@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
|
@@ -52,11 +52,9 @@ export var POSITION_ATTRIBUTE_ENUM = {
|
|
|
52
52
|
values: ['top left', 'top center', 'top right', 'right top', 'right middle', 'right bottom', 'bottom left', 'bottom center', 'bottom right', 'left top', 'left middle', 'left bottom'],
|
|
53
53
|
default: 'right middle'
|
|
54
54
|
};
|
|
55
|
-
|
|
56
55
|
function positionToPopper(position) {
|
|
57
56
|
return position && positionMap[position] ? positionMap[position].position : null;
|
|
58
57
|
}
|
|
59
|
-
|
|
60
58
|
export function positionPropToPopperPosition(position) {
|
|
61
59
|
return positionToPopper(position) || positionMap[POSITION_ATTRIBUTE_ENUM.default].position;
|
|
62
60
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import React from 'react';
|
|
5
4
|
import { jsx } from '@emotion/react';
|
|
@@ -15,36 +14,32 @@ export var shouldAddDefaultWrappedWidth = function shouldAddDefaultWrappedWidth(
|
|
|
15
14
|
};
|
|
16
15
|
export default function MediaSingle(_ref) {
|
|
17
16
|
var layout = _ref.layout,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
17
|
+
width = _ref.width,
|
|
18
|
+
height = _ref.height,
|
|
19
|
+
_ref$containerWidth = _ref.containerWidth,
|
|
20
|
+
containerWidth = _ref$containerWidth === void 0 ? width : _ref$containerWidth,
|
|
21
|
+
_ref$isLoading = _ref.isLoading,
|
|
22
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
23
|
+
pctWidth = _ref.pctWidth,
|
|
24
|
+
className = _ref.className,
|
|
25
|
+
propsChildren = _ref.children,
|
|
26
|
+
_ref$nodeType = _ref.nodeType,
|
|
27
|
+
nodeType = _ref$nodeType === void 0 ? 'mediaSingle' : _ref$nodeType,
|
|
28
|
+
fullWidthMode = _ref.fullWidthMode,
|
|
29
|
+
lineLength = _ref.lineLength,
|
|
30
|
+
_ref$hasFallbackConta = _ref.hasFallbackContainer,
|
|
31
|
+
hasFallbackContainer = _ref$hasFallbackConta === void 0 ? true : _ref$hasFallbackConta,
|
|
32
|
+
handleMediaSingleRef = _ref.handleMediaSingleRef;
|
|
34
33
|
var children = React.Children.toArray(propsChildren);
|
|
35
|
-
|
|
36
34
|
if (!pctWidth && shouldAddDefaultWrappedWidth(layout, width, lineLength)) {
|
|
37
35
|
pctWidth = 50;
|
|
38
|
-
}
|
|
36
|
+
}
|
|
37
|
+
// When width is not set we have an absolute height for a given embed.
|
|
39
38
|
// When both width and height are set we use them to determine ratio and use that to define
|
|
40
39
|
// embed height in relation to whatever width of an dom element is in runtime
|
|
41
|
-
|
|
42
|
-
|
|
43
40
|
var isHeightOnly = width === undefined;
|
|
44
|
-
|
|
45
41
|
if (pctWidth) {
|
|
46
42
|
var pxWidth = Math.ceil(calcPxFromPct(pctWidth / 100, lineLength || containerWidth || 0));
|
|
47
|
-
|
|
48
43
|
if (isHeightOnly) {
|
|
49
44
|
width = pxWidth - akEditorMediaResizeHandlerPaddingWide;
|
|
50
45
|
} else if (width !== undefined) {
|
|
@@ -53,37 +48,35 @@ export default function MediaSingle(_ref) {
|
|
|
53
48
|
}
|
|
54
49
|
} else if (isHeightOnly) {
|
|
55
50
|
// No pctWidth can be found on already existing pages with existing embeds
|
|
51
|
+
|
|
56
52
|
// It's ok to use Embed specific width, because width can be not set only in embed card.
|
|
57
53
|
// This value will be used only in the case of non `wide` and non `full-width` cases inside MediaSingleDimensionHelper.
|
|
58
54
|
width = DEFAULT_EMBED_CARD_WIDTH - akEditorMediaResizeHandlerPaddingWide;
|
|
59
|
-
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Media wrapper controls the height of the box.
|
|
60
58
|
// We can define this height
|
|
61
59
|
// - via height directly
|
|
62
60
|
// - via paddingBottom (if we have both height and width) which is a css trick to represent a ratio
|
|
63
|
-
|
|
64
|
-
|
|
65
61
|
var mediaWrapperHeight;
|
|
66
62
|
var paddingBottom;
|
|
67
|
-
|
|
68
63
|
if (isHeightOnly) {
|
|
69
64
|
mediaWrapperHeight = height;
|
|
70
65
|
} else if (width !== undefined) {
|
|
71
66
|
var mediaWrapperRatio = height / width * 100;
|
|
72
67
|
paddingBottom = "".concat(mediaWrapperRatio.toFixed(3), "%");
|
|
73
|
-
|
|
74
68
|
if (nodeType === 'embedCard') {
|
|
75
69
|
// we want to set ratio of whole box (including header) buy knowing ratio of iframe itself
|
|
70
|
+
|
|
76
71
|
// For some reason importing `embedHeaderHeight` from '@atlaskit/smart-card' breaks
|
|
77
72
|
// packages/editor/editor-core/src/plugins/table/__tests__/unit/toolbar.ts 🤷️, but we have a test
|
|
78
73
|
// that uses imported value, so it's should be good.
|
|
79
74
|
paddingBottom = "calc(".concat(paddingBottom, " + 32px)");
|
|
80
75
|
}
|
|
81
76
|
}
|
|
82
|
-
|
|
83
77
|
var _children = _slicedToArray(children, 2),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
78
|
+
media = _children[0],
|
|
79
|
+
caption = _children[1];
|
|
87
80
|
return jsx("div", {
|
|
88
81
|
ref: handleMediaSingleRef,
|
|
89
82
|
css: MediaSingleDimensionHelper({
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
2
|
var _templateObject;
|
|
4
|
-
|
|
5
3
|
import { css } from '@emotion/react';
|
|
6
4
|
export var mediaLinkStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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"])));
|
|
@@ -1,35 +1,29 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
var _excluded = ["children"];
|
|
4
|
-
|
|
5
4
|
var _templateObject, _templateObject2, _templateObject3;
|
|
6
|
-
|
|
7
5
|
/** @jsx jsx */
|
|
8
6
|
import React from 'react';
|
|
9
7
|
import { css, jsx } from '@emotion/react';
|
|
10
8
|
import { akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
11
9
|
import { calcBreakoutWidth, calcWideWidth } from '../../utils/breakout';
|
|
12
|
-
|
|
13
10
|
function float(layout) {
|
|
14
11
|
switch (layout) {
|
|
15
12
|
case 'wrap-right':
|
|
16
13
|
return 'right';
|
|
17
|
-
|
|
18
14
|
case 'wrap-left':
|
|
19
15
|
return 'left';
|
|
20
|
-
|
|
21
16
|
default:
|
|
22
17
|
return 'none';
|
|
23
18
|
}
|
|
24
19
|
}
|
|
25
|
-
|
|
26
20
|
function getWidthIfFullWidthMode(width) {
|
|
27
21
|
return width > akEditorFullWidthLayoutWidth ? '100%' : "".concat(width, "px");
|
|
28
22
|
}
|
|
29
|
-
|
|
30
23
|
function getWidthIfDefaultMode(width) {
|
|
31
24
|
return width > akEditorFullPageMaxWidth ? '100%' : "".concat(width, "px");
|
|
32
25
|
}
|
|
26
|
+
|
|
33
27
|
/**
|
|
34
28
|
* Calculates the image width for non-resized images.
|
|
35
29
|
*
|
|
@@ -37,120 +31,98 @@ function getWidthIfDefaultMode(width) {
|
|
|
37
31
|
* then an image in wide or full-width can not be wider than the image's
|
|
38
32
|
* original width.
|
|
39
33
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
34
|
export function calcLegacyWidth(layout, width) {
|
|
43
35
|
var containerWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
44
36
|
var fullWidthMode = arguments.length > 3 ? arguments[3] : undefined;
|
|
45
37
|
var isResized = arguments.length > 4 ? arguments[4] : undefined;
|
|
46
|
-
|
|
47
38
|
switch (layout) {
|
|
48
39
|
case 'align-start':
|
|
49
40
|
case 'align-end':
|
|
50
41
|
case 'wrap-right':
|
|
51
42
|
case 'wrap-left':
|
|
52
43
|
return width > containerWidth / 2 ? 'calc(50% - 12px)' : "".concat(width, "px");
|
|
53
|
-
|
|
54
44
|
case 'wide':
|
|
55
45
|
return calcWideWidth(containerWidth);
|
|
56
|
-
|
|
57
46
|
case 'full-width':
|
|
58
47
|
return calcBreakoutWidth(layout, containerWidth);
|
|
59
|
-
|
|
60
48
|
default:
|
|
61
49
|
return isResized ? "".concat(width, "px") : fullWidthMode ? getWidthIfFullWidthMode(width) : getWidthIfDefaultMode(width);
|
|
62
50
|
}
|
|
63
51
|
}
|
|
52
|
+
|
|
64
53
|
/**
|
|
65
54
|
* Calculates the image width for previously resized images.
|
|
66
55
|
*
|
|
67
56
|
* Wide and full-width images are always that size (960px and 100%); there is
|
|
68
57
|
* no distinction between max-width and width.
|
|
69
58
|
*/
|
|
70
|
-
|
|
71
59
|
export function calcResizedWidth(layout, width) {
|
|
72
60
|
var containerWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
73
|
-
|
|
74
61
|
switch (layout) {
|
|
75
62
|
case 'wide':
|
|
76
63
|
return calcWideWidth(containerWidth);
|
|
77
|
-
|
|
78
64
|
case 'full-width':
|
|
79
65
|
return calcBreakoutWidth(layout, containerWidth);
|
|
80
|
-
|
|
81
66
|
default:
|
|
82
67
|
return "".concat(width, "px");
|
|
83
68
|
}
|
|
84
69
|
}
|
|
85
|
-
|
|
86
70
|
function calcMaxWidth(layout, containerWidth) {
|
|
87
71
|
switch (layout) {
|
|
88
72
|
case 'wide':
|
|
89
73
|
return calcWideWidth(containerWidth);
|
|
90
|
-
|
|
91
74
|
case 'full-width':
|
|
92
75
|
return calcBreakoutWidth(layout, containerWidth);
|
|
93
|
-
|
|
94
76
|
default:
|
|
95
77
|
return '100%';
|
|
96
78
|
}
|
|
97
79
|
}
|
|
98
|
-
|
|
99
80
|
function calcMargin(layout) {
|
|
100
81
|
switch (layout) {
|
|
101
82
|
case 'wrap-right':
|
|
102
83
|
return '12px auto 12px 12px';
|
|
103
|
-
|
|
104
84
|
case 'wrap-left':
|
|
105
85
|
return '12px 12px 12px auto';
|
|
106
|
-
|
|
107
86
|
default:
|
|
108
87
|
return '24px auto';
|
|
109
88
|
}
|
|
110
89
|
}
|
|
111
|
-
|
|
112
90
|
function isImageAligned(layout) {
|
|
113
91
|
switch (layout) {
|
|
114
92
|
case 'align-end':
|
|
115
93
|
return 'margin-right: 0';
|
|
116
|
-
|
|
117
94
|
case 'align-start':
|
|
118
95
|
return 'margin-left: 0';
|
|
119
|
-
|
|
120
96
|
default:
|
|
121
97
|
return '';
|
|
122
98
|
}
|
|
123
99
|
}
|
|
124
|
-
|
|
125
100
|
/**
|
|
126
101
|
* Can't use `.attrs` to handle highly dynamic styles because we are still
|
|
127
102
|
* supporting `styled-components` v1.
|
|
128
103
|
*/
|
|
129
104
|
export var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref) {
|
|
130
105
|
var _ref$containerWidth = _ref.containerWidth,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
106
|
+
containerWidth = _ref$containerWidth === void 0 ? 0 : _ref$containerWidth,
|
|
107
|
+
fullWidthMode = _ref.fullWidthMode,
|
|
108
|
+
isResized = _ref.isResized,
|
|
109
|
+
layout = _ref.layout,
|
|
110
|
+
pctWidth = _ref.pctWidth,
|
|
111
|
+
width = _ref.width;
|
|
137
112
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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));
|
|
138
113
|
};
|
|
139
|
-
|
|
140
114
|
var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
|
|
141
115
|
var hasFallbackContainer = _ref2.hasFallbackContainer,
|
|
142
|
-
|
|
143
|
-
|
|
116
|
+
paddingBottom = _ref2.paddingBottom,
|
|
117
|
+
height = _ref2.height;
|
|
144
118
|
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\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 ") : '');
|
|
145
119
|
};
|
|
146
|
-
|
|
147
120
|
export var mediaWrapperStyle = function mediaWrapperStyle(props) {
|
|
148
121
|
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\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');
|
|
149
122
|
};
|
|
150
123
|
export var MediaWrapper = function MediaWrapper(_ref3) {
|
|
151
124
|
var children = _ref3.children,
|
|
152
|
-
|
|
153
|
-
|
|
125
|
+
rest = _objectWithoutProperties(_ref3, _excluded);
|
|
154
126
|
return jsx("div", {
|
|
155
127
|
css: mediaWrapperStyle(rest)
|
|
156
128
|
}, children);
|
|
@@ -5,35 +5,26 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
|
|
13
10
|
import React, { PureComponent } from 'react';
|
|
14
11
|
import { ProviderFactory, WithProviders } from '../../provider-factory';
|
|
15
12
|
import MentionWithProviders from './mention-with-providers';
|
|
16
|
-
|
|
17
13
|
var Mention = /*#__PURE__*/function (_PureComponent) {
|
|
18
14
|
_inherits(Mention, _PureComponent);
|
|
19
|
-
|
|
20
15
|
var _super = _createSuper(Mention);
|
|
21
|
-
|
|
22
16
|
function Mention(props) {
|
|
23
17
|
var _this;
|
|
24
|
-
|
|
25
18
|
_classCallCheck(this, Mention);
|
|
26
|
-
|
|
27
19
|
_this = _super.call(this, props);
|
|
28
|
-
|
|
29
20
|
_defineProperty(_assertThisInitialized(_this), "renderWithProvider", function (providers) {
|
|
30
21
|
var _this$props = _this.props,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
accessLevel = _this$props.accessLevel,
|
|
23
|
+
eventHandlers = _this$props.eventHandlers,
|
|
24
|
+
id = _this$props.id,
|
|
25
|
+
text = _this$props.text;
|
|
35
26
|
var mentionProvider = providers.mentionProvider,
|
|
36
|
-
|
|
27
|
+
profilecardProvider = providers.profilecardProvider;
|
|
37
28
|
return /*#__PURE__*/React.createElement(MentionWithProviders, {
|
|
38
29
|
id: id,
|
|
39
30
|
text: text,
|
|
@@ -43,11 +34,9 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
|
|
|
43
34
|
profilecardProvider: profilecardProvider
|
|
44
35
|
});
|
|
45
36
|
});
|
|
46
|
-
|
|
47
37
|
_this.providerFactory = props.providers || new ProviderFactory();
|
|
48
38
|
return _this;
|
|
49
39
|
}
|
|
50
|
-
|
|
51
40
|
_createClass(Mention, [{
|
|
52
41
|
key: "componentWillUnmount",
|
|
53
42
|
value: function componentWillUnmount() {
|
|
@@ -67,8 +56,6 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
|
|
|
67
56
|
});
|
|
68
57
|
}
|
|
69
58
|
}]);
|
|
70
|
-
|
|
71
59
|
return Mention;
|
|
72
60
|
}(PureComponent);
|
|
73
|
-
|
|
74
61
|
export { Mention as default };
|
|
@@ -3,15 +3,15 @@ import { ResourcedMention } from '@atlaskit/mention';
|
|
|
3
3
|
import ProfileCardTrigger from '@atlaskit/profilecard/user';
|
|
4
4
|
export default function MentionWithProfileCard(_ref) {
|
|
5
5
|
var id = _ref.id,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
text = _ref.text,
|
|
7
|
+
accessLevel = _ref.accessLevel,
|
|
8
|
+
mentionProvider = _ref.mentionProvider,
|
|
9
|
+
profilecardProvider = _ref.profilecardProvider,
|
|
10
|
+
onClick = _ref.onClick,
|
|
11
|
+
onMouseEnter = _ref.onMouseEnter,
|
|
12
|
+
onMouseLeave = _ref.onMouseLeave;
|
|
13
13
|
var cloudId = profilecardProvider.cloudId,
|
|
14
|
-
|
|
14
|
+
resourceClient = profilecardProvider.resourceClient;
|
|
15
15
|
var actions = useMemo(function () {
|
|
16
16
|
return profilecardProvider.getActions(id, text, accessLevel);
|
|
17
17
|
}, [accessLevel, id, profilecardProvider, text]);
|
|
@@ -6,41 +6,28 @@ 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
|
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); }; }
|
|
11
|
-
|
|
12
10
|
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; } }
|
|
13
|
-
|
|
14
11
|
import React, { PureComponent } from 'react';
|
|
15
12
|
import { ResourcedMention } from '@atlaskit/mention/element';
|
|
16
13
|
import ResourcedMentionWithProfilecard from './mention-with-profilecard';
|
|
17
14
|
var GENERIC_USER_IDS = ['HipChat', 'all', 'here'];
|
|
18
|
-
|
|
19
15
|
var noop = function noop() {};
|
|
20
|
-
|
|
21
16
|
var MentionWithProviders = /*#__PURE__*/function (_PureComponent) {
|
|
22
17
|
_inherits(MentionWithProviders, _PureComponent);
|
|
23
|
-
|
|
24
18
|
var _super = _createSuper(MentionWithProviders);
|
|
25
|
-
|
|
26
19
|
function MentionWithProviders() {
|
|
27
20
|
var _this;
|
|
28
|
-
|
|
29
21
|
_classCallCheck(this, MentionWithProviders);
|
|
30
|
-
|
|
31
22
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
32
23
|
args[_key] = arguments[_key];
|
|
33
24
|
}
|
|
34
|
-
|
|
35
25
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
36
|
-
|
|
37
26
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
38
27
|
profilecardProvider: null
|
|
39
28
|
});
|
|
40
|
-
|
|
41
29
|
return _this;
|
|
42
30
|
}
|
|
43
|
-
|
|
44
31
|
_createClass(MentionWithProviders, [{
|
|
45
32
|
key: "UNSAFE_componentWillMount",
|
|
46
33
|
value: function UNSAFE_componentWillMount() {
|
|
@@ -57,7 +44,6 @@ var MentionWithProviders = /*#__PURE__*/function (_PureComponent) {
|
|
|
57
44
|
key: "updateProfilecardProvider",
|
|
58
45
|
value: function updateProfilecardProvider(props) {
|
|
59
46
|
var _this2 = this;
|
|
60
|
-
|
|
61
47
|
// We are not using async/await here to avoid having an intermediate Promise
|
|
62
48
|
// introduced by the transpiler.
|
|
63
49
|
// This will allow consumer to use a SynchronousPromise.resolve and avoid useless
|
|
@@ -82,11 +68,11 @@ var MentionWithProviders = /*#__PURE__*/function (_PureComponent) {
|
|
|
82
68
|
key: "render",
|
|
83
69
|
value: function render() {
|
|
84
70
|
var _this$props = this.props,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
71
|
+
accessLevel = _this$props.accessLevel,
|
|
72
|
+
eventHandlers = _this$props.eventHandlers,
|
|
73
|
+
id = _this$props.id,
|
|
74
|
+
mentionProvider = _this$props.mentionProvider,
|
|
75
|
+
text = _this$props.text;
|
|
90
76
|
var profilecardProvider = this.state.profilecardProvider;
|
|
91
77
|
var actionHandlers = {};
|
|
92
78
|
['onClick', 'onMouseEnter', 'onMouseLeave'].forEach(function (handler) {
|
|
@@ -102,8 +88,6 @@ var MentionWithProviders = /*#__PURE__*/function (_PureComponent) {
|
|
|
102
88
|
}, actionHandlers));
|
|
103
89
|
}
|
|
104
90
|
}]);
|
|
105
|
-
|
|
106
91
|
return MentionWithProviders;
|
|
107
92
|
}(PureComponent);
|
|
108
|
-
|
|
109
93
|
export { MentionWithProviders as default };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
|
|
3
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
4
|
-
|
|
5
3
|
/** @jsx jsx */
|
|
4
|
+
|
|
6
5
|
import { css, jsx } from '@emotion/react';
|
|
7
6
|
import SuccessIcon from '@atlaskit/icon/glyph/editor/success';
|
|
8
7
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
@@ -11,11 +10,9 @@ import { gridSize } from '@atlaskit/theme/constants';
|
|
|
11
10
|
import { h200 } from '@atlaskit/theme/typography';
|
|
12
11
|
var errorColor = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n"])), "var(--ds-text-danger, ".concat(R400, ")"));
|
|
13
12
|
var validColor = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n"])), "var(--ds-text-success, ".concat(G400, ")"));
|
|
14
|
-
|
|
15
13
|
var messageStyle = function messageStyle(props) {
|
|
16
14
|
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", " font-weight: normal;\n color: ", ";\n margin-top: ", "px;\n display: flex;\n justify-content: baseline;\n"])), h200(props), "var(--ds-text-subtlest, ".concat(N200, ")"), gridSize() / 2);
|
|
17
15
|
};
|
|
18
|
-
|
|
19
16
|
var iconWrapperStyle = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n margin-right: 4px;\n"])));
|
|
20
17
|
export var HelperMessage = function HelperMessage(_ref) {
|
|
21
18
|
var children = _ref.children;
|
|
@@ -6,11 +6,8 @@ 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
|
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); }; }
|
|
11
|
-
|
|
12
10
|
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; } }
|
|
13
|
-
|
|
14
11
|
import React from 'react';
|
|
15
12
|
import { ShadowObserver, shadowObserverClassNames } from './shadowObserver';
|
|
16
13
|
export var shadowClassNames = {
|
|
@@ -20,131 +17,96 @@ export var shadowClassNames = {
|
|
|
20
17
|
export default function overflowShadow(Component, options) {
|
|
21
18
|
return /*#__PURE__*/function (_React$Component) {
|
|
22
19
|
_inherits(OverflowShadow, _React$Component);
|
|
23
|
-
|
|
24
20
|
var _super = _createSuper(OverflowShadow);
|
|
25
|
-
|
|
26
21
|
function OverflowShadow() {
|
|
27
22
|
var _this;
|
|
28
|
-
|
|
29
23
|
_classCallCheck(this, OverflowShadow);
|
|
30
|
-
|
|
31
24
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
32
25
|
args[_key] = arguments[_key];
|
|
33
26
|
}
|
|
34
|
-
|
|
35
27
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
36
|
-
|
|
37
28
|
_defineProperty(_assertThisInitialized(_this), "overflowContainerWidth", 0);
|
|
38
|
-
|
|
39
29
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
40
30
|
showLeftShadow: false,
|
|
41
31
|
showRightShadow: false
|
|
42
32
|
});
|
|
43
|
-
|
|
44
33
|
_defineProperty(_assertThisInitialized(_this), "handleScroll", function (event) {
|
|
45
34
|
if (!_this.overflowContainer || event.target !== _this.overflowContainer || options.useShadowObserver) {
|
|
46
35
|
return;
|
|
47
36
|
}
|
|
48
|
-
|
|
49
37
|
_this.updateShadows();
|
|
50
38
|
});
|
|
51
|
-
|
|
52
39
|
_defineProperty(_assertThisInitialized(_this), "updateShadows", function () {
|
|
53
40
|
if (options.useShadowObserver) {
|
|
54
41
|
return;
|
|
55
42
|
}
|
|
56
|
-
|
|
57
43
|
_this.setState(function (prevState) {
|
|
58
44
|
if (!_this.overflowContainer) {
|
|
59
45
|
return;
|
|
60
46
|
}
|
|
61
|
-
|
|
62
47
|
var diff = _this.calcOverflowDiff();
|
|
63
|
-
|
|
64
48
|
var showRightShadow = diff > 0 && diff > _this.overflowContainer.scrollLeft;
|
|
65
|
-
|
|
66
49
|
var showLeftShadow = _this.showLeftShadow(_this.overflowContainer);
|
|
67
|
-
|
|
68
50
|
if (showLeftShadow !== prevState.showLeftShadow || showRightShadow !== _this.state.showRightShadow) {
|
|
69
51
|
return {
|
|
70
52
|
showLeftShadow: showLeftShadow,
|
|
71
53
|
showRightShadow: showRightShadow
|
|
72
54
|
};
|
|
73
55
|
}
|
|
74
|
-
|
|
75
56
|
return null;
|
|
76
57
|
});
|
|
77
58
|
});
|
|
78
|
-
|
|
79
59
|
_defineProperty(_assertThisInitialized(_this), "showLeftShadow", function (overflowContainer) {
|
|
80
60
|
return !!overflowContainer && overflowContainer.scrollLeft > 0;
|
|
81
61
|
});
|
|
82
|
-
|
|
83
62
|
_defineProperty(_assertThisInitialized(_this), "calcOverflowDiff", function () {
|
|
84
63
|
if (!_this.overflowContainer) {
|
|
85
64
|
return 0;
|
|
86
65
|
}
|
|
87
|
-
|
|
88
66
|
_this.diff = _this.calcScrollableWidth();
|
|
89
67
|
return _this.diff - _this.overflowContainer.offsetWidth;
|
|
90
68
|
});
|
|
91
|
-
|
|
92
69
|
_defineProperty(_assertThisInitialized(_this), "calcScrollableWidth", function () {
|
|
93
70
|
if (!_this.scrollable && _this.overflowContainer) {
|
|
94
71
|
return _this.overflowContainer.scrollWidth;
|
|
95
72
|
}
|
|
96
|
-
|
|
97
73
|
if (!_this.scrollable) {
|
|
98
74
|
return 0;
|
|
99
75
|
}
|
|
100
|
-
|
|
101
76
|
var width = 0;
|
|
102
|
-
|
|
103
77
|
for (var i = 0; i < _this.scrollable.length; i++) {
|
|
104
78
|
var scrollableElement = _this.scrollable[i];
|
|
105
79
|
width += scrollableElement.scrollWidth;
|
|
106
80
|
}
|
|
107
|
-
|
|
108
81
|
return width;
|
|
109
82
|
});
|
|
110
|
-
|
|
111
83
|
_defineProperty(_assertThisInitialized(_this), "handleContainer", function (container) {
|
|
112
84
|
if (!container || _this.container) {
|
|
113
85
|
return;
|
|
114
86
|
}
|
|
115
|
-
|
|
116
87
|
_this.container = container;
|
|
117
88
|
_this.overflowContainer = container.querySelector(options.overflowSelector);
|
|
118
|
-
|
|
119
89
|
if (!_this.overflowContainer) {
|
|
120
90
|
_this.overflowContainer = container;
|
|
121
91
|
}
|
|
122
|
-
|
|
123
92
|
if (options.useShadowObserver) {
|
|
124
93
|
_this.initShadowObserver();
|
|
125
|
-
|
|
126
94
|
return;
|
|
127
95
|
}
|
|
128
|
-
|
|
129
96
|
_this.updateShadows();
|
|
130
|
-
|
|
131
97
|
_this.overflowContainer.addEventListener('scroll', _this.handleScroll);
|
|
132
98
|
});
|
|
133
|
-
|
|
134
99
|
return _this;
|
|
135
100
|
}
|
|
136
|
-
|
|
137
101
|
_createClass(OverflowShadow, [{
|
|
138
102
|
key: "componentWillUnmount",
|
|
139
103
|
value: function componentWillUnmount() {
|
|
140
104
|
if (options.useShadowObserver) {
|
|
141
105
|
return this.shadowObserver && this.shadowObserver.dispose();
|
|
142
106
|
}
|
|
143
|
-
|
|
144
107
|
if (this.overflowContainer) {
|
|
145
108
|
this.overflowContainer.removeEventListener('scroll', this.handleScroll);
|
|
146
109
|
}
|
|
147
|
-
|
|
148
110
|
this.updateShadows();
|
|
149
111
|
}
|
|
150
112
|
}, {
|
|
@@ -158,25 +120,21 @@ export default function overflowShadow(Component, options) {
|
|
|
158
120
|
key: "initShadowObserver",
|
|
159
121
|
value: function initShadowObserver() {
|
|
160
122
|
var _this2 = this;
|
|
161
|
-
|
|
162
123
|
if (this.shadowObserver || !this.overflowContainer) {
|
|
163
124
|
return;
|
|
164
125
|
}
|
|
165
|
-
|
|
166
126
|
this.shadowObserver = new ShadowObserver({
|
|
167
127
|
scrollContainer: this.overflowContainer,
|
|
168
128
|
onUpdateShadows: function onUpdateShadows(shadowStates) {
|
|
169
129
|
_this2.setState(function (prevState) {
|
|
170
130
|
var showLeftShadow = shadowStates.showLeftShadow,
|
|
171
|
-
|
|
172
|
-
|
|
131
|
+
showRightShadow = shadowStates.showRightShadow;
|
|
173
132
|
if (showLeftShadow !== prevState.showLeftShadow || showRightShadow !== prevState.showRightShadow) {
|
|
174
133
|
return {
|
|
175
134
|
showLeftShadow: showLeftShadow,
|
|
176
135
|
showRightShadow: showRightShadow
|
|
177
136
|
};
|
|
178
137
|
}
|
|
179
|
-
|
|
180
138
|
return null;
|
|
181
139
|
});
|
|
182
140
|
}
|
|
@@ -186,8 +144,8 @@ export default function overflowShadow(Component, options) {
|
|
|
186
144
|
key: "render",
|
|
187
145
|
value: function render() {
|
|
188
146
|
var _this$state = this.state,
|
|
189
|
-
|
|
190
|
-
|
|
147
|
+
showLeftShadow = _this$state.showLeftShadow,
|
|
148
|
+
showRightShadow = _this$state.showRightShadow;
|
|
191
149
|
var classNames = [showRightShadow && shadowClassNames.RIGHT_SHADOW, showLeftShadow && shadowClassNames.LEFT_SHADOW, options.useShadowObserver && shadowObserverClassNames.SHADOW_CONTAINER].filter(Boolean).join(' ');
|
|
192
150
|
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
193
151
|
handleRef: this.handleContainer,
|
|
@@ -195,7 +153,6 @@ export default function overflowShadow(Component, options) {
|
|
|
195
153
|
}, this.props));
|
|
196
154
|
}
|
|
197
155
|
}]);
|
|
198
|
-
|
|
199
156
|
return OverflowShadow;
|
|
200
157
|
}(React.Component);
|
|
201
158
|
}
|