@atlaskit/editor-plugin-synced-block 10.2.4 → 10.2.5

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/editor-plugin-synced-block
2
2
 
3
+ ## 10.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`12355710b809c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/12355710b809c) -
8
+ Add the `platform_editor_sync_block_activation` boolean experiment API to
9
+ `@atlaskit/tmp-editor-statsig` for Confluence sync block activation checks. Consumers can gate
10
+ sync block activation behavior with
11
+ `expValEquals('platform_editor_sync_block_activation', 'isEnabled', true)`, for example to keep
12
+ source synced block placeholders visible only while the activation experiment is enabled.
13
+
14
+ Decoration-based placeholders now remain visible for empty source synced blocks while activation
15
+ is enabled.
16
+
17
+ The bodied synced block source nodeview now keeps its existing SSR streaming label-container fix
18
+ and only applies the non-SSR separate label container behavior when
19
+ `platform_synced_block_patch_14` is enabled.
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 10.2.4
4
24
 
5
25
  ### Patch Changes
@@ -18,6 +18,8 @@ var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/rea
18
18
  var _syncBlock = require("@atlaskit/editor-common/sync-block");
19
19
  var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
20
20
  var _model = require("@atlaskit/editor-prosemirror/model");
21
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
22
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
21
23
  var _BodiedSyncBlockWrapper = require("../ui/BodiedSyncBlockWrapper");
22
24
  var _SyncBlockLabel = require("../ui/SyncBlockLabel");
23
25
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
@@ -190,12 +192,17 @@ var BodiedSyncBlock = exports.BodiedSyncBlock = /*#__PURE__*/function () {
190
192
  this.dom = dom;
191
193
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
192
194
  this.contentDOM = contentDOM;
193
-
194
- // During SSR, the portal's renderToStaticMarkup + innerHTML clobbers
195
- // contentDOM. Render the label into a separate container to prevent this.
196
- // On client, render directly into this.dom as before.
197
195
  var labelContainer;
198
196
  if ((0, _coreUtils.isSSR)() && (0, _coreUtils.isSSRStreaming)()) {
197
+ // During SSR, the portal's renderToStaticMarkup + innerHTML clobbers
198
+ // contentDOM. Render the label into a separate container to prevent this.
199
+ // eslint-disable-next-line @atlaskit/platform/no-direct-document-usage -- NodeView DOM must be created against active runtime document
200
+ labelContainer = document.createElement('div');
201
+ this.dom.appendChild(labelContainer);
202
+ } else if ((0, _platformFeatureFlags.fg)('platform_synced_block_patch_14') || (0, _expValEquals.expValEquals)('platform_editor_sync_block_activation', 'isEnabled', true)) {
203
+ // Render the label into a separate container for the activation experience so
204
+ // portal implementations that write directly into the target do not clobber
205
+ // the ProseMirror contentDOM.
199
206
  // eslint-disable-next-line @atlaskit/platform/no-direct-document-usage -- NodeView DOM must be created against active runtime document
200
207
  labelContainer = document.createElement('div');
201
208
  this.dom.appendChild(labelContainer);
@@ -6,6 +6,8 @@ import ReactNodeView from '@atlaskit/editor-common/react-node-view';
6
6
  import { BodiedSyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
7
7
  import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
8
8
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
10
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
11
  import { BodiedSyncBlockWrapper } from '../ui/BodiedSyncBlockWrapper';
10
12
  import { SyncBlockLabel } from '../ui/SyncBlockLabel';
11
13
  const toDOMOld = () => ['div', {
@@ -155,12 +157,17 @@ export class BodiedSyncBlock {
155
157
  this.dom = dom;
156
158
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
157
159
  this.contentDOM = contentDOM;
158
-
159
- // During SSR, the portal's renderToStaticMarkup + innerHTML clobbers
160
- // contentDOM. Render the label into a separate container to prevent this.
161
- // On client, render directly into this.dom as before.
162
160
  let labelContainer;
163
161
  if (isSSR() && isSSRStreaming()) {
162
+ // During SSR, the portal's renderToStaticMarkup + innerHTML clobbers
163
+ // contentDOM. Render the label into a separate container to prevent this.
164
+ // eslint-disable-next-line @atlaskit/platform/no-direct-document-usage -- NodeView DOM must be created against active runtime document
165
+ labelContainer = document.createElement('div');
166
+ this.dom.appendChild(labelContainer);
167
+ } else if (fg('platform_synced_block_patch_14') || expValEquals('platform_editor_sync_block_activation', 'isEnabled', true)) {
168
+ // Render the label into a separate container for the activation experience so
169
+ // portal implementations that write directly into the target do not clobber
170
+ // the ProseMirror contentDOM.
164
171
  // eslint-disable-next-line @atlaskit/platform/no-direct-document-usage -- NodeView DOM must be created against active runtime document
165
172
  labelContainer = document.createElement('div');
166
173
  this.dom.appendChild(labelContainer);
@@ -13,6 +13,8 @@ import ReactNodeView from '@atlaskit/editor-common/react-node-view';
13
13
  import { BodiedSyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
14
14
  import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
15
15
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
16
+ import { fg } from '@atlaskit/platform-feature-flags';
17
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
16
18
  import { BodiedSyncBlockWrapper } from '../ui/BodiedSyncBlockWrapper';
17
19
  import { SyncBlockLabel } from '../ui/SyncBlockLabel';
18
20
  var toDOMOld = function toDOMOld() {
@@ -183,12 +185,17 @@ export var BodiedSyncBlock = /*#__PURE__*/function () {
183
185
  this.dom = dom;
184
186
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
185
187
  this.contentDOM = contentDOM;
186
-
187
- // During SSR, the portal's renderToStaticMarkup + innerHTML clobbers
188
- // contentDOM. Render the label into a separate container to prevent this.
189
- // On client, render directly into this.dom as before.
190
188
  var labelContainer;
191
189
  if (isSSR() && isSSRStreaming()) {
190
+ // During SSR, the portal's renderToStaticMarkup + innerHTML clobbers
191
+ // contentDOM. Render the label into a separate container to prevent this.
192
+ // eslint-disable-next-line @atlaskit/platform/no-direct-document-usage -- NodeView DOM must be created against active runtime document
193
+ labelContainer = document.createElement('div');
194
+ this.dom.appendChild(labelContainer);
195
+ } else if (fg('platform_synced_block_patch_14') || expValEquals('platform_editor_sync_block_activation', 'isEnabled', true)) {
196
+ // Render the label into a separate container for the activation experience so
197
+ // portal implementations that write directly into the target do not clobber
198
+ // the ProseMirror contentDOM.
192
199
  // eslint-disable-next-line @atlaskit/platform/no-direct-document-usage -- NodeView DOM must be created against active runtime document
193
200
  labelContainer = document.createElement('div');
194
201
  this.dom.appendChild(labelContainer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-synced-block",
3
- "version": "10.2.4",
3
+ "version": "10.2.5",
4
4
  "description": "SyncedBlock plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -21,7 +21,7 @@
21
21
  "atlaskit:src": "src/index.ts",
22
22
  "dependencies": {
23
23
  "@atlaskit/adf-schema": "^56.1.0",
24
- "@atlaskit/button": "24.3.1",
24
+ "@atlaskit/button": "24.3.2",
25
25
  "@atlaskit/dropdown-menu": "17.1.2",
26
26
  "@atlaskit/editor-json-transformer": "^9.0.0",
27
27
  "@atlaskit/editor-plugin-analytics": "^12.0.0",
@@ -46,7 +46,7 @@
46
46
  "@atlaskit/platform-feature-flags": "^2.0.0",
47
47
  "@atlaskit/primitives": "^20.6.0",
48
48
  "@atlaskit/spinner": "20.1.0",
49
- "@atlaskit/tmp-editor-statsig": "^124.1.0",
49
+ "@atlaskit/tmp-editor-statsig": "^124.2.0",
50
50
  "@atlaskit/tokens": "15.6.1",
51
51
  "@atlaskit/tooltip": "^23.1.0",
52
52
  "@atlaskit/visually-hidden": "^4.1.0",