@atlaskit/editor-common 72.2.0 → 72.2.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/__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 +0 -15
- 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 +14 -38
- package/dist/cjs/ui-menu/DropdownMenu/index.js +23 -75
- package/dist/cjs/ui-menu/MenuArrowKeyNavigationProvider/index.js +16 -49
- 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 +9 -49
- 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 +0 -15
- 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 +0 -7
- package/dist/es2019/ui-menu/DropdownMenu/index.js +1 -21
- package/dist/es2019/ui-menu/MenuArrowKeyNavigationProvider/index.js +8 -31
- package/dist/es2019/ui-menu/ToolbarButton/index.js +2 -6
- package/dist/es2019/ui-react/with-react-editor-view-outer-listeners.js +4 -22
- 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 +0 -15
- 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 +14 -27
- package/dist/esm/ui-menu/DropdownMenu/index.js +23 -56
- package/dist/esm/ui-menu/MenuArrowKeyNavigationProvider/index.js +16 -42
- package/dist/esm/ui-menu/ToolbarButton/index.js +23 -32
- package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +9 -38
- 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/package.json +4 -4
|
@@ -6,13 +6,9 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
|
|
10
9
|
var _templateObject, _templateObject2, _templateObject3;
|
|
11
|
-
|
|
12
10
|
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); }; }
|
|
13
|
-
|
|
14
11
|
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; } }
|
|
15
|
-
|
|
16
12
|
/** @jsx jsx */
|
|
17
13
|
import { Component } from 'react';
|
|
18
14
|
import { css, jsx } from '@emotion/react';
|
|
@@ -22,30 +18,21 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
22
18
|
import { borderRadius, gridSize } from '@atlaskit/theme/constants';
|
|
23
19
|
import Layer from '../Layer';
|
|
24
20
|
var packageName = "@atlaskit/editor-common";
|
|
25
|
-
var packageVersion = "72.2.
|
|
21
|
+
var packageVersion = "72.2.2";
|
|
26
22
|
var halfFocusRing = 1;
|
|
27
23
|
var dropOffset = "0, ".concat(gridSize(), "px");
|
|
28
|
-
|
|
29
24
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
30
25
|
_inherits(DropList, _Component);
|
|
31
|
-
|
|
32
26
|
var _super = _createSuper(DropList);
|
|
33
|
-
|
|
34
27
|
function DropList() {
|
|
35
28
|
var _this;
|
|
36
|
-
|
|
37
29
|
_classCallCheck(this, DropList);
|
|
38
|
-
|
|
39
30
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
40
31
|
args[_key] = arguments[_key];
|
|
41
32
|
}
|
|
42
|
-
|
|
43
33
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
44
|
-
|
|
45
34
|
_defineProperty(_assertThisInitialized(_this), "wrapperStyles", css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n transition-duration: 0.2s;\n transition: box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38);\n "])), _this.props.shouldFitContainer ? 'display: block; flex: 1 1 auto;' : 'display: inline-flex;'));
|
|
46
|
-
|
|
47
35
|
_defineProperty(_assertThisInitialized(_this), "triggerStyles", css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n transition-duration: 0.2s;\n transition: box-shadow 0.15s cubic-bezier(0.47, 0.03, 0.49, 1.38);\n ", "\n "])), _this.props.shouldFitContainer ? 'display: block; box-sizing: border-box;' : 'display: inline-flex;'));
|
|
48
|
-
|
|
49
36
|
_defineProperty(_assertThisInitialized(_this), "menuWrapper", function (theme) {
|
|
50
37
|
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n background-color: ", ";\n border-radius: ", "px;\n box-shadow: 0 ", "px ", "px -", "px ", ",\n 0 0 1px ", ";\n box-sizing: border-box;\n overflow: auto;\n padding: ", "px 0;\n max-height: 90vh;\n "])), themed({
|
|
51
38
|
light: "var(--ds-text, ".concat(N900, ")"),
|
|
@@ -55,46 +42,39 @@ var DropList = /*#__PURE__*/function (_Component) {
|
|
|
55
42
|
dark: "var(--ds-surface-overlay, ".concat(DN50, ")")
|
|
56
43
|
})(theme), borderRadius(), gridSize() / 2, gridSize(), gridSize() / 4, N50A, N60A, gridSize() / 2);
|
|
57
44
|
});
|
|
58
|
-
|
|
59
45
|
_defineProperty(_assertThisInitialized(_this), "componentDidMount", function () {
|
|
60
|
-
_this.setContentWidth();
|
|
46
|
+
_this.setContentWidth();
|
|
47
|
+
// We use a captured event here to avoid a radio or checkbox dropdown item firing its
|
|
61
48
|
// click event first, which would cause a re-render of the element and prevent DropList
|
|
62
49
|
// from detecting the actual source of this original click event.
|
|
63
|
-
|
|
64
|
-
|
|
65
50
|
document.addEventListener('click', _this.handleClickOutside, true);
|
|
66
51
|
document.addEventListener('keydown', _this.handleEsc);
|
|
67
52
|
});
|
|
68
|
-
|
|
69
53
|
_defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function () {
|
|
70
54
|
if (_this.props.isOpen) {
|
|
71
55
|
_this.setContentWidth();
|
|
72
56
|
}
|
|
73
57
|
});
|
|
74
|
-
|
|
75
58
|
_defineProperty(_assertThisInitialized(_this), "componentWillUnmount", function () {
|
|
76
59
|
document.removeEventListener('click', _this.handleClickOutside, true);
|
|
77
60
|
document.removeEventListener('keydown', _this.handleEsc);
|
|
78
61
|
});
|
|
79
|
-
|
|
80
62
|
_defineProperty(_assertThisInitialized(_this), "setContentWidth", function () {
|
|
81
63
|
var _assertThisInitialize = _assertThisInitialized(_this),
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
var shouldFitContainer = _this.props.shouldFitContainer; // We need to manually set the content width to match the trigger width
|
|
64
|
+
dropContentRef = _assertThisInitialize.dropContentRef,
|
|
65
|
+
triggerRef = _assertThisInitialize.triggerRef;
|
|
66
|
+
var shouldFitContainer = _this.props.shouldFitContainer;
|
|
86
67
|
|
|
68
|
+
// We need to manually set the content width to match the trigger width
|
|
87
69
|
if (shouldFitContainer && dropContentRef && triggerRef) {
|
|
88
70
|
dropContentRef.style.width = "".concat(triggerRef.offsetWidth - halfFocusRing * 2, "px");
|
|
89
71
|
}
|
|
90
72
|
});
|
|
91
|
-
|
|
92
73
|
_defineProperty(_assertThisInitialized(_this), "handleEsc", function (event) {
|
|
93
74
|
if ((event.key === 'Escape' || event.key === 'Esc') && _this.props.isOpen) {
|
|
94
75
|
_this.close(event);
|
|
95
76
|
}
|
|
96
77
|
});
|
|
97
|
-
|
|
98
78
|
_defineProperty(_assertThisInitialized(_this), "handleClickOutside", function (event) {
|
|
99
79
|
if (_this.props.isOpen) {
|
|
100
80
|
if (event.target instanceof Node) {
|
|
@@ -102,16 +82,13 @@ var DropList = /*#__PURE__*/function (_Component) {
|
|
|
102
82
|
// This aids with future effort in scroll-locking DropList when isMenuFixed is enabled; the scroll
|
|
103
83
|
// blanket which stretches to the viewport should not stop 'close' from being triggered.
|
|
104
84
|
var withinTrigger = _this.triggerRef && _this.triggerRef.contains(event.target);
|
|
105
|
-
|
|
106
85
|
var withinContent = _this.dropContentRef && _this.dropContentRef.contains(event.target);
|
|
107
|
-
|
|
108
86
|
if (!withinTrigger && !withinContent) {
|
|
109
87
|
_this.close(event);
|
|
110
88
|
}
|
|
111
89
|
}
|
|
112
90
|
}
|
|
113
91
|
});
|
|
114
|
-
|
|
115
92
|
_defineProperty(_assertThisInitialized(_this), "close", function (event) {
|
|
116
93
|
if (_this.props.onOpenChange) {
|
|
117
94
|
_this.props.onOpenChange({
|
|
@@ -120,28 +97,25 @@ var DropList = /*#__PURE__*/function (_Component) {
|
|
|
120
97
|
});
|
|
121
98
|
}
|
|
122
99
|
});
|
|
123
|
-
|
|
124
100
|
_defineProperty(_assertThisInitialized(_this), "handleContentRef", function (ref) {
|
|
125
|
-
_this.dropContentRef = ref;
|
|
101
|
+
_this.dropContentRef = ref;
|
|
102
|
+
|
|
103
|
+
// If the dropdown has just been opened, we focus on the containing element so the
|
|
126
104
|
// user can tab to the first dropdown item. We will only receive this ref if isOpen
|
|
127
105
|
// is true or null, so no need to check for truthiness here.
|
|
128
|
-
|
|
129
106
|
if (ref) {
|
|
130
107
|
ref.focus();
|
|
131
108
|
}
|
|
132
109
|
});
|
|
133
|
-
|
|
134
110
|
_defineProperty(_assertThisInitialized(_this), "handleTriggerRef", function (ref) {
|
|
135
111
|
_this.triggerRef = ref;
|
|
136
112
|
});
|
|
137
|
-
|
|
138
113
|
return _this;
|
|
139
114
|
}
|
|
140
|
-
|
|
141
115
|
_createClass(DropList, [{
|
|
142
116
|
key: "getChildContext",
|
|
143
|
-
value:
|
|
144
|
-
|
|
117
|
+
value: /* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
118
|
+
|
|
145
119
|
function getChildContext() {
|
|
146
120
|
return {
|
|
147
121
|
shouldAllowMultilineItems: false
|
|
@@ -151,14 +125,13 @@ var DropList = /*#__PURE__*/function (_Component) {
|
|
|
151
125
|
key: "render",
|
|
152
126
|
value: function render() {
|
|
153
127
|
var _this2 = this;
|
|
154
|
-
|
|
155
128
|
var _this$props = this.props,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
129
|
+
children = _this$props.children,
|
|
130
|
+
isOpen = _this$props.isOpen,
|
|
131
|
+
position = _this$props.position,
|
|
132
|
+
trigger = _this$props.trigger,
|
|
133
|
+
onPositioned = _this$props.onPositioned,
|
|
134
|
+
testId = _this$props.testId;
|
|
162
135
|
var layerContent = isOpen ? jsx("div", {
|
|
163
136
|
css: function css(theme) {
|
|
164
137
|
return _this2.menuWrapper({
|
|
@@ -182,10 +155,8 @@ var DropList = /*#__PURE__*/function (_Component) {
|
|
|
182
155
|
}, trigger)));
|
|
183
156
|
}
|
|
184
157
|
}]);
|
|
185
|
-
|
|
186
158
|
return DropList;
|
|
187
159
|
}(Component);
|
|
188
|
-
|
|
189
160
|
var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
190
161
|
export default withAnalyticsContext({
|
|
191
162
|
componentName: 'droplist',
|
|
@@ -5,39 +5,28 @@ 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 { ResourcedEmoji } from '@atlaskit/emoji/element';
|
|
15
12
|
import { ProviderFactory, WithProviders } from '../../provider-factory';
|
|
16
|
-
|
|
17
13
|
var EmojiNode = /*#__PURE__*/function (_PureComponent) {
|
|
18
14
|
_inherits(EmojiNode, _PureComponent);
|
|
19
|
-
|
|
20
15
|
var _super = _createSuper(EmojiNode);
|
|
21
|
-
|
|
22
16
|
function EmojiNode(props) {
|
|
23
17
|
var _this;
|
|
24
|
-
|
|
25
18
|
_classCallCheck(this, EmojiNode);
|
|
26
|
-
|
|
27
19
|
_this = _super.call(this, props);
|
|
28
|
-
|
|
29
20
|
_defineProperty(_assertThisInitialized(_this), "renderWithProvider", function (providers) {
|
|
30
21
|
var _resourceConfig$optim;
|
|
31
|
-
|
|
32
22
|
var _this$props = _this.props,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
23
|
+
allowTextFallback = _this$props.allowTextFallback,
|
|
24
|
+
shortName = _this$props.shortName,
|
|
25
|
+
id = _this$props.id,
|
|
26
|
+
fallback = _this$props.fallback,
|
|
27
|
+
fitToHeight = _this$props.fitToHeight,
|
|
28
|
+
showTooltip = _this$props.showTooltip,
|
|
29
|
+
resourceConfig = _this$props.resourceConfig;
|
|
41
30
|
if (allowTextFallback && !providers.emojiProvider) {
|
|
42
31
|
return /*#__PURE__*/React.createElement("span", {
|
|
43
32
|
"data-emoji-id": id,
|
|
@@ -45,11 +34,9 @@ var EmojiNode = /*#__PURE__*/function (_PureComponent) {
|
|
|
45
34
|
"data-emoji-text": fallback || shortName
|
|
46
35
|
}, fallback || shortName);
|
|
47
36
|
}
|
|
48
|
-
|
|
49
37
|
if (!providers.emojiProvider) {
|
|
50
38
|
return null;
|
|
51
39
|
}
|
|
52
|
-
|
|
53
40
|
return /*#__PURE__*/React.createElement(ResourcedEmoji, {
|
|
54
41
|
emojiId: {
|
|
55
42
|
id: id,
|
|
@@ -67,11 +54,9 @@ var EmojiNode = /*#__PURE__*/function (_PureComponent) {
|
|
|
67
54
|
})
|
|
68
55
|
});
|
|
69
56
|
});
|
|
70
|
-
|
|
71
57
|
_this.providerFactory = props.providers || new ProviderFactory();
|
|
72
58
|
return _this;
|
|
73
59
|
}
|
|
74
|
-
|
|
75
60
|
_createClass(EmojiNode, [{
|
|
76
61
|
key: "componentWillUnmount",
|
|
77
62
|
value: function componentWillUnmount() {
|
|
@@ -91,14 +76,10 @@ var EmojiNode = /*#__PURE__*/function (_PureComponent) {
|
|
|
91
76
|
});
|
|
92
77
|
}
|
|
93
78
|
}]);
|
|
94
|
-
|
|
95
79
|
return EmojiNode;
|
|
96
80
|
}(PureComponent);
|
|
97
|
-
|
|
98
81
|
_defineProperty(EmojiNode, "displayName", 'EmojiNode');
|
|
99
|
-
|
|
100
82
|
_defineProperty(EmojiNode, "defaultProps", {
|
|
101
83
|
showTooltip: true
|
|
102
84
|
});
|
|
103
|
-
|
|
104
85
|
export { EmojiNode as default };
|
|
@@ -5,36 +5,25 @@ 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 from 'react';
|
|
14
11
|
import { ACTION, EVENT_TYPE } from '../../analytics';
|
|
15
12
|
export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
16
13
|
_inherits(ErrorBoundary, _React$Component);
|
|
17
|
-
|
|
18
14
|
var _super = _createSuper(ErrorBoundary);
|
|
19
|
-
|
|
20
15
|
function ErrorBoundary() {
|
|
21
16
|
var _this;
|
|
22
|
-
|
|
23
17
|
_classCallCheck(this, ErrorBoundary);
|
|
24
|
-
|
|
25
18
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26
19
|
args[_key] = arguments[_key];
|
|
27
20
|
}
|
|
28
|
-
|
|
29
21
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
30
|
-
|
|
31
22
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
32
23
|
errorCaptured: false
|
|
33
24
|
});
|
|
34
|
-
|
|
35
25
|
return _this;
|
|
36
26
|
}
|
|
37
|
-
|
|
38
27
|
_createClass(ErrorBoundary, [{
|
|
39
28
|
key: "hasFallback",
|
|
40
29
|
value: function hasFallback() {
|
|
@@ -62,7 +51,6 @@ export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
62
51
|
}
|
|
63
52
|
});
|
|
64
53
|
}
|
|
65
|
-
|
|
66
54
|
if (this.hasFallback()) {
|
|
67
55
|
this.setState({
|
|
68
56
|
errorCaptured: true
|
|
@@ -75,10 +63,8 @@ export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
75
63
|
if (this.shouldRecover()) {
|
|
76
64
|
return this.props.fallbackComponent;
|
|
77
65
|
}
|
|
78
|
-
|
|
79
66
|
return this.props.children;
|
|
80
67
|
}
|
|
81
68
|
}]);
|
|
82
|
-
|
|
83
69
|
return ErrorBoundary;
|
|
84
70
|
}(React.Component);
|
|
@@ -2,9 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
4
|
var _excluded = ["children"];
|
|
5
|
-
|
|
6
5
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
7
|
-
|
|
8
6
|
/** @jsx jsx */
|
|
9
7
|
import React, { forwardRef } from 'react';
|
|
10
8
|
import { css, jsx } from '@emotion/react';
|
|
@@ -49,41 +47,37 @@ var EXPAND_EXPANDED_BORDER_COLOR = themed({
|
|
|
49
47
|
});
|
|
50
48
|
export var ExpandIconWrapper = function ExpandIconWrapper(_ref) {
|
|
51
49
|
var children = _ref.children,
|
|
52
|
-
|
|
50
|
+
expanded = _ref.expanded;
|
|
53
51
|
return jsx("div", {
|
|
54
52
|
css: function css(props) {
|
|
55
53
|
return expanded ? [expandIconWrapperStyle(props), expandIconWrapperExpandedStyle] : expandIconWrapperStyle(props);
|
|
56
54
|
}
|
|
57
55
|
}, children);
|
|
58
56
|
};
|
|
59
|
-
|
|
60
57
|
var expandIconWrapperStyle = function expandIconWrapperStyle(props) {
|
|
61
58
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n display: flex;\n color: ", ";\n border-radius: ", "px;\n width: 24px;\n height: 24px;\n\n &:hover {\n background: ", ";\n }\n\n svg {\n transition: transform 0.2s ", ";\n }\n"])), themed({
|
|
62
59
|
light: "var(--ds-icon, ".concat(colors.N90, ")"),
|
|
63
60
|
dark: "var(--ds-icon, #d9dde3)"
|
|
64
61
|
})(props), gridSize() / 2, "var(--ds-background-neutral-subtle-hovered, ".concat(colors.N30A, ")"), akEditorSwoopCubicBezier);
|
|
65
62
|
};
|
|
66
|
-
|
|
67
63
|
var expandIconWrapperExpandedStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n svg {\n transform: rotate(90deg);\n }\n"])));
|
|
68
64
|
export var expandLayoutWrapperStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: ", "px;\n height: ", "px;\n"])), gridSize() * 3, gridSize() * 3);
|
|
69
65
|
export var ExpandLayoutWrapperWithRef = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
70
66
|
var children = props.children,
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
73
68
|
return jsx("div", _extends({
|
|
74
69
|
css: expandLayoutWrapperStyle
|
|
75
70
|
}, rest, {
|
|
76
71
|
ref: ref
|
|
77
72
|
}), children);
|
|
78
73
|
});
|
|
79
|
-
|
|
80
74
|
var containerStyles = function containerStyles(styleProps) {
|
|
81
75
|
var expanded = styleProps.expanded,
|
|
82
|
-
|
|
76
|
+
focused = styleProps.focused;
|
|
83
77
|
var marginTop = "".concat(gridSize() / 2 / fontSize(), "rem");
|
|
84
|
-
var marginBottom = 0;
|
|
78
|
+
var marginBottom = 0;
|
|
79
|
+
// Only only these margins if the expand isn't editable
|
|
85
80
|
// and is the root level expand.
|
|
86
|
-
|
|
87
81
|
var marginHorizontal = styleProps['data-node-type'] === 'expand' ? "-".concat(akLayoutGutterOffset, "px") : 0;
|
|
88
82
|
var margin = "".concat(marginTop, " ").concat(marginHorizontal, " ").concat(marginBottom);
|
|
89
83
|
return function (themeProps) {
|
|
@@ -93,13 +87,11 @@ var containerStyles = function containerStyles(styleProps) {
|
|
|
93
87
|
})(themeProps), EXPAND_SELECTED_BACKGROUND(themeProps));
|
|
94
88
|
};
|
|
95
89
|
};
|
|
96
|
-
|
|
97
90
|
var contentStyles = function contentStyles(styleProps) {
|
|
98
91
|
return function (themeProps) {
|
|
99
92
|
return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n padding-top: ", "px;\n padding-right: ", "px;\n padding-left: ", "px;\n display: flow-root;\n\n // The follow rules inside @supports block are added as a part of ED-8893\n // The fix is targeting mobile bridge on iOS 12 or below,\n // We should consider remove this fix when we no longer support iOS 12\n @supports not (display: flow-root) {\n width: 100%;\n box-sizing: border-box;\n }\n\n ", "\n "])), styleProps.expanded ? gridSize() : 0, gridSize(), gridSize() * 4 - gridSize() / 2, !styleProps.expanded ? "\n .expand-content-wrapper, .nestedExpand-content-wrapper {\n /* We visually hide the content here to preserve the content during copy+paste */\n width: 100%;\n display: block;\n height: 0;\n overflow: hidden;\n clip: rect(1px, 1px, 1px, 1px);\n white-space: nowrap;\n user-select: none;\n }\n " : '');
|
|
100
93
|
};
|
|
101
94
|
};
|
|
102
|
-
|
|
103
95
|
var titleInputStyles = function titleInputStyles(props) {
|
|
104
96
|
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n outline: none;\n border: none;\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n color: ", ";\n background: transparent;\n display: flex;\n flex: 1;\n padding: 0 0 0 ", "px;\n width: 100%;\n\n &::placeholder {\n opacity: 0.6;\n color: ", ";\n }\n"])), relativeFontSizeToBase16(fontSize()), akEditorLineHeight, themed({
|
|
105
97
|
light: "var(--ds-text-subtlest, ".concat(colors.N200A, ")"),
|
|
@@ -109,14 +101,12 @@ var titleInputStyles = function titleInputStyles(props) {
|
|
|
109
101
|
dark: "var(--ds-text-subtlest, ".concat(colors.DN600, ")")
|
|
110
102
|
})(props));
|
|
111
103
|
};
|
|
112
|
-
|
|
113
104
|
var titleContainerStyles = function titleContainerStyles(props) {
|
|
114
105
|
return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n padding: 0;\n display: flex;\n align-items: flex-start;\n background: none;\n border: none;\n font-size: ", ";\n width: 100%;\n color: ", ";\n overflow: hidden;\n cursor: pointer;\n // Prevent browser selection being inside the title container\n user-select: none;\n\n &:focus {\n outline: 0;\n }\n"])), relativeFontSizeToBase16(fontSize()), themed({
|
|
115
106
|
light: "var(--ds-text-subtle, ".concat(colors.N300A, ")"),
|
|
116
107
|
dark: "var(--ds-text-subtle, ".concat(colors.DN600, ")")
|
|
117
108
|
})(props));
|
|
118
109
|
};
|
|
119
|
-
|
|
120
110
|
export var sharedExpandStyles = {
|
|
121
111
|
titleInputStyles: titleInputStyles,
|
|
122
112
|
titleContainerStyles: titleContainerStyles,
|
|
@@ -5,44 +5,30 @@ 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 from 'react';
|
|
14
11
|
import { IntlProvider } from 'react-intl-next';
|
|
15
12
|
export var REACT_INTL_ERROR_MESSAGE = '<IntlProvider> needs to exist in the component ancestry';
|
|
16
|
-
|
|
17
13
|
var isMissingIntlProviderInAncestryError = function isMissingIntlProviderInAncestryError(err) {
|
|
18
14
|
var _err$toString;
|
|
19
|
-
|
|
20
15
|
return err === null || err === void 0 ? void 0 : (_err$toString = err.toString()) === null || _err$toString === void 0 ? void 0 : _err$toString.includes('<IntlProvider> needs to exist in the component ancestry');
|
|
21
16
|
};
|
|
22
|
-
|
|
23
17
|
export var IntlErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
24
18
|
_inherits(IntlErrorBoundary, _React$Component);
|
|
25
|
-
|
|
26
19
|
var _super = _createSuper(IntlErrorBoundary);
|
|
27
|
-
|
|
28
20
|
function IntlErrorBoundary() {
|
|
29
21
|
var _this;
|
|
30
|
-
|
|
31
22
|
_classCallCheck(this, IntlErrorBoundary);
|
|
32
|
-
|
|
33
23
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
34
24
|
args[_key] = arguments[_key];
|
|
35
25
|
}
|
|
36
|
-
|
|
37
26
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
38
|
-
|
|
39
27
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
40
28
|
missingIntlProviderInAncestry: false
|
|
41
29
|
});
|
|
42
|
-
|
|
43
30
|
return _this;
|
|
44
31
|
}
|
|
45
|
-
|
|
46
32
|
_createClass(IntlErrorBoundary, [{
|
|
47
33
|
key: "componentDidCatch",
|
|
48
34
|
value: function componentDidCatch(error, errorInfo) {
|
|
@@ -64,10 +50,8 @@ export var IntlErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
64
50
|
locale: "en"
|
|
65
51
|
}, this.props.children);
|
|
66
52
|
}
|
|
67
|
-
|
|
68
53
|
return this.props.children;
|
|
69
54
|
}
|
|
70
55
|
}]);
|
|
71
|
-
|
|
72
56
|
return IntlErrorBoundary;
|
|
73
57
|
}(React.Component);
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import { IntlContext, IntlProvider } from 'react-intl-next';
|
|
3
|
-
|
|
4
3
|
var useCheckIntlContext = function useCheckIntlContext() {
|
|
5
4
|
return useContext(IntlContext) === null;
|
|
6
5
|
};
|
|
7
|
-
|
|
8
6
|
export default function IntlProviderIfMissingWrapper(_ref) {
|
|
9
7
|
var children = _ref.children;
|
|
10
8
|
var missingIntlContext = useCheckIntlContext();
|
|
11
|
-
|
|
12
9
|
if (missingIntlContext) {
|
|
13
10
|
return /*#__PURE__*/React.createElement(IntlProvider, {
|
|
14
11
|
locale: "en"
|
|
15
12
|
}, children);
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
return children;
|
|
19
15
|
}
|
|
@@ -5,18 +5,12 @@ 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 ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
-
|
|
11
9
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
-
|
|
13
10
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
-
|
|
15
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
16
|
-
|
|
17
12
|
import React, { Component } from 'react';
|
|
18
13
|
import Popper from 'popper.js'; // eslint-disable-line import/extensions
|
|
19
|
-
|
|
20
14
|
import rafSchedule from 'raf-schd';
|
|
21
15
|
import { positionPropToPopperPosition } from './internal/helpers';
|
|
22
16
|
var defaultState = {
|
|
@@ -35,24 +29,17 @@ var defaultState = {
|
|
|
35
29
|
originalHeight: null,
|
|
36
30
|
maxHeight: null
|
|
37
31
|
};
|
|
38
|
-
|
|
39
32
|
var Layer = /*#__PURE__*/function (_Component) {
|
|
40
33
|
_inherits(Layer, _Component);
|
|
41
|
-
|
|
42
34
|
var _super = _createSuper(Layer);
|
|
43
|
-
|
|
44
35
|
// working with extract-react-types
|
|
36
|
+
|
|
45
37
|
function Layer(props) {
|
|
46
38
|
var _this;
|
|
47
|
-
|
|
48
39
|
_classCallCheck(this, Layer);
|
|
49
|
-
|
|
50
40
|
_this = _super.call(this, props);
|
|
51
|
-
|
|
52
41
|
_defineProperty(_assertThisInitialized(_this), "targetRef", /*#__PURE__*/React.createRef());
|
|
53
|
-
|
|
54
42
|
_defineProperty(_assertThisInitialized(_this), "contentRef", /*#__PURE__*/React.createRef());
|
|
55
|
-
|
|
56
43
|
_defineProperty(_assertThisInitialized(_this), "extractStyles", function (state) {
|
|
57
44
|
if (state) {
|
|
58
45
|
var popperHeight = state.offsets.popper.height;
|
|
@@ -60,9 +47,7 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
60
47
|
var top = Math.round(state.offsets.popper.top);
|
|
61
48
|
var cssPosition = 'absolute';
|
|
62
49
|
var originalHeight = _this.state.originalHeight || popperHeight;
|
|
63
|
-
|
|
64
50
|
var maxHeight = _this.calculateMaxHeight(originalHeight, popperHeight, top, cssPosition);
|
|
65
|
-
|
|
66
51
|
_this.setState({
|
|
67
52
|
// position: fixed or absolute
|
|
68
53
|
cssPosition: cssPosition,
|
|
@@ -73,12 +58,10 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
73
58
|
});
|
|
74
59
|
}
|
|
75
60
|
});
|
|
76
|
-
|
|
77
61
|
_this.state = defaultState;
|
|
78
62
|
_this.extractStyles = rafSchedule(_this.extractStyles.bind(_assertThisInitialized(_this)));
|
|
79
63
|
return _this;
|
|
80
64
|
}
|
|
81
|
-
|
|
82
65
|
_createClass(Layer, [{
|
|
83
66
|
key: "componentDidMount",
|
|
84
67
|
value: function componentDidMount() {
|
|
@@ -93,8 +76,9 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
93
76
|
key: "componentDidUpdate",
|
|
94
77
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
95
78
|
var onPositioned = this.props.onPositioned;
|
|
96
|
-
var hasExtractedStyles = this.state.hasExtractedStyles;
|
|
79
|
+
var hasExtractedStyles = this.state.hasExtractedStyles;
|
|
97
80
|
|
|
81
|
+
// This flag is set the first time the position is calculated from Popper and applied to the content
|
|
98
82
|
if (!prevState.hasExtractedStyles && hasExtractedStyles && onPositioned) {
|
|
99
83
|
onPositioned();
|
|
100
84
|
}
|
|
@@ -107,26 +91,24 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
107
91
|
this.popper.destroy();
|
|
108
92
|
}
|
|
109
93
|
}
|
|
94
|
+
|
|
110
95
|
/* Calculate the max height of the popper if it's height is greater than the viewport to prevent
|
|
111
96
|
* the bottom of the popper not being viewable.
|
|
112
97
|
* Only works if the popper uses viewport as the boundary and has a fixed position ancestor.
|
|
113
98
|
*/
|
|
114
|
-
|
|
115
99
|
}, {
|
|
116
100
|
key: "calculateMaxHeight",
|
|
117
101
|
value: function calculateMaxHeight(originalHeight, currentHeight, positionTop, cssPosition) {
|
|
118
102
|
var DocumentElementClientHeight = 0;
|
|
119
|
-
|
|
120
103
|
if (document.documentElement) {
|
|
121
104
|
DocumentElementClientHeight = document.documentElement.clientHeight;
|
|
122
105
|
}
|
|
123
|
-
|
|
124
106
|
if (cssPosition !== 'fixed') {
|
|
125
107
|
return null;
|
|
126
108
|
}
|
|
127
|
-
|
|
128
109
|
var viewportHeight = Math.max(DocumentElementClientHeight, window.innerHeight || 0);
|
|
129
|
-
return viewportHeight < originalHeight && currentHeight + positionTop >= viewportHeight - 50 ?
|
|
110
|
+
return viewportHeight < originalHeight && currentHeight + positionTop >= viewportHeight - 50 ?
|
|
111
|
+
// allow some spacing either side of viewport height
|
|
130
112
|
viewportHeight - 12 : null;
|
|
131
113
|
}
|
|
132
114
|
}, {
|
|
@@ -135,20 +117,19 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
135
117
|
if (!this.targetRef.current || !this.contentRef.current) {
|
|
136
118
|
return;
|
|
137
119
|
}
|
|
138
|
-
|
|
139
120
|
if (this.popper) {
|
|
140
121
|
this.popper.destroy();
|
|
141
|
-
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// "new Popper(...)" operation is very expensive when called on virtual DOM.
|
|
142
125
|
// This condition reduces the number of calls so we can run our tests faster
|
|
143
126
|
// (time was reduced from 100s to 13s).
|
|
144
|
-
|
|
145
|
-
|
|
146
127
|
if (!props.content) {
|
|
147
128
|
return;
|
|
148
|
-
}
|
|
149
|
-
// actual target to popper
|
|
150
|
-
|
|
129
|
+
}
|
|
151
130
|
|
|
131
|
+
// we wrap our target in a div so that we can safely get a reference to it, but we pass the
|
|
132
|
+
// actual target to popper
|
|
152
133
|
var isAlwaysFixed = false;
|
|
153
134
|
var actualTarget = this.targetRef.current.children[0];
|
|
154
135
|
var popperOpts = {
|
|
@@ -171,8 +152,8 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
171
152
|
flipVariations: true,
|
|
172
153
|
boundariesElement: 'viewport',
|
|
173
154
|
padding: 0 // leave 0 pixels between popper and the boundariesElement
|
|
174
|
-
|
|
175
155
|
},
|
|
156
|
+
|
|
176
157
|
preventOverflow: {
|
|
177
158
|
enabled: false,
|
|
178
159
|
escapeWithReference: true
|
|
@@ -180,7 +161,6 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
180
161
|
},
|
|
181
162
|
positionFixed: isAlwaysFixed
|
|
182
163
|
};
|
|
183
|
-
|
|
184
164
|
if (actualTarget) {
|
|
185
165
|
this.popper = new Popper(actualTarget, this.contentRef.current, popperOpts);
|
|
186
166
|
}
|
|
@@ -189,9 +169,9 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
189
169
|
key: "render",
|
|
190
170
|
value: function render() {
|
|
191
171
|
var _this$state = this.state,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
172
|
+
transform = _this$state.transform,
|
|
173
|
+
hasExtractedStyles = _this$state.hasExtractedStyles,
|
|
174
|
+
maxHeight = _this$state.maxHeight;
|
|
195
175
|
var opacity = hasExtractedStyles ? {} : {
|
|
196
176
|
opacity: 0
|
|
197
177
|
};
|
|
@@ -209,10 +189,8 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
209
189
|
}, this.props.content));
|
|
210
190
|
}
|
|
211
191
|
}]);
|
|
212
|
-
|
|
213
192
|
return Layer;
|
|
214
193
|
}(Component);
|
|
215
|
-
|
|
216
194
|
_defineProperty(Layer, "defaultProps", {
|
|
217
195
|
boundariesElement: 'viewport',
|
|
218
196
|
children: null,
|
|
@@ -224,5 +202,4 @@ _defineProperty(Layer, "defaultProps", {
|
|
|
224
202
|
isAlwaysFixed: false,
|
|
225
203
|
onPositioned: function onPositioned() {}
|
|
226
204
|
});
|
|
227
|
-
|
|
228
205
|
export { Layer as default };
|