@atlaskit/editor-common 123.2.1 → 123.4.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 (45) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/block-controls/surface-candidate-invalidation/package.json +10 -0
  3. package/dist/cjs/block-controls/surface-candidate-invalidation.js +27 -0
  4. package/dist/cjs/block-controls/surface-keys.js +5 -1
  5. package/dist/cjs/monitoring/error.js +1 -1
  6. package/dist/cjs/prosemirror-dom-metadata/index.js +2 -1
  7. package/dist/cjs/quick-insert/snippetPreviewImageUrls.js +117 -0
  8. package/dist/cjs/safe-plugin/index.js +4 -3
  9. package/dist/cjs/selection/getFragmentsFromSelection.js +5 -14
  10. package/dist/cjs/ui/DropList/index.js +1 -1
  11. package/dist/cjs/ui/Expand/index.js +22 -1
  12. package/dist/cjs/ui/MediaSingle/styled.js +1 -6
  13. package/dist/cjs/ui/Mention/index.js +1 -1
  14. package/dist/es2019/block-controls/surface-candidate-invalidation.js +19 -0
  15. package/dist/es2019/block-controls/surface-keys.js +4 -0
  16. package/dist/es2019/monitoring/error.js +1 -1
  17. package/dist/es2019/prosemirror-dom-metadata/index.js +2 -1
  18. package/dist/es2019/quick-insert/snippetPreviewImageUrls.js +109 -0
  19. package/dist/es2019/safe-plugin/index.js +4 -3
  20. package/dist/es2019/selection/getFragmentsFromSelection.js +5 -14
  21. package/dist/es2019/ui/DropList/index.js +1 -1
  22. package/dist/es2019/ui/Expand/index.js +22 -1
  23. package/dist/es2019/ui/MediaSingle/styled.js +1 -6
  24. package/dist/es2019/ui/Mention/index.js +1 -1
  25. package/dist/esm/block-controls/surface-candidate-invalidation.js +20 -0
  26. package/dist/esm/block-controls/surface-keys.js +4 -0
  27. package/dist/esm/monitoring/error.js +1 -1
  28. package/dist/esm/prosemirror-dom-metadata/index.js +2 -1
  29. package/dist/esm/quick-insert/snippetPreviewImageUrls.js +111 -0
  30. package/dist/esm/safe-plugin/index.js +4 -3
  31. package/dist/esm/selection/getFragmentsFromSelection.js +5 -14
  32. package/dist/esm/ui/DropList/index.js +1 -1
  33. package/dist/esm/ui/Expand/index.js +22 -1
  34. package/dist/esm/ui/MediaSingle/styled.js +1 -6
  35. package/dist/esm/ui/Mention/index.js +1 -1
  36. package/dist/types/block-controls/block-control-ui-context.d.ts +1 -0
  37. package/dist/types/block-controls/surface-candidate-invalidation.d.ts +21 -0
  38. package/dist/types/block-controls/surface-keys.d.ts +4 -0
  39. package/dist/types/quick-insert/snippetPreviewImageUrls.d.ts +6 -0
  40. package/dist/types/selection/getFragmentsFromSelection.d.ts +3 -9
  41. package/dist/types/types/floating-toolbar.d.ts +7 -0
  42. package/dist/types/types/hyperlink.d.ts +4 -0
  43. package/dist/types/ui/Expand/index.d.ts +20 -0
  44. package/package.json +4 -10
  45. package/quick-insert/snippet-preview-image-urls/package.json +10 -0
@@ -1,18 +1,10 @@
1
- import { toJSON as unsanitizedNodeToJSON } from '@atlaskit/editor-json-transformer/toJSON';
2
- import { fg } from '@atlaskit/platform-feature-flags/fg';
3
1
  import { nodeToJSON } from '../utils/nodes';
4
2
  import { getSliceFromSelection } from './context-helpers';
5
3
 
6
4
  /**
7
- * Get the fragments from the selection.
8
- *
9
- * The result crosses an editor boundary — Remix, Rovo/convo-ai and AIFC treat it as persistable
10
- * ADF. The two same-named `nodeToJSON` exports are not interchangeable: `editor-json-transformer`'s
11
- * is a verbatim ProseMirror serialisation and leaks schema-only container variants such as
12
- * `panel_c1`, while `../utils/nodes` sanitises.
13
- *
14
- * `keepNestedTables: true` keeps the gate scoped to that strip — the sanitiser would otherwise also
15
- * rewrite nested tables into an extension carrying stringified ADF.
5
+ * Selection fragments cross an editor boundary: Remix, Rovo/convo-ai and AIFC consume them as
6
+ * persistable ADF, so schema-only container variants must be sanitized. Nested tables remain intact
7
+ * rather than being converted into extensions containing stringified ADF.
16
8
  */
17
9
  export const getFragmentsFromSelection = selection => {
18
10
  if (!selection || selection.empty) {
@@ -20,12 +12,11 @@ export const getFragmentsFromSelection = selection => {
20
12
  }
21
13
  const slice = getSliceFromSelection(selection);
22
14
  const content = slice.content;
23
- const sanitizeFragments = fg('platform_editor_sanitize_selection_fragments');
24
15
  const fragment = [];
25
16
  content.forEach(node => {
26
- fragment.push(sanitizeFragments ? nodeToJSON(node, {
17
+ fragment.push(nodeToJSON(node, {
27
18
  keepNestedTables: true
28
- }) : unsanitizedNodeToJSON(node));
19
+ }));
29
20
  });
30
21
  return fragment;
31
22
  };
@@ -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 = "123.2.0";
17
+ const packageVersion = "123.3.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -42,10 +42,31 @@ export const messages = defineMessages({
42
42
  defaultMessage: 'Give this expand a title',
43
43
  description: 'aria label for an expand node title input field'
44
44
  },
45
- expandBodyAriaLabel: {
45
+ // Clean up with platform_editor_expand_content_a11y_2.
46
+ expandBodyAriaLabelOriginal: {
46
47
  id: 'fabric.editor.expandBodyAriaLabel',
47
48
  defaultMessage: 'Expand body content',
48
49
  description: 'Aria label for the body content of an expand node'
50
+ },
51
+ expandBodyAriaLabel: {
52
+ id: 'editor-common.Expand.expandBodyAriaLabel',
53
+ defaultMessage: 'Body content for {title}',
54
+ description: 'Aria label for the body content of an expand node'
55
+ },
56
+ expandBodyAriaLabelUntitled: {
57
+ id: 'editor-common.Expand.expandBodyAriaLabelUntitled',
58
+ defaultMessage: 'untitled expand',
59
+ description: 'Fallback title for the body content of an expand node without a title'
60
+ },
61
+ expandBodyAriaDescription: {
62
+ id: 'fabric.editor.expandBodyAriaDescription',
63
+ defaultMessage: 'Enter the content that will be revealed when this expand is opened.',
64
+ description: 'Aria description for the body content of an expand node'
65
+ },
66
+ expandBodyRoleDescription: {
67
+ id: 'fabric.editor.expandBodyRoleDescription',
68
+ defaultMessage: 'macro',
69
+ description: 'Aria role description for the body content of an expand node'
49
70
  }
50
71
  });
51
72
 
@@ -9,7 +9,6 @@ import React from 'react';
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
10
10
  import { css, jsx } from '@emotion/react';
11
11
  import { akEditorDefaultLayoutWidth, akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
12
- import { fg } from '@atlaskit/platform-feature-flags/fg';
13
12
  import { nonWrappedLayouts } from '../../utils';
14
13
  import { calcBreakoutWidth, calcWideWidth } from '../../utils/breakout';
15
14
  import { calcResizedWidth } from './calcResizedWidth';
@@ -300,11 +299,7 @@ MediaWrapper.displayName = 'WrapperMediaSingle';
300
299
  export const MediaBorderGapFiller = ({
301
300
  borderColor
302
301
  }) => {
303
- // [FEATURE FLAG: platform_editor_media_border_radius_fix]
304
- // Fixes border radius to properly match image with 8px radius
305
- // To clean up: remove conditional, keep only flag-on behavior ('8px')
306
- const borderRadius = fg('platform_editor_media_border_radius_fix') ? "var(--ds-radius-large, 8px)" : '1px'; // OLD BEHAVIOR (to be removed when flag is cleaned up)
307
-
302
+ const borderRadius = "var(--ds-radius-large, 8px)";
308
303
  return jsx("div", {
309
304
  style: {
310
305
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
@@ -26,7 +26,7 @@ export default class Mention extends PureComponent {
26
26
  mentionProvider,
27
27
  profilecardProvider
28
28
  } = providers;
29
- const isAvatarEnabled = Boolean(mentionNodeDataProvider) && userType !== 'SPECIAL' && !GENERIC_MENTION_IDS.includes(id) && isExperimentEnabled('platform_editor_mention_node_avatar');
29
+ const isAvatarEnabled = Boolean(mentionNodeDataProvider) && userType !== 'SPECIAL' && !GENERIC_MENTION_IDS.includes(id) && (isExperimentEnabled('platform_editor_mention_node_avatar') || isExperimentEnabled('platform_editor_mention_node_graphql_provider'));
30
30
  if (isAvatarEnabled && mentionNodeDataProvider) {
31
31
  return /*#__PURE__*/React.createElement(MentionWithAvatarProviders, {
32
32
  id: id,
@@ -0,0 +1,20 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
+ /** Transaction metadata for contributors whose surface visibility changes without editing the document. */
3
+ export var BLOCK_CONTROLS_SURFACE_INVALIDATION = 'blockControlsSurfaceInvalidation';
4
+ /**
5
+ * Temporary shared helper for merging invalidations from independent contributors.
6
+ *
7
+ * This would ideally be owned by the Block Controls plugin, but Block Collapse also emits
8
+ * invalidations while Block Controls depends on it for collapsed-heading drag and move behavior.
9
+ * Moving this helper into Block Controls would therefore create a package dependency cycle.
10
+ * Keep it in editor-common until that dependency can be inverted or removed.
11
+ */
12
+ export var invalidateBlockControlsSurfaces = function invalidateBlockControlsSurfaces(tr, invalidation) {
13
+ var _previous$ids, _invalidation$ids, _previous$positions, _invalidation$positio, _previous$ranges, _invalidation$ranges;
14
+ var previous = tr.getMeta(BLOCK_CONTROLS_SURFACE_INVALIDATION);
15
+ return tr.setMeta(BLOCK_CONTROLS_SURFACE_INVALIDATION, {
16
+ ids: [].concat(_toConsumableArray((_previous$ids = previous === null || previous === void 0 ? void 0 : previous.ids) !== null && _previous$ids !== void 0 ? _previous$ids : []), _toConsumableArray((_invalidation$ids = invalidation.ids) !== null && _invalidation$ids !== void 0 ? _invalidation$ids : [])),
17
+ positions: [].concat(_toConsumableArray((_previous$positions = previous === null || previous === void 0 ? void 0 : previous.positions) !== null && _previous$positions !== void 0 ? _previous$positions : []), _toConsumableArray((_invalidation$positio = invalidation.positions) !== null && _invalidation$positio !== void 0 ? _invalidation$positio : [])),
18
+ ranges: [].concat(_toConsumableArray((_previous$ranges = previous === null || previous === void 0 ? void 0 : previous.ranges) !== null && _previous$ranges !== void 0 ? _previous$ranges : []), _toConsumableArray((_invalidation$ranges = invalidation.ranges) !== null && _invalidation$ranges !== void 0 ? _invalidation$ranges : []))
19
+ });
20
+ };
@@ -18,6 +18,10 @@ export var BLOCK_CONTROLS_LEFT_GROUP = {
18
18
  key: 'block-controls-left-group',
19
19
  type: 'group'
20
20
  };
21
+ export var BLOCK_CONTROLS_DRAG_HANDLE = {
22
+ key: 'block-controls-drag-handle',
23
+ type: 'button'
24
+ };
21
25
  export var BLOCK_CONTROLS_RIGHT_SECTION = {
22
26
  key: 'block-controls-right-section',
23
27
  type: 'section'
@@ -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 = "123.2.0";
22
+ var packageVersion = "123.3.0";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -5,6 +5,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
5
5
  /* eslint-disable @atlaskit/editor/no-re-export */
6
6
 
7
7
  import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
8
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
8
9
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
10
  var isPMNode = function isPMNode(nodeOrMark) {
10
11
  return nodeOrMark instanceof PMNode || Array.isArray(nodeOrMark.marks);
@@ -41,7 +42,7 @@ export var createProseMirrorMetadata = function createProseMirrorMetadata(nodeOr
41
42
  if (nodeOrMark.type.isInline) {
42
43
  commonAttributes['data-prosemirror-node-inline'] = 'true';
43
44
  }
44
- if ((options === null || options === void 0 ? void 0 : options.anchrorId) !== undefined && expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true)) {
45
+ if ((options === null || options === void 0 ? void 0 : options.anchrorId) !== undefined && (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) || isExperimentEnabled('platform_editor_block_control_migration'))) {
45
46
  commonAttributes['data-node-anchor'] = options.anchrorId;
46
47
  }
47
48
  return commonAttributes;
@@ -0,0 +1,111 @@
1
+ var DAM_ASSET_LINK = 'https://dam-cdn.atl.orangelogic.com/AssetLink';
2
+ var snippetPreviewImageUrlsByKey = {
3
+ // Action items
4
+ '019e5cd9-5ca1-7258-befd-4f50d491bb42': {
5
+ light: "".concat(DAM_ASSET_LINK, "/qq0503l11x2ub0506p2s046o2ep5gw1w.png"),
6
+ dark: "".concat(DAM_ASSET_LINK, "/i77e8128ir0e34t8w11mar77ngq53o00.png")
7
+ },
8
+ // Bug report
9
+ '019e5cd9-5ca1-7258-befd-1c3c59b0aa00': {
10
+ light: "".concat(DAM_ASSET_LINK, "/221f56s64c186314ka8a7uaj7m4di32l.png"),
11
+ dark: "".concat(DAM_ASSET_LINK, "/1c86e0v3ygh5ct5600luum0w67unpa23.png")
12
+ },
13
+ // Campaign brief
14
+ '019e5cd9-5ca1-7258-befd-398bb4e40f15': {
15
+ light: "".concat(DAM_ASSET_LINK, "/55j1ie55ad1nal6t3awxxui52rp47wn1.png"),
16
+ dark: "".concat(DAM_ASSET_LINK, "/36h5jgou0pw7v532411mbl501b8de4hm.png")
17
+ },
18
+ // Colorful layout
19
+ '019e5cd9-5ca1-7258-befd-53b6eec19427': {
20
+ light: "".concat(DAM_ASSET_LINK, "/53j8kth40pkysk4rqs64038r4cw2i867.png"),
21
+ dark: "".concat(DAM_ASSET_LINK, "/k7ofa1q6r10dydey04780514v75j3fvx.png")
22
+ },
23
+ // Colorful numbered table
24
+ '019e5cd9-5ca1-7258-befd-70a282facf16': {
25
+ light: "".concat(DAM_ASSET_LINK, "/f02n6041opl0rqvbygs2hv162mt6jq3u.png"),
26
+ dark: "".concat(DAM_ASSET_LINK, "/s63mw28263h0oi8we3x052m7rsw2o1k8.png")
27
+ },
28
+ // Colorful summary
29
+ '019e5cd9-5ca1-7258-befd-7e200502de8e': {
30
+ light: "".concat(DAM_ASSET_LINK, "/242qv11f2p7y1u461v71glq85x76b5gp.png"),
31
+ dark: "".concat(DAM_ASSET_LINK, "/jeaj3a8g7x61syy45d73c2223647b14j.png")
32
+ },
33
+ // Colorful table
34
+ '019e5cd9-5ca1-7258-befd-5524d394ba0a': {
35
+ light: "".concat(DAM_ASSET_LINK, "/8w8571k707dlx556rxr3hs72gs5q4m42.png"),
36
+ dark: "".concat(DAM_ASSET_LINK, "/wkt55v21i5q520pqxjh31x5g2j8upth4.png")
37
+ },
38
+ // Competitive snapshot
39
+ '019e5cd9-5ca1-7258-befd-40d1947b7b84': {
40
+ light: "".concat(DAM_ASSET_LINK, "/k5cm81s2h7i41d4d6832n67c2m767h6t.png"),
41
+ dark: "".concat(DAM_ASSET_LINK, "/ks38nc26451n7384d52413lck2qhq4e6.png")
42
+ },
43
+ // Criteria rubric
44
+ '019e5cd9-5ca1-7258-befd-84723a493931': {
45
+ light: "".concat(DAM_ASSET_LINK, "/n00f5ur678kbqdqjj5e13xpij6u3kkuq.png"),
46
+ dark: "".concat(DAM_ASSET_LINK, "/54k2y2f7n2tpg2n12is326376102c3b5.png")
47
+ },
48
+ // Customer quote
49
+ '019e5cd9-5ca1-7258-befd-5fcf6165870f': {
50
+ light: "".concat(DAM_ASSET_LINK, "/k8q5l4htp63652mhw572ed6chren37mv.png"),
51
+ dark: "".concat(DAM_ASSET_LINK, "/y0leijw14xp7mdpi3265xn0d5ymo5lfm.png")
52
+ },
53
+ // Decision log
54
+ '019e5cd9-5ca1-7258-befd-30c6e8712ba4': {
55
+ light: "".concat(DAM_ASSET_LINK, "/4vuxracm3c33555h1u4ug65q55267574.png"),
56
+ dark: "".concat(DAM_ASSET_LINK, "/5445044f626dcb58dbc7s6axr32e4ywl.png")
57
+ },
58
+ // Launch checklist
59
+ '019e5cd9-5ca1-7258-befd-3ce1c551015e': {
60
+ light: "".concat(DAM_ASSET_LINK, "/1o0gj47oprg341fe6iip8fdx8561t54n.png"),
61
+ dark: "".concat(DAM_ASSET_LINK, "/lay6kpn21b264q2q8144h3s18uwjud0f.png")
62
+ },
63
+ // Meeting agenda
64
+ '019e5cd9-5ca1-7258-befd-47559a8d7cfc': {
65
+ light: "".concat(DAM_ASSET_LINK, "/2hn6q5dt118vwyqi438725l141u70fb8.png"),
66
+ dark: "".concat(DAM_ASSET_LINK, "/r4l0ydb7ujg4lms6n0wrrnsmsd1x65kw.png")
67
+ },
68
+ // Project status snapshot
69
+ '019e5cd9-5ca1-7258-befd-2943939d1b79': {
70
+ light: "".concat(DAM_ASSET_LINK, "/qk6emfe0oa2260ldt11748672gs65y1l.png"),
71
+ dark: "".concat(DAM_ASSET_LINK, "/tt36rsll4cmq4607ik7g2d10fxmysyt4.png")
72
+ },
73
+ // Pros and cons
74
+ '019e5cd9-5ca1-7258-befd-6db9658d75f4': {
75
+ light: "".concat(DAM_ASSET_LINK, "/22078yl6viws8rc3au187m76x07xcu61.png"),
76
+ dark: "".concat(DAM_ASSET_LINK, "/4tfd6w50y4yxfh4ks75w5ql04u17n7ub.png")
77
+ },
78
+ // Quick project update
79
+ '019e5cd9-5ca1-7258-befd-820ce1acd7a0': {
80
+ light: "".concat(DAM_ASSET_LINK, "/i8cfkp8v6716121f0w054g85mkw15wgu.png"),
81
+ dark: "".concat(DAM_ASSET_LINK, "/x7a25y5f33ok60871t31e1my5c7880cr.png")
82
+ },
83
+ // Risks and assumptions
84
+ '019e5cd9-5ca1-7258-befd-2da95ce98772': {
85
+ light: "".concat(DAM_ASSET_LINK, "/yl7w10ms70ptlodhc703f6byo3wf7xty.png"),
86
+ dark: "".concat(DAM_ASSET_LINK, "/mn14wqw150cu05w3s358w3f2f1vfgv7r.png")
87
+ },
88
+ // Roles and responsibilities matrix
89
+ '019e5cd9-5ca1-7258-befd-37cd3a06776d': {
90
+ light: "".concat(DAM_ASSET_LINK, "/67hs5t8u4t63c4fepm6ho1c4d5u12bed.png"),
91
+ dark: "".concat(DAM_ASSET_LINK, "/wj5s3dy5nvb810t87f7x45cie88783h6.png")
92
+ },
93
+ // Run sheet
94
+ '019e5cd9-5ca1-7258-befd-4a9979f87235': {
95
+ light: "".concat(DAM_ASSET_LINK, "/tt0n285m6jl5lxb46c5v4fn856540351.png"),
96
+ dark: "".concat(DAM_ASSET_LINK, "/qcrcqcs14753208xqw1j8r38mgs57w2f.png")
97
+ },
98
+ // Started → Now
99
+ '019e5cd9-5ca1-7258-befd-74fb1585da6f': {
100
+ light: "".concat(DAM_ASSET_LINK, "/5ggat8yryusxvaqj3o800t8v6hcyh22v.png"),
101
+ dark: "".concat(DAM_ASSET_LINK, "/287u8yil1jb1j5p1fih0141h07k2f64w.png")
102
+ },
103
+ // Weekly calendar
104
+ '019e5cd9-5ca1-7258-befd-580c2c95a0a0': {
105
+ light: "".concat(DAM_ASSET_LINK, "/na153u604p852n54aji7aj1gf14431o7.png"),
106
+ dark: "".concat(DAM_ASSET_LINK, "/sw7m5s5ay718h025c6ed3gaq63orv4gu.png")
107
+ }
108
+ };
109
+ export var getSnippetPreviewImageUrls = function getSnippetPreviewImageUrls(snippetKey) {
110
+ return Object.prototype.hasOwnProperty.call(snippetPreviewImageUrlsByKey, snippetKey) ? snippetPreviewImageUrlsByKey[snippetKey] : undefined;
111
+ };
@@ -12,6 +12,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
12
12
  // oxlint-disable-next-line import/no-duplicates
13
13
 
14
14
  import { Plugin } from '@atlaskit/editor-prosemirror/state';
15
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
15
16
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
16
17
  import { isSSR } from '../core-utils/is-ssr';
17
18
  import { getNodeIdProvider } from '../node-anchor/node-anchor-provider';
@@ -38,7 +39,7 @@ export var attachGenericProseMirrorMetadata = function attachGenericProseMirrorM
38
39
  name = _ref3[0],
39
40
  value = _ref3[1];
40
41
  dom.setAttribute(name, value);
41
- if (name === 'data-node-anchor' && expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true)) {
42
+ if (name === 'data-node-anchor' && (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) || isExperimentEnabled('platform_editor_block_control_migration'))) {
42
43
  // if browser doesn't support CSS anchor, won't need the style
43
44
  // Or if it supports CSS attr() function as the value of anchor-name,
44
45
  // We won't need set the style
@@ -82,7 +83,7 @@ var wrapGetPosExceptions = function wrapGetPosExceptions(spec) {
82
83
  view = _argumentsList[1],
83
84
  unsafeGetPos = _argumentsList[2],
84
85
  more = _arrayLikeToArray(_argumentsList).slice(3);
85
- if (!nodeIdProvider && expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true)) {
86
+ if (!nodeIdProvider && (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) || isExperimentEnabled('platform_editor_block_control_migration'))) {
86
87
  nodeIdProvider = getNodeIdProvider(view);
87
88
  }
88
89
  var safeGetPos = function () {
@@ -101,7 +102,7 @@ var wrapGetPosExceptions = function wrapGetPosExceptions(spec) {
101
102
  var _nodeIdProvider;
102
103
  // we only attach metadata to the dom if its position is known
103
104
  var pos = safeGetPos();
104
- var options = pos !== undefined && expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) ? {
105
+ var options = pos !== undefined && (expValEquals('platform_editor_native_anchor_with_dnd', 'isEnabled', true) || isExperimentEnabled('platform_editor_block_control_migration')) ? {
105
106
  anchrorId: (_nodeIdProvider = nodeIdProvider) === null || _nodeIdProvider === void 0 ? void 0 : _nodeIdProvider.getOrGenerateId(node, pos)
106
107
  } : undefined;
107
108
  attachGenericProseMirrorMetadata({
@@ -1,18 +1,10 @@
1
- import { toJSON as unsanitizedNodeToJSON } from '@atlaskit/editor-json-transformer/toJSON';
2
- import { fg } from '@atlaskit/platform-feature-flags/fg';
3
1
  import { nodeToJSON } from '../utils/nodes';
4
2
  import { getSliceFromSelection } from './context-helpers';
5
3
 
6
4
  /**
7
- * Get the fragments from the selection.
8
- *
9
- * The result crosses an editor boundary — Remix, Rovo/convo-ai and AIFC treat it as persistable
10
- * ADF. The two same-named `nodeToJSON` exports are not interchangeable: `editor-json-transformer`'s
11
- * is a verbatim ProseMirror serialisation and leaks schema-only container variants such as
12
- * `panel_c1`, while `../utils/nodes` sanitises.
13
- *
14
- * `keepNestedTables: true` keeps the gate scoped to that strip — the sanitiser would otherwise also
15
- * rewrite nested tables into an extension carrying stringified ADF.
5
+ * Selection fragments cross an editor boundary: Remix, Rovo/convo-ai and AIFC consume them as
6
+ * persistable ADF, so schema-only container variants must be sanitized. Nested tables remain intact
7
+ * rather than being converted into extensions containing stringified ADF.
16
8
  */
17
9
  export var getFragmentsFromSelection = function getFragmentsFromSelection(selection) {
18
10
  if (!selection || selection.empty) {
@@ -20,12 +12,11 @@ export var getFragmentsFromSelection = function getFragmentsFromSelection(select
20
12
  }
21
13
  var slice = getSliceFromSelection(selection);
22
14
  var content = slice.content;
23
- var sanitizeFragments = fg('platform_editor_sanitize_selection_fragments');
24
15
  var fragment = [];
25
16
  content.forEach(function (node) {
26
- fragment.push(sanitizeFragments ? nodeToJSON(node, {
17
+ fragment.push(nodeToJSON(node, {
27
18
  keepNestedTables: true
28
- }) : unsanitizedNodeToJSON(node));
19
+ }));
29
20
  });
30
21
  return fragment;
31
22
  };
@@ -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 = "123.2.0";
24
+ var packageVersion = "123.3.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -44,10 +44,31 @@ export var messages = defineMessages({
44
44
  defaultMessage: 'Give this expand a title',
45
45
  description: 'aria label for an expand node title input field'
46
46
  },
47
- expandBodyAriaLabel: {
47
+ // Clean up with platform_editor_expand_content_a11y_2.
48
+ expandBodyAriaLabelOriginal: {
48
49
  id: 'fabric.editor.expandBodyAriaLabel',
49
50
  defaultMessage: 'Expand body content',
50
51
  description: 'Aria label for the body content of an expand node'
52
+ },
53
+ expandBodyAriaLabel: {
54
+ id: 'editor-common.Expand.expandBodyAriaLabel',
55
+ defaultMessage: 'Body content for {title}',
56
+ description: 'Aria label for the body content of an expand node'
57
+ },
58
+ expandBodyAriaLabelUntitled: {
59
+ id: 'editor-common.Expand.expandBodyAriaLabelUntitled',
60
+ defaultMessage: 'untitled expand',
61
+ description: 'Fallback title for the body content of an expand node without a title'
62
+ },
63
+ expandBodyAriaDescription: {
64
+ id: 'fabric.editor.expandBodyAriaDescription',
65
+ defaultMessage: 'Enter the content that will be revealed when this expand is opened.',
66
+ description: 'Aria description for the body content of an expand node'
67
+ },
68
+ expandBodyRoleDescription: {
69
+ id: 'fabric.editor.expandBodyRoleDescription',
70
+ defaultMessage: 'macro',
71
+ description: 'Aria role description for the body content of an expand node'
51
72
  }
52
73
  });
53
74
 
@@ -13,7 +13,6 @@ import React from 'react';
13
13
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
14
14
  import { css, jsx } from '@emotion/react';
15
15
  import { akEditorDefaultLayoutWidth, akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
16
- import { fg } from '@atlaskit/platform-feature-flags/fg';
17
16
  import { nonWrappedLayouts } from '../../utils';
18
17
  import { calcBreakoutWidth, calcWideWidth } from '../../utils/breakout';
19
18
  import { calcResizedWidth } from './calcResizedWidth';
@@ -225,11 +224,7 @@ MediaWrapper.displayName = 'WrapperMediaSingle';
225
224
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
226
225
  export var MediaBorderGapFiller = function MediaBorderGapFiller(_ref4) {
227
226
  var borderColor = _ref4.borderColor;
228
- // [FEATURE FLAG: platform_editor_media_border_radius_fix]
229
- // Fixes border radius to properly match image with 8px radius
230
- // To clean up: remove conditional, keep only flag-on behavior ('8px')
231
- var borderRadius = fg('platform_editor_media_border_radius_fix') ? "var(--ds-radius-large, 8px)" : '1px'; // OLD BEHAVIOR (to be removed when flag is cleaned up)
232
-
227
+ var borderRadius = "var(--ds-radius-large, 8px)";
233
228
  return jsx("div", {
234
229
  style: {
235
230
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
@@ -32,7 +32,7 @@ var Mention = /*#__PURE__*/function (_PureComponent) {
32
32
  mentionNodeDataProvider = _this$props.mentionNodeDataProvider;
33
33
  var mentionProvider = providers.mentionProvider,
34
34
  profilecardProvider = providers.profilecardProvider;
35
- var isAvatarEnabled = Boolean(mentionNodeDataProvider) && userType !== 'SPECIAL' && !GENERIC_MENTION_IDS.includes(id) && isExperimentEnabled('platform_editor_mention_node_avatar');
35
+ var isAvatarEnabled = Boolean(mentionNodeDataProvider) && userType !== 'SPECIAL' && !GENERIC_MENTION_IDS.includes(id) && (isExperimentEnabled('platform_editor_mention_node_avatar') || isExperimentEnabled('platform_editor_mention_node_graphql_provider'));
36
36
  if (isAvatarEnabled && mentionNodeDataProvider) {
37
37
  return /*#__PURE__*/React.createElement(MentionWithAvatarProviders, {
38
38
  id: id,
@@ -25,6 +25,7 @@ export type BlockControlUIContextActiveNode = BlockControlUIContextNode & {
25
25
  };
26
26
  /** Context supplied to controls rendered on a block-controls surface. */
27
27
  export type BlockControlUIContext = {
28
+ activeControlKey?: string;
28
29
  activeNode?: BlockControlUIContextActiveNode;
29
30
  rootNode: BlockControlUIContextNode;
30
31
  targetNode: BlockControlUIContextNode;
@@ -0,0 +1,21 @@
1
+ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
+ /** Transaction metadata for contributors whose surface visibility changes without editing the document. */
3
+ export declare const BLOCK_CONTROLS_SURFACE_INVALIDATION = "blockControlsSurfaceInvalidation";
4
+ export type BlockControlsSurfaceInvalidation = {
5
+ /** Match local IDs against retained candidates, without searching the document. */
6
+ ids?: readonly string[];
7
+ positions?: readonly number[];
8
+ ranges?: readonly {
9
+ from: number;
10
+ to: number;
11
+ }[];
12
+ };
13
+ /**
14
+ * Temporary shared helper for merging invalidations from independent contributors.
15
+ *
16
+ * This would ideally be owned by the Block Controls plugin, but Block Collapse also emits
17
+ * invalidations while Block Controls depends on it for collapsed-heading drag and move behavior.
18
+ * Moving this helper into Block Controls would therefore create a package dependency cycle.
19
+ * Keep it in editor-common until that dependency can be inverted or removed.
20
+ */
21
+ export declare const invalidateBlockControlsSurfaces: (tr: Transaction, invalidation: BlockControlsSurfaceInvalidation) => Transaction;
@@ -18,6 +18,10 @@ export declare const BLOCK_CONTROLS_LEFT_GROUP: {
18
18
  readonly key: 'block-controls-left-group';
19
19
  readonly type: 'group';
20
20
  };
21
+ export declare const BLOCK_CONTROLS_DRAG_HANDLE: {
22
+ readonly key: 'block-controls-drag-handle';
23
+ readonly type: 'button';
24
+ };
21
25
  export declare const BLOCK_CONTROLS_RIGHT_SECTION: {
22
26
  readonly key: 'block-controls-right-section';
23
27
  readonly type: 'section';
@@ -0,0 +1,6 @@
1
+ type SnippetPreviewImageUrls = {
2
+ dark: string;
3
+ light: string;
4
+ };
5
+ export declare const getSnippetPreviewImageUrls: (snippetKey: string) => SnippetPreviewImageUrls | undefined;
6
+ export {};
@@ -1,14 +1,8 @@
1
1
  import type { JSONNode } from '@atlaskit/editor-json-transformer/types';
2
2
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
3
3
  /**
4
- * Get the fragments from the selection.
5
- *
6
- * The result crosses an editor boundary — Remix, Rovo/convo-ai and AIFC treat it as persistable
7
- * ADF. The two same-named `nodeToJSON` exports are not interchangeable: `editor-json-transformer`'s
8
- * is a verbatim ProseMirror serialisation and leaks schema-only container variants such as
9
- * `panel_c1`, while `../utils/nodes` sanitises.
10
- *
11
- * `keepNestedTables: true` keeps the gate scoped to that strip — the sanitiser would otherwise also
12
- * rewrite nested tables into an extension carrying stringified ADF.
4
+ * Selection fragments cross an editor boundary: Remix, Rovo/convo-ai and AIFC consume them as
5
+ * persistable ADF, so schema-only container variants must be sanitized. Nested tables remain intact
6
+ * rather than being converted into extensions containing stringified ADF.
13
7
  */
14
8
  export declare const getFragmentsFromSelection: (selection?: Selection) => JSONNode[] | null;
@@ -329,6 +329,13 @@ export interface FloatingToolbarConfig {
329
329
  align?: AlignType;
330
330
  /** Class added to Toolbar wrapper */
331
331
  className?: string;
332
+ /**
333
+ * Controls the Toolbar wrapper's own visual surface (background, shadow, border radius,
334
+ * padding). Set to `'none'` when a single custom item already renders its own complete
335
+ * surface (e.g. a custom link picker component), so the wrapper's surface isn't duplicated
336
+ * behind it. Defaults to `'default'` (the wrapper's surface, as today).
337
+ */
338
+ containerSurface?: 'default' | 'none';
332
339
  /**
333
340
  * Enable Popup component's focus trap
334
341
  */
@@ -8,8 +8,12 @@ export type LinkInputType = INPUT_METHOD.MANUAL | INPUT_METHOD.TYPEAHEAD;
8
8
  * Extends `LinkPickerProps` to provide future extensibility out-of-the-box.
9
9
  * Use `popupWidth` and `popupHeight` to control the editor popup container size
10
10
  * when providing a custom `component` with non-standard dimensions.
11
+ * Use `popupContainerSurface: 'none'` when that `component` renders its own complete
12
+ * surface (background, shadow, border radius, padding), so the popup wrapper's own
13
+ * surface isn't duplicated behind it. Defaults to `'default'` (the wrapper's surface).
11
14
  */
12
15
  export type LinkPickerOptions = Partial<LinkPickerProps> & {
16
+ popupContainerSurface?: 'default' | 'none';
13
17
  popupHeight?: number;
14
18
  popupWidth?: number;
15
19
  };
@@ -16,11 +16,31 @@ export declare const messages: {
16
16
  description: string;
17
17
  id: string;
18
18
  };
19
+ expandBodyAriaDescription: {
20
+ defaultMessage: string;
21
+ description: string;
22
+ id: string;
23
+ };
19
24
  expandBodyAriaLabel: {
20
25
  defaultMessage: string;
21
26
  description: string;
22
27
  id: string;
23
28
  };
29
+ expandBodyAriaLabelOriginal: {
30
+ defaultMessage: string;
31
+ description: string;
32
+ id: string;
33
+ };
34
+ expandBodyAriaLabelUntitled: {
35
+ defaultMessage: string;
36
+ description: string;
37
+ id: string;
38
+ };
39
+ expandBodyRoleDescription: {
40
+ defaultMessage: string;
41
+ description: string;
42
+ id: string;
43
+ };
24
44
  expandDefaultTitle: {
25
45
  defaultMessage: string;
26
46
  description: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "123.2.1",
3
+ "version": "123.4.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/"
@@ -37,7 +37,7 @@
37
37
  "@atlaskit/analytics-next": "^12.5.0",
38
38
  "@atlaskit/atlassian-context": "^1.2.0",
39
39
  "@atlaskit/browser-apis": "^1.2.0",
40
- "@atlaskit/button": "^25.3.0",
40
+ "@atlaskit/button": "^25.4.0",
41
41
  "@atlaskit/codemod-utils": "^5.1.0",
42
42
  "@atlaskit/css": "^1.1.0",
43
43
  "@atlaskit/custom-steps": "^1.1.0",
@@ -49,7 +49,7 @@
49
49
  "@atlaskit/editor-tables": "^3.2.0",
50
50
  "@atlaskit/editor-toolbar": "^2.7.0",
51
51
  "@atlaskit/editor-toolbar-model": "^1.2.0",
52
- "@atlaskit/editor-ui-control-model": "^2.9.0",
52
+ "@atlaskit/editor-ui-control-model": "^2.10.0",
53
53
  "@atlaskit/emoji": "^72.4.0",
54
54
  "@atlaskit/feature-gate-js-client": "^6.0.0",
55
55
  "@atlaskit/icon": "^37.7.0",
@@ -78,7 +78,7 @@
78
78
  "@atlaskit/react-compiler-gating": "^0.2.0",
79
79
  "@atlaskit/react-ufo": "^7.13.0",
80
80
  "@atlaskit/section-message": "^10.2.0",
81
- "@atlaskit/smart-card": "^45.24.0",
81
+ "@atlaskit/smart-card": "^45.25.0",
82
82
  "@atlaskit/smart-user-picker": "^11.8.0",
83
83
  "@atlaskit/spinner": "^20.4.0",
84
84
  "@atlaskit/task-decision": "^21.10.0",
@@ -170,9 +170,6 @@
170
170
  "type": "boolean",
171
171
  "referenceOnly": true
172
172
  },
173
- "platform_editor_sanitize_selection_fragments": {
174
- "type": "boolean"
175
- },
176
173
  "platform-dst-popper-consolidation": {
177
174
  "type": "boolean",
178
175
  "referenceOnly": true
@@ -226,9 +223,6 @@
226
223
  "jim-lower-ranking-in-jira-macro-search": {
227
224
  "type": "boolean"
228
225
  },
229
- "platform_editor_media_border_radius_fix": {
230
- "type": "boolean"
231
- },
232
226
  "people-teams_migrate-user-profile-card": {
233
227
  "type": "boolean"
234
228
  },
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/quick-insert/snippet-preview-image-urls",
3
+ "main": "../../dist/cjs/quick-insert/snippetPreviewImageUrls.js",
4
+ "module": "../../dist/esm/quick-insert/snippetPreviewImageUrls.js",
5
+ "module:es2019": "../../dist/es2019/quick-insert/snippetPreviewImageUrls.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../../dist/types/quick-insert/snippetPreviewImageUrls.d.ts"
10
+ }