@meowdown/react 0.84.0 → 0.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +705 -325
- package/dist/style.css +15 -115
- package/package.json +3 -4
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c } from "react/compiler-runtime";
|
|
2
2
|
import { clsx } from "clsx/lite";
|
|
3
3
|
import { Fragment, ViewTransition, cloneElement, createContext, createElement, memo, startTransition, use, useDeferredValue, useEffect, useId, useImperativeHandle, useLayoutEffect, useReducer, useRef, useState } from "react";
|
|
4
|
-
import { buildFileMarkdown, codeBlockLanguages, collectReferenceDefinitions, defaultResolveImageUrl, defaultResolveXPost, defaultResolveYouTubeVideo, defineCodeBlockPreviewPlugin, defineEditorExtension, defineLinkEditKeymap, defineLinkHoverHandler, definePendingReplacementHandler, defineSearchStatusHandler, defineVirtualCaret, defineWikilinkHoverHandler, dismissLinkHover, docToMarkdown, docToParagraphMarkdown, formatFileSize, getCodeTokens, getFileKind, getLinkText, getMarkBuilders, getPendingReplacement, getSearchStatus, getSelectedText, getTableColumnAlign, getTextblockDisplayText, getVirtualElementFromRange, inlineTextToMarkChunksWithContext, isCodeBlockPreviewHiddenDecoration, isLinkTextForHref, isModEvent, isNodeOfType, isReferenceDefinitionNode, isSelectionInTableCell, loadKaTeX, markdownToDoc, normalizeHref, paragraphMarkdownToDoc, parsePostEmbedSnapshot, renderMathInto, updateEditorConfig } from "@meowdown/core";
|
|
4
|
+
import { buildFileMarkdown, codeBlockLanguages, collectReferenceDefinitions, convertEmbedToLink, defaultResolveImageUrl, defaultResolveXPost, defaultResolveYouTubeVideo, defineCodeBlockPreviewPlugin, defineEditorExtension, defineEmbedMenuHandler, defineLinkEditKeymap, defineLinkHoverHandler, definePendingReplacementHandler, defineSearchStatusHandler, defineVirtualCaret, defineWikilinkHoverHandler, deleteBlock, deleteEmbed, dismissLinkHover, docToMarkdown, docToParagraphMarkdown, formatFileSize, getCodeTokens, getFileKind, getLinkText, getMarkBuilders, getPendingReplacement, getSearchStatus, getSelectedText, getTableColumnAlign, getTextblockDisplayText, getVirtualElementFromRange, inlineTextToMarkChunksWithContext, isCodeBlockPreviewHiddenDecoration, isLinkTextForHref, isModEvent, isNodeOfType, isReferenceDefinitionNode, isSelectionInTableCell, loadKaTeX, markdownToDoc, normalizeHref, paragraphMarkdownToDoc, parsePostEmbedSnapshot, renderMathInto, updateEditorConfig } from "@meowdown/core";
|
|
5
5
|
import { clamp } from "@ocavue/utils";
|
|
6
6
|
import { canUseRegexLookbehind, createEditor, defineDocChangeHandler, defineKeymap, defineUpdateHandler, isApple, isTextSelection, union } from "@prosekit/core";
|
|
7
7
|
import { Selection, TextSelection } from "@prosekit/pm/state";
|
|
@@ -9,12 +9,11 @@ import { ProseKit, defineReactNodeView, useEditor, useEditor as useEditor$1, use
|
|
|
9
9
|
import GithubSlugger from "github-slugger";
|
|
10
10
|
import { Combobox } from "@base-ui/react/combobox";
|
|
11
11
|
import { Menu } from "@base-ui/react/menu";
|
|
12
|
-
import { BracesIcon, CheckIcon, ChevronsUpDownIcon, CopyIcon, EllipsisIcon, Globe2Icon, GripHorizontalIcon, GripVerticalIcon, PencilIcon, SparklesIcon, UnlinkIcon } from "lucide-react";
|
|
13
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
14
13
|
import { BlockHandleDraggable, BlockHandlePopup, BlockHandlePositioner, BlockHandleRoot } from "@prosekit/react/block-handle";
|
|
15
14
|
import { DropIndicator } from "@prosekit/react/drop-indicator";
|
|
16
|
-
import { Popover } from "@base-ui/react/popover";
|
|
17
15
|
import { queueExtension } from "@prosekit/web";
|
|
16
|
+
import { Popover } from "@base-ui/react/popover";
|
|
18
17
|
import { AutocompleteEmpty, AutocompleteItem, AutocompletePopup, AutocompletePositioner, AutocompleteRoot } from "@prosekit/react/autocomplete";
|
|
19
18
|
import { MenuItem, MenuPopup, MenuPositioner } from "@prosekit/react/menu";
|
|
20
19
|
import { TableHandleColumnMenuRoot, TableHandleColumnMenuTrigger, TableHandleColumnPopup, TableHandleColumnPositioner, TableHandleDragPreview, TableHandleDropIndicator, TableHandleRoot, TableHandleRowMenuRoot, TableHandleRowMenuTrigger, TableHandleRowPopup, TableHandleRowPositioner } from "@prosekit/react/table-handle";
|
|
@@ -25,6 +24,56 @@ import { Mark } from "@prosekit/pm/model";
|
|
|
25
24
|
import { BOOLEAN, OVERLOADED_BOOLEAN, getPropertyInfo, possibleStandardNames } from "react-property";
|
|
26
25
|
import { PreviewCard } from "@base-ui/react/preview-card";
|
|
27
26
|
|
|
27
|
+
// \0rolldown/runtime.js
|
|
28
|
+
var __defProp = Object.defineProperty;
|
|
29
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
30
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
31
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
32
|
+
var __exportAll = (all, no_symbols) => {
|
|
33
|
+
let target = {};
|
|
34
|
+
for (var name in all) {
|
|
35
|
+
__defProp(target, name, {
|
|
36
|
+
get: all[name],
|
|
37
|
+
enumerable: true
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
if (!no_symbols) {
|
|
41
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
42
|
+
}
|
|
43
|
+
return target;
|
|
44
|
+
};
|
|
45
|
+
var __copyProps = (to, from, except, desc) => {
|
|
46
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
47
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
48
|
+
key = keys[i];
|
|
49
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
50
|
+
__defProp(to, key, {
|
|
51
|
+
get: ((k) => from[k]).bind(null, key),
|
|
52
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return to;
|
|
58
|
+
};
|
|
59
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
60
|
+
|
|
61
|
+
// src/class-names.ts
|
|
62
|
+
var class_names_exports = /* @__PURE__ */ __exportAll({
|
|
63
|
+
LIGHTBOX_DIALOG_TRANSITION_CLASS: () => LIGHTBOX_DIALOG_TRANSITION_CLASS,
|
|
64
|
+
ROOT_CLASS: () => ROOT_CLASS
|
|
65
|
+
});
|
|
66
|
+
import * as import__meowdown_core_internal_class_names from "@meowdown/core/internal/class-names";
|
|
67
|
+
__reExport(class_names_exports, import__meowdown_core_internal_class_names);
|
|
68
|
+
/**
|
|
69
|
+
* The outer wrapper of the editor.
|
|
70
|
+
*/
|
|
71
|
+
const ROOT_CLASS = "meowdown";
|
|
72
|
+
/**
|
|
73
|
+
* The view transition class of the lightbox dialog.
|
|
74
|
+
*/
|
|
75
|
+
const LIGHTBOX_DIALOG_TRANSITION_CLASS = "meowdown-lightbox-dialog";
|
|
76
|
+
|
|
28
77
|
// src/extensions/block-menu.ts
|
|
29
78
|
const caretMenuOpeners = /* @__PURE__ */ new WeakMap();
|
|
30
79
|
/**
|
|
@@ -146,6 +195,119 @@ async function writeClipboardText(text) {
|
|
|
146
195
|
}
|
|
147
196
|
}
|
|
148
197
|
|
|
198
|
+
// src/components/collision-boundary.ts
|
|
199
|
+
/**
|
|
200
|
+
* See `EditorProps.collisionBoundary`.
|
|
201
|
+
*/
|
|
202
|
+
const CollisionBoundaryContext = createContext(void 0);
|
|
203
|
+
/**
|
|
204
|
+
* Converts a {@link CollisionBoundary} to the `boundary` prop of ProseKit
|
|
205
|
+
* positioners, which spell the keyword the floating-ui way.
|
|
206
|
+
*/
|
|
207
|
+
function toFloatingBoundary(boundary) {
|
|
208
|
+
return boundary === "clipping-ancestors" ? "clippingAncestors" : boundary;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// src/components/icon.tsx
|
|
212
|
+
/**
|
|
213
|
+
* A decorative Lucide icon, drawn in `currentColor` by the core stylesheet.
|
|
214
|
+
*/
|
|
215
|
+
function Icon(t0) {
|
|
216
|
+
const $ = c(4);
|
|
217
|
+
const { name } = t0;
|
|
218
|
+
let t1;
|
|
219
|
+
if ($[0] !== name) {
|
|
220
|
+
t1 = (0, class_names_exports.getIconClass)(name);
|
|
221
|
+
$[0] = name;
|
|
222
|
+
$[1] = t1;
|
|
223
|
+
} else t1 = $[1];
|
|
224
|
+
const t2 = `${class_names_exports.ICON_CLASS} ${t1}`;
|
|
225
|
+
let t3;
|
|
226
|
+
if ($[2] !== t2) {
|
|
227
|
+
t3 = /* @__PURE__ */ jsx("span", {
|
|
228
|
+
className: t2,
|
|
229
|
+
"aria-hidden": "true"
|
|
230
|
+
});
|
|
231
|
+
$[2] = t2;
|
|
232
|
+
$[3] = t3;
|
|
233
|
+
} else t3 = $[3];
|
|
234
|
+
return t3;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// src/components/action-menu.tsx
|
|
238
|
+
/**
|
|
239
|
+
* The popup of an action menu, such as the code block menu or the embed
|
|
240
|
+
* menu, placed below its trigger or `anchor`.
|
|
241
|
+
*/
|
|
242
|
+
function ActionMenuPopup(t0) {
|
|
243
|
+
const $ = c(8);
|
|
244
|
+
const { anchor, finalFocus, testId, children } = t0;
|
|
245
|
+
const collisionBoundary = use(CollisionBoundaryContext);
|
|
246
|
+
let t1;
|
|
247
|
+
if ($[0] !== children || $[1] !== finalFocus || $[2] !== testId) {
|
|
248
|
+
t1 = /* @__PURE__ */ jsx(Menu.Popup, {
|
|
249
|
+
className: class_names_exports.MENU_POPUP_CLASS,
|
|
250
|
+
finalFocus,
|
|
251
|
+
"data-testid": testId,
|
|
252
|
+
children
|
|
253
|
+
});
|
|
254
|
+
$[0] = children;
|
|
255
|
+
$[1] = finalFocus;
|
|
256
|
+
$[2] = testId;
|
|
257
|
+
$[3] = t1;
|
|
258
|
+
} else t1 = $[3];
|
|
259
|
+
let t2;
|
|
260
|
+
if ($[4] !== anchor || $[5] !== collisionBoundary || $[6] !== t1) {
|
|
261
|
+
t2 = /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
|
|
262
|
+
anchor,
|
|
263
|
+
className: class_names_exports.MENU_POSITIONER_CLASS,
|
|
264
|
+
sideOffset: 4,
|
|
265
|
+
align: "start",
|
|
266
|
+
collisionBoundary,
|
|
267
|
+
children: t1
|
|
268
|
+
}) });
|
|
269
|
+
$[4] = anchor;
|
|
270
|
+
$[5] = collisionBoundary;
|
|
271
|
+
$[6] = t1;
|
|
272
|
+
$[7] = t2;
|
|
273
|
+
} else t2 = $[7];
|
|
274
|
+
return t2;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* A row of an action menu: an icon and a label.
|
|
278
|
+
*/
|
|
279
|
+
function ActionMenuItem(t0) {
|
|
280
|
+
const $ = c(9);
|
|
281
|
+
const { icon, label, onClick, testId } = t0;
|
|
282
|
+
let t1;
|
|
283
|
+
if ($[0] !== icon) {
|
|
284
|
+
t1 = /* @__PURE__ */ jsx(Icon, { name: icon });
|
|
285
|
+
$[0] = icon;
|
|
286
|
+
$[1] = t1;
|
|
287
|
+
} else t1 = $[1];
|
|
288
|
+
let t2;
|
|
289
|
+
if ($[2] !== label) {
|
|
290
|
+
t2 = /* @__PURE__ */ jsx("span", { children: label });
|
|
291
|
+
$[2] = label;
|
|
292
|
+
$[3] = t2;
|
|
293
|
+
} else t2 = $[3];
|
|
294
|
+
let t3;
|
|
295
|
+
if ($[4] !== onClick || $[5] !== t1 || $[6] !== t2 || $[7] !== testId) {
|
|
296
|
+
t3 = /* @__PURE__ */ jsxs(Menu.Item, {
|
|
297
|
+
className: class_names_exports.MENU_ITEM_CLASS,
|
|
298
|
+
onClick,
|
|
299
|
+
"data-testid": testId,
|
|
300
|
+
children: [t1, t2]
|
|
301
|
+
});
|
|
302
|
+
$[4] = onClick;
|
|
303
|
+
$[5] = t1;
|
|
304
|
+
$[6] = t2;
|
|
305
|
+
$[7] = testId;
|
|
306
|
+
$[8] = t3;
|
|
307
|
+
} else t3 = $[8];
|
|
308
|
+
return t3;
|
|
309
|
+
}
|
|
310
|
+
|
|
149
311
|
// src/components/code-block-toolbar-state.ts
|
|
150
312
|
const CODE_BLOCK_TOOLBAR_IDLE = {
|
|
151
313
|
open: void 0,
|
|
@@ -193,16 +355,12 @@ function getCodeBlockToolbarFinalFocus(state) {
|
|
|
193
355
|
// src/components/code-block-view.module.css
|
|
194
356
|
var code_block_view_module_default = {
|
|
195
357
|
"Empty": "meow_Empty_D3j_9q",
|
|
196
|
-
"IconButton": "meow_IconButton_D3j_9q",
|
|
197
358
|
"Item": "meow_Item_D3j_9q",
|
|
198
359
|
"ItemIndicator": "meow_ItemIndicator_D3j_9q",
|
|
199
360
|
"ItemText": "meow_ItemText_D3j_9q",
|
|
200
361
|
"List": "meow_List_D3j_9q",
|
|
201
|
-
"Menu": "meow_Menu_D3j_9q",
|
|
202
|
-
"MenuItem": "meow_MenuItem_D3j_9q",
|
|
203
362
|
"MermaidPreview": "meow_MermaidPreview_D3j_9q",
|
|
204
363
|
"Popup": "meow_Popup_D3j_9q",
|
|
205
|
-
"Positioner": "meow_Positioner_D3j_9q",
|
|
206
364
|
"Preview": "meow_Preview_D3j_9q",
|
|
207
365
|
"Root": "meow_Root_D3j_9q",
|
|
208
366
|
"Search": "meow_Search_D3j_9q",
|
|
@@ -212,19 +370,6 @@ var code_block_view_module_default = {
|
|
|
212
370
|
"TriggerIcon": "meow_TriggerIcon_D3j_9q"
|
|
213
371
|
};
|
|
214
372
|
|
|
215
|
-
// src/components/collision-boundary.ts
|
|
216
|
-
/**
|
|
217
|
-
* See `EditorProps.collisionBoundary`.
|
|
218
|
-
*/
|
|
219
|
-
const CollisionBoundaryContext = createContext(void 0);
|
|
220
|
-
/**
|
|
221
|
-
* Converts a {@link CollisionBoundary} to the `boundary` prop of ProseKit
|
|
222
|
-
* positioners, which spell the keyword the floating-ui way.
|
|
223
|
-
*/
|
|
224
|
-
function toFloatingBoundary(boundary) {
|
|
225
|
-
return boundary === "clipping-ancestors" ? "clippingAncestors" : boundary;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
373
|
// src/components/copy-button.tsx
|
|
229
374
|
const COPIED_RESET_MS = 1500;
|
|
230
375
|
/**
|
|
@@ -274,7 +419,7 @@ function CopyButton(t0) {
|
|
|
274
419
|
const t4 = copied ? "Copied" : label;
|
|
275
420
|
let t5;
|
|
276
421
|
if ($[9] !== copied) {
|
|
277
|
-
t5 = copied ? /* @__PURE__ */ jsx(
|
|
422
|
+
t5 = copied ? /* @__PURE__ */ jsx(Icon, { name: "check" }) : /* @__PURE__ */ jsx(Icon, { name: "copy" });
|
|
278
423
|
$[9] = copied;
|
|
279
424
|
$[10] = t5;
|
|
280
425
|
} else t5 = $[10];
|
|
@@ -466,7 +611,7 @@ function MermaidRender(props) {
|
|
|
466
611
|
|
|
467
612
|
// src/components/code-block-view.tsx
|
|
468
613
|
function CodeBlockView(props) {
|
|
469
|
-
const $ = c(
|
|
614
|
+
const $ = c(39);
|
|
470
615
|
const { node, view, getPos, decorations, selected, setAttrs, contentRef } = props;
|
|
471
616
|
const language = node.attrs.language || "";
|
|
472
617
|
const isMath = language === "math";
|
|
@@ -533,24 +678,26 @@ function CodeBlockView(props) {
|
|
|
533
678
|
$[13] = t6;
|
|
534
679
|
} else t6 = $[13];
|
|
535
680
|
let t7;
|
|
536
|
-
if ($[14] !== caretInside || $[15] !== code || $[16] !==
|
|
681
|
+
if ($[14] !== caretInside || $[15] !== code || $[16] !== getPos || $[17] !== language || $[18] !== selected || $[19] !== setLanguage || $[20] !== view) {
|
|
537
682
|
t7 = selected ? null : /* @__PURE__ */ jsx(CodeBlockToolbar, {
|
|
538
683
|
code,
|
|
539
684
|
language,
|
|
540
685
|
setLanguage,
|
|
541
686
|
view,
|
|
687
|
+
getPos,
|
|
542
688
|
caretInside
|
|
543
689
|
});
|
|
544
690
|
$[14] = caretInside;
|
|
545
691
|
$[15] = code;
|
|
546
|
-
$[16] =
|
|
547
|
-
$[17] =
|
|
548
|
-
$[18] =
|
|
549
|
-
$[19] =
|
|
550
|
-
$[20] =
|
|
551
|
-
|
|
692
|
+
$[16] = getPos;
|
|
693
|
+
$[17] = language;
|
|
694
|
+
$[18] = selected;
|
|
695
|
+
$[19] = setLanguage;
|
|
696
|
+
$[20] = view;
|
|
697
|
+
$[21] = t7;
|
|
698
|
+
} else t7 = $[21];
|
|
552
699
|
let t8;
|
|
553
|
-
if ($[
|
|
700
|
+
if ($[22] !== focusSource || $[23] !== katex || $[24] !== previewCode || $[25] !== showMathPreview) {
|
|
554
701
|
t8 = showMathPreview && /* @__PURE__ */ jsx(MathRender, {
|
|
555
702
|
katex,
|
|
556
703
|
formula: previewCode,
|
|
@@ -560,14 +707,14 @@ function CodeBlockView(props) {
|
|
|
560
707
|
"data-scroll-x": true,
|
|
561
708
|
onMouseDown: focusSource
|
|
562
709
|
});
|
|
563
|
-
$[
|
|
564
|
-
$[
|
|
565
|
-
$[
|
|
566
|
-
$[
|
|
567
|
-
$[
|
|
568
|
-
} else t8 = $[
|
|
710
|
+
$[22] = focusSource;
|
|
711
|
+
$[23] = katex;
|
|
712
|
+
$[24] = previewCode;
|
|
713
|
+
$[25] = showMathPreview;
|
|
714
|
+
$[26] = t8;
|
|
715
|
+
} else t8 = $[26];
|
|
569
716
|
let t9;
|
|
570
|
-
if ($[
|
|
717
|
+
if ($[27] !== focusSource || $[28] !== mermaid || $[29] !== previewCode || $[30] !== showMermaidPreview) {
|
|
571
718
|
t9 = showMermaidPreview && /* @__PURE__ */ jsx(MermaidRender, {
|
|
572
719
|
renderer: mermaid,
|
|
573
720
|
source: previewCode,
|
|
@@ -576,14 +723,14 @@ function CodeBlockView(props) {
|
|
|
576
723
|
"data-scroll-x": true,
|
|
577
724
|
onMouseDown: focusSource
|
|
578
725
|
});
|
|
579
|
-
$[
|
|
580
|
-
$[
|
|
581
|
-
$[
|
|
582
|
-
$[
|
|
583
|
-
$[
|
|
584
|
-
} else t9 = $[
|
|
726
|
+
$[27] = focusSource;
|
|
727
|
+
$[28] = mermaid;
|
|
728
|
+
$[29] = previewCode;
|
|
729
|
+
$[30] = showMermaidPreview;
|
|
730
|
+
$[31] = t9;
|
|
731
|
+
} else t9 = $[31];
|
|
585
732
|
let t10;
|
|
586
|
-
if ($[
|
|
733
|
+
if ($[32] !== t4 || $[33] !== t5 || $[34] !== t6 || $[35] !== t7 || $[36] !== t8 || $[37] !== t9) {
|
|
587
734
|
t10 = /* @__PURE__ */ jsxs("div", {
|
|
588
735
|
className: code_block_view_module_default.Root,
|
|
589
736
|
"data-preview": t4,
|
|
@@ -596,20 +743,19 @@ function CodeBlockView(props) {
|
|
|
596
743
|
t9
|
|
597
744
|
]
|
|
598
745
|
});
|
|
599
|
-
$[
|
|
600
|
-
$[
|
|
601
|
-
$[
|
|
602
|
-
$[
|
|
603
|
-
$[
|
|
604
|
-
$[
|
|
605
|
-
$[
|
|
606
|
-
} else t10 = $[
|
|
746
|
+
$[32] = t4;
|
|
747
|
+
$[33] = t5;
|
|
748
|
+
$[34] = t6;
|
|
749
|
+
$[35] = t7;
|
|
750
|
+
$[36] = t8;
|
|
751
|
+
$[37] = t9;
|
|
752
|
+
$[38] = t10;
|
|
753
|
+
} else t10 = $[38];
|
|
607
754
|
return t10;
|
|
608
755
|
}
|
|
609
|
-
const MENU_SHORTCUT = isApple ? "⌘/" : "Ctrl+/";
|
|
610
756
|
function CodeBlockToolbar(t0) {
|
|
611
|
-
const $ = c(
|
|
612
|
-
const { code, language, setLanguage, view, caretInside } = t0;
|
|
757
|
+
const $ = c(41);
|
|
758
|
+
const { code, language, setLanguage, view, getPos, caretInside } = t0;
|
|
613
759
|
const [state, dispatch] = useReducer(reduceCodeBlockToolbar, CODE_BLOCK_TOOLBAR_IDLE);
|
|
614
760
|
let t1;
|
|
615
761
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -723,199 +869,202 @@ function CodeBlockToolbar(t0) {
|
|
|
723
869
|
} else t10 = $[15];
|
|
724
870
|
const copyCode = t10;
|
|
725
871
|
let t11;
|
|
726
|
-
if ($[16] !==
|
|
727
|
-
t11 =
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
872
|
+
if ($[16] !== getPos || $[17] !== view) {
|
|
873
|
+
t11 = () => {
|
|
874
|
+
const pos = getPos();
|
|
875
|
+
if (pos == null) return;
|
|
876
|
+
deleteBlock(pos)(view.state, view.dispatch);
|
|
877
|
+
view.focus();
|
|
878
|
+
};
|
|
879
|
+
$[16] = getPos;
|
|
880
|
+
$[17] = view;
|
|
881
|
+
$[18] = t11;
|
|
882
|
+
} else t11 = $[18];
|
|
883
|
+
const deleteCodeBlock = t11;
|
|
884
|
+
let t12;
|
|
885
|
+
if ($[19] !== view.editable) {
|
|
886
|
+
t12 = () => view.editable;
|
|
887
|
+
$[19] = view.editable;
|
|
888
|
+
$[20] = t12;
|
|
889
|
+
} else t12 = $[20];
|
|
890
|
+
const canDeleteCodeBlock = t12;
|
|
732
891
|
let t13;
|
|
733
|
-
if ($[
|
|
734
|
-
t13 =
|
|
892
|
+
if ($[21] !== state) {
|
|
893
|
+
t13 = isCodeBlockToolbarActive(state) || void 0;
|
|
894
|
+
$[21] = state;
|
|
895
|
+
$[22] = t13;
|
|
896
|
+
} else t13 = $[22];
|
|
897
|
+
const t14 = state.open === "language";
|
|
898
|
+
let t15;
|
|
899
|
+
if ($[23] !== getFinalFocus || $[24] !== language || $[25] !== setLanguage || $[26] !== t14) {
|
|
900
|
+
t15 = /* @__PURE__ */ jsx(CodeBlockLanguagePickerMemo, {
|
|
735
901
|
language,
|
|
736
902
|
setLanguage,
|
|
737
|
-
open:
|
|
903
|
+
open: t14,
|
|
738
904
|
onOpenChange: changeLanguageOpen,
|
|
739
905
|
onOpenChangeComplete: completeLanguageOpenChange,
|
|
740
906
|
getFinalFocus
|
|
741
907
|
});
|
|
742
|
-
$[
|
|
743
|
-
$[
|
|
744
|
-
$[
|
|
745
|
-
$[
|
|
746
|
-
$[
|
|
747
|
-
} else
|
|
748
|
-
let
|
|
749
|
-
if ($[
|
|
750
|
-
|
|
908
|
+
$[23] = getFinalFocus;
|
|
909
|
+
$[24] = language;
|
|
910
|
+
$[25] = setLanguage;
|
|
911
|
+
$[26] = t14;
|
|
912
|
+
$[27] = t15;
|
|
913
|
+
} else t15 = $[27];
|
|
914
|
+
let t16;
|
|
915
|
+
if ($[28] !== code) {
|
|
916
|
+
t16 = /* @__PURE__ */ jsx(CopyButton, {
|
|
751
917
|
getText: () => code,
|
|
752
918
|
label: "Copy code",
|
|
753
|
-
className:
|
|
919
|
+
className: class_names_exports.ICON_BUTTON_CLASS,
|
|
754
920
|
"data-testid": "code-block-copy"
|
|
755
921
|
});
|
|
756
|
-
$[
|
|
757
|
-
$[
|
|
758
|
-
} else
|
|
759
|
-
const
|
|
760
|
-
let
|
|
761
|
-
if ($[
|
|
762
|
-
|
|
763
|
-
open:
|
|
922
|
+
$[28] = code;
|
|
923
|
+
$[29] = t16;
|
|
924
|
+
} else t16 = $[29];
|
|
925
|
+
const t17 = state.open === "menu";
|
|
926
|
+
let t18;
|
|
927
|
+
if ($[30] !== canDeleteCodeBlock || $[31] !== copyCode || $[32] !== deleteCodeBlock || $[33] !== getFinalFocus || $[34] !== t17) {
|
|
928
|
+
t18 = /* @__PURE__ */ jsx(CodeBlockMenu, {
|
|
929
|
+
open: t17,
|
|
764
930
|
onOpenChange: changeMenuOpen,
|
|
765
931
|
onOpenChangeComplete: completeMenuOpenChange,
|
|
766
932
|
getFinalFocus,
|
|
767
933
|
onChangeLanguage: handOverToLanguagePicker,
|
|
768
|
-
onCopyCode: copyCode
|
|
934
|
+
onCopyCode: copyCode,
|
|
935
|
+
onDelete: deleteCodeBlock,
|
|
936
|
+
canDelete: canDeleteCodeBlock
|
|
769
937
|
});
|
|
770
|
-
$[
|
|
771
|
-
$[
|
|
772
|
-
$[
|
|
773
|
-
$[
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
938
|
+
$[30] = canDeleteCodeBlock;
|
|
939
|
+
$[31] = copyCode;
|
|
940
|
+
$[32] = deleteCodeBlock;
|
|
941
|
+
$[33] = getFinalFocus;
|
|
942
|
+
$[34] = t17;
|
|
943
|
+
$[35] = t18;
|
|
944
|
+
} else t18 = $[35];
|
|
945
|
+
let t19;
|
|
946
|
+
if ($[36] !== t13 || $[37] !== t15 || $[38] !== t16 || $[39] !== t18) {
|
|
947
|
+
t19 = /* @__PURE__ */ jsxs("div", {
|
|
778
948
|
className: code_block_view_module_default.Toolbar,
|
|
779
949
|
contentEditable: false,
|
|
780
|
-
"data-open":
|
|
950
|
+
"data-open": t13,
|
|
781
951
|
children: [
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
952
|
+
t15,
|
|
953
|
+
t16,
|
|
954
|
+
t18
|
|
785
955
|
]
|
|
786
956
|
});
|
|
787
|
-
$[
|
|
788
|
-
$[
|
|
789
|
-
$[
|
|
790
|
-
$[
|
|
791
|
-
$[
|
|
792
|
-
} else
|
|
793
|
-
return
|
|
957
|
+
$[36] = t13;
|
|
958
|
+
$[37] = t15;
|
|
959
|
+
$[38] = t16;
|
|
960
|
+
$[39] = t18;
|
|
961
|
+
$[40] = t19;
|
|
962
|
+
} else t19 = $[40];
|
|
963
|
+
return t19;
|
|
794
964
|
}
|
|
795
965
|
function CodeBlockMenu(t0) {
|
|
796
|
-
const $ = c(
|
|
797
|
-
const { open, onOpenChange, onOpenChangeComplete, getFinalFocus, onChangeLanguage, onCopyCode } = t0;
|
|
966
|
+
const $ = c(12);
|
|
967
|
+
const { open, onOpenChange, onOpenChangeComplete, getFinalFocus, onChangeLanguage, onCopyCode, onDelete, canDelete } = t0;
|
|
798
968
|
let t1;
|
|
799
969
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
800
970
|
t1 = /* @__PURE__ */ jsx(Menu.Trigger, {
|
|
801
|
-
className:
|
|
971
|
+
className: class_names_exports.ICON_BUTTON_CLASS,
|
|
802
972
|
"aria-label": "More",
|
|
803
|
-
title: `More (${
|
|
973
|
+
title: `More (${isApple ? "⌘/" : "Ctrl+/"})`,
|
|
804
974
|
"data-testid": "code-block-menu",
|
|
805
|
-
children: /* @__PURE__ */ jsx(
|
|
975
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "ellipsis" })
|
|
806
976
|
});
|
|
807
977
|
$[0] = t1;
|
|
808
978
|
} else t1 = $[0];
|
|
809
979
|
let t2;
|
|
810
|
-
if ($[1] !==
|
|
980
|
+
if ($[1] !== canDelete || $[2] !== getFinalFocus || $[3] !== onChangeLanguage || $[4] !== onCopyCode || $[5] !== onDelete) {
|
|
811
981
|
t2 = /* @__PURE__ */ jsx(CodeBlockMenuPopup, {
|
|
812
982
|
getFinalFocus,
|
|
813
983
|
onChangeLanguage,
|
|
814
|
-
onCopyCode
|
|
984
|
+
onCopyCode,
|
|
985
|
+
onDelete,
|
|
986
|
+
canDelete
|
|
815
987
|
});
|
|
816
|
-
$[1] =
|
|
817
|
-
$[2] =
|
|
818
|
-
$[3] =
|
|
819
|
-
$[4] =
|
|
820
|
-
|
|
988
|
+
$[1] = canDelete;
|
|
989
|
+
$[2] = getFinalFocus;
|
|
990
|
+
$[3] = onChangeLanguage;
|
|
991
|
+
$[4] = onCopyCode;
|
|
992
|
+
$[5] = onDelete;
|
|
993
|
+
$[6] = t2;
|
|
994
|
+
} else t2 = $[6];
|
|
821
995
|
let t3;
|
|
822
|
-
if ($[
|
|
996
|
+
if ($[7] !== onOpenChange || $[8] !== onOpenChangeComplete || $[9] !== open || $[10] !== t2) {
|
|
823
997
|
t3 = /* @__PURE__ */ jsxs(Menu.Root, {
|
|
824
998
|
open,
|
|
825
999
|
onOpenChange,
|
|
826
1000
|
onOpenChangeComplete,
|
|
827
1001
|
children: [t1, t2]
|
|
828
1002
|
});
|
|
829
|
-
$[
|
|
830
|
-
$[
|
|
831
|
-
$[
|
|
832
|
-
$[
|
|
833
|
-
$[
|
|
834
|
-
} else t3 = $[
|
|
1003
|
+
$[7] = onOpenChange;
|
|
1004
|
+
$[8] = onOpenChangeComplete;
|
|
1005
|
+
$[9] = open;
|
|
1006
|
+
$[10] = t2;
|
|
1007
|
+
$[11] = t3;
|
|
1008
|
+
} else t3 = $[11];
|
|
835
1009
|
return t3;
|
|
836
1010
|
}
|
|
837
1011
|
function CodeBlockMenuPopup(t0) {
|
|
838
|
-
const $ = c(
|
|
839
|
-
const { getFinalFocus, onChangeLanguage, onCopyCode } = t0;
|
|
840
|
-
const collisionBoundary = use(CollisionBoundaryContext);
|
|
1012
|
+
const $ = c(12);
|
|
1013
|
+
const { getFinalFocus, onChangeLanguage, onCopyCode, onDelete, canDelete } = t0;
|
|
841
1014
|
let t1;
|
|
842
|
-
if ($[0]
|
|
843
|
-
t1 =
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
let t2;
|
|
847
|
-
let t3;
|
|
848
|
-
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
849
|
-
t2 = /* @__PURE__ */ jsx(BracesIcon, {});
|
|
850
|
-
t3 = /* @__PURE__ */ jsx("span", { children: "Change language" });
|
|
851
|
-
$[1] = t2;
|
|
852
|
-
$[2] = t3;
|
|
853
|
-
} else {
|
|
854
|
-
t2 = $[1];
|
|
855
|
-
t3 = $[2];
|
|
856
|
-
}
|
|
857
|
-
let t4;
|
|
858
|
-
if ($[3] !== onChangeLanguage) {
|
|
859
|
-
t4 = /* @__PURE__ */ jsxs(Menu.Item, {
|
|
860
|
-
className: code_block_view_module_default.MenuItem,
|
|
1015
|
+
if ($[0] !== onChangeLanguage) {
|
|
1016
|
+
t1 = /* @__PURE__ */ jsx(ActionMenuItem, {
|
|
1017
|
+
icon: "braces",
|
|
1018
|
+
label: "Change language",
|
|
861
1019
|
onClick: onChangeLanguage,
|
|
862
|
-
|
|
863
|
-
children: [t2, t3]
|
|
1020
|
+
testId: "code-block-menu-language"
|
|
864
1021
|
});
|
|
865
|
-
$[
|
|
866
|
-
$[
|
|
867
|
-
} else
|
|
868
|
-
let
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
$[5] = t5;
|
|
874
|
-
$[6] = t6;
|
|
875
|
-
} else {
|
|
876
|
-
t5 = $[5];
|
|
877
|
-
t6 = $[6];
|
|
878
|
-
}
|
|
879
|
-
let t7;
|
|
880
|
-
if ($[7] !== onCopyCode) {
|
|
881
|
-
t7 = /* @__PURE__ */ jsxs(Menu.Item, {
|
|
882
|
-
className: code_block_view_module_default.MenuItem,
|
|
1022
|
+
$[0] = onChangeLanguage;
|
|
1023
|
+
$[1] = t1;
|
|
1024
|
+
} else t1 = $[1];
|
|
1025
|
+
let t2;
|
|
1026
|
+
if ($[2] !== onCopyCode) {
|
|
1027
|
+
t2 = /* @__PURE__ */ jsx(ActionMenuItem, {
|
|
1028
|
+
icon: "copy",
|
|
1029
|
+
label: "Copy code",
|
|
883
1030
|
onClick: onCopyCode,
|
|
884
|
-
|
|
885
|
-
children: [t5, t6]
|
|
1031
|
+
testId: "code-block-menu-copy"
|
|
886
1032
|
});
|
|
887
|
-
$[
|
|
888
|
-
$[
|
|
889
|
-
} else
|
|
890
|
-
let
|
|
891
|
-
if ($[
|
|
892
|
-
|
|
893
|
-
|
|
1033
|
+
$[2] = onCopyCode;
|
|
1034
|
+
$[3] = t2;
|
|
1035
|
+
} else t2 = $[3];
|
|
1036
|
+
let t3;
|
|
1037
|
+
if ($[4] !== canDelete || $[5] !== onDelete) {
|
|
1038
|
+
t3 = canDelete() && /* @__PURE__ */ jsx(ActionMenuItem, {
|
|
1039
|
+
icon: "trash-2",
|
|
1040
|
+
label: "Delete",
|
|
1041
|
+
onClick: onDelete,
|
|
1042
|
+
testId: "code-block-menu-delete"
|
|
1043
|
+
});
|
|
1044
|
+
$[4] = canDelete;
|
|
1045
|
+
$[5] = onDelete;
|
|
1046
|
+
$[6] = t3;
|
|
1047
|
+
} else t3 = $[6];
|
|
1048
|
+
let t4;
|
|
1049
|
+
if ($[7] !== getFinalFocus || $[8] !== t1 || $[9] !== t2 || $[10] !== t3) {
|
|
1050
|
+
t4 = /* @__PURE__ */ jsxs(ActionMenuPopup, {
|
|
894
1051
|
finalFocus: getFinalFocus,
|
|
895
|
-
children: [
|
|
1052
|
+
children: [
|
|
1053
|
+
t1,
|
|
1054
|
+
t2,
|
|
1055
|
+
t3
|
|
1056
|
+
]
|
|
896
1057
|
});
|
|
897
|
-
$[
|
|
898
|
-
$[
|
|
899
|
-
$[
|
|
900
|
-
$[
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
t9 = /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
|
|
905
|
-
className: code_block_view_module_default.Positioner,
|
|
906
|
-
sideOffset: 4,
|
|
907
|
-
align: "end",
|
|
908
|
-
collisionBoundary,
|
|
909
|
-
children: t8
|
|
910
|
-
}) });
|
|
911
|
-
$[13] = collisionBoundary;
|
|
912
|
-
$[14] = t8;
|
|
913
|
-
$[15] = t9;
|
|
914
|
-
} else t9 = $[15];
|
|
915
|
-
return t9;
|
|
1058
|
+
$[7] = getFinalFocus;
|
|
1059
|
+
$[8] = t1;
|
|
1060
|
+
$[9] = t2;
|
|
1061
|
+
$[10] = t3;
|
|
1062
|
+
$[11] = t4;
|
|
1063
|
+
} else t4 = $[11];
|
|
1064
|
+
return t4;
|
|
916
1065
|
}
|
|
917
1066
|
function CodeBlockLanguagePicker(t0) {
|
|
918
|
-
const $ = c(
|
|
1067
|
+
const $ = c(28);
|
|
919
1068
|
const { language, setLanguage, open, onOpenChange, onOpenChangeComplete, getFinalFocus } = t0;
|
|
920
1069
|
const collisionBoundary = use(CollisionBoundaryContext);
|
|
921
1070
|
let t1;
|
|
@@ -974,16 +1123,21 @@ function CodeBlockLanguagePicker(t0) {
|
|
|
974
1123
|
"data-testid": "code-block-language",
|
|
975
1124
|
children: [t5, /* @__PURE__ */ jsx(Combobox.Icon, {
|
|
976
1125
|
className: code_block_view_module_default.TriggerIcon,
|
|
977
|
-
children: /* @__PURE__ */ jsx(
|
|
1126
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "chevrons-up-down" })
|
|
978
1127
|
})]
|
|
979
1128
|
});
|
|
980
1129
|
$[9] = t6;
|
|
981
1130
|
} else t6 = $[9];
|
|
982
1131
|
let t7;
|
|
1132
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1133
|
+
t7 = clsx(class_names_exports.MENU_POPUP_CLASS, code_block_view_module_default.Popup);
|
|
1134
|
+
$[10] = t7;
|
|
1135
|
+
} else t7 = $[10];
|
|
1136
|
+
let t10;
|
|
983
1137
|
let t8;
|
|
984
1138
|
let t9;
|
|
985
|
-
if ($[
|
|
986
|
-
|
|
1139
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1140
|
+
t8 = /* @__PURE__ */ jsx("div", {
|
|
987
1141
|
className: code_block_view_module_default.SearchRow,
|
|
988
1142
|
children: /* @__PURE__ */ jsx(Combobox.Input, {
|
|
989
1143
|
className: code_block_view_module_default.Search,
|
|
@@ -991,51 +1145,51 @@ function CodeBlockLanguagePicker(t0) {
|
|
|
991
1145
|
"data-testid": "code-block-language-search"
|
|
992
1146
|
})
|
|
993
1147
|
});
|
|
994
|
-
|
|
1148
|
+
t9 = /* @__PURE__ */ jsx(Combobox.Empty, {
|
|
995
1149
|
className: code_block_view_module_default.Empty,
|
|
996
1150
|
children: "No languages found."
|
|
997
1151
|
});
|
|
998
|
-
|
|
1152
|
+
t10 = /* @__PURE__ */ jsx(Combobox.List, {
|
|
999
1153
|
className: code_block_view_module_default.List,
|
|
1000
1154
|
children: _temp$3
|
|
1001
1155
|
});
|
|
1002
|
-
$[
|
|
1003
|
-
$[
|
|
1004
|
-
$[
|
|
1156
|
+
$[11] = t10;
|
|
1157
|
+
$[12] = t8;
|
|
1158
|
+
$[13] = t9;
|
|
1005
1159
|
} else {
|
|
1006
|
-
|
|
1007
|
-
t8 = $[
|
|
1008
|
-
t9 = $[
|
|
1160
|
+
t10 = $[11];
|
|
1161
|
+
t8 = $[12];
|
|
1162
|
+
t9 = $[13];
|
|
1009
1163
|
}
|
|
1010
|
-
let
|
|
1011
|
-
if ($[
|
|
1012
|
-
|
|
1013
|
-
className:
|
|
1164
|
+
let t11;
|
|
1165
|
+
if ($[14] !== getFinalFocus) {
|
|
1166
|
+
t11 = /* @__PURE__ */ jsxs(Combobox.Popup, {
|
|
1167
|
+
className: t7,
|
|
1014
1168
|
finalFocus: getFinalFocus,
|
|
1015
1169
|
children: [
|
|
1016
|
-
t7,
|
|
1017
1170
|
t8,
|
|
1018
|
-
t9
|
|
1171
|
+
t9,
|
|
1172
|
+
t10
|
|
1019
1173
|
]
|
|
1020
1174
|
});
|
|
1021
|
-
$[
|
|
1022
|
-
$[
|
|
1023
|
-
} else
|
|
1024
|
-
let
|
|
1025
|
-
if ($[
|
|
1026
|
-
|
|
1027
|
-
className:
|
|
1175
|
+
$[14] = getFinalFocus;
|
|
1176
|
+
$[15] = t11;
|
|
1177
|
+
} else t11 = $[15];
|
|
1178
|
+
let t12;
|
|
1179
|
+
if ($[16] !== collisionBoundary || $[17] !== t11) {
|
|
1180
|
+
t12 = /* @__PURE__ */ jsx(Combobox.Portal, { children: /* @__PURE__ */ jsx(Combobox.Positioner, {
|
|
1181
|
+
className: class_names_exports.MENU_POSITIONER_CLASS,
|
|
1028
1182
|
sideOffset: 4,
|
|
1029
1183
|
collisionBoundary,
|
|
1030
|
-
children:
|
|
1184
|
+
children: t11
|
|
1031
1185
|
}) });
|
|
1032
|
-
$[
|
|
1033
|
-
$[16] = t10;
|
|
1186
|
+
$[16] = collisionBoundary;
|
|
1034
1187
|
$[17] = t11;
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1188
|
+
$[18] = t12;
|
|
1189
|
+
} else t12 = $[18];
|
|
1190
|
+
let t13;
|
|
1191
|
+
if ($[19] !== itemsForView || $[20] !== onOpenChange || $[21] !== open || $[22] !== query || $[23] !== selected || $[24] !== t12 || $[25] !== t3 || $[26] !== t4) {
|
|
1192
|
+
t13 = /* @__PURE__ */ jsxs(Combobox.Root, {
|
|
1039
1193
|
items: itemsForView,
|
|
1040
1194
|
autoHighlight: true,
|
|
1041
1195
|
value: selected,
|
|
@@ -1045,27 +1199,27 @@ function CodeBlockLanguagePicker(t0) {
|
|
|
1045
1199
|
open,
|
|
1046
1200
|
onOpenChange,
|
|
1047
1201
|
onOpenChangeComplete: t4,
|
|
1048
|
-
children: [t6,
|
|
1049
|
-
});
|
|
1050
|
-
$[
|
|
1051
|
-
$[
|
|
1052
|
-
$[
|
|
1053
|
-
$[
|
|
1054
|
-
$[
|
|
1055
|
-
$[
|
|
1056
|
-
$[
|
|
1057
|
-
$[
|
|
1058
|
-
$[
|
|
1059
|
-
} else
|
|
1060
|
-
return
|
|
1202
|
+
children: [t6, t12]
|
|
1203
|
+
});
|
|
1204
|
+
$[19] = itemsForView;
|
|
1205
|
+
$[20] = onOpenChange;
|
|
1206
|
+
$[21] = open;
|
|
1207
|
+
$[22] = query;
|
|
1208
|
+
$[23] = selected;
|
|
1209
|
+
$[24] = t12;
|
|
1210
|
+
$[25] = t3;
|
|
1211
|
+
$[26] = t4;
|
|
1212
|
+
$[27] = t13;
|
|
1213
|
+
} else t13 = $[27];
|
|
1214
|
+
return t13;
|
|
1061
1215
|
}
|
|
1062
1216
|
function _temp$3(item_2) {
|
|
1063
1217
|
return /* @__PURE__ */ jsxs(Combobox.Item, {
|
|
1064
1218
|
value: item_2,
|
|
1065
|
-
className: code_block_view_module_default.Item,
|
|
1219
|
+
className: clsx(class_names_exports.MENU_ITEM_CLASS, code_block_view_module_default.Item),
|
|
1066
1220
|
children: [/* @__PURE__ */ jsx(Combobox.ItemIndicator, {
|
|
1067
|
-
className: code_block_view_module_default.ItemIndicator,
|
|
1068
|
-
children: /* @__PURE__ */ jsx(
|
|
1221
|
+
className: clsx(class_names_exports.MENU_ITEM_INDICATOR_CLASS, code_block_view_module_default.ItemIndicator),
|
|
1222
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "check" })
|
|
1069
1223
|
}), /* @__PURE__ */ jsx("span", {
|
|
1070
1224
|
className: code_block_view_module_default.ItemText,
|
|
1071
1225
|
children: item_2.label
|
|
@@ -1109,7 +1263,7 @@ function BlockHandle() {
|
|
|
1109
1263
|
children: /* @__PURE__ */ jsx(BlockHandleDraggable, {
|
|
1110
1264
|
className: block_handle_module_default.Draggable,
|
|
1111
1265
|
"data-testid": "block-handle-drag",
|
|
1112
|
-
children: /* @__PURE__ */ jsx(
|
|
1266
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "grip-vertical" })
|
|
1113
1267
|
})
|
|
1114
1268
|
})
|
|
1115
1269
|
}) });
|
|
@@ -1210,6 +1364,225 @@ function EditorExtensions(t0) {
|
|
|
1210
1364
|
return null;
|
|
1211
1365
|
}
|
|
1212
1366
|
|
|
1367
|
+
// src/components/embed-menu-state.ts
|
|
1368
|
+
const EMBED_MENU_IDLE = { phase: "idle" };
|
|
1369
|
+
function reduceEmbedMenu(state, event) {
|
|
1370
|
+
switch (event.type) {
|
|
1371
|
+
case "toggle":
|
|
1372
|
+
if (state.phase === "open" && state.button === event.button) return {
|
|
1373
|
+
...state,
|
|
1374
|
+
phase: "closing"
|
|
1375
|
+
};
|
|
1376
|
+
return {
|
|
1377
|
+
phase: "open",
|
|
1378
|
+
embed: event.embed,
|
|
1379
|
+
button: event.button
|
|
1380
|
+
};
|
|
1381
|
+
case "close": return state.phase === "open" ? {
|
|
1382
|
+
...state,
|
|
1383
|
+
phase: "closing"
|
|
1384
|
+
} : state;
|
|
1385
|
+
case "closed": return state.phase === "closing" ? EMBED_MENU_IDLE : state;
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
// src/components/embed-menu.tsx
|
|
1390
|
+
/**
|
|
1391
|
+
* The menu of images, X post cards, and YouTube cards, opened from their menu
|
|
1392
|
+
* button or with `Mod-/` while one is selected. One instance serves them all.
|
|
1393
|
+
*/
|
|
1394
|
+
function EmbedMenu(t0) {
|
|
1395
|
+
const $ = c(43);
|
|
1396
|
+
const { readOnly: t1 } = t0;
|
|
1397
|
+
const readOnly = t1 === void 0 ? false : t1;
|
|
1398
|
+
const editor = useEditor$1();
|
|
1399
|
+
const [state, dispatch] = useReducer(reduceEmbedMenu, EMBED_MENU_IDLE);
|
|
1400
|
+
let t2;
|
|
1401
|
+
let t3;
|
|
1402
|
+
if ($[0] !== editor) {
|
|
1403
|
+
t2 = () => {
|
|
1404
|
+
const extension = defineEmbedMenuHandler((embed, button) => {
|
|
1405
|
+
dispatch({
|
|
1406
|
+
type: "toggle",
|
|
1407
|
+
embed,
|
|
1408
|
+
button
|
|
1409
|
+
});
|
|
1410
|
+
});
|
|
1411
|
+
return queueExtension(editor, extension);
|
|
1412
|
+
};
|
|
1413
|
+
t3 = [editor];
|
|
1414
|
+
$[0] = editor;
|
|
1415
|
+
$[1] = t2;
|
|
1416
|
+
$[2] = t3;
|
|
1417
|
+
} else {
|
|
1418
|
+
t2 = $[1];
|
|
1419
|
+
t3 = $[2];
|
|
1420
|
+
}
|
|
1421
|
+
useEffect(t2, t3);
|
|
1422
|
+
const open = state.phase === "open";
|
|
1423
|
+
const button_0 = state.phase === "idle" ? void 0 : state.button;
|
|
1424
|
+
const embed_0 = state.phase === "idle" ? void 0 : state.embed;
|
|
1425
|
+
let t4;
|
|
1426
|
+
let t5;
|
|
1427
|
+
if ($[3] !== button_0 || $[4] !== open) {
|
|
1428
|
+
t4 = () => {
|
|
1429
|
+
if (!button_0) return;
|
|
1430
|
+
button_0.setAttribute("aria-expanded", String(open));
|
|
1431
|
+
return () => button_0.removeAttribute("aria-expanded");
|
|
1432
|
+
};
|
|
1433
|
+
t5 = [button_0, open];
|
|
1434
|
+
$[3] = button_0;
|
|
1435
|
+
$[4] = open;
|
|
1436
|
+
$[5] = t4;
|
|
1437
|
+
$[6] = t5;
|
|
1438
|
+
} else {
|
|
1439
|
+
t4 = $[5];
|
|
1440
|
+
t5 = $[6];
|
|
1441
|
+
}
|
|
1442
|
+
useEffect(t4, t5);
|
|
1443
|
+
let t6;
|
|
1444
|
+
if ($[7] !== button_0) {
|
|
1445
|
+
t6 = (next, details) => {
|
|
1446
|
+
if (next) return;
|
|
1447
|
+
const target = details.event.target;
|
|
1448
|
+
if (details.reason === "outside-press" && target instanceof Node && button_0?.contains(target)) {
|
|
1449
|
+
details.cancel();
|
|
1450
|
+
return;
|
|
1451
|
+
}
|
|
1452
|
+
dispatch({ type: "close" });
|
|
1453
|
+
};
|
|
1454
|
+
$[7] = button_0;
|
|
1455
|
+
$[8] = t6;
|
|
1456
|
+
} else t6 = $[8];
|
|
1457
|
+
const changeOpen = t6;
|
|
1458
|
+
let t7;
|
|
1459
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1460
|
+
t7 = (next_0) => {
|
|
1461
|
+
if (!next_0) dispatch({ type: "closed" });
|
|
1462
|
+
};
|
|
1463
|
+
$[9] = t7;
|
|
1464
|
+
} else t7 = $[9];
|
|
1465
|
+
const completeOpenChange = t7;
|
|
1466
|
+
let t8;
|
|
1467
|
+
if ($[10] !== editor) {
|
|
1468
|
+
t8 = () => {
|
|
1469
|
+
editor.focus();
|
|
1470
|
+
return false;
|
|
1471
|
+
};
|
|
1472
|
+
$[10] = editor;
|
|
1473
|
+
$[11] = t8;
|
|
1474
|
+
} else t8 = $[11];
|
|
1475
|
+
const getFinalFocus = t8;
|
|
1476
|
+
let t9;
|
|
1477
|
+
if ($[12] !== editor || $[13] !== embed_0) {
|
|
1478
|
+
t9 = () => {
|
|
1479
|
+
if (embed_0) editor.exec(convertEmbedToLink(embed_0.from));
|
|
1480
|
+
};
|
|
1481
|
+
$[12] = editor;
|
|
1482
|
+
$[13] = embed_0;
|
|
1483
|
+
$[14] = t9;
|
|
1484
|
+
} else t9 = $[14];
|
|
1485
|
+
const convertToLink = t9;
|
|
1486
|
+
let t10;
|
|
1487
|
+
if ($[15] !== embed_0) {
|
|
1488
|
+
t10 = () => {
|
|
1489
|
+
if (embed_0) writeClipboardText(embed_0.src);
|
|
1490
|
+
};
|
|
1491
|
+
$[15] = embed_0;
|
|
1492
|
+
$[16] = t10;
|
|
1493
|
+
} else t10 = $[16];
|
|
1494
|
+
const copyLink = t10;
|
|
1495
|
+
let t11;
|
|
1496
|
+
if ($[17] !== editor || $[18] !== embed_0) {
|
|
1497
|
+
t11 = () => {
|
|
1498
|
+
if (embed_0) editor.exec(deleteEmbed(embed_0.from));
|
|
1499
|
+
};
|
|
1500
|
+
$[17] = editor;
|
|
1501
|
+
$[18] = embed_0;
|
|
1502
|
+
$[19] = t11;
|
|
1503
|
+
} else t11 = $[19];
|
|
1504
|
+
const remove = t11;
|
|
1505
|
+
let t12;
|
|
1506
|
+
if ($[20] !== editor.state || $[21] !== embed_0 || $[22] !== readOnly) {
|
|
1507
|
+
t12 = !readOnly && embed_0 != null && convertEmbedToLink(embed_0.from)(editor.state);
|
|
1508
|
+
$[20] = editor.state;
|
|
1509
|
+
$[21] = embed_0;
|
|
1510
|
+
$[22] = readOnly;
|
|
1511
|
+
$[23] = t12;
|
|
1512
|
+
} else t12 = $[23];
|
|
1513
|
+
const canConvert = t12;
|
|
1514
|
+
let t13;
|
|
1515
|
+
if ($[24] !== canConvert || $[25] !== convertToLink) {
|
|
1516
|
+
t13 = canConvert && /* @__PURE__ */ jsx(ActionMenuItem, {
|
|
1517
|
+
icon: "link-2",
|
|
1518
|
+
label: "Convert to link",
|
|
1519
|
+
onClick: convertToLink,
|
|
1520
|
+
testId: "embed-menu-convert"
|
|
1521
|
+
});
|
|
1522
|
+
$[24] = canConvert;
|
|
1523
|
+
$[25] = convertToLink;
|
|
1524
|
+
$[26] = t13;
|
|
1525
|
+
} else t13 = $[26];
|
|
1526
|
+
const t14 = embed_0?.kind === "image" ? "Copy image link" : "Copy link";
|
|
1527
|
+
let t15;
|
|
1528
|
+
if ($[27] !== copyLink || $[28] !== t14) {
|
|
1529
|
+
t15 = /* @__PURE__ */ jsx(ActionMenuItem, {
|
|
1530
|
+
icon: "copy",
|
|
1531
|
+
label: t14,
|
|
1532
|
+
onClick: copyLink,
|
|
1533
|
+
testId: "embed-menu-copy"
|
|
1534
|
+
});
|
|
1535
|
+
$[27] = copyLink;
|
|
1536
|
+
$[28] = t14;
|
|
1537
|
+
$[29] = t15;
|
|
1538
|
+
} else t15 = $[29];
|
|
1539
|
+
let t16;
|
|
1540
|
+
if ($[30] !== readOnly || $[31] !== remove) {
|
|
1541
|
+
t16 = !readOnly && /* @__PURE__ */ jsx(ActionMenuItem, {
|
|
1542
|
+
icon: "trash-2",
|
|
1543
|
+
label: "Delete",
|
|
1544
|
+
onClick: remove,
|
|
1545
|
+
testId: "embed-menu-delete"
|
|
1546
|
+
});
|
|
1547
|
+
$[30] = readOnly;
|
|
1548
|
+
$[31] = remove;
|
|
1549
|
+
$[32] = t16;
|
|
1550
|
+
} else t16 = $[32];
|
|
1551
|
+
let t17;
|
|
1552
|
+
if ($[33] !== button_0 || $[34] !== getFinalFocus || $[35] !== t13 || $[36] !== t15 || $[37] !== t16) {
|
|
1553
|
+
t17 = /* @__PURE__ */ jsxs(ActionMenuPopup, {
|
|
1554
|
+
anchor: button_0,
|
|
1555
|
+
finalFocus: getFinalFocus,
|
|
1556
|
+
testId: "embed-menu-popup",
|
|
1557
|
+
children: [
|
|
1558
|
+
t13,
|
|
1559
|
+
t15,
|
|
1560
|
+
t16
|
|
1561
|
+
]
|
|
1562
|
+
});
|
|
1563
|
+
$[33] = button_0;
|
|
1564
|
+
$[34] = getFinalFocus;
|
|
1565
|
+
$[35] = t13;
|
|
1566
|
+
$[36] = t15;
|
|
1567
|
+
$[37] = t16;
|
|
1568
|
+
$[38] = t17;
|
|
1569
|
+
} else t17 = $[38];
|
|
1570
|
+
let t18;
|
|
1571
|
+
if ($[39] !== changeOpen || $[40] !== open || $[41] !== t17) {
|
|
1572
|
+
t18 = /* @__PURE__ */ jsx(Menu.Root, {
|
|
1573
|
+
open,
|
|
1574
|
+
onOpenChange: changeOpen,
|
|
1575
|
+
onOpenChangeComplete: completeOpenChange,
|
|
1576
|
+
children: t17
|
|
1577
|
+
});
|
|
1578
|
+
$[39] = changeOpen;
|
|
1579
|
+
$[40] = open;
|
|
1580
|
+
$[41] = t17;
|
|
1581
|
+
$[42] = t18;
|
|
1582
|
+
} else t18 = $[42];
|
|
1583
|
+
return t18;
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1213
1586
|
// src/components/link-menu-state.ts
|
|
1214
1587
|
const LINK_MENU_IDLE = { kind: "idle" };
|
|
1215
1588
|
/**
|
|
@@ -1495,7 +1868,7 @@ function LinkActions(t0) {
|
|
|
1495
1868
|
title: "Edit link",
|
|
1496
1869
|
"aria-label": "Edit link",
|
|
1497
1870
|
onClick: onEdit,
|
|
1498
|
-
children: /* @__PURE__ */ jsx(
|
|
1871
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "pencil" })
|
|
1499
1872
|
});
|
|
1500
1873
|
$[8] = onEdit;
|
|
1501
1874
|
$[9] = t4;
|
|
@@ -1508,7 +1881,7 @@ function LinkActions(t0) {
|
|
|
1508
1881
|
title: "Remove link",
|
|
1509
1882
|
"aria-label": "Remove link",
|
|
1510
1883
|
onClick: onRemove,
|
|
1511
|
-
children: /* @__PURE__ */ jsx(
|
|
1884
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "unlink" })
|
|
1512
1885
|
});
|
|
1513
1886
|
$[10] = onRemove;
|
|
1514
1887
|
$[11] = t5;
|
|
@@ -1537,7 +1910,7 @@ function PreviewIcon(t0) {
|
|
|
1537
1910
|
if (!preview.iconSrc || failed) {
|
|
1538
1911
|
let t1;
|
|
1539
1912
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1540
|
-
t1 = /* @__PURE__ */ jsx(
|
|
1913
|
+
t1 = /* @__PURE__ */ jsx(Icon, { name: "earth" });
|
|
1541
1914
|
$[0] = t1;
|
|
1542
1915
|
} else t1 = $[0];
|
|
1543
1916
|
return t1;
|
|
@@ -1661,7 +2034,7 @@ function LinkInfoContent(t0) {
|
|
|
1661
2034
|
t9 = onUseTitle && /* @__PURE__ */ jsxs("div", {
|
|
1662
2035
|
className: link_menu_module_default.ReplaceRow,
|
|
1663
2036
|
children: [
|
|
1664
|
-
/* @__PURE__ */ jsx(
|
|
2037
|
+
/* @__PURE__ */ jsx(Icon, { name: "sparkles" }),
|
|
1665
2038
|
/* @__PURE__ */ jsx("span", { children: "Replace URL with its title?" }),
|
|
1666
2039
|
/* @__PURE__ */ jsx("button", {
|
|
1667
2040
|
type: "button",
|
|
@@ -2664,7 +3037,7 @@ function SelectionMenu(t0) {
|
|
|
2664
3037
|
if (affordanceVisible && showAffordance) {
|
|
2665
3038
|
let t6;
|
|
2666
3039
|
if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2667
|
-
t6 = /* @__PURE__ */ jsx(
|
|
3040
|
+
t6 = /* @__PURE__ */ jsx(Icon, { name: "sparkles" });
|
|
2668
3041
|
$[24] = t6;
|
|
2669
3042
|
} else t6 = $[24];
|
|
2670
3043
|
let t7;
|
|
@@ -3457,7 +3830,7 @@ function TableMenuAlignItem(t0) {
|
|
|
3457
3830
|
} else t3 = $[5];
|
|
3458
3831
|
let t4;
|
|
3459
3832
|
if ($[6] !== active) {
|
|
3460
|
-
t4 = active && /* @__PURE__ */ jsx(
|
|
3833
|
+
t4 = active && /* @__PURE__ */ jsx(Icon, { name: "check" });
|
|
3461
3834
|
$[6] = active;
|
|
3462
3835
|
$[7] = t4;
|
|
3463
3836
|
} else t4 = $[7];
|
|
@@ -3818,7 +4191,7 @@ function TableHandle() {
|
|
|
3818
4191
|
t2 = /* @__PURE__ */ jsx(TableHandleColumnMenuTrigger, {
|
|
3819
4192
|
className: table_handle_module_default.Trigger,
|
|
3820
4193
|
"data-testid": "table-handle-column",
|
|
3821
|
-
children: /* @__PURE__ */ jsx(
|
|
4194
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "grip-horizontal" })
|
|
3822
4195
|
});
|
|
3823
4196
|
$[2] = t2;
|
|
3824
4197
|
} else t2 = $[2];
|
|
@@ -3867,7 +4240,7 @@ function TableHandle() {
|
|
|
3867
4240
|
t6 = /* @__PURE__ */ jsx(TableHandleRowMenuTrigger, {
|
|
3868
4241
|
className: table_handle_module_default.Trigger,
|
|
3869
4242
|
"data-testid": "table-handle-row",
|
|
3870
|
-
children: /* @__PURE__ */ jsx(
|
|
4243
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "grip-vertical" })
|
|
3871
4244
|
});
|
|
3872
4245
|
$[13] = t6;
|
|
3873
4246
|
} else t6 = $[13];
|
|
@@ -4287,7 +4660,7 @@ function findHeadingPosition(doc, fragment) {
|
|
|
4287
4660
|
return match;
|
|
4288
4661
|
}
|
|
4289
4662
|
function ProseKitEditor(t0) {
|
|
4290
|
-
const $ = c(
|
|
4663
|
+
const $ = c(120);
|
|
4291
4664
|
const { markMode: t1, initialMarkdown, singleParagraph: t2, referenceDefinitions, onDocChange, onSlashMenuSearch, onTagSearch, onWikilinkSearch, onSelectionMenuSearch, selectionMenuAffordance: t3, collisionBoundary, pendingReplacementActions, onPendingReplacementResolve, onWikilinkClick, onLinkClick, onLinkCopy, resolveLinkPreview, onTagClick, onExitBoundary, resolveImageUrl, resolveFileLink, resolveWikiEmbed, resolveWikilink, resolveFileInfo, resolveXPost, mediaUrlProtocols, resolveYouTubeVideo, onFileClick, onFilePaste, onFileSaveError, onImageClick, onXPostMediaClick, onYouTubeVideoClick, embedPaste, linkPaste, bulletAfterHeading, backspaceDeletesEmptyFirstBlock, substitution: t4, frontmatter: t5, blockHandle: t6, placeholder, readOnly, spellCheck, writingSuggestions, autoCorrect, autoCapitalize, enterKeyHint, dir, lang, ariaLabel, searchQuery: t7, onSearchChange, timeFormat, editorClassName, CodeBlockView, ref, children } = t0;
|
|
4292
4665
|
const markMode = t1 === void 0 ? "focus" : t1;
|
|
4293
4666
|
const singleParagraph = t2 === void 0 ? false : t2;
|
|
@@ -4651,7 +5024,7 @@ function ProseKitEditor(t0) {
|
|
|
4651
5024
|
$[78] = timeFormat;
|
|
4652
5025
|
$[79] = t22;
|
|
4653
5026
|
} else t22 = $[79];
|
|
4654
|
-
const t23 =
|
|
5027
|
+
const t23 = readOnly ? 1 : 0;
|
|
4655
5028
|
let t24;
|
|
4656
5029
|
if ($[80] !== onLinkClick || $[81] !== onLinkCopy || $[82] !== readOnly || $[83] !== resolveLinkPreview || $[84] !== t23) {
|
|
4657
5030
|
t24 = /* @__PURE__ */ jsx(LinkMenu, {
|
|
@@ -4668,47 +5041,53 @@ function ProseKitEditor(t0) {
|
|
|
4668
5041
|
$[85] = t24;
|
|
4669
5042
|
} else t24 = $[85];
|
|
4670
5043
|
let t25;
|
|
4671
|
-
if ($[86] !==
|
|
4672
|
-
t25 =
|
|
4673
|
-
$[86] =
|
|
5044
|
+
if ($[86] !== readOnly) {
|
|
5045
|
+
t25 = /* @__PURE__ */ jsx(EmbedMenu, { readOnly });
|
|
5046
|
+
$[86] = readOnly;
|
|
4674
5047
|
$[87] = t25;
|
|
4675
5048
|
} else t25 = $[87];
|
|
4676
5049
|
let t26;
|
|
4677
|
-
if ($[88] !==
|
|
4678
|
-
t26 =
|
|
4679
|
-
$[88] =
|
|
5050
|
+
if ($[88] !== onTagSearch) {
|
|
5051
|
+
t26 = onTagSearch && /* @__PURE__ */ jsx(TagMenu, { onTagSearch });
|
|
5052
|
+
$[88] = onTagSearch;
|
|
4680
5053
|
$[89] = t26;
|
|
4681
5054
|
} else t26 = $[89];
|
|
4682
5055
|
let t27;
|
|
4683
|
-
if ($[90] !==
|
|
4684
|
-
t27 =
|
|
5056
|
+
if ($[90] !== onWikilinkSearch) {
|
|
5057
|
+
t27 = onWikilinkSearch && /* @__PURE__ */ jsx(WikilinkMenu, { onWikilinkSearch });
|
|
5058
|
+
$[90] = onWikilinkSearch;
|
|
5059
|
+
$[91] = t27;
|
|
5060
|
+
} else t27 = $[91];
|
|
5061
|
+
let t28;
|
|
5062
|
+
if ($[92] !== onSelectionMenuSearch || $[93] !== openSelectionMenu || $[94] !== readOnly || $[95] !== selectionMenuAffordance || $[96] !== selectionMenuContext) {
|
|
5063
|
+
t28 = onSelectionMenuSearch && !readOnly && /* @__PURE__ */ jsx(SelectionMenu, {
|
|
4685
5064
|
onSelectionMenuSearch,
|
|
4686
5065
|
context: selectionMenuContext,
|
|
4687
5066
|
onOpen: openSelectionMenu,
|
|
4688
5067
|
onClose: closeSelectionMenu,
|
|
4689
5068
|
affordance: selectionMenuAffordance
|
|
4690
5069
|
});
|
|
4691
|
-
$[
|
|
4692
|
-
$[
|
|
4693
|
-
$[
|
|
4694
|
-
$[
|
|
4695
|
-
$[
|
|
4696
|
-
$[
|
|
4697
|
-
} else
|
|
4698
|
-
let
|
|
4699
|
-
if ($[
|
|
4700
|
-
|
|
5070
|
+
$[92] = onSelectionMenuSearch;
|
|
5071
|
+
$[93] = openSelectionMenu;
|
|
5072
|
+
$[94] = readOnly;
|
|
5073
|
+
$[95] = selectionMenuAffordance;
|
|
5074
|
+
$[96] = selectionMenuContext;
|
|
5075
|
+
$[97] = t28;
|
|
5076
|
+
} else t28 = $[97];
|
|
5077
|
+
let t29;
|
|
5078
|
+
if ($[98] !== onPendingReplacementResolve || $[99] !== pendingReplacementActions || $[100] !== readOnly) {
|
|
5079
|
+
t29 = !readOnly && /* @__PURE__ */ jsx(PendingReplacementPreview, {
|
|
4701
5080
|
actions: pendingReplacementActions,
|
|
4702
5081
|
onResolve: onPendingReplacementResolve
|
|
4703
5082
|
});
|
|
4704
|
-
$[
|
|
4705
|
-
$[
|
|
4706
|
-
$[
|
|
4707
|
-
$[
|
|
4708
|
-
} else
|
|
4709
|
-
let
|
|
4710
|
-
if ($[
|
|
4711
|
-
|
|
5083
|
+
$[98] = onPendingReplacementResolve;
|
|
5084
|
+
$[99] = pendingReplacementActions;
|
|
5085
|
+
$[100] = readOnly;
|
|
5086
|
+
$[101] = t29;
|
|
5087
|
+
} else t29 = $[101];
|
|
5088
|
+
let t30;
|
|
5089
|
+
if ($[102] !== children || $[103] !== editor_0 || $[104] !== t17 || $[105] !== t18 || $[106] !== t19 || $[107] !== t20 || $[108] !== t21 || $[109] !== t22 || $[110] !== t24 || $[111] !== t25 || $[112] !== t26 || $[113] !== t27 || $[114] !== t28 || $[115] !== t29) {
|
|
5090
|
+
t30 = /* @__PURE__ */ jsxs(ProseKit, {
|
|
4712
5091
|
editor: editor_0,
|
|
4713
5092
|
children: [
|
|
4714
5093
|
t16,
|
|
@@ -4723,35 +5102,37 @@ function ProseKitEditor(t0) {
|
|
|
4723
5102
|
t26,
|
|
4724
5103
|
t27,
|
|
4725
5104
|
t28,
|
|
5105
|
+
t29,
|
|
4726
5106
|
children
|
|
4727
5107
|
]
|
|
4728
5108
|
});
|
|
4729
|
-
$[
|
|
4730
|
-
$[
|
|
4731
|
-
$[
|
|
4732
|
-
$[
|
|
4733
|
-
$[
|
|
4734
|
-
$[
|
|
4735
|
-
$[
|
|
4736
|
-
$[
|
|
4737
|
-
$[
|
|
4738
|
-
$[
|
|
4739
|
-
$[
|
|
4740
|
-
$[
|
|
4741
|
-
$[
|
|
4742
|
-
$[113] = t29;
|
|
4743
|
-
} else t29 = $[113];
|
|
4744
|
-
let t30;
|
|
4745
|
-
if ($[114] !== collisionBoundary || $[115] !== t29) {
|
|
4746
|
-
t30 = /* @__PURE__ */ jsx(CollisionBoundaryContext, {
|
|
4747
|
-
value: collisionBoundary,
|
|
4748
|
-
children: t29
|
|
4749
|
-
});
|
|
4750
|
-
$[114] = collisionBoundary;
|
|
5109
|
+
$[102] = children;
|
|
5110
|
+
$[103] = editor_0;
|
|
5111
|
+
$[104] = t17;
|
|
5112
|
+
$[105] = t18;
|
|
5113
|
+
$[106] = t19;
|
|
5114
|
+
$[107] = t20;
|
|
5115
|
+
$[108] = t21;
|
|
5116
|
+
$[109] = t22;
|
|
5117
|
+
$[110] = t24;
|
|
5118
|
+
$[111] = t25;
|
|
5119
|
+
$[112] = t26;
|
|
5120
|
+
$[113] = t27;
|
|
5121
|
+
$[114] = t28;
|
|
4751
5122
|
$[115] = t29;
|
|
4752
5123
|
$[116] = t30;
|
|
4753
5124
|
} else t30 = $[116];
|
|
4754
|
-
|
|
5125
|
+
let t31;
|
|
5126
|
+
if ($[117] !== collisionBoundary || $[118] !== t30) {
|
|
5127
|
+
t31 = /* @__PURE__ */ jsx(CollisionBoundaryContext, {
|
|
5128
|
+
value: collisionBoundary,
|
|
5129
|
+
children: t30
|
|
5130
|
+
});
|
|
5131
|
+
$[117] = collisionBoundary;
|
|
5132
|
+
$[118] = t30;
|
|
5133
|
+
$[119] = t31;
|
|
5134
|
+
} else t31 = $[119];
|
|
5135
|
+
return t31;
|
|
4755
5136
|
}
|
|
4756
5137
|
|
|
4757
5138
|
// src/components/editor.tsx
|
|
@@ -4864,7 +5245,7 @@ function MarkdownEditor(t0) {
|
|
|
4864
5245
|
useImperativeHandle(handleRef, t11, t12);
|
|
4865
5246
|
let t13;
|
|
4866
5247
|
if ($[2] !== wrapperClassName) {
|
|
4867
|
-
t13 = clsx(
|
|
5248
|
+
t13 = clsx(ROOT_CLASS, wrapperClassName);
|
|
4868
5249
|
$[2] = wrapperClassName;
|
|
4869
5250
|
$[3] = t13;
|
|
4870
5251
|
} else t13 = $[3];
|
|
@@ -5164,7 +5545,7 @@ function WikilinkChip(props) {
|
|
|
5164
5545
|
let t2;
|
|
5165
5546
|
if ($[3] !== t1) {
|
|
5166
5547
|
t2 = /* @__PURE__ */ jsx("span", {
|
|
5167
|
-
className:
|
|
5548
|
+
className: class_names_exports.WIKILINK_VIEW_LABEL_CLASS,
|
|
5168
5549
|
contentEditable: false,
|
|
5169
5550
|
children: t1
|
|
5170
5551
|
});
|
|
@@ -5174,7 +5555,7 @@ function WikilinkChip(props) {
|
|
|
5174
5555
|
let t3;
|
|
5175
5556
|
if ($[5] !== handleClick || $[6] !== t2) {
|
|
5176
5557
|
t3 = /* @__PURE__ */ jsx("span", {
|
|
5177
|
-
className:
|
|
5558
|
+
className: `${class_names_exports.WIKILINK_VIEW_PREVIEW_CLASS} ${class_names_exports.ATOM_VIEW_PREVIEW_CLASS}`,
|
|
5178
5559
|
"data-testid": "wikilink",
|
|
5179
5560
|
contentEditable: false,
|
|
5180
5561
|
onClick: handleClick,
|
|
@@ -5187,7 +5568,7 @@ function WikilinkChip(props) {
|
|
|
5187
5568
|
let t4;
|
|
5188
5569
|
if ($[8] !== children) {
|
|
5189
5570
|
t4 = /* @__PURE__ */ jsx("span", {
|
|
5190
|
-
className:
|
|
5571
|
+
className: `${class_names_exports.WIKILINK_VIEW_CONTENT_CLASS} ${class_names_exports.ATOM_VIEW_CONTENT_CLASS}`,
|
|
5191
5572
|
children
|
|
5192
5573
|
});
|
|
5193
5574
|
$[8] = children;
|
|
@@ -5196,7 +5577,7 @@ function WikilinkChip(props) {
|
|
|
5196
5577
|
let t5;
|
|
5197
5578
|
if ($[10] !== t3 || $[11] !== t4) {
|
|
5198
5579
|
t5 = /* @__PURE__ */ jsxs("span", {
|
|
5199
|
-
className:
|
|
5580
|
+
className: `${class_names_exports.WIKILINK_VIEW_CLASS} ${class_names_exports.ATOM_VIEW_CLASS}`,
|
|
5200
5581
|
children: [t3, t4]
|
|
5201
5582
|
});
|
|
5202
5583
|
$[10] = t3;
|
|
@@ -5217,7 +5598,7 @@ function PostEmbed(props) {
|
|
|
5217
5598
|
let t4;
|
|
5218
5599
|
if ($[0] !== kind || $[1] !== mediaUrlProtocols || $[2] !== resolveXPost || $[3] !== resolveYouTubeVideo || $[4] !== snapshot || $[5] !== src || $[6] !== width) {
|
|
5219
5600
|
const saved = snapshot == null ? void 0 : parsePostEmbedSnapshot(snapshot);
|
|
5220
|
-
t0 =
|
|
5601
|
+
t0 = `${class_names_exports.IMAGE_VIEW_PREVIEW_CLASS} ${class_names_exports.ATOM_VIEW_PREVIEW_CLASS}`;
|
|
5221
5602
|
t1 = false;
|
|
5222
5603
|
t2 = `${kind}-embed`;
|
|
5223
5604
|
t3 = kind;
|
|
@@ -5325,11 +5706,11 @@ function ImagePreview(props) {
|
|
|
5325
5706
|
let t4;
|
|
5326
5707
|
if ($[14] !== t2 || $[15] !== t3) {
|
|
5327
5708
|
t4 = /* @__PURE__ */ jsx("span", {
|
|
5328
|
-
className:
|
|
5709
|
+
className: `${class_names_exports.IMAGE_VIEW_PREVIEW_CLASS} ${class_names_exports.ATOM_VIEW_PREVIEW_CLASS}`,
|
|
5329
5710
|
"data-testid": "image-preview",
|
|
5330
5711
|
contentEditable: false,
|
|
5331
5712
|
children: /* @__PURE__ */ jsx("span", {
|
|
5332
|
-
className:
|
|
5713
|
+
className: class_names_exports.IMAGE_RESIZABLE_CLASS,
|
|
5333
5714
|
"data-testid": "image-resizable",
|
|
5334
5715
|
"data-loading": "",
|
|
5335
5716
|
style: {
|
|
@@ -5370,7 +5751,7 @@ function ImagePreview(props) {
|
|
|
5370
5751
|
let t4;
|
|
5371
5752
|
if ($[23] !== alt || $[24] !== handleClick || $[25] !== t3 || $[26] !== url) {
|
|
5372
5753
|
t4 = /* @__PURE__ */ jsx("span", {
|
|
5373
|
-
className:
|
|
5754
|
+
className: `${class_names_exports.IMAGE_VIEW_PREVIEW_CLASS} ${class_names_exports.ATOM_VIEW_PREVIEW_CLASS}`,
|
|
5374
5755
|
"data-testid": "image-preview",
|
|
5375
5756
|
contentEditable: false,
|
|
5376
5757
|
children: /* @__PURE__ */ jsx("img", {
|
|
@@ -5423,7 +5804,7 @@ function ImageView(props) {
|
|
|
5423
5804
|
let t1;
|
|
5424
5805
|
if ($[12] !== children) {
|
|
5425
5806
|
t1 = /* @__PURE__ */ jsx("span", {
|
|
5426
|
-
className:
|
|
5807
|
+
className: `${class_names_exports.IMAGE_VIEW_CONTENT_CLASS} ${class_names_exports.ATOM_VIEW_CONTENT_CLASS}`,
|
|
5427
5808
|
children
|
|
5428
5809
|
});
|
|
5429
5810
|
$[12] = children;
|
|
@@ -5432,7 +5813,7 @@ function ImageView(props) {
|
|
|
5432
5813
|
let t2;
|
|
5433
5814
|
if ($[14] !== t0 || $[15] !== t1) {
|
|
5434
5815
|
t2 = /* @__PURE__ */ jsxs("span", {
|
|
5435
|
-
className:
|
|
5816
|
+
className: `${class_names_exports.IMAGE_VIEW_CLASS} ${class_names_exports.ATOM_VIEW_CLASS}`,
|
|
5436
5817
|
children: [t0, t1]
|
|
5437
5818
|
});
|
|
5438
5819
|
$[14] = t0;
|
|
@@ -5508,7 +5889,7 @@ function FileView(props) {
|
|
|
5508
5889
|
let t4;
|
|
5509
5890
|
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
5510
5891
|
t4 = /* @__PURE__ */ jsxs("svg", {
|
|
5511
|
-
className:
|
|
5892
|
+
className: class_names_exports.FILE_VIEW_ICON_CLASS,
|
|
5512
5893
|
viewBox: "0 0 24 24",
|
|
5513
5894
|
"aria-hidden": "true",
|
|
5514
5895
|
fill: "none",
|
|
@@ -5523,7 +5904,7 @@ function FileView(props) {
|
|
|
5523
5904
|
let t5;
|
|
5524
5905
|
if ($[11] !== name) {
|
|
5525
5906
|
t5 = /* @__PURE__ */ jsx("span", {
|
|
5526
|
-
className:
|
|
5907
|
+
className: class_names_exports.FILE_VIEW_NAME_CLASS,
|
|
5527
5908
|
children: name
|
|
5528
5909
|
});
|
|
5529
5910
|
$[11] = name;
|
|
@@ -5532,7 +5913,7 @@ function FileView(props) {
|
|
|
5532
5913
|
let t6;
|
|
5533
5914
|
if ($[13] !== size) {
|
|
5534
5915
|
t6 = /* @__PURE__ */ jsx("span", {
|
|
5535
|
-
className:
|
|
5916
|
+
className: class_names_exports.FILE_VIEW_SIZE_CLASS,
|
|
5536
5917
|
"data-testid": "file-pill-size",
|
|
5537
5918
|
children: size
|
|
5538
5919
|
});
|
|
@@ -5542,7 +5923,7 @@ function FileView(props) {
|
|
|
5542
5923
|
let t7;
|
|
5543
5924
|
if ($[15] !== handleClick || $[16] !== name || $[17] !== t3 || $[18] !== t5 || $[19] !== t6) {
|
|
5544
5925
|
t7 = /* @__PURE__ */ jsxs("span", {
|
|
5545
|
-
className:
|
|
5926
|
+
className: `${class_names_exports.FILE_VIEW_PREVIEW_CLASS} ${class_names_exports.ATOM_VIEW_PREVIEW_CLASS}`,
|
|
5546
5927
|
"data-testid": "file-pill",
|
|
5547
5928
|
"data-file-kind": t3,
|
|
5548
5929
|
contentEditable: false,
|
|
@@ -5564,7 +5945,7 @@ function FileView(props) {
|
|
|
5564
5945
|
let t8;
|
|
5565
5946
|
if ($[21] !== children) {
|
|
5566
5947
|
t8 = /* @__PURE__ */ jsx("span", {
|
|
5567
|
-
className:
|
|
5948
|
+
className: `${class_names_exports.FILE_VIEW_CONTENT_CLASS} ${class_names_exports.ATOM_VIEW_CONTENT_CLASS}`,
|
|
5568
5949
|
children
|
|
5569
5950
|
});
|
|
5570
5951
|
$[21] = children;
|
|
@@ -5573,7 +5954,7 @@ function FileView(props) {
|
|
|
5573
5954
|
let t9;
|
|
5574
5955
|
if ($[23] !== t7 || $[24] !== t8) {
|
|
5575
5956
|
t9 = /* @__PURE__ */ jsxs("span", {
|
|
5576
|
-
className:
|
|
5957
|
+
className: `${class_names_exports.FILE_VIEW_CLASS} ${class_names_exports.ATOM_VIEW_CLASS}`,
|
|
5577
5958
|
children: [t7, t8]
|
|
5578
5959
|
});
|
|
5579
5960
|
$[23] = t7;
|
|
@@ -5661,7 +6042,7 @@ function MathView(props) {
|
|
|
5661
6042
|
katex,
|
|
5662
6043
|
formula,
|
|
5663
6044
|
displayMode: false,
|
|
5664
|
-
className:
|
|
6045
|
+
className: class_names_exports.MATH_VIEW_PREVIEW_CLASS,
|
|
5665
6046
|
"data-testid": "math-preview"
|
|
5666
6047
|
});
|
|
5667
6048
|
$[2] = formula;
|
|
@@ -5671,7 +6052,7 @@ function MathView(props) {
|
|
|
5671
6052
|
let t1;
|
|
5672
6053
|
if ($[5] !== children) {
|
|
5673
6054
|
t1 = /* @__PURE__ */ jsx("span", {
|
|
5674
|
-
className:
|
|
6055
|
+
className: class_names_exports.MATH_VIEW_CONTENT_CLASS,
|
|
5675
6056
|
children
|
|
5676
6057
|
});
|
|
5677
6058
|
$[5] = children;
|
|
@@ -5680,7 +6061,7 @@ function MathView(props) {
|
|
|
5680
6061
|
let t2;
|
|
5681
6062
|
if ($[7] !== t0 || $[8] !== t1) {
|
|
5682
6063
|
t2 = /* @__PURE__ */ jsxs("span", {
|
|
5683
|
-
className:
|
|
6064
|
+
className: class_names_exports.MATH_VIEW_CLASS,
|
|
5684
6065
|
children: [t0, t1]
|
|
5685
6066
|
});
|
|
5686
6067
|
$[7] = t0;
|
|
@@ -5805,7 +6186,7 @@ function wrapMark(mark, children, context) {
|
|
|
5805
6186
|
case "mdLinkText": {
|
|
5806
6187
|
const attrs = mark.attrs;
|
|
5807
6188
|
if (!context.interactive) return /* @__PURE__ */ jsx("span", {
|
|
5808
|
-
className:
|
|
6189
|
+
className: class_names_exports.LINK_TEXT_MARK_CLASS,
|
|
5809
6190
|
children
|
|
5810
6191
|
});
|
|
5811
6192
|
const handleClick = context.onLinkClick ? (event) => {
|
|
@@ -5817,7 +6198,7 @@ function wrapMark(mark, children, context) {
|
|
|
5817
6198
|
});
|
|
5818
6199
|
} : void 0;
|
|
5819
6200
|
return /* @__PURE__ */ jsx("a", {
|
|
5820
|
-
className:
|
|
6201
|
+
className: class_names_exports.LINK_TEXT_MARK_CLASS,
|
|
5821
6202
|
href: attrs.href,
|
|
5822
6203
|
onClick: handleClick,
|
|
5823
6204
|
children
|
|
@@ -6098,7 +6479,7 @@ function MarkdownView(t0) {
|
|
|
6098
6479
|
const rootRef = t16;
|
|
6099
6480
|
let t17;
|
|
6100
6481
|
if ($[31] !== className) {
|
|
6101
|
-
t17 = clsx("ProseMirror",
|
|
6482
|
+
t17 = clsx("ProseMirror", class_names_exports.CONTENT_CLASS, className);
|
|
6102
6483
|
$[31] = className;
|
|
6103
6484
|
$[32] = t17;
|
|
6104
6485
|
} else t17 = $[32];
|
|
@@ -6379,7 +6760,6 @@ function LightboxImage(t0) {
|
|
|
6379
6760
|
}
|
|
6380
6761
|
|
|
6381
6762
|
// src/components/lightbox-root.tsx
|
|
6382
|
-
const DIALOG_TRANSITION_CLASS = "meowdown-lightbox-dialog";
|
|
6383
6763
|
function showModal(dialog) {
|
|
6384
6764
|
const active = document.activeElement;
|
|
6385
6765
|
if (active instanceof HTMLElement && active.isContentEditable) active.blur();
|
|
@@ -6470,7 +6850,7 @@ function LightboxRoot(t0) {
|
|
|
6470
6850
|
let t8;
|
|
6471
6851
|
if ($[22] !== t1 || $[23] !== t7) {
|
|
6472
6852
|
t8 = /* @__PURE__ */ jsx(ViewTransition, {
|
|
6473
|
-
default:
|
|
6853
|
+
default: LIGHTBOX_DIALOG_TRANSITION_CLASS,
|
|
6474
6854
|
onExit: t1,
|
|
6475
6855
|
children: t7
|
|
6476
6856
|
});
|