@atlaskit/editor-plugin-extension 9.2.5 → 9.2.7

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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/editor-plugin-extension
2
2
 
3
+ ## 9.2.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 9.2.6
10
+
11
+ ### Patch Changes
12
+
13
+ - [`4d676bbdb3ce6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4d676bbdb3ce6) -
14
+ ts-ignore added temporarily to unblock local consumption for help-center, will be removed once
15
+ project refs are setup
16
+ - Updated dependencies
17
+
3
18
  ## 9.2.5
4
19
 
5
20
  ### Patch Changes
@@ -102,6 +102,8 @@ var extensionPlugin = exports.extensionPlugin = function extensionPlugin(_ref) {
102
102
  name: 'extensionEditorViewRef',
103
103
  plugin: function plugin() {
104
104
  return new _safePlugin.SafePlugin({
105
+ // @ts-ignore - Workaround for help-center local consumption
106
+
105
107
  view: function view(editorView) {
106
108
  // Do not cleanup the editorViewRef on destroy
107
109
  // because some functions may point to a stale
@@ -19,6 +19,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
19
19
  macroProvider: null
20
20
  };
21
21
  },
22
+ // @ts-ignore - Workaround for help-center local consumption
22
23
  apply: function apply(tr, state) {
23
24
  var meta = tr.getMeta(_pluginKey.pluginKey);
24
25
  if (meta) {
@@ -186,11 +186,15 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
186
186
  var showLivePagesBodiedMacrosRendererView = __rendererExtensionOptions === null || __rendererExtensionOptions === void 0 ? void 0 : __rendererExtensionOptions.isAllowedToUseRendererView;
187
187
  return new _safePlugin.SafePlugin({
188
188
  state: state,
189
+ // @ts-ignore - Workaround for help-center local consumption
190
+
189
191
  view: function view(editorView) {
190
192
  var domAtPos = editorView.domAtPos.bind(editorView);
191
193
  var extensionProviderHandler = createExtensionProviderHandler(editorView);
192
194
  providerFactory.subscribe('extensionProvider', extensionProviderHandler);
193
195
  return {
196
+ // @ts-ignore - Workaround for help-center local consumption
197
+
194
198
  update: function update(view, prevState) {
195
199
  var _pluginInjectionApi$c;
196
200
  handleUpdate({
@@ -208,12 +212,16 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
208
212
  },
209
213
  key: _pluginKey.pluginKey,
210
214
  props: {
215
+ // @ts-ignore - Workaround for help-center local consumption
216
+
211
217
  handleDOMEvents: {
212
218
  /**
213
219
  * ED-18072 - Cannot shift + arrow past bodied extension if it is not empty.
214
220
  * This code is to handle the case where the selection starts inside or on the node and the user is trying to shift + arrow.
215
221
  * For other part of the solution see code in: packages/editor/editor-core/src/plugins/selection/pm-plugins/events/keydown.ts
216
222
  */
223
+ // @ts-ignore - Workaround for help-center local consumption
224
+
217
225
  keydown: function keydown(view, event) {
218
226
  if (event instanceof KeyboardEvent && event.shiftKey && ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(event.key)) {
219
227
  var _view$state = view.state,
@@ -278,6 +286,8 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
278
286
  return false;
279
287
  }
280
288
  },
289
+ // @ts-ignore - Workaround for help-center local consumption
290
+
281
291
  nodeViews: {
282
292
  // WARNING: referentiality-plugin also creates these nodeviews
283
293
  extension: (0, _lazyExtension.lazyExtensionNodeView)('extension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags),
@@ -287,6 +297,8 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
287
297
  inlineExtension: (0, _lazyExtension.lazyExtensionNodeView)('inlineExtension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags),
288
298
  multiBodiedExtension: (0, _lazyExtension.lazyExtensionNodeView)('multiBodiedExtension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags)
289
299
  },
300
+ // @ts-ignore - Workaround for help-center local consumption
301
+
290
302
  createSelectionBetween: function createSelectionBetween(view, anchor, head) {
291
303
  var _view$state3 = view.state,
292
304
  schema = _view$state3.schema,
@@ -16,6 +16,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
16
16
  var pluginKey = new _state.PluginKey('extensionUniqueIdPlugin');
17
17
  var createPlugin = exports.createPlugin = function createPlugin() {
18
18
  return new _safePlugin.SafePlugin({
19
+ // @ts-ignore - Workaround for help-center local consumption
20
+
19
21
  appendTransaction: function appendTransaction(transactions, _oldState, newState) {
20
22
  var tr = newState.tr;
21
23
  var selectionBookmark = tr.selection.getBookmark();
@@ -27,11 +29,20 @@ var createPlugin = exports.createPlugin = function createPlugin() {
27
29
  multiBodiedExtension = _newState$schema$node.multiBodiedExtension;
28
30
  var extensionTypes = new Set([extension, bodiedExtension, inlineExtension, multiBodiedExtension]);
29
31
  var idsObserved = new Set();
32
+
33
+ // @ts-ignore - Workaround for help-center local consumption
34
+
30
35
  transactions.forEach(function (transaction) {
31
36
  if (!transaction.docChanged) {
32
37
  return;
33
38
  }
34
- var isAddingExtension = transaction.steps.some(function (step) {
39
+
40
+ // @ts-ignore - Workaround for help-center local consumption
41
+
42
+ var isAddingExtension = transaction.steps.some(
43
+ // @ts-ignore - Workaround for help-center local consumption
44
+
45
+ function (step) {
35
46
  var _step$attrs;
36
47
  return (0, _utils.stepAddsOneOf)(step, extensionTypes) ||
37
48
  // There are instances where the localId will be reset to null on publish due to extension
@@ -43,6 +54,8 @@ var createPlugin = exports.createPlugin = function createPlugin() {
43
54
  });
44
55
  if (isAddingExtension) {
45
56
  // Can't simply look at changed nodes, as we could be adding an extension
57
+ // @ts-ignore - Workaround for help-center local consumption
58
+
46
59
  newState.doc.descendants(function (node, pos) {
47
60
  var localId = node.attrs.localId;
48
61
 
@@ -82,7 +82,10 @@ function Checkbox(_ref) {
82
82
  // Ignored via go/ees005
83
83
  // eslint-disable-next-line react/jsx-props-no-spreading
84
84
  , (0, _extends2.default)({}, restFieldProps, {
85
- label: label,
85
+ label: label
86
+ // @ts-ignore - Workaround for help-center local consumption
87
+ ,
88
+
86
89
  onChange: function onChange(event) {
87
90
  return handleOnChange(fieldProps.onChange, onFieldChange, event);
88
91
  },
@@ -89,7 +89,7 @@ function CheckboxGroup(_ref3) {
89
89
  var label = (0, _react2.jsx)(_react.Fragment, null, labelBase, isRequired ? (0, _react2.jsx)("span", {
90
90
  css: requiredIndicatorStyles,
91
91
  "aria-hidden": "true"
92
- }, ' ', "*") : null);
92
+ }, " *") : null);
93
93
  var _onFieldChange = (0, _react.useCallback)(function () {
94
94
  onFieldChange(name, true);
95
95
  }, [name, onFieldChange]);
@@ -92,6 +92,8 @@ export const extensionPlugin = ({
92
92
  name: 'extensionEditorViewRef',
93
93
  plugin: () => {
94
94
  return new SafePlugin({
95
+ // @ts-ignore - Workaround for help-center local consumption
96
+
95
97
  view: editorView => {
96
98
  // Do not cleanup the editorViewRef on destroy
97
99
  // because some functions may point to a stale
@@ -6,6 +6,8 @@ export const createPlugin = (dispatch, providerFactory) => new SafePlugin({
6
6
  init: () => ({
7
7
  macroProvider: null
8
8
  }),
9
+ // @ts-ignore - Workaround for help-center local consumption
10
+
9
11
  apply(tr, state) {
10
12
  const meta = tr.getMeta(pluginKey);
11
13
  if (meta) {
@@ -130,11 +130,15 @@ export const createPlugin = (dispatch, providerFactory, extensionHandlers, porta
130
130
  const showLivePagesBodiedMacrosRendererView = __rendererExtensionOptions === null || __rendererExtensionOptions === void 0 ? void 0 : __rendererExtensionOptions.isAllowedToUseRendererView;
131
131
  return new SafePlugin({
132
132
  state,
133
+ // @ts-ignore - Workaround for help-center local consumption
134
+
133
135
  view: editorView => {
134
136
  const domAtPos = editorView.domAtPos.bind(editorView);
135
137
  const extensionProviderHandler = createExtensionProviderHandler(editorView);
136
138
  providerFactory.subscribe('extensionProvider', extensionProviderHandler);
137
139
  return {
140
+ // @ts-ignore - Workaround for help-center local consumption
141
+
138
142
  update: (view, prevState) => {
139
143
  var _pluginInjectionApi$c;
140
144
  handleUpdate({
@@ -152,12 +156,16 @@ export const createPlugin = (dispatch, providerFactory, extensionHandlers, porta
152
156
  },
153
157
  key: pluginKey,
154
158
  props: {
159
+ // @ts-ignore - Workaround for help-center local consumption
160
+
155
161
  handleDOMEvents: {
156
162
  /**
157
163
  * ED-18072 - Cannot shift + arrow past bodied extension if it is not empty.
158
164
  * This code is to handle the case where the selection starts inside or on the node and the user is trying to shift + arrow.
159
165
  * For other part of the solution see code in: packages/editor/editor-core/src/plugins/selection/pm-plugins/events/keydown.ts
160
166
  */
167
+ // @ts-ignore - Workaround for help-center local consumption
168
+
161
169
  keydown: (view, event) => {
162
170
  if (event instanceof KeyboardEvent && event.shiftKey && ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(event.key)) {
163
171
  const {
@@ -231,6 +239,8 @@ export const createPlugin = (dispatch, providerFactory, extensionHandlers, porta
231
239
  return false;
232
240
  }
233
241
  },
242
+ // @ts-ignore - Workaround for help-center local consumption
243
+
234
244
  nodeViews: {
235
245
  // WARNING: referentiality-plugin also creates these nodeviews
236
246
  extension: lazyExtensionNodeView('extension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags),
@@ -240,6 +250,8 @@ export const createPlugin = (dispatch, providerFactory, extensionHandlers, porta
240
250
  inlineExtension: lazyExtensionNodeView('inlineExtension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags),
241
251
  multiBodiedExtension: lazyExtensionNodeView('multiBodiedExtension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags)
242
252
  },
253
+ // @ts-ignore - Workaround for help-center local consumption
254
+
243
255
  createSelectionBetween: function (view, anchor, head) {
244
256
  const {
245
257
  schema,
@@ -5,6 +5,8 @@ import { stepAddsOneOf } from '@atlaskit/editor-common/utils';
5
5
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
6
6
  const pluginKey = new PluginKey('extensionUniqueIdPlugin');
7
7
  const createPlugin = () => new SafePlugin({
8
+ // @ts-ignore - Workaround for help-center local consumption
9
+
8
10
  appendTransaction: (transactions, _oldState, newState) => {
9
11
  const tr = newState.tr;
10
12
  const selectionBookmark = tr.selection.getBookmark();
@@ -17,11 +19,20 @@ const createPlugin = () => new SafePlugin({
17
19
  } = newState.schema.nodes;
18
20
  const extensionTypes = new Set([extension, bodiedExtension, inlineExtension, multiBodiedExtension]);
19
21
  const idsObserved = new Set();
22
+
23
+ // @ts-ignore - Workaround for help-center local consumption
24
+
20
25
  transactions.forEach(transaction => {
21
26
  if (!transaction.docChanged) {
22
27
  return;
23
28
  }
24
- const isAddingExtension = transaction.steps.some(step => {
29
+
30
+ // @ts-ignore - Workaround for help-center local consumption
31
+
32
+ const isAddingExtension = transaction.steps.some(
33
+ // @ts-ignore - Workaround for help-center local consumption
34
+
35
+ step => {
25
36
  var _step$attrs;
26
37
  return stepAddsOneOf(step, extensionTypes) ||
27
38
  // There are instances where the localId will be reset to null on publish due to extension
@@ -33,6 +44,8 @@ const createPlugin = () => new SafePlugin({
33
44
  });
34
45
  if (isAddingExtension) {
35
46
  // Can't simply look at changed nodes, as we could be adding an extension
47
+ // @ts-ignore - Workaround for help-center local consumption
48
+
36
49
  newState.doc.descendants((node, pos) => {
37
50
  const localId = node.attrs.localId;
38
51
 
@@ -73,7 +73,10 @@ function Checkbox({
73
73
  // Ignored via go/ees005
74
74
  // eslint-disable-next-line react/jsx-props-no-spreading
75
75
  , _extends({}, restFieldProps, {
76
- label: label,
76
+ label: label
77
+ // @ts-ignore - Workaround for help-center local consumption
78
+ ,
79
+
77
80
  onChange: event => handleOnChange(fieldProps.onChange, onFieldChange, event),
78
81
  isChecked: parseBoolean(isChecked)
79
82
  })), jsx(FieldMessages, {
@@ -87,7 +87,7 @@ export default function CheckboxGroup({
87
87
  const label = jsx(Fragment, null, labelBase, isRequired ? jsx("span", {
88
88
  css: requiredIndicatorStyles,
89
89
  "aria-hidden": "true"
90
- }, ' ', "*") : null);
90
+ }, " *") : null);
91
91
  const _onFieldChange = useCallback(() => {
92
92
  onFieldChange(name, true);
93
93
  }, [name, onFieldChange]);
@@ -93,6 +93,8 @@ export var extensionPlugin = function extensionPlugin(_ref) {
93
93
  name: 'extensionEditorViewRef',
94
94
  plugin: function plugin() {
95
95
  return new SafePlugin({
96
+ // @ts-ignore - Workaround for help-center local consumption
97
+
96
98
  view: function view(editorView) {
97
99
  // Do not cleanup the editorViewRef on destroy
98
100
  // because some functions may point to a stale
@@ -12,6 +12,7 @@ export var createPlugin = function createPlugin(dispatch, providerFactory) {
12
12
  macroProvider: null
13
13
  };
14
14
  },
15
+ // @ts-ignore - Workaround for help-center local consumption
15
16
  apply: function apply(tr, state) {
16
17
  var meta = tr.getMeta(pluginKey);
17
18
  if (meta) {
@@ -179,11 +179,15 @@ export var createPlugin = function createPlugin(dispatch, providerFactory, exten
179
179
  var showLivePagesBodiedMacrosRendererView = __rendererExtensionOptions === null || __rendererExtensionOptions === void 0 ? void 0 : __rendererExtensionOptions.isAllowedToUseRendererView;
180
180
  return new SafePlugin({
181
181
  state: state,
182
+ // @ts-ignore - Workaround for help-center local consumption
183
+
182
184
  view: function view(editorView) {
183
185
  var domAtPos = editorView.domAtPos.bind(editorView);
184
186
  var extensionProviderHandler = createExtensionProviderHandler(editorView);
185
187
  providerFactory.subscribe('extensionProvider', extensionProviderHandler);
186
188
  return {
189
+ // @ts-ignore - Workaround for help-center local consumption
190
+
187
191
  update: function update(view, prevState) {
188
192
  var _pluginInjectionApi$c;
189
193
  handleUpdate({
@@ -201,12 +205,16 @@ export var createPlugin = function createPlugin(dispatch, providerFactory, exten
201
205
  },
202
206
  key: pluginKey,
203
207
  props: {
208
+ // @ts-ignore - Workaround for help-center local consumption
209
+
204
210
  handleDOMEvents: {
205
211
  /**
206
212
  * ED-18072 - Cannot shift + arrow past bodied extension if it is not empty.
207
213
  * This code is to handle the case where the selection starts inside or on the node and the user is trying to shift + arrow.
208
214
  * For other part of the solution see code in: packages/editor/editor-core/src/plugins/selection/pm-plugins/events/keydown.ts
209
215
  */
216
+ // @ts-ignore - Workaround for help-center local consumption
217
+
210
218
  keydown: function keydown(view, event) {
211
219
  if (event instanceof KeyboardEvent && event.shiftKey && ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(event.key)) {
212
220
  var _view$state = view.state,
@@ -271,6 +279,8 @@ export var createPlugin = function createPlugin(dispatch, providerFactory, exten
271
279
  return false;
272
280
  }
273
281
  },
282
+ // @ts-ignore - Workaround for help-center local consumption
283
+
274
284
  nodeViews: {
275
285
  // WARNING: referentiality-plugin also creates these nodeviews
276
286
  extension: lazyExtensionNodeView('extension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags),
@@ -280,6 +290,8 @@ export var createPlugin = function createPlugin(dispatch, providerFactory, exten
280
290
  inlineExtension: lazyExtensionNodeView('inlineExtension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags),
281
291
  multiBodiedExtension: lazyExtensionNodeView('multiBodiedExtension', portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions, pluginInjectionApi, macroInteractionDesignFeatureFlags)
282
292
  },
293
+ // @ts-ignore - Workaround for help-center local consumption
294
+
283
295
  createSelectionBetween: function createSelectionBetween(view, anchor, head) {
284
296
  var _view$state3 = view.state,
285
297
  schema = _view$state3.schema,
@@ -9,6 +9,8 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
9
9
  var pluginKey = new PluginKey('extensionUniqueIdPlugin');
10
10
  var createPlugin = function createPlugin() {
11
11
  return new SafePlugin({
12
+ // @ts-ignore - Workaround for help-center local consumption
13
+
12
14
  appendTransaction: function appendTransaction(transactions, _oldState, newState) {
13
15
  var tr = newState.tr;
14
16
  var selectionBookmark = tr.selection.getBookmark();
@@ -20,11 +22,20 @@ var createPlugin = function createPlugin() {
20
22
  multiBodiedExtension = _newState$schema$node.multiBodiedExtension;
21
23
  var extensionTypes = new Set([extension, bodiedExtension, inlineExtension, multiBodiedExtension]);
22
24
  var idsObserved = new Set();
25
+
26
+ // @ts-ignore - Workaround for help-center local consumption
27
+
23
28
  transactions.forEach(function (transaction) {
24
29
  if (!transaction.docChanged) {
25
30
  return;
26
31
  }
27
- var isAddingExtension = transaction.steps.some(function (step) {
32
+
33
+ // @ts-ignore - Workaround for help-center local consumption
34
+
35
+ var isAddingExtension = transaction.steps.some(
36
+ // @ts-ignore - Workaround for help-center local consumption
37
+
38
+ function (step) {
28
39
  var _step$attrs;
29
40
  return stepAddsOneOf(step, extensionTypes) ||
30
41
  // There are instances where the localId will be reset to null on publish due to extension
@@ -36,6 +47,8 @@ var createPlugin = function createPlugin() {
36
47
  });
37
48
  if (isAddingExtension) {
38
49
  // Can't simply look at changed nodes, as we could be adding an extension
50
+ // @ts-ignore - Workaround for help-center local consumption
51
+
39
52
  newState.doc.descendants(function (node, pos) {
40
53
  var localId = node.attrs.localId;
41
54
 
@@ -74,7 +74,10 @@ function Checkbox(_ref) {
74
74
  // Ignored via go/ees005
75
75
  // eslint-disable-next-line react/jsx-props-no-spreading
76
76
  , _extends({}, restFieldProps, {
77
- label: label,
77
+ label: label
78
+ // @ts-ignore - Workaround for help-center local consumption
79
+ ,
80
+
78
81
  onChange: function onChange(event) {
79
82
  return handleOnChange(fieldProps.onChange, onFieldChange, event);
80
83
  },
@@ -84,7 +84,7 @@ export default function CheckboxGroup(_ref3) {
84
84
  var label = jsx(Fragment, null, labelBase, isRequired ? jsx("span", {
85
85
  css: requiredIndicatorStyles,
86
86
  "aria-hidden": "true"
87
- }, ' ', "*") : null);
87
+ }, " *") : null);
88
88
  var _onFieldChange = useCallback(function () {
89
89
  onFieldChange(name, true);
90
90
  }, [name, onFieldChange]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-extension",
3
- "version": "9.2.5",
3
+ "version": "9.2.7",
4
4
  "description": "editor-plugin-extension plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -46,7 +46,7 @@
46
46
  "@atlaskit/icon": "^29.0.0",
47
47
  "@atlaskit/link": "^3.2.0",
48
48
  "@atlaskit/platform-feature-flags": "^1.1.0",
49
- "@atlaskit/primitives": "^16.2.0",
49
+ "@atlaskit/primitives": "^16.4.0",
50
50
  "@atlaskit/radio": "^8.3.0",
51
51
  "@atlaskit/section-message": "^8.9.0",
52
52
  "@atlaskit/select": "^21.4.0",
@@ -56,9 +56,9 @@
56
56
  "@atlaskit/textarea": "^8.1.0",
57
57
  "@atlaskit/textfield": "^8.1.0",
58
58
  "@atlaskit/theme": "^21.0.0",
59
- "@atlaskit/tmp-editor-statsig": "^13.41.0",
59
+ "@atlaskit/tmp-editor-statsig": "^14.0.0",
60
60
  "@atlaskit/toggle": "^15.1.0",
61
- "@atlaskit/tokens": "^8.2.0",
61
+ "@atlaskit/tokens": "^8.4.0",
62
62
  "@atlaskit/tooltip": "^20.10.0",
63
63
  "@babel/runtime": "^7.0.0",
64
64
  "@emotion/react": "^11.7.1",
@@ -70,7 +70,7 @@
70
70
  "uuid": "^3.1.0"
71
71
  },
72
72
  "peerDependencies": {
73
- "@atlaskit/editor-common": "^110.33.0",
73
+ "@atlaskit/editor-common": "^110.36.0",
74
74
  "react": "^18.2.0",
75
75
  "react-intl-next": "npm:react-intl@^5.18.1"
76
76
  },