@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,10 +1,10 @@
1
1
  import { mapJsxSourceLocations } from "./source-locations.js";
2
- import { i as parsePredicate, n as collectPredicateVariables } from "./predicate-CvkzT-a2.js";
2
+ import { i as parsePredicate, n as collectPredicateVariables } from "./predicate-DwXzmqIY.js";
3
3
  import { isRootTag } from "./ast.js";
4
4
  import { createVariablesProxy } from "./variables.js";
5
5
  import { parseSml } from "./parser.js";
6
6
  import { printSml } from "./printer.js";
7
- import { Result } from "effect";
7
+ import { Result } from "better-result";
8
8
  //#region src/render-template.ts
9
9
  /**
10
10
  * Runs a template function and returns its canonical document, source, and
@@ -23,9 +23,9 @@ const renderTemplate = (template) => {
23
23
  root
24
24
  });
25
25
  const parsed = parseSml(source);
26
- if (Result.isFailure(parsed)) return Result.fail(parsed.failure);
27
- const document = parsed.success;
28
- return Result.succeed({
26
+ if (Result.isError(parsed)) return Result.err(parsed.error);
27
+ const document = parsed.value;
28
+ return Result.ok({
29
29
  document,
30
30
  source,
31
31
  variables: collectVariableSchema(document, recorder),
@@ -52,7 +52,7 @@ const collectVariableSchema = (document, recorder) => {
52
52
  if (attribute.value.kind !== "string") continue;
53
53
  if (node.tag === "If" && attribute.name === "test") {
54
54
  const parsed = parsePredicate(attribute.value.value, 0);
55
- if (Result.isSuccess(parsed)) for (const name of collectPredicateVariables(parsed.success)) (insideIf ? conditional : unconditional).add(name);
55
+ if (Result.isOk(parsed)) for (const name of collectPredicateVariables(parsed.value)) (insideIf ? conditional : unconditional).add(name);
56
56
  continue;
57
57
  }
58
58
  for (const match of attribute.value.value.matchAll(INTERPOLATION_PATTERN)) {
@@ -1,4 +1,4 @@
1
- import { r as PresetCategory } from "./catalog-Ck1tAGwO.js";
1
+ import { r as PresetCategory } from "./catalog-Db0UcCTg.js";
2
2
  //#region presets/showcase.d.ts
3
3
  /**
4
4
  * The showcase projects: presets authored as complete editable projects under
@@ -453,4 +453,4 @@ declare const showcaseSourcePath: (project: ShowcaseProject) => string;
453
453
  declare const showcaseProjectPaths: (project: ShowcaseProject) => ReadonlyArray<string>;
454
454
  //#endregion
455
455
  export { ShowcaseProjectId as a, showcaseProject as c, showcaseSourcePath as d, ShowcaseProject as i, showcaseProjectPaths as l, OwnedShowcaseId as n, ShowcaseProvenance as o, SHOWCASE_ROOT as r, isShowcaseProjectId as s, BrandRecreationShowcaseId as t, showcaseProjects as u };
456
- //# sourceMappingURL=showcase-C_xgl6hz.d.ts.map
456
+ //# sourceMappingURL=showcase-dvJMn-Lo.d.ts.map
@@ -1,5 +1,4 @@
1
- import { E as SmlNode, m as ElementNode } from "./ast-63I-VLQx.js";
2
- import { Schema } from "effect";
1
+ import { f as ElementNode, x as SmlNode } from "./ast-BLybiDxp.js";
3
2
  //#region src/source-locations.d.ts
4
3
  /**
5
4
  * The source payload emitted by the JSX development transform. The transform
@@ -17,14 +16,6 @@ interface JsxSourceLocation {
17
16
  readonly lineNumber: number;
18
17
  readonly columnNumber: number;
19
18
  }
20
- /** JSON-safe source location shape shared by preview and editor contracts. */
21
- declare const JsxSourceLocation: Schema.Struct<{
22
- readonly fileName: Schema.String;
23
- readonly lineNumber: Schema.Int;
24
- readonly columnNumber: Schema.Int;
25
- }>;
26
- /** Reasons a preview cannot safely expose an authored source map. */
27
- declare const SourceLocationUnavailableReason: Schema.Literals<readonly ["no-source-metadata", "structure-mismatch", "duplicate-source-origin", "render-failed", "stale-preview"]>;
28
19
  /**
29
20
  * Runtime-only carrier for JSX source metadata. It is global so separately
30
21
  * bundled `jsx-dev-runtime` and `render-template` entries still agree on the
@@ -38,7 +29,7 @@ declare const JSX_SOURCE_LOCATION_PROP: "__samva_source_location";
38
29
  * currently provide no source metadata, so that path reports a typed absence
39
30
  * rather than guessing from output order.
40
31
  */
41
- type SourceLocationUnavailableReason = typeof SourceLocationUnavailableReason.Type;
32
+ type SourceLocationUnavailableReason = "no-source-metadata" | "structure-mismatch" | "duplicate-source-origin" | "render-failed" | "stale-preview";
42
33
  type UnboundTemplateSourceLocations = {
43
34
  readonly kind: "available";
44
35
  /** Parsed SML node id → the JSX origin that produced that element. */
@@ -57,19 +48,6 @@ type TemplateSourceLocations = {
57
48
  readonly kind: "unavailable";
58
49
  readonly reason: SourceLocationUnavailableReason;
59
50
  };
60
- /** JSON-safe schema for a parsed-node-id → JSX-origin map. */
61
- declare const TemplateSourceLocationsSchema: Schema.Union<readonly [Schema.Struct<{
62
- readonly kind: Schema.Literal<"available">;
63
- readonly revision: Schema.String;
64
- readonly byNodeId: Schema.$Record<Schema.String, Schema.Struct<{
65
- readonly fileName: Schema.String;
66
- readonly lineNumber: Schema.Int;
67
- readonly columnNumber: Schema.Int;
68
- }>>;
69
- }>, Schema.Struct<{
70
- readonly kind: Schema.Literal<"unavailable">;
71
- readonly reason: Schema.Literals<readonly ["no-source-metadata", "structure-mismatch", "duplicate-source-origin", "render-failed", "stale-preview"]>;
72
- }>]>;
73
51
  /** Normalize the optional payload accepted by `jsxDEV`. */
74
52
  declare const completeJsxSourceLocation: (source: JsxSource | null | undefined) => JsxSourceLocation | undefined;
75
53
  /** Attach a source origin without changing the serialized draft shape. */
@@ -85,5 +63,5 @@ declare const mapJsxSourceLocations: (draft: ElementNode, parsed: ElementNode) =
85
63
  /** Compare source-map statuses for the emission determinism guard. */
86
64
  declare const sameTemplateSourceLocations: (left: UnboundTemplateSourceLocations, right: UnboundTemplateSourceLocations) => boolean;
87
65
  //#endregion
88
- export { SourceLocationUnavailableReason as a, UnboundTemplateSourceLocations as c, jsxSourceLocationOf as d, mapJsxSourceLocations as f, JsxSourceLocation as i, attachJsxSourceLocation as l, JSX_SOURCE_LOCATION_PROP as n, TemplateSourceLocations as o, sameTemplateSourceLocations as p, JsxSource as r, TemplateSourceLocationsSchema as s, JSX_SOURCE_LOCATION as t, completeJsxSourceLocation as u };
89
- //# sourceMappingURL=source-locations-BCJQnIfU.d.ts.map
66
+ export { SourceLocationUnavailableReason as a, attachJsxSourceLocation as c, mapJsxSourceLocations as d, sameTemplateSourceLocations as f, JsxSourceLocation as i, completeJsxSourceLocation as l, JSX_SOURCE_LOCATION_PROP as n, TemplateSourceLocations as o, JsxSource as r, UnboundTemplateSourceLocations as s, JSX_SOURCE_LOCATION as t, jsxSourceLocationOf as u };
67
+ //# sourceMappingURL=source-locations-D6Te6Gy1.d.ts.map
@@ -1,2 +1,2 @@
1
- import { a as SourceLocationUnavailableReason, c as UnboundTemplateSourceLocations, d as jsxSourceLocationOf, f as mapJsxSourceLocations, i as JsxSourceLocation, l as attachJsxSourceLocation, n as JSX_SOURCE_LOCATION_PROP, o as TemplateSourceLocations, p as sameTemplateSourceLocations, r as JsxSource, s as TemplateSourceLocationsSchema, t as JSX_SOURCE_LOCATION, u as completeJsxSourceLocation } from "./source-locations-BCJQnIfU.js";
2
- export { JSX_SOURCE_LOCATION, JSX_SOURCE_LOCATION_PROP, JsxSource, JsxSourceLocation, SourceLocationUnavailableReason, TemplateSourceLocations, TemplateSourceLocationsSchema, UnboundTemplateSourceLocations, attachJsxSourceLocation, completeJsxSourceLocation, jsxSourceLocationOf, mapJsxSourceLocations, sameTemplateSourceLocations };
1
+ import { a as SourceLocationUnavailableReason, c as attachJsxSourceLocation, d as mapJsxSourceLocations, f as sameTemplateSourceLocations, i as JsxSourceLocation, l as completeJsxSourceLocation, n as JSX_SOURCE_LOCATION_PROP, o as TemplateSourceLocations, r as JsxSource, s as UnboundTemplateSourceLocations, t as JSX_SOURCE_LOCATION, u as jsxSourceLocationOf } from "./source-locations-D6Te6Gy1.js";
2
+ export { JSX_SOURCE_LOCATION, JSX_SOURCE_LOCATION_PROP, JsxSource, JsxSourceLocation, SourceLocationUnavailableReason, TemplateSourceLocations, UnboundTemplateSourceLocations, attachJsxSourceLocation, completeJsxSourceLocation, jsxSourceLocationOf, mapJsxSourceLocations, sameTemplateSourceLocations };
@@ -1,19 +1,5 @@
1
- import { Predicate, Schema } from "effect";
1
+ import { t as hasProperty } from "./guards-eV1qLbf2.js";
2
2
  //#region src/source-locations.ts
3
- /** JSON-safe source location shape shared by preview and editor contracts. */
4
- const JsxSourceLocation = Schema.Struct({
5
- fileName: Schema.String,
6
- lineNumber: Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)),
7
- columnNumber: Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))
8
- });
9
- /** Reasons a preview cannot safely expose an authored source map. */
10
- const SourceLocationUnavailableReason = Schema.Literals([
11
- "no-source-metadata",
12
- "structure-mismatch",
13
- "duplicate-source-origin",
14
- "render-failed",
15
- "stale-preview"
16
- ]);
17
3
  /**
18
4
  * Runtime-only carrier for JSX source metadata. It is global so separately
19
5
  * bundled `jsx-dev-runtime` and `render-template` entries still agree on the
@@ -22,15 +8,6 @@ const SourceLocationUnavailableReason = Schema.Literals([
22
8
  const JSX_SOURCE_LOCATION = Symbol.for("@samva/markup/jsx-source-location");
23
9
  /** Internal JSX prop used only by an editor preview source transform. */
24
10
  const JSX_SOURCE_LOCATION_PROP = "__samva_source_location";
25
- /** JSON-safe schema for a parsed-node-id → JSX-origin map. */
26
- const TemplateSourceLocationsSchema = Schema.Union([Schema.Struct({
27
- kind: Schema.Literal("available"),
28
- revision: Schema.String,
29
- byNodeId: Schema.Record(Schema.String, JsxSourceLocation)
30
- }), Schema.Struct({
31
- kind: Schema.Literal("unavailable"),
32
- reason: SourceLocationUnavailableReason
33
- })]);
34
11
  /** Normalize the optional payload accepted by `jsxDEV`. */
35
12
  const completeJsxSourceLocation = (source) => {
36
13
  if (source?.fileName === void 0 || source.lineNumber === void 0 || source.columnNumber === void 0) return;
@@ -50,7 +27,7 @@ const attachJsxSourceLocation = (node, source) => {
50
27
  writable: false
51
28
  });
52
29
  };
53
- const isJsxSourceLocation = (value) => Predicate.hasProperty(value, "fileName") && typeof value.fileName === "string" && Predicate.hasProperty(value, "lineNumber") && typeof value.lineNumber === "number" && Number.isInteger(value.lineNumber) && Predicate.hasProperty(value, "columnNumber") && typeof value.columnNumber === "number" && Number.isInteger(value.columnNumber);
30
+ const isJsxSourceLocation = (value) => hasProperty(value, "fileName") && typeof value.fileName === "string" && hasProperty(value, "lineNumber") && typeof value.lineNumber === "number" && Number.isInteger(value.lineNumber) && hasProperty(value, "columnNumber") && typeof value.columnNumber === "number" && Number.isInteger(value.columnNumber);
54
31
  /** Read the ephemeral origin, if this draft element has one. */
55
32
  const jsxSourceLocationOf = (node) => {
56
33
  if (node.kind !== "element") return void 0;
@@ -120,6 +97,6 @@ const sameTemplateSourceLocations = (left, right) => {
120
97
  return true;
121
98
  };
122
99
  //#endregion
123
- export { JSX_SOURCE_LOCATION, JSX_SOURCE_LOCATION_PROP, JsxSourceLocation, SourceLocationUnavailableReason, TemplateSourceLocationsSchema, attachJsxSourceLocation, completeJsxSourceLocation, jsxSourceLocationOf, mapJsxSourceLocations, sameTemplateSourceLocations };
100
+ export { JSX_SOURCE_LOCATION, JSX_SOURCE_LOCATION_PROP, attachJsxSourceLocation, completeJsxSourceLocation, jsxSourceLocationOf, mapJsxSourceLocations, sameTemplateSourceLocations };
124
101
 
125
102
  //# sourceMappingURL=source-locations.js.map
@@ -1,6 +1,6 @@
1
- import { m as EmailNode } from "./elements-DtwKlFVH.js";
2
- import { r as InputSchema } from "./input-schema-BIfzI63B.js";
3
- import { StandardJSONSchemaV1 } from "effect/StandardSchema";
1
+ import { m as EmailNode } from "./elements-ChJULZlh.js";
2
+ import { r as InputSchema } from "./input-schema-7dPFVvNE.js";
3
+ import { StandardJSONSchemaV1 } from "@standard-schema/spec";
4
4
  //#region src/template.d.ts
5
5
  /** One actual-input render owns all of a message's authored content. */
6
6
  interface EmailContent {
@@ -57,4 +57,4 @@ type TemplateInput<T extends {
57
57
  }> = Parameters<T["render"]>[0];
58
58
  //#endregion
59
59
  export { TemplateRuntime as a, TemplateInput as i, TEMPLATE_NAME_PATTERN as n, defineEmail as o, TemplateDefinition as r, isTemplateDefinition as s, EmailContent as t };
60
- //# sourceMappingURL=template-Dy5yOPyp.d.ts.map
60
+ //# sourceMappingURL=template-G-QPcfmn.d.ts.map
@@ -1,2 +1,2 @@
1
- import { a as TemplateRuntime, i as TemplateInput, n as TEMPLATE_NAME_PATTERN, o as defineEmail, r as TemplateDefinition, s as isTemplateDefinition, t as EmailContent } from "./template-Dy5yOPyp.js";
1
+ import { a as TemplateRuntime, i as TemplateInput, n as TEMPLATE_NAME_PATTERN, o as defineEmail, r as TemplateDefinition, s as isTemplateDefinition, t as EmailContent } from "./template-G-QPcfmn.js";
2
2
  export { EmailContent, TEMPLATE_NAME_PATTERN, TemplateDefinition, TemplateInput, TemplateRuntime, defineEmail, isTemplateDefinition };
package/dist/template.js CHANGED
@@ -1,8 +1,8 @@
1
- import { inputSchema } from "./input-schema.js";
2
- import { Predicate } from "effect";
1
+ import { n as isObject } from "./guards-eV1qLbf2.js";
2
+ import { n as inputSchema } from "./input-schema-zjkgrXn2.js";
3
3
  //#region src/template.ts
4
4
  /** Classify an evaluated module export without executing helpers as templates. */
5
- const isTemplateDefinition = (value) => Predicate.isObject(value) && typeof value.id === "string" && typeof value.render === "function" && Predicate.isObject(value.schema);
5
+ const isTemplateDefinition = (value) => isObject(value) && typeof value.id === "string" && typeof value.render === "function" && isObject(value.schema);
6
6
  /**
7
7
  * The one naming contract for a template id and a fixture key: a letter, a digit or `_` first,
8
8
  * then those plus `.`, `_` and `-`.
@@ -1,6 +1,6 @@
1
- import { t as Diagnostic } from "./diagnostics-oveE-laV.js";
1
+ import { t as Diagnostic } from "./diagnostics-CqepLcpI.js";
2
2
  import { o as TokenOverrides } from "./theme-6ApjjiBo.js";
3
- import { Result } from "effect";
3
+ import { Result } from "better-result";
4
4
  //#region src/theme-css.d.ts
5
5
  /**
6
6
  * `TokenOverrides` plus `tracking`. The compiler's `TokenOverrides` names its
@@ -12,7 +12,7 @@ interface ParsedTheme extends TokenOverrides {
12
12
  /** tracking-{name} → letter-spacing in em (negative allowed). */
13
13
  readonly tracking?: Readonly<Record<string, number>> | undefined;
14
14
  }
15
- declare const parseThemeCss: (css: string) => Result.Result<ParsedTheme, ReadonlyArray<Diagnostic>>;
15
+ declare const parseThemeCss: (css: string) => Result<ParsedTheme, ReadonlyArray<Diagnostic>>;
16
16
  /**
17
17
  * Serialize a ParsedTheme to `@theme` CSS. Light tokens go in the top-level
18
18
  * `@theme` block; `colorsDark` (colors-only, matching the parser) goes in the
package/dist/theme-css.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Result } from "effect";
1
+ import { Result } from "better-result";
2
2
  //#region src/theme-css.ts
3
3
  const CHAR_TAB = 9;
4
4
  const CHAR_LINE_FEED = 10;
@@ -441,7 +441,7 @@ const parseThemeCss = (css) => {
441
441
  start: 0,
442
442
  end: Math.min(1, length)
443
443
  });
444
- if (diagnostics.length > 0) return Result.fail(diagnostics);
444
+ if (diagnostics.length > 0) return Result.err(diagnostics);
445
445
  const nonEmpty = (entries) => Object.keys(entries).length > 0 ? entries : void 0;
446
446
  const colors = nonEmpty(accumulator.colors);
447
447
  const colorsDark = nonEmpty(accumulator.colorsDark);
@@ -452,7 +452,7 @@ const parseThemeCss = (css) => {
452
452
  const fontFamilies = nonEmpty(accumulator.fontFamilies);
453
453
  const containerPx = nonEmpty(accumulator.containerPx);
454
454
  const tracking = nonEmpty(accumulator.tracking);
455
- return Result.succeed({
455
+ return Result.ok({
456
456
  colors,
457
457
  colorsDark,
458
458
  spacingPx: accumulator.spacingPx,
@@ -1,7 +1,5 @@
1
1
  //#region src/tsx-source-instrumentation.d.ts
2
- declare const TsxSourceInstrumentationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
3
- readonly _tag: "TsxSourceInstrumentationError";
4
- } & Readonly<A>;
2
+ declare const TsxSourceInstrumentationError_base: import("better-result").TaggedErrorClass<"TsxSourceInstrumentationError">;
5
3
  declare class TsxSourceInstrumentationError extends TsxSourceInstrumentationError_base<{
6
4
  readonly message: string;
7
5
  readonly cause?: unknown;
@@ -1,17 +1,17 @@
1
+ import { n as isObject } from "./guards-eV1qLbf2.js";
1
2
  import { JSX_SOURCE_LOCATION_PROP } from "./source-locations.js";
2
3
  import { buildLineMap, lineColumn } from "./diagnostics.js";
3
- import { Data, Predicate } from "effect";
4
+ import { TaggedError } from "better-result";
4
5
  import { parse } from "@babel/parser";
5
6
  //#region src/tsx-source-instrumentation.ts
6
- var TsxSourceInstrumentationError = class extends Data.TaggedError("TsxSourceInstrumentationError") {};
7
- const isRecord = (value) => Predicate.isObject(value) && !Array.isArray(value);
8
- const isAstNode = (value) => isRecord(value) && typeof value.type === "string" && typeof value.start === "number" && typeof value.end === "number";
7
+ var TsxSourceInstrumentationError = class extends TaggedError("TsxSourceInstrumentationError") {};
8
+ const isAstNode = (value) => isObject(value) && typeof value.type === "string" && typeof value.start === "number" && typeof value.end === "number";
9
9
  const walkAst = (value, visit) => {
10
10
  if (Array.isArray(value)) {
11
11
  for (const item of value) walkAst(item, visit);
12
12
  return;
13
13
  }
14
- if (!isRecord(value)) return;
14
+ if (!isObject(value)) return;
15
15
  if (isAstNode(value)) visit(value);
16
16
  for (const [key, child] of Object.entries(value)) {
17
17
  if (key === "loc" || key === "extra" || key === "comments" || key === "tokens") continue;
@@ -22,7 +22,7 @@ const jsxIdentifier = (value) => {
22
22
  if (!isAstNode(value) || value.type !== "JSXIdentifier") return void 0;
23
23
  return typeof value.name === "string" ? value.name : void 0;
24
24
  };
25
- const parseErrorMessage = (error) => isRecord(error) && typeof error.message === "string" ? error.message : "The authored TSX could not be parsed for preview instrumentation.";
25
+ const parseErrorMessage = (error) => isObject(error) && typeof error.message === "string" ? error.message : "The authored TSX could not be parsed for preview instrumentation.";
26
26
  const marker = (fileName, source, offset, token) => {
27
27
  const position = lineColumn(buildLineMap(source), offset);
28
28
  return ` ${JSX_SOURCE_LOCATION_PROP}={${JSON.stringify({
@@ -1,6 +1,6 @@
1
- import { s as Span } from "./diagnostics-oveE-laV.js";
1
+ import { a as Span } from "./diagnostics-CqepLcpI.js";
2
2
  import { SmlOp } from "./ops.js";
3
- import { Result } from "effect";
3
+ import { Result } from "better-result";
4
4
  //#region src/tsx-tracer.d.ts
5
5
  /** The closed set of reasons a rendered heading cannot be mapped safely. */
6
6
  type TsxHeadingDiagnosticCode = "tsx-invalid-authored-source" | "tsx-invalid-emitted-source" | "tsx-target-not-found" | "tsx-unsupported-target" | "tsx-ambiguous-target" | "tsx-dynamic-target";
@@ -9,9 +9,7 @@ interface TsxHeadingDiagnostic {
9
9
  readonly message: string;
10
10
  readonly span: Span;
11
11
  }
12
- declare const TsxHeadingTraceError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
13
- readonly _tag: "TsxHeadingTraceError";
14
- } & Readonly<A>;
12
+ declare const TsxHeadingTraceError_base: import("better-result").TaggedErrorClass<"TsxHeadingTraceError">;
15
13
  declare class TsxHeadingTraceError extends TsxHeadingTraceError_base<{
16
14
  readonly diagnostics: ReadonlyArray<TsxHeadingDiagnostic>;
17
15
  }> {}
@@ -62,8 +60,8 @@ interface TraceTsxHeadingInput {
62
60
  interface ReplaceTsxHeadingTextInput extends TraceTsxHeadingInput {
63
61
  readonly text: string;
64
62
  }
65
- type TsxHeadingTrace = Result.Result<TsxHeadingSourceTarget, TsxHeadingTraceError>;
66
- type TsxHeadingEdit = Result.Result<string, TsxHeadingTraceError>;
63
+ type TsxHeadingTrace = Result<TsxHeadingSourceTarget, TsxHeadingTraceError>;
64
+ type TsxHeadingEdit = Result<string, TsxHeadingTraceError>;
67
65
  /** Resolve one rendered Heading to one direct-literal JSX text range. */
68
66
  declare const traceTsxHeadingTarget: (input: TraceTsxHeadingInput) => TsxHeadingTrace;
69
67
  /** Replace only the mapped literal bytes; all other authored TSX stays untouched. */
@@ -80,9 +78,7 @@ interface TsxSmlDiagnostic {
80
78
  readonly message: string;
81
79
  readonly span: Span;
82
80
  }
83
- declare const TsxSmlOpsError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
84
- readonly _tag: "TsxSmlOpsError";
85
- } & Readonly<A>;
81
+ declare const TsxSmlOpsError_base: import("better-result").TaggedErrorClass<"TsxSmlOpsError">;
86
82
  declare class TsxSmlOpsError extends TsxSmlOpsError_base<{
87
83
  readonly diagnostics: ReadonlyArray<TsxSmlDiagnostic>;
88
84
  }> {}
@@ -100,7 +96,7 @@ interface ApplyTsxSmlOpsInput {
100
96
  /** SML operations evaluated against the emitted-source id snapshot. */
101
97
  readonly ops: ReadonlyArray<SmlOp>;
102
98
  }
103
- type TsxSmlOpsResult = Result.Result<string, TsxSmlOpsError>;
99
+ type TsxSmlOpsResult = Result<string, TsxSmlOpsError>;
104
100
  /**
105
101
  * Apply semantic editor operations to the authored TSX entry.
106
102
  *