@atlaskit/editor-core 185.14.3 → 185.15.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 +10 -0
- package/dist/cjs/index.js +9 -9
- package/dist/cjs/labs/next/presets/default.js +2 -2
- package/dist/cjs/plugins/annotation/commands/transform.js +1 -1
- package/dist/cjs/plugins/base/pm-plugins/newline-preserve-marks.js +3 -3
- package/dist/cjs/plugins/block-type/index.js +3 -3
- package/dist/cjs/plugins/block-type/pm-plugins/input-rule.js +6 -6
- package/dist/cjs/plugins/block-type/pm-plugins/main.js +1 -1
- package/dist/cjs/plugins/card/pm-plugins/mountHyperlink.js +1 -0
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +72 -14
- package/dist/cjs/plugins/code-block/index.js +2 -2
- package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +9 -9
- package/dist/cjs/plugins/date/index.js +2 -2
- package/dist/cjs/plugins/{hyperlink → deprecated-hyperlink}/commands.js +60 -119
- package/dist/cjs/plugins/emoji/index.js +2 -2
- package/dist/cjs/plugins/emoji/pm-plugins/ascii-input-rules.js +2 -3
- package/dist/cjs/plugins/expand/index.js +2 -2
- package/dist/cjs/plugins/feedback-dialog/index.js +2 -2
- package/dist/cjs/plugins/floating-toolbar/ui/Input.js +2 -2
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +1 -2
- package/dist/cjs/plugins/image-upload/pm-plugins/input-rule.js +3 -3
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/plugins/insert-block/index.js +98 -48
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +40 -36
- package/dist/cjs/plugins/layout/index.js +2 -2
- package/dist/cjs/plugins/layout/pm-plugins/main.js +4 -4
- package/dist/cjs/plugins/list/actions/conversions.js +3 -3
- package/dist/cjs/plugins/list/actions/indent-list-items-selected.js +3 -3
- package/dist/cjs/plugins/list/commands/index.js +5 -4
- package/dist/cjs/plugins/list/index.js +3 -3
- package/dist/cjs/plugins/list/pm-plugins/input-rules/index.js +2 -2
- package/dist/cjs/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +2 -2
- package/dist/cjs/plugins/list/utils/selection.js +4 -4
- package/dist/cjs/plugins/media/index.js +2 -2
- package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -2
- package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +5 -7
- package/dist/cjs/plugins/mentions/index.js +2 -2
- package/dist/cjs/plugins/panel/index.js +7 -8
- package/dist/cjs/plugins/paste/handlers.js +1 -2
- package/dist/cjs/plugins/placeholder-text/ui/PlaceholderFloatingToolbar/index.js +2 -2
- package/dist/cjs/plugins/rule/index.js +2 -2
- package/dist/cjs/plugins/rule/pm-plugins/input-rule.js +3 -4
- package/dist/cjs/plugins/status/index.js +2 -2
- package/dist/cjs/plugins/tasks-and-decisions/index.js +3 -3
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/input-rules.js +2 -3
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +11 -10
- package/dist/cjs/plugins/text-formatting/commands/clear-formatting.js +3 -2
- package/dist/cjs/plugins/text-formatting/pm-plugins/clear-formatting-keymap.js +1 -1
- package/dist/cjs/plugins/text-formatting/pm-plugins/input-rule.js +8 -8
- package/dist/cjs/plugins/text-formatting/pm-plugins/keymap.js +1 -1
- package/dist/cjs/plugins/text-formatting/pm-plugins/main.js +1 -1
- package/dist/cjs/plugins/text-formatting/pm-plugins/smart-input-rule.js +5 -4
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +2 -2
- package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
- package/dist/cjs/plugins/type-ahead/pm-plugins/input-rules.js +3 -4
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +2 -2
- package/dist/cjs/ui/ContentStyles/index.js +12 -11
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +9 -9
- package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +2 -2
- package/dist/cjs/utils/array.js +0 -8
- package/dist/cjs/utils/commands.js +5 -19
- package/dist/cjs/utils/index.js +0 -10
- package/dist/cjs/utils/input-rules.js +13 -73
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/index.js +14 -3
- package/dist/es2019/labs/next/presets/default.js +1 -1
- package/dist/es2019/plugins/annotation/commands/transform.js +1 -1
- package/dist/es2019/plugins/base/pm-plugins/newline-preserve-marks.js +1 -1
- package/dist/es2019/plugins/block-type/index.js +1 -1
- package/dist/es2019/plugins/block-type/pm-plugins/input-rule.js +3 -2
- package/dist/es2019/plugins/block-type/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/card/pm-plugins/mountHyperlink.js +1 -0
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +64 -3
- package/dist/es2019/plugins/code-block/index.js +1 -1
- package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +1 -1
- package/dist/es2019/plugins/date/index.js +1 -1
- package/dist/es2019/plugins/{hyperlink → deprecated-hyperlink}/commands.js +48 -100
- package/dist/es2019/plugins/emoji/index.js +1 -1
- package/dist/es2019/plugins/emoji/pm-plugins/ascii-input-rules.js +1 -1
- package/dist/es2019/plugins/expand/index.js +1 -1
- package/dist/es2019/plugins/feedback-dialog/index.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Input.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +1 -1
- package/dist/es2019/plugins/image-upload/pm-plugins/input-rule.js +1 -1
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/plugins/insert-block/index.js +102 -52
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -6
- package/dist/es2019/plugins/layout/index.js +1 -1
- package/dist/es2019/plugins/layout/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/list/actions/conversions.js +1 -1
- package/dist/es2019/plugins/list/actions/indent-list-items-selected.js +1 -1
- package/dist/es2019/plugins/list/commands/index.js +2 -1
- package/dist/es2019/plugins/list/index.js +1 -1
- package/dist/es2019/plugins/list/pm-plugins/input-rules/index.js +1 -1
- package/dist/es2019/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +1 -1
- package/dist/es2019/plugins/list/utils/selection.js +1 -1
- package/dist/es2019/plugins/media/index.js +1 -1
- package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
- package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +2 -3
- package/dist/es2019/plugins/mentions/index.js +1 -1
- package/dist/es2019/plugins/panel/index.js +2 -2
- package/dist/es2019/plugins/paste/handlers.js +1 -2
- package/dist/es2019/plugins/placeholder-text/ui/PlaceholderFloatingToolbar/index.js +1 -1
- package/dist/es2019/plugins/rule/index.js +1 -1
- package/dist/es2019/plugins/rule/pm-plugins/input-rule.js +1 -1
- package/dist/es2019/plugins/status/index.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/index.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/input-rules.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +2 -1
- package/dist/es2019/plugins/text-formatting/commands/clear-formatting.js +2 -1
- package/dist/es2019/plugins/text-formatting/pm-plugins/clear-formatting-keymap.js +1 -1
- package/dist/es2019/plugins/text-formatting/pm-plugins/input-rule.js +3 -2
- package/dist/es2019/plugins/text-formatting/pm-plugins/keymap.js +1 -1
- package/dist/es2019/plugins/text-formatting/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/text-formatting/pm-plugins/smart-input-rule.js +3 -2
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +1 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
- package/dist/es2019/plugins/type-ahead/pm-plugins/input-rules.js +2 -2
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +1 -1
- package/dist/es2019/ui/ContentStyles/index.js +6 -1
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +1 -1
- package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +1 -1
- package/dist/es2019/utils/array.js +0 -5
- package/dist/es2019/utils/commands.js +2 -13
- package/dist/es2019/utils/index.js +0 -5
- package/dist/es2019/utils/input-rules.js +1 -59
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/index.js +14 -3
- package/dist/esm/labs/next/presets/default.js +1 -1
- package/dist/esm/plugins/annotation/commands/transform.js +1 -1
- package/dist/esm/plugins/base/pm-plugins/newline-preserve-marks.js +1 -1
- package/dist/esm/plugins/block-type/index.js +1 -1
- package/dist/esm/plugins/block-type/pm-plugins/input-rule.js +3 -2
- package/dist/esm/plugins/block-type/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/card/pm-plugins/mountHyperlink.js +1 -0
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +69 -13
- package/dist/esm/plugins/code-block/index.js +1 -1
- package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +1 -1
- package/dist/esm/plugins/date/index.js +1 -1
- package/dist/esm/plugins/{hyperlink → deprecated-hyperlink}/commands.js +48 -100
- package/dist/esm/plugins/emoji/index.js +1 -1
- package/dist/esm/plugins/emoji/pm-plugins/ascii-input-rules.js +1 -1
- package/dist/esm/plugins/expand/index.js +1 -1
- package/dist/esm/plugins/feedback-dialog/index.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/Input.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +1 -1
- package/dist/esm/plugins/image-upload/pm-plugins/input-rule.js +1 -1
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/plugins/insert-block/index.js +94 -44
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +38 -34
- package/dist/esm/plugins/layout/index.js +1 -1
- package/dist/esm/plugins/layout/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/list/actions/conversions.js +1 -1
- package/dist/esm/plugins/list/actions/indent-list-items-selected.js +1 -1
- package/dist/esm/plugins/list/commands/index.js +2 -1
- package/dist/esm/plugins/list/index.js +1 -1
- package/dist/esm/plugins/list/pm-plugins/input-rules/index.js +1 -1
- package/dist/esm/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +1 -1
- package/dist/esm/plugins/list/utils/selection.js +1 -1
- package/dist/esm/plugins/media/index.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
- package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +2 -3
- package/dist/esm/plugins/mentions/index.js +1 -1
- package/dist/esm/plugins/panel/index.js +2 -2
- package/dist/esm/plugins/paste/handlers.js +1 -2
- package/dist/esm/plugins/placeholder-text/ui/PlaceholderFloatingToolbar/index.js +1 -1
- package/dist/esm/plugins/rule/index.js +1 -1
- package/dist/esm/plugins/rule/pm-plugins/input-rule.js +1 -1
- package/dist/esm/plugins/status/index.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/index.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/input-rules.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +2 -1
- package/dist/esm/plugins/text-formatting/commands/clear-formatting.js +2 -1
- package/dist/esm/plugins/text-formatting/pm-plugins/clear-formatting-keymap.js +1 -1
- package/dist/esm/plugins/text-formatting/pm-plugins/input-rule.js +3 -2
- package/dist/esm/plugins/text-formatting/pm-plugins/keymap.js +1 -1
- package/dist/esm/plugins/text-formatting/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/text-formatting/pm-plugins/smart-input-rule.js +3 -2
- package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +1 -1
- package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
- package/dist/esm/plugins/type-ahead/pm-plugins/input-rules.js +2 -2
- package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +1 -1
- package/dist/esm/ui/ContentStyles/index.js +4 -3
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +1 -1
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +1 -1
- package/dist/esm/utils/array.js +0 -7
- package/dist/esm/utils/commands.js +2 -15
- package/dist/esm/utils/index.js +0 -9
- package/dist/esm/utils/input-rules.js +10 -68
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/index.d.ts +16 -5
- package/dist/types/labs/next/presets/cxhtml.d.ts +8 -2
- package/dist/types/labs/next/presets/default.d.ts +16 -4
- package/dist/types/labs/next/presets/mobile.d.ts +8 -2
- package/dist/types/plugins/annotation/commands/transform.d.ts +1 -1
- package/dist/types/plugins/block-type/commands/block-type.d.ts +1 -1
- package/dist/types/plugins/block-type/types.d.ts +1 -3
- package/dist/types/plugins/card/index.d.ts +1 -1
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +5 -0
- package/dist/types/plugins/deprecated-hyperlink/commands.d.ts +38 -0
- package/dist/types/plugins/find-replace/commands.d.ts +4 -4
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/insert-block/index.d.ts +4 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +2 -4
- package/dist/types/plugins/list/pm-plugins/input-rules/index.d.ts +1 -1
- package/dist/types/plugins/media/ui/MediaLinkingToolbar.d.ts +1 -1
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +2 -3
- package/dist/types/plugins/text-formatting/commands/clear-formatting.d.ts +1 -1
- package/dist/types/plugins/text-formatting/pm-plugins/input-rule.d.ts +1 -1
- package/dist/types/ui/ColorPickerButton/index.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +1 -0
- package/dist/types/utils/array.d.ts +0 -1
- package/dist/types/utils/commands.d.ts +2 -5
- package/dist/types/utils/index.d.ts +0 -1
- package/dist/types/utils/input-rules.d.ts +1 -8
- package/dist/types-ts4.5/index.d.ts +16 -5
- package/dist/types-ts4.5/labs/next/presets/cxhtml.d.ts +8 -2
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +16 -4
- package/dist/types-ts4.5/labs/next/presets/mobile.d.ts +8 -2
- package/dist/types-ts4.5/plugins/annotation/commands/transform.d.ts +1 -1
- package/dist/types-ts4.5/plugins/block-type/commands/block-type.d.ts +1 -1
- package/dist/types-ts4.5/plugins/block-type/types.d.ts +1 -3
- package/dist/types-ts4.5/plugins/card/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/ui/EditLinkToolbar.d.ts +5 -0
- package/dist/types-ts4.5/plugins/deprecated-hyperlink/commands.d.ts +38 -0
- package/dist/types-ts4.5/plugins/find-replace/commands.d.ts +4 -4
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +2 -4
- package/dist/types-ts4.5/plugins/list/pm-plugins/input-rules/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/ui/MediaLinkingToolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +2 -3
- package/dist/types-ts4.5/plugins/text-formatting/commands/clear-formatting.d.ts +1 -1
- package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/input-rule.d.ts +1 -1
- package/dist/types-ts4.5/ui/ColorPickerButton/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +1 -0
- package/dist/types-ts4.5/utils/array.d.ts +0 -1
- package/dist/types-ts4.5/utils/commands.d.ts +2 -5
- package/dist/types-ts4.5/utils/index.d.ts +0 -1
- package/dist/types-ts4.5/utils/input-rules.d.ts +1 -8
- package/package.json +6 -6
- package/report.api.md +15 -72
- package/dist/cjs/plugins/hyperlink/Toolbar.js +0 -242
- package/dist/cjs/plugins/hyperlink/index.js +0 -107
- package/dist/cjs/plugins/hyperlink/pm-plugins/fake-curor-for-toolbar-plugin-key.js +0 -9
- package/dist/cjs/plugins/hyperlink/pm-plugins/fake-cursor-for-toolbar.js +0 -67
- package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +0 -92
- package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +0 -76
- package/dist/cjs/plugins/hyperlink/pm-plugins/main.js +0 -295
- package/dist/cjs/plugins/hyperlink/pm-plugins/toolbar-buttons.js +0 -41
- package/dist/cjs/plugins/hyperlink/styles.js +0 -20
- package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +0 -86
- package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.js +0 -32
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +0 -932
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +0 -104
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/messages.js +0 -40
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/utils.js +0 -76
- package/dist/cjs/plugins/quick-insert/assets/action.js +0 -43
- package/dist/cjs/plugins/quick-insert/assets/code.js +0 -115
- package/dist/cjs/plugins/quick-insert/assets/custom-panel.js +0 -55
- package/dist/cjs/plugins/quick-insert/assets/date.js +0 -93
- package/dist/cjs/plugins/quick-insert/assets/decision.js +0 -34
- package/dist/cjs/plugins/quick-insert/assets/divider.js +0 -74
- package/dist/cjs/plugins/quick-insert/assets/emoji.js +0 -37
- package/dist/cjs/plugins/quick-insert/assets/expand.js +0 -47
- package/dist/cjs/plugins/quick-insert/assets/fallback.js +0 -55
- package/dist/cjs/plugins/quick-insert/assets/feedback.js +0 -70
- package/dist/cjs/plugins/quick-insert/assets/heading1.js +0 -50
- package/dist/cjs/plugins/quick-insert/assets/heading2.js +0 -50
- package/dist/cjs/plugins/quick-insert/assets/heading3.js +0 -50
- package/dist/cjs/plugins/quick-insert/assets/heading4.js +0 -50
- package/dist/cjs/plugins/quick-insert/assets/heading5.js +0 -50
- package/dist/cjs/plugins/quick-insert/assets/heading6.js +0 -50
- package/dist/cjs/plugins/quick-insert/assets/images.js +0 -92
- package/dist/cjs/plugins/quick-insert/assets/index.js +0 -356
- package/dist/cjs/plugins/quick-insert/assets/layout.js +0 -71
- package/dist/cjs/plugins/quick-insert/assets/link.js +0 -35
- package/dist/cjs/plugins/quick-insert/assets/list-number.js +0 -51
- package/dist/cjs/plugins/quick-insert/assets/list.js +0 -65
- package/dist/cjs/plugins/quick-insert/assets/mention.js +0 -56
- package/dist/cjs/plugins/quick-insert/assets/panel-error.js +0 -35
- package/dist/cjs/plugins/quick-insert/assets/panel-note.js +0 -35
- package/dist/cjs/plugins/quick-insert/assets/panel-success.js +0 -35
- package/dist/cjs/plugins/quick-insert/assets/panel-warning.js +0 -35
- package/dist/cjs/plugins/quick-insert/assets/panel.js +0 -50
- package/dist/cjs/plugins/quick-insert/assets/quote.js +0 -35
- package/dist/cjs/plugins/quick-insert/assets/status.js +0 -109
- package/dist/cjs/ui/LinkSearch/LinkSearchList.js +0 -83
- package/dist/cjs/ui/LinkSearch/LinkSearchListItem.js +0 -146
- package/dist/cjs/ui/LinkSearch/ToolbarComponents.js +0 -17
- package/dist/cjs/ui/LinkSearch/index.js +0 -328
- package/dist/cjs/ui/LinkSearch/listItemAlts.js +0 -70
- package/dist/cjs/ui/LinkSearch/transformTimeStamp.js +0 -42
- package/dist/cjs/ui/LinkSearch/types.js +0 -5
- package/dist/cjs/ui/LinkSearch/withActivityProvider.js +0 -57
- package/dist/cjs/ui/PanelTextInput/index.js +0 -174
- package/dist/cjs/ui/PanelTextInput/styles.js +0 -19
- package/dist/cjs/utils/announcer/announcer.js +0 -62
- package/dist/es2019/plugins/hyperlink/Toolbar.js +0 -223
- package/dist/es2019/plugins/hyperlink/index.js +0 -88
- package/dist/es2019/plugins/hyperlink/pm-plugins/fake-curor-for-toolbar-plugin-key.js +0 -2
- package/dist/es2019/plugins/hyperlink/pm-plugins/fake-cursor-for-toolbar.js +0 -62
- package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +0 -79
- package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +0 -64
- package/dist/es2019/plugins/hyperlink/pm-plugins/main.js +0 -292
- package/dist/es2019/plugins/hyperlink/pm-plugins/toolbar-buttons.js +0 -37
- package/dist/es2019/plugins/hyperlink/styles.js +0 -22
- package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +0 -74
- package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.js +0 -25
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +0 -777
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +0 -80
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/messages.js +0 -33
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/utils.js +0 -78
- package/dist/es2019/plugins/quick-insert/assets/action.js +0 -35
- package/dist/es2019/plugins/quick-insert/assets/code.js +0 -107
- package/dist/es2019/plugins/quick-insert/assets/custom-panel.js +0 -47
- package/dist/es2019/plugins/quick-insert/assets/date.js +0 -85
- package/dist/es2019/plugins/quick-insert/assets/decision.js +0 -26
- package/dist/es2019/plugins/quick-insert/assets/divider.js +0 -66
- package/dist/es2019/plugins/quick-insert/assets/emoji.js +0 -29
- package/dist/es2019/plugins/quick-insert/assets/expand.js +0 -39
- package/dist/es2019/plugins/quick-insert/assets/fallback.js +0 -47
- package/dist/es2019/plugins/quick-insert/assets/feedback.js +0 -62
- package/dist/es2019/plugins/quick-insert/assets/heading1.js +0 -42
- package/dist/es2019/plugins/quick-insert/assets/heading2.js +0 -42
- package/dist/es2019/plugins/quick-insert/assets/heading3.js +0 -42
- package/dist/es2019/plugins/quick-insert/assets/heading4.js +0 -42
- package/dist/es2019/plugins/quick-insert/assets/heading5.js +0 -42
- package/dist/es2019/plugins/quick-insert/assets/heading6.js +0 -42
- package/dist/es2019/plugins/quick-insert/assets/images.js +0 -84
- package/dist/es2019/plugins/quick-insert/assets/index.js +0 -113
- package/dist/es2019/plugins/quick-insert/assets/layout.js +0 -63
- package/dist/es2019/plugins/quick-insert/assets/link.js +0 -27
- package/dist/es2019/plugins/quick-insert/assets/list-number.js +0 -43
- package/dist/es2019/plugins/quick-insert/assets/list.js +0 -57
- package/dist/es2019/plugins/quick-insert/assets/mention.js +0 -48
- package/dist/es2019/plugins/quick-insert/assets/panel-error.js +0 -27
- package/dist/es2019/plugins/quick-insert/assets/panel-note.js +0 -27
- package/dist/es2019/plugins/quick-insert/assets/panel-success.js +0 -27
- package/dist/es2019/plugins/quick-insert/assets/panel-warning.js +0 -27
- package/dist/es2019/plugins/quick-insert/assets/panel.js +0 -42
- package/dist/es2019/plugins/quick-insert/assets/quote.js +0 -27
- package/dist/es2019/plugins/quick-insert/assets/status.js +0 -101
- package/dist/es2019/ui/LinkSearch/LinkSearchList.js +0 -63
- package/dist/es2019/ui/LinkSearch/LinkSearchListItem.js +0 -141
- package/dist/es2019/ui/LinkSearch/ToolbarComponents.js +0 -20
- package/dist/es2019/ui/LinkSearch/index.js +0 -213
- package/dist/es2019/ui/LinkSearch/listItemAlts.js +0 -63
- package/dist/es2019/ui/LinkSearch/transformTimeStamp.js +0 -34
- package/dist/es2019/ui/LinkSearch/types.js +0 -1
- package/dist/es2019/ui/LinkSearch/withActivityProvider.js +0 -33
- package/dist/es2019/ui/PanelTextInput/index.js +0 -149
- package/dist/es2019/ui/PanelTextInput/styles.js +0 -36
- package/dist/es2019/utils/announcer/announcer.js +0 -41
- package/dist/esm/plugins/hyperlink/Toolbar.js +0 -235
- package/dist/esm/plugins/hyperlink/index.js +0 -99
- package/dist/esm/plugins/hyperlink/pm-plugins/fake-curor-for-toolbar-plugin-key.js +0 -2
- package/dist/esm/plugins/hyperlink/pm-plugins/fake-cursor-for-toolbar.js +0 -60
- package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +0 -82
- package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +0 -65
- package/dist/esm/plugins/hyperlink/pm-plugins/main.js +0 -283
- package/dist/esm/plugins/hyperlink/pm-plugins/toolbar-buttons.js +0 -32
- package/dist/esm/plugins/hyperlink/styles.js +0 -11
- package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +0 -76
- package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.js +0 -25
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +0 -919
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +0 -97
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/messages.js +0 -33
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/utils.js +0 -66
- package/dist/esm/plugins/quick-insert/assets/action.js +0 -35
- package/dist/esm/plugins/quick-insert/assets/code.js +0 -107
- package/dist/esm/plugins/quick-insert/assets/custom-panel.js +0 -47
- package/dist/esm/plugins/quick-insert/assets/date.js +0 -85
- package/dist/esm/plugins/quick-insert/assets/decision.js +0 -26
- package/dist/esm/plugins/quick-insert/assets/divider.js +0 -66
- package/dist/esm/plugins/quick-insert/assets/emoji.js +0 -29
- package/dist/esm/plugins/quick-insert/assets/expand.js +0 -39
- package/dist/esm/plugins/quick-insert/assets/fallback.js +0 -47
- package/dist/esm/plugins/quick-insert/assets/feedback.js +0 -62
- package/dist/esm/plugins/quick-insert/assets/heading1.js +0 -42
- package/dist/esm/plugins/quick-insert/assets/heading2.js +0 -42
- package/dist/esm/plugins/quick-insert/assets/heading3.js +0 -42
- package/dist/esm/plugins/quick-insert/assets/heading4.js +0 -42
- package/dist/esm/plugins/quick-insert/assets/heading5.js +0 -42
- package/dist/esm/plugins/quick-insert/assets/heading6.js +0 -42
- package/dist/esm/plugins/quick-insert/assets/images.js +0 -84
- package/dist/esm/plugins/quick-insert/assets/index.js +0 -246
- package/dist/esm/plugins/quick-insert/assets/layout.js +0 -63
- package/dist/esm/plugins/quick-insert/assets/link.js +0 -27
- package/dist/esm/plugins/quick-insert/assets/list-number.js +0 -43
- package/dist/esm/plugins/quick-insert/assets/list.js +0 -57
- package/dist/esm/plugins/quick-insert/assets/mention.js +0 -48
- package/dist/esm/plugins/quick-insert/assets/panel-error.js +0 -27
- package/dist/esm/plugins/quick-insert/assets/panel-note.js +0 -27
- package/dist/esm/plugins/quick-insert/assets/panel-success.js +0 -27
- package/dist/esm/plugins/quick-insert/assets/panel-warning.js +0 -27
- package/dist/esm/plugins/quick-insert/assets/panel.js +0 -42
- package/dist/esm/plugins/quick-insert/assets/quote.js +0 -27
- package/dist/esm/plugins/quick-insert/assets/status.js +0 -101
- package/dist/esm/ui/LinkSearch/LinkSearchList.js +0 -75
- package/dist/esm/ui/LinkSearch/LinkSearchListItem.js +0 -131
- package/dist/esm/ui/LinkSearch/ToolbarComponents.js +0 -7
- package/dist/esm/ui/LinkSearch/index.js +0 -320
- package/dist/esm/ui/LinkSearch/listItemAlts.js +0 -63
- package/dist/esm/ui/LinkSearch/transformTimeStamp.js +0 -34
- package/dist/esm/ui/LinkSearch/types.js +0 -1
- package/dist/esm/ui/LinkSearch/withActivityProvider.js +0 -50
- package/dist/esm/ui/PanelTextInput/index.js +0 -168
- package/dist/esm/ui/PanelTextInput/styles.js +0 -10
- package/dist/esm/utils/announcer/announcer.js +0 -52
- package/dist/types/plugins/hyperlink/Toolbar.d.ts +0 -6
- package/dist/types/plugins/hyperlink/commands.d.ts +0 -17
- package/dist/types/plugins/hyperlink/index.d.ts +0 -24
- package/dist/types/plugins/hyperlink/pm-plugins/fake-curor-for-toolbar-plugin-key.d.ts +0 -2
- package/dist/types/plugins/hyperlink/pm-plugins/fake-cursor-for-toolbar.d.ts +0 -3
- package/dist/types/plugins/hyperlink/pm-plugins/input-rule.d.ts +0 -7
- package/dist/types/plugins/hyperlink/pm-plugins/keymap.d.ts +0 -3
- package/dist/types/plugins/hyperlink/pm-plugins/main.d.ts +0 -46
- package/dist/types/plugins/hyperlink/pm-plugins/toolbar-buttons.d.ts +0 -19
- package/dist/types/plugins/hyperlink/styles.d.ts +0 -6
- package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/index.d.ts +0 -21
- package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.d.ts +0 -2
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +0 -109
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +0 -19
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/messages.d.ts +0 -32
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/utils.d.ts +0 -7
- package/dist/types/plugins/quick-insert/assets/action.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/code.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/custom-panel.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/date.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/decision.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/divider.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/emoji.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/expand.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/fallback.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/feedback.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/heading1.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/heading2.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/heading3.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/heading4.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/heading5.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/heading6.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/images.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/index.d.ts +0 -30
- package/dist/types/plugins/quick-insert/assets/layout.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/link.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/list-number.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/list.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/mention.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/panel-error.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/panel-note.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/panel-success.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/panel-warning.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/panel.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/quote.d.ts +0 -2
- package/dist/types/plugins/quick-insert/assets/status.d.ts +0 -2
- package/dist/types/ui/LinkSearch/LinkSearchList.d.ts +0 -20
- package/dist/types/ui/LinkSearch/LinkSearchListItem.d.ts +0 -22
- package/dist/types/ui/LinkSearch/ToolbarComponents.d.ts +0 -3
- package/dist/types/ui/LinkSearch/index.d.ts +0 -59
- package/dist/types/ui/LinkSearch/listItemAlts.d.ts +0 -2
- package/dist/types/ui/LinkSearch/transformTimeStamp.d.ts +0 -10
- package/dist/types/ui/LinkSearch/types.d.ts +0 -49
- package/dist/types/ui/LinkSearch/withActivityProvider.d.ts +0 -66
- package/dist/types/ui/PanelTextInput/index.d.ts +0 -46
- package/dist/types/ui/PanelTextInput/styles.d.ts +0 -2
- package/dist/types/utils/announcer/announcer.d.ts +0 -22
- package/dist/types-ts4.5/plugins/hyperlink/Toolbar.d.ts +0 -6
- package/dist/types-ts4.5/plugins/hyperlink/commands.d.ts +0 -17
- package/dist/types-ts4.5/plugins/hyperlink/index.d.ts +0 -24
- package/dist/types-ts4.5/plugins/hyperlink/pm-plugins/fake-curor-for-toolbar-plugin-key.d.ts +0 -2
- package/dist/types-ts4.5/plugins/hyperlink/pm-plugins/fake-cursor-for-toolbar.d.ts +0 -3
- package/dist/types-ts4.5/plugins/hyperlink/pm-plugins/input-rule.d.ts +0 -7
- package/dist/types-ts4.5/plugins/hyperlink/pm-plugins/keymap.d.ts +0 -3
- package/dist/types-ts4.5/plugins/hyperlink/pm-plugins/main.d.ts +0 -46
- package/dist/types-ts4.5/plugins/hyperlink/pm-plugins/toolbar-buttons.d.ts +0 -19
- package/dist/types-ts4.5/plugins/hyperlink/styles.d.ts +0 -6
- package/dist/types-ts4.5/plugins/hyperlink/ui/EditorLinkPicker/index.d.ts +0 -21
- package/dist/types-ts4.5/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.d.ts +0 -2
- package/dist/types-ts4.5/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +0 -109
- package/dist/types-ts4.5/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +0 -19
- package/dist/types-ts4.5/plugins/hyperlink/ui/HyperlinkAddToolbar/messages.d.ts +0 -32
- package/dist/types-ts4.5/plugins/hyperlink/ui/HyperlinkAddToolbar/utils.d.ts +0 -7
- package/dist/types-ts4.5/plugins/quick-insert/assets/action.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/code.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/custom-panel.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/date.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/decision.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/divider.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/emoji.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/expand.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/fallback.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/feedback.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/heading1.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/heading2.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/heading3.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/heading4.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/heading5.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/heading6.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/images.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/index.d.ts +0 -30
- package/dist/types-ts4.5/plugins/quick-insert/assets/layout.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/link.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/list-number.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/list.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/mention.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/panel-error.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/panel-note.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/panel-success.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/panel-warning.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/panel.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/quote.d.ts +0 -2
- package/dist/types-ts4.5/plugins/quick-insert/assets/status.d.ts +0 -2
- package/dist/types-ts4.5/ui/LinkSearch/LinkSearchList.d.ts +0 -20
- package/dist/types-ts4.5/ui/LinkSearch/LinkSearchListItem.d.ts +0 -22
- package/dist/types-ts4.5/ui/LinkSearch/ToolbarComponents.d.ts +0 -3
- package/dist/types-ts4.5/ui/LinkSearch/index.d.ts +0 -59
- package/dist/types-ts4.5/ui/LinkSearch/listItemAlts.d.ts +0 -2
- package/dist/types-ts4.5/ui/LinkSearch/transformTimeStamp.d.ts +0 -10
- package/dist/types-ts4.5/ui/LinkSearch/types.d.ts +0 -49
- package/dist/types-ts4.5/ui/LinkSearch/withActivityProvider.d.ts +0 -66
- package/dist/types-ts4.5/ui/PanelTextInput/index.d.ts +0 -46
- package/dist/types-ts4.5/ui/PanelTextInput/styles.d.ts +0 -2
- package/dist/types-ts4.5/utils/announcer/announcer.d.ts +0 -22
|
@@ -7,7 +7,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
7
7
|
import { borderRadius } from '@atlaskit/theme';
|
|
8
8
|
import { themed } from '@atlaskit/theme/components';
|
|
9
9
|
import { DN50, N0, N30A, N60A } from '@atlaskit/theme/colors';
|
|
10
|
-
import { IconCode, IconDate, IconDecision, IconDivider, IconExpand, IconPanel, IconQuote, IconStatus } from '
|
|
10
|
+
import { IconCode, IconDate, IconDecision, IconDivider, IconExpand, IconPanel, IconQuote, IconStatus } from '@atlaskit/editor-common/quick-insert';
|
|
11
11
|
import withOuterListeners from '../with-outer-listeners';
|
|
12
12
|
import WithPluginState from '../WithPluginState';
|
|
13
13
|
import { pluginKey } from '../../plugins/quick-insert/plugin-key';
|
|
@@ -10,7 +10,7 @@ import Tooltip from '@atlaskit/tooltip';
|
|
|
10
10
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
11
11
|
import { withAnalyticsContext } from '@atlaskit/analytics-next';
|
|
12
12
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
13
|
-
import IconFallback from '
|
|
13
|
+
import { IconFallback } from '@atlaskit/editor-common/quick-insert';
|
|
14
14
|
import { itemIcon } from '../../../../plugins/type-ahead/ui/TypeAheadListItem';
|
|
15
15
|
import { shortcutStyle } from '../../../styles';
|
|
16
16
|
import { ELEMENT_LIST_PADDING, SCROLLBAR_WIDTH } from '../../constants';
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
export function findUniqueItemsIn(findIn, checkWith, comparator) {
|
|
2
2
|
return findIn.filter(firstItem => checkWith.findIndex(secondItem => comparator ? comparator(firstItem, secondItem) : firstItem === secondItem) === -1);
|
|
3
|
-
}
|
|
4
|
-
export function filterUniqueItems(arr, comparator) {
|
|
5
|
-
return arr.filter((firstItem, index, self) => {
|
|
6
|
-
return self.findIndex(secondItem => comparator ? comparator(firstItem, secondItem) : firstItem === secondItem) === index;
|
|
7
|
-
});
|
|
8
3
|
}
|
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
import { TextSelection, NodeSelection } from 'prosemirror-state';
|
|
2
2
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
3
3
|
import { transformSmartCharsMentionsAndEmojis } from '../plugins/text-formatting/commands/transform-to-code';
|
|
4
|
-
import { GapCursorSelection } from '
|
|
4
|
+
import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
5
5
|
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
6
|
-
const filter = (predicates, cmd) => {
|
|
7
|
-
return function (state, dispatch, view) {
|
|
8
|
-
if (!Array.isArray(predicates)) {
|
|
9
|
-
predicates = [predicates];
|
|
10
|
-
}
|
|
11
|
-
if (predicates.some(pred => !pred(state, view))) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
return cmd(state, dispatch, view) || false;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
6
|
const isEmptySelectionAtStart = state => {
|
|
18
7
|
const {
|
|
19
8
|
empty,
|
|
@@ -294,4 +283,4 @@ const deleteEmptyParagraphAndMoveBlockUp = canNextNodeMoveUp => {
|
|
|
294
283
|
return false;
|
|
295
284
|
};
|
|
296
285
|
};
|
|
297
|
-
export {
|
|
286
|
+
export { isEmptySelectionAtStart, isEmptySelectionAtEnd, isFirstChildOfParent, isNthParentOfType, findCutBefore, toggleMark, applyMarkOnRange, withScrollIntoView, walkNextNode, walkPrevNode, insertContentDeleteRange, selectNode, deleteEmptyParagraphAndMoveBlockUp };
|
|
@@ -365,11 +365,6 @@ export function pipe(...fns) {
|
|
|
365
365
|
}
|
|
366
366
|
return fns.reduce((prevFn, nextFn) => (...args) => nextFn(prevFn(...args)));
|
|
367
367
|
}
|
|
368
|
-
export function shallowEqual(obj1 = {}, obj2 = {}) {
|
|
369
|
-
const keys1 = Object.keys(obj1);
|
|
370
|
-
const keys2 = Object.keys(obj2);
|
|
371
|
-
return keys1.length === keys2.length && keys1.reduce((acc, key) => acc && obj1[key] === obj2[key], true);
|
|
372
|
-
}
|
|
373
368
|
export function sum(arr, f) {
|
|
374
369
|
return arr.reduce((val, x) => val + f(x), 0);
|
|
375
370
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { TextSelection } from 'prosemirror-state';
|
|
2
1
|
import { canJoin, findWrapping } from 'prosemirror-transform';
|
|
3
|
-
import {
|
|
4
|
-
import { createInputRulePlugin } from '@atlaskit/prosemirror-input-rules';
|
|
2
|
+
import { createRule } from '@atlaskit/prosemirror-input-rules';
|
|
5
3
|
import { addAnalytics } from '../plugins/analytics';
|
|
6
4
|
import { JOIN_SCENARIOS_WHEN_TYPING_TO_INSERT_LIST } from '@atlaskit/editor-common/analytics';
|
|
7
|
-
import { closeHistory } from 'prosemirror-history';
|
|
8
5
|
export const ruleWithAnalytics = getPayload => {
|
|
9
6
|
return originalRule => {
|
|
10
7
|
const onHandlerApply = (state, tr, matchResult) => {
|
|
@@ -20,40 +17,6 @@ export const ruleWithAnalytics = getPayload => {
|
|
|
20
17
|
};
|
|
21
18
|
};
|
|
22
19
|
};
|
|
23
|
-
export const createRule = (match, handler) => {
|
|
24
|
-
return {
|
|
25
|
-
match,
|
|
26
|
-
handler,
|
|
27
|
-
onHandlerApply: (state, tr) => {
|
|
28
|
-
closeHistory(tr);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
export const createPlugin = (pluginName, rules, options = {}) => {
|
|
33
|
-
const {
|
|
34
|
-
isBlockNodeRule = false,
|
|
35
|
-
allowInsertTextOnDocument = true
|
|
36
|
-
} = options;
|
|
37
|
-
const onInputEvent = ({
|
|
38
|
-
state,
|
|
39
|
-
from,
|
|
40
|
-
to
|
|
41
|
-
}) => {
|
|
42
|
-
const unsupportedMarks = isBlockNodeRule ? ['code', 'link', 'typeAheadQuery'] : ['code'];
|
|
43
|
-
const $from = state.selection.$from;
|
|
44
|
-
if ($from.parent.type.spec.code || !(state.selection instanceof TextSelection) && !(state.selection instanceof GapCursorSelection) || hasUnsupportedMarks(state, from, to, unsupportedMarks) || isBlockNodeRule && isCursorInsideUnsupportedMarks(state, unsupportedMarks)) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
return true;
|
|
48
|
-
};
|
|
49
|
-
return createInputRulePlugin(pluginName, rules, {
|
|
50
|
-
allowInsertTextOnDocument,
|
|
51
|
-
onInputEvent,
|
|
52
|
-
onBeforeRegexMatch: tr => {
|
|
53
|
-
closeHistory(tr);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
20
|
export const createWrappingTextBlockRule = ({
|
|
58
21
|
match,
|
|
59
22
|
nodeType,
|
|
@@ -111,25 +74,4 @@ export const createJoinNodesRule = (match, nodeType) => {
|
|
|
111
74
|
getAttrs: {},
|
|
112
75
|
joinPredicate: (_, node) => node.type === nodeType
|
|
113
76
|
});
|
|
114
|
-
};
|
|
115
|
-
const hasUnsupportedMarks = (state, start, end, marksNameUnsupported) => {
|
|
116
|
-
const isUnsupportedMark = node => (marksNameUnsupported || []).includes(node.type.name);
|
|
117
|
-
const $from = state.doc.resolve(start);
|
|
118
|
-
const $to = state.doc.resolve(end);
|
|
119
|
-
const marksInSelection = start === end ? $from.marks() : $from.marksAcross($to);
|
|
120
|
-
return (marksInSelection || []).some(isUnsupportedMark);
|
|
121
|
-
};
|
|
122
|
-
const isCursorInsideUnsupportedMarks = (state, marksNameUnsupported) => {
|
|
123
|
-
var _$cursor$nodeBefore, _$cursor$nodeBefore$m;
|
|
124
|
-
const {
|
|
125
|
-
selection
|
|
126
|
-
} = state;
|
|
127
|
-
if (!(selection instanceof TextSelection)) {
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
const {
|
|
131
|
-
$cursor
|
|
132
|
-
} = selection;
|
|
133
|
-
const isUnsupportedMark = node => marksNameUnsupported.includes(node.type.name);
|
|
134
|
-
return Boolean($cursor === null || $cursor === void 0 ? void 0 : (_$cursor$nodeBefore = $cursor.nodeBefore) === null || _$cursor$nodeBefore === void 0 ? void 0 : (_$cursor$nodeBefore$m = _$cursor$nodeBefore.marks) === null || _$cursor$nodeBefore$m === void 0 ? void 0 : _$cursor$nodeBefore$m.some(isUnsupportedMark));
|
|
135
77
|
};
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -22,7 +22,7 @@ export { textColorPluginKey } from './plugins/text-color';
|
|
|
22
22
|
export { changeColor } from './plugins/text-color/commands/change-color';
|
|
23
23
|
export { insertHorizontalRule } from './plugins/rule/commands';
|
|
24
24
|
export { blockPluginStateKey } from './plugins';
|
|
25
|
-
export { InsertStatus as HyperlinkInsertStatus
|
|
25
|
+
export { InsertStatus as HyperlinkInsertStatus } from '@atlaskit/editor-common/link';
|
|
26
26
|
export { pluginKey as listStateKey } from './plugins/list/pm-plugins/main';
|
|
27
27
|
export { toggleSuperscript, toggleSuperscriptWithAnalytics, toggleSubscript, toggleSubscriptWithAnalytics, toggleStrike, toggleStrikeWithAnalytics, toggleCode, toggleCodeWithAnalytics, toggleUnderline, toggleUnderlineWithAnalytics, toggleEm, toggleEmWithAnalytics, toggleStrong, toggleStrongWithAnalytics } from './plugins/text-formatting/commands/text-formatting';
|
|
28
28
|
export { subscribeToToolbarAndPickerUpdates } from './plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates';
|
|
@@ -38,9 +38,20 @@ export { pluginKey as datePluginKey } from './plugins/date/pm-plugins/plugin-key
|
|
|
38
38
|
export { commitStatusPicker, setStatusPickerAt, updateStatus, updateStatusWithAnalytics, removeStatus } from './plugins/status/actions';
|
|
39
39
|
export { typeAheadPluginKey } from './plugins/type-ahead';
|
|
40
40
|
export { pluginKey as quickInsertPluginKey, memoProcessItems as processQuickInsertItems } from './plugins/quick-insert';
|
|
41
|
-
export { insertLink, insertLinkWithAnalyticsMobileNative, insertLinkWithAnalytics,
|
|
41
|
+
export { insertLink, insertLinkWithAnalyticsMobileNative, insertLinkWithAnalytics, updateLink, stateKey as hyperlinkStateKey } from './plugins/deprecated-hyperlink/commands';
|
|
42
|
+
export {
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated
|
|
45
|
+
* Please use the export from '@atlaskit/editor-common/link`
|
|
46
|
+
*/
|
|
47
|
+
isTextAtPos,
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated
|
|
50
|
+
* Please use the export from '@atlaskit/editor-common/link`
|
|
51
|
+
*/
|
|
52
|
+
isLinkAtPos } from '@atlaskit/editor-common/link';
|
|
42
53
|
export { historyPluginKey } from './plugins/history';
|
|
43
|
-
export { INPUT_METHOD, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '
|
|
54
|
+
export { INPUT_METHOD, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
44
55
|
export { setKeyboardHeight, setMobilePaddingTop, setIsExpanded } from './plugins/mobile-dimensions/commands';
|
|
45
56
|
|
|
46
57
|
// Used in editor-test-helpers and mobile bridge
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import pastePlugin from '../../../plugins/paste';
|
|
4
4
|
import blockTypePlugin from '../../../plugins/block-type';
|
|
5
5
|
import clearMarksOnChangeToEmptyDocumentPlugin from '../../../plugins/clear-marks-on-change-to-empty-document';
|
|
6
|
-
import hyperlinkPlugin from '
|
|
6
|
+
import { hyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
|
|
7
7
|
import textFormattingPlugin from '../../../plugins/text-formatting';
|
|
8
8
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
9
9
|
import unsupportedContentPlugin from '../../../plugins/unsupported-content';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TextSelection } from 'prosemirror-state';
|
|
2
2
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
3
|
-
import { ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, ACTION, INPUT_METHOD } from '
|
|
3
|
+
import { ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, ACTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { addAnalytics } from '../../analytics/utils';
|
|
5
5
|
import { getSelectionPositions, getPluginState, getDraftCommandAnalyticsPayload } from '../utils';
|
|
6
6
|
import { applyMarkOnRange } from '../../../utils/commands';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from 'prosemirror-state';
|
|
3
3
|
import { keydownHandler } from 'prosemirror-keymap';
|
|
4
|
-
import { filter } from '
|
|
4
|
+
import { filterCommands as filter } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { isSelectionEndOfParagraph } from '../../../utils';
|
|
6
6
|
export var newlinePreserveMarksKey = new PluginKey('newlinePreserveMarksPlugin');
|
|
7
7
|
var isSelectionAligned = function isSelectionAligned(state) {
|
|
@@ -9,7 +9,7 @@ import WithPluginState from '../../ui/WithPluginState';
|
|
|
9
9
|
import { setBlockTypeWithAnalytics } from './commands';
|
|
10
10
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
11
11
|
import * as keymaps from '../../keymaps';
|
|
12
|
-
import { IconHeading, IconQuote } from '
|
|
12
|
+
import { IconHeading, IconQuote } from '@atlaskit/editor-common/quick-insert';
|
|
13
13
|
import { messages } from './messages';
|
|
14
14
|
import { ToolbarSize } from '../../ui/Toolbar/types';
|
|
15
15
|
var headingPluginOptions = function headingPluginOptions(_ref, isAllowed, editorAnalyticsApi) {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import {
|
|
2
|
+
import { createJoinNodesRule, createWrappingTextBlockRule, ruleWithAnalytics } from '../../../utils/input-rules';
|
|
3
|
+
import { createRule, createPlugin } from '@atlaskit/prosemirror-input-rules';
|
|
3
4
|
import { leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
|
|
4
5
|
import { isConvertableToCodeBlock, transformToCodeBlockAction } from '../commands/transform-to-code-block';
|
|
5
6
|
import { insertBlock } from '../commands/insert-block';
|
|
6
7
|
import { safeInsert } from 'prosemirror-utils';
|
|
7
|
-
import { INPUT_METHOD, ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '
|
|
8
|
+
import { INPUT_METHOD, ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
8
9
|
var MAX_HEADING_LEVEL = 6;
|
|
9
10
|
function getHeadingLevel(match) {
|
|
10
11
|
return {
|
|
@@ -7,7 +7,7 @@ import { browser } from '@atlaskit/editor-common/utils';
|
|
|
7
7
|
import { NORMAL_TEXT, HEADING_1, HEADING_2, HEADING_3, HEADING_4, HEADING_5, HEADING_6, BLOCK_QUOTE, CODE_BLOCK, PANEL, OTHER, TEXT_BLOCK_TYPES, WRAPPER_BLOCK_TYPES, HEADINGS_BY_LEVEL } from '../types';
|
|
8
8
|
import { areBlockTypesDisabled } from '../../../utils';
|
|
9
9
|
import { setHeadingWithAnalytics, setNormalTextWithAnalytics } from '../commands';
|
|
10
|
-
import { INPUT_METHOD } from '
|
|
10
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
11
11
|
import { HEADING_KEYS } from '../../../keymaps/consts';
|
|
12
12
|
var blockTypeForNode = function blockTypeForNode(node, schema) {
|
|
13
13
|
if (node.type === schema.nodes.heading) {
|
|
@@ -29,6 +29,7 @@ export var mountHyperlinkPlugin = function mountHyperlinkPlugin(pluginInjectionA
|
|
|
29
29
|
}];
|
|
30
30
|
},
|
|
31
31
|
onEscapeCallback: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.card.actions.hideLinkToolbar,
|
|
32
|
+
onInsertLinkCallback: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.card.actions.queueCardsFromChangedTr,
|
|
32
33
|
view: editorView
|
|
33
34
|
});
|
|
34
35
|
});
|
|
@@ -10,7 +10,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { withOuterListeners } from '@atlaskit/editor-common/ui';
|
|
12
12
|
import { commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
13
|
-
import HyperlinkToolbar from '
|
|
13
|
+
import { HyperlinkAddToolbar as HyperlinkToolbar } from '@atlaskit/editor-common/link';
|
|
14
14
|
import { showLinkToolbar, hideLinkToolbar as _hideLinkToolbar, showDatasourceModal } from '../pm-plugins/actions';
|
|
15
15
|
import { INPUT_METHOD, ACTION, buildEditLinkPayload } from '@atlaskit/editor-common/analytics';
|
|
16
16
|
import { LINKPICKER_HEIGHT_IN_PX, RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDTH_IN_PX } from '@atlaskit/editor-common/ui';
|
|
@@ -19,7 +19,41 @@ import { findCardInfo, displayInfoForCard } from '../utils';
|
|
|
19
19
|
import { NodeSelection } from 'prosemirror-state';
|
|
20
20
|
import { linkToolbarMessages } from '@atlaskit/editor-common/messages';
|
|
21
21
|
import { DatasourceModal } from './DatasourceModal';
|
|
22
|
-
|
|
22
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
23
|
+
var HyperLinkToolbarWithListeners = withOuterListeners(HyperlinkAddToolbarWithState);
|
|
24
|
+
export function HyperlinkAddToolbarWithState(_ref) {
|
|
25
|
+
var _ref$linkPickerOption = _ref.linkPickerOptions,
|
|
26
|
+
linkPickerOptions = _ref$linkPickerOption === void 0 ? {} : _ref$linkPickerOption,
|
|
27
|
+
onSubmit = _ref.onSubmit,
|
|
28
|
+
displayText = _ref.displayText,
|
|
29
|
+
displayUrl = _ref.displayUrl,
|
|
30
|
+
providerFactory = _ref.providerFactory,
|
|
31
|
+
view = _ref.view,
|
|
32
|
+
onCancel = _ref.onCancel,
|
|
33
|
+
invokeMethod = _ref.invokeMethod,
|
|
34
|
+
featureFlags = _ref.featureFlags,
|
|
35
|
+
onClose = _ref.onClose,
|
|
36
|
+
onEscapeCallback = _ref.onEscapeCallback,
|
|
37
|
+
onClickAwayCallback = _ref.onClickAwayCallback,
|
|
38
|
+
pluginInjectionApi = _ref.pluginInjectionApi;
|
|
39
|
+
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['hyperlink']),
|
|
40
|
+
hyperlinkState = _useSharedPluginState.hyperlinkState;
|
|
41
|
+
return /*#__PURE__*/React.createElement(HyperlinkToolbar, {
|
|
42
|
+
linkPickerOptions: linkPickerOptions,
|
|
43
|
+
onSubmit: onSubmit,
|
|
44
|
+
displayText: displayText,
|
|
45
|
+
displayUrl: displayUrl,
|
|
46
|
+
providerFactory: providerFactory,
|
|
47
|
+
view: view,
|
|
48
|
+
onCancel: onCancel,
|
|
49
|
+
invokeMethod: invokeMethod,
|
|
50
|
+
featureFlags: featureFlags,
|
|
51
|
+
onClose: onClose,
|
|
52
|
+
onEscapeCallback: onEscapeCallback,
|
|
53
|
+
onClickAwayCallback: onClickAwayCallback,
|
|
54
|
+
hyperlinkPluginState: hyperlinkState
|
|
55
|
+
});
|
|
56
|
+
}
|
|
23
57
|
export var EditLinkToolbar = /*#__PURE__*/function (_React$Component) {
|
|
24
58
|
_inherits(EditLinkToolbar, _React$Component);
|
|
25
59
|
var _super = _createSuper(EditLinkToolbar);
|
|
@@ -68,8 +102,10 @@ export var EditLinkToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
68
102
|
text = _this$props2.text,
|
|
69
103
|
view = _this$props2.view,
|
|
70
104
|
featureFlags = _this$props2.featureFlags,
|
|
71
|
-
_onSubmit = _this$props2.onSubmit
|
|
105
|
+
_onSubmit = _this$props2.onSubmit,
|
|
106
|
+
pluginInjectionApi = _this$props2.pluginInjectionApi;
|
|
72
107
|
return /*#__PURE__*/React.createElement(HyperLinkToolbarWithListeners, {
|
|
108
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
73
109
|
view: view,
|
|
74
110
|
linkPickerOptions: linkPickerOptions,
|
|
75
111
|
providerFactory: providerFactory,
|
|
@@ -86,6 +122,25 @@ export var EditLinkToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
86
122
|
if (_onSubmit) {
|
|
87
123
|
_onSubmit(href, displayText || title, inputMethod, analytic);
|
|
88
124
|
}
|
|
125
|
+
},
|
|
126
|
+
onEscapeCallback: function onEscapeCallback(state, dispatch) {
|
|
127
|
+
var tr = state.tr;
|
|
128
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.hyperlink.actions.hideLinkToolbar(tr);
|
|
129
|
+
_hideLinkToolbar(tr);
|
|
130
|
+
if (dispatch) {
|
|
131
|
+
dispatch(tr);
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
return false;
|
|
135
|
+
},
|
|
136
|
+
onClickAwayCallback: function onClickAwayCallback(state, dispatch) {
|
|
137
|
+
var tr = state.tr;
|
|
138
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.hyperlink.actions.hideLinkToolbar(tr);
|
|
139
|
+
if (dispatch) {
|
|
140
|
+
dispatch(tr);
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
return false;
|
|
89
144
|
}
|
|
90
145
|
});
|
|
91
146
|
}
|
|
@@ -108,12 +163,12 @@ export var editLink = function editLink(editorAnalyticsApi) {
|
|
|
108
163
|
return false;
|
|
109
164
|
};
|
|
110
165
|
};
|
|
111
|
-
export var buildEditLinkToolbar = function buildEditLinkToolbar(
|
|
112
|
-
var providerFactory =
|
|
113
|
-
node =
|
|
114
|
-
linkPicker =
|
|
115
|
-
featureFlags =
|
|
116
|
-
pluginInjectionApi =
|
|
166
|
+
export var buildEditLinkToolbar = function buildEditLinkToolbar(_ref2) {
|
|
167
|
+
var providerFactory = _ref2.providerFactory,
|
|
168
|
+
node = _ref2.node,
|
|
169
|
+
linkPicker = _ref2.linkPicker,
|
|
170
|
+
featureFlags = _ref2.featureFlags,
|
|
171
|
+
pluginInjectionApi = _ref2.pluginInjectionApi;
|
|
117
172
|
return {
|
|
118
173
|
type: 'custom',
|
|
119
174
|
disableArrowNavigation: true,
|
|
@@ -125,6 +180,7 @@ export var buildEditLinkToolbar = function buildEditLinkToolbar(_ref) {
|
|
|
125
180
|
}
|
|
126
181
|
var displayInfo = displayInfoForCard(node, findCardInfo(view.state));
|
|
127
182
|
return /*#__PURE__*/React.createElement(EditLinkToolbar, {
|
|
183
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
128
184
|
key: idx,
|
|
129
185
|
view: view,
|
|
130
186
|
linkPickerOptions: linkPicker,
|
|
@@ -183,10 +239,10 @@ export var editDatasource = function editDatasource(editorAnalyticsApi) {
|
|
|
183
239
|
return false;
|
|
184
240
|
};
|
|
185
241
|
};
|
|
186
|
-
export var openDatasourceModal = function openDatasourceModal(
|
|
187
|
-
var state =
|
|
188
|
-
node =
|
|
189
|
-
editorAnalyticsApi =
|
|
242
|
+
export var openDatasourceModal = function openDatasourceModal(_ref3) {
|
|
243
|
+
var state = _ref3.state,
|
|
244
|
+
node = _ref3.node,
|
|
245
|
+
editorAnalyticsApi = _ref3.editorAnalyticsApi;
|
|
190
246
|
return {
|
|
191
247
|
type: 'custom',
|
|
192
248
|
disableArrowNavigation: true,
|
|
@@ -9,7 +9,7 @@ import keymap from './pm-plugins/keymaps';
|
|
|
9
9
|
import ideUX from './pm-plugins/ide-ux';
|
|
10
10
|
import { codeBlockCopySelectionPlugin } from './pm-plugins/codeBlockCopySelectionPlugin';
|
|
11
11
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
12
|
-
import { IconCode } from '
|
|
12
|
+
import { IconCode } from '@atlaskit/editor-common/quick-insert';
|
|
13
13
|
import { messages } from '../block-type/messages';
|
|
14
14
|
import refreshBrowserSelectionOnChange from './refresh-browser-selection';
|
|
15
15
|
// Theres an existing interelationship between these files, where the imported function is being called for code-block
|
|
@@ -3,7 +3,7 @@ import { TextSelection } from 'prosemirror-state';
|
|
|
3
3
|
import { keydownHandler } from 'prosemirror-keymap';
|
|
4
4
|
import { setTextSelection } from 'prosemirror-utils';
|
|
5
5
|
import { getCursor } from '../../../utils';
|
|
6
|
-
import { filter } from '
|
|
6
|
+
import { filterCommands as filter } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { isCursorBeforeClosingCharacter, isClosingCharacter } from '../ide-ux/paired-character-handling';
|
|
8
8
|
import { getAutoClosingBracketInfo, shouldAutoCloseBracket } from '../ide-ux/bracket-handling';
|
|
9
9
|
import { getAutoClosingQuoteInfo, shouldAutoCloseQuote } from '../ide-ux/quote-handling';
|
|
@@ -5,7 +5,7 @@ import { date } from '@atlaskit/adf-schema';
|
|
|
5
5
|
import { insertDate, closeDatePicker as _closeDatePicker, closeDatePickerWithAnalytics as _closeDatePickerWithAnalytics, createDate, deleteDate } from './actions';
|
|
6
6
|
import createDatePlugin from './pm-plugins/main';
|
|
7
7
|
import keymap from './pm-plugins/keymap';
|
|
8
|
-
import { IconDate } from '
|
|
8
|
+
import { IconDate } from '@atlaskit/editor-common/quick-insert';
|
|
9
9
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
11
11
|
import { pluginKey as datePluginKey } from './pm-plugins/plugin-key';
|
|
@@ -1,57 +1,35 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
import { addLinkMetadata
|
|
4
|
+
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
5
5
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { isTextAtPos, LinkAction } from '@atlaskit/editor-common/link';
|
|
7
|
+
import { getLinkCreationAnalyticsEvent, normalizeUrl } from '@atlaskit/editor-common/utils';
|
|
8
8
|
import { Selection } from 'prosemirror-state';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE, ACTION_SUBJECT_ID, buildEditLinkPayload, unlinkPayload } from '@atlaskit/editor-common/analytics';
|
|
9
|
+
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
10
|
+
import { withAnalytics } from '../analytics';
|
|
12
11
|
import { queueCardsFromChangedTr } from '../card/pm-plugins/doc';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
var rightBound = to && pos !== to ? to : pos - $pos.textOffset + node.nodeSize;
|
|
36
|
-
var tr = state.tr.removeMark(pos, rightBound, linkMark);
|
|
37
|
-
if (href.trim()) {
|
|
38
|
-
tr.addMark(pos, rightBound, linkMark.create(_objectSpread(_objectSpread({}, mark && mark.attrs || {}), {}, {
|
|
39
|
-
href: url
|
|
40
|
-
})));
|
|
41
|
-
} else {
|
|
42
|
-
addAnalytics(state, tr, unlinkPayload(ACTION_SUBJECT_ID.HYPERLINK));
|
|
43
|
-
}
|
|
44
|
-
if (!isTabPressed) {
|
|
45
|
-
tr.setMeta(stateKey, {
|
|
46
|
-
type: LinkAction.HIDE_TOOLBAR
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
if (dispatch) {
|
|
50
|
-
dispatch(tr);
|
|
51
|
-
}
|
|
52
|
-
return true;
|
|
53
|
-
});
|
|
54
|
-
}
|
|
12
|
+
// TODO: ED-17836 This workaround is used since we extracted the hyperlink plugin.
|
|
13
|
+
// As soon as we deprecate the plugin we can delete this code.
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated
|
|
16
|
+
* Please do not use this key anymore it will be removed soon.
|
|
17
|
+
* Using plugin keys is a deprecated approach and if you need
|
|
18
|
+
* to access state use the Preset API in EditorNext.
|
|
19
|
+
*/
|
|
20
|
+
export var stateKey = {
|
|
21
|
+
key: 'hyperlinkPlugin$',
|
|
22
|
+
getState: function getState(state) {
|
|
23
|
+
return state['hyperlinkPlugin$'];
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated
|
|
29
|
+
* Please do not use this function anymore it will be removed soon.
|
|
30
|
+
* If you need to update the link please do it through the Preset
|
|
31
|
+
* API in EditorNext.
|
|
32
|
+
*/
|
|
55
33
|
export function updateLink(href, text, pos, to) {
|
|
56
34
|
return function (state, dispatch) {
|
|
57
35
|
var $pos = state.doc.resolve(pos);
|
|
@@ -86,6 +64,13 @@ export function updateLink(href, text, pos, to) {
|
|
|
86
64
|
return true;
|
|
87
65
|
};
|
|
88
66
|
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated
|
|
70
|
+
* Please do not use this function anymore it will be removed soon.
|
|
71
|
+
* If you need to insert link please do it through the Preset
|
|
72
|
+
* API in EditorNext.
|
|
73
|
+
*/
|
|
89
74
|
export function insertLink(from, to, incomingHref, incomingTitle, displayText, source, sourceEvent) {
|
|
90
75
|
return function (state, dispatch) {
|
|
91
76
|
var link = state.schema.marks.link;
|
|
@@ -139,6 +124,13 @@ export function insertLink(from, to, incomingHref, incomingTitle, displayText, s
|
|
|
139
124
|
return false;
|
|
140
125
|
};
|
|
141
126
|
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @deprecated
|
|
130
|
+
* Please do not use this function anymore it will be removed soon.
|
|
131
|
+
* If you need to insert link please do it through the Preset
|
|
132
|
+
* API in EditorNext.
|
|
133
|
+
*/
|
|
142
134
|
export var insertLinkWithAnalytics = function insertLinkWithAnalytics(inputMethod, from, to, href, title, displayText) {
|
|
143
135
|
var cardsAvailable = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
144
136
|
var sourceEvent = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : undefined;
|
|
@@ -148,57 +140,13 @@ export var insertLinkWithAnalytics = function insertLinkWithAnalytics(inputMetho
|
|
|
148
140
|
}
|
|
149
141
|
return withAnalytics(getLinkCreationAnalyticsEvent(inputMethod, href))(insertLink(from, to, href, title, displayText, inputMethod, sourceEvent));
|
|
150
142
|
};
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* @deprecated
|
|
146
|
+
* Please do not use this function anymore it will be removed soon.
|
|
147
|
+
* If you need to insert link please do it through the Preset
|
|
148
|
+
* API in EditorNext.
|
|
149
|
+
*/
|
|
151
150
|
export var insertLinkWithAnalyticsMobileNative = function insertLinkWithAnalyticsMobileNative(inputMethod, from, to, href, title, displayText) {
|
|
152
151
|
return withAnalytics(getLinkCreationAnalyticsEvent(inputMethod, href))(insertLink(from, to, href, title, displayText, inputMethod));
|
|
153
|
-
};
|
|
154
|
-
export function removeLink(pos) {
|
|
155
|
-
return commandWithMetadata(setLinkHref('', pos), {
|
|
156
|
-
action: ACTION.UNLINK
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
export function editInsertedLink() {
|
|
160
|
-
return function (state, dispatch) {
|
|
161
|
-
if (dispatch) {
|
|
162
|
-
dispatch(addAnalytics(state, state.tr.setMeta(stateKey, {
|
|
163
|
-
type: LinkAction.EDIT_INSERTED_TOOLBAR,
|
|
164
|
-
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
165
|
-
}), buildEditLinkPayload(ACTION_SUBJECT_ID.HYPERLINK)));
|
|
166
|
-
}
|
|
167
|
-
return true;
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
export function showLinkToolbar() {
|
|
171
|
-
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : INPUT_METHOD.TOOLBAR;
|
|
172
|
-
return function (state, dispatch) {
|
|
173
|
-
if (dispatch) {
|
|
174
|
-
var tr = state.tr.setMeta(stateKey, {
|
|
175
|
-
type: LinkAction.SHOW_INSERT_TOOLBAR,
|
|
176
|
-
inputMethod: inputMethod
|
|
177
|
-
});
|
|
178
|
-
tr = addAnalytics(state, tr, {
|
|
179
|
-
action: ACTION.INVOKED,
|
|
180
|
-
actionSubject: ACTION_SUBJECT.TYPEAHEAD,
|
|
181
|
-
actionSubjectId: ACTION_SUBJECT_ID.TYPEAHEAD_LINK,
|
|
182
|
-
attributes: {
|
|
183
|
-
inputMethod: inputMethod
|
|
184
|
-
},
|
|
185
|
-
eventType: EVENT_TYPE.UI
|
|
186
|
-
});
|
|
187
|
-
dispatch(tr);
|
|
188
|
-
}
|
|
189
|
-
return true;
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
export function hideLinkToolbar() {
|
|
193
|
-
return function (state, dispatch) {
|
|
194
|
-
if (dispatch) {
|
|
195
|
-
dispatch(hideLinkToolbarSetMeta(state.tr));
|
|
196
|
-
}
|
|
197
|
-
return true;
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
export function hideLinkToolbarSetMeta(tr) {
|
|
201
|
-
return tr.setMeta(stateKey, {
|
|
202
|
-
type: LinkAction.HIDE_TOOLBAR
|
|
203
|
-
});
|
|
204
|
-
}
|
|
152
|
+
};
|
|
@@ -11,7 +11,7 @@ import { EmojiTypeAheadItem, SearchSort, recordSelectionSucceededSli, recordSele
|
|
|
11
11
|
import { getInlineNodeViewProducer } from '@atlaskit/editor-common/react-node-view';
|
|
12
12
|
import { inputRulePlugin as asciiInputRulePlugin } from './pm-plugins/ascii-input-rules';
|
|
13
13
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
14
|
-
import { IconEmoji } from '
|
|
14
|
+
import { IconEmoji } from '@atlaskit/editor-common/quick-insert';
|
|
15
15
|
import { EmojiNodeView } from './nodeviews/emoji';
|
|
16
16
|
import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
17
17
|
import { openTypeAheadAtCursor } from '../type-ahead/transforms/open-typeahead-at-cursor';
|
|
@@ -8,7 +8,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
8
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
10
|
import { PluginKey } from 'prosemirror-state';
|
|
11
|
-
import { createRule, createPlugin } from '
|
|
11
|
+
import { createRule, createPlugin } from '@atlaskit/prosemirror-input-rules';
|
|
12
12
|
import { leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
|
|
13
13
|
import { addAnalytics, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD, EVENT_TYPE } from '../../analytics';
|
|
14
14
|
var matcher;
|