@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
|
@@ -1,33 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = IntlProviderIfMissingWrapper;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _reactIntlNext = require("react-intl-next");
|
|
13
|
-
|
|
14
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
|
|
16
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
|
|
18
12
|
var useCheckIntlContext = function useCheckIntlContext() {
|
|
19
13
|
return (0, _react.useContext)(_reactIntlNext.IntlContext) === null;
|
|
20
14
|
};
|
|
21
|
-
|
|
22
15
|
function IntlProviderIfMissingWrapper(_ref) {
|
|
23
16
|
var children = _ref.children;
|
|
24
17
|
var missingIntlContext = useCheckIntlContext();
|
|
25
|
-
|
|
26
18
|
if (missingIntlContext) {
|
|
27
19
|
return /*#__PURE__*/_react.default.createElement(_reactIntlNext.IntlProvider, {
|
|
28
20
|
locale: "en"
|
|
29
21
|
}, children);
|
|
30
22
|
}
|
|
31
|
-
|
|
32
23
|
return children;
|
|
33
24
|
}
|
|
@@ -1,48 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.default = void 0;
|
|
11
|
-
|
|
12
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
11
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
-
|
|
18
12
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
13
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
-
|
|
22
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
-
|
|
24
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
27
|
-
|
|
28
17
|
var _popper = _interopRequireDefault(require("popper.js"));
|
|
29
|
-
|
|
30
18
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
31
|
-
|
|
32
19
|
var _helpers = require("./internal/helpers");
|
|
33
|
-
|
|
34
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
-
|
|
36
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
-
|
|
38
22
|
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; }
|
|
39
|
-
|
|
40
23
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
41
|
-
|
|
42
24
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
43
|
-
|
|
44
25
|
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; } }
|
|
45
|
-
|
|
46
26
|
var defaultState = {
|
|
47
27
|
hasExtractedStyles: false,
|
|
48
28
|
// We set these default offsets to prevent a flash of popper content in the wrong position
|
|
@@ -59,16 +39,13 @@ var defaultState = {
|
|
|
59
39
|
originalHeight: null,
|
|
60
40
|
maxHeight: null
|
|
61
41
|
};
|
|
62
|
-
|
|
63
42
|
var Layer = /*#__PURE__*/function (_Component) {
|
|
64
43
|
(0, _inherits2.default)(Layer, _Component);
|
|
65
|
-
|
|
66
44
|
var _super = _createSuper(Layer);
|
|
67
|
-
|
|
68
45
|
// working with extract-react-types
|
|
46
|
+
|
|
69
47
|
function Layer(props) {
|
|
70
48
|
var _this;
|
|
71
|
-
|
|
72
49
|
(0, _classCallCheck2.default)(this, Layer);
|
|
73
50
|
_this = _super.call(this, props);
|
|
74
51
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "targetRef", /*#__PURE__*/_react.default.createRef());
|
|
@@ -80,9 +57,7 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
80
57
|
var top = Math.round(state.offsets.popper.top);
|
|
81
58
|
var cssPosition = 'absolute';
|
|
82
59
|
var originalHeight = _this.state.originalHeight || popperHeight;
|
|
83
|
-
|
|
84
60
|
var maxHeight = _this.calculateMaxHeight(originalHeight, popperHeight, top, cssPosition);
|
|
85
|
-
|
|
86
61
|
_this.setState({
|
|
87
62
|
// position: fixed or absolute
|
|
88
63
|
cssPosition: cssPosition,
|
|
@@ -97,7 +72,6 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
97
72
|
_this.extractStyles = (0, _rafSchd.default)(_this.extractStyles.bind((0, _assertThisInitialized2.default)(_this)));
|
|
98
73
|
return _this;
|
|
99
74
|
}
|
|
100
|
-
|
|
101
75
|
(0, _createClass2.default)(Layer, [{
|
|
102
76
|
key: "componentDidMount",
|
|
103
77
|
value: function componentDidMount() {
|
|
@@ -112,8 +86,9 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
112
86
|
key: "componentDidUpdate",
|
|
113
87
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
114
88
|
var onPositioned = this.props.onPositioned;
|
|
115
|
-
var hasExtractedStyles = this.state.hasExtractedStyles;
|
|
89
|
+
var hasExtractedStyles = this.state.hasExtractedStyles;
|
|
116
90
|
|
|
91
|
+
// This flag is set the first time the position is calculated from Popper and applied to the content
|
|
117
92
|
if (!prevState.hasExtractedStyles && hasExtractedStyles && onPositioned) {
|
|
118
93
|
onPositioned();
|
|
119
94
|
}
|
|
@@ -126,26 +101,24 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
126
101
|
this.popper.destroy();
|
|
127
102
|
}
|
|
128
103
|
}
|
|
104
|
+
|
|
129
105
|
/* Calculate the max height of the popper if it's height is greater than the viewport to prevent
|
|
130
106
|
* the bottom of the popper not being viewable.
|
|
131
107
|
* Only works if the popper uses viewport as the boundary and has a fixed position ancestor.
|
|
132
108
|
*/
|
|
133
|
-
|
|
134
109
|
}, {
|
|
135
110
|
key: "calculateMaxHeight",
|
|
136
111
|
value: function calculateMaxHeight(originalHeight, currentHeight, positionTop, cssPosition) {
|
|
137
112
|
var DocumentElementClientHeight = 0;
|
|
138
|
-
|
|
139
113
|
if (document.documentElement) {
|
|
140
114
|
DocumentElementClientHeight = document.documentElement.clientHeight;
|
|
141
115
|
}
|
|
142
|
-
|
|
143
116
|
if (cssPosition !== 'fixed') {
|
|
144
117
|
return null;
|
|
145
118
|
}
|
|
146
|
-
|
|
147
119
|
var viewportHeight = Math.max(DocumentElementClientHeight, window.innerHeight || 0);
|
|
148
|
-
return viewportHeight < originalHeight && currentHeight + positionTop >= viewportHeight - 50 ?
|
|
120
|
+
return viewportHeight < originalHeight && currentHeight + positionTop >= viewportHeight - 50 ?
|
|
121
|
+
// allow some spacing either side of viewport height
|
|
149
122
|
viewportHeight - 12 : null;
|
|
150
123
|
}
|
|
151
124
|
}, {
|
|
@@ -154,20 +127,19 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
154
127
|
if (!this.targetRef.current || !this.contentRef.current) {
|
|
155
128
|
return;
|
|
156
129
|
}
|
|
157
|
-
|
|
158
130
|
if (this.popper) {
|
|
159
131
|
this.popper.destroy();
|
|
160
|
-
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// "new Popper(...)" operation is very expensive when called on virtual DOM.
|
|
161
135
|
// This condition reduces the number of calls so we can run our tests faster
|
|
162
136
|
// (time was reduced from 100s to 13s).
|
|
163
|
-
|
|
164
|
-
|
|
165
137
|
if (!props.content) {
|
|
166
138
|
return;
|
|
167
|
-
}
|
|
168
|
-
// actual target to popper
|
|
169
|
-
|
|
139
|
+
}
|
|
170
140
|
|
|
141
|
+
// we wrap our target in a div so that we can safely get a reference to it, but we pass the
|
|
142
|
+
// actual target to popper
|
|
171
143
|
var isAlwaysFixed = false;
|
|
172
144
|
var actualTarget = this.targetRef.current.children[0];
|
|
173
145
|
var popperOpts = {
|
|
@@ -190,8 +162,8 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
190
162
|
flipVariations: true,
|
|
191
163
|
boundariesElement: 'viewport',
|
|
192
164
|
padding: 0 // leave 0 pixels between popper and the boundariesElement
|
|
193
|
-
|
|
194
165
|
},
|
|
166
|
+
|
|
195
167
|
preventOverflow: {
|
|
196
168
|
enabled: false,
|
|
197
169
|
escapeWithReference: true
|
|
@@ -199,7 +171,6 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
199
171
|
},
|
|
200
172
|
positionFixed: isAlwaysFixed
|
|
201
173
|
};
|
|
202
|
-
|
|
203
174
|
if (actualTarget) {
|
|
204
175
|
this.popper = new _popper.default(actualTarget, this.contentRef.current, popperOpts);
|
|
205
176
|
}
|
|
@@ -208,9 +179,9 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
208
179
|
key: "render",
|
|
209
180
|
value: function render() {
|
|
210
181
|
var _this$state = this.state,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
182
|
+
transform = _this$state.transform,
|
|
183
|
+
hasExtractedStyles = _this$state.hasExtractedStyles,
|
|
184
|
+
maxHeight = _this$state.maxHeight;
|
|
214
185
|
var opacity = hasExtractedStyles ? {} : {
|
|
215
186
|
opacity: 0
|
|
216
187
|
};
|
|
@@ -230,7 +201,6 @@ var Layer = /*#__PURE__*/function (_Component) {
|
|
|
230
201
|
}]);
|
|
231
202
|
return Layer;
|
|
232
203
|
}(_react.Component);
|
|
233
|
-
|
|
234
204
|
exports.default = Layer;
|
|
235
205
|
(0, _defineProperty2.default)(Layer, "defaultProps", {
|
|
236
206
|
boundariesElement: 'viewport',
|
|
@@ -60,11 +60,9 @@ var POSITION_ATTRIBUTE_ENUM = {
|
|
|
60
60
|
default: 'right middle'
|
|
61
61
|
};
|
|
62
62
|
exports.POSITION_ATTRIBUTE_ENUM = POSITION_ATTRIBUTE_ENUM;
|
|
63
|
-
|
|
64
63
|
function positionToPopper(position) {
|
|
65
64
|
return position && positionMap[position] ? positionMap[position].position : null;
|
|
66
65
|
}
|
|
67
|
-
|
|
68
66
|
function positionPropToPopperPosition(position) {
|
|
69
67
|
return positionToPopper(position) || positionMap[POSITION_ATTRIBUTE_ENUM.default].position;
|
|
70
68
|
}
|
|
@@ -11,33 +11,26 @@ exports.snapToGrid = exports.layoutSupportsWidth = void 0;
|
|
|
11
11
|
var handleMargin = 12;
|
|
12
12
|
var gutterSize = handleMargin * 2;
|
|
13
13
|
var validWidthModes = ['center', 'wrap-left', 'wrap-right', 'align-start', 'align-end'];
|
|
14
|
-
|
|
15
14
|
var layoutSupportsWidth = function layoutSupportsWidth(layout) {
|
|
16
15
|
return validWidthModes.indexOf(layout) > -1;
|
|
17
16
|
};
|
|
18
|
-
|
|
19
17
|
exports.layoutSupportsWidth = layoutSupportsWidth;
|
|
20
|
-
|
|
21
18
|
function calcPxFromColumns(columns, lineLength, gridSize) {
|
|
22
19
|
var maxWidth = lineLength + gutterSize;
|
|
23
20
|
return maxWidth / gridSize * columns - gutterSize;
|
|
24
21
|
}
|
|
25
|
-
|
|
26
22
|
function calcColumnsFromPx(width, lineLength, gridSize) {
|
|
27
23
|
var maxWidth = lineLength + gutterSize;
|
|
28
24
|
return (width + gutterSize) * gridSize / maxWidth;
|
|
29
25
|
}
|
|
30
|
-
|
|
31
26
|
function calcPxFromPct(pct, lineLength) {
|
|
32
27
|
var maxWidth = lineLength + gutterSize;
|
|
33
28
|
return maxWidth * pct - gutterSize;
|
|
34
29
|
}
|
|
35
|
-
|
|
36
30
|
function calcPctFromPx(width, lineLength) {
|
|
37
31
|
var maxWidth = lineLength + gutterSize;
|
|
38
32
|
return (width + gutterSize) / maxWidth;
|
|
39
33
|
}
|
|
40
|
-
|
|
41
34
|
var snapToGrid = function snapToGrid(gridWidth, width, height, lineLength, gridSize) {
|
|
42
35
|
var pxWidth = calcPxFromPct(gridWidth / 100, lineLength);
|
|
43
36
|
var columnSpan = Math.round(calcColumnsFromPx(pxWidth, lineLength, gridSize));
|
|
@@ -47,5 +40,4 @@ var snapToGrid = function snapToGrid(gridWidth, width, height, lineLength, gridS
|
|
|
47
40
|
width: alignedWidth
|
|
48
41
|
};
|
|
49
42
|
};
|
|
50
|
-
|
|
51
43
|
exports.snapToGrid = snapToGrid;
|
|
@@ -1,75 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.DEFAULT_IMAGE_WIDTH = exports.DEFAULT_IMAGE_HEIGHT = void 0;
|
|
9
8
|
exports.default = MediaSingle;
|
|
10
9
|
exports.wrappedLayouts = exports.shouldAddDefaultWrappedWidth = void 0;
|
|
11
|
-
|
|
12
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
-
|
|
14
11
|
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
12
|
var _react2 = require("@emotion/react");
|
|
17
|
-
|
|
18
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
|
-
|
|
20
14
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
21
|
-
|
|
22
15
|
var _grid = require("./grid");
|
|
23
|
-
|
|
24
16
|
var _styled = require("./styled");
|
|
25
|
-
|
|
26
17
|
/** @jsx jsx */
|
|
18
|
+
|
|
27
19
|
var DEFAULT_IMAGE_WIDTH = 250;
|
|
28
20
|
exports.DEFAULT_IMAGE_WIDTH = DEFAULT_IMAGE_WIDTH;
|
|
29
21
|
var DEFAULT_IMAGE_HEIGHT = 200;
|
|
30
22
|
exports.DEFAULT_IMAGE_HEIGHT = DEFAULT_IMAGE_HEIGHT;
|
|
31
23
|
var wrappedLayouts = ['wrap-left', 'wrap-right', 'align-end', 'align-start'];
|
|
32
24
|
exports.wrappedLayouts = wrappedLayouts;
|
|
33
|
-
|
|
34
25
|
var shouldAddDefaultWrappedWidth = function shouldAddDefaultWrappedWidth(layout, width, lineLength) {
|
|
35
26
|
return wrappedLayouts.indexOf(layout) > -1 && lineLength && width && width > 0.5 * lineLength;
|
|
36
27
|
};
|
|
37
|
-
|
|
38
28
|
exports.shouldAddDefaultWrappedWidth = shouldAddDefaultWrappedWidth;
|
|
39
|
-
|
|
40
29
|
function MediaSingle(_ref) {
|
|
41
30
|
var layout = _ref.layout,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
31
|
+
width = _ref.width,
|
|
32
|
+
height = _ref.height,
|
|
33
|
+
_ref$containerWidth = _ref.containerWidth,
|
|
34
|
+
containerWidth = _ref$containerWidth === void 0 ? width : _ref$containerWidth,
|
|
35
|
+
_ref$isLoading = _ref.isLoading,
|
|
36
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
37
|
+
pctWidth = _ref.pctWidth,
|
|
38
|
+
className = _ref.className,
|
|
39
|
+
propsChildren = _ref.children,
|
|
40
|
+
_ref$nodeType = _ref.nodeType,
|
|
41
|
+
nodeType = _ref$nodeType === void 0 ? 'mediaSingle' : _ref$nodeType,
|
|
42
|
+
fullWidthMode = _ref.fullWidthMode,
|
|
43
|
+
lineLength = _ref.lineLength,
|
|
44
|
+
_ref$hasFallbackConta = _ref.hasFallbackContainer,
|
|
45
|
+
hasFallbackContainer = _ref$hasFallbackConta === void 0 ? true : _ref$hasFallbackConta,
|
|
46
|
+
handleMediaSingleRef = _ref.handleMediaSingleRef;
|
|
59
47
|
var children = _react.default.Children.toArray(propsChildren);
|
|
60
|
-
|
|
61
48
|
if (!pctWidth && shouldAddDefaultWrappedWidth(layout, width, lineLength)) {
|
|
62
49
|
pctWidth = 50;
|
|
63
|
-
}
|
|
50
|
+
}
|
|
51
|
+
// When width is not set we have an absolute height for a given embed.
|
|
64
52
|
// When both width and height are set we use them to determine ratio and use that to define
|
|
65
53
|
// embed height in relation to whatever width of an dom element is in runtime
|
|
66
|
-
|
|
67
|
-
|
|
68
54
|
var isHeightOnly = width === undefined;
|
|
69
|
-
|
|
70
55
|
if (pctWidth) {
|
|
71
56
|
var pxWidth = Math.ceil((0, _grid.calcPxFromPct)(pctWidth / 100, lineLength || containerWidth || 0));
|
|
72
|
-
|
|
73
57
|
if (isHeightOnly) {
|
|
74
58
|
width = pxWidth - _editorSharedStyles.akEditorMediaResizeHandlerPaddingWide;
|
|
75
59
|
} else if (width !== undefined) {
|
|
@@ -78,37 +62,35 @@ function MediaSingle(_ref) {
|
|
|
78
62
|
}
|
|
79
63
|
} else if (isHeightOnly) {
|
|
80
64
|
// No pctWidth can be found on already existing pages with existing embeds
|
|
65
|
+
|
|
81
66
|
// It's ok to use Embed specific width, because width can be not set only in embed card.
|
|
82
67
|
// This value will be used only in the case of non `wide` and non `full-width` cases inside MediaSingleDimensionHelper.
|
|
83
68
|
width = _editorSharedStyles.DEFAULT_EMBED_CARD_WIDTH - _editorSharedStyles.akEditorMediaResizeHandlerPaddingWide;
|
|
84
|
-
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Media wrapper controls the height of the box.
|
|
85
72
|
// We can define this height
|
|
86
73
|
// - via height directly
|
|
87
74
|
// - via paddingBottom (if we have both height and width) which is a css trick to represent a ratio
|
|
88
|
-
|
|
89
|
-
|
|
90
75
|
var mediaWrapperHeight;
|
|
91
76
|
var paddingBottom;
|
|
92
|
-
|
|
93
77
|
if (isHeightOnly) {
|
|
94
78
|
mediaWrapperHeight = height;
|
|
95
79
|
} else if (width !== undefined) {
|
|
96
80
|
var mediaWrapperRatio = height / width * 100;
|
|
97
81
|
paddingBottom = "".concat(mediaWrapperRatio.toFixed(3), "%");
|
|
98
|
-
|
|
99
82
|
if (nodeType === 'embedCard') {
|
|
100
83
|
// we want to set ratio of whole box (including header) buy knowing ratio of iframe itself
|
|
84
|
+
|
|
101
85
|
// For some reason importing `embedHeaderHeight` from '@atlaskit/smart-card' breaks
|
|
102
86
|
// packages/editor/editor-core/src/plugins/table/__tests__/unit/toolbar.ts 🤷️, but we have a test
|
|
103
87
|
// that uses imported value, so it's should be good.
|
|
104
88
|
paddingBottom = "calc(".concat(paddingBottom, " + 32px)");
|
|
105
89
|
}
|
|
106
90
|
}
|
|
107
|
-
|
|
108
91
|
var _children = (0, _slicedToArray2.default)(children, 2),
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
92
|
+
media = _children[0],
|
|
93
|
+
caption = _children[1];
|
|
112
94
|
return (0, _react2.jsx)("div", {
|
|
113
95
|
ref: handleMediaSingleRef,
|
|
114
96
|
css: (0, _styled.MediaSingleDimensionHelper)({
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.mediaLinkStyle = void 0;
|
|
9
|
-
|
|
10
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
|
|
12
9
|
var _react = require("@emotion/react");
|
|
13
|
-
|
|
14
10
|
var _templateObject;
|
|
15
|
-
|
|
16
11
|
var mediaLinkStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n background: transparent;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n cursor: pointer;\n width: 100%;\n height: 100%;\n"])));
|
|
17
12
|
exports.mediaLinkStyle = mediaLinkStyle;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -9,43 +8,31 @@ exports.MediaWrapper = exports.MediaSingleDimensionHelper = void 0;
|
|
|
9
8
|
exports.calcLegacyWidth = calcLegacyWidth;
|
|
10
9
|
exports.calcResizedWidth = calcResizedWidth;
|
|
11
10
|
exports.mediaWrapperStyle = void 0;
|
|
12
|
-
|
|
13
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
14
|
-
|
|
15
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
16
|
-
|
|
17
13
|
var _react = _interopRequireDefault(require("react"));
|
|
18
|
-
|
|
19
14
|
var _react2 = require("@emotion/react");
|
|
20
|
-
|
|
21
15
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
22
|
-
|
|
23
16
|
var _breakout = require("../../utils/breakout");
|
|
24
|
-
|
|
25
17
|
var _excluded = ["children"];
|
|
26
|
-
|
|
27
18
|
var _templateObject, _templateObject2, _templateObject3;
|
|
28
|
-
|
|
29
19
|
function float(layout) {
|
|
30
20
|
switch (layout) {
|
|
31
21
|
case 'wrap-right':
|
|
32
22
|
return 'right';
|
|
33
|
-
|
|
34
23
|
case 'wrap-left':
|
|
35
24
|
return 'left';
|
|
36
|
-
|
|
37
25
|
default:
|
|
38
26
|
return 'none';
|
|
39
27
|
}
|
|
40
28
|
}
|
|
41
|
-
|
|
42
29
|
function getWidthIfFullWidthMode(width) {
|
|
43
30
|
return width > _editorSharedStyles.akEditorFullWidthLayoutWidth ? '100%' : "".concat(width, "px");
|
|
44
31
|
}
|
|
45
|
-
|
|
46
32
|
function getWidthIfDefaultMode(width) {
|
|
47
33
|
return width > _editorSharedStyles.akEditorFullPageMaxWidth ? '100%' : "".concat(width, "px");
|
|
48
34
|
}
|
|
35
|
+
|
|
49
36
|
/**
|
|
50
37
|
* Calculates the image width for non-resized images.
|
|
51
38
|
*
|
|
@@ -53,129 +40,103 @@ function getWidthIfDefaultMode(width) {
|
|
|
53
40
|
* then an image in wide or full-width can not be wider than the image's
|
|
54
41
|
* original width.
|
|
55
42
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
58
43
|
function calcLegacyWidth(layout, width) {
|
|
59
44
|
var containerWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
60
45
|
var fullWidthMode = arguments.length > 3 ? arguments[3] : undefined;
|
|
61
46
|
var isResized = arguments.length > 4 ? arguments[4] : undefined;
|
|
62
|
-
|
|
63
47
|
switch (layout) {
|
|
64
48
|
case 'align-start':
|
|
65
49
|
case 'align-end':
|
|
66
50
|
case 'wrap-right':
|
|
67
51
|
case 'wrap-left':
|
|
68
52
|
return width > containerWidth / 2 ? 'calc(50% - 12px)' : "".concat(width, "px");
|
|
69
|
-
|
|
70
53
|
case 'wide':
|
|
71
54
|
return (0, _breakout.calcWideWidth)(containerWidth);
|
|
72
|
-
|
|
73
55
|
case 'full-width':
|
|
74
56
|
return (0, _breakout.calcBreakoutWidth)(layout, containerWidth);
|
|
75
|
-
|
|
76
57
|
default:
|
|
77
58
|
return isResized ? "".concat(width, "px") : fullWidthMode ? getWidthIfFullWidthMode(width) : getWidthIfDefaultMode(width);
|
|
78
59
|
}
|
|
79
60
|
}
|
|
61
|
+
|
|
80
62
|
/**
|
|
81
63
|
* Calculates the image width for previously resized images.
|
|
82
64
|
*
|
|
83
65
|
* Wide and full-width images are always that size (960px and 100%); there is
|
|
84
66
|
* no distinction between max-width and width.
|
|
85
67
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
68
|
function calcResizedWidth(layout, width) {
|
|
89
69
|
var containerWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
90
|
-
|
|
91
70
|
switch (layout) {
|
|
92
71
|
case 'wide':
|
|
93
72
|
return (0, _breakout.calcWideWidth)(containerWidth);
|
|
94
|
-
|
|
95
73
|
case 'full-width':
|
|
96
74
|
return (0, _breakout.calcBreakoutWidth)(layout, containerWidth);
|
|
97
|
-
|
|
98
75
|
default:
|
|
99
76
|
return "".concat(width, "px");
|
|
100
77
|
}
|
|
101
78
|
}
|
|
102
|
-
|
|
103
79
|
function calcMaxWidth(layout, containerWidth) {
|
|
104
80
|
switch (layout) {
|
|
105
81
|
case 'wide':
|
|
106
82
|
return (0, _breakout.calcWideWidth)(containerWidth);
|
|
107
|
-
|
|
108
83
|
case 'full-width':
|
|
109
84
|
return (0, _breakout.calcBreakoutWidth)(layout, containerWidth);
|
|
110
|
-
|
|
111
85
|
default:
|
|
112
86
|
return '100%';
|
|
113
87
|
}
|
|
114
88
|
}
|
|
115
|
-
|
|
116
89
|
function calcMargin(layout) {
|
|
117
90
|
switch (layout) {
|
|
118
91
|
case 'wrap-right':
|
|
119
92
|
return '12px auto 12px 12px';
|
|
120
|
-
|
|
121
93
|
case 'wrap-left':
|
|
122
94
|
return '12px 12px 12px auto';
|
|
123
|
-
|
|
124
95
|
default:
|
|
125
96
|
return '24px auto';
|
|
126
97
|
}
|
|
127
98
|
}
|
|
128
|
-
|
|
129
99
|
function isImageAligned(layout) {
|
|
130
100
|
switch (layout) {
|
|
131
101
|
case 'align-end':
|
|
132
102
|
return 'margin-right: 0';
|
|
133
|
-
|
|
134
103
|
case 'align-start':
|
|
135
104
|
return 'margin-left: 0';
|
|
136
|
-
|
|
137
105
|
default:
|
|
138
106
|
return '';
|
|
139
107
|
}
|
|
140
108
|
}
|
|
141
|
-
|
|
142
109
|
/**
|
|
143
110
|
* Can't use `.attrs` to handle highly dynamic styles because we are still
|
|
144
111
|
* supporting `styled-components` v1.
|
|
145
112
|
*/
|
|
146
113
|
var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref) {
|
|
147
114
|
var _ref$containerWidth = _ref.containerWidth,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
115
|
+
containerWidth = _ref$containerWidth === void 0 ? 0 : _ref$containerWidth,
|
|
116
|
+
fullWidthMode = _ref.fullWidthMode,
|
|
117
|
+
isResized = _ref.isResized,
|
|
118
|
+
layout = _ref.layout,
|
|
119
|
+
pctWidth = _ref.pctWidth,
|
|
120
|
+
width = _ref.width;
|
|
154
121
|
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* For nested rich media items, set max-width to 100% */\n tr &,\n [data-layout-column] &,\n [data-node-type='expand'] & {\n max-width: 100%;\n }\n\n width: ", ";\n max-width: ", ";\n float: ", ";\n margin: ", ";\n ", ";\n\n &:not(.is-resizing) {\n transition: width 100ms ease-in;\n }\n"])), pctWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized), calcMaxWidth(layout, containerWidth), float(layout), calcMargin(layout), isImageAligned(layout));
|
|
155
122
|
};
|
|
156
|
-
|
|
157
123
|
exports.MediaSingleDimensionHelper = MediaSingleDimensionHelper;
|
|
158
|
-
|
|
159
124
|
var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
|
|
160
125
|
var hasFallbackContainer = _ref2.hasFallbackContainer,
|
|
161
|
-
|
|
162
|
-
|
|
126
|
+
paddingBottom = _ref2.paddingBottom,
|
|
127
|
+
height = _ref2.height;
|
|
163
128
|
return (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n"])), hasFallbackContainer ? "\n &::after {\n content: '';\n display: block;\n ".concat(height ? "height: ".concat(height, "px;") : paddingBottom ? "padding-bottom: ".concat(paddingBottom, ";") : '', "\n\n /* Fixes extra padding problem in Firefox */\n font-size: 0;\n line-height: 0;\n }\n ") : '');
|
|
164
129
|
};
|
|
165
|
-
|
|
166
130
|
var mediaWrapperStyle = function mediaWrapperStyle(props) {
|
|
167
131
|
return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n\n ", "\n\n /* Editor */\n & > figure {\n position: ", ";\n height: 100%;\n width: 100%;\n }\n\n & > div {\n position: ", ";\n height: 100%;\n width: 100%;\n }\n\n &[data-node-type='embedCard'] > div {\n width: 100%;\n }\n\n /* Renderer */\n [data-node-type='media'] {\n position: static !important;\n\n > div {\n position: absolute;\n height: 100%;\n }\n }\n"])), RenderFallbackContainer(props), props.hasFallbackContainer ? 'absolute' : 'relative', props.hasFallbackContainer ? 'absolute' : 'relative');
|
|
168
132
|
};
|
|
169
|
-
|
|
170
133
|
exports.mediaWrapperStyle = mediaWrapperStyle;
|
|
171
|
-
|
|
172
134
|
var MediaWrapper = function MediaWrapper(_ref3) {
|
|
173
135
|
var children = _ref3.children,
|
|
174
|
-
|
|
136
|
+
rest = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
|
|
175
137
|
return (0, _react2.jsx)("div", {
|
|
176
138
|
css: mediaWrapperStyle(rest)
|
|
177
139
|
}, children);
|
|
178
140
|
};
|
|
179
|
-
|
|
180
141
|
exports.MediaWrapper = MediaWrapper;
|
|
181
142
|
MediaWrapper.displayName = 'WrapperMediaSingle';
|