@atlaskit/editor-core 185.14.2 → 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 +18 -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/commands.js +1 -1
- package/dist/cjs/plugins/image-upload/pm-plugins/input-rule.js +3 -3
- package/dist/cjs/plugins/image-upload/pm-plugins/main.js +56 -28
- 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/clipboard.js +7 -1
- package/dist/cjs/utils/commands.js +5 -19
- package/dist/cjs/utils/drag-drop.js +6 -0
- 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/commands.js +1 -1
- package/dist/es2019/plugins/image-upload/pm-plugins/input-rule.js +1 -1
- package/dist/es2019/plugins/image-upload/pm-plugins/main.js +54 -28
- 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/clipboard.js +3 -0
- package/dist/es2019/utils/commands.js +2 -13
- package/dist/es2019/utils/drag-drop.js +2 -0
- 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/commands.js +1 -1
- package/dist/esm/plugins/image-upload/pm-plugins/input-rule.js +1 -1
- package/dist/esm/plugins/image-upload/pm-plugins/main.js +58 -31
- 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/clipboard.js +5 -0
- package/dist/esm/utils/commands.js +2 -15
- package/dist/esm/utils/drag-drop.js +4 -0
- 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/create-editor/get-plugins.d.ts +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/image-upload/pm-plugins/actions.d.ts +2 -1
- package/dist/types/plugins/image-upload/pm-plugins/commands.d.ts +3 -2
- package/dist/types/plugins/image-upload/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/image-upload/types.d.ts +3 -2
- 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 +3 -5
- package/dist/types/plugins/list/pm-plugins/input-rules/index.d.ts +1 -1
- package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +2 -2
- 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/clipboard.d.ts +1 -0
- package/dist/types/utils/commands.d.ts +2 -5
- package/dist/types/utils/drag-drop.d.ts +1 -0
- package/dist/types/utils/index.d.ts +0 -1
- package/dist/types/utils/input-rules.d.ts +1 -8
- package/dist/types-ts4.5/create-editor/get-plugins.d.ts +1 -1
- 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/image-upload/pm-plugins/actions.d.ts +2 -1
- package/dist/types-ts4.5/plugins/image-upload/pm-plugins/commands.d.ts +3 -2
- package/dist/types-ts4.5/plugins/image-upload/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/plugins/image-upload/types.d.ts +3 -2
- 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 +3 -5
- package/dist/types-ts4.5/plugins/list/pm-plugins/input-rules/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaSingle.d.ts +2 -2
- 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/clipboard.d.ts +1 -0
- package/dist/types-ts4.5/utils/commands.d.ts +2 -5
- package/dist/types-ts4.5/utils/drag-drop.d.ts +1 -0
- 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 +16 -73
- 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
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.panelTextInputWithCustomWidth = exports.panelTextInput = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _react = require("@emotion/react");
|
|
10
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
11
|
-
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
12
|
-
var _templateObject, _templateObject2;
|
|
13
|
-
// Normal .className gets overridden by input[type=text] hence this hack to produce input.className
|
|
14
|
-
var panelTextInput = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n input& {\n background: transparent;\n border: 0;\n border-radius: 0;\n box-sizing: content-box;\n color: ", ";\n flex-grow: 1;\n font-size: ", ";\n line-height: 20px;\n padding: 0;\n min-width: 145px;\n\n /* Hides IE10+ built-in [x] clear input button */\n &::-ms-clear {\n display: none;\n }\n\n &:focus {\n outline: none;\n }\n\n &::placeholder {\n color: ", ";\n }\n }\n"])), "var(--ds-text-subtle, ".concat(_colors.N400, ")"), (0, _editorSharedStyles.relativeFontSizeToBase16)(13), "var(--ds-text-subtlest, ".concat(_colors.N100, ")"));
|
|
15
|
-
exports.panelTextInput = panelTextInput;
|
|
16
|
-
var panelTextInputWithCustomWidth = function panelTextInputWithCustomWidth(width) {
|
|
17
|
-
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n input& {\n width: ", "px;\n }\n"])), width);
|
|
18
|
-
};
|
|
19
|
-
exports.panelTextInputWithCustomWidth = panelTextInputWithCustomWidth;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
-
// How to use:
|
|
14
|
-
// https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions#Preferring_specialized_live_region_roles
|
|
15
|
-
// Demo: https://dequeuniversity.com/library/aria/liveregion-playground
|
|
16
|
-
|
|
17
|
-
// Important: Strongly recommend test your solution in all supported screen readers
|
|
18
|
-
// if you use non default value of properties: ariaAtomic, ariaLive, ariaRelevant, role
|
|
19
|
-
|
|
20
|
-
// Note: Text won't be announced if the text message doesn't change after the render.
|
|
21
|
-
// For using a forced announcement in this case, set the 'key' attribute - key={Date.now()}
|
|
22
|
-
// Note: Flag 'contentRendered' resolves bug with duplicates messages (NVDA + Firefox)
|
|
23
|
-
// https://github.com/nvaccess/nvda/labels/bug%2Fdouble-speaking
|
|
24
|
-
var timer;
|
|
25
|
-
var Announcer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
26
|
-
var _ref$ariaAtomic = _ref.ariaAtomic,
|
|
27
|
-
ariaAtomic = _ref$ariaAtomic === void 0 ? 'true' : _ref$ariaAtomic,
|
|
28
|
-
_ref$ariaLive = _ref.ariaLive,
|
|
29
|
-
ariaLive = _ref$ariaLive === void 0 ? 'polite' : _ref$ariaLive,
|
|
30
|
-
_ref$ariaRelevant = _ref.ariaRelevant,
|
|
31
|
-
ariaRelevant = _ref$ariaRelevant === void 0 ? 'all' : _ref$ariaRelevant,
|
|
32
|
-
_ref$role = _ref.role,
|
|
33
|
-
role = _ref$role === void 0 ? 'status' : _ref$role,
|
|
34
|
-
_ref$text = _ref.text,
|
|
35
|
-
text = _ref$text === void 0 ? '' : _ref$text,
|
|
36
|
-
_ref$delay = _ref.delay,
|
|
37
|
-
delay = _ref$delay === void 0 ? 0 : _ref$delay;
|
|
38
|
-
var _useState = (0, _react.useState)(false),
|
|
39
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
40
|
-
contentRendered = _useState2[0],
|
|
41
|
-
setContentRendered = _useState2[1];
|
|
42
|
-
(0, _react.useEffect)(function () {
|
|
43
|
-
clearTimeout(timer);
|
|
44
|
-
setContentRendered(false);
|
|
45
|
-
timer = setTimeout(function () {
|
|
46
|
-
setContentRendered(true);
|
|
47
|
-
}, delay);
|
|
48
|
-
return function () {
|
|
49
|
-
return clearTimeout(timer);
|
|
50
|
-
};
|
|
51
|
-
}, [text, delay]);
|
|
52
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
53
|
-
className: "assistive",
|
|
54
|
-
ref: ref,
|
|
55
|
-
role: role,
|
|
56
|
-
"aria-atomic": ariaAtomic,
|
|
57
|
-
"aria-relevant": ariaRelevant,
|
|
58
|
-
"aria-live": ariaLive
|
|
59
|
-
}, contentRendered && /*#__PURE__*/_react.default.createElement("span", null, text));
|
|
60
|
-
});
|
|
61
|
-
var _default = /*#__PURE__*/(0, _react.memo)(Announcer);
|
|
62
|
-
exports.default = _default;
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { stateKey } from './pm-plugins/main';
|
|
3
|
-
import { removeLink, editInsertedLink, updateLink, insertLinkWithAnalytics } from './commands';
|
|
4
|
-
import HyperlinkAddToolbar from './ui/HyperlinkAddToolbar';
|
|
5
|
-
import { commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
6
|
-
import UnlinkIcon from '@atlaskit/icon/glyph/editor/unlink';
|
|
7
|
-
import CogIcon from '@atlaskit/icon/glyph/editor/settings';
|
|
8
|
-
import OpenIcon from '@atlaskit/icon/glyph/shortcut';
|
|
9
|
-
import { normalizeUrl } from '@atlaskit/editor-common/utils';
|
|
10
|
-
import { linkToolbarMessages as linkToolbarCommonMessages, linkMessages } from '../../messages';
|
|
11
|
-
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
12
|
-
import { LINKPICKER_HEIGHT_IN_PX, RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDTH_IN_PX } from '@atlaskit/editor-common/ui';
|
|
13
|
-
import { ACTION_SUBJECT_ID, ACTION, INPUT_METHOD, buildVisitedLinkPayload, buildOpenedSettingsPayload } from '@atlaskit/editor-common/analytics';
|
|
14
|
-
import { toolbarKey } from './pm-plugins/toolbar-buttons';
|
|
15
|
-
|
|
16
|
-
/* type guard for edit links */
|
|
17
|
-
function isEditLink(linkMark) {
|
|
18
|
-
return linkMark.pos !== undefined;
|
|
19
|
-
}
|
|
20
|
-
const dispatchAnalytics = (dispatch, state, analyticsBuilder, editorAnalyticsApi) => {
|
|
21
|
-
if (dispatch) {
|
|
22
|
-
const {
|
|
23
|
-
tr
|
|
24
|
-
} = state;
|
|
25
|
-
editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent(analyticsBuilder(ACTION_SUBJECT_ID.HYPERLINK))(tr);
|
|
26
|
-
dispatch(tr);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
const visitHyperlink = editorAnalyticsApi => (state, dispatch) => {
|
|
30
|
-
dispatchAnalytics(dispatch, state, buildVisitedLinkPayload, editorAnalyticsApi);
|
|
31
|
-
return true;
|
|
32
|
-
};
|
|
33
|
-
const openLinkSettings = editorAnalyticsApi => (state, dispatch) => {
|
|
34
|
-
dispatchAnalytics(dispatch, state, buildOpenedSettingsPayload, editorAnalyticsApi);
|
|
35
|
-
return true;
|
|
36
|
-
};
|
|
37
|
-
function getLinkText(activeLinkMark, state) {
|
|
38
|
-
if (!activeLinkMark.node) {
|
|
39
|
-
return undefined;
|
|
40
|
-
}
|
|
41
|
-
const textToUrl = normalizeUrl(activeLinkMark.node.text);
|
|
42
|
-
const linkMark = activeLinkMark.node.marks.find(mark => mark.type === state.schema.marks.link);
|
|
43
|
-
const linkHref = linkMark && linkMark.attrs.href;
|
|
44
|
-
if (textToUrl === linkHref) {
|
|
45
|
-
return undefined;
|
|
46
|
-
}
|
|
47
|
-
return activeLinkMark.node.text;
|
|
48
|
-
}
|
|
49
|
-
const getSettingsButtonGroup = (state, intl, featureFlags, editorAnalyticsApi) => {
|
|
50
|
-
const {
|
|
51
|
-
floatingToolbarLinkSettingsButton
|
|
52
|
-
} = featureFlags;
|
|
53
|
-
return floatingToolbarLinkSettingsButton === 'true' ? [{
|
|
54
|
-
type: 'separator'
|
|
55
|
-
}, {
|
|
56
|
-
id: 'editor.link.settings',
|
|
57
|
-
type: 'button',
|
|
58
|
-
icon: CogIcon,
|
|
59
|
-
title: intl.formatMessage(linkToolbarCommonMessages.settingsLink),
|
|
60
|
-
onClick: openLinkSettings(editorAnalyticsApi),
|
|
61
|
-
href: 'https://id.atlassian.com/manage-profile/link-preferences',
|
|
62
|
-
target: '_blank'
|
|
63
|
-
}] : [];
|
|
64
|
-
};
|
|
65
|
-
export const getToolbarConfig = (options, featureFlags, pluginInjectionApi) => (state, intl, providerFactory) => {
|
|
66
|
-
var _pluginInjectionApi$d;
|
|
67
|
-
const {
|
|
68
|
-
formatMessage
|
|
69
|
-
} = intl;
|
|
70
|
-
const linkState = stateKey.getState(state);
|
|
71
|
-
const editorAnalyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.analytics) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.actions;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Enable focus trap only if feature flag is enabled AND for the new version of the picker
|
|
75
|
-
*/
|
|
76
|
-
const {
|
|
77
|
-
lpLinkPicker,
|
|
78
|
-
lpLinkPickerFocusTrap,
|
|
79
|
-
preventPopupOverflow
|
|
80
|
-
} = featureFlags;
|
|
81
|
-
const shouldEnableFocusTrap = Boolean(lpLinkPicker && lpLinkPickerFocusTrap);
|
|
82
|
-
if (linkState && linkState.activeLinkMark) {
|
|
83
|
-
const {
|
|
84
|
-
activeLinkMark
|
|
85
|
-
} = linkState;
|
|
86
|
-
const hyperLinkToolbar = {
|
|
87
|
-
title: 'Hyperlink floating controls',
|
|
88
|
-
nodeType: [state.schema.nodes.text, state.schema.nodes.paragraph, state.schema.nodes.heading, state.schema.nodes.taskItem, state.schema.nodes.decisionItem, state.schema.nodes.caption].filter(nodeType => !!nodeType),
|
|
89
|
-
// Use only the node types existing in the schema ED-6745
|
|
90
|
-
align: 'left',
|
|
91
|
-
className: activeLinkMark.type.match('INSERT|EDIT_INSERTED') ? 'hyperlink-floating-toolbar' : ''
|
|
92
|
-
};
|
|
93
|
-
switch (activeLinkMark.type) {
|
|
94
|
-
case 'EDIT':
|
|
95
|
-
{
|
|
96
|
-
var _toolbarKey$getState$, _toolbarKey$getState;
|
|
97
|
-
const {
|
|
98
|
-
pos,
|
|
99
|
-
node
|
|
100
|
-
} = activeLinkMark;
|
|
101
|
-
const linkMark = node.marks.filter(mark => mark.type === state.schema.marks.link);
|
|
102
|
-
const link = linkMark[0] && linkMark[0].attrs.href;
|
|
103
|
-
const isValidUrl = isSafeUrl(link);
|
|
104
|
-
const labelOpenLink = formatMessage(isValidUrl ? linkMessages.openLink : linkToolbarCommonMessages.unableToOpenLink);
|
|
105
|
-
// TODO: ED-14403 investigate why these are not translating?
|
|
106
|
-
const labelUnlink = formatMessage(linkToolbarCommonMessages.unlink);
|
|
107
|
-
const editLink = formatMessage(linkToolbarCommonMessages.editLink);
|
|
108
|
-
let metadata = {
|
|
109
|
-
url: link,
|
|
110
|
-
title: ''
|
|
111
|
-
};
|
|
112
|
-
if (activeLinkMark.node.text) {
|
|
113
|
-
metadata.title = activeLinkMark.node.text;
|
|
114
|
-
}
|
|
115
|
-
return {
|
|
116
|
-
...hyperLinkToolbar,
|
|
117
|
-
height: 32,
|
|
118
|
-
width: 250,
|
|
119
|
-
items: [...((_toolbarKey$getState$ = (_toolbarKey$getState = toolbarKey.getState(state)) === null || _toolbarKey$getState === void 0 ? void 0 : _toolbarKey$getState.items(state, intl, providerFactory, link)) !== null && _toolbarKey$getState$ !== void 0 ? _toolbarKey$getState$ : []), {
|
|
120
|
-
id: 'editor.link.edit',
|
|
121
|
-
type: 'button',
|
|
122
|
-
onClick: editInsertedLink(),
|
|
123
|
-
selected: false,
|
|
124
|
-
title: editLink,
|
|
125
|
-
showTitle: true,
|
|
126
|
-
metadata: metadata
|
|
127
|
-
}, {
|
|
128
|
-
type: 'separator'
|
|
129
|
-
}, {
|
|
130
|
-
id: 'editor.link.openLink',
|
|
131
|
-
type: 'button',
|
|
132
|
-
disabled: !isValidUrl,
|
|
133
|
-
target: '_blank',
|
|
134
|
-
href: isValidUrl ? link : undefined,
|
|
135
|
-
onClick: visitHyperlink(editorAnalyticsApi),
|
|
136
|
-
selected: false,
|
|
137
|
-
title: labelOpenLink,
|
|
138
|
-
icon: OpenIcon,
|
|
139
|
-
className: 'hyperlink-open-link',
|
|
140
|
-
metadata: metadata,
|
|
141
|
-
tabIndex: null
|
|
142
|
-
}, {
|
|
143
|
-
type: 'separator'
|
|
144
|
-
}, {
|
|
145
|
-
id: 'editor.link.unlink',
|
|
146
|
-
type: 'button',
|
|
147
|
-
onClick: commandWithMetadata(removeLink(pos), {
|
|
148
|
-
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
149
|
-
}),
|
|
150
|
-
selected: false,
|
|
151
|
-
title: labelUnlink,
|
|
152
|
-
icon: UnlinkIcon,
|
|
153
|
-
tabIndex: null
|
|
154
|
-
}, {
|
|
155
|
-
type: 'copy-button',
|
|
156
|
-
items: [{
|
|
157
|
-
type: 'separator'
|
|
158
|
-
}, {
|
|
159
|
-
state,
|
|
160
|
-
formatMessage: formatMessage,
|
|
161
|
-
markType: state.schema.marks.link
|
|
162
|
-
}]
|
|
163
|
-
}, ...getSettingsButtonGroup(state, intl, featureFlags, editorAnalyticsApi)],
|
|
164
|
-
scrollable: true
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
case 'EDIT_INSERTED':
|
|
168
|
-
case 'INSERT':
|
|
169
|
-
{
|
|
170
|
-
let link;
|
|
171
|
-
if (isEditLink(activeLinkMark) && activeLinkMark.node) {
|
|
172
|
-
const linkMark = activeLinkMark.node.marks.filter(mark => mark.type === state.schema.marks.link);
|
|
173
|
-
link = linkMark[0] && linkMark[0].attrs.href;
|
|
174
|
-
}
|
|
175
|
-
const displayText = isEditLink(activeLinkMark) ? getLinkText(activeLinkMark, state) : linkState.activeText;
|
|
176
|
-
const popupHeight = lpLinkPicker ? LINKPICKER_HEIGHT_IN_PX : RECENT_SEARCH_HEIGHT_IN_PX;
|
|
177
|
-
return {
|
|
178
|
-
...hyperLinkToolbar,
|
|
179
|
-
preventPopupOverflow,
|
|
180
|
-
height: popupHeight,
|
|
181
|
-
width: RECENT_SEARCH_WIDTH_IN_PX,
|
|
182
|
-
focusTrap: shouldEnableFocusTrap,
|
|
183
|
-
items: [{
|
|
184
|
-
type: 'custom',
|
|
185
|
-
fallback: [],
|
|
186
|
-
disableArrowNavigation: true,
|
|
187
|
-
render: (view, idx) => {
|
|
188
|
-
if (!view) {
|
|
189
|
-
return null;
|
|
190
|
-
}
|
|
191
|
-
return /*#__PURE__*/React.createElement(HyperlinkAddToolbar, {
|
|
192
|
-
view: view,
|
|
193
|
-
key: idx,
|
|
194
|
-
linkPickerOptions: options === null || options === void 0 ? void 0 : options.linkPicker,
|
|
195
|
-
featureFlags: featureFlags,
|
|
196
|
-
displayUrl: link,
|
|
197
|
-
displayText: displayText || '',
|
|
198
|
-
providerFactory: providerFactory,
|
|
199
|
-
onCancel: () => view.focus(),
|
|
200
|
-
onClose: lpLinkPickerFocusTrap ? () => view.focus() : undefined,
|
|
201
|
-
onSubmit: (href, title = '', displayText, inputMethod, analytic) => {
|
|
202
|
-
var _options$cardOptions;
|
|
203
|
-
const isEdit = isEditLink(activeLinkMark);
|
|
204
|
-
const action = isEdit ? ACTION.UPDATED : ACTION.INSERTED;
|
|
205
|
-
const command = isEdit ? commandWithMetadata(updateLink(href, displayText || title, activeLinkMark.pos), {
|
|
206
|
-
action,
|
|
207
|
-
inputMethod,
|
|
208
|
-
sourceEvent: analytic
|
|
209
|
-
}) : insertLinkWithAnalytics(inputMethod, activeLinkMark.from, activeLinkMark.to, href, title, displayText, !!(options !== null && options !== void 0 && (_options$cardOptions = options.cardOptions) !== null && _options$cardOptions !== void 0 && _options$cardOptions.provider), analytic);
|
|
210
|
-
command(view.state, view.dispatch, view);
|
|
211
|
-
if (!lpLinkPickerFocusTrap) {
|
|
212
|
-
view.focus();
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
}]
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
return;
|
|
223
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { link } from '@atlaskit/adf-schema';
|
|
3
|
-
import { createInputRulePlugin } from './pm-plugins/input-rule';
|
|
4
|
-
import { createKeymapPlugin } from './pm-plugins/keymap';
|
|
5
|
-
import { plugin, stateKey, LinkAction } from './pm-plugins/main';
|
|
6
|
-
import fakeCursorToolbarPlugin from './pm-plugins/fake-cursor-for-toolbar';
|
|
7
|
-
import { toolbarButtonsPlugin, prependToolbarButtons } from './pm-plugins/toolbar-buttons';
|
|
8
|
-
import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
9
|
-
import { getToolbarConfig } from './Toolbar';
|
|
10
|
-
import { tooltip, addLink } from '../../keymaps';
|
|
11
|
-
import { IconLink } from '../quick-insert/assets';
|
|
12
|
-
import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
13
|
-
const hyperlinkPlugin = (options = {}, api) => {
|
|
14
|
-
var _api$dependencies, _api$dependencies$fea;
|
|
15
|
-
const featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies = api.dependencies) === null || _api$dependencies === void 0 ? void 0 : (_api$dependencies$fea = _api$dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
|
|
16
|
-
return {
|
|
17
|
-
name: 'hyperlink',
|
|
18
|
-
marks() {
|
|
19
|
-
return [{
|
|
20
|
-
name: 'link',
|
|
21
|
-
mark: link
|
|
22
|
-
}];
|
|
23
|
-
},
|
|
24
|
-
actions: {
|
|
25
|
-
prependToolbarButtons
|
|
26
|
-
},
|
|
27
|
-
pmPlugins() {
|
|
28
|
-
var _options$cardOptions;
|
|
29
|
-
// Skip analytics if card provider is available, as they will be
|
|
30
|
-
// sent on handleRejected upon attempting to resolve smart link.
|
|
31
|
-
const skipAnalytics = !!(options !== null && options !== void 0 && (_options$cardOptions = options.cardOptions) !== null && _options$cardOptions !== void 0 && _options$cardOptions.provider);
|
|
32
|
-
return [{
|
|
33
|
-
name: 'hyperlink',
|
|
34
|
-
plugin: ({
|
|
35
|
-
dispatch
|
|
36
|
-
}) => plugin(dispatch, options === null || options === void 0 ? void 0 : options.editorAppearance)
|
|
37
|
-
}, {
|
|
38
|
-
name: 'fakeCursorToolbarPlugin',
|
|
39
|
-
plugin: () => fakeCursorToolbarPlugin
|
|
40
|
-
}, {
|
|
41
|
-
name: 'hyperlinkInputRule',
|
|
42
|
-
plugin: ({
|
|
43
|
-
schema,
|
|
44
|
-
featureFlags
|
|
45
|
-
}) => createInputRulePlugin(schema, skipAnalytics, featureFlags)
|
|
46
|
-
}, {
|
|
47
|
-
name: 'hyperlinkKeymap',
|
|
48
|
-
plugin: () => createKeymapPlugin(skipAnalytics)
|
|
49
|
-
}, {
|
|
50
|
-
name: 'hyperlinkToolbarButtons',
|
|
51
|
-
plugin: toolbarButtonsPlugin
|
|
52
|
-
}];
|
|
53
|
-
},
|
|
54
|
-
pluginsOptions: {
|
|
55
|
-
quickInsert: ({
|
|
56
|
-
formatMessage
|
|
57
|
-
}) => [{
|
|
58
|
-
id: 'hyperlink',
|
|
59
|
-
title: formatMessage(messages.link),
|
|
60
|
-
description: formatMessage(messages.linkDescription),
|
|
61
|
-
keywords: ['hyperlink', 'url'],
|
|
62
|
-
priority: 1200,
|
|
63
|
-
keyshortcut: tooltip(addLink),
|
|
64
|
-
icon: () => /*#__PURE__*/React.createElement(IconLink, null),
|
|
65
|
-
action(insert, state) {
|
|
66
|
-
var _api$dependencies2, _api$dependencies2$an, _api$dependencies2$an2, _api$dependencies2$an3;
|
|
67
|
-
const tr = insert(undefined);
|
|
68
|
-
tr.setMeta(stateKey, {
|
|
69
|
-
type: LinkAction.SHOW_INSERT_TOOLBAR,
|
|
70
|
-
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
71
|
-
});
|
|
72
|
-
const analyticsAttached = api === null || api === void 0 ? void 0 : (_api$dependencies2 = api.dependencies) === null || _api$dependencies2 === void 0 ? void 0 : (_api$dependencies2$an = _api$dependencies2.analytics) === null || _api$dependencies2$an === void 0 ? void 0 : (_api$dependencies2$an2 = _api$dependencies2$an.actions) === null || _api$dependencies2$an2 === void 0 ? void 0 : (_api$dependencies2$an3 = _api$dependencies2$an2.attachAnalyticsEvent) === null || _api$dependencies2$an3 === void 0 ? void 0 : _api$dependencies2$an3.call(_api$dependencies2$an2, {
|
|
73
|
-
action: ACTION.INVOKED,
|
|
74
|
-
actionSubject: ACTION_SUBJECT.TYPEAHEAD,
|
|
75
|
-
actionSubjectId: ACTION_SUBJECT_ID.TYPEAHEAD_LINK,
|
|
76
|
-
attributes: {
|
|
77
|
-
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
78
|
-
},
|
|
79
|
-
eventType: EVENT_TYPE.UI
|
|
80
|
-
})(tr);
|
|
81
|
-
return analyticsAttached !== false ? tr : false;
|
|
82
|
-
}
|
|
83
|
-
}],
|
|
84
|
-
floatingToolbar: getToolbarConfig(options, featureFlags, api)
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
export default hyperlinkPlugin;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { DecorationSet, Decoration } from 'prosemirror-view';
|
|
3
|
-
import { fakeCursorForToolbarPluginKey } from './fake-curor-for-toolbar-plugin-key';
|
|
4
|
-
import { InsertStatus, stateKey as hyperlinkStateKey } from './main';
|
|
5
|
-
const createTextCursor = pos => {
|
|
6
|
-
const node = document.createElement('div');
|
|
7
|
-
node.className = 'ProseMirror-fake-text-cursor';
|
|
8
|
-
return Decoration.widget(pos, node, {
|
|
9
|
-
key: 'hyperlink-text-cursor'
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
const createTextSelection = (from, to) => Decoration.inline(from, to, {
|
|
13
|
-
class: 'ProseMirror-fake-text-selection'
|
|
14
|
-
});
|
|
15
|
-
const getInsertLinkToolbarState = editorState => {
|
|
16
|
-
const state = hyperlinkStateKey.getState(editorState);
|
|
17
|
-
if (state && state.activeLinkMark) {
|
|
18
|
-
if (state.activeLinkMark.type === InsertStatus.INSERT_LINK_TOOLBAR) {
|
|
19
|
-
return state.activeLinkMark;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return undefined;
|
|
23
|
-
};
|
|
24
|
-
const fakeCursorToolbarPlugin = new SafePlugin({
|
|
25
|
-
key: fakeCursorForToolbarPluginKey,
|
|
26
|
-
state: {
|
|
27
|
-
init() {
|
|
28
|
-
return DecorationSet.empty;
|
|
29
|
-
},
|
|
30
|
-
apply(tr, pluginState, oldState, newState) {
|
|
31
|
-
const oldInsertToolbarState = getInsertLinkToolbarState(oldState);
|
|
32
|
-
const insertToolbarState = getInsertLinkToolbarState(newState);
|
|
33
|
-
// Map DecorationSet if it still refers to the same position in the document
|
|
34
|
-
if (oldInsertToolbarState && insertToolbarState) {
|
|
35
|
-
const {
|
|
36
|
-
from,
|
|
37
|
-
to
|
|
38
|
-
} = insertToolbarState;
|
|
39
|
-
const oldFrom = tr.mapping.map(oldInsertToolbarState.from);
|
|
40
|
-
const oldTo = tr.mapping.map(oldInsertToolbarState.to);
|
|
41
|
-
if (oldFrom === from && oldTo === to) {
|
|
42
|
-
return pluginState.map(tr.mapping, tr.doc);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
// Update DecorationSet if new insert toolbar, or if we have moved to a different position in the doc
|
|
46
|
-
if (insertToolbarState) {
|
|
47
|
-
const {
|
|
48
|
-
from,
|
|
49
|
-
to
|
|
50
|
-
} = insertToolbarState;
|
|
51
|
-
return DecorationSet.create(tr.doc, [from === to ? createTextCursor(from) : createTextSelection(from, to)]);
|
|
52
|
-
}
|
|
53
|
-
return DecorationSet.empty;
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
props: {
|
|
57
|
-
decorations(state) {
|
|
58
|
-
return fakeCursorForToolbarPluginKey.getState(state);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
export default fakeCursorToolbarPlugin;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
2
|
-
import { createRule, createPlugin } from '../../../utils/input-rules';
|
|
3
|
-
import { findFilepaths, isLinkInMatches, LinkMatcher, normalizeUrl, getLinkCreationAnalyticsEvent } from '@atlaskit/editor-common/utils';
|
|
4
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
|
-
import { addAnalytics } from '../../analytics';
|
|
6
|
-
export function createLinkInputRule(regexp, skipAnalytics = false) {
|
|
7
|
-
// Plain typed text (eg, typing 'www.google.com') should convert to a hyperlink
|
|
8
|
-
return createRule(regexp, (state, match, start, end) => {
|
|
9
|
-
const {
|
|
10
|
-
schema
|
|
11
|
-
} = state;
|
|
12
|
-
if (state.doc.rangeHasMark(start, end, schema.marks.link)) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
const link = match;
|
|
16
|
-
const url = normalizeUrl(link.url);
|
|
17
|
-
const markType = schema.mark('link', {
|
|
18
|
-
href: url
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
// Need access to complete text to check if last URL is part of a filepath before linkifying
|
|
22
|
-
const nodeBefore = state.selection.$from.nodeBefore;
|
|
23
|
-
if (!nodeBefore || !nodeBefore.isText || !nodeBefore.text) {
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
const filepaths = findFilepaths(nodeBefore.text,
|
|
27
|
-
// The position referenced by 'start' is relative to the start of the document, findFilepaths deals with index in a node only.
|
|
28
|
-
start - (nodeBefore.text.length - link.text.length) // (start of link match) - (whole node text length - link length) gets start of text node, which is used as offset
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
if (isLinkInMatches(start, filepaths)) {
|
|
32
|
-
const tr = state.tr;
|
|
33
|
-
return tr;
|
|
34
|
-
}
|
|
35
|
-
const from = start;
|
|
36
|
-
const to = Math.min(start + link.text.length, state.doc.content.size);
|
|
37
|
-
const tr = state.tr.addMark(from, to, markType);
|
|
38
|
-
|
|
39
|
-
// Keep old behavior that will delete the space after the link
|
|
40
|
-
if (to === end) {
|
|
41
|
-
tr.insertText(' ');
|
|
42
|
-
}
|
|
43
|
-
addLinkMetadata(state.selection, tr, {
|
|
44
|
-
inputMethod: INPUT_METHOD.AUTO_DETECT
|
|
45
|
-
});
|
|
46
|
-
if (skipAnalytics) {
|
|
47
|
-
return tr;
|
|
48
|
-
}
|
|
49
|
-
return addAnalytics(state, tr, getLinkCreationAnalyticsEvent(INPUT_METHOD.AUTO_DETECT, url));
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
export function createInputRulePlugin(schema, skipAnalytics = false, featureFlags) {
|
|
53
|
-
if (!schema.marks.link) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
const urlWithASpaceRule = createLinkInputRule(LinkMatcher.create(), skipAnalytics);
|
|
57
|
-
|
|
58
|
-
// [something](link) should convert to a hyperlink
|
|
59
|
-
const markdownLinkRule = createRule(/(^|[^!])\[(.*?)\]\((\S+)\)$/, (state, match, start, end) => {
|
|
60
|
-
const {
|
|
61
|
-
schema
|
|
62
|
-
} = state;
|
|
63
|
-
const [, prefix, linkText, linkUrl] = match;
|
|
64
|
-
const url = normalizeUrl(linkUrl).trim();
|
|
65
|
-
const markType = schema.mark('link', {
|
|
66
|
-
href: url
|
|
67
|
-
});
|
|
68
|
-
const tr = state.tr.replaceWith(start + prefix.length, end, schema.text((linkText || '').trim(), [markType]));
|
|
69
|
-
addLinkMetadata(state.selection, tr, {
|
|
70
|
-
inputMethod: INPUT_METHOD.FORMATTING
|
|
71
|
-
});
|
|
72
|
-
if (skipAnalytics) {
|
|
73
|
-
return tr;
|
|
74
|
-
}
|
|
75
|
-
return addAnalytics(state, tr, getLinkCreationAnalyticsEvent(INPUT_METHOD.FORMATTING, url));
|
|
76
|
-
});
|
|
77
|
-
return createPlugin('hyperlink', [urlWithASpaceRule, markdownLinkRule]);
|
|
78
|
-
}
|
|
79
|
-
export default createInputRulePlugin;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { keymap } from 'prosemirror-keymap';
|
|
2
|
-
import { getLinkMatch } from '@atlaskit/adf-schema';
|
|
3
|
-
import * as keymaps from '../../../keymaps';
|
|
4
|
-
import { stateKey } from '../pm-plugins/main';
|
|
5
|
-
import { showLinkToolbar, hideLinkToolbar } from '../commands';
|
|
6
|
-
import { INPUT_METHOD, addAnalytics } from '../../analytics';
|
|
7
|
-
import { findFilepaths, isLinkInMatches, getLinkCreationAnalyticsEvent } from '@atlaskit/editor-common/utils';
|
|
8
|
-
export function createKeymapPlugin(skipAnalytics = false) {
|
|
9
|
-
const list = {};
|
|
10
|
-
keymaps.bindKeymapWithCommand(keymaps.addLink.common, showLinkToolbar(INPUT_METHOD.SHORTCUT), list);
|
|
11
|
-
keymaps.bindKeymapWithCommand(keymaps.enter.common, mayConvertLastWordToHyperlink(skipAnalytics), list);
|
|
12
|
-
keymaps.bindKeymapWithCommand(keymaps.insertNewLine.common, mayConvertLastWordToHyperlink(skipAnalytics), list);
|
|
13
|
-
keymaps.bindKeymapWithCommand(keymaps.escape.common, (state, dispatch, view) => {
|
|
14
|
-
const hyperlinkPlugin = stateKey.getState(state);
|
|
15
|
-
if (hyperlinkPlugin.activeLinkMark) {
|
|
16
|
-
hideLinkToolbar()(state, dispatch);
|
|
17
|
-
if (view) {
|
|
18
|
-
view.focus();
|
|
19
|
-
}
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
return false;
|
|
23
|
-
}, list);
|
|
24
|
-
return keymap(list);
|
|
25
|
-
}
|
|
26
|
-
const mayConvertLastWordToHyperlink = skipAnalytics => {
|
|
27
|
-
return function (state, dispatch) {
|
|
28
|
-
const nodeBefore = state.selection.$from.nodeBefore;
|
|
29
|
-
if (!nodeBefore || !nodeBefore.isText || !nodeBefore.text) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
const words = nodeBefore.text.split(' ');
|
|
33
|
-
const lastWord = words[words.length - 1];
|
|
34
|
-
const match = getLinkMatch(lastWord);
|
|
35
|
-
if (match) {
|
|
36
|
-
const hyperlinkedText = match.raw;
|
|
37
|
-
const start = state.selection.$from.pos - hyperlinkedText.length;
|
|
38
|
-
const end = state.selection.$from.pos;
|
|
39
|
-
if (state.doc.rangeHasMark(start, end, state.schema.marks.link)) {
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
const url = match.url;
|
|
43
|
-
const markType = state.schema.mark('link', {
|
|
44
|
-
href: url
|
|
45
|
-
});
|
|
46
|
-
const filepaths = findFilepaths(nodeBefore.text, start - (nodeBefore.text.length - hyperlinkedText.length) // The position referenced by 'start' is relative to the start of the document, findFilepaths deals with index in a node only.
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
if (isLinkInMatches(start, filepaths)) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
const tr = state.tr.addMark(start, end, markType);
|
|
53
|
-
if (dispatch) {
|
|
54
|
-
if (skipAnalytics) {
|
|
55
|
-
dispatch(tr);
|
|
56
|
-
} else {
|
|
57
|
-
dispatch(addAnalytics(state, tr, getLinkCreationAnalyticsEvent(INPUT_METHOD.AUTO_DETECT, url)));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return false;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
export default createKeymapPlugin;
|