@atlaskit/editor-core 180.0.0 → 181.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/CHANGELOG.md +117 -0
- package/codemods/180.1.0-update-to-editor-migration-component.ts +8 -0
- package/codemods/__tests__/rename-editor-to-editor-migration-component.ts +156 -0
- package/codemods/migrates/rename-editor-to-editor-migration-component.ts +34 -0
- package/dist/cjs/actions/index.js +26 -11
- package/dist/cjs/analytics-api/attach-payload-into-transaction.js +1 -1
- package/dist/cjs/create-editor/ReactEditorView.js +9 -764
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +753 -0
- package/dist/cjs/create-editor/ReactEditorViewNext.js +16 -0
- package/dist/cjs/create-editor/create-plugins-list.js +31 -3
- package/dist/cjs/create-editor/feature-flags-from-props.js +3 -2
- package/dist/cjs/create-editor/preset-utils.js +27 -0
- package/dist/cjs/editor-next/editor-internal.js +147 -0
- package/dist/cjs/editor-next/editor-migration-component.js +51 -0
- package/dist/cjs/editor-next/hooks/useEditorMeasuresConstructor.js +36 -0
- package/dist/cjs/editor-next/hooks/useMeasureEditorMountTime.js +42 -0
- package/dist/cjs/editor-next/hooks/useProviderFactory.js +73 -0
- package/dist/cjs/editor-next/index.js +143 -0
- package/dist/cjs/editor-next/utils/deprecationWarnings.js +45 -0
- package/dist/cjs/editor-next/utils/editorMeasureTTICallback.js +44 -0
- package/dist/cjs/editor-next/utils/editorPropTypes.js +36 -0
- package/dist/cjs/editor-next/utils/getBaseFontSize.js +17 -0
- package/dist/cjs/editor-next/utils/getProvidersFromEditorProps.js +41 -0
- package/dist/cjs/editor-next/utils/handleProviders.js +51 -0
- package/dist/cjs/editor-next/utils/onEditorCreated.js +28 -0
- package/dist/cjs/editor-next/utils/sendDurationAnalytics.js +68 -0
- package/dist/cjs/editor-next/utils/trackEditorActions.js +101 -0
- package/dist/cjs/editor.js +139 -445
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/keymaps/consts.js +1 -16
- package/dist/cjs/labs/next/internal/hooks/use-analytics/index.js +4 -4
- package/dist/cjs/labs/next/internal/hooks/use-editor/create-dispatch-transaction.js +6 -6
- package/dist/cjs/labs/next/presets/create-stub-internal-apis.js +117 -0
- package/dist/cjs/labs/next/presets/cxhtml.js +56 -55
- package/dist/cjs/labs/next/presets/default.js +15 -42
- package/dist/cjs/labs/next/presets/mobile.js +76 -89
- package/dist/cjs/labs/next/presets/universal.js +337 -255
- package/dist/cjs/labs/next/presets/useUniversalPreset.js +36 -0
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +48 -13
- package/dist/cjs/plugins/analytics/index.js +2 -3
- package/dist/cjs/plugins/analytics/plugin.js +11 -6
- package/dist/cjs/plugins/analytics/utils.js +0 -11
- package/dist/cjs/plugins/annotation/utils.js +2 -36
- package/dist/cjs/plugins/base/pm-plugins/filter-steps.js +1 -1
- package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +98 -56
- package/dist/cjs/plugins/base/pm-plugins/react-nodeview.js +2 -7
- package/dist/cjs/plugins/base/utils/input-latency-tracking.js +24 -25
- package/dist/cjs/plugins/block-type/pm-plugins/input-rule.js +0 -10
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -0
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +36 -9
- package/dist/cjs/plugins/caption/index.js +0 -7
- package/dist/cjs/plugins/card/nodeviews/blockCard.js +9 -3
- package/dist/cjs/plugins/card/nodeviews/genericCard.js +16 -2
- package/dist/cjs/plugins/card/nodeviews/inlineCard.js +6 -2
- package/dist/cjs/plugins/card/pm-plugins/main.js +10 -5
- package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +4 -0
- package/dist/cjs/plugins/clipboard/pm-plugins/main.js +4 -1
- package/dist/cjs/plugins/code-block/pm-plugins/main-state.js +2 -14
- package/dist/cjs/plugins/collab-edit/plugin.js +2 -3
- package/dist/cjs/plugins/collab-edit/provider/index.js +1 -8
- package/dist/cjs/plugins/collab-edit/provider/types.js +1 -12
- package/dist/cjs/plugins/context-panel/index.js +1 -6
- package/dist/cjs/plugins/data-consumer/index.js +0 -8
- package/dist/cjs/plugins/date/utils/internal.js +0 -4
- package/dist/cjs/plugins/extension/commands.js +1 -8
- package/dist/cjs/plugins/extension/toolbar.js +7 -1
- package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +9 -2
- package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +2 -2
- package/dist/cjs/plugins/extension/ui/Extension/Lozenge.js +1 -0
- package/dist/cjs/plugins/feedback-dialog/index.js +1 -4
- package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +5 -1
- package/dist/cjs/plugins/floating-toolbar/ui/Button.js +9 -3
- package/dist/cjs/plugins/floating-toolbar/ui/CheckboxModal.js +5 -3
- package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +48 -14
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -9
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +24 -21
- package/dist/cjs/plugins/floating-toolbar/ui/ScrollButtons.js +12 -7
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +32 -5
- package/dist/cjs/plugins/floating-toolbar/utils.js +0 -12
- package/dist/cjs/plugins/fragment/index.js +0 -8
- package/dist/cjs/plugins/fragment/pm-plugins/fragment-consistency.js +1 -0
- package/dist/cjs/plugins/help-dialog/commands.js +2 -6
- package/dist/cjs/plugins/hyperlink/analytics.js +5 -5
- package/dist/cjs/plugins/hyperlink/index.js +1 -1
- package/dist/cjs/plugins/hyperlink/pm-plugins/main.js +9 -5
- package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +10 -4
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +4 -3
- package/dist/cjs/plugins/image-upload/pm-plugins/main.js +50 -12
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +1 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +3 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +1 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +22 -0
- package/dist/cjs/plugins/layout/styles.js +10 -1
- package/dist/cjs/plugins/list/utils/find.js +0 -28
- package/dist/cjs/plugins/list/utils/indentation.js +1 -25
- package/dist/cjs/plugins/list/utils/node.js +0 -5
- package/dist/cjs/plugins/list/utils/selection.js +2 -15
- package/dist/cjs/plugins/media/commands/helpers.js +12 -40
- package/dist/cjs/plugins/media/commands/index.js +4 -4
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +14 -12
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +1 -1
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +310 -205
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
- package/dist/cjs/plugins/media/pm-plugins/main.js +2 -27
- package/dist/cjs/plugins/media/toolbar/filePreviewItem.js +1 -4
- package/dist/cjs/plugins/media/utils/media-common.js +1 -20
- package/dist/cjs/plugins/mentions/nodeviews/mention.js +100 -16
- package/dist/cjs/plugins/mentions/type-ahead/index.js +1 -18
- package/dist/cjs/plugins/mentions/ui/InviteItem/index.js +1 -3
- package/dist/cjs/plugins/mobile-dimensions/index.js +1 -4
- package/dist/cjs/plugins/panel/utils.js +4 -1
- package/dist/cjs/plugins/paste/handlers.js +128 -13
- package/dist/cjs/plugins/paste/index.js +1 -2
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +133 -88
- package/dist/cjs/plugins/paste/pm-plugins/main.js +12 -3
- package/dist/cjs/plugins/paste/util/index.js +0 -46
- package/dist/cjs/plugins/placeholder-text/index.js +2 -2
- package/dist/cjs/plugins/quick-insert/assets/index.js +1 -27
- package/dist/cjs/plugins/selection/gap-cursor/actions.js +49 -44
- package/dist/cjs/plugins/status/index.js +9 -3
- package/dist/cjs/plugins/status/ui/statusPicker.js +8 -2
- package/dist/cjs/plugins/status/utils.js +1 -15
- package/dist/cjs/plugins/text-color/pm-plugins/main.js +0 -1
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +48 -12
- package/dist/cjs/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +22 -2
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +3 -1
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/more-button.js +3 -1
- package/dist/cjs/plugins/text-formatting/utils.js +1 -35
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +19 -1
- package/dist/cjs/plugins/type-ahead/constants.js +1 -7
- package/dist/cjs/plugins/type-ahead/index.js +1 -1
- package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +2 -35
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +79 -106
- package/dist/cjs/plugins/type-ahead/utils.js +3 -22
- package/dist/cjs/test-utils.js +4 -12
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +43 -8
- package/dist/cjs/ui/ChromeCollapsed/index.js +1 -0
- package/dist/cjs/ui/CollapsedEditor/index.js +7 -13
- package/dist/cjs/ui/ColorPalette/index.js +18 -0
- package/dist/cjs/ui/ColorPickerButton/index.js +73 -7
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +1 -1
- package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +1 -0
- package/dist/cjs/ui/ConfigPanel/utils.js +4 -17
- package/dist/cjs/ui/ContentStyles/index.js +1 -1
- package/dist/cjs/ui/ContextPanel/context.js +13 -12
- package/dist/cjs/ui/Dropdown/index.js +7 -2
- package/dist/cjs/ui/DropdownMenu/index.js +7 -2
- package/dist/cjs/ui/ElementBrowser/ModalElementBrowser.js +1 -1
- package/dist/cjs/ui/ElementBrowser/components/CategoryList.js +1 -1
- package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +1 -1
- package/dist/cjs/ui/ElementBrowser/components/StatelessElementBrowser.js +1 -1
- package/dist/cjs/ui/ElementBrowser/constants.js +1 -3
- package/dist/cjs/ui/PanelTextInput/index.js +4 -4
- package/dist/cjs/ui/PortalProvider/index.js +5 -5
- package/dist/cjs/ui/Resizer/utils.js +1 -3
- package/dist/cjs/ui/WidthEmitter/index.js +29 -35
- package/dist/cjs/ui/styles.js +3 -7
- package/dist/cjs/utils/document.js +15 -0
- package/dist/cjs/utils/extensions.js +6 -7
- package/dist/cjs/utils/get-editor-plugins.js +30 -0
- package/dist/cjs/utils/index.js +9 -269
- package/dist/cjs/utils/input-rules.js +1 -15
- package/dist/cjs/utils/linking-utils.js +1 -1
- package/dist/cjs/utils/performance/components/RenderTracking.js +1 -1
- package/dist/cjs/utils/performance/safer-transactions.js +1 -1
- package/dist/cjs/utils/prepare-extension-provider.js +25 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +24 -10
- package/dist/es2019/analytics-api/attach-payload-into-transaction.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +3 -710
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +697 -0
- package/dist/es2019/create-editor/ReactEditorViewNext.js +7 -0
- package/dist/es2019/create-editor/create-plugins-list.js +26 -3
- package/dist/es2019/create-editor/feature-flags-from-props.js +3 -2
- package/dist/es2019/create-editor/preset-utils.js +15 -0
- package/dist/es2019/editor-next/editor-internal.js +142 -0
- package/dist/es2019/editor-next/editor-migration-component.js +27 -0
- package/dist/es2019/editor-next/hooks/useEditorMeasuresConstructor.js +30 -0
- package/dist/es2019/editor-next/hooks/useMeasureEditorMountTime.js +35 -0
- package/dist/es2019/editor-next/hooks/useProviderFactory.js +62 -0
- package/dist/es2019/editor-next/index.js +96 -0
- package/dist/es2019/editor-next/utils/deprecationWarnings.js +39 -0
- package/dist/es2019/editor-next/utils/editorMeasureTTICallback.js +40 -0
- package/dist/es2019/editor-next/utils/editorPropTypes.js +29 -0
- package/dist/es2019/editor-next/utils/getBaseFontSize.js +11 -0
- package/dist/es2019/editor-next/utils/getProvidersFromEditorProps.js +36 -0
- package/dist/es2019/editor-next/utils/handleProviders.js +46 -0
- package/dist/es2019/editor-next/utils/onEditorCreated.js +21 -0
- package/dist/es2019/editor-next/utils/sendDurationAnalytics.js +40 -0
- package/dist/es2019/editor-next/utils/trackEditorActions.js +78 -0
- package/dist/es2019/editor.js +122 -398
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/keymaps/consts.js +7 -11
- package/dist/es2019/labs/next/internal/hooks/use-analytics/index.js +2 -2
- package/dist/es2019/labs/next/internal/hooks/use-editor/create-dispatch-transaction.js +2 -3
- package/dist/es2019/labs/next/presets/create-stub-internal-apis.js +105 -0
- package/dist/es2019/labs/next/presets/cxhtml.js +56 -53
- package/dist/es2019/labs/next/presets/default.js +18 -38
- package/dist/es2019/labs/next/presets/mobile.js +88 -88
- package/dist/es2019/labs/next/presets/universal.js +347 -263
- package/dist/es2019/labs/next/presets/useUniversalPreset.js +25 -0
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +41 -12
- package/dist/es2019/plugins/analytics/index.js +3 -4
- package/dist/es2019/plugins/analytics/plugin.js +8 -2
- package/dist/es2019/plugins/analytics/utils.js +0 -4
- package/dist/es2019/plugins/annotation/utils.js +2 -30
- package/dist/es2019/plugins/base/pm-plugins/filter-steps.js +1 -1
- package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +96 -58
- package/dist/es2019/plugins/base/pm-plugins/react-nodeview.js +1 -3
- package/dist/es2019/plugins/base/utils/input-latency-tracking.js +23 -23
- package/dist/es2019/plugins/block-type/pm-plugins/input-rule.js +3 -9
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -0
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +31 -5
- package/dist/es2019/plugins/caption/index.js +0 -2
- package/dist/es2019/plugins/card/nodeviews/blockCard.js +10 -3
- package/dist/es2019/plugins/card/nodeviews/genericCard.js +16 -2
- package/dist/es2019/plugins/card/nodeviews/inlineCard.js +6 -2
- package/dist/es2019/plugins/card/pm-plugins/main.js +9 -4
- package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +4 -0
- package/dist/es2019/plugins/clipboard/pm-plugins/main.js +3 -1
- package/dist/es2019/plugins/code-block/pm-plugins/main-state.js +1 -9
- package/dist/es2019/plugins/collab-edit/plugin.js +1 -2
- package/dist/es2019/plugins/collab-edit/provider/index.js +1 -1
- package/dist/es2019/plugins/collab-edit/provider/types.js +1 -10
- package/dist/es2019/plugins/context-panel/index.js +0 -3
- package/dist/es2019/plugins/data-consumer/index.js +0 -7
- package/dist/es2019/plugins/date/utils/internal.js +0 -3
- package/dist/es2019/plugins/extension/commands.js +0 -6
- package/dist/es2019/plugins/extension/toolbar.js +7 -1
- package/dist/es2019/plugins/extension/ui/Extension/Extension/index.js +12 -2
- package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +3 -0
- package/dist/es2019/plugins/extension/ui/Extension/Lozenge.js +1 -0
- package/dist/es2019/plugins/feedback-dialog/index.js +0 -2
- package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +5 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Button.js +9 -3
- package/dist/es2019/plugins/floating-toolbar/ui/CheckboxModal.js +5 -3
- package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +45 -12
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -11
- package/dist/es2019/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +3 -2
- package/dist/es2019/plugins/floating-toolbar/ui/ScrollButtons.js +12 -7
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +29 -1
- package/dist/es2019/plugins/floating-toolbar/utils.js +0 -10
- package/dist/es2019/plugins/fragment/index.js +0 -7
- package/dist/es2019/plugins/fragment/pm-plugins/fragment-consistency.js +1 -0
- package/dist/es2019/plugins/help-dialog/commands.js +1 -2
- package/dist/es2019/plugins/hyperlink/analytics.js +1 -1
- package/dist/es2019/plugins/hyperlink/index.js +1 -1
- package/dist/es2019/plugins/hyperlink/pm-plugins/main.js +8 -4
- package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +9 -3
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -2
- package/dist/es2019/plugins/image-upload/pm-plugins/main.js +47 -5
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -0
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +1 -0
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +3 -0
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +1 -0
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +24 -0
- package/dist/es2019/plugins/layout/styles.js +12 -4
- package/dist/es2019/plugins/list/utils/find.js +0 -27
- package/dist/es2019/plugins/list/utils/indentation.js +0 -23
- package/dist/es2019/plugins/list/utils/node.js +1 -4
- package/dist/es2019/plugins/list/utils/selection.js +2 -15
- package/dist/es2019/plugins/media/commands/helpers.js +9 -35
- package/dist/es2019/plugins/media/commands/index.js +1 -1
- package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +3 -3
- package/dist/es2019/plugins/media/nodeviews/mediaInline.js +1 -1
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +70 -37
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
- package/dist/es2019/plugins/media/pm-plugins/main.js +3 -30
- package/dist/es2019/plugins/media/toolbar/filePreviewItem.js +1 -4
- package/dist/es2019/plugins/media/utils/media-common.js +1 -19
- package/dist/es2019/plugins/mentions/nodeviews/mention.js +64 -16
- package/dist/es2019/plugins/mentions/type-ahead/index.js +1 -14
- package/dist/es2019/plugins/mentions/ui/InviteItem/index.js +1 -2
- package/dist/es2019/plugins/mobile-dimensions/index.js +0 -3
- package/dist/es2019/plugins/panel/utils.js +4 -1
- package/dist/es2019/plugins/paste/handlers.js +127 -5
- package/dist/es2019/plugins/paste/index.js +1 -2
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +131 -93
- package/dist/es2019/plugins/paste/pm-plugins/main.js +13 -4
- package/dist/es2019/plugins/paste/util/index.js +5 -45
- package/dist/es2019/plugins/placeholder-text/index.js +1 -1
- package/dist/es2019/plugins/quick-insert/assets/index.js +0 -8
- package/dist/es2019/plugins/selection/gap-cursor/actions.js +56 -56
- package/dist/es2019/plugins/status/index.js +8 -2
- package/dist/es2019/plugins/status/ui/statusPicker.js +8 -2
- package/dist/es2019/plugins/status/utils.js +1 -11
- package/dist/es2019/plugins/text-color/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +48 -12
- package/dist/es2019/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +20 -3
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +4 -2
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/more-button.js +3 -1
- package/dist/es2019/plugins/text-formatting/utils.js +0 -27
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +16 -1
- package/dist/es2019/plugins/type-ahead/constants.js +0 -5
- package/dist/es2019/plugins/type-ahead/index.js +1 -1
- package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +0 -35
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +73 -92
- package/dist/es2019/plugins/type-ahead/utils.js +0 -23
- package/dist/es2019/test-utils.js +4 -7
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +40 -6
- package/dist/es2019/ui/ChromeCollapsed/index.js +1 -0
- package/dist/es2019/ui/CollapsedEditor/index.js +7 -11
- package/dist/es2019/ui/ColorPalette/index.js +2 -1
- package/dist/es2019/ui/ColorPickerButton/index.js +66 -9
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +1 -1
- package/dist/es2019/ui/ConfigPanel/Fields/Expand.js +1 -0
- package/dist/es2019/ui/ConfigPanel/utils.js +0 -6
- package/dist/es2019/ui/ContentStyles/index.js +1 -1
- package/dist/es2019/ui/ContextPanel/context.js +5 -4
- package/dist/es2019/ui/Dropdown/index.js +5 -2
- package/dist/es2019/ui/DropdownMenu/index.js +5 -2
- package/dist/es2019/ui/ElementBrowser/ModalElementBrowser.js +1 -1
- package/dist/es2019/ui/ElementBrowser/components/CategoryList.js +1 -1
- package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +1 -1
- package/dist/es2019/ui/ElementBrowser/components/StatelessElementBrowser.js +1 -1
- package/dist/es2019/ui/ElementBrowser/constants.js +0 -1
- package/dist/es2019/ui/PanelTextInput/index.js +3 -3
- package/dist/es2019/ui/PortalProvider/index.js +1 -1
- package/dist/es2019/ui/Resizer/utils.js +0 -1
- package/dist/es2019/ui/WidthEmitter/index.js +25 -29
- package/dist/es2019/ui/styles.js +0 -6
- package/dist/es2019/utils/document.js +11 -1
- package/dist/es2019/utils/extensions.js +1 -3
- package/dist/es2019/utils/get-editor-plugins.js +23 -0
- package/dist/es2019/utils/index.js +13 -199
- package/dist/es2019/utils/input-rules.js +0 -14
- package/dist/es2019/utils/linking-utils.js +1 -1
- package/dist/es2019/utils/performance/components/RenderTracking.js +1 -1
- package/dist/es2019/utils/performance/safer-transactions.js +1 -1
- package/dist/es2019/utils/prepare-extension-provider.js +13 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +24 -10
- package/dist/esm/analytics-api/attach-payload-into-transaction.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +9 -765
- package/dist/esm/create-editor/ReactEditorViewInternal.js +747 -0
- package/dist/esm/create-editor/ReactEditorViewNext.js +7 -0
- package/dist/esm/create-editor/create-plugins-list.js +30 -3
- package/dist/esm/create-editor/feature-flags-from-props.js +3 -2
- package/dist/esm/create-editor/preset-utils.js +21 -0
- package/dist/esm/editor-next/editor-internal.js +141 -0
- package/dist/esm/editor-next/editor-migration-component.js +44 -0
- package/dist/esm/editor-next/hooks/useEditorMeasuresConstructor.js +30 -0
- package/dist/esm/editor-next/hooks/useMeasureEditorMountTime.js +35 -0
- package/dist/esm/editor-next/hooks/useProviderFactory.js +66 -0
- package/dist/esm/editor-next/index.js +138 -0
- package/dist/esm/editor-next/utils/deprecationWarnings.js +39 -0
- package/dist/esm/editor-next/utils/editorMeasureTTICallback.js +38 -0
- package/dist/esm/editor-next/utils/editorPropTypes.js +28 -0
- package/dist/esm/editor-next/utils/getBaseFontSize.js +11 -0
- package/dist/esm/editor-next/utils/getProvidersFromEditorProps.js +35 -0
- package/dist/esm/editor-next/utils/handleProviders.js +45 -0
- package/dist/esm/editor-next/utils/onEditorCreated.js +21 -0
- package/dist/esm/editor-next/utils/sendDurationAnalytics.js +61 -0
- package/dist/esm/editor-next/utils/trackEditorActions.js +94 -0
- package/dist/esm/editor.js +139 -442
- package/dist/esm/index.js +2 -1
- package/dist/esm/keymaps/consts.js +7 -11
- package/dist/esm/labs/next/internal/hooks/use-analytics/index.js +2 -2
- package/dist/esm/labs/next/internal/hooks/use-editor/create-dispatch-transaction.js +2 -3
- package/dist/esm/labs/next/presets/create-stub-internal-apis.js +110 -0
- package/dist/esm/labs/next/presets/cxhtml.js +56 -55
- package/dist/esm/labs/next/presets/default.js +18 -41
- package/dist/esm/labs/next/presets/mobile.js +88 -90
- package/dist/esm/labs/next/presets/universal.js +337 -255
- package/dist/esm/labs/next/presets/useUniversalPreset.js +29 -0
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +48 -13
- package/dist/esm/plugins/analytics/index.js +3 -4
- package/dist/esm/plugins/analytics/plugin.js +7 -2
- package/dist/esm/plugins/analytics/utils.js +0 -9
- package/dist/esm/plugins/annotation/utils.js +2 -32
- package/dist/esm/plugins/base/pm-plugins/filter-steps.js +1 -1
- package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +98 -56
- package/dist/esm/plugins/base/pm-plugins/react-nodeview.js +1 -5
- package/dist/esm/plugins/base/utils/input-latency-tracking.js +24 -25
- package/dist/esm/plugins/block-type/pm-plugins/input-rule.js +3 -9
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -0
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +36 -9
- package/dist/esm/plugins/caption/index.js +0 -2
- package/dist/esm/plugins/card/nodeviews/blockCard.js +9 -3
- package/dist/esm/plugins/card/nodeviews/genericCard.js +16 -2
- package/dist/esm/plugins/card/nodeviews/inlineCard.js +6 -2
- package/dist/esm/plugins/card/pm-plugins/main.js +10 -5
- package/dist/esm/plugins/card/pm-plugins/util/resolve.js +4 -0
- package/dist/esm/plugins/clipboard/pm-plugins/main.js +4 -1
- package/dist/esm/plugins/code-block/pm-plugins/main-state.js +0 -10
- package/dist/esm/plugins/collab-edit/plugin.js +1 -2
- package/dist/esm/plugins/collab-edit/provider/index.js +1 -1
- package/dist/esm/plugins/collab-edit/provider/types.js +1 -10
- package/dist/esm/plugins/context-panel/index.js +0 -3
- package/dist/esm/plugins/data-consumer/index.js +0 -7
- package/dist/esm/plugins/date/utils/internal.js +0 -3
- package/dist/esm/plugins/extension/commands.js +0 -6
- package/dist/esm/plugins/extension/toolbar.js +7 -1
- package/dist/esm/plugins/extension/ui/Extension/Extension/index.js +9 -2
- package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +2 -2
- package/dist/esm/plugins/extension/ui/Extension/Lozenge.js +1 -0
- package/dist/esm/plugins/feedback-dialog/index.js +0 -2
- package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +5 -1
- package/dist/esm/plugins/floating-toolbar/ui/Button.js +9 -3
- package/dist/esm/plugins/floating-toolbar/ui/CheckboxModal.js +5 -3
- package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +48 -14
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -9
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +24 -21
- package/dist/esm/plugins/floating-toolbar/ui/ScrollButtons.js +12 -7
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +32 -5
- package/dist/esm/plugins/floating-toolbar/utils.js +0 -10
- package/dist/esm/plugins/fragment/index.js +0 -7
- package/dist/esm/plugins/fragment/pm-plugins/fragment-consistency.js +1 -0
- package/dist/esm/plugins/help-dialog/commands.js +0 -3
- package/dist/esm/plugins/hyperlink/analytics.js +1 -1
- package/dist/esm/plugins/hyperlink/index.js +1 -1
- package/dist/esm/plugins/hyperlink/pm-plugins/main.js +9 -5
- package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +10 -4
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -2
- package/dist/esm/plugins/image-upload/pm-plugins/main.js +51 -12
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -0
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +1 -0
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +3 -0
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +1 -0
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +22 -0
- package/dist/esm/plugins/layout/styles.js +11 -2
- package/dist/esm/plugins/list/utils/find.js +0 -27
- package/dist/esm/plugins/list/utils/indentation.js +0 -23
- package/dist/esm/plugins/list/utils/node.js +1 -4
- package/dist/esm/plugins/list/utils/selection.js +2 -12
- package/dist/esm/plugins/media/commands/helpers.js +9 -35
- package/dist/esm/plugins/media/commands/index.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +14 -12
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +311 -206
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +3 -28
- package/dist/esm/plugins/media/toolbar/filePreviewItem.js +1 -4
- package/dist/esm/plugins/media/utils/media-common.js +1 -17
- package/dist/esm/plugins/mentions/nodeviews/mention.js +97 -16
- package/dist/esm/plugins/mentions/type-ahead/index.js +1 -18
- package/dist/esm/plugins/mentions/ui/InviteItem/index.js +1 -2
- package/dist/esm/plugins/mobile-dimensions/index.js +0 -3
- package/dist/esm/plugins/panel/utils.js +4 -1
- package/dist/esm/plugins/paste/handlers.js +127 -13
- package/dist/esm/plugins/paste/index.js +1 -2
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +130 -86
- package/dist/esm/plugins/paste/pm-plugins/main.js +13 -4
- package/dist/esm/plugins/paste/util/index.js +5 -45
- package/dist/esm/plugins/placeholder-text/index.js +2 -2
- package/dist/esm/plugins/quick-insert/assets/index.js +0 -20
- package/dist/esm/plugins/selection/gap-cursor/actions.js +52 -45
- package/dist/esm/plugins/status/index.js +9 -3
- package/dist/esm/plugins/status/ui/statusPicker.js +8 -2
- package/dist/esm/plugins/status/utils.js +1 -13
- package/dist/esm/plugins/text-color/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +48 -12
- package/dist/esm/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
- package/dist/esm/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +23 -3
- package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +4 -2
- package/dist/esm/plugins/text-formatting/ui/Toolbar/more-button.js +3 -1
- package/dist/esm/plugins/text-formatting/utils.js +0 -29
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +19 -1
- package/dist/esm/plugins/type-ahead/constants.js +0 -5
- package/dist/esm/plugins/type-ahead/index.js +1 -1
- package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +0 -31
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +79 -106
- package/dist/esm/plugins/type-ahead/utils.js +2 -20
- package/dist/esm/test-utils.js +4 -7
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +41 -6
- package/dist/esm/ui/ChromeCollapsed/index.js +1 -0
- package/dist/esm/ui/CollapsedEditor/index.js +7 -13
- package/dist/esm/ui/ColorPalette/index.js +2 -1
- package/dist/esm/ui/ColorPickerButton/index.js +74 -8
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +1 -1
- package/dist/esm/ui/ConfigPanel/Fields/Expand.js +1 -0
- package/dist/esm/ui/ConfigPanel/utils.js +3 -14
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/ui/ContextPanel/context.js +8 -8
- package/dist/esm/ui/Dropdown/index.js +7 -2
- package/dist/esm/ui/DropdownMenu/index.js +7 -2
- package/dist/esm/ui/ElementBrowser/ModalElementBrowser.js +1 -1
- package/dist/esm/ui/ElementBrowser/components/CategoryList.js +1 -1
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +1 -1
- package/dist/esm/ui/ElementBrowser/components/StatelessElementBrowser.js +1 -1
- package/dist/esm/ui/ElementBrowser/constants.js +0 -1
- package/dist/esm/ui/PanelTextInput/index.js +4 -4
- package/dist/esm/ui/PortalProvider/index.js +1 -1
- package/dist/esm/ui/Resizer/utils.js +0 -1
- package/dist/esm/ui/WidthEmitter/index.js +28 -37
- package/dist/esm/ui/styles.js +2 -5
- package/dist/esm/utils/document.js +15 -1
- package/dist/esm/utils/extensions.js +1 -3
- package/dist/esm/utils/get-editor-plugins.js +23 -0
- package/dist/esm/utils/index.js +13 -196
- package/dist/esm/utils/input-rules.js +0 -13
- package/dist/esm/utils/linking-utils.js +1 -1
- package/dist/esm/utils/performance/components/RenderTracking.js +1 -1
- package/dist/esm/utils/performance/safer-transactions.js +1 -1
- package/dist/esm/utils/prepare-extension-provider.js +17 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +5 -5
- package/dist/types/create-editor/ReactEditorView.d.ts +5 -110
- package/dist/types/create-editor/ReactEditorViewInternal.d.ts +114 -0
- package/dist/types/create-editor/ReactEditorViewNext.d.ts +8 -0
- package/dist/types/create-editor/create-plugins-list.d.ts +3 -5
- package/dist/types/create-editor/preset-utils.d.ts +2 -0
- package/dist/types/editor-next/editor-internal.d.ts +44 -0
- package/dist/types/editor-next/editor-migration-component.d.ts +5 -0
- package/dist/types/editor-next/hooks/useEditorMeasuresConstructor.d.ts +17 -0
- package/dist/types/editor-next/hooks/useMeasureEditorMountTime.d.ts +13 -0
- package/dist/types/editor-next/hooks/useProviderFactory.d.ts +21 -0
- package/dist/types/editor-next/index.d.ts +34 -0
- package/dist/types/editor-next/utils/deprecationWarnings.d.ts +2 -0
- package/dist/types/editor-next/utils/editorMeasureTTICallback.d.ts +5 -0
- package/dist/types/editor-next/utils/editorPropTypes.d.ts +19 -0
- package/dist/types/editor-next/utils/getBaseFontSize.d.ts +6 -0
- package/dist/types/editor-next/utils/getProvidersFromEditorProps.d.ts +9 -0
- package/dist/types/editor-next/utils/handleProviders.d.ts +14 -0
- package/dist/types/editor-next/utils/onEditorCreated.d.ts +12 -0
- package/dist/types/editor-next/utils/sendDurationAnalytics.d.ts +15 -0
- package/dist/types/editor-next/utils/trackEditorActions.d.ts +29 -0
- package/dist/types/editor.d.ts +50 -25
- package/dist/types/index.d.ts +1 -0
- package/dist/types/keymaps/consts.d.ts +0 -11
- package/dist/types/labs/next/internal/hooks/use-analytics/index.d.ts +1 -1
- package/dist/types/labs/next/presets/create-stub-internal-apis.d.ts +16 -0
- package/dist/types/labs/next/presets/cxhtml.d.ts +33 -1
- package/dist/types/labs/next/presets/default.d.ts +67 -10
- package/dist/types/labs/next/presets/mobile.d.ts +33 -1
- package/dist/types/labs/next/presets/universal.d.ts +5 -13
- package/dist/types/labs/next/presets/useUniversalPreset.d.ts +7 -0
- package/dist/types/nodeviews/context-adapter.d.ts +0 -1
- package/dist/types/nodeviews/index.d.ts +0 -1
- package/dist/types/plugins/alignment/index.d.ts +1 -1
- package/dist/types/plugins/alignment/pm-plugins/types.d.ts +0 -11
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/index.d.ts +3 -1
- package/dist/types/plugins/analytics/index.d.ts +3 -6
- package/dist/types/plugins/analytics/plugin.d.ts +3 -1
- package/dist/types/plugins/analytics/utils.d.ts +2 -3
- package/dist/types/plugins/annotation/index.d.ts +3 -1
- package/dist/types/plugins/annotation/utils.d.ts +0 -17
- package/dist/types/plugins/avatar-group/index.d.ts +3 -1
- package/dist/types/plugins/base/index.d.ts +3 -1
- package/dist/types/plugins/base/pm-plugins/filter-steps.d.ts +1 -1
- package/dist/types/plugins/base/pm-plugins/react-nodeview.d.ts +2 -3
- package/dist/types/plugins/base/utils/input-latency-tracking.d.ts +1 -3
- package/dist/types/plugins/before-primaryToolbar/index.d.ts +3 -1
- package/dist/types/plugins/block-type/index.d.ts +3 -1
- package/dist/types/plugins/block-type/pm-plugins/input-rule.d.ts +2 -6
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/blocktype-button.d.ts +1 -0
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -0
- package/dist/types/plugins/breakout/index.d.ts +3 -1
- package/dist/types/plugins/caption/index.d.ts +0 -2
- package/dist/types/plugins/card/index.d.ts +3 -1
- package/dist/types/plugins/card/nodeviews/blockCard.d.ts +2 -10
- package/dist/types/plugins/card/nodeviews/genericCard.d.ts +2 -1
- package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +1 -1
- package/dist/types/plugins/card/pm-plugins/util/state.d.ts +1 -0
- package/dist/types/plugins/card/types.d.ts +3 -0
- package/dist/types/plugins/code-bidi-warning/index.d.ts +3 -1
- package/dist/types/plugins/code-block/actions.d.ts +0 -4
- package/dist/types/plugins/code-block/index.d.ts +3 -1
- package/dist/types/plugins/code-block/pm-plugins/main-state.d.ts +0 -3
- package/dist/types/plugins/collab-edit/index.d.ts +3 -1
- package/dist/types/plugins/collab-edit/provider/index.d.ts +1 -2
- package/dist/types/plugins/collab-edit/provider/types.d.ts +1 -36
- package/dist/types/plugins/context-panel/index.d.ts +3 -4
- package/dist/types/plugins/data-consumer/index.d.ts +0 -2
- package/dist/types/plugins/date/utils/internal.d.ts +0 -1
- package/dist/types/plugins/emoji/index.d.ts +3 -1
- package/dist/types/plugins/expand/index.d.ts +3 -1
- package/dist/types/plugins/extension/commands.d.ts +0 -1
- package/dist/types/plugins/extension/index.d.ts +3 -1
- package/dist/types/plugins/extension/nodeviews/extension.d.ts +0 -5
- package/dist/types/plugins/extension/toolbar.d.ts +5 -0
- package/dist/types/plugins/feature-flags-context/index.d.ts +3 -1
- package/dist/types/plugins/feedback-dialog/index.d.ts +3 -3
- package/dist/types/plugins/find-replace/index.d.ts +3 -1
- package/dist/types/plugins/floating-toolbar/ui/Button.d.ts +4 -1
- package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +6 -2
- package/dist/types/plugins/floating-toolbar/utils.d.ts +0 -2
- package/dist/types/plugins/fragment/index.d.ts +0 -2
- package/dist/types/plugins/grid/index.d.ts +3 -1
- package/dist/types/plugins/help-dialog/commands.d.ts +0 -1
- package/dist/types/plugins/help-dialog/index.d.ts +3 -1
- package/dist/types/plugins/history/actions.d.ts +1 -2
- package/dist/types/plugins/hyperlink/analytics.d.ts +1 -1
- package/dist/types/plugins/hyperlink/index.d.ts +3 -1
- package/dist/types/plugins/hyperlink/pm-plugins/main.d.ts +4 -2
- package/dist/types/plugins/hyperlink/types.d.ts +3 -1
- package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/index.d.ts +3 -1
- package/dist/types/plugins/insert-block/index.d.ts +3 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +1 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +1 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +1 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/index.d.ts +1 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +1 -0
- package/dist/types/plugins/layout/index.d.ts +3 -1
- package/dist/types/plugins/layout/styles.d.ts +2 -1
- package/dist/types/plugins/list/index.d.ts +3 -1
- package/dist/types/plugins/list/utils/find.d.ts +0 -1
- package/dist/types/plugins/list/utils/indentation.d.ts +0 -1
- package/dist/types/plugins/list/utils/node.d.ts +0 -2
- package/dist/types/plugins/list/utils/selection.d.ts +0 -3
- package/dist/types/plugins/max-content-size/index.d.ts +3 -1
- package/dist/types/plugins/media/commands/helpers.d.ts +5 -12
- package/dist/types/plugins/media/commands/index.d.ts +1 -1
- package/dist/types/plugins/media/index.d.ts +3 -1
- package/dist/types/plugins/media/nodeviews/__mocks__/mediaNodeUpdater.d.ts +3 -1
- package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +4 -1
- package/dist/types/plugins/media/pm-plugins/main.d.ts +1 -4
- package/dist/types/plugins/media/pm-plugins/types.d.ts +1 -4
- package/dist/types/plugins/media/utils/media-common.d.ts +0 -5
- package/dist/types/plugins/mentions/index.d.ts +3 -1
- package/dist/types/plugins/mentions/types.d.ts +1 -2
- package/dist/types/plugins/mentions/ui/InviteItem/index.d.ts +2 -3
- package/dist/types/plugins/mentions/ui/InviteItem/styles.d.ts +0 -6
- package/dist/types/plugins/mentions/ui/ToolbarMention/index.d.ts +1 -4
- package/dist/types/plugins/mobile-dimensions/index.d.ts +0 -1
- package/dist/types/plugins/panel/index.d.ts +3 -1
- package/dist/types/plugins/paste/handlers.d.ts +2 -1
- package/dist/types/plugins/paste/index.d.ts +3 -2
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +10 -4
- package/dist/types/plugins/paste/util/index.d.ts +0 -6
- package/dist/types/plugins/placeholder/index.d.ts +3 -1
- package/dist/types/plugins/placeholder-text/index.d.ts +3 -1
- package/dist/types/plugins/quick-insert/assets/index.d.ts +0 -2
- package/dist/types/plugins/quick-insert/index.d.ts +3 -1
- package/dist/types/plugins/save-on-enter/index.d.ts +3 -1
- package/dist/types/plugins/selection/index.d.ts +3 -1
- package/dist/types/plugins/status/index.d.ts +3 -1
- package/dist/types/plugins/status/ui/statusPicker.d.ts +3 -0
- package/dist/types/plugins/status/utils.d.ts +0 -3
- package/dist/types/plugins/submit-editor/index.d.ts +3 -1
- package/dist/types/plugins/tasks-and-decisions/index.d.ts +3 -1
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/main.d.ts +0 -6
- package/dist/types/plugins/text-color/index.d.ts +3 -1
- package/dist/types/plugins/text-color/pm-plugins/main.d.ts +2 -12
- package/dist/types/plugins/text-color/ui/ToolbarTextColor/index.d.ts +2 -0
- package/dist/types/plugins/text-formatting/index.d.ts +3 -1
- package/dist/types/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +0 -1
- package/dist/types/plugins/text-formatting/ui/Toolbar/more-button.d.ts +2 -1
- package/dist/types/plugins/text-formatting/utils.d.ts +0 -5
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +3 -1
- package/dist/types/plugins/type-ahead/constants.d.ts +0 -4
- package/dist/types/plugins/type-ahead/index.d.ts +3 -1
- package/dist/types/plugins/type-ahead/pm-plugins/decorations.d.ts +0 -10
- package/dist/types/plugins/type-ahead/utils.d.ts +1 -2
- package/dist/types/test-utils.d.ts +4 -5
- package/dist/types/types/editor-appearance-component.d.ts +2 -2
- package/dist/types/types/editor-props.d.ts +55 -42
- package/dist/types/types/get-editor-props.d.ts +12 -0
- package/dist/types/types/performance-tracking.d.ts +10 -0
- package/dist/types/ui/Appearance/Chromeless.d.ts +0 -5
- package/dist/types/ui/Appearance/Comment/Comment.d.ts +0 -7
- package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +3 -2
- package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +0 -4
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +29 -29
- package/dist/types/ui/AppearanceComponents/Mobile.d.ts +2 -5
- package/dist/types/ui/CollapsedEditor/index.d.ts +4 -3
- package/dist/types/ui/ColorPalette/Palettes/index.d.ts +1 -1
- package/dist/types/ui/ColorPalette/Palettes/type.d.ts +1 -1
- package/dist/types/ui/ColorPalette/index.d.ts +2 -1
- package/dist/types/ui/ColorPickerButton/index.d.ts +5 -2
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types/ui/ConfigPanel/types.d.ts +0 -3
- package/dist/types/ui/ConfigPanel/utils.d.ts +2 -3
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/ContextPanel/context.d.ts +2 -1
- package/dist/types/ui/ElementBrowser/ModalElementBrowser.d.ts +0 -3
- package/dist/types/ui/ElementBrowser/constants.d.ts +0 -1
- package/dist/types/ui/ElementBrowser/types.d.ts +0 -5
- package/dist/types/ui/PanelTextInput/index.d.ts +1 -1
- package/dist/types/ui/PortalProvider/index.d.ts +1 -1
- package/dist/types/ui/Resizer/utils.d.ts +0 -1
- package/dist/types/ui/styles.d.ts +0 -1
- package/dist/types/utils/document.d.ts +4 -3
- package/dist/types/utils/get-editor-plugins.d.ts +10 -0
- package/dist/types/utils/index.d.ts +6 -65
- package/dist/types/utils/input-rules.d.ts +1 -2
- package/dist/types/utils/linking-utils.d.ts +1 -1
- package/dist/types/utils/performance/components/RenderTracking.d.ts +1 -1
- package/dist/types/utils/performance/instrumented-plugin.d.ts +1 -1
- package/dist/types/utils/performance/safer-transactions.d.ts +1 -1
- package/dist/types/utils/prepare-extension-provider.d.ts +5 -0
- package/dist/types/utils/table.d.ts +0 -1
- package/docs/0-intro.tsx +0 -1
- package/package.json +37 -37
- package/report.api.md +307 -244
- package/dist/cjs/labs/next/presets/preset.js +0 -106
- package/dist/cjs/plugins/analytics/analytics-queue.js +0 -79
- package/dist/cjs/plugins/analytics/fire-analytics-event.js +0 -35
- package/dist/cjs/plugins/collab-edit/provider/channel.js +0 -313
- package/dist/cjs/plugins/collab-edit/provider/logger.js +0 -17
- package/dist/cjs/plugins/collab-edit/provider/mock-users.js +0 -19
- package/dist/cjs/plugins/data-consumer/plugin-key.js +0 -9
- package/dist/cjs/plugins/media/toolbar/toolbar-messages.js +0 -15
- package/dist/cjs/profiler/render-count.js +0 -60
- package/dist/cjs/ui/ColorPalette/Color/index.js +0 -9
- package/dist/cjs/ui/ConfigPanel/FieldDescription.js +0 -19
- package/dist/cjs/ui/WithPluginState/types.js +0 -5
- package/dist/es2019/labs/next/presets/preset.js +0 -71
- package/dist/es2019/plugins/analytics/analytics-queue.js +0 -53
- package/dist/es2019/plugins/analytics/fire-analytics-event.js +0 -26
- package/dist/es2019/plugins/collab-edit/provider/channel.js +0 -179
- package/dist/es2019/plugins/collab-edit/provider/logger.js +0 -8
- package/dist/es2019/plugins/collab-edit/provider/mock-users.js +0 -12
- package/dist/es2019/plugins/data-consumer/plugin-key.js +0 -2
- package/dist/es2019/plugins/media/toolbar/toolbar-messages.js +0 -8
- package/dist/es2019/profiler/render-count.js +0 -53
- package/dist/es2019/ui/ColorPalette/Color/index.js +0 -2
- package/dist/es2019/ui/ConfigPanel/FieldDescription.js +0 -12
- package/dist/esm/labs/next/presets/preset.js +0 -98
- package/dist/esm/plugins/analytics/analytics-queue.js +0 -71
- package/dist/esm/plugins/analytics/fire-analytics-event.js +0 -28
- package/dist/esm/plugins/analytics/types/type-ahead.js +0 -1
- package/dist/esm/plugins/collab-edit/provider/channel.js +0 -305
- package/dist/esm/plugins/collab-edit/provider/logger.js +0 -10
- package/dist/esm/plugins/collab-edit/provider/mock-users.js +0 -12
- package/dist/esm/plugins/data-consumer/plugin-key.js +0 -2
- package/dist/esm/plugins/media/toolbar/toolbar-messages.js +0 -8
- package/dist/esm/profiler/render-count.js +0 -49
- package/dist/esm/ui/ColorPalette/Color/index.js +0 -2
- package/dist/esm/ui/ConfigPanel/FieldDescription.js +0 -11
- package/dist/esm/ui/WithPluginState/types.js +0 -1
- package/dist/types/labs/next/presets/preset.d.ts +0 -46
- package/dist/types/plugins/analytics/analytics-queue.d.ts +0 -10
- package/dist/types/plugins/analytics/fire-analytics-event.d.ts +0 -9
- package/dist/types/plugins/analytics/types/type-ahead.d.ts +0 -1
- package/dist/types/plugins/collab-edit/provider/channel.d.ts +0 -48
- package/dist/types/plugins/collab-edit/provider/logger.d.ts +0 -1
- package/dist/types/plugins/collab-edit/provider/mock-users.d.ts +0 -6
- package/dist/types/plugins/data-consumer/plugin-key.d.ts +0 -2
- package/dist/types/plugins/media/toolbar/toolbar-messages.d.ts +0 -7
- package/dist/types/profiler/render-count.d.ts +0 -14
- package/dist/types/ui/ColorPalette/Color/index.d.ts +0 -2
- package/dist/types/ui/ConfigPanel/FieldDescription.d.ts +0 -6
- package/dist/types/ui/WithPluginState/types.d.ts +0 -10
- /package/dist/cjs/{plugins/analytics/types/type-ahead.js → types/get-editor-props.js} +0 -0
- /package/dist/es2019/{plugins/analytics/types/type-ahead.js → types/get-editor-props.js} +0 -0
- /package/dist/{es2019/ui/WithPluginState/types.js → esm/types/get-editor-props.js} +0 -0
|
@@ -6,6 +6,8 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
13
|
/** @jsx jsx */
|
|
@@ -31,18 +33,30 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
31
33
|
}
|
|
32
34
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
33
35
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
34
|
-
active: false
|
|
36
|
+
active: false,
|
|
37
|
+
isOpenedByKeyboard: false
|
|
35
38
|
});
|
|
36
39
|
_defineProperty(_assertThisInitialized(_this), "onOpenChange", function (attrs) {
|
|
37
|
-
_this.setState({
|
|
38
|
-
active: attrs.isOpen
|
|
39
|
-
|
|
40
|
+
_this.setState(_objectSpread(_objectSpread({}, _this.state), {}, {
|
|
41
|
+
active: attrs.isOpen,
|
|
42
|
+
isOpenedByKeyboard: attrs.isOpenedByKeyboard
|
|
43
|
+
}));
|
|
40
44
|
});
|
|
41
45
|
_defineProperty(_assertThisInitialized(_this), "handleTriggerClick", function () {
|
|
42
46
|
_this.onOpenChange({
|
|
43
|
-
isOpen: !_this.state.active
|
|
47
|
+
isOpen: !_this.state.active,
|
|
48
|
+
isOpenedByKeyboard: false
|
|
44
49
|
});
|
|
45
50
|
});
|
|
51
|
+
_defineProperty(_assertThisInitialized(_this), "handleTriggerByKeyboard", function (event) {
|
|
52
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
53
|
+
event.preventDefault();
|
|
54
|
+
_this.onOpenChange({
|
|
55
|
+
isOpen: !_this.state.active,
|
|
56
|
+
isOpenedByKeyboard: true
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
});
|
|
46
60
|
_defineProperty(_assertThisInitialized(_this), "createItems", function () {
|
|
47
61
|
var formatMessage = _this.props.intl.formatMessage;
|
|
48
62
|
var _this$props$pluginSta = _this.props.pluginState,
|
|
@@ -79,9 +93,9 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
79
93
|
var blockType = item.value;
|
|
80
94
|
_this.props.setBlockType(blockType.name);
|
|
81
95
|
if (shouldCloseMenu) {
|
|
82
|
-
_this.setState({
|
|
96
|
+
_this.setState(_objectSpread(_objectSpread({}, _this.state), {}, {
|
|
83
97
|
active: false
|
|
84
|
-
});
|
|
98
|
+
}));
|
|
85
99
|
}
|
|
86
100
|
});
|
|
87
101
|
return _this;
|
|
@@ -89,7 +103,10 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
89
103
|
_createClass(ToolbarBlockType, [{
|
|
90
104
|
key: "render",
|
|
91
105
|
value: function render() {
|
|
92
|
-
var
|
|
106
|
+
var _this2 = this;
|
|
107
|
+
var _this$state = this.state,
|
|
108
|
+
active = _this$state.active,
|
|
109
|
+
isOpenedByKeyboard = _this$state.isOpenedByKeyboard;
|
|
93
110
|
var _this$props = this.props,
|
|
94
111
|
popupsMountPoint = _this$props.popupsMountPoint,
|
|
95
112
|
popupsBoundariesElement = _this$props.popupsBoundariesElement,
|
|
@@ -131,7 +148,15 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
131
148
|
zIndex: akEditorMenuZIndex,
|
|
132
149
|
fitHeight: 360,
|
|
133
150
|
fitWidth: 106,
|
|
134
|
-
shouldUseDefaultRole: true
|
|
151
|
+
shouldUseDefaultRole: true,
|
|
152
|
+
shouldFocusFirstItem: function shouldFocusFirstItem() {
|
|
153
|
+
if (isOpenedByKeyboard) {
|
|
154
|
+
_this2.setState(_objectSpread(_objectSpread({}, _this2.state), {}, {
|
|
155
|
+
isOpenedByKeyboard: false
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
158
|
+
return isOpenedByKeyboard;
|
|
159
|
+
}
|
|
135
160
|
}, jsx(BlockTypeButton, {
|
|
136
161
|
isSmall: isSmall,
|
|
137
162
|
isReducedSpacing: isReducedSpacing,
|
|
@@ -139,6 +164,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
139
164
|
disabled: false,
|
|
140
165
|
title: blockTypeTitles[0],
|
|
141
166
|
onClick: this.handleTriggerClick,
|
|
167
|
+
onKeyDown: this.handleTriggerByKeyboard,
|
|
142
168
|
formatMessage: formatMessage,
|
|
143
169
|
"aria-expanded": active
|
|
144
170
|
}, longestDropdownMenuItem)), jsx("span", {
|
|
@@ -154,6 +180,7 @@ var ToolbarBlockType = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
154
180
|
disabled: true,
|
|
155
181
|
title: blockTypeTitles[0],
|
|
156
182
|
onClick: this.handleTriggerClick,
|
|
183
|
+
onKeyDown: this.handleTriggerByKeyboard,
|
|
157
184
|
formatMessage: formatMessage,
|
|
158
185
|
"aria-expanded": active
|
|
159
186
|
}, longestDropdownMenuItem), jsx("span", {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { caption } from '@atlaskit/adf-schema';
|
|
2
2
|
import { default as createCaptionPlugin } from './pm-plugins/main';
|
|
3
|
-
import { pluginKey } from './pm-plugins/plugin-key';
|
|
4
3
|
import { captionKeymap } from './pm-plugins/keymap';
|
|
5
|
-
export { pluginKey };
|
|
6
4
|
var captionPlugin = function captionPlugin() {
|
|
7
5
|
return {
|
|
8
6
|
name: 'caption',
|
|
@@ -76,7 +76,8 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
76
76
|
var _this$props2 = this.props,
|
|
77
77
|
node = _this$props2.node,
|
|
78
78
|
cardContext = _this$props2.cardContext,
|
|
79
|
-
platform = _this$props2.platform
|
|
79
|
+
platform = _this$props2.platform,
|
|
80
|
+
showServerActions = _this$props2.showServerActions;
|
|
80
81
|
var _node$attrs = node.attrs,
|
|
81
82
|
url = _node$attrs.url,
|
|
82
83
|
data = _node$attrs.data;
|
|
@@ -89,7 +90,8 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
89
90
|
onClick: this.onClick,
|
|
90
91
|
onResolve: this.onResolve,
|
|
91
92
|
showActions: platform === 'web',
|
|
92
|
-
platform: platform
|
|
93
|
+
platform: platform,
|
|
94
|
+
showServerActions: showServerActions
|
|
93
95
|
}), this.gapCursorSpan());
|
|
94
96
|
// [WS-2307]: we only render card wrapped into a Provider when the value is ready,
|
|
95
97
|
// otherwise if we got data, we can render the card directly since it doesn't need the Provider
|
|
@@ -126,11 +128,15 @@ export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
126
128
|
}, {
|
|
127
129
|
key: "render",
|
|
128
130
|
value: function render() {
|
|
131
|
+
var _this$reactComponentP = this.reactComponentProps,
|
|
132
|
+
platform = _this$reactComponentP.platform,
|
|
133
|
+
showServerActions = _this$reactComponentP.showServerActions;
|
|
129
134
|
return /*#__PURE__*/React.createElement(WrappedBlockCard, {
|
|
130
135
|
node: this.node,
|
|
131
136
|
view: this.view,
|
|
132
137
|
getPos: this.getPos,
|
|
133
|
-
platform:
|
|
138
|
+
platform: platform,
|
|
139
|
+
showServerActions: showServerActions
|
|
134
140
|
});
|
|
135
141
|
}
|
|
136
142
|
}]);
|
|
@@ -13,6 +13,9 @@ import PropTypes from 'prop-types';
|
|
|
13
13
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
14
14
|
import { titleUrlPairFromNode } from '../utils';
|
|
15
15
|
import { changeSelectedCardToLinkFallback } from '../pm-plugins/doc';
|
|
16
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
17
|
+
import { getPluginState } from '../pm-plugins/util/state';
|
|
18
|
+
import { getAnalyticsEditorAppearance } from '@atlaskit/editor-common/utils';
|
|
16
19
|
export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
17
20
|
var _class;
|
|
18
21
|
return _class = /*#__PURE__*/function (_React$Component) {
|
|
@@ -33,6 +36,7 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
33
36
|
_createClass(_class, [{
|
|
34
37
|
key: "render",
|
|
35
38
|
value: function render() {
|
|
39
|
+
var _getPluginState;
|
|
36
40
|
var _titleUrlPairFromNode = titleUrlPairFromNode(this.props.node),
|
|
37
41
|
url = _titleUrlPairFromNode.url;
|
|
38
42
|
if (url && !isSafeUrl(url)) {
|
|
@@ -51,10 +55,20 @@ export function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
57
|
var cardContext = this.context.contextAdapter ? this.context.contextAdapter.card : undefined;
|
|
54
|
-
|
|
58
|
+
var editorAppearance = (_getPluginState = getPluginState(this.props.view.state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.editorAppearance;
|
|
59
|
+
var analyticsEditorAppearance = getAnalyticsEditorAppearance(editorAppearance);
|
|
60
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
61
|
+
data: {
|
|
62
|
+
attributes: {
|
|
63
|
+
location: analyticsEditorAppearance
|
|
64
|
+
},
|
|
65
|
+
// Below is added for the future implementation of Linking Platform namespaced analytics context
|
|
66
|
+
location: analyticsEditorAppearance
|
|
67
|
+
}
|
|
68
|
+
}, /*#__PURE__*/React.createElement(SmartCardComponent, _extends({
|
|
55
69
|
key: url,
|
|
56
70
|
cardContext: cardContext
|
|
57
|
-
}, this.props));
|
|
71
|
+
}, this.props)));
|
|
58
72
|
}
|
|
59
73
|
}, {
|
|
60
74
|
key: "componentDidCatch",
|
|
@@ -66,6 +66,7 @@ export var InlineCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
66
66
|
var _this$props2 = this.props,
|
|
67
67
|
node = _this$props2.node,
|
|
68
68
|
cardContext = _this$props2.cardContext,
|
|
69
|
+
showServerActions = _this$props2.showServerActions,
|
|
69
70
|
useAlternativePreloader = _this$props2.useAlternativePreloader;
|
|
70
71
|
var _node$attrs = node.attrs,
|
|
71
72
|
url = _node$attrs.url,
|
|
@@ -81,7 +82,8 @@ export var InlineCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
81
82
|
container: this.scrollContainer,
|
|
82
83
|
onResolve: this.onResolve,
|
|
83
84
|
onError: this.onError,
|
|
84
|
-
inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined
|
|
85
|
+
inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined,
|
|
86
|
+
showServerActions: showServerActions
|
|
85
87
|
}));
|
|
86
88
|
// [WS-2307]: we only render card wrapped into a Provider when the value is ready,
|
|
87
89
|
// otherwise if we got data, we can render the card directly since it doesn't need the Provider
|
|
@@ -100,11 +102,13 @@ export function InlineCardNodeView(props) {
|
|
|
100
102
|
var useAlternativePreloader = props.useAlternativePreloader,
|
|
101
103
|
node = props.node,
|
|
102
104
|
view = props.view,
|
|
103
|
-
getPos = props.getPos
|
|
105
|
+
getPos = props.getPos,
|
|
106
|
+
showServerActions = props.showServerActions;
|
|
104
107
|
return /*#__PURE__*/React.createElement(WrappedInlineCard, {
|
|
105
108
|
node: node,
|
|
106
109
|
view: view,
|
|
107
110
|
getPos: getPos,
|
|
111
|
+
showServerActions: showServerActions,
|
|
108
112
|
useAlternativePreloader: useAlternativePreloader
|
|
109
113
|
});
|
|
110
114
|
}
|
|
@@ -11,11 +11,13 @@ import { getNewRequests, getPluginState, getPluginStateWithUpdatedPos } from './
|
|
|
11
11
|
export { pluginKey } from './plugin-key';
|
|
12
12
|
export var createPlugin = function createPlugin(options) {
|
|
13
13
|
return function (pmPluginFactoryParams) {
|
|
14
|
-
var
|
|
14
|
+
var editorAppearance = options.editorAppearance,
|
|
15
|
+
platform = options.platform,
|
|
15
16
|
allowResizing = options.allowResizing,
|
|
16
17
|
useAlternativePreloader = options.useAlternativePreloader,
|
|
17
18
|
fullWidthMode = options.fullWidthMode,
|
|
18
|
-
createAnalyticsEvent = options.createAnalyticsEvent
|
|
19
|
+
createAnalyticsEvent = options.createAnalyticsEvent,
|
|
20
|
+
showServerActions = options.showServerActions;
|
|
19
21
|
return new SafePlugin({
|
|
20
22
|
state: {
|
|
21
23
|
init: function init() {
|
|
@@ -25,7 +27,8 @@ export var createPlugin = function createPlugin(options) {
|
|
|
25
27
|
cards: [],
|
|
26
28
|
showLinkingToolbar: false,
|
|
27
29
|
smartLinkEvents: undefined,
|
|
28
|
-
createAnalyticsEvent: createAnalyticsEvent
|
|
30
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
31
|
+
editorAppearance: editorAppearance
|
|
29
32
|
};
|
|
30
33
|
},
|
|
31
34
|
apply: function apply(tr, pluginState) {
|
|
@@ -95,14 +98,16 @@ export var createPlugin = function createPlugin(options) {
|
|
|
95
98
|
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
96
99
|
Component: InlineCardNodeView,
|
|
97
100
|
extraComponentProps: {
|
|
98
|
-
useAlternativePreloader: useAlternativePreloader
|
|
101
|
+
useAlternativePreloader: useAlternativePreloader,
|
|
102
|
+
showServerActions: showServerActions
|
|
99
103
|
}
|
|
100
104
|
}),
|
|
101
105
|
blockCard: function blockCard(node, view, getPos) {
|
|
102
106
|
var portalProviderAPI = pmPluginFactoryParams.portalProviderAPI,
|
|
103
107
|
eventDispatcher = pmPluginFactoryParams.eventDispatcher;
|
|
104
108
|
var reactComponentProps = {
|
|
105
|
-
platform: platform
|
|
109
|
+
platform: platform,
|
|
110
|
+
showServerActions: showServerActions
|
|
106
111
|
};
|
|
107
112
|
var hasIntlContext = true;
|
|
108
113
|
return new BlockCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, undefined, true, undefined, hasIntlContext).init();
|
|
@@ -21,6 +21,10 @@ export var resolveWithProvider = function resolveWithProvider(view, outstandingR
|
|
|
21
21
|
};
|
|
22
22
|
var updateCardType = function updateCardType(resolvedCard, options) {
|
|
23
23
|
if ((resolvedCard === null || resolvedCard === void 0 ? void 0 : resolvedCard.type) === 'blockCard' && !options.allowBlockCards || (resolvedCard === null || resolvedCard === void 0 ? void 0 : resolvedCard.type) === 'embedCard' && !options.allowEmbeds) {
|
|
24
|
+
// clean out the 'layout' attr from an embedCard type that should be transformed into the inlineCard type.
|
|
25
|
+
if (resolvedCard.type === 'embedCard') {
|
|
26
|
+
delete resolvedCard.attrs.layout;
|
|
27
|
+
}
|
|
24
28
|
resolvedCard.type = 'inlineCard';
|
|
25
29
|
}
|
|
26
30
|
};
|
|
@@ -84,7 +84,10 @@ export var createClipboardSerializer = function createClipboardSerializer(schema
|
|
|
84
84
|
var parentTable = findParentNodeOfType(schema.nodes.table)(selection);
|
|
85
85
|
var attributes = parentTable === null || parentTable === void 0 ? void 0 : parentTable.node.attrs;
|
|
86
86
|
var newTable = schema.nodes.table;
|
|
87
|
-
|
|
87
|
+
// Explicitly remove local id since we are creating a new table and it should have a unique local id which will be generated.
|
|
88
|
+
var newTableNode = newTable.createChecked(_objectSpread(_objectSpread({}, attributes), {}, {
|
|
89
|
+
localId: undefined
|
|
90
|
+
}), content);
|
|
88
91
|
var newContent = Fragment.from(newTableNode);
|
|
89
92
|
// Pass updated content into original ProseMirror serializeFragment function.
|
|
90
93
|
// Currently incorrectly typed in @Types. See this GitHub thread: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/57668
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
1
|
import { pluginKey } from '../plugin-key';
|
|
5
2
|
export var getPluginState = function getPluginState(state) {
|
|
6
3
|
return pluginKey.getState(state);
|
|
7
|
-
};
|
|
8
|
-
export var setPluginState = function setPluginState(stateProps) {
|
|
9
|
-
return function (state, dispatch) {
|
|
10
|
-
var pluginState = getPluginState(state);
|
|
11
|
-
dispatch(state.tr.setMeta(pluginKey, _objectSpread(_objectSpread({}, pluginState), stateProps)));
|
|
12
|
-
return true;
|
|
13
|
-
};
|
|
14
4
|
};
|
|
@@ -3,8 +3,7 @@ import { initialize } from './events/initialize';
|
|
|
3
3
|
import { PluginState } from './plugin-state';
|
|
4
4
|
import { pluginKey } from './plugin-key';
|
|
5
5
|
import { addSynchronyErrorAnalytics } from './analytics';
|
|
6
|
-
import { fireAnalyticsEvent } from '
|
|
7
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
|
|
6
|
+
import { fireAnalyticsEvent, ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
8
7
|
export { PluginState, pluginKey };
|
|
9
8
|
export var createPlugin = function createPlugin(dispatch, providerFactory, collabProviderCallback, options) {
|
|
10
9
|
var fireAnalyticsCallback = fireAnalyticsEvent(options === null || options === void 0 ? void 0 : options.createAnalyticsEvent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Same as PubSub client types (don't want a direct dep though)
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export var PubSubSpecialEventType;
|
|
6
|
-
(function (PubSubSpecialEventType) {
|
|
7
|
-
PubSubSpecialEventType["ERROR"] = "ERROR";
|
|
8
|
-
PubSubSpecialEventType["CONNECTED"] = "CONNECTED";
|
|
9
|
-
PubSubSpecialEventType["RECONNECT"] = "RECONNECT";
|
|
10
|
-
})(PubSubSpecialEventType || (PubSubSpecialEventType = {}));
|
|
1
|
+
export {};
|
|
@@ -4,9 +4,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
5
|
import { PluginKey } from 'prosemirror-state';
|
|
6
6
|
export var pluginKey = new PluginKey('contextPanelPluginKey');
|
|
7
|
-
export function getPluginState(state) {
|
|
8
|
-
return pluginKey.getState(state);
|
|
9
|
-
}
|
|
10
7
|
function contextPanelPluginFactory(contextPanels, dispatch) {
|
|
11
8
|
return new SafePlugin({
|
|
12
9
|
key: pluginKey,
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { dataConsumer } from '@atlaskit/adf-schema';
|
|
2
|
-
import { Plugin } from 'prosemirror-state';
|
|
3
|
-
import { pluginKey } from './plugin-key';
|
|
4
|
-
export function createPlugin() {
|
|
5
|
-
return new Plugin({
|
|
6
|
-
key: pluginKey
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
2
|
var dataConsumerMarkPlugin = function dataConsumerMarkPlugin() {
|
|
10
3
|
return {
|
|
11
4
|
name: 'dataConsumerPlugin',
|
|
@@ -5,9 +5,6 @@ import { formatDateType, dateTypeToDate, dateToDateType } from './formatParse';
|
|
|
5
5
|
import addDays from 'date-fns/addDays';
|
|
6
6
|
import addMonths from 'date-fns/addMonths';
|
|
7
7
|
import addYears from 'date-fns/addYears';
|
|
8
|
-
export function padToTwo(number) {
|
|
9
|
-
return number <= 99 ? "0".concat(number).slice(-2) : "".concat(number);
|
|
10
|
-
}
|
|
11
8
|
function isDigit(c) {
|
|
12
9
|
if (c === undefined) {
|
|
13
10
|
return false;
|
|
@@ -42,12 +42,6 @@ export var forceAutoSave = function forceAutoSave(resolve, reject) {
|
|
|
42
42
|
}
|
|
43
43
|
}, applyChange);
|
|
44
44
|
};
|
|
45
|
-
export var showContextPanel = createCommand({
|
|
46
|
-
type: 'UPDATE_STATE',
|
|
47
|
-
data: {
|
|
48
|
-
showContextPanel: true
|
|
49
|
-
}
|
|
50
|
-
}, applyChange);
|
|
51
45
|
export var updateExtensionLayout = function updateExtensionLayout(layout) {
|
|
52
46
|
return createCommand({
|
|
53
47
|
type: 'UPDATE_STATE',
|
|
@@ -25,6 +25,11 @@ export var messages = defineMessages({
|
|
|
25
25
|
defaultMessage: 'Delete element',
|
|
26
26
|
description: 'Title text for confirm modal when deleting an extension linked to a data consumer.'
|
|
27
27
|
},
|
|
28
|
+
unnamedSource: {
|
|
29
|
+
id: 'fabric.editor.extension.sourceNoTitledName',
|
|
30
|
+
defaultMessage: 'this element',
|
|
31
|
+
description: 'The current element without preset name been selected'
|
|
32
|
+
},
|
|
28
33
|
confirmDeleteLinkedModalOKButton: {
|
|
29
34
|
id: 'fabric.editor.extension.confirmDeleteLinkedModalOKButton',
|
|
30
35
|
defaultMessage: 'Delete',
|
|
@@ -122,11 +127,12 @@ export var getToolbarConfig = function getToolbarConfig() {
|
|
|
122
127
|
var confirmDialog;
|
|
123
128
|
if (isReferencedSource(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node)) {
|
|
124
129
|
confirmDialog = function confirmDialog() {
|
|
130
|
+
var localSourceName = formatMessage(messages.unnamedSource);
|
|
125
131
|
return {
|
|
126
132
|
title: formatMessage(messages.deleteElementTitle),
|
|
127
133
|
okButtonLabel: formatMessage(messages.confirmDeleteLinkedModalOKButton),
|
|
128
134
|
message: formatMessage(messages.confirmDeleteLinkedModalMessage, {
|
|
129
|
-
nodeName: getNodeName(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node)
|
|
135
|
+
nodeName: getNodeName(state, extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node) || localSourceName
|
|
130
136
|
}),
|
|
131
137
|
isReferentialityDialog: true,
|
|
132
138
|
getChildrenInfo: function getChildrenInfo() {
|
|
@@ -2,6 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
4
|
var _excluded = ["type"];
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
7
|
/** @jsx jsx */
|
|
6
8
|
import React from 'react';
|
|
7
9
|
import { jsx } from '@emotion/react';
|
|
@@ -45,7 +47,10 @@ function ExtensionWithPluginState(props) {
|
|
|
45
47
|
'with-children': hasChildren,
|
|
46
48
|
'without-frame': removeBorder
|
|
47
49
|
});
|
|
48
|
-
var customContainerStyles = {
|
|
50
|
+
var customContainerStyles = {
|
|
51
|
+
width: '100%'
|
|
52
|
+
};
|
|
53
|
+
var newContentStyles = {};
|
|
49
54
|
if (shouldBreakout) {
|
|
50
55
|
var _calculateBreakoutSty = calculateBreakoutStyles({
|
|
51
56
|
mode: node.attrs.layout,
|
|
@@ -54,8 +59,10 @@ function ExtensionWithPluginState(props) {
|
|
|
54
59
|
}),
|
|
55
60
|
type = _calculateBreakoutSty.type,
|
|
56
61
|
breakoutStyles = _objectWithoutProperties(_calculateBreakoutSty, _excluded);
|
|
62
|
+
newContentStyles = _objectSpread({}, breakoutStyles);
|
|
57
63
|
customContainerStyles = breakoutStyles;
|
|
58
64
|
}
|
|
65
|
+
newContentStyles = _objectSpread(_objectSpread({}, newContentStyles), contentWrapper);
|
|
59
66
|
return jsx("div", {
|
|
60
67
|
ref: handleRef,
|
|
61
68
|
"data-layout": node.attrs.layout,
|
|
@@ -74,7 +81,7 @@ function ExtensionWithPluginState(props) {
|
|
|
74
81
|
}, !removeBorder && jsx(ExtensionLozenge, {
|
|
75
82
|
node: node
|
|
76
83
|
}), children), hasBody && jsx("div", {
|
|
77
|
-
css:
|
|
84
|
+
css: newContentStyles
|
|
78
85
|
}, jsx("div", {
|
|
79
86
|
css: content,
|
|
80
87
|
ref: handleContentDOMRef,
|
|
@@ -11,11 +11,11 @@ export var wrapperStyle = function wrapperStyle(theme) {
|
|
|
11
11
|
};
|
|
12
12
|
export var header = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: ", "px ", "px 0px;\n vertical-align: middle;\n\n &.with-children:not(.without-frame) {\n padding: 4px 8px 8px;\n }\n &.without-frame {\n padding: 0;\n }\n"])), padding / 2, padding / 2);
|
|
13
13
|
export var content = function content(theme) {
|
|
14
|
-
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: ", "px;\n background: ", ";\n color: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n cursor: initial;\n"])), padding, themed({
|
|
14
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: ", "px;\n background: ", ";\n color: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n cursor: initial;\n width: 100%;\n"])), padding, themed({
|
|
15
15
|
light: "var(--ds-surface, white)",
|
|
16
16
|
dark: "var(--ds-surface, ".concat(DN30, ")")
|
|
17
17
|
})(theme), themed({
|
|
18
18
|
dark: "var(--ds-text, ".concat(DN900, ")")
|
|
19
19
|
})(theme), "var(--ds-border, ".concat(N30, ")"), borderRadius());
|
|
20
20
|
};
|
|
21
|
-
export var contentWrapper = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 0 ", "px ", "px;\n"])), padding, padding);
|
|
21
|
+
export var contentWrapper = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 0 ", "px ", "px;\n display: flex;\n justify-content: center;\n"])), padding, padding);
|
|
@@ -69,6 +69,7 @@ var ExtensionLozenge = /*#__PURE__*/function (_Component) {
|
|
|
69
69
|
var title = parameters && parameters.extensionTitle || parameters && parameters.macroMetadata && parameters.macroMetadata.title || extensionKey;
|
|
70
70
|
var isBlockExtension = name === 'extension';
|
|
71
71
|
return jsx("div", {
|
|
72
|
+
"data-testid": "lozenge-fallback",
|
|
72
73
|
css: placeholderFallback
|
|
73
74
|
}, lozengeData && !isBlockExtension ? this.renderImage(_objectSpread({
|
|
74
75
|
height: ICON_SIZE,
|
|
@@ -5,13 +5,11 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
5
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import { PluginKey } from 'prosemirror-state';
|
|
9
8
|
import { IconFeedback } from '../quick-insert/assets';
|
|
10
9
|
import { version as coreVersion } from '../../version-wrapper';
|
|
11
10
|
import { addAnalytics, ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE } from '../analytics';
|
|
12
11
|
import loadJiraCollectorDialogScript from './loadJiraCollectorDialogScript';
|
|
13
12
|
import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
14
|
-
export var pluginKey = new PluginKey('feedbackDialogPlugin');
|
|
15
13
|
var showJiraCollectorDialog;
|
|
16
14
|
var feedbackInfoHash;
|
|
17
15
|
var defaultFeedbackInfo;
|
|
@@ -22,6 +22,7 @@ import FindReplace from './FindReplace';
|
|
|
22
22
|
import { TRIGGER_METHOD } from '../../analytics/types';
|
|
23
23
|
import { ToolTipContent, findKeymapByDescription, tooltip } from '../../../keymaps';
|
|
24
24
|
import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
25
|
+
import { ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu';
|
|
25
26
|
var toolbarButtonWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex: 1 1 auto;\n flex-grow: 0;\n justify-content: flex-end;\n align-items: center;\n padding: 0 8px;\n @media (max-width: ", "px) {\n justify-content: center;\n padding: 0;\n }\n"])), akEditorMobileMaxWidth);
|
|
26
27
|
var toolbarButtonWrapperFullWith = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-grow: 1;\n"])));
|
|
27
28
|
var wrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n"])));
|
|
@@ -88,7 +89,10 @@ var FindReplaceToolbarButton = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
88
89
|
},
|
|
89
90
|
fitWidth: 352,
|
|
90
91
|
zIndex: stackBelowOtherEditorFloatingPanels,
|
|
91
|
-
|
|
92
|
+
arrowKeyNavigationProviderOptions: {
|
|
93
|
+
type: ArrowKeyNavigationType.MENU,
|
|
94
|
+
disableArrowKeyNavigation: true
|
|
95
|
+
},
|
|
92
96
|
trigger: jsx(ToolbarButton, {
|
|
93
97
|
buttonId: TOOLBAR_BUTTON.FIND_REPLACE,
|
|
94
98
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
@@ -12,6 +12,7 @@ export default (function (_ref) {
|
|
|
12
12
|
icon = _ref.icon,
|
|
13
13
|
iconAfter = _ref.iconAfter,
|
|
14
14
|
onClick = _ref.onClick,
|
|
15
|
+
onKeyDown = _ref.onKeyDown,
|
|
15
16
|
onMouseEnter = _ref.onMouseEnter,
|
|
16
17
|
onMouseLeave = _ref.onMouseLeave,
|
|
17
18
|
onFocus = _ref.onFocus,
|
|
@@ -29,7 +30,9 @@ export default (function (_ref) {
|
|
|
29
30
|
_ref$hideTooltipOnCli = _ref.hideTooltipOnClick,
|
|
30
31
|
hideTooltipOnClick = _ref$hideTooltipOnCli === void 0 ? true : _ref$hideTooltipOnCli,
|
|
31
32
|
ariaHasPopup = _ref.ariaHasPopup,
|
|
32
|
-
tabIndex = _ref.tabIndex
|
|
33
|
+
tabIndex = _ref.tabIndex,
|
|
34
|
+
areaControls = _ref.areaControls,
|
|
35
|
+
ariaLabel = _ref.ariaLabel;
|
|
33
36
|
// Check if there's only an icon and add additional styles
|
|
34
37
|
var iconOnly = (icon || iconAfter) && !children;
|
|
35
38
|
var customSpacing = iconOnly ? iconOnlySpacing : {};
|
|
@@ -54,8 +57,10 @@ export default (function (_ref) {
|
|
|
54
57
|
}))
|
|
55
58
|
}, rest);
|
|
56
59
|
},
|
|
57
|
-
"aria-label": title,
|
|
58
|
-
"aria-pressed": selected,
|
|
60
|
+
"aria-label": ariaLabel || title,
|
|
61
|
+
"aria-pressed": !ariaHasPopup ? selected : undefined,
|
|
62
|
+
"aria-expanded": ariaHasPopup ? selected : undefined,
|
|
63
|
+
"aria-controls": ariaHasPopup ? areaControls : undefined,
|
|
59
64
|
spacing: 'compact',
|
|
60
65
|
href: href,
|
|
61
66
|
target: target,
|
|
@@ -64,6 +69,7 @@ export default (function (_ref) {
|
|
|
64
69
|
iconBefore: icon || undefined,
|
|
65
70
|
iconAfter: iconAfter,
|
|
66
71
|
onClick: onClick,
|
|
72
|
+
onKeyDown: onKeyDown,
|
|
67
73
|
isSelected: selected,
|
|
68
74
|
isDisabled: disabled,
|
|
69
75
|
testId: testId,
|
|
@@ -6,6 +6,7 @@ import { Checkbox } from '@atlaskit/checkbox';
|
|
|
6
6
|
import Modal, { ModalBody, ModalTitle, ModalHeader, ModalFooter } from '@atlaskit/modal-dialog';
|
|
7
7
|
import messages from './messages';
|
|
8
8
|
export var CheckboxModal = function CheckboxModal(props) {
|
|
9
|
+
var _options$getChildrenI;
|
|
9
10
|
var _useState = useState(false),
|
|
10
11
|
_useState2 = _slicedToArray(_useState, 2),
|
|
11
12
|
isChecked = _useState2[0],
|
|
@@ -19,9 +20,10 @@ export var CheckboxModal = function CheckboxModal(props) {
|
|
|
19
20
|
var okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(messages.confirmModalOK);
|
|
20
21
|
var cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(messages.confirmModalCancel);
|
|
21
22
|
var checkboxlabel = options === null || options === void 0 ? void 0 : options.checkboxLabel;
|
|
23
|
+
var childrenInfo = options === null || options === void 0 ? void 0 : (_options$getChildrenI = options.getChildrenInfo) === null || _options$getChildrenI === void 0 ? void 0 : _options$getChildrenI.call(options);
|
|
22
24
|
var ListComponent = function ListComponent(_ref) {
|
|
23
25
|
var nodes = _ref.nodes;
|
|
24
|
-
if (
|
|
26
|
+
if (nodes.length === 0) {
|
|
25
27
|
return null;
|
|
26
28
|
}
|
|
27
29
|
return /*#__PURE__*/React.createElement("ul", null, nodes.map(function (node) {
|
|
@@ -46,8 +48,8 @@ export var CheckboxModal = function CheckboxModal(props) {
|
|
|
46
48
|
testId: testId
|
|
47
49
|
}, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
48
50
|
appearance: "warning"
|
|
49
|
-
}, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("p", null, options === null || options === void 0 ? void 0 : options.message), (
|
|
50
|
-
nodes:
|
|
51
|
+
}, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("p", null, options === null || options === void 0 ? void 0 : options.message), !!(childrenInfo !== null && childrenInfo !== void 0 && childrenInfo.length) && /*#__PURE__*/React.createElement(ListComponent, {
|
|
52
|
+
nodes: childrenInfo
|
|
51
53
|
}), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
52
54
|
isChecked: isChecked,
|
|
53
55
|
onChange: function onChange() {
|