@bettercms-ai/kit 3.0.2 → 3.1.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.
- package/dist/brand/logo.js +18 -67
- package/dist/brand/logo.js.map +1 -1
- package/dist/context.js +3 -8
- package/dist/context.js.map +1 -1
- package/dist/controls/button.js +134 -451
- package/dist/controls/button.js.map +1 -1
- package/dist/controls/choice.js +95 -336
- package/dist/controls/choice.js.map +1 -1
- package/dist/controls/code.js +72 -245
- package/dist/controls/code.js.map +1 -1
- package/dist/controls/color.js +31 -108
- package/dist/controls/color.js.map +1 -1
- package/dist/controls/date.js +83 -268
- package/dist/controls/date.js.map +1 -1
- package/dist/controls/form-picker.js +9 -26
- package/dist/controls/form-picker.js.map +1 -1
- package/dist/controls/icon.js +100 -341
- package/dist/controls/icon.js.map +1 -1
- package/dist/controls/json.js +7 -20
- package/dist/controls/json.js.map +1 -1
- package/dist/controls/link.js +156 -561
- package/dist/controls/link.js.map +1 -1
- package/dist/controls/location.js +35 -124
- package/dist/controls/location.js.map +1 -1
- package/dist/controls/media.js +267 -928
- package/dist/controls/media.js.map +1 -1
- package/dist/controls/number.js +23 -80
- package/dist/controls/number.js.map +1 -1
- package/dist/controls/reference.js +155 -516
- package/dist/controls/reference.js.map +1 -1
- package/dist/controls/rich-text/article-shell.js +86 -327
- package/dist/controls/rich-text/article-shell.js.map +1 -1
- package/dist/controls/rich-text/author.js +21 -78
- package/dist/controls/rich-text/author.js.map +1 -1
- package/dist/controls/rich-text/blocks.js +317 -1086
- package/dist/controls/rich-text/blocks.js.map +1 -1
- package/dist/controls/rich-text/button.js +10 -31
- package/dist/controls/rich-text/button.js.map +1 -1
- package/dist/controls/rich-text/catalog.js +51 -168
- package/dist/controls/rich-text/catalog.js.map +1 -1
- package/dist/controls/rich-text/columns.js +31 -104
- package/dist/controls/rich-text/columns.js.map +1 -1
- package/dist/controls/rich-text/component-card.js +209 -790
- package/dist/controls/rich-text/component-card.js.map +1 -1
- package/dist/controls/rich-text/component-panel.js +40 -102
- package/dist/controls/rich-text/component-panel.js.map +1 -1
- package/dist/controls/rich-text/control.js +32 -101
- package/dist/controls/rich-text/control.js.map +1 -1
- package/dist/controls/rich-text/editor.js +108 -369
- package/dist/controls/rich-text/editor.js.map +1 -1
- package/dist/controls/rich-text/embed.js +51 -184
- package/dist/controls/rich-text/embed.js.map +1 -1
- package/dist/controls/rich-text/floating.js +42 -171
- package/dist/controls/rich-text/floating.js.map +1 -1
- package/dist/controls/rich-text/footnote.js +28 -89
- package/dist/controls/rich-text/footnote.js.map +1 -1
- package/dist/controls/rich-text/gallery.js +27 -88
- package/dist/controls/rich-text/gallery.js.map +1 -1
- package/dist/controls/rich-text/link-form.d.ts +10 -0
- package/dist/controls/rich-text/link-form.js +16 -204
- package/dist/controls/rich-text/link-form.js.map +1 -1
- package/dist/controls/rich-text/plain.js +3 -8
- package/dist/controls/rich-text/plain.js.map +1 -1
- package/dist/controls/rich-text/related.js +25 -86
- package/dist/controls/rich-text/related.js.map +1 -1
- package/dist/controls/rich-text/toc.js +15 -48
- package/dist/controls/rich-text/toc.js.map +1 -1
- package/dist/controls/rich-text/toolbar.js +105 -402
- package/dist/controls/rich-text/toolbar.js.map +1 -1
- package/dist/controls/scale.js +52 -169
- package/dist/controls/scale.js.map +1 -1
- package/dist/controls/slot.js +73 -238
- package/dist/controls/slot.js.map +1 -1
- package/dist/controls/table/table-editor.js +500 -1766
- package/dist/controls/table/table-editor.js.map +1 -1
- package/dist/controls/table/table-link.js +41 -121
- package/dist/controls/table/table-link.js.map +1 -1
- package/dist/controls/table/table.js +9 -26
- package/dist/controls/table/table.js.map +1 -1
- package/dist/controls/text.js +68 -221
- package/dist/controls/text.js.map +1 -1
- package/dist/controls/unknown-value.js +22 -79
- package/dist/controls/unknown-value.js.map +1 -1
- package/dist/engine/array.js +228 -821
- package/dist/engine/array.js.map +1 -1
- package/dist/engine/bits.js +13 -38
- package/dist/engine/bits.js.map +1 -1
- package/dist/engine/breadcrumb.js +8 -25
- package/dist/engine/breadcrumb.js.map +1 -1
- package/dist/engine/expand.js +13 -38
- package/dist/engine/expand.js.map +1 -1
- package/dist/engine/field-list.js +5 -14
- package/dist/engine/field-list.js.map +1 -1
- package/dist/engine/field-shell.js +244 -849
- package/dist/engine/field-shell.js.map +1 -1
- package/dist/engine/frame.js +78 -275
- package/dist/engine/frame.js.map +1 -1
- package/dist/engine/grouping.js +193 -630
- package/dist/engine/grouping.js.map +1 -1
- package/dist/engine/item-list.js +50 -187
- package/dist/engine/item-list.js.map +1 -1
- package/dist/engine/kit-field.js +95 -320
- package/dist/engine/kit-field.js.map +1 -1
- package/dist/engine/schema-form.js +32 -101
- package/dist/engine/schema-form.js.map +1 -1
- package/dist/engine/slot.js +45 -146
- package/dist/engine/slot.js.map +1 -1
- package/dist/lib/icons.js +5 -14
- package/dist/lib/icons.js.map +1 -1
- package/dist/styles.css +1 -5821
- package/dist/table/table-view.js +16 -49
- package/dist/table/table-view.js.map +1 -1
- package/dist/testing/test-form.js +5 -14
- package/dist/testing/test-form.js.map +1 -1
- package/dist/theme.js +3 -8
- package/dist/theme.js.map +1 -1
- package/dist/ui/action-tray.js +24 -97
- package/dist/ui/action-tray.js.map +1 -1
- package/dist/ui/autocomplete.js +38 -135
- package/dist/ui/autocomplete.js.map +1 -1
- package/dist/ui/button.js +31 -108
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/choice-switch.js +5 -14
- package/dist/ui/choice-switch.js.map +1 -1
- package/dist/ui/controls.js +86 -279
- package/dist/ui/controls.js.map +1 -1
- package/dist/ui/display.js +116 -401
- package/dist/ui/display.js.map +1 -1
- package/dist/ui/expanded-editor-modal.js +27 -100
- package/dist/ui/expanded-editor-modal.js.map +1 -1
- package/dist/ui/floating-panel.js +37 -130
- package/dist/ui/floating-panel.js.map +1 -1
- package/dist/ui/input.js +59 -196
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/mode-bar.js +11 -32
- package/dist/ui/mode-bar.js.map +1 -1
- package/dist/ui/overlay.js +176 -613
- package/dist/ui/overlay.js.map +1 -1
- package/dist/ui/path-crumbs.js +113 -374
- package/dist/ui/path-crumbs.js.map +1 -1
- package/dist/ui/select.js +78 -311
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/shortcut-hint.js +6 -19
- package/dist/ui/shortcut-hint.js.map +1 -1
- package/dist/ui/spinner.js +7 -20
- package/dist/ui/spinner.js.map +1 -1
- package/dist/ui/split-button.js +10 -35
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/tab.js +17 -50
- package/dist/ui/tab.js.map +1 -1
- package/dist/ui/toast.js +30 -107
- package/dist/ui/toast.js.map +1 -1
- package/dist/ui/tooltip-root.js +7 -24
- package/dist/ui/tooltip-root.js.map +1 -1
- package/package.json +2 -2
package/dist/controls/slot.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Button } from "../ui/button.js";
|
|
|
6
6
|
import { Popover, PopoverContent, PopoverTrigger } from "../ui/overlay.js";
|
|
7
7
|
import { RowList, useListOps } from "../engine/array.js";
|
|
8
8
|
import * as React from "react";
|
|
9
|
-
import {
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { IconPlus, IconSearch } from "@tabler/icons-react";
|
|
11
11
|
//#region src/controls/slot.tsx
|
|
12
12
|
/**
|
|
@@ -22,7 +22,6 @@ import { IconPlus, IconSearch } from "@tabler/icons-react";
|
|
|
22
22
|
*
|
|
23
23
|
* Refusals are said in words, never by an inert control: no catalog service, an unreadable stored value, the nesting cap.
|
|
24
24
|
*/
|
|
25
|
-
var _jsxFileName = "D:/Github/bettercms/bettercms-backend/packages/kit/src/controls/slot.tsx";
|
|
26
25
|
/** How many slots deep the control sits: the host's SlotChild editor sits inside a provider one level down. */
|
|
27
26
|
var SlotDepthContext = React.createContext(0);
|
|
28
27
|
var count = (n) => `${n} block${n === 1 ? "" : "s"}`;
|
|
@@ -32,17 +31,13 @@ var NO_CATALOG = {
|
|
|
32
31
|
};
|
|
33
32
|
/** A note in words, labelable and focusable (the field label's `for` lands on it). */
|
|
34
33
|
function SlotNote({ id, children, tone = "muted" }) {
|
|
35
|
-
return /* @__PURE__ */
|
|
34
|
+
return /* @__PURE__ */ jsx("output", {
|
|
36
35
|
id,
|
|
37
36
|
role: "note",
|
|
38
37
|
tabIndex: id ? 0 : void 0,
|
|
39
38
|
className: cn("block rounded-kit-sm text-kit-xs outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-kit-focus-ring focus-visible:[outline-style:solid] [html[data-input-modality=pointer]_&]:focus-visible:outline-none", tone === "warning" ? "text-kit-warning-fg" : "text-kit-fg-3"),
|
|
40
39
|
children
|
|
41
|
-
}
|
|
42
|
-
fileName: _jsxFileName,
|
|
43
|
-
lineNumber: 35,
|
|
44
|
-
columnNumber: 5
|
|
45
|
-
}, this);
|
|
40
|
+
});
|
|
46
41
|
}
|
|
47
42
|
function ComponentSlotControl({ field, value, onChange, readOnly, id, path }) {
|
|
48
43
|
const slot = field.componentSlot ?? {
|
|
@@ -74,14 +69,10 @@ function ComponentSlotControl({ field, value, onChange, readOnly, id, path }) {
|
|
|
74
69
|
}
|
|
75
70
|
};
|
|
76
71
|
const ops = useListOps(opsField, path, items, write);
|
|
77
|
-
if (depth >= 10) return /* @__PURE__ */
|
|
72
|
+
if (depth >= 10) return /* @__PURE__ */ jsx(SlotNote, {
|
|
78
73
|
id,
|
|
79
74
|
children: "Nested block limit reached. A slot this deep would render as nothing, so it can’t hold more blocks here."
|
|
80
|
-
}
|
|
81
|
-
fileName: _jsxFileName,
|
|
82
|
-
lineNumber: 71,
|
|
83
|
-
columnNumber: 39
|
|
84
|
-
}, this);
|
|
75
|
+
});
|
|
85
76
|
const pick = (componentId) => {
|
|
86
77
|
if (!slot.multiple) {
|
|
87
78
|
const cur = items[0];
|
|
@@ -130,23 +121,15 @@ function ComponentSlotControl({ field, value, onChange, readOnly, id, path }) {
|
|
|
130
121
|
onClick: () => onChange(before)
|
|
131
122
|
} });
|
|
132
123
|
};
|
|
133
|
-
const picker = quickAdd ? /* @__PURE__ */
|
|
124
|
+
const picker = quickAdd ? /* @__PURE__ */ jsxs(Button, {
|
|
134
125
|
size: "lg",
|
|
135
126
|
variant: "ghost",
|
|
136
127
|
className: "text-kit-fg-2",
|
|
137
|
-
leftIcon: /* @__PURE__ */
|
|
138
|
-
fileName: _jsxFileName,
|
|
139
|
-
lineNumber: 120,
|
|
140
|
-
columnNumber: 17
|
|
141
|
-
}, this),
|
|
128
|
+
leftIcon: /* @__PURE__ */ jsx(IconPlus, { stroke: 1.5 }),
|
|
142
129
|
disabled: locked || slot.multiple && items.length >= max,
|
|
143
130
|
onClick: () => addOnly(quickAdd),
|
|
144
131
|
children: ["Add ", quickAdd.title]
|
|
145
|
-
}
|
|
146
|
-
fileName: _jsxFileName,
|
|
147
|
-
lineNumber: 116,
|
|
148
|
-
columnNumber: 5
|
|
149
|
-
}, this) : catalog ? /* @__PURE__ */ jsxDEV(SlotPicker, {
|
|
132
|
+
}) : catalog ? /* @__PURE__ */ jsx(SlotPicker, {
|
|
150
133
|
entries: catalog.entries,
|
|
151
134
|
loading: catalog.loading,
|
|
152
135
|
error: catalog.error,
|
|
@@ -155,16 +138,12 @@ function ComponentSlotControl({ field, value, onChange, readOnly, id, path }) {
|
|
|
155
138
|
label: slot.multiple ? "Add block" : items.length ? "Replace block" : "Choose a block",
|
|
156
139
|
disabled: locked || slot.multiple && items.length >= max,
|
|
157
140
|
onPick: pick
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
lineNumber: 127,
|
|
161
|
-
columnNumber: 5
|
|
162
|
-
}, this) : null;
|
|
163
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
141
|
+
}) : null;
|
|
142
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
164
143
|
className: "flex min-w-0 flex-col gap-1.5",
|
|
165
144
|
"data-slot": "kit-component-slot",
|
|
166
145
|
children: [
|
|
167
|
-
read.unreadable > 0 ? /* @__PURE__ */
|
|
146
|
+
read.unreadable > 0 ? /* @__PURE__ */ jsxs(SlotNote, {
|
|
168
147
|
tone: "warning",
|
|
169
148
|
children: [
|
|
170
149
|
read.unreadable === 1 ? "One child here isn't a block instance" : `${read.unreadable} children here aren't block instances`,
|
|
@@ -172,21 +151,13 @@ function ComponentSlotControl({ field, value, onChange, readOnly, id, path }) {
|
|
|
172
151
|
read.unreadable === 1 ? "it" : "them",
|
|
173
152
|
" on save, so the slot is shown read-only and its value is kept."
|
|
174
153
|
]
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
columnNumber: 9
|
|
179
|
-
}, this) : null,
|
|
180
|
-
read.inherited && items.length === 0 ? /* @__PURE__ */ jsxDEV(SlotNote, { children: "Shows the block’s own content until a block is added here." }, void 0, false, {
|
|
181
|
-
fileName: _jsxFileName,
|
|
182
|
-
lineNumber: 147,
|
|
183
|
-
columnNumber: 47
|
|
184
|
-
}, this) : null,
|
|
185
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
154
|
+
}) : null,
|
|
155
|
+
read.inherited && items.length === 0 ? /* @__PURE__ */ jsx(SlotNote, { children: "Shows the block’s own content until a block is added here." }) : null,
|
|
156
|
+
/* @__PURE__ */ jsx("div", {
|
|
186
157
|
id,
|
|
187
158
|
tabIndex: -1,
|
|
188
159
|
className: "min-w-0 outline-none",
|
|
189
|
-
children: /* @__PURE__ */
|
|
160
|
+
children: /* @__PURE__ */ jsx(RowList, {
|
|
190
161
|
field: opsField,
|
|
191
162
|
rows,
|
|
192
163
|
readOnly: locked,
|
|
@@ -199,89 +170,45 @@ function ComponentSlotControl({ field, value, onChange, readOnly, id, path }) {
|
|
|
199
170
|
renderInline: (r) => {
|
|
200
171
|
const it = r.item;
|
|
201
172
|
const title = r.preview.title;
|
|
202
|
-
if (nameOf(it.componentId).missing) return /* @__PURE__ */
|
|
203
|
-
|
|
204
|
-
lineNumber: 162,
|
|
205
|
-
columnNumber: 56
|
|
206
|
-
}, this);
|
|
207
|
-
if (!SlotChild) return /* @__PURE__ */ jsxDEV(SlotNote, { children: [
|
|
173
|
+
if (nameOf(it.componentId).missing) return /* @__PURE__ */ jsx(SlotNote, { children: "This component no longer exists, so its props can’t be edited. Replace it or remove it." });
|
|
174
|
+
if (!SlotChild) return /* @__PURE__ */ jsxs(SlotNote, { children: [
|
|
208
175
|
"This editor can’t open ",
|
|
209
176
|
title,
|
|
210
177
|
"’s own props."
|
|
211
|
-
] }
|
|
212
|
-
|
|
213
|
-
lineNumber: 163,
|
|
214
|
-
columnNumber: 36
|
|
215
|
-
}, this);
|
|
216
|
-
return /* @__PURE__ */ jsxDEV(SlotDepthContext.Provider, {
|
|
178
|
+
] });
|
|
179
|
+
return /* @__PURE__ */ jsx(SlotDepthContext.Provider, {
|
|
217
180
|
value: depth + 1,
|
|
218
|
-
children: /* @__PURE__ */
|
|
181
|
+
children: /* @__PURE__ */ jsx(SlotChild, {
|
|
219
182
|
componentId: it.componentId,
|
|
220
183
|
title,
|
|
221
184
|
overrides: it.overrides && typeof it.overrides === "object" ? it.overrides : {},
|
|
222
185
|
onChange: (o) => setOverrides(r.index, o),
|
|
223
186
|
readOnly: locked,
|
|
224
187
|
depth: depth + 1
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
lineNumber: 166,
|
|
228
|
-
columnNumber: 17
|
|
229
|
-
}, this)
|
|
230
|
-
}, void 0, false, {
|
|
231
|
-
fileName: _jsxFileName,
|
|
232
|
-
lineNumber: 165,
|
|
233
|
-
columnNumber: 15
|
|
234
|
-
}, this);
|
|
188
|
+
})
|
|
189
|
+
});
|
|
235
190
|
},
|
|
236
|
-
leading: (r) => /* @__PURE__ */
|
|
191
|
+
leading: (r) => /* @__PURE__ */ jsx("span", {
|
|
237
192
|
className: "flex size-7 shrink-0 items-center justify-center rounded-kit-md border border-kit-line bg-kit-control-bg text-kit-fg-2 shadow-kit-xs",
|
|
238
|
-
children: /* @__PURE__ */
|
|
193
|
+
children: /* @__PURE__ */ jsx(KitIcon, {
|
|
239
194
|
name: r.preview.icon,
|
|
240
195
|
className: "size-4"
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
lineNumber: 179,
|
|
244
|
-
columnNumber: 15
|
|
245
|
-
}, this)
|
|
246
|
-
}, void 0, false, {
|
|
247
|
-
fileName: _jsxFileName,
|
|
248
|
-
lineNumber: 178,
|
|
249
|
-
columnNumber: 13
|
|
250
|
-
}, this),
|
|
196
|
+
})
|
|
197
|
+
}),
|
|
251
198
|
emptyLabel: slot.multiple ? "No blocks yet. Add one to start composing." : "No block yet. Choose one to fill this slot.",
|
|
252
|
-
addButton: picker ?? /* @__PURE__ */
|
|
199
|
+
addButton: picker ?? /* @__PURE__ */ jsxs(SlotNote, { children: [
|
|
253
200
|
"No block library is connected to this editor, so ",
|
|
254
201
|
field.title,
|
|
255
202
|
" can’t be changed here."
|
|
256
|
-
] }
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}, this)
|
|
261
|
-
}, void 0, false, {
|
|
262
|
-
fileName: _jsxFileName,
|
|
263
|
-
lineNumber: 149,
|
|
264
|
-
columnNumber: 9
|
|
265
|
-
}, this)
|
|
266
|
-
}, void 0, false, {
|
|
267
|
-
fileName: _jsxFileName,
|
|
268
|
-
lineNumber: 148,
|
|
269
|
-
columnNumber: 7
|
|
270
|
-
}, this),
|
|
271
|
-
slot.multiple ? /* @__PURE__ */ jsxDEV("span", {
|
|
203
|
+
] })
|
|
204
|
+
})
|
|
205
|
+
}),
|
|
206
|
+
slot.multiple ? /* @__PURE__ */ jsxs("span", {
|
|
272
207
|
className: "text-kit-xs text-kit-fg-3",
|
|
273
208
|
children: [items.length >= max ? `This slot holds at most ${count(max)}.` : slot.min > 0 ? `Between ${slot.min} and ${count(max)}.` : `Up to ${count(max)}.`, slot.min > 0 && items.length > 0 && items.length <= slot.min ? ` It needs at least ${slot.min}, so none can be removed.` : ""]
|
|
274
|
-
}
|
|
275
|
-
fileName: _jsxFileName,
|
|
276
|
-
lineNumber: 187,
|
|
277
|
-
columnNumber: 9
|
|
278
|
-
}, this) : null
|
|
209
|
+
}) : null
|
|
279
210
|
]
|
|
280
|
-
}
|
|
281
|
-
fileName: _jsxFileName,
|
|
282
|
-
lineNumber: 140,
|
|
283
|
-
columnNumber: 5
|
|
284
|
-
}, this);
|
|
211
|
+
});
|
|
285
212
|
}
|
|
286
213
|
/**
|
|
287
214
|
* The compact block picker (engine/slot.tsx BlockPicker), over the slot catalog: grouped by family, searchable, ↵ adds.
|
|
@@ -302,49 +229,33 @@ function SlotPicker({ entries, loading, error, note, current, label, disabled, o
|
|
|
302
229
|
setQ("");
|
|
303
230
|
};
|
|
304
231
|
const optionId = (i) => `${listId}-${i}`;
|
|
305
|
-
return /* @__PURE__ */
|
|
232
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
|
306
233
|
open,
|
|
307
234
|
onOpenChange: (o) => {
|
|
308
235
|
setOpen(o);
|
|
309
236
|
setQ("");
|
|
310
237
|
setActive(0);
|
|
311
238
|
},
|
|
312
|
-
children: [/* @__PURE__ */
|
|
313
|
-
render: /* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
240
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
314
241
|
size: "sm",
|
|
315
242
|
variant: "ghost",
|
|
316
243
|
className: "text-kit-fg-2",
|
|
317
|
-
leftIcon: /* @__PURE__ */
|
|
318
|
-
fileName: _jsxFileName,
|
|
319
|
-
lineNumber: 242,
|
|
320
|
-
columnNumber: 101
|
|
321
|
-
}, this),
|
|
244
|
+
leftIcon: /* @__PURE__ */ jsx(IconPlus, { stroke: 1.5 }),
|
|
322
245
|
disabled
|
|
323
|
-
},
|
|
324
|
-
fileName: _jsxFileName,
|
|
325
|
-
lineNumber: 242,
|
|
326
|
-
columnNumber: 31
|
|
327
|
-
}, this),
|
|
246
|
+
}),
|
|
328
247
|
children: label
|
|
329
|
-
},
|
|
330
|
-
fileName: _jsxFileName,
|
|
331
|
-
lineNumber: 242,
|
|
332
|
-
columnNumber: 7
|
|
333
|
-
}, this), /* @__PURE__ */ jsxDEV(PopoverContent, {
|
|
248
|
+
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
334
249
|
className: "w-[300px] p-0",
|
|
335
250
|
align: "start",
|
|
336
251
|
children: [
|
|
337
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ jsxs("label", {
|
|
338
253
|
className: "flex h-10 items-center gap-2 border-b border-kit-line px-3 text-kit-fg-3",
|
|
339
|
-
children: [/* @__PURE__ */
|
|
254
|
+
children: [/* @__PURE__ */ jsx(IconSearch, {
|
|
340
255
|
className: "size-4 shrink-0",
|
|
341
256
|
stroke: 1.5,
|
|
342
257
|
"aria-hidden": true
|
|
343
|
-
},
|
|
344
|
-
fileName: _jsxFileName,
|
|
345
|
-
lineNumber: 245,
|
|
346
|
-
columnNumber: 11
|
|
347
|
-
}, this), /* @__PURE__ */ jsxDEV("input", {
|
|
258
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
348
259
|
autoFocus: true,
|
|
349
260
|
value: q,
|
|
350
261
|
onChange: (e) => {
|
|
@@ -370,64 +281,40 @@ function SlotPicker({ entries, loading, error, note, current, label, disabled, o
|
|
|
370
281
|
"aria-controls": listId,
|
|
371
282
|
"aria-activedescendant": flat.length ? optionId(Math.min(active, flat.length - 1)) : void 0,
|
|
372
283
|
className: "h-full min-w-0 flex-1 bg-transparent text-kit-sm text-kit-fg outline-none placeholder:text-kit-fg-3"
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
columnNumber: 11
|
|
377
|
-
}, this)]
|
|
378
|
-
}, void 0, true, {
|
|
379
|
-
fileName: _jsxFileName,
|
|
380
|
-
lineNumber: 244,
|
|
381
|
-
columnNumber: 9
|
|
382
|
-
}, this),
|
|
383
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
284
|
+
})]
|
|
285
|
+
}),
|
|
286
|
+
/* @__PURE__ */ jsxs("div", {
|
|
384
287
|
id: listId,
|
|
385
288
|
className: "max-h-80 overflow-y-auto p-1",
|
|
386
289
|
role: "listbox",
|
|
387
290
|
"aria-label": "Blocks",
|
|
388
291
|
"aria-busy": loading || void 0,
|
|
389
292
|
children: [
|
|
390
|
-
loading && entries.length === 0 ? /* @__PURE__ */
|
|
293
|
+
loading && entries.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
391
294
|
role: "status",
|
|
392
295
|
className: "px-3 py-6 text-center text-kit-sm text-kit-fg-3",
|
|
393
296
|
children: "Loading blocks…"
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
lineNumber: 276,
|
|
397
|
-
columnNumber: 13
|
|
398
|
-
}, this) : null,
|
|
399
|
-
!loading && !error && flat.length === 0 ? /* @__PURE__ */ jsxDEV("p", {
|
|
297
|
+
}) : null,
|
|
298
|
+
!loading && !error && flat.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
400
299
|
className: "px-3 py-6 text-center text-kit-sm text-kit-fg-3",
|
|
401
300
|
children: entries.length ? "No blocks match" : "This project has no blocks that can go here yet."
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
lineNumber: 280,
|
|
405
|
-
columnNumber: 54
|
|
406
|
-
}, this) : null,
|
|
407
|
-
error ? /* @__PURE__ */ jsxDEV("p", {
|
|
301
|
+
}) : null,
|
|
302
|
+
error ? /* @__PURE__ */ jsx("p", {
|
|
408
303
|
role: "alert",
|
|
409
304
|
className: "px-3 py-3 text-kit-xs text-kit-danger-fg",
|
|
410
305
|
children: error
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
lineNumber: 282,
|
|
414
|
-
columnNumber: 13
|
|
415
|
-
}, this) : null,
|
|
416
|
-
cats.map((c) => /* @__PURE__ */ jsxDEV("div", {
|
|
306
|
+
}) : null,
|
|
307
|
+
cats.map((c) => /* @__PURE__ */ jsxs("div", {
|
|
417
308
|
role: "group",
|
|
418
309
|
"aria-label": c,
|
|
419
310
|
className: "pb-1",
|
|
420
|
-
children: [/* @__PURE__ */
|
|
311
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
421
312
|
"aria-hidden": true,
|
|
422
313
|
className: "px-2 pb-1 pt-1.5 text-kit-2xs font-medium text-kit-fg-3",
|
|
423
314
|
children: c
|
|
424
|
-
},
|
|
425
|
-
fileName: _jsxFileName,
|
|
426
|
-
lineNumber: 288,
|
|
427
|
-
columnNumber: 15
|
|
428
|
-
}, this), list.filter((b) => (b.category || "Blocks") === c).map((b) => {
|
|
315
|
+
}), list.filter((b) => (b.category || "Blocks") === c).map((b) => {
|
|
429
316
|
const i = flat.indexOf(b);
|
|
430
|
-
return /* @__PURE__ */
|
|
317
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
431
318
|
id: optionId(i),
|
|
432
319
|
role: "option",
|
|
433
320
|
"aria-selected": b.id === current,
|
|
@@ -436,94 +323,42 @@ function SlotPicker({ entries, loading, error, note, current, label, disabled, o
|
|
|
436
323
|
onMouseDown: (e) => e.preventDefault(),
|
|
437
324
|
onClick: () => choose(b),
|
|
438
325
|
className: cn("flex w-full items-center gap-2.5 rounded-kit-md p-1.5 text-left", b.insertable ? "cursor-pointer" : "cursor-not-allowed", i === active && "bg-kit-hover"),
|
|
439
|
-
children: [/* @__PURE__ */
|
|
326
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
440
327
|
className: cn("flex size-8 shrink-0 items-center justify-center rounded-kit-md border border-kit-line bg-kit-surface text-kit-fg-2 shadow-kit-xs", !b.insertable && "opacity-50"),
|
|
441
|
-
children: /* @__PURE__ */
|
|
328
|
+
children: /* @__PURE__ */ jsx(KitIcon, {
|
|
442
329
|
name: b.icon ?? "box",
|
|
443
330
|
className: "size-4"
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
lineNumber: 308,
|
|
447
|
-
columnNumber: 25
|
|
448
|
-
}, this)
|
|
449
|
-
}, void 0, false, {
|
|
450
|
-
fileName: _jsxFileName,
|
|
451
|
-
lineNumber: 307,
|
|
452
|
-
columnNumber: 23
|
|
453
|
-
}, this), /* @__PURE__ */ jsxDEV("span", {
|
|
331
|
+
})
|
|
332
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
454
333
|
className: "min-w-0 flex-1",
|
|
455
|
-
children: [/* @__PURE__ */
|
|
334
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
456
335
|
className: cn("block truncate text-kit-sm", b.insertable ? "text-kit-fg" : "text-kit-fg-3"),
|
|
457
336
|
children: b.title
|
|
458
|
-
},
|
|
459
|
-
fileName: _jsxFileName,
|
|
460
|
-
lineNumber: 311,
|
|
461
|
-
columnNumber: 25
|
|
462
|
-
}, this), !b.insertable && b.reason ? /* @__PURE__ */ jsxDEV("span", {
|
|
337
|
+
}), !b.insertable && b.reason ? /* @__PURE__ */ jsx("span", {
|
|
463
338
|
className: "block text-kit-xs text-kit-fg-3",
|
|
464
339
|
children: b.reason
|
|
465
|
-
}
|
|
466
|
-
fileName: _jsxFileName,
|
|
467
|
-
lineNumber: 313,
|
|
468
|
-
columnNumber: 27
|
|
469
|
-
}, this) : b.description ? /* @__PURE__ */ jsxDEV("span", {
|
|
340
|
+
}) : b.description ? /* @__PURE__ */ jsx("span", {
|
|
470
341
|
className: "block truncate text-kit-xs text-kit-fg-3",
|
|
471
342
|
children: b.description
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
columnNumber: 27
|
|
476
|
-
}, this) : null]
|
|
477
|
-
}, void 0, true, {
|
|
478
|
-
fileName: _jsxFileName,
|
|
479
|
-
lineNumber: 310,
|
|
480
|
-
columnNumber: 23
|
|
481
|
-
}, this)]
|
|
482
|
-
}, b.id, true, {
|
|
483
|
-
fileName: _jsxFileName,
|
|
484
|
-
lineNumber: 296,
|
|
485
|
-
columnNumber: 21
|
|
486
|
-
}, this);
|
|
343
|
+
}) : null]
|
|
344
|
+
})]
|
|
345
|
+
}, b.id);
|
|
487
346
|
})]
|
|
488
|
-
}, c
|
|
489
|
-
fileName: _jsxFileName,
|
|
490
|
-
lineNumber: 287,
|
|
491
|
-
columnNumber: 13
|
|
492
|
-
}, this))
|
|
347
|
+
}, c))
|
|
493
348
|
]
|
|
494
|
-
},
|
|
495
|
-
|
|
496
|
-
lineNumber: 274,
|
|
497
|
-
columnNumber: 9
|
|
498
|
-
}, this),
|
|
499
|
-
note ? /* @__PURE__ */ jsxDEV("p", {
|
|
349
|
+
}),
|
|
350
|
+
note ? /* @__PURE__ */ jsx("p", {
|
|
500
351
|
className: "border-t border-kit-line px-3 py-2 text-kit-xs text-kit-fg-3",
|
|
501
352
|
children: note
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
lineNumber: 324,
|
|
505
|
-
columnNumber: 17
|
|
506
|
-
}, this) : null,
|
|
507
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
353
|
+
}) : null,
|
|
354
|
+
/* @__PURE__ */ jsx("div", {
|
|
508
355
|
"data-hint": "shortcuts",
|
|
509
356
|
className: "border-t border-kit-line px-3 py-1.5 text-kit-2xs text-kit-fg-3",
|
|
510
357
|
children: "↵ add · type to search"
|
|
511
|
-
}
|
|
512
|
-
fileName: _jsxFileName,
|
|
513
|
-
lineNumber: 325,
|
|
514
|
-
columnNumber: 9
|
|
515
|
-
}, this)
|
|
358
|
+
})
|
|
516
359
|
]
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
lineNumber: 243,
|
|
520
|
-
columnNumber: 7
|
|
521
|
-
}, this)]
|
|
522
|
-
}, void 0, true, {
|
|
523
|
-
fileName: _jsxFileName,
|
|
524
|
-
lineNumber: 234,
|
|
525
|
-
columnNumber: 5
|
|
526
|
-
}, this);
|
|
360
|
+
})]
|
|
361
|
+
});
|
|
527
362
|
}
|
|
528
363
|
//#endregion
|
|
529
364
|
export { ComponentSlotControl, SlotDepthContext, SlotPicker };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slot.js","names":[],"sources":["../../src/controls/slot.tsx"],"sourcesContent":["/**\n * COMPONENT SLOT — a prop that holds component instances (prod `slot`), on the engine's slot surface (engine/slot.tsx,\n * V2 HEAD 9829bf1): the block rows (icon tile, name, ⋯ menu, drag to reorder) and the compact searchable picker.\n *\n * What differs from V2's block slot is where the rows come from and what they store:\n * - the picker lists the host's slot catalog (`useSlotCatalog`): the project's components with the SERVER's\n * insertability verdict for each; one that can't go here stays in the list, disabled, with the reason under its name;\n * - a row opens in place and edits that child's own props through the host's `SlotChild`;\n * - the value is written in the stored shape (slot-services.ts): one `{ componentId, overrides? }`, or a list of them\n * for a multiple slot, every item spread back with the keys this control does not show (style, window).\n *\n * Refusals are said in words, never by an inert control: no catalog service, an unreadable stored value, the nesting cap.\n */\nimport * as React from \"react\";\nimport { IconPlus, IconSearch } from \"@tabler/icons-react\";\nimport { useKitServices } from \"../context\";\nimport { KitIcon } from \"../lib/icons\";\nimport { cn } from \"../lib/cn\";\nimport { Button } from \"../ui/button\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../ui/overlay\";\nimport { RowList, useListOps, type RowModel } from \"../engine/array\";\nimport type { FieldSchema } from \"../schema/types\";\nimport type { ControlProps } from \"../types\";\nimport { readSlot, slotList, SLOT_DEPTH_MAX, type KitComponentSlot, type KitSlotEntry, type KitSlotItem } from \"./slot-services\";\n\n/** How many slots deep the control sits: the host's SlotChild editor sits inside a provider one level down. */\nexport const SlotDepthContext = React.createContext(0);\n\nconst count = (n: number) => `${n} block${n === 1 ? \"\" : \"s\"}`;\nconst NO_CATALOG = { entries: [] as KitSlotEntry[], nameOf: () => undefined };\n\n/** A note in words, labelable and focusable (the field label's `for` lands on it). */\nfunction SlotNote({ id, children, tone = \"muted\" }: { id?: string; children: React.ReactNode; tone?: \"muted\" | \"warning\" }) {\n return (\n <output\n id={id}\n role=\"note\"\n tabIndex={id ? 0 : undefined}\n className={cn(\n \"block rounded-kit-sm text-kit-xs outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-kit-focus-ring focus-visible:[outline-style:solid] [html[data-input-modality=pointer]_&]:focus-visible:outline-none\",\n tone === \"warning\" ? \"text-kit-warning-fg\" : \"text-kit-fg-3\",\n )}\n >\n {children}\n </output>\n );\n}\n\nexport function ComponentSlotControl({ field, value, onChange, readOnly, id, path }: ControlProps) {\n const slot: KitComponentSlot = field.componentSlot ?? { multiple: false, min: 0, max: 1 };\n const depth = React.useContext(SlotDepthContext);\n const { useSlotCatalog, SlotChild, toast } = useKitServices();\n // a hook service: one identity for the life of the form, so it is called on every render or never\n const catalog = useSlotCatalog ? useSlotCatalog({ componentIds: slot.componentIds }) : null; // eslint-disable-line react-hooks/rules-of-hooks\n const read = readSlot(value);\n const items = read.items;\n const max = slot.multiple ? slot.max : 1;\n const [openId, setOpenId] = React.useState<string | null>(null);\n const nameOf = (componentId: string) => (catalog ?? NO_CATALOG).nameOf(componentId) ?? { title: catalog?.loading ? \"Loading…\" : componentId };\n const locked = readOnly || read.unreadable > 0;\n\n /* writes: the stored shape, never a `_key` (useListOps' duplicate adds one) */\n const write = (next: unknown[]) => {\n setOpenId(null);\n if (slot.multiple) return onChange(slotList(next));\n const [first] = slotList(next);\n onChange(first ?? { componentId: \"\" });\n };\n const opsField: FieldSchema = { ...field, validation: { ...field.validation, min: slot.multiple ? slot.min : 0, max } };\n const ops = useListOps(opsField, path, items, write);\n if (depth >= SLOT_DEPTH_MAX) return <SlotNote id={id}>Nested block limit reached. A slot this deep would render as nothing, so it can’t hold more blocks here.</SlotNote>;\n const pick = (componentId: string) => {\n if (!slot.multiple) {\n const cur = items[0];\n // a different component's overrides are keyed by the old component's props: dropped, never half-applied\n onChange(cur && cur.componentId === componentId ? cur : { componentId });\n setOpenId(null);\n return;\n }\n if (items.length >= max) return;\n onChange([...items, { componentId }]);\n setOpenId(`i${items.length}`);\n };\n const setOverrides = (index: number, overrides: Record<string, unknown>) => {\n const next = items.map((it, i) => (i === index ? { ...it, overrides } : it));\n if (slot.multiple) onChange(next);\n else onChange({ componentId: next[0].componentId, overrides });\n };\n\n const rows: RowModel[] = items.map((it, i) => {\n const name = nameOf(it.componentId);\n const entry = catalog?.entries.find((e) => e.id === it.componentId);\n return {\n id: `i${i}`,\n index: i,\n item: it,\n path: [...path, i],\n preview: { title: name.missing ? \"Missing block\" : name.title, icon: entry?.icon ?? \"box\", empty: false },\n extra: name.missing ? \"Deleted, or not in this project. Replace or remove it.\" : (entry?.category ?? `Block ${i + 1} of ${items.length}`),\n };\n });\n\n /*\n * A slot that takes exactly one block type adds it in one press (V2 content-form.tsx \"Add {child}\"): no picker to\n * choose from a list of one. Not insertable here → the picker, which says why. Undo puts the slot back as it was.\n */\n const only = slot.componentIds?.length === 1 ? catalog?.entries.find((e) => e.id === slot.componentIds![0]) : undefined;\n const quickAdd = only?.insertable && (slot.multiple || items.length === 0) ? only : undefined;\n const addOnly = (entry: KitSlotEntry) => {\n const before = value;\n pick(entry.id);\n toast?.(`${entry.title} added to ${field.title}`, { action: { label: \"Undo\", onClick: () => onChange(before) } });\n };\n\n const picker = quickAdd ? (\n <Button\n size=\"lg\"\n variant=\"ghost\"\n className=\"text-kit-fg-2\"\n leftIcon={<IconPlus stroke={1.5} />}\n disabled={locked || (slot.multiple && items.length >= max)}\n onClick={() => addOnly(quickAdd)}\n >\n Add {quickAdd.title}\n </Button>\n ) : catalog ? (\n <SlotPicker\n entries={catalog.entries}\n loading={catalog.loading}\n error={catalog.error}\n note={catalog.note}\n current={slot.multiple ? undefined : items[0]?.componentId}\n label={slot.multiple ? \"Add block\" : items.length ? \"Replace block\" : \"Choose a block\"}\n disabled={locked || (slot.multiple && items.length >= max)}\n onPick={pick}\n />\n ) : null;\n\n return (\n <div className=\"flex min-w-0 flex-col gap-1.5\" data-slot=\"kit-component-slot\">\n {read.unreadable > 0 ? (\n <SlotNote tone=\"warning\">\n {read.unreadable === 1 ? \"One child here isn't a block instance\" : `${read.unreadable} children here aren't block instances`} (blocks written by another editor). This editor\n would drop {read.unreadable === 1 ? \"it\" : \"them\"} on save, so the slot is shown read-only and its value is kept.\n </SlotNote>\n ) : null}\n {read.inherited && items.length === 0 ? <SlotNote>Shows the block’s own content until a block is added here.</SlotNote> : null}\n <div id={id} tabIndex={-1} className=\"min-w-0 outline-none\">\n <RowList\n field={opsField}\n rows={rows}\n readOnly={locked}\n layout=\"list\"\n mode=\"inline\"\n openId={openId}\n onOpen={(r) => setOpenId(openId === r.id ? null : r.id)}\n onCloseInline={() => setOpenId(null)}\n ops={ops}\n renderInline={(r) => {\n const it = r.item as KitSlotItem;\n const title = r.preview.title;\n if (nameOf(it.componentId).missing) return <SlotNote>This component no longer exists, so its props can’t be edited. Replace it or remove it.</SlotNote>;\n if (!SlotChild) return <SlotNote>This editor can’t open {title}’s own props.</SlotNote>;\n return (\n <SlotDepthContext.Provider value={depth + 1}>\n <SlotChild\n componentId={it.componentId}\n title={title}\n overrides={it.overrides && typeof it.overrides === \"object\" ? it.overrides : {}}\n onChange={(o) => setOverrides(r.index, o)}\n readOnly={locked}\n depth={depth + 1}\n />\n </SlotDepthContext.Provider>\n );\n }}\n leading={(r) => (\n <span className=\"flex size-7 shrink-0 items-center justify-center rounded-kit-md border border-kit-line bg-kit-control-bg text-kit-fg-2 shadow-kit-xs\">\n <KitIcon name={r.preview.icon} className=\"size-4\" />\n </span>\n )}\n emptyLabel={slot.multiple ? \"No blocks yet. Add one to start composing.\" : \"No block yet. Choose one to fill this slot.\"}\n addButton={picker ?? <SlotNote>No block library is connected to this editor, so {field.title} can’t be changed here.</SlotNote>}\n />\n </div>\n {slot.multiple ? (\n <span className=\"text-kit-xs text-kit-fg-3\">\n {items.length >= max ? `This slot holds at most ${count(max)}.` : slot.min > 0 ? `Between ${slot.min} and ${count(max)}.` : `Up to ${count(max)}.`}\n {slot.min > 0 && items.length > 0 && items.length <= slot.min ? ` It needs at least ${slot.min}, so none can be removed.` : \"\"}\n </span>\n ) : null}\n </div>\n );\n}\n\n/**\n * The compact block picker (engine/slot.tsx BlockPicker), over the slot catalog: grouped by family, searchable, ↵ adds.\n * A component the server says can't go here is listed disabled with its reason in place of the description.\n */\nexport function SlotPicker({\n entries,\n loading,\n error,\n note,\n current,\n label,\n disabled,\n onPick,\n}: {\n entries: KitSlotEntry[];\n loading?: boolean;\n error?: string;\n note?: string;\n current?: string;\n label: string;\n disabled?: boolean;\n onPick: (componentId: string) => void;\n}) {\n const [open, setOpen] = React.useState(false);\n const [q, setQ] = React.useState(\"\");\n const [active, setActive] = React.useState(0);\n const listId = React.useId();\n const list = entries.filter((b) => !q || `${b.title} ${b.category ?? \"\"} ${b.description ?? \"\"}`.toLowerCase().includes(q.toLowerCase()));\n const cats = Array.from(new Set(list.map((b) => b.category || \"Blocks\")));\n const flat = cats.flatMap((c) => list.filter((b) => (b.category || \"Blocks\") === c));\n const choose = (b: KitSlotEntry | undefined) => {\n if (!b || !b.insertable) return;\n onPick(b.id);\n setOpen(false);\n setQ(\"\");\n };\n const optionId = (i: number) => `${listId}-${i}`;\n return (\n <Popover\n open={open}\n onOpenChange={(o) => {\n setOpen(o);\n setQ(\"\");\n setActive(0);\n }}\n >\n <PopoverTrigger render={<Button size=\"sm\" variant=\"ghost\" className=\"text-kit-fg-2\" leftIcon={<IconPlus stroke={1.5} />} disabled={disabled} />}>{label}</PopoverTrigger>\n <PopoverContent className=\"w-[300px] p-0\" align=\"start\">\n <label className=\"flex h-10 items-center gap-2 border-b border-kit-line px-3 text-kit-fg-3\">\n <IconSearch className=\"size-4 shrink-0\" stroke={1.5} aria-hidden />\n <input\n autoFocus\n value={q}\n onChange={(e) => {\n setQ(e.target.value);\n setActive(0);\n }}\n onKeyDown={(e) => {\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n setActive((a) => (a + 1) % Math.max(1, flat.length));\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n setActive((a) => (a - 1 + flat.length) % Math.max(1, flat.length));\n } else if (e.key === \"Enter\") {\n e.preventDefault();\n choose(flat[active]);\n }\n }}\n placeholder=\"Search blocks\"\n aria-label=\"Search blocks\"\n role=\"combobox\"\n aria-expanded\n aria-controls={listId}\n aria-activedescendant={flat.length ? optionId(Math.min(active, flat.length - 1)) : undefined}\n className=\"h-full min-w-0 flex-1 bg-transparent text-kit-sm text-kit-fg outline-none placeholder:text-kit-fg-3\"\n />\n </label>\n <div id={listId} className=\"max-h-80 overflow-y-auto p-1\" role=\"listbox\" aria-label=\"Blocks\" aria-busy={loading || undefined}>\n {loading && entries.length === 0 ? (\n <p role=\"status\" className=\"px-3 py-6 text-center text-kit-sm text-kit-fg-3\">\n Loading blocks…\n </p>\n ) : null}\n {!loading && !error && flat.length === 0 ? <p className=\"px-3 py-6 text-center text-kit-sm text-kit-fg-3\">{entries.length ? \"No blocks match\" : \"This project has no blocks that can go here yet.\"}</p> : null}\n {error ? (\n <p role=\"alert\" className=\"px-3 py-3 text-kit-xs text-kit-danger-fg\">\n {error}\n </p>\n ) : null}\n {cats.map((c) => (\n <div key={c} role=\"group\" aria-label={c} className=\"pb-1\">\n <div aria-hidden className=\"px-2 pb-1 pt-1.5 text-kit-2xs font-medium text-kit-fg-3\">\n {c}\n </div>\n {list\n .filter((b) => (b.category || \"Blocks\") === c)\n .map((b) => {\n const i = flat.indexOf(b);\n return (\n <div\n key={b.id}\n id={optionId(i)}\n role=\"option\"\n aria-selected={b.id === current}\n aria-disabled={!b.insertable || undefined}\n onMouseEnter={() => setActive(i)}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => choose(b)}\n className={cn(\"flex w-full items-center gap-2.5 rounded-kit-md p-1.5 text-left\", b.insertable ? \"cursor-pointer\" : \"cursor-not-allowed\", i === active && \"bg-kit-hover\")}\n >\n <span className={cn(\"flex size-8 shrink-0 items-center justify-center rounded-kit-md border border-kit-line bg-kit-surface text-kit-fg-2 shadow-kit-xs\", !b.insertable && \"opacity-50\")}>\n <KitIcon name={b.icon ?? \"box\"} className=\"size-4\" />\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className={cn(\"block truncate text-kit-sm\", b.insertable ? \"text-kit-fg\" : \"text-kit-fg-3\")}>{b.title}</span>\n {!b.insertable && b.reason ? (\n <span className=\"block text-kit-xs text-kit-fg-3\">{b.reason}</span>\n ) : b.description ? (\n <span className=\"block truncate text-kit-xs text-kit-fg-3\">{b.description}</span>\n ) : null}\n </span>\n </div>\n );\n })}\n </div>\n ))}\n </div>\n {note ? <p className=\"border-t border-kit-line px-3 py-2 text-kit-xs text-kit-fg-3\">{note}</p> : null}\n <div data-hint=\"shortcuts\" className=\"border-t border-kit-line px-3 py-1.5 text-kit-2xs text-kit-fg-3\">\n ↵ add · type to search\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAa,mBAAmB,MAAM,cAAc,CAAC;AAErD,IAAM,SAAS,MAAc,GAAG,EAAE,QAAQ,MAAM,IAAI,KAAK;AACzD,IAAM,aAAa;CAAE,SAAS,CAAC;CAAqB,cAAc,KAAA;AAAU;;AAG5E,SAAS,SAAS,EAAE,IAAI,UAAU,OAAO,WAAmF;CAC1H,OACE,uBAAC,UAAD;EACM;EACJ,MAAK;EACL,UAAU,KAAK,IAAI,KAAA;EACnB,WAAW,GACT,kPACA,SAAS,YAAY,wBAAwB,eAC/C;EAEC;CACK,GAAA,KAAA,GAAA,OAAA;;;;;AAEZ;AAEA,SAAgB,qBAAqB,EAAE,OAAO,OAAO,UAAU,UAAU,IAAI,QAAsB;CACjG,MAAM,OAAyB,MAAM,iBAAiB;EAAE,UAAU;EAAO,KAAK;EAAG,KAAK;CAAE;CACxF,MAAM,QAAQ,MAAM,WAAW,gBAAgB;CAC/C,MAAM,EAAE,gBAAgB,WAAW,UAAU,eAAe;CAE5D,MAAM,UAAU,iBAAiB,eAAe,EAAE,cAAc,KAAK,aAAa,CAAC,IAAI;CACvF,MAAM,OAAO,SAAS,KAAK;CAC3B,MAAM,QAAQ,KAAK;CACnB,MAAM,MAAM,KAAK,WAAW,KAAK,MAAM;CACvC,MAAM,CAAC,QAAQ,aAAa,M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AA;;;;;GACS;;;;;EACT,GAAA,IAAA,CAAA;;;;;;AAEb"}
|
|
1
|
+
{"version":3,"file":"slot.js","names":[],"sources":["../../src/controls/slot.tsx"],"sourcesContent":["/**\n * COMPONENT SLOT — a prop that holds component instances (prod `slot`), on the engine's slot surface (engine/slot.tsx,\n * V2 HEAD 9829bf1): the block rows (icon tile, name, ⋯ menu, drag to reorder) and the compact searchable picker.\n *\n * What differs from V2's block slot is where the rows come from and what they store:\n * - the picker lists the host's slot catalog (`useSlotCatalog`): the project's components with the SERVER's\n * insertability verdict for each; one that can't go here stays in the list, disabled, with the reason under its name;\n * - a row opens in place and edits that child's own props through the host's `SlotChild`;\n * - the value is written in the stored shape (slot-services.ts): one `{ componentId, overrides? }`, or a list of them\n * for a multiple slot, every item spread back with the keys this control does not show (style, window).\n *\n * Refusals are said in words, never by an inert control: no catalog service, an unreadable stored value, the nesting cap.\n */\nimport * as React from \"react\";\nimport { IconPlus, IconSearch } from \"@tabler/icons-react\";\nimport { useKitServices } from \"../context\";\nimport { KitIcon } from \"../lib/icons\";\nimport { cn } from \"../lib/cn\";\nimport { Button } from \"../ui/button\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../ui/overlay\";\nimport { RowList, useListOps, type RowModel } from \"../engine/array\";\nimport type { FieldSchema } from \"../schema/types\";\nimport type { ControlProps } from \"../types\";\nimport { readSlot, slotList, SLOT_DEPTH_MAX, type KitComponentSlot, type KitSlotEntry, type KitSlotItem } from \"./slot-services\";\n\n/** How many slots deep the control sits: the host's SlotChild editor sits inside a provider one level down. */\nexport const SlotDepthContext = React.createContext(0);\n\nconst count = (n: number) => `${n} block${n === 1 ? \"\" : \"s\"}`;\nconst NO_CATALOG = { entries: [] as KitSlotEntry[], nameOf: () => undefined };\n\n/** A note in words, labelable and focusable (the field label's `for` lands on it). */\nfunction SlotNote({ id, children, tone = \"muted\" }: { id?: string; children: React.ReactNode; tone?: \"muted\" | \"warning\" }) {\n return (\n <output\n id={id}\n role=\"note\"\n tabIndex={id ? 0 : undefined}\n className={cn(\n \"block rounded-kit-sm text-kit-xs outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-kit-focus-ring focus-visible:[outline-style:solid] [html[data-input-modality=pointer]_&]:focus-visible:outline-none\",\n tone === \"warning\" ? \"text-kit-warning-fg\" : \"text-kit-fg-3\",\n )}\n >\n {children}\n </output>\n );\n}\n\nexport function ComponentSlotControl({ field, value, onChange, readOnly, id, path }: ControlProps) {\n const slot: KitComponentSlot = field.componentSlot ?? { multiple: false, min: 0, max: 1 };\n const depth = React.useContext(SlotDepthContext);\n const { useSlotCatalog, SlotChild, toast } = useKitServices();\n // a hook service: one identity for the life of the form, so it is called on every render or never\n const catalog = useSlotCatalog ? useSlotCatalog({ componentIds: slot.componentIds }) : null; // eslint-disable-line react-hooks/rules-of-hooks\n const read = readSlot(value);\n const items = read.items;\n const max = slot.multiple ? slot.max : 1;\n const [openId, setOpenId] = React.useState<string | null>(null);\n const nameOf = (componentId: string) => (catalog ?? NO_CATALOG).nameOf(componentId) ?? { title: catalog?.loading ? \"Loading…\" : componentId };\n const locked = readOnly || read.unreadable > 0;\n\n /* writes: the stored shape, never a `_key` (useListOps' duplicate adds one) */\n const write = (next: unknown[]) => {\n setOpenId(null);\n if (slot.multiple) return onChange(slotList(next));\n const [first] = slotList(next);\n onChange(first ?? { componentId: \"\" });\n };\n const opsField: FieldSchema = { ...field, validation: { ...field.validation, min: slot.multiple ? slot.min : 0, max } };\n const ops = useListOps(opsField, path, items, write);\n if (depth >= SLOT_DEPTH_MAX) return <SlotNote id={id}>Nested block limit reached. A slot this deep would render as nothing, so it can’t hold more blocks here.</SlotNote>;\n const pick = (componentId: string) => {\n if (!slot.multiple) {\n const cur = items[0];\n // a different component's overrides are keyed by the old component's props: dropped, never half-applied\n onChange(cur && cur.componentId === componentId ? cur : { componentId });\n setOpenId(null);\n return;\n }\n if (items.length >= max) return;\n onChange([...items, { componentId }]);\n setOpenId(`i${items.length}`);\n };\n const setOverrides = (index: number, overrides: Record<string, unknown>) => {\n const next = items.map((it, i) => (i === index ? { ...it, overrides } : it));\n if (slot.multiple) onChange(next);\n else onChange({ componentId: next[0].componentId, overrides });\n };\n\n const rows: RowModel[] = items.map((it, i) => {\n const name = nameOf(it.componentId);\n const entry = catalog?.entries.find((e) => e.id === it.componentId);\n return {\n id: `i${i}`,\n index: i,\n item: it,\n path: [...path, i],\n preview: { title: name.missing ? \"Missing block\" : name.title, icon: entry?.icon ?? \"box\", empty: false },\n extra: name.missing ? \"Deleted, or not in this project. Replace or remove it.\" : (entry?.category ?? `Block ${i + 1} of ${items.length}`),\n };\n });\n\n /*\n * A slot that takes exactly one block type adds it in one press (V2 content-form.tsx \"Add {child}\"): no picker to\n * choose from a list of one. Not insertable here → the picker, which says why. Undo puts the slot back as it was.\n */\n const only = slot.componentIds?.length === 1 ? catalog?.entries.find((e) => e.id === slot.componentIds![0]) : undefined;\n const quickAdd = only?.insertable && (slot.multiple || items.length === 0) ? only : undefined;\n const addOnly = (entry: KitSlotEntry) => {\n const before = value;\n pick(entry.id);\n toast?.(`${entry.title} added to ${field.title}`, { action: { label: \"Undo\", onClick: () => onChange(before) } });\n };\n\n const picker = quickAdd ? (\n <Button\n size=\"lg\"\n variant=\"ghost\"\n className=\"text-kit-fg-2\"\n leftIcon={<IconPlus stroke={1.5} />}\n disabled={locked || (slot.multiple && items.length >= max)}\n onClick={() => addOnly(quickAdd)}\n >\n Add {quickAdd.title}\n </Button>\n ) : catalog ? (\n <SlotPicker\n entries={catalog.entries}\n loading={catalog.loading}\n error={catalog.error}\n note={catalog.note}\n current={slot.multiple ? undefined : items[0]?.componentId}\n label={slot.multiple ? \"Add block\" : items.length ? \"Replace block\" : \"Choose a block\"}\n disabled={locked || (slot.multiple && items.length >= max)}\n onPick={pick}\n />\n ) : null;\n\n return (\n <div className=\"flex min-w-0 flex-col gap-1.5\" data-slot=\"kit-component-slot\">\n {read.unreadable > 0 ? (\n <SlotNote tone=\"warning\">\n {read.unreadable === 1 ? \"One child here isn't a block instance\" : `${read.unreadable} children here aren't block instances`} (blocks written by another editor). This editor\n would drop {read.unreadable === 1 ? \"it\" : \"them\"} on save, so the slot is shown read-only and its value is kept.\n </SlotNote>\n ) : null}\n {read.inherited && items.length === 0 ? <SlotNote>Shows the block’s own content until a block is added here.</SlotNote> : null}\n <div id={id} tabIndex={-1} className=\"min-w-0 outline-none\">\n <RowList\n field={opsField}\n rows={rows}\n readOnly={locked}\n layout=\"list\"\n mode=\"inline\"\n openId={openId}\n onOpen={(r) => setOpenId(openId === r.id ? null : r.id)}\n onCloseInline={() => setOpenId(null)}\n ops={ops}\n renderInline={(r) => {\n const it = r.item as KitSlotItem;\n const title = r.preview.title;\n if (nameOf(it.componentId).missing) return <SlotNote>This component no longer exists, so its props can’t be edited. Replace it or remove it.</SlotNote>;\n if (!SlotChild) return <SlotNote>This editor can’t open {title}’s own props.</SlotNote>;\n return (\n <SlotDepthContext.Provider value={depth + 1}>\n <SlotChild\n componentId={it.componentId}\n title={title}\n overrides={it.overrides && typeof it.overrides === \"object\" ? it.overrides : {}}\n onChange={(o) => setOverrides(r.index, o)}\n readOnly={locked}\n depth={depth + 1}\n />\n </SlotDepthContext.Provider>\n );\n }}\n leading={(r) => (\n <span className=\"flex size-7 shrink-0 items-center justify-center rounded-kit-md border border-kit-line bg-kit-control-bg text-kit-fg-2 shadow-kit-xs\">\n <KitIcon name={r.preview.icon} className=\"size-4\" />\n </span>\n )}\n emptyLabel={slot.multiple ? \"No blocks yet. Add one to start composing.\" : \"No block yet. Choose one to fill this slot.\"}\n addButton={picker ?? <SlotNote>No block library is connected to this editor, so {field.title} can’t be changed here.</SlotNote>}\n />\n </div>\n {slot.multiple ? (\n <span className=\"text-kit-xs text-kit-fg-3\">\n {items.length >= max ? `This slot holds at most ${count(max)}.` : slot.min > 0 ? `Between ${slot.min} and ${count(max)}.` : `Up to ${count(max)}.`}\n {slot.min > 0 && items.length > 0 && items.length <= slot.min ? ` It needs at least ${slot.min}, so none can be removed.` : \"\"}\n </span>\n ) : null}\n </div>\n );\n}\n\n/**\n * The compact block picker (engine/slot.tsx BlockPicker), over the slot catalog: grouped by family, searchable, ↵ adds.\n * A component the server says can't go here is listed disabled with its reason in place of the description.\n */\nexport function SlotPicker({\n entries,\n loading,\n error,\n note,\n current,\n label,\n disabled,\n onPick,\n}: {\n entries: KitSlotEntry[];\n loading?: boolean;\n error?: string;\n note?: string;\n current?: string;\n label: string;\n disabled?: boolean;\n onPick: (componentId: string) => void;\n}) {\n const [open, setOpen] = React.useState(false);\n const [q, setQ] = React.useState(\"\");\n const [active, setActive] = React.useState(0);\n const listId = React.useId();\n const list = entries.filter((b) => !q || `${b.title} ${b.category ?? \"\"} ${b.description ?? \"\"}`.toLowerCase().includes(q.toLowerCase()));\n const cats = Array.from(new Set(list.map((b) => b.category || \"Blocks\")));\n const flat = cats.flatMap((c) => list.filter((b) => (b.category || \"Blocks\") === c));\n const choose = (b: KitSlotEntry | undefined) => {\n if (!b || !b.insertable) return;\n onPick(b.id);\n setOpen(false);\n setQ(\"\");\n };\n const optionId = (i: number) => `${listId}-${i}`;\n return (\n <Popover\n open={open}\n onOpenChange={(o) => {\n setOpen(o);\n setQ(\"\");\n setActive(0);\n }}\n >\n <PopoverTrigger render={<Button size=\"sm\" variant=\"ghost\" className=\"text-kit-fg-2\" leftIcon={<IconPlus stroke={1.5} />} disabled={disabled} />}>{label}</PopoverTrigger>\n <PopoverContent className=\"w-[300px] p-0\" align=\"start\">\n <label className=\"flex h-10 items-center gap-2 border-b border-kit-line px-3 text-kit-fg-3\">\n <IconSearch className=\"size-4 shrink-0\" stroke={1.5} aria-hidden />\n <input\n autoFocus\n value={q}\n onChange={(e) => {\n setQ(e.target.value);\n setActive(0);\n }}\n onKeyDown={(e) => {\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n setActive((a) => (a + 1) % Math.max(1, flat.length));\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n setActive((a) => (a - 1 + flat.length) % Math.max(1, flat.length));\n } else if (e.key === \"Enter\") {\n e.preventDefault();\n choose(flat[active]);\n }\n }}\n placeholder=\"Search blocks\"\n aria-label=\"Search blocks\"\n role=\"combobox\"\n aria-expanded\n aria-controls={listId}\n aria-activedescendant={flat.length ? optionId(Math.min(active, flat.length - 1)) : undefined}\n className=\"h-full min-w-0 flex-1 bg-transparent text-kit-sm text-kit-fg outline-none placeholder:text-kit-fg-3\"\n />\n </label>\n <div id={listId} className=\"max-h-80 overflow-y-auto p-1\" role=\"listbox\" aria-label=\"Blocks\" aria-busy={loading || undefined}>\n {loading && entries.length === 0 ? (\n <p role=\"status\" className=\"px-3 py-6 text-center text-kit-sm text-kit-fg-3\">\n Loading blocks…\n </p>\n ) : null}\n {!loading && !error && flat.length === 0 ? <p className=\"px-3 py-6 text-center text-kit-sm text-kit-fg-3\">{entries.length ? \"No blocks match\" : \"This project has no blocks that can go here yet.\"}</p> : null}\n {error ? (\n <p role=\"alert\" className=\"px-3 py-3 text-kit-xs text-kit-danger-fg\">\n {error}\n </p>\n ) : null}\n {cats.map((c) => (\n <div key={c} role=\"group\" aria-label={c} className=\"pb-1\">\n <div aria-hidden className=\"px-2 pb-1 pt-1.5 text-kit-2xs font-medium text-kit-fg-3\">\n {c}\n </div>\n {list\n .filter((b) => (b.category || \"Blocks\") === c)\n .map((b) => {\n const i = flat.indexOf(b);\n return (\n <div\n key={b.id}\n id={optionId(i)}\n role=\"option\"\n aria-selected={b.id === current}\n aria-disabled={!b.insertable || undefined}\n onMouseEnter={() => setActive(i)}\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => choose(b)}\n className={cn(\"flex w-full items-center gap-2.5 rounded-kit-md p-1.5 text-left\", b.insertable ? \"cursor-pointer\" : \"cursor-not-allowed\", i === active && \"bg-kit-hover\")}\n >\n <span className={cn(\"flex size-8 shrink-0 items-center justify-center rounded-kit-md border border-kit-line bg-kit-surface text-kit-fg-2 shadow-kit-xs\", !b.insertable && \"opacity-50\")}>\n <KitIcon name={b.icon ?? \"box\"} className=\"size-4\" />\n </span>\n <span className=\"min-w-0 flex-1\">\n <span className={cn(\"block truncate text-kit-sm\", b.insertable ? \"text-kit-fg\" : \"text-kit-fg-3\")}>{b.title}</span>\n {!b.insertable && b.reason ? (\n <span className=\"block text-kit-xs text-kit-fg-3\">{b.reason}</span>\n ) : b.description ? (\n <span className=\"block truncate text-kit-xs text-kit-fg-3\">{b.description}</span>\n ) : null}\n </span>\n </div>\n );\n })}\n </div>\n ))}\n </div>\n {note ? <p className=\"border-t border-kit-line px-3 py-2 text-kit-xs text-kit-fg-3\">{note}</p> : null}\n <div data-hint=\"shortcuts\" className=\"border-t border-kit-line px-3 py-1.5 text-kit-2xs text-kit-fg-3\">\n ↵ add · type to search\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAa,mBAAmB,MAAM,cAAc,CAAC;AAErD,IAAM,SAAS,MAAc,GAAG,EAAE,QAAQ,MAAM,IAAI,KAAK;AACzD,IAAM,aAAa;CAAE,SAAS,CAAC;CAAqB,cAAc,KAAA;AAAU;;AAG5E,SAAS,SAAS,EAAE,IAAI,UAAU,OAAO,WAAmF;CAC1H,OACE,oBAAC,UAAD;EACM;EACJ,MAAK;EACL,UAAU,KAAK,IAAI,KAAA;EACnB,WAAW,GACT,kPACA,SAAS,YAAY,wBAAwB,eAC/C;EAEC;CACK,CAAA;AAEZ;AAEA,SAAgB,qBAAqB,EAAE,OAAO,OAAO,UAAU,UAAU,IAAI,QAAsB;CACjG,MAAM,OAAyB,MAAM,iBAAiB;EAAE,UAAU;EAAO,KAAK;EAAG,KAAK;CAAE;CACxF,MAAM,QAAQ,MAAM,WAAW,gBAAgB;CAC/C,MAAM,EAAE,gBAAgB,WAAW,UAAU,eAAe;CAE5D,MAAM,UAAU,iBAAiB,eAAe,EAAE,cAAc,KAAK,aAAa,CAAC,IAAI;CACvF,MAAM,OAAO,SAAS,KAAK;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