@atlaskit/editor-plugin-insert-block 3.1.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/cjs/insertBlockPlugin.js +2 -65
- package/dist/cjs/ui/ToolbarInsertBlock/index.js +1 -1
- package/dist/es2019/insertBlockPlugin.js +2 -69
- package/dist/es2019/ui/ToolbarInsertBlock/index.js +1 -1
- package/dist/esm/insertBlockPlugin.js +2 -65
- package/dist/esm/ui/ToolbarInsertBlock/index.js +1 -1
- package/package.json +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-insert-block
|
|
2
2
|
|
|
3
|
+
## 3.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#132166](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/132166)
|
|
8
|
+
[`e1c6dcf47a8a2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e1c6dcf47a8a2) -
|
|
9
|
+
ED-24538 Clean up platform_editor_basic_text_transformations
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 3.1.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#128664](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/128664)
|
|
17
|
+
[`abca3266336d9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/abca3266336d9) -
|
|
18
|
+
[ED-23250] Remove form element from MediaFromUrl and consolidate experiments and feature flags in
|
|
19
|
+
prepartion for jira release
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 3.1.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
|
@@ -10,21 +10,16 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
11
|
var _elementBrowser = require("@atlaskit/editor-common/element-browser");
|
|
12
12
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
13
|
-
var _insert = require("@atlaskit/editor-common/insert");
|
|
14
|
-
var _messages = require("@atlaskit/editor-common/messages");
|
|
15
13
|
var _providerFactory = require("@atlaskit/editor-common/provider-factory");
|
|
16
14
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
17
15
|
var _types = require("@atlaskit/editor-common/types");
|
|
18
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
19
16
|
var _consts = require("@atlaskit/editor-plugin-block-type/consts");
|
|
20
17
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
18
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
22
19
|
var _elementBrowser2 = require("./pm-plugins/elementBrowser");
|
|
23
20
|
var _toggleInsertBlock = require("./pm-plugins/toggleInsertBlock");
|
|
24
|
-
var _switch = _interopRequireDefault(require("./ui/assets/switch"));
|
|
25
21
|
var _ElementRail = require("./ui/ElementRail");
|
|
26
22
|
var _ToolbarInsertBlock = _interopRequireDefault(require("./ui/ToolbarInsertBlock"));
|
|
27
|
-
var _transformOptions = require("./ui/transformOptions");
|
|
28
23
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
29
24
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
30
25
|
// Ignored via go/ees005
|
|
@@ -229,65 +224,7 @@ var insertBlockPlugin = exports.insertBlockPlugin = function insertBlockPlugin(_
|
|
|
229
224
|
});
|
|
230
225
|
return plugins;
|
|
231
226
|
},
|
|
232
|
-
pluginsOptions: {
|
|
233
|
-
// This is added for basic text transformations experiment.
|
|
234
|
-
// This may not be the most ideal plugin to add this to, but it is suitable for experiment purpose
|
|
235
|
-
// as relevant plugin dependencies are already set up.
|
|
236
|
-
// If we decide to ship the feature, we will consider a separate plugin if needed.
|
|
237
|
-
// Experiment one-pager: https://hello.atlassian.net/wiki/spaces/ETM/pages/3931754727/Experiment+Elements+Basic+Text+Transformations
|
|
238
|
-
selectionToolbar: function selectionToolbar(state, intl) {
|
|
239
|
-
var _api$featureFlags;
|
|
240
|
-
var isEligible = // basicTextTransformations is used to present AI enablement status to avoid adding editor props
|
|
241
|
-
api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 || (_api$featureFlags = _api$featureFlags.sharedState.currentState()) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.basicTextTransformations;
|
|
242
|
-
if (!isEligible) {
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
if ((0, _experiments.editorExperiment)('basic-text-transformations', true, {
|
|
246
|
-
exposure: true
|
|
247
|
-
})) {
|
|
248
|
-
var formatMessage = intl.formatMessage;
|
|
249
|
-
var _options = (0, _transformOptions.transformationOptions)(api, state.schema).map(function (option) {
|
|
250
|
-
var canWrap;
|
|
251
|
-
if (option.type.name === 'codeBlock') {
|
|
252
|
-
var _$from$node;
|
|
253
|
-
var $from = state.selection.$from;
|
|
254
|
-
var grandParentNodeType = (_$from$node = $from.node(-1)) === null || _$from$node === void 0 ? void 0 : _$from$node.type;
|
|
255
|
-
var parentNodeType = $from.parent.type;
|
|
256
|
-
canWrap = (0, _insert.shouldSplitSelectedNodeOnNodeInsertion)({
|
|
257
|
-
parentNodeType: parentNodeType,
|
|
258
|
-
grandParentNodeType: grandParentNodeType,
|
|
259
|
-
content: option.type.createAndFill()
|
|
260
|
-
}) && (0, _insert.contentAllowedInCodeBlock)(state);
|
|
261
|
-
} else {
|
|
262
|
-
canWrap = !!(0, _utils.getWrappingOptions)(state, option.type).wrapping;
|
|
263
|
-
}
|
|
264
|
-
var IconBefore = option.icon;
|
|
265
|
-
return {
|
|
266
|
-
title: formatMessage(option.title),
|
|
267
|
-
icon: /*#__PURE__*/_react.default.createElement(IconBefore, {
|
|
268
|
-
label: "",
|
|
269
|
-
disabled: !canWrap
|
|
270
|
-
}),
|
|
271
|
-
disabled: !canWrap,
|
|
272
|
-
onClick: function onClick(state, dispatch) {
|
|
273
|
-
var _option$command;
|
|
274
|
-
(_option$command = option.command) === null || _option$command === void 0 || _option$command.call(option, _analytics.INPUT_METHOD.FLOATING_TB)(state, dispatch);
|
|
275
|
-
return true;
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
});
|
|
279
|
-
return {
|
|
280
|
-
items: [{
|
|
281
|
-
type: 'dropdown',
|
|
282
|
-
title: formatMessage(_messages.toolbarInsertBlockMessages.turnInto),
|
|
283
|
-
iconBefore: _switch.default,
|
|
284
|
-
options: _options
|
|
285
|
-
}],
|
|
286
|
-
rank: -9
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
},
|
|
227
|
+
pluginsOptions: {},
|
|
291
228
|
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined
|
|
292
229
|
};
|
|
293
230
|
if (
|
|
@@ -350,7 +287,7 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
|
350
287
|
if (!mediaState) {
|
|
351
288
|
return;
|
|
352
289
|
}
|
|
353
|
-
if ((0,
|
|
290
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_add_media_from_url_rollout')) {
|
|
354
291
|
var _pluginInjectionApi$c, _pluginInjectionApi$m;
|
|
355
292
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 || _pluginInjectionApi$c.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m = pluginInjectionApi.mediaInsert) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.commands.showMediaInsertPopup(mountInfo));
|
|
356
293
|
} else {
|
|
@@ -409,7 +409,7 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
409
409
|
dispatchAnalyticsEvent({
|
|
410
410
|
action: _analytics.ACTION.OPENED,
|
|
411
411
|
actionSubject: _analytics.ACTION_SUBJECT.PICKER,
|
|
412
|
-
actionSubjectId: (0,
|
|
412
|
+
actionSubjectId: (0, _platformFeatureFlags.fg)('platform_editor_add_media_from_url_rollout') ? _analytics.ACTION_SUBJECT_ID.PICKER_MEDIA : _analytics.ACTION_SUBJECT_ID.PICKER_CLOUD,
|
|
413
413
|
attributes: {
|
|
414
414
|
inputMethod: inputMethod
|
|
415
415
|
},
|
|
@@ -2,23 +2,18 @@ import React, { useEffect } from 'react';
|
|
|
2
2
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { ElementBrowser } from '@atlaskit/editor-common/element-browser';
|
|
4
4
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
5
|
-
import { contentAllowedInCodeBlock, shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/insert';
|
|
6
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
5
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
8
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
9
7
|
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
10
|
-
import { getWrappingOptions } from '@atlaskit/editor-common/utils';
|
|
11
8
|
import { BLOCK_QUOTE, CODE_BLOCK, PANEL } from '@atlaskit/editor-plugin-block-type/consts';
|
|
12
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
14
11
|
import { elementBrowserPmKey, elementBrowserPmPlugin } from './pm-plugins/elementBrowser';
|
|
15
12
|
import { toggleInsertBlockPmKey, toggleInsertBlockPmPlugin } from './pm-plugins/toggleInsertBlock';
|
|
16
|
-
import SwitchIcon from './ui/assets/switch';
|
|
17
13
|
import { InsertMenuRail } from './ui/ElementRail';
|
|
18
14
|
// Ignored via go/ees005
|
|
19
15
|
// eslint-disable-next-line import/no-named-as-default
|
|
20
16
|
import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
|
|
21
|
-
import { transformationOptions } from './ui/transformOptions';
|
|
22
17
|
export const toolbarSizeToButtons = (toolbarSize, appearance) => {
|
|
23
18
|
// Different button numbers for full-page to better match full page toolbar breakpoints
|
|
24
19
|
if (appearance === 'full-page' && fg('platform_editor_toolbar_responsive_fixes')) {
|
|
@@ -210,69 +205,7 @@ export const insertBlockPlugin = ({
|
|
|
210
205
|
});
|
|
211
206
|
return plugins;
|
|
212
207
|
},
|
|
213
|
-
pluginsOptions: {
|
|
214
|
-
// This is added for basic text transformations experiment.
|
|
215
|
-
// This may not be the most ideal plugin to add this to, but it is suitable for experiment purpose
|
|
216
|
-
// as relevant plugin dependencies are already set up.
|
|
217
|
-
// If we decide to ship the feature, we will consider a separate plugin if needed.
|
|
218
|
-
// Experiment one-pager: https://hello.atlassian.net/wiki/spaces/ETM/pages/3931754727/Experiment+Elements+Basic+Text+Transformations
|
|
219
|
-
selectionToolbar: (state, intl) => {
|
|
220
|
-
var _api$featureFlags, _api$featureFlags$sha;
|
|
221
|
-
const isEligible = // basicTextTransformations is used to present AI enablement status to avoid adding editor props
|
|
222
|
-
api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : (_api$featureFlags$sha = _api$featureFlags.sharedState.currentState()) === null || _api$featureFlags$sha === void 0 ? void 0 : _api$featureFlags$sha.basicTextTransformations;
|
|
223
|
-
if (!isEligible) {
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
if (editorExperiment('basic-text-transformations', true, {
|
|
227
|
-
exposure: true
|
|
228
|
-
})) {
|
|
229
|
-
const {
|
|
230
|
-
formatMessage
|
|
231
|
-
} = intl;
|
|
232
|
-
const options = transformationOptions(api, state.schema).map(option => {
|
|
233
|
-
let canWrap;
|
|
234
|
-
if (option.type.name === 'codeBlock') {
|
|
235
|
-
var _$from$node;
|
|
236
|
-
const {
|
|
237
|
-
$from
|
|
238
|
-
} = state.selection;
|
|
239
|
-
const grandParentNodeType = (_$from$node = $from.node(-1)) === null || _$from$node === void 0 ? void 0 : _$from$node.type;
|
|
240
|
-
const parentNodeType = $from.parent.type;
|
|
241
|
-
canWrap = shouldSplitSelectedNodeOnNodeInsertion({
|
|
242
|
-
parentNodeType,
|
|
243
|
-
grandParentNodeType,
|
|
244
|
-
content: option.type.createAndFill()
|
|
245
|
-
}) && contentAllowedInCodeBlock(state);
|
|
246
|
-
} else {
|
|
247
|
-
canWrap = !!getWrappingOptions(state, option.type).wrapping;
|
|
248
|
-
}
|
|
249
|
-
const IconBefore = option.icon;
|
|
250
|
-
return {
|
|
251
|
-
title: formatMessage(option.title),
|
|
252
|
-
icon: /*#__PURE__*/React.createElement(IconBefore, {
|
|
253
|
-
label: "",
|
|
254
|
-
disabled: !canWrap
|
|
255
|
-
}),
|
|
256
|
-
disabled: !canWrap,
|
|
257
|
-
onClick: (state, dispatch) => {
|
|
258
|
-
var _option$command;
|
|
259
|
-
(_option$command = option.command) === null || _option$command === void 0 ? void 0 : _option$command.call(option, INPUT_METHOD.FLOATING_TB)(state, dispatch);
|
|
260
|
-
return true;
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
});
|
|
264
|
-
return {
|
|
265
|
-
items: [{
|
|
266
|
-
type: 'dropdown',
|
|
267
|
-
title: formatMessage(messages.turnInto),
|
|
268
|
-
iconBefore: SwitchIcon,
|
|
269
|
-
options
|
|
270
|
-
}],
|
|
271
|
-
rank: -9
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
},
|
|
208
|
+
pluginsOptions: {},
|
|
276
209
|
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined
|
|
277
210
|
};
|
|
278
211
|
if (
|
|
@@ -337,7 +270,7 @@ function ToolbarInsertBlockWithInjectionApi({
|
|
|
337
270
|
if (!mediaState) {
|
|
338
271
|
return;
|
|
339
272
|
}
|
|
340
|
-
if (
|
|
273
|
+
if (fg('platform_editor_add_media_from_url_rollout')) {
|
|
341
274
|
var _pluginInjectionApi$c, _pluginInjectionApi$m;
|
|
342
275
|
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$m = pluginInjectionApi.mediaInsert) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.commands.showMediaInsertPopup(mountInfo));
|
|
343
276
|
} else {
|
|
@@ -432,7 +432,7 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
432
432
|
dispatchAnalyticsEvent({
|
|
433
433
|
action: ACTION.OPENED,
|
|
434
434
|
actionSubject: ACTION_SUBJECT.PICKER,
|
|
435
|
-
actionSubjectId:
|
|
435
|
+
actionSubjectId: fg('platform_editor_add_media_from_url_rollout') ? ACTION_SUBJECT_ID.PICKER_MEDIA : ACTION_SUBJECT_ID.PICKER_CLOUD,
|
|
436
436
|
attributes: {
|
|
437
437
|
inputMethod
|
|
438
438
|
},
|
|
@@ -2,23 +2,18 @@ import React, { useEffect } from 'react';
|
|
|
2
2
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { ElementBrowser } from '@atlaskit/editor-common/element-browser';
|
|
4
4
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
5
|
-
import { contentAllowedInCodeBlock, shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/insert';
|
|
6
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
5
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
8
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
9
7
|
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
10
|
-
import { getWrappingOptions } from '@atlaskit/editor-common/utils';
|
|
11
8
|
import { BLOCK_QUOTE, CODE_BLOCK, PANEL } from '@atlaskit/editor-plugin-block-type/consts';
|
|
12
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
14
11
|
import { elementBrowserPmKey, elementBrowserPmPlugin } from './pm-plugins/elementBrowser';
|
|
15
12
|
import { toggleInsertBlockPmKey, toggleInsertBlockPmPlugin } from './pm-plugins/toggleInsertBlock';
|
|
16
|
-
import SwitchIcon from './ui/assets/switch';
|
|
17
13
|
import { InsertMenuRail } from './ui/ElementRail';
|
|
18
14
|
// Ignored via go/ees005
|
|
19
15
|
// eslint-disable-next-line import/no-named-as-default
|
|
20
16
|
import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
|
|
21
|
-
import { transformationOptions } from './ui/transformOptions';
|
|
22
17
|
export var toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize, appearance) {
|
|
23
18
|
// Different button numbers for full-page to better match full page toolbar breakpoints
|
|
24
19
|
if (appearance === 'full-page' && fg('platform_editor_toolbar_responsive_fixes')) {
|
|
@@ -218,65 +213,7 @@ export var insertBlockPlugin = function insertBlockPlugin(_ref) {
|
|
|
218
213
|
});
|
|
219
214
|
return plugins;
|
|
220
215
|
},
|
|
221
|
-
pluginsOptions: {
|
|
222
|
-
// This is added for basic text transformations experiment.
|
|
223
|
-
// This may not be the most ideal plugin to add this to, but it is suitable for experiment purpose
|
|
224
|
-
// as relevant plugin dependencies are already set up.
|
|
225
|
-
// If we decide to ship the feature, we will consider a separate plugin if needed.
|
|
226
|
-
// Experiment one-pager: https://hello.atlassian.net/wiki/spaces/ETM/pages/3931754727/Experiment+Elements+Basic+Text+Transformations
|
|
227
|
-
selectionToolbar: function selectionToolbar(state, intl) {
|
|
228
|
-
var _api$featureFlags;
|
|
229
|
-
var isEligible = // basicTextTransformations is used to present AI enablement status to avoid adding editor props
|
|
230
|
-
api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 || (_api$featureFlags = _api$featureFlags.sharedState.currentState()) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.basicTextTransformations;
|
|
231
|
-
if (!isEligible) {
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
if (editorExperiment('basic-text-transformations', true, {
|
|
235
|
-
exposure: true
|
|
236
|
-
})) {
|
|
237
|
-
var formatMessage = intl.formatMessage;
|
|
238
|
-
var _options = transformationOptions(api, state.schema).map(function (option) {
|
|
239
|
-
var canWrap;
|
|
240
|
-
if (option.type.name === 'codeBlock') {
|
|
241
|
-
var _$from$node;
|
|
242
|
-
var $from = state.selection.$from;
|
|
243
|
-
var grandParentNodeType = (_$from$node = $from.node(-1)) === null || _$from$node === void 0 ? void 0 : _$from$node.type;
|
|
244
|
-
var parentNodeType = $from.parent.type;
|
|
245
|
-
canWrap = shouldSplitSelectedNodeOnNodeInsertion({
|
|
246
|
-
parentNodeType: parentNodeType,
|
|
247
|
-
grandParentNodeType: grandParentNodeType,
|
|
248
|
-
content: option.type.createAndFill()
|
|
249
|
-
}) && contentAllowedInCodeBlock(state);
|
|
250
|
-
} else {
|
|
251
|
-
canWrap = !!getWrappingOptions(state, option.type).wrapping;
|
|
252
|
-
}
|
|
253
|
-
var IconBefore = option.icon;
|
|
254
|
-
return {
|
|
255
|
-
title: formatMessage(option.title),
|
|
256
|
-
icon: /*#__PURE__*/React.createElement(IconBefore, {
|
|
257
|
-
label: "",
|
|
258
|
-
disabled: !canWrap
|
|
259
|
-
}),
|
|
260
|
-
disabled: !canWrap,
|
|
261
|
-
onClick: function onClick(state, dispatch) {
|
|
262
|
-
var _option$command;
|
|
263
|
-
(_option$command = option.command) === null || _option$command === void 0 || _option$command.call(option, INPUT_METHOD.FLOATING_TB)(state, dispatch);
|
|
264
|
-
return true;
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
});
|
|
268
|
-
return {
|
|
269
|
-
items: [{
|
|
270
|
-
type: 'dropdown',
|
|
271
|
-
title: formatMessage(messages.turnInto),
|
|
272
|
-
iconBefore: SwitchIcon,
|
|
273
|
-
options: _options
|
|
274
|
-
}],
|
|
275
|
-
rank: -9
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
},
|
|
216
|
+
pluginsOptions: {},
|
|
280
217
|
primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) ? primaryToolbarComponent : undefined
|
|
281
218
|
};
|
|
282
219
|
if (
|
|
@@ -339,7 +276,7 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
|
339
276
|
if (!mediaState) {
|
|
340
277
|
return;
|
|
341
278
|
}
|
|
342
|
-
if (
|
|
279
|
+
if (fg('platform_editor_add_media_from_url_rollout')) {
|
|
343
280
|
var _pluginInjectionApi$c, _pluginInjectionApi$m;
|
|
344
281
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 || _pluginInjectionApi$c.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m = pluginInjectionApi.mediaInsert) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.commands.showMediaInsertPopup(mountInfo));
|
|
345
282
|
} else {
|
|
@@ -403,7 +403,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
403
403
|
dispatchAnalyticsEvent({
|
|
404
404
|
action: ACTION.OPENED,
|
|
405
405
|
actionSubject: ACTION_SUBJECT.PICKER,
|
|
406
|
-
actionSubjectId:
|
|
406
|
+
actionSubjectId: fg('platform_editor_add_media_from_url_rollout') ? ACTION_SUBJECT_ID.PICKER_MEDIA : ACTION_SUBJECT_ID.PICKER_CLOUD,
|
|
407
407
|
attributes: {
|
|
408
408
|
inputMethod: inputMethod
|
|
409
409
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/editor-plugin-image-upload": "^2.0.0",
|
|
49
49
|
"@atlaskit/editor-plugin-layout": "^2.3.0",
|
|
50
50
|
"@atlaskit/editor-plugin-media": "^2.3.0",
|
|
51
|
-
"@atlaskit/editor-plugin-media-insert": "^6.
|
|
51
|
+
"@atlaskit/editor-plugin-media-insert": "^6.2.0",
|
|
52
52
|
"@atlaskit/editor-plugin-mentions": "^4.1.0",
|
|
53
53
|
"@atlaskit/editor-plugin-metrics": "^3.4.0",
|
|
54
54
|
"@atlaskit/editor-plugin-panel": "^4.3.0",
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
65
65
|
"@atlaskit/emoji": "^69.0.0",
|
|
66
66
|
"@atlaskit/heading": "^5.1.0",
|
|
67
|
-
"@atlaskit/icon": "^25.
|
|
68
|
-
"@atlaskit/icon-lab": "^4.
|
|
67
|
+
"@atlaskit/icon": "^25.2.0",
|
|
68
|
+
"@atlaskit/icon-lab": "^4.5.0",
|
|
69
69
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
70
70
|
"@atlaskit/primitives": "^14.2.0",
|
|
71
71
|
"@atlaskit/theme": "^18.0.0",
|
|
72
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
72
|
+
"@atlaskit/tmp-editor-statsig": "^4.4.0",
|
|
73
73
|
"@atlaskit/tokens": "^4.5.0",
|
|
74
74
|
"@atlaskit/tooltip": "^20.0.0",
|
|
75
75
|
"@babel/runtime": "^7.0.0",
|
|
@@ -138,6 +138,9 @@
|
|
|
138
138
|
},
|
|
139
139
|
"platform_editor_preload_emoji_picker": {
|
|
140
140
|
"type": "boolean"
|
|
141
|
+
},
|
|
142
|
+
"platform_editor_add_media_from_url_rollout": {
|
|
143
|
+
"type": "boolean"
|
|
141
144
|
}
|
|
142
145
|
}
|
|
143
146
|
}
|