@atlaskit/editor-plugin-limited-mode 3.0.4 → 3.1.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 +20 -0
- package/afm-jira/tsconfig.json +1 -1
- package/afm-products/tsconfig.json +30 -0
- package/dist/cjs/limitedModePlugin.js +4 -0
- package/dist/cjs/pm-plugins/main.js +53 -10
- package/dist/es2019/limitedModePlugin.js +4 -0
- package/dist/es2019/pm-plugins/main.js +55 -11
- package/dist/esm/limitedModePlugin.js +4 -0
- package/dist/esm/pm-plugins/main.js +53 -10
- package/package.json +4 -4
- package/afm-dev-agents/tsconfig.json +0 -30
- package/afm-passionfruit/tsconfig.json +0 -30
- package/afm-post-office/tsconfig.json +0 -30
- package/afm-rovo-extension/tsconfig.json +0 -30
- package/afm-townsquare/tsconfig.json +0 -30
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-limited-mode
|
|
2
2
|
|
|
3
|
+
## 3.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4d676bbdb3ce6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4d676bbdb3ce6) -
|
|
8
|
+
ts-ignore added temporarily to unblock local consumption for help-center, will be removed once
|
|
9
|
+
project refs are setup
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 3.1.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [`c6c113481c118`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c6c113481c118) -
|
|
17
|
+
Updates limited mode to include lcm sizes in decision to engage.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 3.0.4
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/afm-jira/tsconfig.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"extends": "../../../../tsconfig.entry-points.jira.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"target": "es5",
|
|
5
|
-
"outDir": "../../../../../tsDist/@atlaskit__editor-plugin-limited-mode/app",
|
|
5
|
+
"outDir": "../../../../../jira/tsDist/@atlaskit__editor-plugin-limited-mode/app",
|
|
6
6
|
"rootDir": "../",
|
|
7
7
|
"composite": true
|
|
8
8
|
},
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../../tsconfig.entry-points.products.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "es5",
|
|
5
|
+
"outDir": "../../../../../tsDist/@atlaskit__editor-plugin-limited-mode/app",
|
|
6
|
+
"rootDir": "../",
|
|
7
|
+
"composite": true
|
|
8
|
+
},
|
|
9
|
+
"include": [
|
|
10
|
+
"../src/**/*.ts",
|
|
11
|
+
"../src/**/*.tsx"
|
|
12
|
+
],
|
|
13
|
+
"exclude": [
|
|
14
|
+
"../src/**/__tests__/*",
|
|
15
|
+
"../src/**/*.test.*",
|
|
16
|
+
"../src/**/test.*",
|
|
17
|
+
"../src/**/examples.*"
|
|
18
|
+
],
|
|
19
|
+
"references": [
|
|
20
|
+
{
|
|
21
|
+
"path": "../../../design-system/primitives/afm-products/tsconfig.json"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"path": "../../tmp-editor-statsig/afm-products/tsconfig.json"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"path": "../../editor-common/afm-products/tsconfig.json"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -54,6 +54,10 @@ var limitedModePlugin = exports.limitedModePlugin = function limitedModePlugin(_
|
|
|
54
54
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
55
55
|
}, [options.contentId]);
|
|
56
56
|
var checkAndShowFlag = (0, _react.useCallback)(function (isLimitedModeEnabled) {
|
|
57
|
+
if (!((0, _expVal.expVal)('cc_editor_limited_mode', 'flagEnabled', true) === true)) {
|
|
58
|
+
// Disable the flag behavior entirely if the flag is off
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
57
61
|
var _learnMoreLink = (0, _expVal.expVal)('cc_editor_limited_mode', 'learnMoreLink', '');
|
|
58
62
|
if (isLimitedModeEnabled && hasEditorBeenFocusedRef.current && !hasShownFlagRef.current) {
|
|
59
63
|
var _options$showFlag;
|
|
@@ -15,34 +15,77 @@ var limitedModePluginKey = exports.limitedModePluginKey = new _state.PluginKey('
|
|
|
15
15
|
var createPlugin = exports.createPlugin = function createPlugin() {
|
|
16
16
|
return new _safePlugin.SafePlugin({
|
|
17
17
|
key: limitedModePluginKey,
|
|
18
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
19
|
+
|
|
18
20
|
view: function view(_view) {
|
|
19
21
|
return {};
|
|
20
22
|
},
|
|
21
23
|
state: {
|
|
24
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
22
25
|
init: function init(config, editorState) {
|
|
23
|
-
if (
|
|
26
|
+
if ((0, _expVal.expVal)('cc_editor_limited_mode_include_lcm', 'isEnabled', true)) {
|
|
27
|
+
// calculates the size of the doc, where when there are legacy content macros, the content
|
|
28
|
+
// is stored in the attrs.
|
|
29
|
+
// This is essentiall doc.nod
|
|
30
|
+
var customDocSize = editorState.doc.nodeSize;
|
|
31
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
32
|
+
|
|
33
|
+
editorState.doc.descendants(function (node) {
|
|
34
|
+
var _node$attrs;
|
|
35
|
+
if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
|
|
36
|
+
var _node$attrs$parameter, _node$attrs2;
|
|
37
|
+
customDocSize += (_node$attrs$parameter = (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.parameters) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.adf) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.length) !== null && _node$attrs$parameter !== void 0 ? _node$attrs$parameter : 0;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
documentSizeBreachesThreshold: customDocSize > (0, _expVal.expVal)('cc_editor_limited_mode', 'nodeSize', 100)
|
|
42
|
+
};
|
|
43
|
+
} else {
|
|
44
|
+
if (editorState.doc.nodeSize > (0, _expVal.expVal)('cc_editor_limited_mode', 'nodeSize', 100)) {
|
|
45
|
+
return {
|
|
46
|
+
documentSizeBreachesThreshold: true
|
|
47
|
+
};
|
|
48
|
+
}
|
|
24
49
|
return {
|
|
25
|
-
documentSizeBreachesThreshold:
|
|
50
|
+
documentSizeBreachesThreshold: false
|
|
26
51
|
};
|
|
27
52
|
}
|
|
28
|
-
return {
|
|
29
|
-
documentSizeBreachesThreshold: false
|
|
30
|
-
};
|
|
31
53
|
},
|
|
54
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
55
|
+
|
|
32
56
|
apply: function apply(tr, currentPluginState) {
|
|
33
57
|
// Don't check the document size if we're already in limited mode.
|
|
34
58
|
// We ALWAYS want to re-check the document size if we're replacing the document (e.g. live-to-live page navigation).
|
|
35
59
|
if (currentPluginState.documentSizeBreachesThreshold && !tr.getMeta('replaceDocument')) {
|
|
36
60
|
return currentPluginState;
|
|
37
61
|
}
|
|
38
|
-
if (
|
|
62
|
+
if ((0, _expVal.expVal)('cc_editor_limited_mode_include_lcm', 'isEnabled', true)) {
|
|
63
|
+
// calculates the size of the doc, where when there are legacy content macros, the content
|
|
64
|
+
// is stored in the attrs.
|
|
65
|
+
// This is essentiall doc.nod
|
|
66
|
+
var customDocSize = tr.doc.nodeSize;
|
|
67
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
68
|
+
|
|
69
|
+
tr.doc.descendants(function (node) {
|
|
70
|
+
var _node$attrs3;
|
|
71
|
+
if (((_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.extensionKey) === 'legacy-content') {
|
|
72
|
+
var _node$attrs$parameter2, _node$attrs4;
|
|
73
|
+
customDocSize += (_node$attrs$parameter2 = (_node$attrs4 = node.attrs) === null || _node$attrs4 === void 0 || (_node$attrs4 = _node$attrs4.parameters) === null || _node$attrs4 === void 0 || (_node$attrs4 = _node$attrs4.adf) === null || _node$attrs4 === void 0 ? void 0 : _node$attrs4.length) !== null && _node$attrs$parameter2 !== void 0 ? _node$attrs$parameter2 : 0;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
return {
|
|
77
|
+
documentSizeBreachesThreshold: customDocSize > (0, _expVal.expVal)('cc_editor_limited_mode', 'nodeSize', 100)
|
|
78
|
+
};
|
|
79
|
+
} else {
|
|
80
|
+
if (tr.doc.nodeSize > (0, _expVal.expVal)('cc_editor_limited_mode', 'nodeSize', 100)) {
|
|
81
|
+
return _objectSpread(_objectSpread({}, currentPluginState), {}, {
|
|
82
|
+
documentSizeBreachesThreshold: true
|
|
83
|
+
});
|
|
84
|
+
}
|
|
39
85
|
return _objectSpread(_objectSpread({}, currentPluginState), {}, {
|
|
40
|
-
documentSizeBreachesThreshold:
|
|
86
|
+
documentSizeBreachesThreshold: false
|
|
41
87
|
});
|
|
42
88
|
}
|
|
43
|
-
return _objectSpread(_objectSpread({}, currentPluginState), {}, {
|
|
44
|
-
documentSizeBreachesThreshold: false
|
|
45
|
-
});
|
|
46
89
|
}
|
|
47
90
|
}
|
|
48
91
|
});
|
|
@@ -48,6 +48,10 @@ export const limitedModePlugin = ({
|
|
|
48
48
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
49
49
|
}, [options.contentId]);
|
|
50
50
|
const checkAndShowFlag = useCallback(isLimitedModeEnabled => {
|
|
51
|
+
if (!(expVal('cc_editor_limited_mode', 'flagEnabled', true) === true)) {
|
|
52
|
+
// Disable the flag behavior entirely if the flag is off
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
51
55
|
const learnMoreLink = expVal('cc_editor_limited_mode', 'learnMoreLink', '');
|
|
52
56
|
if (isLimitedModeEnabled && hasEditorBeenFocusedRef.current && !hasShownFlagRef.current) {
|
|
53
57
|
var _options$showFlag;
|
|
@@ -5,36 +5,80 @@ export const limitedModePluginKey = new PluginKey('limitedModePlugin');
|
|
|
5
5
|
export const createPlugin = () => {
|
|
6
6
|
return new SafePlugin({
|
|
7
7
|
key: limitedModePluginKey,
|
|
8
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
9
|
+
|
|
8
10
|
view: _view => {
|
|
9
11
|
return {};
|
|
10
12
|
},
|
|
11
13
|
state: {
|
|
14
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
15
|
+
|
|
12
16
|
init(config, editorState) {
|
|
13
|
-
if (
|
|
17
|
+
if (expVal('cc_editor_limited_mode_include_lcm', 'isEnabled', true)) {
|
|
18
|
+
// calculates the size of the doc, where when there are legacy content macros, the content
|
|
19
|
+
// is stored in the attrs.
|
|
20
|
+
// This is essentiall doc.nod
|
|
21
|
+
let customDocSize = editorState.doc.nodeSize;
|
|
22
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
23
|
+
|
|
24
|
+
editorState.doc.descendants(node => {
|
|
25
|
+
var _node$attrs;
|
|
26
|
+
if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
|
|
27
|
+
var _node$attrs$parameter, _node$attrs2, _node$attrs2$paramete, _node$attrs2$paramete2;
|
|
28
|
+
customDocSize += (_node$attrs$parameter = (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : (_node$attrs2$paramete = _node$attrs2.parameters) === null || _node$attrs2$paramete === void 0 ? void 0 : (_node$attrs2$paramete2 = _node$attrs2$paramete.adf) === null || _node$attrs2$paramete2 === void 0 ? void 0 : _node$attrs2$paramete2.length) !== null && _node$attrs$parameter !== void 0 ? _node$attrs$parameter : 0;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
14
31
|
return {
|
|
15
|
-
documentSizeBreachesThreshold:
|
|
32
|
+
documentSizeBreachesThreshold: customDocSize > expVal('cc_editor_limited_mode', 'nodeSize', 100)
|
|
33
|
+
};
|
|
34
|
+
} else {
|
|
35
|
+
if (editorState.doc.nodeSize > expVal('cc_editor_limited_mode', 'nodeSize', 100)) {
|
|
36
|
+
return {
|
|
37
|
+
documentSizeBreachesThreshold: true
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
documentSizeBreachesThreshold: false
|
|
16
42
|
};
|
|
17
43
|
}
|
|
18
|
-
return {
|
|
19
|
-
documentSizeBreachesThreshold: false
|
|
20
|
-
};
|
|
21
44
|
},
|
|
45
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
46
|
+
|
|
22
47
|
apply: (tr, currentPluginState) => {
|
|
23
48
|
// Don't check the document size if we're already in limited mode.
|
|
24
49
|
// We ALWAYS want to re-check the document size if we're replacing the document (e.g. live-to-live page navigation).
|
|
25
50
|
if (currentPluginState.documentSizeBreachesThreshold && !tr.getMeta('replaceDocument')) {
|
|
26
51
|
return currentPluginState;
|
|
27
52
|
}
|
|
28
|
-
if (
|
|
53
|
+
if (expVal('cc_editor_limited_mode_include_lcm', 'isEnabled', true)) {
|
|
54
|
+
// calculates the size of the doc, where when there are legacy content macros, the content
|
|
55
|
+
// is stored in the attrs.
|
|
56
|
+
// This is essentiall doc.nod
|
|
57
|
+
let customDocSize = tr.doc.nodeSize;
|
|
58
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
59
|
+
|
|
60
|
+
tr.doc.descendants(node => {
|
|
61
|
+
var _node$attrs3;
|
|
62
|
+
if (((_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.extensionKey) === 'legacy-content') {
|
|
63
|
+
var _node$attrs$parameter2, _node$attrs4, _node$attrs4$paramete, _node$attrs4$paramete2;
|
|
64
|
+
customDocSize += (_node$attrs$parameter2 = (_node$attrs4 = node.attrs) === null || _node$attrs4 === void 0 ? void 0 : (_node$attrs4$paramete = _node$attrs4.parameters) === null || _node$attrs4$paramete === void 0 ? void 0 : (_node$attrs4$paramete2 = _node$attrs4$paramete.adf) === null || _node$attrs4$paramete2 === void 0 ? void 0 : _node$attrs4$paramete2.length) !== null && _node$attrs$parameter2 !== void 0 ? _node$attrs$parameter2 : 0;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
return {
|
|
68
|
+
documentSizeBreachesThreshold: customDocSize > expVal('cc_editor_limited_mode', 'nodeSize', 100)
|
|
69
|
+
};
|
|
70
|
+
} else {
|
|
71
|
+
if (tr.doc.nodeSize > expVal('cc_editor_limited_mode', 'nodeSize', 100)) {
|
|
72
|
+
return {
|
|
73
|
+
...currentPluginState,
|
|
74
|
+
documentSizeBreachesThreshold: true
|
|
75
|
+
};
|
|
76
|
+
}
|
|
29
77
|
return {
|
|
30
78
|
...currentPluginState,
|
|
31
|
-
documentSizeBreachesThreshold:
|
|
79
|
+
documentSizeBreachesThreshold: false
|
|
32
80
|
};
|
|
33
81
|
}
|
|
34
|
-
return {
|
|
35
|
-
...currentPluginState,
|
|
36
|
-
documentSizeBreachesThreshold: false
|
|
37
|
-
};
|
|
38
82
|
}
|
|
39
83
|
}
|
|
40
84
|
});
|
|
@@ -46,6 +46,10 @@ export var limitedModePlugin = function limitedModePlugin(_ref) {
|
|
|
46
46
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
47
47
|
}, [options.contentId]);
|
|
48
48
|
var checkAndShowFlag = useCallback(function (isLimitedModeEnabled) {
|
|
49
|
+
if (!(expVal('cc_editor_limited_mode', 'flagEnabled', true) === true)) {
|
|
50
|
+
// Disable the flag behavior entirely if the flag is off
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
49
53
|
var _learnMoreLink = expVal('cc_editor_limited_mode', 'learnMoreLink', '');
|
|
50
54
|
if (isLimitedModeEnabled && hasEditorBeenFocusedRef.current && !hasShownFlagRef.current) {
|
|
51
55
|
var _options$showFlag;
|
|
@@ -8,34 +8,77 @@ export var limitedModePluginKey = new PluginKey('limitedModePlugin');
|
|
|
8
8
|
export var createPlugin = function createPlugin() {
|
|
9
9
|
return new SafePlugin({
|
|
10
10
|
key: limitedModePluginKey,
|
|
11
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
12
|
+
|
|
11
13
|
view: function view(_view) {
|
|
12
14
|
return {};
|
|
13
15
|
},
|
|
14
16
|
state: {
|
|
17
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
15
18
|
init: function init(config, editorState) {
|
|
16
|
-
if (
|
|
19
|
+
if (expVal('cc_editor_limited_mode_include_lcm', 'isEnabled', true)) {
|
|
20
|
+
// calculates the size of the doc, where when there are legacy content macros, the content
|
|
21
|
+
// is stored in the attrs.
|
|
22
|
+
// This is essentiall doc.nod
|
|
23
|
+
var customDocSize = editorState.doc.nodeSize;
|
|
24
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
25
|
+
|
|
26
|
+
editorState.doc.descendants(function (node) {
|
|
27
|
+
var _node$attrs;
|
|
28
|
+
if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
|
|
29
|
+
var _node$attrs$parameter, _node$attrs2;
|
|
30
|
+
customDocSize += (_node$attrs$parameter = (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.parameters) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.adf) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.length) !== null && _node$attrs$parameter !== void 0 ? _node$attrs$parameter : 0;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
documentSizeBreachesThreshold: customDocSize > expVal('cc_editor_limited_mode', 'nodeSize', 100)
|
|
35
|
+
};
|
|
36
|
+
} else {
|
|
37
|
+
if (editorState.doc.nodeSize > expVal('cc_editor_limited_mode', 'nodeSize', 100)) {
|
|
38
|
+
return {
|
|
39
|
+
documentSizeBreachesThreshold: true
|
|
40
|
+
};
|
|
41
|
+
}
|
|
17
42
|
return {
|
|
18
|
-
documentSizeBreachesThreshold:
|
|
43
|
+
documentSizeBreachesThreshold: false
|
|
19
44
|
};
|
|
20
45
|
}
|
|
21
|
-
return {
|
|
22
|
-
documentSizeBreachesThreshold: false
|
|
23
|
-
};
|
|
24
46
|
},
|
|
47
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
48
|
+
|
|
25
49
|
apply: function apply(tr, currentPluginState) {
|
|
26
50
|
// Don't check the document size if we're already in limited mode.
|
|
27
51
|
// We ALWAYS want to re-check the document size if we're replacing the document (e.g. live-to-live page navigation).
|
|
28
52
|
if (currentPluginState.documentSizeBreachesThreshold && !tr.getMeta('replaceDocument')) {
|
|
29
53
|
return currentPluginState;
|
|
30
54
|
}
|
|
31
|
-
if (
|
|
55
|
+
if (expVal('cc_editor_limited_mode_include_lcm', 'isEnabled', true)) {
|
|
56
|
+
// calculates the size of the doc, where when there are legacy content macros, the content
|
|
57
|
+
// is stored in the attrs.
|
|
58
|
+
// This is essentiall doc.nod
|
|
59
|
+
var customDocSize = tr.doc.nodeSize;
|
|
60
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
61
|
+
|
|
62
|
+
tr.doc.descendants(function (node) {
|
|
63
|
+
var _node$attrs3;
|
|
64
|
+
if (((_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.extensionKey) === 'legacy-content') {
|
|
65
|
+
var _node$attrs$parameter2, _node$attrs4;
|
|
66
|
+
customDocSize += (_node$attrs$parameter2 = (_node$attrs4 = node.attrs) === null || _node$attrs4 === void 0 || (_node$attrs4 = _node$attrs4.parameters) === null || _node$attrs4 === void 0 || (_node$attrs4 = _node$attrs4.adf) === null || _node$attrs4 === void 0 ? void 0 : _node$attrs4.length) !== null && _node$attrs$parameter2 !== void 0 ? _node$attrs$parameter2 : 0;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
return {
|
|
70
|
+
documentSizeBreachesThreshold: customDocSize > expVal('cc_editor_limited_mode', 'nodeSize', 100)
|
|
71
|
+
};
|
|
72
|
+
} else {
|
|
73
|
+
if (tr.doc.nodeSize > expVal('cc_editor_limited_mode', 'nodeSize', 100)) {
|
|
74
|
+
return _objectSpread(_objectSpread({}, currentPluginState), {}, {
|
|
75
|
+
documentSizeBreachesThreshold: true
|
|
76
|
+
});
|
|
77
|
+
}
|
|
32
78
|
return _objectSpread(_objectSpread({}, currentPluginState), {}, {
|
|
33
|
-
documentSizeBreachesThreshold:
|
|
79
|
+
documentSizeBreachesThreshold: false
|
|
34
80
|
});
|
|
35
81
|
}
|
|
36
|
-
return _objectSpread(_objectSpread({}, currentPluginState), {}, {
|
|
37
|
-
documentSizeBreachesThreshold: false
|
|
38
|
-
});
|
|
39
82
|
}
|
|
40
83
|
}
|
|
41
84
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-limited-mode",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "LimitedMode plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
"atlaskit:src": "src/index.ts",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
32
|
-
"@atlaskit/primitives": "^16.
|
|
33
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
32
|
+
"@atlaskit/primitives": "^16.3.0",
|
|
33
|
+
"@atlaskit/tmp-editor-statsig": "^13.42.0",
|
|
34
34
|
"@babel/runtime": "^7.0.0",
|
|
35
35
|
"bind-event-listener": "^3.0.0",
|
|
36
36
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@atlaskit/editor-common": "^110.
|
|
39
|
+
"@atlaskit/editor-common": "^110.34.0",
|
|
40
40
|
"react": "^18.2.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../../tsconfig.entry-points.dev-agents.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "es5",
|
|
5
|
-
"outDir": "../../../../../dev-agents/tsDist/@atlaskit__editor-plugin-limited-mode/app",
|
|
6
|
-
"rootDir": "../",
|
|
7
|
-
"composite": true
|
|
8
|
-
},
|
|
9
|
-
"include": [
|
|
10
|
-
"../src/**/*.ts",
|
|
11
|
-
"../src/**/*.tsx"
|
|
12
|
-
],
|
|
13
|
-
"exclude": [
|
|
14
|
-
"../src/**/__tests__/*",
|
|
15
|
-
"../src/**/*.test.*",
|
|
16
|
-
"../src/**/test.*",
|
|
17
|
-
"../src/**/examples.*"
|
|
18
|
-
],
|
|
19
|
-
"references": [
|
|
20
|
-
{
|
|
21
|
-
"path": "../../../design-system/primitives/afm-dev-agents/tsconfig.json"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"path": "../../tmp-editor-statsig/afm-dev-agents/tsconfig.json"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"path": "../../editor-common/afm-dev-agents/tsconfig.json"
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../../tsconfig.entry-points.passionfruit.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "es5",
|
|
5
|
-
"outDir": "../../../../../passionfruit/tsDist/@atlaskit__editor-plugin-limited-mode/app",
|
|
6
|
-
"rootDir": "../",
|
|
7
|
-
"composite": true
|
|
8
|
-
},
|
|
9
|
-
"include": [
|
|
10
|
-
"../src/**/*.ts",
|
|
11
|
-
"../src/**/*.tsx"
|
|
12
|
-
],
|
|
13
|
-
"exclude": [
|
|
14
|
-
"../src/**/__tests__/*",
|
|
15
|
-
"../src/**/*.test.*",
|
|
16
|
-
"../src/**/test.*",
|
|
17
|
-
"../src/**/examples.*"
|
|
18
|
-
],
|
|
19
|
-
"references": [
|
|
20
|
-
{
|
|
21
|
-
"path": "../../../design-system/primitives/afm-passionfruit/tsconfig.json"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"path": "../../tmp-editor-statsig/afm-passionfruit/tsconfig.json"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"path": "../../editor-common/afm-passionfruit/tsconfig.json"
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../../tsconfig.entry-points.post-office.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "es5",
|
|
5
|
-
"outDir": "../../../../../post-office/tsDist/@atlaskit__editor-plugin-limited-mode/app",
|
|
6
|
-
"rootDir": "../",
|
|
7
|
-
"composite": true
|
|
8
|
-
},
|
|
9
|
-
"include": [
|
|
10
|
-
"../src/**/*.ts",
|
|
11
|
-
"../src/**/*.tsx"
|
|
12
|
-
],
|
|
13
|
-
"exclude": [
|
|
14
|
-
"../src/**/__tests__/*",
|
|
15
|
-
"../src/**/*.test.*",
|
|
16
|
-
"../src/**/test.*",
|
|
17
|
-
"../src/**/examples.*"
|
|
18
|
-
],
|
|
19
|
-
"references": [
|
|
20
|
-
{
|
|
21
|
-
"path": "../../../design-system/primitives/afm-post-office/tsconfig.json"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"path": "../../tmp-editor-statsig/afm-post-office/tsconfig.json"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"path": "../../editor-common/afm-post-office/tsconfig.json"
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../../tsconfig.entry-points.rovo-extension.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "es5",
|
|
5
|
-
"outDir": "../../../../../rovo-extension/tsDist/@atlaskit__editor-plugin-limited-mode/app",
|
|
6
|
-
"rootDir": "../",
|
|
7
|
-
"composite": true
|
|
8
|
-
},
|
|
9
|
-
"include": [
|
|
10
|
-
"../src/**/*.ts",
|
|
11
|
-
"../src/**/*.tsx"
|
|
12
|
-
],
|
|
13
|
-
"exclude": [
|
|
14
|
-
"../src/**/__tests__/*",
|
|
15
|
-
"../src/**/*.test.*",
|
|
16
|
-
"../src/**/test.*",
|
|
17
|
-
"../src/**/examples.*"
|
|
18
|
-
],
|
|
19
|
-
"references": [
|
|
20
|
-
{
|
|
21
|
-
"path": "../../../design-system/primitives/afm-rovo-extension/tsconfig.json"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"path": "../../tmp-editor-statsig/afm-rovo-extension/tsconfig.json"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"path": "../../editor-common/afm-rovo-extension/tsconfig.json"
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../../tsconfig.entry-points.townsquare.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "es5",
|
|
5
|
-
"outDir": "../../../../../townsquare/tsDist/@atlaskit__editor-plugin-limited-mode/app",
|
|
6
|
-
"rootDir": "../",
|
|
7
|
-
"composite": true
|
|
8
|
-
},
|
|
9
|
-
"include": [
|
|
10
|
-
"../src/**/*.ts",
|
|
11
|
-
"../src/**/*.tsx"
|
|
12
|
-
],
|
|
13
|
-
"exclude": [
|
|
14
|
-
"../src/**/__tests__/*",
|
|
15
|
-
"../src/**/*.test.*",
|
|
16
|
-
"../src/**/test.*",
|
|
17
|
-
"../src/**/examples.*"
|
|
18
|
-
],
|
|
19
|
-
"references": [
|
|
20
|
-
{
|
|
21
|
-
"path": "../../../design-system/primitives/afm-townsquare/tsconfig.json"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"path": "../../tmp-editor-statsig/afm-townsquare/tsconfig.json"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"path": "../../editor-common/afm-townsquare/tsconfig.json"
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
}
|