@atlaskit/editor-common 74.50.4 → 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 +10 -0
- package/dist/cjs/guideline/relativeGuideline.js +7 -9
- package/dist/cjs/monitoring/error.js +1 -1
- 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/monitoring/error.js +1 -1
- 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/monitoring/error.js +1 -1
- 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-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/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 74.51.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`7f45581d141`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7f45581d141) - ED-19630 fixed guideline alignment issue.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [`f76bc3a94fa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f76bc3a94fa) - [ux] Datasource container border radius increased
|
|
12
|
+
|
|
3
13
|
## 74.50.4
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -9,11 +9,10 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
9
9
|
var _mediaSingle = require("../media-single");
|
|
10
10
|
var _utils = require("./utils");
|
|
11
11
|
var RELATIVE_GUIDES_GAP = 6;
|
|
12
|
-
var getWidthRelativeGuideline = function getWidthRelativeGuideline(key, view, nodeWithPos, editorWidth, size) {
|
|
12
|
+
var getWidthRelativeGuideline = function getWidthRelativeGuideline(key, view, nodeWithPos, editorWidth, topOffset, size) {
|
|
13
13
|
var node = nodeWithPos.node,
|
|
14
14
|
pos = nodeWithPos.pos;
|
|
15
15
|
var _view$dom$getBounding = view.dom.getBoundingClientRect(),
|
|
16
|
-
topOffSet = _view$dom$getBounding.top,
|
|
17
16
|
viewHeight = _view$dom$getBounding.height;
|
|
18
17
|
var _view$coordsAtPos = view.coordsAtPos(pos + 1),
|
|
19
18
|
top = _view$coordsAtPos.top; // media node
|
|
@@ -21,7 +20,7 @@ var getWidthRelativeGuideline = function getWidthRelativeGuideline(key, view, no
|
|
|
21
20
|
var _ref = size || (0, _utils.getMediaSingleDimensions)(node, editorWidth) || {},
|
|
22
21
|
width = _ref.width,
|
|
23
22
|
height = _ref.height;
|
|
24
|
-
var y = top -
|
|
23
|
+
var y = top - topOffset - RELATIVE_GUIDES_GAP;
|
|
25
24
|
if (!width || !height || y < 0 || y > viewHeight) {
|
|
26
25
|
return null;
|
|
27
26
|
}
|
|
@@ -62,11 +61,10 @@ var getWidthRelativeGuideline = function getWidthRelativeGuideline(key, view, no
|
|
|
62
61
|
}
|
|
63
62
|
};
|
|
64
63
|
};
|
|
65
|
-
var getHeightRelativeGuideline = function getHeightRelativeGuideline(key, view, nodeWithPos, editorWidth, size) {
|
|
64
|
+
var getHeightRelativeGuideline = function getHeightRelativeGuideline(key, view, nodeWithPos, editorWidth, topOffset, size) {
|
|
66
65
|
var node = nodeWithPos.node,
|
|
67
66
|
pos = nodeWithPos.pos;
|
|
68
67
|
var _view$dom$getBounding2 = view.dom.getBoundingClientRect(),
|
|
69
|
-
topOffSet = _view$dom$getBounding2.top,
|
|
70
68
|
viewHeight = _view$dom$getBounding2.height;
|
|
71
69
|
var _view$coordsAtPos2 = view.coordsAtPos(pos + 1),
|
|
72
70
|
top = _view$coordsAtPos2.top; // media node
|
|
@@ -77,7 +75,7 @@ var getHeightRelativeGuideline = function getHeightRelativeGuideline(key, view,
|
|
|
77
75
|
if (!width || !height) {
|
|
78
76
|
return null;
|
|
79
77
|
}
|
|
80
|
-
var start = top -
|
|
78
|
+
var start = top - topOffset;
|
|
81
79
|
var end = start + height;
|
|
82
80
|
if (end < 0 || start > viewHeight) {
|
|
83
81
|
return null;
|
|
@@ -128,14 +126,14 @@ var getRelativeGuideSnaps = function getRelativeGuideSnaps(relativeGuides, aspec
|
|
|
128
126
|
return [].concat((0, _toConsumableArray2.default)(snapsWidthFromMatchingWidth), (0, _toConsumableArray2.default)(snapsWidthFromMatchingHeight));
|
|
129
127
|
};
|
|
130
128
|
exports.getRelativeGuideSnaps = getRelativeGuideSnaps;
|
|
131
|
-
var getRelativeGuidelines = function getRelativeGuidelines(relativeGuides, nodeWithPos, view, editorWidth, size) {
|
|
129
|
+
var getRelativeGuidelines = function getRelativeGuidelines(relativeGuides, nodeWithPos, view, editorWidth, topOffset, size) {
|
|
132
130
|
var matchWidth = relativeGuides.width ? relativeGuides.width[Math.round(size.width)] : [];
|
|
133
131
|
var matchHeight = relativeGuides.height ? relativeGuides.height[Math.round(size.height)] : [];
|
|
134
132
|
var matches = matchWidth || matchHeight;
|
|
135
133
|
var getRelativeGuideline = matchWidth && getWidthRelativeGuideline || matchHeight && getHeightRelativeGuideline || null;
|
|
136
134
|
if (matches && getRelativeGuideline) {
|
|
137
|
-
return [getRelativeGuideline('relative_guide_current', view, nodeWithPos, editorWidth, size)].concat((0, _toConsumableArray2.default)(matches.map(function (nodeWithPos, index) {
|
|
138
|
-
return getRelativeGuideline("relative_guide_".concat(index), view, nodeWithPos, editorWidth);
|
|
135
|
+
return [getRelativeGuideline('relative_guide_current', view, nodeWithPos, editorWidth, topOffset, size)].concat((0, _toConsumableArray2.default)(matches.map(function (nodeWithPos, index) {
|
|
136
|
+
return getRelativeGuideline("relative_guide_".concat(index), view, nodeWithPos, editorWidth, topOffset);
|
|
139
137
|
}))).filter(function (config) {
|
|
140
138
|
return !!config;
|
|
141
139
|
});
|
|
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
18
18
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
19
|
-
var packageVersion = "74.
|
|
19
|
+
var packageVersion = "74.51.0";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -16,5 +16,5 @@ var DATASOURCE_INNER_CONTAINER_CLASSNAME = 'datasourceView-content-inner-wrap';
|
|
|
16
16
|
exports.DATASOURCE_INNER_CONTAINER_CLASSNAME = DATASOURCE_INNER_CONTAINER_CLASSNAME;
|
|
17
17
|
var FLOATING_TOOLBAR_LINKPICKER_CLASSNAME = 'card-floating-toolbar--link-picker';
|
|
18
18
|
exports.FLOATING_TOOLBAR_LINKPICKER_CLASSNAME = FLOATING_TOOLBAR_LINKPICKER_CLASSNAME;
|
|
19
|
-
var smartCardStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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"])), _smartCard.SmartCardSharedCssClassName.INLINE_CARD_CONTAINER, "var(--ds-space-025, 2px)", "var(--ds-space-025, 2px)", _smartCard.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _editorSharedStyles.akEditorSelectedNodeClassName, _smartCard.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _smartCard.SmartCardSharedCssClassName.LOADER_WRAPPER, _smartCard.SmartCardSharedCssClassName.LOADER_WRAPPER, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), _smartCard.SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, _smartCard.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? '' : "\n &:hover {\n background-color: ".concat("var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N20, ")"), ";\n }\n "), _editorSharedStyles.akEditorSelectedNodeClassName, _smartCard.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "border-radius: ".concat("var(--ds-border-radius-300, 12px)", ";") : '', _smartCard.SmartCardSharedCssClassName.LOADER_WRAPPER, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), _smartCard.SmartCardSharedCssClassName.DATASOURCE_CONTAINER, _smartCard.SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, DATASOURCE_INNER_CONTAINER_CLASSNAME, "var(--ds-background-neutral-subtle, ".concat(_colors.N0, ")"), "var(--ds-border-radius-100,
|
|
19
|
+
var smartCardStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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"])), _smartCard.SmartCardSharedCssClassName.INLINE_CARD_CONTAINER, "var(--ds-space-025, 2px)", "var(--ds-space-025, 2px)", _smartCard.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _editorSharedStyles.akEditorSelectedNodeClassName, _smartCard.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _smartCard.SmartCardSharedCssClassName.LOADER_WRAPPER, _smartCard.SmartCardSharedCssClassName.LOADER_WRAPPER, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), _smartCard.SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, _smartCard.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? '' : "\n &:hover {\n background-color: ".concat("var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N20, ")"), ";\n }\n "), _editorSharedStyles.akEditorSelectedNodeClassName, _smartCard.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "border-radius: ".concat("var(--ds-border-radius-300, 12px)", ";") : '', _smartCard.SmartCardSharedCssClassName.LOADER_WRAPPER, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), _smartCard.SmartCardSharedCssClassName.DATASOURCE_CONTAINER, _smartCard.SmartCardSharedCssClassName.BLOCK_CARD_CONTAINER, DATASOURCE_INNER_CONTAINER_CLASSNAME, "var(--ds-background-neutral-subtle, ".concat(_colors.N0, ")"), "var(--ds-border-radius-100, 3px)", "var(--ds-border, ".concat(_colors.N40, ")"), _editorSharedStyles.akEditorSelectedNodeClassName, DATASOURCE_INNER_CONTAINER_CLASSNAME, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), DATASOURCE_INNER_CONTAINER_CLASSNAME, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), _smartCard.SmartCardSharedCssClassName.EMBED_CARD_CONTAINER, _smartCard.SmartCardSharedCssClassName.LOADER_WRAPPER, _editorSharedStyles.akEditorSelectedNodeClassName, _smartCard.SmartCardSharedCssClassName.LOADER_WRAPPER, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), FLOATING_TOOLBAR_LINKPICKER_CLASSNAME);
|
|
20
20
|
exports.smartCardStyles = smartCardStyles;
|
|
@@ -24,7 +24,7 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
24
24
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
25
25
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "74.
|
|
27
|
+
var packageVersion = "74.51.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -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,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,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
|
});
|
|
@@ -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,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;
|
|
@@ -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;
|
package/package.json
CHANGED