@atlaskit/editor-core 171.0.1 → 172.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 +84 -0
- package/codemods/172.0.0-transform-smartlinks-prop.ts +8 -0
- package/codemods/__tests__/rename-smartlinks-prop.ts +204 -0
- package/codemods/migrates/rename-smartlinks-prop.ts +56 -0
- package/dist/cjs/create-editor/ReactEditorView.js +13 -4
- package/dist/cjs/create-editor/create-plugins-list.js +21 -12
- package/dist/cjs/editor.js +8 -23
- package/dist/cjs/labs/next/internal/hooks/use-editor/index.js +6 -1
- package/dist/cjs/labs/next/presets/default.js +1 -1
- package/dist/cjs/nodeviews/context-adapter.js +2 -2
- package/dist/cjs/plugins/analytics/plugin.js +24 -11
- package/dist/cjs/plugins/base/index.js +3 -3
- package/dist/cjs/plugins/base/pm-plugins/disable-spell-checking.js +84 -0
- package/dist/cjs/plugins/card/index.js +1 -1
- package/dist/cjs/plugins/card/toolbar.js +11 -5
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +5 -1
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +7 -7
- package/dist/cjs/plugins/clipboard/pm-plugins/main.js +4 -2
- package/dist/cjs/plugins/code-block/actions.js +13 -0
- package/dist/cjs/plugins/code-block/index.js +7 -0
- package/dist/cjs/plugins/code-block/nodeviews/code-block.js +2 -4
- package/dist/cjs/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +132 -0
- package/dist/cjs/plugins/code-block/pm-plugins/main.js +1 -23
- package/dist/cjs/plugins/code-block/styles.js +3 -36
- package/dist/cjs/plugins/code-block/toolbar.js +9 -0
- package/dist/cjs/plugins/code-block/ui/class-names.js +1 -2
- package/dist/cjs/plugins/copy-button/commands.js +40 -20
- package/dist/cjs/plugins/copy-button/toolbar.js +51 -0
- package/dist/cjs/plugins/copy-button/utils.js +16 -38
- package/dist/cjs/plugins/expand/toolbar.js +8 -2
- package/dist/cjs/plugins/extension/toolbar.js +5 -1
- package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +1 -1
- package/dist/cjs/plugins/extension/ui/Extension/InlineExtension/styles.js +1 -1
- package/dist/cjs/plugins/extension/ui/Extension/styles.js +2 -4
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +29 -18
- package/dist/cjs/plugins/feedback-dialog/index.js +2 -2
- package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +0 -20
- package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +7 -32
- package/dist/cjs/plugins/hyperlink/Toolbar.js +146 -135
- package/dist/cjs/plugins/hyperlink/index.js +4 -4
- package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +50 -0
- package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.js +38 -0
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +50 -5
- package/dist/cjs/plugins/indentation/commands/index.js +35 -7
- package/dist/cjs/plugins/indentation/commands/utils.js +11 -7
- package/dist/cjs/plugins/indentation/pm-plugins/keymap.js +5 -3
- package/dist/cjs/plugins/layout/toolbar.js +3 -1
- package/dist/cjs/plugins/media/toolbar/index.js +13 -5
- package/dist/cjs/plugins/mentions/analytics.js +5 -5
- package/dist/cjs/plugins/panel/toolbar.js +3 -3
- package/dist/cjs/plugins/paste/edge-cases/index.js +16 -3
- package/dist/cjs/plugins/paste/handlers.js +25 -2
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +16 -3
- package/dist/cjs/plugins/paste/pm-plugins/main.js +22 -3
- package/dist/cjs/plugins/status/analytics.js +3 -3
- package/dist/cjs/plugins/table/toolbar.js +2 -2
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +43 -32
- package/dist/cjs/plugins/toolbar-lists-indentation/index.js +33 -13
- package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +122 -0
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +8 -2
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -2
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +7 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +40 -19
- package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +10 -0
- package/dist/cjs/types/browser.js +6 -0
- package/dist/cjs/ui/Addon/click-area-helper.js +40 -19
- package/dist/cjs/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/cjs/ui/ContentStyles/index.js +1 -3
- package/dist/cjs/ui/DropList/index.js +215 -0
- package/dist/cjs/ui/Dropdown/index.js +2 -5
- package/dist/cjs/ui/DropdownMenu/index.js +140 -86
- package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +25 -14
- package/dist/cjs/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +2 -2
- package/dist/cjs/ui/ElementBrowser/components/ElementList/utils.js +28 -1
- package/dist/cjs/ui/ElementBrowser/constants.js +2 -7
- package/dist/cjs/ui/Layer/index.js +245 -0
- package/dist/cjs/ui/Layer/internal/helpers.js +70 -0
- package/dist/cjs/ui/PortalProvider/index.js +7 -26
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +15 -4
- package/dist/es2019/create-editor/create-plugins-list.js +21 -11
- package/dist/es2019/editor.js +9 -23
- package/dist/es2019/labs/next/internal/hooks/use-editor/index.js +6 -1
- package/dist/es2019/labs/next/presets/default.js +1 -1
- package/dist/es2019/nodeviews/context-adapter.js +2 -2
- package/dist/es2019/plugins/analytics/plugin.js +19 -4
- package/dist/es2019/plugins/base/index.js +3 -3
- package/dist/es2019/plugins/base/pm-plugins/disable-spell-checking.js +70 -0
- package/dist/es2019/plugins/card/index.js +1 -1
- package/dist/es2019/plugins/card/nodeviews/embedCard.js +1 -2
- package/dist/es2019/plugins/card/toolbar.js +10 -5
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +5 -1
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +7 -7
- package/dist/es2019/plugins/clipboard/pm-plugins/main.js +1 -2
- package/dist/es2019/plugins/code-block/actions.js +12 -0
- package/dist/es2019/plugins/code-block/index.js +4 -0
- package/dist/es2019/plugins/code-block/nodeviews/code-block.js +1 -1
- package/dist/es2019/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +112 -0
- package/dist/es2019/plugins/code-block/pm-plugins/main.js +1 -21
- package/dist/es2019/plugins/code-block/styles.js +2 -159
- package/dist/es2019/plugins/code-block/toolbar.js +8 -0
- package/dist/es2019/plugins/code-block/ui/class-names.js +1 -2
- package/dist/es2019/plugins/copy-button/commands.js +35 -15
- package/dist/es2019/plugins/copy-button/toolbar.js +29 -0
- package/dist/es2019/plugins/copy-button/utils.js +15 -27
- package/dist/es2019/plugins/expand/toolbar.js +4 -1
- package/dist/es2019/plugins/extension/toolbar.js +4 -1
- package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +1 -1
- package/dist/es2019/plugins/extension/ui/Extension/InlineExtension/styles.js +1 -1
- package/dist/es2019/plugins/extension/ui/Extension/styles.js +1 -3
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +27 -15
- package/dist/es2019/plugins/feedback-dialog/index.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +0 -19
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +14 -29
- package/dist/es2019/plugins/hyperlink/Toolbar.js +11 -5
- package/dist/es2019/plugins/hyperlink/index.js +4 -4
- package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +24 -0
- package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.js +28 -0
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +50 -9
- package/dist/es2019/plugins/indentation/commands/index.js +24 -9
- package/dist/es2019/plugins/indentation/commands/utils.js +8 -3
- package/dist/es2019/plugins/indentation/pm-plugins/keymap.js +5 -4
- package/dist/es2019/plugins/layout/toolbar.js +2 -1
- package/dist/es2019/plugins/media/toolbar/index.js +10 -3
- package/dist/es2019/plugins/mentions/analytics.js +1 -1
- package/dist/es2019/plugins/panel/toolbar.js +1 -1
- package/dist/es2019/plugins/paste/edge-cases/index.js +15 -3
- package/dist/es2019/plugins/paste/handlers.js +27 -2
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +12 -3
- package/dist/es2019/plugins/paste/pm-plugins/main.js +24 -4
- package/dist/es2019/plugins/status/analytics.js +1 -1
- package/dist/es2019/plugins/table/toolbar.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +10 -10
- package/dist/es2019/plugins/toolbar-lists-indentation/index.js +23 -4
- package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +104 -0
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +8 -2
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -2
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +7 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +38 -16
- package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +9 -0
- package/dist/es2019/types/browser.js +2 -0
- package/dist/es2019/ui/Addon/click-area-helper.js +37 -18
- package/dist/es2019/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/es2019/ui/ContentStyles/index.js +5 -9
- package/dist/es2019/ui/DropList/index.js +186 -0
- package/dist/es2019/ui/Dropdown/index.js +2 -6
- package/dist/es2019/ui/DropdownMenu/index.js +124 -75
- package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +11 -22
- package/dist/es2019/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +3 -3
- package/dist/es2019/ui/ElementBrowser/components/ElementList/utils.js +26 -2
- package/dist/es2019/ui/ElementBrowser/constants.js +1 -4
- package/dist/es2019/ui/Layer/index.js +195 -0
- package/dist/es2019/ui/Layer/internal/helpers.js +62 -0
- package/dist/es2019/ui/PortalProvider/index.js +5 -23
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +13 -4
- package/dist/esm/create-editor/create-plugins-list.js +21 -12
- package/dist/esm/editor.js +9 -23
- package/dist/esm/labs/next/internal/hooks/use-editor/index.js +6 -1
- package/dist/esm/labs/next/presets/default.js +1 -1
- package/dist/esm/nodeviews/context-adapter.js +2 -2
- package/dist/esm/plugins/analytics/plugin.js +24 -11
- package/dist/esm/plugins/base/index.js +3 -3
- package/dist/esm/plugins/base/pm-plugins/disable-spell-checking.js +72 -0
- package/dist/esm/plugins/card/index.js +1 -1
- package/dist/esm/plugins/card/nodeviews/embedCard.js +1 -2
- package/dist/esm/plugins/card/toolbar.js +11 -5
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +5 -1
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +7 -7
- package/dist/esm/plugins/clipboard/pm-plugins/main.js +1 -2
- package/dist/esm/plugins/code-block/actions.js +12 -0
- package/dist/esm/plugins/code-block/index.js +6 -0
- package/dist/esm/plugins/code-block/nodeviews/code-block.js +2 -4
- package/dist/esm/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +112 -0
- package/dist/esm/plugins/code-block/pm-plugins/main.js +1 -20
- package/dist/esm/plugins/code-block/styles.js +4 -32
- package/dist/esm/plugins/code-block/toolbar.js +8 -0
- package/dist/esm/plugins/code-block/ui/class-names.js +1 -2
- package/dist/esm/plugins/copy-button/commands.js +35 -15
- package/dist/esm/plugins/copy-button/toolbar.js +31 -0
- package/dist/esm/plugins/copy-button/utils.js +14 -29
- package/dist/esm/plugins/expand/toolbar.js +6 -2
- package/dist/esm/plugins/extension/toolbar.js +4 -1
- package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +1 -1
- package/dist/esm/plugins/extension/ui/Extension/InlineExtension/styles.js +1 -1
- package/dist/esm/plugins/extension/ui/Extension/styles.js +3 -4
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +28 -16
- package/dist/esm/plugins/feedback-dialog/index.js +1 -1
- package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +0 -21
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +8 -27
- package/dist/esm/plugins/hyperlink/Toolbar.js +144 -135
- package/dist/esm/plugins/hyperlink/index.js +4 -4
- package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +26 -0
- package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.js +28 -0
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +46 -5
- package/dist/esm/plugins/indentation/commands/index.js +30 -9
- package/dist/esm/plugins/indentation/commands/utils.js +12 -8
- package/dist/esm/plugins/indentation/pm-plugins/keymap.js +5 -4
- package/dist/esm/plugins/layout/toolbar.js +2 -1
- package/dist/esm/plugins/media/toolbar/index.js +12 -5
- package/dist/esm/plugins/mentions/analytics.js +1 -1
- package/dist/esm/plugins/panel/toolbar.js +1 -1
- package/dist/esm/plugins/paste/edge-cases/index.js +15 -3
- package/dist/esm/plugins/paste/handlers.js +23 -2
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +13 -3
- package/dist/esm/plugins/paste/pm-plugins/main.js +23 -4
- package/dist/esm/plugins/status/analytics.js +1 -1
- package/dist/esm/plugins/table/toolbar.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +37 -31
- package/dist/esm/plugins/toolbar-lists-indentation/index.js +32 -13
- package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +105 -0
- package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +8 -2
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -2
- package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +7 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +38 -20
- package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +9 -0
- package/dist/esm/types/browser.js +2 -0
- package/dist/esm/ui/Addon/click-area-helper.js +37 -18
- package/dist/esm/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/esm/ui/ContentStyles/index.js +2 -4
- package/dist/esm/ui/DropList/index.js +203 -0
- package/dist/esm/ui/Dropdown/index.js +2 -6
- package/dist/esm/ui/DropdownMenu/index.js +134 -88
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +27 -17
- package/dist/esm/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.js +3 -3
- package/dist/esm/ui/ElementBrowser/components/ElementList/utils.js +26 -2
- package/dist/esm/ui/ElementBrowser/constants.js +1 -4
- package/dist/esm/ui/Layer/index.js +228 -0
- package/dist/esm/ui/Layer/internal/helpers.js +62 -0
- package/dist/esm/ui/PortalProvider/index.js +7 -26
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/labs/next/presets/default.d.ts +2 -0
- package/dist/types/plugins/analytics/plugin.d.ts +5 -1
- package/dist/types/plugins/analytics/types/cut-copy-events.d.ts +2 -0
- package/dist/types/plugins/analytics/types/general-events.d.ts +1 -0
- package/dist/types/plugins/analytics/types/paste-events.d.ts +1 -0
- package/dist/types/plugins/base/index.d.ts +1 -1
- package/dist/types/plugins/base/pm-plugins/{fix-chrome-spell-checking.d.ts → disable-spell-checking.d.ts} +0 -0
- package/dist/types/plugins/card/index.d.ts +2 -7
- package/dist/types/plugins/card/nodeviews/genericCard.d.ts +2 -1
- package/dist/types/plugins/card/toolbar.d.ts +3 -5
- package/dist/types/plugins/card/types.d.ts +2 -0
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +4 -1
- package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +2 -1
- package/dist/types/plugins/clipboard/pm-plugins/main.d.ts +3 -0
- package/dist/types/plugins/code-block/nodeviews/code-block.d.ts +1 -1
- package/dist/types/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.d.ts +11 -0
- package/dist/types/plugins/code-block/styles.d.ts +0 -1
- package/dist/types/plugins/code-block/ui/class-names.d.ts +0 -1
- package/dist/types/plugins/copy-button/commands.d.ts +2 -2
- package/dist/types/plugins/copy-button/toolbar.d.ts +7 -0
- package/dist/types/plugins/copy-button/utils.d.ts +7 -6
- package/dist/types/plugins/floating-toolbar/types.d.ts +1 -2
- package/dist/types/plugins/hyperlink/Toolbar.d.ts +2 -1
- package/dist/types/plugins/hyperlink/index.d.ts +2 -2
- package/dist/types/plugins/hyperlink/types.d.ts +30 -0
- package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/index.d.ts +7 -0
- package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/useEscapeClickaway.d.ts +2 -0
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +4 -3
- package/dist/types/plugins/indentation/commands/index.d.ts +6 -2
- package/dist/types/plugins/indentation/commands/utils.d.ts +8 -2
- package/dist/types/plugins/paste/edge-cases/index.d.ts +3 -2
- package/dist/types/plugins/paste/handlers.d.ts +1 -0
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +7 -1
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +5 -0
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +2 -1
- package/dist/types/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.d.ts +14 -0
- package/dist/types/plugins/toolbar-lists-indentation/types.d.ts +2 -0
- package/dist/types/plugins/toolbar-lists-indentation/ui/index.d.ts +2 -0
- package/dist/types/types/browser.d.ts +10 -0
- package/dist/types/types/editor-props.d.ts +6 -5
- package/dist/types/types/feature-flags.d.ts +29 -24
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/ui/Addon/click-area-helper.d.ts +10 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/DropList/index.d.ts +22 -0
- package/dist/types/ui/Dropdown/index.d.ts +2 -1
- package/dist/types/ui/DropdownMenu/index.d.ts +0 -1
- package/dist/types/ui/ElementBrowser/components/ElementList/cellSizeAndPositionGetter.d.ts +1 -1
- package/dist/types/ui/ElementBrowser/components/ElementList/utils.d.ts +1 -0
- package/dist/types/ui/ElementBrowser/constants.d.ts +1 -3
- package/dist/types/ui/Layer/index.d.ts +47 -0
- package/dist/types/ui/Layer/internal/helpers.d.ts +5 -0
- package/package.json +23 -18
- package/dist/cjs/plugins/base/pm-plugins/fix-chrome-spell-checking.js +0 -37
- package/dist/cjs/plugins/code-block/nodeviews/highlighting-code-block.js +0 -195
- package/dist/cjs/utils/check-if-mobile-bridge.js +0 -19
- package/dist/es2019/plugins/base/pm-plugins/fix-chrome-spell-checking.js +0 -22
- package/dist/es2019/plugins/code-block/nodeviews/highlighting-code-block.js +0 -152
- package/dist/es2019/utils/check-if-mobile-bridge.js +0 -12
- package/dist/esm/plugins/base/pm-plugins/fix-chrome-spell-checking.js +0 -24
- package/dist/esm/plugins/code-block/nodeviews/highlighting-code-block.js +0 -178
- package/dist/esm/utils/check-if-mobile-bridge.js +0 -12
- package/dist/types/plugins/code-block/nodeviews/highlighting-code-block.d.ts +0 -48
- package/dist/types/utils/check-if-mobile-bridge.d.ts +0 -1
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
+
|
|
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
|
+
|
|
11
|
+
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; }
|
|
12
|
+
|
|
13
|
+
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); }; }
|
|
14
|
+
|
|
15
|
+
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; } }
|
|
16
|
+
|
|
17
|
+
import React, { Component } from 'react';
|
|
18
|
+
import rafSchedule from 'raf-schd';
|
|
19
|
+
import Popper from 'popper.js'; // eslint-disable-line import/extensions
|
|
20
|
+
|
|
21
|
+
import { positionPropToPopperPosition } from './internal/helpers';
|
|
22
|
+
var defaultState = {
|
|
23
|
+
hasExtractedStyles: false,
|
|
24
|
+
// We set these default offsets to prevent a flash of popper content in the wrong position
|
|
25
|
+
// which can cause incorrect height calculations. Popper will calculate these values
|
|
26
|
+
offsets: {
|
|
27
|
+
popper: {
|
|
28
|
+
left: -9999,
|
|
29
|
+
top: -9999,
|
|
30
|
+
position: null
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
// fix Safari parent width: https://product-fabric.atlassian.net/browse/ED-1784
|
|
34
|
+
cssPosition: 'absolute',
|
|
35
|
+
originalHeight: null,
|
|
36
|
+
maxHeight: null
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var Layer = /*#__PURE__*/function (_Component) {
|
|
40
|
+
_inherits(Layer, _Component);
|
|
41
|
+
|
|
42
|
+
var _super = _createSuper(Layer);
|
|
43
|
+
|
|
44
|
+
// working with extract-react-types
|
|
45
|
+
function Layer(props) {
|
|
46
|
+
var _this;
|
|
47
|
+
|
|
48
|
+
_classCallCheck(this, Layer);
|
|
49
|
+
|
|
50
|
+
_this = _super.call(this, props);
|
|
51
|
+
|
|
52
|
+
_defineProperty(_assertThisInitialized(_this), "targetRef", /*#__PURE__*/React.createRef());
|
|
53
|
+
|
|
54
|
+
_defineProperty(_assertThisInitialized(_this), "contentRef", /*#__PURE__*/React.createRef());
|
|
55
|
+
|
|
56
|
+
_defineProperty(_assertThisInitialized(_this), "extractStyles", function (state) {
|
|
57
|
+
if (state) {
|
|
58
|
+
var popperHeight = state.offsets.popper.height;
|
|
59
|
+
var left = Math.round(state.offsets.popper.left);
|
|
60
|
+
var top = Math.round(state.offsets.popper.top);
|
|
61
|
+
var cssPosition = 'absolute';
|
|
62
|
+
var originalHeight = _this.state.originalHeight || popperHeight;
|
|
63
|
+
|
|
64
|
+
var maxHeight = _this.calculateMaxHeight(originalHeight, popperHeight, top, cssPosition);
|
|
65
|
+
|
|
66
|
+
_this.setState({
|
|
67
|
+
// position: fixed or absolute
|
|
68
|
+
cssPosition: cssPosition,
|
|
69
|
+
hasExtractedStyles: true,
|
|
70
|
+
transform: "translate3d(".concat(left, "px, ").concat(top, "px, 0px)"),
|
|
71
|
+
originalHeight: originalHeight,
|
|
72
|
+
maxHeight: maxHeight
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
_this.state = defaultState;
|
|
78
|
+
_this.extractStyles = rafSchedule(_this.extractStyles.bind(_assertThisInitialized(_this)));
|
|
79
|
+
return _this;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
_createClass(Layer, [{
|
|
83
|
+
key: "componentDidMount",
|
|
84
|
+
value: function componentDidMount() {
|
|
85
|
+
this.applyPopper(this.props);
|
|
86
|
+
}
|
|
87
|
+
}, {
|
|
88
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
89
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
90
|
+
this.applyPopper(nextProps);
|
|
91
|
+
}
|
|
92
|
+
}, {
|
|
93
|
+
key: "componentDidUpdate",
|
|
94
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
95
|
+
var onPositioned = this.props.onPositioned;
|
|
96
|
+
var hasExtractedStyles = this.state.hasExtractedStyles; // This flag is set the first time the position is calculated from Popper and applied to the content
|
|
97
|
+
|
|
98
|
+
if (!prevState.hasExtractedStyles && hasExtractedStyles && onPositioned) {
|
|
99
|
+
onPositioned();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}, {
|
|
103
|
+
key: "componentWillUnmount",
|
|
104
|
+
value: function componentWillUnmount() {
|
|
105
|
+
// this.extractStyles.cancel();
|
|
106
|
+
if (this.popper) {
|
|
107
|
+
this.popper.destroy();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/* Calculate the max height of the popper if it's height is greater than the viewport to prevent
|
|
111
|
+
* the bottom of the popper not being viewable.
|
|
112
|
+
* Only works if the popper uses viewport as the boundary and has a fixed position ancestor.
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
}, {
|
|
116
|
+
key: "calculateMaxHeight",
|
|
117
|
+
value: function calculateMaxHeight(originalHeight, currentHeight, positionTop, cssPosition) {
|
|
118
|
+
var DocumentElementClientHeight = 0;
|
|
119
|
+
|
|
120
|
+
if (document.documentElement) {
|
|
121
|
+
DocumentElementClientHeight = document.documentElement.clientHeight;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (cssPosition !== 'fixed') {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
var viewportHeight = Math.max(DocumentElementClientHeight, window.innerHeight || 0);
|
|
129
|
+
return viewportHeight < originalHeight && currentHeight + positionTop >= viewportHeight - 50 ? // allow some spacing either side of viewport height
|
|
130
|
+
viewportHeight - 12 : null;
|
|
131
|
+
}
|
|
132
|
+
}, {
|
|
133
|
+
key: "applyPopper",
|
|
134
|
+
value: function applyPopper(props) {
|
|
135
|
+
if (!this.targetRef.current || !this.contentRef.current) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (this.popper) {
|
|
140
|
+
this.popper.destroy();
|
|
141
|
+
} // "new Popper(...)" operation is very expensive when called on virtual DOM.
|
|
142
|
+
// This condition reduces the number of calls so we can run our tests faster
|
|
143
|
+
// (time was reduced from 100s to 13s).
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
if (!props.content) {
|
|
147
|
+
return;
|
|
148
|
+
} // we wrap our target in a div so that we can safely get a reference to it, but we pass the
|
|
149
|
+
// actual target to popper
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
var isAlwaysFixed = false;
|
|
153
|
+
var actualTarget = this.targetRef.current.children[0];
|
|
154
|
+
var popperOpts = {
|
|
155
|
+
placement: positionPropToPopperPosition(props.position),
|
|
156
|
+
onCreate: this.extractStyles,
|
|
157
|
+
onUpdate: this.extractStyles,
|
|
158
|
+
modifiers: {
|
|
159
|
+
applyStyle: {
|
|
160
|
+
enabled: false
|
|
161
|
+
},
|
|
162
|
+
hide: {
|
|
163
|
+
enabled: false
|
|
164
|
+
},
|
|
165
|
+
offset: {
|
|
166
|
+
enabled: true,
|
|
167
|
+
offset: this.props.offset
|
|
168
|
+
},
|
|
169
|
+
flip: {
|
|
170
|
+
enabled: false,
|
|
171
|
+
flipVariations: true,
|
|
172
|
+
boundariesElement: 'viewport',
|
|
173
|
+
padding: 0 // leave 0 pixels between popper and the boundariesElement
|
|
174
|
+
|
|
175
|
+
},
|
|
176
|
+
preventOverflow: {
|
|
177
|
+
enabled: false,
|
|
178
|
+
escapeWithReference: true
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
positionFixed: isAlwaysFixed
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
if (actualTarget) {
|
|
185
|
+
this.popper = new Popper(actualTarget, this.contentRef.current, popperOpts);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}, {
|
|
189
|
+
key: "render",
|
|
190
|
+
value: function render() {
|
|
191
|
+
var _this$state = this.state,
|
|
192
|
+
transform = _this$state.transform,
|
|
193
|
+
hasExtractedStyles = _this$state.hasExtractedStyles,
|
|
194
|
+
maxHeight = _this$state.maxHeight;
|
|
195
|
+
var opacity = hasExtractedStyles ? {} : {
|
|
196
|
+
opacity: 0
|
|
197
|
+
};
|
|
198
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
199
|
+
ref: this.targetRef
|
|
200
|
+
}, this.props.children), /*#__PURE__*/React.createElement("div", {
|
|
201
|
+
ref: this.contentRef,
|
|
202
|
+
style: _objectSpread({
|
|
203
|
+
top: 0,
|
|
204
|
+
left: 0,
|
|
205
|
+
position: 'absolute',
|
|
206
|
+
transform: transform,
|
|
207
|
+
maxHeight: maxHeight ? maxHeight : 'auto'
|
|
208
|
+
}, opacity)
|
|
209
|
+
}, this.props.content));
|
|
210
|
+
}
|
|
211
|
+
}]);
|
|
212
|
+
|
|
213
|
+
return Layer;
|
|
214
|
+
}(Component);
|
|
215
|
+
|
|
216
|
+
_defineProperty(Layer, "defaultProps", {
|
|
217
|
+
boundariesElement: 'viewport',
|
|
218
|
+
children: null,
|
|
219
|
+
content: null,
|
|
220
|
+
offset: '0, 0',
|
|
221
|
+
position: 'right middle',
|
|
222
|
+
zIndex: 400,
|
|
223
|
+
lockScroll: false,
|
|
224
|
+
isAlwaysFixed: false,
|
|
225
|
+
onPositioned: function onPositioned() {}
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
export { Layer as default };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var positionMap = {
|
|
2
|
+
'top left': {
|
|
3
|
+
position: 'top-start',
|
|
4
|
+
animation: 'top'
|
|
5
|
+
},
|
|
6
|
+
'top center': {
|
|
7
|
+
position: 'top',
|
|
8
|
+
animation: 'top'
|
|
9
|
+
},
|
|
10
|
+
'top right': {
|
|
11
|
+
position: 'top-end',
|
|
12
|
+
animation: 'top'
|
|
13
|
+
},
|
|
14
|
+
'right top': {
|
|
15
|
+
position: 'right-start',
|
|
16
|
+
animation: 'right'
|
|
17
|
+
},
|
|
18
|
+
'right middle': {
|
|
19
|
+
position: 'right',
|
|
20
|
+
animation: 'right'
|
|
21
|
+
},
|
|
22
|
+
'right bottom': {
|
|
23
|
+
position: 'right-end',
|
|
24
|
+
animation: 'right'
|
|
25
|
+
},
|
|
26
|
+
'bottom left': {
|
|
27
|
+
position: 'bottom-start',
|
|
28
|
+
animation: 'bottom'
|
|
29
|
+
},
|
|
30
|
+
'bottom center': {
|
|
31
|
+
position: 'bottom',
|
|
32
|
+
animation: 'bottom'
|
|
33
|
+
},
|
|
34
|
+
'bottom right': {
|
|
35
|
+
position: 'bottom-end',
|
|
36
|
+
animation: 'bottom'
|
|
37
|
+
},
|
|
38
|
+
'left top': {
|
|
39
|
+
position: 'left-start',
|
|
40
|
+
animation: 'left'
|
|
41
|
+
},
|
|
42
|
+
'left middle': {
|
|
43
|
+
position: 'left',
|
|
44
|
+
animation: 'left'
|
|
45
|
+
},
|
|
46
|
+
'left bottom': {
|
|
47
|
+
position: 'left-end',
|
|
48
|
+
animation: 'left'
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export var POSITION_ATTRIBUTE_ENUM = {
|
|
52
|
+
values: ['top left', 'top center', 'top right', 'right top', 'right middle', 'right bottom', 'bottom left', 'bottom center', 'bottom right', 'left top', 'left middle', 'left bottom'],
|
|
53
|
+
default: 'right middle'
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
function positionToPopper(position) {
|
|
57
|
+
return position && positionMap[position] ? positionMap[position].position : null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function positionPropToPopperPosition(position) {
|
|
61
|
+
return positionToPopper(position) || positionMap[POSITION_ATTRIBUTE_ENUM.default].position;
|
|
62
|
+
}
|
|
@@ -55,37 +55,18 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
55
55
|
var hasAnalyticsContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
56
56
|
var hasIntlContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
this.portals.set(container, {
|
|
66
|
-
children: childrenWithThemeProviders,
|
|
67
|
-
hasAnalyticsContext: hasAnalyticsContext,
|
|
68
|
-
hasIntlContext: hasIntlContext
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
var _wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders()) : childrenWithThemeProviders();
|
|
72
|
-
|
|
73
|
-
if (hasIntlContext) {
|
|
74
|
-
_wrappedChildren = /*#__PURE__*/React.createElement(RawIntlProvider, {
|
|
75
|
-
value: this.intl
|
|
76
|
-
}, _wrappedChildren);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
unstable_renderSubtreeIntoContainer(this.context, _wrappedChildren, container);
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
58
|
+
var childrenWithThemeProviders = function childrenWithThemeProviders() {
|
|
59
|
+
return /*#__PURE__*/React.createElement(PortalProviderThemeProviders, {
|
|
60
|
+
mode: _this2.themeMode
|
|
61
|
+
}, children());
|
|
62
|
+
};
|
|
82
63
|
|
|
83
64
|
this.portals.set(container, {
|
|
84
|
-
children:
|
|
65
|
+
children: childrenWithThemeProviders,
|
|
85
66
|
hasAnalyticsContext: hasAnalyticsContext,
|
|
86
67
|
hasIntlContext: hasIntlContext
|
|
87
68
|
});
|
|
88
|
-
var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null,
|
|
69
|
+
var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders()) : childrenWithThemeProviders();
|
|
89
70
|
|
|
90
71
|
if (hasIntlContext) {
|
|
91
72
|
wrappedChildren = /*#__PURE__*/React.createElement(RawIntlProvider, {
|
package/dist/esm/version.json
CHANGED
|
@@ -15,6 +15,7 @@ import { CodeBlockOptions } from '../../../plugins/code-block/types';
|
|
|
15
15
|
import { SelectionPluginOptions } from '../../../plugins/selection/types';
|
|
16
16
|
import { CardOptions } from '@atlaskit/editor-common/card';
|
|
17
17
|
import { TypeAheadPluginOptions } from '../../../plugins/type-ahead';
|
|
18
|
+
import { HyperlinkPluginOptions } from '../../../plugins/hyperlink/types';
|
|
18
19
|
interface EditorPresetDefaultProps {
|
|
19
20
|
children?: React.ReactNode;
|
|
20
21
|
}
|
|
@@ -30,6 +31,7 @@ export declare type DefaultPresetPluginOptions = {
|
|
|
30
31
|
codeBlock?: CodeBlockOptions;
|
|
31
32
|
selection?: SelectionPluginOptions;
|
|
32
33
|
cardOptions?: CardOptions;
|
|
34
|
+
hyperlinkOptions?: HyperlinkPluginOptions;
|
|
33
35
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
34
36
|
typeAhead?: TypeAheadPluginOptions;
|
|
35
37
|
};
|
|
@@ -7,5 +7,9 @@ interface AnalyticsPluginOptions {
|
|
|
7
7
|
performanceTracking?: PerformanceTracking;
|
|
8
8
|
}
|
|
9
9
|
declare const analyticsPlugin: (options: AnalyticsPluginOptions) => EditorPlugin;
|
|
10
|
-
export declare function extendPayload(payload
|
|
10
|
+
export declare function extendPayload({ payload, duration, distortedDuration, }: {
|
|
11
|
+
payload: AnalyticsEventPayload;
|
|
12
|
+
duration: number;
|
|
13
|
+
distortedDuration: boolean;
|
|
14
|
+
}): AnalyticsEventPayload<void>;
|
|
11
15
|
export default analyticsPlugin;
|
|
@@ -2,6 +2,8 @@ import { TrackAEP } from './utils';
|
|
|
2
2
|
import { ACTION, ACTION_SUBJECT } from './enums';
|
|
3
3
|
declare type CopyAEP = TrackAEP<ACTION.COPIED, ACTION_SUBJECT.DOCUMENT, undefined, {
|
|
4
4
|
content: string[];
|
|
5
|
+
inputMethod?: string;
|
|
6
|
+
nodeType?: string;
|
|
5
7
|
}, undefined>;
|
|
6
8
|
declare type CutAEP = TrackAEP<ACTION.CUT, ACTION_SUBJECT.DOCUMENT, undefined, {
|
|
7
9
|
content: string[];
|
|
@@ -41,6 +41,7 @@ declare type EditorPerfAEP = OperationalAEPWithObjectId<ACTION.EDITOR_MOUNTED |
|
|
|
41
41
|
nodes?: Record<string, number>;
|
|
42
42
|
ttfb?: number;
|
|
43
43
|
severity?: SEVERITY;
|
|
44
|
+
distortedDuration?: boolean;
|
|
44
45
|
}, undefined>;
|
|
45
46
|
declare type EditorTTIAEP = OperationalAEP<ACTION.EDITOR_TTI, ACTION_SUBJECT.EDITOR, undefined, {
|
|
46
47
|
tti: number;
|
|
@@ -33,6 +33,7 @@ declare type PastedTimedAEP = PasteBaseOperationalAEP<ACTION.PASTED_TIMED, {
|
|
|
33
33
|
pasteIntoNode: PASTE_ACTION_SUBJECT_ID;
|
|
34
34
|
content: Array<string>;
|
|
35
35
|
time: number;
|
|
36
|
+
distortedDuration: boolean;
|
|
36
37
|
}, undefined>;
|
|
37
38
|
export declare type PasteEventPayload = PasteAEP | PasteAsPlainAEP | PastedTimedAEP;
|
|
38
39
|
export {};
|
|
@@ -8,6 +8,6 @@ export interface BasePluginOptions {
|
|
|
8
8
|
browserFreezeTracking?: BrowserFreezetracking;
|
|
9
9
|
ufo?: boolean;
|
|
10
10
|
}
|
|
11
|
-
export declare const isChromeWithSelectionBug:
|
|
11
|
+
export declare const isChromeWithSelectionBug: any;
|
|
12
12
|
declare const basePlugin: (options?: BasePluginOptions | undefined) => EditorPlugin;
|
|
13
13
|
export default basePlugin;
|
|
File without changes
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { EditorPlugin } from '../../types';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
declare const cardPlugin: (options: CardOptions & {
|
|
5
|
-
platform: 'mobile' | 'web';
|
|
6
|
-
fullWidthMode?: boolean;
|
|
7
|
-
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
8
|
-
}) => EditorPlugin;
|
|
2
|
+
import { CardPluginOptions } from './types';
|
|
3
|
+
declare const cardPlugin: (options: CardPluginOptions) => EditorPlugin;
|
|
9
4
|
export default cardPlugin;
|
|
@@ -2,7 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { Node as PMNode } from 'prosemirror-model';
|
|
3
3
|
import { EditorView } from 'prosemirror-view';
|
|
4
4
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
-
import {
|
|
5
|
+
import { CardPlatform } from '@atlaskit/smart-card';
|
|
6
|
+
import { SmartCardContext } from '@atlaskit/link-provider';
|
|
6
7
|
import { getPosHandler, ReactComponentProps } from '../../../nodeviews';
|
|
7
8
|
import { EventDispatcher } from '../../../event-dispatcher';
|
|
8
9
|
import { DispatchAnalyticsEvent } from '../../../plugins/analytics';
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { IntlShape } from 'react-intl-next';
|
|
2
|
-
import { EditorState } from 'prosemirror-state';
|
|
3
1
|
import { Command } from '../../types';
|
|
4
|
-
import {
|
|
2
|
+
import { FloatingToolbarHandler } from '../floating-toolbar/types';
|
|
5
3
|
import { CardOptions } from '@atlaskit/editor-common/card';
|
|
6
|
-
import {
|
|
4
|
+
import { LinkPickerOptions } from '../hyperlink/types';
|
|
7
5
|
export declare const removeCard: Command;
|
|
8
6
|
export declare const visitCardLink: Command;
|
|
9
|
-
export declare const floatingToolbar: (cardOptions: CardOptions, platform?: import("json-ld-types").JsonLd.Primitives.Platforms | undefined
|
|
7
|
+
export declare const floatingToolbar: (cardOptions: CardOptions, platform?: import("json-ld-types").JsonLd.Primitives.Platforms | undefined, linkPickerOptions?: LinkPickerOptions | undefined) => FloatingToolbarHandler;
|
|
@@ -3,6 +3,7 @@ import { CardProvider, CardAppearance, CardAdf } from '@atlaskit/editor-common/p
|
|
|
3
3
|
import { SmartLinkEvents } from '@atlaskit/smart-card';
|
|
4
4
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
5
|
import { CardOptions } from '@atlaskit/editor-common/card';
|
|
6
|
+
import { LinkPickerOptions } from '../hyperlink/types';
|
|
6
7
|
export declare type CardInfo = {
|
|
7
8
|
title?: string;
|
|
8
9
|
url?: string;
|
|
@@ -32,6 +33,7 @@ export declare type CardPluginOptions = CardOptions & {
|
|
|
32
33
|
platform: 'mobile' | 'web';
|
|
33
34
|
fullWidthMode?: boolean;
|
|
34
35
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
36
|
+
linkPicker?: LinkPickerOptions;
|
|
35
37
|
};
|
|
36
38
|
export declare type SetProvider = {
|
|
37
39
|
type: 'SET_PROVIDER';
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
3
|
import { Node } from 'prosemirror-model';
|
|
4
4
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
|
+
import { LinkPickerOptions } from '../../hyperlink/types';
|
|
5
6
|
import { Command } from '../../../types';
|
|
6
7
|
import { FloatingToolbarItem, FloatingToolbarConfig } from '../../floating-toolbar/types';
|
|
7
8
|
export declare type EditLinkToolbarProps = {
|
|
@@ -11,6 +12,7 @@ export declare type EditLinkToolbarProps = {
|
|
|
11
12
|
text: string;
|
|
12
13
|
node: Node;
|
|
13
14
|
onSubmit?: (href: string, text?: string) => void;
|
|
15
|
+
linkPickerOptions?: LinkPickerOptions;
|
|
14
16
|
};
|
|
15
17
|
export declare class EditLinkToolbar extends React.Component<EditLinkToolbarProps> {
|
|
16
18
|
componentDidUpdate(prevProps: EditLinkToolbarProps): void;
|
|
@@ -19,8 +21,9 @@ export declare class EditLinkToolbar extends React.Component<EditLinkToolbarProp
|
|
|
19
21
|
render(): JSX.Element;
|
|
20
22
|
}
|
|
21
23
|
export declare const editLink: Command;
|
|
22
|
-
export declare const buildEditLinkToolbar: ({ providerFactory, node, }: {
|
|
24
|
+
export declare const buildEditLinkToolbar: ({ providerFactory, node, linkPicker, }: {
|
|
23
25
|
providerFactory: ProviderFactory;
|
|
24
26
|
node: Node;
|
|
27
|
+
linkPicker?: LinkPickerOptions | undefined;
|
|
25
28
|
}) => FloatingToolbarItem<Command>;
|
|
26
29
|
export declare const editLinkToolbarConfig: Partial<FloatingToolbarConfig>;
|
|
@@ -2,7 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { IntlShape } from 'react-intl-next';
|
|
4
4
|
import { EditorState } from 'prosemirror-state';
|
|
5
|
-
import {
|
|
5
|
+
import { CardPlatform } from '@atlaskit/smart-card';
|
|
6
|
+
import { CardContext } from '@atlaskit/link-provider';
|
|
6
7
|
import { EditorView } from 'prosemirror-view';
|
|
7
8
|
import { CardAppearance } from '@atlaskit/editor-common/provider-factory';
|
|
8
9
|
export interface LinkToolbarAppearanceProps {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import { EditorState } from 'prosemirror-state';
|
|
2
3
|
import { EditorView } from 'prosemirror-view';
|
|
3
4
|
import { PMPluginFactoryParams } from '../../../types';
|
|
4
5
|
import { DispatchAnalyticsEvent } from '../../analytics/types/dispatch-analytics-event';
|
|
6
|
+
import { AnalyticsEventPayload } from '../../../plugins/analytics';
|
|
5
7
|
import { ACTION } from '../../analytics/types/enums';
|
|
6
8
|
import { DOMSerializer } from 'prosemirror-model';
|
|
7
9
|
import type { Schema } from 'prosemirror-model';
|
|
@@ -14,3 +16,4 @@ export declare const createPlugin: ({ dispatchAnalyticsEvent, schema, }: PMPlugi
|
|
|
14
16
|
*/
|
|
15
17
|
export declare const createClipboardSerializer: (schema: Schema, getEditorView: () => EditorView) => DOMSerializer;
|
|
16
18
|
export declare const sendClipboardAnalytics: (view: EditorView, dispatchAnalyticsEvent: DispatchAnalyticsEvent, action: ACTION.CUT | ACTION.COPIED) => boolean;
|
|
19
|
+
export declare const getAnalyticsPayload: (state: EditorState, action: ACTION.CUT | ACTION.COPIED) => AnalyticsEventPayload | undefined;
|
|
@@ -18,4 +18,4 @@ export declare class CodeBlockView {
|
|
|
18
18
|
target: Element;
|
|
19
19
|
}): boolean;
|
|
20
20
|
}
|
|
21
|
-
export declare const codeBlockNodeView: (
|
|
21
|
+
export declare const codeBlockNodeView: (node: Node, view: EditorView, getPos: getPosHandler) => CodeBlockView;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import { PluginKey } from 'prosemirror-state';
|
|
3
|
+
import type { EditorState, Transaction } from 'prosemirror-state';
|
|
4
|
+
export declare const copySelectionPluginKey: PluginKey<any, any>;
|
|
5
|
+
declare type CodeBlockCopySelectionPluginState = {
|
|
6
|
+
decorationStartAndEnd?: [start: number, end: number];
|
|
7
|
+
};
|
|
8
|
+
export declare function codeBlockCopySelectionPlugin(): SafePlugin<CodeBlockCopySelectionPluginState, any>;
|
|
9
|
+
export declare function provideVisualFeedbackForCopyButton(state: EditorState, dispatch?: (tr: Transaction) => void): boolean;
|
|
10
|
+
export declare function removeVisualFeedbackForCopyButton(state: EditorState, dispatch?: (tr: Transaction) => void): boolean;
|
|
11
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Command } from '../../types';
|
|
2
2
|
import { NodeType } from 'prosemirror-model';
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const resetCopiedState: (nodeType: NodeType
|
|
3
|
+
export declare const createToolbarCopyCommand: (nodeType: NodeType | Array<NodeType>) => Command;
|
|
4
|
+
export declare const resetCopiedState: (nodeType: NodeType | Array<NodeType>, onMouseLeave?: Command | undefined) => Command;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NodeType } from 'prosemirror-model';
|
|
2
|
+
import { EditorState } from 'prosemirror-state';
|
|
3
|
+
import { IntlShape } from 'react-intl-next';
|
|
4
|
+
import { Command } from '../../../src/types';
|
|
5
|
+
import { FloatingToolbarItem } from '../floating-toolbar/types';
|
|
6
|
+
export declare const getCopyButtonConfig: (state: EditorState, formatMessage: IntlShape['formatMessage'], nodeType: NodeType | Array<NodeType>, onMouseEnter?: Command | undefined, onMouseLeave?: Command | undefined) => FloatingToolbarItem<Command>;
|
|
7
|
+
export declare const showCopyButton: (state?: EditorState<any> | undefined) => import("prosemirror-state").Plugin<any, any> | undefined;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { NodeType } from 'prosemirror-model';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { Schema, Node as PMNode } from 'prosemirror-model';
|
|
3
|
+
import { Transaction } from 'prosemirror-state';
|
|
4
|
+
export declare function getSelectedNodeOrNodeParentByNodeType({ nodeType, selection, }: {
|
|
5
|
+
nodeType: NodeType | Array<NodeType>;
|
|
6
|
+
selection: Transaction['selection'];
|
|
7
|
+
}): import("prosemirror-utils").ContentNodeWithPos | undefined;
|
|
8
|
+
export declare const toDOM: (node: PMNode, schema: Schema) => Node;
|
|
@@ -10,7 +10,6 @@ import { SelectOption } from './ui/Select';
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { DropdownOptions, RenderOptionsPropsT } from './ui/types';
|
|
12
12
|
import { DispatchAnalyticsEvent } from '../analytics/types/dispatch-analytics-event';
|
|
13
|
-
import { CardOptions } from '@atlaskit/editor-common/card';
|
|
14
13
|
import { PaletteColor } from '../../ui/ColorPalette/Palettes/type';
|
|
15
14
|
import { EmojiId } from '@atlaskit/emoji/types';
|
|
16
15
|
export declare type Icon = React.ComponentType<{
|
|
@@ -150,5 +149,5 @@ export interface FloatingToolbarConfig {
|
|
|
150
149
|
forcePlacement?: boolean;
|
|
151
150
|
onPositionCalculated?: (editorView: EditorView, nextPos: Position) => Position;
|
|
152
151
|
}
|
|
153
|
-
export declare type FloatingToolbarHandler = (state: EditorState, intl: IntlShape, providerFactory: ProviderFactory
|
|
152
|
+
export declare type FloatingToolbarHandler = (state: EditorState, intl: IntlShape, providerFactory: ProviderFactory) => FloatingToolbarConfig | undefined;
|
|
154
153
|
export {};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { FloatingToolbarHandler } from '../floating-toolbar/types';
|
|
2
|
-
|
|
2
|
+
import { HyperlinkPluginOptions } from './types';
|
|
3
|
+
export declare const getToolbarConfig: (options?: HyperlinkPluginOptions | undefined) => FloatingToolbarHandler;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EditorPlugin } from '../../types';
|
|
2
|
-
import {
|
|
3
|
-
declare const hyperlinkPlugin: (options?:
|
|
2
|
+
import { HyperlinkPluginOptions } from './types';
|
|
3
|
+
declare const hyperlinkPlugin: (options?: HyperlinkPluginOptions | undefined) => EditorPlugin;
|
|
4
4
|
export type { HyperlinkState } from './pm-plugins/main';
|
|
5
5
|
export default hyperlinkPlugin;
|