@atlaskit/editor-common 79.1.1 → 79.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 79.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#98035](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98035)
8
+ [`27df90210ecb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/27df90210ecb) -
9
+ Updated ADF validators to allow optional localId attribute on paragraph and heading nodes in
10
+ stage0
11
+
12
+ ### Patch Changes
13
+
14
+ - [#97158](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97158)
15
+ [`5568b03ef792`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5568b03ef792) -
16
+ [ux] EDF-661: Fix AI Panels Undo behaviour during insert flows (revert extension insertion) and
17
+ regenerate flows (revert content changes)
18
+ - Updated dependencies
19
+
3
20
  ## 79.1.1
4
21
 
5
22
  ### Patch Changes
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
16
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
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 = "79.1.1";
19
+ var packageVersion = "79.2.0";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // TODO: Sanitise the URL instead of just removing it
@@ -20,7 +20,7 @@ var _Layer = _interopRequireDefault(require("../Layer"));
20
20
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
21
21
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "79.1.1";
23
+ var packageVersion = "79.2.0";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  var DropList = /*#__PURE__*/function (_Component) {
@@ -524,6 +524,21 @@ var getValidNode = exports.getValidNode = function getValidNode(originalNode) {
524
524
  }
525
525
  case 'paragraph':
526
526
  {
527
+ if (adfStage === 'stage0') {
528
+ var paragraphNode = {
529
+ type: type,
530
+ content: content || []
531
+ };
532
+ if (attrs && attrs.localId) {
533
+ paragraphNode.attrs = {
534
+ localId: attrs.localId
535
+ };
536
+ }
537
+ if (marks) {
538
+ paragraphNode.marks = (0, _toConsumableArray2.default)(marks);
539
+ }
540
+ return paragraphNode;
541
+ }
527
542
  return marks ? {
528
543
  type: type,
529
544
  content: content || [],
@@ -562,6 +577,22 @@ var getValidNode = exports.getValidNode = function getValidNode(originalNode) {
562
577
  return x >= a && x <= b;
563
578
  };
564
579
  if (level && between(level, 1, 6)) {
580
+ if (adfStage === 'stage0') {
581
+ var headingNode = {
582
+ type: type,
583
+ content: content,
584
+ attrs: {
585
+ level: level
586
+ }
587
+ };
588
+ if (attrs.localId) {
589
+ headingNode.attrs.localId = attrs.localId;
590
+ }
591
+ if (marks) {
592
+ headingNode.marks = (0, _toConsumableArray2.default)(marks);
593
+ }
594
+ return headingNode;
595
+ }
565
596
  return marks ? {
566
597
  type: type,
567
598
  content: content,
@@ -1,6 +1,6 @@
1
1
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
2
2
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
3
- const packageVersion = "79.1.1";
3
+ const packageVersion = "79.2.0";
4
4
  const sanitiseSentryEvents = (data, _hint) => {
5
5
  // Remove URL as it has UGC
6
6
  // TODO: Sanitise the URL instead of just removing it
@@ -7,7 +7,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
7
7
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
8
8
  import Layer from '../Layer';
9
9
  const packageName = "@atlaskit/editor-common";
10
- const packageVersion = "79.1.1";
10
+ const packageVersion = "79.2.0";
11
11
  const halfFocusRing = 1;
12
12
  const dropOffset = '0, 8';
13
13
  class DropList extends Component {
@@ -511,6 +511,21 @@ export const getValidNode = (originalNode, schema = defaultSchema, adfStage = 'f
511
511
  }
512
512
  case 'paragraph':
513
513
  {
514
+ if (adfStage === 'stage0') {
515
+ let paragraphNode = {
516
+ type,
517
+ content: content || []
518
+ };
519
+ if (attrs && attrs.localId) {
520
+ paragraphNode.attrs = {
521
+ localId: attrs.localId
522
+ };
523
+ }
524
+ if (marks) {
525
+ paragraphNode.marks = [...marks];
526
+ }
527
+ return paragraphNode;
528
+ }
514
529
  return marks ? {
515
530
  type,
516
531
  content: content || [],
@@ -551,6 +566,22 @@ export const getValidNode = (originalNode, schema = defaultSchema, adfStage = 'f
551
566
  } = attrs;
552
567
  const between = (x, a, b) => x >= a && x <= b;
553
568
  if (level && between(level, 1, 6)) {
569
+ if (adfStage === 'stage0') {
570
+ let headingNode = {
571
+ type,
572
+ content: content,
573
+ attrs: {
574
+ level
575
+ }
576
+ };
577
+ if (attrs.localId) {
578
+ headingNode.attrs.localId = attrs.localId;
579
+ }
580
+ if (marks) {
581
+ headingNode.marks = [...marks];
582
+ }
583
+ return headingNode;
584
+ }
554
585
  return marks ? {
555
586
  type,
556
587
  content,
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
6
6
  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) { _defineProperty(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; }
7
7
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
8
8
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
9
- var packageVersion = "79.1.1";
9
+ var packageVersion = "79.2.0";
10
10
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
11
11
  // Remove URL as it has UGC
12
12
  // TODO: Sanitise the URL instead of just removing it
@@ -15,7 +15,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
15
15
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
16
16
  import Layer from '../Layer';
17
17
  var packageName = "@atlaskit/editor-common";
18
- var packageVersion = "79.1.1";
18
+ var packageVersion = "79.2.0";
19
19
  var halfFocusRing = 1;
20
20
  var dropOffset = '0, 8';
21
21
  var DropList = /*#__PURE__*/function (_Component) {
@@ -517,6 +517,21 @@ export var getValidNode = function getValidNode(originalNode) {
517
517
  }
518
518
  case 'paragraph':
519
519
  {
520
+ if (adfStage === 'stage0') {
521
+ var paragraphNode = {
522
+ type: type,
523
+ content: content || []
524
+ };
525
+ if (attrs && attrs.localId) {
526
+ paragraphNode.attrs = {
527
+ localId: attrs.localId
528
+ };
529
+ }
530
+ if (marks) {
531
+ paragraphNode.marks = _toConsumableArray(marks);
532
+ }
533
+ return paragraphNode;
534
+ }
520
535
  return marks ? {
521
536
  type: type,
522
537
  content: content || [],
@@ -555,6 +570,22 @@ export var getValidNode = function getValidNode(originalNode) {
555
570
  return x >= a && x <= b;
556
571
  };
557
572
  if (level && between(level, 1, 6)) {
573
+ if (adfStage === 'stage0') {
574
+ var headingNode = {
575
+ type: type,
576
+ content: content,
577
+ attrs: {
578
+ level: level
579
+ }
580
+ };
581
+ if (attrs.localId) {
582
+ headingNode.attrs.localId = attrs.localId;
583
+ }
584
+ if (marks) {
585
+ headingNode.marks = _toConsumableArray(marks);
586
+ }
587
+ return headingNode;
588
+ }
558
589
  return marks ? {
559
590
  type: type,
560
591
  content: content,
@@ -23,7 +23,9 @@ export type ExtensionAPI<T extends Parameters = Parameters> = {
23
23
  allowSelectionToNewNode?: boolean;
24
24
  }) => void;
25
25
  scrollTo: (localId: string) => void;
26
- update: (localId: string, mutationCallback: (currentValue: Pick<ADFEntity, 'content' | 'attrs' | 'marks'>) => Pick<ADFEntity, 'content' | 'attrs' | 'marks'>) => void;
26
+ update: (localId: string, mutationCallback: (currentValue: Pick<ADFEntity, 'content' | 'attrs' | 'marks'>) => Pick<ADFEntity, 'content' | 'attrs' | 'marks'>, options?: {
27
+ addToHistory?: boolean;
28
+ }) => void;
27
29
  };
28
30
  };
29
31
  export type UpdateExtension<T extends Parameters = Parameters> = (extensionParameters: T, actions?: ExtensionAPI<T>) => Promise<T | void>;
@@ -23,7 +23,9 @@ export type ExtensionAPI<T extends Parameters = Parameters> = {
23
23
  allowSelectionToNewNode?: boolean;
24
24
  }) => void;
25
25
  scrollTo: (localId: string) => void;
26
- update: (localId: string, mutationCallback: (currentValue: Pick<ADFEntity, 'content' | 'attrs' | 'marks'>) => Pick<ADFEntity, 'content' | 'attrs' | 'marks'>) => void;
26
+ update: (localId: string, mutationCallback: (currentValue: Pick<ADFEntity, 'content' | 'attrs' | 'marks'>) => Pick<ADFEntity, 'content' | 'attrs' | 'marks'>, options?: {
27
+ addToHistory?: boolean;
28
+ }) => void;
27
29
  };
28
30
  };
29
31
  export type UpdateExtension<T extends Parameters = Parameters> = (extensionParameters: T, actions?: ExtensionAPI<T>) => Promise<T | void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "79.1.1",
3
+ "version": "79.2.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/"
@@ -98,7 +98,7 @@
98
98
  "dependencies": {
99
99
  "@atlaskit/activity-provider": "^2.4.0",
100
100
  "@atlaskit/adf-schema": "^35.12.2",
101
- "@atlaskit/adf-utils": "^19.0.0",
101
+ "@atlaskit/adf-utils": "^19.1.0",
102
102
  "@atlaskit/analytics-listeners": "^8.9.0",
103
103
  "@atlaskit/analytics-namespaced-context": "^6.9.0",
104
104
  "@atlaskit/analytics-next": "^9.3.0",
@@ -132,7 +132,7 @@
132
132
  "@atlaskit/primitives": "^6.1.0",
133
133
  "@atlaskit/profilecard": "^19.11.0",
134
134
  "@atlaskit/section-message": "^6.5.0",
135
- "@atlaskit/smart-card": "^26.60.0",
135
+ "@atlaskit/smart-card": "^26.62.0",
136
136
  "@atlaskit/smart-user-picker": "^6.9.0",
137
137
  "@atlaskit/spinner": "^16.1.0",
138
138
  "@atlaskit/task-decision": "^17.10.0",