@atlaskit/editor-common 110.15.1 → 110.16.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 (69) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/afm-dev-agents/tsconfig.json +3 -0
  4. package/afm-jira/tsconfig.json +3 -0
  5. package/afm-passionfruit/tsconfig.json +3 -0
  6. package/afm-post-office/tsconfig.json +3 -0
  7. package/afm-rovo-extension/tsconfig.json +3 -0
  8. package/afm-townsquare/tsconfig.json +3 -0
  9. package/dist/cjs/block-menu/block-link.js +40 -0
  10. package/dist/cjs/block-menu/index.js +20 -1
  11. package/dist/cjs/experiences/Experience.js +110 -0
  12. package/dist/cjs/experiences/ExperienceCheck.js +1 -0
  13. package/dist/cjs/experiences/ExperienceCheckComposite.js +35 -0
  14. package/dist/cjs/experiences/ExperienceCheckDomMutation.js +68 -0
  15. package/dist/cjs/experiences/ExperienceCheckTimeout.js +41 -0
  16. package/dist/cjs/experiences/consts.js +26 -0
  17. package/dist/cjs/experiences/index.js +40 -0
  18. package/dist/cjs/monitoring/error.js +1 -1
  19. package/dist/cjs/ui/DropList/index.js +1 -1
  20. package/dist/cjs/ui-color/ColorPalette/Palettes/highlightColorPalette.js +2 -0
  21. package/dist/cjs/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +1 -1
  22. package/dist/es2019/block-menu/block-link.js +32 -0
  23. package/dist/es2019/block-menu/index.js +2 -1
  24. package/dist/es2019/experiences/Experience.js +80 -0
  25. package/dist/es2019/experiences/ExperienceCheck.js +0 -0
  26. package/dist/es2019/experiences/ExperienceCheckComposite.js +16 -0
  27. package/dist/es2019/experiences/ExperienceCheckDomMutation.js +55 -0
  28. package/dist/es2019/experiences/ExperienceCheckTimeout.js +26 -0
  29. package/dist/es2019/experiences/consts.js +20 -0
  30. package/dist/es2019/experiences/index.js +8 -0
  31. package/dist/es2019/monitoring/error.js +1 -1
  32. package/dist/es2019/ui/DropList/index.js +1 -1
  33. package/dist/es2019/ui-color/ColorPalette/Palettes/highlightColorPalette.js +2 -0
  34. package/dist/es2019/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +2 -0
  35. package/dist/esm/block-menu/block-link.js +34 -0
  36. package/dist/esm/block-menu/index.js +2 -1
  37. package/dist/esm/experiences/Experience.js +103 -0
  38. package/dist/esm/experiences/ExperienceCheck.js +0 -0
  39. package/dist/esm/experiences/ExperienceCheckComposite.js +28 -0
  40. package/dist/esm/experiences/ExperienceCheckDomMutation.js +61 -0
  41. package/dist/esm/experiences/ExperienceCheckTimeout.js +34 -0
  42. package/dist/esm/experiences/consts.js +20 -0
  43. package/dist/esm/experiences/index.js +8 -0
  44. package/dist/esm/monitoring/error.js +1 -1
  45. package/dist/esm/ui/DropList/index.js +1 -1
  46. package/dist/esm/ui-color/ColorPalette/Palettes/highlightColorPalette.js +2 -0
  47. package/dist/esm/ui-color/ColorPalette/Palettes/panelBackgroundPalette.js +2 -0
  48. package/dist/types/analytics/types/media-events.d.ts +5 -1
  49. package/dist/types/block-menu/block-link.d.ts +17 -0
  50. package/dist/types/block-menu/index.d.ts +1 -0
  51. package/dist/types/experiences/Experience.d.ts +41 -0
  52. package/dist/types/experiences/ExperienceCheck.d.ts +14 -0
  53. package/dist/types/experiences/ExperienceCheckComposite.d.ts +12 -0
  54. package/dist/types/experiences/ExperienceCheckDomMutation.d.ts +53 -0
  55. package/dist/types/experiences/ExperienceCheckTimeout.d.ts +13 -0
  56. package/dist/types/experiences/consts.d.ts +20 -0
  57. package/dist/types/experiences/index.d.ts +7 -0
  58. package/dist/types-ts4.5/analytics/types/media-events.d.ts +5 -1
  59. package/dist/types-ts4.5/block-menu/block-link.d.ts +17 -0
  60. package/dist/types-ts4.5/block-menu/index.d.ts +1 -0
  61. package/dist/types-ts4.5/experiences/Experience.d.ts +41 -0
  62. package/dist/types-ts4.5/experiences/ExperienceCheck.d.ts +14 -0
  63. package/dist/types-ts4.5/experiences/ExperienceCheckComposite.d.ts +12 -0
  64. package/dist/types-ts4.5/experiences/ExperienceCheckDomMutation.d.ts +53 -0
  65. package/dist/types-ts4.5/experiences/ExperienceCheckTimeout.d.ts +13 -0
  66. package/dist/types-ts4.5/experiences/consts.d.ts +20 -0
  67. package/dist/types-ts4.5/experiences/index.d.ts +7 -0
  68. package/experiences/package.json +17 -0
  69. package/package.json +5 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 110.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`e5f402044b1c6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e5f402044b1c6) -
8
+ Add media render error analytics
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 110.15.2
15
+
16
+ ### Patch Changes
17
+
18
+ - [`916133ef0c6dd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/916133ef0c6dd) -
19
+ [ux] Editor experience tracking foundation
20
+ - [`6e51d74bb2a29`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6e51d74bb2a29) -
21
+ [ux] ED-29560 Use hash instead of query parameter for link to block
22
+ - Updated dependencies
23
+
3
24
  ## 110.15.1
4
25
 
5
26
  ### Patch Changes
@@ -182,6 +182,9 @@
182
182
  {
183
183
  "path": "../../../design-system/tooltip/afm-cc/tsconfig.json"
184
184
  },
185
+ {
186
+ "path": "../../../data/ufo-external/afm-cc/tsconfig.json"
187
+ },
185
188
  {
186
189
  "path": "../../../design-system/width-detector/afm-cc/tsconfig.json"
187
190
  },
@@ -182,6 +182,9 @@
182
182
  {
183
183
  "path": "../../../design-system/tooltip/afm-dev-agents/tsconfig.json"
184
184
  },
185
+ {
186
+ "path": "../../../data/ufo-external/afm-dev-agents/tsconfig.json"
187
+ },
185
188
  {
186
189
  "path": "../../../design-system/width-detector/afm-dev-agents/tsconfig.json"
187
190
  },
@@ -182,6 +182,9 @@
182
182
  {
183
183
  "path": "../../../design-system/tooltip/afm-jira/tsconfig.json"
184
184
  },
185
+ {
186
+ "path": "../../../data/ufo-external/afm-jira/tsconfig.json"
187
+ },
185
188
  {
186
189
  "path": "../../../design-system/width-detector/afm-jira/tsconfig.json"
187
190
  },
@@ -182,6 +182,9 @@
182
182
  {
183
183
  "path": "../../../design-system/tooltip/afm-passionfruit/tsconfig.json"
184
184
  },
185
+ {
186
+ "path": "../../../data/ufo-external/afm-passionfruit/tsconfig.json"
187
+ },
185
188
  {
186
189
  "path": "../../../design-system/width-detector/afm-passionfruit/tsconfig.json"
187
190
  },
@@ -182,6 +182,9 @@
182
182
  {
183
183
  "path": "../../../design-system/tooltip/afm-post-office/tsconfig.json"
184
184
  },
185
+ {
186
+ "path": "../../../data/ufo-external/afm-post-office/tsconfig.json"
187
+ },
185
188
  {
186
189
  "path": "../../../design-system/width-detector/afm-post-office/tsconfig.json"
187
190
  },
@@ -182,6 +182,9 @@
182
182
  {
183
183
  "path": "../../../design-system/tooltip/afm-rovo-extension/tsconfig.json"
184
184
  },
185
+ {
186
+ "path": "../../../data/ufo-external/afm-rovo-extension/tsconfig.json"
187
+ },
185
188
  {
186
189
  "path": "../../../design-system/width-detector/afm-rovo-extension/tsconfig.json"
187
190
  },
@@ -182,6 +182,9 @@
182
182
  {
183
183
  "path": "../../../design-system/tooltip/afm-townsquare/tsconfig.json"
184
184
  },
185
+ {
186
+ "path": "../../../data/ufo-external/afm-townsquare/tsconfig.json"
187
+ },
185
188
  {
186
189
  "path": "../../../design-system/width-detector/afm-townsquare/tsconfig.json"
187
190
  },
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isBlockLinkHash = exports.extractBlockIdFromLinkHash = exports.DEFAULT_BLOCK_LINK_HASH_PREFIX = void 0;
7
+ var DEFAULT_BLOCK_LINK_HASH_PREFIX = exports.DEFAULT_BLOCK_LINK_HASH_PREFIX = 'block-';
8
+
9
+ /**
10
+ * Matches hashes that start with the block link prefix followed by a UUID
11
+ *
12
+ * @param hash The hash string to check (e.g., '#block-123e4567-e89b-12d3-a456-426614174000' or 'block-123e4567-e89b-12d3-a456-426614174000')
13
+ * @param prefix The prefix to look for (default is 'block-')
14
+ * @returns True if the hash matches the block link pattern, false otherwise
15
+ */
16
+ var isBlockLinkHash = exports.isBlockLinkHash = function isBlockLinkHash(hash) {
17
+ var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_BLOCK_LINK_HASH_PREFIX;
18
+ if (!hash || !prefix) {
19
+ return false;
20
+ }
21
+ var regex = new RegExp("^#?".concat(prefix, "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"), 'iu');
22
+ return regex.test(hash);
23
+ };
24
+
25
+ /**
26
+ * Extracts the block ID from a block link hash.
27
+ *
28
+ * @param hash The hash string to extract the block ID from (e.g., '#block-123e4567-e89b-12d3-a456-426614174000' or 'block-123e4567-e89b-12d3-a456-426614174000')
29
+ * @param prefix The prefix to look for (default is 'block-')
30
+ * @returns The extracted block ID if the hash is valid, null otherwise
31
+ */
32
+ var extractBlockIdFromLinkHash = exports.extractBlockIdFromLinkHash = function extractBlockIdFromLinkHash(hash) {
33
+ var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_BLOCK_LINK_HASH_PREFIX;
34
+ if (!isBlockLinkHash(hash, prefix)) {
35
+ return null;
36
+ }
37
+ // Remove leading # if present, then remove the prefix
38
+ var normalized = hash.startsWith('#') ? hash.slice(1) : hash;
39
+ return normalized.slice(prefix.length);
40
+ };
@@ -51,6 +51,12 @@ Object.defineProperty(exports, "CREATE_SYNCED_BLOCK_MENU_ITEM", {
51
51
  return _key.CREATE_SYNCED_BLOCK_MENU_ITEM;
52
52
  }
53
53
  });
54
+ Object.defineProperty(exports, "DEFAULT_BLOCK_LINK_HASH_PREFIX", {
55
+ enumerable: true,
56
+ get: function get() {
57
+ return _blockLink.DEFAULT_BLOCK_LINK_HASH_PREFIX;
58
+ }
59
+ });
54
60
  Object.defineProperty(exports, "DELETE_MENU_ITEM", {
55
61
  enumerable: true,
56
62
  get: function get() {
@@ -225,6 +231,18 @@ Object.defineProperty(exports, "PRIMARY_MENU_SECTION_RANK", {
225
231
  return _rank.PRIMARY_MENU_SECTION_RANK;
226
232
  }
227
233
  });
234
+ Object.defineProperty(exports, "extractBlockIdFromLinkHash", {
235
+ enumerable: true,
236
+ get: function get() {
237
+ return _blockLink.extractBlockIdFromLinkHash;
238
+ }
239
+ });
240
+ Object.defineProperty(exports, "isBlockLinkHash", {
241
+ enumerable: true,
242
+ get: function get() {
243
+ return _blockLink.isBlockLinkHash;
244
+ }
245
+ });
228
246
  Object.defineProperty(exports, "messages", {
229
247
  enumerable: true,
230
248
  get: function get() {
@@ -233,4 +251,5 @@ Object.defineProperty(exports, "messages", {
233
251
  });
234
252
  var _messages = require("./messages");
235
253
  var _key = require("./key");
236
- var _rank = require("./rank");
254
+ var _rank = require("./rank");
255
+ var _blockLink = require("./block-link");
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.Experience = void 0;
8
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var _ufo = require("@atlaskit/ufo");
11
+ var _ExperienceCheckComposite = require("./ExperienceCheckComposite");
12
+ var PROGRESS_STATES = [_ufo.UFOExperienceState.STARTED.id, _ufo.UFOExperienceState.IN_PROGRESS.id];
13
+ var Experience = exports.Experience = /*#__PURE__*/function () {
14
+ function Experience(id) {
15
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
16
+ (0, _classCallCheck2.default)(this, Experience);
17
+ this.id = id;
18
+ this.options = options;
19
+ this.check = new _ExperienceCheckComposite.ExperienceCheckComposite(this.options.checks || []);
20
+ }
21
+ return (0, _createClass2.default)(Experience, [{
22
+ key: "ufoExperience",
23
+ get: function get() {
24
+ if (!this._ufoExperience) {
25
+ this._ufoExperience = new _ufo.UFOExperience(this.id, {
26
+ type: _ufo.ExperienceTypes.Experience,
27
+ performanceType: _ufo.ExperiencePerformanceTypes.InlineResult
28
+ });
29
+ }
30
+ return this._ufoExperience;
31
+ }
32
+ }, {
33
+ key: "startCheck",
34
+ value: function startCheck() {
35
+ var _this = this;
36
+ this.stopCheck();
37
+ this.check.start(function (result) {
38
+ if (result.status === 'success') {
39
+ _this.success();
40
+ } else {
41
+ _this.failure({
42
+ reason: result.reason
43
+ });
44
+ }
45
+ });
46
+ }
47
+ }, {
48
+ key: "stopCheck",
49
+ value: function stopCheck() {
50
+ this.check.stop();
51
+ }
52
+ }, {
53
+ key: "isInProgress",
54
+ value: function isInProgress() {
55
+ return PROGRESS_STATES.includes(this.ufoExperience.state.id);
56
+ }
57
+
58
+ /**
59
+ * Starts UFO experience tracking and starts all checks which monitor for completion of the experience.
60
+ */
61
+ }, {
62
+ key: "start",
63
+ value: function start() {
64
+ this.ufoExperience.start();
65
+ if (this.isInProgress()) {
66
+ this.startCheck();
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Manually mark the experience as successful and stop any ongoing checks.
72
+ */
73
+ }, {
74
+ key: "success",
75
+ value: function success() {
76
+ this.stopCheck();
77
+ this.ufoExperience.success();
78
+ }
79
+
80
+ /**
81
+ * Manually abort the experience and stop any ongoing checks.
82
+ *
83
+ * Typically used when the experience did not complete due to user action and should not be marked as success or failure,
84
+ * for example on unmount or when navigating away from a page.
85
+ */
86
+ }, {
87
+ key: "abort",
88
+ value: function abort() {
89
+ this.stopCheck();
90
+ this.ufoExperience.abort();
91
+ }
92
+
93
+ /**
94
+ * Manually mark the experience as failed and stop any ongoing checks.
95
+ */
96
+ }, {
97
+ key: "failure",
98
+ value: function failure() {
99
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
100
+ _ref$reason = _ref.reason,
101
+ reason = _ref$reason === void 0 ? 'error' : _ref$reason;
102
+ this.stopCheck();
103
+ this.ufoExperience.failure({
104
+ metadata: {
105
+ reason: reason
106
+ }
107
+ });
108
+ }
109
+ }]);
110
+ }();
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.ExperienceCheckComposite = void 0;
8
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ /**
11
+ * Composite check that combines multiple checks.
12
+ *
13
+ * Starts and stops all contained checks.
14
+ */
15
+ var ExperienceCheckComposite = exports.ExperienceCheckComposite = /*#__PURE__*/function () {
16
+ function ExperienceCheckComposite(checks) {
17
+ (0, _classCallCheck2.default)(this, ExperienceCheckComposite);
18
+ this.checks = checks;
19
+ }
20
+ return (0, _createClass2.default)(ExperienceCheckComposite, [{
21
+ key: "start",
22
+ value: function start(callback) {
23
+ this.checks.forEach(function (check) {
24
+ return check.start(callback);
25
+ });
26
+ }
27
+ }, {
28
+ key: "stop",
29
+ value: function stop() {
30
+ this.checks.forEach(function (check) {
31
+ return check.stop();
32
+ });
33
+ }
34
+ }]);
35
+ }();
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.ExperienceCheckDomMutation = void 0;
8
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var _consts = require("./consts");
11
+ /**
12
+ * Check for the completion of an experience based on DOM mutations
13
+ *
14
+ * Uses a MutationObserver to monitor DOM changes and invokes the provided
15
+ * callback when relevant mutations are detected.
16
+ *
17
+ * Will result in success or failure based on the outcome of the callback.
18
+ */
19
+ var ExperienceCheckDomMutation = exports.ExperienceCheckDomMutation = /*#__PURE__*/function () {
20
+ function ExperienceCheckDomMutation(_ref) {
21
+ var onDomMutation = _ref.onDomMutation,
22
+ observeConfig = _ref.observeConfig;
23
+ (0, _classCallCheck2.default)(this, ExperienceCheckDomMutation);
24
+ this.onDomMutation = onDomMutation;
25
+ this.observeConfig = observeConfig;
26
+ }
27
+ return (0, _createClass2.default)(ExperienceCheckDomMutation, [{
28
+ key: "start",
29
+ value: function start(callback) {
30
+ var _this = this;
31
+ this.stop();
32
+ var config = this.observeConfig();
33
+ if (!config) {
34
+ callback({
35
+ status: 'failure',
36
+ reason: _consts.EXPERIENCE_FAILURE_REASON.DOM_MUTATION_TARGET_NOT_FOUND
37
+ });
38
+ return;
39
+ }
40
+ this.mutationObserver = new MutationObserver(function (mutations) {
41
+ try {
42
+ var result = _this.onDomMutation({
43
+ mutations: mutations
44
+ });
45
+ if (result) {
46
+ callback(result);
47
+ }
48
+ } catch (error) {
49
+ callback({
50
+ status: 'failure',
51
+ reason: _consts.EXPERIENCE_FAILURE_REASON.DOM_MUTATION_CHECK_ERROR
52
+ });
53
+ }
54
+ });
55
+ var target = config.target,
56
+ options = config.options;
57
+ this.mutationObserver.observe(target, options);
58
+ }
59
+ }, {
60
+ key: "stop",
61
+ value: function stop() {
62
+ if (this.mutationObserver) {
63
+ this.mutationObserver.disconnect();
64
+ this.mutationObserver = undefined;
65
+ }
66
+ }
67
+ }]);
68
+ }();
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.ExperienceCheckTimeout = void 0;
8
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var _consts = require("./consts");
11
+ /**
12
+ * Check for the completion of an experience based on a timeout
13
+ *
14
+ * Will always result in failure after the timeout duration
15
+ */
16
+ var ExperienceCheckTimeout = exports.ExperienceCheckTimeout = /*#__PURE__*/function () {
17
+ function ExperienceCheckTimeout(maxDurationMs) {
18
+ (0, _classCallCheck2.default)(this, ExperienceCheckTimeout);
19
+ this.maxDurationMs = maxDurationMs;
20
+ }
21
+ return (0, _createClass2.default)(ExperienceCheckTimeout, [{
22
+ key: "start",
23
+ value: function start(callback) {
24
+ this.stop();
25
+ this.timeoutId = setTimeout(function () {
26
+ callback({
27
+ status: 'failure',
28
+ reason: _consts.EXPERIENCE_FAILURE_REASON.TIMEOUT
29
+ });
30
+ }, this.maxDurationMs);
31
+ }
32
+ }, {
33
+ key: "stop",
34
+ value: function stop() {
35
+ if (this.timeoutId) {
36
+ clearTimeout(this.timeoutId);
37
+ this.timeoutId = undefined;
38
+ }
39
+ }
40
+ }]);
41
+ }();
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EXPERIENCE_FAILURE_REASON = void 0;
7
+ /**
8
+ * Built-in failure reasons for experience checks
9
+ *
10
+ * These are used by the various ExperienceCheck implementations to
11
+ * provide consistent, well-known failure reasons for analytics and debugging.
12
+ */
13
+ var EXPERIENCE_FAILURE_REASON = exports.EXPERIENCE_FAILURE_REASON = {
14
+ /**
15
+ * Experience timed out before completion
16
+ */
17
+ TIMEOUT: 'timeout',
18
+ /**
19
+ * Target element could not be found when starting DOM mutation observation
20
+ */
21
+ DOM_MUTATION_TARGET_NOT_FOUND: 'dom-mutation-target-not-found',
22
+ /**
23
+ * Error occurred during DOM mutation check execution
24
+ */
25
+ DOM_MUTATION_CHECK_ERROR: 'dom-mutation-check-error'
26
+ };
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "EXPERIENCE_FAILURE_REASON", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _consts.EXPERIENCE_FAILURE_REASON;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "Experience", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _Experience.Experience;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "ExperienceCheckComposite", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _ExperienceCheckComposite.ExperienceCheckComposite;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "ExperienceCheckDomMutation", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _ExperienceCheckDomMutation.ExperienceCheckDomMutation;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "ExperienceCheckTimeout", {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _ExperienceCheckTimeout.ExperienceCheckTimeout;
34
+ }
35
+ });
36
+ var _Experience = require("./Experience");
37
+ var _consts = require("./consts");
38
+ var _ExperienceCheckComposite = require("./ExperienceCheckComposite");
39
+ var _ExperienceCheckDomMutation = require("./ExperienceCheckDomMutation");
40
+ var _ExperienceCheckTimeout = require("./ExperienceCheckTimeout");
@@ -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 = "110.15.0";
19
+ var packageVersion = "110.15.2";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // Ignored via go/ees007
@@ -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 = "110.15.0";
27
+ var packageVersion = "110.15.2";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -58,6 +58,7 @@ var EditorDiagonalLineIcon = exports.EditorDiagonalLineIcon = function EditorDia
58
58
  */
59
59
  var highlightColorPalette = exports.highlightColorPalette = [{
60
60
  value: REMOVE_HIGHLIGHT_COLOR,
61
+ // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
61
62
  label: 'No color',
62
63
  // Mostly informative, only used for analytics
63
64
  border: "var(--ds-border, #091E4224)",
@@ -69,6 +70,7 @@ _adfSchema.backgroundColorPalette.forEach(function (label, color) {
69
70
  });
70
71
  var highlightColorPaletteNext = exports.highlightColorPaletteNext = [{
71
72
  value: REMOVE_HIGHLIGHT_COLOR,
73
+ // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
72
74
  label: 'No color',
73
75
  // Mostly informative, only used for analytics
74
76
  border: "var(--ds-border, #091E4224)",
@@ -9,7 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _panel = require("../../../panel");
10
10
  var _common = require("./common");
11
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; }
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; }
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; } /* eslint-disable @atlassian/i18n/no-literal-string-in-object */
13
13
  /** this is not new usage - old code extracted from editor-core */
14
14
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
15
15
  var panelBackgroundPalette = exports.panelBackgroundPalette = [{
@@ -0,0 +1,32 @@
1
+ export const DEFAULT_BLOCK_LINK_HASH_PREFIX = 'block-';
2
+
3
+ /**
4
+ * Matches hashes that start with the block link prefix followed by a UUID
5
+ *
6
+ * @param hash The hash string to check (e.g., '#block-123e4567-e89b-12d3-a456-426614174000' or 'block-123e4567-e89b-12d3-a456-426614174000')
7
+ * @param prefix The prefix to look for (default is 'block-')
8
+ * @returns True if the hash matches the block link pattern, false otherwise
9
+ */
10
+ export const isBlockLinkHash = (hash, prefix = DEFAULT_BLOCK_LINK_HASH_PREFIX) => {
11
+ if (!hash || !prefix) {
12
+ return false;
13
+ }
14
+ const regex = new RegExp(`^#?${prefix}[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`, 'iu');
15
+ return regex.test(hash);
16
+ };
17
+
18
+ /**
19
+ * Extracts the block ID from a block link hash.
20
+ *
21
+ * @param hash The hash string to extract the block ID from (e.g., '#block-123e4567-e89b-12d3-a456-426614174000' or 'block-123e4567-e89b-12d3-a456-426614174000')
22
+ * @param prefix The prefix to look for (default is 'block-')
23
+ * @returns The extracted block ID if the hash is valid, null otherwise
24
+ */
25
+ export const extractBlockIdFromLinkHash = (hash, prefix = DEFAULT_BLOCK_LINK_HASH_PREFIX) => {
26
+ if (!isBlockLinkHash(hash, prefix)) {
27
+ return null;
28
+ }
29
+ // Remove leading # if present, then remove the prefix
30
+ const normalized = hash.startsWith('#') ? hash.slice(1) : hash;
31
+ return normalized.slice(prefix.length);
32
+ };
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/editor/no-re-export */
2
2
  export { messages } from './messages';
3
3
  export { FORMAT_HEADING_1_MENU_ITEM, FORMAT_HEADING_2_MENU_ITEM, FORMAT_HEADING_3_MENU_ITEM, FORMAT_HEADING_4_MENU_ITEM, FORMAT_HEADING_5_MENU_ITEM, FORMAT_HEADING_6_MENU_ITEM, FORMAT_PARAGRAPH_MENU_ITEM, FORMAT_QUOTE_MENU_ITEM, FORMAT_EXPAND_MENU_ITEM, FORMAT_LAYOUT_MENU_ITEM, FORMAT_PANEL_MENU_ITEM, FORMAT_CODE_BLOCK_MENU_ITEM, FORMAT_BULLETED_LIST_MENU_ITEM, FORMAT_NUMBERED_LIST_MENU_ITEM, FORMAT_TASK_LIST_MENU_ITEM, NESTED_FORMAT_MENU_SECTION, COPY_MENU_SECTION, DELETE_MENU_SECTION, MOVE_UP_DOWN_MENU_SECTION, FORMAT_MENU_ITEM, COPY_BLOCK_MENU_ITEM, COPY_LINK_MENU_ITEM, MOVE_UP_MENU_ITEM, MOVE_DOWN_MENU_ITEM, DELETE_MENU_ITEM, NESTED_FORMAT_MENU, PRIMARY_MENU_SECTION, ADD_BLOCKS_MENU_SECTION, CREATE_SYNCED_BLOCK_MENU_ITEM } from './key';
4
- export { FORMAT_NESTED_MENU_RANK, FORMAT_NESTED_MENU_RANK_REVISED, BLOCK_MENU_SECTION_RANK, PRIMARY_MENU_SECTION_RANK, COPY_MENU_SECTION_RANK, DELETE_SECTION_RANK, MOVE_BLOCK_SECTION_RANK, ADD_BLOCKS_MENU_SECTION_RANK } from './rank';
4
+ export { FORMAT_NESTED_MENU_RANK, FORMAT_NESTED_MENU_RANK_REVISED, BLOCK_MENU_SECTION_RANK, PRIMARY_MENU_SECTION_RANK, COPY_MENU_SECTION_RANK, DELETE_SECTION_RANK, MOVE_BLOCK_SECTION_RANK, ADD_BLOCKS_MENU_SECTION_RANK } from './rank';
5
+ export { DEFAULT_BLOCK_LINK_HASH_PREFIX, isBlockLinkHash, extractBlockIdFromLinkHash } from './block-link';