@phtngyn/cms 0.1.0-beta.1 → 0.1.0-beta.2

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 (142) hide show
  1. package/README.md +192 -9
  2. package/package.json +30 -15
  3. package/src/Configuration-Br7tE9Qt.d.ts +68 -0
  4. package/src/{Configuration-DyKo0sLS.js → Configuration-CA_jvQKG.js} +26 -147
  5. package/src/Configuration-CA_jvQKG.js.map +1 -0
  6. package/src/Configuration.d.ts +2 -44
  7. package/src/Configuration.js +0 -1
  8. package/src/Configuration.js.map +1 -1
  9. package/src/{DocumentEngine-DYObwMDY.js → DocumentEngine-CgiBQU4g.js} +75 -27
  10. package/src/DocumentEngine-CgiBQU4g.js.map +1 -0
  11. package/src/DocumentModel-BB9igGC7.d.ts +34 -0
  12. package/src/DocumentModel.d.ts +2 -34
  13. package/src/DocumentModel.js +13 -3
  14. package/src/DocumentModel.js.map +1 -1
  15. package/src/Forms-BsJMev5_.d.ts +74 -0
  16. package/src/Forms-CfcI3tPU.js +79 -0
  17. package/src/Forms-CfcI3tPU.js.map +1 -0
  18. package/src/Forms-DxbkU3_5.js +367 -0
  19. package/src/Forms-DxbkU3_5.js.map +1 -0
  20. package/src/Forms.d.ts +35 -0
  21. package/src/Forms.js +13 -0
  22. package/src/Forms.js.map +1 -0
  23. package/src/{HttpPaths-BbS21Jy8.js → HttpPaths-c9nLZ9H2.js} +6 -2
  24. package/src/HttpPaths-c9nLZ9H2.js.map +1 -0
  25. package/src/I18n-DZK4CkJF.d.ts +21 -0
  26. package/src/I18n.d.ts +2 -0
  27. package/src/I18n.js +1 -0
  28. package/src/Module.js +57 -11
  29. package/src/Module.js.map +1 -1
  30. package/src/S3MediaObjects-JKMAWyVB.js +2664 -0
  31. package/src/S3MediaObjects-JKMAWyVB.js.map +1 -0
  32. package/src/Seed.d.ts +6 -0
  33. package/src/Seed.js +34 -0
  34. package/src/Seed.js.map +1 -0
  35. package/src/Seo-402YumpT.d.ts +198 -0
  36. package/src/{connection-CBTY-TzB.js → connection-B-iz0Y9Y.js} +5 -7
  37. package/src/connection-B-iz0Y9Y.js.map +1 -0
  38. package/src/{installation-DeuBiFRE.js → installation-DgF2M1gL.js} +1005 -2242
  39. package/src/installation-DgF2M1gL.js.map +1 -0
  40. package/src/internal/authoring-catalog.js +10 -4
  41. package/src/internal/authoring-catalog.js.map +1 -1
  42. package/src/internal/authoring-compiler.js +0 -1
  43. package/src/internal/authoring-compiler.js.map +1 -1
  44. package/src/internal/authoring-metadata.js +4 -4
  45. package/src/internal/authoring-metadata.js.map +1 -1
  46. package/src/internal/cms-config.js +0 -1
  47. package/src/internal/cms-config.js.map +1 -1
  48. package/src/internal/configuration.js +23 -10
  49. package/src/internal/configuration.js.map +1 -1
  50. package/src/internal/document-model.js +65 -20
  51. package/src/internal/document-model.js.map +1 -1
  52. package/src/internal/form-capabilities.js +12 -0
  53. package/src/internal/form-capabilities.js.map +1 -0
  54. package/src/internal/i18n.js +47 -0
  55. package/src/internal/i18n.js.map +1 -0
  56. package/src/internal/studio-app.js +2 -2
  57. package/src/internal/studio-app.js.map +1 -1
  58. package/src/{location-DtYv2aes.js → location-CFKTeK1K.js} +2 -3
  59. package/src/location-CFKTeK1K.js.map +1 -0
  60. package/src/{metadata-DE1Mc2td.js → metadata-BEZPWh-3.js} +3 -72
  61. package/src/metadata-BEZPWh-3.js.map +1 -0
  62. package/src/{models-C3witQBK.js → models-BWm1pTAf.js} +3 -2
  63. package/src/models-BWm1pTAf.js.map +1 -0
  64. package/src/{models-BkMgeaOL.js → models-DwYioyNV.js} +203 -32
  65. package/src/models-DwYioyNV.js.map +1 -0
  66. package/src/runtime/blocks.js +22 -9
  67. package/src/runtime/blocks.js.map +1 -1
  68. package/src/runtime/collaboration.js.map +1 -1
  69. package/src/runtime/delivery/DocumentRenderer.js +7 -4
  70. package/src/runtime/delivery/DocumentRenderer.js.map +1 -1
  71. package/src/runtime/delivery/blocks.js +3 -1
  72. package/src/runtime/delivery/blocks.js.map +1 -1
  73. package/src/runtime/delivery/context.js +1 -1
  74. package/src/runtime/delivery/document-page.js +12 -12
  75. package/src/runtime/delivery/document-page.js.map +1 -1
  76. package/src/runtime/delivery/document.js +4 -2
  77. package/src/runtime/delivery/document.js.map +1 -1
  78. package/src/runtime/delivery/error.js.map +1 -1
  79. package/src/runtime/delivery/plugin.js +22 -2
  80. package/src/runtime/delivery/plugin.js.map +1 -1
  81. package/src/runtime/delivery/types.d.ts +5 -0
  82. package/src/runtime/delivery/useCmsDocumentSeo.d.ts +56 -0
  83. package/src/runtime/delivery/useCmsDocumentSeo.js +99 -0
  84. package/src/runtime/delivery/useCmsDocumentSeo.js.map +1 -0
  85. package/src/runtime/delivery/useDocument.js +2 -2
  86. package/src/runtime/delivery/useDocument.js.map +1 -1
  87. package/src/runtime/delivery/useDocumentQuery.js +2 -2
  88. package/src/runtime/delivery/useDocumentQuery.js.map +1 -1
  89. package/src/runtime/forms/document.js +38 -0
  90. package/src/runtime/forms/document.js.map +1 -0
  91. package/src/runtime/forms/useCmsForm.js +149 -0
  92. package/src/runtime/forms/useCmsForm.js.map +1 -0
  93. package/src/runtime/i18n/translator.js +22 -0
  94. package/src/runtime/i18n/translator.js.map +1 -0
  95. package/src/runtime/i18n/useCmsI18n.d.ts +9 -0
  96. package/src/runtime/i18n/useCmsI18n.js +29 -0
  97. package/src/runtime/i18n/useCmsI18n.js.map +1 -0
  98. package/src/runtime/installation.js +1 -1
  99. package/src/runtime/plugin.js +1 -1
  100. package/src/runtime/plugin.js.map +1 -1
  101. package/src/runtime/preview/comark-document.js +0 -1
  102. package/src/runtime/preview/comark-document.js.map +1 -1
  103. package/src/runtime/preview/connection.js +1 -1
  104. package/src/runtime/preview/controller.js +10 -3
  105. package/src/runtime/preview/controller.js.map +1 -1
  106. package/src/runtime/preview/overlay.js.map +1 -1
  107. package/src/runtime/preview/plugin.client.js +59 -48
  108. package/src/runtime/preview/plugin.client.js.map +1 -1
  109. package/src/runtime/preview/protocol.js.map +1 -1
  110. package/src/runtime/preview/store.js +1 -1
  111. package/src/runtime/preview/targets.js +0 -1
  112. package/src/runtime/preview/targets.js.map +1 -1
  113. package/src/runtime/sitemap-entries.js +17 -0
  114. package/src/runtime/sitemap-entries.js.map +1 -0
  115. package/src/runtime/sitemap.js +24 -0
  116. package/src/runtime/sitemap.js.map +1 -0
  117. package/src/runtime/studio-app.js.map +1 -1
  118. package/src/runtime/studio-entry.js +2 -2
  119. package/src/runtime/studio-entry.js.map +1 -1
  120. package/src/runtime/studio-navigation.js +1 -1
  121. package/src/scalars-B2lgGUnj.js +26 -0
  122. package/src/scalars-B2lgGUnj.js.map +1 -0
  123. package/src/{store-CfFFx9Ua.js → store-DjJs3I7k.js} +12 -7
  124. package/src/store-DjJs3I7k.js.map +1 -0
  125. package/studio/{CreateDocumentDialog--L9lTfx6.js → CreateDocumentDialog-CTeIFlPb.js} +44 -44
  126. package/studio/{collaboration-DUuu678R.js → collaboration-DcK2F6v9.js} +7 -6
  127. package/studio/{documentPlanning-BXX04Woe.js → documentPlanning-Bfv-d7OU.js} +7310 -6479
  128. package/studio/{editor-PexnXkJY.js → editor-Bzlh3zXt.js} +7965 -7955
  129. package/studio/host.css +1 -1
  130. package/studio/host.js +10416 -7981
  131. package/src/Configuration-DyKo0sLS.js.map +0 -1
  132. package/src/DocumentEngine-DYObwMDY.js.map +0 -1
  133. package/src/HttpPaths-BbS21Jy8.js.map +0 -1
  134. package/src/StudioHttp-jR2-bc01.js +0 -718
  135. package/src/StudioHttp-jR2-bc01.js.map +0 -1
  136. package/src/connection-CBTY-TzB.js.map +0 -1
  137. package/src/installation-DeuBiFRE.js.map +0 -1
  138. package/src/location-DtYv2aes.js.map +0 -1
  139. package/src/metadata-DE1Mc2td.js.map +0 -1
  140. package/src/models-BkMgeaOL.js.map +0 -1
  141. package/src/models-C3witQBK.js.map +0 -1
  142. package/src/store-CfFFx9Ua.js.map +0 -1
@@ -1,9 +1,10 @@
1
- import { C as MarkdownNode, dt as Locale, ft as SourceDirectory, lt as AddressPattern, n as CmsMarkdownDocument, ut as CollectionName } from "./models-BkMgeaOL.js";
2
- import { a as createEditorNodeId, c as createCmsComarkRenderData, f as toMutableComarkAttributes, l as mutableJson, n as editorMetadata, o as editorNodeId, u as mutableJsonObject } from "./metadata-DE1Mc2td.js";
1
+ import { r as FormCapabilities } from "./Forms-CfcI3tPU.js";
2
+ import { c as resolveCmsComarkAttributes, d as createCmsComarkRenderData, l as withCmsComarkProps, r as formStructureIssues, s as projectCmsEditorComponentAttributes } from "./Forms-DxbkU3_5.js";
3
+ import { C as MarkdownNode, Dt as Locale, Et as CollectionName, Ot as SourceDirectory, Tt as AddressPattern, n as CmsMarkdownDocument } from "./models-DwYioyNV.js";
4
+ import { a as createEditorNodeId, n as editorMetadata, o as editorNodeId } from "./metadata-BEZPWh-3.js";
3
5
  import { Effect, Option, Predicate, Schema } from "effect";
4
6
  import { Extension } from "@tiptap/core";
5
7
  import { ySyncPluginKey } from "@tiptap/y-tiptap";
6
- import { resolveAttributes } from "comark/utils";
7
8
  import { createMarkdownParser } from "comark/parse";
8
9
  import alert from "comark/plugins/alert";
9
10
  import attributes from "comark/plugins/attributes";
@@ -14,130 +15,6 @@ import security from "comark/plugins/security";
14
15
  import taskList from "comark/plugins/task-list";
15
16
  import toc from "comark/plugins/toc";
16
17
 
17
- //#region ../document/src/internal/comark/bindings.ts
18
- const isJsonObject$3 = Schema.is(Schema.JsonObject);
19
- const decodeJson = Schema.decodeUnknownOption(Schema.Json);
20
- /** Normalizes bindings exactly as Comark's framework renderers do before passing props to a component. */
21
- function resolveCmsComarkAttributes(attributes, renderData) {
22
- const resolved = /* @__PURE__ */ new Map();
23
- for (const [name, value] of Object.entries(resolveAttributes(toMutableComarkAttributes(attributes), renderData, { parseJson: true }))) {
24
- if (Predicate.isUndefined(value)) {
25
- resolved.set(name, void 0);
26
- continue;
27
- }
28
- const decoded = decodeJson(value);
29
- if (Option.isNone(decoded)) throw new Error(`Comark resolved non-JSON attribute "${name}".`);
30
- resolved.set(name, decoded.value);
31
- }
32
- return resolved;
33
- }
34
- /** Projects bindings to editable values while retaining enough metadata to reconstruct their authored form. */
35
- function projectCmsEditorComponentAttributes(attributes, renderData) {
36
- const resolved = resolveCmsComarkAttributes(attributes, renderData);
37
- const props = {};
38
- for (const [name, value] of resolved) if (!Predicate.isUndefined(value)) props[name] = mutableJson(value);
39
- const bindings = {};
40
- for (const [authoredName, authoredValue] of Object.entries(attributes)) {
41
- if (!authoredName.startsWith(":") || authoredName.length === 1) continue;
42
- const name = authoredName.slice(1);
43
- if (!resolved.has(name)) continue;
44
- const literal = jsonLiteral(authoredValue);
45
- if (!Predicate.isString(authoredValue) || literal !== authoredValue) {
46
- bindings[name] = { kind: "literal" };
47
- continue;
48
- }
49
- const resolvedValue = resolved.get(name);
50
- bindings[name] = Object.assign({
51
- expression: authoredValue,
52
- kind: "expression"
53
- }, Predicate.isUndefined(resolvedValue) ? void 0 : { resolved: mutableJson(resolvedValue) });
54
- }
55
- return {
56
- bindings,
57
- props,
58
- renderData: withCmsComarkProps(renderData, resolved)
59
- };
60
- }
61
- /** Reconstructs authored bindings, keeping expressions until a user replaces their resolved value. */
62
- function encodeCmsEditorComponentAttributes(props, bindings) {
63
- const attributes = mutableJsonObject(props);
64
- for (const [name, encodedBinding] of Object.entries(bindings)) {
65
- const binding = jsonObject$2(encodedBinding);
66
- const kind = binding.kind;
67
- if (kind !== "literal" && kind !== "expression") continue;
68
- const current = props[name];
69
- if (Predicate.isUndefined(current)) {
70
- const expression = binding.expression;
71
- if (kind === "expression" && Predicate.isString(expression)) attributes[`:${name}`] = expression;
72
- continue;
73
- }
74
- delete attributes[name];
75
- const expression = binding.expression;
76
- const resolved = binding.resolved;
77
- attributes[`:${name}`] = kind === "expression" && Predicate.isString(expression) && Object.hasOwn(binding, "resolved") && sameJson(current, resolved) ? expression : mutableJson(current);
78
- }
79
- return attributes;
80
- }
81
- function withCmsComarkProps(renderData, attributes) {
82
- return attributes.size > 0 ? {
83
- ...renderData,
84
- props: Object.fromEntries(attributes)
85
- } : renderData;
86
- }
87
- /** Restores typed component bindings that Comark's block-YAML roundtrip can emit as plain attributes. */
88
- function normalizeCmsComponentBindings(document, components) {
89
- if (!components) return document;
90
- return CmsMarkdownDocument.make({
91
- frontmatter: document.frontmatter,
92
- meta: document.meta,
93
- nodes: document.nodes.map((node) => normalizeComponentNode(node, components))
94
- });
95
- }
96
- function matchesCmsComponentPropType(value, type) {
97
- switch (type) {
98
- case "object": return isJsonObject$3(value);
99
- case "array": return Array.isArray(value);
100
- case "boolean": return Predicate.isBoolean(value);
101
- case "number": return Predicate.isNumber(value);
102
- case "string": return Predicate.isString(value);
103
- }
104
- }
105
- function normalizeComponentNode(node, components) {
106
- if (Predicate.isString(node) || node[0] === null) return node;
107
- const [tag, originalAttributes, ...originalChildren] = node;
108
- const attributes = mutableJsonObject(originalAttributes);
109
- const definition = components.get(tag.toLocaleLowerCase());
110
- if (definition) for (const prop of definition.authoring.props) {
111
- if (prop.type === "string" || `:${prop.name}` in attributes || !(prop.name in attributes)) continue;
112
- const value = attributes[prop.name];
113
- if (Predicate.isUndefined(value)) continue;
114
- if (!matchesCmsComponentPropType(jsonLiteral(value), prop.type)) continue;
115
- delete attributes[prop.name];
116
- attributes[`:${prop.name}`] = value;
117
- }
118
- return [
119
- tag,
120
- attributes,
121
- ...originalChildren.map((child) => normalizeComponentNode(child, components))
122
- ];
123
- }
124
- function jsonLiteral(value) {
125
- if (!Predicate.isString(value)) return value;
126
- try {
127
- const decoded = decodeJson(JSON.parse(value));
128
- return Option.isSome(decoded) ? decoded.value : value;
129
- } catch {
130
- return value;
131
- }
132
- }
133
- function jsonObject$2(value) {
134
- return isJsonObject$3(value) ? value : {};
135
- }
136
- function sameJson(left, right) {
137
- return !Predicate.isUndefined(right) && JSON.stringify(left) === JSON.stringify(right);
138
- }
139
-
140
- //#endregion
141
18
  //#region ../document/src/internal/editor/attributes.ts
142
19
  function compactJsonAttributes(attributes) {
143
20
  return Object.fromEntries(Object.entries(attributes).filter((entry) => entry[1] !== void 0));
@@ -316,7 +193,7 @@ function decodeBlock(node, context, renderData) {
316
193
  return {
317
194
  type: "codeBlock",
318
195
  attrs: mergeJsonAttributes(commonAttrs, { language: nonEmptyStringAttribute(attrs.language) ?? nonEmptyStringAttribute(code?.[1].class)?.replace(/^language-/u, "") }),
319
- content: textContent$1(code ? elementChildren(code) : children)
196
+ content: textContent(code ? elementChildren(code) : children)
320
197
  };
321
198
  }
322
199
  case "hr": return {
@@ -377,7 +254,7 @@ function decodeSlot(node, context, renderData) {
377
254
  };
378
255
  }
379
256
  function decodeListItems(nodes, context, renderData) {
380
- return nodes.filter(isElementNode$1).filter((node) => node[0] === "li").map((node) => decodeBlock(node, context, renderData));
257
+ return nodes.flatMap((node) => isElementNode$1(node) && node[0] === "li" ? [decodeBlock(node, context, renderData)] : []);
381
258
  }
382
259
  function decodeInlines(nodes, context, renderData, inheritedMarks = []) {
383
260
  const result = [];
@@ -486,8 +363,8 @@ function cleanAttrs(attrs) {
486
363
  const { $: _internal, "data-cms-node": _marker, ...clean } = attrs;
487
364
  return structuredClone(clean);
488
365
  }
489
- function textContent$1(nodes) {
490
- const text = nodes.map((node) => Predicate.isString(node) ? node : node[0] === null ? node[2] : textContent$1(elementChildren(node))?.map((child) => child.text ?? "").join("") ?? "").join("");
366
+ function textContent(nodes) {
367
+ const text = nodes.map((node) => Predicate.isString(node) ? node : node[0] === null ? node[2] : textContent(elementChildren(node))?.map((child) => child.text ?? "").join("") ?? "").join("");
491
368
  return text ? [{
492
369
  type: "text",
493
370
  text
@@ -548,7 +425,6 @@ const WRAPPER_TAGS = /* @__PURE__ */ new Set([
548
425
  "table",
549
426
  "ul"
550
427
  ]);
551
- /** Captures the durable source before frontmatter or other pre-parse stages mutate it. */
552
428
  function sourceCapturePlugin() {
553
429
  return {
554
430
  name: "cms-source-capture",
@@ -557,7 +433,6 @@ function sourceCapturePlugin() {
557
433
  }
558
434
  };
559
435
  }
560
- /** Translate Comark block token line maps into exact JavaScript source offsets. */
561
436
  function sourceMappingPlugin() {
562
437
  return {
563
438
  name: "cms-source-mapping",
@@ -565,7 +440,7 @@ function sourceMappingPlugin() {
565
440
  const source = state.__cmsOriginalMarkdown ?? state.markdown;
566
441
  const descriptors = createBlockDescriptors(state.tokens.flatMap((token) => {
567
442
  const decoded = Schema.decodeUnknownOption(ComarkToken)(token);
568
- return decoded._tag === "Some" ? [decoded.value] : [];
443
+ return Option.isSome(decoded) ? [decoded.value] : [];
569
444
  }), source, state.markdown, state.parsedLines ?? 0);
570
445
  const mappings = [];
571
446
  mapNodes(state.tree.nodes, descriptors, [], mappings);
@@ -759,7 +634,6 @@ function pointAt(source, lineStarts, rawOffset) {
759
634
  * with compiled documents so migrations can identify stale derived content.
760
635
  */
761
636
  const DOCUMENT_ENGINE_FINGERPRINT = "comark@0.6.2/frontmatter+alert+task-list+components+attributes+security+headings+toc+source-mapping/v1";
762
- /** One explicit grammar for authoring, preview, delivery, and analysis projections. */
763
637
  function createDocumentParser() {
764
638
  return createMarkdownParser({
765
639
  autoClose: false,
@@ -792,7 +666,6 @@ var EditorRenderFailed = class extends Schema.TaggedError()("EditorDocument.Rend
792
666
 
793
667
  //#endregion
794
668
  //#region ../document/src/AuthoringSchema.ts
795
- /** Compiles insertion content with the same grammar used for publication. */
796
669
  const parseAuthoringContent = Effect.fn("AuthoringSchema.parseContent")(function* (markdown) {
797
670
  const body = yield* Effect.tryPromise({
798
671
  try: () => createDocumentParser()(markdown),
@@ -804,7 +677,6 @@ const parseAuthoringContent = Effect.fn("AuthoringSchema.parseContent")(function
804
677
  return (yield* Schema.decodeUnknownEffect(CmsMarkdownDocument)(body)).nodes;
805
678
  });
806
679
  const isJsonObject = Schema.is(Schema.JsonObject);
807
- /** Resolves collection selectors for both insertion controls and authoritative validation. */
808
680
  function collectionComponents(components, body) {
809
681
  if (!body) return components;
810
682
  return components.filter((component) => body.blocks?.includes(component.name) || component.authoring.group !== void 0 && body.groups?.includes(component.authoring.group));
@@ -826,6 +698,7 @@ function contentIssues(node, schemas, allowed, purpose, collectionAllowed = allo
826
698
  else {
827
699
  if (!allowed.has(name)) issues.push(`${schema.definition.label} is not allowed in this content region.`);
828
700
  issues.push(...schema.validate(node, purpose));
701
+ if (purpose === "publish" && schema.definition.form) issues.push(...formStructureIssues(node.attrs?.props?.steps, schema.definition.form, name));
829
702
  }
830
703
  }
831
704
  if (node.type === "cmsOpaque" || node.type === "cmsInlineOpaque") issues.push("This content is unsupported. Ask your site developer to update it before publishing.");
@@ -843,13 +716,14 @@ function contentIssues(node, schemas, allowed, purpose, collectionAllowed = allo
843
716
  }
844
717
  return [...issues, ...(node.content ?? []).flatMap((child) => contentIssues(child, schemas, allowed, purpose, collectionAllowed))];
845
718
  }
846
- /** Validates authored blocks during single-document compilation as well as catalog publication. */
847
- function validateAuthoringDocument(body, components, bodyPolicy) {
848
- if (!components) return [];
719
+ /** Resolves a component catalog once so document compilation can reuse its authoring rules. */
720
+ function createAuthoringDocumentValidator(components) {
849
721
  const definitions = [...components.values()];
850
722
  const schemas = new Map(definitions.map((component) => [component.name, createAuthoringSchema(component.name, component.authoring)]));
851
- const allowed = new Set(collectionComponents(definitions, bodyPolicy).map((component) => component.name));
852
- return comarkToEditor(body.nodes, createCmsComarkRenderData(body)).flatMap((node) => contentIssues(node, schemas, allowed, "publish"));
723
+ return (body, bodyPolicy) => {
724
+ const allowed = new Set(collectionComponents(definitions, bodyPolicy).map((component) => component.name));
725
+ return comarkToEditor(body.nodes, createCmsComarkRenderData(body)).flatMap((node) => contentIssues(node, schemas, allowed, "publish"));
726
+ };
853
727
  }
854
728
  function createAuthoringSchema(name, definition) {
855
729
  const fields = new Map(definition.props.map((field) => [field.name, field]));
@@ -940,7 +814,13 @@ function createAuthoringSchema(name, definition) {
940
814
  function propertyIssue(field, value, purpose) {
941
815
  if (value === void 0) return field.required && purpose === "publish" ? `${field.label} is required.` : void 0;
942
816
  if (value === null && field.nullable) return void 0;
943
- if (!(field.type === "string" ? Predicate.isString(value) : field.type === "number" ? Predicate.isNumber(value) && Number.isFinite(value) : field.type === "boolean" ? Predicate.isBoolean(value) : field.type === "array" ? Array.isArray(value) : isJsonObject(value))) return `${field.label} must be ${field.type}.`;
817
+ let valid;
818
+ if (field.type === "string") valid = Predicate.isString(value);
819
+ else if (field.type === "number") valid = Predicate.isNumber(value) && Number.isFinite(value);
820
+ else if (field.type === "boolean") valid = Predicate.isBoolean(value);
821
+ else if (field.type === "array") valid = Array.isArray(value);
822
+ else valid = isJsonObject(value);
823
+ if (!valid) return `${field.label} must be ${field.type}.`;
944
824
  if (field.type === "object" || field.type === "array") {
945
825
  const entries = Array.isArray(value) ? value : [value];
946
826
  const ids = /* @__PURE__ */ new Set();
@@ -998,7 +878,6 @@ function validAuthoringUrl(value, input) {
998
878
 
999
879
  //#endregion
1000
880
  //#region ../protocol/src/Authoring.ts
1001
- /** Serializable component authoring data resolved by the framework compiler. */
1002
881
  const BlockProp = Schema.Struct({
1003
882
  name: Schema.NonEmptyString,
1004
883
  label: Schema.NonEmptyString,
@@ -1053,6 +932,7 @@ const BlockSlot = Schema.Struct({
1053
932
  });
1054
933
  const BlockAuthoring = Schema.Struct({
1055
934
  version: Schema.Literal(1),
935
+ form: Schema.optionalKey(FormCapabilities),
1056
936
  label: Schema.NonEmptyString,
1057
937
  description: Schema.optionalKey(Schema.String),
1058
938
  group: Schema.optionalKey(Schema.String),
@@ -1064,7 +944,6 @@ const BlockAuthoring = Schema.Struct({
1064
944
 
1065
945
  //#endregion
1066
946
  //#region ../protocol/src/Configuration.ts
1067
- /** Validated installation configuration shared by authoring, compilation, Studio, and Nuxt. */
1068
947
  const fieldPresentation = {
1069
948
  path: Schema.NonEmptyString,
1070
949
  label: Schema.NonEmptyString,
@@ -1150,5 +1029,5 @@ const MediaConfiguration = Schema.Struct({
1150
1029
  });
1151
1030
 
1152
1031
  //#endregion
1153
- export { finiteNumberAttribute as C, projectCmsEditorComponentAttributes as D, normalizeCmsComponentBindings as E, resolveCmsComarkAttributes as O, compactJsonAttributes as S, encodeCmsEditorComponentAttributes as T, comarkTagForEditorMark as _, BlockAuthoring as a, encodeEditorImageAttributes as b, validateAuthoringDocument as c, EditorRenderFailed as d, DOCUMENT_ENGINE_FINGERPRINT as f, EDITOR_MARK_TYPES as g, comarkToEditor as h, MediaConfiguration as i, withCmsComarkProps as k, validateCollectionBody as l, SOURCE_MAPPINGS_META_KEY as m, ComponentDefinition as n, createAuthoringSchema as o, createDocumentParser as p, DocumentConfiguration as r, parseAuthoringContent as s, AuthoringCatalog as t, EditorDocumentInvalid as u, isEditorMark as v, nonEmptyStringAttribute as w, normalizeEditorImageLayout as x, EDITOR_IMAGE_LAYOUT_ATTRIBUTE as y };
1154
- //# sourceMappingURL=Configuration-DyKo0sLS.js.map
1032
+ export { finiteNumberAttribute as C, compactJsonAttributes as S, comarkTagForEditorMark as _, BlockAuthoring as a, encodeEditorImageAttributes as b, parseAuthoringContent as c, EditorRenderFailed as d, DOCUMENT_ENGINE_FINGERPRINT as f, EDITOR_MARK_TYPES as g, comarkToEditor as h, MediaConfiguration as i, validateCollectionBody as l, SOURCE_MAPPINGS_META_KEY as m, ComponentDefinition as n, createAuthoringDocumentValidator as o, createDocumentParser as p, DocumentConfiguration as r, createAuthoringSchema as s, AuthoringCatalog as t, EditorDocumentInvalid as u, isEditorMark as v, nonEmptyStringAttribute as w, normalizeEditorImageLayout as x, EDITOR_IMAGE_LAYOUT_ATTRIBUTE as y };
1033
+ //# sourceMappingURL=Configuration-CA_jvQKG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Configuration-CA_jvQKG.js","names":["isJsonObject","jsonObject","comarkToEditor","isJsonObject","isElementNode"],"sources":["../../../../document/src/internal/editor/attributes.ts","../../../../document/src/internal/editor/image.ts","../../../../document/src/internal/editor/marks.ts","../../../../document/src/internal/comark/to-editor.ts","../../../../document/src/internal/comark/source-mapping.ts","../../../../document/src/internal/comark/grammar.ts","../../../../document/src/internal/editor/errors.ts","../../../../document/src/AuthoringSchema.ts","../../../../protocol/src/Authoring.ts","../../../../protocol/src/Configuration.ts"],"sourcesContent":["import { Predicate, Schema } from 'effect'\n\nexport function compactJsonAttributes(\n attributes: Readonly<Record<string, Schema.Json | undefined>>,\n): Schema.JsonObject {\n return Object.fromEntries(\n Object.entries(attributes).filter((entry): entry is [string, Schema.Json] => entry[1] !== undefined),\n )\n}\n\nexport function nonEmptyStringAttribute(value: Schema.Json | undefined): string | undefined {\n return Predicate.isString(value) && value ? value : undefined\n}\n\nexport function finiteNumberAttribute(value: Schema.Json | undefined, fallback: number): number {\n const number = Predicate.isNumber(value) ? value : Number(value)\n\n return Number.isFinite(number) ? number : fallback\n}\n","import { Predicate, Schema } from 'effect'\nimport { compactJsonAttributes } from './attributes'\n\nconst isJsonObject = Schema.is(Schema.JsonObject)\n\nconst EDITOR_IMAGE_LAYOUTS = ['natural', 'content', 'full'] as const\n\nexport type EditorImageLayout = (typeof EDITOR_IMAGE_LAYOUTS)[number]\n\nconst EditorImageLayout = Schema.Literals(EDITOR_IMAGE_LAYOUTS)\n\nconst isEditorImageLayout = Schema.is(EditorImageLayout)\n\nexport const EDITOR_IMAGE_LAYOUT_ATTRIBUTE = 'data-cms-layout'\n\nconst IMAGE_DECORATIVE_ATTRIBUTE = 'data-cms-decorative'\n\nconst IMAGE_SEMANTIC_ATTRIBUTES = new Set([\n 'alt',\n IMAGE_DECORATIVE_ATTRIBUTE,\n EDITOR_IMAGE_LAYOUT_ATTRIBUTE,\n 'src',\n 'title',\n])\n\nexport function decodeEditorImageAttributes(attributes: Schema.JsonObject): Schema.JsonObject {\n const cmsProps = Object.fromEntries(\n Object.entries(attributes).filter(([name]) => !IMAGE_SEMANTIC_ATTRIBUTES.has(name)),\n )\n\n return compactJsonAttributes({\n alt:\n attributes[IMAGE_DECORATIVE_ATTRIBUTE] !== undefined\n ? ''\n : Predicate.isString(attributes.alt)\n ? attributes.alt\n : null,\n cmsProps: Object.keys(cmsProps).length ? cmsProps : null,\n layout: normalizeEditorImageLayout(attributes[EDITOR_IMAGE_LAYOUT_ATTRIBUTE]),\n src: stringValue(attributes.src) || null,\n title: stringValue(attributes.title) || null,\n })\n}\n\nexport function encodeEditorImageAttributes(value: Schema.JsonObject | undefined): Schema.JsonObject {\n const attributes = jsonObject(value)\n const alt = attributes.alt\n const layout = normalizeEditorImageLayout(attributes.layout)\n\n return compactJsonAttributes(\n Object.assign({}, jsonObject(attributes.cmsProps), {\n alt: Predicate.isString(alt) ? alt : undefined,\n [IMAGE_DECORATIVE_ATTRIBUTE]: alt === '' ? 'true' : undefined,\n [EDITOR_IMAGE_LAYOUT_ATTRIBUTE]: layout === 'natural' ? undefined : layout,\n src: stringValue(attributes.src) || undefined,\n title: stringValue(attributes.title) || undefined,\n }),\n )\n}\n\nexport function normalizeEditorImageLayout(value: Schema.Json | undefined): EditorImageLayout {\n return isEditorImageLayout(value) ? value : 'natural'\n}\n\nfunction jsonObject(value: Schema.Json | undefined): Schema.JsonObject {\n return isJsonObject(value) ? value : {}\n}\n\nfunction stringValue(value: Schema.Json | undefined): string {\n return Predicate.isString(value) || Predicate.isNumber(value) ? String(value) : ''\n}\n","const EDITOR_MARKS = [\n ['bold', 'strong'],\n ['code', 'code'],\n ['italic', 'em'],\n ['link', 'a'],\n ['strike', 'del'],\n ['underline', 'u'],\n] as const\n\nexport const EDITOR_MARK_TYPES = EDITOR_MARKS.map(([type]) => type)\n\nconst editorToComark = new Map<string, string>(EDITOR_MARKS)\n\nconst comarkToEditor = new Map<string, string>(EDITOR_MARKS.map(([type, tag]) => [tag, type]))\n\nexport function comarkTagForEditorMark(type: string): string | undefined {\n return editorToComark.get(type)\n}\n\nexport function editorMarkForComarkTag(tag: string): string | undefined {\n return comarkToEditor.get(tag)\n}\n\nexport function isEditorMark(type: string): boolean {\n return editorToComark.has(type)\n}\n\nexport function isComarkMark(tag: string): boolean {\n return comarkToEditor.has(tag)\n}\n","import type { MarkdownNode } from '@internal/protocol/Documents'\nimport type { EditorNodeId } from '@internal/protocol/Documents'\nimport type { JSONContent } from '@tiptap/core'\nimport type { NodeRenderData } from 'comark'\nimport { Predicate, Schema } from 'effect'\nimport { projectCmsEditorComponentAttributes, resolveCmsComarkAttributes, withCmsComarkProps } from './bindings'\nimport { editorNodeId, createEditorNodeId } from '../editor/identity'\nimport { decodeEditorImageAttributes } from '../editor/image'\nimport { editorMetadata } from '../editor/metadata'\nimport { compactJsonAttributes, finiteNumberAttribute, nonEmptyStringAttribute } from '../editor/attributes'\nimport { editorMarkForComarkTag, isComarkMark } from '../editor/marks'\n\nconst isJsonObject = Schema.is(Schema.JsonObject)\n\ntype ElementMarkdownNode = Extract<MarkdownNode, readonly [string, Schema.JsonObject, ...MarkdownNode[]]>\n\ninterface DecodeContext {\n readonly usedIds: Set<EditorNodeId>\n}\n\nconst OPAQUE_BLOCK_TAGS = new Set(['math', 'table', 'tbody', 'td', 'th', 'thead', 'tr'])\n\nexport function comarkToEditor(\n nodes: ReadonlyArray<MarkdownNode>,\n renderData: NodeRenderData = { data: {}, frontmatter: {}, meta: {}, props: {} },\n): JSONContent[] {\n return decodeBlocks(\n nodes,\n {\n usedIds: new Set(),\n },\n renderData,\n )\n}\n\nfunction decodeBlocks(\n nodes: ReadonlyArray<MarkdownNode>,\n context: DecodeContext,\n renderData: NodeRenderData,\n wrapInlineContent = false,\n): JSONContent[] {\n const content: JSONContent[] = []\n let inlineNodes: MarkdownNode[] = []\n\n const flushInlineNodes = () => {\n const inline = decodeInlines(inlineNodes, context, renderData)\n\n if (inline.length) {\n content.push({\n type: 'paragraph',\n attrs: wrapInlineContent ? { cmsSynthetic: true } : { cmsNodeId: claimIdentity(context) },\n content: inline,\n })\n }\n\n inlineNodes = []\n }\n\n for (const node of nodes) {\n if (Predicate.isString(node) || isInlineElement(node)) {\n inlineNodes.push(node)\n continue\n }\n\n flushInlineNodes()\n content.push(decodeBlock(node, context, renderData))\n }\n\n flushInlineNodes()\n\n return content\n}\n\nfunction decodeBlock(\n node: Exclude<MarkdownNode, string>,\n context: DecodeContext,\n renderData: NodeRenderData,\n): JSONContent {\n if (node[0] === null) {\n return opaqueBlock(node, 'Comment', claimIdentity(context, node[1]))\n }\n\n const [tag, rawAttributes, ...children] = node\n const attrs = cleanAttrs(rawAttributes)\n const childRenderData = withCmsComarkProps(renderData, resolveCmsComarkAttributes(rawAttributes, renderData))\n const metadata = editorMetadata(rawAttributes)\n const cmsNodeId = claimIdentity(context, rawAttributes)\n\n const commonAttrs = compactJsonAttributes({\n cmsNodeId,\n cmsProps: attrs,\n })\n\n if (/^h[1-6]$/u.test(tag)) {\n return {\n type: 'heading',\n attrs: mergeJsonAttributes(commonAttrs, { level: Number(tag.slice(1)) }),\n content: decodeInlines(children, context, childRenderData),\n }\n }\n\n switch (tag) {\n case 'p':\n return { type: 'paragraph', attrs: commonAttrs, content: decodeInlines(children, context, childRenderData) }\n case 'blockquote':\n return {\n type: 'blockquote',\n attrs: commonAttrs,\n content: decodeBlocks(children, context, childRenderData),\n }\n case 'ul':\n return {\n type: 'bulletList',\n attrs: commonAttrs,\n content: decodeListItems(children, context, childRenderData),\n }\n case 'ol':\n return {\n type: 'orderedList',\n attrs: mergeJsonAttributes(commonAttrs, { start: finiteNumberAttribute(attrs.start, 1) }),\n content: decodeListItems(children, context, childRenderData),\n }\n case 'li':\n return {\n type: 'listItem',\n attrs: commonAttrs,\n content: decodeBlocks(children, context, childRenderData),\n }\n case 'pre': {\n const code = children.find(isElementNode)\n\n const language =\n nonEmptyStringAttribute(attrs.language) ?? nonEmptyStringAttribute(code?.[1].class)?.replace(/^language-/u, '')\n\n return {\n type: 'codeBlock',\n attrs: mergeJsonAttributes(commonAttrs, { language }),\n content: textContent(code ? elementChildren(code) : children),\n }\n }\n\n case 'hr':\n return { type: 'horizontalRule', attrs: commonAttrs }\n default:\n if (OPAQUE_BLOCK_TAGS.has(tag)) return opaqueBlock(node, tag, cmsNodeId)\n const projection = projectCmsEditorComponentAttributes(rawAttributes, renderData)\n\n return {\n type: 'cmsBlock',\n attrs: compactJsonAttributes({\n bindings: projection.bindings,\n cmsNodeId,\n props: projection.props,\n tag,\n }),\n content: decodeComponentSlots(children, context, projection.renderData, metadata?.implicitSlotId),\n }\n }\n}\n\nfunction decodeComponentSlots(\n children: ReadonlyArray<MarkdownNode>,\n context: DecodeContext,\n renderData: NodeRenderData,\n implicitSlotId?: EditorNodeId,\n): JSONContent[] {\n const templates = children.filter(isSlotTemplate)\n const regular = children.filter((node) => !isSlotTemplate(node))\n const slots = templates.map((node) => decodeSlot(node, context, renderData))\n\n if (!regular.length) return slots\n\n const defaultContent = slotContent(decodeBlocks(regular, context, renderData, true))\n const explicitDefault = slots.find((slot) => slot.attrs?.name === 'default')\n\n if (explicitDefault) {\n explicitDefault.content = [...(explicitDefault.content ?? []), ...defaultContent]\n\n return slots\n }\n\n return [\n {\n type: 'cmsSlot',\n attrs: {\n cmsNodeId: claimIdentityValue(context, implicitSlotId),\n implicit: true,\n name: 'default',\n props: {},\n },\n content: defaultContent,\n },\n ...slots,\n ]\n}\n\nfunction decodeSlot(node: ElementMarkdownNode, context: DecodeContext, renderData: NodeRenderData): JSONContent {\n const attrs = cleanAttrs(node[1])\n const childRenderData = withCmsComarkProps(renderData, resolveCmsComarkAttributes(node[1], renderData))\n const name = slotName(attrs)\n const { name: _name, ...slotProps } = attrs\n\n return {\n type: 'cmsSlot',\n attrs: {\n cmsNodeId: claimIdentity(context, node[1]),\n implicit: false,\n name,\n props: slotProps,\n },\n content: slotContent(decodeBlocks(elementChildren(node), context, childRenderData, true)),\n }\n}\n\nfunction decodeListItems(\n nodes: ReadonlyArray<MarkdownNode>,\n context: DecodeContext,\n renderData: NodeRenderData,\n): JSONContent[] {\n return nodes.flatMap((node) =>\n isElementNode(node) && node[0] === 'li' ? [decodeBlock(node, context, renderData)] : [],\n )\n}\n\nfunction decodeInlines(\n nodes: ReadonlyArray<MarkdownNode>,\n context: DecodeContext,\n renderData: NodeRenderData,\n inheritedMarks: NonNullable<JSONContent['marks']> = [],\n): JSONContent[] {\n const result: JSONContent[] = []\n\n for (const node of nodes) {\n if (Predicate.isString(node)) {\n if (node) {\n result.push(withMarks({ type: 'text', text: node }, inheritedMarks))\n }\n\n continue\n }\n\n if (node[0] === null) {\n result.push(\n withMarks(\n {\n type: 'cmsInlineOpaque',\n attrs: { label: 'Comment', node: stripInternalMetadata(node) },\n },\n inheritedMarks,\n ),\n )\n continue\n }\n\n const markType = editorMarkForComarkTag(node[0])\n\n if (markType) {\n const attrs = cleanAttrs(node[1])\n const childRenderData = withCmsComarkProps(renderData, resolveCmsComarkAttributes(node[1], renderData))\n\n const markAttrs =\n markType === 'link'\n ? mergeJsonAttributes(attrs, { cmsProps: attrs })\n : Object.keys(attrs).length\n ? { cmsProps: attrs }\n : undefined\n\n const mark = markAttrs === undefined ? { type: markType } : { attrs: markAttrs, type: markType }\n result.push(...decodeInlines(elementChildren(node), context, childRenderData, [...inheritedMarks, mark]))\n continue\n }\n\n if (node[0] === 'br') {\n result.push(withMarks({ type: 'hardBreak' }, inheritedMarks))\n continue\n }\n\n if (node[0] === 'img') {\n result.push(\n withMarks(\n {\n type: 'image',\n attrs: mergeJsonAttributes(decodeEditorImageAttributes(cleanAttrs(node[1])), {\n cmsNodeId: claimIdentity(context, node[1]),\n }),\n },\n inheritedMarks,\n ),\n )\n continue\n }\n\n result.push(\n withMarks(\n {\n type: 'cmsInlineOpaque',\n attrs: {\n label: node[0],\n node: stripInternalMetadata(node),\n },\n },\n inheritedMarks,\n ),\n )\n }\n\n return result\n}\n\nfunction claimIdentity(context: DecodeContext, attributes?: Schema.JsonObject): EditorNodeId {\n return claimIdentityValue(context, attributes ? editorMetadata(attributes)?.nodeId : undefined)\n}\n\nfunction claimIdentityValue(context: DecodeContext, candidate?: Schema.Json): EditorNodeId {\n const existing = editorNodeId(candidate)\n\n if (existing !== undefined && !context.usedIds.has(existing)) {\n context.usedIds.add(existing)\n\n return existing\n }\n\n for (let attempt = 0; attempt < 100; attempt++) {\n const created = createEditorNodeId()\n\n if (!context.usedIds.has(created)) {\n context.usedIds.add(created)\n\n return created\n }\n }\n\n throw new Error('The editor identity factory did not produce a unique identity.')\n}\n\nfunction opaqueBlock(node: Exclude<MarkdownNode, string>, label: string, cmsNodeId: EditorNodeId): JSONContent {\n return {\n type: 'cmsOpaque',\n attrs: {\n cmsNodeId,\n label,\n node: stripInternalMetadata(node),\n },\n }\n}\n\nfunction stripInternalMetadata(node: Exclude<MarkdownNode, string>): Exclude<MarkdownNode, string> {\n if (node[0] === null) return [null, cleanAttrs(node[1]), node[2]]\n const [tag, attributes, ...children] = node\n const clean = cleanAttrs(attributes)\n\n return [tag, clean, ...children.map((child) => (Predicate.isString(child) ? child : stripInternalMetadata(child)))]\n}\n\nfunction slotContent(content: JSONContent[]): JSONContent[] {\n return content.length ? content : [{ type: 'paragraph', attrs: { cmsSynthetic: true } }]\n}\n\nfunction slotName(attrs: Schema.JsonObject): string {\n return nonEmptyStringAttribute(attrs.name) ?? 'default'\n}\n\nfunction cleanAttrs(attrs: Schema.JsonObject): Schema.JsonObject {\n const { $: _internal, 'data-cms-node': _marker, ...clean } = attrs\n\n return structuredClone(clean)\n}\n\nfunction textContent(nodes: ReadonlyArray<MarkdownNode>): JSONContent[] | undefined {\n const text = nodes\n .map((node) =>\n Predicate.isString(node)\n ? node\n : node[0] === null\n ? node[2]\n : (textContent(elementChildren(node))\n ?.map((child) => child.text ?? '')\n .join('') ?? ''),\n )\n .join('')\n\n return text ? [{ type: 'text', text }] : undefined\n}\n\nfunction isInlineElement(node: Exclude<MarkdownNode, string>): boolean {\n return (\n node[0] !== null &&\n (isComarkMark(node[0]) || node[0] === 'br' || node[0] === 'img' || jsonObject(node[1].$).block === 0)\n )\n}\n\nfunction isSlotTemplate(node: MarkdownNode): node is ElementMarkdownNode {\n return isElementNode(node) && node[0] === 'template'\n}\n\nfunction isElementNode(node: MarkdownNode | undefined): node is ElementMarkdownNode {\n return Array.isArray(node) && Predicate.isString(node[0])\n}\n\nfunction elementChildren(node: ElementMarkdownNode): MarkdownNode[] {\n const [, , ...children] = node\n\n return children\n}\n\nfunction jsonObject(value: Schema.Json | undefined): Schema.JsonObject {\n return isJsonObject(value) ? value : {}\n}\n\nfunction mergeJsonAttributes(\n attributes: Schema.JsonObject,\n additions: Readonly<Record<string, Schema.Json | undefined>>,\n): Schema.JsonObject {\n return compactJsonAttributes(Object.assign({}, attributes, additions))\n}\n\nfunction withMarks(content: JSONContent, marks: NonNullable<JSONContent['marks']>): JSONContent {\n return marks.length ? Object.assign({}, content, { marks }) : content\n}\n","import type { DocumentSourceMapping, DocumentSourcePoint, DocumentSourceRange } from '@internal/protocol/Documents'\nimport type { ComarkParsePostState, ComarkParsePreState, ComarkPlugin, ElementNode, Node } from 'comark'\nimport { Option, Predicate, Schema } from 'effect'\n\nexport const SOURCE_MAPPINGS_META_KEY = '__cmsSourceMappings'\n\ninterface SourceMapParseState {\n __cmsOriginalMarkdown?: string\n parsedLines?: number\n}\n\ninterface ComarkToken extends Schema.Schema.Type<typeof ComarkToken> {}\n\ninterface BlockDescriptor {\n readonly children: BlockDescriptor[]\n range: DocumentSourceRange\n readonly tag: string\n}\n\nconst BLOCK_TAGS = new Map([\n ['blockquote_open', 'blockquote'],\n ['bullet_list_open', 'ul'],\n ['list_item_open', 'li'],\n ['ordered_list_open', 'ol'],\n ['paragraph_open', 'p'],\n ['table_open', 'table'],\n ['tbody_open', 'tbody'],\n ['td_open', 'td'],\n ['th_open', 'th'],\n ['thead_open', 'thead'],\n ['tr_open', 'tr'],\n])\n\nconst ComarkToken = Schema.Struct({\n attrs: Schema.optionalKey(Schema.NullOr(Schema.Array(Schema.Tuple([Schema.String, Schema.String])))),\n hidden: Schema.optionalKey(Schema.Boolean),\n level: Schema.optionalKey(Schema.Finite),\n map: Schema.optionalKey(Schema.NullOr(Schema.Tuple([Schema.Finite, Schema.Finite]))),\n nesting: Schema.optionalKey(Schema.Finite),\n tag: Schema.optionalKey(Schema.String),\n type: Schema.optionalKey(Schema.String),\n})\n\nconst WRAPPER_TAGS = new Set(['blockquote', 'ol', 'pre', 'table', 'ul'])\n\nexport function sourceCapturePlugin(): ComarkPlugin {\n return {\n name: 'cms-source-capture',\n pre(state: ComarkParsePreState & SourceMapParseState) {\n state.__cmsOriginalMarkdown = state.markdown\n },\n }\n}\n\nexport function sourceMappingPlugin(): ComarkPlugin {\n return {\n name: 'cms-source-mapping',\n post(state: ComarkParsePostState & SourceMapParseState) {\n const source = state.__cmsOriginalMarkdown ?? state.markdown\n\n const descriptors = createBlockDescriptors(\n state.tokens.flatMap((token) => {\n const decoded = Schema.decodeUnknownOption(ComarkToken)(token)\n\n return Option.isSome(decoded) ? [decoded.value] : []\n }),\n source,\n state.markdown,\n state.parsedLines ?? 0,\n )\n\n const mappings: DocumentSourceMapping[] = []\n mapNodes(state.tree.nodes, descriptors, [], mappings)\n state.tree.meta[SOURCE_MAPPINGS_META_KEY] = mappings\n },\n }\n}\n\nfunction createBlockDescriptors(\n tokens: ReadonlyArray<ComarkToken>,\n source: string,\n parsedMarkdown: string,\n parsedLines: number,\n): BlockDescriptor[] {\n const roots: BlockDescriptor[] = []\n const stack: Array<{ descriptor: BlockDescriptor; level: number }> = []\n const sourceLineStarts = indexLineStarts(source)\n const parsedLineStarts = indexLineStarts(parsedMarkdown)\n const parsedOffset = source.lastIndexOf(parsedMarkdown)\n const slotMaps = createSlotTokenMaps(tokens, parsedMarkdown)\n\n for (let tokenIndex = 0; tokenIndex < tokens.length; tokenIndex++) {\n const token = tokens[tokenIndex]\n\n if (!token) continue\n const tag = blockTag(token)\n const tokenMap = token.map ?? slotMaps.get(tokenIndex)\n\n if (!tag || !tokenMap) continue\n\n const level = token.level ?? 0\n\n while (true) {\n const current = stack.at(-1)\n\n if (!current || current.level < level) break\n stack.pop()\n }\n\n const descriptor: BlockDescriptor = {\n children: [],\n range: rangeFromParsedLines(\n source,\n sourceLineStarts,\n parsedMarkdown,\n parsedLineStarts,\n parsedOffset,\n tokenMap[0],\n tokenMap[1] + (token.type === 'mdc_block_open' ? 1 : 0),\n parsedLines,\n ),\n tag,\n }\n\n const parent = stack.at(-1)?.descriptor\n\n ;(parent?.children ?? roots).push(descriptor)\n\n if (token.nesting === 1) stack.push({ descriptor, level })\n }\n\n return roots.map(collapseComarkWrapper).map(groupProjectedSlotContent)\n}\n\nfunction blockTag(token: ComarkToken): string | undefined {\n if (token.hidden || !token.type) return undefined\n\n if (token.type === 'heading_open') return token.tag\n\n if (token.type === 'mdc_block_open' || (token.type === 'mdc_block_shorthand' && token.nesting !== -1))\n return token.tag || 'component'\n\n if (token.type === 'mdc_block_slot' && token.nesting === 1) return 'template'\n\n if (['fence', 'fenced_code_block', 'code_block'].includes(token.type)) return 'pre'\n\n if (token.type === 'math_block') return 'math'\n\n if (token.type === 'html_block') return '*'\n\n if (token.type === 'hr') return 'hr'\n\n return BLOCK_TAGS.get(token.type)\n}\n\nfunction createSlotTokenMaps(\n tokens: ReadonlyArray<ComarkToken>,\n parsedMarkdown: string,\n): Map<number, [number, number]> {\n const maps = new Map<number, [number, number]>()\n const markers = slotMarkers(parsedMarkdown)\n const stack: Array<{ index: number; marker: number }> = []\n let nextMarker = 0\n\n for (let index = 0; index < tokens.length; index++) {\n const token = tokens[index]\n\n if (!token || token.type !== 'mdc_block_slot') continue\n\n if (token.nesting === 1) {\n const name = token.attrs?.[0]?.[0]?.replace(/^#/u, '')\n let markerIndex = nextMarker\n\n while (markerIndex < markers.length && markers[markerIndex]?.name !== name) markerIndex++\n const marker = markers[markerIndex]\n\n if (marker) {\n stack.push({ index, marker: marker.line })\n nextMarker = markerIndex + 1\n }\n\n continue\n }\n\n if (token.nesting !== -1) continue\n const open = stack.pop()\n\n if (!open) continue\n let endLine = open.marker + 1\n\n for (let childIndex = open.index + 1; childIndex < index; childIndex++) {\n const child = tokens[childIndex]\n const map = child?.map ?? maps.get(childIndex)\n\n if (child && map) {\n endLine = Math.max(endLine, map[1] + (child.type === 'mdc_block_open' ? 1 : 0))\n }\n }\n\n maps.set(open.index, [open.marker, endLine])\n }\n\n return maps\n}\n\nfunction slotMarkers(source: string): Array<{ line: number; name: string }> {\n return source.split(/\\r?\\n/u).flatMap((line, index) => {\n const name = line.match(/^\\s*#([^\\s{]+)/u)?.[1]\n\n return name ? [{ line: index, name }] : []\n })\n}\n\nfunction collapseComarkWrapper(descriptor: BlockDescriptor): BlockDescriptor {\n const children = descriptor.children.map(collapseComarkWrapper)\n\n if (WRAPPER_TAGS.has(descriptor.tag) && children.length === 1 && children[0]?.tag === descriptor.tag) {\n return { ...descriptor, children: children[0].children }\n }\n\n return { ...descriptor, children }\n}\n\n/** Comark projects siblings after a named slot into that active slot. */\nfunction groupProjectedSlotContent(descriptor: BlockDescriptor): BlockDescriptor {\n const grouped: BlockDescriptor[] = []\n let activeSlot: BlockDescriptor | undefined\n\n for (const rawChild of descriptor.children) {\n const child = groupProjectedSlotContent(rawChild)\n\n if (child.tag === 'template') {\n activeSlot = child\n grouped.push(child)\n continue\n }\n\n if (!activeSlot) {\n grouped.push(child)\n continue\n }\n\n activeSlot.children.push(child)\n\n if (child.range.end.offset > activeSlot.range.end.offset) {\n activeSlot.range = { start: activeSlot.range.start, end: child.range.end }\n }\n }\n\n return { ...descriptor, children: grouped }\n}\n\nfunction mapNodes(\n nodes: ReadonlyArray<Node>,\n descriptors: ReadonlyArray<BlockDescriptor>,\n parentPath: ReadonlyArray<number>,\n mappings: DocumentSourceMapping[],\n): void {\n let descriptorIndex = 0\n\n for (let nodeIndex = 0; nodeIndex < nodes.length; nodeIndex++) {\n const node = nodes[nodeIndex]\n\n if (!node || !isElementNode(node)) continue\n\n let matchIndex = descriptorIndex\n\n while (\n matchIndex < descriptors.length &&\n descriptors[matchIndex]?.tag !== '*' &&\n descriptors[matchIndex]?.tag !== node[0]\n ) {\n matchIndex++\n }\n\n const descriptor = descriptors[matchIndex]\n\n if (!descriptor) continue\n\n descriptorIndex = matchIndex + 1\n const nodePath = [...parentPath, nodeIndex]\n mappings.push({ nodePath, range: descriptor.range })\n const [, , ...children] = node\n mapNodes(children, descriptor.children, nodePath, mappings)\n }\n}\n\nfunction isElementNode(node: Node): node is ElementNode {\n return Array.isArray(node) && Predicate.isString(node[0])\n}\n\nfunction indexLineStarts(source: string): number[] {\n const starts = [0]\n\n for (let offset = 0; offset < source.length; offset++) {\n if (source.charCodeAt(offset) === 10) starts.push(offset + 1)\n }\n\n return starts\n}\n\nfunction rangeFromParsedLines(\n source: string,\n sourceLineStarts: ReadonlyArray<number>,\n parsedMarkdown: string,\n parsedLineStarts: ReadonlyArray<number>,\n parsedOffset: number,\n startLine: number,\n endLine: number,\n fallbackLineOffset: number,\n): DocumentSourceRange {\n const startOffset =\n parsedOffset >= 0\n ? parsedOffset + (parsedLineStarts[startLine] ?? parsedMarkdown.length)\n : (sourceLineStarts[startLine + fallbackLineOffset] ?? source.length)\n\n const endOffset =\n parsedOffset >= 0\n ? parsedOffset + (parsedLineStarts[endLine] ?? parsedMarkdown.length)\n : (sourceLineStarts[endLine + fallbackLineOffset] ?? source.length)\n\n return {\n start: pointAt(source, sourceLineStarts, startOffset),\n end: pointAt(source, sourceLineStarts, Math.max(startOffset, endOffset)),\n }\n}\n\nfunction pointAt(source: string, lineStarts: ReadonlyArray<number>, rawOffset: number): DocumentSourcePoint {\n const offset = Math.min(Math.max(rawOffset, 0), source.length)\n let low = 0\n let high = lineStarts.length - 1\n\n while (low < high) {\n const middle = Math.ceil((low + high) / 2)\n\n if ((lineStarts[middle] ?? source.length) <= offset) low = middle\n else high = middle - 1\n }\n\n return {\n offset,\n line: low + 1,\n column: offset - (lineStarts[low] ?? 0) + 1,\n }\n}\n","import type { ComarkParseFn } from 'comark'\nimport { createMarkdownParser } from 'comark/parse'\nimport alert from 'comark/plugins/alert'\nimport attributes from 'comark/plugins/attributes'\nimport components from 'comark/plugins/components'\nimport frontmatter from 'comark/plugins/frontmatter'\nimport headings from 'comark/plugins/headings'\nimport security from 'comark/plugins/security'\nimport taskList from 'comark/plugins/task-list'\nimport toc from 'comark/plugins/toc'\nimport { sourceCapturePlugin, sourceMappingPlugin } from './source-mapping'\n\n/**\n * Changes when parsing, normalization, or projection semantics change. Stored\n * with compiled documents so migrations can identify stale derived content.\n */\nexport const DOCUMENT_ENGINE_FINGERPRINT =\n 'comark@0.6.2/frontmatter+alert+task-list+components+attributes+security+headings+toc+source-mapping/v1'\n\nexport function createDocumentParser(): ComarkParseFn {\n return createMarkdownParser({\n autoClose: false,\n registerDefaultPlugins: false,\n plugins: [\n sourceCapturePlugin(),\n frontmatter(),\n alert(),\n taskList(),\n components(),\n attributes(),\n // Security mutates the tree before metadata and source paths are derived.\n security(),\n headings(),\n toc({ depth: 5, searchDepth: 6 }),\n sourceMappingPlugin(),\n ],\n })\n}\n","import { Schema } from 'effect'\n\nexport class EditorDocumentInvalid extends Schema.TaggedError<EditorDocumentInvalid>()('EditorDocument.Invalid', {\n message: Schema.NonEmptyString,\n cause: Schema.Defect(),\n}) {}\n\nexport class EditorRenderFailed extends Schema.TaggedError<EditorRenderFailed>()('EditorDocument.RenderFailed', {\n cause: Schema.Defect(),\n}) {}\n","import { formStructureIssues } from './Forms'\nimport type { BlockAuthoring, BlockProp, BlockSlot } from '@internal/protocol/Authoring'\nimport type { Editor, JSONContent } from '@tiptap/core'\nimport type { CollectionBody, ComponentDefinition } from '@internal/protocol/Configuration'\nimport { Extension } from '@tiptap/core'\nimport { Plugin } from '@tiptap/pm/state'\nimport { ySyncPluginKey } from '@tiptap/y-tiptap'\nimport { CmsMarkdownDocument } from '@internal/protocol/Documents'\nimport { Effect, Predicate, Schema } from 'effect'\nimport { comarkToEditor } from './internal/comark/to-editor'\nimport { createCmsComarkRenderData } from './internal/comark/document-adapter'\nimport { createDocumentParser } from './internal/comark/grammar'\nimport { EditorDocumentInvalid } from './internal/editor/errors'\nimport { createEditorNodeId } from './internal/editor/identity'\n\nexport const parseAuthoringContent = Effect.fn('AuthoringSchema.parseContent')(function* (markdown: string) {\n const body = yield* Effect.tryPromise({\n try: () => createDocumentParser()(markdown),\n catch: (cause) => new EditorDocumentInvalid({ cause, message: 'Invalid initial Markdown content.' }),\n })\n\n const decoded = yield* Schema.decodeUnknownEffect(CmsMarkdownDocument)(body)\n\n return decoded.nodes\n})\n\nconst isJsonObject = Schema.is(Schema.JsonObject)\n\nexport function collectionComponents(\n components: ReadonlyArray<ComponentDefinition>,\n body: CollectionBody | undefined,\n): ReadonlyArray<ComponentDefinition> {\n if (!body) return components\n\n return components.filter(\n (component) =>\n body.blocks?.includes(component.name) ||\n (component.authoring.group !== undefined && body.groups?.includes(component.authoring.group)),\n )\n}\n\n/** Configuration errors belong to developers, before an installation adopts the catalog. */\nexport function validateCollectionBody(\n components: ReadonlyArray<ComponentDefinition>,\n body: CollectionBody | undefined,\n): ReadonlyArray<string> {\n return [\n ...components.flatMap((component) =>\n component.authoring.slots.flatMap((slot) => [\n ...(slot.blocks ?? [])\n .filter((name) => !components.some((candidate) => candidate.name === name))\n .map((name) => `Unknown block \"${name}\" in ${slot.label}.`),\n ...(slot.groups ?? [])\n .filter((group) => !components.some((candidate) => candidate.authoring.group === group))\n .map((group) => `Unknown block group \"${group}\" in ${slot.label}.`),\n ]),\n ),\n ...(body?.blocks ?? [])\n .filter((name) => !components.some((component) => component.name === name))\n .map((name) => `Unknown block \"${name}\".`),\n ...(body?.groups ?? [])\n .filter((group) => !components.some((component) => component.authoring.group === group))\n .map((group) => `Unknown block group \"${group}\".`),\n ]\n}\n\nfunction contentIssues(\n node: JSONContent,\n schemas: ReadonlyMap<string, AuthoringSchema>,\n allowed: ReadonlySet<string>,\n purpose: 'working' | 'publish',\n collectionAllowed: ReadonlySet<string> = allowed,\n): string[] {\n const issues: string[] = []\n\n if (node.type === 'cmsBlock') {\n const name = String(node.attrs?.tag).toLowerCase()\n const schema = schemas.get(name)\n\n if (!schema) issues.push('This block is unavailable. Ask your site developer to restore its definition.')\n else {\n if (!allowed.has(name)) issues.push(`${schema.definition.label} is not allowed in this content region.`)\n issues.push(...schema.validate(node, purpose))\n\n if (purpose === 'publish' && schema.definition.form)\n issues.push(...formStructureIssues(node.attrs?.props?.steps, schema.definition.form, name))\n }\n }\n\n if (node.type === 'cmsOpaque' || node.type === 'cmsInlineOpaque')\n issues.push('This content is unsupported. Ask your site developer to update it before publishing.')\n\n if (node.type === 'cmsBlock') {\n const schema = schemas.get(String(node.attrs?.tag).toLowerCase())\n\n for (const region of node.content ?? []) {\n const slot = schema?.definition.slots.find((candidate) => candidate.name === region.attrs?.name)\n\n const permitted =\n slot?.input === 'blocks'\n ? new Set(\n collectionComponents(\n [...schemas].map(([name, schema]) => ({ name, authoring: schema.definition })),\n slot.blocks === undefined && slot.groups === undefined ? undefined : slot,\n )\n .map((component) => component.name)\n .filter((name) => collectionAllowed.has(name)),\n )\n : collectionAllowed\n\n issues.push(...contentIssues(region, schemas, permitted, purpose, collectionAllowed))\n }\n\n return issues\n }\n\n return [\n ...issues,\n ...(node.content ?? []).flatMap((child) => contentIssues(child, schemas, allowed, purpose, collectionAllowed)),\n ]\n}\n\nexport function validateAuthoringDocument(\n body: CmsMarkdownDocument,\n components: ReadonlyMap<string, ComponentDefinition> | undefined,\n bodyPolicy?: CollectionBody,\n): ReadonlyArray<string> {\n return components ? createAuthoringDocumentValidator(components)(body, bodyPolicy) : []\n}\n\n/** Resolves a component catalog once so document compilation can reuse its authoring rules. */\nexport function createAuthoringDocumentValidator(components: ReadonlyMap<string, ComponentDefinition>) {\n const definitions = [...components.values()]\n\n const schemas = new Map(\n definitions.map((component) => [component.name, createAuthoringSchema(component.name, component.authoring)]),\n )\n\n return (body: CmsMarkdownDocument, bodyPolicy?: CollectionBody): ReadonlyArray<string> => {\n const allowed = new Set(collectionComponents(definitions, bodyPolicy).map((component) => component.name))\n\n return comarkToEditor(body.nodes, createCmsComarkRenderData(body)).flatMap((node) =>\n contentIssues(node, schemas, allowed, 'publish'),\n )\n }\n}\n\nexport interface AuthoringSchema {\n readonly definition: BlockAuthoring\n readonly createContent: () => JSONContent\n readonly createSlot: (name: string) => JSONContent\n readonly setProperty: (current: Schema.JsonObject, name: string, value: Schema.Json | undefined) => Schema.JsonObject\n readonly validate: (node: JSONContent, purpose: 'working' | 'publish') => ReadonlyArray<string>\n}\n\nexport function createAuthoringSchema(name: string, definition: BlockAuthoring): AuthoringSchema {\n const fields = new Map(definition.props.map((field) => [field.name, field]))\n const slots = new Map(definition.slots.map((slot) => [slot.name, slot]))\n\n if (fields.size !== definition.props.length || slots.size !== definition.slots.length) {\n throw new Error(`${definition.label}: authoring names must be unique.`)\n }\n\n const initialProps = {\n ...Object.fromEntries(\n definition.props.flatMap((field) => (field.defaultValue === undefined ? [] : [[field.name, field.defaultValue]])),\n ),\n ...definition.initialProps,\n }\n\n for (const field of definition.props) {\n if (field.defaultValue === undefined) continue\n const issue = propertyIssue(field, field.defaultValue, 'working')\n\n if (issue) throw new Error(`Invalid default for ${definition.label}: ${issue}`)\n }\n\n function createSlot(slotName: string): JSONContent {\n const slot = slots.get(slotName)\n\n if (!slot) throw new Error(`${definition.label}: unknown content region ${slotName}.`)\n const content = slot.initial ? comarkToEditor(slot.initial) : []\n\n return {\n type: 'cmsSlot',\n attrs: { cmsNodeId: createEditorNodeId(), name: slotName, implicit: slotName === 'default', props: {} },\n content: content.length ? content : [{ type: 'paragraph', attrs: { cmsNodeId: createEditorNodeId() } }],\n }\n }\n\n function createContent(): JSONContent {\n return {\n type: 'cmsBlock',\n attrs: { cmsNodeId: createEditorNodeId(), tag: name, props: structuredClone(initialProps) },\n content: definition.slots\n .filter((slot) => slot.required || slot.initial !== undefined)\n .map((slot) => createSlot(slot.name)),\n }\n }\n\n function validate(node: JSONContent, purpose: 'working' | 'publish'): ReadonlyArray<string> {\n const issues: string[] = []\n const attributes = node.attrs?.props\n const values = isJsonObject(attributes) ? attributes : {}\n\n for (const key of Object.keys(values))\n if (!fields.has(key)) issues.push(`${definition.label}: ${key} is not editable.`)\n\n for (const field of definition.props) {\n const value = values[field.name] ?? (values[field.name] === null ? null : field.defaultValue)\n const issue = propertyIssue(field, value, purpose)\n\n if (issue) issues.push(issue)\n }\n\n const used = new Set<string>()\n\n for (const region of node.content ?? []) {\n const key = String(region.attrs?.name ?? 'default')\n const slot = slots.get(key)\n\n if (!slot || region.type !== 'cmsSlot') {\n issues.push(`${definition.label}: unsupported content region ${key}.`)\n continue\n }\n\n if (used.has(key)) issues.push(`${slot.label} can only appear once.`)\n used.add(key)\n\n if (!validRegion(slot, region.content ?? []))\n issues.push(`${slot.label} contains unsupported formatting or blocks.`)\n }\n\n for (const slot of definition.slots)\n if (slot.required && !used.has(slot.name)) issues.push(`${slot.label} is required.`)\n\n return issues\n }\n\n const schema: AuthoringSchema = {\n definition,\n createContent,\n createSlot,\n validate,\n setProperty(current: Schema.JsonObject, key: string, value: Schema.Json | undefined) {\n const field = fields.get(key)\n\n if (!field) throw new Error(`${definition.label}: ${key} is not editable.`)\n const issue = propertyIssue(field, value, 'working')\n\n if (issue) throw new Error(issue)\n const next = Object.fromEntries(Object.entries(current))\n\n if (value === undefined) delete next[key]\n else next[key] = value\n\n return next\n },\n }\n\n const issues = validate(createContent(), 'publish')\n\n if (issues.length) throw new Error(`Invalid initial content for ${definition.label}: ${issues.join(' ')}`)\n\n return schema\n}\n\nexport function selectedAuthoringSlot(\n editor: Editor,\n components: ReadonlyArray<ComponentDefinition>,\n): BlockSlot | undefined {\n const position = editor.state.selection.$from\n\n for (let depth = position.depth; depth > 0; depth--) {\n const region = position.node(depth)\n\n if (region.type.name !== 'cmsSlot') continue\n const block = position.node(depth - 1)\n\n return components\n .find((component) => component.name === block.attrs.tag)\n ?.authoring.slots.find((slot) => slot.name === region.attrs.name)\n }\n\n return undefined\n}\n\n/** Applies authoring rules to local edits. Remote CRDT updates always converge; publication validates them. */\nexport function createAuthoringExtension(\n components: () => ReadonlyArray<ComponentDefinition>,\n body: () => CollectionBody | undefined = () => undefined,\n): Extension {\n let previousComponents: ReadonlyArray<ComponentDefinition> | undefined\n let schemas = new Map<string, ReturnType<typeof createAuthoringSchema>>()\n\n function refresh() {\n const current = components()\n\n if (current === previousComponents) return\n previousComponents = current\n schemas = new Map(\n current.map((component) => [component.name, createAuthoringSchema(component.name, component.authoring)]),\n )\n }\n\n function issues(content: JSONContent): string[] {\n const allowed = new Set(collectionComponents(components(), body()).map((component) => component.name))\n\n return contentIssues(content, schemas, allowed, 'working')\n }\n\n return Extension.create({\n name: 'cmsAuthoringPolicy',\n addProseMirrorPlugins() {\n return [\n new Plugin({\n filterTransaction(transaction, state) {\n if (!transaction.docChanged || transaction.getMeta(ySyncPluginKey)?.isChangeOrigin) return true\n refresh()\n const previous = issues(state.doc.toJSON())\n\n return issues(transaction.doc.toJSON()).every((issue) => {\n const index = previous.indexOf(issue)\n\n if (index < 0) return false\n previous.splice(index, 1)\n\n return true\n })\n },\n }),\n ]\n },\n })\n}\n\nfunction propertyIssue(\n field: BlockProp,\n value: Schema.Json | undefined,\n purpose: 'working' | 'publish',\n): string | undefined {\n if (value === undefined) return field.required && purpose === 'publish' ? `${field.label} is required.` : undefined\n\n if (value === null && field.nullable) return undefined\n\n let valid: boolean\n\n if (field.type === 'string') valid = Predicate.isString(value)\n else if (field.type === 'number') valid = Predicate.isNumber(value) && Number.isFinite(value)\n else if (field.type === 'boolean') valid = Predicate.isBoolean(value)\n else if (field.type === 'array') valid = Array.isArray(value)\n else valid = isJsonObject(value)\n\n if (!valid) return `${field.label} must be ${field.type}.`\n\n if (field.type === 'object' || field.type === 'array') {\n const entries = Array.isArray(value) ? value : [value]\n const ids = new Set<string>()\n\n for (const entry of entries) {\n if (!isJsonObject(entry)) return `${field.label} must contain objects.`\n\n if (field.type === 'array') {\n const id = entry.id\n\n if (!Predicate.isString(id) || !id || ids.has(id)) return `${field.label} items need unique identities.`\n ids.add(id)\n }\n\n for (const key of Object.keys(entry))\n if (!(field.type === 'array' && key === 'id') && !field.fields?.some((child) => child.name === key))\n return `${field.label} contains an unavailable field.`\n\n for (const child of field.fields ?? []) {\n const issue = propertyIssue(child, entry[child.name], purpose)\n\n if (issue) return `${field.label}: ${issue}`\n }\n }\n }\n\n if (purpose === 'publish' && field.required && value === '' && (field.input === 'image' || field.input === 'link'))\n return `${field.label} is required.`\n\n if (\n purpose === 'publish' &&\n Predicate.isString(value) &&\n value &&\n (field.input === 'image' || field.input === 'link') &&\n !validAuthoringUrl(value, field.input)\n )\n return `${field.label} needs a valid ${field.input === 'image' ? 'image URL' : 'link'}.`\n\n if (field.options.length && !field.options.some((option) => option.value === value))\n return `${field.label} must use one of its available choices.`\n\n return undefined\n}\n\nfunction validRegion(slot: BlockSlot, content: ReadonlyArray<JSONContent>): boolean {\n if (slot.input === 'blocks')\n return content.every((node) => node.type === 'cmsBlock' || (node.type === 'paragraph' && !node.content?.length))\n const types = new Set(['paragraph', 'text', 'hardBreak'])\n const marks = new Set<string>()\n\n if (slot.input === 'text' && content.length > 1) return false\n\n if (slot.input === 'rich-text')\n for (const feature of slot.features) {\n if (feature === 'bullet-list') {\n types.add('bulletList')\n types.add('listItem')\n } else marks.add(feature)\n }\n\n const valid = (node: JSONContent): boolean =>\n types.has(node.type ?? '') &&\n (node.marks ?? []).every((mark) => marks.has(mark.type)) &&\n (node.content ?? []).every(valid)\n\n return content.every(valid)\n}\n\n/** URL values remain ordinary Vue strings and use the document model's public paths. */\nexport function validAuthoringUrl(value: string, input: 'image' | 'link'): boolean {\n if (value.trim() !== value || value.includes('\\\\')) return false\n\n for (const character of value) if (character.charCodeAt(0) <= 32) return false\n\n if (value.startsWith('/') && !value.startsWith('//')) return true\n\n if (input === 'link' && value.startsWith('#')) return true\n\n try {\n const url = new URL(value)\n\n return ['https:', 'http:', ...(input === 'link' ? ['mailto:', 'tel:'] : [])].includes(url.protocol)\n } catch {\n return false\n }\n}\n\nexport function createAuthoringItem(fields: ReadonlyArray<BlockProp>, list = false): Schema.JsonObject {\n return {\n ...(list ? { id: createEditorNodeId() } : undefined),\n ...Object.fromEntries(\n fields.flatMap((field) =>\n field.required || field.defaultValue !== undefined\n ? [[field.name, field.defaultValue ?? defaultAuthoringValue(field)]]\n : [],\n ),\n ),\n }\n}\n\nfunction defaultAuthoringValue(field: BlockProp): Schema.Json {\n if (field.type === 'object') return createAuthoringItem(field.fields ?? [])\n\n if (field.type === 'array') return []\n\n if (field.type === 'number') return 0\n\n if (field.type === 'boolean') return false\n\n return field.options[0]?.value ?? ''\n}\n","import { Schema } from 'effect'\nimport { FormCapabilities } from './Forms'\nimport { MarkdownNode } from './internal/documents/models'\n\nexport interface BlockProp {\n readonly name: string\n readonly label: string\n readonly help?: string\n readonly type: 'string' | 'number' | 'boolean' | 'object' | 'array'\n readonly input: 'text' | 'textarea' | 'select' | 'number' | 'toggle' | 'image' | 'link' | 'object' | 'list'\n readonly required: boolean\n readonly nullable: boolean\n readonly defaultValue?: Schema.Json\n readonly options: ReadonlyArray<{ readonly value: string; readonly label: string }>\n readonly fields?: ReadonlyArray<BlockProp>\n}\n\nexport const BlockProp: Schema.Codec<BlockProp> = Schema.Struct({\n name: Schema.NonEmptyString,\n label: Schema.NonEmptyString,\n help: Schema.optionalKey(Schema.String),\n type: Schema.Literals(['string', 'number', 'boolean', 'object', 'array']),\n input: Schema.Literals(['text', 'textarea', 'select', 'number', 'toggle', 'image', 'link', 'object', 'list']),\n required: Schema.Boolean,\n nullable: Schema.Boolean,\n defaultValue: Schema.optionalKey(Schema.Json),\n fields: Schema.optionalKey(Schema.Array(Schema.suspend(() => BlockProp))),\n options: Schema.Array(Schema.Struct({ value: Schema.String, label: Schema.String })),\n})\n\nexport const BlockSlot = Schema.Struct({\n name: Schema.NonEmptyString,\n label: Schema.NonEmptyString,\n help: Schema.optionalKey(Schema.String),\n required: Schema.Boolean,\n input: Schema.Literals(['text', 'rich-text', 'blocks']),\n blocks: Schema.optionalKey(Schema.Array(Schema.NonEmptyString)),\n groups: Schema.optionalKey(Schema.Array(Schema.NonEmptyString)),\n features: Schema.Array(Schema.Literals(['bold', 'italic', 'link', 'bullet-list', 'code'])),\n initial: Schema.optionalKey(Schema.Array(MarkdownNode)),\n})\n\nexport interface BlockSlot extends Schema.Schema.Type<typeof BlockSlot> {}\n\nexport const BlockAuthoring = Schema.Struct({\n version: Schema.Literal(1),\n form: Schema.optionalKey(FormCapabilities),\n label: Schema.NonEmptyString,\n description: Schema.optionalKey(Schema.String),\n group: Schema.optionalKey(Schema.String),\n icon: Schema.optionalKey(Schema.String),\n props: Schema.Array(BlockProp),\n slots: Schema.Array(BlockSlot),\n initialProps: Schema.JsonObject,\n})\n\nexport interface BlockAuthoring extends Schema.Schema.Type<typeof BlockAuthoring> {}\n","import { Schema } from 'effect'\nimport { BlockAuthoring } from './Authoring'\nimport { AddressPattern, CollectionName, Locale, SourceDirectory } from './internal/configuration/scalars'\n\nexport { AddressPattern, CollectionName, Locale, SourceDirectory } from './internal/configuration/scalars'\n\nconst fieldPresentation = {\n path: Schema.NonEmptyString,\n label: Schema.NonEmptyString,\n description: Schema.optionalKey(Schema.String),\n defaultValue: Schema.optionalKey(Schema.Json),\n required: Schema.Boolean,\n}\n\nconst BooleanAuthoringField = Schema.Struct({\n type: Schema.tag('boolean'),\n ...fieldPresentation,\n input: Schema.Literal('toggle'),\n})\n\nconst DateAuthoringField = Schema.Struct({\n type: Schema.tag('date'),\n ...fieldPresentation,\n input: Schema.Literal('date'),\n})\n\nconst NumberAuthoringField = Schema.Struct({\n type: Schema.tag('number'),\n ...fieldPresentation,\n input: Schema.Literals(['number', 'select']),\n options: Schema.Array(Schema.Finite),\n})\n\nconst StringAuthoringField = Schema.Struct({\n type: Schema.tag('string'),\n ...fieldPresentation,\n input: Schema.Literals(['select', 'text', 'textarea']),\n options: Schema.Array(Schema.String),\n})\n\nconst StringArrayAuthoringField = Schema.Struct({\n type: Schema.tag('string[]'),\n ...fieldPresentation,\n input: Schema.Literal('multiselect'),\n options: Schema.Array(Schema.String),\n})\n\nexport const DocumentField = Schema.Union([\n BooleanAuthoringField,\n DateAuthoringField,\n NumberAuthoringField,\n StringArrayAuthoringField,\n StringAuthoringField,\n])\n\nexport type DocumentField = typeof DocumentField.Type\n\nexport const CollectionBody = Schema.Struct({\n blocks: Schema.optionalKey(Schema.Array(Schema.NonEmptyString)),\n groups: Schema.optionalKey(Schema.Array(Schema.NonEmptyString)),\n})\n\nexport interface CollectionBody extends Schema.Schema.Type<typeof CollectionBody> {}\n\nexport const CollectionDefinition = Schema.Struct({\n collection: CollectionName,\n body: Schema.optionalKey(CollectionBody),\n label: Schema.NonEmptyString,\n description: Schema.String,\n directory: SourceDirectory,\n addressPattern: AddressPattern,\n hierarchy: Schema.Boolean,\n canCreate: Schema.Boolean,\n authoringFields: Schema.Array(DocumentField),\n}).annotate({ identifier: 'CollectionDefinition' })\n\nexport interface CollectionDefinition extends Schema.Schema.Type<typeof CollectionDefinition> {}\n\nexport const LocaleConfiguration = Schema.Struct({\n locales: Schema.Array(Locale),\n defaultLocale: Locale,\n fallbackLocale: Schema.NullOr(Locale),\n prefixDefaultLocale: Schema.Boolean,\n}).annotate({ identifier: 'LocaleConfiguration' })\n\nexport interface LocaleConfiguration extends Schema.Schema.Type<typeof LocaleConfiguration> {}\n\nexport const DocumentConfiguration = Schema.Struct({\n types: Schema.Array(CollectionDefinition),\n locales: Schema.optionalKey(LocaleConfiguration),\n}).annotate({ identifier: 'DocumentConfiguration' })\n\nexport interface DocumentConfiguration extends Schema.Schema.Type<typeof DocumentConfiguration> {}\n\nexport const ComponentDefinition = Schema.Struct({\n authoring: BlockAuthoring,\n name: Schema.NonEmptyString,\n}).annotate({ identifier: 'ComponentDefinition' })\n\nexport interface ComponentDefinition extends Schema.Schema.Type<typeof ComponentDefinition> {}\n\nexport const AuthoringCatalog = Schema.Struct({\n revision: Schema.NonEmptyString,\n components: Schema.Array(ComponentDefinition),\n})\n\nexport interface AuthoringCatalog extends Schema.Schema.Type<typeof AuthoringCatalog> {}\n\nexport const MediaConfiguration = Schema.Struct({\n enabled: Schema.Boolean,\n maxUploadB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Aa,uBAAuB,OAAO,OAAO;CAChD,YAAY;CACZ,MAAM,OAAO,YAAY,cAAc;CACvC,OAAO,OAAO;CACd,aAAa,OAAO;CACpB,WAAW;CACX,gBAAgB;CAChB,WAAW,OAAO;CAClB,WAAW,OAAO;CAClB,iBAAiB,OAAO,MAAM,aAAa;AAC7C,CAAC,CAAC,CAAC,SAAS,EAAE,YAAY,uBAAuB,CAAC;AAIlD,MAAa,sBAAsB,OAAO,OAAO;CAC/C,SAAS,OAAO,MAAM,MAAM;CAC5B,eAAe;CACf,gBAAgB,OAAO,OAAO,MAAM;CACpC,qBAAqB,OAAO;AAC9B,CAAC,CAAC,CAAC,SAAS,EAAE,YAAY,sBAAsB,CAAC;AAIjD,MAAa,wBAAwB,OAAO,OAAO;CACjD,OAAO,OAAO,MAAM,oBAAoB;CACxC,SAAS,OAAO,YAAY,mBAAmB;AACjD,CAAC,CAAC,CAAC,SAAS,EAAE,YAAY,wBAAwB,CAAC;AAInD,MAAa,sBAAsB,OAAO,OAAO;CAC/C,WAAW;CACX,MAAM,OAAO;AACf,CAAC,CAAC,CAAC,SAAS,EAAE,YAAY,sBAAsB,CAAC;AAIjD,MAAa,mBAAmB,OAAO,OAAO;CAC5C,UAAU,OAAO;CACjB,YAAY,OAAO,MAAM,mBAAmB;AAC9C,CAAC;AAID,MAAa,qBAAqB,OAAO,OAAO;CAC9C,SAAS,OAAO;CAChB,gBAAgB,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC;AAC1D,CAAC"}
@@ -1,44 +1,2 @@
1
- import { CmsDocumentModelOptions } from "./DocumentModel.js";
2
- //#region src/Configuration.d.ts
3
- export interface CmsInitialDocument {
4
- readonly markdown: string;
5
- readonly published: boolean;
6
- readonly sourcePath: string;
7
- }
8
- export type CmsInitialDocumentProvider = () => PromiseLike<ReadonlyArray<CmsInitialDocument>> | ReadonlyArray<CmsInitialDocument>;
9
- export interface CmsCleanupOptions {
10
- readonly initialDelayMillis?: number;
11
- readonly intervalMillis?: number;
12
- }
13
- export interface CmsMediaStorageCredentials {
14
- readonly accessKeyId: string;
15
- readonly secretAccessKey: string;
16
- readonly sessionToken?: string;
17
- }
18
- export interface CmsMediaStorageOptions {
19
- readonly bucket: string;
20
- readonly credentials?: CmsMediaStorageCredentials;
21
- readonly endpoint?: string;
22
- readonly forcePathStyle?: boolean;
23
- readonly provisionBucket?: boolean;
24
- readonly region: string;
25
- }
26
- export interface CmsMediaOptions {
27
- readonly maxUploadBytes?: number;
28
- readonly publicBaseUrl: string;
29
- readonly storage: CmsMediaStorageOptions;
30
- }
31
- export interface CmsConfiguration {
32
- readonly baseUrl: string;
33
- readonly cleanup?: false | CmsCleanupOptions;
34
- readonly databaseUrl: string;
35
- readonly documents: CmsDocumentModelOptions;
36
- readonly initialSources?: CmsInitialDocumentProvider;
37
- readonly initializationToken: string;
38
- readonly media?: false | CmsMediaOptions;
39
- readonly secret: string;
40
- }
41
- /** Preserves full inference while checking the authored CMS configuration. */
42
- export declare function defineCmsConfig<const Configuration extends CmsConfiguration>(configuration: Configuration): Configuration;
43
- //#endregion
44
- //# sourceMappingURL=Configuration.d.ts.map
1
+ import { a as CmsMediaOptions, c as CmsSeoOptions, i as CmsInitialDocumentProvider, l as defineCmsConfig, n as CmsConfiguration, o as CmsMediaStorageCredentials, r as CmsInitialDocument, s as CmsMediaStorageOptions, t as CmsCleanupOptions } from "./Configuration-Br7tE9Qt.js";
2
+ export { CmsCleanupOptions, CmsConfiguration, CmsInitialDocument, CmsInitialDocumentProvider, CmsMediaOptions, CmsMediaStorageCredentials, CmsMediaStorageOptions, CmsSeoOptions, defineCmsConfig };
@@ -1,5 +1,4 @@
1
1
  //#region src/Configuration.ts
2
- /** Preserves full inference while checking the authored CMS configuration. */
3
2
  function defineCmsConfig(configuration) {
4
3
  return configuration;
5
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Configuration.js","names":[],"sources":["../../../src/Configuration.ts"],"sourcesContent":["import type { CmsDocumentModelOptions } from './DocumentModel'\n\nexport interface CmsInitialDocument {\n readonly markdown: string\n readonly published: boolean\n readonly sourcePath: string\n}\n\nexport type CmsInitialDocumentProvider = () =>\n | PromiseLike<ReadonlyArray<CmsInitialDocument>>\n | ReadonlyArray<CmsInitialDocument>\n\nexport interface CmsCleanupOptions {\n readonly initialDelayMillis?: number\n readonly intervalMillis?: number\n}\n\nexport interface CmsMediaStorageCredentials {\n readonly accessKeyId: string\n readonly secretAccessKey: string\n readonly sessionToken?: string\n}\n\nexport interface CmsMediaStorageOptions {\n readonly bucket: string\n readonly credentials?: CmsMediaStorageCredentials\n readonly endpoint?: string\n readonly forcePathStyle?: boolean\n readonly provisionBucket?: boolean\n readonly region: string\n}\n\nexport interface CmsMediaOptions {\n readonly maxUploadBytes?: number\n readonly publicBaseUrl: string\n readonly storage: CmsMediaStorageOptions\n}\n\nexport interface CmsConfiguration {\n readonly baseUrl: string\n readonly cleanup?: false | CmsCleanupOptions\n readonly databaseUrl: string\n readonly documents: CmsDocumentModelOptions\n readonly initialSources?: CmsInitialDocumentProvider\n readonly initializationToken: string\n readonly media?: false | CmsMediaOptions\n readonly secret: string\n}\n\n/** Preserves full inference while checking the authored CMS configuration. */\nexport function defineCmsConfig<const Configuration extends CmsConfiguration>(\n configuration: Configuration,\n): Configuration {\n return configuration\n}\n"],"mappings":";;AAkDA,SAAgB,gBACd,eACe;CACf,OAAO;AACT"}
1
+ {"version":3,"file":"Configuration.js","names":[],"sources":["../../../src/Configuration.ts"],"sourcesContent":["import type { CmsI18nOptions } from './I18n'\nimport type { FormCapabilities } from '@internal/protocol/Forms'\nimport type { FormSubmissionHandler } from '@internal/server/Forms'\nimport type { CmsDocumentModelOptions } from './DocumentModel'\nimport type { SeoConfiguration as SeoConfigurationSchema } from '@internal/protocol/Seo'\nimport type { Schema } from 'effect'\n\nexport type CmsSeoOptions = Schema.Codec.Encoded<typeof SeoConfigurationSchema>\n\nexport interface CmsInitialDocument {\n readonly markdown: string\n readonly published: boolean\n readonly sourcePath: string\n}\n\nexport type CmsInitialDocumentProvider = () =>\n | PromiseLike<ReadonlyArray<CmsInitialDocument>>\n | ReadonlyArray<CmsInitialDocument>\n\nexport interface CmsCleanupOptions {\n readonly initialDelayMillis?: number\n readonly intervalMillis?: number\n}\n\nexport interface CmsMediaStorageCredentials {\n readonly accessKeyId: string\n readonly secretAccessKey: string\n readonly sessionToken?: string\n}\n\nexport interface CmsMediaStorageOptions {\n readonly bucket: string\n readonly credentials?: CmsMediaStorageCredentials\n readonly endpoint?: string\n readonly forcePathStyle?: boolean\n readonly provisionBucket?: boolean\n readonly region: string\n}\n\nexport interface CmsMediaOptions {\n readonly maxUploadBytes?: number\n readonly publicBaseUrl: string\n readonly storage: CmsMediaStorageOptions\n}\n\nexport interface CmsConfiguration {\n readonly forms?: Readonly<\n Record<string, { readonly definition: FormCapabilities; readonly onSubmit: FormSubmissionHandler }>\n >\n readonly baseUrl: string\n readonly cleanup?: false | CmsCleanupOptions\n readonly databaseUrl: string\n readonly documents: CmsDocumentModelOptions\n readonly i18n?: CmsI18nOptions\n readonly initialSources?: CmsInitialDocumentProvider\n readonly initializationToken: string\n readonly media?: false | CmsMediaOptions\n readonly seo?: CmsSeoOptions\n readonly secret: string\n}\n\nexport function defineCmsConfig<const Configuration extends CmsConfiguration>(\n configuration: Configuration,\n): Configuration {\n return configuration\n}\n"],"mappings":";AA6DA,SAAgB,gBACd,eACe;CACf,OAAO;AACT"}