@atlaskit/editor-common 74.44.1 → 74.45.1

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 (75) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/icons/shared/table.js +24 -7
  3. package/dist/cjs/mark/commands.js +21 -26
  4. package/dist/cjs/media-single/constants.js +3 -1
  5. package/dist/cjs/media-single/index.js +6 -0
  6. package/dist/cjs/monitoring/error.js +1 -1
  7. package/dist/cjs/quick-insert/assets/list-number.js +18 -6
  8. package/dist/cjs/quick-insert/assets/list.js +21 -10
  9. package/dist/cjs/quick-insert/assets/quote.js +15 -3
  10. package/dist/cjs/quick-insert/assets/status.js +55 -16
  11. package/dist/cjs/selection/index.js +36 -0
  12. package/dist/cjs/selection/utils.js +46 -1
  13. package/dist/cjs/styles/shared/media-single.js +1 -2
  14. package/dist/cjs/ui/DropList/index.js +1 -1
  15. package/dist/cjs/ui/MediaSingle/styled.js +1 -8
  16. package/dist/cjs/utils/index.js +150 -0
  17. package/dist/cjs/utils/rich-media-utils.js +3 -6
  18. package/dist/cjs/version.json +1 -1
  19. package/dist/es2019/icons/shared/table.js +25 -7
  20. package/dist/es2019/mark/commands.js +21 -28
  21. package/dist/es2019/mark/index.js +1 -1
  22. package/dist/es2019/media-single/constants.js +1 -0
  23. package/dist/es2019/media-single/index.js +1 -1
  24. package/dist/es2019/monitoring/error.js +1 -1
  25. package/dist/es2019/quick-insert/assets/list-number.js +19 -6
  26. package/dist/es2019/quick-insert/assets/list.js +22 -9
  27. package/dist/es2019/quick-insert/assets/quote.js +16 -3
  28. package/dist/es2019/quick-insert/assets/status.js +56 -15
  29. package/dist/es2019/selection/index.js +1 -1
  30. package/dist/es2019/selection/utils.js +52 -1
  31. package/dist/es2019/styles/shared/media-single.js +3 -4
  32. package/dist/es2019/ui/DropList/index.js +1 -1
  33. package/dist/es2019/ui/MediaSingle/styled.js +1 -11
  34. package/dist/es2019/utils/index.js +139 -1
  35. package/dist/es2019/utils/rich-media-utils.js +3 -6
  36. package/dist/es2019/version.json +1 -1
  37. package/dist/esm/icons/shared/table.js +24 -7
  38. package/dist/esm/mark/commands.js +21 -26
  39. package/dist/esm/mark/index.js +1 -1
  40. package/dist/esm/media-single/constants.js +1 -0
  41. package/dist/esm/media-single/index.js +1 -1
  42. package/dist/esm/monitoring/error.js +1 -1
  43. package/dist/esm/quick-insert/assets/list-number.js +18 -6
  44. package/dist/esm/quick-insert/assets/list.js +21 -9
  45. package/dist/esm/quick-insert/assets/quote.js +15 -3
  46. package/dist/esm/quick-insert/assets/status.js +55 -15
  47. package/dist/esm/selection/index.js +1 -1
  48. package/dist/esm/selection/utils.js +40 -1
  49. package/dist/esm/styles/shared/media-single.js +1 -2
  50. package/dist/esm/ui/DropList/index.js +1 -1
  51. package/dist/esm/ui/MediaSingle/styled.js +1 -8
  52. package/dist/esm/utils/index.js +141 -1
  53. package/dist/esm/utils/rich-media-utils.js +3 -6
  54. package/dist/esm/version.json +1 -1
  55. package/dist/types/collab/index.d.ts +4 -1
  56. package/dist/types/mark/commands.d.ts +4 -4
  57. package/dist/types/mark/index.d.ts +1 -1
  58. package/dist/types/media-single/constants.d.ts +1 -0
  59. package/dist/types/media-single/index.d.ts +1 -1
  60. package/dist/types/selection/index.d.ts +1 -1
  61. package/dist/types/selection/utils.d.ts +9 -2
  62. package/dist/types/utils/index.d.ts +17 -0
  63. package/dist/types/utils/input-rules.d.ts +3 -2
  64. package/dist/types/utils/rich-media-utils.d.ts +4 -4
  65. package/dist/types-ts4.5/collab/index.d.ts +4 -1
  66. package/dist/types-ts4.5/mark/commands.d.ts +4 -4
  67. package/dist/types-ts4.5/mark/index.d.ts +1 -1
  68. package/dist/types-ts4.5/media-single/constants.d.ts +1 -0
  69. package/dist/types-ts4.5/media-single/index.d.ts +1 -1
  70. package/dist/types-ts4.5/selection/index.d.ts +1 -1
  71. package/dist/types-ts4.5/selection/utils.d.ts +9 -2
  72. package/dist/types-ts4.5/utils/index.d.ts +17 -0
  73. package/dist/types-ts4.5/utils/input-rules.d.ts +3 -2
  74. package/dist/types-ts4.5/utils/rich-media-utils.d.ts +4 -4
  75. package/package.json +1 -1
@@ -1,7 +1,13 @@
1
- // TODO: https://product-fabric.atlassian.net/browse/DSP-4138
2
1
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
3
2
  import React from 'react';
3
+ import { useIconThemed } from '../use-icon-themed';
4
4
  export default function IconListOrdered() {
5
+ var _useIconThemed = useIconThemed(),
6
+ iconThemed = _useIconThemed.iconThemed;
7
+ var lineColour = iconThemed({
8
+ light: '#C1C7D0',
9
+ dark: '#454F59'
10
+ });
5
11
  return /*#__PURE__*/React.createElement("svg", {
6
12
  focusable: "false",
7
13
  "aria-hidden": true,
@@ -11,33 +17,39 @@ export default function IconListOrdered() {
11
17
  fill: "none",
12
18
  fillRule: "evenodd"
13
19
  }, /*#__PURE__*/React.createElement("path", {
14
- fill: "#FFF",
20
+ fill: iconThemed({
21
+ light: '#FFF',
22
+ dark: '#161A1D'
23
+ }),
15
24
  d: "M0 0h40v40H0z"
16
25
  }), /*#__PURE__*/React.createElement("g", {
17
26
  transform: "translate(9 9)"
18
27
  }, /*#__PURE__*/React.createElement("rect", {
19
- fill: "#C1C7D0",
28
+ fill: lineColour,
20
29
  x: 6,
21
30
  y: 10,
22
31
  width: 17,
23
32
  height: 2,
24
33
  rx: 1
25
34
  }), /*#__PURE__*/React.createElement("rect", {
26
- fill: "#C1C7D0",
35
+ fill: lineColour,
27
36
  x: 6,
28
37
  y: 2,
29
38
  width: 17,
30
39
  height: 2,
31
40
  rx: 1
32
41
  }), /*#__PURE__*/React.createElement("rect", {
33
- fill: "#C1C7D0",
42
+ fill: lineColour,
34
43
  x: 6,
35
44
  y: 18,
36
45
  width: 17,
37
46
  height: 2,
38
47
  rx: 1
39
48
  }), /*#__PURE__*/React.createElement("path", {
40
- fill: "#6C798F",
49
+ fill: iconThemed({
50
+ light: '#6C798F',
51
+ dark: '#5A6977'
52
+ }),
41
53
  d: "M1.159 4.996v-3.58h-.056L0 2.176v-.875L1.162.5H2.1v4.496zM0 9.97C0 9.094.67 8.5 1.648 8.5c.943 0 1.6.542 1.6 1.319 0 .492-.266.915-1.049 1.65l-.864.825v.056h1.98v.786H.052v-.66L1.53 11.03c.636-.62.795-.855.795-1.15 0-.363-.294-.62-.708-.62-.438 0-.739.288-.739.705v.019H0v-.016zm1.172 9.22v-.71h.554c.431 0 .724-.251.724-.623 0-.365-.283-.598-.727-.598-.441 0-.734.249-.76.642H.086c.032-.86.67-1.401 1.663-1.401.932 0 1.603.51 1.603 1.225 0 .526-.33.935-.838 1.04v.056c.624.07 1.014.485 1.014 1.083 0 .797-.75 1.373-1.785 1.373-1.015 0-1.701-.56-1.742-1.417h.91c.028.384.353.627.841.627.475 0 .806-.268.806-.655 0-.397-.312-.643-.822-.643h-.563z"
42
54
  }))));
43
55
  }
@@ -1,7 +1,16 @@
1
- // TODO: https://product-fabric.atlassian.net/browse/DSP-4138
2
- /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
3
1
  import React from 'react';
2
+ import { useIconThemed } from '../use-icon-themed';
4
3
  export default function IconList() {
4
+ var _useIconThemed = useIconThemed(),
5
+ iconThemed = _useIconThemed.iconThemed;
6
+ var dotColour = iconThemed({
7
+ light: '#6C798F',
8
+ dark: '#5A6977'
9
+ });
10
+ var lineColour = iconThemed({
11
+ light: '#C1C7D0',
12
+ dark: '#454F59'
13
+ });
5
14
  return /*#__PURE__*/React.createElement("svg", {
6
15
  focusable: "false",
7
16
  "aria-hidden": true,
@@ -11,44 +20,47 @@ export default function IconList() {
11
20
  fill: "none",
12
21
  fillRule: "evenodd"
13
22
  }, /*#__PURE__*/React.createElement("path", {
14
- fill: "#FFF",
23
+ fill: iconThemed({
24
+ light: '#FFF',
25
+ dark: '#161A1D'
26
+ }),
15
27
  d: "M0 0h40v40H0z"
16
28
  }), /*#__PURE__*/React.createElement("g", {
17
29
  transform: "translate(8 10)"
18
30
  }, /*#__PURE__*/React.createElement("rect", {
19
- fill: "#6C798F",
31
+ fill: dotColour,
20
32
  width: 4,
21
33
  height: 4,
22
34
  rx: 2
23
35
  }), /*#__PURE__*/React.createElement("rect", {
24
- fill: "#C1C7D0",
36
+ fill: lineColour,
25
37
  x: 7,
26
38
  y: 9,
27
39
  width: 17,
28
40
  height: 2,
29
41
  rx: 1
30
42
  }), /*#__PURE__*/React.createElement("rect", {
31
- fill: "#C1C7D0",
43
+ fill: lineColour,
32
44
  x: 7,
33
45
  y: 1,
34
46
  width: 17,
35
47
  height: 2,
36
48
  rx: 1
37
49
  }), /*#__PURE__*/React.createElement("rect", {
38
- fill: "#C1C7D0",
50
+ fill: lineColour,
39
51
  x: 7,
40
52
  y: 17,
41
53
  width: 17,
42
54
  height: 2,
43
55
  rx: 1
44
56
  }), /*#__PURE__*/React.createElement("rect", {
45
- fill: "#6C798F",
57
+ fill: dotColour,
46
58
  y: 8,
47
59
  width: 4,
48
60
  height: 4,
49
61
  rx: 2
50
62
  }), /*#__PURE__*/React.createElement("rect", {
51
- fill: "#6C798F",
63
+ fill: dotColour,
52
64
  y: 16,
53
65
  width: 4,
54
66
  height: 4,
@@ -1,7 +1,10 @@
1
1
  // TODO: https://product-fabric.atlassian.net/browse/DSP-4138
2
2
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
3
3
  import React from 'react';
4
+ import { useIconThemed } from '../use-icon-themed';
4
5
  export default function IconQuote() {
6
+ var _useIconThemed = useIconThemed(),
7
+ iconThemed = _useIconThemed.iconThemed;
5
8
  return /*#__PURE__*/React.createElement("svg", {
6
9
  focusable: "false",
7
10
  "aria-hidden": true,
@@ -11,10 +14,16 @@ export default function IconQuote() {
11
14
  fill: "none",
12
15
  fillRule: "evenodd"
13
16
  }, /*#__PURE__*/React.createElement("path", {
14
- fill: "#FFF",
17
+ fill: iconThemed({
18
+ light: '#FFF',
19
+ dark: '#161A1D'
20
+ }),
15
21
  d: "M0 0h40v40H0z"
16
22
  }), /*#__PURE__*/React.createElement("rect", {
17
- fill: "#C1C7D0",
23
+ fill: iconThemed({
24
+ light: '#C1C7D0',
25
+ dark: '#454F59'
26
+ }),
18
27
  x: 6,
19
28
  y: 8,
20
29
  width: 2,
@@ -22,6 +31,9 @@ export default function IconQuote() {
22
31
  rx: 1
23
32
  }), /*#__PURE__*/React.createElement("path", {
24
33
  d: "M27.284 12c-1.888 0-3.422 1.577-3.422 3.522 0 1.944 1.534 3.521 3.422 3.521 3.245 0 1.365 6.118-2.727 6.755a.818.818 0 00-.695.806c0 .5.447.896.942.82C32.242 26.296 34.886 12 27.284 12m-9.86 0C15.533 12 14 13.577 14 15.522c0 1.944 1.533 3.521 3.424 3.521 3.243 0 1.363 6.118-2.73 6.755a.818.818 0 00-.694.806c0 .5.447.896.941.82C22.381 26.296 25.026 12 17.424 12",
25
- fill: "#6C798F"
34
+ fill: iconThemed({
35
+ light: '#6C798F',
36
+ dark: '#5A6977'
37
+ })
26
38
  })));
27
39
  }
@@ -1,7 +1,8 @@
1
- // TODO: https://product-fabric.atlassian.net/browse/DSP-4138
2
- /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
3
1
  import React from 'react';
2
+ import { useIconThemed } from '../use-icon-themed';
4
3
  export default function IconStatus() {
4
+ var _useIconThemed = useIconThemed(),
5
+ iconThemed = _useIconThemed.iconThemed;
5
6
  return /*#__PURE__*/React.createElement("svg", {
6
7
  focusable: "false",
7
8
  "aria-hidden": true,
@@ -11,17 +12,26 @@ export default function IconStatus() {
11
12
  fill: "none",
12
13
  fillRule: "evenodd"
13
14
  }, /*#__PURE__*/React.createElement("path", {
14
- fill: "#FFF",
15
+ fill: iconThemed({
16
+ light: '#FFF',
17
+ dark: '#161A1D'
18
+ }),
15
19
  d: "M0 0h40v40H0z"
16
20
  }), /*#__PURE__*/React.createElement("g", {
17
21
  transform: "translate(5 11)"
18
22
  }, /*#__PURE__*/React.createElement("rect", {
19
- fill: "#B3D4FF",
23
+ fill: iconThemed({
24
+ light: '#B3D4FF',
25
+ dark: '#09326C'
26
+ }),
20
27
  width: 14,
21
28
  height: 5,
22
29
  rx: 1
23
30
  }), /*#__PURE__*/React.createElement("rect", {
24
- fill: "#0065FF",
31
+ fill: iconThemed({
32
+ light: '#0065FF',
33
+ dark: '#1D7AFC'
34
+ }),
25
35
  x: 2,
26
36
  y: 2,
27
37
  width: 10,
@@ -30,12 +40,18 @@ export default function IconStatus() {
30
40
  })), /*#__PURE__*/React.createElement("g", {
31
41
  transform: "translate(5 18)"
32
42
  }, /*#__PURE__*/React.createElement("rect", {
33
- fill: "#C3F8DF",
43
+ fill: iconThemed({
44
+ light: '#C3F8DF',
45
+ dark: '#164B35'
46
+ }),
34
47
  width: 14,
35
48
  height: 5,
36
49
  rx: 1
37
50
  }), /*#__PURE__*/React.createElement("rect", {
38
- fill: "#36B37E",
51
+ fill: iconThemed({
52
+ light: '#36B37E',
53
+ dark: '#22A06B'
54
+ }),
39
55
  x: 2,
40
56
  y: 2,
41
57
  width: 10,
@@ -44,12 +60,18 @@ export default function IconStatus() {
44
60
  })), /*#__PURE__*/React.createElement("g", {
45
61
  transform: "translate(5 25)"
46
62
  }, /*#__PURE__*/React.createElement("rect", {
47
- fill: "#DFE1E6",
63
+ fill: iconThemed({
64
+ light: '#DFE1E6',
65
+ dark: '#2C333A'
66
+ }),
48
67
  width: 14,
49
68
  height: 5,
50
69
  rx: 1
51
70
  }), /*#__PURE__*/React.createElement("rect", {
52
- fill: "#8993A4",
71
+ fill: iconThemed({
72
+ light: '#8993A4',
73
+ dark: '#5A6977'
74
+ }),
53
75
  x: 2,
54
76
  y: 2,
55
77
  width: 10,
@@ -58,12 +80,18 @@ export default function IconStatus() {
58
80
  })), /*#__PURE__*/React.createElement("g", {
59
81
  transform: "translate(21 25)"
60
82
  }, /*#__PURE__*/React.createElement("rect", {
61
- fill: "#FFD3C8",
83
+ fill: iconThemed({
84
+ light: '#FFD3C8',
85
+ dark: '#601D16'
86
+ }),
62
87
  width: 14,
63
88
  height: 5,
64
89
  rx: 1
65
90
  }), /*#__PURE__*/React.createElement("rect", {
66
- fill: "#FF5230",
91
+ fill: iconThemed({
92
+ light: '#FF5230',
93
+ dark: '#F35844'
94
+ }),
67
95
  x: 2,
68
96
  y: 2,
69
97
  width: 10,
@@ -72,12 +100,18 @@ export default function IconStatus() {
72
100
  })), /*#__PURE__*/React.createElement("g", {
73
101
  transform: "translate(21 11)"
74
102
  }, /*#__PURE__*/React.createElement("rect", {
75
- fill: "#EAE6FF",
103
+ fill: iconThemed({
104
+ light: '#EAE6FF',
105
+ dark: '#352C63'
106
+ }),
76
107
  width: 14,
77
108
  height: 5,
78
109
  rx: 1
79
110
  }), /*#__PURE__*/React.createElement("rect", {
80
- fill: "#8777D9",
111
+ fill: iconThemed({
112
+ light: '#8777D9',
113
+ dark: '#8270DB'
114
+ }),
81
115
  x: 2,
82
116
  y: 2,
83
117
  width: 10,
@@ -86,12 +120,18 @@ export default function IconStatus() {
86
120
  })), /*#__PURE__*/React.createElement("g", {
87
121
  transform: "translate(21 18)"
88
122
  }, /*#__PURE__*/React.createElement("rect", {
89
- fill: "#FFF0B3",
123
+ fill: iconThemed({
124
+ light: '#FFF0B3',
125
+ dark: '#5F3811'
126
+ }),
90
127
  width: 14,
91
128
  height: 5,
92
129
  rx: 1
93
130
  }), /*#__PURE__*/React.createElement("rect", {
94
- fill: "#FF991F",
131
+ fill: iconThemed({
132
+ light: '#FF991F',
133
+ dark: '#D19D00'
134
+ }),
95
135
  x: 2,
96
136
  y: 2,
97
137
  width: 10,
@@ -1,4 +1,4 @@
1
1
  export { RelativeSelectionPos } from './types';
2
2
  export { GapCursorSelection, Side, JSON_ID, GapBookmark } from './gap-cursor/selection';
3
3
  export { isIgnored, isValidTargetNode } from './gap-cursor/utils';
4
- export { isSelectionAtStartOfNode, isSelectionAtEndOfNode } from './utils';
4
+ export { atTheBeginningOfBlock, atTheBeginningOfDoc, atTheEndOfBlock, atTheEndOfDoc, endPositionOfParent, isSelectionAtEndOfNode, isSelectionAtStartOfNode, startPositionOfParent } from './utils';
@@ -1,3 +1,5 @@
1
+ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
2
+ import { GapCursorSelection } from './gap-cursor/selection';
1
3
  export var isSelectionAtStartOfNode = function isSelectionAtStartOfNode($pos, parentNode) {
2
4
  if (!parentNode) {
3
5
  return false;
@@ -27,4 +29,41 @@ export var isSelectionAtEndOfNode = function isSelectionAtEndOfNode($pos, parent
27
29
  }
28
30
  }
29
31
  return true;
30
- };
32
+ };
33
+ export function atTheEndOfDoc(state) {
34
+ var selection = state.selection,
35
+ doc = state.doc;
36
+ return doc.nodeSize - selection.$to.pos - 2 === selection.$to.depth;
37
+ }
38
+ export function atTheBeginningOfDoc(state) {
39
+ var selection = state.selection;
40
+ return selection.$from.pos === selection.$from.depth;
41
+ }
42
+ export function atTheEndOfBlock(state) {
43
+ var selection = state.selection;
44
+ var $to = selection.$to;
45
+ if (selection instanceof GapCursorSelection) {
46
+ return false;
47
+ }
48
+ if (selection instanceof NodeSelection && selection.node.isBlock) {
49
+ return true;
50
+ }
51
+ return endPositionOfParent($to) === $to.pos + 1;
52
+ }
53
+ export function atTheBeginningOfBlock(state) {
54
+ var selection = state.selection;
55
+ var $from = selection.$from;
56
+ if (selection instanceof GapCursorSelection) {
57
+ return false;
58
+ }
59
+ if (selection instanceof NodeSelection && selection.node.isBlock) {
60
+ return true;
61
+ }
62
+ return startPositionOfParent($from) === $from.pos;
63
+ }
64
+ export function startPositionOfParent(resolvedPos) {
65
+ return resolvedPos.start(resolvedPos.depth);
66
+ }
67
+ export function endPositionOfParent(resolvedPos) {
68
+ return resolvedPos.end(resolvedPos.depth) + 1;
69
+ }
@@ -1,8 +1,7 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
2
  var _templateObject;
3
3
  import { css } from '@emotion/react';
4
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
4
  var richMediaClassName = 'rich-media-item';
6
5
  var wrappedMediaBreakoutPoint = 410;
7
- var mediaSingleSharedStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n li .", " {\n margin: 0;\n }\n\n /* Hack for chrome to fix media single position\n inside a list when media is the first child */\n &.ua-chrome li > .mediaSingleView-content-wrap::before {\n content: '';\n display: block;\n height: 0;\n }\n\n &.ua-firefox {\n .mediaSingleView-content-wrap {\n user-select: none;\n }\n\n .captionView-content-wrap {\n user-select: text;\n }\n }\n\n .mediaSingleView-content-wrap[layout='center'] {\n clear: both;\n }\n\n table .", " {\n margin-top: ", ";\n margin-bottom: ", ";\n clear: both;\n\n &.image-wrap-left,\n &.image-wrap-right {\n clear: none;\n\n &:first-child {\n margin-top: ", ";\n }\n }\n }\n\n .", ".image-wrap-right\n + .", ".image-wrap-left {\n clear: both;\n }\n\n .", ".image-wrap-left\n + .", ".image-wrap-right,\n .", ".image-wrap-right\n + .", ".image-wrap-left,\n .", ".image-wrap-left\n + .", ".image-wrap-left,\n .", ".image-wrap-right\n + .", ".image-wrap-right {\n margin-right: 0;\n margin-left: 0;\n }\n\n ", "\n"])), richMediaClassName, richMediaClassName, "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)", richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, !getBooleanFF('platform.editor.media.extended-resize-experience') && "@media all and (max-width: ".concat(wrappedMediaBreakoutPoint, "px) {\n div.mediaSingleView-content-wrap[layout='wrap-left'],\n div.mediaSingleView-content-wrap[data-layout='wrap-left'],\n div.mediaSingleView-content-wrap[layout='wrap-right'],\n div.mediaSingleView-content-wrap[data-layout='wrap-right'] {\n float: none;\n overflow: auto;\n margin: 12px 0;\n }\n }"));
6
+ var mediaSingleSharedStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n li .", " {\n margin: 0;\n }\n\n /* Hack for chrome to fix media single position\n inside a list when media is the first child */\n &.ua-chrome li > .mediaSingleView-content-wrap::before {\n content: '';\n display: block;\n height: 0;\n }\n\n &.ua-firefox {\n .mediaSingleView-content-wrap {\n user-select: none;\n }\n\n .captionView-content-wrap {\n user-select: text;\n }\n }\n\n .mediaSingleView-content-wrap[layout='center'] {\n clear: both;\n }\n\n table .", " {\n margin-top: ", ";\n margin-bottom: ", ";\n clear: both;\n\n &.image-wrap-left,\n &.image-wrap-right {\n clear: none;\n\n &:first-child {\n margin-top: ", ";\n }\n }\n }\n\n .", ".image-wrap-right\n + .", ".image-wrap-left {\n clear: both;\n }\n\n .", ".image-wrap-left\n + .", ".image-wrap-right,\n .", ".image-wrap-right\n + .", ".image-wrap-left,\n .", ".image-wrap-left\n + .", ".image-wrap-left,\n .", ".image-wrap-right\n + .", ".image-wrap-right {\n margin-right: 0;\n margin-left: 0;\n }\n\n @media all and (max-width: ", "px) {\n div.mediaSingleView-content-wrap[layout='wrap-left'],\n div.mediaSingleView-content-wrap[data-layout='wrap-left'],\n div.mediaSingleView-content-wrap[layout='wrap-right'],\n div.mediaSingleView-content-wrap[data-layout='wrap-right'] {\n float: none;\n overflow: auto;\n margin: ", " 0;\n }\n }\n"])), richMediaClassName, richMediaClassName, "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)", "var(--ds-space-150, 12px)", richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, wrappedMediaBreakoutPoint, "var(--ds-space-150, 12px)");
8
7
  export { mediaSingleSharedStyle, richMediaClassName };
@@ -18,7 +18,7 @@ import { themed } from '@atlaskit/theme/components';
18
18
  import { borderRadius } from '@atlaskit/theme/constants';
19
19
  import Layer from '../Layer';
20
20
  var packageName = "@atlaskit/editor-common";
21
- var packageVersion = "74.44.1";
21
+ var packageVersion = "74.45.1";
22
22
  var halfFocusRing = 1;
23
23
  var dropOffset = '0, 8';
24
24
  var DropList = /*#__PURE__*/function (_Component) {
@@ -7,7 +7,6 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
7
7
  import React from 'react';
8
8
  import { css, jsx } from '@emotion/react';
9
9
  import { akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
10
- import { calcMediaSingleMaxWidth } from '../../media-single';
11
10
  import { nonWrappedLayouts } from '../../utils';
12
11
  import { calcBreakoutWidth, calcWideWidth } from '../../utils/breakout';
13
12
  function float(layout) {
@@ -80,12 +79,6 @@ function calcMaxWidth(layout, containerWidth) {
80
79
  return '100%';
81
80
  }
82
81
  }
83
- var getEffectiveFullWidth = function getEffectiveFullWidth(containerWidth, fullWidthMode) {
84
- if (fullWidthMode) {
85
- return '100%';
86
- }
87
- return "".concat(calcMediaSingleMaxWidth(containerWidth), "px");
88
- };
89
82
  function calcMargin(layout) {
90
83
  switch (layout) {
91
84
  case 'wrap-right':
@@ -122,7 +115,7 @@ export var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref
122
115
  isExtendedResizeExperienceOn = _ref.isExtendedResizeExperienceOn,
123
116
  _ref$isNestedNode = _ref.isNestedNode,
124
117
  isNestedNode = _ref$isNestedNode === void 0 ? false : _ref$isNestedNode;
125
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* For nested rich media items, set max-width to 100% */\n tr &,\n [data-layout-column] &,\n [data-node-type='expand'] & {\n max-width: 100%;\n }\n\n width: ", ";\n ", "\n max-width: ", ";\n\n ", "\n\n &[class*='not-resizing'] {\n ", "\n }\n\n float: ", ";\n margin: ", ";\n ", ";\n\n &:not(.is-resizing) {\n transition: width 100ms ease-in;\n }\n"])), mediaSingleWidth || pctWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized), layout === 'full-width' && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n min-width: 100%;\n "]))), calcMaxWidth(layout, containerWidth), isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), !isNestedNode && "".concat(nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n\n // override min-width to counteract max-width set by ResizerNext inline style\n ").concat(layout === 'full-width' && "min-width: ".concat(getEffectiveFullWidth(containerWidth, fullWidthMode), " !important;"), ";"), float(layout), calcMargin(layout), isImageAligned(layout));
118
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* For nested rich media items, set max-width to 100% */\n tr &,\n [data-layout-column] &,\n [data-node-type='expand'] & {\n max-width: 100%;\n }\n\n width: ", ";\n ", "\n max-width: ", ";\n\n ", "\n\n &[class*='not-resizing'] {\n ", "\n }\n\n float: ", ";\n margin: ", ";\n ", ";\n\n &:not(.is-resizing) {\n transition: width 100ms ease-in;\n }\n"])), mediaSingleWidth || pctWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized), layout === 'full-width' && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n min-width: 100%;\n "]))), calcMaxWidth(layout, containerWidth), isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), !isNestedNode && "".concat(nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);"), float(layout), calcMargin(layout), isImageAligned(layout));
126
119
  };
127
120
  var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
128
121
  var hasFallbackContainer = _ref2.hasFallbackContainer,
@@ -1,9 +1,11 @@
1
+ import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
1
2
  export { canApplyAnnotationOnRange, getAnnotationIdsFromRange } from './annotation';
2
3
  export { getExtensionLozengeData } from './macro';
3
4
  export { default as browser } from './browser';
4
5
  export { default as ErrorReporter } from './error-reporter';
5
6
  export { isPastDate, timestampToIsoFormat, timestampToString, timestampToTaskContext, timestampToUTCDate, todayTimestampInUTC } from './date';
6
7
  export { isElementInTableCell, isTextSelection, isLastItemMediaGroup, setNodeSelection, setTextSelection, nonNullable, stepAddsOneOf, stepHasSlice, extractSliceFromStep, isValidPosition, isEmptyParagraph, isInLayoutColumn, removeBlockMarks, filterChildrenBetween } from './editor-core-utils';
8
+ import { isEmptyParagraph } from './editor-core-utils';
7
9
  export { withImageLoader } from './imageLoader';
8
10
  export { absoluteBreakoutWidth, calcBreakoutWidth, calcWideWidth, breakoutConsts, calculateBreakoutStyles, calcBreakoutWidthPx, getNextBreakoutMode, getTitle } from './breakout';
9
11
  export { findChangedNodesFromTransaction, validNode, validateNodes, isType, isParagraph, isText, isLinkMark, SelectedState, isNodeSelectedOrInRange, isSupportedInParent, isMediaNode, isNodeBeforeMediaNode } from './nodes';
@@ -55,4 +57,142 @@ export function shallowEqual() {
55
57
  return acc && obj1[key] === obj2[key];
56
58
  }, true);
57
59
  }
58
- export { inputRuleWithAnalytics, createWrappingJoinRule, createRule } from './input-rules';
60
+ export { inputRuleWithAnalytics, createWrappingJoinRule, createRule } from './input-rules';
61
+ export function isSelectionInsideLastNodeInDocument(selection) {
62
+ var docNode = selection.$anchor.node(0);
63
+ var rootNode = selection.$anchor.node(1);
64
+ return docNode.lastChild === rootNode;
65
+ }
66
+ export var isInListItem = function isInListItem(state) {
67
+ return hasParentNodeOfType(state.schema.nodes.listItem)(state.selection);
68
+ };
69
+
70
+ /**
71
+ * Find the farthest node given a condition
72
+ * @param predicate Function to check the node
73
+ */
74
+ export var findFarthestParentNode = function findFarthestParentNode(predicate) {
75
+ return function ($pos) {
76
+ var candidate = null;
77
+ for (var i = $pos.depth; i > 0; i--) {
78
+ var _node = $pos.node(i);
79
+ if (predicate(_node)) {
80
+ candidate = {
81
+ pos: i > 0 ? $pos.before(i) : 0,
82
+ start: $pos.start(i),
83
+ depth: i,
84
+ node: _node
85
+ };
86
+ }
87
+ }
88
+ return candidate;
89
+ };
90
+ };
91
+ export var insideTableCell = function insideTableCell(state) {
92
+ var _state$schema$nodes = state.schema.nodes,
93
+ tableCell = _state$schema$nodes.tableCell,
94
+ tableHeader = _state$schema$nodes.tableHeader;
95
+ return hasParentNodeOfType([tableCell, tableHeader])(state.selection);
96
+ };
97
+
98
+ /**
99
+ * Traverse the document until an "ancestor" is found. Any nestable block can be an ancestor.
100
+ */
101
+ function findAncestorPosition(doc, pos) {
102
+ var nestableBlocks = ['blockquote', 'bulletList', 'orderedList'];
103
+ if (pos.depth === 1) {
104
+ return pos;
105
+ }
106
+ var node = pos.node(pos.depth);
107
+ var newPos = pos;
108
+ while (pos.depth >= 1) {
109
+ pos = doc.resolve(pos.before(pos.depth));
110
+ node = pos.node(pos.depth);
111
+ if (node && nestableBlocks.indexOf(node.type.name) !== -1) {
112
+ newPos = pos;
113
+ }
114
+ }
115
+ return newPos;
116
+ }
117
+ export function checkNodeDown(selection, doc, filter) {
118
+ var ancestorDepth = findAncestorPosition(doc, selection.$to).depth;
119
+
120
+ // Top level node
121
+ if (ancestorDepth === 0) {
122
+ return false;
123
+ }
124
+ var res = doc.resolve(selection.$to.after(ancestorDepth));
125
+ return res.nodeAfter ? filter(res.nodeAfter) : false;
126
+ }
127
+ export var isEmptyNode = function isEmptyNode(schema) {
128
+ var _schema$nodes = schema.nodes,
129
+ doc = _schema$nodes.doc,
130
+ paragraph = _schema$nodes.paragraph,
131
+ codeBlock = _schema$nodes.codeBlock,
132
+ blockquote = _schema$nodes.blockquote,
133
+ panel = _schema$nodes.panel,
134
+ heading = _schema$nodes.heading,
135
+ listItem = _schema$nodes.listItem,
136
+ bulletList = _schema$nodes.bulletList,
137
+ orderedList = _schema$nodes.orderedList,
138
+ taskList = _schema$nodes.taskList,
139
+ taskItem = _schema$nodes.taskItem,
140
+ decisionList = _schema$nodes.decisionList,
141
+ decisionItem = _schema$nodes.decisionItem,
142
+ media = _schema$nodes.media,
143
+ mediaGroup = _schema$nodes.mediaGroup,
144
+ mediaSingle = _schema$nodes.mediaSingle;
145
+ var innerIsEmptyNode = function innerIsEmptyNode(node) {
146
+ switch (node.type) {
147
+ case media:
148
+ case mediaGroup:
149
+ case mediaSingle:
150
+ return false;
151
+ case paragraph:
152
+ case codeBlock:
153
+ case heading:
154
+ case taskItem:
155
+ case decisionItem:
156
+ return node.content.size === 0;
157
+ case blockquote:
158
+ case panel:
159
+ case listItem:
160
+ return node.content.size === 2 && innerIsEmptyNode(node.content.firstChild);
161
+ case bulletList:
162
+ case orderedList:
163
+ return node.content.size === 4 && innerIsEmptyNode(node.content.firstChild);
164
+ case taskList:
165
+ case decisionList:
166
+ return node.content.size === 2 && innerIsEmptyNode(node.content.firstChild);
167
+ case doc:
168
+ var isEmpty = true;
169
+ node.content.forEach(function (child) {
170
+ isEmpty = isEmpty && innerIsEmptyNode(child);
171
+ });
172
+ return isEmpty;
173
+ default:
174
+ return isNodeEmpty(node);
175
+ }
176
+ };
177
+ return innerIsEmptyNode;
178
+ };
179
+
180
+ /**
181
+ * Checks if a node has any content. Ignores node that only contain empty block nodes.
182
+ */
183
+ export function isNodeEmpty(node) {
184
+ if (node && node.textContent) {
185
+ return false;
186
+ }
187
+ if (!node || !node.childCount || node.childCount === 1 && isEmptyParagraph(node.firstChild)) {
188
+ return true;
189
+ }
190
+ var block = [];
191
+ var nonBlock = [];
192
+ node.forEach(function (child) {
193
+ child.isInline ? nonBlock.push(child) : block.push(child);
194
+ });
195
+ return !nonBlock.length && !block.filter(function (childNode) {
196
+ return !!childNode.childCount && !(childNode.childCount === 1 && isEmptyParagraph(childNode.firstChild)) || childNode.isAtom;
197
+ }).length;
198
+ }
@@ -9,7 +9,7 @@ export var shouldAddDefaultWrappedWidth = function shouldAddDefaultWrappedWidth(
9
9
  };
10
10
  export var nonWrappedLayouts = ['center', 'wide', 'full-width'];
11
11
  export var floatingLayouts = ['wrap-left', 'wrap-right'];
12
- export var isRichMediaInsideOfBlockNode = function isRichMediaInsideOfBlockNode(view, pos, includeMoreParentNodeTypes) {
12
+ export var isRichMediaInsideOfBlockNode = function isRichMediaInsideOfBlockNode(view, pos) {
13
13
  if (typeof pos !== 'number' || isNaN(pos) || !view) {
14
14
  return false;
15
15
  }
@@ -17,11 +17,8 @@ export var isRichMediaInsideOfBlockNode = function isRichMediaInsideOfBlockNode(
17
17
  var _view$state$schema$no = view.state.schema.nodes,
18
18
  expand = _view$state$schema$no.expand,
19
19
  nestedExpand = _view$state$schema$no.nestedExpand,
20
- layoutColumn = _view$state$schema$no.layoutColumn,
21
- tableCell = _view$state$schema$no.tableCell,
22
- listItem = _view$state$schema$no.listItem;
23
- var parentNodeTypes = [expand, nestedExpand, layoutColumn];
24
- return !!findParentNodeOfTypeClosestToPos($pos, includeMoreParentNodeTypes ? [].concat(parentNodeTypes, [tableCell, listItem]) : parentNodeTypes);
20
+ layoutColumn = _view$state$schema$no.layoutColumn;
21
+ return !!findParentNodeOfTypeClosestToPos($pos, [expand, nestedExpand, layoutColumn]);
25
22
  };
26
23
  export var alignAttributes = function alignAttributes(layout, oldAttrs) {
27
24
  var gridSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 12;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "74.44.1",
3
+ "version": "74.45.1",
4
4
  "sideEffects": false
5
5
  }
@@ -369,8 +369,11 @@ export interface CollabInviteToEditProps {
369
369
  }
370
370
  export interface CollabAnalyticsProps {
371
371
  /**
372
- * @description Control wether Synchrony entity error events are tracked
372
+ * @description Control whether Synchrony entity error events are tracked
373
373
  */
374
374
  EXPERIMENTAL_allowInternalErrorAnalytics?: boolean;
375
375
  }
376
+ export interface CollabEventLocalStepData {
377
+ steps: Array<Step>;
378
+ }
376
379
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { Mark, MarkType, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
3
- import type { Command } from '../types';
3
+ import type { PluginCommand } from '../types';
4
4
  export declare function filterChildrenBetween(doc: PMNode, from: number, to: number, predicate: (node: PMNode, pos: number, parent: PMNode | null) => boolean | undefined): {
5
5
  node: PMNode;
6
6
  pos: number;
@@ -8,11 +8,11 @@ export declare function filterChildrenBetween(doc: PMNode, from: number, to: num
8
8
  export declare const transformSmartCharsMentionsAndEmojis: (from: number, to: number, tr: Transaction) => void;
9
9
  export declare const applyMarkOnRange: (from: number, to: number, removeMark: boolean, mark: Mark, tr: Transaction) => Transaction;
10
10
  /**
11
- * A wrapper over the default toggleMark, except when we have a selection
12
- * we only toggle marks on text nodes rather than inline nodes.
11
+ * A custom version of the ProseMirror toggleMark, where we only toggle marks
12
+ * on text nodes in the selection rather than all inline nodes.
13
13
  * @param markType
14
14
  * @param attrs
15
15
  */
16
16
  export declare const toggleMark: (markType: MarkType, attrs?: {
17
17
  [key: string]: any;
18
- } | undefined) => Command;
18
+ } | undefined) => PluginCommand;
@@ -1,2 +1,2 @@
1
- export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, toggleMark, filterChildrenBetween, } from './commands';
1
+ export { transformSmartCharsMentionsAndEmojis, applyMarkOnRange, filterChildrenBetween, toggleMark, } from './commands';
2
2
  export { anyMarkActive } from './text-formatting';