@atlaskit/editor-common 122.10.0 → 122.11.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,25 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 122.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`b51cc398d7701`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b51cc398d7701) -
8
+ Add the opt-in @mention availability predicate used by the gated Home Search mode, so Search
9
+ preserves existing Chat mentions as inactive content while preventing new mention typeahead and
10
+ `/mention` slash-menu insertion. The `editor-disable-feature` feature gate enables that predicate
11
+ for Home Search.
12
+
13
+ ### Patch Changes
14
+
15
+ - [`8aaca3d7e468b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8aaca3d7e468b) -
16
+ Behind the `platform_editor_ssr_reuse_requires_content` feature gate, `ExtensionNode` no longer
17
+ adopts an empty server-rendered element on the SSR DOM reuse path
18
+ (`platform_editor_hydration_skip_react_portal`). When the SSR render of an extension node view
19
+ failed and left the element empty, the node view now falls back to the normal React render instead
20
+ of staying blank until the next update (HOT-306707).
21
+ - Updated dependencies
22
+
3
23
  ## 122.10.0
4
24
 
5
25
  ### Minor Changes
@@ -185,6 +185,17 @@ var ExtensionNode = exports.ExtensionNode = /*#__PURE__*/function (_ReactNodeVie
185
185
  var selector = "[extensionkey=\"".concat(extensionKey, "\"][localid=\"").concat(localId, "\"]");
186
186
  var element = editorDom.querySelector(selector);
187
187
  if (element && element instanceof HTMLElement) {
188
+ // A server-rendered element is only worth adopting if React actually rendered into it.
189
+ // The SSR pass renders each node view through an isolated `renderToStaticMarkup`; when
190
+ // that render throws, the portal provider swallows the error and leaves the container
191
+ // empty. Adopting an empty element and skipping the React portal leaves the extension
192
+ // invisible until the next `update()`, which for an untouched node only happens on user
193
+ // interaction (HOT-306707). Treat an empty element as "no SSR DOM" so the node view takes
194
+ // the normal React render path instead.
195
+ if ((0, _fg.fg)('platform_editor_ssr_reuse_requires_content') && !element.querySelector('[data-testid="extension-node-wrapper"]')) {
196
+ this.cachedSsrElement = null;
197
+ return null;
198
+ }
188
199
  this.cachedSsrElement = element;
189
200
  return element;
190
201
  }
@@ -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 = "122.9.1";
30
+ var packageVersion = "122.10.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 = "122.9.1";
27
+ var packageVersion = "122.10.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -152,6 +152,17 @@ export class ExtensionNode extends ReactNodeView {
152
152
  const selector = `[extensionkey="${extensionKey}"][localid="${localId}"]`;
153
153
  const element = editorDom.querySelector(selector);
154
154
  if (element && element instanceof HTMLElement) {
155
+ // A server-rendered element is only worth adopting if React actually rendered into it.
156
+ // The SSR pass renders each node view through an isolated `renderToStaticMarkup`; when
157
+ // that render throws, the portal provider swallows the error and leaves the container
158
+ // empty. Adopting an empty element and skipping the React portal leaves the extension
159
+ // invisible until the next `update()`, which for an untouched node only happens on user
160
+ // interaction (HOT-306707). Treat an empty element as "no SSR DOM" so the node view takes
161
+ // the normal React render path instead.
162
+ if (fg('platform_editor_ssr_reuse_requires_content') && !element.querySelector('[data-testid="extension-node-wrapper"]')) {
163
+ this.cachedSsrElement = null;
164
+ return null;
165
+ }
155
166
  this.cachedSsrElement = element;
156
167
  return element;
157
168
  }
@@ -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 = "122.9.1";
16
+ const packageVersion = "122.10.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 = "122.9.1";
17
+ const packageVersion = "122.10.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -177,6 +177,17 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
177
177
  var selector = "[extensionkey=\"".concat(extensionKey, "\"][localid=\"").concat(localId, "\"]");
178
178
  var element = editorDom.querySelector(selector);
179
179
  if (element && element instanceof HTMLElement) {
180
+ // A server-rendered element is only worth adopting if React actually rendered into it.
181
+ // The SSR pass renders each node view through an isolated `renderToStaticMarkup`; when
182
+ // that render throws, the portal provider swallows the error and leaves the container
183
+ // empty. Adopting an empty element and skipping the React portal leaves the extension
184
+ // invisible until the next `update()`, which for an untouched node only happens on user
185
+ // interaction (HOT-306707). Treat an empty element as "no SSR DOM" so the node view takes
186
+ // the normal React render path instead.
187
+ if (fg('platform_editor_ssr_reuse_requires_content') && !element.querySelector('[data-testid="extension-node-wrapper"]')) {
188
+ this.cachedSsrElement = null;
189
+ return null;
190
+ }
180
191
  this.cachedSsrElement = element;
181
192
  return element;
182
193
  }
@@ -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 = "122.9.1";
22
+ var packageVersion = "122.10.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 = "122.9.1";
24
+ var packageVersion = "122.10.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -30,6 +30,8 @@ export type QuickInsertItem = TypeAheadItem & {
30
30
  featured?: boolean;
31
31
  /** optional identifier */
32
32
  id?: QuickInsertItemId;
33
+ /** Returns true when the item should not be shown in Quick Insert results. */
34
+ isHidden?: () => boolean;
33
35
  /** other names used to find the item */
34
36
  keywords?: Array<string>;
35
37
  };
@@ -109,6 +109,11 @@ export type MoreOptionsButtonConfig = {
109
109
  title: string;
110
110
  };
111
111
  export type TypeAheadHandler = {
112
+ /**
113
+ * Optional predicate evaluated before the typeahead opens. When false, the
114
+ * trigger remains as ordinary editor text.
115
+ */
116
+ canOpen?: () => boolean;
112
117
  /** Custom regex must have a capture group around trigger so it's possible to
113
118
  * use it without needing to scan through all triggers again */
114
119
  customRegex?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "122.10.0",
3
+ "version": "122.11.0",
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/"
@@ -205,6 +205,9 @@
205
205
  "confluence_connect_macro_preset_height": {
206
206
  "type": "boolean"
207
207
  },
208
+ "platform_editor_ssr_reuse_requires_content": {
209
+ "type": "boolean"
210
+ },
208
211
  "cc_comments_log_draft_annotation_ancestor_nodes": {
209
212
  "type": "boolean"
210
213
  },