@atlaskit/editor-common 114.36.0 → 114.36.2

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,19 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 114.36.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 114.36.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`e55600892c6bd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e55600892c6bd) -
14
+ Ensure table localIds (rows, cells) get sent to the BE
15
+ - Updated dependencies
16
+
3
17
  ## 114.36.0
4
18
 
5
19
  ### Minor Changes
@@ -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 = "114.35.0";
22
+ var packageVersion = "114.36.1";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -9,6 +9,8 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
9
9
  var _editorJsonTransformer = require("@atlaskit/editor-json-transformer");
10
10
  var _model = require("@atlaskit/editor-prosemirror/model");
11
11
  var _state = require("@atlaskit/editor-prosemirror/state");
12
+ var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
13
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
14
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
13
15
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
14
16
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
@@ -109,7 +111,65 @@ var getLocalIdsFromSelection = exports.getLocalIdsFromSelection = function getLo
109
111
  return null;
110
112
  }
111
113
  if (selection instanceof _state.NodeSelection) {
114
+ if ((0, _platformFeatureFlags.fg)('platform_editor_ai_selection_local_ids')) {
115
+ var _selection$node$attrs;
116
+ var _ids = [];
117
+ var rootLocalId = (_selection$node$attrs = selection.node.attrs) === null || _selection$node$attrs === void 0 ? void 0 : _selection$node$attrs.localId;
118
+ if (rootLocalId) {
119
+ _ids.push(rootLocalId);
120
+ }
121
+ selection.node.descendants(function (node) {
122
+ var _node$attrs;
123
+ if (node.isInline) {
124
+ return false;
125
+ }
126
+ var localId = (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId;
127
+ if (localId) {
128
+ _ids.push(localId);
129
+ }
130
+ });
131
+ return _ids;
132
+ }
112
133
  return [selection.node.attrs.localId];
134
+ } else if (selection instanceof _cellSelection.CellSelection) {
135
+ if ((0, _platformFeatureFlags.fg)('platform_editor_ai_selection_local_ids')) {
136
+ var _ids2 = [];
137
+ var ancestorIds = new Set();
138
+ // Collect localIds from each selected cell and its descendants
139
+ selection.forEachCell(function (cellNode, cellPos) {
140
+ var _cellNode$attrs;
141
+ var cellLocalId = (_cellNode$attrs = cellNode.attrs) === null || _cellNode$attrs === void 0 ? void 0 : _cellNode$attrs.localId;
142
+ if (cellLocalId) {
143
+ _ids2.push(cellLocalId);
144
+ }
145
+ cellNode.descendants(function (node) {
146
+ var _node$attrs2;
147
+ if (node.isInline) {
148
+ return false;
149
+ }
150
+ var localId = (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.localId;
151
+ if (localId) {
152
+ _ids2.push(localId);
153
+ }
154
+ });
155
+ // Collect ancestor localIds (row, table) separately
156
+ var $cell = selection.$anchorCell.doc.resolve(cellPos + 1);
157
+ for (var depth = $cell.depth - 1; depth >= 1; depth--) {
158
+ var _ancestor$attrs;
159
+ var ancestor = $cell.node(depth);
160
+ var localId = (_ancestor$attrs = ancestor.attrs) === null || _ancestor$attrs === void 0 ? void 0 : _ancestor$attrs.localId;
161
+ if (localId) {
162
+ ancestorIds.add(localId);
163
+ }
164
+ }
165
+ });
166
+ var uniqueIds = new Set(_ids2);
167
+ var uniqueAncestors = (0, _toConsumableArray2.default)(ancestorIds).filter(function (id) {
168
+ return !uniqueIds.has(id);
169
+ });
170
+ return [].concat((0, _toConsumableArray2.default)(uniqueIds), (0, _toConsumableArray2.default)(uniqueAncestors));
171
+ }
172
+ // Fall through to default slice-based behavior when gate is off
113
173
  } else if (selection.empty) {
114
174
  return [selection.$from.parent.attrs.localId];
115
175
  }
@@ -117,8 +177,8 @@ var getLocalIdsFromSelection = exports.getLocalIdsFromSelection = function getLo
117
177
  var content = slice.content;
118
178
  var ids = [];
119
179
  content.forEach(function (node) {
120
- var _node$attrs;
121
- var localId = (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId;
180
+ var _node$attrs3;
181
+ var localId = (_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.localId;
122
182
  if (localId) {
123
183
  ids.push(localId);
124
184
  }
@@ -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 = "114.35.0";
27
+ var packageVersion = "114.36.1";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -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 = "114.35.0";
7
+ const packageVersion = "114.36.1";
8
8
  const sanitiseSentryEvents = (data, _hint) => {
9
9
  // Remove URL as it has UGC
10
10
  // Ignored via go/ees007
@@ -1,6 +1,8 @@
1
1
  import { nodeToJSON } from '@atlaskit/editor-json-transformer';
2
2
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
3
3
  import { TextSelection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
4
+ import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
4
6
  const listDepth = 3;
5
7
  export const selectionCoversAllListItems = ($from, $to) => {
6
8
  // Block level lists
@@ -91,7 +93,63 @@ export const getLocalIdsFromSelection = selection => {
91
93
  return null;
92
94
  }
93
95
  if (selection instanceof NodeSelection) {
96
+ if (fg('platform_editor_ai_selection_local_ids')) {
97
+ var _selection$node$attrs;
98
+ const ids = [];
99
+ const rootLocalId = (_selection$node$attrs = selection.node.attrs) === null || _selection$node$attrs === void 0 ? void 0 : _selection$node$attrs.localId;
100
+ if (rootLocalId) {
101
+ ids.push(rootLocalId);
102
+ }
103
+ selection.node.descendants(node => {
104
+ var _node$attrs;
105
+ if (node.isInline) {
106
+ return false;
107
+ }
108
+ const localId = (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId;
109
+ if (localId) {
110
+ ids.push(localId);
111
+ }
112
+ });
113
+ return ids;
114
+ }
94
115
  return [selection.node.attrs.localId];
116
+ } else if (selection instanceof CellSelection) {
117
+ if (fg('platform_editor_ai_selection_local_ids')) {
118
+ const ids = [];
119
+ const ancestorIds = new Set();
120
+ // Collect localIds from each selected cell and its descendants
121
+ selection.forEachCell((cellNode, cellPos) => {
122
+ var _cellNode$attrs;
123
+ const cellLocalId = (_cellNode$attrs = cellNode.attrs) === null || _cellNode$attrs === void 0 ? void 0 : _cellNode$attrs.localId;
124
+ if (cellLocalId) {
125
+ ids.push(cellLocalId);
126
+ }
127
+ cellNode.descendants(node => {
128
+ var _node$attrs2;
129
+ if (node.isInline) {
130
+ return false;
131
+ }
132
+ const localId = (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.localId;
133
+ if (localId) {
134
+ ids.push(localId);
135
+ }
136
+ });
137
+ // Collect ancestor localIds (row, table) separately
138
+ const $cell = selection.$anchorCell.doc.resolve(cellPos + 1);
139
+ for (let depth = $cell.depth - 1; depth >= 1; depth--) {
140
+ var _ancestor$attrs;
141
+ const ancestor = $cell.node(depth);
142
+ const localId = (_ancestor$attrs = ancestor.attrs) === null || _ancestor$attrs === void 0 ? void 0 : _ancestor$attrs.localId;
143
+ if (localId) {
144
+ ancestorIds.add(localId);
145
+ }
146
+ }
147
+ });
148
+ const uniqueIds = new Set(ids);
149
+ const uniqueAncestors = [...ancestorIds].filter(id => !uniqueIds.has(id));
150
+ return [...uniqueIds, ...uniqueAncestors];
151
+ }
152
+ // Fall through to default slice-based behavior when gate is off
95
153
  } else if (selection.empty) {
96
154
  return [selection.$from.parent.attrs.localId];
97
155
  }
@@ -99,8 +157,8 @@ export const getLocalIdsFromSelection = selection => {
99
157
  const content = slice.content;
100
158
  const ids = [];
101
159
  content.forEach(node => {
102
- var _node$attrs;
103
- const localId = (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId;
160
+ var _node$attrs3;
161
+ const localId = (_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.localId;
104
162
  if (localId) {
105
163
  ids.push(localId);
106
164
  }
@@ -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 = "114.35.0";
17
+ const packageVersion = "114.36.1";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -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 = "114.35.0";
13
+ var packageVersion = "114.36.1";
14
14
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
15
15
  // Remove URL as it has UGC
16
16
  // Ignored via go/ees007
@@ -5,6 +5,8 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
5
5
  import { nodeToJSON } from '@atlaskit/editor-json-transformer';
6
6
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
7
7
  import { TextSelection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
8
+ import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
8
10
  var listDepth = 3;
9
11
  export var selectionCoversAllListItems = function selectionCoversAllListItems($from, $to) {
10
12
  // Block level lists
@@ -102,7 +104,65 @@ export var getLocalIdsFromSelection = function getLocalIdsFromSelection(selectio
102
104
  return null;
103
105
  }
104
106
  if (selection instanceof NodeSelection) {
107
+ if (fg('platform_editor_ai_selection_local_ids')) {
108
+ var _selection$node$attrs;
109
+ var _ids = [];
110
+ var rootLocalId = (_selection$node$attrs = selection.node.attrs) === null || _selection$node$attrs === void 0 ? void 0 : _selection$node$attrs.localId;
111
+ if (rootLocalId) {
112
+ _ids.push(rootLocalId);
113
+ }
114
+ selection.node.descendants(function (node) {
115
+ var _node$attrs;
116
+ if (node.isInline) {
117
+ return false;
118
+ }
119
+ var localId = (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId;
120
+ if (localId) {
121
+ _ids.push(localId);
122
+ }
123
+ });
124
+ return _ids;
125
+ }
105
126
  return [selection.node.attrs.localId];
127
+ } else if (selection instanceof CellSelection) {
128
+ if (fg('platform_editor_ai_selection_local_ids')) {
129
+ var _ids2 = [];
130
+ var ancestorIds = new Set();
131
+ // Collect localIds from each selected cell and its descendants
132
+ selection.forEachCell(function (cellNode, cellPos) {
133
+ var _cellNode$attrs;
134
+ var cellLocalId = (_cellNode$attrs = cellNode.attrs) === null || _cellNode$attrs === void 0 ? void 0 : _cellNode$attrs.localId;
135
+ if (cellLocalId) {
136
+ _ids2.push(cellLocalId);
137
+ }
138
+ cellNode.descendants(function (node) {
139
+ var _node$attrs2;
140
+ if (node.isInline) {
141
+ return false;
142
+ }
143
+ var localId = (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.localId;
144
+ if (localId) {
145
+ _ids2.push(localId);
146
+ }
147
+ });
148
+ // Collect ancestor localIds (row, table) separately
149
+ var $cell = selection.$anchorCell.doc.resolve(cellPos + 1);
150
+ for (var depth = $cell.depth - 1; depth >= 1; depth--) {
151
+ var _ancestor$attrs;
152
+ var ancestor = $cell.node(depth);
153
+ var localId = (_ancestor$attrs = ancestor.attrs) === null || _ancestor$attrs === void 0 ? void 0 : _ancestor$attrs.localId;
154
+ if (localId) {
155
+ ancestorIds.add(localId);
156
+ }
157
+ }
158
+ });
159
+ var uniqueIds = new Set(_ids2);
160
+ var uniqueAncestors = _toConsumableArray(ancestorIds).filter(function (id) {
161
+ return !uniqueIds.has(id);
162
+ });
163
+ return [].concat(_toConsumableArray(uniqueIds), _toConsumableArray(uniqueAncestors));
164
+ }
165
+ // Fall through to default slice-based behavior when gate is off
106
166
  } else if (selection.empty) {
107
167
  return [selection.$from.parent.attrs.localId];
108
168
  }
@@ -110,8 +170,8 @@ export var getLocalIdsFromSelection = function getLocalIdsFromSelection(selectio
110
170
  var content = slice.content;
111
171
  var ids = [];
112
172
  content.forEach(function (node) {
113
- var _node$attrs;
114
- var localId = (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId;
173
+ var _node$attrs3;
174
+ var localId = (_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.localId;
115
175
  if (localId) {
116
176
  ids.push(localId);
117
177
  }
@@ -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 = "114.35.0";
24
+ var packageVersion = "114.36.1";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "114.36.0",
3
+ "version": "114.36.2",
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,16 +37,16 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@atlaskit/activity-provider": "^2.6.0",
40
- "@atlaskit/adf-schema": "^52.12.0",
40
+ "@atlaskit/adf-schema": "^52.13.0",
41
41
  "@atlaskit/adf-utils": "^19.30.0",
42
42
  "@atlaskit/afm-i18n-platform-editor-editor-common": "2.18.0",
43
43
  "@atlaskit/analytics-listeners": "^10.1.0",
44
44
  "@atlaskit/analytics-namespaced-context": "^7.3.0",
45
45
  "@atlaskit/analytics-next": "^11.2.0",
46
46
  "@atlaskit/atlassian-context": "^0.9.0",
47
- "@atlaskit/browser-apis": "^0.0.1",
47
+ "@atlaskit/browser-apis": "^0.0.2",
48
48
  "@atlaskit/button": "^23.11.0",
49
- "@atlaskit/codemod-utils": "^4.2.0",
49
+ "@atlaskit/codemod-utils": "^4.3.0",
50
50
  "@atlaskit/css": "^0.19.0",
51
51
  "@atlaskit/custom-steps": "^0.17.0",
52
52
  "@atlaskit/dropdown-menu": "^16.9.0",
@@ -57,7 +57,7 @@
57
57
  "@atlaskit/editor-tables": "^2.10.0",
58
58
  "@atlaskit/editor-toolbar": "^1.6.0",
59
59
  "@atlaskit/editor-toolbar-model": "^0.5.0",
60
- "@atlaskit/emoji": "^70.9.0",
60
+ "@atlaskit/emoji": "^70.10.0",
61
61
  "@atlaskit/icon": "^35.0.0",
62
62
  "@atlaskit/link": "^3.4.0",
63
63
  "@atlaskit/link-datasource": "^5.3.0",
@@ -79,15 +79,15 @@
79
79
  "@atlaskit/primitives": "^19.0.0",
80
80
  "@atlaskit/profilecard": "^25.7.0",
81
81
  "@atlaskit/prosemirror-history": "^0.2.0",
82
- "@atlaskit/react-ufo": "^5.21.0",
83
- "@atlaskit/section-message": "^8.12.0",
82
+ "@atlaskit/react-ufo": "^5.22.0",
83
+ "@atlaskit/section-message": "^8.13.0",
84
84
  "@atlaskit/smart-card": "^44.12.0",
85
- "@atlaskit/smart-user-picker": "^10.0.0",
85
+ "@atlaskit/smart-user-picker": "^10.1.0",
86
86
  "@atlaskit/spinner": "^19.1.0",
87
87
  "@atlaskit/task-decision": "^20.1.0",
88
88
  "@atlaskit/teams-app-config": "^1.12.0",
89
89
  "@atlaskit/textfield": "^8.3.0",
90
- "@atlaskit/tmp-editor-statsig": "^81.2.0",
90
+ "@atlaskit/tmp-editor-statsig": "^82.0.0",
91
91
  "@atlaskit/tokens": "^13.0.0",
92
92
  "@atlaskit/tooltip": "^22.2.0",
93
93
  "@atlaskit/width-detector": "^5.1.0",
@@ -271,6 +271,9 @@
271
271
  },
272
272
  "people-teams_migrate-user-profile-card": {
273
273
  "type": "boolean"
274
+ },
275
+ "platform_editor_ai_selection_local_ids": {
276
+ "type": "boolean"
274
277
  }
275
278
  }
276
279
  }