@atlaskit/editor-common 97.1.2 → 97.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/cjs/analytics/analytics-queue.js +8 -0
- package/dist/cjs/analytics/linking-utils.js +2 -0
- package/dist/cjs/card/LinkToolbarButtonGroup.js +2 -0
- package/dist/cjs/card/MediaAndEmbedsToolbar/index.js +15 -3
- package/dist/cjs/card/ui/assets/card.js +4 -0
- package/dist/cjs/card/ui/assets/embed.js +4 -0
- package/dist/cjs/card/ui/assets/inline.js +4 -0
- package/dist/cjs/card/ui/assets/url.js +4 -0
- package/dist/cjs/clipboard/index.js +12 -1
- package/dist/cjs/collab/index.js +2 -0
- package/dist/cjs/commands/index.js +50 -42
- package/dist/cjs/commands/insert-block.js +10 -2
- package/dist/cjs/core-utils/document-logger.js +4 -0
- package/dist/cjs/doc-utils/editor-use-only.js +8 -3
- package/dist/cjs/element-browser/ElementBrowser.js +2 -0
- package/dist/cjs/element-browser/ViewMore.js +8 -2
- package/dist/cjs/element-browser/components/CategoryList.js +2 -0
- package/dist/cjs/element-browser/components/ElementList/ElementList.js +12 -0
- package/dist/cjs/element-browser/components/StatelessElementBrowser.js +8 -2
- package/dist/cjs/element-browser/hooks/use-select-and-focus-on-arrow-navigation.js +13 -2
- package/dist/cjs/event-dispatcher/index.js +6 -0
- package/dist/cjs/extensibility/Extension/Extension/index.js +2 -0
- package/dist/cjs/extensibility/Extension/Lozenge/ExtensionLabel.js +10 -2
- package/dist/cjs/extensibility/Extension/Lozenge/index.js +3 -1
- package/dist/cjs/extensibility/Extension.js +2 -0
- package/dist/cjs/extensibility/ExtensionComponent.js +17 -2
- package/dist/cjs/extensibility/MultiBodiedExtension/index.js +4 -0
- package/dist/cjs/extensibility/extensionNodeView.js +2 -1
- package/dist/cjs/extensions/extension-fields-helpers.js +4 -1
- package/dist/cjs/extensions/extension-handlers.js +4 -0
- package/dist/cjs/extensions/module-helpers.js +14 -6
- package/dist/cjs/extensions/types/field-definitions.js +5 -0
- package/dist/cjs/floating-toolbar/index.js +18 -2
- package/dist/cjs/guideline/dynamicGuideline.js +4 -1
- package/dist/cjs/guideline/relativeGuideline.js +12 -3
- package/dist/cjs/guideline/updateGuideline.js +4 -1
- package/dist/cjs/hooks/usePluginStateEffect.js +3 -0
- package/dist/cjs/hooks/useSharedPluginState.js +3 -0
- package/dist/cjs/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +3 -0
- package/dist/cjs/icons/shared/BorderIcon.js +4 -0
- package/dist/cjs/icons/shared/PanelErrorIcon.js +4 -0
- package/dist/cjs/icons/shared/PanelInfoIcon.js +4 -0
- package/dist/cjs/icons/shared/PanelNoteIcon.js +4 -0
- package/dist/cjs/icons/shared/PanelSuccessIcon.js +4 -0
- package/dist/cjs/icons/shared/PanelWarningIcon.js +4 -0
- package/dist/cjs/insert/index.js +6 -1
- package/dist/cjs/keymaps/index.js +48 -5
- package/dist/cjs/keymaps/keymap.js +4 -0
- package/dist/cjs/lazy-node-view/css-helper.js +4 -0
- package/dist/cjs/lazy-node-view/index.js +6 -1
- package/dist/cjs/lazy-node-view/node-view.js +2 -0
- package/dist/cjs/link/ConfigureLinkOverlay/Dropdown.js +2 -0
- package/dist/cjs/link/ConfigureLinkOverlay/StyledButton.js +4 -1
- package/dist/cjs/link/LinkPicker/EditorLinkPicker/index.js +4 -1
- package/dist/cjs/link/LinkPicker/EditorLinkPicker/useEscapeClickaway.js +9 -0
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +16 -1
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/index.js +2 -0
- package/dist/cjs/link/LinkSearch/LinkSearchList.js +2 -0
- package/dist/cjs/link/LinkSearch/LinkSearchListItem.js +2 -0
- package/dist/cjs/link/LinkSearch/index.js +9 -1
- package/dist/cjs/link/LinkSearch/withActivityProvider.js +3 -0
- package/dist/cjs/lists/analytics.js +2 -0
- package/dist/cjs/mark/commands.js +24 -3
- package/dist/cjs/media-inline/inline-image-card.js +4 -2
- package/dist/cjs/media-inline/inline-image-wrapper.js +2 -0
- package/dist/cjs/media-single/MediaBadges.js +2 -0
- package/dist/cjs/media-single/utils.js +5 -0
- package/dist/cjs/monitoring/environment.js +6 -1
- package/dist/cjs/monitoring/error.js +19 -3
- package/dist/cjs/node-width/index.js +6 -1
- package/dist/cjs/normalize-feature-flags.js +4 -1
- package/dist/cjs/paste/clipboard.js +2 -0
- package/dist/cjs/paste/md-plugins/ignore-list-heading-md-plugin.js +5 -0
- package/dist/cjs/paste/md-plugins/linkify-md-plugin.js +20 -0
- package/dist/cjs/paste/md-plugins/newline-md-plugin.js +5 -0
- package/dist/cjs/paste/md-plugins/paragraph-md-plugin.js +5 -0
- package/dist/cjs/portal/common.js +4 -1
- package/dist/cjs/preset/builder.js +8 -0
- package/dist/cjs/preset/core-plugin/index.js +5 -0
- package/dist/cjs/preset/core-plugin/requestDocument.js +3 -0
- package/dist/cjs/preset/plugin-injection-api.js +61 -6
- package/dist/cjs/provider-factory/provider-factory.js +8 -1
- package/dist/cjs/provider-factory/with-providers.js +12 -0
- package/dist/cjs/provider-helpers/combine-providers.js +7 -0
- package/dist/cjs/provider-helpers/promise-helpers.js +3 -0
- package/dist/cjs/quick-insert/assets/index.js +2 -0
- package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +4 -0
- package/dist/cjs/react-node-view/index.js +33 -2
- package/dist/cjs/resizer/BreakoutResizer.js +0 -6
- package/dist/cjs/resizer/Resizer.js +10 -2
- package/dist/cjs/safe-plugin/index.js +3 -0
- package/dist/cjs/selection/gap-cursor/actions.js +11 -2
- package/dist/cjs/selection/gap-cursor/selection.js +8 -0
- package/dist/cjs/selection/index.js +2 -0
- package/dist/cjs/selection-based-node-view/SelectionBasedNodeView.js +10 -1
- package/dist/cjs/styles/shared/lists.js +4 -1
- package/dist/cjs/transforms/code-block.js +6 -0
- package/dist/cjs/transforms/extension.js +14 -2
- package/dist/cjs/transforms/layout.js +6 -0
- package/dist/cjs/types/annotation/emitter.js +8 -2
- package/dist/cjs/types/index.js +3 -1
- package/dist/cjs/ui/Caption/index.js +4 -0
- package/dist/cjs/ui/ContextPanel/context.js +4 -0
- package/dist/cjs/ui/DropList/index.js +11 -1
- package/dist/cjs/ui/Emoji/index.js +2 -0
- package/dist/cjs/ui/ErrorBoundary/index.js +2 -0
- package/dist/cjs/ui/Expand/index.js +13 -6
- package/dist/cjs/ui/FloatingToolbar/Button.js +2 -0
- package/dist/cjs/ui/FloatingToolbar/ButtonSpotlightCard.js +4 -1
- package/dist/cjs/ui/FloatingToolbar/styles.js +3 -0
- package/dist/cjs/ui/IntlErrorBoundary/index.js +3 -0
- package/dist/cjs/ui/Layer/index.js +8 -0
- package/dist/cjs/ui/MediaSingle/grid.js +12 -2
- package/dist/cjs/ui/MediaSingle/index.js +2 -0
- package/dist/cjs/ui/MediaSingle/styled.js +6 -0
- package/dist/cjs/ui/Mention/mention-with-profilecard.js +4 -1
- package/dist/cjs/ui/Mention/mention-with-providers.js +20 -3
- package/dist/cjs/ui/OverflowShadow/index.js +18 -4
- package/dist/cjs/ui/OverflowShadow/shadowObserver.js +12 -2
- package/dist/cjs/ui/PanelTextInput/index.js +16 -1
- package/dist/cjs/ui/Popup/index.js +23 -2
- package/dist/cjs/ui/Popup/utils.js +19 -0
- package/dist/cjs/ui/ResizerLegacy/index.js +7 -0
- package/dist/cjs/ui/unsupported-content-helper.js +6 -1
- package/dist/cjs/ui/with-outer-listeners.js +12 -1
- package/dist/cjs/ui-color/ColorPalette/utils.js +2 -0
- package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.js +9 -0
- package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +12 -0
- package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/index.js +4 -0
- package/dist/cjs/ui-menu/Dropdown/index.js +9 -2
- package/dist/cjs/ui-menu/DropdownContainer/index.js +4 -1
- package/dist/cjs/ui-menu/DropdownMenu/index.js +20 -3
- package/dist/cjs/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +17 -0
- package/dist/cjs/ui-menu/ToolbarButton/styles.js +2 -0
- package/dist/cjs/ui-react/with-react-editor-view-outer-listeners.js +29 -4
- package/dist/cjs/utils/breakout.js +4 -0
- package/dist/cjs/utils/browser-extensions.js +4 -0
- package/dist/cjs/utils/browser.js +47 -5
- package/dist/cjs/utils/commands.js +4 -1
- package/dist/cjs/utils/compareNodes.js +7 -0
- package/dist/cjs/utils/compose.js +2 -0
- package/dist/cjs/utils/create-wrap-selection-transaction.js +9 -1
- package/dist/cjs/utils/dom.js +2 -0
- package/dist/cjs/utils/editor-core-utils.js +5 -0
- package/dist/cjs/utils/filter/privacy-filter.js +2 -0
- package/dist/cjs/utils/get-performance-options.js +2 -0
- package/dist/cjs/utils/hyperlink.js +16 -0
- package/dist/cjs/utils/imageLoader.js +23 -0
- package/dist/cjs/utils/index.js +10 -0
- package/dist/cjs/utils/input-rules.js +4 -1
- package/dist/cjs/utils/macro.js +2 -0
- package/dist/cjs/utils/nodes.js +6 -1
- package/dist/cjs/utils/outdated-browsers.js +21 -1
- package/dist/cjs/utils/performance/is-performance-api-available.js +4 -1
- package/dist/cjs/utils/performance/measure-render.js +5 -0
- package/dist/cjs/utils/performance/measure-tti.js +5 -0
- package/dist/cjs/utils/plugin-state-factory.js +4 -0
- package/dist/cjs/utils/processRawValue.js +13 -1
- package/dist/cjs/utils/prosemirror/autojoin.js +2 -0
- package/dist/cjs/utils/referentiality.js +5 -0
- package/dist/cjs/utils/rich-media-utils.js +4 -1
- package/dist/cjs/utils/should-auto-linkify-tld.js +5 -0
- package/dist/cjs/utils/should-force-tracking.js +2 -0
- package/dist/cjs/utils/slice.js +2 -0
- package/dist/cjs/utils/track-unsupported-content.js +15 -2
- package/dist/cjs/utils/traversor.js +6 -0
- package/dist/cjs/utils/validate-using-spec.js +13 -1
- package/dist/cjs/utils/validator.js +19 -0
- package/dist/cjs/utils/withFeatureFlaggedComponent.js +4 -0
- package/dist/cjs/with-plugin-state/index.js +94 -20
- package/dist/es2019/analytics/analytics-queue.js +8 -0
- package/dist/es2019/analytics/linking-utils.js +2 -0
- package/dist/es2019/card/LinkToolbarButtonGroup.js +2 -0
- package/dist/es2019/card/MediaAndEmbedsToolbar/index.js +15 -3
- package/dist/es2019/card/ui/assets/card.js +4 -0
- package/dist/es2019/card/ui/assets/embed.js +4 -0
- package/dist/es2019/card/ui/assets/inline.js +4 -0
- package/dist/es2019/card/ui/assets/url.js +4 -0
- package/dist/es2019/clipboard/index.js +12 -1
- package/dist/es2019/collab/index.js +2 -0
- package/dist/es2019/commands/index.js +8 -2
- package/dist/es2019/commands/insert-block.js +10 -2
- package/dist/es2019/core-utils/document-logger.js +4 -0
- package/dist/es2019/doc-utils/editor-use-only.js +5 -1
- package/dist/es2019/element-browser/ElementBrowser.js +2 -0
- package/dist/es2019/element-browser/ViewMore.js +8 -2
- package/dist/es2019/element-browser/components/CategoryList.js +2 -0
- package/dist/es2019/element-browser/components/ElementList/ElementList.js +12 -0
- package/dist/es2019/element-browser/components/StatelessElementBrowser.js +8 -2
- package/dist/es2019/element-browser/hooks/use-select-and-focus-on-arrow-navigation.js +13 -2
- package/dist/es2019/event-dispatcher/index.js +8 -0
- package/dist/es2019/extensibility/Extension/Extension/index.js +2 -0
- package/dist/es2019/extensibility/Extension/Lozenge/ExtensionLabel.js +10 -2
- package/dist/es2019/extensibility/Extension/Lozenge/index.js +3 -1
- package/dist/es2019/extensibility/Extension.js +2 -0
- package/dist/es2019/extensibility/ExtensionComponent.js +15 -1
- package/dist/es2019/extensibility/MultiBodiedExtension/index.js +4 -0
- package/dist/es2019/extensibility/extensionNodeView.js +3 -0
- package/dist/es2019/extensions/extension-fields-helpers.js +4 -0
- package/dist/es2019/extensions/extension-handlers.js +4 -0
- package/dist/es2019/extensions/module-helpers.js +11 -2
- package/dist/es2019/extensions/types/field-definitions.js +5 -0
- package/dist/es2019/floating-toolbar/index.js +18 -2
- package/dist/es2019/guideline/dynamicGuideline.js +4 -1
- package/dist/es2019/guideline/relativeGuideline.js +12 -3
- package/dist/es2019/guideline/snapping.js +4 -1
- package/dist/es2019/guideline/updateGuideline.js +4 -1
- package/dist/es2019/hooks/usePluginStateEffect.js +4 -0
- package/dist/es2019/hooks/useSharedPluginState.js +4 -0
- package/dist/es2019/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +3 -0
- package/dist/es2019/icons/shared/BorderIcon.js +4 -0
- package/dist/es2019/icons/shared/PanelErrorIcon.js +4 -0
- package/dist/es2019/icons/shared/PanelInfoIcon.js +4 -0
- package/dist/es2019/icons/shared/PanelNoteIcon.js +4 -0
- package/dist/es2019/icons/shared/PanelSuccessIcon.js +4 -0
- package/dist/es2019/icons/shared/PanelWarningIcon.js +4 -0
- package/dist/es2019/insert/index.js +6 -1
- package/dist/es2019/keymaps/index.js +46 -4
- package/dist/es2019/keymaps/keymap.js +4 -0
- package/dist/es2019/lazy-node-view/css-helper.js +4 -0
- package/dist/es2019/lazy-node-view/index.js +6 -1
- package/dist/es2019/lazy-node-view/node-view.js +2 -0
- package/dist/es2019/link/ConfigureLinkOverlay/Dropdown.js +2 -0
- package/dist/es2019/link/ConfigureLinkOverlay/StyledButton.js +4 -1
- package/dist/es2019/link/LinkPicker/EditorLinkPicker/index.js +4 -1
- package/dist/es2019/link/LinkPicker/EditorLinkPicker/useEscapeClickaway.js +9 -0
- package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +19 -0
- package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/index.js +2 -0
- package/dist/es2019/link/LinkSearch/LinkSearchList.js +2 -0
- package/dist/es2019/link/LinkSearch/LinkSearchListItem.js +2 -0
- package/dist/es2019/link/LinkSearch/index.js +13 -0
- package/dist/es2019/link/LinkSearch/withActivityProvider.js +3 -0
- package/dist/es2019/lists/analytics.js +2 -0
- package/dist/es2019/mark/commands.js +24 -3
- package/dist/es2019/media-inline/inline-image-card.js +4 -2
- package/dist/es2019/media-inline/inline-image-wrapper.js +2 -0
- package/dist/es2019/media-single/MediaBadges.js +2 -0
- package/dist/es2019/media-single/utils.js +5 -0
- package/dist/es2019/monitoring/environment.js +6 -1
- package/dist/es2019/monitoring/error.js +19 -3
- package/dist/es2019/node-width/index.js +6 -1
- package/dist/es2019/normalize-feature-flags.js +4 -1
- package/dist/es2019/paste/clipboard.js +2 -0
- package/dist/es2019/paste/md-plugins/ignore-list-heading-md-plugin.js +5 -0
- package/dist/es2019/paste/md-plugins/linkify-md-plugin.js +20 -0
- package/dist/es2019/paste/md-plugins/newline-md-plugin.js +5 -0
- package/dist/es2019/paste/md-plugins/paragraph-md-plugin.js +5 -0
- package/dist/es2019/portal/common.js +4 -1
- package/dist/es2019/preset/builder.js +8 -0
- package/dist/es2019/preset/core-plugin/index.js +5 -0
- package/dist/es2019/preset/core-plugin/requestDocument.js +3 -0
- package/dist/es2019/preset/plugin-injection-api.js +62 -6
- package/dist/es2019/provider-factory/provider-factory.js +8 -1
- package/dist/es2019/provider-factory/with-providers.js +12 -0
- package/dist/es2019/provider-helpers/combine-providers.js +7 -0
- package/dist/es2019/provider-helpers/promise-helpers.js +3 -0
- package/dist/es2019/quick-insert/assets/index.js +2 -0
- package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +4 -0
- package/dist/es2019/react-node-view/index.js +32 -2
- package/dist/es2019/resizer/BreakoutResizer.js +1 -7
- package/dist/es2019/resizer/Resizer.js +10 -2
- package/dist/es2019/safe-plugin/index.js +3 -0
- package/dist/es2019/selection/gap-cursor/actions.js +11 -2
- package/dist/es2019/selection/gap-cursor/selection.js +8 -0
- package/dist/es2019/selection/index.js +2 -0
- package/dist/es2019/selection-based-node-view/SelectionBasedNodeView.js +10 -1
- package/dist/es2019/styles/shared/lists.js +4 -1
- package/dist/es2019/transforms/code-block.js +6 -0
- package/dist/es2019/transforms/extension.js +14 -2
- package/dist/es2019/transforms/layout.js +6 -0
- package/dist/es2019/types/annotation/emitter.js +4 -0
- package/dist/es2019/types/index.js +3 -1
- package/dist/es2019/ui/Caption/index.js +4 -0
- package/dist/es2019/ui/ContextPanel/context.js +4 -0
- package/dist/es2019/ui/DropList/index.js +12 -2
- package/dist/es2019/ui/Emoji/index.js +2 -0
- package/dist/es2019/ui/ErrorBoundary/index.js +2 -0
- package/dist/es2019/ui/Expand/index.js +13 -6
- package/dist/es2019/ui/FloatingToolbar/Button.js +2 -0
- package/dist/es2019/ui/FloatingToolbar/ButtonSpotlightCard.js +4 -1
- package/dist/es2019/ui/FloatingToolbar/styles.js +3 -0
- package/dist/es2019/ui/IntlErrorBoundary/index.js +3 -0
- package/dist/es2019/ui/Layer/index.js +8 -0
- package/dist/es2019/ui/MediaSingle/grid.js +12 -2
- package/dist/es2019/ui/MediaSingle/index.js +2 -0
- package/dist/es2019/ui/MediaSingle/styled.js +6 -0
- package/dist/es2019/ui/Mention/mention-with-profilecard.js +4 -1
- package/dist/es2019/ui/Mention/mention-with-providers.js +18 -2
- package/dist/es2019/ui/OverflowShadow/index.js +19 -5
- package/dist/es2019/ui/OverflowShadow/shadowObserver.js +12 -2
- package/dist/es2019/ui/PanelTextInput/index.js +14 -0
- package/dist/es2019/ui/Popup/index.js +21 -1
- package/dist/es2019/ui/Popup/utils.js +19 -0
- package/dist/es2019/ui/ResizerLegacy/index.js +7 -0
- package/dist/es2019/ui/unsupported-content-helper.js +6 -1
- package/dist/es2019/ui/with-outer-listeners.js +12 -1
- package/dist/es2019/ui-color/ColorPalette/utils.js +2 -0
- package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.js +9 -0
- package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +12 -0
- package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/index.js +4 -0
- package/dist/es2019/ui-menu/Dropdown/index.js +9 -2
- package/dist/es2019/ui-menu/DropdownContainer/index.js +4 -1
- package/dist/es2019/ui-menu/DropdownMenu/index.js +20 -3
- package/dist/es2019/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +17 -0
- package/dist/es2019/ui-menu/ToolbarButton/styles.js +2 -0
- package/dist/es2019/ui-react/with-react-editor-view-outer-listeners.js +27 -4
- package/dist/es2019/utils/breakout.js +4 -0
- package/dist/es2019/utils/browser-extensions.js +4 -0
- package/dist/es2019/utils/browser.js +47 -5
- package/dist/es2019/utils/commands.js +4 -1
- package/dist/es2019/utils/compare-props.js +4 -1
- package/dist/es2019/utils/compareNodes.js +7 -0
- package/dist/es2019/utils/compose.js +2 -0
- package/dist/es2019/utils/create-wrap-selection-transaction.js +9 -1
- package/dist/es2019/utils/dom.js +2 -0
- package/dist/es2019/utils/editor-core-utils.js +5 -0
- package/dist/es2019/utils/filter/privacy-filter.js +2 -0
- package/dist/es2019/utils/get-performance-options.js +2 -0
- package/dist/es2019/utils/hyperlink.js +16 -0
- package/dist/es2019/utils/imageLoader.js +23 -0
- package/dist/es2019/utils/index.js +11 -0
- package/dist/es2019/utils/input-rules.js +4 -1
- package/dist/es2019/utils/macro.js +2 -0
- package/dist/es2019/utils/nodes.js +6 -1
- package/dist/es2019/utils/outdated-browsers.js +21 -1
- package/dist/es2019/utils/performance/is-performance-api-available.js +4 -1
- package/dist/es2019/utils/performance/measure-render.js +6 -1
- package/dist/es2019/utils/performance/measure-tti.js +6 -0
- package/dist/es2019/utils/plugin-state-factory.js +4 -0
- package/dist/es2019/utils/processRawValue.js +13 -1
- package/dist/es2019/utils/prosemirror/autojoin.js +2 -0
- package/dist/es2019/utils/referentiality.js +5 -0
- package/dist/es2019/utils/rich-media-utils.js +4 -1
- package/dist/es2019/utils/should-auto-linkify-tld.js +5 -0
- package/dist/es2019/utils/should-force-tracking.js +2 -0
- package/dist/es2019/utils/slice.js +2 -0
- package/dist/es2019/utils/track-unsupported-content.js +19 -3
- package/dist/es2019/utils/traversor.js +7 -0
- package/dist/es2019/utils/validate-using-spec.js +13 -1
- package/dist/es2019/utils/validator.js +19 -0
- package/dist/es2019/utils/withFeatureFlaggedComponent.js +4 -0
- package/dist/es2019/with-plugin-state/index.js +77 -3
- package/dist/esm/analytics/analytics-queue.js +8 -0
- package/dist/esm/analytics/linking-utils.js +2 -0
- package/dist/esm/card/LinkToolbarButtonGroup.js +2 -0
- package/dist/esm/card/MediaAndEmbedsToolbar/index.js +15 -3
- package/dist/esm/card/ui/assets/card.js +4 -0
- package/dist/esm/card/ui/assets/embed.js +4 -0
- package/dist/esm/card/ui/assets/inline.js +4 -0
- package/dist/esm/card/ui/assets/url.js +4 -0
- package/dist/esm/clipboard/index.js +11 -1
- package/dist/esm/collab/index.js +2 -0
- package/dist/esm/commands/index.js +50 -42
- package/dist/esm/commands/insert-block.js +10 -2
- package/dist/esm/core-utils/document-logger.js +4 -0
- package/dist/esm/doc-utils/editor-use-only.js +8 -3
- package/dist/esm/element-browser/ElementBrowser.js +2 -0
- package/dist/esm/element-browser/ViewMore.js +8 -2
- package/dist/esm/element-browser/components/CategoryList.js +2 -0
- package/dist/esm/element-browser/components/ElementList/ElementList.js +12 -0
- package/dist/esm/element-browser/components/StatelessElementBrowser.js +8 -2
- package/dist/esm/element-browser/hooks/use-select-and-focus-on-arrow-navigation.js +13 -2
- package/dist/esm/event-dispatcher/index.js +8 -0
- package/dist/esm/extensibility/Extension/Extension/index.js +2 -0
- package/dist/esm/extensibility/Extension/Lozenge/ExtensionLabel.js +10 -2
- package/dist/esm/extensibility/Extension/Lozenge/index.js +3 -1
- package/dist/esm/extensibility/Extension.js +2 -0
- package/dist/esm/extensibility/ExtensionComponent.js +17 -2
- package/dist/esm/extensibility/MultiBodiedExtension/index.js +4 -0
- package/dist/esm/extensibility/extensionNodeView.js +3 -0
- package/dist/esm/extensions/extension-fields-helpers.js +4 -1
- package/dist/esm/extensions/extension-handlers.js +4 -0
- package/dist/esm/extensions/module-helpers.js +15 -5
- package/dist/esm/extensions/types/field-definitions.js +5 -0
- package/dist/esm/floating-toolbar/index.js +18 -2
- package/dist/esm/guideline/dynamicGuideline.js +4 -1
- package/dist/esm/guideline/relativeGuideline.js +12 -3
- package/dist/esm/guideline/updateGuideline.js +4 -1
- package/dist/esm/hooks/usePluginStateEffect.js +4 -0
- package/dist/esm/hooks/useSharedPluginState.js +4 -0
- package/dist/esm/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +3 -0
- package/dist/esm/icons/shared/BorderIcon.js +4 -0
- package/dist/esm/icons/shared/PanelErrorIcon.js +4 -0
- package/dist/esm/icons/shared/PanelInfoIcon.js +4 -0
- package/dist/esm/icons/shared/PanelNoteIcon.js +4 -0
- package/dist/esm/icons/shared/PanelSuccessIcon.js +4 -0
- package/dist/esm/icons/shared/PanelWarningIcon.js +4 -0
- package/dist/esm/insert/index.js +6 -1
- package/dist/esm/keymaps/index.js +48 -5
- package/dist/esm/keymaps/keymap.js +4 -0
- package/dist/esm/lazy-node-view/css-helper.js +4 -0
- package/dist/esm/lazy-node-view/index.js +6 -1
- package/dist/esm/lazy-node-view/node-view.js +2 -0
- package/dist/esm/link/ConfigureLinkOverlay/Dropdown.js +2 -0
- package/dist/esm/link/ConfigureLinkOverlay/StyledButton.js +4 -1
- package/dist/esm/link/LinkPicker/EditorLinkPicker/index.js +4 -1
- package/dist/esm/link/LinkPicker/EditorLinkPicker/useEscapeClickaway.js +9 -0
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +16 -1
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/index.js +2 -0
- package/dist/esm/link/LinkSearch/LinkSearchList.js +2 -0
- package/dist/esm/link/LinkSearch/LinkSearchListItem.js +2 -0
- package/dist/esm/link/LinkSearch/index.js +9 -1
- package/dist/esm/link/LinkSearch/withActivityProvider.js +3 -0
- package/dist/esm/lists/analytics.js +2 -0
- package/dist/esm/mark/commands.js +24 -3
- package/dist/esm/media-inline/inline-image-card.js +4 -2
- package/dist/esm/media-inline/inline-image-wrapper.js +2 -0
- package/dist/esm/media-single/MediaBadges.js +2 -0
- package/dist/esm/media-single/utils.js +5 -0
- package/dist/esm/monitoring/environment.js +6 -1
- package/dist/esm/monitoring/error.js +19 -3
- package/dist/esm/node-width/index.js +6 -1
- package/dist/esm/normalize-feature-flags.js +4 -1
- package/dist/esm/paste/clipboard.js +2 -0
- package/dist/esm/paste/md-plugins/ignore-list-heading-md-plugin.js +5 -0
- package/dist/esm/paste/md-plugins/linkify-md-plugin.js +20 -0
- package/dist/esm/paste/md-plugins/newline-md-plugin.js +5 -0
- package/dist/esm/paste/md-plugins/paragraph-md-plugin.js +5 -0
- package/dist/esm/portal/common.js +4 -1
- package/dist/esm/preset/builder.js +8 -0
- package/dist/esm/preset/core-plugin/index.js +5 -0
- package/dist/esm/preset/core-plugin/requestDocument.js +3 -0
- package/dist/esm/preset/plugin-injection-api.js +62 -6
- package/dist/esm/provider-factory/provider-factory.js +8 -1
- package/dist/esm/provider-factory/with-providers.js +12 -0
- package/dist/esm/provider-helpers/combine-providers.js +7 -0
- package/dist/esm/provider-helpers/promise-helpers.js +3 -0
- package/dist/esm/quick-insert/assets/index.js +2 -0
- package/dist/esm/react-node-view/getInlineNodeViewProducer.js +4 -0
- package/dist/esm/react-node-view/index.js +33 -2
- package/dist/esm/resizer/BreakoutResizer.js +1 -7
- package/dist/esm/resizer/Resizer.js +10 -2
- package/dist/esm/safe-plugin/index.js +3 -0
- package/dist/esm/selection/gap-cursor/actions.js +11 -2
- package/dist/esm/selection/gap-cursor/selection.js +8 -0
- package/dist/esm/selection/index.js +2 -0
- package/dist/esm/selection-based-node-view/SelectionBasedNodeView.js +10 -1
- package/dist/esm/styles/shared/lists.js +4 -1
- package/dist/esm/transforms/code-block.js +6 -0
- package/dist/esm/transforms/extension.js +14 -2
- package/dist/esm/transforms/layout.js +6 -0
- package/dist/esm/types/annotation/emitter.js +8 -2
- package/dist/esm/types/index.js +3 -1
- package/dist/esm/ui/Caption/index.js +4 -0
- package/dist/esm/ui/ContextPanel/context.js +4 -0
- package/dist/esm/ui/DropList/index.js +11 -1
- package/dist/esm/ui/Emoji/index.js +2 -0
- package/dist/esm/ui/ErrorBoundary/index.js +2 -0
- package/dist/esm/ui/Expand/index.js +13 -6
- package/dist/esm/ui/FloatingToolbar/Button.js +2 -0
- package/dist/esm/ui/FloatingToolbar/ButtonSpotlightCard.js +4 -1
- package/dist/esm/ui/FloatingToolbar/styles.js +3 -0
- package/dist/esm/ui/IntlErrorBoundary/index.js +3 -0
- package/dist/esm/ui/Layer/index.js +8 -0
- package/dist/esm/ui/MediaSingle/grid.js +12 -2
- package/dist/esm/ui/MediaSingle/index.js +2 -0
- package/dist/esm/ui/MediaSingle/styled.js +6 -0
- package/dist/esm/ui/Mention/mention-with-profilecard.js +4 -1
- package/dist/esm/ui/Mention/mention-with-providers.js +20 -3
- package/dist/esm/ui/OverflowShadow/index.js +18 -4
- package/dist/esm/ui/OverflowShadow/shadowObserver.js +12 -2
- package/dist/esm/ui/PanelTextInput/index.js +16 -1
- package/dist/esm/ui/Popup/index.js +23 -2
- package/dist/esm/ui/Popup/utils.js +19 -0
- package/dist/esm/ui/ResizerLegacy/index.js +7 -0
- package/dist/esm/ui/unsupported-content-helper.js +6 -1
- package/dist/esm/ui/with-outer-listeners.js +12 -1
- package/dist/esm/ui-color/ColorPalette/utils.js +2 -0
- package/dist/esm/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.js +9 -0
- package/dist/esm/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +12 -0
- package/dist/esm/ui-menu/ArrowKeyNavigationProvider/index.js +4 -0
- package/dist/esm/ui-menu/Dropdown/index.js +9 -2
- package/dist/esm/ui-menu/DropdownContainer/index.js +4 -1
- package/dist/esm/ui-menu/DropdownMenu/index.js +20 -3
- package/dist/esm/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +17 -0
- package/dist/esm/ui-menu/ToolbarButton/styles.js +2 -0
- package/dist/esm/ui-react/with-react-editor-view-outer-listeners.js +29 -4
- package/dist/esm/utils/breakout.js +4 -0
- package/dist/esm/utils/browser-extensions.js +4 -0
- package/dist/esm/utils/browser.js +47 -5
- package/dist/esm/utils/commands.js +4 -1
- package/dist/esm/utils/compareNodes.js +7 -0
- package/dist/esm/utils/compose.js +2 -0
- package/dist/esm/utils/create-wrap-selection-transaction.js +9 -1
- package/dist/esm/utils/dom.js +2 -0
- package/dist/esm/utils/editor-core-utils.js +5 -0
- package/dist/esm/utils/filter/privacy-filter.js +2 -0
- package/dist/esm/utils/get-performance-options.js +2 -0
- package/dist/esm/utils/hyperlink.js +16 -0
- package/dist/esm/utils/imageLoader.js +23 -0
- package/dist/esm/utils/index.js +11 -0
- package/dist/esm/utils/input-rules.js +4 -1
- package/dist/esm/utils/macro.js +2 -0
- package/dist/esm/utils/nodes.js +6 -1
- package/dist/esm/utils/outdated-browsers.js +21 -1
- package/dist/esm/utils/performance/is-performance-api-available.js +4 -1
- package/dist/esm/utils/performance/measure-render.js +5 -0
- package/dist/esm/utils/performance/measure-tti.js +6 -0
- package/dist/esm/utils/plugin-state-factory.js +4 -0
- package/dist/esm/utils/processRawValue.js +13 -1
- package/dist/esm/utils/prosemirror/autojoin.js +2 -0
- package/dist/esm/utils/referentiality.js +5 -0
- package/dist/esm/utils/rich-media-utils.js +4 -1
- package/dist/esm/utils/should-auto-linkify-tld.js +5 -0
- package/dist/esm/utils/should-force-tracking.js +2 -0
- package/dist/esm/utils/slice.js +2 -0
- package/dist/esm/utils/track-unsupported-content.js +15 -2
- package/dist/esm/utils/traversor.js +6 -0
- package/dist/esm/utils/validate-using-spec.js +13 -1
- package/dist/esm/utils/validator.js +19 -0
- package/dist/esm/utils/withFeatureFlaggedComponent.js +4 -0
- package/dist/esm/with-plugin-state/index.js +95 -19
- package/dist/types/analytics/types/avatar.d.ts +1 -1
- package/dist/types/analytics/types/toolbar-button.d.ts +1 -1
- package/dist/types/analytics/types/utils.d.ts +2 -2
- package/dist/types/annotation/index.d.ts +1 -1
- package/dist/types/commands/index.d.ts +3 -3
- package/dist/types/guideline/types.d.ts +1 -2
- package/dist/types/hooks/usePluginStateEffect.d.ts +2 -1
- package/dist/types/link/LinkPicker/EditorLinkPicker/index.d.ts +1 -1
- package/dist/types/link/LinkSearch/LinkSearchList.d.ts +1 -1
- package/dist/types/provider-factory/macro-provider.d.ts +1 -1
- package/dist/types/selection/types.d.ts +1 -2
- package/dist/types/types/floating-toolbar.d.ts +16 -16
- package/dist/types/types/hyperlink.d.ts +1 -2
- package/dist/types/ui/Mention/index.d.ts +1 -1
- package/dist/types/ui-react/with-react-editor-view-outer-listeners.d.ts +1 -1
- package/dist/types/utils/imageLoader.d.ts +2 -2
- package/dist/types-ts4.5/analytics/types/avatar.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/toolbar-button.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/utils.d.ts +2 -2
- package/dist/types-ts4.5/annotation/index.d.ts +1 -1
- package/dist/types-ts4.5/commands/index.d.ts +3 -3
- package/dist/types-ts4.5/guideline/types.d.ts +1 -2
- package/dist/types-ts4.5/hooks/usePluginStateEffect.d.ts +2 -1
- package/dist/types-ts4.5/link/LinkPicker/EditorLinkPicker/index.d.ts +1 -1
- package/dist/types-ts4.5/link/LinkSearch/LinkSearchList.d.ts +1 -1
- package/dist/types-ts4.5/provider-factory/macro-provider.d.ts +1 -1
- package/dist/types-ts4.5/selection/types.d.ts +1 -2
- package/dist/types-ts4.5/types/floating-toolbar.d.ts +16 -16
- package/dist/types-ts4.5/types/hyperlink.d.ts +1 -2
- package/dist/types-ts4.5/ui/Mention/index.d.ts +1 -1
- package/dist/types-ts4.5/ui-react/with-react-editor-view-outer-listeners.d.ts +1 -1
- package/dist/types-ts4.5/utils/imageLoader.d.ts +2 -2
- package/package.json +7 -7
- package/tsconfig.json +0 -1
|
@@ -9,15 +9,26 @@ import { findFilepaths, isLinkInMatches, shouldAutoLinkifyMatch } from '../../ut
|
|
|
9
9
|
|
|
10
10
|
// modified version of the original markdown-it Linkify plugin
|
|
11
11
|
// https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js
|
|
12
|
+
// Ignored via go/ees005
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
14
|
const arrayReplaceAt = (src, pos, newElements) => {
|
|
15
|
+
// Ignored via go/ees005
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
17
|
return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));
|
|
14
18
|
};
|
|
15
19
|
const isLinkOpen = str => {
|
|
20
|
+
// Ignored via go/ees005
|
|
21
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
16
22
|
return /^<a[>\s]/i.test(str);
|
|
17
23
|
};
|
|
18
24
|
const isLinkClose = str => {
|
|
25
|
+
// Ignored via go/ees005
|
|
26
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
19
27
|
return /^<\/a\s*>/i.test(str);
|
|
20
28
|
};
|
|
29
|
+
|
|
30
|
+
// Ignored via go/ees005
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
32
|
const linkify = state => {
|
|
22
33
|
const blockTokens = state.tokens;
|
|
23
34
|
const linkify = new LinkifyIt();
|
|
@@ -85,8 +96,14 @@ const linkify = state => {
|
|
|
85
96
|
// and remove it afterwards.
|
|
86
97
|
//
|
|
87
98
|
if (!links[ln].schema) {
|
|
99
|
+
// Ignored via go/ees005
|
|
100
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
88
101
|
urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, '');
|
|
102
|
+
// Ignored via go/ees005
|
|
103
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
89
104
|
} else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) {
|
|
105
|
+
// Ignored via go/ees005
|
|
106
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
90
107
|
urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, '');
|
|
91
108
|
} else {
|
|
92
109
|
urlText = state.md.normalizeLinkText(urlText);
|
|
@@ -128,4 +145,7 @@ const linkify = state => {
|
|
|
128
145
|
}
|
|
129
146
|
}
|
|
130
147
|
};
|
|
148
|
+
|
|
149
|
+
// Ignored via go/ees005
|
|
150
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
131
151
|
export default (md => md.core.ruler.push('custom-linkify', linkify));
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
// ED-15363: modified version of the original newline plugin
|
|
5
5
|
// https://github.com/markdown-it/markdown-it/blob/master/lib/rules_inline/newline.js
|
|
6
|
+
// Ignored via go/ees005
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
8
|
const newline = (state, silent) => {
|
|
7
9
|
let pmax,
|
|
8
10
|
// ED-15363: unread variables
|
|
@@ -55,4 +57,7 @@ const newline = (state, silent) => {
|
|
|
55
57
|
state.pos = pos;
|
|
56
58
|
return true;
|
|
57
59
|
};
|
|
60
|
+
|
|
61
|
+
// Ignored via go/ees005
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
58
63
|
export default (md => md.inline.ruler.at('newline', newline));
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
// ED-15363: modified version of the original paragraph plugin
|
|
5
5
|
// https://github.com/markdown-it/markdown-it/blob/master/lib/rules_block/paragraph.js
|
|
6
6
|
|
|
7
|
+
// Ignored via go/ees005
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
9
|
const paragraph = (state, startLine) => {
|
|
8
10
|
let content,
|
|
9
11
|
terminate,
|
|
@@ -61,4 +63,7 @@ const paragraph = (state, startLine) => {
|
|
|
61
63
|
state.parentType = oldParentType;
|
|
62
64
|
return true;
|
|
63
65
|
};
|
|
66
|
+
|
|
67
|
+
// Ignored via go/ees005
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
69
|
export default (md => md.block.ruler.at('paragraph', paragraph));
|
|
@@ -10,7 +10,10 @@ export function createPortalRendererComponent(portalManager) {
|
|
|
10
10
|
portalManager.unregisterPortalRenderer();
|
|
11
11
|
};
|
|
12
12
|
}, []);
|
|
13
|
-
const portalsElements = useMemo(
|
|
13
|
+
const portalsElements = useMemo(
|
|
14
|
+
// Ignored via go/ees005
|
|
15
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
16
|
+
() => buckets.map((_, i) => /*#__PURE__*/React.createElement(PortalBucket, {
|
|
14
17
|
key: i,
|
|
15
18
|
id: i,
|
|
16
19
|
portalManager: portalManager
|
|
@@ -316,6 +316,8 @@ import { EventDispatcher } from '../event-dispatcher';
|
|
|
316
316
|
* configurations.
|
|
317
317
|
*
|
|
318
318
|
*/
|
|
319
|
+
// Ignored via go/ees005
|
|
320
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
319
321
|
|
|
320
322
|
/**
|
|
321
323
|
* 🧱 Internal Type: Editor FE Platform
|
|
@@ -345,6 +347,8 @@ import { EventDispatcher } from '../event-dispatcher';
|
|
|
345
347
|
*
|
|
346
348
|
* It is being used to separate plugins registred with `preset.maybeAdd` and `preset.add`.
|
|
347
349
|
*/
|
|
350
|
+
// Ignored via go/ees005
|
|
351
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
348
352
|
|
|
349
353
|
/**
|
|
350
354
|
* 🧱 Internal Type: Editor FE Platform
|
|
@@ -448,6 +452,8 @@ import { EventDispatcher } from '../event-dispatcher';
|
|
|
448
452
|
*
|
|
449
453
|
* ```
|
|
450
454
|
*/
|
|
455
|
+
// Ignored via go/ees005
|
|
456
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
451
457
|
|
|
452
458
|
/**
|
|
453
459
|
* 🧱 Internal Type: Editor FE Platform
|
|
@@ -491,6 +497,8 @@ import { EventDispatcher } from '../event-dispatcher';
|
|
|
491
497
|
* api.cat?.actions
|
|
492
498
|
* ```
|
|
493
499
|
*/
|
|
500
|
+
// Ignored via go/ees005
|
|
501
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
494
502
|
|
|
495
503
|
/*************************
|
|
496
504
|
* *
|
|
@@ -42,6 +42,9 @@ export const corePlugin = ({
|
|
|
42
42
|
if (!editorView || !editorView.hasFocus()) {
|
|
43
43
|
return false;
|
|
44
44
|
}
|
|
45
|
+
|
|
46
|
+
// Ignored via go/ees005
|
|
47
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
45
48
|
editorView.dom.blur();
|
|
46
49
|
return true;
|
|
47
50
|
},
|
|
@@ -69,6 +72,8 @@ export const corePlugin = ({
|
|
|
69
72
|
}
|
|
70
73
|
return false;
|
|
71
74
|
},
|
|
75
|
+
// Ignored via go/ees005
|
|
76
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
77
|
requestDocument(onReceive, options) {
|
|
73
78
|
var _config$getEditorView;
|
|
74
79
|
const view = (_config$getEditorView = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView !== void 0 ? _config$getEditorView : null;
|
|
@@ -33,6 +33,9 @@ function createThrottleSchedule(callback) {
|
|
|
33
33
|
return wrapperFn;
|
|
34
34
|
}
|
|
35
35
|
export const scheduleDocumentRequest = createThrottleSchedule(returnDocumentRequest);
|
|
36
|
+
|
|
37
|
+
// Ignored via go/ees005
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/max-params
|
|
36
39
|
function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent) {
|
|
37
40
|
var _editorView$state;
|
|
38
41
|
const {
|
|
@@ -2,13 +2,45 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import isEqual from 'lodash/isEqual';
|
|
3
3
|
import throttle from 'lodash/throttle';
|
|
4
4
|
import { corePlugin } from './core-plugin';
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
// Ignored via go/ees005
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
+
|
|
9
|
+
function hasGetSharedState(
|
|
10
|
+
// Ignored via go/ees005
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
+
plugin
|
|
13
|
+
// Ignored via go/ees005
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
|
+
) {
|
|
16
|
+
// Ignored via go/ees005
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
18
|
return typeof plugin.getSharedState === 'function';
|
|
7
19
|
}
|
|
8
|
-
function hasActions(
|
|
20
|
+
function hasActions(
|
|
21
|
+
// Ignored via go/ees005
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
+
plugin
|
|
24
|
+
// Ignored via go/ees005
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
|
+
// Ignored via go/ees005
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
) {
|
|
29
|
+
// Ignored via go/ees005
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
31
|
return typeof plugin.actions === 'object';
|
|
10
32
|
}
|
|
11
|
-
function hasCommands(
|
|
33
|
+
function hasCommands(
|
|
34
|
+
// Ignored via go/ees005
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
36
|
+
plugin
|
|
37
|
+
// Ignored via go/ees005
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
|
+
// Ignored via go/ees005
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
+
) {
|
|
42
|
+
// Ignored via go/ees005
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
44
|
return typeof plugin.commands === 'object';
|
|
13
45
|
}
|
|
14
46
|
const filterPluginsWithListeners = ({
|
|
@@ -62,7 +94,13 @@ const notifyListenersThrottled = throttle(({
|
|
|
62
94
|
}, THROTTLE_CALLS_FOR_MILLISECONDS);
|
|
63
95
|
export class PluginsData {}
|
|
64
96
|
class ActionsAPI {
|
|
65
|
-
createAPI(
|
|
97
|
+
createAPI(
|
|
98
|
+
// Ignored via go/ees005
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
100
|
+
plugin
|
|
101
|
+
// Ignored via go/ees005
|
|
102
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
103
|
+
) {
|
|
66
104
|
if (!plugin || !hasActions(plugin)) {
|
|
67
105
|
return {};
|
|
68
106
|
}
|
|
@@ -75,7 +113,13 @@ class ActionsAPI {
|
|
|
75
113
|
}
|
|
76
114
|
}
|
|
77
115
|
class EditorCommandsAPI {
|
|
78
|
-
createAPI(
|
|
116
|
+
createAPI(
|
|
117
|
+
// Ignored via go/ees005
|
|
118
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
119
|
+
plugin
|
|
120
|
+
// Ignored via go/ees005
|
|
121
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
122
|
+
) {
|
|
79
123
|
if (!plugin || !hasCommands(plugin)) {
|
|
80
124
|
return {};
|
|
81
125
|
}
|
|
@@ -95,7 +139,10 @@ export class SharedStateAPI {
|
|
|
95
139
|
this.getEditorState = getEditorState;
|
|
96
140
|
this.listeners = new Map();
|
|
97
141
|
}
|
|
98
|
-
createAPI(plugin
|
|
142
|
+
createAPI(plugin
|
|
143
|
+
// Ignored via go/ees005
|
|
144
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
145
|
+
) {
|
|
99
146
|
if (!plugin) {
|
|
100
147
|
return {
|
|
101
148
|
currentState: () => undefined,
|
|
@@ -214,6 +261,9 @@ export class EditorPluginInjectionAPI {
|
|
|
214
261
|
commandsAPI,
|
|
215
262
|
getPluginByName
|
|
216
263
|
} = this;
|
|
264
|
+
|
|
265
|
+
// Ignored via go/ees005
|
|
266
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
217
267
|
return new Proxy({}, {
|
|
218
268
|
get: function (target, prop, receiver) {
|
|
219
269
|
// If we pass this as a prop React hates us
|
|
@@ -228,6 +278,9 @@ export class EditorPluginInjectionAPI {
|
|
|
228
278
|
const sharedState = sharedStateAPI.createAPI(plugin);
|
|
229
279
|
const actions = actionsAPI.createAPI(plugin);
|
|
230
280
|
const commands = commandsAPI.createAPI(plugin);
|
|
281
|
+
|
|
282
|
+
// Ignored via go/ees005
|
|
283
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
231
284
|
const proxyCoreAPI = {
|
|
232
285
|
sharedState,
|
|
233
286
|
actions,
|
|
@@ -241,6 +294,9 @@ export class EditorPluginInjectionAPI {
|
|
|
241
294
|
if (!editorAPICache.get(this)) {
|
|
242
295
|
editorAPICache.set(this, this.createAPI());
|
|
243
296
|
}
|
|
297
|
+
|
|
298
|
+
// Ignored via go/ees005
|
|
299
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
244
300
|
return editorAPICache.get(this);
|
|
245
301
|
}
|
|
246
302
|
}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
// Ignored via go/ees005
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
4
|
function isUndefined(x) {
|
|
3
5
|
return x === undefined;
|
|
4
6
|
}
|
|
5
7
|
export default class ProviderFactory {
|
|
6
8
|
constructor() {
|
|
9
|
+
// Ignored via go/ees005
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
11
|
_defineProperty(this, "providers", new Map());
|
|
8
12
|
_defineProperty(this, "subscribers", new Map());
|
|
9
13
|
}
|
|
10
|
-
static create(
|
|
14
|
+
static create(
|
|
15
|
+
// Ignored via go/ees005
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
+
providers) {
|
|
11
18
|
const providerFactory = new ProviderFactory();
|
|
12
19
|
const keys = Object.keys(providers);
|
|
13
20
|
keys.forEach(name => {
|
|
@@ -2,16 +2,22 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
/* eslint-disable @repo/internal/react/no-class-components */
|
|
3
3
|
import { PureComponent } from 'react';
|
|
4
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
|
+
// Ignored via go/ees005
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
7
|
export class WithProviders extends PureComponent {
|
|
6
8
|
constructor(props) {
|
|
7
9
|
super(props);
|
|
8
10
|
_defineProperty(this, "mounted", false);
|
|
11
|
+
// Ignored via go/ees005
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
13
|
_defineProperty(this, "handleProviderIfMounted", (name, provider) => {
|
|
10
14
|
if (!this.mounted) {
|
|
11
15
|
return;
|
|
12
16
|
}
|
|
13
17
|
this.handleProvider(name, provider);
|
|
14
18
|
});
|
|
19
|
+
// Ignored via go/ees005
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
21
|
_defineProperty(this, "handleProvider", (name, provider) => {
|
|
16
22
|
this.setState(({
|
|
17
23
|
providers
|
|
@@ -25,6 +31,9 @@ export class WithProviders extends PureComponent {
|
|
|
25
31
|
});
|
|
26
32
|
});
|
|
27
33
|
this.mounted = false;
|
|
34
|
+
|
|
35
|
+
// Ignored via go/ees005
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
37
|
const _providers = {};
|
|
29
38
|
this.props.providers.forEach(name => {
|
|
30
39
|
if (fg('platform_editor_react18_phase2_v2')) {
|
|
@@ -41,6 +50,9 @@ export class WithProviders extends PureComponent {
|
|
|
41
50
|
componentDidMount() {
|
|
42
51
|
this.mounted = true;
|
|
43
52
|
}
|
|
53
|
+
|
|
54
|
+
// Ignored via go/ees005
|
|
55
|
+
// eslint-disable-next-line react/no-unsafe
|
|
44
56
|
UNSAFE_componentWillMount() {
|
|
45
57
|
if (!fg('platform_editor_react18_phase2_v2')) {
|
|
46
58
|
const {
|
|
@@ -16,6 +16,9 @@ export default (providers => {
|
|
|
16
16
|
const runInAllProviders = async mapFunction => {
|
|
17
17
|
return (await getFulfilledProviders()).map(provider => mapFunction(provider));
|
|
18
18
|
};
|
|
19
|
+
|
|
20
|
+
// Ignored via go/ees005
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
22
|
const createCallback = (methodName, args) => provider => {
|
|
20
23
|
const method = provider[methodName];
|
|
21
24
|
if (typeof method === 'function') {
|
|
@@ -29,6 +32,8 @@ export default (providers => {
|
|
|
29
32
|
* @param methodName
|
|
30
33
|
* @param args
|
|
31
34
|
*/
|
|
35
|
+
// Ignored via go/ees005
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
37
|
const invokeSingle = async (methodName, args) => {
|
|
33
38
|
const callback = createCallback(methodName, args);
|
|
34
39
|
return waitForFirstFulfilledPromise(await runInAllProviders(callback));
|
|
@@ -39,6 +44,8 @@ export default (providers => {
|
|
|
39
44
|
* @param methodName
|
|
40
45
|
* @param args
|
|
41
46
|
*/
|
|
47
|
+
// Ignored via go/ees005
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
49
|
const invokeList = async (methodName, args) => {
|
|
43
50
|
const callback = createCallback(methodName, args);
|
|
44
51
|
const results = await waitForAllPromises(await runInAllProviders(callback));
|
|
@@ -8,6 +8,9 @@ const markFullfilled = value => ({
|
|
|
8
8
|
status: ResultStatus.FULFILLED,
|
|
9
9
|
value: value
|
|
10
10
|
});
|
|
11
|
+
|
|
12
|
+
// Ignored via go/ees005
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
14
|
const markRejected = error => ({
|
|
12
15
|
status: ResultStatus.FAILED,
|
|
13
16
|
reason: error
|
|
@@ -121,6 +121,8 @@ export const IconHeading = ({
|
|
|
121
121
|
loader: () => importHeading(level).then(module => module.default),
|
|
122
122
|
loading: () => null
|
|
123
123
|
});
|
|
124
|
+
// Ignored via go/ees005
|
|
125
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
124
126
|
return /*#__PURE__*/React.createElement(Icon, props);
|
|
125
127
|
};
|
|
126
128
|
export const IconFeedback = Loadable({
|
|
@@ -179,9 +179,13 @@ function getPortalChildren({
|
|
|
179
179
|
}), ZERO_WIDTH_SPACE), jsx(Component, _extends({
|
|
180
180
|
view: nodeViewParams.view
|
|
181
181
|
// TODO: ED-13910 - Remove the boolean to fix the prosemirror view type
|
|
182
|
+
// Ignored via go/ees005
|
|
183
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
182
184
|
,
|
|
183
185
|
getPos: nodeViewParams.getPos,
|
|
184
186
|
node: currentNode
|
|
187
|
+
// Ignored via go/ees005
|
|
188
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
185
189
|
}, extraComponentProps)), browser.android ?
|
|
186
190
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
187
191
|
jsx("span", {
|
|
@@ -12,7 +12,14 @@ import { analyticsEventKey } from '../utils/analytics';
|
|
|
12
12
|
import { generateUniqueNodeKey } from './generateUniqueNodeKey';
|
|
13
13
|
export { getInlineNodeViewProducer, inlineNodeViewClassname } from './getInlineNodeViewProducer';
|
|
14
14
|
export default class ReactNodeView {
|
|
15
|
-
|
|
15
|
+
// Ignored via go/ees005
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
17
|
+
constructor(_node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps,
|
|
18
|
+
// Ignored via go/ees005
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
+
reactComponent, viewShouldUpdate) {
|
|
21
|
+
// Ignored via go/ees005
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
23
|
_defineProperty(this, "decorations", []);
|
|
17
24
|
_defineProperty(this, "handleRef", node => this._handleRef(node));
|
|
18
25
|
_defineProperty(this, "dispatchAnalyticsEvent", payload => {
|
|
@@ -81,6 +88,9 @@ export default class ReactNodeView {
|
|
|
81
88
|
});
|
|
82
89
|
return this;
|
|
83
90
|
}
|
|
91
|
+
|
|
92
|
+
// Ignored via go/ees005
|
|
93
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
84
94
|
renderReactComponent(component) {
|
|
85
95
|
if (!this.domRef || !component) {
|
|
86
96
|
return;
|
|
@@ -93,6 +103,9 @@ export default class ReactNodeView {
|
|
|
93
103
|
dispatchAnalyticsEvent: this.dispatchAnalyticsEvent
|
|
94
104
|
}, component());
|
|
95
105
|
};
|
|
106
|
+
|
|
107
|
+
// Ignored via go/ees005
|
|
108
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
96
109
|
this.portalProviderAPI.render(componentWithErrorBoundary, this.domRef, this.key);
|
|
97
110
|
}
|
|
98
111
|
createDomRef() {
|
|
@@ -108,6 +121,8 @@ export default class ReactNodeView {
|
|
|
108
121
|
_handleRef(node) {
|
|
109
122
|
const contentDOM = this.contentDOMWrapper || this.contentDOM;
|
|
110
123
|
// @ts-ignore
|
|
124
|
+
// Ignored via go/ees005
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
111
126
|
let oldIgnoreMutation;
|
|
112
127
|
let selectionBookmark;
|
|
113
128
|
let parentOffset = 0;
|
|
@@ -155,14 +170,22 @@ export default class ReactNodeView {
|
|
|
155
170
|
});
|
|
156
171
|
}
|
|
157
172
|
}
|
|
173
|
+
|
|
174
|
+
// Ignored via go/ees005
|
|
175
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
158
176
|
render(props, forwardRef) {
|
|
159
177
|
return this.reactComponent ? /*#__PURE__*/React.createElement(this.reactComponent, _extends({
|
|
160
178
|
view: this.view,
|
|
161
179
|
getPos: this.getPos,
|
|
162
180
|
node: this.node,
|
|
163
181
|
forwardRef: forwardRef
|
|
182
|
+
// Ignored via go/ees005
|
|
183
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
164
184
|
}, props)) : null;
|
|
165
185
|
}
|
|
186
|
+
|
|
187
|
+
// Ignored via go/ees005
|
|
188
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
166
189
|
update(node, decorations, _innerDecorations, validUpdate = () => true) {
|
|
167
190
|
// @see https://github.com/ProseMirror/prosemirror/issues/648
|
|
168
191
|
const isValidUpdate = this.node.type === node.type && validUpdate(this.node, node);
|
|
@@ -202,6 +225,8 @@ export default class ReactNodeView {
|
|
|
202
225
|
});
|
|
203
226
|
}
|
|
204
227
|
get dom() {
|
|
228
|
+
// Ignored via go/ees005
|
|
229
|
+
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
205
230
|
return this.domRef;
|
|
206
231
|
}
|
|
207
232
|
destroy() {
|
|
@@ -212,7 +237,12 @@ export default class ReactNodeView {
|
|
|
212
237
|
this.domRef = undefined;
|
|
213
238
|
this.contentDOM = undefined;
|
|
214
239
|
}
|
|
215
|
-
|
|
240
|
+
// Ignored via go/ees005
|
|
241
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
242
|
+
static fromComponent(
|
|
243
|
+
// Ignored via go/ees005
|
|
244
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
245
|
+
component, portalProviderAPI, eventDispatcher, props, viewShouldUpdate) {
|
|
216
246
|
return (node, view, getPos) => new ReactNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, props, component, viewShouldUpdate).init();
|
|
217
247
|
}
|
|
218
248
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback,
|
|
1
|
+
import React, { useCallback, useMemo, useRef, useState, useLayoutEffect } from 'react';
|
|
2
2
|
import { bind, bindAll } from 'bind-event-listener';
|
|
3
3
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
@@ -269,12 +269,6 @@ const BreakoutResizer = ({
|
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
271
|
}, [editorView, resizerGlobalKeyDownHandler, resizeHandleKeyDownHandler, resizeHandleKeyUpHandler]);
|
|
272
|
-
useEffect(() => {
|
|
273
|
-
// clean up gap cursor if node was unmounting when resizing (e.g. during collab)
|
|
274
|
-
return () => {
|
|
275
|
-
displayGapCursor(true);
|
|
276
|
-
};
|
|
277
|
-
}, [displayGapCursor]);
|
|
278
272
|
if (disabled) {
|
|
279
273
|
return /*#__PURE__*/React.createElement("div", {
|
|
280
274
|
"data-testid": "breakout-resizer-editor-view-wrapper",
|
|
@@ -54,7 +54,10 @@ const ResizerNext = (props, ref) => {
|
|
|
54
54
|
setIsResizing(true);
|
|
55
55
|
handleResizeStart();
|
|
56
56
|
}, [handleResizeStart]);
|
|
57
|
-
const onResize = useCallback((_event, _direction, _elementRef, delta
|
|
57
|
+
const onResize = useCallback((_event, _direction, _elementRef, delta
|
|
58
|
+
// Ignored via go/ees005
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
60
|
+
) => {
|
|
58
61
|
if (!handleResize) {
|
|
59
62
|
return;
|
|
60
63
|
}
|
|
@@ -70,7 +73,10 @@ const ResizerNext = (props, ref) => {
|
|
|
70
73
|
};
|
|
71
74
|
handleResize(originalState, delta);
|
|
72
75
|
}, [handleResize]);
|
|
73
|
-
const onResizeStop = useCallback((_event, _direction, _elementRef, delta
|
|
76
|
+
const onResizeStop = useCallback((_event, _direction, _elementRef, delta
|
|
77
|
+
// Ignored via go/ees005
|
|
78
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
79
|
+
) => {
|
|
74
80
|
const resizableCurrent = resizable.current;
|
|
75
81
|
if (!resizableCurrent || !resizableCurrent.state.original) {
|
|
76
82
|
return;
|
|
@@ -195,6 +201,8 @@ const ResizerNext = (props, ref) => {
|
|
|
195
201
|
snapGap: snapGapActual,
|
|
196
202
|
snap: snap,
|
|
197
203
|
handleComponent: handleComponent
|
|
204
|
+
// Ignored via go/ees005
|
|
205
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
198
206
|
}, otherProps), /*#__PURE__*/React.createElement("span", {
|
|
199
207
|
className: resizerZoneClassName,
|
|
200
208
|
ref: ref => childrenDOMRef && childrenDOMRef(ref)
|
|
@@ -61,6 +61,9 @@ const wrapGetPosExceptions = spec => {
|
|
|
61
61
|
spec.props.nodeViews = safeNodeViews;
|
|
62
62
|
return spec;
|
|
63
63
|
};
|
|
64
|
+
|
|
65
|
+
// Ignored via go/ees005
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
67
|
export class SafePlugin extends Plugin {
|
|
65
68
|
// This variable isn't (and shouldn't) be used anywhere. Its purpose is
|
|
66
69
|
// to distinguish Plugin from SafePlugin, thus ensuring that an 'unsafe'
|
|
@@ -4,7 +4,10 @@ import { isValidTargetNode } from './utils/is-valid-target-node';
|
|
|
4
4
|
|
|
5
5
|
// This function captures clicks outside of the ProseMirror contentEditable area
|
|
6
6
|
// see also description of "handleClick" in gap-cursor pm-plugin
|
|
7
|
-
const captureCursorCoords = (event, editorRef, posAtCoords, tr
|
|
7
|
+
const captureCursorCoords = (event, editorRef, posAtCoords, tr
|
|
8
|
+
// Ignored via go/ees005
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
10
|
+
) => {
|
|
8
11
|
const rect = editorRef.getBoundingClientRect();
|
|
9
12
|
|
|
10
13
|
// capture clicks before the first block element
|
|
@@ -41,11 +44,17 @@ const captureCursorCoords = (event, editorRef, posAtCoords, tr) => {
|
|
|
41
44
|
}
|
|
42
45
|
return null;
|
|
43
46
|
};
|
|
44
|
-
export const setSelectionTopLevelBlocks = (tr, event, editorRef, posAtCoords, editorFocused
|
|
47
|
+
export const setSelectionTopLevelBlocks = (tr, event, editorRef, posAtCoords, editorFocused
|
|
48
|
+
// Ignored via go/ees005
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
50
|
+
) => {
|
|
45
51
|
const cursorCoords = captureCursorCoords(event, editorRef, posAtCoords, tr);
|
|
46
52
|
if (!cursorCoords) {
|
|
47
53
|
return;
|
|
48
54
|
}
|
|
55
|
+
|
|
56
|
+
// Ignored via go/ees005
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
49
58
|
const $pos = cursorCoords.position !== undefined ? tr.doc.resolve(cursorCoords.position) : null;
|
|
50
59
|
if ($pos === null) {
|
|
51
60
|
return;
|
|
@@ -29,6 +29,9 @@ export class GapCursorSelection extends Selection {
|
|
|
29
29
|
if (!targetNode || parent.isTextblock) {
|
|
30
30
|
return false;
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
// Ignored via go/ees005
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
32
35
|
const deflt = parent.contentMatchAt($pos.index()).defaultType;
|
|
33
36
|
return deflt && deflt.isTextblock;
|
|
34
37
|
}
|
|
@@ -40,6 +43,8 @@ export class GapCursorSelection extends Selection {
|
|
|
40
43
|
let pos = $pos.pos;
|
|
41
44
|
|
|
42
45
|
// TODO: Fix any, potential issue. ED-5048
|
|
46
|
+
// Ignored via go/ees005
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
48
|
let next = null;
|
|
44
49
|
|
|
45
50
|
// Scan up from this position
|
|
@@ -101,6 +106,9 @@ export class GapBookmark {
|
|
|
101
106
|
constructor(pos) {
|
|
102
107
|
this.pos = pos;
|
|
103
108
|
}
|
|
109
|
+
|
|
110
|
+
// Ignored via go/ees005
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
104
112
|
map(mapping) {
|
|
105
113
|
return new GapBookmark(mapping.map(this.pos));
|
|
106
114
|
}
|
|
@@ -101,6 +101,8 @@ export const selectNode = pos => (state, dispatch) => {
|
|
|
101
101
|
return true;
|
|
102
102
|
};
|
|
103
103
|
export function createSelectionClickHandler(nodes, isValidTarget, options) {
|
|
104
|
+
// Ignored via go/ees005
|
|
105
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
104
106
|
return function handleClickOn(view, pos, node, nodePos, event, direct) {
|
|
105
107
|
if (options.useLongPressSelection) {
|
|
106
108
|
return false;
|
|
@@ -26,9 +26,16 @@ import ReactNodeView from '../react-node-view';
|
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
export class SelectionBasedNodeView extends ReactNodeView {
|
|
29
|
-
|
|
29
|
+
// Ignored via go/ees005
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
31
|
+
constructor(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps,
|
|
32
|
+
// Ignored via go/ees005
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
+
reactComponent, viewShouldUpdate) {
|
|
30
35
|
super(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, reactComponent, viewShouldUpdate);
|
|
31
36
|
_defineProperty(this, "isSelectedNode", false);
|
|
37
|
+
// Ignored via go/ees005
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
32
39
|
_defineProperty(this, "isNodeInsideSelection", (from, to, pos, posEnd) => {
|
|
33
40
|
({
|
|
34
41
|
pos,
|
|
@@ -39,6 +46,8 @@ export class SelectionBasedNodeView extends ReactNodeView {
|
|
|
39
46
|
}
|
|
40
47
|
return from <= pos && to >= posEnd;
|
|
41
48
|
});
|
|
49
|
+
// Ignored via go/ees005
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/max-params
|
|
42
51
|
_defineProperty(this, "isSelectionInsideNode", (from, to, pos, posEnd) => {
|
|
43
52
|
({
|
|
44
53
|
pos,
|