@glw907/cairn-cms 0.9.0 → 0.10.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 (55) hide show
  1. package/dist/components/ComponentForm.svelte +178 -0
  2. package/dist/components/ComponentForm.svelte.d.ts +20 -0
  3. package/dist/components/ComponentForm.svelte.d.ts.map +1 -0
  4. package/dist/components/ComponentInsertDialog.svelte +92 -0
  5. package/dist/components/ComponentInsertDialog.svelte.d.ts +20 -0
  6. package/dist/components/ComponentInsertDialog.svelte.d.ts.map +1 -0
  7. package/dist/components/EditPage.svelte +6 -3
  8. package/dist/components/EditPage.svelte.d.ts +3 -0
  9. package/dist/components/EditPage.svelte.d.ts.map +1 -1
  10. package/dist/components/IconPicker.svelte +51 -0
  11. package/dist/components/IconPicker.svelte.d.ts +20 -0
  12. package/dist/components/IconPicker.svelte.d.ts.map +1 -0
  13. package/dist/components/index.d.ts +3 -1
  14. package/dist/components/index.d.ts.map +1 -1
  15. package/dist/components/index.js +3 -1
  16. package/dist/content/compose.d.ts.map +1 -1
  17. package/dist/content/compose.js +1 -0
  18. package/dist/content/types.d.ts +5 -0
  19. package/dist/content/types.d.ts.map +1 -1
  20. package/dist/index.d.ts +8 -2
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +5 -1
  23. package/dist/render/component-grammar.d.ts +10 -0
  24. package/dist/render/component-grammar.d.ts.map +1 -0
  25. package/dist/render/component-grammar.js +140 -0
  26. package/dist/render/component-insert.d.ts +14 -0
  27. package/dist/render/component-insert.d.ts.map +1 -0
  28. package/dist/render/component-insert.js +9 -0
  29. package/dist/render/component-reference.d.ts +11 -0
  30. package/dist/render/component-reference.d.ts.map +1 -0
  31. package/dist/render/component-reference.js +34 -0
  32. package/dist/render/component-validate.d.ts +10 -0
  33. package/dist/render/component-validate.d.ts.map +1 -0
  34. package/dist/render/component-validate.js +30 -0
  35. package/dist/render/registry.d.ts +45 -1
  36. package/dist/render/registry.d.ts.map +1 -1
  37. package/dist/render/registry.js +13 -0
  38. package/package.json +2 -1
  39. package/src/lib/components/ComponentForm.svelte +178 -0
  40. package/src/lib/components/ComponentInsertDialog.svelte +92 -0
  41. package/src/lib/components/EditPage.svelte +6 -3
  42. package/src/lib/components/IconPicker.svelte +51 -0
  43. package/src/lib/components/index.ts +3 -1
  44. package/src/lib/content/compose.ts +1 -0
  45. package/src/lib/content/types.ts +5 -0
  46. package/src/lib/index.ts +16 -2
  47. package/src/lib/render/component-grammar.ts +167 -0
  48. package/src/lib/render/component-insert.ts +15 -0
  49. package/src/lib/render/component-reference.ts +38 -0
  50. package/src/lib/render/component-validate.ts +36 -0
  51. package/src/lib/render/registry.ts +61 -1
  52. package/dist/components/ComponentPalette.svelte +0 -50
  53. package/dist/components/ComponentPalette.svelte.d.ts +0 -16
  54. package/dist/components/ComponentPalette.svelte.d.ts.map +0 -1
  55. package/src/lib/components/ComponentPalette.svelte +0 -50
@@ -0,0 +1,178 @@
1
+ <!--
2
+ @component
3
+ The schema-driven fill form for one component. It holds the working ComponentValues, seeded from
4
+ emptyValues(def), and renders attribute fields and the title/body and other non-repeatable slots.
5
+ Submit (Task 6) serializes and validates through buildComponentInsert and calls onInsert with the
6
+ markdown. Back returns to the picker. This is not a nested HTML form; Insert calls a callback.
7
+ -->
8
+ <script lang="ts">
9
+ import { untrack } from 'svelte';
10
+ import { emptyValues, type ComponentDef } from '../render/registry.js';
11
+ import { buildComponentInsert } from '../render/component-insert.js';
12
+ import type { IconSet } from '../render/glyph.js';
13
+ import IconPicker from './IconPicker.svelte';
14
+
15
+ interface Props {
16
+ def: ComponentDef;
17
+ icons?: IconSet;
18
+ /** Called with the serialized markdown when the form validates. */
19
+ onInsert: (markdown: string) => void;
20
+ /** Return to the picker. */
21
+ onBack: () => void;
22
+ }
23
+
24
+ let { def, icons, onInsert, onBack }: Props = $props();
25
+
26
+ // Working values, seeded once from the schema. $state makes the nested records deeply reactive.
27
+ // untrack marks the seed as a deliberate one-time read of the initial def, not a reactive miss.
28
+ let values = $state(untrack(() => emptyValues(def)));
29
+
30
+ const attributes = $derived(def.attributes ?? []);
31
+ // Non-repeatable slots render here; the repeatable list is handled separately.
32
+ const flatSlots = $derived((def.slots ?? []).filter((s) => s.kind !== 'repeatable'));
33
+ const repeatableSlots = $derived((def.slots ?? []).filter((s) => s.kind === 'repeatable'));
34
+
35
+ // The live $state proxy array for a repeatable slot, so push/splice stay reactive.
36
+ function slotItems(name: string): string[] {
37
+ const v = values.slots[name];
38
+ return Array.isArray(v) ? v : [];
39
+ }
40
+
41
+ // Typed accessors over the unions so explicit value targets stay sound.
42
+ function asString(key: string): string {
43
+ const v = values.attributes[key];
44
+ return typeof v === 'string' ? v : '';
45
+ }
46
+ function asBool(key: string): boolean {
47
+ return values.attributes[key] === true;
48
+ }
49
+ function slotString(name: string): string {
50
+ const v = values.slots[name];
51
+ return typeof v === 'string' ? v : '';
52
+ }
53
+
54
+ // Field-keyed validation errors from the last submit, keyed by attribute key or slot name.
55
+ let errors = $state<Record<string, string>>({});
56
+
57
+ // Serialize and validate through the pure helper. On success clear errors and emit the markdown;
58
+ // on failure keep the field-keyed errors so each field can show its message and insert nothing.
59
+ async function submit() {
60
+ const result = await buildComponentInsert(def, values);
61
+ if (result.ok) {
62
+ errors = {};
63
+ onInsert(result.markdown);
64
+ } else {
65
+ errors = result.errors;
66
+ }
67
+ }
68
+ </script>
69
+
70
+ <div class="flex flex-col gap-3">
71
+ <div class="flex items-center justify-between">
72
+ <h3 class="text-sm font-semibold">{def.label}</h3>
73
+ <button type="button" class="btn btn-ghost btn-xs" onclick={onBack}>Back</button>
74
+ </div>
75
+
76
+ {#each attributes as field (field.key)}
77
+ {#if field.type === 'boolean'}
78
+ <label class="label cursor-pointer justify-start gap-2">
79
+ <input
80
+ class="checkbox checkbox-sm"
81
+ type="checkbox"
82
+ aria-label={field.label}
83
+ aria-invalid={Boolean(errors[field.key])}
84
+ aria-describedby={errors[field.key] ? `err-${field.key}` : undefined}
85
+ checked={asBool(field.key)}
86
+ onchange={(e) => (values.attributes[field.key] = e.currentTarget.checked)}
87
+ />
88
+ <span class="text-sm">{field.label}</span>
89
+ </label>
90
+ {:else if field.type === 'select'}
91
+ <label class="flex flex-col gap-1">
92
+ <span class="text-sm font-medium">{field.label}</span>
93
+ <select
94
+ class="select"
95
+ aria-label={field.label}
96
+ aria-invalid={Boolean(errors[field.key])}
97
+ aria-describedby={errors[field.key] ? `err-${field.key}` : undefined}
98
+ value={asString(field.key)}
99
+ onchange={(e) => (values.attributes[field.key] = e.currentTarget.value)}
100
+ >
101
+ {#if !field.required}<option value="">—</option>{/if}
102
+ {#each field.options ?? [] as opt (opt)}<option value={opt}>{opt}</option>{/each}
103
+ </select>
104
+ </label>
105
+ {:else if field.type === 'icon' && icons}
106
+ <div class="flex flex-col gap-1">
107
+ <span class="text-sm font-medium">{field.label}</span>
108
+ <IconPicker
109
+ {icons}
110
+ value={asString(field.key)}
111
+ required={field.required ?? false}
112
+ onChange={(name) => (values.attributes[field.key] = name)}
113
+ />
114
+ </div>
115
+ {:else}
116
+ <label class="flex flex-col gap-1">
117
+ <span class="text-sm font-medium">{field.label}</span>
118
+ <input
119
+ class="input"
120
+ aria-label={field.label}
121
+ aria-invalid={Boolean(errors[field.key])}
122
+ aria-describedby={errors[field.key] ? `err-${field.key}` : undefined}
123
+ value={asString(field.key)}
124
+ oninput={(e) => (values.attributes[field.key] = e.currentTarget.value)}
125
+ />
126
+ </label>
127
+ {/if}
128
+ {#if errors[field.key]}<span id={`err-${field.key}`} role="alert" class="text-error text-xs">{errors[field.key]}</span>{/if}
129
+ {/each}
130
+
131
+ {#each flatSlots as slot (slot.name)}
132
+ {#if slot.kind === 'markdown'}
133
+ <label class="flex flex-col gap-1">
134
+ <span class="text-sm font-medium">{slot.label}</span>
135
+ <textarea
136
+ class="textarea"
137
+ aria-label={slot.label}
138
+ aria-invalid={Boolean(errors[slot.name])}
139
+ aria-describedby={errors[slot.name] ? `err-${slot.name}` : undefined}
140
+ rows={3}
141
+ value={slotString(slot.name)}
142
+ oninput={(e) => (values.slots[slot.name] = e.currentTarget.value)}
143
+ ></textarea>
144
+ </label>
145
+ {:else}
146
+ <label class="flex flex-col gap-1">
147
+ <span class="text-sm font-medium">{slot.label}</span>
148
+ <input
149
+ class="input"
150
+ aria-label={slot.label}
151
+ aria-invalid={Boolean(errors[slot.name])}
152
+ aria-describedby={errors[slot.name] ? `err-${slot.name}` : undefined}
153
+ value={slotString(slot.name)}
154
+ oninput={(e) => (values.slots[slot.name] = e.currentTarget.value)}
155
+ />
156
+ </label>
157
+ {/if}
158
+ {#if errors[slot.name]}<span id={`err-${slot.name}`} role="alert" class="text-error text-xs">{errors[slot.name]}</span>{/if}
159
+ {/each}
160
+
161
+ {#each repeatableSlots as slot (slot.name)}
162
+ {@const items = slotItems(slot.name)}
163
+ <fieldset class="rounded-box border border-base-300 flex flex-col gap-2 p-2">
164
+ <legend class="text-sm font-medium">{slot.label}</legend>
165
+ <!-- Index key is deliberate: items are bare strings with no stable id, so the value bindings and splice/push are index-based by design. -->
166
+ {#each items as _, i (i)}
167
+ <div class="flex items-center gap-2">
168
+ <input class="input input-sm flex-1" aria-label={`${slot.label} item`} bind:value={items[i]} />
169
+ <button type="button" class="btn btn-ghost btn-sm" aria-label={`Remove item ${i + 1}`} onclick={() => items.splice(i, 1)}>✕</button>
170
+ </div>
171
+ {/each}
172
+ <button type="button" class="btn btn-sm self-start" onclick={() => items.push('')}>Add item</button>
173
+ {#if errors[slot.name]}<span id={`err-${slot.name}`} role="alert" class="text-error text-xs">{errors[slot.name]}</span>{/if}
174
+ </fieldset>
175
+ {/each}
176
+
177
+ <button type="button" class="btn btn-primary btn-sm mt-2" onclick={submit}>Insert</button>
178
+ </div>
@@ -0,0 +1,20 @@
1
+ import { type ComponentDef } from '../render/registry.js';
2
+ import type { IconSet } from '../render/glyph.js';
3
+ interface Props {
4
+ def: ComponentDef;
5
+ icons?: IconSet;
6
+ /** Called with the serialized markdown when the form validates. */
7
+ onInsert: (markdown: string) => void;
8
+ /** Return to the picker. */
9
+ onBack: () => void;
10
+ }
11
+ /**
12
+ * The schema-driven fill form for one component. It holds the working ComponentValues, seeded from
13
+ * emptyValues(def), and renders attribute fields and the title/body and other non-repeatable slots.
14
+ * Submit (Task 6) serializes and validates through buildComponentInsert and calls onInsert with the
15
+ * markdown. Back returns to the picker. This is not a nested HTML form; Insert calls a callback.
16
+ */
17
+ declare const ComponentForm: import("svelte").Component<Props, {}, "">;
18
+ type ComponentForm = ReturnType<typeof ComponentForm>;
19
+ export default ComponentForm;
20
+ //# sourceMappingURL=ComponentForm.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentForm.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/components/ComponentForm.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAIhD,UAAU,KAAK;IACb,GAAG,EAAE,YAAY,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mEAAmE;IACnE,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,4BAA4B;IAC5B,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AA8HH;;;;;GAKG;AACH,QAAA,MAAM,aAAa,2CAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
@@ -0,0 +1,92 @@
1
+ <!--
2
+ @component
3
+ The Insert control and its modal. The picker lists each actionable component with its description and
4
+ intended use. A component with a schema opens the guided ComponentForm; a template-only component
5
+ inserts directly; a component with neither is not listed. Built on a native <dialog> for focus
6
+ trapping and Escape, following the dropdown's a11y conventions used elsewhere in the admin.
7
+ -->
8
+ <script lang="ts">
9
+ import type { ComponentRegistry, ComponentDef } from '../render/registry.js';
10
+ import type { IconSet } from '../render/glyph.js';
11
+ import ComponentForm from './ComponentForm.svelte';
12
+
13
+ interface Props {
14
+ /** The site's component registry. */
15
+ registry?: ComponentRegistry;
16
+ /** Insert markdown at the editor cursor. */
17
+ insert: (text: string) => void;
18
+ /** The site's icon set, for icon fields. */
19
+ icons?: IconSet;
20
+ }
21
+
22
+ let { registry, insert, icons }: Props = $props();
23
+
24
+ let dialog = $state<HTMLDialogElement | null>(null);
25
+ let picked = $state<ComponentDef | null>(null);
26
+
27
+ function hasSchema(def: ComponentDef): boolean {
28
+ return (def.attributes?.length ?? 0) > 0 || (def.slots?.length ?? 0) > 0;
29
+ }
30
+ function actionable(def: ComponentDef): boolean {
31
+ return hasSchema(def) || Boolean(def.insertTemplate);
32
+ }
33
+
34
+ const defs = $derived((registry?.defs ?? []).filter(actionable));
35
+
36
+ function open() {
37
+ picked = null;
38
+ dialog?.showModal();
39
+ }
40
+ function close() {
41
+ picked = null;
42
+ dialog?.close();
43
+ }
44
+ function choose(def: ComponentDef) {
45
+ if (hasSchema(def)) {
46
+ picked = def;
47
+ } else {
48
+ insert(def.insertTemplate ?? '');
49
+ close();
50
+ }
51
+ }
52
+ function onInsert(markdown: string) {
53
+ insert(markdown);
54
+ close();
55
+ }
56
+ </script>
57
+
58
+ {#if defs.length > 0}
59
+ <button type="button" class="btn btn-sm btn-ghost" aria-haspopup="dialog" aria-label="Insert component" onclick={open}>Insert</button>
60
+
61
+ <dialog class="modal" aria-labelledby="cairn-insert-dialog-title" bind:this={dialog} onclose={() => (picked = null)}>
62
+ <div class="modal-box">
63
+ <div class="mb-3 flex items-center justify-between">
64
+ <h2 id="cairn-insert-dialog-title" class="text-base font-semibold">Insert component</h2>
65
+ <button type="button" class="btn btn-ghost btn-sm" aria-label="Close" onclick={close}>✕</button>
66
+ </div>
67
+
68
+ {#if picked}
69
+ {#key picked}
70
+ <ComponentForm def={picked} {icons} {onInsert} onBack={() => (picked = null)} />
71
+ {/key}
72
+ {:else}
73
+ <ul class="menu w-full">
74
+ {#each defs as def (def.name)}
75
+ <li>
76
+ <button type="button" onclick={() => choose(def)}>
77
+ <span class="flex flex-col items-start">
78
+ <span class="font-medium">{def.label}</span>
79
+ {#if def.description}<span class="text-xs text-[var(--color-muted)]">{def.description}</span>{/if}
80
+ {#if def.use}<span class="text-xs text-[var(--color-muted)]">{def.use}</span>{/if}
81
+ </span>
82
+ </button>
83
+ </li>
84
+ {/each}
85
+ </ul>
86
+ {/if}
87
+ </div>
88
+ <form method="dialog" class="modal-backdrop">
89
+ <button tabindex="-1" aria-label="Close">close</button>
90
+ </form>
91
+ </dialog>
92
+ {/if}
@@ -0,0 +1,20 @@
1
+ import type { ComponentRegistry } from '../render/registry.js';
2
+ import type { IconSet } from '../render/glyph.js';
3
+ interface Props {
4
+ /** The site's component registry. */
5
+ registry?: ComponentRegistry;
6
+ /** Insert markdown at the editor cursor. */
7
+ insert: (text: string) => void;
8
+ /** The site's icon set, for icon fields. */
9
+ icons?: IconSet;
10
+ }
11
+ /**
12
+ * The Insert control and its modal. The picker lists each actionable component with its description and
13
+ * intended use. A component with a schema opens the guided ComponentForm; a template-only component
14
+ * inserts directly; a component with neither is not listed. Built on a native <dialog> for focus
15
+ * trapping and Escape, following the dropdown's a11y conventions used elsewhere in the admin.
16
+ */
17
+ declare const ComponentInsertDialog: import("svelte").Component<Props, {}, "">;
18
+ type ComponentInsertDialog = ReturnType<typeof ComponentInsertDialog>;
19
+ export default ComponentInsertDialog;
20
+ //# sourceMappingURL=ComponentInsertDialog.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentInsertDialog.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/components/ComponentInsertDialog.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAgB,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAIhD,UAAU,KAAK;IACb,qCAAqC;IACrC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,4CAA4C;IAC5C,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,4CAA4C;IAC5C,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAkFH;;;;;GAKG;AACH,QAAA,MAAM,qBAAqB,2CAAwC,CAAC;AACpE,KAAK,qBAAqB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACtE,eAAe,qBAAqB,CAAC"}
@@ -7,8 +7,9 @@ markdown editor and a live, design-accurate preview. The whole surface is one fo
7
7
  <script lang="ts">
8
8
  import { untrack } from 'svelte';
9
9
  import MarkdownEditor from './MarkdownEditor.svelte';
10
- import ComponentPalette from './ComponentPalette.svelte';
10
+ import ComponentInsertDialog from './ComponentInsertDialog.svelte';
11
11
  import type { ComponentRegistry } from '../render/registry.js';
12
+ import type { IconSet } from '../render/glyph.js';
12
13
  import type { EditData } from '../sveltekit/content-routes.js';
13
14
  import type { TextareaField, TagsField, FreeTagsField } from '../content/types.js';
14
15
  import { sanitizePreviewHtml } from '../render/sanitize.js';
@@ -20,9 +21,11 @@ markdown editor and a live, design-accurate preview. The whole surface is one fo
20
21
  registry?: ComponentRegistry;
21
22
  /** The site's design-accurate render pipeline; the preview pane sanitizes its output. */
22
23
  render?: (md: string, opts?: { stagger?: boolean }) => string | Promise<string>;
24
+ /** The site's icon set, for the guided form's icon fields. */
25
+ icons?: IconSet;
23
26
  }
24
27
 
25
- let { data, registry, render }: Props = $props();
28
+ let { data, registry, render, icons }: Props = $props();
26
29
 
27
30
  // `body` is local editor state seeded once from the prop; it diverges as the user types.
28
31
  // untrack() captures the initial value without subscribing to future prop changes.
@@ -76,7 +79,7 @@ markdown editor and a live, design-accurate preview. The whole surface is one fo
76
79
  <p class="text-xs text-[var(--color-muted)]">{data.label}: {data.id}</p>
77
80
  </div>
78
81
  <div class="flex items-center gap-2">
79
- <ComponentPalette {registry} {insert} />
82
+ <ComponentInsertDialog {registry} {insert} {icons} />
80
83
  <button
81
84
  type="button"
82
85
  class="btn btn-sm btn-ghost"
@@ -1,4 +1,5 @@
1
1
  import type { ComponentRegistry } from '../render/registry.js';
2
+ import type { IconSet } from '../render/glyph.js';
2
3
  import type { EditData } from '../sveltekit/content-routes.js';
3
4
  interface Props {
4
5
  /** The edit load's data, plus the site name for the heading. */
@@ -11,6 +12,8 @@ interface Props {
11
12
  render?: (md: string, opts?: {
12
13
  stagger?: boolean;
13
14
  }) => string | Promise<string>;
15
+ /** The site's icon set, for the guided form's icon fields. */
16
+ icons?: IconSet;
14
17
  }
15
18
  /**
16
19
  * The differentiated editor: the per-concept frontmatter form (from `data.fields`) beside the
@@ -1 +1 @@
1
- {"version":3,"file":"EditPage.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/components/EditPage.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAK7D,UAAU,KAAK;IACb,gEAAgE;IAChE,IAAI,EAAE,QAAQ,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,yFAAyF;IACzF,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACjF;AAqJH;;;;GAIG;AACH,QAAA,MAAM,QAAQ,2CAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"EditPage.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/components/EditPage.svelte.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAK7D,UAAU,KAAK;IACb,gEAAgE;IAChE,IAAI,EAAE,QAAQ,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,yFAAyF;IACzF,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAChF,8DAA8D;IAC9D,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAsJH;;;;GAIG;AACH,QAAA,MAAM,QAAQ,2CAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,51 @@
1
+ <!--
2
+ @component
3
+ A visual icon choice over the site's IconSet. Each glyph is a toggle button; the selected one carries
4
+ aria-pressed. When the field is optional, a None button clears the value. The glyph renders inline from
5
+ the IconSet path data, matching the renderer's 256-unit viewBox.
6
+ -->
7
+ <script lang="ts">
8
+ import type { IconSet } from '../render/glyph.js';
9
+
10
+ interface Props {
11
+ /** The site's glyph name to SVG path-data map. */
12
+ icons: IconSet;
13
+ /** The currently selected glyph name, or '' for none. */
14
+ value: string;
15
+ /** When false, a None choice is offered. */
16
+ required: boolean;
17
+ /** Called with the new glyph name (or '' for none). */
18
+ onChange: (name: string) => void;
19
+ }
20
+
21
+ let { icons, value, required, onChange }: Props = $props();
22
+
23
+ const names = $derived(Object.keys(icons));
24
+ </script>
25
+
26
+ <div class="flex flex-wrap gap-2" role="group" aria-label="Icon">
27
+ {#if !required}
28
+ <button
29
+ type="button"
30
+ class="btn btn-sm"
31
+ class:btn-primary={value === ''}
32
+ aria-pressed={value === ''}
33
+ onclick={() => onChange('')}
34
+ >None</button>
35
+ {/if}
36
+ {#each names as name (name)}
37
+ <button
38
+ type="button"
39
+ class="btn btn-sm gap-1"
40
+ class:btn-primary={value === name}
41
+ aria-pressed={value === name}
42
+ aria-label={name}
43
+ onclick={() => onChange(name)}
44
+ >
45
+ <svg class="ec-glyph" viewBox="0 0 256 256" fill="currentColor" aria-hidden="true" width="16" height="16">
46
+ <path d={icons[name]} />
47
+ </svg>
48
+ <span class="text-xs">{name}</span>
49
+ </button>
50
+ {/each}
51
+ </div>
@@ -0,0 +1,20 @@
1
+ import type { IconSet } from '../render/glyph.js';
2
+ interface Props {
3
+ /** The site's glyph name to SVG path-data map. */
4
+ icons: IconSet;
5
+ /** The currently selected glyph name, or '' for none. */
6
+ value: string;
7
+ /** When false, a None choice is offered. */
8
+ required: boolean;
9
+ /** Called with the new glyph name (or '' for none). */
10
+ onChange: (name: string) => void;
11
+ }
12
+ /**
13
+ * A visual icon choice over the site's IconSet. Each glyph is a toggle button; the selected one carries
14
+ * aria-pressed. When the field is optional, a None button clears the value. The glyph renders inline from
15
+ * the IconSet path data, matching the renderer's 256-unit viewBox.
16
+ */
17
+ declare const IconPicker: import("svelte").Component<Props, {}, "">;
18
+ type IconPicker = ReturnType<typeof IconPicker>;
19
+ export default IconPicker;
20
+ //# sourceMappingURL=IconPicker.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconPicker.svelte.d.ts","sourceRoot":"","sources":["../../src/lib/components/IconPicker.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGhD,UAAU,KAAK;IACb,kDAAkD;IAClD,KAAK,EAAE,OAAO,CAAC;IACf,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,QAAQ,EAAE,OAAO,CAAC;IAClB,uDAAuD;IACvD,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AA2BH;;;;GAIG;AACH,QAAA,MAAM,UAAU,2CAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
@@ -5,6 +5,8 @@ export { default as ConceptList } from './ConceptList.svelte';
5
5
  export { default as EditPage } from './EditPage.svelte';
6
6
  export { default as ManageEditors } from './ManageEditors.svelte';
7
7
  export { default as MarkdownEditor } from './MarkdownEditor.svelte';
8
- export { default as ComponentPalette } from './ComponentPalette.svelte';
8
+ export { default as ComponentInsertDialog } from './ComponentInsertDialog.svelte';
9
+ export { default as ComponentForm } from './ComponentForm.svelte';
10
+ export { default as IconPicker } from './IconPicker.svelte';
9
11
  export { default as NavTree } from './NavTree.svelte';
10
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/components/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/components/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC"}
@@ -7,5 +7,7 @@ export { default as ConceptList } from './ConceptList.svelte';
7
7
  export { default as EditPage } from './EditPage.svelte';
8
8
  export { default as ManageEditors } from './ManageEditors.svelte';
9
9
  export { default as MarkdownEditor } from './MarkdownEditor.svelte';
10
- export { default as ComponentPalette } from './ComponentPalette.svelte';
10
+ export { default as ComponentInsertDialog } from './ComponentInsertDialog.svelte';
11
+ export { default as ComponentForm } from './ComponentForm.svelte';
12
+ export { default as IconPicker } from './IconPicker.svelte';
11
13
  export { default as NavTree } from './NavTree.svelte';
@@ -1 +1 @@
1
- {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/lib/content/compose.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAc,YAAY,EAAE,cAAc,EAAE,YAAY,EAAiB,gBAAgB,EAAgB,MAAM,YAAY,CAAC;AAGxI;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,YAAY,EACrB,UAAU,GAAE,cAAc,EAAO,EACjC,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAM,GAC3D,YAAY,CAuBd"}
1
+ {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/lib/content/compose.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAc,YAAY,EAAE,cAAc,EAAE,YAAY,EAAiB,gBAAgB,EAAgB,MAAM,YAAY,CAAC;AAGxI;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,YAAY,EACrB,UAAU,GAAE,cAAc,EAAO,EACjC,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAM,GAC3D,YAAY,CAwBd"}
@@ -24,6 +24,7 @@ export function composeRuntime(adapter, extensions = [], urlPolicy = {}) {
24
24
  sender: adapter.sender,
25
25
  render: adapter.render,
26
26
  registry: adapter.registry,
27
+ icons: adapter.icons,
27
28
  navMenu: adapter.navMenu,
28
29
  assets: adapter.assets,
29
30
  adminPanels,
@@ -1,4 +1,5 @@
1
1
  import type { ComponentRegistry } from '../render/registry.js';
2
+ import type { IconSet } from '../render/glyph.js';
2
3
  import type { DatePrefix } from './ids.js';
3
4
  /** Common to every frontmatter field: the frontmatter key, the form label, and whether it is required. */
4
5
  interface FieldBase {
@@ -131,6 +132,8 @@ export interface CairnAdapter {
131
132
  }): string | Promise<string>;
132
133
  /** Directive component registry; the renderer and the future palette derive from it (seam 3). */
133
134
  registry?: ComponentRegistry;
135
+ /** The site's glyph name to SVG path-data map, for the admin icon picker and the renderer. */
136
+ icons?: IconSet;
134
137
  navMenu?: NavMenuConfig;
135
138
  assets?: AssetConfig;
136
139
  }
@@ -219,6 +222,8 @@ export interface CairnRuntime {
219
222
  stagger?: boolean;
220
223
  }): string | Promise<string>;
221
224
  registry?: ComponentRegistry;
225
+ /** The site's glyph name to SVG path-data map, for the admin icon picker and the renderer. */
226
+ icons?: IconSet;
222
227
  navMenu?: NavMenuConfig;
223
228
  assets?: AssetConfig;
224
229
  /** Admin panels contributed by extensions (Mode 2). Empty until Plan 09 wires the dispatch route. */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/content/types.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,0GAA0G;AAC1G,UAAU,SAAS;IACjB,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,gCAAgC;AAChC,MAAM,WAAW,SAAU,SAAQ,SAAS;IAC1C,IAAI,EAAE,MAAM,CAAC;CACd;AACD,+BAA+B;AAC/B,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,IAAI,EAAE,UAAU,CAAC;IACjB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AACD,iCAAiC;AACjC,MAAM,WAAW,SAAU,SAAQ,SAAS;IAC1C,IAAI,EAAE,MAAM,CAAC;CACd;AACD,sCAAsC;AACtC,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C,IAAI,EAAE,SAAS,CAAC;CACjB;AACD,sEAAsE;AACtE,MAAM,WAAW,SAAU,SAAQ,SAAS;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5B;AACD,iE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CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,EAAE,YAAY,CAAC;IACrB,qGAAqG;IACrG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3E,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,8FAA8F;IAC9F,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,qGAAqG;IACrG,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,mGAAmG;IACnG,UAAU,CAAC,EAAE,YAAY,EAAE,CAAC;CAC7B"}
package/dist/index.d.ts CHANGED
@@ -9,8 +9,14 @@ export { frontmatterFromForm, dateInputValue, serializeMarkdown, parseMarkdown,
9
9
  export { validateFields } from './content/validate.js';
10
10
  export { isValidId, idFromFilename, filenameFromId, slugify, slugFromId, composeDatedId, } from './content/ids.js';
11
11
  export type { DatePrefix } from './content/ids.js';
12
- export { defineRegistry } from './render/registry.js';
13
- export type { ComponentDef, ComponentRegistry } from './render/registry.js';
12
+ export { defineRegistry, emptyValues } from './render/registry.js';
13
+ export type { ComponentDef, ComponentRegistry, FieldType, AttributeField, SlotKind, SlotDef, ComponentValues, } from './render/registry.js';
14
+ export { serializeComponent, parseComponent } from './render/component-grammar.js';
15
+ export { validateComponent } from './render/component-validate.js';
16
+ export type { ComponentValidation } from './render/component-validate.js';
17
+ export { buildComponentInsert, type ComponentInsert } from './render/component-insert.js';
18
+ export { generateComponentReference } from './render/component-reference.js';
19
+ export type { ReferenceOptions } from './render/component-reference.js';
14
20
  export { glyph } from './render/glyph.js';
15
21
  export type { IconSet } from './render/glyph.js';
16
22
  export { remarkDirectiveStamp } from './render/remark-directives.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC7D,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGnE,YAAY,EACV,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,SAAS,EACT,YAAY,EACZ,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,UAAU,EACV,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EACL,SAAS,EACT,cAAc,EACd,cAAc,EACd,OAAO,EACP,UAAU,EACV,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,YAAY,EAAE,iBAAiB,EA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S,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,YAAY,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC"}
package/dist/index.js CHANGED
@@ -8,7 +8,11 @@ export { frontmatterFromForm, dateInputValue, serializeMarkdown, parseMarkdown,
8
8
  export { validateFields } from './content/validate.js';
9
9
  export { isValidId, idFromFilename, filenameFromId, slugify, slugFromId, composeDatedId, } from './content/ids.js';
10
10
  // Render engine (Plan 04): generic directive pipeline; sites own the component registry.
11
- export { defineRegistry } from './render/registry.js';
11
+ export { defineRegistry, emptyValues } from './render/registry.js';
12
+ export { serializeComponent, parseComponent } from './render/component-grammar.js';
13
+ export { validateComponent } from './render/component-validate.js';
14
+ export { buildComponentInsert } from './render/component-insert.js';
15
+ export { generateComponentReference } from './render/component-reference.js';
12
16
  export { glyph } from './render/glyph.js';
13
17
  export { remarkDirectiveStamp } from './render/remark-directives.js';
14
18
  export { rehypeDispatch, isElement, strProp, iconSpan, splitHead, cardShell, markFirstList, } from './render/rehype-dispatch.js';
@@ -0,0 +1,10 @@
1
+ import type { ComponentDef, ComponentValues } from './registry.js';
2
+ export declare function serializeComponent(def: ComponentDef, values: ComponentValues): string;
3
+ /** Parse a serialized component directive back into guided-form values, the inverse of
4
+ * {@link serializeComponent}. The grammar is reversible, so the editor can round-trip a
5
+ * saved directive through the form. */
6
+ export declare function parseComponent(markdown: string, def: ComponentDef): Promise<ComponentValues>;
7
+ /** The raw attribute keys present on the component's opening directive, read from the parsed tree
8
+ * (quote-aware, unlike a regex over the source). Used by validation to flag unknown keys. */
9
+ export declare function parseRawAttributeKeys(markdown: string, def: ComponentDef): string[];
10
+ //# sourceMappingURL=component-grammar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-grammar.d.ts","sourceRoot":"","sources":["../../src/lib/render/component-grammar.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAW,MAAM,eAAe,CAAC;AA8B5E,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,GAAG,MAAM,CA2BrF;AAwBD;;wCAEwC;AACxC,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,CAqClG;AAED;8FAC8F;AAC9F,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,GAAG,MAAM,EAAE,CAMnF"}