@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
@@ -1,26 +1,8 @@
1
- import { i as JsxSourceLocation, r as JsxSource } from "../source-locations-BCJQnIfU.js";
2
- import { g as JSX, h as Fragment, m as EmailNode, p as EmailComponent } from "../elements-DtwKlFVH.js";
1
+ import { r as JsxSource } from "../source-locations-D6Te6Gy1.js";
2
+ import { g as JSX, h as Fragment, m as EmailNode, p as EmailComponent } from "../elements-ChJULZlh.js";
3
3
  //#region src/email/jsx-dev-runtime.d.ts
4
4
  /** Development JSX retains compiler-provided origins directly on the semantic tree. */
5
- declare const jsxDEV: (type: string | EmailComponent<Record<string, unknown>> | typeof Fragment, props: Record<string, unknown> | null, _key?: unknown, _staticChildren?: boolean, source?: JsxSource) => {
6
- readonly _tag: "Element";
7
- readonly tag: string;
8
- readonly props: Readonly<Record<string, unknown>>;
9
- readonly children: readonly EmailNode[];
10
- readonly origins: readonly JsxSourceLocation[];
11
- readonly authored: boolean;
12
- } | {
13
- readonly _tag: "Fragment";
14
- readonly children: readonly EmailNode[];
15
- } | {
16
- readonly _tag: "Raw";
17
- readonly html: string;
18
- readonly text: string;
19
- readonly origins: readonly JsxSourceLocation[];
20
- } | {
21
- readonly _tag: "Text";
22
- readonly value: string;
23
- };
5
+ declare const jsxDEV: (type: string | EmailComponent<Record<string, unknown>> | typeof Fragment, props: Record<string, unknown> | null, _key?: unknown, _staticChildren?: boolean, source?: JsxSource) => EmailNode;
24
6
  //#endregion
25
7
  export { Fragment, type JSX, jsxDEV };
26
8
  //# sourceMappingURL=jsx-dev-runtime.d.ts.map
@@ -1,2 +1,2 @@
1
- import { C as reportEmailDiagnostic, S as rawMarkup, _ as currentEmailOrigins, b as jsxs, f as EmailChild, g as JSX, h as Fragment, m as EmailNode, p as EmailComponent, v as drainEmailDiagnostics, x as normalizeChildren, y as jsx } from "../elements-DtwKlFVH.js";
1
+ import { C as reportEmailDiagnostic, S as rawMarkup, _ as currentEmailOrigins, b as jsxs, f as EmailChild, g as JSX, h as Fragment, m as EmailNode, p as EmailComponent, v as drainEmailDiagnostics, x as normalizeChildren, y as jsx } from "../elements-ChJULZlh.js";
2
2
  export { EmailChild, EmailComponent, EmailNode, Fragment, JSX, currentEmailOrigins, drainEmailDiagnostics, jsx, jsxs, normalizeChildren, rawMarkup, reportEmailDiagnostic };
@@ -1,7 +1,33 @@
1
+ import { t as hasProperty } from "../guards-eV1qLbf2.js";
1
2
  import { JSX_SOURCE_LOCATION_PROP, completeJsxSourceLocation } from "../source-locations.js";
2
- import { Data, Predicate } from "effect";
3
3
  //#region src/email/jsx-runtime.ts
4
- const EmailNode = Data.taggedEnum();
4
+ /** Constructors for the authoring tree. The tree is data; nothing here validates it. */
5
+ const EmailNode = {
6
+ Text: (fields) => ({
7
+ type: "Text",
8
+ ...fields
9
+ }),
10
+ Element: (fields) => ({
11
+ type: "Element",
12
+ ...fields
13
+ }),
14
+ Fragment: (fields) => ({
15
+ type: "Fragment",
16
+ ...fields
17
+ }),
18
+ Raw: (fields) => ({
19
+ type: "Raw",
20
+ ...fields
21
+ })
22
+ };
23
+ const EMAIL_NODE_TYPES = /* @__PURE__ */ new Set([
24
+ "Text",
25
+ "Element",
26
+ "Fragment",
27
+ "Raw"
28
+ ]);
29
+ /** True for a node this runtime built; anything else is not a child it can place. */
30
+ const isEmailNode = (input) => hasProperty(input, "type") && typeof input.type === "string" && EMAIL_NODE_TYPES.has(input.type);
5
31
  const Fragment = Symbol.for("@samva/markup/email/Fragment");
6
32
  const callSites = [];
7
33
  /** Call sites enclosing the element being built, innermost first. */
@@ -22,7 +48,7 @@ const normalizeChildren = (input) => {
22
48
  if (typeof input === "string") return [EmailNode.Text({ value: input })];
23
49
  if (typeof input === "number" && Number.isFinite(input)) return [EmailNode.Text({ value: String(input) })];
24
50
  if (Array.isArray(input)) return input.flatMap(normalizeChildren);
25
- if (Predicate.isTagged(input, "Text") || Predicate.isTagged(input, "Element") || Predicate.isTagged(input, "Fragment") || Predicate.isTagged(input, "Raw")) return [input];
51
+ if (isEmailNode(input)) return [input];
26
52
  throw new TypeError("Email children must be synchronous text, finite numbers, elements, or arrays");
27
53
  };
28
54
  /** Compatibility markup emitted by a compiler primitive, with the text it stands for. */
@@ -1,9 +1,9 @@
1
- import { r as EmailDiagnostic } from "../diagnostics-Djd9ckLg.js";
2
- import { m as EmailNode } from "../elements-DtwKlFVH.js";
1
+ import { r as EmailDiagnostic } from "../diagnostics-eFM9A_TU.js";
2
+ import { m as EmailNode } from "../elements-ChJULZlh.js";
3
3
  import { EmittedPosition } from "./selection.js";
4
4
  import { SerializeEmailOptions } from "./html.js";
5
- import { r as TemplateDefinition } from "../template-Dy5yOPyp.js";
6
- import { i as Stylesheet } from "../css-ar2lU3NC.js";
5
+ import { r as TemplateDefinition } from "../template-G-QPcfmn.js";
6
+ import { i as Stylesheet } from "../css-DoNc7CiC.js";
7
7
  //#region src/email/render.d.ts
8
8
  /** Classic Outlook lays a document out correctly only under a transitional doctype. */
9
9
  declare const EMAIL_DOCTYPE = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
@@ -1,4 +1,4 @@
1
- import { i as renderEmail, n as bindStylesheets, r as compileEmail, t as EMAIL_DOCTYPE } from "../render-ykQhtMs_.js";
1
+ import { i as renderEmail, n as bindStylesheets, r as compileEmail, t as EMAIL_DOCTYPE } from "../render-T6IFPnP4.js";
2
2
  import "./html.js";
3
3
  import "./diagnostics.js";
4
4
  import "./stylesheets.js";
@@ -1,5 +1,4 @@
1
- import { i as JsxSourceLocation } from "../source-locations-BCJQnIfU.js";
2
- import { Schema } from "effect";
1
+ import { i as JsxSourceLocation } from "../source-locations-D6Te6Gy1.js";
3
2
  //#region src/email/selection.d.ts
4
3
  /**
5
4
  * The attribute a preview stamps so a click in a rendered document resolves to
@@ -7,65 +6,55 @@ import { Schema } from "effect";
7
6
  */
8
7
  declare const INSTANCE_PATH_ATTRIBUTE = "data-samva-instance";
9
8
  /** Where one element sits in the emitted document, with the authoring that produced it. */
10
- declare const EmittedPosition: Schema.Struct<{
11
- readonly start: Schema.Int;
12
- readonly end: Schema.Int;
13
- readonly origins: Schema.$Array<Schema.Struct<{
14
- readonly fileName: Schema.String;
15
- readonly lineNumber: Schema.Int;
16
- readonly columnNumber: Schema.Int;
17
- }>>;
9
+ interface EmittedPosition {
10
+ readonly start: number;
11
+ readonly end: number;
12
+ readonly origins: ReadonlyArray<JsxSourceLocation>;
18
13
  /**
19
14
  * Dot-separated element indices from the document root, assigned as the
20
15
  * document is written. It is the identity of one rendered instance.
21
16
  */
22
- readonly instancePath: Schema.String;
23
- readonly tag: Schema.String;
17
+ readonly instancePath: string;
18
+ readonly tag: string;
24
19
  /** False when a compiler primitive generated this element. */
25
- readonly authored: Schema.Boolean;
26
- }>;
27
- interface EmittedPosition extends Schema.Schema.Type<typeof EmittedPosition> {}
20
+ readonly authored: boolean;
21
+ }
28
22
  /** One rendered element, and the authoring it came from. */
29
- declare const EmailElementSelection: Schema.Struct<{
23
+ interface EmailElementSelection {
30
24
  /**
31
25
  * Dot-separated element indices from the document root. It is the identity
32
26
  * of one rendered instance, which is what tells two iterations of the same
33
27
  * authored element apart: their origins are identical.
34
28
  */
35
- readonly instancePath: Schema.String;
36
- readonly tag: Schema.String;
29
+ readonly instancePath: string;
30
+ readonly tag: string;
37
31
  /**
38
32
  * The authored JSX element first, then each enclosing component call site,
39
33
  * innermost first. Empty when the compiler generated this element with no
40
34
  * authoring on the stack — the hidden preheader block, for instance.
41
35
  */
42
- readonly origins: Schema.$Array<Schema.Struct<{
43
- readonly fileName: Schema.String;
44
- readonly lineNumber: Schema.Int;
45
- readonly columnNumber: Schema.Int;
46
- }>>;
36
+ readonly origins: ReadonlyArray<JsxSourceLocation>;
47
37
  /**
48
38
  * False when a compiler primitive generated this element. `origins[0]` is
49
39
  * then the authoring element that asked for it rather than this element
50
40
  * itself, so the wrapper selects the primitive the author wrote.
51
41
  */
52
- readonly authored: Schema.Boolean;
42
+ readonly authored: boolean;
53
43
  /** 1-based position among the rendered elements sharing this origin chain and tag. */
54
- readonly occurrence: Schema.Int;
44
+ readonly occurrence: number;
55
45
  /**
56
46
  * How many rendered elements share that chain and tag. Above one, one piece
57
47
  * of authoring produced several rendered elements — a loop over a component,
58
48
  * or a primitive that generates a repeated cell — so an edit there changes
59
49
  * all of them.
60
50
  */
61
- readonly occurrences: Schema.Int;
51
+ readonly occurrences: number;
62
52
  /** Absent for the document root. */
63
- readonly parentPath: Schema.optionalKey<Schema.String>;
53
+ readonly parentPath?: string;
64
54
  /** Offset range in the rendered HTML this selection was taken from. */
65
- readonly start: Schema.Int;
66
- readonly end: Schema.Int;
67
- }>;
68
- interface EmailElementSelection extends Schema.Schema.Type<typeof EmailElementSelection> {}
55
+ readonly start: number;
56
+ readonly end: number;
57
+ }
69
58
  /**
70
59
  * Turn one render's emitted positions into selections, in document order.
71
60
  *
@@ -1,61 +1,9 @@
1
- import { JsxSourceLocation } from "../source-locations.js";
2
- import { Schema } from "effect";
3
1
  //#region src/email/selection.ts
4
2
  /**
5
3
  * The attribute a preview stamps so a click in a rendered document resolves to
6
4
  * exactly one rendered element. A delivered message never carries it.
7
5
  */
8
6
  const INSTANCE_PATH_ATTRIBUTE = "data-samva-instance";
9
- /** Where one element sits in the emitted document, with the authoring that produced it. */
10
- const EmittedPosition = Schema.Struct({
11
- start: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
12
- end: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
13
- origins: Schema.Array(JsxSourceLocation),
14
- /**
15
- * Dot-separated element indices from the document root, assigned as the
16
- * document is written. It is the identity of one rendered instance.
17
- */
18
- instancePath: Schema.String.check(Schema.isMinLength(1)),
19
- tag: Schema.String.check(Schema.isMinLength(1)),
20
- /** False when a compiler primitive generated this element. */
21
- authored: Schema.Boolean
22
- });
23
- /** One rendered element, and the authoring it came from. */
24
- const EmailElementSelection = Schema.Struct({
25
- /**
26
- * Dot-separated element indices from the document root. It is the identity
27
- * of one rendered instance, which is what tells two iterations of the same
28
- * authored element apart: their origins are identical.
29
- */
30
- instancePath: Schema.String.check(Schema.isMinLength(1)),
31
- tag: Schema.String.check(Schema.isMinLength(1)),
32
- /**
33
- * The authored JSX element first, then each enclosing component call site,
34
- * innermost first. Empty when the compiler generated this element with no
35
- * authoring on the stack — the hidden preheader block, for instance.
36
- */
37
- origins: Schema.Array(JsxSourceLocation),
38
- /**
39
- * False when a compiler primitive generated this element. `origins[0]` is
40
- * then the authoring element that asked for it rather than this element
41
- * itself, so the wrapper selects the primitive the author wrote.
42
- */
43
- authored: Schema.Boolean,
44
- /** 1-based position among the rendered elements sharing this origin chain and tag. */
45
- occurrence: Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)),
46
- /**
47
- * How many rendered elements share that chain and tag. Above one, one piece
48
- * of authoring produced several rendered elements — a loop over a component,
49
- * or a primitive that generates a repeated cell — so an edit there changes
50
- * all of them.
51
- */
52
- occurrences: Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)),
53
- /** Absent for the document root. */
54
- parentPath: Schema.optionalKey(Schema.String),
55
- /** Offset range in the rendered HTML this selection was taken from. */
56
- start: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
57
- end: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))
58
- });
59
7
  const locationKey = (origin) => `${origin.fileName}:${origin.lineNumber}:${origin.columnNumber}`;
60
8
  /** One call site: the authored element and every component call enclosing it. */
61
9
  const callSiteKey = (selection) => `${selection.tag}\u0000${selection.origins.map(locationKey).join("\0")}`;
@@ -138,6 +86,6 @@ const emailDefinitionInstances = (selections, selection) => {
138
86
  return selections.filter((candidate) => definitionKey(candidate) === key);
139
87
  };
140
88
  //#endregion
141
- export { EmailElementSelection, EmittedPosition, INSTANCE_PATH_ATTRIBUTE, emailAuthoringTarget, emailDefinitionInstances, emailSelectionAncestry, emailSelectionIndex, emailSelectionSiblings, emailSelections };
89
+ export { INSTANCE_PATH_ATTRIBUTE, emailAuthoringTarget, emailDefinitionInstances, emailSelectionAncestry, emailSelectionIndex, emailSelectionSiblings, emailSelections };
142
90
 
143
91
  //# sourceMappingURL=selection.js.map
@@ -1,4 +1,4 @@
1
- import { i as JsxSourceLocation } from "../source-locations-BCJQnIfU.js";
1
+ import { i as JsxSourceLocation } from "../source-locations-D6Te6Gy1.js";
2
2
  //#region src/email/source-edit.d.ts
3
3
  /** One exact source replacement; before text guards against concurrent changes. */
4
4
  interface SourceReplacement {
@@ -1,8 +1,8 @@
1
+ import { n as isObject } from "../guards-eV1qLbf2.js";
1
2
  import { buildLineMap } from "../diagnostics.js";
2
- import { Predicate } from "effect";
3
3
  import { parse } from "@babel/parser";
4
4
  //#region src/email/source-edit.ts
5
- const node = (value) => Predicate.isObject(value) && "type" in value && typeof value.type === "string" && "start" in value && typeof value.start === "number" && "end" in value && typeof value.end === "number";
5
+ const node = (value) => isObject(value) && "type" in value && typeof value.type === "string" && "start" in value && typeof value.start === "number" && "end" in value && typeof value.end === "number";
6
6
  const children = (value) => Array.isArray(value) ? value.filter(node) : [];
7
7
  const walk = (value, visit, parent = null) => {
8
8
  if (Array.isArray(value)) {
@@ -1,4 +1,4 @@
1
- import { i as Stylesheet } from "../css-ar2lU3NC.js";
1
+ import { i as Stylesheet } from "../css-DoNc7CiC.js";
2
2
  //#region src/email/stylesheets.d.ts
3
3
  /** Called by a compiler-generated stylesheet module at import time. */
4
4
  declare const registerStylesheet: (sheet: Stylesheet) => void;
@@ -1,4 +1,4 @@
1
- import { m as EmailNode } from "../elements-DtwKlFVH.js";
1
+ import { m as EmailNode } from "../elements-ChJULZlh.js";
2
2
  //#region src/email/text.d.ts
3
3
  /** Derive the plain-text alternative from the semantic tree in reading order. */
4
4
  declare const deriveEmailText: (node: EmailNode) => string;
@@ -18,8 +18,8 @@ const block = (inner, separator) => {
18
18
  return trimmed === "" ? "" : `${separator}${trimmed}${separator}`;
19
19
  };
20
20
  const collect = (nodes, keep, descend) => nodes.flatMap((child) => {
21
- if (child._tag === "Fragment") return collect(child.children, keep, descend);
22
- if (child._tag !== "Element") return [];
21
+ if (child.type === "Fragment") return collect(child.children, keep, descend);
22
+ if (child.type !== "Element") return [];
23
23
  if (keep(child.tag)) return [child];
24
24
  return descend(child.tag) ? collect(child.children, keep, descend) : [];
25
25
  });
@@ -30,7 +30,7 @@ const TABLE_SECTIONS = /* @__PURE__ */ new Set([
30
30
  ]);
31
31
  const childText = (node, context) => node.children.map((child) => derive(child, context)).join("");
32
32
  const derive = (node, context) => {
33
- switch (node._tag) {
33
+ switch (node.type) {
34
34
  case "Text": return context.preformatted ? node.value : node.value.replace(INVISIBLE, "").replace(/[^\S\n]+/g, " ");
35
35
  case "Raw": return node.text;
36
36
  case "Fragment": return node.children.map((child) => derive(child, context)).join("");
package/dist/emit.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { t as Diagnostic } from "./diagnostics-oveE-laV.js";
2
- import { c as UnboundTemplateSourceLocations } from "./source-locations-BCJQnIfU.js";
1
+ import { t as Diagnostic } from "./diagnostics-CqepLcpI.js";
2
+ import { s as UnboundTemplateSourceLocations } from "./source-locations-D6Te6Gy1.js";
3
3
  import { TemplateVariable } from "./render-template.js";
4
4
  //#region src/emit.d.ts
5
5
  /**
package/dist/emit.js CHANGED
@@ -2,7 +2,7 @@ import { sameTemplateSourceLocations } from "./source-locations.js";
2
2
  import { isRootTag } from "./ast.js";
3
3
  import { createVariablesProxy } from "./variables.js";
4
4
  import { renderTemplate } from "./render-template.js";
5
- import { Result } from "effect";
5
+ import { Result } from "better-result";
6
6
  //#region src/emit.ts
7
7
  /**
8
8
  * emitModule — the module-level emit boundary for the TSX authoring layer
@@ -115,7 +115,7 @@ const emitModule = (moduleExports) => {
115
115
  */
116
116
  const emitOne = (name, template) => {
117
117
  const first = renderTemplate(template);
118
- if (Result.isFailure(first)) return {
118
+ if (Result.isError(first)) return {
119
119
  name,
120
120
  ok: false,
121
121
  source: void 0,
@@ -124,11 +124,11 @@ const emitOne = (name, template) => {
124
124
  kind: "unavailable",
125
125
  reason: "render-failed"
126
126
  },
127
- diagnostics: first.failure.diagnostics
127
+ diagnostics: first.error.diagnostics
128
128
  };
129
- const rendered = first.success;
129
+ const rendered = first.value;
130
130
  const second = renderTemplate(template);
131
- if (Result.isSuccess(second) && second.success.source === rendered.source && sameTemplateSourceLocations(second.success.sourceLocations, rendered.sourceLocations)) return {
131
+ if (Result.isOk(second) && second.value.source === rendered.source && sameTemplateSourceLocations(second.value.sourceLocations, rendered.sourceLocations)) return {
132
132
  name,
133
133
  ok: true,
134
134
  source: rendered.source,
@@ -0,0 +1,9 @@
1
+ //#region src/internal/guards.ts
2
+ /** A non-null, non-array object, narrowed for property access. */
3
+ const isObject = (input) => typeof input === "object" && input !== null && !Array.isArray(input);
4
+ /** True when `input` carries `property`, narrowing it for reads. */
5
+ const hasProperty = (input, property) => typeof input === "object" && input !== null || typeof input === "function" ? property in input : false;
6
+ //#endregion
7
+ export { isObject as n, hasProperty as t };
8
+
9
+ //# sourceMappingURL=guards-eV1qLbf2.js.map
@@ -1,5 +1,5 @@
1
1
  import { OutputUnit } from "@cfworker/json-schema";
2
- import { StandardJSONSchemaV1 } from "effect/StandardSchema";
2
+ import { StandardJSONSchemaV1 } from "@standard-schema/spec";
3
3
  //#region src/input-schema.d.ts
4
4
  /** JSON Schema dialect accepted by template publications. */
5
5
  declare const INPUT_SCHEMA_DIALECT = "https://json-schema.org/draft/2020-12/schema";
@@ -20,4 +20,4 @@ declare const inputSchema: <S extends StandardJSONSchemaV1>(source: S) => InputS
20
20
  type InputIssue = OutputUnit;
21
21
  //#endregion
22
22
  export { jsonSchema as a, inputSchema as i, InputIssue as n, InputSchema as r, INPUT_SCHEMA_DIALECT as t };
23
- //# sourceMappingURL=input-schema-BIfzI63B.d.ts.map
23
+ //# sourceMappingURL=input-schema-7dPFVvNE.d.ts.map