@samva/markup 0.8.0 → 0.9.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/AGENTS.md +90 -37
- package/README.md +188 -52
- package/dist/assets-C5duwTya.d.ts +40 -0
- package/dist/{brand-DcoVkh_S.d.ts → brand-B-0bN_Ir.d.ts} +2 -2
- package/dist/{render-vAv_4r9v.js → cascade-t6kxlgEI.js} +93 -280
- package/dist/channel-edit.d.ts +121 -0
- package/dist/channel-edit.js +609 -0
- package/dist/channel-specs-B6M_HlaV.js +29 -0
- package/dist/channel-specs-C2feJwuP.d.ts +13 -0
- package/dist/compatibility-DbISoFIq.js +589 -0
- package/dist/compiler.d.ts +10 -257
- package/dist/compiler.js +10 -730
- package/dist/{css-CS2jLID6.d.ts → css-BVQKICKC.d.ts} +3 -3
- package/dist/diagnostic-codes.d.ts +403 -0
- package/dist/diagnostic-codes.js +399 -0
- package/dist/{diagnostics-BMYtBCQk.d.ts → diagnostics-B-Gym34R.d.ts} +8 -4
- package/dist/diagnostics.d.ts +31 -2
- package/dist/diagnostics.js +1 -19
- package/dist/{elements-BzjjnoCS.d.ts → elements-cqldpaJt.d.ts} +3 -3
- package/dist/email/assets.d.ts +2 -40
- package/dist/email/brand-footer.d.ts +2 -2
- package/dist/email/brand-footer.js +4 -3
- package/dist/email/brand.d.ts +1 -1
- package/dist/email/brand.js +1 -1
- package/dist/email/components.d.ts +21 -10
- package/dist/email/components.js +46 -11
- package/dist/email/diagnostics.d.ts +2 -2
- package/dist/email/diagnostics.js +2 -1
- package/dist/email/elements.d.ts +1 -1
- package/dist/email/html.d.ts +2 -2
- package/dist/email/html.js +45 -2
- package/dist/email/jsx-dev-runtime.d.ts +2 -2
- package/dist/email/jsx-runtime.d.ts +1 -1
- package/dist/email/render.d.ts +8 -18
- package/dist/email/render.js +163 -3
- package/dist/email/text.d.ts +1 -1
- package/dist/fmt.d.ts +32 -0
- package/dist/fmt.js +174 -0
- package/dist/{html-Bl9BAdqc.d.ts → html-BJepOwZ4.d.ts} +19 -5
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/ir-aaqNE987.d.ts +252 -0
- package/dist/ir.d.ts +2 -0
- package/dist/ir.js +7 -0
- package/dist/preview-Ekdg1dXG.d.ts +100 -0
- package/dist/preview.d.ts +2 -0
- package/dist/preview.js +160 -0
- package/dist/profile-BH-OtdDA.js +3670 -0
- package/dist/render-ir.d.ts +19 -0
- package/dist/render-ir.js +826 -0
- package/dist/sms-segments.d.ts +13 -2
- package/dist/sms.d.ts +16 -0
- package/dist/sms.js +12 -0
- package/dist/{email/source-edit.d.ts → source-edit.d.ts} +55 -6
- package/dist/source-edit.js +343 -0
- package/dist/source-locations-C8wCsiAy.d.ts +23 -0
- package/dist/source-locations.d.ts +2 -2
- package/dist/source-locations.js +3 -89
- package/dist/static.d.ts +57 -0
- package/dist/static.js +69 -0
- package/dist/tailwind-CMYpZf1v.js +614 -0
- package/dist/template-_QE_rQND.d.ts +65 -0
- package/dist/template.d.ts +2 -2
- package/dist/template.js +15 -10
- package/dist/theme-css.d.ts +1 -1
- package/dist/theme-imports-lvBw3AD1.js +109 -0
- package/dist/transform-Ct2OMkFN.d.ts +153 -0
- package/dist/whatsapp.d.ts +57 -0
- package/dist/whatsapp.js +22 -0
- package/generated/contract.json +1782 -0
- package/generated/reference.md +353 -0
- package/package.json +41 -151
- package/skills/sml/SKILL.md +123 -0
- package/dist/ast-BrDtApwS.d.ts +0 -107
- package/dist/ast.d.ts +0 -2
- package/dist/ast.js +0 -124
- package/dist/candidate.d.ts +0 -29
- package/dist/candidate.js +0 -88
- package/dist/catalog-CKuOooB8.d.ts +0 -354
- package/dist/checks-D73Xizbw.js +0 -59366
- package/dist/checks.d.ts +0 -33
- package/dist/checks.js +0 -2
- package/dist/classes.d.ts +0 -26
- package/dist/classes.js +0 -184
- package/dist/compile-sms.d.ts +0 -28
- package/dist/compile-sms.js +0 -44
- package/dist/compile-whatsapp.d.ts +0 -56
- package/dist/compile-whatsapp.js +0 -186
- package/dist/compile.d.ts +0 -18
- package/dist/compile.js +0 -29
- package/dist/components.d.ts +0 -289
- package/dist/components.js +0 -106
- package/dist/conditionals.d.ts +0 -10
- package/dist/conditionals.js +0 -74
- package/dist/corpus-CPPfgAHN.d.ts +0 -106
- package/dist/diagnostics-OcQKQYSY.d.ts +0 -49
- package/dist/email/selection.d.ts +0 -2
- package/dist/email/selection.js +0 -91
- package/dist/email/source-edit.js +0 -185
- package/dist/email/stylesheets.d.ts +0 -15
- package/dist/email/stylesheets.js +0 -48
- package/dist/emit.d.ts +0 -51
- package/dist/emit.js +0 -151
- package/dist/interpolate.d.ts +0 -24
- package/dist/interpolate.js +0 -43
- package/dist/jsx-dev-runtime.d.ts +0 -11
- package/dist/jsx-dev-runtime.js +0 -15
- package/dist/jsx-runtime-I-1nCtl2.d.ts +0 -57
- package/dist/jsx-runtime.d.ts +0 -2
- package/dist/jsx-runtime.js +0 -121
- package/dist/lexer.d.ts +0 -60
- package/dist/lexer.js +0 -281
- package/dist/model.d.ts +0 -24
- package/dist/model.js +0 -77
- package/dist/ops-BvwqHl7V.js +0 -630
- package/dist/ops.d.ts +0 -114
- package/dist/ops.js +0 -2
- package/dist/parser-t29cHLVL.d.ts +0 -396
- package/dist/parser.d.ts +0 -2
- package/dist/parser.js +0 -859
- package/dist/predicate-BI6uRRM-.js +0 -549
- package/dist/predicate-M-05Nd7R.d.ts +0 -56
- package/dist/predicate.d.ts +0 -2
- package/dist/predicate.js +0 -2
- package/dist/printer.d.ts +0 -6
- package/dist/printer.js +0 -122
- package/dist/registry-Dcp6QEK_.d.ts +0 -73
- package/dist/registry.d.ts +0 -2
- package/dist/registry.js +0 -646
- package/dist/render-template.d.ts +0 -45
- package/dist/render-template.js +0 -76
- package/dist/selection-CCArx9lU.d.ts +0 -91
- package/dist/showcase-egkusQBf.d.ts +0 -415
- package/dist/sms-segments-y4FpPilJ.d.ts +0 -13
- package/dist/source-locations-DrCM82Ym.d.ts +0 -67
- package/dist/starters/category-mapping.d.ts +0 -13
- package/dist/starters/category-mapping.js +0 -49
- package/dist/starters/corpus.d.ts +0 -2
- package/dist/starters/corpus.js +0 -194
- package/dist/starters/library.d.ts +0 -18
- package/dist/starters/library.js +0 -692
- package/dist/starters/public-gallery.d.ts +0 -266
- package/dist/starters/public-gallery.js +0 -916
- package/dist/starters/public-handoff.d.ts +0 -164
- package/dist/starters/public-handoff.js +0 -361
- package/dist/starters/public-preview-artifacts.d.ts +0 -43
- package/dist/starters/public-preview-artifacts.js +0 -104
- package/dist/starters/public-preview.d.ts +0 -61
- package/dist/starters/public-preview.js +0 -83
- package/dist/starters/showcase.d.ts +0 -2
- package/dist/starters/showcase.js +0 -335
- package/dist/starters/sources.d.ts +0 -45
- package/dist/starters/sources.js +0 -7762
- package/dist/starters/theme.d.ts +0 -45
- package/dist/starters/theme.js +0 -77
- package/dist/starters.d.ts +0 -2
- package/dist/starters.js +0 -874
- package/dist/tailwind-BYq7Lo6u.js +0 -727
- package/dist/template-DWftqh4x.d.ts +0 -60
- package/dist/tsx-source-instrumentation.d.ts +0 -30
- package/dist/tsx-source-instrumentation.js +0 -115
- package/dist/tsx-tracer.d.ts +0 -112
- package/dist/tsx-tracer.js +0 -985
- package/dist/variables-J_L3qxRa.d.ts +0 -77
- package/dist/variables.d.ts +0 -2
- package/dist/variables.js +0 -141
- package/dist/version-BITr58kk.js +0 -96
- package/generated/sml-agent-contract.json +0 -709
- package/generated/sml-email-agent-contract.json +0 -615
- package/generated/sml-email-language-reference.md +0 -94
- 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,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 };
|