@atlaskit/editor-plugin-limited-mode 0.0.3 → 1.0.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,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-limited-mode
|
|
2
2
|
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b6192b3a69e94`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b6192b3a69e94) -
|
|
8
|
+
ED-29194 Limited mode banner: add handling for live-to-live page transitions where the editor is
|
|
9
|
+
reused and has a transaction meta "replaceDocument"
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 1.0.0
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 0.0.3
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"extends": "../../../../tsconfig.entry-points.confluence.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"target": "es5",
|
|
5
|
-
"composite": true,
|
|
6
5
|
"outDir": "../../../../../confluence/tsDist/@atlaskit__editor-plugin-limited-mode",
|
|
7
|
-
"rootDir": "../"
|
|
6
|
+
"rootDir": "../",
|
|
7
|
+
"composite": true
|
|
8
8
|
},
|
|
9
9
|
"include": [
|
|
10
10
|
"../src/**/*.ts",
|
|
@@ -24,4 +24,4 @@
|
|
|
24
24
|
"path": "../../editor-common/afm-cc/tsconfig.json"
|
|
25
25
|
}
|
|
26
26
|
]
|
|
27
|
-
}
|
|
27
|
+
}
|
|
@@ -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
|
});
|
|
@@ -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
|
});
|
|
@@ -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": "
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "LimitedMode plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -27,16 +27,13 @@
|
|
|
27
27
|
},
|
|
28
28
|
"sideEffects": false,
|
|
29
29
|
"atlaskit:src": "src/index.ts",
|
|
30
|
-
"af:exports": {
|
|
31
|
-
".": "./src/index.ts"
|
|
32
|
-
},
|
|
33
30
|
"dependencies": {
|
|
34
31
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
35
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
32
|
+
"@atlaskit/tmp-editor-statsig": "^12.4.0",
|
|
36
33
|
"@babel/runtime": "^7.0.0"
|
|
37
34
|
},
|
|
38
35
|
"peerDependencies": {
|
|
39
|
-
"@atlaskit/editor-common": "^
|
|
36
|
+
"@atlaskit/editor-common": "^108.2.0",
|
|
40
37
|
"react": "^18.2.0"
|
|
41
38
|
},
|
|
42
39
|
"devDependencies": {
|