@atlaskit/editor-common 74.50.3 → 74.51.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 +17 -0
- package/dist/cjs/guideline/relativeGuideline.js +7 -9
- package/dist/cjs/media-single/index.js +12 -0
- package/dist/cjs/media-single/utils.js +63 -3
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/quick-insert/assets/heading1.js +23 -6
- package/dist/cjs/quick-insert/assets/heading2.js +23 -6
- package/dist/cjs/quick-insert/assets/heading3.js +23 -6
- package/dist/cjs/quick-insert/assets/heading4.js +23 -6
- package/dist/cjs/quick-insert/assets/heading5.js +23 -6
- package/dist/cjs/quick-insert/assets/heading6.js +23 -6
- package/dist/cjs/styles/shared/smartCard.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/guideline/relativeGuideline.js +7 -9
- package/dist/es2019/media-single/index.js +1 -1
- package/dist/es2019/media-single/utils.js +59 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/quick-insert/assets/heading1.js +24 -6
- package/dist/es2019/quick-insert/assets/heading2.js +24 -6
- package/dist/es2019/quick-insert/assets/heading3.js +24 -6
- package/dist/es2019/quick-insert/assets/heading4.js +24 -6
- package/dist/es2019/quick-insert/assets/heading5.js +24 -6
- package/dist/es2019/quick-insert/assets/heading6.js +24 -6
- package/dist/es2019/styles/shared/smartCard.js +2 -2
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/guideline/relativeGuideline.js +7 -9
- package/dist/esm/media-single/index.js +1 -1
- package/dist/esm/media-single/utils.js +57 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/quick-insert/assets/heading1.js +23 -6
- package/dist/esm/quick-insert/assets/heading2.js +23 -6
- package/dist/esm/quick-insert/assets/heading3.js +23 -6
- package/dist/esm/quick-insert/assets/heading4.js +23 -6
- package/dist/esm/quick-insert/assets/heading5.js +23 -6
- package/dist/esm/quick-insert/assets/heading6.js +23 -6
- package/dist/esm/styles/shared/smartCard.js +2 -2
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/guideline/index.d.ts +1 -1
- package/dist/types/guideline/relativeGuideline.d.ts +1 -1
- package/dist/types/guideline/types.d.ts +6 -1
- package/dist/types/media-single/index.d.ts +1 -1
- package/dist/types/media-single/utils.d.ts +15 -0
- package/dist/types-ts4.5/guideline/index.d.ts +1 -1
- package/dist/types-ts4.5/guideline/relativeGuideline.d.ts +1 -1
- package/dist/types-ts4.5/guideline/types.d.ts +6 -1
- package/dist/types-ts4.5/media-single/index.d.ts +1 -1
- package/dist/types-ts4.5/media-single/utils.d.ts +15 -0
- package/package.json +1 -1
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { roundToNearest } from '../media-single';
|
|
2
2
|
import { getMediaSingleDimensions } from './utils';
|
|
3
3
|
const RELATIVE_GUIDES_GAP = 6;
|
|
4
|
-
const getWidthRelativeGuideline = (key, view, nodeWithPos, editorWidth, size) => {
|
|
4
|
+
const getWidthRelativeGuideline = (key, view, nodeWithPos, editorWidth, topOffset, size) => {
|
|
5
5
|
const {
|
|
6
6
|
node,
|
|
7
7
|
pos
|
|
8
8
|
} = nodeWithPos;
|
|
9
9
|
const {
|
|
10
|
-
top: topOffSet,
|
|
11
10
|
height: viewHeight
|
|
12
11
|
} = view.dom.getBoundingClientRect();
|
|
13
12
|
const {
|
|
@@ -18,7 +17,7 @@ const getWidthRelativeGuideline = (key, view, nodeWithPos, editorWidth, size) =>
|
|
|
18
17
|
width,
|
|
19
18
|
height
|
|
20
19
|
} = size || getMediaSingleDimensions(node, editorWidth) || {};
|
|
21
|
-
const y = top -
|
|
20
|
+
const y = top - topOffset - RELATIVE_GUIDES_GAP;
|
|
22
21
|
if (!width || !height || y < 0 || y > viewHeight) {
|
|
23
22
|
return null;
|
|
24
23
|
}
|
|
@@ -59,13 +58,12 @@ const getWidthRelativeGuideline = (key, view, nodeWithPos, editorWidth, size) =>
|
|
|
59
58
|
}
|
|
60
59
|
};
|
|
61
60
|
};
|
|
62
|
-
const getHeightRelativeGuideline = (key, view, nodeWithPos, editorWidth, size) => {
|
|
61
|
+
const getHeightRelativeGuideline = (key, view, nodeWithPos, editorWidth, topOffset, size) => {
|
|
63
62
|
const {
|
|
64
63
|
node,
|
|
65
64
|
pos
|
|
66
65
|
} = nodeWithPos;
|
|
67
66
|
const {
|
|
68
|
-
top: topOffSet,
|
|
69
67
|
height: viewHeight
|
|
70
68
|
} = view.dom.getBoundingClientRect();
|
|
71
69
|
const {
|
|
@@ -79,7 +77,7 @@ const getHeightRelativeGuideline = (key, view, nodeWithPos, editorWidth, size) =
|
|
|
79
77
|
if (!width || !height) {
|
|
80
78
|
return null;
|
|
81
79
|
}
|
|
82
|
-
const start = top -
|
|
80
|
+
const start = top - topOffset;
|
|
83
81
|
const end = start + height;
|
|
84
82
|
if (end < 0 || start > viewHeight) {
|
|
85
83
|
return null;
|
|
@@ -129,14 +127,14 @@ export const getRelativeGuideSnaps = (relativeGuides, aspectRatio) => {
|
|
|
129
127
|
});
|
|
130
128
|
return [...snapsWidthFromMatchingWidth, ...snapsWidthFromMatchingHeight];
|
|
131
129
|
};
|
|
132
|
-
export const getRelativeGuidelines = (relativeGuides, nodeWithPos, view, editorWidth, size) => {
|
|
130
|
+
export const getRelativeGuidelines = (relativeGuides, nodeWithPos, view, editorWidth, topOffset, size) => {
|
|
133
131
|
const matchWidth = relativeGuides.width ? relativeGuides.width[Math.round(size.width)] : [];
|
|
134
132
|
const matchHeight = relativeGuides.height ? relativeGuides.height[Math.round(size.height)] : [];
|
|
135
133
|
const matches = matchWidth || matchHeight;
|
|
136
134
|
const getRelativeGuideline = matchWidth && getWidthRelativeGuideline || matchHeight && getHeightRelativeGuideline || null;
|
|
137
135
|
if (matches && getRelativeGuideline) {
|
|
138
|
-
return [getRelativeGuideline('relative_guide_current', view, nodeWithPos, editorWidth, size), ...matches.map((nodeWithPos, index) => {
|
|
139
|
-
return getRelativeGuideline(`relative_guide_${index}`, view, nodeWithPos, editorWidth);
|
|
136
|
+
return [getRelativeGuideline('relative_guide_current', view, nodeWithPos, editorWidth, topOffset, size), ...matches.map((nodeWithPos, index) => {
|
|
137
|
+
return getRelativeGuideline(`relative_guide_${index}`, view, nodeWithPos, editorWidth, topOffset);
|
|
140
138
|
})].filter(config => !!config);
|
|
141
139
|
}
|
|
142
140
|
return [];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH, MEDIA_SINGLE_SNAP_GAP, MEDIA_SINGLE_HIGHLIGHT_GAP, MEDIA_SINGLE_GUTTER_SIZE, MEDIA_SINGLE_RESIZE_THROTTLE_TIME, Layout as MediaSingleLayout, DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, wrappedLayouts } from './constants';
|
|
2
|
-
export { getMediaSinglePixelWidth, calcMediaSinglePixelWidth, calcMediaSingleMaxWidth, getMediaSingleInitialWidth, calculateOffsetLeft, roundToNearest } from './utils';
|
|
2
|
+
export { getMediaSinglePixelWidth, calcMediaSinglePixelWidth, calcMediaSingleMaxWidth, getMediaSingleInitialWidth, calculateOffsetLeft, roundToNearest, getMaxWidthForNestedNode, getMaxWidthForNestedNodeNext } from './utils';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, breakoutWideScaleRatio } from '@atlaskit/editor-shared-styles';
|
|
2
|
+
import { floatingLayouts, isRichMediaInsideOfBlockNode } from '../utils/rich-media-utils';
|
|
2
3
|
import { DEFAULT_IMAGE_WIDTH, DEFAULT_ROUNDING_INTERVAL, MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, wrappedLayouts } from './constants';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -118,4 +119,61 @@ export function calculateOffsetLeft(insideInlineLike, insideLayout, pmViewDom, w
|
|
|
118
119
|
* @param {number} interval The numeric interval to round to, default to 0.5
|
|
119
120
|
* @return {number} the rounded number
|
|
120
121
|
*/
|
|
121
|
-
export const roundToNearest = (value, interval = DEFAULT_ROUNDING_INTERVAL) => Math.round(value / interval) * interval;
|
|
122
|
+
export const roundToNearest = (value, interval = DEFAULT_ROUNDING_INTERVAL) => Math.round(value / interval) * interval;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Get parent width for a nested media single node
|
|
126
|
+
* @param view Editor view
|
|
127
|
+
* @param pos node position
|
|
128
|
+
*/
|
|
129
|
+
export const getMaxWidthForNestedNode = (view, pos) => {
|
|
130
|
+
if (typeof pos !== 'number') {
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
if (isRichMediaInsideOfBlockNode(view, pos)) {
|
|
134
|
+
const $pos = view.state.doc.resolve(pos);
|
|
135
|
+
const domNode = view.nodeDOM($pos.pos);
|
|
136
|
+
if ($pos.nodeAfter && floatingLayouts.indexOf($pos.nodeAfter.attrs.layout) > -1 && domNode && domNode.parentElement) {
|
|
137
|
+
return domNode.parentElement.offsetWidth;
|
|
138
|
+
}
|
|
139
|
+
if (domNode instanceof HTMLElement) {
|
|
140
|
+
return domNode.offsetWidth;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return null;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Get parent width for a nested media single node for new experience
|
|
148
|
+
* @param view Editor view
|
|
149
|
+
* @param pos node position
|
|
150
|
+
*/
|
|
151
|
+
export const getMaxWidthForNestedNodeNext = (view, pos) => {
|
|
152
|
+
if (typeof pos !== 'number') {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
const $pos = view.state.doc.resolve(pos);
|
|
156
|
+
if ($pos && $pos.parent.type.name !== 'doc') {
|
|
157
|
+
return getParentWidthForNestedMediaSingleNode($pos, view);
|
|
158
|
+
}
|
|
159
|
+
return null;
|
|
160
|
+
};
|
|
161
|
+
export const getParentWidthForNestedMediaSingleNode = (resolvedPos, view) => {
|
|
162
|
+
const domNode = view.nodeDOM(resolvedPos.pos);
|
|
163
|
+
if (resolvedPos.nodeAfter && floatingLayouts.includes(resolvedPos.nodeAfter.attrs.layout) && domNode && domNode.parentElement) {
|
|
164
|
+
const {
|
|
165
|
+
tableCell,
|
|
166
|
+
tableHeader
|
|
167
|
+
} = view.state.schema.nodes;
|
|
168
|
+
if ([tableCell, tableHeader].includes(resolvedPos.parent.type)) {
|
|
169
|
+
// since table has constant padding, use hardcoded constant instead of query the dom
|
|
170
|
+
const tablePadding = 8;
|
|
171
|
+
return domNode.parentElement.offsetWidth - tablePadding * 2;
|
|
172
|
+
}
|
|
173
|
+
return domNode.parentElement.offsetWidth;
|
|
174
|
+
}
|
|
175
|
+
if (domNode instanceof HTMLElement) {
|
|
176
|
+
return domNode.offsetWidth;
|
|
177
|
+
}
|
|
178
|
+
return null;
|
|
179
|
+
};
|
|
@@ -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 = "74.
|
|
3
|
+
const packageVersion = "74.51.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
|
|
@@ -1,7 +1,10 @@
|
|
|
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 IconHeading1() {
|
|
5
|
+
const {
|
|
6
|
+
iconThemed
|
|
7
|
+
} = useIconThemed();
|
|
5
8
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
9
|
focusable: "false",
|
|
7
10
|
"aria-hidden": true,
|
|
@@ -11,24 +14,36 @@ export default function IconHeading1() {
|
|
|
11
14
|
fill: "none",
|
|
12
15
|
fillRule: "evenodd"
|
|
13
16
|
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
-
fill:
|
|
17
|
+
fill: iconThemed({
|
|
18
|
+
light: '#FFF',
|
|
19
|
+
dark: '#161A1D'
|
|
20
|
+
}),
|
|
15
21
|
d: "M0 0h40v40H0z"
|
|
16
22
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
17
|
-
fill:
|
|
23
|
+
fill: iconThemed({
|
|
24
|
+
light: '#C1C7D0',
|
|
25
|
+
dark: '#454F59'
|
|
26
|
+
}),
|
|
18
27
|
x: 6,
|
|
19
28
|
y: 32,
|
|
20
29
|
width: 20,
|
|
21
30
|
height: 1,
|
|
22
31
|
rx: 0.5
|
|
23
32
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
24
|
-
fill:
|
|
33
|
+
fill: iconThemed({
|
|
34
|
+
light: '#C1C7D0',
|
|
35
|
+
dark: '#454F59'
|
|
36
|
+
}),
|
|
25
37
|
x: 6,
|
|
26
38
|
y: 29,
|
|
27
39
|
width: 28,
|
|
28
40
|
height: 1,
|
|
29
41
|
rx: 0.5
|
|
30
42
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
31
|
-
fill:
|
|
43
|
+
fill: iconThemed({
|
|
44
|
+
light: '#C1C7D0',
|
|
45
|
+
dark: '#454F59'
|
|
46
|
+
}),
|
|
32
47
|
x: 6,
|
|
33
48
|
y: 26,
|
|
34
49
|
width: 28,
|
|
@@ -36,7 +51,10 @@ export default function IconHeading1() {
|
|
|
36
51
|
rx: 0.5
|
|
37
52
|
}), /*#__PURE__*/React.createElement("path", {
|
|
38
53
|
d: "M16.336 7.232h2.88V23h-2.88v-6.528H8.944V23h-2.88V7.232h2.88v6.624h7.392V7.232zM28.206 23h-2.88V9.992l-3.264 1.2V8.504l4.056-1.272h2.088V23z",
|
|
39
|
-
fill:
|
|
54
|
+
fill: iconThemed({
|
|
55
|
+
light: '#172B4D',
|
|
56
|
+
dark: '#8696A7'
|
|
57
|
+
}),
|
|
40
58
|
fillRule: "nonzero"
|
|
41
59
|
})));
|
|
42
60
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
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 IconHeading2() {
|
|
5
|
+
const {
|
|
6
|
+
iconThemed
|
|
7
|
+
} = useIconThemed();
|
|
5
8
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
9
|
focusable: "false",
|
|
7
10
|
"aria-hidden": true,
|
|
@@ -11,24 +14,36 @@ export default function IconHeading2() {
|
|
|
11
14
|
fill: "none",
|
|
12
15
|
fillRule: "evenodd"
|
|
13
16
|
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
-
fill:
|
|
17
|
+
fill: iconThemed({
|
|
18
|
+
light: '#FFF',
|
|
19
|
+
dark: '#161A1D'
|
|
20
|
+
}),
|
|
15
21
|
d: "M0 0h40v40H0z"
|
|
16
22
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
17
|
-
fill:
|
|
23
|
+
fill: iconThemed({
|
|
24
|
+
light: '#C1C7D0',
|
|
25
|
+
dark: '#454F59'
|
|
26
|
+
}),
|
|
18
27
|
x: 6,
|
|
19
28
|
y: 32,
|
|
20
29
|
width: 20,
|
|
21
30
|
height: 1,
|
|
22
31
|
rx: 0.5
|
|
23
32
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
24
|
-
fill:
|
|
33
|
+
fill: iconThemed({
|
|
34
|
+
light: '#C1C7D0',
|
|
35
|
+
dark: '#454F59'
|
|
36
|
+
}),
|
|
25
37
|
x: 6,
|
|
26
38
|
y: 29,
|
|
27
39
|
width: 28,
|
|
28
40
|
height: 1,
|
|
29
41
|
rx: 0.5
|
|
30
42
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
31
|
-
fill:
|
|
43
|
+
fill: iconThemed({
|
|
44
|
+
light: '#C1C7D0',
|
|
45
|
+
dark: '#454F59'
|
|
46
|
+
}),
|
|
32
47
|
x: 6,
|
|
33
48
|
y: 26,
|
|
34
49
|
width: 28,
|
|
@@ -36,7 +51,10 @@ export default function IconHeading2() {
|
|
|
36
51
|
rx: 0.5
|
|
37
52
|
}), /*#__PURE__*/React.createElement("path", {
|
|
38
53
|
d: "M14.68 8.86h2.4V22h-2.4v-5.44H8.52V22h-2.4V8.86h2.4v5.52h6.16V8.86zM28.88 22h-9.04v-2.2l4.66-3.7c1.14-.92 1.98-1.8 1.98-3.1 0-1.46-.98-2.1-2.48-2.1-1.28 0-2.6.44-3.86 1.16V9.78c.9-.52 2.06-1.12 4.14-1.12 3.14 0 4.58 1.74 4.58 4.26 0 2.02-1.28 3.4-3.04 4.7l-3.3 2.44c1.14-.14 2.74-.26 3.94-.26h2.42V22z",
|
|
39
|
-
fill:
|
|
54
|
+
fill: iconThemed({
|
|
55
|
+
light: '#172B4D',
|
|
56
|
+
dark: '#8696A7'
|
|
57
|
+
}),
|
|
40
58
|
fillRule: "nonzero"
|
|
41
59
|
})));
|
|
42
60
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
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 IconHeading3() {
|
|
5
|
+
const {
|
|
6
|
+
iconThemed
|
|
7
|
+
} = useIconThemed();
|
|
5
8
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
9
|
focusable: "false",
|
|
7
10
|
"aria-hidden": true,
|
|
@@ -11,24 +14,36 @@ export default function IconHeading3() {
|
|
|
11
14
|
fill: "none",
|
|
12
15
|
fillRule: "evenodd"
|
|
13
16
|
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
-
fill:
|
|
17
|
+
fill: iconThemed({
|
|
18
|
+
light: '#FFF',
|
|
19
|
+
dark: '#161A1D'
|
|
20
|
+
}),
|
|
15
21
|
d: "M0 0h40v40H0z"
|
|
16
22
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
17
|
-
fill:
|
|
23
|
+
fill: iconThemed({
|
|
24
|
+
light: '#C1C7D0',
|
|
25
|
+
dark: '#454F59'
|
|
26
|
+
}),
|
|
18
27
|
x: 6,
|
|
19
28
|
y: 31,
|
|
20
29
|
width: 20,
|
|
21
30
|
height: 1,
|
|
22
31
|
rx: 0.5
|
|
23
32
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
24
|
-
fill:
|
|
33
|
+
fill: iconThemed({
|
|
34
|
+
light: '#C1C7D0',
|
|
35
|
+
dark: '#454F59'
|
|
36
|
+
}),
|
|
25
37
|
x: 6,
|
|
26
38
|
y: 28,
|
|
27
39
|
width: 28,
|
|
28
40
|
height: 1,
|
|
29
41
|
rx: 0.5
|
|
30
42
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
31
|
-
fill:
|
|
43
|
+
fill: iconThemed({
|
|
44
|
+
light: '#C1C7D0',
|
|
45
|
+
dark: '#454F59'
|
|
46
|
+
}),
|
|
32
47
|
x: 6,
|
|
33
48
|
y: 25,
|
|
34
49
|
width: 28,
|
|
@@ -36,7 +51,10 @@ export default function IconHeading3() {
|
|
|
36
51
|
rx: 0.5
|
|
37
52
|
}), /*#__PURE__*/React.createElement("path", {
|
|
38
53
|
d: "M13.224 9.488h1.92V20h-1.92v-4.352H8.296V20h-1.92V9.488h1.92v4.416h4.928V9.488zM20.8 20.16c-1.712 0-2.736-.32-3.536-.88v-1.776c1.152.736 2.416.896 3.52.896 1.232 0 1.984-.432 1.984-1.504 0-1.104-.752-1.408-2.112-1.408H19.44v-1.472h1.232c1.216 0 1.92-.384 1.92-1.424 0-1.024-.688-1.52-1.92-1.52-.944 0-2.128.208-3.168.768v-1.744c.736-.416 1.776-.768 3.296-.768 2.544 0 3.696 1.296 3.696 2.816 0 1.424-.544 2.32-2.064 2.64 1.68.256 2.24 1.2 2.24 2.384 0 1.616-1.184 2.992-3.872 2.992z",
|
|
39
|
-
fill:
|
|
54
|
+
fill: iconThemed({
|
|
55
|
+
light: '#172B4D',
|
|
56
|
+
dark: '#8696A7'
|
|
57
|
+
}),
|
|
40
58
|
fillRule: "nonzero"
|
|
41
59
|
})));
|
|
42
60
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
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 IconHeading4() {
|
|
5
|
+
const {
|
|
6
|
+
iconThemed
|
|
7
|
+
} = useIconThemed();
|
|
5
8
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
9
|
focusable: "false",
|
|
7
10
|
"aria-hidden": true,
|
|
@@ -11,24 +14,36 @@ export default function IconHeading4() {
|
|
|
11
14
|
fill: "none",
|
|
12
15
|
fillRule: "evenodd"
|
|
13
16
|
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
-
fill:
|
|
17
|
+
fill: iconThemed({
|
|
18
|
+
light: '#FFF',
|
|
19
|
+
dark: '#161A1D'
|
|
20
|
+
}),
|
|
15
21
|
d: "M0 0h40v40H0z"
|
|
16
22
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
17
|
-
fill:
|
|
23
|
+
fill: iconThemed({
|
|
24
|
+
light: '#C1C7D0',
|
|
25
|
+
dark: '#454F59'
|
|
26
|
+
}),
|
|
18
27
|
x: 6,
|
|
19
28
|
y: 30,
|
|
20
29
|
width: 20,
|
|
21
30
|
height: 1,
|
|
22
31
|
rx: 0.5
|
|
23
32
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
24
|
-
fill:
|
|
33
|
+
fill: iconThemed({
|
|
34
|
+
light: '#C1C7D0',
|
|
35
|
+
dark: '#454F59'
|
|
36
|
+
}),
|
|
25
37
|
x: 6,
|
|
26
38
|
y: 27,
|
|
27
39
|
width: 28,
|
|
28
40
|
height: 1,
|
|
29
41
|
rx: 0.5
|
|
30
42
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
31
|
-
fill:
|
|
43
|
+
fill: iconThemed({
|
|
44
|
+
light: '#C1C7D0',
|
|
45
|
+
dark: '#454F59'
|
|
46
|
+
}),
|
|
32
47
|
x: 6,
|
|
33
48
|
y: 24,
|
|
34
49
|
width: 28,
|
|
@@ -36,7 +51,10 @@ export default function IconHeading4() {
|
|
|
36
51
|
rx: 0.5
|
|
37
52
|
}), /*#__PURE__*/React.createElement("path", {
|
|
38
53
|
d: "M11.804 9.802h2.254V19h-2.254v-3.57H8.206V19H5.952V9.802h2.254v3.654h3.598V9.802zm6.188 4.186l-1.246 1.68a33.67 33.67 0 012.646-.098v-3.78c-.476.812-.994 1.638-1.4 2.198zM21.52 19h-2.24v-1.666h-4.116v-1.946l4.116-5.586h2.24v5.768h1.05v1.764h-1.05V19z",
|
|
39
|
-
fill:
|
|
54
|
+
fill: iconThemed({
|
|
55
|
+
light: '#172B4D',
|
|
56
|
+
dark: '#8696A7'
|
|
57
|
+
}),
|
|
40
58
|
fillRule: "nonzero"
|
|
41
59
|
})));
|
|
42
60
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
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 IconHeading5() {
|
|
5
|
+
const {
|
|
6
|
+
iconThemed
|
|
7
|
+
} = useIconThemed();
|
|
5
8
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
9
|
focusable: "false",
|
|
7
10
|
"aria-hidden": true,
|
|
@@ -11,24 +14,36 @@ export default function IconHeading5() {
|
|
|
11
14
|
fill: "none",
|
|
12
15
|
fillRule: "evenodd"
|
|
13
16
|
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
-
fill:
|
|
17
|
+
fill: iconThemed({
|
|
18
|
+
light: '#FFF',
|
|
19
|
+
dark: '#161A1D'
|
|
20
|
+
}),
|
|
15
21
|
d: "M0 0h40v40H0z"
|
|
16
22
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
17
|
-
fill:
|
|
23
|
+
fill: iconThemed({
|
|
24
|
+
light: '#C1C7D0',
|
|
25
|
+
dark: '#454F59'
|
|
26
|
+
}),
|
|
18
27
|
x: 6,
|
|
19
28
|
y: 30,
|
|
20
29
|
width: 20,
|
|
21
30
|
height: 1,
|
|
22
31
|
rx: 0.5
|
|
23
32
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
24
|
-
fill:
|
|
33
|
+
fill: iconThemed({
|
|
34
|
+
light: '#C1C7D0',
|
|
35
|
+
dark: '#454F59'
|
|
36
|
+
}),
|
|
25
37
|
x: 6,
|
|
26
38
|
y: 27,
|
|
27
39
|
width: 28,
|
|
28
40
|
height: 1,
|
|
29
41
|
rx: 0.5
|
|
30
42
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
31
|
-
fill:
|
|
43
|
+
fill: iconThemed({
|
|
44
|
+
light: '#C1C7D0',
|
|
45
|
+
dark: '#454F59'
|
|
46
|
+
}),
|
|
32
47
|
x: 6,
|
|
33
48
|
y: 24,
|
|
34
49
|
width: 28,
|
|
@@ -36,7 +51,10 @@ export default function IconHeading5() {
|
|
|
36
51
|
rx: 0.5
|
|
37
52
|
}), /*#__PURE__*/React.createElement("path", {
|
|
38
53
|
d: "M10.832 11.116h1.932V19h-1.932v-3.06H7.748V19H5.816v-7.884h1.932v3.132h3.084v-3.132zm6.024 8.016c-1.152 0-2.124-.252-2.796-.684v-1.716a5.307 5.307 0 002.676.744c.852 0 1.308-.288 1.308-.984 0-.744-.456-.984-1.2-.984-.396 0-.816.096-1.176.24l-1.308-.504v-4.128h5.124v1.644h-3.48v1.896c.372-.168.852-.288 1.452-.288 1.656 0 2.4.9 2.4 2.304 0 1.476-.924 2.46-3 2.46z",
|
|
39
|
-
fill:
|
|
54
|
+
fill: iconThemed({
|
|
55
|
+
light: '#172B4D',
|
|
56
|
+
dark: '#8696A7'
|
|
57
|
+
}),
|
|
40
58
|
fillRule: "nonzero"
|
|
41
59
|
})));
|
|
42
60
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
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 IconHeading6() {
|
|
5
|
+
const {
|
|
6
|
+
iconThemed
|
|
7
|
+
} = useIconThemed();
|
|
5
8
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
9
|
focusable: "false",
|
|
7
10
|
"aria-hidden": true,
|
|
@@ -11,24 +14,36 @@ export default function IconHeading6() {
|
|
|
11
14
|
fill: "none",
|
|
12
15
|
fillRule: "evenodd"
|
|
13
16
|
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
-
fill:
|
|
17
|
+
fill: iconThemed({
|
|
18
|
+
light: '#FFF',
|
|
19
|
+
dark: '#161A1D'
|
|
20
|
+
}),
|
|
15
21
|
d: "M0 0h40v40H0z"
|
|
16
22
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
17
|
-
fill:
|
|
23
|
+
fill: iconThemed({
|
|
24
|
+
light: '#C1C7D0',
|
|
25
|
+
dark: '#454F59'
|
|
26
|
+
}),
|
|
18
27
|
x: 6,
|
|
19
28
|
y: 30,
|
|
20
29
|
width: 20,
|
|
21
30
|
height: 1,
|
|
22
31
|
rx: 0.5
|
|
23
32
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
24
|
-
fill:
|
|
33
|
+
fill: iconThemed({
|
|
34
|
+
light: '#C1C7D0',
|
|
35
|
+
dark: '#454F59'
|
|
36
|
+
}),
|
|
25
37
|
x: 6,
|
|
26
38
|
y: 27,
|
|
27
39
|
width: 28,
|
|
28
40
|
height: 1,
|
|
29
41
|
rx: 0.5
|
|
30
42
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
31
|
-
fill:
|
|
43
|
+
fill: iconThemed({
|
|
44
|
+
light: '#C1C7D0',
|
|
45
|
+
dark: '#454F59'
|
|
46
|
+
}),
|
|
32
47
|
x: 6,
|
|
33
48
|
y: 24,
|
|
34
49
|
width: 28,
|
|
@@ -36,7 +51,10 @@ export default function IconHeading6() {
|
|
|
36
51
|
rx: 0.5
|
|
37
52
|
}), /*#__PURE__*/React.createElement("path", {
|
|
38
53
|
d: "M12.675 19h-1.622v-3.239H7.562V19H5.94v-7.75h1.622v3.125h3.491V11.25h1.622V19zm4.878.199c-1.122 0-2.025-.494-2.556-1.402-.43-.66-.65-1.552-.65-2.616 0-2.573 1.213-4.13 3.233-4.13 1.472 0 2.616.87 2.836 2.164H18.81c-.15-.51-.634-.832-1.24-.832-1.064 0-1.709 1.026-1.677 2.632h.097c.355-.73 1.074-1.144 1.977-1.144 1.471 0 2.551 1.09 2.551 2.572 0 1.612-1.23 2.756-2.965 2.756zm-.016-1.332c.795 0 1.407-.596 1.407-1.375 0-.79-.59-1.37-1.402-1.37-.81 0-1.407.58-1.407 1.354 0 .79.607 1.39 1.402 1.39z",
|
|
39
|
-
fill:
|
|
54
|
+
fill: iconThemed({
|
|
55
|
+
light: '#97A0AF',
|
|
56
|
+
dark: '#5A6977'
|
|
57
|
+
}),
|
|
40
58
|
fillRule: "nonzero"
|
|
41
59
|
})));
|
|
42
60
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
-
import { akEditorDeleteBackground, akEditorDeleteBorder,
|
|
2
|
+
import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedNodeClassName, getSelectionStyles, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
3
3
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
4
|
import { N0, N20, N40 } from '@atlaskit/theme/colors';
|
|
5
5
|
import { SmartCardSharedCssClassName } from './smart-card';
|
|
@@ -79,7 +79,7 @@ export const smartCardStyles = css`
|
|
|
79
79
|
.${DATASOURCE_INNER_CONTAINER_CLASSNAME} {
|
|
80
80
|
cursor: pointer;
|
|
81
81
|
background-color: ${`var(--ds-background-neutral-subtle, ${N0})`};
|
|
82
|
-
border-radius: ${
|
|
82
|
+
border-radius: ${"var(--ds-border-radius-100, 3px)"};
|
|
83
83
|
border: 1px solid ${`var(--ds-border, ${N40})`};
|
|
84
84
|
}
|
|
85
85
|
|
|
@@ -8,7 +8,7 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
8
8
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
9
9
|
import Layer from '../Layer';
|
|
10
10
|
const packageName = "@atlaskit/editor-common";
|
|
11
|
-
const packageVersion = "74.
|
|
11
|
+
const packageVersion = "74.51.0";
|
|
12
12
|
const halfFocusRing = 1;
|
|
13
13
|
const dropOffset = '0, 8';
|
|
14
14
|
class DropList extends Component {
|
|
@@ -2,11 +2,10 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
2
2
|
import { roundToNearest } from '../media-single';
|
|
3
3
|
import { getMediaSingleDimensions } from './utils';
|
|
4
4
|
var RELATIVE_GUIDES_GAP = 6;
|
|
5
|
-
var getWidthRelativeGuideline = function getWidthRelativeGuideline(key, view, nodeWithPos, editorWidth, size) {
|
|
5
|
+
var getWidthRelativeGuideline = function getWidthRelativeGuideline(key, view, nodeWithPos, editorWidth, topOffset, size) {
|
|
6
6
|
var node = nodeWithPos.node,
|
|
7
7
|
pos = nodeWithPos.pos;
|
|
8
8
|
var _view$dom$getBounding = view.dom.getBoundingClientRect(),
|
|
9
|
-
topOffSet = _view$dom$getBounding.top,
|
|
10
9
|
viewHeight = _view$dom$getBounding.height;
|
|
11
10
|
var _view$coordsAtPos = view.coordsAtPos(pos + 1),
|
|
12
11
|
top = _view$coordsAtPos.top; // media node
|
|
@@ -14,7 +13,7 @@ var getWidthRelativeGuideline = function getWidthRelativeGuideline(key, view, no
|
|
|
14
13
|
var _ref = size || getMediaSingleDimensions(node, editorWidth) || {},
|
|
15
14
|
width = _ref.width,
|
|
16
15
|
height = _ref.height;
|
|
17
|
-
var y = top -
|
|
16
|
+
var y = top - topOffset - RELATIVE_GUIDES_GAP;
|
|
18
17
|
if (!width || !height || y < 0 || y > viewHeight) {
|
|
19
18
|
return null;
|
|
20
19
|
}
|
|
@@ -55,11 +54,10 @@ var getWidthRelativeGuideline = function getWidthRelativeGuideline(key, view, no
|
|
|
55
54
|
}
|
|
56
55
|
};
|
|
57
56
|
};
|
|
58
|
-
var getHeightRelativeGuideline = function getHeightRelativeGuideline(key, view, nodeWithPos, editorWidth, size) {
|
|
57
|
+
var getHeightRelativeGuideline = function getHeightRelativeGuideline(key, view, nodeWithPos, editorWidth, topOffset, size) {
|
|
59
58
|
var node = nodeWithPos.node,
|
|
60
59
|
pos = nodeWithPos.pos;
|
|
61
60
|
var _view$dom$getBounding2 = view.dom.getBoundingClientRect(),
|
|
62
|
-
topOffSet = _view$dom$getBounding2.top,
|
|
63
61
|
viewHeight = _view$dom$getBounding2.height;
|
|
64
62
|
var _view$coordsAtPos2 = view.coordsAtPos(pos + 1),
|
|
65
63
|
top = _view$coordsAtPos2.top; // media node
|
|
@@ -70,7 +68,7 @@ var getHeightRelativeGuideline = function getHeightRelativeGuideline(key, view,
|
|
|
70
68
|
if (!width || !height) {
|
|
71
69
|
return null;
|
|
72
70
|
}
|
|
73
|
-
var start = top -
|
|
71
|
+
var start = top - topOffset;
|
|
74
72
|
var end = start + height;
|
|
75
73
|
if (end < 0 || start > viewHeight) {
|
|
76
74
|
return null;
|
|
@@ -120,14 +118,14 @@ export var getRelativeGuideSnaps = function getRelativeGuideSnaps(relativeGuides
|
|
|
120
118
|
});
|
|
121
119
|
return [].concat(_toConsumableArray(snapsWidthFromMatchingWidth), _toConsumableArray(snapsWidthFromMatchingHeight));
|
|
122
120
|
};
|
|
123
|
-
export var getRelativeGuidelines = function getRelativeGuidelines(relativeGuides, nodeWithPos, view, editorWidth, size) {
|
|
121
|
+
export var getRelativeGuidelines = function getRelativeGuidelines(relativeGuides, nodeWithPos, view, editorWidth, topOffset, size) {
|
|
124
122
|
var matchWidth = relativeGuides.width ? relativeGuides.width[Math.round(size.width)] : [];
|
|
125
123
|
var matchHeight = relativeGuides.height ? relativeGuides.height[Math.round(size.height)] : [];
|
|
126
124
|
var matches = matchWidth || matchHeight;
|
|
127
125
|
var getRelativeGuideline = matchWidth && getWidthRelativeGuideline || matchHeight && getHeightRelativeGuideline || null;
|
|
128
126
|
if (matches && getRelativeGuideline) {
|
|
129
|
-
return [getRelativeGuideline('relative_guide_current', view, nodeWithPos, editorWidth, size)].concat(_toConsumableArray(matches.map(function (nodeWithPos, index) {
|
|
130
|
-
return getRelativeGuideline("relative_guide_".concat(index), view, nodeWithPos, editorWidth);
|
|
127
|
+
return [getRelativeGuideline('relative_guide_current', view, nodeWithPos, editorWidth, topOffset, size)].concat(_toConsumableArray(matches.map(function (nodeWithPos, index) {
|
|
128
|
+
return getRelativeGuideline("relative_guide_".concat(index), view, nodeWithPos, editorWidth, topOffset);
|
|
131
129
|
}))).filter(function (config) {
|
|
132
130
|
return !!config;
|
|
133
131
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH, MEDIA_SINGLE_SNAP_GAP, MEDIA_SINGLE_HIGHLIGHT_GAP, MEDIA_SINGLE_GUTTER_SIZE, MEDIA_SINGLE_RESIZE_THROTTLE_TIME, Layout as MediaSingleLayout, DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, wrappedLayouts } from './constants';
|
|
2
|
-
export { getMediaSinglePixelWidth, calcMediaSinglePixelWidth, calcMediaSingleMaxWidth, getMediaSingleInitialWidth, calculateOffsetLeft, roundToNearest } from './utils';
|
|
2
|
+
export { getMediaSinglePixelWidth, calcMediaSinglePixelWidth, calcMediaSingleMaxWidth, getMediaSingleInitialWidth, calculateOffsetLeft, roundToNearest, getMaxWidthForNestedNode, getMaxWidthForNestedNodeNext } from './utils';
|