@kubuild/schema 0.6.0 → 0.8.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.
- package/README.md +24 -0
- package/dist/actions.d.ts +26 -2
- package/dist/actions.d.ts.map +1 -1
- package/dist/breakpoints.d.ts +35 -0
- package/dist/breakpoints.d.ts.map +1 -0
- package/dist/builtin-components.d.ts +17 -0
- package/dist/builtin-components.d.ts.map +1 -0
- package/dist/canonical-props.d.ts +39 -0
- package/dist/canonical-props.d.ts.map +1 -0
- package/dist/chunk-MT3M7D67.js +1041 -0
- package/dist/chunk-MT3M7D67.js.map +1 -0
- package/dist/chunk-PECTZDCI.js +1038 -0
- package/dist/chunk-PECTZDCI.js.map +1 -0
- package/dist/document.d.ts +21 -82
- package/dist/document.d.ts.map +1 -1
- package/dist/index.cjs +700 -169
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +447 -747
- package/dist/index.js.map +1 -1
- package/dist/json-schema.d.ts +323 -10
- package/dist/json-schema.d.ts.map +1 -1
- package/dist/template.d.ts +6 -18
- package/dist/template.d.ts.map +1 -1
- package/dist/theme.d.ts +80 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/tracking.d.ts +178 -31
- package/dist/tracking.d.ts.map +1 -1
- package/dist/types.cjs +19 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.ts +331 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -0
- package/dist/validate.cjs +715 -0
- package/dist/validate.cjs.map +1 -0
- package/dist/validate.d.ts +16 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +53 -0
- package/dist/validate.js.map +1 -0
- package/package.json +22 -2
package/dist/json-schema.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare const PAGE_DOCUMENT_JSON_SCHEMA_V1: {
|
|
|
20
20
|
readonly type: "string";
|
|
21
21
|
readonly pattern: "^\\d+(\\.\\d+)*$";
|
|
22
22
|
readonly description: "Schema version of the document";
|
|
23
|
-
readonly default: "1.
|
|
23
|
+
readonly default: "1.2.0";
|
|
24
24
|
};
|
|
25
25
|
readonly metadata: {
|
|
26
26
|
readonly $ref: "#/definitions/documentMetadata";
|
|
@@ -28,8 +28,159 @@ export declare const PAGE_DOCUMENT_JSON_SCHEMA_V1: {
|
|
|
28
28
|
readonly document: {
|
|
29
29
|
readonly $ref: "#/definitions/rootPageNode";
|
|
30
30
|
};
|
|
31
|
+
readonly tracking: {
|
|
32
|
+
readonly $ref: "#/definitions/trackingConfig";
|
|
33
|
+
};
|
|
34
|
+
readonly theme: {
|
|
35
|
+
readonly $ref: "#/definitions/theme";
|
|
36
|
+
};
|
|
31
37
|
};
|
|
32
38
|
readonly definitions: {
|
|
39
|
+
readonly themeTokenMap: {
|
|
40
|
+
readonly type: "object";
|
|
41
|
+
readonly propertyNames: {
|
|
42
|
+
readonly pattern: "^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$";
|
|
43
|
+
};
|
|
44
|
+
readonly additionalProperties: {
|
|
45
|
+
readonly type: readonly ["string", "number"];
|
|
46
|
+
readonly maxLength: 512;
|
|
47
|
+
readonly pattern: "^[^;{}<>\\\\]*$";
|
|
48
|
+
};
|
|
49
|
+
readonly description: "Design tokens keyed by name. Values must not contain ; { } < > or backslashes.";
|
|
50
|
+
};
|
|
51
|
+
readonly theme: {
|
|
52
|
+
readonly type: "object";
|
|
53
|
+
readonly description: "Document design tokens, emitted as CSS custom properties (--kb-color-*, --kb-font-*, --kb-radius-*, --kb-space-*) and referenced from styles as var(--kb-color-<key>).";
|
|
54
|
+
readonly properties: {
|
|
55
|
+
readonly colors: {
|
|
56
|
+
readonly $ref: "#/definitions/themeTokenMap";
|
|
57
|
+
};
|
|
58
|
+
readonly fonts: {
|
|
59
|
+
readonly $ref: "#/definitions/themeTokenMap";
|
|
60
|
+
};
|
|
61
|
+
readonly radii: {
|
|
62
|
+
readonly $ref: "#/definitions/themeTokenMap";
|
|
63
|
+
};
|
|
64
|
+
readonly spacing: {
|
|
65
|
+
readonly $ref: "#/definitions/themeTokenMap";
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
readonly additionalProperties: false;
|
|
69
|
+
};
|
|
70
|
+
readonly trackingConfig: {
|
|
71
|
+
readonly type: "object";
|
|
72
|
+
readonly description: "Tracking configuration. Contains only public ids, flags and opaque credential ids — secrets are host-owned.";
|
|
73
|
+
readonly properties: {
|
|
74
|
+
readonly enabled: {
|
|
75
|
+
readonly type: "boolean";
|
|
76
|
+
readonly default: true;
|
|
77
|
+
};
|
|
78
|
+
readonly debugMode: {
|
|
79
|
+
readonly type: "boolean";
|
|
80
|
+
readonly default: false;
|
|
81
|
+
};
|
|
82
|
+
readonly autoPageView: {
|
|
83
|
+
readonly type: "boolean";
|
|
84
|
+
readonly default: true;
|
|
85
|
+
};
|
|
86
|
+
readonly defaultDelivery: {
|
|
87
|
+
readonly type: "string";
|
|
88
|
+
readonly enum: readonly ["both", "client_only", "server_only"];
|
|
89
|
+
readonly default: "both";
|
|
90
|
+
};
|
|
91
|
+
readonly providers: {
|
|
92
|
+
readonly type: "object";
|
|
93
|
+
readonly properties: {
|
|
94
|
+
readonly meta: {
|
|
95
|
+
readonly type: "object";
|
|
96
|
+
readonly properties: {
|
|
97
|
+
readonly enabled: {
|
|
98
|
+
readonly type: "boolean";
|
|
99
|
+
};
|
|
100
|
+
readonly credentialId: {
|
|
101
|
+
readonly type: "string";
|
|
102
|
+
};
|
|
103
|
+
readonly pixelId: {
|
|
104
|
+
readonly type: "string";
|
|
105
|
+
};
|
|
106
|
+
readonly capiEnabled: {
|
|
107
|
+
readonly type: "boolean";
|
|
108
|
+
};
|
|
109
|
+
readonly testEventCode: {
|
|
110
|
+
readonly type: "string";
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
readonly additionalProperties: false;
|
|
114
|
+
};
|
|
115
|
+
readonly google: {
|
|
116
|
+
readonly type: "object";
|
|
117
|
+
readonly properties: {
|
|
118
|
+
readonly enabled: {
|
|
119
|
+
readonly type: "boolean";
|
|
120
|
+
};
|
|
121
|
+
readonly credentialId: {
|
|
122
|
+
readonly type: "string";
|
|
123
|
+
};
|
|
124
|
+
readonly measurementId: {
|
|
125
|
+
readonly type: "string";
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
readonly additionalProperties: false;
|
|
129
|
+
};
|
|
130
|
+
readonly gtm: {
|
|
131
|
+
readonly type: "object";
|
|
132
|
+
readonly properties: {
|
|
133
|
+
readonly enabled: {
|
|
134
|
+
readonly type: "boolean";
|
|
135
|
+
};
|
|
136
|
+
readonly credentialId: {
|
|
137
|
+
readonly type: "string";
|
|
138
|
+
};
|
|
139
|
+
readonly containerId: {
|
|
140
|
+
readonly type: "string";
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
readonly additionalProperties: false;
|
|
144
|
+
};
|
|
145
|
+
readonly tiktok: {
|
|
146
|
+
readonly type: "object";
|
|
147
|
+
readonly properties: {
|
|
148
|
+
readonly enabled: {
|
|
149
|
+
readonly type: "boolean";
|
|
150
|
+
};
|
|
151
|
+
readonly credentialId: {
|
|
152
|
+
readonly type: "string";
|
|
153
|
+
};
|
|
154
|
+
readonly pixelId: {
|
|
155
|
+
readonly type: "string";
|
|
156
|
+
};
|
|
157
|
+
readonly eventsApiEnabled: {
|
|
158
|
+
readonly type: "boolean";
|
|
159
|
+
};
|
|
160
|
+
readonly testEventCode: {
|
|
161
|
+
readonly type: "string";
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
readonly additionalProperties: false;
|
|
165
|
+
};
|
|
166
|
+
readonly custom: {
|
|
167
|
+
readonly type: "object";
|
|
168
|
+
readonly properties: {
|
|
169
|
+
readonly enabled: {
|
|
170
|
+
readonly type: "boolean";
|
|
171
|
+
};
|
|
172
|
+
readonly credentialId: {
|
|
173
|
+
readonly type: "string";
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
readonly additionalProperties: false;
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
readonly additionalProperties: false;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
readonly additionalProperties: false;
|
|
183
|
+
};
|
|
33
184
|
readonly styleValue: {
|
|
34
185
|
readonly type: readonly ["string", "number", "boolean", "null"];
|
|
35
186
|
readonly description: "A CSS property or design token value";
|
|
@@ -169,7 +320,7 @@ export declare const PAGE_DOCUMENT_JSON_SCHEMA_V1: {
|
|
|
169
320
|
};
|
|
170
321
|
readonly type: {
|
|
171
322
|
readonly type: "string";
|
|
172
|
-
readonly enum: readonly ["api_request", "navigate", "set_state", "reset_form", "show_toast", "open_modal", "close_modal", "copy_clipboard", "custom_event"];
|
|
323
|
+
readonly enum: readonly ["api_request", "navigate", "set_state", "reset_form", "show_toast", "open_modal", "close_modal", "toggle_modal", "copy_clipboard", "custom_event", "track_event"];
|
|
173
324
|
};
|
|
174
325
|
readonly label: {
|
|
175
326
|
readonly type: "string";
|
|
@@ -225,7 +376,7 @@ export declare const PAGE_DOCUMENT_JSON_SCHEMA_V1: {
|
|
|
225
376
|
};
|
|
226
377
|
readonly trigger: {
|
|
227
378
|
readonly type: "string";
|
|
228
|
-
readonly enum: readonly ["click", "submit", "change", "blur", "focus", "load"];
|
|
379
|
+
readonly enum: readonly ["click", "submit", "change", "blur", "focus", "load", "expire"];
|
|
229
380
|
};
|
|
230
381
|
readonly label: {
|
|
231
382
|
readonly type: "string";
|
|
@@ -404,7 +555,7 @@ export declare function getPageDocumentJsonSchema(): {
|
|
|
404
555
|
readonly type: "string";
|
|
405
556
|
readonly pattern: "^\\d+(\\.\\d+)*$";
|
|
406
557
|
readonly description: "Schema version of the document";
|
|
407
|
-
readonly default: "1.
|
|
558
|
+
readonly default: "1.2.0";
|
|
408
559
|
};
|
|
409
560
|
readonly metadata: {
|
|
410
561
|
readonly $ref: "#/definitions/documentMetadata";
|
|
@@ -412,8 +563,159 @@ export declare function getPageDocumentJsonSchema(): {
|
|
|
412
563
|
readonly document: {
|
|
413
564
|
readonly $ref: "#/definitions/rootPageNode";
|
|
414
565
|
};
|
|
566
|
+
readonly tracking: {
|
|
567
|
+
readonly $ref: "#/definitions/trackingConfig";
|
|
568
|
+
};
|
|
569
|
+
readonly theme: {
|
|
570
|
+
readonly $ref: "#/definitions/theme";
|
|
571
|
+
};
|
|
415
572
|
};
|
|
416
573
|
readonly definitions: {
|
|
574
|
+
readonly themeTokenMap: {
|
|
575
|
+
readonly type: "object";
|
|
576
|
+
readonly propertyNames: {
|
|
577
|
+
readonly pattern: "^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$";
|
|
578
|
+
};
|
|
579
|
+
readonly additionalProperties: {
|
|
580
|
+
readonly type: readonly ["string", "number"];
|
|
581
|
+
readonly maxLength: 512;
|
|
582
|
+
readonly pattern: "^[^;{}<>\\\\]*$";
|
|
583
|
+
};
|
|
584
|
+
readonly description: "Design tokens keyed by name. Values must not contain ; { } < > or backslashes.";
|
|
585
|
+
};
|
|
586
|
+
readonly theme: {
|
|
587
|
+
readonly type: "object";
|
|
588
|
+
readonly description: "Document design tokens, emitted as CSS custom properties (--kb-color-*, --kb-font-*, --kb-radius-*, --kb-space-*) and referenced from styles as var(--kb-color-<key>).";
|
|
589
|
+
readonly properties: {
|
|
590
|
+
readonly colors: {
|
|
591
|
+
readonly $ref: "#/definitions/themeTokenMap";
|
|
592
|
+
};
|
|
593
|
+
readonly fonts: {
|
|
594
|
+
readonly $ref: "#/definitions/themeTokenMap";
|
|
595
|
+
};
|
|
596
|
+
readonly radii: {
|
|
597
|
+
readonly $ref: "#/definitions/themeTokenMap";
|
|
598
|
+
};
|
|
599
|
+
readonly spacing: {
|
|
600
|
+
readonly $ref: "#/definitions/themeTokenMap";
|
|
601
|
+
};
|
|
602
|
+
};
|
|
603
|
+
readonly additionalProperties: false;
|
|
604
|
+
};
|
|
605
|
+
readonly trackingConfig: {
|
|
606
|
+
readonly type: "object";
|
|
607
|
+
readonly description: "Tracking configuration. Contains only public ids, flags and opaque credential ids — secrets are host-owned.";
|
|
608
|
+
readonly properties: {
|
|
609
|
+
readonly enabled: {
|
|
610
|
+
readonly type: "boolean";
|
|
611
|
+
readonly default: true;
|
|
612
|
+
};
|
|
613
|
+
readonly debugMode: {
|
|
614
|
+
readonly type: "boolean";
|
|
615
|
+
readonly default: false;
|
|
616
|
+
};
|
|
617
|
+
readonly autoPageView: {
|
|
618
|
+
readonly type: "boolean";
|
|
619
|
+
readonly default: true;
|
|
620
|
+
};
|
|
621
|
+
readonly defaultDelivery: {
|
|
622
|
+
readonly type: "string";
|
|
623
|
+
readonly enum: readonly ["both", "client_only", "server_only"];
|
|
624
|
+
readonly default: "both";
|
|
625
|
+
};
|
|
626
|
+
readonly providers: {
|
|
627
|
+
readonly type: "object";
|
|
628
|
+
readonly properties: {
|
|
629
|
+
readonly meta: {
|
|
630
|
+
readonly type: "object";
|
|
631
|
+
readonly properties: {
|
|
632
|
+
readonly enabled: {
|
|
633
|
+
readonly type: "boolean";
|
|
634
|
+
};
|
|
635
|
+
readonly credentialId: {
|
|
636
|
+
readonly type: "string";
|
|
637
|
+
};
|
|
638
|
+
readonly pixelId: {
|
|
639
|
+
readonly type: "string";
|
|
640
|
+
};
|
|
641
|
+
readonly capiEnabled: {
|
|
642
|
+
readonly type: "boolean";
|
|
643
|
+
};
|
|
644
|
+
readonly testEventCode: {
|
|
645
|
+
readonly type: "string";
|
|
646
|
+
};
|
|
647
|
+
};
|
|
648
|
+
readonly additionalProperties: false;
|
|
649
|
+
};
|
|
650
|
+
readonly google: {
|
|
651
|
+
readonly type: "object";
|
|
652
|
+
readonly properties: {
|
|
653
|
+
readonly enabled: {
|
|
654
|
+
readonly type: "boolean";
|
|
655
|
+
};
|
|
656
|
+
readonly credentialId: {
|
|
657
|
+
readonly type: "string";
|
|
658
|
+
};
|
|
659
|
+
readonly measurementId: {
|
|
660
|
+
readonly type: "string";
|
|
661
|
+
};
|
|
662
|
+
};
|
|
663
|
+
readonly additionalProperties: false;
|
|
664
|
+
};
|
|
665
|
+
readonly gtm: {
|
|
666
|
+
readonly type: "object";
|
|
667
|
+
readonly properties: {
|
|
668
|
+
readonly enabled: {
|
|
669
|
+
readonly type: "boolean";
|
|
670
|
+
};
|
|
671
|
+
readonly credentialId: {
|
|
672
|
+
readonly type: "string";
|
|
673
|
+
};
|
|
674
|
+
readonly containerId: {
|
|
675
|
+
readonly type: "string";
|
|
676
|
+
};
|
|
677
|
+
};
|
|
678
|
+
readonly additionalProperties: false;
|
|
679
|
+
};
|
|
680
|
+
readonly tiktok: {
|
|
681
|
+
readonly type: "object";
|
|
682
|
+
readonly properties: {
|
|
683
|
+
readonly enabled: {
|
|
684
|
+
readonly type: "boolean";
|
|
685
|
+
};
|
|
686
|
+
readonly credentialId: {
|
|
687
|
+
readonly type: "string";
|
|
688
|
+
};
|
|
689
|
+
readonly pixelId: {
|
|
690
|
+
readonly type: "string";
|
|
691
|
+
};
|
|
692
|
+
readonly eventsApiEnabled: {
|
|
693
|
+
readonly type: "boolean";
|
|
694
|
+
};
|
|
695
|
+
readonly testEventCode: {
|
|
696
|
+
readonly type: "string";
|
|
697
|
+
};
|
|
698
|
+
};
|
|
699
|
+
readonly additionalProperties: false;
|
|
700
|
+
};
|
|
701
|
+
readonly custom: {
|
|
702
|
+
readonly type: "object";
|
|
703
|
+
readonly properties: {
|
|
704
|
+
readonly enabled: {
|
|
705
|
+
readonly type: "boolean";
|
|
706
|
+
};
|
|
707
|
+
readonly credentialId: {
|
|
708
|
+
readonly type: "string";
|
|
709
|
+
};
|
|
710
|
+
};
|
|
711
|
+
readonly additionalProperties: false;
|
|
712
|
+
};
|
|
713
|
+
};
|
|
714
|
+
readonly additionalProperties: false;
|
|
715
|
+
};
|
|
716
|
+
};
|
|
717
|
+
readonly additionalProperties: false;
|
|
718
|
+
};
|
|
417
719
|
readonly styleValue: {
|
|
418
720
|
readonly type: readonly ["string", "number", "boolean", "null"];
|
|
419
721
|
readonly description: "A CSS property or design token value";
|
|
@@ -553,7 +855,7 @@ export declare function getPageDocumentJsonSchema(): {
|
|
|
553
855
|
};
|
|
554
856
|
readonly type: {
|
|
555
857
|
readonly type: "string";
|
|
556
|
-
readonly enum: readonly ["api_request", "navigate", "set_state", "reset_form", "show_toast", "open_modal", "close_modal", "copy_clipboard", "custom_event"];
|
|
858
|
+
readonly enum: readonly ["api_request", "navigate", "set_state", "reset_form", "show_toast", "open_modal", "close_modal", "toggle_modal", "copy_clipboard", "custom_event", "track_event"];
|
|
557
859
|
};
|
|
558
860
|
readonly label: {
|
|
559
861
|
readonly type: "string";
|
|
@@ -609,7 +911,7 @@ export declare function getPageDocumentJsonSchema(): {
|
|
|
609
911
|
};
|
|
610
912
|
readonly trigger: {
|
|
611
913
|
readonly type: "string";
|
|
612
|
-
readonly enum: readonly ["click", "submit", "change", "blur", "focus", "load"];
|
|
914
|
+
readonly enum: readonly ["click", "submit", "change", "blur", "focus", "load", "expire"];
|
|
613
915
|
};
|
|
614
916
|
readonly label: {
|
|
615
917
|
readonly type: "string";
|
|
@@ -1340,7 +1642,7 @@ export declare const ACTION_PIPELINE_JSON_SCHEMA_V1: {
|
|
|
1340
1642
|
};
|
|
1341
1643
|
readonly trigger: {
|
|
1342
1644
|
readonly type: "string";
|
|
1343
|
-
readonly enum: readonly ["click", "submit", "change", "blur", "focus", "load"];
|
|
1645
|
+
readonly enum: readonly ["click", "submit", "change", "blur", "focus", "load", "expire"];
|
|
1344
1646
|
readonly description: "DOM or component event that triggers the action pipeline";
|
|
1345
1647
|
};
|
|
1346
1648
|
readonly label: {
|
|
@@ -1381,7 +1683,7 @@ export declare const ACTION_PIPELINE_JSON_SCHEMA_V1: {
|
|
|
1381
1683
|
};
|
|
1382
1684
|
readonly type: {
|
|
1383
1685
|
readonly type: "string";
|
|
1384
|
-
readonly enum: readonly ["api_request", "navigate", "set_state", "reset_form", "show_toast", "open_modal", "close_modal", "copy_clipboard", "custom_event"];
|
|
1686
|
+
readonly enum: readonly ["api_request", "navigate", "set_state", "reset_form", "show_toast", "open_modal", "close_modal", "toggle_modal", "copy_clipboard", "custom_event", "track_event"];
|
|
1385
1687
|
};
|
|
1386
1688
|
readonly label: {
|
|
1387
1689
|
readonly type: "string";
|
|
@@ -1445,7 +1747,7 @@ export declare function getActionPipelineJsonSchema(): {
|
|
|
1445
1747
|
};
|
|
1446
1748
|
readonly trigger: {
|
|
1447
1749
|
readonly type: "string";
|
|
1448
|
-
readonly enum: readonly ["click", "submit", "change", "blur", "focus", "load"];
|
|
1750
|
+
readonly enum: readonly ["click", "submit", "change", "blur", "focus", "load", "expire"];
|
|
1449
1751
|
readonly description: "DOM or component event that triggers the action pipeline";
|
|
1450
1752
|
};
|
|
1451
1753
|
readonly label: {
|
|
@@ -1486,7 +1788,7 @@ export declare function getActionPipelineJsonSchema(): {
|
|
|
1486
1788
|
};
|
|
1487
1789
|
readonly type: {
|
|
1488
1790
|
readonly type: "string";
|
|
1489
|
-
readonly enum: readonly ["api_request", "navigate", "set_state", "reset_form", "show_toast", "open_modal", "close_modal", "copy_clipboard", "custom_event"];
|
|
1791
|
+
readonly enum: readonly ["api_request", "navigate", "set_state", "reset_form", "show_toast", "open_modal", "close_modal", "toggle_modal", "copy_clipboard", "custom_event", "track_event"];
|
|
1490
1792
|
};
|
|
1491
1793
|
readonly label: {
|
|
1492
1794
|
readonly type: "string";
|
|
@@ -1750,4 +2052,15 @@ export declare function getFormFieldBindingJsonSchema(): {
|
|
|
1750
2052
|
};
|
|
1751
2053
|
};
|
|
1752
2054
|
};
|
|
2055
|
+
type JsonSchemaObject = Record<string, unknown>;
|
|
2056
|
+
/** JSON Schema (Draft-07) of the body POSTed to a tracking relay (`TrackingRelayRequestSchema`). */
|
|
2057
|
+
export declare function getTrackingRelayRequestJsonSchema(): JsonSchemaObject;
|
|
2058
|
+
/** JSON Schema (Draft-07) of the JSON a tracking relay responds with (`TrackingRelayResponseSchema`). */
|
|
2059
|
+
export declare function getTrackingRelayResponseJsonSchema(): JsonSchemaObject;
|
|
2060
|
+
/**
|
|
2061
|
+
* JSON Schema (Draft-07) of host-side provider secrets, keyed by provider. Useful for hosts
|
|
2062
|
+
* validating their secret store. Never embedded in a document.
|
|
2063
|
+
*/
|
|
2064
|
+
export declare function getTrackingProviderSecretsJsonSchema(): JsonSchemaObject;
|
|
2065
|
+
export {};
|
|
1753
2066
|
//# sourceMappingURL=json-schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema.d.ts","sourceRoot":"","sources":["../src/json-schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"json-schema.d.ts","sourceRoot":"","sources":["../src/json-schema.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwc/B,CAAC;AAEX,wBAAgB,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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|
|
110
110
|
credentialId: z.ZodOptional<z.ZodString>;
|
|
111
111
|
pixelId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
112
112
|
capiEnabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
113
|
-
capiAccessToken: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
114
113
|
testEventCode: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
115
|
-
serverRelayUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
116
114
|
}, z.core.$strip>>;
|
|
117
115
|
google: z.ZodOptional<z.ZodObject<{
|
|
118
116
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
119
117
|
credentialId: z.ZodOptional<z.ZodString>;
|
|
120
118
|
measurementId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
121
|
-
measurementProtocolSecret: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
122
|
-
serverRelayUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
123
119
|
}, z.core.$strip>>;
|
|
124
120
|
gtm: z.ZodOptional<z.ZodObject<{
|
|
125
121
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
126
122
|
credentialId: z.ZodOptional<z.ZodString>;
|
|
127
123
|
containerId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
128
|
-
serverRelayUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
129
124
|
}, z.core.$strip>>;
|
|
130
125
|
tiktok: z.ZodOptional<z.ZodObject<{
|
|
131
126
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
132
127
|
credentialId: z.ZodOptional<z.ZodString>;
|
|
133
128
|
pixelId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
134
129
|
eventsApiEnabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
135
|
-
accessToken: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
136
130
|
testEventCode: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
137
|
-
serverRelayUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
138
131
|
}, z.core.$strip>>;
|
|
139
132
|
custom: z.ZodOptional<z.ZodObject<{
|
|
140
133
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
141
134
|
credentialId: z.ZodOptional<z.ZodString>;
|
|
142
|
-
endpointUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
143
|
-
headers: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
144
135
|
}, z.core.$strip>>;
|
|
145
136
|
}, z.core.$strip>>>;
|
|
146
137
|
}, z.core.$strip>>;
|
|
@@ -160,40 +151,37 @@ export declare const TemplateRecordSchema: z.ZodObject<{
|
|
|
160
151
|
credentialId: z.ZodOptional<z.ZodString>;
|
|
161
152
|
pixelId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
162
153
|
capiEnabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
163
|
-
capiAccessToken: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
164
154
|
testEventCode: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
165
|
-
serverRelayUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
166
155
|
}, z.core.$strip>>;
|
|
167
156
|
google: z.ZodOptional<z.ZodObject<{
|
|
168
157
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
169
158
|
credentialId: z.ZodOptional<z.ZodString>;
|
|
170
159
|
measurementId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
171
|
-
measurementProtocolSecret: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
172
|
-
serverRelayUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
173
160
|
}, z.core.$strip>>;
|
|
174
161
|
gtm: z.ZodOptional<z.ZodObject<{
|
|
175
162
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
176
163
|
credentialId: z.ZodOptional<z.ZodString>;
|
|
177
164
|
containerId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
178
|
-
serverRelayUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
179
165
|
}, z.core.$strip>>;
|
|
180
166
|
tiktok: z.ZodOptional<z.ZodObject<{
|
|
181
167
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
182
168
|
credentialId: z.ZodOptional<z.ZodString>;
|
|
183
169
|
pixelId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
184
170
|
eventsApiEnabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
185
|
-
accessToken: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
186
171
|
testEventCode: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
187
|
-
serverRelayUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
188
172
|
}, z.core.$strip>>;
|
|
189
173
|
custom: z.ZodOptional<z.ZodObject<{
|
|
190
174
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
191
175
|
credentialId: z.ZodOptional<z.ZodString>;
|
|
192
|
-
endpointUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
193
|
-
headers: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
194
176
|
}, z.core.$strip>>;
|
|
195
177
|
}, z.core.$strip>>>;
|
|
196
178
|
}, z.core.$strip>>;
|
|
179
|
+
theme: z.ZodOptional<z.ZodObject<{
|
|
180
|
+
colors: z.ZodOptional<z.ZodRecord<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
181
|
+
fonts: z.ZodOptional<z.ZodRecord<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
182
|
+
radii: z.ZodOptional<z.ZodRecord<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
183
|
+
spacing: z.ZodOptional<z.ZodRecord<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
184
|
+
}, z.core.$strip>>;
|
|
197
185
|
document: z.ZodType<import("./document").RootPageNode, unknown, z.core.$ZodTypeInternals<import("./document").RootPageNode, unknown>>;
|
|
198
186
|
}, z.core.$strip>>;
|
|
199
187
|
packageReference: z.ZodOptional<z.ZodObject<{
|
package/dist/template.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../src/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAA4C,KAAK,cAAc,EAAqB,MAAM,YAAY,CAAC;AAS9G;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAMvD;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,aAGlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;iBAKpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;gCAI9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,mBAAmB,GAAG,MAAM,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;iBAKnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;iB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EH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAEtE"}
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Document Theme / Design Tokens (STORA-551)
|
|
4
|
+
*
|
|
5
|
+
* A theme is a small, portable set of named design tokens stored on the document
|
|
6
|
+
* (`PageDocument.theme`). The renderer emits every token as a CSS custom property on
|
|
7
|
+
* the page root, and node styles reference tokens with a plain CSS `var()` string:
|
|
8
|
+
*
|
|
9
|
+
* styles.base.backgroundColor = 'var(--kb-color-primary)'
|
|
10
|
+
*
|
|
11
|
+
* Because the reference is an ordinary CSS value it passes the existing style
|
|
12
|
+
* validation, renders unchanged in inline styles, generated CSS and exported HTML,
|
|
13
|
+
* and falls back gracefully (to the property's initial value) when a token is absent.
|
|
14
|
+
*
|
|
15
|
+
* Token groups map to custom-property prefixes:
|
|
16
|
+
* colors -> --kb-color-<key>
|
|
17
|
+
* fonts -> --kb-font-<key>
|
|
18
|
+
* radii -> --kb-radius-<key>
|
|
19
|
+
* spacing -> --kb-space-<key>
|
|
20
|
+
*
|
|
21
|
+
* Security: token keys are restricted to a safe identifier alphabet and token values
|
|
22
|
+
* are screened like style values, and additionally may not contain characters that can
|
|
23
|
+
* terminate a CSS declaration/rule or open markup (`; { } < > \`), since values end up
|
|
24
|
+
* inside a `<style>` block in generated HTML.
|
|
25
|
+
*/
|
|
26
|
+
export declare const THEME_TOKEN_GROUPS: readonly ["colors", "fonts", "radii", "spacing"];
|
|
27
|
+
export type ThemeTokenGroup = (typeof THEME_TOKEN_GROUPS)[number];
|
|
28
|
+
/** CSS custom-property prefix per token group. */
|
|
29
|
+
export declare const THEME_TOKEN_CSS_PREFIX: Readonly<Record<ThemeTokenGroup, string>>;
|
|
30
|
+
/** True when `key` can be used as a theme token key (and custom-property suffix). */
|
|
31
|
+
export declare function isSafeThemeTokenKey(key: unknown): key is string;
|
|
32
|
+
/**
|
|
33
|
+
* True when `value` is safe to emit as a CSS custom-property value. Numbers are allowed
|
|
34
|
+
* (finite only); strings must be short and free of injection vectors.
|
|
35
|
+
*/
|
|
36
|
+
export declare function isSafeThemeTokenValue(value: unknown): value is string | number;
|
|
37
|
+
export declare const ThemeTokenKeySchema: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
38
|
+
export declare const ThemeTokenValueSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
39
|
+
export type ThemeTokenValue = z.infer<typeof ThemeTokenValueSchema>;
|
|
40
|
+
export declare const ThemeTokenMapSchema: z.ZodRecord<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
41
|
+
export type ThemeTokenMap = Record<string, ThemeTokenValue>;
|
|
42
|
+
export declare const ThemeSchema: z.ZodObject<{
|
|
43
|
+
colors: z.ZodOptional<z.ZodRecord<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
44
|
+
fonts: z.ZodOptional<z.ZodRecord<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
45
|
+
radii: z.ZodOptional<z.ZodRecord<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
46
|
+
spacing: z.ZodOptional<z.ZodRecord<z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export type Theme = z.infer<typeof ThemeSchema>;
|
|
49
|
+
/**
|
|
50
|
+
* Builds the custom-property name for a token, e.g. `('colors', 'primary')` ->
|
|
51
|
+
* `--kb-color-primary`. Returns `null` for unsafe keys.
|
|
52
|
+
*/
|
|
53
|
+
export declare function themeTokenCssVarName(group: ThemeTokenGroup, key: string): string | null;
|
|
54
|
+
/**
|
|
55
|
+
* Builds the style value that references a token, e.g. `var(--kb-color-primary)`.
|
|
56
|
+
* This is the canonical token reference format stored in node styles.
|
|
57
|
+
*/
|
|
58
|
+
export declare function themeTokenRef(group: ThemeTokenGroup, key: string): string;
|
|
59
|
+
/**
|
|
60
|
+
* Parses a token reference style value back into `{ group, key }`, or `null` when the
|
|
61
|
+
* value is not a theme token reference.
|
|
62
|
+
*/
|
|
63
|
+
export declare function parseThemeTokenRef(value: unknown): {
|
|
64
|
+
group: ThemeTokenGroup;
|
|
65
|
+
key: string;
|
|
66
|
+
} | null;
|
|
67
|
+
/**
|
|
68
|
+
* Merges theme layers left-to-right (later layers win per token). Used to apply a host
|
|
69
|
+
* runtime override on top of the document theme without mutating either. Unsafe tokens in
|
|
70
|
+
* any layer are skipped, so an invalid override never clobbers a valid lower-layer value.
|
|
71
|
+
*/
|
|
72
|
+
export declare function mergeThemes(...layers: Array<Partial<Theme> | undefined | null>): Theme;
|
|
73
|
+
/**
|
|
74
|
+
* Flattens a theme into `[customPropertyName, value]` pairs, silently dropping any
|
|
75
|
+
* token whose key or value is unsafe. Safe to call on unvalidated input (e.g. a host
|
|
76
|
+
* runtime override), which is why it re-checks every entry.
|
|
77
|
+
*/
|
|
78
|
+
export declare function themeToCssVariables(theme: Partial<Theme> | undefined | null): Array<[string, string]>;
|
|
79
|
+
export declare function isTheme(value: unknown): value is Theme;
|
|
80
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@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