@atlaskit/editor-plugin-extension 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/editor-actions/actions.js +16 -14
  3. package/dist/cjs/extensionPlugin.js +4 -1
  4. package/dist/cjs/pm-plugins/keymap.js +6 -3
  5. package/dist/cjs/pm-plugins/macro/index.js +0 -24
  6. package/dist/cjs/pm-plugins/main.js +19 -25
  7. package/dist/cjs/pm-plugins/toolbar.js +15 -5
  8. package/dist/cjs/pm-plugins/utils.js +2 -0
  9. package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +4 -1
  10. package/dist/cjs/ui/ConfigPanel/Fields/Boolean.js +8 -2
  11. package/dist/cjs/ui/ConfigPanel/Fields/CheckboxGroup.js +8 -1
  12. package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +4 -1
  13. package/dist/cjs/ui/ConfigPanel/Fields/Date.js +4 -1
  14. package/dist/cjs/ui/ConfigPanel/Fields/DateRange.js +16 -4
  15. package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +4 -1
  16. package/dist/cjs/ui/ConfigPanel/Fields/Number.js +4 -1
  17. package/dist/cjs/ui/ConfigPanel/Fields/RadioGroup.js +4 -1
  18. package/dist/cjs/ui/ConfigPanel/Fields/Select.js +6 -1
  19. package/dist/cjs/ui/ConfigPanel/Fields/String.js +8 -2
  20. package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +7 -3
  21. package/dist/cjs/ui/ConfigPanel/Header.js +4 -1
  22. package/dist/cjs/ui/ConfigPanel/utils.js +3 -0
  23. package/dist/cjs/ui/SaveIndicator/SaveIndicator.js +4 -1
  24. package/dist/cjs/ui/context-panel.js +8 -6
  25. package/dist/es2019/editor-actions/actions.js +13 -5
  26. package/dist/es2019/extensionPlugin.js +4 -1
  27. package/dist/es2019/pm-plugins/keymap.js +5 -2
  28. package/dist/es2019/pm-plugins/macro/index.js +0 -1
  29. package/dist/es2019/pm-plugins/main.js +20 -8
  30. package/dist/es2019/pm-plugins/toolbar.js +13 -3
  31. package/dist/es2019/pm-plugins/utils.js +2 -0
  32. package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +4 -1
  33. package/dist/es2019/ui/ConfigPanel/Fields/Boolean.js +8 -2
  34. package/dist/es2019/ui/ConfigPanel/Fields/CheckboxGroup.js +8 -1
  35. package/dist/es2019/ui/ConfigPanel/Fields/CustomSelect.js +4 -1
  36. package/dist/es2019/ui/ConfigPanel/Fields/Date.js +4 -1
  37. package/dist/es2019/ui/ConfigPanel/Fields/DateRange.js +16 -4
  38. package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +4 -1
  39. package/dist/es2019/ui/ConfigPanel/Fields/Number.js +4 -1
  40. package/dist/es2019/ui/ConfigPanel/Fields/RadioGroup.js +4 -1
  41. package/dist/es2019/ui/ConfigPanel/Fields/Select.js +6 -1
  42. package/dist/es2019/ui/ConfigPanel/Fields/String.js +8 -2
  43. package/dist/es2019/ui/ConfigPanel/Fields/UserSelect.js +7 -3
  44. package/dist/es2019/ui/ConfigPanel/Header.js +4 -1
  45. package/dist/es2019/ui/ConfigPanel/transformers.js +8 -2
  46. package/dist/es2019/ui/ConfigPanel/utils.js +3 -0
  47. package/dist/es2019/ui/SaveIndicator/SaveIndicator.js +4 -1
  48. package/dist/es2019/ui/context-panel.js +3 -1
  49. package/dist/esm/editor-actions/actions.js +13 -5
  50. package/dist/esm/extensionPlugin.js +4 -1
  51. package/dist/esm/pm-plugins/keymap.js +5 -2
  52. package/dist/esm/pm-plugins/macro/index.js +0 -1
  53. package/dist/esm/pm-plugins/main.js +21 -9
  54. package/dist/esm/pm-plugins/toolbar.js +13 -3
  55. package/dist/esm/pm-plugins/utils.js +2 -0
  56. package/dist/esm/ui/ConfigPanel/ConfigPanel.js +4 -1
  57. package/dist/esm/ui/ConfigPanel/Fields/Boolean.js +8 -2
  58. package/dist/esm/ui/ConfigPanel/Fields/CheckboxGroup.js +8 -1
  59. package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +4 -1
  60. package/dist/esm/ui/ConfigPanel/Fields/Date.js +4 -1
  61. package/dist/esm/ui/ConfigPanel/Fields/DateRange.js +16 -4
  62. package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +4 -1
  63. package/dist/esm/ui/ConfigPanel/Fields/Number.js +4 -1
  64. package/dist/esm/ui/ConfigPanel/Fields/RadioGroup.js +4 -1
  65. package/dist/esm/ui/ConfigPanel/Fields/Select.js +6 -1
  66. package/dist/esm/ui/ConfigPanel/Fields/String.js +8 -2
  67. package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +7 -3
  68. package/dist/esm/ui/ConfigPanel/Header.js +4 -1
  69. package/dist/esm/ui/ConfigPanel/utils.js +3 -0
  70. package/dist/esm/ui/SaveIndicator/SaveIndicator.js +4 -1
  71. package/dist/esm/ui/context-panel.js +3 -1
  72. package/dist/types/editor-actions/actions.d.ts +1 -1
  73. package/dist/types/pm-plugins/macro/index.d.ts +0 -4
  74. package/dist/types/pm-plugins/main.d.ts +1 -4
  75. package/dist/types-ts4.5/editor-actions/actions.d.ts +1 -1
  76. package/dist/types-ts4.5/pm-plugins/macro/index.d.ts +0 -4
  77. package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -4
  78. package/example-utils/config-panel/ConfigPanelWithExtensionPicker.tsx +2 -0
  79. package/example-utils/config-panel/ConfigPanelWithProviders.tsx +1 -1
  80. package/example-utils/config-panel/ExtensionNodePicker.tsx +3 -1
  81. package/example-utils/config-panel/example-manifest-all-fields.ts +2 -0
  82. package/example-utils/config-panel/example-manifest-individual-fields.ts +6 -0
  83. package/package.json +5 -5
  84. package/dist/cjs/ui/ConfigPanel/index.js +0 -9
  85. package/dist/es2019/ui/ConfigPanel/index.js +0 -2
  86. package/dist/esm/ui/ConfigPanel/index.js +0 -2
  87. package/dist/types/ui/ConfigPanel/index.d.ts +0 -2
  88. package/dist/types-ts4.5/ui/ConfigPanel/index.d.ts +0 -2
@@ -4,13 +4,15 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
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
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; }
6
6
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD, TARGET_SELECTION_SOURCE } from '@atlaskit/editor-common/analytics';
7
- export { transformSliceToRemoveOpenBodiedExtension } from '@atlaskit/editor-common/transforms';
8
7
  import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
9
8
  import { findSelectedNodeOfType, replaceParentNodeOfType, replaceSelectedNode } from '@atlaskit/editor-prosemirror/utils';
10
9
  import { createExtensionAPI, getEditInLegacyMacroBrowser } from '../pm-plugins/extension-api';
11
- import { getPluginState } from '../pm-plugins/main';
10
+ import { getPluginState } from '../pm-plugins/plugin-factory';
12
11
  import { findExtensionWithLocalId } from '../pm-plugins/utils';
13
- export var buildExtensionNode = function buildExtensionNode(type, schema, attrs, content, marks) {
12
+ export var buildExtensionNode = function buildExtensionNode(type, schema, attrs, content, marks
13
+ // Ignored via go/ees005
14
+ // eslint-disable-next-line @typescript-eslint/max-params
15
+ ) {
14
16
  switch (type) {
15
17
  case 'extension':
16
18
  return schema.nodes.extension.createChecked(attrs, content, marks);
@@ -23,7 +25,10 @@ export var buildExtensionNode = function buildExtensionNode(type, schema, attrs,
23
25
  }
24
26
  };
25
27
  export var performNodeUpdate = function performNodeUpdate(editorAnalyticsAPI) {
26
- return function (type, newAttrs, content, marks, shouldScrollIntoView) {
28
+ return function (type, newAttrs, content, marks, shouldScrollIntoView
29
+ // Ignored via go/ees005
30
+ // eslint-disable-next-line @typescript-eslint/max-params
31
+ ) {
27
32
  return function (_state, _dispatch, view) {
28
33
  if (!view) {
29
34
  throw Error('EditorView is required to perform node update!');
@@ -166,7 +171,10 @@ var updateExtensionParams = function updateExtensionParams(editorAnalyticsAPI) {
166
171
  }();
167
172
  };
168
173
  };
169
- export var editExtension = function editExtension(macroProvider, applyChangeToContextPanel, editorAnalyticsAPI, updateExtension) {
174
+ export var editExtension = function editExtension(macroProvider, applyChangeToContextPanel, editorAnalyticsAPI, updateExtension
175
+ // Ignored via go/ees005
176
+ // eslint-disable-next-line @typescript-eslint/max-params
177
+ ) {
170
178
  return function (state, dispatch, view) {
171
179
  if (!view) {
172
180
  return false;
@@ -6,7 +6,8 @@ import { createExtensionAPI } from './pm-plugins/extension-api';
6
6
  import keymapPlugin from './pm-plugins/keymap';
7
7
  import { createPlugin as createMacroPlugin } from './pm-plugins/macro';
8
8
  import { insertMacroFromMacroBrowser, runMacroAutoConvert } from './pm-plugins/macro/actions';
9
- import { createPlugin, pluginKey } from './pm-plugins/main';
9
+ import { createPlugin } from './pm-plugins/main';
10
+ import { pluginKey } from './pm-plugins/plugin-key';
10
11
  import { bodiedExtensionSpecWithFixedToDOM } from './pm-plugins/toDOM-fixes/bodiedExtension';
11
12
  import { getToolbarConfig } from './pm-plugins/toolbar';
12
13
  import { createPlugin as createUniqueIdPlugin } from './pm-plugins/unique-id';
@@ -105,6 +106,8 @@ export var extensionPlugin = function extensionPlugin(_ref) {
105
106
  api: function api() {
106
107
  var _api$contextPanel2, _api$analytics;
107
108
  return createExtensionAPI({
109
+ // Ignored via go/ees005
110
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
108
111
  editorView: editorViewRef.current,
109
112
  applyChange: _api === null || _api === void 0 || (_api$contextPanel2 = _api.contextPanel) === null || _api$contextPanel2 === void 0 ? void 0 : _api$contextPanel2.actions.applyChange,
110
113
  editorAnalyticsAPI: _api === null || _api === void 0 || (_api$analytics = _api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions
@@ -1,10 +1,13 @@
1
1
  import { bindKeymapWithCommand, escape } from '@atlaskit/editor-common/keymaps';
2
2
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
3
3
  import { clearEditingContext } from '../editor-commands/commands';
4
- import { getPluginState } from './main';
4
+ import { getPluginState } from './plugin-factory';
5
5
  export default function keymapPlugin(applyChange) {
6
6
  var list = {};
7
- bindKeymapWithCommand(escape.common, function (state, dispatch) {
7
+ bindKeymapWithCommand(
8
+ // Ignored via go/ees005
9
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
10
+ escape.common, function (state, dispatch) {
8
11
  var extensionState = getPluginState(state);
9
12
  if (!extensionState.showContextPanel) {
10
13
  return false;
@@ -4,7 +4,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
5
  import { setMacroProvider } from './actions';
6
6
  import { pluginKey } from './plugin-key';
7
- export { insertMacroFromMacroBrowser, resolveMacro, runMacroAutoConvert, setMacroProvider } from './actions';
8
7
  export var createPlugin = function createPlugin(dispatch, providerFactory) {
9
8
  return new SafePlugin({
10
9
  state: {
@@ -8,7 +8,7 @@ import { findParentNodeOfTypeClosestToPos, findSelectedNodeOfType } from '@atlas
8
8
  import { fg } from '@atlaskit/platform-feature-flags';
9
9
  import { clearEditingContext, updateState } from '../editor-commands/commands';
10
10
  import { lazyExtensionNodeView } from '../nodeviews/lazyExtension';
11
- import { createCommand, createPluginState, getPluginState } from './plugin-factory';
11
+ import { createPluginState, getPluginState } from './plugin-factory';
12
12
  import { pluginKey } from './plugin-key';
13
13
  import { updateEditButton } from './update-edit-button';
14
14
  import { getSelectedDomElement, getSelectedExtension } from './utils';
@@ -160,13 +160,16 @@ export var handleUpdate = function handleUpdate(_ref3) {
160
160
  }
161
161
  return true;
162
162
  };
163
- var createPlugin = function createPlugin(dispatch, providerFactory, extensionHandlers, portalProviderAPI, eventDispatcher, pluginInjectionApi) {
163
+ export var createPlugin = function createPlugin(dispatch, providerFactory, extensionHandlers, portalProviderAPI, eventDispatcher, pluginInjectionApi) {
164
164
  var _featureFlags$macroIn;
165
165
  var useLongPressSelection = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
166
166
  var options = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : {};
167
167
  var featureFlags = arguments.length > 8 ? arguments[8] : undefined;
168
168
  var allowDragAndDrop = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : true;
169
- var __rendererExtensionOptions = arguments.length > 10 ? arguments[10] : undefined;
169
+ var __rendererExtensionOptions
170
+ // Ignored via go/ees005
171
+ // eslint-disable-next-line @typescript-eslint/max-params
172
+ = arguments.length > 10 ? arguments[10] : undefined;
170
173
  var state = createPluginState(dispatch, {
171
174
  showEditButton: false,
172
175
  showContextPanel: false
@@ -205,11 +208,19 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
205
208
  handleDOMEvents: {
206
209
  blur: function blur(view, event) {
207
210
  if (fg('platform_editor_legacy_content_macro')) {
208
- var currentTarget = event.relatedTarget;
209
- var source = event.target;
211
+ var currentSelection = event.relatedTarget;
212
+ var previousSelection = event.target;
213
+ if (!(currentSelection instanceof HTMLElement) || !(previousSelection instanceof HTMLElement)) {
214
+ return;
215
+ }
216
+ var wasPreviousSelectionInsideExtensionEditableArea = !!previousSelection.closest('.extension-editable-area');
217
+ var isCurrentSelectionInsideExtensionEditableArea = !!currentSelection.closest('.extension-editable-area');
218
+ var maybeFromPopup = !!currentSelection.closest('[data-editor-popup="true"]');
210
219
 
211
- // If the focus is going from outside to inside an area designated as an editable area of an extension, then the extension selection is reset.
212
- if (!!currentTarget.closest('.extension-editable-area') !== !!source.closest('.extension-editable-area')) {
220
+ // We want to reset the user's selection if they are entering or exiting the extension editable area.
221
+ // To do so, we check if there previous selection was inside or outside, and if they are now inside or outside.
222
+ // We want to ignore this if a blur event is originating from an editor popup.
223
+ if (!maybeFromPopup && wasPreviousSelectionInsideExtensionEditableArea !== isCurrentSelectionInsideExtensionEditableArea) {
213
224
  var emptySelection = new TextSelection(view.state.doc.resolve(0));
214
225
  var tr = view.state.tr.setSelection(emptySelection);
215
226
  view.dispatch(tr);
@@ -323,6 +334,8 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
323
334
  {
324
335
  useLongPressSelection: useLongPressSelection
325
336
  }),
337
+ // Ignored via go/ees005
338
+ // eslint-disable-next-line @typescript-eslint/max-params
326
339
  handleDrop: function handleDrop(view, event, slice, moved) {
327
340
  if (fg('platform_editor_legacy_content_macro')) {
328
341
  if (!allowDragAndDrop) {
@@ -337,5 +350,4 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
337
350
  }
338
351
  }
339
352
  });
340
- };
341
- export { pluginKey, createPlugin, createCommand, getPluginState };
353
+ };
@@ -18,7 +18,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
18
18
  import { editExtension } from '../editor-actions/actions';
19
19
  import { removeDescendantNodes, removeExtension, updateExtensionLayout } from '../editor-commands/commands';
20
20
  import { pluginKey as macroPluginKey } from './macro/plugin-key';
21
- import { getPluginState } from './main';
21
+ import { getPluginState } from './plugin-factory';
22
22
  import { getSelectedExtension } from './utils';
23
23
  var isLayoutSupported = function isLayoutSupported(state, selectedExtNode) {
24
24
  var _state$schema$nodes = state.schema.nodes,
@@ -40,7 +40,10 @@ var isLayoutSupported = function isLayoutSupported(state, selectedExtNode) {
40
40
  // and not inside a layoutSection
41
41
  return !!((isMultiBodiedExtension || isNonEmbeddedBodiedExtension || isNonEmbeddedExtension) && !hasParentNodeOfType([layoutSection])(selection));
42
42
  };
43
- var breakoutOptions = function breakoutOptions(state, formatMessage, extensionState, breakoutEnabled, editorAnalyticsAPI) {
43
+ var breakoutOptions = function breakoutOptions(state, formatMessage, extensionState, breakoutEnabled, editorAnalyticsAPI
44
+ // Ignored via go/ees005
45
+ // eslint-disable-next-line @typescript-eslint/max-params
46
+ ) {
44
47
  var nodeWithPos = getSelectedExtension(state, true);
45
48
 
46
49
  // we should only return breakout options when breakouts are enabled and the node supports them
@@ -74,7 +77,10 @@ var breakoutOptions = function breakoutOptions(state, formatMessage, extensionSt
74
77
  }
75
78
  return [];
76
79
  };
77
- var editButton = function editButton(formatMessage, extensionState, applyChangeToContextPanel, editorAnalyticsAPI) {
80
+ var editButton = function editButton(formatMessage, extensionState, applyChangeToContextPanel, editorAnalyticsAPI
81
+ // Ignored via go/ees005
82
+ // eslint-disable-next-line @typescript-eslint/max-params
83
+ ) {
78
84
  if (!extensionState.showEditButton) {
79
85
  return [];
80
86
  }
@@ -137,6 +143,8 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
137
143
  }
138
144
  return {
139
145
  title: 'Extension floating controls',
146
+ // Ignored via go/ees005
147
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
140
148
  getDomRef: function getDomRef() {
141
149
  return extensionState.element.parentElement || undefined;
142
150
  },
@@ -153,6 +161,8 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
153
161
  return nextPos;
154
162
  }
155
163
  var scrollWrapper = editorView.dom.closest('.fabric-editor-popup-scroll-parent') || document.body;
164
+ // Ignored via go/ees005
165
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
156
166
  var nestedBodiedExtensionDomElement = editorView.nodeDOM(extensionNode.pos);
157
167
  var nestedBodiedExtensionRect = nestedBodiedExtensionDomElement === null || nestedBodiedExtensionDomElement === void 0 ? void 0 : nestedBodiedExtensionDomElement.getBoundingClientRect();
158
168
  var wrapperBounds = scrollWrapper.getBoundingClientRect();
@@ -36,6 +36,8 @@ export var findExtensionWithLocalId = function findExtensionWithLocalId(state, l
36
36
  return matched;
37
37
  };
38
38
  export var getSelectedDomElement = function getSelectedDomElement(schema, domAtPos, selectedExtensionNode) {
39
+ // Ignored via go/ees005
40
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
39
41
  var selectedExtensionDomNode = findDomRefAtPos(selectedExtensionNode.pos, domAtPos);
40
42
  var isContentExtension = selectedExtensionNode.node.type !== schema.nodes.bodiedExtension;
41
43
  return (
@@ -135,7 +135,10 @@ var ConfigPanel = /*#__PURE__*/function (_React$Component) {
135
135
  // https://product-fabric.atlassian.net/browse/DST-2697
136
136
  // workaround for DST-2697, remove this function once fix.
137
137
  _defineProperty(_this, "backfillTabFormData", function (fields, formData, currentParameters) {
138
- var getRelevantData = function getRelevantData(field, formParams, currentParams, backfill) {
138
+ var getRelevantData = function getRelevantData(field, formParams, currentParams, backfill
139
+ // Ignored via go/ees005
140
+ // eslint-disable-next-line @typescript-eslint/max-params
141
+ ) {
139
142
  if (field.hasGroupedValues && !(field.name in backfill)) {
140
143
  backfill[field.name] = {};
141
144
  }
@@ -68,7 +68,10 @@ function Checkbox(_ref) {
68
68
  error = _ref2.error;
69
69
  var isChecked = fieldProps.value,
70
70
  restFieldProps = _objectWithoutProperties(fieldProps, _excluded);
71
- return jsx(Fragment, null, jsx(AKCheckbox, _extends({}, restFieldProps, {
71
+ return jsx(Fragment, null, jsx(AKCheckbox
72
+ // Ignored via go/ees005
73
+ // eslint-disable-next-line react/jsx-props-no-spreading
74
+ , _extends({}, restFieldProps, {
72
75
  label: label,
73
76
  onChange: function onChange(event) {
74
77
  return handleOnChange(fieldProps.onChange, onFieldChange, event);
@@ -113,7 +116,10 @@ function Toggle(_ref3) {
113
116
  }, label, isRequired ? jsx(Text, {
114
117
  color: "color.text.danger",
115
118
  "aria-hidden": "true"
116
- }, "*") : null), jsx(AKToggle, _extends({}, restFieldProps, {
119
+ }, "*") : null), jsx(AKToggle
120
+ // Ignored via go/ees005
121
+ // eslint-disable-next-line react/jsx-props-no-spreading
122
+ , _extends({}, restFieldProps, {
117
123
  onChange: function onChange(event) {
118
124
  return handleOnChange(fieldProps.onChange, onFieldChange, event);
119
125
  },
@@ -52,8 +52,13 @@ function CheckboxGroupInner(_ref) {
52
52
  var onOptionChange = function onOptionChange(event) {
53
53
  _onChange(optionValue, event.target.checked);
54
54
  };
55
- return jsx(AKCheckbox, _extends({
55
+ return jsx(AKCheckbox
56
+ // Ignored via go/ees005
57
+ // eslint-disable-next-line react/no-array-index-key
58
+ , _extends({
56
59
  key: i
60
+ // Ignored via go/ees005
61
+ // eslint-disable-next-line react/jsx-props-no-spreading
57
62
  }, restFieldProps, {
58
63
  isRequired: false,
59
64
  label: optionLabel,
@@ -95,6 +100,8 @@ export default function CheckboxGroup(_ref3) {
95
100
  description: description,
96
101
  options: options,
97
102
  onFieldChange: _onFieldChange
103
+ // Ignored via go/ees005
104
+ // eslint-disable-next-line react/jsx-props-no-spreading
98
105
  }, props));
99
106
  });
100
107
  }
@@ -145,7 +145,10 @@ function CustomSelect(_ref2) {
145
145
  }, function (_ref3) {
146
146
  var fieldProps = _ref3.fieldProps,
147
147
  error = _ref3.error;
148
- return /*#__PURE__*/React.createElement(React.Fragment, null, resolver && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AsyncCreatableSelect, _extends({}, fieldProps, {
148
+ return /*#__PURE__*/React.createElement(React.Fragment, null, resolver && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AsyncCreatableSelect
149
+ // Ignored via go/ees005
150
+ // eslint-disable-next-line react/jsx-props-no-spreading
151
+ , _extends({}, fieldProps, {
149
152
  onChange: function onChange(value) {
150
153
  fieldProps.onChange(value);
151
154
  // We assume onChange is called whenever values actually changed
@@ -28,7 +28,10 @@ function Date(_ref) {
28
28
  }, function (_ref2) {
29
29
  var fieldProps = _ref2.fieldProps,
30
30
  error = _ref2.error;
31
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DatePicker, _extends({}, fieldProps, {
31
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DatePicker
32
+ // Ignored via go/ees005
33
+ // eslint-disable-next-line react/jsx-props-no-spreading
34
+ , _extends({}, fieldProps, {
32
35
  autoFocus: autoFocus,
33
36
  onBlur: function onBlur() {
34
37
  fieldProps.onBlur();
@@ -59,7 +59,10 @@ var DateField = function DateField(_ref) {
59
59
  }, function (_ref2) {
60
60
  var fieldProps = _ref2.fieldProps,
61
61
  error = _ref2.error;
62
- return jsx(Fragment, null, jsx(DatePicker, _extends({}, fieldProps, {
62
+ return jsx(Fragment, null, jsx(DatePicker
63
+ // Ignored via go/ees005
64
+ // eslint-disable-next-line react/jsx-props-no-spreading
65
+ , _extends({}, fieldProps, {
63
66
  onChange: function onChange(date) {
64
67
  fieldProps.onChange(date);
65
68
  onFieldChange(parentField.name, true);
@@ -103,7 +106,10 @@ var DateRange = function DateRange(_ref3) {
103
106
  defaultValue: 'date-range'
104
107
  }, function (_ref4) {
105
108
  var fieldProps = _ref4.fieldProps;
106
- return jsx(TextField, _extends({}, fieldProps, {
109
+ return jsx(TextField
110
+ // Ignored via go/ees005
111
+ // eslint-disable-next-line react/jsx-props-no-spreading
112
+ , _extends({}, fieldProps, {
107
113
  type: "hidden"
108
114
  }));
109
115
  })), jsx(Field, {
@@ -118,7 +124,10 @@ var DateRange = function DateRange(_ref3) {
118
124
  }, function (_ref5) {
119
125
  var fieldProps = _ref5.fieldProps,
120
126
  error = _ref5.error;
121
- return jsx(Fragment, null, jsx(RadioGroup, _extends({}, fieldProps, {
127
+ return jsx(Fragment, null, jsx(RadioGroup
128
+ // Ignored via go/ees005
129
+ // eslint-disable-next-line react/jsx-props-no-spreading
130
+ , _extends({}, fieldProps, {
122
131
  options: items,
123
132
  onChange: function onChange(event) {
124
133
  fieldProps.onChange(event.target.value);
@@ -134,7 +143,10 @@ var DateRange = function DateRange(_ref3) {
134
143
  defaultValue: currentValue
135
144
  }, function (_ref6) {
136
145
  var fieldProps = _ref6.fieldProps;
137
- return jsx(TextField, _extends({}, fieldProps, {
146
+ return jsx(TextField
147
+ // Ignored via go/ees005
148
+ // eslint-disable-next-line react/jsx-props-no-spreading
149
+ , _extends({}, fieldProps, {
138
150
  type: "hidden"
139
151
  }));
140
152
  })) : jsx("div", {
@@ -197,7 +197,10 @@ var FieldsetField = /*#__PURE__*/function (_React$Component) {
197
197
  testId: "add-more",
198
198
  appearance: "subtle",
199
199
  iconBefore: function iconBefore(iconProps) {
200
- return jsx(AddCircleIcon, _extends({}, iconProps, {
200
+ return jsx(AddCircleIcon
201
+ // Ignored via go/ees005
202
+ // eslint-disable-next-line react/jsx-props-no-spreading
203
+ , _extends({}, iconProps, {
201
204
  size: "small",
202
205
  label: intl.formatMessage(messages.addField)
203
206
  }));
@@ -40,7 +40,10 @@ export default function Number(_ref) {
40
40
  var fieldProps = _ref2.fieldProps,
41
41
  error = _ref2.error,
42
42
  meta = _ref2.meta;
43
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TextField, _extends({}, fieldProps, {
43
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TextField
44
+ // Ignored via go/ees005
45
+ // eslint-disable-next-line react/jsx-props-no-spreading
46
+ , _extends({}, fieldProps, {
44
47
  autoFocus: autoFocus,
45
48
  onBlur: function onBlur() {
46
49
  fieldProps.onBlur();
@@ -29,7 +29,10 @@ export default function RadioField(_ref) {
29
29
  }, function (_ref2) {
30
30
  var fieldProps = _ref2.fieldProps,
31
31
  error = _ref2.error;
32
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(RadioGroup, _extends({}, fieldProps, {
32
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(RadioGroup
33
+ // Ignored via go/ees005
34
+ // eslint-disable-next-line react/jsx-props-no-spreading
35
+ , _extends({}, fieldProps, {
33
36
  options: (field.items || []).map(function (option) {
34
37
  return _objectSpread(_objectSpread({}, option), {}, {
35
38
  name: field.name
@@ -25,12 +25,17 @@ export default function SelectField(_ref) {
25
25
  testId: "config-panel-select-".concat(name),
26
26
  isRequired: field.isRequired,
27
27
  validate: function validate(value) {
28
+ // Ignored via go/ees005
29
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
28
30
  return _validate(field, value);
29
31
  }
30
32
  }, function (_ref2) {
31
33
  var fieldProps = _ref2.fieldProps,
32
34
  error = _ref2.error;
33
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Select, _extends({}, _objectSpread(_objectSpread({}, fieldProps), {}, {
35
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Select
36
+ // Ignored via go/ees005
37
+ // eslint-disable-next-line react/jsx-props-no-spreading
38
+ , _extends({}, _objectSpread(_objectSpread({}, fieldProps), {}, {
34
39
  // Pass `id` as `inputId` so that the input gets the correct id, and make sure there are no duplicate ids
35
40
  inputId: fieldProps.id,
36
41
  id: undefined
@@ -34,7 +34,10 @@ export default function String(_ref) {
34
34
  var _onChange = fieldProps.onChange,
35
35
  restFieldProps = _objectWithoutProperties(fieldProps, _excluded);
36
36
  var options = field.options;
37
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(TextArea, _extends({}, restFieldProps, options, {
37
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(TextArea
38
+ // Ignored via go/ees005
39
+ // eslint-disable-next-line react/jsx-props-no-spreading
40
+ , _extends({}, restFieldProps, options, {
38
41
  onChange: function onChange(e) {
39
42
  return _onChange(e.currentTarget.value);
40
43
  },
@@ -49,7 +52,10 @@ export default function String(_ref) {
49
52
  description: description
50
53
  }));
51
54
  }
52
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(TextField, _extends({}, fieldProps, {
55
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(TextField
56
+ // Ignored via go/ees005
57
+ // eslint-disable-next-line react/jsx-props-no-spreading
58
+ , _extends({}, fieldProps, {
53
59
  type: "text",
54
60
  autoFocus: autoFocus,
55
61
  onBlur: function onBlur() {
@@ -127,7 +127,10 @@ function SafeSmartUserPicker(_ref) {
127
127
  cancel = true;
128
128
  };
129
129
  }, [safeValue, productKey]);
130
- return /*#__PURE__*/React.createElement(SmartUserPicker, _extends({}, formFieldPropsRest, {
130
+ return /*#__PURE__*/React.createElement(SmartUserPicker
131
+ // Ignored via go/ees005
132
+ // eslint-disable-next-line react/jsx-props-no-spreading
133
+ , _extends({}, formFieldPropsRest, {
131
134
  onChange: onChangeUnsafe,
132
135
  autoFocus: autoFocus,
133
136
  onBlur: onBlur,
@@ -228,7 +231,8 @@ export default function UserSelect(_ref2) {
228
231
  testId: "config-panel-user-select-".concat(name)
229
232
  }, function (_ref3) {
230
233
  var fieldProps = _ref3.fieldProps,
231
- error = _ref3.error;
234
+ error = _ref3.error,
235
+ meta = _ref3.meta;
232
236
  // if any of these don't exists, the provider is missing
233
237
  if (!siteId || !principalId || !fieldId || !productKey) {
234
238
  return /*#__PURE__*/React.createElement(UnhandledType, {
@@ -247,7 +251,7 @@ export default function UserSelect(_ref2) {
247
251
  formFieldProps: fieldProps,
248
252
  autoFocus: autoFocus || false,
249
253
  onBlur: function onBlur() {
250
- return onFieldChange(name, true);
254
+ return onFieldChange(name, meta.dirty);
251
255
  },
252
256
  onChange: onChange
253
257
  }), /*#__PURE__*/React.createElement(FieldMessages, {
@@ -136,7 +136,10 @@ var Header = function Header(_ref) {
136
136
  }, jsx(Text, {
137
137
  as: "p",
138
138
  testId: "config-panel-header-description"
139
- }, description && jsx(Fragment, null, description.replace(/([^.])$/, '$1.'), " "), documentationUrl && (enableHelpCTA ? jsx(Box, {
139
+ }, description && jsx(Fragment, null,
140
+ // Ignored via go/ees005
141
+ // eslint-disable-next-line require-unicode-regexp
142
+ description.replace(/([^.])$/, '$1.'), ' '), documentationUrl && (enableHelpCTA ? jsx(Box, {
140
143
  xcss: helpLinkStyles
141
144
  }, jsx(Text, {
142
145
  as: "p"
@@ -61,6 +61,9 @@ export var getSafeParentedName = function getSafeParentedName(name, parentName)
61
61
  }
62
62
  return name;
63
63
  };
64
+
65
+ // Ignored via go/ees005
66
+ // eslint-disable-next-line require-unicode-regexp
64
67
  var duplicateFieldRegex = /:[0-9]+$/;
65
68
  export var isDuplicateField = function isDuplicateField(key) {
66
69
  return duplicateFieldRegex.test(key);
@@ -73,5 +73,8 @@ export var SaveIndicator = function SaveIndicator(_ref) {
73
73
  size: "small"
74
74
  }), jsx(Box, {
75
75
  xcss: saveIndicatorTextStyles
76
- }, jsx(Text, null, jsx(FormattedMessage, messages.saveIndicator))))));
76
+ }, jsx(Text, null, jsx(FormattedMessage
77
+ // Ignored via go/ees005
78
+ // eslint-disable-next-line react/jsx-props-no-spreading
79
+ , messages.saveIndicator))))));
77
80
  };
@@ -12,7 +12,7 @@ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state
12
12
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
13
13
  import { buildExtensionNode } from '../editor-actions/actions';
14
14
  import { clearEditingContext, forceAutoSave, updateState } from '../editor-commands/commands';
15
- import { getPluginState } from '../pm-plugins/main';
15
+ import { getPluginState } from '../pm-plugins/plugin-factory';
16
16
  import { getSelectedExtension } from '../pm-plugins/utils';
17
17
  import ConfigPanelLoader from './ConfigPanel/ConfigPanelLoader';
18
18
  import { SaveIndicator } from './SaveIndicator/SaveIndicator';
@@ -145,6 +145,8 @@ export var getContextPanel = function getContextPanel(getEditorView) {
145
145
 
146
146
  // Added this interface to handle the macroParams on Parameters
147
147
 
148
+ // Ignored via go/ees005
149
+ // eslint-disable-next-line @typescript-eslint/max-params
148
150
  export function onChangeAction(_x2) {
149
151
  return _onChangeAction.apply(this, arguments);
150
152
  }
@@ -1,4 +1,3 @@
1
- export { transformSliceToRemoveOpenBodiedExtension } from '@atlaskit/editor-common/transforms';
2
1
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
2
  import type { UpdateExtension } from '@atlaskit/editor-common/extensions';
4
3
  import type { MacroProvider } from '@atlaskit/editor-common/provider-factory';
@@ -19,3 +18,4 @@ type Props = {
19
18
  export declare const createEditSelectedExtensionAction: ({ editorViewRef, editorAnalyticsAPI, applyChangeToContextPanel }: Props) => () => boolean;
20
19
  export declare const insertOrReplaceExtension: ({ editorView, action, attrs, content, position, size, tr, }: InsertOrReplaceExtensionType) => Transaction;
21
20
  export declare const insertOrReplaceBodiedExtension: ({ editorView, action, attrs, content, position, size, tr, }: InsertOrReplaceExtensionType) => Transaction;
21
+ export {};
@@ -1,8 +1,4 @@
1
1
  import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
2
2
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
- import type { MacroState } from './types';
5
- export type { MacroProvider, MacroAttributes, ExtensionType, } from '@atlaskit/editor-common/provider-factory';
6
- export { insertMacroFromMacroBrowser, resolveMacro, runMacroAutoConvert, setMacroProvider, } from './actions';
7
- export type { MacroState };
8
4
  export declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory) => SafePlugin<any>;
@@ -8,8 +8,6 @@ import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
8
8
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
9
9
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
10
10
  import type { ExtensionPlugin, ExtensionPluginOptions } from '../extensionPluginType';
11
- import { createCommand, getPluginState } from './plugin-factory';
12
- import { pluginKey } from './plugin-key';
13
11
  export declare const createExtensionProviderHandler: (view: EditorView) => (name: string, provider?: Promise<ExtensionProvider>) => Promise<void>;
14
12
  export declare const handleUpdate: ({ view, prevState, domAtPos, extensionHandlers, applyChange, }: {
15
13
  view: EditorView;
@@ -18,7 +16,6 @@ export declare const handleUpdate: ({ view, prevState, domAtPos, extensionHandle
18
16
  extensionHandlers: ExtensionHandlers;
19
17
  applyChange: ApplyChangeHandler | undefined;
20
18
  }) => true | undefined;
21
- declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginInjectionApi: ExtractInjectionAPI<ExtensionPlugin> | undefined, useLongPressSelection?: boolean, options?: {
19
+ export declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginInjectionApi: ExtractInjectionAPI<ExtensionPlugin> | undefined, useLongPressSelection?: boolean, options?: {
22
20
  appearance?: EditorAppearance;
23
21
  }, featureFlags?: FeatureFlags, allowDragAndDrop?: boolean, __rendererExtensionOptions?: ExtensionPluginOptions['__rendererExtensionOptions']) => SafePlugin<import("../extensionPluginType").ExtensionState>;
24
- export { pluginKey, createPlugin, createCommand, getPluginState };
@@ -1,4 +1,3 @@
1
- export { transformSliceToRemoveOpenBodiedExtension } from '@atlaskit/editor-common/transforms';
2
1
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
2
  import type { UpdateExtension } from '@atlaskit/editor-common/extensions';
4
3
  import type { MacroProvider } from '@atlaskit/editor-common/provider-factory';
@@ -19,3 +18,4 @@ type Props = {
19
18
  export declare const createEditSelectedExtensionAction: ({ editorViewRef, editorAnalyticsAPI, applyChangeToContextPanel }: Props) => () => boolean;
20
19
  export declare const insertOrReplaceExtension: ({ editorView, action, attrs, content, position, size, tr, }: InsertOrReplaceExtensionType) => Transaction;
21
20
  export declare const insertOrReplaceBodiedExtension: ({ editorView, action, attrs, content, position, size, tr, }: InsertOrReplaceExtensionType) => Transaction;
21
+ export {};
@@ -1,8 +1,4 @@
1
1
  import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
2
2
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
- import type { MacroState } from './types';
5
- export type { MacroProvider, MacroAttributes, ExtensionType, } from '@atlaskit/editor-common/provider-factory';
6
- export { insertMacroFromMacroBrowser, resolveMacro, runMacroAutoConvert, setMacroProvider, } from './actions';
7
- export type { MacroState };
8
4
  export declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory) => SafePlugin<any>;
@@ -8,8 +8,6 @@ import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
8
8
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
9
9
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
10
10
  import type { ExtensionPlugin, ExtensionPluginOptions } from '../extensionPluginType';
11
- import { createCommand, getPluginState } from './plugin-factory';
12
- import { pluginKey } from './plugin-key';
13
11
  export declare const createExtensionProviderHandler: (view: EditorView) => (name: string, provider?: Promise<ExtensionProvider>) => Promise<void>;
14
12
  export declare const handleUpdate: ({ view, prevState, domAtPos, extensionHandlers, applyChange, }: {
15
13
  view: EditorView;
@@ -18,7 +16,6 @@ export declare const handleUpdate: ({ view, prevState, domAtPos, extensionHandle
18
16
  extensionHandlers: ExtensionHandlers;
19
17
  applyChange: ApplyChangeHandler | undefined;
20
18
  }) => true | undefined;
21
- declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginInjectionApi: ExtractInjectionAPI<ExtensionPlugin> | undefined, useLongPressSelection?: boolean, options?: {
19
+ export declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginInjectionApi: ExtractInjectionAPI<ExtensionPlugin> | undefined, useLongPressSelection?: boolean, options?: {
22
20
  appearance?: EditorAppearance;
23
21
  }, featureFlags?: FeatureFlags, allowDragAndDrop?: boolean, __rendererExtensionOptions?: ExtensionPluginOptions['__rendererExtensionOptions']) => SafePlugin<import("../extensionPluginType").ExtensionState>;
24
- export { pluginKey, createPlugin, createCommand, getPluginState };
@@ -20,6 +20,8 @@ import { getExtensionKeyAndNodeKey } from '@atlaskit/editor-common/extensions';
20
20
  import Heading from '@atlaskit/heading';
21
21
  import { Box, xcss } from '@atlaskit/primitives';
22
22
  import TextArea from '@atlaskit/textarea';
23
+ // Ignored via go/ees005
24
+ // eslint-disable-next-line import/no-namespace
23
25
  import * as colors from '@atlaskit/theme/colors';
24
26
  import { token } from '@atlaskit/tokens';
25
27
 
@@ -9,7 +9,7 @@ import type {
9
9
  Parameters,
10
10
  } from '@atlaskit/editor-common/extensions';
11
11
 
12
- import ConfigPanel from '../../src/ui/ConfigPanel';
12
+ import ConfigPanel from '../../src/ui/ConfigPanel/ConfigPanelLoader';
13
13
 
14
14
  export default function ConfigPanelWithProviders({
15
15
  extensionType,