@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,1780 +0,0 @@
1
- import { assertPortableComponentPolicyV2 as e, parseMdcBody as t, validatePublicMarkdownAst as n, validateStoredPortableMarkdownAst as r } from "@lupinum/ginko-content/cms-contract";
2
- //#region src/layout-kit.ts
3
- var i = (e) => e === "json" ? [
4
- "string",
5
- "number",
6
- "boolean",
7
- "json"
8
- ] : [e], a = (e) => ({
9
- types: i(e),
10
- required: !1,
11
- allowedValues: null
12
- }), o = (e) => ({
13
- types: i(e),
14
- required: !0,
15
- allowedValues: null
16
- }), s = (...e) => ({
17
- types: ["string"],
18
- required: !1,
19
- allowedValues: [...e]
20
- }), c = (e = {}, t = ["default"], n = null, r = {
21
- allowedParents: null,
22
- allowedChildren: null
23
- }) => ({
24
- kind: "block",
25
- props: e,
26
- slots: t,
27
- media: n,
28
- ...r
29
- }), l = (e = {}) => ({
30
- kind: "inline",
31
- props: e,
32
- slots: ["default"],
33
- allowedParents: null,
34
- allowedChildren: null,
35
- media: null
36
- }), u = { appearance: a("string") }, d = c({
37
- title: a("string"),
38
- icon: a("string"),
39
- ...u
40
- }), f = {
41
- components: {
42
- accordion: c({
43
- ...u,
44
- type: a("string"),
45
- collapsible: a("boolean"),
46
- defaultValue: a("json")
47
- }),
48
- "accordion-item": c({
49
- value: a("string"),
50
- title: a("string"),
51
- content: a("string")
52
- }, [
53
- "default",
54
- "title",
55
- "content"
56
- ]),
57
- api: c({
58
- ...u,
59
- title: a("string"),
60
- icon: a("string"),
61
- method: a("string"),
62
- path: a("string"),
63
- groups: a("json")
64
- }),
65
- aside: c({
66
- label: a("string"),
67
- ...u
68
- }),
69
- card: c({
70
- title: a("string"),
71
- description: a("string"),
72
- footer: a("string"),
73
- to: a("string"),
74
- target: a("string"),
75
- icon: a("string"),
76
- iconColor: a("string"),
77
- img: a("asset"),
78
- showLinkIcon: a("boolean"),
79
- horizontal: a("boolean"),
80
- ...u
81
- }, [
82
- "default",
83
- "title",
84
- "description",
85
- "footer"
86
- ], {
87
- sourceProp: "img",
88
- altProp: null,
89
- titleProp: null,
90
- filenameProp: null
91
- }),
92
- cards: c({
93
- cols: a("string"),
94
- ...u
95
- }),
96
- center: c({
97
- size: a("string"),
98
- max: a("string"),
99
- type: a("string")
100
- }),
101
- "code-group": c(u),
102
- "code-tree": c({
103
- ...u,
104
- defaultValue: a("string"),
105
- expandAll: a("boolean")
106
- }),
107
- collapse: c(u),
108
- column: c({ size: s("sm", "md", "lg") }, ["default"], null, {
109
- allowedParents: ["layout"],
110
- allowedChildren: null
111
- }),
112
- dropcap: c({ lines: a("json") }),
113
- error: d,
114
- excerpt: c({
115
- label: a("string"),
116
- source: a("string"),
117
- ...u
118
- }),
119
- figure: c({
120
- ...u,
121
- src: o("asset"),
122
- alt: o("string"),
123
- caption: a("string"),
124
- width: a("json"),
125
- height: a("json"),
126
- bleed: a("string"),
127
- aspect: a("string"),
128
- fit: a("string"),
129
- zoom: a("json")
130
- }, ["default"], {
131
- sourceProp: "src",
132
- altProp: "alt",
133
- titleProp: null,
134
- filenameProp: null
135
- }),
136
- files: c({
137
- active: a("string"),
138
- annotations: a("json"),
139
- ...u
140
- }),
141
- idea: d,
142
- info: c({
143
- title: a("string"),
144
- icon: a("string"),
145
- appearance: s("quiet", "tint")
146
- }),
147
- kbd: l(),
148
- layout: c({ type: s("default", "card", "border", "border-dashed", "outline", "outline-dashed") }, ["default"], null, {
149
- allowedParents: null,
150
- allowedChildren: ["column"]
151
- }),
152
- note: d,
153
- quiz: c({
154
- ...u,
155
- title: a("string"),
156
- description: a("string"),
157
- questionLabel: a("string"),
158
- backLabel: a("string"),
159
- nextLabel: a("string"),
160
- resultsLabel: a("string"),
161
- correctSummaryLabel: a("string"),
162
- perfectLabel: a("string"),
163
- retryPrompt: a("string"),
164
- resetLabel: a("string")
165
- }),
166
- "quiz-question": c({
167
- question: o("string"),
168
- type: a("string"),
169
- explanation: a("string"),
170
- options: o("json"),
171
- checkLabel: a("string"),
172
- correctLabel: a("string"),
173
- incorrectLabel: a("string"),
174
- resetLabel: a("string"),
175
- multipleChoiceLabel: a("string")
176
- }),
177
- "read-more": c({
178
- title: a("string"),
179
- links: o("json"),
180
- ...u
181
- }, []),
182
- steps: c({
183
- mode: a("string"),
184
- ...u
185
- }),
186
- success: d,
187
- tab: c({
188
- icon: a("string"),
189
- label: a("string")
190
- }),
191
- tabs: c({
192
- layout: a("string"),
193
- padded: a("boolean"),
194
- ...u
195
- }),
196
- timeline: c(u),
197
- "timeline-item": c({
198
- date: a("string"),
199
- label: a("string"),
200
- title: a("string"),
201
- icon: a("string"),
202
- active: a("boolean")
203
- }),
204
- toc: c({
205
- title: a("string"),
206
- depth: a("json"),
207
- open: a("json")
208
- }, []),
209
- warning: d
210
- },
211
- version: 2
212
- }, p = {
213
- accordion: "MdcAccordion",
214
- "accordion-item": "MdcAccordionItem",
215
- api: "MdcApi",
216
- aside: "MdcAside",
217
- card: "MdcCard",
218
- cards: "MdcCards",
219
- center: "MdcCenter",
220
- "code-group": "MdcCodeGroup",
221
- "code-tree": "MdcCodeTree",
222
- collapse: "MdcCollapse",
223
- column: "MdcColumn",
224
- dropcap: "MdcDropcap",
225
- error: "MdcError",
226
- excerpt: "MdcExcerpt",
227
- figure: "MdcFigure",
228
- files: "MdcFiles",
229
- idea: "MdcIdea",
230
- info: "MdcInfo",
231
- kbd: "MdcKbd",
232
- layout: "MdcLayout",
233
- note: "MdcNote",
234
- quiz: "MdcQuiz",
235
- "quiz-question": "MdcQuizQuestion",
236
- "read-more": "MdcReadMore",
237
- steps: "MdcSteps",
238
- success: "MdcSuccess",
239
- tab: "MdcTab",
240
- tabs: "MdcTabs",
241
- timeline: "MdcTimeline",
242
- "timeline-item": "MdcTimelineItem",
243
- toc: "MdcInlineToc",
244
- warning: "MdcWarning"
245
- }, m = {
246
- required: !1,
247
- types: ["string"]
248
- }, h = {
249
- required: !1,
250
- types: ["boolean"]
251
- }, g = {
252
- required: !1,
253
- types: ["string"],
254
- options: ["quiet", "tint"]
255
- }, _ = {
256
- required: !1,
257
- types: [
258
- "boolean",
259
- "number",
260
- "object",
261
- "string"
262
- ]
263
- }, v = {
264
- title: m,
265
- icon: m,
266
- appearance: g
267
- }, y = {
268
- accordion: {
269
- props: {
270
- appearance: g,
271
- type: {
272
- required: !1,
273
- types: ["string"],
274
- default: "single",
275
- options: ["single", "multiple"]
276
- },
277
- collapsible: {
278
- required: !1,
279
- types: ["boolean"],
280
- default: !0
281
- },
282
- defaultValue: {
283
- required: !1,
284
- types: ["string", "object"]
285
- }
286
- },
287
- slots: ["default"]
288
- },
289
- "accordion-item": {
290
- props: {
291
- value: m,
292
- title: m,
293
- content: m
294
- },
295
- slots: [
296
- "title",
297
- "content",
298
- "default"
299
- ]
300
- },
301
- api: {
302
- props: {
303
- appearance: g,
304
- title: m,
305
- icon: m,
306
- method: m,
307
- path: m,
308
- groups: _
309
- },
310
- slots: ["default"]
311
- },
312
- aside: {
313
- props: {
314
- label: m,
315
- appearance: g
316
- },
317
- slots: ["default"]
318
- },
319
- card: {
320
- props: {
321
- title: m,
322
- description: m,
323
- footer: m,
324
- to: m,
325
- target: m,
326
- icon: m,
327
- iconColor: {
328
- required: !1,
329
- types: ["string"],
330
- options: [
331
- "muted",
332
- "foreground",
333
- "primary",
334
- "info",
335
- "success",
336
- "warning",
337
- "destructive"
338
- ]
339
- },
340
- img: m,
341
- showLinkIcon: {
342
- required: !1,
343
- types: ["boolean"],
344
- default: !0
345
- },
346
- horizontal: {
347
- required: !1,
348
- types: ["boolean"],
349
- default: !1
350
- },
351
- appearance: g
352
- },
353
- slots: [
354
- "title",
355
- "description",
356
- "default",
357
- "footer"
358
- ]
359
- },
360
- cards: {
361
- props: {
362
- cols: {
363
- required: !1,
364
- types: ["number", "string"],
365
- default: 2,
366
- options: [
367
- "1",
368
- "2",
369
- "3"
370
- ]
371
- },
372
- appearance: g
373
- },
374
- slots: ["default"]
375
- },
376
- center: {
377
- props: {
378
- size: {
379
- required: !1,
380
- types: ["string", "object"],
381
- default: "md",
382
- options: [
383
- "sm",
384
- "md",
385
- "lg"
386
- ]
387
- },
388
- max: {
389
- required: !1,
390
- types: ["string"],
391
- options: [
392
- "sm",
393
- "md",
394
- "lg"
395
- ]
396
- },
397
- type: {
398
- required: !1,
399
- types: ["string", "object"],
400
- default: "default",
401
- options: [
402
- "default",
403
- "card",
404
- "border",
405
- "border-dashed",
406
- "outline",
407
- "outline-dashed"
408
- ]
409
- }
410
- },
411
- slots: ["default"]
412
- },
413
- "code-group": {
414
- props: { appearance: g },
415
- slots: ["default"]
416
- },
417
- "code-tree": {
418
- props: {
419
- appearance: g,
420
- defaultValue: m,
421
- expandAll: h
422
- },
423
- slots: ["default"]
424
- },
425
- collapse: {
426
- props: { appearance: g },
427
- slots: ["default"]
428
- },
429
- column: {
430
- props: { size: {
431
- required: !1,
432
- types: ["string", "object"],
433
- default: "md",
434
- options: [
435
- "sm",
436
- "md",
437
- "lg"
438
- ]
439
- } },
440
- slots: ["default"]
441
- },
442
- dropcap: {
443
- props: { lines: {
444
- required: !1,
445
- types: ["number", "string"],
446
- default: 2
447
- } },
448
- slots: ["default"]
449
- },
450
- error: {
451
- props: v,
452
- slots: ["default"]
453
- },
454
- excerpt: {
455
- props: {
456
- label: m,
457
- source: m,
458
- appearance: g
459
- },
460
- slots: ["default"]
461
- },
462
- figure: {
463
- props: {
464
- appearance: g,
465
- src: m,
466
- alt: m,
467
- caption: m,
468
- width: {
469
- required: !1,
470
- types: ["string", "number"]
471
- },
472
- height: {
473
- required: !1,
474
- types: ["string", "number"]
475
- },
476
- bleed: {
477
- required: !1,
478
- types: ["boolean", "string"]
479
- },
480
- aspect: {
481
- required: !1,
482
- types: ["string"],
483
- options: [
484
- "auto",
485
- "video",
486
- "wide",
487
- "square",
488
- "portrait"
489
- ]
490
- },
491
- fit: {
492
- required: !1,
493
- types: ["string"],
494
- options: ["cover", "contain"]
495
- },
496
- zoom: {
497
- required: !1,
498
- types: ["boolean", "string"],
499
- default: "auto"
500
- }
501
- },
502
- slots: ["default"]
503
- },
504
- files: {
505
- props: {
506
- active: m,
507
- annotations: {
508
- required: !1,
509
- types: ["object"]
510
- },
511
- appearance: g
512
- },
513
- slots: ["default"]
514
- },
515
- idea: {
516
- props: v,
517
- slots: ["default"]
518
- },
519
- info: {
520
- props: v,
521
- slots: ["default"]
522
- },
523
- kbd: {
524
- props: {},
525
- slots: ["default"]
526
- },
527
- layout: {
528
- props: { type: {
529
- required: !1,
530
- types: ["string", "object"],
531
- default: "default",
532
- options: [
533
- "default",
534
- "card",
535
- "border",
536
- "border-dashed",
537
- "outline",
538
- "outline-dashed"
539
- ]
540
- } },
541
- slots: ["default"]
542
- },
543
- note: {
544
- props: v,
545
- slots: ["default"]
546
- },
547
- quiz: {
548
- props: {
549
- appearance: g,
550
- title: m,
551
- description: m,
552
- questionLabel: m,
553
- backLabel: m,
554
- nextLabel: m,
555
- resultsLabel: m,
556
- correctSummaryLabel: m,
557
- perfectLabel: m,
558
- retryPrompt: m,
559
- resetLabel: m
560
- },
561
- slots: ["default"]
562
- },
563
- "quiz-question": {
564
- props: {
565
- question: {
566
- required: !0,
567
- types: ["string"]
568
- },
569
- type: {
570
- required: !1,
571
- types: ["string"],
572
- default: "single",
573
- options: ["single", "multiple"]
574
- },
575
- explanation: m,
576
- options: {
577
- required: !0,
578
- types: ["object"]
579
- },
580
- checkLabel: m,
581
- correctLabel: m,
582
- incorrectLabel: m,
583
- resetLabel: m,
584
- multipleChoiceLabel: m
585
- },
586
- slots: ["default"]
587
- },
588
- "read-more": {
589
- props: {
590
- title: m,
591
- links: _,
592
- appearance: g
593
- },
594
- slots: []
595
- },
596
- steps: {
597
- props: {
598
- mode: {
599
- required: !1,
600
- types: ["string"],
601
- default: "icons",
602
- options: ["icons", "numbered"]
603
- },
604
- appearance: g
605
- },
606
- slots: ["default"]
607
- },
608
- success: {
609
- props: v,
610
- slots: ["default"]
611
- },
612
- tab: {
613
- props: {
614
- icon: m,
615
- label: m
616
- },
617
- slots: ["default"]
618
- },
619
- tabs: {
620
- props: {
621
- layout: {
622
- required: !1,
623
- types: ["string"],
624
- default: "separate",
625
- options: ["separate", "line"]
626
- },
627
- padded: {
628
- required: !1,
629
- types: ["boolean"],
630
- default: !0
631
- },
632
- appearance: g
633
- },
634
- slots: ["default"]
635
- },
636
- timeline: {
637
- props: { appearance: g },
638
- slots: ["default"]
639
- },
640
- "timeline-item": {
641
- props: {
642
- date: m,
643
- label: m,
644
- title: m,
645
- icon: m,
646
- active: h
647
- },
648
- slots: ["default"]
649
- },
650
- toc: {
651
- props: {
652
- title: m,
653
- depth: {
654
- required: !1,
655
- types: ["number"]
656
- },
657
- open: {
658
- required: !1,
659
- types: ["boolean", "string"]
660
- }
661
- },
662
- slots: []
663
- },
664
- warning: {
665
- props: v,
666
- slots: ["default"]
667
- }
668
- }, b = Object.fromEntries(Object.keys(p).map((e) => [e, {
669
- componentName: p[e],
670
- ...y[e]
671
- }])), x = {
672
- control: "text",
673
- label: "Appearance",
674
- help: "quiet or tint. Leave empty to use the site setting."
675
- }, S = {
676
- control: "text",
677
- label: "Icon",
678
- help: "An icon name, for example lucide:rocket."
679
- }, C = { default: { label: "Content" } };
680
- function w(e, t, n) {
681
- return {
682
- label: e,
683
- description: t,
684
- canvas: {
685
- titleProp: "title",
686
- switchGroup: "callout",
687
- tone: n
688
- },
689
- props: {
690
- icon: S,
691
- title: {
692
- control: "text",
693
- label: "Title"
694
- },
695
- appearance: x
696
- },
697
- slots: C
698
- };
699
- }
700
- var T = {
701
- version: 1,
702
- policy: f,
703
- implementation: b,
704
- authoring: {
705
- note: w("Note", "Useful context alongside the main text.", "neutral"),
706
- warning: w("Warning", "A condition readers should check before continuing.", "warning"),
707
- error: w("Error", "Explain a failure and how to recover.", "danger"),
708
- success: w("Success", "Confirm an outcome or a completed step.", "success"),
709
- idea: w("Idea", "A suggestion worth exploring.", "idea"),
710
- info: {
711
- label: "Information",
712
- description: "Supporting information that readers should notice.",
713
- canvas: {
714
- titleProp: "title",
715
- switchGroup: "callout",
716
- tone: "info"
717
- },
718
- props: {
719
- appearance: {
720
- control: "select",
721
- label: "Appearance"
722
- },
723
- icon: S,
724
- title: {
725
- control: "text",
726
- label: "Title"
727
- }
728
- },
729
- slots: C
730
- },
731
- aside: {
732
- label: "Aside",
733
- description: "Additional context beside the main argument.",
734
- canvas: { titleProp: "label" },
735
- props: {
736
- label: {
737
- control: "text",
738
- label: "Label"
739
- },
740
- appearance: x
741
- },
742
- slots: C
743
- },
744
- excerpt: {
745
- label: "Excerpt",
746
- description: "A quoted passage with a source.",
747
- canvas: { titleProp: "label" },
748
- props: {
749
- label: {
750
- control: "text",
751
- label: "Label"
752
- },
753
- source: {
754
- control: "text",
755
- label: "Source"
756
- },
757
- appearance: x
758
- },
759
- slots: { default: { label: "Quotation" } }
760
- },
761
- layout: {
762
- label: "Layout",
763
- description: "A responsive row for related columns.",
764
- canvas: { columns: {
765
- childTag: "column",
766
- sizeProp: "size",
767
- presets: [
768
- {
769
- label: "Small / Large",
770
- values: ["sm", "lg"],
771
- ratio: 1 / 3
772
- },
773
- {
774
- label: "Medium / Medium",
775
- values: ["md", "md"],
776
- ratio: 1 / 2
777
- },
778
- {
779
- label: "Large / Small",
780
- values: ["lg", "sm"],
781
- ratio: 2 / 3
782
- }
783
- ]
784
- } },
785
- props: { type: {
786
- control: "select",
787
- label: "Style"
788
- } },
789
- slots: { default: { label: "Columns" } }
790
- },
791
- column: {
792
- label: "Column",
793
- description: "A responsive column inside a layout.",
794
- props: { size: {
795
- control: "select",
796
- label: "Width"
797
- } },
798
- slots: C
799
- },
800
- tabs: {
801
- label: "Tabs",
802
- description: "Content that readers switch between.",
803
- canvas: { items: {
804
- childTag: "tab",
805
- labelProp: "label",
806
- presentation: "tabs",
807
- addLabel: "Add tab",
808
- template: "::tab{label=\"New tab\"}\nWrite the tab content here.\n::"
809
- } },
810
- props: {
811
- layout: {
812
- control: "text",
813
- label: "Layout",
814
- help: "separate or line."
815
- },
816
- padded: {
817
- control: "toggle",
818
- label: "Padded"
819
- },
820
- appearance: x
821
- },
822
- slots: { default: { label: "Tabs" } }
823
- },
824
- tab: {
825
- label: "Tab",
826
- description: "One tab inside tabs.",
827
- canvas: { titleProp: "label" },
828
- props: {
829
- label: {
830
- control: "text",
831
- label: "Label"
832
- },
833
- icon: S
834
- },
835
- slots: C
836
- },
837
- accordion: {
838
- label: "Accordion",
839
- description: "Questions or sections that readers open one at a time.",
840
- canvas: { items: {
841
- childTag: "accordion-item",
842
- labelProp: "title",
843
- presentation: "accordion",
844
- addLabel: "Add item",
845
- template: "::accordion-item{title=\"New question\"}\nWrite the answer here.\n::"
846
- } },
847
- props: {
848
- type: {
849
- control: "text",
850
- label: "Type",
851
- help: "single or multiple."
852
- },
853
- collapsible: {
854
- control: "toggle",
855
- label: "Collapsible"
856
- },
857
- defaultValue: {
858
- control: "json",
859
- label: "Open items",
860
- help: "An item value, or a JSON list of item values for the multiple type."
861
- },
862
- appearance: x
863
- },
864
- slots: { default: { label: "Items" } }
865
- },
866
- "accordion-item": {
867
- label: "Accordion item",
868
- description: "One item inside an accordion.",
869
- canvas: { titleProp: "title" },
870
- props: {
871
- title: {
872
- control: "text",
873
- label: "Title"
874
- },
875
- value: {
876
- control: "text",
877
- label: "Value",
878
- help: "A unique name for this item."
879
- }
880
- },
881
- slots: {
882
- default: { label: "Content" },
883
- title: { label: "Title" },
884
- content: { label: "Content" }
885
- }
886
- },
887
- steps: {
888
- label: "Steps",
889
- description: "A sequence of instructions. Each level-three heading starts a step.",
890
- canvas: { items: {
891
- childNode: "heading",
892
- presentation: "steps",
893
- addLabel: "Add step",
894
- template: "### New step\n\nDescribe this step."
895
- } },
896
- props: {
897
- mode: {
898
- control: "text",
899
- label: "Mode",
900
- help: "icons or numbered."
901
- },
902
- appearance: x
903
- },
904
- slots: { default: { label: "Steps" } }
905
- },
906
- cards: {
907
- label: "Cards",
908
- description: "A grid of linked cards.",
909
- canvas: { items: {
910
- childTag: "card",
911
- labelProp: "title",
912
- presentation: "grid",
913
- columnsProp: "cols",
914
- addLabel: "Add card",
915
- template: "::card{title=\"New card\"}\nDescribe this card.\n::"
916
- } },
917
- props: {
918
- cols: {
919
- control: "text",
920
- label: "Columns",
921
- help: "1, 2, or 3."
922
- },
923
- appearance: x
924
- },
925
- slots: { default: { label: "Cards" } }
926
- },
927
- card: {
928
- label: "Card",
929
- description: "A card with a title, text, and an optional link.",
930
- canvas: { titleProp: "title" },
931
- props: {
932
- title: {
933
- control: "text",
934
- label: "Title"
935
- },
936
- description: {
937
- control: "text",
938
- label: "Description"
939
- },
940
- to: {
941
- control: "text",
942
- label: "Link"
943
- },
944
- target: {
945
- control: "text",
946
- label: "Link target"
947
- },
948
- footer: {
949
- control: "text",
950
- label: "Footer"
951
- },
952
- icon: S,
953
- iconColor: {
954
- control: "text",
955
- label: "Icon color"
956
- },
957
- img: {
958
- control: "text",
959
- label: "Image"
960
- },
961
- showLinkIcon: {
962
- control: "toggle",
963
- label: "Show link icon"
964
- },
965
- horizontal: {
966
- control: "toggle",
967
- label: "Horizontal"
968
- },
969
- appearance: x
970
- },
971
- slots: {
972
- default: { label: "Content" },
973
- title: { label: "Title" },
974
- description: { label: "Description" },
975
- footer: { label: "Footer" }
976
- }
977
- },
978
- timeline: {
979
- label: "Timeline",
980
- description: "Events in time order.",
981
- canvas: { items: {
982
- childTag: "timeline-item",
983
- labelProp: "title",
984
- presentation: "timeline",
985
- addLabel: "Add event",
986
- template: "::timeline-item{title=\"New event\"}\nDescribe the event.\n::"
987
- } },
988
- props: { appearance: x },
989
- slots: { default: { label: "Events" } }
990
- },
991
- "timeline-item": {
992
- label: "Timeline event",
993
- description: "One event in a timeline.",
994
- canvas: { titleProp: "title" },
995
- props: {
996
- title: {
997
- control: "text",
998
- label: "Title"
999
- },
1000
- date: {
1001
- control: "text",
1002
- label: "Date"
1003
- },
1004
- label: {
1005
- control: "text",
1006
- label: "Label"
1007
- },
1008
- icon: S,
1009
- active: {
1010
- control: "toggle",
1011
- label: "Current event"
1012
- }
1013
- },
1014
- slots: C
1015
- },
1016
- "code-group": {
1017
- label: "Code group",
1018
- description: "Code examples that readers switch between.",
1019
- canvas: { items: {
1020
- childNode: "codeBlock",
1021
- presentation: "tabs",
1022
- addLabel: "Add file",
1023
- template: "```ts [example.ts]\n// Write the code here.\n```"
1024
- } },
1025
- props: { appearance: x },
1026
- slots: { default: { label: "Code blocks" } }
1027
- },
1028
- "code-tree": {
1029
- label: "Code tree",
1030
- description: "Several files that readers browse in a file tree.",
1031
- canvas: { items: {
1032
- childNode: "codeBlock",
1033
- presentation: "stack",
1034
- addLabel: "Add file",
1035
- template: "```ts [src/example.ts]\n// Write the code here.\n```"
1036
- } },
1037
- props: {
1038
- defaultValue: {
1039
- control: "text",
1040
- label: "Selected file",
1041
- help: "The file name to show first."
1042
- },
1043
- expandAll: {
1044
- control: "toggle",
1045
- label: "Expand all folders"
1046
- },
1047
- appearance: x
1048
- },
1049
- slots: { default: { label: "Files" } }
1050
- },
1051
- collapse: {
1052
- label: "Collapse",
1053
- description: "Long content that readers expand.",
1054
- props: { appearance: x },
1055
- slots: C
1056
- },
1057
- center: {
1058
- label: "Center",
1059
- description: "Content in a centered column.",
1060
- props: {
1061
- size: {
1062
- control: "text",
1063
- label: "Size",
1064
- help: "sm, md, or lg."
1065
- },
1066
- max: {
1067
- control: "text",
1068
- label: "Maximum width",
1069
- help: "sm, md, or lg."
1070
- },
1071
- type: {
1072
- control: "text",
1073
- label: "Style",
1074
- help: "default, card, border, border-dashed, outline, or outline-dashed."
1075
- }
1076
- },
1077
- slots: C
1078
- },
1079
- figure: {
1080
- label: "Figure",
1081
- description: "An image with a caption.",
1082
- props: {
1083
- src: {
1084
- control: "text",
1085
- label: "Image"
1086
- },
1087
- alt: {
1088
- control: "text",
1089
- label: "Alternative text"
1090
- },
1091
- caption: {
1092
- control: "text",
1093
- label: "Caption"
1094
- },
1095
- aspect: {
1096
- control: "text",
1097
- label: "Aspect",
1098
- help: "auto, video, wide, square, or portrait."
1099
- },
1100
- fit: {
1101
- control: "text",
1102
- label: "Fit",
1103
- help: "cover or contain."
1104
- },
1105
- bleed: {
1106
- control: "text",
1107
- label: "Bleed",
1108
- help: "outside to use the full width."
1109
- },
1110
- width: {
1111
- control: "json",
1112
- label: "Width",
1113
- help: "A number of pixels."
1114
- },
1115
- height: {
1116
- control: "json",
1117
- label: "Height",
1118
- help: "A number of pixels."
1119
- },
1120
- zoom: {
1121
- control: "json",
1122
- label: "Zoom",
1123
- help: "true, false, or \"auto\"."
1124
- },
1125
- appearance: x
1126
- },
1127
- slots: { default: { label: "Caption" } }
1128
- },
1129
- dropcap: {
1130
- label: "Drop cap",
1131
- description: "A large first letter.",
1132
- props: { lines: {
1133
- control: "json",
1134
- label: "Lines",
1135
- help: "The height of the letter in lines."
1136
- } },
1137
- slots: C
1138
- },
1139
- kbd: {
1140
- label: "Keyboard key",
1141
- description: "A key or shortcut in a sentence.",
1142
- slots: { default: { label: "Key" } }
1143
- },
1144
- "read-more": {
1145
- label: "Read more",
1146
- description: "Links to further reading.",
1147
- props: {
1148
- title: {
1149
- control: "text",
1150
- label: "Title"
1151
- },
1152
- links: {
1153
- control: "json",
1154
- label: "Links",
1155
- help: "A JSON list of links. Each link has title and to, and can have description and icon."
1156
- },
1157
- appearance: x
1158
- }
1159
- },
1160
- toc: {
1161
- label: "Table of contents",
1162
- description: "A table of contents for this page.",
1163
- props: {
1164
- title: {
1165
- control: "text",
1166
- label: "Title"
1167
- },
1168
- depth: {
1169
- control: "json",
1170
- label: "Depth",
1171
- help: "The deepest heading level, for example 2."
1172
- },
1173
- open: {
1174
- control: "json",
1175
- label: "Open",
1176
- help: "true to show the list open."
1177
- }
1178
- }
1179
- },
1180
- quiz: {
1181
- label: "Quiz",
1182
- description: "Questions that readers answer to check what they learned.",
1183
- canvas: { items: {
1184
- childTag: "quiz-question",
1185
- labelProp: "question",
1186
- presentation: "stack",
1187
- addLabel: "Add question",
1188
- template: "::quiz-question\n---\nquestion: New question\noptions:\n - text: Correct answer\n correct: true\n - text: Wrong answer\n correct: false\n---\nExplain the answer here.\n::"
1189
- } },
1190
- props: {
1191
- title: {
1192
- control: "text",
1193
- label: "Title"
1194
- },
1195
- description: {
1196
- control: "text",
1197
- label: "Description"
1198
- },
1199
- appearance: x
1200
- },
1201
- slots: { default: { label: "Questions" } }
1202
- },
1203
- "quiz-question": {
1204
- label: "Quiz question",
1205
- description: "One question with answer choices.",
1206
- canvas: { titleProp: "question" },
1207
- props: {
1208
- question: {
1209
- control: "text",
1210
- label: "Question"
1211
- },
1212
- type: {
1213
- control: "text",
1214
- label: "Type",
1215
- help: "single or multiple."
1216
- },
1217
- options: {
1218
- control: "json",
1219
- label: "Choices",
1220
- help: "A JSON list of at least two choices. Each choice has text and correct."
1221
- },
1222
- explanation: {
1223
- control: "text",
1224
- label: "Explanation"
1225
- }
1226
- },
1227
- slots: { default: { label: "Explanation" } }
1228
- },
1229
- api: {
1230
- label: "API reference",
1231
- description: "Structured fields in a reference panel.",
1232
- canvas: { titleProp: "title" },
1233
- props: {
1234
- title: {
1235
- control: "text",
1236
- label: "Title"
1237
- },
1238
- icon: S,
1239
- method: {
1240
- control: "text",
1241
- label: "Method"
1242
- },
1243
- path: {
1244
- control: "text",
1245
- label: "Path"
1246
- },
1247
- groups: {
1248
- control: "json",
1249
- label: "Groups",
1250
- help: "A JSON list of groups. Each group has label and entries."
1251
- },
1252
- appearance: x
1253
- },
1254
- slots: { default: { label: "Content (not shown on Docs sites)" } }
1255
- },
1256
- files: {
1257
- label: "Files",
1258
- description: "A folder structure without file contents.",
1259
- props: {
1260
- active: {
1261
- control: "text",
1262
- label: "Highlighted path"
1263
- },
1264
- annotations: {
1265
- control: "json",
1266
- label: "Annotations",
1267
- help: "A JSON object from paths to labels."
1268
- },
1269
- appearance: x
1270
- },
1271
- slots: { default: { label: "File list" } }
1272
- }
1273
- },
1274
- recipes: [
1275
- {
1276
- id: "ginko.layout.note",
1277
- label: "Note",
1278
- description: "Useful context alongside the main text.",
1279
- keywords: ["callout", "notice"],
1280
- group: "callouts",
1281
- icon: "sticky-note",
1282
- source: "::note{title=\"Keep in mind\"}\nWrite the important context here.\n::"
1283
- },
1284
- {
1285
- id: "ginko.layout.info",
1286
- label: "Information",
1287
- description: "Supporting information that readers should notice.",
1288
- keywords: [
1289
- "callout",
1290
- "info",
1291
- "tip"
1292
- ],
1293
- group: "callouts",
1294
- icon: "info",
1295
- source: "::info{title=\"Good to know\"}\nWrite the supporting information here.\n::"
1296
- },
1297
- {
1298
- id: "ginko.layout.warning",
1299
- label: "Warning",
1300
- description: "A condition readers should check before continuing.",
1301
- keywords: [
1302
- "callout",
1303
- "caution",
1304
- "alert"
1305
- ],
1306
- group: "callouts",
1307
- icon: "triangle-alert",
1308
- source: "::warning{title=\"Before you continue\"}\nWrite the condition here.\n::"
1309
- },
1310
- {
1311
- id: "ginko.layout.error",
1312
- label: "Error",
1313
- description: "Explain a failure and how to recover.",
1314
- keywords: [
1315
- "callout",
1316
- "danger",
1317
- "failure"
1318
- ],
1319
- group: "callouts",
1320
- icon: "circle-x",
1321
- source: "::error{title=\"Something needs attention\"}\nExplain the failure and the recovery here.\n::"
1322
- },
1323
- {
1324
- id: "ginko.layout.success",
1325
- label: "Success",
1326
- description: "Confirm an outcome or a completed step.",
1327
- keywords: [
1328
- "callout",
1329
- "done",
1330
- "check"
1331
- ],
1332
- group: "callouts",
1333
- icon: "circle-check",
1334
- source: "::success{title=\"You are ready\"}\nWrite the outcome here.\n::"
1335
- },
1336
- {
1337
- id: "ginko.layout.idea",
1338
- label: "Idea",
1339
- description: "A suggestion worth exploring.",
1340
- keywords: [
1341
- "callout",
1342
- "tip",
1343
- "suggestion"
1344
- ],
1345
- group: "callouts",
1346
- icon: "lightbulb",
1347
- source: "::idea{title=\"Try this\"}\nWrite the suggestion here.\n::"
1348
- },
1349
- {
1350
- id: "ginko.layout.aside",
1351
- label: "Aside",
1352
- description: "Add context without interrupting the main text.",
1353
- keywords: ["sidebar", "context"],
1354
- group: "callouts",
1355
- icon: "message-square-quote",
1356
- source: "::aside{label=\"A little context\"}\nAdd a useful detail here.\n::"
1357
- },
1358
- {
1359
- id: "ginko.layout.excerpt",
1360
- label: "Excerpt",
1361
- description: "Quote a passage and name its source.",
1362
- keywords: ["quotation", "citation"],
1363
- group: "text",
1364
- icon: "text-quote",
1365
- source: "::excerpt{label=\"In their words\" source=\"Source\"}\nWrite the quoted passage here.\n::"
1366
- },
1367
- {
1368
- id: "ginko.layout.dropcap",
1369
- label: "Drop cap",
1370
- description: "Start a passage with a large first letter.",
1371
- keywords: ["initial", "letter"],
1372
- group: "text",
1373
- icon: "case-upper",
1374
- source: "::dropcap\nWrite the first paragraph of the story here.\n::"
1375
- },
1376
- {
1377
- id: "ginko.layout.kbd",
1378
- label: "Keyboard key",
1379
- description: "Show a key or a shortcut in a sentence.",
1380
- keywords: [
1381
- "kbd",
1382
- "shortcut",
1383
- "key"
1384
- ],
1385
- group: "text",
1386
- icon: "keyboard",
1387
- source: "Press :kbd[Ctrl] + :kbd[K] to search."
1388
- },
1389
- {
1390
- id: "ginko.layout.two-columns",
1391
- label: "Two columns",
1392
- description: "Put related content side by side.",
1393
- keywords: [
1394
- "layout",
1395
- "columns",
1396
- "side by side"
1397
- ],
1398
- group: "layout",
1399
- icon: "columns-2",
1400
- source: "::layout{type=\"border\"}\n:::column{size=\"sm\"}\nFirst column.\n:::\n\n:::column{size=\"lg\"}\nSecond column.\n:::\n::"
1401
- },
1402
- {
1403
- id: "ginko.layout.tabs",
1404
- label: "Tabs",
1405
- description: "Content that readers switch between.",
1406
- keywords: ["tab", "switch"],
1407
- group: "layout",
1408
- icon: "panel-top",
1409
- source: "::tabs\n:::tab{label=\"First tab\"}\nWrite the first tab here.\n:::\n\n:::tab{label=\"Second tab\"}\nWrite the second tab here.\n:::\n::"
1410
- },
1411
- {
1412
- id: "ginko.layout.accordion",
1413
- label: "Accordion",
1414
- description: "Questions or sections that readers open one at a time.",
1415
- keywords: [
1416
- "faq",
1417
- "collapsible",
1418
- "disclosure"
1419
- ],
1420
- group: "layout",
1421
- icon: "list-collapse",
1422
- source: "::accordion\n:::accordion-item{title=\"First question\"}\nWrite the first answer here.\n:::\n\n:::accordion-item{title=\"Second question\"}\nWrite the second answer here.\n:::\n::"
1423
- },
1424
- {
1425
- id: "ginko.layout.steps",
1426
- label: "Steps",
1427
- description: "A sequence of instructions.",
1428
- keywords: [
1429
- "procedure",
1430
- "how to",
1431
- "sequence"
1432
- ],
1433
- group: "layout",
1434
- icon: "list-checks",
1435
- source: "::steps\n### Prepare\n\nDescribe the first step.\n\n### Do the work\n\nDescribe the second step.\n\n### Check the result\n\nDescribe the last step.\n::"
1436
- },
1437
- {
1438
- id: "ginko.layout.cards",
1439
- label: "Cards",
1440
- description: "A grid of linked cards.",
1441
- keywords: [
1442
- "grid",
1443
- "card",
1444
- "links"
1445
- ],
1446
- group: "layout",
1447
- icon: "layout-grid",
1448
- source: "::cards{cols=\"2\"}\n:::card{title=\"First card\"}\nDescribe the first card.\n:::\n\n:::card{title=\"Second card\"}\nDescribe the second card.\n:::\n::"
1449
- },
1450
- {
1451
- id: "ginko.layout.timeline",
1452
- label: "Timeline",
1453
- description: "Events in time order.",
1454
- keywords: [
1455
- "history",
1456
- "events",
1457
- "changelog"
1458
- ],
1459
- group: "layout",
1460
- icon: "milestone",
1461
- source: "::timeline\n:::timeline-item{date=\"Start\" title=\"First event\"}\nDescribe the first event.\n:::\n\n:::timeline-item{date=\"Next\" title=\"Second event\"}\nDescribe the second event.\n:::\n::"
1462
- },
1463
- {
1464
- id: "ginko.layout.collapse",
1465
- label: "Collapse",
1466
- description: "Long content that readers expand.",
1467
- keywords: [
1468
- "expand",
1469
- "more",
1470
- "fold"
1471
- ],
1472
- group: "layout",
1473
- icon: "chevrons-down-up",
1474
- source: "::collapse\nWrite the long content here.\n::"
1475
- },
1476
- {
1477
- id: "ginko.layout.center",
1478
- label: "Center",
1479
- description: "Content in a centered column.",
1480
- keywords: ["centered", "narrow"],
1481
- group: "layout",
1482
- icon: "align-center",
1483
- source: "::center{size=\"md\"}\nWrite the centered content here.\n::"
1484
- },
1485
- {
1486
- id: "ginko.layout.figure",
1487
- label: "Figure",
1488
- description: "An image with a caption. Set the image in the block settings.",
1489
- keywords: [
1490
- "image",
1491
- "photo",
1492
- "caption"
1493
- ],
1494
- group: "media",
1495
- icon: "frame",
1496
- source: "::figure{src=\"/images/example.jpg\" alt=\"Describe the image\" caption=\"Write the caption here.\"}\n::"
1497
- },
1498
- {
1499
- id: "ginko.layout.code-group",
1500
- label: "Code group",
1501
- description: "Code examples that readers switch between.",
1502
- keywords: [
1503
- "code",
1504
- "tabs",
1505
- "snippets"
1506
- ],
1507
- group: "advanced",
1508
- icon: "files",
1509
- source: "::code-group\n```ts [example.ts]\nexport const answer = 42\n```\n\n```js [example.js]\nexport const answer = 42\n```\n::"
1510
- },
1511
- {
1512
- id: "ginko.layout.code-tree",
1513
- label: "Code tree",
1514
- description: "Several files that readers browse in a file tree.",
1515
- keywords: [
1516
- "files",
1517
- "code",
1518
- "project"
1519
- ],
1520
- group: "advanced",
1521
- icon: "folder-code",
1522
- source: "::code-tree\n```ts [src/index.ts]\nexport const answer = 42\n```\n\n```json [package.json]\n{ \"name\": \"example\" }\n```\n::"
1523
- },
1524
- {
1525
- id: "ginko.layout.files",
1526
- label: "Files",
1527
- description: "Show a folder structure.",
1528
- keywords: [
1529
- "folders",
1530
- "tree",
1531
- "directory"
1532
- ],
1533
- group: "advanced",
1534
- icon: "folder-tree",
1535
- source: "::files\n- `content`\n - `index.md`\n- `public`\n - `logo.svg`\n::"
1536
- },
1537
- {
1538
- id: "ginko.layout.read-more",
1539
- label: "Read more",
1540
- description: "Link to further reading.",
1541
- keywords: [
1542
- "links",
1543
- "related",
1544
- "see also"
1545
- ],
1546
- group: "advanced",
1547
- icon: "book-open",
1548
- source: "::read-more{title=\"Read more\"}\n---\nlinks:\n - title: Getting started\n to: /\n---\n::"
1549
- },
1550
- {
1551
- id: "ginko.layout.toc",
1552
- label: "Table of contents",
1553
- description: "List the headings of this page.",
1554
- keywords: [
1555
- "toc",
1556
- "contents",
1557
- "outline"
1558
- ],
1559
- group: "advanced",
1560
- icon: "list-tree",
1561
- source: "::toc{title=\"On this page\"}\n::"
1562
- },
1563
- {
1564
- id: "ginko.layout.quiz",
1565
- label: "Quiz",
1566
- description: "Let readers check what they learned.",
1567
- keywords: [
1568
- "question",
1569
- "test",
1570
- "check"
1571
- ],
1572
- group: "advanced",
1573
- icon: "circle-help",
1574
- source: "::quiz{title=\"Check your understanding\"}\n:::quiz-question\n---\nquestion: Which answer is correct?\noptions:\n - text: This answer\n correct: true\n - text: That answer\n correct: false\n---\nExplain the answer here.\n:::\n::"
1575
- },
1576
- {
1577
- id: "ginko.layout.api",
1578
- label: "API reference",
1579
- description: "Describe structured fields in a reference panel.",
1580
- keywords: [
1581
- "api",
1582
- "fields",
1583
- "reference",
1584
- "props"
1585
- ],
1586
- group: "advanced",
1587
- icon: "braces",
1588
- source: "::api{title=\"Fields\"}\n---\ngroups:\n - label: Fields\n entries:\n - name: title\n annotation: string\n required: true\n description: The page title.\n---\n::"
1589
- }
1590
- ]
1591
- }, E = {
1592
- json: [
1593
- "boolean",
1594
- "number",
1595
- "object",
1596
- "string"
1597
- ],
1598
- number: ["number"],
1599
- select: [
1600
- "boolean",
1601
- "number",
1602
- "string"
1603
- ],
1604
- text: ["string"],
1605
- toggle: ["boolean"]
1606
- };
1607
- function D(e) {
1608
- throw TypeError(`Invalid authoring kit: ${e}`);
1609
- }
1610
- function O(e, t, n = /* @__PURE__ */ new WeakSet()) {
1611
- if (!(e === null || typeof e == "boolean" || typeof e == "string")) {
1612
- if (typeof e == "number") {
1613
- Number.isFinite(e) || D(`${t} must contain only finite numbers.`);
1614
- return;
1615
- }
1616
- if (Array.isArray(e)) {
1617
- n.has(e) && D(`${t} must not contain a cycle.`), n.add(e), e.forEach((e, r) => O(e, `${t}[${r}]`, n)), n.delete(e);
1618
- return;
1619
- }
1620
- typeof e != "object" && D(`${t} must be JSON-safe.`), Object.getPrototypeOf(e) !== Object.prototype && Object.getPrototypeOf(e) !== null && D(`${t} must contain only plain JSON objects.`), n.has(e) && D(`${t} must not contain a cycle.`), n.add(e);
1621
- for (let [r, i] of Object.entries(e)) i === void 0 && D(`${t}.${r} must not be undefined.`), O(i, `${t}.${r}`, n);
1622
- n.delete(e);
1623
- }
1624
- }
1625
- function k(e, t) {
1626
- let n = /* @__PURE__ */ new Set();
1627
- for (let r of e) r.trim() || D(`${t} contains an empty value.`), n.has(r) && D(`${t} contains duplicate "${r}".`), n.add(r);
1628
- }
1629
- function A(e) {
1630
- return e === "asset" ? "string" : e === "json" ? "object" : e;
1631
- }
1632
- function j(e) {
1633
- return [...new Set(e.map(A))];
1634
- }
1635
- function M(e, t, n, r) {
1636
- /^[a-z][a-z0-9-]*$/.test(e) || D(`component tag "${e}" is not canonical kebab-case.`), n.componentName.trim() || D(`${e}.implementation.componentName is empty.`), k(n.slots, `${e}.implementation.slots`), k(t.slots, `${e}.policy.slots`);
1637
- for (let [r, i] of Object.entries(t.props)) {
1638
- let t = n.props[r];
1639
- t || D(`${e}.policy.props.${r} is not implemented.`);
1640
- let a = j(i.types);
1641
- t.types.length === 0 && D(`${e}.implementation.props.${r} has no type.`), t.types.every((e) => e === "complex") && D(`${e}.implementation.props.${r} has an unsupported complex type.`);
1642
- let o = i.types.includes("json") ? a.some((e) => t.types.includes(e)) ? [] : a : a.filter((e) => !t.types.includes(e));
1643
- o.length > 0 && D(`${e}.policy.props.${r} expects ${o.join(" | ")}, not ${t.types.join(" | ")}.`);
1644
- let s = t.options;
1645
- i.allowedValues && s && i.allowedValues.some((e) => !s.includes(e)) && D(`${e}.implementation.props.${r} does not implement every allowed policy value.`);
1646
- }
1647
- for (let [r, i] of Object.entries(n.props)) i.required && i.default === void 0 && (!t.props[r] || !t.props[r].required) && D(`${e}.implementation.props.${r} is required but optional or unavailable in policy.`);
1648
- for (let r of t.slots) n.slots.includes(r) || D(`${e}.policy slot "${r}" is not implemented.`);
1649
- for (let [i, a] of Object.entries(r.props ?? {})) {
1650
- if (!a) continue;
1651
- i in t.props || D(`${e}.authoring.props.${i} is not allowed by policy.`);
1652
- let r = n.props[i], o = j(t.props[i].types);
1653
- (!r || !o.some((e) => E[a.control].includes(e))) && D(`${e}.authoring.props.${i} uses an incompatible ${a.control} control.`), a.control === "select" && !t.props[i].allowedValues?.length && D(`${e}.authoring.props.${i} requires policy allowedValues.`), a.control === "json" && !t.props[i].types.includes("json") && D(`${e}.authoring.props.${i} uses a json control without a policy json type.`);
1654
- }
1655
- r.canvas?.switchGroup !== void 0 && !r.canvas.switchGroup.trim() && D(`${e}.canvas.switchGroup must not be empty.`), r.canvas?.tone && ![
1656
- "neutral",
1657
- "info",
1658
- "warning",
1659
- "danger",
1660
- "success",
1661
- "idea"
1662
- ].includes(r.canvas.tone) && D(`${e}.canvas.tone is unsupported.`);
1663
- let i = r.canvas?.titleProp;
1664
- i && (!t.props[i]?.types.includes("string") || r.props?.[i]?.control !== "text") && D(`${e}.canvas.titleProp must reference an authored text property.`);
1665
- for (let n of Object.keys(r.slots ?? {})) t.slots.includes(n) || D(`${e}.authoring slot "${n}" is not allowed by policy.`);
1666
- }
1667
- var N = [
1668
- "accordion",
1669
- "grid",
1670
- "stack",
1671
- "steps",
1672
- "tabs",
1673
- "timeline"
1674
- ];
1675
- function P(e, t) {
1676
- let n = t.authoring[e].canvas?.items;
1677
- if (!n) return;
1678
- let r = `${e}.canvas.items`, i = t.policy.components[e];
1679
- if ((i.kind !== "block" || !i.slots.includes("default")) && D(`${r} requires a block component with a default slot.`), N.includes(n.presentation) || D(`${r}.presentation is unsupported.`), n.childTag === void 0 == (n.childNode === void 0) && D(`${r} must set exactly one of childTag or childNode.`), n.childNode !== void 0 && !["codeBlock", "heading"].includes(n.childNode) && D(`${r}.childNode is unsupported.`), n.childTag !== void 0) {
1680
- let a = t.policy.components[n.childTag];
1681
- (!a || a.kind !== "block") && D(`${r}.childTag must reference a block component.`), (i.allowedChildren && !i.allowedChildren.includes(n.childTag) || a.allowedParents && !a.allowedParents.includes(e)) && D(`${r} must respect parent and child placement policy.`), n.labelProp !== void 0 && !a.props[n.labelProp]?.types.includes("string") && D(`${r}.labelProp must be a declared text property of "${n.childTag}".`);
1682
- } else n.labelProp !== void 0 && D(`${r}.labelProp requires childTag.`);
1683
- n.columnsProp !== void 0 && ((i.props[n.columnsProp]?.types)?.some((e) => e === "string" || e === "number") || D(`${r}.columnsProp must be a declared text or number property of "${e}".`)), n.addLabel !== void 0 && !n.addLabel.trim() && D(`${r}.addLabel must not be empty.`), (typeof n.template != "string" || !n.template.trim()) && D(`${r}.template must not be empty.`);
1684
- }
1685
- async function F(e, r, i) {
1686
- let a = `${e}.canvas.items.template`, { body: o } = await t(r.template, { autoClose: !1 }), s = (o.children ?? []).filter((e) => e.type === "element"), c = (e) => e.props?.$?.html === 1, l = (e) => /^h([1-6])$/.exec(e?.tag ?? "")?.[1];
1687
- if (r.childTag !== void 0) (s.length !== 1 || s[0].tag !== r.childTag || c(s[0])) && D(`${a} must contain exactly one "${r.childTag}" component.`);
1688
- else if (r.childNode === "codeBlock") (s.length !== 1 || s[0].tag !== "pre") && D(`${a} must contain exactly one code block.`);
1689
- else {
1690
- let e = Number(l(s[0]));
1691
- (!e || s.slice(1).some((t) => Number(l(t) ?? 7) <= e)) && D(`${a} must start with the only heading of its level.`);
1692
- }
1693
- let u = { ...i.policy.components };
1694
- r.childTag && (u[r.childTag] = {
1695
- ...u[r.childTag],
1696
- allowedParents: null
1697
- });
1698
- let d = n(o, {
1699
- version: 2,
1700
- components: u
1701
- });
1702
- if (!d.ok) {
1703
- let e = d.issues[0];
1704
- D(`${a} is outside policy (${e.code} at ${e.path.join(".")}).`);
1705
- }
1706
- }
1707
- function I(e) {
1708
- return e && typeof e == "object" && (Object.isFrozen(e) || Object.freeze(e), Object.values(e).forEach(I)), e;
1709
- }
1710
- async function L(t) {
1711
- O(t, "source"), t.version !== 1 && D("version must be 1.");
1712
- try {
1713
- e(t.policy);
1714
- } catch (e) {
1715
- D(`policy is invalid (${e instanceof Error ? e.message : "unknown error"}).`);
1716
- }
1717
- let n = Object.keys(t.policy.components);
1718
- k(n, "policy.components");
1719
- let r = Object.keys(t.implementation), i = Object.keys(t.authoring);
1720
- r.sort().join("\0") !== [...n].sort().join("\0") && D("implementation tags must exactly match policy tags."), i.sort().join("\0") !== [...n].sort().join("\0") && D("authoring tags must exactly match policy tags.");
1721
- for (let e of n) M(e, t.policy.components[e], t.implementation[e], t.authoring[e]);
1722
- for (let e of n) {
1723
- let n = t.authoring[e].canvas?.columns;
1724
- if (!n) continue;
1725
- let r = t.policy.components[n.childTag], i = r?.props[n.sizeProp]?.allowedValues;
1726
- (t.policy.components[e].kind !== "block" || r?.kind !== "block" || !i?.length || n.presets.length < 2) && D(`${e}.canvas.columns must reference a block child with discrete sizes and at least two presets.`);
1727
- let a = t.policy.components[e];
1728
- (a.allowedChildren && !a.allowedChildren.includes(n.childTag) || r.allowedParents && !r.allowedParents.includes(e)) && D(`${e}.canvas.columns must respect parent and child placement policy.`);
1729
- let o = 0, s = /* @__PURE__ */ new Set();
1730
- for (let t of n.presets) (!Number.isFinite(t.ratio) || s.has(JSON.stringify(t.values)) || !t.label.trim() || t.values.length !== 2 || t.values.some((e) => !i.includes(e)) || t.ratio <= o || t.ratio >= 1) && D(`${e}.canvas.columns presets must use allowed size pairs and increasing ratios between zero and one.`), s.add(JSON.stringify(t.values)), o = t.ratio;
1731
- }
1732
- for (let e of n) P(e, t);
1733
- k(t.recipes.map(({ id: e }) => e), "recipes"), I(t);
1734
- for (let e of n) {
1735
- let n = t.authoring[e].canvas?.items;
1736
- n && await F(e, n, t);
1737
- }
1738
- for (let e of t.recipes) e.label.trim() || D(`recipe "${e.id}" has an empty label.`), e.keywords && k(e.keywords, `recipe "${e.id}".keywords`), e.group !== void 0 && (!e.group.trim() || e.group.length > 40) && D(`recipe "${e.id}".group must be a short, non-empty name.`), e.icon !== void 0 && !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(e.icon) && D(`recipe "${e.id}".icon must be a kebab-case Lucide icon name.`), await z(e.source, t, `recipe "${e.id}"`);
1739
- return I(t);
1740
- }
1741
- async function R(e, n, i = "source") {
1742
- let { body: a } = await t(e, { autoClose: !1 }), o = r(a, n.policy);
1743
- if (!o.ok) {
1744
- let e = o.issues[0];
1745
- D(`${i} is outside policy (${e.code} at ${e.path.join(".")}).`);
1746
- }
1747
- return a;
1748
- }
1749
- async function z(e, r, i) {
1750
- let { body: a } = await t(e, { autoClose: !1 }), o = n(a, r.policy);
1751
- if (!o.ok) {
1752
- let e = o.issues[0];
1753
- D(`${i} is outside policy (${e.code} at ${e.path.join(".")}).`);
1754
- }
1755
- return a;
1756
- }
1757
- async function B(...e) {
1758
- let t = {}, n = {}, r = {}, i = [], a = /* @__PURE__ */ new Set();
1759
- for (let o of e) {
1760
- for (let e of Object.keys(o.policy.components)) e in n && D(`component tag "${e}" is registered more than once.`), n[e] = o.policy.components[e], t[e] = o.implementation[e], r[e] = o.authoring[e];
1761
- for (let e of o.recipes) a.has(e.id) && D(`recipe id "${e.id}" is registered more than once.`), a.add(e.id), i.push(e);
1762
- }
1763
- return await L({
1764
- authoring: r,
1765
- implementation: t,
1766
- policy: {
1767
- version: 2,
1768
- components: n
1769
- },
1770
- recipes: i,
1771
- version: 1
1772
- });
1773
- }
1774
- async function V() {
1775
- return await L(T);
1776
- }
1777
- //#endregion
1778
- export { p as a, R as i, L as n, f as o, V as r, T as s, B as t };
1779
-
1780
- //# sourceMappingURL=authoring-D7MJezVG.js.map