article-content-renderer-vue2 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,939 @@
1
+ {
2
+ "fileFormat": "article-content-protocol",
3
+ "fileFormatVersion": 1,
4
+ "mediaType": "application/vnd.article-content-protocol+json",
5
+ "id": "article-content-v1",
6
+ "version": 1,
7
+ "name": "Article Content Protocol v1",
8
+ "status": "draft",
9
+ "rootNode": "doc",
10
+ "nodes": [
11
+ {
12
+ "type": "doc",
13
+ "kind": "root",
14
+ "description": "Document root; render its children without adding a semantic element.",
15
+ "contentModel": "block*",
16
+ "attributes": [],
17
+ "render": {
18
+ "mode": "fragment"
19
+ }
20
+ },
21
+ {
22
+ "type": "paragraph",
23
+ "kind": "block",
24
+ "description": "A paragraph of inline text.",
25
+ "contentModel": "text*",
26
+ "attributes": [
27
+ {
28
+ "name": "textAlign",
29
+ "type": "string",
30
+ "required": false,
31
+ "description": "Block text alignment. When omitted, use the renderer's default alignment.",
32
+ "allowedValues": [
33
+ "left",
34
+ "center",
35
+ "right",
36
+ "justify"
37
+ ]
38
+ }
39
+ ],
40
+ "render": {
41
+ "mode": "element",
42
+ "element": "p",
43
+ "styleBindings": {
44
+ "textAlign": "text-align"
45
+ }
46
+ }
47
+ },
48
+ {
49
+ "type": "heading",
50
+ "kind": "block",
51
+ "description": "A semantic heading from h1 through h6.",
52
+ "contentModel": "text*",
53
+ "attributes": [
54
+ {
55
+ "name": "level",
56
+ "type": "integer",
57
+ "required": true,
58
+ "description": "Semantic heading level.",
59
+ "allowedValues": [
60
+ 1,
61
+ 2,
62
+ 3,
63
+ 4,
64
+ 5,
65
+ 6
66
+ ],
67
+ "minimum": 1,
68
+ "maximum": 6
69
+ },
70
+ {
71
+ "name": "textAlign",
72
+ "type": "string",
73
+ "required": false,
74
+ "description": "Block text alignment. When omitted, use the renderer's default alignment.",
75
+ "allowedValues": [
76
+ "left",
77
+ "center",
78
+ "right",
79
+ "justify"
80
+ ]
81
+ }
82
+ ],
83
+ "render": {
84
+ "mode": "dynamic-element",
85
+ "attribute": "level",
86
+ "prefix": "h",
87
+ "allowedElements": [
88
+ "h1",
89
+ "h2",
90
+ "h3",
91
+ "h4",
92
+ "h5",
93
+ "h6"
94
+ ],
95
+ "styleBindings": {
96
+ "textAlign": "text-align"
97
+ }
98
+ }
99
+ },
100
+ {
101
+ "type": "blockquote",
102
+ "kind": "block",
103
+ "description": "A quoted group of block nodes.",
104
+ "contentModel": "block+",
105
+ "attributes": [],
106
+ "render": {
107
+ "mode": "element",
108
+ "element": "blockquote"
109
+ }
110
+ },
111
+ {
112
+ "type": "bulletList",
113
+ "kind": "block",
114
+ "description": "An unordered list.",
115
+ "contentModel": "listItem+",
116
+ "attributes": [],
117
+ "render": {
118
+ "mode": "element",
119
+ "element": "ul"
120
+ }
121
+ },
122
+ {
123
+ "type": "orderedList",
124
+ "kind": "block",
125
+ "description": "An ordered list with a one-based start value.",
126
+ "contentModel": "listItem+",
127
+ "attributes": [
128
+ {
129
+ "name": "start",
130
+ "type": "integer",
131
+ "required": true,
132
+ "description": "First visible list number.",
133
+ "defaultValue": 1,
134
+ "minimum": 1
135
+ }
136
+ ],
137
+ "render": {
138
+ "mode": "element",
139
+ "element": "ol",
140
+ "attributeBindings": {
141
+ "start": "start"
142
+ }
143
+ }
144
+ },
145
+ {
146
+ "type": "listItem",
147
+ "kind": "block",
148
+ "description": "A list item containing one or more block nodes.",
149
+ "contentModel": "block+",
150
+ "attributes": [],
151
+ "render": {
152
+ "mode": "element",
153
+ "element": "li"
154
+ }
155
+ },
156
+ {
157
+ "type": "codeBlock",
158
+ "kind": "block",
159
+ "description": "A preformatted code block with an optional language identifier.",
160
+ "contentModel": "text?",
161
+ "attributes": [
162
+ {
163
+ "name": "language",
164
+ "type": "string",
165
+ "required": false,
166
+ "description": "Lowercase language identifier used for syntax highlighting."
167
+ }
168
+ ],
169
+ "render": {
170
+ "mode": "element",
171
+ "element": "pre",
172
+ "contentElement": "code",
173
+ "attributeBindings": {
174
+ "language": "data-language"
175
+ }
176
+ }
177
+ },
178
+ {
179
+ "type": "horizontalRule",
180
+ "kind": "block",
181
+ "description": "A thematic break.",
182
+ "contentModel": "none",
183
+ "attributes": [],
184
+ "render": {
185
+ "mode": "element",
186
+ "element": "hr",
187
+ "void": true
188
+ }
189
+ },
190
+ {
191
+ "type": "image",
192
+ "kind": "block",
193
+ "description": "A block image with optional horizontal alignment in the article content column.",
194
+ "contentModel": "none",
195
+ "attributes": [
196
+ {
197
+ "name": "src",
198
+ "type": "string",
199
+ "required": true,
200
+ "description": "Image URL or relative path."
201
+ },
202
+ {
203
+ "name": "alt",
204
+ "type": "string",
205
+ "required": false,
206
+ "description": "Alternative text."
207
+ },
208
+ {
209
+ "name": "title",
210
+ "type": "string",
211
+ "required": false,
212
+ "description": "Optional image title."
213
+ },
214
+ {
215
+ "name": "width",
216
+ "type": "integer",
217
+ "required": false,
218
+ "description": "Intrinsic width in pixels.",
219
+ "minimum": 1,
220
+ "maximum": 10000
221
+ },
222
+ {
223
+ "name": "height",
224
+ "type": "integer",
225
+ "required": false,
226
+ "description": "Intrinsic height in pixels.",
227
+ "minimum": 1,
228
+ "maximum": 10000
229
+ },
230
+ {
231
+ "name": "imageAlign",
232
+ "type": "string",
233
+ "required": false,
234
+ "description": "Horizontal image alignment. Renderers must use a layout container; omission means center.",
235
+ "defaultValue": "center",
236
+ "allowedValues": [
237
+ "left",
238
+ "center",
239
+ "right"
240
+ ]
241
+ }
242
+ ],
243
+ "render": {
244
+ "mode": "element",
245
+ "element": "img",
246
+ "void": true,
247
+ "attributeBindings": {
248
+ "src": "src",
249
+ "alt": "alt",
250
+ "title": "title",
251
+ "width": "width",
252
+ "height": "height",
253
+ "imageAlign": "data-image-align"
254
+ }
255
+ }
256
+ },
257
+ {
258
+ "type": "articleButton",
259
+ "kind": "block",
260
+ "description": "An article action button identified by a business id and displayed with its text.",
261
+ "contentModel": "none",
262
+ "attributes": [
263
+ {
264
+ "name": "id",
265
+ "type": "string",
266
+ "required": true,
267
+ "description": "Business identifier used by the consuming application to handle the action."
268
+ },
269
+ {
270
+ "name": "title",
271
+ "type": "string",
272
+ "required": false,
273
+ "description": "Descriptive title or tooltip."
274
+ },
275
+ {
276
+ "name": "text",
277
+ "type": "string",
278
+ "required": true,
279
+ "description": "Visible button text."
280
+ },
281
+ {
282
+ "name": "style",
283
+ "type": "string",
284
+ "required": true,
285
+ "description": "Controlled visual variant: text is rendered as a text-like action; button as a button-like action.",
286
+ "allowedValues": [
287
+ "text",
288
+ "button"
289
+ ]
290
+ }
291
+ ],
292
+ "render": {
293
+ "mode": "element",
294
+ "element": "button",
295
+ "textBinding": "text",
296
+ "attributeBindings": {
297
+ "id": "data-article-button-id",
298
+ "title": "title",
299
+ "style": "data-article-button-style"
300
+ }
301
+ }
302
+ },
303
+ {
304
+ "type": "table",
305
+ "kind": "table",
306
+ "description": "A basic semantic table without presentation attributes.",
307
+ "contentModel": "tableRow+",
308
+ "attributes": [],
309
+ "constraints": [
310
+ {
311
+ "name": "uniform-table-columns",
312
+ "description": "Every tableRow in the same table must contain the same number of tableCell nodes."
313
+ }
314
+ ],
315
+ "render": {
316
+ "mode": "element",
317
+ "element": "table"
318
+ }
319
+ },
320
+ {
321
+ "type": "tableRow",
322
+ "kind": "table",
323
+ "description": "A table row.",
324
+ "contentModel": "tableCell+",
325
+ "attributes": [],
326
+ "render": {
327
+ "mode": "element",
328
+ "element": "tr"
329
+ }
330
+ },
331
+ {
332
+ "type": "tableCell",
333
+ "kind": "table",
334
+ "description": "A table cell containing block nodes. v1 does not distinguish header cells.",
335
+ "contentModel": "block+",
336
+ "attributes": [],
337
+ "render": {
338
+ "mode": "element",
339
+ "element": "td"
340
+ }
341
+ },
342
+ {
343
+ "type": "text",
344
+ "kind": "inline",
345
+ "description": "A text leaf; escape its value before producing HTML.",
346
+ "contentModel": "none",
347
+ "attributes": [],
348
+ "render": {
349
+ "mode": "text"
350
+ }
351
+ }
352
+ ],
353
+ "marks": [
354
+ {
355
+ "type": "bold",
356
+ "description": "Strong importance.",
357
+ "attributes": [],
358
+ "render": {
359
+ "mode": "element",
360
+ "element": "strong"
361
+ }
362
+ },
363
+ {
364
+ "type": "italic",
365
+ "description": "Emphasized text.",
366
+ "attributes": [],
367
+ "render": {
368
+ "mode": "element",
369
+ "element": "em"
370
+ }
371
+ },
372
+ {
373
+ "type": "strike",
374
+ "description": "Deleted or no-longer-valid text.",
375
+ "attributes": [],
376
+ "render": {
377
+ "mode": "element",
378
+ "element": "s"
379
+ }
380
+ },
381
+ {
382
+ "type": "underline",
383
+ "description": "Underlined text.",
384
+ "attributes": [],
385
+ "render": {
386
+ "mode": "element",
387
+ "element": "u"
388
+ }
389
+ },
390
+ {
391
+ "type": "code",
392
+ "description": "Inline code.",
393
+ "attributes": [],
394
+ "render": {
395
+ "mode": "element",
396
+ "element": "code"
397
+ }
398
+ },
399
+ {
400
+ "type": "link",
401
+ "description": "A hyperlink. Renderers must validate and escape the URL.",
402
+ "attributes": [
403
+ {
404
+ "name": "href",
405
+ "type": "string",
406
+ "required": true,
407
+ "description": "Link destination."
408
+ },
409
+ {
410
+ "name": "target",
411
+ "type": "string",
412
+ "required": true,
413
+ "description": "Browsing context.",
414
+ "defaultValue": "_blank",
415
+ "allowedValues": [
416
+ "_blank",
417
+ "_self"
418
+ ]
419
+ }
420
+ ],
421
+ "render": {
422
+ "mode": "element",
423
+ "element": "a",
424
+ "attributeBindings": {
425
+ "href": "href",
426
+ "target": "target"
427
+ }
428
+ }
429
+ }
430
+ ],
431
+ "documentSchema": {
432
+ "$schema": "http://json-schema.org/draft-07/schema#",
433
+ "$id": "urn:article-content-protocol:v1",
434
+ "title": "Article Content Protocol v1",
435
+ "type": "object",
436
+ "additionalProperties": false,
437
+ "required": [
438
+ "type",
439
+ "content"
440
+ ],
441
+ "properties": {
442
+ "type": {
443
+ "const": "doc"
444
+ },
445
+ "content": {
446
+ "type": "array",
447
+ "items": {
448
+ "$ref": "#/definitions/blockNode"
449
+ }
450
+ }
451
+ },
452
+ "definitions": {
453
+ "blockNode": {
454
+ "oneOf": [
455
+ {
456
+ "$ref": "#/definitions/paragraph"
457
+ },
458
+ {
459
+ "$ref": "#/definitions/heading"
460
+ },
461
+ {
462
+ "$ref": "#/definitions/blockquote"
463
+ },
464
+ {
465
+ "$ref": "#/definitions/bulletList"
466
+ },
467
+ {
468
+ "$ref": "#/definitions/orderedList"
469
+ },
470
+ {
471
+ "$ref": "#/definitions/codeBlock"
472
+ },
473
+ {
474
+ "$ref": "#/definitions/horizontalRule"
475
+ },
476
+ {
477
+ "$ref": "#/definitions/image"
478
+ },
479
+ {
480
+ "$ref": "#/definitions/articleButton"
481
+ },
482
+ {
483
+ "$ref": "#/definitions/table"
484
+ }
485
+ ]
486
+ },
487
+ "paragraph": {
488
+ "type": "object",
489
+ "additionalProperties": false,
490
+ "required": [
491
+ "type"
492
+ ],
493
+ "properties": {
494
+ "type": {
495
+ "const": "paragraph"
496
+ },
497
+ "attrs": {
498
+ "type": "object",
499
+ "additionalProperties": false,
500
+ "properties": {
501
+ "textAlign": {
502
+ "$ref": "#/definitions/textAlign"
503
+ }
504
+ }
505
+ },
506
+ "content": {
507
+ "type": "array",
508
+ "items": {
509
+ "$ref": "#/definitions/text"
510
+ }
511
+ }
512
+ }
513
+ },
514
+ "heading": {
515
+ "type": "object",
516
+ "additionalProperties": false,
517
+ "required": [
518
+ "type",
519
+ "attrs"
520
+ ],
521
+ "properties": {
522
+ "type": {
523
+ "const": "heading"
524
+ },
525
+ "attrs": {
526
+ "type": "object",
527
+ "additionalProperties": false,
528
+ "required": [
529
+ "level"
530
+ ],
531
+ "properties": {
532
+ "level": {
533
+ "type": "integer",
534
+ "minimum": 1,
535
+ "maximum": 6
536
+ },
537
+ "textAlign": {
538
+ "$ref": "#/definitions/textAlign"
539
+ }
540
+ }
541
+ },
542
+ "content": {
543
+ "type": "array",
544
+ "items": {
545
+ "$ref": "#/definitions/text"
546
+ }
547
+ }
548
+ }
549
+ },
550
+ "blockquote": {
551
+ "type": "object",
552
+ "additionalProperties": false,
553
+ "required": [
554
+ "type",
555
+ "content"
556
+ ],
557
+ "properties": {
558
+ "type": {
559
+ "const": "blockquote"
560
+ },
561
+ "content": {
562
+ "type": "array",
563
+ "items": {
564
+ "$ref": "#/definitions/blockNode"
565
+ }
566
+ }
567
+ }
568
+ },
569
+ "bulletList": {
570
+ "type": "object",
571
+ "additionalProperties": false,
572
+ "required": [
573
+ "type",
574
+ "content"
575
+ ],
576
+ "properties": {
577
+ "type": {
578
+ "const": "bulletList"
579
+ },
580
+ "content": {
581
+ "type": "array",
582
+ "items": {
583
+ "$ref": "#/definitions/listItem"
584
+ }
585
+ }
586
+ }
587
+ },
588
+ "orderedList": {
589
+ "type": "object",
590
+ "additionalProperties": false,
591
+ "required": [
592
+ "type",
593
+ "attrs",
594
+ "content"
595
+ ],
596
+ "properties": {
597
+ "type": {
598
+ "const": "orderedList"
599
+ },
600
+ "attrs": {
601
+ "type": "object",
602
+ "additionalProperties": false,
603
+ "required": [
604
+ "start"
605
+ ],
606
+ "properties": {
607
+ "start": {
608
+ "type": "integer",
609
+ "minimum": 1
610
+ }
611
+ }
612
+ },
613
+ "content": {
614
+ "type": "array",
615
+ "items": {
616
+ "$ref": "#/definitions/listItem"
617
+ }
618
+ }
619
+ }
620
+ },
621
+ "listItem": {
622
+ "type": "object",
623
+ "additionalProperties": false,
624
+ "required": [
625
+ "type",
626
+ "content"
627
+ ],
628
+ "properties": {
629
+ "type": {
630
+ "const": "listItem"
631
+ },
632
+ "content": {
633
+ "type": "array",
634
+ "items": {
635
+ "$ref": "#/definitions/blockNode"
636
+ }
637
+ }
638
+ }
639
+ },
640
+ "codeBlock": {
641
+ "type": "object",
642
+ "additionalProperties": false,
643
+ "required": [
644
+ "type",
645
+ "attrs"
646
+ ],
647
+ "properties": {
648
+ "type": {
649
+ "const": "codeBlock"
650
+ },
651
+ "attrs": {
652
+ "type": "object",
653
+ "additionalProperties": false,
654
+ "properties": {
655
+ "language": {
656
+ "type": "string",
657
+ "minLength": 1,
658
+ "maxLength": 32
659
+ }
660
+ }
661
+ },
662
+ "content": {
663
+ "type": "array",
664
+ "items": {
665
+ "type": "object",
666
+ "additionalProperties": false,
667
+ "required": [
668
+ "type",
669
+ "text"
670
+ ],
671
+ "properties": {
672
+ "type": {
673
+ "const": "text"
674
+ },
675
+ "text": {
676
+ "type": "string",
677
+ "minLength": 1
678
+ }
679
+ }
680
+ }
681
+ }
682
+ }
683
+ },
684
+ "horizontalRule": {
685
+ "type": "object",
686
+ "additionalProperties": false,
687
+ "required": [
688
+ "type"
689
+ ],
690
+ "properties": {
691
+ "type": {
692
+ "const": "horizontalRule"
693
+ }
694
+ }
695
+ },
696
+ "image": {
697
+ "type": "object",
698
+ "additionalProperties": false,
699
+ "required": [
700
+ "type",
701
+ "attrs"
702
+ ],
703
+ "properties": {
704
+ "type": {
705
+ "const": "image"
706
+ },
707
+ "attrs": {
708
+ "type": "object",
709
+ "additionalProperties": false,
710
+ "required": [
711
+ "src"
712
+ ],
713
+ "properties": {
714
+ "src": {
715
+ "type": "string",
716
+ "minLength": 1
717
+ },
718
+ "alt": {
719
+ "type": "string"
720
+ },
721
+ "title": {
722
+ "type": "string"
723
+ },
724
+ "width": {
725
+ "type": "integer",
726
+ "minimum": 1,
727
+ "maximum": 10000
728
+ },
729
+ "height": {
730
+ "type": "integer",
731
+ "minimum": 1,
732
+ "maximum": 10000
733
+ },
734
+ "imageAlign": {
735
+ "$ref": "#/definitions/imageAlign"
736
+ }
737
+ }
738
+ }
739
+ }
740
+ },
741
+ "articleButton": {
742
+ "type": "object",
743
+ "additionalProperties": false,
744
+ "required": [
745
+ "type",
746
+ "attrs"
747
+ ],
748
+ "properties": {
749
+ "type": {
750
+ "const": "articleButton"
751
+ },
752
+ "attrs": {
753
+ "type": "object",
754
+ "additionalProperties": false,
755
+ "required": [
756
+ "id",
757
+ "text",
758
+ "style"
759
+ ],
760
+ "properties": {
761
+ "id": {
762
+ "type": "string",
763
+ "minLength": 1
764
+ },
765
+ "title": {
766
+ "type": "string",
767
+ "minLength": 1
768
+ },
769
+ "text": {
770
+ "type": "string",
771
+ "minLength": 1
772
+ },
773
+ "style": {
774
+ "enum": [
775
+ "text",
776
+ "button"
777
+ ]
778
+ }
779
+ }
780
+ }
781
+ }
782
+ },
783
+ "table": {
784
+ "type": "object",
785
+ "additionalProperties": false,
786
+ "required": [
787
+ "type",
788
+ "content"
789
+ ],
790
+ "properties": {
791
+ "type": {
792
+ "const": "table"
793
+ },
794
+ "content": {
795
+ "type": "array",
796
+ "items": {
797
+ "$ref": "#/definitions/tableRow"
798
+ }
799
+ }
800
+ }
801
+ },
802
+ "tableRow": {
803
+ "type": "object",
804
+ "additionalProperties": false,
805
+ "required": [
806
+ "type",
807
+ "content"
808
+ ],
809
+ "properties": {
810
+ "type": {
811
+ "const": "tableRow"
812
+ },
813
+ "content": {
814
+ "type": "array",
815
+ "items": {
816
+ "$ref": "#/definitions/tableCell"
817
+ }
818
+ }
819
+ }
820
+ },
821
+ "tableCell": {
822
+ "type": "object",
823
+ "additionalProperties": false,
824
+ "required": [
825
+ "type",
826
+ "content"
827
+ ],
828
+ "properties": {
829
+ "type": {
830
+ "const": "tableCell"
831
+ },
832
+ "content": {
833
+ "type": "array",
834
+ "items": {
835
+ "$ref": "#/definitions/blockNode"
836
+ }
837
+ }
838
+ }
839
+ },
840
+ "text": {
841
+ "type": "object",
842
+ "additionalProperties": false,
843
+ "required": [
844
+ "type",
845
+ "text"
846
+ ],
847
+ "properties": {
848
+ "type": {
849
+ "const": "text"
850
+ },
851
+ "text": {
852
+ "type": "string",
853
+ "minLength": 1
854
+ },
855
+ "marks": {
856
+ "type": "array",
857
+ "items": {
858
+ "$ref": "#/definitions/mark"
859
+ }
860
+ }
861
+ }
862
+ },
863
+ "textAlign": {
864
+ "type": "string",
865
+ "enum": [
866
+ "left",
867
+ "center",
868
+ "right",
869
+ "justify"
870
+ ]
871
+ },
872
+ "imageAlign": {
873
+ "type": "string",
874
+ "enum": [
875
+ "left",
876
+ "center",
877
+ "right"
878
+ ]
879
+ },
880
+ "mark": {
881
+ "oneOf": [
882
+ {
883
+ "type": "object",
884
+ "additionalProperties": false,
885
+ "required": [
886
+ "type"
887
+ ],
888
+ "properties": {
889
+ "type": {
890
+ "enum": [
891
+ "bold",
892
+ "italic",
893
+ "strike",
894
+ "underline",
895
+ "code"
896
+ ]
897
+ }
898
+ }
899
+ },
900
+ {
901
+ "type": "object",
902
+ "additionalProperties": false,
903
+ "required": [
904
+ "type",
905
+ "attrs"
906
+ ],
907
+ "properties": {
908
+ "type": {
909
+ "const": "link"
910
+ },
911
+ "attrs": {
912
+ "type": "object",
913
+ "additionalProperties": false,
914
+ "required": [
915
+ "href",
916
+ "target"
917
+ ],
918
+ "properties": {
919
+ "href": {
920
+ "type": "string",
921
+ "minLength": 1
922
+ },
923
+ "target": {
924
+ "enum": [
925
+ "_blank",
926
+ "_self"
927
+ ]
928
+ }
929
+ }
930
+ }
931
+ }
932
+ }
933
+ ]
934
+ }
935
+ }
936
+ }
937
+ }
938
+
939
+