@atlaskit/editor-core 187.17.5 → 187.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/labs/next/presets/default.js +2 -2
- package/dist/cjs/plugins/annotation/toolbar.js +31 -8
- package/dist/cjs/plugins/base/pm-plugins/inline-cursor-target.js +7 -41
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +0 -3
- package/dist/cjs/plugins/selection/pm-plugins/gap-cursor-main.js +27 -13
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/labs/next/presets/default.js +1 -1
- package/dist/es2019/plugins/annotation/toolbar.js +34 -9
- package/dist/es2019/plugins/base/pm-plugins/inline-cursor-target.js +9 -41
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +0 -3
- package/dist/es2019/plugins/selection/pm-plugins/gap-cursor-main.js +27 -13
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/labs/next/presets/default.js +1 -1
- package/dist/esm/plugins/annotation/toolbar.js +30 -7
- package/dist/esm/plugins/base/pm-plugins/inline-cursor-target.js +7 -41
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +0 -3
- package/dist/esm/plugins/selection/pm-plugins/gap-cursor-main.js +27 -13
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/extensibility.d.ts +0 -2
- package/dist/types/index.d.ts +0 -5
- package/dist/types/labs/next/presets/default.d.ts +28 -30
- package/dist/types/plugins/analytics/index.d.ts +0 -2
- package/dist/types/plugins/annotation/pm-plugins/plugin-factory.d.ts +0 -2
- package/dist/types/plugins/annotation/types.d.ts +9 -3
- package/dist/types/plugins/annotation/utils.d.ts +2 -5
- package/dist/types/plugins/base/pm-plugins/context-identifier.d.ts +1 -1
- package/dist/types/plugins/block-type/commands/block-type.d.ts +0 -2
- package/dist/types/plugins/block-type/pm-plugins/main.d.ts +6 -1
- package/dist/types/plugins/code-bidi-warning/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/code-bidi-warning/pm-plugins/plugin-factory.d.ts +0 -2
- package/dist/types/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.d.ts +5 -1
- package/dist/types/plugins/code-block/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/code-block/utils.d.ts +1 -1
- package/dist/types/plugins/collab-edit/utils.d.ts +1 -5
- package/dist/types/plugins/copy-button/pm-plugins/main.d.ts +10 -1
- package/dist/types/plugins/copy-button/toolbar.d.ts +0 -2
- package/dist/types/plugins/copy-button/utils.d.ts +1 -1
- package/dist/types/plugins/custom-autoformat/index.d.ts +2 -1
- package/dist/types/plugins/date/pm-plugins/main.d.ts +0 -2
- package/dist/types/plugins/expand/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/expand/pm-plugins/plugin-factory.d.ts +0 -2
- package/dist/types/plugins/extension/plugin-factory.d.ts +0 -2
- package/dist/types/plugins/extension/utils.d.ts +1 -1
- package/dist/types/plugins/find-replace/plugin.d.ts +0 -2
- package/dist/types/plugins/find-replace/utils/index.d.ts +1 -4
- package/dist/types/plugins/floating-toolbar/pm-plugins/force-focus/index.d.ts +3 -1
- package/dist/types/plugins/floating-toolbar/pm-plugins/toolbar-data/plugin-factory.d.ts +0 -2
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/list/pm-plugins/input-rules/wrapping-join-rule.d.ts +1 -2
- package/dist/types/plugins/media/commands/helpers.d.ts +1 -1
- package/dist/types/plugins/media/pm-plugins/alt-text/index.d.ts +1 -3
- package/dist/types/plugins/media/pm-plugins/linking/index.d.ts +0 -2
- package/dist/types/plugins/media/toolbar/utils.d.ts +1 -3
- package/dist/types/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +0 -1
- package/dist/types/plugins/media/ui/ResizableMediaSingle/index.d.ts +0 -1
- package/dist/types/plugins/mobile-dimensions/plugin-factory.d.ts +0 -2
- package/dist/types/plugins/panel/utils.d.ts +1 -1
- package/dist/types/plugins/paste/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/paste/pm-plugins/plugin-factory.d.ts +0 -2
- package/dist/types/plugins/paste/util/index.d.ts +1 -1
- package/dist/types/plugins/selection/plugin-factory.d.ts +0 -2
- package/dist/types/plugins/selection/pm-plugins/gap-cursor-main.d.ts +1 -1
- package/dist/types/plugins/selection/pm-plugins/selection-main.d.ts +1 -1
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/helpers.d.ts +1 -2
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/utils/action.d.ts +1 -60
- package/dist/types/utils/list-commands.d.ts +0 -1
- package/dist/types-ts4.5/extensibility.d.ts +0 -2
- package/dist/types-ts4.5/index.d.ts +0 -5
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +28 -30
- package/dist/types-ts4.5/plugins/analytics/index.d.ts +0 -2
- package/dist/types-ts4.5/plugins/annotation/pm-plugins/plugin-factory.d.ts +0 -2
- package/dist/types-ts4.5/plugins/annotation/types.d.ts +9 -3
- package/dist/types-ts4.5/plugins/annotation/utils.d.ts +2 -5
- package/dist/types-ts4.5/plugins/base/pm-plugins/context-identifier.d.ts +1 -1
- package/dist/types-ts4.5/plugins/block-type/commands/block-type.d.ts +0 -2
- package/dist/types-ts4.5/plugins/block-type/pm-plugins/main.d.ts +6 -1
- package/dist/types-ts4.5/plugins/code-bidi-warning/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/plugins/code-bidi-warning/pm-plugins/plugin-factory.d.ts +0 -2
- package/dist/types-ts4.5/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.d.ts +8 -1
- package/dist/types-ts4.5/plugins/code-block/pm-plugins/main.d.ts +2 -1
- package/dist/types-ts4.5/plugins/code-block/utils.d.ts +1 -1
- package/dist/types-ts4.5/plugins/collab-edit/utils.d.ts +1 -5
- package/dist/types-ts4.5/plugins/copy-button/pm-plugins/main.d.ts +10 -1
- package/dist/types-ts4.5/plugins/copy-button/toolbar.d.ts +0 -2
- package/dist/types-ts4.5/plugins/copy-button/utils.d.ts +1 -1
- package/dist/types-ts4.5/plugins/custom-autoformat/index.d.ts +2 -1
- package/dist/types-ts4.5/plugins/date/pm-plugins/main.d.ts +0 -2
- package/dist/types-ts4.5/plugins/expand/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/plugins/expand/pm-plugins/plugin-factory.d.ts +0 -2
- package/dist/types-ts4.5/plugins/extension/plugin-factory.d.ts +0 -2
- package/dist/types-ts4.5/plugins/extension/utils.d.ts +1 -1
- package/dist/types-ts4.5/plugins/find-replace/plugin.d.ts +0 -2
- package/dist/types-ts4.5/plugins/find-replace/utils/index.d.ts +1 -4
- package/dist/types-ts4.5/plugins/floating-toolbar/pm-plugins/force-focus/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/floating-toolbar/pm-plugins/toolbar-data/plugin-factory.d.ts +0 -2
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/list/pm-plugins/input-rules/wrapping-join-rule.d.ts +1 -2
- package/dist/types-ts4.5/plugins/media/commands/helpers.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/pm-plugins/alt-text/index.d.ts +1 -3
- package/dist/types-ts4.5/plugins/media/pm-plugins/linking/index.d.ts +0 -2
- package/dist/types-ts4.5/plugins/media/toolbar/utils.d.ts +1 -3
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +0 -1
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/mobile-dimensions/plugin-factory.d.ts +0 -2
- package/dist/types-ts4.5/plugins/panel/utils.d.ts +1 -1
- package/dist/types-ts4.5/plugins/paste/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/plugins/paste/pm-plugins/plugin-factory.d.ts +0 -2
- package/dist/types-ts4.5/plugins/paste/util/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/selection/plugin-factory.d.ts +0 -2
- package/dist/types-ts4.5/plugins/selection/pm-plugins/gap-cursor-main.d.ts +1 -1
- package/dist/types-ts4.5/plugins/selection/pm-plugins/selection-main.d.ts +1 -1
- package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/helpers.d.ts +1 -2
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types-ts4.5/utils/action.d.ts +1 -60
- package/dist/types-ts4.5/utils/list-commands.d.ts +0 -1
- package/package.json +5 -4
- package/report.api.md +1 -24
- package/tmp/api-report-tmp.d.ts +1 -21
- package/dist/cjs/plugins/text-formatting/actions.js +0 -188
- package/dist/cjs/plugins/text-formatting/commands/clear-formatting.js +0 -111
- package/dist/cjs/plugins/text-formatting/commands/text-formatting.js +0 -143
- package/dist/cjs/plugins/text-formatting/commands/transform-to-code.js +0 -68
- package/dist/cjs/plugins/text-formatting/index.js +0 -136
- package/dist/cjs/plugins/text-formatting/pm-plugins/clear-formatting-keymap.js +0 -21
- package/dist/cjs/plugins/text-formatting/pm-plugins/clear-formatting.js +0 -36
- package/dist/cjs/plugins/text-formatting/pm-plugins/cursor.js +0 -55
- package/dist/cjs/plugins/text-formatting/pm-plugins/input-rule.js +0 -276
- package/dist/cjs/plugins/text-formatting/pm-plugins/keymap.js +0 -52
- package/dist/cjs/plugins/text-formatting/pm-plugins/main.js +0 -113
- package/dist/cjs/plugins/text-formatting/pm-plugins/plugin-key.js +0 -9
- package/dist/cjs/plugins/text-formatting/pm-plugins/smart-input-rule.js +0 -176
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/constants.js +0 -19
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +0 -86
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +0 -53
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +0 -225
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/menu-state.js +0 -23
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/responsive-toolbar-buttons.js +0 -60
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +0 -201
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/more-button.js +0 -40
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +0 -46
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/types.js +0 -17
- package/dist/cjs/plugins/text-formatting/utils/cell-selection.js +0 -12
- package/dist/cjs/plugins/text-formatting/utils.js +0 -86
- package/dist/es2019/plugins/text-formatting/actions.js +0 -161
- package/dist/es2019/plugins/text-formatting/commands/clear-formatting.js +0 -105
- package/dist/es2019/plugins/text-formatting/commands/text-formatting.js +0 -144
- package/dist/es2019/plugins/text-formatting/commands/transform-to-code.js +0 -71
- package/dist/es2019/plugins/text-formatting/index.js +0 -127
- package/dist/es2019/plugins/text-formatting/pm-plugins/clear-formatting-keymap.js +0 -10
- package/dist/es2019/plugins/text-formatting/pm-plugins/clear-formatting.js +0 -26
- package/dist/es2019/plugins/text-formatting/pm-plugins/cursor.js +0 -52
- package/dist/es2019/plugins/text-formatting/pm-plugins/input-rule.js +0 -244
- package/dist/es2019/plugins/text-formatting/pm-plugins/keymap.js +0 -43
- package/dist/es2019/plugins/text-formatting/pm-plugins/main.js +0 -109
- package/dist/es2019/plugins/text-formatting/pm-plugins/plugin-key.js +0 -2
- package/dist/es2019/plugins/text-formatting/pm-plugins/smart-input-rule.js +0 -155
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/constants.js +0 -20
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +0 -66
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +0 -42
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +0 -210
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/menu-state.js +0 -11
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/responsive-toolbar-buttons.js +0 -48
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +0 -168
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/more-button.js +0 -32
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +0 -36
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/types.js +0 -10
- package/dist/es2019/plugins/text-formatting/utils/cell-selection.js +0 -5
- package/dist/es2019/plugins/text-formatting/utils.js +0 -74
- package/dist/esm/plugins/text-formatting/actions.js +0 -168
- package/dist/esm/plugins/text-formatting/commands/clear-formatting.js +0 -101
- package/dist/esm/plugins/text-formatting/commands/text-formatting.js +0 -134
- package/dist/esm/plugins/text-formatting/commands/transform-to-code.js +0 -61
- package/dist/esm/plugins/text-formatting/index.js +0 -128
- package/dist/esm/plugins/text-formatting/pm-plugins/clear-formatting-keymap.js +0 -10
- package/dist/esm/plugins/text-formatting/pm-plugins/clear-formatting.js +0 -28
- package/dist/esm/plugins/text-formatting/pm-plugins/cursor.js +0 -48
- package/dist/esm/plugins/text-formatting/pm-plugins/input-rule.js +0 -259
- package/dist/esm/plugins/text-formatting/pm-plugins/keymap.js +0 -43
- package/dist/esm/plugins/text-formatting/pm-plugins/main.js +0 -98
- package/dist/esm/plugins/text-formatting/pm-plugins/plugin-key.js +0 -2
- package/dist/esm/plugins/text-formatting/pm-plugins/smart-input-rule.js +0 -169
- package/dist/esm/plugins/text-formatting/ui/Toolbar/constants.js +0 -8
- package/dist/esm/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +0 -75
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +0 -45
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +0 -213
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/menu-state.js +0 -15
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/responsive-toolbar-buttons.js +0 -50
- package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +0 -191
- package/dist/esm/plugins/text-formatting/ui/Toolbar/more-button.js +0 -31
- package/dist/esm/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +0 -35
- package/dist/esm/plugins/text-formatting/ui/Toolbar/types.js +0 -10
- package/dist/esm/plugins/text-formatting/utils/cell-selection.js +0 -5
- package/dist/esm/plugins/text-formatting/utils.js +0 -75
- package/dist/types/plugins/text-formatting/actions.d.ts +0 -22
- package/dist/types/plugins/text-formatting/commands/clear-formatting.d.ts +0 -6
- package/dist/types/plugins/text-formatting/commands/text-formatting.d.ts +0 -5
- package/dist/types/plugins/text-formatting/commands/transform-to-code.d.ts +0 -2
- package/dist/types/plugins/text-formatting/index.d.ts +0 -17
- package/dist/types/plugins/text-formatting/pm-plugins/clear-formatting-keymap.d.ts +0 -4
- package/dist/types/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +0 -8
- package/dist/types/plugins/text-formatting/pm-plugins/cursor.d.ts +0 -3
- package/dist/types/plugins/text-formatting/pm-plugins/input-rule.d.ts +0 -24
- package/dist/types/plugins/text-formatting/pm-plugins/keymap.d.ts +0 -4
- package/dist/types/plugins/text-formatting/pm-plugins/main.d.ts +0 -7
- package/dist/types/plugins/text-formatting/pm-plugins/plugin-key.d.ts +0 -3
- package/dist/types/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +0 -3
- package/dist/types/plugins/text-formatting/ui/Toolbar/constants.d.ts +0 -6
- package/dist/types/plugins/text-formatting/ui/Toolbar/dropdown-menu.d.ts +0 -15
- package/dist/types/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.d.ts +0 -7
- package/dist/types/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.d.ts +0 -14
- package/dist/types/plugins/text-formatting/ui/Toolbar/hooks/menu-state.d.ts +0 -1
- package/dist/types/plugins/text-formatting/ui/Toolbar/hooks/responsive-toolbar-buttons.d.ts +0 -20
- package/dist/types/plugins/text-formatting/ui/Toolbar/index.d.ts +0 -26
- package/dist/types/plugins/text-formatting/ui/Toolbar/more-button.d.ts +0 -13
- package/dist/types/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.d.ts +0 -9
- package/dist/types/plugins/text-formatting/ui/Toolbar/types.d.ts +0 -32
- package/dist/types/plugins/text-formatting/utils/cell-selection.d.ts +0 -3
- package/dist/types/plugins/text-formatting/utils.d.ts +0 -11
- package/dist/types-ts4.5/plugins/text-formatting/actions.d.ts +0 -22
- package/dist/types-ts4.5/plugins/text-formatting/commands/clear-formatting.d.ts +0 -6
- package/dist/types-ts4.5/plugins/text-formatting/commands/text-formatting.d.ts +0 -5
- package/dist/types-ts4.5/plugins/text-formatting/commands/transform-to-code.d.ts +0 -2
- package/dist/types-ts4.5/plugins/text-formatting/index.d.ts +0 -19
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/clear-formatting-keymap.d.ts +0 -4
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +0 -8
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/cursor.d.ts +0 -3
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/input-rule.d.ts +0 -24
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/keymap.d.ts +0 -4
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/main.d.ts +0 -7
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/plugin-key.d.ts +0 -3
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +0 -3
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/constants.d.ts +0 -6
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/dropdown-menu.d.ts +0 -15
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.d.ts +0 -7
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.d.ts +0 -14
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/hooks/menu-state.d.ts +0 -5
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/hooks/responsive-toolbar-buttons.d.ts +0 -20
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/index.d.ts +0 -26
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/more-button.d.ts +0 -13
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.d.ts +0 -9
- package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/types.d.ts +0 -32
- package/dist/types-ts4.5/plugins/text-formatting/utils/cell-selection.d.ts +0 -3
- package/dist/types-ts4.5/plugins/text-formatting/utils.d.ts +0 -11
|
@@ -42,24 +42,18 @@ export default (function () {
|
|
|
42
42
|
node.setAttribute('aria-hidden', 'true');
|
|
43
43
|
node.appendChild(document.createTextNode(ZERO_WIDTH_SPACE));
|
|
44
44
|
node.className = 'cursor-target';
|
|
45
|
-
|
|
45
|
+
var $from = selection.$from;
|
|
46
|
+
var rightPosition = $from.pos;
|
|
47
|
+
var leftPosition = $from.posAtIndex(Math.max($from.index() - 1, 0));
|
|
48
|
+
var widgetPos = side === 'left' ? leftPosition : rightPosition;
|
|
49
|
+
return Decoration.widget(widgetPos, node, {
|
|
46
50
|
raw: true,
|
|
47
|
-
side: side === 'left' ? -1 : 1,
|
|
48
51
|
key: 'inlineCursor'
|
|
49
52
|
});
|
|
50
53
|
};
|
|
51
54
|
|
|
52
|
-
// Create editable decoration widgets
|
|
53
|
-
|
|
54
|
-
// We check beforeInput events below to prevent content
|
|
55
|
-
// being added to the decorations.
|
|
56
|
-
//
|
|
57
|
-
// This prevents issues with the cursor disappearing
|
|
58
|
-
// or appearing in the wrong place when;
|
|
59
|
-
// - positioned between inline nodes (chrome + firefox)
|
|
60
|
-
// - positioned between the beginning of another node and an inline node (firefox)
|
|
61
|
-
// - positioned between an inline node and the end of a node (chrome)
|
|
62
|
-
if (!browser.safari && (hasInlineNodeViewAfter || isAtEndAndInlineNodeViewBefore) && (hasInlineNodeViewBefore || isAtStartAndInlineNodeViewAfter)) {
|
|
55
|
+
// Create editable decoration widgets around the current inline node to allow proper cursor navigation.
|
|
56
|
+
if ((hasInlineNodeViewAfter || isAtEndAndInlineNodeViewBefore) && (hasInlineNodeViewBefore || isAtStartAndInlineNodeViewAfter)) {
|
|
63
57
|
return {
|
|
64
58
|
cursorTarget: {
|
|
65
59
|
decorations: [createWidget('left'), createWidget('right')],
|
|
@@ -70,34 +64,6 @@ export default (function () {
|
|
|
70
64
|
}
|
|
71
65
|
};
|
|
72
66
|
}
|
|
73
|
-
|
|
74
|
-
// Only create one widget on the left or right of the cursor in Safari.
|
|
75
|
-
// This is to prevent the left key from being blocked when at the start of a paragraph,
|
|
76
|
-
// and the right key from being blocked when at the end of a paragraph. This also
|
|
77
|
-
// improves click and drag selections, making it easier to select the first node.
|
|
78
|
-
if (browser.safari) {
|
|
79
|
-
if (isAtEndAndInlineNodeViewBefore || hasInlineNodeViewBefore && hasInlineNodeViewAfter) {
|
|
80
|
-
return {
|
|
81
|
-
cursorTarget: {
|
|
82
|
-
decorations: [createWidget('left')],
|
|
83
|
-
positions: {
|
|
84
|
-
from: $from.pos,
|
|
85
|
-
to: $to.pos
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
} else if (isAtStartAndInlineNodeViewAfter) {
|
|
90
|
-
return {
|
|
91
|
-
cursorTarget: {
|
|
92
|
-
decorations: [createWidget('right')],
|
|
93
|
-
positions: {
|
|
94
|
-
from: $from.pos,
|
|
95
|
-
to: $to.pos
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
67
|
}
|
|
102
68
|
return {
|
|
103
69
|
cursorTarget: undefined
|
|
@@ -30,7 +30,6 @@ export { default as saveOnEnterPlugin } from './save-on-enter';
|
|
|
30
30
|
export { default as submitEditorPlugin } from './submit-editor';
|
|
31
31
|
export { default as tasksAndDecisionsPlugin } from './tasks-and-decisions';
|
|
32
32
|
export { default as textColorPlugin } from './text-color';
|
|
33
|
-
export { default as textFormattingPlugin } from './text-formatting';
|
|
34
33
|
export { default as typeAheadPlugin } from './type-ahead';
|
|
35
34
|
export { default as unsupportedContentPlugin } from './unsupported-content';
|
|
36
35
|
export { default as floatingToolbarPlugin } from './floating-toolbar';
|
|
@@ -8,9 +8,6 @@ var serializePlaceholderNode = function serializePlaceholderNode(node) {
|
|
|
8
8
|
|
|
9
9
|
// the inline node api test suite requires the following class name
|
|
10
10
|
element.classList.add('placeholderView-content-wrap');
|
|
11
|
-
if (browser.gecko) {
|
|
12
|
-
element.setAttribute('contenteditable', 'true');
|
|
13
|
-
}
|
|
14
11
|
element.innerText = ZERO_WIDTH_SPACE;
|
|
15
12
|
var elementChildren = document.createElement('span');
|
|
16
13
|
elementChildren.classList.add('pm-placeholder__text');
|
|
@@ -88,24 +88,38 @@ var plugin = new SafePlugin({
|
|
|
88
88
|
}
|
|
89
89
|
return null;
|
|
90
90
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
// top level nodes are handled by <ClickAreaBlock>
|
|
94
|
-
handleClick: function handleClick(view, position, event) {
|
|
91
|
+
handleClick: function handleClick(view, nodePos, event) {
|
|
92
|
+
var _$pos$parent;
|
|
95
93
|
var posAtCoords = view.posAtCoords({
|
|
96
94
|
left: event.clientX,
|
|
97
95
|
top: event.clientY
|
|
98
96
|
});
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if (posAtCoords && posAtCoords.inside !== position && !isIgnoredClick(event.target)) {
|
|
102
|
-
// max available space between parent and child from the left side in px
|
|
103
|
-
// this ensures the correct side of the gap cursor in case of clicking in between two block nodes
|
|
104
|
-
var leftSideOffsetX = 20;
|
|
105
|
-
var side = event.offsetX > leftSideOffsetX ? Side.RIGHT : Side.LEFT;
|
|
106
|
-
return setGapCursorAtPos(position, side)(view.state, view.dispatch);
|
|
97
|
+
if (!posAtCoords || isIgnoredClick(event.target)) {
|
|
98
|
+
return false;
|
|
107
99
|
}
|
|
108
|
-
|
|
100
|
+
var isInsideTheTarget = posAtCoords.pos === posAtCoords.inside;
|
|
101
|
+
if (isInsideTheTarget) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
var leftSideOffsetX = 20;
|
|
105
|
+
var side = event.offsetX > leftSideOffsetX ? Side.RIGHT : Side.LEFT;
|
|
106
|
+
var $pos = view.state.doc.resolve(nodePos);
|
|
107
|
+
// In the new prosemirror-view posAtCoords is not returning a precise value for our media nodes
|
|
108
|
+
if (((_$pos$parent = $pos.parent) === null || _$pos$parent === void 0 ? void 0 : _$pos$parent.type.name) === 'mediaSingle') {
|
|
109
|
+
var $insidePos = view.state.doc.resolve(Math.max(posAtCoords.inside, 0));
|
|
110
|
+
// We don't have GapCursors problems when the node target is inside the root level
|
|
111
|
+
if ($insidePos.depth <= 1) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
var mediaGapCursor = !$pos.nodeBefore ? $pos.before() : $pos.after();
|
|
115
|
+
return setGapCursorAtPos(mediaGapCursor, side)(view.state, view.dispatch);
|
|
116
|
+
}
|
|
117
|
+
var docSize = view.state.doc.content.size;
|
|
118
|
+
var nodeInside = posAtCoords.inside <= 0 || posAtCoords.inside > docSize ? null : view.state.doc.nodeAt(posAtCoords.inside);
|
|
119
|
+
if (nodeInside !== null && nodeInside !== void 0 && nodeInside.isAtom) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
return setGapCursorAtPos(nodePos, side)(view.state, view.dispatch);
|
|
109
123
|
},
|
|
110
124
|
handleDOMEvents: {
|
|
111
125
|
/**
|
package/dist/esm/version.json
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference path="../../../../../typings/prosemirror.d.ts" />
|
|
2
|
-
/// <reference path="../../../../../typings/prosemirror-state.d.ts" />
|
|
3
1
|
export { getChangedNodes } from './utils/document';
|
|
4
2
|
export { validateNodes } from './utils/nodes';
|
|
5
3
|
export { toJSON } from './utils';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -77,8 +77,3 @@ export { DEFAULT_BORDER_COLOR } from './ui/ColorPalette/Palettes/common';
|
|
|
77
77
|
export { default as messages, statusMessages, dateMessages } from './messages';
|
|
78
78
|
export { createTypeAheadTools } from './plugins/type-ahead/api';
|
|
79
79
|
export { createQuickInsertTools } from './plugins/quick-insert/api';
|
|
80
|
-
export type {
|
|
81
|
-
/**
|
|
82
|
-
* Temporary, until we extract the plugin to its own package
|
|
83
|
-
* @deprecated Don't use this
|
|
84
|
-
*/ textFormattingPlugin, } from './plugins';
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference path="../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
-
/// <reference path="../../../../../../../../typings/prosemirror-state.d.ts" />
|
|
3
1
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
2
|
import type { PastePluginOptions } from '../../../plugins/paste';
|
|
5
3
|
import type { BasePluginOptions } from '../../../plugins/base';
|
|
@@ -257,13 +255,13 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
257
255
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
258
256
|
}>>];
|
|
259
257
|
actions: {
|
|
260
|
-
toggleSuperscript: import("
|
|
261
|
-
toggleSubscript: import("
|
|
262
|
-
toggleStrike: import("
|
|
263
|
-
toggleCode: import("
|
|
264
|
-
toggleUnderline: import("
|
|
265
|
-
toggleEm: import("
|
|
266
|
-
toggleStrong: import("
|
|
258
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
259
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
260
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
261
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
262
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
263
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
264
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
267
265
|
};
|
|
268
266
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"textFormatting", {
|
|
269
267
|
pluginConfiguration: TextFormattingOptions | undefined;
|
|
@@ -297,13 +295,13 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
297
295
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
298
296
|
}>>];
|
|
299
297
|
actions: {
|
|
300
|
-
toggleSuperscript: import("
|
|
301
|
-
toggleSubscript: import("
|
|
302
|
-
toggleStrike: import("
|
|
303
|
-
toggleCode: import("
|
|
304
|
-
toggleUnderline: import("
|
|
305
|
-
toggleEm: import("
|
|
306
|
-
toggleStrong: import("
|
|
298
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
299
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
300
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
301
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
302
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
303
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
304
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
307
305
|
};
|
|
308
306
|
}>, (config?: HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
|
|
309
307
|
pluginConfiguration: HyperlinkPluginOptions | undefined;
|
|
@@ -620,13 +618,13 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
620
618
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
621
619
|
}>>];
|
|
622
620
|
actions: {
|
|
623
|
-
toggleSuperscript: import("
|
|
624
|
-
toggleSubscript: import("
|
|
625
|
-
toggleStrike: import("
|
|
626
|
-
toggleCode: import("
|
|
627
|
-
toggleUnderline: import("
|
|
628
|
-
toggleEm: import("
|
|
629
|
-
toggleStrong: import("
|
|
621
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
622
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
623
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
624
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
625
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
626
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
627
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
630
628
|
};
|
|
631
629
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"textFormatting", {
|
|
632
630
|
pluginConfiguration: TextFormattingOptions | undefined;
|
|
@@ -660,13 +658,13 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
660
658
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
661
659
|
}>>];
|
|
662
660
|
actions: {
|
|
663
|
-
toggleSuperscript: import("
|
|
664
|
-
toggleSubscript: import("
|
|
665
|
-
toggleStrike: import("
|
|
666
|
-
toggleCode: import("
|
|
667
|
-
toggleUnderline: import("
|
|
668
|
-
toggleEm: import("
|
|
669
|
-
toggleStrong: import("
|
|
661
|
+
toggleSuperscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
662
|
+
toggleSubscript: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
663
|
+
toggleStrike: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
664
|
+
toggleCode: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
665
|
+
toggleUnderline: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
666
|
+
toggleEm: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
667
|
+
toggleStrong: import("@atlaskit/editor-plugin-text-formatting").ToggleMarkWithAnalyticsCommand;
|
|
670
668
|
};
|
|
671
669
|
}>, (config?: HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
|
|
672
670
|
pluginConfiguration: HyperlinkPluginOptions | undefined;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference path="../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
-
/// <reference path="../../../../../../../typings/prosemirror-state.d.ts" />
|
|
3
1
|
import analyticsPlugin from './plugin';
|
|
4
2
|
export { ACTION_SUBJECT_ID, ACTION_SUBJECT, ACTION, BROWSER_FREEZE_INTERACTION_TYPE, EVENT_TYPE, FULL_WIDTH_MODE, INDENT_DIRECTION, INDENT_TYPE, INPUT_METHOD, LINK_REPRESENTATION, LINK_RESOURCE, LINK_STATUS, MODE, PasteContents, PasteSources, PasteTypes, PLATFORMS, PUNC, SYMBOL, TABLE_ACTION, TABLE_BREAKOUT, TRIGGER_METHOD, USER_CONTEXT, DELETE_DIRECTION, LIST_TEXT_SCENARIOS, fireAnalyticsEvent, getAnalyticsEventsFromTransaction, } from '@atlaskit/editor-common/analytics';
|
|
5
3
|
export type { AnalyticsDispatch, AnalyticsEventPayload, AnalyticsEventPayloadWithChannel, CommonListAnalyticsAttributes, CreateLinkInlineDialogActionType, CreateLinkInlineDialogEventPayload, ErrorEventPayload, ErrorEventAttributes, FormatEventPayload, GeneralEventPayload, InputMethodInsertLink, InputMethodInsertMedia, InsertEventPayload, MediaAltTextActionType, MediaEventPayload, MediaLinkAEP, PASTE_ACTION_SUBJECT_ID, PasteContent, PasteEventPayload, PasteSource, PasteType, SubstituteEventPayload, TableEventPayload, FireAnalyticsCallback, FireAnalyticsEvent, } from '@atlaskit/editor-common/analytics';
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
/// <reference path="../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
-
/// <reference path="../../../../../../../../typings/prosemirror-state.d.ts" />
|
|
3
1
|
import type { InlineCommentPluginState } from './types';
|
|
4
2
|
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: InlineCommentPluginState | ((state: import("prosemirror-state").EditorState) => InlineCommentPluginState)) => import("prosemirror-state").SafeStateField<InlineCommentPluginState>, createCommand: <A = import("./types").InlineCommentAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
3
|
-
import { AnnotationUpdateEmitter } from './update-provider';
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
3
|
+
import type { AnnotationUpdateEmitter } from './update-provider';
|
|
4
4
|
export type AnnotationInfo = {
|
|
5
5
|
id: string;
|
|
6
6
|
type: AnnotationTypes.INLINE_COMMENT;
|
|
@@ -73,4 +73,10 @@ export declare const AnnotationTestIds: {
|
|
|
73
73
|
componentSave: string;
|
|
74
74
|
componentClose: string;
|
|
75
75
|
};
|
|
76
|
+
export type CoordsAtPos = {
|
|
77
|
+
top: number;
|
|
78
|
+
bottom: number;
|
|
79
|
+
left: number;
|
|
80
|
+
right: number;
|
|
81
|
+
};
|
|
76
82
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference path="../../../../../../../typings/prosemirror.d.ts" />
|
|
2
1
|
import type { ResolvedPos, Mark, Node, Slice, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
3
2
|
import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
3
|
import { PluginKey, TextSelection, AllSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -12,11 +11,9 @@ import type { AnalyticsEventPayloadCallback } from '../analytics/utils';
|
|
|
12
11
|
* Finds the marks in the nodes to the left and right.
|
|
13
12
|
* @param $pos Position to center search around
|
|
14
13
|
*/
|
|
15
|
-
export declare const surroundingMarks: ($pos: ResolvedPos) => Mark[][];
|
|
14
|
+
export declare const surroundingMarks: ($pos: ResolvedPos) => (readonly Mark[])[];
|
|
16
15
|
export declare const getAllAnnotations: (doc: Node) => string[];
|
|
17
|
-
export declare const addDraftDecoration: (start: number, end: number) => Decoration
|
|
18
|
-
[key: string]: any;
|
|
19
|
-
} & import("prosemirror-view").InlineDecorationSpec>;
|
|
16
|
+
export declare const addDraftDecoration: (start: number, end: number) => Decoration;
|
|
20
17
|
export declare const getAnnotationViewKey: (annotations: AnnotationInfo[]) => string;
|
|
21
18
|
export declare const findAnnotationsInSelection: (selection: Selection, doc: Node) => AnnotationInfo[];
|
|
22
19
|
/**
|
|
@@ -9,5 +9,5 @@ export interface PluginState {
|
|
|
9
9
|
contextIdentifierProvider?: ContextIdentifierProvider;
|
|
10
10
|
}
|
|
11
11
|
export declare const getContextIdentifier: (state?: EditorState) => ContextIdentifierProvider | undefined;
|
|
12
|
-
declare const _default: (dispatch: Dispatch, providerFactory?: ProviderFactory) => SafePlugin<
|
|
12
|
+
declare const _default: (dispatch: Dispatch, providerFactory?: ProviderFactory) => SafePlugin<{}>;
|
|
13
13
|
export default _default;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference path="../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
-
/// <reference path="../../../../../../../../typings/prosemirror-state.d.ts" />
|
|
3
1
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
2
|
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
5
3
|
import type { HeadingLevelsAndNormalText, Command } from '@atlaskit/editor-common/types';
|
|
@@ -9,4 +9,9 @@ export type BlockTypeState = {
|
|
|
9
9
|
availableWrapperBlockTypes: BlockType[];
|
|
10
10
|
};
|
|
11
11
|
export declare const pluginKey: PluginKey<BlockTypeState>;
|
|
12
|
-
export declare const createPlugin: (editorAnalyticsApi: EditorAnalyticsAPI | undefined, dispatch: (eventName: string | PluginKey, data: any) => void, lastNodeMustBeParagraph?: boolean) => SafePlugin<
|
|
12
|
+
export declare const createPlugin: (editorAnalyticsApi: EditorAnalyticsAPI | undefined, dispatch: (eventName: string | PluginKey, data: any) => void, lastNodeMustBeParagraph?: boolean) => SafePlugin<{
|
|
13
|
+
currentBlockType: BlockType;
|
|
14
|
+
blockTypesDisabled: boolean;
|
|
15
|
+
availableBlockTypes: BlockType[];
|
|
16
|
+
availableWrapperBlockTypes: BlockType[];
|
|
17
|
+
}>;
|
|
@@ -2,4 +2,4 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import type { EditorProps, PMPluginFactoryParams } from '../../../types';
|
|
3
3
|
export declare const createPlugin: ({ dispatch, getIntl }: PMPluginFactoryParams, { appearance }: {
|
|
4
4
|
appearance: EditorProps['appearance'];
|
|
5
|
-
}) => SafePlugin<
|
|
5
|
+
}) => SafePlugin<import("./types").CodeBidiWarningPluginState>;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference path="../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
-
/// <reference path="../../../../../../../../typings/prosemirror-state.d.ts" />
|
|
3
1
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
2
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
3
|
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("./types").CodeBidiWarningPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").CodeBidiWarningPluginState)) => import("prosemirror-state").SafeStateField<import("./types").CodeBidiWarningPluginState>, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").CodeBidiWarningPluginState;
|
|
@@ -2,6 +2,10 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
export declare const copySelectionPluginKey: PluginKey<any>;
|
|
5
|
-
|
|
5
|
+
type CodeBlockCopySelectionPluginState = {
|
|
6
|
+
decorationStartAndEnd?: [start: number, end: number];
|
|
7
|
+
};
|
|
8
|
+
export declare function codeBlockCopySelectionPlugin(): SafePlugin<CodeBlockCopySelectionPluginState>;
|
|
6
9
|
export declare function provideVisualFeedbackForCopyButton(state: EditorState, dispatch?: (tr: Transaction) => void): boolean;
|
|
7
10
|
export declare function removeVisualFeedbackForCopyButton(state: EditorState, dispatch?: (tr: Transaction) => void): boolean;
|
|
11
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { IntlShape } from 'react-intl-next';
|
|
3
3
|
import type { EditorProps } from '../../../types';
|
|
4
|
+
import type { CodeBlockState } from './main-state';
|
|
4
5
|
export declare const createPlugin: ({ useLongPressSelection, getIntl, appearance, allowCompositionInputOverride, }: {
|
|
5
6
|
useLongPressSelection?: boolean | undefined;
|
|
6
7
|
getIntl: () => IntlShape;
|
|
7
8
|
appearance: EditorProps['appearance'];
|
|
8
9
|
allowCompositionInputOverride?: boolean | undefined;
|
|
9
|
-
}) => SafePlugin<
|
|
10
|
+
}) => SafePlugin<CodeBlockState>;
|
|
@@ -3,4 +3,4 @@ import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
export declare function transformSliceToJoinAdjacentCodeBlocks(slice: Slice): Slice;
|
|
5
5
|
export declare const transformSingleLineCodeBlockToCodeMark: (slice: Slice, schema: Schema) => Slice;
|
|
6
|
-
export declare const findCodeBlock: (state: EditorState, selection?: Selection | null) => import("prosemirror-utils").
|
|
6
|
+
export declare const findCodeBlock: (state: EditorState, selection?: Selection | null) => import("prosemirror-utils/dist/types").FindResult;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference path="../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
-
/// <reference path="../../../../../../../typings/prosemirror-state.d.ts" />
|
|
3
1
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
2
|
import type { EditorView, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
5
3
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -15,9 +13,7 @@ export declare const getAvatarColor: (str: string) => {
|
|
|
15
13
|
color: Color;
|
|
16
14
|
};
|
|
17
15
|
export declare const findPointers: (id: string, decorations: DecorationSet) => Decoration[];
|
|
18
|
-
export declare const createTelepointers: (from: number, to: number, sessionId: string, isSelection: boolean, initial: string) => Decoration
|
|
19
|
-
[key: string]: any;
|
|
20
|
-
}>[];
|
|
16
|
+
export declare const createTelepointers: (from: number, to: number, sessionId: string, isSelection: boolean, initial: string) => Decoration[];
|
|
21
17
|
export declare const replaceDocument: (doc: any, state: EditorState, version?: number, options?: CollabEditOptions, reserveCursor?: boolean) => import("prosemirror-state").Transaction;
|
|
22
18
|
export declare const scrollToCollabCursor: (editorView: EditorView, participants: CollabParticipant[], sessionId: string | undefined, index: number) => void;
|
|
23
19
|
export declare const getPositionOfTelepointer: (sessionId: string, decorationSet: DecorationSet) => undefined | number;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
|
|
2
|
+
import type { MarkType } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
type CopyButtonPluginState = {
|
|
4
|
+
copied: boolean;
|
|
5
|
+
markSelection?: {
|
|
6
|
+
start: number;
|
|
7
|
+
end: number;
|
|
8
|
+
markType: MarkType;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare function copyButtonPlugin(): SafePlugin<CopyButtonPluginState>;
|
|
3
12
|
export default copyButtonPlugin;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference path="../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
-
/// <reference path="../../../../../../../typings/prosemirror-state.d.ts" />
|
|
3
1
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
2
|
import type { Command } from '../../../src/types';
|
|
5
3
|
import type { FloatingToolbarButton, FloatingToolbarItem, MarkOptions, NodeOptions } from '@atlaskit/editor-common/types';
|
|
@@ -4,5 +4,5 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
4
4
|
export declare function getSelectedNodeOrNodeParentByNodeType({ nodeType, selection, }: {
|
|
5
5
|
nodeType: NodeType | Array<NodeType>;
|
|
6
6
|
selection: Transaction['selection'];
|
|
7
|
-
}): import("prosemirror-utils").
|
|
7
|
+
}): import("prosemirror-utils/dist/types").FindResult;
|
|
8
8
|
export declare const toDOM: (node: PMNode, schema: Schema) => Node;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { NextEditorPlugin, PMPluginFactoryParams } from '../../types';
|
|
3
|
-
|
|
3
|
+
import type { CustomAutoformatState } from './types';
|
|
4
|
+
export declare const createPMPlugin: ({ providerFactory }: PMPluginFactoryParams) => SafePlugin<CustomAutoformatState>;
|
|
4
5
|
declare const customAutoformatPlugin: NextEditorPlugin<'customAutoformat'>;
|
|
5
6
|
export default customAutoformatPlugin;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference path="../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
-
/// <reference path="../../../../../../../../typings/prosemirror-state.d.ts" />
|
|
3
1
|
import { PMPluginFactory } from '../../../types';
|
|
4
2
|
import { DatePluginState } from './types';
|
|
5
3
|
declare const getPluginState: (state: import("prosemirror-state").EditorState) => DatePluginState;
|
|
@@ -4,4 +4,4 @@ import type { EditorProps } from '../../../types';
|
|
|
4
4
|
import type { IntlShape } from 'react-intl-next';
|
|
5
5
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
6
6
|
export declare function containsClass(element: Element | null, className: string): boolean;
|
|
7
|
-
export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorProps['appearance'], useLongPressSelection: boolean | undefined, featureFlags: FeatureFlags) => SafePlugin<
|
|
7
|
+
export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorProps['appearance'], useLongPressSelection: boolean | undefined, featureFlags: FeatureFlags) => SafePlugin<import("..").ExpandPluginState>;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference path="../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
-
/// <reference path="../../../../../../../../typings/prosemirror-state.d.ts" />
|
|
3
1
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
2
|
export declare const pluginKey: PluginKey<any>;
|
|
5
3
|
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("..").ExpandPluginState | ((state: import("prosemirror-state").EditorState) => import("..").ExpandPluginState)) => import("prosemirror-state").SafeStateField<import("..").ExpandPluginState>, createCommand: <A = import("../types").ExpandPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("..").ExpandPluginState;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference path="../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
-
/// <reference path="../../../../../../../typings/prosemirror-state.d.ts" />
|
|
3
1
|
import { ExtensionState } from './types';
|
|
4
2
|
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: ExtensionState<import("@atlaskit/editor-common/extensions").Parameters> | ((state: import("prosemirror-state").EditorState) => ExtensionState<import("@atlaskit/editor-common/extensions").Parameters>)) => import("prosemirror-state").SafeStateField<ExtensionState<import("@atlaskit/editor-common/extensions").Parameters>>;
|
|
5
3
|
export declare const createCommand: <A = import("./types").ExtensionAction<import("@atlaskit/editor-common/extensions").Parameters>>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
@@ -2,7 +2,7 @@ import type { Schema, Mark } from '@atlaskit/editor-prosemirror/model';
|
|
|
2
2
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { NodeWithPos, DomAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
-
export declare const getSelectedExtension: (state: EditorState, searchParent?: boolean) => import("prosemirror-utils").ContentNodeWithPos | undefined;
|
|
5
|
+
export declare const getSelectedExtension: (state: EditorState, searchParent?: boolean) => import("prosemirror-utils/dist/types").ContentNodeWithPos | undefined;
|
|
6
6
|
export declare const findExtensionWithLocalId: (state: EditorState, localId?: string) => NodeWithPos | undefined;
|
|
7
7
|
export declare const getSelectedDomElement: (schema: Schema, domAtPos: DomAtPos, selectedExtensionNode: NodeWithPos) => HTMLElement;
|
|
8
8
|
export declare const getDataConsumerMark: (newNode: PMNode) => Mark | undefined;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference path="../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
-
/// <reference path="../../../../../../../typings/prosemirror-state.d.ts" />
|
|
3
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
2
|
import type { Dispatch } from '../../event-dispatcher';
|
|
5
3
|
import type { FindReplacePluginState } from './types';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference path="../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
1
|
import type { Fragment, Node as PmNode, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
3
2
|
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
3
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -11,9 +10,7 @@ export declare const createDecorations: (selectedIndex: number, matches: {
|
|
|
11
10
|
start: number;
|
|
12
11
|
end: number;
|
|
13
12
|
}[]) => Decoration[];
|
|
14
|
-
export declare const createDecoration: (start: number, end: number, isSelected?: boolean) => Decoration
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
} & import("prosemirror-view").InlineDecorationSpec>;
|
|
13
|
+
export declare const createDecoration: (start: number, end: number, isSelected?: boolean) => Decoration;
|
|
17
14
|
export declare function findMatches(content: PmNode | Fragment, searchText: string, shouldMatchCase: boolean, contentIndex?: number): Match[];
|
|
18
15
|
/**
|
|
19
16
|
* Finds index of first item in matches array that comes after user's cursor pos.
|
|
@@ -7,7 +7,9 @@ export declare const forceFocusStateKey: PluginKey<any>;
|
|
|
7
7
|
* Used in cases where a floating toolbar button opens a submenu which destroys
|
|
8
8
|
* the button, but the user has pressed ESC to close the submenu and focus needs
|
|
9
9
|
* to move back to the button. */
|
|
10
|
-
declare const _default: () => SafePlugin<
|
|
10
|
+
declare const _default: () => SafePlugin<{
|
|
11
|
+
selector: null;
|
|
12
|
+
}>;
|
|
11
13
|
export default _default;
|
|
12
14
|
/**
|
|
13
15
|
* The provided selector should be the floating toolbar button that needs focus.
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
/// <reference path="../../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
-
/// <reference path="../../../../../../../../../typings/prosemirror-state.d.ts" />
|
|
3
1
|
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("@atlaskit/editor-plugin-floating-toolbar").FloatingToolbarPluginData | ((state: import("prosemirror-state").EditorState) => import("@atlaskit/editor-plugin-floating-toolbar").FloatingToolbarPluginData)) => import("prosemirror-state").SafeStateField<import("@atlaskit/editor-plugin-floating-toolbar").FloatingToolbarPluginData>, createCommand: <A = import("./types").FloatingToolbarPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("@atlaskit/editor-plugin-floating-toolbar").FloatingToolbarPluginData;
|
|
@@ -31,7 +31,6 @@ export { default as saveOnEnterPlugin } from './save-on-enter';
|
|
|
31
31
|
export { default as submitEditorPlugin } from './submit-editor';
|
|
32
32
|
export { default as tasksAndDecisionsPlugin } from './tasks-and-decisions';
|
|
33
33
|
export { default as textColorPlugin } from './text-color';
|
|
34
|
-
export { default as textFormattingPlugin } from './text-formatting';
|
|
35
34
|
export { default as typeAheadPlugin } from './type-ahead';
|
|
36
35
|
export { default as unsupportedContentPlugin } from './unsupported-content';
|
|
37
36
|
export { default as floatingToolbarPlugin } from './floating-toolbar';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Node as PMNode, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { InputRuleWrapper } from '@atlaskit/
|
|
2
|
+
import type { InputRuleWrapper, FeatureFlags } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
5
4
|
type WrappingRuleProps = {
|
|
6
5
|
featureFlags: FeatureFlags;
|
|
7
6
|
match: RegExp;
|
|
@@ -8,7 +8,7 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const findMediaSingleNode: (mediaPluginState: MediaPluginState, id: string) => MediaNodeWithPosHandler | null;
|
|
10
10
|
export declare const findAllMediaSingleNodes: (mediaPluginState: MediaPluginState, id: string) => MediaNodeWithPosHandler[];
|
|
11
|
-
export declare const isMediaNode: (pos: number, state: EditorState) => boolean | null
|
|
11
|
+
export declare const isMediaNode: (pos: number, state: EditorState) => boolean | null;
|
|
12
12
|
export declare const updateAllMediaSingleNodesAttrs: (id: string, attrs: object) => Command;
|
|
13
13
|
export declare const updateCurrentMediaNodeAttrs: (attrs: object, mediaNode: MediaNodeWithPosHandler) => Command;
|
|
14
14
|
export declare const updateMediaSingleNodeAttrs: (id: string, attrs: object) => Command;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
/// <reference path="../../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
-
/// <reference path="../../../../../../../../../typings/prosemirror-state.d.ts" />
|
|
3
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
5
3
|
import type { PMPluginFactoryParams } from '../../../../types';
|
|
6
4
|
export declare const pluginKey: PluginKey<any>;
|
|
7
5
|
declare const createCommand: <A = import("./actions").MediaAltTextAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").MediaAltTextState;
|
|
8
|
-
export declare const createPlugin: ({ dispatch, providerFactory, }: PMPluginFactoryParams) => SafePlugin<
|
|
6
|
+
export declare const createPlugin: ({ dispatch, providerFactory, }: PMPluginFactoryParams) => SafePlugin<import("./types").MediaAltTextState>;
|
|
9
7
|
export { createCommand, getPluginState };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference path="../../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
-
/// <reference path="../../../../../../../../../typings/prosemirror-state.d.ts" />
|
|
3
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
5
3
|
import type { Dispatch } from '../../../../event-dispatcher';
|