@samva/markup 0.4.0 → 0.5.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 (102) hide show
  1. package/AGENTS.md +17 -0
  2. package/dist/{ast-63I-VLQx.d.ts → ast-BLybiDxp.d.ts} +34 -60
  3. package/dist/ast.d.ts +2 -2
  4. package/dist/ast.js +4 -52
  5. package/dist/{catalog-Ck1tAGwO.d.ts → catalog-Db0UcCTg.d.ts} +2 -2
  6. package/dist/{checks-DXuERO4B.js → checks-CmmITP6j.js} +14 -14
  7. package/dist/checks.d.ts +1 -1
  8. package/dist/checks.js +1 -1
  9. package/dist/classes.d.ts +1 -1
  10. package/dist/compile-sms.d.ts +3 -3
  11. package/dist/compile-whatsapp.d.ts +5 -5
  12. package/dist/compile-whatsapp.js +3 -3
  13. package/dist/compile.d.ts +5 -5
  14. package/dist/compile.js +5 -5
  15. package/dist/compiler.d.ts +4 -4
  16. package/dist/compiler.js +6 -6
  17. package/dist/components.d.ts +4 -4
  18. package/dist/conditionals.js +3 -3
  19. package/dist/corpus-CM7rKX41.d.ts +106 -0
  20. package/dist/{css-ar2lU3NC.d.ts → css-DoNc7CiC.d.ts} +4 -5
  21. package/dist/diagnostics-CqepLcpI.d.ts +47 -0
  22. package/dist/diagnostics-eFM9A_TU.d.ts +46 -0
  23. package/dist/diagnostics.d.ts +2 -2
  24. package/dist/diagnostics.js +15 -29
  25. package/dist/{elements-DtwKlFVH.d.ts → elements-ChJULZlh.d.ts} +40 -161
  26. package/dist/email/components.d.ts +1 -1
  27. package/dist/email/diagnostics.d.ts +1 -1
  28. package/dist/email/diagnostics.js +8 -43
  29. package/dist/email/elements.d.ts +1 -1
  30. package/dist/email/html.d.ts +2 -2
  31. package/dist/email/html.js +9 -9
  32. package/dist/email/jsx-dev-runtime.d.ts +3 -21
  33. package/dist/email/jsx-runtime.d.ts +1 -1
  34. package/dist/email/jsx-runtime.js +29 -3
  35. package/dist/email/render.d.ts +4 -4
  36. package/dist/email/render.js +1 -1
  37. package/dist/email/selection.d.ts +20 -31
  38. package/dist/email/selection.js +1 -53
  39. package/dist/email/source-edit.d.ts +1 -1
  40. package/dist/email/source-edit.js +2 -2
  41. package/dist/email/stylesheets.d.ts +1 -1
  42. package/dist/email/text.d.ts +1 -1
  43. package/dist/email/text.js +3 -3
  44. package/dist/emit.d.ts +2 -2
  45. package/dist/emit.js +5 -5
  46. package/dist/guards-eV1qLbf2.js +9 -0
  47. package/dist/{input-schema-BIfzI63B.d.ts → input-schema-7dPFVvNE.d.ts} +2 -2
  48. package/dist/input-schema-zjkgrXn2.js +455 -0
  49. package/dist/input-schema.d.ts +1 -1
  50. package/dist/input-schema.js +1 -169
  51. package/dist/interpolate.d.ts +9 -12
  52. package/dist/interpolate.js +1 -19
  53. package/dist/jsx-dev-runtime.d.ts +2 -2
  54. package/dist/{jsx-runtime-C5k_Zq0A.d.ts → jsx-runtime-BI4gI19E.d.ts} +3 -3
  55. package/dist/jsx-runtime.d.ts +1 -1
  56. package/dist/jsx-runtime.js +3 -3
  57. package/dist/model.d.ts +18 -33
  58. package/dist/model.js +4 -17
  59. package/dist/ops.d.ts +78 -172
  60. package/dist/ops.js +51 -117
  61. package/dist/{parser-CGBS73Gz.d.ts → parser-b_Kp5MT6.d.ts} +5 -5
  62. package/dist/parser.d.ts +1 -1
  63. package/dist/parser.js +8 -8
  64. package/dist/{predicate-G2SeSvoN.d.ts → predicate-Bmvgw7Ao.d.ts} +4 -4
  65. package/dist/{predicate-CvkzT-a2.js → predicate-DwXzmqIY.js} +11 -11
  66. package/dist/predicate.d.ts +1 -1
  67. package/dist/predicate.js +1 -1
  68. package/dist/presets/category-mapping.d.ts +1 -1
  69. package/dist/presets/corpus.d.ts +1 -1
  70. package/dist/presets/corpus.js +74 -117
  71. package/dist/presets/public-gallery.d.ts +2 -2
  72. package/dist/presets/public-gallery.js +7 -7
  73. package/dist/presets/public-handoff.d.ts +4 -4
  74. package/dist/presets/public-handoff.js +10 -9
  75. package/dist/presets/public-preview-artifacts.d.ts +5 -5
  76. package/dist/presets/public-preview-artifacts.js +9 -9
  77. package/dist/presets/showcase.d.ts +1 -1
  78. package/dist/presets.d.ts +1 -1
  79. package/dist/printer.d.ts +1 -1
  80. package/dist/{render-ykQhtMs_.js → render-T6IFPnP4.js} +12 -12
  81. package/dist/render-template.d.ts +7 -7
  82. package/dist/render-template.js +6 -6
  83. package/dist/{showcase-C_xgl6hz.d.ts → showcase-dvJMn-Lo.d.ts} +2 -2
  84. package/dist/{source-locations-BCJQnIfU.d.ts → source-locations-D6Te6Gy1.d.ts} +4 -26
  85. package/dist/source-locations.d.ts +2 -2
  86. package/dist/source-locations.js +3 -26
  87. package/dist/{template-Dy5yOPyp.d.ts → template-G-QPcfmn.d.ts} +4 -4
  88. package/dist/template.d.ts +1 -1
  89. package/dist/template.js +3 -3
  90. package/dist/theme-css.d.ts +3 -3
  91. package/dist/theme-css.js +3 -3
  92. package/dist/tsx-source-instrumentation.d.ts +1 -3
  93. package/dist/tsx-source-instrumentation.js +6 -6
  94. package/dist/tsx-tracer.d.ts +7 -11
  95. package/dist/tsx-tracer.js +164 -164
  96. package/dist/{variables-if1VrV34.d.ts → variables-BnKs1iqb.d.ts} +2 -2
  97. package/dist/variables.d.ts +1 -1
  98. package/dist/variables.js +4 -4
  99. package/package.json +4 -3
  100. package/dist/corpus-U2EeALvS.d.ts +0 -234
  101. package/dist/diagnostics-Djd9ckLg.d.ts +0 -90
  102. package/dist/diagnostics-oveE-laV.d.ts +0 -79
package/AGENTS.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Samva Markup consumer guide
2
2
 
3
+ This package is plain TypeScript. It depends on no application runtime, so a template project
4
+ installs the compiler and nothing that comes with one. The structured SML surface — `parseSml`,
5
+ `compileSml`, `compileSource` — returns a better-result `Result` you branch on with `Result.isOk`
6
+ / `Result.isErr`, carrying a `TaggedError` such as `SmlParseError` or `SmlCompileError` that you
7
+ discriminate by `_tag`. Email compilation reports through `EmailDiagnostic` values instead. A
8
+ declaration the compiler cannot accept at all throws a `TypeError`: a template id or fixture key
9
+ that is not one plain path segment, a nonportable input schema, a project holding a reserved
10
+ compiler path.
11
+
12
+ Markup's own data models are types and interfaces, not schema declarations, so there is no schema
13
+ library to adopt to consume them. Their unions discriminate on `type`: an `EmailNode` is `Text`,
14
+ `Element`, `Fragment` or `Raw`, and an `SmlOp` names its edit the same way.
15
+ Only the better-result error classes carry `_tag`. A template's JSON input contract is the one
16
+ exception to the no-schema rule, because it has to be checked against real input: `inputSchema`
17
+ accepts any Standard Schema through the `@standard-schema/spec` types and returns a portable JSON
18
+ Schema with its validator, so which schema library an author reaches for stays theirs.
19
+
3
20
  Email entries default-export `defineEmail` definitions. SMS and WhatsApp use the structured
4
21
  channel runtime at `@samva/markup` and components at `@samva/markup/components`.
5
22
  Use documented package subpaths only. Template entry discovery is `.tsx` only.
@@ -1,5 +1,4 @@
1
- import { c as SpanSchema } from "./diagnostics-oveE-laV.js";
2
- import { Schema } from "effect";
1
+ import { a as Span } from "./diagnostics-CqepLcpI.js";
3
2
  //#region src/ast.d.ts
4
3
  declare const BLOCK_TAGS: readonly ["Email", "Subject", "Preview", "Container", "Section", "Row", "Column", "Heading", "Text", "Button", "Image", "Divider", "Spacer", "List", "ListItem", "If", "Else"];
5
4
  declare const INLINE_TAGS: readonly ["strong", "em", "a"];
@@ -41,74 +40,49 @@ declare const ROOT_TAGS: ReadonlyArray<RootTag>;
41
40
  declare const isRootTag: (tag: string) => tag is RootTag;
42
41
  /** The channel a parsed document targets, read off its root tag. */
43
42
  declare const documentChannel: (document: SmlDocument) => Channel;
44
- declare const AttributeValueSchema: Schema.Union<readonly [Schema.Struct<{
45
- readonly kind: Schema.Literal<"string">;
46
- readonly value: Schema.String;
47
- }>, Schema.Struct<{
48
- readonly kind: Schema.Literal<"number">;
49
- readonly value: Schema.Finite;
50
- }>]>;
51
- type AttributeValue = typeof AttributeValueSchema.Type;
52
- declare const AttributeSchema: Schema.Struct<{
53
- readonly name: Schema.String;
54
- readonly value: Schema.Union<readonly [Schema.Struct<{
55
- readonly kind: Schema.Literal<"string">;
56
- readonly value: Schema.String;
57
- }>, Schema.Struct<{
58
- readonly kind: Schema.Literal<"number">;
59
- readonly value: Schema.Finite;
60
- }>]>;
43
+ type AttributeValue = {
44
+ readonly kind: "string";
45
+ readonly value: string;
46
+ } | {
47
+ readonly kind: "number";
48
+ readonly value: number;
49
+ };
50
+ interface Attribute {
51
+ readonly name: string;
52
+ readonly value: AttributeValue;
61
53
  /** Span of the whole `name="value"` pair. */
62
- readonly span: Schema.Struct<{
63
- readonly start: Schema.Finite;
64
- readonly end: Schema.Finite;
65
- }>;
54
+ readonly span: Span;
66
55
  /** Span of the value contents (inside quotes/braces) — class diagnostics point here. */
67
- readonly valueSpan: Schema.Struct<{
68
- readonly start: Schema.Finite;
69
- readonly end: Schema.Finite;
70
- }>;
71
- }>;
72
- interface Attribute extends Schema.Schema.Type<typeof AttributeSchema> {}
73
- declare const TextNodeSchema: Schema.Struct<{
74
- readonly kind: Schema.Literal<"text">;
75
- readonly id: Schema.String;
76
- readonly value: Schema.String;
77
- readonly span: Schema.Struct<{
78
- readonly start: Schema.Finite;
79
- readonly end: Schema.Finite;
80
- }>;
81
- }>;
82
- interface TextNode extends Schema.Schema.Type<typeof TextNodeSchema> {}
83
- declare const InterpolationNodeSchema: Schema.Struct<{
84
- readonly kind: Schema.Literal<"interpolation">;
85
- readonly id: Schema.String;
86
- readonly name: Schema.String;
56
+ readonly valueSpan: Span;
57
+ }
58
+ interface TextNode {
59
+ readonly kind: "text";
60
+ readonly id: string;
61
+ readonly value: string;
62
+ readonly span: Span;
63
+ }
64
+ interface InterpolationNode {
65
+ readonly kind: "interpolation";
66
+ readonly id: string;
67
+ readonly name: string;
87
68
  /** {{name}} vs ${name} — both today's syntaxes, preserved through print. */
88
- readonly syntax: Schema.Literals<readonly ["curly", "dollar"]>;
89
- readonly span: Schema.Struct<{
90
- readonly start: Schema.Finite;
91
- readonly end: Schema.Finite;
92
- }>;
93
- }>;
94
- interface InterpolationNode extends Schema.Schema.Type<typeof InterpolationNodeSchema> {}
69
+ readonly syntax: "curly" | "dollar";
70
+ readonly span: Span;
71
+ }
95
72
  interface ElementNode {
96
73
  readonly kind: "element";
97
74
  readonly id: string;
98
75
  readonly tag: SmlTag;
99
76
  readonly attributes: ReadonlyArray<Attribute>;
100
77
  readonly children: ReadonlyArray<SmlNode>;
101
- readonly span: typeof SpanSchema.Type;
78
+ readonly span: Span;
102
79
  }
103
80
  type SmlNode = ElementNode | TextNode | InterpolationNode;
104
- declare const ElementNodeSchema: Schema.Codec<ElementNode>;
105
- declare const SmlNodeSchema: Schema.Codec<SmlNode>;
106
- declare const SmlDocumentSchema: Schema.Struct<{
107
- readonly kind: Schema.Literal<"document">;
81
+ interface SmlDocument {
82
+ readonly kind: "document";
108
83
  /** Always a root element: `<Email>`, `<Sms>`, or `<WhatsApp>`. */
109
- readonly root: Schema.Codec<ElementNode, ElementNode, never, never>;
110
- }>;
111
- interface SmlDocument extends Schema.Schema.Type<typeof SmlDocumentSchema> {}
84
+ readonly root: ElementNode;
85
+ }
112
86
  declare const attributeValue: (node: ElementNode, name: string) => AttributeValue | undefined;
113
87
  declare const stringAttribute: (node: ElementNode, name: string) => string | undefined;
114
88
  declare const numberAttribute: (node: ElementNode, name: string) => number | undefined;
@@ -129,5 +103,5 @@ declare const isHiddenNode: (node: ElementNode) => boolean;
129
103
  */
130
104
  declare const collectVariableReferences: (document: SmlDocument) => ReadonlySet<string>;
131
105
  //#endregion
132
- export { TextNodeSchema as A, stringAttribute as B, SML_TAG_BY_COMPONENT_NAME as C, SmlNodeSchema as D, SmlNode as E, isHiddenNode as F, isRootTag as I, nodeLabel as L, collectVariableReferences as M, componentNameForSmlTag as N, SmlTag as O, documentChannel as P, numberAttribute as R, SML_TAGS as S, SmlDocumentSchema as T, InlineTag as _, AttributeValueSchema as a, ROOT_TAGS as b, BlockTag as c, Channel as d, ChannelTag as f, INLINE_TAGS as g, ElementNodeSchema as h, AttributeValue as i, attributeValue as j, TextNode as k, CHANNEL_BY_ROOT_TAG as l, ElementNode as m, Attribute as n, AuxiliaryTag as o, DEFAULT_EMAIL_WIDTH as p, AttributeSchema as r, BLOCK_TAGS as s, AUXILIARY_TAGS as t, CHANNEL_TAGS as u, InterpolationNode as v, SmlDocument as w, RootTag as x, InterpolationNodeSchema as y, smlTagForComponentName as z };
133
- //# sourceMappingURL=ast-63I-VLQx.d.ts.map
106
+ export { nodeLabel as A, TextNode as C, documentChannel as D, componentNameForSmlTag as E, smlTagForComponentName as M, stringAttribute as N, isHiddenNode as O, SmlTag as S, collectVariableReferences as T, RootTag as _, BLOCK_TAGS as a, SmlDocument as b, CHANNEL_TAGS as c, DEFAULT_EMAIL_WIDTH as d, ElementNode as f, ROOT_TAGS as g, InterpolationNode as h, AuxiliaryTag as i, numberAttribute as j, isRootTag as k, Channel as l, InlineTag as m, Attribute as n, BlockTag as o, INLINE_TAGS as p, AttributeValue as r, CHANNEL_BY_ROOT_TAG as s, AUXILIARY_TAGS as t, ChannelTag as u, SML_TAGS as v, attributeValue as w, SmlNode as x, SML_TAG_BY_COMPONENT_NAME as y };
107
+ //# sourceMappingURL=ast-BLybiDxp.d.ts.map
package/dist/ast.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as TextNodeSchema, B as stringAttribute, C as SML_TAG_BY_COMPONENT_NAME, D as SmlNodeSchema, E as SmlNode, F as isHiddenNode, I as isRootTag, L as nodeLabel, M as collectVariableReferences, N as componentNameForSmlTag, O as SmlTag, P as documentChannel, R as numberAttribute, S as SML_TAGS, T as SmlDocumentSchema, _ as InlineTag, a as AttributeValueSchema, b as ROOT_TAGS, c as BlockTag, d as Channel, f as ChannelTag, g as INLINE_TAGS, h as ElementNodeSchema, i as AttributeValue, j as attributeValue, k as TextNode, l as CHANNEL_BY_ROOT_TAG, m as ElementNode, n as Attribute, o as AuxiliaryTag, p as DEFAULT_EMAIL_WIDTH, r as AttributeSchema, s as BLOCK_TAGS, t as AUXILIARY_TAGS, u as CHANNEL_TAGS, v as InterpolationNode, w as SmlDocument, x as RootTag, y as InterpolationNodeSchema, z as smlTagForComponentName } from "./ast-63I-VLQx.js";
2
- export { AUXILIARY_TAGS, Attribute, AttributeSchema, AttributeValue, AttributeValueSchema, AuxiliaryTag, BLOCK_TAGS, BlockTag, CHANNEL_BY_ROOT_TAG, CHANNEL_TAGS, Channel, ChannelTag, DEFAULT_EMAIL_WIDTH, ElementNode, ElementNodeSchema, INLINE_TAGS, InlineTag, InterpolationNode, InterpolationNodeSchema, ROOT_TAGS, RootTag, SML_TAGS, SML_TAG_BY_COMPONENT_NAME, SmlDocument, SmlDocumentSchema, SmlNode, SmlNodeSchema, SmlTag, TextNode, TextNodeSchema, attributeValue, collectVariableReferences, componentNameForSmlTag, documentChannel, isHiddenNode, isRootTag, nodeLabel, numberAttribute, smlTagForComponentName, stringAttribute };
1
+ import { A as nodeLabel, C as TextNode, D as documentChannel, E as componentNameForSmlTag, M as smlTagForComponentName, N as stringAttribute, O as isHiddenNode, S as SmlTag, T as collectVariableReferences, _ as RootTag, a as BLOCK_TAGS, b as SmlDocument, c as CHANNEL_TAGS, d as DEFAULT_EMAIL_WIDTH, f as ElementNode, g as ROOT_TAGS, h as InterpolationNode, i as AuxiliaryTag, j as numberAttribute, k as isRootTag, l as Channel, m as InlineTag, n as Attribute, o as BlockTag, p as INLINE_TAGS, r as AttributeValue, s as CHANNEL_BY_ROOT_TAG, t as AUXILIARY_TAGS, u as ChannelTag, v as SML_TAGS, w as attributeValue, x as SmlNode, y as SML_TAG_BY_COMPONENT_NAME } from "./ast-BLybiDxp.js";
2
+ export { AUXILIARY_TAGS, Attribute, AttributeValue, AuxiliaryTag, BLOCK_TAGS, BlockTag, CHANNEL_BY_ROOT_TAG, CHANNEL_TAGS, Channel, ChannelTag, DEFAULT_EMAIL_WIDTH, ElementNode, INLINE_TAGS, InlineTag, InterpolationNode, ROOT_TAGS, RootTag, SML_TAGS, SML_TAG_BY_COMPONENT_NAME, SmlDocument, SmlNode, SmlTag, TextNode, attributeValue, collectVariableReferences, componentNameForSmlTag, documentChannel, isHiddenNode, isRootTag, nodeLabel, numberAttribute, smlTagForComponentName, stringAttribute };
package/dist/ast.js CHANGED
@@ -1,6 +1,5 @@
1
- import { SpanSchema } from "./diagnostics.js";
2
- import { i as parsePredicate, n as collectPredicateVariables } from "./predicate-CvkzT-a2.js";
3
- import { Result, Schema } from "effect";
1
+ import { i as parsePredicate, n as collectPredicateVariables } from "./predicate-DwXzmqIY.js";
2
+ import { Result } from "better-result";
4
3
  //#region src/ast.ts
5
4
  const BLOCK_TAGS = [
6
5
  "Email",
@@ -68,53 +67,6 @@ const ROOT_TAGS = Object.keys(CHANNEL_BY_ROOT_TAG);
68
67
  const isRootTag = (tag) => tag in CHANNEL_BY_ROOT_TAG;
69
68
  /** The channel a parsed document targets, read off its root tag. */
70
69
  const documentChannel = (document) => CHANNEL_BY_ROOT_TAG[document.root.tag];
71
- const AttributeValueSchema = Schema.Union([Schema.Struct({
72
- kind: Schema.Literal("string"),
73
- value: Schema.String
74
- }), Schema.Struct({
75
- kind: Schema.Literal("number"),
76
- value: Schema.Finite
77
- })]);
78
- const AttributeSchema = Schema.Struct({
79
- name: Schema.String,
80
- value: AttributeValueSchema,
81
- /** Span of the whole `name="value"` pair. */
82
- span: SpanSchema,
83
- /** Span of the value contents (inside quotes/braces) — class diagnostics point here. */
84
- valueSpan: SpanSchema
85
- });
86
- const TextNodeSchema = Schema.Struct({
87
- kind: Schema.Literal("text"),
88
- id: Schema.String,
89
- value: Schema.String,
90
- span: SpanSchema
91
- });
92
- const InterpolationNodeSchema = Schema.Struct({
93
- kind: Schema.Literal("interpolation"),
94
- id: Schema.String,
95
- name: Schema.String,
96
- /** {{name}} vs ${name} — both today's syntaxes, preserved through print. */
97
- syntax: Schema.Literals(["curly", "dollar"]),
98
- span: SpanSchema
99
- });
100
- const ElementNodeSchema = Schema.Struct({
101
- kind: Schema.Literal("element"),
102
- id: Schema.String,
103
- tag: Schema.Literals(SML_TAGS),
104
- attributes: Schema.Array(AttributeSchema),
105
- children: Schema.Array(Schema.suspend(() => SmlNodeSchema)),
106
- span: SpanSchema
107
- });
108
- const SmlNodeSchema = Schema.Union([
109
- ElementNodeSchema,
110
- TextNodeSchema,
111
- InterpolationNodeSchema
112
- ]);
113
- const SmlDocumentSchema = Schema.Struct({
114
- kind: Schema.Literal("document"),
115
- /** Always a root element: `<Email>`, `<Sms>`, or `<WhatsApp>`. */
116
- root: ElementNodeSchema
117
- });
118
70
  const attributeValue = (node, name) => node.attributes.find((attribute) => attribute.name === name)?.value;
119
71
  const stringAttribute = (node, name) => {
120
72
  const value = attributeValue(node, name);
@@ -153,7 +105,7 @@ const collectVariableReferences = (document) => {
153
105
  if (attribute.value.kind !== "string") continue;
154
106
  if (node.tag === "If" && attribute.name === "test") {
155
107
  const parsed = parsePredicate(attribute.value.value);
156
- if (Result.isSuccess(parsed)) for (const name of collectPredicateVariables(parsed.success)) names.add(name);
108
+ if (Result.isOk(parsed)) for (const name of collectPredicateVariables(parsed.value)) names.add(name);
157
109
  continue;
158
110
  }
159
111
  for (const match of attribute.value.value.matchAll(attributePattern)) {
@@ -167,6 +119,6 @@ const collectVariableReferences = (document) => {
167
119
  return names;
168
120
  };
169
121
  //#endregion
170
- export { AUXILIARY_TAGS, AttributeSchema, AttributeValueSchema, BLOCK_TAGS, CHANNEL_BY_ROOT_TAG, CHANNEL_TAGS, DEFAULT_EMAIL_WIDTH, ElementNodeSchema, INLINE_TAGS, InterpolationNodeSchema, ROOT_TAGS, SML_TAGS, SML_TAG_BY_COMPONENT_NAME, SmlDocumentSchema, SmlNodeSchema, TextNodeSchema, attributeValue, collectVariableReferences, componentNameForSmlTag, documentChannel, isHiddenNode, isRootTag, nodeLabel, numberAttribute, smlTagForComponentName, stringAttribute };
122
+ export { AUXILIARY_TAGS, BLOCK_TAGS, CHANNEL_BY_ROOT_TAG, CHANNEL_TAGS, DEFAULT_EMAIL_WIDTH, INLINE_TAGS, ROOT_TAGS, SML_TAGS, SML_TAG_BY_COMPONENT_NAME, attributeValue, collectVariableReferences, componentNameForSmlTag, documentChannel, isHiddenNode, isRootTag, nodeLabel, numberAttribute, smlTagForComponentName, stringAttribute };
171
123
 
172
124
  //# sourceMappingURL=ast.js.map
@@ -1,4 +1,4 @@
1
- import { d as Channel } from "./ast-63I-VLQx.js";
1
+ import { l as Channel } from "./ast-BLybiDxp.js";
2
2
  import { o as TokenOverrides } from "./theme-6ApjjiBo.js";
3
3
  //#region presets/catalog.d.ts
4
4
  type PresetCategory = "transactional" | "digest" | "marketing" | "lifecycle";
@@ -353,4 +353,4 @@ type EmailPresetVariable = EmailPreset extends (infer Preset) ? Preset extends {
353
353
  } ? Variable : never : never;
354
354
  //#endregion
355
355
  export { PresetMeta as a, presetCatalog as c, PresetId as i, EmailPresetVariable as n, PresetVariable as o, PresetCategory as r, RECOMMENDED_THEME as s, EmailPresetId as t };
356
- //# sourceMappingURL=catalog-Ck1tAGwO.d.ts.map
356
+ //# sourceMappingURL=catalog-Db0UcCTg.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { formatDiagnostic } from "./diagnostics.js";
2
- import { i as parsePredicate } from "./predicate-CvkzT-a2.js";
2
+ import { i as parsePredicate } from "./predicate-DwXzmqIY.js";
3
3
  import { stringAttribute } from "./ast.js";
4
4
  import { parseCandidate, splitRoot } from "./candidate.js";
5
5
  import { registryRoots, utilityRegistry } from "./registry.js";
@@ -7,7 +7,7 @@ import { resolveClasses } from "./classes.js";
7
7
  import { decodeEntities } from "./lexer.js";
8
8
  import { parseSml } from "./parser.js";
9
9
  import { baseTokens } from "./tokens.js";
10
- import { Result } from "effect";
10
+ import { Result } from "better-result";
11
11
  //#region src/caniemail-compact.ts
12
12
  const caniemailCompactData = {
13
13
  apiVersion: "1.0.4",
@@ -58604,7 +58604,7 @@ const DELIVERY_ASSET_ATTRIBUTES = {
58604
58604
  */
58605
58605
  const checkDeliveryAssetDiagnostics = (source) => {
58606
58606
  const parsed = parseSml(source);
58607
- if (Result.isFailure(parsed)) return [];
58607
+ if (Result.isError(parsed)) return [];
58608
58608
  const diagnostics = [];
58609
58609
  const visit = (node) => {
58610
58610
  if (node.kind !== "element") return;
@@ -58621,7 +58621,7 @@ const checkDeliveryAssetDiagnostics = (source) => {
58621
58621
  }
58622
58622
  for (const child of node.children) visit(child);
58623
58623
  };
58624
- visit(parsed.success.root);
58624
+ visit(parsed.value.root);
58625
58625
  return diagnostics;
58626
58626
  };
58627
58627
  function isBreakingCompatibilityCheck(message) {
@@ -58749,14 +58749,14 @@ const analyzeDocument = (document) => {
58749
58749
  };
58750
58750
  const analyzeSource = (source) => {
58751
58751
  const parsed = parseSml(source);
58752
- if (Result.isFailure(parsed)) return {
58752
+ if (Result.isError(parsed)) return {
58753
58753
  featureSlugs: /* @__PURE__ */ new Set(),
58754
58754
  hasDarkClasses: false,
58755
58755
  hasImages: false,
58756
58756
  hasPureBlackText: false,
58757
58757
  styledElements: []
58758
58758
  };
58759
- return analyzeDocument(parsed.success);
58759
+ return analyzeDocument(parsed.value);
58760
58760
  };
58761
58761
  const collectPredicateVariableReferences = (ast) => {
58762
58762
  const references = [];
@@ -58840,9 +58840,9 @@ const predicateDiagnosticMessages = (source, document, declaredVariables) => {
58840
58840
  if (testAttribute?.value.kind === "string") {
58841
58841
  const predicate = predicateSource(source, testAttribute);
58842
58842
  const parsed = parsePredicate(predicate.text);
58843
- if (Result.isFailure(parsed)) for (const diagnostic of parsed.failure) messages.push(`error: ${formatDiagnostic(source, predicate.mapDiagnostic(diagnostic))}`);
58843
+ if (Result.isError(parsed)) for (const diagnostic of parsed.error) messages.push(`error: ${formatDiagnostic(source, predicate.mapDiagnostic(diagnostic))}`);
58844
58844
  else if (declared !== void 0) {
58845
- for (const reference of collectPredicateVariableReferences(parsed.success)) if (!declared.has(reference.name)) messages.push(`error: ${formatDiagnostic(source, {
58845
+ for (const reference of collectPredicateVariableReferences(parsed.value)) if (!declared.has(reference.name)) messages.push(`error: ${formatDiagnostic(source, {
58846
58846
  code: "predicate-unknown-variable",
58847
58847
  message: `unknown predicate variable "${reference.name}" in <If test>`,
58848
58848
  span: predicate.mapSpan(reference.span)
@@ -58857,8 +58857,8 @@ const predicateDiagnosticMessages = (source, document, declaredVariables) => {
58857
58857
  };
58858
58858
  const parseFailurePredicateMessages = (source) => {
58859
58859
  const parsed = parseSml(source);
58860
- if (Result.isSuccess(parsed)) return [];
58861
- return parsed.failure.diagnostics.filter((diagnostic) => diagnostic.code.startsWith("predicate-")).map((diagnostic) => `error: ${formatDiagnostic(source, diagnostic)}`);
58860
+ if (Result.isOk(parsed)) return [];
58861
+ return parsed.error.diagnostics.filter((diagnostic) => diagnostic.code.startsWith("predicate-")).map((diagnostic) => `error: ${formatDiagnostic(source, diagnostic)}`);
58862
58862
  };
58863
58863
  const clientsByDarkBehavior = (profile, behavior) => profile.targets.filter((target) => target.darkBehavior === behavior).map(targetLabel).filter((label, index, labels) => labels.indexOf(label) === index);
58864
58864
  const gmailForcedInvertClients = (profile) => profile.targets.filter((target) => target.family === "gmail" && target.darkBehavior === "force-inverts").map(targetLabel);
@@ -58941,10 +58941,10 @@ function worstCaseArtifactBytes(html) {
58941
58941
  function checkSmlCompatibility(input) {
58942
58942
  const profile = input.profile ?? DEFAULT_EMAIL_TARGET_CLIENT_PROFILE;
58943
58943
  const parsed = parseSml(input.source);
58944
- if (Result.isFailure(parsed)) return parseFailurePredicateMessages(input.source);
58945
- const analysis = analyzeDocument(parsed.success);
58944
+ if (Result.isError(parsed)) return parseFailurePredicateMessages(input.source);
58945
+ const analysis = analyzeDocument(parsed.value);
58946
58946
  return [
58947
- ...predicateDiagnosticMessages(input.source, parsed.success, input.declaredVariables),
58947
+ ...predicateDiagnosticMessages(input.source, parsed.value, input.declaredVariables),
58948
58948
  ...checkDeliveryAssetDiagnostics(input.source).map((diagnostic) => `error: ${formatDiagnostic(input.source, diagnostic)}`),
58949
58949
  ...caniemailMessages(analysis.featureSlugs, profile),
58950
58950
  ...darkModeMessages(analysis, profile)
@@ -58953,4 +58953,4 @@ function checkSmlCompatibility(input) {
58953
58953
  //#endregion
58954
58954
  export { isBreakingCompatibilityCheck as a, collectSmlFeatureSlugs as i, checkDeliveryAssetDiagnostics as n, worstCaseArtifactBytes as o, checkSmlCompatibility as r, DEFAULT_EMAIL_TARGET_CLIENT_PROFILE as t };
58955
58955
 
58956
- //# sourceMappingURL=checks-DXuERO4B.js.map
58956
+ //# sourceMappingURL=checks-CmmITP6j.js.map
package/dist/checks.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as Diagnostic } from "./diagnostics-oveE-laV.js";
1
+ import { t as Diagnostic } from "./diagnostics-CqepLcpI.js";
2
2
  //#region src/checks.d.ts
3
3
  type EmailClientDarkBehavior = "honors" | "force-inverts" | "no dark mode";
4
4
  interface EmailClientTarget {
package/dist/checks.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as isBreakingCompatibilityCheck, i as collectSmlFeatureSlugs, n as checkDeliveryAssetDiagnostics, o as worstCaseArtifactBytes, r as checkSmlCompatibility, t as DEFAULT_EMAIL_TARGET_CLIENT_PROFILE } from "./checks-DXuERO4B.js";
1
+ import { a as isBreakingCompatibilityCheck, i as collectSmlFeatureSlugs, n as checkDeliveryAssetDiagnostics, o as worstCaseArtifactBytes, r as checkSmlCompatibility, t as DEFAULT_EMAIL_TARGET_CLIENT_PROFILE } from "./checks-CmmITP6j.js";
2
2
  export { DEFAULT_EMAIL_TARGET_CLIENT_PROFILE, checkDeliveryAssetDiagnostics, checkSmlCompatibility, collectSmlFeatureSlugs, isBreakingCompatibilityCheck, worstCaseArtifactBytes };
package/dist/classes.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { s as Span, t as Diagnostic } from "./diagnostics-oveE-laV.js";
1
+ import { a as Span, t as Diagnostic } from "./diagnostics-CqepLcpI.js";
2
2
  import { s as TokenTable } from "./theme-6ApjjiBo.js";
3
3
  import { Declaration } from "./registry.js";
4
4
  //#region src/classes.d.ts
@@ -1,6 +1,6 @@
1
- import { t as Diagnostic } from "./diagnostics-oveE-laV.js";
2
- import { m as ElementNode } from "./ast-63I-VLQx.js";
3
- import { a as SMS_TAG_SPECS } from "./parser-CGBS73Gz.js";
1
+ import { t as Diagnostic } from "./diagnostics-CqepLcpI.js";
2
+ import { f as ElementNode } from "./ast-BLybiDxp.js";
3
+ import { a as SMS_TAG_SPECS } from "./parser-b_Kp5MT6.js";
4
4
  import { t as SmsEncoding } from "./sms-segments-y4FpPilJ.js";
5
5
  //#region src/compile-sms.d.ts
6
6
  /** Documented worst-case rendered width of one `{{variable}}`. */
@@ -1,7 +1,7 @@
1
- import { a as SmlCompileError, t as Diagnostic } from "./diagnostics-oveE-laV.js";
2
- import { m as ElementNode } from "./ast-63I-VLQx.js";
3
- import { l as WHATSAPP_TAG_SPECS } from "./parser-CGBS73Gz.js";
4
- import { Result } from "effect";
1
+ import { r as SmlCompileError, t as Diagnostic } from "./diagnostics-CqepLcpI.js";
2
+ import { f as ElementNode } from "./ast-BLybiDxp.js";
3
+ import { l as WHATSAPP_TAG_SPECS } from "./parser-b_Kp5MT6.js";
4
+ import { Result } from "better-result";
5
5
  //#region src/compile-whatsapp.d.ts
6
6
  type WhatsAppSpecs = typeof WHATSAPP_TAG_SPECS;
7
7
  /** Mirrors whatsappTemplateCategoryEnum, derived from the grammar's closed set. */
@@ -50,7 +50,7 @@ interface CompiledWhatsApp {
50
50
  readonly compilerVersion: string;
51
51
  }
52
52
  /** Root is a parsed `<WhatsApp>` element; the grammar already validated its anatomy. */
53
- declare const compileWhatsAppRoot: (root: ElementNode) => Result.Result<CompiledWhatsApp, SmlCompileError>;
53
+ declare const compileWhatsAppRoot: (root: ElementNode) => Result<CompiledWhatsApp, SmlCompileError>;
54
54
  //#endregion
55
55
  export { CompiledWhatsApp, WhatsAppButtonPayload, WhatsAppExamples, WhatsAppHeaderMediaType, WhatsAppHeaderType, WhatsAppTemplateCategory, compileWhatsAppRoot };
56
56
  //# sourceMappingURL=compile-whatsapp.d.ts.map
@@ -2,7 +2,7 @@ import { SmlCompileError } from "./diagnostics.js";
2
2
  import { stringAttribute } from "./ast.js";
3
3
  import { n as channelTextVariants, r as flattenChannelText, t as COMPILER_VERSION } from "./version-BITr58kk.js";
4
4
  import { variableReferences } from "./interpolate.js";
5
- import { Result } from "effect";
5
+ import { Result } from "better-result";
6
6
  //#region src/compile-whatsapp.ts
7
7
  const WHATSAPP_BUTTON_LIMITS = {
8
8
  URL: 2,
@@ -158,8 +158,8 @@ const compileWhatsAppRoot = (root) => {
158
158
  message: "whatsapp mixes positional {{1}} and named {{var}} placeholders; Meta requires one style",
159
159
  span: root.span
160
160
  });
161
- if (errors.length > 0) return Result.fail(new SmlCompileError({ diagnostics: errors }));
162
- return Result.succeed({
161
+ if (errors.length > 0) return Result.err(new SmlCompileError({ diagnostics: errors }));
162
+ return Result.ok({
163
163
  channel: "whatsapp",
164
164
  name: stringAttribute(root, "name"),
165
165
  language: stringAttribute(root, "language"),
package/dist/compile.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { a as SmlCompileError, o as SmlParseError } from "./diagnostics-oveE-laV.js";
2
- import { w as SmlDocument } from "./ast-63I-VLQx.js";
1
+ import { i as SmlParseError, r as SmlCompileError } from "./diagnostics-CqepLcpI.js";
2
+ import { b as SmlDocument } from "./ast-BLybiDxp.js";
3
3
  import { CompiledSms } from "./compile-sms.js";
4
4
  import { CompiledWhatsApp } from "./compile-whatsapp.js";
5
- import { Result } from "effect";
5
+ import { Result } from "better-result";
6
6
  //#region src/version.d.ts
7
7
  declare const COMPILER_VERSION = "0.1.0";
8
8
  //#endregion
@@ -10,9 +10,9 @@ declare const COMPILER_VERSION = "0.1.0";
10
10
  /** Structured channel payloads compiled from recorded SML. */
11
11
  type CompiledTemplate = CompiledSms | CompiledWhatsApp;
12
12
  /** Compile a structured document; email definitions execute through the email runtime. */
13
- declare const compileSml: (document: SmlDocument) => Result.Result<CompiledTemplate, SmlCompileError>;
13
+ declare const compileSml: (document: SmlDocument) => Result<CompiledTemplate, SmlCompileError>;
14
14
  /** Parse and compile a structured SMS or WhatsApp document. */
15
- declare const compileSource: (source: string) => Result.Result<CompiledTemplate, SmlParseError | SmlCompileError>;
15
+ declare const compileSource: (source: string) => Result<CompiledTemplate, SmlParseError | SmlCompileError>;
16
16
  //#endregion
17
17
  export { COMPILER_VERSION, CompiledTemplate, compileSml, compileSource };
18
18
  //# sourceMappingURL=compile.d.ts.map
package/dist/compile.js CHANGED
@@ -3,14 +3,14 @@ import { parseSml } from "./parser.js";
3
3
  import { t as COMPILER_VERSION } from "./version-BITr58kk.js";
4
4
  import { compileSmsRoot } from "./compile-sms.js";
5
5
  import { compileWhatsAppRoot } from "./compile-whatsapp.js";
6
- import { Result } from "effect";
6
+ import { Result } from "better-result";
7
7
  //#region src/compile.ts
8
8
  /** Compile a structured document; email definitions execute through the email runtime. */
9
9
  const compileSml = (document) => {
10
10
  switch (document.root.tag) {
11
- case "Sms": return Result.succeed(compileSmsRoot(document.root));
11
+ case "Sms": return Result.ok(compileSmsRoot(document.root));
12
12
  case "WhatsApp": return compileWhatsAppRoot(document.root);
13
- default: return Result.fail(new SmlCompileError({ diagnostics: [{
13
+ default: return Result.err(new SmlCompileError({ diagnostics: [{
14
14
  code: "email-requires-object-template",
15
15
  message: "Email templates must default-export defineEmail with an input schema and fixtures.",
16
16
  span: document.root.span
@@ -20,8 +20,8 @@ const compileSml = (document) => {
20
20
  /** Parse and compile a structured SMS or WhatsApp document. */
21
21
  const compileSource = (source) => {
22
22
  const parsed = parseSml(source);
23
- if (Result.isFailure(parsed)) return Result.fail(parsed.failure);
24
- return compileSml(parsed.success);
23
+ if (Result.isError(parsed)) return Result.err(parsed.error);
24
+ return compileSml(parsed.value);
25
25
  };
26
26
  //#endregion
27
27
  export { COMPILER_VERSION, compileSml, compileSource };
@@ -1,9 +1,9 @@
1
- import { a as formatEmailDiagnostic, i as EmailDiagnosticSeverity, n as EmailCompileError, o as hasBlockingDiagnostic, r as EmailDiagnostic } from "./diagnostics-Djd9ckLg.js";
2
- import { a as EmailGlobalProps, c as EmailStyle, d as isUrlAttribute, i as EmailElementSpec, l as EmailTag, m as EmailNode, n as EMAIL_GLOBAL_ATTRIBUTES, o as EmailIntrinsicElements, r as EmailAttributeSpec, s as EmailLayout, t as EMAIL_ELEMENTS, u as emailElement } from "./elements-DtwKlFVH.js";
1
+ import { a as formatEmailDiagnostic, i as EmailDiagnosticSeverity, n as EmailCompileError, o as hasBlockingDiagnostic, r as EmailDiagnostic } from "./diagnostics-eFM9A_TU.js";
2
+ import { a as EmailGlobalProps, c as EmailStyle, d as isUrlAttribute, i as EmailElementSpec, l as EmailTag, m as EmailNode, n as EMAIL_GLOBAL_ATTRIBUTES, o as EmailIntrinsicElements, r as EmailAttributeSpec, s as EmailLayout, t as EMAIL_ELEMENTS, u as emailElement } from "./elements-ChJULZlh.js";
3
3
  import { EmailElementSelection, EmittedPosition, INSTANCE_PATH_ATTRIBUTE, emailAuthoringTarget, emailDefinitionInstances, emailSelectionAncestry, emailSelectionIndex, emailSelectionSiblings, emailSelections } from "./email/selection.js";
4
4
  import { EmailHtmlOutput, SerializeEmailOptions, escapeAttribute, escapeText, serializeEmailHtml } from "./email/html.js";
5
5
  import { deriveEmailText } from "./email/text.js";
6
- import { a as compileSelector, c as CompiledSelector, d as matchesSelector, i as Stylesheet, l as Compound, n as CssRule, o as parseStylesheet, r as Specificity, s as Ancestry, t as CssDeclaration, u as classListOf } from "./css-ar2lU3NC.js";
6
+ import { a as compileSelector, c as CompiledSelector, d as matchesSelector, i as Stylesheet, l as Compound, n as CssRule, o as parseStylesheet, r as Specificity, s as Ancestry, t as CssDeclaration, u as classListOf } from "./css-DoNc7CiC.js";
7
7
  import { EMAIL_DOCTYPE, EmailCompileOutput, RenderedEmail, compileEmail, renderEmail } from "./email/render.js";
8
8
  import { collectStylesheets, hasStylesheets, registerStylesheet, resetStylesheets } from "./email/stylesheets.js";
9
9
  import { instrumentTsxSourceForPreview } from "./tsx-source-instrumentation.js";
@@ -299,5 +299,5 @@ interface CompiledEmailProject {
299
299
  */
300
300
  declare const compileEmailProject: (source: Readonly<Record<string, string | Uint8Array>>, authoredEntry: string, options: TransformOptions) => Promise<CompiledEmailProject>;
301
301
  //#endregion
302
- export { ASSET_CONTENT_TYPES, type Ancestry, type AppliedStyles, type AssetEntry, type AssetManifest, COMPATIBILITY_PROVENANCE, type ClassDiscovery, type CompatibilityInput, type CompatibilityProvenance, type CompiledEmailProject, type CompiledSelector, type Compound, type CssDeclaration, type CssRule, EMAIL_CLIENT_MATRIX, EMAIL_DOCTYPE, EMAIL_ELEMENTS, EMAIL_ENTRY_WRAPPER, EMAIL_GLOBAL_ATTRIBUTES, EMAIL_RESET_MODULE, ESSENTIAL_CONSTRUCTS, type EmailAttributeSpec, type EmailClientTarget, EmailCompileError, type EmailCompileOutput, EmailDiagnostic, EmailDiagnosticSeverity, EmailElementSelection, type EmailElementSpec, type EmailGlobalProps, type EmailHtmlOutput, type EmailIntrinsicElements, type EmailLayout, type EmailStyle, type EmailTag, EmittedPosition, INSTANCE_PATH_ATTRIBUTE, type ModuleTransform, type ProjectTransform, type RenderedEmail, type SerializeEmailOptions, type Specificity, type Stylesheet, TAILWIND_MODULE_PATH, TAILWIND_VERSION, type TailwindLimits, type TailwindOptions, type TailwindOutput, type TransformOptions, applyStylesheet, assetEntry, assetUrl, checkAssetBase, checkEmailCompatibility, classListOf, collectStylesheets, compileEmail, compileEmailProject, compileSelector, compileTailwind, deriveEmailText, discoverClassCandidates, downlevelColors, downlevelMediaQuery, emailAuthoringTarget, emailDefinitionInstances, emailElement, emailEntryWrapper, emailResetModule, emailSelectionAncestry, emailSelectionIndex, emailSelectionSiblings, emailSelections, escapeAttribute, escapeText, finalizeValue, foldCalc, formatColor, formatEmailDiagnostic, hasBlockingCompatibility, hasBlockingDiagnostic, hasStylesheets, instrumentTsxSourceForPreview, isAssetPath, isExternalAsset, isUrlAttribute, matchesSelector, parseColor, parseStylesheet, registerStylesheet, renderEmail, renderHeadCss, resetStylesheets, resolveVariables, serializeEmailHtml, tailwindSpecifierFor, transformModule, transformProject, unknownCoverage, withLeadingImport };
302
+ export { ASSET_CONTENT_TYPES, type Ancestry, type AppliedStyles, type AssetEntry, type AssetManifest, COMPATIBILITY_PROVENANCE, type ClassDiscovery, type CompatibilityInput, type CompatibilityProvenance, type CompiledEmailProject, type CompiledSelector, type Compound, type CssDeclaration, type CssRule, EMAIL_CLIENT_MATRIX, EMAIL_DOCTYPE, EMAIL_ELEMENTS, EMAIL_ENTRY_WRAPPER, EMAIL_GLOBAL_ATTRIBUTES, EMAIL_RESET_MODULE, ESSENTIAL_CONSTRUCTS, type EmailAttributeSpec, type EmailClientTarget, EmailCompileError, type EmailCompileOutput, type EmailDiagnostic, type EmailDiagnosticSeverity, type EmailElementSelection, type EmailElementSpec, type EmailGlobalProps, type EmailHtmlOutput, type EmailIntrinsicElements, type EmailLayout, type EmailStyle, type EmailTag, type EmittedPosition, INSTANCE_PATH_ATTRIBUTE, type ModuleTransform, type ProjectTransform, type RenderedEmail, type SerializeEmailOptions, type Specificity, type Stylesheet, TAILWIND_MODULE_PATH, TAILWIND_VERSION, type TailwindLimits, type TailwindOptions, type TailwindOutput, type TransformOptions, applyStylesheet, assetEntry, assetUrl, checkAssetBase, checkEmailCompatibility, classListOf, collectStylesheets, compileEmail, compileEmailProject, compileSelector, compileTailwind, deriveEmailText, discoverClassCandidates, downlevelColors, downlevelMediaQuery, emailAuthoringTarget, emailDefinitionInstances, emailElement, emailEntryWrapper, emailResetModule, emailSelectionAncestry, emailSelectionIndex, emailSelectionSiblings, emailSelections, escapeAttribute, escapeText, finalizeValue, foldCalc, formatColor, formatEmailDiagnostic, hasBlockingCompatibility, hasBlockingDiagnostic, hasStylesheets, instrumentTsxSourceForPreview, isAssetPath, isExternalAsset, isUrlAttribute, matchesSelector, parseColor, parseStylesheet, registerStylesheet, renderEmail, renderHeadCss, resetStylesheets, resolveVariables, serializeEmailHtml, tailwindSpecifierFor, transformModule, transformProject, unknownCoverage, withLeadingImport };
303
303
  //# sourceMappingURL=compiler.d.ts.map
package/dist/compiler.js CHANGED
@@ -1,13 +1,13 @@
1
- import { a as applyStylesheet, c as downlevelMediaQuery, d as renderHeadCss, f as resolveVariables, i as renderEmail, l as finalizeValue, o as classListOf, r as compileEmail, s as matchesSelector, t as EMAIL_DOCTYPE, u as foldCalc } from "./render-ykQhtMs_.js";
1
+ import { n as isObject } from "./guards-eV1qLbf2.js";
2
+ import { a as applyStylesheet, c as downlevelMediaQuery, d as renderHeadCss, f as resolveVariables, i as renderEmail, l as finalizeValue, o as classListOf, r as compileEmail, s as matchesSelector, t as EMAIL_DOCTYPE, u as foldCalc } from "./render-T6IFPnP4.js";
2
3
  import { EMAIL_ELEMENTS, EMAIL_GLOBAL_ATTRIBUTES, emailElement, isUrlAttribute } from "./email/elements.js";
3
- import { EmailElementSelection, EmittedPosition, INSTANCE_PATH_ATTRIBUTE, emailAuthoringTarget, emailDefinitionInstances, emailSelectionAncestry, emailSelectionIndex, emailSelectionSiblings, emailSelections } from "./email/selection.js";
4
+ import { INSTANCE_PATH_ATTRIBUTE, emailAuthoringTarget, emailDefinitionInstances, emailSelectionAncestry, emailSelectionIndex, emailSelectionSiblings, emailSelections } from "./email/selection.js";
4
5
  import { escapeAttribute, escapeText, serializeEmailHtml } from "./email/html.js";
5
- import { EmailCompileError, EmailDiagnostic, EmailDiagnosticSeverity, formatEmailDiagnostic, hasBlockingDiagnostic } from "./email/diagnostics.js";
6
+ import { EmailCompileError, formatEmailDiagnostic, hasBlockingDiagnostic } from "./email/diagnostics.js";
6
7
  import { collectStylesheets, hasStylesheets, registerStylesheet, resetStylesheets } from "./email/stylesheets.js";
7
8
  import { deriveEmailText } from "./email/text.js";
8
9
  import { buildLineMap, lineColumn } from "./diagnostics.js";
9
10
  import { instrumentTsxSourceForPreview } from "./tsx-source-instrumentation.js";
10
- import { Predicate } from "effect";
11
11
  import { parse } from "@babel/parser";
12
12
  import { caniemail, parseHtml, rawData } from "caniemail";
13
13
  import { generate, ident, parse as parse$1, walk } from "css-tree";
@@ -1134,7 +1134,7 @@ const compileTailwind = async (candidates, options = {}) => {
1134
1134
  candidates: all
1135
1135
  };
1136
1136
  };
1137
- const isRecord = (value) => Predicate.isObject(value) && !Array.isArray(value);
1137
+ const isRecord = (value) => isObject(value) && !Array.isArray(value);
1138
1138
  const isAstNode = (value) => isRecord(value) && typeof value.type === "string" && typeof value.start === "number" && typeof value.end === "number";
1139
1139
  const walk$1 = (value, visit) => {
1140
1140
  if (Array.isArray(value)) {
@@ -1385,6 +1385,6 @@ const compileEmailProject = async (source, authoredEntry, options) => {
1385
1385
  };
1386
1386
  };
1387
1387
  //#endregion
1388
- export { ASSET_CONTENT_TYPES, COMPATIBILITY_PROVENANCE, EMAIL_CLIENT_MATRIX, EMAIL_DOCTYPE, EMAIL_ELEMENTS, EMAIL_ENTRY_WRAPPER, EMAIL_GLOBAL_ATTRIBUTES, EMAIL_RESET_MODULE, ESSENTIAL_CONSTRUCTS, EmailCompileError, EmailDiagnostic, EmailDiagnosticSeverity, EmailElementSelection, EmittedPosition, INSTANCE_PATH_ATTRIBUTE, TAILWIND_MODULE_PATH, TAILWIND_VERSION, applyStylesheet, assetEntry, assetUrl, checkAssetBase, checkEmailCompatibility, classListOf, collectStylesheets, compileEmail, compileEmailProject, compileSelector, compileTailwind, deriveEmailText, discoverClassCandidates, downlevelColors, downlevelMediaQuery, emailAuthoringTarget, emailDefinitionInstances, emailElement, emailEntryWrapper, emailResetModule, emailSelectionAncestry, emailSelectionIndex, emailSelectionSiblings, emailSelections, escapeAttribute, escapeText, finalizeValue, foldCalc, formatColor, formatEmailDiagnostic, hasBlockingCompatibility, hasBlockingDiagnostic, hasStylesheets, instrumentTsxSourceForPreview, isAssetPath, isExternalAsset, isUrlAttribute, matchesSelector, parseColor, parseStylesheet, registerStylesheet, renderEmail, renderHeadCss, resetStylesheets, resolveVariables, serializeEmailHtml, tailwindSpecifierFor, transformModule, transformProject, unknownCoverage, withLeadingImport };
1388
+ export { ASSET_CONTENT_TYPES, COMPATIBILITY_PROVENANCE, EMAIL_CLIENT_MATRIX, EMAIL_DOCTYPE, EMAIL_ELEMENTS, EMAIL_ENTRY_WRAPPER, EMAIL_GLOBAL_ATTRIBUTES, EMAIL_RESET_MODULE, ESSENTIAL_CONSTRUCTS, EmailCompileError, INSTANCE_PATH_ATTRIBUTE, TAILWIND_MODULE_PATH, TAILWIND_VERSION, applyStylesheet, assetEntry, assetUrl, checkAssetBase, checkEmailCompatibility, classListOf, collectStylesheets, compileEmail, compileEmailProject, compileSelector, compileTailwind, deriveEmailText, discoverClassCandidates, downlevelColors, downlevelMediaQuery, emailAuthoringTarget, emailDefinitionInstances, emailElement, emailEntryWrapper, emailResetModule, emailSelectionAncestry, emailSelectionIndex, emailSelectionSiblings, emailSelections, escapeAttribute, escapeText, finalizeValue, foldCalc, formatColor, formatEmailDiagnostic, hasBlockingCompatibility, hasBlockingDiagnostic, hasStylesheets, instrumentTsxSourceForPreview, isAssetPath, isExternalAsset, isUrlAttribute, matchesSelector, parseColor, parseStylesheet, registerStylesheet, renderEmail, renderHeadCss, resetStylesheets, resolveVariables, serializeEmailHtml, tailwindSpecifierFor, transformModule, transformProject, unknownCoverage, withLeadingImport };
1389
1389
 
1390
1390
  //# sourceMappingURL=compiler.js.map
@@ -1,7 +1,7 @@
1
- import { m as ElementNode } from "./ast-63I-VLQx.js";
2
- import { i as EMAIL_TAG_SPECS, l as WHATSAPP_TAG_SPECS, o as TagSpec, t as AttributeSpec } from "./parser-CGBS73Gz.js";
3
- import { r as PredicateRef, s as VariableRef } from "./variables-if1VrV34.js";
4
- import { s as SmlChildren } from "./jsx-runtime-C5k_Zq0A.js";
1
+ import { f as ElementNode } from "./ast-BLybiDxp.js";
2
+ import { i as EMAIL_TAG_SPECS, l as WHATSAPP_TAG_SPECS, o as TagSpec, t as AttributeSpec } from "./parser-b_Kp5MT6.js";
3
+ import { r as PredicateRef, s as VariableRef } from "./variables-BnKs1iqb.js";
4
+ import { s as SmlChildren } from "./jsx-runtime-BI4gI19E.js";
5
5
  //#region src/components.d.ts
6
6
  /**
7
7
  * The scalar type an attribute spec accepts. `level` narrows to the Heading
@@ -1,5 +1,5 @@
1
- import { i as parsePredicate, r as evaluatePredicate } from "./predicate-CvkzT-a2.js";
2
- import { Result } from "effect";
1
+ import { i as parsePredicate, r as evaluatePredicate } from "./predicate-DwXzmqIY.js";
2
+ import { Result } from "better-result";
3
3
  //#region src/conditionals.ts
4
4
  const IF_MARKER = "<!--sml:if:";
5
5
  const MARKER_CLOSE = "-->";
@@ -20,7 +20,7 @@ const resolve = (content, variables) => {
20
20
  const elseCandidate = content.indexOf(elseMarker, bodyStart);
21
21
  const elseIndex = elseCandidate !== -1 && elseCandidate < endIndex ? elseCandidate : -1;
22
22
  const parsed = parsePredicate(predicateSource);
23
- const condition = Result.isSuccess(parsed) && evaluatePredicate(parsed.success, variables);
23
+ const condition = Result.isOk(parsed) && evaluatePredicate(parsed.value, variables);
24
24
  const branchA = content.slice(bodyStart, elseIndex === -1 ? endIndex : elseIndex);
25
25
  const branchB = elseIndex === -1 ? "" : content.slice(elseIndex + elseMarker.length, endIndex);
26
26
  const selected = resolve(condition ? branchA : branchB, variables).trim();