@atlaskit/editor-common 72.1.2 → 72.2.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 +21 -0
- package/dist/cjs/__tests_external__/cases/fundamentals/collection.js +0 -5
- package/dist/cjs/__tests_external__/cases/fundamentals/test-cases/editor-is-present.js +0 -4
- package/dist/cjs/__tests_external__/cases/fundamentals/test-cases/editor-typing.js +0 -8
- package/dist/cjs/__tests_external__/cases/smart-links/index.js +0 -4
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/block/delete.js +1 -8
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/block/edit.js +2 -12
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/block/index.js +0 -6
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/block/insert.js +1 -8
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/embed/delete.js +1 -8
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/embed/edit.js +2 -12
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/embed/index.js +0 -6
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/embed/insert.js +1 -8
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/delete.js +1 -8
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/edit.js +2 -12
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/index.js +0 -7
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/insert.js +1 -8
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/unlink.js +1 -8
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/url/index.js +0 -4
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/url/insert.js +1 -8
- package/dist/cjs/__tests_external__/index.js +0 -3
- package/dist/cjs/__tests_external__/page-objects/Editor.js +0 -16
- package/dist/cjs/__tests_external__/page-objects/EditorSmartLink.js +0 -29
- package/dist/cjs/__tests_external__/page-objects/Renderer.js +0 -14
- package/dist/cjs/analytics/index.js +0 -1
- package/dist/cjs/analytics/types/enums.js +1 -16
- package/dist/cjs/analytics/types/extension-events.js +0 -4
- package/dist/cjs/analytics/types/format-events.js +0 -3
- package/dist/cjs/analytics/types/general-events.js +0 -7
- package/dist/cjs/analytics/types/index.js +0 -14
- package/dist/cjs/analytics/types/inline-comment-events.js +0 -1
- package/dist/cjs/analytics/types/insert-events.js +0 -7
- package/dist/cjs/analytics/types/list-events.js +0 -3
- package/dist/cjs/analytics/types/node-events.js +0 -3
- package/dist/cjs/analytics/types/substitute-events.js +0 -3
- package/dist/cjs/analytics/types/table-events.js +0 -4
- package/dist/cjs/analytics/types/toolbar-button.js +0 -1
- package/dist/cjs/analytics/types/utils.js +0 -3
- package/dist/cjs/core-utils/index.js +0 -1
- package/dist/cjs/core-utils/inside.js +2 -5
- package/dist/cjs/emoji.js +0 -3
- package/dist/cjs/event-dispatcher/index.js +0 -14
- package/dist/cjs/extensions/combine-extension-providers.js +2 -6
- package/dist/cjs/extensions/default-extension-provider.js +0 -26
- package/dist/cjs/extensions/extension-fields-helpers.js +0 -35
- package/dist/cjs/extensions/extension-handlers.js +0 -27
- package/dist/cjs/extensions/index.js +0 -8
- package/dist/cjs/extensions/manifest-helpers.js +4 -30
- package/dist/cjs/extensions/module-helpers.js +17 -89
- package/dist/cjs/extensions/types/field-definitions.js +1 -10
- package/dist/cjs/extensions/types/index.js +0 -1
- package/dist/cjs/extensions.js +0 -1
- package/dist/cjs/i18n/cs.js +0 -1
- package/dist/cjs/i18n/da.js +0 -1
- package/dist/cjs/i18n/de.js +0 -1
- package/dist/cjs/i18n/en.js +0 -1
- package/dist/cjs/i18n/en_GB.js +0 -1
- package/dist/cjs/i18n/en_ZZ.js +0 -1
- package/dist/cjs/i18n/es.js +0 -1
- package/dist/cjs/i18n/et.js +0 -1
- package/dist/cjs/i18n/fi.js +0 -1
- package/dist/cjs/i18n/fr.js +0 -1
- package/dist/cjs/i18n/hu.js +0 -1
- package/dist/cjs/i18n/index.js +0 -27
- package/dist/cjs/i18n/it.js +0 -1
- package/dist/cjs/i18n/ja.js +0 -1
- package/dist/cjs/i18n/ko.js +0 -1
- package/dist/cjs/i18n/languages.js +0 -1
- package/dist/cjs/i18n/nb.js +0 -1
- package/dist/cjs/i18n/nl.js +0 -1
- package/dist/cjs/i18n/pl.js +0 -1
- package/dist/cjs/i18n/pt_BR.js +0 -1
- package/dist/cjs/i18n/pt_PT.js +0 -1
- package/dist/cjs/i18n/ru.js +0 -1
- package/dist/cjs/i18n/sk.js +0 -1
- package/dist/cjs/i18n/sv.js +0 -1
- package/dist/cjs/i18n/th.js +0 -1
- package/dist/cjs/i18n/tr.js +0 -1
- package/dist/cjs/i18n/uk.js +0 -1
- package/dist/cjs/i18n/vi.js +0 -1
- package/dist/cjs/i18n/zh.js +0 -1
- package/dist/cjs/i18n/zh_TW.js +0 -1
- package/dist/cjs/icons/index.js +0 -11
- package/dist/cjs/icons/shared/PanelErrorIcon.js +0 -7
- package/dist/cjs/icons/shared/PanelInfoIcon.js +0 -7
- package/dist/cjs/icons/shared/PanelNoteIcon.js +0 -7
- package/dist/cjs/icons/shared/PanelSuccessIcon.js +0 -7
- package/dist/cjs/icons/shared/PanelWarningIcon.js +0 -7
- package/dist/cjs/icons/shared/table.js +1 -3
- package/dist/cjs/in-product.js +0 -1
- package/dist/cjs/keymaps/index.js +2 -50
- package/dist/cjs/mention.js +0 -3
- package/dist/cjs/messages/codeBidiWarning.js +0 -2
- package/dist/cjs/messages/codeBlockCopyButton.js +0 -2
- package/dist/cjs/messages/index.js +0 -8
- package/dist/cjs/messages/insert-block.js +0 -2
- package/dist/cjs/messages/link.js +0 -2
- package/dist/cjs/messages/unsupportedContent.js +0 -2
- package/dist/cjs/node-width/index.js +2 -20
- package/dist/cjs/normalize-feature-flags.js +6 -25
- package/dist/cjs/panel.js +0 -1
- package/dist/cjs/provider-factory/context.js +3 -17
- package/dist/cjs/provider-factory/provider-factory.js +0 -19
- package/dist/cjs/provider-factory/with-providers.js +5 -28
- package/dist/cjs/provider-factory.js +0 -4
- package/dist/cjs/provider-helpers/combine-providers.js +3 -33
- package/dist/cjs/provider-helpers/index.js +0 -2
- package/dist/cjs/provider-helpers/promise-helpers.js +3 -15
- package/dist/cjs/react-node-view/index.js +18 -48
- package/dist/cjs/safe-plugin/index.js +1 -14
- package/dist/cjs/selection/gap-cursor/selection.js +8 -44
- package/dist/cjs/selection/gap-cursor/utils/index.js +0 -2
- package/dist/cjs/selection/gap-cursor/utils/is-ignored.js +0 -2
- package/dist/cjs/selection/gap-cursor/utils/is-valid-target-node.js +0 -3
- package/dist/cjs/selection/index.js +0 -4
- package/dist/cjs/selection/types.js +0 -1
- package/dist/cjs/selection/utils.js +0 -12
- package/dist/cjs/styles/index.js +0 -23
- package/dist/cjs/styles/shared/annotation.js +0 -11
- package/dist/cjs/styles/shared/block-marks.js +0 -5
- package/dist/cjs/styles/shared/blockquote.js +0 -7
- package/dist/cjs/styles/shared/code-block.js +0 -11
- package/dist/cjs/styles/shared/code-mark.js +0 -9
- package/dist/cjs/styles/shared/column-layout.js +0 -6
- package/dist/cjs/styles/shared/date.js +0 -5
- package/dist/cjs/styles/shared/emoji.js +0 -2
- package/dist/cjs/styles/shared/extension.js +0 -2
- package/dist/cjs/styles/shared/headings.js +0 -7
- package/dist/cjs/styles/shared/indentation.js +0 -5
- package/dist/cjs/styles/shared/layout.js +0 -2
- package/dist/cjs/styles/shared/link.js +0 -5
- package/dist/cjs/styles/shared/lists.js +2 -21
- package/dist/cjs/styles/shared/media-single.js +0 -5
- package/dist/cjs/styles/shared/panel.js +15 -41
- package/dist/cjs/styles/shared/paragraph.js +0 -6
- package/dist/cjs/styles/shared/rule.js +2 -10
- package/dist/cjs/styles/shared/shadow.js +1 -9
- package/dist/cjs/styles/shared/smart-card.js +0 -3
- package/dist/cjs/styles/shared/table.js +0 -20
- package/dist/cjs/styles/shared/task-decision.js +0 -6
- package/dist/cjs/styles/shared/text-color.js +0 -5
- package/dist/cjs/styles/shared/whitespace.js +0 -5
- package/dist/cjs/transforms/expand.js +7 -16
- package/dist/cjs/transforms/extension.js +2 -7
- package/dist/cjs/transforms/index.js +0 -3
- package/dist/cjs/transforms/layout.js +9 -15
- package/dist/cjs/type-ahead/index.js +0 -3
- package/dist/cjs/types/annotation/emitter.js +0 -11
- package/dist/cjs/types/annotation/index.js +0 -1
- package/dist/cjs/types/index.js +0 -4
- package/dist/cjs/types/toolbar.js +0 -5
- package/dist/cjs/ufo/experience-store.js +0 -24
- package/dist/cjs/ufo/index.js +0 -1
- package/dist/cjs/ui/BaseTheme/index.js +3 -21
- package/dist/cjs/ui/Caption/index.js +5 -29
- package/dist/cjs/ui/Caption/messages.js +0 -2
- package/dist/cjs/ui/DropList/index.js +18 -51
- package/dist/cjs/ui/Emoji/index.js +7 -33
- package/dist/cjs/ui/ErrorBoundary/index.js +0 -22
- package/dist/cjs/ui/Expand/index.js +5 -31
- package/dist/cjs/ui/IntlErrorBoundary/index.js +0 -24
- package/dist/cjs/ui/IntlProviderIfMissingWrapper/index.js +0 -9
- package/dist/cjs/ui/Layer/index.js +16 -46
- package/dist/cjs/ui/Layer/internal/helpers.js +0 -2
- package/dist/cjs/ui/MediaSingle/grid.js +0 -8
- package/dist/cjs/ui/MediaSingle/index.js +26 -44
- package/dist/cjs/ui/MediaSingle/link.js +0 -5
- package/dist/cjs/ui/MediaSingle/styled.js +11 -50
- package/dist/cjs/ui/Mention/index.js +5 -27
- package/dist/cjs/ui/Mention/mention-with-profilecard.js +8 -16
- package/dist/cjs/ui/Mention/mention-with-providers.js +5 -33
- package/dist/cjs/ui/Messages/index.js +0 -18
- package/dist/cjs/ui/OverflowShadow/index.js +3 -48
- package/dist/cjs/ui/OverflowShadow/shadowObserver.js +2 -26
- package/dist/cjs/ui/Popup/index.js +28 -80
- package/dist/cjs/ui/Popup/utils.js +67 -132
- package/dist/cjs/ui/PortalProvider/PortalProviderThemesProvider.js +3 -13
- package/dist/cjs/ui/PortalProvider/index.js +16 -73
- package/dist/cjs/ui/UnsupportedBlock/index.js +5 -29
- package/dist/cjs/ui/UnsupportedInline/index.js +5 -29
- package/dist/cjs/ui/WidthProvider/index.js +1 -31
- package/dist/cjs/ui/WithCreateAnalyticsEvent/index.js +2 -16
- package/dist/cjs/ui/clear-next-sibling-margin-top.js +0 -5
- package/dist/cjs/ui/index.js +0 -23
- package/dist/cjs/ui/unsupported-content-helper.js +0 -5
- package/dist/cjs/ui/with-outer-listeners.js +0 -25
- package/dist/cjs/ui-color/ColorPalette/Color/index.js +12 -40
- package/dist/cjs/ui-color/ColorPalette/Color/styles.js +0 -10
- package/dist/cjs/ui-color/ColorPalette/Palettes/cellBackgroundColorPalette.js +0 -7
- package/dist/cjs/ui-color/ColorPalette/Palettes/common.js +4 -12
- package/dist/cjs/ui-color/ColorPalette/Palettes/getColorMessage.js +0 -3
- package/dist/cjs/ui-color/ColorPalette/Palettes/index.js +0 -1
- package/dist/cjs/ui-color/ColorPalette/Palettes/paletteMessages.js +0 -3
- package/dist/cjs/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +0 -8
- package/dist/cjs/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +0 -10
- package/dist/cjs/ui-color/ColorPalette/Palettes/statusColorPalette.js +0 -7
- package/dist/cjs/ui-color/ColorPalette/Palettes/textColorPalette.js +2 -9
- package/dist/cjs/ui-color/ColorPalette/index.js +16 -38
- package/dist/cjs/ui-color/ColorPalette/styles.js +0 -6
- package/dist/cjs/ui-color/index.js +0 -9
- package/dist/cjs/ui-menu/Dropdown/index.js +15 -39
- package/dist/cjs/ui-menu/DropdownMenu/index.js +43 -79
- package/dist/cjs/ui-menu/MenuArrowKeyNavigationProvider/index.js +66 -82
- package/dist/cjs/ui-menu/ToolbarButton/index.js +23 -46
- package/dist/cjs/ui-menu/ToolbarButton/styles.js +0 -6
- package/dist/cjs/ui-menu/index.js +0 -7
- package/dist/cjs/ui-react/ReactEditorViewContext.js +0 -4
- package/dist/cjs/ui-react/index.js +0 -3
- package/dist/cjs/ui-react/with-react-editor-view-outer-listeners.js +12 -52
- package/dist/cjs/utils/analytics.js +0 -14
- package/dist/cjs/utils/annotation/index.js +5 -13
- package/dist/cjs/utils/breakout.js +7 -23
- package/dist/cjs/utils/browser-extensions.js +28 -56
- package/dist/cjs/utils/browser.js +0 -2
- package/dist/cjs/utils/builder.js +0 -10
- package/dist/cjs/utils/collab.js +0 -4
- package/dist/cjs/utils/compare-props.js +11 -25
- package/dist/cjs/utils/compareNodes.js +7 -53
- package/dist/cjs/utils/compose.js +0 -2
- package/dist/cjs/utils/date.js +4 -25
- package/dist/cjs/utils/dom.js +6 -29
- package/dist/cjs/utils/editor-core-utils.js +8 -33
- package/dist/cjs/utils/error-reporter.js +0 -7
- package/dist/cjs/utils/extension-handler.js +0 -3
- package/dist/cjs/utils/get-performance-options.js +4 -12
- package/dist/cjs/utils/getModeFromTheme.js +0 -1
- package/dist/cjs/utils/imageLoader.js +0 -27
- package/dist/cjs/utils/index.js +0 -40
- package/dist/cjs/utils/is-text-input.js +5 -11
- package/dist/cjs/utils/list.js +3 -13
- package/dist/cjs/utils/macro.js +1 -7
- package/dist/cjs/utils/nodes.js +4 -31
- package/dist/cjs/utils/outdated-browsers.js +0 -10
- package/dist/cjs/utils/performance/hooks/use-component-render-tracking/index.js +4 -14
- package/dist/cjs/utils/performance/is-performance-api-available.js +0 -4
- package/dist/cjs/utils/performance/measure-render.js +1 -11
- package/dist/cjs/utils/performance/measure-tti.js +3 -17
- package/dist/cjs/utils/performance/measure.js +0 -11
- package/dist/cjs/utils/performance/navigation.js +0 -5
- package/dist/cjs/utils/plugin-state-factory.js +3 -11
- package/dist/cjs/utils/profiler/render-count.js +4 -24
- package/dist/cjs/utils/referentiality.js +30 -88
- package/dist/cjs/utils/sendLogs.js +0 -2
- package/dist/cjs/utils/should-force-tracking.js +4 -7
- package/dist/cjs/utils/slice.js +0 -17
- package/dist/cjs/utils/table.js +4 -13
- package/dist/cjs/utils/track-unsupported-content.js +14 -39
- package/dist/cjs/utils/traversor.js +0 -14
- package/dist/cjs/utils/unsupportedContent/get-unsupported-content-level-data.js +5 -21
- package/dist/cjs/utils/validate-using-spec.js +5 -36
- package/dist/cjs/utils/validator.js +26 -188
- package/dist/cjs/validator.js +0 -1
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/with-plugin-state/index.js +7 -55
- package/dist/es2019/__tests_external__/cases/fundamentals/test-cases/editor-typing.js +0 -3
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/block/delete.js +0 -1
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/block/edit.js +0 -2
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/block/insert.js +0 -1
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/embed/delete.js +0 -1
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/embed/edit.js +0 -2
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/embed/insert.js +0 -1
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/inline/delete.js +0 -1
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/inline/edit.js +0 -2
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/inline/insert.js +0 -1
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/inline/unlink.js +0 -1
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/url/insert.js +0 -1
- package/dist/es2019/__tests_external__/page-objects/Editor.js +0 -4
- package/dist/es2019/__tests_external__/page-objects/EditorSmartLink.js +0 -28
- package/dist/es2019/__tests_external__/page-objects/Renderer.js +0 -2
- package/dist/es2019/analytics/types/enums.js +1 -16
- package/dist/es2019/analytics/types/extension-events.js +2 -3
- package/dist/es2019/analytics/types/format-events.js +0 -3
- package/dist/es2019/analytics/types/general-events.js +0 -7
- package/dist/es2019/analytics/types/inline-comment-events.js +0 -1
- package/dist/es2019/analytics/types/insert-events.js +0 -7
- package/dist/es2019/analytics/types/list-events.js +0 -3
- package/dist/es2019/analytics/types/node-events.js +0 -3
- package/dist/es2019/analytics/types/substitute-events.js +0 -3
- package/dist/es2019/analytics/types/table-events.js +2 -3
- package/dist/es2019/analytics/types/toolbar-button.js +0 -1
- package/dist/es2019/analytics/types/utils.js +0 -3
- package/dist/es2019/event-dispatcher/index.js +1 -12
- package/dist/es2019/extensions/combine-extension-providers.js +0 -5
- package/dist/es2019/extensions/default-extension-provider.js +0 -8
- package/dist/es2019/extensions/extension-fields-helpers.js +4 -10
- package/dist/es2019/extensions/extension-handlers.js +1 -8
- package/dist/es2019/extensions/manifest-helpers.js +2 -7
- package/dist/es2019/extensions/module-helpers.js +10 -43
- package/dist/es2019/extensions/types/field-definitions.js +1 -0
- package/dist/es2019/icons/index.js +1 -3
- package/dist/es2019/icons/shared/PanelErrorIcon.js +0 -2
- package/dist/es2019/icons/shared/PanelInfoIcon.js +0 -2
- package/dist/es2019/icons/shared/PanelNoteIcon.js +0 -2
- package/dist/es2019/icons/shared/PanelSuccessIcon.js +0 -2
- package/dist/es2019/icons/shared/PanelWarningIcon.js +0 -2
- package/dist/es2019/keymaps/index.js +0 -24
- package/dist/es2019/node-width/index.js +3 -14
- package/dist/es2019/normalize-feature-flags.js +1 -11
- package/dist/es2019/provider-factory/context.js +0 -1
- package/dist/es2019/provider-factory/provider-factory.js +0 -25
- package/dist/es2019/provider-factory/with-providers.js +2 -8
- package/dist/es2019/provider-helpers/combine-providers.js +3 -13
- package/dist/es2019/provider-helpers/promise-helpers.js +3 -10
- package/dist/es2019/react-node-view/index.js +10 -34
- package/dist/es2019/safe-plugin/index.js +1 -1
- package/dist/es2019/selection/gap-cursor/selection.js +6 -31
- package/dist/es2019/selection/types.js +0 -1
- package/dist/es2019/selection/utils.js +0 -8
- package/dist/es2019/styles/shared/headings.js +3 -2
- package/dist/es2019/styles/shared/lists.js +0 -8
- package/dist/es2019/styles/shared/panel.js +13 -12
- package/dist/es2019/styles/shared/paragraph.js +2 -1
- package/dist/es2019/styles/shared/rule.js +2 -1
- package/dist/es2019/styles/shared/shadow.js +2 -0
- package/dist/es2019/styles/shared/table.js +1 -5
- package/dist/es2019/transforms/expand.js +3 -3
- package/dist/es2019/transforms/extension.js +3 -4
- package/dist/es2019/transforms/layout.js +9 -10
- package/dist/es2019/type-ahead/index.js +0 -3
- package/dist/es2019/types/annotation/emitter.js +0 -8
- package/dist/es2019/types/index.js +0 -2
- package/dist/es2019/types/toolbar.js +0 -5
- package/dist/es2019/ufo/experience-store.js +0 -25
- package/dist/es2019/ui/BaseTheme/index.js +0 -2
- package/dist/es2019/ui/Caption/index.js +0 -2
- package/dist/es2019/ui/DropList/index.js +9 -25
- package/dist/es2019/ui/Emoji/index.js +0 -11
- package/dist/es2019/ui/ErrorBoundary/index.js +0 -8
- package/dist/es2019/ui/Expand/index.js +2 -10
- package/dist/es2019/ui/IntlErrorBoundary/index.js +0 -8
- package/dist/es2019/ui/IntlProviderIfMissingWrapper/index.js +0 -4
- package/dist/es2019/ui/Layer/index.js +13 -29
- package/dist/es2019/ui/Layer/internal/helpers.js +0 -2
- package/dist/es2019/ui/MediaSingle/index.js +7 -12
- package/dist/es2019/ui/MediaSingle/styled.js +2 -25
- package/dist/es2019/ui/Mention/index.js +0 -5
- package/dist/es2019/ui/Mention/mention-with-providers.js +0 -8
- package/dist/es2019/ui/Messages/index.js +1 -2
- package/dist/es2019/ui/OverflowShadow/index.js +0 -32
- package/dist/es2019/ui/OverflowShadow/shadowObserver.js +0 -14
- package/dist/es2019/ui/Popup/index.js +11 -59
- package/dist/es2019/ui/Popup/utils.js +18 -57
- package/dist/es2019/ui/PortalProvider/PortalProviderThemesProvider.js +2 -1
- package/dist/es2019/ui/PortalProvider/index.js +7 -35
- package/dist/es2019/ui/UnsupportedBlock/index.js +0 -2
- package/dist/es2019/ui/UnsupportedInline/index.js +0 -2
- package/dist/es2019/ui/WidthProvider/index.js +0 -9
- package/dist/es2019/ui/WithCreateAnalyticsEvent/index.js +0 -1
- package/dist/es2019/ui/clear-next-sibling-margin-top.js +2 -1
- package/dist/es2019/ui/unsupported-content-helper.js +0 -4
- package/dist/es2019/ui/with-outer-listeners.js +0 -8
- package/dist/es2019/ui-color/ColorPalette/Color/index.js +0 -10
- package/dist/es2019/ui-color/ColorPalette/Color/styles.js +1 -4
- package/dist/es2019/ui-color/ColorPalette/Palettes/common.js +2 -4
- package/dist/es2019/ui-color/ColorPalette/Palettes/getColorMessage.js +0 -2
- package/dist/es2019/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +5 -3
- package/dist/es2019/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +4 -4
- package/dist/es2019/ui-color/ColorPalette/Palettes/statusColorPalette.js +0 -2
- package/dist/es2019/ui-color/ColorPalette/Palettes/textColorPalette.js +2 -3
- package/dist/es2019/ui-color/ColorPalette/index.js +3 -10
- package/dist/es2019/ui-menu/Dropdown/index.js +1 -8
- package/dist/es2019/ui-menu/DropdownMenu/index.js +23 -27
- package/dist/es2019/ui-menu/MenuArrowKeyNavigationProvider/index.js +59 -73
- package/dist/es2019/ui-menu/ToolbarButton/index.js +2 -6
- package/dist/es2019/ui-react/with-react-editor-view-outer-listeners.js +7 -25
- package/dist/es2019/utils/analytics.js +0 -8
- package/dist/es2019/utils/annotation/index.js +3 -7
- package/dist/es2019/utils/breakout.js +6 -13
- package/dist/es2019/utils/browser-extensions.js +10 -22
- package/dist/es2019/utils/browser.js +0 -2
- package/dist/es2019/utils/builder.js +0 -2
- package/dist/es2019/utils/collab.js +0 -2
- package/dist/es2019/utils/compare-props.js +5 -4
- package/dist/es2019/utils/compareNodes.js +3 -42
- package/dist/es2019/utils/date.js +4 -11
- package/dist/es2019/utils/dom.js +6 -19
- package/dist/es2019/utils/editor-core-utils.js +6 -11
- package/dist/es2019/utils/error-reporter.js +0 -4
- package/dist/es2019/utils/get-performance-options.js +3 -3
- package/dist/es2019/utils/imageLoader.js +0 -11
- package/dist/es2019/utils/is-text-input.js +1 -2
- package/dist/es2019/utils/list.js +3 -7
- package/dist/es2019/utils/macro.js +0 -3
- package/dist/es2019/utils/nodes.js +3 -11
- package/dist/es2019/utils/outdated-browsers.js +0 -8
- package/dist/es2019/utils/performance/hooks/use-component-render-tracking/index.js +0 -4
- package/dist/es2019/utils/performance/is-performance-api-available.js +0 -1
- package/dist/es2019/utils/performance/measure-render.js +2 -10
- package/dist/es2019/utils/performance/measure-tti.js +3 -11
- package/dist/es2019/utils/performance/measure.js +0 -6
- package/dist/es2019/utils/performance/navigation.js +0 -3
- package/dist/es2019/utils/plugin-state-factory.js +1 -10
- package/dist/es2019/utils/profiler/render-count.js +10 -23
- package/dist/es2019/utils/referentiality.js +24 -65
- package/dist/es2019/utils/should-force-tracking.js +2 -1
- package/dist/es2019/utils/slice.js +1 -9
- package/dist/es2019/utils/table.js +2 -6
- package/dist/es2019/utils/track-unsupported-content.js +6 -11
- package/dist/es2019/utils/traversor.js +0 -13
- package/dist/es2019/utils/unsupportedContent/get-unsupported-content-level-data.js +3 -15
- package/dist/es2019/utils/validate-using-spec.js +3 -25
- package/dist/es2019/utils/validator.js +10 -149
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/with-plugin-state/index.js +5 -46
- package/dist/esm/__tests_external__/cases/fundamentals/test-cases/editor-typing.js +0 -3
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/block/delete.js +1 -2
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/block/edit.js +2 -4
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/block/insert.js +1 -2
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/embed/delete.js +1 -2
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/embed/edit.js +2 -4
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/embed/insert.js +1 -2
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/inline/delete.js +1 -2
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/inline/edit.js +2 -4
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/inline/insert.js +1 -2
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/inline/unlink.js +1 -2
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/url/insert.js +1 -2
- package/dist/esm/__tests_external__/page-objects/Editor.js +0 -9
- package/dist/esm/__tests_external__/page-objects/EditorSmartLink.js +0 -23
- package/dist/esm/__tests_external__/page-objects/Renderer.js +0 -8
- package/dist/esm/analytics/types/enums.js +1 -16
- package/dist/esm/analytics/types/extension-events.js +2 -3
- package/dist/esm/analytics/types/format-events.js +0 -3
- package/dist/esm/analytics/types/general-events.js +0 -7
- package/dist/esm/analytics/types/inline-comment-events.js +0 -1
- package/dist/esm/analytics/types/insert-events.js +0 -7
- package/dist/esm/analytics/types/list-events.js +0 -3
- package/dist/esm/analytics/types/node-events.js +0 -3
- package/dist/esm/analytics/types/substitute-events.js +0 -3
- package/dist/esm/analytics/types/table-events.js +2 -3
- package/dist/esm/analytics/types/toolbar-button.js +0 -1
- package/dist/esm/analytics/types/utils.js +0 -3
- package/dist/esm/core-utils/inside.js +2 -2
- package/dist/esm/event-dispatcher/index.js +1 -9
- package/dist/esm/extensions/combine-extension-providers.js +2 -4
- package/dist/esm/extensions/default-extension-provider.js +0 -22
- package/dist/esm/extensions/extension-fields-helpers.js +3 -29
- package/dist/esm/extensions/extension-handlers.js +1 -18
- package/dist/esm/extensions/manifest-helpers.js +4 -17
- package/dist/esm/extensions/module-helpers.js +17 -74
- package/dist/esm/extensions/types/field-definitions.js +1 -0
- package/dist/esm/icons/index.js +1 -3
- package/dist/esm/icons/shared/PanelErrorIcon.js +0 -2
- package/dist/esm/icons/shared/PanelInfoIcon.js +0 -2
- package/dist/esm/icons/shared/PanelNoteIcon.js +0 -2
- package/dist/esm/icons/shared/PanelSuccessIcon.js +0 -2
- package/dist/esm/icons/shared/PanelWarningIcon.js +0 -2
- package/dist/esm/keymaps/index.js +2 -28
- package/dist/esm/node-width/index.js +3 -14
- package/dist/esm/normalize-feature-flags.js +6 -19
- package/dist/esm/provider-factory/context.js +3 -5
- package/dist/esm/provider-factory/provider-factory.js +0 -18
- package/dist/esm/provider-factory/with-providers.js +5 -23
- package/dist/esm/provider-helpers/combine-providers.js +3 -27
- package/dist/esm/provider-helpers/promise-helpers.js +3 -10
- package/dist/esm/react-node-view/index.js +18 -42
- package/dist/esm/safe-plugin/index.js +1 -7
- package/dist/esm/selection/gap-cursor/selection.js +8 -35
- package/dist/esm/selection/types.js +0 -1
- package/dist/esm/selection/utils.js +0 -8
- package/dist/esm/styles/shared/annotation.js +0 -2
- package/dist/esm/styles/shared/block-marks.js +0 -2
- package/dist/esm/styles/shared/blockquote.js +0 -2
- package/dist/esm/styles/shared/code-block.js +0 -2
- package/dist/esm/styles/shared/code-mark.js +0 -2
- package/dist/esm/styles/shared/column-layout.js +0 -2
- package/dist/esm/styles/shared/date.js +0 -2
- package/dist/esm/styles/shared/headings.js +3 -4
- package/dist/esm/styles/shared/indentation.js +0 -2
- package/dist/esm/styles/shared/link.js +0 -2
- package/dist/esm/styles/shared/lists.js +2 -13
- package/dist/esm/styles/shared/media-single.js +0 -2
- package/dist/esm/styles/shared/panel.js +15 -17
- package/dist/esm/styles/shared/paragraph.js +2 -3
- package/dist/esm/styles/shared/rule.js +2 -3
- package/dist/esm/styles/shared/shadow.js +2 -2
- package/dist/esm/styles/shared/table.js +1 -8
- package/dist/esm/styles/shared/task-decision.js +0 -2
- package/dist/esm/styles/shared/text-color.js +0 -2
- package/dist/esm/styles/shared/whitespace.js +0 -2
- package/dist/esm/transforms/expand.js +7 -7
- package/dist/esm/transforms/extension.js +3 -4
- package/dist/esm/transforms/layout.js +9 -10
- package/dist/esm/type-ahead/index.js +0 -3
- package/dist/esm/types/annotation/emitter.js +0 -6
- package/dist/esm/types/index.js +0 -2
- package/dist/esm/types/toolbar.js +0 -5
- package/dist/esm/ufo/experience-store.js +0 -19
- package/dist/esm/ui/BaseTheme/index.js +3 -7
- package/dist/esm/ui/Caption/index.js +5 -14
- package/dist/esm/ui/DropList/index.js +18 -47
- package/dist/esm/ui/Emoji/index.js +7 -26
- package/dist/esm/ui/ErrorBoundary/index.js +0 -14
- package/dist/esm/ui/Expand/index.js +5 -15
- package/dist/esm/ui/IntlErrorBoundary/index.js +0 -16
- package/dist/esm/ui/IntlProviderIfMissingWrapper/index.js +0 -4
- package/dist/esm/ui/Layer/index.js +16 -39
- package/dist/esm/ui/Layer/internal/helpers.js +0 -2
- package/dist/esm/ui/MediaSingle/index.js +25 -32
- package/dist/esm/ui/MediaSingle/link.js +0 -2
- package/dist/esm/ui/MediaSingle/styled.js +11 -39
- package/dist/esm/ui/Mention/index.js +5 -18
- package/dist/esm/ui/Mention/mention-with-profilecard.js +8 -8
- package/dist/esm/ui/Mention/mention-with-providers.js +5 -21
- package/dist/esm/ui/Messages/index.js +1 -4
- package/dist/esm/ui/OverflowShadow/index.js +3 -46
- package/dist/esm/ui/OverflowShadow/shadowObserver.js +2 -27
- package/dist/esm/ui/Popup/index.js +28 -80
- package/dist/esm/ui/Popup/utils.js +67 -123
- package/dist/esm/ui/PortalProvider/PortalProviderThemesProvider.js +3 -3
- package/dist/esm/ui/PortalProvider/index.js +17 -61
- package/dist/esm/ui/UnsupportedBlock/index.js +5 -11
- package/dist/esm/ui/UnsupportedInline/index.js +5 -11
- package/dist/esm/ui/WidthProvider/index.js +1 -17
- package/dist/esm/ui/WithCreateAnalyticsEvent/index.js +2 -10
- package/dist/esm/ui/clear-next-sibling-margin-top.js +2 -3
- package/dist/esm/ui/unsupported-content-helper.js +0 -4
- package/dist/esm/ui/with-outer-listeners.js +0 -15
- package/dist/esm/ui-color/ColorPalette/Color/index.js +12 -27
- package/dist/esm/ui-color/ColorPalette/Color/styles.js +1 -6
- package/dist/esm/ui-color/ColorPalette/Palettes/common.js +5 -7
- package/dist/esm/ui-color/ColorPalette/Palettes/getColorMessage.js +0 -2
- package/dist/esm/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +2 -4
- package/dist/esm/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +0 -5
- package/dist/esm/ui-color/ColorPalette/Palettes/statusColorPalette.js +0 -2
- package/dist/esm/ui-color/ColorPalette/Palettes/textColorPalette.js +2 -3
- package/dist/esm/ui-color/ColorPalette/index.js +16 -24
- package/dist/esm/ui-color/ColorPalette/styles.js +0 -2
- package/dist/esm/ui-menu/Dropdown/index.js +15 -28
- package/dist/esm/ui-menu/DropdownMenu/index.js +43 -60
- package/dist/esm/ui-menu/MenuArrowKeyNavigationProvider/index.js +66 -78
- package/dist/esm/ui-menu/ToolbarButton/index.js +23 -32
- package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +12 -41
- package/dist/esm/utils/analytics.js +0 -8
- package/dist/esm/utils/annotation/index.js +5 -9
- package/dist/esm/utils/breakout.js +8 -15
- package/dist/esm/utils/browser-extensions.js +28 -55
- package/dist/esm/utils/browser.js +0 -2
- package/dist/esm/utils/builder.js +0 -4
- package/dist/esm/utils/collab.js +0 -2
- package/dist/esm/utils/compare-props.js +10 -15
- package/dist/esm/utils/compareNodes.js +7 -48
- package/dist/esm/utils/compose.js +0 -1
- package/dist/esm/utils/date.js +4 -11
- package/dist/esm/utils/dom.js +6 -19
- package/dist/esm/utils/editor-core-utils.js +8 -13
- package/dist/esm/utils/error-reporter.js +0 -5
- package/dist/esm/utils/get-performance-options.js +7 -7
- package/dist/esm/utils/imageLoader.js +0 -18
- package/dist/esm/utils/is-text-input.js +5 -6
- package/dist/esm/utils/list.js +3 -7
- package/dist/esm/utils/macro.js +1 -5
- package/dist/esm/utils/nodes.js +5 -13
- package/dist/esm/utils/outdated-browsers.js +0 -8
- package/dist/esm/utils/performance/hooks/use-component-render-tracking/index.js +4 -10
- package/dist/esm/utils/performance/is-performance-api-available.js +0 -1
- package/dist/esm/utils/performance/measure-render.js +2 -9
- package/dist/esm/utils/performance/measure-tti.js +3 -12
- package/dist/esm/utils/performance/measure.js +0 -6
- package/dist/esm/utils/performance/navigation.js +0 -3
- package/dist/esm/utils/plugin-state-factory.js +3 -10
- package/dist/esm/utils/profiler/render-count.js +4 -21
- package/dist/esm/utils/referentiality.js +30 -80
- package/dist/esm/utils/should-force-tracking.js +4 -4
- package/dist/esm/utils/slice.js +1 -10
- package/dist/esm/utils/table.js +4 -8
- package/dist/esm/utils/track-unsupported-content.js +14 -31
- package/dist/esm/utils/traversor.js +0 -13
- package/dist/esm/utils/unsupportedContent/get-unsupported-content-level-data.js +5 -18
- package/dist/esm/utils/validate-using-spec.js +5 -29
- package/dist/esm/utils/validator.js +26 -170
- package/dist/esm/version.json +1 -1
- package/dist/esm/with-plugin-state/index.js +7 -55
- package/dist/types/analytics/types/enums.d.ts +1 -1
- package/dist/types/analytics/types/events.d.ts +3 -2
- package/dist/types/analytics/types/general-events.d.ts +8 -3
- package/dist/types/types/editor-plugin.d.ts +24 -2
- package/dist/types/types/floating-toolbar.d.ts +10 -0
- package/dist/types/types/type-ahead.d.ts +8 -0
- package/dist/types/ui-menu/DropdownMenu/index.d.ts +1 -1
- package/dist/types/ui-menu/DropdownMenu/types.d.ts +1 -0
- package/dist/types/ui-menu/MenuArrowKeyNavigationProvider/index.d.ts +3 -2
- package/dist/types/ui-react/with-react-editor-view-outer-listeners.d.ts +1 -1
- package/package.json +8 -8
|
@@ -5,17 +5,13 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
9
|
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; } }
|
|
12
|
-
|
|
13
10
|
import React, { PureComponent } from 'react';
|
|
14
11
|
import { withReactEditorViewOuterListeners } from '../../ui-react';
|
|
15
12
|
import DropdownList from '../../ui/DropList';
|
|
16
13
|
import Popup from '../../ui/Popup';
|
|
17
14
|
import { MenuArrowKeyNavigationProvider } from '../MenuArrowKeyNavigationProvider';
|
|
18
|
-
|
|
19
15
|
/**
|
|
20
16
|
* Wrapper around @atlaskit/droplist which uses Popup and Portal to render
|
|
21
17
|
* droplist outside of "overflow: hidden" containers when needed.
|
|
@@ -24,51 +20,43 @@ import { MenuArrowKeyNavigationProvider } from '../MenuArrowKeyNavigationProvide
|
|
|
24
20
|
*/
|
|
25
21
|
export var Dropdown = /*#__PURE__*/function (_PureComponent) {
|
|
26
22
|
_inherits(Dropdown, _PureComponent);
|
|
27
|
-
|
|
28
23
|
var _super = _createSuper(Dropdown);
|
|
29
|
-
|
|
30
24
|
function Dropdown(props) {
|
|
31
25
|
var _this;
|
|
32
|
-
|
|
33
26
|
_classCallCheck(this, Dropdown);
|
|
34
|
-
|
|
35
27
|
_this = _super.call(this, props);
|
|
36
|
-
|
|
37
28
|
_defineProperty(_assertThisInitialized(_this), "handleRef", function (target) {
|
|
38
29
|
_this.setState({
|
|
39
30
|
target: target || undefined
|
|
40
31
|
});
|
|
41
32
|
});
|
|
42
|
-
|
|
43
33
|
_defineProperty(_assertThisInitialized(_this), "updatePopupPlacement", function (placement) {
|
|
44
34
|
_this.setState({
|
|
45
35
|
popupPlacement: placement
|
|
46
36
|
});
|
|
47
37
|
});
|
|
48
|
-
|
|
49
38
|
_this.state = {
|
|
50
39
|
popupPlacement: ['bottom', 'left']
|
|
51
40
|
};
|
|
52
41
|
return _this;
|
|
53
42
|
}
|
|
54
|
-
|
|
55
43
|
_createClass(Dropdown, [{
|
|
56
44
|
key: "renderDropdown",
|
|
57
45
|
value: function renderDropdown() {
|
|
58
46
|
var _this$state = this.state,
|
|
59
|
-
|
|
60
|
-
|
|
47
|
+
target = _this$state.target,
|
|
48
|
+
popupPlacement = _this$state.popupPlacement;
|
|
61
49
|
var _this$props = this.props,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
50
|
+
children = _this$props.children,
|
|
51
|
+
mountTo = _this$props.mountTo,
|
|
52
|
+
boundariesElement = _this$props.boundariesElement,
|
|
53
|
+
scrollableElement = _this$props.scrollableElement,
|
|
54
|
+
onOpenChange = _this$props.onOpenChange,
|
|
55
|
+
fitHeight = _this$props.fitHeight,
|
|
56
|
+
fitWidth = _this$props.fitWidth,
|
|
57
|
+
zIndex = _this$props.zIndex,
|
|
58
|
+
disableArrowKeyNavigation = _this$props.disableArrowKeyNavigation,
|
|
59
|
+
keyDownHandlerContext = _this$props.keyDownHandlerContext;
|
|
72
60
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
73
61
|
target: target,
|
|
74
62
|
mountTo: mountTo,
|
|
@@ -81,7 +69,7 @@ export var Dropdown = /*#__PURE__*/function (_PureComponent) {
|
|
|
81
69
|
}, /*#__PURE__*/React.createElement(MenuArrowKeyNavigationProvider, {
|
|
82
70
|
disableArrowKeyNavigation: disableArrowKeyNavigation,
|
|
83
71
|
keyDownHandlerContext: keyDownHandlerContext,
|
|
84
|
-
|
|
72
|
+
closeOnTab: true,
|
|
85
73
|
handleClose: function handleClose(event) {
|
|
86
74
|
return onOpenChange && onOpenChange({
|
|
87
75
|
isOpen: false,
|
|
@@ -104,14 +92,13 @@ export var Dropdown = /*#__PURE__*/function (_PureComponent) {
|
|
|
104
92
|
key: "render",
|
|
105
93
|
value: function render() {
|
|
106
94
|
var _this$props2 = this.props,
|
|
107
|
-
|
|
108
|
-
|
|
95
|
+
trigger = _this$props2.trigger,
|
|
96
|
+
isOpen = _this$props2.isOpen;
|
|
109
97
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
110
98
|
ref: this.handleRef
|
|
111
99
|
}, trigger), isOpen ? this.renderDropdown() : null);
|
|
112
100
|
}
|
|
113
101
|
}]);
|
|
114
|
-
|
|
115
102
|
return Dropdown;
|
|
116
103
|
}(PureComponent);
|
|
117
104
|
var DropdownWithOuterListeners = withReactEditorViewOuterListeners(Dropdown);
|
|
@@ -9,13 +9,9 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
9
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
10
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
11
11
|
var _excluded = ["children"];
|
|
12
|
-
|
|
13
12
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
14
|
-
|
|
15
13
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
16
|
-
|
|
17
14
|
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
|
-
|
|
19
15
|
/** @jsx jsx */
|
|
20
16
|
import React, { PureComponent } from 'react';
|
|
21
17
|
import { css, jsx } from '@emotion/react';
|
|
@@ -30,7 +26,6 @@ import Popup from '../../ui/Popup';
|
|
|
30
26
|
import { MenuArrowKeyNavigationProvider } from '../MenuArrowKeyNavigationProvider';
|
|
31
27
|
var wrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* tooltip in ToolbarButton is display:block */\n & > div > div {\n display: flex;\n }\n"])));
|
|
32
28
|
var focusedMenuItemStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n box-shadow: inset 0px 0px 0px 2px ", ";\n outline: none;\n"])), "var(--ds-border-focused, ".concat(B100, ")"));
|
|
33
|
-
|
|
34
29
|
var buttonStyles = function buttonStyles(isActive) {
|
|
35
30
|
return function (theme) {
|
|
36
31
|
if (isActive) {
|
|
@@ -57,57 +52,45 @@ var buttonStyles = function buttonStyles(isActive) {
|
|
|
57
52
|
};
|
|
58
53
|
|
|
59
54
|
var DropListWithOutsideListeners = withReactEditorViewOuterListeners(DropList);
|
|
55
|
+
|
|
60
56
|
/**
|
|
61
57
|
* Wrapper around @atlaskit/droplist which uses Popup and Portal to render
|
|
62
58
|
* dropdown-menu outside of "overflow: hidden" containers when needed.
|
|
63
59
|
*
|
|
64
60
|
* Also it controls popper's placement.
|
|
65
61
|
*/
|
|
66
|
-
|
|
67
62
|
var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
68
63
|
_inherits(DropdownMenuWrapper, _PureComponent);
|
|
69
|
-
|
|
70
64
|
var _super = _createSuper(DropdownMenuWrapper);
|
|
71
|
-
|
|
72
65
|
function DropdownMenuWrapper() {
|
|
73
66
|
var _this;
|
|
74
|
-
|
|
75
67
|
_classCallCheck(this, DropdownMenuWrapper);
|
|
76
|
-
|
|
77
68
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
78
69
|
args[_key] = arguments[_key];
|
|
79
70
|
}
|
|
80
|
-
|
|
81
71
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
82
|
-
|
|
83
72
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
84
|
-
popupPlacement: ['bottom', 'left']
|
|
73
|
+
popupPlacement: ['bottom', 'left'],
|
|
74
|
+
selectionIndex: -1
|
|
85
75
|
});
|
|
86
|
-
|
|
87
76
|
_defineProperty(_assertThisInitialized(_this), "handleRef", function (target) {
|
|
88
77
|
_this.setState({
|
|
89
78
|
target: target || undefined
|
|
90
79
|
});
|
|
91
80
|
});
|
|
92
|
-
|
|
93
81
|
_defineProperty(_assertThisInitialized(_this), "updatePopupPlacement", function (placement) {
|
|
94
82
|
var previousPlacement = _this.state.popupPlacement;
|
|
95
|
-
|
|
96
83
|
if (placement[0] !== previousPlacement[0] || placement[1] !== previousPlacement[1]) {
|
|
97
84
|
_this.setState({
|
|
98
85
|
popupPlacement: placement
|
|
99
86
|
});
|
|
100
87
|
}
|
|
101
88
|
});
|
|
102
|
-
|
|
103
|
-
_defineProperty(_assertThisInitialized(_this), "handleCloseandFocus", function () {
|
|
89
|
+
_defineProperty(_assertThisInitialized(_this), "handleCloseAndFocus", function () {
|
|
104
90
|
var _this$state$target, _this$state$target$qu;
|
|
105
|
-
|
|
106
91
|
_this.handleClose();
|
|
107
|
-
|
|
108
92
|
(_this$state$target = _this.state.target) === null || _this$state$target === void 0 ? void 0 : (_this$state$target$qu = _this$state$target.querySelector('button')) === null || _this$state$target$qu === void 0 ? void 0 : _this$state$target$qu.focus();
|
|
109
93
|
});
|
|
110
|
-
|
|
111
94
|
_defineProperty(_assertThisInitialized(_this), "handleClose", function () {
|
|
112
95
|
if (_this.props.onOpenChange) {
|
|
113
96
|
_this.props.onOpenChange({
|
|
@@ -115,31 +98,29 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
115
98
|
});
|
|
116
99
|
}
|
|
117
100
|
});
|
|
118
|
-
|
|
119
101
|
return _this;
|
|
120
102
|
}
|
|
121
|
-
|
|
122
103
|
_createClass(DropdownMenuWrapper, [{
|
|
123
104
|
key: "renderDropdownMenu",
|
|
124
105
|
value: function renderDropdownMenu() {
|
|
125
106
|
var _this2 = this;
|
|
126
|
-
|
|
127
107
|
var _this$state = this.state,
|
|
128
|
-
|
|
129
|
-
|
|
108
|
+
target = _this$state.target,
|
|
109
|
+
popupPlacement = _this$state.popupPlacement;
|
|
130
110
|
var _this$props = this.props,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
111
|
+
items = _this$props.items,
|
|
112
|
+
mountTo = _this$props.mountTo,
|
|
113
|
+
boundariesElement = _this$props.boundariesElement,
|
|
114
|
+
scrollableElement = _this$props.scrollableElement,
|
|
115
|
+
offset = _this$props.offset,
|
|
116
|
+
fitHeight = _this$props.fitHeight,
|
|
117
|
+
fitWidth = _this$props.fitWidth,
|
|
118
|
+
isOpen = _this$props.isOpen,
|
|
119
|
+
zIndex = _this$props.zIndex,
|
|
120
|
+
shouldUseDefaultRole = _this$props.shouldUseDefaultRole,
|
|
121
|
+
disableArrowKeyNavigation = _this$props.disableArrowKeyNavigation,
|
|
122
|
+
keyDownHandlerContext = _this$props.keyDownHandlerContext,
|
|
123
|
+
onItemActivated = _this$props.onItemActivated;
|
|
143
124
|
return jsx(Popup, {
|
|
144
125
|
target: isOpen ? target : undefined,
|
|
145
126
|
mountTo: mountTo,
|
|
@@ -152,9 +133,21 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
152
133
|
offset: offset
|
|
153
134
|
}, jsx(MenuArrowKeyNavigationProvider, {
|
|
154
135
|
disableArrowKeyNavigation: disableArrowKeyNavigation,
|
|
155
|
-
handleClose: this.
|
|
136
|
+
handleClose: this.handleCloseAndFocus,
|
|
156
137
|
keyDownHandlerContext: keyDownHandlerContext,
|
|
157
|
-
|
|
138
|
+
onSelection: function onSelection(index) {
|
|
139
|
+
var result = [];
|
|
140
|
+
if (typeof onItemActivated === 'function') {
|
|
141
|
+
result = items.reduce(function (result, group) {
|
|
142
|
+
return result.concat(group.items);
|
|
143
|
+
}, result);
|
|
144
|
+
onItemActivated({
|
|
145
|
+
item: result[index],
|
|
146
|
+
shouldCloseMenu: false
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
closeOnTab: true
|
|
158
151
|
}, jsx(DropListWithOutsideListeners, {
|
|
159
152
|
isOpen: true,
|
|
160
153
|
appearance: "tall",
|
|
@@ -163,7 +156,7 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
163
156
|
shouldFitContainer: true,
|
|
164
157
|
isTriggerNotTabbable: true,
|
|
165
158
|
handleClickOutside: this.handleClose,
|
|
166
|
-
handleEscapeKeydown: this.
|
|
159
|
+
handleEscapeKeydown: this.handleCloseAndFocus,
|
|
167
160
|
targetRef: this.state.target
|
|
168
161
|
}, jsx("div", {
|
|
169
162
|
style: {
|
|
@@ -176,7 +169,6 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
176
169
|
role: shouldUseDefaultRole ? 'group' : 'menu'
|
|
177
170
|
}, group.items.map(function (item) {
|
|
178
171
|
var _item$key;
|
|
179
|
-
|
|
180
172
|
return jsx(DropdownMenuItem, {
|
|
181
173
|
key: (_item$key = item.key) !== null && _item$key !== void 0 ? _item$key : String(item.content),
|
|
182
174
|
item: item,
|
|
@@ -192,8 +184,8 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
192
184
|
key: "render",
|
|
193
185
|
value: function render() {
|
|
194
186
|
var _this$props2 = this.props,
|
|
195
|
-
|
|
196
|
-
|
|
187
|
+
children = _this$props2.children,
|
|
188
|
+
isOpen = _this$props2.isOpen;
|
|
197
189
|
return jsx("div", {
|
|
198
190
|
css: wrapper
|
|
199
191
|
}, jsx("div", {
|
|
@@ -201,29 +193,23 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
201
193
|
}, children), isOpen ? this.renderDropdownMenu() : null);
|
|
202
194
|
}
|
|
203
195
|
}]);
|
|
204
|
-
|
|
205
196
|
return DropdownMenuWrapper;
|
|
206
197
|
}(PureComponent);
|
|
207
|
-
|
|
208
198
|
export { DropdownMenuWrapper as default };
|
|
209
199
|
var DropdownMenuItemCustomComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
210
200
|
var children = props.children,
|
|
211
|
-
|
|
212
|
-
|
|
201
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
213
202
|
return jsx("span", _extends({
|
|
214
203
|
ref: ref
|
|
215
204
|
}, rest), children);
|
|
216
205
|
});
|
|
217
|
-
|
|
218
206
|
function DropdownMenuItem(_ref) {
|
|
219
207
|
var _item$key2;
|
|
220
|
-
|
|
221
208
|
var item = _ref.item,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
209
|
+
onItemActivated = _ref.onItemActivated,
|
|
210
|
+
shouldUseDefaultRole = _ref.shouldUseDefaultRole,
|
|
211
|
+
_onMouseEnter = _ref.onMouseEnter,
|
|
212
|
+
_onMouseLeave = _ref.onMouseLeave;
|
|
227
213
|
// onClick and value.name are the action indicators in the handlers
|
|
228
214
|
// If neither are present, don't wrap in an Item.
|
|
229
215
|
if (!item.onClick && !(item.value && item.value.name)) {
|
|
@@ -231,14 +217,14 @@ function DropdownMenuItem(_ref) {
|
|
|
231
217
|
key: String(item.content)
|
|
232
218
|
}, item.content);
|
|
233
219
|
}
|
|
234
|
-
|
|
235
220
|
var dropListItem = jsx("div", {
|
|
236
221
|
css: function css(theme) {
|
|
237
222
|
return buttonStyles(item.isActive)({
|
|
238
223
|
theme: theme
|
|
239
224
|
});
|
|
240
225
|
},
|
|
241
|
-
tabIndex: -1
|
|
226
|
+
tabIndex: -1,
|
|
227
|
+
"aria-disabled": item.isDisabled ? 'true' : 'false'
|
|
242
228
|
}, jsx(CustomItem, {
|
|
243
229
|
item: item,
|
|
244
230
|
key: (_item$key2 = item.key) !== null && _item$key2 !== void 0 ? _item$key2 : String(item.content),
|
|
@@ -270,16 +256,13 @@ function DropdownMenuItem(_ref) {
|
|
|
270
256
|
});
|
|
271
257
|
}
|
|
272
258
|
}, item.content));
|
|
273
|
-
|
|
274
259
|
if (item.tooltipDescription) {
|
|
275
260
|
var _item$key3;
|
|
276
|
-
|
|
277
261
|
return jsx(Tooltip, {
|
|
278
262
|
key: (_item$key3 = item.key) !== null && _item$key3 !== void 0 ? _item$key3 : String(item.content),
|
|
279
263
|
content: item.tooltipDescription,
|
|
280
264
|
position: item.tooltipPosition
|
|
281
265
|
}, dropListItem);
|
|
282
266
|
}
|
|
283
|
-
|
|
284
267
|
return dropListItem;
|
|
285
268
|
}
|
|
@@ -1,147 +1,135 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React, { useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* This component is a wrapper of vertical menus which listens to keydown events of children
|
|
5
5
|
* and handles up/down arrow key navigation
|
|
6
6
|
*/
|
|
7
7
|
export var MenuArrowKeyNavigationProvider = function MenuArrowKeyNavigationProvider(_ref) {
|
|
8
8
|
var children = _ref.children,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
handleClose = _ref.handleClose,
|
|
10
|
+
disableArrowKeyNavigation = _ref.disableArrowKeyNavigation,
|
|
11
|
+
keyDownHandlerContext = _ref.keyDownHandlerContext,
|
|
12
|
+
closeOnTab = _ref.closeOnTab,
|
|
13
|
+
onSelection = _ref.onSelection;
|
|
13
14
|
var wrapperRef = useRef(null);
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
var _useState = useState(-1),
|
|
16
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
17
|
+
currentSelectedItemIndex = _useState2[0],
|
|
18
|
+
setCurrentSelectedItemIndex = _useState2[1];
|
|
19
|
+
var incrementIndex = useCallback(function (list) {
|
|
20
|
+
var currentIndex = currentSelectedItemIndex;
|
|
21
|
+
var nextIndex = (currentIndex + 1) % list.length;
|
|
22
|
+
// Skips disabled items. Previously this function relied on a list of enabled elements which caused a
|
|
23
|
+
// difference between currentIndex and the item index in the menu.
|
|
24
|
+
while (nextIndex !== currentIndex && list[nextIndex].getAttribute('aria-disabled') === 'true') {
|
|
25
|
+
nextIndex = (nextIndex + 1) % list.length;
|
|
21
26
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
setCurrentSelectedItemIndex(nextIndex);
|
|
28
|
+
return nextIndex;
|
|
29
|
+
}, [currentSelectedItemIndex]);
|
|
30
|
+
var decrementIndex = useCallback(function (list) {
|
|
31
|
+
var currentIndex = currentSelectedItemIndex;
|
|
32
|
+
var nextIndex = (list.length + currentIndex - 1) % list.length;
|
|
33
|
+
while (nextIndex !== currentIndex && list[nextIndex].getAttribute('aria-disabled') === 'true') {
|
|
34
|
+
nextIndex = (list.length + nextIndex - 1) % list.length;
|
|
29
35
|
}
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
setCurrentSelectedItemIndex(nextIndex);
|
|
37
|
+
return nextIndex;
|
|
38
|
+
}, [currentSelectedItemIndex]);
|
|
32
39
|
useLayoutEffect(function () {
|
|
33
40
|
if (disableArrowKeyNavigation) {
|
|
34
41
|
return;
|
|
35
42
|
}
|
|
43
|
+
|
|
36
44
|
/**
|
|
37
45
|
* To handle the key events on the list
|
|
38
46
|
* @param event
|
|
39
47
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
48
|
var handleKeyDown = function handleKeyDown(event) {
|
|
43
|
-
var _wrapperRef$current
|
|
49
|
+
var _wrapperRef$current;
|
|
50
|
+
var targetElement = event.target;
|
|
44
51
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (event.key === 'Tab' && closeonTab) {
|
|
52
|
+
//Tab key on menu items can be handled in the parent components of dropdown menus with KeydownHandlerContext
|
|
53
|
+
if (event.key === 'Tab' && closeOnTab) {
|
|
48
54
|
handleClose(event);
|
|
49
55
|
keyDownHandlerContext === null || keyDownHandlerContext === void 0 ? void 0 : keyDownHandlerContext.handleTab();
|
|
50
56
|
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
var focusableElements = getEnabledElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
57
|
+
}
|
|
55
58
|
|
|
59
|
+
//To trap the focus inside the toolbar using left and right arrow keys
|
|
60
|
+
var focusableElements = getFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
56
61
|
if (!focusableElements || (focusableElements === null || focusableElements === void 0 ? void 0 : focusableElements.length) === 0) {
|
|
57
62
|
return;
|
|
58
63
|
}
|
|
59
|
-
|
|
60
64
|
if (!((_wrapperRef$current = wrapperRef.current) !== null && _wrapperRef$current !== void 0 && _wrapperRef$current.contains(targetElement))) {
|
|
61
|
-
|
|
65
|
+
setCurrentSelectedItemIndex(-1);
|
|
62
66
|
}
|
|
63
|
-
|
|
64
67
|
switch (event.key) {
|
|
65
68
|
case 'ArrowDown':
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
event.preventDefault();
|
|
74
|
-
break;
|
|
75
|
-
|
|
69
|
+
{
|
|
70
|
+
var _focusableElements$fo;
|
|
71
|
+
var focusIndex = incrementIndex(focusableElements);
|
|
72
|
+
(_focusableElements$fo = focusableElements[focusIndex]) === null || _focusableElements$fo === void 0 ? void 0 : _focusableElements$fo.focus();
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
76
|
case 'ArrowUp':
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
break;
|
|
77
|
+
{
|
|
78
|
+
var _focusableElements$_f;
|
|
79
|
+
var _focusIndex = decrementIndex(focusableElements);
|
|
80
|
+
(_focusableElements$_f = focusableElements[_focusIndex]) === null || _focusableElements$_f === void 0 ? void 0 : _focusableElements$_f.focus();
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
|
|
86
85
|
//ArrowLeft/Right on the menu should close the menus
|
|
87
86
|
//then logic to retain the focus can be handled in the parent components with KeydownHandlerContext
|
|
88
|
-
|
|
89
87
|
case 'ArrowLeft':
|
|
90
88
|
//Filter out the events from outside the menu
|
|
91
89
|
if (!targetElement.closest('.custom-key-handler-wrapper')) {
|
|
92
90
|
return;
|
|
93
91
|
}
|
|
94
|
-
|
|
92
|
+
if (!targetElement.closest('[data-testid="editor-floating-toolbar"]')) {
|
|
93
|
+
keyDownHandlerContext === null || keyDownHandlerContext === void 0 ? void 0 : keyDownHandlerContext.handleArrowLeft();
|
|
94
|
+
}
|
|
95
95
|
handleClose(event);
|
|
96
|
-
keyDownHandlerContext === null || keyDownHandlerContext === void 0 ? void 0 : keyDownHandlerContext.handleArrowLeft();
|
|
97
96
|
break;
|
|
98
|
-
|
|
99
97
|
case 'ArrowRight':
|
|
100
98
|
//Filter out the events from outside the menu
|
|
101
99
|
if (!targetElement.closest('.custom-key-handler-wrapper')) {
|
|
102
100
|
return;
|
|
103
101
|
}
|
|
104
|
-
|
|
102
|
+
if (!targetElement.closest('[data-testid="editor-floating-toolbar"]')) {
|
|
103
|
+
keyDownHandlerContext === null || keyDownHandlerContext === void 0 ? void 0 : keyDownHandlerContext.handleArrowRight();
|
|
104
|
+
}
|
|
105
105
|
handleClose(event);
|
|
106
|
-
keyDownHandlerContext === null || keyDownHandlerContext === void 0 ? void 0 : keyDownHandlerContext.handleArrowRight();
|
|
107
106
|
break;
|
|
108
|
-
|
|
109
107
|
case 'Escape':
|
|
110
108
|
handleClose(event);
|
|
111
109
|
break;
|
|
112
|
-
|
|
110
|
+
case 'Enter':
|
|
111
|
+
if (typeof onSelection === 'function') {
|
|
112
|
+
onSelection(currentSelectedItemIndex);
|
|
113
|
+
}
|
|
114
|
+
break;
|
|
113
115
|
default:
|
|
114
116
|
return;
|
|
115
117
|
}
|
|
116
118
|
};
|
|
117
|
-
|
|
118
119
|
document.addEventListener('keydown', handleKeyDown);
|
|
119
120
|
return function () {
|
|
120
121
|
document.removeEventListener('keydown', handleKeyDown);
|
|
121
122
|
};
|
|
122
|
-
}, [currentSelectedItemIndex, wrapperRef, handleClose, disableArrowKeyNavigation, keyDownHandlerContext,
|
|
123
|
+
}, [currentSelectedItemIndex, wrapperRef, handleClose, disableArrowKeyNavigation, keyDownHandlerContext, closeOnTab, onSelection, incrementIndex, decrementIndex]);
|
|
123
124
|
return /*#__PURE__*/React.createElement("div", {
|
|
124
|
-
className: "custom-key-handler-wrapper",
|
|
125
|
+
className: "menu-key-handler-wrapper custom-key-handler-wrapper",
|
|
125
126
|
ref: wrapperRef
|
|
126
127
|
}, children);
|
|
127
128
|
};
|
|
128
|
-
|
|
129
129
|
function getFocusableElements(rootNode) {
|
|
130
130
|
if (!rootNode) {
|
|
131
131
|
return [];
|
|
132
132
|
}
|
|
133
|
-
|
|
134
133
|
var focusableModalElements = rootNode.querySelectorAll('a[href], button:not([disabled]), textarea, input, select, div[tabindex="-1"]') || [];
|
|
135
134
|
return Array.from(focusableModalElements);
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* This method filters out all the disabled menu items
|
|
139
|
-
*/
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
function getEnabledElements(rootNode) {
|
|
143
|
-
var focusableElements = getFocusableElements(rootNode);
|
|
144
|
-
return focusableElements.filter(function (element) {
|
|
145
|
-
return !element.querySelector('[role="button"][aria-disabled="true"]') && !element.querySelector('[role="menuitem"][aria-disabled="true"]');
|
|
146
|
-
});
|
|
147
135
|
}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
-
|
|
4
3
|
var _templateObject;
|
|
5
|
-
|
|
6
4
|
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; }
|
|
7
|
-
|
|
8
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9
|
-
|
|
10
6
|
/** @jsx jsx */
|
|
11
7
|
import React, { useCallback } from 'react';
|
|
12
8
|
import { css, jsx } from '@emotion/react';
|
|
@@ -18,34 +14,33 @@ export var TOOLBAR_BUTTON = TOOLBAR_ACTION_SUBJECT_ID;
|
|
|
18
14
|
var buttonWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n height: 100%;\n"])));
|
|
19
15
|
var ToolbarButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
20
16
|
var buttonId = props.buttonId,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
17
|
+
testId = props.testId,
|
|
18
|
+
_props$className = props.className,
|
|
19
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
20
|
+
href = props.href,
|
|
21
|
+
iconAfter = props.iconAfter,
|
|
22
|
+
iconBefore = props.iconBefore,
|
|
23
|
+
disabled = props.disabled,
|
|
24
|
+
selected = props.selected,
|
|
25
|
+
spacing = props.spacing,
|
|
26
|
+
target = props.target,
|
|
27
|
+
children = props.children,
|
|
28
|
+
hideTooltip = props.hideTooltip,
|
|
29
|
+
title = props.title,
|
|
30
|
+
_props$titlePosition = props.titlePosition,
|
|
31
|
+
titlePosition = _props$titlePosition === void 0 ? 'top' : _props$titlePosition,
|
|
32
|
+
item = props.item,
|
|
33
|
+
ariaLabel = props['aria-label'],
|
|
34
|
+
ariaHasPopup = props['aria-haspopup'],
|
|
35
|
+
ariaExpanded = props['aria-expanded'],
|
|
36
|
+
ariaPressed = props['aria-pressed'],
|
|
37
|
+
ariaKeyShortcuts = props['aria-keyshortcuts'],
|
|
38
|
+
onClick = props.onClick,
|
|
39
|
+
onItemClick = props.onItemClick;
|
|
44
40
|
var handleClick = useCallback(function (event, analyticsEvent) {
|
|
45
41
|
if (disabled) {
|
|
46
42
|
return;
|
|
47
43
|
}
|
|
48
|
-
|
|
49
44
|
if (buttonId) {
|
|
50
45
|
analyticsEvent.update(function (payload) {
|
|
51
46
|
return _objectSpread(_objectSpread({}, payload), {}, {
|
|
@@ -56,11 +51,9 @@ var ToolbarButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
56
51
|
});
|
|
57
52
|
}).fire(FabricChannel.editor);
|
|
58
53
|
}
|
|
59
|
-
|
|
60
54
|
if (onClick) {
|
|
61
55
|
onClick(event);
|
|
62
56
|
}
|
|
63
|
-
|
|
64
57
|
if (item && onItemClick) {
|
|
65
58
|
onItemClick(item);
|
|
66
59
|
}
|
|
@@ -87,11 +80,9 @@ var ToolbarButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
87
80
|
"aria-pressed": ariaPressed,
|
|
88
81
|
"aria-keyshortcuts": ariaKeyShortcuts
|
|
89
82
|
}, children);
|
|
90
|
-
|
|
91
83
|
if (!title) {
|
|
92
84
|
return button;
|
|
93
85
|
}
|
|
94
|
-
|
|
95
86
|
var tooltipContent = !hideTooltip ? title : null;
|
|
96
87
|
return jsx(Tooltip, {
|
|
97
88
|
content: tooltipContent,
|