@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,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
|
/**
|
|
@@ -127,4 +128,60 @@ export function calculateOffsetLeft(insideInlineLike, insideLayout, pmViewDom, w
|
|
|
127
128
|
export var roundToNearest = function roundToNearest(value) {
|
|
128
129
|
var interval = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_ROUNDING_INTERVAL;
|
|
129
130
|
return Math.round(value / interval) * interval;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Get parent width for a nested media single node
|
|
135
|
+
* @param view Editor view
|
|
136
|
+
* @param pos node position
|
|
137
|
+
*/
|
|
138
|
+
export var getMaxWidthForNestedNode = function getMaxWidthForNestedNode(view, pos) {
|
|
139
|
+
if (typeof pos !== 'number') {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
if (isRichMediaInsideOfBlockNode(view, pos)) {
|
|
143
|
+
var $pos = view.state.doc.resolve(pos);
|
|
144
|
+
var domNode = view.nodeDOM($pos.pos);
|
|
145
|
+
if ($pos.nodeAfter && floatingLayouts.indexOf($pos.nodeAfter.attrs.layout) > -1 && domNode && domNode.parentElement) {
|
|
146
|
+
return domNode.parentElement.offsetWidth;
|
|
147
|
+
}
|
|
148
|
+
if (domNode instanceof HTMLElement) {
|
|
149
|
+
return domNode.offsetWidth;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return null;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Get parent width for a nested media single node for new experience
|
|
157
|
+
* @param view Editor view
|
|
158
|
+
* @param pos node position
|
|
159
|
+
*/
|
|
160
|
+
export var getMaxWidthForNestedNodeNext = function getMaxWidthForNestedNodeNext(view, pos) {
|
|
161
|
+
if (typeof pos !== 'number') {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
var $pos = view.state.doc.resolve(pos);
|
|
165
|
+
if ($pos && $pos.parent.type.name !== 'doc') {
|
|
166
|
+
return getParentWidthForNestedMediaSingleNode($pos, view);
|
|
167
|
+
}
|
|
168
|
+
return null;
|
|
169
|
+
};
|
|
170
|
+
export var getParentWidthForNestedMediaSingleNode = function getParentWidthForNestedMediaSingleNode(resolvedPos, view) {
|
|
171
|
+
var domNode = view.nodeDOM(resolvedPos.pos);
|
|
172
|
+
if (resolvedPos.nodeAfter && floatingLayouts.includes(resolvedPos.nodeAfter.attrs.layout) && domNode && domNode.parentElement) {
|
|
173
|
+
var _view$state$schema$no = view.state.schema.nodes,
|
|
174
|
+
tableCell = _view$state$schema$no.tableCell,
|
|
175
|
+
tableHeader = _view$state$schema$no.tableHeader;
|
|
176
|
+
if ([tableCell, tableHeader].includes(resolvedPos.parent.type)) {
|
|
177
|
+
// since table has constant padding, use hardcoded constant instead of query the dom
|
|
178
|
+
var tablePadding = 8;
|
|
179
|
+
return domNode.parentElement.offsetWidth - tablePadding * 2;
|
|
180
|
+
}
|
|
181
|
+
return domNode.parentElement.offsetWidth;
|
|
182
|
+
}
|
|
183
|
+
if (domNode instanceof HTMLElement) {
|
|
184
|
+
return domNode.offsetWidth;
|
|
185
|
+
}
|
|
186
|
+
return null;
|
|
130
187
|
};
|
|
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
6
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
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 = "74.
|
|
9
|
+
var packageVersion = "74.51.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
|
|
@@ -1,7 +1,9 @@
|
|
|
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
|
+
var _useIconThemed = useIconThemed(),
|
|
6
|
+
iconThemed = _useIconThemed.iconThemed;
|
|
5
7
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
8
|
focusable: "false",
|
|
7
9
|
"aria-hidden": true,
|
|
@@ -11,24 +13,36 @@ export default function IconHeading1() {
|
|
|
11
13
|
fill: "none",
|
|
12
14
|
fillRule: "evenodd"
|
|
13
15
|
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
-
fill:
|
|
16
|
+
fill: iconThemed({
|
|
17
|
+
light: '#FFF',
|
|
18
|
+
dark: '#161A1D'
|
|
19
|
+
}),
|
|
15
20
|
d: "M0 0h40v40H0z"
|
|
16
21
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
17
|
-
fill:
|
|
22
|
+
fill: iconThemed({
|
|
23
|
+
light: '#C1C7D0',
|
|
24
|
+
dark: '#454F59'
|
|
25
|
+
}),
|
|
18
26
|
x: 6,
|
|
19
27
|
y: 32,
|
|
20
28
|
width: 20,
|
|
21
29
|
height: 1,
|
|
22
30
|
rx: 0.5
|
|
23
31
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
24
|
-
fill:
|
|
32
|
+
fill: iconThemed({
|
|
33
|
+
light: '#C1C7D0',
|
|
34
|
+
dark: '#454F59'
|
|
35
|
+
}),
|
|
25
36
|
x: 6,
|
|
26
37
|
y: 29,
|
|
27
38
|
width: 28,
|
|
28
39
|
height: 1,
|
|
29
40
|
rx: 0.5
|
|
30
41
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
31
|
-
fill:
|
|
42
|
+
fill: iconThemed({
|
|
43
|
+
light: '#C1C7D0',
|
|
44
|
+
dark: '#454F59'
|
|
45
|
+
}),
|
|
32
46
|
x: 6,
|
|
33
47
|
y: 26,
|
|
34
48
|
width: 28,
|
|
@@ -36,7 +50,10 @@ export default function IconHeading1() {
|
|
|
36
50
|
rx: 0.5
|
|
37
51
|
}), /*#__PURE__*/React.createElement("path", {
|
|
38
52
|
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:
|
|
53
|
+
fill: iconThemed({
|
|
54
|
+
light: '#172B4D',
|
|
55
|
+
dark: '#8696A7'
|
|
56
|
+
}),
|
|
40
57
|
fillRule: "nonzero"
|
|
41
58
|
})));
|
|
42
59
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
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
|
+
var _useIconThemed = useIconThemed(),
|
|
6
|
+
iconThemed = _useIconThemed.iconThemed;
|
|
5
7
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
8
|
focusable: "false",
|
|
7
9
|
"aria-hidden": true,
|
|
@@ -11,24 +13,36 @@ export default function IconHeading2() {
|
|
|
11
13
|
fill: "none",
|
|
12
14
|
fillRule: "evenodd"
|
|
13
15
|
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
-
fill:
|
|
16
|
+
fill: iconThemed({
|
|
17
|
+
light: '#FFF',
|
|
18
|
+
dark: '#161A1D'
|
|
19
|
+
}),
|
|
15
20
|
d: "M0 0h40v40H0z"
|
|
16
21
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
17
|
-
fill:
|
|
22
|
+
fill: iconThemed({
|
|
23
|
+
light: '#C1C7D0',
|
|
24
|
+
dark: '#454F59'
|
|
25
|
+
}),
|
|
18
26
|
x: 6,
|
|
19
27
|
y: 32,
|
|
20
28
|
width: 20,
|
|
21
29
|
height: 1,
|
|
22
30
|
rx: 0.5
|
|
23
31
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
24
|
-
fill:
|
|
32
|
+
fill: iconThemed({
|
|
33
|
+
light: '#C1C7D0',
|
|
34
|
+
dark: '#454F59'
|
|
35
|
+
}),
|
|
25
36
|
x: 6,
|
|
26
37
|
y: 29,
|
|
27
38
|
width: 28,
|
|
28
39
|
height: 1,
|
|
29
40
|
rx: 0.5
|
|
30
41
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
31
|
-
fill:
|
|
42
|
+
fill: iconThemed({
|
|
43
|
+
light: '#C1C7D0',
|
|
44
|
+
dark: '#454F59'
|
|
45
|
+
}),
|
|
32
46
|
x: 6,
|
|
33
47
|
y: 26,
|
|
34
48
|
width: 28,
|
|
@@ -36,7 +50,10 @@ export default function IconHeading2() {
|
|
|
36
50
|
rx: 0.5
|
|
37
51
|
}), /*#__PURE__*/React.createElement("path", {
|
|
38
52
|
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:
|
|
53
|
+
fill: iconThemed({
|
|
54
|
+
light: '#172B4D',
|
|
55
|
+
dark: '#8696A7'
|
|
56
|
+
}),
|
|
40
57
|
fillRule: "nonzero"
|
|
41
58
|
})));
|
|
42
59
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
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
|
+
var _useIconThemed = useIconThemed(),
|
|
6
|
+
iconThemed = _useIconThemed.iconThemed;
|
|
5
7
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
8
|
focusable: "false",
|
|
7
9
|
"aria-hidden": true,
|
|
@@ -11,24 +13,36 @@ export default function IconHeading3() {
|
|
|
11
13
|
fill: "none",
|
|
12
14
|
fillRule: "evenodd"
|
|
13
15
|
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
-
fill:
|
|
16
|
+
fill: iconThemed({
|
|
17
|
+
light: '#FFF',
|
|
18
|
+
dark: '#161A1D'
|
|
19
|
+
}),
|
|
15
20
|
d: "M0 0h40v40H0z"
|
|
16
21
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
17
|
-
fill:
|
|
22
|
+
fill: iconThemed({
|
|
23
|
+
light: '#C1C7D0',
|
|
24
|
+
dark: '#454F59'
|
|
25
|
+
}),
|
|
18
26
|
x: 6,
|
|
19
27
|
y: 31,
|
|
20
28
|
width: 20,
|
|
21
29
|
height: 1,
|
|
22
30
|
rx: 0.5
|
|
23
31
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
24
|
-
fill:
|
|
32
|
+
fill: iconThemed({
|
|
33
|
+
light: '#C1C7D0',
|
|
34
|
+
dark: '#454F59'
|
|
35
|
+
}),
|
|
25
36
|
x: 6,
|
|
26
37
|
y: 28,
|
|
27
38
|
width: 28,
|
|
28
39
|
height: 1,
|
|
29
40
|
rx: 0.5
|
|
30
41
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
31
|
-
fill:
|
|
42
|
+
fill: iconThemed({
|
|
43
|
+
light: '#C1C7D0',
|
|
44
|
+
dark: '#454F59'
|
|
45
|
+
}),
|
|
32
46
|
x: 6,
|
|
33
47
|
y: 25,
|
|
34
48
|
width: 28,
|
|
@@ -36,7 +50,10 @@ export default function IconHeading3() {
|
|
|
36
50
|
rx: 0.5
|
|
37
51
|
}), /*#__PURE__*/React.createElement("path", {
|
|
38
52
|
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:
|
|
53
|
+
fill: iconThemed({
|
|
54
|
+
light: '#172B4D',
|
|
55
|
+
dark: '#8696A7'
|
|
56
|
+
}),
|
|
40
57
|
fillRule: "nonzero"
|
|
41
58
|
})));
|
|
42
59
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
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
|
+
var _useIconThemed = useIconThemed(),
|
|
6
|
+
iconThemed = _useIconThemed.iconThemed;
|
|
5
7
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
8
|
focusable: "false",
|
|
7
9
|
"aria-hidden": true,
|
|
@@ -11,24 +13,36 @@ export default function IconHeading4() {
|
|
|
11
13
|
fill: "none",
|
|
12
14
|
fillRule: "evenodd"
|
|
13
15
|
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
-
fill:
|
|
16
|
+
fill: iconThemed({
|
|
17
|
+
light: '#FFF',
|
|
18
|
+
dark: '#161A1D'
|
|
19
|
+
}),
|
|
15
20
|
d: "M0 0h40v40H0z"
|
|
16
21
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
17
|
-
fill:
|
|
22
|
+
fill: iconThemed({
|
|
23
|
+
light: '#C1C7D0',
|
|
24
|
+
dark: '#454F59'
|
|
25
|
+
}),
|
|
18
26
|
x: 6,
|
|
19
27
|
y: 30,
|
|
20
28
|
width: 20,
|
|
21
29
|
height: 1,
|
|
22
30
|
rx: 0.5
|
|
23
31
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
24
|
-
fill:
|
|
32
|
+
fill: iconThemed({
|
|
33
|
+
light: '#C1C7D0',
|
|
34
|
+
dark: '#454F59'
|
|
35
|
+
}),
|
|
25
36
|
x: 6,
|
|
26
37
|
y: 27,
|
|
27
38
|
width: 28,
|
|
28
39
|
height: 1,
|
|
29
40
|
rx: 0.5
|
|
30
41
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
31
|
-
fill:
|
|
42
|
+
fill: iconThemed({
|
|
43
|
+
light: '#C1C7D0',
|
|
44
|
+
dark: '#454F59'
|
|
45
|
+
}),
|
|
32
46
|
x: 6,
|
|
33
47
|
y: 24,
|
|
34
48
|
width: 28,
|
|
@@ -36,7 +50,10 @@ export default function IconHeading4() {
|
|
|
36
50
|
rx: 0.5
|
|
37
51
|
}), /*#__PURE__*/React.createElement("path", {
|
|
38
52
|
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:
|
|
53
|
+
fill: iconThemed({
|
|
54
|
+
light: '#172B4D',
|
|
55
|
+
dark: '#8696A7'
|
|
56
|
+
}),
|
|
40
57
|
fillRule: "nonzero"
|
|
41
58
|
})));
|
|
42
59
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
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
|
+
var _useIconThemed = useIconThemed(),
|
|
6
|
+
iconThemed = _useIconThemed.iconThemed;
|
|
5
7
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
8
|
focusable: "false",
|
|
7
9
|
"aria-hidden": true,
|
|
@@ -11,24 +13,36 @@ export default function IconHeading5() {
|
|
|
11
13
|
fill: "none",
|
|
12
14
|
fillRule: "evenodd"
|
|
13
15
|
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
-
fill:
|
|
16
|
+
fill: iconThemed({
|
|
17
|
+
light: '#FFF',
|
|
18
|
+
dark: '#161A1D'
|
|
19
|
+
}),
|
|
15
20
|
d: "M0 0h40v40H0z"
|
|
16
21
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
17
|
-
fill:
|
|
22
|
+
fill: iconThemed({
|
|
23
|
+
light: '#C1C7D0',
|
|
24
|
+
dark: '#454F59'
|
|
25
|
+
}),
|
|
18
26
|
x: 6,
|
|
19
27
|
y: 30,
|
|
20
28
|
width: 20,
|
|
21
29
|
height: 1,
|
|
22
30
|
rx: 0.5
|
|
23
31
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
24
|
-
fill:
|
|
32
|
+
fill: iconThemed({
|
|
33
|
+
light: '#C1C7D0',
|
|
34
|
+
dark: '#454F59'
|
|
35
|
+
}),
|
|
25
36
|
x: 6,
|
|
26
37
|
y: 27,
|
|
27
38
|
width: 28,
|
|
28
39
|
height: 1,
|
|
29
40
|
rx: 0.5
|
|
30
41
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
31
|
-
fill:
|
|
42
|
+
fill: iconThemed({
|
|
43
|
+
light: '#C1C7D0',
|
|
44
|
+
dark: '#454F59'
|
|
45
|
+
}),
|
|
32
46
|
x: 6,
|
|
33
47
|
y: 24,
|
|
34
48
|
width: 28,
|
|
@@ -36,7 +50,10 @@ export default function IconHeading5() {
|
|
|
36
50
|
rx: 0.5
|
|
37
51
|
}), /*#__PURE__*/React.createElement("path", {
|
|
38
52
|
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:
|
|
53
|
+
fill: iconThemed({
|
|
54
|
+
light: '#172B4D',
|
|
55
|
+
dark: '#8696A7'
|
|
56
|
+
}),
|
|
40
57
|
fillRule: "nonzero"
|
|
41
58
|
})));
|
|
42
59
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
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
|
+
var _useIconThemed = useIconThemed(),
|
|
6
|
+
iconThemed = _useIconThemed.iconThemed;
|
|
5
7
|
return /*#__PURE__*/React.createElement("svg", {
|
|
6
8
|
focusable: "false",
|
|
7
9
|
"aria-hidden": true,
|
|
@@ -11,24 +13,36 @@ export default function IconHeading6() {
|
|
|
11
13
|
fill: "none",
|
|
12
14
|
fillRule: "evenodd"
|
|
13
15
|
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
-
fill:
|
|
16
|
+
fill: iconThemed({
|
|
17
|
+
light: '#FFF',
|
|
18
|
+
dark: '#161A1D'
|
|
19
|
+
}),
|
|
15
20
|
d: "M0 0h40v40H0z"
|
|
16
21
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
17
|
-
fill:
|
|
22
|
+
fill: iconThemed({
|
|
23
|
+
light: '#C1C7D0',
|
|
24
|
+
dark: '#454F59'
|
|
25
|
+
}),
|
|
18
26
|
x: 6,
|
|
19
27
|
y: 30,
|
|
20
28
|
width: 20,
|
|
21
29
|
height: 1,
|
|
22
30
|
rx: 0.5
|
|
23
31
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
24
|
-
fill:
|
|
32
|
+
fill: iconThemed({
|
|
33
|
+
light: '#C1C7D0',
|
|
34
|
+
dark: '#454F59'
|
|
35
|
+
}),
|
|
25
36
|
x: 6,
|
|
26
37
|
y: 27,
|
|
27
38
|
width: 28,
|
|
28
39
|
height: 1,
|
|
29
40
|
rx: 0.5
|
|
30
41
|
}), /*#__PURE__*/React.createElement("rect", {
|
|
31
|
-
fill:
|
|
42
|
+
fill: iconThemed({
|
|
43
|
+
light: '#C1C7D0',
|
|
44
|
+
dark: '#454F59'
|
|
45
|
+
}),
|
|
32
46
|
x: 6,
|
|
33
47
|
y: 24,
|
|
34
48
|
width: 28,
|
|
@@ -36,7 +50,10 @@ export default function IconHeading6() {
|
|
|
36
50
|
rx: 0.5
|
|
37
51
|
}), /*#__PURE__*/React.createElement("path", {
|
|
38
52
|
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:
|
|
53
|
+
fill: iconThemed({
|
|
54
|
+
light: '#97A0AF',
|
|
55
|
+
dark: '#5A6977'
|
|
56
|
+
}),
|
|
40
57
|
fillRule: "nonzero"
|
|
41
58
|
})));
|
|
42
59
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { akEditorDeleteBackground, akEditorDeleteBorder,
|
|
4
|
+
import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedNodeClassName, getSelectionStyles, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
5
5
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
6
|
import { N0, N20, N40 } from '@atlaskit/theme/colors';
|
|
7
7
|
import { SmartCardSharedCssClassName } from './smart-card';
|
|
8
8
|
export var DATASOURCE_INNER_CONTAINER_CLASSNAME = 'datasourceView-content-inner-wrap';
|
|
9
9
|
export var FLOATING_TOOLBAR_LINKPICKER_CLASSNAME = 'card-floating-toolbar--link-picker';
|
|
10
|
-
export var smartCardStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n max-width: calc(100% - 20px);\n vertical-align: top;\n word-break: break-all;\n\n .card {\n padding-left: ", ";\n padding-right: ", ";\n padding-top: 0.5em;\n padding-bottom: 0.5em;\n margin-bottom: -0.5em;\n\n .", " > a:focus {\n ", "\n }\n }\n\n &.", "\n .", "\n > a {\n ", "\n }\n .", " > a {\n /* EDM-1717: box-shadow Safari fix start */\n z-index: 1;\n position: relative;\n /* EDM-1717: box-shadow Safari fix end */\n }\n\n &.danger {\n .", " > a {\n box-shadow: 0 0 0 1px\n ", ";\n /* EDM-1717: box-shadow Safari fix start */\n z-index: 2;\n /* EDM-1717: box-shadow Safari fix end */\n }\n }\n }\n\n .", " {\n .", " > div {\n cursor: pointer;\n ", "\n }\n\n &.", "\n .", "\n > div {\n ", "\n ", "\n }\n\n &.danger {\n .", " > div {\n box-shadow: 0 0 0 1px\n ", " !important;\n }\n }\n }\n\n .", ".", " {\n max-width: 100%;\n display: flex;\n justify-content: center;\n\n .", " {\n cursor: pointer;\n background-color: ", ";\n border-radius: ", ";\n border: 1px solid ", ";\n }\n\n &.", " {\n .", " {\n ", "\n }\n }\n\n &.danger {\n .", " {\n box-shadow: 0 0 0 1px\n ", ";\n }\n }\n }\n\n .", " {\n .", " > div {\n cursor: pointer;\n &::after {\n transition: box-shadow 0s;\n }\n }\n\n &.", "\n .", "\n > div::after {\n ", "\n }\n\n &.danger {\n .media-card-frame::after {\n box-shadow: 0 0 0 1px\n ", " !important;\n background: ", " !important;\n }\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n background: ", ";\n }\n }\n }\n\n .", " {\n padding: 0;\n }\n"])), SmartCardSharedCssClassName.INLINE_CARD_CONTAINER, "var(--ds-space-025, 2px)", "var(--ds-space-025, 2px)", SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), SmartCardSharedCssClassName.LOADER_WRAPPER, SmartCardSharedCssClassName.LOADER_WRAPPER, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? '' : "\n &:hover {\n background-color: ".concat("var(--ds-background-neutral-subtle-hovered, ".concat(N20, ")"), ";\n }\n "), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "border-radius: ".concat("var(--ds-border-radius-300, 12px)", ";") : '', SmartCardSharedCssClassName.LOADER_WRAPPER, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), SmartCardSharedCssClassName.DATASOURCE_CONTAINER, SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, DATASOURCE_INNER_CONTAINER_CLASSNAME, "var(--ds-background-neutral-subtle, ".concat(N0, ")"), "var(--ds-border-radius-100,
|
|
10
|
+
export var smartCardStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n max-width: calc(100% - 20px);\n vertical-align: top;\n word-break: break-all;\n\n .card {\n padding-left: ", ";\n padding-right: ", ";\n padding-top: 0.5em;\n padding-bottom: 0.5em;\n margin-bottom: -0.5em;\n\n .", " > a:focus {\n ", "\n }\n }\n\n &.", "\n .", "\n > a {\n ", "\n }\n .", " > a {\n /* EDM-1717: box-shadow Safari fix start */\n z-index: 1;\n position: relative;\n /* EDM-1717: box-shadow Safari fix end */\n }\n\n &.danger {\n .", " > a {\n box-shadow: 0 0 0 1px\n ", ";\n /* EDM-1717: box-shadow Safari fix start */\n z-index: 2;\n /* EDM-1717: box-shadow Safari fix end */\n }\n }\n }\n\n .", " {\n .", " > div {\n cursor: pointer;\n ", "\n }\n\n &.", "\n .", "\n > div {\n ", "\n ", "\n }\n\n &.danger {\n .", " > div {\n box-shadow: 0 0 0 1px\n ", " !important;\n }\n }\n }\n\n .", ".", " {\n max-width: 100%;\n display: flex;\n justify-content: center;\n\n .", " {\n cursor: pointer;\n background-color: ", ";\n border-radius: ", ";\n border: 1px solid ", ";\n }\n\n &.", " {\n .", " {\n ", "\n }\n }\n\n &.danger {\n .", " {\n box-shadow: 0 0 0 1px\n ", ";\n }\n }\n }\n\n .", " {\n .", " > div {\n cursor: pointer;\n &::after {\n transition: box-shadow 0s;\n }\n }\n\n &.", "\n .", "\n > div::after {\n ", "\n }\n\n &.danger {\n .media-card-frame::after {\n box-shadow: 0 0 0 1px\n ", " !important;\n background: ", " !important;\n }\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n background: ", ";\n }\n }\n }\n\n .", " {\n padding: 0;\n }\n"])), SmartCardSharedCssClassName.INLINE_CARD_CONTAINER, "var(--ds-space-025, 2px)", "var(--ds-space-025, 2px)", SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), SmartCardSharedCssClassName.LOADER_WRAPPER, SmartCardSharedCssClassName.LOADER_WRAPPER, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? '' : "\n &:hover {\n background-color: ".concat("var(--ds-background-neutral-subtle-hovered, ".concat(N20, ")"), ";\n }\n "), akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "border-radius: ".concat("var(--ds-border-radius-300, 12px)", ";") : '', SmartCardSharedCssClassName.LOADER_WRAPPER, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), SmartCardSharedCssClassName.DATASOURCE_CONTAINER, SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, DATASOURCE_INNER_CONTAINER_CLASSNAME, "var(--ds-background-neutral-subtle, ".concat(N0, ")"), "var(--ds-border-radius-100, 3px)", "var(--ds-border, ".concat(N40, ")"), akEditorSelectedNodeClassName, DATASOURCE_INNER_CONTAINER_CLASSNAME, getSelectionStyles([SelectionStyle.BoxShadow]), DATASOURCE_INNER_CONTAINER_CLASSNAME, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), SmartCardSharedCssClassName.EMBED_CARD_CONTAINER, SmartCardSharedCssClassName.LOADER_WRAPPER, akEditorSelectedNodeClassName, SmartCardSharedCssClassName.LOADER_WRAPPER, getSelectionStyles([SelectionStyle.BoxShadow]), "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), "var(--ds-background-danger, ".concat(akEditorDeleteBackground, ")"), "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), FLOATING_TOOLBAR_LINKPICKER_CLASSNAME);
|
|
@@ -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.
|
|
21
|
+
var packageVersion = "74.51.0";
|
|
22
22
|
var halfFocusRing = 1;
|
|
23
23
|
var dropOffset = '0, 8';
|
|
24
24
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -3,7 +3,7 @@ export { createFixedGuidelinesFromLengths, createGuidesFromLengths, } from './fi
|
|
|
3
3
|
export { generateDefaultGuidelines } from './defaultGuideline';
|
|
4
4
|
export { getGuidelinesWithHighlights } from './updateGuideline';
|
|
5
5
|
export { MEDIA_DYNAMIC_GUIDELINE_PREFIX, INNER_GRID_GUIDELINE_PREFIX, } from './constants';
|
|
6
|
-
export type { WidthTypes, Position, GuidelineStyles, GuidelineConfig, GuidelinePluginState, GuidelinePluginOptions, DisplayGuideline, DisplayGrid, VerticalPosition, HorizontalPosition, RelativeGuides, GuidelineSnap, GuidelineSnapsReference, GuidelineTypes, } from './types';
|
|
6
|
+
export type { WidthTypes, Position, GuidelineStyles, GuidelineConfig, GuidelineContainerRect, GuidelinePluginState, GuidelinePluginOptions, DisplayGuideline, DisplayGrid, VerticalPosition, HorizontalPosition, RelativeGuides, GuidelineSnap, GuidelineSnapsReference, GuidelineTypes, } from './types';
|
|
7
7
|
export { getGuidelineSnaps, findClosestSnap } from './snapping';
|
|
8
8
|
export { isVerticalPosition, getMediaSingleDimensions, getContainerWidthOrFullEditorWidth, getGuidelineTypeFromKey, } from './utils';
|
|
9
9
|
export { getRelativeGuideSnaps, getRelativeGuidelines, } from './relativeGuideline';
|
|
@@ -2,7 +2,7 @@ import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { GuidelineConfig, RelativeGuides } from './types';
|
|
4
4
|
export declare const getRelativeGuideSnaps: (relativeGuides: RelativeGuides, aspectRatio: number) => number[];
|
|
5
|
-
export declare const getRelativeGuidelines: (relativeGuides: RelativeGuides, nodeWithPos: NodeWithPos, view: EditorView, editorWidth: number, size: {
|
|
5
|
+
export declare const getRelativeGuidelines: (relativeGuides: RelativeGuides, nodeWithPos: NodeWithPos, view: EditorView, editorWidth: number, topOffset: number, size: {
|
|
6
6
|
width: number;
|
|
7
7
|
height: number;
|
|
8
8
|
}) => GuidelineConfig[];
|
|
@@ -33,12 +33,17 @@ export type GuidelineConfig = {
|
|
|
33
33
|
key: string;
|
|
34
34
|
position: Position;
|
|
35
35
|
} & GuidelineStyles;
|
|
36
|
+
export type GuidelineContainerRect = {
|
|
37
|
+
top: number;
|
|
38
|
+
left: number;
|
|
39
|
+
};
|
|
36
40
|
export type GuidelinePluginState = {
|
|
37
41
|
guidelines: GuidelineConfig[];
|
|
42
|
+
rect?: GuidelineContainerRect;
|
|
38
43
|
};
|
|
39
44
|
export interface GuidelinePluginOptions {
|
|
40
45
|
}
|
|
41
|
-
export type DisplayGrid = (props:
|
|
46
|
+
export type DisplayGrid = (props: GuidelinePluginState) => boolean;
|
|
42
47
|
export type DisplayGuideline = (view: EditorView) => DisplayGrid;
|
|
43
48
|
export type GuidelineSnap = {
|
|
44
49
|
guidelineKey: string;
|
|
@@ -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,6 @@
|
|
|
1
1
|
import type { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
2
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
4
|
/**
|
|
3
5
|
* Convert media node width to pixel
|
|
4
6
|
*
|
|
@@ -54,3 +56,16 @@ export declare function calculateOffsetLeft(insideInlineLike: boolean, insideLay
|
|
|
54
56
|
* @return {number} the rounded number
|
|
55
57
|
*/
|
|
56
58
|
export declare const roundToNearest: (value: number, interval?: number) => number;
|
|
59
|
+
/**
|
|
60
|
+
* Get parent width for a nested media single node
|
|
61
|
+
* @param view Editor view
|
|
62
|
+
* @param pos node position
|
|
63
|
+
*/
|
|
64
|
+
export declare const getMaxWidthForNestedNode: (view: EditorView, pos: number | undefined) => number | null;
|
|
65
|
+
/**
|
|
66
|
+
* Get parent width for a nested media single node for new experience
|
|
67
|
+
* @param view Editor view
|
|
68
|
+
* @param pos node position
|
|
69
|
+
*/
|
|
70
|
+
export declare const getMaxWidthForNestedNodeNext: (view: EditorView, pos: number | undefined) => number | null;
|
|
71
|
+
export declare const getParentWidthForNestedMediaSingleNode: (resolvedPos: ResolvedPos, view: EditorView) => number | null;
|
|
@@ -3,7 +3,7 @@ export { createFixedGuidelinesFromLengths, createGuidesFromLengths, } from './fi
|
|
|
3
3
|
export { generateDefaultGuidelines } from './defaultGuideline';
|
|
4
4
|
export { getGuidelinesWithHighlights } from './updateGuideline';
|
|
5
5
|
export { MEDIA_DYNAMIC_GUIDELINE_PREFIX, INNER_GRID_GUIDELINE_PREFIX, } from './constants';
|
|
6
|
-
export type { WidthTypes, Position, GuidelineStyles, GuidelineConfig, GuidelinePluginState, GuidelinePluginOptions, DisplayGuideline, DisplayGrid, VerticalPosition, HorizontalPosition, RelativeGuides, GuidelineSnap, GuidelineSnapsReference, GuidelineTypes, } from './types';
|
|
6
|
+
export type { WidthTypes, Position, GuidelineStyles, GuidelineConfig, GuidelineContainerRect, GuidelinePluginState, GuidelinePluginOptions, DisplayGuideline, DisplayGrid, VerticalPosition, HorizontalPosition, RelativeGuides, GuidelineSnap, GuidelineSnapsReference, GuidelineTypes, } from './types';
|
|
7
7
|
export { getGuidelineSnaps, findClosestSnap } from './snapping';
|
|
8
8
|
export { isVerticalPosition, getMediaSingleDimensions, getContainerWidthOrFullEditorWidth, getGuidelineTypeFromKey, } from './utils';
|
|
9
9
|
export { getRelativeGuideSnaps, getRelativeGuidelines, } from './relativeGuideline';
|
|
@@ -2,7 +2,7 @@ import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { GuidelineConfig, RelativeGuides } from './types';
|
|
4
4
|
export declare const getRelativeGuideSnaps: (relativeGuides: RelativeGuides, aspectRatio: number) => number[];
|
|
5
|
-
export declare const getRelativeGuidelines: (relativeGuides: RelativeGuides, nodeWithPos: NodeWithPos, view: EditorView, editorWidth: number, size: {
|
|
5
|
+
export declare const getRelativeGuidelines: (relativeGuides: RelativeGuides, nodeWithPos: NodeWithPos, view: EditorView, editorWidth: number, topOffset: number, size: {
|
|
6
6
|
width: number;
|
|
7
7
|
height: number;
|
|
8
8
|
}) => GuidelineConfig[];
|
|
@@ -33,12 +33,17 @@ export type GuidelineConfig = {
|
|
|
33
33
|
key: string;
|
|
34
34
|
position: Position;
|
|
35
35
|
} & GuidelineStyles;
|
|
36
|
+
export type GuidelineContainerRect = {
|
|
37
|
+
top: number;
|
|
38
|
+
left: number;
|
|
39
|
+
};
|
|
36
40
|
export type GuidelinePluginState = {
|
|
37
41
|
guidelines: GuidelineConfig[];
|
|
42
|
+
rect?: GuidelineContainerRect;
|
|
38
43
|
};
|
|
39
44
|
export interface GuidelinePluginOptions {
|
|
40
45
|
}
|
|
41
|
-
export type DisplayGrid = (props:
|
|
46
|
+
export type DisplayGrid = (props: GuidelinePluginState) => boolean;
|
|
42
47
|
export type DisplayGuideline = (view: EditorView) => DisplayGrid;
|
|
43
48
|
export type GuidelineSnap = {
|
|
44
49
|
guidelineKey: string;
|
|
@@ -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,6 @@
|
|
|
1
1
|
import type { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
2
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
4
|
/**
|
|
3
5
|
* Convert media node width to pixel
|
|
4
6
|
*
|
|
@@ -54,3 +56,16 @@ export declare function calculateOffsetLeft(insideInlineLike: boolean, insideLay
|
|
|
54
56
|
* @return {number} the rounded number
|
|
55
57
|
*/
|
|
56
58
|
export declare const roundToNearest: (value: number, interval?: number) => number;
|
|
59
|
+
/**
|
|
60
|
+
* Get parent width for a nested media single node
|
|
61
|
+
* @param view Editor view
|
|
62
|
+
* @param pos node position
|
|
63
|
+
*/
|
|
64
|
+
export declare const getMaxWidthForNestedNode: (view: EditorView, pos: number | undefined) => number | null;
|
|
65
|
+
/**
|
|
66
|
+
* Get parent width for a nested media single node for new experience
|
|
67
|
+
* @param view Editor view
|
|
68
|
+
* @param pos node position
|
|
69
|
+
*/
|
|
70
|
+
export declare const getMaxWidthForNestedNodeNext: (view: EditorView, pos: number | undefined) => number | null;
|
|
71
|
+
export declare const getParentWidthForNestedMediaSingleNode: (resolvedPos: ResolvedPos, view: EditorView) => number | null;
|
package/package.json
CHANGED