@atlaskit/editor-plugin-local-id 4.3.0 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-plugin-local-id
2
2
 
3
+ ## 4.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`65e23b9169d24`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/65e23b9169d24) -
8
+ Do not pre-load local ids with collab
9
+ - Updated dependencies
10
+
3
11
  ## 4.3.0
4
12
 
5
13
  ### Minor Changes
@@ -45,6 +45,13 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
45
45
  * to nodes that don't have them. It's designed to run only once per
46
46
  * editor instance to avoid performance issues.
47
47
  */
48
+ // @ts-expect-error - This is an experiment to see if we can improve performance - if successful
49
+ // we will add the plugin as a dependency
50
+ if (api !== null && api !== void 0 && api.collabEdit && (0, _platformFeatureFlags.fg)('platform_editor_ai_aifc_avoid_initial_localId')) {
51
+ return {
52
+ update: function update() {}
53
+ };
54
+ }
48
55
  requestIdleCallbackWithFallback(function () {
49
56
  var tr = editorView.state.tr;
50
57
  var localIdWasAdded = false;
@@ -153,7 +160,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
153
160
  });
154
161
  });
155
162
  if (addedNodes.size > 0 && (0, _platformFeatureFlags.fg)('platform_editor_use_localid_dedupe')) {
156
- newState.doc.descendants(function (node, pos) {
163
+ newState.doc.descendants(function (node) {
157
164
  if (addedNodes.has(node)) {
158
165
  return true;
159
166
  }
@@ -34,6 +34,13 @@ export const createPlugin = api => {
34
34
  * to nodes that don't have them. It's designed to run only once per
35
35
  * editor instance to avoid performance issues.
36
36
  */
37
+ // @ts-expect-error - This is an experiment to see if we can improve performance - if successful
38
+ // we will add the plugin as a dependency
39
+ if (api !== null && api !== void 0 && api.collabEdit && fg('platform_editor_ai_aifc_avoid_initial_localId')) {
40
+ return {
41
+ update: () => {}
42
+ };
43
+ }
37
44
  requestIdleCallbackWithFallback(() => {
38
45
  const tr = editorView.state.tr;
39
46
  let localIdWasAdded = false;
@@ -144,7 +151,7 @@ export const createPlugin = api => {
144
151
  });
145
152
  });
146
153
  if (addedNodes.size > 0 && fg('platform_editor_use_localid_dedupe')) {
147
- newState.doc.descendants((node, pos) => {
154
+ newState.doc.descendants(node => {
148
155
  if (addedNodes.has(node)) {
149
156
  return true;
150
157
  }
@@ -38,6 +38,13 @@ export var createPlugin = function createPlugin(api) {
38
38
  * to nodes that don't have them. It's designed to run only once per
39
39
  * editor instance to avoid performance issues.
40
40
  */
41
+ // @ts-expect-error - This is an experiment to see if we can improve performance - if successful
42
+ // we will add the plugin as a dependency
43
+ if (api !== null && api !== void 0 && api.collabEdit && fg('platform_editor_ai_aifc_avoid_initial_localId')) {
44
+ return {
45
+ update: function update() {}
46
+ };
47
+ }
41
48
  requestIdleCallbackWithFallback(function () {
42
49
  var tr = editorView.state.tr;
43
50
  var localIdWasAdded = false;
@@ -146,7 +153,7 @@ export var createPlugin = function createPlugin(api) {
146
153
  });
147
154
  });
148
155
  if (addedNodes.size > 0 && fg('platform_editor_use_localid_dedupe')) {
149
- newState.doc.descendants(function (node, pos) {
156
+ newState.doc.descendants(function (node) {
150
157
  if (addedNodes.has(node)) {
151
158
  return true;
152
159
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-local-id",
3
- "version": "4.3.0",
3
+ "version": "4.3.1",
4
4
  "description": "LocalId plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -84,6 +84,9 @@
84
84
  "platform_editor_ai_local_id_short": {
85
85
  "type": "boolean"
86
86
  },
87
+ "platform_editor_ai_aifc_avoid_initial_localId": {
88
+ "type": "boolean"
89
+ },
87
90
  "platform_editor_localid_improvements": {
88
91
  "type": "boolean"
89
92
  }