@atlaskit/editor-common 74.0.1 → 74.1.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 +19 -0
- package/dist/cjs/event-dispatcher/index.js +6 -3
- package/dist/cjs/insert/index.js +274 -0
- package/dist/cjs/monitoring/error.js +106 -0
- package/dist/cjs/monitoring/index.js +12 -0
- package/dist/cjs/node-width/index.js +5 -0
- package/dist/cjs/paste/index.js +12 -0
- package/dist/cjs/paste/md-plugins/ignore-list-heading-md-plugin.js +47 -0
- package/dist/cjs/paste/md-plugins/linkify-md-plugin.js +135 -0
- package/dist/cjs/paste/md-plugins/newline-md-plugin.js +67 -0
- package/dist/cjs/paste/md-plugins/paragraph-md-plugin.js +73 -0
- package/dist/cjs/paste/md.js +31 -0
- package/dist/cjs/preset/plugin-injection-api.js +4 -2
- package/dist/cjs/resizer.js +13 -0
- package/dist/cjs/styles/index.js +8 -1
- package/dist/cjs/styles/shared/blockquote.js +1 -2
- package/dist/cjs/styles/shared/code-block.js +5 -5
- package/dist/cjs/styles/shared/extension.js +4 -0
- package/dist/cjs/styles/shared/layout.js +4 -0
- package/dist/cjs/styles/shared/panel.js +4 -1
- package/dist/cjs/styles/shared/resizer.js +31 -0
- package/dist/cjs/styles/shared/smart-card.js +5 -0
- package/dist/cjs/styles/shared/table.js +2 -3
- package/dist/cjs/types/performance-tracking.js +5 -0
- package/dist/cjs/ui/DropList/index.js +6 -4
- package/dist/cjs/ui/ErrorBoundary/index.js +7 -0
- package/dist/cjs/ui/Expand/index.js +11 -8
- package/dist/cjs/ui/FloatingToolbar/Button.js +93 -0
- package/dist/cjs/ui/FloatingToolbar/styles.js +79 -0
- package/dist/cjs/ui/MediaSingle/grid.js +52 -1
- package/dist/cjs/ui/MediaSingle/index.js +2 -4
- package/dist/cjs/ui/Messages/index.js +2 -3
- package/dist/cjs/ui/Resizer/index.js +97 -0
- package/dist/cjs/ui/Resizer/types.js +5 -0
- package/dist/cjs/ui/Resizer/utils.js +8 -0
- package/dist/cjs/ui/index.js +14 -1
- package/dist/cjs/ui-color/ColorPalette/styles.js +1 -2
- package/dist/cjs/utils/editor-core-utils.js +9 -1
- package/dist/cjs/utils/hyperlink.js +200 -0
- package/dist/cjs/utils/index.js +96 -8
- package/dist/cjs/utils/list.js +19 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/event-dispatcher/index.js +4 -2
- package/dist/es2019/insert/index.js +264 -0
- package/dist/es2019/monitoring/error.js +68 -0
- package/dist/es2019/monitoring/index.js +1 -0
- package/dist/es2019/node-width/index.js +4 -0
- package/dist/es2019/paste/index.js +1 -0
- package/dist/es2019/paste/md-plugins/ignore-list-heading-md-plugin.js +43 -0
- package/dist/es2019/paste/md-plugins/linkify-md-plugin.js +128 -0
- package/dist/es2019/paste/md-plugins/newline-md-plugin.js +58 -0
- package/dist/es2019/paste/md-plugins/paragraph-md-plugin.js +64 -0
- package/dist/es2019/paste/md.js +22 -0
- package/dist/es2019/preset/plugin-injection-api.js +4 -2
- package/dist/es2019/resizer.js +1 -0
- package/dist/es2019/styles/index.js +2 -1
- package/dist/es2019/styles/shared/blockquote.js +2 -3
- package/dist/es2019/styles/shared/code-block.js +8 -7
- package/dist/es2019/styles/shared/extension.js +4 -0
- package/dist/es2019/styles/shared/layout.js +4 -0
- package/dist/es2019/styles/shared/panel.js +7 -4
- package/dist/es2019/styles/shared/resizer.js +72 -0
- package/dist/es2019/styles/shared/smart-card.js +4 -0
- package/dist/es2019/styles/shared/table.js +2 -3
- package/dist/es2019/types/performance-tracking.js +1 -0
- package/dist/es2019/ui/DropList/index.js +7 -3
- package/dist/es2019/ui/ErrorBoundary/index.js +7 -0
- package/dist/es2019/ui/Expand/index.js +14 -9
- package/dist/es2019/ui/FloatingToolbar/Button.js +85 -0
- package/dist/es2019/ui/FloatingToolbar/styles.js +64 -0
- package/dist/es2019/ui/MediaSingle/grid.js +50 -0
- package/dist/es2019/ui/MediaSingle/index.js +1 -2
- package/dist/es2019/ui/Messages/index.js +2 -3
- package/dist/es2019/ui/Resizer/index.js +92 -0
- package/dist/es2019/ui/Resizer/types.js +1 -0
- package/dist/es2019/ui/Resizer/utils.js +1 -0
- package/dist/es2019/ui/index.js +4 -3
- package/dist/es2019/ui-color/ColorPalette/styles.js +1 -2
- package/dist/es2019/utils/editor-core-utils.js +7 -0
- package/dist/es2019/utils/hyperlink.js +165 -0
- package/dist/es2019/utils/index.js +6 -3
- package/dist/es2019/utils/list.js +13 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/event-dispatcher/index.js +4 -2
- package/dist/esm/insert/index.js +262 -0
- package/dist/esm/monitoring/error.js +91 -0
- package/dist/esm/monitoring/index.js +1 -0
- package/dist/esm/node-width/index.js +4 -0
- package/dist/esm/paste/index.js +1 -0
- package/dist/esm/paste/md-plugins/ignore-list-heading-md-plugin.js +41 -0
- package/dist/esm/paste/md-plugins/linkify-md-plugin.js +128 -0
- package/dist/esm/paste/md-plugins/newline-md-plugin.js +60 -0
- package/dist/esm/paste/md-plugins/paragraph-md-plugin.js +66 -0
- package/dist/esm/paste/md.js +22 -0
- package/dist/esm/preset/plugin-injection-api.js +4 -2
- package/dist/esm/resizer.js +1 -0
- package/dist/esm/styles/index.js +2 -1
- package/dist/esm/styles/shared/blockquote.js +1 -2
- package/dist/esm/styles/shared/code-block.js +6 -6
- package/dist/esm/styles/shared/extension.js +4 -0
- package/dist/esm/styles/shared/layout.js +4 -0
- package/dist/esm/styles/shared/panel.js +4 -1
- package/dist/esm/styles/shared/resizer.js +18 -0
- package/dist/esm/styles/shared/smart-card.js +4 -0
- package/dist/esm/styles/shared/table.js +2 -3
- package/dist/esm/types/performance-tracking.js +1 -0
- package/dist/esm/ui/DropList/index.js +6 -3
- package/dist/esm/ui/ErrorBoundary/index.js +7 -0
- package/dist/esm/ui/Expand/index.js +11 -8
- package/dist/esm/ui/FloatingToolbar/Button.js +85 -0
- package/dist/esm/ui/FloatingToolbar/styles.js +68 -0
- package/dist/esm/ui/MediaSingle/grid.js +48 -0
- package/dist/esm/ui/MediaSingle/index.js +1 -2
- package/dist/esm/ui/Messages/index.js +2 -3
- package/dist/esm/ui/Resizer/index.js +90 -0
- package/dist/esm/ui/Resizer/types.js +1 -0
- package/dist/esm/ui/Resizer/utils.js +1 -0
- package/dist/esm/ui/index.js +4 -3
- package/dist/esm/ui-color/ColorPalette/styles.js +1 -2
- package/dist/esm/utils/editor-core-utils.js +7 -0
- package/dist/esm/utils/hyperlink.js +184 -0
- package/dist/esm/utils/index.js +6 -3
- package/dist/esm/utils/list.js +13 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/api.d.ts +1 -1
- package/dist/types/event-dispatcher/index.d.ts +3 -1
- package/dist/types/insert/index.d.ts +25 -0
- package/dist/types/monitoring/error.d.ts +4 -0
- package/dist/types/monitoring/index.d.ts +1 -0
- package/dist/types/paste/index.d.ts +1 -0
- package/dist/types/paste/md-plugins/ignore-list-heading-md-plugin.d.ts +2 -0
- package/dist/types/paste/md-plugins/linkify-md-plugin.d.ts +2 -0
- package/dist/types/paste/md-plugins/newline-md-plugin.d.ts +2 -0
- package/dist/types/paste/md-plugins/paragraph-md-plugin.d.ts +2 -0
- package/dist/types/paste/md.d.ts +2 -0
- package/dist/types/resizer.d.ts +1 -0
- package/dist/types/styles/index.d.ts +1 -0
- package/dist/types/styles/shared/resizer.d.ts +6 -0
- package/dist/types/types/index.d.ts +2 -1
- package/dist/types/types/next-editor-plugin.d.ts +1 -1
- package/dist/types/types/performance-tracking.d.ts +343 -0
- package/dist/types/ui/DropList/index.d.ts +1 -1
- package/dist/types/ui/FloatingToolbar/Button.d.ts +30 -0
- package/dist/types/ui/FloatingToolbar/styles.d.ts +20 -0
- package/dist/types/ui/MediaSingle/grid.d.ts +14 -0
- package/dist/types/ui/MediaSingle/index.d.ts +0 -1
- package/dist/types/ui/Resizer/index.d.ts +22 -0
- package/dist/types/ui/Resizer/types.d.ts +18 -0
- package/dist/types/ui/Resizer/utils.d.ts +1 -0
- package/dist/types/ui/index.d.ts +3 -2
- package/dist/types/utils/editor-core-utils.d.ts +4 -0
- package/dist/types/utils/hyperlink.d.ts +27 -0
- package/dist/types/utils/index.d.ts +4 -3
- package/dist/types/utils/list.d.ts +4 -0
- package/dist/types-ts4.5/__tests_external__/cases/fundamentals/collection.d.ts +3 -0
- package/dist/types-ts4.5/__tests_external__/cases/fundamentals/test-cases/editor-is-present.d.ts +3 -0
- package/dist/types-ts4.5/__tests_external__/cases/fundamentals/test-cases/editor-typing.d.ts +3 -0
- package/dist/types-ts4.5/__tests_external__/cases/smart-links/index.d.ts +4 -0
- package/dist/types-ts4.5/__tests_external__/cases/smart-links/test-cases/block/delete.d.ts +3 -0
- package/dist/types-ts4.5/__tests_external__/cases/smart-links/test-cases/block/edit.d.ts +4 -0
- package/dist/types-ts4.5/__tests_external__/cases/smart-links/test-cases/block/index.d.ts +3 -0
- package/dist/types-ts4.5/__tests_external__/cases/smart-links/test-cases/block/insert.d.ts +3 -0
- package/dist/types-ts4.5/__tests_external__/cases/smart-links/test-cases/embed/delete.d.ts +3 -0
- package/dist/types-ts4.5/__tests_external__/cases/smart-links/test-cases/embed/edit.d.ts +4 -0
- package/dist/types-ts4.5/__tests_external__/cases/smart-links/test-cases/embed/index.d.ts +3 -0
- package/dist/types-ts4.5/__tests_external__/cases/smart-links/test-cases/embed/insert.d.ts +3 -0
- package/dist/types-ts4.5/__tests_external__/cases/smart-links/test-cases/inline/delete.d.ts +3 -0
- package/dist/types-ts4.5/__tests_external__/cases/smart-links/test-cases/inline/edit.d.ts +4 -0
- package/dist/types-ts4.5/__tests_external__/cases/smart-links/test-cases/inline/index.d.ts +3 -0
- package/dist/types-ts4.5/__tests_external__/cases/smart-links/test-cases/inline/insert.d.ts +3 -0
- package/dist/types-ts4.5/__tests_external__/cases/smart-links/test-cases/inline/unlink.d.ts +3 -0
- package/dist/types-ts4.5/__tests_external__/cases/smart-links/test-cases/types.d.ts +4 -0
- package/dist/types-ts4.5/__tests_external__/cases/smart-links/test-cases/url/index.d.ts +3 -0
- package/dist/types-ts4.5/__tests_external__/cases/smart-links/test-cases/url/insert.d.ts +3 -0
- package/dist/types-ts4.5/__tests_external__/cases/types.d.ts +7 -0
- package/dist/types-ts4.5/__tests_external__/index.d.ts +3 -0
- package/dist/types-ts4.5/__tests_external__/page-objects/Editor.d.ts +9 -0
- package/dist/types-ts4.5/__tests_external__/page-objects/EditorSmartLink.d.ts +40 -0
- package/dist/types-ts4.5/__tests_external__/page-objects/Renderer.d.ts +6 -0
- package/dist/types-ts4.5/analytics/analytics-queue.d.ts +10 -0
- package/dist/types-ts4.5/analytics/api.d.ts +5 -0
- package/dist/types-ts4.5/analytics/fire-analytics-event.d.ts +2 -0
- package/dist/types-ts4.5/analytics/index.d.ts +5 -0
- package/dist/types-ts4.5/analytics/types/avatar.d.ts +5 -0
- package/dist/types-ts4.5/analytics/types/block.d.ts +3 -0
- package/dist/types-ts4.5/analytics/types/config-panel-events.d.ts +17 -0
- package/dist/types-ts4.5/analytics/types/cut-copy-events.d.ts +12 -0
- package/dist/types-ts4.5/analytics/types/date-events.d.ts +17 -0
- package/dist/types-ts4.5/analytics/types/dispatch-analytics-event.d.ts +2 -0
- package/dist/types-ts4.5/analytics/types/element-browser-events.d.ts +11 -0
- package/dist/types-ts4.5/analytics/types/enums.d.ts +357 -0
- package/dist/types-ts4.5/analytics/types/events.d.ts +130 -0
- package/dist/types-ts4.5/analytics/types/experimental-events.d.ts +16 -0
- package/dist/types-ts4.5/analytics/types/extension-events.d.ts +37 -0
- package/dist/types-ts4.5/analytics/types/find-replace-events.d.ts +23 -0
- package/dist/types-ts4.5/analytics/types/format-events.d.ts +49 -0
- package/dist/types-ts4.5/analytics/types/general-events.d.ts +187 -0
- package/dist/types-ts4.5/analytics/types/index.d.ts +36 -0
- package/dist/types-ts4.5/analytics/types/inline-comment-events.d.ts +17 -0
- package/dist/types-ts4.5/analytics/types/insert-events.d.ts +128 -0
- package/dist/types-ts4.5/analytics/types/link-tool-bar-events.d.ts +76 -0
- package/dist/types-ts4.5/analytics/types/list-events.d.ts +66 -0
- package/dist/types-ts4.5/analytics/types/media-events.d.ts +18 -0
- package/dist/types-ts4.5/analytics/types/node-events.d.ts +56 -0
- package/dist/types-ts4.5/analytics/types/paste-events.d.ts +39 -0
- package/dist/types-ts4.5/analytics/types/performance-report.d.ts +24 -0
- package/dist/types-ts4.5/analytics/types/referentiality-events.d.ts +52 -0
- package/dist/types-ts4.5/analytics/types/selection-events.d.ts +18 -0
- package/dist/types-ts4.5/analytics/types/smart-links.d.ts +14 -0
- package/dist/types-ts4.5/analytics/types/substitute-events.d.ts +26 -0
- package/dist/types-ts4.5/analytics/types/table-events.d.ts +102 -0
- package/dist/types-ts4.5/analytics/types/toolbar-button.d.ts +22 -0
- package/dist/types-ts4.5/analytics/types/type-ahead.d.ts +27 -0
- package/dist/types-ts4.5/analytics/types/utils.d.ts +46 -0
- package/dist/types-ts4.5/analytics/utils.d.ts +3 -0
- package/dist/types-ts4.5/card/cardOptions.d.ts +12 -0
- package/dist/types-ts4.5/card/index.d.ts +2 -0
- package/dist/types-ts4.5/card/utils.d.ts +18 -0
- package/dist/types-ts4.5/collab/types.d.ts +101 -0
- package/dist/types-ts4.5/collab.d.ts +1 -0
- package/dist/types-ts4.5/core-utils/index.d.ts +1 -0
- package/dist/types-ts4.5/core-utils/inside.d.ts +2 -0
- package/dist/types-ts4.5/emoji.d.ts +3 -0
- package/dist/types-ts4.5/event-dispatcher/index.d.ts +21 -0
- package/dist/types-ts4.5/extensions/combine-extension-providers.d.ts +7 -0
- package/dist/types-ts4.5/extensions/default-extension-provider.d.ts +17 -0
- package/dist/types-ts4.5/extensions/extension-fields-helpers.d.ts +10 -0
- package/dist/types-ts4.5/extensions/extension-handlers.d.ts +13 -0
- package/dist/types-ts4.5/extensions/index.d.ts +8 -0
- package/dist/types-ts4.5/extensions/manifest-helpers.d.ts +9 -0
- package/dist/types-ts4.5/extensions/module-helpers.d.ts +11 -0
- package/dist/types-ts4.5/extensions/types/extension-handler.d.ts +40 -0
- package/dist/types-ts4.5/extensions/types/extension-manifest-common.d.ts +8 -0
- package/dist/types-ts4.5/extensions/types/extension-manifest-toolbar-item.d.ts +45 -0
- package/dist/types-ts4.5/extensions/types/extension-manifest.d.ts +101 -0
- package/dist/types-ts4.5/extensions/types/extension-parameters.d.ts +5 -0
- package/dist/types-ts4.5/extensions/types/extension-provider.d.ts +8 -0
- package/dist/types-ts4.5/extensions/types/field-definitions.d.ts +171 -0
- package/dist/types-ts4.5/extensions/types/index.d.ts +8 -0
- package/dist/types-ts4.5/extensions/types/utils.d.ts +18 -0
- package/dist/types-ts4.5/extensions.d.ts +2 -0
- package/dist/types-ts4.5/hooks/index.d.ts +3 -0
- package/dist/types-ts4.5/hooks/useConstructor.d.ts +9 -0
- package/dist/types-ts4.5/hooks/usePreviousState.d.ts +11 -0
- package/dist/types-ts4.5/hooks/useSharedPluginState.d.ts +39 -0
- package/dist/types-ts4.5/i18n/cs.d.ts +133 -0
- package/dist/types-ts4.5/i18n/da.d.ts +133 -0
- package/dist/types-ts4.5/i18n/de.d.ts +133 -0
- package/dist/types-ts4.5/i18n/en.d.ts +133 -0
- package/dist/types-ts4.5/i18n/en_GB.d.ts +133 -0
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +115 -0
- package/dist/types-ts4.5/i18n/es.d.ts +133 -0
- package/dist/types-ts4.5/i18n/et.d.ts +8 -0
- package/dist/types-ts4.5/i18n/fi.d.ts +133 -0
- package/dist/types-ts4.5/i18n/fr.d.ts +133 -0
- package/dist/types-ts4.5/i18n/hu.d.ts +133 -0
- package/dist/types-ts4.5/i18n/index.d.ts +32 -0
- package/dist/types-ts4.5/i18n/it.d.ts +133 -0
- package/dist/types-ts4.5/i18n/ja.d.ts +133 -0
- package/dist/types-ts4.5/i18n/ko.d.ts +133 -0
- package/dist/types-ts4.5/i18n/languages.d.ts +35 -0
- package/dist/types-ts4.5/i18n/nb.d.ts +133 -0
- package/dist/types-ts4.5/i18n/nl.d.ts +133 -0
- package/dist/types-ts4.5/i18n/pl.d.ts +133 -0
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +133 -0
- package/dist/types-ts4.5/i18n/pt_PT.d.ts +8 -0
- package/dist/types-ts4.5/i18n/ru.d.ts +133 -0
- package/dist/types-ts4.5/i18n/sk.d.ts +8 -0
- package/dist/types-ts4.5/i18n/sv.d.ts +133 -0
- package/dist/types-ts4.5/i18n/th.d.ts +133 -0
- package/dist/types-ts4.5/i18n/tr.d.ts +133 -0
- package/dist/types-ts4.5/i18n/uk.d.ts +133 -0
- package/dist/types-ts4.5/i18n/vi.d.ts +133 -0
- package/dist/types-ts4.5/i18n/zh.d.ts +133 -0
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +133 -0
- package/dist/types-ts4.5/icons/index.d.ts +10 -0
- package/dist/types-ts4.5/icons/shared/BorderIcon.d.ts +3 -0
- package/dist/types-ts4.5/icons/shared/PanelErrorIcon.d.ts +3 -0
- package/dist/types-ts4.5/icons/shared/PanelInfoIcon.d.ts +3 -0
- package/dist/types-ts4.5/icons/shared/PanelNoteIcon.d.ts +3 -0
- package/dist/types-ts4.5/icons/shared/PanelSuccessIcon.d.ts +3 -0
- package/dist/types-ts4.5/icons/shared/PanelWarningIcon.d.ts +3 -0
- package/dist/types-ts4.5/icons/shared/table.d.ts +2 -0
- package/dist/types-ts4.5/in-product.d.ts +1 -0
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/insert/index.d.ts +25 -0
- package/dist/types-ts4.5/keymaps/consts.d.ts +12 -0
- package/dist/types-ts4.5/keymaps/index.d.ts +91 -0
- package/dist/types-ts4.5/mention.d.ts +2 -0
- package/dist/types-ts4.5/messages/codeBidiWarning.d.ts +11 -0
- package/dist/types-ts4.5/messages/codeBlockButton.d.ts +22 -0
- package/dist/types-ts4.5/messages/index.d.ts +128 -0
- package/dist/types-ts4.5/messages/insert-block.d.ts +172 -0
- package/dist/types-ts4.5/messages/link.d.ts +7 -0
- package/dist/types-ts4.5/messages/unsupportedContent.d.ts +17 -0
- package/dist/types-ts4.5/monitoring/error.d.ts +4 -0
- package/dist/types-ts4.5/monitoring/index.d.ts +1 -0
- package/dist/types-ts4.5/node-width/index.d.ts +7 -0
- package/dist/types-ts4.5/normalize-feature-flags.d.ts +27 -0
- package/dist/types-ts4.5/panel.d.ts +1 -0
- package/dist/types-ts4.5/paste/index.d.ts +1 -0
- package/dist/types-ts4.5/paste/md-plugins/ignore-list-heading-md-plugin.d.ts +2 -0
- package/dist/types-ts4.5/paste/md-plugins/linkify-md-plugin.d.ts +2 -0
- package/dist/types-ts4.5/paste/md-plugins/newline-md-plugin.d.ts +2 -0
- package/dist/types-ts4.5/paste/md-plugins/paragraph-md-plugin.d.ts +2 -0
- package/dist/types-ts4.5/paste/md.d.ts +2 -0
- package/dist/types-ts4.5/preset/builder.d.ts +36 -0
- package/dist/types-ts4.5/preset/index.d.ts +2 -0
- package/dist/types-ts4.5/preset/plugin-injection-api.d.ts +50 -0
- package/dist/types-ts4.5/provider-factory/autoformatting-provider.d.ts +9 -0
- package/dist/types-ts4.5/provider-factory/card-provider.d.ts +7 -0
- package/dist/types-ts4.5/provider-factory/context-identifier-provider.d.ts +6 -0
- package/dist/types-ts4.5/provider-factory/context.d.ts +6 -0
- package/dist/types-ts4.5/provider-factory/image-upload-provider.d.ts +6 -0
- package/dist/types-ts4.5/provider-factory/macro-provider.d.ts +25 -0
- package/dist/types-ts4.5/provider-factory/media-provider.d.ts +15 -0
- package/dist/types-ts4.5/provider-factory/profile-card-provider.d.ts +6 -0
- package/dist/types-ts4.5/provider-factory/provider-factory.d.ts +17 -0
- package/dist/types-ts4.5/provider-factory/quick-insert-provider.d.ts +24 -0
- package/dist/types-ts4.5/provider-factory/search-provider.d.ts +12 -0
- package/dist/types-ts4.5/provider-factory/types.d.ts +37 -0
- package/dist/types-ts4.5/provider-factory/with-providers.d.ts +18 -0
- package/dist/types-ts4.5/provider-factory.d.ts +13 -0
- package/dist/types-ts4.5/provider-helpers/combine-providers.d.ts +9 -0
- package/dist/types-ts4.5/provider-helpers/index.d.ts +1 -0
- package/dist/types-ts4.5/provider-helpers/promise-helpers.d.ts +32 -0
- package/dist/types-ts4.5/react-node-view/index.d.ts +52 -0
- package/dist/types-ts4.5/react-node-view/types.d.ts +12 -0
- package/dist/types-ts4.5/resizer.d.ts +1 -0
- package/dist/types-ts4.5/safe-plugin/index.d.ts +6 -0
- package/dist/types-ts4.5/selection/gap-cursor/selection.d.ts +40 -0
- package/dist/types-ts4.5/selection/gap-cursor/utils/index.d.ts +2 -0
- package/dist/types-ts4.5/selection/gap-cursor/utils/is-ignored.d.ts +2 -0
- package/dist/types-ts4.5/selection/gap-cursor/utils/is-valid-target-node.d.ts +2 -0
- package/dist/types-ts4.5/selection/index.d.ts +5 -0
- package/dist/types-ts4.5/selection/types.d.ts +26 -0
- package/dist/types-ts4.5/selection/utils.d.ts +4 -0
- package/dist/types-ts4.5/styles/index.d.ts +25 -0
- package/dist/types-ts4.5/styles/shared/annotation.d.ts +12 -0
- package/dist/types-ts4.5/styles/shared/block-marks.d.ts +1 -0
- package/dist/types-ts4.5/styles/shared/blockquote.d.ts +1 -0
- package/dist/types-ts4.5/styles/shared/code-block.d.ts +12 -0
- package/dist/types-ts4.5/styles/shared/code-mark.d.ts +2 -0
- package/dist/types-ts4.5/styles/shared/column-layout.d.ts +2 -0
- package/dist/types-ts4.5/styles/shared/date.d.ts +5 -0
- package/dist/types-ts4.5/styles/shared/dropdown-menu.d.ts +4 -0
- package/dist/types-ts4.5/styles/shared/emoji.d.ts +7 -0
- package/dist/types-ts4.5/styles/shared/extension.d.ts +2 -0
- package/dist/types-ts4.5/styles/shared/headings.d.ts +2 -0
- package/dist/types-ts4.5/styles/shared/indentation.d.ts +1 -0
- package/dist/types-ts4.5/styles/shared/layout.d.ts +2 -0
- package/dist/types-ts4.5/styles/shared/link.d.ts +2 -0
- package/dist/types-ts4.5/styles/shared/lists.d.ts +4 -0
- package/dist/types-ts4.5/styles/shared/media-single.d.ts +3 -0
- package/dist/types-ts4.5/styles/shared/mention.d.ts +3 -0
- package/dist/types-ts4.5/styles/shared/panel.d.ts +85 -0
- package/dist/types-ts4.5/styles/shared/paragraph.d.ts +1 -0
- package/dist/types-ts4.5/styles/shared/resizer.d.ts +6 -0
- package/dist/types-ts4.5/styles/shared/rule.d.ts +2 -0
- package/dist/types-ts4.5/styles/shared/shadow.d.ts +15 -0
- package/dist/types-ts4.5/styles/shared/smart-card.d.ts +7 -0
- package/dist/types-ts4.5/styles/shared/status.d.ts +4 -0
- package/dist/types-ts4.5/styles/shared/table.d.ts +31 -0
- package/dist/types-ts4.5/styles/shared/tableCell.d.ts +1 -0
- package/dist/types-ts4.5/styles/shared/task-decision.d.ts +4 -0
- package/dist/types-ts4.5/styles/shared/text-color.d.ts +1 -0
- package/dist/types-ts4.5/styles/shared/whitespace.d.ts +2 -0
- package/dist/types-ts4.5/transforms/expand.d.ts +5 -0
- package/dist/types-ts4.5/transforms/extension.d.ts +6 -0
- package/dist/types-ts4.5/transforms/index.d.ts +3 -0
- package/dist/types-ts4.5/transforms/layout.d.ts +15 -0
- package/dist/types-ts4.5/type-ahead/index.d.ts +12 -0
- package/dist/types-ts4.5/types/annotation/emitter.d.ts +33 -0
- package/dist/types-ts4.5/types/annotation/index.d.ts +84 -0
- package/dist/types-ts4.5/types/collab.d.ts +8 -0
- package/dist/types-ts4.5/types/command.d.ts +5 -0
- package/dist/types-ts4.5/types/context-panel.d.ts +3 -0
- package/dist/types-ts4.5/types/copy-button.d.ts +24 -0
- package/dist/types-ts4.5/types/editor-actions.d.ts +21 -0
- package/dist/types-ts4.5/types/editor-appearance.d.ts +1 -0
- package/dist/types-ts4.5/types/editor-container-width.d.ts +20 -0
- package/dist/types-ts4.5/types/editor-plugin.d.ts +83 -0
- package/dist/types-ts4.5/types/editor-react-context.d.ts +6 -0
- package/dist/types-ts4.5/types/empty-state-handler.d.ts +7 -0
- package/dist/types-ts4.5/types/feature-flags.d.ts +432 -0
- package/dist/types-ts4.5/types/floating-toolbar.d.ts +256 -0
- package/dist/types-ts4.5/types/index.d.ts +36 -0
- package/dist/types-ts4.5/types/next-editor-plugin.d.ts +113 -0
- package/dist/types-ts4.5/types/performance-tracking.d.ts +343 -0
- package/dist/types-ts4.5/types/plugin-factory.d.ts +27 -0
- package/dist/types-ts4.5/types/prosemirror-config.d.ts +14 -0
- package/dist/types-ts4.5/types/quick-insert.d.ts +26 -0
- package/dist/types-ts4.5/types/supported-browsers.d.ts +15 -0
- package/dist/types-ts4.5/types/toolbar.d.ts +30 -0
- package/dist/types-ts4.5/types/type-ahead.d.ts +72 -0
- package/dist/types-ts4.5/types/ui-components.d.ts +22 -0
- package/dist/types-ts4.5/ufo/experience-store.d.ts +33 -0
- package/dist/types-ts4.5/ufo/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/BaseTheme/index.d.ts +15 -0
- package/dist/types-ts4.5/ui/Caption/index.d.ts +19 -0
- package/dist/types-ts4.5/ui/Caption/messages.d.ts +7 -0
- package/dist/types-ts4.5/ui/DropList/index.d.ts +20 -0
- package/dist/types-ts4.5/ui/Emoji/index.d.ts +22 -0
- package/dist/types-ts4.5/ui/ErrorBoundary/index.d.ts +24 -0
- package/dist/types-ts4.5/ui/EventHandlers/index.d.ts +36 -0
- package/dist/types-ts4.5/ui/Expand/index.d.ts +43 -0
- package/dist/types-ts4.5/ui/FloatingToolbar/Button.d.ts +30 -0
- package/dist/types-ts4.5/ui/FloatingToolbar/styles.d.ts +20 -0
- package/dist/types-ts4.5/ui/IntlErrorBoundary/index.d.ts +15 -0
- package/dist/types-ts4.5/ui/IntlProviderIfMissingWrapper/index.d.ts +6 -0
- package/dist/types-ts4.5/ui/Layer/index.d.ts +47 -0
- package/dist/types-ts4.5/ui/Layer/internal/helpers.d.ts +5 -0
- package/dist/types-ts4.5/ui/MediaSingle/grid.d.ts +24 -0
- package/dist/types-ts4.5/ui/MediaSingle/index.d.ts +23 -0
- package/dist/types-ts4.5/ui/MediaSingle/link.d.ts +1 -0
- package/dist/types-ts4.5/ui/MediaSingle/styled.d.ts +43 -0
- package/dist/types-ts4.5/ui/Mention/index.d.ts +21 -0
- package/dist/types-ts4.5/ui/Mention/mention-with-profilecard.d.ts +15 -0
- package/dist/types-ts4.5/ui/Mention/mention-with-providers.d.ts +22 -0
- package/dist/types-ts4.5/ui/Mention/types.d.ts +2 -0
- package/dist/types-ts4.5/ui/Messages/index.d.ts +11 -0
- package/dist/types-ts4.5/ui/OverflowShadow/index.d.ts +103 -0
- package/dist/types-ts4.5/ui/OverflowShadow/shadowObserver.d.ts +27 -0
- package/dist/types-ts4.5/ui/Popup/index.d.ts +83 -0
- package/dist/types-ts4.5/ui/Popup/utils.d.ts +42 -0
- package/dist/types-ts4.5/ui/PortalProvider/PortalProviderThemesProvider.d.ts +6 -0
- package/dist/types-ts4.5/ui/PortalProvider/index.d.ts +51 -0
- package/dist/types-ts4.5/ui/Resizer/index.d.ts +22 -0
- package/dist/types-ts4.5/ui/Resizer/types.d.ts +18 -0
- package/dist/types-ts4.5/ui/Resizer/utils.d.ts +1 -0
- package/dist/types-ts4.5/ui/UnsupportedBlock/index.d.ts +14 -0
- package/dist/types-ts4.5/ui/UnsupportedInline/index.d.ts +14 -0
- package/dist/types-ts4.5/ui/WidthProvider/index.d.ts +29 -0
- package/dist/types-ts4.5/ui/WithCreateAnalyticsEvent/index.d.ts +6 -0
- package/dist/types-ts4.5/ui/clear-next-sibling-margin-top.d.ts +2 -0
- package/dist/types-ts4.5/ui/index.d.ts +28 -0
- package/dist/types-ts4.5/ui/unsupported-content-helper.d.ts +3 -0
- package/dist/types-ts4.5/ui/with-outer-listeners.d.ts +8 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/Color/index.d.ts +20 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/Color/styles.d.ts +4 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/borderColorPalette.d.ts +3 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/cellBackgroundColorPalette.d.ts +3 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/common.d.ts +2 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/getColorMessage.d.ts +2 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/index.d.ts +3 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/paletteMessages.d.ts +123 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/paletteMessagesTokenModeNames.d.ts +1444 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/panelBackgroundPalette.d.ts +4 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/statusColorPalette.d.ts +4 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/textColorPalette.d.ts +2 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/type.d.ts +12 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/index.d.ts +50 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/styles.d.ts +1 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/utils.d.ts +11 -0
- package/dist/types-ts4.5/ui-color/index.d.ts +12 -0
- package/dist/types-ts4.5/ui-menu/ArrowKeyNavigationProvider/ColorPaletteArrowKeyNavigationProvider/index.d.ts +7 -0
- package/dist/types-ts4.5/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.d.ts +7 -0
- package/dist/types-ts4.5/ui-menu/ArrowKeyNavigationProvider/index.d.ts +3 -0
- package/dist/types-ts4.5/ui-menu/ArrowKeyNavigationProvider/types.d.ts +36 -0
- package/dist/types-ts4.5/ui-menu/Dropdown/index.d.ts +40 -0
- package/dist/types-ts4.5/ui-menu/DropdownMenu/index.d.ts +22 -0
- package/dist/types-ts4.5/ui-menu/DropdownMenu/types.d.ts +52 -0
- package/dist/types-ts4.5/ui-menu/ToolbarButton/index.d.ts +57 -0
- package/dist/types-ts4.5/ui-menu/ToolbarButton/styles.d.ts +4 -0
- package/dist/types-ts4.5/ui-menu/index.d.ts +8 -0
- package/dist/types-ts4.5/ui-react/ReactEditorViewContext.d.ts +8 -0
- package/dist/types-ts4.5/ui-react/index.d.ts +2 -0
- package/dist/types-ts4.5/ui-react/with-react-editor-view-outer-listeners.d.ts +11 -0
- package/dist/types-ts4.5/utils/analytics.d.ts +29 -0
- package/dist/types-ts4.5/utils/annotation/index.d.ts +8 -0
- package/dist/types-ts4.5/utils/breakout.d.ts +43 -0
- package/dist/types-ts4.5/utils/browser-extensions.d.ts +43 -0
- package/dist/types-ts4.5/utils/browser.d.ts +4 -0
- package/dist/types-ts4.5/utils/collab.d.ts +2 -0
- package/dist/types-ts4.5/utils/compare-props.d.ts +32 -0
- package/dist/types-ts4.5/utils/compareNodes.d.ts +47 -0
- package/dist/types-ts4.5/utils/compose.d.ts +30 -0
- package/dist/types-ts4.5/utils/date.d.ts +18 -0
- package/dist/types-ts4.5/utils/dom.d.ts +40 -0
- package/dist/types-ts4.5/utils/editor-core-utils.d.ts +28 -0
- package/dist/types-ts4.5/utils/error-reporter.d.ts +13 -0
- package/dist/types-ts4.5/utils/extension-handler.d.ts +2 -0
- package/dist/types-ts4.5/utils/get-performance-options.d.ts +18 -0
- package/dist/types-ts4.5/utils/getModeFromTheme.d.ts +1 -0
- package/dist/types-ts4.5/utils/hyperlink.d.ts +27 -0
- package/dist/types-ts4.5/utils/imageLoader.d.ts +14 -0
- package/dist/types-ts4.5/utils/index.d.ts +51 -0
- package/dist/types-ts4.5/utils/is-text-input.d.ts +2 -0
- package/dist/types-ts4.5/utils/list.d.ts +14 -0
- package/dist/types-ts4.5/utils/macro.d.ts +10 -0
- package/dist/types-ts4.5/utils/nodes.d.ts +49 -0
- package/dist/types-ts4.5/utils/outdated-browsers.d.ts +1 -0
- package/dist/types-ts4.5/utils/performance/hooks/use-component-render-tracking/index.d.ts +19 -0
- package/dist/types-ts4.5/utils/performance/is-performance-api-available.d.ts +3 -0
- package/dist/types-ts4.5/utils/performance/measure-render.d.ts +53 -0
- package/dist/types-ts4.5/utils/performance/measure-tti.d.ts +14 -0
- package/dist/types-ts4.5/utils/performance/measure.d.ts +3 -0
- package/dist/types-ts4.5/utils/performance/navigation.d.ts +1 -0
- package/dist/types-ts4.5/utils/plugin-state-factory.d.ts +16 -0
- package/dist/types-ts4.5/utils/profiler/render-count.d.ts +50 -0
- package/dist/types-ts4.5/utils/referentiality.d.ts +18 -0
- package/dist/types-ts4.5/utils/should-force-tracking.d.ts +1 -0
- package/dist/types-ts4.5/utils/slice.d.ts +11 -0
- package/dist/types-ts4.5/utils/table.d.ts +4 -0
- package/dist/types-ts4.5/utils/track-unsupported-content.d.ts +20 -0
- package/dist/types-ts4.5/utils/traversor.d.ts +9 -0
- package/dist/types-ts4.5/utils/types.d.ts +2 -0
- package/dist/types-ts4.5/utils/unsupportedContent/get-unsupported-content-level-data.d.ts +57 -0
- package/dist/types-ts4.5/utils/validate-using-spec.d.ts +19 -0
- package/dist/types-ts4.5/utils/validator.d.ts +42 -0
- package/dist/types-ts4.5/utils/whitespace.d.ts +2 -0
- package/dist/types-ts4.5/validator.d.ts +2 -0
- package/dist/types-ts4.5/with-plugin-state/index.d.ts +88 -0
- package/dist/types-ts4.5/with-plugin-state/types.d.ts +10 -0
- package/insert/package.json +15 -0
- package/monitoring/package.json +15 -0
- package/package.json +27 -9
- package/paste/package.json +15 -0
- package/report.api.md +1 -1
- package/resizer/package.json +15 -0
- package/dist/cjs/utils/sendLogs.js +0 -17
- package/dist/es2019/utils/sendLogs.js +0 -8
- package/dist/esm/utils/sendLogs.js +0 -10
- package/dist/types/utils/sendLogs.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 74.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`6bc52e5a406`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6bc52e5a406) - [ED-17687] Capture errors caught in error boundaries in Sentry
|
|
8
|
+
- [`8a391616ecc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8a391616ecc) - Moving insert node API to a new editor plugin to allow it to be more extensible. Also exposing a new editor plugin action for tables to allow for consistent insertion.
|
|
9
|
+
- [`5cc449dac8d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5cc449dac8d) - Decouple card plugin so that it uses new NextEditorPlugin for any injected dependencies.
|
|
10
|
+
- [`be561d3491c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/be561d3491c) - [ED-17622] Adds new Resizer component
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`9220da2225b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9220da2225b) - ED-16320: Add checks to certain SLO related events to see if they are explicitly disabled, in preparation for disabling them for synthetic tenants in prod
|
|
15
|
+
- [`b804d3ad561`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b804d3ad561) - Remove unused code related to GASv2 table analytics from editor-plugin table, editor-core and editor-common
|
|
16
|
+
- [`e20cca743c4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e20cca743c4) - Moving editor analytics plugin to new package.
|
|
17
|
+
- [`f621ae6490a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f621ae6490a) - Adding type dependency on analytics plugin to tables plugin.
|
|
18
|
+
- [`a142ba1aa28`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a142ba1aa28) - [ED17172] Bump prosemirror-model to 1.16.0 and prosemirror-view to 1.23.7 and removed work-arounds for fixed issues
|
|
19
|
+
- [`9369cc38a68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9369cc38a68) - Migrated use of `gridSize` to space tokens where possible. There is no expected visual or behaviour change.
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 74.0.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -58,17 +58,20 @@ var EventDispatcher = /*#__PURE__*/function () {
|
|
|
58
58
|
}]);
|
|
59
59
|
return EventDispatcher;
|
|
60
60
|
}();
|
|
61
|
+
exports.EventDispatcher = EventDispatcher;
|
|
62
|
+
function getEventFromEventName(eventName) {
|
|
63
|
+
return typeof eventName === 'string' ? eventName : eventName.key;
|
|
64
|
+
}
|
|
65
|
+
|
|
61
66
|
/**
|
|
62
67
|
* Creates a dispatch function that can be called inside ProseMirror Plugin
|
|
63
68
|
* to notify listeners about that plugin's state change.
|
|
64
69
|
*/
|
|
65
|
-
exports.EventDispatcher = EventDispatcher;
|
|
66
70
|
function createDispatch(eventDispatcher) {
|
|
67
71
|
return function (eventName, data) {
|
|
68
72
|
if (!eventName) {
|
|
69
73
|
throw new Error('event name is required!');
|
|
70
74
|
}
|
|
71
|
-
|
|
72
|
-
eventDispatcher.emit(event, data);
|
|
75
|
+
eventDispatcher.emit(getEventFromEventName(eventName), data);
|
|
73
76
|
};
|
|
74
77
|
}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.shouldSplitSelectedNodeOnNodeInsertion = exports.safeInsert = exports.normaliseNestedLayout = exports.insertSelectedItem = exports.LookDirection = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _prosemirrorModel = require("prosemirror-model");
|
|
10
|
+
var _prosemirrorState = require("prosemirror-state");
|
|
11
|
+
var _prosemirrorTransform = require("prosemirror-transform");
|
|
12
|
+
var _prosemirrorUtils = require("prosemirror-utils");
|
|
13
|
+
var _selection = require("../selection");
|
|
14
|
+
var _utils = require("../utils");
|
|
15
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
|
+
var LookDirection = /*#__PURE__*/function (LookDirection) {
|
|
18
|
+
LookDirection["Before"] = "before";
|
|
19
|
+
LookDirection["After"] = "after";
|
|
20
|
+
return LookDirection;
|
|
21
|
+
}({});
|
|
22
|
+
exports.LookDirection = LookDirection;
|
|
23
|
+
var normaliseNestedLayout = function normaliseNestedLayout(_ref, node) {
|
|
24
|
+
var selection = _ref.selection,
|
|
25
|
+
doc = _ref.doc;
|
|
26
|
+
if (selection.$from.depth > 1) {
|
|
27
|
+
if (node.attrs.layout && node.attrs.layout !== 'default') {
|
|
28
|
+
return node.type.createChecked(_objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
29
|
+
layout: 'default'
|
|
30
|
+
}), node.content, node.marks);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// If its a breakout layout, we can remove the mark
|
|
34
|
+
// Since default isn't a valid breakout mode.
|
|
35
|
+
var breakoutMark = doc.type.schema.marks.breakout;
|
|
36
|
+
if (breakoutMark && breakoutMark.isInSet(node.marks)) {
|
|
37
|
+
var newMarks = breakoutMark.removeFromSet(node.marks);
|
|
38
|
+
return node.type.createChecked(node.attrs, node.content, newMarks);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return node;
|
|
42
|
+
};
|
|
43
|
+
exports.normaliseNestedLayout = normaliseNestedLayout;
|
|
44
|
+
var isLastChild = function isLastChild($pos, doc) {
|
|
45
|
+
return doc.resolve($pos.after()).node().lastChild === $pos.node();
|
|
46
|
+
};
|
|
47
|
+
var isFirstChild = function isFirstChild($pos, doc) {
|
|
48
|
+
return doc.resolve($pos.before()).node().firstChild === $pos.node();
|
|
49
|
+
};
|
|
50
|
+
var nodeIsInsideAList = function nodeIsInsideAList(tr) {
|
|
51
|
+
var nodes = tr.doc.type.schema.nodes;
|
|
52
|
+
return (0, _prosemirrorUtils.hasParentNodeOfType)([nodes.orderedList, nodes.bulletList])(tr.selection);
|
|
53
|
+
};
|
|
54
|
+
var selectionIsInsideAPanel = function selectionIsInsideAPanel(tr) {
|
|
55
|
+
var nodes = tr.doc.type.schema.nodes;
|
|
56
|
+
return (0, _prosemirrorUtils.hasParentNodeOfType)(nodes.panel)(tr.selection);
|
|
57
|
+
};
|
|
58
|
+
var selectionIsInNestedList = function selectionIsInNestedList(tr) {
|
|
59
|
+
var nodes = tr.doc.type.schema.nodes;
|
|
60
|
+
var parentListNode = (0, _prosemirrorUtils.findParentNodeOfType)([nodes.orderedList, nodes.bulletList])(tr.selection);
|
|
61
|
+
if (!parentListNode) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
return (0, _utils.isListItemNode)(tr.doc.resolve(parentListNode.pos).parent);
|
|
65
|
+
};
|
|
66
|
+
var insertBeforeOrAfter = function insertBeforeOrAfter(tr, lookDirection, $parentPos, $proposedPosition, content) {
|
|
67
|
+
/**
|
|
68
|
+
* This block caters for the first item in a parent with the cursor being at the very start
|
|
69
|
+
* or the last item with the cursor being at the very end
|
|
70
|
+
*
|
|
71
|
+
* e.g.
|
|
72
|
+
* ul
|
|
73
|
+
* li {<>}Scenario one
|
|
74
|
+
* li
|
|
75
|
+
* li Scenario two{<>}
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
if (isFirstChild($proposedPosition, tr.doc) && lookDirection === LookDirection.Before || isLastChild($proposedPosition, tr.doc) && lookDirection === LookDirection.After) {
|
|
79
|
+
return tr.insert($parentPos[lookDirection](), content);
|
|
80
|
+
}
|
|
81
|
+
return tr.insert($proposedPosition[lookDirection](), content);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// FIXME: A more sustainable and configurable way to choose when to split
|
|
85
|
+
var shouldSplit = function shouldSplit(nodeType, schemaNodes) {
|
|
86
|
+
return [schemaNodes.bulletList, schemaNodes.orderedList, schemaNodes.panel].includes(nodeType);
|
|
87
|
+
};
|
|
88
|
+
var safeInsert = function safeInsert(content, position) {
|
|
89
|
+
return function (tr) {
|
|
90
|
+
var _tr$selection$$from$n;
|
|
91
|
+
var nodes = tr.doc.type.schema.nodes;
|
|
92
|
+
var whitelist = [nodes.rule, nodes.mediaSingle];
|
|
93
|
+
if (content instanceof _prosemirrorModel.Fragment || !whitelist.includes(content.type)) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Check for selection
|
|
98
|
+
if (!tr.selection.empty || (0, _prosemirrorUtils.isNodeSelection)(tr.selection)) {
|
|
99
|
+
// NOT IMPLEMENTED
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
var $from = tr.selection.$from;
|
|
103
|
+
var $insertPos = position ? tr.doc.resolve(position) : (0, _prosemirrorUtils.isNodeSelection)(tr.selection) ? tr.doc.resolve($from.pos + 1) : $from;
|
|
104
|
+
var lookDirection;
|
|
105
|
+
var insertPosEnd = $insertPos.end();
|
|
106
|
+
var insertPosStart = $insertPos.start();
|
|
107
|
+
|
|
108
|
+
// When parent node is an empty paragraph,
|
|
109
|
+
// check the empty paragraph is the first or last node of its parent.
|
|
110
|
+
if ((0, _utils.isEmptyParagraph)($insertPos.parent)) {
|
|
111
|
+
if (isLastChild($insertPos, tr.doc)) {
|
|
112
|
+
lookDirection = LookDirection.After;
|
|
113
|
+
} else if (isFirstChild($insertPos, tr.doc)) {
|
|
114
|
+
lookDirection = LookDirection.Before;
|
|
115
|
+
}
|
|
116
|
+
} else {
|
|
117
|
+
if ($insertPos.pos === insertPosEnd) {
|
|
118
|
+
lookDirection = LookDirection.After;
|
|
119
|
+
} else if ($insertPos.pos === insertPosStart) {
|
|
120
|
+
lookDirection = LookDirection.Before;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
var grandParentNodeType = (_tr$selection$$from$n = tr.selection.$from.node(-1)) === null || _tr$selection$$from$n === void 0 ? void 0 : _tr$selection$$from$n.type;
|
|
124
|
+
var parentNodeType = tr.selection.$from.parent.type;
|
|
125
|
+
|
|
126
|
+
// if there is no direction, and cannot split for this particular node
|
|
127
|
+
var noDirectionAndShouldNotSplit = !lookDirection && !shouldSplitSelectedNodeOnNodeInsertion({
|
|
128
|
+
parentNodeType: parentNodeType,
|
|
129
|
+
grandParentNodeType: grandParentNodeType,
|
|
130
|
+
content: content
|
|
131
|
+
});
|
|
132
|
+
var ruleNodeInANestedListNode = content.type === nodes.rule && selectionIsInNestedList(tr);
|
|
133
|
+
var nonRuleNodeInListNode = !(content.type === nodes.rule) && nodeIsInsideAList(tr);
|
|
134
|
+
if (ruleNodeInANestedListNode || noDirectionAndShouldNotSplit && nonRuleNodeInListNode || noDirectionAndShouldNotSplit && !nodeIsInsideAList(tr)) {
|
|
135
|
+
// node to be inserted is an invalid child of selection so insert below selected node
|
|
136
|
+
return (0, _prosemirrorUtils.safeInsert)(content, tr.selection.from)(tr);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// if node is a rule and that is a flat list splitting and not at the end of a list
|
|
140
|
+
var _tr$selection = tr.selection,
|
|
141
|
+
from = _tr$selection.from,
|
|
142
|
+
to = _tr$selection.to;
|
|
143
|
+
var ruleTypeInAList = content.type === nodes.rule && nodeIsInsideAList(tr);
|
|
144
|
+
if (ruleTypeInAList && !($insertPos.pos === insertPosEnd)) {
|
|
145
|
+
return tr.replaceRange(from, to, new _prosemirrorModel.Slice(_prosemirrorModel.Fragment.from(nodes.rule.createChecked()), 0, 0));
|
|
146
|
+
}
|
|
147
|
+
if (!lookDirection) {
|
|
148
|
+
// fallback to consumer for now
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Replace empty paragraph
|
|
153
|
+
if ((0, _utils.isEmptyParagraph)($insertPos.parent) && (0, _prosemirrorUtils.canInsert)(tr.doc.resolve($insertPos[lookDirection]()), content)) {
|
|
154
|
+
return finaliseInsert(tr.replaceWith($insertPos.before(), $insertPos.after(), content), -1);
|
|
155
|
+
}
|
|
156
|
+
var $proposedPosition = $insertPos;
|
|
157
|
+
while ($proposedPosition.depth > 0) {
|
|
158
|
+
var $parentPos = tr.doc.resolve($proposedPosition[lookDirection]());
|
|
159
|
+
var parentNode = $parentPos.node();
|
|
160
|
+
|
|
161
|
+
// Insert at position (before or after target pos)
|
|
162
|
+
if ((0, _prosemirrorUtils.canInsert)($proposedPosition, content)) {
|
|
163
|
+
return finaliseInsert(tr.insert($proposedPosition.pos, content), content.nodeSize);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// If we can't insert, and we think we should split, we fallback to consumer for now
|
|
167
|
+
if (shouldSplit(parentNode.type, tr.doc.type.schema.nodes)) {
|
|
168
|
+
var nextTr = finaliseInsert(insertBeforeOrAfter(tr, lookDirection, $parentPos, $proposedPosition, content), content.nodeSize);
|
|
169
|
+
|
|
170
|
+
// Move selection to the closest text node, otherwise it defaults to the whatever the lookDirection is set to above
|
|
171
|
+
if ([nodes.orderedList, nodes.bulletList].includes(parentNode.type) && nextTr) {
|
|
172
|
+
return nextTr.setSelection(_prosemirrorState.TextSelection.between(nextTr.selection.$from, nextTr.selection.$from));
|
|
173
|
+
} else {
|
|
174
|
+
return nextTr;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Can not insert into current parent, step up one parent
|
|
179
|
+
$proposedPosition = $parentPos;
|
|
180
|
+
}
|
|
181
|
+
return finaliseInsert(tr.insert($proposedPosition.pos, content), content.nodeSize);
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
exports.safeInsert = safeInsert;
|
|
185
|
+
var finaliseInsert = function finaliseInsert(tr, nodeLength) {
|
|
186
|
+
var lastStep = tr.steps[tr.steps.length - 1];
|
|
187
|
+
if (!(lastStep instanceof _prosemirrorTransform.ReplaceStep || lastStep instanceof _prosemirrorTransform.ReplaceAroundStep)) {
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Place gap cursor after the newly inserted node
|
|
192
|
+
var gapCursorPos = lastStep.to + lastStep.slice.openStart + nodeLength;
|
|
193
|
+
return tr.setSelection(new _selection.GapCursorSelection(tr.doc.resolve(gapCursorPos), _selection.Side.RIGHT)).scrollIntoView();
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Method extracted from typeahed plugin to be shared with the element browser on handling element insertion.
|
|
198
|
+
*/
|
|
199
|
+
var insertSelectedItem = function insertSelectedItem(maybeNode) {
|
|
200
|
+
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
201
|
+
return function (state, tr, start) {
|
|
202
|
+
if (!maybeNode) {
|
|
203
|
+
return tr;
|
|
204
|
+
}
|
|
205
|
+
var isInputFragment = maybeNode instanceof _prosemirrorModel.Fragment;
|
|
206
|
+
var node;
|
|
207
|
+
try {
|
|
208
|
+
node = maybeNode instanceof _prosemirrorModel.Node || isInputFragment ? maybeNode : typeof maybeNode === 'string' ? state.schema.text(maybeNode) : _prosemirrorModel.Node.fromJSON(state.schema, maybeNode);
|
|
209
|
+
} catch (e) {
|
|
210
|
+
// eslint-disable-next-line no-console
|
|
211
|
+
console.error(e);
|
|
212
|
+
return tr;
|
|
213
|
+
}
|
|
214
|
+
if (node.isText) {
|
|
215
|
+
tr = tr.replaceWith(start, start, node);
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
*
|
|
219
|
+
* Replacing a type ahead query mark with a block node.
|
|
220
|
+
*
|
|
221
|
+
*/
|
|
222
|
+
} else if (node.isBlock) {
|
|
223
|
+
/**
|
|
224
|
+
*
|
|
225
|
+
* Rule has unique insertion behaviour
|
|
226
|
+
* so using this safeInsert function in order to handle specific cases in flat list vs nested list
|
|
227
|
+
* instead of a generic pmSafeInsert (i.e appending at the end)
|
|
228
|
+
*
|
|
229
|
+
*/
|
|
230
|
+
|
|
231
|
+
var selectionInsideAPanel = selectionIsInsideAPanel(tr);
|
|
232
|
+
if (node.type.name === 'rule' && !selectionInsideAPanel) {
|
|
233
|
+
var _safeInsert;
|
|
234
|
+
tr = (_safeInsert = safeInsert(node, tr.selection.from)(tr)) !== null && _safeInsert !== void 0 ? _safeInsert : tr;
|
|
235
|
+
} else {
|
|
236
|
+
tr = (0, _prosemirrorUtils.safeInsert)(normaliseNestedLayout(state, node), undefined, true)(tr);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
*
|
|
241
|
+
* Replacing a type ahead query mark with an inline node.
|
|
242
|
+
*
|
|
243
|
+
*/
|
|
244
|
+
} else if (node.isInline || isInputFragment) {
|
|
245
|
+
var fragment = isInputFragment ? node : _prosemirrorModel.Fragment.fromArray([node, state.schema.text(' ')]);
|
|
246
|
+
tr = tr.replaceWith(start, start, fragment);
|
|
247
|
+
if (opts.selectInlineNode) {
|
|
248
|
+
// Select inserted node
|
|
249
|
+
tr = tr.setSelection(_prosemirrorState.NodeSelection.create(tr.doc, start));
|
|
250
|
+
} else {
|
|
251
|
+
// Placing cursor after node + space.
|
|
252
|
+
tr = tr.setSelection(_prosemirrorState.Selection.near(tr.doc.resolve(start + fragment.size)));
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return tr;
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* ED-14584: Util to check if the destination node is a paragraph & the
|
|
261
|
+
* content being inserted is a valid child of the grandparent node.
|
|
262
|
+
* In this case, the destination node should split
|
|
263
|
+
*/
|
|
264
|
+
exports.insertSelectedItem = insertSelectedItem;
|
|
265
|
+
var shouldSplitSelectedNodeOnNodeInsertion = function shouldSplitSelectedNodeOnNodeInsertion(_ref2) {
|
|
266
|
+
var parentNodeType = _ref2.parentNodeType,
|
|
267
|
+
grandParentNodeType = _ref2.grandParentNodeType,
|
|
268
|
+
content = _ref2.content;
|
|
269
|
+
if (parentNodeType.name === 'doc' || parentNodeType.name === 'paragraph' && grandParentNodeType.validContent(_prosemirrorModel.Fragment.from(content))) {
|
|
270
|
+
return true;
|
|
271
|
+
}
|
|
272
|
+
return false;
|
|
273
|
+
};
|
|
274
|
+
exports.shouldSplitSelectedNodeOnNodeInsertion = shouldSplitSelectedNodeOnNodeInsertion;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.logException = void 0;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
18
|
+
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
19
|
+
var packageVersion = "74.1.0";
|
|
20
|
+
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
|
+
// Remove URL as it has UGC
|
|
22
|
+
// TODO: Sanitise the URL instead of just removing it
|
|
23
|
+
if (data.request) {
|
|
24
|
+
delete data.request.url;
|
|
25
|
+
}
|
|
26
|
+
return data;
|
|
27
|
+
};
|
|
28
|
+
var logException = /*#__PURE__*/function () {
|
|
29
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(error, tags) {
|
|
30
|
+
var _process$env$CLOUD_EN, _yield$import, BrowserClient, defaultIntegrations, getCurrentHub, _yield$import2, ExtraErrorData, sentryOptions, client, hub;
|
|
31
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
32
|
+
while (1) switch (_context.prev = _context.next) {
|
|
33
|
+
case 0:
|
|
34
|
+
_context.prev = 0;
|
|
35
|
+
if (!(process.env.NODE_ENV !== 'production' || process.env.CLOUD_ENV === 'branch')) {
|
|
36
|
+
_context.next = 3;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
return _context.abrupt("return");
|
|
40
|
+
case 3:
|
|
41
|
+
_context.next = 5;
|
|
42
|
+
return Promise.resolve().then(function () {
|
|
43
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_editor-sentrybrowser" */'@sentry/browser'));
|
|
44
|
+
});
|
|
45
|
+
case 5:
|
|
46
|
+
_yield$import = _context.sent;
|
|
47
|
+
BrowserClient = _yield$import.BrowserClient;
|
|
48
|
+
defaultIntegrations = _yield$import.defaultIntegrations;
|
|
49
|
+
getCurrentHub = _yield$import.getCurrentHub;
|
|
50
|
+
_context.next = 11;
|
|
51
|
+
return Promise.resolve().then(function () {
|
|
52
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_editor-sentryintegrations" */'@sentry/integrations'));
|
|
53
|
+
});
|
|
54
|
+
case 11:
|
|
55
|
+
_yield$import2 = _context.sent;
|
|
56
|
+
ExtraErrorData = _yield$import2.ExtraErrorData;
|
|
57
|
+
sentryOptions = {
|
|
58
|
+
dsn: SENTRY_DSN,
|
|
59
|
+
release: "".concat(packageName, "@").concat(packageVersion),
|
|
60
|
+
environment: (_process$env$CLOUD_EN = process.env.CLOUD_ENV) !== null && _process$env$CLOUD_EN !== void 0 ? _process$env$CLOUD_EN : 'unknown',
|
|
61
|
+
ignoreErrors: [
|
|
62
|
+
// Network issues
|
|
63
|
+
/^network error/i, /^network failure/i, 'TypeError: Failed to fetch',
|
|
64
|
+
// A benign error, see https://stackoverflow.com/a/50387233/2645305
|
|
65
|
+
'ResizeObserver loop limit exceeded', /ResizeObserver loop completed with undelivered notifications/],
|
|
66
|
+
autoSessionTracking: false,
|
|
67
|
+
integrations: function integrations(_integrations) {
|
|
68
|
+
return [].concat((0, _toConsumableArray2.default)(defaultIntegrations.filter(function (_ref2) {
|
|
69
|
+
var name = _ref2.name;
|
|
70
|
+
return name !== 'Breadcrumbs';
|
|
71
|
+
})), [
|
|
72
|
+
// Extracts all non-native attributes from the error object and attaches them to the event as the extra data
|
|
73
|
+
// https://docs.sentry.io/platforms/javascript/configuration/integrations/plugin/?original_referrer=https%3A%2F%2Fduckduckgo.com%2F#extraerrordata
|
|
74
|
+
new ExtraErrorData()]);
|
|
75
|
+
},
|
|
76
|
+
beforeSend: sanitiseSentryEvents
|
|
77
|
+
}; // Use a client to avoid picking up the errors from parent applications
|
|
78
|
+
client = new BrowserClient(sentryOptions);
|
|
79
|
+
hub = getCurrentHub();
|
|
80
|
+
hub.bindClient(client);
|
|
81
|
+
hub.withScope(function (scope) {
|
|
82
|
+
scope.setTags(_objectSpread({
|
|
83
|
+
// Jira environment variables
|
|
84
|
+
'jira-bundler': window.BUNDLER_VERSION,
|
|
85
|
+
'jira-variant': window.BUILD_VARIANT,
|
|
86
|
+
'jira-release': window.BUILD_KEY,
|
|
87
|
+
// Confluence environment variables
|
|
88
|
+
'confluence-frontend-version': window.__buildInfo.FRONTEND_VERSION
|
|
89
|
+
}, tags));
|
|
90
|
+
hub.captureException(error);
|
|
91
|
+
});
|
|
92
|
+
return _context.abrupt("return", client.close());
|
|
93
|
+
case 21:
|
|
94
|
+
_context.prev = 21;
|
|
95
|
+
_context.t0 = _context["catch"](0);
|
|
96
|
+
case 23:
|
|
97
|
+
case "end":
|
|
98
|
+
return _context.stop();
|
|
99
|
+
}
|
|
100
|
+
}, _callee, null, [[0, 21]]);
|
|
101
|
+
}));
|
|
102
|
+
return function logException(_x, _x2) {
|
|
103
|
+
return _ref.apply(this, arguments);
|
|
104
|
+
};
|
|
105
|
+
}();
|
|
106
|
+
exports.logException = logException;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "logException", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _error.logException;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _error = require("./error");
|
|
@@ -10,6 +10,8 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
10
10
|
var _extension = require("../styles/shared/extension");
|
|
11
11
|
var _layout = require("../styles/shared/layout");
|
|
12
12
|
var _breakout = require("../utils/breakout");
|
|
13
|
+
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
14
|
+
|
|
13
15
|
/**
|
|
14
16
|
* Calculates width of parent node of a nested node (inside layouts, extension)
|
|
15
17
|
* If current node selection is not nested will return undefined
|
|
@@ -52,6 +54,9 @@ var getParentNodeWidth = function getParentNodeWidth(pos, state, containerWidth,
|
|
|
52
54
|
case schema.nodes.bodiedExtension:
|
|
53
55
|
parentWidth -= _extension.BODIED_EXT_PADDING * 2;
|
|
54
56
|
break;
|
|
57
|
+
|
|
58
|
+
// TODO: Migrate away from gridSize
|
|
59
|
+
// Recommendation: Replace gridSize with 8
|
|
55
60
|
case schema.nodes.expand:
|
|
56
61
|
// padding
|
|
57
62
|
parentWidth -= (0, _constants.gridSize)() * 2;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = _default;
|
|
7
|
+
/*
|
|
8
|
+
* ED-15646
|
|
9
|
+
* Headings in list items are not supported in our schema.
|
|
10
|
+
* As the markdown transformer is used by the paste plugin,
|
|
11
|
+
* certain pastes will strip invalid lines as
|
|
12
|
+
* prosemirror-markdown cannot conform to the schema
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
function handleHeadingOpen(state, token, acc, index) {
|
|
16
|
+
var _state$tokens;
|
|
17
|
+
var isInListItem = ((_state$tokens = state.tokens[index - 1]) === null || _state$tokens === void 0 ? void 0 : _state$tokens.type) === 'list_item_open';
|
|
18
|
+
if (isInListItem) {
|
|
19
|
+
acc.push(new state.Token('paragraph_open', 'p', 1));
|
|
20
|
+
} else {
|
|
21
|
+
acc.push(token);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function handleHeadingClose(state, token, acc, index) {
|
|
25
|
+
var _state$tokens2;
|
|
26
|
+
var isInListItem = ((_state$tokens2 = state.tokens[index + 1]) === null || _state$tokens2 === void 0 ? void 0 : _state$tokens2.type) === 'list_item_close';
|
|
27
|
+
if (isInListItem) {
|
|
28
|
+
acc.push(new state.Token('paragraph_close', 'p', -1));
|
|
29
|
+
} else {
|
|
30
|
+
acc.push(token);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function _default(md) {
|
|
34
|
+
md.core.ruler.after('inline', 'ignore-list-heading-md-plugin', function (state) {
|
|
35
|
+
state.tokens = state.tokens.reduce(function (acc, token, index) {
|
|
36
|
+
var type = token.type;
|
|
37
|
+
if (type === 'heading_open') {
|
|
38
|
+
handleHeadingOpen(state, token, acc, index);
|
|
39
|
+
} else if (type === 'heading_close') {
|
|
40
|
+
handleHeadingClose(state, token, acc, index);
|
|
41
|
+
} else {
|
|
42
|
+
acc.push(token);
|
|
43
|
+
}
|
|
44
|
+
return acc;
|
|
45
|
+
}, []);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _linkifyIt = _interopRequireDefault(require("linkify-it"));
|
|
9
|
+
var _adfSchema = require("@atlaskit/adf-schema");
|
|
10
|
+
var _utils = require("../../utils");
|
|
11
|
+
// File has been copied to packages/editor/editor-plugin-ai/src/provider/markdown-transformer/md/linkify-md-plugin.ts
|
|
12
|
+
// If changes are made to this file, please make the same update in the linked file.
|
|
13
|
+
|
|
14
|
+
// modified version of the original Linkify plugin
|
|
15
|
+
// https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js
|
|
16
|
+
var arrayReplaceAt = function arrayReplaceAt(src, pos, newElements) {
|
|
17
|
+
return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));
|
|
18
|
+
};
|
|
19
|
+
var isLinkOpen = function isLinkOpen(str) {
|
|
20
|
+
return /^<a[>\s]/i.test(str);
|
|
21
|
+
};
|
|
22
|
+
var isLinkClose = function isLinkClose(str) {
|
|
23
|
+
return /^<\/a\s*>/i.test(str);
|
|
24
|
+
};
|
|
25
|
+
var linkify = function linkify(state) {
|
|
26
|
+
var blockTokens = state.tokens;
|
|
27
|
+
var linkify = new _linkifyIt.default();
|
|
28
|
+
for (var j = 0, l = blockTokens.length; j < l; j++) {
|
|
29
|
+
if (blockTokens[j].type !== 'inline' || !linkify.pretest(blockTokens[j].content)) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
var tokens = blockTokens[j].children;
|
|
33
|
+
var htmlLinkLevel = 0;
|
|
34
|
+
|
|
35
|
+
// We scan from the end, to keep position when new tags added.
|
|
36
|
+
// Use reversed logic in links start/end match
|
|
37
|
+
for (var i = tokens.length - 1; i >= 0; i--) {
|
|
38
|
+
var currentToken = tokens[i];
|
|
39
|
+
|
|
40
|
+
// Skip content of markdown links
|
|
41
|
+
if (currentToken.type === 'link_close') {
|
|
42
|
+
i--;
|
|
43
|
+
while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') {
|
|
44
|
+
i--;
|
|
45
|
+
}
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Skip content of html tag links
|
|
50
|
+
if (currentToken.type === 'html_inline') {
|
|
51
|
+
if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {
|
|
52
|
+
htmlLinkLevel--;
|
|
53
|
+
}
|
|
54
|
+
if (isLinkClose(currentToken.content)) {
|
|
55
|
+
htmlLinkLevel++;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (htmlLinkLevel > 0) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
if (currentToken.type === 'text' && linkify.test(currentToken.content)) {
|
|
62
|
+
var text = currentToken.content;
|
|
63
|
+
var links = (0, _adfSchema.linkifyMatch)(text);
|
|
64
|
+
if (!links.length) {
|
|
65
|
+
links = linkify.match(text) || [];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Now split string to nodes
|
|
69
|
+
var nodes = [];
|
|
70
|
+
var level = currentToken.level;
|
|
71
|
+
var lastPos = 0;
|
|
72
|
+
var filepaths = (0, _utils.findFilepaths)(text);
|
|
73
|
+
for (var ln = 0; ln < links.length; ln++) {
|
|
74
|
+
if ((0, _utils.isLinkInMatches)(links[ln].index, filepaths)) {
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
var url = links[ln].url;
|
|
78
|
+
var fullUrl = state.md.normalizeLink(url);
|
|
79
|
+
if (!state.md.validateLink(fullUrl)) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
var urlText = links[ln].text;
|
|
83
|
+
|
|
84
|
+
// Linkifier might send raw hostnames like "example.com", where url
|
|
85
|
+
// starts with domain name. So we prepend http:// in those cases,
|
|
86
|
+
// and remove it afterwards.
|
|
87
|
+
//
|
|
88
|
+
if (!links[ln].schema) {
|
|
89
|
+
urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, '');
|
|
90
|
+
} else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) {
|
|
91
|
+
urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, '');
|
|
92
|
+
} else {
|
|
93
|
+
urlText = state.md.normalizeLinkText(urlText);
|
|
94
|
+
}
|
|
95
|
+
var pos = links[ln].index;
|
|
96
|
+
if (pos > lastPos) {
|
|
97
|
+
var _token = new state.Token('text', '', 0);
|
|
98
|
+
_token.content = text.slice(lastPos, pos);
|
|
99
|
+
_token.level = level;
|
|
100
|
+
nodes.push(_token);
|
|
101
|
+
}
|
|
102
|
+
var token = new state.Token('link_open', 'a', 1);
|
|
103
|
+
token.attrs = [['href', fullUrl]];
|
|
104
|
+
token.level = level++;
|
|
105
|
+
token.markup = 'linkify';
|
|
106
|
+
token.info = 'auto';
|
|
107
|
+
nodes.push(token);
|
|
108
|
+
token = new state.Token('text', '', 0);
|
|
109
|
+
token.content = urlText;
|
|
110
|
+
token.level = level;
|
|
111
|
+
nodes.push(token);
|
|
112
|
+
token = new state.Token('link_close', 'a', -1);
|
|
113
|
+
token.level = --level;
|
|
114
|
+
token.markup = 'linkify';
|
|
115
|
+
token.info = 'auto';
|
|
116
|
+
nodes.push(token);
|
|
117
|
+
lastPos = links[ln].lastIndex;
|
|
118
|
+
}
|
|
119
|
+
if (lastPos < text.length) {
|
|
120
|
+
var _token2 = new state.Token('text', '', 0);
|
|
121
|
+
_token2.content = text.slice(lastPos);
|
|
122
|
+
_token2.level = level;
|
|
123
|
+
nodes.push(_token2);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// replace current node
|
|
127
|
+
blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
var _default = function _default(md) {
|
|
133
|
+
return md.core.ruler.push('custom-linkify', linkify);
|
|
134
|
+
};
|
|
135
|
+
exports.default = _default;
|