@atlaskit/editor-common 107.24.0 → 107.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/monitoring/error.js +1 -1
  3. package/dist/cjs/node-anchor/dynamic-bit-array.js +59 -0
  4. package/dist/cjs/node-anchor/node-anchor-provider.js +53 -0
  5. package/dist/cjs/prosemirror-dom-metadata/index.js +5 -1
  6. package/dist/cjs/safe-plugin/index.js +18 -4
  7. package/dist/cjs/styles/shared/lists.js +1 -2
  8. package/dist/cjs/ui/DropList/index.js +17 -3
  9. package/dist/cjs/utils/wrap-selection-in.js +2 -3
  10. package/dist/es2019/monitoring/error.js +1 -1
  11. package/dist/es2019/node-anchor/dynamic-bit-array.js +41 -0
  12. package/dist/es2019/node-anchor/node-anchor-provider.js +39 -0
  13. package/dist/es2019/prosemirror-dom-metadata/index.js +5 -1
  14. package/dist/es2019/safe-plugin/index.js +18 -4
  15. package/dist/es2019/styles/shared/lists.js +1 -2
  16. package/dist/es2019/ui/DropList/index.js +18 -4
  17. package/dist/es2019/utils/wrap-selection-in.js +2 -3
  18. package/dist/esm/monitoring/error.js +1 -1
  19. package/dist/esm/node-anchor/dynamic-bit-array.js +52 -0
  20. package/dist/esm/node-anchor/node-anchor-provider.js +46 -0
  21. package/dist/esm/prosemirror-dom-metadata/index.js +5 -1
  22. package/dist/esm/safe-plugin/index.js +18 -4
  23. package/dist/esm/styles/shared/lists.js +1 -2
  24. package/dist/esm/ui/DropList/index.js +18 -4
  25. package/dist/esm/utils/wrap-selection-in.js +2 -3
  26. package/dist/types/node-anchor/dynamic-bit-array.d.ts +14 -0
  27. package/dist/types/node-anchor/node-anchor-provider.d.ts +9 -0
  28. package/dist/types/prosemirror-dom-metadata/index.d.ts +3 -1
  29. package/dist/types/safe-plugin/index.d.ts +4 -1
  30. package/dist/types/utils/wrap-selection-in.d.ts +1 -1
  31. package/dist/types-ts4.5/node-anchor/dynamic-bit-array.d.ts +14 -0
  32. package/dist/types-ts4.5/node-anchor/node-anchor-provider.d.ts +9 -0
  33. package/dist/types-ts4.5/prosemirror-dom-metadata/index.d.ts +3 -1
  34. package/dist/types-ts4.5/safe-plugin/index.d.ts +4 -1
  35. package/dist/types-ts4.5/utils/wrap-selection-in.d.ts +1 -1
  36. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 107.25.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`e2bb51245dcec`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e2bb51245dcec) -
8
+ ED-28774 add native editor anchor support
9
+ - [`5651a63330731`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5651a63330731) -
10
+ [ux] Adds Animation when Drop List is rendered. The animation function is cubic-bezier(0.8, 0,
11
+ 0, 1) and the animation duraion is 360ms. The change is behind a FF only for confluence"
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
17
+ ## 107.24.1
18
+
19
+ ### Patch Changes
20
+
21
+ - [`3fff102f55da9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3fff102f55da9) -
22
+ Cleanup FG platform_editor_ol_padding_fix
23
+ - Updated dependencies
24
+
3
25
  ## 107.24.0
4
26
 
5
27
  ### Minor Changes
@@ -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.23.3";
19
+ var packageVersion = "107.24.1";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // Ignored via go/ees007
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.DynamicBitArray = void 0;
8
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var DEFAULT_CHUNK_SIZE = 4096; // Default chunk size in bits
11
+
12
+ /**
13
+ * A dynamic bit array implementation that allows for efficient storage and manipulation of bits.
14
+ * It supports dynamic resizing and provides methods for setting and getting bit values.
15
+ * This is useful for scenarios where you need to manage a large number of boolean flags efficiently.
16
+ */
17
+ var DynamicBitArray = exports.DynamicBitArray = /*#__PURE__*/function () {
18
+ function DynamicBitArray() {
19
+ var chunkSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_CHUNK_SIZE;
20
+ (0, _classCallCheck2.default)(this, DynamicBitArray);
21
+ this.chunkSize = chunkSize;
22
+ this.chunkTotalBitSize = this.chunkSize * 8;
23
+ this.bitArrays = [];
24
+ }
25
+ return (0, _createClass2.default)(DynamicBitArray, [{
26
+ key: "set",
27
+ value: function set(index, value) {
28
+ var bitArray = this.getChunk(index);
29
+ var byteOffset = index % this.chunkTotalBitSize;
30
+ var byteIndex = Math.floor(byteOffset / 8); // Get the byte index
31
+ var bitOffset = byteOffset % 8; // Get the bit offset within the byte
32
+
33
+ if (value) {
34
+ bitArray[byteIndex] |= 1 << bitOffset; // set the bit
35
+ } else {
36
+ bitArray[byteIndex] &= ~(1 << bitOffset); // clear the bit
37
+ }
38
+ }
39
+ }, {
40
+ key: "get",
41
+ value: function get(index) {
42
+ var bitArray = this.getChunk(index);
43
+ var byteOffset = index % this.chunkTotalBitSize;
44
+ var byteIndex = Math.floor(byteOffset / 8); // Get the byte index
45
+ var bitOffset = byteOffset % 8; // Get the bit offset within the byte
46
+
47
+ return (bitArray[byteIndex] & 1 << bitOffset) !== 0; // Check if the bit is set
48
+ }
49
+ }, {
50
+ key: "getChunk",
51
+ value: function getChunk(index) {
52
+ var chunkIndex = Math.floor(index / this.chunkTotalBitSize);
53
+ if (!this.bitArrays[chunkIndex]) {
54
+ this.bitArrays[chunkIndex] = new Uint8Array(this.chunkSize);
55
+ }
56
+ return this.bitArrays[chunkIndex];
57
+ }
58
+ }]);
59
+ }();
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.getNodeIdProvider = exports.NodeAnchorProvider = void 0;
8
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+ var _dynamicBitArray = require("./dynamic-bit-array");
12
+ var NodeAnchorProvider = exports.NodeAnchorProvider = /*#__PURE__*/function () {
13
+ function NodeAnchorProvider() {
14
+ (0, _classCallCheck2.default)(this, NodeAnchorProvider);
15
+ (0, _defineProperty2.default)(this, "cache", new WeakMap());
16
+ (0, _defineProperty2.default)(this, "count", BigInt(0));
17
+ (0, _defineProperty2.default)(this, "existingPos", new _dynamicBitArray.DynamicBitArray());
18
+ }
19
+ return (0, _createClass2.default)(NodeAnchorProvider, [{
20
+ key: "getOrGenerateId",
21
+ value:
22
+ // We use pos to generate unique ids for each node at a specific position
23
+ // This is to ensure the same ADF will always generate the same DOM initially
24
+ function getOrGenerateId(node, pos) {
25
+ if (this.cache.has(node)) {
26
+ return this.cache.get(node);
27
+ }
28
+ var idSuffix = '';
29
+ if (this.existingPos.get(pos)) {
30
+ idSuffix = "-".concat((this.count++).toString(36));
31
+ } else {
32
+ this.existingPos.set(pos, true);
33
+ }
34
+ var anchorName = "--anchor-".concat(node.type.name, "-").concat(pos).concat(idSuffix);
35
+ this.cache.set(node, anchorName);
36
+ return anchorName;
37
+ }
38
+ }]);
39
+ }();
40
+ var nodeIdProviderMap = new WeakMap();
41
+
42
+ // Get the NodeIdProvider for a specific EditorView instance.
43
+ // This allows access to the node ids anywhere.
44
+ var getNodeIdProvider = exports.getNodeIdProvider = function getNodeIdProvider(editorView) {
45
+ if (!nodeIdProviderMap.has(editorView)) {
46
+ var provider = new NodeAnchorProvider();
47
+ nodeIdProviderMap.set(editorView, provider);
48
+ return provider;
49
+ }
50
+
51
+ // This is based on the fact that editorView is a singleton.
52
+ return nodeIdProviderMap.get(editorView);
53
+ };
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.createProseMirrorMetadata = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _model = require("@atlaskit/editor-prosemirror/model");
10
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
10
11
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
12
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // Disable no-re-export rule for entry point files
12
13
  /* eslint-disable @atlaskit/editor/no-re-export */
@@ -29,7 +30,7 @@ var isPMNode = function isPMNode(nodeOrMark) {
29
30
  * - `data-prosemirror-node-inline` (if applicable): Indicates if the node is inline.
30
31
  * - `data-prosemirror-mark-name` (if applicable): The name of the mark.
31
32
  */
32
- var createProseMirrorMetadata = exports.createProseMirrorMetadata = function createProseMirrorMetadata(nodeOrMark) {
33
+ var createProseMirrorMetadata = exports.createProseMirrorMetadata = function createProseMirrorMetadata(nodeOrMark, options) {
33
34
  var name = nodeOrMark.type.name;
34
35
  var isNode = isPMNode(nodeOrMark);
35
36
  var commonAttributes = {
@@ -45,5 +46,8 @@ var createProseMirrorMetadata = exports.createProseMirrorMetadata = function cre
45
46
  if (nodeOrMark.type.isInline) {
46
47
  commonAttributes['data-prosemirror-node-inline'] = 'true';
47
48
  }
49
+ if ((options === null || options === void 0 ? void 0 : options.anchrorId) !== undefined && (0, _expValEquals.expValEquals)('platform_editor_native_anchor_support', 'isEnabled', true)) {
50
+ commonAttributes['data-node-anchor'] = options.anchrorId;
51
+ }
48
52
  return commonAttributes;
49
53
  };
@@ -14,6 +14,8 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
14
14
  var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
15
15
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
16
16
  var _state = require("@atlaskit/editor-prosemirror/state");
17
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
18
+ var _nodeAnchorProvider = require("../node-anchor/node-anchor-provider");
17
19
  var _prosemirrorDomMetadata = require("../prosemirror-dom-metadata");
18
20
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
19
21
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
@@ -30,8 +32,9 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
30
32
  */
31
33
  var attachGenericProseMirrorMetadata = exports.attachGenericProseMirrorMetadata = function attachGenericProseMirrorMetadata(_ref) {
32
34
  var nodeOrMark = _ref.nodeOrMark,
33
- dom = _ref.dom;
34
- var metadata = (0, _prosemirrorDomMetadata.createProseMirrorMetadata)(nodeOrMark);
35
+ dom = _ref.dom,
36
+ options = _ref.options;
37
+ var metadata = (0, _prosemirrorDomMetadata.createProseMirrorMetadata)(nodeOrMark, options);
35
38
  Object.entries(metadata).forEach(function (_ref2) {
36
39
  var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
37
40
  name = _ref3[0],
@@ -49,6 +52,7 @@ var wrapGetPosExceptions = function wrapGetPosExceptions(spec) {
49
52
  return spec;
50
53
  }
51
54
  var unsafeNodeViews = spec.props.nodeViews;
55
+ var nodeIdProvider;
52
56
  var safeNodeViews = new Proxy(unsafeNodeViews, {
53
57
  get: function get(target, prop, receiver) {
54
58
  var safeNodeView = new Proxy(Reflect.get(target, prop, receiver), {
@@ -58,20 +62,30 @@ var wrapGetPosExceptions = function wrapGetPosExceptions(spec) {
58
62
  view = _argumentsList[1],
59
63
  unsafeGetPos = _argumentsList[2],
60
64
  more = _argumentsList.slice(3);
65
+ if (!nodeIdProvider && (0, _expValEquals.expValEquals)('platform_editor_native_anchor_support', 'isEnabled', true)) {
66
+ nodeIdProvider = (0, _nodeAnchorProvider.getNodeIdProvider)(view);
67
+ }
61
68
  var safeGetPos = function () {
62
69
  try {
63
70
  return unsafeGetPos();
64
71
  } catch (e) {
65
72
  return;
66
73
  }
67
- return;
74
+
68
75
  // eslint-disable-next-line no-extra-bind
69
76
  }.bind(thisArg);
70
77
  var result = Reflect.apply(target, thisArg, [node, view, safeGetPos].concat((0, _toConsumableArray2.default)(more)));
71
78
  if ((result === null || result === void 0 ? void 0 : result.dom) instanceof HTMLElement) {
79
+ var _nodeIdProvider;
80
+ // we only attach metadata to the dom if its position is known
81
+ var pos = safeGetPos();
82
+ var options = pos !== undefined && (0, _expValEquals.expValEquals)('platform_editor_native_anchor_support', 'isEnabled', true) ? {
83
+ anchrorId: (_nodeIdProvider = nodeIdProvider) === null || _nodeIdProvider === void 0 ? void 0 : _nodeIdProvider.getOrGenerateId(node, pos)
84
+ } : undefined;
72
85
  attachGenericProseMirrorMetadata({
73
86
  nodeOrMark: node,
74
- dom: result.dom
87
+ dom: result.dom,
88
+ options: options
75
89
  });
76
90
  }
77
91
  return result;
@@ -11,7 +11,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
11
11
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
12
12
  var _react = require("@emotion/react");
13
13
  var _adfSchema = require("@atlaskit/adf-schema");
14
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
14
  var _browser = require("../../utils/browser");
16
15
  var _templateObject; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
17
16
  var listItemCounterPadding = exports.listItemCounterPadding = 24;
@@ -25,7 +24,7 @@ var getItemCounterLeftPadding = function getItemCounterLeftPadding(itemCounterDi
25
24
  // character). We use "ch" so that this computed padding can now grow if
26
25
  // the font-size ever enlarges.
27
26
  var paddingLeft = "2.385ch";
28
- if (itemCounterDigitsSize >= ((0, _platformFeatureFlags.fg)('platform_editor_ol_padding_fix') ? 2 : 3)) {
27
+ if (itemCounterDigitsSize >= 2) {
29
28
  // When there are 2 or more digits, we use a combination of "ch" units and
30
29
  // pixel values so that while the computed padding grows if font-size ever
31
30
  // enlarges, it doesn't over-scale with each digit (because of the fixed pixel
@@ -16,6 +16,7 @@ var _react2 = require("@emotion/react");
16
16
  var _createAndFireEvents = _interopRequireDefault(require("@atlaskit/analytics-next/createAndFireEvents"));
17
17
  var _withAnalyticsContext = _interopRequireDefault(require("@atlaskit/analytics-next/withAnalyticsContext"));
18
18
  var _withAnalyticsEvents = _interopRequireDefault(require("@atlaskit/analytics-next/withAnalyticsEvents"));
19
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
20
  var _Layer = _interopRequireDefault(require("../Layer"));
20
21
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
21
22
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
@@ -23,9 +24,17 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
24
  * @jsx jsx
24
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
26
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "107.23.3";
27
+ var packageVersion = "107.24.1";
27
28
  var halfFocusRing = 1;
28
29
  var dropOffset = '0, 8';
30
+ var fadeIn = (0, _react2.keyframes)({
31
+ '0%': {
32
+ opacity: 0
33
+ },
34
+ '100%': {
35
+ opacity: 1
36
+ }
37
+ });
29
38
  // Ignored via go/ees005
30
39
  // eslint-disable-next-line @repo/internal/react/no-class-components
31
40
  var DropList = /*#__PURE__*/function (_Component) {
@@ -52,6 +61,11 @@ var DropList = /*#__PURE__*/function (_Component) {
52
61
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
53
62
  boxSizing: _this.props.shouldFitContainer ? 'border-box' : undefined
54
63
  }));
64
+ (0, _defineProperty2.default)(_this, "motionStyles", (0, _react2.css)({
65
+ animationName: "".concat(fadeIn),
66
+ animationDuration: '360ms',
67
+ animationTimingFunction: 'cubic-bezier(0.8, 0, 0, 1)'
68
+ }));
55
69
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
56
70
  (0, _defineProperty2.default)(_this, "menuWrapper", function () {
57
71
  return (0, _react2.css)({
@@ -169,7 +183,7 @@ var DropList = /*#__PURE__*/function (_Component) {
169
183
  role: "presentation"
170
184
  }, children) : null;
171
185
  return (0, _react2.jsx)("div", {
172
- css: this.wrapperStyles,
186
+ css: [this.wrapperStyles, (0, _platformFeatureFlags.fg)('p2m-drop-down-motion') && this.motionStyles],
173
187
  ref: this.handleDroplistRef
174
188
  }, (0, _react2.jsx)(_Layer.default, {
175
189
  content: layerContent,
@@ -177,7 +191,7 @@ var DropList = /*#__PURE__*/function (_Component) {
177
191
  position: position,
178
192
  onPositioned: onPositioned
179
193
  }, (0, _react2.jsx)("div", {
180
- css: this.triggerStyles,
194
+ css: [this.triggerStyles, (0, _platformFeatureFlags.fg)('p2m-drop-down-motion') && this.motionStyles],
181
195
  ref: this.handleTriggerRef
182
196
  }, trigger)));
183
197
  }
@@ -11,12 +11,11 @@ var _createWrapSelectionTransaction = require("./create-wrap-selection-transacti
11
11
  * 2. If current block can not be wrapped inside wrapping block it will create a new block below selection,
12
12
  * and set selection on it.
13
13
  */
14
- function wrapSelectionIn(type, nodeAttributes) {
14
+ function wrapSelectionIn(type) {
15
15
  return function (state, dispatch) {
16
16
  var tr = (0, _createWrapSelectionTransaction.createWrapSelectionTransaction)({
17
17
  state: state,
18
- type: type,
19
- nodeAttributes: nodeAttributes
18
+ type: type
20
19
  });
21
20
  if (dispatch) {
22
21
  dispatch(tr);
@@ -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.23.3";
4
+ const packageVersion = "107.24.1";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // Ignored via go/ees007
@@ -0,0 +1,41 @@
1
+ const DEFAULT_CHUNK_SIZE = 4096; // Default chunk size in bits
2
+
3
+ /**
4
+ * A dynamic bit array implementation that allows for efficient storage and manipulation of bits.
5
+ * It supports dynamic resizing and provides methods for setting and getting bit values.
6
+ * This is useful for scenarios where you need to manage a large number of boolean flags efficiently.
7
+ */
8
+ export class DynamicBitArray {
9
+ constructor(chunkSize = DEFAULT_CHUNK_SIZE) {
10
+ this.chunkSize = chunkSize;
11
+ this.chunkTotalBitSize = this.chunkSize * 8;
12
+ this.bitArrays = [];
13
+ }
14
+ set(index, value) {
15
+ const bitArray = this.getChunk(index);
16
+ const byteOffset = index % this.chunkTotalBitSize;
17
+ const byteIndex = Math.floor(byteOffset / 8); // Get the byte index
18
+ const bitOffset = byteOffset % 8; // Get the bit offset within the byte
19
+
20
+ if (value) {
21
+ bitArray[byteIndex] |= 1 << bitOffset; // set the bit
22
+ } else {
23
+ bitArray[byteIndex] &= ~(1 << bitOffset); // clear the bit
24
+ }
25
+ }
26
+ get(index) {
27
+ const bitArray = this.getChunk(index);
28
+ const byteOffset = index % this.chunkTotalBitSize;
29
+ const byteIndex = Math.floor(byteOffset / 8); // Get the byte index
30
+ const bitOffset = byteOffset % 8; // Get the bit offset within the byte
31
+
32
+ return (bitArray[byteIndex] & 1 << bitOffset) !== 0; // Check if the bit is set
33
+ }
34
+ getChunk(index) {
35
+ const chunkIndex = Math.floor(index / this.chunkTotalBitSize);
36
+ if (!this.bitArrays[chunkIndex]) {
37
+ this.bitArrays[chunkIndex] = new Uint8Array(this.chunkSize);
38
+ }
39
+ return this.bitArrays[chunkIndex];
40
+ }
41
+ }
@@ -0,0 +1,39 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import { DynamicBitArray } from './dynamic-bit-array';
3
+ export class NodeAnchorProvider {
4
+ constructor() {
5
+ _defineProperty(this, "cache", new WeakMap());
6
+ _defineProperty(this, "count", BigInt(0));
7
+ _defineProperty(this, "existingPos", new DynamicBitArray());
8
+ }
9
+ // We use pos to generate unique ids for each node at a specific position
10
+ // This is to ensure the same ADF will always generate the same DOM initially
11
+ getOrGenerateId(node, pos) {
12
+ if (this.cache.has(node)) {
13
+ return this.cache.get(node);
14
+ }
15
+ let idSuffix = '';
16
+ if (this.existingPos.get(pos)) {
17
+ idSuffix = `-${(this.count++).toString(36)}`;
18
+ } else {
19
+ this.existingPos.set(pos, true);
20
+ }
21
+ const anchorName = `--anchor-${node.type.name}-${pos}${idSuffix}`;
22
+ this.cache.set(node, anchorName);
23
+ return anchorName;
24
+ }
25
+ }
26
+ const nodeIdProviderMap = new WeakMap();
27
+
28
+ // Get the NodeIdProvider for a specific EditorView instance.
29
+ // This allows access to the node ids anywhere.
30
+ export const getNodeIdProvider = editorView => {
31
+ if (!nodeIdProviderMap.has(editorView)) {
32
+ const provider = new NodeAnchorProvider();
33
+ nodeIdProviderMap.set(editorView, provider);
34
+ return provider;
35
+ }
36
+
37
+ // This is based on the fact that editorView is a singleton.
38
+ return nodeIdProviderMap.get(editorView);
39
+ };
@@ -2,6 +2,7 @@
2
2
  /* eslint-disable @atlaskit/editor/no-re-export */
3
3
 
4
4
  import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
5
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
6
  const isPMNode = nodeOrMark => {
6
7
  return nodeOrMark instanceof PMNode || Array.isArray(nodeOrMark.marks);
7
8
  };
@@ -21,7 +22,7 @@ const isPMNode = nodeOrMark => {
21
22
  * - `data-prosemirror-node-inline` (if applicable): Indicates if the node is inline.
22
23
  * - `data-prosemirror-mark-name` (if applicable): The name of the mark.
23
24
  */
24
- export const createProseMirrorMetadata = nodeOrMark => {
25
+ export const createProseMirrorMetadata = (nodeOrMark, options) => {
25
26
  const name = nodeOrMark.type.name;
26
27
  const isNode = isPMNode(nodeOrMark);
27
28
  const commonAttributes = {
@@ -40,5 +41,8 @@ export const createProseMirrorMetadata = nodeOrMark => {
40
41
  if (nodeOrMark.type.isInline) {
41
42
  commonAttributes['data-prosemirror-node-inline'] = 'true';
42
43
  }
44
+ if ((options === null || options === void 0 ? void 0 : options.anchrorId) !== undefined && expValEquals('platform_editor_native_anchor_support', 'isEnabled', true)) {
45
+ commonAttributes['data-node-anchor'] = options.anchrorId;
46
+ }
43
47
  return commonAttributes;
44
48
  };
@@ -1,4 +1,6 @@
1
1
  import { Plugin } from '@atlaskit/editor-prosemirror/state';
2
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
+ import { getNodeIdProvider } from '../node-anchor/node-anchor-provider';
2
4
  import { createProseMirrorMetadata } from '../prosemirror-dom-metadata';
3
5
  /**
4
6
  * 🧱 Internal Helper Function: Editor FE Platform
@@ -13,9 +15,10 @@ import { createProseMirrorMetadata } from '../prosemirror-dom-metadata';
13
15
  */
14
16
  export const attachGenericProseMirrorMetadata = ({
15
17
  nodeOrMark,
16
- dom
18
+ dom,
19
+ options
17
20
  }) => {
18
- const metadata = createProseMirrorMetadata(nodeOrMark);
21
+ const metadata = createProseMirrorMetadata(nodeOrMark, options);
19
22
  Object.entries(metadata).forEach(([name, value]) => {
20
23
  dom.setAttribute(name, value);
21
24
  });
@@ -30,25 +33,36 @@ const wrapGetPosExceptions = spec => {
30
33
  return spec;
31
34
  }
32
35
  const unsafeNodeViews = spec.props.nodeViews;
36
+ let nodeIdProvider;
33
37
  const safeNodeViews = new Proxy(unsafeNodeViews, {
34
38
  get(target, prop, receiver) {
35
39
  const safeNodeView = new Proxy(Reflect.get(target, prop, receiver), {
36
40
  apply(target, thisArg, argumentsList) {
37
41
  const [node, view, unsafeGetPos, ...more] = argumentsList;
42
+ if (!nodeIdProvider && expValEquals('platform_editor_native_anchor_support', 'isEnabled', true)) {
43
+ nodeIdProvider = getNodeIdProvider(view);
44
+ }
38
45
  const safeGetPos = (() => {
39
46
  try {
40
47
  return unsafeGetPos();
41
48
  } catch (e) {
42
49
  return;
43
50
  }
44
- return;
51
+
45
52
  // eslint-disable-next-line no-extra-bind
46
53
  }).bind(thisArg);
47
54
  const result = Reflect.apply(target, thisArg, [node, view, safeGetPos, ...more]);
48
55
  if ((result === null || result === void 0 ? void 0 : result.dom) instanceof HTMLElement) {
56
+ var _nodeIdProvider;
57
+ // we only attach metadata to the dom if its position is known
58
+ const pos = safeGetPos();
59
+ const options = pos !== undefined && expValEquals('platform_editor_native_anchor_support', 'isEnabled', true) ? {
60
+ anchrorId: (_nodeIdProvider = nodeIdProvider) === null || _nodeIdProvider === void 0 ? void 0 : _nodeIdProvider.getOrGenerateId(node, pos)
61
+ } : undefined;
49
62
  attachGenericProseMirrorMetadata({
50
63
  nodeOrMark: node,
51
- dom: result.dom
64
+ dom: result.dom,
65
+ options
52
66
  });
53
67
  }
54
68
  return result;
@@ -1,7 +1,6 @@
1
1
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
2
  import { css } from '@emotion/react';
3
3
  import { bulletListSelector, orderedListSelector } from '@atlaskit/adf-schema';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  import { browser } from '../../utils/browser';
6
5
  export const listItemCounterPadding = 24;
7
6
  var CSS_VAR_NAMES = /*#__PURE__*/function (CSS_VAR_NAMES) {
@@ -14,7 +13,7 @@ const getItemCounterLeftPadding = itemCounterDigitsSize => {
14
13
  // character). We use "ch" so that this computed padding can now grow if
15
14
  // the font-size ever enlarges.
16
15
  let paddingLeft = `2.385ch`;
17
- if (itemCounterDigitsSize >= (fg('platform_editor_ol_padding_fix') ? 2 : 3)) {
16
+ if (itemCounterDigitsSize >= 2) {
18
17
  // When there are 2 or more digits, we use a combination of "ch" units and
19
18
  // pixel values so that while the computed padding grows if font-size ever
20
19
  // enlarges, it doesn't over-scale with each digit (because of the fixed pixel
@@ -7,15 +7,24 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
7
  import { Component } from 'react';
8
8
 
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
- import { css, jsx } from '@emotion/react';
10
+ import { css, jsx, keyframes } from '@emotion/react';
11
11
  import createAndFireEvent from '@atlaskit/analytics-next/createAndFireEvents';
12
12
  import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext';
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
+ import { fg } from '@atlaskit/platform-feature-flags';
14
15
  import Layer from '../Layer';
15
16
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "107.23.3";
17
+ const packageVersion = "107.24.1";
17
18
  const halfFocusRing = 1;
18
19
  const dropOffset = '0, 8';
20
+ const fadeIn = keyframes({
21
+ '0%': {
22
+ opacity: 0
23
+ },
24
+ '100%': {
25
+ opacity: 1
26
+ }
27
+ });
19
28
  // Ignored via go/ees005
20
29
  // eslint-disable-next-line @repo/internal/react/no-class-components
21
30
  class DropList extends Component {
@@ -37,6 +46,11 @@ class DropList extends Component {
37
46
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
38
47
  boxSizing: this.props.shouldFitContainer ? 'border-box' : undefined
39
48
  }));
49
+ _defineProperty(this, "motionStyles", css({
50
+ animationName: `${fadeIn}`,
51
+ animationDuration: '360ms',
52
+ animationTimingFunction: 'cubic-bezier(0.8, 0, 0, 1)'
53
+ }));
40
54
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
41
55
  _defineProperty(this, "menuWrapper", () => {
42
56
  return css({
@@ -154,7 +168,7 @@ class DropList extends Component {
154
168
  role: "presentation"
155
169
  }, children) : null;
156
170
  return jsx("div", {
157
- css: this.wrapperStyles,
171
+ css: [this.wrapperStyles, fg('p2m-drop-down-motion') && this.motionStyles],
158
172
  ref: this.handleDroplistRef
159
173
  }, jsx(Layer, {
160
174
  content: layerContent,
@@ -162,7 +176,7 @@ class DropList extends Component {
162
176
  position: position,
163
177
  onPositioned: onPositioned
164
178
  }, jsx("div", {
165
- css: this.triggerStyles,
179
+ css: [this.triggerStyles, fg('p2m-drop-down-motion') && this.motionStyles],
166
180
  ref: this.handleTriggerRef
167
181
  }, trigger)));
168
182
  }
@@ -5,12 +5,11 @@ import { createWrapSelectionTransaction } from './create-wrap-selection-transact
5
5
  * 2. If current block can not be wrapped inside wrapping block it will create a new block below selection,
6
6
  * and set selection on it.
7
7
  */
8
- export function wrapSelectionIn(type, nodeAttributes) {
8
+ export function wrapSelectionIn(type) {
9
9
  return function (state, dispatch) {
10
10
  const tr = createWrapSelectionTransaction({
11
11
  state,
12
- type,
13
- nodeAttributes
12
+ type
14
13
  });
15
14
  if (dispatch) {
16
15
  dispatch(tr);
@@ -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.23.3";
10
+ var packageVersion = "107.24.1";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // Ignored via go/ees007
@@ -0,0 +1,52 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ var DEFAULT_CHUNK_SIZE = 4096; // Default chunk size in bits
4
+
5
+ /**
6
+ * A dynamic bit array implementation that allows for efficient storage and manipulation of bits.
7
+ * It supports dynamic resizing and provides methods for setting and getting bit values.
8
+ * This is useful for scenarios where you need to manage a large number of boolean flags efficiently.
9
+ */
10
+ export var DynamicBitArray = /*#__PURE__*/function () {
11
+ function DynamicBitArray() {
12
+ var chunkSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_CHUNK_SIZE;
13
+ _classCallCheck(this, DynamicBitArray);
14
+ this.chunkSize = chunkSize;
15
+ this.chunkTotalBitSize = this.chunkSize * 8;
16
+ this.bitArrays = [];
17
+ }
18
+ return _createClass(DynamicBitArray, [{
19
+ key: "set",
20
+ value: function set(index, value) {
21
+ var bitArray = this.getChunk(index);
22
+ var byteOffset = index % this.chunkTotalBitSize;
23
+ var byteIndex = Math.floor(byteOffset / 8); // Get the byte index
24
+ var bitOffset = byteOffset % 8; // Get the bit offset within the byte
25
+
26
+ if (value) {
27
+ bitArray[byteIndex] |= 1 << bitOffset; // set the bit
28
+ } else {
29
+ bitArray[byteIndex] &= ~(1 << bitOffset); // clear the bit
30
+ }
31
+ }
32
+ }, {
33
+ key: "get",
34
+ value: function get(index) {
35
+ var bitArray = this.getChunk(index);
36
+ var byteOffset = index % this.chunkTotalBitSize;
37
+ var byteIndex = Math.floor(byteOffset / 8); // Get the byte index
38
+ var bitOffset = byteOffset % 8; // Get the bit offset within the byte
39
+
40
+ return (bitArray[byteIndex] & 1 << bitOffset) !== 0; // Check if the bit is set
41
+ }
42
+ }, {
43
+ key: "getChunk",
44
+ value: function getChunk(index) {
45
+ var chunkIndex = Math.floor(index / this.chunkTotalBitSize);
46
+ if (!this.bitArrays[chunkIndex]) {
47
+ this.bitArrays[chunkIndex] = new Uint8Array(this.chunkSize);
48
+ }
49
+ return this.bitArrays[chunkIndex];
50
+ }
51
+ }]);
52
+ }();
@@ -0,0 +1,46 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
+ import { DynamicBitArray } from './dynamic-bit-array';
5
+ export var NodeAnchorProvider = /*#__PURE__*/function () {
6
+ function NodeAnchorProvider() {
7
+ _classCallCheck(this, NodeAnchorProvider);
8
+ _defineProperty(this, "cache", new WeakMap());
9
+ _defineProperty(this, "count", BigInt(0));
10
+ _defineProperty(this, "existingPos", new DynamicBitArray());
11
+ }
12
+ return _createClass(NodeAnchorProvider, [{
13
+ key: "getOrGenerateId",
14
+ value:
15
+ // We use pos to generate unique ids for each node at a specific position
16
+ // This is to ensure the same ADF will always generate the same DOM initially
17
+ function getOrGenerateId(node, pos) {
18
+ if (this.cache.has(node)) {
19
+ return this.cache.get(node);
20
+ }
21
+ var idSuffix = '';
22
+ if (this.existingPos.get(pos)) {
23
+ idSuffix = "-".concat((this.count++).toString(36));
24
+ } else {
25
+ this.existingPos.set(pos, true);
26
+ }
27
+ var anchorName = "--anchor-".concat(node.type.name, "-").concat(pos).concat(idSuffix);
28
+ this.cache.set(node, anchorName);
29
+ return anchorName;
30
+ }
31
+ }]);
32
+ }();
33
+ var nodeIdProviderMap = new WeakMap();
34
+
35
+ // Get the NodeIdProvider for a specific EditorView instance.
36
+ // This allows access to the node ids anywhere.
37
+ export var getNodeIdProvider = function getNodeIdProvider(editorView) {
38
+ if (!nodeIdProviderMap.has(editorView)) {
39
+ var provider = new NodeAnchorProvider();
40
+ nodeIdProviderMap.set(editorView, provider);
41
+ return provider;
42
+ }
43
+
44
+ // This is based on the fact that editorView is a singleton.
45
+ return nodeIdProviderMap.get(editorView);
46
+ };
@@ -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 { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
9
  var isPMNode = function isPMNode(nodeOrMark) {
9
10
  return nodeOrMark instanceof PMNode || Array.isArray(nodeOrMark.marks);
10
11
  };
@@ -24,7 +25,7 @@ var isPMNode = function isPMNode(nodeOrMark) {
24
25
  * - `data-prosemirror-node-inline` (if applicable): Indicates if the node is inline.
25
26
  * - `data-prosemirror-mark-name` (if applicable): The name of the mark.
26
27
  */
27
- export var createProseMirrorMetadata = function createProseMirrorMetadata(nodeOrMark) {
28
+ export var createProseMirrorMetadata = function createProseMirrorMetadata(nodeOrMark, options) {
28
29
  var name = nodeOrMark.type.name;
29
30
  var isNode = isPMNode(nodeOrMark);
30
31
  var commonAttributes = {
@@ -40,5 +41,8 @@ export var createProseMirrorMetadata = function createProseMirrorMetadata(nodeOr
40
41
  if (nodeOrMark.type.isInline) {
41
42
  commonAttributes['data-prosemirror-node-inline'] = 'true';
42
43
  }
44
+ if ((options === null || options === void 0 ? void 0 : options.anchrorId) !== undefined && expValEquals('platform_editor_native_anchor_support', 'isEnabled', true)) {
45
+ commonAttributes['data-node-anchor'] = options.anchrorId;
46
+ }
43
47
  return commonAttributes;
44
48
  };
@@ -9,6 +9,8 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
9
9
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
10
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
11
  import { Plugin } from '@atlaskit/editor-prosemirror/state';
12
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
13
+ import { getNodeIdProvider } from '../node-anchor/node-anchor-provider';
12
14
  import { createProseMirrorMetadata } from '../prosemirror-dom-metadata';
13
15
  /**
14
16
  * 🧱 Internal Helper Function: Editor FE Platform
@@ -23,8 +25,9 @@ import { createProseMirrorMetadata } from '../prosemirror-dom-metadata';
23
25
  */
24
26
  export var attachGenericProseMirrorMetadata = function attachGenericProseMirrorMetadata(_ref) {
25
27
  var nodeOrMark = _ref.nodeOrMark,
26
- dom = _ref.dom;
27
- var metadata = createProseMirrorMetadata(nodeOrMark);
28
+ dom = _ref.dom,
29
+ options = _ref.options;
30
+ var metadata = createProseMirrorMetadata(nodeOrMark, options);
28
31
  Object.entries(metadata).forEach(function (_ref2) {
29
32
  var _ref3 = _slicedToArray(_ref2, 2),
30
33
  name = _ref3[0],
@@ -42,6 +45,7 @@ var wrapGetPosExceptions = function wrapGetPosExceptions(spec) {
42
45
  return spec;
43
46
  }
44
47
  var unsafeNodeViews = spec.props.nodeViews;
48
+ var nodeIdProvider;
45
49
  var safeNodeViews = new Proxy(unsafeNodeViews, {
46
50
  get: function get(target, prop, receiver) {
47
51
  var safeNodeView = new Proxy(Reflect.get(target, prop, receiver), {
@@ -51,20 +55,30 @@ var wrapGetPosExceptions = function wrapGetPosExceptions(spec) {
51
55
  view = _argumentsList[1],
52
56
  unsafeGetPos = _argumentsList[2],
53
57
  more = _argumentsList.slice(3);
58
+ if (!nodeIdProvider && expValEquals('platform_editor_native_anchor_support', 'isEnabled', true)) {
59
+ nodeIdProvider = getNodeIdProvider(view);
60
+ }
54
61
  var safeGetPos = function () {
55
62
  try {
56
63
  return unsafeGetPos();
57
64
  } catch (e) {
58
65
  return;
59
66
  }
60
- return;
67
+
61
68
  // eslint-disable-next-line no-extra-bind
62
69
  }.bind(thisArg);
63
70
  var result = Reflect.apply(target, thisArg, [node, view, safeGetPos].concat(_toConsumableArray(more)));
64
71
  if ((result === null || result === void 0 ? void 0 : result.dom) instanceof HTMLElement) {
72
+ var _nodeIdProvider;
73
+ // we only attach metadata to the dom if its position is known
74
+ var pos = safeGetPos();
75
+ var options = pos !== undefined && expValEquals('platform_editor_native_anchor_support', 'isEnabled', true) ? {
76
+ anchrorId: (_nodeIdProvider = nodeIdProvider) === null || _nodeIdProvider === void 0 ? void 0 : _nodeIdProvider.getOrGenerateId(node, pos)
77
+ } : undefined;
65
78
  attachGenericProseMirrorMetadata({
66
79
  nodeOrMark: node,
67
- dom: result.dom
80
+ dom: result.dom,
81
+ options: options
68
82
  });
69
83
  }
70
84
  return result;
@@ -5,7 +5,6 @@ var _templateObject;
5
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
6
  import { css } from '@emotion/react';
7
7
  import { bulletListSelector, orderedListSelector } from '@atlaskit/adf-schema';
8
- import { fg } from '@atlaskit/platform-feature-flags';
9
8
  import { browser } from '../../utils/browser';
10
9
  export var listItemCounterPadding = 24;
11
10
  var CSS_VAR_NAMES = /*#__PURE__*/function (CSS_VAR_NAMES) {
@@ -18,7 +17,7 @@ var getItemCounterLeftPadding = function getItemCounterLeftPadding(itemCounterDi
18
17
  // character). We use "ch" so that this computed padding can now grow if
19
18
  // the font-size ever enlarges.
20
19
  var paddingLeft = "2.385ch";
21
- if (itemCounterDigitsSize >= (fg('platform_editor_ol_padding_fix') ? 2 : 3)) {
20
+ if (itemCounterDigitsSize >= 2) {
22
21
  // When there are 2 or more digits, we use a combination of "ch" units and
23
22
  // pixel values so that while the computed padding grows if font-size ever
24
23
  // enlarges, it doesn't over-scale with each digit (because of the fixed pixel
@@ -14,15 +14,24 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
14
14
  import { Component } from 'react';
15
15
 
16
16
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
17
- import { css, jsx } from '@emotion/react';
17
+ import { css, jsx, keyframes } from '@emotion/react';
18
18
  import createAndFireEvent from '@atlaskit/analytics-next/createAndFireEvents';
19
19
  import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext';
20
20
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
+ import { fg } from '@atlaskit/platform-feature-flags';
21
22
  import Layer from '../Layer';
22
23
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "107.23.3";
24
+ var packageVersion = "107.24.1";
24
25
  var halfFocusRing = 1;
25
26
  var dropOffset = '0, 8';
27
+ var fadeIn = keyframes({
28
+ '0%': {
29
+ opacity: 0
30
+ },
31
+ '100%': {
32
+ opacity: 1
33
+ }
34
+ });
26
35
  // Ignored via go/ees005
27
36
  // eslint-disable-next-line @repo/internal/react/no-class-components
28
37
  var DropList = /*#__PURE__*/function (_Component) {
@@ -49,6 +58,11 @@ var DropList = /*#__PURE__*/function (_Component) {
49
58
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
50
59
  boxSizing: _this.props.shouldFitContainer ? 'border-box' : undefined
51
60
  }));
61
+ _defineProperty(_this, "motionStyles", css({
62
+ animationName: "".concat(fadeIn),
63
+ animationDuration: '360ms',
64
+ animationTimingFunction: 'cubic-bezier(0.8, 0, 0, 1)'
65
+ }));
52
66
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
53
67
  _defineProperty(_this, "menuWrapper", function () {
54
68
  return css({
@@ -166,7 +180,7 @@ var DropList = /*#__PURE__*/function (_Component) {
166
180
  role: "presentation"
167
181
  }, children) : null;
168
182
  return jsx("div", {
169
- css: this.wrapperStyles,
183
+ css: [this.wrapperStyles, fg('p2m-drop-down-motion') && this.motionStyles],
170
184
  ref: this.handleDroplistRef
171
185
  }, jsx(Layer, {
172
186
  content: layerContent,
@@ -174,7 +188,7 @@ var DropList = /*#__PURE__*/function (_Component) {
174
188
  position: position,
175
189
  onPositioned: onPositioned
176
190
  }, jsx("div", {
177
- css: this.triggerStyles,
191
+ css: [this.triggerStyles, fg('p2m-drop-down-motion') && this.motionStyles],
178
192
  ref: this.handleTriggerRef
179
193
  }, trigger)));
180
194
  }
@@ -5,12 +5,11 @@ import { createWrapSelectionTransaction } from './create-wrap-selection-transact
5
5
  * 2. If current block can not be wrapped inside wrapping block it will create a new block below selection,
6
6
  * and set selection on it.
7
7
  */
8
- export function wrapSelectionIn(type, nodeAttributes) {
8
+ export function wrapSelectionIn(type) {
9
9
  return function (state, dispatch) {
10
10
  var tr = createWrapSelectionTransaction({
11
11
  state: state,
12
- type: type,
13
- nodeAttributes: nodeAttributes
12
+ type: type
14
13
  });
15
14
  if (dispatch) {
16
15
  dispatch(tr);
@@ -0,0 +1,14 @@
1
+ /**
2
+ * A dynamic bit array implementation that allows for efficient storage and manipulation of bits.
3
+ * It supports dynamic resizing and provides methods for setting and getting bit values.
4
+ * This is useful for scenarios where you need to manage a large number of boolean flags efficiently.
5
+ */
6
+ export declare class DynamicBitArray {
7
+ private chunkSize;
8
+ private chunkTotalBitSize;
9
+ private bitArrays;
10
+ constructor(chunkSize?: number);
11
+ set(index: number, value: boolean): void;
12
+ get(index: number): boolean;
13
+ private getChunk;
14
+ }
@@ -0,0 +1,9 @@
1
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ export declare class NodeAnchorProvider {
4
+ private cache;
5
+ private count;
6
+ private existingPos;
7
+ getOrGenerateId(node: PMNode, pos: number): string | null;
8
+ }
9
+ export declare const getNodeIdProvider: (editorView: EditorView) => NodeAnchorProvider;
@@ -15,4 +15,6 @@ import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
15
15
  * - `data-prosemirror-node-inline` (if applicable): Indicates if the node is inline.
16
16
  * - `data-prosemirror-mark-name` (if applicable): The name of the mark.
17
17
  */
18
- export declare const createProseMirrorMetadata: (nodeOrMark: PMNode | PMMark) => Record<string, string>;
18
+ export declare const createProseMirrorMetadata: (nodeOrMark: PMNode | PMMark, options?: {
19
+ anchrorId?: string;
20
+ }) => Record<string, string>;
@@ -13,9 +13,12 @@ import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
13
13
  * @param {PMNode} params.node - The ProseMirror node from which to derive metadata.
14
14
  * @param {HTMLElement} params.dom - The DOM element to which the metadata attributes will be attached.
15
15
  */
16
- export declare const attachGenericProseMirrorMetadata: ({ nodeOrMark, dom, }: {
16
+ export declare const attachGenericProseMirrorMetadata: ({ nodeOrMark, dom, options, }: {
17
17
  nodeOrMark: PMNode | PMMark;
18
18
  dom: HTMLElement;
19
+ options?: {
20
+ anchrorId?: string;
21
+ };
19
22
  }) => void;
20
23
  export declare class SafePlugin<T = any> extends Plugin<T> {
21
24
  _isATypeSafePlugin: never;
@@ -6,4 +6,4 @@ import type { Command } from '../types';
6
6
  * 2. If current block can not be wrapped inside wrapping block it will create a new block below selection,
7
7
  * and set selection on it.
8
8
  */
9
- export declare function wrapSelectionIn(type: NodeType, nodeAttributes?: Record<string, unknown>): Command;
9
+ export declare function wrapSelectionIn(type: NodeType): Command;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * A dynamic bit array implementation that allows for efficient storage and manipulation of bits.
3
+ * It supports dynamic resizing and provides methods for setting and getting bit values.
4
+ * This is useful for scenarios where you need to manage a large number of boolean flags efficiently.
5
+ */
6
+ export declare class DynamicBitArray {
7
+ private chunkSize;
8
+ private chunkTotalBitSize;
9
+ private bitArrays;
10
+ constructor(chunkSize?: number);
11
+ set(index: number, value: boolean): void;
12
+ get(index: number): boolean;
13
+ private getChunk;
14
+ }
@@ -0,0 +1,9 @@
1
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ export declare class NodeAnchorProvider {
4
+ private cache;
5
+ private count;
6
+ private existingPos;
7
+ getOrGenerateId(node: PMNode, pos: number): string | null;
8
+ }
9
+ export declare const getNodeIdProvider: (editorView: EditorView) => NodeAnchorProvider;
@@ -15,4 +15,6 @@ import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
15
15
  * - `data-prosemirror-node-inline` (if applicable): Indicates if the node is inline.
16
16
  * - `data-prosemirror-mark-name` (if applicable): The name of the mark.
17
17
  */
18
- export declare const createProseMirrorMetadata: (nodeOrMark: PMNode | PMMark) => Record<string, string>;
18
+ export declare const createProseMirrorMetadata: (nodeOrMark: PMNode | PMMark, options?: {
19
+ anchrorId?: string;
20
+ }) => Record<string, string>;
@@ -13,9 +13,12 @@ import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
13
13
  * @param {PMNode} params.node - The ProseMirror node from which to derive metadata.
14
14
  * @param {HTMLElement} params.dom - The DOM element to which the metadata attributes will be attached.
15
15
  */
16
- export declare const attachGenericProseMirrorMetadata: ({ nodeOrMark, dom, }: {
16
+ export declare const attachGenericProseMirrorMetadata: ({ nodeOrMark, dom, options, }: {
17
17
  nodeOrMark: PMNode | PMMark;
18
18
  dom: HTMLElement;
19
+ options?: {
20
+ anchrorId?: string;
21
+ };
19
22
  }) => void;
20
23
  export declare class SafePlugin<T = any> extends Plugin<T> {
21
24
  _isATypeSafePlugin: never;
@@ -6,4 +6,4 @@ import type { Command } from '../types';
6
6
  * 2. If current block can not be wrapped inside wrapping block it will create a new block below selection,
7
7
  * and set selection on it.
8
8
  */
9
- export declare function wrapSelectionIn(type: NodeType, nodeAttributes?: Record<string, unknown>): Command;
9
+ export declare function wrapSelectionIn(type: NodeType): Command;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "107.24.0",
3
+ "version": "107.25.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/"
@@ -130,7 +130,7 @@
130
130
  "@atlaskit/analytics-namespaced-context": "^7.0.0",
131
131
  "@atlaskit/analytics-next": "^11.1.0",
132
132
  "@atlaskit/atlassian-context": "^0.4.0",
133
- "@atlaskit/button": "^23.3.0",
133
+ "@atlaskit/button": "^23.4.0",
134
134
  "@atlaskit/code": "^17.2.0",
135
135
  "@atlaskit/codemod-utils": "^4.2.0",
136
136
  "@atlaskit/css": "^0.12.0",
@@ -174,7 +174,7 @@
174
174
  "@atlaskit/task-decision": "^19.2.0",
175
175
  "@atlaskit/textfield": "^8.0.0",
176
176
  "@atlaskit/theme": "^19.0.0",
177
- "@atlaskit/tmp-editor-statsig": "^9.29.0",
177
+ "@atlaskit/tmp-editor-statsig": "^10.0.0",
178
178
  "@atlaskit/tokens": "^6.0.0",
179
179
  "@atlaskit/tooltip": "^20.4.0",
180
180
  "@atlaskit/width-detector": "^5.0.0",
@@ -214,7 +214,7 @@
214
214
  "devDependencies": {
215
215
  "@af/visual-regression": "workspace:^",
216
216
  "@atlaskit/media-core": "^37.0.0",
217
- "@atlaskit/media-test-helpers": "^38.0.0",
217
+ "@atlaskit/media-test-helpers": "^39.0.0",
218
218
  "@atlaskit/util-data-test": "^18.1.0",
219
219
  "@atlaskit/visual-regression": "workspace:^",
220
220
  "@testing-library/dom": "^10.1.0",
@@ -362,7 +362,7 @@
362
362
  "platform_editor_find_and_replace_improvements_1": {
363
363
  "type": "boolean"
364
364
  },
365
- "platform_editor_ol_padding_fix": {
365
+ "p2m-drop-down-motion": {
366
366
  "type": "boolean"
367
367
  }
368
368
  }