@atlaskit/editor-plugin-extension 33.0.19 → 33.1.1
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 +21 -0
- package/dist/cjs/extensionPlugin.js +54 -35
- package/dist/cjs/pm-plugins/main.js +13 -3
- package/dist/cjs/ui/ConfigPanel/Fields/Boolean.js +19 -1
- package/dist/cjs/ui/ConfigPanel/FormContent.js +1 -0
- package/dist/es2019/extensionPlugin.js +15 -0
- package/dist/es2019/pm-plugins/main.js +9 -1
- package/dist/es2019/ui/ConfigPanel/Fields/Boolean.js +20 -2
- package/dist/es2019/ui/ConfigPanel/FormContent.js +1 -0
- package/dist/esm/extensionPlugin.js +54 -33
- package/dist/esm/pm-plugins/main.js +13 -3
- package/dist/esm/ui/ConfigPanel/Fields/Boolean.js +20 -2
- package/dist/esm/ui/ConfigPanel/FormContent.js +1 -0
- package/dist/types/extensionPluginType.d.ts +7 -0
- package/dist/types/ui/ConfigPanel/Fields/Boolean.d.ts +3 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-extension
|
|
2
2
|
|
|
3
|
+
## 33.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`57ad371c701cd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/57ad371c701cd) -
|
|
8
|
+
Behind `platform_editor_config_panel_field_analytics`, tag the ConfigPanel's `checkbox changed`
|
|
9
|
+
analytics event with the field name and the extension key and type.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 33.1.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [`8bcfd4cbc0135`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8bcfd4cbc0135) -
|
|
17
|
+
Scope generated media and native embed entrance animations to the final Rovo create insertion
|
|
18
|
+
using existing media and extension plugin state behind cwr_remix_animate_stream_only.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 33.0.19
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -5,11 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.extensionPlugin = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
9
|
var _uuid = require("uuid");
|
|
9
10
|
var _extension = require("@atlaskit/adf-schema/extension");
|
|
10
11
|
var _inlineExtension = require("@atlaskit/adf-schema/inline-extension");
|
|
11
12
|
var _multiBodiedExtension = require("@atlaskit/adf-schema/multi-bodied-extension");
|
|
12
13
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
14
|
+
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
13
15
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
14
16
|
var _actions = require("./editor-actions/actions");
|
|
15
17
|
var _commands = require("./editor-commands/commands");
|
|
@@ -25,8 +27,8 @@ var _uniqueId = require("./pm-plugins/unique-id");
|
|
|
25
27
|
var _constants = require("./ui/ConfigPanel/constants");
|
|
26
28
|
var _contextPanel = require("./ui/context-panel");
|
|
27
29
|
var _useConfigPanelPluginHook = require("./ui/useConfigPanelPluginHook");
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
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; }
|
|
31
|
+
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) { (0, _defineProperty2.default)(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; } // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
30
32
|
var extensionPlugin = exports.extensionPlugin = function extensionPlugin(_ref) {
|
|
31
33
|
var _api$featureFlags, _api$contextPanel, _api$analytics2, _api$analytics3, _api$contextPanel4;
|
|
32
34
|
var _ref$config = _ref.config,
|
|
@@ -64,25 +66,42 @@ var extensionPlugin = exports.extensionPlugin = function extensionPlugin(_ref) {
|
|
|
64
66
|
return extensionNodes;
|
|
65
67
|
},
|
|
66
68
|
getSharedState: function getSharedState(state) {
|
|
69
|
+
var _pluginState$shouldAn;
|
|
67
70
|
if (!state) {
|
|
68
71
|
return undefined;
|
|
69
72
|
}
|
|
70
73
|
var pluginState = _pluginKey.pluginKey.getState(state);
|
|
71
|
-
return {
|
|
72
|
-
showContextPanel: pluginState === null || pluginState === void 0 ? void 0 : pluginState.showContextPanel
|
|
74
|
+
return _objectSpread(_objectSpread({
|
|
75
|
+
showContextPanel: pluginState === null || pluginState === void 0 ? void 0 : pluginState.showContextPanel
|
|
76
|
+
}, (0, _isExperimentEnabled.isExperimentEnabled)('cwr_remix_animate_stream_only') && {
|
|
77
|
+
shouldAnimateInsertedContent: (_pluginState$shouldAn = pluginState === null || pluginState === void 0 ? void 0 : pluginState.shouldAnimateInsertedContent) !== null && _pluginState$shouldAn !== void 0 ? _pluginState$shouldAn : false
|
|
78
|
+
}), {}, {
|
|
73
79
|
extensionProvider: pluginState === null || pluginState === void 0 ? void 0 : pluginState.extensionProvider,
|
|
74
80
|
processParametersAfter: pluginState === null || pluginState === void 0 ? void 0 : pluginState.processParametersAfter
|
|
75
|
-
};
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
commands: {
|
|
84
|
+
setInsertAnimationEnabled: function setInsertAnimationEnabled(enabled) {
|
|
85
|
+
return function (_ref2) {
|
|
86
|
+
var tr = _ref2.tr;
|
|
87
|
+
return (0, _isExperimentEnabled.isExperimentEnabled)('cwr_remix_animate_stream_only') ? tr.setMeta(_pluginKey.pluginKey, {
|
|
88
|
+
type: 'UPDATE_STATE',
|
|
89
|
+
data: {
|
|
90
|
+
shouldAnimateInsertedContent: enabled
|
|
91
|
+
}
|
|
92
|
+
}).setMeta('addToHistory', false) : null;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
76
95
|
},
|
|
77
96
|
pmPlugins: function pmPlugins() {
|
|
78
97
|
return [{
|
|
79
98
|
name: 'extension',
|
|
80
|
-
plugin: function plugin(
|
|
81
|
-
var dispatch =
|
|
82
|
-
providerFactory =
|
|
83
|
-
portalProviderAPI =
|
|
84
|
-
eventDispatcher =
|
|
85
|
-
getIntl =
|
|
99
|
+
plugin: function plugin(_ref3) {
|
|
100
|
+
var dispatch = _ref3.dispatch,
|
|
101
|
+
providerFactory = _ref3.providerFactory,
|
|
102
|
+
portalProviderAPI = _ref3.portalProviderAPI,
|
|
103
|
+
eventDispatcher = _ref3.eventDispatcher,
|
|
104
|
+
getIntl = _ref3.getIntl;
|
|
86
105
|
var extensionHandlers = options.extensionHandlers || {};
|
|
87
106
|
return (0, _main.createPlugin)(dispatch, providerFactory, extensionHandlers, extensionLoadingHandlers, portalProviderAPI, eventDispatcher, _api, options.useLongPressSelection, {
|
|
88
107
|
appearance: options.appearance,
|
|
@@ -119,9 +138,9 @@ var extensionPlugin = exports.extensionPlugin = function extensionPlugin(_ref) {
|
|
|
119
138
|
}
|
|
120
139
|
}, {
|
|
121
140
|
name: 'macro',
|
|
122
|
-
plugin: function plugin(
|
|
123
|
-
var dispatch =
|
|
124
|
-
providerFactory =
|
|
141
|
+
plugin: function plugin(_ref4) {
|
|
142
|
+
var dispatch = _ref4.dispatch,
|
|
143
|
+
providerFactory = _ref4.providerFactory;
|
|
125
144
|
return (0, _plugin.createPlugin)(dispatch, providerFactory);
|
|
126
145
|
}
|
|
127
146
|
}];
|
|
@@ -141,14 +160,14 @@ var extensionPlugin = exports.extensionPlugin = function extensionPlugin(_ref) {
|
|
|
141
160
|
return extensionLoadingHandlers;
|
|
142
161
|
},
|
|
143
162
|
insertMacroFromMacroBrowser: (0, _actions2.insertMacroFromMacroBrowser)(_api === null || _api === void 0 || (_api$analytics2 = _api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions),
|
|
144
|
-
insertOrReplaceExtension: function insertOrReplaceExtension(
|
|
145
|
-
var editorView =
|
|
146
|
-
action =
|
|
147
|
-
attrs =
|
|
148
|
-
content =
|
|
149
|
-
position =
|
|
150
|
-
size =
|
|
151
|
-
tr =
|
|
163
|
+
insertOrReplaceExtension: function insertOrReplaceExtension(_ref5) {
|
|
164
|
+
var editorView = _ref5.editorView,
|
|
165
|
+
action = _ref5.action,
|
|
166
|
+
attrs = _ref5.attrs,
|
|
167
|
+
content = _ref5.content,
|
|
168
|
+
position = _ref5.position,
|
|
169
|
+
size = _ref5.size,
|
|
170
|
+
tr = _ref5.tr;
|
|
152
171
|
return (0, _actions.insertOrReplaceExtension)({
|
|
153
172
|
editorView: editorView,
|
|
154
173
|
action: action,
|
|
@@ -159,14 +178,14 @@ var extensionPlugin = exports.extensionPlugin = function extensionPlugin(_ref) {
|
|
|
159
178
|
tr: tr
|
|
160
179
|
});
|
|
161
180
|
},
|
|
162
|
-
insertOrReplaceBodiedExtension: function insertOrReplaceBodiedExtension(
|
|
163
|
-
var editorView =
|
|
164
|
-
action =
|
|
165
|
-
attrs =
|
|
166
|
-
content =
|
|
167
|
-
position =
|
|
168
|
-
size =
|
|
169
|
-
tr =
|
|
181
|
+
insertOrReplaceBodiedExtension: function insertOrReplaceBodiedExtension(_ref6) {
|
|
182
|
+
var editorView = _ref6.editorView,
|
|
183
|
+
action = _ref6.action,
|
|
184
|
+
attrs = _ref6.attrs,
|
|
185
|
+
content = _ref6.content,
|
|
186
|
+
position = _ref6.position,
|
|
187
|
+
size = _ref6.size,
|
|
188
|
+
tr = _ref6.tr;
|
|
170
189
|
return (0, _actions.insertOrReplaceBodiedExtension)({
|
|
171
190
|
editorView: editorView,
|
|
172
191
|
action: action,
|
|
@@ -182,9 +201,9 @@ var extensionPlugin = exports.extensionPlugin = function extensionPlugin(_ref) {
|
|
|
182
201
|
editorAnalyticsAPI: _api === null || _api === void 0 || (_api$analytics3 = _api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions,
|
|
183
202
|
applyChangeToContextPanel: _api === null || _api === void 0 || (_api$contextPanel4 = _api.contextPanel) === null || _api$contextPanel4 === void 0 ? void 0 : _api$contextPanel4.actions.applyChange
|
|
184
203
|
}),
|
|
185
|
-
registerExtensionLoadingHandler: function registerExtensionLoadingHandler(
|
|
186
|
-
var extensionType =
|
|
187
|
-
handler =
|
|
204
|
+
registerExtensionLoadingHandler: function registerExtensionLoadingHandler(_ref7) {
|
|
205
|
+
var extensionType = _ref7.extensionType,
|
|
206
|
+
handler = _ref7.handler;
|
|
188
207
|
extensionLoadingHandlers[extensionType] = handler;
|
|
189
208
|
return function () {
|
|
190
209
|
if (extensionLoadingHandlers[extensionType] === handler) {
|
|
@@ -208,8 +227,8 @@ var extensionPlugin = exports.extensionPlugin = function extensionPlugin(_ref) {
|
|
|
208
227
|
return (_editorViewRef$curren = editorViewRef.current) !== null && _editorViewRef$curren !== void 0 ? _editorViewRef$curren : undefined;
|
|
209
228
|
})(_api, featureFlags) : undefined
|
|
210
229
|
},
|
|
211
|
-
usePluginHook: showContextPanel ? function (
|
|
212
|
-
var editorView =
|
|
230
|
+
usePluginHook: showContextPanel ? function (_ref8) {
|
|
231
|
+
var editorView = _ref8.editorView;
|
|
213
232
|
(0, _useConfigPanelPluginHook.useConfigPanelPluginHook)({
|
|
214
233
|
api: _api,
|
|
215
234
|
configPanelId: configPanelId,
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.handleUpdate = exports.createPlugin = exports.createExtensionProviderHandler = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
11
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
12
|
var _extensionNodeView = _interopRequireDefault(require("@atlaskit/editor-common/extensionNodeView"));
|
|
@@ -14,12 +15,15 @@ var _selection2 = require("@atlaskit/editor-common/selection");
|
|
|
14
15
|
var _selection3 = require("@atlaskit/editor-common/selection/gap-cursor/selection");
|
|
15
16
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
16
17
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
18
|
+
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
17
19
|
var _commands = require("../editor-commands/commands");
|
|
18
20
|
var _blockTransforms = require("./block-transforms");
|
|
19
21
|
var _pluginFactory = require("./plugin-factory");
|
|
20
22
|
var _pluginKey = require("./plugin-key");
|
|
21
23
|
var _updateEditButton = require("./update-edit-button");
|
|
22
24
|
var _utils2 = require("./utils");
|
|
25
|
+
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; }
|
|
26
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
23
27
|
var shouldShowEditButton = function shouldShowEditButton(extensionHandler, extensionProvider) {
|
|
24
28
|
var usesLegacyMacroBrowser = !extensionHandler && !extensionProvider || typeof extensionHandler === 'function';
|
|
25
29
|
var usesModernUpdateMethod = (0, _typeof2.default)(extensionHandler) === 'object' && typeof extensionHandler.update === 'function';
|
|
@@ -191,15 +195,21 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
|
|
|
191
195
|
var featureFlags = arguments.length > 9 ? arguments[9] : undefined;
|
|
192
196
|
var __rendererExtensionOptions = arguments.length > 10 ? arguments[10] : undefined;
|
|
193
197
|
var intl = arguments.length > 11 ? arguments[11] : undefined;
|
|
194
|
-
var state = (0, _pluginFactory.createPluginState)(dispatch, {
|
|
198
|
+
var state = (0, _pluginFactory.createPluginState)(dispatch, _objectSpread(_objectSpread({}, (0, _isExperimentEnabled.isExperimentEnabled)('cwr_remix_animate_stream_only') && {
|
|
199
|
+
shouldAnimateInsertedContent: false
|
|
200
|
+
}), {}, {
|
|
195
201
|
showEditButton: false,
|
|
196
202
|
showCopyButton: true,
|
|
197
203
|
showContextPanel: false
|
|
198
|
-
});
|
|
204
|
+
}));
|
|
199
205
|
var extensionNodeViewOptions = {
|
|
200
206
|
appearance: options.appearance,
|
|
201
207
|
getExtensionHeight: options.getExtensionHeight,
|
|
202
|
-
allowAIGeneratedContentMotion: options.allowAIGeneratedContentMotion
|
|
208
|
+
allowAIGeneratedContentMotion: options.allowAIGeneratedContentMotion,
|
|
209
|
+
shouldAnimateGeneratedContent: function shouldAnimateGeneratedContent() {
|
|
210
|
+
var _pluginInjectionApi$e, _pluginInjectionApi$e2;
|
|
211
|
+
return (_pluginInjectionApi$e = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e2 = pluginInjectionApi.extension) === null || _pluginInjectionApi$e2 === void 0 || (_pluginInjectionApi$e2 = _pluginInjectionApi$e2.sharedState.currentState()) === null || _pluginInjectionApi$e2 === void 0 ? void 0 : _pluginInjectionApi$e2.shouldAnimateInsertedContent) !== null && _pluginInjectionApi$e !== void 0 ? _pluginInjectionApi$e : false;
|
|
212
|
+
}
|
|
203
213
|
};
|
|
204
214
|
var macroInteractionDesignFeatureFlags = {
|
|
205
215
|
showMacroInteractionDesignUpdates: (_featureFlags$macroIn = featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.macroInteractionUpdates) !== null && _featureFlags$macroIn !== void 0 ? _featureFlags$macroIn : false
|
|
@@ -12,6 +12,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
13
|
var _checkbox = require("@atlaskit/checkbox/checkbox");
|
|
14
14
|
var _field = _interopRequireDefault(require("@atlaskit/form/field"));
|
|
15
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
15
16
|
var _text = require("@atlaskit/primitives/compiled/text");
|
|
16
17
|
var _toggle = _interopRequireDefault(require("@atlaskit/toggle/toggle"));
|
|
17
18
|
var _FieldMessages = _interopRequireDefault(require("../FieldMessages"));
|
|
@@ -57,6 +58,7 @@ function handleOnChange(onChange, onFieldChange, event) {
|
|
|
57
58
|
function Checkbox(_ref) {
|
|
58
59
|
var name = _ref.name,
|
|
59
60
|
field = _ref.field,
|
|
61
|
+
extensionManifest = _ref.extensionManifest,
|
|
60
62
|
onFieldChange = _ref.onFieldChange;
|
|
61
63
|
var label = field.label,
|
|
62
64
|
description = field.description,
|
|
@@ -65,6 +67,19 @@ function Checkbox(_ref) {
|
|
|
65
67
|
_field$defaultValue = field.defaultValue,
|
|
66
68
|
defaultValue = _field$defaultValue === void 0 ? false : _field$defaultValue,
|
|
67
69
|
isDisabled = field.isDisabled;
|
|
70
|
+
var extensionKey = extensionManifest.key,
|
|
71
|
+
extensionType = extensionManifest.type;
|
|
72
|
+
// Without this, the checkbox's `checkbox changed` event has only `source: 'ConfigPanel'`, so it
|
|
73
|
+
// cannot say which field of which extension changed.
|
|
74
|
+
var analyticsContext = (0, _react.useMemo)(function () {
|
|
75
|
+
return (0, _fg.fg)('platform_editor_config_panel_field_analytics') ? {
|
|
76
|
+
attributes: {
|
|
77
|
+
fieldName: name,
|
|
78
|
+
extensionKey: extensionKey,
|
|
79
|
+
extensionType: extensionType
|
|
80
|
+
}
|
|
81
|
+
} : undefined;
|
|
82
|
+
}, [name, extensionKey, extensionType]);
|
|
68
83
|
return (0, _react2.jsx)(_field.default, {
|
|
69
84
|
name: name,
|
|
70
85
|
isRequired: isRequired
|
|
@@ -84,7 +99,8 @@ function Checkbox(_ref) {
|
|
|
84
99
|
// Ignored via go/ees005
|
|
85
100
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
86
101
|
, (0, _extends2.default)({}, restFieldProps, {
|
|
87
|
-
label: label
|
|
102
|
+
label: label,
|
|
103
|
+
analyticsContext: analyticsContext
|
|
88
104
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
89
105
|
,
|
|
90
106
|
onChange: function onChange(event) {
|
|
@@ -154,6 +170,7 @@ function Toggle(_ref3) {
|
|
|
154
170
|
function Boolean(_ref5) {
|
|
155
171
|
var name = _ref5.name,
|
|
156
172
|
field = _ref5.field,
|
|
173
|
+
extensionManifest = _ref5.extensionManifest,
|
|
157
174
|
onFieldChange = _ref5.onFieldChange;
|
|
158
175
|
if (field.style === 'toggle') {
|
|
159
176
|
return (0, _react2.jsx)(Toggle, {
|
|
@@ -165,6 +182,7 @@ function Boolean(_ref5) {
|
|
|
165
182
|
return (0, _react2.jsx)(Checkbox, {
|
|
166
183
|
name: name,
|
|
167
184
|
field: field,
|
|
185
|
+
extensionManifest: extensionManifest,
|
|
168
186
|
onFieldChange: onFieldChange
|
|
169
187
|
});
|
|
170
188
|
}
|
|
@@ -4,6 +4,7 @@ import { extension, extensionWithAnnotationStage0 } from '@atlaskit/adf-schema/e
|
|
|
4
4
|
import { inlineExtension } from '@atlaskit/adf-schema/inline-extension';
|
|
5
5
|
import { extensionFrame, multiBodiedExtension } from '@atlaskit/adf-schema/multi-bodied-extension';
|
|
6
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
7
8
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
9
|
import { createEditSelectedExtensionAction, insertOrReplaceBodiedExtension, insertOrReplaceExtension } from './editor-actions/actions';
|
|
9
10
|
import { forceAutoSave } from './editor-commands/commands';
|
|
@@ -56,16 +57,30 @@ export const extensionPlugin = ({
|
|
|
56
57
|
return extensionNodes;
|
|
57
58
|
},
|
|
58
59
|
getSharedState(state) {
|
|
60
|
+
var _pluginState$shouldAn;
|
|
59
61
|
if (!state) {
|
|
60
62
|
return undefined;
|
|
61
63
|
}
|
|
62
64
|
const pluginState = pluginKey.getState(state);
|
|
63
65
|
return {
|
|
64
66
|
showContextPanel: pluginState === null || pluginState === void 0 ? void 0 : pluginState.showContextPanel,
|
|
67
|
+
...(isExperimentEnabled('cwr_remix_animate_stream_only') && {
|
|
68
|
+
shouldAnimateInsertedContent: (_pluginState$shouldAn = pluginState === null || pluginState === void 0 ? void 0 : pluginState.shouldAnimateInsertedContent) !== null && _pluginState$shouldAn !== void 0 ? _pluginState$shouldAn : false
|
|
69
|
+
}),
|
|
65
70
|
extensionProvider: pluginState === null || pluginState === void 0 ? void 0 : pluginState.extensionProvider,
|
|
66
71
|
processParametersAfter: pluginState === null || pluginState === void 0 ? void 0 : pluginState.processParametersAfter
|
|
67
72
|
};
|
|
68
73
|
},
|
|
74
|
+
commands: {
|
|
75
|
+
setInsertAnimationEnabled: enabled => ({
|
|
76
|
+
tr
|
|
77
|
+
}) => isExperimentEnabled('cwr_remix_animate_stream_only') ? tr.setMeta(pluginKey, {
|
|
78
|
+
type: 'UPDATE_STATE',
|
|
79
|
+
data: {
|
|
80
|
+
shouldAnimateInsertedContent: enabled
|
|
81
|
+
}
|
|
82
|
+
}).setMeta('addToHistory', false) : null
|
|
83
|
+
},
|
|
69
84
|
pmPlugins() {
|
|
70
85
|
return [{
|
|
71
86
|
name: 'extension',
|
|
@@ -4,6 +4,7 @@ import { createSelectionClickHandler, isSelectionAtEndOfNode, isSelectionAtStart
|
|
|
4
4
|
import { GapCursorSelection } from '@atlaskit/editor-common/selection/gap-cursor/selection';
|
|
5
5
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { findParentNodeOfTypeClosestToPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
7
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
7
8
|
import { clearEditingContext, updateState } from '../editor-commands/commands';
|
|
8
9
|
import { buildExtensionBlockTransforms } from './block-transforms';
|
|
9
10
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
@@ -130,6 +131,9 @@ export const handleUpdate = ({
|
|
|
130
131
|
export const createPlugin = (dispatch, providerFactory, extensionHandlers, extensionLoadingHandlers, portalProviderAPI, eventDispatcher, pluginInjectionApi, useLongPressSelection = false, options = {}, featureFlags, __rendererExtensionOptions, intl) => {
|
|
131
132
|
var _featureFlags$macroIn;
|
|
132
133
|
const state = createPluginState(dispatch, {
|
|
134
|
+
...(isExperimentEnabled('cwr_remix_animate_stream_only') && {
|
|
135
|
+
shouldAnimateInsertedContent: false
|
|
136
|
+
}),
|
|
133
137
|
showEditButton: false,
|
|
134
138
|
showCopyButton: true,
|
|
135
139
|
showContextPanel: false
|
|
@@ -137,7 +141,11 @@ export const createPlugin = (dispatch, providerFactory, extensionHandlers, exten
|
|
|
137
141
|
const extensionNodeViewOptions = {
|
|
138
142
|
appearance: options.appearance,
|
|
139
143
|
getExtensionHeight: options.getExtensionHeight,
|
|
140
|
-
allowAIGeneratedContentMotion: options.allowAIGeneratedContentMotion
|
|
144
|
+
allowAIGeneratedContentMotion: options.allowAIGeneratedContentMotion,
|
|
145
|
+
shouldAnimateGeneratedContent: () => {
|
|
146
|
+
var _pluginInjectionApi$e, _pluginInjectionApi$e2, _pluginInjectionApi$e3;
|
|
147
|
+
return (_pluginInjectionApi$e = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$e2 = pluginInjectionApi.extension) === null || _pluginInjectionApi$e2 === void 0 ? void 0 : (_pluginInjectionApi$e3 = _pluginInjectionApi$e2.sharedState.currentState()) === null || _pluginInjectionApi$e3 === void 0 ? void 0 : _pluginInjectionApi$e3.shouldAnimateInsertedContent) !== null && _pluginInjectionApi$e !== void 0 ? _pluginInjectionApi$e : false;
|
|
148
|
+
}
|
|
141
149
|
};
|
|
142
150
|
const macroInteractionDesignFeatureFlags = {
|
|
143
151
|
showMacroInteractionDesignUpdates: (_featureFlags$macroIn = featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.macroInteractionUpdates) !== null && _featureFlags$macroIn !== void 0 ? _featureFlags$macroIn : false
|
|
@@ -3,12 +3,13 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
* @jsxRuntime classic
|
|
4
4
|
* @jsx jsx
|
|
5
5
|
*/
|
|
6
|
-
import React, { Fragment } from 'react';
|
|
6
|
+
import React, { Fragment, useMemo } from 'react';
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { Checkbox as AKCheckbox } from '@atlaskit/checkbox/checkbox';
|
|
11
11
|
import Field from '@atlaskit/form/field';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
12
13
|
import { Text } from '@atlaskit/primitives/compiled/text';
|
|
13
14
|
import AKToggle from '@atlaskit/toggle/toggle';
|
|
14
15
|
import FieldMessages from '../FieldMessages';
|
|
@@ -46,6 +47,7 @@ function handleOnChange(onChange, onFieldChange, event) {
|
|
|
46
47
|
function Checkbox({
|
|
47
48
|
name,
|
|
48
49
|
field,
|
|
50
|
+
extensionManifest,
|
|
49
51
|
onFieldChange
|
|
50
52
|
}) {
|
|
51
53
|
const {
|
|
@@ -55,6 +57,19 @@ function Checkbox({
|
|
|
55
57
|
defaultValue = false,
|
|
56
58
|
isDisabled
|
|
57
59
|
} = field;
|
|
60
|
+
const {
|
|
61
|
+
key: extensionKey,
|
|
62
|
+
type: extensionType
|
|
63
|
+
} = extensionManifest;
|
|
64
|
+
// Without this, the checkbox's `checkbox changed` event has only `source: 'ConfigPanel'`, so it
|
|
65
|
+
// cannot say which field of which extension changed.
|
|
66
|
+
const analyticsContext = useMemo(() => fg('platform_editor_config_panel_field_analytics') ? {
|
|
67
|
+
attributes: {
|
|
68
|
+
fieldName: name,
|
|
69
|
+
extensionKey,
|
|
70
|
+
extensionType
|
|
71
|
+
}
|
|
72
|
+
} : undefined, [name, extensionKey, extensionType]);
|
|
58
73
|
return jsx(Field, {
|
|
59
74
|
name: name,
|
|
60
75
|
isRequired: isRequired
|
|
@@ -75,7 +90,8 @@ function Checkbox({
|
|
|
75
90
|
// Ignored via go/ees005
|
|
76
91
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
77
92
|
, _extends({}, restFieldProps, {
|
|
78
|
-
label: label
|
|
93
|
+
label: label,
|
|
94
|
+
analyticsContext: analyticsContext
|
|
79
95
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
80
96
|
,
|
|
81
97
|
onChange: event => handleOnChange(fieldProps.onChange, onFieldChange, event),
|
|
@@ -143,6 +159,7 @@ function Toggle({
|
|
|
143
159
|
export default function Boolean({
|
|
144
160
|
name,
|
|
145
161
|
field,
|
|
162
|
+
extensionManifest,
|
|
146
163
|
onFieldChange
|
|
147
164
|
}) {
|
|
148
165
|
if (field.style === 'toggle') {
|
|
@@ -155,6 +172,7 @@ export default function Boolean({
|
|
|
155
172
|
return jsx(Checkbox, {
|
|
156
173
|
name: name,
|
|
157
174
|
field: field,
|
|
175
|
+
extensionManifest: extensionManifest,
|
|
158
176
|
onFieldChange: onFieldChange
|
|
159
177
|
});
|
|
160
178
|
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
1
4
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
2
5
|
import { v4 as uuid } from 'uuid';
|
|
3
6
|
import { extension, extensionWithAnnotationStage0 } from '@atlaskit/adf-schema/extension';
|
|
4
7
|
import { inlineExtension } from '@atlaskit/adf-schema/inline-extension';
|
|
5
8
|
import { extensionFrame, multiBodiedExtension } from '@atlaskit/adf-schema/multi-bodied-extension';
|
|
6
9
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
10
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
7
11
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
12
|
import { createEditSelectedExtensionAction, insertOrReplaceBodiedExtension as _insertOrReplaceBodiedExtension, insertOrReplaceExtension as _insertOrReplaceExtension } from './editor-actions/actions';
|
|
9
13
|
import { forceAutoSave } from './editor-commands/commands';
|
|
@@ -56,25 +60,42 @@ export var extensionPlugin = function extensionPlugin(_ref) {
|
|
|
56
60
|
return extensionNodes;
|
|
57
61
|
},
|
|
58
62
|
getSharedState: function getSharedState(state) {
|
|
63
|
+
var _pluginState$shouldAn;
|
|
59
64
|
if (!state) {
|
|
60
65
|
return undefined;
|
|
61
66
|
}
|
|
62
67
|
var pluginState = pluginKey.getState(state);
|
|
63
|
-
return {
|
|
64
|
-
showContextPanel: pluginState === null || pluginState === void 0 ? void 0 : pluginState.showContextPanel
|
|
68
|
+
return _objectSpread(_objectSpread({
|
|
69
|
+
showContextPanel: pluginState === null || pluginState === void 0 ? void 0 : pluginState.showContextPanel
|
|
70
|
+
}, isExperimentEnabled('cwr_remix_animate_stream_only') && {
|
|
71
|
+
shouldAnimateInsertedContent: (_pluginState$shouldAn = pluginState === null || pluginState === void 0 ? void 0 : pluginState.shouldAnimateInsertedContent) !== null && _pluginState$shouldAn !== void 0 ? _pluginState$shouldAn : false
|
|
72
|
+
}), {}, {
|
|
65
73
|
extensionProvider: pluginState === null || pluginState === void 0 ? void 0 : pluginState.extensionProvider,
|
|
66
74
|
processParametersAfter: pluginState === null || pluginState === void 0 ? void 0 : pluginState.processParametersAfter
|
|
67
|
-
};
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
commands: {
|
|
78
|
+
setInsertAnimationEnabled: function setInsertAnimationEnabled(enabled) {
|
|
79
|
+
return function (_ref2) {
|
|
80
|
+
var tr = _ref2.tr;
|
|
81
|
+
return isExperimentEnabled('cwr_remix_animate_stream_only') ? tr.setMeta(pluginKey, {
|
|
82
|
+
type: 'UPDATE_STATE',
|
|
83
|
+
data: {
|
|
84
|
+
shouldAnimateInsertedContent: enabled
|
|
85
|
+
}
|
|
86
|
+
}).setMeta('addToHistory', false) : null;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
68
89
|
},
|
|
69
90
|
pmPlugins: function pmPlugins() {
|
|
70
91
|
return [{
|
|
71
92
|
name: 'extension',
|
|
72
|
-
plugin: function plugin(
|
|
73
|
-
var dispatch =
|
|
74
|
-
providerFactory =
|
|
75
|
-
portalProviderAPI =
|
|
76
|
-
eventDispatcher =
|
|
77
|
-
getIntl =
|
|
93
|
+
plugin: function plugin(_ref3) {
|
|
94
|
+
var dispatch = _ref3.dispatch,
|
|
95
|
+
providerFactory = _ref3.providerFactory,
|
|
96
|
+
portalProviderAPI = _ref3.portalProviderAPI,
|
|
97
|
+
eventDispatcher = _ref3.eventDispatcher,
|
|
98
|
+
getIntl = _ref3.getIntl;
|
|
78
99
|
var extensionHandlers = options.extensionHandlers || {};
|
|
79
100
|
return createPlugin(dispatch, providerFactory, extensionHandlers, extensionLoadingHandlers, portalProviderAPI, eventDispatcher, _api, options.useLongPressSelection, {
|
|
80
101
|
appearance: options.appearance,
|
|
@@ -111,9 +132,9 @@ export var extensionPlugin = function extensionPlugin(_ref) {
|
|
|
111
132
|
}
|
|
112
133
|
}, {
|
|
113
134
|
name: 'macro',
|
|
114
|
-
plugin: function plugin(
|
|
115
|
-
var dispatch =
|
|
116
|
-
providerFactory =
|
|
135
|
+
plugin: function plugin(_ref4) {
|
|
136
|
+
var dispatch = _ref4.dispatch,
|
|
137
|
+
providerFactory = _ref4.providerFactory;
|
|
117
138
|
return createMacroPlugin(dispatch, providerFactory);
|
|
118
139
|
}
|
|
119
140
|
}];
|
|
@@ -133,14 +154,14 @@ export var extensionPlugin = function extensionPlugin(_ref) {
|
|
|
133
154
|
return extensionLoadingHandlers;
|
|
134
155
|
},
|
|
135
156
|
insertMacroFromMacroBrowser: insertMacroFromMacroBrowser(_api === null || _api === void 0 || (_api$analytics2 = _api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions),
|
|
136
|
-
insertOrReplaceExtension: function insertOrReplaceExtension(
|
|
137
|
-
var editorView =
|
|
138
|
-
action =
|
|
139
|
-
attrs =
|
|
140
|
-
content =
|
|
141
|
-
position =
|
|
142
|
-
size =
|
|
143
|
-
tr =
|
|
157
|
+
insertOrReplaceExtension: function insertOrReplaceExtension(_ref5) {
|
|
158
|
+
var editorView = _ref5.editorView,
|
|
159
|
+
action = _ref5.action,
|
|
160
|
+
attrs = _ref5.attrs,
|
|
161
|
+
content = _ref5.content,
|
|
162
|
+
position = _ref5.position,
|
|
163
|
+
size = _ref5.size,
|
|
164
|
+
tr = _ref5.tr;
|
|
144
165
|
return _insertOrReplaceExtension({
|
|
145
166
|
editorView: editorView,
|
|
146
167
|
action: action,
|
|
@@ -151,14 +172,14 @@ export var extensionPlugin = function extensionPlugin(_ref) {
|
|
|
151
172
|
tr: tr
|
|
152
173
|
});
|
|
153
174
|
},
|
|
154
|
-
insertOrReplaceBodiedExtension: function insertOrReplaceBodiedExtension(
|
|
155
|
-
var editorView =
|
|
156
|
-
action =
|
|
157
|
-
attrs =
|
|
158
|
-
content =
|
|
159
|
-
position =
|
|
160
|
-
size =
|
|
161
|
-
tr =
|
|
175
|
+
insertOrReplaceBodiedExtension: function insertOrReplaceBodiedExtension(_ref6) {
|
|
176
|
+
var editorView = _ref6.editorView,
|
|
177
|
+
action = _ref6.action,
|
|
178
|
+
attrs = _ref6.attrs,
|
|
179
|
+
content = _ref6.content,
|
|
180
|
+
position = _ref6.position,
|
|
181
|
+
size = _ref6.size,
|
|
182
|
+
tr = _ref6.tr;
|
|
162
183
|
return _insertOrReplaceBodiedExtension({
|
|
163
184
|
editorView: editorView,
|
|
164
185
|
action: action,
|
|
@@ -174,9 +195,9 @@ export var extensionPlugin = function extensionPlugin(_ref) {
|
|
|
174
195
|
editorAnalyticsAPI: _api === null || _api === void 0 || (_api$analytics3 = _api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions,
|
|
175
196
|
applyChangeToContextPanel: _api === null || _api === void 0 || (_api$contextPanel4 = _api.contextPanel) === null || _api$contextPanel4 === void 0 ? void 0 : _api$contextPanel4.actions.applyChange
|
|
176
197
|
}),
|
|
177
|
-
registerExtensionLoadingHandler: function registerExtensionLoadingHandler(
|
|
178
|
-
var extensionType =
|
|
179
|
-
handler =
|
|
198
|
+
registerExtensionLoadingHandler: function registerExtensionLoadingHandler(_ref7) {
|
|
199
|
+
var extensionType = _ref7.extensionType,
|
|
200
|
+
handler = _ref7.handler;
|
|
180
201
|
extensionLoadingHandlers[extensionType] = handler;
|
|
181
202
|
return function () {
|
|
182
203
|
if (extensionLoadingHandlers[extensionType] === handler) {
|
|
@@ -200,8 +221,8 @@ export var extensionPlugin = function extensionPlugin(_ref) {
|
|
|
200
221
|
return (_editorViewRef$curren = editorViewRef.current) !== null && _editorViewRef$curren !== void 0 ? _editorViewRef$curren : undefined;
|
|
201
222
|
})(_api, featureFlags) : undefined
|
|
202
223
|
},
|
|
203
|
-
usePluginHook: showContextPanel ? function (
|
|
204
|
-
var editorView =
|
|
224
|
+
usePluginHook: showContextPanel ? function (_ref8) {
|
|
225
|
+
var editorView = _ref8.editorView;
|
|
205
226
|
useConfigPanelPluginHook({
|
|
206
227
|
api: _api,
|
|
207
228
|
configPanelId: configPanelId,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
3
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
3
6
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
7
|
import ExtensionNodeView from '@atlaskit/editor-common/extensionNodeView';
|
|
5
8
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
@@ -7,6 +10,7 @@ import { createSelectionClickHandler, isSelectionAtEndOfNode, isSelectionAtStart
|
|
|
7
10
|
import { GapCursorSelection } from '@atlaskit/editor-common/selection/gap-cursor/selection';
|
|
8
11
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
9
12
|
import { findParentNodeOfTypeClosestToPos, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
13
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
10
14
|
import { clearEditingContext, updateState } from '../editor-commands/commands';
|
|
11
15
|
import { buildExtensionBlockTransforms } from './block-transforms';
|
|
12
16
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
@@ -184,15 +188,21 @@ export var createPlugin = function createPlugin(dispatch, providerFactory, exten
|
|
|
184
188
|
var featureFlags = arguments.length > 9 ? arguments[9] : undefined;
|
|
185
189
|
var __rendererExtensionOptions = arguments.length > 10 ? arguments[10] : undefined;
|
|
186
190
|
var intl = arguments.length > 11 ? arguments[11] : undefined;
|
|
187
|
-
var state = createPluginState(dispatch, {
|
|
191
|
+
var state = createPluginState(dispatch, _objectSpread(_objectSpread({}, isExperimentEnabled('cwr_remix_animate_stream_only') && {
|
|
192
|
+
shouldAnimateInsertedContent: false
|
|
193
|
+
}), {}, {
|
|
188
194
|
showEditButton: false,
|
|
189
195
|
showCopyButton: true,
|
|
190
196
|
showContextPanel: false
|
|
191
|
-
});
|
|
197
|
+
}));
|
|
192
198
|
var extensionNodeViewOptions = {
|
|
193
199
|
appearance: options.appearance,
|
|
194
200
|
getExtensionHeight: options.getExtensionHeight,
|
|
195
|
-
allowAIGeneratedContentMotion: options.allowAIGeneratedContentMotion
|
|
201
|
+
allowAIGeneratedContentMotion: options.allowAIGeneratedContentMotion,
|
|
202
|
+
shouldAnimateGeneratedContent: function shouldAnimateGeneratedContent() {
|
|
203
|
+
var _pluginInjectionApi$e, _pluginInjectionApi$e2;
|
|
204
|
+
return (_pluginInjectionApi$e = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e2 = pluginInjectionApi.extension) === null || _pluginInjectionApi$e2 === void 0 || (_pluginInjectionApi$e2 = _pluginInjectionApi$e2.sharedState.currentState()) === null || _pluginInjectionApi$e2 === void 0 ? void 0 : _pluginInjectionApi$e2.shouldAnimateInsertedContent) !== null && _pluginInjectionApi$e !== void 0 ? _pluginInjectionApi$e : false;
|
|
205
|
+
}
|
|
196
206
|
};
|
|
197
207
|
var macroInteractionDesignFeatureFlags = {
|
|
198
208
|
showMacroInteractionDesignUpdates: (_featureFlags$macroIn = featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.macroInteractionUpdates) !== null && _featureFlags$macroIn !== void 0 ? _featureFlags$macroIn : false
|
|
@@ -6,12 +6,13 @@ var _excluded = ["value"],
|
|
|
6
6
|
* @jsxRuntime classic
|
|
7
7
|
* @jsx jsx
|
|
8
8
|
*/
|
|
9
|
-
import React, { Fragment } from 'react';
|
|
9
|
+
import React, { Fragment, useMemo } from 'react';
|
|
10
10
|
|
|
11
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
12
12
|
import { css, jsx } from '@emotion/react';
|
|
13
13
|
import { Checkbox as AKCheckbox } from '@atlaskit/checkbox/checkbox';
|
|
14
14
|
import Field from '@atlaskit/form/field';
|
|
15
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
15
16
|
import { Text } from '@atlaskit/primitives/compiled/text';
|
|
16
17
|
import AKToggle from '@atlaskit/toggle/toggle';
|
|
17
18
|
import FieldMessages from '../FieldMessages';
|
|
@@ -49,6 +50,7 @@ function handleOnChange(onChange, onFieldChange, event) {
|
|
|
49
50
|
function Checkbox(_ref) {
|
|
50
51
|
var name = _ref.name,
|
|
51
52
|
field = _ref.field,
|
|
53
|
+
extensionManifest = _ref.extensionManifest,
|
|
52
54
|
onFieldChange = _ref.onFieldChange;
|
|
53
55
|
var label = field.label,
|
|
54
56
|
description = field.description,
|
|
@@ -57,6 +59,19 @@ function Checkbox(_ref) {
|
|
|
57
59
|
_field$defaultValue = field.defaultValue,
|
|
58
60
|
defaultValue = _field$defaultValue === void 0 ? false : _field$defaultValue,
|
|
59
61
|
isDisabled = field.isDisabled;
|
|
62
|
+
var extensionKey = extensionManifest.key,
|
|
63
|
+
extensionType = extensionManifest.type;
|
|
64
|
+
// Without this, the checkbox's `checkbox changed` event has only `source: 'ConfigPanel'`, so it
|
|
65
|
+
// cannot say which field of which extension changed.
|
|
66
|
+
var analyticsContext = useMemo(function () {
|
|
67
|
+
return fg('platform_editor_config_panel_field_analytics') ? {
|
|
68
|
+
attributes: {
|
|
69
|
+
fieldName: name,
|
|
70
|
+
extensionKey: extensionKey,
|
|
71
|
+
extensionType: extensionType
|
|
72
|
+
}
|
|
73
|
+
} : undefined;
|
|
74
|
+
}, [name, extensionKey, extensionType]);
|
|
60
75
|
return jsx(Field, {
|
|
61
76
|
name: name,
|
|
62
77
|
isRequired: isRequired
|
|
@@ -76,7 +91,8 @@ function Checkbox(_ref) {
|
|
|
76
91
|
// Ignored via go/ees005
|
|
77
92
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
78
93
|
, _extends({}, restFieldProps, {
|
|
79
|
-
label: label
|
|
94
|
+
label: label,
|
|
95
|
+
analyticsContext: analyticsContext
|
|
80
96
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
81
97
|
,
|
|
82
98
|
onChange: function onChange(event) {
|
|
@@ -146,6 +162,7 @@ function Toggle(_ref3) {
|
|
|
146
162
|
export default function Boolean(_ref5) {
|
|
147
163
|
var name = _ref5.name,
|
|
148
164
|
field = _ref5.field,
|
|
165
|
+
extensionManifest = _ref5.extensionManifest,
|
|
149
166
|
onFieldChange = _ref5.onFieldChange;
|
|
150
167
|
if (field.style === 'toggle') {
|
|
151
168
|
return jsx(Toggle, {
|
|
@@ -157,6 +174,7 @@ export default function Boolean(_ref5) {
|
|
|
157
174
|
return jsx(Checkbox, {
|
|
158
175
|
name: name,
|
|
159
176
|
field: field,
|
|
177
|
+
extensionManifest: extensionManifest,
|
|
160
178
|
onFieldChange: onFieldChange
|
|
161
179
|
});
|
|
162
180
|
}
|
|
@@ -6,6 +6,7 @@ import type { Parameters } from '@atlaskit/editor-common/extensions/extension-pa
|
|
|
6
6
|
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions/extension-provider';
|
|
7
7
|
import type { MacroProvider } from '@atlaskit/editor-common/provider-factory/macro-provider';
|
|
8
8
|
import type { EditorAppearance } from '@atlaskit/editor-common/types/editor-appearance';
|
|
9
|
+
import type { EditorCommand } from '@atlaskit/editor-common/types/editor-command';
|
|
9
10
|
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types/next-editor-plugin';
|
|
10
11
|
import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types/selection';
|
|
11
12
|
import type { JSONDocNode } from '@atlaskit/editor-json-transformer/types';
|
|
@@ -35,6 +36,7 @@ export type ExtensionState<T extends Parameters = Parameters> = {
|
|
|
35
36
|
positions?: Record<number, number>;
|
|
36
37
|
processParametersAfter?: TransformAfter<T>;
|
|
37
38
|
processParametersBefore?: TransformBefore<T>;
|
|
39
|
+
shouldAnimateInsertedContent?: boolean;
|
|
38
40
|
showContextPanel: boolean;
|
|
39
41
|
showCopyButton: boolean;
|
|
40
42
|
showEditButton: boolean;
|
|
@@ -135,11 +137,16 @@ export type ExtensionPluginActions = {
|
|
|
135
137
|
};
|
|
136
138
|
export type ExtensionPlugin = NextEditorPlugin<'extension', {
|
|
137
139
|
actions: ExtensionPluginActions;
|
|
140
|
+
commands: {
|
|
141
|
+
/** Controls entrance motion for node views created while enabled. */
|
|
142
|
+
setInsertAnimationEnabled: (enabled: boolean) => EditorCommand;
|
|
143
|
+
};
|
|
138
144
|
dependencies: ExtensionPluginDependencies;
|
|
139
145
|
pluginConfiguration: ExtensionPluginOptions | undefined;
|
|
140
146
|
sharedState: {
|
|
141
147
|
extensionProvider?: ExtensionState['extensionProvider'];
|
|
142
148
|
processParametersAfter?: ExtensionState['processParametersAfter'];
|
|
149
|
+
shouldAnimateInsertedContent?: boolean;
|
|
143
150
|
showContextPanel: boolean | undefined;
|
|
144
151
|
} | undefined;
|
|
145
152
|
}>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
|
+
import type { ExtensionManifest } from '@atlaskit/editor-common/extensions/extension-manifest';
|
|
2
3
|
import type { BooleanField } from '@atlaskit/editor-common/extensions/field-definitions';
|
|
3
4
|
import type { OnFieldChange } from '../types';
|
|
4
|
-
export default function Boolean({ name, field, onFieldChange, }: {
|
|
5
|
+
export default function Boolean({ name, field, extensionManifest, onFieldChange, }: {
|
|
6
|
+
extensionManifest: ExtensionManifest;
|
|
5
7
|
field: BooleanField;
|
|
6
8
|
name: string;
|
|
7
9
|
onFieldChange: OnFieldChange;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-extension",
|
|
3
|
-
"version": "33.
|
|
3
|
+
"version": "33.1.1",
|
|
4
4
|
"description": "editor-plugin-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@atlaskit/editor-plugin-decorations": "^30.0.0",
|
|
46
46
|
"@atlaskit/editor-plugin-feature-flags": "^29.0.0",
|
|
47
47
|
"@atlaskit/editor-plugin-mentions": "^32.2.0",
|
|
48
|
-
"@atlaskit/editor-plugin-toolbar": "^27.
|
|
48
|
+
"@atlaskit/editor-plugin-toolbar": "^27.1.0",
|
|
49
49
|
"@atlaskit/editor-plugin-width": "^31.0.0",
|
|
50
50
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
51
51
|
"@atlaskit/editor-shared-styles": "^5.1.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/empty-state": "^12.2.0",
|
|
54
54
|
"@atlaskit/form": "^18.3.0",
|
|
55
55
|
"@atlaskit/heading": "^8.0.0",
|
|
56
|
-
"@atlaskit/icon": "^38.
|
|
56
|
+
"@atlaskit/icon": "^38.1.0",
|
|
57
57
|
"@atlaskit/link": "^5.1.0",
|
|
58
58
|
"@atlaskit/mention": "^30.9.0",
|
|
59
59
|
"@atlaskit/menu": "^11.0.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@atlaskit/primitives": "^22.7.0",
|
|
63
63
|
"@atlaskit/radio": "^10.2.0",
|
|
64
64
|
"@atlaskit/react-select": "^4.12.0",
|
|
65
|
-
"@atlaskit/section-message": "^10.
|
|
65
|
+
"@atlaskit/section-message": "^10.3.0",
|
|
66
66
|
"@atlaskit/select": "^23.2.0",
|
|
67
67
|
"@atlaskit/smart-user-picker": "^12.12.0",
|
|
68
68
|
"@atlaskit/spinner": "^20.4.0",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@atlaskit/textfield": "^10.3.0",
|
|
72
72
|
"@atlaskit/tmp-editor-statsig": "^262.0.0",
|
|
73
73
|
"@atlaskit/toggle": "^17.3.0",
|
|
74
|
-
"@atlaskit/tokens": "^20.
|
|
74
|
+
"@atlaskit/tokens": "^20.12.0",
|
|
75
75
|
"@atlaskit/tooltip": "^24.4.0",
|
|
76
76
|
"@atlaskit/user-picker": "^14.8.0",
|
|
77
77
|
"@babel/runtime": "^7.0.0",
|
|
@@ -85,12 +85,12 @@
|
|
|
85
85
|
"uuid": "^11.1.1"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@atlaskit/editor-common": "^134.
|
|
88
|
+
"@atlaskit/editor-common": "^134.19.0",
|
|
89
89
|
"react": "^18.2.0 || ^19.2.0",
|
|
90
90
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@atlaskit/editor-common": "^134.
|
|
93
|
+
"@atlaskit/editor-common": "^134.19.0",
|
|
94
94
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
95
95
|
"@atlassian/workbench": "workspace:*",
|
|
96
96
|
"react": "^19.2.0",
|