@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
|
@@ -7,66 +7,47 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
var _excluded = ["handleClickOutside", "handleEnterKeydown", "handleEscapeKeydown", "closeOnTab"];
|
|
10
|
-
|
|
11
10
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
|
-
|
|
13
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
14
|
-
|
|
15
12
|
import React, { PureComponent } from 'react';
|
|
16
13
|
import ReactDOM from 'react-dom';
|
|
17
14
|
import ReactEditorViewContext from './ReactEditorViewContext';
|
|
18
|
-
|
|
19
15
|
var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
|
|
20
16
|
_inherits(WithOutsideClick, _PureComponent);
|
|
21
|
-
|
|
22
17
|
var _super = _createSuper(WithOutsideClick);
|
|
23
|
-
|
|
24
18
|
function WithOutsideClick() {
|
|
25
19
|
var _this;
|
|
26
|
-
|
|
27
20
|
_classCallCheck(this, WithOutsideClick);
|
|
28
|
-
|
|
29
21
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
30
22
|
args[_key] = arguments[_key];
|
|
31
23
|
}
|
|
32
|
-
|
|
33
24
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
34
|
-
|
|
35
25
|
_defineProperty(_assertThisInitialized(_this), "handleClick", function (evt) {
|
|
36
26
|
if (!_this.props.isActiveComponent) {
|
|
37
27
|
return;
|
|
38
28
|
}
|
|
39
|
-
|
|
40
29
|
var domNode = ReactDOM.findDOMNode(_assertThisInitialized(_this)); // eslint-disable-line react/no-find-dom-node
|
|
41
|
-
|
|
42
30
|
if (!domNode || evt.target instanceof Node && !domNode.contains(evt.target)) {
|
|
43
31
|
if (_this.props.handleClickOutside) {
|
|
44
32
|
var _this$props$editorVie;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
33
|
+
_this.props.handleClickOutside(evt);
|
|
34
|
+
//When the menus are closed by clicking outside the focus is set on editor.
|
|
49
35
|
if (!((_this$props$editorVie = _this.props.editorView) !== null && _this$props$editorVie !== void 0 && _this$props$editorVie.hasFocus())) {
|
|
50
36
|
var _this$props$editorVie2;
|
|
51
|
-
|
|
52
37
|
(_this$props$editorVie2 = _this.props.editorView) === null || _this$props$editorVie2 === void 0 ? void 0 : _this$props$editorVie2.focus();
|
|
53
38
|
}
|
|
54
39
|
}
|
|
55
40
|
}
|
|
56
41
|
});
|
|
57
|
-
|
|
58
42
|
_defineProperty(_assertThisInitialized(_this), "handleKeydown", function (evt) {
|
|
59
43
|
if (!_this.props.isActiveComponent) {
|
|
60
44
|
return;
|
|
61
45
|
}
|
|
62
|
-
|
|
63
46
|
if (evt.code === 'Escape' && _this.props.handleEscapeKeydown) {
|
|
64
47
|
evt.preventDefault();
|
|
65
48
|
evt.stopPropagation();
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
49
|
+
_this.props.handleEscapeKeydown(evt);
|
|
50
|
+
//on 'Esc', Focus is handled in 'handleEscapeKeydown'.
|
|
70
51
|
return false;
|
|
71
52
|
} else if (evt.code === 'Enter' && _this.props.handleEnterKeydown) {
|
|
72
53
|
_this.props.handleEnterKeydown(evt);
|
|
@@ -75,20 +56,16 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
|
|
|
75
56
|
_this.props.handleEscapeKeydown(evt);
|
|
76
57
|
}
|
|
77
58
|
});
|
|
78
|
-
|
|
79
59
|
return _this;
|
|
80
60
|
}
|
|
81
|
-
|
|
82
61
|
_createClass(WithOutsideClick, [{
|
|
83
62
|
key: "componentDidMount",
|
|
84
63
|
value: function componentDidMount() {
|
|
85
64
|
if (this.props.handleClickOutside) {
|
|
86
65
|
document.addEventListener('click', this.handleClick, false);
|
|
87
66
|
}
|
|
88
|
-
|
|
89
67
|
if (this.props.handleEscapeKeydown) {
|
|
90
68
|
var _this$props$editorRef;
|
|
91
|
-
|
|
92
69
|
//Attached event to the menu so that 'ESC' events from the opened menu also will be handled.
|
|
93
70
|
(((_this$props$editorRef = this.props.editorRef) === null || _this$props$editorRef === void 0 ? void 0 : _this$props$editorRef.current) || this.props.targetRef || document).addEventListener('keydown', this.handleKeydown, false);
|
|
94
71
|
}
|
|
@@ -99,10 +76,8 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
|
|
|
99
76
|
if (this.props.handleClickOutside) {
|
|
100
77
|
document.removeEventListener('click', this.handleClick, false);
|
|
101
78
|
}
|
|
102
|
-
|
|
103
79
|
if (this.props.handleEscapeKeydown) {
|
|
104
80
|
var _this$props$editorRef2;
|
|
105
|
-
|
|
106
81
|
(((_this$props$editorRef2 = this.props.editorRef) === null || _this$props$editorRef2 === void 0 ? void 0 : _this$props$editorRef2.current) || this.props.targetRef || document).removeEventListener('keydown', this.handleKeydown, false);
|
|
107
82
|
}
|
|
108
83
|
}
|
|
@@ -112,26 +87,22 @@ var WithOutsideClick = /*#__PURE__*/function (_PureComponent) {
|
|
|
112
87
|
return this.props.children;
|
|
113
88
|
}
|
|
114
89
|
}]);
|
|
115
|
-
|
|
116
90
|
return WithOutsideClick;
|
|
117
91
|
}(PureComponent);
|
|
118
|
-
|
|
119
92
|
function hasIsOpen(props) {
|
|
120
93
|
return 'isOpen' in props;
|
|
121
94
|
}
|
|
122
|
-
|
|
123
95
|
export default function withReactEditorViewOuterListeners(Component) {
|
|
124
96
|
return function (_ref) {
|
|
125
97
|
var handleClickOutside = _ref.handleClickOutside,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
98
|
+
handleEnterKeydown = _ref.handleEnterKeydown,
|
|
99
|
+
handleEscapeKeydown = _ref.handleEscapeKeydown,
|
|
100
|
+
closeOnTab = _ref.closeOnTab,
|
|
101
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
131
102
|
var isActiveComponent = hasIsOpen(props) ? props.isOpen : true;
|
|
132
103
|
return /*#__PURE__*/React.createElement(ReactEditorViewContext.Consumer, null, function (_ref2) {
|
|
133
104
|
var editorView = _ref2.editorView,
|
|
134
|
-
|
|
105
|
+
editorRef = _ref2.editorRef;
|
|
135
106
|
return /*#__PURE__*/React.createElement(WithOutsideClick, {
|
|
136
107
|
editorView: editorView,
|
|
137
108
|
editorRef: editorRef,
|
|
@@ -3,16 +3,12 @@ export var getAnalyticsAppearance = function getAnalyticsAppearance(appearance)
|
|
|
3
3
|
switch (appearance) {
|
|
4
4
|
case 'full-page':
|
|
5
5
|
return EDITOR_APPEARANCE_CONTEXT.FIXED_WIDTH;
|
|
6
|
-
|
|
7
6
|
case 'full-width':
|
|
8
7
|
return EDITOR_APPEARANCE_CONTEXT.FULL_WIDTH;
|
|
9
|
-
|
|
10
8
|
case 'comment':
|
|
11
9
|
return EDITOR_APPEARANCE_CONTEXT.COMMENT;
|
|
12
|
-
|
|
13
10
|
case 'chromeless':
|
|
14
11
|
return EDITOR_APPEARANCE_CONTEXT.CHROMELESS;
|
|
15
|
-
|
|
16
12
|
case 'mobile':
|
|
17
13
|
return EDITOR_APPEARANCE_CONTEXT.MOBILE;
|
|
18
14
|
}
|
|
@@ -21,20 +17,16 @@ export var getAnalyticsEventSeverity = function getAnalyticsEventSeverity(durati
|
|
|
21
17
|
if (duration > normalThreshold && duration <= degradedThreshold) {
|
|
22
18
|
return SEVERITY.DEGRADED;
|
|
23
19
|
}
|
|
24
|
-
|
|
25
20
|
if (duration > degradedThreshold) {
|
|
26
21
|
return SEVERITY.BLOCKING;
|
|
27
22
|
}
|
|
28
|
-
|
|
29
23
|
return SEVERITY.NORMAL;
|
|
30
24
|
};
|
|
31
25
|
export var SEVERITY;
|
|
32
|
-
|
|
33
26
|
(function (SEVERITY) {
|
|
34
27
|
SEVERITY["NORMAL"] = "normal";
|
|
35
28
|
SEVERITY["DEGRADED"] = "degraded";
|
|
36
29
|
SEVERITY["BLOCKING"] = "blocking";
|
|
37
30
|
})(SEVERITY || (SEVERITY = {}));
|
|
38
|
-
|
|
39
31
|
export { UNSUPPORTED_CONTENT_LEVEL_SEVERITY, getUnsupportedContentLevelData, UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS } from './unsupportedContent/get-unsupported-content-level-data';
|
|
40
32
|
export var analyticsEventKey = 'EDITOR_ANALYTICS_EVENT';
|
|
@@ -1,39 +1,35 @@
|
|
|
1
1
|
export var canApplyAnnotationOnRange = function canApplyAnnotationOnRange(rangeSelection, doc, schema) {
|
|
2
2
|
var from = rangeSelection.from,
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
to = rangeSelection.to;
|
|
5
4
|
if (isNaN(from + to) || to - from <= 0 || to < 0 || from < 0) {
|
|
6
5
|
return false;
|
|
7
6
|
}
|
|
8
|
-
|
|
9
7
|
var foundInvalid = false;
|
|
10
8
|
doc.nodesBetween(rangeSelection.from, rangeSelection.to, function (node, _pos, parent) {
|
|
11
9
|
// Special exception for hardBreak nodes
|
|
12
10
|
if (schema.nodes.hardBreak === node.type) {
|
|
13
11
|
return false;
|
|
14
|
-
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// For block elements or text nodes, we want to check
|
|
15
15
|
// if annotations are allowed inside this tree
|
|
16
16
|
// or if we're leaf and not text
|
|
17
|
-
|
|
18
|
-
|
|
19
17
|
if (node.isInline && !node.isText || node.isLeaf && !node.isText || node.isText && !parent.type.allowsMarkType(schema.marks.annotation)) {
|
|
20
18
|
foundInvalid = true;
|
|
21
19
|
return false;
|
|
22
20
|
}
|
|
23
|
-
|
|
24
21
|
return true;
|
|
25
22
|
});
|
|
26
23
|
return !foundInvalid;
|
|
27
24
|
};
|
|
28
25
|
export var getAnnotationIdsFromRange = function getAnnotationIdsFromRange(rangeSelection, doc, schema) {
|
|
29
26
|
var from = rangeSelection.from,
|
|
30
|
-
|
|
27
|
+
to = rangeSelection.to;
|
|
31
28
|
var annotations = new Set();
|
|
32
29
|
doc.nodesBetween(from, to, function (node) {
|
|
33
30
|
if (!node.marks) {
|
|
34
31
|
return true;
|
|
35
32
|
}
|
|
36
|
-
|
|
37
33
|
node.marks.forEach(function (mark) {
|
|
38
34
|
if (mark.type === schema.marks.annotation && mark.attrs) {
|
|
39
35
|
annotations.add(mark.attrs.id);
|
|
@@ -2,12 +2,12 @@ import { akEditorBreakoutPadding, akEditorDefaultLayoutWidth, akEditorFullWidthL
|
|
|
2
2
|
import { mapBreakpointToLayoutMaxWidth } from '../ui/BaseTheme';
|
|
3
3
|
import { getBreakpoint } from '../ui/WidthProvider';
|
|
4
4
|
import { parsePx } from './dom';
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* Variables required to construct a context for breakout ssr inline script.
|
|
7
8
|
*
|
|
8
9
|
* TODO: Clean this up after: https://product-fabric.atlassian.net/browse/ED-8942
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
11
|
var breakoutConsts = {
|
|
12
12
|
padding: akEditorBreakoutPadding,
|
|
13
13
|
defaultLayoutWidth: akEditorDefaultLayoutWidth,
|
|
@@ -16,21 +16,17 @@ var breakoutConsts = {
|
|
|
16
16
|
wideLayoutWidth: akEditorWideLayoutWidth,
|
|
17
17
|
mapBreakpointToLayoutMaxWidth: mapBreakpointToLayoutMaxWidth,
|
|
18
18
|
getBreakpoint: getBreakpoint,
|
|
19
|
-
|
|
20
19
|
/**
|
|
21
20
|
* Consumers are opinionated that this will always return a string ending in
|
|
22
21
|
* `px` when called with `full-width` or `wide` as the layout parameter.
|
|
23
22
|
*/
|
|
24
23
|
calcBreakoutWidth: function calcBreakoutWidth(layout, containerWidth) {
|
|
25
24
|
var effectiveFullWidth = containerWidth - breakoutConsts.padding;
|
|
26
|
-
|
|
27
25
|
switch (layout) {
|
|
28
26
|
case 'full-width':
|
|
29
27
|
return "".concat(Math.min(effectiveFullWidth, breakoutConsts.fullWidthLayoutWidth), "px");
|
|
30
|
-
|
|
31
28
|
case 'wide':
|
|
32
29
|
return breakoutConsts.calcWideWidth(containerWidth);
|
|
33
|
-
|
|
34
30
|
default:
|
|
35
31
|
return '100%';
|
|
36
32
|
}
|
|
@@ -49,21 +45,19 @@ var breakoutConsts = {
|
|
|
49
45
|
}
|
|
50
46
|
};
|
|
51
47
|
export var absoluteBreakoutWidth = function absoluteBreakoutWidth(layout, containerWidth) {
|
|
52
|
-
var breakoutWidth = breakoutConsts.calcBreakoutWidth(layout, containerWidth);
|
|
48
|
+
var breakoutWidth = breakoutConsts.calcBreakoutWidth(layout, containerWidth);
|
|
53
49
|
|
|
50
|
+
// If it's percent, map to max layout size
|
|
54
51
|
if (breakoutWidth.endsWith('%')) {
|
|
55
52
|
switch (layout) {
|
|
56
53
|
case 'full-width':
|
|
57
54
|
return akEditorFullWidthLayoutWidth;
|
|
58
|
-
|
|
59
55
|
case 'wide':
|
|
60
56
|
return akEditorWideLayoutWidth;
|
|
61
|
-
|
|
62
57
|
default:
|
|
63
58
|
return breakoutConsts.mapBreakpointToLayoutMaxWidth(breakoutConsts.getBreakpoint(containerWidth));
|
|
64
59
|
}
|
|
65
60
|
}
|
|
66
|
-
|
|
67
61
|
return parseInt(breakoutWidth, 10);
|
|
68
62
|
};
|
|
69
63
|
export { breakoutConsts };
|
|
@@ -71,11 +65,10 @@ export var calcWideWidth = breakoutConsts.calcWideWidth;
|
|
|
71
65
|
export var calcBreakoutWidth = breakoutConsts.calcBreakoutWidth;
|
|
72
66
|
export function calculateBreakoutStyles(_ref) {
|
|
73
67
|
var mode = _ref.mode,
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
widthStateLineLength = _ref.widthStateLineLength,
|
|
69
|
+
widthStateWidth = _ref.widthStateWidth;
|
|
76
70
|
var breakoutWidth = calcBreakoutWidth(mode, widthStateWidth);
|
|
77
71
|
var breakoutWidthPx = parsePx(breakoutWidth);
|
|
78
|
-
|
|
79
72
|
if (!widthStateLineLength) {
|
|
80
73
|
// lineLength is not normally undefined when this is run for,
|
|
81
74
|
// consumers but can be in SSR, initial render or test (jsdom)
|
|
@@ -91,13 +84,13 @@ export function calculateBreakoutStyles(_ref) {
|
|
|
91
84
|
transform: 'translateX(-50%)',
|
|
92
85
|
marginLeft: '50%'
|
|
93
86
|
};
|
|
94
|
-
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// NOTE
|
|
95
90
|
// At time of writing -- when toggling between full-width and
|
|
96
91
|
// full-page appearance modes. There is a slight delay before
|
|
97
92
|
// the widthState is updated.
|
|
98
93
|
// During this period -- the marginLeftPx will be incorrect.
|
|
99
|
-
|
|
100
|
-
|
|
101
94
|
var marginLeftPx = -(breakoutWidthPx - widthStateLineLength) / 2;
|
|
102
95
|
return {
|
|
103
96
|
type: 'line-length-known',
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
2
|
-
|
|
3
2
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
-
|
|
5
3
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
6
|
-
|
|
7
4
|
var registerDetectors = function registerDetectors(targetExtensions, supportedDetectors) {
|
|
8
5
|
var detectors = supportedDetectors.filter(function (registration) {
|
|
9
6
|
return targetExtensions.includes(registration.name);
|
|
@@ -21,11 +18,11 @@ var registerDetectors = function registerDetectors(targetExtensions, supportedDe
|
|
|
21
18
|
};
|
|
22
19
|
});
|
|
23
20
|
};
|
|
24
|
-
|
|
25
21
|
var RACE_COMPLETE = 'race_complete';
|
|
26
22
|
var SELECTORS = {
|
|
27
23
|
GRAMMARLY: 'grammarly-extension, grammarly-popups, [data-grammarly-shadow-root]'
|
|
28
24
|
};
|
|
25
|
+
|
|
29
26
|
/**
|
|
30
27
|
* This is the official list of supported browser extension detectors. To add support
|
|
31
28
|
* for detecting an additional browser extension, simply add a (DetectorRegistration)
|
|
@@ -49,75 +46,52 @@ var SELECTORS = {
|
|
|
49
46
|
* }
|
|
50
47
|
* ```
|
|
51
48
|
*/
|
|
52
|
-
|
|
53
49
|
var supportedDetectors = [{
|
|
54
50
|
name: 'grammarly',
|
|
55
51
|
fns: {
|
|
56
52
|
sync: function sync() {
|
|
57
53
|
var _document;
|
|
58
|
-
|
|
59
54
|
return Boolean((_document = document) === null || _document === void 0 ? void 0 : _document.querySelector(SELECTORS.GRAMMARLY));
|
|
60
55
|
},
|
|
61
56
|
async: function async(detected, cleanup) {
|
|
62
57
|
var _document2;
|
|
63
|
-
|
|
64
58
|
// First check to see if grammarly already exists on page
|
|
65
59
|
var exists = Boolean((_document2 = document) === null || _document2 === void 0 ? void 0 : _document2.querySelector(SELECTORS.GRAMMARLY));
|
|
66
|
-
|
|
67
60
|
if (exists) {
|
|
68
61
|
detected();
|
|
69
|
-
}
|
|
62
|
+
}
|
|
63
|
+
// Otherwise, setup a mutation observer to observe the page and its children
|
|
70
64
|
// for newly added nodes. Collect observed mutations in a queue and in 1 second
|
|
71
65
|
// intervals either process the queue or schedule the processing task for when
|
|
72
66
|
// the user agent's main thread is idle (if possible).
|
|
73
|
-
|
|
74
|
-
|
|
75
67
|
var queue = [];
|
|
76
|
-
|
|
77
68
|
var processQueue = function processQueue() {
|
|
78
|
-
var
|
|
69
|
+
for (var _i = 0, _queue = queue; _i < _queue.length; _i++) {
|
|
70
|
+
var mutations = _queue[_i];
|
|
71
|
+
var _iterator = _createForOfIteratorHelper(mutations),
|
|
79
72
|
_step;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
var mutation = _step2.value;
|
|
93
|
-
|
|
94
|
-
if ((mutation === null || mutation === void 0 ? void 0 : mutation.type) === 'childList' && mutation !== null && mutation !== void 0 && (_mutation$addedNodes = mutation.addedNodes) !== null && _mutation$addedNodes !== void 0 && _mutation$addedNodes.length) {
|
|
95
|
-
var _exists = Array.from(mutation.addedNodes).some(function (node) {
|
|
96
|
-
var _node$parentElement;
|
|
97
|
-
|
|
98
|
-
return (_node$parentElement = node.parentElement) === null || _node$parentElement === void 0 ? void 0 : _node$parentElement.querySelector(SELECTORS.GRAMMARLY);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
if (_exists) {
|
|
102
|
-
detected();
|
|
103
|
-
}
|
|
73
|
+
try {
|
|
74
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
75
|
+
var _mutation$addedNodes;
|
|
76
|
+
var mutation = _step.value;
|
|
77
|
+
if ((mutation === null || mutation === void 0 ? void 0 : mutation.type) === 'childList' && mutation !== null && mutation !== void 0 && (_mutation$addedNodes = mutation.addedNodes) !== null && _mutation$addedNodes !== void 0 && _mutation$addedNodes.length) {
|
|
78
|
+
var _exists = Array.from(mutation.addedNodes).some(function (node) {
|
|
79
|
+
var _node$parentElement;
|
|
80
|
+
return (_node$parentElement = node.parentElement) === null || _node$parentElement === void 0 ? void 0 : _node$parentElement.querySelector(SELECTORS.GRAMMARLY);
|
|
81
|
+
});
|
|
82
|
+
if (_exists) {
|
|
83
|
+
detected();
|
|
104
84
|
}
|
|
105
85
|
}
|
|
106
|
-
} catch (err) {
|
|
107
|
-
_iterator2.e(err);
|
|
108
|
-
} finally {
|
|
109
|
-
_iterator2.f();
|
|
110
86
|
}
|
|
87
|
+
} catch (err) {
|
|
88
|
+
_iterator.e(err);
|
|
89
|
+
} finally {
|
|
90
|
+
_iterator.f();
|
|
111
91
|
}
|
|
112
|
-
} catch (err) {
|
|
113
|
-
_iterator.e(err);
|
|
114
|
-
} finally {
|
|
115
|
-
_iterator.f();
|
|
116
92
|
}
|
|
117
|
-
|
|
118
93
|
queue = [];
|
|
119
94
|
};
|
|
120
|
-
|
|
121
95
|
var intervalId = setInterval(function () {
|
|
122
96
|
if (typeof window.requestIdleCallback === 'function') {
|
|
123
97
|
window.requestIdleCallback(processQueue);
|
|
@@ -140,6 +114,7 @@ var supportedDetectors = [{
|
|
|
140
114
|
}
|
|
141
115
|
}
|
|
142
116
|
}];
|
|
117
|
+
|
|
143
118
|
/**
|
|
144
119
|
* Call this to return a list (or a Promise of a list) of detected browser extensions.
|
|
145
120
|
*
|
|
@@ -172,10 +147,10 @@ export function sniffUserBrowserExtensions(options) {
|
|
|
172
147
|
try {
|
|
173
148
|
// First we filter out supported extensions that aren't requested through options. We also
|
|
174
149
|
// prepare detector objects with some initial internal state (e.g. detector.state.detected = false)
|
|
175
|
-
var detectors = registerDetectors(options.extensions, supportedDetectors);
|
|
150
|
+
var detectors = registerDetectors(options.extensions, supportedDetectors);
|
|
151
|
+
// If async mode is enabled, we convert the list of detector objects to a list of promises
|
|
176
152
|
// that resolve when the detector invokes detected() during its asynchronous check.
|
|
177
153
|
// We also track any scheduled cleanup() tasks.
|
|
178
|
-
|
|
179
154
|
if (options.async === true) {
|
|
180
155
|
var asyncCleanups = [];
|
|
181
156
|
var asyncDetections = Promise.all(detectors.map(function (detector) {
|
|
@@ -184,11 +159,9 @@ export function sniffUserBrowserExtensions(options) {
|
|
|
184
159
|
detector.state.detected = true;
|
|
185
160
|
resolve();
|
|
186
161
|
};
|
|
187
|
-
|
|
188
162
|
var cleanup = function cleanup(cb) {
|
|
189
163
|
asyncCleanups.push(cb);
|
|
190
164
|
};
|
|
191
|
-
|
|
192
165
|
if (typeof detector.fns.async === 'function') {
|
|
193
166
|
detector.fns.async(detected, cleanup);
|
|
194
167
|
} else {
|
|
@@ -196,10 +169,10 @@ export function sniffUserBrowserExtensions(options) {
|
|
|
196
169
|
resolve();
|
|
197
170
|
}
|
|
198
171
|
});
|
|
199
|
-
}));
|
|
172
|
+
}));
|
|
173
|
+
// We race all asynchronous checkers against a user-defined timeout (asyncTimeoutMs).
|
|
200
174
|
// When asynchronous checks are finalised first,or if the timeout elapses, we return
|
|
201
175
|
// the list of extensions detected up until that point.
|
|
202
|
-
|
|
203
176
|
var globalTimeout = new Promise(function (resolve) {
|
|
204
177
|
return setTimeout(resolve, options.asyncTimeoutMs, RACE_COMPLETE);
|
|
205
178
|
});
|
|
@@ -209,7 +182,8 @@ export function sniffUserBrowserExtensions(options) {
|
|
|
209
182
|
}).map(function (detector) {
|
|
210
183
|
return detector.name;
|
|
211
184
|
});
|
|
212
|
-
})
|
|
185
|
+
})
|
|
186
|
+
// If there are any errors, we fail safely and silently with zero detected extensions.
|
|
213
187
|
.catch(function () {
|
|
214
188
|
return [];
|
|
215
189
|
}).finally(function () {
|
|
@@ -222,7 +196,6 @@ export function sniffUserBrowserExtensions(options) {
|
|
|
222
196
|
// and return a list of extensions whose synchronous checks returned true.
|
|
223
197
|
return detectors.filter(function (detector) {
|
|
224
198
|
var _detector$fns$sync, _detector$fns;
|
|
225
|
-
|
|
226
199
|
return (_detector$fns$sync = (_detector$fns = detector.fns).sync) === null || _detector$fns$sync === void 0 ? void 0 : _detector$fns$sync.call(_detector$fns);
|
|
227
200
|
}).map(function (detector) {
|
|
228
201
|
return detector.name;
|
|
@@ -14,7 +14,6 @@ var result = {
|
|
|
14
14
|
supportsIntersectionObserver: false,
|
|
15
15
|
supportsResizeObserver: false
|
|
16
16
|
};
|
|
17
|
-
|
|
18
17
|
if (typeof navigator !== 'undefined') {
|
|
19
18
|
var ieEdge = /Edge\/(\d+)/.exec(navigator.userAgent);
|
|
20
19
|
var ieUpTo10 = /MSIE \d/.test(navigator.userAgent);
|
|
@@ -34,5 +33,4 @@ if (typeof navigator !== 'undefined') {
|
|
|
34
33
|
result.supportsIntersectionObserver = typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window && 'intersectionRatio' in window.IntersectionObserverEntry.prototype;
|
|
35
34
|
result.supportsResizeObserver = typeof window !== 'undefined' && 'ResizeObserver' in window && 'ResizeObserverEntry' in window;
|
|
36
35
|
}
|
|
37
|
-
|
|
38
36
|
export default result;
|
|
@@ -5,14 +5,11 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
5
5
|
export var Builder = /*#__PURE__*/function () {
|
|
6
6
|
function Builder() {
|
|
7
7
|
_classCallCheck(this, Builder);
|
|
8
|
-
|
|
9
8
|
for (var _len = arguments.length, more = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
10
9
|
more[_key] = arguments[_key];
|
|
11
10
|
}
|
|
12
|
-
|
|
13
11
|
this.data = [].concat(more) || [];
|
|
14
12
|
}
|
|
15
|
-
|
|
16
13
|
_createClass(Builder, [{
|
|
17
14
|
key: "add",
|
|
18
15
|
value: function add(nextOrTuple) {
|
|
@@ -25,6 +22,5 @@ export var Builder = /*#__PURE__*/function () {
|
|
|
25
22
|
nextOrTuple].concat(_toConsumableArray(this.data)));
|
|
26
23
|
}
|
|
27
24
|
}]);
|
|
28
|
-
|
|
29
25
|
return Builder;
|
|
30
26
|
}();
|
package/dist/esm/utils/collab.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
export var getParticipantsCount = function getParticipantsCount(editorState) {
|
|
2
2
|
var _collabEditPlugin$$pa, _collabEditPlugin$$pa2;
|
|
3
|
-
|
|
4
3
|
// TODO: ED-15663
|
|
5
4
|
// Please, do not copy or use this kind of code below
|
|
6
5
|
// @ts-ignore
|
|
7
6
|
if (!editorState || !editorState['collabEditPlugin$']) {
|
|
8
7
|
return 1;
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
var participantsCount = (_collabEditPlugin$$pa = (_collabEditPlugin$$pa2 = editorState['collabEditPlugin$'].participants) === null || _collabEditPlugin$$pa2 === void 0 ? void 0 : _collabEditPlugin$$pa2.size()) !== null && _collabEditPlugin$$pa !== void 0 ? _collabEditPlugin$$pa : 1;
|
|
12
10
|
return participantsCount;
|
|
13
11
|
};
|
|
@@ -21,7 +21,6 @@ export var getKeysAddedRemovedCommon = function getKeysAddedRemovedCommon(object
|
|
|
21
21
|
};
|
|
22
22
|
export var serializeValue = function serializeValue(value) {
|
|
23
23
|
var valueType = _typeof(value);
|
|
24
|
-
|
|
25
24
|
if (value === null) {
|
|
26
25
|
return 'null';
|
|
27
26
|
} else if (value === undefined) {
|
|
@@ -30,7 +29,8 @@ export var serializeValue = function serializeValue(value) {
|
|
|
30
29
|
return value;
|
|
31
30
|
} else if (valueType === 'symbol') {
|
|
32
31
|
return value.toString();
|
|
33
|
-
}
|
|
32
|
+
}
|
|
33
|
+
// Calling toString of function returns whole function text with body.
|
|
34
34
|
// So, just return function with name.
|
|
35
35
|
else if (valueType === 'function') {
|
|
36
36
|
return "function:".concat(value.name);
|
|
@@ -45,23 +45,19 @@ export var getPropsDifference = function getPropsDifference(object1, object2) {
|
|
|
45
45
|
var curDepth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
46
46
|
var maxDepth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;
|
|
47
47
|
var keysToIgnore = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
48
|
-
|
|
49
48
|
var _getKeysAddedRemovedC = getKeysAddedRemovedCommon(object1, object2),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
added = _getKeysAddedRemovedC.added,
|
|
50
|
+
common = _getKeysAddedRemovedC.common,
|
|
51
|
+
removed = _getKeysAddedRemovedC.removed;
|
|
54
52
|
var changed = [];
|
|
55
53
|
common.forEach(function (key) {
|
|
56
54
|
var value1 = object1[key];
|
|
57
55
|
var value2 = object2[key];
|
|
58
|
-
|
|
59
56
|
var value1Type = _typeof(value1);
|
|
57
|
+
var value2Type = _typeof(value2);
|
|
60
58
|
|
|
61
|
-
|
|
59
|
+
// Do comparision only if values doesn't match (or reference to same object in memory).
|
|
62
60
|
// Or if key does not exist in keys to ignore.
|
|
63
|
-
|
|
64
|
-
|
|
65
61
|
if (value1 !== value2 && keysToIgnore.indexOf(key) === -1) {
|
|
66
62
|
// if both key value are objects and not referencing same object in memory.
|
|
67
63
|
// then get recursive difference.
|
|
@@ -100,10 +96,9 @@ export var getPropsDifference = function getPropsDifference(object1, object2) {
|
|
|
100
96
|
};
|
|
101
97
|
export var getShallowPropsDifference = function getShallowPropsDifference(object1, object2) {
|
|
102
98
|
var _getKeysAddedRemovedC2 = getKeysAddedRemovedCommon(object1, object2),
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
99
|
+
added = _getKeysAddedRemovedC2.added,
|
|
100
|
+
common = _getKeysAddedRemovedC2.common,
|
|
101
|
+
removed = _getKeysAddedRemovedC2.removed;
|
|
107
102
|
var changed = common.filter(function (key) {
|
|
108
103
|
return object1[key] !== object2[key];
|
|
109
104
|
});
|