@atlaskit/editor-plugin-media 19.0.0 → 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,41 @@
|
|
|
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
|
+
|
|
3
39
|
## 19.0.0
|
|
4
40
|
|
|
5
41
|
### 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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",
|
|
@@ -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.
|
|
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",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"uuid": "^11.1.1"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@atlaskit/editor-common": "^121.
|
|
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",
|