@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
|
@@ -11,11 +11,11 @@ const registerDetectors = (targetExtensions, supportedDetectors) => {
|
|
|
11
11
|
}
|
|
12
12
|
}));
|
|
13
13
|
};
|
|
14
|
-
|
|
15
14
|
const RACE_COMPLETE = 'race_complete';
|
|
16
15
|
const SELECTORS = {
|
|
17
16
|
GRAMMARLY: 'grammarly-extension, grammarly-popups, [data-grammarly-shadow-root]'
|
|
18
17
|
};
|
|
18
|
+
|
|
19
19
|
/**
|
|
20
20
|
* This is the official list of supported browser extension detectors. To add support
|
|
21
21
|
* for detecting an additional browser extension, simply add a (DetectorRegistration)
|
|
@@ -39,53 +39,42 @@ const SELECTORS = {
|
|
|
39
39
|
* }
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
|
-
|
|
43
42
|
const supportedDetectors = [{
|
|
44
43
|
name: 'grammarly',
|
|
45
44
|
fns: {
|
|
46
45
|
sync: () => {
|
|
47
46
|
var _document;
|
|
48
|
-
|
|
49
47
|
return Boolean((_document = document) === null || _document === void 0 ? void 0 : _document.querySelector(SELECTORS.GRAMMARLY));
|
|
50
48
|
},
|
|
51
49
|
async: (detected, cleanup) => {
|
|
52
50
|
var _document2;
|
|
53
|
-
|
|
54
51
|
// First check to see if grammarly already exists on page
|
|
55
52
|
const exists = Boolean((_document2 = document) === null || _document2 === void 0 ? void 0 : _document2.querySelector(SELECTORS.GRAMMARLY));
|
|
56
|
-
|
|
57
53
|
if (exists) {
|
|
58
54
|
detected();
|
|
59
|
-
}
|
|
55
|
+
}
|
|
56
|
+
// Otherwise, setup a mutation observer to observe the page and its children
|
|
60
57
|
// for newly added nodes. Collect observed mutations in a queue and in 1 second
|
|
61
58
|
// intervals either process the queue or schedule the processing task for when
|
|
62
59
|
// the user agent's main thread is idle (if possible).
|
|
63
|
-
|
|
64
|
-
|
|
65
60
|
let queue = [];
|
|
66
|
-
|
|
67
61
|
const processQueue = () => {
|
|
68
62
|
for (const mutations of queue) {
|
|
69
63
|
for (const mutation of mutations) {
|
|
70
64
|
var _mutation$addedNodes;
|
|
71
|
-
|
|
72
65
|
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) {
|
|
73
66
|
const exists = Array.from(mutation.addedNodes).some(node => {
|
|
74
67
|
var _node$parentElement;
|
|
75
|
-
|
|
76
68
|
return (_node$parentElement = node.parentElement) === null || _node$parentElement === void 0 ? void 0 : _node$parentElement.querySelector(SELECTORS.GRAMMARLY);
|
|
77
69
|
});
|
|
78
|
-
|
|
79
70
|
if (exists) {
|
|
80
71
|
detected();
|
|
81
72
|
}
|
|
82
73
|
}
|
|
83
74
|
}
|
|
84
75
|
}
|
|
85
|
-
|
|
86
76
|
queue = [];
|
|
87
77
|
};
|
|
88
|
-
|
|
89
78
|
const intervalId = setInterval(() => {
|
|
90
79
|
if (typeof window.requestIdleCallback === 'function') {
|
|
91
80
|
window.requestIdleCallback(processQueue);
|
|
@@ -108,6 +97,7 @@ const supportedDetectors = [{
|
|
|
108
97
|
}
|
|
109
98
|
}
|
|
110
99
|
}];
|
|
100
|
+
|
|
111
101
|
/**
|
|
112
102
|
* Call this to return a list (or a Promise of a list) of detected browser extensions.
|
|
113
103
|
*
|
|
@@ -140,10 +130,10 @@ export function sniffUserBrowserExtensions(options) {
|
|
|
140
130
|
try {
|
|
141
131
|
// First we filter out supported extensions that aren't requested through options. We also
|
|
142
132
|
// prepare detector objects with some initial internal state (e.g. detector.state.detected = false)
|
|
143
|
-
const detectors = registerDetectors(options.extensions, supportedDetectors);
|
|
133
|
+
const detectors = registerDetectors(options.extensions, supportedDetectors);
|
|
134
|
+
// If async mode is enabled, we convert the list of detector objects to a list of promises
|
|
144
135
|
// that resolve when the detector invokes detected() during its asynchronous check.
|
|
145
136
|
// We also track any scheduled cleanup() tasks.
|
|
146
|
-
|
|
147
137
|
if (options.async === true) {
|
|
148
138
|
const asyncCleanups = [];
|
|
149
139
|
const asyncDetections = Promise.all(detectors.map(detector => {
|
|
@@ -152,11 +142,9 @@ export function sniffUserBrowserExtensions(options) {
|
|
|
152
142
|
detector.state.detected = true;
|
|
153
143
|
resolve();
|
|
154
144
|
};
|
|
155
|
-
|
|
156
145
|
const cleanup = cb => {
|
|
157
146
|
asyncCleanups.push(cb);
|
|
158
147
|
};
|
|
159
|
-
|
|
160
148
|
if (typeof detector.fns.async === 'function') {
|
|
161
149
|
detector.fns.async(detected, cleanup);
|
|
162
150
|
} else {
|
|
@@ -164,21 +152,21 @@ export function sniffUserBrowserExtensions(options) {
|
|
|
164
152
|
resolve();
|
|
165
153
|
}
|
|
166
154
|
});
|
|
167
|
-
}));
|
|
155
|
+
}));
|
|
156
|
+
// We race all asynchronous checkers against a user-defined timeout (asyncTimeoutMs).
|
|
168
157
|
// When asynchronous checks are finalised first,or if the timeout elapses, we return
|
|
169
158
|
// the list of extensions detected up until that point.
|
|
170
|
-
|
|
171
159
|
const globalTimeout = new Promise(resolve => setTimeout(resolve, options.asyncTimeoutMs, RACE_COMPLETE));
|
|
172
160
|
return Promise.race([asyncDetections, globalTimeout]).then(() => {
|
|
173
161
|
return detectors.filter(detector => detector.state.detected).map(detector => detector.name);
|
|
174
|
-
})
|
|
162
|
+
})
|
|
163
|
+
// If there are any errors, we fail safely and silently with zero detected extensions.
|
|
175
164
|
.catch(() => []).finally(() => asyncCleanups.map(cleanup => cleanup()));
|
|
176
165
|
} else {
|
|
177
166
|
// If sync mode, we immediately execute synchronous checks
|
|
178
167
|
// and return a list of extensions whose synchronous checks returned true.
|
|
179
168
|
return detectors.filter(detector => {
|
|
180
169
|
var _detector$fns$sync, _detector$fns;
|
|
181
|
-
|
|
182
170
|
return (_detector$fns$sync = (_detector$fns = detector.fns).sync) === null || _detector$fns$sync === void 0 ? void 0 : _detector$fns$sync.call(_detector$fns);
|
|
183
171
|
}).map(detector => detector.name);
|
|
184
172
|
}
|
|
@@ -14,7 +14,6 @@ const result = {
|
|
|
14
14
|
supportsIntersectionObserver: false,
|
|
15
15
|
supportsResizeObserver: false
|
|
16
16
|
};
|
|
17
|
-
|
|
18
17
|
if (typeof navigator !== 'undefined') {
|
|
19
18
|
const ieEdge = /Edge\/(\d+)/.exec(navigator.userAgent);
|
|
20
19
|
const 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;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
export const 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
|
const 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
|
};
|
|
@@ -14,7 +14,6 @@ export const getKeysAddedRemovedCommon = (object1, object2) => {
|
|
|
14
14
|
};
|
|
15
15
|
export const serializeValue = value => {
|
|
16
16
|
const valueType = typeof value;
|
|
17
|
-
|
|
18
17
|
if (value === null) {
|
|
19
18
|
return 'null';
|
|
20
19
|
} else if (value === undefined) {
|
|
@@ -23,7 +22,8 @@ export const serializeValue = value => {
|
|
|
23
22
|
return value;
|
|
24
23
|
} else if (valueType === 'symbol') {
|
|
25
24
|
return value.toString();
|
|
26
|
-
}
|
|
25
|
+
}
|
|
26
|
+
// Calling toString of function returns whole function text with body.
|
|
27
27
|
// So, just return function with name.
|
|
28
28
|
else if (valueType === 'function') {
|
|
29
29
|
return `function:${value.name}`;
|
|
@@ -45,9 +45,10 @@ export const getPropsDifference = (object1, object2, curDepth = 0, maxDepth = 2,
|
|
|
45
45
|
const value1 = object1[key];
|
|
46
46
|
const value2 = object2[key];
|
|
47
47
|
const value1Type = typeof value1;
|
|
48
|
-
const value2Type = typeof value2;
|
|
49
|
-
// Or if key does not exist in keys to ignore.
|
|
48
|
+
const value2Type = typeof value2;
|
|
50
49
|
|
|
50
|
+
// Do comparision only if values doesn't match (or reference to same object in memory).
|
|
51
|
+
// Or if key does not exist in keys to ignore.
|
|
51
52
|
if (value1 !== value2 && keysToIgnore.indexOf(key) === -1) {
|
|
52
53
|
// if both key value are objects and not referencing same object in memory.
|
|
53
54
|
// then get recursive difference.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SortOrder } from '../types';
|
|
2
2
|
export let ContentType;
|
|
3
|
-
|
|
4
3
|
(function (ContentType) {
|
|
5
4
|
ContentType[ContentType["NUMBER"] = 0] = "NUMBER";
|
|
6
5
|
ContentType[ContentType["TEXT"] = 5] = "TEXT";
|
|
@@ -9,31 +8,26 @@ export let ContentType;
|
|
|
9
8
|
ContentType[ContentType["STATUS"] = 20] = "STATUS";
|
|
10
9
|
ContentType[ContentType["LINK"] = 25] = "LINK";
|
|
11
10
|
})(ContentType || (ContentType = {}));
|
|
12
|
-
|
|
13
11
|
function getLinkMark(node) {
|
|
14
12
|
const [linkMark] = node.marks.filter(mark => mark.type.name === 'link');
|
|
15
13
|
return linkMark || null;
|
|
16
|
-
}
|
|
17
|
-
|
|
14
|
+
}
|
|
18
15
|
|
|
16
|
+
// Source: https://stackoverflow.com/questions/12004808/does-javascript-take-local-decimal-separators-into-account
|
|
19
17
|
function parseLocaleNumber(stringNumber) {
|
|
20
18
|
if (stringNumber.trim() === '') {
|
|
21
19
|
return null;
|
|
22
20
|
}
|
|
23
|
-
|
|
24
21
|
const locale = window.navigator.language;
|
|
25
22
|
const thousandSeparator = Intl.NumberFormat(locale).format(11111).replace(/\p{Number}/gu, '');
|
|
26
23
|
const decimalSeparator = Intl.NumberFormat(locale).format(1.1).replace(/\p{Number}/gu, '');
|
|
27
24
|
const maybeANumber = Number(stringNumber.replace(new RegExp('\\' + thousandSeparator, 'g'), '').replace(new RegExp('\\' + decimalSeparator), '.'));
|
|
28
25
|
const isANumber = !Number.isNaN(maybeANumber);
|
|
29
|
-
|
|
30
26
|
if (!isANumber) {
|
|
31
27
|
return null;
|
|
32
28
|
}
|
|
33
|
-
|
|
34
29
|
return maybeANumber;
|
|
35
30
|
}
|
|
36
|
-
|
|
37
31
|
function extractFirstWordFromString(text) {
|
|
38
32
|
// Firefox is the only browser that doesn't support it
|
|
39
33
|
if (!Intl || !Intl.Segmenter) {
|
|
@@ -44,29 +38,22 @@ function extractFirstWordFromString(text) {
|
|
|
44
38
|
const firstWord = firstEmptySpace !== -1 ? text.substring(0, firstEmptySpace) : text;
|
|
45
39
|
return firstWord;
|
|
46
40
|
}
|
|
47
|
-
|
|
48
41
|
const languageSegment = new Intl.Segmenter(window.navigator.language, {
|
|
49
42
|
granularity: 'word'
|
|
50
43
|
});
|
|
51
44
|
const segmentsIterator = languageSegment.segment(text);
|
|
52
|
-
|
|
53
45
|
if (!segmentsIterator) {
|
|
54
46
|
return text;
|
|
55
47
|
}
|
|
56
|
-
|
|
57
48
|
const segmentsArray = Array.from(segmentsIterator);
|
|
58
|
-
|
|
59
49
|
if (segmentsArray.length === 0) {
|
|
60
50
|
return text;
|
|
61
51
|
}
|
|
62
|
-
|
|
63
52
|
return segmentsArray[0].segment;
|
|
64
53
|
}
|
|
65
|
-
|
|
66
54
|
export function extractMetaFromTextNode(textNode) {
|
|
67
55
|
// treat as a link if contain a link
|
|
68
56
|
const linkMark = getLinkMark(textNode);
|
|
69
|
-
|
|
70
57
|
if (linkMark) {
|
|
71
58
|
const value = textNode.text || '';
|
|
72
59
|
return {
|
|
@@ -74,38 +61,30 @@ export function extractMetaFromTextNode(textNode) {
|
|
|
74
61
|
value
|
|
75
62
|
};
|
|
76
63
|
}
|
|
77
|
-
|
|
78
64
|
const text = textNode.text || '';
|
|
79
65
|
const firstWord = extractFirstWordFromString(text);
|
|
80
66
|
const maybeANumber = parseLocaleNumber(firstWord);
|
|
81
|
-
|
|
82
67
|
if (maybeANumber !== null) {
|
|
83
68
|
return {
|
|
84
69
|
type: ContentType.NUMBER,
|
|
85
70
|
value: maybeANumber
|
|
86
71
|
};
|
|
87
72
|
}
|
|
88
|
-
|
|
89
73
|
return {
|
|
90
74
|
type: ContentType.TEXT,
|
|
91
75
|
value: firstWord
|
|
92
76
|
};
|
|
93
77
|
}
|
|
94
|
-
|
|
95
78
|
function getMetaFromNode(node, options) {
|
|
96
79
|
if (!node) {
|
|
97
80
|
return null;
|
|
98
81
|
}
|
|
99
|
-
|
|
100
82
|
const firstChild = node.firstChild;
|
|
101
|
-
|
|
102
83
|
if (!firstChild) {
|
|
103
84
|
return null;
|
|
104
85
|
}
|
|
105
|
-
|
|
106
86
|
switch (firstChild.type.name) {
|
|
107
87
|
// Text case
|
|
108
|
-
|
|
109
88
|
/*
|
|
110
89
|
Get Meta value from the first child if the cell is of type
|
|
111
90
|
* Heading (Any cell where the text is set to a heading type)
|
|
@@ -116,31 +95,26 @@ function getMetaFromNode(node, options) {
|
|
|
116
95
|
{
|
|
117
96
|
return getMetaFromNode(firstChild, options);
|
|
118
97
|
}
|
|
119
|
-
|
|
120
98
|
case 'inlineCard':
|
|
121
99
|
{
|
|
122
100
|
const attrs = firstChild.attrs;
|
|
123
101
|
const maybeTitle = options.getInlineCardTextFromStore(attrs);
|
|
124
|
-
|
|
125
102
|
if (maybeTitle) {
|
|
126
103
|
return {
|
|
127
104
|
type: ContentType.LINK,
|
|
128
105
|
value: maybeTitle
|
|
129
106
|
};
|
|
130
107
|
}
|
|
131
|
-
|
|
132
108
|
const url = attrs.url;
|
|
133
109
|
return {
|
|
134
110
|
type: ContentType.LINK,
|
|
135
111
|
value: url ? url : ''
|
|
136
112
|
};
|
|
137
113
|
}
|
|
138
|
-
|
|
139
114
|
case 'text':
|
|
140
115
|
{
|
|
141
116
|
return extractMetaFromTextNode(firstChild);
|
|
142
117
|
}
|
|
143
|
-
|
|
144
118
|
case 'status':
|
|
145
119
|
{
|
|
146
120
|
const text = firstChild.attrs.text;
|
|
@@ -149,7 +123,6 @@ function getMetaFromNode(node, options) {
|
|
|
149
123
|
value: text
|
|
150
124
|
};
|
|
151
125
|
}
|
|
152
|
-
|
|
153
126
|
case 'date':
|
|
154
127
|
{
|
|
155
128
|
const timestamp = Number.parseInt(firstChild.attrs.timestamp, 20);
|
|
@@ -158,7 +131,6 @@ function getMetaFromNode(node, options) {
|
|
|
158
131
|
value: timestamp
|
|
159
132
|
};
|
|
160
133
|
}
|
|
161
|
-
|
|
162
134
|
case 'mention':
|
|
163
135
|
{
|
|
164
136
|
// TODO: Check what should be the fallback when mention does not have a text
|
|
@@ -168,25 +140,22 @@ function getMetaFromNode(node, options) {
|
|
|
168
140
|
value: text.toLowerCase()
|
|
169
141
|
};
|
|
170
142
|
}
|
|
171
|
-
|
|
172
143
|
default:
|
|
173
144
|
return null;
|
|
174
145
|
}
|
|
175
146
|
}
|
|
176
|
-
|
|
177
147
|
function compareValue(valueA, valueB) {
|
|
178
148
|
if (valueA === valueB) {
|
|
179
149
|
return 0;
|
|
180
150
|
}
|
|
181
|
-
|
|
182
151
|
if (typeof valueA === 'string' && typeof valueB === 'string') {
|
|
183
152
|
return valueA.localeCompare(valueB, window.navigator.language, {
|
|
184
153
|
caseFirst: 'upper'
|
|
185
154
|
});
|
|
186
155
|
}
|
|
187
|
-
|
|
188
156
|
return valueA > valueB ? 1 : -1;
|
|
189
157
|
}
|
|
158
|
+
|
|
190
159
|
/**
|
|
191
160
|
* Compare 2 prosemirror nodes and check if it's greater, equal or less than the other node
|
|
192
161
|
* based on the sort order.
|
|
@@ -211,8 +180,6 @@ function compareValue(valueA, valueB) {
|
|
|
211
180
|
* If no order is provided the method defaults to Ascending order,
|
|
212
181
|
* like a regular JS sort method.
|
|
213
182
|
*/
|
|
214
|
-
|
|
215
|
-
|
|
216
183
|
export const createCompareNodes = (options, order = SortOrder.ASC) => {
|
|
217
184
|
return (nodeA, nodeB) => {
|
|
218
185
|
const metaNodeA = getMetaFromNode(nodeA, options);
|
|
@@ -221,27 +188,21 @@ export const createCompareNodes = (options, order = SortOrder.ASC) => {
|
|
|
221
188
|
Donot switch the order (Asec or Desc) if either node is null.
|
|
222
189
|
This will ensure that empty cells are always at the bottom during sorting.
|
|
223
190
|
*/
|
|
224
|
-
|
|
225
191
|
if (metaNodeA === null || metaNodeB === null) {
|
|
226
192
|
return compareMetaFromNode(metaNodeA, metaNodeB);
|
|
227
193
|
}
|
|
228
|
-
|
|
229
194
|
return (order === SortOrder.DESC ? -1 : 1) * compareMetaFromNode(metaNodeA, metaNodeB);
|
|
230
195
|
};
|
|
231
196
|
};
|
|
232
|
-
|
|
233
197
|
function compareMetaFromNode(metaNodeA, metaNodeB) {
|
|
234
198
|
if (metaNodeA === metaNodeB) {
|
|
235
199
|
return 0;
|
|
236
200
|
}
|
|
237
|
-
|
|
238
201
|
if (metaNodeA === null || metaNodeB === null) {
|
|
239
202
|
return metaNodeB === null ? -1 : 1;
|
|
240
203
|
}
|
|
241
|
-
|
|
242
204
|
if (metaNodeA.type !== metaNodeB.type) {
|
|
243
205
|
return metaNodeA.type > metaNodeB.type ? 1 : -1;
|
|
244
206
|
}
|
|
245
|
-
|
|
246
207
|
return compareValue(metaNodeA.value, metaNodeB.value);
|
|
247
208
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import differenceInCalendarDays from 'date-fns/differenceInCalendarDays';
|
|
2
2
|
import isBefore from 'date-fns/isBefore';
|
|
3
3
|
var FORMATS;
|
|
4
|
-
|
|
5
4
|
(function (FORMATS) {
|
|
6
5
|
FORMATS["ISO_FORMAT"] = "YYYY-MM-DD";
|
|
7
6
|
FORMATS["CURRENT_YEAR_FORMAT_WITHOUT_YEAR"] = "CURRENT_YEAR_FORMAT_WITHOUT_YEAR";
|
|
8
7
|
FORMATS["LOCALIZED_FORMAT"] = "LOCALIZED_FORMAT";
|
|
9
8
|
})(FORMATS || (FORMATS = {}));
|
|
10
|
-
|
|
11
9
|
export const timestampToUTCDate = timestamp => {
|
|
12
10
|
const date = new Date(Number(timestamp));
|
|
13
11
|
const day = date.getUTCDate();
|
|
@@ -24,25 +22,21 @@ export const todayTimestampInUTC = () => {
|
|
|
24
22
|
const todayInUTC = Date.UTC(today.getFullYear(), today.getMonth(), today.getDate());
|
|
25
23
|
return todayInUTC.toString();
|
|
26
24
|
};
|
|
27
|
-
|
|
28
25
|
const addLeadingZero = val => {
|
|
29
26
|
if (val < 10) {
|
|
30
27
|
return `0${val}`;
|
|
31
28
|
}
|
|
32
|
-
|
|
33
29
|
return val;
|
|
34
30
|
};
|
|
35
|
-
|
|
36
31
|
const capitalizeFirstLetter = str => {
|
|
37
32
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
38
|
-
};
|
|
39
|
-
|
|
33
|
+
};
|
|
40
34
|
|
|
35
|
+
// example: "23 Jan 2018"
|
|
41
36
|
export const timestampToString = (timestamp, intl, pattern) => {
|
|
42
37
|
if (!intl || pattern === FORMATS.ISO_FORMAT) {
|
|
43
38
|
return timestampToIsoFormat(timestamp);
|
|
44
39
|
}
|
|
45
|
-
|
|
46
40
|
const date = new Date(Number(timestamp));
|
|
47
41
|
const showWeekday = pattern === FORMATS.CURRENT_YEAR_FORMAT_WITHOUT_YEAR;
|
|
48
42
|
const showYear = !showWeekday;
|
|
@@ -54,8 +48,9 @@ export const timestampToString = (timestamp, intl, pattern) => {
|
|
|
54
48
|
year: showYear ? 'numeric' : undefined,
|
|
55
49
|
formatMatcher: 'best fit'
|
|
56
50
|
});
|
|
57
|
-
};
|
|
51
|
+
};
|
|
58
52
|
|
|
53
|
+
// example: "2018-01-23"
|
|
59
54
|
export const timestampToIsoFormat = timestamp => {
|
|
60
55
|
const date = new Date(Number(timestamp));
|
|
61
56
|
return `${date.getUTCFullYear()}-${addLeadingZero(date.getUTCMonth() + 1)}-${date.getUTCDate()}`;
|
|
@@ -68,12 +63,10 @@ export const timestampToTaskContext = (timestamp, intl) => {
|
|
|
68
63
|
const givenDate = new Date(Number(timestamp));
|
|
69
64
|
const distance = differenceInCalendarDays(givenDate, curDate);
|
|
70
65
|
const sameYear = givenDate.getUTCFullYear() === curDate.getUTCFullYear();
|
|
71
|
-
|
|
72
66
|
if (intl && [-1, 0, 1].indexOf(distance) > -1) {
|
|
73
67
|
return capitalizeFirstLetter(intl.formatRelativeTime(distance, 'day', {
|
|
74
68
|
numeric: 'auto'
|
|
75
69
|
}));
|
|
76
70
|
}
|
|
77
|
-
|
|
78
71
|
return timestampToString(timestamp, intl, sameYear ? FORMATS.CURRENT_YEAR_FORMAT_WITHOUT_YEAR : FORMATS.LOCALIZED_FORMAT);
|
|
79
72
|
};
|
package/dist/es2019/utils/dom.js
CHANGED
|
@@ -5,18 +5,16 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export function walkUpTreeUntil(element, shouldStop) {
|
|
7
7
|
let rootElement = element;
|
|
8
|
-
|
|
9
8
|
while (rootElement && rootElement.parentElement && !shouldStop(rootElement)) {
|
|
10
9
|
rootElement = rootElement.parentElement;
|
|
11
10
|
}
|
|
12
|
-
|
|
13
11
|
return rootElement;
|
|
14
12
|
}
|
|
13
|
+
|
|
15
14
|
/**
|
|
16
15
|
* Takes all children out from wrapped el and puts them directly inside
|
|
17
16
|
* the parent el, at the wrapped el's position
|
|
18
17
|
*/
|
|
19
|
-
|
|
20
18
|
export function unwrap(parent, wrapped) {
|
|
21
19
|
const docsFragment = document.createDocumentFragment();
|
|
22
20
|
Array.from(wrapped.children).forEach(child => {
|
|
@@ -24,11 +22,11 @@ export function unwrap(parent, wrapped) {
|
|
|
24
22
|
});
|
|
25
23
|
parent.replaceChild(docsFragment, wrapped);
|
|
26
24
|
}
|
|
25
|
+
|
|
27
26
|
/**
|
|
28
27
|
* Walks up DOM removing elements if they are empty until it finds
|
|
29
28
|
* one that is not
|
|
30
29
|
*/
|
|
31
|
-
|
|
32
30
|
export function removeNestedEmptyEls(el) {
|
|
33
31
|
while (el.parentElement && el.childElementCount === 0 && el.textContent === '') {
|
|
34
32
|
const parentEl = el.parentElement;
|
|
@@ -36,23 +34,20 @@ export function removeNestedEmptyEls(el) {
|
|
|
36
34
|
el = parentEl;
|
|
37
35
|
}
|
|
38
36
|
}
|
|
37
|
+
|
|
39
38
|
/**
|
|
40
39
|
* IE11 doesn't support classList to SVGElements
|
|
41
40
|
**/
|
|
42
|
-
|
|
43
41
|
export const containsClassName = (node, className) => {
|
|
44
42
|
if (!node) {
|
|
45
43
|
return false;
|
|
46
44
|
}
|
|
47
|
-
|
|
48
45
|
if (node.classList && node.classList.contains) {
|
|
49
46
|
return node.classList.contains(className);
|
|
50
47
|
}
|
|
51
|
-
|
|
52
48
|
if (!node.className) {
|
|
53
49
|
return false;
|
|
54
50
|
}
|
|
55
|
-
|
|
56
51
|
const classNames = typeof node.className.baseVal === 'string' ? node.className.baseVal : node.className;
|
|
57
52
|
return classNames.split(' ').indexOf(className) !== -1;
|
|
58
53
|
};
|
|
@@ -60,36 +55,30 @@ export function closest(node, s) {
|
|
|
60
55
|
if (!node) {
|
|
61
56
|
return null;
|
|
62
57
|
}
|
|
63
|
-
|
|
64
58
|
let el = node;
|
|
65
|
-
|
|
66
59
|
if (!document.documentElement || !document.documentElement.contains(el)) {
|
|
67
60
|
return null;
|
|
68
61
|
}
|
|
69
|
-
|
|
70
62
|
if (el.closest) {
|
|
71
63
|
return el.closest(s);
|
|
72
64
|
}
|
|
73
|
-
|
|
74
65
|
do {
|
|
75
66
|
const matchfn = el.matches ? el.matches : el.msMatchesSelector;
|
|
76
|
-
|
|
77
67
|
if (matchfn && matchfn.call(el, s)) {
|
|
78
68
|
return el;
|
|
79
69
|
}
|
|
80
|
-
|
|
81
70
|
el = el.parentElement || el.parentNode;
|
|
82
71
|
} while (el !== null && el.nodeType === 1);
|
|
83
|
-
|
|
84
72
|
return null;
|
|
85
73
|
}
|
|
74
|
+
|
|
86
75
|
/*
|
|
87
76
|
* @deprecated - Use HTMLElement.protoype.closest instead
|
|
88
77
|
*/
|
|
89
|
-
|
|
90
78
|
export function closestElement(node, s) {
|
|
91
79
|
return closest(node, s);
|
|
92
80
|
}
|
|
81
|
+
|
|
93
82
|
/**
|
|
94
83
|
* Util for converting a css pixel size value to a number (of pixels).
|
|
95
84
|
*
|
|
@@ -110,18 +99,16 @@ export function parsePx(pxStr) {
|
|
|
110
99
|
if (!pxStr.endsWith('px')) {
|
|
111
100
|
return undefined;
|
|
112
101
|
}
|
|
113
|
-
|
|
114
102
|
const maybeNumber = parseInt(pxStr, 10);
|
|
115
103
|
return !Number.isNaN(maybeNumber) ? maybeNumber : undefined;
|
|
116
104
|
}
|
|
117
105
|
// does typescript have function templates yet?
|
|
106
|
+
|
|
118
107
|
export function mapElem(elem, callback) {
|
|
119
108
|
const array = [];
|
|
120
|
-
|
|
121
109
|
for (let i = 0; i < elem.childElementCount; i++) {
|
|
122
110
|
array.push(callback(elem.children[i], i, elem));
|
|
123
111
|
}
|
|
124
|
-
|
|
125
112
|
return array;
|
|
126
113
|
}
|
|
127
114
|
export function maphElem(elem, callback) {
|
|
@@ -2,25 +2,22 @@ import { NodeSelection, TextSelection } from 'prosemirror-state';
|
|
|
2
2
|
import { ReplaceAroundStep, ReplaceStep } from 'prosemirror-transform';
|
|
3
3
|
import { closest } from './dom';
|
|
4
4
|
export const stepHasSlice = step => step && step.hasOwnProperty('slice');
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* Checks whether a given step is adding nodes of given nodeTypes
|
|
7
8
|
*
|
|
8
9
|
* @param step Step to check
|
|
9
10
|
* @param nodeTypes NodeTypes being added
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
12
|
export function stepAddsOneOf(step, nodeTypes) {
|
|
13
13
|
let adds = false;
|
|
14
|
-
|
|
15
14
|
if (!stepHasSlice(step)) {
|
|
16
15
|
return adds;
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
step.slice.content.descendants(node => {
|
|
20
18
|
if (nodeTypes.has(node.type)) {
|
|
21
19
|
adds = true;
|
|
22
20
|
}
|
|
23
|
-
|
|
24
21
|
return !adds;
|
|
25
22
|
});
|
|
26
23
|
return adds;
|
|
@@ -28,10 +25,10 @@ export function stepAddsOneOf(step, nodeTypes) {
|
|
|
28
25
|
export const extractSliceFromStep = step => {
|
|
29
26
|
if (!(step instanceof ReplaceStep) && !(step instanceof ReplaceAroundStep)) {
|
|
30
27
|
return null;
|
|
31
|
-
}
|
|
32
|
-
// However, we need to read it to found if the step was adding a newline
|
|
33
|
-
|
|
28
|
+
}
|
|
34
29
|
|
|
30
|
+
// @ts-ignore This is by design. Slice is a private property, but accesible, from ReplaceStep.
|
|
31
|
+
// However, we need to read it to found if the step was adding a newline
|
|
35
32
|
const slice = step.slice;
|
|
36
33
|
return slice;
|
|
37
34
|
};
|
|
@@ -50,11 +47,9 @@ export const setNodeSelection = (view, pos) => {
|
|
|
50
47
|
state,
|
|
51
48
|
dispatch
|
|
52
49
|
} = view;
|
|
53
|
-
|
|
54
50
|
if (!isFinite(pos)) {
|
|
55
51
|
return;
|
|
56
52
|
}
|
|
57
|
-
|
|
58
53
|
const tr = state.tr.setSelection(NodeSelection.create(state.doc, pos));
|
|
59
54
|
dispatch(tr);
|
|
60
55
|
};
|
|
@@ -68,12 +63,12 @@ export function setTextSelection(view, anchor, head) {
|
|
|
68
63
|
}
|
|
69
64
|
export function nonNullable(value) {
|
|
70
65
|
return value !== null && value !== undefined;
|
|
71
|
-
}
|
|
66
|
+
}
|
|
72
67
|
|
|
68
|
+
// checks if the given position is within the ProseMirror document
|
|
73
69
|
export const isValidPosition = (pos, state) => {
|
|
74
70
|
if (pos >= 0 && pos <= state.doc.resolve(0).end()) {
|
|
75
71
|
return true;
|
|
76
72
|
}
|
|
77
|
-
|
|
78
73
|
return false;
|
|
79
74
|
};
|
|
@@ -3,21 +3,17 @@ export default class ErrorReporter {
|
|
|
3
3
|
constructor() {
|
|
4
4
|
_defineProperty(this, "handlerStorage", null);
|
|
5
5
|
}
|
|
6
|
-
|
|
7
6
|
captureMessage(msg, tags) {
|
|
8
7
|
if (this.handlerStorage) {
|
|
9
8
|
this.handlerStorage.captureMessage(msg, tags);
|
|
10
9
|
}
|
|
11
10
|
}
|
|
12
|
-
|
|
13
11
|
captureException(err, tags) {
|
|
14
12
|
if (this.handlerStorage) {
|
|
15
13
|
this.handlerStorage.captureException(err, tags);
|
|
16
14
|
}
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
set handler(handler) {
|
|
20
17
|
this.handlerStorage = handler;
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
}
|