@atlaskit/editor-core 171.0.0 → 172.0.1
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 +96 -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/table/ui/common-styles.js +1 -1
- 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 +18 -12
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +10 -10
- 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/table/ui/common-styles.js +2 -0
- 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 +18 -12
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +10 -10
- 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/table/ui/common-styles.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 +18 -12
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +10 -10
- 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
|
@@ -9,6 +9,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.default = void 0;
|
|
11
11
|
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
|
+
|
|
12
16
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
17
|
|
|
14
18
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -25,13 +29,13 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
25
29
|
|
|
26
30
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
27
31
|
|
|
28
|
-
var _react = require("react");
|
|
32
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
29
33
|
|
|
30
34
|
var _react2 = require("@emotion/react");
|
|
31
35
|
|
|
32
|
-
var
|
|
36
|
+
var _DropList = _interopRequireDefault(require("../DropList"));
|
|
33
37
|
|
|
34
|
-
var
|
|
38
|
+
var _menu = require("@atlaskit/menu");
|
|
35
39
|
|
|
36
40
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
37
41
|
|
|
@@ -41,6 +45,14 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
41
45
|
|
|
42
46
|
var _withOuterListeners = _interopRequireDefault(require("../with-outer-listeners"));
|
|
43
47
|
|
|
48
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
49
|
+
|
|
50
|
+
var _components = require("@atlaskit/theme/components");
|
|
51
|
+
|
|
52
|
+
var _tokens = require("@atlaskit/tokens");
|
|
53
|
+
|
|
54
|
+
var _excluded = ["children"];
|
|
55
|
+
|
|
44
56
|
var _templateObject, _templateObject2, _templateObject3;
|
|
45
57
|
|
|
46
58
|
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); }
|
|
@@ -52,18 +64,33 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
52
64
|
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; } }
|
|
53
65
|
|
|
54
66
|
var wrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* tooltip in ToolbarButton is display:block */\n & > div > div {\n display: flex;\n }\n"])));
|
|
55
|
-
var DropListWithOutsideListeners = (0, _withOuterListeners.default)(_droplist.default);
|
|
56
|
-
/**
|
|
57
|
-
* Hack for item to imitate old dropdown-menu selected styles
|
|
58
|
-
*/
|
|
59
|
-
// TODO: https://product-fabric.atlassian.net/browse/DSP-4500
|
|
60
67
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
68
|
+
var buttonStyles = function buttonStyles(isActive) {
|
|
69
|
+
return function (theme) {
|
|
70
|
+
if (isActive) {
|
|
71
|
+
/**
|
|
72
|
+
* Hack for item to imitate old dropdown-menu selected styles
|
|
73
|
+
*/
|
|
74
|
+
// TODO: https://product-fabric.atlassian.net/browse/DSP-4500
|
|
75
|
+
|
|
76
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
77
|
+
return (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n > span,\n > span:hover {\n background: #6c798f;\n color: #fff;\n }\n "])));
|
|
78
|
+
} else {
|
|
79
|
+
return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n > span:hover[aria-disabled='false'] {\n color: ", ";\n background-color: ", ";\n }\n > span[aria-disabled='true'] {\n color: ", ";\n }\n "])), (0, _components.themed)({
|
|
80
|
+
light: (0, _tokens.token)('color.text', _colors.N900),
|
|
81
|
+
dark: (0, _tokens.token)('color.text', _colors.DN600)
|
|
82
|
+
})(theme), (0, _components.themed)({
|
|
83
|
+
light: (0, _tokens.token)('color.background.neutral.subtle.hovered', 'rgb(244, 245, 247)'),
|
|
84
|
+
dark: (0, _tokens.token)('color.background.neutral.subtle.hovered', 'rgb(59, 71, 92)')
|
|
85
|
+
})(theme), (0, _components.themed)({
|
|
86
|
+
light: (0, _tokens.token)('color.text.disabled', _colors.N70),
|
|
87
|
+
dark: (0, _tokens.token)('color.text.disabled', _colors.DN80)
|
|
88
|
+
})(theme));
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
};
|
|
65
92
|
|
|
66
|
-
var
|
|
93
|
+
var DropListWithOutsideListeners = (0, _withOuterListeners.default)(_DropList.default);
|
|
67
94
|
/**
|
|
68
95
|
* Wrapper around @atlaskit/droplist which uses Popup and Portal to render
|
|
69
96
|
* dropdown-menu outside of "overflow: hidden" containers when needed.
|
|
@@ -114,62 +141,6 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
114
141
|
}
|
|
115
142
|
|
|
116
143
|
(0, _createClass2.default)(DropdownMenuWrapper, [{
|
|
117
|
-
key: "renderItem",
|
|
118
|
-
value: function renderItem(item) {
|
|
119
|
-
var _this$props = this.props,
|
|
120
|
-
onItemActivated = _this$props.onItemActivated,
|
|
121
|
-
_onMouseEnter = _this$props.onMouseEnter,
|
|
122
|
-
_onMouseLeave = _this$props.onMouseLeave,
|
|
123
|
-
shouldUseDefaultRole = _this$props.shouldUseDefaultRole; // onClick and value.name are the action indicators in the handlers
|
|
124
|
-
// If neither are present, don't wrap in an Item.
|
|
125
|
-
|
|
126
|
-
if (!item.onClick && !item.value && !item.value.name) {
|
|
127
|
-
return (0, _react2.jsx)("span", {
|
|
128
|
-
key: String(item.content)
|
|
129
|
-
}, item.content);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
var dropListItem = (0, _react2.jsx)("div", {
|
|
133
|
-
css: item.isActive ? itemWrapper : '',
|
|
134
|
-
key: item.key || item.content
|
|
135
|
-
}, (0, _react2.jsx)(_item.default, {
|
|
136
|
-
role: shouldUseDefaultRole ? 'button' : 'menuitem',
|
|
137
|
-
elemBefore: item.elemBefore,
|
|
138
|
-
elemAfter: item.elemAfter,
|
|
139
|
-
isDisabled: item.isDisabled,
|
|
140
|
-
onClick: function onClick() {
|
|
141
|
-
return onItemActivated && onItemActivated({
|
|
142
|
-
item: item
|
|
143
|
-
});
|
|
144
|
-
},
|
|
145
|
-
onMouseEnter: function onMouseEnter() {
|
|
146
|
-
return _onMouseEnter && _onMouseEnter({
|
|
147
|
-
item: item
|
|
148
|
-
});
|
|
149
|
-
},
|
|
150
|
-
onMouseLeave: function onMouseLeave() {
|
|
151
|
-
return _onMouseLeave && _onMouseLeave({
|
|
152
|
-
item: item
|
|
153
|
-
});
|
|
154
|
-
},
|
|
155
|
-
className: item.className,
|
|
156
|
-
"aria-label": item.label || String(item.content),
|
|
157
|
-
"aria-pressed": shouldUseDefaultRole ? item.isActive : undefined
|
|
158
|
-
}, (0, _react2.jsx)("span", {
|
|
159
|
-
css: !!item.elemBefore ? itemContentWrapper : ''
|
|
160
|
-
}, item.content)));
|
|
161
|
-
|
|
162
|
-
if (item.tooltipDescription) {
|
|
163
|
-
return (0, _react2.jsx)(_tooltip.default, {
|
|
164
|
-
key: item.key || item.content,
|
|
165
|
-
content: item.tooltipDescription,
|
|
166
|
-
position: item.tooltipPosition
|
|
167
|
-
}, dropListItem);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
return dropListItem;
|
|
171
|
-
}
|
|
172
|
-
}, {
|
|
173
144
|
key: "renderDropdownMenu",
|
|
174
145
|
value: function renderDropdownMenu() {
|
|
175
146
|
var _this2 = this;
|
|
@@ -177,17 +148,17 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
177
148
|
var _this$state = this.state,
|
|
178
149
|
target = _this$state.target,
|
|
179
150
|
popupPlacement = _this$state.popupPlacement;
|
|
180
|
-
var _this$
|
|
181
|
-
items = _this$
|
|
182
|
-
mountTo = _this$
|
|
183
|
-
boundariesElement = _this$
|
|
184
|
-
scrollableElement = _this$
|
|
185
|
-
offset = _this$
|
|
186
|
-
fitHeight = _this$
|
|
187
|
-
fitWidth = _this$
|
|
188
|
-
isOpen = _this$
|
|
189
|
-
zIndex = _this$
|
|
190
|
-
shouldUseDefaultRole = _this$
|
|
151
|
+
var _this$props = this.props,
|
|
152
|
+
items = _this$props.items,
|
|
153
|
+
mountTo = _this$props.mountTo,
|
|
154
|
+
boundariesElement = _this$props.boundariesElement,
|
|
155
|
+
scrollableElement = _this$props.scrollableElement,
|
|
156
|
+
offset = _this$props.offset,
|
|
157
|
+
fitHeight = _this$props.fitHeight,
|
|
158
|
+
fitWidth = _this$props.fitWidth,
|
|
159
|
+
isOpen = _this$props.isOpen,
|
|
160
|
+
zIndex = _this$props.zIndex,
|
|
161
|
+
shouldUseDefaultRole = _this$props.shouldUseDefaultRole;
|
|
191
162
|
return (0, _react2.jsx)(_ui.Popup, {
|
|
192
163
|
target: isOpen ? target : undefined,
|
|
193
164
|
mountTo: mountTo,
|
|
@@ -213,20 +184,29 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
213
184
|
minWidth: fitWidth || 0
|
|
214
185
|
}
|
|
215
186
|
}), items.map(function (group, index) {
|
|
216
|
-
return (0, _react2.jsx)(
|
|
187
|
+
return (0, _react2.jsx)(_menu.MenuGroup, {
|
|
217
188
|
key: index,
|
|
218
189
|
role: shouldUseDefaultRole ? 'group' : 'menu'
|
|
219
190
|
}, group.items.map(function (item) {
|
|
220
|
-
|
|
191
|
+
var _item$key;
|
|
192
|
+
|
|
193
|
+
return (0, _react2.jsx)(DropdownMenuItem, {
|
|
194
|
+
key: (_item$key = item.key) !== null && _item$key !== void 0 ? _item$key : String(item.content),
|
|
195
|
+
item: item,
|
|
196
|
+
onItemActivated: _this2.props.onItemActivated,
|
|
197
|
+
shouldUseDefaultRole: _this2.props.shouldUseDefaultRole,
|
|
198
|
+
onMouseEnter: _this2.props.onMouseEnter,
|
|
199
|
+
onMouseLeave: _this2.props.onMouseLeave
|
|
200
|
+
});
|
|
221
201
|
}));
|
|
222
202
|
})));
|
|
223
203
|
}
|
|
224
204
|
}, {
|
|
225
205
|
key: "render",
|
|
226
206
|
value: function render() {
|
|
227
|
-
var _this$
|
|
228
|
-
children = _this$
|
|
229
|
-
isOpen = _this$
|
|
207
|
+
var _this$props2 = this.props,
|
|
208
|
+
children = _this$props2.children,
|
|
209
|
+
isOpen = _this$props2.isOpen;
|
|
230
210
|
return (0, _react2.jsx)("div", {
|
|
231
211
|
css: wrapper
|
|
232
212
|
}, (0, _react2.jsx)("div", {
|
|
@@ -237,4 +217,78 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
237
217
|
return DropdownMenuWrapper;
|
|
238
218
|
}(_react.PureComponent);
|
|
239
219
|
|
|
240
|
-
exports.default = DropdownMenuWrapper;
|
|
220
|
+
exports.default = DropdownMenuWrapper;
|
|
221
|
+
|
|
222
|
+
var DropdownMenuItemCustomComponent = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
223
|
+
var children = props.children,
|
|
224
|
+
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
225
|
+
return (0, _react2.jsx)("span", (0, _extends2.default)({
|
|
226
|
+
ref: ref
|
|
227
|
+
}, rest), children);
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
function DropdownMenuItem(_ref) {
|
|
231
|
+
var _item$key2;
|
|
232
|
+
|
|
233
|
+
var item = _ref.item,
|
|
234
|
+
onItemActivated = _ref.onItemActivated,
|
|
235
|
+
shouldUseDefaultRole = _ref.shouldUseDefaultRole,
|
|
236
|
+
_onMouseEnter = _ref.onMouseEnter,
|
|
237
|
+
_onMouseLeave = _ref.onMouseLeave;
|
|
238
|
+
|
|
239
|
+
// onClick and value.name are the action indicators in the handlers
|
|
240
|
+
// If neither are present, don't wrap in an Item.
|
|
241
|
+
if (!item.onClick && !(item.value && item.value.name)) {
|
|
242
|
+
return (0, _react2.jsx)("span", {
|
|
243
|
+
key: String(item.content)
|
|
244
|
+
}, item.content);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
var dropListItem = (0, _react2.jsx)("div", {
|
|
248
|
+
css: function css(theme) {
|
|
249
|
+
return buttonStyles(item.isActive)({
|
|
250
|
+
theme: theme
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}, (0, _react2.jsx)(_menu.CustomItem, {
|
|
254
|
+
item: item,
|
|
255
|
+
key: (_item$key2 = item.key) !== null && _item$key2 !== void 0 ? _item$key2 : String(item.content),
|
|
256
|
+
role: shouldUseDefaultRole ? 'button' : 'menuitem',
|
|
257
|
+
iconBefore: item.elemBefore,
|
|
258
|
+
iconAfter: item.elemAfter,
|
|
259
|
+
isDisabled: item.isDisabled,
|
|
260
|
+
onClick: function onClick() {
|
|
261
|
+
return onItemActivated && onItemActivated({
|
|
262
|
+
item: item
|
|
263
|
+
});
|
|
264
|
+
},
|
|
265
|
+
"aria-label": item['aria-label'] || String(item.content),
|
|
266
|
+
"aria-pressed": shouldUseDefaultRole ? item.isActive : undefined,
|
|
267
|
+
onMouseDown: function onMouseDown(e) {
|
|
268
|
+
e.preventDefault();
|
|
269
|
+
},
|
|
270
|
+
component: DropdownMenuItemCustomComponent,
|
|
271
|
+
onMouseEnter: function onMouseEnter() {
|
|
272
|
+
return _onMouseEnter && _onMouseEnter({
|
|
273
|
+
item: item
|
|
274
|
+
});
|
|
275
|
+
},
|
|
276
|
+
onMouseLeave: function onMouseLeave() {
|
|
277
|
+
return _onMouseLeave && _onMouseLeave({
|
|
278
|
+
item: item
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
}, item.content));
|
|
282
|
+
|
|
283
|
+
if (item.tooltipDescription) {
|
|
284
|
+
var _item$key3;
|
|
285
|
+
|
|
286
|
+
return (0, _react2.jsx)(_tooltip.default, {
|
|
287
|
+
key: (_item$key3 = item.key) !== null && _item$key3 !== void 0 ? _item$key3 : String(item.content),
|
|
288
|
+
content: item.tooltipDescription,
|
|
289
|
+
position: item.tooltipPosition
|
|
290
|
+
}, dropListItem);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
return dropListItem;
|
|
294
|
+
}
|
|
@@ -14,6 +14,8 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
14
14
|
|
|
15
15
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
16
16
|
|
|
17
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
18
|
+
|
|
17
19
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
18
20
|
|
|
19
21
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -58,7 +60,7 @@ var _EmptyState = _interopRequireDefault(require("./EmptyState"));
|
|
|
58
60
|
|
|
59
61
|
var _utils = require("./utils");
|
|
60
62
|
|
|
61
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10
|
|
63
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
62
64
|
|
|
63
65
|
var _excluded = ["items", "mode", "selectedItemIndex", "focusedItemIndex", "setColumnCount", "createAnalyticsEvent", "emptyStateHandler", "selectedCategory", "searchTerm"];
|
|
64
66
|
|
|
@@ -82,6 +84,11 @@ function ElementList(_ref) {
|
|
|
82
84
|
containerWidth = _useContainerWidth.containerWidth,
|
|
83
85
|
ContainerWidthMonitor = _useContainerWidth.ContainerWidthMonitor;
|
|
84
86
|
|
|
87
|
+
var _useState = (0, _react.useState)(_constants.SCROLLBAR_WIDTH),
|
|
88
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
89
|
+
scrollbarWidth = _useState2[0],
|
|
90
|
+
setScrollbarWidth = _useState2[1];
|
|
91
|
+
|
|
85
92
|
var fullMode = mode === _types.Modes.full;
|
|
86
93
|
(0, _react.useEffect)(function () {
|
|
87
94
|
/**
|
|
@@ -90,8 +97,13 @@ function ElementList(_ref) {
|
|
|
90
97
|
**/
|
|
91
98
|
if (fullMode && containerWidth > 0) {
|
|
92
99
|
setColumnCount((0, _utils.getColumnCount)(containerWidth));
|
|
100
|
+
var updatedScrollbarWidth = (0, _utils.getScrollbarWidth)();
|
|
101
|
+
|
|
102
|
+
if (updatedScrollbarWidth > 0) {
|
|
103
|
+
setScrollbarWidth(updatedScrollbarWidth);
|
|
104
|
+
}
|
|
93
105
|
}
|
|
94
|
-
}, [fullMode, containerWidth, setColumnCount]);
|
|
106
|
+
}, [fullMode, containerWidth, setColumnCount, scrollbarWidth]);
|
|
95
107
|
var onExternalLinkClick = (0, _react.useCallback)(function () {
|
|
96
108
|
(0, _analytics.fireAnalyticsEvent)(createAnalyticsEvent)({
|
|
97
109
|
payload: {
|
|
@@ -141,7 +153,7 @@ function ElementList(_ref) {
|
|
|
141
153
|
return (0, _react2.jsx)(_Collection.Collection, {
|
|
142
154
|
cellCount: items.length,
|
|
143
155
|
cellRenderer: cellRenderer,
|
|
144
|
-
cellSizeAndPositionGetter: (0, _cellSizeAndPositionGetter.default)(containerWidth),
|
|
156
|
+
cellSizeAndPositionGetter: (0, _cellSizeAndPositionGetter.default)(containerWidth - _constants.ELEMENT_LIST_PADDING * 2, scrollbarWidth),
|
|
145
157
|
height: height,
|
|
146
158
|
width: containerWidth - _constants.ELEMENT_LIST_PADDING * 2 // containerWidth - padding on Left/Right (for focus outline)
|
|
147
159
|
|
|
@@ -265,22 +277,21 @@ var ItemContent = /*#__PURE__*/(0, _react.memo)(function (_ref6) {
|
|
|
265
277
|
css: itemDescription
|
|
266
278
|
}, description)));
|
|
267
279
|
});
|
|
268
|
-
var
|
|
269
|
-
var
|
|
270
|
-
var
|
|
271
|
-
var itemBody = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n line-height: 1.4;\n width: 100%;\n\n margin-top: -2px; // Fixes the Item Icon and text's alignment issue\n"])));
|
|
280
|
+
var elementItemsWrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n flex: 1;\n flex-flow: row wrap;\n align-items: flex-start;\n justify-content: flex-start;\n overflow: hidden;\n padding: ", "px; // For Focus outline\n\n .ReactVirtualized__Collection {\n border-radius: 3px; // Standard border-radius across other components like Search or Item.\n outline: none;\n\n :focus {\n box-shadow: 0 0 0 ", "px\n ", ";\n }\n }\n .ReactVirtualized__Collection__innerScrollContainer {\n div[class='element-item-wrapper']:last-child {\n padding-bottom: 4px;\n }\n }\n"])), _constants.ELEMENT_LIST_PADDING, _constants.ELEMENT_LIST_PADDING, (0, _tokens.token)('color.border.focused', _colors.B100));
|
|
281
|
+
var elementItemWrapper = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n div {\n button {\n height: 75px;\n align-items: flex-start;\n padding: 12px 12px 11px;\n }\n }\n"])));
|
|
282
|
+
var itemBody = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n line-height: 1.4;\n width: 100%;\n\n margin-top: -2px; // Fixes the Item Icon and text's alignment issue\n"])));
|
|
272
283
|
/*
|
|
273
284
|
* -webkit-line-clamp is also supported by firefox 🎉
|
|
274
285
|
* https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/68#CSS
|
|
275
286
|
*/
|
|
276
287
|
|
|
277
|
-
var multilineStyle = (0, _react2.css)(
|
|
278
|
-
var itemDescription = (0, _react2.css)(
|
|
279
|
-
var itemText = (0, _react2.css)(
|
|
280
|
-
var itemTitleWrapper = (0, _react2.css)(
|
|
281
|
-
var itemTitle = (0, _react2.css)(
|
|
282
|
-
var itemAfter = (0, _react2.css)(
|
|
283
|
-
var itemIconStyle = (0, _react2.css)(
|
|
288
|
+
var multilineStyle = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n"])));
|
|
289
|
+
var itemDescription = (0, _react2.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n\n overflow: hidden;\n font-size: ", ";\n color: ", ";\n margin-top: 2px;\n"])), multilineStyle, (0, _editorSharedStyles.relativeFontSizeToBase16)(11.67), (0, _tokens.token)('color.text.subtle', _colors.N200));
|
|
290
|
+
var itemText = (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n width: inherit;\n white-space: initial;\n"])));
|
|
291
|
+
var itemTitleWrapper = (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between; // Title and keyboardshortcut are rendered in the same block\n"])));
|
|
292
|
+
var itemTitle = (0, _react2.css)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n overflow: hidden;\n\n white-space: nowrap;\n text-overflow: ellipsis;\n"])));
|
|
293
|
+
var itemAfter = (0, _react2.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n flex: 0 0 auto;\n"])));
|
|
294
|
+
var itemIconStyle = (0, _react2.css)(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n img {\n height: 40px;\n width: 40px;\n object-fit: cover;\n }\n"])));
|
|
284
295
|
var MemoizedElementListWithAnalytics = /*#__PURE__*/(0, _react.memo)((0, _analyticsNext.withAnalyticsContext)({
|
|
285
296
|
component: 'ElementList'
|
|
286
297
|
})(ElementList));
|
|
@@ -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;
|