@samva/markup 0.8.0 → 0.10.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.
Files changed (172) hide show
  1. package/AGENTS.md +107 -46
  2. package/CHANGELOG.md +345 -0
  3. package/README.md +188 -52
  4. package/dist/{brand-DcoVkh_S.d.ts → assets-BIsyMQ92.d.ts} +41 -11
  5. package/dist/{email/brand.js → brand-C0MKTwmX.js} +64 -4
  6. package/dist/{theme-css.d.ts → brand.d.ts} +12 -3
  7. package/dist/brand.js +4 -0
  8. package/dist/channel-specs-C2feJwuP.d.ts +13 -0
  9. package/dist/compiler.d.ts +88 -115
  10. package/dist/compiler.js +750 -171
  11. package/dist/components-BZCqegS8.js +1864 -0
  12. package/dist/diagnostic-model-DJtqbETd.js +38 -0
  13. package/dist/{diagnostics-OcQKQYSY.d.ts → diagnostic-model-DxthUZBT.d.ts} +3 -21
  14. package/dist/{diagnostics-BMYtBCQk.d.ts → diagnostics-B-Gym34R.d.ts} +8 -4
  15. package/dist/{email/diagnostics.js → diagnostics-CnKFefKz.js} +4 -3
  16. package/dist/diagnostics.d.ts +410 -2
  17. package/dist/diagnostics.js +402 -52
  18. package/dist/edit.d.ts +234 -0
  19. package/dist/edit.js +947 -0
  20. package/dist/email/jsx-dev-runtime.d.ts +2 -2
  21. package/dist/email/jsx-dev-runtime.js +1 -2
  22. package/dist/email/jsx-runtime.d.ts +1 -1
  23. package/dist/email/jsx-runtime.js +1 -85
  24. package/dist/{email/components.d.ts → email.d.ts} +22 -11
  25. package/dist/email.js +2 -0
  26. package/dist/fmt.d.ts +32 -0
  27. package/dist/fmt.js +174 -0
  28. package/dist/index.d.ts +2 -0
  29. package/dist/index.js +2 -0
  30. package/dist/{render-vAv_4r9v.js → ir-CLhlklKV.js} +96 -279
  31. package/dist/jsx-runtime-CBlexoeR.js +98 -0
  32. package/dist/{elements-BzjjnoCS.d.ts → jsx-runtime-ylIOnaSf.d.ts} +76 -76
  33. package/dist/profile-pWGtWZXF.js +3803 -0
  34. package/dist/render-BPonDpCl.d.ts +539 -0
  35. package/dist/render-BQmfh94k.js +257 -0
  36. package/dist/render.d.ts +35 -0
  37. package/dist/render.js +49 -0
  38. package/dist/sms.d.ts +16 -0
  39. package/dist/sms.js +12 -0
  40. package/dist/source-locations-C8wCsiAy.d.ts +23 -0
  41. package/dist/template-DMPwxMSq.d.ts +65 -0
  42. package/dist/template-zLUjcwfF.js +42 -0
  43. package/dist/{theme-css-hFqcPSar.js → theme-css-JtRCm1fb.js} +2 -2
  44. package/dist/whatsapp.d.ts +57 -0
  45. package/dist/whatsapp.js +22 -0
  46. package/generated/contract.json +1788 -0
  47. package/generated/reference.md +360 -0
  48. package/package.json +46 -239
  49. package/samva-brand.d.ts +4 -4
  50. package/skills/sml/SKILL.md +123 -0
  51. package/dist/ast-BrDtApwS.d.ts +0 -107
  52. package/dist/ast.d.ts +0 -2
  53. package/dist/ast.js +0 -124
  54. package/dist/candidate.d.ts +0 -29
  55. package/dist/candidate.js +0 -88
  56. package/dist/catalog-CKuOooB8.d.ts +0 -354
  57. package/dist/checks-D73Xizbw.js +0 -59366
  58. package/dist/checks.d.ts +0 -33
  59. package/dist/checks.js +0 -2
  60. package/dist/classes.d.ts +0 -26
  61. package/dist/classes.js +0 -184
  62. package/dist/compile-sms.d.ts +0 -28
  63. package/dist/compile-sms.js +0 -44
  64. package/dist/compile-whatsapp.d.ts +0 -56
  65. package/dist/compile-whatsapp.js +0 -186
  66. package/dist/compile.d.ts +0 -18
  67. package/dist/compile.js +0 -29
  68. package/dist/components.d.ts +0 -289
  69. package/dist/components.js +0 -106
  70. package/dist/conditionals.d.ts +0 -10
  71. package/dist/conditionals.js +0 -74
  72. package/dist/corpus-CPPfgAHN.d.ts +0 -106
  73. package/dist/css-CS2jLID6.d.ts +0 -109
  74. package/dist/email/assets.d.ts +0 -40
  75. package/dist/email/assets.js +0 -63
  76. package/dist/email/brand-footer.d.ts +0 -34
  77. package/dist/email/brand-footer.js +0 -62
  78. package/dist/email/brand.d.ts +0 -2
  79. package/dist/email/components.js +0 -240
  80. package/dist/email/diagnostics.d.ts +0 -2
  81. package/dist/email/elements.d.ts +0 -2
  82. package/dist/email/elements.js +0 -299
  83. package/dist/email/html.d.ts +0 -2
  84. package/dist/email/html.js +0 -278
  85. package/dist/email/render.d.ts +0 -50
  86. package/dist/email/render.js +0 -3
  87. package/dist/email/selection.d.ts +0 -2
  88. package/dist/email/selection.js +0 -91
  89. package/dist/email/source-edit.d.ts +0 -67
  90. package/dist/email/source-edit.js +0 -185
  91. package/dist/email/stylesheets.d.ts +0 -15
  92. package/dist/email/stylesheets.js +0 -48
  93. package/dist/email/text.d.ts +0 -7
  94. package/dist/email/text.js +0 -100
  95. package/dist/emit.d.ts +0 -51
  96. package/dist/emit.js +0 -151
  97. package/dist/html-Bl9BAdqc.d.ts +0 -42
  98. package/dist/interpolate.d.ts +0 -24
  99. package/dist/interpolate.js +0 -43
  100. package/dist/jsx-dev-runtime.d.ts +0 -11
  101. package/dist/jsx-dev-runtime.js +0 -15
  102. package/dist/jsx-runtime-I-1nCtl2.d.ts +0 -57
  103. package/dist/jsx-runtime.d.ts +0 -2
  104. package/dist/jsx-runtime.js +0 -121
  105. package/dist/lexer.d.ts +0 -60
  106. package/dist/lexer.js +0 -281
  107. package/dist/model.d.ts +0 -24
  108. package/dist/model.js +0 -77
  109. package/dist/ops-BvwqHl7V.js +0 -630
  110. package/dist/ops.d.ts +0 -114
  111. package/dist/ops.js +0 -2
  112. package/dist/parser-t29cHLVL.d.ts +0 -396
  113. package/dist/parser.d.ts +0 -2
  114. package/dist/parser.js +0 -859
  115. package/dist/predicate-BI6uRRM-.js +0 -549
  116. package/dist/predicate-M-05Nd7R.d.ts +0 -56
  117. package/dist/predicate.d.ts +0 -2
  118. package/dist/predicate.js +0 -2
  119. package/dist/printer.d.ts +0 -6
  120. package/dist/printer.js +0 -122
  121. package/dist/registry-Dcp6QEK_.d.ts +0 -73
  122. package/dist/registry.d.ts +0 -2
  123. package/dist/registry.js +0 -646
  124. package/dist/render-template.d.ts +0 -45
  125. package/dist/render-template.js +0 -76
  126. package/dist/selection-CCArx9lU.d.ts +0 -91
  127. package/dist/showcase-egkusQBf.d.ts +0 -415
  128. package/dist/sms-segments-y4FpPilJ.d.ts +0 -13
  129. package/dist/sms-segments.d.ts +0 -2
  130. package/dist/sms-segments.js +0 -46
  131. package/dist/source-locations-DrCM82Ym.d.ts +0 -67
  132. package/dist/source-locations.d.ts +0 -2
  133. package/dist/source-locations.js +0 -102
  134. package/dist/starters/category-mapping.d.ts +0 -13
  135. package/dist/starters/category-mapping.js +0 -49
  136. package/dist/starters/corpus.d.ts +0 -2
  137. package/dist/starters/corpus.js +0 -194
  138. package/dist/starters/library.d.ts +0 -18
  139. package/dist/starters/library.js +0 -692
  140. package/dist/starters/public-gallery.d.ts +0 -266
  141. package/dist/starters/public-gallery.js +0 -916
  142. package/dist/starters/public-handoff.d.ts +0 -164
  143. package/dist/starters/public-handoff.js +0 -361
  144. package/dist/starters/public-preview-artifacts.d.ts +0 -43
  145. package/dist/starters/public-preview-artifacts.js +0 -104
  146. package/dist/starters/public-preview.d.ts +0 -61
  147. package/dist/starters/public-preview.js +0 -83
  148. package/dist/starters/showcase.d.ts +0 -2
  149. package/dist/starters/showcase.js +0 -335
  150. package/dist/starters/sources.d.ts +0 -45
  151. package/dist/starters/sources.js +0 -7762
  152. package/dist/starters/theme.d.ts +0 -45
  153. package/dist/starters/theme.js +0 -77
  154. package/dist/starters.d.ts +0 -2
  155. package/dist/starters.js +0 -874
  156. package/dist/tailwind-BYq7Lo6u.js +0 -727
  157. package/dist/template-DWftqh4x.d.ts +0 -60
  158. package/dist/template.d.ts +0 -2
  159. package/dist/template.js +0 -37
  160. package/dist/theme-css.js +0 -2
  161. package/dist/tsx-source-instrumentation.d.ts +0 -30
  162. package/dist/tsx-source-instrumentation.js +0 -115
  163. package/dist/tsx-tracer.d.ts +0 -112
  164. package/dist/tsx-tracer.js +0 -985
  165. package/dist/variables-J_L3qxRa.d.ts +0 -77
  166. package/dist/variables.d.ts +0 -2
  167. package/dist/variables.js +0 -141
  168. package/dist/version-BITr58kk.js +0 -96
  169. package/generated/sml-agent-contract.json +0 -709
  170. package/generated/sml-email-agent-contract.json +0 -615
  171. package/generated/sml-email-language-reference.md +0 -94
  172. package/generated/sml-language-reference.md +0 -195
package/dist/ops.d.ts DELETED
@@ -1,114 +0,0 @@
1
- import { i as SmlParseError, t as Diagnostic } from "./diagnostics-OcQKQYSY.js";
2
- import { S as SmlTag, r as AttributeValue, x as SmlNode } from "./ast-BrDtApwS.js";
3
- import { Result } from "better-result";
4
- //#region src/ops.d.ts
5
- /** Where an inserted node lands relative to its reference node. */
6
- type SmlInsertPosition = "before" | "after" | "inside";
7
- interface SetPropOp {
8
- readonly type: "setProp";
9
- readonly nodeId: string;
10
- readonly name: string;
11
- readonly value: AttributeValue | null;
12
- }
13
- /**
14
- * Replace a node's complete child list. The normal print → parse → compile
15
- * preflight remains the authority on whether the replacement satisfies the
16
- * target's content model.
17
- */
18
- interface SetChildrenOp {
19
- readonly type: "setChildren";
20
- readonly nodeId: string;
21
- readonly children: ReadonlyArray<SmlNode>;
22
- }
23
- interface InsertBlockOp {
24
- readonly type: "insertBlock";
25
- readonly tag: SmlTag;
26
- readonly referenceId: string | null;
27
- readonly position: SmlInsertPosition;
28
- }
29
- interface InsertSnippetOp {
30
- readonly type: "insertSnippet";
31
- readonly snippet: string;
32
- readonly referenceId: string | null;
33
- readonly position: SmlInsertPosition;
34
- }
35
- /**
36
- * `insertionIndex` is an element-child index into `targetParentId` evaluated
37
- * AFTER the moved node has left its old position — the lifted-out model, so a
38
- * same-parent caller must compute the index against the sibling list without
39
- * the node. Indexes past the end append.
40
- */
41
- interface MoveNodeOp {
42
- readonly type: "moveNode";
43
- readonly nodeId: string;
44
- readonly targetParentId: string;
45
- readonly insertionIndex: number;
46
- }
47
- interface DuplicateNodeOp {
48
- readonly type: "duplicateNode";
49
- readonly nodeId: string;
50
- }
51
- interface RemoveNodeOp {
52
- readonly type: "removeNode";
53
- readonly nodeId: string;
54
- }
55
- /**
56
- * A single edit against SML source. `nodeId` (and `referenceId` /
57
- * `targetParentId`) are positional ids from the source the caller last read;
58
- * within a batch they always resolve against that snapshot — see {@link applyOps}.
59
- */
60
- type SmlOp = SetPropOp | SetChildrenOp | InsertBlockOp | InsertSnippetOp | MoveNodeOp | DuplicateNodeOp | RemoveNodeOp;
61
- interface SmlOpResult {
62
- readonly index: number;
63
- readonly status: "applied" | "failed";
64
- readonly op: SmlOp;
65
- readonly diagnostics: ReadonlyArray<Diagnostic>;
66
- }
67
- interface ApplyOpsResult {
68
- readonly source: string;
69
- readonly revision: string;
70
- readonly diagnostics: ReadonlyArray<Diagnostic>;
71
- readonly results: ReadonlyArray<SmlOpResult>;
72
- }
73
- interface ApplyOpsOptions {
74
- readonly expectedRevision?: string | number | undefined;
75
- readonly currentRevision?: string | number | undefined;
76
- }
77
- declare const SmlOpError_base: import("better-result").TaggedErrorClass<"SmlOpError">;
78
- declare class SmlOpError extends SmlOpError_base<{
79
- readonly diagnostics: ReadonlyArray<Diagnostic>;
80
- readonly message: string;
81
- }> {
82
- constructor(args: {
83
- readonly diagnostics: ReadonlyArray<Diagnostic>;
84
- });
85
- }
86
- declare const sourceRevision: (source: string) => string;
87
- declare const normalizeSml: (source: string) => Result<string, SmlParseError>;
88
- /**
89
- * Apply a batch of ops to SML source, returning the rewritten source, its new
90
- * revision, and a per-op result.
91
- *
92
- * Id contract: every id in the batch resolves against the id-space of the
93
- * source the caller read (the `expectedRevision` snapshot). Ids are positional
94
- * (`n0..nN` in document order) and are NOT rewritten between ops, so:
95
- *
96
- * - An op cannot target a node created earlier in the same batch — freshly
97
- * inserted/duplicated nodes carry a blank id until the next reprint reassigns
98
- * positional ids, and are unaddressable within the batch (fails with
99
- * `op-target-not-found`).
100
- * - After `duplicateNode`, the duplicated id still addresses the ORIGINAL (the
101
- * first match in document order); the clone is a blank-id copy.
102
- * - Structural ops (insert/remove/move) do not shift the ids of the nodes that
103
- * survive, so a later op targeting a surviving sibling lands on the intended
104
- * node regardless of what earlier ops did.
105
- *
106
- * Each op is still preflighted (reprint, reparse, compile, compatibility check)
107
- * as an independent validity gate; a failing op is recorded as `failed` and
108
- * does not advance the working document.
109
- */
110
- declare const applyOps: (source: string, ops: readonly SmlOp[], options?: ApplyOpsOptions) => Result<ApplyOpsResult, SmlOpError>;
111
- declare const applyOp: (source: string, op: SmlOp, options?: ApplyOpsOptions) => Result<ApplyOpsResult, SmlOpError>;
112
- //#endregion
113
- export { ApplyOpsOptions, ApplyOpsResult, DuplicateNodeOp, InsertBlockOp, InsertSnippetOp, MoveNodeOp, RemoveNodeOp, SetChildrenOp, SetPropOp, SmlInsertPosition, SmlOp, SmlOpError, SmlOpResult, applyOp, applyOps, normalizeSml, sourceRevision };
114
- //# sourceMappingURL=ops.d.ts.map
package/dist/ops.js DELETED
@@ -1,2 +0,0 @@
1
- import { a as sourceRevision, i as normalizeSml, n as applyOp, r as applyOps, t as SmlOpError } from "./ops-BvwqHl7V.js";
2
- export { SmlOpError, applyOp, applyOps, normalizeSml, sourceRevision };
@@ -1,396 +0,0 @@
1
- import { i as SmlParseError } from "./diagnostics-OcQKQYSY.js";
2
- import { S as SmlTag, b as SmlDocument, l as Channel } from "./ast-BrDtApwS.js";
3
- import { Result } from "better-result";
4
- //#region src/limits.d.ts
5
- /** Hard ceilings shared by SML documents and standalone predicate parsing. */
6
- declare const SML_PARSER_LIMITS: {
7
- readonly maxCharacters: 500000;
8
- readonly maxUtf8Bytes: number;
9
- readonly maxDepth: 64;
10
- readonly maxNodes: 25000;
11
- };
12
- //#endregion
13
- //#region src/parser.d.ts
14
- type ContentModel = "email" | "block" | "columns" | "list" | "image" | "if" | "inline" | "inline-nolink" | "preview" | "whatsapp" | "buttons" | "verbatim" | "verbatim-if" | "void";
15
- interface AttributeSpec {
16
- readonly type: "string" | "number";
17
- readonly required?: boolean | undefined;
18
- /** Inclusive numeric bounds for number attributes. */
19
- readonly min?: number | undefined;
20
- readonly max?: number | undefined;
21
- /** Closed value set for string attributes; anything else is a parse error. */
22
- readonly values?: ReadonlyArray<string> | undefined;
23
- }
24
- interface TagSpec {
25
- readonly attributes: Readonly<Record<string, AttributeSpec>>;
26
- readonly content: ContentModel;
27
- }
28
- /**
29
- * The email language surface as data: per-tag attributes
30
- * (type/required/bounds) and content model. Public API — typed TSX components
31
- * and the reference-docs generator derive from this table, so it cannot drift
32
- * from the parser.
33
- */
34
- declare const EMAIL_TAG_SPECS: {
35
- readonly Email: {
36
- readonly attributes: {
37
- readonly lang: {
38
- readonly type: "string";
39
- };
40
- readonly dir: {
41
- readonly type: "string";
42
- };
43
- readonly width: {
44
- readonly type: "number";
45
- readonly min: 1;
46
- readonly max: 10000;
47
- };
48
- readonly class: {
49
- readonly type: "string";
50
- };
51
- };
52
- readonly content: "email";
53
- };
54
- readonly Subject: {
55
- readonly attributes: {};
56
- readonly content: "preview";
57
- };
58
- readonly Preview: {
59
- readonly attributes: {};
60
- readonly content: "preview";
61
- };
62
- readonly Container: {
63
- readonly attributes: {
64
- readonly backgroundImage: {
65
- readonly type: "string";
66
- };
67
- readonly backgroundPosition: {
68
- readonly type: "string";
69
- readonly values: readonly ["center", "top", "bottom"];
70
- };
71
- readonly backgroundSize: {
72
- readonly type: "string";
73
- readonly values: readonly ["cover", "contain", "auto"];
74
- };
75
- readonly class: {
76
- readonly type: "string";
77
- };
78
- };
79
- readonly content: "block";
80
- };
81
- readonly Section: {
82
- readonly attributes: {
83
- readonly backgroundImage: {
84
- readonly type: "string";
85
- };
86
- readonly backgroundPosition: {
87
- readonly type: "string";
88
- readonly values: readonly ["center", "top", "bottom"];
89
- };
90
- readonly backgroundSize: {
91
- readonly type: "string";
92
- readonly values: readonly ["cover", "contain", "auto"];
93
- };
94
- readonly class: {
95
- readonly type: "string";
96
- };
97
- };
98
- readonly content: "block";
99
- };
100
- readonly Row: {
101
- readonly attributes: {
102
- readonly class: {
103
- readonly type: "string";
104
- };
105
- };
106
- readonly content: "columns";
107
- };
108
- readonly Column: {
109
- readonly attributes: {
110
- readonly class: {
111
- readonly type: "string";
112
- };
113
- readonly width: {
114
- readonly type: "string";
115
- };
116
- readonly valign: {
117
- readonly type: "string";
118
- readonly values: readonly ["top", "middle", "bottom"];
119
- };
120
- };
121
- readonly content: "block";
122
- };
123
- readonly Heading: {
124
- readonly attributes: {
125
- readonly level: {
126
- readonly type: "number";
127
- readonly min: 1;
128
- readonly max: 6;
129
- };
130
- readonly class: {
131
- readonly type: "string";
132
- };
133
- };
134
- readonly content: "inline";
135
- };
136
- readonly Text: {
137
- readonly attributes: {
138
- readonly class: {
139
- readonly type: "string";
140
- };
141
- };
142
- readonly content: "inline";
143
- };
144
- readonly Button: {
145
- readonly attributes: {
146
- readonly href: {
147
- readonly type: "string";
148
- readonly required: true;
149
- };
150
- readonly class: {
151
- readonly type: "string";
152
- };
153
- };
154
- readonly content: "inline-nolink";
155
- };
156
- readonly Image: {
157
- readonly attributes: {
158
- readonly src: {
159
- readonly type: "string";
160
- readonly required: true;
161
- };
162
- readonly alt: {
163
- readonly type: "string";
164
- };
165
- readonly width: {
166
- readonly type: "number";
167
- readonly min: 0;
168
- readonly max: 10000;
169
- };
170
- readonly height: {
171
- readonly type: "number";
172
- readonly min: 0;
173
- readonly max: 10000;
174
- };
175
- readonly class: {
176
- readonly type: "string";
177
- };
178
- };
179
- readonly content: "image";
180
- };
181
- readonly Source: {
182
- readonly attributes: {
183
- readonly scheme: {
184
- readonly type: "string";
185
- readonly required: true;
186
- readonly values: readonly ["dark"];
187
- };
188
- readonly src: {
189
- readonly type: "string";
190
- readonly required: true;
191
- };
192
- };
193
- readonly content: "void";
194
- };
195
- readonly Divider: {
196
- readonly attributes: {
197
- readonly class: {
198
- readonly type: "string";
199
- };
200
- };
201
- readonly content: "void";
202
- };
203
- readonly Spacer: {
204
- readonly attributes: {
205
- readonly height: {
206
- readonly type: "number";
207
- readonly required: true;
208
- readonly min: 1;
209
- readonly max: 2000;
210
- };
211
- };
212
- readonly content: "void";
213
- };
214
- readonly List: {
215
- readonly attributes: {
216
- readonly type: {
217
- readonly type: "string";
218
- readonly values: readonly ["unordered", "ordered"];
219
- };
220
- readonly class: {
221
- readonly type: "string";
222
- };
223
- };
224
- readonly content: "list";
225
- };
226
- readonly ListItem: {
227
- readonly attributes: {
228
- readonly class: {
229
- readonly type: "string";
230
- };
231
- };
232
- readonly content: "inline";
233
- };
234
- readonly If: {
235
- readonly attributes: {
236
- readonly test: {
237
- readonly type: "string";
238
- readonly required: true;
239
- };
240
- };
241
- readonly content: "if";
242
- };
243
- readonly Else: {
244
- readonly attributes: {};
245
- readonly content: "block";
246
- };
247
- readonly a: {
248
- readonly attributes: {
249
- readonly href: {
250
- readonly type: "string";
251
- readonly required: true;
252
- };
253
- readonly class: {
254
- readonly type: "string";
255
- };
256
- };
257
- readonly content: "inline-nolink";
258
- };
259
- readonly strong: {
260
- readonly attributes: {};
261
- readonly content: "inline-nolink";
262
- };
263
- readonly em: {
264
- readonly attributes: {};
265
- readonly content: "inline-nolink";
266
- };
267
- };
268
- /**
269
- * The sms language surface: a raw verbatim text body with `{{vars}}` and
270
- * send-time conditionals — no layout tags, no classes, no theming.
271
- */
272
- declare const SMS_TAG_SPECS: {
273
- readonly Sms: {
274
- readonly attributes: {
275
- readonly category: {
276
- readonly type: "string";
277
- readonly values: readonly ["transactional", "promotional", "service_implicit"];
278
- };
279
- };
280
- readonly content: "verbatim";
281
- };
282
- readonly If: {
283
- readonly attributes: {
284
- readonly test: {
285
- readonly type: "string";
286
- readonly required: true;
287
- };
288
- };
289
- readonly content: "verbatim-if";
290
- };
291
- readonly Else: {
292
- readonly attributes: {};
293
- readonly content: "verbatim";
294
- };
295
- };
296
- /**
297
- * The whatsapp language surface: Meta's template anatomy IS the closed
298
- * grammar — Header? Body Footer? Buttons?, verbatim text slots, no classes.
299
- * Root attributes carry authoring intent (name defaults from the template
300
- * slug, language from the variant locale — defaulting happens at the API
301
- * layer; the language just carries the attributes).
302
- */
303
- declare const WHATSAPP_TAG_SPECS: {
304
- readonly WhatsApp: {
305
- readonly attributes: {
306
- readonly name: {
307
- readonly type: "string";
308
- };
309
- readonly language: {
310
- readonly type: "string";
311
- };
312
- readonly category: {
313
- readonly type: "string";
314
- readonly required: true;
315
- readonly values: readonly ["marketing", "utility", "authentication"];
316
- };
317
- };
318
- readonly content: "whatsapp";
319
- };
320
- readonly Header: {
321
- readonly attributes: {
322
- readonly type: {
323
- readonly type: "string";
324
- readonly values: readonly ["text", "image", "video", "document"];
325
- };
326
- };
327
- readonly content: "verbatim";
328
- };
329
- readonly Body: {
330
- readonly attributes: {};
331
- readonly content: "verbatim";
332
- };
333
- readonly Footer: {
334
- readonly attributes: {};
335
- readonly content: "verbatim";
336
- };
337
- readonly Buttons: {
338
- readonly attributes: {};
339
- readonly content: "buttons";
340
- };
341
- readonly Button: {
342
- readonly attributes: {
343
- readonly type: {
344
- readonly type: "string";
345
- readonly required: true;
346
- readonly values: readonly ["quick-reply", "url", "phone", "copy-code"];
347
- };
348
- readonly url: {
349
- readonly type: "string";
350
- };
351
- readonly phone: {
352
- readonly type: "string";
353
- };
354
- };
355
- readonly content: "verbatim";
356
- };
357
- readonly If: {
358
- readonly attributes: {
359
- readonly test: {
360
- readonly type: "string";
361
- readonly required: true;
362
- };
363
- };
364
- readonly content: "verbatim-if";
365
- };
366
- readonly Else: {
367
- readonly attributes: {};
368
- readonly content: "verbatim";
369
- };
370
- };
371
- /** Per-channel tag tables — the root tag picks one for the whole document. */
372
- declare const CHANNEL_TAG_SPECS: Readonly<Record<Channel, Readonly<Partial<Record<SmlTag, TagSpec>>>>>;
373
- /**
374
- * Editor-only attributes accepted on every email block-level tag on top of the
375
- * tag's own spec. The compiler ignores both, so neither ever reaches HTML:
376
- * `label` renames a node in the layout navigator; `hidden="true"` drops it from
377
- * the compiled artifact while it stays in the source. Email-only — sms/whatsapp
378
- * compile has no strip pass, so their tags keep their own specs verbatim.
379
- */
380
- declare const UNIVERSAL_ATTRIBUTES: {
381
- readonly label: {
382
- readonly type: "string";
383
- };
384
- readonly hidden: {
385
- readonly type: "string";
386
- readonly values: readonly ["true"];
387
- };
388
- };
389
- /** Email tags a user manipulates as layers — the ones the universal attributes attach to. */
390
- declare const UNIVERSAL_ATTRIBUTE_TAGS: ReadonlySet<SmlTag>;
391
- /** Tags a content model admits as direct children (public alongside the spec tables). */
392
- declare const allowedChildren: (model: ContentModel) => ReadonlyArray<SmlTag>;
393
- declare const parseSml: (source: string) => Result<SmlDocument, SmlParseError>;
394
- //#endregion
395
- export { SMS_TAG_SPECS as a, UNIVERSAL_ATTRIBUTE_TAGS as c, parseSml as d, SML_PARSER_LIMITS as f, EMAIL_TAG_SPECS as i, WHATSAPP_TAG_SPECS as l, CHANNEL_TAG_SPECS as n, TagSpec as o, ContentModel as r, UNIVERSAL_ATTRIBUTES as s, AttributeSpec as t, allowedChildren as u };
396
- //# sourceMappingURL=parser-t29cHLVL.d.ts.map
package/dist/parser.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { a as SMS_TAG_SPECS, c as UNIVERSAL_ATTRIBUTE_TAGS, d as parseSml, f as SML_PARSER_LIMITS, i as EMAIL_TAG_SPECS, l as WHATSAPP_TAG_SPECS, n as CHANNEL_TAG_SPECS, o as TagSpec, r as ContentModel, s as UNIVERSAL_ATTRIBUTES, t as AttributeSpec, u as allowedChildren } from "./parser-t29cHLVL.js";
2
- export { AttributeSpec, CHANNEL_TAG_SPECS, ContentModel, EMAIL_TAG_SPECS, SML_PARSER_LIMITS, SMS_TAG_SPECS, TagSpec, UNIVERSAL_ATTRIBUTES, UNIVERSAL_ATTRIBUTE_TAGS, WHATSAPP_TAG_SPECS, allowedChildren, parseSml };