@bettercms-ai/kit 3.0.2 → 3.1.1
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/adapters/lossy.d.ts +1 -1
- package/dist/adapters/lossy.js +3 -2
- package/dist/adapters/lossy.js.map +1 -1
- package/dist/adapters/schema.js +5 -5
- package/dist/adapters/schema.js.map +1 -1
- 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/library/kit-catalog.json +2 -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 +1 -1
|
@@ -4,10 +4,10 @@ import { useKitServices } from "../../context.js";
|
|
|
4
4
|
import { Button, IconButton } from "../../ui/button.js";
|
|
5
5
|
import { Menu, MenuContent, MenuItem, MenuTrigger, Popover, PopoverContent, PopoverTrigger, Tooltip } from "../../ui/overlay.js";
|
|
6
6
|
import { Input, Textarea } from "../../ui/input.js";
|
|
7
|
+
import { LinkPopoverBody } from "../link.js";
|
|
7
8
|
import { TableEditor } from "../table/table-editor.js";
|
|
8
9
|
import { VideoPreview } from "../media.js";
|
|
9
10
|
import { CALLOUT_TONES, placeCaret } from "./dom.js";
|
|
10
|
-
import { LinkForm } from "./link-form.js";
|
|
11
11
|
import { ArticleActions, ArticleCard, ArticleForm, ArticlePanel, articleCardKeyDown, useArticleOpen } from "./article-shell.js";
|
|
12
12
|
import { EmbedBlock } from "./embed.js";
|
|
13
13
|
import { GalleryBlock } from "./gallery.js";
|
|
@@ -17,7 +17,7 @@ import { AuthorBlock } from "./author.js";
|
|
|
17
17
|
import { RelatedBlock } from "./related.js";
|
|
18
18
|
import { ComponentCard } from "./component-card.js";
|
|
19
19
|
import * as React from "react";
|
|
20
|
-
import { Fragment,
|
|
20
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
21
21
|
import { IconAlertTriangle, IconAlt, IconArrowsHorizontal, IconBulb, IconCheck, IconChevronDown, IconChevronRight, IconComponents, IconCopy, IconFileText, IconFileUpload, IconInfoCircle, IconLayoutAlignCenter, IconLayoutAlignLeft, IconLayoutAlignRight, IconLibraryPhoto, IconLink, IconPhoto, IconQuote, IconReplace, IconTrash, IconWorld } from "@tabler/icons-react";
|
|
22
22
|
//#region src/controls/rich-text/blocks.tsx
|
|
23
23
|
/**
|
|
@@ -37,7 +37,6 @@ import { IconAlertTriangle, IconAlt, IconArrowsHorizontal, IconBulb, IconCheck,
|
|
|
37
37
|
* written in the text itself (article-blocks.tsx TakeawaysEditor, surface "inline"): a title line and a line per point.
|
|
38
38
|
* The embed island draws embed.tsx's block (V2's article Embed: Link, Title, Shape), keeping the keys it lacks absent.
|
|
39
39
|
*/
|
|
40
|
-
var _jsxFileName = "D:/Github/bettercms/bettercms-backend/packages/kit/src/controls/rich-text/blocks.tsx";
|
|
41
40
|
function Island({ el, ctx }) {
|
|
42
41
|
const kind = el.getAttribute("data-rt-island");
|
|
43
42
|
const [model, setModel] = React.useState(() => el.__rt);
|
|
@@ -74,170 +73,106 @@ function Island({ el, ctx }) {
|
|
|
74
73
|
ctx.exit(el);
|
|
75
74
|
}
|
|
76
75
|
};
|
|
77
|
-
return /* @__PURE__ */
|
|
76
|
+
return /* @__PURE__ */ jsx("div", {
|
|
78
77
|
className: "relative select-text",
|
|
79
78
|
onKeyDown,
|
|
80
79
|
"data-island-kind": kind,
|
|
81
|
-
children: kind === "image" ? /* @__PURE__ */
|
|
80
|
+
children: kind === "image" ? /* @__PURE__ */ jsx(ImageBlock, {
|
|
82
81
|
el,
|
|
83
82
|
ctx,
|
|
84
83
|
autoFocus,
|
|
85
84
|
m: model,
|
|
86
85
|
set
|
|
87
|
-
}
|
|
88
|
-
fileName: _jsxFileName,
|
|
89
|
-
lineNumber: 133,
|
|
90
|
-
columnNumber: 27
|
|
91
|
-
}, this) : kind === "table" ? /* @__PURE__ */ jsxDEV(TableBlock, {
|
|
86
|
+
}) : kind === "table" ? /* @__PURE__ */ jsx(TableBlock, {
|
|
92
87
|
el,
|
|
93
88
|
ctx,
|
|
94
89
|
autoFocus,
|
|
95
90
|
m: model,
|
|
96
91
|
set
|
|
97
|
-
}
|
|
98
|
-
fileName: _jsxFileName,
|
|
99
|
-
lineNumber: 134,
|
|
100
|
-
columnNumber: 30
|
|
101
|
-
}, this) : kind === "pullquote" ? /* @__PURE__ */ jsxDEV(PullQuoteBlock, {
|
|
92
|
+
}) : kind === "pullquote" ? /* @__PURE__ */ jsx(PullQuoteBlock, {
|
|
102
93
|
el,
|
|
103
94
|
ctx,
|
|
104
95
|
autoFocus,
|
|
105
96
|
m: model,
|
|
106
97
|
set
|
|
107
|
-
}
|
|
108
|
-
fileName: _jsxFileName,
|
|
109
|
-
lineNumber: 135,
|
|
110
|
-
columnNumber: 34
|
|
111
|
-
}, this) : kind === "takeaways" ? /* @__PURE__ */ jsxDEV(TakeawaysBlock, {
|
|
98
|
+
}) : kind === "takeaways" ? /* @__PURE__ */ jsx(TakeawaysBlock, {
|
|
112
99
|
el,
|
|
113
100
|
ctx,
|
|
114
101
|
autoFocus,
|
|
115
102
|
m: model,
|
|
116
103
|
set
|
|
117
|
-
}
|
|
118
|
-
fileName: _jsxFileName,
|
|
119
|
-
lineNumber: 136,
|
|
120
|
-
columnNumber: 34
|
|
121
|
-
}, this) : kind === "callout" ? /* @__PURE__ */ jsxDEV(CalloutBlock, {
|
|
104
|
+
}) : kind === "callout" ? /* @__PURE__ */ jsx(CalloutBlock, {
|
|
122
105
|
el,
|
|
123
106
|
ctx,
|
|
124
107
|
autoFocus,
|
|
125
108
|
m: model,
|
|
126
109
|
set
|
|
127
|
-
}
|
|
128
|
-
fileName: _jsxFileName,
|
|
129
|
-
lineNumber: 137,
|
|
130
|
-
columnNumber: 32
|
|
131
|
-
}, this) : kind === "toggle" ? /* @__PURE__ */ jsxDEV(ToggleBlock, {
|
|
110
|
+
}) : kind === "toggle" ? /* @__PURE__ */ jsx(ToggleBlock, {
|
|
132
111
|
el,
|
|
133
112
|
ctx,
|
|
134
113
|
autoFocus,
|
|
135
114
|
m: model,
|
|
136
115
|
set
|
|
137
|
-
}
|
|
138
|
-
fileName: _jsxFileName,
|
|
139
|
-
lineNumber: 138,
|
|
140
|
-
columnNumber: 31
|
|
141
|
-
}, this) : kind === "video" ? /* @__PURE__ */ jsxDEV(VideoBlock, {
|
|
116
|
+
}) : kind === "video" ? /* @__PURE__ */ jsx(VideoBlock, {
|
|
142
117
|
el,
|
|
143
118
|
ctx,
|
|
144
119
|
autoFocus,
|
|
145
120
|
m: model,
|
|
146
121
|
set
|
|
147
|
-
}
|
|
148
|
-
fileName: _jsxFileName,
|
|
149
|
-
lineNumber: 139,
|
|
150
|
-
columnNumber: 30
|
|
151
|
-
}, this) : kind === "embed" ? /* @__PURE__ */ jsxDEV(EmbedIsland, {
|
|
122
|
+
}) : kind === "embed" ? /* @__PURE__ */ jsx(EmbedIsland, {
|
|
152
123
|
el,
|
|
153
124
|
ctx,
|
|
154
125
|
autoFocus,
|
|
155
126
|
m: model,
|
|
156
127
|
set
|
|
157
|
-
}
|
|
158
|
-
fileName: _jsxFileName,
|
|
159
|
-
lineNumber: 140,
|
|
160
|
-
columnNumber: 30
|
|
161
|
-
}, this) : kind === "gallery" ? /* @__PURE__ */ jsxDEV(GalleryIsland, {
|
|
128
|
+
}) : kind === "gallery" ? /* @__PURE__ */ jsx(GalleryIsland, {
|
|
162
129
|
el,
|
|
163
130
|
ctx,
|
|
164
131
|
autoFocus,
|
|
165
132
|
m: model,
|
|
166
133
|
set
|
|
167
|
-
}
|
|
168
|
-
fileName: _jsxFileName,
|
|
169
|
-
lineNumber: 141,
|
|
170
|
-
columnNumber: 32
|
|
171
|
-
}, this) : kind === "toc" ? /* @__PURE__ */ jsxDEV(TocIsland, {
|
|
134
|
+
}) : kind === "toc" ? /* @__PURE__ */ jsx(TocIsland, {
|
|
172
135
|
el,
|
|
173
136
|
ctx,
|
|
174
137
|
autoFocus,
|
|
175
138
|
m: model,
|
|
176
139
|
set
|
|
177
|
-
}
|
|
178
|
-
fileName: _jsxFileName,
|
|
179
|
-
lineNumber: 142,
|
|
180
|
-
columnNumber: 28
|
|
181
|
-
}, this) : kind === "columns" ? /* @__PURE__ */ jsxDEV(ColumnsIsland, {
|
|
140
|
+
}) : kind === "columns" ? /* @__PURE__ */ jsx(ColumnsIsland, {
|
|
182
141
|
el,
|
|
183
142
|
ctx,
|
|
184
143
|
autoFocus,
|
|
185
144
|
m: model,
|
|
186
145
|
set
|
|
187
|
-
}
|
|
188
|
-
fileName: _jsxFileName,
|
|
189
|
-
lineNumber: 143,
|
|
190
|
-
columnNumber: 32
|
|
191
|
-
}, this) : kind === "author" ? /* @__PURE__ */ jsxDEV(AuthorIsland, {
|
|
146
|
+
}) : kind === "author" ? /* @__PURE__ */ jsx(AuthorIsland, {
|
|
192
147
|
el,
|
|
193
148
|
ctx,
|
|
194
149
|
autoFocus,
|
|
195
150
|
m: model,
|
|
196
151
|
set
|
|
197
|
-
}
|
|
198
|
-
fileName: _jsxFileName,
|
|
199
|
-
lineNumber: 144,
|
|
200
|
-
columnNumber: 31
|
|
201
|
-
}, this) : kind === "related" ? /* @__PURE__ */ jsxDEV(RelatedIsland, {
|
|
152
|
+
}) : kind === "related" ? /* @__PURE__ */ jsx(RelatedIsland, {
|
|
202
153
|
el,
|
|
203
154
|
ctx,
|
|
204
155
|
autoFocus,
|
|
205
156
|
m: model,
|
|
206
157
|
set
|
|
207
|
-
}
|
|
208
|
-
fileName: _jsxFileName,
|
|
209
|
-
lineNumber: 145,
|
|
210
|
-
columnNumber: 32
|
|
211
|
-
}, this) : kind === "file" ? /* @__PURE__ */ jsxDEV(FileBlock, {
|
|
158
|
+
}) : kind === "file" ? /* @__PURE__ */ jsx(FileBlock, {
|
|
212
159
|
el,
|
|
213
160
|
ctx,
|
|
214
161
|
autoFocus,
|
|
215
162
|
m: model,
|
|
216
163
|
set
|
|
217
|
-
}
|
|
218
|
-
fileName: _jsxFileName,
|
|
219
|
-
lineNumber: 146,
|
|
220
|
-
columnNumber: 29
|
|
221
|
-
}, this) : kind === "component" ? /* @__PURE__ */ jsxDEV(ComponentBlock, {
|
|
164
|
+
}) : kind === "component" ? /* @__PURE__ */ jsx(ComponentBlock, {
|
|
222
165
|
el,
|
|
223
166
|
ctx,
|
|
224
167
|
autoFocus,
|
|
225
168
|
m: model,
|
|
226
169
|
set
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
lineNumber: 147,
|
|
230
|
-
columnNumber: 34
|
|
231
|
-
}, this) : null
|
|
232
|
-
}, void 0, false, {
|
|
233
|
-
fileName: _jsxFileName,
|
|
234
|
-
lineNumber: 132,
|
|
235
|
-
columnNumber: 5
|
|
236
|
-
}, this);
|
|
170
|
+
}) : null
|
|
171
|
+
});
|
|
237
172
|
}
|
|
238
173
|
/** The island's stored embed (keys absent when the block lacks them) through embed.tsx's block (V2's model). */
|
|
239
174
|
function EmbedIsland({ m, set, el, ctx, autoFocus }) {
|
|
240
|
-
return /* @__PURE__ */
|
|
175
|
+
return /* @__PURE__ */ jsx(EmbedBlock, {
|
|
241
176
|
m: {
|
|
242
177
|
url: m.url ?? "",
|
|
243
178
|
title: m.title ?? "",
|
|
@@ -259,11 +194,7 @@ function EmbedIsland({ m, set, el, ctx, autoFocus }) {
|
|
|
259
194
|
ctx,
|
|
260
195
|
autoFocus,
|
|
261
196
|
shape: ctx.allows?.("embedAspect") ?? false
|
|
262
|
-
}
|
|
263
|
-
fileName: _jsxFileName,
|
|
264
|
-
lineNumber: 156,
|
|
265
|
-
columnNumber: 5
|
|
266
|
-
}, this);
|
|
197
|
+
});
|
|
267
198
|
}
|
|
268
199
|
/** The island's stored gallery (src, alt, caption per image) through gallery.tsx's block (V2's model, an image value each). */
|
|
269
200
|
/** RT9: a gallery image's framing, image-url's 0–1 focal point ⇄ the kit image value's percent */
|
|
@@ -297,7 +228,7 @@ var focalOf = (f) => {
|
|
|
297
228
|
} : void 0;
|
|
298
229
|
};
|
|
299
230
|
function GalleryIsland({ m, set, el, ctx, autoFocus }) {
|
|
300
|
-
return /* @__PURE__ */
|
|
231
|
+
return /* @__PURE__ */ jsx(GalleryBlock, {
|
|
301
232
|
m: toGallery(m),
|
|
302
233
|
set: (fn, label) => set((prev) => {
|
|
303
234
|
const next = fn(toGallery(prev));
|
|
@@ -322,15 +253,11 @@ function GalleryIsland({ m, set, el, ctx, autoFocus }) {
|
|
|
322
253
|
el,
|
|
323
254
|
ctx,
|
|
324
255
|
autoFocus
|
|
325
|
-
}
|
|
326
|
-
fileName: _jsxFileName,
|
|
327
|
-
lineNumber: 196,
|
|
328
|
-
columnNumber: 5
|
|
329
|
-
}, this);
|
|
256
|
+
});
|
|
330
257
|
}
|
|
331
258
|
/** The island's stored table of contents (title, depth) through toc.tsx's block, which lists the editor's live outline. */
|
|
332
259
|
function TocIsland({ m, set, el, ctx, autoFocus }) {
|
|
333
|
-
return /* @__PURE__ */
|
|
260
|
+
return /* @__PURE__ */ jsx(TocBlock, {
|
|
334
261
|
m: {
|
|
335
262
|
title: m.title ?? "",
|
|
336
263
|
depth: m.depth ?? "3"
|
|
@@ -348,15 +275,11 @@ function TocIsland({ m, set, el, ctx, autoFocus }) {
|
|
|
348
275
|
el,
|
|
349
276
|
ctx,
|
|
350
277
|
autoFocus
|
|
351
|
-
}
|
|
352
|
-
fileName: _jsxFileName,
|
|
353
|
-
lineNumber: 223,
|
|
354
|
-
columnNumber: 5
|
|
355
|
-
}, this);
|
|
278
|
+
});
|
|
356
279
|
}
|
|
357
280
|
/** The island's stored columns (gap, each column's HTML) through columns.tsx's block. */
|
|
358
281
|
function ColumnsIsland({ m, set, el, ctx, autoFocus }) {
|
|
359
|
-
return /* @__PURE__ */
|
|
282
|
+
return /* @__PURE__ */ jsx(ColumnsBlock, {
|
|
360
283
|
m: {
|
|
361
284
|
gap: m.gap ?? "m",
|
|
362
285
|
cols: m.cols
|
|
@@ -376,15 +299,11 @@ function ColumnsIsland({ m, set, el, ctx, autoFocus }) {
|
|
|
376
299
|
el,
|
|
377
300
|
ctx,
|
|
378
301
|
autoFocus
|
|
379
|
-
}
|
|
380
|
-
fileName: _jsxFileName,
|
|
381
|
-
lineNumber: 244,
|
|
382
|
-
columnNumber: 5
|
|
383
|
-
}, this);
|
|
302
|
+
});
|
|
384
303
|
}
|
|
385
304
|
/** The island's stored author reference through author.tsx's block, picking from the field's authors collection. */
|
|
386
305
|
function AuthorIsland({ m, set, el, ctx, autoFocus }) {
|
|
387
|
-
return /* @__PURE__ */
|
|
306
|
+
return /* @__PURE__ */ jsx(AuthorBlock, {
|
|
388
307
|
m: { author: m.author ?? "" },
|
|
389
308
|
set: (fn, label) => set((prev) => {
|
|
390
309
|
const next = fn({ author: prev.author ?? "" });
|
|
@@ -397,11 +316,7 @@ function AuthorIsland({ m, set, el, ctx, autoFocus }) {
|
|
|
397
316
|
ctx,
|
|
398
317
|
autoFocus,
|
|
399
318
|
collection: ctx.references?.authors ?? ""
|
|
400
|
-
}
|
|
401
|
-
fileName: _jsxFileName,
|
|
402
|
-
lineNumber: 264,
|
|
403
|
-
columnNumber: 5
|
|
404
|
-
}, this);
|
|
319
|
+
});
|
|
405
320
|
}
|
|
406
321
|
/** The island's stored related posts through related.tsx's block, over the field's posts collection. */
|
|
407
322
|
var toRelated = (m) => ({
|
|
@@ -411,7 +326,7 @@ var toRelated = (m) => ({
|
|
|
411
326
|
posts: m.posts
|
|
412
327
|
});
|
|
413
328
|
function RelatedIsland({ m, set, el, ctx, autoFocus }) {
|
|
414
|
-
return /* @__PURE__ */
|
|
329
|
+
return /* @__PURE__ */ jsx(RelatedBlock, {
|
|
415
330
|
m: toRelated(m),
|
|
416
331
|
set: (fn, label) => set((prev) => {
|
|
417
332
|
const was = toRelated(prev);
|
|
@@ -432,20 +347,12 @@ function RelatedIsland({ m, set, el, ctx, autoFocus }) {
|
|
|
432
347
|
excludeId: ctx.references?.entryId,
|
|
433
348
|
topic: ctx.references?.topic !== false,
|
|
434
349
|
noun: ctx.references?.postsNoun
|
|
435
|
-
}
|
|
436
|
-
fileName: _jsxFileName,
|
|
437
|
-
lineNumber: 284,
|
|
438
|
-
columnNumber: 5
|
|
439
|
-
}, this);
|
|
350
|
+
});
|
|
440
351
|
}
|
|
441
|
-
var Sep = () => /* @__PURE__ */
|
|
352
|
+
var Sep = () => /* @__PURE__ */ jsx("span", {
|
|
442
353
|
"aria-hidden": true,
|
|
443
354
|
className: "mx-0.5 h-4 w-px shrink-0 bg-kit-line"
|
|
444
|
-
}
|
|
445
|
-
fileName: _jsxFileName,
|
|
446
|
-
lineNumber: 308,
|
|
447
|
-
columnNumber: 19
|
|
448
|
-
}, void 0);
|
|
355
|
+
});
|
|
449
356
|
/** An address an image can be shown from: http(s) or a site path. */
|
|
450
357
|
var imageUrlOk = (u) => /^(https?:)?\/\/[^\s]+$/i.test(u) || /^\/(?!\/)\S*$/.test(u);
|
|
451
358
|
function PlainEditable({ value, onChange, label, placeholder, readOnly, autoFocus, multiline, onEnter, onBackspaceEmpty, className }) {
|
|
@@ -460,7 +367,7 @@ function PlainEditable({ value, onChange, label, placeholder, readOnly, autoFocu
|
|
|
460
367
|
ref.current.focus({ preventScroll: false });
|
|
461
368
|
placeCaret(ref.current);
|
|
462
369
|
}, []);
|
|
463
|
-
return /* @__PURE__ */
|
|
370
|
+
return /* @__PURE__ */ jsx("div", {
|
|
464
371
|
ref,
|
|
465
372
|
role: "textbox",
|
|
466
373
|
"aria-label": label,
|
|
@@ -489,27 +396,15 @@ function PlainEditable({ value, onChange, label, placeholder, readOnly, autoFocu
|
|
|
489
396
|
onEnter?.();
|
|
490
397
|
},
|
|
491
398
|
className: cn("min-w-0 cursor-text whitespace-pre-wrap break-words outline-none focus-visible:shadow-none empty:before:pointer-events-none empty:before:text-kit-fg-4 empty:before:content-[attr(data-placeholder)]", className)
|
|
492
|
-
}
|
|
493
|
-
fileName: _jsxFileName,
|
|
494
|
-
lineNumber: 351,
|
|
495
|
-
columnNumber: 5
|
|
496
|
-
}, this);
|
|
399
|
+
});
|
|
497
400
|
}
|
|
498
|
-
var RemoveBtn = ({ onClick, label = "Remove block" }) => /* @__PURE__ */
|
|
401
|
+
var RemoveBtn = ({ onClick, label = "Remove block" }) => /* @__PURE__ */ jsx(IconButton, {
|
|
499
402
|
size: "xs",
|
|
500
403
|
label,
|
|
501
404
|
onClick,
|
|
502
405
|
className: "hover:text-kit-danger-fg",
|
|
503
|
-
children: /* @__PURE__ */
|
|
504
|
-
|
|
505
|
-
lineNumber: 390,
|
|
506
|
-
columnNumber: 5
|
|
507
|
-
}, void 0)
|
|
508
|
-
}, void 0, false, {
|
|
509
|
-
fileName: _jsxFileName,
|
|
510
|
-
lineNumber: 389,
|
|
511
|
-
columnNumber: 3
|
|
512
|
-
}, void 0);
|
|
406
|
+
children: /* @__PURE__ */ jsx(IconTrash, { stroke: 1.5 })
|
|
407
|
+
});
|
|
513
408
|
/** Production's image layout (lib/richtext/imageLayout.ts): a size sets the column share; with none, the alignment does. */
|
|
514
409
|
var SIZES = [
|
|
515
410
|
{
|
|
@@ -543,38 +438,22 @@ var ALIGNS = [
|
|
|
543
438
|
{
|
|
544
439
|
v: "full",
|
|
545
440
|
label: "Full width",
|
|
546
|
-
icon: /* @__PURE__ */
|
|
547
|
-
fileName: _jsxFileName,
|
|
548
|
-
lineNumber: 404,
|
|
549
|
-
columnNumber: 43
|
|
550
|
-
}, void 0)
|
|
441
|
+
icon: /* @__PURE__ */ jsx(IconArrowsHorizontal, { stroke: 1.5 })
|
|
551
442
|
},
|
|
552
443
|
{
|
|
553
444
|
v: "center",
|
|
554
445
|
label: "Center",
|
|
555
|
-
icon: /* @__PURE__ */
|
|
556
|
-
fileName: _jsxFileName,
|
|
557
|
-
lineNumber: 405,
|
|
558
|
-
columnNumber: 41
|
|
559
|
-
}, void 0)
|
|
446
|
+
icon: /* @__PURE__ */ jsx(IconLayoutAlignCenter, { stroke: 1.5 })
|
|
560
447
|
},
|
|
561
448
|
{
|
|
562
449
|
v: "left",
|
|
563
450
|
label: "Left",
|
|
564
|
-
icon: /* @__PURE__ */
|
|
565
|
-
fileName: _jsxFileName,
|
|
566
|
-
lineNumber: 406,
|
|
567
|
-
columnNumber: 37
|
|
568
|
-
}, void 0)
|
|
451
|
+
icon: /* @__PURE__ */ jsx(IconLayoutAlignLeft, { stroke: 1.5 })
|
|
569
452
|
},
|
|
570
453
|
{
|
|
571
454
|
v: "right",
|
|
572
455
|
label: "Right",
|
|
573
|
-
icon: /* @__PURE__ */
|
|
574
|
-
fileName: _jsxFileName,
|
|
575
|
-
lineNumber: 407,
|
|
576
|
-
columnNumber: 39
|
|
577
|
-
}, void 0)
|
|
456
|
+
icon: /* @__PURE__ */ jsx(IconLayoutAlignRight, { stroke: 1.5 })
|
|
578
457
|
}
|
|
579
458
|
];
|
|
580
459
|
function ImageBlock({ m, set, el, ctx }) {
|
|
@@ -585,7 +464,7 @@ function ImageBlock({ m, set, el, ctx }) {
|
|
|
585
464
|
const [busy, setBusy] = React.useState(false);
|
|
586
465
|
const [linkOpen, setLinkOpen] = React.useState(false);
|
|
587
466
|
const ro = ctx.readOnly;
|
|
588
|
-
const pickerEl = MediaPicker ? /* @__PURE__ */
|
|
467
|
+
const pickerEl = MediaPicker ? /* @__PURE__ */ jsx(MediaPicker, {
|
|
589
468
|
open: picker,
|
|
590
469
|
onOpenChange: setPicker,
|
|
591
470
|
accept: ["image", "svg"],
|
|
@@ -593,70 +472,38 @@ function ImageBlock({ m, set, el, ctx }) {
|
|
|
593
472
|
src: a[0].url,
|
|
594
473
|
alt: a[0].alt || m.alt || ""
|
|
595
474
|
}, "Replace image")
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
lineNumber: 419,
|
|
599
|
-
columnNumber: 5
|
|
600
|
-
}, this) : null;
|
|
601
|
-
if (!m.src) return /* @__PURE__ */ jsxDEV("div", {
|
|
475
|
+
}) : null;
|
|
476
|
+
if (!m.src) return /* @__PURE__ */ jsxs("div", {
|
|
602
477
|
className: "group/blk rounded-kit-lg border border-dashed border-kit-line-strong bg-kit-subtle px-4 py-4",
|
|
603
478
|
children: [
|
|
604
|
-
/* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ jsxs("div", {
|
|
605
480
|
className: "flex items-start gap-3",
|
|
606
481
|
children: [
|
|
607
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ jsx("span", {
|
|
608
483
|
className: "flex size-8 shrink-0 items-center justify-center rounded-kit-md border border-kit-line bg-kit-control-bg text-kit-fg-2",
|
|
609
|
-
children: /* @__PURE__ */
|
|
484
|
+
children: /* @__PURE__ */ jsx(IconPhoto, {
|
|
610
485
|
className: "size-4",
|
|
611
486
|
stroke: 1.5,
|
|
612
487
|
"aria-hidden": true
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
columnNumber: 13
|
|
617
|
-
}, this)
|
|
618
|
-
}, void 0, false, {
|
|
619
|
-
fileName: _jsxFileName,
|
|
620
|
-
lineNumber: 431,
|
|
621
|
-
columnNumber: 11
|
|
622
|
-
}, this),
|
|
623
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
488
|
+
})
|
|
489
|
+
}),
|
|
490
|
+
/* @__PURE__ */ jsxs("div", {
|
|
624
491
|
className: "min-w-0 flex-1",
|
|
625
|
-
children: [/* @__PURE__ */
|
|
492
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
626
493
|
className: "text-kit-sm font-medium text-kit-fg",
|
|
627
494
|
children: "Add an image"
|
|
628
|
-
},
|
|
629
|
-
fileName: _jsxFileName,
|
|
630
|
-
lineNumber: 435,
|
|
631
|
-
columnNumber: 13
|
|
632
|
-
}, this), /* @__PURE__ */ jsxDEV("p", {
|
|
495
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
633
496
|
className: "text-kit-xs text-kit-fg-3",
|
|
634
497
|
children: MediaPicker ? "Pick one from the media library or paste a link." : "Paste a link to the image."
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
columnNumber: 13
|
|
639
|
-
}, this)]
|
|
640
|
-
}, void 0, true, {
|
|
641
|
-
fileName: _jsxFileName,
|
|
642
|
-
lineNumber: 434,
|
|
643
|
-
columnNumber: 11
|
|
644
|
-
}, this),
|
|
645
|
-
ro ? null : /* @__PURE__ */ jsxDEV(RemoveBtn, {
|
|
498
|
+
})]
|
|
499
|
+
}),
|
|
500
|
+
ro ? null : /* @__PURE__ */ jsx(RemoveBtn, {
|
|
646
501
|
onClick: () => ctx.remove(el),
|
|
647
502
|
label: "Remove image"
|
|
648
|
-
}
|
|
649
|
-
fileName: _jsxFileName,
|
|
650
|
-
lineNumber: 438,
|
|
651
|
-
columnNumber: 24
|
|
652
|
-
}, this)
|
|
503
|
+
})
|
|
653
504
|
]
|
|
654
|
-
},
|
|
655
|
-
|
|
656
|
-
lineNumber: 430,
|
|
657
|
-
columnNumber: 9
|
|
658
|
-
}, this),
|
|
659
|
-
ro ? null : urlMode || !MediaPicker ? /* @__PURE__ */ jsxDEV("form", {
|
|
505
|
+
}),
|
|
506
|
+
ro ? null : urlMode || !MediaPicker ? /* @__PURE__ */ jsxs("form", {
|
|
660
507
|
className: "mt-3 flex items-center gap-2",
|
|
661
508
|
onSubmit: (e) => {
|
|
662
509
|
e.preventDefault();
|
|
@@ -669,208 +516,112 @@ function ImageBlock({ m, set, el, ctx }) {
|
|
|
669
516
|
ctx.exit(el);
|
|
670
517
|
},
|
|
671
518
|
children: [
|
|
672
|
-
/* @__PURE__ */
|
|
519
|
+
/* @__PURE__ */ jsx(Input, {
|
|
673
520
|
autoFocus: true,
|
|
674
521
|
size: "sm",
|
|
675
522
|
value: url,
|
|
676
523
|
onChange: (e) => setUrl(e.target.value),
|
|
677
524
|
placeholder: "https://…",
|
|
678
525
|
"aria-label": "Image URL",
|
|
679
|
-
leading: /* @__PURE__ */
|
|
680
|
-
fileName: _jsxFileName,
|
|
681
|
-
lineNumber: 451,
|
|
682
|
-
columnNumber: 149
|
|
683
|
-
}, this),
|
|
526
|
+
leading: /* @__PURE__ */ jsx(IconLink, { stroke: 1.5 }),
|
|
684
527
|
className: "flex-1"
|
|
685
|
-
},
|
|
686
|
-
|
|
687
|
-
lineNumber: 451,
|
|
688
|
-
columnNumber: 13
|
|
689
|
-
}, this),
|
|
690
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
528
|
+
}),
|
|
529
|
+
/* @__PURE__ */ jsx(Button, {
|
|
691
530
|
size: "sm",
|
|
692
531
|
variant: "primary",
|
|
693
532
|
type: "submit",
|
|
694
533
|
disabled: !url.trim(),
|
|
695
534
|
children: "Add"
|
|
696
|
-
},
|
|
697
|
-
|
|
698
|
-
lineNumber: 452,
|
|
699
|
-
columnNumber: 13
|
|
700
|
-
}, this),
|
|
701
|
-
MediaPicker ? /* @__PURE__ */ jsxDEV(Button, {
|
|
535
|
+
}),
|
|
536
|
+
MediaPicker ? /* @__PURE__ */ jsx(Button, {
|
|
702
537
|
size: "sm",
|
|
703
538
|
variant: "ghost",
|
|
704
539
|
onClick: () => setUrlMode(false),
|
|
705
540
|
children: "Cancel"
|
|
706
|
-
}
|
|
707
|
-
fileName: _jsxFileName,
|
|
708
|
-
lineNumber: 456,
|
|
709
|
-
columnNumber: 15
|
|
710
|
-
}, this) : null
|
|
541
|
+
}) : null
|
|
711
542
|
]
|
|
712
|
-
}
|
|
713
|
-
fileName: _jsxFileName,
|
|
714
|
-
lineNumber: 441,
|
|
715
|
-
columnNumber: 11
|
|
716
|
-
}, this) : /* @__PURE__ */ jsxDEV("div", {
|
|
543
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
717
544
|
className: "mt-3 flex flex-wrap gap-2",
|
|
718
|
-
children: [/* @__PURE__ */
|
|
545
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
719
546
|
size: "sm",
|
|
720
|
-
leftIcon: /* @__PURE__ */
|
|
721
|
-
fileName: _jsxFileName,
|
|
722
|
-
lineNumber: 463,
|
|
723
|
-
columnNumber: 41
|
|
724
|
-
}, this),
|
|
547
|
+
leftIcon: /* @__PURE__ */ jsx(IconLibraryPhoto, { stroke: 1.5 }),
|
|
725
548
|
onClick: () => setPicker(true),
|
|
726
549
|
children: "Media library"
|
|
727
|
-
},
|
|
728
|
-
fileName: _jsxFileName,
|
|
729
|
-
lineNumber: 463,
|
|
730
|
-
columnNumber: 13
|
|
731
|
-
}, this), /* @__PURE__ */ jsxDEV(Button, {
|
|
550
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
732
551
|
size: "sm",
|
|
733
552
|
variant: "ghost",
|
|
734
|
-
leftIcon: /* @__PURE__ */
|
|
735
|
-
fileName: _jsxFileName,
|
|
736
|
-
lineNumber: 466,
|
|
737
|
-
columnNumber: 57
|
|
738
|
-
}, this),
|
|
553
|
+
leftIcon: /* @__PURE__ */ jsx(IconLink, { stroke: 1.5 }),
|
|
739
554
|
onClick: () => setUrlMode(true),
|
|
740
555
|
children: "Paste URL"
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
lineNumber: 466,
|
|
744
|
-
columnNumber: 13
|
|
745
|
-
}, this)]
|
|
746
|
-
}, void 0, true, {
|
|
747
|
-
fileName: _jsxFileName,
|
|
748
|
-
lineNumber: 462,
|
|
749
|
-
columnNumber: 11
|
|
750
|
-
}, this),
|
|
556
|
+
})]
|
|
557
|
+
}),
|
|
751
558
|
pickerEl
|
|
752
559
|
]
|
|
753
|
-
}
|
|
754
|
-
fileName: _jsxFileName,
|
|
755
|
-
lineNumber: 429,
|
|
756
|
-
columnNumber: 7
|
|
757
|
-
}, this);
|
|
560
|
+
});
|
|
758
561
|
const align = m.align ?? "full";
|
|
759
562
|
const size = m.size;
|
|
760
563
|
const width = size ? SIZES.find((x) => x.v === size)?.w ?? "100%" : ALIGN_WIDTH[align];
|
|
761
564
|
const justify = align === "left" ? "justify-start" : align === "right" ? "justify-end" : "justify-center";
|
|
762
565
|
const alignItem = ALIGNS.find((a) => a.v === align);
|
|
763
566
|
const toolBtn = "flex h-7 shrink-0 items-center gap-1 rounded-kit-md px-1.5 text-kit-xs text-kit-fg-2 hover:bg-kit-hover hover:text-kit-fg data-[popup-open]:bg-kit-hover data-[popup-open]:text-kit-fg [&_svg]:size-3.5";
|
|
764
|
-
return /* @__PURE__ */
|
|
567
|
+
return /* @__PURE__ */ jsxs("figure", {
|
|
765
568
|
className: "group/blk relative m-0",
|
|
766
569
|
children: [
|
|
767
|
-
ro ? null : /* @__PURE__ */
|
|
570
|
+
ro ? null : /* @__PURE__ */ jsxs("div", {
|
|
768
571
|
role: "toolbar",
|
|
769
572
|
"aria-label": "Image tools",
|
|
770
573
|
className: cn("glass-strong absolute left-1/2 top-2 z-[3] flex h-8 -translate-x-1/2 items-center gap-0.5 rounded-kit-lg border border-kit-line px-1 opacity-0 transition-opacity duration-150", "group-hover/blk:opacity-100 group-focus-within/blk:opacity-100 pointer-coarse:opacity-100", busy && "opacity-100"),
|
|
771
574
|
children: [
|
|
772
|
-
MediaPicker ? /* @__PURE__ */
|
|
575
|
+
MediaPicker ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Tooltip, {
|
|
773
576
|
content: "Replace image",
|
|
774
|
-
children: /* @__PURE__ */
|
|
577
|
+
children: /* @__PURE__ */ jsxs("button", {
|
|
775
578
|
type: "button",
|
|
776
579
|
"aria-label": "Replace image",
|
|
777
580
|
className: toolBtn,
|
|
778
581
|
onClick: () => setPicker(true),
|
|
779
|
-
children: [/* @__PURE__ */
|
|
582
|
+
children: [/* @__PURE__ */ jsx(IconReplace, {
|
|
780
583
|
stroke: 1.5,
|
|
781
584
|
"aria-hidden": true
|
|
782
|
-
},
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
}, this), ctx.dense ? null : "Replace"]
|
|
787
|
-
}, void 0, true, {
|
|
788
|
-
fileName: _jsxFileName,
|
|
789
|
-
lineNumber: 497,
|
|
790
|
-
columnNumber: 17
|
|
791
|
-
}, this)
|
|
792
|
-
}, void 0, false, {
|
|
793
|
-
fileName: _jsxFileName,
|
|
794
|
-
lineNumber: 496,
|
|
795
|
-
columnNumber: 15
|
|
796
|
-
}, this), /* @__PURE__ */ jsxDEV(Sep, {}, void 0, false, {
|
|
797
|
-
fileName: _jsxFileName,
|
|
798
|
-
lineNumber: 502,
|
|
799
|
-
columnNumber: 15
|
|
800
|
-
}, this)] }, void 0, true, {
|
|
801
|
-
fileName: _jsxFileName,
|
|
802
|
-
lineNumber: 495,
|
|
803
|
-
columnNumber: 13
|
|
804
|
-
}, this) : null,
|
|
805
|
-
/* @__PURE__ */ jsxDEV(Menu, {
|
|
585
|
+
}), ctx.dense ? null : "Replace"]
|
|
586
|
+
})
|
|
587
|
+
}), /* @__PURE__ */ jsx(Sep, {})] }) : null,
|
|
588
|
+
/* @__PURE__ */ jsxs(Menu, {
|
|
806
589
|
onOpenChange: setBusy,
|
|
807
|
-
children: [/* @__PURE__ */
|
|
590
|
+
children: [/* @__PURE__ */ jsx(MenuTrigger, { render: /* @__PURE__ */ jsxs("button", {
|
|
808
591
|
type: "button",
|
|
809
592
|
"aria-label": `Align: ${alignItem.label}`,
|
|
810
593
|
className: toolBtn,
|
|
811
|
-
children: [alignItem.icon, /* @__PURE__ */
|
|
594
|
+
children: [alignItem.icon, /* @__PURE__ */ jsx(IconChevronDown, {
|
|
812
595
|
className: "!size-3 text-kit-fg-3",
|
|
813
596
|
stroke: 1.5,
|
|
814
597
|
"aria-hidden": true
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
lineNumber: 510,
|
|
818
|
-
columnNumber: 19
|
|
819
|
-
}, this)]
|
|
820
|
-
}, void 0, true, {
|
|
821
|
-
fileName: _jsxFileName,
|
|
822
|
-
lineNumber: 508,
|
|
823
|
-
columnNumber: 17
|
|
824
|
-
}, this) }, void 0, false, {
|
|
825
|
-
fileName: _jsxFileName,
|
|
826
|
-
lineNumber: 506,
|
|
827
|
-
columnNumber: 13
|
|
828
|
-
}, this), /* @__PURE__ */ jsxDEV(MenuContent, {
|
|
598
|
+
})]
|
|
599
|
+
}) }), /* @__PURE__ */ jsx(MenuContent, {
|
|
829
600
|
className: "w-40",
|
|
830
|
-
children: ALIGNS.map((a) => /* @__PURE__ */
|
|
601
|
+
children: ALIGNS.map((a) => /* @__PURE__ */ jsx(MenuItem, {
|
|
831
602
|
icon: a.icon,
|
|
832
603
|
onClick: () => set({
|
|
833
604
|
align: a.v,
|
|
834
605
|
...a.v === "full" ? { size: "full" } : size === "full" || !size ? { size: "l" } : {}
|
|
835
606
|
}, "Align image"),
|
|
836
|
-
children: /* @__PURE__ */
|
|
607
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
837
608
|
className: "flex w-full items-center justify-between",
|
|
838
|
-
children: [a.label, align === a.v ? /* @__PURE__ */
|
|
609
|
+
children: [a.label, align === a.v ? /* @__PURE__ */ jsx(IconCheck, {
|
|
839
610
|
className: "size-3.5 text-kit-fg-2",
|
|
840
611
|
stroke: 2,
|
|
841
612
|
"aria-hidden": true
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
fileName: _jsxFileName,
|
|
849
|
-
lineNumber: 521,
|
|
850
|
-
columnNumber: 19
|
|
851
|
-
}, this)
|
|
852
|
-
}, a.v, false, {
|
|
853
|
-
fileName: _jsxFileName,
|
|
854
|
-
lineNumber: 516,
|
|
855
|
-
columnNumber: 17
|
|
856
|
-
}, this))
|
|
857
|
-
}, void 0, false, {
|
|
858
|
-
fileName: _jsxFileName,
|
|
859
|
-
lineNumber: 514,
|
|
860
|
-
columnNumber: 13
|
|
861
|
-
}, this)]
|
|
862
|
-
}, void 0, true, {
|
|
863
|
-
fileName: _jsxFileName,
|
|
864
|
-
lineNumber: 505,
|
|
865
|
-
columnNumber: 11
|
|
866
|
-
}, this),
|
|
867
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
613
|
+
}) : null]
|
|
614
|
+
})
|
|
615
|
+
}, a.v))
|
|
616
|
+
})]
|
|
617
|
+
}),
|
|
618
|
+
/* @__PURE__ */ jsx("div", {
|
|
868
619
|
role: "group",
|
|
869
620
|
"aria-label": "Size",
|
|
870
621
|
className: "flex items-center",
|
|
871
622
|
children: SIZES.map((x) => {
|
|
872
623
|
const on = (size ?? (align === "full" ? "full" : null)) === x.v;
|
|
873
|
-
return /* @__PURE__ */
|
|
624
|
+
return /* @__PURE__ */ jsx("button", {
|
|
874
625
|
type: "button",
|
|
875
626
|
"aria-pressed": on,
|
|
876
627
|
"aria-label": `Size ${x.label}`,
|
|
@@ -880,63 +631,35 @@ function ImageBlock({ m, set, el, ctx }) {
|
|
|
880
631
|
}, "Resize image"),
|
|
881
632
|
className: cn("h-7 min-w-6 rounded-kit-md px-1 text-kit-xs text-kit-fg-3 hover:bg-kit-hover hover:text-kit-fg", on && "bg-kit-selected font-medium text-kit-fg"),
|
|
882
633
|
children: x.label
|
|
883
|
-
}, x.v
|
|
884
|
-
fileName: _jsxFileName,
|
|
885
|
-
lineNumber: 533,
|
|
886
|
-
columnNumber: 17
|
|
887
|
-
}, this);
|
|
634
|
+
}, x.v);
|
|
888
635
|
})
|
|
889
|
-
},
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
columnNumber: 11
|
|
893
|
-
}, this),
|
|
894
|
-
/* @__PURE__ */ jsxDEV(Sep, {}, void 0, false, {
|
|
895
|
-
fileName: _jsxFileName,
|
|
896
|
-
lineNumber: 546,
|
|
897
|
-
columnNumber: 11
|
|
898
|
-
}, this),
|
|
899
|
-
/* @__PURE__ */ jsxDEV(Popover, {
|
|
636
|
+
}),
|
|
637
|
+
/* @__PURE__ */ jsx(Sep, {}),
|
|
638
|
+
/* @__PURE__ */ jsxs(Popover, {
|
|
900
639
|
open: linkOpen,
|
|
901
640
|
onOpenChange: (o) => {
|
|
902
641
|
setLinkOpen(o);
|
|
903
642
|
setBusy(o);
|
|
904
643
|
},
|
|
905
|
-
children: [/* @__PURE__ */
|
|
644
|
+
children: [/* @__PURE__ */ jsx(Tooltip, {
|
|
906
645
|
content: m.href ? `Links to ${m.href}` : "Link the image",
|
|
907
|
-
children: /* @__PURE__ */
|
|
646
|
+
children: /* @__PURE__ */ jsx(PopoverTrigger, {
|
|
908
647
|
"aria-label": "Link the image",
|
|
909
648
|
className: cn(toolBtn, m.href && "text-kit-accent-fg"),
|
|
910
|
-
children: /* @__PURE__ */
|
|
649
|
+
children: /* @__PURE__ */ jsx(IconLink, {
|
|
911
650
|
stroke: 1.5,
|
|
912
651
|
"aria-hidden": true
|
|
913
|
-
}
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
columnNumber: 17
|
|
917
|
-
}, this)
|
|
918
|
-
}, void 0, false, {
|
|
919
|
-
fileName: _jsxFileName,
|
|
920
|
-
lineNumber: 555,
|
|
921
|
-
columnNumber: 15
|
|
922
|
-
}, this)
|
|
923
|
-
}, void 0, false, {
|
|
924
|
-
fileName: _jsxFileName,
|
|
925
|
-
lineNumber: 554,
|
|
926
|
-
columnNumber: 13
|
|
927
|
-
}, this), /* @__PURE__ */ jsxDEV(PopoverContent, {
|
|
652
|
+
})
|
|
653
|
+
})
|
|
654
|
+
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
928
655
|
className: "w-[340px] rounded-kit-lg p-3",
|
|
929
656
|
finalFocus: false,
|
|
930
|
-
children: [/* @__PURE__ */
|
|
657
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
931
658
|
className: "mb-2 text-kit-xs font-medium text-kit-fg-2",
|
|
932
659
|
children: "Link the image to"
|
|
933
|
-
},
|
|
934
|
-
fileName: _jsxFileName,
|
|
935
|
-
lineNumber: 560,
|
|
936
|
-
columnNumber: 15
|
|
937
|
-
}, this), /* @__PURE__ */ jsxDEV(LinkForm, {
|
|
660
|
+
}), /* @__PURE__ */ jsx(LinkPopoverBody, {
|
|
938
661
|
initial: { href: m.href ?? "" },
|
|
939
|
-
|
|
662
|
+
hideOptions: true,
|
|
940
663
|
onSave: (v) => {
|
|
941
664
|
set({ href: v.href }, "Link image");
|
|
942
665
|
setLinkOpen(false);
|
|
@@ -954,86 +677,42 @@ function ImageBlock({ m, set, el, ctx }) {
|
|
|
954
677
|
setLinkOpen(false);
|
|
955
678
|
setBusy(false);
|
|
956
679
|
} : void 0
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
}, this)]
|
|
962
|
-
}, void 0, true, {
|
|
963
|
-
fileName: _jsxFileName,
|
|
964
|
-
lineNumber: 559,
|
|
965
|
-
columnNumber: 13
|
|
966
|
-
}, this)]
|
|
967
|
-
}, void 0, true, {
|
|
968
|
-
fileName: _jsxFileName,
|
|
969
|
-
lineNumber: 547,
|
|
970
|
-
columnNumber: 11
|
|
971
|
-
}, this),
|
|
972
|
-
/* @__PURE__ */ jsxDEV(AltPopover, {
|
|
680
|
+
})]
|
|
681
|
+
})]
|
|
682
|
+
}),
|
|
683
|
+
/* @__PURE__ */ jsx(AltPopover, {
|
|
973
684
|
alt: m.alt ?? "",
|
|
974
685
|
onSave: (alt) => set({ alt }, "Edit alt text"),
|
|
975
686
|
onOpen: setBusy,
|
|
976
687
|
btnClass: toolBtn
|
|
977
|
-
},
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
columnNumber: 11
|
|
981
|
-
}, this),
|
|
982
|
-
/* @__PURE__ */ jsxDEV(Sep, {}, void 0, false, {
|
|
983
|
-
fileName: _jsxFileName,
|
|
984
|
-
lineNumber: 590,
|
|
985
|
-
columnNumber: 11
|
|
986
|
-
}, this),
|
|
987
|
-
/* @__PURE__ */ jsxDEV(Tooltip, {
|
|
688
|
+
}),
|
|
689
|
+
/* @__PURE__ */ jsx(Sep, {}),
|
|
690
|
+
/* @__PURE__ */ jsx(Tooltip, {
|
|
988
691
|
content: "Remove image",
|
|
989
|
-
children: /* @__PURE__ */
|
|
692
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
990
693
|
type: "button",
|
|
991
694
|
"aria-label": "Remove image",
|
|
992
695
|
className: cn(toolBtn, "hover:text-kit-danger-fg"),
|
|
993
696
|
onClick: () => ctx.remove(el),
|
|
994
|
-
children: /* @__PURE__ */
|
|
697
|
+
children: /* @__PURE__ */ jsx(IconTrash, {
|
|
995
698
|
stroke: 1.5,
|
|
996
699
|
"aria-hidden": true
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
columnNumber: 15
|
|
1001
|
-
}, this)
|
|
1002
|
-
}, void 0, false, {
|
|
1003
|
-
fileName: _jsxFileName,
|
|
1004
|
-
lineNumber: 592,
|
|
1005
|
-
columnNumber: 13
|
|
1006
|
-
}, this)
|
|
1007
|
-
}, void 0, false, {
|
|
1008
|
-
fileName: _jsxFileName,
|
|
1009
|
-
lineNumber: 591,
|
|
1010
|
-
columnNumber: 11
|
|
1011
|
-
}, this)
|
|
700
|
+
})
|
|
701
|
+
})
|
|
702
|
+
})
|
|
1012
703
|
]
|
|
1013
|
-
},
|
|
1014
|
-
|
|
1015
|
-
lineNumber: 485,
|
|
1016
|
-
columnNumber: 9
|
|
1017
|
-
}, this),
|
|
1018
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
704
|
+
}),
|
|
705
|
+
/* @__PURE__ */ jsx("div", {
|
|
1019
706
|
className: cn("flex", justify),
|
|
1020
|
-
children: /* @__PURE__ */
|
|
707
|
+
children: /* @__PURE__ */ jsx("img", {
|
|
1021
708
|
src: m.src,
|
|
1022
709
|
alt: m.alt ?? "",
|
|
1023
710
|
style: { width },
|
|
1024
711
|
className: "block h-auto max-w-full rounded-kit-lg border border-kit-line",
|
|
1025
712
|
draggable: false
|
|
1026
|
-
}
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
columnNumber: 9
|
|
1030
|
-
}, this)
|
|
1031
|
-
}, void 0, false, {
|
|
1032
|
-
fileName: _jsxFileName,
|
|
1033
|
-
lineNumber: 598,
|
|
1034
|
-
columnNumber: 7
|
|
1035
|
-
}, this),
|
|
1036
|
-
ro && !m.caption ? null : /* @__PURE__ */ jsxDEV(PlainEditable, {
|
|
713
|
+
})
|
|
714
|
+
}),
|
|
715
|
+
ro && !m.caption ? null : /* @__PURE__ */ jsx(PlainEditable, {
|
|
1037
716
|
value: m.caption ?? "",
|
|
1038
717
|
label: "Image caption",
|
|
1039
718
|
readOnly: ro,
|
|
@@ -1041,56 +720,36 @@ function ImageBlock({ m, set, el, ctx }) {
|
|
|
1041
720
|
onChange: (caption) => set({ caption }, "Edit caption"),
|
|
1042
721
|
onEnter: () => ctx.exit(el),
|
|
1043
722
|
className: "mt-1.5 text-center text-kit-sm text-kit-fg-3 empty:before:text-kit-fg-4"
|
|
1044
|
-
},
|
|
1045
|
-
fileName: _jsxFileName,
|
|
1046
|
-
lineNumber: 602,
|
|
1047
|
-
columnNumber: 9
|
|
1048
|
-
}, this),
|
|
723
|
+
}),
|
|
1049
724
|
pickerEl
|
|
1050
725
|
]
|
|
1051
|
-
}
|
|
1052
|
-
fileName: _jsxFileName,
|
|
1053
|
-
lineNumber: 483,
|
|
1054
|
-
columnNumber: 5
|
|
1055
|
-
}, this);
|
|
726
|
+
});
|
|
1056
727
|
}
|
|
1057
728
|
function AltPopover({ alt, onSave, onOpen, btnClass }) {
|
|
1058
729
|
const [open, setOpen] = React.useState(false);
|
|
1059
730
|
const [v, setV] = React.useState(alt);
|
|
1060
731
|
const id = React.useId();
|
|
1061
|
-
return /* @__PURE__ */
|
|
732
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
|
1062
733
|
open,
|
|
1063
734
|
onOpenChange: (o) => {
|
|
1064
735
|
setOpen(o);
|
|
1065
736
|
onOpen(o);
|
|
1066
737
|
if (o) setV(alt);
|
|
1067
738
|
},
|
|
1068
|
-
children: [/* @__PURE__ */
|
|
739
|
+
children: [/* @__PURE__ */ jsx(Tooltip, {
|
|
1069
740
|
content: alt ? "Alt text" : "Add alt text",
|
|
1070
|
-
children: /* @__PURE__ */
|
|
741
|
+
children: /* @__PURE__ */ jsx(PopoverTrigger, {
|
|
1071
742
|
"aria-label": "Alt text",
|
|
1072
743
|
className: cn(btnClass, !alt && "text-kit-warning-fg"),
|
|
1073
|
-
children: /* @__PURE__ */
|
|
744
|
+
children: /* @__PURE__ */ jsx(IconAlt, {
|
|
1074
745
|
stroke: 1.5,
|
|
1075
746
|
"aria-hidden": true
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
columnNumber: 11
|
|
1080
|
-
}, this)
|
|
1081
|
-
}, void 0, false, {
|
|
1082
|
-
fileName: _jsxFileName,
|
|
1083
|
-
lineNumber: 631,
|
|
1084
|
-
columnNumber: 9
|
|
1085
|
-
}, this)
|
|
1086
|
-
}, void 0, false, {
|
|
1087
|
-
fileName: _jsxFileName,
|
|
1088
|
-
lineNumber: 630,
|
|
1089
|
-
columnNumber: 7
|
|
1090
|
-
}, this), /* @__PURE__ */ jsxDEV(PopoverContent, {
|
|
747
|
+
})
|
|
748
|
+
})
|
|
749
|
+
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
1091
750
|
className: "w-72",
|
|
1092
751
|
finalFocus: false,
|
|
1093
|
-
children: /* @__PURE__ */
|
|
752
|
+
children: /* @__PURE__ */ jsxs("form", {
|
|
1094
753
|
onSubmit: (e) => {
|
|
1095
754
|
e.preventDefault();
|
|
1096
755
|
onSave(v.trim());
|
|
@@ -1099,97 +758,53 @@ function AltPopover({ alt, onSave, onOpen, btnClass }) {
|
|
|
1099
758
|
},
|
|
1100
759
|
className: "flex flex-col gap-2",
|
|
1101
760
|
children: [
|
|
1102
|
-
/* @__PURE__ */
|
|
761
|
+
/* @__PURE__ */ jsx("label", {
|
|
1103
762
|
className: "text-kit-xs font-medium text-kit-fg-2",
|
|
1104
763
|
htmlFor: id,
|
|
1105
764
|
children: "Alt text"
|
|
1106
|
-
},
|
|
1107
|
-
|
|
1108
|
-
lineNumber: 645,
|
|
1109
|
-
columnNumber: 11
|
|
1110
|
-
}, this),
|
|
1111
|
-
/* @__PURE__ */ jsxDEV(Textarea, {
|
|
765
|
+
}),
|
|
766
|
+
/* @__PURE__ */ jsx(Textarea, {
|
|
1112
767
|
id,
|
|
1113
768
|
autoFocus: true,
|
|
1114
769
|
value: v,
|
|
1115
770
|
onChange: (e) => setV(e.target.value),
|
|
1116
771
|
placeholder: "Describe the image",
|
|
1117
772
|
rows: 2
|
|
1118
|
-
},
|
|
1119
|
-
|
|
1120
|
-
lineNumber: 648,
|
|
1121
|
-
columnNumber: 11
|
|
1122
|
-
}, this),
|
|
1123
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
773
|
+
}),
|
|
774
|
+
/* @__PURE__ */ jsx("p", {
|
|
1124
775
|
className: "text-kit-2xs text-kit-fg-3",
|
|
1125
776
|
children: "Read aloud by screen readers and used by search engines."
|
|
1126
|
-
},
|
|
1127
|
-
|
|
1128
|
-
lineNumber: 649,
|
|
1129
|
-
columnNumber: 11
|
|
1130
|
-
}, this),
|
|
1131
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
777
|
+
}),
|
|
778
|
+
/* @__PURE__ */ jsx("div", {
|
|
1132
779
|
className: "flex justify-end",
|
|
1133
|
-
children: /* @__PURE__ */
|
|
780
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
1134
781
|
size: "xs",
|
|
1135
782
|
variant: "primary",
|
|
1136
783
|
type: "submit",
|
|
1137
784
|
children: "Done"
|
|
1138
|
-
}
|
|
1139
|
-
|
|
1140
|
-
lineNumber: 651,
|
|
1141
|
-
columnNumber: 13
|
|
1142
|
-
}, this)
|
|
1143
|
-
}, void 0, false, {
|
|
1144
|
-
fileName: _jsxFileName,
|
|
1145
|
-
lineNumber: 650,
|
|
1146
|
-
columnNumber: 11
|
|
1147
|
-
}, this)
|
|
785
|
+
})
|
|
786
|
+
})
|
|
1148
787
|
]
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
columnNumber: 9
|
|
1153
|
-
}, this)
|
|
1154
|
-
}, void 0, false, {
|
|
1155
|
-
fileName: _jsxFileName,
|
|
1156
|
-
lineNumber: 635,
|
|
1157
|
-
columnNumber: 7
|
|
1158
|
-
}, this)]
|
|
1159
|
-
}, void 0, true, {
|
|
1160
|
-
fileName: _jsxFileName,
|
|
1161
|
-
lineNumber: 622,
|
|
1162
|
-
columnNumber: 5
|
|
1163
|
-
}, this);
|
|
788
|
+
})
|
|
789
|
+
})]
|
|
790
|
+
});
|
|
1164
791
|
}
|
|
1165
792
|
var TONES = {
|
|
1166
793
|
info: {
|
|
1167
794
|
label: "Info",
|
|
1168
|
-
icon: /* @__PURE__ */
|
|
1169
|
-
fileName: _jsxFileName,
|
|
1170
|
-
lineNumber: 663,
|
|
1171
|
-
columnNumber: 32
|
|
1172
|
-
}, void 0),
|
|
795
|
+
icon: /* @__PURE__ */ jsx(IconInfoCircle, { stroke: 1.5 }),
|
|
1173
796
|
box: "border-kit-info-line bg-kit-info-soft",
|
|
1174
797
|
chip: "text-kit-info-fg"
|
|
1175
798
|
},
|
|
1176
799
|
tip: {
|
|
1177
800
|
label: "Tip",
|
|
1178
|
-
icon: /* @__PURE__ */
|
|
1179
|
-
fileName: _jsxFileName,
|
|
1180
|
-
lineNumber: 664,
|
|
1181
|
-
columnNumber: 30
|
|
1182
|
-
}, void 0),
|
|
801
|
+
icon: /* @__PURE__ */ jsx(IconBulb, { stroke: 1.5 }),
|
|
1183
802
|
box: "border-kit-success-line bg-kit-success-soft",
|
|
1184
803
|
chip: "text-kit-success-fg"
|
|
1185
804
|
},
|
|
1186
805
|
warning: {
|
|
1187
806
|
label: "Warning",
|
|
1188
|
-
icon: /* @__PURE__ */
|
|
1189
|
-
fileName: _jsxFileName,
|
|
1190
|
-
lineNumber: 665,
|
|
1191
|
-
columnNumber: 38
|
|
1192
|
-
}, void 0),
|
|
807
|
+
icon: /* @__PURE__ */ jsx(IconAlertTriangle, { stroke: 1.5 }),
|
|
1193
808
|
box: "border-kit-warning-line bg-kit-warning-soft",
|
|
1194
809
|
chip: "text-kit-warning-fg"
|
|
1195
810
|
}
|
|
@@ -1199,103 +814,55 @@ function CalloutBlock({ m, set, el, ctx, autoFocus }) {
|
|
|
1199
814
|
const t = TONES[tone];
|
|
1200
815
|
const body = React.useRef(null);
|
|
1201
816
|
const ro = ctx.readOnly;
|
|
1202
|
-
return /* @__PURE__ */
|
|
817
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1203
818
|
className: cn("group/blk relative rounded-kit-lg border px-3.5 py-3", t.box),
|
|
1204
819
|
"data-rt-isolate": "",
|
|
1205
820
|
children: [
|
|
1206
|
-
/* @__PURE__ */
|
|
821
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1207
822
|
className: "flex items-center gap-1",
|
|
1208
823
|
children: [
|
|
1209
|
-
/* @__PURE__ */
|
|
824
|
+
/* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsx(MenuTrigger, {
|
|
1210
825
|
disabled: ro,
|
|
1211
|
-
render: /* @__PURE__ */
|
|
826
|
+
render: /* @__PURE__ */ jsxs("button", {
|
|
1212
827
|
type: "button",
|
|
1213
828
|
"aria-label": `Callout tone: ${t.label}`,
|
|
1214
829
|
className: cn("-ml-1 flex h-6 items-center gap-1 rounded-kit-md px-1.5 text-kit-xs font-medium hover:bg-kit-hover data-[popup-open]:bg-kit-hover [&_svg]:size-3.5", t.chip),
|
|
1215
830
|
children: [
|
|
1216
831
|
t.icon,
|
|
1217
832
|
t.label,
|
|
1218
|
-
ro ? null : /* @__PURE__ */
|
|
833
|
+
ro ? null : /* @__PURE__ */ jsx(IconChevronDown, {
|
|
1219
834
|
className: "!size-3 opacity-70",
|
|
1220
835
|
stroke: 1.5,
|
|
1221
836
|
"aria-hidden": true
|
|
1222
|
-
}
|
|
1223
|
-
fileName: _jsxFileName,
|
|
1224
|
-
lineNumber: 687,
|
|
1225
|
-
columnNumber: 30
|
|
1226
|
-
}, this)
|
|
837
|
+
})
|
|
1227
838
|
]
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
|
-
lineNumber: 680,
|
|
1231
|
-
columnNumber: 15
|
|
1232
|
-
}, this)
|
|
1233
|
-
}, void 0, false, {
|
|
1234
|
-
fileName: _jsxFileName,
|
|
1235
|
-
lineNumber: 677,
|
|
1236
|
-
columnNumber: 11
|
|
1237
|
-
}, this), /* @__PURE__ */ jsxDEV(MenuContent, {
|
|
839
|
+
})
|
|
840
|
+
}), /* @__PURE__ */ jsx(MenuContent, {
|
|
1238
841
|
className: "w-36",
|
|
1239
|
-
children: CALLOUT_TONES.map((k) => /* @__PURE__ */
|
|
842
|
+
children: CALLOUT_TONES.map((k) => /* @__PURE__ */ jsx(MenuItem, {
|
|
1240
843
|
icon: TONES[k].icon,
|
|
1241
844
|
onClick: () => set({ tone: k }, "Change callout tone"),
|
|
1242
|
-
children: /* @__PURE__ */
|
|
845
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
1243
846
|
className: "flex w-full items-center justify-between",
|
|
1244
|
-
children: [TONES[k].label, tone === k ? /* @__PURE__ */
|
|
847
|
+
children: [TONES[k].label, tone === k ? /* @__PURE__ */ jsx(IconCheck, {
|
|
1245
848
|
className: "size-3.5 text-kit-fg-2",
|
|
1246
849
|
stroke: 2,
|
|
1247
850
|
"aria-hidden": true
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
fileName: _jsxFileName,
|
|
1255
|
-
lineNumber: 694,
|
|
1256
|
-
columnNumber: 17
|
|
1257
|
-
}, this)
|
|
1258
|
-
}, k, false, {
|
|
1259
|
-
fileName: _jsxFileName,
|
|
1260
|
-
lineNumber: 693,
|
|
1261
|
-
columnNumber: 15
|
|
1262
|
-
}, this))
|
|
1263
|
-
}, void 0, false, {
|
|
1264
|
-
fileName: _jsxFileName,
|
|
1265
|
-
lineNumber: 691,
|
|
1266
|
-
columnNumber: 11
|
|
1267
|
-
}, this)] }, void 0, true, {
|
|
1268
|
-
fileName: _jsxFileName,
|
|
1269
|
-
lineNumber: 676,
|
|
1270
|
-
columnNumber: 9
|
|
1271
|
-
}, this),
|
|
1272
|
-
/* @__PURE__ */ jsxDEV("span", { className: "flex-1" }, void 0, false, {
|
|
1273
|
-
fileName: _jsxFileName,
|
|
1274
|
-
lineNumber: 702,
|
|
1275
|
-
columnNumber: 9
|
|
1276
|
-
}, this),
|
|
1277
|
-
ro ? null : /* @__PURE__ */ jsxDEV("div", {
|
|
851
|
+
}) : null]
|
|
852
|
+
})
|
|
853
|
+
}, k))
|
|
854
|
+
})] }),
|
|
855
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1" }),
|
|
856
|
+
ro ? null : /* @__PURE__ */ jsx("div", {
|
|
1278
857
|
className: "opacity-0 transition-opacity group-hover/blk:opacity-100 group-focus-within/blk:opacity-100 pointer-coarse:opacity-100",
|
|
1279
|
-
children: /* @__PURE__ */
|
|
858
|
+
children: /* @__PURE__ */ jsx(RemoveBtn, {
|
|
1280
859
|
onClick: () => ctx.remove(el),
|
|
1281
860
|
label: "Remove callout"
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
lineNumber: 705,
|
|
1285
|
-
columnNumber: 13
|
|
1286
|
-
}, this)
|
|
1287
|
-
}, void 0, false, {
|
|
1288
|
-
fileName: _jsxFileName,
|
|
1289
|
-
lineNumber: 704,
|
|
1290
|
-
columnNumber: 11
|
|
1291
|
-
}, this)
|
|
861
|
+
})
|
|
862
|
+
})
|
|
1292
863
|
]
|
|
1293
|
-
},
|
|
1294
|
-
|
|
1295
|
-
lineNumber: 675,
|
|
1296
|
-
columnNumber: 7
|
|
1297
|
-
}, this),
|
|
1298
|
-
/* @__PURE__ */ jsxDEV(PlainEditable, {
|
|
864
|
+
}),
|
|
865
|
+
/* @__PURE__ */ jsx(PlainEditable, {
|
|
1299
866
|
value: m.title ?? "",
|
|
1300
867
|
label: "Callout title",
|
|
1301
868
|
readOnly: ro,
|
|
@@ -1308,14 +875,10 @@ function CalloutBlock({ m, set, el, ctx, autoFocus }) {
|
|
|
1308
875
|
if (b) placeCaret(b, false);
|
|
1309
876
|
},
|
|
1310
877
|
className: "mt-1 font-medium text-kit-fg"
|
|
1311
|
-
},
|
|
1312
|
-
|
|
1313
|
-
lineNumber: 709,
|
|
1314
|
-
columnNumber: 7
|
|
1315
|
-
}, this),
|
|
1316
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
878
|
+
}),
|
|
879
|
+
/* @__PURE__ */ jsx("div", {
|
|
1317
880
|
ref: body,
|
|
1318
|
-
children: /* @__PURE__ */
|
|
881
|
+
children: /* @__PURE__ */ jsx(PlainEditable, {
|
|
1319
882
|
multiline: true,
|
|
1320
883
|
value: m.body ?? "",
|
|
1321
884
|
label: "Callout message",
|
|
@@ -1323,56 +886,36 @@ function CalloutBlock({ m, set, el, ctx, autoFocus }) {
|
|
|
1323
886
|
placeholder: "Write a message…",
|
|
1324
887
|
onChange: (b) => set({ body: b }, "Edit callout message"),
|
|
1325
888
|
className: "mt-0.5 text-kit-fg-2 [&_p+p]:mt-2"
|
|
1326
|
-
}
|
|
1327
|
-
|
|
1328
|
-
lineNumber: 724,
|
|
1329
|
-
columnNumber: 9
|
|
1330
|
-
}, this)
|
|
1331
|
-
}, void 0, false, {
|
|
1332
|
-
fileName: _jsxFileName,
|
|
1333
|
-
lineNumber: 723,
|
|
1334
|
-
columnNumber: 7
|
|
1335
|
-
}, this)
|
|
889
|
+
})
|
|
890
|
+
})
|
|
1336
891
|
]
|
|
1337
|
-
}
|
|
1338
|
-
fileName: _jsxFileName,
|
|
1339
|
-
lineNumber: 674,
|
|
1340
|
-
columnNumber: 5
|
|
1341
|
-
}, this);
|
|
892
|
+
});
|
|
1342
893
|
}
|
|
1343
894
|
function ToggleBlock({ m, set, el, ctx, autoFocus }) {
|
|
1344
895
|
const [open, setOpen] = React.useState(!!autoFocus);
|
|
1345
896
|
const body = React.useRef(null);
|
|
1346
897
|
const bodyId = React.useId();
|
|
1347
898
|
const ro = ctx.readOnly;
|
|
1348
|
-
return /* @__PURE__ */
|
|
899
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1349
900
|
className: "group/blk relative rounded-kit-md",
|
|
1350
901
|
"data-rt-isolate": "",
|
|
1351
|
-
children: [/* @__PURE__ */
|
|
902
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1352
903
|
className: "flex items-start gap-1",
|
|
1353
904
|
children: [
|
|
1354
|
-
/* @__PURE__ */
|
|
905
|
+
/* @__PURE__ */ jsx("button", {
|
|
1355
906
|
type: "button",
|
|
1356
907
|
"aria-expanded": open,
|
|
1357
908
|
"aria-controls": bodyId,
|
|
1358
909
|
"aria-label": open ? "Collapse toggle" : "Expand toggle",
|
|
1359
910
|
onClick: () => setOpen((o) => !o),
|
|
1360
911
|
className: "mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-kit-md text-kit-fg-2 hover:bg-kit-hover hover:text-kit-fg",
|
|
1361
|
-
children: /* @__PURE__ */
|
|
912
|
+
children: /* @__PURE__ */ jsx(IconChevronRight, {
|
|
1362
913
|
className: cn("size-4 transition-transform duration-150", open && "rotate-90"),
|
|
1363
914
|
stroke: 1.5,
|
|
1364
915
|
"aria-hidden": true
|
|
1365
|
-
}
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
columnNumber: 11
|
|
1369
|
-
}, this)
|
|
1370
|
-
}, void 0, false, {
|
|
1371
|
-
fileName: _jsxFileName,
|
|
1372
|
-
lineNumber: 747,
|
|
1373
|
-
columnNumber: 9
|
|
1374
|
-
}, this),
|
|
1375
|
-
/* @__PURE__ */ jsxDEV(PlainEditable, {
|
|
916
|
+
})
|
|
917
|
+
}),
|
|
918
|
+
/* @__PURE__ */ jsx(PlainEditable, {
|
|
1376
919
|
value: m.title ?? "",
|
|
1377
920
|
label: "Toggle title",
|
|
1378
921
|
readOnly: ro,
|
|
@@ -1388,37 +931,21 @@ function ToggleBlock({ m, set, el, ctx, autoFocus }) {
|
|
|
1388
931
|
});
|
|
1389
932
|
},
|
|
1390
933
|
className: "flex-1 py-0.5 font-medium text-kit-fg"
|
|
1391
|
-
},
|
|
1392
|
-
|
|
1393
|
-
lineNumber: 757,
|
|
1394
|
-
columnNumber: 9
|
|
1395
|
-
}, this),
|
|
1396
|
-
ro ? null : /* @__PURE__ */ jsxDEV("div", {
|
|
934
|
+
}),
|
|
935
|
+
ro ? null : /* @__PURE__ */ jsx("div", {
|
|
1397
936
|
className: "opacity-0 transition-opacity group-hover/blk:opacity-100 group-focus-within/blk:opacity-100 pointer-coarse:opacity-100",
|
|
1398
|
-
children: /* @__PURE__ */
|
|
937
|
+
children: /* @__PURE__ */ jsx(RemoveBtn, {
|
|
1399
938
|
onClick: () => ctx.remove(el),
|
|
1400
939
|
label: "Remove toggle"
|
|
1401
|
-
}
|
|
1402
|
-
|
|
1403
|
-
lineNumber: 776,
|
|
1404
|
-
columnNumber: 13
|
|
1405
|
-
}, this)
|
|
1406
|
-
}, void 0, false, {
|
|
1407
|
-
fileName: _jsxFileName,
|
|
1408
|
-
lineNumber: 775,
|
|
1409
|
-
columnNumber: 11
|
|
1410
|
-
}, this)
|
|
940
|
+
})
|
|
941
|
+
})
|
|
1411
942
|
]
|
|
1412
|
-
},
|
|
1413
|
-
fileName: _jsxFileName,
|
|
1414
|
-
lineNumber: 746,
|
|
1415
|
-
columnNumber: 7
|
|
1416
|
-
}, this), /* @__PURE__ */ jsxDEV("div", {
|
|
943
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
1417
944
|
ref: body,
|
|
1418
945
|
id: bodyId,
|
|
1419
946
|
hidden: !open,
|
|
1420
947
|
className: "ml-3 mt-1 border-l border-kit-line pl-4",
|
|
1421
|
-
children: /* @__PURE__ */
|
|
948
|
+
children: /* @__PURE__ */ jsx(PlainEditable, {
|
|
1422
949
|
multiline: true,
|
|
1423
950
|
value: m.body ?? "",
|
|
1424
951
|
label: "Toggle body",
|
|
@@ -1426,21 +953,9 @@ function ToggleBlock({ m, set, el, ctx, autoFocus }) {
|
|
|
1426
953
|
placeholder: "Hidden content. Click to write…",
|
|
1427
954
|
onChange: (b) => set({ body: b }, "Edit toggle body"),
|
|
1428
955
|
className: "py-0.5 text-kit-fg-2 [&_p+p]:mt-2"
|
|
1429
|
-
}
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
columnNumber: 9
|
|
1433
|
-
}, this)
|
|
1434
|
-
}, void 0, false, {
|
|
1435
|
-
fileName: _jsxFileName,
|
|
1436
|
-
lineNumber: 780,
|
|
1437
|
-
columnNumber: 7
|
|
1438
|
-
}, this)]
|
|
1439
|
-
}, void 0, true, {
|
|
1440
|
-
fileName: _jsxFileName,
|
|
1441
|
-
lineNumber: 745,
|
|
1442
|
-
columnNumber: 5
|
|
1443
|
-
}, this);
|
|
956
|
+
})
|
|
957
|
+
})]
|
|
958
|
+
});
|
|
1444
959
|
}
|
|
1445
960
|
var videoUrlOk = (u) => /^https?:\/\/\S+$/i.test(u) || /^\/(?!\/)\S*$/.test(u);
|
|
1446
961
|
function VideoBlock({ m, set, el, ctx, autoFocus }) {
|
|
@@ -1456,13 +971,13 @@ function VideoBlock({ m, set, el, ctx, autoFocus }) {
|
|
|
1456
971
|
set({ url: u }, "Set video link");
|
|
1457
972
|
};
|
|
1458
973
|
const ro = ctx.readOnly;
|
|
1459
|
-
return /* @__PURE__ */
|
|
974
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1460
975
|
className: "group/blk rounded-kit-lg border border-kit-line bg-kit-subtle p-2.5",
|
|
1461
976
|
"data-rt-isolate": "",
|
|
1462
977
|
children: [
|
|
1463
|
-
ro ? null : /* @__PURE__ */
|
|
978
|
+
ro ? null : /* @__PURE__ */ jsxs("div", {
|
|
1464
979
|
className: "mb-2 flex items-center gap-1.5",
|
|
1465
|
-
children: [/* @__PURE__ */
|
|
980
|
+
children: [/* @__PURE__ */ jsx(Input, {
|
|
1466
981
|
size: "sm",
|
|
1467
982
|
autoFocus,
|
|
1468
983
|
value: draft,
|
|
@@ -1480,60 +995,28 @@ function VideoBlock({ m, set, el, ctx, autoFocus }) {
|
|
|
1480
995
|
"aria-describedby": error ? errId : void 0,
|
|
1481
996
|
spellCheck: false,
|
|
1482
997
|
autoComplete: "off",
|
|
1483
|
-
leading: /* @__PURE__ */
|
|
1484
|
-
fileName: _jsxFileName,
|
|
1485
|
-
lineNumber: 832,
|
|
1486
|
-
columnNumber: 22
|
|
1487
|
-
}, this),
|
|
998
|
+
leading: /* @__PURE__ */ jsx(IconWorld, { stroke: 1.5 }),
|
|
1488
999
|
className: "min-w-0 flex-1"
|
|
1489
|
-
},
|
|
1490
|
-
fileName: _jsxFileName,
|
|
1491
|
-
lineNumber: 814,
|
|
1492
|
-
columnNumber: 11
|
|
1493
|
-
}, this), /* @__PURE__ */ jsxDEV(RemoveBtn, {
|
|
1000
|
+
}), /* @__PURE__ */ jsx(RemoveBtn, {
|
|
1494
1001
|
onClick: () => ctx.remove(el),
|
|
1495
1002
|
label: "Remove video"
|
|
1496
|
-
}
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
columnNumber: 11
|
|
1500
|
-
}, this)]
|
|
1501
|
-
}, void 0, true, {
|
|
1502
|
-
fileName: _jsxFileName,
|
|
1503
|
-
lineNumber: 813,
|
|
1504
|
-
columnNumber: 9
|
|
1505
|
-
}, this),
|
|
1506
|
-
error ? /* @__PURE__ */ jsxDEV("p", {
|
|
1003
|
+
})]
|
|
1004
|
+
}),
|
|
1005
|
+
error ? /* @__PURE__ */ jsx("p", {
|
|
1507
1006
|
id: errId,
|
|
1508
1007
|
role: "alert",
|
|
1509
1008
|
className: "mb-2 px-1 text-kit-xs text-kit-danger-fg",
|
|
1510
1009
|
children: error
|
|
1511
|
-
}
|
|
1512
|
-
|
|
1513
|
-
lineNumber: 839,
|
|
1514
|
-
columnNumber: 9
|
|
1515
|
-
}, this) : null,
|
|
1516
|
-
m.url ? /* @__PURE__ */ jsxDEV(VideoPreview, {
|
|
1010
|
+
}) : null,
|
|
1011
|
+
m.url ? /* @__PURE__ */ jsx(VideoPreview, {
|
|
1517
1012
|
url: m.url,
|
|
1518
1013
|
title: "Video"
|
|
1519
|
-
}
|
|
1520
|
-
fileName: _jsxFileName,
|
|
1521
|
-
lineNumber: 844,
|
|
1522
|
-
columnNumber: 16
|
|
1523
|
-
}, this) : /* @__PURE__ */ jsxDEV("p", {
|
|
1014
|
+
}) : /* @__PURE__ */ jsx("p", {
|
|
1524
1015
|
className: "px-1 pb-0.5 text-kit-xs text-kit-fg-3",
|
|
1525
1016
|
children: "No video yet."
|
|
1526
|
-
}
|
|
1527
|
-
fileName: _jsxFileName,
|
|
1528
|
-
lineNumber: 844,
|
|
1529
|
-
columnNumber: 61
|
|
1530
|
-
}, this)
|
|
1017
|
+
})
|
|
1531
1018
|
]
|
|
1532
|
-
}
|
|
1533
|
-
fileName: _jsxFileName,
|
|
1534
|
-
lineNumber: 811,
|
|
1535
|
-
columnNumber: 5
|
|
1536
|
-
}, this);
|
|
1019
|
+
});
|
|
1537
1020
|
}
|
|
1538
1021
|
var formatBytes = (n) => n < 1024 ? `${n} B` : n < 1048576 ? `${(n / 1024).toFixed(0)} KB` : `${(n / 1024 / 1024).toFixed(1)} MB`;
|
|
1539
1022
|
function FileBlock({ m, set, el, ctx, autoFocus }) {
|
|
@@ -1543,7 +1026,7 @@ function FileBlock({ m, set, el, ctx, autoFocus }) {
|
|
|
1543
1026
|
const [name, setName] = React.useState("");
|
|
1544
1027
|
const ro = ctx.readOnly;
|
|
1545
1028
|
const has = !!(m.url && m.name);
|
|
1546
|
-
const pickerEl = MediaPicker ? /* @__PURE__ */
|
|
1029
|
+
const pickerEl = MediaPicker ? /* @__PURE__ */ jsx(MediaPicker, {
|
|
1547
1030
|
open: picker,
|
|
1548
1031
|
onOpenChange: setPicker,
|
|
1549
1032
|
accept: ["file"],
|
|
@@ -1552,164 +1035,80 @@ function FileBlock({ m, set, el, ctx, autoFocus }) {
|
|
|
1552
1035
|
name: a[0].name ?? a[0].url.split("/").pop() ?? "Download",
|
|
1553
1036
|
...a[0].size ? { size: a[0].size } : {}
|
|
1554
1037
|
}, "Choose file")
|
|
1555
|
-
}
|
|
1556
|
-
|
|
1557
|
-
lineNumber: 859,
|
|
1558
|
-
columnNumber: 5
|
|
1559
|
-
}, this) : null;
|
|
1560
|
-
if (has) return /* @__PURE__ */ jsxDEV("div", {
|
|
1038
|
+
}) : null;
|
|
1039
|
+
if (has) return /* @__PURE__ */ jsxs("div", {
|
|
1561
1040
|
className: "group/blk",
|
|
1562
1041
|
"data-rt-isolate": "",
|
|
1563
|
-
children: [/* @__PURE__ */
|
|
1042
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1564
1043
|
className: "flex items-center gap-3 rounded-kit-lg border border-kit-line bg-kit-surface px-3 py-2.5",
|
|
1565
1044
|
children: [
|
|
1566
|
-
/* @__PURE__ */
|
|
1045
|
+
/* @__PURE__ */ jsx("span", {
|
|
1567
1046
|
className: "flex size-9 shrink-0 items-center justify-center rounded-kit-md bg-kit-muted text-kit-fg-2",
|
|
1568
|
-
children: /* @__PURE__ */
|
|
1047
|
+
children: /* @__PURE__ */ jsx(IconFileText, {
|
|
1569
1048
|
className: "size-[18px]",
|
|
1570
1049
|
stroke: 1.5,
|
|
1571
1050
|
"aria-hidden": true
|
|
1572
|
-
}
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
columnNumber: 13
|
|
1576
|
-
}, this)
|
|
1577
|
-
}, void 0, false, {
|
|
1578
|
-
fileName: _jsxFileName,
|
|
1579
|
-
lineNumber: 865,
|
|
1580
|
-
columnNumber: 11
|
|
1581
|
-
}, this),
|
|
1582
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
1051
|
+
})
|
|
1052
|
+
}),
|
|
1053
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1583
1054
|
className: "min-w-0 flex-1",
|
|
1584
|
-
children: [/* @__PURE__ */
|
|
1055
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1585
1056
|
className: "truncate text-kit-sm font-medium text-kit-fg",
|
|
1586
1057
|
children: m.name
|
|
1587
|
-
},
|
|
1588
|
-
fileName: _jsxFileName,
|
|
1589
|
-
lineNumber: 869,
|
|
1590
|
-
columnNumber: 13
|
|
1591
|
-
}, this), /* @__PURE__ */ jsxDEV("div", {
|
|
1058
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
1592
1059
|
className: "truncate text-kit-xs text-kit-fg-3",
|
|
1593
1060
|
children: [m.size ? `${formatBytes(m.size)} · ` : "", (m.name.includes(".") ? m.name.split(".").pop() : "file").toUpperCase()]
|
|
1594
|
-
}
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
columnNumber: 13
|
|
1598
|
-
}, this)]
|
|
1599
|
-
}, void 0, true, {
|
|
1600
|
-
fileName: _jsxFileName,
|
|
1601
|
-
lineNumber: 868,
|
|
1602
|
-
columnNumber: 11
|
|
1603
|
-
}, this),
|
|
1604
|
-
ro ? null : /* @__PURE__ */ jsxDEV(Fragment, { children: [MediaPicker ? /* @__PURE__ */ jsxDEV(Button, {
|
|
1061
|
+
})]
|
|
1062
|
+
}),
|
|
1063
|
+
ro ? null : /* @__PURE__ */ jsxs(Fragment, { children: [MediaPicker ? /* @__PURE__ */ jsx(Button, {
|
|
1605
1064
|
size: "xs",
|
|
1606
1065
|
variant: "ghost",
|
|
1607
1066
|
onClick: () => setPicker(true),
|
|
1608
1067
|
children: "Replace"
|
|
1609
|
-
}
|
|
1610
|
-
fileName: _jsxFileName,
|
|
1611
|
-
lineNumber: 878,
|
|
1612
|
-
columnNumber: 17
|
|
1613
|
-
}, this) : null, /* @__PURE__ */ jsxDEV(RemoveBtn, {
|
|
1068
|
+
}) : null, /* @__PURE__ */ jsx(RemoveBtn, {
|
|
1614
1069
|
onClick: () => ctx.remove(el),
|
|
1615
1070
|
label: "Remove file"
|
|
1616
|
-
}
|
|
1617
|
-
fileName: _jsxFileName,
|
|
1618
|
-
lineNumber: 882,
|
|
1619
|
-
columnNumber: 15
|
|
1620
|
-
}, this)] }, void 0, true, {
|
|
1621
|
-
fileName: _jsxFileName,
|
|
1622
|
-
lineNumber: 876,
|
|
1623
|
-
columnNumber: 13
|
|
1624
|
-
}, this)
|
|
1071
|
+
})] })
|
|
1625
1072
|
]
|
|
1626
|
-
},
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
columnNumber: 9
|
|
1630
|
-
}, this), pickerEl]
|
|
1631
|
-
}, void 0, true, {
|
|
1632
|
-
fileName: _jsxFileName,
|
|
1633
|
-
lineNumber: 863,
|
|
1634
|
-
columnNumber: 7
|
|
1635
|
-
}, this);
|
|
1636
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
1073
|
+
}), pickerEl]
|
|
1074
|
+
});
|
|
1075
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1637
1076
|
className: "group/blk",
|
|
1638
1077
|
"data-rt-isolate": "",
|
|
1639
1078
|
children: [
|
|
1640
|
-
/* @__PURE__ */
|
|
1079
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1641
1080
|
className: "flex items-center gap-3 rounded-kit-lg border border-dashed border-kit-line-strong bg-kit-subtle px-3 py-2.5",
|
|
1642
1081
|
children: [
|
|
1643
|
-
/* @__PURE__ */
|
|
1082
|
+
/* @__PURE__ */ jsx("span", {
|
|
1644
1083
|
className: "flex size-9 shrink-0 items-center justify-center rounded-kit-md border border-kit-line bg-kit-control-bg text-kit-fg-3",
|
|
1645
|
-
children: /* @__PURE__ */
|
|
1084
|
+
children: /* @__PURE__ */ jsx(IconFileText, {
|
|
1646
1085
|
className: "size-[18px]",
|
|
1647
1086
|
stroke: 1.5,
|
|
1648
1087
|
"aria-hidden": true
|
|
1649
|
-
}
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
columnNumber: 11
|
|
1653
|
-
}, this)
|
|
1654
|
-
}, void 0, false, {
|
|
1655
|
-
fileName: _jsxFileName,
|
|
1656
|
-
lineNumber: 892,
|
|
1657
|
-
columnNumber: 9
|
|
1658
|
-
}, this),
|
|
1659
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
1088
|
+
})
|
|
1089
|
+
}),
|
|
1090
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1660
1091
|
className: "min-w-0 flex-1",
|
|
1661
|
-
children: [/* @__PURE__ */
|
|
1092
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1662
1093
|
className: "text-kit-sm font-medium text-kit-fg",
|
|
1663
1094
|
children: "File"
|
|
1664
|
-
},
|
|
1665
|
-
fileName: _jsxFileName,
|
|
1666
|
-
lineNumber: 896,
|
|
1667
|
-
columnNumber: 11
|
|
1668
|
-
}, this), /* @__PURE__ */ jsxDEV("p", {
|
|
1095
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
1669
1096
|
className: "text-kit-xs text-kit-fg-3",
|
|
1670
1097
|
children: "No file yet."
|
|
1671
|
-
}
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
columnNumber: 11
|
|
1675
|
-
}, this)]
|
|
1676
|
-
}, void 0, true, {
|
|
1677
|
-
fileName: _jsxFileName,
|
|
1678
|
-
lineNumber: 895,
|
|
1679
|
-
columnNumber: 9
|
|
1680
|
-
}, this),
|
|
1681
|
-
ro ? null : /* @__PURE__ */ jsxDEV(Fragment, { children: [MediaPicker ? /* @__PURE__ */ jsxDEV(Button, {
|
|
1098
|
+
})]
|
|
1099
|
+
}),
|
|
1100
|
+
ro ? null : /* @__PURE__ */ jsxs(Fragment, { children: [MediaPicker ? /* @__PURE__ */ jsx(Button, {
|
|
1682
1101
|
size: "sm",
|
|
1683
|
-
leftIcon: /* @__PURE__ */
|
|
1684
|
-
fileName: _jsxFileName,
|
|
1685
|
-
lineNumber: 902,
|
|
1686
|
-
columnNumber: 43
|
|
1687
|
-
}, this),
|
|
1102
|
+
leftIcon: /* @__PURE__ */ jsx(IconFileUpload, { stroke: 1.5 }),
|
|
1688
1103
|
onClick: () => setPicker(true),
|
|
1689
1104
|
children: "Choose file"
|
|
1690
|
-
}
|
|
1691
|
-
fileName: _jsxFileName,
|
|
1692
|
-
lineNumber: 902,
|
|
1693
|
-
columnNumber: 15
|
|
1694
|
-
}, this) : null, /* @__PURE__ */ jsxDEV(RemoveBtn, {
|
|
1105
|
+
}) : null, /* @__PURE__ */ jsx(RemoveBtn, {
|
|
1695
1106
|
onClick: () => ctx.remove(el),
|
|
1696
1107
|
label: "Remove file"
|
|
1697
|
-
}
|
|
1698
|
-
fileName: _jsxFileName,
|
|
1699
|
-
lineNumber: 906,
|
|
1700
|
-
columnNumber: 13
|
|
1701
|
-
}, this)] }, void 0, true, {
|
|
1702
|
-
fileName: _jsxFileName,
|
|
1703
|
-
lineNumber: 900,
|
|
1704
|
-
columnNumber: 11
|
|
1705
|
-
}, this)
|
|
1108
|
+
})] })
|
|
1706
1109
|
]
|
|
1707
|
-
},
|
|
1708
|
-
|
|
1709
|
-
lineNumber: 891,
|
|
1710
|
-
columnNumber: 7
|
|
1711
|
-
}, this),
|
|
1712
|
-
ro ? null : /* @__PURE__ */ jsxDEV("form", {
|
|
1110
|
+
}),
|
|
1111
|
+
ro ? null : /* @__PURE__ */ jsxs("form", {
|
|
1713
1112
|
className: "mt-2.5 flex flex-wrap items-center gap-2",
|
|
1714
1113
|
onSubmit: (e) => {
|
|
1715
1114
|
e.preventDefault();
|
|
@@ -1722,7 +1121,7 @@ function FileBlock({ m, set, el, ctx, autoFocus }) {
|
|
|
1722
1121
|
ctx.exit(el);
|
|
1723
1122
|
},
|
|
1724
1123
|
children: [
|
|
1725
|
-
/* @__PURE__ */
|
|
1124
|
+
/* @__PURE__ */ jsx(Input, {
|
|
1726
1125
|
autoFocus: autoFocus && !MediaPicker,
|
|
1727
1126
|
size: "sm",
|
|
1728
1127
|
value: url,
|
|
@@ -1731,53 +1130,29 @@ function FileBlock({ m, set, el, ctx, autoFocus }) {
|
|
|
1731
1130
|
"aria-label": "File URL",
|
|
1732
1131
|
spellCheck: false,
|
|
1733
1132
|
autoComplete: "off",
|
|
1734
|
-
leading: /* @__PURE__ */
|
|
1735
|
-
fileName: _jsxFileName,
|
|
1736
|
-
lineNumber: 921,
|
|
1737
|
-
columnNumber: 222
|
|
1738
|
-
}, this),
|
|
1133
|
+
leading: /* @__PURE__ */ jsx(IconLink, { stroke: 1.5 }),
|
|
1739
1134
|
className: "min-w-40 flex-1"
|
|
1740
|
-
},
|
|
1741
|
-
|
|
1742
|
-
lineNumber: 921,
|
|
1743
|
-
columnNumber: 11
|
|
1744
|
-
}, this),
|
|
1745
|
-
/* @__PURE__ */ jsxDEV(Input, {
|
|
1135
|
+
}),
|
|
1136
|
+
/* @__PURE__ */ jsx(Input, {
|
|
1746
1137
|
size: "sm",
|
|
1747
1138
|
value: name,
|
|
1748
1139
|
onChange: (e) => setName(e.target.value),
|
|
1749
1140
|
placeholder: "Link text",
|
|
1750
1141
|
"aria-label": "File name shown to readers",
|
|
1751
1142
|
className: "min-w-28 flex-1"
|
|
1752
|
-
},
|
|
1753
|
-
|
|
1754
|
-
lineNumber: 922,
|
|
1755
|
-
columnNumber: 11
|
|
1756
|
-
}, this),
|
|
1757
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
1143
|
+
}),
|
|
1144
|
+
/* @__PURE__ */ jsx(Button, {
|
|
1758
1145
|
size: "sm",
|
|
1759
1146
|
variant: "primary",
|
|
1760
1147
|
type: "submit",
|
|
1761
1148
|
disabled: !url.trim(),
|
|
1762
1149
|
children: "Add"
|
|
1763
|
-
}
|
|
1764
|
-
fileName: _jsxFileName,
|
|
1765
|
-
lineNumber: 923,
|
|
1766
|
-
columnNumber: 11
|
|
1767
|
-
}, this)
|
|
1150
|
+
})
|
|
1768
1151
|
]
|
|
1769
|
-
},
|
|
1770
|
-
fileName: _jsxFileName,
|
|
1771
|
-
lineNumber: 911,
|
|
1772
|
-
columnNumber: 9
|
|
1773
|
-
}, this),
|
|
1152
|
+
}),
|
|
1774
1153
|
pickerEl
|
|
1775
1154
|
]
|
|
1776
|
-
}
|
|
1777
|
-
fileName: _jsxFileName,
|
|
1778
|
-
lineNumber: 890,
|
|
1779
|
-
columnNumber: 5
|
|
1780
|
-
}, this);
|
|
1155
|
+
});
|
|
1781
1156
|
}
|
|
1782
1157
|
function ComponentBlock({ m, el, ctx, set }) {
|
|
1783
1158
|
const { useComponentInfo } = useKitServices();
|
|
@@ -1789,106 +1164,58 @@ function ComponentBlock({ m, el, ctx, set }) {
|
|
|
1789
1164
|
return {};
|
|
1790
1165
|
}
|
|
1791
1166
|
}, [m.overrides]);
|
|
1792
|
-
if (useComponentInfo) return /* @__PURE__ */
|
|
1167
|
+
if (useComponentInfo) return /* @__PURE__ */ jsx(ComponentCard, {
|
|
1793
1168
|
m,
|
|
1794
1169
|
el,
|
|
1795
1170
|
ctx,
|
|
1796
1171
|
use: useComponentInfo,
|
|
1797
1172
|
overrides,
|
|
1798
1173
|
set
|
|
1799
|
-
}
|
|
1800
|
-
fileName: _jsxFileName,
|
|
1801
|
-
lineNumber: 945,
|
|
1802
|
-
columnNumber: 32
|
|
1803
|
-
}, this);
|
|
1174
|
+
});
|
|
1804
1175
|
const count = Object.keys(overrides).length;
|
|
1805
1176
|
const name = m.name || "Block";
|
|
1806
|
-
return /* @__PURE__ */
|
|
1177
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1807
1178
|
role: "group",
|
|
1808
1179
|
"aria-label": `${name}, ${m.detached ? "separate copy" : "linked block"}`,
|
|
1809
1180
|
className: "group/blk flex items-center gap-3 rounded-kit-lg border border-kit-line bg-kit-surface px-3 py-2.5",
|
|
1810
1181
|
"data-rt-isolate": "",
|
|
1811
1182
|
children: [
|
|
1812
|
-
/* @__PURE__ */
|
|
1183
|
+
/* @__PURE__ */ jsx("span", {
|
|
1813
1184
|
className: "flex size-9 shrink-0 items-center justify-center rounded-kit-md bg-kit-muted text-kit-fg-2",
|
|
1814
|
-
children: /* @__PURE__ */
|
|
1185
|
+
children: /* @__PURE__ */ jsx(IconComponents, {
|
|
1815
1186
|
className: "size-[18px]",
|
|
1816
1187
|
stroke: 1.5,
|
|
1817
1188
|
"aria-hidden": true
|
|
1818
|
-
}
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
columnNumber: 9
|
|
1822
|
-
}, this)
|
|
1823
|
-
}, void 0, false, {
|
|
1824
|
-
fileName: _jsxFileName,
|
|
1825
|
-
lineNumber: 955,
|
|
1826
|
-
columnNumber: 7
|
|
1827
|
-
}, this),
|
|
1828
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
1189
|
+
})
|
|
1190
|
+
}),
|
|
1191
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1829
1192
|
className: "min-w-0 flex-1",
|
|
1830
|
-
children: [/* @__PURE__ */
|
|
1193
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1831
1194
|
className: "truncate text-kit-sm font-medium text-kit-fg",
|
|
1832
1195
|
children: name
|
|
1833
|
-
},
|
|
1834
|
-
fileName: _jsxFileName,
|
|
1835
|
-
lineNumber: 959,
|
|
1836
|
-
columnNumber: 9
|
|
1837
|
-
}, this), /* @__PURE__ */ jsxDEV("div", {
|
|
1196
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
1838
1197
|
className: "truncate text-kit-xs text-kit-fg-3",
|
|
1839
|
-
children: m.detached ? "Separate copy · edits to the block don't reach it" : /* @__PURE__ */
|
|
1198
|
+
children: m.detached ? "Separate copy · edits to the block don't reach it" : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1840
1199
|
m.ref ? "Linked block" : "Block with no source",
|
|
1841
1200
|
count ? ` · ${count} ${count === 1 ? "override" : "overrides"}` : "",
|
|
1842
1201
|
" · edits to the component show here too"
|
|
1843
|
-
] }
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
}, this)
|
|
1848
|
-
}, void 0, false, {
|
|
1849
|
-
fileName: _jsxFileName,
|
|
1850
|
-
lineNumber: 960,
|
|
1851
|
-
columnNumber: 9
|
|
1852
|
-
}, this)]
|
|
1853
|
-
}, void 0, true, {
|
|
1854
|
-
fileName: _jsxFileName,
|
|
1855
|
-
lineNumber: 958,
|
|
1856
|
-
columnNumber: 7
|
|
1857
|
-
}, this),
|
|
1858
|
-
ctx.readOnly ? null : /* @__PURE__ */ jsxDEV("div", {
|
|
1202
|
+
] })
|
|
1203
|
+
})]
|
|
1204
|
+
}),
|
|
1205
|
+
ctx.readOnly ? null : /* @__PURE__ */ jsxs("div", {
|
|
1859
1206
|
className: "flex items-center gap-0.5 opacity-0 transition-opacity motion-reduce:transition-none group-hover/blk:opacity-100 group-focus-within/blk:opacity-100 pointer-coarse:opacity-100",
|
|
1860
|
-
children: [ctx.duplicate ? /* @__PURE__ */
|
|
1207
|
+
children: [ctx.duplicate ? /* @__PURE__ */ jsx(IconButton, {
|
|
1861
1208
|
size: "xs",
|
|
1862
1209
|
label: `Duplicate ${name}`,
|
|
1863
1210
|
onClick: () => ctx.duplicate?.(el),
|
|
1864
|
-
children: /* @__PURE__ */
|
|
1865
|
-
|
|
1866
|
-
lineNumber: 975,
|
|
1867
|
-
columnNumber: 15
|
|
1868
|
-
}, this)
|
|
1869
|
-
}, void 0, false, {
|
|
1870
|
-
fileName: _jsxFileName,
|
|
1871
|
-
lineNumber: 974,
|
|
1872
|
-
columnNumber: 13
|
|
1873
|
-
}, this) : null, /* @__PURE__ */ jsxDEV(RemoveBtn, {
|
|
1211
|
+
children: /* @__PURE__ */ jsx(IconCopy, { stroke: 1.5 })
|
|
1212
|
+
}) : null, /* @__PURE__ */ jsx(RemoveBtn, {
|
|
1874
1213
|
onClick: () => ctx.remove(el),
|
|
1875
1214
|
label: `Remove ${name}`
|
|
1876
|
-
}
|
|
1877
|
-
|
|
1878
|
-
lineNumber: 978,
|
|
1879
|
-
columnNumber: 11
|
|
1880
|
-
}, this)]
|
|
1881
|
-
}, void 0, true, {
|
|
1882
|
-
fileName: _jsxFileName,
|
|
1883
|
-
lineNumber: 972,
|
|
1884
|
-
columnNumber: 9
|
|
1885
|
-
}, this)
|
|
1215
|
+
})]
|
|
1216
|
+
})
|
|
1886
1217
|
]
|
|
1887
|
-
}
|
|
1888
|
-
fileName: _jsxFileName,
|
|
1889
|
-
lineNumber: 949,
|
|
1890
|
-
columnNumber: 5
|
|
1891
|
-
}, this);
|
|
1218
|
+
});
|
|
1892
1219
|
}
|
|
1893
1220
|
/**
|
|
1894
1221
|
* What production's rich-text table keeps: typed columns (V2's Text, Number, Price, Yes / No, Link and Rating with their unit,
|
|
@@ -1915,33 +1242,21 @@ var STORED_TABLE = {
|
|
|
1915
1242
|
]
|
|
1916
1243
|
};
|
|
1917
1244
|
function TableBlock({ m, set, el, ctx }) {
|
|
1918
|
-
return /* @__PURE__ */
|
|
1245
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1919
1246
|
className: "group/blk",
|
|
1920
1247
|
"data-rt-isolate": "",
|
|
1921
|
-
children: /* @__PURE__ */
|
|
1248
|
+
children: /* @__PURE__ */ jsx(TableEditor, {
|
|
1922
1249
|
value: m,
|
|
1923
1250
|
onChange: (next) => set(() => next, "Edit table"),
|
|
1924
1251
|
readOnly: ctx.readOnly,
|
|
1925
1252
|
options: STORED_TABLE,
|
|
1926
1253
|
label: "Table",
|
|
1927
|
-
actions: ctx.readOnly ? null : /* @__PURE__ */
|
|
1254
|
+
actions: ctx.readOnly ? null : /* @__PURE__ */ jsx(RemoveBtn, {
|
|
1928
1255
|
onClick: () => ctx.remove(el),
|
|
1929
1256
|
label: "Remove table"
|
|
1930
|
-
}
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
columnNumber: 40
|
|
1934
|
-
}, this)
|
|
1935
|
-
}, void 0, false, {
|
|
1936
|
-
fileName: _jsxFileName,
|
|
1937
|
-
lineNumber: 1013,
|
|
1938
|
-
columnNumber: 7
|
|
1939
|
-
}, this)
|
|
1940
|
-
}, void 0, false, {
|
|
1941
|
-
fileName: _jsxFileName,
|
|
1942
|
-
lineNumber: 1012,
|
|
1943
|
-
columnNumber: 5
|
|
1944
|
-
}, this);
|
|
1257
|
+
})
|
|
1258
|
+
})
|
|
1259
|
+
});
|
|
1945
1260
|
}
|
|
1946
1261
|
var PULL_QUOTE_LABEL = "Pull quote";
|
|
1947
1262
|
/** V2 article.ts ARTICLE_SCHEMAS.pullquote: the properties panel is built from it. */
|
|
@@ -2003,7 +1318,7 @@ function PullQuoteBlock({ m, set, el, ctx, autoFocus }) {
|
|
|
2003
1318
|
const field = Object.keys(next).find((k) => next[k] !== prev[k]) ?? "";
|
|
2004
1319
|
set(() => next, `Edit ${label.toLowerCase()} ${field}`);
|
|
2005
1320
|
};
|
|
2006
|
-
return /* @__PURE__ */
|
|
1321
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(ArticleCard, {
|
|
2007
1322
|
ref: cardRef,
|
|
2008
1323
|
label,
|
|
2009
1324
|
kind: "pullquote",
|
|
@@ -2020,26 +1335,14 @@ function PullQuoteBlock({ m, set, el, ctx, autoFocus }) {
|
|
|
2020
1335
|
onClose: close,
|
|
2021
1336
|
focusCard
|
|
2022
1337
|
}),
|
|
2023
|
-
children: [/* @__PURE__ */
|
|
2024
|
-
fileName: _jsxFileName,
|
|
2025
|
-
lineNumber: 1074,
|
|
2026
|
-
columnNumber: 9
|
|
2027
|
-
}, this), /* @__PURE__ */ jsxDEV(ArticleActions, {
|
|
1338
|
+
children: [/* @__PURE__ */ jsx(PullQuotePreview, { m }), /* @__PURE__ */ jsx(ArticleActions, {
|
|
2028
1339
|
label,
|
|
2029
1340
|
ctx,
|
|
2030
1341
|
el,
|
|
2031
1342
|
editing,
|
|
2032
1343
|
onEdit: () => editing ? close() : openPanel()
|
|
2033
|
-
}
|
|
2034
|
-
|
|
2035
|
-
lineNumber: 1075,
|
|
2036
|
-
columnNumber: 9
|
|
2037
|
-
}, this)]
|
|
2038
|
-
}, void 0, true, {
|
|
2039
|
-
fileName: _jsxFileName,
|
|
2040
|
-
lineNumber: 1065,
|
|
2041
|
-
columnNumber: 7
|
|
2042
|
-
}, this), editing ? /* @__PURE__ */ jsxDEV(ArticlePanel, {
|
|
1344
|
+
})]
|
|
1345
|
+
}), editing ? /* @__PURE__ */ jsx(ArticlePanel, {
|
|
2043
1346
|
label,
|
|
2044
1347
|
anchor: cardEl,
|
|
2045
1348
|
nonce: open.nonce,
|
|
@@ -2048,26 +1351,14 @@ function PullQuoteBlock({ m, set, el, ctx, autoFocus }) {
|
|
|
2048
1351
|
focusBack: focusCard,
|
|
2049
1352
|
ctx,
|
|
2050
1353
|
el,
|
|
2051
|
-
children: /* @__PURE__ */
|
|
1354
|
+
children: /* @__PURE__ */ jsx(ArticleForm, {
|
|
2052
1355
|
schema: PULL_QUOTE_SCHEMA,
|
|
2053
1356
|
label,
|
|
2054
1357
|
value: m,
|
|
2055
1358
|
onChange: (v) => commit(v),
|
|
2056
1359
|
ro
|
|
2057
|
-
}
|
|
2058
|
-
|
|
2059
|
-
lineNumber: 1079,
|
|
2060
|
-
columnNumber: 11
|
|
2061
|
-
}, this)
|
|
2062
|
-
}, void 0, false, {
|
|
2063
|
-
fileName: _jsxFileName,
|
|
2064
|
-
lineNumber: 1078,
|
|
2065
|
-
columnNumber: 9
|
|
2066
|
-
}, this) : null] }, void 0, true, {
|
|
2067
|
-
fileName: _jsxFileName,
|
|
2068
|
-
lineNumber: 1064,
|
|
2069
|
-
columnNumber: 5
|
|
2070
|
-
}, this);
|
|
1360
|
+
})
|
|
1361
|
+
}) : null] });
|
|
2071
1362
|
}
|
|
2072
1363
|
var TAKEAWAYS_LABEL = "Key takeaways";
|
|
2073
1364
|
/** V2 article.ts ARTICLE_SCHEMAS.takeaways `points` max (the stored block's limit, key_takeaways_limit_exceeded) */
|
|
@@ -2095,16 +1386,16 @@ function TakeawaysBlock({ m, set, el, ctx, autoFocus }) {
|
|
|
2095
1386
|
ro,
|
|
2096
1387
|
focusCard
|
|
2097
1388
|
});
|
|
2098
|
-
return /* @__PURE__ */
|
|
1389
|
+
return /* @__PURE__ */ jsxs(ArticleCard, {
|
|
2099
1390
|
ref: card,
|
|
2100
1391
|
label,
|
|
2101
1392
|
kind: "takeaways",
|
|
2102
1393
|
ro,
|
|
2103
1394
|
onKeyDown,
|
|
2104
|
-
children: [/* @__PURE__ */
|
|
1395
|
+
children: [/* @__PURE__ */ jsxs("aside", {
|
|
2105
1396
|
className: "rounded-kit-lg border border-kit-line bg-kit-subtle px-4 py-3",
|
|
2106
1397
|
"aria-label": m.title || label,
|
|
2107
|
-
children: [/* @__PURE__ */
|
|
1398
|
+
children: [/* @__PURE__ */ jsx(PlainEditable, {
|
|
2108
1399
|
label: "Key takeaways title",
|
|
2109
1400
|
value: m.title,
|
|
2110
1401
|
placeholder: "Key takeaways",
|
|
@@ -2115,23 +1406,15 @@ function TakeawaysBlock({ m, set, el, ctx, autoFocus }) {
|
|
|
2115
1406
|
},
|
|
2116
1407
|
onEnter: () => focusPoint(0, false),
|
|
2117
1408
|
className: "text-kit-sm font-semibold text-kit-fg"
|
|
2118
|
-
},
|
|
2119
|
-
fileName: _jsxFileName,
|
|
2120
|
-
lineNumber: 1114,
|
|
2121
|
-
columnNumber: 9
|
|
2122
|
-
}, this), /* @__PURE__ */ jsxDEV("ul", {
|
|
1409
|
+
}), /* @__PURE__ */ jsx("ul", {
|
|
2123
1410
|
ref: box,
|
|
2124
1411
|
className: "m-0 mt-1.5 flex flex-col gap-1 p-0",
|
|
2125
|
-
children: m.points.map((p, i) => /* @__PURE__ */
|
|
1412
|
+
children: m.points.map((p, i) => /* @__PURE__ */ jsxs("li", {
|
|
2126
1413
|
className: "flex list-none items-baseline gap-2 text-[15px] leading-relaxed text-kit-fg",
|
|
2127
|
-
children: [/* @__PURE__ */
|
|
1414
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
2128
1415
|
"aria-hidden": true,
|
|
2129
1416
|
className: "mt-[0.55em] size-1.5 shrink-0 self-start rounded-full bg-kit-accent"
|
|
2130
|
-
},
|
|
2131
|
-
fileName: _jsxFileName,
|
|
2132
|
-
lineNumber: 1131,
|
|
2133
|
-
columnNumber: 15
|
|
2134
|
-
}, this), /* @__PURE__ */ jsxDEV(PlainEditable, {
|
|
1417
|
+
}), /* @__PURE__ */ jsx(PlainEditable, {
|
|
2135
1418
|
label: `Point ${i + 1}`,
|
|
2136
1419
|
value: p,
|
|
2137
1420
|
placeholder: i === 0 ? "The first thing to remember" : "Another point",
|
|
@@ -2161,103 +1444,51 @@ function TakeawaysBlock({ m, set, el, ctx, autoFocus }) {
|
|
|
2161
1444
|
focusPoint(Math.max(0, i - 1));
|
|
2162
1445
|
} : void 0,
|
|
2163
1446
|
className: "flex-1"
|
|
2164
|
-
}
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
}, this)]
|
|
2169
|
-
}, i, true, {
|
|
2170
|
-
fileName: _jsxFileName,
|
|
2171
|
-
lineNumber: 1130,
|
|
2172
|
-
columnNumber: 13
|
|
2173
|
-
}, this))
|
|
2174
|
-
}, void 0, false, {
|
|
2175
|
-
fileName: _jsxFileName,
|
|
2176
|
-
lineNumber: 1128,
|
|
2177
|
-
columnNumber: 9
|
|
2178
|
-
}, this)]
|
|
2179
|
-
}, void 0, true, {
|
|
2180
|
-
fileName: _jsxFileName,
|
|
2181
|
-
lineNumber: 1113,
|
|
2182
|
-
columnNumber: 7
|
|
2183
|
-
}, this), /* @__PURE__ */ jsxDEV(ArticleActions, {
|
|
1447
|
+
})]
|
|
1448
|
+
}, i))
|
|
1449
|
+
})]
|
|
1450
|
+
}), /* @__PURE__ */ jsx(ArticleActions, {
|
|
2184
1451
|
label,
|
|
2185
1452
|
ctx,
|
|
2186
1453
|
el
|
|
2187
|
-
}
|
|
2188
|
-
|
|
2189
|
-
lineNumber: 1161,
|
|
2190
|
-
columnNumber: 7
|
|
2191
|
-
}, this)]
|
|
2192
|
-
}, void 0, true, {
|
|
2193
|
-
fileName: _jsxFileName,
|
|
2194
|
-
lineNumber: 1112,
|
|
2195
|
-
columnNumber: 5
|
|
2196
|
-
}, this);
|
|
1454
|
+
})]
|
|
1455
|
+
});
|
|
2197
1456
|
}
|
|
2198
1457
|
function PullQuotePreview({ m }) {
|
|
2199
|
-
return /* @__PURE__ */
|
|
1458
|
+
return /* @__PURE__ */ jsxs("figure", {
|
|
2200
1459
|
className: "m-0 py-2 pl-5 pr-10",
|
|
2201
1460
|
children: [
|
|
2202
|
-
/* @__PURE__ */
|
|
1461
|
+
/* @__PURE__ */ jsx(IconQuote, {
|
|
2203
1462
|
className: "mb-1 size-6 text-kit-accent-fg",
|
|
2204
1463
|
stroke: 1.5,
|
|
2205
1464
|
"aria-hidden": true
|
|
2206
|
-
},
|
|
2207
|
-
|
|
2208
|
-
lineNumber: 1170,
|
|
2209
|
-
columnNumber: 7
|
|
2210
|
-
}, this),
|
|
2211
|
-
/* @__PURE__ */ jsxDEV("blockquote", {
|
|
1465
|
+
}),
|
|
1466
|
+
/* @__PURE__ */ jsx("blockquote", {
|
|
2212
1467
|
"data-field": "quote",
|
|
2213
1468
|
className: cn("m-0 text-[22px] font-medium leading-snug tracking-[-0.01em]", m.quote ? "text-kit-fg" : "text-kit-fg-4"),
|
|
2214
1469
|
children: m.quote || "Write the quote"
|
|
2215
|
-
},
|
|
2216
|
-
|
|
2217
|
-
lineNumber: 1171,
|
|
2218
|
-
columnNumber: 7
|
|
2219
|
-
}, this),
|
|
2220
|
-
m.name || m.role ? /* @__PURE__ */ jsxDEV("figcaption", {
|
|
1470
|
+
}),
|
|
1471
|
+
m.name || m.role ? /* @__PURE__ */ jsxs("figcaption", {
|
|
2221
1472
|
className: "mt-3 text-kit-sm text-kit-fg-2",
|
|
2222
1473
|
children: [
|
|
2223
|
-
m.name ? /* @__PURE__ */
|
|
1474
|
+
m.name ? /* @__PURE__ */ jsx("span", {
|
|
2224
1475
|
"data-field": "name",
|
|
2225
1476
|
className: cn("font-medium text-kit-fg", m.link && "underline decoration-kit-line-strong underline-offset-2"),
|
|
2226
1477
|
children: m.name
|
|
2227
|
-
}
|
|
2228
|
-
fileName: _jsxFileName,
|
|
2229
|
-
lineNumber: 1177,
|
|
2230
|
-
columnNumber: 13
|
|
2231
|
-
}, this) : null,
|
|
1478
|
+
}) : null,
|
|
2232
1479
|
m.name && m.role ? ", " : null,
|
|
2233
|
-
m.role ? /* @__PURE__ */
|
|
1480
|
+
m.role ? /* @__PURE__ */ jsx("span", {
|
|
2234
1481
|
"data-field": "role",
|
|
2235
1482
|
children: m.role
|
|
2236
|
-
}
|
|
2237
|
-
fileName: _jsxFileName,
|
|
2238
|
-
lineNumber: 1182,
|
|
2239
|
-
columnNumber: 21
|
|
2240
|
-
}, this) : null
|
|
1483
|
+
}) : null
|
|
2241
1484
|
]
|
|
2242
|
-
}
|
|
2243
|
-
fileName: _jsxFileName,
|
|
2244
|
-
lineNumber: 1175,
|
|
2245
|
-
columnNumber: 9
|
|
2246
|
-
}, this) : /* @__PURE__ */ jsxDEV("figcaption", {
|
|
1485
|
+
}) : /* @__PURE__ */ jsx("figcaption", {
|
|
2247
1486
|
"data-field": "name",
|
|
2248
1487
|
className: "mt-3 text-kit-sm text-kit-fg-4",
|
|
2249
1488
|
children: "Who said it"
|
|
2250
|
-
}
|
|
2251
|
-
fileName: _jsxFileName,
|
|
2252
|
-
lineNumber: 1185,
|
|
2253
|
-
columnNumber: 9
|
|
2254
|
-
}, this)
|
|
1489
|
+
})
|
|
2255
1490
|
]
|
|
2256
|
-
}
|
|
2257
|
-
fileName: _jsxFileName,
|
|
2258
|
-
lineNumber: 1169,
|
|
2259
|
-
columnNumber: 5
|
|
2260
|
-
}, this);
|
|
1491
|
+
});
|
|
2261
1492
|
}
|
|
2262
1493
|
//#endregion
|
|
2263
1494
|
export { Island };
|