@atlaskit/editor-plugin-media 18.1.11 → 19.1.0

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.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`aec3fcfe13ff9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aec3fcfe13ff9) -
8
+ EDITOR-8303 Add runtime input-latency trigger for limited mode behind
9
+ platform_editor_dynamic_limited_mode. Limited mode can now latch mid-session when sustained slow
10
+ input or repeated browser freezes indicate the device is struggling, in addition to the existing
11
+ document-size decision. The latch is one-way. Nothing is constructed when the experiment is off.
12
+
13
+ How much evidence is needed is a single tunable, `requiredConfirmations`: that many qualifying
14
+ windows, each separated from the last by `confirmationGapMs`. The hardware no longer feeds into
15
+ the decision — `navigator.hardwareConcurrency` and `navigator.deviceMemory` are reported with the
16
+ `limitedModeLatched` event instead, so which devices latch can be answered from the data rather
17
+ than assumed up front.
18
+
19
+ `LimitedModePluginState` gains a derived `enabled` flag, which is now the single thing consumers
20
+ should branch on — the individual reasons (`documentSizeBreachesThreshold`, `latchPolicyBreached`)
21
+ no longer need to be combined at each call site, so a future reason needs no change outside this
22
+ plugin. `sharedState.enabled` reads from it.
23
+
24
+ Under the experiment the document decision is also evaluated on load and on document replacement
25
+ only, rather than on every transaction that changes the document. That check walks the whole
26
+ document, so it was a full-document scan per keystroke on exactly the pages least able to afford
27
+ one. The trade-off is that a document editing its way past the thresholds is not re-judged until
28
+ it next loads.
29
+
30
+ Consumers updated to react to a mid-session change: table sticky headers now subscribe instead of
31
+ reading once at construction, block-controls resets rather than freezes its state on entry, and
32
+ the expand, media and table nodeviews read the derived flag so they no longer miss a runtime
33
+ latch.
34
+
35
+ ### Patch Changes
36
+
37
+ - Updated dependencies
38
+
39
+ ## 19.0.0
40
+
41
+ ### Patch Changes
42
+
43
+ - Updated dependencies
44
+
3
45
  ## 18.1.11
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": "18.1.11",
3
+ "version": "19.1.0",
4
4
  "description": "Media plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -21,27 +21,27 @@
21
21
  ],
22
22
  "atlaskit:src": "src/index.ts",
23
23
  "dependencies": {
24
- "@atlaskit/adf-schema": "^57.3.0",
24
+ "@atlaskit/adf-schema": "^57.4.0",
25
25
  "@atlaskit/analytics-namespaced-context": "^8.2.0",
26
26
  "@atlaskit/analytics-next": "^12.5.0",
27
27
  "@atlaskit/button": "^25.3.0",
28
28
  "@atlaskit/editor-palette": "^3.5.0",
29
- "@atlaskit/editor-plugin-analytics": "^16.1.0",
30
- "@atlaskit/editor-plugin-annotation": "^16.0.0",
31
- "@atlaskit/editor-plugin-connectivity": "^16.0.0",
32
- "@atlaskit/editor-plugin-decorations": "^16.1.0",
33
- "@atlaskit/editor-plugin-editor-disabled": "^16.1.0",
34
- "@atlaskit/editor-plugin-editor-viewmode": "^18.0.0",
35
- "@atlaskit/editor-plugin-floating-toolbar": "^18.1.0",
36
- "@atlaskit/editor-plugin-focus": "^15.1.0",
37
- "@atlaskit/editor-plugin-grid": "^16.1.0",
38
- "@atlaskit/editor-plugin-guideline": "^16.1.0",
39
- "@atlaskit/editor-plugin-interaction": "^27.0.0",
40
- "@atlaskit/editor-plugin-limited-mode": "^13.0.0",
41
- "@atlaskit/editor-plugin-media-editing": "^10.0.0",
42
- "@atlaskit/editor-plugin-selection": "^16.1.0",
43
- "@atlaskit/editor-plugin-toolbar": "^13.0.0",
44
- "@atlaskit/editor-plugin-width": "^17.1.0",
29
+ "@atlaskit/editor-plugin-analytics": "^17.0.0",
30
+ "@atlaskit/editor-plugin-annotation": "^17.0.0",
31
+ "@atlaskit/editor-plugin-connectivity": "^17.0.0",
32
+ "@atlaskit/editor-plugin-decorations": "^17.0.0",
33
+ "@atlaskit/editor-plugin-editor-disabled": "^17.0.0",
34
+ "@atlaskit/editor-plugin-editor-viewmode": "^19.0.0",
35
+ "@atlaskit/editor-plugin-floating-toolbar": "^19.0.0",
36
+ "@atlaskit/editor-plugin-focus": "^16.0.0",
37
+ "@atlaskit/editor-plugin-grid": "^17.0.0",
38
+ "@atlaskit/editor-plugin-guideline": "^17.0.0",
39
+ "@atlaskit/editor-plugin-interaction": "^28.0.0",
40
+ "@atlaskit/editor-plugin-limited-mode": "^14.1.0",
41
+ "@atlaskit/editor-plugin-media-editing": "^11.0.0",
42
+ "@atlaskit/editor-plugin-selection": "^17.0.0",
43
+ "@atlaskit/editor-plugin-toolbar": "^14.0.0",
44
+ "@atlaskit/editor-plugin-width": "^18.0.0",
45
45
  "@atlaskit/editor-prosemirror": "^8.0.0",
46
46
  "@atlaskit/editor-shared-styles": "^4.1.0",
47
47
  "@atlaskit/editor-tables": "^3.1.0",
@@ -60,7 +60,7 @@
60
60
  "@atlaskit/platform-feature-flags": "^2.2.0",
61
61
  "@atlaskit/primitives": "^22.5.0",
62
62
  "@atlaskit/textfield": "^10.2.0",
63
- "@atlaskit/tmp-editor-statsig": "^178.0.0",
63
+ "@atlaskit/tmp-editor-statsig": "^179.0.0",
64
64
  "@atlaskit/tokens": "^16.11.0",
65
65
  "@atlaskit/tooltip": "^24.3.0",
66
66
  "@babel/runtime": "^7.0.0",
@@ -72,7 +72,7 @@
72
72
  "uuid": "^11.1.1"
73
73
  },
74
74
  "peerDependencies": {
75
- "@atlaskit/editor-common": "^120.16.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",