@atlaskit/editor-common 111.21.2 → 111.23.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/hooks/index.js +8 -1
  3. package/dist/cjs/hooks/useSmartCardReloadAfterCache.js +54 -0
  4. package/dist/cjs/messages/block-menu.js +14 -7
  5. package/dist/cjs/messages/block-type.js +7 -0
  6. package/dist/cjs/messages/syncBlock.js +7 -0
  7. package/dist/cjs/monitoring/error.js +1 -1
  8. package/dist/cjs/ui/DropList/index.js +1 -1
  9. package/dist/cjs/ui/Mention/mention-with-profilecard.js +3 -1
  10. package/dist/es2019/hooks/index.js +2 -1
  11. package/dist/es2019/hooks/useSmartCardReloadAfterCache.js +49 -0
  12. package/dist/es2019/messages/block-menu.js +14 -7
  13. package/dist/es2019/messages/block-type.js +7 -0
  14. package/dist/es2019/messages/syncBlock.js +7 -0
  15. package/dist/es2019/monitoring/error.js +1 -1
  16. package/dist/es2019/ui/DropList/index.js +1 -1
  17. package/dist/es2019/ui/Mention/mention-with-profilecard.js +3 -1
  18. package/dist/esm/hooks/index.js +2 -1
  19. package/dist/esm/hooks/useSmartCardReloadAfterCache.js +49 -0
  20. package/dist/esm/messages/block-menu.js +14 -7
  21. package/dist/esm/messages/block-type.js +7 -0
  22. package/dist/esm/messages/syncBlock.js +7 -0
  23. package/dist/esm/monitoring/error.js +1 -1
  24. package/dist/esm/ui/DropList/index.js +1 -1
  25. package/dist/esm/ui/Mention/mention-with-profilecard.js +3 -1
  26. package/dist/types/hooks/index.d.ts +1 -0
  27. package/dist/types/hooks/useSmartCardReloadAfterCache.d.ts +16 -0
  28. package/dist/types/messages/block-menu.d.ts +6 -1
  29. package/dist/types/messages/block-type.d.ts +5 -0
  30. package/dist/types/messages/syncBlock.d.ts +5 -0
  31. package/dist/types-ts4.5/hooks/index.d.ts +1 -0
  32. package/dist/types-ts4.5/hooks/useSmartCardReloadAfterCache.d.ts +16 -0
  33. package/dist/types-ts4.5/messages/block-menu.d.ts +6 -1
  34. package/dist/types-ts4.5/messages/block-type.d.ts +5 -0
  35. package/dist/types-ts4.5/messages/syncBlock.d.ts +5 -0
  36. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 111.23.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`8d4d473fe4cd8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8d4d473fe4cd8) -
8
+ Only reload cached smartlinks when the url changes and we sucessfully got the data from cache
9
+
10
+ ### Patch Changes
11
+
12
+ - [`3b290b31e9ad1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3b290b31e9ad1) -
13
+ Update menu button text for sync blocks
14
+ - Updated dependencies
15
+
16
+ ## 111.22.0
17
+
18
+ ### Minor Changes
19
+
20
+ - [`ab3866dd7f659`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ab3866dd7f659) -
21
+ Make sure that we use isRenderedInPortal for profilecards in the editor to make sure we are
22
+ focusing on the heading
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies
27
+
3
28
  ## 111.21.2
4
29
 
5
30
  ### Patch Changes
@@ -28,7 +28,14 @@ Object.defineProperty(exports, "useSharedPluginStateWithSelector", {
28
28
  return _useSharedPluginStateWithSelector.useSharedPluginStateWithSelector;
29
29
  }
30
30
  });
31
+ Object.defineProperty(exports, "useSmartCardReloadAfterCache", {
32
+ enumerable: true,
33
+ get: function get() {
34
+ return _useSmartCardReloadAfterCache.default;
35
+ }
36
+ });
31
37
  var _usePreviousState = _interopRequireDefault(require("./usePreviousState"));
32
38
  var _useConstructor = _interopRequireDefault(require("./useConstructor"));
33
39
  var _useSharedPluginState = require("./useSharedPluginState");
34
- var _useSharedPluginStateWithSelector = require("./useSharedPluginStateWithSelector");
40
+ var _useSharedPluginStateWithSelector = require("./useSharedPluginStateWithSelector");
41
+ var _useSmartCardReloadAfterCache = _interopRequireDefault(require("./useSmartCardReloadAfterCache"));
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = require("react");
8
+ var _hooks = require("@atlaskit/smart-card/hooks");
9
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
10
+ /**
11
+ * Hook to manage smart card reload behavior when content is loaded from local cache.
12
+ *
13
+ * Handles:
14
+ * - Capturing initial card status on mount (synchronously to avoid race conditions)
15
+ * - Tracking URL changes and resetting state
16
+ * - Only reloading data that was initially loaded from cache
17
+ * - Ensuring reload is called at most once per URL
18
+ * - Respecting page SSR state to avoid reloading on server-rendered pages
19
+ *
20
+ * @param url - The smart card URL
21
+ * @param cardStatus - The current card resolution status ('pending', 'resolved', etc)
22
+ * @param isPageSSRed - Whether the page was server-side rendered
23
+ */
24
+ var useSmartCardReloadAfterCache = function useSmartCardReloadAfterCache(url, cardStatus, isPageSSRed) {
25
+ var initialCardStatus = (0, _react.useRef)(undefined);
26
+ var hasReloaded = (0, _react.useRef)(false);
27
+ var previousUrl = (0, _react.useRef)(url);
28
+ var reload = (0, _hooks.useSmartLinkReload)({
29
+ url: url || ''
30
+ });
31
+
32
+ // Reset refs when URL changes (do this before capturing initial status)
33
+ if (previousUrl.current !== url) {
34
+ initialCardStatus.current = undefined;
35
+ hasReloaded.current = false;
36
+ previousUrl.current = url;
37
+ }
38
+
39
+ // Capture initial card status on first render (synchronously)
40
+ // This determines if the card was loaded from cache (resolved on mount)
41
+ // or if it's being fetched fresh (pending on mount)
42
+ if ((0, _expValEquals.expValEquals)('platform_editor_smartlink_local_cache', 'isEnabled', true) && cardStatus && initialCardStatus.current === undefined) {
43
+ initialCardStatus.current = cardStatus;
44
+ }
45
+
46
+ // Reload from cache in the background if needed
47
+ (0, _react.useEffect)(function () {
48
+ if ((0, _expValEquals.expValEquals)('platform_editor_smartlink_local_cache', 'isEnabled', true) && !isPageSSRed && url && initialCardStatus.current === 'resolved' && cardStatus === 'resolved' && !hasReloaded.current) {
49
+ hasReloaded.current = true;
50
+ reload();
51
+ }
52
+ }, [isPageSSRed, url, cardStatus, reload]);
53
+ };
54
+ var _default = exports.default = useSmartCardReloadAfterCache;
@@ -27,17 +27,17 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
27
27
  description: 'Copy link to the selected content'
28
28
  },
29
29
  copyLinkToBlock: {
30
- id: 'fabric.editor.block.menu.copy.link.to.block',
31
- defaultMessage: 'Copy link to selection',
32
- description: 'Copy link to the selected content'
33
- },
34
- // [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
35
- // Old message retained for flag-off state. To clean up: remove this when flag is removed.
36
- copyLinkToBlockOld: {
37
30
  id: 'fabric.editor.block.menu.copy.link.to.block',
38
31
  defaultMessage: 'Copy link to block',
39
32
  description: 'Copy link to the selected block'
40
33
  },
34
+ // [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
35
+ // New message with updated wording. To clean up: remove old message and feature flag check when flag is removed.
36
+ copyLinkToSelection: {
37
+ id: 'fabric.editor.block.menu.copy.link.to.selection',
38
+ defaultMessage: 'Copy link to selection',
39
+ description: 'Copy link to the selected content'
40
+ },
41
41
  linkCopiedToClipboard: {
42
42
  id: 'fabric.editor.block.menu.link.copied.to.clipboard',
43
43
  defaultMessage: 'Link copied to clipboard',
@@ -73,6 +73,13 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
73
73
  defaultMessage: 'Create synced block',
74
74
  description: 'Create a synced block at this line, converting the selection to a synced block if applicable'
75
75
  },
76
+ // [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
77
+ // New message with updated wording. To clean up: remove old message and feature flag check when flag is removed.
78
+ syncBlock: {
79
+ id: 'fabric.editor.block.menu.sync.block',
80
+ defaultMessage: 'Sync block',
81
+ description: 'Create a synced block at this line, converting the selection to a synced block if applicable'
82
+ },
76
83
  copySyncedBlock: {
77
84
  id: 'fabric.editor.block.menu.copy.synced.block',
78
85
  defaultMessage: 'Copy synced block',
@@ -156,6 +156,13 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
156
156
  defaultMessage: 'Create synced block',
157
157
  description: 'Inserts a synced block that auto-updates content across Atlassian apps'
158
158
  },
159
+ // [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
160
+ // New message with updated wording. To clean up: remove old message and feature flag check when flag is removed.
161
+ syncBlock: {
162
+ id: 'fabric.editor.syncBlock',
163
+ defaultMessage: 'Sync block',
164
+ description: 'Inserts a synced block that auto-updates content across Atlassian apps'
165
+ },
159
166
  syncedBlockDescription: {
160
167
  id: 'fabric.editor.syncedBlock.description',
161
168
  defaultMessage: 'Sync content across multiple locations',
@@ -141,6 +141,13 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
141
141
  defaultMessage: 'Create synced block',
142
142
  description: 'Label for button which creates a new synced block'
143
143
  },
144
+ // [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
145
+ // New message with updated wording. To clean up: remove old message and feature flag check when flag is removed.
146
+ syncBlockLabel: {
147
+ id: 'fabric.editor.syncBlockLabel',
148
+ defaultMessage: 'Sync block',
149
+ description: 'Label for button which creates a new synced block'
150
+ },
144
151
  newLozenge: {
145
152
  id: 'fabric.editor.syncBlock.toolbar.newLozenge',
146
153
  defaultMessage: 'New',
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
19
19
  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); }
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 = "0.0.0-development";
22
+ var packageVersion = "111.22.0";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // 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 = "0.0.0-development";
27
+ var packageVersion = "111.22.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -9,6 +9,7 @@ exports.default = MentionWithProfileCard;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _mention = require("@atlaskit/mention");
11
11
  var _user = _interopRequireDefault(require("@atlaskit/profilecard/user"));
12
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
12
13
  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); }
13
14
  function MentionWithProfileCard(_ref) {
14
15
  var autoFocus = _ref.autoFocus,
@@ -40,7 +41,8 @@ function MentionWithProfileCard(_ref) {
40
41
  // eslint-disable-next-line require-unicode-regexp
41
42
  ,
42
43
  ariaLabel: text.replace(/^@/, ''),
43
- ssrPlaceholderId: ssrPlaceholderId
44
+ ssrPlaceholderId: ssrPlaceholderId,
45
+ isRenderedInPortal: (0, _expValEquals.expValEquals)('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true)
44
46
  }, /*#__PURE__*/_react.default.createElement(_mention.ResourcedMention, {
45
47
  id: id,
46
48
  text: text,
@@ -4,4 +4,5 @@
4
4
  export { default as usePreviousState } from './usePreviousState';
5
5
  export { default as useConstructor } from './useConstructor';
6
6
  export { useSharedPluginState } from './useSharedPluginState';
7
- export { useSharedPluginStateWithSelector } from './useSharedPluginStateWithSelector';
7
+ export { useSharedPluginStateWithSelector } from './useSharedPluginStateWithSelector';
8
+ export { default as useSmartCardReloadAfterCache } from './useSmartCardReloadAfterCache';
@@ -0,0 +1,49 @@
1
+ import { useEffect, useRef } from 'react';
2
+ import { useSmartLinkReload } from '@atlaskit/smart-card/hooks';
3
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
+
5
+ /**
6
+ * Hook to manage smart card reload behavior when content is loaded from local cache.
7
+ *
8
+ * Handles:
9
+ * - Capturing initial card status on mount (synchronously to avoid race conditions)
10
+ * - Tracking URL changes and resetting state
11
+ * - Only reloading data that was initially loaded from cache
12
+ * - Ensuring reload is called at most once per URL
13
+ * - Respecting page SSR state to avoid reloading on server-rendered pages
14
+ *
15
+ * @param url - The smart card URL
16
+ * @param cardStatus - The current card resolution status ('pending', 'resolved', etc)
17
+ * @param isPageSSRed - Whether the page was server-side rendered
18
+ */
19
+ const useSmartCardReloadAfterCache = (url, cardStatus, isPageSSRed) => {
20
+ const initialCardStatus = useRef(undefined);
21
+ const hasReloaded = useRef(false);
22
+ const previousUrl = useRef(url);
23
+ const reload = useSmartLinkReload({
24
+ url: url || ''
25
+ });
26
+
27
+ // Reset refs when URL changes (do this before capturing initial status)
28
+ if (previousUrl.current !== url) {
29
+ initialCardStatus.current = undefined;
30
+ hasReloaded.current = false;
31
+ previousUrl.current = url;
32
+ }
33
+
34
+ // Capture initial card status on first render (synchronously)
35
+ // This determines if the card was loaded from cache (resolved on mount)
36
+ // or if it's being fetched fresh (pending on mount)
37
+ if (expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true) && cardStatus && initialCardStatus.current === undefined) {
38
+ initialCardStatus.current = cardStatus;
39
+ }
40
+
41
+ // Reload from cache in the background if needed
42
+ useEffect(() => {
43
+ if (expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true) && !isPageSSRed && url && initialCardStatus.current === 'resolved' && cardStatus === 'resolved' && !hasReloaded.current) {
44
+ hasReloaded.current = true;
45
+ reload();
46
+ }
47
+ }, [isPageSSRed, url, cardStatus, reload]);
48
+ };
49
+ export default useSmartCardReloadAfterCache;
@@ -21,17 +21,17 @@ export const messages = defineMessages({
21
21
  description: 'Copy link to the selected content'
22
22
  },
23
23
  copyLinkToBlock: {
24
- id: 'fabric.editor.block.menu.copy.link.to.block',
25
- defaultMessage: 'Copy link to selection',
26
- description: 'Copy link to the selected content'
27
- },
28
- // [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
29
- // Old message retained for flag-off state. To clean up: remove this when flag is removed.
30
- copyLinkToBlockOld: {
31
24
  id: 'fabric.editor.block.menu.copy.link.to.block',
32
25
  defaultMessage: 'Copy link to block',
33
26
  description: 'Copy link to the selected block'
34
27
  },
28
+ // [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
29
+ // New message with updated wording. To clean up: remove old message and feature flag check when flag is removed.
30
+ copyLinkToSelection: {
31
+ id: 'fabric.editor.block.menu.copy.link.to.selection',
32
+ defaultMessage: 'Copy link to selection',
33
+ description: 'Copy link to the selected content'
34
+ },
35
35
  linkCopiedToClipboard: {
36
36
  id: 'fabric.editor.block.menu.link.copied.to.clipboard',
37
37
  defaultMessage: 'Link copied to clipboard',
@@ -67,6 +67,13 @@ export const messages = defineMessages({
67
67
  defaultMessage: 'Create synced block',
68
68
  description: 'Create a synced block at this line, converting the selection to a synced block if applicable'
69
69
  },
70
+ // [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
71
+ // New message with updated wording. To clean up: remove old message and feature flag check when flag is removed.
72
+ syncBlock: {
73
+ id: 'fabric.editor.block.menu.sync.block',
74
+ defaultMessage: 'Sync block',
75
+ description: 'Create a synced block at this line, converting the selection to a synced block if applicable'
76
+ },
70
77
  copySyncedBlock: {
71
78
  id: 'fabric.editor.block.menu.copy.synced.block',
72
79
  defaultMessage: 'Copy synced block',
@@ -150,6 +150,13 @@ export const messages = defineMessages({
150
150
  defaultMessage: 'Create synced block',
151
151
  description: 'Inserts a synced block that auto-updates content across Atlassian apps'
152
152
  },
153
+ // [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
154
+ // New message with updated wording. To clean up: remove old message and feature flag check when flag is removed.
155
+ syncBlock: {
156
+ id: 'fabric.editor.syncBlock',
157
+ defaultMessage: 'Sync block',
158
+ description: 'Inserts a synced block that auto-updates content across Atlassian apps'
159
+ },
153
160
  syncedBlockDescription: {
154
161
  id: 'fabric.editor.syncedBlock.description',
155
162
  defaultMessage: 'Sync content across multiple locations',
@@ -135,6 +135,13 @@ export const syncBlockMessages = defineMessages({
135
135
  defaultMessage: 'Create synced block',
136
136
  description: 'Label for button which creates a new synced block'
137
137
  },
138
+ // [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
139
+ // New message with updated wording. To clean up: remove old message and feature flag check when flag is removed.
140
+ syncBlockLabel: {
141
+ id: 'fabric.editor.syncBlockLabel',
142
+ defaultMessage: 'Sync block',
143
+ description: 'Label for button which creates a new synced block'
144
+ },
138
145
  newLozenge: {
139
146
  id: 'fabric.editor.syncBlock.toolbar.newLozenge',
140
147
  defaultMessage: 'New',
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
4
4
  import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
5
5
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
6
6
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
7
- const packageVersion = "0.0.0-development";
7
+ const packageVersion = "111.22.0";
8
8
  const sanitiseSentryEvents = (data, _hint) => {
9
9
  // Remove URL as it has UGC
10
10
  // Ignored via go/ees007
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "0.0.0-development";
17
+ const packageVersion = "111.22.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -1,6 +1,7 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import { ResourcedMention } from '@atlaskit/mention';
3
3
  import ProfileCardTrigger from '@atlaskit/profilecard/user';
4
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
5
  export default function MentionWithProfileCard({
5
6
  autoFocus,
6
7
  id,
@@ -32,7 +33,8 @@ export default function MentionWithProfileCard({
32
33
  // eslint-disable-next-line require-unicode-regexp
33
34
  ,
34
35
  ariaLabel: text.replace(/^@/, ''),
35
- ssrPlaceholderId: ssrPlaceholderId
36
+ ssrPlaceholderId: ssrPlaceholderId,
37
+ isRenderedInPortal: expValEquals('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true)
36
38
  }, /*#__PURE__*/React.createElement(ResourcedMention, {
37
39
  id: id,
38
40
  text: text,
@@ -4,4 +4,5 @@
4
4
  export { default as usePreviousState } from './usePreviousState';
5
5
  export { default as useConstructor } from './useConstructor';
6
6
  export { useSharedPluginState } from './useSharedPluginState';
7
- export { useSharedPluginStateWithSelector } from './useSharedPluginStateWithSelector';
7
+ export { useSharedPluginStateWithSelector } from './useSharedPluginStateWithSelector';
8
+ export { default as useSmartCardReloadAfterCache } from './useSmartCardReloadAfterCache';
@@ -0,0 +1,49 @@
1
+ import { useEffect, useRef } from 'react';
2
+ import { useSmartLinkReload } from '@atlaskit/smart-card/hooks';
3
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
+
5
+ /**
6
+ * Hook to manage smart card reload behavior when content is loaded from local cache.
7
+ *
8
+ * Handles:
9
+ * - Capturing initial card status on mount (synchronously to avoid race conditions)
10
+ * - Tracking URL changes and resetting state
11
+ * - Only reloading data that was initially loaded from cache
12
+ * - Ensuring reload is called at most once per URL
13
+ * - Respecting page SSR state to avoid reloading on server-rendered pages
14
+ *
15
+ * @param url - The smart card URL
16
+ * @param cardStatus - The current card resolution status ('pending', 'resolved', etc)
17
+ * @param isPageSSRed - Whether the page was server-side rendered
18
+ */
19
+ var useSmartCardReloadAfterCache = function useSmartCardReloadAfterCache(url, cardStatus, isPageSSRed) {
20
+ var initialCardStatus = useRef(undefined);
21
+ var hasReloaded = useRef(false);
22
+ var previousUrl = useRef(url);
23
+ var reload = useSmartLinkReload({
24
+ url: url || ''
25
+ });
26
+
27
+ // Reset refs when URL changes (do this before capturing initial status)
28
+ if (previousUrl.current !== url) {
29
+ initialCardStatus.current = undefined;
30
+ hasReloaded.current = false;
31
+ previousUrl.current = url;
32
+ }
33
+
34
+ // Capture initial card status on first render (synchronously)
35
+ // This determines if the card was loaded from cache (resolved on mount)
36
+ // or if it's being fetched fresh (pending on mount)
37
+ if (expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true) && cardStatus && initialCardStatus.current === undefined) {
38
+ initialCardStatus.current = cardStatus;
39
+ }
40
+
41
+ // Reload from cache in the background if needed
42
+ useEffect(function () {
43
+ if (expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true) && !isPageSSRed && url && initialCardStatus.current === 'resolved' && cardStatus === 'resolved' && !hasReloaded.current) {
44
+ hasReloaded.current = true;
45
+ reload();
46
+ }
47
+ }, [isPageSSRed, url, cardStatus, reload]);
48
+ };
49
+ export default useSmartCardReloadAfterCache;
@@ -21,17 +21,17 @@ export var messages = defineMessages({
21
21
  description: 'Copy link to the selected content'
22
22
  },
23
23
  copyLinkToBlock: {
24
- id: 'fabric.editor.block.menu.copy.link.to.block',
25
- defaultMessage: 'Copy link to selection',
26
- description: 'Copy link to the selected content'
27
- },
28
- // [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
29
- // Old message retained for flag-off state. To clean up: remove this when flag is removed.
30
- copyLinkToBlockOld: {
31
24
  id: 'fabric.editor.block.menu.copy.link.to.block',
32
25
  defaultMessage: 'Copy link to block',
33
26
  description: 'Copy link to the selected block'
34
27
  },
28
+ // [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
29
+ // New message with updated wording. To clean up: remove old message and feature flag check when flag is removed.
30
+ copyLinkToSelection: {
31
+ id: 'fabric.editor.block.menu.copy.link.to.selection',
32
+ defaultMessage: 'Copy link to selection',
33
+ description: 'Copy link to the selected content'
34
+ },
35
35
  linkCopiedToClipboard: {
36
36
  id: 'fabric.editor.block.menu.link.copied.to.clipboard',
37
37
  defaultMessage: 'Link copied to clipboard',
@@ -67,6 +67,13 @@ export var messages = defineMessages({
67
67
  defaultMessage: 'Create synced block',
68
68
  description: 'Create a synced block at this line, converting the selection to a synced block if applicable'
69
69
  },
70
+ // [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
71
+ // New message with updated wording. To clean up: remove old message and feature flag check when flag is removed.
72
+ syncBlock: {
73
+ id: 'fabric.editor.block.menu.sync.block',
74
+ defaultMessage: 'Sync block',
75
+ description: 'Create a synced block at this line, converting the selection to a synced block if applicable'
76
+ },
70
77
  copySyncedBlock: {
71
78
  id: 'fabric.editor.block.menu.copy.synced.block',
72
79
  defaultMessage: 'Copy synced block',
@@ -150,6 +150,13 @@ export var messages = defineMessages({
150
150
  defaultMessage: 'Create synced block',
151
151
  description: 'Inserts a synced block that auto-updates content across Atlassian apps'
152
152
  },
153
+ // [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
154
+ // New message with updated wording. To clean up: remove old message and feature flag check when flag is removed.
155
+ syncBlock: {
156
+ id: 'fabric.editor.syncBlock',
157
+ defaultMessage: 'Sync block',
158
+ description: 'Inserts a synced block that auto-updates content across Atlassian apps'
159
+ },
153
160
  syncedBlockDescription: {
154
161
  id: 'fabric.editor.syncedBlock.description',
155
162
  defaultMessage: 'Sync content across multiple locations',
@@ -135,6 +135,13 @@ export var syncBlockMessages = defineMessages({
135
135
  defaultMessage: 'Create synced block',
136
136
  description: 'Label for button which creates a new synced block'
137
137
  },
138
+ // [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
139
+ // New message with updated wording. To clean up: remove old message and feature flag check when flag is removed.
140
+ syncBlockLabel: {
141
+ id: 'fabric.editor.syncBlockLabel',
142
+ defaultMessage: 'Sync block',
143
+ description: 'Label for button which creates a new synced block'
144
+ },
138
145
  newLozenge: {
139
146
  id: 'fabric.editor.syncBlock.toolbar.newLozenge',
140
147
  defaultMessage: 'New',
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
10
10
  import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
11
11
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
12
12
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
13
- var packageVersion = "0.0.0-development";
13
+ var packageVersion = "111.22.0";
14
14
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
15
15
  // Remove URL as it has UGC
16
16
  // Ignored via go/ees007
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "0.0.0-development";
24
+ var packageVersion = "111.22.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -1,6 +1,7 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import { ResourcedMention } from '@atlaskit/mention';
3
3
  import ProfileCardTrigger from '@atlaskit/profilecard/user';
4
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
5
  export default function MentionWithProfileCard(_ref) {
5
6
  var autoFocus = _ref.autoFocus,
6
7
  id = _ref.id,
@@ -31,7 +32,8 @@ export default function MentionWithProfileCard(_ref) {
31
32
  // eslint-disable-next-line require-unicode-regexp
32
33
  ,
33
34
  ariaLabel: text.replace(/^@/, ''),
34
- ssrPlaceholderId: ssrPlaceholderId
35
+ ssrPlaceholderId: ssrPlaceholderId,
36
+ isRenderedInPortal: expValEquals('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true)
35
37
  }, /*#__PURE__*/React.createElement(ResourcedMention, {
36
38
  id: id,
37
39
  text: text,
@@ -2,3 +2,4 @@ export { default as usePreviousState } from './usePreviousState';
2
2
  export { default as useConstructor } from './useConstructor';
3
3
  export { useSharedPluginState } from './useSharedPluginState';
4
4
  export { useSharedPluginStateWithSelector, type NamedPluginStatesFromInjectionAPI, } from './useSharedPluginStateWithSelector';
5
+ export { default as useSmartCardReloadAfterCache } from './useSmartCardReloadAfterCache';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Hook to manage smart card reload behavior when content is loaded from local cache.
3
+ *
4
+ * Handles:
5
+ * - Capturing initial card status on mount (synchronously to avoid race conditions)
6
+ * - Tracking URL changes and resetting state
7
+ * - Only reloading data that was initially loaded from cache
8
+ * - Ensuring reload is called at most once per URL
9
+ * - Respecting page SSR state to avoid reloading on server-rendered pages
10
+ *
11
+ * @param url - The smart card URL
12
+ * @param cardStatus - The current card resolution status ('pending', 'resolved', etc)
13
+ * @param isPageSSRed - Whether the page was server-side rendered
14
+ */
15
+ declare const useSmartCardReloadAfterCache: (url: string | undefined, cardStatus: string | undefined, isPageSSRed: boolean) => void;
16
+ export default useSmartCardReloadAfterCache;
@@ -24,7 +24,7 @@ export declare const messages: {
24
24
  defaultMessage: string;
25
25
  description: string;
26
26
  };
27
- copyLinkToBlockOld: {
27
+ copyLinkToSelection: {
28
28
  id: string;
29
29
  defaultMessage: string;
30
30
  description: string;
@@ -64,6 +64,11 @@ export declare const messages: {
64
64
  defaultMessage: string;
65
65
  description: string;
66
66
  };
67
+ syncBlock: {
68
+ id: string;
69
+ defaultMessage: string;
70
+ description: string;
71
+ };
67
72
  copySyncedBlock: {
68
73
  id: string;
69
74
  defaultMessage: string;
@@ -149,6 +149,11 @@ export declare const messages: {
149
149
  defaultMessage: string;
150
150
  description: string;
151
151
  };
152
+ syncBlock: {
153
+ id: string;
154
+ defaultMessage: string;
155
+ description: string;
156
+ };
152
157
  syncedBlockDescription: {
153
158
  id: string;
154
159
  defaultMessage: string;
@@ -134,6 +134,11 @@ export declare const syncBlockMessages: {
134
134
  defaultMessage: string;
135
135
  description: string;
136
136
  };
137
+ syncBlockLabel: {
138
+ id: string;
139
+ defaultMessage: string;
140
+ description: string;
141
+ };
137
142
  newLozenge: {
138
143
  id: string;
139
144
  defaultMessage: string;
@@ -2,3 +2,4 @@ export { default as usePreviousState } from './usePreviousState';
2
2
  export { default as useConstructor } from './useConstructor';
3
3
  export { useSharedPluginState } from './useSharedPluginState';
4
4
  export { useSharedPluginStateWithSelector, type NamedPluginStatesFromInjectionAPI, } from './useSharedPluginStateWithSelector';
5
+ export { default as useSmartCardReloadAfterCache } from './useSmartCardReloadAfterCache';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Hook to manage smart card reload behavior when content is loaded from local cache.
3
+ *
4
+ * Handles:
5
+ * - Capturing initial card status on mount (synchronously to avoid race conditions)
6
+ * - Tracking URL changes and resetting state
7
+ * - Only reloading data that was initially loaded from cache
8
+ * - Ensuring reload is called at most once per URL
9
+ * - Respecting page SSR state to avoid reloading on server-rendered pages
10
+ *
11
+ * @param url - The smart card URL
12
+ * @param cardStatus - The current card resolution status ('pending', 'resolved', etc)
13
+ * @param isPageSSRed - Whether the page was server-side rendered
14
+ */
15
+ declare const useSmartCardReloadAfterCache: (url: string | undefined, cardStatus: string | undefined, isPageSSRed: boolean) => void;
16
+ export default useSmartCardReloadAfterCache;
@@ -24,7 +24,7 @@ export declare const messages: {
24
24
  defaultMessage: string;
25
25
  description: string;
26
26
  };
27
- copyLinkToBlockOld: {
27
+ copyLinkToSelection: {
28
28
  id: string;
29
29
  defaultMessage: string;
30
30
  description: string;
@@ -64,6 +64,11 @@ export declare const messages: {
64
64
  defaultMessage: string;
65
65
  description: string;
66
66
  };
67
+ syncBlock: {
68
+ id: string;
69
+ defaultMessage: string;
70
+ description: string;
71
+ };
67
72
  copySyncedBlock: {
68
73
  id: string;
69
74
  defaultMessage: string;
@@ -149,6 +149,11 @@ export declare const messages: {
149
149
  defaultMessage: string;
150
150
  description: string;
151
151
  };
152
+ syncBlock: {
153
+ id: string;
154
+ defaultMessage: string;
155
+ description: string;
156
+ };
152
157
  syncedBlockDescription: {
153
158
  id: string;
154
159
  defaultMessage: string;
@@ -134,6 +134,11 @@ export declare const syncBlockMessages: {
134
134
  defaultMessage: string;
135
135
  description: string;
136
136
  };
137
+ syncBlockLabel: {
138
+ id: string;
139
+ defaultMessage: string;
140
+ description: string;
141
+ };
137
142
  newLozenge: {
138
143
  id: string;
139
144
  defaultMessage: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "111.21.2",
3
+ "version": "111.23.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/"
@@ -71,7 +71,7 @@
71
71
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
72
72
  "@atlaskit/popper": "^7.1.0",
73
73
  "@atlaskit/primitives": "^18.0.0",
74
- "@atlaskit/profilecard": "^24.38.0",
74
+ "@atlaskit/profilecard": "^24.39.0",
75
75
  "@atlaskit/prosemirror-history": "^0.2.0",
76
76
  "@atlaskit/react-ufo": "^5.4.0",
77
77
  "@atlaskit/section-message": "^8.12.0",
@@ -82,7 +82,7 @@
82
82
  "@atlaskit/task-decision": "^19.3.0",
83
83
  "@atlaskit/textfield": "^8.2.0",
84
84
  "@atlaskit/theme": "^21.0.0",
85
- "@atlaskit/tmp-editor-statsig": "^32.4.0",
85
+ "@atlaskit/tmp-editor-statsig": "^32.5.0",
86
86
  "@atlaskit/tokens": "^11.0.0",
87
87
  "@atlaskit/tooltip": "^20.14.0",
88
88
  "@atlaskit/width-detector": "^5.0.0",
@@ -123,7 +123,7 @@
123
123
  },
124
124
  "devDependencies": {
125
125
  "@atlaskit/media-core": "^37.0.0",
126
- "@atlassian/a11y-jest-testing": "^0.10.0",
126
+ "@atlassian/a11y-jest-testing": "^0.11.0",
127
127
  "@testing-library/dom": "^10.1.0",
128
128
  "@testing-library/jest-dom": "^6.4.5",
129
129
  "@testing-library/react": "^16.3.0",