@atlaskit/editor-core 166.0.4 → 167.0.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/.eslintrc.js +46 -1
- package/CHANGELOG.md +87 -0
- package/dist/cjs/actions/index.js +26 -2
- package/dist/cjs/create-editor/ReactEditorView.js +2 -0
- package/dist/cjs/create-editor/create-plugins-list.js +1 -2
- package/dist/cjs/editor.js +5 -2
- package/dist/cjs/keymaps/index.js +5 -1
- package/dist/cjs/labs/next/ContentComponents.js +8 -4
- package/dist/cjs/labs/next/full-page.js +14 -8
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.js +7 -3
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +3 -1
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/styles.js +3 -1
- package/dist/cjs/plugins/analytics/types/enums.js +3 -0
- package/dist/cjs/plugins/base/index.js +8 -17
- package/dist/cjs/plugins/base/pm-plugins/better-type-history.js +3 -12
- package/dist/cjs/plugins/base/pm-plugins/inline-cursor-target.js +71 -16
- package/dist/cjs/plugins/block-type/commands/block-type.js +32 -22
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +4 -2
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +4 -11
- package/dist/cjs/plugins/card/styles.js +1 -1
- package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
- package/dist/cjs/plugins/code-block/actions.js +36 -2
- package/dist/cjs/plugins/code-block/nodeviews/code-block.js +70 -1
- package/dist/cjs/plugins/code-block/pm-plugins/actions.js +2 -1
- package/dist/cjs/plugins/code-block/pm-plugins/main.js +46 -8
- package/dist/cjs/plugins/code-block/styles.js +28 -24
- package/dist/cjs/plugins/collab-edit/styles.js +4 -2
- package/dist/cjs/plugins/collab-edit/ui/styles.js +4 -2
- package/dist/cjs/plugins/collab-edit/utils.js +1 -0
- package/dist/cjs/plugins/date/ui/DatePicker/index.js +3 -1
- package/dist/cjs/plugins/expand/ui/styles.js +16 -14
- package/dist/cjs/plugins/extension/commands.js +3 -2
- package/dist/cjs/plugins/extension/context-panel.js +21 -7
- package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +6 -4
- package/dist/cjs/plugins/extension/ui/Extension/InlineExtension/styles.js +3 -1
- package/dist/cjs/plugins/extension/ui/Extension/styles.js +7 -5
- package/dist/cjs/plugins/extension/ui/SaveIndicator/SaveIndicator.js +4 -2
- package/dist/cjs/plugins/fake-text-cursor/styles.js +3 -1
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
- package/dist/cjs/plugins/find-replace/styles.js +2 -6
- package/dist/cjs/plugins/find-replace/ui/styles.js +4 -2
- package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +3 -1
- package/dist/cjs/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +3 -1
- package/dist/cjs/plugins/floating-toolbar/ui/Separator.js +3 -1
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +6 -4
- package/dist/cjs/plugins/floating-toolbar/ui/styles.js +12 -10
- package/dist/cjs/plugins/grid/styles.js +3 -1
- package/dist/cjs/plugins/help-dialog/ui/styles.js +9 -7
- package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +23 -1
- package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +10 -1
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +5 -3
- package/dist/cjs/plugins/hyperlink/utils.js +53 -2
- package/dist/cjs/plugins/jira-issue/nodeviews/jira-issue.js +4 -2
- package/dist/cjs/plugins/layout/styles.js +1 -1
- package/dist/cjs/plugins/media/commands/helpers.js +10 -9
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +23 -4
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +6 -0
- package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -3
- package/dist/cjs/plugins/media/pm-plugins/main.js +1 -0
- package/dist/cjs/plugins/media/styles.js +1 -1
- package/dist/cjs/plugins/media/ui/CaptionPlaceholder/index.js +3 -1
- package/dist/cjs/plugins/media/ui/Media/DropPlaceholder.js +4 -2
- package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +3 -1
- package/dist/cjs/plugins/mentions/styles.js +3 -1
- package/dist/cjs/plugins/mentions/ui/InviteItem/index.js +3 -1
- package/dist/cjs/plugins/mentions/ui/InviteItem/styles.js +4 -2
- package/dist/cjs/plugins/panel/index.js +1 -0
- package/dist/cjs/plugins/panel/nodeviews/panel.js +4 -1
- package/dist/cjs/plugins/panel/pm-plugins/keymaps.js +21 -3
- package/dist/cjs/plugins/paste/handlers.js +23 -0
- package/dist/cjs/plugins/paste/linkify-md-plugin.js +7 -0
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +9 -1
- package/dist/cjs/plugins/paste/pm-plugins/main.js +27 -1
- package/dist/cjs/plugins/placeholder/index.js +15 -3
- package/dist/cjs/plugins/placeholder/styles.js +3 -1
- package/dist/cjs/plugins/placeholder-text/styles.js +3 -1
- package/dist/cjs/plugins/selection/gap-cursor/styles.js +1 -1
- package/dist/cjs/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
- package/dist/cjs/plugins/status/ui/statusPicker.js +3 -3
- package/dist/cjs/plugins/table/index.js +14 -4
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +6 -6
- package/dist/cjs/plugins/table/nodeviews/table.js +9 -4
- package/dist/cjs/plugins/table/pm-plugins/main.js +1 -4
- package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +118 -0
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin.js +2 -5
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +4 -8
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
- package/dist/cjs/plugins/table/transforms/column-width.js +1 -2
- package/dist/cjs/plugins/table/transforms/fix-tables.js +1 -3
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +4 -1
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +3 -1
- package/dist/cjs/plugins/table/ui/common-styles.js +4 -2
- package/dist/cjs/plugins/table/ui/consts.js +14 -11
- package/dist/cjs/plugins/table/ui/ui-styles.js +17 -10
- package/dist/cjs/plugins/table/utils/decoration.js +3 -4
- package/dist/cjs/plugins/table/utils/paste.js +9 -9
- package/dist/cjs/plugins/type-ahead/index.js +4 -3
- package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +3 -1
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +4 -4
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +11 -9
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +73 -3
- package/dist/cjs/plugins/unsupported-content/styles.js +1 -1
- package/dist/cjs/ui/Addon/Dropdown/styles.js +3 -1
- package/dist/cjs/ui/Addon/DropdownItem/styles.js +3 -1
- package/dist/cjs/ui/Appearance/Chromeless.js +2 -1
- package/dist/cjs/ui/Appearance/Comment/Comment.js +10 -3
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +4 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +5 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
- package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +6 -3
- package/dist/cjs/ui/ChromeCollapsed/styles.js +1 -1
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +21 -14
- package/dist/cjs/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
- package/dist/cjs/ui/ConfigPanel/Fields/CheckboxGroup.js +3 -1
- package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +3 -1
- package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +3 -1
- package/dist/cjs/ui/ConfigPanel/Fields/common/RequiredIndicator.js +3 -1
- package/dist/cjs/ui/ConfigPanel/Header.js +4 -2
- package/dist/cjs/ui/ConfigPanel/NestedForms/RemovableField.js +4 -8
- package/dist/cjs/ui/ContentStyles/index.js +4 -2
- package/dist/cjs/ui/ContextPanel/index.js +3 -1
- package/dist/cjs/ui/DropdownMenu/index.js +5 -0
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +6 -4
- package/dist/cjs/ui/ElementBrowser/ModalElementBrowser.js +4 -2
- package/dist/cjs/ui/ElementBrowser/components/CategoryList.js +4 -2
- package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +12 -5
- package/dist/cjs/ui/ElementBrowser/components/ElementList/EmptyState.js +3 -1
- package/dist/cjs/ui/ElementBrowser/components/ElementSearch.js +3 -1
- package/dist/cjs/ui/ElementBrowser/constants.js +3 -1
- package/dist/cjs/ui/FloatingToolbar/styles.js +2 -2
- package/dist/cjs/ui/LinkSearch/LinkSearchListItem.js +5 -3
- package/dist/cjs/ui/PanelTextInput/styles.js +3 -1
- package/dist/cjs/ui/PluginSlot/index.js +7 -4
- package/dist/cjs/ui/Toolbar/ToolbarInner.js +2 -1
- package/dist/cjs/ui/Toolbar/ToolbarWithSizeDetector.js +5 -2
- package/dist/cjs/ui/ToolbarFeedback/styles.js +5 -3
- package/dist/cjs/ui/WithFlash/index.js +4 -2
- package/dist/cjs/ui/styles.js +6 -4
- package/dist/cjs/utils/document.js +62 -6
- package/dist/cjs/utils/filter/privacy-filter.js +2 -2
- package/dist/cjs/utils/step.js +17 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +25 -1
- package/dist/es2019/create-editor/ReactEditorView.js +2 -0
- package/dist/es2019/create-editor/create-plugins-list.js +1 -2
- package/dist/es2019/editor.js +5 -2
- package/dist/es2019/keymaps/index.js +5 -1
- package/dist/es2019/labs/next/ContentComponents.js +7 -2
- package/dist/es2019/labs/next/full-page.js +11 -8
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.js +4 -3
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +16 -4
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/styles.js +2 -1
- package/dist/es2019/plugins/analytics/types/enums.js +3 -0
- package/dist/es2019/plugins/base/index.js +6 -15
- package/dist/es2019/plugins/base/pm-plugins/better-type-history.js +1 -11
- package/dist/es2019/plugins/base/pm-plugins/inline-cursor-target.js +72 -17
- package/dist/es2019/plugins/block-type/commands/block-type.js +25 -16
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -2
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +6 -10
- package/dist/es2019/plugins/card/styles.js +1 -1
- package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
- package/dist/es2019/plugins/code-block/actions.js +32 -0
- package/dist/es2019/plugins/code-block/nodeviews/code-block.js +61 -1
- package/dist/es2019/plugins/code-block/pm-plugins/actions.js +2 -1
- package/dist/es2019/plugins/code-block/pm-plugins/main.js +37 -3
- package/dist/es2019/plugins/code-block/styles.js +30 -27
- package/dist/es2019/plugins/collab-edit/styles.js +3 -2
- package/dist/es2019/plugins/collab-edit/ui/styles.js +4 -3
- package/dist/es2019/plugins/collab-edit/utils.js +1 -0
- package/dist/es2019/plugins/date/ui/DatePicker/index.js +3 -2
- package/dist/es2019/plugins/expand/ui/styles.js +15 -14
- package/dist/es2019/plugins/extension/commands.js +3 -2
- package/dist/es2019/plugins/extension/context-panel.js +11 -3
- package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +5 -4
- package/dist/es2019/plugins/extension/ui/Extension/InlineExtension/styles.js +2 -1
- package/dist/es2019/plugins/extension/ui/Extension/styles.js +7 -6
- package/dist/es2019/plugins/extension/ui/SaveIndicator/SaveIndicator.js +4 -4
- package/dist/es2019/plugins/fake-text-cursor/styles.js +3 -2
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
- package/dist/es2019/plugins/find-replace/styles.js +4 -4
- package/dist/es2019/plugins/find-replace/ui/styles.js +3 -2
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
- package/dist/es2019/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +2 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Separator.js +2 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +4 -4
- package/dist/es2019/plugins/floating-toolbar/ui/styles.js +11 -10
- package/dist/es2019/plugins/grid/styles.js +4 -2
- package/dist/es2019/plugins/help-dialog/ui/styles.js +10 -9
- package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +24 -2
- package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +9 -1
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +5 -4
- package/dist/es2019/plugins/hyperlink/utils.js +43 -2
- package/dist/es2019/plugins/jira-issue/nodeviews/jira-issue.js +6 -5
- package/dist/es2019/plugins/layout/styles.js +10 -7
- package/dist/es2019/plugins/media/commands/helpers.js +6 -8
- package/dist/es2019/plugins/media/nodeviews/mediaInline.js +21 -5
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/media.js +7 -0
- package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -4
- package/dist/es2019/plugins/media/pm-plugins/main.js +2 -0
- package/dist/es2019/plugins/media/styles.js +3 -3
- package/dist/es2019/plugins/media/ui/CaptionPlaceholder/index.js +2 -1
- package/dist/es2019/plugins/media/ui/Media/DropPlaceholder.js +4 -3
- package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +2 -1
- package/dist/es2019/plugins/mentions/styles.js +5 -4
- package/dist/es2019/plugins/mentions/ui/InviteItem/index.js +2 -1
- package/dist/es2019/plugins/mentions/ui/InviteItem/styles.js +3 -2
- package/dist/es2019/plugins/panel/index.js +1 -0
- package/dist/es2019/plugins/panel/nodeviews/panel.js +4 -1
- package/dist/es2019/plugins/panel/pm-plugins/keymaps.js +22 -4
- package/dist/es2019/plugins/paste/handlers.js +23 -0
- package/dist/es2019/plugins/paste/linkify-md-plugin.js +7 -1
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +4 -1
- package/dist/es2019/plugins/paste/pm-plugins/main.js +27 -2
- package/dist/es2019/plugins/placeholder/index.js +12 -1
- package/dist/es2019/plugins/placeholder/styles.js +3 -1
- package/dist/es2019/plugins/placeholder-text/styles.js +5 -4
- package/dist/es2019/plugins/selection/gap-cursor/styles.js +9 -9
- package/dist/es2019/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
- package/dist/es2019/plugins/status/ui/statusPicker.js +3 -3
- package/dist/es2019/plugins/table/index.js +13 -4
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +6 -6
- package/dist/es2019/plugins/table/nodeviews/table.js +6 -2
- package/dist/es2019/plugins/table/pm-plugins/main.js +1 -4
- package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +106 -0
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/plugin.js +2 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +3 -7
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
- package/dist/es2019/plugins/table/transforms/column-width.js +1 -2
- package/dist/es2019/plugins/table/transforms/fix-tables.js +1 -3
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/styles.js +4 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/styles.js +4 -3
- package/dist/es2019/plugins/table/ui/common-styles.js +29 -27
- package/dist/es2019/plugins/table/ui/consts.js +15 -12
- package/dist/es2019/plugins/table/ui/ui-styles.js +28 -23
- package/dist/es2019/plugins/table/utils/decoration.js +1 -4
- package/dist/es2019/plugins/table/utils/paste.js +9 -9
- package/dist/es2019/plugins/type-ahead/index.js +4 -3
- package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +2 -1
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +4 -4
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +10 -9
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +64 -6
- package/dist/es2019/plugins/unsupported-content/styles.js +1 -1
- package/dist/es2019/ui/Addon/Dropdown/styles.js +3 -2
- package/dist/es2019/ui/Addon/DropdownItem/styles.js +3 -2
- package/dist/es2019/ui/Appearance/Chromeless.js +2 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +9 -4
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +4 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +6 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
- package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +7 -3
- package/dist/es2019/ui/ChromeCollapsed/styles.js +4 -3
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +10 -2
- package/dist/es2019/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
- package/dist/es2019/ui/ConfigPanel/ErrorMessage/ErrorImage.js +3 -0
- package/dist/es2019/ui/ConfigPanel/Fields/CheckboxGroup.js +2 -1
- package/dist/es2019/ui/ConfigPanel/Fields/Expand.js +2 -1
- package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +2 -1
- package/dist/es2019/ui/ConfigPanel/Fields/common/RequiredIndicator.js +2 -1
- package/dist/es2019/ui/ConfigPanel/Header.js +3 -2
- package/dist/es2019/ui/ConfigPanel/NestedForms/RemovableField.js +4 -3
- package/dist/es2019/ui/ContentStyles/index.js +3 -2
- package/dist/es2019/ui/ContextPanel/index.js +2 -1
- package/dist/es2019/ui/DropdownMenu/index.js +5 -0
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +6 -3
- package/dist/es2019/ui/ElementBrowser/ModalElementBrowser.js +3 -2
- package/dist/es2019/ui/ElementBrowser/components/CategoryList.js +3 -2
- package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +12 -5
- package/dist/es2019/ui/ElementBrowser/components/ElementList/EmptyState.js +2 -1
- package/dist/es2019/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +3 -0
- package/dist/es2019/ui/ElementBrowser/components/ElementSearch.js +2 -1
- package/dist/es2019/ui/ElementBrowser/constants.js +3 -1
- package/dist/es2019/ui/FloatingToolbar/styles.js +4 -4
- package/dist/es2019/ui/LinkSearch/LinkSearchListItem.js +4 -3
- package/dist/es2019/ui/PanelTextInput/styles.js +5 -5
- package/dist/es2019/ui/PluginSlot/index.js +7 -4
- package/dist/es2019/ui/Toolbar/ToolbarInner.js +2 -1
- package/dist/es2019/ui/Toolbar/ToolbarWithSizeDetector.js +4 -2
- package/dist/es2019/ui/ToolbarFeedback/styles.js +5 -4
- package/dist/es2019/ui/WithFlash/index.js +4 -3
- package/dist/es2019/ui/styles.js +10 -9
- package/dist/es2019/utils/document.js +58 -5
- package/dist/es2019/utils/filter/privacy-filter.js +1 -1
- package/dist/es2019/utils/step.js +12 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +26 -1
- package/dist/esm/create-editor/ReactEditorView.js +2 -0
- package/dist/esm/create-editor/create-plugins-list.js +1 -2
- package/dist/esm/editor.js +5 -2
- package/dist/esm/keymaps/index.js +5 -1
- package/dist/esm/labs/next/ContentComponents.js +8 -4
- package/dist/esm/labs/next/full-page.js +11 -8
- package/dist/esm/nodeviews/getInlineNodeViewProducer.js +4 -3
- package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +3 -2
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/styles.js +2 -1
- package/dist/esm/plugins/analytics/types/enums.js +3 -0
- package/dist/esm/plugins/base/index.js +8 -17
- package/dist/esm/plugins/base/pm-plugins/better-type-history.js +1 -11
- package/dist/esm/plugins/base/pm-plugins/inline-cursor-target.js +72 -17
- package/dist/esm/plugins/block-type/commands/block-type.js +31 -22
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -2
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +3 -5
- package/dist/esm/plugins/card/styles.js +1 -1
- package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +2 -2
- package/dist/esm/plugins/code-block/actions.js +28 -0
- package/dist/esm/plugins/code-block/nodeviews/code-block.js +67 -1
- package/dist/esm/plugins/code-block/pm-plugins/actions.js +2 -1
- package/dist/esm/plugins/code-block/pm-plugins/main.js +39 -3
- package/dist/esm/plugins/code-block/styles.js +27 -23
- package/dist/esm/plugins/collab-edit/styles.js +3 -2
- package/dist/esm/plugins/collab-edit/ui/styles.js +3 -2
- package/dist/esm/plugins/collab-edit/utils.js +2 -0
- package/dist/esm/plugins/date/ui/DatePicker/index.js +2 -1
- package/dist/esm/plugins/expand/ui/styles.js +15 -14
- package/dist/esm/plugins/extension/commands.js +3 -2
- package/dist/esm/plugins/extension/context-panel.js +21 -7
- package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +5 -4
- package/dist/esm/plugins/extension/ui/Extension/InlineExtension/styles.js +2 -1
- package/dist/esm/plugins/extension/ui/Extension/styles.js +6 -5
- package/dist/esm/plugins/extension/ui/SaveIndicator/SaveIndicator.js +3 -2
- package/dist/esm/plugins/fake-text-cursor/styles.js +2 -1
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
- package/dist/esm/plugins/find-replace/styles.js +3 -3
- package/dist/esm/plugins/find-replace/ui/styles.js +3 -2
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/Separator.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +5 -4
- package/dist/esm/plugins/floating-toolbar/ui/styles.js +11 -10
- package/dist/esm/plugins/grid/styles.js +2 -1
- package/dist/esm/plugins/help-dialog/ui/styles.js +8 -7
- package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +24 -2
- package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +9 -1
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +4 -3
- package/dist/esm/plugins/hyperlink/utils.js +44 -2
- package/dist/esm/plugins/jira-issue/nodeviews/jira-issue.js +3 -2
- package/dist/esm/plugins/layout/styles.js +1 -1
- package/dist/esm/plugins/media/commands/helpers.js +6 -8
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +22 -4
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +7 -0
- package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +4 -3
- package/dist/esm/plugins/media/pm-plugins/main.js +2 -0
- package/dist/esm/plugins/media/styles.js +1 -1
- package/dist/esm/plugins/media/ui/CaptionPlaceholder/index.js +2 -1
- package/dist/esm/plugins/media/ui/Media/DropPlaceholder.js +3 -2
- package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +2 -1
- package/dist/esm/plugins/mentions/styles.js +2 -1
- package/dist/esm/plugins/mentions/ui/InviteItem/index.js +2 -1
- package/dist/esm/plugins/mentions/ui/InviteItem/styles.js +3 -2
- package/dist/esm/plugins/panel/index.js +1 -0
- package/dist/esm/plugins/panel/nodeviews/panel.js +4 -1
- package/dist/esm/plugins/panel/pm-plugins/keymaps.js +22 -4
- package/dist/esm/plugins/paste/handlers.js +21 -0
- package/dist/esm/plugins/paste/linkify-md-plugin.js +7 -1
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +6 -1
- package/dist/esm/plugins/paste/pm-plugins/main.js +27 -2
- package/dist/esm/plugins/placeholder/index.js +12 -1
- package/dist/esm/plugins/placeholder/styles.js +2 -1
- package/dist/esm/plugins/placeholder-text/styles.js +2 -1
- package/dist/esm/plugins/selection/gap-cursor/styles.js +1 -1
- package/dist/esm/plugins/selection/pm-plugins/gap-cursor-main.js +2 -2
- package/dist/esm/plugins/status/ui/statusPicker.js +2 -2
- package/dist/esm/plugins/table/index.js +13 -4
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +6 -6
- package/dist/esm/plugins/table/nodeviews/table.js +6 -2
- package/dist/esm/plugins/table/pm-plugins/main.js +1 -4
- package/dist/esm/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +102 -0
- package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +2 -4
- package/dist/esm/plugins/table/pm-plugins/table-resizing/plugin.js +2 -5
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +4 -8
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -3
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +0 -3
- package/dist/esm/plugins/table/transforms/column-width.js +1 -2
- package/dist/esm/plugins/table/transforms/fix-tables.js +1 -3
- package/dist/esm/plugins/table/ui/FloatingContextualButton/styles.js +3 -1
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/styles.js +2 -1
- package/dist/esm/plugins/table/ui/common-styles.js +4 -2
- package/dist/esm/plugins/table/ui/consts.js +15 -12
- package/dist/esm/plugins/table/ui/ui-styles.js +15 -10
- package/dist/esm/plugins/table/utils/decoration.js +3 -4
- package/dist/esm/plugins/table/utils/paste.js +9 -9
- package/dist/esm/plugins/type-ahead/index.js +4 -3
- package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +2 -1
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +4 -4
- package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +10 -9
- package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +71 -5
- package/dist/esm/plugins/unsupported-content/styles.js +1 -1
- package/dist/esm/ui/Addon/Dropdown/styles.js +2 -1
- package/dist/esm/ui/Addon/DropdownItem/styles.js +2 -1
- package/dist/esm/ui/Appearance/Chromeless.js +2 -1
- package/dist/esm/ui/Appearance/Comment/Comment.js +10 -3
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +3 -2
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +6 -2
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +12 -11
- package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +5 -3
- package/dist/esm/ui/ChromeCollapsed/styles.js +1 -1
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +21 -14
- package/dist/esm/ui/ConfigPanel/ConfigPanelFieldsLoader.js +2 -0
- package/dist/esm/ui/ConfigPanel/ErrorMessage/ErrorImage.js +3 -0
- package/dist/esm/ui/ConfigPanel/Fields/CheckboxGroup.js +2 -1
- package/dist/esm/ui/ConfigPanel/Fields/Expand.js +2 -1
- package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +2 -1
- package/dist/esm/ui/ConfigPanel/Fields/common/RequiredIndicator.js +2 -1
- package/dist/esm/ui/ConfigPanel/Header.js +3 -2
- package/dist/esm/ui/ConfigPanel/NestedForms/RemovableField.js +3 -2
- package/dist/esm/ui/ContentStyles/index.js +3 -2
- package/dist/esm/ui/ContextPanel/index.js +2 -1
- package/dist/esm/ui/DropdownMenu/index.js +5 -0
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +5 -4
- package/dist/esm/ui/ElementBrowser/ModalElementBrowser.js +3 -2
- package/dist/esm/ui/ElementBrowser/components/CategoryList.js +3 -2
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +11 -5
- package/dist/esm/ui/ElementBrowser/components/ElementList/EmptyState.js +2 -1
- package/dist/esm/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +3 -0
- package/dist/esm/ui/ElementBrowser/components/ElementSearch.js +2 -1
- package/dist/esm/ui/ElementBrowser/constants.js +3 -1
- package/dist/esm/ui/FloatingToolbar/styles.js +3 -3
- package/dist/esm/ui/LinkSearch/LinkSearchListItem.js +4 -3
- package/dist/esm/ui/PanelTextInput/styles.js +4 -3
- package/dist/esm/ui/PluginSlot/index.js +7 -4
- package/dist/esm/ui/Toolbar/ToolbarInner.js +2 -1
- package/dist/esm/ui/Toolbar/ToolbarWithSizeDetector.js +4 -2
- package/dist/esm/ui/ToolbarFeedback/styles.js +4 -3
- package/dist/esm/ui/WithFlash/index.js +3 -2
- package/dist/esm/ui/styles.js +5 -4
- package/dist/esm/utils/document.js +59 -5
- package/dist/esm/utils/filter/privacy-filter.js +1 -1
- package/dist/esm/utils/step.js +12 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +6 -0
- package/dist/types/labs/next/ContentComponents.d.ts +7 -1
- package/dist/types/nodeviews/getInlineNodeViewProducer.d.ts +1 -0
- package/dist/types/plugins/analytics/types/enums.d.ts +3 -0
- package/dist/types/plugins/analytics/types/general-events.d.ts +7 -1
- package/dist/types/plugins/base/pm-plugins/inline-cursor-target.d.ts +1 -1
- package/dist/types/plugins/code-block/actions.d.ts +2 -0
- package/dist/types/plugins/code-block/nodeviews/code-block.d.ts +2 -0
- package/dist/types/plugins/code-block/pm-plugins/actions.d.ts +1 -0
- package/dist/types/plugins/code-block/pm-plugins/main-state.d.ts +1 -0
- package/dist/types/plugins/extension/commands.d.ts +1 -1
- package/dist/types/plugins/extension/types.d.ts +1 -0
- package/dist/types/plugins/extension/ui/Extension/Extension/index.d.ts +6 -0
- package/dist/types/plugins/find-replace/styles.d.ts +0 -2
- package/dist/types/plugins/hyperlink/utils.d.ts +8 -0
- package/dist/types/plugins/media/commands/helpers.d.ts +2 -0
- package/dist/types/plugins/media/nodeviews/mediaNodeView/media.d.ts +1 -0
- package/dist/types/plugins/media/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/media/pm-plugins/types.d.ts +2 -1
- package/dist/types/plugins/paste/handlers.d.ts +1 -0
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +1 -0
- package/dist/types/plugins/table/commands/misc.d.ts +0 -1
- package/dist/types/plugins/table/index.d.ts +0 -1
- package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +1 -0
- package/dist/types/plugins/table/nodeviews/types.d.ts +0 -1
- package/dist/types/plugins/table/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +15 -0
- package/dist/types/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/plugin.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +1 -2
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +0 -1
- package/dist/types/plugins/table/transforms/fix-tables.d.ts +0 -1
- package/dist/types/plugins/table/types.d.ts +0 -1
- package/dist/types/plugins/table/ui/consts.d.ts +9 -9
- package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +2 -0
- package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +4 -4
- package/dist/types/types/editor-appearance-component.d.ts +0 -1
- package/dist/types/types/editor-props.d.ts +4 -0
- package/dist/types/types/feature-flags.d.ts +8 -0
- package/dist/types/types/ui-components.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +1 -0
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +3 -2
- package/dist/types/ui/ConfigPanel/ConfigPanelFieldsLoader.d.ts +3 -2
- package/dist/types/ui/PluginSlot/index.d.ts +1 -0
- package/dist/types/ui/Toolbar/toolbar-types.d.ts +1 -0
- package/dist/types/utils/document.d.ts +1 -0
- package/dist/types/utils/step.d.ts +1 -0
- package/docs/0-intro.tsx +12 -4
- package/package.json +20 -20
|
@@ -2,10 +2,10 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
6
|
+
// TODO: https://product-fabric.atlassian.net/browse/DSP-4290
|
|
5
7
|
import { css } from '@emotion/react';
|
|
6
8
|
import { B75, B200 } from '@atlaskit/theme/colors';
|
|
7
|
-
export var searchMatchBgColour = B75;
|
|
8
|
-
export var selectedSearchMatchBgColour = B200;
|
|
9
9
|
export var searchMatchClass = 'search-match';
|
|
10
10
|
export var selectedSearchMatchClass = 'selected-search-match';
|
|
11
|
-
export var findReplaceStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n background-color: ", ";\n }\n\n .", " {\n background-color: ", ";\n color: white;\n }\n"])), searchMatchClass,
|
|
11
|
+
export var findReplaceStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n background-color: ", ";\n }\n\n .", " {\n background-color: ", ";\n color: white;\n }\n"])), searchMatchClass, B75, selectedSearchMatchClass, B200);
|
|
@@ -5,6 +5,7 @@ var _templateObject;
|
|
|
5
5
|
/** @jsx jsx */
|
|
6
6
|
import { css } from '@emotion/react';
|
|
7
7
|
import { N60, N30A } from '@atlaskit/theme/colors';
|
|
8
|
+
import { token } from '@atlaskit/tokens';
|
|
8
9
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
9
10
|
export var replaceSectionButtonStyles = css({
|
|
10
11
|
marginLeft: '4px'
|
|
@@ -12,7 +13,7 @@ export var replaceSectionButtonStyles = css({
|
|
|
12
13
|
export var ruleStyles = css({
|
|
13
14
|
width: '100%',
|
|
14
15
|
border: 'none',
|
|
15
|
-
backgroundColor: "".concat(N30A),
|
|
16
|
+
backgroundColor: "".concat(token('color.border', N30A)),
|
|
16
17
|
margin: '4px 0px',
|
|
17
18
|
height: '1px',
|
|
18
19
|
borderRadius: '1px'
|
|
@@ -26,7 +27,7 @@ export var wrapperStyles = css({
|
|
|
26
27
|
});
|
|
27
28
|
export var sectionWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n\n & > * {\n display: inline-flex;\n height: 32px;\n flex: 0 0 auto;\n }\n\n & > [data-ds--text-field--container] {\n display: flex;\n flex: 1 1 auto;\n }\n"])));
|
|
28
29
|
export var countStyles = css({
|
|
29
|
-
color: "".concat(N60),
|
|
30
|
+
color: "".concat(token('color.text.subtlest', N60)),
|
|
30
31
|
fontSize: "".concat(relativeFontSizeToBase16(12)),
|
|
31
32
|
flex: '0 0 auto',
|
|
32
33
|
justifyContent: 'center',
|
|
@@ -23,6 +23,7 @@ import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
|
|
|
23
23
|
import Tooltip from '@atlaskit/tooltip';
|
|
24
24
|
import { injectIntl } from 'react-intl-next';
|
|
25
25
|
import messages from './messages';
|
|
26
|
+
import { token } from '@atlaskit/tokens';
|
|
26
27
|
export var menuItemDimensions = {
|
|
27
28
|
width: 175,
|
|
28
29
|
height: 32
|
|
@@ -111,7 +112,7 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
111
112
|
|
|
112
113
|
if (selected !== undefined) {
|
|
113
114
|
return selected ? jsx(EditorDoneIcon, {
|
|
114
|
-
primaryColor: B400,
|
|
115
|
+
primaryColor: token('color.icon.selected', B400),
|
|
115
116
|
size: "small",
|
|
116
117
|
label: intl.formatMessage(messages.confirmModalOK)
|
|
117
118
|
}) : jsx("span", {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { token } from '@atlaskit/tokens';
|
|
2
3
|
export default function EditorEmojiAddIcon() {
|
|
3
4
|
return /*#__PURE__*/React.createElement("svg", {
|
|
4
5
|
width: 24,
|
|
@@ -9,7 +10,7 @@ export default function EditorEmojiAddIcon() {
|
|
|
9
10
|
}, /*#__PURE__*/React.createElement("rect", {
|
|
10
11
|
width: 24,
|
|
11
12
|
height: 24,
|
|
12
|
-
fill:
|
|
13
|
+
fill: token('color.background.neutral.subtle', 'white'),
|
|
13
14
|
fillOpacity: "0.01"
|
|
14
15
|
}), /*#__PURE__*/React.createElement("path", {
|
|
15
16
|
fillRule: "evenodd",
|
|
@@ -5,7 +5,8 @@ var _templateObject;
|
|
|
5
5
|
/** @jsx jsx */
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import { N30 } from '@atlaskit/theme/colors';
|
|
8
|
-
|
|
8
|
+
import { token } from '@atlaskit/tokens';
|
|
9
|
+
var separator = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: ", ";\n width: 1px;\n height: 20px;\n margin: 0 4px;\n align-self: center;\n"])), token('color.border', N30));
|
|
9
10
|
export default (function () {
|
|
10
11
|
return jsx("div", {
|
|
11
12
|
css: separator,
|
|
@@ -33,13 +33,14 @@ import { EmojiPickerButton } from './EmojiPickerButton';
|
|
|
33
33
|
import Announcer from '../../../utils/announcer/announcer';
|
|
34
34
|
import { injectIntl } from 'react-intl-next';
|
|
35
35
|
import messages from './messages';
|
|
36
|
+
import { token } from '@atlaskit/tokens';
|
|
36
37
|
var akGridSize = gridSize();
|
|
37
38
|
|
|
38
39
|
var toolbarContainer = function toolbarContainer(theme) {
|
|
39
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n border-radius: ", "px;\n box-shadow:
|
|
40
|
-
light: 'white',
|
|
41
|
-
dark: DN70
|
|
42
|
-
})(theme), borderRadius(), akGridSize / 2, akGridSize);
|
|
40
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n border-radius: ", "px;\n box-shadow: ", ";\n padding: ", "px ", "px;\n display: flex;\n line-height: 1;\n box-sizing: border-box;\n\n & > div {\n align-items: center;\n }\n"])), themed({
|
|
41
|
+
light: token('elevation.surface.overlay', 'white'),
|
|
42
|
+
dark: token('elevation.surface.overlay', DN70)
|
|
43
|
+
})(theme), borderRadius(), token('elevation.shadow.overlay', "0 0 1px rgba(9, 30, 66, 0.31), 0 4px 8px -2px rgba(9, 30, 66, 0.25)"), akGridSize / 2, akGridSize);
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
var toolbarContainerLeftPadding = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding-left: ", "px;\n"])), akGridSize / 2);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as colors from '@atlaskit/theme/colors';
|
|
2
2
|
import { hexToRgba } from '@atlaskit/adf-schema';
|
|
3
|
+
import { token } from '@atlaskit/tokens';
|
|
3
4
|
var background = {
|
|
4
5
|
danger: {
|
|
5
6
|
default: {
|
|
@@ -7,28 +8,28 @@ var background = {
|
|
|
7
8
|
dark: 'inherit'
|
|
8
9
|
},
|
|
9
10
|
hover: {
|
|
10
|
-
light: colors.N30A,
|
|
11
|
-
dark: colors.N30A
|
|
11
|
+
light: token('color.background.neutral.subtle.hovered', colors.N30A),
|
|
12
|
+
dark: token('color.background.neutral.subtle.hovered', colors.N30A)
|
|
12
13
|
},
|
|
13
14
|
active: {
|
|
14
|
-
light: hexToRgba(colors.B75, 0.6),
|
|
15
|
-
dark: hexToRgba(colors.B75, 0.6)
|
|
15
|
+
light: token('color.background.neutral.pressed', "".concat(hexToRgba(colors.B75, 0.6))),
|
|
16
|
+
dark: token('color.background.neutral.pressed', "".concat(hexToRgba(colors.B75, 0.6)))
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
};
|
|
19
20
|
var color = {
|
|
20
21
|
danger: {
|
|
21
22
|
default: {
|
|
22
|
-
light: colors.N400,
|
|
23
|
-
dark: colors.DN400
|
|
23
|
+
light: token('color.icon', colors.N400),
|
|
24
|
+
dark: token('color.icon', colors.DN400)
|
|
24
25
|
},
|
|
25
26
|
hover: {
|
|
26
|
-
light: colors.R400,
|
|
27
|
-
dark: colors.R400
|
|
27
|
+
light: token('color.icon.danger', colors.R400),
|
|
28
|
+
dark: token('color.icon.danger', colors.R400)
|
|
28
29
|
},
|
|
29
30
|
active: {
|
|
30
|
-
light: colors.R400,
|
|
31
|
-
dark: colors.R400
|
|
31
|
+
light: token('color.icon.danger', colors.R400),
|
|
32
|
+
dark: token('color.icon.danger', colors.R400)
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
};
|
|
@@ -5,5 +5,6 @@ var _templateObject;
|
|
|
5
5
|
import { css } from '@emotion/react';
|
|
6
6
|
import { N30A, B200 } from '@atlaskit/theme/colors';
|
|
7
7
|
import { akEditorGridLineZIndex } from '@atlaskit/editor-shared-styles';
|
|
8
|
+
import { token } from '@atlaskit/tokens';
|
|
8
9
|
export var GRID_GUTTER = 12;
|
|
9
|
-
export var gridStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .gridParent {\n width: calc(100% + ", "px);\n margin-left: -", "px;\n margin-right: -", "px;\n transform: scale(1);\n z-index: ", ";\n }\n\n .gridContainer {\n position: fixed;\n height: 100vh;\n width: 100%;\n pointer-events: none;\n }\n\n .gridLine {\n border-left: 1px solid ", ";\n display: inline-block;\n box-sizing: border-box;\n height: 100%;\n margin-left: -1px;\n\n transition: border-color 0.15s linear;\n z-index: 0;\n }\n\n .highlight {\n border-left: 1px solid ", ";\n }\n"])), GRID_GUTTER * 2, GRID_GUTTER, GRID_GUTTER, akEditorGridLineZIndex, N30A, B200);
|
|
10
|
+
export var gridStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .gridParent {\n width: calc(100% + ", "px);\n margin-left: -", "px;\n margin-right: -", "px;\n transform: scale(1);\n z-index: ", ";\n }\n\n .gridContainer {\n position: fixed;\n height: 100vh;\n width: 100%;\n pointer-events: none;\n }\n\n // TODO: https://product-fabric.atlassian.net/browse/DSP-4352\n .gridLine {\n border-left: 1px solid ", ";\n display: inline-block;\n box-sizing: border-box;\n height: 100%;\n margin-left: -1px;\n\n transition: border-color 0.15s linear;\n z-index: 0;\n }\n\n .highlight {\n border-left: 1px solid ", ";\n }\n"])), GRID_GUTTER * 2, GRID_GUTTER, GRID_GUTTER, akEditorGridLineZIndex, token('color.border', N30A), token('color.border.focused', B200));
|
|
@@ -6,15 +6,16 @@ import { css } from '@emotion/react';
|
|
|
6
6
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
7
7
|
import * as colors from '@atlaskit/theme/colors';
|
|
8
8
|
import { akEditorUnitZIndex, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
9
|
-
|
|
10
|
-
export var
|
|
11
|
-
export var
|
|
12
|
-
export var
|
|
9
|
+
import { token } from '@atlaskit/tokens';
|
|
10
|
+
export var header = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n z-index: ", ";\n min-height: 24px;\n padding: 20px 40px;\n font-size: ", ";\n display: flex;\n justify-content: space-between;\n align-items: center;\n box-shadow: 'none';\n color: ", ";\n background-color: ", ";\n border-radius: ", "px;\n"])), akEditorUnitZIndex, relativeFontSizeToBase16(24), token('color.text', colors.N400), token('color.background.neutral.subtle', colors.N0), borderRadius());
|
|
11
|
+
export var footer = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n z-index: ", ";\n font-size: ", ";\n line-height: 20px;\n color: ", ";\n padding: 24px;\n text-align: right;\n box-shadow: 'none';\n"])), akEditorUnitZIndex, relativeFontSizeToBase16(14), token('color.text.subtlest', colors.N300));
|
|
12
|
+
export var contentWrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 18px 20px;\n border-bottom-right-radius: ", "px;\n overflow: auto;\n position: relative;\n color: ", ";\n background-color: ", ";\n"])), borderRadius(), token('color.text.subtle', colors.N400), token('color.background.neutral.subtle', colors.N0));
|
|
13
|
+
export var line = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background: ", ";\n content: '';\n display: block;\n height: 2px;\n left: 0;\n position: absolute;\n top: 0;\n right: 0;\n width: 100%;\n min-width: 604px;\n"])), token('color.background.neutral.subtle', '#fff'));
|
|
13
14
|
export var content = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n min-width: 524px;\n width: 100%;\n position: relative;\n display: flex;\n justify-content: space-between;\n"])));
|
|
14
15
|
export var columnLeft = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: 44%;\n"])));
|
|
15
16
|
export var columnRight = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n width: 44%;\n"])));
|
|
16
17
|
export var row = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n margin: 20px 0;\n display: flex;\n justify-content: space-between;\n"])));
|
|
17
18
|
export var title = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n font-size: ", ";\n font-weight: 400;\n"])), relativeFontSizeToBase16(18));
|
|
18
|
-
export var codeSm = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n background-color: ", ";\n border-radius: ", "px;\n width: 24px;\n display: inline-block;\n height: 24px;\n line-height: 24px;\n text-align: center;\n"])), colors.N20, borderRadius());
|
|
19
|
-
export var codeMd = css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n background-color: ", ";\n border-radius: ", "px;\n display: inline-block;\n height: 24px;\n line-height: 24px;\n width: 50px;\n text-align: center;\n"])), colors.N20, borderRadius());
|
|
20
|
-
export var codeLg = css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n background-color: ", ";\n border-radius: ", "px;\n display: inline-block;\n height: 24px;\n line-height: 24px;\n padding: 0 10px;\n text-align: center;\n"])), colors.N20, borderRadius());
|
|
19
|
+
export var codeSm = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n background-color: ", ";\n border-radius: ", "px;\n width: 24px;\n display: inline-block;\n height: 24px;\n line-height: 24px;\n text-align: center;\n"])), token('color.background.neutral', colors.N20), borderRadius());
|
|
20
|
+
export var codeMd = css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n background-color: ", ";\n border-radius: ", "px;\n display: inline-block;\n height: 24px;\n line-height: 24px;\n width: 50px;\n text-align: center;\n"])), token('color.background.neutral', colors.N20), borderRadius());
|
|
21
|
+
export var codeLg = css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n background-color: ", ";\n border-radius: ", "px;\n display: inline-block;\n height: 24px;\n line-height: 24px;\n padding: 0 10px;\n text-align: center;\n"])), token('color.background.neutral', colors.N20), borderRadius());
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { createRule, createPlugin } from '../../../utils/input-rules';
|
|
3
|
-
import { LinkMatcher, normalizeUrl } from '../utils';
|
|
3
|
+
import { findFilepaths, isLinkInMatches, LinkMatcher, normalizeUrl } from '../utils';
|
|
4
4
|
import { INPUT_METHOD, addAnalytics } from '../../analytics';
|
|
5
5
|
import { getLinkCreationAnalyticsEvent } from '../analytics';
|
|
6
6
|
export function createLinkInputRule(regexp) {
|
|
@@ -18,7 +18,29 @@ export function createLinkInputRule(regexp) {
|
|
|
18
18
|
var url = normalizeUrl(link.url);
|
|
19
19
|
var markType = schema.mark('link', {
|
|
20
20
|
href: url
|
|
21
|
-
});
|
|
21
|
+
}); // Need access to complete text to check if last URL is part of a filepath before linkifying
|
|
22
|
+
|
|
23
|
+
var nodeBefore = state.selection.$from.nodeBefore;
|
|
24
|
+
|
|
25
|
+
if (!nodeBefore || !nodeBefore.isText || !nodeBefore.text) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var filepaths = findFilepaths(nodeBefore.text, // The position referenced by 'start' is relative to the start of the document, findFilepaths deals with index in a node only.
|
|
30
|
+
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
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
if (isLinkInMatches(start, filepaths)) {
|
|
34
|
+
var _tr = state.tr;
|
|
35
|
+
|
|
36
|
+
if (useUnpredictableInputRule) {
|
|
37
|
+
_tr.insertText(' ');
|
|
38
|
+
} // To keep consistent with original behaviour.
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
return _tr;
|
|
42
|
+
}
|
|
43
|
+
|
|
22
44
|
var from = start;
|
|
23
45
|
var to = Math.min(start + link.text.length, state.doc.content.size);
|
|
24
46
|
var tr = state.tr.addMark(from, to, markType); // Keep old behavior that will delete the space after the link
|
|
@@ -5,6 +5,7 @@ import { stateKey } from '../pm-plugins/main';
|
|
|
5
5
|
import { showLinkToolbar, hideLinkToolbar } from '../commands';
|
|
6
6
|
import { INPUT_METHOD, addAnalytics } from '../../analytics';
|
|
7
7
|
import { getLinkCreationAnalyticsEvent } from '../analytics';
|
|
8
|
+
import { findFilepaths, isLinkInMatches } from '../utils';
|
|
8
9
|
export function createKeymapPlugin() {
|
|
9
10
|
var skipAnalytics = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
10
11
|
var list = {};
|
|
@@ -33,7 +34,7 @@ var mayConvertLastWordToHyperlink = function mayConvertLastWordToHyperlink(skipA
|
|
|
33
34
|
return function (state, dispatch) {
|
|
34
35
|
var nodeBefore = state.selection.$from.nodeBefore;
|
|
35
36
|
|
|
36
|
-
if (!nodeBefore || !nodeBefore.isText) {
|
|
37
|
+
if (!nodeBefore || !nodeBefore.isText || !nodeBefore.text) {
|
|
37
38
|
return false;
|
|
38
39
|
}
|
|
39
40
|
|
|
@@ -54,6 +55,13 @@ var mayConvertLastWordToHyperlink = function mayConvertLastWordToHyperlink(skipA
|
|
|
54
55
|
var markType = state.schema.mark('link', {
|
|
55
56
|
href: url
|
|
56
57
|
});
|
|
58
|
+
var 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.
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
if (isLinkInMatches(start, filepaths)) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
|
|
57
65
|
var tr = state.tr.addMark(start, end, markType);
|
|
58
66
|
|
|
59
67
|
if (dispatch) {
|
|
@@ -25,6 +25,7 @@ import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
|
|
|
25
25
|
import EditorAlignLeftIcon from '@atlaskit/icon/glyph/editor/align-left';
|
|
26
26
|
import LinkIcon from '@atlaskit/icon/glyph/link';
|
|
27
27
|
import { N90, N80, N30 } from '@atlaskit/theme/colors';
|
|
28
|
+
import { token } from '@atlaskit/tokens';
|
|
28
29
|
import Page16Icon from '@atlaskit/icon-object/glyph/page/16';
|
|
29
30
|
import Tooltip from '@atlaskit/tooltip';
|
|
30
31
|
import { PureComponent } from 'react';
|
|
@@ -46,9 +47,9 @@ import { browser } from '@atlaskit/editor-common/utils';
|
|
|
46
47
|
import { transformTimeStamp } from '../../../../ui/LinkSearch/transformTimeStamp';
|
|
47
48
|
import Announcer from '../../../../utils/announcer/announcer';
|
|
48
49
|
export var RECENT_SEARCH_LIST_SIZE = 5;
|
|
49
|
-
var clearText = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n padding: 0;\n margin-right: 8px;\n color: ", ";\n background: transparent;\n border: none;\n"])), N90);
|
|
50
|
-
var textInputWrapper = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", ";\n border-top: 1px solid ", ";\n border-bottom: 1px solid ", ";\n"])), inputWrapper, N30, N30);
|
|
51
|
-
var iconWrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n padding: 4px 8px;\n width: 18px;\n"])), N80);
|
|
50
|
+
var clearText = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n padding: 0;\n margin-right: 8px;\n color: ", ";\n background: transparent;\n border: none;\n"])), token('color.icon.subtle', N90));
|
|
51
|
+
var textInputWrapper = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", ";\n border-top: 1px solid ", ";\n border-bottom: 1px solid ", ";\n"])), inputWrapper, token('color.border', N30), token('color.border', N30));
|
|
52
|
+
var iconWrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n padding: 4px 8px;\n width: 18px;\n"])), token('color.icon.subtle', N80));
|
|
52
53
|
export var messages = defineMessages({
|
|
53
54
|
displayText: {
|
|
54
55
|
id: 'fabric.editor.displayText',
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import { mapSlice } from '../../utils/slice';
|
|
4
|
-
import { isSafeUrl, linkify, normalizeUrl as normaliseLinkHref } from '@atlaskit/adf-schema';
|
|
4
|
+
import { isSafeUrl, linkify, normalizeUrl as normaliseLinkHref } from '@atlaskit/adf-schema'; // Regular expression for a windows filepath in the format <DRIVE LETTER>:\<folder name>\
|
|
5
|
+
|
|
6
|
+
export var FILEPATH_REGEXP = /([a-zA-Z]:|\\)([^\/:*?<>"|]+\\)?([^\/:*?<>"| ]+(?=\s?))?/gim;
|
|
5
7
|
/**
|
|
6
8
|
* Instance of class LinkMatcher are used in autoformatting in place of Regex.
|
|
7
9
|
* Hence it has been made similar to regex with an exec method.
|
|
@@ -95,7 +97,12 @@ export function linkifyContent(schema) {
|
|
|
95
97
|
var text = node.text;
|
|
96
98
|
var matches = findLinkMatches(text);
|
|
97
99
|
var pos = 0;
|
|
100
|
+
var filepaths = findFilepaths(text);
|
|
98
101
|
matches.forEach(function (match) {
|
|
102
|
+
if (isLinkInMatches(match.start, filepaths)) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
99
106
|
if (match.start > 0) {
|
|
100
107
|
linkified.push(node.cut(pos, match.start));
|
|
101
108
|
}
|
|
@@ -150,4 +157,39 @@ function findLinkMatches(text) {
|
|
|
150
157
|
}
|
|
151
158
|
|
|
152
159
|
return matches;
|
|
153
|
-
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export var findFilepaths = function findFilepaths(text) {
|
|
163
|
+
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
164
|
+
// Creation of a copy of the RegExp is necessary as lastIndex is stored on it when we run .exec()
|
|
165
|
+
var localRegExp = new RegExp(FILEPATH_REGEXP);
|
|
166
|
+
var match;
|
|
167
|
+
var matchesList = [];
|
|
168
|
+
var maxFilepathSize = 260;
|
|
169
|
+
|
|
170
|
+
while ((match = localRegExp.exec(text)) !== null) {
|
|
171
|
+
var start = match.index + offset;
|
|
172
|
+
var end = localRegExp.lastIndex + offset;
|
|
173
|
+
|
|
174
|
+
if (end - start > maxFilepathSize) {
|
|
175
|
+
end = start + maxFilepathSize;
|
|
176
|
+
} // We don't care about big strings of text that are pretending to be filepaths!!
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
matchesList.push({
|
|
180
|
+
startIndex: start,
|
|
181
|
+
endIndex: end
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return matchesList;
|
|
186
|
+
};
|
|
187
|
+
export var isLinkInMatches = function isLinkInMatches(linkStart, matchesList) {
|
|
188
|
+
for (var i = 0; i < matchesList.length; i++) {
|
|
189
|
+
if (linkStart >= matchesList[i].startIndex && linkStart < matchesList[i].endIndex) {
|
|
190
|
+
return true;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return false;
|
|
195
|
+
};
|
|
@@ -8,8 +8,9 @@ import { JiraIcon } from '@atlaskit/logo/jira-icon';
|
|
|
8
8
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
9
9
|
import { N30, N50 } from '@atlaskit/theme/colors';
|
|
10
10
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
11
|
-
|
|
12
|
-
var
|
|
11
|
+
import { token } from '@atlaskit/tokens';
|
|
12
|
+
var wrapperNode = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n align-items: center;\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n box-sizing: border-box;\n cursor: default;\n display: inline-flex;\n font-size: ", ";\n margin: 0 2px;\n min-height: 24px;\n padding: 0 4px;\n user-select: none;\n vertical-align: middle;\n white-space: nowrap;\n\n .ProseMirror-selectednode & {\n background: ", ";\n outline: none;\n }\n"])), token('color.background.neutral', N30), token('color.border', N50), borderRadius(), relativeFontSizeToBase16(13), token('color.background.selected', N50));
|
|
13
|
+
var jiraChildNode = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: inline-block;\n color: ", ";\n line-height: 24px;\n vertical-align: top;\n\n &::before {\n color: ", ";\n content: 'JIRA | ';\n }\n"])), token('color.text.subtlest', '#707070'), token('color.text', 'black'));
|
|
13
14
|
var svgChildNode = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: inline-block;\n height: 24px;\n vertical-align: top;\n width: 24px;\n\n & > div {\n height: 24px;\n width: 24px;\n }\n"])));
|
|
14
15
|
export default function JIRAIssueNode(props) {
|
|
15
16
|
var issueKey = props.node.attrs.issueKey;
|
|
@@ -12,4 +12,4 @@ import { TableCssClassName } from '../table/types';
|
|
|
12
12
|
import { tableMarginFullWidthMode } from '../table/ui/consts';
|
|
13
13
|
export var LAYOUT_SECTION_MARGIN = gridSize();
|
|
14
14
|
export var LAYOUT_COLUMN_PADDING = gridSize() * 1.5;
|
|
15
|
-
export var layoutStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n ", " [data-layout-section] {\n margin: ", "px -", "px 0;\n transition: border-color 0.3s ", ";\n cursor: pointer;\n\n /* Inner cursor located 26px from left */\n [data-layout-column] {\n flex: 1;\n min-width: 0;\n border: ", "px solid
|
|
15
|
+
export var layoutStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n ", " [data-layout-section] {\n margin: ", "px -", "px 0;\n transition: border-color 0.3s ", ";\n cursor: pointer;\n\n /* Inner cursor located 26px from left */\n [data-layout-column] {\n flex: 1;\n min-width: 0;\n // TODO: https://product-fabric.atlassian.net/browse/DSP-4353\n border: ", "px solid\n ", ";\n border-radius: 4px;\n padding: ", "px;\n box-sizing: border-box;\n\n > div {\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-of-type + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursord:first-of-type + span + * {\n margin-top: 0;\n }\n\n .rich-media-item {\n margin-top: 0;\n }\n\n > .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-of-type\n + .mediaSingleView-content-wrap\n .rich-media-item {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-of-type\n + span\n + .mediaSingleView-content-wrap\n .rich-media-item {\n margin-top: 0;\n }\n\n /* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n and shrinking layout's node selectable area (leniency margin) */\n > [data-node-type='decisionList'] {\n li:first-of-type [data-decision-wrapper] {\n margin-top: 0;\n }\n }\n }\n\n /* Make the 'content' fill the entire height of the layout column to allow click\n handler of layout section nodeview to target only data-layout-column */\n [data-layout-content] {\n height: 100%;\n cursor: text;\n }\n }\n\n [data-layout-column] + [data-layout-column] {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n [data-layout-column] + [data-layout-column] {\n margin-left: 0;\n }\n }\n\n // TODO: https://product-fabric.atlassian.net/browse/DSP-4441\n /* Shows the border when cursor is inside a layout */\n &.selected [data-layout-column],\n &:hover [data-layout-column] {\n border-color: ", ";\n }\n\n &.selected.danger > [data-layout-column] {\n background-color: ", ";\n border-color: ", ";\n }\n\n &.", ":not(.danger) {\n [data-layout-column] {\n ", "\n }\n }\n }\n }\n\n .fabric-editor--full-width-mode .ProseMirror {\n [data-layout-section] {\n .", " {\n margin: 0 ", "px;\n }\n }\n }\n"])), columnLayoutSharedStyle, gridSize() - 1, akLayoutGutterOffset, akEditorSwoopCubicBezier, akEditorSelectedBorderSize, token('color.border', N40A), LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN, gridMediumMaxWidth, token('color.border', N50A), token('color.background.danger', akEditorDeleteBackground), token('color.border.danger', akEditorDeleteBorder), akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.Border, SelectionStyle.Blanket]), TableCssClassName.TABLE_CONTAINER, tableMarginFullWidthMode);
|
|
@@ -60,6 +60,10 @@ export var isMobileUploadCompleted = function isMobileUploadCompleted(mediaPlugi
|
|
|
60
60
|
return !!mediaPluginState.mediaOptions && // This flag tells us that it's a 'mobile' env.
|
|
61
61
|
!!mediaPluginState.mediaOptions.allowMarkingUploadsAsIncomplete && typeof mediaPluginState.mobileUploadComplete[mediaId] === 'boolean' ? mediaPluginState.mobileUploadComplete[mediaId] : undefined;
|
|
62
62
|
};
|
|
63
|
+
export var isMediaNode = function isMediaNode(pos, state) {
|
|
64
|
+
var node = state.doc.nodeAt(pos);
|
|
65
|
+
return node && ['media', 'mediaInline'].includes(node.type.name);
|
|
66
|
+
};
|
|
63
67
|
export var updateAllMediaNodesAttrs = function updateAllMediaNodesAttrs(id, attrs, isMediaSingle) {
|
|
64
68
|
return function (state, dispatch) {
|
|
65
69
|
var mediaPluginState = mediaPluginKey.getState(state);
|
|
@@ -72,16 +76,11 @@ export var updateAllMediaNodesAttrs = function updateAllMediaNodesAttrs(id, attr
|
|
|
72
76
|
mediaNodes = mediaGroupNode ? [mediaGroupNode] : [];
|
|
73
77
|
}
|
|
74
78
|
|
|
75
|
-
var isMediaNode = function isMediaNode(pos) {
|
|
76
|
-
var node = state.doc.nodeAt(pos);
|
|
77
|
-
return node && node.type.name === 'media';
|
|
78
|
-
};
|
|
79
|
-
|
|
80
79
|
var validMediaNodePositions = mediaNodes.reduce(function (acc, _ref) {
|
|
81
80
|
var getPos = _ref.getPos;
|
|
82
81
|
var pos = getPos();
|
|
83
82
|
|
|
84
|
-
if (typeof pos === 'number' && !isMediaNode(pos)) {
|
|
83
|
+
if (typeof pos === 'number' && !isMediaNode(pos, state)) {
|
|
85
84
|
return acc;
|
|
86
85
|
}
|
|
87
86
|
|
|
@@ -117,9 +116,8 @@ export var updateMediaNodeAttrs = function updateMediaNodeAttrs(id, attrs, isMed
|
|
|
117
116
|
|
|
118
117
|
var tr = state.tr;
|
|
119
118
|
var pos = mediaNodeWithPos.getPos();
|
|
120
|
-
var node = tr.doc.nodeAt(pos);
|
|
121
119
|
|
|
122
|
-
if (!
|
|
120
|
+
if (!isMediaNode(pos, state)) {
|
|
123
121
|
return false;
|
|
124
122
|
}
|
|
125
123
|
|
|
@@ -25,12 +25,14 @@ import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
|
25
25
|
import { MediaInlineNodeSelector } from './styles';
|
|
26
26
|
import { stateKey as mediaStateKey } from '../pm-plugins/plugin-key';
|
|
27
27
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
28
|
+
import { MediaInlineCardLoadingView } from '@atlaskit/media-ui';
|
|
28
29
|
export var createMediaNodeUpdater = function createMediaNodeUpdater(props) {
|
|
29
|
-
var node = props.node
|
|
30
|
+
var node = props.node;
|
|
30
31
|
return new MediaNodeUpdater(_objectSpread(_objectSpread({}, props), {}, {
|
|
31
32
|
isMediaSingle: true,
|
|
32
33
|
node: node ? node : props.node,
|
|
33
|
-
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent
|
|
34
|
+
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
35
|
+
contextIdentifierProvider: props.contextIdentifierProvider
|
|
34
36
|
}));
|
|
35
37
|
};
|
|
36
38
|
/**
|
|
@@ -97,6 +99,10 @@ export var updateMediaNodeAttributes = /*#__PURE__*/function () {
|
|
|
97
99
|
return _context.abrupt("return");
|
|
98
100
|
|
|
99
101
|
case 23:
|
|
102
|
+
_context.next = 25;
|
|
103
|
+
return mediaNodeUpdater.updateFileAttrs();
|
|
104
|
+
|
|
105
|
+
case 25:
|
|
100
106
|
case "end":
|
|
101
107
|
return _context.stop();
|
|
102
108
|
}
|
|
@@ -117,7 +123,7 @@ export var handleNewNode = function handleNewNode(props) {
|
|
|
117
123
|
});
|
|
118
124
|
};
|
|
119
125
|
export var MediaInline = function MediaInline(props) {
|
|
120
|
-
var _useState = useState(
|
|
126
|
+
var _useState = useState(),
|
|
121
127
|
_useState2 = _slicedToArray(_useState, 2),
|
|
122
128
|
viewMediaClientConfig = _useState2[0],
|
|
123
129
|
setViewMediaClientConfig = _useState2[1];
|
|
@@ -172,6 +178,18 @@ export var MediaInline = function MediaInline(props) {
|
|
|
172
178
|
mediaItemType: 'file',
|
|
173
179
|
collectionName: collection
|
|
174
180
|
};
|
|
181
|
+
/*
|
|
182
|
+
* Only show the loading view if the media provider is not ready
|
|
183
|
+
* prevents calling the media API before the provider is ready
|
|
184
|
+
*/
|
|
185
|
+
|
|
186
|
+
if (!viewMediaClientConfig) {
|
|
187
|
+
return /*#__PURE__*/React.createElement(MediaInlineCardLoadingView, {
|
|
188
|
+
message: "",
|
|
189
|
+
isSelected: false
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
175
193
|
return /*#__PURE__*/React.createElement(MediaInlineCard, {
|
|
176
194
|
isSelected: props.isSelected,
|
|
177
195
|
identifier: identifier,
|
|
@@ -194,13 +212,13 @@ export var MediaInlineNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
194
212
|
value: function createDomRef() {
|
|
195
213
|
var domRef = document.createElement('span');
|
|
196
214
|
domRef.contentEditable = 'false';
|
|
197
|
-
domRef.classList.add(MediaInlineNodeSelector);
|
|
198
215
|
return domRef;
|
|
199
216
|
}
|
|
200
217
|
}, {
|
|
201
218
|
key: "getContentDOM",
|
|
202
219
|
value: function getContentDOM() {
|
|
203
220
|
var dom = document.createElement('span');
|
|
221
|
+
dom.classList.add(MediaInlineNodeSelector);
|
|
204
222
|
return {
|
|
205
223
|
dom: dom
|
|
206
224
|
};
|
|
@@ -92,6 +92,12 @@ export var MediaNode = /*#__PURE__*/function (_Component) {
|
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "onFullscreenChange", function (fullscreen) {
|
|
96
|
+
_this.mediaPluginState.updateAndDispatch({
|
|
97
|
+
isFullscreen: fullscreen
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
95
101
|
_defineProperty(_assertThisInitialized(_this), "handleNewNode", function (props) {
|
|
96
102
|
var node = props.node;
|
|
97
103
|
|
|
@@ -230,6 +236,7 @@ export var MediaNode = /*#__PURE__*/function (_Component) {
|
|
|
230
236
|
selectable: true,
|
|
231
237
|
selected: selected,
|
|
232
238
|
disableOverlay: true,
|
|
239
|
+
onFullscreenChange: this.onFullscreenChange,
|
|
233
240
|
onClick: this.selectMediaSingleFromCard,
|
|
234
241
|
useInlinePlayer: mediaOptions && mediaOptions.allowLazyLoading,
|
|
235
242
|
isLazy: mediaOptions && mediaOptions.allowLazyLoading,
|
|
@@ -31,15 +31,16 @@ import { ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEvent, ACTI
|
|
|
31
31
|
import { RECENT_SEARCH_WIDTH_IN_PX } from '../../../../../ui/LinkSearch/ToolbarComponents';
|
|
32
32
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
33
33
|
import { ErrorMessage } from '@atlaskit/editor-common/ui';
|
|
34
|
+
import { token } from '@atlaskit/tokens';
|
|
34
35
|
export var CONTAINER_WIDTH_IN_PX = RECENT_SEARCH_WIDTH_IN_PX;
|
|
35
36
|
export var MAX_ALT_TEXT_LENGTH = 510; // double tweet length
|
|
36
37
|
|
|
37
|
-
var supportText = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n font-size: ", ";\n padding: 12px 40px;\n line-height: 20px;\n border-top: 1px solid ", ";\n margin: 0;\n"])), N100, relativeFontSizeToBase16(12), N30);
|
|
38
|
+
var supportText = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n font-size: ", ";\n padding: 12px 40px;\n line-height: 20px;\n border-top: 1px solid ", ";\n margin: 0;\n"])), token('color.text.subtlest', N100), relativeFontSizeToBase16(12), token('color.border', N30));
|
|
38
39
|
var container = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: ", "px;\n display: flex;\n flex-direction: column;\n overflow: auto;\n line-height: 2;\n"])), CONTAINER_WIDTH_IN_PX);
|
|
39
40
|
var inputWrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n line-height: 0;\n padding: 5px 0;\n align-items: center;\n"])));
|
|
40
|
-
var validationWrapper = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n line-height: 0;\n padding: 12px 24px 12px 0;\n margin: 0 12px 0 40px;\n border-top: 1px solid ", ";\n align-items: start;\n flex-direction: column;\n"])), R400);
|
|
41
|
+
var validationWrapper = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n line-height: 0;\n padding: 12px 24px 12px 0;\n margin: 0 12px 0 40px;\n border-top: 1px solid ", ";\n align-items: start;\n flex-direction: column;\n"])), token('color.border.danger', R400));
|
|
41
42
|
var buttonWrapper = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n padding: 4px 8px;\n"])));
|
|
42
|
-
var clearText = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: ", ";\n"])), N80);
|
|
43
|
+
var clearText = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n color: ", ";\n"])), token('color.icon.subtle', N80));
|
|
43
44
|
export var AltTextEditComponent = /*#__PURE__*/function (_React$Component) {
|
|
44
45
|
_inherits(AltTextEditComponent, _React$Component);
|
|
45
46
|
|
|
@@ -76,6 +76,8 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
76
76
|
|
|
77
77
|
_defineProperty(this, "showDropzone", false);
|
|
78
78
|
|
|
79
|
+
_defineProperty(this, "isFullscreen", false);
|
|
80
|
+
|
|
79
81
|
_defineProperty(this, "layout", 'center');
|
|
80
82
|
|
|
81
83
|
_defineProperty(this, "mediaNodes", []);
|
|
@@ -8,7 +8,7 @@ import { akEditorDeleteBorder, akEditorDeleteBackground, akEditorSelectedBorderB
|
|
|
8
8
|
import { N60, B200 } from '@atlaskit/theme/colors';
|
|
9
9
|
import { fileCardImageViewSelector, fileCardImageViewSelectedSelector, inlinePlayerClassName, newFileExperienceClassName } from '@atlaskit/media-card';
|
|
10
10
|
import { token } from '@atlaskit/tokens';
|
|
11
|
-
export var mediaStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n ", " & [layout='full-width'] .", ",\n & [layout='wide'] .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n & [layout^='wrap-'] + [layout^='wrap-'] {\n clear: none;\n & + p,\n & + div[class^='fabric-editor-align'],\n & + ul,\n & + ol,\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n clear: both !important;\n }\n & .", " {\n margin-left: 0;\n margin-right: 0;\n }\n }\n\n .mediaSingleView-content-wrap[layout^='wrap-'] {\n max-width: 100%;\n // overwrite default Prosemirror setting making it clear: both\n clear: inherit;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-left'] {\n float: left;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right'] {\n float: right;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right']\n + .mediaSingleView-content-wrap[layout='wrap-left'] {\n clear: both;\n }\n\n /* Larger margins for resize handlers when at depth 0 of the document */\n & > .mediaSingleView-content-wrap {\n .richMedia-resize-handle-right {\n margin-right: -", "px;\n }\n .richMedia-resize-handle-left {\n margin-left: -", "px;\n }\n }\n }\n\n .richMedia-resize-handle-right,\n .richMedia-resize-handle-left {\n display: flex;\n flex-direction: column;\n\n /* vertical align */\n justify-content: center;\n }\n\n .richMedia-resize-handle-right {\n align-items: flex-end;\n padding-right: 12px;\n margin-right: -", "px;\n }\n\n .richMedia-resize-handle-left {\n align-items: flex-start;\n padding-left: 12px;\n margin-left: -", "px;\n }\n\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n content: ' ';\n display: flex;\n width: 3px;\n height: 64px;\n\n border-radius: 6px;\n }\n\n .", ":hover .richMedia-resize-handle-left::after,\n .", ":hover .richMedia-resize-handle-right::after {\n background: ", ";\n }\n\n .", " .richMedia-resize-handle-right::after,\n .", " .richMedia-resize-handle-left::after,\n .", " .richMedia-resize-handle-right:hover::after,\n .", " .richMedia-resize-handle-left:hover::after,\n .", ".is-resizing .richMedia-resize-handle-right::after,\n .", ".is-resizing .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n .__resizable_base__ {\n left: unset !important;\n width: auto !important;\n height: auto !important;\n }\n\n /* Danger when top level node for smart cards / inline links */\n .danger > div > div > .media-card-frame,\n .danger > span > a {\n background-color: ", ";\n box-shadow: 0px 0px 0px ", "px\n ", ";\n transition: background-color 0s, box-shadow 0s;\n }\n .mediaGroupView-content-wrap.danger {\n /* Media inline */\n .", "::after {\n border: 1px solid ", ";\n }\n }\n /* Danger when nested node or common */\n .danger {\n /* Media single */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* Media single video player */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* New file experience */\n .", " .", " {\n box-shadow: 0 0 0 1px\n ", " !important;\n }\n /* Media resize handlers */\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n /* Smart cards */\n div div .media-card-frame,\n .inlineCardView-content-wrap > span > a {\n background-color:
|
|
11
|
+
export var mediaStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n ", " & [layout='full-width'] .", ",\n & [layout='wide'] .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n & [layout^='wrap-'] + [layout^='wrap-'] {\n clear: none;\n & + p,\n & + div[class^='fabric-editor-align'],\n & + ul,\n & + ol,\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n clear: both !important;\n }\n & .", " {\n margin-left: 0;\n margin-right: 0;\n }\n }\n\n .mediaSingleView-content-wrap[layout^='wrap-'] {\n max-width: 100%;\n // overwrite default Prosemirror setting making it clear: both\n clear: inherit;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-left'] {\n float: left;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right'] {\n float: right;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right']\n + .mediaSingleView-content-wrap[layout='wrap-left'] {\n clear: both;\n }\n\n /* Larger margins for resize handlers when at depth 0 of the document */\n & > .mediaSingleView-content-wrap {\n .richMedia-resize-handle-right {\n margin-right: -", "px;\n }\n .richMedia-resize-handle-left {\n margin-left: -", "px;\n }\n }\n }\n\n .richMedia-resize-handle-right,\n .richMedia-resize-handle-left {\n display: flex;\n flex-direction: column;\n\n /* vertical align */\n justify-content: center;\n }\n\n .richMedia-resize-handle-right {\n align-items: flex-end;\n padding-right: 12px;\n margin-right: -", "px;\n }\n\n .richMedia-resize-handle-left {\n align-items: flex-start;\n padding-left: 12px;\n margin-left: -", "px;\n }\n\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n content: ' ';\n display: flex;\n width: 3px;\n height: 64px;\n\n border-radius: 6px;\n }\n\n .", ":hover .richMedia-resize-handle-left::after,\n .", ":hover .richMedia-resize-handle-right::after {\n background: ", ";\n }\n\n .", " .richMedia-resize-handle-right::after,\n .", " .richMedia-resize-handle-left::after,\n .", " .richMedia-resize-handle-right:hover::after,\n .", " .richMedia-resize-handle-left:hover::after,\n .", ".is-resizing .richMedia-resize-handle-right::after,\n .", ".is-resizing .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n .__resizable_base__ {\n left: unset !important;\n width: auto !important;\n height: auto !important;\n }\n\n /* Danger when top level node for smart cards / inline links */\n .danger > div > div > .media-card-frame,\n .danger > span > a {\n background-color: ", ";\n box-shadow: 0px 0px 0px ", "px\n ", ";\n transition: background-color 0s, box-shadow 0s;\n }\n .mediaGroupView-content-wrap.danger {\n /* Media inline */\n .", "::after {\n border: 1px solid ", ";\n }\n }\n /* Danger when nested node or common */\n .danger {\n /* Media single */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* Media single video player */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* New file experience */\n .", " .", " {\n box-shadow: 0 0 0 1px\n ", " !important;\n }\n /* Media resize handlers */\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n /* Smart cards */\n div div .media-card-frame,\n .inlineCardView-content-wrap > span > a {\n background-color: ", "; /* R75 with 50% opactiy */\n transition: background-color 0s;\n }\n\n div div .media-card-frame::after {\n box-shadow: none;\n }\n }\n"])), mediaSingleSharedStyle, richMediaClassName, richMediaClassName, richMediaClassName, akEditorMediaResizeHandlerPaddingWide, akEditorMediaResizeHandlerPaddingWide, akEditorMediaResizeHandlerPadding, akEditorMediaResizeHandlerPadding, richMediaClassName, richMediaClassName, token('color.border', N60), akEditorSelectedNodeClassName, akEditorSelectedNodeClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, token('color.border.focused', B200), token('color.background.danger', akEditorDeleteBackground), akEditorSelectedBorderBoldSize, token('color.border.danger', akEditorDeleteBorder), fileCardImageViewSelectedSelector, token('color.border.danger', akEditorDeleteIconColor), richMediaClassName, fileCardImageViewSelector, token('color.border.danger', akEditorDeleteIconColor), richMediaClassName, inlinePlayerClassName, token('color.border.danger', akEditorDeleteIconColor), richMediaClassName, newFileExperienceClassName, token('color.border.danger', akEditorDeleteIconColor), token('color.icon.danger', akEditorDeleteIconColor), token('color.blanket.danger', 'rgb(255, 189, 173, 0.5)'));
|
|
12
12
|
/* `left: unset` above is to work around Chrome bug where rendering a div with
|
|
13
13
|
* that style applied inside a container that has a scroll, causes any svgs on
|
|
14
14
|
* the page, without a border, that are inside a flexbox, to no longer align to
|
|
@@ -6,8 +6,9 @@ var _templateObject;
|
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
8
|
import { N200 } from '@atlaskit/theme/colors';
|
|
9
|
+
import { token } from '@atlaskit/tokens';
|
|
9
10
|
import { messages } from './messages';
|
|
10
|
-
var placeholder = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n width: 100%;\n text-align: center;\n margin-top: 8px !important;\n display: block;\n"])), N200);
|
|
11
|
+
var placeholder = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n width: 100%;\n text-align: center;\n margin-top: 8px !important;\n display: block;\n"])), token('color.text.subtlest', N200));
|
|
11
12
|
export var CAPTION_PLACEHOLDER_ID = 'caption-placeholder';
|
|
12
13
|
export default (function (_ref) {
|
|
13
14
|
var onClick = _ref.onClick;
|