@lupinum/ginko-editor 0.1.0 → 0.18.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 (166) hide show
  1. package/CHANGELOG.md +7 -73
  2. package/LICENSE +1 -1
  3. package/README.md +15 -340
  4. package/dist/assets.d.ts +70 -0
  5. package/dist/assets.js +31 -0
  6. package/dist/core/component-props.d.ts +87 -0
  7. package/dist/core/component-props.js +134 -0
  8. package/dist/core/convert.d.ts +24 -0
  9. package/dist/core/convert.js +278 -0
  10. package/dist/core/editor.d.ts +60 -0
  11. package/dist/core/editor.js +85 -0
  12. package/dist/core/extensions.d.ts +38 -0
  13. package/dist/core/extensions.js +444 -0
  14. package/dist/core/file-images.d.ts +9 -0
  15. package/dist/core/file-images.js +54 -0
  16. package/dist/core/image-frame.d.ts +23 -0
  17. package/dist/core/image-frame.js +24 -0
  18. package/dist/core/index.d.ts +17 -0
  19. package/dist/core/index.js +17 -0
  20. package/dist/core/link-card.d.ts +20 -0
  21. package/dist/core/link-card.js +70 -0
  22. package/dist/core/link.d.ts +3 -0
  23. package/dist/core/link.js +8 -0
  24. package/dist/core/move.d.ts +11 -0
  25. package/dist/core/move.js +37 -0
  26. package/dist/core/paste-html.d.ts +6 -0
  27. package/dist/core/paste-html.js +384 -0
  28. package/dist/core/paste.d.ts +21 -0
  29. package/dist/core/paste.js +108 -0
  30. package/dist/core/problems.d.ts +31 -0
  31. package/dist/core/problems.js +54 -0
  32. package/dist/core/search.d.ts +47 -0
  33. package/dist/core/search.js +148 -0
  34. package/dist/core/slash.d.ts +93 -0
  35. package/dist/core/slash.js +215 -0
  36. package/dist/core/table.d.ts +34 -0
  37. package/dist/core/table.js +141 -0
  38. package/dist/core/uploads.d.ts +23 -0
  39. package/dist/core/uploads.js +71 -0
  40. package/dist/core/use-editor.d.ts +19 -0
  41. package/dist/core/use-editor.js +53 -0
  42. package/dist/index.d.ts +6 -15
  43. package/dist/index.js +6 -5668
  44. package/dist/issues.d.ts +49 -0
  45. package/dist/issues.js +9 -0
  46. package/dist/today.d.ts +6 -0
  47. package/dist/today.js +19 -0
  48. package/dist/useUpload.d.ts +48 -0
  49. package/dist/useUpload.js +59 -0
  50. package/dist/values.d.ts +14 -0
  51. package/dist/values.js +36 -0
  52. package/package.json +35 -95
  53. package/dist/GinkoEditor.vue.d.ts +0 -96
  54. package/dist/GinkoImagePicker.vue.d.ts +0 -36
  55. package/dist/agent/AGENTS.md +0 -13
  56. package/dist/agent/pages/docs/getting-started/collaboration.md +0 -435
  57. package/dist/agent/pages/docs/getting-started/component-coverage.md +0 -107
  58. package/dist/agent/pages/docs/getting-started/customize.md +0 -384
  59. package/dist/agent/pages/docs/getting-started/images.md +0 -188
  60. package/dist/agent/pages/docs/getting-started/in-place-editing.md +0 -110
  61. package/dist/agent/pages/docs/getting-started/layout-blocks.md +0 -148
  62. package/dist/agent/pages/docs/getting-started/runtime.md +0 -111
  63. package/dist/agent/pages/docs/getting-started.md +0 -128
  64. package/dist/authoring-D7MJezVG.js +0 -1780
  65. package/dist/authoring-D7MJezVG.js.map +0 -1
  66. package/dist/authoring.d.ts +0 -122
  67. package/dist/authoring.js +0 -2
  68. package/dist/collaboration.d.ts +0 -14
  69. package/dist/collaboration.js +0 -907
  70. package/dist/collaboration.js.map +0 -1
  71. package/dist/composables/useAssetRequests.d.ts +0 -44
  72. package/dist/composables/useCollaborationBinding.d.ts +0 -59
  73. package/dist/composables/useDevice.d.ts +0 -10
  74. package/dist/composables/useInsertMenu.d.ts +0 -67
  75. package/dist/composables/useMarkdownSync.d.ts +0 -96
  76. package/dist/composables/useStableAuthoringKit.d.ts +0 -16
  77. package/dist/documentConfig-Z6LdrWZj.js +0 -2360
  78. package/dist/documentConfig-Z6LdrWZj.js.map +0 -1
  79. package/dist/editorProps.d.ts +0 -124
  80. package/dist/index.js.map +0 -1
  81. package/dist/layout-kit.d.ts +0 -922
  82. package/dist/lib/collaboration/presence-record.d.ts +0 -18
  83. package/dist/lib/collaboration/presence.d.ts +0 -103
  84. package/dist/lib/collaboration/protocol.d.ts +0 -133
  85. package/dist/lib/collaboration/recovery.d.ts +0 -45
  86. package/dist/lib/collaboration/session.d.ts +0 -163
  87. package/dist/lib/collaboration/validation.d.ts +0 -42
  88. package/dist/lib/component-converters.d.ts +0 -119
  89. package/dist/lib/config/documentConfig.d.ts +0 -19
  90. package/dist/lib/config/editorConfig.d.ts +0 -38
  91. package/dist/lib/container-items.d.ts +0 -55
  92. package/dist/lib/conversionInvariants.d.ts +0 -3
  93. package/dist/lib/conversionLogger.d.ts +0 -10
  94. package/dist/lib/conversionPipeline.d.ts +0 -17
  95. package/dist/lib/conversionState.d.ts +0 -10
  96. package/dist/lib/conversionTypes.d.ts +0 -50
  97. package/dist/lib/editor-operations.d.ts +0 -39
  98. package/dist/lib/environment.d.ts +0 -6
  99. package/dist/lib/extensions/code-block.d.ts +0 -18
  100. package/dist/lib/extensions/component-boundary.d.ts +0 -9
  101. package/dist/lib/extensions/container-items.d.ts +0 -29
  102. package/dist/lib/extensions/element.d.ts +0 -19
  103. package/dist/lib/extensions/file.d.ts +0 -24
  104. package/dist/lib/extensions/heading.d.ts +0 -5
  105. package/dist/lib/extensions/image-upload.d.ts +0 -39
  106. package/dist/lib/extensions/image.d.ts +0 -39
  107. package/dist/lib/extensions/index.d.ts +0 -10
  108. package/dist/lib/extensions/inline-element.d.ts +0 -13
  109. package/dist/lib/extensions/markdown-clipboard.d.ts +0 -21
  110. package/dist/lib/extensions/profile.d.ts +0 -11
  111. package/dist/lib/extensions/slot.d.ts +0 -16
  112. package/dist/lib/extensions/span-style.d.ts +0 -15
  113. package/dist/lib/extensions/video.d.ts +0 -15
  114. package/dist/lib/image-properties.d.ts +0 -20
  115. package/dist/lib/input-rules.d.ts +0 -7
  116. package/dist/lib/markdown.d.ts +0 -11
  117. package/dist/lib/marks.d.ts +0 -7
  118. package/dist/lib/mdcToTiptap.d.ts +0 -20
  119. package/dist/lib/mdcTypes.d.ts +0 -20
  120. package/dist/lib/nodes.d.ts +0 -57
  121. package/dist/lib/nodeviews/block-actions.d.ts +0 -7
  122. package/dist/lib/nodeviews/code.d.ts +0 -4
  123. package/dist/lib/nodeviews/columns.d.ts +0 -17
  124. package/dist/lib/nodeviews/component.d.ts +0 -6
  125. package/dist/lib/nodeviews/icons.d.ts +0 -26
  126. package/dist/lib/nodeviews/image.d.ts +0 -9
  127. package/dist/lib/nodeviews/items.d.ts +0 -15
  128. package/dist/lib/nodeviews/lifecycle.d.ts +0 -45
  129. package/dist/lib/nodeviews/popover.d.ts +0 -15
  130. package/dist/lib/nodeviews/settings.d.ts +0 -11
  131. package/dist/lib/nodeviews/table-operations.d.ts +0 -50
  132. package/dist/lib/nodeviews/table.d.ts +0 -4
  133. package/dist/lib/profiles.d.ts +0 -62
  134. package/dist/lib/property-input.d.ts +0 -10
  135. package/dist/lib/property-step.d.ts +0 -77
  136. package/dist/lib/props.d.ts +0 -13
  137. package/dist/lib/stripStyleNodes.d.ts +0 -2
  138. package/dist/lib/tiptapToMdc.d.ts +0 -18
  139. package/dist/presence-record-CLdPZWKC.js +0 -291
  140. package/dist/presence-record-CLdPZWKC.js.map +0 -1
  141. package/dist/runtime.d.ts +0 -13
  142. package/dist/runtime.js +0 -3
  143. package/dist/style.css +0 -2
  144. package/dist/types.d.ts +0 -126
  145. package/dist/ui/GinkoActionButton.vue.d.ts +0 -8
  146. package/dist/ui/GinkoInsertMenu.vue.d.ts +0 -49
  147. package/dist/ui/GinkoKeyboardDock.vue.d.ts +0 -15
  148. package/dist/ui/GinkoNodePopover.vue.d.ts +0 -21
  149. package/dist/ui/GinkoRecipeIcon.vue.d.ts +0 -6
  150. package/dist/ui/GinkoSelectionToolbar.vue.d.ts +0 -10
  151. package/dist/ui/GinkoToolbar.vue.d.ts +0 -26
  152. package/dist/ui/GinkoToolbarIcon.vue.d.ts +0 -6
  153. package/dist/ui/block-shortcuts.d.ts +0 -6
  154. package/dist/ui/commands.d.ts +0 -78
  155. package/dist/ui/context.d.ts +0 -23
  156. package/dist/ui/editor-keyboard.d.ts +0 -15
  157. package/dist/ui/messages.d.ts +0 -214
  158. package/dist/ui/messages.de.d.ts +0 -6
  159. package/dist/ui/recipe-command.d.ts +0 -14
  160. package/dist/ui/recipe-search.d.ts +0 -47
  161. package/dist/ui/slash-command.d.ts +0 -17
  162. package/dist/ui/writingRecipes.d.ts +0 -13
  163. package/skills/ginko-editor/SKILL.md +0 -40
  164. package/skills/ginko-editor/agents/openai.yaml +0 -4
  165. package/skills/ginko-editor/references/in-place-editing.md +0 -50
  166. package/skills/ginko-editor/references/quickstart.md +0 -55
@@ -1 +0,0 @@
1
- {"version":3,"file":"authoring-D7MJezVG.js","names":[],"sources":["../src/layout-kit.ts","../src/authoring.ts"],"sourcesContent":["/**\n * The default layout kit. Its component vocabulary is the Ginko Docs component\n * policy, so a document written with this kit renders on a Ginko Docs site.\n *\n * This module has no Vue or browser dependencies.\n */\nimport type { PortableComponentPolicyV2 } from '@lupinum/ginko-content/cms-contract'\n\nimport type {\n AuthoringKitSource,\n AuthoringRecipe,\n ComponentAuthoringMetadata,\n ComponentImplementationMetadata,\n ComponentImplementationProp,\n} from './authoring'\n\ntype ComponentDefinition = PortableComponentPolicyV2['components'][string]\ntype ComponentProps = ComponentDefinition['props']\ntype ValueType = 'string' | 'number' | 'boolean' | 'json' | 'asset'\n\n// The policy helpers match the Ginko Docs policy source. Keep the output identical.\nconst valueTypes = (type: ValueType) =>\n type === 'json' ? (['string', 'number', 'boolean', 'json'] as const) : ([type] as const)\nconst optional = (type: ValueType) => ({ types: valueTypes(type), required: false, allowedValues: null })\nconst required = (type: ValueType) => ({ types: valueTypes(type), required: true, allowedValues: null })\nconst choice = <const Values extends readonly [string, ...string[]]>(...allowedValues: Values) => ({\n types: ['string'] as const,\n required: false,\n allowedValues: [...allowedValues],\n})\nconst block = (\n props: ComponentProps = {},\n slots: string[] = ['default'],\n media: ComponentDefinition['media'] = null,\n nesting: Pick<ComponentDefinition, 'allowedParents' | 'allowedChildren'> = {\n allowedParents: null,\n allowedChildren: null,\n },\n): ComponentDefinition => ({ kind: 'block', props, slots, media, ...nesting })\nconst inline = (props: ComponentProps = {}): ComponentDefinition => ({\n kind: 'inline',\n props,\n slots: ['default'],\n allowedParents: null,\n allowedChildren: null,\n media: null,\n})\n\nconst appearance = { appearance: optional('string') }\nconst notice = block({ title: optional('string'), icon: optional('string'), ...appearance })\n\n/** The Ginko Docs component policy (version 2). */\nexport const ginkoLayoutComponentPolicy = {\n components: {\n accordion: block({\n ...appearance,\n type: optional('string'),\n collapsible: optional('boolean'),\n defaultValue: optional('json'),\n }),\n 'accordion-item': block(\n {\n value: optional('string'),\n title: optional('string'),\n content: optional('string'),\n },\n ['default', 'title', 'content'],\n ),\n api: block({\n ...appearance,\n title: optional('string'),\n icon: optional('string'),\n method: optional('string'),\n path: optional('string'),\n groups: optional('json'),\n }),\n aside: block({ label: optional('string'), ...appearance }),\n card: block(\n {\n title: optional('string'),\n description: optional('string'),\n footer: optional('string'),\n to: optional('string'),\n target: optional('string'),\n icon: optional('string'),\n iconColor: optional('string'),\n img: optional('asset'),\n showLinkIcon: optional('boolean'),\n horizontal: optional('boolean'),\n ...appearance,\n },\n ['default', 'title', 'description', 'footer'],\n { sourceProp: 'img', altProp: null, titleProp: null, filenameProp: null },\n ),\n cards: block({ cols: optional('string'), ...appearance }),\n center: block({\n size: optional('string'),\n max: optional('string'),\n type: optional('string'),\n }),\n 'code-group': block(appearance),\n 'code-tree': block({\n ...appearance,\n defaultValue: optional('string'),\n expandAll: optional('boolean'),\n }),\n collapse: block(appearance),\n column: block({ size: choice('sm', 'md', 'lg') }, ['default'], null, {\n allowedParents: ['layout'],\n allowedChildren: null,\n }),\n dropcap: block({ lines: optional('json') }),\n error: notice,\n excerpt: block({ label: optional('string'), source: optional('string'), ...appearance }),\n figure: block(\n {\n ...appearance,\n src: required('asset'),\n alt: required('string'),\n caption: optional('string'),\n width: optional('json'),\n height: optional('json'),\n bleed: optional('string'),\n aspect: optional('string'),\n fit: optional('string'),\n zoom: optional('json'),\n },\n ['default'],\n { sourceProp: 'src', altProp: 'alt', titleProp: null, filenameProp: null },\n ),\n files: block({ active: optional('string'), annotations: optional('json'), ...appearance }),\n idea: notice,\n info: block({\n title: optional('string'),\n icon: optional('string'),\n appearance: choice('quiet', 'tint'),\n }),\n kbd: inline(),\n layout: block(\n { type: choice('default', 'card', 'border', 'border-dashed', 'outline', 'outline-dashed') },\n ['default'],\n null,\n { allowedParents: null, allowedChildren: ['column'] },\n ),\n note: notice,\n quiz: block({\n ...appearance,\n title: optional('string'),\n description: optional('string'),\n questionLabel: optional('string'),\n backLabel: optional('string'),\n nextLabel: optional('string'),\n resultsLabel: optional('string'),\n correctSummaryLabel: optional('string'),\n perfectLabel: optional('string'),\n retryPrompt: optional('string'),\n resetLabel: optional('string'),\n }),\n 'quiz-question': block({\n question: required('string'),\n type: optional('string'),\n explanation: optional('string'),\n options: required('json'),\n checkLabel: optional('string'),\n correctLabel: optional('string'),\n incorrectLabel: optional('string'),\n resetLabel: optional('string'),\n multipleChoiceLabel: optional('string'),\n }),\n 'read-more': block({ title: optional('string'), links: required('json'), ...appearance }, []),\n steps: block({ mode: optional('string'), ...appearance }),\n success: notice,\n tab: block({ icon: optional('string'), label: optional('string') }),\n tabs: block({ layout: optional('string'), padded: optional('boolean'), ...appearance }),\n timeline: block(appearance),\n 'timeline-item': block({\n date: optional('string'),\n label: optional('string'),\n title: optional('string'),\n icon: optional('string'),\n active: optional('boolean'),\n }),\n toc: block(\n {\n title: optional('string'),\n depth: optional('json'),\n open: optional('json'),\n },\n [],\n ),\n warning: notice,\n },\n version: 2,\n} satisfies PortableComponentPolicyV2\n\ntype LayoutTag = keyof typeof ginkoLayoutComponentPolicy.components\n\n/** The Ginko Docs Vue component that renders each tag. */\nexport const ginkoLayoutComponentNames = {\n accordion: 'MdcAccordion',\n 'accordion-item': 'MdcAccordionItem',\n api: 'MdcApi',\n aside: 'MdcAside',\n card: 'MdcCard',\n cards: 'MdcCards',\n center: 'MdcCenter',\n 'code-group': 'MdcCodeGroup',\n 'code-tree': 'MdcCodeTree',\n collapse: 'MdcCollapse',\n column: 'MdcColumn',\n dropcap: 'MdcDropcap',\n error: 'MdcError',\n excerpt: 'MdcExcerpt',\n figure: 'MdcFigure',\n files: 'MdcFiles',\n idea: 'MdcIdea',\n info: 'MdcInfo',\n kbd: 'MdcKbd',\n layout: 'MdcLayout',\n note: 'MdcNote',\n quiz: 'MdcQuiz',\n 'quiz-question': 'MdcQuizQuestion',\n 'read-more': 'MdcReadMore',\n steps: 'MdcSteps',\n success: 'MdcSuccess',\n tab: 'MdcTab',\n tabs: 'MdcTabs',\n timeline: 'MdcTimeline',\n 'timeline-item': 'MdcTimelineItem',\n toc: 'MdcInlineToc',\n warning: 'MdcWarning',\n} as const satisfies Record<LayoutTag, string>\n\ntype Prop = ComponentImplementationProp\nconst text: Prop = { required: false, types: ['string'] }\nconst flag: Prop = { required: false, types: ['boolean'] }\nconst quietOrTint: Prop = { required: false, types: ['string'], options: ['quiet', 'tint'] }\n/** An untyped Vue property (`unknown`) accepts every JSON value. */\nconst anyValue: Prop = { required: false, types: ['boolean', 'number', 'object', 'string'] }\nconst noticeProps = { title: text, icon: text, appearance: quietOrTint }\n\n/**\n * Runtime properties and slots of the Ginko Docs Vue components, for the\n * properties that the policy exposes. Components that read `useSlots()`\n * render their default slot although their template has no `<slot>`.\n */\nconst implementationProps: Record<LayoutTag, { props: Record<string, Prop>; slots: readonly string[] }> = {\n accordion: {\n props: {\n appearance: quietOrTint,\n type: { required: false, types: ['string'], default: 'single', options: ['single', 'multiple'] },\n collapsible: { required: false, types: ['boolean'], default: true },\n defaultValue: { required: false, types: ['string', 'object'] },\n },\n slots: ['default'],\n },\n 'accordion-item': {\n props: { value: text, title: text, content: text },\n slots: ['title', 'content', 'default'],\n },\n // MdcApi renders only its `groups` property. Default slot content is kept in\n // the document but the Docs renderer does not show it.\n api: {\n props: { appearance: quietOrTint, title: text, icon: text, method: text, path: text, groups: anyValue },\n slots: ['default'],\n },\n aside: { props: { label: text, appearance: quietOrTint }, slots: ['default'] },\n card: {\n props: {\n title: text,\n description: text,\n footer: text,\n to: text,\n target: text,\n icon: text,\n iconColor: {\n required: false,\n types: ['string'],\n options: ['muted', 'foreground', 'primary', 'info', 'success', 'warning', 'destructive'],\n },\n img: text,\n showLinkIcon: { required: false, types: ['boolean'], default: true },\n horizontal: { required: false, types: ['boolean'], default: false },\n appearance: quietOrTint,\n },\n slots: ['title', 'description', 'default', 'footer'],\n },\n cards: {\n props: {\n cols: { required: false, types: ['number', 'string'], default: 2, options: ['1', '2', '3'] },\n appearance: quietOrTint,\n },\n slots: ['default'],\n },\n center: {\n props: {\n size: { required: false, types: ['string', 'object'], default: 'md', options: ['sm', 'md', 'lg'] },\n max: { required: false, types: ['string'], options: ['sm', 'md', 'lg'] },\n type: {\n required: false,\n types: ['string', 'object'],\n default: 'default',\n options: ['default', 'card', 'border', 'border-dashed', 'outline', 'outline-dashed'],\n },\n },\n slots: ['default'],\n },\n 'code-group': { props: { appearance: quietOrTint }, slots: ['default'] },\n 'code-tree': {\n props: { appearance: quietOrTint, defaultValue: text, expandAll: flag },\n slots: ['default'],\n },\n collapse: { props: { appearance: quietOrTint }, slots: ['default'] },\n column: {\n props: { size: { required: false, types: ['string', 'object'], default: 'md', options: ['sm', 'md', 'lg'] } },\n slots: ['default'],\n },\n dropcap: { props: { lines: { required: false, types: ['number', 'string'], default: 2 } }, slots: ['default'] },\n error: { props: noticeProps, slots: ['default'] },\n excerpt: { props: { label: text, source: text, appearance: quietOrTint }, slots: ['default'] },\n figure: {\n props: {\n appearance: quietOrTint,\n src: text,\n alt: text,\n caption: text,\n width: { required: false, types: ['string', 'number'] },\n height: { required: false, types: ['string', 'number'] },\n bleed: { required: false, types: ['boolean', 'string'] },\n aspect: { required: false, types: ['string'], options: ['auto', 'video', 'wide', 'square', 'portrait'] },\n fit: { required: false, types: ['string'], options: ['cover', 'contain'] },\n zoom: { required: false, types: ['boolean', 'string'], default: 'auto' },\n },\n slots: ['default'],\n },\n files: { props: { active: text, annotations: { required: false, types: ['object'] }, appearance: quietOrTint }, slots: ['default'] },\n idea: { props: noticeProps, slots: ['default'] },\n info: { props: noticeProps, slots: ['default'] },\n kbd: { props: {}, slots: ['default'] },\n layout: {\n props: {\n type: {\n required: false,\n types: ['string', 'object'],\n default: 'default',\n options: ['default', 'card', 'border', 'border-dashed', 'outline', 'outline-dashed'],\n },\n },\n slots: ['default'],\n },\n note: { props: noticeProps, slots: ['default'] },\n quiz: {\n props: {\n appearance: quietOrTint,\n title: text,\n description: text,\n questionLabel: text,\n backLabel: text,\n nextLabel: text,\n resultsLabel: text,\n correctSummaryLabel: text,\n perfectLabel: text,\n retryPrompt: text,\n resetLabel: text,\n },\n slots: ['default'],\n },\n 'quiz-question': {\n props: {\n question: { required: true, types: ['string'] },\n type: { required: false, types: ['string'], default: 'single', options: ['single', 'multiple'] },\n explanation: text,\n options: { required: true, types: ['object'] },\n checkLabel: text,\n correctLabel: text,\n incorrectLabel: text,\n resetLabel: text,\n multipleChoiceLabel: text,\n },\n slots: ['default'],\n },\n 'read-more': { props: { title: text, links: anyValue, appearance: quietOrTint }, slots: [] },\n steps: {\n props: { mode: { required: false, types: ['string'], default: 'icons', options: ['icons', 'numbered'] }, appearance: quietOrTint },\n slots: ['default'],\n },\n success: { props: noticeProps, slots: ['default'] },\n tab: { props: { icon: text, label: text }, slots: ['default'] },\n tabs: {\n props: {\n layout: { required: false, types: ['string'], default: 'separate', options: ['separate', 'line'] },\n padded: { required: false, types: ['boolean'], default: true },\n appearance: quietOrTint,\n },\n slots: ['default'],\n },\n timeline: { props: { appearance: quietOrTint }, slots: ['default'] },\n 'timeline-item': {\n props: { date: text, label: text, title: text, icon: text, active: flag },\n slots: ['default'],\n },\n toc: {\n props: { title: text, depth: { required: false, types: ['number'] }, open: { required: false, types: ['boolean', 'string'] } },\n slots: [],\n },\n warning: { props: noticeProps, slots: ['default'] },\n}\n\nconst implementation = Object.fromEntries(\n (Object.keys(ginkoLayoutComponentNames) as LayoutTag[]).map(tag => [tag, {\n componentName: ginkoLayoutComponentNames[tag],\n ...implementationProps[tag],\n }]),\n) as Record<LayoutTag, ComponentImplementationMetadata>\n\nconst appearanceField = {\n control: 'text',\n label: 'Appearance',\n help: 'quiet or tint. Leave empty to use the site setting.',\n} as const\nconst iconField = { control: 'text', label: 'Icon', help: 'An icon name, for example lucide:rocket.' } as const\nconst content = { default: { label: 'Content' } }\n\nfunction callout(label: string, description: string, tone: 'neutral' | 'warning' | 'danger' | 'success' | 'idea') {\n return {\n label,\n description,\n canvas: { titleProp: 'title', switchGroup: 'callout', tone },\n props: { icon: iconField, title: { control: 'text', label: 'Title' }, appearance: appearanceField },\n slots: content,\n } as const\n}\n\nconst authoring: { [Tag in LayoutTag]: ComponentAuthoringMetadata } = {\n note: callout('Note', 'Useful context alongside the main text.', 'neutral'),\n warning: callout('Warning', 'A condition readers should check before continuing.', 'warning'),\n error: callout('Error', 'Explain a failure and how to recover.', 'danger'),\n success: callout('Success', 'Confirm an outcome or a completed step.', 'success'),\n idea: callout('Idea', 'A suggestion worth exploring.', 'idea'),\n info: {\n label: 'Information',\n description: 'Supporting information that readers should notice.',\n canvas: { titleProp: 'title', switchGroup: 'callout', tone: 'info' },\n props: {\n appearance: { control: 'select', label: 'Appearance' },\n icon: iconField,\n title: { control: 'text', label: 'Title' },\n },\n slots: content,\n },\n aside: {\n label: 'Aside',\n description: 'Additional context beside the main argument.',\n canvas: { titleProp: 'label' },\n props: { label: { control: 'text', label: 'Label' }, appearance: appearanceField },\n slots: content,\n },\n excerpt: {\n label: 'Excerpt',\n description: 'A quoted passage with a source.',\n canvas: { titleProp: 'label' },\n props: {\n label: { control: 'text', label: 'Label' },\n source: { control: 'text', label: 'Source' },\n appearance: appearanceField,\n },\n slots: { default: { label: 'Quotation' } },\n },\n layout: {\n label: 'Layout',\n description: 'A responsive row for related columns.',\n canvas: {\n columns: {\n childTag: 'column',\n sizeProp: 'size',\n presets: [\n { label: 'Small / Large', values: ['sm', 'lg'], ratio: 1 / 3 },\n { label: 'Medium / Medium', values: ['md', 'md'], ratio: 1 / 2 },\n { label: 'Large / Small', values: ['lg', 'sm'], ratio: 2 / 3 },\n ],\n },\n },\n props: { type: { control: 'select', label: 'Style' } },\n slots: { default: { label: 'Columns' } },\n },\n column: {\n label: 'Column',\n description: 'A responsive column inside a layout.',\n props: { size: { control: 'select', label: 'Width' } },\n slots: content,\n },\n tabs: {\n label: 'Tabs',\n description: 'Content that readers switch between.',\n canvas: {\n items: {\n childTag: 'tab',\n labelProp: 'label',\n presentation: 'tabs',\n addLabel: 'Add tab',\n template: '::tab{label=\"New tab\"}\\nWrite the tab content here.\\n::',\n },\n },\n props: {\n layout: { control: 'text', label: 'Layout', help: 'separate or line.' },\n padded: { control: 'toggle', label: 'Padded' },\n appearance: appearanceField,\n },\n slots: { default: { label: 'Tabs' } },\n },\n tab: {\n label: 'Tab',\n description: 'One tab inside tabs.',\n canvas: { titleProp: 'label' },\n props: { label: { control: 'text', label: 'Label' }, icon: iconField },\n slots: content,\n },\n accordion: {\n label: 'Accordion',\n description: 'Questions or sections that readers open one at a time.',\n canvas: {\n items: {\n childTag: 'accordion-item',\n labelProp: 'title',\n presentation: 'accordion',\n addLabel: 'Add item',\n template: '::accordion-item{title=\"New question\"}\\nWrite the answer here.\\n::',\n },\n },\n props: {\n type: { control: 'text', label: 'Type', help: 'single or multiple.' },\n collapsible: { control: 'toggle', label: 'Collapsible' },\n defaultValue: {\n control: 'json',\n label: 'Open items',\n help: 'An item value, or a JSON list of item values for the multiple type.',\n },\n appearance: appearanceField,\n },\n slots: { default: { label: 'Items' } },\n },\n 'accordion-item': {\n label: 'Accordion item',\n description: 'One item inside an accordion.',\n canvas: { titleProp: 'title' },\n props: {\n title: { control: 'text', label: 'Title' },\n value: { control: 'text', label: 'Value', help: 'A unique name for this item.' },\n },\n slots: {\n default: { label: 'Content' },\n title: { label: 'Title' },\n content: { label: 'Content' },\n },\n },\n steps: {\n label: 'Steps',\n description: 'A sequence of instructions. Each level-three heading starts a step.',\n canvas: {\n items: {\n childNode: 'heading',\n presentation: 'steps',\n addLabel: 'Add step',\n template: '### New step\\n\\nDescribe this step.',\n },\n },\n props: {\n mode: { control: 'text', label: 'Mode', help: 'icons or numbered.' },\n appearance: appearanceField,\n },\n slots: { default: { label: 'Steps' } },\n },\n cards: {\n label: 'Cards',\n description: 'A grid of linked cards.',\n canvas: {\n items: {\n childTag: 'card',\n labelProp: 'title',\n presentation: 'grid',\n columnsProp: 'cols',\n addLabel: 'Add card',\n template: '::card{title=\"New card\"}\\nDescribe this card.\\n::',\n },\n },\n props: {\n cols: { control: 'text', label: 'Columns', help: '1, 2, or 3.' },\n appearance: appearanceField,\n },\n slots: { default: { label: 'Cards' } },\n },\n card: {\n label: 'Card',\n description: 'A card with a title, text, and an optional link.',\n canvas: { titleProp: 'title' },\n props: {\n title: { control: 'text', label: 'Title' },\n description: { control: 'text', label: 'Description' },\n to: { control: 'text', label: 'Link' },\n target: { control: 'text', label: 'Link target' },\n footer: { control: 'text', label: 'Footer' },\n icon: iconField,\n iconColor: { control: 'text', label: 'Icon color' },\n img: { control: 'text', label: 'Image' },\n showLinkIcon: { control: 'toggle', label: 'Show link icon' },\n horizontal: { control: 'toggle', label: 'Horizontal' },\n appearance: appearanceField,\n },\n slots: {\n default: { label: 'Content' },\n title: { label: 'Title' },\n description: { label: 'Description' },\n footer: { label: 'Footer' },\n },\n },\n timeline: {\n label: 'Timeline',\n description: 'Events in time order.',\n canvas: {\n items: {\n childTag: 'timeline-item',\n labelProp: 'title',\n presentation: 'timeline',\n addLabel: 'Add event',\n template: '::timeline-item{title=\"New event\"}\\nDescribe the event.\\n::',\n },\n },\n props: { appearance: appearanceField },\n slots: { default: { label: 'Events' } },\n },\n 'timeline-item': {\n label: 'Timeline event',\n description: 'One event in a timeline.',\n canvas: { titleProp: 'title' },\n props: {\n title: { control: 'text', label: 'Title' },\n date: { control: 'text', label: 'Date' },\n label: { control: 'text', label: 'Label' },\n icon: iconField,\n active: { control: 'toggle', label: 'Current event' },\n },\n slots: content,\n },\n 'code-group': {\n label: 'Code group',\n description: 'Code examples that readers switch between.',\n canvas: {\n items: {\n childNode: 'codeBlock',\n presentation: 'tabs',\n addLabel: 'Add file',\n template: '```ts [example.ts]\\n// Write the code here.\\n```',\n },\n },\n props: { appearance: appearanceField },\n slots: { default: { label: 'Code blocks' } },\n },\n 'code-tree': {\n label: 'Code tree',\n description: 'Several files that readers browse in a file tree.',\n canvas: {\n items: {\n childNode: 'codeBlock',\n presentation: 'stack',\n addLabel: 'Add file',\n template: '```ts [src/example.ts]\\n// Write the code here.\\n```',\n },\n },\n props: {\n defaultValue: { control: 'text', label: 'Selected file', help: 'The file name to show first.' },\n expandAll: { control: 'toggle', label: 'Expand all folders' },\n appearance: appearanceField,\n },\n slots: { default: { label: 'Files' } },\n },\n collapse: {\n label: 'Collapse',\n description: 'Long content that readers expand.',\n props: { appearance: appearanceField },\n slots: content,\n },\n center: {\n label: 'Center',\n description: 'Content in a centered column.',\n props: {\n size: { control: 'text', label: 'Size', help: 'sm, md, or lg.' },\n max: { control: 'text', label: 'Maximum width', help: 'sm, md, or lg.' },\n type: { control: 'text', label: 'Style', help: 'default, card, border, border-dashed, outline, or outline-dashed.' },\n },\n slots: content,\n },\n figure: {\n label: 'Figure',\n description: 'An image with a caption.',\n props: {\n src: { control: 'text', label: 'Image' },\n alt: { control: 'text', label: 'Alternative text' },\n caption: { control: 'text', label: 'Caption' },\n aspect: { control: 'text', label: 'Aspect', help: 'auto, video, wide, square, or portrait.' },\n fit: { control: 'text', label: 'Fit', help: 'cover or contain.' },\n bleed: { control: 'text', label: 'Bleed', help: 'outside to use the full width.' },\n width: { control: 'json', label: 'Width', help: 'A number of pixels.' },\n height: { control: 'json', label: 'Height', help: 'A number of pixels.' },\n zoom: { control: 'json', label: 'Zoom', help: 'true, false, or \"auto\".' },\n appearance: appearanceField,\n },\n slots: { default: { label: 'Caption' } },\n },\n dropcap: {\n label: 'Drop cap',\n description: 'A large first letter.',\n props: { lines: { control: 'json', label: 'Lines', help: 'The height of the letter in lines.' } },\n slots: content,\n },\n kbd: {\n label: 'Keyboard key',\n description: 'A key or shortcut in a sentence.',\n slots: { default: { label: 'Key' } },\n },\n 'read-more': {\n label: 'Read more',\n description: 'Links to further reading.',\n props: {\n title: { control: 'text', label: 'Title' },\n links: {\n control: 'json',\n label: 'Links',\n help: 'A JSON list of links. Each link has title and to, and can have description and icon.',\n },\n appearance: appearanceField,\n },\n },\n toc: {\n label: 'Table of contents',\n description: 'A table of contents for this page.',\n props: {\n title: { control: 'text', label: 'Title' },\n depth: { control: 'json', label: 'Depth', help: 'The deepest heading level, for example 2.' },\n open: { control: 'json', label: 'Open', help: 'true to show the list open.' },\n },\n },\n quiz: {\n label: 'Quiz',\n description: 'Questions that readers answer to check what they learned.',\n canvas: {\n items: {\n childTag: 'quiz-question',\n labelProp: 'question',\n presentation: 'stack',\n addLabel: 'Add question',\n template:\n '::quiz-question\\n---\\nquestion: New question\\noptions:\\n - text: Correct answer\\n correct: true\\n'\n + ' - text: Wrong answer\\n correct: false\\n---\\nExplain the answer here.\\n::',\n },\n },\n props: {\n title: { control: 'text', label: 'Title' },\n description: { control: 'text', label: 'Description' },\n appearance: appearanceField,\n },\n slots: { default: { label: 'Questions' } },\n },\n 'quiz-question': {\n label: 'Quiz question',\n description: 'One question with answer choices.',\n canvas: { titleProp: 'question' },\n props: {\n question: { control: 'text', label: 'Question' },\n type: { control: 'text', label: 'Type', help: 'single or multiple.' },\n options: {\n control: 'json',\n label: 'Choices',\n help: 'A JSON list of at least two choices. Each choice has text and correct.',\n },\n explanation: { control: 'text', label: 'Explanation' },\n },\n slots: { default: { label: 'Explanation' } },\n },\n api: {\n label: 'API reference',\n description: 'Structured fields in a reference panel.',\n canvas: { titleProp: 'title' },\n props: {\n title: { control: 'text', label: 'Title' },\n icon: iconField,\n method: { control: 'text', label: 'Method' },\n path: { control: 'text', label: 'Path' },\n groups: {\n control: 'json',\n label: 'Groups',\n help: 'A JSON list of groups. Each group has label and entries.',\n },\n appearance: appearanceField,\n },\n slots: { default: { label: 'Content (not shown on Docs sites)' } },\n },\n files: {\n label: 'Files',\n description: 'A folder structure without file contents.',\n props: {\n active: { control: 'text', label: 'Highlighted path' },\n annotations: { control: 'json', label: 'Annotations', help: 'A JSON object from paths to labels.' },\n appearance: appearanceField,\n },\n slots: { default: { label: 'File list' } },\n },\n}\n\nconst recipes: readonly AuthoringRecipe[] = [\n {\n id: 'ginko.layout.note',\n label: 'Note',\n description: 'Useful context alongside the main text.',\n keywords: ['callout', 'notice'],\n group: 'callouts',\n icon: 'sticky-note',\n source: '::note{title=\"Keep in mind\"}\\nWrite the important context here.\\n::',\n },\n {\n id: 'ginko.layout.info',\n label: 'Information',\n description: 'Supporting information that readers should notice.',\n keywords: ['callout', 'info', 'tip'],\n group: 'callouts',\n icon: 'info',\n source: '::info{title=\"Good to know\"}\\nWrite the supporting information here.\\n::',\n },\n {\n id: 'ginko.layout.warning',\n label: 'Warning',\n description: 'A condition readers should check before continuing.',\n keywords: ['callout', 'caution', 'alert'],\n group: 'callouts',\n icon: 'triangle-alert',\n source: '::warning{title=\"Before you continue\"}\\nWrite the condition here.\\n::',\n },\n {\n id: 'ginko.layout.error',\n label: 'Error',\n description: 'Explain a failure and how to recover.',\n keywords: ['callout', 'danger', 'failure'],\n group: 'callouts',\n icon: 'circle-x',\n source: '::error{title=\"Something needs attention\"}\\nExplain the failure and the recovery here.\\n::',\n },\n {\n id: 'ginko.layout.success',\n label: 'Success',\n description: 'Confirm an outcome or a completed step.',\n keywords: ['callout', 'done', 'check'],\n group: 'callouts',\n icon: 'circle-check',\n source: '::success{title=\"You are ready\"}\\nWrite the outcome here.\\n::',\n },\n {\n id: 'ginko.layout.idea',\n label: 'Idea',\n description: 'A suggestion worth exploring.',\n keywords: ['callout', 'tip', 'suggestion'],\n group: 'callouts',\n icon: 'lightbulb',\n source: '::idea{title=\"Try this\"}\\nWrite the suggestion here.\\n::',\n },\n {\n id: 'ginko.layout.aside',\n label: 'Aside',\n description: 'Add context without interrupting the main text.',\n keywords: ['sidebar', 'context'],\n group: 'callouts',\n icon: 'message-square-quote',\n source: '::aside{label=\"A little context\"}\\nAdd a useful detail here.\\n::',\n },\n {\n id: 'ginko.layout.excerpt',\n label: 'Excerpt',\n description: 'Quote a passage and name its source.',\n keywords: ['quotation', 'citation'],\n group: 'text',\n icon: 'text-quote',\n source: '::excerpt{label=\"In their words\" source=\"Source\"}\\nWrite the quoted passage here.\\n::',\n },\n {\n id: 'ginko.layout.dropcap',\n label: 'Drop cap',\n description: 'Start a passage with a large first letter.',\n keywords: ['initial', 'letter'],\n group: 'text',\n icon: 'case-upper',\n source: '::dropcap\\nWrite the first paragraph of the story here.\\n::',\n },\n {\n id: 'ginko.layout.kbd',\n label: 'Keyboard key',\n description: 'Show a key or a shortcut in a sentence.',\n keywords: ['kbd', 'shortcut', 'key'],\n group: 'text',\n icon: 'keyboard',\n source: 'Press :kbd[Ctrl] + :kbd[K] to search.',\n },\n {\n id: 'ginko.layout.two-columns',\n label: 'Two columns',\n description: 'Put related content side by side.',\n keywords: ['layout', 'columns', 'side by side'],\n group: 'layout',\n icon: 'columns-2',\n source:\n '::layout{type=\"border\"}\\n:::column{size=\"sm\"}\\nFirst column.\\n:::\\n\\n:::column{size=\"lg\"}\\nSecond column.\\n:::\\n::',\n },\n {\n id: 'ginko.layout.tabs',\n label: 'Tabs',\n description: 'Content that readers switch between.',\n keywords: ['tab', 'switch'],\n group: 'layout',\n icon: 'panel-top',\n source:\n '::tabs\\n:::tab{label=\"First tab\"}\\nWrite the first tab here.\\n:::\\n\\n'\n + ':::tab{label=\"Second tab\"}\\nWrite the second tab here.\\n:::\\n::',\n },\n {\n id: 'ginko.layout.accordion',\n label: 'Accordion',\n description: 'Questions or sections that readers open one at a time.',\n keywords: ['faq', 'collapsible', 'disclosure'],\n group: 'layout',\n icon: 'list-collapse',\n source:\n '::accordion\\n:::accordion-item{title=\"First question\"}\\nWrite the first answer here.\\n:::\\n\\n'\n + ':::accordion-item{title=\"Second question\"}\\nWrite the second answer here.\\n:::\\n::',\n },\n {\n id: 'ginko.layout.steps',\n label: 'Steps',\n description: 'A sequence of instructions.',\n keywords: ['procedure', 'how to', 'sequence'],\n group: 'layout',\n icon: 'list-checks',\n source:\n '::steps\\n### Prepare\\n\\nDescribe the first step.\\n\\n### Do the work\\n\\nDescribe the second step.\\n\\n'\n + '### Check the result\\n\\nDescribe the last step.\\n::',\n },\n {\n id: 'ginko.layout.cards',\n label: 'Cards',\n description: 'A grid of linked cards.',\n keywords: ['grid', 'card', 'links'],\n group: 'layout',\n icon: 'layout-grid',\n source:\n '::cards{cols=\"2\"}\\n:::card{title=\"First card\"}\\nDescribe the first card.\\n:::\\n\\n'\n + ':::card{title=\"Second card\"}\\nDescribe the second card.\\n:::\\n::',\n },\n {\n id: 'ginko.layout.timeline',\n label: 'Timeline',\n description: 'Events in time order.',\n keywords: ['history', 'events', 'changelog'],\n group: 'layout',\n icon: 'milestone',\n source:\n '::timeline\\n:::timeline-item{date=\"Start\" title=\"First event\"}\\nDescribe the first event.\\n:::\\n\\n'\n + ':::timeline-item{date=\"Next\" title=\"Second event\"}\\nDescribe the second event.\\n:::\\n::',\n },\n {\n id: 'ginko.layout.collapse',\n label: 'Collapse',\n description: 'Long content that readers expand.',\n keywords: ['expand', 'more', 'fold'],\n group: 'layout',\n icon: 'chevrons-down-up',\n source: '::collapse\\nWrite the long content here.\\n::',\n },\n {\n id: 'ginko.layout.center',\n label: 'Center',\n description: 'Content in a centered column.',\n keywords: ['centered', 'narrow'],\n group: 'layout',\n icon: 'align-center',\n source: '::center{size=\"md\"}\\nWrite the centered content here.\\n::',\n },\n {\n id: 'ginko.layout.figure',\n label: 'Figure',\n description: 'An image with a caption. Set the image in the block settings.',\n keywords: ['image', 'photo', 'caption'],\n group: 'media',\n icon: 'frame',\n source: '::figure{src=\"/images/example.jpg\" alt=\"Describe the image\" caption=\"Write the caption here.\"}\\n::',\n },\n {\n id: 'ginko.layout.code-group',\n label: 'Code group',\n description: 'Code examples that readers switch between.',\n keywords: ['code', 'tabs', 'snippets'],\n group: 'advanced',\n icon: 'files',\n source:\n '::code-group\\n```ts [example.ts]\\nexport const answer = 42\\n```\\n\\n'\n + '```js [example.js]\\nexport const answer = 42\\n```\\n::',\n },\n {\n id: 'ginko.layout.code-tree',\n label: 'Code tree',\n description: 'Several files that readers browse in a file tree.',\n keywords: ['files', 'code', 'project'],\n group: 'advanced',\n icon: 'folder-code',\n source:\n '::code-tree\\n```ts [src/index.ts]\\nexport const answer = 42\\n```\\n\\n'\n + '```json [package.json]\\n{ \"name\": \"example\" }\\n```\\n::',\n },\n {\n id: 'ginko.layout.files',\n label: 'Files',\n description: 'Show a folder structure.',\n keywords: ['folders', 'tree', 'directory'],\n group: 'advanced',\n icon: 'folder-tree',\n source: '::files\\n- `content`\\n - `index.md`\\n- `public`\\n - `logo.svg`\\n::',\n },\n {\n id: 'ginko.layout.read-more',\n label: 'Read more',\n description: 'Link to further reading.',\n keywords: ['links', 'related', 'see also'],\n group: 'advanced',\n icon: 'book-open',\n source: '::read-more{title=\"Read more\"}\\n---\\nlinks:\\n - title: Getting started\\n to: /\\n---\\n::',\n },\n {\n id: 'ginko.layout.toc',\n label: 'Table of contents',\n description: 'List the headings of this page.',\n keywords: ['toc', 'contents', 'outline'],\n group: 'advanced',\n icon: 'list-tree',\n source: '::toc{title=\"On this page\"}\\n::',\n },\n {\n id: 'ginko.layout.quiz',\n label: 'Quiz',\n description: 'Let readers check what they learned.',\n keywords: ['question', 'test', 'check'],\n group: 'advanced',\n icon: 'circle-help',\n source:\n '::quiz{title=\"Check your understanding\"}\\n:::quiz-question\\n---\\nquestion: Which answer is correct?\\n'\n + 'options:\\n - text: This answer\\n correct: true\\n - text: That answer\\n correct: false\\n---\\n'\n + 'Explain the answer here.\\n:::\\n::',\n },\n {\n id: 'ginko.layout.api',\n label: 'API reference',\n description: 'Describe structured fields in a reference panel.',\n keywords: ['api', 'fields', 'reference', 'props'],\n group: 'advanced',\n icon: 'braces',\n source:\n '::api{title=\"Fields\"}\\n---\\ngroups:\\n - label: Fields\\n entries:\\n - name: title\\n'\n + ' annotation: string\\n required: true\\n description: The page title.\\n---\\n::',\n },\n]\n\n/**\n * The built-in layout kit source. Compose it with other kits through\n * `composeAuthoringKits`, or create it alone with `createGinkoLayoutKit`.\n */\nexport const ginkoLayoutKitSource = {\n version: 1,\n policy: ginkoLayoutComponentPolicy,\n implementation,\n authoring,\n recipes,\n} satisfies AuthoringKitSource\n","import {\n assertPortableComponentPolicyV2,\n parseMdcBody,\n validatePublicMarkdownAst,\n validateStoredPortableMarkdownAst,\n type ParseMdcBodyResult,\n type PortableComponentPolicyV2,\n} from '@lupinum/ginko-content/cms-contract'\n\nimport { ginkoLayoutKitSource } from './layout-kit'\nimport type { JsonValue } from './types'\n\nexport { ginkoLayoutKitSource, ginkoLayoutComponentNames, ginkoLayoutComponentPolicy } from './layout-kit'\n\nexport type AuthoringControl = 'json' | 'number' | 'select' | 'text' | 'toggle'\nexport type ImplementationPropType = 'boolean' | 'complex' | 'number' | 'object' | 'string'\n\nexport interface ComponentImplementationProp {\n default?: JsonValue\n options?: readonly (boolean | number | string)[]\n required: boolean\n types: readonly ImplementationPropType[]\n}\n\nexport interface ComponentImplementationMetadata {\n componentName: string\n props: Readonly<Record<string, ComponentImplementationProp>>\n slots: readonly string[]\n}\n\nexport interface ComponentAuthoringField {\n control: AuthoringControl\n help?: string\n label: string\n}\n\ntype ComponentPolicy = PortableComponentPolicyV2['components'][string]\n\n/** How the canvas shows the repeated children of a container component. */\nexport type ComponentItemsPresentation = 'accordion' | 'grid' | 'stack' | 'steps' | 'tabs' | 'timeline'\n\n/**\n * Repeated children of a container component. Set exactly one of `childTag`\n * or `childNode`. The canvas adds, removes, renames, and selects items with\n * normal document steps. The selected tab and collapsed items are view state.\n */\nexport interface ComponentCanvasItems {\n /** Each item is a component with this tag. */\n childTag?: string\n /**\n * Each item is a built-in node. `codeBlock` items are code blocks.\n * `heading` items start at a heading with the template's heading level.\n */\n childNode?: 'codeBlock' | 'heading'\n presentation: ComponentItemsPresentation\n /** A text property of the child component that names each item. */\n labelProp?: string\n /** A property of this component that sets the number of grid columns. */\n columnsProp?: string\n /** The label of the add control, for example \"Add tab\". */\n addLabel?: string\n /** MDC source for one new item. */\n template: string\n}\n\nexport type ComponentAuthoringMetadata<\n Definition extends ComponentPolicy = ComponentPolicy,\n> = {\n /** Canvas interactions reference the same properties as the content policy. */\n canvas?: {\n switchGroup?: string\n tone?: 'neutral' | 'info' | 'warning' | 'danger' | 'success' | 'idea'\n titleProp?: keyof Definition['props'] & string\n columns?: {\n childTag: string\n sizeProp: string\n presets: readonly { label: string; values: readonly [string, string]; ratio: number }[]\n }\n items?: ComponentCanvasItems\n }\n description?: string\n label: string\n props?: Partial<Record<keyof Definition['props'] & string, ComponentAuthoringField>>\n slots?: Partial<Record<Definition['slots'][number], { label: string }>>\n}\n\nexport interface AuthoringRecipe {\n /** Short explanation shown while choosing a block. */\n description?: string\n /**\n * The menu group. Built-in groups are `text`, `lists`, `media`, `layout`,\n * `callouts`, and `advanced`. Other values show as their own group heading.\n */\n group?: string\n /** A Lucide icon name in kebab-case, for example `panel-top`. */\n icon?: string\n id: string\n keywords?: readonly string[]\n label: string\n source: string\n}\n\ntype ComponentMap = PortableComponentPolicyV2['components']\n\nexport type AuthoringKitSource<Components extends ComponentMap = ComponentMap> = {\n authoring: {\n [Tag in keyof Components]: ComponentAuthoringMetadata<Components[Tag]>\n }\n implementation: { [Tag in keyof Components]: ComponentImplementationMetadata }\n policy: { version: 2; components: Components }\n recipes: readonly AuthoringRecipe[]\n version: 1\n}\n\nexport type AuthoringKit<Components extends ComponentMap = ComponentMap> = Readonly<\n AuthoringKitSource<Components>\n>\n\n/** @deprecated Use `ComponentImplementationProp`. */\nexport type ComponentImplementationPropV1 = ComponentImplementationProp\n/** @deprecated Use `ComponentImplementationMetadata`. */\nexport type ComponentImplementationMetadataV1 = ComponentImplementationMetadata\n/** @deprecated Use `ComponentAuthoringField`. */\nexport type ComponentAuthoringFieldV1 = ComponentAuthoringField\n/** @deprecated Use `ComponentAuthoringMetadata`. */\nexport type ComponentAuthoringMetadataV1<\n Definition extends ComponentPolicy = ComponentPolicy,\n> = ComponentAuthoringMetadata<Definition>\n/** @deprecated Use `AuthoringRecipe`. */\nexport type AuthoringRecipeV1 = AuthoringRecipe\n/** @deprecated Use `AuthoringKitSource`. */\nexport type AuthoringKitSourceV1<Components extends ComponentMap = ComponentMap> = AuthoringKitSource<Components>\n/** @deprecated Use `AuthoringKit`. */\nexport type AuthoringKitV1<Components extends ComponentMap = ComponentMap> = AuthoringKit<Components>\n\nconst controlTypes: Record<AuthoringControl, readonly ImplementationPropType[]> = {\n json: ['boolean', 'number', 'object', 'string'],\n number: ['number'],\n select: ['boolean', 'number', 'string'],\n text: ['string'],\n toggle: ['boolean'],\n}\n\nfunction fail(message: string): never {\n throw new TypeError(`Invalid authoring kit: ${message}`)\n}\n\nfunction assertJsonValue(value: unknown, path: string, ancestors = new WeakSet<object>()): void {\n if (value === null || typeof value === 'boolean' || typeof value === 'string') return\n if (typeof value === 'number') {\n if (!Number.isFinite(value)) fail(`${path} must contain only finite numbers.`)\n return\n }\n if (Array.isArray(value)) {\n if (ancestors.has(value)) fail(`${path} must not contain a cycle.`)\n ancestors.add(value)\n value.forEach((item, index) => assertJsonValue(item, `${path}[${index}]`, ancestors))\n ancestors.delete(value)\n return\n }\n if (typeof value !== 'object') fail(`${path} must be JSON-safe.`)\n if (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) {\n fail(`${path} must contain only plain JSON objects.`)\n }\n if (ancestors.has(value)) fail(`${path} must not contain a cycle.`)\n ancestors.add(value)\n for (const [key, child] of Object.entries(value as Record<string, unknown>)) {\n if (child === undefined) fail(`${path}.${key} must not be undefined.`)\n assertJsonValue(child, `${path}.${key}`, ancestors)\n }\n ancestors.delete(value)\n}\n\nfunction assertUnique(values: readonly string[], path: string): void {\n const seen = new Set<string>()\n for (const value of values) {\n if (!value.trim()) fail(`${path} contains an empty value.`)\n if (seen.has(value)) fail(`${path} contains duplicate \"${value}\".`)\n seen.add(value)\n }\n}\n\nfunction expectedImplementationType(type: ComponentPolicy['props'][string]['types'][number]) {\n if (type === 'asset') return 'string'\n if (type === 'json') return 'object'\n return type\n}\n\nfunction expectedImplementationTypes(types: ComponentPolicy['props'][string]['types']) {\n return [...new Set(types.map(expectedImplementationType))]\n}\n\nfunction validateComponent(\n tag: string,\n policy: ComponentPolicy,\n implementation: ComponentImplementationMetadata,\n authoring: ComponentAuthoringMetadata,\n): void {\n if (!/^[a-z][a-z0-9-]*$/.test(tag)) fail(`component tag \"${tag}\" is not canonical kebab-case.`)\n if (!implementation.componentName.trim()) fail(`${tag}.implementation.componentName is empty.`)\n assertUnique(implementation.slots, `${tag}.implementation.slots`)\n assertUnique(policy.slots, `${tag}.policy.slots`)\n\n for (const [prop, definition] of Object.entries(policy.props)) {\n const implemented = implementation.props[prop]\n if (!implemented) fail(`${tag}.policy.props.${prop} is not implemented.`)\n const expected = expectedImplementationTypes(definition.types)\n if (implemented.types.length === 0) fail(`${tag}.implementation.props.${prop} has no type.`)\n if (implemented.types.every((type) => type === 'complex')) {\n fail(`${tag}.implementation.props.${prop} has an unsupported complex type.`)\n }\n // A policy `json` value is free-form data. The component must accept at\n // least one of its value types and normalize the others itself.\n const missing = definition.types.includes('json')\n ? expected.some(type => implemented.types.includes(type)) ? [] : expected\n : expected.filter(type => !implemented.types.includes(type))\n if (missing.length > 0) {\n fail(`${tag}.policy.props.${prop} expects ${missing.join(' | ')}, not ${implemented.types.join(' | ')}.`)\n }\n const implementationOptions = implemented.options\n if (definition.allowedValues && implementationOptions) {\n if (definition.allowedValues.some(value => !implementationOptions.includes(value))) {\n fail(`${tag}.implementation.props.${prop} does not implement every allowed policy value.`)\n }\n }\n }\n\n for (const [prop, implemented] of Object.entries(implementation.props)) {\n if (\n implemented.required &&\n implemented.default === undefined &&\n (!policy.props[prop] || !policy.props[prop].required)\n ) {\n fail(`${tag}.implementation.props.${prop} is required but optional or unavailable in policy.`)\n }\n }\n\n for (const slot of policy.slots) {\n if (!implementation.slots.includes(slot)) fail(`${tag}.policy slot \"${slot}\" is not implemented.`)\n }\n\n for (const [prop, field] of Object.entries(authoring.props ?? {})) {\n if (!field) continue\n if (!(prop in policy.props)) fail(`${tag}.authoring.props.${prop} is not allowed by policy.`)\n const implemented = implementation.props[prop]\n const policyTypes = expectedImplementationTypes(policy.props[prop].types)\n if (!implemented || !policyTypes.some(type => controlTypes[field.control].includes(type))) {\n fail(`${tag}.authoring.props.${prop} uses an incompatible ${field.control} control.`)\n }\n if (field.control === 'select' && !policy.props[prop].allowedValues?.length) {\n fail(`${tag}.authoring.props.${prop} requires policy allowedValues.`)\n }\n if (field.control === 'json' && !policy.props[prop].types.includes('json')) {\n fail(`${tag}.authoring.props.${prop} uses a json control without a policy json type.`)\n }\n }\n if (authoring.canvas?.switchGroup !== undefined && !authoring.canvas.switchGroup.trim()) {\n fail(`${tag}.canvas.switchGroup must not be empty.`)\n }\n if (\n authoring.canvas?.tone\n && !['neutral', 'info', 'warning', 'danger', 'success', 'idea'].includes(authoring.canvas.tone)\n ) {\n fail(`${tag}.canvas.tone is unsupported.`)\n }\n const titleProp = authoring.canvas?.titleProp\n if (\n titleProp\n && (!policy.props[titleProp]?.types.includes('string') || authoring.props?.[titleProp]?.control !== 'text')\n ) {\n fail(`${tag}.canvas.titleProp must reference an authored text property.`)\n }\n for (const slot of Object.keys(authoring.slots ?? {})) {\n if (!policy.slots.includes(slot)) fail(`${tag}.authoring slot \"${slot}\" is not allowed by policy.`)\n }\n}\n\nconst itemPresentations: readonly ComponentItemsPresentation[] = [\n 'accordion', 'grid', 'stack', 'steps', 'tabs', 'timeline',\n]\n\nfunction validateItems(tag: string, source: AuthoringKitSource) {\n const items = (source.authoring[tag] as ComponentAuthoringMetadata).canvas?.items\n if (!items) return\n const path = `${tag}.canvas.items`\n const parent = source.policy.components[tag]\n if (parent.kind !== 'block' || !parent.slots.includes('default')) {\n fail(`${path} requires a block component with a default slot.`)\n }\n if (!itemPresentations.includes(items.presentation)) fail(`${path}.presentation is unsupported.`)\n if ((items.childTag === undefined) === (items.childNode === undefined)) {\n fail(`${path} must set exactly one of childTag or childNode.`)\n }\n if (items.childNode !== undefined && !['codeBlock', 'heading'].includes(items.childNode)) {\n fail(`${path}.childNode is unsupported.`)\n }\n if (items.childTag !== undefined) {\n const child = source.policy.components[items.childTag]\n if (!child || child.kind !== 'block') fail(`${path}.childTag must reference a block component.`)\n if (\n (parent.allowedChildren && !parent.allowedChildren.includes(items.childTag))\n || (child.allowedParents && !child.allowedParents.includes(tag))\n ) {\n fail(`${path} must respect parent and child placement policy.`)\n }\n if (items.labelProp !== undefined && !child.props[items.labelProp]?.types.includes('string')) {\n fail(`${path}.labelProp must be a declared text property of \"${items.childTag}\".`)\n }\n } else if (items.labelProp !== undefined) {\n fail(`${path}.labelProp requires childTag.`)\n }\n if (items.columnsProp !== undefined) {\n const types = parent.props[items.columnsProp]?.types\n if (!types?.some(type => type === 'string' || type === 'number')) {\n fail(`${path}.columnsProp must be a declared text or number property of \"${tag}\".`)\n }\n }\n if (items.addLabel !== undefined && !items.addLabel.trim()) fail(`${path}.addLabel must not be empty.`)\n if (typeof items.template !== 'string' || !items.template.trim()) fail(`${path}.template must not be empty.`)\n}\n\ntype ParsedNode = { type?: string; tag?: string; props?: Record<string, unknown>; children?: ParsedNode[] }\n\nasync function validateItemTemplate(tag: string, items: ComponentCanvasItems, source: AuthoringKitSource) {\n const path = `${tag}.canvas.items.template`\n const { body } = await parseMdcBody(items.template, { autoClose: false })\n const nodes = ((body as ParsedNode).children ?? []).filter(node => node.type === 'element')\n const isNative = (node: ParsedNode) => (node.props?.$ as { html?: number } | undefined)?.html === 1\n const level = (node: ParsedNode | undefined) => /^h([1-6])$/.exec(node?.tag ?? '')?.[1]\n if (items.childTag !== undefined) {\n if (nodes.length !== 1 || nodes[0].tag !== items.childTag || isNative(nodes[0])) {\n fail(`${path} must contain exactly one \"${items.childTag}\" component.`)\n }\n } else if (items.childNode === 'codeBlock') {\n if (nodes.length !== 1 || nodes[0].tag !== 'pre') fail(`${path} must contain exactly one code block.`)\n } else {\n const first = Number(level(nodes[0]))\n if (!first || nodes.slice(1).some(node => Number(level(node) ?? 7) <= first)) {\n fail(`${path} must start with the only heading of its level.`)\n }\n }\n // Placement inside the container is checked above. Check the item content alone.\n const components = { ...source.policy.components }\n if (items.childTag) components[items.childTag] = { ...components[items.childTag], allowedParents: null }\n const validation = validatePublicMarkdownAst(body, { version: 2, components })\n if (!validation.ok) {\n const issue = validation.issues[0]\n fail(`${path} is outside policy (${issue.code} at ${issue.path.join('.')}).`)\n }\n}\n\nfunction freezeJson<T>(value: T): T {\n if (value && typeof value === 'object') {\n if (!Object.isFrozen(value)) Object.freeze(value)\n Object.values(value as Record<string, unknown>).forEach(freezeJson)\n }\n return value\n}\n\nexport async function createAuthoringKit<const Components extends ComponentMap>(\n source: AuthoringKitSource<Components>,\n): Promise<AuthoringKit<Components>> {\n assertJsonValue(source, 'source')\n if (source.version !== 1) fail('version must be 1.')\n try {\n assertPortableComponentPolicyV2(source.policy)\n } catch (error) {\n fail(`policy is invalid (${error instanceof Error ? error.message : 'unknown error'}).`)\n }\n\n const policyTags = Object.keys(source.policy.components)\n assertUnique(policyTags, 'policy.components')\n const implementationTags = Object.keys(source.implementation)\n const authoringTags = Object.keys(source.authoring)\n if (implementationTags.sort().join('\\0') !== [...policyTags].sort().join('\\0')) {\n fail('implementation tags must exactly match policy tags.')\n }\n if (authoringTags.sort().join('\\0') !== [...policyTags].sort().join('\\0')) {\n fail('authoring tags must exactly match policy tags.')\n }\n\n for (const tag of policyTags) {\n validateComponent(\n tag,\n source.policy.components[tag],\n source.implementation[tag],\n source.authoring[tag],\n )\n }\n\n for (const tag of policyTags) {\n const metadata: ComponentAuthoringMetadata = source.authoring[tag]\n const columns = metadata.canvas?.columns\n if (!columns) continue\n const child = source.policy.components[columns.childTag]\n const allowed = child?.props[columns.sizeProp]?.allowedValues\n if (\n source.policy.components[tag].kind !== 'block'\n || child?.kind !== 'block'\n || !allowed?.length\n || columns.presets.length < 2\n ) {\n fail(`${tag}.canvas.columns must reference a block child with discrete sizes and at least two presets.`)\n }\n const parent = source.policy.components[tag]\n if (\n (parent.allowedChildren && !parent.allowedChildren.includes(columns.childTag))\n || (child.allowedParents && !child.allowedParents.includes(tag))\n ) {\n fail(`${tag}.canvas.columns must respect parent and child placement policy.`)\n }\n let lastRatio = 0\n const pairs = new Set<string>()\n for (const preset of columns.presets) {\n if (\n !Number.isFinite(preset.ratio)\n || pairs.has(JSON.stringify(preset.values))\n || !preset.label.trim()\n || preset.values.length !== 2\n || preset.values.some(value => !allowed.includes(value))\n || preset.ratio <= lastRatio\n || preset.ratio >= 1\n ) {\n fail(`${tag}.canvas.columns presets must use allowed size pairs and increasing ratios between zero and one.`)\n }\n pairs.add(JSON.stringify(preset.values))\n lastRatio = preset.ratio\n }\n }\n\n for (const tag of policyTags) validateItems(tag, source)\n\n assertUnique(source.recipes.map(({ id }) => id), 'recipes')\n // Validation crosses an async parser boundary. Consume the input now so\n // callers cannot change the contract while its recipes are being checked.\n freezeJson(source)\n for (const tag of policyTags) {\n const items = (source.authoring[tag] as ComponentAuthoringMetadata).canvas?.items\n if (items) await validateItemTemplate(tag, items, source)\n }\n for (const recipe of source.recipes) {\n if (!recipe.label.trim()) fail(`recipe \"${recipe.id}\" has an empty label.`)\n if (recipe.keywords) assertUnique(recipe.keywords, `recipe \"${recipe.id}\".keywords`)\n if (recipe.group !== undefined && (!recipe.group.trim() || recipe.group.length > 40)) {\n fail(`recipe \"${recipe.id}\".group must be a short, non-empty name.`)\n }\n if (recipe.icon !== undefined && !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(recipe.icon)) {\n fail(`recipe \"${recipe.id}\".icon must be a kebab-case Lucide icon name.`)\n }\n await parsePublicRecipeSource(recipe.source, source, `recipe \"${recipe.id}\"`)\n }\n\n return freezeJson(source)\n}\n\nexport async function parseAuthoringSource(\n markdown: string,\n kit: AuthoringKitSource,\n label = 'source',\n): Promise<ParseMdcBodyResult['body']> {\n const { body } = await parseMdcBody(markdown, { autoClose: false })\n const validation = validateStoredPortableMarkdownAst(body, kit.policy)\n if (!validation.ok) {\n const issue = validation.issues[0]\n fail(`${label} is outside policy (${issue.code} at ${issue.path.join('.')}).`)\n }\n return body\n}\n\nasync function parsePublicRecipeSource(\n markdown: string,\n kit: AuthoringKitSource,\n label: string,\n): Promise<ParseMdcBodyResult['body']> {\n const { body } = await parseMdcBody(markdown, { autoClose: false })\n const validation = validatePublicMarkdownAst(body, kit.policy)\n if (!validation.ok) {\n const issue = validation.issues[0]\n fail(`${label} is outside policy (${issue.code} at ${issue.path.join('.')}).`)\n }\n return body\n}\n\nexport async function composeAuthoringKits(\n ...sources: readonly AuthoringKitSource[]\n): Promise<AuthoringKit> {\n const implementation: Record<string, ComponentImplementationMetadata> = {}\n const components: ComponentMap = {}\n const authoring: Record<string, ComponentAuthoringMetadata> = {}\n const recipes: AuthoringRecipe[] = []\n const recipeIds = new Set<string>()\n\n for (const source of sources) {\n for (const tag of Object.keys(source.policy.components)) {\n if (tag in components) fail(`component tag \"${tag}\" is registered more than once.`)\n components[tag] = source.policy.components[tag]\n implementation[tag] = source.implementation[tag]\n authoring[tag] = source.authoring[tag]\n }\n for (const recipe of source.recipes) {\n if (recipeIds.has(recipe.id)) fail(`recipe id \"${recipe.id}\" is registered more than once.`)\n recipeIds.add(recipe.id)\n recipes.push(recipe)\n }\n }\n\n return await createAuthoringKit({\n authoring,\n implementation,\n policy: { version: 2, components },\n recipes,\n version: 1,\n })\n}\n\n/** Create the built-in layout kit alone. Compose its source to add host components. */\nexport async function createGinkoLayoutKit(): Promise<AuthoringKit<typeof ginkoLayoutKitSource.policy.components>> {\n return await createAuthoringKit(ginkoLayoutKitSource)\n}\n"],"mappings":";;AAqBA,IAAM,KAAc,MAClB,MAAS,SAAU;CAAC;CAAU;CAAU;CAAW;AAAM,IAAe,CAAC,CAAI,GACzE,KAAY,OAAqB;CAAE,OAAO,EAAW,CAAI;CAAG,UAAU;CAAO,eAAe;AAAK,IACjG,KAAY,OAAqB;CAAE,OAAO,EAAW,CAAI;CAAG,UAAU;CAAM,eAAe;AAAK,IAChG,KAA+D,GAAG,OAA2B;CACjG,OAAO,CAAC,QAAQ;CAChB,UAAU;CACV,eAAe,CAAC,GAAG,CAAa;AAClC,IACM,KACJ,IAAwB,CAAC,GACzB,IAAkB,CAAC,SAAS,GAC5B,IAAsC,MACtC,IAA2E;CACzE,gBAAgB;CAChB,iBAAiB;AACnB,OACyB;CAAE,MAAM;CAAS;CAAO;CAAO;CAAO,GAAG;AAAQ,IACtE,KAAU,IAAwB,CAAC,OAA4B;CACnE,MAAM;CACN;CACA,OAAO,CAAC,SAAS;CACjB,gBAAgB;CAChB,iBAAiB;CACjB,OAAO;AACT,IAEM,IAAa,EAAE,YAAY,EAAS,QAAQ,EAAE,GAC9C,IAAS,EAAM;CAAE,OAAO,EAAS,QAAQ;CAAG,MAAM,EAAS,QAAQ;CAAG,GAAG;AAAW,CAAC,GAG9E,IAA6B;CACxC,YAAY;EACV,WAAW,EAAM;GACf,GAAG;GACH,MAAM,EAAS,QAAQ;GACvB,aAAa,EAAS,SAAS;GAC/B,cAAc,EAAS,MAAM;EAC/B,CAAC;EACD,kBAAkB,EAChB;GACE,OAAO,EAAS,QAAQ;GACxB,OAAO,EAAS,QAAQ;GACxB,SAAS,EAAS,QAAQ;EAC5B,GACA;GAAC;GAAW;GAAS;EAAS,CAChC;EACA,KAAK,EAAM;GACT,GAAG;GACH,OAAO,EAAS,QAAQ;GACxB,MAAM,EAAS,QAAQ;GACvB,QAAQ,EAAS,QAAQ;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,EAAI,MAAM;CAC7D,IAAI,CAAC,EAAW,IAAI;EAClB,IAAM,IAAQ,EAAW,OAAO;EAChC,EAAK,GAAG,EAAM,sBAAsB,EAAM,KAAK,MAAM,EAAM,KAAK,KAAK,GAAG,EAAE,GAAG;CAC/E;CACA,OAAO;AACT;AAEA,eAAsB,EACpB,GAAG,GACoB;CACvB,IAAM,IAAkE,CAAC,GACnE,IAA2B,CAAC,GAC5B,IAAwD,CAAC,GACzD,IAA6B,CAAC,GAC9B,oBAAY,IAAI,IAAY;CAElC,KAAK,IAAM,KAAU,GAAS;EAC5B,KAAK,IAAM,KAAO,OAAO,KAAK,EAAO,OAAO,UAAU,GAIpD,AAHI,KAAO,KAAY,EAAK,kBAAkB,EAAI,gCAAgC,GAClF,EAAW,KAAO,EAAO,OAAO,WAAW,IAC3C,EAAe,KAAO,EAAO,eAAe,IAC5C,EAAU,KAAO,EAAO,UAAU;EAEpC,KAAK,IAAM,KAAU,EAAO,SAG1B,AAFI,EAAU,IAAI,EAAO,EAAE,KAAG,EAAK,cAAc,EAAO,GAAG,gCAAgC,GAC3F,EAAU,IAAI,EAAO,EAAE,GACvB,EAAQ,KAAK,CAAM;CAEvB;CAEA,OAAO,MAAM,EAAmB;EAC9B;EACA;EACA,QAAQ;GAAE,SAAS;GAAG;EAAW;EACjC;EACA,SAAS;CACX,CAAC;AACH;AAGA,eAAsB,IAA6F;CACjH,OAAO,MAAM,EAAmB,CAAoB;AACtD"}
@@ -1,122 +0,0 @@
1
- import { type ParseMdcBodyResult, type PortableComponentPolicyV2 } from '@lupinum/ginko-content/cms-contract';
2
- import { ginkoLayoutKitSource } from './layout-kit.js';
3
- import type { JsonValue } from './types.js';
4
- export { ginkoLayoutKitSource, ginkoLayoutComponentNames, ginkoLayoutComponentPolicy } from './layout-kit.js';
5
- export type AuthoringControl = 'json' | 'number' | 'select' | 'text' | 'toggle';
6
- export type ImplementationPropType = 'boolean' | 'complex' | 'number' | 'object' | 'string';
7
- export interface ComponentImplementationProp {
8
- default?: JsonValue;
9
- options?: readonly (boolean | number | string)[];
10
- required: boolean;
11
- types: readonly ImplementationPropType[];
12
- }
13
- export interface ComponentImplementationMetadata {
14
- componentName: string;
15
- props: Readonly<Record<string, ComponentImplementationProp>>;
16
- slots: readonly string[];
17
- }
18
- export interface ComponentAuthoringField {
19
- control: AuthoringControl;
20
- help?: string;
21
- label: string;
22
- }
23
- type ComponentPolicy = PortableComponentPolicyV2['components'][string];
24
- /** How the canvas shows the repeated children of a container component. */
25
- export type ComponentItemsPresentation = 'accordion' | 'grid' | 'stack' | 'steps' | 'tabs' | 'timeline';
26
- /**
27
- * Repeated children of a container component. Set exactly one of `childTag`
28
- * or `childNode`. The canvas adds, removes, renames, and selects items with
29
- * normal document steps. The selected tab and collapsed items are view state.
30
- */
31
- export interface ComponentCanvasItems {
32
- /** Each item is a component with this tag. */
33
- childTag?: string;
34
- /**
35
- * Each item is a built-in node. `codeBlock` items are code blocks.
36
- * `heading` items start at a heading with the template's heading level.
37
- */
38
- childNode?: 'codeBlock' | 'heading';
39
- presentation: ComponentItemsPresentation;
40
- /** A text property of the child component that names each item. */
41
- labelProp?: string;
42
- /** A property of this component that sets the number of grid columns. */
43
- columnsProp?: string;
44
- /** The label of the add control, for example "Add tab". */
45
- addLabel?: string;
46
- /** MDC source for one new item. */
47
- template: string;
48
- }
49
- export type ComponentAuthoringMetadata<Definition extends ComponentPolicy = ComponentPolicy> = {
50
- /** Canvas interactions reference the same properties as the content policy. */
51
- canvas?: {
52
- switchGroup?: string;
53
- tone?: 'neutral' | 'info' | 'warning' | 'danger' | 'success' | 'idea';
54
- titleProp?: keyof Definition['props'] & string;
55
- columns?: {
56
- childTag: string;
57
- sizeProp: string;
58
- presets: readonly {
59
- label: string;
60
- values: readonly [string, string];
61
- ratio: number;
62
- }[];
63
- };
64
- items?: ComponentCanvasItems;
65
- };
66
- description?: string;
67
- label: string;
68
- props?: Partial<Record<keyof Definition['props'] & string, ComponentAuthoringField>>;
69
- slots?: Partial<Record<Definition['slots'][number], {
70
- label: string;
71
- }>>;
72
- };
73
- export interface AuthoringRecipe {
74
- /** Short explanation shown while choosing a block. */
75
- description?: string;
76
- /**
77
- * The menu group. Built-in groups are `text`, `lists`, `media`, `layout`,
78
- * `callouts`, and `advanced`. Other values show as their own group heading.
79
- */
80
- group?: string;
81
- /** A Lucide icon name in kebab-case, for example `panel-top`. */
82
- icon?: string;
83
- id: string;
84
- keywords?: readonly string[];
85
- label: string;
86
- source: string;
87
- }
88
- type ComponentMap = PortableComponentPolicyV2['components'];
89
- export type AuthoringKitSource<Components extends ComponentMap = ComponentMap> = {
90
- authoring: {
91
- [Tag in keyof Components]: ComponentAuthoringMetadata<Components[Tag]>;
92
- };
93
- implementation: {
94
- [Tag in keyof Components]: ComponentImplementationMetadata;
95
- };
96
- policy: {
97
- version: 2;
98
- components: Components;
99
- };
100
- recipes: readonly AuthoringRecipe[];
101
- version: 1;
102
- };
103
- export type AuthoringKit<Components extends ComponentMap = ComponentMap> = Readonly<AuthoringKitSource<Components>>;
104
- /** @deprecated Use `ComponentImplementationProp`. */
105
- export type ComponentImplementationPropV1 = ComponentImplementationProp;
106
- /** @deprecated Use `ComponentImplementationMetadata`. */
107
- export type ComponentImplementationMetadataV1 = ComponentImplementationMetadata;
108
- /** @deprecated Use `ComponentAuthoringField`. */
109
- export type ComponentAuthoringFieldV1 = ComponentAuthoringField;
110
- /** @deprecated Use `ComponentAuthoringMetadata`. */
111
- export type ComponentAuthoringMetadataV1<Definition extends ComponentPolicy = ComponentPolicy> = ComponentAuthoringMetadata<Definition>;
112
- /** @deprecated Use `AuthoringRecipe`. */
113
- export type AuthoringRecipeV1 = AuthoringRecipe;
114
- /** @deprecated Use `AuthoringKitSource`. */
115
- export type AuthoringKitSourceV1<Components extends ComponentMap = ComponentMap> = AuthoringKitSource<Components>;
116
- /** @deprecated Use `AuthoringKit`. */
117
- export type AuthoringKitV1<Components extends ComponentMap = ComponentMap> = AuthoringKit<Components>;
118
- export declare function createAuthoringKit<const Components extends ComponentMap>(source: AuthoringKitSource<Components>): Promise<AuthoringKit<Components>>;
119
- export declare function parseAuthoringSource(markdown: string, kit: AuthoringKitSource, label?: string): Promise<ParseMdcBodyResult['body']>;
120
- export declare function composeAuthoringKits(...sources: readonly AuthoringKitSource[]): Promise<AuthoringKit>;
121
- /** Create the built-in layout kit alone. Compose its source to add host components. */
122
- export declare function createGinkoLayoutKit(): Promise<AuthoringKit<typeof ginkoLayoutKitSource.policy.components>>;
package/dist/authoring.js DELETED
@@ -1,2 +0,0 @@
1
- import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./authoring-D7MJezVG.js";
2
- export { o as composeAuthoringKits, n as createAuthoringKit, i as createGinkoLayoutKit, e as ginkoLayoutComponentNames, r as ginkoLayoutComponentPolicy, a as ginkoLayoutKitSource, t as parseAuthoringSource };
@@ -1,14 +0,0 @@
1
- /**
2
- * Browser editing session for a host-owned shared document.
3
- * Protocol and transport types live in `@lupinum/ginko-editor/runtime`.
4
- * @experimental The collaboration API can change in a minor release before it is declared stable.
5
- * @packageDocumentation
6
- */
7
- export { createEditorCollaboration, parseCollaborationRecovery, EditorCollaborationSession, CollaborationConnectionError } from './lib/collaboration/session.js';
8
- export type { EditorCollaborationOptions, CollaborationState, CollaborationStateCode, CollaborationStatus, CollaborationRecovery, } from './lib/collaboration/session.js';
9
- export { readCollaborationRecovery, collaborationRecoveryToMarkdown } from './lib/collaboration/recovery.js';
10
- export type { CollaborationRecoveryReadResult, CollaborationRecoveryMarkdown } from './lib/collaboration/recovery.js';
11
- export { collaborationColor } from './lib/collaboration/presence-record.js';
12
- export type { CollaborationPeer, CollaborationPresenceOptions } from './lib/collaboration/presence.js';
13
- export { CollaborationError } from './lib/collaboration/protocol.js';
14
- export type { CollaborationErrorCode, CollaborationUser } from './lib/collaboration/protocol.js';