@bettercms-ai/kit 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brand/logo.js +67 -18
- package/dist/brand/logo.js.map +1 -1
- package/dist/context.js +8 -3
- package/dist/context.js.map +1 -1
- package/dist/controls/button.js +451 -134
- package/dist/controls/button.js.map +1 -1
- package/dist/controls/choice.js +336 -95
- package/dist/controls/choice.js.map +1 -1
- package/dist/controls/code.js +245 -72
- package/dist/controls/code.js.map +1 -1
- package/dist/controls/color.js +108 -31
- package/dist/controls/color.js.map +1 -1
- package/dist/controls/date.js +268 -83
- package/dist/controls/date.js.map +1 -1
- package/dist/controls/form-picker.js +26 -9
- package/dist/controls/form-picker.js.map +1 -1
- package/dist/controls/icon.js +341 -100
- package/dist/controls/icon.js.map +1 -1
- package/dist/controls/json.js +20 -7
- package/dist/controls/json.js.map +1 -1
- package/dist/controls/link.js +561 -156
- package/dist/controls/link.js.map +1 -1
- package/dist/controls/location.js +124 -35
- package/dist/controls/location.js.map +1 -1
- package/dist/controls/media.js +928 -267
- package/dist/controls/media.js.map +1 -1
- package/dist/controls/number.js +80 -23
- package/dist/controls/number.js.map +1 -1
- package/dist/controls/reference.js +516 -155
- package/dist/controls/reference.js.map +1 -1
- package/dist/controls/rich-text/article-shell.js +327 -86
- package/dist/controls/rich-text/article-shell.js.map +1 -1
- package/dist/controls/rich-text/author.js +78 -21
- package/dist/controls/rich-text/author.js.map +1 -1
- package/dist/controls/rich-text/blocks.js +1084 -315
- package/dist/controls/rich-text/blocks.js.map +1 -1
- package/dist/controls/rich-text/button.js +30 -9
- package/dist/controls/rich-text/button.js.map +1 -1
- package/dist/controls/rich-text/catalog.js +168 -51
- package/dist/controls/rich-text/catalog.js.map +1 -1
- package/dist/controls/rich-text/columns.js +104 -31
- package/dist/controls/rich-text/columns.js.map +1 -1
- package/dist/controls/rich-text/component-card.js +790 -209
- package/dist/controls/rich-text/component-card.js.map +1 -1
- package/dist/controls/rich-text/component-panel.js +102 -40
- package/dist/controls/rich-text/component-panel.js.map +1 -1
- package/dist/controls/rich-text/control.js +101 -32
- package/dist/controls/rich-text/control.js.map +1 -1
- package/dist/controls/rich-text/editor.js +423 -121
- package/dist/controls/rich-text/editor.js.map +1 -1
- package/dist/controls/rich-text/embed.js +184 -51
- package/dist/controls/rich-text/embed.js.map +1 -1
- package/dist/controls/rich-text/floating.js +171 -42
- package/dist/controls/rich-text/floating.js.map +1 -1
- package/dist/controls/rich-text/footnote.js +89 -28
- package/dist/controls/rich-text/footnote.js.map +1 -1
- package/dist/controls/rich-text/gallery.js +88 -27
- package/dist/controls/rich-text/gallery.js.map +1 -1
- package/dist/controls/rich-text/link-form.js +111 -34
- package/dist/controls/rich-text/link-form.js.map +1 -1
- package/dist/controls/rich-text/plain.js +8 -3
- package/dist/controls/rich-text/plain.js.map +1 -1
- package/dist/controls/rich-text/related.js +86 -25
- package/dist/controls/rich-text/related.js.map +1 -1
- package/dist/controls/rich-text/toc.js +48 -15
- package/dist/controls/rich-text/toc.js.map +1 -1
- package/dist/controls/rich-text/toolbar.js +408 -107
- package/dist/controls/rich-text/toolbar.js.map +1 -1
- package/dist/controls/scale.js +169 -52
- package/dist/controls/scale.js.map +1 -1
- package/dist/controls/slot.js +238 -73
- package/dist/controls/slot.js.map +1 -1
- package/dist/controls/table/table-editor.js +1766 -500
- package/dist/controls/table/table-editor.js.map +1 -1
- package/dist/controls/table/table-link.js +119 -38
- package/dist/controls/table/table-link.js.map +1 -1
- package/dist/controls/table/table.js +26 -9
- package/dist/controls/table/table.js.map +1 -1
- package/dist/controls/text.js +221 -68
- package/dist/controls/text.js.map +1 -1
- package/dist/controls/unknown-value.js +79 -22
- package/dist/controls/unknown-value.js.map +1 -1
- package/dist/engine/array.js +821 -228
- package/dist/engine/array.js.map +1 -1
- package/dist/engine/bits.js +38 -13
- package/dist/engine/bits.js.map +1 -1
- package/dist/engine/breadcrumb.js +25 -8
- package/dist/engine/breadcrumb.js.map +1 -1
- package/dist/engine/expand.js +38 -13
- package/dist/engine/expand.js.map +1 -1
- package/dist/engine/field-list.js +14 -5
- package/dist/engine/field-list.js.map +1 -1
- package/dist/engine/field-shell.js +849 -244
- package/dist/engine/field-shell.js.map +1 -1
- package/dist/engine/frame.js +275 -78
- package/dist/engine/frame.js.map +1 -1
- package/dist/engine/grouping.js +630 -193
- package/dist/engine/grouping.js.map +1 -1
- package/dist/engine/item-list.js +187 -50
- package/dist/engine/item-list.js.map +1 -1
- package/dist/engine/kit-field.js +320 -95
- package/dist/engine/kit-field.js.map +1 -1
- package/dist/engine/schema-form.js +101 -32
- package/dist/engine/schema-form.js.map +1 -1
- package/dist/engine/slot.js +146 -45
- package/dist/engine/slot.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/icons.js +14 -5
- package/dist/lib/icons.js.map +1 -1
- package/dist/styles.css +5821 -1
- package/dist/table/table-view.js +49 -16
- package/dist/table/table-view.js.map +1 -1
- package/dist/testing/test-form.js +14 -5
- package/dist/testing/test-form.js.map +1 -1
- package/dist/theme.js +8 -3
- package/dist/theme.js.map +1 -1
- package/dist/ui/action-tray.js +97 -24
- package/dist/ui/action-tray.js.map +1 -1
- package/dist/ui/autocomplete.js +135 -38
- package/dist/ui/autocomplete.js.map +1 -1
- package/dist/ui/button.js +108 -31
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/choice-switch.js +14 -5
- package/dist/ui/choice-switch.js.map +1 -1
- package/dist/ui/controls.js +279 -86
- package/dist/ui/controls.js.map +1 -1
- package/dist/ui/display.js +401 -116
- package/dist/ui/display.js.map +1 -1
- package/dist/ui/expanded-editor-modal.js +100 -27
- package/dist/ui/expanded-editor-modal.js.map +1 -1
- package/dist/ui/floating-panel.js +130 -37
- package/dist/ui/floating-panel.js.map +1 -1
- package/dist/ui/index.js +2 -2
- package/dist/ui/input.js +196 -59
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/mode-bar.js +32 -11
- package/dist/ui/mode-bar.js.map +1 -1
- package/dist/ui/overlay.js +616 -179
- package/dist/ui/overlay.js.map +1 -1
- package/dist/ui/path-crumbs.js +374 -113
- package/dist/ui/path-crumbs.js.map +1 -1
- package/dist/ui/select.js +311 -78
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/shortcut-hint.d.ts +3 -0
- package/dist/ui/shortcut-hint.js +33 -7
- package/dist/ui/shortcut-hint.js.map +1 -1
- package/dist/ui/spinner.js +20 -7
- package/dist/ui/spinner.js.map +1 -1
- package/dist/ui/split-button.js +35 -10
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/tab.js +50 -17
- package/dist/ui/tab.js.map +1 -1
- package/dist/ui/toast.js +107 -30
- package/dist/ui/toast.js.map +1 -1
- package/dist/ui/tooltip-root.js +24 -7
- 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 { jsxDEV } from "react/jsx-dev-runtime";
|
|
10
10
|
import { IconPlus, IconSearch } from "@tabler/icons-react";
|
|
11
11
|
//#region src/controls/slot.tsx
|
|
12
12
|
/**
|
|
@@ -22,6 +22,7 @@ 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";
|
|
25
26
|
/** How many slots deep the control sits: the host's SlotChild editor sits inside a provider one level down. */
|
|
26
27
|
var SlotDepthContext = React.createContext(0);
|
|
27
28
|
var count = (n) => `${n} block${n === 1 ? "" : "s"}`;
|
|
@@ -31,13 +32,17 @@ var NO_CATALOG = {
|
|
|
31
32
|
};
|
|
32
33
|
/** A note in words, labelable and focusable (the field label's `for` lands on it). */
|
|
33
34
|
function SlotNote({ id, children, tone = "muted" }) {
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ jsxDEV("output", {
|
|
35
36
|
id,
|
|
36
37
|
role: "note",
|
|
37
38
|
tabIndex: id ? 0 : void 0,
|
|
38
39
|
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"),
|
|
39
40
|
children
|
|
40
|
-
}
|
|
41
|
+
}, void 0, false, {
|
|
42
|
+
fileName: _jsxFileName,
|
|
43
|
+
lineNumber: 35,
|
|
44
|
+
columnNumber: 5
|
|
45
|
+
}, this);
|
|
41
46
|
}
|
|
42
47
|
function ComponentSlotControl({ field, value, onChange, readOnly, id, path }) {
|
|
43
48
|
const slot = field.componentSlot ?? {
|
|
@@ -69,10 +74,14 @@ function ComponentSlotControl({ field, value, onChange, readOnly, id, path }) {
|
|
|
69
74
|
}
|
|
70
75
|
};
|
|
71
76
|
const ops = useListOps(opsField, path, items, write);
|
|
72
|
-
if (depth >= 10) return /* @__PURE__ */
|
|
77
|
+
if (depth >= 10) return /* @__PURE__ */ jsxDEV(SlotNote, {
|
|
73
78
|
id,
|
|
74
79
|
children: "Nested block limit reached. A slot this deep would render as nothing, so it can’t hold more blocks here."
|
|
75
|
-
}
|
|
80
|
+
}, void 0, false, {
|
|
81
|
+
fileName: _jsxFileName,
|
|
82
|
+
lineNumber: 71,
|
|
83
|
+
columnNumber: 39
|
|
84
|
+
}, this);
|
|
76
85
|
const pick = (componentId) => {
|
|
77
86
|
if (!slot.multiple) {
|
|
78
87
|
const cur = items[0];
|
|
@@ -121,15 +130,23 @@ function ComponentSlotControl({ field, value, onChange, readOnly, id, path }) {
|
|
|
121
130
|
onClick: () => onChange(before)
|
|
122
131
|
} });
|
|
123
132
|
};
|
|
124
|
-
const picker = quickAdd ? /* @__PURE__ */
|
|
133
|
+
const picker = quickAdd ? /* @__PURE__ */ jsxDEV(Button, {
|
|
125
134
|
size: "lg",
|
|
126
135
|
variant: "ghost",
|
|
127
136
|
className: "text-kit-fg-2",
|
|
128
|
-
leftIcon: /* @__PURE__ */
|
|
137
|
+
leftIcon: /* @__PURE__ */ jsxDEV(IconPlus, { stroke: 1.5 }, void 0, false, {
|
|
138
|
+
fileName: _jsxFileName,
|
|
139
|
+
lineNumber: 120,
|
|
140
|
+
columnNumber: 17
|
|
141
|
+
}, this),
|
|
129
142
|
disabled: locked || slot.multiple && items.length >= max,
|
|
130
143
|
onClick: () => addOnly(quickAdd),
|
|
131
144
|
children: ["Add ", quickAdd.title]
|
|
132
|
-
}
|
|
145
|
+
}, void 0, true, {
|
|
146
|
+
fileName: _jsxFileName,
|
|
147
|
+
lineNumber: 116,
|
|
148
|
+
columnNumber: 5
|
|
149
|
+
}, this) : catalog ? /* @__PURE__ */ jsxDEV(SlotPicker, {
|
|
133
150
|
entries: catalog.entries,
|
|
134
151
|
loading: catalog.loading,
|
|
135
152
|
error: catalog.error,
|
|
@@ -138,12 +155,16 @@ function ComponentSlotControl({ field, value, onChange, readOnly, id, path }) {
|
|
|
138
155
|
label: slot.multiple ? "Add block" : items.length ? "Replace block" : "Choose a block",
|
|
139
156
|
disabled: locked || slot.multiple && items.length >= max,
|
|
140
157
|
onPick: pick
|
|
141
|
-
}
|
|
142
|
-
|
|
158
|
+
}, void 0, false, {
|
|
159
|
+
fileName: _jsxFileName,
|
|
160
|
+
lineNumber: 127,
|
|
161
|
+
columnNumber: 5
|
|
162
|
+
}, this) : null;
|
|
163
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
143
164
|
className: "flex min-w-0 flex-col gap-1.5",
|
|
144
165
|
"data-slot": "kit-component-slot",
|
|
145
166
|
children: [
|
|
146
|
-
read.unreadable > 0 ? /* @__PURE__ */
|
|
167
|
+
read.unreadable > 0 ? /* @__PURE__ */ jsxDEV(SlotNote, {
|
|
147
168
|
tone: "warning",
|
|
148
169
|
children: [
|
|
149
170
|
read.unreadable === 1 ? "One child here isn't a block instance" : `${read.unreadable} children here aren't block instances`,
|
|
@@ -151,13 +172,21 @@ function ComponentSlotControl({ field, value, onChange, readOnly, id, path }) {
|
|
|
151
172
|
read.unreadable === 1 ? "it" : "them",
|
|
152
173
|
" on save, so the slot is shown read-only and its value is kept."
|
|
153
174
|
]
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
175
|
+
}, void 0, true, {
|
|
176
|
+
fileName: _jsxFileName,
|
|
177
|
+
lineNumber: 142,
|
|
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", {
|
|
157
186
|
id,
|
|
158
187
|
tabIndex: -1,
|
|
159
188
|
className: "min-w-0 outline-none",
|
|
160
|
-
children: /* @__PURE__ */
|
|
189
|
+
children: /* @__PURE__ */ jsxDEV(RowList, {
|
|
161
190
|
field: opsField,
|
|
162
191
|
rows,
|
|
163
192
|
readOnly: locked,
|
|
@@ -170,45 +199,89 @@ function ComponentSlotControl({ field, value, onChange, readOnly, id, path }) {
|
|
|
170
199
|
renderInline: (r) => {
|
|
171
200
|
const it = r.item;
|
|
172
201
|
const title = r.preview.title;
|
|
173
|
-
if (nameOf(it.componentId).missing) return /* @__PURE__ */
|
|
174
|
-
|
|
202
|
+
if (nameOf(it.componentId).missing) return /* @__PURE__ */ jsxDEV(SlotNote, { children: "This component no longer exists, so its props can’t be edited. Replace it or remove it." }, void 0, false, {
|
|
203
|
+
fileName: _jsxFileName,
|
|
204
|
+
lineNumber: 162,
|
|
205
|
+
columnNumber: 56
|
|
206
|
+
}, this);
|
|
207
|
+
if (!SlotChild) return /* @__PURE__ */ jsxDEV(SlotNote, { children: [
|
|
175
208
|
"This editor can’t open ",
|
|
176
209
|
title,
|
|
177
210
|
"’s own props."
|
|
178
|
-
] }
|
|
179
|
-
|
|
211
|
+
] }, void 0, true, {
|
|
212
|
+
fileName: _jsxFileName,
|
|
213
|
+
lineNumber: 163,
|
|
214
|
+
columnNumber: 36
|
|
215
|
+
}, this);
|
|
216
|
+
return /* @__PURE__ */ jsxDEV(SlotDepthContext.Provider, {
|
|
180
217
|
value: depth + 1,
|
|
181
|
-
children: /* @__PURE__ */
|
|
218
|
+
children: /* @__PURE__ */ jsxDEV(SlotChild, {
|
|
182
219
|
componentId: it.componentId,
|
|
183
220
|
title,
|
|
184
221
|
overrides: it.overrides && typeof it.overrides === "object" ? it.overrides : {},
|
|
185
222
|
onChange: (o) => setOverrides(r.index, o),
|
|
186
223
|
readOnly: locked,
|
|
187
224
|
depth: depth + 1
|
|
188
|
-
}
|
|
189
|
-
|
|
225
|
+
}, void 0, false, {
|
|
226
|
+
fileName: _jsxFileName,
|
|
227
|
+
lineNumber: 166,
|
|
228
|
+
columnNumber: 17
|
|
229
|
+
}, this)
|
|
230
|
+
}, void 0, false, {
|
|
231
|
+
fileName: _jsxFileName,
|
|
232
|
+
lineNumber: 165,
|
|
233
|
+
columnNumber: 15
|
|
234
|
+
}, this);
|
|
190
235
|
},
|
|
191
|
-
leading: (r) => /* @__PURE__ */
|
|
236
|
+
leading: (r) => /* @__PURE__ */ jsxDEV("span", {
|
|
192
237
|
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",
|
|
193
|
-
children: /* @__PURE__ */
|
|
238
|
+
children: /* @__PURE__ */ jsxDEV(KitIcon, {
|
|
194
239
|
name: r.preview.icon,
|
|
195
240
|
className: "size-4"
|
|
196
|
-
}
|
|
197
|
-
|
|
241
|
+
}, void 0, false, {
|
|
242
|
+
fileName: _jsxFileName,
|
|
243
|
+
lineNumber: 179,
|
|
244
|
+
columnNumber: 15
|
|
245
|
+
}, this)
|
|
246
|
+
}, void 0, false, {
|
|
247
|
+
fileName: _jsxFileName,
|
|
248
|
+
lineNumber: 178,
|
|
249
|
+
columnNumber: 13
|
|
250
|
+
}, this),
|
|
198
251
|
emptyLabel: slot.multiple ? "No blocks yet. Add one to start composing." : "No block yet. Choose one to fill this slot.",
|
|
199
|
-
addButton: picker ?? /* @__PURE__ */
|
|
252
|
+
addButton: picker ?? /* @__PURE__ */ jsxDEV(SlotNote, { children: [
|
|
200
253
|
"No block library is connected to this editor, so ",
|
|
201
254
|
field.title,
|
|
202
255
|
" can’t be changed here."
|
|
203
|
-
] }
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
256
|
+
] }, void 0, true, {
|
|
257
|
+
fileName: _jsxFileName,
|
|
258
|
+
lineNumber: 183,
|
|
259
|
+
columnNumber: 32
|
|
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", {
|
|
207
272
|
className: "text-kit-xs text-kit-fg-3",
|
|
208
273
|
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.` : ""]
|
|
209
|
-
}
|
|
274
|
+
}, void 0, true, {
|
|
275
|
+
fileName: _jsxFileName,
|
|
276
|
+
lineNumber: 187,
|
|
277
|
+
columnNumber: 9
|
|
278
|
+
}, this) : null
|
|
210
279
|
]
|
|
211
|
-
}
|
|
280
|
+
}, void 0, true, {
|
|
281
|
+
fileName: _jsxFileName,
|
|
282
|
+
lineNumber: 140,
|
|
283
|
+
columnNumber: 5
|
|
284
|
+
}, this);
|
|
212
285
|
}
|
|
213
286
|
/**
|
|
214
287
|
* The compact block picker (engine/slot.tsx BlockPicker), over the slot catalog: grouped by family, searchable, ↵ adds.
|
|
@@ -229,33 +302,49 @@ function SlotPicker({ entries, loading, error, note, current, label, disabled, o
|
|
|
229
302
|
setQ("");
|
|
230
303
|
};
|
|
231
304
|
const optionId = (i) => `${listId}-${i}`;
|
|
232
|
-
return /* @__PURE__ */
|
|
305
|
+
return /* @__PURE__ */ jsxDEV(Popover, {
|
|
233
306
|
open,
|
|
234
307
|
onOpenChange: (o) => {
|
|
235
308
|
setOpen(o);
|
|
236
309
|
setQ("");
|
|
237
310
|
setActive(0);
|
|
238
311
|
},
|
|
239
|
-
children: [/* @__PURE__ */
|
|
240
|
-
render: /* @__PURE__ */
|
|
312
|
+
children: [/* @__PURE__ */ jsxDEV(PopoverTrigger, {
|
|
313
|
+
render: /* @__PURE__ */ jsxDEV(Button, {
|
|
241
314
|
size: "sm",
|
|
242
315
|
variant: "ghost",
|
|
243
316
|
className: "text-kit-fg-2",
|
|
244
|
-
leftIcon: /* @__PURE__ */
|
|
317
|
+
leftIcon: /* @__PURE__ */ jsxDEV(IconPlus, { stroke: 1.5 }, void 0, false, {
|
|
318
|
+
fileName: _jsxFileName,
|
|
319
|
+
lineNumber: 242,
|
|
320
|
+
columnNumber: 101
|
|
321
|
+
}, this),
|
|
245
322
|
disabled
|
|
246
|
-
}
|
|
323
|
+
}, void 0, false, {
|
|
324
|
+
fileName: _jsxFileName,
|
|
325
|
+
lineNumber: 242,
|
|
326
|
+
columnNumber: 31
|
|
327
|
+
}, this),
|
|
247
328
|
children: label
|
|
248
|
-
}
|
|
329
|
+
}, void 0, false, {
|
|
330
|
+
fileName: _jsxFileName,
|
|
331
|
+
lineNumber: 242,
|
|
332
|
+
columnNumber: 7
|
|
333
|
+
}, this), /* @__PURE__ */ jsxDEV(PopoverContent, {
|
|
249
334
|
className: "w-[300px] p-0",
|
|
250
335
|
align: "start",
|
|
251
336
|
children: [
|
|
252
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ jsxDEV("label", {
|
|
253
338
|
className: "flex h-10 items-center gap-2 border-b border-kit-line px-3 text-kit-fg-3",
|
|
254
|
-
children: [/* @__PURE__ */
|
|
339
|
+
children: [/* @__PURE__ */ jsxDEV(IconSearch, {
|
|
255
340
|
className: "size-4 shrink-0",
|
|
256
341
|
stroke: 1.5,
|
|
257
342
|
"aria-hidden": true
|
|
258
|
-
}
|
|
343
|
+
}, void 0, false, {
|
|
344
|
+
fileName: _jsxFileName,
|
|
345
|
+
lineNumber: 245,
|
|
346
|
+
columnNumber: 11
|
|
347
|
+
}, this), /* @__PURE__ */ jsxDEV("input", {
|
|
259
348
|
autoFocus: true,
|
|
260
349
|
value: q,
|
|
261
350
|
onChange: (e) => {
|
|
@@ -281,40 +370,64 @@ function SlotPicker({ entries, loading, error, note, current, label, disabled, o
|
|
|
281
370
|
"aria-controls": listId,
|
|
282
371
|
"aria-activedescendant": flat.length ? optionId(Math.min(active, flat.length - 1)) : void 0,
|
|
283
372
|
className: "h-full min-w-0 flex-1 bg-transparent text-kit-sm text-kit-fg outline-none placeholder:text-kit-fg-3"
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
|
|
373
|
+
}, void 0, false, {
|
|
374
|
+
fileName: _jsxFileName,
|
|
375
|
+
lineNumber: 246,
|
|
376
|
+
columnNumber: 11
|
|
377
|
+
}, this)]
|
|
378
|
+
}, void 0, true, {
|
|
379
|
+
fileName: _jsxFileName,
|
|
380
|
+
lineNumber: 244,
|
|
381
|
+
columnNumber: 9
|
|
382
|
+
}, this),
|
|
383
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
287
384
|
id: listId,
|
|
288
385
|
className: "max-h-80 overflow-y-auto p-1",
|
|
289
386
|
role: "listbox",
|
|
290
387
|
"aria-label": "Blocks",
|
|
291
388
|
"aria-busy": loading || void 0,
|
|
292
389
|
children: [
|
|
293
|
-
loading && entries.length === 0 ? /* @__PURE__ */
|
|
390
|
+
loading && entries.length === 0 ? /* @__PURE__ */ jsxDEV("p", {
|
|
294
391
|
role: "status",
|
|
295
392
|
className: "px-3 py-6 text-center text-kit-sm text-kit-fg-3",
|
|
296
393
|
children: "Loading blocks…"
|
|
297
|
-
}
|
|
298
|
-
|
|
394
|
+
}, void 0, false, {
|
|
395
|
+
fileName: _jsxFileName,
|
|
396
|
+
lineNumber: 276,
|
|
397
|
+
columnNumber: 13
|
|
398
|
+
}, this) : null,
|
|
399
|
+
!loading && !error && flat.length === 0 ? /* @__PURE__ */ jsxDEV("p", {
|
|
299
400
|
className: "px-3 py-6 text-center text-kit-sm text-kit-fg-3",
|
|
300
401
|
children: entries.length ? "No blocks match" : "This project has no blocks that can go here yet."
|
|
301
|
-
}
|
|
302
|
-
|
|
402
|
+
}, void 0, false, {
|
|
403
|
+
fileName: _jsxFileName,
|
|
404
|
+
lineNumber: 280,
|
|
405
|
+
columnNumber: 54
|
|
406
|
+
}, this) : null,
|
|
407
|
+
error ? /* @__PURE__ */ jsxDEV("p", {
|
|
303
408
|
role: "alert",
|
|
304
409
|
className: "px-3 py-3 text-kit-xs text-kit-danger-fg",
|
|
305
410
|
children: error
|
|
306
|
-
}
|
|
307
|
-
|
|
411
|
+
}, void 0, false, {
|
|
412
|
+
fileName: _jsxFileName,
|
|
413
|
+
lineNumber: 282,
|
|
414
|
+
columnNumber: 13
|
|
415
|
+
}, this) : null,
|
|
416
|
+
cats.map((c) => /* @__PURE__ */ jsxDEV("div", {
|
|
308
417
|
role: "group",
|
|
309
418
|
"aria-label": c,
|
|
310
419
|
className: "pb-1",
|
|
311
|
-
children: [/* @__PURE__ */
|
|
420
|
+
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
312
421
|
"aria-hidden": true,
|
|
313
422
|
className: "px-2 pb-1 pt-1.5 text-kit-2xs font-medium text-kit-fg-3",
|
|
314
423
|
children: c
|
|
315
|
-
}
|
|
424
|
+
}, void 0, false, {
|
|
425
|
+
fileName: _jsxFileName,
|
|
426
|
+
lineNumber: 288,
|
|
427
|
+
columnNumber: 15
|
|
428
|
+
}, this), list.filter((b) => (b.category || "Blocks") === c).map((b) => {
|
|
316
429
|
const i = flat.indexOf(b);
|
|
317
|
-
return /* @__PURE__ */
|
|
430
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
318
431
|
id: optionId(i),
|
|
319
432
|
role: "option",
|
|
320
433
|
"aria-selected": b.id === current,
|
|
@@ -323,42 +436,94 @@ function SlotPicker({ entries, loading, error, note, current, label, disabled, o
|
|
|
323
436
|
onMouseDown: (e) => e.preventDefault(),
|
|
324
437
|
onClick: () => choose(b),
|
|
325
438
|
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"),
|
|
326
|
-
children: [/* @__PURE__ */
|
|
439
|
+
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
327
440
|
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"),
|
|
328
|
-
children: /* @__PURE__ */
|
|
441
|
+
children: /* @__PURE__ */ jsxDEV(KitIcon, {
|
|
329
442
|
name: b.icon ?? "box",
|
|
330
443
|
className: "size-4"
|
|
331
|
-
}
|
|
332
|
-
|
|
444
|
+
}, void 0, false, {
|
|
445
|
+
fileName: _jsxFileName,
|
|
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", {
|
|
333
454
|
className: "min-w-0 flex-1",
|
|
334
|
-
children: [/* @__PURE__ */
|
|
455
|
+
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
335
456
|
className: cn("block truncate text-kit-sm", b.insertable ? "text-kit-fg" : "text-kit-fg-3"),
|
|
336
457
|
children: b.title
|
|
337
|
-
}
|
|
458
|
+
}, void 0, false, {
|
|
459
|
+
fileName: _jsxFileName,
|
|
460
|
+
lineNumber: 311,
|
|
461
|
+
columnNumber: 25
|
|
462
|
+
}, this), !b.insertable && b.reason ? /* @__PURE__ */ jsxDEV("span", {
|
|
338
463
|
className: "block text-kit-xs text-kit-fg-3",
|
|
339
464
|
children: b.reason
|
|
340
|
-
}
|
|
465
|
+
}, void 0, false, {
|
|
466
|
+
fileName: _jsxFileName,
|
|
467
|
+
lineNumber: 313,
|
|
468
|
+
columnNumber: 27
|
|
469
|
+
}, this) : b.description ? /* @__PURE__ */ jsxDEV("span", {
|
|
341
470
|
className: "block truncate text-kit-xs text-kit-fg-3",
|
|
342
471
|
children: b.description
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
|
|
472
|
+
}, void 0, false, {
|
|
473
|
+
fileName: _jsxFileName,
|
|
474
|
+
lineNumber: 315,
|
|
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);
|
|
346
487
|
})]
|
|
347
|
-
}, c
|
|
488
|
+
}, c, true, {
|
|
489
|
+
fileName: _jsxFileName,
|
|
490
|
+
lineNumber: 287,
|
|
491
|
+
columnNumber: 13
|
|
492
|
+
}, this))
|
|
348
493
|
]
|
|
349
|
-
}
|
|
350
|
-
|
|
494
|
+
}, void 0, true, {
|
|
495
|
+
fileName: _jsxFileName,
|
|
496
|
+
lineNumber: 274,
|
|
497
|
+
columnNumber: 9
|
|
498
|
+
}, this),
|
|
499
|
+
note ? /* @__PURE__ */ jsxDEV("p", {
|
|
351
500
|
className: "border-t border-kit-line px-3 py-2 text-kit-xs text-kit-fg-3",
|
|
352
501
|
children: note
|
|
353
|
-
}
|
|
354
|
-
|
|
502
|
+
}, void 0, false, {
|
|
503
|
+
fileName: _jsxFileName,
|
|
504
|
+
lineNumber: 324,
|
|
505
|
+
columnNumber: 17
|
|
506
|
+
}, this) : null,
|
|
507
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
355
508
|
"data-hint": "shortcuts",
|
|
356
509
|
className: "border-t border-kit-line px-3 py-1.5 text-kit-2xs text-kit-fg-3",
|
|
357
510
|
children: "↵ add · type to search"
|
|
358
|
-
}
|
|
511
|
+
}, void 0, false, {
|
|
512
|
+
fileName: _jsxFileName,
|
|
513
|
+
lineNumber: 325,
|
|
514
|
+
columnNumber: 9
|
|
515
|
+
}, this)
|
|
359
516
|
]
|
|
360
|
-
}
|
|
361
|
-
|
|
517
|
+
}, void 0, true, {
|
|
518
|
+
fileName: _jsxFileName,
|
|
519
|
+
lineNumber: 243,
|
|
520
|
+
columnNumber: 7
|
|
521
|
+
}, this)]
|
|
522
|
+
}, void 0, true, {
|
|
523
|
+
fileName: _jsxFileName,
|
|
524
|
+
lineNumber: 234,
|
|
525
|
+
columnNumber: 5
|
|
526
|
+
}, this);
|
|
362
527
|
}
|
|
363
528
|
//#endregion
|
|
364
529
|
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,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;CAC3B,MAAM,QAAQ,KAAK;CACnB,MAAM,MAAM,KAAK,WAAW,KAAK,MAAM;CACvC,MAAM,CAAC,QAAQ,aAAa,MAAM,SAAwB,IAA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;QArBE,GAAA,EAAE,EAqBJ;OAET,CAAC,CACA;MAlCK,GAAA,CAkCL,CACN;KACE;;IACJ,OAAO,oBAAC,KAAD;KAAG,WAAU;KAAgE,UAAA;IAAQ,CAAA,IAAI;IACjG,oBAAC,OAAD;KAAK,aAAU;KAAY,WAAU;KAAkE,UAAA;IAElG,CAAA;GACS;EACT,CAAA,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,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;EA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