@atlaskit/editor-core 185.1.6 → 185.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/actions/index.js +2 -2
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +1 -2
- package/dist/cjs/index.js +0 -6
- package/dist/cjs/labs/next/internal/hooks/use-editor/create-editor.js +1 -1
- package/dist/cjs/messages.js +6 -56
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +2 -2
- package/dist/cjs/plugins/base/pm-plugins/scroll-gutter.js +1 -1
- package/dist/cjs/plugins/card/nodeviews/blockCard.js +2 -2
- package/dist/cjs/plugins/card/nodeviews/embedCard.js +4 -4
- package/dist/cjs/plugins/card/pm-plugins/doc.js +9 -11
- package/dist/cjs/plugins/card/pm-plugins/keymap.js +3 -6
- package/dist/cjs/plugins/card/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/card/toolbar.js +12 -15
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +4 -6
- package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +7 -10
- package/dist/cjs/plugins/card/utils.js +3 -4
- package/dist/cjs/plugins/clear-marks-on-change-to-empty-document/index.js +1 -1
- package/dist/cjs/plugins/custom-autoformat/doc.js +1 -1
- package/dist/cjs/plugins/date/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/emoji/index.js +2 -2
- package/dist/cjs/plugins/floating-toolbar/index.js +1 -1
- package/dist/cjs/plugins/hyperlink/Toolbar.js +8 -8
- package/dist/cjs/plugins/hyperlink/commands.js +2 -3
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +2 -2
- package/dist/cjs/plugins/layout/actions.js +1 -1
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -3
- package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -2
- package/dist/cjs/plugins/media/toolbar/index.js +9 -8
- package/dist/cjs/plugins/media/toolbar/linking-toolbar-appearance.js +4 -3
- package/dist/cjs/plugins/media/toolbar/linking.js +3 -3
- package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +1 -1
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +6 -8
- package/dist/cjs/plugins/media/utils/media-files.js +8 -7
- package/dist/cjs/plugins/mentions/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/placeholder/index.js +2 -3
- package/dist/cjs/plugins/status/plugin.js +2 -2
- package/dist/cjs/plugins/unsupported-content/index.js +3 -3
- package/dist/cjs/ui/Appearance/Chromeless.js +4 -2
- package/dist/cjs/ui/Appearance/Comment/Comment.js +4 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +2 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/cjs/ui/Appearance/Mobile.js +4 -2
- package/dist/cjs/ui/AppearanceComponents/Mobile.js +6 -3
- package/dist/cjs/ui/ContentStyles/index.js +5 -3
- package/dist/cjs/ui/LinkSearch/ToolbarComponents.js +4 -11
- package/dist/cjs/utils/document.js +7 -249
- package/dist/cjs/utils/index.js +1 -23
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +2 -1
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/labs/next/internal/hooks/use-editor/create-editor.js +1 -1
- package/dist/es2019/messages.js +2 -54
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/es2019/plugins/base/pm-plugins/scroll-gutter.js +1 -1
- package/dist/es2019/plugins/card/nodeviews/blockCard.js +1 -1
- package/dist/es2019/plugins/card/nodeviews/embedCard.js +1 -1
- package/dist/es2019/plugins/card/pm-plugins/doc.js +2 -3
- package/dist/es2019/plugins/card/pm-plugins/keymap.js +3 -3
- package/dist/es2019/plugins/card/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/card/toolbar.js +7 -9
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +3 -4
- package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +1 -4
- package/dist/es2019/plugins/card/utils.js +1 -2
- package/dist/es2019/plugins/clear-marks-on-change-to-empty-document/index.js +1 -1
- package/dist/es2019/plugins/custom-autoformat/doc.js +1 -1
- package/dist/es2019/plugins/date/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/emoji/index.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/index.js +1 -1
- package/dist/es2019/plugins/hyperlink/Toolbar.js +3 -3
- package/dist/es2019/plugins/hyperlink/commands.js +1 -2
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +1 -1
- package/dist/es2019/plugins/layout/actions.js +1 -1
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
- package/dist/es2019/plugins/media/toolbar/index.js +9 -8
- package/dist/es2019/plugins/media/toolbar/linking-toolbar-appearance.js +2 -1
- package/dist/es2019/plugins/media/toolbar/linking.js +1 -1
- package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +1 -1
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +2 -4
- package/dist/es2019/plugins/media/utils/media-files.js +4 -3
- package/dist/es2019/plugins/mentions/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/placeholder/index.js +1 -1
- package/dist/es2019/plugins/status/plugin.js +1 -1
- package/dist/es2019/plugins/unsupported-content/index.js +1 -1
- package/dist/es2019/ui/Appearance/Chromeless.js +4 -2
- package/dist/es2019/ui/Appearance/Comment/Comment.js +4 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +2 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/es2019/ui/Appearance/Mobile.js +4 -2
- package/dist/es2019/ui/AppearanceComponents/Mobile.js +6 -3
- package/dist/es2019/ui/ContentStyles/index.js +5 -3
- package/dist/es2019/ui/LinkSearch/ToolbarComponents.js +1 -4
- package/dist/es2019/utils/document.js +3 -244
- package/dist/es2019/utils/index.js +1 -4
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +2 -1
- package/dist/esm/create-editor/ReactEditorViewInternal.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/labs/next/internal/hooks/use-editor/create-editor.js +1 -1
- package/dist/esm/messages.js +2 -54
- package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/esm/plugins/base/pm-plugins/scroll-gutter.js +1 -1
- package/dist/esm/plugins/card/nodeviews/blockCard.js +1 -1
- package/dist/esm/plugins/card/nodeviews/embedCard.js +1 -1
- package/dist/esm/plugins/card/pm-plugins/doc.js +2 -3
- package/dist/esm/plugins/card/pm-plugins/keymap.js +3 -3
- package/dist/esm/plugins/card/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/card/toolbar.js +7 -9
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +3 -4
- package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +1 -4
- package/dist/esm/plugins/card/utils.js +1 -2
- package/dist/esm/plugins/clear-marks-on-change-to-empty-document/index.js +1 -1
- package/dist/esm/plugins/custom-autoformat/doc.js +1 -1
- package/dist/esm/plugins/date/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/emoji/index.js +1 -1
- package/dist/esm/plugins/floating-toolbar/index.js +1 -1
- package/dist/esm/plugins/hyperlink/Toolbar.js +3 -3
- package/dist/esm/plugins/hyperlink/commands.js +1 -2
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +1 -1
- package/dist/esm/plugins/layout/actions.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
- package/dist/esm/plugins/media/toolbar/index.js +9 -8
- package/dist/esm/plugins/media/toolbar/linking-toolbar-appearance.js +2 -1
- package/dist/esm/plugins/media/toolbar/linking.js +1 -1
- package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +1 -1
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +2 -4
- package/dist/esm/plugins/media/utils/media-files.js +4 -3
- package/dist/esm/plugins/mentions/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/placeholder/index.js +1 -1
- package/dist/esm/plugins/status/plugin.js +1 -1
- package/dist/esm/plugins/unsupported-content/index.js +1 -1
- package/dist/esm/ui/Appearance/Chromeless.js +4 -2
- package/dist/esm/ui/Appearance/Comment/Comment.js +4 -2
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +2 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/esm/ui/Appearance/Mobile.js +4 -2
- package/dist/esm/ui/AppearanceComponents/Mobile.js +6 -3
- package/dist/esm/ui/ContentStyles/index.js +5 -3
- package/dist/esm/ui/LinkSearch/ToolbarComponents.js +1 -4
- package/dist/esm/utils/document.js +6 -240
- package/dist/esm/utils/index.js +1 -4
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/index.d.ts +1 -2
- package/dist/types/labs/next/presets/cxhtml.d.ts +3 -3
- package/dist/types/labs/next/presets/default.d.ts +1 -1
- package/dist/types/labs/next/presets/mobile.d.ts +3 -3
- package/dist/types/messages.d.ts +2 -53
- package/dist/types/plugins/card/nodeviews/blockCard.d.ts +1 -1
- package/dist/types/plugins/card/nodeviews/genericCard.d.ts +3 -3
- package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +1 -1
- package/dist/types/plugins/card/toolbar.d.ts +1 -1
- package/dist/types/plugins/card/types.d.ts +1 -1
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +1 -1
- package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +1 -1
- package/dist/types/plugins/date/nodeviews/date.d.ts +1 -1
- package/dist/types/plugins/emoji/nodeviews/emoji.d.ts +1 -1
- package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +1 -1
- package/dist/types/plugins/hyperlink/Toolbar.d.ts +1 -1
- package/dist/types/plugins/hyperlink/commands.d.ts +2 -3
- package/dist/types/plugins/hyperlink/index.d.ts +1 -1
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +1 -1
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +1 -1
- package/dist/types/plugins/media/ui/ResizableMediaSingle/types.d.ts +0 -15
- package/dist/types/plugins/media/utils/media-files.d.ts +1 -1
- package/dist/types/plugins/mentions/nodeviews/mention.d.ts +1 -1
- package/dist/types/plugins/status/nodeviews/status.d.ts +1 -1
- package/dist/types/plugins/unsupported-content/unsupported-inline-node-view.d.ts +1 -1
- package/dist/types/types/editor-props.d.ts +1 -1
- package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +2 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +5 -364
- package/dist/types/ui/Appearance/Mobile.d.ts +1 -1
- package/dist/types/ui/AppearanceComponents/Mobile.d.ts +2 -0
- package/dist/types/ui/ContentStyles/index.d.ts +3 -3
- package/dist/types/ui/LinkSearch/ToolbarComponents.d.ts +0 -4
- package/dist/types/utils/document.d.ts +0 -12
- package/dist/types/utils/index.d.ts +1 -2
- package/dist/types-ts4.5/index.d.ts +1 -2
- package/dist/types-ts4.5/labs/next/presets/cxhtml.d.ts +3 -3
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +1 -1
- package/dist/types-ts4.5/labs/next/presets/mobile.d.ts +3 -3
- package/dist/types-ts4.5/messages.d.ts +2 -53
- package/dist/types-ts4.5/plugins/card/nodeviews/blockCard.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/nodeviews/genericCard.d.ts +3 -3
- package/dist/types-ts4.5/plugins/card/nodeviews/inlineCard.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/toolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/ui/EditLinkToolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/ui/ResizableEmbedCard.d.ts +1 -1
- package/dist/types-ts4.5/plugins/date/nodeviews/date.d.ts +1 -1
- package/dist/types-ts4.5/plugins/emoji/nodeviews/emoji.d.ts +1 -1
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/Toolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/hyperlink/Toolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/hyperlink/commands.d.ts +2 -3
- package/dist/types-ts4.5/plugins/hyperlink/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/types.d.ts +0 -15
- package/dist/types-ts4.5/plugins/media/utils/media-files.d.ts +1 -1
- package/dist/types-ts4.5/plugins/mentions/nodeviews/mention.d.ts +1 -1
- package/dist/types-ts4.5/plugins/status/nodeviews/status.d.ts +1 -1
- package/dist/types-ts4.5/plugins/unsupported-content/unsupported-inline-node-view.d.ts +1 -1
- package/dist/types-ts4.5/types/editor-props.d.ts +1 -1
- package/dist/types-ts4.5/ui/Appearance/FullPage/FullPageContentArea.d.ts +2 -0
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +5 -364
- package/dist/types-ts4.5/ui/Appearance/Mobile.d.ts +1 -1
- package/dist/types-ts4.5/ui/AppearanceComponents/Mobile.d.ts +2 -0
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +3 -3
- package/dist/types-ts4.5/ui/LinkSearch/ToolbarComponents.d.ts +0 -4
- package/dist/types-ts4.5/utils/document.d.ts +0 -12
- package/dist/types-ts4.5/utils/index.d.ts +1 -2
- package/package.json +9 -10
- package/report.api.md +9 -34
- package/tmp/api-report-tmp.d.ts +7 -33
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.js +0 -227
- package/dist/cjs/plugins/hyperlink/types.js +0 -5
- package/dist/cjs/ui/MediaAndEmbedsToolbar/index.js +0 -152
- package/dist/cjs/ui/Resizer/index.js +0 -210
- package/dist/cjs/ui/Resizer/styled.js +0 -15
- package/dist/cjs/ui/Resizer/types.js +0 -5
- package/dist/cjs/ui/Resizer/utils.js +0 -21
- package/dist/cjs/utils/filter/privacy-filter.js +0 -55
- package/dist/cjs/utils/linking-utils.js +0 -84
- package/dist/cjs/utils/rich-media-utils.js +0 -130
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.js +0 -221
- package/dist/es2019/plugins/hyperlink/types.js +0 -1
- package/dist/es2019/ui/MediaAndEmbedsToolbar/index.js +0 -159
- package/dist/es2019/ui/Resizer/index.js +0 -191
- package/dist/es2019/ui/Resizer/styled.js +0 -15
- package/dist/es2019/ui/Resizer/types.js +0 -1
- package/dist/es2019/ui/Resizer/utils.js +0 -12
- package/dist/es2019/utils/filter/privacy-filter.js +0 -47
- package/dist/es2019/utils/linking-utils.js +0 -74
- package/dist/es2019/utils/rich-media-utils.js +0 -108
- package/dist/esm/nodeviews/getInlineNodeViewProducer.js +0 -217
- package/dist/esm/plugins/hyperlink/types.js +0 -1
- package/dist/esm/ui/MediaAndEmbedsToolbar/index.js +0 -144
- package/dist/esm/ui/Resizer/index.js +0 -203
- package/dist/esm/ui/Resizer/styled.js +0 -7
- package/dist/esm/ui/Resizer/types.js +0 -1
- package/dist/esm/ui/Resizer/utils.js +0 -12
- package/dist/esm/utils/filter/privacy-filter.js +0 -48
- package/dist/esm/utils/linking-utils.js +0 -74
- package/dist/esm/utils/rich-media-utils.js +0 -117
- package/dist/types/nodeviews/getInlineNodeViewProducer.d.ts +0 -24
- package/dist/types/plugins/hyperlink/types.d.ts +0 -35
- package/dist/types/ui/MediaAndEmbedsToolbar/index.d.ts +0 -9
- package/dist/types/ui/Resizer/index.d.ts +0 -41
- package/dist/types/ui/Resizer/styled.d.ts +0 -2
- package/dist/types/ui/Resizer/types.d.ts +0 -26
- package/dist/types/ui/Resizer/utils.d.ts +0 -6
- package/dist/types/utils/filter/privacy-filter.d.ts +0 -9
- package/dist/types/utils/linking-utils.d.ts +0 -14
- package/dist/types/utils/rich-media-utils.d.ts +0 -8
- package/dist/types-ts4.5/nodeviews/getInlineNodeViewProducer.d.ts +0 -24
- package/dist/types-ts4.5/plugins/hyperlink/types.d.ts +0 -35
- package/dist/types-ts4.5/ui/MediaAndEmbedsToolbar/index.d.ts +0 -9
- package/dist/types-ts4.5/ui/Resizer/index.d.ts +0 -41
- package/dist/types-ts4.5/ui/Resizer/styled.d.ts +0 -2
- package/dist/types-ts4.5/ui/Resizer/types.d.ts +0 -26
- package/dist/types-ts4.5/ui/Resizer/utils.d.ts +0 -6
- package/dist/types-ts4.5/utils/filter/privacy-filter.d.ts +0 -9
- package/dist/types-ts4.5/utils/linking-utils.d.ts +0 -14
- package/dist/types-ts4.5/utils/rich-media-utils.d.ts +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "185.
|
|
3
|
+
"version": "185.2.2",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"@atlaskit/code": "^14.6.0",
|
|
50
50
|
"@atlaskit/date": "^0.10.0",
|
|
51
51
|
"@atlaskit/datetime-picker": "^12.7.0",
|
|
52
|
-
"@atlaskit/editor-common": "^74.
|
|
52
|
+
"@atlaskit/editor-common": "^74.6.0",
|
|
53
53
|
"@atlaskit/editor-json-transformer": "^8.9.0",
|
|
54
54
|
"@atlaskit/editor-markdown-transformer": "^5.2.0",
|
|
55
55
|
"@atlaskit/editor-palette": "1.4.3",
|
|
56
|
-
"@atlaskit/editor-plugin-analytics": "^0.0.
|
|
57
|
-
"@atlaskit/editor-plugin-content-insertion": "^0.0.
|
|
56
|
+
"@atlaskit/editor-plugin-analytics": "^0.0.2",
|
|
57
|
+
"@atlaskit/editor-plugin-content-insertion": "^0.0.2",
|
|
58
58
|
"@atlaskit/editor-plugin-decorations": "^0.1.0",
|
|
59
59
|
"@atlaskit/editor-plugin-feature-flags": "^0.1.0",
|
|
60
60
|
"@atlaskit/editor-plugin-grid": "^0.1.0",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@atlaskit/icon": "^21.12.0",
|
|
69
69
|
"@atlaskit/icon-object": "^6.3.0",
|
|
70
70
|
"@atlaskit/link-analytics": "^8.0.0",
|
|
71
|
-
"@atlaskit/link-picker": "^1.
|
|
71
|
+
"@atlaskit/link-picker": "^1.23.0",
|
|
72
72
|
"@atlaskit/locale": "^2.5.0",
|
|
73
73
|
"@atlaskit/logo": "^13.14.0",
|
|
74
74
|
"@atlaskit/media-card": "^76.0.0",
|
|
@@ -129,7 +129,6 @@
|
|
|
129
129
|
"prosemirror-utils": "^1.0.0-0",
|
|
130
130
|
"prosemirror-view": "1.23.7",
|
|
131
131
|
"raf-schd": "^4.0.3",
|
|
132
|
-
"re-resizable": "6.0.0",
|
|
133
132
|
"react-loadable": "^5.1.0",
|
|
134
133
|
"react-transition-group": "^4.4.1",
|
|
135
134
|
"react-virtualized": "^9.8.0",
|
|
@@ -149,7 +148,7 @@
|
|
|
149
148
|
"@atlaskit/atlassian-navigation": "^2.6.0",
|
|
150
149
|
"@atlaskit/breadcrumbs": "11.10.4",
|
|
151
150
|
"@atlaskit/code": "^14.6.0",
|
|
152
|
-
"@atlaskit/collab-provider": "9.2.
|
|
151
|
+
"@atlaskit/collab-provider": "9.2.1",
|
|
153
152
|
"@atlaskit/docs": "*",
|
|
154
153
|
"@atlaskit/drawer": "^7.5.0",
|
|
155
154
|
"@atlaskit/dropdown-menu": "^11.9.0",
|
|
@@ -157,7 +156,7 @@
|
|
|
157
156
|
"@atlaskit/editor-card-provider": "^3.0.0",
|
|
158
157
|
"@atlaskit/editor-extension-dropbox": "^0.4.0",
|
|
159
158
|
"@atlaskit/editor-plugin-table": "^1.5.0",
|
|
160
|
-
"@atlaskit/editor-test-helpers": "^18.
|
|
159
|
+
"@atlaskit/editor-test-helpers": "^18.6.0",
|
|
161
160
|
"@atlaskit/flag": "^15.2.0",
|
|
162
161
|
"@atlaskit/inline-dialog": "^13.6.0",
|
|
163
162
|
"@atlaskit/link-provider": "^1.6.0",
|
|
@@ -183,9 +182,9 @@
|
|
|
183
182
|
"@atlaskit/visual-regression": "*",
|
|
184
183
|
"@atlaskit/webdriver-runner": "*",
|
|
185
184
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
186
|
-
"@atlassian/link-picker-atlassian-plugin": "^33.
|
|
185
|
+
"@atlassian/link-picker-atlassian-plugin": "^33.3.0",
|
|
187
186
|
"@atlassian/link-picker-plugins": "^22.2.0",
|
|
188
|
-
"@atlassian/search-provider": "2.4.
|
|
187
|
+
"@atlassian/search-provider": "2.4.6",
|
|
189
188
|
"@atlassian/ufo": "^0.2.0",
|
|
190
189
|
"@emotion/jest": "^11.8.0",
|
|
191
190
|
"@storybook/addon-knobs": "^5.3.18",
|
package/report.api.md
CHANGED
|
@@ -85,6 +85,7 @@ import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
|
85
85
|
import { Side as GapCursorSide } from '@atlaskit/editor-common/selection';
|
|
86
86
|
import { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
87
87
|
import type { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
88
|
+
import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
|
|
88
89
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
89
90
|
import { InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
|
|
90
91
|
import { InputTracking } from '@atlaskit/editor-common/types';
|
|
@@ -92,7 +93,8 @@ import { IntlShape } from 'react-intl-next';
|
|
|
92
93
|
import { JSONDocNode } from '@atlaskit/editor-json-transformer/types';
|
|
93
94
|
import { jsx } from '@emotion/react';
|
|
94
95
|
import { lightModeStatusColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
95
|
-
import {
|
|
96
|
+
import type { LinkingOptions } from '@atlaskit/editor-common/types';
|
|
97
|
+
import type { LinkInputType } from '@atlaskit/editor-common/types';
|
|
96
98
|
import { MacroAttributes } from '@atlaskit/editor-common/provider-factory';
|
|
97
99
|
import { MacroProvider } from '@atlaskit/editor-common/provider-factory';
|
|
98
100
|
import { MarkConfig } from '@atlaskit/editor-common/types';
|
|
@@ -1226,18 +1228,6 @@ export enum HyperlinkInsertStatus {
|
|
|
1226
1228
|
INSERT_LINK_TOOLBAR = 'INSERT',
|
|
1227
1229
|
}
|
|
1228
1230
|
|
|
1229
|
-
// @public
|
|
1230
|
-
interface HyperlinkPluginOptions {
|
|
1231
|
-
// (undocumented)
|
|
1232
|
-
cardOptions?: CardOptions;
|
|
1233
|
-
// (undocumented)
|
|
1234
|
-
editorAppearance?: EditorAppearance;
|
|
1235
|
-
// (undocumented)
|
|
1236
|
-
linkPicker?: LinkPickerOptions;
|
|
1237
|
-
// (undocumented)
|
|
1238
|
-
platform?: 'mobile' | 'web';
|
|
1239
|
-
}
|
|
1240
|
-
|
|
1241
1231
|
// @public (undocumented)
|
|
1242
1232
|
export interface HyperlinkState {
|
|
1243
1233
|
// (undocumented)
|
|
@@ -1347,13 +1337,13 @@ export function insertLink(
|
|
|
1347
1337
|
incomingHref: string,
|
|
1348
1338
|
incomingTitle?: string,
|
|
1349
1339
|
displayText?: string,
|
|
1350
|
-
source?:
|
|
1340
|
+
source?: LinkInputType,
|
|
1351
1341
|
sourceEvent?: UIAnalyticsEvent | null | undefined,
|
|
1352
|
-
):
|
|
1342
|
+
): Command_2;
|
|
1353
1343
|
|
|
1354
1344
|
// @public (undocumented)
|
|
1355
1345
|
export const insertLinkWithAnalytics: (
|
|
1356
|
-
inputMethod:
|
|
1346
|
+
inputMethod: LinkInputType,
|
|
1357
1347
|
from: number,
|
|
1358
1348
|
to: number,
|
|
1359
1349
|
href: string,
|
|
@@ -1361,11 +1351,11 @@ export const insertLinkWithAnalytics: (
|
|
|
1361
1351
|
displayText?: string,
|
|
1362
1352
|
cardsAvailable?: boolean,
|
|
1363
1353
|
sourceEvent?: UIAnalyticsEvent | null | undefined,
|
|
1364
|
-
) =>
|
|
1354
|
+
) => Command_2;
|
|
1365
1355
|
|
|
1366
1356
|
// @public (undocumented)
|
|
1367
1357
|
export const insertLinkWithAnalyticsMobileNative: (
|
|
1368
|
-
inputMethod:
|
|
1358
|
+
inputMethod: LinkInputType,
|
|
1369
1359
|
from: number,
|
|
1370
1360
|
to: number,
|
|
1371
1361
|
href: string,
|
|
@@ -1413,9 +1403,6 @@ type InviteToEditComponentProps = {
|
|
|
1413
1403
|
children: ReactElement<InviteToEditButtonProps>;
|
|
1414
1404
|
};
|
|
1415
1405
|
|
|
1416
|
-
// @public
|
|
1417
|
-
export function isEmptyDocument(node: Node_2): boolean;
|
|
1418
|
-
|
|
1419
1406
|
// @public (undocumented)
|
|
1420
1407
|
export function isLinkAtPos(pos: number): Predicate;
|
|
1421
1408
|
|
|
@@ -1434,18 +1421,6 @@ interface LayoutPluginOptions extends LongPressSelectionPluginOptions {
|
|
|
1434
1421
|
|
|
1435
1422
|
export { lightModeStatusColorPalette };
|
|
1436
1423
|
|
|
1437
|
-
// @public
|
|
1438
|
-
interface LinkingOptions {
|
|
1439
|
-
linkPicker?: LinkPickerOptions;
|
|
1440
|
-
smartLinks?: CardOptions;
|
|
1441
|
-
}
|
|
1442
|
-
|
|
1443
|
-
// @public (undocumented)
|
|
1444
|
-
export type LinkInputMethod = INPUT_METHOD.MANUAL | INPUT_METHOD.TYPEAHEAD;
|
|
1445
|
-
|
|
1446
|
-
// @public
|
|
1447
|
-
interface LinkPickerOptions extends Partial<LinkPickerProps> {}
|
|
1448
|
-
|
|
1449
1424
|
// @public (undocumented)
|
|
1450
1425
|
type LinkToolbarState = EditInsertedState | EditState | InsertState | undefined;
|
|
1451
1426
|
|
|
@@ -2674,7 +2649,7 @@ export function updateLink(
|
|
|
2674
2649
|
text: string,
|
|
2675
2650
|
pos: number,
|
|
2676
2651
|
to?: number,
|
|
2677
|
-
):
|
|
2652
|
+
): Command_2;
|
|
2678
2653
|
|
|
2679
2654
|
// @public (undocumented)
|
|
2680
2655
|
export const updateStatus: (status?: StatusType) => Command;
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
|
74
74
|
import { Side as GapCursorSide } from '@atlaskit/editor-common/selection';
|
|
75
75
|
import { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
76
76
|
import type { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
77
|
+
import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
|
|
77
78
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
78
79
|
import { InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
|
|
79
80
|
import { InputTracking } from '@atlaskit/editor-common/types';
|
|
@@ -81,7 +82,8 @@ import { IntlShape } from 'react-intl-next';
|
|
|
81
82
|
import { JSONDocNode } from '@atlaskit/editor-json-transformer/types';
|
|
82
83
|
import { jsx } from '@emotion/react';
|
|
83
84
|
import { lightModeStatusColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
84
|
-
import {
|
|
85
|
+
import type { LinkingOptions } from '@atlaskit/editor-common/types';
|
|
86
|
+
import type { LinkInputType } from '@atlaskit/editor-common/types';
|
|
85
87
|
import { MacroAttributes } from '@atlaskit/editor-common/provider-factory';
|
|
86
88
|
import { MacroProvider } from '@atlaskit/editor-common/provider-factory';
|
|
87
89
|
import { MarkConfig } from '@atlaskit/editor-common/types';
|
|
@@ -1126,18 +1128,6 @@ export enum HyperlinkInsertStatus {
|
|
|
1126
1128
|
INSERT_LINK_TOOLBAR = "INSERT"
|
|
1127
1129
|
}
|
|
1128
1130
|
|
|
1129
|
-
// @public
|
|
1130
|
-
interface HyperlinkPluginOptions {
|
|
1131
|
-
// (undocumented)
|
|
1132
|
-
cardOptions?: CardOptions;
|
|
1133
|
-
// (undocumented)
|
|
1134
|
-
editorAppearance?: EditorAppearance;
|
|
1135
|
-
// (undocumented)
|
|
1136
|
-
linkPicker?: LinkPickerOptions;
|
|
1137
|
-
// (undocumented)
|
|
1138
|
-
platform?: 'mobile' | 'web';
|
|
1139
|
-
}
|
|
1140
|
-
|
|
1141
1131
|
// @public (undocumented)
|
|
1142
1132
|
export interface HyperlinkState {
|
|
1143
1133
|
// (undocumented)
|
|
@@ -1220,13 +1210,13 @@ type InsertItemProps = {
|
|
|
1220
1210
|
};
|
|
1221
1211
|
|
|
1222
1212
|
// @public (undocumented)
|
|
1223
|
-
export function insertLink(from: number, to: number, incomingHref: string, incomingTitle?: string, displayText?: string, source?:
|
|
1213
|
+
export function insertLink(from: number, to: number, incomingHref: string, incomingTitle?: string, displayText?: string, source?: LinkInputType, sourceEvent?: UIAnalyticsEvent | null | undefined): Command_2;
|
|
1224
1214
|
|
|
1225
1215
|
// @public (undocumented)
|
|
1226
|
-
export const insertLinkWithAnalytics: (inputMethod:
|
|
1216
|
+
export const insertLinkWithAnalytics: (inputMethod: LinkInputType, from: number, to: number, href: string, title?: string, displayText?: string, cardsAvailable?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined) => Command_2;
|
|
1227
1217
|
|
|
1228
1218
|
// @public (undocumented)
|
|
1229
|
-
export const insertLinkWithAnalyticsMobileNative: (inputMethod:
|
|
1219
|
+
export const insertLinkWithAnalyticsMobileNative: (inputMethod: LinkInputType, from: number, to: number, href: string, title?: string, displayText?: string) => Command;
|
|
1230
1220
|
|
|
1231
1221
|
// @public (undocumented)
|
|
1232
1222
|
export const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, newInsertionBehaviour?: boolean) => boolean;
|
|
@@ -1252,9 +1242,6 @@ type InviteToEditComponentProps = {
|
|
|
1252
1242
|
children: ReactElement<InviteToEditButtonProps>;
|
|
1253
1243
|
};
|
|
1254
1244
|
|
|
1255
|
-
// @public
|
|
1256
|
-
export function isEmptyDocument(node: Node_2): boolean;
|
|
1257
|
-
|
|
1258
1245
|
// @public (undocumented)
|
|
1259
1246
|
export function isLinkAtPos(pos: number): Predicate;
|
|
1260
1247
|
|
|
@@ -1273,19 +1260,6 @@ interface LayoutPluginOptions extends LongPressSelectionPluginOptions {
|
|
|
1273
1260
|
|
|
1274
1261
|
export { lightModeStatusColorPalette }
|
|
1275
1262
|
|
|
1276
|
-
// @public
|
|
1277
|
-
interface LinkingOptions {
|
|
1278
|
-
linkPicker?: LinkPickerOptions;
|
|
1279
|
-
smartLinks?: CardOptions;
|
|
1280
|
-
}
|
|
1281
|
-
|
|
1282
|
-
// @public (undocumented)
|
|
1283
|
-
export type LinkInputMethod = INPUT_METHOD.MANUAL | INPUT_METHOD.TYPEAHEAD;
|
|
1284
|
-
|
|
1285
|
-
// @public
|
|
1286
|
-
interface LinkPickerOptions extends Partial<LinkPickerProps> {
|
|
1287
|
-
}
|
|
1288
|
-
|
|
1289
1263
|
// @public (undocumented)
|
|
1290
1264
|
type LinkToolbarState = EditInsertedState | EditState | InsertState | undefined;
|
|
1291
1265
|
|
|
@@ -2362,7 +2336,7 @@ interface TypeAheadStatsSerializable extends TypeAheadStats {
|
|
|
2362
2336
|
export type UpdateEvent = 'create' | 'delete' | 'resolve' | 'unresolve';
|
|
2363
2337
|
|
|
2364
2338
|
// @public (undocumented)
|
|
2365
|
-
export function updateLink(href: string, text: string, pos: number, to?: number):
|
|
2339
|
+
export function updateLink(href: string, text: string, pos: number, to?: number): Command_2;
|
|
2366
2340
|
|
|
2367
2341
|
// @public (undocumented)
|
|
2368
2342
|
export const updateStatus: (status?: StatusType) => Command;
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.getInlineNodeViewProducer = getInlineNodeViewProducer;
|
|
8
|
-
exports.inlineNodeViewClassname = void 0;
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var _react = require("@emotion/react");
|
|
11
|
-
var _react2 = _interopRequireDefault(require("react"));
|
|
12
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
|
-
var _analytics = require("../plugins/analytics");
|
|
14
|
-
var _consts = require("../plugins/analytics/consts");
|
|
15
|
-
var _ErrorBoundary = require("../ui/ErrorBoundary");
|
|
16
|
-
var _getPerformanceOptions = require("./getPerformanceOptions");
|
|
17
|
-
/** @jsx jsx */
|
|
18
|
-
|
|
19
|
-
var inlineNodeViewClassname = 'inlineNodeView';
|
|
20
|
-
exports.inlineNodeViewClassname = inlineNodeViewClassname;
|
|
21
|
-
function createNodeView(_ref) {
|
|
22
|
-
var nodeViewParams = _ref.nodeViewParams,
|
|
23
|
-
pmPluginFactoryParams = _ref.pmPluginFactoryParams,
|
|
24
|
-
Component = _ref.Component,
|
|
25
|
-
extraComponentProps = _ref.extraComponentProps;
|
|
26
|
-
// We set a variable for the current node which is
|
|
27
|
-
// used for comparisions when doing updates, before being
|
|
28
|
-
// overwritten to the updated node.
|
|
29
|
-
var currentNode = nodeViewParams.node;
|
|
30
|
-
|
|
31
|
-
// First we setup the dom element which will be rendered and "tracked" by prosemirror
|
|
32
|
-
// and also used as a "editor portal" (not react portal) target by the editor
|
|
33
|
-
// portal provider api, for rendering the Component passed.
|
|
34
|
-
|
|
35
|
-
var domRef = document.createElement('span');
|
|
36
|
-
domRef.contentEditable = 'false';
|
|
37
|
-
setDomAttrs(nodeViewParams.node, domRef);
|
|
38
|
-
|
|
39
|
-
// @see ED-3790
|
|
40
|
-
// something gets messed up during mutation processing inside of a
|
|
41
|
-
// nodeView if DOM structure has nested plain "div"s, it doesn't see the
|
|
42
|
-
// difference between them and it kills the nodeView
|
|
43
|
-
domRef.classList.add("".concat(nodeViewParams.node.type.name, "View-content-wrap"), "".concat(inlineNodeViewClassname));
|
|
44
|
-
|
|
45
|
-
// This util is shared for tracking rendering, and the ErrorBoundary that
|
|
46
|
-
// is setup to wrap the Component when rendering
|
|
47
|
-
// NOTE: This is not a prosemirror dispatch
|
|
48
|
-
function dispatchAnalyticsEvent(payload) {
|
|
49
|
-
pmPluginFactoryParams.eventDispatcher.emit(_consts.analyticsEventKey, {
|
|
50
|
-
payload: payload
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// This is called to render the Component into domRef which is inside the
|
|
55
|
-
// prosemirror View.
|
|
56
|
-
// Internally it uses the unstable_renderSubtreeIntoContainer api to render,
|
|
57
|
-
// to the passed dom element (domRef) which means it is automatically
|
|
58
|
-
// "cleaned up" when you do a "re render".
|
|
59
|
-
function renderComponent() {
|
|
60
|
-
pmPluginFactoryParams.portalProviderAPI.render(getPortalChildren({
|
|
61
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
62
|
-
currentNode: currentNode,
|
|
63
|
-
nodeViewParams: nodeViewParams,
|
|
64
|
-
Component: Component,
|
|
65
|
-
extraComponentProps: extraComponentProps
|
|
66
|
-
}), domRef, false,
|
|
67
|
-
// node views should be rendered with intl context
|
|
68
|
-
true);
|
|
69
|
-
}
|
|
70
|
-
var _getPerformanceOption = (0, _getPerformanceOptions.getPerformanceOptions)(nodeViewParams.view),
|
|
71
|
-
samplingRate = _getPerformanceOption.samplingRate,
|
|
72
|
-
slowThreshold = _getPerformanceOption.slowThreshold,
|
|
73
|
-
trackingEnabled = _getPerformanceOption.trackingEnabled;
|
|
74
|
-
trackingEnabled && (0, _getPerformanceOptions.startMeasureReactNodeViewRendered)({
|
|
75
|
-
nodeTypeName: currentNode.type.name
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
// We render the component while creating the node view
|
|
79
|
-
renderComponent();
|
|
80
|
-
trackingEnabled && (0, _getPerformanceOptions.stopMeasureReactNodeViewRendered)({
|
|
81
|
-
nodeTypeName: currentNode.type.name,
|
|
82
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
83
|
-
editorState: nodeViewParams.view.state,
|
|
84
|
-
samplingRate: samplingRate,
|
|
85
|
-
slowThreshold: slowThreshold
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
// https://prosemirror.net/docs/ref/#view.NodeView
|
|
89
|
-
var nodeView = {
|
|
90
|
-
get dom() {
|
|
91
|
-
return domRef;
|
|
92
|
-
},
|
|
93
|
-
update: function update(nextNode, _decorations) {
|
|
94
|
-
// Let ProseMirror handle the update if node types are different.
|
|
95
|
-
// This prevents an issue where it was not possible to select the
|
|
96
|
-
// inline node view then replace it by entering text - the node
|
|
97
|
-
// view contents would be deleted but the node view itself would
|
|
98
|
-
// stay in the view and become uneditable.
|
|
99
|
-
if (currentNode.type !== nextNode.type) {
|
|
100
|
-
return false;
|
|
101
|
-
}
|
|
102
|
-
// On updates, we only set the new attributes if the type, attributes, and marks
|
|
103
|
-
// have changed on the node.
|
|
104
|
-
|
|
105
|
-
// NOTE: this could mean attrs changes aren't reflected in the dom,
|
|
106
|
-
// when an attribute key which was previously present is no longer
|
|
107
|
-
// present.
|
|
108
|
-
// ie.
|
|
109
|
-
// -> Original attributes { text: "hello world", color: "red" }
|
|
110
|
-
// -> Updated attributes { color: "blue" }
|
|
111
|
-
// in this case, the dom text attribute will not be cleared.
|
|
112
|
-
//
|
|
113
|
-
// This may not be an issue with any of our current node schemas.
|
|
114
|
-
if (!currentNode.sameMarkup(nextNode)) {
|
|
115
|
-
setDomAttrs(nextNode, domRef);
|
|
116
|
-
}
|
|
117
|
-
currentNode = nextNode;
|
|
118
|
-
renderComponent();
|
|
119
|
-
return true;
|
|
120
|
-
},
|
|
121
|
-
destroy: function destroy() {
|
|
122
|
-
// When prosemirror destroys the node view, we need to clean up
|
|
123
|
-
// what we have previously rendered using the editor portal
|
|
124
|
-
// provider api.
|
|
125
|
-
pmPluginFactoryParams.portalProviderAPI.remove(domRef);
|
|
126
|
-
// @ts-expect-error Expect an error as domRef is expected to be
|
|
127
|
-
// of HTMLSpanElement type however once the node view has
|
|
128
|
-
// been destroyed no other consumers should still be using it.
|
|
129
|
-
domRef = undefined;
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
return nodeView;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Copies the attributes from a ProseMirror Node to a DOM node.
|
|
137
|
-
* @param node The Prosemirror Node from which to source the attributes
|
|
138
|
-
*/
|
|
139
|
-
function setDomAttrs(node, element) {
|
|
140
|
-
Object.keys(node.attrs || {}).forEach(function (attr) {
|
|
141
|
-
element.setAttribute(attr, node.attrs[attr]);
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
function getPortalChildren(_ref2) {
|
|
145
|
-
var dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
|
|
146
|
-
currentNode = _ref2.currentNode,
|
|
147
|
-
nodeViewParams = _ref2.nodeViewParams,
|
|
148
|
-
Component = _ref2.Component,
|
|
149
|
-
extraComponentProps = _ref2.extraComponentProps;
|
|
150
|
-
return function portalChildren() {
|
|
151
|
-
var _currentNode$type$nam, _currentNode$type;
|
|
152
|
-
// All inline nodes use `display: inline` to allow for multi-line
|
|
153
|
-
// wrapping. This does produce an issue in Chrome where it is not
|
|
154
|
-
// possible to click select the position after the node,
|
|
155
|
-
// see: https://product-fabric.atlassian.net/browse/ED-12003
|
|
156
|
-
// however this is only a problem for node views that use
|
|
157
|
-
// `display: inline-block` somewhere within the Component.
|
|
158
|
-
// Looking at the below structure, spans with className
|
|
159
|
-
// `inlineNodeViewAddZeroWidthSpace` have pseudo elements that
|
|
160
|
-
// add a zero width space which fixes the problem.
|
|
161
|
-
// Without the additional zero width space before the Component,
|
|
162
|
-
// it is not possible to use the keyboard to range select in Safari.
|
|
163
|
-
//
|
|
164
|
-
// Zero width spaces on either side of the Component also prevent
|
|
165
|
-
// the cursor from appearing inside the node view on all browsers.
|
|
166
|
-
//
|
|
167
|
-
// Note:
|
|
168
|
-
// In future it is worth considering prohibiting the use of `display: inline-block`
|
|
169
|
-
// within inline node view Components however would require a sizable
|
|
170
|
-
// refactor. A test suite to catch any instances of this is ideal however
|
|
171
|
-
// the refactor required is currently out of scope for https://product-fabric.atlassian.net/browse/ED-14176
|
|
172
|
-
|
|
173
|
-
return (0, _react.jsx)(_ErrorBoundary.ErrorBoundary, {
|
|
174
|
-
component: _analytics.ACTION_SUBJECT.REACT_NODE_VIEW,
|
|
175
|
-
componentId: (_currentNode$type$nam = currentNode === null || currentNode === void 0 ? void 0 : (_currentNode$type = currentNode.type) === null || _currentNode$type === void 0 ? void 0 : _currentNode$type.name) !== null && _currentNode$type$nam !== void 0 ? _currentNode$type$nam : _analytics.ACTION_SUBJECT_ID.UNKNOWN_NODE,
|
|
176
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
177
|
-
}, (0, _react.jsx)("span", {
|
|
178
|
-
"aria-hidden": "true",
|
|
179
|
-
className: "zeroWidthSpaceContainer"
|
|
180
|
-
}, (0, _react.jsx)("span", {
|
|
181
|
-
className: "".concat(inlineNodeViewClassname, "AddZeroWidthSpace")
|
|
182
|
-
}), _utils.ZERO_WIDTH_SPACE), (0, _react.jsx)(Component, (0, _extends2.default)({
|
|
183
|
-
view: nodeViewParams.view,
|
|
184
|
-
getPos: nodeViewParams.getPos,
|
|
185
|
-
node: currentNode
|
|
186
|
-
}, extraComponentProps)), (0, _react.jsx)("span", {
|
|
187
|
-
"aria-hidden": "true",
|
|
188
|
-
className: "".concat(inlineNodeViewClassname, "AddZeroWidthSpace")
|
|
189
|
-
}));
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
// https://prosemirror.net/docs/ref/#view.EditorProps.nodeViews
|
|
194
|
-
// The prosemirror EditorProps has a nodeViews key which has the rough shape:
|
|
195
|
-
// type nodeViews: {
|
|
196
|
-
// [nodeViewName: string]: (node, editorView, getPos, decorations, innerDecorations) => NodeView
|
|
197
|
-
// }
|
|
198
|
-
// So the value of the keys on the nodeViews object, are a function which should return a NodeView.
|
|
199
|
-
// The following type NodeViewProducer, refers to these functions which return a NodeView.
|
|
200
|
-
//
|
|
201
|
-
// So the above type could also be described as
|
|
202
|
-
// type NodeViewProducer = (node, editorView, getPos, decorations, innerDecorations) => NodeView
|
|
203
|
-
// nodeViews: {
|
|
204
|
-
// [nodeViewName: string]: NodeViewProducer
|
|
205
|
-
// }
|
|
206
|
-
// This return of this function is intended to be the value of a key
|
|
207
|
-
// in a ProseMirror nodeViews object.
|
|
208
|
-
function getInlineNodeViewProducer(_ref3) {
|
|
209
|
-
var pmPluginFactoryParams = _ref3.pmPluginFactoryParams,
|
|
210
|
-
Component = _ref3.Component,
|
|
211
|
-
extraComponentProps = _ref3.extraComponentProps;
|
|
212
|
-
function nodeViewProducer() {
|
|
213
|
-
var nodeView = createNodeView({
|
|
214
|
-
nodeViewParams: {
|
|
215
|
-
node: arguments.length <= 0 ? undefined : arguments[0],
|
|
216
|
-
view: arguments.length <= 1 ? undefined : arguments[1],
|
|
217
|
-
getPos: arguments.length <= 2 ? undefined : arguments[2],
|
|
218
|
-
decorations: arguments.length <= 3 ? undefined : arguments[3]
|
|
219
|
-
},
|
|
220
|
-
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
221
|
-
Component: Component,
|
|
222
|
-
extraComponentProps: extraComponentProps
|
|
223
|
-
});
|
|
224
|
-
return nodeView;
|
|
225
|
-
}
|
|
226
|
-
return nodeViewProducer;
|
|
227
|
-
}
|
|
@@ -1,152 +0,0 @@
|
|
|
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 _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
-
var _prosemirrorState = require("prosemirror-state");
|
|
10
|
-
var _prosemirrorUtils = require("prosemirror-utils");
|
|
11
|
-
var _messages = _interopRequireDefault(require("../../messages"));
|
|
12
|
-
var _mediaWrapLeft = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/media-wrap-left"));
|
|
13
|
-
var _mediaWrapRight = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/media-wrap-right"));
|
|
14
|
-
var _mediaWide = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/media-wide"));
|
|
15
|
-
var _mediaFullWidth = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/media-full-width"));
|
|
16
|
-
var _alignImageLeft = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/align-image-left"));
|
|
17
|
-
var _alignImageRight = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/align-image-right"));
|
|
18
|
-
var _alignImageCenter = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/align-image-center"));
|
|
19
|
-
var _richMediaUtils = require("../../utils/rich-media-utils");
|
|
20
|
-
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
21
|
-
var _utils = require("../../plugins/analytics/utils");
|
|
22
|
-
var _analytics = require("../../plugins/analytics");
|
|
23
|
-
var _toolbarMessages = require("./toolbar-messages");
|
|
24
|
-
var _utils2 = require("../../utils");
|
|
25
|
-
var alignmentIcons = [{
|
|
26
|
-
id: 'editor.media.alignLeft',
|
|
27
|
-
value: 'align-start',
|
|
28
|
-
icon: _alignImageLeft.default
|
|
29
|
-
}, {
|
|
30
|
-
id: 'editor.media.alignCenter',
|
|
31
|
-
value: 'center',
|
|
32
|
-
icon: _alignImageCenter.default
|
|
33
|
-
}, {
|
|
34
|
-
id: 'editor.media.alignRight',
|
|
35
|
-
value: 'align-end',
|
|
36
|
-
icon: _alignImageRight.default
|
|
37
|
-
}];
|
|
38
|
-
var wrappingIcons = [{
|
|
39
|
-
id: 'editor.media.wrapLeft',
|
|
40
|
-
value: 'wrap-left',
|
|
41
|
-
icon: _mediaWrapLeft.default
|
|
42
|
-
}, {
|
|
43
|
-
id: 'editor.media.wrapRight',
|
|
44
|
-
value: 'wrap-right',
|
|
45
|
-
icon: _mediaWrapRight.default
|
|
46
|
-
}];
|
|
47
|
-
var breakoutIcons = [{
|
|
48
|
-
value: 'wide',
|
|
49
|
-
icon: _mediaWide.default
|
|
50
|
-
}, {
|
|
51
|
-
value: 'full-width',
|
|
52
|
-
icon: _mediaFullWidth.default
|
|
53
|
-
}];
|
|
54
|
-
var layoutToMessages = {
|
|
55
|
-
'wrap-left': _toolbarMessages.toolbarMessages.wrapLeft,
|
|
56
|
-
center: _messages.default.alignImageCenter,
|
|
57
|
-
'wrap-right': _toolbarMessages.toolbarMessages.wrapRight,
|
|
58
|
-
wide: _messages.default.layoutWide,
|
|
59
|
-
'full-width': _messages.default.layoutFullWidth,
|
|
60
|
-
'align-end': _messages.default.alignImageRight,
|
|
61
|
-
'align-start': _messages.default.alignImageLeft
|
|
62
|
-
};
|
|
63
|
-
var getNodeWidth = function getNodeWidth(node, schema) {
|
|
64
|
-
var embedCard = schema.nodes.embedCard;
|
|
65
|
-
if (node.type === embedCard) {
|
|
66
|
-
return node.attrs.originalWidth || _editorSharedStyles.DEFAULT_EMBED_CARD_WIDTH;
|
|
67
|
-
}
|
|
68
|
-
return node.firstChild && node.firstChild.attrs.width || node.attrs.width;
|
|
69
|
-
};
|
|
70
|
-
var makeAlign = function makeAlign(layout, nodeType, widthPluginDependencyApi) {
|
|
71
|
-
return function (state, dispatch) {
|
|
72
|
-
var _ref = state.selection,
|
|
73
|
-
node = _ref.node;
|
|
74
|
-
var previousLayoutType = node.attrs.layout;
|
|
75
|
-
var mediaSingle = state.schema.nodes.mediaSingle;
|
|
76
|
-
if (!dispatch) {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
var widthPluginState = widthPluginDependencyApi === null || widthPluginDependencyApi === void 0 ? void 0 : widthPluginDependencyApi.sharedState.currentState();
|
|
80
|
-
if (!node || node.type !== nodeType || !widthPluginState) {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
var nodeWidth = getNodeWidth(node, state.schema);
|
|
84
|
-
var newAttrs = (0, _richMediaUtils.alignAttributes)(layout, node.attrs, undefined, nodeWidth, widthPluginState.lineLength);
|
|
85
|
-
var tr = state.tr.setNodeMarkup(state.selection.from, undefined, newAttrs);
|
|
86
|
-
tr.setMeta('scrollIntoView', false);
|
|
87
|
-
// when image captions are enabled, the wrong node gets selected after
|
|
88
|
-
// setNodeMarkup is called
|
|
89
|
-
tr.setSelection(_prosemirrorState.NodeSelection.create(tr.doc, state.selection.from));
|
|
90
|
-
var paragraph = tr.doc.type.schema.nodes.paragraph;
|
|
91
|
-
|
|
92
|
-
// see https://product-fabric.atlassian.net/browse/ED-15518 insert a new paragraph when an embedded card is wrapped left or right
|
|
93
|
-
if (layout.startsWith('wrap') && paragraph && !tr.doc.nodeAt(state.selection.to) && ((0, _utils2.insideTable)(state) || (0, _utils2.isInLayoutColumn)(state))) {
|
|
94
|
-
tr.insert(state.selection.to, paragraph.createAndFill());
|
|
95
|
-
}
|
|
96
|
-
dispatch((0, _utils.addAnalytics)(state, tr, {
|
|
97
|
-
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
98
|
-
action: _analytics.ACTION.SELECTED,
|
|
99
|
-
actionSubject: _analytics.ACTION_SUBJECT[node.type === mediaSingle ? 'MEDIA_SINGLE' : 'EMBEDS'],
|
|
100
|
-
actionSubjectId: _analytics.ACTION_SUBJECT_ID.RICH_MEDIA_LAYOUT,
|
|
101
|
-
attributes: {
|
|
102
|
-
previousLayoutType: previousLayoutType,
|
|
103
|
-
currentLayoutType: layout
|
|
104
|
-
}
|
|
105
|
-
}));
|
|
106
|
-
return true;
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
var mapIconsToToolbarItem = function mapIconsToToolbarItem(icons, layout, intl, nodeType, widthPluginDependencyApi) {
|
|
110
|
-
return icons.map(function (toolbarItem) {
|
|
111
|
-
var id = toolbarItem.id,
|
|
112
|
-
value = toolbarItem.value;
|
|
113
|
-
return {
|
|
114
|
-
id: id,
|
|
115
|
-
type: 'button',
|
|
116
|
-
icon: toolbarItem.icon,
|
|
117
|
-
title: intl.formatMessage(layoutToMessages[value]),
|
|
118
|
-
selected: layout === value,
|
|
119
|
-
onClick: makeAlign(value, nodeType, widthPluginDependencyApi)
|
|
120
|
-
};
|
|
121
|
-
});
|
|
122
|
-
};
|
|
123
|
-
var shouldHideLayoutToolbar = function shouldHideLayoutToolbar(selection, _ref2, allowResizingInTables) {
|
|
124
|
-
var nodes = _ref2.nodes;
|
|
125
|
-
return (0, _prosemirrorUtils.hasParentNodeOfType)([nodes.bodiedExtension, nodes.listItem, nodes.expand, nodes.nestedExpand].concat((0, _toConsumableArray2.default)(allowResizingInTables ? [] : [nodes.table])).filter(Boolean))(selection);
|
|
126
|
-
};
|
|
127
|
-
var buildLayoutButtons = function buildLayoutButtons(state, intl, nodeType, widthPluginDependencyApi, allowResizing, allowResizingInTables) {
|
|
128
|
-
var allowWrapping = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : true;
|
|
129
|
-
var allowAlignment = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : true;
|
|
130
|
-
var selection = state.selection;
|
|
131
|
-
if (!(selection instanceof _prosemirrorState.NodeSelection) || !selection.node || !nodeType || shouldHideLayoutToolbar(selection, state.schema, allowResizingInTables)) {
|
|
132
|
-
return [];
|
|
133
|
-
}
|
|
134
|
-
var layout = selection.node.attrs.layout;
|
|
135
|
-
var alignmentToolbarItems = allowAlignment ? mapIconsToToolbarItem(alignmentIcons, layout, intl, nodeType, widthPluginDependencyApi) : [];
|
|
136
|
-
var wrappingToolbarItems = allowWrapping ? mapIconsToToolbarItem(wrappingIcons, layout, intl, nodeType, widthPluginDependencyApi) : [];
|
|
137
|
-
var breakOutToolbarItems = !allowResizing ? mapIconsToToolbarItem(breakoutIcons, layout, intl, nodeType, widthPluginDependencyApi) : [];
|
|
138
|
-
var items = [].concat((0, _toConsumableArray2.default)(alignmentToolbarItems), (0, _toConsumableArray2.default)(getSeparatorBetweenAlignmentAndWrapping(allowAlignment, allowWrapping)), (0, _toConsumableArray2.default)(wrappingToolbarItems), (0, _toConsumableArray2.default)(getSeparatorBeforeBreakoutItems(allowAlignment, allowWrapping, allowResizing)), (0, _toConsumableArray2.default)(breakOutToolbarItems));
|
|
139
|
-
return items;
|
|
140
|
-
};
|
|
141
|
-
var getSeparatorBetweenAlignmentAndWrapping = function getSeparatorBetweenAlignmentAndWrapping(allowAlignment, allowWrapping) {
|
|
142
|
-
return allowAlignment && allowWrapping ? [{
|
|
143
|
-
type: 'separator'
|
|
144
|
-
}] : [];
|
|
145
|
-
};
|
|
146
|
-
var getSeparatorBeforeBreakoutItems = function getSeparatorBeforeBreakoutItems(allowAlignment, allowWrapping, allowResizing) {
|
|
147
|
-
return !allowResizing && (allowAlignment || allowWrapping) ? [{
|
|
148
|
-
type: 'separator'
|
|
149
|
-
}] : [];
|
|
150
|
-
};
|
|
151
|
-
var _default = buildLayoutButtons;
|
|
152
|
-
exports.default = _default;
|