@atlaskit/editor-plugin-limited-mode 3.1.1 → 3.1.3

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-limited-mode
2
2
 
3
+ ## 3.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`55920a92e882a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/55920a92e882a) -
8
+ tsignores added for help-center local consumpton removed
9
+ - Updated dependencies
10
+
11
+ ## 3.1.2
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 3.1.1
4
18
 
5
19
  ### Patch Changes
@@ -54,6 +54,7 @@ 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
+ // @ts-expect-error - true is not allowed as a default value
57
58
  if (!((0, _expVal.expVal)('cc_editor_limited_mode', 'flagEnabled', true) === true)) {
58
59
  // Disable the flag behavior entirely if the flag is off
59
60
  return;
@@ -15,21 +15,17 @@ 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
-
20
18
  view: function view(_view) {
21
19
  return {};
22
20
  },
23
21
  state: {
24
- // @ts-ignore - Workaround for help-center local consumption
25
22
  init: function init(config, editorState) {
23
+ // @ts-expect-error - true is not allowed as a default value
26
24
  if ((0, _expVal.expVal)('cc_editor_limited_mode_include_lcm', 'isEnabled', true)) {
27
25
  // calculates the size of the doc, where when there are legacy content macros, the content
28
26
  // is stored in the attrs.
29
27
  // This is essentiall doc.nod
30
28
  var customDocSize = editorState.doc.nodeSize;
31
- // @ts-ignore - Workaround for help-center local consumption
32
-
33
29
  editorState.doc.descendants(function (node) {
34
30
  var _node$attrs;
35
31
  if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
@@ -51,21 +47,19 @@ var createPlugin = exports.createPlugin = function createPlugin() {
51
47
  };
52
48
  }
53
49
  },
54
- // @ts-ignore - Workaround for help-center local consumption
55
-
56
50
  apply: function apply(tr, currentPluginState) {
57
51
  // Don't check the document size if we're already in limited mode.
58
52
  // We ALWAYS want to re-check the document size if we're replacing the document (e.g. live-to-live page navigation).
59
53
  if (currentPluginState.documentSizeBreachesThreshold && !tr.getMeta('replaceDocument')) {
60
54
  return currentPluginState;
61
55
  }
56
+
57
+ // @ts-expect-error - true is not allowed as a default value
62
58
  if ((0, _expVal.expVal)('cc_editor_limited_mode_include_lcm', 'isEnabled', true)) {
63
59
  // calculates the size of the doc, where when there are legacy content macros, the content
64
60
  // is stored in the attrs.
65
61
  // This is essentiall doc.nod
66
62
  var customDocSize = tr.doc.nodeSize;
67
- // @ts-ignore - Workaround for help-center local consumption
68
-
69
63
  tr.doc.descendants(function (node) {
70
64
  var _node$attrs3;
71
65
  if (((_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.extensionKey) === 'legacy-content') {
@@ -48,6 +48,7 @@ export const limitedModePlugin = ({
48
48
  // eslint-disable-next-line react-hooks/exhaustive-deps
49
49
  }, [options.contentId]);
50
50
  const checkAndShowFlag = useCallback(isLimitedModeEnabled => {
51
+ // @ts-expect-error - true is not allowed as a default value
51
52
  if (!(expVal('cc_editor_limited_mode', 'flagEnabled', true) === true)) {
52
53
  // Disable the flag behavior entirely if the flag is off
53
54
  return;
@@ -5,22 +5,17 @@ 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
-
10
8
  view: _view => {
11
9
  return {};
12
10
  },
13
11
  state: {
14
- // @ts-ignore - Workaround for help-center local consumption
15
-
16
12
  init(config, editorState) {
13
+ // @ts-expect-error - true is not allowed as a default value
17
14
  if (expVal('cc_editor_limited_mode_include_lcm', 'isEnabled', true)) {
18
15
  // calculates the size of the doc, where when there are legacy content macros, the content
19
16
  // is stored in the attrs.
20
17
  // This is essentiall doc.nod
21
18
  let customDocSize = editorState.doc.nodeSize;
22
- // @ts-ignore - Workaround for help-center local consumption
23
-
24
19
  editorState.doc.descendants(node => {
25
20
  var _node$attrs;
26
21
  if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
@@ -42,21 +37,19 @@ export const createPlugin = () => {
42
37
  };
43
38
  }
44
39
  },
45
- // @ts-ignore - Workaround for help-center local consumption
46
-
47
40
  apply: (tr, currentPluginState) => {
48
41
  // Don't check the document size if we're already in limited mode.
49
42
  // We ALWAYS want to re-check the document size if we're replacing the document (e.g. live-to-live page navigation).
50
43
  if (currentPluginState.documentSizeBreachesThreshold && !tr.getMeta('replaceDocument')) {
51
44
  return currentPluginState;
52
45
  }
46
+
47
+ // @ts-expect-error - true is not allowed as a default value
53
48
  if (expVal('cc_editor_limited_mode_include_lcm', 'isEnabled', true)) {
54
49
  // calculates the size of the doc, where when there are legacy content macros, the content
55
50
  // is stored in the attrs.
56
51
  // This is essentiall doc.nod
57
52
  let customDocSize = tr.doc.nodeSize;
58
- // @ts-ignore - Workaround for help-center local consumption
59
-
60
53
  tr.doc.descendants(node => {
61
54
  var _node$attrs3;
62
55
  if (((_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.extensionKey) === 'legacy-content') {
@@ -46,6 +46,7 @@ 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
+ // @ts-expect-error - true is not allowed as a default value
49
50
  if (!(expVal('cc_editor_limited_mode', 'flagEnabled', true) === true)) {
50
51
  // Disable the flag behavior entirely if the flag is off
51
52
  return;
@@ -8,21 +8,17 @@ 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
-
13
11
  view: function view(_view) {
14
12
  return {};
15
13
  },
16
14
  state: {
17
- // @ts-ignore - Workaround for help-center local consumption
18
15
  init: function init(config, editorState) {
16
+ // @ts-expect-error - true is not allowed as a default value
19
17
  if (expVal('cc_editor_limited_mode_include_lcm', 'isEnabled', true)) {
20
18
  // calculates the size of the doc, where when there are legacy content macros, the content
21
19
  // is stored in the attrs.
22
20
  // This is essentiall doc.nod
23
21
  var customDocSize = editorState.doc.nodeSize;
24
- // @ts-ignore - Workaround for help-center local consumption
25
-
26
22
  editorState.doc.descendants(function (node) {
27
23
  var _node$attrs;
28
24
  if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
@@ -44,21 +40,19 @@ export var createPlugin = function createPlugin() {
44
40
  };
45
41
  }
46
42
  },
47
- // @ts-ignore - Workaround for help-center local consumption
48
-
49
43
  apply: function apply(tr, currentPluginState) {
50
44
  // Don't check the document size if we're already in limited mode.
51
45
  // We ALWAYS want to re-check the document size if we're replacing the document (e.g. live-to-live page navigation).
52
46
  if (currentPluginState.documentSizeBreachesThreshold && !tr.getMeta('replaceDocument')) {
53
47
  return currentPluginState;
54
48
  }
49
+
50
+ // @ts-expect-error - true is not allowed as a default value
55
51
  if (expVal('cc_editor_limited_mode_include_lcm', 'isEnabled', true)) {
56
52
  // calculates the size of the doc, where when there are legacy content macros, the content
57
53
  // is stored in the attrs.
58
54
  // This is essentiall doc.nod
59
55
  var customDocSize = tr.doc.nodeSize;
60
- // @ts-ignore - Workaround for help-center local consumption
61
-
62
56
  tr.doc.descendants(function (node) {
63
57
  var _node$attrs3;
64
58
  if (((_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.extensionKey) === 'legacy-content') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-limited-mode",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
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.3.0",
33
- "@atlaskit/tmp-editor-statsig": "^13.42.0",
32
+ "@atlaskit/primitives": "^16.4.0",
33
+ "@atlaskit/tmp-editor-statsig": "^14.2.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.34.0",
39
+ "@atlaskit/editor-common": "^110.36.0",
40
40
  "react": "^18.2.0"
41
41
  },
42
42
  "devDependencies": {