@atlaskit/renderer 128.10.6 → 128.11.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,25 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 128.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c4c9b75b91fe3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c4c9b75b91fe3) -
8
+ Removed feature flag `platform_editor_fix_wide_media_in_renderer`. The fix for wide media in
9
+ renderer (skipping width override for pixel-based resizing) is now the default behavior.
10
+ - Updated dependencies
11
+
12
+ ## 128.11.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [`65f1d80415ae8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/65f1d80415ae8) -
17
+ EDITOR-679 improve reliability of media provider
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 128.10.6
4
24
 
5
25
  ### Patch Changes
@@ -10,6 +10,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
  var _mediaClientReact = require("@atlaskit/media-client-react");
12
12
  var _providerFactory = require("@atlaskit/editor-common/provider-factory");
13
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
13
14
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
14
15
  var EditorMediaClientProvider = exports.EditorMediaClientProvider = function EditorMediaClientProvider(_ref) {
15
16
  var children = _ref.children,
@@ -18,13 +19,24 @@ var EditorMediaClientProvider = exports.EditorMediaClientProvider = function Edi
18
19
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
19
20
  mediaClientConfig = _useState2[0],
20
21
  setMediaClientConfig = _useState2[1];
22
+ var providerFactory = (0, _providerFactory.useProviderFactory)();
21
23
  var mediaProvider = (0, _providerFactory.useProviderLayout)('mediaProvider');
22
24
 
23
25
  /**
24
- * If a mediaClientConfig is provided then we will force
25
- * skip the mediaClient from context
26
+ * Whether this renderer has its own media provider and should never inherit
27
+ * the mediaClient from a parent renderer's context.
28
+ *
29
+ * We use providerFactory.hasProvider() rather and checking the mediaProvider
30
+ * state value, because useProviderLayout subscribes via useLayoutEffect —
31
+ * meaning mediaProvider state is always undefined on the first render, even
32
+ * if the ProviderFactory already has a provider registered. This would cause
33
+ * shouldSkipContext to be false on the first render, incorrectly allowing the
34
+ * inner renderer to inherit the outer renderer's MediaClientContext (which
35
+ * carries the wrong media token for this page).
36
+ *
37
+ * hasProvider() is synchronous and correct from render 1, closing that window.
26
38
  */
27
- var shouldSkipContext = Boolean((ssr === null || ssr === void 0 ? void 0 : ssr.config) || mediaProvider);
39
+ var shouldSkipContext = (0, _expValEquals.expValEquals)('platform_editor_media_reliability_enhancements', 'isEnabled', true) ? Boolean((ssr === null || ssr === void 0 ? void 0 : ssr.config) || providerFactory.hasProvider('mediaProvider') || mediaProvider) : Boolean((ssr === null || ssr === void 0 ? void 0 : ssr.config) || mediaProvider);
28
40
  var contextMediaClient = (0, _react.useContext)(_mediaClientReact.MediaClientContext);
29
41
 
30
42
  // MediaClientProvider currently requires a mediaClientConfig
@@ -51,7 +51,6 @@ function BreakoutSSRInlineScript(_ref) {
51
51
  function createBreakoutInlineScript(id, shouldSkipScript) {
52
52
  var flags = {
53
53
  platform_editor_fix_media_in_renderer: (0, _platformFeatureFlags.fg)('platform_editor_fix_media_in_renderer'),
54
- platform_editor_fix_wide_media_in_renderer: (0, _platformFeatureFlags.fg)('platform_editor_fix_wide_media_in_renderer'),
55
54
  platform_editor_renderer_extension_width_fix: (0, _expValEquals.expValEquals)('platform_editor_renderer_extension_width_fix', 'isEnabled', true)
56
55
  };
57
56
  return "(function(window){\nif(typeof window !== 'undefined' && window.__RENDERER_BYPASS_BREAKOUT_SSR__) { return; }\n".concat(breakoutInlineScriptContext, ";\n(").concat(applyBreakoutAfterSSR.toString(), ")(\"").concat(id, "\", breakoutConsts, ").concat(JSON.stringify(shouldSkipScript), ", ").concat(JSON.stringify(flags), ");\n})(window);\n");
@@ -195,12 +194,12 @@ function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript, fla
195
194
 
196
195
  // Pixel based resizing has width set in pixels based on its width attribute
197
196
  // Thus, no need to override width
198
- if (flags['platform_editor_fix_wide_media_in_renderer'] && isPixelBasedResizing) {
197
+ if (isPixelBasedResizing) {
199
198
  return;
200
199
  }
201
200
  if (WIDE_LAYOUT_MODES.includes(mode)) {
202
201
  card.style.width = '100%';
203
- } else if (width && (!isPixelBasedResizing || flags['platform_editor_fix_wide_media_in_renderer'])) {
202
+ } else if (width) {
204
203
  card.style.width = "".concat(width, "%");
205
204
  }
206
205
  };
@@ -71,7 +71,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
71
71
  var TABLE_INFO_TIMEOUT = 10000;
72
72
  var RENDER_EVENT_SAMPLE_RATE = 0.2;
73
73
  var packageName = "@atlaskit/renderer";
74
- var packageVersion = "128.10.5";
74
+ var packageVersion = "128.11.0";
75
75
  var setAsQueryContainerStyles = (0, _react2.css)({
76
76
  containerName: 'ak-renderer-wrapper',
77
77
  containerType: 'inline-size'
@@ -1,18 +1,30 @@
1
1
  import React, { useContext, useLayoutEffect, useMemo, useState } from 'react';
2
2
  import { MediaClientContext, getMediaClient } from '@atlaskit/media-client-react';
3
- import { useProviderLayout } from '@atlaskit/editor-common/provider-factory';
3
+ import { useProviderFactory, useProviderLayout } from '@atlaskit/editor-common/provider-factory';
4
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
5
  export const EditorMediaClientProvider = ({
5
6
  children,
6
7
  ssr
7
8
  }) => {
8
9
  const [mediaClientConfig, setMediaClientConfig] = useState();
10
+ const providerFactory = useProviderFactory();
9
11
  const mediaProvider = useProviderLayout('mediaProvider');
10
12
 
11
13
  /**
12
- * If a mediaClientConfig is provided then we will force
13
- * skip the mediaClient from context
14
+ * Whether this renderer has its own media provider and should never inherit
15
+ * the mediaClient from a parent renderer's context.
16
+ *
17
+ * We use providerFactory.hasProvider() rather and checking the mediaProvider
18
+ * state value, because useProviderLayout subscribes via useLayoutEffect —
19
+ * meaning mediaProvider state is always undefined on the first render, even
20
+ * if the ProviderFactory already has a provider registered. This would cause
21
+ * shouldSkipContext to be false on the first render, incorrectly allowing the
22
+ * inner renderer to inherit the outer renderer's MediaClientContext (which
23
+ * carries the wrong media token for this page).
24
+ *
25
+ * hasProvider() is synchronous and correct from render 1, closing that window.
14
26
  */
15
- const shouldSkipContext = Boolean((ssr === null || ssr === void 0 ? void 0 : ssr.config) || mediaProvider);
27
+ const shouldSkipContext = expValEquals('platform_editor_media_reliability_enhancements', 'isEnabled', true) ? Boolean((ssr === null || ssr === void 0 ? void 0 : ssr.config) || providerFactory.hasProvider('mediaProvider') || mediaProvider) : Boolean((ssr === null || ssr === void 0 ? void 0 : ssr.config) || mediaProvider);
16
28
  const contextMediaClient = useContext(MediaClientContext);
17
29
 
18
30
  // MediaClientProvider currently requires a mediaClientConfig
@@ -43,7 +43,6 @@ export function BreakoutSSRInlineScript({
43
43
  export function createBreakoutInlineScript(id, shouldSkipScript) {
44
44
  const flags = {
45
45
  platform_editor_fix_media_in_renderer: fg('platform_editor_fix_media_in_renderer'),
46
- platform_editor_fix_wide_media_in_renderer: fg('platform_editor_fix_wide_media_in_renderer'),
47
46
  platform_editor_renderer_extension_width_fix: expValEquals('platform_editor_renderer_extension_width_fix', 'isEnabled', true)
48
47
  };
49
48
  return `(function(window){
@@ -198,12 +197,12 @@ function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript, fla
198
197
 
199
198
  // Pixel based resizing has width set in pixels based on its width attribute
200
199
  // Thus, no need to override width
201
- if (flags['platform_editor_fix_wide_media_in_renderer'] && isPixelBasedResizing) {
200
+ if (isPixelBasedResizing) {
202
201
  return;
203
202
  }
204
203
  if (WIDE_LAYOUT_MODES.includes(mode)) {
205
204
  card.style.width = '100%';
206
- } else if (width && (!isPixelBasedResizing || flags['platform_editor_fix_wide_media_in_renderer'])) {
205
+ } else if (width) {
207
206
  card.style.width = `${width}%`;
208
207
  }
209
208
  };
@@ -57,7 +57,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
57
57
  const TABLE_INFO_TIMEOUT = 10000;
58
58
  const RENDER_EVENT_SAMPLE_RATE = 0.2;
59
59
  const packageName = "@atlaskit/renderer";
60
- const packageVersion = "128.10.5";
60
+ const packageVersion = "128.11.0";
61
61
  const setAsQueryContainerStyles = css({
62
62
  containerName: 'ak-renderer-wrapper',
63
63
  containerType: 'inline-size'
@@ -1,7 +1,8 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import React, { useContext, useLayoutEffect, useMemo, useState } from 'react';
3
3
  import { MediaClientContext, getMediaClient } from '@atlaskit/media-client-react';
4
- import { useProviderLayout } from '@atlaskit/editor-common/provider-factory';
4
+ import { useProviderFactory, useProviderLayout } from '@atlaskit/editor-common/provider-factory';
5
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
6
  export var EditorMediaClientProvider = function EditorMediaClientProvider(_ref) {
6
7
  var children = _ref.children,
7
8
  ssr = _ref.ssr;
@@ -9,13 +10,24 @@ export var EditorMediaClientProvider = function EditorMediaClientProvider(_ref)
9
10
  _useState2 = _slicedToArray(_useState, 2),
10
11
  mediaClientConfig = _useState2[0],
11
12
  setMediaClientConfig = _useState2[1];
13
+ var providerFactory = useProviderFactory();
12
14
  var mediaProvider = useProviderLayout('mediaProvider');
13
15
 
14
16
  /**
15
- * If a mediaClientConfig is provided then we will force
16
- * skip the mediaClient from context
17
+ * Whether this renderer has its own media provider and should never inherit
18
+ * the mediaClient from a parent renderer's context.
19
+ *
20
+ * We use providerFactory.hasProvider() rather and checking the mediaProvider
21
+ * state value, because useProviderLayout subscribes via useLayoutEffect —
22
+ * meaning mediaProvider state is always undefined on the first render, even
23
+ * if the ProviderFactory already has a provider registered. This would cause
24
+ * shouldSkipContext to be false on the first render, incorrectly allowing the
25
+ * inner renderer to inherit the outer renderer's MediaClientContext (which
26
+ * carries the wrong media token for this page).
27
+ *
28
+ * hasProvider() is synchronous and correct from render 1, closing that window.
17
29
  */
18
- var shouldSkipContext = Boolean((ssr === null || ssr === void 0 ? void 0 : ssr.config) || mediaProvider);
30
+ var shouldSkipContext = expValEquals('platform_editor_media_reliability_enhancements', 'isEnabled', true) ? Boolean((ssr === null || ssr === void 0 ? void 0 : ssr.config) || providerFactory.hasProvider('mediaProvider') || mediaProvider) : Boolean((ssr === null || ssr === void 0 ? void 0 : ssr.config) || mediaProvider);
19
31
  var contextMediaClient = useContext(MediaClientContext);
20
32
 
21
33
  // MediaClientProvider currently requires a mediaClientConfig
@@ -42,7 +42,6 @@ export function BreakoutSSRInlineScript(_ref) {
42
42
  export function createBreakoutInlineScript(id, shouldSkipScript) {
43
43
  var flags = {
44
44
  platform_editor_fix_media_in_renderer: fg('platform_editor_fix_media_in_renderer'),
45
- platform_editor_fix_wide_media_in_renderer: fg('platform_editor_fix_wide_media_in_renderer'),
46
45
  platform_editor_renderer_extension_width_fix: expValEquals('platform_editor_renderer_extension_width_fix', 'isEnabled', true)
47
46
  };
48
47
  return "(function(window){\nif(typeof window !== 'undefined' && window.__RENDERER_BYPASS_BREAKOUT_SSR__) { return; }\n".concat(breakoutInlineScriptContext, ";\n(").concat(applyBreakoutAfterSSR.toString(), ")(\"").concat(id, "\", breakoutConsts, ").concat(JSON.stringify(shouldSkipScript), ", ").concat(JSON.stringify(flags), ");\n})(window);\n");
@@ -186,12 +185,12 @@ function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript, fla
186
185
 
187
186
  // Pixel based resizing has width set in pixels based on its width attribute
188
187
  // Thus, no need to override width
189
- if (flags['platform_editor_fix_wide_media_in_renderer'] && isPixelBasedResizing) {
188
+ if (isPixelBasedResizing) {
190
189
  return;
191
190
  }
192
191
  if (WIDE_LAYOUT_MODES.includes(mode)) {
193
192
  card.style.width = '100%';
194
- } else if (width && (!isPixelBasedResizing || flags['platform_editor_fix_wide_media_in_renderer'])) {
193
+ } else if (width) {
195
194
  card.style.width = "".concat(width, "%");
196
195
  }
197
196
  };
@@ -62,7 +62,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
62
62
  var TABLE_INFO_TIMEOUT = 10000;
63
63
  var RENDER_EVENT_SAMPLE_RATE = 0.2;
64
64
  var packageName = "@atlaskit/renderer";
65
- var packageVersion = "128.10.5";
65
+ var packageVersion = "128.11.0";
66
66
  var setAsQueryContainerStyles = css({
67
67
  containerName: 'ak-renderer-wrapper',
68
68
  containerType: 'inline-size'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "128.10.6",
3
+ "version": "128.11.1",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,7 +37,7 @@
37
37
  "@atlaskit/editor-prosemirror": "^7.3.0",
38
38
  "@atlaskit/editor-shared-styles": "^3.10.0",
39
39
  "@atlaskit/editor-smart-link-draggable": "^0.5.0",
40
- "@atlaskit/emoji": "^69.12.0",
40
+ "@atlaskit/emoji": "^70.0.0",
41
41
  "@atlaskit/feature-gate-js-client": "^5.5.0",
42
42
  "@atlaskit/icon": "^34.1.0",
43
43
  "@atlaskit/link": "^3.4.0",
@@ -56,10 +56,10 @@
56
56
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
57
57
  "@atlaskit/react-ufo": "^5.13.0",
58
58
  "@atlaskit/smart-card": "^44.0.0",
59
- "@atlaskit/status": "^3.2.0",
60
- "@atlaskit/task-decision": "^19.3.0",
59
+ "@atlaskit/status": "^4.0.0",
60
+ "@atlaskit/task-decision": "^20.0.0",
61
61
  "@atlaskit/theme": "^23.0.0",
62
- "@atlaskit/tmp-editor-statsig": "^62.1.0",
62
+ "@atlaskit/tmp-editor-statsig": "^62.2.0",
63
63
  "@atlaskit/tokens": "^13.0.0",
64
64
  "@atlaskit/tooltip": "^21.1.0",
65
65
  "@atlaskit/visually-hidden": "^3.0.0",
@@ -89,7 +89,7 @@
89
89
  "@atlaskit/media-core": "^37.0.0",
90
90
  "@atlaskit/media-integration-test-helpers": "workspace:^",
91
91
  "@atlaskit/media-test-helpers": "^40.0.0",
92
- "@atlaskit/mention": "^24.6.0",
92
+ "@atlaskit/mention": "^25.0.0",
93
93
  "@atlaskit/modal-dialog": "^14.15.0",
94
94
  "@atlaskit/navigation-system": "^7.3.0",
95
95
  "@atlaskit/profilecard": "^24.49.0",
@@ -160,9 +160,6 @@
160
160
  "platform_editor_fix_media_in_renderer": {
161
161
  "type": "boolean"
162
162
  },
163
- "platform_editor_fix_wide_media_in_renderer": {
164
- "type": "boolean"
165
- },
166
163
  "platform_editor_content_mode_button_mvp": {
167
164
  "type": "boolean"
168
165
  },