@atlaskit/editor-plugin-extension 1.5.4 → 1.6.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/actions.js +37 -1
  3. package/dist/cjs/plugin.js +36 -0
  4. package/dist/cjs/ui/ConfigPanel/ErrorMessage/ErrorImage.js +1 -0
  5. package/dist/cjs/ui/ConfigPanel/Fields/Boolean.js +2 -1
  6. package/dist/cjs/ui/ConfigPanel/Fields/CheckboxGroup.js +1 -0
  7. package/dist/cjs/ui/ConfigPanel/Fields/ColorPicker.js +3 -2
  8. package/dist/cjs/ui/ConfigPanel/Fields/DateRange.js +1 -1
  9. package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +3 -1
  10. package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +1 -1
  11. package/dist/cjs/ui/ConfigPanel/Fields/SelectItem.js +2 -1
  12. package/dist/cjs/ui/ConfigPanel/Fields/TabGroup.js +2 -0
  13. package/dist/cjs/ui/ConfigPanel/Fields/common/RequiredIndicator.js +3 -0
  14. package/dist/cjs/ui/ConfigPanel/Header.js +7 -2
  15. package/dist/cjs/ui/ConfigPanel/LoadingState.js +1 -0
  16. package/dist/cjs/ui/ConfigPanel/NestedForms/RemovableField.js +2 -0
  17. package/dist/cjs/ui/SaveIndicator/SaveIndicator.js +2 -0
  18. package/dist/es2019/actions.js +36 -0
  19. package/dist/es2019/plugin.js +35 -1
  20. package/dist/es2019/ui/ConfigPanel/ErrorMessage/ErrorImage.js +1 -0
  21. package/dist/es2019/ui/ConfigPanel/Fields/Boolean.js +3 -1
  22. package/dist/es2019/ui/ConfigPanel/Fields/CheckboxGroup.js +2 -0
  23. package/dist/es2019/ui/ConfigPanel/Fields/ColorPicker.js +4 -1
  24. package/dist/es2019/ui/ConfigPanel/Fields/DateRange.js +2 -0
  25. package/dist/es2019/ui/ConfigPanel/Fields/Expand.js +3 -1
  26. package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +2 -0
  27. package/dist/es2019/ui/ConfigPanel/Fields/SelectItem.js +2 -1
  28. package/dist/es2019/ui/ConfigPanel/Fields/TabGroup.js +2 -0
  29. package/dist/es2019/ui/ConfigPanel/Fields/common/RequiredIndicator.js +2 -0
  30. package/dist/es2019/ui/ConfigPanel/Header.js +7 -2
  31. package/dist/es2019/ui/ConfigPanel/LoadingState.js +1 -0
  32. package/dist/es2019/ui/ConfigPanel/NestedForms/RemovableField.js +2 -0
  33. package/dist/es2019/ui/SaveIndicator/SaveIndicator.js +2 -0
  34. package/dist/esm/actions.js +36 -0
  35. package/dist/esm/plugin.js +37 -1
  36. package/dist/esm/ui/ConfigPanel/ErrorMessage/ErrorImage.js +1 -0
  37. package/dist/esm/ui/ConfigPanel/Fields/Boolean.js +3 -1
  38. package/dist/esm/ui/ConfigPanel/Fields/CheckboxGroup.js +2 -0
  39. package/dist/esm/ui/ConfigPanel/Fields/ColorPicker.js +4 -1
  40. package/dist/esm/ui/ConfigPanel/Fields/DateRange.js +2 -0
  41. package/dist/esm/ui/ConfigPanel/Fields/Expand.js +3 -1
  42. package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +2 -0
  43. package/dist/esm/ui/ConfigPanel/Fields/SelectItem.js +2 -1
  44. package/dist/esm/ui/ConfigPanel/Fields/TabGroup.js +2 -0
  45. package/dist/esm/ui/ConfigPanel/Fields/common/RequiredIndicator.js +2 -0
  46. package/dist/esm/ui/ConfigPanel/Header.js +7 -2
  47. package/dist/esm/ui/ConfigPanel/LoadingState.js +1 -0
  48. package/dist/esm/ui/ConfigPanel/NestedForms/RemovableField.js +2 -0
  49. package/dist/esm/ui/SaveIndicator/SaveIndicator.js +2 -0
  50. package/dist/types/actions.d.ts +4 -0
  51. package/dist/types/index.d.ts +1 -1
  52. package/dist/types/types.d.ts +14 -2
  53. package/dist/types-ts4.5/actions.d.ts +4 -0
  54. package/dist/types-ts4.5/index.d.ts +1 -1
  55. package/dist/types-ts4.5/types.d.ts +14 -2
  56. package/example-utils/config-panel/ConfigPanelWithExtensionPicker.tsx +4 -0
  57. package/package.json +117 -117
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @atlaskit/editor-plugin-extension
2
2
 
3
+ ## 1.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 1.6.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#108272](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108272)
14
+ [`a2eeda76039fd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a2eeda76039fd) -
15
+ [EDF-465] Move convertExtensionType action to extensions plugin to decouple the ai plugin with the
16
+ extensions plug
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies
21
+
3
22
  ## 1.5.4
4
23
 
5
24
  ### Patch Changes
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.performNodeUpdate = exports.editExtension = exports.createEditSelectedExtensionAction = exports.buildExtensionNode = void 0;
7
+ exports.performNodeUpdate = exports.insertOrReplaceExtension = exports.insertOrReplaceBodiedExtension = exports.editExtension = exports.createEditSelectedExtensionAction = exports.buildExtensionNode = void 0;
8
8
  Object.defineProperty(exports, "transformSliceToRemoveOpenBodiedExtension", {
9
9
  enumerable: true,
10
10
  get: function get() {
@@ -234,4 +234,40 @@ var createEditSelectedExtensionAction = exports.createEditSelectedExtensionActio
234
234
  updateExtension = _getPluginState2.updateExtension;
235
235
  return editExtension(null, applyChangeToContextPanel, editorAnalyticsAPI, updateExtension)(view.state, view.dispatch, view);
236
236
  };
237
+ };
238
+ var insertOrReplaceExtension = exports.insertOrReplaceExtension = function insertOrReplaceExtension(_ref3) {
239
+ var editorView = _ref3.editorView,
240
+ action = _ref3.action,
241
+ attrs = _ref3.attrs,
242
+ content = _ref3.content,
243
+ position = _ref3.position,
244
+ _ref3$size = _ref3.size,
245
+ size = _ref3$size === void 0 ? 0 : _ref3$size,
246
+ tr = _ref3.tr;
247
+ var newNode = editorView.state.schema.node('extension', attrs, content);
248
+ if (action === 'insert') {
249
+ tr = editorView.state.tr.insert(position, newNode);
250
+ return tr;
251
+ } else {
252
+ tr.replaceWith(position, position + size, newNode);
253
+ return tr;
254
+ }
255
+ };
256
+ var insertOrReplaceBodiedExtension = exports.insertOrReplaceBodiedExtension = function insertOrReplaceBodiedExtension(_ref4) {
257
+ var editorView = _ref4.editorView,
258
+ action = _ref4.action,
259
+ attrs = _ref4.attrs,
260
+ content = _ref4.content,
261
+ position = _ref4.position,
262
+ _ref4$size = _ref4.size,
263
+ size = _ref4$size === void 0 ? 0 : _ref4$size,
264
+ tr = _ref4.tr;
265
+ var newNode = editorView.state.schema.node('bodiedExtension', attrs, content);
266
+ if (action === 'insert') {
267
+ tr = editorView.state.tr.insert(position, newNode);
268
+ return tr;
269
+ } else {
270
+ tr.replaceWith(position, position + size, newNode);
271
+ return tr;
272
+ }
237
273
  };
@@ -124,6 +124,42 @@ var extensionPlugin = exports.extensionPlugin = function extensionPlugin(_ref) {
124
124
  });
125
125
  },
126
126
  insertMacroFromMacroBrowser: (0, _actions2.insertMacroFromMacroBrowser)(_api === null || _api === void 0 || (_api$analytics2 = _api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions),
127
+ insertOrReplaceExtension: function insertOrReplaceExtension(_ref4) {
128
+ var editorView = _ref4.editorView,
129
+ action = _ref4.action,
130
+ attrs = _ref4.attrs,
131
+ content = _ref4.content,
132
+ position = _ref4.position,
133
+ size = _ref4.size,
134
+ tr = _ref4.tr;
135
+ return (0, _actions.insertOrReplaceExtension)({
136
+ editorView: editorView,
137
+ action: action,
138
+ attrs: attrs,
139
+ content: content,
140
+ position: position,
141
+ size: size,
142
+ tr: tr
143
+ });
144
+ },
145
+ insertOrReplaceBodiedExtension: function insertOrReplaceBodiedExtension(_ref5) {
146
+ var editorView = _ref5.editorView,
147
+ action = _ref5.action,
148
+ attrs = _ref5.attrs,
149
+ content = _ref5.content,
150
+ position = _ref5.position,
151
+ size = _ref5.size,
152
+ tr = _ref5.tr;
153
+ return (0, _actions.insertOrReplaceBodiedExtension)({
154
+ editorView: editorView,
155
+ action: action,
156
+ attrs: attrs,
157
+ content: content,
158
+ position: position,
159
+ size: size,
160
+ tr: tr
161
+ });
162
+ },
127
163
  editSelectedExtension: (0, _actions.createEditSelectedExtensionAction)({
128
164
  editorViewRef: editorViewRef,
129
165
  editorAnalyticsAPI: _api === null || _api === void 0 || (_api$analytics3 = _api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions,
@@ -8,6 +8,7 @@ var _react = require("@emotion/react");
8
8
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
9
9
  // Quality Ticket: https://product-fabric.atlassian.net/browse/DSP-4249
10
10
  /** @jsx jsx */
11
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
11
12
 
12
13
  var imageContainerStyles = (0, _react.css)({
13
14
  margin: "0 auto ".concat("var(--ds-space-300, 24px)"),
@@ -19,6 +19,7 @@ var _RequiredIndicator = require("./common/RequiredIndicator");
19
19
  var _excluded = ["value"],
20
20
  _excluded2 = ["id", "value"];
21
21
  /** @jsx jsx */
22
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
22
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); }
23
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 && Object.prototype.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; }
24
25
  var toggleFieldWrapperStyles = (0, _react2.css)({
@@ -116,7 +117,7 @@ function Toggle(_ref3) {
116
117
  id: id,
117
118
  htmlFor: id
118
119
  }, label, isRequired ?
119
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
120
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
120
121
  (0, _react2.jsx)("span", {
121
122
  css: _RequiredIndicator.requiredIndicator,
122
123
  "aria-hidden": "true"
@@ -16,6 +16,7 @@ var _FieldMessages = _interopRequireDefault(require("../FieldMessages"));
16
16
  var _types = require("../types");
17
17
  var _excluded = ["onChange", "value"];
18
18
  /** @jsx jsx */
19
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
19
20
  function _validate(value, isRequired) {
20
21
  if (isRequired && !(value !== null && value !== void 0 && value.length)) {
21
22
  return _types.ValidationError.Required;
@@ -16,7 +16,7 @@ var _FieldMessages = _interopRequireDefault(require("../FieldMessages"));
16
16
  var _utils = require("../utils");
17
17
  var _RequiredIndicator = require("./common/RequiredIndicator");
18
18
  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; }
19
- 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; } /** @jsx jsx */
19
+ 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; } /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
20
20
  /*
21
21
  NOTE: color used here are not yet in atlaskit code
22
22
  this is part of extended color pack from ADG, which is yet to be release
@@ -332,6 +332,7 @@ var colorPickerWrapperStyles = (0, _react2.css)({
332
332
  paddingRight: "var(--ds-space-100, 8px)"
333
333
  });
334
334
  var colorPickerLabelStyles = (0, _react2.css)({
335
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
335
336
  fontSize: "".concat(_typography.headingSizes.h400.size, "px"),
336
337
  marginTop: 0
337
338
  });
@@ -395,7 +396,7 @@ var ColorPickerField = function ColorPickerField(_ref) {
395
396
  }, (0, _react2.jsx)("label", {
396
397
  css: colorPickerLabelStyles
397
398
  }, label, isRequired &&
398
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
399
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
399
400
  (0, _react2.jsx)("span", {
400
401
  css: _RequiredIndicator.requiredIndicator,
401
402
  "aria-hidden": "true"
@@ -20,7 +20,7 @@ var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
20
20
  var _FieldMessages = _interopRequireDefault(require("../FieldMessages"));
21
21
  var _utils = require("../utils");
22
22
  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; }
23
- 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; } /** @jsx jsx */
23
+ 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; } /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
24
24
  var horizontalFieldsStyles = (0, _react2.css)({
25
25
  display: 'flex',
26
26
  flexDirection: 'row',
@@ -19,6 +19,8 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
19
19
  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 && Object.prototype.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; }
20
20
  /** @jsx jsx */
21
21
 
22
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
23
+
22
24
  var expandContainerStyles = (0, _react2.css)({
23
25
  borderBottom: "1px solid ".concat("var(--ds-border, ".concat(_colors.N40, ")"))
24
26
  });
@@ -31,7 +33,7 @@ var expandControlStyles = (0, _react2.css)({
31
33
  var chevronContainerStyles = (0, _react2.css)({
32
34
  display: 'flex',
33
35
  alignItems: 'center',
34
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
36
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
35
37
  '& > button': {
36
38
  width: "var(--ds-space-300, 24px)",
37
39
  height: "var(--ds-space-300, 24px)"
@@ -31,7 +31,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
31
31
  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; }
32
32
  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; }
33
33
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
34
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
34
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
35
35
  var actionsWrapperStyles = (0, _react2.css)({
36
36
  borderTop: "1px solid ".concat("var(--ds-border, ".concat(_colors.N40A, ")")),
37
37
  marginTop: "var(--ds-space-200, 16px)",
@@ -8,11 +8,12 @@ exports.formatOptionLabel = void 0;
8
8
  var _react = require("@emotion/react");
9
9
  var _avatar = _interopRequireDefault(require("@atlaskit/avatar"));
10
10
  /** @jsx jsx */
11
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
11
12
 
12
13
  var itemWrapperStyles = (0, _react.css)({
13
14
  display: 'flex',
14
15
  alignItems: 'center',
15
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
16
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
16
17
  small: {
17
18
  margin: 0,
18
19
  display: 'block',
@@ -15,6 +15,8 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
15
15
  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 && Object.prototype.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; }
16
16
  /** @jsx jsx */
17
17
 
18
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
19
+
18
20
  var panelWrapperStyles = (0, _react2.css)({
19
21
  flexGrow: 1,
20
22
  maxWidth: '100%'
@@ -6,6 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.requiredIndicator = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  var _colors = require("@atlaskit/theme/colors");
9
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
+
11
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
9
12
  var requiredIndicator = exports.requiredIndicator = (0, _react.css)({
10
13
  color: "var(--ds-text-danger, ".concat(_colors.R500, ")")
11
14
  });
@@ -17,6 +17,8 @@ var _colors = require("@atlaskit/theme/colors");
17
17
  var _constants = require("@atlaskit/theme/constants");
18
18
  /** @jsx jsx */
19
19
 
20
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
21
+
20
22
  var iconWidth = 40;
21
23
  var buttonWidth = 40;
22
24
  var margin = 16;
@@ -30,12 +32,13 @@ var itemIconStyles = (0, _react2.css)({
30
32
  height: iconWidth,
31
33
  overflow: 'hidden',
32
34
  border: "1px solid ".concat("var(--ds-border, rgba(223, 225, 229, 0.5))"),
35
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
33
36
  borderRadius: "".concat((0, _constants.borderRadius)(), "px"),
34
37
  boxSizing: 'border-box',
35
38
  display: 'flex',
36
39
  justifyContent: 'center',
37
40
  alignItems: 'center',
38
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
41
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
39
42
  div: {
40
43
  width: iconWidth,
41
44
  height: iconWidth
@@ -49,6 +52,7 @@ var itemBodyStyles = (0, _react2.css)({
49
52
  lineHeight: 1.4,
50
53
  margin: "0 ".concat("var(--ds-space-200, 16px)"),
51
54
  flexGrow: 3,
55
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
52
56
  maxWidth: "calc(100% - ".concat(gapSizeForEllipsis, "px)")
53
57
  });
54
58
  var centeredItemTitleStyles = (0, _react2.css)({
@@ -59,8 +63,9 @@ var centeredItemTitleStyles = (0, _react2.css)({
59
63
  var itemTextStyles = (0, _react2.css)({
60
64
  maxWidth: '100%',
61
65
  whiteSpace: 'initial',
62
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
66
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
63
67
  itemSummary: {
68
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
64
69
  fontSize: (0, _editorSharedStyles.relativeFontSizeToBase16)(11.67),
65
70
  color: "var(--ds-text-subtlest, ".concat(_colors.N200, ")"),
66
71
  marginTop: "var(--ds-space-050, 4px)",
@@ -8,6 +8,7 @@ exports.default = void 0;
8
8
  var _react = require("@emotion/react");
9
9
  var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
10
10
  /** @jsx jsx */
11
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
11
12
 
12
13
  var spinnerWrapperStyles = (0, _react.css)({
13
14
  display: 'flex',
@@ -14,6 +14,8 @@ var _colors = require("@atlaskit/theme/colors");
14
14
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
15
15
  /** @jsx jsx */
16
16
 
17
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
18
+
17
19
  var removableFieldWrapperStyles = (0, _react2.css)({
18
20
  position: 'relative',
19
21
  marginBottom: 0
@@ -14,6 +14,8 @@ var _checkCircle = _interopRequireDefault(require("@atlaskit/icon/glyph/check-ci
14
14
  var _colors = require("@atlaskit/theme/colors");
15
15
  /** @jsx jsx */
16
16
 
17
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
18
+
17
19
  var noop = function noop() {};
18
20
  var saveIndicatorWrapperStyles = (0, _react2.css)({
19
21
  display: 'flex',
@@ -203,4 +203,40 @@ export const createEditSelectedExtensionAction = ({
203
203
  updateExtension
204
204
  } = getPluginState(view.state);
205
205
  return editExtension(null, applyChangeToContextPanel, editorAnalyticsAPI, updateExtension)(view.state, view.dispatch, view);
206
+ };
207
+ export const insertOrReplaceExtension = ({
208
+ editorView,
209
+ action,
210
+ attrs,
211
+ content,
212
+ position,
213
+ size = 0,
214
+ tr
215
+ }) => {
216
+ const newNode = editorView.state.schema.node('extension', attrs, content);
217
+ if (action === 'insert') {
218
+ tr = editorView.state.tr.insert(position, newNode);
219
+ return tr;
220
+ } else {
221
+ tr.replaceWith(position, position + size, newNode);
222
+ return tr;
223
+ }
224
+ };
225
+ export const insertOrReplaceBodiedExtension = ({
226
+ editorView,
227
+ action,
228
+ attrs,
229
+ content,
230
+ position,
231
+ size = 0,
232
+ tr
233
+ }) => {
234
+ const newNode = editorView.state.schema.node('bodiedExtension', attrs, content);
235
+ if (action === 'insert') {
236
+ tr = editorView.state.tr.insert(position, newNode);
237
+ return tr;
238
+ } else {
239
+ tr.replaceWith(position, position + size, newNode);
240
+ return tr;
241
+ }
206
242
  };
@@ -1,7 +1,7 @@
1
1
  import { bodiedExtension, extension, extensionFrame, inlineExtension, multiBodiedExtension } from '@atlaskit/adf-schema';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
4
- import { createEditSelectedExtensionAction } from './actions';
4
+ import { createEditSelectedExtensionAction, insertOrReplaceBodiedExtension, insertOrReplaceExtension } from './actions';
5
5
  import { forceAutoSave } from './commands';
6
6
  import { getContextPanel } from './context-panel';
7
7
  import { createExtensionAPI } from './extension-api';
@@ -115,6 +115,40 @@ export const extensionPlugin = ({
115
115
  });
116
116
  },
117
117
  insertMacroFromMacroBrowser: insertMacroFromMacroBrowser(api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions),
118
+ insertOrReplaceExtension: ({
119
+ editorView,
120
+ action,
121
+ attrs,
122
+ content,
123
+ position,
124
+ size,
125
+ tr
126
+ }) => insertOrReplaceExtension({
127
+ editorView,
128
+ action,
129
+ attrs,
130
+ content,
131
+ position,
132
+ size,
133
+ tr
134
+ }),
135
+ insertOrReplaceBodiedExtension: ({
136
+ editorView,
137
+ action,
138
+ attrs,
139
+ content,
140
+ position,
141
+ size,
142
+ tr
143
+ }) => insertOrReplaceBodiedExtension({
144
+ editorView,
145
+ action,
146
+ attrs,
147
+ content,
148
+ position,
149
+ size,
150
+ tr
151
+ }),
118
152
  editSelectedExtension: createEditSelectedExtensionAction({
119
153
  editorViewRef,
120
154
  editorAnalyticsAPI: api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions,
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
2
2
  // Quality Ticket: https://product-fabric.atlassian.net/browse/DSP-4249
3
3
  /** @jsx jsx */
4
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
5
  import { css, jsx } from '@emotion/react';
5
6
  const imageContainerStyles = css({
6
7
  margin: `0 auto ${"var(--ds-space-300, 24px)"}`,
@@ -1,6 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  /** @jsx jsx */
3
3
  import React, { Fragment } from 'react';
4
+
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
6
  import { css, jsx } from '@emotion/react';
5
7
  import { Checkbox as AKCheckbox } from '@atlaskit/checkbox';
6
8
  import { Field } from '@atlaskit/form';
@@ -105,7 +107,7 @@ function Toggle({
105
107
  id: id,
106
108
  htmlFor: id
107
109
  }, label, isRequired ?
108
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
110
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
109
111
  jsx("span", {
110
112
  css: requiredIndicator,
111
113
  "aria-hidden": "true"
@@ -2,6 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  /** @jsx jsx */
3
3
 
4
4
  import { Fragment, useCallback } from 'react';
5
+
6
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
5
7
  import { css, jsx } from '@emotion/react';
6
8
  import { Checkbox as AKCheckbox } from '@atlaskit/checkbox';
7
9
  import { Fieldset as AKFieldset, Field } from '@atlaskit/form';
@@ -1,5 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { Fragment } from 'react';
3
+
4
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
5
  import { css, jsx } from '@emotion/react';
4
6
  import { chartsColorPaletteTooltipMessages, DEFAULT_BORDER_COLOR } from '@atlaskit/editor-common/ui-color';
5
7
  import { ColorPickerButton } from '@atlaskit/editor-common/ui-menu';
@@ -321,6 +323,7 @@ const colorPickerWrapperStyles = css({
321
323
  paddingRight: "var(--ds-space-100, 8px)"
322
324
  });
323
325
  const colorPickerLabelStyles = css({
326
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
324
327
  fontSize: `${headingSizes.h400.size}px`,
325
328
  marginTop: 0
326
329
  });
@@ -387,7 +390,7 @@ const ColorPickerField = ({
387
390
  }, jsx("label", {
388
391
  css: colorPickerLabelStyles
389
392
  }, label, isRequired &&
390
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
393
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
391
394
  jsx("span", {
392
395
  css: requiredIndicator,
393
396
  "aria-hidden": "true"
@@ -1,6 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  /** @jsx jsx */
3
3
  import { Fragment, useEffect, useMemo, useState } from 'react';
4
+
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
6
  import { css, jsx } from '@emotion/react';
5
7
  import { injectIntl } from 'react-intl-next';
6
8
  import { DatePicker } from '@atlaskit/datetime-picker';
@@ -1,5 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import React, { useState } from 'react';
3
+
4
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
5
  import { css, jsx } from '@emotion/react';
4
6
  import { injectIntl } from 'react-intl-next';
5
7
  import Button from '@atlaskit/button';
@@ -19,7 +21,7 @@ const expandControlStyles = css({
19
21
  const chevronContainerStyles = css({
20
22
  display: 'flex',
21
23
  alignItems: 'center',
22
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
24
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
23
25
  '& > button': {
24
26
  width: "var(--ds-space-300, 24px)",
25
27
  height: "var(--ds-space-300, 24px)"
@@ -1,6 +1,8 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  /** @jsx jsx */
3
3
  import React, { Fragment } from 'react';
4
+
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
6
  import { css, jsx } from '@emotion/react';
5
7
  import { injectIntl } from 'react-intl-next';
6
8
  import Button from '@atlaskit/button/custom-theme-button';
@@ -1,10 +1,11 @@
1
1
  /** @jsx jsx */
2
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
3
  import { css, jsx } from '@emotion/react';
3
4
  import Avatar from '@atlaskit/avatar';
4
5
  const itemWrapperStyles = css({
5
6
  display: 'flex',
6
7
  alignItems: 'center',
7
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
8
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
8
9
  small: {
9
10
  margin: 0,
10
11
  display: 'block',
@@ -1,5 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import React, { useState } from 'react';
3
+
4
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
5
  import { css, jsx } from '@emotion/react';
4
6
  import { injectIntl } from 'react-intl-next';
5
7
  import Tabs, { Tab, TabList, TabPanel } from '@atlaskit/tabs';
@@ -1,5 +1,7 @@
1
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
1
2
  import { css } from '@emotion/react';
2
3
  import { R500 } from '@atlaskit/theme/colors';
4
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
3
5
  export const requiredIndicator = css({
4
6
  color: `var(--ds-text-danger, ${R500})`
5
7
  });
@@ -1,5 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { Fragment } from 'react';
3
+
4
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
5
  import { css, jsx } from '@emotion/react';
4
6
  import { injectIntl } from 'react-intl-next';
5
7
  import Loadable from 'react-loadable';
@@ -22,12 +24,13 @@ const itemIconStyles = css({
22
24
  height: iconWidth,
23
25
  overflow: 'hidden',
24
26
  border: `1px solid ${"var(--ds-border, rgba(223, 225, 229, 0.5))"}`,
27
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
25
28
  borderRadius: `${borderRadius()}px`,
26
29
  boxSizing: 'border-box',
27
30
  display: 'flex',
28
31
  justifyContent: 'center',
29
32
  alignItems: 'center',
30
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
33
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
31
34
  div: {
32
35
  width: iconWidth,
33
36
  height: iconWidth
@@ -41,6 +44,7 @@ const itemBodyStyles = css({
41
44
  lineHeight: 1.4,
42
45
  margin: `0 ${"var(--ds-space-200, 16px)"}`,
43
46
  flexGrow: 3,
47
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
44
48
  maxWidth: `calc(100% - ${gapSizeForEllipsis}px)`
45
49
  });
46
50
  const centeredItemTitleStyles = css({
@@ -51,8 +55,9 @@ const centeredItemTitleStyles = css({
51
55
  const itemTextStyles = css({
52
56
  maxWidth: '100%',
53
57
  whiteSpace: 'initial',
54
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
58
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
55
59
  itemSummary: {
60
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
56
61
  fontSize: relativeFontSizeToBase16(11.67),
57
62
  color: `var(--ds-text-subtlest, ${N200})`,
58
63
  marginTop: "var(--ds-space-050, 4px)",
@@ -1,4 +1,5 @@
1
1
  /** @jsx jsx */
2
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
3
  import { css, jsx } from '@emotion/react';
3
4
  import Spinner from '@atlaskit/spinner';
4
5
  const spinnerWrapperStyles = css({
@@ -1,5 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
+
4
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
5
  import { css, jsx } from '@emotion/react';
4
6
  import { injectIntl } from 'react-intl-next';
5
7
  import { configPanelMessages as messages } from '@atlaskit/editor-common/extensions';
@@ -1,5 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { Fragment, useCallback, useEffect, useRef, useState } from 'react';
3
+
4
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
5
  import { css, jsx } from '@emotion/react';
4
6
  import { FormattedMessage } from 'react-intl-next';
5
7
  import { messages } from '@atlaskit/editor-common/extensions';