@atlaskit/editor-core 188.10.4 → 188.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/create-editor/ReactEditorView.js +3 -4
- package/dist/cjs/create-editor/create-editor.js +3 -6
- package/dist/cjs/create-editor/feature-flags-from-props.js +7 -9
- package/dist/cjs/labs/next/presets/universal.js +2 -1
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/utils/performance/instrumented-plugin.js +4 -10
- package/dist/cjs/utils/performance/safer-transactions.js +2 -5
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +3 -4
- package/dist/es2019/create-editor/create-editor.js +3 -6
- package/dist/es2019/create-editor/feature-flags-from-props.js +7 -9
- package/dist/es2019/labs/next/presets/universal.js +2 -1
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/utils/performance/instrumented-plugin.js +4 -8
- package/dist/es2019/utils/performance/safer-transactions.js +2 -5
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +3 -4
- package/dist/esm/create-editor/create-editor.js +3 -6
- package/dist/esm/create-editor/feature-flags-from-props.js +7 -9
- package/dist/esm/labs/next/presets/universal.js +2 -1
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/utils/performance/instrumented-plugin.js +4 -10
- package/dist/esm/utils/performance/safer-transactions.js +2 -5
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/insert-block/types.d.ts +2 -4
- package/dist/types/types/editor-props.d.ts +1 -1
- package/dist/types/utils/performance/instrumented-plugin.d.ts +0 -3
- package/dist/types/utils/performance/safer-transactions.d.ts +1 -2
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +2 -4
- package/dist/types-ts4.5/types/editor-props.d.ts +1 -1
- package/dist/types-ts4.5/utils/performance/instrumented-plugin.d.ts +0 -3
- package/dist/types-ts4.5/utils/performance/safer-transactions.d.ts +1 -2
- package/package.json +2 -2
- package/report.api.md +1 -9
- package/tmp/api-report-tmp.d.ts +1 -9
- package/dist/cjs/plugins/mentions/analytics.js +0 -157
- package/dist/cjs/plugins/mentions/index.js +0 -142
- package/dist/cjs/plugins/mentions/messages.js +0 -29
- package/dist/cjs/plugins/mentions/nodeviews/mention.js +0 -117
- package/dist/cjs/plugins/mentions/pm-plugins/key.js +0 -8
- package/dist/cjs/plugins/mentions/pm-plugins/main.js +0 -156
- package/dist/cjs/plugins/mentions/pm-plugins/utils.js +0 -23
- package/dist/cjs/plugins/mentions/type-ahead/index.js +0 -362
- package/dist/cjs/plugins/mentions/types.js +0 -5
- package/dist/cjs/plugins/mentions/ui/InviteItem/index.js +0 -76
- package/dist/cjs/plugins/mentions/ui/InviteItem/styles.js +0 -19
- package/dist/cjs/plugins/mentions/ui/Mention/index.js +0 -98
- package/dist/cjs/plugins/mentions/ui/ToolbarMention/index.js +0 -63
- package/dist/cjs/plugins/mentions/utils.js +0 -32
- package/dist/es2019/plugins/mentions/analytics.js +0 -147
- package/dist/es2019/plugins/mentions/index.js +0 -124
- package/dist/es2019/plugins/mentions/messages.js +0 -23
- package/dist/es2019/plugins/mentions/nodeviews/mention.js +0 -80
- package/dist/es2019/plugins/mentions/pm-plugins/key.js +0 -2
- package/dist/es2019/plugins/mentions/pm-plugins/main.js +0 -143
- package/dist/es2019/plugins/mentions/pm-plugins/utils.js +0 -14
- package/dist/es2019/plugins/mentions/type-ahead/index.js +0 -338
- package/dist/es2019/plugins/mentions/types.js +0 -1
- package/dist/es2019/plugins/mentions/ui/InviteItem/index.js +0 -66
- package/dist/es2019/plugins/mentions/ui/InviteItem/styles.js +0 -47
- package/dist/es2019/plugins/mentions/ui/Mention/index.js +0 -71
- package/dist/es2019/plugins/mentions/ui/ToolbarMention/index.js +0 -33
- package/dist/es2019/plugins/mentions/utils.js +0 -20
- package/dist/esm/plugins/mentions/analytics.js +0 -150
- package/dist/esm/plugins/mentions/index.js +0 -130
- package/dist/esm/plugins/mentions/messages.js +0 -23
- package/dist/esm/plugins/mentions/nodeviews/mention.js +0 -107
- package/dist/esm/plugins/mentions/pm-plugins/key.js +0 -2
- package/dist/esm/plugins/mentions/pm-plugins/main.js +0 -148
- package/dist/esm/plugins/mentions/pm-plugins/utils.js +0 -16
- package/dist/esm/plugins/mentions/type-ahead/index.js +0 -350
- package/dist/esm/plugins/mentions/types.js +0 -1
- package/dist/esm/plugins/mentions/ui/InviteItem/index.js +0 -65
- package/dist/esm/plugins/mentions/ui/InviteItem/styles.js +0 -12
- package/dist/esm/plugins/mentions/ui/Mention/index.js +0 -91
- package/dist/esm/plugins/mentions/ui/ToolbarMention/index.js +0 -53
- package/dist/esm/plugins/mentions/utils.js +0 -26
- package/dist/types/plugins/mentions/analytics.d.ts +0 -13
- package/dist/types/plugins/mentions/index.d.ts +0 -19
- package/dist/types/plugins/mentions/messages.d.ts +0 -22
- package/dist/types/plugins/mentions/nodeviews/mention.d.ts +0 -9
- package/dist/types/plugins/mentions/pm-plugins/key.d.ts +0 -3
- package/dist/types/plugins/mentions/pm-plugins/main.d.ts +0 -6
- package/dist/types/plugins/mentions/pm-plugins/utils.d.ts +0 -4
- package/dist/types/plugins/mentions/type-ahead/index.d.ts +0 -17
- package/dist/types/plugins/mentions/types.d.ts +0 -24
- package/dist/types/plugins/mentions/ui/InviteItem/index.d.ts +0 -22
- package/dist/types/plugins/mentions/ui/InviteItem/styles.d.ts +0 -8
- package/dist/types/plugins/mentions/ui/Mention/index.d.ts +0 -19
- package/dist/types/plugins/mentions/ui/ToolbarMention/index.d.ts +0 -13
- package/dist/types/plugins/mentions/utils.d.ts +0 -8
- package/dist/types-ts4.5/plugins/mentions/analytics.d.ts +0 -13
- package/dist/types-ts4.5/plugins/mentions/index.d.ts +0 -22
- package/dist/types-ts4.5/plugins/mentions/messages.d.ts +0 -22
- package/dist/types-ts4.5/plugins/mentions/nodeviews/mention.d.ts +0 -9
- package/dist/types-ts4.5/plugins/mentions/pm-plugins/key.d.ts +0 -3
- package/dist/types-ts4.5/plugins/mentions/pm-plugins/main.d.ts +0 -6
- package/dist/types-ts4.5/plugins/mentions/pm-plugins/utils.d.ts +0 -4
- package/dist/types-ts4.5/plugins/mentions/type-ahead/index.d.ts +0 -17
- package/dist/types-ts4.5/plugins/mentions/types.d.ts +0 -24
- package/dist/types-ts4.5/plugins/mentions/ui/InviteItem/index.d.ts +0 -22
- package/dist/types-ts4.5/plugins/mentions/ui/InviteItem/styles.d.ts +0 -8
- package/dist/types-ts4.5/plugins/mentions/ui/Mention/index.d.ts +0 -19
- package/dist/types-ts4.5/plugins/mentions/ui/ToolbarMention/index.d.ts +0 -13
- package/dist/types-ts4.5/plugins/mentions/utils.d.ts +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 188.10.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#41648](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41648) [`20f43769aa7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/20f43769aa7) - [ED-19746] Extract mentions plugin from editor-core to its own package: @atlaskit/editor-plugin-mentions
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 188.10.5
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#41549](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41549) [`2b9597a3f14`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2b9597a3f14) - ESS-3896-remove-safer-dispatch-transaction-FF
|
|
15
|
+
|
|
3
16
|
## 188.10.4
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -275,11 +275,10 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
|
|
|
275
275
|
}
|
|
276
276
|
var nodes = (0, _nodes.findChangedNodesFromTransaction)(unsafeTransaction);
|
|
277
277
|
var changedNodesValid = (0, _nodes.validateNodes)(nodes);
|
|
278
|
-
var transaction =
|
|
278
|
+
var transaction = new Proxy(unsafeTransaction, (0, _saferTransactions.freezeUnsafeTransactionProperties)({
|
|
279
279
|
dispatchAnalyticsEvent: _this.dispatchAnalyticsEvent,
|
|
280
|
-
pluginKey: 'unknown-reacteditorview'
|
|
281
|
-
|
|
282
|
-
})) : unsafeTransaction;
|
|
280
|
+
pluginKey: 'unknown-reacteditorview'
|
|
281
|
+
}));
|
|
283
282
|
if (changedNodesValid) {
|
|
284
283
|
var oldEditorState = _this.view.state;
|
|
285
284
|
|
|
@@ -101,15 +101,14 @@ function createPMPlugins(config) {
|
|
|
101
101
|
_config$performanceTr = config.performanceTracking,
|
|
102
102
|
performanceTracking = _config$performanceTr === void 0 ? {} : _config$performanceTr,
|
|
103
103
|
transactionTracker = config.transactionTracker,
|
|
104
|
-
featureFlags = config.featureFlags,
|
|
105
104
|
dispatchAnalyticsEvent = config.dispatchAnalyticsEvent;
|
|
106
105
|
var _performanceTracking$ = performanceTracking.uiTracking,
|
|
107
106
|
uiTracking = _performanceTracking$ === void 0 ? TRACKING_DEFAULT : _performanceTracking$,
|
|
108
107
|
_performanceTracking$2 = performanceTracking.transactionTracking,
|
|
109
108
|
transactionTracking = _performanceTracking$2 === void 0 ? TRACKING_DEFAULT : _performanceTracking$2;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
var useInstrumentedPlugin = uiTracking.enabled || transactionTracking.enabled ||
|
|
109
|
+
|
|
110
|
+
// TO-DO need to question editor team about this condition true here
|
|
111
|
+
var useInstrumentedPlugin = uiTracking.enabled || transactionTracking.enabled || true;
|
|
113
112
|
if (process.env.NODE_ENV === 'development' && transactionTracking.enabled && !transactionTracker) {
|
|
114
113
|
// eslint-disable-next-line no-console
|
|
115
114
|
console.warn('createPMPlugins(): tracking is turned on but transactionTracker not defined! Transaction tracking has been disabled');
|
|
@@ -118,8 +117,6 @@ function createPMPlugins(config) {
|
|
|
118
117
|
return _instrumentedPlugin.InstrumentedPlugin.fromPlugin(plugin, {
|
|
119
118
|
uiTracking: uiTracking,
|
|
120
119
|
transactionTracking: transactionTracking,
|
|
121
|
-
saferDispatchedTransactions: saferDispatchedTransactions,
|
|
122
|
-
saferDispatchedTransactionsAnalyticsOnly: saferDispatchedTransactionsAnalyticsOnly,
|
|
123
120
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
124
121
|
}, transactionTracker);
|
|
125
122
|
} : function (plugin) {
|
|
@@ -32,7 +32,7 @@ function getSpellCheck(featureFlags) {
|
|
|
32
32
|
* which is used by both current and archv3 editors.
|
|
33
33
|
*/
|
|
34
34
|
function createFeatureFlagsFromProps(props) {
|
|
35
|
-
var _props$allowLayouts, _props$performanceTra, _props$allowExtension, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$
|
|
35
|
+
var _props$allowLayouts, _props$performanceTra, _props$allowExtension, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$collabEdit, _props$collabEdit2, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23;
|
|
36
36
|
var normalizedFeatureFlags = (0, _normalizeFeatureFlags.normalizeFeatureFlags)(props.featureFlags);
|
|
37
37
|
return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
|
|
38
38
|
newInsertionBehaviour: props.allowNewInsertionBehaviour,
|
|
@@ -52,18 +52,16 @@ function createFeatureFlagsFromProps(props) {
|
|
|
52
52
|
collabAvatarScroll: Boolean(typeof ((_props$featureFlags9 = props.featureFlags) === null || _props$featureFlags9 === void 0 ? void 0 : _props$featureFlags9.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags10 = props.featureFlags) !== null && _props$featureFlags10 !== void 0 && _props$featureFlags10.collabAvatarScroll) : false),
|
|
53
53
|
ufo: Boolean(typeof ((_props$featureFlags11 = props.featureFlags) === null || _props$featureFlags11 === void 0 ? void 0 : _props$featureFlags11.ufo) === 'boolean' ? !!((_props$featureFlags12 = props.featureFlags) !== null && _props$featureFlags12 !== void 0 && _props$featureFlags12.ufo) : false),
|
|
54
54
|
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags13 = props.featureFlags) === null || _props$featureFlags13 === void 0 ? void 0 : _props$featureFlags13.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags14 = props.featureFlags) !== null && _props$featureFlags14 !== void 0 && _props$featureFlags14.twoLineEditorToolbar) : false),
|
|
55
|
-
saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags15 = props.featureFlags) === null || _props$featureFlags15 === void 0 ? void 0 : _props$featureFlags15.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags16 = props.featureFlags) !== null && _props$featureFlags16 !== void 0 && _props$featureFlags16.saferDispatchedTransactions) : false)),
|
|
56
|
-
saferDispatchedTransactionsAnalyticsOnly: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly || (typeof ((_props$featureFlags17 = props.featureFlags) === null || _props$featureFlags17 === void 0 ? void 0 : _props$featureFlags17.saferDispatchedTransactionsAnalyticsOnly) === 'boolean' ? !!((_props$featureFlags18 = props.featureFlags) !== null && _props$featureFlags18 !== void 0 && _props$featureFlags18.saferDispatchedTransactionsAnalyticsOnly) : false)),
|
|
57
55
|
useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
|
|
58
|
-
chromeCursorHandlerFixedVersion: typeof ((_props$
|
|
59
|
-
showHoverPreview: Boolean(typeof ((_props$
|
|
60
|
-
indentationButtonsInTheToolbar: typeof props.showIndentationButtons === 'boolean' ? props.showIndentationButtons : Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$
|
|
61
|
-
floatingToolbarLinkSettingsButton: typeof ((_props$
|
|
56
|
+
chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags15 = props.featureFlags) === null || _props$featureFlags15 === void 0 ? void 0 : _props$featureFlags15.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
|
|
57
|
+
showHoverPreview: Boolean(typeof ((_props$featureFlags16 = props.featureFlags) === null || _props$featureFlags16 === void 0 ? void 0 : _props$featureFlags16.showHoverPreview) === 'boolean' ? !!((_props$featureFlags17 = props.featureFlags) !== null && _props$featureFlags17 !== void 0 && _props$featureFlags17.showHoverPreview) : false),
|
|
58
|
+
indentationButtonsInTheToolbar: typeof props.showIndentationButtons === 'boolean' ? props.showIndentationButtons : Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags19 = props.featureFlags) !== null && _props$featureFlags19 !== void 0 && _props$featureFlags19.indentationButtonsInTheToolbar) : false)),
|
|
59
|
+
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
62
60
|
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
|
|
63
61
|
// Including fallback to props.featureFlags so that mobile feature flags
|
|
64
62
|
// are included (they are not kebab cased)
|
|
65
|
-
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$
|
|
63
|
+
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags21 = props.featureFlags) === null || _props$featureFlags21 === void 0 ? void 0 : _props$featureFlags21.restartNumberedLists) === true,
|
|
66
64
|
lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
|
|
67
|
-
preventPopupOverflow: Boolean(typeof ((_props$
|
|
65
|
+
preventPopupOverflow: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23['prevent-popup-overflow']) : false)
|
|
68
66
|
});
|
|
69
67
|
}
|
|
@@ -27,6 +27,7 @@ var _editorPluginContentInsertion = require("@atlaskit/editor-plugin-content-ins
|
|
|
27
27
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
28
28
|
var _editorPluginSaveOnEnter = require("@atlaskit/editor-plugin-save-on-enter");
|
|
29
29
|
var _editorPluginScrollIntoView = require("@atlaskit/editor-plugin-scroll-into-view");
|
|
30
|
+
var _editorPluginMentions = require("@atlaskit/editor-plugin-mentions");
|
|
30
31
|
var _isFullPage = require("../../../utils/is-full-page");
|
|
31
32
|
var _mediaCommon = require("@atlaskit/media-common");
|
|
32
33
|
var _default = require("./default");
|
|
@@ -139,7 +140,7 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
139
140
|
return builder.add(plugin);
|
|
140
141
|
}
|
|
141
142
|
return builder;
|
|
142
|
-
}).maybeAdd(
|
|
143
|
+
}).maybeAdd(_editorPluginMentions.mentionsPlugin, function (plugin, builder) {
|
|
143
144
|
if (props.mentionProvider) {
|
|
144
145
|
var _props$mention$insert, _props$mention, _props$mention2;
|
|
145
146
|
return builder.add([plugin, {
|
|
@@ -173,12 +173,6 @@ Object.defineProperty(exports, "maxContentSizePlugin", {
|
|
|
173
173
|
return _maxContentSize.default;
|
|
174
174
|
}
|
|
175
175
|
});
|
|
176
|
-
Object.defineProperty(exports, "mentionsPlugin", {
|
|
177
|
-
enumerable: true,
|
|
178
|
-
get: function get() {
|
|
179
|
-
return _mentions.default;
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
176
|
Object.defineProperty(exports, "mobileDimensionsPlugin", {
|
|
183
177
|
enumerable: true,
|
|
184
178
|
get: function get() {
|
|
@@ -258,7 +252,6 @@ var _layout = _interopRequireDefault(require("./layout"));
|
|
|
258
252
|
var _toolbarListsIndentation = _interopRequireDefault(require("./toolbar-lists-indentation"));
|
|
259
253
|
var _macro = _interopRequireDefault(require("./macro"));
|
|
260
254
|
var _maxContentSize = _interopRequireDefault(require("./max-content-size"));
|
|
261
|
-
var _mentions = _interopRequireDefault(require("./mentions"));
|
|
262
255
|
var _panel = _interopRequireDefault(require("./panel"));
|
|
263
256
|
var _paste = _interopRequireDefault(require("./paste"));
|
|
264
257
|
var _placeholderText = _interopRequireDefault(require("./placeholder-text"));
|
|
@@ -32,21 +32,15 @@ var InstrumentedPlugin = exports.InstrumentedPlugin = /*#__PURE__*/function (_Sa
|
|
|
32
32
|
uiTracking = _options$uiTracking === void 0 ? {
|
|
33
33
|
enabled: false
|
|
34
34
|
} : _options$uiTracking,
|
|
35
|
-
_options$saferDispatc = options.saferDispatchedTransactions,
|
|
36
|
-
saferDispatchedTransactions = _options$saferDispatc === void 0 ? false : _options$saferDispatc,
|
|
37
|
-
_options$saferDispatc2 = options.saferDispatchedTransactionsAnalyticsOnly,
|
|
38
|
-
saferDispatchedTransactionsAnalyticsOnly = _options$saferDispatc2 === void 0 ? false : _options$saferDispatc2,
|
|
39
35
|
dispatchAnalyticsEvent = options.dispatchAnalyticsEvent;
|
|
40
|
-
|
|
41
|
-
if (shouldOverrideApply && spec.state) {
|
|
36
|
+
if (spec.state) {
|
|
42
37
|
var originalApply = spec.state.apply.bind(spec.state);
|
|
43
38
|
spec.state.apply = function (aTr, value, oldState, newState) {
|
|
44
39
|
var self = (0, _assertThisInitialized2.default)(_this);
|
|
45
|
-
var tr =
|
|
40
|
+
var tr = new Proxy(aTr, (0, _saferTransactions.freezeUnsafeTransactionProperties)({
|
|
46
41
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
47
|
-
pluginKey: self.key
|
|
48
|
-
|
|
49
|
-
})) : aTr;
|
|
42
|
+
pluginKey: self.key
|
|
43
|
+
}));
|
|
50
44
|
var shouldTrackTransactions = transactionTracker === null || transactionTracker === void 0 ? void 0 : transactionTracker.shouldTrackTransaction(transactionTracking);
|
|
51
45
|
if (!shouldTrackTransactions || !transactionTracker) {
|
|
52
46
|
return originalApply(tr, value, oldState, newState);
|
|
@@ -16,8 +16,7 @@ var isReadOnlyProperty = function isReadOnlyProperty(prop) {
|
|
|
16
16
|
};
|
|
17
17
|
var freezeUnsafeTransactionProperties = exports.freezeUnsafeTransactionProperties = function freezeUnsafeTransactionProperties(_ref) {
|
|
18
18
|
var dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
|
|
19
|
-
pluginKey = _ref.pluginKey
|
|
20
|
-
analyticsOnly = _ref.analyticsOnly;
|
|
19
|
+
pluginKey = _ref.pluginKey;
|
|
21
20
|
var isUnsafe = function isUnsafe() {
|
|
22
21
|
if (dispatchAnalyticsEvent) {
|
|
23
22
|
dispatchAnalyticsEvent({
|
|
@@ -32,9 +31,7 @@ var freezeUnsafeTransactionProperties = exports.freezeUnsafeTransactionPropertie
|
|
|
32
31
|
}
|
|
33
32
|
});
|
|
34
33
|
}
|
|
35
|
-
|
|
36
|
-
throw new Error(UNSAFE_PROPERTY_SET_ERROR);
|
|
37
|
-
}
|
|
34
|
+
throw new Error(UNSAFE_PROPERTY_SET_ERROR);
|
|
38
35
|
};
|
|
39
36
|
return {
|
|
40
37
|
get: function get(target, prop, receiver) {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = exports.name = "@atlaskit/editor-core";
|
|
8
|
-
var version = exports.version = "188.10.
|
|
8
|
+
var version = exports.version = "188.10.7";
|
|
9
9
|
var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
|
|
10
10
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
11
11
|
};
|
|
@@ -276,11 +276,10 @@ export class ReactEditorView extends React.Component {
|
|
|
276
276
|
}
|
|
277
277
|
const nodes = findChangedNodesFromTransaction(unsafeTransaction);
|
|
278
278
|
const changedNodesValid = validateNodes(nodes);
|
|
279
|
-
const transaction =
|
|
279
|
+
const transaction = new Proxy(unsafeTransaction, freezeUnsafeTransactionProperties({
|
|
280
280
|
dispatchAnalyticsEvent: this.dispatchAnalyticsEvent,
|
|
281
|
-
pluginKey: 'unknown-reacteditorview'
|
|
282
|
-
|
|
283
|
-
})) : unsafeTransaction;
|
|
281
|
+
pluginKey: 'unknown-reacteditorview'
|
|
282
|
+
}));
|
|
284
283
|
if (changedNodesValid) {
|
|
285
284
|
const oldEditorState = this.view.state;
|
|
286
285
|
|
|
@@ -82,16 +82,15 @@ export function createPMPlugins(config) {
|
|
|
82
82
|
editorConfig,
|
|
83
83
|
performanceTracking = {},
|
|
84
84
|
transactionTracker,
|
|
85
|
-
featureFlags,
|
|
86
85
|
dispatchAnalyticsEvent
|
|
87
86
|
} = config;
|
|
88
87
|
const {
|
|
89
88
|
uiTracking = TRACKING_DEFAULT,
|
|
90
89
|
transactionTracking = TRACKING_DEFAULT
|
|
91
90
|
} = performanceTracking;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const useInstrumentedPlugin = uiTracking.enabled || transactionTracking.enabled ||
|
|
91
|
+
|
|
92
|
+
// TO-DO need to question editor team about this condition true here
|
|
93
|
+
const useInstrumentedPlugin = uiTracking.enabled || transactionTracking.enabled || true;
|
|
95
94
|
if (process.env.NODE_ENV === 'development' && transactionTracking.enabled && !transactionTracker) {
|
|
96
95
|
// eslint-disable-next-line no-console
|
|
97
96
|
console.warn('createPMPlugins(): tracking is turned on but transactionTracker not defined! Transaction tracking has been disabled');
|
|
@@ -99,8 +98,6 @@ export function createPMPlugins(config) {
|
|
|
99
98
|
const instrumentPlugin = useInstrumentedPlugin ? plugin => InstrumentedPlugin.fromPlugin(plugin, {
|
|
100
99
|
uiTracking,
|
|
101
100
|
transactionTracking,
|
|
102
|
-
saferDispatchedTransactions,
|
|
103
|
-
saferDispatchedTransactionsAnalyticsOnly,
|
|
104
101
|
dispatchAnalyticsEvent
|
|
105
102
|
}, transactionTracker) : plugin => plugin;
|
|
106
103
|
return editorConfig.pmPlugins.sort(sortByOrder('plugins')).map(({
|
|
@@ -21,7 +21,7 @@ function getSpellCheck(featureFlags) {
|
|
|
21
21
|
* which is used by both current and archv3 editors.
|
|
22
22
|
*/
|
|
23
23
|
export function createFeatureFlagsFromProps(props) {
|
|
24
|
-
var _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$allowExtension, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$
|
|
24
|
+
var _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$allowExtension, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$collabEdit, _props$collabEdit2, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23;
|
|
25
25
|
const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
26
26
|
return {
|
|
27
27
|
...normalizedFeatureFlags,
|
|
@@ -42,18 +42,16 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
42
42
|
collabAvatarScroll: Boolean(typeof ((_props$featureFlags9 = props.featureFlags) === null || _props$featureFlags9 === void 0 ? void 0 : _props$featureFlags9.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags10 = props.featureFlags) !== null && _props$featureFlags10 !== void 0 && _props$featureFlags10.collabAvatarScroll) : false),
|
|
43
43
|
ufo: Boolean(typeof ((_props$featureFlags11 = props.featureFlags) === null || _props$featureFlags11 === void 0 ? void 0 : _props$featureFlags11.ufo) === 'boolean' ? !!((_props$featureFlags12 = props.featureFlags) !== null && _props$featureFlags12 !== void 0 && _props$featureFlags12.ufo) : false),
|
|
44
44
|
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags13 = props.featureFlags) === null || _props$featureFlags13 === void 0 ? void 0 : _props$featureFlags13.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags14 = props.featureFlags) !== null && _props$featureFlags14 !== void 0 && _props$featureFlags14.twoLineEditorToolbar) : false),
|
|
45
|
-
saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags15 = props.featureFlags) === null || _props$featureFlags15 === void 0 ? void 0 : _props$featureFlags15.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags16 = props.featureFlags) !== null && _props$featureFlags16 !== void 0 && _props$featureFlags16.saferDispatchedTransactions) : false)),
|
|
46
|
-
saferDispatchedTransactionsAnalyticsOnly: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly || (typeof ((_props$featureFlags17 = props.featureFlags) === null || _props$featureFlags17 === void 0 ? void 0 : _props$featureFlags17.saferDispatchedTransactionsAnalyticsOnly) === 'boolean' ? !!((_props$featureFlags18 = props.featureFlags) !== null && _props$featureFlags18 !== void 0 && _props$featureFlags18.saferDispatchedTransactionsAnalyticsOnly) : false)),
|
|
47
45
|
useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
|
|
48
|
-
chromeCursorHandlerFixedVersion: typeof ((_props$
|
|
49
|
-
showHoverPreview: Boolean(typeof ((_props$
|
|
50
|
-
indentationButtonsInTheToolbar: typeof props.showIndentationButtons === 'boolean' ? props.showIndentationButtons : Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$
|
|
51
|
-
floatingToolbarLinkSettingsButton: typeof ((_props$
|
|
46
|
+
chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags15 = props.featureFlags) === null || _props$featureFlags15 === void 0 ? void 0 : _props$featureFlags15.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
|
|
47
|
+
showHoverPreview: Boolean(typeof ((_props$featureFlags16 = props.featureFlags) === null || _props$featureFlags16 === void 0 ? void 0 : _props$featureFlags16.showHoverPreview) === 'boolean' ? !!((_props$featureFlags17 = props.featureFlags) !== null && _props$featureFlags17 !== void 0 && _props$featureFlags17.showHoverPreview) : false),
|
|
48
|
+
indentationButtonsInTheToolbar: typeof props.showIndentationButtons === 'boolean' ? props.showIndentationButtons : Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags19 = props.featureFlags) !== null && _props$featureFlags19 !== void 0 && _props$featureFlags19.indentationButtonsInTheToolbar) : false)),
|
|
49
|
+
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
52
50
|
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
|
|
53
51
|
// Including fallback to props.featureFlags so that mobile feature flags
|
|
54
52
|
// are included (they are not kebab cased)
|
|
55
|
-
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$
|
|
53
|
+
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags21 = props.featureFlags) === null || _props$featureFlags21 === void 0 ? void 0 : _props$featureFlags21.restartNumberedLists) === true,
|
|
56
54
|
lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
|
|
57
|
-
preventPopupOverflow: Boolean(typeof ((_props$
|
|
55
|
+
preventPopupOverflow: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23['prevent-popup-overflow']) : false)
|
|
58
56
|
};
|
|
59
57
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin, fragmentMarkPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin,
|
|
1
|
+
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin, fragmentMarkPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, panelPlugin, placeholderTextPlugin, tasksAndDecisionsPlugin, textColorPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin } from '../../../plugins';
|
|
2
2
|
import { statusPlugin } from '@atlaskit/editor-plugin-status';
|
|
3
3
|
import { datePlugin } from '../../../plugins/date';
|
|
4
4
|
import { captionPlugin } from '@atlaskit/editor-plugin-caption';
|
|
@@ -18,6 +18,7 @@ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertio
|
|
|
18
18
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
19
19
|
import { saveOnEnterPlugin } from '@atlaskit/editor-plugin-save-on-enter';
|
|
20
20
|
import { scrollIntoViewPlugin } from '@atlaskit/editor-plugin-scroll-into-view';
|
|
21
|
+
import { mentionsPlugin } from '@atlaskit/editor-plugin-mentions';
|
|
21
22
|
import { isFullPage as fullPageCheck } from '../../../utils/is-full-page';
|
|
22
23
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
23
24
|
import { createDefaultPreset } from './default';
|
|
@@ -11,7 +11,6 @@ export { default as layoutPlugin } from './layout';
|
|
|
11
11
|
export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
|
|
12
12
|
export { default as macroPlugin } from './macro';
|
|
13
13
|
export { default as maxContentSizePlugin } from './max-content-size';
|
|
14
|
-
export { default as mentionsPlugin } from './mentions';
|
|
15
14
|
export { default as panelPlugin } from './panel';
|
|
16
15
|
export { default as pastePlugin } from './paste';
|
|
17
16
|
export { default as placeholderTextPlugin } from './placeholder-text';
|
|
@@ -10,20 +10,16 @@ export class InstrumentedPlugin extends SafePlugin {
|
|
|
10
10
|
uiTracking = {
|
|
11
11
|
enabled: false
|
|
12
12
|
},
|
|
13
|
-
saferDispatchedTransactions = false,
|
|
14
|
-
saferDispatchedTransactionsAnalyticsOnly = false,
|
|
15
13
|
dispatchAnalyticsEvent
|
|
16
14
|
} = options;
|
|
17
|
-
|
|
18
|
-
if (shouldOverrideApply && spec.state) {
|
|
15
|
+
if (spec.state) {
|
|
19
16
|
const originalApply = spec.state.apply.bind(spec.state);
|
|
20
17
|
spec.state.apply = (aTr, value, oldState, newState) => {
|
|
21
18
|
const self = this;
|
|
22
|
-
const tr =
|
|
19
|
+
const tr = new Proxy(aTr, freezeUnsafeTransactionProperties({
|
|
23
20
|
dispatchAnalyticsEvent,
|
|
24
|
-
pluginKey: self.key
|
|
25
|
-
|
|
26
|
-
})) : aTr;
|
|
21
|
+
pluginKey: self.key
|
|
22
|
+
}));
|
|
27
23
|
const shouldTrackTransactions = transactionTracker === null || transactionTracker === void 0 ? void 0 : transactionTracker.shouldTrackTransaction(transactionTracking);
|
|
28
24
|
if (!shouldTrackTransactions || !transactionTracker) {
|
|
29
25
|
return originalApply(tr, value, oldState, newState);
|
|
@@ -6,8 +6,7 @@ const isUnsafeMethod = prop => ['setSelection'].includes(prop.toString());
|
|
|
6
6
|
const isReadOnlyProperty = prop => ['doc', 'docs', 'steps', 'selection'].includes(prop.toString());
|
|
7
7
|
export const freezeUnsafeTransactionProperties = ({
|
|
8
8
|
dispatchAnalyticsEvent,
|
|
9
|
-
pluginKey
|
|
10
|
-
analyticsOnly
|
|
9
|
+
pluginKey
|
|
11
10
|
}) => {
|
|
12
11
|
const isUnsafe = () => {
|
|
13
12
|
if (dispatchAnalyticsEvent) {
|
|
@@ -23,9 +22,7 @@ export const freezeUnsafeTransactionProperties = ({
|
|
|
23
22
|
}
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
throw new Error(UNSAFE_PROPERTY_SET_ERROR);
|
|
28
|
-
}
|
|
25
|
+
throw new Error(UNSAFE_PROPERTY_SET_ERROR);
|
|
29
26
|
};
|
|
30
27
|
return {
|
|
31
28
|
get: function (target, prop, receiver) {
|
|
@@ -269,11 +269,10 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
269
269
|
}
|
|
270
270
|
var nodes = findChangedNodesFromTransaction(unsafeTransaction);
|
|
271
271
|
var changedNodesValid = validateNodes(nodes);
|
|
272
|
-
var transaction =
|
|
272
|
+
var transaction = new Proxy(unsafeTransaction, freezeUnsafeTransactionProperties({
|
|
273
273
|
dispatchAnalyticsEvent: _this.dispatchAnalyticsEvent,
|
|
274
|
-
pluginKey: 'unknown-reacteditorview'
|
|
275
|
-
|
|
276
|
-
})) : unsafeTransaction;
|
|
274
|
+
pluginKey: 'unknown-reacteditorview'
|
|
275
|
+
}));
|
|
277
276
|
if (changedNodesValid) {
|
|
278
277
|
var oldEditorState = _this.view.state;
|
|
279
278
|
|
|
@@ -90,15 +90,14 @@ export function createPMPlugins(config) {
|
|
|
90
90
|
_config$performanceTr = config.performanceTracking,
|
|
91
91
|
performanceTracking = _config$performanceTr === void 0 ? {} : _config$performanceTr,
|
|
92
92
|
transactionTracker = config.transactionTracker,
|
|
93
|
-
featureFlags = config.featureFlags,
|
|
94
93
|
dispatchAnalyticsEvent = config.dispatchAnalyticsEvent;
|
|
95
94
|
var _performanceTracking$ = performanceTracking.uiTracking,
|
|
96
95
|
uiTracking = _performanceTracking$ === void 0 ? TRACKING_DEFAULT : _performanceTracking$,
|
|
97
96
|
_performanceTracking$2 = performanceTracking.transactionTracking,
|
|
98
97
|
transactionTracking = _performanceTracking$2 === void 0 ? TRACKING_DEFAULT : _performanceTracking$2;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
var useInstrumentedPlugin = uiTracking.enabled || transactionTracking.enabled ||
|
|
98
|
+
|
|
99
|
+
// TO-DO need to question editor team about this condition true here
|
|
100
|
+
var useInstrumentedPlugin = uiTracking.enabled || transactionTracking.enabled || true;
|
|
102
101
|
if (process.env.NODE_ENV === 'development' && transactionTracking.enabled && !transactionTracker) {
|
|
103
102
|
// eslint-disable-next-line no-console
|
|
104
103
|
console.warn('createPMPlugins(): tracking is turned on but transactionTracker not defined! Transaction tracking has been disabled');
|
|
@@ -107,8 +106,6 @@ export function createPMPlugins(config) {
|
|
|
107
106
|
return InstrumentedPlugin.fromPlugin(plugin, {
|
|
108
107
|
uiTracking: uiTracking,
|
|
109
108
|
transactionTracking: transactionTracking,
|
|
110
|
-
saferDispatchedTransactions: saferDispatchedTransactions,
|
|
111
|
-
saferDispatchedTransactionsAnalyticsOnly: saferDispatchedTransactionsAnalyticsOnly,
|
|
112
109
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
113
110
|
}, transactionTracker);
|
|
114
111
|
} : function (plugin) {
|
|
@@ -25,7 +25,7 @@ function getSpellCheck(featureFlags) {
|
|
|
25
25
|
* which is used by both current and archv3 editors.
|
|
26
26
|
*/
|
|
27
27
|
export function createFeatureFlagsFromProps(props) {
|
|
28
|
-
var _props$allowLayouts, _props$performanceTra, _props$allowExtension, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$
|
|
28
|
+
var _props$allowLayouts, _props$performanceTra, _props$allowExtension, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$collabEdit, _props$collabEdit2, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23;
|
|
29
29
|
var normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
30
30
|
return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
|
|
31
31
|
newInsertionBehaviour: props.allowNewInsertionBehaviour,
|
|
@@ -45,18 +45,16 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
45
45
|
collabAvatarScroll: Boolean(typeof ((_props$featureFlags9 = props.featureFlags) === null || _props$featureFlags9 === void 0 ? void 0 : _props$featureFlags9.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags10 = props.featureFlags) !== null && _props$featureFlags10 !== void 0 && _props$featureFlags10.collabAvatarScroll) : false),
|
|
46
46
|
ufo: Boolean(typeof ((_props$featureFlags11 = props.featureFlags) === null || _props$featureFlags11 === void 0 ? void 0 : _props$featureFlags11.ufo) === 'boolean' ? !!((_props$featureFlags12 = props.featureFlags) !== null && _props$featureFlags12 !== void 0 && _props$featureFlags12.ufo) : false),
|
|
47
47
|
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags13 = props.featureFlags) === null || _props$featureFlags13 === void 0 ? void 0 : _props$featureFlags13.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags14 = props.featureFlags) !== null && _props$featureFlags14 !== void 0 && _props$featureFlags14.twoLineEditorToolbar) : false),
|
|
48
|
-
saferDispatchedTransactions: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactions === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactions || (typeof ((_props$featureFlags15 = props.featureFlags) === null || _props$featureFlags15 === void 0 ? void 0 : _props$featureFlags15.saferDispatchedTransactions) === 'boolean' ? !!((_props$featureFlags16 = props.featureFlags) !== null && _props$featureFlags16 !== void 0 && _props$featureFlags16.saferDispatchedTransactions) : false)),
|
|
49
|
-
saferDispatchedTransactionsAnalyticsOnly: Boolean(typeof normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly === 'boolean' && !!normalizedFeatureFlags.saferDispatchedTransactionsAnalyticsOnly || (typeof ((_props$featureFlags17 = props.featureFlags) === null || _props$featureFlags17 === void 0 ? void 0 : _props$featureFlags17.saferDispatchedTransactionsAnalyticsOnly) === 'boolean' ? !!((_props$featureFlags18 = props.featureFlags) !== null && _props$featureFlags18 !== void 0 && _props$featureFlags18.saferDispatchedTransactionsAnalyticsOnly) : false)),
|
|
50
48
|
useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
|
|
51
|
-
chromeCursorHandlerFixedVersion: typeof ((_props$
|
|
52
|
-
showHoverPreview: Boolean(typeof ((_props$
|
|
53
|
-
indentationButtonsInTheToolbar: typeof props.showIndentationButtons === 'boolean' ? props.showIndentationButtons : Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$
|
|
54
|
-
floatingToolbarLinkSettingsButton: typeof ((_props$
|
|
49
|
+
chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags15 = props.featureFlags) === null || _props$featureFlags15 === void 0 ? void 0 : _props$featureFlags15.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
|
|
50
|
+
showHoverPreview: Boolean(typeof ((_props$featureFlags16 = props.featureFlags) === null || _props$featureFlags16 === void 0 ? void 0 : _props$featureFlags16.showHoverPreview) === 'boolean' ? !!((_props$featureFlags17 = props.featureFlags) !== null && _props$featureFlags17 !== void 0 && _props$featureFlags17.showHoverPreview) : false),
|
|
51
|
+
indentationButtonsInTheToolbar: typeof props.showIndentationButtons === 'boolean' ? props.showIndentationButtons : Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags19 = props.featureFlags) !== null && _props$featureFlags19 !== void 0 && _props$featureFlags19.indentationButtonsInTheToolbar) : false)),
|
|
52
|
+
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
55
53
|
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
|
|
56
54
|
// Including fallback to props.featureFlags so that mobile feature flags
|
|
57
55
|
// are included (they are not kebab cased)
|
|
58
|
-
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$
|
|
56
|
+
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags21 = props.featureFlags) === null || _props$featureFlags21 === void 0 ? void 0 : _props$featureFlags21.restartNumberedLists) === true,
|
|
59
57
|
lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
|
|
60
|
-
preventPopupOverflow: Boolean(typeof ((_props$
|
|
58
|
+
preventPopupOverflow: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23['prevent-popup-overflow']) : false)
|
|
61
59
|
});
|
|
62
60
|
}
|
|
@@ -2,7 +2,7 @@ import _typeof from "@babel/runtime/helpers/typeof";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin, fragmentMarkPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin,
|
|
5
|
+
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin, fragmentMarkPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, panelPlugin, placeholderTextPlugin, tasksAndDecisionsPlugin, textColorPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin } from '../../../plugins';
|
|
6
6
|
import { statusPlugin } from '@atlaskit/editor-plugin-status';
|
|
7
7
|
import { datePlugin } from '../../../plugins/date';
|
|
8
8
|
import { captionPlugin } from '@atlaskit/editor-plugin-caption';
|
|
@@ -22,6 +22,7 @@ import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertio
|
|
|
22
22
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
23
23
|
import { saveOnEnterPlugin } from '@atlaskit/editor-plugin-save-on-enter';
|
|
24
24
|
import { scrollIntoViewPlugin } from '@atlaskit/editor-plugin-scroll-into-view';
|
|
25
|
+
import { mentionsPlugin } from '@atlaskit/editor-plugin-mentions';
|
|
25
26
|
import { isFullPage as fullPageCheck } from '../../../utils/is-full-page';
|
|
26
27
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
27
28
|
import { createDefaultPreset } from './default';
|
|
@@ -11,7 +11,6 @@ export { default as layoutPlugin } from './layout';
|
|
|
11
11
|
export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
|
|
12
12
|
export { default as macroPlugin } from './macro';
|
|
13
13
|
export { default as maxContentSizePlugin } from './max-content-size';
|
|
14
|
-
export { default as mentionsPlugin } from './mentions';
|
|
15
14
|
export { default as panelPlugin } from './panel';
|
|
16
15
|
export { default as pastePlugin } from './paste';
|
|
17
16
|
export { default as placeholderTextPlugin } from './placeholder-text';
|
|
@@ -25,21 +25,15 @@ export var InstrumentedPlugin = /*#__PURE__*/function (_SafePlugin) {
|
|
|
25
25
|
uiTracking = _options$uiTracking === void 0 ? {
|
|
26
26
|
enabled: false
|
|
27
27
|
} : _options$uiTracking,
|
|
28
|
-
_options$saferDispatc = options.saferDispatchedTransactions,
|
|
29
|
-
saferDispatchedTransactions = _options$saferDispatc === void 0 ? false : _options$saferDispatc,
|
|
30
|
-
_options$saferDispatc2 = options.saferDispatchedTransactionsAnalyticsOnly,
|
|
31
|
-
saferDispatchedTransactionsAnalyticsOnly = _options$saferDispatc2 === void 0 ? false : _options$saferDispatc2,
|
|
32
28
|
dispatchAnalyticsEvent = options.dispatchAnalyticsEvent;
|
|
33
|
-
|
|
34
|
-
if (shouldOverrideApply && spec.state) {
|
|
29
|
+
if (spec.state) {
|
|
35
30
|
var originalApply = spec.state.apply.bind(spec.state);
|
|
36
31
|
spec.state.apply = function (aTr, value, oldState, newState) {
|
|
37
32
|
var self = _assertThisInitialized(_this);
|
|
38
|
-
var tr =
|
|
33
|
+
var tr = new Proxy(aTr, freezeUnsafeTransactionProperties({
|
|
39
34
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
40
|
-
pluginKey: self.key
|
|
41
|
-
|
|
42
|
-
})) : aTr;
|
|
35
|
+
pluginKey: self.key
|
|
36
|
+
}));
|
|
43
37
|
var shouldTrackTransactions = transactionTracker === null || transactionTracker === void 0 ? void 0 : transactionTracker.shouldTrackTransaction(transactionTracking);
|
|
44
38
|
if (!shouldTrackTransactions || !transactionTracker) {
|
|
45
39
|
return originalApply(tr, value, oldState, newState);
|
|
@@ -10,8 +10,7 @@ var isReadOnlyProperty = function isReadOnlyProperty(prop) {
|
|
|
10
10
|
};
|
|
11
11
|
export var freezeUnsafeTransactionProperties = function freezeUnsafeTransactionProperties(_ref) {
|
|
12
12
|
var dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
|
|
13
|
-
pluginKey = _ref.pluginKey
|
|
14
|
-
analyticsOnly = _ref.analyticsOnly;
|
|
13
|
+
pluginKey = _ref.pluginKey;
|
|
15
14
|
var isUnsafe = function isUnsafe() {
|
|
16
15
|
if (dispatchAnalyticsEvent) {
|
|
17
16
|
dispatchAnalyticsEvent({
|
|
@@ -26,9 +25,7 @@ export var freezeUnsafeTransactionProperties = function freezeUnsafeTransactionP
|
|
|
26
25
|
}
|
|
27
26
|
});
|
|
28
27
|
}
|
|
29
|
-
|
|
30
|
-
throw new Error(UNSAFE_PROPERTY_SET_ERROR);
|
|
31
|
-
}
|
|
28
|
+
throw new Error(UNSAFE_PROPERTY_SET_ERROR);
|
|
32
29
|
};
|
|
33
30
|
return {
|
|
34
31
|
get: function get(target, prop, receiver) {
|
|
@@ -11,7 +11,6 @@ export { default as layoutPlugin } from './layout';
|
|
|
11
11
|
export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
|
|
12
12
|
export { default as macroPlugin } from './macro';
|
|
13
13
|
export { default as maxContentSizePlugin } from './max-content-size';
|
|
14
|
-
export { default as mentionsPlugin } from './mentions';
|
|
15
14
|
export { default as panelPlugin } from './panel';
|
|
16
15
|
export { default as pastePlugin } from './paste';
|
|
17
16
|
export { default as placeholderTextPlugin } from './placeholder-text';
|
|
@@ -6,7 +6,6 @@ import type { tablesPlugin } from '@atlaskit/editor-plugin-table';
|
|
|
6
6
|
import type { hyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
|
|
7
7
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
8
8
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
9
|
-
import type mentionsPlugin from '../mentions';
|
|
10
9
|
import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
|
|
11
10
|
import type { BlockTypePlugin } from '@atlaskit/editor-plugin-block-type';
|
|
12
11
|
import type codeBlockPlugin from '../code-block';
|
|
@@ -14,7 +13,7 @@ import type panelPlugin from '../panel';
|
|
|
14
13
|
import type { RulePlugin } from '@atlaskit/editor-plugin-rule';
|
|
15
14
|
import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
|
|
16
15
|
import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
|
|
17
|
-
import type {
|
|
16
|
+
import type { MentionsPlugin } from '@atlaskit/editor-plugin-mentions';
|
|
18
17
|
import type { StatusPlugin } from '@atlaskit/editor-plugin-status';
|
|
19
18
|
export type InsertBlockPluginDependencies = [
|
|
20
19
|
FeatureFlagsPlugin,
|
|
@@ -25,13 +24,12 @@ export type InsertBlockPluginDependencies = [
|
|
|
25
24
|
OptionalPlugin<BlockTypePlugin>,
|
|
26
25
|
OptionalPlugin<typeof analyticsPlugin>,
|
|
27
26
|
OptionalPlugin<ImageUploadPlugin>,
|
|
28
|
-
OptionalPlugin<typeof mentionsPlugin>,
|
|
29
27
|
OptionalPlugin<EmojiPlugin>,
|
|
30
28
|
OptionalPlugin<QuickInsertPlugin>,
|
|
31
29
|
OptionalPlugin<RulePlugin>,
|
|
32
30
|
OptionalPlugin<typeof codeBlockPlugin>,
|
|
33
31
|
OptionalPlugin<typeof panelPlugin>,
|
|
34
32
|
OptionalPlugin<MediaPlugin>,
|
|
35
|
-
OptionalPlugin<
|
|
33
|
+
OptionalPlugin<MentionsPlugin>,
|
|
36
34
|
OptionalPlugin<StatusPlugin>
|
|
37
35
|
];
|