platejs 54.0.0-beta.2 → 54.0.0-beta.3
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-DY104TqL.d.ts} +2 -2
- package/dist/{BaseSuggestionPlugin-DBl3fqnm.d.ts → BaseSuggestionPlugin-Deo6n6Fs.d.ts} +7 -3
- package/dist/{PlateStatic-DhNv2ejp.d.ts → PlateStatic-CJX5bKuv.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-DAOYWuvC.d.ts} +2 -2
- package/dist/{comparison-types-CYnJ35qU.d.ts → comparison-types-Dt-unJZY-DCddmbSD.d.ts} +10 -2
- package/dist/compiler/index.d.ts +2 -2
- package/dist/{core-BJG8l_mk.d.ts → core-ClHasORr.d.ts} +433 -95
- 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 +4 -2
- package/dist/docs/api/core/plate-plugin.md +3 -0
- package/dist/docs/api/core/plate-store.md +3 -3
- package/dist/docs/api/dom.md +14 -4
- package/dist/docs/api/editor-transforms.md +2 -1
- package/dist/docs/api/react-hooks.md +25 -11
- package/dist/docs/authored-changes.md +5 -2
- package/dist/docs/basic-blocks.md +42 -29
- package/dist/docs/blockquote.md +5 -3
- package/dist/docs/board.md +63 -8
- package/dist/docs/code-block.md +47 -0
- package/dist/docs/discussion.md +1 -1
- package/dist/docs/docx.md +1 -1
- package/dist/docs/dom-coverage.md +5 -0
- 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 +176 -8
- package/dist/docs/plugin-components.md +13 -10
- package/dist/docs/plugin-input-rules.md +4 -12
- 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 +29 -5
- package/dist/docx/export/lib/reviewPart.js +1 -1
- package/dist/docx/export/lib/reviewProjection.js +10 -8
- 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/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 +10 -10
- package/dist/features/field/index.d.ts +2 -0
- package/dist/features/field/index.js +2 -0
- package/dist/features/field/lib/BaseFieldPlugin.js +414 -0
- package/dist/features/field/lib/fieldRules.internal.js +42 -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 +533 -62
- 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 +1 -1
- package/dist/features/media/lib/media/parseMediaUrl.js +11 -1
- package/dist/features/media/lib/media-embed/BaseMediaEmbedPlugin.js +6 -2
- 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 +14 -8
- 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-cg_cWsaN.d.ts} +2 -31
- package/dist/hyperscript/index.d.ts +1 -1
- package/dist/{index-D1CFXA-i.d.ts → index-8WO2vI0U.d.ts} +475 -143
- package/dist/{index-DaM37gF6.d.ts → index-B5mYEawV.d.ts} +37 -21
- package/dist/{index-Bq3sdm3S.d.ts → index-BZWFoUXt.d.ts} +5 -4
- package/dist/{index-DdIRduDG.d.ts → index-C0POz7rg.d.ts} +3 -2
- package/dist/{index-Bxfvicyy.d.ts → index-C1_JIhL4.d.ts} +4 -3
- package/dist/{index-DC_MNGyu.d.ts → index-C35V_hj0.d.ts} +3 -3
- package/dist/{index-kLKMc-pI.d.ts → index-C6ql9pKw.d.ts} +2 -2
- package/dist/{index-hsC_sOn2.d.ts → index-C9DiGDVj.d.ts} +35 -5
- package/dist/{index-DTgaSxKr.d.ts → index-CLsEe3LY.d.ts} +40 -4
- package/dist/{index-CT7miqQN.d.ts → index-CdOLsPaW.d.ts} +29 -9
- package/dist/{index-DLA2DUR2.d.ts → index-CktYvOgk.d.ts} +4 -3
- package/dist/{index-BBKGrsG3.d.ts → index-Cmuluh6f.d.ts} +1 -1
- package/dist/{index-BiQerPJS.d.ts → index-CzLwBZpY.d.ts} +2 -2
- package/dist/{index-DzD6BIFJ.d.ts → index-D3-2iM1b.d.ts} +7 -5
- package/dist/{index-Cl77E9yr.d.ts → index-DKOFvteF.d.ts} +2 -2
- package/dist/{index-iaZOhA76.d.ts → index-DPWyk3lG-DOYwohXO.d.ts} +1 -1
- package/dist/index-DQnjqtQa.d.ts +678 -0
- package/dist/{index-CcZbqPqk.d.ts → index-Do9pj1GK.d.ts} +73 -39
- package/dist/{index-BU6k1Aev.d.ts → index-DpltOCot-A2b3p3Eb.d.ts} +4735 -4586
- package/dist/{index-Bc2Yg_2j.d.ts → index-HPYawTae-BCUQLEWF.d.ts} +2 -2
- package/dist/{index-BkR7-GLI.d.ts → index-baQOK89E.d.ts} +2 -2
- package/dist/{index-D5W-p9bS.d.ts → index-oIJAZxc2.d.ts} +49 -4
- package/dist/{index-xdmCBvlT.d.ts → index-r7yb77Wy.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 +8 -2
- 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 +5 -15
- package/dist/lib/plugins/input-rules/inputRuleVeto.internal.js +16 -0
- package/dist/markdown/index.d.ts +2 -2
- package/dist/markdown/index.js +2 -1
- package/dist/markdown/lib/MarkdownPlugin.js +16 -9
- package/dist/markdown/lib/RawHtmlPlugin.js +24 -0
- package/dist/markdown/lib/deserializer/mdastToSlate.js +12 -2
- package/dist/markdown/lib/internal/markdownConversion.js +773 -74
- package/dist/markdown/lib/internal/markdownDiagnostics.js +18 -7
- 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 +314 -0
- package/dist/markdown/lib/internal/markdownSegments.js +57 -48
- package/dist/markdown/lib/internal/markdownTags.js +22 -8
- 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/pagination/index.d.ts +1 -1
- package/dist/pagination/react/index.d.ts +4 -4
- package/dist/react/components/EditorContentView.internal.js +17 -8
- package/dist/react/components/EditorProvider.js +5 -5
- package/dist/react/components/Plate.js +103 -122
- 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/boardGesture.internal.js +6 -3
- package/dist/react/features/board/boardIndex.internal.js +7 -18
- package/dist/react/features/board/boardPictures.internal.js +19 -13
- package/dist/react/features/board/boardView.internal.js +184 -49
- package/dist/react/features/board/boardVoice.internal.js +10 -11
- package/dist/react/features/board/index.d.ts +64 -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 +34 -0
- package/dist/react/features/field/index.d.ts +312 -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 -29
- 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 +331 -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 +8 -7
- 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 +425 -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 +66 -21
- 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-aUwpNnAw.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
|
@@ -6,6 +6,10 @@ import { PLUGINS } from "../../../utils/plate-keys.js";
|
|
|
6
6
|
import { property, schema, txLocate } from "../../../core.js";
|
|
7
7
|
//#region src/features/basic-nodes/lib/BaseHeadingPlugins.ts
|
|
8
8
|
const isHeadingLevel = (value) => typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= 6;
|
|
9
|
+
const levelProps = (level, type, detailsTitleType) => (node) => node.type === detailsTitleType ? { level } : {
|
|
10
|
+
level,
|
|
11
|
+
type
|
|
12
|
+
};
|
|
9
13
|
const rules = {
|
|
10
14
|
break: { splitReset: true },
|
|
11
15
|
delete: {
|
|
@@ -60,21 +64,39 @@ const BaseHeadingPlugin = definePlugin(PLUGINS.heading, {
|
|
|
60
64
|
}
|
|
61
65
|
}),
|
|
62
66
|
rules,
|
|
63
|
-
read: ({ editor, schema: { type } }) =>
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
read: ({ editor, schema: { type }, state }) => {
|
|
68
|
+
const detailsTitleType = () => {
|
|
69
|
+
const summary = getCompiledPlatePlugin(editor, PLUGINS.detailsSummary);
|
|
70
|
+
return summary ? editor.plugin(summary).schema.type : void 0;
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
level: (node) => (node.type === type || node.type === detailsTitleType()) && isHeadingLevel(node.level) ? node.level : void 0,
|
|
74
|
+
/**
|
|
75
|
+
* Whether `setLevel(level)` can apply: the schema lets every selected
|
|
76
|
+
* block take the level where it sits.
|
|
77
|
+
*/
|
|
78
|
+
canSetLevel: (level) => {
|
|
79
|
+
const blocks = state.nodes.blocks();
|
|
80
|
+
const props = levelProps(level, type, detailsTitleType());
|
|
81
|
+
const root = state.view.root();
|
|
82
|
+
return blocks.length > 0 && blocks.every(([node, path]) => state.schema.canPlace([{
|
|
83
|
+
...node,
|
|
84
|
+
...props(node)
|
|
85
|
+
}], {
|
|
86
|
+
at: path,
|
|
87
|
+
replace: true,
|
|
88
|
+
root
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
68
93
|
}).extend(({ read }) => ({ update: ({ editor, tx, schema: { type } }) => {
|
|
69
94
|
const summary = getCompiledPlatePlugin(editor, PLUGINS.detailsSummary);
|
|
70
|
-
const
|
|
95
|
+
const detailsTitleType = summary ? editor.plugin(summary).schema.type : void 0;
|
|
71
96
|
const setLevel = txLocate(false, (level) => {
|
|
72
97
|
const blocks = tx.nodes.blocks();
|
|
73
98
|
if (blocks.length === 0) return false;
|
|
74
|
-
return blocks.every(([node]) => read.level(node) === level) || tx.blocks.set((
|
|
75
|
-
level,
|
|
76
|
-
type
|
|
77
|
-
});
|
|
99
|
+
return blocks.every(([node]) => read.level(node) === level) || tx.blocks.set(levelProps(level, type, detailsTitleType));
|
|
78
100
|
});
|
|
79
101
|
return {
|
|
80
102
|
setLevel,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { BaseBoardArrowPlugin, BaseBoardFramePlugin, BaseBoardGeoPlugin, BaseBoardImagePlugin, BaseBoardNotePlugin, BaseBoardPlugin, BaseBoardStrokePlugin, type BoardArrowAnchor, BoardArrowElement, type BoardArrowEnd, BoardArrowEndInput, type BoardArrowEnds, type BoardArrowEntry, type BoardArrowSide, BoardDefinition, BoardElement, BoardFrameElement, type BoardFrameEntry, type BoardFramePlace, BoardGeo, BoardGeoElement, BoardImageElement, type BoardMemberEntry, BoardNoteElement, type BoardPlace, type BoardRestackDirection, type BoardShapeEntry, type BoardShapePlace, type BoardSize, BoardStrokeElement, defineBoardShape };
|
|
1
|
+
import { A as BoardShapeEntry, C as BoardArrowEnd, D as BoardArrowEntry, F as BoardPlace, I as BoardRestackDirection, M as BoardShapePlace, O as BoardFrameEntry, R as BoardSize, S as BoardArrowAnchor, T as BoardArrowSide, _ as BaseBoardFramePlugin, a as BoardElement, b as BoardArrowElement, d as BoardNoteElement, f as BaseBoardImagePlugin, g as BoardGeoElement, h as BoardGeo, i as BoardDefinition, j as BoardFramePlace, k as BoardMemberEntry, m as BaseBoardGeoPlugin, n as BoardStrokeElement, p as BoardImageElement, r as BaseBoardPlugin, s as BoardStrokePath, t as BaseBoardStrokePlugin, u as BaseBoardNotePlugin, v as BoardFrameElement, w as BoardArrowEnds, x as BoardArrowEndInput, y as BaseBoardArrowPlugin, z as defineBoardShape } from "../../index-oIJAZxc2.js";
|
|
2
|
+
export { BaseBoardArrowPlugin, BaseBoardFramePlugin, BaseBoardGeoPlugin, BaseBoardImagePlugin, BaseBoardNotePlugin, BaseBoardPlugin, BaseBoardStrokePlugin, type BoardArrowAnchor, BoardArrowElement, type BoardArrowEnd, BoardArrowEndInput, type BoardArrowEnds, type BoardArrowEntry, type BoardArrowSide, BoardDefinition, BoardElement, BoardFrameElement, type BoardFrameEntry, type BoardFramePlace, BoardGeo, BoardGeoElement, BoardImageElement, type BoardMemberEntry, BoardNoteElement, type BoardPlace, type BoardRestackDirection, type BoardShapeEntry, type BoardShapePlace, type BoardSize, BoardStrokeElement, type BoardStrokePath, defineBoardShape };
|
|
@@ -13,10 +13,12 @@ import { BaseBoardFramePlugin } from "./BaseBoardFramePlugin.js";
|
|
|
13
13
|
import { BaseBoardGeoPlugin } from "./BaseBoardGeoPlugin.js";
|
|
14
14
|
import { BaseBoardImagePlugin } from "./BaseBoardImagePlugin.js";
|
|
15
15
|
import { BaseBoardNotePlugin } from "./BaseBoardNotePlugin.js";
|
|
16
|
+
import { boardStrokePath, boardStrokePointsOf } from "./boardStroke.internal.js";
|
|
16
17
|
import { BaseBoardStrokePlugin } from "./BaseBoardStrokePlugin.js";
|
|
17
18
|
import { moveShapesTo, paintKeyOf, paintOrder, placeShapeCopies, shapeIdOf, withCarriedRootSlots, withCutSlotsLoose, withFreshRootShapeIds, withSourcePaintOrder } from "./boardCopy.internal.js";
|
|
18
19
|
import { BOARD_ARROW_ATTRIBUTES, BOARD_FRAME_ATTRIBUTES, BOARD_SHAPE_ATTRIBUTES, BOARD_STROKE_ATTRIBUTES, decodeBoardArrowAttributes, decodeBoardFrameAttributes, decodeBoardShapeAttributes, decodeBoardStrokeAttributes, encodeBoardArrowAttributes, encodeBoardFrameAttributes, encodeBoardShapeAttributes, encodeBoardStrokeAttributes } from "./boardHtml.internal.js";
|
|
19
20
|
import { flooredSizeKeepingRatio, keepsBoardRatio } from "./boardRatio.internal.js";
|
|
21
|
+
import { boardTypesOf } from "./boardTypes.internal.js";
|
|
20
22
|
import { nanoid } from "nanoid";
|
|
21
23
|
//#region src/features/board/lib/BaseBoardPlugin.ts
|
|
22
24
|
/**
|
|
@@ -166,6 +168,7 @@ const BaseBoardPlugin = definePlugin("board", {
|
|
|
166
168
|
}))],
|
|
167
169
|
read: ({ state }) => {
|
|
168
170
|
const members = boardMembersOf(state, properties);
|
|
171
|
+
const types = boardTypesOf(editor);
|
|
169
172
|
return {
|
|
170
173
|
/**
|
|
171
174
|
* Where the arrow `id` draws its two ends, or null when `id` names
|
|
@@ -192,7 +195,17 @@ const BaseBoardPlugin = definePlugin("board", {
|
|
|
192
195
|
}) });
|
|
193
196
|
},
|
|
194
197
|
/** The members of the board block `board`, in stored order. */
|
|
195
|
-
shapes: (board) => boardShapesOf(state, members, board)
|
|
198
|
+
shapes: (board) => boardShapesOf(state, members, board),
|
|
199
|
+
/**
|
|
200
|
+
* Where the pen line `id` draws its outline within its box, the
|
|
201
|
+
* path the live board draws, or null when `id` names no pen line.
|
|
202
|
+
*/
|
|
203
|
+
strokePath: (id) => {
|
|
204
|
+
const entry = members.member(id);
|
|
205
|
+
if (entry?.kind !== "shape") return null;
|
|
206
|
+
const points = boardStrokePointsOf(entry, types.stroke());
|
|
207
|
+
return points ? boardStrokePath(points, entry.size) : null;
|
|
208
|
+
}
|
|
196
209
|
};
|
|
197
210
|
}
|
|
198
211
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { strokeOutline } from "../../../internal/penStroke.internal.js";
|
|
1
2
|
//#region src/features/board/lib/boardStroke.internal.ts
|
|
2
3
|
const BOARD_STROKE_TYPE = "boardStroke";
|
|
3
4
|
/** How much thinner perfect-freehand draws a pen line as its pressure falls. */
|
|
@@ -29,5 +30,16 @@ const boardInkIn = (points, box) => {
|
|
|
29
30
|
]);
|
|
30
31
|
return ink;
|
|
31
32
|
};
|
|
33
|
+
const boardStrokePointsOf = (entry, strokeType) => entry.node.type === strokeType && Array.isArray(entry.node.points) ? entry.node.points : void 0;
|
|
34
|
+
const boardStrokePath = (points, { height, width }) => ({
|
|
35
|
+
height,
|
|
36
|
+
path: strokeOutline(boardInkIn(points, {
|
|
37
|
+
height,
|
|
38
|
+
width,
|
|
39
|
+
x: 0,
|
|
40
|
+
y: 0
|
|
41
|
+
}), BOARD_PEN, true),
|
|
42
|
+
width
|
|
43
|
+
});
|
|
32
44
|
//#endregion
|
|
33
|
-
export { BOARD_PEN, BOARD_STROKE_REACH, BOARD_STROKE_THINNING, BOARD_STROKE_TYPE, boardInkIn, boardStrokeRadius, isBoardStrokePoints };
|
|
45
|
+
export { BOARD_PEN, BOARD_STROKE_REACH, BOARD_STROKE_THINNING, BOARD_STROKE_TYPE, boardInkIn, boardStrokePath, boardStrokePointsOf, boardStrokeRadius, isBoardStrokePoints };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseBoardGeoPlugin } from "./BaseBoardGeoPlugin.js";
|
|
2
|
+
import { BaseBoardNotePlugin } from "./BaseBoardNotePlugin.js";
|
|
3
|
+
import { BaseBoardStrokePlugin } from "./BaseBoardStrokePlugin.js";
|
|
4
|
+
//#region src/features/board/lib/boardTypes.internal.ts
|
|
5
|
+
const boardTypesOf = (editor) => {
|
|
6
|
+
const geo = editor.plugin(BaseBoardGeoPlugin);
|
|
7
|
+
const note = editor.plugin(BaseBoardNotePlugin);
|
|
8
|
+
const stroke = editor.plugin(BaseBoardStrokePlugin);
|
|
9
|
+
return {
|
|
10
|
+
geo: () => geo.installed ? geo.schema.type : void 0,
|
|
11
|
+
note: () => note.installed ? note.schema.type : void 0,
|
|
12
|
+
stroke: () => stroke.installed ? stroke.schema.type : void 0
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { boardTypesOf };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { Vt as EditorJsonValue, is as PropertyStringDescriptor, ki as ElementOf, ls as PropertyValueOptions } from "../../index-DpltOCot-A2b3p3Eb.js";
|
|
2
|
+
import "../../htmlTypes-cg_cWsaN.js";
|
|
3
|
+
import { _ as BasePlugin } from "../../core-ClHasORr.js";
|
|
3
4
|
declare const BaseCalloutPlugin: BasePlugin<Readonly<{
|
|
4
5
|
formats: true;
|
|
5
6
|
rules: true;
|
|
@@ -96,7 +96,10 @@ const BaseCodeBlockPlugin = definePlugin(PLUGINS.codeBlock, {
|
|
|
96
96
|
max: 1
|
|
97
97
|
}),
|
|
98
98
|
ownsExit: true,
|
|
99
|
-
properties: {
|
|
99
|
+
properties: {
|
|
100
|
+
language: property.string(),
|
|
101
|
+
meta: property.string()
|
|
102
|
+
},
|
|
100
103
|
slice: { preserveContext: true }
|
|
101
104
|
} },
|
|
102
105
|
component: "pre",
|
|
@@ -114,20 +117,23 @@ const BaseCodeBlockPlugin = definePlugin(PLUGINS.codeBlock, {
|
|
|
114
117
|
}
|
|
115
118
|
const languageClass = element.querySelector(":scope > code")?.className.match(CODE_LANGUAGE_CLASS_RE)?.[1];
|
|
116
119
|
const language = element.dataset.language || languageClass || void 0;
|
|
120
|
+
const { meta } = element.dataset;
|
|
117
121
|
const text = restoreTrailingNewlines(readCodeDomText(element), element);
|
|
118
|
-
preserve("data-code-trailing-newlines", "data-language");
|
|
122
|
+
preserve("data-code-trailing-newlines", "data-language", "data-meta");
|
|
119
123
|
return {
|
|
120
124
|
children: [{ text }],
|
|
121
|
-
...language ? { language } : {}
|
|
125
|
+
...language ? { language } : {},
|
|
126
|
+
...meta ? { meta } : {}
|
|
122
127
|
};
|
|
123
128
|
},
|
|
124
129
|
encode: ({ content, node, preserve }) => {
|
|
125
130
|
const trailingNewlines = countTrailingNewlines(NodeApi.string(node));
|
|
126
|
-
preserve("language");
|
|
131
|
+
preserve("language", "meta");
|
|
127
132
|
return {
|
|
128
133
|
attributes: {
|
|
129
134
|
...trailingNewlines > 0 ? { "data-code-trailing-newlines": trailingNewlines } : {},
|
|
130
|
-
"data-language": node.language
|
|
135
|
+
"data-language": node.language,
|
|
136
|
+
"data-meta": node.meta
|
|
131
137
|
},
|
|
132
138
|
children: [{
|
|
133
139
|
children: content,
|
|
@@ -146,13 +152,16 @@ const BaseCodeBlockPlugin = definePlugin(PLUGINS.codeBlock, {
|
|
|
146
152
|
node: "code",
|
|
147
153
|
decode: ({ node }) => ({
|
|
148
154
|
...node.lang ? { language: node.lang } : {},
|
|
155
|
+
...node.meta ? { meta: node.meta } : {},
|
|
149
156
|
children: [{ text: node.value || "" }],
|
|
150
157
|
type
|
|
151
158
|
}),
|
|
152
159
|
encode: ({ node, preserve }) => {
|
|
153
160
|
preserve("language");
|
|
161
|
+
if (node.language) preserve("meta");
|
|
154
162
|
return {
|
|
155
163
|
lang: node.language,
|
|
164
|
+
meta: node.meta,
|
|
156
165
|
type: "code",
|
|
157
166
|
value: NodeApi.string(node)
|
|
158
167
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as ComboboxState, t as ComboboxEditor } from "../../combobox-
|
|
2
|
-
import { n as filterWords, t as FilterWordsOptions } from "../../index-
|
|
1
|
+
import { n as ComboboxState, t as ComboboxEditor } from "../../combobox-DAOYWuvC.js";
|
|
2
|
+
import { n as filterWords, t as FilterWordsOptions } from "../../index-Cmuluh6f.js";
|
|
3
3
|
export { ComboboxEditor, ComboboxState, FilterWordsOptions, filterWords };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { S as SavedComments, _ as CommentsLoadIssue, a as CommentDataValue, b as CreateCommentThreadInput, c as CommentMutationRequest, d as CommentRanges, f as CommentResolution, g as CommentsChange, h as CommentUser, i as CommentDataList, l as CommentMutationResult, m as CommentThread, n as CommentAttachment, o as CommentMessage, p as CommentTarget, r as CommentData, s as CommentMutationDecision, t as BaseCommentsPlugin, u as CommentOperation, v as CommentsPluginState, x as PendingComment, y as CommentsSnapshot } from "../../index-
|
|
1
|
+
import { S as SavedComments, _ as CommentsLoadIssue, a as CommentDataValue, b as CreateCommentThreadInput, c as CommentMutationRequest, d as CommentRanges, f as CommentResolution, g as CommentsChange, h as CommentUser, i as CommentDataList, l as CommentMutationResult, m as CommentThread, n as CommentAttachment, o as CommentMessage, p as CommentTarget, r as CommentData, s as CommentMutationDecision, t as BaseCommentsPlugin, u as CommentOperation, v as CommentsPluginState, x as PendingComment, y as CommentsSnapshot } from "../../index-C1_JIhL4.js";
|
|
2
2
|
export { BaseCommentsPlugin, CommentAttachment, CommentData, CommentDataList, CommentDataValue, CommentMessage, CommentMutationDecision, CommentMutationRequest, CommentMutationResult, CommentOperation, CommentRanges, CommentResolution, CommentTarget, CommentThread, CommentUser, CommentsChange, CommentsLoadIssue, CommentsPluginState, CommentsSnapshot, CreateCommentThreadInput, PendingComment, SavedComments };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { eu as TxDeclaredMethod, is as PropertyStringDescriptor, ki as ElementOf } from "../../index-DpltOCot-A2b3p3Eb.js";
|
|
2
|
+
import "../../htmlTypes-cg_cWsaN.js";
|
|
3
|
+
import { _ as BasePlugin, _t as NodeInsertOptions } from "../../core-ClHasORr.js";
|
|
3
4
|
declare const BaseDatePlugin: BasePlugin<Readonly<{
|
|
4
5
|
readonly __pluginWritableProperties: Readonly<{
|
|
5
6
|
descriptor: PropertyStringDescriptor<{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { Ds as SchemaContentPrefixSlot, Ki as Location, Pa as NodeSelection, Ps as SchemaContentRule, Qo as PropertyJsonDescriptor, Vt as EditorJsonValue, eu as TxDeclaredMethod, ki as ElementOf, ws as SchemaContentDefault, xa as NodeKey } from "../../index-DpltOCot-A2b3p3Eb.js";
|
|
2
|
+
import "../../htmlTypes-cg_cWsaN.js";
|
|
3
|
+
import { Qn as HeadingLevel, _ as BasePlugin, ct as BlockInsertOptions, lt as BlockUpsertOptions, xo as PluginReference, yo as PluginDependency } from "../../core-ClHasORr.js";
|
|
3
4
|
declare const isSummaryHeadingLevel: (value: unknown) => value is HeadingLevel;
|
|
4
5
|
type BaseDetailsViewState = {
|
|
5
6
|
openKeys: Set<NodeKey>;
|
|
@@ -346,23 +346,23 @@ const BaseDetailsPlugin = definePlugin(PLUGINS.details, {
|
|
|
346
346
|
if (!details) return next();
|
|
347
347
|
const detailsKey = state.key(details[0]);
|
|
348
348
|
const paragraphType = editor.plugin(BaseParagraphPlugin).schema.type;
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
const point = tx.nodes.get(nextPath) ? tx.points.start(nextPath) : void 0;
|
|
352
|
-
if (point) {
|
|
353
|
-
tx.selection.set(point);
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
349
|
+
const afterDetails = PathApi.next(details[1]);
|
|
350
|
+
const insertParagraphAfterDetails = () => state.transaction((tx) => {
|
|
356
351
|
tx.nodes.insert({
|
|
357
352
|
children: [{ text: "" }],
|
|
358
353
|
type: paragraphType
|
|
359
354
|
}, {
|
|
360
|
-
at:
|
|
355
|
+
at: afterDetails,
|
|
361
356
|
select: true
|
|
362
357
|
});
|
|
363
358
|
});
|
|
364
359
|
if (summary) {
|
|
365
|
-
if (!viewStoreOf(state).get("openKeys").has(detailsKey))
|
|
360
|
+
if (!viewStoreOf(state).get("openKeys").has(detailsKey)) {
|
|
361
|
+
const point = state.nodes.get(afterDetails) ? state.points.start(afterDetails) : void 0;
|
|
362
|
+
return point ? state.transaction((tx) => {
|
|
363
|
+
tx.selection.set(point);
|
|
364
|
+
}) : insertParagraphAfterDetails();
|
|
365
|
+
}
|
|
366
366
|
if (state.points.isEnd(selection.anchor, summary[1])) {
|
|
367
367
|
const firstBodyPoint = state.points.start(details[1].concat(1));
|
|
368
368
|
return state.transaction((tx) => {
|
|
@@ -380,7 +380,7 @@ const BaseDetailsPlugin = definePlugin(PLUGINS.details, {
|
|
|
380
380
|
}
|
|
381
381
|
const block = state.nodes.block({ at: selection });
|
|
382
382
|
const childIndex = block?.[1].at(-1);
|
|
383
|
-
if (block && childIndex === details[0].children.length - 1 && childIndex > 0 && NodeApi.string(block[0]) === "" && state.points.isEnd(selection.anchor, block[1])) return
|
|
383
|
+
if (block && childIndex === details[0].children.length - 1 && childIndex > 0 && NodeApi.string(block[0]) === "" && state.points.isEnd(selection.anchor, block[1])) return insertParagraphAfterDetails();
|
|
384
384
|
return next();
|
|
385
385
|
}),
|
|
386
386
|
handle(editorCommands.delete, ({ input, state }) => {
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as FieldKind, c as FieldProblem, d as FieldTest, f as FieldValue, i as FieldElement, l as FieldRead, n as FIELD_TESTS, o as FieldOption, p as fitsField, r as FieldCondition, s as FieldPatch, t as BaseFieldPlugin, u as FieldSettings } from "../../index-DQnjqtQa.js";
|
|
2
|
+
export { BaseFieldPlugin, FIELD_TESTS, FieldCondition, FieldElement, FieldKind, FieldOption, FieldPatch, FieldProblem, FieldRead, FieldSettings, FieldTest, FieldValue, fitsField };
|