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