@atlaskit/editor-common 122.11.1 → 123.0.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 (70) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/cjs/ai-messages/ai-suggestions.js +13 -8
  3. package/dist/cjs/extensibility/GeneratedContentReveal.compiled.css +4 -3
  4. package/dist/cjs/extensibility/GeneratedContentReveal.js +7 -22
  5. package/dist/cjs/extensions/buildMenuItem.js +1 -1
  6. package/dist/cjs/lists/flatten-list.js +1 -73
  7. package/dist/cjs/lists/index.js +0 -26
  8. package/dist/cjs/lists/node.js +1 -78
  9. package/dist/cjs/lists/replace-content.js +1 -9
  10. package/dist/cjs/lists/selection.js +2 -29
  11. package/dist/cjs/monitoring/error.js +1 -1
  12. package/dist/cjs/node-anchor/node-anchor-provider.js +1 -3
  13. package/dist/cjs/quick-insert/build-quick-insert-menu-model.js +6 -5
  14. package/dist/cjs/quick-insert/getQuickInsertProviderMenuItemKey.js +16 -3
  15. package/dist/cjs/quick-insert/registered-menu-model.js +14 -0
  16. package/dist/cjs/quick-insert/selectQuickInsertCategoryItems.js +27 -0
  17. package/dist/cjs/ui/DropList/index.js +1 -1
  18. package/dist/es2019/ai-messages/ai-suggestions.js +13 -8
  19. package/dist/es2019/extensibility/GeneratedContentReveal.compiled.css +4 -3
  20. package/dist/es2019/extensibility/GeneratedContentReveal.js +6 -18
  21. package/dist/es2019/extensions/buildMenuItem.js +1 -1
  22. package/dist/es2019/lists/flatten-list.js +1 -76
  23. package/dist/es2019/lists/index.js +2 -4
  24. package/dist/es2019/lists/node.js +0 -77
  25. package/dist/es2019/lists/replace-content.js +1 -3
  26. package/dist/es2019/lists/selection.js +1 -31
  27. package/dist/es2019/monitoring/error.js +1 -1
  28. package/dist/es2019/node-anchor/node-anchor-provider.js +1 -3
  29. package/dist/es2019/quick-insert/build-quick-insert-menu-model.js +6 -5
  30. package/dist/es2019/quick-insert/getQuickInsertProviderMenuItemKey.js +10 -1
  31. package/dist/es2019/quick-insert/registered-menu-model.js +2 -0
  32. package/dist/es2019/quick-insert/selectQuickInsertCategoryItems.js +19 -0
  33. package/dist/es2019/ui/DropList/index.js +1 -1
  34. package/dist/esm/ai-messages/ai-suggestions.js +13 -8
  35. package/dist/esm/extensibility/GeneratedContentReveal.compiled.css +4 -3
  36. package/dist/esm/extensibility/GeneratedContentReveal.js +7 -22
  37. package/dist/esm/extensions/buildMenuItem.js +1 -1
  38. package/dist/esm/lists/flatten-list.js +1 -71
  39. package/dist/esm/lists/index.js +2 -4
  40. package/dist/esm/lists/node.js +0 -77
  41. package/dist/esm/lists/replace-content.js +1 -3
  42. package/dist/esm/lists/selection.js +1 -28
  43. package/dist/esm/monitoring/error.js +1 -1
  44. package/dist/esm/node-anchor/node-anchor-provider.js +1 -3
  45. package/dist/esm/quick-insert/build-quick-insert-menu-model.js +6 -5
  46. package/dist/esm/quick-insert/getQuickInsertProviderMenuItemKey.js +15 -2
  47. package/dist/esm/quick-insert/registered-menu-model.js +2 -0
  48. package/dist/esm/quick-insert/selectQuickInsertCategoryItems.js +21 -0
  49. package/dist/esm/ui/DropList/index.js +1 -1
  50. package/dist/types/ai-messages/ai-suggestions.d.ts +5 -0
  51. package/dist/types/collab/agent-edit-chrome.d.ts +1 -0
  52. package/dist/types/lists/flatten-list.d.ts +0 -28
  53. package/dist/types/lists/index.d.ts +2 -4
  54. package/dist/types/lists/node.d.ts +0 -1
  55. package/dist/types/lists/replace-content.d.ts +1 -1
  56. package/dist/types/lists/selection.d.ts +1 -7
  57. package/dist/types/quick-insert/build-quick-insert-menu-model.d.ts +2 -1
  58. package/dist/types/quick-insert/getQuickInsertProviderMenuItemKey.d.ts +10 -1
  59. package/dist/types/quick-insert/registered-menu-model.d.ts +3 -0
  60. package/dist/types/quick-insert/selectQuickInsertCategoryItems.d.ts +7 -0
  61. package/package.json +5 -5
  62. package/dist/cjs/lists/indentation.js +0 -23
  63. package/dist/cjs/lists/wrapTaskListIntoListAbove.js +0 -30
  64. package/dist/es2019/lists/indentation.js +0 -18
  65. package/dist/es2019/lists/wrapTaskListIntoListAbove.js +0 -24
  66. package/dist/esm/lists/indentation.js +0 -17
  67. package/dist/esm/lists/wrapTaskListIntoListAbove.js +0 -24
  68. package/dist/types/lists/indentation.d.ts +0 -5
  69. package/dist/types/lists/wrapTaskListIntoListAbove.d.ts +0 -2
  70. package/lists/indentation/package.json +0 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "122.11.1",
3
+ "version": "123.0.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/"
@@ -44,7 +44,7 @@
44
44
  "@atlaskit/dropdown-menu": "^18.3.0",
45
45
  "@atlaskit/editor-json-transformer": "^9.8.0",
46
46
  "@atlaskit/editor-palette": "^3.5.0",
47
- "@atlaskit/editor-prosemirror": "^8.0.0",
47
+ "@atlaskit/editor-prosemirror": "^9.0.0",
48
48
  "@atlaskit/editor-shared-styles": "^4.3.0",
49
49
  "@atlaskit/editor-tables": "^3.2.0",
50
50
  "@atlaskit/editor-toolbar": "^2.6.0",
@@ -65,7 +65,7 @@
65
65
  "@atlaskit/media-ui": "^30.16.0",
66
66
  "@atlaskit/media-viewer": "^54.8.0",
67
67
  "@atlaskit/mention": "^29.2.0",
68
- "@atlaskit/menu": "^10.2.0",
68
+ "@atlaskit/menu": "^11.0.0",
69
69
  "@atlaskit/object": "^2.3.0",
70
70
  "@atlaskit/onboarding": "^15.4.0",
71
71
  "@atlaskit/platform-feature-experiments": "^0.3.0",
@@ -76,7 +76,7 @@
76
76
  "@atlaskit/profilecard": "^26.24.0",
77
77
  "@atlaskit/prosemirror-history": "^1.2.0",
78
78
  "@atlaskit/react-compiler-gating": "^0.2.0",
79
- "@atlaskit/react-ufo": "^7.11.0",
79
+ "@atlaskit/react-ufo": "^7.12.0",
80
80
  "@atlaskit/section-message": "^10.2.0",
81
81
  "@atlaskit/smart-card": "^45.24.0",
82
82
  "@atlaskit/smart-user-picker": "^11.8.0",
@@ -85,7 +85,7 @@
85
85
  "@atlaskit/teams-app-config": "^3.1.0",
86
86
  "@atlaskit/textfield": "^10.2.0",
87
87
  "@atlaskit/tmp-editor-statsig": "^199.0.0",
88
- "@atlaskit/tokens": "^18.0.0",
88
+ "@atlaskit/tokens": "^18.2.0",
89
89
  "@atlaskit/tooltip": "^24.3.0",
90
90
  "@atlaskit/width-detector": "^7.2.0",
91
91
  "@babel/runtime": "^7.0.0",
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.hasValidListIndentationLevel = void 0;
7
- var _numberNestedLists = require("./numberNestedLists");
8
- var hasValidListIndentationLevel = exports.hasValidListIndentationLevel = function hasValidListIndentationLevel(_ref) {
9
- var tr = _ref.tr,
10
- maxIndentation = _ref.maxIndentation;
11
- var initialIndentationLevel = (0, _numberNestedLists.numberNestedLists)(tr.selection.$from);
12
- var currentIndentationLevel;
13
- var currentPos = tr.selection.$to.pos;
14
- do {
15
- var resolvedPos = tr.doc.resolve(currentPos);
16
- currentIndentationLevel = (0, _numberNestedLists.numberNestedLists)(resolvedPos);
17
- if (currentIndentationLevel > maxIndentation) {
18
- return false;
19
- }
20
- currentPos++;
21
- } while (currentIndentationLevel >= initialIndentationLevel);
22
- return true;
23
- };
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.wrapTaskListIntoListAbove = void 0;
7
- var _model = require("@atlaskit/editor-prosemirror/model");
8
- var wrapTaskListIntoListAbove = exports.wrapTaskListIntoListAbove = function wrapTaskListIntoListAbove(tr, taskListStart, previousListStart) {
9
- var $taskListStart = tr.doc.resolve(taskListStart);
10
-
11
- /* Safecheck: if not passed a taskList node, return */
12
- if ($taskListStart.node().type.name !== 'taskList') {
13
- return;
14
- }
15
- var $previousListStart = tr.doc.resolve(previousListStart);
16
- var taskList = tr.doc.slice($taskListStart.pos, $taskListStart.after());
17
- var frag = _model.Fragment.from(taskList.content);
18
-
19
- /*
20
- Delete the existing taskList at the same level and insert inside above list provided
21
- 1. To delete the tasklist, we need wrapping positions before and after it to completely delete it.
22
- $taskListStart.after() would give us closing position enclosed by node itself using it would remove only the contents of taskList
23
- so we add 1 to it to get the position after the taskList node and completly remove it.
24
- 2. Inserting the taskList at the end() position safe inserts the taskList to next available position which would lead to deleting and inserting taskList at same place.
25
- Reason: $previousListStart.end() gives us end position of listItem but we can add content only inside listItem not at same level
26
- so we subtract 1 to get the position inside the list item and insert the TaskList same level as paragraph/content inside listItem.
27
- */
28
- tr.delete($taskListStart.before(), $taskListStart.after() + 1);
29
- tr.insert($previousListStart.end() - 1, frag);
30
- };
@@ -1,18 +0,0 @@
1
- import { numberNestedLists } from './numberNestedLists';
2
- export const hasValidListIndentationLevel = ({
3
- tr,
4
- maxIndentation
5
- }) => {
6
- const initialIndentationLevel = numberNestedLists(tr.selection.$from);
7
- let currentIndentationLevel;
8
- let currentPos = tr.selection.$to.pos;
9
- do {
10
- const resolvedPos = tr.doc.resolve(currentPos);
11
- currentIndentationLevel = numberNestedLists(resolvedPos);
12
- if (currentIndentationLevel > maxIndentation) {
13
- return false;
14
- }
15
- currentPos++;
16
- } while (currentIndentationLevel >= initialIndentationLevel);
17
- return true;
18
- };
@@ -1,24 +0,0 @@
1
- import { Fragment } from '@atlaskit/editor-prosemirror/model';
2
- export const wrapTaskListIntoListAbove = (tr, taskListStart, previousListStart) => {
3
- const $taskListStart = tr.doc.resolve(taskListStart);
4
-
5
- /* Safecheck: if not passed a taskList node, return */
6
- if ($taskListStart.node().type.name !== 'taskList') {
7
- return;
8
- }
9
- const $previousListStart = tr.doc.resolve(previousListStart);
10
- const taskList = tr.doc.slice($taskListStart.pos, $taskListStart.after());
11
- const frag = Fragment.from(taskList.content);
12
-
13
- /*
14
- Delete the existing taskList at the same level and insert inside above list provided
15
- 1. To delete the tasklist, we need wrapping positions before and after it to completely delete it.
16
- $taskListStart.after() would give us closing position enclosed by node itself using it would remove only the contents of taskList
17
- so we add 1 to it to get the position after the taskList node and completly remove it.
18
- 2. Inserting the taskList at the end() position safe inserts the taskList to next available position which would lead to deleting and inserting taskList at same place.
19
- Reason: $previousListStart.end() gives us end position of listItem but we can add content only inside listItem not at same level
20
- so we subtract 1 to get the position inside the list item and insert the TaskList same level as paragraph/content inside listItem.
21
- */
22
- tr.delete($taskListStart.before(), $taskListStart.after() + 1);
23
- tr.insert($previousListStart.end() - 1, frag);
24
- };
@@ -1,17 +0,0 @@
1
- import { numberNestedLists } from './numberNestedLists';
2
- export var hasValidListIndentationLevel = function hasValidListIndentationLevel(_ref) {
3
- var tr = _ref.tr,
4
- maxIndentation = _ref.maxIndentation;
5
- var initialIndentationLevel = numberNestedLists(tr.selection.$from);
6
- var currentIndentationLevel;
7
- var currentPos = tr.selection.$to.pos;
8
- do {
9
- var resolvedPos = tr.doc.resolve(currentPos);
10
- currentIndentationLevel = numberNestedLists(resolvedPos);
11
- if (currentIndentationLevel > maxIndentation) {
12
- return false;
13
- }
14
- currentPos++;
15
- } while (currentIndentationLevel >= initialIndentationLevel);
16
- return true;
17
- };
@@ -1,24 +0,0 @@
1
- import { Fragment } from '@atlaskit/editor-prosemirror/model';
2
- export var wrapTaskListIntoListAbove = function wrapTaskListIntoListAbove(tr, taskListStart, previousListStart) {
3
- var $taskListStart = tr.doc.resolve(taskListStart);
4
-
5
- /* Safecheck: if not passed a taskList node, return */
6
- if ($taskListStart.node().type.name !== 'taskList') {
7
- return;
8
- }
9
- var $previousListStart = tr.doc.resolve(previousListStart);
10
- var taskList = tr.doc.slice($taskListStart.pos, $taskListStart.after());
11
- var frag = Fragment.from(taskList.content);
12
-
13
- /*
14
- Delete the existing taskList at the same level and insert inside above list provided
15
- 1. To delete the tasklist, we need wrapping positions before and after it to completely delete it.
16
- $taskListStart.after() would give us closing position enclosed by node itself using it would remove only the contents of taskList
17
- so we add 1 to it to get the position after the taskList node and completly remove it.
18
- 2. Inserting the taskList at the end() position safe inserts the taskList to next available position which would lead to deleting and inserting taskList at same place.
19
- Reason: $previousListStart.end() gives us end position of listItem but we can add content only inside listItem not at same level
20
- so we subtract 1 to get the position inside the list item and insert the TaskList same level as paragraph/content inside listItem.
21
- */
22
- tr.delete($taskListStart.before(), $taskListStart.after() + 1);
23
- tr.insert($previousListStart.end() - 1, frag);
24
- };
@@ -1,5 +0,0 @@
1
- import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
- export declare const hasValidListIndentationLevel: ({ tr, maxIndentation, }: {
3
- maxIndentation: number;
4
- tr: Transaction;
5
- }) => boolean;
@@ -1,2 +0,0 @@
1
- import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
- export declare const wrapTaskListIntoListAbove: (tr: Transaction, taskListStart: number, previousListStart: number) => void;
@@ -1,10 +0,0 @@
1
- {
2
- "name": "@atlaskit/editor-common/lists/indentation",
3
- "main": "../../dist/cjs/lists/indentation.js",
4
- "module": "../../dist/esm/lists/indentation.js",
5
- "module:es2019": "../../dist/es2019/lists/indentation.js",
6
- "sideEffects": [
7
- "**/*.compiled.css"
8
- ],
9
- "types": "../../dist/types/lists/indentation.d.ts"
10
- }