platejs 54.0.0-beta.2 → 54.0.0-beta.4
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/README.md +1 -1
- package/THIRD_PARTY_NOTICES.md +56 -0
- package/dist/{AIChatRequestContext-BMVWhfPV.d.ts → AIChatRequestContext-DrUahdTc.d.ts} +2 -2
- package/dist/{BaseSuggestionPlugin-DBl3fqnm.d.ts → BaseSuggestionPlugin-_7Ka6nY3.d.ts} +7 -3
- package/dist/{PlateStatic-DhNv2ejp.d.ts → PlateStatic-D3Cb-QwH.d.ts} +7 -7
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/react/AIChatPlugin.js +113 -78
- package/dist/ai/react/CopilotPlugin.js +1 -1
- package/dist/ai/react/index.d.ts +23 -16
- package/dist/authored/index.d.ts +4 -4
- package/dist/code-block/codemirror/createCodeMirrorAdapter.js +12 -9
- package/dist/code-block/codemirror/index.d.ts +1 -1
- package/dist/{combobox-DkBGgyd3.d.ts → combobox-Dr0OYZIE.d.ts} +2 -2
- package/dist/{comparison-types-CYnJ35qU.d.ts → comparison-types-DdwE6mYq-BogsHoUO.d.ts} +10 -2
- package/dist/compiler/index.d.ts +2 -2
- package/dist/{core-BJG8l_mk.d.ts → core-BqR-fEDp.d.ts} +493 -116
- package/dist/diff/index.d.ts +2 -2
- package/dist/docs/ai.md +4 -3
- package/dist/docs/api/core/plate-components.md +0 -19
- package/dist/docs/api/core/plate-controller.md +5 -3
- package/dist/docs/api/core/plate-plugin.md +3 -0
- package/dist/docs/api/core/plate-store.md +3 -3
- package/dist/docs/api/core.md +45 -5
- package/dist/docs/api/dom.md +11 -4
- package/dist/docs/api/editor-transforms.md +2 -1
- package/dist/docs/api/react-hooks.md +45 -13
- package/dist/docs/authored-changes.md +9 -4
- package/dist/docs/basic-blocks.md +42 -29
- package/dist/docs/block-placeholder.md +4 -2
- package/dist/docs/blockquote.md +5 -3
- package/dist/docs/board.md +118 -10
- package/dist/docs/code-block.md +47 -0
- package/dist/docs/comment.md +2 -2
- package/dist/docs/discussion.md +1 -1
- package/dist/docs/document-model.md +15 -3
- package/dist/docs/docx.md +1 -1
- package/dist/docs/dom-coverage.md +5 -0
- package/dist/docs/editor.md +50 -4
- package/dist/docs/examples/editable-voids.md +2 -3
- package/dist/docs/external-text.md +2 -0
- package/dist/docs/field.md +370 -0
- package/dist/docs/find.md +9 -6
- package/dist/docs/form.md +2 -0
- package/dist/docs/heading.md +6 -0
- package/dist/docs/installation/manual.md +0 -4
- package/dist/docs/link.md +3 -3
- package/dist/docs/llms.txt +4 -2
- package/dist/docs/markdown.md +270 -14
- package/dist/docs/plugin-components.md +13 -10
- package/dist/docs/plugin-input-rules.md +66 -15
- package/dist/docs/prompt-editor.md +205 -0
- package/dist/docs/roots.md +8 -6
- package/dist/docs/rtl.md +6 -4
- package/dist/docs/selection.md +7 -4
- package/dist/docs/suggestion.md +1 -1
- package/dist/docs/toolbar.md +26 -30
- package/dist/docs/upload.md +106 -17
- package/dist/docx/export/index.d.ts +3 -3
- package/dist/docx/export/lib/docxStaticComponents.js +12 -2
- package/dist/docx/export/lib/exportDocx.js +46 -17
- package/dist/docx/export/lib/internal/xml-builder.js +11 -16
- package/dist/docx/export/lib/reviewPart.js +1 -1
- package/dist/docx/export/lib/reviewProjection.js +52 -10
- package/dist/docx/import/index.d.ts +4 -4
- package/dist/docx/paste/index.d.ts +4 -4
- package/dist/dom/index.d.ts +1 -6
- package/dist/dom/plite-dom.internal.js +2 -2
- package/dist/excalidraw/index.d.ts +3 -2
- package/dist/excalidraw/react/index.d.ts +3 -2
- package/dist/facade.js +2 -2
- package/dist/features/basic-nodes/lib/BaseBlockPlugins.js +13 -5
- package/dist/features/basic-nodes/lib/BaseHeadingPlugins.js +32 -10
- package/dist/features/board/index.d.ts +2 -2
- package/dist/features/board/lib/BaseBoardPlugin.js +14 -1
- package/dist/features/board/lib/boardStroke.internal.js +13 -1
- package/dist/features/board/lib/boardTypes.internal.js +16 -0
- package/dist/features/callout/index.d.ts +3 -2
- package/dist/features/code-block/lib/BaseCodeBlockPlugin.js +14 -5
- package/dist/features/combobox/index.d.ts +2 -2
- package/dist/features/comments/BaseCommentsPlugin.js +33 -17
- package/dist/features/comments/index.d.ts +1 -1
- package/dist/features/date/index.d.ts +3 -2
- package/dist/features/details/index.d.ts +3 -2
- package/dist/features/details/lib/BaseDetailsPlugin.js +25 -12
- package/dist/features/field/index.d.ts +2 -0
- package/dist/features/field/index.js +4 -0
- package/dist/features/field/lib/BaseFieldPlugin.js +360 -0
- package/dist/features/field/lib/applyFieldValues.js +188 -0
- package/dist/features/field/lib/fieldRules.internal.js +204 -0
- package/dist/features/find/index.d.ts +3 -2
- package/dist/features/footnote/index.d.ts +1 -1
- package/dist/features/ink/index.d.ts +1 -1
- package/dist/features/ink/lib/BaseInkPlugin.js +126 -103
- package/dist/features/ink/lib/inkCodec.internal.js +130 -0
- package/dist/features/ink/lib/inkGone.internal.js +229 -48
- package/dist/features/ink/lib/inkPlaces.internal.js +534 -64
- package/dist/features/layout/index.d.ts +1 -1
- package/dist/features/link/lib/BaseLinkPlugin.js +6 -4
- package/dist/features/lint/index.d.ts +3 -2
- package/dist/features/media/index.d.ts +2 -2
- package/dist/features/media/index.js +2 -2
- package/dist/features/media/lib/media/parseMediaUrl.js +11 -1
- package/dist/features/media/lib/media-embed/BaseMediaEmbedPlugin.js +206 -4
- package/dist/features/mention/index.d.ts +5 -4
- package/dist/features/suggestion/index.d.ts +1 -1
- package/dist/features/table/index.d.ts +1 -1
- package/dist/features/table/lib/BaseTablePlugin.js +64 -15
- package/dist/features/table/lib/internal/selection.js +4 -2
- package/dist/features/toc/index.d.ts +1 -1
- package/dist/features/upload/index.d.ts +2 -2
- package/dist/features/upload/lib/BaseUploadPlugin.js +464 -250
- package/dist/history/index.d.ts +2 -2
- package/dist/html/index.d.ts +3 -3
- package/dist/html/server/index.d.ts +1 -1
- package/dist/{htmlTypes-DjeFG3P8.d.ts → htmlTypes-eT2ZGDAj.d.ts} +2 -31
- package/dist/hyperscript/index.d.ts +1 -1
- package/dist/{index-DzD6BIFJ.d.ts → index-B33E1CRJ.d.ts} +295 -6
- package/dist/{index-Cl77E9yr.d.ts → index-B7moSod7.d.ts} +2 -2
- package/dist/{index-hsC_sOn2.d.ts → index-B8-5Sr7I.d.ts} +35 -5
- package/dist/{index-BiQerPJS.d.ts → index-B8QJDAmG.d.ts} +2 -2
- package/dist/{index-BBKGrsG3.d.ts → index-BTx5oK7k.d.ts} +1 -1
- package/dist/{index-iaZOhA76.d.ts → index-BWPcE4ac-Cto_IsNs.d.ts} +7 -1
- package/dist/{index-BU6k1Aev.d.ts → index-BXjLmx1n-CXk17buG.d.ts} +4781 -4584
- package/dist/{index-kLKMc-pI.d.ts → index-BXwU9QH6.d.ts} +2 -2
- package/dist/{index-DTgaSxKr.d.ts → index-BkwR-5hH.d.ts} +40 -4
- package/dist/{index-Bq3sdm3S.d.ts → index-BsV2McRr.d.ts} +5 -4
- package/dist/index-C9Fu-P4E.d.ts +773 -0
- package/dist/{index-D5W-p9bS.d.ts → index-Ca48r1ng.d.ts} +49 -4
- package/dist/{index-CcZbqPqk.d.ts → index-Cob_iBdu.d.ts} +116 -41
- package/dist/{index-Bxfvicyy.d.ts → index-CpY7Xnxw.d.ts} +4 -3
- package/dist/{index-BkR7-GLI.d.ts → index-DNQXzU-X.d.ts} +2 -2
- package/dist/{index-D1CFXA-i.d.ts → index-DPowErHa.d.ts} +471 -141
- package/dist/{index-DaM37gF6.d.ts → index-DShbzec2.d.ts} +38 -23
- package/dist/{index-DC_MNGyu.d.ts → index-DYdObeFQ.d.ts} +3 -3
- package/dist/{index-Bc2Yg_2j.d.ts → index-Dq3Jlj8O-BJ6NxZm0.d.ts} +2 -2
- package/dist/{index-CT7miqQN.d.ts → index-DwWQVwQt.d.ts} +29 -11
- package/dist/{index-xdmCBvlT.d.ts → index-JWgwL5l3.d.ts} +5 -2
- package/dist/{index-DLA2DUR2.d.ts → index-M781pyx9.d.ts} +4 -3
- package/dist/{index-DdIRduDG.d.ts → index-d7io3MzC.d.ts} +3 -2
- package/dist/index.d.ts +4 -4
- package/dist/{react/internal → internal}/penStroke.internal.js +1 -1
- package/dist/internal/plugin/OverridePlugin.js +101 -119
- package/dist/internal/plugin/collectPlateNodeMappings.js +5 -1
- package/dist/internal/plugin/pastedUploadFiles.js +4 -0
- package/dist/internal/plugin/resolvePlugin.js +1 -1
- package/dist/internal/plugin/resolvePlugins.js +3 -0
- package/dist/internal/plugin/uploadDrafts.js +6 -0
- package/dist/internal/utils/mergePlugins.js +1 -0
- package/dist/lib/plugins/element-id/ElementIdPlugin.js +14 -18
- package/dist/lib/plugins/html/HtmlPlugin.js +9 -0
- package/dist/lib/plugins/html/htmlSafety.js +1 -1
- package/dist/lib/plugins/input-rules/InputRulesPlugin.js +77 -28
- package/dist/lib/plugins/input-rules/inputRuleVeto.internal.js +16 -0
- package/dist/markdown/index.d.ts +2 -2
- package/dist/markdown/index.js +3 -1
- package/dist/markdown/lib/MarkdownPlugin.js +14 -11
- package/dist/markdown/lib/RawHtmlPlugin.js +26 -0
- package/dist/markdown/lib/deserializer/mdastToSlate.js +12 -2
- package/dist/markdown/lib/internal/markdownConversion.js +776 -74
- package/dist/markdown/lib/internal/markdownDiagnostics.js +18 -7
- package/dist/markdown/lib/internal/markdownFootnoteWriter.js +35 -0
- package/dist/markdown/lib/internal/markdownFrontmatter.js +102 -0
- package/dist/markdown/lib/internal/markdownIntrinsics.js +125 -43
- package/dist/markdown/lib/internal/markdownLine.js +5 -3
- package/dist/markdown/lib/internal/markdownMappings.js +19 -7
- package/dist/markdown/lib/internal/markdownOpenTail.js +381 -0
- package/dist/markdown/lib/internal/markdownRawHtml.js +353 -0
- package/dist/markdown/lib/internal/markdownSegments.js +57 -48
- package/dist/markdown/lib/internal/markdownTags.js +29 -9
- package/dist/markdown/lib/serializer/convertNodesSerialize.js +10 -8
- package/dist/markdown/lib/serializer/convertPhrasingSerialize.js +226 -0
- package/dist/markdown/lib/serializer/listToMdastTree.js +2 -0
- package/dist/math/index.d.ts +3 -2
- package/dist/math/react/index.d.ts +4 -3
- package/dist/migrations/index.d.ts +3 -3
- package/dist/migrations/migratePlateV54.js +4 -6
- package/dist/migrations/migratePlateV54RetiredMarks.internal.js +23 -8
- package/dist/migrations/migratePlateV54Suggestions.internal.js +2 -2
- package/dist/migrations/v53-manifest.internal.js +4 -0
- package/dist/pagination/index.d.ts +1 -1
- package/dist/pagination/react/index.d.ts +4 -4
- package/dist/react/components/EditorContentView.internal.js +42 -23
- package/dist/react/components/EditorProvider.js +5 -5
- package/dist/react/components/Plate.js +102 -128
- package/dist/react/components/PlateContainer.js +40 -32
- package/dist/react/components/PlateController.js +28 -16
- package/dist/react/components/PlateRoot.internal.js +3 -2
- package/dist/react/core.js +4 -4
- package/dist/react/features/board/BoardSurface.js +116 -87
- package/dist/react/features/board/boardClipboard.internal.js +15 -5
- package/dist/react/features/board/boardExport.internal.js +470 -0
- package/dist/react/features/board/boardGesture.internal.js +6 -3
- package/dist/react/features/board/boardIndex.internal.js +7 -18
- package/dist/react/features/board/boardPictureStyles.internal.js +415 -0
- package/dist/react/features/board/boardPictures.internal.js +19 -13
- package/dist/react/features/board/boardView.internal.js +190 -50
- package/dist/react/features/board/boardVoice.internal.js +10 -11
- package/dist/react/features/board/index.d.ts +108 -18
- package/dist/react/features/callout/index.d.ts +3 -2
- package/dist/react/features/combobox/index.d.ts +8 -8
- package/dist/react/features/comments/index.d.ts +6 -5
- package/dist/react/features/date/index.d.ts +4 -3
- package/dist/react/features/details/index.d.ts +4 -3
- package/dist/react/features/field/FieldPlugin.js +35 -0
- package/dist/react/features/field/index.d.ts +315 -0
- package/dist/react/features/field/index.js +2 -0
- package/dist/react/features/footnote/index.d.ts +7 -6
- package/dist/react/features/format-painter/index.d.ts +4 -3
- package/dist/react/features/ink/InkContent.js +313 -0
- package/dist/react/features/ink/index.d.ts +57 -33
- package/dist/react/features/ink/index.js +2 -2
- package/dist/react/features/ink/inkCapture.internal.js +39 -17
- package/dist/react/features/ink/inkInput.internal.js +1 -1
- package/dist/react/features/ink/inkLayout.internal.js +6 -3
- package/dist/react/features/ink/inkPaint.internal.js +78 -2
- package/dist/react/features/ink/inkPlacement.internal.js +332 -104
- package/dist/react/features/ink/inkWatch.internal.js +7 -5
- package/dist/react/features/layout/index.d.ts +5 -4
- package/dist/react/features/media/index.d.ts +5 -4
- package/dist/react/features/mention/index.d.ts +6 -5
- package/dist/react/features/resizable/Resizable.js +4 -6
- package/dist/react/features/resizable/index.d.ts +5 -5
- package/dist/react/features/suggestion/index.d.ts +6 -5
- package/dist/react/features/table/TablePlugin.js +4 -11
- package/dist/react/features/table/index.d.ts +10 -8
- package/dist/react/features/table/useTableResize.js +10 -1
- package/dist/react/features/toc/index.d.ts +2 -2
- package/dist/react/features/upload/index.d.ts +11 -6
- package/dist/react/index.d.ts +6 -6
- package/dist/react/index.js +4 -4
- package/dist/react/internal/plate-context.js +434 -188
- package/dist/react/plite-react.js +2 -2
- package/dist/react/plugins/navigation-feedback/NavigationFeedbackPlugin.js +12 -10
- package/dist/react/stores/plate/useEditor.js +32 -14
- package/dist/react/stores/plate/useEditorHistory.js +55 -0
- package/dist/react/stores/plate/useEditorSelector.js +79 -21
- package/dist/react/utils/BlockPlaceholderPlugin.js +5 -2
- package/dist/react/utils/pipeRenderElement.internal.js +1 -1
- package/dist/react/utils/pluginRenderElement.internal.js +1 -1
- package/dist/react/virtualized.d.ts +4 -4
- package/dist/{source-CNKy99Th.d.ts → source-BGohy8vH.d.ts} +4 -4
- package/dist/static/index.d.ts +18 -18
- package/dist/static/internal/renderStaticHtmlWithOverrides.js +2 -2
- package/dist/static/internal/staticPresentation.js +4 -4
- package/dist/static/internal/writeStaticSelectionClipboardData.js +7 -2
- package/dist/tabbable/index.d.ts +1 -1
- package/dist/tabbable/react/index.d.ts +3 -3
- package/dist/testing/index.d.ts +3 -3
- package/dist/yjs/index.d.ts +1 -1
- package/dist/yjs/react/index.d.ts +6 -6
- package/package.json +20 -2
- package/dist/markdown/lib/serializer/convertTextsSerialize.js +0 -163
- package/dist/react/components/EditorSelectionView.js +0 -40
- package/dist/react/features/ink/InkLayer.js +0 -218
- package/dist/react/internal/createPlateTargetScope.js +0 -62
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useElementSelected, useRootEditor } from "../../plite-react.js";
|
|
2
2
|
import { useEditor, useModelEditor } from "../../stores/plate/useEditor.js";
|
|
3
|
+
import { useEditorHistory } from "../../stores/plate/useEditorHistory.js";
|
|
3
4
|
import { EditorElement } from "../../components/plate-nodes.js";
|
|
4
5
|
import { BOARD_SHAPES_SLOT } from "../../../features/board/lib/boardShape.internal.js";
|
|
5
6
|
import { keepToolbarArrowFromBrowser } from "./boardKeys.internal.js";
|
|
@@ -51,7 +52,7 @@ import { c } from "react/compiler-runtime";
|
|
|
51
52
|
* `height`; it never changes the document.
|
|
52
53
|
*/
|
|
53
54
|
function BoardSurface(t0) {
|
|
54
|
-
const $ = c(
|
|
55
|
+
const $ = c(37);
|
|
55
56
|
const { height, messages, toolbar, ...props } = t0;
|
|
56
57
|
const { element } = props;
|
|
57
58
|
const editor = useModelEditor();
|
|
@@ -68,145 +69,166 @@ function BoardSurface(t0) {
|
|
|
68
69
|
} else t1 = $[1];
|
|
69
70
|
const attach = t1;
|
|
70
71
|
let t2;
|
|
71
|
-
if ($[2] !==
|
|
72
|
-
t2 =
|
|
73
|
-
$[2] =
|
|
72
|
+
if ($[2] !== view) {
|
|
73
|
+
t2 = (host) => view.holdPictureHost(host);
|
|
74
|
+
$[2] = view;
|
|
74
75
|
$[3] = t2;
|
|
75
76
|
} else t2 = $[3];
|
|
76
|
-
const
|
|
77
|
+
const holdPictureHost = t2;
|
|
77
78
|
let t3;
|
|
78
|
-
if ($[4] !==
|
|
79
|
-
t3 =
|
|
80
|
-
$[4] =
|
|
79
|
+
if ($[4] !== mounted) {
|
|
80
|
+
t3 = { editor: mounted };
|
|
81
|
+
$[4] = mounted;
|
|
81
82
|
$[5] = t3;
|
|
82
83
|
} else t3 = $[5];
|
|
83
|
-
const
|
|
84
|
-
const hand = React$1.useSyncExternalStore(view.subscribe, readHand, readHand);
|
|
84
|
+
const history = useEditorHistory(t3);
|
|
85
85
|
let t4;
|
|
86
|
+
if ($[6] !== view) {
|
|
87
|
+
t4 = () => view.state().tool === "hand";
|
|
88
|
+
$[6] = view;
|
|
89
|
+
$[7] = t4;
|
|
90
|
+
} else t4 = $[7];
|
|
91
|
+
const readHand = t4;
|
|
92
|
+
const hand = React$1.useSyncExternalStore(view.subscribe, readHand, readHand);
|
|
86
93
|
let t5;
|
|
87
|
-
|
|
88
|
-
|
|
94
|
+
let t6;
|
|
95
|
+
if ($[8] !== history || $[9] !== messages || $[10] !== view) {
|
|
96
|
+
t5 = () => view.renderWith({
|
|
89
97
|
history,
|
|
90
98
|
messages
|
|
91
99
|
});
|
|
92
|
-
|
|
100
|
+
t6 = [
|
|
93
101
|
history,
|
|
94
102
|
messages,
|
|
95
103
|
view
|
|
96
104
|
];
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
$[
|
|
101
|
-
$[
|
|
105
|
+
$[8] = history;
|
|
106
|
+
$[9] = messages;
|
|
107
|
+
$[10] = view;
|
|
108
|
+
$[11] = t5;
|
|
109
|
+
$[12] = t6;
|
|
102
110
|
} else {
|
|
103
|
-
|
|
104
|
-
|
|
111
|
+
t5 = $[11];
|
|
112
|
+
t6 = $[12];
|
|
105
113
|
}
|
|
106
|
-
React$1.useLayoutEffect(
|
|
107
|
-
let t6;
|
|
114
|
+
React$1.useLayoutEffect(t5, t6);
|
|
108
115
|
let t7;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
t7 =
|
|
112
|
-
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
116
|
+
let t8;
|
|
117
|
+
if ($[13] !== view) {
|
|
118
|
+
t7 = () => view.connect();
|
|
119
|
+
t8 = [view];
|
|
120
|
+
$[13] = view;
|
|
121
|
+
$[14] = t7;
|
|
122
|
+
$[15] = t8;
|
|
115
123
|
} else {
|
|
116
|
-
|
|
117
|
-
|
|
124
|
+
t7 = $[14];
|
|
125
|
+
t8 = $[15];
|
|
118
126
|
}
|
|
119
|
-
React$1.useEffect(
|
|
120
|
-
const
|
|
121
|
-
const
|
|
122
|
-
let
|
|
123
|
-
if ($[
|
|
124
|
-
|
|
125
|
-
cursor:
|
|
126
|
-
height:
|
|
127
|
+
React$1.useEffect(t7, t8);
|
|
128
|
+
const t9 = hand ? "grab" : void 0;
|
|
129
|
+
const t10 = height ?? element.height;
|
|
130
|
+
let t11;
|
|
131
|
+
if ($[16] !== t10 || $[17] !== t9) {
|
|
132
|
+
t11 = {
|
|
133
|
+
cursor: t9,
|
|
134
|
+
height: t10,
|
|
127
135
|
overflow: "clip",
|
|
128
136
|
position: "relative",
|
|
129
137
|
touchAction: "none"
|
|
130
138
|
};
|
|
131
|
-
$[14] = t8;
|
|
132
|
-
$[15] = t9;
|
|
133
139
|
$[16] = t10;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
140
|
+
$[17] = t9;
|
|
141
|
+
$[18] = t11;
|
|
142
|
+
} else t11 = $[18];
|
|
143
|
+
const t12 = "";
|
|
144
|
+
const t13 = view.takeTextTab;
|
|
138
145
|
let t14;
|
|
139
|
-
|
|
140
|
-
|
|
146
|
+
let t15;
|
|
147
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
148
|
+
t14 = {
|
|
141
149
|
left: 0,
|
|
142
150
|
position: "absolute",
|
|
143
151
|
top: 0,
|
|
144
152
|
transformOrigin: "0 0",
|
|
145
153
|
willChange: "transform"
|
|
146
154
|
};
|
|
147
|
-
|
|
155
|
+
t15 = {
|
|
148
156
|
left: 0,
|
|
149
157
|
position: "absolute",
|
|
150
158
|
top: 0,
|
|
151
159
|
transformOrigin: "0 0"
|
|
152
160
|
};
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
161
|
+
$[19] = t14;
|
|
162
|
+
$[20] = t15;
|
|
155
163
|
} else {
|
|
156
|
-
|
|
157
|
-
|
|
164
|
+
t14 = $[19];
|
|
165
|
+
t15 = $[20];
|
|
158
166
|
}
|
|
159
|
-
const
|
|
167
|
+
const t16 = props.slots.contentRoot(BOARD_SHAPES_SLOT, {
|
|
160
168
|
ariaLabel: messages.label,
|
|
161
169
|
nodeSelectionFocus: view.focusTarget,
|
|
162
170
|
tabIndex: -1,
|
|
163
171
|
viewport
|
|
164
172
|
});
|
|
165
|
-
let t16;
|
|
166
|
-
if ($[19] !== t14 || $[20] !== t15) {
|
|
167
|
-
t16 = /* @__PURE__ */ React$1.createElement("div", { style: t14 }, t15);
|
|
168
|
-
$[19] = t14;
|
|
169
|
-
$[20] = t15;
|
|
170
|
-
$[21] = t16;
|
|
171
|
-
} else t16 = $[21];
|
|
172
173
|
let t17;
|
|
173
|
-
if ($[
|
|
174
|
-
t17 = /* @__PURE__ */ React$1.createElement("div", {
|
|
175
|
-
|
|
174
|
+
if ($[21] !== t15 || $[22] !== t16) {
|
|
175
|
+
t17 = /* @__PURE__ */ React$1.createElement("div", { style: t15 }, t16);
|
|
176
|
+
$[21] = t15;
|
|
177
|
+
$[22] = t16;
|
|
178
|
+
$[23] = t17;
|
|
179
|
+
} else t17 = $[23];
|
|
180
|
+
let t18;
|
|
181
|
+
if ($[24] !== attach || $[25] !== t14 || $[26] !== t17 || $[27] !== view.takeTextTab) {
|
|
182
|
+
t18 = /* @__PURE__ */ React$1.createElement("div", {
|
|
183
|
+
"data-board-layer": t12,
|
|
176
184
|
ref: attach,
|
|
177
|
-
onKeyDown:
|
|
178
|
-
style:
|
|
179
|
-
},
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
$[24] = t16;
|
|
183
|
-
$[25] = view.takeTextTab;
|
|
185
|
+
onKeyDown: t13,
|
|
186
|
+
style: t14
|
|
187
|
+
}, t17);
|
|
188
|
+
$[24] = attach;
|
|
189
|
+
$[25] = t14;
|
|
184
190
|
$[26] = t17;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
191
|
+
$[27] = view.takeTextTab;
|
|
192
|
+
$[28] = t18;
|
|
193
|
+
} else t18 = $[28];
|
|
194
|
+
let t19;
|
|
195
|
+
if ($[29] !== messages.instructions || $[30] !== messages.label || $[31] !== view.focusTarget) {
|
|
196
|
+
t19 = /* @__PURE__ */ React$1.createElement(BoardFocusTarget, {
|
|
189
197
|
focusRef: view.focusTarget,
|
|
190
198
|
instructions: messages.instructions,
|
|
191
199
|
label: messages.label
|
|
192
200
|
});
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
$[
|
|
196
|
-
$[
|
|
197
|
-
} else
|
|
198
|
-
let
|
|
199
|
-
if ($[
|
|
200
|
-
|
|
201
|
+
$[29] = messages.instructions;
|
|
202
|
+
$[30] = messages.label;
|
|
203
|
+
$[31] = view.focusTarget;
|
|
204
|
+
$[32] = t19;
|
|
205
|
+
} else t19 = $[32];
|
|
206
|
+
let t20;
|
|
207
|
+
if ($[33] !== holdPictureHost) {
|
|
208
|
+
t20 = /* @__PURE__ */ React$1.createElement("div", {
|
|
209
|
+
"aria-hidden": true,
|
|
210
|
+
contentEditable: false,
|
|
211
|
+
"data-board-picture-host": "",
|
|
212
|
+
"data-editor-root-chrome-ignore": "true",
|
|
213
|
+
inert: true,
|
|
214
|
+
ref: holdPictureHost,
|
|
215
|
+
style: PICTURE_HOST
|
|
216
|
+
});
|
|
217
|
+
$[33] = holdPictureHost;
|
|
218
|
+
$[34] = t20;
|
|
219
|
+
} else t20 = $[34];
|
|
220
|
+
let t21;
|
|
221
|
+
if ($[35] !== toolbar) {
|
|
222
|
+
t21 = toolbar && /* @__PURE__ */ React$1.createElement("div", {
|
|
201
223
|
contentEditable: false,
|
|
202
224
|
"data-board-toolbar": "",
|
|
203
225
|
role: "presentation",
|
|
204
226
|
style: { cursor: "default" },
|
|
205
227
|
onKeyDown: keepToolbarArrowFromBrowser
|
|
206
228
|
}, toolbar);
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
} else
|
|
229
|
+
$[35] = toolbar;
|
|
230
|
+
$[36] = t21;
|
|
231
|
+
} else t21 = $[36];
|
|
210
232
|
return /* @__PURE__ */ React$1.createElement(BoardViewContext.Provider, { value: view }, /* @__PURE__ */ React$1.createElement(EditorElement, {
|
|
211
233
|
...props,
|
|
212
234
|
attributes: {
|
|
@@ -214,9 +236,16 @@ function BoardSurface(t0) {
|
|
|
214
236
|
"data-board": view.root,
|
|
215
237
|
"data-selected": selected || void 0
|
|
216
238
|
},
|
|
217
|
-
style:
|
|
218
|
-
},
|
|
239
|
+
style: t11
|
|
240
|
+
}, t18, t19, t20, t21, props.children));
|
|
219
241
|
}
|
|
242
|
+
const PICTURE_HOST = {
|
|
243
|
+
left: 0,
|
|
244
|
+
opacity: 0,
|
|
245
|
+
pointerEvents: "none",
|
|
246
|
+
position: "absolute",
|
|
247
|
+
top: 0
|
|
248
|
+
};
|
|
220
249
|
const WITHOUT_OWN_FOCUS_RING = {
|
|
221
250
|
clipPath: "inset(50%)",
|
|
222
251
|
height: 0,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ElementApi } from "../../../core.js";
|
|
2
2
|
import { BaseBoardImagePlugin } from "../../../features/board/lib/BaseBoardImagePlugin.js";
|
|
3
|
+
import { pastedUploadFiles } from "../../../internal/plugin/pastedUploadFiles.js";
|
|
3
4
|
import { readImageLink } from "../../../internal/plugin/imageLink.js";
|
|
4
5
|
import { activeElementOf } from "./boardVoice.internal.js";
|
|
5
6
|
//#region src/react/features/board/boardClipboard.internal.ts
|
|
@@ -49,16 +50,25 @@ const attachBoardClipboard = (host, core) => {
|
|
|
49
50
|
const onTarget = !!target && target === core.focusTarget.current;
|
|
50
51
|
const onBoard = onTarget || !!hover && editor.api.dom.hasEditableTarget(target) && (host.contains(target) || target.contains(host));
|
|
51
52
|
if (!event.clipboardData || !onBoard) return;
|
|
52
|
-
const
|
|
53
|
+
const data = event.clipboardData;
|
|
54
|
+
const read = editor.api.dom.clipboard.readSlice(data);
|
|
55
|
+
const holdsFiles = data.files.length > 0 && read.kind !== "slice";
|
|
56
|
+
if (holdsFiles && !onTarget) return;
|
|
53
57
|
core.measure();
|
|
54
|
-
const
|
|
55
|
-
|
|
58
|
+
const point = hover ? core.boardPointAt(hover) : core.viewCenter();
|
|
59
|
+
const open = read.kind !== "slice" && !core.editedShape();
|
|
60
|
+
const pictures = open && core.writable() && editor.plugin(BaseBoardImagePlugin).installed ? picturesIn(data) : void 0;
|
|
61
|
+
const takesFiles = open && core.takesPictureFiles();
|
|
62
|
+
const fallbackFiles = takesFiles && pictures ? Array.from(data.files) : [];
|
|
63
|
+
const pictureFiles = takesFiles && !pictures ? pastedUploadFiles(data) : [];
|
|
64
|
+
if (pictures || pictureFiles.length > 0) {
|
|
56
65
|
event.preventDefault();
|
|
57
66
|
event.stopPropagation();
|
|
58
|
-
core.landPictures(pictures,
|
|
67
|
+
if (pictures) core.landPictures(pictures, point, fallbackFiles);
|
|
68
|
+
else core.landPictureFiles(pictureFiles, point);
|
|
59
69
|
return;
|
|
60
70
|
}
|
|
61
|
-
if (!((read.kind === "slice" ? core.land(read.slice, hover ? core.boardPointAt(hover) : void 0) : onTarget && core.selectedShapes().length > 0 && core.paste(
|
|
71
|
+
if (!((read.kind === "slice" ? core.land(read.slice, hover ? core.boardPointAt(hover) : void 0) : onTarget && !holdsFiles && (core.selectedShapes().length > 0 && core.paste(data) || open && data.getData("text/plain").trim() !== "" && core.pasteNote(data, point))) || onTarget)) return;
|
|
62
72
|
event.preventDefault();
|
|
63
73
|
event.stopPropagation();
|
|
64
74
|
};
|