@atlaskit/editor-common 107.26.1 → 107.27.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 (39) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/block-menu/package.json +17 -0
  3. package/dist/cjs/ai-messages/ai.js +5 -0
  4. package/dist/cjs/block-menu/index.js +12 -0
  5. package/dist/cjs/block-menu/messages.js +14 -0
  6. package/dist/cjs/copy-button/index.js +35 -0
  7. package/dist/cjs/monitoring/error.js +1 -1
  8. package/dist/cjs/node-anchor/node-anchor-provider.js +5 -0
  9. package/dist/cjs/preset/core-plugin/index.js +9 -0
  10. package/dist/cjs/ui/DropList/index.js +1 -1
  11. package/dist/es2019/ai-messages/ai.js +5 -0
  12. package/dist/es2019/block-menu/index.js +2 -0
  13. package/dist/es2019/block-menu/messages.js +8 -0
  14. package/dist/es2019/copy-button/index.js +34 -0
  15. package/dist/es2019/monitoring/error.js +1 -1
  16. package/dist/es2019/node-anchor/node-anchor-provider.js +3 -0
  17. package/dist/es2019/preset/core-plugin/index.js +9 -0
  18. package/dist/es2019/ui/DropList/index.js +1 -1
  19. package/dist/esm/ai-messages/ai.js +5 -0
  20. package/dist/esm/block-menu/index.js +2 -0
  21. package/dist/esm/block-menu/messages.js +8 -0
  22. package/dist/esm/copy-button/index.js +34 -0
  23. package/dist/esm/monitoring/error.js +1 -1
  24. package/dist/esm/node-anchor/node-anchor-provider.js +5 -0
  25. package/dist/esm/preset/core-plugin/index.js +9 -0
  26. package/dist/esm/ui/DropList/index.js +1 -1
  27. package/dist/types/ai-messages/ai.d.ts +5 -0
  28. package/dist/types/block-menu/index.d.ts +1 -0
  29. package/dist/types/block-menu/messages.d.ts +7 -0
  30. package/dist/types/copy-button/index.d.ts +2 -1
  31. package/dist/types/node-anchor/node-anchor-provider.d.ts +1 -0
  32. package/dist/types/types/next-editor-plugin.d.ts +8 -1
  33. package/dist/types-ts4.5/ai-messages/ai.d.ts +5 -0
  34. package/dist/types-ts4.5/block-menu/index.d.ts +1 -0
  35. package/dist/types-ts4.5/block-menu/messages.d.ts +7 -0
  36. package/dist/types-ts4.5/copy-button/index.d.ts +2 -1
  37. package/dist/types-ts4.5/node-anchor/node-anchor-provider.d.ts +1 -0
  38. package/dist/types-ts4.5/types/next-editor-plugin.d.ts +8 -1
  39. package/package.json +6 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 107.27.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`1dc35286ebb8a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1dc35286ebb8a) -
8
+ [ux] [EDITOR-1064] Added rovo menu on current selection toolbar
9
+ - [`e05e3e8cd0659`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e05e3e8cd0659) -
10
+ ED-28776 implement native anchor api
11
+
12
+ ## 107.26.2
13
+
14
+ ### Patch Changes
15
+
16
+ - [`31fc6b9e10762`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/31fc6b9e10762) -
17
+ [ux] ED-28592 ED-28592:Add copy block menu item to block menu
18
+ - Updated dependencies
19
+
3
20
  ## 107.26.1
4
21
 
5
22
  ### Patch Changes
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/block-menu",
3
+ "main": "../dist/cjs/block-menu/index.js",
4
+ "module": "../dist/esm/block-menu/index.js",
5
+ "module:es2019": "../dist/es2019/block-menu/index.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../dist/types/block-menu/index.d.ts",
10
+ "typesVersions": {
11
+ ">=4.5 <5.9": {
12
+ "*": [
13
+ "../dist/types-ts4.5/block-menu/index.d.ts"
14
+ ]
15
+ }
16
+ }
17
+ }
@@ -63,6 +63,11 @@ var aiMessages = exports.aiMessages = (0, _reactIntlNext.defineMessages)({
63
63
  defaultMessage: "Ask AI {key}+'",
64
64
  description: 'Tooltip text for an option to use Atlassian Intellgience with quick command'
65
65
  },
66
+ askRovoToolbarIconTooltipQuickCommand: {
67
+ id: 'fabric.editor.ai.toolbar.askRovo.tooltip.quickCommand',
68
+ defaultMessage: "Ask Rovo {key}+'",
69
+ description: 'Tooltip text for an option to use Rovo AI with quick command'
70
+ },
66
71
  tryAIToolbarIconTitle: {
67
72
  id: 'fabric.editor.ai.toolbar.tryAI.title',
68
73
  defaultMessage: 'Try AI',
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "messages", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _messages.messages;
10
+ }
11
+ });
12
+ var _messages = require("./messages");
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.messages = void 0;
7
+ var _reactIntlNext = require("react-intl-next");
8
+ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
9
+ copyBlock: {
10
+ id: 'fabric.editor.block.menu.copy.block',
11
+ defaultMessage: 'Copy Block',
12
+ description: 'Copy the selected block to the clipboard'
13
+ }
14
+ });
@@ -3,10 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.copyDomNode = void 0;
6
7
  exports.getSelectedNodeOrNodeParentByNodeType = getSelectedNodeOrNodeParentByNodeType;
7
8
  exports.toDOM = void 0;
8
9
  var _model = require("@atlaskit/editor-prosemirror/model");
10
+ var _state = require("@atlaskit/editor-prosemirror/state");
9
11
  var _utils = require("@atlaskit/editor-prosemirror/utils");
12
+ var _clipboard = require("../clipboard");
13
+ var _utils2 = require("../utils");
10
14
  function getSelectedNodeOrNodeParentByNodeType(_ref) {
11
15
  var nodeType = _ref.nodeType,
12
16
  selection = _ref.selection;
@@ -18,4 +22,35 @@ function getSelectedNodeOrNodeParentByNodeType(_ref) {
18
22
  }
19
23
  var toDOM = exports.toDOM = function toDOM(node, schema) {
20
24
  return _model.DOMSerializer.fromSchema(schema).serializeNode(node);
25
+ };
26
+ var copyDomNode = exports.copyDomNode = function copyDomNode(domNode, nodeType, selection) {
27
+ if (domNode) {
28
+ var div = document.createElement('div');
29
+ div.appendChild(domNode);
30
+ var schema = selection.$from.doc.type.schema;
31
+
32
+ // if copying inline content
33
+ if (nodeType.inlineContent) {
34
+ // The "1 1" refers to the start and end depth of the slice
35
+ // since we're copying the text inside a paragraph, it will always be 1 1
36
+ // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
37
+ // Ignored via go/ees005
38
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
39
+ div.firstChild.setAttribute('data-pm-slice', '1 1 []');
40
+ } else {
41
+ // The "0 0" refers to the start and end depth of the slice
42
+ // since we're copying the block node only, it will always be 0 0
43
+ // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
44
+ // Ignored via go/ees005
45
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
46
+ div.firstChild.setAttribute('data-pm-slice', '0 0 []');
47
+ }
48
+ // ED-17083 safari seems have bugs for extension copy because exntension do not have a child text(innerText) and it will not recognized as html in clipboard, this could be merge into one if this extension fixed children issue or safari fix the copy bug
49
+ // MEX-2528 safari has a bug related to the mediaSingle node with border or link. The image tag within the clipboard is not recognized as HTML when using the ClipboardItem API. To address this, we have to switch to ClipboardPolyfill
50
+ if (_utils2.browser.safari && selection instanceof _state.NodeSelection && (selection.node.type === schema.nodes.extension || selection.node.type === schema.nodes.mediaSingle)) {
51
+ (0, _clipboard.copyHTMLToClipboardPolyfill)(div);
52
+ } else {
53
+ (0, _clipboard.copyHTMLToClipboard)(div);
54
+ }
55
+ }
21
56
  };
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
16
16
  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); }
17
17
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
18
18
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
19
- var packageVersion = "107.26.0";
19
+ var packageVersion = "107.26.2";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // Ignored via go/ees007
@@ -35,6 +35,11 @@ var NodeAnchorProvider = exports.NodeAnchorProvider = /*#__PURE__*/function () {
35
35
  this.cache.set(node, anchorName);
36
36
  return anchorName;
37
37
  }
38
+ }, {
39
+ key: "getIdForNode",
40
+ value: function getIdForNode(node) {
41
+ return this.cache.get(node) || undefined;
42
+ }
38
43
  }]);
39
44
  }();
40
45
  var nodeIdProviderMap = new WeakMap();
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.corePlugin = void 0;
7
7
  var _model = require("@atlaskit/editor-prosemirror/model");
8
8
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
9
+ var _nodeAnchorProvider = require("../../node-anchor/node-anchor-provider");
9
10
  var _processRawValue = require("../../utils/processRawValue");
10
11
  var _editorCommands = require("../editor-commands");
11
12
  var _requestDocument = require("./requestDocument");
@@ -125,6 +126,14 @@ var corePlugin = exports.corePlugin = function corePlugin(_ref) {
125
126
  return undefined;
126
127
  }
127
128
  return cb(view === null || view === void 0 ? void 0 : view.state.schema);
129
+ },
130
+ getAnchorIdForNode: function getAnchorIdForNode(node) {
131
+ var _config$getEditorView3;
132
+ var view = (_config$getEditorView3 = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView3 !== void 0 ? _config$getEditorView3 : null;
133
+ if (!view) {
134
+ return undefined;
135
+ }
136
+ return (0, _nodeAnchorProvider.getNodeIdProvider)(view).getIdForNode(node);
128
137
  }
129
138
  }
130
139
  };
@@ -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 = "107.26.0";
27
+ var packageVersion = "107.26.2";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -57,6 +57,11 @@ export const aiMessages = defineMessages({
57
57
  defaultMessage: "Ask AI {key}+'",
58
58
  description: 'Tooltip text for an option to use Atlassian Intellgience with quick command'
59
59
  },
60
+ askRovoToolbarIconTooltipQuickCommand: {
61
+ id: 'fabric.editor.ai.toolbar.askRovo.tooltip.quickCommand',
62
+ defaultMessage: "Ask Rovo {key}+'",
63
+ description: 'Tooltip text for an option to use Rovo AI with quick command'
64
+ },
60
65
  tryAIToolbarIconTitle: {
61
66
  id: 'fabric.editor.ai.toolbar.tryAI.title',
62
67
  defaultMessage: 'Try AI',
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { messages } from './messages';
@@ -0,0 +1,8 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export const messages = defineMessages({
3
+ copyBlock: {
4
+ id: 'fabric.editor.block.menu.copy.block',
5
+ defaultMessage: 'Copy Block',
6
+ description: 'Copy the selected block to the clipboard'
7
+ }
8
+ });
@@ -1,5 +1,8 @@
1
1
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
2
+ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
2
3
  import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
4
+ import { copyHTMLToClipboard, copyHTMLToClipboardPolyfill } from '../clipboard';
5
+ import { browser } from '../utils';
3
6
  export function getSelectedNodeOrNodeParentByNodeType({
4
7
  nodeType,
5
8
  selection
@@ -12,4 +15,35 @@ export function getSelectedNodeOrNodeParentByNodeType({
12
15
  }
13
16
  export const toDOM = (node, schema) => {
14
17
  return DOMSerializer.fromSchema(schema).serializeNode(node);
18
+ };
19
+ export const copyDomNode = (domNode, nodeType, selection) => {
20
+ if (domNode) {
21
+ const div = document.createElement('div');
22
+ div.appendChild(domNode);
23
+ const schema = selection.$from.doc.type.schema;
24
+
25
+ // if copying inline content
26
+ if (nodeType.inlineContent) {
27
+ // The "1 1" refers to the start and end depth of the slice
28
+ // since we're copying the text inside a paragraph, it will always be 1 1
29
+ // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
30
+ // Ignored via go/ees005
31
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
32
+ div.firstChild.setAttribute('data-pm-slice', '1 1 []');
33
+ } else {
34
+ // The "0 0" refers to the start and end depth of the slice
35
+ // since we're copying the block node only, it will always be 0 0
36
+ // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
37
+ // Ignored via go/ees005
38
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
39
+ div.firstChild.setAttribute('data-pm-slice', '0 0 []');
40
+ }
41
+ // ED-17083 safari seems have bugs for extension copy because exntension do not have a child text(innerText) and it will not recognized as html in clipboard, this could be merge into one if this extension fixed children issue or safari fix the copy bug
42
+ // MEX-2528 safari has a bug related to the mediaSingle node with border or link. The image tag within the clipboard is not recognized as HTML when using the ClipboardItem API. To address this, we have to switch to ClipboardPolyfill
43
+ if (browser.safari && selection instanceof NodeSelection && (selection.node.type === schema.nodes.extension || selection.node.type === schema.nodes.mediaSingle)) {
44
+ copyHTMLToClipboardPolyfill(div);
45
+ } else {
46
+ copyHTMLToClipboard(div);
47
+ }
48
+ }
15
49
  };
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "107.26.0";
4
+ const packageVersion = "107.26.2";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // Ignored via go/ees007
@@ -22,6 +22,9 @@ export class NodeAnchorProvider {
22
22
  this.cache.set(node, anchorName);
23
23
  return anchorName;
24
24
  }
25
+ getIdForNode(node) {
26
+ return this.cache.get(node) || undefined;
27
+ }
25
28
  }
26
29
  const nodeIdProviderMap = new WeakMap();
27
30
 
@@ -1,5 +1,6 @@
1
1
  import { Node } from '@atlaskit/editor-prosemirror/model';
2
2
  import { fg } from '@atlaskit/platform-feature-flags';
3
+ import { getNodeIdProvider } from '../../node-anchor/node-anchor-provider';
3
4
  import { processRawFragmentValue, processRawValue, processRawValueWithoutValidation } from '../../utils/processRawValue';
4
5
  import { editorCommandToPMCommand } from '../editor-commands';
5
6
  import { createThrottleSchedule, returnDocumentRequest } from './requestDocument';
@@ -127,6 +128,14 @@ export const corePlugin = ({
127
128
  return undefined;
128
129
  }
129
130
  return cb(view === null || view === void 0 ? void 0 : view.state.schema);
131
+ },
132
+ getAnchorIdForNode(node) {
133
+ var _config$getEditorView3;
134
+ const view = (_config$getEditorView3 = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView3 !== void 0 ? _config$getEditorView3 : null;
135
+ if (!view) {
136
+ return undefined;
137
+ }
138
+ return getNodeIdProvider(view).getIdForNode(node);
130
139
  }
131
140
  }
132
141
  };
@@ -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 = "107.26.0";
17
+ const packageVersion = "107.26.2";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -57,6 +57,11 @@ export var aiMessages = defineMessages({
57
57
  defaultMessage: "Ask AI {key}+'",
58
58
  description: 'Tooltip text for an option to use Atlassian Intellgience with quick command'
59
59
  },
60
+ askRovoToolbarIconTooltipQuickCommand: {
61
+ id: 'fabric.editor.ai.toolbar.askRovo.tooltip.quickCommand',
62
+ defaultMessage: "Ask Rovo {key}+'",
63
+ description: 'Tooltip text for an option to use Rovo AI with quick command'
64
+ },
60
65
  tryAIToolbarIconTitle: {
61
66
  id: 'fabric.editor.ai.toolbar.tryAI.title',
62
67
  defaultMessage: 'Try AI',
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { messages } from './messages';
@@ -0,0 +1,8 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export var messages = defineMessages({
3
+ copyBlock: {
4
+ id: 'fabric.editor.block.menu.copy.block',
5
+ defaultMessage: 'Copy Block',
6
+ description: 'Copy the selected block to the clipboard'
7
+ }
8
+ });
@@ -1,5 +1,8 @@
1
1
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
2
+ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
2
3
  import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
4
+ import { copyHTMLToClipboard, copyHTMLToClipboardPolyfill } from '../clipboard';
5
+ import { browser } from '../utils';
3
6
  export function getSelectedNodeOrNodeParentByNodeType(_ref) {
4
7
  var nodeType = _ref.nodeType,
5
8
  selection = _ref.selection;
@@ -11,4 +14,35 @@ export function getSelectedNodeOrNodeParentByNodeType(_ref) {
11
14
  }
12
15
  export var toDOM = function toDOM(node, schema) {
13
16
  return DOMSerializer.fromSchema(schema).serializeNode(node);
17
+ };
18
+ export var copyDomNode = function copyDomNode(domNode, nodeType, selection) {
19
+ if (domNode) {
20
+ var div = document.createElement('div');
21
+ div.appendChild(domNode);
22
+ var schema = selection.$from.doc.type.schema;
23
+
24
+ // if copying inline content
25
+ if (nodeType.inlineContent) {
26
+ // The "1 1" refers to the start and end depth of the slice
27
+ // since we're copying the text inside a paragraph, it will always be 1 1
28
+ // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
29
+ // Ignored via go/ees005
30
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
31
+ div.firstChild.setAttribute('data-pm-slice', '1 1 []');
32
+ } else {
33
+ // The "0 0" refers to the start and end depth of the slice
34
+ // since we're copying the block node only, it will always be 0 0
35
+ // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
36
+ // Ignored via go/ees005
37
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
38
+ div.firstChild.setAttribute('data-pm-slice', '0 0 []');
39
+ }
40
+ // ED-17083 safari seems have bugs for extension copy because exntension do not have a child text(innerText) and it will not recognized as html in clipboard, this could be merge into one if this extension fixed children issue or safari fix the copy bug
41
+ // MEX-2528 safari has a bug related to the mediaSingle node with border or link. The image tag within the clipboard is not recognized as HTML when using the ClipboardItem API. To address this, we have to switch to ClipboardPolyfill
42
+ if (browser.safari && selection instanceof NodeSelection && (selection.node.type === schema.nodes.extension || selection.node.type === schema.nodes.mediaSingle)) {
43
+ copyHTMLToClipboardPolyfill(div);
44
+ } else {
45
+ copyHTMLToClipboard(div);
46
+ }
47
+ }
14
48
  };
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "107.26.0";
10
+ var packageVersion = "107.26.2";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // Ignored via go/ees007
@@ -28,6 +28,11 @@ export var NodeAnchorProvider = /*#__PURE__*/function () {
28
28
  this.cache.set(node, anchorName);
29
29
  return anchorName;
30
30
  }
31
+ }, {
32
+ key: "getIdForNode",
33
+ value: function getIdForNode(node) {
34
+ return this.cache.get(node) || undefined;
35
+ }
31
36
  }]);
32
37
  }();
33
38
  var nodeIdProviderMap = new WeakMap();
@@ -1,5 +1,6 @@
1
1
  import { Node } from '@atlaskit/editor-prosemirror/model';
2
2
  import { fg } from '@atlaskit/platform-feature-flags';
3
+ import { getNodeIdProvider } from '../../node-anchor/node-anchor-provider';
3
4
  import { processRawFragmentValue, processRawValue, processRawValueWithoutValidation } from '../../utils/processRawValue';
4
5
  import { editorCommandToPMCommand } from '../editor-commands';
5
6
  import { createThrottleSchedule, returnDocumentRequest } from './requestDocument';
@@ -120,6 +121,14 @@ export var corePlugin = function corePlugin(_ref) {
120
121
  return undefined;
121
122
  }
122
123
  return cb(view === null || view === void 0 ? void 0 : view.state.schema);
124
+ },
125
+ getAnchorIdForNode: function getAnchorIdForNode(node) {
126
+ var _config$getEditorView3;
127
+ var view = (_config$getEditorView3 = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView3 !== void 0 ? _config$getEditorView3 : null;
128
+ if (!view) {
129
+ return undefined;
130
+ }
131
+ return getNodeIdProvider(view).getIdForNode(node);
123
132
  }
124
133
  }
125
134
  };
@@ -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 = "107.26.0";
24
+ var packageVersion = "107.26.2";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -54,6 +54,11 @@ export declare const aiMessages: {
54
54
  defaultMessage: string;
55
55
  description: string;
56
56
  };
57
+ askRovoToolbarIconTooltipQuickCommand: {
58
+ id: string;
59
+ defaultMessage: string;
60
+ description: string;
61
+ };
57
62
  tryAIToolbarIconTitle: {
58
63
  id: string;
59
64
  defaultMessage: string;
@@ -0,0 +1 @@
1
+ export { messages } from './messages';
@@ -0,0 +1,7 @@
1
+ export declare const messages: {
2
+ copyBlock: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ };
@@ -1,8 +1,9 @@
1
1
  import type { NodeType, Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
2
- import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
+ import type { Transaction, Selection } from '@atlaskit/editor-prosemirror/state';
3
3
  import { type ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
4
4
  export declare function getSelectedNodeOrNodeParentByNodeType({ nodeType, selection, }: {
5
5
  nodeType: NodeType | Array<NodeType>;
6
6
  selection: Transaction['selection'];
7
7
  }): ContentNodeWithPos | undefined;
8
8
  export declare const toDOM: (node: PMNode, schema: Schema) => Node;
9
+ export declare const copyDomNode: (domNode: Node, nodeType: NodeType, selection: Selection) => void;
@@ -5,5 +5,6 @@ export declare class NodeAnchorProvider {
5
5
  private count;
6
6
  private existingPos;
7
7
  getOrGenerateId(node: PMNode, pos: number): string | null;
8
+ getIdForNode(node: PMNode): string | undefined;
8
9
  }
9
10
  export declare const getNodeIdProvider: (editorView: EditorView) => NodeAnchorProvider;
@@ -5,7 +5,7 @@
5
5
  * are put together - but for now `Builder` & `Preset` aim to beinterchangeable.
6
6
  */
7
7
  import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
8
- import type { Fragment, Node, Schema } from '@atlaskit/editor-prosemirror/model';
8
+ import type { Fragment, Node, Schema, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
9
9
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
10
10
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
11
11
  import type { FireAnalyticsCallback } from '../analytics';
@@ -98,6 +98,13 @@ export type CorePlugin = NextEditorPlugin<'core', {
98
98
  * @returns Transformer which can be used to request a document
99
99
  */
100
100
  createTransformer<Format>(cb: (schema: Schema) => Transformer<Format>): Transformer<Format> | undefined;
101
+ /**
102
+ * Get the anchor ID for a ProseMirror node.
103
+ *
104
+ * @param node - The ProseMirror node to get the anchor ID for.
105
+ * @returns The anchor ID if found, otherwise undefined.
106
+ */
107
+ getAnchorIdForNode: (node: PMNode) => string | undefined;
101
108
  };
102
109
  }>;
103
110
  export type TransformerResult<GenericTransformer = Transformer<JSONDocNode>> = GenericTransformer extends Transformer<infer Content> ? Content : JSONDocNode;
@@ -54,6 +54,11 @@ export declare const aiMessages: {
54
54
  defaultMessage: string;
55
55
  description: string;
56
56
  };
57
+ askRovoToolbarIconTooltipQuickCommand: {
58
+ id: string;
59
+ defaultMessage: string;
60
+ description: string;
61
+ };
57
62
  tryAIToolbarIconTitle: {
58
63
  id: string;
59
64
  defaultMessage: string;
@@ -0,0 +1 @@
1
+ export { messages } from './messages';
@@ -0,0 +1,7 @@
1
+ export declare const messages: {
2
+ copyBlock: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ };
@@ -1,8 +1,9 @@
1
1
  import type { NodeType, Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
2
- import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
+ import type { Transaction, Selection } from '@atlaskit/editor-prosemirror/state';
3
3
  import { type ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
4
4
  export declare function getSelectedNodeOrNodeParentByNodeType({ nodeType, selection, }: {
5
5
  nodeType: NodeType | Array<NodeType>;
6
6
  selection: Transaction['selection'];
7
7
  }): ContentNodeWithPos | undefined;
8
8
  export declare const toDOM: (node: PMNode, schema: Schema) => Node;
9
+ export declare const copyDomNode: (domNode: Node, nodeType: NodeType, selection: Selection) => void;
@@ -5,5 +5,6 @@ export declare class NodeAnchorProvider {
5
5
  private count;
6
6
  private existingPos;
7
7
  getOrGenerateId(node: PMNode, pos: number): string | null;
8
+ getIdForNode(node: PMNode): string | undefined;
8
9
  }
9
10
  export declare const getNodeIdProvider: (editorView: EditorView) => NodeAnchorProvider;
@@ -5,7 +5,7 @@
5
5
  * are put together - but for now `Builder` & `Preset` aim to beinterchangeable.
6
6
  */
7
7
  import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
8
- import type { Fragment, Node, Schema } from '@atlaskit/editor-prosemirror/model';
8
+ import type { Fragment, Node, Schema, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
9
9
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
10
10
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
11
11
  import type { FireAnalyticsCallback } from '../analytics';
@@ -98,6 +98,13 @@ export type CorePlugin = NextEditorPlugin<'core', {
98
98
  * @returns Transformer which can be used to request a document
99
99
  */
100
100
  createTransformer<Format>(cb: (schema: Schema) => Transformer<Format>): Transformer<Format> | undefined;
101
+ /**
102
+ * Get the anchor ID for a ProseMirror node.
103
+ *
104
+ * @param node - The ProseMirror node to get the anchor ID for.
105
+ * @returns The anchor ID if found, otherwise undefined.
106
+ */
107
+ getAnchorIdForNode: (node: PMNode) => string | undefined;
101
108
  };
102
109
  }>;
103
110
  export type TransformerResult<GenericTransformer = Transformer<JSONDocNode>> = GenericTransformer extends Transformer<infer Content> ? Content : JSONDocNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "107.26.1",
3
+ "version": "107.27.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/"
@@ -90,6 +90,7 @@
90
90
  "./lists": "./src/lists/index.ts",
91
91
  "./element-browser": "./src/element-browser/index.ts",
92
92
  "./floating-toolbar": "./src/floating-toolbar/index.ts",
93
+ "./block-menu": "./src/block-menu/index.ts",
93
94
  "./copy-button": "./src/copy-button/index.ts",
94
95
  "./legacy-rank-plugins": "./src/rank.ts",
95
96
  "./browser": "./src/utils/browser.ts",
@@ -136,7 +137,7 @@
136
137
  "@atlaskit/css": "^0.12.0",
137
138
  "@atlaskit/custom-steps": "^0.11.0",
138
139
  "@atlaskit/dropdown-menu": "^16.3.0",
139
- "@atlaskit/editor-json-transformer": "^8.26.0",
140
+ "@atlaskit/editor-json-transformer": "^8.27.0",
140
141
  "@atlaskit/editor-palette": "^2.1.0",
141
142
  "@atlaskit/editor-prosemirror": "7.0.0",
142
143
  "@atlaskit/editor-shared-styles": "^3.6.0",
@@ -144,10 +145,10 @@
144
145
  "@atlaskit/editor-toolbar": "^0.3.0",
145
146
  "@atlaskit/editor-toolbar-model": "^0.1.0",
146
147
  "@atlaskit/emoji": "^69.5.0",
147
- "@atlaskit/icon": "^27.12.0",
148
+ "@atlaskit/icon": "^28.0.0",
148
149
  "@atlaskit/icon-object": "^7.2.0",
149
150
  "@atlaskit/link": "^3.2.0",
150
- "@atlaskit/link-datasource": "^4.19.0",
151
+ "@atlaskit/link-datasource": "^4.20.0",
151
152
  "@atlaskit/link-picker": "^3.9.0",
152
153
  "@atlaskit/media-card": "^79.5.0",
153
154
  "@atlaskit/media-client": "^35.3.0",
@@ -167,7 +168,7 @@
167
168
  "@atlaskit/profilecard": "^24.5.0",
168
169
  "@atlaskit/react-ufo": "^4.4.0",
169
170
  "@atlaskit/section-message": "^8.5.0",
170
- "@atlaskit/smart-card": "^40.10.0",
171
+ "@atlaskit/smart-card": "^40.11.0",
171
172
  "@atlaskit/smart-user-picker": "^8.1.0",
172
173
  "@atlaskit/spinner": "^19.0.0",
173
174
  "@atlaskit/status": "^3.0.0",