@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
|
@@ -1,113 +1,95 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
|
|
4
3
|
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; }
|
|
5
|
-
|
|
6
4
|
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; }
|
|
7
|
-
|
|
8
5
|
export function isBody(elem) {
|
|
9
6
|
return elem === document.body;
|
|
10
7
|
}
|
|
11
8
|
export function isTextNode(elem) {
|
|
12
9
|
return elem && elem.nodeType === 3;
|
|
13
10
|
}
|
|
11
|
+
|
|
14
12
|
/**
|
|
15
13
|
* Decides if given fitHeight fits below or above the target taking boundaries into account.
|
|
16
14
|
*/
|
|
17
|
-
|
|
18
15
|
export function getVerticalPlacement(target, boundariesElement, fitHeight, alignY, forcePlacement, preventOverflow) {
|
|
19
16
|
if (forcePlacement && alignY) {
|
|
20
17
|
return alignY;
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
if (!fitHeight) {
|
|
24
20
|
return 'bottom';
|
|
25
21
|
}
|
|
26
|
-
|
|
27
22
|
if (isTextNode(target)) {
|
|
28
23
|
target = target.parentElement;
|
|
29
24
|
}
|
|
30
|
-
|
|
31
25
|
var boundariesClientRect = boundariesElement.getBoundingClientRect();
|
|
32
26
|
var boundariesHeight = boundariesClientRect.height;
|
|
33
27
|
var boundariesTop = isBody(boundariesElement) ? 0 : boundariesClientRect.top;
|
|
34
|
-
|
|
35
28
|
var _target$getBoundingCl = target.getBoundingClientRect(),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
targetTop = _target$getBoundingCl.top,
|
|
30
|
+
targetHeight = _target$getBoundingCl.height;
|
|
39
31
|
var spaceAbove = targetTop - (boundariesTop - boundariesElement.scrollTop);
|
|
40
|
-
var spaceBelow = boundariesTop + boundariesHeight - (targetTop + targetHeight);
|
|
32
|
+
var spaceBelow = boundariesTop + boundariesHeight - (targetTop + targetHeight);
|
|
41
33
|
|
|
34
|
+
// Force vertical placement to bottom if the space above doesn't accomodate the fitHeight
|
|
42
35
|
if (preventOverflow) {
|
|
43
36
|
if (spaceAbove <= fitHeight) {
|
|
44
37
|
return 'bottom';
|
|
45
38
|
}
|
|
46
39
|
}
|
|
47
|
-
|
|
48
40
|
if (spaceBelow >= fitHeight || spaceBelow >= spaceAbove) {
|
|
49
41
|
return 'bottom';
|
|
50
42
|
}
|
|
51
|
-
|
|
52
43
|
return 'top';
|
|
53
44
|
}
|
|
45
|
+
|
|
54
46
|
/**
|
|
55
47
|
* Decides if given fitWidth fits to the left or to the right of the target taking boundaries into account.
|
|
56
48
|
*/
|
|
57
|
-
|
|
58
49
|
export function getHorizontalPlacement(target, boundariesElement, fitWidth, alignX, forcePlacement, preventOverflow) {
|
|
59
50
|
// force placement unless preventOverflow is enabled
|
|
60
51
|
if (forcePlacement && alignX && !preventOverflow) {
|
|
61
52
|
return alignX;
|
|
62
53
|
}
|
|
63
|
-
|
|
64
54
|
if (!fitWidth) {
|
|
65
55
|
return alignX || 'left';
|
|
66
56
|
}
|
|
67
|
-
|
|
68
57
|
if (isTextNode(target)) {
|
|
69
58
|
target = target.parentElement;
|
|
70
59
|
}
|
|
71
|
-
|
|
72
60
|
var _target$getBoundingCl2 = target.getBoundingClientRect(),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
61
|
+
targetLeft = _target$getBoundingCl2.left,
|
|
62
|
+
targetWidth = _target$getBoundingCl2.width;
|
|
76
63
|
var _boundariesElement$ge = boundariesElement.getBoundingClientRect(),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
64
|
+
boundariesLeft = _boundariesElement$ge.left,
|
|
65
|
+
boundariesWidth = _boundariesElement$ge.width;
|
|
80
66
|
var spaceLeft = targetLeft - boundariesLeft + targetWidth;
|
|
81
67
|
var spaceRight = boundariesLeft + boundariesWidth - targetLeft;
|
|
82
|
-
|
|
83
68
|
if (alignX && spaceLeft > fitWidth && spaceRight > fitWidth) {
|
|
84
69
|
return alignX;
|
|
85
70
|
} else if (spaceRight >= fitWidth || spaceRight >= spaceLeft && !alignX) {
|
|
86
71
|
return 'left';
|
|
87
72
|
}
|
|
88
|
-
|
|
89
73
|
return 'right';
|
|
90
74
|
}
|
|
91
75
|
export function calculatePlacement(target, boundariesElement, fitWidth, fitHeight, alignX, alignY, forcePlacement, preventOverflow) {
|
|
92
76
|
return [getVerticalPlacement(target, boundariesElement, fitHeight, alignY, forcePlacement, preventOverflow), getHorizontalPlacement(target, boundariesElement, fitWidth, alignX, forcePlacement, preventOverflow)];
|
|
93
77
|
}
|
|
94
|
-
|
|
95
78
|
var calculateHorizontalPlacement = function calculateHorizontalPlacement(_ref) {
|
|
96
79
|
var placement = _ref.placement,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
80
|
+
targetLeft = _ref.targetLeft,
|
|
81
|
+
targetRight = _ref.targetRight,
|
|
82
|
+
targetWidth = _ref.targetWidth,
|
|
83
|
+
isPopupParentBody = _ref.isPopupParentBody,
|
|
84
|
+
popupOffsetParentLeft = _ref.popupOffsetParentLeft,
|
|
85
|
+
popupOffsetParentRight = _ref.popupOffsetParentRight,
|
|
86
|
+
popupOffsetParentScrollLeft = _ref.popupOffsetParentScrollLeft,
|
|
87
|
+
popupOffsetParentClientWidth = _ref.popupOffsetParentClientWidth,
|
|
88
|
+
popupClientWidth = _ref.popupClientWidth,
|
|
89
|
+
offset = _ref.offset,
|
|
90
|
+
_ref$allowOutOfBounds = _ref.allowOutOfBounds,
|
|
91
|
+
allowOutOfBounds = _ref$allowOutOfBounds === void 0 ? false : _ref$allowOutOfBounds;
|
|
109
92
|
var position = {};
|
|
110
|
-
|
|
111
93
|
if (placement === 'left') {
|
|
112
94
|
position.left = Math.ceil(targetLeft - popupOffsetParentLeft + (isPopupParentBody ? 0 : popupOffsetParentScrollLeft) + offset[0]);
|
|
113
95
|
} else if (placement === 'center') {
|
|
@@ -118,47 +100,38 @@ var calculateHorizontalPlacement = function calculateHorizontalPlacement(_ref) {
|
|
|
118
100
|
} else {
|
|
119
101
|
position.right = Math.ceil(popupOffsetParentRight - targetRight - (isPopupParentBody ? 0 : popupOffsetParentScrollLeft) + offset[0]);
|
|
120
102
|
}
|
|
121
|
-
|
|
122
103
|
if (!allowOutOfBounds) {
|
|
123
104
|
if (position.left !== undefined) {
|
|
124
105
|
position.left = getPopupXInsideParent(position.left, popupClientWidth, popupOffsetParentClientWidth);
|
|
125
106
|
}
|
|
126
|
-
|
|
127
107
|
if (position.right !== undefined) {
|
|
128
108
|
position.right = getPopupXInsideParent(position.right, popupClientWidth, popupOffsetParentClientWidth);
|
|
129
109
|
}
|
|
130
110
|
}
|
|
131
|
-
|
|
132
111
|
return position;
|
|
133
112
|
};
|
|
134
|
-
|
|
135
113
|
var getPopupXInsideParent = function getPopupXInsideParent(x, popupClientWidth, popupOffsetParentClientWidth) {
|
|
136
114
|
// minimum distance the popup can be from the edge of its parent
|
|
137
|
-
var minPopupMargin = 1;
|
|
138
|
-
|
|
115
|
+
var minPopupMargin = 1;
|
|
116
|
+
// prevent going too far right
|
|
139
117
|
if (popupOffsetParentClientWidth < x + popupClientWidth) {
|
|
140
118
|
x = popupOffsetParentClientWidth - popupClientWidth - minPopupMargin;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
119
|
+
}
|
|
120
|
+
// prevent going too far left
|
|
144
121
|
return Math.max(minPopupMargin, x);
|
|
145
122
|
};
|
|
146
|
-
|
|
147
123
|
var calculateVerticalStickBottom = function calculateVerticalStickBottom(_ref2) {
|
|
148
124
|
var target = _ref2.target,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
125
|
+
targetTop = _ref2.targetTop,
|
|
126
|
+
targetHeight = _ref2.targetHeight,
|
|
127
|
+
popup = _ref2.popup,
|
|
128
|
+
offset = _ref2.offset,
|
|
129
|
+
position = _ref2.position;
|
|
154
130
|
var scrollParent = findOverflowScrollParent(target);
|
|
155
|
-
|
|
156
131
|
var newPos = _objectSpread({}, position);
|
|
157
|
-
|
|
158
132
|
if (scrollParent) {
|
|
159
133
|
var topOffsetTop = targetTop - scrollParent.getBoundingClientRect().top;
|
|
160
134
|
var targetEnd = targetHeight + topOffsetTop;
|
|
161
|
-
|
|
162
135
|
if (scrollParent.clientHeight - targetEnd <= popup.clientHeight + offset[1] * 2 && topOffsetTop < scrollParent.clientHeight) {
|
|
163
136
|
var scroll = targetEnd - scrollParent.clientHeight + offset[1] * 2;
|
|
164
137
|
var top = newPos.top || 0;
|
|
@@ -166,33 +139,26 @@ var calculateVerticalStickBottom = function calculateVerticalStickBottom(_ref2)
|
|
|
166
139
|
newPos.top = top;
|
|
167
140
|
}
|
|
168
141
|
}
|
|
169
|
-
|
|
170
142
|
return newPos;
|
|
171
143
|
};
|
|
172
|
-
|
|
173
144
|
var calculateVerticalStickTop = function calculateVerticalStickTop(_ref3) {
|
|
174
145
|
var target = _ref3.target,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
146
|
+
targetTop = _ref3.targetTop,
|
|
147
|
+
targetHeight = _ref3.targetHeight,
|
|
148
|
+
popupOffsetParentHeight = _ref3.popupOffsetParentHeight,
|
|
149
|
+
popupOffsetParent = _ref3.popupOffsetParent,
|
|
150
|
+
offset = _ref3.offset,
|
|
151
|
+
position = _ref3.position,
|
|
152
|
+
placement = _ref3.placement;
|
|
182
153
|
var scrollParent = findOverflowScrollParent(target);
|
|
183
|
-
|
|
184
154
|
var newPos = _objectSpread({}, position);
|
|
185
|
-
|
|
186
155
|
if (scrollParent) {
|
|
187
156
|
var _scrollParent$getBoun = scrollParent.getBoundingClientRect(),
|
|
188
|
-
|
|
189
|
-
|
|
157
|
+
scrollParentTop = _scrollParent$getBoun.top;
|
|
190
158
|
var topBoundary = targetTop - scrollParentTop;
|
|
191
159
|
var scrollParentScrollTop = scrollParent.scrollTop;
|
|
192
|
-
|
|
193
160
|
if (topBoundary < 0) {
|
|
194
161
|
var isBelowNodeBoundary = targetTop + (scrollParentScrollTop - scrollParentTop) + targetHeight + offset[1] < scrollParentScrollTop;
|
|
195
|
-
|
|
196
162
|
if (placement === 'top') {
|
|
197
163
|
if (isBelowNodeBoundary) {
|
|
198
164
|
newPos.bottom = popupOffsetParentHeight - (topBoundary + popupOffsetParent.scrollTop + targetHeight);
|
|
@@ -200,7 +166,6 @@ var calculateVerticalStickTop = function calculateVerticalStickTop(_ref3) {
|
|
|
200
166
|
newPos.bottom = topBoundary + (newPos.bottom || 0);
|
|
201
167
|
}
|
|
202
168
|
}
|
|
203
|
-
|
|
204
169
|
if (placement === 'start') {
|
|
205
170
|
if (isBelowNodeBoundary) {
|
|
206
171
|
newPos.top = topBoundary + popupOffsetParent.scrollTop + targetHeight;
|
|
@@ -210,22 +175,19 @@ var calculateVerticalStickTop = function calculateVerticalStickTop(_ref3) {
|
|
|
210
175
|
}
|
|
211
176
|
}
|
|
212
177
|
}
|
|
213
|
-
|
|
214
178
|
return newPos;
|
|
215
179
|
};
|
|
216
|
-
|
|
217
180
|
var calculateVerticalPlacement = function calculateVerticalPlacement(_ref4) {
|
|
218
181
|
var placement = _ref4.placement,
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
182
|
+
targetTop = _ref4.targetTop,
|
|
183
|
+
targetHeight = _ref4.targetHeight,
|
|
184
|
+
isPopupParentBody = _ref4.isPopupParentBody,
|
|
185
|
+
popupOffsetParentHeight = _ref4.popupOffsetParentHeight,
|
|
186
|
+
popupOffsetParentTop = _ref4.popupOffsetParentTop,
|
|
187
|
+
popupOffsetParentScrollTop = _ref4.popupOffsetParentScrollTop,
|
|
188
|
+
borderBottomWidth = _ref4.borderBottomWidth,
|
|
189
|
+
offset = _ref4.offset;
|
|
227
190
|
var position = {};
|
|
228
|
-
|
|
229
191
|
if (placement === 'top') {
|
|
230
192
|
position.bottom = Math.ceil(popupOffsetParentHeight - (targetTop - popupOffsetParentTop) - (isPopupParentBody ? 0 : popupOffsetParentScrollTop) - borderBottomWidth + offset[1]);
|
|
231
193
|
} else if (placement === 'start') {
|
|
@@ -234,59 +196,49 @@ var calculateVerticalPlacement = function calculateVerticalPlacement(_ref4) {
|
|
|
234
196
|
var top = Math.ceil(targetTop - popupOffsetParentTop + targetHeight + (isPopupParentBody ? 0 : popupOffsetParentScrollTop) - borderBottomWidth + offset[1]);
|
|
235
197
|
position.top = top;
|
|
236
198
|
}
|
|
237
|
-
|
|
238
199
|
return position;
|
|
239
200
|
};
|
|
201
|
+
|
|
240
202
|
/**
|
|
241
203
|
* Calculates relative coordinates for placing popup along with the target.
|
|
242
204
|
* Uses placement from calculatePlacement.
|
|
243
205
|
*/
|
|
244
|
-
|
|
245
|
-
|
|
246
206
|
export function calculatePosition(_ref5) {
|
|
247
207
|
var placement = _ref5.placement,
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
208
|
+
target = _ref5.target,
|
|
209
|
+
popup = _ref5.popup,
|
|
210
|
+
offset = _ref5.offset,
|
|
211
|
+
stick = _ref5.stick,
|
|
212
|
+
_ref5$allowOutOfBound = _ref5.allowOutOfBounds,
|
|
213
|
+
allowOutOfBounds = _ref5$allowOutOfBound === void 0 ? false : _ref5$allowOutOfBound,
|
|
214
|
+
rect = _ref5.rect;
|
|
255
215
|
var position = {};
|
|
256
|
-
|
|
257
216
|
if (!target || !popup || !popup.offsetParent) {
|
|
258
217
|
return position;
|
|
259
218
|
}
|
|
260
|
-
|
|
261
219
|
if (isTextNode(target)) {
|
|
262
220
|
target = target.parentElement;
|
|
263
221
|
}
|
|
264
|
-
|
|
265
222
|
var popupOffsetParent = popup.offsetParent;
|
|
266
223
|
var offsetParentStyle = popupOffsetParent.style;
|
|
267
224
|
var borderBottomWidth = 0;
|
|
268
|
-
|
|
269
225
|
if (offsetParentStyle && offsetParentStyle.borderBottomWidth) {
|
|
270
226
|
borderBottomWidth = parseInt(offsetParentStyle.borderBottomWidth, 10);
|
|
271
227
|
}
|
|
272
|
-
|
|
273
228
|
var _placement = _slicedToArray(placement, 2),
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
229
|
+
verticalPlacement = _placement[0],
|
|
230
|
+
horizontalPlacement = _placement[1];
|
|
277
231
|
var _ref6 = rect ? rect : popupOffsetParent.getBoundingClientRect(),
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
232
|
+
popupOffsetParentTop = _ref6.top,
|
|
233
|
+
popupOffsetParentLeft = _ref6.left,
|
|
234
|
+
popupOffsetParentRight = _ref6.right,
|
|
235
|
+
popupOffsetParentHeight = _ref6.height;
|
|
283
236
|
var _target$getBoundingCl3 = target.getBoundingClientRect(),
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
237
|
+
targetTop = _target$getBoundingCl3.top,
|
|
238
|
+
targetLeft = _target$getBoundingCl3.left,
|
|
239
|
+
targetRight = _target$getBoundingCl3.right,
|
|
240
|
+
targetHeight = _target$getBoundingCl3.height,
|
|
241
|
+
targetWidth = _target$getBoundingCl3.width;
|
|
290
242
|
var isPopupParentBody = isBody(popupOffsetParent);
|
|
291
243
|
var verticalPosition = calculateVerticalPlacement({
|
|
292
244
|
placement: verticalPlacement,
|
|
@@ -300,7 +252,6 @@ export function calculatePosition(_ref5) {
|
|
|
300
252
|
offset: offset
|
|
301
253
|
});
|
|
302
254
|
position = _objectSpread(_objectSpread({}, position), verticalPosition);
|
|
303
|
-
|
|
304
255
|
if ((verticalPlacement === 'top' || verticalPlacement === 'start') && stick) {
|
|
305
256
|
position = calculateVerticalStickTop({
|
|
306
257
|
target: target,
|
|
@@ -314,7 +265,6 @@ export function calculatePosition(_ref5) {
|
|
|
314
265
|
placement: verticalPlacement
|
|
315
266
|
});
|
|
316
267
|
}
|
|
317
|
-
|
|
318
268
|
if (verticalPlacement !== 'top' && verticalPlacement !== 'start' && stick) {
|
|
319
269
|
position = calculateVerticalStickBottom({
|
|
320
270
|
target: target,
|
|
@@ -325,7 +275,6 @@ export function calculatePosition(_ref5) {
|
|
|
325
275
|
position: position
|
|
326
276
|
});
|
|
327
277
|
}
|
|
328
|
-
|
|
329
278
|
var horizontalPosition = calculateHorizontalPlacement({
|
|
330
279
|
placement: horizontalPlacement,
|
|
331
280
|
targetLeft: targetLeft,
|
|
@@ -348,28 +297,23 @@ export function validatePosition(popup) {
|
|
|
348
297
|
if (!popup || !popup.offsetParent) {
|
|
349
298
|
return false;
|
|
350
299
|
}
|
|
351
|
-
|
|
352
300
|
return true;
|
|
353
301
|
}
|
|
302
|
+
|
|
354
303
|
/**
|
|
355
304
|
* Traverse DOM Tree upwards looking for popup parents with "overflow: scroll".
|
|
356
305
|
*/
|
|
357
|
-
|
|
358
306
|
export function findOverflowScrollParent(popup) {
|
|
359
307
|
var parent = popup;
|
|
360
|
-
|
|
361
308
|
if (!parent) {
|
|
362
309
|
return false;
|
|
363
310
|
}
|
|
364
|
-
|
|
365
311
|
while (parent = parent.parentElement) {
|
|
366
312
|
// IE11 on Window 8 doesn't show styles from CSS when accessing through element.style property.
|
|
367
313
|
var style = window.getComputedStyle(parent);
|
|
368
|
-
|
|
369
314
|
if (style.overflow === 'scroll' || style.overflowX === 'scroll' || style.overflowY === 'scroll' || parent.classList.contains('fabric-editor-popup-scroll-parent')) {
|
|
370
315
|
return parent;
|
|
371
316
|
}
|
|
372
317
|
}
|
|
373
|
-
|
|
374
318
|
return false;
|
|
375
319
|
}
|
|
@@ -5,8 +5,9 @@ import AtlaskitTheme from '@atlaskit/theme/components';
|
|
|
5
5
|
import { CHANNEL } from '@atlaskit/theme/constants';
|
|
6
6
|
export function PortalProviderThemeProviders(props) {
|
|
7
7
|
var children = props.children,
|
|
8
|
-
|
|
9
|
-
var styledComponentsAndEmotionTheme = React.useMemo(
|
|
8
|
+
mode = props.mode;
|
|
9
|
+
var styledComponentsAndEmotionTheme = React.useMemo(
|
|
10
|
+
// This return value should only be one of the following
|
|
10
11
|
// - { [CHANNEL]: { mode },
|
|
11
12
|
// - { theme: { [CHANNEL]: { mode } }
|
|
12
13
|
// However, it appears that consumers have inconsistent expectations
|
|
@@ -16,7 +17,6 @@ export function PortalProviderThemeProviders(props) {
|
|
|
16
17
|
// we are merging the two shapes consumers expect.
|
|
17
18
|
function () {
|
|
18
19
|
var _ref;
|
|
19
|
-
|
|
20
20
|
return _ref = {}, _defineProperty(_ref, CHANNEL, {
|
|
21
21
|
mode: mode
|
|
22
22
|
}), _defineProperty(_ref, "theme", _defineProperty({}, CHANNEL, {
|
|
@@ -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 _class;
|
|
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
|
import React from 'react';
|
|
17
13
|
import PropTypes from 'prop-types';
|
|
18
14
|
import { createPortal, unmountComponentAtNode, unstable_renderSubtreeIntoContainer } from 'react-dom';
|
|
@@ -25,29 +21,21 @@ import IntlProviderIfMissingWrapper from '../IntlProviderIfMissingWrapper';
|
|
|
25
21
|
import { PortalProviderThemeProviders } from './PortalProviderThemesProvider';
|
|
26
22
|
export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
|
|
27
23
|
_inherits(PortalProviderAPI, _EventDispatcher);
|
|
28
|
-
|
|
29
24
|
var _super = _createSuper(PortalProviderAPI);
|
|
30
|
-
|
|
31
25
|
function PortalProviderAPI(intl, onAnalyticsEvent, analyticsContext, themeMode) {
|
|
32
26
|
var _this;
|
|
33
|
-
|
|
34
27
|
_classCallCheck(this, PortalProviderAPI);
|
|
35
|
-
|
|
36
28
|
_this = _super.call(this);
|
|
37
|
-
|
|
38
29
|
_defineProperty(_assertThisInitialized(_this), "portals", new Map());
|
|
39
|
-
|
|
40
30
|
_defineProperty(_assertThisInitialized(_this), "setContext", function (context) {
|
|
41
31
|
_this.context = context;
|
|
42
32
|
});
|
|
43
|
-
|
|
44
33
|
_this.intl = intl;
|
|
45
34
|
_this.onAnalyticsEvent = onAnalyticsEvent;
|
|
46
35
|
_this.useAnalyticsContext = analyticsContext;
|
|
47
36
|
_this.themeMode = themeMode;
|
|
48
37
|
return _this;
|
|
49
38
|
}
|
|
50
|
-
|
|
51
39
|
_createClass(PortalProviderAPI, [{
|
|
52
40
|
key: "render",
|
|
53
41
|
value: function render(children, container) {
|
|
@@ -62,60 +50,55 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
62
50
|
mode: this.themeMode
|
|
63
51
|
}, children());
|
|
64
52
|
var wrappedChildren = this.useAnalyticsContext ? /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders) : childrenWithThemeProviders;
|
|
65
|
-
|
|
66
53
|
if (hasIntlContext) {
|
|
67
54
|
wrappedChildren = /*#__PURE__*/React.createElement(RawIntlProvider, {
|
|
68
55
|
value: this.intl
|
|
69
56
|
}, wrappedChildren);
|
|
70
57
|
}
|
|
71
|
-
|
|
72
58
|
unstable_renderSubtreeIntoContainer(this.context, wrappedChildren, container);
|
|
73
|
-
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// TODO: until https://product-fabric.atlassian.net/browse/ED-5013
|
|
74
62
|
// we (unfortunately) need to re-render to pass down any updated context.
|
|
75
63
|
// selectively do this for nodeviews that opt-in via `hasAnalyticsContext`
|
|
76
|
-
|
|
77
64
|
}, {
|
|
78
65
|
key: "forceUpdate",
|
|
79
66
|
value: function forceUpdate(_ref) {
|
|
80
67
|
var _this2 = this;
|
|
81
|
-
|
|
82
68
|
var intl = _ref.intl,
|
|
83
|
-
|
|
69
|
+
themeMode = _ref.themeMode;
|
|
84
70
|
this.intl = intl;
|
|
85
71
|
this.themeMode = themeMode;
|
|
86
72
|
this.portals.forEach(function (portal, container) {
|
|
87
73
|
if (!portal.hasAnalyticsContext && !_this2.useAnalyticsContext && !portal.hasIntlContext) {
|
|
88
74
|
return;
|
|
89
75
|
}
|
|
90
|
-
|
|
91
76
|
var wrappedChildren = portal.children();
|
|
92
77
|
var childrenWithThemeProviders = /*#__PURE__*/React.createElement(PortalProviderThemeProviders, {
|
|
93
78
|
mode: themeMode
|
|
94
79
|
}, wrappedChildren);
|
|
95
|
-
|
|
96
80
|
if (portal.hasAnalyticsContext && _this2.useAnalyticsContext) {
|
|
97
81
|
wrappedChildren = /*#__PURE__*/React.createElement(AnalyticsContextWrapper, null, childrenWithThemeProviders);
|
|
98
82
|
}
|
|
99
|
-
|
|
100
83
|
if (portal.hasIntlContext) {
|
|
101
84
|
wrappedChildren = /*#__PURE__*/React.createElement(RawIntlProvider, {
|
|
102
85
|
value: _this2.intl
|
|
103
86
|
}, childrenWithThemeProviders);
|
|
104
87
|
}
|
|
105
|
-
|
|
106
88
|
unstable_renderSubtreeIntoContainer(_this2.context, wrappedChildren, container);
|
|
107
89
|
});
|
|
108
90
|
}
|
|
109
91
|
}, {
|
|
110
92
|
key: "remove",
|
|
111
93
|
value: function remove(container) {
|
|
112
|
-
this.portals.delete(container);
|
|
94
|
+
this.portals.delete(container);
|
|
95
|
+
|
|
96
|
+
// There is a race condition that can happen caused by Prosemirror vs React,
|
|
113
97
|
// where Prosemirror removes the container from the DOM before React gets
|
|
114
98
|
// around to removing the child from the container
|
|
115
99
|
// This will throw a NotFoundError: The node to be removed is not a child of this node
|
|
116
100
|
// Both Prosemirror and React remove the elements asynchronously, and in edge
|
|
117
101
|
// cases Prosemirror beats React
|
|
118
|
-
|
|
119
102
|
try {
|
|
120
103
|
unmountComponentAtNode(container);
|
|
121
104
|
} catch (error) {
|
|
@@ -140,25 +123,18 @@ export var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
140
123
|
}
|
|
141
124
|
}
|
|
142
125
|
}]);
|
|
143
|
-
|
|
144
126
|
return PortalProviderAPI;
|
|
145
127
|
}(EventDispatcher);
|
|
146
|
-
|
|
147
128
|
var BasePortalProvider = /*#__PURE__*/function (_React$Component) {
|
|
148
129
|
_inherits(BasePortalProvider, _React$Component);
|
|
149
|
-
|
|
150
130
|
var _super2 = _createSuper(BasePortalProvider);
|
|
151
|
-
|
|
152
131
|
function BasePortalProvider(props) {
|
|
153
132
|
var _this3;
|
|
154
|
-
|
|
155
133
|
_classCallCheck(this, BasePortalProvider);
|
|
156
|
-
|
|
157
134
|
_this3 = _super2.call(this, props);
|
|
158
135
|
_this3.portalProviderAPI = new PortalProviderAPI(props.intl, props.onAnalyticsEvent, props.useAnalyticsContext, props.themeMode);
|
|
159
136
|
return _this3;
|
|
160
137
|
}
|
|
161
|
-
|
|
162
138
|
_createClass(BasePortalProvider, [{
|
|
163
139
|
key: "render",
|
|
164
140
|
value: function render() {
|
|
@@ -173,28 +149,24 @@ var BasePortalProvider = /*#__PURE__*/function (_React$Component) {
|
|
|
173
149
|
});
|
|
174
150
|
}
|
|
175
151
|
}]);
|
|
176
|
-
|
|
177
152
|
return BasePortalProvider;
|
|
178
153
|
}(React.Component);
|
|
179
|
-
|
|
180
154
|
_defineProperty(BasePortalProvider, "displayName", 'PortalProvider');
|
|
181
|
-
|
|
182
155
|
export var PortalProvider = injectIntl(BasePortalProvider);
|
|
183
156
|
export var PortalProviderWithThemeProviders = function PortalProviderWithThemeProviders(_ref2) {
|
|
184
157
|
var onAnalyticsEvent = _ref2.onAnalyticsEvent,
|
|
185
|
-
|
|
186
|
-
|
|
158
|
+
useAnalyticsContext = _ref2.useAnalyticsContext,
|
|
159
|
+
render = _ref2.render;
|
|
187
160
|
return /*#__PURE__*/React.createElement(IntlProviderIfMissingWrapper, null, /*#__PURE__*/React.createElement(PortalProviderWithThemeAndIntlProviders, {
|
|
188
161
|
onAnalyticsEvent: onAnalyticsEvent,
|
|
189
162
|
useAnalyticsContext: useAnalyticsContext,
|
|
190
163
|
render: render
|
|
191
164
|
}));
|
|
192
165
|
};
|
|
193
|
-
|
|
194
166
|
var PortalProviderWithThemeAndIntlProviders = function PortalProviderWithThemeAndIntlProviders(_ref3) {
|
|
195
167
|
var onAnalyticsEvent = _ref3.onAnalyticsEvent,
|
|
196
|
-
|
|
197
|
-
|
|
168
|
+
useAnalyticsContext = _ref3.useAnalyticsContext,
|
|
169
|
+
render = _ref3.render;
|
|
198
170
|
var intl = useIntl();
|
|
199
171
|
var globalTheme = useGlobalTheme();
|
|
200
172
|
return /*#__PURE__*/React.createElement(BasePortalProvider, {
|
|
@@ -205,25 +177,18 @@ var PortalProviderWithThemeAndIntlProviders = function PortalProviderWithThemeAn
|
|
|
205
177
|
render: render
|
|
206
178
|
});
|
|
207
179
|
};
|
|
208
|
-
|
|
209
180
|
export var PortalRenderer = /*#__PURE__*/function (_React$Component2) {
|
|
210
181
|
_inherits(PortalRenderer, _React$Component2);
|
|
211
|
-
|
|
212
182
|
var _super3 = _createSuper(PortalRenderer);
|
|
213
|
-
|
|
214
183
|
function PortalRenderer(props) {
|
|
215
184
|
var _this4;
|
|
216
|
-
|
|
217
185
|
_classCallCheck(this, PortalRenderer);
|
|
218
|
-
|
|
219
186
|
_this4 = _super3.call(this, props);
|
|
220
|
-
|
|
221
187
|
_defineProperty(_assertThisInitialized(_this4), "handleUpdate", function (portals) {
|
|
222
188
|
return _this4.setState({
|
|
223
189
|
portals: portals
|
|
224
190
|
});
|
|
225
191
|
});
|
|
226
|
-
|
|
227
192
|
props.portalProviderAPI.setContext(_assertThisInitialized(_this4));
|
|
228
193
|
props.portalProviderAPI.on('update', _this4.handleUpdate);
|
|
229
194
|
_this4.state = {
|
|
@@ -231,56 +196,47 @@ export var PortalRenderer = /*#__PURE__*/function (_React$Component2) {
|
|
|
231
196
|
};
|
|
232
197
|
return _this4;
|
|
233
198
|
}
|
|
234
|
-
|
|
235
199
|
_createClass(PortalRenderer, [{
|
|
236
200
|
key: "render",
|
|
237
201
|
value: function render() {
|
|
238
202
|
var portals = this.state.portals;
|
|
239
203
|
return /*#__PURE__*/React.createElement(React.Fragment, null, Array.from(portals.entries()).map(function (_ref4) {
|
|
240
204
|
var _ref5 = _slicedToArray(_ref4, 2),
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
205
|
+
container = _ref5[0],
|
|
206
|
+
children = _ref5[1];
|
|
244
207
|
return /*#__PURE__*/createPortal(children, container);
|
|
245
208
|
}));
|
|
246
209
|
}
|
|
247
210
|
}]);
|
|
248
|
-
|
|
249
211
|
return PortalRenderer;
|
|
250
212
|
}(React.Component);
|
|
213
|
+
|
|
251
214
|
/**
|
|
252
215
|
* Wrapper to re-provide modern analytics context to ReactNodeViews.
|
|
253
216
|
*/
|
|
254
|
-
|
|
255
217
|
var dummyAnalyticsContext = {
|
|
256
218
|
getAtlaskitAnalyticsContext: function getAtlaskitAnalyticsContext() {},
|
|
257
219
|
getAtlaskitAnalyticsEventHandlers: function getAtlaskitAnalyticsEventHandlers() {}
|
|
258
220
|
};
|
|
259
221
|
var AnalyticsContextWrapper = (_class = /*#__PURE__*/function (_React$Component3) {
|
|
260
222
|
_inherits(AnalyticsContextWrapper, _React$Component3);
|
|
261
|
-
|
|
262
223
|
var _super4 = _createSuper(AnalyticsContextWrapper);
|
|
263
|
-
|
|
264
224
|
function AnalyticsContextWrapper() {
|
|
265
225
|
_classCallCheck(this, AnalyticsContextWrapper);
|
|
266
|
-
|
|
267
226
|
return _super4.apply(this, arguments);
|
|
268
227
|
}
|
|
269
|
-
|
|
270
228
|
_createClass(AnalyticsContextWrapper, [{
|
|
271
229
|
key: "render",
|
|
272
230
|
value: function render() {
|
|
273
231
|
var _ref6 = this.context.contextAdapter.analytics || {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
232
|
+
value: dummyAnalyticsContext
|
|
233
|
+
},
|
|
234
|
+
value = _ref6.value;
|
|
278
235
|
return /*#__PURE__*/React.createElement(AnalyticsReactContext.Provider, {
|
|
279
236
|
value: value
|
|
280
237
|
}, this.props.children);
|
|
281
238
|
}
|
|
282
239
|
}]);
|
|
283
|
-
|
|
284
240
|
return AnalyticsContextWrapper;
|
|
285
241
|
}(React.Component), _defineProperty(_class, "contextTypes", {
|
|
286
242
|
contextAdapter: PropTypes.object
|