@atlaskit/editor-plugin-local-id 4.3.1 → 4.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-plugin-local-id
2
2
 
3
+ ## 4.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`45270b9a8ed63`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/45270b9a8ed63) -
8
+ CONFCLOUD-83370: Fix broken IME composition
9
+ - Updated dependencies
10
+
3
11
  ## 4.3.1
4
12
 
5
13
  ### Patch Changes
@@ -18,9 +18,18 @@
18
18
  "../src/**/examples.*"
19
19
  ],
20
20
  "references": [
21
+ {
22
+ "path": "../../adf-schema/afm-cc/tsconfig.json"
23
+ },
24
+ {
25
+ "path": "../../editor-prosemirror/afm-cc/tsconfig.json"
26
+ },
21
27
  {
22
28
  "path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
23
29
  },
30
+ {
31
+ "path": "../../tmp-editor-statsig/afm-cc/tsconfig.json"
32
+ },
24
33
  {
25
34
  "path": "../../editor-common/afm-cc/tsconfig.json"
26
35
  }
@@ -18,6 +18,12 @@
18
18
  "../src/**/examples.*"
19
19
  ],
20
20
  "references": [
21
+ {
22
+ "path": "../../adf-schema/afm-jira/tsconfig.json"
23
+ },
24
+ {
25
+ "path": "../../editor-prosemirror/afm-jira/tsconfig.json"
26
+ },
21
27
  {
22
28
  "path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
23
29
  },
@@ -18,6 +18,12 @@
18
18
  "../src/**/examples.*"
19
19
  ],
20
20
  "references": [
21
+ {
22
+ "path": "../../adf-schema/afm-products/tsconfig.json"
23
+ },
24
+ {
25
+ "path": "../../editor-prosemirror/afm-products/tsconfig.json"
26
+ },
21
27
  {
22
28
  "path": "../../../platform/feature-flags/afm-products/tsconfig.json"
23
29
  },
@@ -13,6 +13,7 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
13
13
  var _utils = require("@atlaskit/editor-common/utils");
14
14
  var _state = require("@atlaskit/editor-prosemirror/state");
15
15
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
16
17
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
17
18
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
18
19
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
@@ -97,6 +98,10 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
97
98
  * This ensures uniqueness of localIds on nodes being created or edited
98
99
  */
99
100
  appendTransaction: function appendTransaction(transactions, _oldState, newState) {
101
+ var _api$composition$shar;
102
+ if (api !== null && api !== void 0 && (_api$composition$shar = api.composition.sharedState.currentState()) !== null && _api$composition$shar !== void 0 && _api$composition$shar.isComposing && (0, _expValEquals.expValEquals)('platform_editor_localid_ime_composition_fix', 'isEnabled', true)) {
103
+ return undefined;
104
+ }
100
105
  var modified = false;
101
106
  var tr = newState.tr;
102
107
  var _newState$schema$node = newState.schema.nodes,
@@ -197,7 +202,6 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
197
202
  _iterator.f();
198
203
  }
199
204
  }
200
-
201
205
  // Apply local ID updates based on the improvements feature flag:
202
206
  // - When enabled: Batch all updates into a single BatchAttrsStep
203
207
  // - When disabled: Individual steps were already applied above during node processing
@@ -5,6 +5,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
5
  import { stepHasSlice } from '@atlaskit/editor-common/utils';
6
6
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
9
  export const localIdPluginKey = new PluginKey('localIdPlugin');
9
10
  const generateUUID = (api, node, pos) => {
10
11
  if (fg('platform_editor_ai_local_id_short')) {
@@ -87,6 +88,10 @@ export const createPlugin = api => {
87
88
  * This ensures uniqueness of localIds on nodes being created or edited
88
89
  */
89
90
  appendTransaction: (transactions, _oldState, newState) => {
91
+ var _api$composition$shar;
92
+ if (api !== null && api !== void 0 && (_api$composition$shar = api.composition.sharedState.currentState()) !== null && _api$composition$shar !== void 0 && _api$composition$shar.isComposing && expValEquals('platform_editor_localid_ime_composition_fix', 'isEnabled', true)) {
93
+ return undefined;
94
+ }
90
95
  let modified = false;
91
96
  const tr = newState.tr;
92
97
  const {
@@ -179,7 +184,6 @@ export const createPlugin = api => {
179
184
  }
180
185
  }
181
186
  }
182
-
183
187
  // Apply local ID updates based on the improvements feature flag:
184
188
  // - When enabled: Batch all updates into a single BatchAttrsStep
185
189
  // - When disabled: Individual steps were already applied above during node processing
@@ -9,6 +9,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
9
9
  import { stepHasSlice } from '@atlaskit/editor-common/utils';
10
10
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
11
11
  import { fg } from '@atlaskit/platform-feature-flags';
12
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
13
  export var localIdPluginKey = new PluginKey('localIdPlugin');
13
14
  var generateUUID = function generateUUID(api, node, pos) {
14
15
  if (fg('platform_editor_ai_local_id_short')) {
@@ -90,6 +91,10 @@ export var createPlugin = function createPlugin(api) {
90
91
  * This ensures uniqueness of localIds on nodes being created or edited
91
92
  */
92
93
  appendTransaction: function appendTransaction(transactions, _oldState, newState) {
94
+ var _api$composition$shar;
95
+ if (api !== null && api !== void 0 && (_api$composition$shar = api.composition.sharedState.currentState()) !== null && _api$composition$shar !== void 0 && _api$composition$shar.isComposing && expValEquals('platform_editor_localid_ime_composition_fix', 'isEnabled', true)) {
96
+ return undefined;
97
+ }
93
98
  var modified = false;
94
99
  var tr = newState.tr;
95
100
  var _newState$schema$node = newState.schema.nodes,
@@ -190,7 +195,6 @@ export var createPlugin = function createPlugin(api) {
190
195
  _iterator.f();
191
196
  }
192
197
  }
193
-
194
198
  // Apply local ID updates based on the improvements feature flag:
195
199
  // - When enabled: Batch all updates into a single BatchAttrsStep
196
200
  // - When disabled: Individual steps were already applied above during node processing
@@ -1,4 +1,5 @@
1
1
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
+ import type { CompositionPlugin } from '@atlaskit/editor-plugin-composition';
2
3
  import type { Node } from '@atlaskit/editor-prosemirror/model';
3
4
  import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
4
5
  export type ActionProps = {
@@ -24,4 +25,5 @@ export type LocalIdPlugin = NextEditorPlugin<'localId', {
24
25
  value: Node;
25
26
  }) => boolean;
26
27
  };
28
+ dependencies: [CompositionPlugin];
27
29
  }>;
@@ -1,4 +1,5 @@
1
1
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
+ import type { CompositionPlugin } from '@atlaskit/editor-plugin-composition';
2
3
  import type { Node } from '@atlaskit/editor-prosemirror/model';
3
4
  import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
4
5
  export type ActionProps = {
@@ -24,4 +25,7 @@ export type LocalIdPlugin = NextEditorPlugin<'localId', {
24
25
  value: Node;
25
26
  }) => boolean;
26
27
  };
28
+ dependencies: [
29
+ CompositionPlugin
30
+ ];
27
31
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-local-id",
3
- "version": "4.3.1",
3
+ "version": "4.3.2",
4
4
  "description": "LocalId plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -28,14 +28,15 @@
28
28
  "sideEffects": false,
29
29
  "atlaskit:src": "src/index.ts",
30
30
  "dependencies": {
31
- "@atlaskit/adf-schema": "^51.5.1",
32
- "@atlaskit/editor-prosemirror": "7.0.0",
31
+ "@atlaskit/adf-schema": "^51.5.0",
32
+ "@atlaskit/editor-prosemirror": "^7.2.0",
33
33
  "@atlaskit/platform-feature-flags": "^1.1.0",
34
+ "@atlaskit/tmp-editor-statsig": "^16.3.0",
34
35
  "@babel/runtime": "^7.0.0",
35
36
  "raf-schd": "^4.0.3"
36
37
  },
37
38
  "peerDependencies": {
38
- "@atlaskit/editor-common": "^110.41.0",
39
+ "@atlaskit/editor-common": "^110.49.0",
39
40
  "react": "^18.2.0"
40
41
  },
41
42
  "devDependencies": {