@atlaskit/editor-plugin-media 19.0.0 → 19.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-media
2
2
 
3
+ ## 19.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 19.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
  ## 19.0.0
4
46
 
5
47
  ### Patch Changes
@@ -175,7 +175,9 @@ var MediaSingleNodeView = /*#__PURE__*/function (_ReactNodeView) {
175
175
  var api = this.reactComponentProps.pluginInjectionApi;
176
176
  // Read limited mode from `this.view.state` via the exposed plugin key, NOT `currentState().enabled`
177
177
  // (which reads a stale false during initial EditorView construction — see the table nodeView).
178
- var enabled = Boolean(api === null || api === void 0 || (_api$limitedMode = api.limitedMode) === null || _api$limitedMode === void 0 || (_api$limitedMode = _api$limitedMode.sharedState.currentState()) === null || _api$limitedMode === void 0 || (_api$limitedMode = _api$limitedMode.limitedModePluginKey) === null || _api$limitedMode === void 0 || (_api$limitedMode = _api$limitedMode.getState(this.view.state)) === null || _api$limitedMode === void 0 ? void 0 : _api$limitedMode.documentSizeBreachesThreshold);
178
+ //
179
+ // Reads the plugin's derived `enabled`, so this covers every reason limited mode can be on.
180
+ var enabled = Boolean(api === null || api === void 0 || (_api$limitedMode = api.limitedMode) === null || _api$limitedMode === void 0 || (_api$limitedMode = _api$limitedMode.sharedState.currentState()) === null || _api$limitedMode === void 0 || (_api$limitedMode = _api$limitedMode.limitedModePluginKey) === null || _api$limitedMode === void 0 || (_api$limitedMode = _api$limitedMode.getState(this.view.state)) === null || _api$limitedMode === void 0 ? void 0 : _api$limitedMode.enabled);
179
181
  (0, _contentVisibility.applyContentVisibility)(dom, enabled, function () {
180
182
  var _api$width, _widthState$lineLengt, _widthState$width;
181
183
  var widthState = api === null || api === void 0 || (_api$width = api.width) === null || _api$width === void 0 ? void 0 : _api$width.sharedState.currentState();
@@ -148,7 +148,9 @@ class MediaSingleNodeView extends ReactNodeView {
148
148
  const api = this.reactComponentProps.pluginInjectionApi;
149
149
  // Read limited mode from `this.view.state` via the exposed plugin key, NOT `currentState().enabled`
150
150
  // (which reads a stale false during initial EditorView construction — see the table nodeView).
151
- const enabled = Boolean(api === null || api === void 0 ? void 0 : (_api$limitedMode = api.limitedMode) === null || _api$limitedMode === void 0 ? void 0 : (_api$limitedMode$shar = _api$limitedMode.sharedState.currentState()) === null || _api$limitedMode$shar === void 0 ? void 0 : (_api$limitedMode$shar2 = _api$limitedMode$shar.limitedModePluginKey) === null || _api$limitedMode$shar2 === void 0 ? void 0 : (_api$limitedMode$shar3 = _api$limitedMode$shar2.getState(this.view.state)) === null || _api$limitedMode$shar3 === void 0 ? void 0 : _api$limitedMode$shar3.documentSizeBreachesThreshold);
151
+ //
152
+ // Reads the plugin's derived `enabled`, so this covers every reason limited mode can be on.
153
+ const enabled = Boolean(api === null || api === void 0 ? void 0 : (_api$limitedMode = api.limitedMode) === null || _api$limitedMode === void 0 ? void 0 : (_api$limitedMode$shar = _api$limitedMode.sharedState.currentState()) === null || _api$limitedMode$shar === void 0 ? void 0 : (_api$limitedMode$shar2 = _api$limitedMode$shar.limitedModePluginKey) === null || _api$limitedMode$shar2 === void 0 ? void 0 : (_api$limitedMode$shar3 = _api$limitedMode$shar2.getState(this.view.state)) === null || _api$limitedMode$shar3 === void 0 ? void 0 : _api$limitedMode$shar3.enabled);
152
154
  applyContentVisibility(dom, enabled, () => {
153
155
  var _api$width, _widthState$lineLengt, _widthState$width;
154
156
  const widthState = api === null || api === void 0 ? void 0 : (_api$width = api.width) === null || _api$width === void 0 ? void 0 : _api$width.sharedState.currentState();
@@ -171,7 +171,9 @@ var MediaSingleNodeView = /*#__PURE__*/function (_ReactNodeView) {
171
171
  var api = this.reactComponentProps.pluginInjectionApi;
172
172
  // Read limited mode from `this.view.state` via the exposed plugin key, NOT `currentState().enabled`
173
173
  // (which reads a stale false during initial EditorView construction — see the table nodeView).
174
- var enabled = Boolean(api === null || api === void 0 || (_api$limitedMode = api.limitedMode) === null || _api$limitedMode === void 0 || (_api$limitedMode = _api$limitedMode.sharedState.currentState()) === null || _api$limitedMode === void 0 || (_api$limitedMode = _api$limitedMode.limitedModePluginKey) === null || _api$limitedMode === void 0 || (_api$limitedMode = _api$limitedMode.getState(this.view.state)) === null || _api$limitedMode === void 0 ? void 0 : _api$limitedMode.documentSizeBreachesThreshold);
174
+ //
175
+ // Reads the plugin's derived `enabled`, so this covers every reason limited mode can be on.
176
+ var enabled = Boolean(api === null || api === void 0 || (_api$limitedMode = api.limitedMode) === null || _api$limitedMode === void 0 || (_api$limitedMode = _api$limitedMode.sharedState.currentState()) === null || _api$limitedMode === void 0 || (_api$limitedMode = _api$limitedMode.limitedModePluginKey) === null || _api$limitedMode === void 0 || (_api$limitedMode = _api$limitedMode.getState(this.view.state)) === null || _api$limitedMode === void 0 ? void 0 : _api$limitedMode.enabled);
175
177
  applyContentVisibility(dom, enabled, function () {
176
178
  var _api$width, _widthState$lineLengt, _widthState$width;
177
179
  var widthState = api === null || api === void 0 || (_api$width = api.width) === null || _api$width === void 0 ? void 0 : _api$width.sharedState.currentState();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media",
3
- "version": "19.0.0",
3
+ "version": "19.1.1",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -37,7 +37,7 @@
37
37
  "@atlaskit/editor-plugin-grid": "^17.0.0",
38
38
  "@atlaskit/editor-plugin-guideline": "^17.0.0",
39
39
  "@atlaskit/editor-plugin-interaction": "^28.0.0",
40
- "@atlaskit/editor-plugin-limited-mode": "^14.0.0",
40
+ "@atlaskit/editor-plugin-limited-mode": "^14.1.0",
41
41
  "@atlaskit/editor-plugin-media-editing": "^11.0.0",
42
42
  "@atlaskit/editor-plugin-selection": "^17.0.0",
43
43
  "@atlaskit/editor-plugin-toolbar": "^14.0.0",
@@ -49,7 +49,7 @@
49
49
  "@atlaskit/icon": "^37.6.0",
50
50
  "@atlaskit/icon-lab": "^7.8.0",
51
51
  "@atlaskit/media-card": "^81.10.0",
52
- "@atlaskit/media-client": "^37.7.0",
52
+ "@atlaskit/media-client": "^38.0.0",
53
53
  "@atlaskit/media-client-react": "^6.4.0",
54
54
  "@atlaskit/media-common": "^14.6.0",
55
55
  "@atlaskit/media-filmstrip": "^52.4.0",
@@ -72,7 +72,7 @@
72
72
  "uuid": "^11.1.1"
73
73
  },
74
74
  "peerDependencies": {
75
- "@atlaskit/editor-common": "^121.0.0",
75
+ "@atlaskit/editor-common": "^121.1.0",
76
76
  "@atlaskit/media-core": "^38.2.0",
77
77
  "react": "^18.2.0 || ^19.2.0",
78
78
  "react-dom": "^18.2.0 || ^19.2.0",