@blade-hq/agent-react 2612.0.0-beta.115 → 2612.0.0-beta.117
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/{chunk-AMWLYUD7.js → chunk-34YJQXTM.js} +2 -2
- package/dist/{chunk-N2SQZ2HY.js → chunk-63G66FWM.js} +5 -1
- package/dist/{chunk-HV3NKRZ2.js → chunk-7DG4JFRS.js} +3 -3
- package/dist/{chunk-7UQ3RWAU.js → chunk-DNND32V4.js} +4 -4
- package/dist/{chunk-C3G6F7UG.js → chunk-LFC3UTIJ.js} +5 -5
- package/dist/{chunk-22JUW3EQ.js → chunk-NPDS3EEK.js} +2 -2
- package/dist/{chunk-GZWQVVE7.js → chunk-VUUX2BIU.js} +2818 -2341
- package/dist/chunk-VUUX2BIU.js.map +1 -0
- package/dist/{chunk-XRNHTA7C.js → chunk-XCASYOA6.js} +3 -3
- package/dist/connectors.js +2 -2
- package/dist/index.js +7 -7
- package/dist/internal.js +8 -8
- package/dist/questions.js +3 -3
- package/dist/rich-input.js +7023 -6787
- package/dist/rich-input.js.map +1 -1
- package/dist/tool-details.js +4 -4
- package/node_modules/@tiptap/core/dist/index.cjs +7679 -6763
- package/node_modules/@tiptap/core/dist/index.cjs.map +1 -1
- package/node_modules/@tiptap/core/dist/index.d.cts +4468 -3614
- package/node_modules/@tiptap/core/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/core/dist/index.d.ts +4467 -3614
- package/node_modules/@tiptap/core/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/core/dist/index.js +7508 -6632
- package/node_modules/@tiptap/core/dist/index.js.map +1 -1
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.cjs +66 -52
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.cjs.map +1 -1
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.d.cts +17 -12
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.d.cts.map +1 -0
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.d.ts +17 -12
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.d.ts.map +1 -0
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +60 -22
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +1 -1
- package/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/node_modules/@tiptap/core/package.json +27 -24
- package/node_modules/@tiptap/core/src/CommandManager.ts +72 -2
- package/node_modules/@tiptap/core/src/Editor.ts +108 -26
- package/node_modules/@tiptap/core/src/EventEmitter.ts +20 -7
- package/node_modules/@tiptap/core/src/Extendable.ts +52 -7
- package/node_modules/@tiptap/core/src/Extension.ts +7 -3
- package/node_modules/@tiptap/core/src/ExtensionManager.ts +158 -15
- package/node_modules/@tiptap/core/src/InputRule.ts +30 -3
- package/node_modules/@tiptap/core/src/Mark.ts +26 -6
- package/node_modules/@tiptap/core/src/MarkView.ts +13 -3
- package/node_modules/@tiptap/core/src/Node.ts +19 -6
- package/node_modules/@tiptap/core/src/NodePos.ts +17 -4
- package/node_modules/@tiptap/core/src/NodeView.ts +31 -9
- package/node_modules/@tiptap/core/src/PasteRule.ts +17 -4
- package/node_modules/@tiptap/core/src/Tracker.ts +9 -7
- package/node_modules/@tiptap/core/src/__tests__/Editor.spec.ts +73 -0
- package/node_modules/@tiptap/core/src/__tests__/htmlEntities.test.ts +55 -0
- package/node_modules/@tiptap/core/src/__tests__/inputRuleInlineAtoms.test.ts +111 -0
- package/node_modules/@tiptap/core/src/__tests__/isAndroid.test.ts +28 -0
- package/node_modules/@tiptap/core/src/__tests__/rewriteUnknownContent.test.ts +51 -0
- package/node_modules/@tiptap/core/src/__tests__/transformPastedHTML.test.ts +10 -4
- package/node_modules/@tiptap/core/src/commands/deleteSelection.ts +90 -2
- package/node_modules/@tiptap/core/src/commands/extendMarkRange.ts +3 -2
- package/node_modules/@tiptap/core/src/commands/index.ts +2 -0
- package/node_modules/@tiptap/core/src/commands/insertContent.ts +5 -1
- package/node_modules/@tiptap/core/src/commands/insertContentAt.ts +17 -21
- package/node_modules/@tiptap/core/src/commands/insertDefaultBlock.ts +97 -0
- package/node_modules/@tiptap/core/src/commands/resetAttributes.ts +9 -2
- package/node_modules/@tiptap/core/src/commands/setContent.ts +4 -1
- package/node_modules/@tiptap/core/src/commands/setMark.ts +7 -3
- package/node_modules/@tiptap/core/src/commands/setTextSelection.ts +2 -1
- package/node_modules/@tiptap/core/src/commands/splitBlock.ts +16 -4
- package/node_modules/@tiptap/core/src/commands/splitListItem.ts +14 -6
- package/node_modules/@tiptap/core/src/commands/toggleList.ts +106 -7
- package/node_modules/@tiptap/core/src/commands/undoInputRule.ts +1 -1
- package/node_modules/@tiptap/core/src/commands/unsetAllMarks.ts +17 -5
- package/node_modules/@tiptap/core/src/commands/updateDecorations.ts +28 -0
- package/node_modules/@tiptap/core/src/decorations/Decoration.ts +177 -0
- package/node_modules/@tiptap/core/src/decorations/DecorationManager.ts +440 -0
- package/node_modules/@tiptap/core/src/decorations/__tests__/DecorationManager.test.ts +821 -0
- package/node_modules/@tiptap/core/src/decorations/constants.ts +7 -0
- package/node_modules/@tiptap/core/src/decorations/createWidgetDecoration.ts +221 -0
- package/node_modules/@tiptap/core/src/decorations/decorationApplyScope.ts +45 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/__tests__/getRebuildRanges.test.ts +147 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/buildDecorationSet.ts +25 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/decorationsToPMDecorations.ts +36 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/filterOutOfRangeDecorations.ts +52 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/findDuplicateWidgetKeys.ts +37 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/getRebuildRanges.ts +96 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/hasResolvableChangedRange.ts +24 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/isAttrStep.ts +21 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/mapDecorationSet.ts +31 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/mapDecorations.ts +26 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/mergeDecorationSets.ts +16 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/rangeOwnsPosition.ts +38 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/shouldRecomputeDecoration.ts +24 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/unionWidgetKeys.ts +15 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/validateDecorationSpec.ts +49 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/widgetKeyOf.ts +11 -0
- package/node_modules/@tiptap/core/src/decorations/index.ts +28 -0
- package/node_modules/@tiptap/core/src/decorations/types.ts +87 -0
- package/node_modules/@tiptap/core/src/extensions/clipboardTextSerializer.ts +17 -8
- package/node_modules/@tiptap/core/src/extensions/delete.ts +33 -21
- package/node_modules/@tiptap/core/src/extensions/focusEvents.ts +6 -2
- package/node_modules/@tiptap/core/src/extensions/keymap.ts +8 -3
- package/node_modules/@tiptap/core/src/extensions/tabindex.ts +42 -2
- package/node_modules/@tiptap/core/src/extensions/textDirection.ts +3 -1
- package/node_modules/@tiptap/core/src/helpers/MappablePosition.ts +4 -1
- package/node_modules/@tiptap/core/src/helpers/__tests__/getChangedRanges.test.ts +48 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorAddMarkStep.test.ts +19 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorAddNodeMarkStep.test.ts +19 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorAttrStep.test.ts +17 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorCellSelection.test.ts +17 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorDocAttrStep.test.ts +17 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorFragment.test.ts +27 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorNodeSelection.test.ts +35 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorRemoveMarkStep.test.ts +19 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorRemoveNodeMarkStep.test.ts +19 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorReplaceAroundStep.test.ts +19 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorReplaceStep.test.ts +17 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorSlice.test.ts +16 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorStep.test.ts +30 -0
- package/node_modules/@tiptap/core/src/helpers/__tests__/isProseMirrorStepResult.test.ts +17 -0
- package/node_modules/@tiptap/core/src/helpers/combineTransactionSteps.ts +4 -1
- package/node_modules/@tiptap/core/src/helpers/createChainableState.ts +4 -1
- package/node_modules/@tiptap/core/src/helpers/createNodeFromContent.ts +15 -6
- package/node_modules/@tiptap/core/src/helpers/findChildrenInRange.ts +5 -1
- package/node_modules/@tiptap/core/src/helpers/flattenExtensions.ts +5 -1
- package/node_modules/@tiptap/core/src/helpers/getAttributes.ts +4 -1
- package/node_modules/@tiptap/core/src/helpers/getAttributesFromExtensions.ts +3 -5
- package/node_modules/@tiptap/core/src/helpers/getMarkAttributes.ts +4 -1
- package/node_modules/@tiptap/core/src/helpers/getMarkRange.ts +20 -5
- package/node_modules/@tiptap/core/src/helpers/getMarkType.ts +3 -1
- package/node_modules/@tiptap/core/src/helpers/getNodeAtPosition.ts +6 -1
- package/node_modules/@tiptap/core/src/helpers/getNodeAttributes.ts +4 -1
- package/node_modules/@tiptap/core/src/helpers/getNodeType.ts +3 -1
- package/node_modules/@tiptap/core/src/helpers/getPreviousBlockSibling.ts +36 -0
- package/node_modules/@tiptap/core/src/helpers/getSchemaByResolvedExtensions.ts +73 -20
- package/node_modules/@tiptap/core/src/helpers/getTextBetween.ts +1 -1
- package/node_modules/@tiptap/core/src/helpers/getTextContentFromNodes.ts +17 -12
- package/node_modules/@tiptap/core/src/helpers/index.ts +16 -0
- package/node_modules/@tiptap/core/src/helpers/isActive.ts +5 -1
- package/node_modules/@tiptap/core/src/helpers/isFragment.ts +14 -0
- package/node_modules/@tiptap/core/src/helpers/isNodeViewSelected.ts +42 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorAddMarkStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorAddNodeMarkStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorAttrStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorCellSelection.ts +18 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorContent.ts +14 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorDocAttrStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorFragment.ts +34 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorNodeSelection.ts +18 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorRemoveMarkStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorRemoveNodeMarkStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorReplaceAroundStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorReplaceStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorSlice.ts +43 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorStep.ts +30 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorStepResult.ts +26 -0
- package/node_modules/@tiptap/core/src/helpers/resolveFocusPosition.ts +14 -3
- package/node_modules/@tiptap/core/src/helpers/rewriteUnknownContent.ts +19 -10
- package/node_modules/@tiptap/core/src/helpers/splitExtensions.ts +3 -1
- package/node_modules/@tiptap/core/src/helpers/warnOnDuplicatedProseMirrorModel.ts +40 -0
- package/node_modules/@tiptap/core/src/index.ts +1 -6
- package/node_modules/@tiptap/core/src/inputRules/markInputRule.ts +5 -1
- package/node_modules/@tiptap/core/src/inputRules/nodeInputRule.ts +9 -2
- package/node_modules/@tiptap/core/src/inputRules/textInputRule.ts +5 -1
- package/node_modules/@tiptap/core/src/inputRules/textblockTypeInputRule.ts +8 -2
- package/node_modules/@tiptap/core/src/inputRules/wrappingInputRule.ts +8 -2
- package/node_modules/@tiptap/core/src/jsx-runtime.ts +91 -11
- package/node_modules/@tiptap/core/src/lib/ResizableNodeView.ts +25 -6
- package/node_modules/@tiptap/core/src/pasteRules/markPasteRule.ts +12 -1
- package/node_modules/@tiptap/core/src/types.ts +65 -18
- package/node_modules/@tiptap/core/src/utilities/attrsEqual.ts +27 -0
- package/node_modules/@tiptap/core/src/utilities/callOrReturn.ts +5 -1
- package/node_modules/@tiptap/core/src/utilities/deleteProps.ts +4 -1
- package/node_modules/@tiptap/core/src/utilities/elementFromString.ts +3 -1
- package/node_modules/@tiptap/core/src/utilities/getStyleProperty.ts +52 -0
- package/node_modules/@tiptap/core/src/utilities/htmlEntities.ts +26 -0
- package/node_modules/@tiptap/core/src/utilities/index.ts +4 -0
- package/node_modules/@tiptap/core/src/utilities/isAndroid.ts +1 -1
- package/node_modules/@tiptap/core/src/utilities/isDev.ts +12 -0
- package/node_modules/@tiptap/core/src/utilities/isFunction.ts +1 -1
- package/node_modules/@tiptap/core/src/utilities/isSafari.ts +3 -1
- package/node_modules/@tiptap/core/src/utilities/isiOS.ts +3 -1
- package/node_modules/@tiptap/core/src/utilities/markdown/createAtomBlockMarkdownSpec.ts +2 -4
- package/node_modules/@tiptap/core/src/utilities/markdown/createBlockMarkdownSpec.ts +10 -6
- package/node_modules/@tiptap/core/src/utilities/markdown/createInlineMarkdownSpec.ts +4 -24
- package/node_modules/@tiptap/core/src/utilities/markdown/index.ts +2 -1
- package/node_modules/@tiptap/core/src/utilities/markdown/parseAttributes.ts +48 -0
- package/node_modules/@tiptap/core/src/utilities/markdown/parseShortcodeAttributes.ts +13 -0
- package/node_modules/@tiptap/core/src/utilities/markdown/renderNestedMarkdownContent.ts +2 -1
- package/node_modules/@tiptap/core/src/utilities/markdown/serializeAttributes.ts +42 -0
- package/node_modules/@tiptap/core/src/utilities/markdown/tokenizeAttributes.ts +163 -0
- package/node_modules/@tiptap/core/src/utilities/marksEqual.ts +44 -0
- package/node_modules/@tiptap/core/src/utilities/mergeAttributes.ts +22 -3
- package/node_modules/@tiptap/core/src/utilities/mergeDeep.ts +4 -1
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.cjs +324 -453
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.cjs.map +1 -1
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.d.cts +152 -151
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.d.ts +152 -151
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.js +316 -433
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.js.map +1 -1
- package/node_modules/@tiptap/extension-bubble-menu/package.json +25 -23
- package/node_modules/@tiptap/extension-bubble-menu/src/bubble-menu-plugin.ts +73 -13
- package/node_modules/@tiptap/extension-floating-menu/dist/index.cjs +265 -373
- package/node_modules/@tiptap/extension-floating-menu/dist/index.cjs.map +1 -1
- package/node_modules/@tiptap/extension-floating-menu/dist/index.d.cts +161 -160
- package/node_modules/@tiptap/extension-floating-menu/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-floating-menu/dist/index.d.ts +161 -160
- package/node_modules/@tiptap/extension-floating-menu/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-floating-menu/dist/index.js +258 -354
- package/node_modules/@tiptap/extension-floating-menu/dist/index.js.map +1 -1
- package/node_modules/@tiptap/extension-floating-menu/package.json +23 -21
- package/node_modules/@tiptap/extension-floating-menu/src/floating-menu-plugin.ts +66 -11
- package/node_modules/@tiptap/extension-mention/dist/index.cjs +232 -268
- package/node_modules/@tiptap/extension-mention/dist/index.cjs.map +1 -1
- package/node_modules/@tiptap/extension-mention/dist/index.d.cts +85 -84
- package/node_modules/@tiptap/extension-mention/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-mention/dist/index.d.ts +85 -84
- package/node_modules/@tiptap/extension-mention/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-mention/dist/index.js +226 -240
- package/node_modules/@tiptap/extension-mention/dist/index.js.map +1 -1
- package/node_modules/@tiptap/extension-mention/package.json +24 -22
- package/node_modules/@tiptap/extension-mention/src/mention.ts +23 -13
- package/node_modules/@tiptap/pm/README.md +1 -1
- package/node_modules/{prosemirror-markdown/LICENSE → @tiptap/pm/THIRD_PARTY_LICENSES.md} +28 -0
- package/node_modules/@tiptap/pm/dist/changeset/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/changeset/index.d.cts +1 -18
- package/node_modules/@tiptap/pm/dist/changeset/index.d.ts +1 -18
- package/node_modules/@tiptap/pm/dist/changeset/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/commands/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/commands/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/commands/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/commands/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/dropcursor/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/dropcursor/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/dropcursor/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/dropcursor/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/gapcursor/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/gapcursor/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/gapcursor/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/gapcursor/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/history/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/history/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/history/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/history/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/inputrules/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/inputrules/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/inputrules/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/inputrules/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/keymap/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/keymap/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/keymap/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/keymap/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/model/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/model/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/model/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/model/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/schema-list/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/schema-list/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/schema-list/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/schema-list/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/state/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/state/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/state/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/state/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/tables/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/tables/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/tables/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/tables/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/transform/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/transform/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/transform/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/transform/index.js +1 -1
- package/node_modules/@tiptap/pm/dist/view/index.cjs +9 -2
- package/node_modules/@tiptap/pm/dist/view/index.d.cts +1 -1
- package/node_modules/@tiptap/pm/dist/view/index.d.ts +1 -1
- package/node_modules/@tiptap/pm/dist/view/index.js +1 -1
- package/node_modules/@tiptap/pm/package.json +54 -99
- package/node_modules/@tiptap/react/dist/index.cjs +1243 -1141
- package/node_modules/@tiptap/react/dist/index.cjs.map +1 -1
- package/node_modules/@tiptap/react/dist/index.d.cts +396 -294
- package/node_modules/@tiptap/react/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/react/dist/index.d.ts +396 -294
- package/node_modules/@tiptap/react/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/react/dist/index.js +1188 -1081
- package/node_modules/@tiptap/react/dist/index.js.map +1 -1
- package/node_modules/@tiptap/react/dist/menus/index.cjs +420 -450
- package/node_modules/@tiptap/react/dist/menus/index.cjs.map +1 -1
- package/node_modules/@tiptap/react/dist/menus/index.d.cts +13 -11
- package/node_modules/@tiptap/react/dist/menus/index.d.cts.map +1 -0
- package/node_modules/@tiptap/react/dist/menus/index.d.ts +13 -11
- package/node_modules/@tiptap/react/dist/menus/index.d.ts.map +1 -0
- package/node_modules/@tiptap/react/dist/menus/index.js +399 -416
- package/node_modules/@tiptap/react/dist/menus/index.js.map +1 -1
- package/node_modules/@tiptap/react/package.json +29 -27
- package/node_modules/@tiptap/react/src/Context.tsx +3 -1
- package/node_modules/@tiptap/react/src/Editor.ts +4 -1
- package/node_modules/@tiptap/react/src/EditorContent.spec.ts +39 -0
- package/node_modules/@tiptap/react/src/EditorContent.tsx +26 -41
- package/node_modules/@tiptap/react/src/ReactMarkViewRenderer.tsx +18 -10
- package/node_modules/@tiptap/react/src/ReactNodeViewRenderer.spec.ts +415 -0
- package/node_modules/@tiptap/react/src/ReactNodeViewRenderer.tsx +126 -24
- package/node_modules/@tiptap/react/src/ReactRenderer.tsx +30 -8
- package/node_modules/@tiptap/react/src/ReactWidgetRenderer.spec.ts +448 -0
- package/node_modules/@tiptap/react/src/ReactWidgetRenderer.tsx +97 -0
- package/node_modules/@tiptap/react/src/Tiptap.tsx +22 -15
- package/node_modules/@tiptap/react/src/captureDOMSelection.spec.ts +76 -0
- package/node_modules/@tiptap/react/src/captureDOMSelection.ts +35 -0
- package/node_modules/@tiptap/react/src/index.ts +3 -0
- package/node_modules/@tiptap/react/src/menus/BubbleMenu.spec.ts +7 -3
- package/node_modules/@tiptap/react/src/menus/BubbleMenu.tsx +10 -3
- package/node_modules/@tiptap/react/src/menus/FloatingMenu.spec.ts +7 -3
- package/node_modules/@tiptap/react/src/menus/FloatingMenu.tsx +28 -4
- package/node_modules/@tiptap/react/src/menus/index.ts +2 -0
- package/node_modules/@tiptap/react/src/menus/useMenuElementProps.ts +18 -3
- package/node_modules/@tiptap/react/src/use-client.spec.ts +26 -0
- package/node_modules/@tiptap/react/src/useEditor.ts +30 -33
- package/node_modules/@tiptap/react/src/useEditorState.spec.ts +121 -0
- package/node_modules/@tiptap/react/src/useEditorState.ts +17 -3
- package/node_modules/@tiptap/react/src/useReactNodeView.ts +12 -2
- package/node_modules/@tiptap/suggestion/dist/index.cjs +657 -361
- package/node_modules/@tiptap/suggestion/dist/index.cjs.map +1 -1
- package/node_modules/@tiptap/suggestion/dist/index.d.cts +395 -189
- package/node_modules/@tiptap/suggestion/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/suggestion/dist/index.d.ts +395 -189
- package/node_modules/@tiptap/suggestion/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/suggestion/dist/index.js +648 -330
- package/node_modules/@tiptap/suggestion/dist/index.js.map +1 -1
- package/node_modules/@tiptap/suggestion/package.json +25 -21
- package/node_modules/@tiptap/suggestion/src/__tests__/suggestion.test.ts +1123 -2
- package/node_modules/@tiptap/suggestion/src/findSuggestionMatch.ts +8 -1
- package/node_modules/@tiptap/suggestion/src/helpers.ts +129 -0
- package/node_modules/@tiptap/suggestion/src/plugin/async.ts +89 -0
- package/node_modules/@tiptap/suggestion/src/plugin/floating-ui.ts +204 -0
- package/node_modules/@tiptap/suggestion/src/plugin/props.ts +94 -0
- package/node_modules/@tiptap/suggestion/src/plugin/state.ts +182 -0
- package/node_modules/@tiptap/suggestion/src/plugin/view.ts +236 -0
- package/node_modules/@tiptap/suggestion/src/suggestion.ts +101 -535
- package/node_modules/@tiptap/suggestion/src/types.ts +439 -0
- package/node_modules/prosemirror-changeset/CHANGELOG.md +36 -0
- package/node_modules/prosemirror-changeset/README.md +1 -1
- package/node_modules/prosemirror-changeset/dist/index.cjs +35 -24
- package/node_modules/prosemirror-changeset/dist/index.d.cts +2 -1
- package/node_modules/prosemirror-changeset/dist/index.d.ts +2 -1
- package/node_modules/prosemirror-changeset/dist/index.js +23 -8
- package/node_modules/prosemirror-changeset/package.json +2 -2
- package/node_modules/prosemirror-changeset/src/README.md +1 -1
- package/node_modules/prosemirror-changeset/src/diff.ts +21 -8
- package/node_modules/prosemirror-changeset/src/simplify.ts +1 -1
- package/node_modules/prosemirror-changeset/test/test-diff.ts +26 -0
- package/node_modules/prosemirror-changeset/test/test-simplify.ts +3 -0
- package/node_modules/prosemirror-commands/CHANGELOG.md +6 -0
- package/node_modules/prosemirror-commands/CONTRIBUTING.md +19 -19
- package/node_modules/prosemirror-commands/README.md +3 -3
- package/node_modules/prosemirror-commands/dist/index.cjs +23 -22
- package/node_modules/prosemirror-commands/dist/index.js +11 -9
- package/node_modules/prosemirror-commands/package.json +2 -2
- package/node_modules/prosemirror-commands/src/commands.ts +11 -8
- package/node_modules/prosemirror-dropcursor/CHANGELOG.md +12 -0
- package/node_modules/prosemirror-dropcursor/CONTRIBUTING.md +22 -18
- package/node_modules/prosemirror-dropcursor/README.md +3 -3
- package/node_modules/prosemirror-dropcursor/dist/index.cjs +25 -10
- package/node_modules/prosemirror-dropcursor/dist/index.js +30 -13
- package/node_modules/prosemirror-dropcursor/package.json +2 -2
- package/node_modules/prosemirror-dropcursor/src/dropcursor.ts +26 -10
- package/node_modules/prosemirror-history/CHANGELOG.md +12 -0
- package/node_modules/prosemirror-history/CONTRIBUTING.md +19 -19
- package/node_modules/prosemirror-history/README.md +3 -3
- package/node_modules/prosemirror-history/dist/index.cjs +32 -11
- package/node_modules/prosemirror-history/dist/index.js +21 -4
- package/node_modules/prosemirror-history/package.json +2 -2
- package/node_modules/prosemirror-history/src/history.ts +24 -5
- package/node_modules/prosemirror-model/CHANGELOG.md +58 -0
- package/node_modules/prosemirror-model/CONTRIBUTING.md +19 -19
- package/node_modules/prosemirror-model/README.md +3 -3
- package/node_modules/prosemirror-model/dist/index.cjs +117 -110
- package/node_modules/prosemirror-model/dist/index.d.cts +36 -30
- package/node_modules/prosemirror-model/dist/index.d.ts +36 -30
- package/node_modules/prosemirror-model/dist/index.js +67 -56
- package/node_modules/prosemirror-model/package.json +2 -2
- package/node_modules/prosemirror-model/src/diff.ts +10 -5
- package/node_modules/prosemirror-model/src/fragment.ts +1 -1
- package/node_modules/prosemirror-model/src/from_dom.ts +5 -2
- package/node_modules/prosemirror-model/src/mark.ts +0 -1
- package/node_modules/prosemirror-model/src/node.ts +30 -10
- package/node_modules/prosemirror-model/src/replace.ts +8 -16
- package/node_modules/prosemirror-model/src/schema.ts +15 -28
- package/node_modules/prosemirror-model/src/to_dom.ts +24 -20
- package/node_modules/prosemirror-transform/CHANGELOG.md +56 -0
- package/node_modules/prosemirror-transform/CONTRIBUTING.md +19 -19
- package/node_modules/prosemirror-transform/README.md +3 -3
- package/node_modules/prosemirror-transform/dist/index.cjs +288 -176
- package/node_modules/prosemirror-transform/dist/index.d.cts +14 -4
- package/node_modules/prosemirror-transform/dist/index.d.ts +14 -4
- package/node_modules/prosemirror-transform/dist/index.js +156 -55
- package/node_modules/prosemirror-transform/package.json +2 -2
- package/node_modules/prosemirror-transform/src/attr_step.ts +1 -1
- package/node_modules/prosemirror-transform/src/map.ts +11 -6
- package/node_modules/prosemirror-transform/src/mark.ts +4 -21
- package/node_modules/prosemirror-transform/src/mark_step.ts +81 -10
- package/node_modules/prosemirror-transform/src/replace.ts +31 -9
- package/node_modules/prosemirror-transform/src/replace_step.ts +11 -2
- package/node_modules/prosemirror-transform/src/structure.ts +15 -9
- package/node_modules/prosemirror-view/CHANGELOG.md +52 -2
- package/node_modules/prosemirror-view/CONTRIBUTING.md +19 -19
- package/node_modules/prosemirror-view/README.md +3 -3
- package/node_modules/prosemirror-view/dist/index.cjs +287 -183
- package/node_modules/prosemirror-view/dist/index.d.cts +10 -2
- package/node_modules/prosemirror-view/dist/index.d.ts +10 -2
- package/node_modules/prosemirror-view/dist/index.js +180 -93
- package/node_modules/prosemirror-view/package.json +3 -3
- package/node_modules/prosemirror-view/src/clipboard.ts +21 -5
- package/node_modules/prosemirror-view/src/domchange.ts +8 -18
- package/node_modules/prosemirror-view/src/domcoords.ts +4 -1
- package/node_modules/prosemirror-view/src/domobserver.ts +4 -1
- package/node_modules/prosemirror-view/src/index.ts +4 -3
- package/node_modules/prosemirror-view/src/input.ts +96 -41
- package/node_modules/prosemirror-view/src/selection.ts +6 -6
- package/node_modules/prosemirror-view/src/viewdesc.ts +48 -23
- package/node_modules/prosemirror-view/style/prosemirror.css +1 -1
- package/package.json +19 -55
- package/dist/chunk-GZWQVVE7.js.map +0 -1
- package/node_modules/@remirror/core-constants/LICENSE +0 -21
- package/node_modules/@remirror/core-constants/dist/_tsup-dts-rollup.d.cts +0 -612
- package/node_modules/@remirror/core-constants/dist/_tsup-dts-rollup.d.ts +0 -612
- package/node_modules/@remirror/core-constants/dist/remirror-core-constants.cjs +0 -314
- package/node_modules/@remirror/core-constants/dist/remirror-core-constants.d.cts +0 -20
- package/node_modules/@remirror/core-constants/dist/remirror-core-constants.d.ts +0 -20
- package/node_modules/@remirror/core-constants/dist/remirror-core-constants.js +0 -269
- package/node_modules/@remirror/core-constants/dist-types/core-constants.d.ts +0 -431
- package/node_modules/@remirror/core-constants/dist-types/error-constants.d.ts +0 -119
- package/node_modules/@remirror/core-constants/dist-types/index.d.ts +0 -2
- package/node_modules/@remirror/core-constants/dist-types/tsconfig.tsbuildinfo +0 -1
- package/node_modules/@remirror/core-constants/package.json +0 -45
- package/node_modules/@remirror/core-constants/readme.md +0 -17
- package/node_modules/@tiptap/core/src/utilities/markdown/attributeUtils.ts +0 -130
- package/node_modules/@tiptap/pm/collab/index.ts +0 -1
- package/node_modules/@tiptap/pm/dist/collab/index.cjs +0 -2
- package/node_modules/@tiptap/pm/dist/collab/index.d.cts +0 -1
- package/node_modules/@tiptap/pm/dist/collab/index.d.ts +0 -1
- package/node_modules/@tiptap/pm/dist/collab/index.js +0 -2
- package/node_modules/@tiptap/pm/dist/markdown/index.cjs +0 -2
- package/node_modules/@tiptap/pm/dist/markdown/index.d.cts +0 -1
- package/node_modules/@tiptap/pm/dist/markdown/index.d.ts +0 -1
- package/node_modules/@tiptap/pm/dist/markdown/index.js +0 -2
- package/node_modules/@tiptap/pm/dist/menu/index.cjs +0 -2
- package/node_modules/@tiptap/pm/dist/menu/index.d.cts +0 -1
- package/node_modules/@tiptap/pm/dist/menu/index.d.ts +0 -1
- package/node_modules/@tiptap/pm/dist/menu/index.js +0 -2
- package/node_modules/@tiptap/pm/dist/schema-basic/index.cjs +0 -2
- package/node_modules/@tiptap/pm/dist/schema-basic/index.d.cts +0 -1
- package/node_modules/@tiptap/pm/dist/schema-basic/index.d.ts +0 -1
- package/node_modules/@tiptap/pm/dist/schema-basic/index.js +0 -2
- package/node_modules/@tiptap/pm/dist/trailing-node/index.cjs +0 -2
- package/node_modules/@tiptap/pm/dist/trailing-node/index.d.cts +0 -1
- package/node_modules/@tiptap/pm/dist/trailing-node/index.d.ts +0 -1
- package/node_modules/@tiptap/pm/dist/trailing-node/index.js +0 -2
- package/node_modules/@tiptap/pm/markdown/index.ts +0 -1
- package/node_modules/@tiptap/pm/menu/index.ts +0 -1
- package/node_modules/@tiptap/pm/schema-basic/index.ts +0 -1
- package/node_modules/@tiptap/pm/trailing-node/index.ts +0 -1
- package/node_modules/@types/linkify-it/LICENSE +0 -21
- package/node_modules/@types/linkify-it/README.md +0 -15
- package/node_modules/@types/linkify-it/build/index.cjs.d.ts +0 -178
- package/node_modules/@types/linkify-it/index.d.mts +0 -174
- package/node_modules/@types/linkify-it/index.d.ts +0 -3
- package/node_modules/@types/linkify-it/package.json +0 -50
- package/node_modules/@types/markdown-it/LICENSE +0 -21
- package/node_modules/@types/markdown-it/README.md +0 -15
- package/node_modules/@types/markdown-it/dist/index.cjs.d.ts +0 -1236
- package/node_modules/@types/markdown-it/dist/markdown-it.d.ts +0 -5
- package/node_modules/@types/markdown-it/dist/markdown-it.min.d.ts +0 -5
- package/node_modules/@types/markdown-it/index.d.mts +0 -1
- package/node_modules/@types/markdown-it/index.d.ts +0 -3
- package/node_modules/@types/markdown-it/lib/common/html_blocks.d.mts +0 -7
- package/node_modules/@types/markdown-it/lib/common/html_re.d.mts +0 -2
- package/node_modules/@types/markdown-it/lib/common/utils.d.mts +0 -62
- package/node_modules/@types/markdown-it/lib/helpers/index.d.mts +0 -5
- package/node_modules/@types/markdown-it/lib/helpers/parse_link_destination.d.mts +0 -7
- package/node_modules/@types/markdown-it/lib/helpers/parse_link_label.d.mts +0 -3
- package/node_modules/@types/markdown-it/lib/helpers/parse_link_title.d.mts +0 -29
- package/node_modules/@types/markdown-it/lib/index.d.mts +0 -404
- package/node_modules/@types/markdown-it/lib/parser_block.d.mts +0 -25
- package/node_modules/@types/markdown-it/lib/parser_core.d.mts +0 -18
- package/node_modules/@types/markdown-it/lib/parser_inline.d.mts +0 -38
- package/node_modules/@types/markdown-it/lib/renderer.d.mts +0 -96
- package/node_modules/@types/markdown-it/lib/ruler.d.mts +0 -158
- package/node_modules/@types/markdown-it/lib/rules_block/state_block.d.mts +0 -124
- package/node_modules/@types/markdown-it/lib/rules_core/state_core.d.mts +0 -18
- package/node_modules/@types/markdown-it/lib/rules_inline/state_inline.d.mts +0 -73
- package/node_modules/@types/markdown-it/lib/token.d.mts +0 -108
- package/node_modules/@types/markdown-it/package.json +0 -54
- package/node_modules/@types/mdurl/LICENSE +0 -21
- package/node_modules/@types/mdurl/README.md +0 -15
- package/node_modules/@types/mdurl/build/index.cjs.d.ts +0 -52
- package/node_modules/@types/mdurl/index.d.mts +0 -6
- package/node_modules/@types/mdurl/index.d.ts +0 -3
- package/node_modules/@types/mdurl/lib/decode.d.mts +0 -10
- package/node_modules/@types/mdurl/lib/encode.d.mts +0 -15
- package/node_modules/@types/mdurl/lib/format.d.mts +0 -3
- package/node_modules/@types/mdurl/lib/parse.d.mts +0 -18
- package/node_modules/@types/mdurl/package.json +0 -36
- package/node_modules/argparse/LICENSE +0 -254
- package/node_modules/argparse/README.md +0 -84
- package/node_modules/argparse/argparse.js +0 -3707
- package/node_modules/argparse/lib/sub.js +0 -67
- package/node_modules/argparse/lib/textwrap.js +0 -440
- package/node_modules/argparse/package.json +0 -31
- package/node_modules/crelt/LICENSE +0 -19
- package/node_modules/crelt/README.md +0 -23
- package/node_modules/crelt/dist/index.cjs +0 -31
- package/node_modules/crelt/dist/index.d.cts +0 -4
- package/node_modules/crelt/index.d.ts +0 -4
- package/node_modules/crelt/index.js +0 -28
- package/node_modules/crelt/package.json +0 -35
- package/node_modules/crelt/rollup.config.js +0 -13
- package/node_modules/entities/LICENSE +0 -11
- package/node_modules/entities/lib/decode.d.ts +0 -211
- package/node_modules/entities/lib/decode.d.ts.map +0 -1
- package/node_modules/entities/lib/decode.js +0 -536
- package/node_modules/entities/lib/decode.js.map +0 -1
- package/node_modules/entities/lib/decode_codepoint.d.ts +0 -19
- package/node_modules/entities/lib/decode_codepoint.d.ts.map +0 -1
- package/node_modules/entities/lib/decode_codepoint.js +0 -76
- package/node_modules/entities/lib/decode_codepoint.js.map +0 -1
- package/node_modules/entities/lib/encode.d.ts +0 -22
- package/node_modules/entities/lib/encode.d.ts.map +0 -1
- package/node_modules/entities/lib/encode.js +0 -77
- package/node_modules/entities/lib/encode.js.map +0 -1
- package/node_modules/entities/lib/escape.d.ts +0 -43
- package/node_modules/entities/lib/escape.d.ts.map +0 -1
- package/node_modules/entities/lib/escape.js +0 -122
- package/node_modules/entities/lib/escape.js.map +0 -1
- package/node_modules/entities/lib/esm/decode.d.ts +0 -211
- package/node_modules/entities/lib/esm/decode.d.ts.map +0 -1
- package/node_modules/entities/lib/esm/decode.js +0 -496
- package/node_modules/entities/lib/esm/decode.js.map +0 -1
- package/node_modules/entities/lib/esm/decode_codepoint.d.ts +0 -19
- package/node_modules/entities/lib/esm/decode_codepoint.d.ts.map +0 -1
- package/node_modules/entities/lib/esm/decode_codepoint.js +0 -71
- package/node_modules/entities/lib/esm/decode_codepoint.js.map +0 -1
- package/node_modules/entities/lib/esm/encode.d.ts +0 -22
- package/node_modules/entities/lib/esm/encode.d.ts.map +0 -1
- package/node_modules/entities/lib/esm/encode.js +0 -69
- package/node_modules/entities/lib/esm/encode.js.map +0 -1
- package/node_modules/entities/lib/esm/escape.d.ts +0 -43
- package/node_modules/entities/lib/esm/escape.d.ts.map +0 -1
- package/node_modules/entities/lib/esm/escape.js +0 -116
- package/node_modules/entities/lib/esm/escape.js.map +0 -1
- package/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +0 -3
- package/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map +0 -1
- package/node_modules/entities/lib/esm/generated/decode-data-html.js +0 -7
- package/node_modules/entities/lib/esm/generated/decode-data-html.js.map +0 -1
- package/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +0 -3
- package/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map +0 -1
- package/node_modules/entities/lib/esm/generated/decode-data-xml.js +0 -7
- package/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +0 -1
- package/node_modules/entities/lib/esm/generated/encode-html.d.ts +0 -8
- package/node_modules/entities/lib/esm/generated/encode-html.d.ts.map +0 -1
- package/node_modules/entities/lib/esm/generated/encode-html.js +0 -10
- package/node_modules/entities/lib/esm/generated/encode-html.js.map +0 -1
- package/node_modules/entities/lib/esm/index.d.ts +0 -96
- package/node_modules/entities/lib/esm/index.d.ts.map +0 -1
- package/node_modules/entities/lib/esm/index.js +0 -99
- package/node_modules/entities/lib/esm/index.js.map +0 -1
- package/node_modules/entities/lib/esm/package.json +0 -1
- package/node_modules/entities/lib/generated/decode-data-html.d.ts +0 -3
- package/node_modules/entities/lib/generated/decode-data-html.d.ts.map +0 -1
- package/node_modules/entities/lib/generated/decode-data-html.js +0 -9
- package/node_modules/entities/lib/generated/decode-data-html.js.map +0 -1
- package/node_modules/entities/lib/generated/decode-data-xml.d.ts +0 -3
- package/node_modules/entities/lib/generated/decode-data-xml.d.ts.map +0 -1
- package/node_modules/entities/lib/generated/decode-data-xml.js +0 -9
- package/node_modules/entities/lib/generated/decode-data-xml.js.map +0 -1
- package/node_modules/entities/lib/generated/encode-html.d.ts +0 -8
- package/node_modules/entities/lib/generated/encode-html.d.ts.map +0 -1
- package/node_modules/entities/lib/generated/encode-html.js +0 -12
- package/node_modules/entities/lib/generated/encode-html.js.map +0 -1
- package/node_modules/entities/lib/index.d.ts +0 -96
- package/node_modules/entities/lib/index.d.ts.map +0 -1
- package/node_modules/entities/lib/index.js +0 -126
- package/node_modules/entities/lib/index.js.map +0 -1
- package/node_modules/entities/package.json +0 -90
- package/node_modules/entities/readme.md +0 -122
- package/node_modules/escape-string-regexp/index.d.ts +0 -18
- package/node_modules/escape-string-regexp/index.js +0 -13
- package/node_modules/escape-string-regexp/license +0 -9
- package/node_modules/escape-string-regexp/package.json +0 -38
- package/node_modules/escape-string-regexp/readme.md +0 -34
- package/node_modules/linkify-it/LICENSE +0 -22
- package/node_modules/linkify-it/README.md +0 -196
- package/node_modules/linkify-it/build/index.cjs.js +0 -832
- package/node_modules/linkify-it/index.mjs +0 -642
- package/node_modules/linkify-it/lib/re.mjs +0 -189
- package/node_modules/linkify-it/package.json +0 -58
- package/node_modules/markdown-it/LICENSE +0 -22
- package/node_modules/markdown-it/README.md +0 -324
- package/node_modules/markdown-it/bin/markdown-it.mjs +0 -107
- package/node_modules/markdown-it/dist/index.cjs.js +0 -5547
- package/node_modules/markdown-it/dist/markdown-it.js +0 -6969
- package/node_modules/markdown-it/dist/markdown-it.min.js +0 -2
- package/node_modules/markdown-it/index.mjs +0 -1
- package/node_modules/markdown-it/lib/common/html_blocks.mjs +0 -67
- package/node_modules/markdown-it/lib/common/html_re.mjs +0 -25
- package/node_modules/markdown-it/lib/common/utils.mjs +0 -304
- package/node_modules/markdown-it/lib/helpers/index.mjs +0 -11
- package/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs +0 -77
- package/node_modules/markdown-it/lib/helpers/parse_link_label.mjs +0 -49
- package/node_modules/markdown-it/lib/helpers/parse_link_title.mjs +0 -66
- package/node_modules/markdown-it/lib/index.mjs +0 -565
- package/node_modules/markdown-it/lib/parser_block.mjs +0 -134
- package/node_modules/markdown-it/lib/parser_core.mjs +0 -62
- package/node_modules/markdown-it/lib/parser_inline.mjs +0 -197
- package/node_modules/markdown-it/lib/presets/commonmark.mjs +0 -88
- package/node_modules/markdown-it/lib/presets/default.mjs +0 -47
- package/node_modules/markdown-it/lib/presets/zero.mjs +0 -70
- package/node_modules/markdown-it/lib/renderer.mjs +0 -322
- package/node_modules/markdown-it/lib/ruler.mjs +0 -340
- package/node_modules/markdown-it/lib/rules_block/blockquote.mjs +0 -209
- package/node_modules/markdown-it/lib/rules_block/code.mjs +0 -30
- package/node_modules/markdown-it/lib/rules_block/fence.mjs +0 -94
- package/node_modules/markdown-it/lib/rules_block/heading.mjs +0 -51
- package/node_modules/markdown-it/lib/rules_block/hr.mjs +0 -40
- package/node_modules/markdown-it/lib/rules_block/html_block.mjs +0 -69
- package/node_modules/markdown-it/lib/rules_block/lheading.mjs +0 -82
- package/node_modules/markdown-it/lib/rules_block/list.mjs +0 -331
- package/node_modules/markdown-it/lib/rules_block/paragraph.mjs +0 -46
- package/node_modules/markdown-it/lib/rules_block/reference.mjs +0 -212
- package/node_modules/markdown-it/lib/rules_block/state_block.mjs +0 -220
- package/node_modules/markdown-it/lib/rules_block/table.mjs +0 -228
- package/node_modules/markdown-it/lib/rules_core/block.mjs +0 -13
- package/node_modules/markdown-it/lib/rules_core/inline.mjs +0 -11
- package/node_modules/markdown-it/lib/rules_core/linkify.mjs +0 -134
- package/node_modules/markdown-it/lib/rules_core/normalize.mjs +0 -17
- package/node_modules/markdown-it/lib/rules_core/replacements.mjs +0 -101
- package/node_modules/markdown-it/lib/rules_core/smartquotes.mjs +0 -193
- package/node_modules/markdown-it/lib/rules_core/state_core.mjs +0 -17
- package/node_modules/markdown-it/lib/rules_core/text_join.mjs +0 -43
- package/node_modules/markdown-it/lib/rules_inline/autolink.mjs +0 -72
- package/node_modules/markdown-it/lib/rules_inline/backticks.mjs +0 -60
- package/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs +0 -124
- package/node_modules/markdown-it/lib/rules_inline/emphasis.mjs +0 -123
- package/node_modules/markdown-it/lib/rules_inline/entity.mjs +0 -51
- package/node_modules/markdown-it/lib/rules_inline/escape.mjs +0 -69
- package/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs +0 -38
- package/node_modules/markdown-it/lib/rules_inline/html_inline.mjs +0 -50
- package/node_modules/markdown-it/lib/rules_inline/image.mjs +0 -138
- package/node_modules/markdown-it/lib/rules_inline/link.mjs +0 -139
- package/node_modules/markdown-it/lib/rules_inline/linkify.mjs +0 -63
- package/node_modules/markdown-it/lib/rules_inline/newline.mjs +0 -42
- package/node_modules/markdown-it/lib/rules_inline/state_inline.mjs +0 -123
- package/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs +0 -127
- package/node_modules/markdown-it/lib/rules_inline/text.mjs +0 -86
- package/node_modules/markdown-it/lib/token.mjs +0 -191
- package/node_modules/markdown-it/package.json +0 -92
- package/node_modules/mdurl/LICENSE +0 -45
- package/node_modules/mdurl/README.md +0 -102
- package/node_modules/mdurl/build/index.cjs.js +0 -534
- package/node_modules/mdurl/index.mjs +0 -11
- package/node_modules/mdurl/lib/decode.mjs +0 -112
- package/node_modules/mdurl/lib/encode.mjs +0 -89
- package/node_modules/mdurl/lib/format.mjs +0 -21
- package/node_modules/mdurl/lib/parse.mjs +0 -308
- package/node_modules/mdurl/package.json +0 -37
- package/node_modules/prosemirror-collab/.tern-project +0 -8
- package/node_modules/prosemirror-collab/CHANGELOG.md +0 -77
- package/node_modules/prosemirror-collab/CONTRIBUTING.md +0 -104
- package/node_modules/prosemirror-collab/LICENSE +0 -19
- package/node_modules/prosemirror-collab/README.md +0 -28
- package/node_modules/prosemirror-collab/dist/index.cjs +0 -155
- package/node_modules/prosemirror-collab/dist/index.d.cts +0 -60
- package/node_modules/prosemirror-collab/dist/index.d.ts +0 -60
- package/node_modules/prosemirror-collab/dist/index.js +0 -156
- package/node_modules/prosemirror-collab/package.json +0 -40
- package/node_modules/prosemirror-collab/src/README.md +0 -11
- package/node_modules/prosemirror-collab/src/collab.ts +0 -184
- package/node_modules/prosemirror-markdown/.tern-project +0 -8
- package/node_modules/prosemirror-markdown/CHANGELOG.md +0 -311
- package/node_modules/prosemirror-markdown/CONTRIBUTING.md +0 -100
- package/node_modules/prosemirror-markdown/README.md +0 -276
- package/node_modules/prosemirror-markdown/dist/index.cjs +0 -966
- package/node_modules/prosemirror-markdown/dist/index.d.cts +0 -335
- package/node_modules/prosemirror-markdown/dist/index.d.ts +0 -335
- package/node_modules/prosemirror-markdown/dist/index.js +0 -878
- package/node_modules/prosemirror-markdown/package.json +0 -40
- package/node_modules/prosemirror-markdown/src/README.md +0 -42
- package/node_modules/prosemirror-markdown/src/from_markdown.ts +0 -272
- package/node_modules/prosemirror-markdown/src/index.ts +0 -5
- package/node_modules/prosemirror-markdown/src/schema.ts +0 -156
- package/node_modules/prosemirror-markdown/src/to_markdown.ts +0 -483
- package/node_modules/prosemirror-menu/.tern-project +0 -8
- package/node_modules/prosemirror-menu/CHANGELOG.md +0 -107
- package/node_modules/prosemirror-menu/CONTRIBUTING.md +0 -100
- package/node_modules/prosemirror-menu/LICENSE +0 -19
- package/node_modules/prosemirror-menu/README.md +0 -235
- package/node_modules/prosemirror-menu/dist/index.cjs +0 -798
- package/node_modules/prosemirror-menu/dist/index.d.cts +0 -281
- package/node_modules/prosemirror-menu/dist/index.d.ts +0 -281
- package/node_modules/prosemirror-menu/dist/index.js +0 -795
- package/node_modules/prosemirror-menu/package.json +0 -42
- package/node_modules/prosemirror-menu/src/README.md +0 -60
- package/node_modules/prosemirror-menu/src/icons.ts +0 -53
- package/node_modules/prosemirror-menu/src/index.ts +0 -4
- package/node_modules/prosemirror-menu/src/menu.ts +0 -628
- package/node_modules/prosemirror-menu/src/menubar.ts +0 -210
- package/node_modules/prosemirror-menu/style/menu.css +0 -169
- package/node_modules/prosemirror-schema-basic/.tern-project +0 -8
- package/node_modules/prosemirror-schema-basic/CHANGELOG.md +0 -81
- package/node_modules/prosemirror-schema-basic/CONTRIBUTING.md +0 -100
- package/node_modules/prosemirror-schema-basic/LICENSE +0 -19
- package/node_modules/prosemirror-schema-basic/README.md +0 -28
- package/node_modules/prosemirror-schema-basic/dist/index.cjs +0 -246
- package/node_modules/prosemirror-schema-basic/dist/index.d.cts +0 -87
- package/node_modules/prosemirror-schema-basic/dist/index.d.ts +0 -87
- package/node_modules/prosemirror-schema-basic/dist/index.js +0 -183
- package/node_modules/prosemirror-schema-basic/package.json +0 -37
- package/node_modules/prosemirror-schema-basic/src/README.md +0 -8
- package/node_modules/prosemirror-schema-basic/src/schema-basic.ts +0 -166
- package/node_modules/prosemirror-trailing-node/LICENSE +0 -21
- package/node_modules/prosemirror-trailing-node/dist/_tsup-dts-rollup.d.cts +0 -41
- package/node_modules/prosemirror-trailing-node/dist/_tsup-dts-rollup.d.ts +0 -41
- package/node_modules/prosemirror-trailing-node/dist/prosemirror-trailing-node.cjs +0 -70
- package/node_modules/prosemirror-trailing-node/dist/prosemirror-trailing-node.d.cts +0 -2
- package/node_modules/prosemirror-trailing-node/dist/prosemirror-trailing-node.d.ts +0 -2
- package/node_modules/prosemirror-trailing-node/dist/prosemirror-trailing-node.js +0 -43
- package/node_modules/prosemirror-trailing-node/dist-types/index.d.ts +0 -2
- package/node_modules/prosemirror-trailing-node/dist-types/trailing-node-plugin.d.ts +0 -33
- package/node_modules/prosemirror-trailing-node/dist-types/tsconfig.tsbuildinfo +0 -1
- package/node_modules/prosemirror-trailing-node/package.json +0 -57
- package/node_modules/prosemirror-trailing-node/readme.md +0 -55
- package/node_modules/punycode.js/LICENSE-MIT.txt +0 -20
- package/node_modules/punycode.js/README.md +0 -148
- package/node_modules/punycode.js/package.json +0 -58
- package/node_modules/punycode.js/punycode.es6.js +0 -444
- package/node_modules/punycode.js/punycode.js +0 -443
- package/node_modules/uc.micro/LICENSE.txt +0 -20
- package/node_modules/uc.micro/README.md +0 -14
- package/node_modules/uc.micro/build/index.cjs.js +0 -20
- package/node_modules/uc.micro/categories/Cc/regex.mjs +0 -1
- package/node_modules/uc.micro/categories/Cf/regex.mjs +0 -1
- package/node_modules/uc.micro/categories/P/regex.mjs +0 -1
- package/node_modules/uc.micro/categories/S/regex.mjs +0 -1
- package/node_modules/uc.micro/categories/Z/regex.mjs +0 -1
- package/node_modules/uc.micro/index.mjs +0 -8
- package/node_modules/uc.micro/package.json +0 -37
- package/node_modules/uc.micro/properties/Any/regex.mjs +0 -1
- /package/dist/{chunk-AMWLYUD7.js.map → chunk-34YJQXTM.js.map} +0 -0
- /package/dist/{chunk-N2SQZ2HY.js.map → chunk-63G66FWM.js.map} +0 -0
- /package/dist/{chunk-HV3NKRZ2.js.map → chunk-7DG4JFRS.js.map} +0 -0
- /package/dist/{chunk-7UQ3RWAU.js.map → chunk-DNND32V4.js.map} +0 -0
- /package/dist/{chunk-C3G6F7UG.js.map → chunk-LFC3UTIJ.js.map} +0 -0
- /package/dist/{chunk-22JUW3EQ.js.map → chunk-NPDS3EEK.js.map} +0 -0
- /package/dist/{chunk-XRNHTA7C.js.map → chunk-XCASYOA6.js.map} +0 -0
- /package/node_modules/@tiptap/pm/{LICENSE.md → LICENSE} +0 -0
|
@@ -202,6 +202,7 @@ function clientRect(node) {
|
|
|
202
202
|
};
|
|
203
203
|
}
|
|
204
204
|
function scrollRectIntoView(view, rect, startDOM) {
|
|
205
|
+
if (!nonZero(rect) && rect.left == 0) return;
|
|
205
206
|
var scrollThreshold = view.someProp("scrollThreshold") || 0,
|
|
206
207
|
scrollMargin = view.someProp("scrollMargin") || 5;
|
|
207
208
|
var doc = view.dom.ownerDocument;
|
|
@@ -686,7 +687,7 @@ var ViewDesc = function () {
|
|
|
686
687
|
}
|
|
687
688
|
}, {
|
|
688
689
|
key: "parseRule",
|
|
689
|
-
value: function parseRule() {
|
|
690
|
+
value: function parseRule(addedNodes) {
|
|
690
691
|
return null;
|
|
691
692
|
}
|
|
692
693
|
}, {
|
|
@@ -1104,7 +1105,7 @@ var WidgetViewDesc = function (_ViewDesc) {
|
|
|
1104
1105
|
wrap.appendChild(dom);
|
|
1105
1106
|
dom = wrap;
|
|
1106
1107
|
}
|
|
1107
|
-
dom.contentEditable = "false";
|
|
1108
|
+
if (!dom.hasAttribute("contenteditable")) dom.contentEditable = "false";
|
|
1108
1109
|
dom.classList.add("ProseMirror-widget");
|
|
1109
1110
|
}
|
|
1110
1111
|
_this = _super.call(this, parent, [], dom, null);
|
|
@@ -1272,7 +1273,7 @@ var MarkViewDesc = function (_ViewDesc3) {
|
|
|
1272
1273
|
var NodeViewDesc = function (_ViewDesc4) {
|
|
1273
1274
|
_inherits(NodeViewDesc, _ViewDesc4);
|
|
1274
1275
|
var _super4 = _createSuper(NodeViewDesc);
|
|
1275
|
-
function NodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM
|
|
1276
|
+
function NodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM) {
|
|
1276
1277
|
var _this4;
|
|
1277
1278
|
_classCallCheck(this, NodeViewDesc);
|
|
1278
1279
|
_this4 = _super4.call(this, parent, [], dom, contentDOM);
|
|
@@ -1284,7 +1285,7 @@ var NodeViewDesc = function (_ViewDesc4) {
|
|
|
1284
1285
|
}
|
|
1285
1286
|
_createClass(NodeViewDesc, [{
|
|
1286
1287
|
key: "parseRule",
|
|
1287
|
-
value: function parseRule() {
|
|
1288
|
+
value: function parseRule(addedNodes) {
|
|
1288
1289
|
var _this5 = this;
|
|
1289
1290
|
if (this.node.type.spec.reparseInView) return null;
|
|
1290
1291
|
var rule = {
|
|
@@ -1306,9 +1307,14 @@ var NodeViewDesc = function (_ViewDesc4) {
|
|
|
1306
1307
|
break;
|
|
1307
1308
|
}
|
|
1308
1309
|
}
|
|
1309
|
-
if (!rule.contentElement)
|
|
1310
|
-
|
|
1311
|
-
|
|
1310
|
+
if (!rule.contentElement) {
|
|
1311
|
+
var found = addedNodes && addedNodes.find(function (n) {
|
|
1312
|
+
return n.nodeType == 1 && addedNodes.indexOf(n.parentNode) < 0 && _this5.dom.contains(n);
|
|
1313
|
+
});
|
|
1314
|
+
if (found) rule.contentElement = found;else rule.getContent = function () {
|
|
1315
|
+
return prosemirrorModel.Fragment.empty;
|
|
1316
|
+
};
|
|
1317
|
+
}
|
|
1312
1318
|
}
|
|
1313
1319
|
return rule;
|
|
1314
1320
|
}
|
|
@@ -1474,23 +1480,23 @@ var NodeViewDesc = function (_ViewDesc4) {
|
|
|
1474
1480
|
}
|
|
1475
1481
|
var nodeDOM = dom;
|
|
1476
1482
|
dom = applyOuterDeco(dom, outerDeco, node);
|
|
1477
|
-
if (spec) return descObj = new CustomNodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM || null, nodeDOM, spec
|
|
1483
|
+
if (spec) return descObj = new CustomNodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM || null, nodeDOM, spec);else if (node.isText) return new TextViewDesc(parent, node, outerDeco, innerDeco, dom, nodeDOM);else return new NodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM || null, nodeDOM);
|
|
1478
1484
|
}
|
|
1479
1485
|
}]);
|
|
1480
1486
|
return NodeViewDesc;
|
|
1481
1487
|
}(ViewDesc);
|
|
1482
1488
|
function docViewDesc(doc, outerDeco, innerDeco, dom, view) {
|
|
1483
1489
|
applyOuterDeco(dom, outerDeco, doc);
|
|
1484
|
-
var docView = new NodeViewDesc(undefined, doc, outerDeco, innerDeco, dom, dom, dom
|
|
1490
|
+
var docView = new NodeViewDesc(undefined, doc, outerDeco, innerDeco, dom, dom, dom);
|
|
1485
1491
|
if (docView.contentDOM) docView.updateChildren(view, 0);
|
|
1486
1492
|
return docView;
|
|
1487
1493
|
}
|
|
1488
1494
|
var TextViewDesc = function (_NodeViewDesc) {
|
|
1489
1495
|
_inherits(TextViewDesc, _NodeViewDesc);
|
|
1490
1496
|
var _super5 = _createSuper(TextViewDesc);
|
|
1491
|
-
function TextViewDesc(parent, node, outerDeco, innerDeco, dom, nodeDOM
|
|
1497
|
+
function TextViewDesc(parent, node, outerDeco, innerDeco, dom, nodeDOM) {
|
|
1492
1498
|
_classCallCheck(this, TextViewDesc);
|
|
1493
|
-
return _super5.call(this, parent, node, outerDeco, innerDeco, dom, null, nodeDOM
|
|
1499
|
+
return _super5.call(this, parent, node, outerDeco, innerDeco, dom, null, nodeDOM);
|
|
1494
1500
|
}
|
|
1495
1501
|
_createClass(TextViewDesc, [{
|
|
1496
1502
|
key: "parseRule",
|
|
@@ -1542,10 +1548,10 @@ var TextViewDesc = function (_NodeViewDesc) {
|
|
|
1542
1548
|
}
|
|
1543
1549
|
}, {
|
|
1544
1550
|
key: "slice",
|
|
1545
|
-
value: function slice(from, to,
|
|
1551
|
+
value: function slice(from, to, _view) {
|
|
1546
1552
|
var node = this.node.cut(from, to),
|
|
1547
1553
|
dom = document.createTextNode(node.text);
|
|
1548
|
-
return new TextViewDesc(this.parent, node, this.outerDeco, this.innerDeco, dom, dom
|
|
1554
|
+
return new TextViewDesc(this.parent, node, this.outerDeco, this.innerDeco, dom, dom);
|
|
1549
1555
|
}
|
|
1550
1556
|
}, {
|
|
1551
1557
|
key: "markDirty",
|
|
@@ -1601,10 +1607,10 @@ var TrailingHackViewDesc = function (_ViewDesc5) {
|
|
|
1601
1607
|
var CustomNodeViewDesc = function (_NodeViewDesc2) {
|
|
1602
1608
|
_inherits(CustomNodeViewDesc, _NodeViewDesc2);
|
|
1603
1609
|
var _super7 = _createSuper(CustomNodeViewDesc);
|
|
1604
|
-
function CustomNodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, spec
|
|
1610
|
+
function CustomNodeViewDesc(parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM, spec) {
|
|
1605
1611
|
var _this7;
|
|
1606
1612
|
_classCallCheck(this, CustomNodeViewDesc);
|
|
1607
|
-
_this7 = _super7.call(this, parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM
|
|
1613
|
+
_this7 = _super7.call(this, parent, node, outerDeco, innerDeco, dom, contentDOM, nodeDOM);
|
|
1608
1614
|
_this7.spec = spec;
|
|
1609
1615
|
return _this7;
|
|
1610
1616
|
}
|
|
@@ -1810,6 +1816,14 @@ var ViewTreeUpdater = function () {
|
|
|
1810
1816
|
break;
|
|
1811
1817
|
}
|
|
1812
1818
|
}
|
|
1819
|
+
if (found < 0 && this.index < this.top.children.length) {
|
|
1820
|
+
var cur = this.top.children[this.index];
|
|
1821
|
+
if (cur instanceof MarkViewDesc && cur.dirty != NODE_DIRTY && cur.mark.type == marks[depth].type && cur.spec.update && !this.isLocked(cur.dom) && cur.spec.update(marks[depth])) {
|
|
1822
|
+
cur.mark = marks[depth];
|
|
1823
|
+
found = this.index;
|
|
1824
|
+
this.changed = true;
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1813
1827
|
if (found > -1) {
|
|
1814
1828
|
if (found > this.index) {
|
|
1815
1829
|
this.changed = true;
|
|
@@ -2201,11 +2215,11 @@ function selectionToDOM(view) {
|
|
|
2201
2215
|
var sel = view.state.selection;
|
|
2202
2216
|
syncNodeSelection(view, sel);
|
|
2203
2217
|
if (!editorOwnsSelection(view)) return;
|
|
2204
|
-
|
|
2218
|
+
var mouseDown = view.input.mouseDown;
|
|
2219
|
+
if (!force && chrome && mouseDown) {
|
|
2205
2220
|
var domSel = view.domSelectionRange(),
|
|
2206
2221
|
curSel = view.domObserver.currentSelection;
|
|
2207
|
-
if (domSel.anchorNode && curSel.anchorNode && isEquivalentPosition(domSel.anchorNode, domSel.anchorOffset, curSel.anchorNode, curSel.anchorOffset)) {
|
|
2208
|
-
view.input.mouseDown.delayedSelectionSync = true;
|
|
2222
|
+
if (domSel.anchorNode && curSel.anchorNode && isEquivalentPosition(domSel.anchorNode, domSel.anchorOffset, curSel.anchorNode, curSel.anchorOffset) && mouseDown.delaySelUpdate()) {
|
|
2209
2223
|
view.domObserver.setCurSelection();
|
|
2210
2224
|
return;
|
|
2211
2225
|
}
|
|
@@ -2831,25 +2845,30 @@ var wrapMap = {
|
|
|
2831
2845
|
td: ["table", "tbody", "tr"],
|
|
2832
2846
|
th: ["table", "tbody", "tr"]
|
|
2833
2847
|
};
|
|
2834
|
-
var _detachedDoc = null;
|
|
2835
2848
|
function detachedDoc() {
|
|
2836
|
-
return
|
|
2849
|
+
return document.implementation.createHTMLDocument("title");
|
|
2837
2850
|
}
|
|
2838
2851
|
var _policy = null;
|
|
2839
2852
|
function maybeWrapTrusted(html) {
|
|
2840
2853
|
var trustedTypes = window.trustedTypes;
|
|
2841
2854
|
if (!trustedTypes) return html;
|
|
2842
|
-
if (!_policy)
|
|
2843
|
-
|
|
2844
|
-
return
|
|
2845
|
-
}
|
|
2846
|
-
|
|
2855
|
+
if (!_policy) {
|
|
2856
|
+
if (_policy = trustedTypes.defaultPolicy) try {
|
|
2857
|
+
return _policy.createHTML(html);
|
|
2858
|
+
} catch (_a) {}
|
|
2859
|
+
_policy = trustedTypes.createPolicy("ProseMirrorClipboard", {
|
|
2860
|
+
createHTML: function createHTML(s) {
|
|
2861
|
+
return s;
|
|
2862
|
+
}
|
|
2863
|
+
});
|
|
2864
|
+
}
|
|
2847
2865
|
return _policy.createHTML(html);
|
|
2848
2866
|
}
|
|
2849
2867
|
function readHTML(html) {
|
|
2850
2868
|
var metas = /^(\s*<meta [^>]*>)*/.exec(html);
|
|
2851
2869
|
if (metas) html = html.slice(metas[0].length);
|
|
2852
|
-
var
|
|
2870
|
+
var doc = detachedDoc(),
|
|
2871
|
+
elt = doc.body;
|
|
2853
2872
|
var firstTag = /<([a-z][^>\s]+)/i.exec(html),
|
|
2854
2873
|
wrap;
|
|
2855
2874
|
if (wrap = firstTag && wrapMap[firstTag[1].toLowerCase()]) html = wrap.map(function (n) {
|
|
@@ -2859,6 +2878,16 @@ function readHTML(html) {
|
|
|
2859
2878
|
}).reverse().join("");
|
|
2860
2879
|
elt.innerHTML = maybeWrapTrusted(html);
|
|
2861
2880
|
if (wrap) for (var i = 0; i < wrap.length; i++) elt = elt.querySelector(wrap[i]) || elt;
|
|
2881
|
+
for (var _i6 = 0; _i6 < doc.styleSheets.length; _i6++) {
|
|
2882
|
+
var style = doc.styleSheets[_i6];
|
|
2883
|
+
for (var j = 0; j < style.rules.length; j++) {
|
|
2884
|
+
var rule = style.rules[j];
|
|
2885
|
+
if (rule instanceof CSSStyleRule) {
|
|
2886
|
+
var matches = elt.querySelectorAll(rule.selectorText);
|
|
2887
|
+
for (var k = 0; k < matches.length; k++) matches[k].style.cssText += rule.style.cssText;
|
|
2888
|
+
}
|
|
2889
|
+
}
|
|
2890
|
+
}
|
|
2862
2891
|
return elt;
|
|
2863
2892
|
}
|
|
2864
2893
|
function restoreReplacedSpaces(dom) {
|
|
@@ -2883,6 +2912,11 @@ function addContext(slice, context) {
|
|
|
2883
2912
|
for (var i = array.length - 2; i >= 0; i -= 2) {
|
|
2884
2913
|
var type = schema.nodes[array[i]];
|
|
2885
2914
|
if (!type || type.hasRequiredAttrs()) break;
|
|
2915
|
+
try {
|
|
2916
|
+
type.checkAttrs(array[i + 1]);
|
|
2917
|
+
} catch (e) {
|
|
2918
|
+
break;
|
|
2919
|
+
}
|
|
2886
2920
|
content = prosemirrorModel.Fragment.from(type.create(array[i + 1], content));
|
|
2887
2921
|
openStart++;
|
|
2888
2922
|
openEnd++;
|
|
@@ -2949,6 +2983,7 @@ function setSelectionOrigin(view, origin) {
|
|
|
2949
2983
|
view.input.lastSelectionTime = Date.now();
|
|
2950
2984
|
}
|
|
2951
2985
|
function destroyInput(view) {
|
|
2986
|
+
if (view.input.mouseDown) view.input.mouseDown.done();
|
|
2952
2987
|
view.domObserver.stop();
|
|
2953
2988
|
for (var type in view.input.eventHandlers) view.dom.removeEventListener(type, view.input.eventHandlers[type]);
|
|
2954
2989
|
clearTimeout(view.input.composingTimeout);
|
|
@@ -2979,7 +3014,7 @@ function _dispatchEvent(view, event) {
|
|
|
2979
3014
|
editHandlers.keydown = function (view, _event) {
|
|
2980
3015
|
var event = _event;
|
|
2981
3016
|
view.input.shiftKey = event.keyCode == 16 || event.shiftKey;
|
|
2982
|
-
if (inOrNearComposition(view
|
|
3017
|
+
if (inOrNearComposition(view)) return;
|
|
2983
3018
|
view.input.lastKeyCode = event.keyCode;
|
|
2984
3019
|
view.input.lastKeyCodeTime = Date.now();
|
|
2985
3020
|
if (android && chrome && event.keyCode == 13) return;
|
|
@@ -3008,7 +3043,7 @@ editHandlers.keyup = function (view, event) {
|
|
|
3008
3043
|
};
|
|
3009
3044
|
editHandlers.keypress = function (view, _event) {
|
|
3010
3045
|
var event = _event;
|
|
3011
|
-
if (inOrNearComposition(view
|
|
3046
|
+
if (inOrNearComposition(view) || !event.charCode || event.ctrlKey && !event.altKey || mac && event.metaKey) return;
|
|
3012
3047
|
if (view.someProp("handleKeyPress", function (f) {
|
|
3013
3048
|
return f(view, event);
|
|
3014
3049
|
})) {
|
|
@@ -3110,21 +3145,23 @@ function handleTripleClick(view, pos, inside, event) {
|
|
|
3110
3145
|
}
|
|
3111
3146
|
function defaultTripleClick(view, inside, event) {
|
|
3112
3147
|
if (event.button != 0) return false;
|
|
3148
|
+
var selection = selectionForTripleClick(view, inside, true),
|
|
3149
|
+
doc = view.state.doc;
|
|
3150
|
+
if (!selection) return false;
|
|
3151
|
+
updateSelection(view, selection, "pointer");
|
|
3152
|
+
if (selection instanceof prosemirrorState.TextSelection && doc.eq(view.state.doc)) view.input.mouseDown = new TripleClickDrag(view, selection);
|
|
3153
|
+
return true;
|
|
3154
|
+
}
|
|
3155
|
+
function selectionForTripleClick(view, inside, selectNodes) {
|
|
3113
3156
|
var doc = view.state.doc;
|
|
3114
|
-
if (inside == -1)
|
|
3115
|
-
if (doc.inlineContent) {
|
|
3116
|
-
updateSelection(view, prosemirrorState.TextSelection.create(doc, 0, doc.content.size), "pointer");
|
|
3117
|
-
return true;
|
|
3118
|
-
}
|
|
3119
|
-
return false;
|
|
3120
|
-
}
|
|
3157
|
+
if (inside == -1) return doc.inlineContent ? prosemirrorState.TextSelection.create(doc, 0, doc.content.size) : null;
|
|
3121
3158
|
var $pos = doc.resolve(inside);
|
|
3122
3159
|
for (var i = $pos.depth + 1; i > 0; i--) {
|
|
3123
3160
|
var node = i > $pos.depth ? $pos.nodeAfter : $pos.node(i);
|
|
3124
3161
|
var nodePos = $pos.before(i);
|
|
3125
|
-
if (node.inlineContent)
|
|
3126
|
-
return true;
|
|
3162
|
+
if (node.inlineContent) return prosemirrorState.TextSelection.create(doc, nodePos + 1, nodePos + 1 + node.content.size);else if (selectNodes && prosemirrorState.NodeSelection.isSelectable(node)) return prosemirrorState.NodeSelection.create(doc, nodePos);
|
|
3127
3163
|
}
|
|
3164
|
+
return null;
|
|
3128
3165
|
}
|
|
3129
3166
|
function forceDOMFlush(view) {
|
|
3130
3167
|
return endComposition(view);
|
|
@@ -3146,11 +3183,11 @@ handlers.mousedown = function (view, _event) {
|
|
|
3146
3183
|
type: type,
|
|
3147
3184
|
button: event.button
|
|
3148
3185
|
};
|
|
3186
|
+
if (view.input.mouseDown) view.input.mouseDown.done();
|
|
3149
3187
|
var pos = view.posAtCoords(eventCoords(event));
|
|
3150
3188
|
if (!pos) return;
|
|
3151
3189
|
if (type == "singleClick") {
|
|
3152
|
-
|
|
3153
|
-
view.input.mouseDown = new MouseDown(view, pos, event, !!flushed);
|
|
3190
|
+
view.input.mouseDown = new LeftMouseDown(view, pos, event, !!flushed);
|
|
3154
3191
|
} else if ((type == "doubleClick" ? handleDoubleClick : handleTripleClick)(view, pos.pos, pos.inside, event)) {
|
|
3155
3192
|
event.preventDefault();
|
|
3156
3193
|
} else {
|
|
@@ -3158,18 +3195,52 @@ handlers.mousedown = function (view, _event) {
|
|
|
3158
3195
|
}
|
|
3159
3196
|
};
|
|
3160
3197
|
var MouseDown = function () {
|
|
3161
|
-
function MouseDown(view
|
|
3162
|
-
var _this8 = this;
|
|
3198
|
+
function MouseDown(view) {
|
|
3163
3199
|
_classCallCheck(this, MouseDown);
|
|
3164
3200
|
this.view = view;
|
|
3165
|
-
this.pos = pos;
|
|
3166
|
-
this.event = event;
|
|
3167
|
-
this.flushed = flushed;
|
|
3168
|
-
this.delayedSelectionSync = false;
|
|
3169
3201
|
this.mightDrag = null;
|
|
3170
|
-
this.
|
|
3171
|
-
this.
|
|
3172
|
-
|
|
3202
|
+
view.root.addEventListener("mouseup", this.up = this.up.bind(this));
|
|
3203
|
+
view.root.addEventListener("mousemove", this.move = this.move.bind(this));
|
|
3204
|
+
}
|
|
3205
|
+
_createClass(MouseDown, [{
|
|
3206
|
+
key: "up",
|
|
3207
|
+
value: function up(event) {
|
|
3208
|
+
this.done();
|
|
3209
|
+
}
|
|
3210
|
+
}, {
|
|
3211
|
+
key: "move",
|
|
3212
|
+
value: function move(event) {
|
|
3213
|
+
if (event.buttons == 0) this.done();
|
|
3214
|
+
}
|
|
3215
|
+
}, {
|
|
3216
|
+
key: "done",
|
|
3217
|
+
value: function done() {
|
|
3218
|
+
this.view.root.removeEventListener("mouseup", this.up);
|
|
3219
|
+
this.view.root.removeEventListener("mousemove", this.move);
|
|
3220
|
+
if (this.view.input.mouseDown == this) this.view.input.mouseDown = null;
|
|
3221
|
+
}
|
|
3222
|
+
}, {
|
|
3223
|
+
key: "delaySelUpdate",
|
|
3224
|
+
value: function delaySelUpdate() {
|
|
3225
|
+
return false;
|
|
3226
|
+
}
|
|
3227
|
+
}]);
|
|
3228
|
+
return MouseDown;
|
|
3229
|
+
}();
|
|
3230
|
+
var LeftMouseDown = function (_MouseDown) {
|
|
3231
|
+
_inherits(LeftMouseDown, _MouseDown);
|
|
3232
|
+
var _super8 = _createSuper(LeftMouseDown);
|
|
3233
|
+
function LeftMouseDown(view, pos, event, flushed) {
|
|
3234
|
+
var _this8;
|
|
3235
|
+
_classCallCheck(this, LeftMouseDown);
|
|
3236
|
+
_this8 = _super8.call(this, view);
|
|
3237
|
+
_this8.pos = pos;
|
|
3238
|
+
_this8.event = event;
|
|
3239
|
+
_this8.flushed = flushed;
|
|
3240
|
+
_this8.delayedSelectionSync = false;
|
|
3241
|
+
_this8.startDoc = view.state.doc;
|
|
3242
|
+
_this8.selectNode = !!event[selectNodeModifier];
|
|
3243
|
+
_this8.allowDefault = event.shiftKey;
|
|
3173
3244
|
var targetNode, targetPos;
|
|
3174
3245
|
if (pos.inside > -1) {
|
|
3175
3246
|
targetNode = view.state.doc.nodeAt(pos.inside);
|
|
@@ -3181,32 +3252,30 @@ var MouseDown = function () {
|
|
|
3181
3252
|
}
|
|
3182
3253
|
var target = flushed ? null : event.target;
|
|
3183
3254
|
var targetDesc = target ? view.docView.nearestDesc(target, true) : null;
|
|
3184
|
-
|
|
3255
|
+
_this8.target = targetDesc && targetDesc.nodeDOM.nodeType == 1 ? targetDesc.nodeDOM : null;
|
|
3185
3256
|
var selection = view.state.selection;
|
|
3186
|
-
if (event.button == 0 && targetNode.type.spec.draggable && targetNode.type.spec.selectable !== false || selection instanceof prosemirrorState.NodeSelection && selection.from <= targetPos && selection.to > targetPos)
|
|
3257
|
+
if (event.button == 0 && (targetNode.type.spec.draggable && targetNode.type.spec.selectable !== false || selection instanceof prosemirrorState.NodeSelection && selection.from <= targetPos && selection.to > targetPos)) _this8.mightDrag = {
|
|
3187
3258
|
node: targetNode,
|
|
3188
3259
|
pos: targetPos,
|
|
3189
|
-
addAttr: !!(
|
|
3190
|
-
setUneditable: !!(
|
|
3260
|
+
addAttr: !!(_this8.target && !_this8.target.draggable),
|
|
3261
|
+
setUneditable: !!(_this8.target && gecko && !_this8.target.hasAttribute("contentEditable"))
|
|
3191
3262
|
};
|
|
3192
|
-
if (
|
|
3193
|
-
|
|
3194
|
-
if (
|
|
3195
|
-
if (
|
|
3196
|
-
if (_this8.view.input.mouseDown == _this8) _this8.target.setAttribute("contentEditable", "false");
|
|
3263
|
+
if (_this8.target && _this8.mightDrag && (_this8.mightDrag.addAttr || _this8.mightDrag.setUneditable)) {
|
|
3264
|
+
_this8.view.domObserver.stop();
|
|
3265
|
+
if (_this8.mightDrag.addAttr) _this8.target.draggable = true;
|
|
3266
|
+
if (_this8.mightDrag.setUneditable) setTimeout(function () {
|
|
3267
|
+
if (_this8.view.input.mouseDown == _assertThisInitialized(_this8)) _this8.target.setAttribute("contentEditable", "false");
|
|
3197
3268
|
}, 20);
|
|
3198
|
-
|
|
3269
|
+
_this8.view.domObserver.start();
|
|
3199
3270
|
}
|
|
3200
|
-
view.root.addEventListener("mouseup", this.up = this.up.bind(this));
|
|
3201
|
-
view.root.addEventListener("mousemove", this.move = this.move.bind(this));
|
|
3202
3271
|
setSelectionOrigin(view, "pointer");
|
|
3272
|
+
return _this8;
|
|
3203
3273
|
}
|
|
3204
|
-
_createClass(
|
|
3274
|
+
_createClass(LeftMouseDown, [{
|
|
3205
3275
|
key: "done",
|
|
3206
3276
|
value: function done() {
|
|
3207
3277
|
var _this9 = this;
|
|
3208
|
-
|
|
3209
|
-
this.view.root.removeEventListener("mousemove", this.move);
|
|
3278
|
+
_get(_getPrototypeOf(LeftMouseDown.prototype), "done", this).call(this);
|
|
3210
3279
|
if (this.mightDrag && this.target) {
|
|
3211
3280
|
this.view.domObserver.stop();
|
|
3212
3281
|
if (this.mightDrag.addAttr) this.target.removeAttribute("draggable");
|
|
@@ -3214,9 +3283,8 @@ var MouseDown = function () {
|
|
|
3214
3283
|
this.view.domObserver.start();
|
|
3215
3284
|
}
|
|
3216
3285
|
if (this.delayedSelectionSync) setTimeout(function () {
|
|
3217
|
-
|
|
3286
|
+
if (!_this9.view.isDestroyed) selectionToDOM(_this9.view);
|
|
3218
3287
|
});
|
|
3219
|
-
this.view.input.mouseDown = null;
|
|
3220
3288
|
}
|
|
3221
3289
|
}, {
|
|
3222
3290
|
key: "up",
|
|
@@ -3242,16 +3310,57 @@ var MouseDown = function () {
|
|
|
3242
3310
|
value: function move(event) {
|
|
3243
3311
|
this.updateAllowDefault(event);
|
|
3244
3312
|
setSelectionOrigin(this.view, "pointer");
|
|
3245
|
-
|
|
3313
|
+
_get(_getPrototypeOf(LeftMouseDown.prototype), "move", this).call(this, event);
|
|
3246
3314
|
}
|
|
3247
3315
|
}, {
|
|
3248
3316
|
key: "updateAllowDefault",
|
|
3249
3317
|
value: function updateAllowDefault(event) {
|
|
3250
3318
|
if (!this.allowDefault && (Math.abs(this.event.x - event.clientX) > 4 || Math.abs(this.event.y - event.clientY) > 4)) this.allowDefault = true;
|
|
3251
3319
|
}
|
|
3320
|
+
}, {
|
|
3321
|
+
key: "delaySelUpdate",
|
|
3322
|
+
value: function delaySelUpdate() {
|
|
3323
|
+
if (!this.allowDefault) return false;
|
|
3324
|
+
this.delayedSelectionSync = true;
|
|
3325
|
+
return true;
|
|
3326
|
+
}
|
|
3252
3327
|
}]);
|
|
3253
|
-
return
|
|
3254
|
-
}();
|
|
3328
|
+
return LeftMouseDown;
|
|
3329
|
+
}(MouseDown);
|
|
3330
|
+
var TripleClickDrag = function (_MouseDown2) {
|
|
3331
|
+
_inherits(TripleClickDrag, _MouseDown2);
|
|
3332
|
+
var _super9 = _createSuper(TripleClickDrag);
|
|
3333
|
+
function TripleClickDrag(view, startSelection) {
|
|
3334
|
+
var _this10;
|
|
3335
|
+
_classCallCheck(this, TripleClickDrag);
|
|
3336
|
+
_this10 = _super9.call(this, view);
|
|
3337
|
+
_this10.startSelection = startSelection;
|
|
3338
|
+
_this10.startDoc = view.state.doc;
|
|
3339
|
+
return _this10;
|
|
3340
|
+
}
|
|
3341
|
+
_createClass(TripleClickDrag, [{
|
|
3342
|
+
key: "move",
|
|
3343
|
+
value: function move(event) {
|
|
3344
|
+
if (event.buttons == 0 || this.view.isDestroyed || !this.view.state.doc.eq(this.startDoc)) {
|
|
3345
|
+
this.done();
|
|
3346
|
+
return;
|
|
3347
|
+
}
|
|
3348
|
+
event.preventDefault();
|
|
3349
|
+
setSelectionOrigin(this.view, "pointer");
|
|
3350
|
+
var pos = this.view.posAtCoords(eventCoords(event));
|
|
3351
|
+
var target = pos && selectionForTripleClick(this.view, pos.inside, false);
|
|
3352
|
+
if (!target) return;
|
|
3353
|
+
var doc = this.view.state.doc,
|
|
3354
|
+
start = this.startSelection;
|
|
3355
|
+
var _ref5 = target.from < start.from ? [start.to, target.from] : [start.from, target.to],
|
|
3356
|
+
_ref6 = _slicedToArray(_ref5, 2),
|
|
3357
|
+
anchor = _ref6[0],
|
|
3358
|
+
head = _ref6[1];
|
|
3359
|
+
updateSelection(this.view, prosemirrorState.TextSelection.create(doc, anchor, head), "pointer");
|
|
3360
|
+
}
|
|
3361
|
+
}]);
|
|
3362
|
+
return TripleClickDrag;
|
|
3363
|
+
}(MouseDown);
|
|
3255
3364
|
handlers.touchstart = function (view) {
|
|
3256
3365
|
view.input.lastTouch = Date.now();
|
|
3257
3366
|
forceDOMFlush(view);
|
|
@@ -3266,7 +3375,7 @@ handlers.contextmenu = function (view) {
|
|
|
3266
3375
|
};
|
|
3267
3376
|
function inOrNearComposition(view, event) {
|
|
3268
3377
|
if (view.composing) return true;
|
|
3269
|
-
if (safari && Math.abs(
|
|
3378
|
+
if (safari && Math.abs(Date.now() - view.input.compositionEndedAt) < 500) {
|
|
3270
3379
|
view.input.compositionEndedAt = -2e8;
|
|
3271
3380
|
return true;
|
|
3272
3381
|
}
|
|
@@ -3317,7 +3426,7 @@ function selectionBeforeUneditable(view) {
|
|
|
3317
3426
|
editHandlers.compositionend = function (view, event) {
|
|
3318
3427
|
if (view.composing) {
|
|
3319
3428
|
view.input.composing = false;
|
|
3320
|
-
view.input.compositionEndedAt =
|
|
3429
|
+
view.input.compositionEndedAt = Date.now();
|
|
3321
3430
|
view.input.compositionPendingChanges = view.domObserver.pendingRecords().length ? view.input.compositionID : 0;
|
|
3322
3431
|
view.input.compositionNode = null;
|
|
3323
3432
|
if (view.input.badSafariComposition) view.domObserver.forceFlush();else if (view.input.compositionPendingChanges) Promise.resolve().then(function () {
|
|
@@ -3336,7 +3445,7 @@ function scheduleComposeEnd(view, delay) {
|
|
|
3336
3445
|
function clearComposition(view) {
|
|
3337
3446
|
if (view.composing) {
|
|
3338
3447
|
view.input.composing = false;
|
|
3339
|
-
view.input.compositionEndedAt =
|
|
3448
|
+
view.input.compositionEndedAt = Date.now();
|
|
3340
3449
|
}
|
|
3341
3450
|
while (view.input.compositionNodes.length > 0) view.input.compositionNodes.pop().markParentsDirty();
|
|
3342
3451
|
}
|
|
@@ -3358,11 +3467,6 @@ function findCompositionNode(view) {
|
|
|
3358
3467
|
}
|
|
3359
3468
|
return textBefore || textAfter;
|
|
3360
3469
|
}
|
|
3361
|
-
function timestampFromCustomEvent() {
|
|
3362
|
-
var event = document.createEvent("Event");
|
|
3363
|
-
event.initEvent("event", true, true);
|
|
3364
|
-
return event.timeStamp;
|
|
3365
|
-
}
|
|
3366
3470
|
function endComposition(view) {
|
|
3367
3471
|
var restarting = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
3368
3472
|
if (android && view.domObserver.flushingSoon >= 0) return;
|
|
@@ -3462,10 +3566,11 @@ var Dragging = _createClass(function Dragging(slice, move, node) {
|
|
|
3462
3566
|
});
|
|
3463
3567
|
var dragCopyModifier = mac ? "altKey" : "ctrlKey";
|
|
3464
3568
|
function dragMoves(view, event) {
|
|
3465
|
-
var
|
|
3466
|
-
|
|
3569
|
+
var copy;
|
|
3570
|
+
view.someProp("dragCopies", function (test) {
|
|
3571
|
+
copy = copy || test(event);
|
|
3467
3572
|
});
|
|
3468
|
-
return
|
|
3573
|
+
return copy != null ? !copy : !event[dragCopyModifier];
|
|
3469
3574
|
}
|
|
3470
3575
|
handlers.dragstart = function (view, _event) {
|
|
3471
3576
|
var event = _event;
|
|
@@ -3579,7 +3684,7 @@ handlers.blur = function (view, _event) {
|
|
|
3579
3684
|
};
|
|
3580
3685
|
handlers.beforeinput = function (view, _event) {
|
|
3581
3686
|
var event = _event;
|
|
3582
|
-
if (
|
|
3687
|
+
if (android && event.inputType == "deleteContentBackward") {
|
|
3583
3688
|
view.domObserver.flushSoon();
|
|
3584
3689
|
var domChangeCount = view.input.domChangeCount;
|
|
3585
3690
|
setTimeout(function () {
|
|
@@ -3781,10 +3886,10 @@ var DecorationSet = function () {
|
|
|
3781
3886
|
var span = this.local[i];
|
|
3782
3887
|
if (span.from <= end && span.to >= start && (!predicate || predicate(span.spec))) result.push(span.copy(span.from + offset, span.to + offset));
|
|
3783
3888
|
}
|
|
3784
|
-
for (var
|
|
3785
|
-
if (this.children[
|
|
3786
|
-
var childOff = this.children[
|
|
3787
|
-
this.children[
|
|
3889
|
+
for (var _i7 = 0; _i7 < this.children.length; _i7 += 3) {
|
|
3890
|
+
if (this.children[_i7] < end && this.children[_i7 + 1] > start) {
|
|
3891
|
+
var childOff = this.children[_i7] + 1;
|
|
3892
|
+
this.children[_i7 + 2].findInner(start - childOff, end - childOff, result, offset + childOff, predicate);
|
|
3788
3893
|
}
|
|
3789
3894
|
}
|
|
3790
3895
|
}
|
|
@@ -3814,14 +3919,14 @@ var DecorationSet = function () {
|
|
|
3814
3919
|
}, {
|
|
3815
3920
|
key: "addInner",
|
|
3816
3921
|
value: function addInner(doc, decorations, offset) {
|
|
3817
|
-
var
|
|
3922
|
+
var _this11 = this;
|
|
3818
3923
|
var children,
|
|
3819
3924
|
childIndex = 0;
|
|
3820
3925
|
doc.forEach(function (childNode, childOffset) {
|
|
3821
3926
|
var baseOffset = childOffset + offset,
|
|
3822
3927
|
found;
|
|
3823
3928
|
if (!(found = takeSpansForNode(decorations, childNode, baseOffset))) return;
|
|
3824
|
-
if (!children) children =
|
|
3929
|
+
if (!children) children = _this11.children.slice();
|
|
3825
3930
|
while (childIndex < children.length && children[childIndex] < childOffset) childIndex += 3;
|
|
3826
3931
|
if (children[childIndex] == childOffset) children[childIndex + 2] = children[childIndex + 2].addInner(childNode, found, baseOffset + 1);else children.splice(childIndex, 0, childOffset, childOffset + childNode.nodeSize, buildTree(found, childNode, baseOffset + 1, noSpec));
|
|
3827
3932
|
childIndex += 3;
|
|
@@ -3861,7 +3966,7 @@ var DecorationSet = function () {
|
|
|
3861
3966
|
i -= 3;
|
|
3862
3967
|
}
|
|
3863
3968
|
}
|
|
3864
|
-
if (local.length) for (var
|
|
3969
|
+
if (local.length) for (var _i8 = 0, _span; _i8 < decorations.length; _i8++) if (_span = decorations[_i8]) {
|
|
3865
3970
|
for (var _j2 = 0; _j2 < local.length; _j2++) if (local[_j2].eq(_span, offset)) {
|
|
3866
3971
|
if (local == this.local) local = this.local.slice();
|
|
3867
3972
|
local.splice(_j2--, 1);
|
|
@@ -3882,8 +3987,8 @@ var DecorationSet = function () {
|
|
|
3882
3987
|
}
|
|
3883
3988
|
var start = offset + 1,
|
|
3884
3989
|
end = start + node.content.size;
|
|
3885
|
-
for (var
|
|
3886
|
-
var dec = this.local[
|
|
3990
|
+
for (var _i9 = 0; _i9 < this.local.length; _i9++) {
|
|
3991
|
+
var dec = this.local[_i9];
|
|
3887
3992
|
if (dec.from < end && dec.to > start && dec.type instanceof InlineType) {
|
|
3888
3993
|
var from = Math.max(start, dec.from) - start,
|
|
3889
3994
|
to = Math.min(end, dec.to) - start;
|
|
@@ -3902,7 +4007,7 @@ var DecorationSet = function () {
|
|
|
3902
4007
|
if (this == other) return true;
|
|
3903
4008
|
if (!(other instanceof DecorationSet) || this.local.length != other.local.length || this.children.length != other.children.length) return false;
|
|
3904
4009
|
for (var i = 0; i < this.local.length; i++) if (!this.local[i].eq(other.local[i])) return false;
|
|
3905
|
-
for (var
|
|
4010
|
+
for (var _i10 = 0; _i10 < this.children.length; _i10 += 3) if (this.children[_i10] != other.children[_i10] || this.children[_i10 + 1] != other.children[_i10 + 1] || !this.children[_i10 + 2].eq(other.children[_i10 + 2])) return false;
|
|
3906
4011
|
return true;
|
|
3907
4012
|
}
|
|
3908
4013
|
}, {
|
|
@@ -4019,15 +4124,15 @@ function mapChildren(oldChildren, newLocal, mapping, node, offset, oldOffset, op
|
|
|
4019
4124
|
var moved = 0;
|
|
4020
4125
|
mapping.maps[i].forEach(function (oldStart, oldEnd, newStart, newEnd) {
|
|
4021
4126
|
var dSize = newEnd - newStart - (oldEnd - oldStart);
|
|
4022
|
-
for (var
|
|
4023
|
-
var end = children[
|
|
4127
|
+
for (var _i14 = 0; _i14 < children.length; _i14 += 3) {
|
|
4128
|
+
var end = children[_i14 + 1];
|
|
4024
4129
|
if (end < 0 || oldStart > end + _baseOffset - moved) continue;
|
|
4025
|
-
var start = children[
|
|
4130
|
+
var start = children[_i14] + _baseOffset - moved;
|
|
4026
4131
|
if (oldEnd >= start) {
|
|
4027
|
-
children[
|
|
4132
|
+
children[_i14 + 1] = oldStart <= start ? -2 : -1;
|
|
4028
4133
|
} else if (oldStart >= _baseOffset && dSize) {
|
|
4029
|
-
children[
|
|
4030
|
-
children[
|
|
4134
|
+
children[_i14] += dSize;
|
|
4135
|
+
children[_i14 + 1] += dSize;
|
|
4031
4136
|
}
|
|
4032
4137
|
}
|
|
4033
4138
|
moved += dSize;
|
|
@@ -4039,32 +4144,32 @@ function mapChildren(oldChildren, newLocal, mapping, node, offset, oldOffset, op
|
|
|
4039
4144
|
_loop4(baseOffset);
|
|
4040
4145
|
}
|
|
4041
4146
|
var mustRebuild = false;
|
|
4042
|
-
for (var
|
|
4043
|
-
if (children[
|
|
4147
|
+
for (var _i11 = 0; _i11 < children.length; _i11 += 3) if (children[_i11 + 1] < 0) {
|
|
4148
|
+
if (children[_i11 + 1] == -2) {
|
|
4044
4149
|
mustRebuild = true;
|
|
4045
|
-
children[
|
|
4150
|
+
children[_i11 + 1] = -1;
|
|
4046
4151
|
continue;
|
|
4047
4152
|
}
|
|
4048
|
-
var from = mapping.map(oldChildren[
|
|
4153
|
+
var from = mapping.map(oldChildren[_i11] + oldOffset),
|
|
4049
4154
|
fromLocal = from - offset;
|
|
4050
4155
|
if (fromLocal < 0 || fromLocal >= node.content.size) {
|
|
4051
4156
|
mustRebuild = true;
|
|
4052
4157
|
continue;
|
|
4053
4158
|
}
|
|
4054
|
-
var to = mapping.map(oldChildren[
|
|
4159
|
+
var to = mapping.map(oldChildren[_i11 + 1] + oldOffset, -1),
|
|
4055
4160
|
toLocal = to - offset;
|
|
4056
4161
|
var _node$content$findInd2 = node.content.findIndex(fromLocal),
|
|
4057
4162
|
index = _node$content$findInd2.index,
|
|
4058
4163
|
childOffset = _node$content$findInd2.offset;
|
|
4059
4164
|
var childNode = node.maybeChild(index);
|
|
4060
4165
|
if (childNode && childOffset == fromLocal && childOffset + childNode.nodeSize == toLocal) {
|
|
4061
|
-
var mapped = children[
|
|
4166
|
+
var mapped = children[_i11 + 2].mapInner(mapping, childNode, from + 1, oldChildren[_i11] + oldOffset + 1, options);
|
|
4062
4167
|
if (mapped != empty) {
|
|
4063
|
-
children[
|
|
4064
|
-
children[
|
|
4065
|
-
children[
|
|
4168
|
+
children[_i11] = fromLocal;
|
|
4169
|
+
children[_i11 + 1] = toLocal;
|
|
4170
|
+
children[_i11 + 2] = mapped;
|
|
4066
4171
|
} else {
|
|
4067
|
-
children[
|
|
4172
|
+
children[_i11 + 1] = -2;
|
|
4068
4173
|
mustRebuild = true;
|
|
4069
4174
|
}
|
|
4070
4175
|
} else {
|
|
@@ -4075,14 +4180,14 @@ function mapChildren(oldChildren, newLocal, mapping, node, offset, oldOffset, op
|
|
|
4075
4180
|
var decorations = mapAndGatherRemainingDecorations(children, oldChildren, newLocal, mapping, offset, oldOffset, options);
|
|
4076
4181
|
var built = buildTree(decorations, node, 0, options);
|
|
4077
4182
|
newLocal = built.local;
|
|
4078
|
-
for (var
|
|
4079
|
-
children.splice(
|
|
4080
|
-
|
|
4183
|
+
for (var _i12 = 0; _i12 < children.length; _i12 += 3) if (children[_i12 + 1] < 0) {
|
|
4184
|
+
children.splice(_i12, 3);
|
|
4185
|
+
_i12 -= 3;
|
|
4081
4186
|
}
|
|
4082
|
-
for (var
|
|
4083
|
-
var _from2 = built.children[
|
|
4187
|
+
for (var _i13 = 0, j = 0; _i13 < built.children.length; _i13 += 3) {
|
|
4188
|
+
var _from2 = built.children[_i13];
|
|
4084
4189
|
while (j < children.length && children[j] < _from2) j += 3;
|
|
4085
|
-
children.splice(j, 0, built.children[
|
|
4190
|
+
children.splice(j, 0, built.children[_i13], built.children[_i13 + 1], built.children[_i13 + 2]);
|
|
4086
4191
|
}
|
|
4087
4192
|
}
|
|
4088
4193
|
return new DecorationSet(newLocal.sort(byPos), children);
|
|
@@ -4102,7 +4207,7 @@ function mapAndGatherRemainingDecorations(children, oldChildren, decorations, ma
|
|
|
4102
4207
|
var mapped = set.local[i].map(mapping, offset, oldOffset);
|
|
4103
4208
|
if (mapped) decorations.push(mapped);else if (options.onRemove) options.onRemove(set.local[i].spec);
|
|
4104
4209
|
}
|
|
4105
|
-
for (var
|
|
4210
|
+
for (var _i15 = 0; _i15 < set.children.length; _i15 += 3) gather(set.children[_i15 + 2], set.children[_i15] + oldOffset + 1);
|
|
4106
4211
|
}
|
|
4107
4212
|
for (var i = 0; i < children.length; i += 3) if (children[i + 1] == -1) gather(children[i + 2], oldChildren[i] + oldOffset + 1);
|
|
4108
4213
|
return decorations;
|
|
@@ -4223,7 +4328,7 @@ var SelectionState = function () {
|
|
|
4223
4328
|
}();
|
|
4224
4329
|
var DOMObserver = function () {
|
|
4225
4330
|
function DOMObserver(view, handleDOMChange) {
|
|
4226
|
-
var
|
|
4331
|
+
var _this12 = this;
|
|
4227
4332
|
_classCallCheck(this, DOMObserver);
|
|
4228
4333
|
this.view = view;
|
|
4229
4334
|
this.handleDOMChange = handleDOMChange;
|
|
@@ -4235,28 +4340,28 @@ var DOMObserver = function () {
|
|
|
4235
4340
|
this.suppressingSelectionUpdates = false;
|
|
4236
4341
|
this.lastChangedTextNode = null;
|
|
4237
4342
|
this.observer = window.MutationObserver && new window.MutationObserver(function (mutations) {
|
|
4238
|
-
for (var i = 0; i < mutations.length; i++)
|
|
4343
|
+
for (var i = 0; i < mutations.length; i++) _this12.queue.push(mutations[i]);
|
|
4239
4344
|
if (ie && ie_version <= 11 && mutations.some(function (m) {
|
|
4240
4345
|
return m.type == "childList" && m.removedNodes.length || m.type == "characterData" && m.oldValue.length > m.target.nodeValue.length;
|
|
4241
4346
|
})) {
|
|
4242
|
-
|
|
4347
|
+
_this12.flushSoon();
|
|
4243
4348
|
} else if (safari && view.composing && mutations.some(function (m) {
|
|
4244
4349
|
return m.type == "childList" && m.target.nodeName == "TR";
|
|
4245
4350
|
})) {
|
|
4246
4351
|
view.input.badSafariComposition = true;
|
|
4247
|
-
|
|
4352
|
+
_this12.flushSoon();
|
|
4248
4353
|
} else {
|
|
4249
|
-
|
|
4354
|
+
_this12.flush();
|
|
4250
4355
|
}
|
|
4251
4356
|
});
|
|
4252
4357
|
if (useCharData) {
|
|
4253
4358
|
this.onCharData = function (e) {
|
|
4254
|
-
|
|
4359
|
+
_this12.queue.push({
|
|
4255
4360
|
target: e.target,
|
|
4256
4361
|
type: "characterData",
|
|
4257
4362
|
oldValue: e.prevValue
|
|
4258
4363
|
});
|
|
4259
|
-
|
|
4364
|
+
_this12.flushSoon();
|
|
4260
4365
|
};
|
|
4261
4366
|
}
|
|
4262
4367
|
this.onSelectionChange = this.onSelectionChange.bind(this);
|
|
@@ -4264,10 +4369,10 @@ var DOMObserver = function () {
|
|
|
4264
4369
|
_createClass(DOMObserver, [{
|
|
4265
4370
|
key: "flushSoon",
|
|
4266
4371
|
value: function flushSoon() {
|
|
4267
|
-
var
|
|
4372
|
+
var _this13 = this;
|
|
4268
4373
|
if (this.flushingSoon < 0) this.flushingSoon = window.setTimeout(function () {
|
|
4269
|
-
|
|
4270
|
-
|
|
4374
|
+
_this13.flushingSoon = -1;
|
|
4375
|
+
_this13.flush();
|
|
4271
4376
|
}, 20);
|
|
4272
4377
|
}
|
|
4273
4378
|
}, {
|
|
@@ -4292,13 +4397,13 @@ var DOMObserver = function () {
|
|
|
4292
4397
|
}, {
|
|
4293
4398
|
key: "stop",
|
|
4294
4399
|
value: function stop() {
|
|
4295
|
-
var
|
|
4400
|
+
var _this14 = this;
|
|
4296
4401
|
if (this.observer) {
|
|
4297
4402
|
var take = this.observer.takeRecords();
|
|
4298
4403
|
if (take.length) {
|
|
4299
4404
|
for (var i = 0; i < take.length; i++) this.queue.push(take[i]);
|
|
4300
4405
|
window.setTimeout(function () {
|
|
4301
|
-
return
|
|
4406
|
+
return _this14.flush();
|
|
4302
4407
|
}, 20);
|
|
4303
4408
|
}
|
|
4304
4409
|
this.observer.disconnect();
|
|
@@ -4319,10 +4424,10 @@ var DOMObserver = function () {
|
|
|
4319
4424
|
}, {
|
|
4320
4425
|
key: "suppressSelectionUpdates",
|
|
4321
4426
|
value: function suppressSelectionUpdates() {
|
|
4322
|
-
var
|
|
4427
|
+
var _this15 = this;
|
|
4323
4428
|
this.suppressingSelectionUpdates = true;
|
|
4324
4429
|
setTimeout(function () {
|
|
4325
|
-
return
|
|
4430
|
+
return _this15.suppressingSelectionUpdates = false;
|
|
4326
4431
|
}, 50);
|
|
4327
4432
|
}
|
|
4328
4433
|
}, {
|
|
@@ -4405,7 +4510,9 @@ var DOMObserver = function () {
|
|
|
4405
4510
|
}
|
|
4406
4511
|
if (added.some(function (n) {
|
|
4407
4512
|
return n.nodeName == "BR";
|
|
4408
|
-
}) && (view.input.lastKeyCode == 8 || view.input.lastKeyCode == 46)) {
|
|
4513
|
+
}) && (view.input.lastKeyCode == 8 || view.input.lastKeyCode == 46 || chrome && (view.composing || view.input.compositionEndedAt > Date.now() - 50) && mutations.some(function (m) {
|
|
4514
|
+
return m.type == "childList" && m.removedNodes.length;
|
|
4515
|
+
}))) {
|
|
4409
4516
|
var _iterator3 = _createForOfIteratorHelper(added),
|
|
4410
4517
|
_step3;
|
|
4411
4518
|
try {
|
|
@@ -4493,8 +4600,8 @@ var DOMObserver = function () {
|
|
|
4493
4600
|
var prev = mut.previousSibling,
|
|
4494
4601
|
next = mut.nextSibling;
|
|
4495
4602
|
if (ie && ie_version <= 11 && mut.addedNodes.length) {
|
|
4496
|
-
for (var
|
|
4497
|
-
var _mut$addedNodes$_i = mut.addedNodes[
|
|
4603
|
+
for (var _i16 = 0; _i16 < mut.addedNodes.length; _i16++) {
|
|
4604
|
+
var _mut$addedNodes$_i = mut.addedNodes[_i16],
|
|
4498
4605
|
previousSibling = _mut$addedNodes$_i.previousSibling,
|
|
4499
4606
|
nextSibling = _mut$addedNodes$_i.nextSibling;
|
|
4500
4607
|
if (!previousSibling || Array.prototype.indexOf.call(mut.addedNodes, previousSibling) < 0) prev = previousSibling;
|
|
@@ -4545,11 +4652,11 @@ function rangeToSelectionRange(view, range) {
|
|
|
4545
4652
|
focusOffset = range.endOffset;
|
|
4546
4653
|
var currentAnchor = view.domAtPos(view.state.selection.anchor);
|
|
4547
4654
|
if (isEquivalentPosition(currentAnchor.node, currentAnchor.offset, focusNode, focusOffset)) {
|
|
4548
|
-
var
|
|
4549
|
-
anchorNode =
|
|
4550
|
-
anchorOffset =
|
|
4551
|
-
focusNode =
|
|
4552
|
-
focusOffset =
|
|
4655
|
+
var _ref7 = [focusNode, focusOffset, anchorNode, anchorOffset];
|
|
4656
|
+
anchorNode = _ref7[0];
|
|
4657
|
+
anchorOffset = _ref7[1];
|
|
4658
|
+
focusNode = _ref7[2];
|
|
4659
|
+
focusOffset = _ref7[3];
|
|
4553
4660
|
}
|
|
4554
4661
|
return {
|
|
4555
4662
|
anchorNode: anchorNode,
|
|
@@ -4614,7 +4721,7 @@ function fixUpBadSafariComposition(view, addedNodes) {
|
|
|
4614
4721
|
_iterator5.f();
|
|
4615
4722
|
}
|
|
4616
4723
|
}
|
|
4617
|
-
function parseBetween(view, from_, to_) {
|
|
4724
|
+
function parseBetween(view, from_, to_, addedNodes) {
|
|
4618
4725
|
var _view$docView$parseRa = view.docView.parseRange(from_, to_),
|
|
4619
4726
|
parent = _view$docView$parseRa.node,
|
|
4620
4727
|
fromOffset = _view$docView$parseRa.fromOffset,
|
|
@@ -4657,7 +4764,7 @@ function parseBetween(view, from_, to_) {
|
|
|
4657
4764
|
to: toOffset,
|
|
4658
4765
|
preserveWhitespace: $from.parent.type.whitespace == "pre" ? "full" : true,
|
|
4659
4766
|
findPositions: find,
|
|
4660
|
-
ruleFromNode: ruleFromNode,
|
|
4767
|
+
ruleFromNode: ruleFromNode(addedNodes),
|
|
4661
4768
|
context: $from
|
|
4662
4769
|
});
|
|
4663
4770
|
if (find && find[0].pos != null) {
|
|
@@ -4676,29 +4783,31 @@ function parseBetween(view, from_, to_) {
|
|
|
4676
4783
|
to: to
|
|
4677
4784
|
};
|
|
4678
4785
|
}
|
|
4679
|
-
function ruleFromNode(
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
if (
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4786
|
+
var ruleFromNode = function ruleFromNode(added) {
|
|
4787
|
+
return function (dom) {
|
|
4788
|
+
var desc = dom.pmViewDesc;
|
|
4789
|
+
if (desc) {
|
|
4790
|
+
return desc.parseRule(added);
|
|
4791
|
+
} else if (dom.nodeName == "BR" && dom.parentNode) {
|
|
4792
|
+
if (safari && /^(ul|ol)$/i.test(dom.parentNode.nodeName)) {
|
|
4793
|
+
var skip = document.createElement("div");
|
|
4794
|
+
skip.appendChild(document.createElement("li"));
|
|
4795
|
+
return {
|
|
4796
|
+
skip: skip
|
|
4797
|
+
};
|
|
4798
|
+
} else if (dom.parentNode.lastChild == dom || safari && /^(tr|table)$/i.test(dom.parentNode.nodeName)) {
|
|
4799
|
+
return {
|
|
4800
|
+
ignore: true
|
|
4801
|
+
};
|
|
4802
|
+
}
|
|
4803
|
+
} else if (dom.nodeName == "IMG" && dom.getAttribute("mark-placeholder")) {
|
|
4691
4804
|
return {
|
|
4692
4805
|
ignore: true
|
|
4693
4806
|
};
|
|
4694
4807
|
}
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
};
|
|
4699
|
-
}
|
|
4700
|
-
return null;
|
|
4701
|
-
}
|
|
4808
|
+
return null;
|
|
4809
|
+
};
|
|
4810
|
+
};
|
|
4702
4811
|
var isInline = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
|
|
4703
4812
|
function readDOMChange(view, from, to, typeOver, addedNodes) {
|
|
4704
4813
|
var compositionID = view.input.compositionPendingChanges || (view.composing ? view.input.compositionID : 0);
|
|
@@ -4722,7 +4831,7 @@ function readDOMChange(view, from, to, typeOver, addedNodes) {
|
|
|
4722
4831
|
from = $before.before(shared + 1);
|
|
4723
4832
|
to = view.state.doc.resolve(to).after(shared + 1);
|
|
4724
4833
|
var sel = view.state.selection;
|
|
4725
|
-
var parse = parseBetween(view, from, to);
|
|
4834
|
+
var parse = parseBetween(view, from, to, addedNodes);
|
|
4726
4835
|
var doc = view.state.doc,
|
|
4727
4836
|
compare = doc.slice(parse.from, parse.to);
|
|
4728
4837
|
var preferredPos, preferredSide;
|
|
@@ -4860,7 +4969,7 @@ function isMarkChange(cur, prev) {
|
|
|
4860
4969
|
mark,
|
|
4861
4970
|
update;
|
|
4862
4971
|
for (var i = 0; i < prevMarks.length; i++) added = prevMarks[i].removeFromSet(added);
|
|
4863
|
-
for (var
|
|
4972
|
+
for (var _i17 = 0; _i17 < curMarks.length; _i17++) removed = curMarks[_i17].removeFromSet(removed);
|
|
4864
4973
|
if (added.length == 1 && removed.length == 0) {
|
|
4865
4974
|
mark = added[0];
|
|
4866
4975
|
type = "add";
|
|
@@ -4877,7 +4986,7 @@ function isMarkChange(cur, prev) {
|
|
|
4877
4986
|
return null;
|
|
4878
4987
|
}
|
|
4879
4988
|
var updated = [];
|
|
4880
|
-
for (var
|
|
4989
|
+
for (var _i18 = 0; _i18 < prev.childCount; _i18++) updated.push(update(prev.child(_i18)));
|
|
4881
4990
|
if (prosemirrorModel.Fragment.from(updated).eq(cur)) return {
|
|
4882
4991
|
mark: mark,
|
|
4883
4992
|
type: type
|
|
@@ -4913,25 +5022,25 @@ function skipClosingAndOpening($pos, fromEnd, mayOpen) {
|
|
|
4913
5022
|
return end;
|
|
4914
5023
|
}
|
|
4915
5024
|
function findDiff(a, b, pos, preferredPos, preferredSide) {
|
|
4916
|
-
var start = a.findDiffStart(b, pos)
|
|
5025
|
+
var start = a.findDiffStart(b, pos),
|
|
5026
|
+
lenA = pos + a.size,
|
|
5027
|
+
lenB = pos + b.size;
|
|
4917
5028
|
if (start == null) return null;
|
|
4918
|
-
var _a$findDiffEnd = a.findDiffEnd(b,
|
|
5029
|
+
var _a$findDiffEnd = a.findDiffEnd(b, lenA, lenB),
|
|
4919
5030
|
endA = _a$findDiffEnd.a,
|
|
4920
5031
|
endB = _a$findDiffEnd.b;
|
|
4921
5032
|
if (preferredSide == "end") {
|
|
4922
5033
|
var adjust = Math.max(0, start - Math.min(endA, endB));
|
|
4923
5034
|
preferredPos -= endA + adjust - start;
|
|
4924
5035
|
}
|
|
4925
|
-
if (endA < start &&
|
|
5036
|
+
if (endA < start && lenA < lenB) {
|
|
4926
5037
|
var move = preferredPos <= start && preferredPos >= endA ? start - preferredPos : 0;
|
|
4927
5038
|
start -= move;
|
|
4928
|
-
if (start && start < b.size && isSurrogatePair(b.textBetween(start - 1, start + 1))) start += move ? 1 : -1;
|
|
4929
5039
|
endB = start + (endB - endA);
|
|
4930
5040
|
endA = start;
|
|
4931
5041
|
} else if (endB < start) {
|
|
4932
5042
|
var _move = preferredPos <= start && preferredPos >= endB ? start - preferredPos : 0;
|
|
4933
5043
|
start -= _move;
|
|
4934
|
-
if (start && start < a.size && isSurrogatePair(a.textBetween(start - 1, start + 1))) start += _move ? 1 : -1;
|
|
4935
5044
|
endA = start + (endA - endB);
|
|
4936
5045
|
endB = start;
|
|
4937
5046
|
}
|
|
@@ -4941,17 +5050,11 @@ function findDiff(a, b, pos, preferredPos, preferredSide) {
|
|
|
4941
5050
|
endB: endB
|
|
4942
5051
|
};
|
|
4943
5052
|
}
|
|
4944
|
-
function isSurrogatePair(str) {
|
|
4945
|
-
if (str.length != 2) return false;
|
|
4946
|
-
var a = str.charCodeAt(0),
|
|
4947
|
-
b = str.charCodeAt(1);
|
|
4948
|
-
return a >= 0xDC00 && a <= 0xDFFF && b >= 0xD800 && b <= 0xDBFF;
|
|
4949
|
-
}
|
|
4950
5053
|
var __parseFromClipboard = parseFromClipboard;
|
|
4951
5054
|
var __endComposition = endComposition;
|
|
4952
5055
|
var EditorView = function () {
|
|
4953
5056
|
function EditorView(place, props) {
|
|
4954
|
-
var
|
|
5057
|
+
var _this16 = this;
|
|
4955
5058
|
_classCallCheck(this, EditorView);
|
|
4956
5059
|
this._root = null;
|
|
4957
5060
|
this.focused = false;
|
|
@@ -4979,7 +5082,7 @@ var EditorView = function () {
|
|
|
4979
5082
|
this.nodeViews = buildNodeViews(this);
|
|
4980
5083
|
this.docView = docViewDesc(this.state.doc, computeDocDeco(this), viewDecorations(this), this.dom, this);
|
|
4981
5084
|
this.domObserver = new DOMObserver(this, function (from, to, typeOver, added) {
|
|
4982
|
-
return readDOMChange(
|
|
5085
|
+
return readDOMChange(_this16, from, to, typeOver, added);
|
|
4983
5086
|
});
|
|
4984
5087
|
this.domObserver.start();
|
|
4985
5088
|
initInput(this);
|
|
@@ -5071,7 +5174,8 @@ var EditorView = function () {
|
|
|
5071
5174
|
}
|
|
5072
5175
|
if (chromeKludge && (!this.trackWrites || !this.dom.contains(this.trackWrites))) forceSelUpdate = true;
|
|
5073
5176
|
}
|
|
5074
|
-
|
|
5177
|
+
var mouseDown = this.input.mouseDown;
|
|
5178
|
+
if (forceSelUpdate || !(mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && anchorInRightPlace(this) && mouseDown.delaySelUpdate())) {
|
|
5075
5179
|
selectionToDOM(this, forceSelUpdate);
|
|
5076
5180
|
} else {
|
|
5077
5181
|
syncNodeSelection(this, state.selection);
|
|
@@ -5092,10 +5196,10 @@ var EditorView = function () {
|
|
|
5092
5196
|
}, {
|
|
5093
5197
|
key: "scrollToSelection",
|
|
5094
5198
|
value: function scrollToSelection() {
|
|
5095
|
-
var
|
|
5199
|
+
var _this17 = this;
|
|
5096
5200
|
var startDOM = this.domSelectionRange().focusNode;
|
|
5097
5201
|
if (!startDOM || !this.dom.contains(startDOM.nodeType == 1 ? startDOM : startDOM.parentNode)) ;else if (this.someProp("handleScrollToSelection", function (f) {
|
|
5098
|
-
return f(
|
|
5202
|
+
return f(_this17);
|
|
5099
5203
|
})) ;else if (this.state.selection instanceof prosemirrorState.NodeSelection) {
|
|
5100
5204
|
var target = this.docView.domAfterPos(this.state.selection.from);
|
|
5101
5205
|
if (target.nodeType == 1) scrollRectIntoView(this, target.getBoundingClientRect(), startDOM);
|
|
@@ -5119,13 +5223,13 @@ var EditorView = function () {
|
|
|
5119
5223
|
var plugin = this.directPlugins[i];
|
|
5120
5224
|
if (plugin.spec.view) this.pluginViews.push(plugin.spec.view(this));
|
|
5121
5225
|
}
|
|
5122
|
-
for (var
|
|
5123
|
-
var _plugin = this.state.plugins[
|
|
5226
|
+
for (var _i19 = 0; _i19 < this.state.plugins.length; _i19++) {
|
|
5227
|
+
var _plugin = this.state.plugins[_i19];
|
|
5124
5228
|
if (_plugin.spec.view) this.pluginViews.push(_plugin.spec.view(this));
|
|
5125
5229
|
}
|
|
5126
5230
|
} else {
|
|
5127
|
-
for (var
|
|
5128
|
-
var pluginView = this.pluginViews[
|
|
5231
|
+
for (var _i20 = 0; _i20 < this.pluginViews.length; _i20++) {
|
|
5232
|
+
var pluginView = this.pluginViews[_i20];
|
|
5129
5233
|
if (pluginView.update) pluginView.update(this, prevState);
|
|
5130
5234
|
}
|
|
5131
5235
|
}
|
|
@@ -5155,8 +5259,8 @@ var EditorView = function () {
|
|
|
5155
5259
|
if (_prop != null && (value = f ? f(_prop) : _prop)) return value;
|
|
5156
5260
|
}
|
|
5157
5261
|
var plugins = this.state.plugins;
|
|
5158
|
-
if (plugins) for (var
|
|
5159
|
-
var _prop2 = plugins[
|
|
5262
|
+
if (plugins) for (var _i21 = 0; _i21 < plugins.length; _i21++) {
|
|
5263
|
+
var _prop2 = plugins[_i21].props[propName];
|
|
5160
5264
|
if (_prop2 != null && (value = f ? f(_prop2) : _prop2)) return value;
|
|
5161
5265
|
}
|
|
5162
5266
|
}
|
|
@@ -5186,7 +5290,7 @@ var EditorView = function () {
|
|
|
5186
5290
|
}, {
|
|
5187
5291
|
key: "root",
|
|
5188
5292
|
get: function get() {
|
|
5189
|
-
var
|
|
5293
|
+
var _this18 = this;
|
|
5190
5294
|
var cached = this._root;
|
|
5191
5295
|
if (cached == null) {
|
|
5192
5296
|
var _loop5 = function _loop5(search) {
|
|
@@ -5195,7 +5299,7 @@ var EditorView = function () {
|
|
|
5195
5299
|
return search.ownerDocument.getSelection();
|
|
5196
5300
|
};
|
|
5197
5301
|
return {
|
|
5198
|
-
v:
|
|
5302
|
+
v: _this18._root = search
|
|
5199
5303
|
};
|
|
5200
5304
|
}
|
|
5201
5305
|
},
|