@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
|
@@ -2,9 +2,10 @@ 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 { jsxDEV } from "react/jsx-dev-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";
|
|
8
9
|
var EMBED_ASPECTS = [
|
|
9
10
|
"16:9",
|
|
10
11
|
"4:3",
|
|
@@ -77,16 +78,56 @@ var NO_SHAPE_SCHEMA = {
|
|
|
77
78
|
fields: EMBED_SCHEMA.fields.filter((f) => f.name !== "aspect")
|
|
78
79
|
};
|
|
79
80
|
var PROVIDER_ICON = {
|
|
80
|
-
youtube: /* @__PURE__ */
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
81
|
+
youtube: /* @__PURE__ */ jsxDEV(IconBrandYoutube, { stroke: 1.5 }, void 0, false, {
|
|
82
|
+
fileName: _jsxFileName,
|
|
83
|
+
lineNumber: 61,
|
|
84
|
+
columnNumber: 12
|
|
85
|
+
}, void 0),
|
|
86
|
+
vimeo: /* @__PURE__ */ jsxDEV(IconBrandVimeo, { stroke: 1.5 }, void 0, false, {
|
|
87
|
+
fileName: _jsxFileName,
|
|
88
|
+
lineNumber: 61,
|
|
89
|
+
columnNumber: 54
|
|
90
|
+
}, void 0),
|
|
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)
|
|
90
131
|
};
|
|
91
132
|
var ASPECT_RATIO = {
|
|
92
133
|
"16:9": "16 / 9",
|
|
@@ -97,88 +138,172 @@ var ASPECT_RATIO = {
|
|
|
97
138
|
var bare = (url) => url.replace(/^https?:\/\/(www\.)?/, "");
|
|
98
139
|
/** A faithful placeholder: provider, title and shape, no third-party frame in the editor. */
|
|
99
140
|
function EmbedPreview({ m, onAdd, ro }) {
|
|
100
|
-
if (!m.url) return /* @__PURE__ */
|
|
101
|
-
icon: /* @__PURE__ */
|
|
141
|
+
if (!m.url) return /* @__PURE__ */ jsxDEV(ArticleEmpty, {
|
|
142
|
+
icon: /* @__PURE__ */ jsxDEV(IconLink, { stroke: 1.5 }, void 0, false, {
|
|
143
|
+
fileName: _jsxFileName,
|
|
144
|
+
lineNumber: 70,
|
|
145
|
+
columnNumber: 42
|
|
146
|
+
}, this),
|
|
102
147
|
title: EMBED_LABEL,
|
|
103
148
|
action: "Paste a link",
|
|
104
149
|
onAction: onAdd,
|
|
105
150
|
ro
|
|
106
|
-
}
|
|
151
|
+
}, void 0, false, {
|
|
152
|
+
fileName: _jsxFileName,
|
|
153
|
+
lineNumber: 70,
|
|
154
|
+
columnNumber: 22
|
|
155
|
+
}, this);
|
|
107
156
|
const info = detectEmbed(m.url);
|
|
108
157
|
const icon = PROVIDER_ICON[info.provider];
|
|
109
|
-
const title = m.title || /* @__PURE__ */
|
|
158
|
+
const title = m.title || /* @__PURE__ */ jsxDEV("span", {
|
|
110
159
|
className: "text-kit-warning-fg",
|
|
111
160
|
children: "Add a title"
|
|
112
|
-
}
|
|
113
|
-
|
|
161
|
+
}, void 0, false, {
|
|
162
|
+
fileName: _jsxFileName,
|
|
163
|
+
lineNumber: 73,
|
|
164
|
+
columnNumber: 28
|
|
165
|
+
}, this);
|
|
166
|
+
if (info.shape === "frame") return /* @__PURE__ */ jsxDEV("figure", {
|
|
114
167
|
className: "m-0",
|
|
115
168
|
"data-field": "url",
|
|
116
|
-
children: /* @__PURE__ */
|
|
169
|
+
children: /* @__PURE__ */ jsxDEV("div", {
|
|
117
170
|
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]"),
|
|
118
171
|
style: { aspectRatio: ASPECT_RATIO[m.aspect] },
|
|
119
172
|
children: [
|
|
120
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
121
174
|
className: "flex size-11 items-center justify-center rounded-full bg-kit-inverse text-kit-fg-inverse [&_svg]:size-5",
|
|
122
|
-
children: info.provider === "youtube" || info.provider === "vimeo" ? /* @__PURE__ */
|
|
123
|
-
|
|
124
|
-
|
|
175
|
+
children: info.provider === "youtube" || info.provider === "vimeo" ? /* @__PURE__ */ jsxDEV(IconPlayerPlayFilled, {}, void 0, false, {
|
|
176
|
+
fileName: _jsxFileName,
|
|
177
|
+
lineNumber: 85,
|
|
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", {
|
|
125
186
|
"data-field": "title",
|
|
126
187
|
className: "max-w-[80%] truncate text-kit-sm font-medium text-kit-fg",
|
|
127
188
|
children: title
|
|
128
|
-
}
|
|
129
|
-
|
|
189
|
+
}, void 0, false, {
|
|
190
|
+
fileName: _jsxFileName,
|
|
191
|
+
lineNumber: 87,
|
|
192
|
+
columnNumber: 11
|
|
193
|
+
}, this),
|
|
194
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
130
195
|
className: "absolute left-3 top-2.5 flex items-center gap-1.5 text-kit-xs text-kit-fg-2 [&_svg]:size-3.5",
|
|
131
196
|
children: [icon, info.label]
|
|
132
|
-
}
|
|
197
|
+
}, void 0, true, {
|
|
198
|
+
fileName: _jsxFileName,
|
|
199
|
+
lineNumber: 88,
|
|
200
|
+
columnNumber: 11
|
|
201
|
+
}, this)
|
|
133
202
|
]
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
203
|
+
}, void 0, true, {
|
|
204
|
+
fileName: _jsxFileName,
|
|
205
|
+
lineNumber: 77,
|
|
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", {
|
|
137
214
|
className: "m-0 flex items-center gap-3 rounded-kit-lg border border-kit-line bg-kit-subtle px-3 py-2.5",
|
|
138
215
|
"data-field": "url",
|
|
139
216
|
children: [
|
|
140
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
141
218
|
className: "flex size-9 shrink-0 items-center justify-center rounded-full bg-kit-inverse text-kit-fg-inverse [&_svg]:size-4",
|
|
142
|
-
children: /* @__PURE__ */
|
|
143
|
-
|
|
144
|
-
|
|
219
|
+
children: /* @__PURE__ */ jsxDEV(IconPlayerPlayFilled, {}, void 0, false, {
|
|
220
|
+
fileName: _jsxFileName,
|
|
221
|
+
lineNumber: 99,
|
|
222
|
+
columnNumber: 11
|
|
223
|
+
}, this)
|
|
224
|
+
}, void 0, false, {
|
|
225
|
+
fileName: _jsxFileName,
|
|
226
|
+
lineNumber: 98,
|
|
227
|
+
columnNumber: 9
|
|
228
|
+
}, this),
|
|
229
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
145
230
|
className: "min-w-0 flex-1",
|
|
146
|
-
children: [/* @__PURE__ */
|
|
231
|
+
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
147
232
|
"data-field": "title",
|
|
148
233
|
className: "block truncate text-kit-sm font-medium text-kit-fg",
|
|
149
234
|
children: title
|
|
150
|
-
}
|
|
235
|
+
}, void 0, false, {
|
|
236
|
+
fileName: _jsxFileName,
|
|
237
|
+
lineNumber: 102,
|
|
238
|
+
columnNumber: 11
|
|
239
|
+
}, this), /* @__PURE__ */ jsxDEV("span", {
|
|
151
240
|
className: "flex items-center gap-1 text-kit-xs text-kit-fg-3 [&_svg]:size-3",
|
|
152
241
|
children: [icon, info.label]
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
242
|
+
}, void 0, true, {
|
|
243
|
+
fileName: _jsxFileName,
|
|
244
|
+
lineNumber: 103,
|
|
245
|
+
columnNumber: 11
|
|
246
|
+
}, this)]
|
|
247
|
+
}, void 0, true, {
|
|
248
|
+
fileName: _jsxFileName,
|
|
249
|
+
lineNumber: 101,
|
|
250
|
+
columnNumber: 9
|
|
251
|
+
}, this),
|
|
252
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
156
253
|
"aria-hidden": true,
|
|
157
254
|
className: "hidden h-1 w-28 rounded-full bg-kit-line-strong sm:block"
|
|
158
|
-
}
|
|
255
|
+
}, void 0, false, {
|
|
256
|
+
fileName: _jsxFileName,
|
|
257
|
+
lineNumber: 108,
|
|
258
|
+
columnNumber: 9
|
|
259
|
+
}, this)
|
|
159
260
|
]
|
|
160
|
-
}
|
|
161
|
-
|
|
261
|
+
}, void 0, true, {
|
|
262
|
+
fileName: _jsxFileName,
|
|
263
|
+
lineNumber: 97,
|
|
264
|
+
columnNumber: 7
|
|
265
|
+
}, this);
|
|
266
|
+
return /* @__PURE__ */ jsxDEV("figure", {
|
|
162
267
|
className: "m-0 flex items-center gap-3 rounded-kit-lg border border-kit-line bg-kit-surface px-3 py-2.5",
|
|
163
268
|
"data-field": "url",
|
|
164
|
-
children: [/* @__PURE__ */
|
|
269
|
+
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
165
270
|
className: "flex size-9 shrink-0 items-center justify-center rounded-kit-md bg-kit-muted text-kit-fg-2 [&_svg]:size-4",
|
|
166
271
|
children: icon
|
|
167
|
-
}
|
|
272
|
+
}, void 0, false, {
|
|
273
|
+
fileName: _jsxFileName,
|
|
274
|
+
lineNumber: 113,
|
|
275
|
+
columnNumber: 7
|
|
276
|
+
}, this), /* @__PURE__ */ jsxDEV("span", {
|
|
168
277
|
className: "min-w-0 flex-1",
|
|
169
|
-
children: [/* @__PURE__ */
|
|
278
|
+
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
170
279
|
"data-field": "title",
|
|
171
280
|
className: "block truncate text-kit-sm font-medium text-kit-fg",
|
|
172
281
|
children: title
|
|
173
|
-
}
|
|
282
|
+
}, void 0, false, {
|
|
283
|
+
fileName: _jsxFileName,
|
|
284
|
+
lineNumber: 115,
|
|
285
|
+
columnNumber: 9
|
|
286
|
+
}, this), /* @__PURE__ */ jsxDEV("span", {
|
|
174
287
|
className: "block truncate text-kit-xs text-kit-fg-3",
|
|
175
288
|
children: info.shape === "post" ? `${info.label} · ${bare(m.url)}` : bare(m.url)
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
289
|
+
}, void 0, false, {
|
|
290
|
+
fileName: _jsxFileName,
|
|
291
|
+
lineNumber: 116,
|
|
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);
|
|
179
304
|
}
|
|
180
305
|
function EmbedBlock({ m, set, el, ctx, autoFocus, shape = true }) {
|
|
181
|
-
return /* @__PURE__ */
|
|
306
|
+
return /* @__PURE__ */ jsxDEV(ArticlePopoverBlock, {
|
|
182
307
|
label: EMBED_LABEL,
|
|
183
308
|
kind: "embed",
|
|
184
309
|
schema: shape ? EMBED_SCHEMA : NO_SHAPE_SCHEMA,
|
|
@@ -197,12 +322,20 @@ function EmbedBlock({ m, set, el, ctx, autoFocus, shape = true }) {
|
|
|
197
322
|
title: String(v.title ?? ""),
|
|
198
323
|
aspect: shape ? asAspect(v.aspect) : prev.aspect
|
|
199
324
|
}),
|
|
200
|
-
children: (open, ro) => /* @__PURE__ */
|
|
325
|
+
children: (open, ro) => /* @__PURE__ */ jsxDEV(EmbedPreview, {
|
|
201
326
|
m,
|
|
202
327
|
onAdd: () => open("url"),
|
|
203
328
|
ro
|
|
204
|
-
}
|
|
205
|
-
|
|
329
|
+
}, void 0, false, {
|
|
330
|
+
fileName: _jsxFileName,
|
|
331
|
+
lineNumber: 146,
|
|
332
|
+
columnNumber: 22
|
|
333
|
+
}, this)
|
|
334
|
+
}, void 0, false, {
|
|
335
|
+
fileName: _jsxFileName,
|
|
336
|
+
lineNumber: 134,
|
|
337
|
+
columnNumber: 5
|
|
338
|
+
}, this);
|
|
206
339
|
}
|
|
207
340
|
//#endregion
|
|
208
341
|
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,IAAoB;AAE/G,IAAa,eAA2B;CACtC,MAAM;CACN,OAAO;CACP,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GAAE,MAAM;GAAO,OAAO;GAAQ,M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AClF;;CAEZ,OACE,qBAAC,UAAD;EAAQ,WAAU;EAA+F,cAAW;EAA5H,UAAA,CACE,oBAAC,QAAD;GAAM,WAAU;GAA6G,UAAA;EAAW,CAAA,GACxI,qBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA,CACE,oBAAC,QAAD;IAAM,cAAW;IAAQ,WAAU;IAAsD,UAAA;GAAY,CAAA,GACrG,oBAAC,QAAD;IAAM,WAAU;IAA4C,UAAA,KAAK,UAAU,SAAS,GAAG,KAAK,MAAM,KAAK,KAAK,EAAE,GAAG,MAAM,KAAK,EAAE,GAAG;GAAQ,CAAA,CACrI;EACA,CAAA,CAAA;;AAEZ;AAEA,SAAgB,WAAW,EACzB,GAAG,KAAK,IAAI,KAAK,WAAW,QAAQ,QASnC;CACD,OACE,oBAAC,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,oBAAC,cAAD;GAAiB;GAAG,aAAa,KAAK,KAAK;GAAO;EAAK,CAAA;CACnD,CAAA;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,aA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A,OAAA;;;;;CACnD,GAAA,KAAA,GAAA,OAAA;;;;;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, jsxDEV } from "react/jsx-dev-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,6 +10,7 @@ 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";
|
|
13
14
|
/** The bubble's rewrite directions (V2: improve, shorter, punchier, grammar), as the host service's presets. */
|
|
14
15
|
var BUBBLE_AI = [
|
|
15
16
|
{
|
|
@@ -42,7 +43,7 @@ function SelectionBubble({ rect, fmt, allows, saveSel, onAi, onStyle, onMark, on
|
|
|
42
43
|
!!onAi,
|
|
43
44
|
!!onComment
|
|
44
45
|
]);
|
|
45
|
-
return createPortal(/* @__PURE__ */
|
|
46
|
+
return createPortal(/* @__PURE__ */ jsxDEV("div", {
|
|
46
47
|
onMouseDown: (e) => {
|
|
47
48
|
if (!e.target.closest("button")) e.preventDefault();
|
|
48
49
|
},
|
|
@@ -58,95 +59,223 @@ function SelectionBubble({ rect, fmt, allows, saveSel, onAi, onStyle, onMark, on
|
|
|
58
59
|
role: "toolbar",
|
|
59
60
|
"aria-label": "Selection formatting",
|
|
60
61
|
children: [
|
|
61
|
-
onAi ? /* @__PURE__ */
|
|
62
|
+
onAi ? /* @__PURE__ */ jsxDEV(Fragment, { children: [/* @__PURE__ */ jsxDEV(Menu, { children: [/* @__PURE__ */ jsxDEV(MenuTrigger, {
|
|
62
63
|
onMouseDown: (e) => {
|
|
63
64
|
e.preventDefault();
|
|
64
65
|
saveSel();
|
|
65
66
|
},
|
|
66
67
|
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",
|
|
67
|
-
children: [/* @__PURE__ */
|
|
68
|
-
|
|
68
|
+
children: [/* @__PURE__ */ jsxDEV(Sparkle, { size: 14 }, void 0, false, {
|
|
69
|
+
fileName: _jsxFileName,
|
|
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, {
|
|
69
78
|
className: "w-52",
|
|
70
79
|
finalFocus: false,
|
|
71
|
-
children: BUBBLE_AI.map((p) => /* @__PURE__ */
|
|
72
|
-
icon: /* @__PURE__ */
|
|
80
|
+
children: BUBBLE_AI.map((p) => /* @__PURE__ */ jsxDEV(MenuItem, {
|
|
81
|
+
icon: /* @__PURE__ */ jsxDEV(Sparkle, { size: 16 }, void 0, false, {
|
|
82
|
+
fileName: _jsxFileName,
|
|
83
|
+
lineNumber: 90,
|
|
84
|
+
columnNumber: 44
|
|
85
|
+
}, this),
|
|
73
86
|
onClick: () => onAi(p.id),
|
|
74
87
|
children: p.label
|
|
75
|
-
}, p.id
|
|
76
|
-
|
|
88
|
+
}, p.id, false, {
|
|
89
|
+
fileName: _jsxFileName,
|
|
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", {
|
|
77
102
|
"aria-hidden": true,
|
|
78
103
|
className: "mx-0.5 h-4 w-px bg-kit-line"
|
|
79
|
-
}
|
|
80
|
-
|
|
104
|
+
}, void 0, false, {
|
|
105
|
+
fileName: _jsxFileName,
|
|
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, {
|
|
81
114
|
block: fmt.block,
|
|
82
115
|
styles,
|
|
83
116
|
onPick: onStyle
|
|
84
|
-
}
|
|
117
|
+
}, void 0, false, {
|
|
118
|
+
fileName: _jsxFileName,
|
|
119
|
+
lineNumber: 101,
|
|
120
|
+
columnNumber: 11
|
|
121
|
+
}, this), /* @__PURE__ */ jsxDEV("span", {
|
|
85
122
|
"aria-hidden": true,
|
|
86
123
|
className: "mx-0.5 h-4 w-px bg-kit-line"
|
|
87
|
-
}
|
|
88
|
-
|
|
124
|
+
}, void 0, false, {
|
|
125
|
+
fileName: _jsxFileName,
|
|
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, {
|
|
89
134
|
label: "Bold",
|
|
90
|
-
icon: /* @__PURE__ */
|
|
135
|
+
icon: /* @__PURE__ */ jsxDEV(IconBold, { stroke: 1.5 }, void 0, false, {
|
|
136
|
+
fileName: _jsxFileName,
|
|
137
|
+
lineNumber: 105,
|
|
138
|
+
columnNumber: 56
|
|
139
|
+
}, this),
|
|
91
140
|
shortcut: "⌘B",
|
|
92
141
|
active: fmt.bold,
|
|
93
142
|
onClick: () => onMark("bold")
|
|
94
|
-
}
|
|
95
|
-
|
|
143
|
+
}, void 0, false, {
|
|
144
|
+
fileName: _jsxFileName,
|
|
145
|
+
lineNumber: 105,
|
|
146
|
+
columnNumber: 25
|
|
147
|
+
}, this) : null,
|
|
148
|
+
allows("italic") ? /* @__PURE__ */ jsxDEV(ToolButton, {
|
|
96
149
|
label: "Italic",
|
|
97
|
-
icon: /* @__PURE__ */
|
|
150
|
+
icon: /* @__PURE__ */ jsxDEV(IconItalic, { stroke: 1.5 }, void 0, false, {
|
|
151
|
+
fileName: _jsxFileName,
|
|
152
|
+
lineNumber: 106,
|
|
153
|
+
columnNumber: 60
|
|
154
|
+
}, this),
|
|
98
155
|
shortcut: "⌘I",
|
|
99
156
|
active: fmt.italic,
|
|
100
157
|
onClick: () => onMark("italic")
|
|
101
|
-
}
|
|
102
|
-
|
|
158
|
+
}, void 0, false, {
|
|
159
|
+
fileName: _jsxFileName,
|
|
160
|
+
lineNumber: 106,
|
|
161
|
+
columnNumber: 27
|
|
162
|
+
}, this) : null,
|
|
163
|
+
allows("underline") ? /* @__PURE__ */ jsxDEV(ToolButton, {
|
|
103
164
|
label: "Underline",
|
|
104
|
-
icon: /* @__PURE__ */
|
|
165
|
+
icon: /* @__PURE__ */ jsxDEV(IconUnderline, { stroke: 1.5 }, void 0, false, {
|
|
166
|
+
fileName: _jsxFileName,
|
|
167
|
+
lineNumber: 107,
|
|
168
|
+
columnNumber: 66
|
|
169
|
+
}, this),
|
|
105
170
|
shortcut: "⌘U",
|
|
106
171
|
active: fmt.underline,
|
|
107
172
|
onClick: () => onMark("underline")
|
|
108
|
-
}
|
|
109
|
-
|
|
173
|
+
}, void 0, false, {
|
|
174
|
+
fileName: _jsxFileName,
|
|
175
|
+
lineNumber: 107,
|
|
176
|
+
columnNumber: 30
|
|
177
|
+
}, this) : null,
|
|
178
|
+
allows("strike") ? /* @__PURE__ */ jsxDEV(ToolButton, {
|
|
110
179
|
label: "Strikethrough",
|
|
111
|
-
icon: /* @__PURE__ */
|
|
180
|
+
icon: /* @__PURE__ */ jsxDEV(IconStrikethrough, { stroke: 1.5 }, void 0, false, {
|
|
181
|
+
fileName: _jsxFileName,
|
|
182
|
+
lineNumber: 108,
|
|
183
|
+
columnNumber: 67
|
|
184
|
+
}, this),
|
|
112
185
|
active: fmt.strike,
|
|
113
186
|
onClick: () => onMark("strikeThrough")
|
|
114
|
-
}
|
|
115
|
-
|
|
187
|
+
}, void 0, false, {
|
|
188
|
+
fileName: _jsxFileName,
|
|
189
|
+
lineNumber: 108,
|
|
190
|
+
columnNumber: 27
|
|
191
|
+
}, this) : null,
|
|
192
|
+
allows("sup") ? /* @__PURE__ */ jsxDEV(ToolButton, {
|
|
116
193
|
label: "Superscript",
|
|
117
|
-
icon: /* @__PURE__ */
|
|
194
|
+
icon: /* @__PURE__ */ jsxDEV(IconSuperscript, { stroke: 1.5 }, void 0, false, {
|
|
195
|
+
fileName: _jsxFileName,
|
|
196
|
+
lineNumber: 110,
|
|
197
|
+
columnNumber: 62
|
|
198
|
+
}, this),
|
|
118
199
|
active: fmt.sup,
|
|
119
200
|
onClick: () => onMark("superscript")
|
|
120
|
-
}
|
|
121
|
-
|
|
201
|
+
}, void 0, false, {
|
|
202
|
+
fileName: _jsxFileName,
|
|
203
|
+
lineNumber: 110,
|
|
204
|
+
columnNumber: 24
|
|
205
|
+
}, this) : null,
|
|
206
|
+
allows("sub") ? /* @__PURE__ */ jsxDEV(ToolButton, {
|
|
122
207
|
label: "Subscript",
|
|
123
|
-
icon: /* @__PURE__ */
|
|
208
|
+
icon: /* @__PURE__ */ jsxDEV(IconSubscript, { stroke: 1.5 }, void 0, false, {
|
|
209
|
+
fileName: _jsxFileName,
|
|
210
|
+
lineNumber: 111,
|
|
211
|
+
columnNumber: 60
|
|
212
|
+
}, this),
|
|
124
213
|
active: fmt.sub,
|
|
125
214
|
onClick: () => onMark("subscript")
|
|
126
|
-
}
|
|
127
|
-
|
|
215
|
+
}, void 0, false, {
|
|
216
|
+
fileName: _jsxFileName,
|
|
217
|
+
lineNumber: 111,
|
|
218
|
+
columnNumber: 24
|
|
219
|
+
}, this) : null,
|
|
220
|
+
allows("code") ? /* @__PURE__ */ jsxDEV(ToolButton, {
|
|
128
221
|
label: "Inline code",
|
|
129
|
-
icon: /* @__PURE__ */
|
|
222
|
+
icon: /* @__PURE__ */ jsxDEV(IconCode, { stroke: 1.5 }, void 0, false, {
|
|
223
|
+
fileName: _jsxFileName,
|
|
224
|
+
lineNumber: 112,
|
|
225
|
+
columnNumber: 63
|
|
226
|
+
}, this),
|
|
130
227
|
shortcut: "⌘E",
|
|
131
228
|
onClick: onInlineCode
|
|
132
|
-
}
|
|
133
|
-
|
|
229
|
+
}, void 0, false, {
|
|
230
|
+
fileName: _jsxFileName,
|
|
231
|
+
lineNumber: 112,
|
|
232
|
+
columnNumber: 25
|
|
233
|
+
}, this) : null,
|
|
234
|
+
allows("link") ? /* @__PURE__ */ jsxDEV(ToolButton, {
|
|
134
235
|
label: "Link",
|
|
135
|
-
icon: /* @__PURE__ */
|
|
236
|
+
icon: /* @__PURE__ */ jsxDEV(IconLink, { stroke: 1.5 }, void 0, false, {
|
|
237
|
+
fileName: _jsxFileName,
|
|
238
|
+
lineNumber: 113,
|
|
239
|
+
columnNumber: 56
|
|
240
|
+
}, this),
|
|
136
241
|
shortcut: "⌘K",
|
|
137
242
|
active: fmt.onLink,
|
|
138
243
|
onClick: onLink
|
|
139
|
-
}
|
|
140
|
-
|
|
244
|
+
}, void 0, false, {
|
|
245
|
+
fileName: _jsxFileName,
|
|
246
|
+
lineNumber: 113,
|
|
247
|
+
columnNumber: 25
|
|
248
|
+
}, this) : null,
|
|
249
|
+
onComment ? /* @__PURE__ */ jsxDEV(Fragment, { children: [/* @__PURE__ */ jsxDEV("span", {
|
|
141
250
|
"aria-hidden": true,
|
|
142
251
|
className: "mx-0.5 h-4 w-px bg-kit-line"
|
|
143
|
-
}
|
|
252
|
+
}, void 0, false, {
|
|
253
|
+
fileName: _jsxFileName,
|
|
254
|
+
lineNumber: 116,
|
|
255
|
+
columnNumber: 11
|
|
256
|
+
}, this), /* @__PURE__ */ jsxDEV(ToolButton, {
|
|
144
257
|
label: "Comment",
|
|
145
|
-
icon: /* @__PURE__ */
|
|
258
|
+
icon: /* @__PURE__ */ jsxDEV(IconMessage, { stroke: 1.5 }, void 0, false, {
|
|
259
|
+
fileName: _jsxFileName,
|
|
260
|
+
lineNumber: 117,
|
|
261
|
+
columnNumber: 45
|
|
262
|
+
}, this),
|
|
146
263
|
onClick: onComment
|
|
147
|
-
}
|
|
264
|
+
}, void 0, false, {
|
|
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
|
|
148
273
|
]
|
|
149
|
-
}
|
|
274
|
+
}, void 0, true, {
|
|
275
|
+
fileName: _jsxFileName,
|
|
276
|
+
lineNumber: 62,
|
|
277
|
+
columnNumber: 5
|
|
278
|
+
}, this), document.body);
|
|
150
279
|
}
|
|
151
280
|
//#endregion
|
|
152
281
|
export { BUBBLE_AI, SelectionBubble };
|