@atlaskit/editor-common 72.2.0 → 72.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/__tests_external__/cases/fundamentals/collection.js +0 -5
- package/dist/cjs/__tests_external__/cases/fundamentals/test-cases/editor-is-present.js +0 -4
- package/dist/cjs/__tests_external__/cases/fundamentals/test-cases/editor-typing.js +0 -8
- package/dist/cjs/__tests_external__/cases/smart-links/index.js +0 -4
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/block/delete.js +1 -8
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/block/edit.js +2 -12
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/block/index.js +0 -6
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/block/insert.js +1 -8
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/embed/delete.js +1 -8
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/embed/edit.js +2 -12
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/embed/index.js +0 -6
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/embed/insert.js +1 -8
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/delete.js +1 -8
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/edit.js +2 -12
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/index.js +0 -7
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/insert.js +1 -8
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/inline/unlink.js +1 -8
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/url/index.js +0 -4
- package/dist/cjs/__tests_external__/cases/smart-links/test-cases/url/insert.js +1 -8
- package/dist/cjs/__tests_external__/index.js +0 -3
- package/dist/cjs/__tests_external__/page-objects/Editor.js +0 -16
- package/dist/cjs/__tests_external__/page-objects/EditorSmartLink.js +0 -29
- package/dist/cjs/__tests_external__/page-objects/Renderer.js +0 -14
- package/dist/cjs/analytics/index.js +0 -1
- package/dist/cjs/analytics/types/enums.js +0 -15
- package/dist/cjs/analytics/types/extension-events.js +0 -4
- package/dist/cjs/analytics/types/format-events.js +0 -3
- package/dist/cjs/analytics/types/general-events.js +0 -7
- package/dist/cjs/analytics/types/index.js +0 -14
- package/dist/cjs/analytics/types/inline-comment-events.js +0 -1
- package/dist/cjs/analytics/types/insert-events.js +0 -7
- package/dist/cjs/analytics/types/list-events.js +0 -3
- package/dist/cjs/analytics/types/node-events.js +0 -3
- package/dist/cjs/analytics/types/substitute-events.js +0 -3
- package/dist/cjs/analytics/types/table-events.js +0 -4
- package/dist/cjs/analytics/types/toolbar-button.js +0 -1
- package/dist/cjs/analytics/types/utils.js +0 -3
- package/dist/cjs/core-utils/index.js +0 -1
- package/dist/cjs/core-utils/inside.js +2 -5
- package/dist/cjs/emoji.js +0 -3
- package/dist/cjs/event-dispatcher/index.js +0 -14
- package/dist/cjs/extensions/combine-extension-providers.js +2 -6
- package/dist/cjs/extensions/default-extension-provider.js +0 -26
- package/dist/cjs/extensions/extension-fields-helpers.js +0 -35
- package/dist/cjs/extensions/extension-handlers.js +0 -27
- package/dist/cjs/extensions/index.js +0 -8
- package/dist/cjs/extensions/manifest-helpers.js +4 -30
- package/dist/cjs/extensions/module-helpers.js +17 -89
- package/dist/cjs/extensions/types/field-definitions.js +1 -10
- package/dist/cjs/extensions/types/index.js +0 -1
- package/dist/cjs/extensions.js +0 -1
- package/dist/cjs/i18n/cs.js +0 -1
- package/dist/cjs/i18n/da.js +0 -1
- package/dist/cjs/i18n/de.js +0 -1
- package/dist/cjs/i18n/en.js +0 -1
- package/dist/cjs/i18n/en_GB.js +0 -1
- package/dist/cjs/i18n/en_ZZ.js +0 -1
- package/dist/cjs/i18n/es.js +0 -1
- package/dist/cjs/i18n/et.js +0 -1
- package/dist/cjs/i18n/fi.js +0 -1
- package/dist/cjs/i18n/fr.js +0 -1
- package/dist/cjs/i18n/hu.js +0 -1
- package/dist/cjs/i18n/index.js +0 -27
- package/dist/cjs/i18n/it.js +0 -1
- package/dist/cjs/i18n/ja.js +0 -1
- package/dist/cjs/i18n/ko.js +0 -1
- package/dist/cjs/i18n/languages.js +0 -1
- package/dist/cjs/i18n/nb.js +0 -1
- package/dist/cjs/i18n/nl.js +0 -1
- package/dist/cjs/i18n/pl.js +0 -1
- package/dist/cjs/i18n/pt_BR.js +0 -1
- package/dist/cjs/i18n/pt_PT.js +0 -1
- package/dist/cjs/i18n/ru.js +0 -1
- package/dist/cjs/i18n/sk.js +0 -1
- package/dist/cjs/i18n/sv.js +0 -1
- package/dist/cjs/i18n/th.js +0 -1
- package/dist/cjs/i18n/tr.js +0 -1
- package/dist/cjs/i18n/uk.js +0 -1
- package/dist/cjs/i18n/vi.js +0 -1
- package/dist/cjs/i18n/zh.js +0 -1
- package/dist/cjs/i18n/zh_TW.js +0 -1
- package/dist/cjs/icons/index.js +0 -11
- package/dist/cjs/icons/shared/PanelErrorIcon.js +0 -7
- package/dist/cjs/icons/shared/PanelInfoIcon.js +0 -7
- package/dist/cjs/icons/shared/PanelNoteIcon.js +0 -7
- package/dist/cjs/icons/shared/PanelSuccessIcon.js +0 -7
- package/dist/cjs/icons/shared/PanelWarningIcon.js +0 -7
- package/dist/cjs/icons/shared/table.js +1 -3
- package/dist/cjs/in-product.js +0 -1
- package/dist/cjs/keymaps/index.js +2 -50
- package/dist/cjs/mention.js +0 -3
- package/dist/cjs/messages/codeBidiWarning.js +0 -2
- package/dist/cjs/messages/codeBlockCopyButton.js +0 -2
- package/dist/cjs/messages/index.js +0 -8
- package/dist/cjs/messages/insert-block.js +0 -2
- package/dist/cjs/messages/link.js +0 -2
- package/dist/cjs/messages/unsupportedContent.js +0 -2
- package/dist/cjs/node-width/index.js +2 -20
- package/dist/cjs/normalize-feature-flags.js +6 -25
- package/dist/cjs/panel.js +0 -1
- package/dist/cjs/provider-factory/context.js +3 -17
- package/dist/cjs/provider-factory/provider-factory.js +0 -19
- package/dist/cjs/provider-factory/with-providers.js +5 -28
- package/dist/cjs/provider-factory.js +0 -4
- package/dist/cjs/provider-helpers/combine-providers.js +3 -33
- package/dist/cjs/provider-helpers/index.js +0 -2
- package/dist/cjs/provider-helpers/promise-helpers.js +3 -15
- package/dist/cjs/react-node-view/index.js +18 -48
- package/dist/cjs/safe-plugin/index.js +1 -14
- package/dist/cjs/selection/gap-cursor/selection.js +8 -44
- package/dist/cjs/selection/gap-cursor/utils/index.js +0 -2
- package/dist/cjs/selection/gap-cursor/utils/is-ignored.js +0 -2
- package/dist/cjs/selection/gap-cursor/utils/is-valid-target-node.js +0 -3
- package/dist/cjs/selection/index.js +0 -4
- package/dist/cjs/selection/types.js +0 -1
- package/dist/cjs/selection/utils.js +0 -12
- package/dist/cjs/styles/index.js +0 -23
- package/dist/cjs/styles/shared/annotation.js +0 -11
- package/dist/cjs/styles/shared/block-marks.js +0 -5
- package/dist/cjs/styles/shared/blockquote.js +0 -7
- package/dist/cjs/styles/shared/code-block.js +0 -11
- package/dist/cjs/styles/shared/code-mark.js +0 -9
- package/dist/cjs/styles/shared/column-layout.js +0 -6
- package/dist/cjs/styles/shared/date.js +0 -5
- package/dist/cjs/styles/shared/emoji.js +0 -2
- package/dist/cjs/styles/shared/extension.js +0 -2
- package/dist/cjs/styles/shared/headings.js +0 -7
- package/dist/cjs/styles/shared/indentation.js +0 -5
- package/dist/cjs/styles/shared/layout.js +0 -2
- package/dist/cjs/styles/shared/link.js +0 -5
- package/dist/cjs/styles/shared/lists.js +2 -21
- package/dist/cjs/styles/shared/media-single.js +0 -5
- package/dist/cjs/styles/shared/panel.js +15 -41
- package/dist/cjs/styles/shared/paragraph.js +0 -6
- package/dist/cjs/styles/shared/rule.js +2 -10
- package/dist/cjs/styles/shared/shadow.js +1 -9
- package/dist/cjs/styles/shared/smart-card.js +0 -3
- package/dist/cjs/styles/shared/table.js +0 -20
- package/dist/cjs/styles/shared/task-decision.js +0 -6
- package/dist/cjs/styles/shared/text-color.js +0 -5
- package/dist/cjs/styles/shared/whitespace.js +0 -5
- package/dist/cjs/transforms/expand.js +7 -16
- package/dist/cjs/transforms/extension.js +2 -7
- package/dist/cjs/transforms/index.js +0 -3
- package/dist/cjs/transforms/layout.js +9 -15
- package/dist/cjs/type-ahead/index.js +0 -3
- package/dist/cjs/types/annotation/emitter.js +0 -11
- package/dist/cjs/types/annotation/index.js +0 -1
- package/dist/cjs/types/index.js +0 -4
- package/dist/cjs/types/toolbar.js +0 -5
- package/dist/cjs/ufo/experience-store.js +0 -24
- package/dist/cjs/ufo/index.js +0 -1
- package/dist/cjs/ui/BaseTheme/index.js +3 -21
- package/dist/cjs/ui/Caption/index.js +5 -29
- package/dist/cjs/ui/Caption/messages.js +0 -2
- package/dist/cjs/ui/DropList/index.js +18 -51
- package/dist/cjs/ui/Emoji/index.js +7 -33
- package/dist/cjs/ui/ErrorBoundary/index.js +0 -22
- package/dist/cjs/ui/Expand/index.js +5 -31
- package/dist/cjs/ui/IntlErrorBoundary/index.js +0 -24
- package/dist/cjs/ui/IntlProviderIfMissingWrapper/index.js +0 -9
- package/dist/cjs/ui/Layer/index.js +16 -46
- package/dist/cjs/ui/Layer/internal/helpers.js +0 -2
- package/dist/cjs/ui/MediaSingle/grid.js +0 -8
- package/dist/cjs/ui/MediaSingle/index.js +26 -44
- package/dist/cjs/ui/MediaSingle/link.js +0 -5
- package/dist/cjs/ui/MediaSingle/styled.js +11 -50
- package/dist/cjs/ui/Mention/index.js +5 -27
- package/dist/cjs/ui/Mention/mention-with-profilecard.js +8 -16
- package/dist/cjs/ui/Mention/mention-with-providers.js +5 -33
- package/dist/cjs/ui/Messages/index.js +0 -18
- package/dist/cjs/ui/OverflowShadow/index.js +3 -48
- package/dist/cjs/ui/OverflowShadow/shadowObserver.js +2 -26
- package/dist/cjs/ui/Popup/index.js +28 -80
- package/dist/cjs/ui/Popup/utils.js +67 -132
- package/dist/cjs/ui/PortalProvider/PortalProviderThemesProvider.js +3 -13
- package/dist/cjs/ui/PortalProvider/index.js +16 -73
- package/dist/cjs/ui/UnsupportedBlock/index.js +5 -29
- package/dist/cjs/ui/UnsupportedInline/index.js +5 -29
- package/dist/cjs/ui/WidthProvider/index.js +1 -31
- package/dist/cjs/ui/WithCreateAnalyticsEvent/index.js +2 -16
- package/dist/cjs/ui/clear-next-sibling-margin-top.js +0 -5
- package/dist/cjs/ui/index.js +0 -23
- package/dist/cjs/ui/unsupported-content-helper.js +0 -5
- package/dist/cjs/ui/with-outer-listeners.js +0 -25
- package/dist/cjs/ui-color/ColorPalette/Color/index.js +12 -40
- package/dist/cjs/ui-color/ColorPalette/Color/styles.js +0 -10
- package/dist/cjs/ui-color/ColorPalette/Palettes/cellBackgroundColorPalette.js +0 -7
- package/dist/cjs/ui-color/ColorPalette/Palettes/common.js +4 -12
- package/dist/cjs/ui-color/ColorPalette/Palettes/getColorMessage.js +0 -3
- package/dist/cjs/ui-color/ColorPalette/Palettes/index.js +0 -1
- package/dist/cjs/ui-color/ColorPalette/Palettes/paletteMessages.js +0 -3
- package/dist/cjs/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +0 -8
- package/dist/cjs/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +0 -10
- package/dist/cjs/ui-color/ColorPalette/Palettes/statusColorPalette.js +0 -7
- package/dist/cjs/ui-color/ColorPalette/Palettes/textColorPalette.js +2 -9
- package/dist/cjs/ui-color/ColorPalette/index.js +16 -38
- package/dist/cjs/ui-color/ColorPalette/styles.js +0 -6
- package/dist/cjs/ui-color/index.js +0 -9
- package/dist/cjs/ui-menu/Dropdown/index.js +14 -38
- package/dist/cjs/ui-menu/DropdownMenu/index.js +23 -75
- package/dist/cjs/ui-menu/MenuArrowKeyNavigationProvider/index.js +16 -49
- package/dist/cjs/ui-menu/ToolbarButton/index.js +23 -46
- package/dist/cjs/ui-menu/ToolbarButton/styles.js +0 -6
- package/dist/cjs/ui-menu/index.js +0 -7
- package/dist/cjs/ui-react/ReactEditorViewContext.js +0 -4
- package/dist/cjs/ui-react/index.js +0 -3
- package/dist/cjs/ui-react/with-react-editor-view-outer-listeners.js +9 -49
- package/dist/cjs/utils/analytics.js +0 -14
- package/dist/cjs/utils/annotation/index.js +5 -13
- package/dist/cjs/utils/breakout.js +7 -23
- package/dist/cjs/utils/browser-extensions.js +28 -56
- package/dist/cjs/utils/browser.js +0 -2
- package/dist/cjs/utils/builder.js +0 -10
- package/dist/cjs/utils/collab.js +0 -4
- package/dist/cjs/utils/compare-props.js +11 -25
- package/dist/cjs/utils/compareNodes.js +7 -53
- package/dist/cjs/utils/compose.js +0 -2
- package/dist/cjs/utils/date.js +4 -25
- package/dist/cjs/utils/dom.js +6 -29
- package/dist/cjs/utils/editor-core-utils.js +8 -33
- package/dist/cjs/utils/error-reporter.js +0 -7
- package/dist/cjs/utils/extension-handler.js +0 -3
- package/dist/cjs/utils/get-performance-options.js +4 -12
- package/dist/cjs/utils/getModeFromTheme.js +0 -1
- package/dist/cjs/utils/imageLoader.js +0 -27
- package/dist/cjs/utils/index.js +0 -40
- package/dist/cjs/utils/is-text-input.js +5 -11
- package/dist/cjs/utils/list.js +3 -13
- package/dist/cjs/utils/macro.js +1 -7
- package/dist/cjs/utils/nodes.js +4 -31
- package/dist/cjs/utils/outdated-browsers.js +0 -10
- package/dist/cjs/utils/performance/hooks/use-component-render-tracking/index.js +4 -14
- package/dist/cjs/utils/performance/is-performance-api-available.js +0 -4
- package/dist/cjs/utils/performance/measure-render.js +1 -11
- package/dist/cjs/utils/performance/measure-tti.js +3 -17
- package/dist/cjs/utils/performance/measure.js +0 -11
- package/dist/cjs/utils/performance/navigation.js +0 -5
- package/dist/cjs/utils/plugin-state-factory.js +3 -11
- package/dist/cjs/utils/profiler/render-count.js +4 -24
- package/dist/cjs/utils/referentiality.js +30 -88
- package/dist/cjs/utils/sendLogs.js +0 -2
- package/dist/cjs/utils/should-force-tracking.js +4 -7
- package/dist/cjs/utils/slice.js +0 -17
- package/dist/cjs/utils/table.js +4 -13
- package/dist/cjs/utils/track-unsupported-content.js +14 -39
- package/dist/cjs/utils/traversor.js +0 -14
- package/dist/cjs/utils/unsupportedContent/get-unsupported-content-level-data.js +5 -21
- package/dist/cjs/utils/validate-using-spec.js +5 -36
- package/dist/cjs/utils/validator.js +26 -188
- package/dist/cjs/validator.js +0 -1
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/with-plugin-state/index.js +7 -55
- package/dist/es2019/__tests_external__/cases/fundamentals/test-cases/editor-typing.js +0 -3
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/block/delete.js +0 -1
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/block/edit.js +0 -2
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/block/insert.js +0 -1
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/embed/delete.js +0 -1
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/embed/edit.js +0 -2
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/embed/insert.js +0 -1
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/inline/delete.js +0 -1
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/inline/edit.js +0 -2
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/inline/insert.js +0 -1
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/inline/unlink.js +0 -1
- package/dist/es2019/__tests_external__/cases/smart-links/test-cases/url/insert.js +0 -1
- package/dist/es2019/__tests_external__/page-objects/Editor.js +0 -4
- package/dist/es2019/__tests_external__/page-objects/EditorSmartLink.js +0 -28
- package/dist/es2019/__tests_external__/page-objects/Renderer.js +0 -2
- package/dist/es2019/analytics/types/enums.js +0 -15
- package/dist/es2019/analytics/types/extension-events.js +2 -3
- package/dist/es2019/analytics/types/format-events.js +0 -3
- package/dist/es2019/analytics/types/general-events.js +0 -7
- package/dist/es2019/analytics/types/inline-comment-events.js +0 -1
- package/dist/es2019/analytics/types/insert-events.js +0 -7
- package/dist/es2019/analytics/types/list-events.js +0 -3
- package/dist/es2019/analytics/types/node-events.js +0 -3
- package/dist/es2019/analytics/types/substitute-events.js +0 -3
- package/dist/es2019/analytics/types/table-events.js +2 -3
- package/dist/es2019/analytics/types/toolbar-button.js +0 -1
- package/dist/es2019/analytics/types/utils.js +0 -3
- package/dist/es2019/event-dispatcher/index.js +1 -12
- package/dist/es2019/extensions/combine-extension-providers.js +0 -5
- package/dist/es2019/extensions/default-extension-provider.js +0 -8
- package/dist/es2019/extensions/extension-fields-helpers.js +4 -10
- package/dist/es2019/extensions/extension-handlers.js +1 -8
- package/dist/es2019/extensions/manifest-helpers.js +2 -7
- package/dist/es2019/extensions/module-helpers.js +10 -43
- package/dist/es2019/extensions/types/field-definitions.js +1 -0
- package/dist/es2019/icons/index.js +1 -3
- package/dist/es2019/icons/shared/PanelErrorIcon.js +0 -2
- package/dist/es2019/icons/shared/PanelInfoIcon.js +0 -2
- package/dist/es2019/icons/shared/PanelNoteIcon.js +0 -2
- package/dist/es2019/icons/shared/PanelSuccessIcon.js +0 -2
- package/dist/es2019/icons/shared/PanelWarningIcon.js +0 -2
- package/dist/es2019/keymaps/index.js +0 -24
- package/dist/es2019/node-width/index.js +3 -14
- package/dist/es2019/normalize-feature-flags.js +1 -11
- package/dist/es2019/provider-factory/context.js +0 -1
- package/dist/es2019/provider-factory/provider-factory.js +0 -25
- package/dist/es2019/provider-factory/with-providers.js +2 -8
- package/dist/es2019/provider-helpers/combine-providers.js +3 -13
- package/dist/es2019/provider-helpers/promise-helpers.js +3 -10
- package/dist/es2019/react-node-view/index.js +10 -34
- package/dist/es2019/safe-plugin/index.js +1 -1
- package/dist/es2019/selection/gap-cursor/selection.js +6 -31
- package/dist/es2019/selection/types.js +0 -1
- package/dist/es2019/selection/utils.js +0 -8
- package/dist/es2019/styles/shared/headings.js +3 -2
- package/dist/es2019/styles/shared/lists.js +0 -8
- package/dist/es2019/styles/shared/panel.js +13 -12
- package/dist/es2019/styles/shared/paragraph.js +2 -1
- package/dist/es2019/styles/shared/rule.js +2 -1
- package/dist/es2019/styles/shared/shadow.js +2 -0
- package/dist/es2019/styles/shared/table.js +1 -5
- package/dist/es2019/transforms/expand.js +3 -3
- package/dist/es2019/transforms/extension.js +3 -4
- package/dist/es2019/transforms/layout.js +9 -10
- package/dist/es2019/type-ahead/index.js +0 -3
- package/dist/es2019/types/annotation/emitter.js +0 -8
- package/dist/es2019/types/index.js +0 -2
- package/dist/es2019/types/toolbar.js +0 -5
- package/dist/es2019/ufo/experience-store.js +0 -25
- package/dist/es2019/ui/BaseTheme/index.js +0 -2
- package/dist/es2019/ui/Caption/index.js +0 -2
- package/dist/es2019/ui/DropList/index.js +9 -25
- package/dist/es2019/ui/Emoji/index.js +0 -11
- package/dist/es2019/ui/ErrorBoundary/index.js +0 -8
- package/dist/es2019/ui/Expand/index.js +2 -10
- package/dist/es2019/ui/IntlErrorBoundary/index.js +0 -8
- package/dist/es2019/ui/IntlProviderIfMissingWrapper/index.js +0 -4
- package/dist/es2019/ui/Layer/index.js +13 -29
- package/dist/es2019/ui/Layer/internal/helpers.js +0 -2
- package/dist/es2019/ui/MediaSingle/index.js +7 -12
- package/dist/es2019/ui/MediaSingle/styled.js +2 -25
- package/dist/es2019/ui/Mention/index.js +0 -5
- package/dist/es2019/ui/Mention/mention-with-providers.js +0 -8
- package/dist/es2019/ui/Messages/index.js +1 -2
- package/dist/es2019/ui/OverflowShadow/index.js +0 -32
- package/dist/es2019/ui/OverflowShadow/shadowObserver.js +0 -14
- package/dist/es2019/ui/Popup/index.js +11 -59
- package/dist/es2019/ui/Popup/utils.js +18 -57
- package/dist/es2019/ui/PortalProvider/PortalProviderThemesProvider.js +2 -1
- package/dist/es2019/ui/PortalProvider/index.js +7 -35
- package/dist/es2019/ui/UnsupportedBlock/index.js +0 -2
- package/dist/es2019/ui/UnsupportedInline/index.js +0 -2
- package/dist/es2019/ui/WidthProvider/index.js +0 -9
- package/dist/es2019/ui/WithCreateAnalyticsEvent/index.js +0 -1
- package/dist/es2019/ui/clear-next-sibling-margin-top.js +2 -1
- package/dist/es2019/ui/unsupported-content-helper.js +0 -4
- package/dist/es2019/ui/with-outer-listeners.js +0 -8
- package/dist/es2019/ui-color/ColorPalette/Color/index.js +0 -10
- package/dist/es2019/ui-color/ColorPalette/Color/styles.js +1 -4
- package/dist/es2019/ui-color/ColorPalette/Palettes/common.js +2 -4
- package/dist/es2019/ui-color/ColorPalette/Palettes/getColorMessage.js +0 -2
- package/dist/es2019/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +5 -3
- package/dist/es2019/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +4 -4
- package/dist/es2019/ui-color/ColorPalette/Palettes/statusColorPalette.js +0 -2
- package/dist/es2019/ui-color/ColorPalette/Palettes/textColorPalette.js +2 -3
- package/dist/es2019/ui-color/ColorPalette/index.js +3 -10
- package/dist/es2019/ui-menu/Dropdown/index.js +0 -7
- package/dist/es2019/ui-menu/DropdownMenu/index.js +1 -21
- package/dist/es2019/ui-menu/MenuArrowKeyNavigationProvider/index.js +8 -31
- package/dist/es2019/ui-menu/ToolbarButton/index.js +2 -6
- package/dist/es2019/ui-react/with-react-editor-view-outer-listeners.js +4 -22
- package/dist/es2019/utils/analytics.js +0 -8
- package/dist/es2019/utils/annotation/index.js +3 -7
- package/dist/es2019/utils/breakout.js +6 -13
- package/dist/es2019/utils/browser-extensions.js +10 -22
- package/dist/es2019/utils/browser.js +0 -2
- package/dist/es2019/utils/builder.js +0 -2
- package/dist/es2019/utils/collab.js +0 -2
- package/dist/es2019/utils/compare-props.js +5 -4
- package/dist/es2019/utils/compareNodes.js +3 -42
- package/dist/es2019/utils/date.js +4 -11
- package/dist/es2019/utils/dom.js +6 -19
- package/dist/es2019/utils/editor-core-utils.js +6 -11
- package/dist/es2019/utils/error-reporter.js +0 -4
- package/dist/es2019/utils/get-performance-options.js +3 -3
- package/dist/es2019/utils/imageLoader.js +0 -11
- package/dist/es2019/utils/is-text-input.js +1 -2
- package/dist/es2019/utils/list.js +3 -7
- package/dist/es2019/utils/macro.js +0 -3
- package/dist/es2019/utils/nodes.js +3 -11
- package/dist/es2019/utils/outdated-browsers.js +0 -8
- package/dist/es2019/utils/performance/hooks/use-component-render-tracking/index.js +0 -4
- package/dist/es2019/utils/performance/is-performance-api-available.js +0 -1
- package/dist/es2019/utils/performance/measure-render.js +2 -10
- package/dist/es2019/utils/performance/measure-tti.js +3 -11
- package/dist/es2019/utils/performance/measure.js +0 -6
- package/dist/es2019/utils/performance/navigation.js +0 -3
- package/dist/es2019/utils/plugin-state-factory.js +1 -10
- package/dist/es2019/utils/profiler/render-count.js +10 -23
- package/dist/es2019/utils/referentiality.js +24 -65
- package/dist/es2019/utils/should-force-tracking.js +2 -1
- package/dist/es2019/utils/slice.js +1 -9
- package/dist/es2019/utils/table.js +2 -6
- package/dist/es2019/utils/track-unsupported-content.js +6 -11
- package/dist/es2019/utils/traversor.js +0 -13
- package/dist/es2019/utils/unsupportedContent/get-unsupported-content-level-data.js +3 -15
- package/dist/es2019/utils/validate-using-spec.js +3 -25
- package/dist/es2019/utils/validator.js +10 -149
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/with-plugin-state/index.js +5 -46
- package/dist/esm/__tests_external__/cases/fundamentals/test-cases/editor-typing.js +0 -3
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/block/delete.js +1 -2
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/block/edit.js +2 -4
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/block/insert.js +1 -2
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/embed/delete.js +1 -2
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/embed/edit.js +2 -4
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/embed/insert.js +1 -2
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/inline/delete.js +1 -2
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/inline/edit.js +2 -4
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/inline/insert.js +1 -2
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/inline/unlink.js +1 -2
- package/dist/esm/__tests_external__/cases/smart-links/test-cases/url/insert.js +1 -2
- package/dist/esm/__tests_external__/page-objects/Editor.js +0 -9
- package/dist/esm/__tests_external__/page-objects/EditorSmartLink.js +0 -23
- package/dist/esm/__tests_external__/page-objects/Renderer.js +0 -8
- package/dist/esm/analytics/types/enums.js +0 -15
- package/dist/esm/analytics/types/extension-events.js +2 -3
- package/dist/esm/analytics/types/format-events.js +0 -3
- package/dist/esm/analytics/types/general-events.js +0 -7
- package/dist/esm/analytics/types/inline-comment-events.js +0 -1
- package/dist/esm/analytics/types/insert-events.js +0 -7
- package/dist/esm/analytics/types/list-events.js +0 -3
- package/dist/esm/analytics/types/node-events.js +0 -3
- package/dist/esm/analytics/types/substitute-events.js +0 -3
- package/dist/esm/analytics/types/table-events.js +2 -3
- package/dist/esm/analytics/types/toolbar-button.js +0 -1
- package/dist/esm/analytics/types/utils.js +0 -3
- package/dist/esm/core-utils/inside.js +2 -2
- package/dist/esm/event-dispatcher/index.js +1 -9
- package/dist/esm/extensions/combine-extension-providers.js +2 -4
- package/dist/esm/extensions/default-extension-provider.js +0 -22
- package/dist/esm/extensions/extension-fields-helpers.js +3 -29
- package/dist/esm/extensions/extension-handlers.js +1 -18
- package/dist/esm/extensions/manifest-helpers.js +4 -17
- package/dist/esm/extensions/module-helpers.js +17 -74
- package/dist/esm/extensions/types/field-definitions.js +1 -0
- package/dist/esm/icons/index.js +1 -3
- package/dist/esm/icons/shared/PanelErrorIcon.js +0 -2
- package/dist/esm/icons/shared/PanelInfoIcon.js +0 -2
- package/dist/esm/icons/shared/PanelNoteIcon.js +0 -2
- package/dist/esm/icons/shared/PanelSuccessIcon.js +0 -2
- package/dist/esm/icons/shared/PanelWarningIcon.js +0 -2
- package/dist/esm/keymaps/index.js +2 -28
- package/dist/esm/node-width/index.js +3 -14
- package/dist/esm/normalize-feature-flags.js +6 -19
- package/dist/esm/provider-factory/context.js +3 -5
- package/dist/esm/provider-factory/provider-factory.js +0 -18
- package/dist/esm/provider-factory/with-providers.js +5 -23
- package/dist/esm/provider-helpers/combine-providers.js +3 -27
- package/dist/esm/provider-helpers/promise-helpers.js +3 -10
- package/dist/esm/react-node-view/index.js +18 -42
- package/dist/esm/safe-plugin/index.js +1 -7
- package/dist/esm/selection/gap-cursor/selection.js +8 -35
- package/dist/esm/selection/types.js +0 -1
- package/dist/esm/selection/utils.js +0 -8
- package/dist/esm/styles/shared/annotation.js +0 -2
- package/dist/esm/styles/shared/block-marks.js +0 -2
- package/dist/esm/styles/shared/blockquote.js +0 -2
- package/dist/esm/styles/shared/code-block.js +0 -2
- package/dist/esm/styles/shared/code-mark.js +0 -2
- package/dist/esm/styles/shared/column-layout.js +0 -2
- package/dist/esm/styles/shared/date.js +0 -2
- package/dist/esm/styles/shared/headings.js +3 -4
- package/dist/esm/styles/shared/indentation.js +0 -2
- package/dist/esm/styles/shared/link.js +0 -2
- package/dist/esm/styles/shared/lists.js +2 -13
- package/dist/esm/styles/shared/media-single.js +0 -2
- package/dist/esm/styles/shared/panel.js +15 -17
- package/dist/esm/styles/shared/paragraph.js +2 -3
- package/dist/esm/styles/shared/rule.js +2 -3
- package/dist/esm/styles/shared/shadow.js +2 -2
- package/dist/esm/styles/shared/table.js +1 -8
- package/dist/esm/styles/shared/task-decision.js +0 -2
- package/dist/esm/styles/shared/text-color.js +0 -2
- package/dist/esm/styles/shared/whitespace.js +0 -2
- package/dist/esm/transforms/expand.js +7 -7
- package/dist/esm/transforms/extension.js +3 -4
- package/dist/esm/transforms/layout.js +9 -10
- package/dist/esm/type-ahead/index.js +0 -3
- package/dist/esm/types/annotation/emitter.js +0 -6
- package/dist/esm/types/index.js +0 -2
- package/dist/esm/types/toolbar.js +0 -5
- package/dist/esm/ufo/experience-store.js +0 -19
- package/dist/esm/ui/BaseTheme/index.js +3 -7
- package/dist/esm/ui/Caption/index.js +5 -14
- package/dist/esm/ui/DropList/index.js +18 -47
- package/dist/esm/ui/Emoji/index.js +7 -26
- package/dist/esm/ui/ErrorBoundary/index.js +0 -14
- package/dist/esm/ui/Expand/index.js +5 -15
- package/dist/esm/ui/IntlErrorBoundary/index.js +0 -16
- package/dist/esm/ui/IntlProviderIfMissingWrapper/index.js +0 -4
- package/dist/esm/ui/Layer/index.js +16 -39
- package/dist/esm/ui/Layer/internal/helpers.js +0 -2
- package/dist/esm/ui/MediaSingle/index.js +25 -32
- package/dist/esm/ui/MediaSingle/link.js +0 -2
- package/dist/esm/ui/MediaSingle/styled.js +11 -39
- package/dist/esm/ui/Mention/index.js +5 -18
- package/dist/esm/ui/Mention/mention-with-profilecard.js +8 -8
- package/dist/esm/ui/Mention/mention-with-providers.js +5 -21
- package/dist/esm/ui/Messages/index.js +1 -4
- package/dist/esm/ui/OverflowShadow/index.js +3 -46
- package/dist/esm/ui/OverflowShadow/shadowObserver.js +2 -27
- package/dist/esm/ui/Popup/index.js +28 -80
- package/dist/esm/ui/Popup/utils.js +67 -123
- package/dist/esm/ui/PortalProvider/PortalProviderThemesProvider.js +3 -3
- package/dist/esm/ui/PortalProvider/index.js +17 -61
- package/dist/esm/ui/UnsupportedBlock/index.js +5 -11
- package/dist/esm/ui/UnsupportedInline/index.js +5 -11
- package/dist/esm/ui/WidthProvider/index.js +1 -17
- package/dist/esm/ui/WithCreateAnalyticsEvent/index.js +2 -10
- package/dist/esm/ui/clear-next-sibling-margin-top.js +2 -3
- package/dist/esm/ui/unsupported-content-helper.js +0 -4
- package/dist/esm/ui/with-outer-listeners.js +0 -15
- package/dist/esm/ui-color/ColorPalette/Color/index.js +12 -27
- package/dist/esm/ui-color/ColorPalette/Color/styles.js +1 -6
- package/dist/esm/ui-color/ColorPalette/Palettes/common.js +5 -7
- package/dist/esm/ui-color/ColorPalette/Palettes/getColorMessage.js +0 -2
- package/dist/esm/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.js +2 -4
- package/dist/esm/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +0 -5
- package/dist/esm/ui-color/ColorPalette/Palettes/statusColorPalette.js +0 -2
- package/dist/esm/ui-color/ColorPalette/Palettes/textColorPalette.js +2 -3
- package/dist/esm/ui-color/ColorPalette/index.js +16 -24
- package/dist/esm/ui-color/ColorPalette/styles.js +0 -2
- package/dist/esm/ui-menu/Dropdown/index.js +14 -27
- package/dist/esm/ui-menu/DropdownMenu/index.js +23 -56
- package/dist/esm/ui-menu/MenuArrowKeyNavigationProvider/index.js +16 -42
- package/dist/esm/ui-menu/ToolbarButton/index.js +23 -32
- package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +9 -38
- package/dist/esm/utils/analytics.js +0 -8
- package/dist/esm/utils/annotation/index.js +5 -9
- package/dist/esm/utils/breakout.js +8 -15
- package/dist/esm/utils/browser-extensions.js +28 -55
- package/dist/esm/utils/browser.js +0 -2
- package/dist/esm/utils/builder.js +0 -4
- package/dist/esm/utils/collab.js +0 -2
- package/dist/esm/utils/compare-props.js +10 -15
- package/dist/esm/utils/compareNodes.js +7 -48
- package/dist/esm/utils/compose.js +0 -1
- package/dist/esm/utils/date.js +4 -11
- package/dist/esm/utils/dom.js +6 -19
- package/dist/esm/utils/editor-core-utils.js +8 -13
- package/dist/esm/utils/error-reporter.js +0 -5
- package/dist/esm/utils/get-performance-options.js +7 -7
- package/dist/esm/utils/imageLoader.js +0 -18
- package/dist/esm/utils/is-text-input.js +5 -6
- package/dist/esm/utils/list.js +3 -7
- package/dist/esm/utils/macro.js +1 -5
- package/dist/esm/utils/nodes.js +5 -13
- package/dist/esm/utils/outdated-browsers.js +0 -8
- package/dist/esm/utils/performance/hooks/use-component-render-tracking/index.js +4 -10
- package/dist/esm/utils/performance/is-performance-api-available.js +0 -1
- package/dist/esm/utils/performance/measure-render.js +2 -9
- package/dist/esm/utils/performance/measure-tti.js +3 -12
- package/dist/esm/utils/performance/measure.js +0 -6
- package/dist/esm/utils/performance/navigation.js +0 -3
- package/dist/esm/utils/plugin-state-factory.js +3 -10
- package/dist/esm/utils/profiler/render-count.js +4 -21
- package/dist/esm/utils/referentiality.js +30 -80
- package/dist/esm/utils/should-force-tracking.js +4 -4
- package/dist/esm/utils/slice.js +1 -10
- package/dist/esm/utils/table.js +4 -8
- package/dist/esm/utils/track-unsupported-content.js +14 -31
- package/dist/esm/utils/traversor.js +0 -13
- package/dist/esm/utils/unsupportedContent/get-unsupported-content-level-data.js +5 -18
- package/dist/esm/utils/validate-using-spec.js +5 -29
- package/dist/esm/utils/validator.js +26 -170
- package/dist/esm/version.json +1 -1
- package/dist/esm/with-plugin-state/index.js +7 -55
- package/package.json +4 -4
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.trackUnsupportedContentTooltipDisplayedFor = exports.fireUnsupportedEvent = exports.findAndTrackUnsupportedContentNodes = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _analytics = require("../analytics");
|
|
13
|
-
|
|
14
10
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
-
|
|
16
11
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
|
-
|
|
18
12
|
var whitelistedAttributes = ['align', 'annotationType', 'extensionKey', 'extensionType', 'layout', 'type', 'localId', 'mode', 'language', 'timestamp', 'state', 'originalWidth', 'originalHeight', 'height', 'width', 'shortName', 'level', 'userType', 'order', 'panelType', 'color', 'style', 'isNumberColumnEnabled', 'colspan', 'rowspan', 'colwidth', 'background'];
|
|
19
|
-
|
|
20
13
|
function concatAncestorHierarchy(node, ancestoryHierarchy) {
|
|
21
|
-
var name = node.type.name;
|
|
22
|
-
|
|
14
|
+
var name = node.type.name;
|
|
15
|
+
// Space concatenator used to reduce analytics payload size
|
|
23
16
|
return ancestoryHierarchy ? "".concat(ancestoryHierarchy, " ").concat(name) : name;
|
|
24
17
|
}
|
|
25
|
-
|
|
26
18
|
var sanitizeMarks = function sanitizeMarks() {
|
|
27
19
|
var marks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
28
20
|
var sanitizedMarks = [];
|
|
@@ -38,7 +30,6 @@ var sanitizeMarks = function sanitizeMarks() {
|
|
|
38
30
|
});
|
|
39
31
|
return sanitizedMarks;
|
|
40
32
|
};
|
|
41
|
-
|
|
42
33
|
var sanitizeAttributes = function sanitizeAttributes() {
|
|
43
34
|
var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
44
35
|
var sanitizedAttrs = Object.assign({}, attrs);
|
|
@@ -49,7 +40,6 @@ var sanitizeAttributes = function sanitizeAttributes() {
|
|
|
49
40
|
});
|
|
50
41
|
return sanitizedAttrs;
|
|
51
42
|
};
|
|
52
|
-
|
|
53
43
|
var trackUnsupportedContentTooltipActionFor = function trackUnsupportedContentTooltipActionFor(action, dispatchAnalyticsEvent, unsupportedContentType, originalNodeType) {
|
|
54
44
|
dispatchAnalyticsEvent({
|
|
55
45
|
action: action,
|
|
@@ -61,28 +51,24 @@ var trackUnsupportedContentTooltipActionFor = function trackUnsupportedContentTo
|
|
|
61
51
|
}
|
|
62
52
|
});
|
|
63
53
|
};
|
|
64
|
-
|
|
65
54
|
var findAndTrackUnsupportedContentNodes = function findAndTrackUnsupportedContentNodes(node, schema, dispatchAnalyticsEvent) {
|
|
66
55
|
var ancestorHierarchy = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
|
|
67
56
|
var nodeType = node.type,
|
|
68
|
-
|
|
57
|
+
nodeMarks = node.marks;
|
|
69
58
|
var _schema$marks = schema.marks,
|
|
70
|
-
|
|
71
|
-
|
|
59
|
+
unsupportedMark = _schema$marks.unsupportedMark,
|
|
60
|
+
unsupportedNodeAttribute = _schema$marks.unsupportedNodeAttribute;
|
|
72
61
|
var _schema$nodes = schema.nodes,
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
unsupportedInline = _schema$nodes.unsupportedInline,
|
|
63
|
+
unsupportedBlock = _schema$nodes.unsupportedBlock;
|
|
75
64
|
var parentType = ancestorHierarchy.split(' ').pop() || '';
|
|
76
|
-
|
|
77
65
|
if (nodeMarks.length) {
|
|
78
66
|
nodeMarks.forEach(function (mark) {
|
|
79
67
|
if (mark.type === unsupportedMark) {
|
|
80
68
|
var _ref = mark.attrs || {},
|
|
81
|
-
|
|
82
|
-
|
|
69
|
+
originalValue = _ref.originalValue;
|
|
83
70
|
var _ref2 = originalValue || {},
|
|
84
|
-
|
|
85
|
-
|
|
71
|
+
type = _ref2.type;
|
|
86
72
|
var unsupportedNode = {
|
|
87
73
|
type: type || '',
|
|
88
74
|
ancestry: ancestorHierarchy,
|
|
@@ -93,8 +79,7 @@ var findAndTrackUnsupportedContentNodes = function findAndTrackUnsupportedConten
|
|
|
93
79
|
fireUnsupportedEvent(dispatchAnalyticsEvent, _analytics.ACTION_SUBJECT_ID.UNSUPPORTED_MARK, unsupportedNode);
|
|
94
80
|
} else if (mark.type === unsupportedNodeAttribute) {
|
|
95
81
|
var _ref3 = mark.attrs || {},
|
|
96
|
-
|
|
97
|
-
|
|
82
|
+
unsupported = _ref3.unsupported;
|
|
98
83
|
var _unsupportedNodeAttribute = {
|
|
99
84
|
type: nodeType.name || '',
|
|
100
85
|
ancestry: ancestorHierarchy,
|
|
@@ -106,20 +91,15 @@ var findAndTrackUnsupportedContentNodes = function findAndTrackUnsupportedConten
|
|
|
106
91
|
}
|
|
107
92
|
});
|
|
108
93
|
}
|
|
109
|
-
|
|
110
94
|
if (nodeType === unsupportedInline || nodeType === unsupportedBlock) {
|
|
111
95
|
var _ref4 = node.attrs || {},
|
|
112
|
-
|
|
113
|
-
|
|
96
|
+
originalValue = _ref4.originalValue;
|
|
114
97
|
var _ref5 = originalValue || [],
|
|
115
|
-
|
|
116
|
-
|
|
98
|
+
marks = _ref5.marks;
|
|
117
99
|
var _ref6 = originalValue || {},
|
|
118
|
-
|
|
119
|
-
|
|
100
|
+
attrs = _ref6.attrs;
|
|
120
101
|
var _ref7 = originalValue || {},
|
|
121
|
-
|
|
122
|
-
|
|
102
|
+
type = _ref7.type;
|
|
123
103
|
var unsupportedNode = {
|
|
124
104
|
type: type || '',
|
|
125
105
|
ancestry: ancestorHierarchy,
|
|
@@ -136,9 +116,7 @@ var findAndTrackUnsupportedContentNodes = function findAndTrackUnsupportedConten
|
|
|
136
116
|
});
|
|
137
117
|
}
|
|
138
118
|
};
|
|
139
|
-
|
|
140
119
|
exports.findAndTrackUnsupportedContentNodes = findAndTrackUnsupportedContentNodes;
|
|
141
|
-
|
|
142
120
|
var fireUnsupportedEvent = function fireUnsupportedEvent(dispatchAnalyticsEvent, actionSubjectId, unsupportedNode, errorCode) {
|
|
143
121
|
var sanitizedAttrs = sanitizeAttributes(unsupportedNode.attrs);
|
|
144
122
|
var sanitizedMarks = sanitizeMarks(unsupportedNode.marks);
|
|
@@ -162,11 +140,8 @@ var fireUnsupportedEvent = function fireUnsupportedEvent(dispatchAnalyticsEvent,
|
|
|
162
140
|
};
|
|
163
141
|
dispatchAnalyticsEvent(payload);
|
|
164
142
|
};
|
|
165
|
-
|
|
166
143
|
exports.fireUnsupportedEvent = fireUnsupportedEvent;
|
|
167
|
-
|
|
168
144
|
var trackUnsupportedContentTooltipDisplayedFor = function trackUnsupportedContentTooltipDisplayedFor(dispatchAnalyticsEvent, unsupportedContentType, originalNodeType) {
|
|
169
145
|
trackUnsupportedContentTooltipActionFor(_analytics.ACTION.UNSUPPORTED_TOOLTIP_VIEWED, dispatchAnalyticsEvent, unsupportedContentType, originalNodeType);
|
|
170
146
|
};
|
|
171
|
-
|
|
172
147
|
exports.trackUnsupportedContentTooltipDisplayedFor = trackUnsupportedContentTooltipDisplayedFor;
|
|
@@ -1,30 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
|
|
16
11
|
var ADFTraversor = /*#__PURE__*/function () {
|
|
17
12
|
function ADFTraversor(doc) {
|
|
18
13
|
(0, _classCallCheck2.default)(this, ADFTraversor);
|
|
19
14
|
(0, _defineProperty2.default)(this, "subscribers", new Map());
|
|
20
15
|
this.doc = doc;
|
|
21
16
|
}
|
|
22
|
-
|
|
23
17
|
(0, _createClass2.default)(ADFTraversor, [{
|
|
24
18
|
key: "subscribe",
|
|
25
19
|
value: function subscribe(type, callback) {
|
|
26
20
|
var callbacks = this.subscribers.get(type);
|
|
27
|
-
|
|
28
21
|
if (!callbacks) {
|
|
29
22
|
this.subscribers.set(type, [callback]);
|
|
30
23
|
} else {
|
|
@@ -37,22 +30,16 @@ var ADFTraversor = /*#__PURE__*/function () {
|
|
|
37
30
|
if (!this.doc || !Array.isArray(this.doc.content)) {
|
|
38
31
|
return;
|
|
39
32
|
}
|
|
40
|
-
|
|
41
33
|
var candidates = this.doc.content.slice(0);
|
|
42
|
-
|
|
43
34
|
while (candidates.length) {
|
|
44
35
|
var _node = candidates.shift();
|
|
45
|
-
|
|
46
36
|
if (Array.isArray(_node.content)) {
|
|
47
37
|
candidates = candidates.concat(_node.content);
|
|
48
38
|
}
|
|
49
|
-
|
|
50
39
|
var callbacks = this.subscribers.get(_node.type);
|
|
51
|
-
|
|
52
40
|
if (!callbacks) {
|
|
53
41
|
continue;
|
|
54
42
|
}
|
|
55
|
-
|
|
56
43
|
for (var i = 0; i < callbacks.length; i++) {
|
|
57
44
|
callbacks[i](_node);
|
|
58
45
|
}
|
|
@@ -61,6 +48,5 @@ var ADFTraversor = /*#__PURE__*/function () {
|
|
|
61
48
|
}]);
|
|
62
49
|
return ADFTraversor;
|
|
63
50
|
}();
|
|
64
|
-
|
|
65
51
|
var _default = ADFTraversor;
|
|
66
52
|
exports.default = _default;
|
|
@@ -4,43 +4,34 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getUnsupportedContentLevelData = exports.UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS = exports.UNSUPPORTED_CONTENT_LEVEL_SEVERITY = void 0;
|
|
7
|
-
|
|
8
7
|
var _traverse = require("@atlaskit/adf-utils/traverse");
|
|
9
|
-
|
|
10
8
|
var UNSUPPORTED_CONTENT_LEVEL_SEVERITY;
|
|
11
9
|
exports.UNSUPPORTED_CONTENT_LEVEL_SEVERITY = UNSUPPORTED_CONTENT_LEVEL_SEVERITY;
|
|
12
|
-
|
|
13
10
|
(function (UNSUPPORTED_CONTENT_LEVEL_SEVERITY) {
|
|
14
11
|
UNSUPPORTED_CONTENT_LEVEL_SEVERITY["NORMAL"] = "normal";
|
|
15
12
|
UNSUPPORTED_CONTENT_LEVEL_SEVERITY["DEGRADED"] = "degraded";
|
|
16
13
|
UNSUPPORTED_CONTENT_LEVEL_SEVERITY["BLOCKING"] = "blocking";
|
|
17
14
|
})(UNSUPPORTED_CONTENT_LEVEL_SEVERITY || (exports.UNSUPPORTED_CONTENT_LEVEL_SEVERITY = UNSUPPORTED_CONTENT_LEVEL_SEVERITY = {}));
|
|
18
|
-
|
|
19
15
|
var UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS = {
|
|
20
16
|
DEGRADED: 10,
|
|
21
17
|
BLOCKING: 25
|
|
22
18
|
};
|
|
23
19
|
exports.UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS = UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS;
|
|
24
|
-
|
|
25
20
|
var buildUnsupportedContentLevelThresholds = function buildUnsupportedContentLevelThresholds(customThresholds) {
|
|
26
21
|
return {
|
|
27
22
|
degraded: (customThresholds === null || customThresholds === void 0 ? void 0 : customThresholds.degraded) || UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS.DEGRADED,
|
|
28
23
|
blocking: (customThresholds === null || customThresholds === void 0 ? void 0 : customThresholds.blocking) || UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS.BLOCKING
|
|
29
24
|
};
|
|
30
25
|
};
|
|
31
|
-
|
|
32
26
|
var countSupportedUnsupportedNodes = function countSupportedUnsupportedNodes(validDocument) {
|
|
33
27
|
var unsupportedNodes = 0;
|
|
34
28
|
var supportedNodes = 0;
|
|
35
29
|
(0, _traverse.traverse)(validDocument, {
|
|
36
30
|
any: function any(node) {
|
|
37
31
|
var unsupportedNodeTypes = ['unsupportedInline', 'unsupportedBlock', 'confluenceUnsupportedInline', 'confluenceUnsupportedBlock'];
|
|
38
|
-
|
|
39
32
|
if (unsupportedNodeTypes.includes(node.type)) {
|
|
40
33
|
var _node$attrs;
|
|
41
|
-
|
|
42
34
|
var originalNode = (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.originalValue;
|
|
43
|
-
|
|
44
35
|
if (originalNode) {
|
|
45
36
|
// start an independent traversal for the purpose of counting
|
|
46
37
|
// unsupported content nodes (with nested children contributing towards
|
|
@@ -50,10 +41,9 @@ var countSupportedUnsupportedNodes = function countSupportedUnsupportedNodes(val
|
|
|
50
41
|
unsupportedNodes++;
|
|
51
42
|
}
|
|
52
43
|
});
|
|
53
|
-
}
|
|
44
|
+
}
|
|
45
|
+
// force the parent traversal (which is counting supported content nodes)
|
|
54
46
|
// to skip traversal/counting of nested children of the unsupported nodes
|
|
55
|
-
|
|
56
|
-
|
|
57
47
|
return false;
|
|
58
48
|
} else {
|
|
59
49
|
supportedNodes++;
|
|
@@ -65,18 +55,16 @@ var countSupportedUnsupportedNodes = function countSupportedUnsupportedNodes(val
|
|
|
65
55
|
supportedNodes: supportedNodes
|
|
66
56
|
};
|
|
67
57
|
};
|
|
68
|
-
|
|
69
58
|
var mapUnsupportedContentLevelToSeverity = function mapUnsupportedContentLevelToSeverity(unsupportedContentLevelPercent, thresholds) {
|
|
70
59
|
if (thresholds.degraded <= unsupportedContentLevelPercent && unsupportedContentLevelPercent < thresholds.blocking) {
|
|
71
60
|
return UNSUPPORTED_CONTENT_LEVEL_SEVERITY.DEGRADED;
|
|
72
61
|
}
|
|
73
|
-
|
|
74
62
|
if (thresholds.blocking <= unsupportedContentLevelPercent) {
|
|
75
63
|
return UNSUPPORTED_CONTENT_LEVEL_SEVERITY.BLOCKING;
|
|
76
64
|
}
|
|
77
|
-
|
|
78
65
|
return UNSUPPORTED_CONTENT_LEVEL_SEVERITY.NORMAL;
|
|
79
66
|
};
|
|
67
|
+
|
|
80
68
|
/**
|
|
81
69
|
* When given a valid ADF document, this function will return an information
|
|
82
70
|
* object about the level of unsupported content in the document including:
|
|
@@ -104,13 +92,10 @@ var mapUnsupportedContentLevelToSeverity = function mapUnsupportedContentLevelTo
|
|
|
104
92
|
* ```
|
|
105
93
|
*
|
|
106
94
|
*/
|
|
107
|
-
|
|
108
|
-
|
|
109
95
|
var getUnsupportedContentLevelData = function getUnsupportedContentLevelData(validDocument, customThresholds) {
|
|
110
96
|
var _countSupportedUnsupp = countSupportedUnsupportedNodes(validDocument),
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
97
|
+
unsupportedNodes = _countSupportedUnsupp.unsupportedNodes,
|
|
98
|
+
supportedNodes = _countSupportedUnsupp.supportedNodes;
|
|
114
99
|
var thresholds = buildUnsupportedContentLevelThresholds(customThresholds);
|
|
115
100
|
var percentage = Math.round(unsupportedNodes / (unsupportedNodes + supportedNodes) * 100);
|
|
116
101
|
var severity = mapUnsupportedContentLevelToSeverity(percentage, thresholds);
|
|
@@ -123,5 +108,4 @@ var getUnsupportedContentLevelData = function getUnsupportedContentLevelData(val
|
|
|
123
108
|
}
|
|
124
109
|
};
|
|
125
110
|
};
|
|
126
|
-
|
|
127
111
|
exports.getUnsupportedContentLevelData = getUnsupportedContentLevelData;
|
|
@@ -5,31 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.validationErrorHandler = exports.validateADFEntity = exports.UNSUPPORTED_NODE_ATTRIBUTE = void 0;
|
|
7
7
|
exports.wrapWithUnsupported = wrapWithUnsupported;
|
|
8
|
-
|
|
9
8
|
var _validator = require("@atlaskit/adf-utils/validator");
|
|
10
|
-
|
|
11
9
|
var _analytics = require("../analytics");
|
|
12
|
-
|
|
13
10
|
var _trackUnsupportedContent = require("./track-unsupported-content");
|
|
14
|
-
|
|
15
11
|
var UNSUPPORTED_NODE_ATTRIBUTE = 'unsupportedNodeAttribute';
|
|
16
12
|
exports.UNSUPPORTED_NODE_ATTRIBUTE = UNSUPPORTED_NODE_ATTRIBUTE;
|
|
17
|
-
|
|
18
13
|
var errorCallbackFor = function errorCallbackFor(marks, validate, dispatchAnalyticsEvent) {
|
|
19
14
|
return function (entity, error, options) {
|
|
20
15
|
return validationErrorHandler(entity, error, options, marks, validate, dispatchAnalyticsEvent);
|
|
21
16
|
};
|
|
22
17
|
};
|
|
23
|
-
|
|
24
18
|
var validationErrorHandler = function validationErrorHandler(entity, error, options, marks, validate, dispatchAnalyticsEvent) {
|
|
25
19
|
if (entity && entity.type === UNSUPPORTED_NODE_ATTRIBUTE) {
|
|
26
20
|
return entity;
|
|
27
21
|
}
|
|
28
|
-
|
|
29
22
|
if (options.isMark) {
|
|
30
23
|
return wrapWithUnsupported(error.meta, 'mark');
|
|
31
24
|
}
|
|
32
|
-
|
|
33
25
|
if (options.isNodeAttribute) {
|
|
34
26
|
var entityType = entity && entity.type ? entity.type : undefined;
|
|
35
27
|
return {
|
|
@@ -42,25 +34,23 @@ var validationErrorHandler = function validationErrorHandler(entity, error, opti
|
|
|
42
34
|
}
|
|
43
35
|
};
|
|
44
36
|
}
|
|
45
|
-
|
|
46
37
|
if (entity && marks.indexOf(entity.type) > -1) {
|
|
47
38
|
return;
|
|
48
39
|
}
|
|
40
|
+
|
|
49
41
|
/**
|
|
50
42
|
* There's a inconsistency between ProseMirror and ADF.
|
|
51
43
|
* `content` is actually optional in ProseMirror.
|
|
52
44
|
* And, also empty `text` node is not valid.
|
|
53
45
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
46
|
if (error.code === 'MISSING_PROPERTIES' && entity.type === 'paragraph') {
|
|
57
47
|
return {
|
|
58
48
|
type: 'paragraph',
|
|
59
49
|
content: []
|
|
60
50
|
};
|
|
61
|
-
}
|
|
62
|
-
|
|
51
|
+
}
|
|
63
52
|
|
|
53
|
+
// TODO: We can repair missing content like `panel` without a `paragraph`.
|
|
64
54
|
if (error.code === 'INVALID_CONTENT_LENGTH') {
|
|
65
55
|
if (error.meta && options.allowUnsupportedBlock && entity.content) {
|
|
66
56
|
return getEntityForInvalidContentLength(error, entity, validate, marks, dispatchAnalyticsEvent);
|
|
@@ -71,27 +61,20 @@ var validationErrorHandler = function validationErrorHandler(entity, error, opti
|
|
|
71
61
|
}
|
|
72
62
|
}
|
|
73
63
|
}
|
|
74
|
-
|
|
75
64
|
if (options.allowUnsupportedBlock) {
|
|
76
65
|
return wrapWithUnsupported(entity);
|
|
77
66
|
}
|
|
78
|
-
|
|
79
67
|
if (options.allowUnsupportedInline) {
|
|
80
68
|
return wrapWithUnsupported(entity, 'inline');
|
|
81
69
|
}
|
|
82
|
-
|
|
83
70
|
if (dispatchAnalyticsEvent) {
|
|
84
71
|
trackValidationError(dispatchAnalyticsEvent, error, entity);
|
|
85
72
|
}
|
|
86
|
-
|
|
87
73
|
return entity;
|
|
88
74
|
};
|
|
89
|
-
|
|
90
75
|
exports.validationErrorHandler = validationErrorHandler;
|
|
91
|
-
|
|
92
76
|
function getEntityForInvalidContentLength(error, entity, validate, marks, dispatchAnalyticsEvent) {
|
|
93
77
|
var meta = error.meta;
|
|
94
|
-
|
|
95
78
|
if (meta.type === 'maximum') {
|
|
96
79
|
entity.content = entity.content.filter(function (x) {
|
|
97
80
|
return !!x;
|
|
@@ -99,27 +82,22 @@ function getEntityForInvalidContentLength(error, entity, validate, marks, dispat
|
|
|
99
82
|
return index >= meta.requiredLength && child.type !== 'unsupportedBlock' ? wrapWithUnsupported(child) : validate(child, errorCallbackFor(marks, validate, dispatchAnalyticsEvent)).entity;
|
|
100
83
|
});
|
|
101
84
|
}
|
|
102
|
-
|
|
103
85
|
if (meta.type === 'minimum') {
|
|
104
86
|
if (entity.content.length === 0) {
|
|
105
87
|
return wrapWithUnsupported(entity);
|
|
106
88
|
}
|
|
107
|
-
|
|
108
89
|
entity.content = entity.content.filter(function (x) {
|
|
109
90
|
return !!x;
|
|
110
91
|
}).map(function (child) {
|
|
111
92
|
return child.type !== 'unsupportedBlock' ? wrapWithUnsupported(child) : child;
|
|
112
93
|
});
|
|
113
94
|
}
|
|
114
|
-
|
|
115
95
|
return entity;
|
|
116
96
|
}
|
|
117
|
-
|
|
118
97
|
function trackValidationError(dispatchAnalyticsEvent, error, entity) {
|
|
119
98
|
if (!dispatchAnalyticsEvent) {
|
|
120
99
|
return;
|
|
121
100
|
}
|
|
122
|
-
|
|
123
101
|
(0, _trackUnsupportedContent.fireUnsupportedEvent)(dispatchAnalyticsEvent, _analytics.ACTION_SUBJECT_ID.UNSUPPORTED_ERROR, {
|
|
124
102
|
type: entity.type || '',
|
|
125
103
|
ancestry: entity.ancestorHierarchy || '',
|
|
@@ -128,7 +106,6 @@ function trackValidationError(dispatchAnalyticsEvent, error, entity) {
|
|
|
128
106
|
attrs: entity.attrs || {}
|
|
129
107
|
}, error.code);
|
|
130
108
|
}
|
|
131
|
-
|
|
132
109
|
var validateADFEntity = function validateADFEntity(schema, node, dispatchAnalyticsEvent) {
|
|
133
110
|
var nodes = Object.keys(schema.nodes);
|
|
134
111
|
var marks = Object.keys(schema.marks);
|
|
@@ -139,33 +116,25 @@ var validateADFEntity = function validateADFEntity(schema, node, dispatchAnalyti
|
|
|
139
116
|
type: 'doc',
|
|
140
117
|
content: []
|
|
141
118
|
};
|
|
142
|
-
|
|
143
119
|
var _validate = validate(node, errorCallbackFor(marks, validate, dispatchAnalyticsEvent)),
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
120
|
+
_validate$entity = _validate.entity,
|
|
121
|
+
entity = _validate$entity === void 0 ? emptyDoc : _validate$entity;
|
|
147
122
|
return entity;
|
|
148
123
|
};
|
|
149
|
-
|
|
150
124
|
exports.validateADFEntity = validateADFEntity;
|
|
151
|
-
|
|
152
125
|
function wrapWithUnsupported(originalValue) {
|
|
153
126
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'block';
|
|
154
127
|
var unsupportedNodeType;
|
|
155
|
-
|
|
156
128
|
switch (type) {
|
|
157
129
|
case 'inline':
|
|
158
130
|
unsupportedNodeType = 'unsupportedInline';
|
|
159
131
|
break;
|
|
160
|
-
|
|
161
132
|
case 'mark':
|
|
162
133
|
unsupportedNodeType = 'unsupportedMark';
|
|
163
134
|
break;
|
|
164
|
-
|
|
165
135
|
default:
|
|
166
136
|
unsupportedNodeType = 'unsupportedBlock';
|
|
167
137
|
}
|
|
168
|
-
|
|
169
138
|
return {
|
|
170
139
|
type: unsupportedNodeType,
|
|
171
140
|
attrs: {
|