@atlaskit/editor-core 205.7.0 → 205.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 205.7.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#145932](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/145932)
8
+ [`c771b0db325a2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c771b0db325a2) -
9
+ Add comment to show example how to migrate editorActions.getNodeByLocalId to the editorAPI
10
+ equivalent
11
+
3
12
  ## 205.7.0
4
13
 
5
14
  ### Minor Changes
@@ -41,7 +41,15 @@ var fakePluginKey = {
41
41
  editorApi?.core.actions.requestDocument((doc) => {
42
42
  // use doc as desired
43
43
  })
44
- */
44
+
45
+ * If you were using editorActions.getNodeByLocalId(localId) replace with:
46
+ const { editorApi, preset } = usePreset(...);
47
+ const extensionAPI = editorAPI?.extension?.actions?.api();
48
+ // Use nodeWithPos as desired
49
+ const nodeWithPos = extensionAPI.getNodeWithPosByLocalId(localId);
50
+ const node = nodeWithPos.node;
51
+ const nodePos = nodeWithPos.pos;
52
+ */
45
53
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
46
54
  var EditorActions = exports.default = /*#__PURE__*/function () {
47
55
  function EditorActions() {
@@ -295,7 +303,17 @@ var EditorActions = exports.default = /*#__PURE__*/function () {
295
303
  return _getValue.apply(this, arguments);
296
304
  }
297
305
  return getValue;
298
- }()
306
+ }() // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
307
+ /**
308
+ * @deprecated - please use `getNodeWithPosByLocalId` found in the core plugin actions instead
309
+ * @example
310
+ const { editorApi, preset } = usePreset(...);
311
+ const extensionAPI = editorAPI?.extension?.actions?.api();
312
+ // Use nodeWithPos as desired
313
+ const nodeWithPos = extensionAPI.getNodeWithPosByLocalId(localId);
314
+ const node = nodeWithPos.node;
315
+ const nodePos = nodeWithPos.pos;
316
+ */
299
317
  }, {
300
318
  key: "getNodeByLocalId",
301
319
  value: function getNodeByLocalId(id) {
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "205.7.0";
8
+ var version = exports.version = "205.7.1";
@@ -31,7 +31,15 @@ const fakePluginKey = {
31
31
  editorApi?.core.actions.requestDocument((doc) => {
32
32
  // use doc as desired
33
33
  })
34
- */
34
+
35
+ * If you were using editorActions.getNodeByLocalId(localId) replace with:
36
+ const { editorApi, preset } = usePreset(...);
37
+ const extensionAPI = editorAPI?.extension?.actions?.api();
38
+ // Use nodeWithPos as desired
39
+ const nodeWithPos = extensionAPI.getNodeWithPosByLocalId(localId);
40
+ const node = nodeWithPos.node;
41
+ const nodePos = nodeWithPos.pos;
42
+ */
35
43
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
44
  export default class EditorActions {
37
45
  constructor() {
@@ -213,6 +221,18 @@ export default class EditorActions {
213
221
  throw e;
214
222
  }
215
223
  }
224
+
225
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
226
+ /**
227
+ * @deprecated - please use `getNodeWithPosByLocalId` found in the core plugin actions instead
228
+ * @example
229
+ const { editorApi, preset } = usePreset(...);
230
+ const extensionAPI = editorAPI?.extension?.actions?.api();
231
+ // Use nodeWithPos as desired
232
+ const nodeWithPos = extensionAPI.getNodeWithPosByLocalId(localId);
233
+ const node = nodeWithPos.node;
234
+ const nodePos = nodeWithPos.pos;
235
+ */
216
236
  getNodeByLocalId(id) {
217
237
  var _this$editorView;
218
238
  if ((_this$editorView = this.editorView) !== null && _this$editorView !== void 0 && _this$editorView.state) {
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "205.7.0";
2
+ export const version = "205.7.1";
@@ -35,7 +35,15 @@ var fakePluginKey = {
35
35
  editorApi?.core.actions.requestDocument((doc) => {
36
36
  // use doc as desired
37
37
  })
38
- */
38
+
39
+ * If you were using editorActions.getNodeByLocalId(localId) replace with:
40
+ const { editorApi, preset } = usePreset(...);
41
+ const extensionAPI = editorAPI?.extension?.actions?.api();
42
+ // Use nodeWithPos as desired
43
+ const nodeWithPos = extensionAPI.getNodeWithPosByLocalId(localId);
44
+ const node = nodeWithPos.node;
45
+ const nodePos = nodeWithPos.pos;
46
+ */
39
47
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
48
  var EditorActions = /*#__PURE__*/function () {
41
49
  function EditorActions() {
@@ -289,7 +297,17 @@ var EditorActions = /*#__PURE__*/function () {
289
297
  return _getValue.apply(this, arguments);
290
298
  }
291
299
  return getValue;
292
- }()
300
+ }() // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required -- Ignored via go/ED-25883
301
+ /**
302
+ * @deprecated - please use `getNodeWithPosByLocalId` found in the core plugin actions instead
303
+ * @example
304
+ const { editorApi, preset } = usePreset(...);
305
+ const extensionAPI = editorAPI?.extension?.actions?.api();
306
+ // Use nodeWithPos as desired
307
+ const nodeWithPos = extensionAPI.getNodeWithPosByLocalId(localId);
308
+ const node = nodeWithPos.node;
309
+ const nodePos = nodeWithPos.pos;
310
+ */
293
311
  }, {
294
312
  key: "getNodeByLocalId",
295
313
  value: function getNodeByLocalId(id) {
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "205.7.0";
2
+ export var version = "205.7.1";
@@ -11,7 +11,15 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
11
11
  editorApi?.core.actions.requestDocument((doc) => {
12
12
  // use doc as desired
13
13
  })
14
- */
14
+
15
+ * If you were using editorActions.getNodeByLocalId(localId) replace with:
16
+ const { editorApi, preset } = usePreset(...);
17
+ const extensionAPI = editorAPI?.extension?.actions?.api();
18
+ // Use nodeWithPos as desired
19
+ const nodeWithPos = extensionAPI.getNodeWithPosByLocalId(localId);
20
+ const node = nodeWithPos.node;
21
+ const nodePos = nodeWithPos.pos;
22
+ */
15
23
  export default class EditorActions<T = any> implements EditorActionsOptions<T> {
16
24
  private editorView?;
17
25
  private contentTransformer?;
@@ -42,6 +50,16 @@ export default class EditorActions<T = any> implements EditorActionsOptions<T> {
42
50
  * WARNING: this may be called repeatedly, async with care
43
51
  */
44
52
  getValue(): Promise<import("@atlaskit/editor-json-transformer").JSONDocNode | T | undefined>;
53
+ /**
54
+ * @deprecated - please use `getNodeWithPosByLocalId` found in the core plugin actions instead
55
+ * @example
56
+ const { editorApi, preset } = usePreset(...);
57
+ const extensionAPI = editorAPI?.extension?.actions?.api();
58
+ // Use nodeWithPos as desired
59
+ const nodeWithPos = extensionAPI.getNodeWithPosByLocalId(localId);
60
+ const node = nodeWithPos.node;
61
+ const nodePos = nodeWithPos.pos;
62
+ */
45
63
  getNodeByLocalId(id: string): Node | undefined;
46
64
  getNodeByFragmentLocalId(id: string): Node | undefined;
47
65
  /**
@@ -11,7 +11,15 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
11
11
  editorApi?.core.actions.requestDocument((doc) => {
12
12
  // use doc as desired
13
13
  })
14
- */
14
+
15
+ * If you were using editorActions.getNodeByLocalId(localId) replace with:
16
+ const { editorApi, preset } = usePreset(...);
17
+ const extensionAPI = editorAPI?.extension?.actions?.api();
18
+ // Use nodeWithPos as desired
19
+ const nodeWithPos = extensionAPI.getNodeWithPosByLocalId(localId);
20
+ const node = nodeWithPos.node;
21
+ const nodePos = nodeWithPos.pos;
22
+ */
15
23
  export default class EditorActions<T = any> implements EditorActionsOptions<T> {
16
24
  private editorView?;
17
25
  private contentTransformer?;
@@ -42,6 +50,16 @@ export default class EditorActions<T = any> implements EditorActionsOptions<T> {
42
50
  * WARNING: this may be called repeatedly, async with care
43
51
  */
44
52
  getValue(): Promise<import("@atlaskit/editor-json-transformer").JSONDocNode | T | undefined>;
53
+ /**
54
+ * @deprecated - please use `getNodeWithPosByLocalId` found in the core plugin actions instead
55
+ * @example
56
+ const { editorApi, preset } = usePreset(...);
57
+ const extensionAPI = editorAPI?.extension?.actions?.api();
58
+ // Use nodeWithPos as desired
59
+ const nodeWithPos = extensionAPI.getNodeWithPosByLocalId(localId);
60
+ const node = nodeWithPos.node;
61
+ const nodePos = nodeWithPos.pos;
62
+ */
45
63
  getNodeByLocalId(id: string): Node | undefined;
46
64
  getNodeByFragmentLocalId(id: string): Node | undefined;
47
65
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "205.7.0",
3
+ "version": "205.7.1",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"