@atlaskit/editor-plugin-expand 18.0.0 → 18.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 CHANGED
@@ -1,5 +1,47 @@
1
1
  # @atlaskit/editor-plugin-expand
2
2
 
3
+ ## 18.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 18.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`aec3fcfe13ff9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aec3fcfe13ff9) -
14
+ EDITOR-8303 Add runtime input-latency trigger for limited mode behind
15
+ platform_editor_dynamic_limited_mode. Limited mode can now latch mid-session when sustained slow
16
+ input or repeated browser freezes indicate the device is struggling, in addition to the existing
17
+ document-size decision. The latch is one-way. Nothing is constructed when the experiment is off.
18
+
19
+ How much evidence is needed is a single tunable, `requiredConfirmations`: that many qualifying
20
+ windows, each separated from the last by `confirmationGapMs`. The hardware no longer feeds into
21
+ the decision — `navigator.hardwareConcurrency` and `navigator.deviceMemory` are reported with the
22
+ `limitedModeLatched` event instead, so which devices latch can be answered from the data rather
23
+ than assumed up front.
24
+
25
+ `LimitedModePluginState` gains a derived `enabled` flag, which is now the single thing consumers
26
+ should branch on — the individual reasons (`documentSizeBreachesThreshold`, `latchPolicyBreached`)
27
+ no longer need to be combined at each call site, so a future reason needs no change outside this
28
+ plugin. `sharedState.enabled` reads from it.
29
+
30
+ Under the experiment the document decision is also evaluated on load and on document replacement
31
+ only, rather than on every transaction that changes the document. That check walks the whole
32
+ document, so it was a full-document scan per keystroke on exactly the pages least able to afford
33
+ one. The trade-off is that a document editing its way past the thresholds is not re-judged until
34
+ it next loads.
35
+
36
+ Consumers updated to react to a mid-session change: table sticky headers now subscribe instead of
37
+ reading once at construction, block-controls resets rather than freezes its state on entry, and
38
+ the expand, media and table nodeviews read the derived flag so they no longer miss a runtime
39
+ latch.
40
+
41
+ ### Patch Changes
42
+
43
+ - Updated dependencies
44
+
3
45
  ## 18.0.0
4
46
 
5
47
  ### Patch Changes
@@ -655,7 +655,9 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
655
655
  // Read from `this.view.state` via the exposed plugin key rather than the shared state's
656
656
  // `enabled`, which reads a stale `false` during initial EditorView construction (the injection
657
657
  // API's editor state isn't wired up yet).
658
- return Boolean((_this$api9 = this.api) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.limitedMode) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.sharedState.currentState()) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.limitedModePluginKey) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.getState(this.view.state)) === null || _this$api9 === void 0 ? void 0 : _this$api9.documentSizeBreachesThreshold);
658
+ //
659
+ // Reads the plugin's derived `enabled`, so this covers every reason limited mode can be on.
660
+ return Boolean((_this$api9 = this.api) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.limitedMode) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.sharedState.currentState()) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.limitedModePluginKey) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.getState(this.view.state)) === null || _this$api9 === void 0 ? void 0 : _this$api9.enabled);
659
661
  }
660
662
  }, {
661
663
  key: "stopEvent",
@@ -681,7 +681,9 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
681
681
  // Read from `this.view.state` via the exposed plugin key rather than the shared state's
682
682
  // `enabled`, which reads a stale `false` during initial EditorView construction (the injection
683
683
  // API's editor state isn't wired up yet).
684
- return Boolean((_this$api9 = this.api) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.limitedMode) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.sharedState.currentState()) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.limitedModePluginKey) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.getState(this.view.state)) === null || _this$api9 === void 0 ? void 0 : _this$api9.documentSizeBreachesThreshold);
684
+ //
685
+ // Reads the plugin's derived `enabled`, so this covers every reason limited mode can be on.
686
+ return Boolean((_this$api9 = this.api) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.limitedMode) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.sharedState.currentState()) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.limitedModePluginKey) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.getState(this.view.state)) === null || _this$api9 === void 0 ? void 0 : _this$api9.enabled);
685
687
  }
686
688
  }, {
687
689
  key: "updateDisplayStyle",
@@ -648,7 +648,9 @@ export class ExpandNodeView {
648
648
  // Read from `this.view.state` via the exposed plugin key rather than the shared state's
649
649
  // `enabled`, which reads a stale `false` during initial EditorView construction (the injection
650
650
  // API's editor state isn't wired up yet).
651
- return Boolean((_this$api9 = this.api) === null || _this$api9 === void 0 ? void 0 : (_this$api9$limitedMod = _this$api9.limitedMode) === null || _this$api9$limitedMod === void 0 ? void 0 : (_this$api9$limitedMod2 = _this$api9$limitedMod.sharedState.currentState()) === null || _this$api9$limitedMod2 === void 0 ? void 0 : (_this$api9$limitedMod3 = _this$api9$limitedMod2.limitedModePluginKey) === null || _this$api9$limitedMod3 === void 0 ? void 0 : (_this$api9$limitedMod4 = _this$api9$limitedMod3.getState(this.view.state)) === null || _this$api9$limitedMod4 === void 0 ? void 0 : _this$api9$limitedMod4.documentSizeBreachesThreshold);
651
+ //
652
+ // Reads the plugin's derived `enabled`, so this covers every reason limited mode can be on.
653
+ return Boolean((_this$api9 = this.api) === null || _this$api9 === void 0 ? void 0 : (_this$api9$limitedMod = _this$api9.limitedMode) === null || _this$api9$limitedMod === void 0 ? void 0 : (_this$api9$limitedMod2 = _this$api9$limitedMod.sharedState.currentState()) === null || _this$api9$limitedMod2 === void 0 ? void 0 : (_this$api9$limitedMod3 = _this$api9$limitedMod2.limitedModePluginKey) === null || _this$api9$limitedMod3 === void 0 ? void 0 : (_this$api9$limitedMod4 = _this$api9$limitedMod3.getState(this.view.state)) === null || _this$api9$limitedMod4 === void 0 ? void 0 : _this$api9$limitedMod4.enabled);
652
654
  }
653
655
  stopEvent(event) {
654
656
  // Ignored via go/ees005
@@ -668,7 +668,9 @@ export class ExpandNodeView {
668
668
  // Read from `this.view.state` via the exposed plugin key rather than the shared state's
669
669
  // `enabled`, which reads a stale `false` during initial EditorView construction (the injection
670
670
  // API's editor state isn't wired up yet).
671
- return Boolean((_this$api9 = this.api) === null || _this$api9 === void 0 ? void 0 : (_this$api9$limitedMod = _this$api9.limitedMode) === null || _this$api9$limitedMod === void 0 ? void 0 : (_this$api9$limitedMod2 = _this$api9$limitedMod.sharedState.currentState()) === null || _this$api9$limitedMod2 === void 0 ? void 0 : (_this$api9$limitedMod3 = _this$api9$limitedMod2.limitedModePluginKey) === null || _this$api9$limitedMod3 === void 0 ? void 0 : (_this$api9$limitedMod4 = _this$api9$limitedMod3.getState(this.view.state)) === null || _this$api9$limitedMod4 === void 0 ? void 0 : _this$api9$limitedMod4.documentSizeBreachesThreshold);
671
+ //
672
+ // Reads the plugin's derived `enabled`, so this covers every reason limited mode can be on.
673
+ return Boolean((_this$api9 = this.api) === null || _this$api9 === void 0 ? void 0 : (_this$api9$limitedMod = _this$api9.limitedMode) === null || _this$api9$limitedMod === void 0 ? void 0 : (_this$api9$limitedMod2 = _this$api9$limitedMod.sharedState.currentState()) === null || _this$api9$limitedMod2 === void 0 ? void 0 : (_this$api9$limitedMod3 = _this$api9$limitedMod2.limitedModePluginKey) === null || _this$api9$limitedMod3 === void 0 ? void 0 : (_this$api9$limitedMod4 = _this$api9$limitedMod3.getState(this.view.state)) === null || _this$api9$limitedMod4 === void 0 ? void 0 : _this$api9$limitedMod4.enabled);
672
674
  }
673
675
  updateDisplayStyle(node) {
674
676
  if (this.content) {
@@ -648,7 +648,9 @@ export var ExpandNodeView = /*#__PURE__*/function () {
648
648
  // Read from `this.view.state` via the exposed plugin key rather than the shared state's
649
649
  // `enabled`, which reads a stale `false` during initial EditorView construction (the injection
650
650
  // API's editor state isn't wired up yet).
651
- return Boolean((_this$api9 = this.api) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.limitedMode) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.sharedState.currentState()) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.limitedModePluginKey) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.getState(this.view.state)) === null || _this$api9 === void 0 ? void 0 : _this$api9.documentSizeBreachesThreshold);
651
+ //
652
+ // Reads the plugin's derived `enabled`, so this covers every reason limited mode can be on.
653
+ return Boolean((_this$api9 = this.api) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.limitedMode) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.sharedState.currentState()) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.limitedModePluginKey) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.getState(this.view.state)) === null || _this$api9 === void 0 ? void 0 : _this$api9.enabled);
652
654
  }
653
655
  }, {
654
656
  key: "stopEvent",
@@ -673,7 +673,9 @@ export var ExpandNodeView = /*#__PURE__*/function () {
673
673
  // Read from `this.view.state` via the exposed plugin key rather than the shared state's
674
674
  // `enabled`, which reads a stale `false` during initial EditorView construction (the injection
675
675
  // API's editor state isn't wired up yet).
676
- return Boolean((_this$api9 = this.api) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.limitedMode) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.sharedState.currentState()) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.limitedModePluginKey) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.getState(this.view.state)) === null || _this$api9 === void 0 ? void 0 : _this$api9.documentSizeBreachesThreshold);
676
+ //
677
+ // Reads the plugin's derived `enabled`, so this covers every reason limited mode can be on.
678
+ return Boolean((_this$api9 = this.api) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.limitedMode) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.sharedState.currentState()) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.limitedModePluginKey) === null || _this$api9 === void 0 || (_this$api9 = _this$api9.getState(this.view.state)) === null || _this$api9 === void 0 ? void 0 : _this$api9.enabled);
677
679
  }
678
680
  }, {
679
681
  key: "updateDisplayStyle",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-expand",
3
- "version": "18.0.0",
3
+ "version": "18.1.1",
4
4
  "description": "Expand plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -24,12 +24,12 @@
24
24
  "@atlaskit/adf-schema": "^57.4.0",
25
25
  "@atlaskit/button": "^25.3.0",
26
26
  "@atlaskit/editor-plugin-analytics": "^17.0.0",
27
- "@atlaskit/editor-plugin-block-controls": "^18.0.0",
27
+ "@atlaskit/editor-plugin-block-controls": "^18.2.0",
28
28
  "@atlaskit/editor-plugin-block-menu": "^16.0.0",
29
29
  "@atlaskit/editor-plugin-decorations": "^17.0.0",
30
30
  "@atlaskit/editor-plugin-editor-disabled": "^17.0.0",
31
31
  "@atlaskit/editor-plugin-editor-viewmode": "^19.0.0",
32
- "@atlaskit/editor-plugin-limited-mode": "^14.0.0",
32
+ "@atlaskit/editor-plugin-limited-mode": "^14.1.0",
33
33
  "@atlaskit/editor-plugin-local-id": "^15.0.0",
34
34
  "@atlaskit/editor-plugin-selection": "^17.0.0",
35
35
  "@atlaskit/editor-plugin-selection-marker": "^17.0.0",
@@ -43,7 +43,7 @@
43
43
  "@atlaskit/platform-feature-experiments": "^0.3.0",
44
44
  "@atlaskit/platform-feature-flags": "^2.2.0",
45
45
  "@atlaskit/prosemirror-history": "^1.2.0",
46
- "@atlaskit/tmp-editor-statsig": "^179.0.0",
46
+ "@atlaskit/tmp-editor-statsig": "^180.0.0",
47
47
  "@atlaskit/tokens": "^16.11.0",
48
48
  "@atlaskit/tooltip": "^24.3.0",
49
49
  "@babel/runtime": "^7.0.0",
@@ -52,7 +52,7 @@
52
52
  "w3c-keyname": "^2.1.8"
53
53
  },
54
54
  "peerDependencies": {
55
- "@atlaskit/editor-common": "^121.0.0",
55
+ "@atlaskit/editor-common": "^121.1.0",
56
56
  "react": "^18.2.0 || ^19.2.0",
57
57
  "react-dom": "^18.2.0 || ^19.2.0",
58
58
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"