@atlaskit/editor-core 150.0.3 → 151.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -0
- package/dist/cjs/actions/index.js +5 -23
- package/dist/cjs/create-editor/ErrorBoundary.js +113 -79
- package/dist/cjs/create-editor/ReactEditorView.js +145 -31
- package/dist/cjs/create-editor/create-plugins-list.js +4 -2
- package/dist/cjs/editor.js +101 -40
- package/dist/cjs/labs/next/presets/cxhtml.js +2 -1
- package/dist/cjs/plugins/analytics/types/enums.js +3 -1
- package/dist/cjs/plugins/base/index.js +4 -3
- package/dist/cjs/plugins/base/pm-plugins/frozen-editor.js +66 -36
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -1
- package/dist/cjs/plugins/card/index.js +13 -2
- package/dist/cjs/plugins/card/nodeviews/embedCard.js +1 -0
- package/dist/cjs/plugins/card/pm-plugins/main.js +7 -2
- package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +10 -3
- package/dist/cjs/plugins/code-block/toolbar.js +1 -1
- package/dist/cjs/plugins/emoji/styles.js +1 -1
- package/dist/cjs/plugins/extension/pm-plugins/main.js +1 -4
- package/dist/cjs/plugins/extension/toolbar.js +28 -23
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +8 -3
- package/dist/cjs/plugins/find-replace/ui/Find.js +27 -7
- package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +3 -3
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -4
- package/dist/cjs/plugins/hyperlink/utils.js +6 -69
- package/dist/cjs/plugins/media/index.js +14 -3
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +24 -10
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +179 -0
- package/dist/cjs/plugins/media/pm-plugins/main.js +18 -9
- package/dist/cjs/plugins/media/toolbar/index.js +49 -17
- package/dist/cjs/plugins/media/toolbar/utils.js +20 -2
- package/dist/cjs/plugins/media/utils/media-files.js +67 -1
- package/dist/cjs/plugins/panel/index.js +2 -3
- package/dist/cjs/plugins/panel/message.js +47 -0
- package/dist/cjs/plugins/panel/toolbar.js +64 -84
- package/dist/cjs/plugins/panel/utils.js +2 -2
- package/dist/cjs/plugins/paste/linkify-md-plugin.js +3 -3
- package/dist/cjs/plugins/status/styles.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +18 -2
- package/dist/cjs/profiler/render-count.js +82 -0
- package/dist/cjs/ui/Appearance/Comment/Comment.js +6 -5
- package/dist/cjs/utils/react-hooks/use-component-renderer-tracking/index.js +55 -19
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +6 -28
- package/dist/es2019/create-editor/ErrorBoundary.js +73 -60
- package/dist/es2019/create-editor/ReactEditorView.js +130 -23
- package/dist/es2019/create-editor/create-plugins-list.js +4 -2
- package/dist/es2019/editor.js +74 -35
- package/dist/es2019/labs/next/presets/cxhtml.js +2 -1
- package/dist/es2019/plugins/analytics/types/enums.js +3 -1
- package/dist/es2019/plugins/base/index.js +4 -3
- package/dist/es2019/plugins/base/pm-plugins/frozen-editor.js +63 -35
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +2 -1
- package/dist/es2019/plugins/card/index.js +7 -2
- package/dist/es2019/plugins/card/nodeviews/embedCard.js +1 -0
- package/dist/es2019/plugins/card/pm-plugins/main.js +9 -2
- package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +12 -5
- package/dist/es2019/plugins/code-block/toolbar.js +1 -1
- package/dist/es2019/plugins/emoji/styles.js +2 -0
- package/dist/es2019/plugins/extension/pm-plugins/main.js +1 -4
- package/dist/es2019/plugins/extension/toolbar.js +30 -25
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +8 -4
- package/dist/es2019/plugins/find-replace/ui/Find.js +27 -6
- package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +1 -1
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -4
- package/dist/es2019/plugins/hyperlink/utils.js +3 -59
- package/dist/es2019/plugins/media/index.js +13 -4
- package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +16 -7
- package/dist/es2019/plugins/media/nodeviews/mediaInline.js +88 -0
- package/dist/es2019/plugins/media/pm-plugins/main.js +20 -11
- package/dist/es2019/plugins/media/toolbar/index.js +44 -15
- package/dist/es2019/plugins/media/toolbar/utils.js +16 -0
- package/dist/es2019/plugins/media/utils/media-files.js +68 -2
- package/dist/es2019/plugins/panel/index.js +3 -4
- package/dist/es2019/plugins/panel/message.js +38 -0
- package/dist/es2019/plugins/panel/toolbar.js +52 -71
- package/dist/es2019/plugins/panel/utils.js +2 -2
- package/dist/es2019/plugins/paste/linkify-md-plugin.js +2 -2
- package/dist/es2019/plugins/status/styles.js +2 -0
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +18 -2
- package/dist/es2019/profiler/render-count.js +60 -0
- package/dist/es2019/ui/Appearance/Comment/Comment.js +4 -2
- package/dist/es2019/utils/react-hooks/use-component-renderer-tracking/index.js +51 -18
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +6 -24
- package/dist/esm/create-editor/ErrorBoundary.js +113 -78
- package/dist/esm/create-editor/ReactEditorView.js +146 -31
- package/dist/esm/create-editor/create-plugins-list.js +4 -2
- package/dist/esm/editor.js +100 -40
- package/dist/esm/labs/next/presets/cxhtml.js +2 -1
- package/dist/esm/plugins/analytics/types/enums.js +3 -1
- package/dist/esm/plugins/base/index.js +4 -3
- package/dist/esm/plugins/base/pm-plugins/frozen-editor.js +64 -36
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +3 -1
- package/dist/esm/plugins/card/index.js +13 -2
- package/dist/esm/plugins/card/nodeviews/embedCard.js +1 -0
- package/dist/esm/plugins/card/pm-plugins/main.js +7 -2
- package/dist/esm/plugins/card/pm-plugins/util/resolve.js +12 -5
- package/dist/esm/plugins/code-block/toolbar.js +1 -1
- package/dist/esm/plugins/emoji/styles.js +1 -1
- package/dist/esm/plugins/extension/pm-plugins/main.js +1 -4
- package/dist/esm/plugins/extension/toolbar.js +28 -23
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +8 -4
- package/dist/esm/plugins/find-replace/ui/Find.js +27 -7
- package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +1 -1
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +7 -4
- package/dist/esm/plugins/hyperlink/utils.js +3 -59
- package/dist/esm/plugins/media/index.js +14 -4
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +24 -10
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +147 -0
- package/dist/esm/plugins/media/pm-plugins/main.js +19 -11
- package/dist/esm/plugins/media/toolbar/index.js +47 -19
- package/dist/esm/plugins/media/toolbar/utils.js +15 -1
- package/dist/esm/plugins/media/utils/media-files.js +60 -2
- package/dist/esm/plugins/panel/index.js +3 -4
- package/dist/esm/plugins/panel/message.js +38 -0
- package/dist/esm/plugins/panel/toolbar.js +57 -77
- package/dist/esm/plugins/panel/utils.js +2 -2
- package/dist/esm/plugins/paste/linkify-md-plugin.js +2 -2
- package/dist/esm/plugins/status/styles.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +18 -2
- package/dist/esm/profiler/render-count.js +57 -0
- package/dist/esm/ui/Appearance/Comment/Comment.js +6 -5
- package/dist/esm/utils/react-hooks/use-component-renderer-tracking/index.js +53 -20
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/ErrorBoundary.d.ts +6 -6
- package/dist/types/create-editor/ReactEditorView.d.ts +15 -3
- package/dist/types/editor.d.ts +2 -0
- package/dist/types/plugins/analytics/index.d.ts +1 -1
- package/dist/types/plugins/analytics/types/enums.d.ts +4 -2
- package/dist/types/plugins/analytics/types/events.d.ts +7 -2
- package/dist/types/plugins/analytics/types/general-events.d.ts +4 -1
- package/dist/types/plugins/analytics/types/index.d.ts +1 -1
- package/dist/types/plugins/analytics/types/insert-events.d.ts +6 -1
- package/dist/types/plugins/analytics/types/link-tool-bar-events.d.ts +1 -0
- package/dist/types/plugins/base/index.d.ts +1 -0
- package/dist/types/plugins/base/pm-plugins/frozen-editor.d.ts +3 -2
- package/dist/types/plugins/card/pm-plugins/main.d.ts +2 -3
- package/dist/types/plugins/card/pm-plugins/util/resolve.d.ts +2 -1
- package/dist/types/plugins/card/types.d.ts +6 -0
- package/dist/types/plugins/extension/types.d.ts +0 -2
- package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -1
- package/dist/types/plugins/floating-toolbar/types.d.ts +1 -1
- package/dist/types/plugins/floating-toolbar/ui/Select.d.ts +1 -1
- package/dist/types/plugins/hyperlink/utils.d.ts +0 -21
- package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +27 -0
- package/dist/types/plugins/media/pm-plugins/main.d.ts +2 -2
- package/dist/types/plugins/media/toolbar/utils.d.ts +2 -0
- package/dist/types/plugins/media/utils/media-files.d.ts +8 -0
- package/dist/types/plugins/panel/message.d.ts +37 -0
- package/dist/types/plugins/panel/toolbar.d.ts +4 -37
- package/dist/types/plugins/panel/types.d.ts +1 -0
- package/dist/types/profiler/render-count.d.ts +14 -0
- package/dist/types/types/feature-flags.d.ts +8 -0
- package/dist/types/ui/LinkSearch/types.d.ts +1 -0
- package/dist/types/utils/react-hooks/use-component-renderer-tracking/index.d.ts +17 -1
- package/package.json +19 -16
- package/dist/cjs/plugins/caption/nodeviews/index.test.js +0 -135
- package/dist/cjs/plugins/caption/pm-plugins/keymap.test.js +0 -203
- package/dist/cjs/plugins/caption/pm-plugins/main.test.js +0 -141
- package/dist/cjs/plugins/code-block/language-list.test.js +0 -74
- package/dist/cjs/plugins/extension/ui/SaveIndicator/SaveIndicator.test.js +0 -101
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.test.js +0 -98
- package/dist/cjs/plugins/media/commands/captions.test.js +0 -149
- package/dist/cjs/plugins/media/commands/linking.test.js +0 -296
- package/dist/cjs/plugins/media/ui/CaptionPlaceholder/index.test.js +0 -50
- package/dist/cjs/plugins/panel/toolbar.test.js +0 -250
- package/dist/cjs/ui/ColorPickerButton/index.test.js +0 -123
- package/dist/cjs/ui/PortalProvider/index.test.js +0 -139
- package/dist/es2019/plugins/caption/nodeviews/index.test.js +0 -122
- package/dist/es2019/plugins/caption/pm-plugins/keymap.test.js +0 -193
- package/dist/es2019/plugins/caption/pm-plugins/main.test.js +0 -132
- package/dist/es2019/plugins/code-block/language-list.test.js +0 -69
- package/dist/es2019/plugins/extension/ui/SaveIndicator/SaveIndicator.test.js +0 -83
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.test.js +0 -85
- package/dist/es2019/plugins/media/commands/captions.test.js +0 -126
- package/dist/es2019/plugins/media/commands/linking.test.js +0 -208
- package/dist/es2019/plugins/media/ui/CaptionPlaceholder/index.test.js +0 -41
- package/dist/es2019/plugins/panel/toolbar.test.js +0 -200
- package/dist/es2019/ui/ColorPickerButton/index.test.js +0 -88
- package/dist/es2019/ui/PortalProvider/index.test.js +0 -115
- package/dist/esm/plugins/caption/nodeviews/index.test.js +0 -125
- package/dist/esm/plugins/caption/pm-plugins/keymap.test.js +0 -195
- package/dist/esm/plugins/caption/pm-plugins/main.test.js +0 -124
- package/dist/esm/plugins/code-block/language-list.test.js +0 -71
- package/dist/esm/plugins/extension/ui/SaveIndicator/SaveIndicator.test.js +0 -92
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.test.js +0 -85
- package/dist/esm/plugins/media/commands/captions.test.js +0 -135
- package/dist/esm/plugins/media/commands/linking.test.js +0 -268
- package/dist/esm/plugins/media/ui/CaptionPlaceholder/index.test.js +0 -41
- package/dist/esm/plugins/panel/toolbar.test.js +0 -230
- package/dist/esm/ui/ColorPickerButton/index.test.js +0 -107
- package/dist/esm/ui/PortalProvider/index.test.js +0 -129
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getPosInList = exports.insertMediaGroupNode = void 0;
|
|
6
|
+
exports.getPosInList = exports.insertMediaGroupNode = exports.insertMediaInlineNode = exports.canInsertMediaInline = void 0;
|
|
7
7
|
|
|
8
8
|
var _prosemirrorModel = require("prosemirror-model");
|
|
9
9
|
|
|
@@ -19,6 +19,13 @@ var _nodes = require("../../../utils/nodes");
|
|
|
19
19
|
|
|
20
20
|
var _analytics = require("../../analytics");
|
|
21
21
|
|
|
22
|
+
var canInsertMediaInline = function canInsertMediaInline(state) {
|
|
23
|
+
var node = state.schema.nodes.mediaInline.create({});
|
|
24
|
+
return (0, _prosemirrorUtils.canInsert)(state.selection.$to, _prosemirrorModel.Fragment.from(node));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.canInsertMediaInline = canInsertMediaInline;
|
|
28
|
+
|
|
22
29
|
var getInsertMediaGroupAnalytics = function getInsertMediaGroupAnalytics(mediaState, inputMethod) {
|
|
23
30
|
var media = '';
|
|
24
31
|
|
|
@@ -40,6 +47,21 @@ var getInsertMediaGroupAnalytics = function getInsertMediaGroupAnalytics(mediaSt
|
|
|
40
47
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
41
48
|
};
|
|
42
49
|
};
|
|
50
|
+
|
|
51
|
+
var getInsertMediaInlineAnalytics = function getInsertMediaInlineAnalytics(mediaState, inputMethod) {
|
|
52
|
+
var media = mediaState.fileMimeType || 'unknown';
|
|
53
|
+
return {
|
|
54
|
+
action: _analytics.ACTION.INSERTED,
|
|
55
|
+
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
56
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.MEDIA,
|
|
57
|
+
attributes: {
|
|
58
|
+
type: _analytics.ACTION_SUBJECT_ID.MEDIA_INLINE,
|
|
59
|
+
inputMethod: inputMethod,
|
|
60
|
+
fileExtension: media
|
|
61
|
+
},
|
|
62
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
63
|
+
};
|
|
64
|
+
};
|
|
43
65
|
/**
|
|
44
66
|
* Check if current editor selections is a media group or not.
|
|
45
67
|
* @param state Editor state
|
|
@@ -64,6 +86,48 @@ function shouldAppendParagraph(state, node) {
|
|
|
64
86
|
var wasMediaNode = node && node.type === media;
|
|
65
87
|
return ((0, _utils.insideTableCell)(state) || (0, _utils.isInListItem)(state) || (0, _utils.isInLayoutColumn)(state) || (0, _position.atTheEndOfDoc)(state) && (!(0, _mediaCommon.posOfPrecedingMediaGroup)(state) || (0, _mediaCommon.isSelectionNonMediaBlockNode)(state))) && !wasMediaNode;
|
|
66
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Create a new media inline to insert the new media.
|
|
91
|
+
* @param view Editor view
|
|
92
|
+
* @param mediaState Media file to be added to the editor
|
|
93
|
+
* @param collection Collection for the media to be added
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
var insertMediaInlineNode = function insertMediaInlineNode(view, mediaState, collection, inputMethod) {
|
|
98
|
+
var state = view.state,
|
|
99
|
+
dispatch = view.dispatch;
|
|
100
|
+
var schema = state.schema,
|
|
101
|
+
tr = state.tr;
|
|
102
|
+
var mediaInline = schema.nodes.mediaInline; // Do nothing if no media found
|
|
103
|
+
|
|
104
|
+
if (!mediaInline || !mediaState || collection === undefined) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
var id = mediaState.id;
|
|
109
|
+
var mediaInlineNode = mediaInline.create({
|
|
110
|
+
id: id,
|
|
111
|
+
collection: collection
|
|
112
|
+
});
|
|
113
|
+
var space = state.schema.text(' ');
|
|
114
|
+
var pos = state.selection.$to.pos;
|
|
115
|
+
|
|
116
|
+
var content = _prosemirrorModel.Fragment.from([mediaInlineNode, space]); // Delete the selection if a selection is made
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
var deleteRange = findDeleteRange(state);
|
|
120
|
+
|
|
121
|
+
if (!deleteRange) {
|
|
122
|
+
tr.insert(pos, content);
|
|
123
|
+
} else {
|
|
124
|
+
tr.insert(pos, content).deleteRange(deleteRange.start, deleteRange.end);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
(0, _analytics.addAnalytics)(state, tr, getInsertMediaInlineAnalytics(mediaState, inputMethod));
|
|
128
|
+
dispatch(tr);
|
|
129
|
+
return true;
|
|
130
|
+
};
|
|
67
131
|
/**
|
|
68
132
|
* Insert a media into an existing media group
|
|
69
133
|
* or create a new media group to insert the new media.
|
|
@@ -73,6 +137,8 @@ function shouldAppendParagraph(state, node) {
|
|
|
73
137
|
*/
|
|
74
138
|
|
|
75
139
|
|
|
140
|
+
exports.insertMediaInlineNode = insertMediaInlineNode;
|
|
141
|
+
|
|
76
142
|
var insertMediaGroupNode = function insertMediaGroupNode(view, mediaStates, collection, inputMethod) {
|
|
77
143
|
var state = view.state,
|
|
78
144
|
dispatch = view.dispatch;
|
|
@@ -55,8 +55,7 @@ var panelPlugin = function panelPlugin() {
|
|
|
55
55
|
return {
|
|
56
56
|
name: 'panel',
|
|
57
57
|
nodes: function nodes() {
|
|
58
|
-
|
|
59
|
-
var panelNode = options.UNSAFE_allowCustomPanel ? _adfSchema.customPanel : _adfSchema.panel;
|
|
58
|
+
var panelNode = (0, _adfSchema.customPanel)(!!options.UNSAFE_allowCustomPanel);
|
|
60
59
|
return [{
|
|
61
60
|
name: 'panel',
|
|
62
61
|
node: panelNode
|
|
@@ -149,7 +148,7 @@ var panelPlugin = function panelPlugin() {
|
|
|
149
148
|
}
|
|
150
149
|
}];
|
|
151
150
|
|
|
152
|
-
if (options.UNSAFE_allowCustomPanel) {
|
|
151
|
+
if (options.UNSAFE_allowCustomPanelEdit && options.UNSAFE_allowCustomPanel) {
|
|
153
152
|
quickInsertOptions.push({
|
|
154
153
|
id: 'custompanel',
|
|
155
154
|
title: formatMessage(_messages.messages.customPanel),
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.messages = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactIntl = require("react-intl");
|
|
9
|
+
|
|
10
|
+
var messages = (0, _reactIntl.defineMessages)({
|
|
11
|
+
info: {
|
|
12
|
+
id: 'fabric.editor.info',
|
|
13
|
+
defaultMessage: 'Info',
|
|
14
|
+
description: 'Panels provide a way to highlight text. The info panel has a blue background.'
|
|
15
|
+
},
|
|
16
|
+
note: {
|
|
17
|
+
id: 'fabric.editor.note',
|
|
18
|
+
defaultMessage: 'Note',
|
|
19
|
+
description: 'Panels provide a way to highlight text. The note panel has a purple background.'
|
|
20
|
+
},
|
|
21
|
+
success: {
|
|
22
|
+
id: 'fabric.editor.success',
|
|
23
|
+
defaultMessage: 'Success',
|
|
24
|
+
description: 'Panels provide a way to highlight text. The success panel has a green background.'
|
|
25
|
+
},
|
|
26
|
+
warning: {
|
|
27
|
+
id: 'fabric.editor.warning',
|
|
28
|
+
defaultMessage: 'Warning',
|
|
29
|
+
description: 'Panels provide a way to highlight text. The warning panel has a yellow background.'
|
|
30
|
+
},
|
|
31
|
+
error: {
|
|
32
|
+
id: 'fabric.editor.error',
|
|
33
|
+
defaultMessage: 'Error',
|
|
34
|
+
description: 'Panels provide a way to highlight text. The error panel has a red background.'
|
|
35
|
+
},
|
|
36
|
+
emoji: {
|
|
37
|
+
id: 'fabric.editor.panel.emoji',
|
|
38
|
+
defaultMessage: 'Add emoji',
|
|
39
|
+
description: 'Select the panel icon'
|
|
40
|
+
},
|
|
41
|
+
backgroundColor: {
|
|
42
|
+
id: 'fabric.editor.panel.backgroundColor',
|
|
43
|
+
defaultMessage: 'Background color',
|
|
44
|
+
description: 'Select the panel background color.'
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
exports.messages = messages;
|
|
@@ -5,9 +5,9 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.getToolbarConfig = exports.getToolbarItems = exports.
|
|
8
|
+
exports.getToolbarConfig = exports.getToolbarItems = exports.panelIconMap = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
12
12
|
var _success = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/success"));
|
|
13
13
|
|
|
@@ -43,81 +43,53 @@ var _adfSchema = require("@atlaskit/adf-schema");
|
|
|
43
43
|
|
|
44
44
|
var _analytics = require("../analytics");
|
|
45
45
|
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
id: 'fabric.editor.note',
|
|
54
|
-
defaultMessage: 'Note',
|
|
55
|
-
description: 'Panels provide a way to highlight text. The note panel has a purple background.'
|
|
56
|
-
},
|
|
57
|
-
success: {
|
|
58
|
-
id: 'fabric.editor.success',
|
|
59
|
-
defaultMessage: 'Success',
|
|
60
|
-
description: 'Panels provide a way to highlight text. The success panel has a green background.'
|
|
61
|
-
},
|
|
62
|
-
warning: {
|
|
63
|
-
id: 'fabric.editor.warning',
|
|
64
|
-
defaultMessage: 'Warning',
|
|
65
|
-
description: 'Panels provide a way to highlight text. The warning panel has a yellow background.'
|
|
66
|
-
},
|
|
67
|
-
error: {
|
|
68
|
-
id: 'fabric.editor.error',
|
|
69
|
-
defaultMessage: 'Error',
|
|
70
|
-
description: 'Panels provide a way to highlight text. The error panel has a red background.'
|
|
71
|
-
},
|
|
72
|
-
emoji: {
|
|
73
|
-
id: 'fabric.editor.panel.emoji',
|
|
74
|
-
defaultMessage: 'Add emoji',
|
|
75
|
-
description: 'Select the panel icon'
|
|
76
|
-
},
|
|
77
|
-
backgroundColor: {
|
|
78
|
-
id: 'fabric.editor.panel.backgroundColor',
|
|
79
|
-
defaultMessage: 'Background color',
|
|
80
|
-
description: 'Select the panel background color.'
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
exports.messages = messages;
|
|
46
|
+
var _message = require("./message");
|
|
47
|
+
|
|
48
|
+
var _panelIconMap;
|
|
49
|
+
|
|
50
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
51
|
+
|
|
52
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
84
53
|
|
|
85
|
-
var
|
|
54
|
+
var panelIconMap = (_panelIconMap = {}, (0, _defineProperty2.default)(_panelIconMap, _adfSchema.PanelType.INFO, ':info:'), (0, _defineProperty2.default)(_panelIconMap, _adfSchema.PanelType.NOTE, ':note:'), (0, _defineProperty2.default)(_panelIconMap, _adfSchema.PanelType.WARNING, ':warning:'), (0, _defineProperty2.default)(_panelIconMap, _adfSchema.PanelType.ERROR, ':error:'), (0, _defineProperty2.default)(_panelIconMap, _adfSchema.PanelType.SUCCESS, ':success:'), (0, _defineProperty2.default)(_panelIconMap, _adfSchema.PanelType.TIP, ':tip:'), _panelIconMap);
|
|
55
|
+
exports.panelIconMap = panelIconMap;
|
|
56
|
+
|
|
57
|
+
var getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, activePanelType, activePanelColor, activePanelIcon) {
|
|
86
58
|
var items = [{
|
|
87
59
|
id: 'editor.panel.info',
|
|
88
60
|
type: 'button',
|
|
89
61
|
icon: _info.default,
|
|
90
62
|
onClick: (0, _actions.changePanelType)(_adfSchema.PanelType.INFO),
|
|
91
63
|
selected: activePanelType === _adfSchema.PanelType.INFO,
|
|
92
|
-
title: formatMessage(messages.info)
|
|
64
|
+
title: formatMessage(_message.messages.info)
|
|
93
65
|
}, {
|
|
94
66
|
id: 'editor.panel.note',
|
|
95
67
|
type: 'button',
|
|
96
68
|
icon: _note.default,
|
|
97
69
|
onClick: (0, _actions.changePanelType)(_adfSchema.PanelType.NOTE),
|
|
98
70
|
selected: activePanelType === _adfSchema.PanelType.NOTE,
|
|
99
|
-
title: formatMessage(messages.note)
|
|
71
|
+
title: formatMessage(_message.messages.note)
|
|
100
72
|
}, {
|
|
101
73
|
id: 'editor.panel.success',
|
|
102
74
|
type: 'button',
|
|
103
75
|
icon: _success.default,
|
|
104
76
|
onClick: (0, _actions.changePanelType)(_adfSchema.PanelType.SUCCESS),
|
|
105
77
|
selected: activePanelType === _adfSchema.PanelType.SUCCESS,
|
|
106
|
-
title: formatMessage(messages.success)
|
|
78
|
+
title: formatMessage(_message.messages.success)
|
|
107
79
|
}, {
|
|
108
80
|
id: 'editor.panel.warning',
|
|
109
81
|
type: 'button',
|
|
110
82
|
icon: _warning.default,
|
|
111
83
|
onClick: (0, _actions.changePanelType)(_adfSchema.PanelType.WARNING),
|
|
112
84
|
selected: activePanelType === _adfSchema.PanelType.WARNING,
|
|
113
|
-
title: formatMessage(messages.warning)
|
|
85
|
+
title: formatMessage(_message.messages.warning)
|
|
114
86
|
}, {
|
|
115
87
|
id: 'editor.panel.error',
|
|
116
88
|
type: 'button',
|
|
117
89
|
icon: _error.default,
|
|
118
90
|
onClick: (0, _actions.changePanelType)(_adfSchema.PanelType.ERROR),
|
|
119
91
|
selected: activePanelType === _adfSchema.PanelType.ERROR,
|
|
120
|
-
title: formatMessage(messages.error)
|
|
92
|
+
title: formatMessage(_message.messages.error)
|
|
121
93
|
}];
|
|
122
94
|
|
|
123
95
|
if (isCustomPanelEnabled) {
|
|
@@ -130,11 +102,16 @@ var getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isC
|
|
|
130
102
|
}
|
|
131
103
|
|
|
132
104
|
var previousColor = panelNode.node.attrs.panelColor || (0, _editorCommon.getPanelTypeBackground)(panelNode.node.attrs.panelType);
|
|
105
|
+
var emojiInfo = panelNode.node.attrs.panelType;
|
|
106
|
+
var panelInfo = panelIconMap[emojiInfo];
|
|
107
|
+
var previousEmoji = panelInfo ? {
|
|
108
|
+
emoji: panelInfo
|
|
109
|
+
} : {};
|
|
133
110
|
|
|
134
111
|
if (previousColor === color) {
|
|
135
|
-
(0, _actions.changePanelType)(_adfSchema.PanelType.CUSTOM, {
|
|
112
|
+
(0, _actions.changePanelType)(_adfSchema.PanelType.CUSTOM, _objectSpread({
|
|
136
113
|
color: color
|
|
137
|
-
}, isCustomPanelEnabled)(state, dispatch);
|
|
114
|
+
}, previousEmoji), isCustomPanelEnabled)(state, dispatch);
|
|
138
115
|
return false;
|
|
139
116
|
}
|
|
140
117
|
|
|
@@ -148,9 +125,9 @@ var getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isC
|
|
|
148
125
|
},
|
|
149
126
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
150
127
|
};
|
|
151
|
-
(0, _analytics.withAnalytics)(payload)((0, _actions.changePanelType)(_adfSchema.PanelType.CUSTOM, {
|
|
128
|
+
(0, _analytics.withAnalytics)(payload)((0, _actions.changePanelType)(_adfSchema.PanelType.CUSTOM, _objectSpread({
|
|
152
129
|
color: color
|
|
153
|
-
}, isCustomPanelEnabled))(state, dispatch);
|
|
130
|
+
}, previousEmoji), isCustomPanelEnabled))(state, dispatch);
|
|
154
131
|
return false;
|
|
155
132
|
};
|
|
156
133
|
};
|
|
@@ -225,39 +202,42 @@ var getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isC
|
|
|
225
202
|
value: panelColor,
|
|
226
203
|
border: _Palettes.DEFAULT_BORDER_COLOR
|
|
227
204
|
};
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
205
|
+
|
|
206
|
+
if (isCustomPanelEditable) {
|
|
207
|
+
var colorPicker = {
|
|
208
|
+
id: 'editor.panel.colorPicker',
|
|
209
|
+
title: formatMessage(_message.messages.backgroundColor),
|
|
210
|
+
type: 'select',
|
|
211
|
+
selectType: 'color',
|
|
212
|
+
defaultValue: defaultPalette,
|
|
213
|
+
options: _panelBackgroundPalette.panelBackgroundPalette,
|
|
214
|
+
onChange: function onChange(option) {
|
|
215
|
+
return changeColor(option.value);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
var emojiPicker = {
|
|
219
|
+
id: 'editor.panel.emojiPicker',
|
|
220
|
+
title: formatMessage(_message.messages.emoji),
|
|
221
|
+
type: 'select',
|
|
222
|
+
selectType: 'emoji',
|
|
223
|
+
options: [],
|
|
224
|
+
selected: activePanelType === _adfSchema.PanelType.CUSTOM && !!activePanelIcon,
|
|
225
|
+
onChange: function onChange(emojiShortName) {
|
|
226
|
+
return changeEmoji(emojiShortName);
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
var removeEmojiButton = {
|
|
230
|
+
id: 'editor.panel.removeEmoji',
|
|
231
|
+
type: 'button',
|
|
232
|
+
icon: _EditorRemoveEmojiIcon.default,
|
|
233
|
+
onClick: removeEmoji(),
|
|
234
|
+
title: formatMessage(_messages.default.removeEmoji),
|
|
235
|
+
disabled: activePanelIcon ? false : true
|
|
236
|
+
};
|
|
237
|
+
items.push(emojiPicker, removeEmojiButton, {
|
|
238
|
+
type: 'separator'
|
|
239
|
+
}, colorPicker);
|
|
240
|
+
}
|
|
261
241
|
}
|
|
262
242
|
|
|
263
243
|
items.push({
|
|
@@ -292,7 +272,7 @@ var getToolbarConfig = function getToolbarConfig(state, intl) {
|
|
|
292
272
|
panelColor = _panelObject$node$att.panelColor,
|
|
293
273
|
panelIcon = _panelObject$node$att.panelIcon; // force toolbar to be turned on
|
|
294
274
|
|
|
295
|
-
var items = getToolbarItems(formatMessage, nodeType, options.UNSAFE_allowCustomPanel || false, providerFactory, panelType, options.UNSAFE_allowCustomPanel ? panelColor : undefined, options.UNSAFE_allowCustomPanel ? panelIcon : undefined);
|
|
275
|
+
var items = getToolbarItems(formatMessage, nodeType, options.UNSAFE_allowCustomPanel || false, options.UNSAFE_allowCustomPanel && options.UNSAFE_allowCustomPanelEdit || false, providerFactory, panelType, options.UNSAFE_allowCustomPanel ? panelColor : undefined, options.UNSAFE_allowCustomPanel ? panelIcon : undefined);
|
|
296
276
|
|
|
297
277
|
var getDomRef = function getDomRef(editorView) {
|
|
298
278
|
var domAtPos = editorView.domAtPos.bind(editorView);
|
|
@@ -30,7 +30,7 @@ var panelAttrsToDom = function panelAttrsToDom(attrs, allowCustomPanel) {
|
|
|
30
30
|
'data-panel-type': panelType || _adfSchema.PanelType.INFO,
|
|
31
31
|
style: style
|
|
32
32
|
};
|
|
33
|
-
var
|
|
33
|
+
var iconDiv = ['div', {
|
|
34
34
|
class: _editorCommon.PanelSharedCssClassName.icon
|
|
35
35
|
}];
|
|
36
36
|
var contentDiv = ['div', {
|
|
@@ -38,7 +38,7 @@ var panelAttrsToDom = function panelAttrsToDom(attrs, allowCustomPanel) {
|
|
|
38
38
|
}, 0];
|
|
39
39
|
|
|
40
40
|
if (hasIcon) {
|
|
41
|
-
return ['div', panelAttrs,
|
|
41
|
+
return ['div', panelAttrs, iconDiv, contentDiv];
|
|
42
42
|
} else {
|
|
43
43
|
return ['div', panelAttrs, contentDiv];
|
|
44
44
|
}
|
|
@@ -7,9 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _adfSchema = require("@atlaskit/adf-schema");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _linkifyIt = _interopRequireDefault(require("linkify-it"));
|
|
13
13
|
|
|
14
14
|
// modified version of the original Linkify plugin
|
|
15
15
|
// https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js
|
|
@@ -68,7 +68,7 @@ var linkify = function linkify(state) {
|
|
|
68
68
|
|
|
69
69
|
if (currentToken.type === 'text' && linkify.test(currentToken.content)) {
|
|
70
70
|
var text = currentToken.content;
|
|
71
|
-
var links = (0,
|
|
71
|
+
var links = (0, _adfSchema.linkifyMatch)(text);
|
|
72
72
|
|
|
73
73
|
if (!links.length) {
|
|
74
74
|
links = linkify.match(text) || [];
|
|
@@ -17,5 +17,5 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
17
17
|
|
|
18
18
|
var _templateObject;
|
|
19
19
|
|
|
20
|
-
var statusStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n > span {\n display: inline-block;\n cursor: pointer;\n line-height: 0; /* Prevent responsive layouts increasing height of container. */\n }\n\n &.", "\n .", "\n > span {\n ", "\n }\n }\n\n .danger {\n .", " > span {\n background-color: ", ";\n }\n\n .", ".", "\n .", "\n > span {\n box-shadow: 0 0 0 ", "px ", ";\n }\n }\n"])), _editorCommon.StatusSharedCssClassName.STATUS_CONTAINER, _editorSharedStyles.akEditorSelectedNodeClassName, _editorCommon.StatusSharedCssClassName.STATUS_LOZENGE, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _editorCommon.StatusSharedCssClassName.STATUS_LOZENGE, _editorSharedStyles.akEditorDeleteBackgroundWithOpacity, _editorCommon.StatusSharedCssClassName.STATUS_CONTAINER, _editorSharedStyles.akEditorSelectedNodeClassName, _editorCommon.StatusSharedCssClassName.STATUS_LOZENGE, _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder);
|
|
20
|
+
var statusStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n display: inline-block;\n\n > span {\n display: inline-block;\n cursor: pointer;\n line-height: 0; /* Prevent responsive layouts increasing height of container. */\n }\n\n &.", "\n .", "\n > span {\n ", "\n }\n }\n\n .danger {\n .", " > span {\n background-color: ", ";\n }\n\n .", ".", "\n .", "\n > span {\n box-shadow: 0 0 0 ", "px ", ";\n }\n }\n"])), _editorCommon.StatusSharedCssClassName.STATUS_CONTAINER, _editorSharedStyles.akEditorSelectedNodeClassName, _editorCommon.StatusSharedCssClassName.STATUS_LOZENGE, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _editorCommon.StatusSharedCssClassName.STATUS_LOZENGE, _editorSharedStyles.akEditorDeleteBackgroundWithOpacity, _editorCommon.StatusSharedCssClassName.STATUS_CONTAINER, _editorSharedStyles.akEditorSelectedNodeClassName, _editorCommon.StatusSharedCssClassName.STATUS_LOZENGE, _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder);
|
|
21
21
|
exports.statusStyles = statusStyles;
|
|
@@ -498,10 +498,26 @@ var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
498
498
|
* so it should be safe to ignore mutations that we cause
|
|
499
499
|
* by updating styles and classnames on this DOM element
|
|
500
500
|
*
|
|
501
|
-
* Update: should
|
|
501
|
+
* Update: should not ignore mutations for row selection to avoid known issue with table selection highlight in firefox
|
|
502
502
|
* Related bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1289673
|
|
503
503
|
* */
|
|
504
|
-
|
|
504
|
+
var isTableSelection = mutationRecord.type === 'selection' && mutationRecord.target.nodeName === 'TR';
|
|
505
|
+
/**
|
|
506
|
+
* Update: should not ignore mutations when an node is added, as this interferes with
|
|
507
|
+
* prosemirrors handling of some language inputs in Safari (ie. Pinyin, Hiragana).
|
|
508
|
+
*
|
|
509
|
+
* In paticular, when a composition occurs at the start of the first node inside a table cell, if the resulting mutation
|
|
510
|
+
* from the composition end is ignored than prosemirror will end up with; invalid table markup nesting and a misplaced
|
|
511
|
+
* selection and insertion.
|
|
512
|
+
*/
|
|
513
|
+
|
|
514
|
+
var isNodeInsertion = mutationRecord.type === 'childList' && mutationRecord.target.nodeName === 'TR' && mutationRecord.addedNodes.length;
|
|
515
|
+
|
|
516
|
+
if (isTableSelection || isNodeInsertion) {
|
|
517
|
+
return false;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
return true;
|
|
505
521
|
}
|
|
506
522
|
/* receive external events */
|
|
507
523
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.RenderCountProfiler = exports.ProfiledComponentIds = void 0;
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
|
|
14
|
+
var _uuid = _interopRequireDefault(require("uuid"));
|
|
15
|
+
|
|
16
|
+
var _useComponentRendererTracking = require("../utils/react-hooks/use-component-renderer-tracking");
|
|
17
|
+
|
|
18
|
+
var _editorCommon = require("@atlaskit/editor-common");
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
var ProfiledComponentIds;
|
|
25
|
+
exports.ProfiledComponentIds = ProfiledComponentIds;
|
|
26
|
+
|
|
27
|
+
(function (ProfiledComponentIds) {
|
|
28
|
+
ProfiledComponentIds["editor"] = "Editor";
|
|
29
|
+
ProfiledComponentIds["appearance"] = "FullPageEditor";
|
|
30
|
+
ProfiledComponentIds["reactEditorView"] = "ReactEditorView";
|
|
31
|
+
ProfiledComponentIds["contentArea"] = "FullPageContentArea";
|
|
32
|
+
ProfiledComponentIds["toolbar"] = "FullPageToolbar";
|
|
33
|
+
ProfiledComponentIds["mention"] = "MentionNodeView";
|
|
34
|
+
})(ProfiledComponentIds || (exports.ProfiledComponentIds = ProfiledComponentIds = {}));
|
|
35
|
+
|
|
36
|
+
var CoreRenderCountProfiler = function CoreRenderCountProfiler(_ref) {
|
|
37
|
+
var componentId = _ref.componentId;
|
|
38
|
+
|
|
39
|
+
var _useRef = (0, _react.useRef)((0, _uuid.default)()),
|
|
40
|
+
instanceId = _useRef.current;
|
|
41
|
+
|
|
42
|
+
var onRender = function onRender(_ref2) {
|
|
43
|
+
var renderCount = _ref2.renderCount;
|
|
44
|
+
|
|
45
|
+
var profiler = _editorCommon.RenderCountProfiler.getInstance({
|
|
46
|
+
store: window
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
profiler.setRenderCount({
|
|
50
|
+
componentId: componentId,
|
|
51
|
+
instanceId: instanceId,
|
|
52
|
+
renderCount: renderCount
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
(0, _useComponentRendererTracking.useComponentRenderTracking)({
|
|
57
|
+
onRender: onRender,
|
|
58
|
+
propsDiffingOptions: {
|
|
59
|
+
enabled: false
|
|
60
|
+
},
|
|
61
|
+
zeroBasedCount: false
|
|
62
|
+
});
|
|
63
|
+
return null;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
var RenderCountProfiler = function RenderCountProfiler(_ref3) {
|
|
67
|
+
var componentId = _ref3.componentId;
|
|
68
|
+
|
|
69
|
+
var profiler = _editorCommon.RenderCountProfiler.getInstance({
|
|
70
|
+
store: window
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
if (profiler.isEnabled()) {
|
|
74
|
+
return /*#__PURE__*/_react.default.createElement(CoreRenderCountProfiler, {
|
|
75
|
+
componentId: componentId
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return null;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
exports.RenderCountProfiler = RenderCountProfiler;
|
|
@@ -78,12 +78,12 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
78
78
|
var CommentEditorMargin = 14;
|
|
79
79
|
var CommentEditorSmallerMargin = 8;
|
|
80
80
|
|
|
81
|
-
var CommentEditor = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n\n .less-margin .ProseMirror {\n margin: 12px ", "px ", "px;\n }\n\n min-width: 272px;\n /* Border + Toolbar + Footer + (Paragraph + ((Parahraph + Margin) * (DefaultLines - 1)) */\n /* calc(2px + 40px + 24px + ( 20px + (32px * 2))) */\n min-height: 150px;\n height: auto;\n
|
|
82
|
-
return props.maxHeight ? 'max-height: ' + props.maxHeight + 'px;' : '';
|
|
83
|
-
}, _colors.N40, (0, _constants.borderRadius)());
|
|
81
|
+
var CommentEditor = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n\n .less-margin .ProseMirror {\n margin: 12px ", "px ", "px;\n }\n\n min-width: 272px;\n /* Border + Toolbar + Footer + (Paragraph + ((Parahraph + Margin) * (DefaultLines - 1)) */\n /* calc(2px + 40px + 24px + ( 20px + (32px * 2))) */\n min-height: 150px;\n height: auto;\n background-color: white;\n border: 1px solid ", ";\n box-sizing: border-box;\n border-radius: ", "px;\n\n max-width: inherit;\n word-wrap: break-word;\n"])), CommentEditorSmallerMargin, CommentEditorSmallerMargin, _colors.N40, (0, _constants.borderRadius)());
|
|
84
82
|
|
|
85
83
|
CommentEditor.displayName = 'CommentEditor';
|
|
86
|
-
var ContentArea = (0, _styledComponents.default)(_ContentStyles.default)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n flex-grow: 1;\n overflow-x: hidden;\n overflow-y: auto;\n line-height: 24px;\n\n /** Hack for Bitbucket to ensure entire editorView gets drop event; see ED-3294 **/\n /** Hack for tables controlls. Otherwise marging collapse and controlls are misplaced. **/\n .ProseMirror {\n margin: 12px ", "px ", "px;\n }\n\n .gridParent {\n margin-left: ", "px;\n margin-right: ", "px;\n width: calc(100% + ", "px);\n }\n\n padding: ", "px;\n\n ", ";\n"])),
|
|
84
|
+
var ContentArea = (0, _styledComponents.default)(_ContentStyles.default)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n flex-grow: 1;\n overflow-x: hidden;\n overflow-y: auto;\n line-height: 24px;\n ", ";\n\n /** Hack for Bitbucket to ensure entire editorView gets drop event; see ED-3294 **/\n /** Hack for tables controlls. Otherwise marging collapse and controlls are misplaced. **/\n .ProseMirror {\n margin: 12px ", "px ", "px;\n }\n\n .gridParent {\n margin-left: ", "px;\n margin-right: ", "px;\n width: calc(100% + ", "px);\n }\n\n padding: ", "px;\n\n ", ";\n"])), function (props) {
|
|
85
|
+
return props.maxHeight ? 'max-height: ' + props.maxHeight + 'px;' : '';
|
|
86
|
+
}, CommentEditorMargin, CommentEditorMargin, CommentEditorMargin - _grid.GRID_GUTTER, CommentEditorMargin - _grid.GRID_GUTTER, CommentEditorMargin - _grid.GRID_GUTTER, _Toolbar2.TableControlsPadding, _commonStyles.tableCommentEditorStyles);
|
|
87
87
|
ContentArea.displayName = 'ContentArea';
|
|
88
88
|
|
|
89
89
|
var SecondaryToolbar = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n box-sizing: border-box;\n justify-content: flex-end;\n align-items: center;\n display: flex;\n padding: 12px 1px;\n"])));
|
|
@@ -173,7 +173,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
173
173
|
},
|
|
174
174
|
className: (0, _classnames.default)('ak-editor-content-area', {
|
|
175
175
|
'less-margin': width < _editorSharedStyles.akEditorMobileBreakoutPoint
|
|
176
|
-
})
|
|
176
|
+
}),
|
|
177
|
+
maxHeight: maxHeight
|
|
177
178
|
}, customContentComponents, /*#__PURE__*/_react.default.createElement(_PluginSlot.default, {
|
|
178
179
|
editorView: editorView,
|
|
179
180
|
editorActions: editorActions,
|