Skip to content

Commit 7f75574

Browse files
Merge pull request #105 from Financial-Times/CI-3004-add-identifier-to-certain-blocks-only-rename
CI-3004 Rename blockIdentifier to fragmentIdentifier to align with Spark term…
2 parents 4a98ce9 + 8275704 commit 7f75574

File tree

7 files changed

+70
-70
lines changed

7 files changed

+70
-70
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ interface Heading extends Parent {
246246
type: "heading"
247247
children: Text[]
248248
level: "chapter" | "subheading" | "label"
249-
blockIdentifier?: string
249+
fragmentIdentifier?: string
250250
}
251251
```
252252

@@ -356,7 +356,7 @@ interface ImageSet extends Node {
356356
type: "image-set"
357357
id: string
358358
external picture: ImageSetPicture
359-
blockIdentifier?: string
359+
fragmentIdentifier?: string
360360
}
361361
```
362362

@@ -515,7 +515,7 @@ interface Flourish extends Node {
515515
description?: string
516516
timestamp?: string
517517
external fallbackImage?: Image
518-
blockIdentifier?: string
518+
fragmentIdentifier?: string
519519
}
520520
```
521521

content-tree.d.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export declare namespace ContentTree {
3636
type: "heading";
3737
children: Text[];
3838
level: "chapter" | "subheading" | "label";
39-
blockIdentifier?: string;
39+
fragmentIdentifier?: string;
4040
}
4141
interface Strong extends Parent {
4242
type: "strong";
@@ -78,7 +78,7 @@ export declare namespace ContentTree {
7878
type: "image-set";
7979
id: string;
8080
picture: ImageSetPicture;
81-
blockIdentifier?: string;
81+
fragmentIdentifier?: string;
8282
}
8383
type ImageSetPicture = {
8484
layoutWidth: string;
@@ -158,7 +158,7 @@ export declare namespace ContentTree {
158158
description?: string;
159159
timestamp?: string;
160160
fallbackImage?: Image;
161-
blockIdentifier?: string;
161+
fragmentIdentifier?: string;
162162
}
163163
interface BigNumber extends Node {
164164
type: "big-number";
@@ -314,7 +314,7 @@ export declare namespace ContentTree {
314314
type: "heading";
315315
children: Text[];
316316
level: "chapter" | "subheading" | "label";
317-
blockIdentifier?: string;
317+
fragmentIdentifier?: string;
318318
}
319319
interface Strong extends Parent {
320320
type: "strong";
@@ -356,7 +356,7 @@ export declare namespace ContentTree {
356356
type: "image-set";
357357
id: string;
358358
picture: ImageSetPicture;
359-
blockIdentifier?: string;
359+
fragmentIdentifier?: string;
360360
}
361361
type ImageSetPicture = {
362362
layoutWidth: string;
@@ -436,7 +436,7 @@ export declare namespace ContentTree {
436436
description?: string;
437437
timestamp?: string;
438438
fallbackImage?: Image;
439-
blockIdentifier?: string;
439+
fragmentIdentifier?: string;
440440
}
441441
interface BigNumber extends Node {
442442
type: "big-number";
@@ -593,7 +593,7 @@ export declare namespace ContentTree {
593593
type: "heading";
594594
children: Text[];
595595
level: "chapter" | "subheading" | "label";
596-
blockIdentifier?: string;
596+
fragmentIdentifier?: string;
597597
}
598598
interface Strong extends Parent {
599599
type: "strong";
@@ -634,7 +634,7 @@ export declare namespace ContentTree {
634634
interface ImageSet extends Node {
635635
type: "image-set";
636636
id: string;
637-
blockIdentifier?: string;
637+
fragmentIdentifier?: string;
638638
}
639639
type ImageSetPicture = {
640640
layoutWidth: string;
@@ -711,7 +711,7 @@ export declare namespace ContentTree {
711711
flourishType: string;
712712
description?: string;
713713
timestamp?: string;
714-
blockIdentifier?: string;
714+
fragmentIdentifier?: string;
715715
}
716716
interface BigNumber extends Node {
717717
type: "big-number";
@@ -857,7 +857,7 @@ export declare namespace ContentTree {
857857
type: "heading";
858858
children: Text[];
859859
level: "chapter" | "subheading" | "label";
860-
blockIdentifier?: string;
860+
fragmentIdentifier?: string;
861861
}
862862
interface Strong extends Parent {
863863
type: "strong";
@@ -899,7 +899,7 @@ export declare namespace ContentTree {
899899
type: "image-set";
900900
id: string;
901901
picture?: ImageSetPicture;
902-
blockIdentifier?: string;
902+
fragmentIdentifier?: string;
903903
}
904904
type ImageSetPicture = {
905905
layoutWidth: string;
@@ -979,7 +979,7 @@ export declare namespace ContentTree {
979979
description?: string;
980980
timestamp?: string;
981981
fallbackImage?: Image;
982-
blockIdentifier?: string;
982+
fragmentIdentifier?: string;
983983
}
984984
interface BigNumber extends Node {
985985
type: "big-number";

content_tree.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -586,15 +586,15 @@ func (n *Emphasis) GetChildren() []Node {
586586
}
587587

588588
type Flourish struct {
589-
Type string `json:"type"`
590-
Data interface{} `json:"data,omitempty"`
591-
Description string `json:"description,omitempty"`
592-
FallbackImage *FlourishFallbackImage `json:"fallbackImage,omitempty"`
593-
FlourishType string `json:"flourishType,omitempty"`
594-
Id string `json:"id,omitempty"`
595-
LayoutWidth string `json:"layoutWidth,omitempty"`
596-
Timestamp string `json:"timestamp,omitempty"`
597-
BlockIdentifier string `json:"blockIdentifier,omitempty"`
589+
Type string `json:"type"`
590+
Data interface{} `json:"data,omitempty"`
591+
Description string `json:"description,omitempty"`
592+
FallbackImage *FlourishFallbackImage `json:"fallbackImage,omitempty"`
593+
FlourishType string `json:"flourishType,omitempty"`
594+
Id string `json:"id,omitempty"`
595+
LayoutWidth string `json:"layoutWidth,omitempty"`
596+
Timestamp string `json:"timestamp,omitempty"`
597+
FragmentIdentifier string `json:"fragmentIdentifier,omitempty"`
598598
}
599599

600600
func (n *Flourish) GetType() string {
@@ -625,11 +625,11 @@ type FlourishFallbackImageSourceSetElem struct {
625625
}
626626

627627
type Heading struct {
628-
Type string `json:"type"`
629-
Children []*Text `json:"children,omitempty"`
630-
Data interface{} `json:"data,omitempty"`
631-
Level string `json:"level,omitempty"`
632-
BlockIdentifier string `json:"blockIdentifier,omitempty"`
628+
Type string `json:"type"`
629+
Children []*Text `json:"children,omitempty"`
630+
Data interface{} `json:"data,omitempty"`
631+
Level string `json:"level,omitempty"`
632+
FragmentIdentifier string `json:"fragmentIdentifier,omitempty"`
633633
}
634634

635635
func (n *Heading) GetType() string {
@@ -649,11 +649,11 @@ func (n *Heading) GetChildren() []Node {
649649
}
650650

651651
type ImageSet struct {
652-
Type string `json:"type"`
653-
Data interface{} `json:"data,omitempty"`
654-
ID string `json:"id,omitempty"`
655-
Picture *Picture `json:"picture,omitempty"`
656-
BlockIdentifier string `json:"blockIdentifier,omitempty"`
652+
Type string `json:"type"`
653+
Data interface{} `json:"data,omitempty"`
654+
ID string `json:"id,omitempty"`
655+
Picture *Picture `json:"picture,omitempty"`
656+
FragmentIdentifier string `json:"fragmentIdentifier,omitempty"`
657657
}
658658

659659
func (n *ImageSet) GetType() string {

libraries/from-bodyxml/index.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,44 +56,44 @@ export let defaultTransformers = {
5656
* @type {Transformer<ContentTree.transit.Heading>}
5757
*/
5858
h1(h1) {
59-
const blockId = h1.attributes["data-fragment-id"] || h1.attributes["id"];
59+
const fragmentId = h1.attributes["data-fragment-id"] || h1.attributes["id"];
6060
return {
6161
type: "heading",
6262
level: "chapter",
63-
...(blockId && { blockIdentifier: blockId }),
63+
...(fragmentId && { fragmentIdentifier: fragmentId }),
6464
};
6565
},
6666
/**
6767
* @type {Transformer<ContentTree.transit.Heading>}
6868
*/
6969
h2(h2) {
70-
const blockId = h2.attributes["data-fragment-id"] || h2.attributes["id"];
70+
const fragmentId = h2.attributes["data-fragment-id"] || h2.attributes["id"];
7171
return {
7272
type: "heading",
7373
level: "subheading",
74-
...(blockId && { blockIdentifier: blockId }),
74+
...(fragmentId && { fragmentIdentifier: fragmentId }),
7575
};
7676
},
7777
/**
7878
* @type {Transformer<ContentTree.transit.Heading>}
7979
*/
8080
h3(h3) {
81-
const blockId = h3.attributes["data-fragment-id"] || h3.attributes["id"];
81+
const fragmentId = h3.attributes["data-fragment-id"] || h3.attributes["id"];
8282
return {
8383
type: "heading",
8484
level: "subheading",
85-
...(blockId && { blockIdentifier: blockId }),
85+
...(fragmentId && { fragmentIdentifier: fragmentId }),
8686
};
8787
},
8888
/**
8989
* @type {Transformer<ContentTree.transit.Heading>}
9090
*/
9191
h4(h4) {
92-
const blockId = h4.attributes["data-fragment-id"] || h4.attributes["id"];
92+
const fragmentId = h4.attributes["data-fragment-id"] || h4.attributes["id"];
9393
return {
9494
type: "heading",
9595
level: "label",
96-
...(blockId && { blockIdentifier: blockId }),
96+
...(fragmentId && { fragmentIdentifier: fragmentId }),
9797
};
9898
},
9999
/**
@@ -245,11 +245,11 @@ export let defaultTransformers = {
245245
* @type {Transformer<ContentTree.transit.ImageSet>}
246246
*/
247247
[ContentType.imageset](content) {
248-
const blockId = content.attributes["data-fragment-id"] || content.attributes["id"];
248+
const fragmentId = content.attributes["data-fragment-id"] || content.attributes["id"];
249249
return {
250250
type: "image-set",
251251
id: content.attributes.url ?? "",
252-
...(blockId && { blockIdentifier: blockId }),
252+
...(fragmentId && { fragmentIdentifier: fragmentId }),
253253
children: null,
254254
};
255255
},
@@ -270,7 +270,7 @@ export let defaultTransformers = {
270270
[ContentType.content](content) {
271271
const id = content.attributes.url ?? "";
272272
const uuid = id.split("/").pop();
273-
const blockId = content.attributes["data-fragment-id"] || content.attributes["id"];
273+
const fragmentId = content.attributes["data-fragment-id"] || content.attributes["id"];
274274

275275
if (content.attributes["data-asset-type"] == "flourish") {
276276
return /** @type {ContentTree.transit.Flourish} */ ({
@@ -282,7 +282,7 @@ export let defaultTransformers = {
282282
),
283283
description: content.attributes["alt"] || "",
284284
timestamp: content.attributes["data-time-stamp"] || "",
285-
...(blockId && { blockIdentifier: blockId }),
285+
...(fragmentId && { fragmentIdentifier: fragmentId }),
286286
children: null,
287287
});
288288
}

schemas/body-tree.schema.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,16 @@
188188
"ContentTree.transit.Flourish": {
189189
"additionalProperties": false,
190190
"properties": {
191-
"blockIdentifier": {
192-
"type": "string"
193-
},
194191
"data": {},
195192
"description": {
196193
"type": "string"
197194
},
198195
"flourishType": {
199196
"type": "string"
200197
},
198+
"fragmentIdentifier": {
199+
"type": "string"
200+
},
201201
"id": {
202202
"type": "string"
203203
},
@@ -223,16 +223,16 @@
223223
"ContentTree.transit.Heading": {
224224
"additionalProperties": false,
225225
"properties": {
226-
"blockIdentifier": {
227-
"type": "string"
228-
},
229226
"children": {
230227
"items": {
231228
"$ref": "#/definitions/ContentTree.transit.Text"
232229
},
233230
"type": "array"
234231
},
235232
"data": {},
233+
"fragmentIdentifier": {
234+
"type": "string"
235+
},
236236
"level": {
237237
"enum": [
238238
"chapter",
@@ -256,10 +256,10 @@
256256
"ContentTree.transit.ImageSet": {
257257
"additionalProperties": false,
258258
"properties": {
259-
"blockIdentifier": {
259+
"data": {},
260+
"fragmentIdentifier": {
260261
"type": "string"
261262
},
262-
"data": {},
263263
"id": {
264264
"type": "string"
265265
},

schemas/content-tree.schema.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,6 @@
239239
"ContentTree.full.Flourish": {
240240
"additionalProperties": false,
241241
"properties": {
242-
"blockIdentifier": {
243-
"type": "string"
244-
},
245242
"data": {},
246243
"description": {
247244
"type": "string"
@@ -309,6 +306,9 @@
309306
"flourishType": {
310307
"type": "string"
311308
},
309+
"fragmentIdentifier": {
310+
"type": "string"
311+
},
312312
"id": {
313313
"type": "string"
314314
},
@@ -334,16 +334,16 @@
334334
"ContentTree.full.Heading": {
335335
"additionalProperties": false,
336336
"properties": {
337-
"blockIdentifier": {
338-
"type": "string"
339-
},
340337
"children": {
341338
"items": {
342339
"$ref": "#/definitions/ContentTree.full.Text"
343340
},
344341
"type": "array"
345342
},
346343
"data": {},
344+
"fragmentIdentifier": {
345+
"type": "string"
346+
},
347347
"level": {
348348
"enum": [
349349
"chapter",
@@ -367,10 +367,10 @@
367367
"ContentTree.full.ImageSet": {
368368
"additionalProperties": false,
369369
"properties": {
370-
"blockIdentifier": {
370+
"data": {},
371+
"fragmentIdentifier": {
371372
"type": "string"
372373
},
373-
"data": {},
374374
"id": {
375375
"type": "string"
376376
},

0 commit comments

Comments
 (0)