@atlaskit/adf-utils 19.26.0 → 19.26.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,19 @@
|
|
|
1
1
|
# @atlaskit/adf-utils
|
|
2
2
|
|
|
3
|
+
## 19.26.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a05464ea42678`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a05464ea42678) -
|
|
8
|
+
EDITOR-2791 bump adf-schema
|
|
9
|
+
|
|
10
|
+
## 19.26.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`97ab189b05912`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/97ab189b05912) -
|
|
15
|
+
Fix bug causing the ADF scrubber to throw an error when document contains very long words
|
|
16
|
+
|
|
3
17
|
## 19.26.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -9,6 +9,7 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
15
|
var DUMMY_TEXT = "Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur Excepteur sint occaecat cupidatat non proident sunt in culpa qui officia deserunt mollit anim id est laborum";
|
|
@@ -83,8 +84,10 @@ var scrubStr = exports.scrubStr = function scrubStr(val) {
|
|
|
83
84
|
return '';
|
|
84
85
|
} else {
|
|
85
86
|
// Everything else
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
|
|
88
|
+
// modulo to ensure wrapping occurs around base string (no OOB access)
|
|
89
|
+
var correction = base[offset % base.length] === ' ' ? 1 : 0;
|
|
90
|
+
var raw = (0, _platformFeatureFlags.fg)('platform_adf-utils_fix-dummy-text-index-oob') ? base[(offset + correction) % base.length] : base[offset + correction];
|
|
88
91
|
var isLower = char.toLowerCase() === char;
|
|
89
92
|
var result = isLower ? raw.toLowerCase() : raw.toUpperCase();
|
|
90
93
|
offset += 1 + correction;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
const DUMMY_TEXT = `Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur Excepteur sint occaecat cupidatat non proident sunt in culpa qui officia deserunt mollit anim id est laborum`;
|
|
2
3
|
const DUMMY_DIGITS = ['2', '7', '4', '3', '5', '9', '1', '8', '0', '5'];
|
|
3
4
|
const BYPASS_ATTR_LIST = {
|
|
@@ -65,8 +66,10 @@ export const scrubStr = (val, offset = 0) => {
|
|
|
65
66
|
return '';
|
|
66
67
|
} else {
|
|
67
68
|
// Everything else
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
|
|
70
|
+
// modulo to ensure wrapping occurs around base string (no OOB access)
|
|
71
|
+
const correction = base[offset % base.length] === ' ' ? 1 : 0;
|
|
72
|
+
const raw = fg('platform_adf-utils_fix-dummy-text-index-oob') ? base[(offset + correction) % base.length] : base[offset + correction];
|
|
70
73
|
const isLower = char.toLowerCase() === char;
|
|
71
74
|
const result = isLower ? raw.toLowerCase() : raw.toUpperCase();
|
|
72
75
|
offset += 1 + correction;
|
|
@@ -4,6 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
4
4
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
var DUMMY_TEXT = "Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt ut labore et dolore magna aliqua Ut enim ad minim veniam quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur Excepteur sint occaecat cupidatat non proident sunt in culpa qui officia deserunt mollit anim id est laborum";
|
|
8
9
|
var DUMMY_DIGITS = ['2', '7', '4', '3', '5', '9', '1', '8', '0', '5'];
|
|
9
10
|
var BYPASS_ATTR_LIST = {
|
|
@@ -76,8 +77,10 @@ export var scrubStr = function scrubStr(val) {
|
|
|
76
77
|
return '';
|
|
77
78
|
} else {
|
|
78
79
|
// Everything else
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
|
|
81
|
+
// modulo to ensure wrapping occurs around base string (no OOB access)
|
|
82
|
+
var correction = base[offset % base.length] === ' ' ? 1 : 0;
|
|
83
|
+
var raw = fg('platform_adf-utils_fix-dummy-text-index-oob') ? base[(offset + correction) % base.length] : base[offset + correction];
|
|
81
84
|
var isLower = char.toLowerCase() === char;
|
|
82
85
|
var result = isLower ? raw.toLowerCase() : raw.toUpperCase();
|
|
83
86
|
offset += 1 + correction;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/adf-utils",
|
|
3
|
-
"version": "19.26.
|
|
3
|
+
"version": "19.26.2",
|
|
4
4
|
"description": "Set of utilities to traverse, modify and create ADF documents.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -26,11 +26,13 @@
|
|
|
26
26
|
"team": "Editor: Collaboration"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@atlaskit/adf-schema": "^51.
|
|
29
|
+
"@atlaskit/adf-schema": "^51.4.0",
|
|
30
|
+
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
30
31
|
"@babel/runtime": "^7.0.0"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"@atlassian/adf-schema-json": "^1.31.0",
|
|
35
|
+
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
34
36
|
"react": "^18.2.0",
|
|
35
37
|
"wait-for-expect": "^1.2.0"
|
|
36
38
|
},
|
|
@@ -47,5 +49,9 @@
|
|
|
47
49
|
]
|
|
48
50
|
}
|
|
49
51
|
},
|
|
50
|
-
"platform-feature-flags": {
|
|
52
|
+
"platform-feature-flags": {
|
|
53
|
+
"platform_adf-utils_fix-dummy-text-index-oob": {
|
|
54
|
+
"type": "boolean"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
51
57
|
}
|