@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
|
@@ -14,7 +14,7 @@ var _utils = require("./utils");
|
|
|
14
14
|
* for a given cell.
|
|
15
15
|
* https://github.com/bvaughn/react-virtualized/blob/master/docs/Collection.md
|
|
16
16
|
**/
|
|
17
|
-
function cellSizeAndPositionGetter(containerWidth) {
|
|
17
|
+
function cellSizeAndPositionGetter(containerWidth, scrollbarWidth) {
|
|
18
18
|
var GUTTER_SIZE = 4;
|
|
19
19
|
/**
|
|
20
20
|
* Save the currently rendered columnY positions.
|
|
@@ -27,7 +27,7 @@ function cellSizeAndPositionGetter(containerWidth) {
|
|
|
27
27
|
|
|
28
28
|
var _generateVirtualizedC = (0, _utils.generateVirtualizedContainerDatum)(containerWidth, {
|
|
29
29
|
gutterSize: GUTTER_SIZE,
|
|
30
|
-
scrollbarWidth:
|
|
30
|
+
scrollbarWidth: scrollbarWidth
|
|
31
31
|
}),
|
|
32
32
|
columnCount = _generateVirtualizedC.columnCount,
|
|
33
33
|
availableWidth = _generateVirtualizedC.availableWidth;
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.generateVirtualizedContainerDatum = generateVirtualizedContainerDatum;
|
|
7
7
|
exports.getColumnCount = getColumnCount;
|
|
8
|
+
exports.getScrollbarWidth = getScrollbarWidth;
|
|
8
9
|
|
|
9
10
|
var _constants = require("../../constants");
|
|
10
11
|
|
|
@@ -31,9 +32,35 @@ function getColumnCount(clientWidth) {
|
|
|
31
32
|
function generateVirtualizedContainerDatum(containerWidth, options) {
|
|
32
33
|
var scrollbarWidth = options.scrollbarWidth;
|
|
33
34
|
var columnCount = getColumnCount(containerWidth);
|
|
34
|
-
var availableWidth = containerWidth - (scrollbarWidth + _constants.ELEMENT_LIST_PADDING
|
|
35
|
+
var availableWidth = containerWidth - (scrollbarWidth + _constants.ELEMENT_LIST_PADDING);
|
|
35
36
|
return {
|
|
36
37
|
availableWidth: availableWidth,
|
|
37
38
|
columnCount: columnCount
|
|
38
39
|
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
var CALCULATED_SCROLLBAR_WIDTH;
|
|
43
|
+
|
|
44
|
+
function getScrollbarWidth() {
|
|
45
|
+
if (!CALCULATED_SCROLLBAR_WIDTH) {
|
|
46
|
+
var _container$parentNode;
|
|
47
|
+
|
|
48
|
+
var container = document.createElement('div');
|
|
49
|
+
container.style.visibility = 'hidden';
|
|
50
|
+
container.style.overflow = 'scroll';
|
|
51
|
+
document.body.appendChild(container);
|
|
52
|
+
var innerContainer = document.createElement('div');
|
|
53
|
+
container.appendChild(innerContainer);
|
|
54
|
+
var scrollbarWidth = container.offsetWidth - innerContainer.offsetWidth;
|
|
55
|
+
(_container$parentNode = container.parentNode) === null || _container$parentNode === void 0 ? void 0 : _container$parentNode.removeChild(container);
|
|
56
|
+
|
|
57
|
+
if (scrollbarWidth) {
|
|
58
|
+
CALCULATED_SCROLLBAR_WIDTH = scrollbarWidth;
|
|
59
|
+
return scrollbarWidth;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return _constants.SCROLLBAR_WIDTH;
|
|
63
|
+
} else {
|
|
64
|
+
return CALCULATED_SCROLLBAR_WIDTH;
|
|
65
|
+
}
|
|
39
66
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.SIDEBAR_WIDTH = exports.SIDEBAR_HEADING_WRAPPER_HEIGHT = exports.SIDEBAR_HEADING_PADDING_LEFT = exports.SEARCH_ITEM_MARGIN = exports.SEARCH_ITEM_HEIGHT_WIDTH = exports.SCROLLBAR_WIDTH = exports.
|
|
6
|
+
exports.SIDEBAR_WIDTH = exports.SIDEBAR_HEADING_WRAPPER_HEIGHT = exports.SIDEBAR_HEADING_PADDING_LEFT = exports.SEARCH_ITEM_MARGIN = exports.SEARCH_ITEM_HEIGHT_WIDTH = exports.SCROLLBAR_WIDTH = exports.MODAL_WRAPPER_PADDING = exports.INLINE_SIDEBAR_HEIGHT = exports.GRID_SIZE = exports.FLEX_ITEMS_CONTAINER_BREAKPOINT_NUMBERS = exports.ELEMENT_LIST_PADDING = exports.ELEMENT_ITEM_HEIGHT = exports.DEVICE_BREAKPOINT_NUMBERS = void 0;
|
|
7
7
|
|
|
8
8
|
var _constants = require("@atlaskit/theme/constants");
|
|
9
9
|
|
|
@@ -34,13 +34,8 @@ var SEARCH_ITEM_MARGIN = '12px';
|
|
|
34
34
|
exports.SEARCH_ITEM_MARGIN = SEARCH_ITEM_MARGIN;
|
|
35
35
|
var SEARCH_ITEM_HEIGHT_WIDTH = '20px';
|
|
36
36
|
exports.SEARCH_ITEM_HEIGHT_WIDTH = SEARCH_ITEM_HEIGHT_WIDTH;
|
|
37
|
-
var SCROLLBAR_WIDTH =
|
|
38
|
-
|
|
37
|
+
var SCROLLBAR_WIDTH = 15;
|
|
39
38
|
exports.SCROLLBAR_WIDTH = SCROLLBAR_WIDTH;
|
|
40
|
-
var SCROLLBAR_THUMB_COLOR = '#eeeeee';
|
|
41
|
-
exports.SCROLLBAR_THUMB_COLOR = SCROLLBAR_THUMB_COLOR;
|
|
42
|
-
var SCROLLBAR_TRACK_COLOR = 'rgba(255, 255, 255, 0)';
|
|
43
|
-
exports.SCROLLBAR_TRACK_COLOR = SCROLLBAR_TRACK_COLOR;
|
|
44
39
|
var ELEMENT_LIST_PADDING = 2;
|
|
45
40
|
exports.ELEMENT_LIST_PADDING = ELEMENT_LIST_PADDING;
|
|
46
41
|
var MODAL_WRAPPER_PADDING = 16;
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.default = void 0;
|
|
11
|
+
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
+
|
|
16
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
+
|
|
18
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
+
|
|
20
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
+
|
|
22
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
+
|
|
24
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
+
|
|
26
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
27
|
+
|
|
28
|
+
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
29
|
+
|
|
30
|
+
var _popper = _interopRequireDefault(require("popper.js"));
|
|
31
|
+
|
|
32
|
+
var _helpers = require("./internal/helpers");
|
|
33
|
+
|
|
34
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
+
|
|
36
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
+
|
|
38
|
+
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; }
|
|
39
|
+
|
|
40
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
41
|
+
|
|
42
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
43
|
+
|
|
44
|
+
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; } }
|
|
45
|
+
|
|
46
|
+
var defaultState = {
|
|
47
|
+
hasExtractedStyles: false,
|
|
48
|
+
// We set these default offsets to prevent a flash of popper content in the wrong position
|
|
49
|
+
// which can cause incorrect height calculations. Popper will calculate these values
|
|
50
|
+
offsets: {
|
|
51
|
+
popper: {
|
|
52
|
+
left: -9999,
|
|
53
|
+
top: -9999,
|
|
54
|
+
position: null
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
// fix Safari parent width: https://product-fabric.atlassian.net/browse/ED-1784
|
|
58
|
+
cssPosition: 'absolute',
|
|
59
|
+
originalHeight: null,
|
|
60
|
+
maxHeight: null
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var Layer = /*#__PURE__*/function (_Component) {
|
|
64
|
+
(0, _inherits2.default)(Layer, _Component);
|
|
65
|
+
|
|
66
|
+
var _super = _createSuper(Layer);
|
|
67
|
+
|
|
68
|
+
// working with extract-react-types
|
|
69
|
+
function Layer(props) {
|
|
70
|
+
var _this;
|
|
71
|
+
|
|
72
|
+
(0, _classCallCheck2.default)(this, Layer);
|
|
73
|
+
_this = _super.call(this, props);
|
|
74
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "targetRef", /*#__PURE__*/_react.default.createRef());
|
|
75
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "contentRef", /*#__PURE__*/_react.default.createRef());
|
|
76
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "extractStyles", function (state) {
|
|
77
|
+
if (state) {
|
|
78
|
+
var popperHeight = state.offsets.popper.height;
|
|
79
|
+
var left = Math.round(state.offsets.popper.left);
|
|
80
|
+
var top = Math.round(state.offsets.popper.top);
|
|
81
|
+
var cssPosition = 'absolute';
|
|
82
|
+
var originalHeight = _this.state.originalHeight || popperHeight;
|
|
83
|
+
|
|
84
|
+
var maxHeight = _this.calculateMaxHeight(originalHeight, popperHeight, top, cssPosition);
|
|
85
|
+
|
|
86
|
+
_this.setState({
|
|
87
|
+
// position: fixed or absolute
|
|
88
|
+
cssPosition: cssPosition,
|
|
89
|
+
hasExtractedStyles: true,
|
|
90
|
+
transform: "translate3d(".concat(left, "px, ").concat(top, "px, 0px)"),
|
|
91
|
+
originalHeight: originalHeight,
|
|
92
|
+
maxHeight: maxHeight
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
_this.state = defaultState;
|
|
97
|
+
_this.extractStyles = (0, _rafSchd.default)(_this.extractStyles.bind((0, _assertThisInitialized2.default)(_this)));
|
|
98
|
+
return _this;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
(0, _createClass2.default)(Layer, [{
|
|
102
|
+
key: "componentDidMount",
|
|
103
|
+
value: function componentDidMount() {
|
|
104
|
+
this.applyPopper(this.props);
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
107
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
108
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
109
|
+
this.applyPopper(nextProps);
|
|
110
|
+
}
|
|
111
|
+
}, {
|
|
112
|
+
key: "componentDidUpdate",
|
|
113
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
114
|
+
var onPositioned = this.props.onPositioned;
|
|
115
|
+
var hasExtractedStyles = this.state.hasExtractedStyles; // This flag is set the first time the position is calculated from Popper and applied to the content
|
|
116
|
+
|
|
117
|
+
if (!prevState.hasExtractedStyles && hasExtractedStyles && onPositioned) {
|
|
118
|
+
onPositioned();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
key: "componentWillUnmount",
|
|
123
|
+
value: function componentWillUnmount() {
|
|
124
|
+
// this.extractStyles.cancel();
|
|
125
|
+
if (this.popper) {
|
|
126
|
+
this.popper.destroy();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/* Calculate the max height of the popper if it's height is greater than the viewport to prevent
|
|
130
|
+
* the bottom of the popper not being viewable.
|
|
131
|
+
* Only works if the popper uses viewport as the boundary and has a fixed position ancestor.
|
|
132
|
+
*/
|
|
133
|
+
|
|
134
|
+
}, {
|
|
135
|
+
key: "calculateMaxHeight",
|
|
136
|
+
value: function calculateMaxHeight(originalHeight, currentHeight, positionTop, cssPosition) {
|
|
137
|
+
var DocumentElementClientHeight = 0;
|
|
138
|
+
|
|
139
|
+
if (document.documentElement) {
|
|
140
|
+
DocumentElementClientHeight = document.documentElement.clientHeight;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (cssPosition !== 'fixed') {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
var viewportHeight = Math.max(DocumentElementClientHeight, window.innerHeight || 0);
|
|
148
|
+
return viewportHeight < originalHeight && currentHeight + positionTop >= viewportHeight - 50 ? // allow some spacing either side of viewport height
|
|
149
|
+
viewportHeight - 12 : null;
|
|
150
|
+
}
|
|
151
|
+
}, {
|
|
152
|
+
key: "applyPopper",
|
|
153
|
+
value: function applyPopper(props) {
|
|
154
|
+
if (!this.targetRef.current || !this.contentRef.current) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (this.popper) {
|
|
159
|
+
this.popper.destroy();
|
|
160
|
+
} // "new Popper(...)" operation is very expensive when called on virtual DOM.
|
|
161
|
+
// This condition reduces the number of calls so we can run our tests faster
|
|
162
|
+
// (time was reduced from 100s to 13s).
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
if (!props.content) {
|
|
166
|
+
return;
|
|
167
|
+
} // we wrap our target in a div so that we can safely get a reference to it, but we pass the
|
|
168
|
+
// actual target to popper
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
var isAlwaysFixed = false;
|
|
172
|
+
var actualTarget = this.targetRef.current.children[0];
|
|
173
|
+
var popperOpts = {
|
|
174
|
+
placement: (0, _helpers.positionPropToPopperPosition)(props.position),
|
|
175
|
+
onCreate: this.extractStyles,
|
|
176
|
+
onUpdate: this.extractStyles,
|
|
177
|
+
modifiers: {
|
|
178
|
+
applyStyle: {
|
|
179
|
+
enabled: false
|
|
180
|
+
},
|
|
181
|
+
hide: {
|
|
182
|
+
enabled: false
|
|
183
|
+
},
|
|
184
|
+
offset: {
|
|
185
|
+
enabled: true,
|
|
186
|
+
offset: this.props.offset
|
|
187
|
+
},
|
|
188
|
+
flip: {
|
|
189
|
+
enabled: false,
|
|
190
|
+
flipVariations: true,
|
|
191
|
+
boundariesElement: 'viewport',
|
|
192
|
+
padding: 0 // leave 0 pixels between popper and the boundariesElement
|
|
193
|
+
|
|
194
|
+
},
|
|
195
|
+
preventOverflow: {
|
|
196
|
+
enabled: false,
|
|
197
|
+
escapeWithReference: true
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
positionFixed: isAlwaysFixed
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
if (actualTarget) {
|
|
204
|
+
this.popper = new _popper.default(actualTarget, this.contentRef.current, popperOpts);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}, {
|
|
208
|
+
key: "render",
|
|
209
|
+
value: function render() {
|
|
210
|
+
var _this$state = this.state,
|
|
211
|
+
transform = _this$state.transform,
|
|
212
|
+
hasExtractedStyles = _this$state.hasExtractedStyles,
|
|
213
|
+
maxHeight = _this$state.maxHeight;
|
|
214
|
+
var opacity = hasExtractedStyles ? {} : {
|
|
215
|
+
opacity: 0
|
|
216
|
+
};
|
|
217
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
218
|
+
ref: this.targetRef
|
|
219
|
+
}, this.props.children), /*#__PURE__*/_react.default.createElement("div", {
|
|
220
|
+
ref: this.contentRef,
|
|
221
|
+
style: _objectSpread({
|
|
222
|
+
top: 0,
|
|
223
|
+
left: 0,
|
|
224
|
+
position: 'absolute',
|
|
225
|
+
transform: transform,
|
|
226
|
+
maxHeight: maxHeight ? maxHeight : 'auto'
|
|
227
|
+
}, opacity)
|
|
228
|
+
}, this.props.content));
|
|
229
|
+
}
|
|
230
|
+
}]);
|
|
231
|
+
return Layer;
|
|
232
|
+
}(_react.Component);
|
|
233
|
+
|
|
234
|
+
exports.default = Layer;
|
|
235
|
+
(0, _defineProperty2.default)(Layer, "defaultProps", {
|
|
236
|
+
boundariesElement: 'viewport',
|
|
237
|
+
children: null,
|
|
238
|
+
content: null,
|
|
239
|
+
offset: '0, 0',
|
|
240
|
+
position: 'right middle',
|
|
241
|
+
zIndex: 400,
|
|
242
|
+
lockScroll: false,
|
|
243
|
+
isAlwaysFixed: false,
|
|
244
|
+
onPositioned: function onPositioned() {}
|
|
245
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.POSITION_ATTRIBUTE_ENUM = void 0;
|
|
7
|
+
exports.positionPropToPopperPosition = positionPropToPopperPosition;
|
|
8
|
+
var positionMap = {
|
|
9
|
+
'top left': {
|
|
10
|
+
position: 'top-start',
|
|
11
|
+
animation: 'top'
|
|
12
|
+
},
|
|
13
|
+
'top center': {
|
|
14
|
+
position: 'top',
|
|
15
|
+
animation: 'top'
|
|
16
|
+
},
|
|
17
|
+
'top right': {
|
|
18
|
+
position: 'top-end',
|
|
19
|
+
animation: 'top'
|
|
20
|
+
},
|
|
21
|
+
'right top': {
|
|
22
|
+
position: 'right-start',
|
|
23
|
+
animation: 'right'
|
|
24
|
+
},
|
|
25
|
+
'right middle': {
|
|
26
|
+
position: 'right',
|
|
27
|
+
animation: 'right'
|
|
28
|
+
},
|
|
29
|
+
'right bottom': {
|
|
30
|
+
position: 'right-end',
|
|
31
|
+
animation: 'right'
|
|
32
|
+
},
|
|
33
|
+
'bottom left': {
|
|
34
|
+
position: 'bottom-start',
|
|
35
|
+
animation: 'bottom'
|
|
36
|
+
},
|
|
37
|
+
'bottom center': {
|
|
38
|
+
position: 'bottom',
|
|
39
|
+
animation: 'bottom'
|
|
40
|
+
},
|
|
41
|
+
'bottom right': {
|
|
42
|
+
position: 'bottom-end',
|
|
43
|
+
animation: 'bottom'
|
|
44
|
+
},
|
|
45
|
+
'left top': {
|
|
46
|
+
position: 'left-start',
|
|
47
|
+
animation: 'left'
|
|
48
|
+
},
|
|
49
|
+
'left middle': {
|
|
50
|
+
position: 'left',
|
|
51
|
+
animation: 'left'
|
|
52
|
+
},
|
|
53
|
+
'left bottom': {
|
|
54
|
+
position: 'left-end',
|
|
55
|
+
animation: 'left'
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
var POSITION_ATTRIBUTE_ENUM = {
|
|
59
|
+
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'],
|
|
60
|
+
default: 'right middle'
|
|
61
|
+
};
|
|
62
|
+
exports.POSITION_ATTRIBUTE_ENUM = POSITION_ATTRIBUTE_ENUM;
|
|
63
|
+
|
|
64
|
+
function positionToPopper(position) {
|
|
65
|
+
return position && positionMap[position] ? positionMap[position].position : null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function positionPropToPopperPosition(position) {
|
|
69
|
+
return positionToPopper(position) || positionMap[POSITION_ATTRIBUTE_ENUM.default].position;
|
|
70
|
+
}
|
|
@@ -76,37 +76,18 @@ var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
76
76
|
var hasAnalyticsContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
77
77
|
var hasIntlContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
this.portals.set(container, {
|
|
87
|
-
children: childrenWithThemeProviders,
|
|
88
|
-
hasAnalyticsContext: hasAnalyticsContext,
|
|
89
|
-
hasIntlContext: hasIntlContext
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
var _wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/_react.default.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders()) : childrenWithThemeProviders();
|
|
93
|
-
|
|
94
|
-
if (hasIntlContext) {
|
|
95
|
-
_wrappedChildren = /*#__PURE__*/_react.default.createElement(_reactIntlNext.RawIntlProvider, {
|
|
96
|
-
value: this.intl
|
|
97
|
-
}, _wrappedChildren);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
(0, _reactDom.unstable_renderSubtreeIntoContainer)(this.context, _wrappedChildren, container);
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
79
|
+
var childrenWithThemeProviders = function childrenWithThemeProviders() {
|
|
80
|
+
return /*#__PURE__*/_react.default.createElement(_PortalProviderThemesProvider.PortalProviderThemeProviders, {
|
|
81
|
+
mode: _this2.themeMode
|
|
82
|
+
}, children());
|
|
83
|
+
};
|
|
103
84
|
|
|
104
85
|
this.portals.set(container, {
|
|
105
|
-
children:
|
|
86
|
+
children: childrenWithThemeProviders,
|
|
106
87
|
hasAnalyticsContext: hasAnalyticsContext,
|
|
107
88
|
hasIntlContext: hasIntlContext
|
|
108
89
|
});
|
|
109
|
-
var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/_react.default.createElement(AnalyticsContextWrapper, null,
|
|
90
|
+
var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/_react.default.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders()) : childrenWithThemeProviders();
|
|
110
91
|
|
|
111
92
|
if (hasIntlContext) {
|
|
112
93
|
wrappedChildren = /*#__PURE__*/_react.default.createElement(_reactIntlNext.RawIntlProvider, {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "
|
|
9
|
+
var version = "172.0.0";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
|
|
12
12
|
var nextMajorVersion = function nextMajorVersion() {
|
package/dist/cjs/version.json
CHANGED
|
@@ -440,7 +440,11 @@ export class ReactEditorView extends React.Component {
|
|
|
440
440
|
});
|
|
441
441
|
|
|
442
442
|
_defineProperty(this, "createEditorView", node => {
|
|
443
|
-
measureRender(measurements.PROSEMIRROR_RENDERED, (
|
|
443
|
+
measureRender(measurements.PROSEMIRROR_RENDERED, ({
|
|
444
|
+
duration,
|
|
445
|
+
startTime,
|
|
446
|
+
distortedDuration
|
|
447
|
+
}) => {
|
|
444
448
|
var _this$props$editorPro7, _this$props$editorPro8, _proseMirrorRenderedT, _proseMirrorRenderedT2;
|
|
445
449
|
|
|
446
450
|
const proseMirrorRenderedTracking = (_this$props$editorPro7 = this.props.editorProps) === null || _this$props$editorPro7 === void 0 ? void 0 : (_this$props$editorPro8 = _this$props$editorPro7.performanceTracking) === null || _this$props$editorPro8 === void 0 ? void 0 : _this$props$editorPro8.proseMirrorRenderedTracking;
|
|
@@ -448,7 +452,7 @@ export class ReactEditorView extends React.Component {
|
|
|
448
452
|
this.proseMirrorRenderedSeverity = !!forceSeverityTracking || proseMirrorRenderedTracking !== null && proseMirrorRenderedTracking !== void 0 && proseMirrorRenderedTracking.trackSeverity ? getAnalyticsEventSeverity(duration, (_proseMirrorRenderedT = proseMirrorRenderedTracking === null || proseMirrorRenderedTracking === void 0 ? void 0 : proseMirrorRenderedTracking.severityNormalThreshold) !== null && _proseMirrorRenderedT !== void 0 ? _proseMirrorRenderedT : PROSEMIRROR_RENDERED_NORMAL_SEVERITY_THRESHOLD, (_proseMirrorRenderedT2 = proseMirrorRenderedTracking === null || proseMirrorRenderedTracking === void 0 ? void 0 : proseMirrorRenderedTracking.severityDegradedThreshold) !== null && _proseMirrorRenderedT2 !== void 0 ? _proseMirrorRenderedT2 : PROSEMIRROR_RENDERED_DEGRADED_SEVERITY_THRESHOLD) : undefined;
|
|
449
453
|
|
|
450
454
|
if (this.view) {
|
|
451
|
-
var _getContextIdentifier, _this$
|
|
455
|
+
var _getContextIdentifier, _this$experienceStore10;
|
|
452
456
|
|
|
453
457
|
const nodes = getNodesCount(this.view.state.doc);
|
|
454
458
|
const ttfb = getResponseEndTime();
|
|
@@ -461,11 +465,18 @@ export class ReactEditorView extends React.Component {
|
|
|
461
465
|
nodes,
|
|
462
466
|
ttfb,
|
|
463
467
|
severity: this.proseMirrorRenderedSeverity,
|
|
464
|
-
objectId: (_getContextIdentifier = getContextIdentifier(this.editorState)) === null || _getContextIdentifier === void 0 ? void 0 : _getContextIdentifier.objectId
|
|
468
|
+
objectId: (_getContextIdentifier = getContextIdentifier(this.editorState)) === null || _getContextIdentifier === void 0 ? void 0 : _getContextIdentifier.objectId,
|
|
469
|
+
distortedDuration
|
|
465
470
|
},
|
|
466
471
|
eventType: EVENT_TYPE.OPERATIONAL
|
|
467
472
|
});
|
|
468
|
-
|
|
473
|
+
|
|
474
|
+
if (!distortedDuration) {
|
|
475
|
+
var _this$experienceStore9;
|
|
476
|
+
|
|
477
|
+
(_this$experienceStore9 = this.experienceStore) === null || _this$experienceStore9 === void 0 ? void 0 : _this$experienceStore9.mark(EditorExperience.loadEditor, ACTION.PROSEMIRROR_RENDERED, startTime + duration);
|
|
478
|
+
}
|
|
479
|
+
|
|
469
480
|
(_this$experienceStore10 = this.experienceStore) === null || _this$experienceStore10 === void 0 ? void 0 : _this$experienceStore10.addMetadata(EditorExperience.loadEditor, {
|
|
470
481
|
nodes,
|
|
471
482
|
ttfb
|
|
@@ -37,11 +37,12 @@ export function getScrollGutterOptions(props) {
|
|
|
37
37
|
return undefined;
|
|
38
38
|
}
|
|
39
39
|
export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
|
|
40
|
-
var _props$performanceTra, _props$featureFlags, _props$performanceTra2, _props$textFormatting;
|
|
40
|
+
var _props$performanceTra, _props$linking, _props$featureFlags, _props$performanceTra2, _props$textFormatting, _props$linking2;
|
|
41
41
|
|
|
42
42
|
const appearance = props.appearance;
|
|
43
43
|
const isMobile = appearance === 'mobile';
|
|
44
44
|
const inputTracking = (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : _props$performanceTra.inputTracking;
|
|
45
|
+
const cardOptions = ((_props$linking = props.linking) === null || _props$linking === void 0 ? void 0 : _props$linking.smartLinks) || props.smartLinks || props.UNSAFE_cards;
|
|
45
46
|
return {
|
|
46
47
|
createAnalyticsEvent,
|
|
47
48
|
typeAhead: {
|
|
@@ -50,7 +51,7 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
|
|
|
50
51
|
},
|
|
51
52
|
featureFlags: createFeatureFlagsFromProps(props),
|
|
52
53
|
paste: {
|
|
53
|
-
cardOptions
|
|
54
|
+
cardOptions,
|
|
54
55
|
sanitizePrivateContent: props.sanitizePrivateContent,
|
|
55
56
|
plainTextPasteLinkification: ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.plainTextPasteLinkification) === true
|
|
56
57
|
},
|
|
@@ -86,7 +87,11 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
|
|
|
86
87
|
selection: {
|
|
87
88
|
useLongPressSelection: false
|
|
88
89
|
},
|
|
89
|
-
cardOptions
|
|
90
|
+
cardOptions,
|
|
91
|
+
hyperlinkOptions: {
|
|
92
|
+
linkPicker: (_props$linking2 = props.linking) === null || _props$linking2 === void 0 ? void 0 : _props$linking2.linkPicker,
|
|
93
|
+
cardOptions
|
|
94
|
+
},
|
|
90
95
|
codeBlock: { ...props.codeBlock,
|
|
91
96
|
useLongPressSelection: false,
|
|
92
97
|
appearance: props.appearance,
|
|
@@ -102,6 +107,8 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
|
|
|
102
107
|
*/
|
|
103
108
|
|
|
104
109
|
export default function createPluginsList(props, prevProps, createAnalyticsEvent) {
|
|
110
|
+
var _props$linking3;
|
|
111
|
+
|
|
105
112
|
const appearance = props.appearance;
|
|
106
113
|
const isMobile = appearance === 'mobile';
|
|
107
114
|
const isComment = appearance === 'comment';
|
|
@@ -313,13 +320,17 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
|
|
|
313
320
|
}]);
|
|
314
321
|
}
|
|
315
322
|
|
|
316
|
-
if (props.smartLinks || props.UNSAFE_cards) {
|
|
323
|
+
if ((_props$linking3 = props.linking) !== null && _props$linking3 !== void 0 && _props$linking3.smartLinks || props.smartLinks || props.UNSAFE_cards) {
|
|
324
|
+
var _props$linking4, _props$linking5;
|
|
325
|
+
|
|
317
326
|
const fullWidthMode = props.appearance === 'full-width';
|
|
318
327
|
preset.add([cardPlugin, { ...props.UNSAFE_cards,
|
|
319
328
|
...props.smartLinks,
|
|
329
|
+
...((_props$linking4 = props.linking) === null || _props$linking4 === void 0 ? void 0 : _props$linking4.smartLinks),
|
|
320
330
|
platform: isMobile ? 'mobile' : 'web',
|
|
321
331
|
fullWidthMode,
|
|
322
|
-
createAnalyticsEvent
|
|
332
|
+
createAnalyticsEvent,
|
|
333
|
+
linkPicker: (_props$linking5 = props.linking) === null || _props$linking5 === void 0 ? void 0 : _props$linking5.linkPicker
|
|
323
334
|
}]);
|
|
324
335
|
}
|
|
325
336
|
|
|
@@ -360,7 +371,8 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
|
|
|
360
371
|
|
|
361
372
|
|
|
362
373
|
preset.add([toolbarListsIndentationPlugin, {
|
|
363
|
-
showIndentationButtons: !!featureFlags.indentationButtonsInTheToolbar
|
|
374
|
+
showIndentationButtons: !!featureFlags.indentationButtonsInTheToolbar,
|
|
375
|
+
allowHeadingAndParagraphIndentation: !!props.allowIndentation
|
|
364
376
|
}]);
|
|
365
377
|
preset.add([insertBlockPlugin, {
|
|
366
378
|
allowTables: !!props.allowTables,
|
|
@@ -408,11 +420,9 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
|
|
|
408
420
|
preset.add([viewUpdateSubscriptionPlugin]);
|
|
409
421
|
}
|
|
410
422
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}]);
|
|
415
|
-
}
|
|
423
|
+
preset.add([codeBidiWarningPlugin, {
|
|
424
|
+
appearance: props.appearance
|
|
425
|
+
}]);
|
|
416
426
|
|
|
417
427
|
if (featureFlags.floatingToolbarCopyButton) {
|
|
418
428
|
preset.add(copyButtonPlugin);
|