@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,14 +1,14 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
|
|
2
2
|
import { getParticipantsCount } from './collab';
|
|
3
|
-
import { startMeasure, stopMeasure } from './performance/measure';
|
|
4
|
-
// our current sampling for this event is not bound by node.type
|
|
3
|
+
import { startMeasure, stopMeasure } from './performance/measure';
|
|
5
4
|
|
|
5
|
+
// This was existing logic when converting from ReactNodeView
|
|
6
|
+
// our current sampling for this event is not bound by node.type
|
|
6
7
|
let nodeViewRenderedEventsCounter = 0;
|
|
7
8
|
const DEFAULT_SAMPLING_RATE = 100;
|
|
8
9
|
const DEFAULT_SLOW_THRESHOLD = 7;
|
|
9
10
|
export function getPerformanceOptions(view) {
|
|
10
11
|
var _nodeViewTracking$sam, _nodeViewTracking$slo;
|
|
11
|
-
|
|
12
12
|
// TODO: ED-15663
|
|
13
13
|
// Please, do not copy or use this kind of code below
|
|
14
14
|
// @ts-ignore
|
|
@@ -4,11 +4,9 @@ import React, { Component } from 'react';
|
|
|
4
4
|
export const withImageLoader = Wrapped => class WithImageLoader extends Component {
|
|
5
5
|
constructor(...args) {
|
|
6
6
|
super(...args);
|
|
7
|
-
|
|
8
7
|
_defineProperty(this, "state", {
|
|
9
8
|
imageStatus: 'loading'
|
|
10
9
|
});
|
|
11
|
-
|
|
12
10
|
_defineProperty(this, "onLoad", () => {
|
|
13
11
|
this.setState({
|
|
14
12
|
imageStatus: 'complete'
|
|
@@ -16,7 +14,6 @@ export const withImageLoader = Wrapped => class WithImageLoader extends Componen
|
|
|
16
14
|
const {
|
|
17
15
|
onExternalImageLoaded
|
|
18
16
|
} = this.props;
|
|
19
|
-
|
|
20
17
|
if (onExternalImageLoaded && this.img) {
|
|
21
18
|
onExternalImageLoaded({
|
|
22
19
|
width: this.img.naturalWidth,
|
|
@@ -24,18 +21,15 @@ export const withImageLoader = Wrapped => class WithImageLoader extends Componen
|
|
|
24
21
|
});
|
|
25
22
|
}
|
|
26
23
|
});
|
|
27
|
-
|
|
28
24
|
_defineProperty(this, "onError", () => {
|
|
29
25
|
this.setState({
|
|
30
26
|
imageStatus: 'error'
|
|
31
27
|
});
|
|
32
28
|
});
|
|
33
29
|
}
|
|
34
|
-
|
|
35
30
|
componentDidMount() {
|
|
36
31
|
this.fetchImage(this.props);
|
|
37
32
|
}
|
|
38
|
-
|
|
39
33
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
40
34
|
if (nextProps.url !== this.props.url) {
|
|
41
35
|
this.setState({
|
|
@@ -44,7 +38,6 @@ export const withImageLoader = Wrapped => class WithImageLoader extends Componen
|
|
|
44
38
|
this.fetchImage(nextProps);
|
|
45
39
|
}
|
|
46
40
|
}
|
|
47
|
-
|
|
48
41
|
componentWillUnmount() {
|
|
49
42
|
if (this.img) {
|
|
50
43
|
this.img.removeEventListener('load', this.onLoad);
|
|
@@ -52,7 +45,6 @@ export const withImageLoader = Wrapped => class WithImageLoader extends Componen
|
|
|
52
45
|
this.img = null;
|
|
53
46
|
}
|
|
54
47
|
}
|
|
55
|
-
|
|
56
48
|
fetchImage({
|
|
57
49
|
url
|
|
58
50
|
}) {
|
|
@@ -62,11 +54,9 @@ export const withImageLoader = Wrapped => class WithImageLoader extends Componen
|
|
|
62
54
|
this.img.addEventListener('load', this.onLoad);
|
|
63
55
|
this.img.addEventListener('error', this.onError);
|
|
64
56
|
}
|
|
65
|
-
|
|
66
57
|
this.img.src = url;
|
|
67
58
|
}
|
|
68
59
|
}
|
|
69
|
-
|
|
70
60
|
render() {
|
|
71
61
|
const {
|
|
72
62
|
imageStatus
|
|
@@ -75,5 +65,4 @@ export const withImageLoader = Wrapped => class WithImageLoader extends Componen
|
|
|
75
65
|
imageStatus: imageStatus
|
|
76
66
|
}));
|
|
77
67
|
}
|
|
78
|
-
|
|
79
68
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
// TODO: remove from editor-core utils, re-export from editor-common
|
|
2
|
+
|
|
2
3
|
import { ReplaceStep } from 'prosemirror-transform';
|
|
3
4
|
export const isTextInput = tr => {
|
|
4
5
|
const [step] = tr.steps;
|
|
5
|
-
|
|
6
6
|
if (!step || !(step instanceof ReplaceStep)) {
|
|
7
7
|
return false;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
9
|
const {
|
|
11
10
|
slice: {
|
|
12
11
|
content
|
|
@@ -1,29 +1,25 @@
|
|
|
1
|
-
export const DEFAULT_ORDER = 1;
|
|
1
|
+
export const DEFAULT_ORDER = 1;
|
|
2
|
+
|
|
3
|
+
// resolve "order" to a safe, 0+ integer, otherwise return undefined
|
|
2
4
|
// Note: Any changes to this function should also be made to "resolveStart"
|
|
3
5
|
// in packages/editor/adf-schema/src/schema/nodes/ordered-list.ts
|
|
4
|
-
|
|
5
6
|
export const resolveOrder = order => {
|
|
6
7
|
const num = Number(order);
|
|
7
|
-
|
|
8
8
|
if (Number.isNaN(num)) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
11
|
if (num < 0) {
|
|
13
12
|
return;
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
return Math.floor(Math.max(num, 0));
|
|
17
15
|
};
|
|
18
16
|
export const getOrderFromOrderedListNode = orderedListNode => {
|
|
19
17
|
var _orderedListNode$attr, _resolveOrder;
|
|
20
|
-
|
|
21
18
|
const order = orderedListNode === null || orderedListNode === void 0 ? void 0 : (_orderedListNode$attr = orderedListNode.attrs) === null || _orderedListNode$attr === void 0 ? void 0 : _orderedListNode$attr.order;
|
|
22
19
|
return (_resolveOrder = resolveOrder(order)) !== null && _resolveOrder !== void 0 ? _resolveOrder : DEFAULT_ORDER;
|
|
23
20
|
};
|
|
24
21
|
export const getItemCounterDigitsSize = options => {
|
|
25
22
|
var _resolveOrder2, _String, _String$split, _String$split$;
|
|
26
|
-
|
|
27
23
|
const order = (_resolveOrder2 = resolveOrder(options.order)) !== null && _resolveOrder2 !== void 0 ? _resolveOrder2 : DEFAULT_ORDER;
|
|
28
24
|
const itemsCount = typeof options.itemsCount === 'number' ? options.itemsCount : 0;
|
|
29
25
|
const largestCounter = order + (itemsCount - 1);
|
|
@@ -5,11 +5,9 @@ export const getExtensionLozengeData = ({
|
|
|
5
5
|
if (!node.attrs.parameters) {
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
8
|
const {
|
|
10
9
|
macroMetadata
|
|
11
10
|
} = node.attrs.parameters;
|
|
12
|
-
|
|
13
11
|
if (macroMetadata && macroMetadata.placeholder) {
|
|
14
12
|
let placeholderData;
|
|
15
13
|
macroMetadata.placeholder.forEach(placeholder => {
|
|
@@ -19,6 +17,5 @@ export const getExtensionLozengeData = ({
|
|
|
19
17
|
});
|
|
20
18
|
return placeholderData;
|
|
21
19
|
}
|
|
22
|
-
|
|
23
20
|
return;
|
|
24
21
|
};
|
|
@@ -13,11 +13,9 @@ export const findChangedNodesFromTransaction = tr => {
|
|
|
13
13
|
slice
|
|
14
14
|
} = step;
|
|
15
15
|
const size = slice && slice.content ? slice.content.size : 0;
|
|
16
|
-
|
|
17
16
|
for (let i = from; i <= to + size; i++) {
|
|
18
17
|
if (i <= tr.doc.content.size) {
|
|
19
18
|
const topLevelNode = tr.doc.resolve(i).node(1);
|
|
20
|
-
|
|
21
19
|
if (topLevelNode && !nodes.find(n => n === topLevelNode)) {
|
|
22
20
|
nodes.push(topLevelNode);
|
|
23
21
|
}
|
|
@@ -32,55 +30,49 @@ export const validNode = node => {
|
|
|
32
30
|
} catch (error) {
|
|
33
31
|
return false;
|
|
34
32
|
}
|
|
35
|
-
|
|
36
33
|
return true;
|
|
37
34
|
};
|
|
38
|
-
/** Validates prosemirror nodes, and returns true only if all nodes are valid */
|
|
39
35
|
|
|
36
|
+
/** Validates prosemirror nodes, and returns true only if all nodes are valid */
|
|
40
37
|
export const validateNodes = nodes => nodes.every(validNode);
|
|
41
38
|
export const isType = (node, type) => type && node && node.type === type;
|
|
42
39
|
export const isParagraph = (node, schema) => isType(node, schema.nodes.paragraph);
|
|
43
40
|
export const isText = (node, schema) => isType(node, schema.nodes.text);
|
|
44
41
|
export const isLinkMark = (node, schema) => isType(node, schema.marks.link);
|
|
45
42
|
export let SelectedState;
|
|
43
|
+
|
|
46
44
|
/**
|
|
47
45
|
* Returns if the current selection from achor-head is selecting the node.
|
|
48
46
|
* If the node is not selected then null is returned.
|
|
49
47
|
* If the node is selected then an enum is returned that describes weather the node
|
|
50
48
|
* is fully selected by a range or if the "inside" of the node has been selected or clicked.
|
|
51
49
|
*/
|
|
52
|
-
|
|
53
50
|
(function (SelectedState) {
|
|
54
51
|
SelectedState[SelectedState["selectedInRange"] = 0] = "selectedInRange";
|
|
55
52
|
SelectedState[SelectedState["selectedInside"] = 1] = "selectedInside";
|
|
56
53
|
})(SelectedState || (SelectedState = {}));
|
|
57
|
-
|
|
58
54
|
export const isNodeSelectedOrInRange = (anchorPosition, headPosition, nodePosition, nodeSize) => {
|
|
59
55
|
const rangeStart = Math.min(anchorPosition, headPosition);
|
|
60
56
|
const rangeEnd = Math.max(anchorPosition, headPosition);
|
|
61
57
|
const nodeStart = nodePosition;
|
|
62
58
|
const nodeEnd = nodePosition + nodeSize;
|
|
63
|
-
|
|
64
59
|
if (anchorPosition === headPosition) {
|
|
65
60
|
return null;
|
|
66
61
|
}
|
|
67
|
-
|
|
68
62
|
if (rangeStart <= nodeStart && nodeEnd < rangeEnd || rangeStart < nodeStart && nodeEnd <= rangeEnd) {
|
|
69
63
|
return SelectedState.selectedInRange;
|
|
70
64
|
}
|
|
71
|
-
|
|
72
65
|
if (nodeStart <= anchorPosition && headPosition <= nodeEnd) {
|
|
73
66
|
return SelectedState.selectedInside;
|
|
74
67
|
}
|
|
75
|
-
|
|
76
68
|
return null;
|
|
77
69
|
};
|
|
70
|
+
|
|
78
71
|
/**
|
|
79
72
|
* Checks if a particular node fragment is supported in the parent
|
|
80
73
|
* @param state EditorState
|
|
81
74
|
* @param fragment The fragment to be checked for
|
|
82
75
|
*/
|
|
83
|
-
|
|
84
76
|
export const isSupportedInParent = (state, fragment, currentAppearance) => {
|
|
85
77
|
const depth = currentAppearance === 'embed' || currentAppearance === 'block' ? undefined : -1;
|
|
86
78
|
const parent = state.selection.$from.node(depth);
|
|
@@ -2,31 +2,23 @@ export const isOutdatedBrowser = userAgent => {
|
|
|
2
2
|
// Take browsers in both Desktop and Mobile (includes Chrome, Firefox, Edge and Safari) within last 2 years
|
|
3
3
|
const chrome = /Chrome\//.test(userAgent) && !/OPR\//.test(userAgent);
|
|
4
4
|
const chromeVersion = chrome ? parseInt((userAgent.match(/Chrome\/(\d+)/) || [])[1], 10) : 0;
|
|
5
|
-
|
|
6
5
|
if (chromeVersion >= 84) {
|
|
7
6
|
return false;
|
|
8
7
|
}
|
|
9
|
-
|
|
10
8
|
const gecko = /gecko\/\d/i.test(userAgent);
|
|
11
9
|
const geckoVersion = gecko ? parseInt((userAgent.match(/Firefox\/(\d+)/) || [])[1], 10) : 0;
|
|
12
|
-
|
|
13
10
|
if (geckoVersion >= 84) {
|
|
14
11
|
return false;
|
|
15
12
|
}
|
|
16
|
-
|
|
17
13
|
const edge = /Edge\/(\d+)/.exec(userAgent);
|
|
18
14
|
const edgeVersion = edge ? +edge[1] : 0;
|
|
19
|
-
|
|
20
15
|
if (edgeVersion >= 84) {
|
|
21
16
|
return false;
|
|
22
17
|
}
|
|
23
|
-
|
|
24
18
|
const safari = !chrome && !gecko && /Version\/([0-9\._]+).*Safari/.test(userAgent);
|
|
25
19
|
const safariVersion = safari ? parseInt((userAgent.match(/Version\/([0-9\._]+).*Safari/) || [])[1], 10) : 0;
|
|
26
|
-
|
|
27
20
|
if (safariVersion >= 12) {
|
|
28
21
|
return false;
|
|
29
22
|
}
|
|
30
|
-
|
|
31
23
|
return true;
|
|
32
24
|
};
|
|
@@ -15,22 +15,18 @@ export function useComponentRenderTracking({
|
|
|
15
15
|
const lastProps = propsRef.current;
|
|
16
16
|
const renderCount = renderCountRef.current;
|
|
17
17
|
let propsDifference;
|
|
18
|
-
|
|
19
18
|
if (propsDiffingOptions !== null && propsDiffingOptions !== void 0 && propsDiffingOptions.enabled && lastProps) {
|
|
20
19
|
propsDifference = propsDiffingOptions !== null && propsDiffingOptions !== void 0 && propsDiffingOptions.useShallow ? getShallowPropsDifference(lastProps, propsDiffingOptions.props) : getPropsDifference(lastProps, propsDiffingOptions.props, 0, 2, propsDiffingOptions === null || propsDiffingOptions === void 0 ? void 0 : propsDiffingOptions.propsToIgnore);
|
|
21
20
|
}
|
|
22
|
-
|
|
23
21
|
const result = {
|
|
24
22
|
renderCount,
|
|
25
23
|
propsDifference,
|
|
26
24
|
componentId
|
|
27
25
|
};
|
|
28
26
|
onRender(result);
|
|
29
|
-
|
|
30
27
|
if (propsDiffingOptions !== null && propsDiffingOptions !== void 0 && propsDiffingOptions.enabled) {
|
|
31
28
|
propsRef.current = propsDiffingOptions.props;
|
|
32
29
|
}
|
|
33
|
-
|
|
34
30
|
renderCountRef.current = renderCountRef.current + 1;
|
|
35
31
|
}); // No dependencies run on each render
|
|
36
32
|
}
|
|
@@ -3,7 +3,6 @@ export function isPerformanceAPIAvailable() {
|
|
|
3
3
|
if (hasRequiredPerformanceAPIs === undefined) {
|
|
4
4
|
hasRequiredPerformanceAPIs = typeof window !== 'undefined' && 'performance' in window && ['measure', 'clearMeasures', 'clearMarks', 'getEntriesByName', 'getEntriesByType', 'now'].every(api => !!performance[api]);
|
|
5
5
|
}
|
|
6
|
-
|
|
7
6
|
return hasRequiredPerformanceAPIs;
|
|
8
7
|
}
|
|
9
8
|
export function isPerformanceObserverAvailable() {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { isPerformanceAPIAvailable } from './is-performance-api-available';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Monitors if a pages enters a visibility state which will lead to
|
|
4
5
|
* distorted duration measurements (where the measurement uses the
|
|
5
6
|
* requestAnimationFrame api).
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
8
|
export function getDistortedDurationMonitor() {
|
|
9
9
|
// If an editor is rendered when the document is not visible -- the callback passed to
|
|
10
10
|
// requestAnimationFrame will not fire until the document becomes visible again.
|
|
@@ -16,26 +16,23 @@ export function getDistortedDurationMonitor() {
|
|
|
16
16
|
// To mitigate this -- we detect this state -- and fire a seperate callback when the
|
|
17
17
|
// measurement has occured when the render was in the backgroun
|
|
18
18
|
let distortedDuration = document.visibilityState !== 'visible';
|
|
19
|
-
|
|
20
19
|
function handleVisibilityChange() {
|
|
21
20
|
if (document.visibilityState !== 'visible') {
|
|
22
21
|
distortedDuration = true;
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
|
-
|
|
26
24
|
document.addEventListener('visibilitychange', handleVisibilityChange);
|
|
27
25
|
return {
|
|
28
26
|
distortedDuration,
|
|
29
|
-
|
|
30
27
|
/**
|
|
31
28
|
* Cleans up the document visibility event listener
|
|
32
29
|
*/
|
|
33
30
|
cleanup() {
|
|
34
31
|
document.removeEventListener('visibilitychange', handleVisibilityChange);
|
|
35
32
|
}
|
|
36
|
-
|
|
37
33
|
};
|
|
38
34
|
}
|
|
35
|
+
|
|
39
36
|
/**
|
|
40
37
|
* Measures time it takes to render a frame including -> style, paint, layout and composition.
|
|
41
38
|
*
|
|
@@ -49,7 +46,6 @@ export function getDistortedDurationMonitor() {
|
|
|
49
46
|
* | javascript (framework) | style | layout | paint | composite | javascript | ...
|
|
50
47
|
* | startMark + scheduling rAF | | rAF callback, endMark
|
|
51
48
|
*/
|
|
52
|
-
|
|
53
49
|
export function measureRender(
|
|
54
50
|
/**
|
|
55
51
|
* Unique name for the measurement
|
|
@@ -70,7 +66,6 @@ onMeasureComplete) {
|
|
|
70
66
|
if (!isPerformanceAPIAvailable()) {
|
|
71
67
|
return;
|
|
72
68
|
}
|
|
73
|
-
|
|
74
69
|
const startMark = `[START]: ${measureName}`;
|
|
75
70
|
const endMark = `[END]: ${measureName}`;
|
|
76
71
|
const startTime = performance.now();
|
|
@@ -81,11 +76,9 @@ onMeasureComplete) {
|
|
|
81
76
|
performance.mark(endMark);
|
|
82
77
|
distortedDurationMonitor.cleanup();
|
|
83
78
|
const duration = performance.now() - startTime;
|
|
84
|
-
|
|
85
79
|
try {
|
|
86
80
|
performance.measure(measureName, startMark, endMark);
|
|
87
81
|
const entry = performance.getEntriesByName(measureName).pop();
|
|
88
|
-
|
|
89
82
|
if (!entry) {
|
|
90
83
|
onMeasureComplete({
|
|
91
84
|
duration,
|
|
@@ -106,7 +99,6 @@ onMeasureComplete) {
|
|
|
106
99
|
distortedDuration: distortedDurationMonitor.distortedDuration
|
|
107
100
|
});
|
|
108
101
|
}
|
|
109
|
-
|
|
110
102
|
performance.clearMeasures(measureName);
|
|
111
103
|
performance.clearMarks(startMark);
|
|
112
104
|
performance.clearMarks(endMark);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SEVERITY } from '../analytics';
|
|
2
2
|
import { isPerformanceObserverLongTaskAvailable } from './is-performance-api-available';
|
|
3
|
-
export function measureTTI(onMeasureComplete, idleThreshold = 1000, cancelAfter = 60,
|
|
3
|
+
export function measureTTI(onMeasureComplete, idleThreshold = 1000, cancelAfter = 60,
|
|
4
|
+
// Dependency Injection for easier testing
|
|
4
5
|
PerfObserver) {
|
|
5
6
|
if (!isPerformanceObserverLongTaskAvailable()) {
|
|
6
7
|
return;
|
|
7
8
|
}
|
|
8
|
-
|
|
9
9
|
const start = performance.now();
|
|
10
10
|
let prevLongTask;
|
|
11
11
|
let lastLongTask = {
|
|
@@ -15,7 +15,6 @@ PerfObserver) {
|
|
|
15
15
|
let cancelAfterMs = cancelAfter * 1000;
|
|
16
16
|
const observer = new (PerfObserver || PerformanceObserver)(list => {
|
|
17
17
|
const entries = list.getEntries();
|
|
18
|
-
|
|
19
18
|
if (entries.length) {
|
|
20
19
|
prevLongTask = lastLongTask;
|
|
21
20
|
lastLongTask = entries[entries.length - 1];
|
|
@@ -24,17 +23,16 @@ PerfObserver) {
|
|
|
24
23
|
observer.observe({
|
|
25
24
|
entryTypes: ['longtask']
|
|
26
25
|
});
|
|
27
|
-
|
|
28
26
|
const checkIdle = () => {
|
|
29
27
|
// 1. There hasn't been any long task in `idleThreshold` time: Interactive from the start.
|
|
30
28
|
// 2. Only 1 long task: Interactive from the end of the only long task.
|
|
31
29
|
// 3. Several long tasks:
|
|
32
30
|
// 3.1 Interactive from the end of prevLongTask if `lastLongTask.start - prevLongTask.end >= idleThreshold`
|
|
33
31
|
// 3.2 Interactive from the end of lastLongTask if `lastLongTask.start - prevLongTask.end < idleThreshold`
|
|
32
|
+
|
|
34
33
|
const now = performance.now();
|
|
35
34
|
const lastEnd = lastLongTask.startTime + lastLongTask.duration;
|
|
36
35
|
const prevEnd = prevLongTask ? prevLongTask.startTime + prevLongTask.duration : lastEnd;
|
|
37
|
-
|
|
38
36
|
if (!prevLongTask) {
|
|
39
37
|
observer.disconnect();
|
|
40
38
|
return onMeasureComplete(prevEnd, 0, false);
|
|
@@ -45,11 +43,9 @@ PerfObserver) {
|
|
|
45
43
|
observer.disconnect();
|
|
46
44
|
return onMeasureComplete(lastEnd, lastEnd - start, cancelAfterMs <= 0);
|
|
47
45
|
}
|
|
48
|
-
|
|
49
46
|
cancelAfterMs = Math.max(0, cancelAfterMs - (now - start));
|
|
50
47
|
return setTimeout(checkIdle, idleThreshold);
|
|
51
48
|
};
|
|
52
|
-
|
|
53
49
|
setTimeout(checkIdle, idleThreshold);
|
|
54
50
|
}
|
|
55
51
|
export const TTI_SEVERITY_THRESHOLD_DEFAULTS = {
|
|
@@ -64,7 +60,6 @@ export function getTTISeverity(tti, ttiFromInvocation, ttiSeverityNormalTheshold
|
|
|
64
60
|
const ttiNormalThreshold = ttiSeverityNormalTheshold || TTI_SEVERITY_THRESHOLD_DEFAULTS.NORMAL;
|
|
65
61
|
const ttiDegradedThreshold = ttiSeverityDegradedThreshold || TTI_SEVERITY_THRESHOLD_DEFAULTS.DEGRADED;
|
|
66
62
|
let ttiSeverity;
|
|
67
|
-
|
|
68
63
|
if (tti >= ttiNormalThreshold && tti < ttiDegradedThreshold) {
|
|
69
64
|
ttiSeverity = SEVERITY.DEGRADED;
|
|
70
65
|
} else if (tti >= ttiDegradedThreshold) {
|
|
@@ -72,11 +67,9 @@ export function getTTISeverity(tti, ttiFromInvocation, ttiSeverityNormalTheshold
|
|
|
72
67
|
} else {
|
|
73
68
|
ttiSeverity = SEVERITY.NORMAL;
|
|
74
69
|
}
|
|
75
|
-
|
|
76
70
|
const ttiFromInvocationNormalThreshold = ttiFromInvocationSeverityNormalThreshold || TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS.NORMAL;
|
|
77
71
|
const ttiFromInvocationDegradedThreshold = ttiFromInvocationSeverityDegradedThreshold || TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS.DEGRADED;
|
|
78
72
|
let ttiFromInvocationSeverity;
|
|
79
|
-
|
|
80
73
|
if (ttiFromInvocation >= ttiFromInvocationNormalThreshold && ttiFromInvocation < ttiFromInvocationDegradedThreshold) {
|
|
81
74
|
ttiFromInvocationSeverity = SEVERITY.DEGRADED;
|
|
82
75
|
} else if (ttiFromInvocation >= ttiFromInvocationDegradedThreshold) {
|
|
@@ -84,7 +77,6 @@ export function getTTISeverity(tti, ttiFromInvocation, ttiSeverityNormalTheshold
|
|
|
84
77
|
} else {
|
|
85
78
|
ttiFromInvocationSeverity = SEVERITY.NORMAL;
|
|
86
79
|
}
|
|
87
|
-
|
|
88
80
|
return {
|
|
89
81
|
ttiSeverity,
|
|
90
82
|
ttiFromInvocationSeverity
|
|
@@ -4,7 +4,6 @@ export function startMeasure(measureName) {
|
|
|
4
4
|
if (!isPerformanceAPIAvailable()) {
|
|
5
5
|
return;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
7
|
performance.mark(`${measureName}::start`);
|
|
9
8
|
measureMap.set(measureName, performance.now());
|
|
10
9
|
}
|
|
@@ -12,23 +11,19 @@ export function stopMeasure(measureName, onMeasureComplete) {
|
|
|
12
11
|
if (!isPerformanceAPIAvailable()) {
|
|
13
12
|
return;
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
performance.mark(`${measureName}::end`);
|
|
17
15
|
const start = onMeasureComplete ? measureMap.get(measureName) : undefined;
|
|
18
|
-
|
|
19
16
|
try {
|
|
20
17
|
performance.measure(measureName, `${measureName}::start`, `${measureName}::end`);
|
|
21
18
|
} catch (error) {} finally {
|
|
22
19
|
if (onMeasureComplete) {
|
|
23
20
|
const entry = performance.getEntriesByName(measureName).pop();
|
|
24
|
-
|
|
25
21
|
if (entry) {
|
|
26
22
|
onMeasureComplete(entry.duration, entry.startTime);
|
|
27
23
|
} else if (start) {
|
|
28
24
|
onMeasureComplete(performance.now() - start, start);
|
|
29
25
|
}
|
|
30
26
|
}
|
|
31
|
-
|
|
32
27
|
clearMeasure(measureName);
|
|
33
28
|
}
|
|
34
29
|
}
|
|
@@ -36,7 +31,6 @@ export function clearMeasure(measureName) {
|
|
|
36
31
|
if (!isPerformanceAPIAvailable()) {
|
|
37
32
|
return;
|
|
38
33
|
}
|
|
39
|
-
|
|
40
34
|
measureMap.delete(measureName);
|
|
41
35
|
performance.clearMarks(`${measureName}::start`);
|
|
42
36
|
performance.clearMarks(`${measureName}::end`);
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
* }, tr => tr.setMeta('addToHistory', false));
|
|
45
45
|
*
|
|
46
46
|
*/
|
|
47
|
+
|
|
47
48
|
function isFunction(x) {
|
|
48
49
|
return typeof x === 'function';
|
|
49
50
|
}
|
|
50
|
-
|
|
51
51
|
export function pluginFactory(pluginKey, reducer, options = {}) {
|
|
52
52
|
const {
|
|
53
53
|
mapping,
|
|
@@ -62,46 +62,37 @@ export function pluginFactory(pluginKey, reducer, options = {}) {
|
|
|
62
62
|
const oldPluginState = mapping ? mapping(tr, _pluginState, newEditorState) : _pluginState;
|
|
63
63
|
let newPluginState = oldPluginState;
|
|
64
64
|
const meta = tr.getMeta(pluginKey);
|
|
65
|
-
|
|
66
65
|
if (meta) {
|
|
67
66
|
newPluginState = reducer(oldPluginState, meta);
|
|
68
67
|
}
|
|
69
|
-
|
|
70
68
|
if (onDocChanged && tr.docChanged) {
|
|
71
69
|
newPluginState = onDocChanged(tr, newPluginState, newEditorState);
|
|
72
70
|
} else if (onSelectionChanged && tr.selectionSet) {
|
|
73
71
|
newPluginState = onSelectionChanged(tr, newPluginState, newEditorState);
|
|
74
72
|
}
|
|
75
|
-
|
|
76
73
|
if (newPluginState !== oldPluginState) {
|
|
77
74
|
dispatch(pluginKey, newPluginState);
|
|
78
75
|
}
|
|
79
|
-
|
|
80
76
|
return newPluginState;
|
|
81
77
|
}
|
|
82
78
|
};
|
|
83
79
|
},
|
|
84
|
-
|
|
85
80
|
createCommand(action, transform) {
|
|
86
81
|
return (state, dispatch) => {
|
|
87
82
|
if (dispatch) {
|
|
88
83
|
const tr = transform ? transform(state.tr, state) : state.tr;
|
|
89
84
|
const resolvedAction = isFunction(action) ? action(state) : action;
|
|
90
|
-
|
|
91
85
|
if (tr && resolvedAction) {
|
|
92
86
|
dispatch(tr.setMeta(pluginKey, resolvedAction));
|
|
93
87
|
} else {
|
|
94
88
|
return false;
|
|
95
89
|
}
|
|
96
90
|
}
|
|
97
|
-
|
|
98
91
|
return true;
|
|
99
92
|
};
|
|
100
93
|
},
|
|
101
|
-
|
|
102
94
|
getPluginState(state) {
|
|
103
95
|
return pluginKey.getState(state);
|
|
104
96
|
}
|
|
105
|
-
|
|
106
97
|
};
|
|
107
98
|
}
|
|
@@ -4,51 +4,44 @@ export class RenderCountProfiler {
|
|
|
4
4
|
* The singleton/cached instance of RenderCountProfiler that will be shared
|
|
5
5
|
* betweenRenderCountProfiler.getInstance() calls
|
|
6
6
|
*/
|
|
7
|
+
|
|
7
8
|
constructor({
|
|
8
9
|
store
|
|
9
10
|
}) {
|
|
10
11
|
this.store = store;
|
|
11
12
|
}
|
|
13
|
+
|
|
12
14
|
/**
|
|
13
15
|
* Returns the singleton/cached instance of RenderCountProfiler that
|
|
14
16
|
* currently exists. If it hasn't been instantiated yet, the singleton
|
|
15
17
|
* instance will be created using the given params. Returns the latest
|
|
16
18
|
* singleton/instance.
|
|
17
19
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
20
|
static getInstance(params) {
|
|
21
21
|
if (!RenderCountProfiler.instance) {
|
|
22
22
|
RenderCountProfiler.instance = new RenderCountProfiler({
|
|
23
23
|
store: params.store
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
|
|
27
26
|
return RenderCountProfiler.instance;
|
|
28
27
|
}
|
|
29
|
-
|
|
30
28
|
getData(profilerKey) {
|
|
31
29
|
var _this$store;
|
|
32
|
-
|
|
33
30
|
return (_this$store = this.store) === null || _this$store === void 0 ? void 0 : _this$store[profilerKey];
|
|
34
31
|
}
|
|
35
|
-
|
|
36
32
|
enable() {
|
|
37
|
-
this.store[PROFILER_KEY] = {
|
|
33
|
+
this.store[PROFILER_KEY] = {
|
|
34
|
+
...this.store[PROFILER_KEY],
|
|
38
35
|
enabled: true
|
|
39
36
|
};
|
|
40
37
|
}
|
|
41
|
-
|
|
42
38
|
remove() {
|
|
43
39
|
delete this.store[PROFILER_KEY];
|
|
44
40
|
}
|
|
45
|
-
|
|
46
41
|
isEnabled() {
|
|
47
42
|
var _this$store2, _this$store2$PROFILER;
|
|
48
|
-
|
|
49
43
|
return Boolean((_this$store2 = this.store) === null || _this$store2 === void 0 ? void 0 : (_this$store2$PROFILER = _this$store2[PROFILER_KEY]) === null || _this$store2$PROFILER === void 0 ? void 0 : _this$store2$PROFILER.enabled);
|
|
50
44
|
}
|
|
51
|
-
|
|
52
45
|
setRenderCount({
|
|
53
46
|
componentId,
|
|
54
47
|
renderCount,
|
|
@@ -60,24 +53,24 @@ export class RenderCountProfiler {
|
|
|
60
53
|
};
|
|
61
54
|
const existingComponents = profilerData === null || profilerData === void 0 ? void 0 : profilerData.components;
|
|
62
55
|
const existingInstances = existingComponents === null || existingComponents === void 0 ? void 0 : existingComponents[componentId];
|
|
63
|
-
const updatedComponent = {
|
|
56
|
+
const updatedComponent = {
|
|
57
|
+
...existingInstances,
|
|
64
58
|
[instanceId]: instance
|
|
65
59
|
};
|
|
66
|
-
this.store[PROFILER_KEY] = {
|
|
67
|
-
|
|
60
|
+
this.store[PROFILER_KEY] = {
|
|
61
|
+
...profilerData,
|
|
62
|
+
components: {
|
|
63
|
+
...existingComponents,
|
|
68
64
|
[componentId]: updatedComponent
|
|
69
65
|
}
|
|
70
66
|
};
|
|
71
67
|
}
|
|
72
|
-
|
|
73
68
|
getInstanceRenderCounters({
|
|
74
69
|
componentId
|
|
75
70
|
}) {
|
|
76
71
|
var _this$store$PROFILER_, _this$store3, _this$store3$PROFILER, _this$store3$PROFILER2;
|
|
77
|
-
|
|
78
72
|
const component = (_this$store$PROFILER_ = (_this$store3 = this.store) === null || _this$store3 === void 0 ? void 0 : (_this$store3$PROFILER = _this$store3[PROFILER_KEY]) === null || _this$store3$PROFILER === void 0 ? void 0 : (_this$store3$PROFILER2 = _this$store3$PROFILER.components) === null || _this$store3$PROFILER2 === void 0 ? void 0 : _this$store3$PROFILER2[componentId]) !== null && _this$store$PROFILER_ !== void 0 ? _this$store$PROFILER_ : {};
|
|
79
73
|
const counters = [];
|
|
80
|
-
|
|
81
74
|
for (let instanceId in component) {
|
|
82
75
|
const counter = {
|
|
83
76
|
instanceId,
|
|
@@ -85,23 +78,17 @@ export class RenderCountProfiler {
|
|
|
85
78
|
};
|
|
86
79
|
counters.push(counter);
|
|
87
80
|
}
|
|
88
|
-
|
|
89
81
|
return counters;
|
|
90
82
|
}
|
|
91
|
-
|
|
92
83
|
getRenderCount({
|
|
93
84
|
componentId
|
|
94
85
|
}) {
|
|
95
86
|
var _this$store$PROFILER_2, _this$store4, _this$store4$PROFILER, _this$store4$PROFILER2;
|
|
96
|
-
|
|
97
87
|
const component = (_this$store$PROFILER_2 = (_this$store4 = this.store) === null || _this$store4 === void 0 ? void 0 : (_this$store4$PROFILER = _this$store4[PROFILER_KEY]) === null || _this$store4$PROFILER === void 0 ? void 0 : (_this$store4$PROFILER2 = _this$store4$PROFILER.components) === null || _this$store4$PROFILER2 === void 0 ? void 0 : _this$store4$PROFILER2[componentId]) !== null && _this$store$PROFILER_2 !== void 0 ? _this$store$PROFILER_2 : {};
|
|
98
88
|
let total = 0;
|
|
99
|
-
|
|
100
89
|
for (let instanceId in component) {
|
|
101
90
|
total += component[instanceId].count;
|
|
102
91
|
}
|
|
103
|
-
|
|
104
92
|
return total;
|
|
105
93
|
}
|
|
106
|
-
|
|
107
94
|
}
|