@atlaskit/editor-plugin-limited-mode 1.0.0 → 1.0.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 +18 -0
- package/dist/cjs/limitedModePlugin.js +2 -1
- package/dist/cjs/pm-plugins/main.js +5 -2
- package/dist/es2019/limitedModePlugin.js +2 -1
- package/dist/es2019/pm-plugins/main.js +6 -2
- package/dist/esm/limitedModePlugin.js +2 -1
- package/dist/esm/pm-plugins/main.js +5 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-limited-mode
|
|
2
2
|
|
|
3
|
+
## 1.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f0664ee77d680`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f0664ee77d680) -
|
|
8
|
+
ED-29201 Limited Mode: Undefined error in our limited mode enabled getter when trying to get
|
|
9
|
+
documentSizeBreachesThreshold from plugin state.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 1.0.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`b6192b3a69e94`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b6192b3a69e94) -
|
|
17
|
+
ED-29194 Limited mode banner: add handling for live-to-live page transitions where the editor is
|
|
18
|
+
reused and has a transaction meta "replaceDocument"
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 1.0.0
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -18,7 +18,8 @@ var limitedModePlugin = exports.limitedModePlugin = function limitedModePlugin()
|
|
|
18
18
|
if (editorState) {
|
|
19
19
|
return {
|
|
20
20
|
get enabled() {
|
|
21
|
-
|
|
21
|
+
var _limitedModePluginKey, _limitedModePluginKey2;
|
|
22
|
+
return (_limitedModePluginKey = (_limitedModePluginKey2 = _main.limitedModePluginKey.getState(editorState)) === null || _limitedModePluginKey2 === void 0 ? void 0 : _limitedModePluginKey2.documentSizeBreachesThreshold) !== null && _limitedModePluginKey !== void 0 ? _limitedModePluginKey : false;
|
|
22
23
|
},
|
|
23
24
|
limitedModePluginKey: _main.limitedModePluginKey
|
|
24
25
|
};
|
|
@@ -31,7 +31,8 @@ var createPlugin = exports.createPlugin = function createPlugin() {
|
|
|
31
31
|
},
|
|
32
32
|
apply: function apply(tr, currentPluginState) {
|
|
33
33
|
// Don't check the document size if we're already in limited mode.
|
|
34
|
-
if (
|
|
34
|
+
// We ALWAYS want to re-check the document size if we're replacing the document (e.g. live-to-live page navigation).
|
|
35
|
+
if (currentPluginState.documentSizeBreachesThreshold && !tr.getMeta('replaceDocument')) {
|
|
35
36
|
return currentPluginState;
|
|
36
37
|
}
|
|
37
38
|
if (tr.doc.nodeSize > (0, _expVal.expVal)('cc_editor_limited_mode', 'nodeSize', 100)) {
|
|
@@ -39,7 +40,9 @@ var createPlugin = exports.createPlugin = function createPlugin() {
|
|
|
39
40
|
documentSizeBreachesThreshold: true
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
|
-
return currentPluginState
|
|
43
|
+
return _objectSpread(_objectSpread({}, currentPluginState), {}, {
|
|
44
|
+
documentSizeBreachesThreshold: false
|
|
45
|
+
});
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
});
|
|
@@ -12,7 +12,8 @@ export const limitedModePlugin = () => {
|
|
|
12
12
|
if (editorState) {
|
|
13
13
|
return {
|
|
14
14
|
get enabled() {
|
|
15
|
-
|
|
15
|
+
var _limitedModePluginKey, _limitedModePluginKey2;
|
|
16
|
+
return (_limitedModePluginKey = (_limitedModePluginKey2 = limitedModePluginKey.getState(editorState)) === null || _limitedModePluginKey2 === void 0 ? void 0 : _limitedModePluginKey2.documentSizeBreachesThreshold) !== null && _limitedModePluginKey !== void 0 ? _limitedModePluginKey : false;
|
|
16
17
|
},
|
|
17
18
|
limitedModePluginKey
|
|
18
19
|
};
|
|
@@ -21,7 +21,8 @@ export const createPlugin = () => {
|
|
|
21
21
|
},
|
|
22
22
|
apply: (tr, currentPluginState) => {
|
|
23
23
|
// Don't check the document size if we're already in limited mode.
|
|
24
|
-
if (
|
|
24
|
+
// We ALWAYS want to re-check the document size if we're replacing the document (e.g. live-to-live page navigation).
|
|
25
|
+
if (currentPluginState.documentSizeBreachesThreshold && !tr.getMeta('replaceDocument')) {
|
|
25
26
|
return currentPluginState;
|
|
26
27
|
}
|
|
27
28
|
if (tr.doc.nodeSize > expVal('cc_editor_limited_mode', 'nodeSize', 100)) {
|
|
@@ -30,7 +31,10 @@ export const createPlugin = () => {
|
|
|
30
31
|
documentSizeBreachesThreshold: true
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
|
-
return
|
|
34
|
+
return {
|
|
35
|
+
...currentPluginState,
|
|
36
|
+
documentSizeBreachesThreshold: false
|
|
37
|
+
};
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
40
|
});
|
|
@@ -12,7 +12,8 @@ export var limitedModePlugin = function limitedModePlugin() {
|
|
|
12
12
|
if (editorState) {
|
|
13
13
|
return {
|
|
14
14
|
get enabled() {
|
|
15
|
-
|
|
15
|
+
var _limitedModePluginKey, _limitedModePluginKey2;
|
|
16
|
+
return (_limitedModePluginKey = (_limitedModePluginKey2 = limitedModePluginKey.getState(editorState)) === null || _limitedModePluginKey2 === void 0 ? void 0 : _limitedModePluginKey2.documentSizeBreachesThreshold) !== null && _limitedModePluginKey !== void 0 ? _limitedModePluginKey : false;
|
|
16
17
|
},
|
|
17
18
|
limitedModePluginKey: limitedModePluginKey
|
|
18
19
|
};
|
|
@@ -24,7 +24,8 @@ export var createPlugin = function createPlugin() {
|
|
|
24
24
|
},
|
|
25
25
|
apply: function apply(tr, currentPluginState) {
|
|
26
26
|
// Don't check the document size if we're already in limited mode.
|
|
27
|
-
if (
|
|
27
|
+
// We ALWAYS want to re-check the document size if we're replacing the document (e.g. live-to-live page navigation).
|
|
28
|
+
if (currentPluginState.documentSizeBreachesThreshold && !tr.getMeta('replaceDocument')) {
|
|
28
29
|
return currentPluginState;
|
|
29
30
|
}
|
|
30
31
|
if (tr.doc.nodeSize > expVal('cc_editor_limited_mode', 'nodeSize', 100)) {
|
|
@@ -32,7 +33,9 @@ export var createPlugin = function createPlugin() {
|
|
|
32
33
|
documentSizeBreachesThreshold: true
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
|
-
return currentPluginState
|
|
36
|
+
return _objectSpread(_objectSpread({}, currentPluginState), {}, {
|
|
37
|
+
documentSizeBreachesThreshold: false
|
|
38
|
+
});
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-limited-mode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "LimitedMode plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"atlaskit:src": "src/index.ts",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
32
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
32
|
+
"@atlaskit/tmp-editor-statsig": "^12.5.0",
|
|
33
33
|
"@babel/runtime": "^7.0.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@atlaskit/editor-common": "^108.
|
|
36
|
+
"@atlaskit/editor-common": "^108.3.0",
|
|
37
37
|
"react": "^18.2.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|