@pstdio/ui 0.3.1 → 0.5.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-DwEDwpo2.js +124 -0
- package/dist/MermaidComponent-DwEDwpo2.js.map +1 -0
- package/dist/chat-ui.js +610 -505
- package/dist/chat-ui.js.map +1 -1
- package/dist/components/attached-panel.d.ts +9 -0
- package/dist/components/attached-panel.utils.d.ts +6 -0
- package/dist/components/bubble-button.d.ts +10 -0
- package/dist/components/bubble-panel.d.ts +18 -0
- package/dist/components/chat-ui/components/chat-input-actions.d.ts +10 -0
- package/dist/components/chat-ui/components/chat-panel-sticky-user-message.d.ts +1 -1
- package/dist/components/chat-ui/components/chat-panel.d.ts +1 -0
- package/dist/components/chat-ui/tool-rendering/apply-patch-renderer.d.ts +2 -0
- package/dist/components/chat-ui/tool-rendering/default-renderers.d.ts +8 -7
- package/dist/components/chat-ui/tool-rendering/edit-renderer.d.ts +2 -0
- package/dist/components/chat-ui/tool-rendering/shared.d.ts +52 -0
- package/dist/components/chat-ui/tool-rendering/standard-renderers.d.ts +6 -0
- package/dist/components/chat-ui/tool-rendering/todo-write-renderer.d.ts +2 -0
- package/dist/components/diff-card.d.ts +3 -0
- package/dist/components/diff-drawer.d.ts +1 -0
- package/dist/components/layout.d.ts +1 -2
- package/dist/components/menu-item.d.ts +2 -1
- package/dist/components/panel-header.constants.d.ts +1 -0
- package/dist/components/resource-context-menu.d.ts +20 -0
- package/dist/components/rich-text/markdown-editor/markdown-editor.d.ts +1 -0
- package/dist/components/rich-text/prompt-input/plugins/ReferencePlugin/nodes/ReferenceNode/ReferenceNode.d.ts +2 -1
- package/dist/components/rich-text/shared/components/content-editable.d.ts +2 -1
- package/dist/components/rich-text/shared/plugins/CodePlugin/CodeBlockActionsPlugin.d.ts +4 -0
- package/dist/components/rich-text/shared/plugins/CodePlugin/CodeBlockPlugin.d.ts +2 -0
- package/dist/components/rich-text/shared/plugins/CodePlugin/CodeHighlightingPlugin.d.ts +1 -0
- package/dist/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/resolve-block-type.d.ts +17 -0
- package/dist/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/should-show-floating-toolbar.d.ts +11 -0
- package/dist/components/rich-text/shared/plugins/MermaidPlugin/MermaidComponent.d.ts +6 -0
- package/dist/components/rich-text/shared/plugins/MermaidPlugin/MermaidNode.d.ts +23 -0
- package/dist/components/rich-text/shared/plugins/MermaidPlugin/index.d.ts +1 -0
- package/dist/components/rich-text/shared/transformers/markdown-transformers.d.ts +1 -0
- package/dist/components/rich-text/utils/markdown.d.ts +1 -0
- package/dist/components/searchable-menu.d.ts +35 -2
- package/dist/components/session-indicator.d.ts +2 -2
- package/dist/components/sidebar/sidebar-footer.d.ts +6 -0
- package/dist/components/sidebar/sidebar-header.d.ts +7 -0
- package/dist/components/sidebar/sidebar-project-menu.d.ts +10 -0
- package/dist/components/sidebar/sidebar.d.ts +2 -0
- package/dist/components/sidebar/sidebar.store.d.ts +47 -0
- package/dist/components/{sidebar-next/sidebar-next.types.d.ts → sidebar/sidebar.types.d.ts} +3 -2
- package/dist/components/sidebar-tree/sidebar-node-content.d.ts +9 -0
- package/dist/components/sidebar-tree/sidebar-tree.d.ts +1 -1
- package/dist/components/sidebar-tree/sidebar-tree.types.d.ts +15 -3
- package/dist/components/tickets/tag-badge.d.ts +10 -0
- package/dist/components/tickets/tag-option-icon.d.ts +2 -0
- package/dist/components/tickets/ticket-board.d.ts +2 -0
- package/dist/components/tickets/ticket-card.d.ts +12 -7
- package/dist/components/tickets/ticket-grouping.d.ts +2 -2
- package/dist/components/tickets/ticket-list.d.ts +6 -1
- package/dist/components/tickets/tickets-workspace.d.ts +9 -3
- package/dist/components/tickets/types.d.ts +22 -5
- package/dist/components/tickets/workspace-helpers.d.ts +13 -0
- package/dist/components/workspace-badge.d.ts +22 -0
- package/dist/get-file-type-icon-Bwqf1WXA.js +101 -0
- package/dist/get-file-type-icon-Bwqf1WXA.js.map +1 -0
- package/dist/index.d.ts +22 -21
- package/dist/index.js +2303 -1963
- package/dist/index.js.map +1 -1
- package/dist/rich-message-BVRk9BSD.js +1503 -0
- package/dist/rich-message-BVRk9BSD.js.map +1 -0
- package/dist/rich-text.js +442 -279
- package/dist/rich-text.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/test-utils/local-storage.d.ts +1 -0
- package/dist/theme/global.d.ts +3 -0
- package/dist/theme/primitives/colors.d.ts +116 -0
- package/dist/theme/recipes/button.d.ts +13 -13
- package/dist/theme/recipes/dialog.d.ts +1 -1
- package/dist/theme/recipes/drawer.d.ts +1 -1
- package/dist/theme/recipes/menu.d.ts +1 -1
- package/dist/theme/recipes/popover.d.ts +1 -1
- package/dist/theme/recipes/tooltip.d.ts +1 -1
- package/dist/theme/tokens/colors.d.ts +162 -8
- package/dist/{theme-BFV2Q048.js → theme-D0VvFB1Y.js} +292 -154
- package/dist/theme-D0VvFB1Y.js.map +1 -0
- package/dist/theme.js +1 -1
- package/package.json +4 -2
- package/dist/components/breadcrumb.stories.d.ts +0 -25
- package/dist/components/button.stories.d.ts +0 -18
- package/dist/components/chat-ui/components/ai-conversation.stories.d.ts +0 -6
- package/dist/components/chat-ui/components/ai-conversation.test.d.ts +0 -1
- package/dist/components/chat-ui/components/ai-message.stories.d.ts +0 -6
- package/dist/components/chat-ui/components/ai-response.stories.d.ts +0 -7
- package/dist/components/chat-ui/components/attachment-list.stories.d.ts +0 -6
- package/dist/components/chat-ui/components/chat-input.stories.d.ts +0 -7
- package/dist/components/chat-ui/components/chat-panel-alerts.stories.d.ts +0 -9
- package/dist/components/chat-ui/components/chat-panel.sticky-user-message.test.d.ts +0 -1
- package/dist/components/chat-ui/components/chat-panel.stories.d.ts +0 -10
- package/dist/components/chat-ui/components/message-parts-renderer.stories.d.ts +0 -9
- package/dist/components/chat-ui/components/model-swap-separator.stories.d.ts +0 -6
- package/dist/components/chat-ui/components/tool-invocation-timeline.stories.d.ts +0 -6
- package/dist/components/chat-ui/components/workspace-hub.stories.d.ts +0 -6
- package/dist/components/checkbox.stories.d.ts +0 -15
- package/dist/components/column-file-browser.stories.d.ts +0 -15
- package/dist/components/data-table/data-table.stories.d.ts +0 -33
- package/dist/components/delete-confirmation-modal.stories.d.ts +0 -11
- package/dist/components/diff-bubble.stories.d.ts +0 -13
- package/dist/components/diff-drawer.stories.d.ts +0 -8
- package/dist/components/diff-view-adapter.test.d.ts +0 -1
- package/dist/components/documentation/docs-changelog.d.ts +0 -20
- package/dist/components/documentation/docs-changelog.stories.d.ts +0 -15
- package/dist/components/documentation/docs-outline.d.ts +0 -13
- package/dist/components/documentation/docs-outline.stories.d.ts +0 -16
- package/dist/components/documentation/docs-pagination.d.ts +0 -10
- package/dist/components/documentation/docs-pagination.stories.d.ts +0 -14
- package/dist/components/documentation/docs-sidebar.d.ts +0 -14
- package/dist/components/documentation/docs-sidebar.stories.d.ts +0 -7
- package/dist/components/drawer-inline.stories.d.ts +0 -8
- package/dist/components/empty-state.stories.d.ts +0 -34
- package/dist/components/file-selector.stories.d.ts +0 -17
- package/dist/components/folder-picker-dialog.stories.d.ts +0 -11
- package/dist/components/info-card.stories.d.ts +0 -41
- package/dist/components/item-section.stories.d.ts +0 -17
- package/dist/components/layout.stories.d.ts +0 -11
- package/dist/components/menu-item.stories.d.ts +0 -72
- package/dist/components/open-source-notices-screen.stories.d.ts +0 -12
- package/dist/components/panel-menu.d.ts +0 -9
- package/dist/components/panel-menu.stories.d.ts +0 -8
- package/dist/components/param-editor-horizontal.stories.d.ts +0 -19
- package/dist/components/param-editor.stories.d.ts +0 -24
- package/dist/components/properties.stories.d.ts +0 -17
- package/dist/components/resource-badge.stories.d.ts +0 -7
- package/dist/components/rich-text/collaborative-markdown-editor/collaborative-markdown-editor.stories.d.ts +0 -9
- package/dist/components/rich-text/markdown-editor/markdown-editor.stories.d.ts +0 -7
- package/dist/components/rich-text/prompt-input/prompt-input.stories.d.ts +0 -8
- package/dist/components/rich-text/rich-message/rich-message.stories.d.ts +0 -6
- package/dist/components/rich-text/shared/nodes/DataTableNode.stories.d.ts +0 -7
- package/dist/components/rich-text/shared/plugins/CodePlugin/CodeNode.d.ts +0 -21
- package/dist/components/rich-text/shared/plugins/CodePlugin/CodeNode.test.d.ts +0 -1
- package/dist/components/scroll-area.stories.d.ts +0 -7
- package/dist/components/searchable-menu.stories.d.ts +0 -6
- package/dist/components/searchable-menu.test.d.ts +0 -1
- package/dist/components/session-indicator.stories.d.ts +0 -11
- package/dist/components/sidebar-next/sidebar-next-footer.d.ts +0 -6
- package/dist/components/sidebar-next/sidebar-next-header.d.ts +0 -7
- package/dist/components/sidebar-next/sidebar-next.d.ts +0 -2
- package/dist/components/sidebar-next/sidebar-next.store.d.ts +0 -47
- package/dist/components/sidebar-next/sidebar-next.store.test.d.ts +0 -1
- package/dist/components/sidebar-next/sidebar-next.stories.d.ts +0 -10
- package/dist/components/sidebar-tree/sidebar-tree-searchable-action-menu.stories.d.ts +0 -6
- package/dist/components/sidebar-tree/sidebar-tree.stories.d.ts +0 -13
- package/dist/components/slider.stories.d.ts +0 -15
- package/dist/components/style-guide.stories.d.ts +0 -28
- package/dist/components/switch.stories.d.ts +0 -16
- package/dist/components/tickets/display-menu.stories.d.ts +0 -6
- package/dist/components/tickets/filter-menu.stories.d.ts +0 -6
- package/dist/components/tickets/ticket-board.stories.d.ts +0 -5
- package/dist/components/tickets/ticket-card.stories.d.ts +0 -18
- package/dist/components/tickets/ticket-grouping.test.d.ts +0 -1
- package/dist/components/tickets/ticket-list.stories.d.ts +0 -10
- package/dist/components/tickets/tickets-workspace.stories.d.ts +0 -10
- package/dist/components/tickets/use-workspace-store.test.d.ts +0 -1
- package/dist/components/toaster.stories.d.ts +0 -11
- package/dist/rich-message-ZT2CEiwt.js +0 -1406
- package/dist/rich-message-ZT2CEiwt.js.map +0 -1
- package/dist/theme-BFV2Q048.js.map +0 -1
- package/dist/tooltip-Dze4WXVl.js +0 -86
- package/dist/tooltip-Dze4WXVl.js.map +0 -1
package/dist/rich-text.js
CHANGED
|
@@ -1,44 +1,146 @@
|
|
|
1
|
-
import { jsx as t, jsxs 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 {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { $
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { $
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import { jsx as t, jsxs as ie } from "react/jsx-runtime";
|
|
2
|
+
import { c as ee } from "react/compiler-runtime";
|
|
3
|
+
import { e as he, a as ge, C as ve, I as Ce, E as be, b as xe, s as Fe, n as $e, c as fe, T as De, d as je } from "./rich-message-BVRk9BSD.js";
|
|
4
|
+
import { D as vo, f as Co, R as bo, P as xo, R as Eo, g as To, h as yo } from "./rich-message-BVRk9BSD.js";
|
|
5
|
+
import { IconButton as $, Stack as We, Text as Z, Box as Ee, Flex as de } from "@chakra-ui/react";
|
|
6
|
+
import { LexicalCollaboration as Ue } from "@lexical/react/LexicalCollaborationContext";
|
|
7
|
+
import { CollaborationPluginV2__EXPERIMENTAL as Ke } from "@lexical/react/LexicalCollaborationPlugin";
|
|
8
|
+
import { LexicalComposer as Te } from "@lexical/react/LexicalComposer";
|
|
9
|
+
import { LexicalErrorBoundary as ye } from "@lexical/react/LexicalErrorBoundary";
|
|
10
|
+
import { HorizontalRulePlugin as _e } from "@lexical/react/LexicalHorizontalRulePlugin";
|
|
11
|
+
import { LinkPlugin as Se } from "@lexical/react/LexicalLinkPlugin";
|
|
12
|
+
import { ListPlugin as Re } from "@lexical/react/LexicalListPlugin";
|
|
13
|
+
import { RichTextPlugin as we } from "@lexical/react/LexicalRichTextPlugin";
|
|
14
|
+
import { TabIndentationPlugin as ke } from "@lexical/react/LexicalTabIndentationPlugin";
|
|
15
|
+
import { useState as H, useRef as te, useEffect as G } from "react";
|
|
16
|
+
import { WebsocketProvider as qe } from "y-websocket";
|
|
17
|
+
import * as Ve from "yjs";
|
|
18
|
+
import { $isCodeNode as le, $createCodeNode as Ge } from "@lexical/code";
|
|
19
|
+
import { useLexicalComposerContext as Le } from "@lexical/react/LexicalComposerContext";
|
|
20
|
+
import { mergeRegister as Ie, $findMatchingParent as me } from "@lexical/utils";
|
|
21
|
+
import { SELECTION_CHANGE_COMMAND as Me, COMMAND_PRIORITY_CRITICAL as Ne, $getSelection as J, $isRangeSelection as Y, $isRootOrShadowRoot as Ye, CLICK_COMMAND as Xe, COMMAND_PRIORITY_HIGH as Qe, FORMAT_TEXT_COMMAND as re, $createParagraphNode as ue, $getRoot as Ze } from "lexical";
|
|
22
|
+
import { Check as Je, Copy as et, Code2 as tt, List as ot, ListOrdered as nt, ListTodo as it } from "lucide-react";
|
|
23
|
+
import { createPortal as Pe } from "react-dom";
|
|
24
|
+
import { T as D } from "./get-file-type-icon-Bwqf1WXA.js";
|
|
25
|
+
import { $isListNode as ae, REMOVE_LIST_COMMAND as lt, INSERT_CHECK_LIST_COMMAND as rt, INSERT_ORDERED_LIST_COMMAND as at, INSERT_UNORDERED_LIST_COMMAND as st } from "@lexical/list";
|
|
26
|
+
import { $isHeadingNode as ct, $createHeadingNode as dt } from "@lexical/rich-text";
|
|
27
|
+
import { $setBlocksType as ne } from "@lexical/selection";
|
|
28
|
+
import { $convertFromMarkdownString as mt, $convertToMarkdownString as ft } from "@lexical/markdown";
|
|
29
|
+
import { AutoFocusPlugin as ut } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
30
|
+
import { CheckListPlugin as pt } from "@lexical/react/LexicalCheckListPlugin";
|
|
31
|
+
import { HistoryPlugin as ht } from "@lexical/react/LexicalHistoryPlugin";
|
|
32
|
+
import { OnChangePlugin as gt } from "@lexical/react/LexicalOnChangePlugin";
|
|
33
|
+
function se(o) {
|
|
34
|
+
const e = J();
|
|
35
|
+
if (!Y(e))
|
|
36
|
+
return null;
|
|
37
|
+
const i = e.anchor.getNode(), n = le(i) ? i : me(i, (a) => le(a));
|
|
38
|
+
if (!le(n))
|
|
39
|
+
return null;
|
|
40
|
+
const s = o.getElementByKey(n.getKey());
|
|
41
|
+
return s instanceof HTMLElement ? s : null;
|
|
42
|
+
}
|
|
43
|
+
function vt(o) {
|
|
44
|
+
return o instanceof HTMLElement ? o.closest(".rich-text__code") : null;
|
|
45
|
+
}
|
|
46
|
+
function Ct(o, e) {
|
|
47
|
+
const i = o.getBoundingClientRect(), n = e.getBoundingClientRect();
|
|
48
|
+
return {
|
|
49
|
+
top: n.top - i.top + 6,
|
|
50
|
+
left: n.right - i.left - 30
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function Be(o) {
|
|
54
|
+
const e = ee(31), {
|
|
55
|
+
anchorElem: i
|
|
56
|
+
} = o, [n] = Le(), [s, a] = H(null), [m, d] = H(!1), c = te(null);
|
|
57
|
+
let v, C;
|
|
58
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (v = () => () => {
|
|
59
|
+
c.current !== null && window.clearTimeout(c.current);
|
|
60
|
+
}, C = [], e[0] = v, e[1] = C) : (v = e[0], C = e[1]), G(v, C);
|
|
61
|
+
let L, f;
|
|
62
|
+
e[2] !== n ? (L = () => {
|
|
63
|
+
const p = n.getRootElement();
|
|
64
|
+
if (!p)
|
|
65
|
+
return;
|
|
66
|
+
const S = (N) => {
|
|
67
|
+
const M = vt(N.target);
|
|
68
|
+
a(M instanceof HTMLElement ? M : null);
|
|
69
|
+
}, k = () => {
|
|
70
|
+
n.getEditorState().read(() => {
|
|
71
|
+
const N = se(n);
|
|
72
|
+
a(N);
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
return p.addEventListener("pointermove", S), p.addEventListener("pointerleave", k), () => {
|
|
76
|
+
p.removeEventListener("pointermove", S), p.removeEventListener("pointerleave", k);
|
|
77
|
+
};
|
|
78
|
+
}, f = [n], e[2] = n, e[3] = L, e[4] = f) : (L = e[3], f = e[4]), G(L, f);
|
|
79
|
+
let u, R;
|
|
80
|
+
if (e[5] !== n ? (u = () => Ie(n.registerUpdateListener((p) => {
|
|
81
|
+
const {
|
|
82
|
+
editorState: S
|
|
83
|
+
} = p;
|
|
84
|
+
S.read(() => {
|
|
85
|
+
const k = se(n);
|
|
86
|
+
k && a(k);
|
|
87
|
+
});
|
|
88
|
+
}), n.registerCommand(Me, () => (n.getEditorState().read(() => {
|
|
89
|
+
const p = se(n);
|
|
90
|
+
if (!p) {
|
|
91
|
+
a(bt);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
a(p);
|
|
95
|
+
}), !1), Ne)), R = [n], e[5] = n, e[6] = u, e[7] = R) : (u = e[6], R = e[7]), G(u, R), !i || !s)
|
|
96
|
+
return null;
|
|
97
|
+
let T;
|
|
98
|
+
e[8] !== s || e[9] !== i ? (T = Ct(i, s), e[8] = s, e[9] = i, e[10] = T) : T = e[10];
|
|
99
|
+
const I = T;
|
|
100
|
+
let E;
|
|
101
|
+
e[11] !== I.left || e[12] !== I.top ? (E = {
|
|
102
|
+
position: "absolute",
|
|
103
|
+
top: I.top,
|
|
104
|
+
left: I.left
|
|
105
|
+
}, e[11] = I.left, e[12] = I.top, e[13] = E) : E = e[13];
|
|
106
|
+
const l = E, r = m ? "Copied" : "Copy code", y = m ? "Copied" : "Copy code";
|
|
107
|
+
let b;
|
|
108
|
+
e[14] !== s.textContent ? (b = async () => {
|
|
109
|
+
const p = s.textContent ?? "";
|
|
110
|
+
try {
|
|
111
|
+
await navigator.clipboard.writeText(p), d(!0), c.current !== null && window.clearTimeout(c.current), c.current = window.setTimeout(() => {
|
|
112
|
+
d(!1);
|
|
113
|
+
}, 1200);
|
|
114
|
+
} catch {
|
|
115
|
+
d(!1);
|
|
116
|
+
}
|
|
117
|
+
}, e[14] = s.textContent, e[15] = b) : b = e[15];
|
|
118
|
+
let h;
|
|
119
|
+
e[16] !== m ? (h = m ? /* @__PURE__ */ t(Je, { size: 14 }) : /* @__PURE__ */ t(et, { size: 14 }), e[16] = m, e[17] = h) : h = e[17];
|
|
120
|
+
let g;
|
|
121
|
+
e[18] !== y || e[19] !== b || e[20] !== h ? (g = /* @__PURE__ */ t($, { "aria-label": y, variant: "surface", size: "xs", onClick: b, children: h }), e[18] = y, e[19] = b, e[20] = h, e[21] = g) : g = e[21];
|
|
122
|
+
let x;
|
|
123
|
+
e[22] !== g || e[23] !== r ? (x = /* @__PURE__ */ t(D, { content: r, children: g }), e[22] = g, e[23] = r, e[24] = x) : x = e[24];
|
|
124
|
+
let _;
|
|
125
|
+
e[25] !== l || e[26] !== x ? (_ = /* @__PURE__ */ t("div", { className: "code-block-actions", style: l, children: x }), e[25] = l, e[26] = x, e[27] = _) : _ = e[27];
|
|
126
|
+
let w;
|
|
127
|
+
return e[28] !== i || e[29] !== _ ? (w = Pe(_, i), e[28] = i, e[29] = _, e[30] = w) : w = e[30], w;
|
|
128
|
+
}
|
|
129
|
+
function bt(o) {
|
|
130
|
+
return o?.matches(":hover") ? o : null;
|
|
131
|
+
}
|
|
132
|
+
const xt = 10, Et = 5;
|
|
133
|
+
function pe(o, e, i, n = xt, s = Et) {
|
|
134
|
+
const a = i.parentElement;
|
|
135
|
+
if (o === null || !a) {
|
|
34
136
|
e.style.opacity = "0", e.style.transform = "translate(-10000px, -10000px)";
|
|
35
137
|
return;
|
|
36
138
|
}
|
|
37
|
-
const
|
|
38
|
-
let
|
|
39
|
-
|
|
139
|
+
const m = e.getBoundingClientRect(), d = i.getBoundingClientRect(), c = a.getBoundingClientRect();
|
|
140
|
+
let v = o.top - n, C = o.left - s;
|
|
141
|
+
v < c.top && (v += m.height + o.height + n * 2), C + m.width > c.right && (C = c.right - m.width - s), v -= d.top, C -= d.left, e.style.opacity = "1", e.style.transform = `translate(${C}px, ${v}px)`;
|
|
40
142
|
}
|
|
41
|
-
const
|
|
143
|
+
const Tt = {
|
|
42
144
|
bullet: "Bulleted List",
|
|
43
145
|
check: "Check List",
|
|
44
146
|
code: "Code Block",
|
|
@@ -51,130 +153,169 @@ const Qe = -4, Ze = {
|
|
|
51
153
|
number: "Numbered List",
|
|
52
154
|
paragraph: "Normal",
|
|
53
155
|
quote: "Quote"
|
|
54
|
-
},
|
|
55
|
-
const
|
|
56
|
-
return
|
|
57
|
-
})) ?? o.getTopLevelElementOrThrow(),
|
|
58
|
-
const e =
|
|
59
|
-
if (
|
|
156
|
+
}, yt = (o) => o in Tt ? o : null, _t = (o) => (o.getKey() === "root" ? o : me(o, (i) => {
|
|
157
|
+
const n = i.getParent();
|
|
158
|
+
return n !== null && Ye(n);
|
|
159
|
+
})) ?? o.getTopLevelElementOrThrow(), St = (o) => {
|
|
160
|
+
const e = _t(o);
|
|
161
|
+
if (ae(e))
|
|
60
162
|
return e.getListType();
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
63
|
-
return
|
|
64
|
-
const
|
|
65
|
-
return
|
|
163
|
+
const i = me(o, (s) => ae(s));
|
|
164
|
+
if (i !== null && ae(i))
|
|
165
|
+
return i.getListType();
|
|
166
|
+
const n = ct(e) ? e.getTag() : e.getType();
|
|
167
|
+
return yt(n);
|
|
66
168
|
};
|
|
67
|
-
function
|
|
169
|
+
function Rt(o) {
|
|
170
|
+
const {
|
|
171
|
+
hasSelection: e,
|
|
172
|
+
isRangeSelection: i,
|
|
173
|
+
isCollapsed: n,
|
|
174
|
+
hasNativeSelection: s,
|
|
175
|
+
hasNativeRange: a,
|
|
176
|
+
isAnchorInsideEditor: m,
|
|
177
|
+
isEditorEditable: d
|
|
178
|
+
} = o;
|
|
179
|
+
return e && i && !n && s && a && m && d;
|
|
180
|
+
}
|
|
181
|
+
const wt = -4;
|
|
182
|
+
function ce() {
|
|
183
|
+
const o = ee(1);
|
|
184
|
+
let e;
|
|
185
|
+
return o[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ t("span", { style: {
|
|
186
|
+
display: "inline-flex",
|
|
187
|
+
height: "1rem",
|
|
188
|
+
margin: "0 0.25rem",
|
|
189
|
+
borderLeft: "1px solid var(--chakra-colors-border-muted)"
|
|
190
|
+
} }), o[0] = e) : e = o[0], e;
|
|
191
|
+
}
|
|
192
|
+
function kt({
|
|
68
193
|
editor: o,
|
|
69
194
|
anchorElem: e,
|
|
70
|
-
isToolbarActive:
|
|
71
|
-
setIsToolbarActive:
|
|
195
|
+
isToolbarActive: i,
|
|
196
|
+
setIsToolbarActive: n
|
|
72
197
|
}) {
|
|
73
|
-
const
|
|
74
|
-
}),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
198
|
+
const s = te(null), [a, m] = H("paragraph"), [d, c] = H(!1), [v, C] = H(!1), [L, f] = H(!1), u = te(() => {
|
|
199
|
+
}), R = (l) => {
|
|
200
|
+
o.update(() => {
|
|
201
|
+
const r = J();
|
|
202
|
+
if (Y(r)) {
|
|
203
|
+
if (a === l) {
|
|
204
|
+
ne(r, ue);
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
ne(r, () => dt(l));
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}, T = (l) => {
|
|
211
|
+
if (a === l) {
|
|
212
|
+
o.dispatchCommand(lt, void 0);
|
|
80
213
|
return;
|
|
81
214
|
}
|
|
215
|
+
const r = {
|
|
216
|
+
bullet: st,
|
|
217
|
+
number: at,
|
|
218
|
+
check: rt
|
|
219
|
+
}[l];
|
|
220
|
+
o.dispatchCommand(r, void 0);
|
|
221
|
+
}, I = () => {
|
|
82
222
|
o.update(() => {
|
|
83
|
-
const
|
|
84
|
-
|
|
223
|
+
const l = J();
|
|
224
|
+
if (Y(l)) {
|
|
225
|
+
if (a === "code") {
|
|
226
|
+
ne(l, ue);
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
ne(l, () => Ge());
|
|
230
|
+
}
|
|
85
231
|
});
|
|
86
|
-
},
|
|
87
|
-
l
|
|
88
|
-
|
|
89
|
-
l
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if (!J(r)) return;
|
|
93
|
-
f(r.hasFormat("bold")), p(r.hasFormat("italic")), M(r.hasFormat("underline"));
|
|
94
|
-
const i = tt(r.anchor.getNode());
|
|
95
|
-
i && s(i);
|
|
232
|
+
}, E = () => {
|
|
233
|
+
const l = J();
|
|
234
|
+
if (!Y(l)) return;
|
|
235
|
+
c(l.hasFormat("bold")), C(l.hasFormat("italic")), f(l.hasFormat("underline"));
|
|
236
|
+
const r = St(l.anchor.getNode());
|
|
237
|
+
r && m(r);
|
|
96
238
|
};
|
|
97
|
-
return
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
239
|
+
return u.current = () => {
|
|
240
|
+
const l = J(), r = s.current, y = window.getSelection();
|
|
241
|
+
if (r === null)
|
|
100
242
|
return;
|
|
101
|
-
const b = o.getRootElement();
|
|
102
|
-
if (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
243
|
+
const b = o.getRootElement(), h = y !== null, g = h && y.rangeCount > 0, x = !!b?.contains(h ? y.anchorNode : null);
|
|
244
|
+
if (Rt({
|
|
245
|
+
hasSelection: l !== null,
|
|
246
|
+
isRangeSelection: Y(l),
|
|
247
|
+
isCollapsed: Y(l) ? l.isCollapsed() : !1,
|
|
248
|
+
hasNativeSelection: h,
|
|
249
|
+
hasNativeRange: g,
|
|
250
|
+
isAnchorInsideEditor: x,
|
|
251
|
+
isEditorEditable: o.isEditable()
|
|
252
|
+
}) && y) {
|
|
253
|
+
const _ = y.getRangeAt(0).getBoundingClientRect();
|
|
254
|
+
if (_) {
|
|
255
|
+
const w = new DOMRect(_.left, _.bottom, 0, 0);
|
|
256
|
+
pe(w, r, e, wt);
|
|
107
257
|
}
|
|
108
|
-
|
|
258
|
+
n(!0);
|
|
109
259
|
} else
|
|
110
|
-
b !== null &&
|
|
111
|
-
return
|
|
112
|
-
},
|
|
113
|
-
const
|
|
260
|
+
b !== null && pe(null, r, e), n(!1);
|
|
261
|
+
return E(), !0;
|
|
262
|
+
}, G(() => {
|
|
263
|
+
const l = e.parentElement, r = () => {
|
|
114
264
|
o.getEditorState().read(() => {
|
|
115
|
-
|
|
265
|
+
u.current();
|
|
116
266
|
});
|
|
117
267
|
};
|
|
118
|
-
return window.addEventListener("resize",
|
|
119
|
-
window.removeEventListener("resize",
|
|
268
|
+
return window.addEventListener("resize", r), l && l.addEventListener("scroll", r), () => {
|
|
269
|
+
window.removeEventListener("resize", r), l && l.removeEventListener("scroll", r);
|
|
120
270
|
};
|
|
121
|
-
}, [e, o]),
|
|
122
|
-
editorState:
|
|
271
|
+
}, [e, o]), G(() => Ie(o.registerUpdateListener(({
|
|
272
|
+
editorState: l
|
|
123
273
|
}) => {
|
|
124
|
-
|
|
125
|
-
|
|
274
|
+
l.read(() => {
|
|
275
|
+
u.current();
|
|
126
276
|
});
|
|
127
|
-
}), o.registerCommand(
|
|
128
|
-
const
|
|
129
|
-
return
|
|
130
|
-
},
|
|
131
|
-
/* @__PURE__ */ t(
|
|
132
|
-
o.dispatchCommand(
|
|
133
|
-
}, variant: "ghost", "aria-label": "Bold", size: "xs", children: /* @__PURE__ */ t(
|
|
134
|
-
/* @__PURE__ */ t(
|
|
135
|
-
o.dispatchCommand(
|
|
136
|
-
}, variant: "ghost", "aria-label": "Italic", size: "xs", children: /* @__PURE__ */ t(
|
|
137
|
-
/* @__PURE__ */ t(
|
|
138
|
-
o.dispatchCommand(
|
|
139
|
-
}, variant: "ghost", "aria-label": "Underline", size: "xs", children: /* @__PURE__ */ t(
|
|
140
|
-
/* @__PURE__ */ t(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
/* @__PURE__ */ t(
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
/* @__PURE__ */ t(
|
|
155
|
-
|
|
156
|
-
height: "100%",
|
|
157
|
-
borderColor: "var(--chakra-colors-border-muted)"
|
|
158
|
-
} }) }),
|
|
159
|
-
/* @__PURE__ */ t(z, { content: "Bulleted List", children: /* @__PURE__ */ t(D, { "data-active": l === "bullet" || void 0, variant: "ghost", "aria-label": "Bulleted List", size: "xs", onClick: P, children: /* @__PURE__ */ t($e, { size: 14 }) }) }),
|
|
160
|
-
/* @__PURE__ */ t(z, { content: "Numbered List", children: /* @__PURE__ */ t(D, { "data-active": l === "number" || void 0, variant: "ghost", "aria-label": "Numbered List", size: "xs", onClick: $, children: /* @__PURE__ */ t(je, { size: 14 }) }) })
|
|
277
|
+
}), o.registerCommand(Me, (l) => (u.current(), !1), Ne), o.registerCommand(Xe, (l) => {
|
|
278
|
+
const r = J();
|
|
279
|
+
return Y(r) && u.current(), !1;
|
|
280
|
+
}, Qe)), [o]), /* @__PURE__ */ t("div", { ref: s, className: `floating-text-format-toolbar ${i ? "active" : ""}`, children: /* @__PURE__ */ ie(We, { direction: "row", gap: "0.5", alignItems: "center", children: [
|
|
281
|
+
/* @__PURE__ */ t(D, { content: "Bold", children: /* @__PURE__ */ t($, { "data-active": d || void 0, onClick: () => {
|
|
282
|
+
o.dispatchCommand(re, "bold");
|
|
283
|
+
}, variant: "ghost", "aria-label": "Bold", size: "xs", children: /* @__PURE__ */ t(Z, { fontWeight: "bold", fontSize: ".75rem", children: "B" }) }) }),
|
|
284
|
+
/* @__PURE__ */ t(D, { content: "Italic", children: /* @__PURE__ */ t($, { "data-active": v || void 0, onClick: () => {
|
|
285
|
+
o.dispatchCommand(re, "italic");
|
|
286
|
+
}, variant: "ghost", "aria-label": "Italic", size: "xs", children: /* @__PURE__ */ t(Z, { fontStyle: "italic", fontSize: ".75rem", children: "I" }) }) }),
|
|
287
|
+
/* @__PURE__ */ t(D, { content: "Underline", children: /* @__PURE__ */ t($, { "data-active": L || void 0, onClick: () => {
|
|
288
|
+
o.dispatchCommand(re, "underline");
|
|
289
|
+
}, variant: "ghost", "aria-label": "Underline", size: "xs", children: /* @__PURE__ */ t(Z, { textDecoration: "underline", fontSize: ".75rem", children: "U" }) }) }),
|
|
290
|
+
/* @__PURE__ */ t(ce, {}),
|
|
291
|
+
/* @__PURE__ */ t(D, { content: "Heading 1", children: /* @__PURE__ */ t($, { "data-active": a === "h1" || void 0, variant: "ghost", "aria-label": "Heading 1", size: "xs", onClick: () => {
|
|
292
|
+
R("h1");
|
|
293
|
+
}, children: /* @__PURE__ */ t(Z, { fontWeight: "thin", fontSize: ".8rem", children: "H1" }) }) }),
|
|
294
|
+
/* @__PURE__ */ t(D, { content: "Heading 2", children: /* @__PURE__ */ t($, { "data-active": a === "h2" || void 0, variant: "ghost", "aria-label": "Heading 2", size: "xs", onClick: () => {
|
|
295
|
+
R("h2");
|
|
296
|
+
}, children: /* @__PURE__ */ t(Z, { fontWeight: "thin", fontSize: ".8rem", children: "H2" }) }) }),
|
|
297
|
+
/* @__PURE__ */ t(D, { content: "Heading 3", children: /* @__PURE__ */ t($, { "data-active": a === "h3" || void 0, variant: "ghost", "aria-label": "Heading 3", size: "xs", onClick: () => {
|
|
298
|
+
R("h3");
|
|
299
|
+
}, children: /* @__PURE__ */ t(Z, { fontWeight: "thin", fontSize: ".8rem", children: "H3" }) }) }),
|
|
300
|
+
/* @__PURE__ */ t(ce, {}),
|
|
301
|
+
/* @__PURE__ */ t(D, { content: "Code Block", children: /* @__PURE__ */ t($, { "data-active": a === "code" || void 0, variant: "ghost", "aria-label": "Code Block", size: "xs", onClick: I, children: /* @__PURE__ */ t(tt, { size: 14 }) }) }),
|
|
302
|
+
/* @__PURE__ */ t(ce, {}),
|
|
303
|
+
/* @__PURE__ */ t(D, { content: "Bulleted List", children: /* @__PURE__ */ t($, { "data-active": a === "bullet" || void 0, variant: "ghost", "aria-label": "Bulleted List", size: "xs", onClick: () => T("bullet"), children: /* @__PURE__ */ t(ot, { size: 14 }) }) }),
|
|
304
|
+
/* @__PURE__ */ t(D, { content: "Numbered List", children: /* @__PURE__ */ t($, { "data-active": a === "number" || void 0, variant: "ghost", "aria-label": "Numbered List", size: "xs", onClick: () => T("number"), children: /* @__PURE__ */ t(nt, { size: 14 }) }) }),
|
|
305
|
+
/* @__PURE__ */ t(D, { content: "Check List", children: /* @__PURE__ */ t($, { "data-active": a === "check" || void 0, variant: "ghost", "aria-label": "Check List", size: "xs", onClick: () => T("check"), children: /* @__PURE__ */ t(it, { size: 14 }) }) })
|
|
161
306
|
] }) });
|
|
162
307
|
}
|
|
163
|
-
function
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
let
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
const {
|
|
172
|
-
anchorElem: e
|
|
173
|
-
} = o, n = e === void 0 ? document.body : e, [a] = Me();
|
|
174
|
-
return nt(a, n);
|
|
308
|
+
function Ae(o) {
|
|
309
|
+
const e = ee(7), {
|
|
310
|
+
anchorElem: i
|
|
311
|
+
} = o, n = i === void 0 ? document.body : i, [s] = Le(), [a, m] = H(!1);
|
|
312
|
+
let d;
|
|
313
|
+
e[0] !== n || e[1] !== s || e[2] !== a ? (d = /* @__PURE__ */ t(kt, { editor: s, anchorElem: n, isToolbarActive: a, setIsToolbarActive: m }), e[0] = n, e[1] = s, e[2] = a, e[3] = d) : d = e[3];
|
|
314
|
+
let c;
|
|
315
|
+
return e[4] !== n || e[5] !== d ? (c = Pe(d, n), e[4] = n, e[5] = d, e[6] = c) : c = e[6], c;
|
|
175
316
|
}
|
|
176
|
-
function
|
|
177
|
-
const o =
|
|
317
|
+
function Lt() {
|
|
318
|
+
const o = ee(1);
|
|
178
319
|
let e;
|
|
179
320
|
return o[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ t("style", { children: `
|
|
180
321
|
.collaboration-cursor-container {
|
|
@@ -212,161 +353,183 @@ function it() {
|
|
|
212
353
|
}
|
|
213
354
|
` }), o[0] = e) : e = o[0], e;
|
|
214
355
|
}
|
|
215
|
-
function
|
|
216
|
-
const e =
|
|
217
|
-
roomId:
|
|
218
|
-
wsUrl:
|
|
219
|
-
wsParams:
|
|
220
|
-
userName:
|
|
221
|
-
userColor:
|
|
222
|
-
placeholder:
|
|
356
|
+
function mo(o) {
|
|
357
|
+
const e = ee(42), {
|
|
358
|
+
roomId: i,
|
|
359
|
+
wsUrl: n,
|
|
360
|
+
wsParams: s,
|
|
361
|
+
userName: a,
|
|
362
|
+
userColor: m,
|
|
363
|
+
placeholder: d
|
|
223
364
|
} = o;
|
|
224
|
-
let
|
|
225
|
-
e[0] !==
|
|
226
|
-
const
|
|
227
|
-
let
|
|
228
|
-
e[2] !==
|
|
229
|
-
const
|
|
230
|
-
params:
|
|
365
|
+
let c;
|
|
366
|
+
e[0] !== s ? (c = s === void 0 ? {} : s, e[0] = s, e[1] = c) : c = e[1];
|
|
367
|
+
const v = c, C = a === void 0 ? "Anonymous" : a, L = m === void 0 ? "#30bced" : m, f = te(null), [u, R] = H(null), [T, I] = H(!1), [E] = H(Mt);
|
|
368
|
+
let l;
|
|
369
|
+
e[2] !== E || e[3] !== i || e[4] !== v || e[5] !== n ? (l = () => {
|
|
370
|
+
const q = new qe(n, i, E, {
|
|
371
|
+
params: v,
|
|
231
372
|
connect: !1
|
|
232
373
|
});
|
|
233
|
-
return
|
|
234
|
-
|
|
235
|
-
}),
|
|
236
|
-
}, e[2] =
|
|
237
|
-
const [
|
|
238
|
-
let
|
|
239
|
-
e[7] !==
|
|
240
|
-
|
|
241
|
-
}), b = [
|
|
242
|
-
let
|
|
243
|
-
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
244
|
-
|
|
245
|
-
},
|
|
246
|
-
let
|
|
247
|
-
e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
374
|
+
return q.on("sync", (V) => {
|
|
375
|
+
V && I(!0);
|
|
376
|
+
}), q;
|
|
377
|
+
}, e[2] = E, e[3] = i, e[4] = v, e[5] = n, e[6] = l) : l = e[6];
|
|
378
|
+
const [r] = H(l);
|
|
379
|
+
let y, b;
|
|
380
|
+
e[7] !== r ? (y = () => (r.connect(), () => {
|
|
381
|
+
r.disconnect();
|
|
382
|
+
}), b = [r], e[7] = r, e[8] = y, e[9] = b) : (y = e[8], b = e[9]), G(y, b);
|
|
383
|
+
let h, g;
|
|
384
|
+
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = () => {
|
|
385
|
+
R(f.current);
|
|
386
|
+
}, g = [], e[10] = h, e[11] = g) : (h = e[10], g = e[11]), G(h, g);
|
|
387
|
+
let x;
|
|
388
|
+
e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = {
|
|
248
389
|
namespace: "COLLABORATIVE_EDITOR",
|
|
249
|
-
nodes:
|
|
390
|
+
nodes: ge,
|
|
250
391
|
editorState: null,
|
|
251
|
-
onError:
|
|
392
|
+
onError: It,
|
|
252
393
|
editable: !0,
|
|
253
|
-
theme:
|
|
254
|
-
}, e[12] =
|
|
255
|
-
const
|
|
394
|
+
theme: he
|
|
395
|
+
}, e[12] = x) : x = e[12];
|
|
396
|
+
const _ = x;
|
|
397
|
+
let w;
|
|
398
|
+
e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ t(Lt, {}), e[13] = w) : w = e[13];
|
|
399
|
+
const p = r;
|
|
400
|
+
let S;
|
|
401
|
+
e[14] !== E || e[15] !== i || e[16] !== p || e[17] !== L || e[18] !== C ? (S = /* @__PURE__ */ t(Ke, { id: i, doc: E, provider: p, __shouldBootstrapUnsafe: !1, username: C, cursorColor: L }), e[14] = E, e[15] = i, e[16] = p, e[17] = L, e[18] = C, e[19] = S) : S = e[19];
|
|
402
|
+
let k, N, M, j, W, U;
|
|
403
|
+
e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ t(Se, {}), N = /* @__PURE__ */ t(Re, {}), M = /* @__PURE__ */ t(ke, { maxIndent: 7 }), j = /* @__PURE__ */ t(_e, {}), W = /* @__PURE__ */ t(ve, {}), U = /* @__PURE__ */ t(Ce, {}), e[20] = k, e[21] = N, e[22] = M, e[23] = j, e[24] = W, e[25] = U) : (k = e[20], N = e[21], M = e[22], j = e[23], W = e[24], U = e[25]);
|
|
404
|
+
let z;
|
|
405
|
+
e[26] !== u ? (z = /* @__PURE__ */ t(Be, { anchorElem: u }), e[26] = u, e[27] = z) : z = e[27];
|
|
406
|
+
let O;
|
|
407
|
+
e[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ t(be, {}), e[28] = O) : O = e[28];
|
|
408
|
+
let K;
|
|
409
|
+
e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (K = /* @__PURE__ */ t(xe, { fullWidth: !1 }), e[29] = K) : K = e[29];
|
|
410
|
+
let P;
|
|
411
|
+
e[30] !== d || e[31] !== T ? (P = T && d ? /* @__PURE__ */ t(Ee, { position: "absolute", top: "0", color: "fg.muted", pointerEvents: "none", userSelect: "none", textStyle: "paragraph/M/regular", children: d }) : null, e[30] = d, e[31] = T, e[32] = P) : P = e[32];
|
|
256
412
|
let B;
|
|
257
|
-
e[
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
e[14] !== v || e[15] !== n || e[16] !== H || e[17] !== d || e[18] !== p ? (_ = /* @__PURE__ */ t(Se, { id: n, doc: v, provider: H, __shouldBootstrapUnsafe: !1, username: p, cursorColor: d }), e[14] = v, e[15] = n, e[16] = H, e[17] = d, e[18] = p, e[19] = _) : _ = e[19];
|
|
261
|
-
let N, A, O, S, w;
|
|
262
|
-
e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ t(he, {}), A = /* @__PURE__ */ t(ge, {}), O = /* @__PURE__ */ t(pe, {}), S = /* @__PURE__ */ t(se, {}), w = /* @__PURE__ */ t(ce, {}), e[20] = N, e[21] = A, e[22] = O, e[23] = S, e[24] = w) : (N = e[20], A = e[21], O = e[22], S = e[23], w = e[24]);
|
|
263
|
-
let R;
|
|
264
|
-
e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ t(de, { fullWidth: !1 }), e[25] = R) : R = e[25];
|
|
265
|
-
let C;
|
|
266
|
-
e[26] !== m || e[27] !== P ? (C = P && m ? /* @__PURE__ */ t(me, { position: "absolute", top: "0", color: "fg.muted", pointerEvents: "none", userSelect: "none", textStyle: "paragraph/M/regular", children: m }) : null, e[26] = m, e[27] = P, e[28] = C) : C = e[28];
|
|
267
|
-
let T;
|
|
268
|
-
e[29] !== C ? (T = /* @__PURE__ */ t(be, { contentEditable: R, placeholder: C, ErrorBoundary: ue }), e[29] = C, e[30] = T) : T = e[30];
|
|
269
|
-
let y;
|
|
270
|
-
e[31] !== h ? (y = h ? /* @__PURE__ */ t(xe, { anchorElem: h }) : null, e[31] = h, e[32] = y) : y = e[32];
|
|
413
|
+
e[33] !== P ? (B = /* @__PURE__ */ t(we, { contentEditable: K, placeholder: P, ErrorBoundary: ye }), e[33] = P, e[34] = B) : B = e[34];
|
|
414
|
+
let A;
|
|
415
|
+
e[35] !== u ? (A = u ? /* @__PURE__ */ t(Ae, { anchorElem: u }) : null, e[35] = u, e[36] = A) : A = e[36];
|
|
271
416
|
let F;
|
|
272
|
-
return e[
|
|
273
|
-
|
|
274
|
-
/* @__PURE__ */ t(
|
|
275
|
-
|
|
417
|
+
return e[37] !== S || e[38] !== z || e[39] !== B || e[40] !== A ? (F = /* @__PURE__ */ ie(de, { ref: f, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "visible", children: [
|
|
418
|
+
w,
|
|
419
|
+
/* @__PURE__ */ t(Te, { initialConfig: _, children: /* @__PURE__ */ ie(Ue, { children: [
|
|
420
|
+
S,
|
|
421
|
+
k,
|
|
276
422
|
N,
|
|
277
|
-
|
|
423
|
+
M,
|
|
424
|
+
j,
|
|
425
|
+
W,
|
|
426
|
+
U,
|
|
427
|
+
z,
|
|
278
428
|
O,
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
T,
|
|
282
|
-
y
|
|
429
|
+
B,
|
|
430
|
+
A
|
|
283
431
|
] }) })
|
|
284
|
-
] }), e[
|
|
432
|
+
] }), e[37] = S, e[38] = z, e[39] = B, e[40] = A, e[41] = F) : F = e[41], F;
|
|
285
433
|
}
|
|
286
|
-
function
|
|
434
|
+
function It(o) {
|
|
287
435
|
return console.error(o);
|
|
288
436
|
}
|
|
289
|
-
function
|
|
290
|
-
return new
|
|
437
|
+
function Mt() {
|
|
438
|
+
return new Ve.Doc();
|
|
291
439
|
}
|
|
292
|
-
function
|
|
293
|
-
const e =
|
|
294
|
-
autoFocus:
|
|
295
|
-
debug:
|
|
296
|
-
defaultState:
|
|
297
|
-
isEditable:
|
|
298
|
-
placeholder:
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
440
|
+
function fo(o) {
|
|
441
|
+
const e = ee(54), {
|
|
442
|
+
autoFocus: i,
|
|
443
|
+
debug: n,
|
|
444
|
+
defaultState: s,
|
|
445
|
+
isEditable: a,
|
|
446
|
+
placeholder: m,
|
|
447
|
+
scrollable: d,
|
|
448
|
+
onChange: c
|
|
449
|
+
} = o, v = i === void 0 ? !1 : i, C = n === void 0 ? !1 : n, L = s === void 0 ? "" : s, f = a === void 0 ? !1 : a, u = d === void 0 ? !0 : d;
|
|
450
|
+
let R;
|
|
451
|
+
e[0] !== L ? (R = Fe(L), e[0] = L, e[1] = R) : R = e[1];
|
|
303
452
|
const {
|
|
304
|
-
frontmatter:
|
|
453
|
+
frontmatter: T,
|
|
305
454
|
body: I
|
|
306
|
-
} =
|
|
307
|
-
let
|
|
308
|
-
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
309
|
-
|
|
310
|
-
},
|
|
311
|
-
let
|
|
312
|
-
e[4] !== I ? (
|
|
455
|
+
} = R, E = f && !!c, l = te(null), [r, y] = H(null);
|
|
456
|
+
let b, h;
|
|
457
|
+
e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = () => {
|
|
458
|
+
y(l.current);
|
|
459
|
+
}, h = [], e[2] = b, e[3] = h) : (b = e[2], h = e[3]), G(b, h);
|
|
460
|
+
let g;
|
|
461
|
+
e[4] !== I ? (g = () => mt($e(I), fe, void 0, !1), e[4] = I, e[5] = g) : g = e[5];
|
|
313
462
|
let x;
|
|
314
|
-
e[6] !==
|
|
463
|
+
e[6] !== f || e[7] !== g ? (x = {
|
|
315
464
|
namespace: "MARKDOWN_EDITOR",
|
|
316
|
-
nodes:
|
|
317
|
-
editorState:
|
|
318
|
-
onError:
|
|
319
|
-
editable:
|
|
320
|
-
theme:
|
|
321
|
-
}, e[6] =
|
|
322
|
-
const
|
|
323
|
-
let
|
|
324
|
-
e[9] !==
|
|
325
|
-
let
|
|
326
|
-
e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
465
|
+
nodes: ge,
|
|
466
|
+
editorState: g,
|
|
467
|
+
onError: Nt,
|
|
468
|
+
editable: f,
|
|
469
|
+
theme: he
|
|
470
|
+
}, e[6] = f, e[7] = g, e[8] = x) : x = e[8];
|
|
471
|
+
const _ = x, w = u ? "100%" : "auto";
|
|
472
|
+
let p;
|
|
473
|
+
e[9] !== v ? (p = v ? /* @__PURE__ */ t(ut, {}) : null, e[9] = v, e[10] = p) : p = e[10];
|
|
474
|
+
let S, k, N;
|
|
475
|
+
e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ t(ht, {}), k = /* @__PURE__ */ t(Se, {}), N = /* @__PURE__ */ t(Re, {}), e[11] = S, e[12] = k, e[13] = N) : (S = e[11], k = e[12], N = e[13]);
|
|
476
|
+
let M;
|
|
477
|
+
e[14] !== f ? (M = f ? /* @__PURE__ */ t(ke, { maxIndent: 7 }) : null, e[14] = f, e[15] = M) : M = e[15];
|
|
478
|
+
let j, W, U, z;
|
|
479
|
+
e[16] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ t(pt, {}), W = /* @__PURE__ */ t(_e, {}), U = /* @__PURE__ */ t(ve, {}), z = /* @__PURE__ */ t(Ce, {}), e[16] = j, e[17] = W, e[18] = U, e[19] = z) : (j = e[16], W = e[17], U = e[18], z = e[19]);
|
|
327
480
|
let O;
|
|
328
|
-
e[
|
|
329
|
-
let
|
|
330
|
-
e[
|
|
331
|
-
let
|
|
332
|
-
e[
|
|
333
|
-
let
|
|
334
|
-
e[
|
|
335
|
-
let
|
|
336
|
-
e[
|
|
337
|
-
V.read(() => {
|
|
338
|
-
const X = ze(), Ce = qe(oe, X);
|
|
339
|
-
m?.(h + Ce);
|
|
340
|
-
});
|
|
341
|
-
} }) : null, e[25] = h, e[26] = m, e[27] = P, e[28] = C) : C = e[28];
|
|
342
|
-
let T;
|
|
343
|
-
e[29] !== d ? (T = /* @__PURE__ */ t(ye, { isEditable: d }), e[29] = d, e[30] = T) : T = e[30];
|
|
344
|
-
let y;
|
|
345
|
-
e[31] !== u ? (y = u && /* @__PURE__ */ t(Ee, {}), e[31] = u, e[32] = y) : y = e[32];
|
|
481
|
+
e[20] !== r ? (O = /* @__PURE__ */ t(Be, { anchorElem: r }), e[20] = r, e[21] = O) : O = e[21];
|
|
482
|
+
let K;
|
|
483
|
+
e[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (K = /* @__PURE__ */ t(be, {}), e[22] = K) : K = e[22];
|
|
484
|
+
let P;
|
|
485
|
+
e[23] !== u ? (P = /* @__PURE__ */ t(xe, { fullWidth: !1, padding: "sm", scrollable: u }), e[23] = u, e[24] = P) : P = e[24];
|
|
486
|
+
let B;
|
|
487
|
+
e[25] !== m ? (B = m ? /* @__PURE__ */ t(de, { position: "absolute", padding: "sm", top: "0", left: "0", right: "0", pointerEvents: "none", userSelect: "none", justifyContent: "center", children: /* @__PURE__ */ t(Ee, { width: "100%", maxWidth: "720px", color: "fg.muted", textStyle: "paragraph/M/regular", children: m }) }) : null, e[25] = m, e[26] = B) : B = e[26];
|
|
488
|
+
let A;
|
|
489
|
+
e[27] !== P || e[28] !== B ? (A = /* @__PURE__ */ t(we, { contentEditable: P, placeholder: B, ErrorBoundary: ye }), e[27] = P, e[28] = B, e[29] = A) : A = e[29];
|
|
346
490
|
let F;
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
491
|
+
e[30] !== r || e[31] !== f ? (F = f && r ? /* @__PURE__ */ t(Ae, { anchorElem: r }) : null, e[30] = r, e[31] = f, e[32] = F) : F = e[32];
|
|
492
|
+
let q;
|
|
493
|
+
e[33] !== T || e[34] !== c || e[35] !== E ? (q = E ? /* @__PURE__ */ t(gt, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (He) => {
|
|
494
|
+
He.read(() => {
|
|
495
|
+
const ze = Ze(), Oe = ft(fe, ze);
|
|
496
|
+
c?.(T + Oe);
|
|
497
|
+
});
|
|
498
|
+
} }) : null, e[33] = T, e[34] = c, e[35] = E, e[36] = q) : q = e[36];
|
|
499
|
+
let V;
|
|
500
|
+
e[37] !== f ? (V = /* @__PURE__ */ t(De, { isEditable: f }), e[37] = f, e[38] = V) : V = e[38];
|
|
501
|
+
let X;
|
|
502
|
+
e[39] !== C ? (X = C && /* @__PURE__ */ t(je, {}), e[39] = C, e[40] = X) : X = e[40];
|
|
503
|
+
let Q;
|
|
504
|
+
e[41] !== _ || e[42] !== p || e[43] !== M || e[44] !== O || e[45] !== A || e[46] !== F || e[47] !== q || e[48] !== V || e[49] !== X ? (Q = /* @__PURE__ */ ie(Te, { initialConfig: _, children: [
|
|
505
|
+
p,
|
|
506
|
+
S,
|
|
507
|
+
k,
|
|
353
508
|
N,
|
|
509
|
+
M,
|
|
510
|
+
j,
|
|
511
|
+
W,
|
|
512
|
+
U,
|
|
513
|
+
z,
|
|
514
|
+
O,
|
|
515
|
+
K,
|
|
354
516
|
A,
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
517
|
+
F,
|
|
518
|
+
q,
|
|
519
|
+
V,
|
|
520
|
+
X
|
|
521
|
+
] }), e[41] = _, e[42] = p, e[43] = M, e[44] = O, e[45] = A, e[46] = F, e[47] = q, e[48] = V, e[49] = X, e[50] = Q) : Q = e[50];
|
|
522
|
+
let oe;
|
|
523
|
+
return e[51] !== w || e[52] !== Q ? (oe = /* @__PURE__ */ t(de, { ref: l, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: w, position: "relative", direction: "column", overflow: "visible", children: Q }), e[51] = w, e[52] = Q, e[53] = oe) : oe = e[53], oe;
|
|
361
524
|
}
|
|
362
|
-
function
|
|
525
|
+
function Nt(o) {
|
|
363
526
|
return console.error(o);
|
|
364
527
|
}
|
|
365
|
-
function
|
|
528
|
+
function uo(o) {
|
|
366
529
|
const e = o.toLowerCase().trim();
|
|
367
530
|
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";
|
|
368
531
|
}
|
|
369
|
-
const
|
|
532
|
+
const Pt = {
|
|
370
533
|
csv: "text/csv",
|
|
371
534
|
tsv: "text/tab-separated-values",
|
|
372
535
|
json: "application/json",
|
|
@@ -390,21 +553,21 @@ const st = {
|
|
|
390
553
|
yml: "text/yaml",
|
|
391
554
|
yaml: "text/yaml"
|
|
392
555
|
};
|
|
393
|
-
function
|
|
394
|
-
const
|
|
395
|
-
return
|
|
556
|
+
function po(o) {
|
|
557
|
+
const i = (o.split("?")[0]?.split("#")[0] ?? "").split(".").pop()?.toLowerCase();
|
|
558
|
+
return i ? Pt[i] ?? null : null;
|
|
396
559
|
}
|
|
397
560
|
export {
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
561
|
+
mo as CollaborativeMarkdownEditor,
|
|
562
|
+
vo as DefaultRichTextCodeEditor,
|
|
563
|
+
Co as DefaultRichTextDataTable,
|
|
564
|
+
fo as MarkdownEditor,
|
|
565
|
+
bo as MarkdownPreview,
|
|
566
|
+
xo as PromptEditor,
|
|
567
|
+
Eo as RichMessage,
|
|
568
|
+
To as generateEditorStateFromString,
|
|
569
|
+
yo as getTextFromSerializedEditorState,
|
|
570
|
+
uo as inferResourceTypeFromMediaType,
|
|
571
|
+
po as mediaTypeFromPath
|
|
409
572
|
};
|
|
410
573
|
//# sourceMappingURL=rich-text.js.map
|