@atlaskit/editor-common 107.26.2 → 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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
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
+
3
12
  ## 107.26.2
4
13
 
5
14
  ### Patch Changes
@@ -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',
@@ -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.1";
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.1";
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',
@@ -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.1";
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.1";
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',
@@ -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.1";
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.1";
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;
@@ -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;
@@ -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.2",
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/"