@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
|
@@ -2,10 +2,9 @@ import { cn } from "../../lib/cn.js";
|
|
|
2
2
|
import { detectEmbed } from "./dom.js";
|
|
3
3
|
import { ArticleEmpty, ArticlePopoverBlock } from "./article-shell.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import {
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { IconBrandCodepen, IconBrandFigma, IconBrandSpotify, IconBrandVimeo, IconBrandX, IconBrandYoutube, IconHeadphones, IconLink, IconMap, IconMicrophone, IconPlayerPlayFilled, IconWorld } from "@tabler/icons-react";
|
|
7
7
|
//#region src/controls/rich-text/embed.tsx
|
|
8
|
-
var _jsxFileName = "D:/Github/bettercms/bettercms-backend/packages/kit/src/controls/rich-text/embed.tsx";
|
|
9
8
|
var EMBED_ASPECTS = [
|
|
10
9
|
"16:9",
|
|
11
10
|
"4:3",
|
|
@@ -78,56 +77,16 @@ var NO_SHAPE_SCHEMA = {
|
|
|
78
77
|
fields: EMBED_SCHEMA.fields.filter((f) => f.name !== "aspect")
|
|
79
78
|
};
|
|
80
79
|
var PROVIDER_ICON = {
|
|
81
|
-
youtube: /* @__PURE__ */
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
x: /* @__PURE__ */ jsxDEV(IconBrandX, { stroke: 1.5 }, void 0, false, {
|
|
92
|
-
fileName: _jsxFileName,
|
|
93
|
-
lineNumber: 61,
|
|
94
|
-
columnNumber: 90
|
|
95
|
-
}, void 0),
|
|
96
|
-
codepen: /* @__PURE__ */ jsxDEV(IconBrandCodepen, { stroke: 1.5 }, void 0, false, {
|
|
97
|
-
fileName: _jsxFileName,
|
|
98
|
-
lineNumber: 61,
|
|
99
|
-
columnNumber: 128
|
|
100
|
-
}, void 0),
|
|
101
|
-
figma: /* @__PURE__ */ jsxDEV(IconBrandFigma, { stroke: 1.5 }, void 0, false, {
|
|
102
|
-
fileName: _jsxFileName,
|
|
103
|
-
lineNumber: 62,
|
|
104
|
-
columnNumber: 10
|
|
105
|
-
}, void 0),
|
|
106
|
-
maps: /* @__PURE__ */ jsxDEV(IconMap, { stroke: 1.5 }, void 0, false, {
|
|
107
|
-
fileName: _jsxFileName,
|
|
108
|
-
lineNumber: 62,
|
|
109
|
-
columnNumber: 49
|
|
110
|
-
}, void 0),
|
|
111
|
-
spotify: /* @__PURE__ */ jsxDEV(IconBrandSpotify, { stroke: 1.5 }, void 0, false, {
|
|
112
|
-
fileName: _jsxFileName,
|
|
113
|
-
lineNumber: 62,
|
|
114
|
-
columnNumber: 84
|
|
115
|
-
}, void 0),
|
|
116
|
-
podcast: /* @__PURE__ */ jsxDEV(IconMicrophone, { stroke: 1.5 }, void 0, false, {
|
|
117
|
-
fileName: _jsxFileName,
|
|
118
|
-
lineNumber: 62,
|
|
119
|
-
columnNumber: 128
|
|
120
|
-
}, void 0),
|
|
121
|
-
audio: /* @__PURE__ */ jsxDEV(IconHeadphones, { stroke: 1.5 }, void 0, false, {
|
|
122
|
-
fileName: _jsxFileName,
|
|
123
|
-
lineNumber: 63,
|
|
124
|
-
columnNumber: 10
|
|
125
|
-
}, void 0),
|
|
126
|
-
link: /* @__PURE__ */ jsxDEV(IconWorld, { stroke: 1.5 }, void 0, false, {
|
|
127
|
-
fileName: _jsxFileName,
|
|
128
|
-
lineNumber: 63,
|
|
129
|
-
columnNumber: 49
|
|
130
|
-
}, void 0)
|
|
80
|
+
youtube: /* @__PURE__ */ jsx(IconBrandYoutube, { stroke: 1.5 }),
|
|
81
|
+
vimeo: /* @__PURE__ */ jsx(IconBrandVimeo, { stroke: 1.5 }),
|
|
82
|
+
x: /* @__PURE__ */ jsx(IconBrandX, { stroke: 1.5 }),
|
|
83
|
+
codepen: /* @__PURE__ */ jsx(IconBrandCodepen, { stroke: 1.5 }),
|
|
84
|
+
figma: /* @__PURE__ */ jsx(IconBrandFigma, { stroke: 1.5 }),
|
|
85
|
+
maps: /* @__PURE__ */ jsx(IconMap, { stroke: 1.5 }),
|
|
86
|
+
spotify: /* @__PURE__ */ jsx(IconBrandSpotify, { stroke: 1.5 }),
|
|
87
|
+
podcast: /* @__PURE__ */ jsx(IconMicrophone, { stroke: 1.5 }),
|
|
88
|
+
audio: /* @__PURE__ */ jsx(IconHeadphones, { stroke: 1.5 }),
|
|
89
|
+
link: /* @__PURE__ */ jsx(IconWorld, { stroke: 1.5 })
|
|
131
90
|
};
|
|
132
91
|
var ASPECT_RATIO = {
|
|
133
92
|
"16:9": "16 / 9",
|
|
@@ -138,172 +97,88 @@ var ASPECT_RATIO = {
|
|
|
138
97
|
var bare = (url) => url.replace(/^https?:\/\/(www\.)?/, "");
|
|
139
98
|
/** A faithful placeholder: provider, title and shape, no third-party frame in the editor. */
|
|
140
99
|
function EmbedPreview({ m, onAdd, ro }) {
|
|
141
|
-
if (!m.url) return /* @__PURE__ */
|
|
142
|
-
icon: /* @__PURE__ */
|
|
143
|
-
fileName: _jsxFileName,
|
|
144
|
-
lineNumber: 70,
|
|
145
|
-
columnNumber: 42
|
|
146
|
-
}, this),
|
|
100
|
+
if (!m.url) return /* @__PURE__ */ jsx(ArticleEmpty, {
|
|
101
|
+
icon: /* @__PURE__ */ jsx(IconLink, { stroke: 1.5 }),
|
|
147
102
|
title: EMBED_LABEL,
|
|
148
103
|
action: "Paste a link",
|
|
149
104
|
onAction: onAdd,
|
|
150
105
|
ro
|
|
151
|
-
}
|
|
152
|
-
fileName: _jsxFileName,
|
|
153
|
-
lineNumber: 70,
|
|
154
|
-
columnNumber: 22
|
|
155
|
-
}, this);
|
|
106
|
+
});
|
|
156
107
|
const info = detectEmbed(m.url);
|
|
157
108
|
const icon = PROVIDER_ICON[info.provider];
|
|
158
|
-
const title = m.title || /* @__PURE__ */
|
|
109
|
+
const title = m.title || /* @__PURE__ */ jsx("span", {
|
|
159
110
|
className: "text-kit-warning-fg",
|
|
160
111
|
children: "Add a title"
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
lineNumber: 73,
|
|
164
|
-
columnNumber: 28
|
|
165
|
-
}, this);
|
|
166
|
-
if (info.shape === "frame") return /* @__PURE__ */ jsxDEV("figure", {
|
|
112
|
+
});
|
|
113
|
+
if (info.shape === "frame") return /* @__PURE__ */ jsx("figure", {
|
|
167
114
|
className: "m-0",
|
|
168
115
|
"data-field": "url",
|
|
169
|
-
children: /* @__PURE__ */
|
|
116
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
170
117
|
className: cn("relative mx-auto flex w-full flex-col items-center justify-center gap-2 overflow-hidden rounded-kit-lg border border-kit-line bg-kit-subtle text-center", m.aspect === "9:16" && "max-w-[300px]"),
|
|
171
118
|
style: { aspectRatio: ASPECT_RATIO[m.aspect] },
|
|
172
119
|
children: [
|
|
173
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ jsx("span", {
|
|
174
121
|
className: "flex size-11 items-center justify-center rounded-full bg-kit-inverse text-kit-fg-inverse [&_svg]:size-5",
|
|
175
|
-
children: info.provider === "youtube" || info.provider === "vimeo" ? /* @__PURE__ */
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
columnNumber: 73
|
|
179
|
-
}, this) : icon
|
|
180
|
-
}, void 0, false, {
|
|
181
|
-
fileName: _jsxFileName,
|
|
182
|
-
lineNumber: 84,
|
|
183
|
-
columnNumber: 11
|
|
184
|
-
}, this),
|
|
185
|
-
/* @__PURE__ */ jsxDEV("span", {
|
|
122
|
+
children: info.provider === "youtube" || info.provider === "vimeo" ? /* @__PURE__ */ jsx(IconPlayerPlayFilled, {}) : icon
|
|
123
|
+
}),
|
|
124
|
+
/* @__PURE__ */ jsx("span", {
|
|
186
125
|
"data-field": "title",
|
|
187
126
|
className: "max-w-[80%] truncate text-kit-sm font-medium text-kit-fg",
|
|
188
127
|
children: title
|
|
189
|
-
},
|
|
190
|
-
|
|
191
|
-
lineNumber: 87,
|
|
192
|
-
columnNumber: 11
|
|
193
|
-
}, this),
|
|
194
|
-
/* @__PURE__ */ jsxDEV("span", {
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ jsxs("span", {
|
|
195
130
|
className: "absolute left-3 top-2.5 flex items-center gap-1.5 text-kit-xs text-kit-fg-2 [&_svg]:size-3.5",
|
|
196
131
|
children: [icon, info.label]
|
|
197
|
-
}
|
|
198
|
-
fileName: _jsxFileName,
|
|
199
|
-
lineNumber: 88,
|
|
200
|
-
columnNumber: 11
|
|
201
|
-
}, this)
|
|
132
|
+
})
|
|
202
133
|
]
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
columnNumber: 9
|
|
207
|
-
}, this)
|
|
208
|
-
}, void 0, false, {
|
|
209
|
-
fileName: _jsxFileName,
|
|
210
|
-
lineNumber: 76,
|
|
211
|
-
columnNumber: 7
|
|
212
|
-
}, this);
|
|
213
|
-
if (info.shape === "audio") return /* @__PURE__ */ jsxDEV("figure", {
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
if (info.shape === "audio") return /* @__PURE__ */ jsxs("figure", {
|
|
214
137
|
className: "m-0 flex items-center gap-3 rounded-kit-lg border border-kit-line bg-kit-subtle px-3 py-2.5",
|
|
215
138
|
"data-field": "url",
|
|
216
139
|
children: [
|
|
217
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ jsx("span", {
|
|
218
141
|
className: "flex size-9 shrink-0 items-center justify-center rounded-full bg-kit-inverse text-kit-fg-inverse [&_svg]:size-4",
|
|
219
|
-
children: /* @__PURE__ */
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
columnNumber: 11
|
|
223
|
-
}, this)
|
|
224
|
-
}, void 0, false, {
|
|
225
|
-
fileName: _jsxFileName,
|
|
226
|
-
lineNumber: 98,
|
|
227
|
-
columnNumber: 9
|
|
228
|
-
}, this),
|
|
229
|
-
/* @__PURE__ */ jsxDEV("span", {
|
|
142
|
+
children: /* @__PURE__ */ jsx(IconPlayerPlayFilled, {})
|
|
143
|
+
}),
|
|
144
|
+
/* @__PURE__ */ jsxs("span", {
|
|
230
145
|
className: "min-w-0 flex-1",
|
|
231
|
-
children: [/* @__PURE__ */
|
|
146
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
232
147
|
"data-field": "title",
|
|
233
148
|
className: "block truncate text-kit-sm font-medium text-kit-fg",
|
|
234
149
|
children: title
|
|
235
|
-
},
|
|
236
|
-
fileName: _jsxFileName,
|
|
237
|
-
lineNumber: 102,
|
|
238
|
-
columnNumber: 11
|
|
239
|
-
}, this), /* @__PURE__ */ jsxDEV("span", {
|
|
150
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
240
151
|
className: "flex items-center gap-1 text-kit-xs text-kit-fg-3 [&_svg]:size-3",
|
|
241
152
|
children: [icon, info.label]
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
columnNumber: 11
|
|
246
|
-
}, this)]
|
|
247
|
-
}, void 0, true, {
|
|
248
|
-
fileName: _jsxFileName,
|
|
249
|
-
lineNumber: 101,
|
|
250
|
-
columnNumber: 9
|
|
251
|
-
}, this),
|
|
252
|
-
/* @__PURE__ */ jsxDEV("span", {
|
|
153
|
+
})]
|
|
154
|
+
}),
|
|
155
|
+
/* @__PURE__ */ jsx("span", {
|
|
253
156
|
"aria-hidden": true,
|
|
254
157
|
className: "hidden h-1 w-28 rounded-full bg-kit-line-strong sm:block"
|
|
255
|
-
}
|
|
256
|
-
fileName: _jsxFileName,
|
|
257
|
-
lineNumber: 108,
|
|
258
|
-
columnNumber: 9
|
|
259
|
-
}, this)
|
|
158
|
+
})
|
|
260
159
|
]
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
lineNumber: 97,
|
|
264
|
-
columnNumber: 7
|
|
265
|
-
}, this);
|
|
266
|
-
return /* @__PURE__ */ jsxDEV("figure", {
|
|
160
|
+
});
|
|
161
|
+
return /* @__PURE__ */ jsxs("figure", {
|
|
267
162
|
className: "m-0 flex items-center gap-3 rounded-kit-lg border border-kit-line bg-kit-surface px-3 py-2.5",
|
|
268
163
|
"data-field": "url",
|
|
269
|
-
children: [/* @__PURE__ */
|
|
164
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
270
165
|
className: "flex size-9 shrink-0 items-center justify-center rounded-kit-md bg-kit-muted text-kit-fg-2 [&_svg]:size-4",
|
|
271
166
|
children: icon
|
|
272
|
-
},
|
|
273
|
-
fileName: _jsxFileName,
|
|
274
|
-
lineNumber: 113,
|
|
275
|
-
columnNumber: 7
|
|
276
|
-
}, this), /* @__PURE__ */ jsxDEV("span", {
|
|
167
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
277
168
|
className: "min-w-0 flex-1",
|
|
278
|
-
children: [/* @__PURE__ */
|
|
169
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
279
170
|
"data-field": "title",
|
|
280
171
|
className: "block truncate text-kit-sm font-medium text-kit-fg",
|
|
281
172
|
children: title
|
|
282
|
-
},
|
|
283
|
-
fileName: _jsxFileName,
|
|
284
|
-
lineNumber: 115,
|
|
285
|
-
columnNumber: 9
|
|
286
|
-
}, this), /* @__PURE__ */ jsxDEV("span", {
|
|
173
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
287
174
|
className: "block truncate text-kit-xs text-kit-fg-3",
|
|
288
175
|
children: info.shape === "post" ? `${info.label} · ${bare(m.url)}` : bare(m.url)
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
columnNumber: 9
|
|
293
|
-
}, this)]
|
|
294
|
-
}, void 0, true, {
|
|
295
|
-
fileName: _jsxFileName,
|
|
296
|
-
lineNumber: 114,
|
|
297
|
-
columnNumber: 7
|
|
298
|
-
}, this)]
|
|
299
|
-
}, void 0, true, {
|
|
300
|
-
fileName: _jsxFileName,
|
|
301
|
-
lineNumber: 112,
|
|
302
|
-
columnNumber: 5
|
|
303
|
-
}, this);
|
|
176
|
+
})]
|
|
177
|
+
})]
|
|
178
|
+
});
|
|
304
179
|
}
|
|
305
180
|
function EmbedBlock({ m, set, el, ctx, autoFocus, shape = true }) {
|
|
306
|
-
return /* @__PURE__ */
|
|
181
|
+
return /* @__PURE__ */ jsx(ArticlePopoverBlock, {
|
|
307
182
|
label: EMBED_LABEL,
|
|
308
183
|
kind: "embed",
|
|
309
184
|
schema: shape ? EMBED_SCHEMA : NO_SHAPE_SCHEMA,
|
|
@@ -322,20 +197,12 @@ function EmbedBlock({ m, set, el, ctx, autoFocus, shape = true }) {
|
|
|
322
197
|
title: String(v.title ?? ""),
|
|
323
198
|
aspect: shape ? asAspect(v.aspect) : prev.aspect
|
|
324
199
|
}),
|
|
325
|
-
children: (open, ro) => /* @__PURE__ */
|
|
200
|
+
children: (open, ro) => /* @__PURE__ */ jsx(EmbedPreview, {
|
|
326
201
|
m,
|
|
327
202
|
onAdd: () => open("url"),
|
|
328
203
|
ro
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
lineNumber: 146,
|
|
332
|
-
columnNumber: 22
|
|
333
|
-
}, this)
|
|
334
|
-
}, void 0, false, {
|
|
335
|
-
fileName: _jsxFileName,
|
|
336
|
-
lineNumber: 134,
|
|
337
|
-
columnNumber: 5
|
|
338
|
-
}, this);
|
|
204
|
+
})
|
|
205
|
+
});
|
|
339
206
|
}
|
|
340
207
|
//#endregion
|
|
341
208
|
export { EMBED_ASPECTS, EMBED_LABEL, EMBED_SCHEMA, EmbedBlock, EmbedPreview, embedDefault };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embed.js","names":[],"sources":["../../../src/controls/rich-text/embed.tsx"],"sourcesContent":["/**\n * RICH TEXT · Embed (kit-richtext-ui-spec.md §3): V2's article block, stored as the PT block object\n * `{ _type: \"embed\", url, title, aspect }`. The provider and its shape are detected from the link (dom.ts detectEmbed),\n * never stored. Supersedes blocks.tsx EmbedBlock/EmbedPreview, which had no stored Shape (kit-40 removes those).\n *\n * form V2 article.ts:115-136: Link (required), Title (required, max 120, screen-reader only), Shape (a select:\n * 16:9 Landscape, 4:3 Classic, 1:1 Square, 9:16 Portrait). Three settings → the shell's popover (D54).\n * preview V2 article-blocks.tsx:482-535: a faithful placeholder, nothing third-party in the editor. A frame is\n * drawn at its Shape (9:16 capped at 300px wide), audio as a slim player, an X post or any other link as a\n * card. On the site an X post is a static card by default (owner, 2026-10-24); the editor shows V2's card.\n */\nimport * as React from \"react\";\nimport {\n IconBrandCodepen, IconBrandFigma, IconBrandSpotify, IconBrandVimeo, IconBrandX, IconBrandYoutube, IconHeadphones, IconLink, IconMap, IconMicrophone,\n IconPlayerPlayFilled, IconWorld,\n} from \"@tabler/icons-react\";\nimport { cn } from \"../../lib/cn\";\nimport type { TypeSchema } from \"../../schema/types\";\nimport { ArticleEmpty, ArticlePopoverBlock } from \"./article-shell\";\nimport type { IslandCtx } from \"./blocks\";\nimport { detectEmbed, type IslandEl } from \"./dom\";\n\nexport type EmbedAspect = \"16:9\" | \"4:3\" | \"1:1\" | \"9:16\";\nexport const EMBED_ASPECTS: readonly EmbedAspect[] = [\"16:9\", \"4:3\", \"1:1\", \"9:16\"];\nexport interface EmbedBlockModel {\n url: string;\n title: string;\n aspect: EmbedAspect;\n}\nexport const EMBED_LABEL = \"Embed\";\nexport const embedDefault = (): EmbedBlockModel => ({ url: \"\", title: \"\", aspect: \"16:9\" });\nconst asAspect = (v: unknown): EmbedAspect => (EMBED_ASPECTS.includes(v as EmbedAspect) ? (v as EmbedAspect) : \"16:9\");\n\nexport const EMBED_SCHEMA: TypeSchema = {\n name: \"embed\",\n title: EMBED_LABEL,\n kind: \"object\",\n icon: \"code\",\n fields: [\n { name: \"url\", title: \"Link\", type: \"url\", placeholder: \"Paste a YouTube, X, CodePen, Figma or map link\", validation: { required: true } },\n { name: \"title\", title: \"Title\", type: \"string\", validation: { required: true, max: 120 }, description: \"Not shown. Read by screen readers.\" },\n {\n name: \"aspect\",\n title: \"Shape\",\n type: \"select\",\n initialValue: \"16:9\",\n options: [\n { value: \"16:9\", label: \"16:9\", description: \"Landscape\" },\n { value: \"4:3\", label: \"4:3\", description: \"Classic\" },\n { value: \"1:1\", label: \"1:1\", description: \"Square\" },\n { value: \"9:16\", label: \"9:16\", description: \"Portrait\" },\n ],\n },\n ],\n};\n\n/** EMBED_SCHEMA without Shape, for a host whose stored embed keeps no aspect (a stored one still draws). */\nconst NO_SHAPE_SCHEMA: TypeSchema = { ...EMBED_SCHEMA, fields: EMBED_SCHEMA.fields.filter((f) => f.name !== \"aspect\") };\n\nconst PROVIDER_ICON: Record<string, React.ReactNode> = {\n youtube: <IconBrandYoutube stroke={1.5} />, vimeo: <IconBrandVimeo stroke={1.5} />, x: <IconBrandX stroke={1.5} />, codepen: <IconBrandCodepen stroke={1.5} />,\n figma: <IconBrandFigma stroke={1.5} />, maps: <IconMap stroke={1.5} />, spotify: <IconBrandSpotify stroke={1.5} />, podcast: <IconMicrophone stroke={1.5} />,\n audio: <IconHeadphones stroke={1.5} />, link: <IconWorld stroke={1.5} />,\n};\nconst ASPECT_RATIO: Record<EmbedAspect, string> = { \"16:9\": \"16 / 9\", \"4:3\": \"4 / 3\", \"1:1\": \"1 / 1\", \"9:16\": \"9 / 16\" };\nconst bare = (url: string) => url.replace(/^https?:\\/\\/(www\\.)?/, \"\");\n\n/** A faithful placeholder: provider, title and shape, no third-party frame in the editor. */\nexport function EmbedPreview({ m, onAdd, ro }: { m: EmbedBlockModel; onAdd: () => void; ro: boolean }) {\n if (!m.url) return <ArticleEmpty icon={<IconLink stroke={1.5} />} title={EMBED_LABEL} action=\"Paste a link\" onAction={onAdd} ro={ro} />;\n const info = detectEmbed(m.url);\n const icon = PROVIDER_ICON[info.provider];\n const title = m.title || <span className=\"text-kit-warning-fg\">Add a title</span>;\n if (info.shape === \"frame\")\n return (\n <figure className=\"m-0\" data-field=\"url\">\n <div\n className={cn(\n \"relative mx-auto flex w-full flex-col items-center justify-center gap-2 overflow-hidden rounded-kit-lg border border-kit-line bg-kit-subtle text-center\",\n m.aspect === \"9:16\" && \"max-w-[300px]\",\n )}\n style={{ aspectRatio: ASPECT_RATIO[m.aspect] }}\n >\n <span className=\"flex size-11 items-center justify-center rounded-full bg-kit-inverse text-kit-fg-inverse [&_svg]:size-5\">\n {info.provider === \"youtube\" || info.provider === \"vimeo\" ? <IconPlayerPlayFilled /> : icon}\n </span>\n <span data-field=\"title\" className=\"max-w-[80%] truncate text-kit-sm font-medium text-kit-fg\">{title}</span>\n <span className=\"absolute left-3 top-2.5 flex items-center gap-1.5 text-kit-xs text-kit-fg-2 [&_svg]:size-3.5\">\n {icon}\n {info.label}\n </span>\n </div>\n </figure>\n );\n if (info.shape === \"audio\")\n return (\n <figure className=\"m-0 flex items-center gap-3 rounded-kit-lg border border-kit-line bg-kit-subtle px-3 py-2.5\" data-field=\"url\">\n <span className=\"flex size-9 shrink-0 items-center justify-center rounded-full bg-kit-inverse text-kit-fg-inverse [&_svg]:size-4\">\n <IconPlayerPlayFilled />\n </span>\n <span className=\"min-w-0 flex-1\">\n <span data-field=\"title\" className=\"block truncate text-kit-sm font-medium text-kit-fg\">{title}</span>\n <span className=\"flex items-center gap-1 text-kit-xs text-kit-fg-3 [&_svg]:size-3\">\n {icon}\n {info.label}\n </span>\n </span>\n <span aria-hidden className=\"hidden h-1 w-28 rounded-full bg-kit-line-strong sm:block\" />\n </figure>\n );\n return (\n <figure className=\"m-0 flex items-center gap-3 rounded-kit-lg border border-kit-line bg-kit-surface px-3 py-2.5\" data-field=\"url\">\n <span className=\"flex size-9 shrink-0 items-center justify-center rounded-kit-md bg-kit-muted text-kit-fg-2 [&_svg]:size-4\">{icon}</span>\n <span className=\"min-w-0 flex-1\">\n <span data-field=\"title\" className=\"block truncate text-kit-sm font-medium text-kit-fg\">{title}</span>\n <span className=\"block truncate text-kit-xs text-kit-fg-3\">{info.shape === \"post\" ? `${info.label} · ${bare(m.url)}` : bare(m.url)}</span>\n </span>\n </figure>\n );\n}\n\nexport function EmbedBlock({\n m, set, el, ctx, autoFocus, shape = true,\n}: {\n /** the Shape setting is drawn only where the host stores it (e1 2026-10-24: no control that does not persist) */\n shape?: boolean;\n m: EmbedBlockModel;\n set: (fn: (m: EmbedBlockModel) => EmbedBlockModel, label?: string) => void;\n el: IslandEl;\n ctx: IslandCtx;\n autoFocus: boolean;\n}) {\n return (\n <ArticlePopoverBlock<EmbedBlockModel>\n label={EMBED_LABEL}\n kind=\"embed\"\n schema={shape ? EMBED_SCHEMA : NO_SHAPE_SCHEMA}\n m={m}\n set={set}\n el={el}\n ctx={ctx}\n autoFocus={autoFocus}\n toForm={(x) => ({ url: x.url, title: x.title, aspect: x.aspect })}\n fromForm={(v, prev) => ({ url: String(v.url ?? \"\"), title: String(v.title ?? \"\"), aspect: shape ? asAspect(v.aspect) : prev.aspect })}\n >\n {(open, ro) => <EmbedPreview m={m} onAdd={() => open(\"url\")} ro={ro} />}\n </ArticlePopoverBlock>\n );\n}\n"],"mappings":";;;;;;;;AAuBA,IAAa,gBAAwC;CAAC;CAAQ;CAAO;CAAO;AAAM;AAMlF,IAAa,cAAc;AAC3B,IAAa,sBAAuC;CAAE,KAAK;CAAI,OAAO;CAAI,QAAQ;AAAO;AACzF,IAAM,YAAY,MAA6B,cAAc,SAAS,CAAgB,IAAK,IAA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B,GAAG,KAAK,IAAI,KAAK,WAAW,QAAQ,QASnC;CACD,OACE,uBAAC,qBAAD;EACE,OAAO;EACP,MAAK;EACL,QAAQ,QAAQ,eAAe;EAC5B;EACE;EACD;EACC;EACM;EACX,SAAS,OAAO;GAAE,KAAK,EAAE;GAAK,OAAO,EAAE;GAAO,QAAQ,EAAE;EAAO;EAC/D,WAAW,GAAG,UAAU;GAAE,KAAK,OAAO,EAAE,OAAO,EAAE;GAAG,OAAO,OAAO,EAAE,SAAS,EAAE;GAAG,QAAQ,QAAQ,SAAS,EAAE,MAAM,IAAI,KAAK;EAAO;EAEjI,WAAA,MAAM,OAAO,uBAAC,cAAD;GAAiB;GAAG,aAAa,KAAK,KAAK;GAAO;EAAK,GAAA,KAAA,GAAA,OAAA;;;;;CACnD,GAAA,KAAA,GAAA,OAAA;;;;;AAEzB"}
|
|
1
|
+
{"version":3,"file":"embed.js","names":[],"sources":["../../../src/controls/rich-text/embed.tsx"],"sourcesContent":["/**\n * RICH TEXT · Embed (kit-richtext-ui-spec.md §3): V2's article block, stored as the PT block object\n * `{ _type: \"embed\", url, title, aspect }`. The provider and its shape are detected from the link (dom.ts detectEmbed),\n * never stored. Supersedes blocks.tsx EmbedBlock/EmbedPreview, which had no stored Shape (kit-40 removes those).\n *\n * form V2 article.ts:115-136: Link (required), Title (required, max 120, screen-reader only), Shape (a select:\n * 16:9 Landscape, 4:3 Classic, 1:1 Square, 9:16 Portrait). Three settings → the shell's popover (D54).\n * preview V2 article-blocks.tsx:482-535: a faithful placeholder, nothing third-party in the editor. A frame is\n * drawn at its Shape (9:16 capped at 300px wide), audio as a slim player, an X post or any other link as a\n * card. On the site an X post is a static card by default (owner, 2026-10-24); the editor shows V2's card.\n */\nimport * as React from \"react\";\nimport {\n IconBrandCodepen, IconBrandFigma, IconBrandSpotify, IconBrandVimeo, IconBrandX, IconBrandYoutube, IconHeadphones, IconLink, IconMap, IconMicrophone,\n IconPlayerPlayFilled, IconWorld,\n} from \"@tabler/icons-react\";\nimport { cn } from \"../../lib/cn\";\nimport type { TypeSchema } from \"../../schema/types\";\nimport { ArticleEmpty, ArticlePopoverBlock } from \"./article-shell\";\nimport type { IslandCtx } from \"./blocks\";\nimport { detectEmbed, type IslandEl } from \"./dom\";\n\nexport type EmbedAspect = \"16:9\" | \"4:3\" | \"1:1\" | \"9:16\";\nexport const EMBED_ASPECTS: readonly EmbedAspect[] = [\"16:9\", \"4:3\", \"1:1\", \"9:16\"];\nexport interface EmbedBlockModel {\n url: string;\n title: string;\n aspect: EmbedAspect;\n}\nexport const EMBED_LABEL = \"Embed\";\nexport const embedDefault = (): EmbedBlockModel => ({ url: \"\", title: \"\", aspect: \"16:9\" });\nconst asAspect = (v: unknown): EmbedAspect => (EMBED_ASPECTS.includes(v as EmbedAspect) ? (v as EmbedAspect) : \"16:9\");\n\nexport const EMBED_SCHEMA: TypeSchema = {\n name: \"embed\",\n title: EMBED_LABEL,\n kind: \"object\",\n icon: \"code\",\n fields: [\n { name: \"url\", title: \"Link\", type: \"url\", placeholder: \"Paste a YouTube, X, CodePen, Figma or map link\", validation: { required: true } },\n { name: \"title\", title: \"Title\", type: \"string\", validation: { required: true, max: 120 }, description: \"Not shown. Read by screen readers.\" },\n {\n name: \"aspect\",\n title: \"Shape\",\n type: \"select\",\n initialValue: \"16:9\",\n options: [\n { value: \"16:9\", label: \"16:9\", description: \"Landscape\" },\n { value: \"4:3\", label: \"4:3\", description: \"Classic\" },\n { value: \"1:1\", label: \"1:1\", description: \"Square\" },\n { value: \"9:16\", label: \"9:16\", description: \"Portrait\" },\n ],\n },\n ],\n};\n\n/** EMBED_SCHEMA without Shape, for a host whose stored embed keeps no aspect (a stored one still draws). */\nconst NO_SHAPE_SCHEMA: TypeSchema = { ...EMBED_SCHEMA, fields: EMBED_SCHEMA.fields.filter((f) => f.name !== \"aspect\") };\n\nconst PROVIDER_ICON: Record<string, React.ReactNode> = {\n youtube: <IconBrandYoutube stroke={1.5} />, vimeo: <IconBrandVimeo stroke={1.5} />, x: <IconBrandX stroke={1.5} />, codepen: <IconBrandCodepen stroke={1.5} />,\n figma: <IconBrandFigma stroke={1.5} />, maps: <IconMap stroke={1.5} />, spotify: <IconBrandSpotify stroke={1.5} />, podcast: <IconMicrophone stroke={1.5} />,\n audio: <IconHeadphones stroke={1.5} />, link: <IconWorld stroke={1.5} />,\n};\nconst ASPECT_RATIO: Record<EmbedAspect, string> = { \"16:9\": \"16 / 9\", \"4:3\": \"4 / 3\", \"1:1\": \"1 / 1\", \"9:16\": \"9 / 16\" };\nconst bare = (url: string) => url.replace(/^https?:\\/\\/(www\\.)?/, \"\");\n\n/** A faithful placeholder: provider, title and shape, no third-party frame in the editor. */\nexport function EmbedPreview({ m, onAdd, ro }: { m: EmbedBlockModel; onAdd: () => void; ro: boolean }) {\n if (!m.url) return <ArticleEmpty icon={<IconLink stroke={1.5} />} title={EMBED_LABEL} action=\"Paste a link\" onAction={onAdd} ro={ro} />;\n const info = detectEmbed(m.url);\n const icon = PROVIDER_ICON[info.provider];\n const title = m.title || <span className=\"text-kit-warning-fg\">Add a title</span>;\n if (info.shape === \"frame\")\n return (\n <figure className=\"m-0\" data-field=\"url\">\n <div\n className={cn(\n \"relative mx-auto flex w-full flex-col items-center justify-center gap-2 overflow-hidden rounded-kit-lg border border-kit-line bg-kit-subtle text-center\",\n m.aspect === \"9:16\" && \"max-w-[300px]\",\n )}\n style={{ aspectRatio: ASPECT_RATIO[m.aspect] }}\n >\n <span className=\"flex size-11 items-center justify-center rounded-full bg-kit-inverse text-kit-fg-inverse [&_svg]:size-5\">\n {info.provider === \"youtube\" || info.provider === \"vimeo\" ? <IconPlayerPlayFilled /> : icon}\n </span>\n <span data-field=\"title\" className=\"max-w-[80%] truncate text-kit-sm font-medium text-kit-fg\">{title}</span>\n <span className=\"absolute left-3 top-2.5 flex items-center gap-1.5 text-kit-xs text-kit-fg-2 [&_svg]:size-3.5\">\n {icon}\n {info.label}\n </span>\n </div>\n </figure>\n );\n if (info.shape === \"audio\")\n return (\n <figure className=\"m-0 flex items-center gap-3 rounded-kit-lg border border-kit-line bg-kit-subtle px-3 py-2.5\" data-field=\"url\">\n <span className=\"flex size-9 shrink-0 items-center justify-center rounded-full bg-kit-inverse text-kit-fg-inverse [&_svg]:size-4\">\n <IconPlayerPlayFilled />\n </span>\n <span className=\"min-w-0 flex-1\">\n <span data-field=\"title\" className=\"block truncate text-kit-sm font-medium text-kit-fg\">{title}</span>\n <span className=\"flex items-center gap-1 text-kit-xs text-kit-fg-3 [&_svg]:size-3\">\n {icon}\n {info.label}\n </span>\n </span>\n <span aria-hidden className=\"hidden h-1 w-28 rounded-full bg-kit-line-strong sm:block\" />\n </figure>\n );\n return (\n <figure className=\"m-0 flex items-center gap-3 rounded-kit-lg border border-kit-line bg-kit-surface px-3 py-2.5\" data-field=\"url\">\n <span className=\"flex size-9 shrink-0 items-center justify-center rounded-kit-md bg-kit-muted text-kit-fg-2 [&_svg]:size-4\">{icon}</span>\n <span className=\"min-w-0 flex-1\">\n <span data-field=\"title\" className=\"block truncate text-kit-sm font-medium text-kit-fg\">{title}</span>\n <span className=\"block truncate text-kit-xs text-kit-fg-3\">{info.shape === \"post\" ? `${info.label} · ${bare(m.url)}` : bare(m.url)}</span>\n </span>\n </figure>\n );\n}\n\nexport function EmbedBlock({\n m, set, el, ctx, autoFocus, shape = true,\n}: {\n /** the Shape setting is drawn only where the host stores it (e1 2026-10-24: no control that does not persist) */\n shape?: boolean;\n m: EmbedBlockModel;\n set: (fn: (m: EmbedBlockModel) => EmbedBlockModel, label?: string) => void;\n el: IslandEl;\n ctx: IslandCtx;\n autoFocus: boolean;\n}) {\n return (\n <ArticlePopoverBlock<EmbedBlockModel>\n label={EMBED_LABEL}\n kind=\"embed\"\n schema={shape ? EMBED_SCHEMA : NO_SHAPE_SCHEMA}\n m={m}\n set={set}\n el={el}\n ctx={ctx}\n autoFocus={autoFocus}\n toForm={(x) => ({ url: x.url, title: x.title, aspect: x.aspect })}\n fromForm={(v, prev) => ({ url: String(v.url ?? \"\"), title: String(v.title ?? \"\"), aspect: shape ? asAspect(v.aspect) : prev.aspect })}\n >\n {(open, ro) => <EmbedPreview m={m} onAdd={() => open(\"url\")} ro={ro} />}\n </ArticlePopoverBlock>\n );\n}\n"],"mappings":";;;;;;;AAuBA,IAAa,gBAAwC;CAAC;CAAQ;CAAO;CAAO;AAAM;AAMlF,IAAa,cAAc;AAC3B,IAAa,sBAAuC;CAAE,KAAK;CAAI,OAAO;CAAI,QAAQ;AAAO;AACzF,IAAM,YAAY,MAA6B,cAAc,SAAS,CAAgB,IAAK,IAAoB;AAE/G,IAAa,eAA2B;CACtC,MAAM;CACN,OAAO;CACP,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GAAE,MAAM;GAAO,OAAO;GAAQ,MAAM;GAAO,aAAa;GAAkD,YAAY,EAAE,UAAU,KAAK;EAAE;EACzI;GAAE,MAAM;GAAS,OAAO;GAAS,MAAM;GAAU,YAAY;IAAE,UAAU;IAAM,KAAK;GAAI;GAAG,aAAa;EAAqC;EAC7I;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,cAAc;GACd,SAAS;IACP;KAAE,OAAO;KAAQ,OAAO;KAAQ,aAAa;IAAY;IACzD;KAAE,OAAO;KAAO,OAAO;KAAO,aAAa;IAAU;IACrD;KAAE,OAAO;KAAO,OAAO;KAAO,aAAa;IAAS;IACpD;KAAE,OAAO;KAAQ,OAAO;KAAQ,aAAa;IAAW;GAC1D;EACF;CACF;AACF;;AAGA,IAAM,kBAA8B;CAAE,GAAG;CAAc,QAAQ,aAAa,OAAO,QAAQ,MAAM,EAAE,SAAS,QAAQ;AAAE;AAEtH,IAAM,gBAAiD;CACrD,SAAS,oBAAC,kBAAD,EAAkB,QAAQ,IAAM,CAAA;CAAG,OAAO,oBAAC,gBAAD,EAAgB,QAAQ,IAAM,CAAA;CAAG,GAAG,oBAAC,YAAD,EAAY,QAAQ,IAAM,CAAA;CAAG,SAAS,oBAAC,kBAAD,EAAkB,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S,EAAE;GAAG,QAAQ,QAAQ,SAAS,EAAE,MAAM,IAAI,KAAK;EAAO;EAEjI,WAAA,MAAM,OAAO,oBAAC,cAAD;GAAiB;GAAG,aAAa,KAAK,KAAK;GAAO;EAAK,CAAA;CACnD,CAAA;AAEzB"}
|
|
@@ -2,7 +2,7 @@ import { Sparkle } from "../../ui/button.js";
|
|
|
2
2
|
import { Menu, MenuContent, MenuItem, MenuTrigger } from "../../ui/overlay.js";
|
|
3
3
|
import { StyleMenu, ToolButton, stylesFor } from "./toolbar.js";
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import { Fragment,
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { IconBold, IconCode, IconItalic, IconLink, IconMessage, IconStrikethrough, IconSubscript, IconSuperscript, IconUnderline } from "@tabler/icons-react";
|
|
7
7
|
import { createPortal } from "react-dom";
|
|
8
8
|
//#region src/controls/rich-text/floating.tsx
|
|
@@ -10,7 +10,6 @@ import { createPortal } from "react-dom";
|
|
|
10
10
|
* RICH TEXT · the selection bubble: AI rewrite, style, marks, link (V2 HEAD controls/rich-text/floating.tsx).
|
|
11
11
|
* V2's inline "Ask AI" prompt took free text; the host's AI service rewrites by preset only, so it is not drawn.
|
|
12
12
|
*/
|
|
13
|
-
var _jsxFileName = "D:/Github/bettercms/bettercms-backend/packages/kit/src/controls/rich-text/floating.tsx";
|
|
14
13
|
/** The bubble's rewrite directions (V2: improve, shorter, punchier, grammar), as the host service's presets. */
|
|
15
14
|
var BUBBLE_AI = [
|
|
16
15
|
{
|
|
@@ -43,7 +42,7 @@ function SelectionBubble({ rect, fmt, allows, saveSel, onAi, onStyle, onMark, on
|
|
|
43
42
|
!!onAi,
|
|
44
43
|
!!onComment
|
|
45
44
|
]);
|
|
46
|
-
return createPortal(/* @__PURE__ */
|
|
45
|
+
return createPortal(/* @__PURE__ */ jsxs("div", {
|
|
47
46
|
onMouseDown: (e) => {
|
|
48
47
|
if (!e.target.closest("button")) e.preventDefault();
|
|
49
48
|
},
|
|
@@ -59,223 +58,95 @@ function SelectionBubble({ rect, fmt, allows, saveSel, onAi, onStyle, onMark, on
|
|
|
59
58
|
role: "toolbar",
|
|
60
59
|
"aria-label": "Selection formatting",
|
|
61
60
|
children: [
|
|
62
|
-
onAi ? /* @__PURE__ */
|
|
61
|
+
onAi ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsxs(MenuTrigger, {
|
|
63
62
|
onMouseDown: (e) => {
|
|
64
63
|
e.preventDefault();
|
|
65
64
|
saveSel();
|
|
66
65
|
},
|
|
67
66
|
className: "flex h-7 items-center gap-1.5 rounded-kit-md px-2 text-kit-sm text-kit-fg hover:bg-kit-hover data-[popup-open]:bg-kit-hover",
|
|
68
|
-
children: [/* @__PURE__ */
|
|
69
|
-
|
|
70
|
-
lineNumber: 86,
|
|
71
|
-
columnNumber: 15
|
|
72
|
-
}, this), " Improve writing"]
|
|
73
|
-
}, void 0, true, {
|
|
74
|
-
fileName: _jsxFileName,
|
|
75
|
-
lineNumber: 79,
|
|
76
|
-
columnNumber: 13
|
|
77
|
-
}, this), /* @__PURE__ */ jsxDEV(MenuContent, {
|
|
67
|
+
children: [/* @__PURE__ */ jsx(Sparkle, { size: 14 }), " Improve writing"]
|
|
68
|
+
}), /* @__PURE__ */ jsx(MenuContent, {
|
|
78
69
|
className: "w-52",
|
|
79
70
|
finalFocus: false,
|
|
80
|
-
children: BUBBLE_AI.map((p) => /* @__PURE__ */
|
|
81
|
-
icon: /* @__PURE__ */
|
|
82
|
-
fileName: _jsxFileName,
|
|
83
|
-
lineNumber: 90,
|
|
84
|
-
columnNumber: 44
|
|
85
|
-
}, this),
|
|
71
|
+
children: BUBBLE_AI.map((p) => /* @__PURE__ */ jsx(MenuItem, {
|
|
72
|
+
icon: /* @__PURE__ */ jsx(Sparkle, { size: 16 }),
|
|
86
73
|
onClick: () => onAi(p.id),
|
|
87
74
|
children: p.label
|
|
88
|
-
}, p.id
|
|
89
|
-
|
|
90
|
-
lineNumber: 90,
|
|
91
|
-
columnNumber: 17
|
|
92
|
-
}, this))
|
|
93
|
-
}, void 0, false, {
|
|
94
|
-
fileName: _jsxFileName,
|
|
95
|
-
lineNumber: 88,
|
|
96
|
-
columnNumber: 13
|
|
97
|
-
}, this)] }, void 0, true, {
|
|
98
|
-
fileName: _jsxFileName,
|
|
99
|
-
lineNumber: 78,
|
|
100
|
-
columnNumber: 11
|
|
101
|
-
}, this), /* @__PURE__ */ jsxDEV("span", {
|
|
75
|
+
}, p.id))
|
|
76
|
+
})] }), /* @__PURE__ */ jsx("span", {
|
|
102
77
|
"aria-hidden": true,
|
|
103
78
|
className: "mx-0.5 h-4 w-px bg-kit-line"
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
lineNumber: 96,
|
|
107
|
-
columnNumber: 11
|
|
108
|
-
}, this)] }, void 0, true, {
|
|
109
|
-
fileName: _jsxFileName,
|
|
110
|
-
lineNumber: 77,
|
|
111
|
-
columnNumber: 9
|
|
112
|
-
}, this) : null,
|
|
113
|
-
fmt.block !== "island" && styles.length > 1 ? /* @__PURE__ */ jsxDEV(Fragment, { children: [/* @__PURE__ */ jsxDEV(StyleMenu, {
|
|
79
|
+
})] }) : null,
|
|
80
|
+
fmt.block !== "island" && styles.length > 1 ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(StyleMenu, {
|
|
114
81
|
block: fmt.block,
|
|
115
82
|
styles,
|
|
116
83
|
onPick: onStyle
|
|
117
|
-
},
|
|
118
|
-
fileName: _jsxFileName,
|
|
119
|
-
lineNumber: 101,
|
|
120
|
-
columnNumber: 11
|
|
121
|
-
}, this), /* @__PURE__ */ jsxDEV("span", {
|
|
84
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
122
85
|
"aria-hidden": true,
|
|
123
86
|
className: "mx-0.5 h-4 w-px bg-kit-line"
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
lineNumber: 102,
|
|
127
|
-
columnNumber: 11
|
|
128
|
-
}, this)] }, void 0, true, {
|
|
129
|
-
fileName: _jsxFileName,
|
|
130
|
-
lineNumber: 100,
|
|
131
|
-
columnNumber: 9
|
|
132
|
-
}, this) : null,
|
|
133
|
-
allows("bold") ? /* @__PURE__ */ jsxDEV(ToolButton, {
|
|
87
|
+
})] }) : null,
|
|
88
|
+
allows("bold") ? /* @__PURE__ */ jsx(ToolButton, {
|
|
134
89
|
label: "Bold",
|
|
135
|
-
icon: /* @__PURE__ */
|
|
136
|
-
fileName: _jsxFileName,
|
|
137
|
-
lineNumber: 105,
|
|
138
|
-
columnNumber: 56
|
|
139
|
-
}, this),
|
|
90
|
+
icon: /* @__PURE__ */ jsx(IconBold, { stroke: 1.5 }),
|
|
140
91
|
shortcut: "⌘B",
|
|
141
92
|
active: fmt.bold,
|
|
142
93
|
onClick: () => onMark("bold")
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
lineNumber: 105,
|
|
146
|
-
columnNumber: 25
|
|
147
|
-
}, this) : null,
|
|
148
|
-
allows("italic") ? /* @__PURE__ */ jsxDEV(ToolButton, {
|
|
94
|
+
}) : null,
|
|
95
|
+
allows("italic") ? /* @__PURE__ */ jsx(ToolButton, {
|
|
149
96
|
label: "Italic",
|
|
150
|
-
icon: /* @__PURE__ */
|
|
151
|
-
fileName: _jsxFileName,
|
|
152
|
-
lineNumber: 106,
|
|
153
|
-
columnNumber: 60
|
|
154
|
-
}, this),
|
|
97
|
+
icon: /* @__PURE__ */ jsx(IconItalic, { stroke: 1.5 }),
|
|
155
98
|
shortcut: "⌘I",
|
|
156
99
|
active: fmt.italic,
|
|
157
100
|
onClick: () => onMark("italic")
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
lineNumber: 106,
|
|
161
|
-
columnNumber: 27
|
|
162
|
-
}, this) : null,
|
|
163
|
-
allows("underline") ? /* @__PURE__ */ jsxDEV(ToolButton, {
|
|
101
|
+
}) : null,
|
|
102
|
+
allows("underline") ? /* @__PURE__ */ jsx(ToolButton, {
|
|
164
103
|
label: "Underline",
|
|
165
|
-
icon: /* @__PURE__ */
|
|
166
|
-
fileName: _jsxFileName,
|
|
167
|
-
lineNumber: 107,
|
|
168
|
-
columnNumber: 66
|
|
169
|
-
}, this),
|
|
104
|
+
icon: /* @__PURE__ */ jsx(IconUnderline, { stroke: 1.5 }),
|
|
170
105
|
shortcut: "⌘U",
|
|
171
106
|
active: fmt.underline,
|
|
172
107
|
onClick: () => onMark("underline")
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
lineNumber: 107,
|
|
176
|
-
columnNumber: 30
|
|
177
|
-
}, this) : null,
|
|
178
|
-
allows("strike") ? /* @__PURE__ */ jsxDEV(ToolButton, {
|
|
108
|
+
}) : null,
|
|
109
|
+
allows("strike") ? /* @__PURE__ */ jsx(ToolButton, {
|
|
179
110
|
label: "Strikethrough",
|
|
180
|
-
icon: /* @__PURE__ */
|
|
181
|
-
fileName: _jsxFileName,
|
|
182
|
-
lineNumber: 108,
|
|
183
|
-
columnNumber: 67
|
|
184
|
-
}, this),
|
|
111
|
+
icon: /* @__PURE__ */ jsx(IconStrikethrough, { stroke: 1.5 }),
|
|
185
112
|
active: fmt.strike,
|
|
186
113
|
onClick: () => onMark("strikeThrough")
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
lineNumber: 108,
|
|
190
|
-
columnNumber: 27
|
|
191
|
-
}, this) : null,
|
|
192
|
-
allows("sup") ? /* @__PURE__ */ jsxDEV(ToolButton, {
|
|
114
|
+
}) : null,
|
|
115
|
+
allows("sup") ? /* @__PURE__ */ jsx(ToolButton, {
|
|
193
116
|
label: "Superscript",
|
|
194
|
-
icon: /* @__PURE__ */
|
|
195
|
-
fileName: _jsxFileName,
|
|
196
|
-
lineNumber: 110,
|
|
197
|
-
columnNumber: 62
|
|
198
|
-
}, this),
|
|
117
|
+
icon: /* @__PURE__ */ jsx(IconSuperscript, { stroke: 1.5 }),
|
|
199
118
|
active: fmt.sup,
|
|
200
119
|
onClick: () => onMark("superscript")
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
lineNumber: 110,
|
|
204
|
-
columnNumber: 24
|
|
205
|
-
}, this) : null,
|
|
206
|
-
allows("sub") ? /* @__PURE__ */ jsxDEV(ToolButton, {
|
|
120
|
+
}) : null,
|
|
121
|
+
allows("sub") ? /* @__PURE__ */ jsx(ToolButton, {
|
|
207
122
|
label: "Subscript",
|
|
208
|
-
icon: /* @__PURE__ */
|
|
209
|
-
fileName: _jsxFileName,
|
|
210
|
-
lineNumber: 111,
|
|
211
|
-
columnNumber: 60
|
|
212
|
-
}, this),
|
|
123
|
+
icon: /* @__PURE__ */ jsx(IconSubscript, { stroke: 1.5 }),
|
|
213
124
|
active: fmt.sub,
|
|
214
125
|
onClick: () => onMark("subscript")
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
lineNumber: 111,
|
|
218
|
-
columnNumber: 24
|
|
219
|
-
}, this) : null,
|
|
220
|
-
allows("code") ? /* @__PURE__ */ jsxDEV(ToolButton, {
|
|
126
|
+
}) : null,
|
|
127
|
+
allows("code") ? /* @__PURE__ */ jsx(ToolButton, {
|
|
221
128
|
label: "Inline code",
|
|
222
|
-
icon: /* @__PURE__ */
|
|
223
|
-
fileName: _jsxFileName,
|
|
224
|
-
lineNumber: 112,
|
|
225
|
-
columnNumber: 63
|
|
226
|
-
}, this),
|
|
129
|
+
icon: /* @__PURE__ */ jsx(IconCode, { stroke: 1.5 }),
|
|
227
130
|
shortcut: "⌘E",
|
|
228
131
|
onClick: onInlineCode
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
lineNumber: 112,
|
|
232
|
-
columnNumber: 25
|
|
233
|
-
}, this) : null,
|
|
234
|
-
allows("link") ? /* @__PURE__ */ jsxDEV(ToolButton, {
|
|
132
|
+
}) : null,
|
|
133
|
+
allows("link") ? /* @__PURE__ */ jsx(ToolButton, {
|
|
235
134
|
label: "Link",
|
|
236
|
-
icon: /* @__PURE__ */
|
|
237
|
-
fileName: _jsxFileName,
|
|
238
|
-
lineNumber: 113,
|
|
239
|
-
columnNumber: 56
|
|
240
|
-
}, this),
|
|
135
|
+
icon: /* @__PURE__ */ jsx(IconLink, { stroke: 1.5 }),
|
|
241
136
|
shortcut: "⌘K",
|
|
242
137
|
active: fmt.onLink,
|
|
243
138
|
onClick: onLink
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
lineNumber: 113,
|
|
247
|
-
columnNumber: 25
|
|
248
|
-
}, this) : null,
|
|
249
|
-
onComment ? /* @__PURE__ */ jsxDEV(Fragment, { children: [/* @__PURE__ */ jsxDEV("span", {
|
|
139
|
+
}) : null,
|
|
140
|
+
onComment ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
250
141
|
"aria-hidden": true,
|
|
251
142
|
className: "mx-0.5 h-4 w-px bg-kit-line"
|
|
252
|
-
},
|
|
253
|
-
fileName: _jsxFileName,
|
|
254
|
-
lineNumber: 116,
|
|
255
|
-
columnNumber: 11
|
|
256
|
-
}, this), /* @__PURE__ */ jsxDEV(ToolButton, {
|
|
143
|
+
}), /* @__PURE__ */ jsx(ToolButton, {
|
|
257
144
|
label: "Comment",
|
|
258
|
-
icon: /* @__PURE__ */
|
|
259
|
-
fileName: _jsxFileName,
|
|
260
|
-
lineNumber: 117,
|
|
261
|
-
columnNumber: 45
|
|
262
|
-
}, this),
|
|
145
|
+
icon: /* @__PURE__ */ jsx(IconMessage, { stroke: 1.5 }),
|
|
263
146
|
onClick: onComment
|
|
264
|
-
}
|
|
265
|
-
fileName: _jsxFileName,
|
|
266
|
-
lineNumber: 117,
|
|
267
|
-
columnNumber: 11
|
|
268
|
-
}, this)] }, void 0, true, {
|
|
269
|
-
fileName: _jsxFileName,
|
|
270
|
-
lineNumber: 115,
|
|
271
|
-
columnNumber: 9
|
|
272
|
-
}, this) : null
|
|
147
|
+
})] }) : null
|
|
273
148
|
]
|
|
274
|
-
},
|
|
275
|
-
fileName: _jsxFileName,
|
|
276
|
-
lineNumber: 62,
|
|
277
|
-
columnNumber: 5
|
|
278
|
-
}, this), document.body);
|
|
149
|
+
}), document.body);
|
|
279
150
|
}
|
|
280
151
|
//#endregion
|
|
281
152
|
export { BUBBLE_AI, SelectionBubble };
|