@atlaskit/editor-core 182.0.0 → 182.0.2
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 +12 -0
- package/dist/cjs/actions/index.js +17 -7
- package/dist/cjs/create-editor/ErrorBoundary.js +8 -7
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +0 -1
- package/dist/cjs/editor-next/editor-internal.js +1 -1
- package/dist/cjs/editor-next/index.js +1 -1
- package/dist/cjs/editor-next/utils/sendDurationAnalytics.js +4 -3
- package/dist/cjs/editor-next/utils/trackEditorActions.js +4 -3
- package/dist/cjs/editor.js +15 -1
- package/dist/cjs/labs/next/full-page.js +1 -0
- package/dist/cjs/labs/next/internal/context/shared-config.js +5 -0
- package/dist/cjs/labs/next/presets/cxhtml.js +25 -0
- package/dist/cjs/labs/next/presets/default.js +2 -0
- package/dist/cjs/labs/next/presets/mobile.js +13 -0
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.js +0 -1
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +1 -1
- package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +6 -5
- package/dist/cjs/plugins/annotation/toolbar.js +3 -0
- package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +1 -0
- package/dist/cjs/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +1 -0
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +1 -1
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +1 -0
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +1 -0
- package/dist/cjs/plugins/card/nodeviews/embedCard.js +6 -0
- package/dist/cjs/plugins/card/ui/LinkToolbarButtonGroup.js +1 -0
- package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +1 -1
- package/dist/cjs/plugins/collab-edit/index.js +4 -3
- package/dist/cjs/plugins/custom-autoformat/doc.js +4 -3
- package/dist/cjs/plugins/custom-autoformat/index.js +4 -3
- package/dist/cjs/plugins/date/ui/DatePicker/date-picker-input.js +7 -0
- package/dist/cjs/plugins/date/ui/DatePicker/index.js +1 -0
- package/dist/cjs/plugins/expand/ui/ExpandIconButton.js +1 -1
- package/dist/cjs/plugins/extension/actions.js +4 -3
- package/dist/cjs/plugins/extension/commands.js +3 -0
- package/dist/cjs/plugins/extension/context-panel.js +8 -7
- package/dist/cjs/plugins/extension/pm-plugins/main.js +8 -7
- package/dist/cjs/plugins/extension/pm-plugins/utils.js +6 -5
- package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +1 -0
- package/dist/cjs/plugins/extension/ui/Extension/ExtensionComponent.js +11 -3
- package/dist/cjs/plugins/extension/ui/Extension/InlineExtension/index.js +1 -1
- package/dist/cjs/plugins/extension/ui/Extension/Lozenge.js +1 -1
- package/dist/cjs/plugins/extension/ui/SaveIndicator/SaveIndicator.js +1 -0
- package/dist/cjs/plugins/feedback-dialog/index.js +6 -5
- package/dist/cjs/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +4 -3
- package/dist/cjs/plugins/find-replace/styles.js +2 -0
- package/dist/cjs/plugins/find-replace/ui/Find.js +1 -1
- package/dist/cjs/plugins/find-replace/ui/FindReplace.js +1 -1
- package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +1 -0
- package/dist/cjs/plugins/find-replace/ui/Replace.js +1 -1
- package/dist/cjs/plugins/find-replace/ui/styles.js +1 -0
- package/dist/cjs/plugins/find-replace/utils/batch-decorations.js +10 -9
- package/dist/cjs/plugins/floating-toolbar/index.js +2 -1
- package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +1 -0
- package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +3 -0
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -0
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +7 -7
- package/dist/cjs/plugins/floating-toolbar/ui/Input.js +1 -1
- package/dist/cjs/plugins/floating-toolbar/ui/ScrollButtons.js +1 -0
- package/dist/cjs/plugins/floating-toolbar/ui/Separator.js +1 -0
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +1 -0
- package/dist/cjs/plugins/help-dialog/ui/index.js +1 -1
- package/dist/cjs/plugins/hyperlink/HyperlinkToolbarAppearance.js +7 -7
- package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +4 -0
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +14 -13
- package/dist/cjs/plugins/image-upload/pm-plugins/main.js +4 -3
- package/dist/cjs/plugins/indentation/commands/utils.js +2 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +1 -1
- package/dist/cjs/plugins/jira-issue/nodeviews/jira-issue.js +1 -0
- package/dist/cjs/plugins/list/commands/listBackspace.js +0 -1
- package/dist/cjs/plugins/macro/actions.js +6 -5
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +4 -3
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +5 -5
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +34 -32
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +5 -5
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +10 -9
- package/dist/cjs/plugins/media/nodeviews/styles.js +1 -0
- package/dist/cjs/plugins/media/picker-facade.js +4 -3
- package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -0
- package/dist/cjs/plugins/media/pm-plugins/main.js +25 -7
- package/dist/cjs/plugins/media/pm-plugins/mediaTaskManager.js +4 -3
- package/dist/cjs/plugins/media/toolbar/linking-toolbar-appearance.js +1 -0
- package/dist/cjs/plugins/media/toolbar/utils.js +4 -3
- package/dist/cjs/plugins/media/ui/CaptionPlaceholder/index.js +1 -0
- package/dist/cjs/plugins/media/ui/ImageBorder/index.js +2 -2
- package/dist/cjs/plugins/media/ui/Media/DropPlaceholder.js +1 -0
- package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +2 -0
- package/dist/cjs/plugins/media/ui/MediaPicker/PickerFacadeProvider.js +4 -3
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +7 -6
- package/dist/cjs/plugins/media/utils/check-media-type.js +4 -3
- package/dist/cjs/plugins/mentions/nodeviews/mention.js +3 -3
- package/dist/cjs/plugins/paste/handlers.js +4 -3
- package/dist/cjs/plugins/paste/pm-plugins/main.js +3 -3
- package/dist/cjs/plugins/quick-insert/index.js +4 -3
- package/dist/cjs/plugins/status/nodeviews/status.js +1 -0
- package/dist/cjs/plugins/status/ui/statusPicker.js +5 -0
- package/dist/cjs/plugins/tasks-and-decisions/index.js +1 -0
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +10 -0
- package/dist/cjs/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +8 -4
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +1 -1
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +1 -0
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +1 -1
- package/dist/cjs/plugins/type-ahead/ui/AssistiveText.js +1 -1
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +1 -0
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +1 -0
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +1 -0
- package/dist/cjs/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +1 -1
- package/dist/cjs/ui/Addon/ClickAreaBlock/index.js +1 -0
- package/dist/cjs/ui/Addon/ClickAreaInline/index.js +1 -0
- package/dist/cjs/ui/Addon/ClickAreaMobile/index.js +1 -0
- package/dist/cjs/ui/Addon/Dropdown/index.js +1 -1
- package/dist/cjs/ui/Alignment/index.js +1 -1
- package/dist/cjs/ui/Appearance/Chromeless.js +1 -0
- package/dist/cjs/ui/Appearance/Comment/Comment.js +19 -1
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +1 -0
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +1 -1
- package/dist/cjs/ui/AppearanceComponents/Mobile.js +1 -0
- package/dist/cjs/ui/ChromeCollapsed/index.js +1 -1
- package/dist/cjs/ui/ColorPickerButton/index.js +1 -0
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +9 -5
- package/dist/cjs/ui/ConfigPanel/ErrorMessage/ErrorImage.js +3 -0
- package/dist/cjs/ui/ConfigPanel/Fields/Boolean.js +1 -0
- package/dist/cjs/ui/ConfigPanel/Fields/CheckboxGroup.js +1 -0
- package/dist/cjs/ui/ConfigPanel/Fields/ColorPicker.js +1 -1
- package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +3 -3
- package/dist/cjs/ui/ConfigPanel/Fields/DateRange.js +1 -0
- package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +1 -0
- package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +1 -0
- package/dist/cjs/ui/ConfigPanel/Fields/SelectItem.js +1 -0
- package/dist/cjs/ui/ConfigPanel/Fields/TabGroup.js +1 -0
- package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +5 -5
- package/dist/cjs/ui/ConfigPanel/FormErrorBoundary.js +4 -3
- package/dist/cjs/ui/ConfigPanel/Header.js +1 -0
- package/dist/cjs/ui/ConfigPanel/LoadingState.js +1 -0
- package/dist/cjs/ui/ConfigPanel/NestedForms/RemovableField.js +1 -0
- package/dist/cjs/ui/ConfigPanel/transformers.js +20 -19
- package/dist/cjs/ui/ContentStyles/index.js +1 -0
- package/dist/cjs/ui/ContextPanel/context.js +15 -0
- package/dist/cjs/ui/ContextPanel/index.js +1 -0
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +3 -0
- package/dist/cjs/ui/ElementBrowser/ModalElementBrowser.js +1 -0
- package/dist/cjs/ui/ElementBrowser/components/CategoryList.js +1 -0
- package/dist/cjs/ui/ElementBrowser/components/ElementBrowserLoader.js +1 -0
- package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
- package/dist/cjs/ui/ElementBrowser/components/ElementList/EmptyState.js +1 -0
- package/dist/cjs/ui/ElementBrowser/components/ElementList/NotFoundIllustration.js +3 -0
- package/dist/cjs/ui/ElementBrowser/components/ElementSearch.js +1 -0
- package/dist/cjs/ui/ElementBrowser/components/StatelessElementBrowser.js +1 -0
- package/dist/cjs/ui/ElementBrowser/hooks/use-container-width.js +27 -0
- package/dist/cjs/ui/ElementBrowser/hooks/use-focus.js +32 -0
- package/dist/cjs/ui/ElementBrowser/hooks/use-select-and-focus-on-arrow-navigation.js +38 -0
- package/dist/cjs/ui/FloatingToolbar/index.js +1 -1
- package/dist/cjs/ui/LinkSearch/LinkSearchList.js +1 -0
- package/dist/cjs/ui/LinkSearch/LinkSearchListItem.js +3 -0
- package/dist/cjs/ui/LinkSearch/index.js +8 -7
- package/dist/cjs/ui/PanelTextInput/index.js +1 -1
- package/dist/cjs/ui/PluginSlot/index.js +1 -0
- package/dist/cjs/ui/Toolbar/ToolbarInner.js +1 -0
- package/dist/cjs/ui/Toolbar/ToolbarWithSizeDetector.js +1 -0
- package/dist/cjs/ui/ToolbarArrowKeyNavigationProvider/index.js +33 -20
- package/dist/cjs/ui/ToolbarFeedback/index.js +7 -4
- package/dist/cjs/ui/WithFlash/index.js +1 -0
- package/dist/cjs/ui/styles.js +5 -3
- package/dist/cjs/utils/action.js +6 -5
- package/dist/cjs/utils/announcer/announcer.js +9 -1
- package/dist/cjs/utils/clipboard.js +5 -5
- package/dist/cjs/utils/extensions.js +6 -5
- package/dist/cjs/utils/index.js +12 -0
- package/dist/cjs/utils/performance/simple-measure-to-entries.js +2 -1
- package/dist/cjs/utils/performance/track-transactions.js +2 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +9 -0
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +0 -1
- package/dist/es2019/editor.js +14 -0
- package/dist/es2019/labs/next/internal/context/shared-config.js +6 -0
- package/dist/es2019/labs/next/presets/cxhtml.js +23 -0
- package/dist/es2019/labs/next/presets/mobile.js +0 -2
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.js +0 -1
- package/dist/es2019/plugins/annotation/toolbar.js +0 -1
- package/dist/es2019/plugins/card/nodeviews/embedCard.js +7 -0
- package/dist/es2019/plugins/date/ui/DatePicker/date-picker-input.js +7 -0
- package/dist/es2019/plugins/extension/commands.js +0 -1
- package/dist/es2019/plugins/extension/ui/Extension/ExtensionComponent.js +9 -0
- package/dist/es2019/plugins/floating-toolbar/index.js +0 -1
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +3 -0
- package/dist/es2019/plugins/indentation/commands/utils.js +3 -0
- package/dist/es2019/plugins/list/commands/listBackspace.js +0 -1
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +5 -1
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +3 -0
- package/dist/es2019/plugins/media/pm-plugins/main.js +18 -0
- package/dist/es2019/plugins/media/ui/ImageBorder/index.js +2 -2
- package/dist/es2019/plugins/quick-insert/commands.js +0 -1
- package/dist/es2019/plugins/status/ui/statusPicker.js +4 -0
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +11 -0
- package/dist/es2019/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +5 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +18 -1
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +4 -0
- package/dist/es2019/ui/ContextPanel/context.js +0 -1
- package/dist/es2019/ui/ToolbarArrowKeyNavigationProvider/index.js +26 -15
- package/dist/es2019/ui/ToolbarFeedback/index.js +3 -0
- package/dist/es2019/ui/styles.js +5 -0
- package/dist/es2019/utils/announcer/announcer.js +0 -2
- package/dist/es2019/utils/index.js +9 -0
- package/dist/es2019/utils/performance/simple-measure-to-entries.js +1 -1
- package/dist/es2019/utils/performance/track-transactions.js +2 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +17 -7
- package/dist/esm/create-editor/ErrorBoundary.js +8 -7
- package/dist/esm/create-editor/ReactEditorViewInternal.js +0 -1
- package/dist/esm/editor-next/utils/sendDurationAnalytics.js +4 -3
- package/dist/esm/editor-next/utils/trackEditorActions.js +4 -3
- package/dist/esm/editor.js +14 -0
- package/dist/esm/labs/next/internal/context/shared-config.js +6 -0
- package/dist/esm/labs/next/presets/cxhtml.js +23 -0
- package/dist/esm/labs/next/presets/mobile.js +0 -2
- package/dist/esm/nodeviews/getInlineNodeViewProducer.js +0 -1
- package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +6 -5
- package/dist/esm/plugins/annotation/toolbar.js +0 -1
- package/dist/esm/plugins/card/nodeviews/embedCard.js +6 -0
- package/dist/esm/plugins/collab-edit/index.js +4 -3
- package/dist/esm/plugins/custom-autoformat/doc.js +4 -3
- package/dist/esm/plugins/custom-autoformat/index.js +4 -3
- package/dist/esm/plugins/date/ui/DatePicker/date-picker-input.js +6 -0
- package/dist/esm/plugins/extension/actions.js +4 -3
- package/dist/esm/plugins/extension/commands.js +0 -1
- package/dist/esm/plugins/extension/context-panel.js +7 -7
- package/dist/esm/plugins/extension/pm-plugins/main.js +7 -7
- package/dist/esm/plugins/extension/pm-plugins/utils.js +6 -5
- package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +12 -3
- package/dist/esm/plugins/feedback-dialog/index.js +6 -5
- package/dist/esm/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +4 -3
- package/dist/esm/plugins/find-replace/utils/batch-decorations.js +10 -9
- package/dist/esm/plugins/floating-toolbar/index.js +0 -1
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +3 -0
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +8 -7
- package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +8 -7
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +14 -13
- package/dist/esm/plugins/image-upload/pm-plugins/main.js +4 -3
- package/dist/esm/plugins/indentation/commands/utils.js +3 -0
- package/dist/esm/plugins/list/commands/listBackspace.js +0 -1
- package/dist/esm/plugins/macro/actions.js +6 -5
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +4 -3
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +6 -5
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +34 -32
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +6 -5
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +10 -8
- package/dist/esm/plugins/media/picker-facade.js +4 -3
- package/dist/esm/plugins/media/pm-plugins/main.js +26 -7
- package/dist/esm/plugins/media/pm-plugins/mediaTaskManager.js +4 -3
- package/dist/esm/plugins/media/toolbar/utils.js +4 -3
- package/dist/esm/plugins/media/ui/ImageBorder/index.js +2 -2
- package/dist/esm/plugins/media/ui/MediaPicker/PickerFacadeProvider.js +4 -3
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +6 -5
- package/dist/esm/plugins/media/utils/check-media-type.js +4 -3
- package/dist/esm/plugins/mentions/nodeviews/mention.js +4 -3
- package/dist/esm/plugins/paste/handlers.js +4 -3
- package/dist/esm/plugins/paste/pm-plugins/main.js +4 -3
- package/dist/esm/plugins/quick-insert/commands.js +0 -1
- package/dist/esm/plugins/quick-insert/index.js +4 -3
- package/dist/esm/plugins/status/ui/statusPicker.js +4 -0
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +10 -0
- package/dist/esm/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +9 -4
- package/dist/esm/ui/Appearance/Comment/Comment.js +18 -1
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +10 -5
- package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +4 -3
- package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +6 -5
- package/dist/esm/ui/ConfigPanel/FormErrorBoundary.js +4 -3
- package/dist/esm/ui/ConfigPanel/transformers.js +19 -19
- package/dist/esm/ui/ContextPanel/context.js +0 -1
- package/dist/esm/ui/LinkSearch/index.js +8 -7
- package/dist/esm/ui/ToolbarArrowKeyNavigationProvider/index.js +26 -14
- package/dist/esm/ui/ToolbarFeedback/index.js +6 -3
- package/dist/esm/ui/styles.js +3 -2
- package/dist/esm/utils/action.js +6 -5
- package/dist/esm/utils/announcer/announcer.js +0 -2
- package/dist/esm/utils/clipboard.js +6 -5
- package/dist/esm/utils/extensions.js +6 -5
- package/dist/esm/utils/index.js +9 -0
- package/dist/esm/utils/performance/simple-measure-to-entries.js +2 -1
- package/dist/esm/utils/performance/track-transactions.js +2 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +8 -2
- package/dist/types/ui/styles.d.ts +1 -0
- package/package.json +6 -6
|
@@ -15,6 +15,21 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
|
16
16
|
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); }; }
|
|
17
17
|
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; } }
|
|
18
|
+
// React context to communicate the active context panel width up and down the tree.
|
|
19
|
+
//
|
|
20
|
+
// We need the width prop from the ContextPanel component.
|
|
21
|
+
//
|
|
22
|
+
// However, the actual <ContextPanel /> component might be deeply nested inside the contextPanel.
|
|
23
|
+
// For example, in the template context panel storybook, we wrap it in 2 higher order components.
|
|
24
|
+
//
|
|
25
|
+
// Changing the max-width on the main editor container happens above where the <ContextPanel /> gets rendered.
|
|
26
|
+
//
|
|
27
|
+
// To subtract the context panel width from the available real estate, we use the Provider and Consumer.
|
|
28
|
+
//
|
|
29
|
+
// positionedOverEditor is used to determine whether the context panel is positioned over the Editor so we are
|
|
30
|
+
// able to position and add margins to handle certain elements like inline comment dialogues overlapping the context
|
|
31
|
+
// panel
|
|
32
|
+
|
|
18
33
|
var ContextPanel = /*#__PURE__*/_react.default.createContext({
|
|
19
34
|
width: 0,
|
|
20
35
|
positionedOverEditor: false,
|
|
@@ -26,6 +26,7 @@ var _width = require("../../plugins/width");
|
|
|
26
26
|
var _WithEditorActions = _interopRequireDefault(require("../WithEditorActions"));
|
|
27
27
|
var _document = require("../../utils/document");
|
|
28
28
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
29
|
+
/** @jsx jsx */
|
|
29
30
|
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; }
|
|
30
31
|
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; }
|
|
31
32
|
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); }; }
|
|
@@ -25,6 +25,9 @@ var _ElementBrowserLoader = _interopRequireDefault(require("./components/Element
|
|
|
25
25
|
var _constants = require("./constants");
|
|
26
26
|
var _excluded = ["children"];
|
|
27
27
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
28
|
+
/** @jsx jsx */
|
|
29
|
+
// AFP-2532 TODO: Fix automatic suppressions below
|
|
30
|
+
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
28
31
|
var InsertMenu = function InsertMenu(_ref) {
|
|
29
32
|
var editorView = _ref.editorView,
|
|
30
33
|
dropdownItems = _ref.dropdownItems,
|
|
@@ -22,6 +22,7 @@ var _categories = require("./categories");
|
|
|
22
22
|
var _constants2 = require("./constants");
|
|
23
23
|
var _messages = require("./messages");
|
|
24
24
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
25
|
+
/** @jsx jsx */
|
|
25
26
|
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); }
|
|
26
27
|
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; }
|
|
27
28
|
var actions = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: inline-flex;\n margin: 0 -4px;\n"])));
|
|
@@ -22,6 +22,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
22
22
|
var _templateObject;
|
|
23
23
|
var _excluded = ["categories"],
|
|
24
24
|
_excluded2 = ["buttonStyles"];
|
|
25
|
+
/** @jsx jsx */
|
|
25
26
|
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); }
|
|
26
27
|
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; }
|
|
27
28
|
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; }
|
|
@@ -12,6 +12,7 @@ var _react2 = _interopRequireDefault(require("react"));
|
|
|
12
12
|
var _reactLoadable = _interopRequireDefault(require("react-loadable"));
|
|
13
13
|
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
14
14
|
var _templateObject;
|
|
15
|
+
/** @jsx jsx */
|
|
15
16
|
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); }
|
|
16
17
|
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; }
|
|
17
18
|
var spinnerContainer = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n"])));
|
|
@@ -33,6 +33,7 @@ var _EmptyState = _interopRequireDefault(require("./EmptyState"));
|
|
|
33
33
|
var _utils = require("./utils");
|
|
34
34
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
35
35
|
var _excluded = ["items", "mode", "selectedItemIndex", "focusedItemIndex", "setColumnCount", "createAnalyticsEvent", "emptyStateHandler", "selectedCategory", "searchTerm"];
|
|
36
|
+
/** @jsx jsx */
|
|
36
37
|
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); }
|
|
37
38
|
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; }
|
|
38
39
|
function ElementList(_ref) {
|
|
@@ -11,6 +11,7 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
11
11
|
var _button = _interopRequireDefault(require("@atlaskit/button"));
|
|
12
12
|
var _NotFoundIllustration = _interopRequireDefault(require("./NotFoundIllustration"));
|
|
13
13
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
14
|
+
/** @jsx jsx */
|
|
14
15
|
function EmptyState(_ref) {
|
|
15
16
|
var onExternalLinkClick = _ref.onExternalLinkClick;
|
|
16
17
|
return (0, _react.jsx)("div", {
|
|
@@ -8,6 +8,9 @@ exports.default = NotFoundIllustration;
|
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _templateObject;
|
|
11
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
12
|
+
// TODO: https://product-fabric.atlassian.net/browse/DSP-4249
|
|
13
|
+
/** @jsx jsx */
|
|
11
14
|
var imageContainer = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 120px;\n height: 111px;\n margin-top: 48px;\n"])));
|
|
12
15
|
function NotFoundIllustration() {
|
|
13
16
|
return (0, _react.jsx)("div", {
|
|
@@ -20,6 +20,7 @@ var _useFocus = _interopRequireDefault(require("../hooks/use-focus"));
|
|
|
20
20
|
var _types = require("../types");
|
|
21
21
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
22
22
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
23
|
+
/** @jsx jsx */
|
|
23
24
|
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); }
|
|
24
25
|
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; }
|
|
25
26
|
function ElementSearch(_ref) {
|
|
@@ -21,6 +21,7 @@ var _constants = require("../constants");
|
|
|
21
21
|
var _useContainerWidth2 = _interopRequireDefault(require("../hooks/use-container-width"));
|
|
22
22
|
var _useSelectAndFocusOnArrowNavigation = _interopRequireDefault(require("../hooks/use-select-and-focus-on-arrow-navigation"));
|
|
23
23
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15;
|
|
24
|
+
/** @jsx jsx */
|
|
24
25
|
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); }
|
|
25
26
|
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; }
|
|
26
27
|
var wrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n max-height: inherit;\n overflow: hidden;\n"])));
|
|
@@ -12,8 +12,35 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
13
|
var _widthDetector = require("@atlaskit/width-detector");
|
|
14
14
|
var _templateObject;
|
|
15
|
+
/** @jsx jsx */
|
|
15
16
|
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); }
|
|
16
17
|
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; }
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* Problem:
|
|
21
|
+
* While using WidthObserver, there's no initial width.
|
|
22
|
+
* That may cause problems, but not limited to, something like a lag between
|
|
23
|
+
* renders for conditionally rendered components.
|
|
24
|
+
*
|
|
25
|
+
* solution:
|
|
26
|
+
* useContainerWidth() hook
|
|
27
|
+
* it pre-measures the width of a parent container on initial mount
|
|
28
|
+
* and gives you back the containerWidth.
|
|
29
|
+
*
|
|
30
|
+
*
|
|
31
|
+
* Example hook usage:
|
|
32
|
+
*
|
|
33
|
+
* const { containerWidth, ContainerWidthMonitor } = useContainerWidth();
|
|
34
|
+
*
|
|
35
|
+
* return (
|
|
36
|
+
* <>
|
|
37
|
+
* <ContainerWidthMonitor />
|
|
38
|
+
* {containerWidth < 600 ? <MobileComponent /> : <DesktopComponent />}
|
|
39
|
+
* </>
|
|
40
|
+
* );
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
|
+
|
|
17
44
|
var widthObserverWrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n"])));
|
|
18
45
|
function useContainerWidth() {
|
|
19
46
|
var _useState = (0, _react.useState)(0),
|
|
@@ -5,6 +5,38 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = useFocus;
|
|
7
7
|
var _react = require("react");
|
|
8
|
+
/**
|
|
9
|
+
* A custom hook that handles focus on a DOM element.
|
|
10
|
+
* Takes in a boolean value and calls element.focus
|
|
11
|
+
*
|
|
12
|
+
* @param {boolean} focus
|
|
13
|
+
*
|
|
14
|
+
* Example usage:
|
|
15
|
+
*******************************************************************************
|
|
16
|
+
* const SearchBar = ({ focus }) => {
|
|
17
|
+
* const ref = useFocus(focus);
|
|
18
|
+
* return <input ref={ref} />
|
|
19
|
+
* }
|
|
20
|
+
*******************************************************************************
|
|
21
|
+
* const ItemList = ({ items, focus }) => (
|
|
22
|
+
* <ul>
|
|
23
|
+
* {items.map((item, index) => (
|
|
24
|
+
* <Item key={item.uuid} item={item} focus={focus} />
|
|
25
|
+
* ))}
|
|
26
|
+
* </ul>
|
|
27
|
+
* );
|
|
28
|
+
*
|
|
29
|
+
* const Item = ({ item, focus }) => {
|
|
30
|
+
* const ref = useFocus(focus);
|
|
31
|
+
* return (
|
|
32
|
+
* <li ref={ref}>
|
|
33
|
+
* {item.name}
|
|
34
|
+
* </li>
|
|
35
|
+
* )
|
|
36
|
+
* }
|
|
37
|
+
*******************************************************************************
|
|
38
|
+
*/
|
|
39
|
+
|
|
8
40
|
function useFocus(focus) {
|
|
9
41
|
var ref = (0, _react.useRef)(null);
|
|
10
42
|
(0, _react.useLayoutEffect)(function () {
|
|
@@ -10,6 +10,44 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
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; }
|
|
12
12
|
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; }
|
|
13
|
+
/**
|
|
14
|
+
* a custom hook that handles keyboard navigation for Arrow keys based on a
|
|
15
|
+
* given listSize, and a step (for up and down arrows).
|
|
16
|
+
*
|
|
17
|
+
* @param {number} listSize
|
|
18
|
+
* @param {number} upDownStep
|
|
19
|
+
*
|
|
20
|
+
* Example usage:
|
|
21
|
+
* const list = ['Confluence','Jira','Atlaskit'];
|
|
22
|
+
* const {
|
|
23
|
+
* selectedItemIndex,
|
|
24
|
+
* focusedItemIndex,
|
|
25
|
+
* focusOnSearch,
|
|
26
|
+
* setFocusedItemIndex,
|
|
27
|
+
* onKeyDown
|
|
28
|
+
* } = useSelectAndFocusOnArrowNavigation(list.length - 1, 1);
|
|
29
|
+
*
|
|
30
|
+
* return (
|
|
31
|
+
* <div onKeyDown={onKeyDown}>
|
|
32
|
+
* <SearchBar onClick={() => setFocusedItemIndex(undefined)} focus={focusOnSearch} />
|
|
33
|
+
* {list.map((item, index) => (
|
|
34
|
+
* <ListItem
|
|
35
|
+
* title={item}
|
|
36
|
+
* style={{ ..., color: selected ? 'selectedStateColor' : defaultColor }}
|
|
37
|
+
* onClick={() => {
|
|
38
|
+
* setFocusedItemIndex(index);
|
|
39
|
+
* }
|
|
40
|
+
* />
|
|
41
|
+
* )}
|
|
42
|
+
* </div>
|
|
43
|
+
* );
|
|
44
|
+
*
|
|
45
|
+
* const SearchBar = ({ focus }) => {
|
|
46
|
+
* const ref = useRefToFocusOrScroll(focus);
|
|
47
|
+
* return <input ref={ref} />
|
|
48
|
+
* }
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
13
51
|
var ACTIONS;
|
|
14
52
|
exports.ACTIONS = ACTIONS;
|
|
15
53
|
(function (ACTIONS) {
|
|
@@ -34,7 +34,7 @@ var _ui = require("@atlaskit/editor-common/ui");
|
|
|
34
34
|
var _styles = require("./styles");
|
|
35
35
|
var _utils = require("./utils");
|
|
36
36
|
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); }; }
|
|
37
|
-
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; } }
|
|
37
|
+
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; } } /** @jsx jsx */
|
|
38
38
|
var FloatingToolbar = /*#__PURE__*/function (_PureComponent) {
|
|
39
39
|
(0, _inherits2.default)(FloatingToolbar, _PureComponent);
|
|
40
40
|
var _super = _createSuper(FloatingToolbar);
|
|
@@ -16,6 +16,7 @@ var _react2 = require("react");
|
|
|
16
16
|
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
17
17
|
var _LinkSearchListItem = _interopRequireDefault(require("./LinkSearchListItem"));
|
|
18
18
|
var _templateObject, _templateObject2, _templateObject3;
|
|
19
|
+
/** @jsx jsx */
|
|
19
20
|
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); }; }
|
|
20
21
|
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; } }
|
|
21
22
|
var listContainer = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n padding-top: 0;\n"])));
|
|
@@ -23,6 +23,9 @@ var _listItemAlts = require("./listItemAlts");
|
|
|
23
23
|
var _transformTimeStamp = require("./transformTimeStamp");
|
|
24
24
|
var _reactIntlNext = require("react-intl-next");
|
|
25
25
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
26
|
+
/** @jsx jsx */
|
|
27
|
+
// AFP-2532 TODO: Fix automatic suppressions below
|
|
28
|
+
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
26
29
|
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); }
|
|
27
30
|
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; }
|
|
28
31
|
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); }; }
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
8
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -19,6 +19,7 @@ var _LinkSearchList = _interopRequireDefault(require("./LinkSearchList"));
|
|
|
19
19
|
var _reactIntlNext = require("react-intl-next");
|
|
20
20
|
var _withActivityProvider = _interopRequireDefault(require("./withActivityProvider"));
|
|
21
21
|
var _analytics = require("../../plugins/analytics");
|
|
22
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
22
23
|
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); }; }
|
|
23
24
|
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; } }
|
|
24
25
|
var DEFAULT_ITEMS_LIMIT = 5;
|
|
@@ -87,8 +88,8 @@ var RecentLink = /*#__PURE__*/function (_React$Component) {
|
|
|
87
88
|
}
|
|
88
89
|
});
|
|
89
90
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleChange", /*#__PURE__*/function () {
|
|
90
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
91
|
-
return
|
|
91
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(input) {
|
|
92
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
92
93
|
while (1) {
|
|
93
94
|
switch (_context.prev = _context.next) {
|
|
94
95
|
case 0:
|
|
@@ -221,8 +222,8 @@ var RecentLink = /*#__PURE__*/function (_React$Component) {
|
|
|
221
222
|
}, {
|
|
222
223
|
key: "componentDidMount",
|
|
223
224
|
value: function () {
|
|
224
|
-
var _componentDidMount = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
225
|
-
return
|
|
225
|
+
var _componentDidMount = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
226
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
226
227
|
while (1) {
|
|
227
228
|
switch (_context2.prev = _context2.next) {
|
|
228
229
|
case 0:
|
|
@@ -251,8 +252,8 @@ var RecentLink = /*#__PURE__*/function (_React$Component) {
|
|
|
251
252
|
}, {
|
|
252
253
|
key: "loadRecentItems",
|
|
253
254
|
value: function () {
|
|
254
|
-
var _loadRecentItems = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
255
|
-
return
|
|
255
|
+
var _loadRecentItems = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(activityProvider) {
|
|
256
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
256
257
|
while (1) {
|
|
257
258
|
switch (_context3.prev = _context3.next) {
|
|
258
259
|
case 0:
|
|
@@ -18,7 +18,7 @@ var _react2 = require("react");
|
|
|
18
18
|
var _styles = require("./styles");
|
|
19
19
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
20
20
|
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); }; }
|
|
21
|
-
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; } }
|
|
21
|
+
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; } } /** @jsx jsx */
|
|
22
22
|
var KeyZCode = 90;
|
|
23
23
|
var KeyYCode = 89;
|
|
24
24
|
var PanelTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
@@ -19,6 +19,7 @@ var _analytics = require("../../plugins/analytics");
|
|
|
19
19
|
var _utils = require("../../utils");
|
|
20
20
|
var _ErrorBoundary = require("../ErrorBoundary");
|
|
21
21
|
var _templateObject;
|
|
22
|
+
/** @jsx jsx */
|
|
22
23
|
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); }; }
|
|
23
24
|
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; } }
|
|
24
25
|
var pluginsComponentsWrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n"])));
|
|
@@ -15,6 +15,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
15
15
|
var _react2 = require("@emotion/react");
|
|
16
16
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
17
17
|
var _templateObject;
|
|
18
|
+
/** @jsx jsx */
|
|
18
19
|
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); }; }
|
|
19
20
|
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; } }
|
|
20
21
|
var toolbarComponentsWrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n\n @media (max-width: ", "px) {\n justify-content: space-between;\n }\n"])), _editorSharedStyles.akEditorMobileMaxWidth);
|
|
@@ -19,6 +19,7 @@ var _Toolbar = require("./Toolbar");
|
|
|
19
19
|
var _types = require("./types");
|
|
20
20
|
var _isFullPage = require("../../utils/is-full-page");
|
|
21
21
|
var _templateObject;
|
|
22
|
+
/** @jsx jsx */
|
|
22
23
|
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); }
|
|
23
24
|
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; }
|
|
24
25
|
var toolbar = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n position: relative;\n @media (max-width: ", "px) {\n grid-column: 1 / 2;\n grid-row: 2;\n width: calc(100% - 30px);\n margin: 0 15px;\n }\n"])), _editorSharedStyles.akEditorMobileMaxWidth);
|
|
@@ -5,9 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.ToolbarArrowKeyNavigationProvider = exports.KeyDownHandlerContext = void 0;
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
var _styles = require("../styles");
|
|
10
|
+
var _react2 = _interopRequireWildcard(require("react"));
|
|
9
11
|
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); }
|
|
10
12
|
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; }
|
|
13
|
+
/** @jsx jsx */
|
|
11
14
|
/* eslint-disable no-console */
|
|
12
15
|
|
|
13
16
|
/*
|
|
@@ -15,7 +18,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
15
18
|
** Because the keyboard navigation is explicitly managed for main toolbar items
|
|
16
19
|
** Few key presses such as Tab,Arrow Right/Left need ot be handled here via context
|
|
17
20
|
*/
|
|
18
|
-
var KeyDownHandlerContext = /*#__PURE__*/
|
|
21
|
+
var KeyDownHandlerContext = /*#__PURE__*/_react2.default.createContext({
|
|
19
22
|
handleArrowLeft: function handleArrowLeft() {},
|
|
20
23
|
handleArrowRight: function handleArrowRight() {},
|
|
21
24
|
handleTab: function handleTab() {}
|
|
@@ -34,10 +37,12 @@ var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigationProvid
|
|
|
34
37
|
childComponentSelector = _ref.childComponentSelector,
|
|
35
38
|
handleEscape = _ref.handleEscape,
|
|
36
39
|
disableArrowKeyNavigation = _ref.disableArrowKeyNavigation,
|
|
37
|
-
isShortcutToFocusToolbar = _ref.isShortcutToFocusToolbar
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var
|
|
40
|
+
isShortcutToFocusToolbar = _ref.isShortcutToFocusToolbar,
|
|
41
|
+
editorAppearance = _ref.editorAppearance,
|
|
42
|
+
useStickyToolbar = _ref.useStickyToolbar;
|
|
43
|
+
var wrapperRef = (0, _react2.useRef)(null);
|
|
44
|
+
var selectedItemIndex = (0, _react2.useRef)(0);
|
|
45
|
+
var incrementIndex = (0, _react2.useCallback)(function (list) {
|
|
41
46
|
var index = 0;
|
|
42
47
|
if (document.activeElement) {
|
|
43
48
|
index = list.indexOf(document.activeElement);
|
|
@@ -45,7 +50,7 @@ var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigationProvid
|
|
|
45
50
|
}
|
|
46
51
|
selectedItemIndex.current = index;
|
|
47
52
|
}, []);
|
|
48
|
-
var decrementIndex = (0,
|
|
53
|
+
var decrementIndex = (0, _react2.useCallback)(function (list) {
|
|
49
54
|
var index = 0;
|
|
50
55
|
if (document.activeElement) {
|
|
51
56
|
index = list.indexOf(document.activeElement);
|
|
@@ -71,11 +76,14 @@ var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigationProvid
|
|
|
71
76
|
(_filteredFocusableEle3 = filteredFocusableElements[selectedItemIndex.current]) === null || _filteredFocusableEle3 === void 0 ? void 0 : _filteredFocusableEle3.focus();
|
|
72
77
|
};
|
|
73
78
|
var focusAndScrollToElement = function focusAndScrollToElement(element) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
var scrollToElement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
80
|
+
if (scrollToElement) {
|
|
81
|
+
element === null || element === void 0 ? void 0 : element.scrollIntoView({
|
|
82
|
+
behavior: 'smooth',
|
|
83
|
+
block: 'center',
|
|
84
|
+
inline: 'nearest'
|
|
85
|
+
});
|
|
86
|
+
}
|
|
79
87
|
element.focus();
|
|
80
88
|
};
|
|
81
89
|
var submenuKeydownHandleContext = {
|
|
@@ -83,7 +91,7 @@ var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigationProvid
|
|
|
83
91
|
handleArrowRight: handleArrowRight,
|
|
84
92
|
handleTab: handleTab
|
|
85
93
|
};
|
|
86
|
-
(0,
|
|
94
|
+
(0, _react2.useLayoutEffect)(function () {
|
|
87
95
|
if (!wrapperRef.current || disableArrowKeyNavigation) {
|
|
88
96
|
return;
|
|
89
97
|
}
|
|
@@ -124,15 +132,18 @@ var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigationProvid
|
|
|
124
132
|
} else {
|
|
125
133
|
selectedItemIndex.current = filteredFocusableElements.indexOf(targetElement) > -1 ? filteredFocusableElements.indexOf(targetElement) : selectedItemIndex.current;
|
|
126
134
|
}
|
|
135
|
+
|
|
136
|
+
//do not scroll to focused element for sticky toolbar when navigating with arrows to avoid unnesessary scroll jump
|
|
137
|
+
var allowScrollToElement = !(editorAppearance === 'comment' && !!useStickyToolbar);
|
|
127
138
|
switch (event.key) {
|
|
128
139
|
case 'ArrowRight':
|
|
129
140
|
incrementIndex(filteredFocusableElements);
|
|
130
|
-
focusAndScrollToElement(filteredFocusableElements[selectedItemIndex.current]);
|
|
141
|
+
focusAndScrollToElement(filteredFocusableElements[selectedItemIndex.current], allowScrollToElement);
|
|
131
142
|
event.preventDefault();
|
|
132
143
|
break;
|
|
133
144
|
case 'ArrowLeft':
|
|
134
145
|
decrementIndex(filteredFocusableElements);
|
|
135
|
-
focusAndScrollToElement(filteredFocusableElements[selectedItemIndex.current]);
|
|
146
|
+
focusAndScrollToElement(filteredFocusableElements[selectedItemIndex.current], allowScrollToElement);
|
|
136
147
|
event.preventDefault();
|
|
137
148
|
break;
|
|
138
149
|
case 'Escape':
|
|
@@ -155,20 +166,22 @@ var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigationProvid
|
|
|
155
166
|
}
|
|
156
167
|
};
|
|
157
168
|
element === null || element === void 0 ? void 0 : element.addEventListener('keydown', handleKeyDown);
|
|
169
|
+
var editorViewDom = editorView === null || editorView === void 0 ? void 0 : editorView.dom;
|
|
158
170
|
if (isShortcutToFocusToolbar) {
|
|
159
|
-
|
|
171
|
+
editorViewDom === null || editorViewDom === void 0 ? void 0 : editorViewDom.addEventListener('keydown', globalKeyDownHandler);
|
|
160
172
|
}
|
|
161
173
|
return function () {
|
|
162
174
|
element === null || element === void 0 ? void 0 : element.removeEventListener('keydown', handleKeyDown);
|
|
163
175
|
if (isShortcutToFocusToolbar) {
|
|
164
|
-
|
|
176
|
+
editorViewDom === null || editorViewDom === void 0 ? void 0 : editorViewDom.removeEventListener('keydown', globalKeyDownHandler);
|
|
165
177
|
}
|
|
166
178
|
};
|
|
167
|
-
}, [selectedItemIndex, wrapperRef, editorView, disableArrowKeyNavigation, handleEscape, childComponentSelector, incrementIndex, decrementIndex, isShortcutToFocusToolbar]);
|
|
168
|
-
return
|
|
179
|
+
}, [selectedItemIndex, wrapperRef, editorView, disableArrowKeyNavigation, handleEscape, childComponentSelector, incrementIndex, decrementIndex, isShortcutToFocusToolbar, editorAppearance, useStickyToolbar]);
|
|
180
|
+
return (0, _react.jsx)("div", {
|
|
181
|
+
css: editorAppearance === 'comment' && _styles.centeredToolbarContainer,
|
|
169
182
|
className: "custom-key-handler-wrapper",
|
|
170
183
|
ref: wrapperRef
|
|
171
|
-
},
|
|
184
|
+
}, (0, _react.jsx)(KeyDownHandlerContext.Provider, {
|
|
172
185
|
value: submenuKeydownHandleContext
|
|
173
186
|
}, children));
|
|
174
187
|
};
|