@pstdio/ui 0.16.0 → 0.18.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/{MermaidComponent-BCMQqPqu.js → MermaidComponent-BPiVFNYK.js} +2 -2
- package/dist/{MermaidComponent-BCMQqPqu.js.map → MermaidComponent-BPiVFNYK.js.map} +1 -1
- package/dist/chat-ui.js +1618 -1102
- package/dist/chat-ui.js.map +1 -1
- package/dist/{checkbox-D5AzFRlb.js → checkbox-B2zYVemL.js} +28 -28
- package/dist/checkbox-B2zYVemL.js.map +1 -0
- package/dist/components/chat-ui/components/chat-input-actions.d.ts +1 -0
- package/dist/components/chat-ui/components/chat-input.d.ts +8 -2
- package/dist/components/chat-ui/components/chat-panel.d.ts +11 -5
- package/dist/components/chat-ui/components/composer-constants.d.ts +1 -0
- package/dist/components/chat-ui/components/conversation-browse.d.ts +22 -0
- package/dist/components/chat-ui/components/message-types.d.ts +14 -0
- package/dist/components/chat-ui/components/queued-follow-up-list-state.d.ts +4 -0
- package/dist/components/chat-ui/components/queued-follow-up-list.d.ts +11 -0
- package/dist/components/chat-ui/components/timeline.d.ts +5 -0
- package/dist/components/chat-ui/components/working-indicator.d.ts +9 -0
- package/dist/components/chat-ui/components/workspace-hub.d.ts +8 -1
- package/dist/components/chat-ui/index.d.ts +4 -2
- package/dist/components/chat-ui/tool-rendering/build-timeline.d.ts +2 -2
- package/dist/components/chat-ui/tool-rendering/question-prompt.d.ts +9 -0
- package/dist/components/data-table/build-columns.d.ts +13 -2
- package/dist/components/data-table/categorical-color-cell.d.ts +8 -0
- package/dist/components/data-table/color-cell-style.d.ts +13 -0
- package/dist/components/data-table/color-scale-cell.d.ts +7 -0
- package/dist/components/data-table/data-table-column-menu.d.ts +15 -0
- package/dist/components/data-table/data-table-header.d.ts +10 -0
- package/dist/components/data-table/data-table-stat-chart.d.ts +21 -0
- package/dist/components/data-table/data-table-state.d.ts +27 -0
- package/dist/components/data-table/data-table-stats-row.d.ts +11 -0
- package/dist/components/data-table/data-table-stats.d.ts +19 -0
- package/dist/components/data-table/data-table-table-parts.d.ts +21 -0
- package/dist/components/data-table/data-table.story-descriptions.d.ts +6 -0
- package/dist/components/data-table/data-table.story-fixtures.d.ts +6 -0
- package/dist/components/data-table/editable-cells-story.d.ts +9 -0
- package/dist/components/data-table/friendly-json-display.d.ts +31 -0
- package/dist/components/data-table/index.d.ts +3 -1
- package/dist/components/data-table/json-cell.d.ts +6 -0
- package/dist/components/data-table/pagination-footer.d.ts +4 -1
- package/dist/components/data-table/selection-toolbar.d.ts +3 -1
- package/dist/components/data-table/types.d.ts +72 -0
- package/dist/components/diff-viewer/code-editor.d.ts +2 -0
- package/dist/components/diff-viewer/index.d.ts +1 -1
- package/dist/components/diff-viewer/monaco-browser.d.ts +1 -0
- package/dist/components/{data-renderer → kanban-renderer}/display-menu.d.ts +4 -4
- package/dist/components/{data-renderer → kanban-renderer}/filter-menu.d.ts +3 -3
- package/dist/components/kanban-renderer/index.d.ts +19 -0
- package/dist/components/kanban-renderer/kanban-renderer-attribute-badge.d.ts +7 -0
- package/dist/components/{data-renderer/data-renderer-board-column-header.d.ts → kanban-renderer/kanban-renderer-board-column-header.d.ts} +2 -2
- package/dist/components/{data-renderer/data-renderer-board-group-section.d.ts → kanban-renderer/kanban-renderer-board-group-section.d.ts} +2 -2
- package/dist/components/{data-renderer/data-renderer-board-move.d.ts → kanban-renderer/kanban-renderer-board-move.d.ts} +3 -3
- package/dist/components/{data-renderer/data-renderer-board.d.ts → kanban-renderer/kanban-renderer-board.d.ts} +15 -14
- package/dist/components/{data-renderer/data-renderer-card.d.ts → kanban-renderer/kanban-renderer-card.d.ts} +4 -3
- package/dist/components/{data-renderer/data-renderer-content.d.ts → kanban-renderer/kanban-renderer-content.d.ts} +8 -8
- package/dist/components/kanban-renderer/kanban-renderer-create-dialog.d.ts +12 -0
- package/dist/components/kanban-renderer/kanban-renderer-create-field.d.ts +10 -0
- package/dist/components/kanban-renderer/kanban-renderer-grouping.d.ts +23 -0
- package/dist/components/{data-renderer/data-renderer-helpers.d.ts → kanban-renderer/kanban-renderer-helpers.d.ts} +15 -15
- package/dist/components/kanban-renderer/kanban-renderer-list-items.d.ts +25 -0
- package/dist/components/kanban-renderer/kanban-renderer-list.d.ts +43 -0
- package/dist/components/{data-renderer/data-renderer-story-fixtures.d.ts → kanban-renderer/kanban-renderer-story-fixtures.d.ts} +3 -2
- package/dist/components/kanban-renderer/kanban-renderer-toolbar.d.ts +15 -0
- package/dist/components/kanban-renderer/kanban-renderer-view-bar.d.ts +14 -0
- package/dist/components/kanban-renderer/kanban-renderer-views.d.ts +12 -0
- package/dist/components/{data-renderer/data-renderer.d.ts → kanban-renderer/kanban-renderer.d.ts} +11 -8
- package/dist/components/{data-renderer → kanban-renderer}/types.d.ts +51 -8
- package/dist/components/kanban-renderer/use-kanban-renderer-store.d.ts +78 -0
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/panel-header.constants.d.ts +2 -0
- package/dist/components/layout/resizable-split-layout.d.ts +3 -2
- package/dist/components/layout/resizable-split-layout.geometry.d.ts +56 -0
- package/dist/components/layout/resizable-split-layout.handle.d.ts +6 -2
- package/dist/components/layout/resizable-split-layout.panels.d.ts +25 -0
- package/dist/components/list-row/list-row-actions.d.ts +1 -0
- package/dist/components/list-row/list-row-content.d.ts +7 -0
- package/dist/components/list-row/list-row.types.d.ts +4 -1
- package/dist/components/overlays/attached-menu.d.ts +6 -0
- package/dist/components/overlays/attachment-chip.d.ts +13 -0
- package/dist/components/overlays/index.d.ts +6 -2
- package/dist/components/overlays/resource-context-menu.d.ts +13 -1
- package/dist/components/overlays/searchable-menu-input.d.ts +9 -0
- package/dist/components/param-editor/index.d.ts +6 -2
- package/dist/components/param-editor/inputs/action-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/boolean-input.d.ts +13 -0
- package/dist/components/param-editor/inputs/color-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/date-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/file-upload-input.d.ts +15 -0
- package/dist/components/param-editor/inputs/file-upload-value.d.ts +7 -0
- package/dist/components/param-editor/inputs/horizontal-text-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/markdown-input.d.ts +13 -0
- package/dist/components/param-editor/inputs/number-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/range-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/resource-input.d.ts +2 -0
- package/dist/components/param-editor/inputs/segmented-input.d.ts +1 -0
- package/dist/components/param-editor/inputs/selection-input.d.ts +7 -6
- package/dist/components/param-editor/inputs/selection-menu.d.ts +33 -0
- package/dist/components/param-editor/inputs/text-input.d.ts +1 -0
- package/dist/components/param-editor/param-editor-advanced-field.d.ts +14 -0
- package/dist/components/param-editor/param-editor-control-fixtures.d.ts +24 -0
- package/dist/components/param-editor/param-editor-field.d.ts +2 -0
- package/dist/components/param-editor/param-editor-horizontal.d.ts +3 -2
- package/dist/components/param-editor/param-editor-label.d.ts +1 -0
- package/dist/components/param-editor/param-editor-presentation.d.ts +3 -0
- package/dist/components/param-editor/param-editor-read-only-field.d.ts +9 -0
- package/dist/components/param-editor/param-editor-section.d.ts +1 -0
- package/dist/components/param-editor/param-editor.d.ts +1 -0
- package/dist/components/param-editor/param-editor.types.d.ts +59 -18
- package/dist/components/param-editor/resolve-param-value.d.ts +2 -0
- package/dist/components/primitives/chip.d.ts +4 -0
- package/dist/components/primitives/index.d.ts +2 -0
- package/dist/components/primitives/resource-badge.d.ts +12 -10
- package/dist/components/rich-text/index.d.ts +1 -0
- package/dist/components/rich-text/lazy-markdown-editor.d.ts +2 -0
- package/dist/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/ReferenceMenuPlugin.d.ts +2 -1
- package/dist/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/hooks/useContextLookup.d.ts +2 -1
- package/dist/components/rich-text/prompt-input/plugins/ReferencePlugin/ReferencePlugin.d.ts +2 -1
- package/dist/components/rich-text/prompt-input/prompt-input.d.ts +3 -2
- package/dist/components/rich-text/types.d.ts +1 -1
- package/dist/components/rich-text/utils/inferResourceType.d.ts +1 -1
- package/dist/components/{sidebar/sidebar-footer.d.ts → sidenav/sidenav-footer.d.ts} +2 -2
- package/dist/components/{sidebar/sidebar-header.d.ts → sidenav/sidenav-header.d.ts} +2 -2
- package/dist/components/sidenav/sidenav.d.ts +2 -0
- package/dist/components/sidenav/sidenav.store.d.ts +49 -0
- package/dist/components/{sidebar/sidebar.types.d.ts → sidenav/sidenav.types.d.ts} +5 -5
- package/dist/components/tab-strip/tab-visibility-filter.d.ts +1 -0
- package/dist/components/terminal/terminal.d.ts +11 -0
- package/dist/components/tree-list/tree-list-visibility-filter.d.ts +0 -1
- package/dist/components/tree-list/tree-list.d.ts +1 -1
- package/dist/components/tree-list/tree-list.types.d.ts +4 -0
- package/dist/data-table.js +1321 -0
- package/dist/data-table.js.map +1 -0
- package/dist/diff.js +370 -366
- package/dist/diff.js.map +1 -1
- package/dist/font/css/prompt-studio-icons.css +690 -0
- package/dist/font/prompt-studio-icons.eot +0 -0
- package/dist/font/prompt-studio-icons.svg +1 -0
- package/dist/font/prompt-studio-icons.ttf +0 -0
- package/dist/font/prompt-studio-icons.woff +0 -0
- package/dist/font/prompt-studio-icons.woff2 +0 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1854 -3381
- package/dist/index.js.map +1 -1
- package/dist/kanban-renderer-toolbar-Db1mIWWd.js +1318 -0
- package/dist/kanban-renderer-toolbar-Db1mIWWd.js.map +1 -0
- package/dist/kanban-renderer.js +1101 -0
- package/dist/kanban-renderer.js.map +1 -0
- package/dist/lazy-markdown-editor-DwhqQ-NN.js +26 -0
- package/dist/lazy-markdown-editor-DwhqQ-NN.js.map +1 -0
- package/dist/list-row-BYWwcbGK.js +823 -0
- package/dist/list-row-BYWwcbGK.js.map +1 -0
- package/dist/markdown-DDd2ESoH.js +743 -0
- package/dist/markdown-DDd2ESoH.js.map +1 -0
- package/dist/markdown-editor-CYVkzt8t.js +741 -0
- package/dist/markdown-editor-CYVkzt8t.js.map +1 -0
- package/dist/monaco-browser-CO0NxK_Z.js +19 -0
- package/dist/monaco-browser-CO0NxK_Z.js.map +1 -0
- package/dist/param-editor-BCZOw5Gt.js +140 -0
- package/dist/param-editor-BCZOw5Gt.js.map +1 -0
- package/dist/param-editor-field-ZzZwgjZ_.js +2094 -0
- package/dist/param-editor-field-ZzZwgjZ_.js.map +1 -0
- package/dist/resource-badge-CuItchgL.js +98 -0
- package/dist/resource-badge-CuItchgL.js.map +1 -0
- package/dist/rich-message--eRzjWYK.js +730 -0
- package/dist/rich-message--eRzjWYK.js.map +1 -0
- package/dist/rich-text.js +114 -827
- package/dist/rich-text.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/terminal.js +197 -177
- package/dist/terminal.js.map +1 -1
- package/dist/theme/primitives/fonts.d.ts +3 -0
- package/dist/theme/primitives/sizes.d.ts +23 -0
- package/dist/theme/recipes/badge.d.ts +8 -0
- package/dist/theme/recipes/button.d.ts +6 -0
- package/dist/theme/recipes/color-picker.d.ts +18 -1
- package/dist/theme/recipes/switch.d.ts +17 -0
- package/dist/theme/recipes/tabs.d.ts +4 -4
- package/dist/theme/tokens/colors.d.ts +18 -24
- package/dist/{theme-CJBYBJaA.js → theme-poQlUgt0.js} +414 -240
- package/dist/theme-poQlUgt0.js.map +1 -0
- package/dist/theme.js +1 -1
- package/dist/tree-list-BAja2eXU.js +1033 -0
- package/dist/tree-list-BAja2eXU.js.map +1 -0
- package/package.json +11 -4
- package/dist/checkbox-D5AzFRlb.js.map +0 -1
- package/dist/components/data-renderer/card-interaction-guard.d.ts +0 -2
- package/dist/components/data-renderer/data-renderer-attribute-badge.d.ts +0 -7
- package/dist/components/data-renderer/data-renderer-grouping.d.ts +0 -23
- package/dist/components/data-renderer/data-renderer-list.d.ts +0 -39
- package/dist/components/data-renderer/data-renderer-toolbar.d.ts +0 -12
- package/dist/components/data-renderer/index.d.ts +0 -18
- package/dist/components/data-renderer/use-data-renderer-store.d.ts +0 -59
- package/dist/components/param-editor/inputs/file-accept.d.ts +0 -22
- package/dist/components/param-editor/inputs/file-drop-input.d.ts +0 -14
- package/dist/components/sidebar/sidebar.d.ts +0 -2
- package/dist/components/sidebar/sidebar.store.d.ts +0 -49
- package/dist/data-renderer.js +0 -1669
- package/dist/data-renderer.js.map +0 -1
- package/dist/list-row-mi3Hn-Um.js +0 -740
- package/dist/list-row-mi3Hn-Um.js.map +0 -1
- package/dist/resource-badge-qCWHP-wQ.js +0 -99
- package/dist/resource-badge-qCWHP-wQ.js.map +0 -1
- package/dist/rich-message-DBf_5YlW.js +0 -1450
- package/dist/rich-message-DBf_5YlW.js.map +0 -1
- package/dist/theme-CJBYBJaA.js.map +0 -1
- package/dist/tree-list-CcuZMLS5.js +0 -930
- package/dist/tree-list-CcuZMLS5.js.map +0 -1
- package/dist/workspace-badge-Fuo-1zPj.js +0 -314
- package/dist/workspace-badge-Fuo-1zPj.js.map +0 -1
- /package/dist/components/{data-renderer/data-renderer-badge-helpers.d.ts → kanban-renderer/kanban-renderer-badge-helpers.d.ts} +0 -0
- /package/dist/components/{data-renderer/data-renderer-enum-helpers.d.ts → kanban-renderer/kanban-renderer-enum-helpers.d.ts} +0 -0
- /package/dist/components/{data-renderer → kanban-renderer}/use-resolved-attributes.d.ts +0 -0
package/dist/rich-text.js
CHANGED
|
@@ -1,423 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import { e as
|
|
4
|
-
import { D as
|
|
5
|
-
import {
|
|
6
|
-
import { LexicalCollaboration as
|
|
7
|
-
import { CollaborationPluginV2__EXPERIMENTAL as
|
|
8
|
-
import { LexicalComposer as
|
|
9
|
-
import { LexicalErrorBoundary as
|
|
10
|
-
import { HorizontalRulePlugin as
|
|
11
|
-
import { LinkPlugin as
|
|
12
|
-
import { ListPlugin as
|
|
13
|
-
import { RichTextPlugin as
|
|
14
|
-
import { TabIndentationPlugin as
|
|
15
|
-
import {
|
|
16
|
-
import { WebsocketProvider as
|
|
17
|
-
import * as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
import { $isCodeNode as we, $createCodeNode as zt } from "@lexical/code";
|
|
25
|
-
import { $isLinkNode as re, $isAutoLinkNode as pe, TOGGLE_LINK_COMMAND as De, $createLinkNode as $t } from "@lexical/link";
|
|
26
|
-
import { $isListNode as Ne, REMOVE_LIST_COMMAND as Ut, INSERT_CHECK_LIST_COMMAND as Ht, INSERT_ORDERED_LIST_COMMAND as Ft, INSERT_UNORDERED_LIST_COMMAND as jt } from "@lexical/list";
|
|
27
|
-
import { $isHeadingNode as Kt, $createHeadingNode as Wt } from "@lexical/rich-text";
|
|
28
|
-
import { $isAtNodeEnd as je, $setBlocksType as _e } from "@lexical/selection";
|
|
29
|
-
import { $convertFromMarkdownString as Gt, $convertToMarkdownString as Vt } from "@lexical/markdown";
|
|
30
|
-
import { AutoFocusPlugin as qt } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
31
|
-
import { CheckListPlugin as Yt } from "@lexical/react/LexicalCheckListPlugin";
|
|
32
|
-
import { HistoryPlugin as Xt } from "@lexical/react/LexicalHistoryPlugin";
|
|
33
|
-
import { MarkdownShortcutPlugin as Qt } from "@lexical/react/LexicalMarkdownShortcutPlugin";
|
|
34
|
-
import { OnChangePlugin as Zt } from "@lexical/react/LexicalOnChangePlugin";
|
|
35
|
-
function Ie(t) {
|
|
36
|
-
const e = ee();
|
|
37
|
-
if (!Q(e))
|
|
38
|
-
return null;
|
|
39
|
-
const r = e.anchor.getNode(), o = we(r) ? r : Z(r, (u) => we(u));
|
|
40
|
-
if (!we(o))
|
|
41
|
-
return null;
|
|
42
|
-
const l = t.getElementByKey(o.getKey());
|
|
43
|
-
return l instanceof HTMLElement ? l : null;
|
|
44
|
-
}
|
|
45
|
-
function Jt(t) {
|
|
46
|
-
return t instanceof HTMLElement ? t.closest(".rich-text__code") : null;
|
|
47
|
-
}
|
|
48
|
-
function en(t, e) {
|
|
49
|
-
const r = t.getBoundingClientRect(), o = e.getBoundingClientRect();
|
|
50
|
-
return {
|
|
51
|
-
top: o.top - r.top + 6,
|
|
52
|
-
left: o.right - r.left - 30
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function rt(t) {
|
|
56
|
-
const e = te(31), {
|
|
57
|
-
anchorElem: r
|
|
58
|
-
} = t, [o] = $e(), [l, u] = A(null), [L, h] = A(!1), a = ie(null);
|
|
59
|
-
let p, E;
|
|
60
|
-
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = () => () => {
|
|
61
|
-
a.current !== null && window.clearTimeout(a.current);
|
|
62
|
-
}, E = [], e[0] = p, e[1] = E) : (p = e[0], E = e[1]), Y(p, E);
|
|
63
|
-
let b, d;
|
|
64
|
-
e[2] !== o ? (b = () => {
|
|
65
|
-
const _ = o.getRootElement();
|
|
66
|
-
if (!_)
|
|
67
|
-
return;
|
|
68
|
-
const k = (I) => {
|
|
69
|
-
const M = Jt(I.target);
|
|
70
|
-
u(M instanceof HTMLElement ? M : null);
|
|
71
|
-
}, N = () => {
|
|
72
|
-
o.getEditorState().read(() => {
|
|
73
|
-
const I = Ie(o);
|
|
74
|
-
u(I);
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
return _.addEventListener("pointermove", k), _.addEventListener("pointerleave", N), () => {
|
|
78
|
-
_.removeEventListener("pointermove", k), _.removeEventListener("pointerleave", N);
|
|
79
|
-
};
|
|
80
|
-
}, d = [o], e[2] = o, e[3] = b, e[4] = d) : (b = e[3], d = e[4]), Y(b, d);
|
|
81
|
-
let C, R;
|
|
82
|
-
if (e[5] !== o ? (C = () => Le(o.registerUpdateListener((_) => {
|
|
83
|
-
const {
|
|
84
|
-
editorState: k
|
|
85
|
-
} = _;
|
|
86
|
-
k.read(() => {
|
|
87
|
-
const N = Ie(o);
|
|
88
|
-
N && u(N);
|
|
89
|
-
});
|
|
90
|
-
}), o.registerCommand(Se, () => (o.getEditorState().read(() => {
|
|
91
|
-
const _ = Ie(o);
|
|
92
|
-
if (!_) {
|
|
93
|
-
u(tn);
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
u(_);
|
|
97
|
-
}), !1), Ue)), R = [o], e[5] = o, e[6] = C, e[7] = R) : (C = e[6], R = e[7]), Y(C, R), !r || !l)
|
|
98
|
-
return null;
|
|
99
|
-
let c;
|
|
100
|
-
e[8] !== l || e[9] !== r ? (c = en(r, l), e[8] = l, e[9] = r, e[10] = c) : c = e[10];
|
|
101
|
-
const w = c;
|
|
102
|
-
let v;
|
|
103
|
-
e[11] !== w.left || e[12] !== w.top ? (v = {
|
|
104
|
-
position: "absolute",
|
|
105
|
-
top: w.top,
|
|
106
|
-
left: w.left
|
|
107
|
-
}, e[11] = w.left, e[12] = w.top, e[13] = v) : v = e[13];
|
|
108
|
-
const S = v, g = L ? "Copied" : "Copy code", f = L ? "Copied" : "Copy code";
|
|
109
|
-
let i;
|
|
110
|
-
e[14] !== l.textContent ? (i = async () => {
|
|
111
|
-
const _ = l.textContent ?? "";
|
|
112
|
-
try {
|
|
113
|
-
await navigator.clipboard.writeText(_), h(!0), a.current !== null && window.clearTimeout(a.current), a.current = window.setTimeout(() => {
|
|
114
|
-
h(!1);
|
|
115
|
-
}, 1200);
|
|
116
|
-
} catch {
|
|
117
|
-
h(!1);
|
|
118
|
-
}
|
|
119
|
-
}, e[14] = l.textContent, e[15] = i) : i = e[15];
|
|
120
|
-
let s;
|
|
121
|
-
e[16] !== L ? (s = L ? /* @__PURE__ */ n(lt, { size: 14 }) : /* @__PURE__ */ n(wt, { size: 14 }), e[16] = L, e[17] = s) : s = e[17];
|
|
122
|
-
let m;
|
|
123
|
-
e[18] !== f || e[19] !== i || e[20] !== s ? (m = /* @__PURE__ */ n(K, { "aria-label": f, variant: "subtle", size: "xs", onClick: i, children: s }), e[18] = f, e[19] = i, e[20] = s, e[21] = m) : m = e[21];
|
|
124
|
-
let y;
|
|
125
|
-
e[22] !== m || e[23] !== g ? (y = /* @__PURE__ */ n(W, { content: g, children: m }), e[22] = m, e[23] = g, e[24] = y) : y = e[24];
|
|
126
|
-
let x;
|
|
127
|
-
e[25] !== S || e[26] !== y ? (x = /* @__PURE__ */ n("div", { className: "code-block-actions", style: S, children: y }), e[25] = S, e[26] = y, e[27] = x) : x = e[27];
|
|
128
|
-
let T;
|
|
129
|
-
return e[28] !== r || e[29] !== x ? (T = He(x, r), e[28] = r, e[29] = x, e[30] = T) : T = e[30], T;
|
|
130
|
-
}
|
|
131
|
-
function tn(t) {
|
|
132
|
-
return t?.matches(":hover") ? t : null;
|
|
133
|
-
}
|
|
134
|
-
const st = Lt("TOGGLE_LINK_EDIT_MODE_COMMAND");
|
|
135
|
-
function ge(t) {
|
|
136
|
-
const e = t.anchor, r = t.focus, o = t.anchor.getNode(), l = t.focus.getNode();
|
|
137
|
-
return o === l ? o : t.isBackward() ? je(r) ? o : l : je(e) ? o : l;
|
|
138
|
-
}
|
|
139
|
-
const nn = 10, on = 5;
|
|
140
|
-
function ke(t, e, r, o = nn, l = on, u = "legacy") {
|
|
141
|
-
const L = r.parentElement;
|
|
142
|
-
if (t === null || !L) {
|
|
143
|
-
e.style.opacity = "0", e.style.transform = "translate(-10000px, -10000px)";
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const h = e.getBoundingClientRect(), a = r.getBoundingClientRect(), p = L.getBoundingClientRect();
|
|
147
|
-
let E = u === "above" ? t.top - h.height - o : t.top - o, b = t.left - l;
|
|
148
|
-
E < p.top && (E = u === "above" ? t.bottom + o : E + h.height + t.height + o * 2), b + h.width > p.right && (b = p.right - h.width - l), E -= a.top, b -= a.left, e.style.opacity = "1", e.style.transform = `translate(${b}px, ${E}px)`;
|
|
149
|
-
}
|
|
150
|
-
function Pe() {
|
|
151
|
-
const t = te(1);
|
|
152
|
-
let e;
|
|
153
|
-
return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n("span", { style: {
|
|
154
|
-
display: "inline-flex",
|
|
155
|
-
height: "1rem",
|
|
156
|
-
margin: "0 0.25rem",
|
|
157
|
-
borderLeft: "1px solid var(--chakra-colors-border-subtle)"
|
|
158
|
-
} }), t[0] = e) : e = t[0], e;
|
|
159
|
-
}
|
|
160
|
-
function ln(t) {
|
|
161
|
-
const e = te(81), {
|
|
162
|
-
editor: r,
|
|
163
|
-
blockType: o,
|
|
164
|
-
isBold: l,
|
|
165
|
-
isItalic: u,
|
|
166
|
-
isUnderline: L,
|
|
167
|
-
isLink: h,
|
|
168
|
-
formatHeading: a,
|
|
169
|
-
formatList: p,
|
|
170
|
-
formatCodeBlock: E,
|
|
171
|
-
insertLink: b
|
|
172
|
-
} = t, d = l || void 0;
|
|
173
|
-
let C;
|
|
174
|
-
e[0] !== r ? (C = () => r.dispatchCommand(Re, "bold"), e[0] = r, e[1] = C) : C = e[1];
|
|
175
|
-
let R;
|
|
176
|
-
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ n(ue, { fontWeight: "bold", fontSize: ".75rem", children: "B" }), e[2] = R) : R = e[2];
|
|
177
|
-
let c;
|
|
178
|
-
e[3] !== d || e[4] !== C ? (c = /* @__PURE__ */ n(W, { content: "Bold", children: /* @__PURE__ */ n(K, { "data-active": d, onClick: C, variant: "ghost", "aria-label": "Bold", size: "xs", children: R }) }), e[3] = d, e[4] = C, e[5] = c) : c = e[5];
|
|
179
|
-
const w = u || void 0;
|
|
180
|
-
let v;
|
|
181
|
-
e[6] !== r ? (v = () => r.dispatchCommand(Re, "italic"), e[6] = r, e[7] = v) : v = e[7];
|
|
182
|
-
let S;
|
|
183
|
-
e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ n(ue, { fontStyle: "italic", fontSize: ".75rem", children: "I" }), e[8] = S) : S = e[8];
|
|
184
|
-
let g;
|
|
185
|
-
e[9] !== w || e[10] !== v ? (g = /* @__PURE__ */ n(W, { content: "Italic", children: /* @__PURE__ */ n(K, { "data-active": w, onClick: v, variant: "ghost", "aria-label": "Italic", size: "xs", children: S }) }), e[9] = w, e[10] = v, e[11] = g) : g = e[11];
|
|
186
|
-
const f = L || void 0;
|
|
187
|
-
let i;
|
|
188
|
-
e[12] !== r ? (i = () => r.dispatchCommand(Re, "underline"), e[12] = r, e[13] = i) : i = e[13];
|
|
189
|
-
let s;
|
|
190
|
-
e[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ n(ue, { textDecoration: "underline", fontSize: ".75rem", children: "U" }), e[14] = s) : s = e[14];
|
|
191
|
-
let m;
|
|
192
|
-
e[15] !== f || e[16] !== i ? (m = /* @__PURE__ */ n(W, { content: "Underline", children: /* @__PURE__ */ n(K, { "data-active": f, onClick: i, variant: "ghost", "aria-label": "Underline", size: "xs", children: s }) }), e[15] = f, e[16] = i, e[17] = m) : m = e[17];
|
|
193
|
-
const y = h ? "Remove Link" : "Insert Link", x = h || void 0, T = h ? "Remove Link" : "Insert Link";
|
|
194
|
-
let _;
|
|
195
|
-
e[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ n(Nt, { size: 14 }), e[18] = _) : _ = e[18];
|
|
196
|
-
let k;
|
|
197
|
-
e[19] !== b || e[20] !== x || e[21] !== T ? (k = /* @__PURE__ */ n(K, { "data-active": x, variant: "ghost", "aria-label": T, size: "xs", onClick: b, children: _ }), e[19] = b, e[20] = x, e[21] = T, e[22] = k) : k = e[22];
|
|
198
|
-
let N;
|
|
199
|
-
e[23] !== y || e[24] !== k ? (N = /* @__PURE__ */ n(W, { content: y, children: k }), e[23] = y, e[24] = k, e[25] = N) : N = e[25];
|
|
200
|
-
let I;
|
|
201
|
-
e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ n(Pe, {}), e[26] = I) : I = e[26];
|
|
202
|
-
const M = o === "h1" || void 0;
|
|
203
|
-
let O;
|
|
204
|
-
e[27] !== a ? (O = () => a("h1"), e[27] = a, e[28] = O) : O = e[28];
|
|
205
|
-
let z;
|
|
206
|
-
e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ n(ue, { fontWeight: "thin", fontSize: ".8rem", children: "H1" }), e[29] = z) : z = e[29];
|
|
207
|
-
let $;
|
|
208
|
-
e[30] !== M || e[31] !== O ? ($ = /* @__PURE__ */ n(W, { content: "Heading 1", children: /* @__PURE__ */ n(K, { "data-active": M, variant: "ghost", "aria-label": "Heading 1", size: "xs", onClick: O, children: z }) }), e[30] = M, e[31] = O, e[32] = $) : $ = e[32];
|
|
209
|
-
const G = o === "h2" || void 0;
|
|
210
|
-
let U;
|
|
211
|
-
e[33] !== a ? (U = () => a("h2"), e[33] = a, e[34] = U) : U = e[34];
|
|
212
|
-
let H;
|
|
213
|
-
e[35] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ n(ue, { fontWeight: "thin", fontSize: ".8rem", children: "H2" }), e[35] = H) : H = e[35];
|
|
214
|
-
let B;
|
|
215
|
-
e[36] !== G || e[37] !== U ? (B = /* @__PURE__ */ n(W, { content: "Heading 2", children: /* @__PURE__ */ n(K, { "data-active": G, variant: "ghost", "aria-label": "Heading 2", size: "xs", onClick: U, children: H }) }), e[36] = G, e[37] = U, e[38] = B) : B = e[38];
|
|
216
|
-
const D = o === "h3" || void 0;
|
|
217
|
-
let P;
|
|
218
|
-
e[39] !== a ? (P = () => a("h3"), e[39] = a, e[40] = P) : P = e[40];
|
|
219
|
-
let F;
|
|
220
|
-
e[41] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (F = /* @__PURE__ */ n(ue, { fontWeight: "thin", fontSize: ".8rem", children: "H3" }), e[41] = F) : F = e[41];
|
|
221
|
-
let j;
|
|
222
|
-
e[42] !== D || e[43] !== P ? (j = /* @__PURE__ */ n(W, { content: "Heading 3", children: /* @__PURE__ */ n(K, { "data-active": D, variant: "ghost", "aria-label": "Heading 3", size: "xs", onClick: P, children: F }) }), e[42] = D, e[43] = P, e[44] = j) : j = e[44];
|
|
223
|
-
let V;
|
|
224
|
-
e[45] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ n(Pe, {}), e[45] = V) : V = e[45];
|
|
225
|
-
const J = o === "code" || void 0;
|
|
226
|
-
let X;
|
|
227
|
-
e[46] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (X = /* @__PURE__ */ n(It, { size: 14 }), e[46] = X) : X = e[46];
|
|
228
|
-
let q;
|
|
229
|
-
e[47] !== E || e[48] !== J ? (q = /* @__PURE__ */ n(W, { content: "Code Block", children: /* @__PURE__ */ n(K, { "data-active": J, variant: "ghost", "aria-label": "Code Block", size: "xs", onClick: E, children: X }) }), e[47] = E, e[48] = J, e[49] = q) : q = e[49];
|
|
230
|
-
let ne;
|
|
231
|
-
e[50] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ne = /* @__PURE__ */ n(Pe, {}), e[50] = ne) : ne = e[50];
|
|
232
|
-
const he = o === "bullet" || void 0;
|
|
233
|
-
let oe;
|
|
234
|
-
e[51] !== p ? (oe = () => p("bullet"), e[51] = p, e[52] = oe) : oe = e[52];
|
|
235
|
-
let se;
|
|
236
|
-
e[53] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (se = /* @__PURE__ */ n(Pt, { size: 14 }), e[53] = se) : se = e[53];
|
|
237
|
-
let ae;
|
|
238
|
-
e[54] !== he || e[55] !== oe ? (ae = /* @__PURE__ */ n(W, { content: "Bulleted List", children: /* @__PURE__ */ n(K, { "data-active": he, variant: "ghost", "aria-label": "Bulleted List", size: "xs", onClick: oe, children: se }) }), e[54] = he, e[55] = oe, e[56] = ae) : ae = e[56];
|
|
239
|
-
const ye = o === "number" || void 0;
|
|
240
|
-
let ce;
|
|
241
|
-
e[57] !== p ? (ce = () => p("number"), e[57] = p, e[58] = ce) : ce = e[58];
|
|
242
|
-
let be;
|
|
243
|
-
e[59] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (be = /* @__PURE__ */ n(At, { size: 14 }), e[59] = be) : be = e[59];
|
|
244
|
-
let de;
|
|
245
|
-
e[60] !== ye || e[61] !== ce ? (de = /* @__PURE__ */ n(W, { content: "Numbered List", children: /* @__PURE__ */ n(K, { "data-active": ye, variant: "ghost", "aria-label": "Numbered List", size: "xs", onClick: ce, children: be }) }), e[60] = ye, e[61] = ce, e[62] = de) : de = e[62];
|
|
246
|
-
const xe = o === "check" || void 0;
|
|
247
|
-
let fe;
|
|
248
|
-
e[63] !== p ? (fe = () => p("check"), e[63] = p, e[64] = fe) : fe = e[64];
|
|
249
|
-
let ve;
|
|
250
|
-
e[65] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ve = /* @__PURE__ */ n(Mt, { size: 14 }), e[65] = ve) : ve = e[65];
|
|
251
|
-
let me;
|
|
252
|
-
e[66] !== xe || e[67] !== fe ? (me = /* @__PURE__ */ n(W, { content: "Check List", children: /* @__PURE__ */ n(K, { "data-active": xe, variant: "ghost", "aria-label": "Check List", size: "xs", onClick: fe, children: ve }) }), e[66] = xe, e[67] = fe, e[68] = me) : me = e[68];
|
|
253
|
-
let Ce;
|
|
254
|
-
return e[69] !== m || e[70] !== N || e[71] !== $ || e[72] !== B || e[73] !== c || e[74] !== j || e[75] !== q || e[76] !== ae || e[77] !== de || e[78] !== me || e[79] !== g ? (Ce = /* @__PURE__ */ le(Ae, { direction: "row", gap: "0.5", alignItems: "center", children: [
|
|
255
|
-
c,
|
|
256
|
-
g,
|
|
257
|
-
m,
|
|
258
|
-
N,
|
|
259
|
-
I,
|
|
260
|
-
$,
|
|
261
|
-
B,
|
|
262
|
-
j,
|
|
263
|
-
V,
|
|
264
|
-
q,
|
|
265
|
-
ne,
|
|
266
|
-
ae,
|
|
267
|
-
de,
|
|
268
|
-
me
|
|
269
|
-
] }), e[69] = m, e[70] = N, e[71] = $, e[72] = B, e[73] = c, e[74] = j, e[75] = q, e[76] = ae, e[77] = de, e[78] = me, e[79] = g, e[80] = Ce) : Ce = e[80], Ce;
|
|
270
|
-
}
|
|
271
|
-
const rn = {
|
|
272
|
-
bullet: "Bulleted List",
|
|
273
|
-
check: "Check List",
|
|
274
|
-
code: "Code Block",
|
|
275
|
-
h1: "Heading 1",
|
|
276
|
-
h2: "Heading 2",
|
|
277
|
-
h3: "Heading 3",
|
|
278
|
-
h4: "Heading 4",
|
|
279
|
-
h5: "Heading 5",
|
|
280
|
-
h6: "Heading 6",
|
|
281
|
-
number: "Numbered List",
|
|
282
|
-
paragraph: "Normal",
|
|
283
|
-
quote: "Quote"
|
|
284
|
-
}, sn = (t) => t in rn ? t : null, an = (t) => (t.getKey() === "root" ? t : Z(t, (r) => {
|
|
285
|
-
const o = r.getParent();
|
|
286
|
-
return o !== null && St(o);
|
|
287
|
-
})) ?? t.getTopLevelElementOrThrow(), cn = (t) => {
|
|
288
|
-
const e = an(t);
|
|
289
|
-
if (Ne(e))
|
|
290
|
-
return e.getListType();
|
|
291
|
-
const r = Z(t, (l) => Ne(l));
|
|
292
|
-
if (r !== null && Ne(r))
|
|
293
|
-
return r.getListType();
|
|
294
|
-
const o = Kt(e) ? e.getTag() : e.getType();
|
|
295
|
-
return sn(o);
|
|
296
|
-
};
|
|
297
|
-
function dn(t) {
|
|
298
|
-
const {
|
|
299
|
-
hasSelection: e,
|
|
300
|
-
isRangeSelection: r,
|
|
301
|
-
isCollapsed: o,
|
|
302
|
-
hasNativeSelection: l,
|
|
303
|
-
hasNativeRange: u,
|
|
304
|
-
isAnchorInsideEditor: L,
|
|
305
|
-
isEditorEditable: h
|
|
306
|
-
} = t;
|
|
307
|
-
return e && r && !o && l && u && L && h;
|
|
308
|
-
}
|
|
309
|
-
const fn = -4;
|
|
310
|
-
function mn({
|
|
311
|
-
editor: t,
|
|
312
|
-
anchorElem: e,
|
|
313
|
-
isToolbarActive: r,
|
|
314
|
-
setIsToolbarActive: o
|
|
315
|
-
}) {
|
|
316
|
-
const l = ie(null), [u, L] = A("paragraph"), [h, a] = A(!1), [p, E] = A(!1), [b, d] = A(!1), [C, R] = A(!1), c = ie(() => {
|
|
317
|
-
}), w = (i) => {
|
|
318
|
-
t.update(() => {
|
|
319
|
-
const s = ee();
|
|
320
|
-
if (Q(s)) {
|
|
321
|
-
if (u === i) {
|
|
322
|
-
_e(s, Fe);
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
|
-
_e(s, () => Wt(i));
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
}, v = (i) => {
|
|
329
|
-
if (u === i) {
|
|
330
|
-
t.dispatchCommand(Ut, void 0);
|
|
331
|
-
return;
|
|
332
|
-
}
|
|
333
|
-
const s = {
|
|
334
|
-
bullet: jt,
|
|
335
|
-
number: Ft,
|
|
336
|
-
check: Ht
|
|
337
|
-
}[i];
|
|
338
|
-
t.dispatchCommand(s, void 0);
|
|
339
|
-
}, S = () => {
|
|
340
|
-
t.update(() => {
|
|
341
|
-
const i = ee();
|
|
342
|
-
if (Q(i)) {
|
|
343
|
-
if (u === "code") {
|
|
344
|
-
_e(i, Fe);
|
|
345
|
-
return;
|
|
346
|
-
}
|
|
347
|
-
_e(i, () => zt());
|
|
348
|
-
}
|
|
349
|
-
});
|
|
350
|
-
}, g = () => {
|
|
351
|
-
if (C) {
|
|
352
|
-
t.dispatchCommand(De, null);
|
|
353
|
-
return;
|
|
354
|
-
}
|
|
355
|
-
t.dispatchCommand(st, !0);
|
|
356
|
-
}, f = () => {
|
|
357
|
-
const i = ee();
|
|
358
|
-
if (!Q(i)) return;
|
|
359
|
-
a(i.hasFormat("bold")), E(i.hasFormat("italic")), d(i.hasFormat("underline"));
|
|
360
|
-
const s = ge(i), m = Z(s, re), y = Z(s, pe);
|
|
361
|
-
R(m !== null || y !== null);
|
|
362
|
-
const x = cn(i.anchor.getNode());
|
|
363
|
-
x && L(x);
|
|
364
|
-
};
|
|
365
|
-
return c.current = () => {
|
|
366
|
-
const i = ee(), s = l.current, m = window.getSelection();
|
|
367
|
-
if (s === null)
|
|
368
|
-
return;
|
|
369
|
-
const y = t.getRootElement(), x = m !== null, T = x && m.rangeCount > 0, _ = !!y?.contains(x ? m.anchorNode : null);
|
|
370
|
-
if (dn({
|
|
371
|
-
hasSelection: i !== null,
|
|
372
|
-
isRangeSelection: Q(i),
|
|
373
|
-
isCollapsed: Q(i) ? i.isCollapsed() : !1,
|
|
374
|
-
hasNativeSelection: x,
|
|
375
|
-
hasNativeRange: T,
|
|
376
|
-
isAnchorInsideEditor: _,
|
|
377
|
-
isEditorEditable: t.isEditable()
|
|
378
|
-
}) && m) {
|
|
379
|
-
const k = m.getRangeAt(0).getBoundingClientRect();
|
|
380
|
-
if (k) {
|
|
381
|
-
const N = new DOMRect(k.left, k.bottom, 0, 0);
|
|
382
|
-
ke(N, s, e, fn);
|
|
383
|
-
}
|
|
384
|
-
o(!0);
|
|
385
|
-
} else
|
|
386
|
-
y !== null && ke(null, s, e), o(!1);
|
|
387
|
-
return f(), !0;
|
|
388
|
-
}, Y(() => {
|
|
389
|
-
const i = e.parentElement, s = () => {
|
|
390
|
-
t.getEditorState().read(() => {
|
|
391
|
-
c.current();
|
|
392
|
-
});
|
|
393
|
-
};
|
|
394
|
-
return window.addEventListener("resize", s), i && i.addEventListener("scroll", s), () => {
|
|
395
|
-
window.removeEventListener("resize", s), i && i.removeEventListener("scroll", s);
|
|
396
|
-
};
|
|
397
|
-
}, [e, t]), Y(() => Le(t.registerUpdateListener(({
|
|
398
|
-
editorState: i
|
|
399
|
-
}) => {
|
|
400
|
-
i.read(() => {
|
|
401
|
-
c.current();
|
|
402
|
-
});
|
|
403
|
-
}), t.registerCommand(Se, (i) => (c.current(), !1), Ue), t.registerCommand(ot, (i) => {
|
|
404
|
-
const s = ee();
|
|
405
|
-
return Q(s) && c.current(), !1;
|
|
406
|
-
}, it)), [t]), /* @__PURE__ */ n("div", { ref: l, className: `floating-text-format-toolbar ${r ? "active" : ""}`, children: /* @__PURE__ */ n(ln, { editor: t, blockType: u, isBold: h, isItalic: p, isUnderline: b, isLink: C, formatHeading: w, formatList: v, formatCodeBlock: S, insertLink: g }) });
|
|
407
|
-
}
|
|
408
|
-
function at(t) {
|
|
409
|
-
const e = te(7), {
|
|
410
|
-
anchorElem: r
|
|
411
|
-
} = t, o = r === void 0 ? document.body : r, [l] = $e(), [u, L] = A(!1);
|
|
412
|
-
let h;
|
|
413
|
-
e[0] !== o || e[1] !== l || e[2] !== u ? (h = /* @__PURE__ */ n(mn, { editor: l, anchorElem: o, isToolbarActive: u, setIsToolbarActive: L }), e[0] = o, e[1] = l, e[2] = u, e[3] = h) : h = e[3];
|
|
414
|
-
let a;
|
|
415
|
-
return e[4] !== o || e[5] !== h ? (a = He(h, o), e[4] = o, e[5] = h, e[6] = a) : a = e[6], a;
|
|
416
|
-
}
|
|
417
|
-
function un() {
|
|
418
|
-
const t = te(1);
|
|
1
|
+
import { jsx as t, jsxs as O } from "react/jsx-runtime";
|
|
2
|
+
import { c as U } from "react/compiler-runtime";
|
|
3
|
+
import { e as G, a as J, C as K, I as Q, E as Z, b as ee } from "./markdown-DDd2ESoH.js";
|
|
4
|
+
import { D as Oe, c as He } from "./markdown-DDd2ESoH.js";
|
|
5
|
+
import { Box as te, Flex as oe } from "@chakra-ui/react";
|
|
6
|
+
import { LexicalCollaboration as ne } from "@lexical/react/LexicalCollaborationContext";
|
|
7
|
+
import { CollaborationPluginV2__EXPERIMENTAL as re } from "@lexical/react/LexicalCollaborationPlugin";
|
|
8
|
+
import { LexicalComposer as ie } from "@lexical/react/LexicalComposer";
|
|
9
|
+
import { LexicalErrorBoundary as le } from "@lexical/react/LexicalErrorBoundary";
|
|
10
|
+
import { HorizontalRulePlugin as ae } from "@lexical/react/LexicalHorizontalRulePlugin";
|
|
11
|
+
import { LinkPlugin as se } from "@lexical/react/LexicalLinkPlugin";
|
|
12
|
+
import { ListPlugin as ce } from "@lexical/react/LexicalListPlugin";
|
|
13
|
+
import { RichTextPlugin as me } from "@lexical/react/LexicalRichTextPlugin";
|
|
14
|
+
import { TabIndentationPlugin as pe } from "@lexical/react/LexicalTabIndentationPlugin";
|
|
15
|
+
import { useRef as fe, useState as L, useEffect as H } from "react";
|
|
16
|
+
import { WebsocketProvider as de } from "y-websocket";
|
|
17
|
+
import * as ue from "yjs";
|
|
18
|
+
import { C as xe, F as ge } from "./markdown-editor-CYVkzt8t.js";
|
|
19
|
+
import { M as Ve } from "./markdown-editor-CYVkzt8t.js";
|
|
20
|
+
import { L as Xe } from "./lazy-markdown-editor-DwhqQ-NN.js";
|
|
21
|
+
import { R as Ge, P as Je, R as Ke, g as Qe, a as Ze } from "./rich-message--eRzjWYK.js";
|
|
22
|
+
function he() {
|
|
23
|
+
const o = U(1);
|
|
419
24
|
let e;
|
|
420
|
-
return
|
|
25
|
+
return o[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ t("style", { children: `
|
|
421
26
|
.collaboration-cursor-container {
|
|
422
27
|
position: relative;
|
|
423
28
|
display: inline;
|
|
@@ -451,416 +56,97 @@ function un() {
|
|
|
451
56
|
pointer-events: none;
|
|
452
57
|
opacity: 0.25;
|
|
453
58
|
}
|
|
454
|
-
` }),
|
|
455
|
-
}
|
|
456
|
-
function
|
|
457
|
-
const e =
|
|
458
|
-
roomId:
|
|
459
|
-
wsUrl:
|
|
460
|
-
wsParams:
|
|
461
|
-
userName:
|
|
462
|
-
userColor:
|
|
463
|
-
placeholder:
|
|
464
|
-
} =
|
|
465
|
-
let
|
|
466
|
-
e[0] !==
|
|
467
|
-
const
|
|
468
|
-
let
|
|
469
|
-
e[2] !==
|
|
470
|
-
const
|
|
471
|
-
params:
|
|
59
|
+
` }), o[0] = e) : e = o[0], e;
|
|
60
|
+
}
|
|
61
|
+
function De(o) {
|
|
62
|
+
const e = U(42), {
|
|
63
|
+
roomId: n,
|
|
64
|
+
wsUrl: M,
|
|
65
|
+
wsParams: f,
|
|
66
|
+
userName: W,
|
|
67
|
+
userColor: z,
|
|
68
|
+
placeholder: d
|
|
69
|
+
} = o;
|
|
70
|
+
let u;
|
|
71
|
+
e[0] !== f ? (u = f === void 0 ? {} : f, e[0] = f, e[1] = u) : u = e[1];
|
|
72
|
+
const F = u, A = W === void 0 ? "Anonymous" : W, I = z === void 0 ? "#30bced" : z, N = fe(null), [r, V] = L(null), [B, $] = L(!1), [i] = L(ve);
|
|
73
|
+
let x;
|
|
74
|
+
e[2] !== i || e[3] !== n || e[4] !== F || e[5] !== M ? (x = () => {
|
|
75
|
+
const q = new de(M, n, i, {
|
|
76
|
+
params: F,
|
|
472
77
|
connect: !1
|
|
473
78
|
});
|
|
474
|
-
return
|
|
475
|
-
|
|
476
|
-
}),
|
|
477
|
-
}, e[2] =
|
|
478
|
-
const [
|
|
479
|
-
let
|
|
480
|
-
e[7] !==
|
|
481
|
-
|
|
482
|
-
}),
|
|
483
|
-
let
|
|
484
|
-
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
485
|
-
|
|
486
|
-
},
|
|
79
|
+
return q.on("sync", (Y) => {
|
|
80
|
+
Y && $(!0);
|
|
81
|
+
}), q;
|
|
82
|
+
}, e[2] = i, e[3] = n, e[4] = F, e[5] = M, e[6] = x) : x = e[6];
|
|
83
|
+
const [l] = L(x);
|
|
84
|
+
let g, h;
|
|
85
|
+
e[7] !== l ? (g = () => (l.connect(), () => {
|
|
86
|
+
l.disconnect();
|
|
87
|
+
}), h = [l], e[7] = l, e[8] = g, e[9] = h) : (g = e[8], h = e[9]), H(g, h);
|
|
88
|
+
let b, v;
|
|
89
|
+
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = () => {
|
|
90
|
+
V(N.current);
|
|
91
|
+
}, v = [], e[10] = b, e[11] = v) : (b = e[10], v = e[11]), H(b, v);
|
|
487
92
|
let y;
|
|
488
93
|
e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = {
|
|
489
94
|
namespace: "COLLABORATIVE_EDITOR",
|
|
490
|
-
nodes:
|
|
95
|
+
nodes: J,
|
|
491
96
|
editorState: null,
|
|
492
|
-
onError:
|
|
97
|
+
onError: be,
|
|
493
98
|
editable: !0,
|
|
494
|
-
theme:
|
|
99
|
+
theme: G
|
|
495
100
|
}, e[12] = y) : y = e[12];
|
|
496
|
-
const
|
|
497
|
-
let
|
|
498
|
-
e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
499
|
-
const
|
|
101
|
+
const X = y;
|
|
102
|
+
let w;
|
|
103
|
+
e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ t(he, {}), e[13] = w) : w = e[13];
|
|
104
|
+
const D = l;
|
|
105
|
+
let a;
|
|
106
|
+
e[14] !== i || e[15] !== n || e[16] !== D || e[17] !== I || e[18] !== A ? (a = /* @__PURE__ */ t(re, { id: n, doc: i, provider: D, __shouldBootstrapUnsafe: !1, username: A, cursorColor: I }), e[14] = i, e[15] = n, e[16] = D, e[17] = I, e[18] = A, e[19] = a) : a = e[19];
|
|
107
|
+
let E, C, _, P, T, S;
|
|
108
|
+
e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ t(se, {}), C = /* @__PURE__ */ t(ce, {}), _ = /* @__PURE__ */ t(pe, { maxIndent: 7 }), P = /* @__PURE__ */ t(ae, {}), T = /* @__PURE__ */ t(K, {}), S = /* @__PURE__ */ t(Q, {}), e[20] = E, e[21] = C, e[22] = _, e[23] = P, e[24] = T, e[25] = S) : (E = e[20], C = e[21], _ = e[22], P = e[23], T = e[24], S = e[25]);
|
|
109
|
+
let s;
|
|
110
|
+
e[26] !== r ? (s = /* @__PURE__ */ t(xe, { anchorElem: r }), e[26] = r, e[27] = s) : s = e[27];
|
|
500
111
|
let k;
|
|
501
|
-
e[
|
|
502
|
-
let
|
|
503
|
-
e[
|
|
504
|
-
let
|
|
505
|
-
e[
|
|
506
|
-
let
|
|
507
|
-
e[
|
|
508
|
-
let
|
|
509
|
-
e[
|
|
510
|
-
let
|
|
511
|
-
e[
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
112
|
+
e[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ t(Z, {}), e[28] = k) : k = e[28];
|
|
113
|
+
let j;
|
|
114
|
+
e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ t(ee, { fullWidth: !1 }), e[29] = j) : j = e[29];
|
|
115
|
+
let c;
|
|
116
|
+
e[30] !== d || e[31] !== B ? (c = B && d ? /* @__PURE__ */ t(te, { position: "absolute", top: "0", color: "fg.muted", pointerEvents: "none", userSelect: "none", textStyle: "paragraph/M/regular", children: d }) : null, e[30] = d, e[31] = B, e[32] = c) : c = e[32];
|
|
117
|
+
let m;
|
|
118
|
+
e[33] !== c ? (m = /* @__PURE__ */ t(me, { contentEditable: j, placeholder: c, ErrorBoundary: le }), e[33] = c, e[34] = m) : m = e[34];
|
|
119
|
+
let p;
|
|
120
|
+
e[35] !== r ? (p = r ? /* @__PURE__ */ t(ge, { anchorElem: r }) : null, e[35] = r, e[36] = p) : p = e[36];
|
|
121
|
+
let R;
|
|
122
|
+
return e[37] !== a || e[38] !== s || e[39] !== m || e[40] !== p ? (R = /* @__PURE__ */ O(oe, { ref: N, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "visible", children: [
|
|
123
|
+
w,
|
|
124
|
+
/* @__PURE__ */ t(ie, { initialConfig: X, children: /* @__PURE__ */ O(ne, { children: [
|
|
125
|
+
a,
|
|
126
|
+
E,
|
|
127
|
+
C,
|
|
128
|
+
_,
|
|
129
|
+
P,
|
|
130
|
+
T,
|
|
131
|
+
S,
|
|
132
|
+
s,
|
|
520
133
|
k,
|
|
521
|
-
N,
|
|
522
|
-
I,
|
|
523
|
-
M,
|
|
524
|
-
O,
|
|
525
|
-
z,
|
|
526
|
-
$,
|
|
527
|
-
G,
|
|
528
|
-
U,
|
|
529
|
-
D,
|
|
530
|
-
P
|
|
531
|
-
] }) })
|
|
532
|
-
] }), e[37] = k, e[38] = G, e[39] = D, e[40] = P, e[41] = F) : F = e[41], F;
|
|
533
|
-
}
|
|
534
|
-
function hn(t) {
|
|
535
|
-
return console.error(t);
|
|
536
|
-
}
|
|
537
|
-
function pn() {
|
|
538
|
-
return new kt.Doc();
|
|
539
|
-
}
|
|
540
|
-
function gn(t) {
|
|
541
|
-
const e = te(32), {
|
|
542
|
-
isActive: r,
|
|
543
|
-
isLinkEditMode: o,
|
|
544
|
-
editedLinkUrl: l,
|
|
545
|
-
editedLinkUrlIsValid: u,
|
|
546
|
-
linkUrl: L,
|
|
547
|
-
href: h,
|
|
548
|
-
inputRef: a,
|
|
549
|
-
onEditedLinkUrlChange: p,
|
|
550
|
-
onInputKeyDown: E,
|
|
551
|
-
onClose: b,
|
|
552
|
-
onSubmit: d,
|
|
553
|
-
onEdit: C,
|
|
554
|
-
onRemove: R
|
|
555
|
-
} = t;
|
|
556
|
-
if (!r)
|
|
557
|
-
return null;
|
|
558
|
-
if (o) {
|
|
559
|
-
const i = !u;
|
|
560
|
-
let s;
|
|
561
|
-
e[0] !== p ? (s = (I) => {
|
|
562
|
-
p(I.target.value);
|
|
563
|
-
}, e[0] = p, e[1] = s) : s = e[1];
|
|
564
|
-
let m;
|
|
565
|
-
e[2] !== l || e[3] !== a || e[4] !== E || e[5] !== i || e[6] !== s ? (m = /* @__PURE__ */ n(gt, { ref: a, className: "link-editor-url-field", size: "sm", fontSize: "sm", value: l, placeholder: "https://", "aria-label": "Link URL", "aria-invalid": i, onChange: s, onKeyDown: E }), e[2] = l, e[3] = a, e[4] = E, e[5] = i, e[6] = s, e[7] = m) : m = e[7];
|
|
566
|
-
let y;
|
|
567
|
-
e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ n(Bt, { size: 14 }), e[8] = y) : y = e[8];
|
|
568
|
-
let x;
|
|
569
|
-
e[9] !== b ? (x = /* @__PURE__ */ n(W, { content: "Cancel", children: /* @__PURE__ */ n(K, { variant: "ghost", size: "xs", "aria-label": "Cancel link edit", onMouseDown: Ee, onClick: b, children: y }) }), e[9] = b, e[10] = x) : x = e[10];
|
|
570
|
-
const T = !u;
|
|
571
|
-
let _;
|
|
572
|
-
e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ n(lt, { size: 14 }), e[11] = _) : _ = e[11];
|
|
573
|
-
let k;
|
|
574
|
-
e[12] !== d || e[13] !== T ? (k = /* @__PURE__ */ n(W, { content: "Confirm", children: /* @__PURE__ */ n(K, { variant: "ghost", size: "xs", "aria-label": "Confirm link edit", disabled: T, onMouseDown: Ee, onClick: d, children: _ }) }), e[12] = d, e[13] = T, e[14] = k) : k = e[14];
|
|
575
|
-
let N;
|
|
576
|
-
return e[15] !== m || e[16] !== x || e[17] !== k ? (N = /* @__PURE__ */ le(Ae, { className: "link-editor-content", direction: "row", gap: "1", alignItems: "center", p: "1", children: [
|
|
577
134
|
m,
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
}
|
|
582
|
-
let c;
|
|
583
|
-
e[19] !== h || e[20] !== L ? (c = /* @__PURE__ */ n(bt, { href: h, target: "_blank", rel: "noopener noreferrer", className: "link-editor-url-field", fontSize: "sm", textDecoration: "underline", px: "2", truncate: !0, children: L }), e[19] = h, e[20] = L, e[21] = c) : c = e[21];
|
|
584
|
-
let w;
|
|
585
|
-
e[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ n(Dt, { size: 14 }), e[22] = w) : w = e[22];
|
|
586
|
-
let v;
|
|
587
|
-
e[23] !== C ? (v = /* @__PURE__ */ n(W, { content: "Edit link", children: /* @__PURE__ */ n(K, { variant: "ghost", size: "xs", "aria-label": "Edit link", onMouseDown: Ee, onClick: C, children: w }) }), e[23] = C, e[24] = v) : v = e[24];
|
|
588
|
-
let S;
|
|
589
|
-
e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ n(Ot, { size: 14 }), e[25] = S) : S = e[25];
|
|
590
|
-
let g;
|
|
591
|
-
e[26] !== R ? (g = /* @__PURE__ */ n(W, { content: "Remove link", children: /* @__PURE__ */ n(K, { variant: "ghost", size: "xs", "aria-label": "Remove link", onMouseDown: Ee, onClick: R, children: S }) }), e[26] = R, e[27] = g) : g = e[27];
|
|
592
|
-
let f;
|
|
593
|
-
return e[28] !== c || e[29] !== v || e[30] !== g ? (f = /* @__PURE__ */ le(Ae, { className: "link-editor-content", direction: "row", gap: "1", alignItems: "center", p: "1", children: [
|
|
594
|
-
c,
|
|
595
|
-
v,
|
|
596
|
-
g
|
|
597
|
-
] }), e[28] = c, e[29] = v, e[30] = g, e[31] = f) : f = e[31], f;
|
|
598
|
-
}
|
|
599
|
-
function Ee(t) {
|
|
600
|
-
t.preventDefault();
|
|
601
|
-
}
|
|
602
|
-
function bn(t, e, r) {
|
|
603
|
-
return t && e && r === "";
|
|
604
|
-
}
|
|
605
|
-
function vn(t) {
|
|
606
|
-
const e = ge(t), r = Z(e, re);
|
|
607
|
-
return r ? r.getURL() : re(e) ? e.getURL() : "";
|
|
608
|
-
}
|
|
609
|
-
const ct = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "sms:", "tel:"]);
|
|
610
|
-
function Oe(t) {
|
|
611
|
-
try {
|
|
612
|
-
const e = new URL(t);
|
|
613
|
-
if (!ct.has(e.protocol))
|
|
614
|
-
return "about:blank";
|
|
615
|
-
} catch {
|
|
616
|
-
return t;
|
|
617
|
-
}
|
|
618
|
-
return t;
|
|
619
|
-
}
|
|
620
|
-
function dt(t) {
|
|
621
|
-
try {
|
|
622
|
-
const e = new URL(t);
|
|
623
|
-
return ct.has(e.protocol) ? e.protocol === "http:" || e.protocol === "https:" ? e.hostname !== "" : e.pathname.trim() !== "" : !1;
|
|
624
|
-
} catch {
|
|
625
|
-
return !1;
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
const Cn = 8;
|
|
629
|
-
function _n({
|
|
630
|
-
editor: t,
|
|
631
|
-
isLink: e,
|
|
632
|
-
setIsLink: r,
|
|
633
|
-
anchorElem: o,
|
|
634
|
-
isLinkEditMode: l,
|
|
635
|
-
setIsLinkEditMode: u
|
|
636
|
-
}) {
|
|
637
|
-
const L = ie(null), h = ie(null), a = ie(() => {
|
|
638
|
-
}), [p, E] = A(""), [b, d] = A("https://"), [C, R] = A(null), c = e || l, w = dt(b);
|
|
639
|
-
a.current = () => {
|
|
640
|
-
const f = ee();
|
|
641
|
-
if (Q(f)) {
|
|
642
|
-
const T = vn(f);
|
|
643
|
-
E(T), bn(l, e, T) && S(), l && T !== "" && d(T);
|
|
644
|
-
}
|
|
645
|
-
const i = L.current, s = window.getSelection(), m = document.activeElement;
|
|
646
|
-
if (i === null)
|
|
647
|
-
return;
|
|
648
|
-
const y = t.getRootElement(), x = s !== null && s.rangeCount > 0;
|
|
649
|
-
if (f !== null && s !== null && x && y?.contains(s.anchorNode) && t.isEditable()) {
|
|
650
|
-
const T = s.getRangeAt(0).getBoundingClientRect(), _ = new DOMRect(T.left, T.top, 0, T.height);
|
|
651
|
-
ke(_, i, o, Cn, void 0, "above"), R(f);
|
|
652
|
-
} else i.contains(m) || (y !== null && ke(null, i, o), R(null), u(!1), E(""));
|
|
653
|
-
}, Y(() => {
|
|
654
|
-
const f = o.parentElement, i = () => {
|
|
655
|
-
t.getEditorState().read(() => {
|
|
656
|
-
a.current();
|
|
657
|
-
});
|
|
658
|
-
};
|
|
659
|
-
return window.addEventListener("resize", i), f && f.addEventListener("scroll", i), () => {
|
|
660
|
-
window.removeEventListener("resize", i), f && f.removeEventListener("scroll", i);
|
|
661
|
-
};
|
|
662
|
-
}, [o.parentElement, t]), Y(() => Le(t.registerUpdateListener(({
|
|
663
|
-
editorState: f
|
|
664
|
-
}) => {
|
|
665
|
-
f.read(() => {
|
|
666
|
-
a.current();
|
|
667
|
-
});
|
|
668
|
-
}), t.registerCommand(Se, () => (a.current(), !0), Be), t.registerCommand(yt, () => e ? (r(!1), !0) : !1, it)), [t, r, e]), Y(() => {
|
|
669
|
-
t.getEditorState().read(() => {
|
|
670
|
-
a.current();
|
|
671
|
-
});
|
|
672
|
-
}, [t]), _t(() => {
|
|
673
|
-
c && t.getEditorState().read(() => {
|
|
674
|
-
a.current();
|
|
675
|
-
});
|
|
676
|
-
}, [t, c]), Y(() => {
|
|
677
|
-
l && h.current && h.current.focus();
|
|
678
|
-
}, [l]);
|
|
679
|
-
const v = (f) => {
|
|
680
|
-
f.key === "Enter" ? (f.preventDefault(), g()) : f.key === "Escape" && (f.preventDefault(), S());
|
|
681
|
-
}, S = () => {
|
|
682
|
-
d("https://"), u(!1);
|
|
683
|
-
}, g = () => {
|
|
684
|
-
C === null || !w || (t.update(() => {
|
|
685
|
-
Tt(C);
|
|
686
|
-
}), t.dispatchCommand(De, Oe(b)), t.update(() => {
|
|
687
|
-
const f = ee();
|
|
688
|
-
if (Q(f)) {
|
|
689
|
-
const i = ge(f).getParent();
|
|
690
|
-
if (pe(i)) {
|
|
691
|
-
const s = $t(i.getURL(), {
|
|
692
|
-
rel: i.__rel,
|
|
693
|
-
target: i.__target,
|
|
694
|
-
title: i.__title
|
|
695
|
-
});
|
|
696
|
-
i.replace(s, !0);
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
}), S());
|
|
700
|
-
};
|
|
701
|
-
return /* @__PURE__ */ n(ze, { ref: L, className: `link-editor ${c ? "active" : ""}`, children: /* @__PURE__ */ n(gn, { isActive: c, isLinkEditMode: l, editedLinkUrl: b, editedLinkUrlIsValid: w, linkUrl: p, href: Oe(p), inputRef: h, onEditedLinkUrlChange: d, onInputKeyDown: v, onClose: S, onSubmit: g, onEdit: () => {
|
|
702
|
-
d(p), u(!0);
|
|
703
|
-
}, onRemove: () => {
|
|
704
|
-
t.dispatchCommand(De, null);
|
|
705
|
-
} }) });
|
|
706
|
-
}
|
|
707
|
-
function En(t, e, r, o) {
|
|
708
|
-
const l = te(13), [u, L] = A(t), [h, a] = A(!1);
|
|
709
|
-
let p, E;
|
|
710
|
-
l[0] !== t || l[1] !== o ? (p = () => {
|
|
711
|
-
const C = function() {
|
|
712
|
-
const c = ee();
|
|
713
|
-
if (Q(c)) {
|
|
714
|
-
const w = ge(c), v = Z(w, re), S = Z(w, pe);
|
|
715
|
-
if (!(v || S)) {
|
|
716
|
-
a(!1);
|
|
717
|
-
return;
|
|
718
|
-
}
|
|
719
|
-
const g = c.getNodes().filter(Ln).find((f) => {
|
|
720
|
-
const i = Z(f, re), s = Z(f, pe), m = pe(s) && s.getIsUnlinked();
|
|
721
|
-
return v && !v.is(i) || i && !i.is(v) || S && !S.is(s) || s && (!s.is(S) || m);
|
|
722
|
-
});
|
|
723
|
-
a(!g);
|
|
724
|
-
}
|
|
725
|
-
};
|
|
726
|
-
return Le(t.registerUpdateListener((R) => {
|
|
727
|
-
const {
|
|
728
|
-
editorState: c
|
|
729
|
-
} = R;
|
|
730
|
-
c.read(() => {
|
|
731
|
-
C();
|
|
732
|
-
});
|
|
733
|
-
}), t.registerCommand(Se, (R, c) => (C(), L(c), !1), Ue), t.registerCommand(ot, kn, Be), t.registerCommand(st, (R) => (o(R), !0), Be));
|
|
734
|
-
}, E = [t, o], l[0] = t, l[1] = o, l[2] = p, l[3] = E) : (p = l[2], E = l[3]), Y(p, E);
|
|
735
|
-
let b;
|
|
736
|
-
l[4] !== u || l[5] !== e || l[6] !== h || l[7] !== r || l[8] !== o ? (b = /* @__PURE__ */ n(_n, { editor: u, isLink: h, anchorElem: e, setIsLink: a, isLinkEditMode: r, setIsLinkEditMode: o }), l[4] = u, l[5] = e, l[6] = h, l[7] = r, l[8] = o, l[9] = b) : b = l[9];
|
|
737
|
-
let d;
|
|
738
|
-
return l[10] !== e || l[11] !== b ? (d = He(b, e), l[10] = e, l[11] = b, l[12] = d) : d = l[12], d;
|
|
739
|
-
}
|
|
740
|
-
function kn(t) {
|
|
741
|
-
const e = ee();
|
|
742
|
-
if (Q(e)) {
|
|
743
|
-
const r = ge(e), o = Z(r, re);
|
|
744
|
-
if (re(o) && (t.metaKey || t.ctrlKey))
|
|
745
|
-
return window.open(Oe(o.getURL()), "_blank", "noopener,noreferrer"), !0;
|
|
746
|
-
}
|
|
747
|
-
return !1;
|
|
748
|
-
}
|
|
749
|
-
function Ln(t) {
|
|
750
|
-
return !xt(t);
|
|
751
|
-
}
|
|
752
|
-
function Sn(t) {
|
|
753
|
-
const {
|
|
754
|
-
anchorElem: e
|
|
755
|
-
} = t, r = e === void 0 ? document.body : e, [o, l] = A(!1), [u] = $e();
|
|
756
|
-
return En(u, r, o, l);
|
|
757
|
-
}
|
|
758
|
-
function yn() {
|
|
759
|
-
const t = te(1);
|
|
760
|
-
let e;
|
|
761
|
-
return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n(Je, { validateUrl: dt }), t[0] = e) : e = t[0], e;
|
|
135
|
+
p
|
|
136
|
+
] }) })
|
|
137
|
+
] }), e[37] = a, e[38] = s, e[39] = m, e[40] = p, e[41] = R) : R = e[41], R;
|
|
762
138
|
}
|
|
763
|
-
function
|
|
764
|
-
|
|
765
|
-
autoFocus: r,
|
|
766
|
-
debug: o,
|
|
767
|
-
defaultState: l,
|
|
768
|
-
isEditable: u,
|
|
769
|
-
placeholder: L,
|
|
770
|
-
scrollable: h,
|
|
771
|
-
onChange: a
|
|
772
|
-
} = t, p = r === void 0 ? !1 : r, E = o === void 0 ? !1 : o, b = l === void 0 ? "" : l, d = u === void 0 ? !1 : u, C = h === void 0 ? !0 : h;
|
|
773
|
-
let R;
|
|
774
|
-
e[0] !== b ? (R = mt(b), e[0] = b, e[1] = R) : R = e[1];
|
|
775
|
-
const {
|
|
776
|
-
frontmatter: c,
|
|
777
|
-
body: w
|
|
778
|
-
} = R, v = d && !!a, S = ie(null), [g, f] = A(null);
|
|
779
|
-
let i, s;
|
|
780
|
-
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = () => {
|
|
781
|
-
f(S.current);
|
|
782
|
-
}, s = [], e[2] = i, e[3] = s) : (i = e[2], s = e[3]), Y(i, s);
|
|
783
|
-
let m;
|
|
784
|
-
e[4] !== w ? (m = () => Gt(ut(w), Te, void 0, !1), e[4] = w, e[5] = m) : m = e[5];
|
|
785
|
-
let y;
|
|
786
|
-
e[6] !== d || e[7] !== m ? (y = {
|
|
787
|
-
namespace: "MARKDOWN_EDITOR",
|
|
788
|
-
nodes: We,
|
|
789
|
-
editorState: m,
|
|
790
|
-
onError: xn,
|
|
791
|
-
editable: d,
|
|
792
|
-
theme: Ke
|
|
793
|
-
}, e[6] = d, e[7] = m, e[8] = y) : y = e[8];
|
|
794
|
-
const x = y, T = C ? "100%" : "auto";
|
|
795
|
-
let _;
|
|
796
|
-
e[9] !== p ? (_ = p ? /* @__PURE__ */ n(qt, {}) : null, e[9] = p, e[10] = _) : _ = e[10];
|
|
797
|
-
let k, N, I;
|
|
798
|
-
e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ n(Xt, {}), N = /* @__PURE__ */ n(yn, {}), I = /* @__PURE__ */ n(et, {}), e[11] = k, e[12] = N, e[13] = I) : (k = e[11], N = e[12], I = e[13]);
|
|
799
|
-
let M;
|
|
800
|
-
e[14] !== d ? (M = d ? /* @__PURE__ */ n(nt, { maxIndent: 7 }) : null, e[14] = d, e[15] = M) : M = e[15];
|
|
801
|
-
let O;
|
|
802
|
-
e[16] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ n(Yt, {}), e[16] = O) : O = e[16];
|
|
803
|
-
let z;
|
|
804
|
-
e[17] !== d ? (z = d ? /* @__PURE__ */ n(Qt, { transformers: Te }) : null, e[17] = d, e[18] = z) : z = e[18];
|
|
805
|
-
let $, G, U;
|
|
806
|
-
e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? ($ = /* @__PURE__ */ n(Ze, {}), G = /* @__PURE__ */ n(Ge, {}), U = /* @__PURE__ */ n(Ve, {}), e[19] = $, e[20] = G, e[21] = U) : ($ = e[19], G = e[20], U = e[21]);
|
|
807
|
-
let H;
|
|
808
|
-
e[22] !== g ? (H = /* @__PURE__ */ n(rt, { anchorElem: g }), e[22] = g, e[23] = H) : H = e[23];
|
|
809
|
-
let B;
|
|
810
|
-
e[24] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ n(qe, {}), e[24] = B) : B = e[24];
|
|
811
|
-
let D;
|
|
812
|
-
e[25] !== C ? (D = /* @__PURE__ */ n(Ye, { fullWidth: !1, padding: "sm", scrollable: C }), e[25] = C, e[26] = D) : D = e[26];
|
|
813
|
-
let P;
|
|
814
|
-
e[27] !== L ? (P = L ? /* @__PURE__ */ n(Me, { position: "absolute", padding: "sm", top: "0", left: "0", right: "0", pointerEvents: "none", userSelect: "none", justifyContent: "center", children: /* @__PURE__ */ n(ze, { width: "100%", maxWidth: "45rem", color: "fg.muted", textStyle: "paragraph/M/regular", children: L }) }) : null, e[27] = L, e[28] = P) : P = e[28];
|
|
815
|
-
let F;
|
|
816
|
-
e[29] !== D || e[30] !== P ? (F = /* @__PURE__ */ n(tt, { contentEditable: D, placeholder: P, ErrorBoundary: Qe }), e[29] = D, e[30] = P, e[31] = F) : F = e[31];
|
|
817
|
-
let j;
|
|
818
|
-
e[32] !== g || e[33] !== d ? (j = d && g ? /* @__PURE__ */ le(ft, { children: [
|
|
819
|
-
/* @__PURE__ */ n(at, { anchorElem: g }),
|
|
820
|
-
/* @__PURE__ */ n(Sn, { anchorElem: g })
|
|
821
|
-
] }) : null, e[32] = g, e[33] = d, e[34] = j) : j = e[34];
|
|
822
|
-
let V;
|
|
823
|
-
e[35] !== c || e[36] !== a || e[37] !== v ? (V = v ? /* @__PURE__ */ n(Zt, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (he) => {
|
|
824
|
-
he.read(() => {
|
|
825
|
-
const oe = Rt(), se = Vt(Te, oe);
|
|
826
|
-
a?.(c + se);
|
|
827
|
-
});
|
|
828
|
-
} }) : null, e[35] = c, e[36] = a, e[37] = v, e[38] = V) : V = e[38];
|
|
829
|
-
let J;
|
|
830
|
-
e[39] !== d ? (J = /* @__PURE__ */ n(ht, { isEditable: d }), e[39] = d, e[40] = J) : J = e[40];
|
|
831
|
-
let X;
|
|
832
|
-
e[41] !== E ? (X = E && /* @__PURE__ */ n(pt, {}), e[41] = E, e[42] = X) : X = e[42];
|
|
833
|
-
let q;
|
|
834
|
-
e[43] !== x || e[44] !== _ || e[45] !== M || e[46] !== z || e[47] !== H || e[48] !== F || e[49] !== j || e[50] !== V || e[51] !== J || e[52] !== X ? (q = /* @__PURE__ */ le(Xe, { initialConfig: x, children: [
|
|
835
|
-
_,
|
|
836
|
-
k,
|
|
837
|
-
N,
|
|
838
|
-
I,
|
|
839
|
-
M,
|
|
840
|
-
O,
|
|
841
|
-
z,
|
|
842
|
-
$,
|
|
843
|
-
G,
|
|
844
|
-
U,
|
|
845
|
-
H,
|
|
846
|
-
B,
|
|
847
|
-
F,
|
|
848
|
-
j,
|
|
849
|
-
V,
|
|
850
|
-
J,
|
|
851
|
-
X
|
|
852
|
-
] }), e[43] = x, e[44] = _, e[45] = M, e[46] = z, e[47] = H, e[48] = F, e[49] = j, e[50] = V, e[51] = J, e[52] = X, e[53] = q) : q = e[53];
|
|
853
|
-
let ne;
|
|
854
|
-
return e[54] !== T || e[55] !== q ? (ne = /* @__PURE__ */ n(Me, { ref: S, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: T, position: "relative", direction: "column", overflow: "visible", children: q }), e[54] = T, e[55] = q, e[56] = ne) : ne = e[56], ne;
|
|
139
|
+
function be(o) {
|
|
140
|
+
return console.error(o);
|
|
855
141
|
}
|
|
856
|
-
function
|
|
857
|
-
return
|
|
142
|
+
function ve() {
|
|
143
|
+
return new ue.Doc();
|
|
858
144
|
}
|
|
859
|
-
function
|
|
860
|
-
const e =
|
|
145
|
+
function We(o) {
|
|
146
|
+
const e = o.toLowerCase().trim();
|
|
861
147
|
return e ? e.startsWith("image/") ? "image" : e === "application/pdf" ? "pdf" : e === "text/markdown" ? "markdown" : e === "text/csv" || e === "text/tab-separated-values" ? "table" : e === "application/json" ? "json" : (e.startsWith("text/") || e.startsWith("application/"), "text") : "text";
|
|
862
148
|
}
|
|
863
|
-
const
|
|
149
|
+
const ye = {
|
|
864
150
|
csv: "text/csv",
|
|
865
151
|
tsv: "text/tab-separated-values",
|
|
866
152
|
json: "application/json",
|
|
@@ -884,21 +170,22 @@ const Tn = {
|
|
|
884
170
|
yml: "text/yaml",
|
|
885
171
|
yaml: "text/yaml"
|
|
886
172
|
};
|
|
887
|
-
function
|
|
888
|
-
const
|
|
889
|
-
return
|
|
173
|
+
function ze(o) {
|
|
174
|
+
const n = (o.split("?")[0]?.split("#")[0] ?? "").split(".").pop()?.toLowerCase();
|
|
175
|
+
return n ? ye[n] ?? null : null;
|
|
890
176
|
}
|
|
891
177
|
export {
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
178
|
+
De as CollaborativeMarkdownEditor,
|
|
179
|
+
Oe as DefaultRichTextCodeEditor,
|
|
180
|
+
He as DefaultRichTextDataTable,
|
|
181
|
+
Xe as LazyMarkdownEditor,
|
|
182
|
+
Ve as MarkdownEditor,
|
|
183
|
+
Ge as MarkdownPreview,
|
|
184
|
+
Je as PromptEditor,
|
|
185
|
+
Ke as RichMessage,
|
|
186
|
+
Qe as generateEditorStateFromString,
|
|
187
|
+
Ze as getTextFromSerializedEditorState,
|
|
188
|
+
We as inferResourceTypeFromMediaType,
|
|
189
|
+
ze as mediaTypeFromPath
|
|
903
190
|
};
|
|
904
191
|
//# sourceMappingURL=rich-text.js.map
|