@atlaskit/editor-common 125.1.0 → 125.2.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,32 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 125.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a8919aeeabced`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a8919aeeabced) -
8
+ Remove the shipped `platform_editor_hydration_skip_react_portal` experiment and preserve SSR DOM
9
+ reuse. The experiment is no longer available in the Statsig configuration; consumers should remove
10
+ its overrides and checks.
11
+ - Updated dependencies
12
+
13
+ ## 125.2.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [`111eaadd44c1c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/111eaadd44c1c) -
18
+ EDITOR-8995: Make the editor find dialog usable in live view. The find dialog now accepts an
19
+ `allowReplace` prop, and hides the replace label, field, replacement count message, both replace
20
+ buttons and the horizontal rule when it is false. It also names the dialog "Find" instead of "Find
21
+ and Replace" in that state. The find plugin derives `allowReplace` from the `editorViewMode`
22
+ shared state, so view mode never offers replace. A new ProseMirror plugin opens the dialog on
23
+ `Mod-f` in view mode, where no keymap fires, behind the `platform_editor_collapsible_headings`
24
+ experiment. The `activated` analytics event gains an `editorViewMode` attribute.
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies
29
+
3
30
  ## 125.1.0
4
31
 
5
32
  ### Minor Changes
@@ -17,7 +17,6 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
17
17
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
18
18
  var _react = _interopRequireWildcard(require("react"));
19
19
  var _fg = require("@atlaskit/platform-feature-flags/fg");
20
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
21
20
  var _coreUtils = require("../core-utils");
22
21
  var _reactNodeView = _interopRequireDefault(require("../react-node-view"));
23
22
  var _Extension = require("./Extension");
@@ -140,7 +139,7 @@ var ExtensionNode = exports.ExtensionNode = /*#__PURE__*/function (_ReactNodeVie
140
139
  value: function createDomRef() {
141
140
  // SSR DOM reuse takes precedence over preset height — when eligible, adopt the
142
141
  // server-rendered element directly so React hydration is deferred until update().
143
- if (!(0, _coreUtils.isSSR)() && isSSRHydrationEligible(this.node) && this.isInInitialHydrationWindow() && (0, _expValEquals.expValEquals)('platform_editor_hydration_skip_react_portal', 'isEnabled', true)) {
142
+ if (!(0, _coreUtils.isSSR)() && isSSRHydrationEligible(this.node) && this.isInInitialHydrationWindow()) {
144
143
  var ssrElement = this.findSSRElement();
145
144
  if (ssrElement) {
146
145
  this.didReuseSsrDom = true;
@@ -211,22 +210,18 @@ var ExtensionNode = exports.ExtensionNode = /*#__PURE__*/function (_ReactNodeVie
211
210
  }, {
212
211
  key: "init",
213
212
  value: function init() {
214
- if (!(0, _expValEquals.expValEquals)('platform_editor_hydration_skip_react_portal', 'isEnabled', true)) {
215
- _superPropGet(ExtensionNode, "init", this, 3)([]);
216
- } else {
217
- var isEligibleForSsrReuse = !(0, _coreUtils.isSSR)() && isSSRHydrationEligible(this.node);
218
- if (isEligibleForSsrReuse && this.isInInitialHydrationWindow()) {
219
- var ssrElement = this.findSSRElement();
220
- var shouldSkipInitRender = ssrElement !== null;
221
- _superPropGet(ExtensionNode, "init", this, 3)([shouldSkipInitRender]);
222
- var identityKey = this.getHydrationIdentityKey();
223
- if (identityKey !== null) {
224
- // Close the hydration window — see {@link consumedHydrationIdentitiesByEditor}.
225
- markHydrationIdentityAsConsumed(this.view, identityKey);
226
- }
227
- } else {
228
- _superPropGet(ExtensionNode, "init", this, 3)([]);
213
+ var isEligibleForSsrReuse = !(0, _coreUtils.isSSR)() && isSSRHydrationEligible(this.node);
214
+ if (isEligibleForSsrReuse && this.isInInitialHydrationWindow()) {
215
+ var ssrElement = this.findSSRElement();
216
+ var shouldSkipInitRender = ssrElement !== null;
217
+ _superPropGet(ExtensionNode, "init", this, 3)([shouldSkipInitRender]);
218
+ var identityKey = this.getHydrationIdentityKey();
219
+ if (identityKey !== null) {
220
+ // Close the hydration window — see {@link consumedHydrationIdentitiesByEditor}.
221
+ markHydrationIdentityAsConsumed(this.view, identityKey);
229
222
  }
223
+ } else {
224
+ _superPropGet(ExtensionNode, "init", this, 3)([]);
230
225
  }
231
226
  return this;
232
227
  }
@@ -238,7 +233,7 @@ var ExtensionNode = exports.ExtensionNode = /*#__PURE__*/function (_ReactNodeVie
238
233
  };
239
234
  // Remove extensionNodeWrapper aka span.relative if we previously reused SSR DOM
240
235
  // control is back to React afterwards
241
- if (this.didReuseSsrDom && (0, _expValEquals.expValEquals)('platform_editor_hydration_skip_react_portal', 'isEnabled', true)) {
236
+ if (this.didReuseSsrDom) {
242
237
  var ssrElement = this.findSSRElement();
243
238
  if (ssrElement) {
244
239
  var extensionNodeWrapper = ssrElement.querySelector('[data-testid="extension-node-wrapper"]');
@@ -31,6 +31,11 @@ var findReplaceMessages = exports.findReplaceMessages = (0, _reactIntl.defineMes
31
31
  defaultMessage: 'Find and Replace',
32
32
  description: 'Aria label for the "Find and Replace" dialog'
33
33
  },
34
+ findDialogAriaLabel: {
35
+ id: 'fabric.editor.findDialogAriaLabel',
36
+ defaultMessage: 'Find',
37
+ description: 'Aria label for the "Find" dialog, used where the dialog offers find without replace'
38
+ },
34
39
  closeFindReplaceDialog: {
35
40
  id: 'fabric.editor.closeFindReplaceDialog',
36
41
  defaultMessage: 'Close',
@@ -27,7 +27,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
27
27
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
28
28
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
29
29
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
30
- var packageVersion = "125.0.0";
30
+ var packageVersion = "125.2.0";
31
31
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
32
32
  // Remove URL as it has UGC
33
33
  // Ignored via go/ees007
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "125.0.0";
27
+ var packageVersion = "125.2.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -1,7 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import React, { useCallback, useState } from 'react';
3
3
  import { fg } from '@atlaskit/platform-feature-flags/fg';
4
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
4
  import { isSSR } from '../core-utils';
6
5
  import ReactNodeView from '../react-node-view';
7
6
  import { Extension } from './Extension';
@@ -106,7 +105,7 @@ export class ExtensionNode extends ReactNodeView {
106
105
  createDomRef() {
107
106
  // SSR DOM reuse takes precedence over preset height — when eligible, adopt the
108
107
  // server-rendered element directly so React hydration is deferred until update().
109
- if (!isSSR() && isSSRHydrationEligible(this.node) && this.isInInitialHydrationWindow() && expValEquals('platform_editor_hydration_skip_react_portal', 'isEnabled', true)) {
108
+ if (!isSSR() && isSSRHydrationEligible(this.node) && this.isInInitialHydrationWindow()) {
110
109
  const ssrElement = this.findSSRElement();
111
110
  if (ssrElement) {
112
111
  this.didReuseSsrDom = true;
@@ -173,29 +172,25 @@ export class ExtensionNode extends ReactNodeView {
173
172
 
174
173
  /** Skip React Portal render on first init when reusing SSR DOM. See {@link consumedHydrationIdentitiesByEditor}. */
175
174
  init() {
176
- if (!expValEquals('platform_editor_hydration_skip_react_portal', 'isEnabled', true)) {
177
- super.init();
178
- } else {
179
- const isEligibleForSsrReuse = !isSSR() && isSSRHydrationEligible(this.node);
180
- if (isEligibleForSsrReuse && this.isInInitialHydrationWindow()) {
181
- const ssrElement = this.findSSRElement();
182
- const shouldSkipInitRender = ssrElement !== null;
183
- super.init(shouldSkipInitRender);
184
- const identityKey = this.getHydrationIdentityKey();
185
- if (identityKey !== null) {
186
- // Close the hydration window — see {@link consumedHydrationIdentitiesByEditor}.
187
- markHydrationIdentityAsConsumed(this.view, identityKey);
188
- }
189
- } else {
190
- super.init();
175
+ const isEligibleForSsrReuse = !isSSR() && isSSRHydrationEligible(this.node);
176
+ if (isEligibleForSsrReuse && this.isInInitialHydrationWindow()) {
177
+ const ssrElement = this.findSSRElement();
178
+ const shouldSkipInitRender = ssrElement !== null;
179
+ super.init(shouldSkipInitRender);
180
+ const identityKey = this.getHydrationIdentityKey();
181
+ if (identityKey !== null) {
182
+ // Close the hydration window — see {@link consumedHydrationIdentitiesByEditor}.
183
+ markHydrationIdentityAsConsumed(this.view, identityKey);
191
184
  }
185
+ } else {
186
+ super.init();
192
187
  }
193
188
  return this;
194
189
  }
195
190
  update(node, decorations, _innerDecorations, validUpdate = () => true) {
196
191
  // Remove extensionNodeWrapper aka span.relative if we previously reused SSR DOM
197
192
  // control is back to React afterwards
198
- if (this.didReuseSsrDom && expValEquals('platform_editor_hydration_skip_react_portal', 'isEnabled', true)) {
193
+ if (this.didReuseSsrDom) {
199
194
  const ssrElement = this.findSSRElement();
200
195
  if (ssrElement) {
201
196
  const extensionNodeWrapper = ssrElement.querySelector('[data-testid="extension-node-wrapper"]');
@@ -25,6 +25,11 @@ export const findReplaceMessages = defineMessages({
25
25
  defaultMessage: 'Find and Replace',
26
26
  description: 'Aria label for the "Find and Replace" dialog'
27
27
  },
28
+ findDialogAriaLabel: {
29
+ id: 'fabric.editor.findDialogAriaLabel',
30
+ defaultMessage: 'Find',
31
+ description: 'Aria label for the "Find" dialog, used where the dialog offers find without replace'
32
+ },
28
33
  closeFindReplaceDialog: {
29
34
  id: 'fabric.editor.closeFindReplaceDialog',
30
35
  defaultMessage: 'Close',
@@ -13,7 +13,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
13
13
  const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
14
14
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
15
15
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
16
- const packageVersion = "125.0.0";
16
+ const packageVersion = "125.2.0";
17
17
  const sanitiseSentryEvents = (data, _hint) => {
18
18
  // Remove URL as it has UGC
19
19
  // Ignored via go/ees007
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags/fg';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "125.0.0";
17
+ const packageVersion = "125.2.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -11,7 +11,6 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
11
11
  function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
12
12
  import React, { useCallback, useState } from 'react';
13
13
  import { fg } from '@atlaskit/platform-feature-flags/fg';
14
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
15
14
  import { isSSR } from '../core-utils';
16
15
  import ReactNodeView from '../react-node-view';
17
16
  import { Extension } from './Extension';
@@ -130,7 +129,7 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
130
129
  value: function createDomRef() {
131
130
  // SSR DOM reuse takes precedence over preset height — when eligible, adopt the
132
131
  // server-rendered element directly so React hydration is deferred until update().
133
- if (!isSSR() && isSSRHydrationEligible(this.node) && this.isInInitialHydrationWindow() && expValEquals('platform_editor_hydration_skip_react_portal', 'isEnabled', true)) {
132
+ if (!isSSR() && isSSRHydrationEligible(this.node) && this.isInInitialHydrationWindow()) {
134
133
  var ssrElement = this.findSSRElement();
135
134
  if (ssrElement) {
136
135
  this.didReuseSsrDom = true;
@@ -201,22 +200,18 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
201
200
  }, {
202
201
  key: "init",
203
202
  value: function init() {
204
- if (!expValEquals('platform_editor_hydration_skip_react_portal', 'isEnabled', true)) {
205
- _superPropGet(ExtensionNode, "init", this, 3)([]);
206
- } else {
207
- var isEligibleForSsrReuse = !isSSR() && isSSRHydrationEligible(this.node);
208
- if (isEligibleForSsrReuse && this.isInInitialHydrationWindow()) {
209
- var ssrElement = this.findSSRElement();
210
- var shouldSkipInitRender = ssrElement !== null;
211
- _superPropGet(ExtensionNode, "init", this, 3)([shouldSkipInitRender]);
212
- var identityKey = this.getHydrationIdentityKey();
213
- if (identityKey !== null) {
214
- // Close the hydration window — see {@link consumedHydrationIdentitiesByEditor}.
215
- markHydrationIdentityAsConsumed(this.view, identityKey);
216
- }
217
- } else {
218
- _superPropGet(ExtensionNode, "init", this, 3)([]);
203
+ var isEligibleForSsrReuse = !isSSR() && isSSRHydrationEligible(this.node);
204
+ if (isEligibleForSsrReuse && this.isInInitialHydrationWindow()) {
205
+ var ssrElement = this.findSSRElement();
206
+ var shouldSkipInitRender = ssrElement !== null;
207
+ _superPropGet(ExtensionNode, "init", this, 3)([shouldSkipInitRender]);
208
+ var identityKey = this.getHydrationIdentityKey();
209
+ if (identityKey !== null) {
210
+ // Close the hydration window — see {@link consumedHydrationIdentitiesByEditor}.
211
+ markHydrationIdentityAsConsumed(this.view, identityKey);
219
212
  }
213
+ } else {
214
+ _superPropGet(ExtensionNode, "init", this, 3)([]);
220
215
  }
221
216
  return this;
222
217
  }
@@ -228,7 +223,7 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
228
223
  };
229
224
  // Remove extensionNodeWrapper aka span.relative if we previously reused SSR DOM
230
225
  // control is back to React afterwards
231
- if (this.didReuseSsrDom && expValEquals('platform_editor_hydration_skip_react_portal', 'isEnabled', true)) {
226
+ if (this.didReuseSsrDom) {
232
227
  var ssrElement = this.findSSRElement();
233
228
  if (ssrElement) {
234
229
  var extensionNodeWrapper = ssrElement.querySelector('[data-testid="extension-node-wrapper"]');
@@ -25,6 +25,11 @@ export var findReplaceMessages = defineMessages({
25
25
  defaultMessage: 'Find and Replace',
26
26
  description: 'Aria label for the "Find and Replace" dialog'
27
27
  },
28
+ findDialogAriaLabel: {
29
+ id: 'fabric.editor.findDialogAriaLabel',
30
+ defaultMessage: 'Find',
31
+ description: 'Aria label for the "Find" dialog, used where the dialog offers find without replace'
32
+ },
28
33
  closeFindReplaceDialog: {
29
34
  id: 'fabric.editor.closeFindReplaceDialog',
30
35
  defaultMessage: 'Close',
@@ -19,7 +19,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
19
19
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
20
20
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
21
21
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
22
- var packageVersion = "125.0.0";
22
+ var packageVersion = "125.2.0";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags/fg';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "125.0.0";
24
+ var packageVersion = "125.2.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -1,6 +1,8 @@
1
1
  import type { ACTION, ACTION_SUBJECT, INPUT_METHOD, TRIGGER_METHOD } from './enums';
2
2
  import type { TrackAEP, UIAEP } from './utils';
3
3
  type ActivateAEP = UIAEP<ACTION.ACTIVATED, ACTION_SUBJECT.FIND_REPLACE_DIALOG, undefined, {
4
+ /** The editor mode when the dialog opened. */
5
+ editorViewMode?: 'view' | 'edit';
4
6
  inputMethod: INPUT_METHOD.KEYBOARD | INPUT_METHOD.PREFILL;
5
7
  triggerMethod: TRIGGER_METHOD.SHORTCUT | TRIGGER_METHOD.TOOLBAR | TRIGGER_METHOD.EXTERNAL;
6
8
  }, undefined>;
@@ -1,67 +1,72 @@
1
1
  export declare const findReplaceMessages: {
2
- find: {
3
- id: string;
2
+ closeFindReplaceDialog: {
4
3
  defaultMessage: string;
5
4
  description: string;
5
+ id: string;
6
6
  };
7
- matchCase: {
7
+ find: {
8
+ defaultMessage: string;
9
+ description: string;
8
10
  id: string;
11
+ };
12
+ findDialogAriaLabel: {
9
13
  defaultMessage: string;
10
14
  description: string;
15
+ id: string;
11
16
  };
12
17
  findNext: {
13
- id: string;
14
18
  defaultMessage: string;
15
19
  description: string;
20
+ id: string;
16
21
  };
17
22
  findPrevious: {
18
- id: string;
19
23
  defaultMessage: string;
20
24
  description: string;
25
+ id: string;
21
26
  };
22
27
  findReplaceDialogAriaLabel: {
23
- id: string;
24
28
  defaultMessage: string;
25
29
  description: string;
26
- };
27
- closeFindReplaceDialog: {
28
30
  id: string;
29
- defaultMessage: string;
30
- description: string;
31
31
  };
32
- noResultsFound: {
33
- id: string;
32
+ findReplaceToolbarButton: {
34
33
  defaultMessage: string;
35
34
  description: string;
36
- };
37
- resultsCount: {
38
35
  id: string;
39
- description: string;
40
- defaultMessage: string;
41
36
  };
42
- findReplaceToolbarButton: {
43
- id: string;
37
+ matchCase: {
44
38
  defaultMessage: string;
45
39
  description: string;
46
- };
47
- replaceWith: {
48
40
  id: string;
41
+ };
42
+ noResultsFound: {
49
43
  defaultMessage: string;
50
44
  description: string;
45
+ id: string;
51
46
  };
52
47
  replace: {
53
- id: string;
54
48
  defaultMessage: string;
55
49
  description: string;
50
+ id: string;
56
51
  };
57
52
  replaceAll: {
58
- id: string;
59
53
  defaultMessage: string;
60
54
  description: string;
55
+ id: string;
61
56
  };
62
57
  replaceSuccess: {
58
+ defaultMessage: string;
59
+ description: string;
60
+ id: string;
61
+ };
62
+ replaceWith: {
63
+ defaultMessage: string;
64
+ description: string;
63
65
  id: string;
66
+ };
67
+ resultsCount: {
64
68
  defaultMessage: string;
65
69
  description: string;
70
+ id: string;
66
71
  };
67
72
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "125.1.0",
3
+ "version": "125.2.1",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -84,7 +84,7 @@
84
84
  "@atlaskit/task-decision": "^21.10.0",
85
85
  "@atlaskit/teams-app-config": "^3.1.0",
86
86
  "@atlaskit/textfield": "^10.2.0",
87
- "@atlaskit/tmp-editor-statsig": "^206.0.0",
87
+ "@atlaskit/tmp-editor-statsig": "^208.0.0",
88
88
  "@atlaskit/tokens": "^20.0.0",
89
89
  "@atlaskit/tooltip": "^24.3.0",
90
90
  "@atlaskit/width-detector": "^7.2.0",