@atlaskit/editor-plugin-selection-extension 15.0.10 → 15.0.12

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,19 @@
1
1
  # @atlaskit/editor-plugin-selection-extension
2
2
 
3
+ ## 15.0.12
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 15.0.11
10
+
11
+ ### Patch Changes
12
+
13
+ - [`24d7483e9519e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/24d7483e9519e) -
14
+ Cleans up prefer static regex violations
15
+ - Updated dependencies
16
+
3
17
  ## 15.0.10
4
18
 
5
19
  ### Patch Changes
@@ -5,6 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getOffsetByPath = getOffsetByPath;
7
7
  var _model = require("@atlaskit/editor-prosemirror/model");
8
+ // @ts-ignore - TS1501 TypeScript 5.9.2 upgrade
9
+ var NUMERIC_KEY_REGEX = /^[0-9]+$/;
10
+
8
11
  // TODO: ED-28434 - move this to a shared package
9
12
  // mirror code from https://bitbucket.org/atlassian/pf-adf-service/src/master/src/lib/update/get-offset.ts
10
13
 
@@ -20,8 +23,7 @@ function getOffsetByPath(root, pos, pointer) {
20
23
 
21
24
  for (var i = 1; i < len; i++) {
22
25
  var key = parts[i];
23
- // @ts-ignore - TS1501 TypeScript 5.9.2 upgrade
24
- if (ref instanceof _model.Fragment && /^[0-9]+$/.test(key)) {
26
+ if (ref instanceof _model.Fragment && NUMERIC_KEY_REGEX.test(key)) {
25
27
  var index = parseInt(key, 10);
26
28
  if (index >= ref.childCount) {
27
29
  throw new Error("JSON pointer \"".concat(pointer, "\" points to non-existing location."));
@@ -1,5 +1,8 @@
1
1
  import { Fragment, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
2
 
3
+ // @ts-ignore - TS1501 TypeScript 5.9.2 upgrade
4
+ const NUMERIC_KEY_REGEX = /^[0-9]+$/u;
5
+
3
6
  // TODO: ED-28434 - move this to a shared package
4
7
  // mirror code from https://bitbucket.org/atlassian/pf-adf-service/src/master/src/lib/update/get-offset.ts
5
8
 
@@ -13,8 +16,7 @@ export function getOffsetByPath(root, pos, pointer, from = 0, to) {
13
16
 
14
17
  for (let i = 1; i < len; i++) {
15
18
  const key = parts[i];
16
- // @ts-ignore - TS1501 TypeScript 5.9.2 upgrade
17
- if (ref instanceof Fragment && /^[0-9]+$/u.test(key)) {
19
+ if (ref instanceof Fragment && NUMERIC_KEY_REGEX.test(key)) {
18
20
  let index = parseInt(key, 10);
19
21
  if (index >= ref.childCount) {
20
22
  throw new Error(`JSON pointer "${pointer}" points to non-existing location.`);
@@ -1,5 +1,8 @@
1
1
  import { Fragment, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
2
 
3
+ // @ts-ignore - TS1501 TypeScript 5.9.2 upgrade
4
+ var NUMERIC_KEY_REGEX = /^[0-9]+$/;
5
+
3
6
  // TODO: ED-28434 - move this to a shared package
4
7
  // mirror code from https://bitbucket.org/atlassian/pf-adf-service/src/master/src/lib/update/get-offset.ts
5
8
 
@@ -15,8 +18,7 @@ export function getOffsetByPath(root, pos, pointer) {
15
18
 
16
19
  for (var i = 1; i < len; i++) {
17
20
  var key = parts[i];
18
- // @ts-ignore - TS1501 TypeScript 5.9.2 upgrade
19
- if (ref instanceof Fragment && /^[0-9]+$/.test(key)) {
21
+ if (ref instanceof Fragment && NUMERIC_KEY_REGEX.test(key)) {
20
22
  var index = parseInt(key, 10);
21
23
  if (index >= ref.childCount) {
22
24
  throw new Error("JSON pointer \"".concat(pointer, "\" points to non-existing location."));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-extension",
3
- "version": "15.0.10",
3
+ "version": "15.0.12",
4
4
  "description": "editor-plugin-selection-extension plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,19 +39,19 @@
39
39
  "@atlaskit/editor-prosemirror": "^8.0.0",
40
40
  "@atlaskit/editor-shared-styles": "^4.0.0",
41
41
  "@atlaskit/editor-tables": "^3.0.0",
42
- "@atlaskit/editor-toolbar": "^2.0.0",
43
- "@atlaskit/icon": "^36.0.0",
44
- "@atlaskit/lozenge": "^14.0.0",
42
+ "@atlaskit/editor-toolbar": "^2.1.0",
43
+ "@atlaskit/icon": "^36.1.0",
44
+ "@atlaskit/lozenge": "^14.1.0",
45
45
  "@atlaskit/platform-feature-flags": "^2.0.0",
46
- "@atlaskit/primitives": "^20.0.0",
47
- "@atlaskit/tmp-editor-statsig": "^114.0.0",
48
- "@atlaskit/tokens": "^15.0.0",
46
+ "@atlaskit/primitives": "^20.2.0",
47
+ "@atlaskit/tmp-editor-statsig": "^115.0.0",
48
+ "@atlaskit/tokens": "^15.2.0",
49
49
  "@babel/runtime": "^7.0.0",
50
50
  "lodash": "^4.17.21",
51
51
  "uuid": "^3.1.0"
52
52
  },
53
53
  "peerDependencies": {
54
- "@atlaskit/editor-common": "^116.13.0",
54
+ "@atlaskit/editor-common": "^116.17.0",
55
55
  "react": "^18.2.0",
56
56
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
57
57
  },