@atlaskit/editor-core 185.2.0 → 185.2.5
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 +14 -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 +6 -6
- package/dist/cjs/plugins/card/nodeviews/genericCard.js +2 -1
- 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 +13 -16
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +19 -18
- 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 +8 -2
- 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/mediaNodeUpdater.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 +10 -9
- package/dist/cjs/plugins/media/toolbar/linking-toolbar-appearance.js +4 -3
- package/dist/cjs/plugins/media/toolbar/linking.js +6 -6
- 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/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 +3 -3
- package/dist/es2019/plugins/card/nodeviews/genericCard.js +2 -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 +8 -10
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +10 -8
- 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 +5 -2
- 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/mediaNodeUpdater.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 +10 -9
- package/dist/es2019/plugins/media/toolbar/linking-toolbar-appearance.js +2 -1
- package/dist/es2019/plugins/media/toolbar/linking.js +4 -4
- 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/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 +3 -3
- package/dist/esm/plugins/card/nodeviews/genericCard.js +2 -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 +8 -10
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +18 -16
- 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 +5 -2
- 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/mediaNodeUpdater.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 +10 -9
- package/dist/esm/plugins/media/toolbar/linking-toolbar-appearance.js +2 -1
- package/dist/esm/plugins/media/toolbar/linking.js +4 -4
- 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/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 +9 -3
- package/dist/types/labs/next/presets/default.d.ts +13 -1
- package/dist/types/labs/next/presets/mobile.d.ts +9 -3
- package/dist/types/messages.d.ts +2 -53
- package/dist/types/plugins/card/index.d.ts +3 -1
- 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 +7 -4
- 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/index.d.ts +2 -6
- 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/index.d.ts +3 -1
- package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +1 -1
- package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +1 -1
- package/dist/types/plugins/media/nodeviews/types.d.ts +1 -1
- package/dist/types/plugins/media/toolbar/linking.d.ts +3 -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/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 +9 -3
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +13 -1
- package/dist/types-ts4.5/labs/next/presets/mobile.d.ts +9 -3
- package/dist/types-ts4.5/messages.d.ts +2 -53
- package/dist/types-ts4.5/plugins/card/index.d.ts +3 -1
- 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 +7 -4
- 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/index.d.ts +2 -9
- 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/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaInline.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaNodeUpdater.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/nodeviews/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/toolbar/linking.d.ts +3 -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/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 +11 -14
- package/report.api.md +11 -34
- package/tmp/api-report-tmp.d.ts +10 -34
- 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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 185.2.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b48d0a5f88f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b48d0a5f88f) - Create new placeholder for the floating toolbar plugin and use a new action to replace the forceFocusSelector action.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 185.2.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`f07a1e036a9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f07a1e036a9) - Refactoring editor-core to prepare for extracting card plugin.
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 185.2.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -304,7 +304,7 @@ var EditorActions = /*#__PURE__*/function () {
|
|
|
304
304
|
if (!this.editorView) {
|
|
305
305
|
return true;
|
|
306
306
|
}
|
|
307
|
-
return (0,
|
|
307
|
+
return (0, _utils.isEmptyDocument)(this.editorView.state.doc);
|
|
308
308
|
}
|
|
309
309
|
}, {
|
|
310
310
|
key: "replaceDocument",
|
|
@@ -342,7 +342,7 @@ var EditorActions = /*#__PURE__*/function () {
|
|
|
342
342
|
return true;
|
|
343
343
|
}
|
|
344
344
|
var schema = state.schema;
|
|
345
|
-
var content = Array.isArray(rawValue) ? (0, _document.processRawFragmentValue)(schema, rawValue) : (0,
|
|
345
|
+
var content = Array.isArray(rawValue) ? (0, _document.processRawFragmentValue)(schema, rawValue) : (0, _utils.processRawValue)(schema, rawValue);
|
|
346
346
|
if (!content) {
|
|
347
347
|
return false;
|
|
348
348
|
}
|
|
@@ -21,7 +21,6 @@ var _messages = require("./messages");
|
|
|
21
21
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
22
22
|
var _ufo = require("@atlaskit/editor-common/ufo");
|
|
23
23
|
var _eventDispatcher = require("../event-dispatcher");
|
|
24
|
-
var _utils2 = require("../utils");
|
|
25
24
|
var _saferTransactions = require("../utils/performance/safer-transactions");
|
|
26
25
|
var _RenderTracking = require("../utils/performance/components/RenderTracking");
|
|
27
26
|
var _nodes = require("../utils/nodes");
|
|
@@ -186,7 +185,7 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
186
185
|
_this.contentTransformer = contentTransformerProvider ? contentTransformerProvider(schema) : undefined;
|
|
187
186
|
var doc;
|
|
188
187
|
if (options.doc) {
|
|
189
|
-
doc = (0,
|
|
188
|
+
doc = (0, _utils.processRawValue)(schema, options.doc, options.props.providerFactory, options.props.editorProps.sanitizePrivateContent, _this.contentTransformer, _this.dispatchAnalyticsEvent);
|
|
190
189
|
}
|
|
191
190
|
var selection;
|
|
192
191
|
if (doc) {
|
package/dist/cjs/index.js
CHANGED
|
@@ -371,12 +371,6 @@ Object.defineProperty(exports, "insertTaskDecisionCommand", {
|
|
|
371
371
|
return _commands5.insertTaskDecisionCommand;
|
|
372
372
|
}
|
|
373
373
|
});
|
|
374
|
-
Object.defineProperty(exports, "isEmptyDocument", {
|
|
375
|
-
enumerable: true,
|
|
376
|
-
get: function get() {
|
|
377
|
-
return _utils.isEmptyDocument;
|
|
378
|
-
}
|
|
379
|
-
});
|
|
380
374
|
Object.defineProperty(exports, "isLinkAtPos", {
|
|
381
375
|
enumerable: true,
|
|
382
376
|
get: function get() {
|
|
@@ -8,7 +8,7 @@ var _prosemirrorView = require("prosemirror-view");
|
|
|
8
8
|
var _prosemirrorState = require("prosemirror-state");
|
|
9
9
|
var _eventDispatcher = require("../../../../../event-dispatcher");
|
|
10
10
|
var _createEditor = require("../../../../../create-editor/create-editor");
|
|
11
|
-
var _utils = require("
|
|
11
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
12
12
|
var _createSchema = require("../../../../../create-editor/create-schema");
|
|
13
13
|
function createEditor(_ref) {
|
|
14
14
|
var context = _ref.context,
|
package/dist/cjs/messages.js
CHANGED
|
@@ -17,73 +17,23 @@ Object.defineProperty(exports, "linkMessages", {
|
|
|
17
17
|
return _messages.linkMessages;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
exports
|
|
20
|
+
Object.defineProperty(exports, "linkToolbarMessages", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function get() {
|
|
23
|
+
return _messages.linkToolbarMessages;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
21
26
|
Object.defineProperty(exports, "statusMessages", {
|
|
22
27
|
enumerable: true,
|
|
23
28
|
get: function get() {
|
|
24
29
|
return _messages2.messages;
|
|
25
30
|
}
|
|
26
31
|
});
|
|
27
|
-
var _reactIntlNext = require("react-intl-next");
|
|
28
32
|
var _messages = _interopRequireWildcard(require("@atlaskit/editor-common/messages"));
|
|
29
33
|
var _messages2 = require("./plugins/status/nodeviews/messages");
|
|
30
34
|
var _messages3 = require("./plugins/date/nodeviews/messages");
|
|
31
35
|
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); }
|
|
32
36
|
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; }
|
|
33
37
|
// Common Translations will live here
|
|
34
|
-
|
|
35
|
-
var linkToolbarMessages = (0, _reactIntlNext.defineMessages)({
|
|
36
|
-
addLink: {
|
|
37
|
-
id: 'fabric.editor.mediaAddLink',
|
|
38
|
-
defaultMessage: 'Add link',
|
|
39
|
-
description: 'Add link'
|
|
40
|
-
},
|
|
41
|
-
unableToOpenLink: {
|
|
42
|
-
id: 'fabric.editor.unableToOpenLink',
|
|
43
|
-
defaultMessage: 'Unable to open this link',
|
|
44
|
-
description: 'Unable to open this link'
|
|
45
|
-
},
|
|
46
|
-
unlink: {
|
|
47
|
-
id: 'fabric.editor.unlink',
|
|
48
|
-
defaultMessage: 'Unlink',
|
|
49
|
-
description: 'Removes the hyperlink but keeps your text.'
|
|
50
|
-
},
|
|
51
|
-
editLink: {
|
|
52
|
-
id: 'fabric.editor.editLink',
|
|
53
|
-
defaultMessage: 'Edit link',
|
|
54
|
-
description: 'Edit the link, update display text'
|
|
55
|
-
},
|
|
56
|
-
placeholder: {
|
|
57
|
-
id: 'fabric.editor.hyperlinkToolbarPlaceholder',
|
|
58
|
-
defaultMessage: 'Paste or search for link',
|
|
59
|
-
description: 'Paste or search for link'
|
|
60
|
-
},
|
|
61
|
-
linkPlaceholder: {
|
|
62
|
-
id: 'fabric.editor.linkPlaceholder',
|
|
63
|
-
defaultMessage: 'Paste link',
|
|
64
|
-
description: 'Create a new link by pasting a URL.'
|
|
65
|
-
},
|
|
66
|
-
linkAddress: {
|
|
67
|
-
id: 'fabric.editor.linkAddress',
|
|
68
|
-
defaultMessage: 'Link address',
|
|
69
|
-
description: 'Insert the address of the link'
|
|
70
|
-
},
|
|
71
|
-
invalidLink: {
|
|
72
|
-
id: 'fabric.editor.invalidLink',
|
|
73
|
-
defaultMessage: 'Please enter a valid link.',
|
|
74
|
-
description: 'Please enter a valid link.'
|
|
75
|
-
},
|
|
76
|
-
emptyLink: {
|
|
77
|
-
id: 'fabric.editor.emptyLink',
|
|
78
|
-
defaultMessage: 'Please enter a link.',
|
|
79
|
-
description: 'Please enter a link.'
|
|
80
|
-
},
|
|
81
|
-
settingsLink: {
|
|
82
|
-
id: 'fabric.editor.settingsLinks',
|
|
83
|
-
defaultMessage: 'Go to Link Preferences',
|
|
84
|
-
description: 'Go to Link Preferences'
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
exports.linkToolbarMessages = linkToolbarMessages;
|
|
88
38
|
var _default = _messages.default;
|
|
89
39
|
exports.default = _default;
|
|
@@ -8,10 +8,10 @@ exports.InlineNodeViewSharedStyles = void 0;
|
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
11
|
-
var
|
|
11
|
+
var _reactNodeView = require("@atlaskit/editor-common/react-node-view");
|
|
12
12
|
var _templateObject;
|
|
13
13
|
// For reasoning behind styles, see comments in:
|
|
14
14
|
// ./getInlineNodeViewProducer -> portalChildren()
|
|
15
15
|
|
|
16
|
-
var InlineNodeViewSharedStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n display: inline;\n user-select: all;\n /* Collapses zero width spaces inside the inline node view\n to prevent the node from line breaking too early.\n */\n white-space: nowrap;\n /* Then reset to the Editor default so we don't interfere\n with any component styling. */\n & > *:not(span[aria-hidden='true'].zeroWidthSpaceContainer) {\n white-space: pre-wrap;\n }\n }\n /** Remove browser deafult selections style. This prevents\n unexpected visual artefacts in Safari when navigating\n with the keyboard or making range selections. */\n &.ua-safari {\n .", " {\n ::selection,\n *::selection {\n background: transparent;\n }\n }\n }\n\n &.ua-chrome .", " > span {\n user-select: none;\n }\n\n .", "AddZeroWidthSpace {\n ::after {\n content: '", "';\n }\n }\n"])),
|
|
16
|
+
var InlineNodeViewSharedStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n display: inline;\n user-select: all;\n /* Collapses zero width spaces inside the inline node view\n to prevent the node from line breaking too early.\n */\n white-space: nowrap;\n /* Then reset to the Editor default so we don't interfere\n with any component styling. */\n & > *:not(span[aria-hidden='true'].zeroWidthSpaceContainer) {\n white-space: pre-wrap;\n }\n }\n /** Remove browser deafult selections style. This prevents\n unexpected visual artefacts in Safari when navigating\n with the keyboard or making range selections. */\n &.ua-safari {\n .", " {\n ::selection,\n *::selection {\n background: transparent;\n }\n }\n }\n\n &.ua-chrome .", " > span {\n user-select: none;\n }\n\n .", "AddZeroWidthSpace {\n ::after {\n content: '", "';\n }\n }\n"])), _reactNodeView.inlineNodeViewClassname, _reactNodeView.inlineNodeViewClassname, _reactNodeView.inlineNodeViewClassname, _reactNodeView.inlineNodeViewClassname, _utils.ZERO_WIDTH_SPACE);
|
|
17
17
|
exports.InlineNodeViewSharedStyles = InlineNodeViewSharedStyles;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.GUTTER_SIZE_MOBILE_IN_PX = exports.GUTTER_SIZE_IN_PX = exports.GUTTER_SELECTOR = void 0;
|
|
7
7
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
|
-
var _utils = require("
|
|
8
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
9
9
|
var _utils2 = require("../../mobile-dimensions/utils");
|
|
10
10
|
var GUTTER_SIZE_IN_PX = 120; // Default gutter size
|
|
11
11
|
exports.GUTTER_SIZE_IN_PX = GUTTER_SIZE_IN_PX;
|
|
@@ -19,7 +19,7 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
19
19
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
20
20
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
21
21
|
var _genericCard = require("./genericCard");
|
|
22
|
-
var
|
|
22
|
+
var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/react-node-view"));
|
|
23
23
|
var _actions = require("../pm-plugins/actions");
|
|
24
24
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
25
25
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -155,5 +155,5 @@ var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
155
155
|
}
|
|
156
156
|
}]);
|
|
157
157
|
return BlockCard;
|
|
158
|
-
}(
|
|
158
|
+
}(_reactNodeView.default);
|
|
159
159
|
exports.BlockCard = BlockCard;
|
|
@@ -24,7 +24,7 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
24
24
|
var _nodeviews = require("../../../nodeviews/");
|
|
25
25
|
var _actions = require("../pm-plugins/actions");
|
|
26
26
|
var _ResizableEmbedCard = _interopRequireDefault(require("../ui/ResizableEmbedCard"));
|
|
27
|
-
var
|
|
27
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
28
28
|
var _steps = require("@atlaskit/adf-schema/steps");
|
|
29
29
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
30
30
|
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; }
|
|
@@ -55,7 +55,7 @@ var CardInner = function CardInner(_ref) {
|
|
|
55
55
|
return null;
|
|
56
56
|
}
|
|
57
57
|
var lineLength = getLineLength(view, pos, widthStateLineLength);
|
|
58
|
-
var containerWidth = (0,
|
|
58
|
+
var containerWidth = (0, _utils.isRichMediaInsideOfBlockNode)(view, pos) ? lineLength : widthStateWidth;
|
|
59
59
|
if (!allowResizing || !hasPreview) {
|
|
60
60
|
// There are two ways `width` and `height` can be defined here:
|
|
61
61
|
// 1) Either as `heightAlone` as height value and no width
|
|
@@ -78,8 +78,8 @@ var CardInner = function CardInner(_ref) {
|
|
|
78
78
|
}), smartCard);
|
|
79
79
|
}
|
|
80
80
|
var displayGrid = function displayGrid(visible, gridType, highlight) {
|
|
81
|
-
var _pluginInjectionApi$d
|
|
82
|
-
return pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d === void 0 ? void 0 :
|
|
81
|
+
var _pluginInjectionApi$d;
|
|
82
|
+
return pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.grid.actions) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.displayGrid(view)({
|
|
83
83
|
visible: visible,
|
|
84
84
|
gridType: gridType,
|
|
85
85
|
highlight: highlight
|
|
@@ -183,10 +183,10 @@ var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
183
183
|
return true;
|
|
184
184
|
});
|
|
185
185
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getLineLength", function (view, pos, originalLineLength) {
|
|
186
|
-
if (typeof pos === 'number' && (0,
|
|
186
|
+
if (typeof pos === 'number' && (0, _utils.isRichMediaInsideOfBlockNode)(view, pos)) {
|
|
187
187
|
var $pos = view.state.doc.resolve(pos);
|
|
188
188
|
var domNode = view.nodeDOM($pos.pos);
|
|
189
|
-
if ($pos.nodeAfter &&
|
|
189
|
+
if ($pos.nodeAfter && _utils.floatingLayouts.indexOf($pos.nodeAfter.attrs.layout) > -1 && domNode && domNode.parentElement) {
|
|
190
190
|
return domNode.parentElement.offsetWidth;
|
|
191
191
|
}
|
|
192
192
|
if (domNode instanceof HTMLElement) {
|
|
@@ -87,6 +87,7 @@ function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
87
87
|
// (2) Render a blue link whilst downgrading to `link` in the ADF (fatal errs).
|
|
88
88
|
|
|
89
89
|
if (maybeAPIError.kind && maybeAPIError.kind === 'fatal') {
|
|
90
|
+
var _pluginInjectionApi$d;
|
|
90
91
|
this.setState({
|
|
91
92
|
isError: true
|
|
92
93
|
});
|
|
@@ -100,7 +101,7 @@ function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
100
101
|
if (!getPos || typeof getPos === 'boolean') {
|
|
101
102
|
return;
|
|
102
103
|
}
|
|
103
|
-
(0, _doc.changeSelectedCardToLinkFallback)(undefined, url, true, node, getPos(), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.analytics.actions)(view.state, view.dispatch);
|
|
104
|
+
(0, _doc.changeSelectedCardToLinkFallback)(undefined, url, true, node, getPos(), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.analytics) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.actions)(view.state, view.dispatch);
|
|
104
105
|
return null;
|
|
105
106
|
} else {
|
|
106
107
|
// Otherwise, render a blue link as fallback (above in render()).
|
|
@@ -12,10 +12,8 @@ var _prosemirrorHistory = require("prosemirror-history");
|
|
|
12
12
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
13
13
|
var _card = require("@atlaskit/editor-common/card");
|
|
14
14
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
15
|
-
var _utils = require("
|
|
16
|
-
var
|
|
17
|
-
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
18
|
-
var _utils3 = require("../utils");
|
|
15
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
16
|
+
var _utils2 = require("../utils");
|
|
19
17
|
var _actions = require("./actions");
|
|
20
18
|
var _pluginKey = require("./plugin-key");
|
|
21
19
|
var _shouldReplaceLink = require("./shouldReplaceLink");
|
|
@@ -107,7 +105,7 @@ var replaceQueuedUrlWithCard = function replaceQueuedUrlWithCard(url, cardData,
|
|
|
107
105
|
inputMethod: inputMethod,
|
|
108
106
|
nodeType: nodeType,
|
|
109
107
|
nodeContext: nodeContext,
|
|
110
|
-
fromCurrentDomain: (0,
|
|
108
|
+
fromCurrentDomain: (0, _utils.isFromCurrentDomain)(url)
|
|
111
109
|
},
|
|
112
110
|
nonPrivacySafeAttributes: {
|
|
113
111
|
domainName: domainName
|
|
@@ -136,7 +134,7 @@ var handleFallbackWithAnalytics = function handleFallbackWithAnalytics(request,
|
|
|
136
134
|
}
|
|
137
135
|
var tr = state.tr;
|
|
138
136
|
if (request.source !== _analytics.INPUT_METHOD.FLOATING_TB) {
|
|
139
|
-
editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent((0,
|
|
137
|
+
editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent((0, _utils.getLinkCreationAnalyticsEvent)(request.source, request.url))(tr);
|
|
140
138
|
}
|
|
141
139
|
(0, _card.addLinkMetadata)(state.selection, tr, {
|
|
142
140
|
action: request.analyticsAction,
|
|
@@ -268,7 +266,7 @@ var changeSelectedCardToLink = function changeSelectedCardToLink(text, href, sen
|
|
|
268
266
|
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
269
267
|
attributes: {
|
|
270
268
|
newType: _analytics.SMART_LINK_TYPE.URL,
|
|
271
|
-
previousType: (0,
|
|
269
|
+
previousType: (0, _utils2.appearanceForNodeType)(selectedNode.type)
|
|
272
270
|
}
|
|
273
271
|
})(tr);
|
|
274
272
|
}
|
|
@@ -311,7 +309,7 @@ var updateCard = function updateCard(href, sourceEvent) {
|
|
|
311
309
|
if (!selectedNode) {
|
|
312
310
|
return false;
|
|
313
311
|
}
|
|
314
|
-
var cardAppearance = (0,
|
|
312
|
+
var cardAppearance = (0, _utils2.selectedCardAppearance)(state);
|
|
315
313
|
var tr = cardToLinkWithTransaction(state, href, href);
|
|
316
314
|
queueCardFromChangedTr(state, tr, _analytics.INPUT_METHOD.MANUAL, _analytics.ACTION.UPDATED, undefined, sourceEvent, cardAppearance);
|
|
317
315
|
if (dispatch) {
|
|
@@ -352,7 +350,7 @@ var changeSelectedCardToText = function changeSelectedCardToText(text, editorAna
|
|
|
352
350
|
action: _analytics.ACTION.UNLINK
|
|
353
351
|
});
|
|
354
352
|
tr.scrollIntoView();
|
|
355
|
-
editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent((0,
|
|
353
|
+
editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent((0, _analytics.unlinkPayload)(_analytics.ACTION_SUBJECT_ID.CARD_INLINE))(tr);
|
|
356
354
|
dispatch(tr);
|
|
357
355
|
}
|
|
358
356
|
return true;
|
|
@@ -375,7 +373,7 @@ var setSelectedCardAppearance = function setSelectedCardAppearance(appearance, e
|
|
|
375
373
|
}
|
|
376
374
|
return false;
|
|
377
375
|
}
|
|
378
|
-
if ((0,
|
|
376
|
+
if ((0, _utils2.appearanceForNodeType)(selectedNode.type) === appearance) {
|
|
379
377
|
return false;
|
|
380
378
|
}
|
|
381
379
|
var isEmbed = appearance === 'embed';
|
|
@@ -404,7 +402,7 @@ var setSelectedCardAppearance = function setSelectedCardAppearance(appearance, e
|
|
|
404
402
|
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
405
403
|
attributes: {
|
|
406
404
|
newType: appearance,
|
|
407
|
-
previousType: (0,
|
|
405
|
+
previousType: (0, _utils2.appearanceForNodeType)(selectedNode.type)
|
|
408
406
|
}
|
|
409
407
|
})(tr);
|
|
410
408
|
(0, _card.addLinkMetadata)(state.selection, tr, {
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.cardKeymap = cardKeymap;
|
|
8
7
|
var _prosemirrorKeymap = require("prosemirror-keymap");
|
|
9
8
|
var _prosemirrorState = require("prosemirror-state");
|
|
10
|
-
var
|
|
9
|
+
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
11
10
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
12
11
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
|
-
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); }
|
|
14
|
-
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; }
|
|
15
12
|
var lookupPixel = 10;
|
|
16
13
|
var getClosestInlineCardPos = function getClosestInlineCardPos(state, editorView, direction) {
|
|
17
14
|
var _editorView$posAtCoor;
|
|
@@ -60,8 +57,8 @@ function cardKeymap(featureFlags) {
|
|
|
60
57
|
|
|
61
58
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=1227468 introduced since Chrome 91
|
|
62
59
|
if (_utils.browser.chrome && _utils.browser.chrome_version > 90 && featureFlags.chromeCursorHandlerFixedVersion && _utils.browser.chrome_version < featureFlags.chromeCursorHandlerFixedVersion) {
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveUp.common, selectAboveBelowInlineCard('up'), list);
|
|
61
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveDown.common, selectAboveBelowInlineCard('down'), list);
|
|
65
62
|
}
|
|
66
63
|
return (0, _prosemirrorKeymap.keymap)(list);
|
|
67
64
|
}
|
|
@@ -14,7 +14,7 @@ Object.defineProperty(exports, "pluginKey", {
|
|
|
14
14
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
15
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
16
16
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
17
|
-
var
|
|
17
|
+
var _reactNodeView = require("@atlaskit/editor-common/react-node-view");
|
|
18
18
|
var _blockCard = require("../nodeviews/blockCard");
|
|
19
19
|
var _embedCard = require("../nodeviews/embedCard");
|
|
20
20
|
var _inlineCard = require("../nodeviews/inlineCard");
|
|
@@ -113,7 +113,7 @@ var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
113
113
|
},
|
|
114
114
|
props: {
|
|
115
115
|
nodeViews: {
|
|
116
|
-
inlineCard: (0,
|
|
116
|
+
inlineCard: (0, _reactNodeView.getInlineNodeViewProducer)({
|
|
117
117
|
pmPluginFactoryParams: pmPluginFactoryParams,
|
|
118
118
|
Component: _inlineCard.InlineCardNodeView,
|
|
119
119
|
extraComponentProps: {
|
|
@@ -15,19 +15,16 @@ var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove
|
|
|
15
15
|
var _unlink = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/unlink"));
|
|
16
16
|
var _settings = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/settings"));
|
|
17
17
|
var _shortcut = _interopRequireDefault(require("@atlaskit/icon/glyph/shortcut"));
|
|
18
|
-
var _messages = require("../../messages");
|
|
19
|
-
var _messages2 = _interopRequireWildcard(require("@atlaskit/editor-common/messages"));
|
|
20
|
-
var _doc = require("./pm-plugins/doc");
|
|
21
18
|
var _card = require("@atlaskit/editor-common/card");
|
|
19
|
+
var _messages = _interopRequireWildcard(require("@atlaskit/editor-common/messages"));
|
|
20
|
+
var _doc = require("./pm-plugins/doc");
|
|
22
21
|
var _main = require("./pm-plugins/main");
|
|
23
22
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
24
23
|
var _EditLinkToolbar = require("./ui/EditLinkToolbar");
|
|
25
24
|
var _utils = require("./utils");
|
|
26
25
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
27
26
|
var _LinkToolbarAppearance = require("./ui/LinkToolbarAppearance");
|
|
28
|
-
var
|
|
29
|
-
var _MediaAndEmbedsToolbar = _interopRequireDefault(require("../../ui/MediaAndEmbedsToolbar"));
|
|
30
|
-
var _linkingUtils = require("../../utils/linking-utils");
|
|
27
|
+
var _messages2 = require("./messages");
|
|
31
28
|
var _styles2 = require("./styles");
|
|
32
29
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
33
30
|
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); }
|
|
@@ -76,7 +73,7 @@ var visitCardLink = function visitCardLink(editorAnalyticsApi) {
|
|
|
76
73
|
window.open(url);
|
|
77
74
|
if (dispatch) {
|
|
78
75
|
var tr = state.tr;
|
|
79
|
-
editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent((0,
|
|
76
|
+
editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent((0, _analytics.buildVisitedLinkPayload)(type.name))(tr);
|
|
80
77
|
dispatch(tr);
|
|
81
78
|
}
|
|
82
79
|
return true;
|
|
@@ -92,7 +89,7 @@ var openLinkSettings = function openLinkSettings(editorAnalyticsApi) {
|
|
|
92
89
|
if (dispatch) {
|
|
93
90
|
var tr = state.tr,
|
|
94
91
|
type = state.selection.node.type;
|
|
95
|
-
editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent((0,
|
|
92
|
+
editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent((0, _analytics.buildOpenedSettingsPayload)(type.name))(tr);
|
|
96
93
|
dispatch(tr);
|
|
97
94
|
}
|
|
98
95
|
return true;
|
|
@@ -133,7 +130,7 @@ var floatingToolbar = function floatingToolbar(cardOptions, featureFlags, platfo
|
|
|
133
130
|
var shouldEnableFocusTrap = lpLinkPicker && lpLinkPickerFocusTrap;
|
|
134
131
|
var isLinkPickerEnabled = !!lpLinkPicker;
|
|
135
132
|
return _objectSpread(_objectSpread({
|
|
136
|
-
title: intl.formatMessage(
|
|
133
|
+
title: intl.formatMessage(_messages2.messages.card),
|
|
137
134
|
className: className,
|
|
138
135
|
nodeType: nodeType,
|
|
139
136
|
preventPopupOverflow: preventPopupOverflow
|
|
@@ -167,8 +164,8 @@ var unlinkCard = function unlinkCard(node, state, editorAnalyticsApi) {
|
|
|
167
164
|
return false;
|
|
168
165
|
};
|
|
169
166
|
};
|
|
170
|
-
var buildAlignmentOptions = function buildAlignmentOptions(state, intl, widthPluginDependencyApi, cardOptions) {
|
|
171
|
-
return (0,
|
|
167
|
+
var buildAlignmentOptions = function buildAlignmentOptions(state, intl, widthPluginDependencyApi, analyticsApi, cardOptions) {
|
|
168
|
+
return (0, _card.buildLayoutButtons)(state, intl, state.schema.nodes.embedCard, widthPluginDependencyApi, analyticsApi, true, true, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowWrapping, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowAlignment);
|
|
172
169
|
};
|
|
173
170
|
var withToolbarMetadata = function withToolbarMetadata(command) {
|
|
174
171
|
return (0, _card.commandWithMetadata)(command, {
|
|
@@ -205,7 +202,7 @@ var generateToolbarItems = function generateToolbarItems(state, featureFlags, in
|
|
|
205
202
|
linkPicker: linkPicker,
|
|
206
203
|
node: node,
|
|
207
204
|
featureFlags: featureFlags,
|
|
208
|
-
|
|
205
|
+
pluginInjectionApi: pluginInjectionApi
|
|
209
206
|
})];
|
|
210
207
|
} else {
|
|
211
208
|
var inlineCard = state.schema.nodes.inlineCard;
|
|
@@ -226,7 +223,7 @@ var generateToolbarItems = function generateToolbarItems(state, featureFlags, in
|
|
|
226
223
|
icon: _shortcut.default,
|
|
227
224
|
metadata: metadata,
|
|
228
225
|
className: 'hyperlink-open-link',
|
|
229
|
-
title: intl.formatMessage(
|
|
226
|
+
title: intl.formatMessage(_messages.linkMessages.openLink),
|
|
230
227
|
onClick: visitCardLink(editorAnalyticsApi)
|
|
231
228
|
}, {
|
|
232
229
|
type: 'separator'
|
|
@@ -249,12 +246,12 @@ var generateToolbarItems = function generateToolbarItems(state, featureFlags, in
|
|
|
249
246
|
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
250
247
|
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, true),
|
|
251
248
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
252
|
-
title: intl.formatMessage(
|
|
249
|
+
title: intl.formatMessage(_messages.default.remove),
|
|
253
250
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
254
251
|
}]);
|
|
255
252
|
if (currentAppearance === 'embed') {
|
|
256
|
-
var _pluginInjectionApi$d6;
|
|
257
|
-
var alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d6 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d6 === void 0 ? void 0 : _pluginInjectionApi$d6.width, cardOptions);
|
|
253
|
+
var _pluginInjectionApi$d6, _pluginInjectionApi$d7, _pluginInjectionApi$d8;
|
|
254
|
+
var alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d6 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d6 === void 0 ? void 0 : _pluginInjectionApi$d6.width, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d7 = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d7 === void 0 ? void 0 : (_pluginInjectionApi$d8 = _pluginInjectionApi$d7.analytics) === null || _pluginInjectionApi$d8 === void 0 ? void 0 : _pluginInjectionApi$d8.actions, cardOptions);
|
|
258
255
|
if (alignmentOptions.length) {
|
|
259
256
|
alignmentOptions.push({
|
|
260
257
|
type: 'separator'
|
|
@@ -18,13 +18,10 @@ var _card = require("@atlaskit/editor-common/card");
|
|
|
18
18
|
var _HyperlinkAddToolbar = _interopRequireDefault(require("../../hyperlink/ui/HyperlinkAddToolbar"));
|
|
19
19
|
var _actions = require("../pm-plugins/actions");
|
|
20
20
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
21
|
-
var _ToolbarComponents = require("../../../ui/LinkSearch/ToolbarComponents");
|
|
22
21
|
var _doc = require("../pm-plugins/doc");
|
|
23
22
|
var _utils = require("../utils");
|
|
24
23
|
var _prosemirrorState = require("prosemirror-state");
|
|
25
|
-
var
|
|
26
|
-
var _forceFocus = require("../../floating-toolbar/pm-plugins/force-focus");
|
|
27
|
-
var _messages = require("../../../messages");
|
|
24
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
28
25
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
29
26
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
30
27
|
var HyperLinkToolbarWithListeners = (0, _ui.withOuterListeners)(_HyperlinkAddToolbar.default);
|
|
@@ -42,7 +39,8 @@ var EditLinkToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
42
39
|
* and not close the floating toolbar.
|
|
43
40
|
*/
|
|
44
41
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleEsc", function (e) {
|
|
45
|
-
|
|
42
|
+
var _this$props$forceFocu, _this$props;
|
|
43
|
+
(_this$props$forceFocu = (_this$props = _this.props).forceFocusSelector) === null || _this$props$forceFocu === void 0 ? void 0 : _this$props$forceFocu.call(_this$props, "[aria-label=\"".concat(_messages.linkToolbarMessages.editLink.defaultMessage, "\"]"), _this.props.view);
|
|
46
44
|
});
|
|
47
45
|
return _this;
|
|
48
46
|
}
|
|
@@ -68,14 +66,14 @@ var EditLinkToolbar = /*#__PURE__*/function (_React$Component) {
|
|
|
68
66
|
key: "render",
|
|
69
67
|
value: function render() {
|
|
70
68
|
var _this2 = this;
|
|
71
|
-
var _this$
|
|
72
|
-
linkPickerOptions = _this$
|
|
73
|
-
providerFactory = _this$
|
|
74
|
-
url = _this$
|
|
75
|
-
text = _this$
|
|
76
|
-
view = _this$
|
|
77
|
-
featureFlags = _this$
|
|
78
|
-
_onSubmit = _this$
|
|
69
|
+
var _this$props2 = this.props,
|
|
70
|
+
linkPickerOptions = _this$props2.linkPickerOptions,
|
|
71
|
+
providerFactory = _this$props2.providerFactory,
|
|
72
|
+
url = _this$props2.url,
|
|
73
|
+
text = _this$props2.text,
|
|
74
|
+
view = _this$props2.view,
|
|
75
|
+
featureFlags = _this$props2.featureFlags,
|
|
76
|
+
_onSubmit = _this$props2.onSubmit;
|
|
79
77
|
return /*#__PURE__*/_react.default.createElement(HyperLinkToolbarWithListeners, {
|
|
80
78
|
view: view,
|
|
81
79
|
linkPickerOptions: linkPickerOptions,
|
|
@@ -109,7 +107,7 @@ var editLink = function editLink(editorAnalyticsApi) {
|
|
|
109
107
|
if (dispatch) {
|
|
110
108
|
var tr = state.tr;
|
|
111
109
|
(0, _actions.showLinkToolbar)(tr);
|
|
112
|
-
editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent((0,
|
|
110
|
+
editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent((0, _analytics.buildEditLinkPayload)(type))(tr);
|
|
113
111
|
dispatch(tr);
|
|
114
112
|
return true;
|
|
115
113
|
}
|
|
@@ -122,12 +120,13 @@ var buildEditLinkToolbar = function buildEditLinkToolbar(_ref) {
|
|
|
122
120
|
node = _ref.node,
|
|
123
121
|
linkPicker = _ref.linkPicker,
|
|
124
122
|
featureFlags = _ref.featureFlags,
|
|
125
|
-
|
|
123
|
+
pluginInjectionApi = _ref.pluginInjectionApi;
|
|
126
124
|
return {
|
|
127
125
|
type: 'custom',
|
|
128
126
|
disableArrowNavigation: true,
|
|
129
127
|
fallback: [],
|
|
130
128
|
render: function render(view, idx) {
|
|
129
|
+
var _pluginInjectionApi$d;
|
|
131
130
|
if (!view || !providerFactory) {
|
|
132
131
|
return null;
|
|
133
132
|
}
|
|
@@ -141,6 +140,7 @@ var buildEditLinkToolbar = function buildEditLinkToolbar(_ref) {
|
|
|
141
140
|
text: displayInfo.title || '',
|
|
142
141
|
node: node,
|
|
143
142
|
featureFlags: featureFlags,
|
|
143
|
+
forceFocusSelector: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.floatingToolbar.actions) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.forceFocusSelector,
|
|
144
144
|
onSubmit: function onSubmit(newHref, newText, analytic) {
|
|
145
145
|
var urlChanged = newHref !== displayInfo.url;
|
|
146
146
|
var titleChanged = newText !== displayInfo.title;
|
|
@@ -148,7 +148,8 @@ var buildEditLinkToolbar = function buildEditLinkToolbar(_ref) {
|
|
|
148
148
|
// If the title is changed in a smartlink, convert to standard blue hyperlink
|
|
149
149
|
// (even if the url was also changed) - we don't want to lose the custom title.
|
|
150
150
|
if (titleChanged) {
|
|
151
|
-
|
|
151
|
+
var _pluginInjectionApi$d2;
|
|
152
|
+
return (0, _card.commandWithMetadata)((0, _doc.changeSelectedCardToLink)(newText, newHref, undefined, undefined, undefined, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.dependencies.analytics) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.actions), {
|
|
152
153
|
action: _analytics.ACTION.UPDATED,
|
|
153
154
|
sourceEvent: analytic
|
|
154
155
|
})(view.state, view.dispatch);
|
|
@@ -165,8 +166,8 @@ var buildEditLinkToolbar = function buildEditLinkToolbar(_ref) {
|
|
|
165
166
|
exports.buildEditLinkToolbar = buildEditLinkToolbar;
|
|
166
167
|
var editLinkToolbarConfig = function editLinkToolbarConfig(showLinkingToolbar, lpLinkPicker) {
|
|
167
168
|
return showLinkingToolbar ? {
|
|
168
|
-
height: lpLinkPicker ?
|
|
169
|
-
width:
|
|
169
|
+
height: lpLinkPicker ? _ui.LINKPICKER_HEIGHT_IN_PX : _ui.RECENT_SEARCH_HEIGHT_IN_PX,
|
|
170
|
+
width: _ui.RECENT_SEARCH_WIDTH_IN_PX,
|
|
170
171
|
forcePlacement: true
|
|
171
172
|
} : {};
|
|
172
173
|
};
|