@atlaskit/editor-plugin-extension 5.2.6 → 5.3.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/pm-plugins/extension-api.js +5 -0
- package/dist/cjs/pm-plugins/toolbar.js +0 -3
- package/dist/cjs/pm-plugins/unique-id.js +10 -1
- package/dist/cjs/ui/ConfigPanel/NestedForms/RemovableField.js +1 -1
- package/dist/es2019/pm-plugins/extension-api.js +5 -0
- package/dist/es2019/pm-plugins/toolbar.js +0 -3
- package/dist/es2019/pm-plugins/unique-id.js +12 -1
- package/dist/es2019/ui/ConfigPanel/NestedForms/RemovableField.js +1 -1
- package/dist/esm/pm-plugins/extension-api.js +5 -0
- package/dist/esm/pm-plugins/toolbar.js +0 -3
- package/dist/esm/pm-plugins/unique-id.js +10 -1
- package/dist/esm/ui/ConfigPanel/NestedForms/RemovableField.js +1 -1
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-extension
|
|
2
2
|
|
|
3
|
+
## 5.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#147400](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/147400)
|
|
8
|
+
[`800ff50276ed7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/800ff50276ed7) -
|
|
9
|
+
Clean up experiment platform_editor_nested_non_bodied_macros
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 5.3.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [#145243](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/145243)
|
|
17
|
+
[`7d32c3cc54ceb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7d32c3cc54ceb) -
|
|
18
|
+
Exposes a new getNodeWithPosByLocalId(localId: string) function in the ExtensionAPI
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 5.2.6
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -284,6 +284,11 @@ var createExtensionAPI = exports.createExtensionAPI = function createExtensionAP
|
|
|
284
284
|
}
|
|
285
285
|
editInLegacy();
|
|
286
286
|
},
|
|
287
|
+
getNodeWithPosByLocalId: function getNodeWithPosByLocalId(localId) {
|
|
288
|
+
return ensureNodePosByLocalId(localId, {
|
|
289
|
+
opName: 'getNodeWithPosByLocalId'
|
|
290
|
+
});
|
|
291
|
+
},
|
|
287
292
|
doc: doc
|
|
288
293
|
};
|
|
289
294
|
};
|
|
@@ -37,9 +37,6 @@ var isNestedNBM = function isNestedNBM(state, selectedExtNode) {
|
|
|
37
37
|
blockquote = _state$schema$nodes.blockquote,
|
|
38
38
|
listItem = _state$schema$nodes.listItem,
|
|
39
39
|
selection = state.selection;
|
|
40
|
-
if (!(0, _experiments.editorExperiment)('platform_editor_nested_non_bodied_macros', 'test')) {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
40
|
if (!selectedExtNode) {
|
|
44
41
|
return false;
|
|
45
42
|
}
|
|
@@ -7,9 +7,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.createPlugin = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
10
|
+
var _steps = require("@atlaskit/adf-schema/steps");
|
|
10
11
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
11
12
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
12
13
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
15
|
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; }
|
|
14
16
|
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; }
|
|
15
17
|
var pluginKey = new _state.PluginKey('extensionUniqueIdPlugin');
|
|
@@ -31,7 +33,14 @@ var createPlugin = exports.createPlugin = function createPlugin() {
|
|
|
31
33
|
return;
|
|
32
34
|
}
|
|
33
35
|
var isAddingExtension = transaction.steps.some(function (step) {
|
|
34
|
-
|
|
36
|
+
var _step$attrs;
|
|
37
|
+
return (0, _utils.stepAddsOneOf)(step, extensionTypes) ||
|
|
38
|
+
// There are instances where the localId will be reset to null on publish due to extension
|
|
39
|
+
// not existing in the Storage format (eg. Legacy Content Extensions) or not having a localId
|
|
40
|
+
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
41
|
+
(0, _platformFeatureFlags.fg)('platform_editor_update_extension_local_id_on_reset') && step instanceof _steps.SetAttrsStep &&
|
|
42
|
+
// @ts-expect-error Bad ProseMirror step types
|
|
43
|
+
((_step$attrs = step.attrs) === null || _step$attrs === void 0 ? void 0 : _step$attrs.localId) === null;
|
|
35
44
|
});
|
|
36
45
|
if (isAddingExtension) {
|
|
37
46
|
// Can't simply look at changed nodes, as we could be adding an extension
|
|
@@ -54,7 +54,7 @@ var RemovableField = function RemovableField(_ref) {
|
|
|
54
54
|
,
|
|
55
55
|
className: className
|
|
56
56
|
}, children, canRemoveField &&
|
|
57
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
57
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions, @atlassian/a11y/interactive-element-not-keyboard-focusable
|
|
58
58
|
(0, _react2.jsx)("div", {
|
|
59
59
|
css: removeButtonWrapperStyles,
|
|
60
60
|
"data-testid": "remove-field-".concat(name),
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { uuid } from '@atlaskit/adf-schema';
|
|
2
|
+
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
2
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
4
|
import { stepAddsOneOf } from '@atlaskit/editor-common/utils';
|
|
4
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
7
|
const pluginKey = new PluginKey('extensionUniqueIdPlugin');
|
|
6
8
|
const createPlugin = () => new SafePlugin({
|
|
7
9
|
appendTransaction: (transactions, _oldState, newState) => {
|
|
@@ -20,7 +22,16 @@ const createPlugin = () => new SafePlugin({
|
|
|
20
22
|
if (!transaction.docChanged) {
|
|
21
23
|
return;
|
|
22
24
|
}
|
|
23
|
-
const isAddingExtension = transaction.steps.some(step =>
|
|
25
|
+
const isAddingExtension = transaction.steps.some(step => {
|
|
26
|
+
var _step$attrs;
|
|
27
|
+
return stepAddsOneOf(step, extensionTypes) ||
|
|
28
|
+
// There are instances where the localId will be reset to null on publish due to extension
|
|
29
|
+
// not existing in the Storage format (eg. Legacy Content Extensions) or not having a localId
|
|
30
|
+
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
31
|
+
fg('platform_editor_update_extension_local_id_on_reset') && step instanceof SetAttrsStep &&
|
|
32
|
+
// @ts-expect-error Bad ProseMirror step types
|
|
33
|
+
((_step$attrs = step.attrs) === null || _step$attrs === void 0 ? void 0 : _step$attrs.localId) === null;
|
|
34
|
+
});
|
|
24
35
|
if (isAddingExtension) {
|
|
25
36
|
// Can't simply look at changed nodes, as we could be adding an extension
|
|
26
37
|
newState.doc.descendants((node, pos) => {
|
|
@@ -45,7 +45,7 @@ const RemovableField = ({
|
|
|
45
45
|
,
|
|
46
46
|
className: className
|
|
47
47
|
}, children, canRemoveField &&
|
|
48
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
48
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions, @atlassian/a11y/interactive-element-not-keyboard-focusable
|
|
49
49
|
jsx("div", {
|
|
50
50
|
css: removeButtonWrapperStyles,
|
|
51
51
|
"data-testid": `remove-field-${name}`,
|
|
@@ -277,6 +277,11 @@ export var createExtensionAPI = function createExtensionAPI(options) {
|
|
|
277
277
|
}
|
|
278
278
|
editInLegacy();
|
|
279
279
|
},
|
|
280
|
+
getNodeWithPosByLocalId: function getNodeWithPosByLocalId(localId) {
|
|
281
|
+
return ensureNodePosByLocalId(localId, {
|
|
282
|
+
opName: 'getNodeWithPosByLocalId'
|
|
283
|
+
});
|
|
284
|
+
},
|
|
280
285
|
doc: doc
|
|
281
286
|
};
|
|
282
287
|
};
|
|
@@ -31,9 +31,6 @@ var isNestedNBM = function isNestedNBM(state, selectedExtNode) {
|
|
|
31
31
|
blockquote = _state$schema$nodes.blockquote,
|
|
32
32
|
listItem = _state$schema$nodes.listItem,
|
|
33
33
|
selection = state.selection;
|
|
34
|
-
if (!editorExperiment('platform_editor_nested_non_bodied_macros', 'test')) {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
34
|
if (!selectedExtNode) {
|
|
38
35
|
return false;
|
|
39
36
|
}
|
|
@@ -2,9 +2,11 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
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
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; }
|
|
4
4
|
import { uuid } from '@atlaskit/adf-schema';
|
|
5
|
+
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
5
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
7
|
import { stepAddsOneOf } from '@atlaskit/editor-common/utils';
|
|
7
8
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
10
|
var pluginKey = new PluginKey('extensionUniqueIdPlugin');
|
|
9
11
|
var createPlugin = function createPlugin() {
|
|
10
12
|
return new SafePlugin({
|
|
@@ -24,7 +26,14 @@ var createPlugin = function createPlugin() {
|
|
|
24
26
|
return;
|
|
25
27
|
}
|
|
26
28
|
var isAddingExtension = transaction.steps.some(function (step) {
|
|
27
|
-
|
|
29
|
+
var _step$attrs;
|
|
30
|
+
return stepAddsOneOf(step, extensionTypes) ||
|
|
31
|
+
// There are instances where the localId will be reset to null on publish due to extension
|
|
32
|
+
// not existing in the Storage format (eg. Legacy Content Extensions) or not having a localId
|
|
33
|
+
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
34
|
+
fg('platform_editor_update_extension_local_id_on_reset') && step instanceof SetAttrsStep &&
|
|
35
|
+
// @ts-expect-error Bad ProseMirror step types
|
|
36
|
+
((_step$attrs = step.attrs) === null || _step$attrs === void 0 ? void 0 : _step$attrs.localId) === null;
|
|
28
37
|
});
|
|
29
38
|
if (isAddingExtension) {
|
|
30
39
|
// Can't simply look at changed nodes, as we could be adding an extension
|
|
@@ -46,7 +46,7 @@ var RemovableField = function RemovableField(_ref) {
|
|
|
46
46
|
,
|
|
47
47
|
className: className
|
|
48
48
|
}, children, canRemoveField &&
|
|
49
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
49
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions, @atlassian/a11y/interactive-element-not-keyboard-focusable
|
|
50
50
|
jsx("div", {
|
|
51
51
|
css: removeButtonWrapperStyles,
|
|
52
52
|
"data-testid": "remove-field-".concat(name),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-extension",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.1",
|
|
4
4
|
"description": "editor-plugin-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@atlaskit/button": "^23.0.0",
|
|
33
33
|
"@atlaskit/checkbox": "^17.1.0",
|
|
34
34
|
"@atlaskit/datetime-picker": "^17.0.0",
|
|
35
|
-
"@atlaskit/editor-common": "^103.
|
|
35
|
+
"@atlaskit/editor-common": "^103.19.0",
|
|
36
36
|
"@atlaskit/editor-json-transformer": "^8.24.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
38
38
|
"@atlaskit/editor-plugin-connectivity": "^2.0.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/textarea": "^8.0.0",
|
|
60
60
|
"@atlaskit/textfield": "^8.0.0",
|
|
61
61
|
"@atlaskit/theme": "^18.0.0",
|
|
62
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
62
|
+
"@atlaskit/tmp-editor-statsig": "^4.15.0",
|
|
63
63
|
"@atlaskit/toggle": "^15.0.0",
|
|
64
64
|
"@atlaskit/tokens": "^4.8.0",
|
|
65
65
|
"@atlaskit/tooltip": "^20.0.0",
|
|
@@ -122,6 +122,9 @@
|
|
|
122
122
|
"platform_editor_extension_deprecation_status": {
|
|
123
123
|
"type": "boolean"
|
|
124
124
|
},
|
|
125
|
+
"platform_editor_update_extension_local_id_on_reset": {
|
|
126
|
+
"type": "boolean"
|
|
127
|
+
},
|
|
125
128
|
"platform_editor_controls_patch_2": {
|
|
126
129
|
"type": "boolean"
|
|
127
130
|
}
|