@atlaskit/editor-common 74.50.4 → 74.51.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -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/cjs/utils/count-nodes.js +37 -0
- package/dist/cjs/utils/document.js +6 -1
- package/dist/cjs/utils/index.js +20 -0
- package/dist/cjs/utils/performance/get-performance-timing.js +17 -0
- 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/es2019/utils/count-nodes.js +31 -0
- package/dist/es2019/utils/document.js +2 -1
- package/dist/es2019/utils/index.js +3 -1
- package/dist/es2019/utils/performance/get-performance-timing.js +8 -0
- 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/esm/utils/count-nodes.js +31 -0
- package/dist/esm/utils/document.js +4 -1
- package/dist/esm/utils/index.js +3 -1
- package/dist/esm/utils/performance/get-performance-timing.js +10 -0
- 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/utils/count-nodes.d.ts +8 -0
- package/dist/types/utils/document.d.ts +4 -2
- package/dist/types/utils/index.d.ts +3 -1
- package/dist/types/utils/performance/get-performance-timing.d.ts +8 -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/utils/count-nodes.d.ts +8 -0
- package/dist/types-ts4.5/utils/document.d.ts +4 -2
- package/dist/types-ts4.5/utils/index.d.ts +3 -1
- package/dist/types-ts4.5/utils/performance/get-performance-timing.d.ts +8 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 74.51.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f68eb1b1731`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f68eb1b1731) - Move common functions from `editor-core` to `editor-common` in preparation for `base` plugin extraction
|
|
8
|
+
|
|
9
|
+
## 74.51.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`7f45581d141`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7f45581d141) - ED-19630 fixed guideline alignment issue.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`f76bc3a94fa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f76bc3a94fa) - [ux] Datasource container border radius increased
|
|
18
|
+
|
|
3
19
|
## 74.50.4
|
|
4
20
|
|
|
5
21
|
### 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.1";
|
|
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.1";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.countNodes = countNodes;
|
|
7
|
+
function countNodes(state) {
|
|
8
|
+
var _nodeTypes$extension, _nodeTypes$inlineExte, _nodeTypes$bodiedExte;
|
|
9
|
+
var nodeCount = {};
|
|
10
|
+
var extensionNodeCount = {};
|
|
11
|
+
var nodeTypes = state.schema.nodes;
|
|
12
|
+
var extensionNodeTypes = [(_nodeTypes$extension = nodeTypes.extension) === null || _nodeTypes$extension === void 0 ? void 0 : _nodeTypes$extension.name, (_nodeTypes$inlineExte = nodeTypes.inlineExtension) === null || _nodeTypes$inlineExte === void 0 ? void 0 : _nodeTypes$inlineExte.name, (_nodeTypes$bodiedExte = nodeTypes.bodiedExtension) === null || _nodeTypes$bodiedExte === void 0 ? void 0 : _nodeTypes$bodiedExte.name];
|
|
13
|
+
state.doc.descendants(function (node) {
|
|
14
|
+
var _node$attrs;
|
|
15
|
+
var nodeName = node.type.name;
|
|
16
|
+
if (nodeName in nodeCount) {
|
|
17
|
+
nodeCount[nodeName]++;
|
|
18
|
+
} else {
|
|
19
|
+
nodeCount[nodeName] = 1;
|
|
20
|
+
}
|
|
21
|
+
var extensionNodeName = nodeName;
|
|
22
|
+
if (extensionNodeTypes.includes(extensionNodeName) && (_node$attrs = node.attrs) !== null && _node$attrs !== void 0 && _node$attrs.extensionType) {
|
|
23
|
+
var _node$attrs2;
|
|
24
|
+
extensionNodeName = "".concat(node.attrs.extensionType, " - ").concat((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.extensionKey);
|
|
25
|
+
if (extensionNodeName in extensionNodeCount) {
|
|
26
|
+
extensionNodeCount[extensionNodeName]++;
|
|
27
|
+
} else {
|
|
28
|
+
extensionNodeCount[extensionNodeName] = 1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return true;
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
nodeCount: nodeCount,
|
|
35
|
+
extensionNodeCount: extensionNodeCount
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -8,6 +8,7 @@ exports.getStepRange = void 0;
|
|
|
8
8
|
exports.hasDocAsParent = hasDocAsParent;
|
|
9
9
|
exports.hasVisibleContent = hasVisibleContent;
|
|
10
10
|
exports.isEmptyDocument = isEmptyDocument;
|
|
11
|
+
exports.isSelectionEndOfParagraph = void 0;
|
|
11
12
|
exports.nodesBetweenChanged = nodesBetweenChanged;
|
|
12
13
|
exports.processRawValue = processRawValue;
|
|
13
14
|
var _transforms = require("@atlaskit/adf-utils/transforms");
|
|
@@ -280,4 +281,8 @@ function hasVisibleContent(node) {
|
|
|
280
281
|
}
|
|
281
282
|
}
|
|
282
283
|
return false;
|
|
283
|
-
}
|
|
284
|
+
}
|
|
285
|
+
var isSelectionEndOfParagraph = function isSelectionEndOfParagraph(state) {
|
|
286
|
+
return state.selection.$to.parent.type === state.schema.nodes.paragraph && state.selection.$to.pos === state.doc.resolve(state.selection.$to.pos).end();
|
|
287
|
+
};
|
|
288
|
+
exports.isSelectionEndOfParagraph = isSelectionEndOfParagraph;
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -239,6 +239,12 @@ Object.defineProperty(exports, "convertProsemirrorTableNodeToArrayOfRows", {
|
|
|
239
239
|
return _table.convertProsemirrorTableNodeToArrayOfRows;
|
|
240
240
|
}
|
|
241
241
|
});
|
|
242
|
+
Object.defineProperty(exports, "countNodes", {
|
|
243
|
+
enumerable: true,
|
|
244
|
+
get: function get() {
|
|
245
|
+
return _countNodes.countNodes;
|
|
246
|
+
}
|
|
247
|
+
});
|
|
242
248
|
Object.defineProperty(exports, "createCompareNodes", {
|
|
243
249
|
enumerable: true,
|
|
244
250
|
get: function get() {
|
|
@@ -462,6 +468,12 @@ Object.defineProperty(exports, "getTTISeverity", {
|
|
|
462
468
|
return _measureTti.getTTISeverity;
|
|
463
469
|
}
|
|
464
470
|
});
|
|
471
|
+
Object.defineProperty(exports, "getTimeSince", {
|
|
472
|
+
enumerable: true,
|
|
473
|
+
get: function get() {
|
|
474
|
+
return _getPerformanceTiming.getTimeSince;
|
|
475
|
+
}
|
|
476
|
+
});
|
|
465
477
|
Object.defineProperty(exports, "getTitle", {
|
|
466
478
|
enumerable: true,
|
|
467
479
|
get: function get() {
|
|
@@ -664,6 +676,12 @@ Object.defineProperty(exports, "isRichMediaInsideOfBlockNode", {
|
|
|
664
676
|
return _richMediaUtils.isRichMediaInsideOfBlockNode;
|
|
665
677
|
}
|
|
666
678
|
});
|
|
679
|
+
Object.defineProperty(exports, "isSelectionEndOfParagraph", {
|
|
680
|
+
enumerable: true,
|
|
681
|
+
get: function get() {
|
|
682
|
+
return _document.isSelectionEndOfParagraph;
|
|
683
|
+
}
|
|
684
|
+
});
|
|
667
685
|
exports.isSelectionInsideLastNodeInDocument = isSelectionInsideLastNodeInDocument;
|
|
668
686
|
Object.defineProperty(exports, "isSupportedInParent", {
|
|
669
687
|
enumerable: true,
|
|
@@ -1020,6 +1038,8 @@ var _privacyFilter = require("./filter/privacy-filter");
|
|
|
1020
1038
|
var _datasource = require("./datasource");
|
|
1021
1039
|
var _commands = require("./commands");
|
|
1022
1040
|
var _scrollGutter = require("./scroll-gutter");
|
|
1041
|
+
var _getPerformanceTiming = require("./performance/get-performance-timing");
|
|
1042
|
+
var _countNodes = require("./count-nodes");
|
|
1023
1043
|
var _inputRules = require("./input-rules");
|
|
1024
1044
|
// prosemirror-history does not export its plugin key
|
|
1025
1045
|
var pmHistoryPluginKey = 'history$';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getTimeSince = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Calculate the difference between performance.now() and the given startTime.
|
|
9
|
+
* This allows for the timing to be overridable during tests.
|
|
10
|
+
*
|
|
11
|
+
* @param startTime DOMHighResTimeStamp
|
|
12
|
+
* @returns DOMHighResTimeStamp
|
|
13
|
+
*/
|
|
14
|
+
var getTimeSince = function getTimeSince(startTime) {
|
|
15
|
+
return performance.now() - startTime;
|
|
16
|
+
};
|
|
17
|
+
exports.getTimeSince = getTimeSince;
|
|
@@ -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.1";
|
|
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.1";
|
|
12
12
|
const halfFocusRing = 1;
|
|
13
13
|
const dropOffset = '0, 8';
|
|
14
14
|
class DropList extends Component {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function countNodes(state) {
|
|
2
|
+
var _nodeTypes$extension, _nodeTypes$inlineExte, _nodeTypes$bodiedExte;
|
|
3
|
+
const nodeCount = {};
|
|
4
|
+
const extensionNodeCount = {};
|
|
5
|
+
const nodeTypes = state.schema.nodes;
|
|
6
|
+
const extensionNodeTypes = [(_nodeTypes$extension = nodeTypes.extension) === null || _nodeTypes$extension === void 0 ? void 0 : _nodeTypes$extension.name, (_nodeTypes$inlineExte = nodeTypes.inlineExtension) === null || _nodeTypes$inlineExte === void 0 ? void 0 : _nodeTypes$inlineExte.name, (_nodeTypes$bodiedExte = nodeTypes.bodiedExtension) === null || _nodeTypes$bodiedExte === void 0 ? void 0 : _nodeTypes$bodiedExte.name];
|
|
7
|
+
state.doc.descendants(node => {
|
|
8
|
+
var _node$attrs;
|
|
9
|
+
const nodeName = node.type.name;
|
|
10
|
+
if (nodeName in nodeCount) {
|
|
11
|
+
nodeCount[nodeName]++;
|
|
12
|
+
} else {
|
|
13
|
+
nodeCount[nodeName] = 1;
|
|
14
|
+
}
|
|
15
|
+
let extensionNodeName = nodeName;
|
|
16
|
+
if (extensionNodeTypes.includes(extensionNodeName) && (_node$attrs = node.attrs) !== null && _node$attrs !== void 0 && _node$attrs.extensionType) {
|
|
17
|
+
var _node$attrs2;
|
|
18
|
+
extensionNodeName = `${node.attrs.extensionType} - ${(_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.extensionKey}`;
|
|
19
|
+
if (extensionNodeName in extensionNodeCount) {
|
|
20
|
+
extensionNodeCount[extensionNodeName]++;
|
|
21
|
+
} else {
|
|
22
|
+
extensionNodeCount[extensionNodeName] = 1;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
});
|
|
27
|
+
return {
|
|
28
|
+
nodeCount,
|
|
29
|
+
extensionNodeCount
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -274,4 +274,5 @@ export function hasVisibleContent(node) {
|
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
return false;
|
|
277
|
-
}
|
|
277
|
+
}
|
|
278
|
+
export const isSelectionEndOfParagraph = state => state.selection.$to.parent.type === state.schema.nodes.paragraph && state.selection.$to.pos === state.doc.resolve(state.selection.$to.pos).end();
|
|
@@ -43,12 +43,14 @@ export { isFromCurrentDomain, LinkMatcher, normalizeUrl, linkifyContent, getLink
|
|
|
43
43
|
// prosemirror-history does not export its plugin key
|
|
44
44
|
export const pmHistoryPluginKey = 'history$';
|
|
45
45
|
export { gridTypeForLayout } from './grid';
|
|
46
|
-
export { nodesBetweenChanged, getStepRange, isEmptyDocument, processRawValue, hasDocAsParent, bracketTyped, hasVisibleContent } from './document';
|
|
46
|
+
export { nodesBetweenChanged, getStepRange, isEmptyDocument, processRawValue, hasDocAsParent, bracketTyped, hasVisibleContent, isSelectionEndOfParagraph } from './document';
|
|
47
47
|
export { floatingLayouts, isRichMediaInsideOfBlockNode, calculateSnapPoints, alignAttributes, nonWrappedLayouts } from './rich-media-utils';
|
|
48
48
|
export { sanitizeNodeForPrivacy } from './filter/privacy-filter';
|
|
49
49
|
export { canRenderDatasource } from './datasource';
|
|
50
50
|
export { filterCommand, isEmptySelectionAtStart, isEmptySelectionAtEnd, insertContentDeleteRange, deleteEmptyParagraphAndMoveBlockUp, insertNewLineWithAnalytics, createNewParagraphAbove, createNewParagraphBelow, createParagraphNear, walkNextNode, walkPrevNode } from './commands';
|
|
51
51
|
export { GUTTER_SELECTOR, GUTTER_SIZE_IN_PX, GUTTER_SIZE_MOBILE_IN_PX } from './scroll-gutter';
|
|
52
|
+
export { getTimeSince } from './performance/get-performance-timing';
|
|
53
|
+
export { countNodes } from './count-nodes';
|
|
52
54
|
export function shallowEqual(obj1 = {}, obj2 = {}) {
|
|
53
55
|
const keys1 = Object.keys(obj1);
|
|
54
56
|
const keys2 = Object.keys(obj2);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculate the difference between performance.now() and the given startTime.
|
|
3
|
+
* This allows for the timing to be overridable during tests.
|
|
4
|
+
*
|
|
5
|
+
* @param startTime DOMHighResTimeStamp
|
|
6
|
+
* @returns DOMHighResTimeStamp
|
|
7
|
+
*/
|
|
8
|
+
export const getTimeSince = startTime => performance.now() - startTime;
|
|
@@ -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.1";
|
|
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.1";
|
|
22
22
|
var halfFocusRing = 1;
|
|
23
23
|
var dropOffset = '0, 8';
|
|
24
24
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function countNodes(state) {
|
|
2
|
+
var _nodeTypes$extension, _nodeTypes$inlineExte, _nodeTypes$bodiedExte;
|
|
3
|
+
var nodeCount = {};
|
|
4
|
+
var extensionNodeCount = {};
|
|
5
|
+
var nodeTypes = state.schema.nodes;
|
|
6
|
+
var extensionNodeTypes = [(_nodeTypes$extension = nodeTypes.extension) === null || _nodeTypes$extension === void 0 ? void 0 : _nodeTypes$extension.name, (_nodeTypes$inlineExte = nodeTypes.inlineExtension) === null || _nodeTypes$inlineExte === void 0 ? void 0 : _nodeTypes$inlineExte.name, (_nodeTypes$bodiedExte = nodeTypes.bodiedExtension) === null || _nodeTypes$bodiedExte === void 0 ? void 0 : _nodeTypes$bodiedExte.name];
|
|
7
|
+
state.doc.descendants(function (node) {
|
|
8
|
+
var _node$attrs;
|
|
9
|
+
var nodeName = node.type.name;
|
|
10
|
+
if (nodeName in nodeCount) {
|
|
11
|
+
nodeCount[nodeName]++;
|
|
12
|
+
} else {
|
|
13
|
+
nodeCount[nodeName] = 1;
|
|
14
|
+
}
|
|
15
|
+
var extensionNodeName = nodeName;
|
|
16
|
+
if (extensionNodeTypes.includes(extensionNodeName) && (_node$attrs = node.attrs) !== null && _node$attrs !== void 0 && _node$attrs.extensionType) {
|
|
17
|
+
var _node$attrs2;
|
|
18
|
+
extensionNodeName = "".concat(node.attrs.extensionType, " - ").concat((_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.extensionKey);
|
|
19
|
+
if (extensionNodeName in extensionNodeCount) {
|
|
20
|
+
extensionNodeCount[extensionNodeName]++;
|
|
21
|
+
} else {
|
|
22
|
+
extensionNodeCount[extensionNodeName] = 1;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
});
|
|
27
|
+
return {
|
|
28
|
+
nodeCount: nodeCount,
|
|
29
|
+
extensionNodeCount: extensionNodeCount
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -267,4 +267,7 @@ export function hasVisibleContent(node) {
|
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
return false;
|
|
270
|
-
}
|
|
270
|
+
}
|
|
271
|
+
export var isSelectionEndOfParagraph = function isSelectionEndOfParagraph(state) {
|
|
272
|
+
return state.selection.$to.parent.type === state.schema.nodes.paragraph && state.selection.$to.pos === state.doc.resolve(state.selection.$to.pos).end();
|
|
273
|
+
};
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -43,12 +43,14 @@ export { isFromCurrentDomain, LinkMatcher, normalizeUrl, linkifyContent, getLink
|
|
|
43
43
|
// prosemirror-history does not export its plugin key
|
|
44
44
|
export var pmHistoryPluginKey = 'history$';
|
|
45
45
|
export { gridTypeForLayout } from './grid';
|
|
46
|
-
export { nodesBetweenChanged, getStepRange, isEmptyDocument, processRawValue, hasDocAsParent, bracketTyped, hasVisibleContent } from './document';
|
|
46
|
+
export { nodesBetweenChanged, getStepRange, isEmptyDocument, processRawValue, hasDocAsParent, bracketTyped, hasVisibleContent, isSelectionEndOfParagraph } from './document';
|
|
47
47
|
export { floatingLayouts, isRichMediaInsideOfBlockNode, calculateSnapPoints, alignAttributes, nonWrappedLayouts } from './rich-media-utils';
|
|
48
48
|
export { sanitizeNodeForPrivacy } from './filter/privacy-filter';
|
|
49
49
|
export { canRenderDatasource } from './datasource';
|
|
50
50
|
export { filterCommand, isEmptySelectionAtStart, isEmptySelectionAtEnd, insertContentDeleteRange, deleteEmptyParagraphAndMoveBlockUp, insertNewLineWithAnalytics, createNewParagraphAbove, createNewParagraphBelow, createParagraphNear, walkNextNode, walkPrevNode } from './commands';
|
|
51
51
|
export { GUTTER_SELECTOR, GUTTER_SIZE_IN_PX, GUTTER_SIZE_MOBILE_IN_PX } from './scroll-gutter';
|
|
52
|
+
export { getTimeSince } from './performance/get-performance-timing';
|
|
53
|
+
export { countNodes } from './count-nodes';
|
|
52
54
|
export function shallowEqual() {
|
|
53
55
|
var obj1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
54
56
|
var obj2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculate the difference between performance.now() and the given startTime.
|
|
3
|
+
* This allows for the timing to be overridable during tests.
|
|
4
|
+
*
|
|
5
|
+
* @param startTime DOMHighResTimeStamp
|
|
6
|
+
* @returns DOMHighResTimeStamp
|
|
7
|
+
*/
|
|
8
|
+
export var getTimeSince = function getTimeSince(startTime) {
|
|
9
|
+
return performance.now() - startTime;
|
|
10
|
+
};
|
|
@@ -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;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
type NodeCount = Record<string, number>;
|
|
3
|
+
type NodesCount = {
|
|
4
|
+
nodeCount: NodeCount;
|
|
5
|
+
extensionNodeCount: NodeCount;
|
|
6
|
+
};
|
|
7
|
+
export declare function countNodes(state: EditorState): NodesCount;
|
|
8
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ResolvedPos, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
3
|
import type { EditorState, ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { DispatchAnalyticsEvent } from '../analytics';
|
|
4
|
+
import type { DispatchAnalyticsEvent } from '../analytics';
|
|
4
5
|
import type { ProviderFactory } from '../provider-factory';
|
|
5
6
|
import type { ReplaceRawValue, Transformer } from '../types';
|
|
6
7
|
type ChangedFn = (node: Node, pos: number, parent: Node | null, index: number) => boolean | void;
|
|
@@ -20,4 +21,5 @@ export declare function processRawValue(schema: Schema, value?: ReplaceRawValue,
|
|
|
20
21
|
* Returns false if node contains only empty inline nodes and hardBreaks.
|
|
21
22
|
*/
|
|
22
23
|
export declare function hasVisibleContent(node: Node): boolean;
|
|
24
|
+
export declare const isSelectionEndOfParagraph: (state: EditorState) => boolean;
|
|
23
25
|
export {};
|
|
@@ -54,13 +54,15 @@ export { getItemCounterDigitsSize, getOrderFromOrderedListNode, resolveOrder, is
|
|
|
54
54
|
export { isFromCurrentDomain, LinkMatcher, normalizeUrl, linkifyContent, getLinkDomain, findFilepaths, isLinkInMatches, FILEPATH_REGEXP, DONTLINKIFY_REGEXP, getLinkCreationAnalyticsEvent, canLinkBeCreatedInRange, } from './hyperlink';
|
|
55
55
|
export declare const pmHistoryPluginKey = "history$";
|
|
56
56
|
export { gridTypeForLayout } from './grid';
|
|
57
|
-
export { nodesBetweenChanged, getStepRange, isEmptyDocument, processRawValue, hasDocAsParent, bracketTyped, hasVisibleContent, } from './document';
|
|
57
|
+
export { nodesBetweenChanged, getStepRange, isEmptyDocument, processRawValue, hasDocAsParent, bracketTyped, hasVisibleContent, isSelectionEndOfParagraph, } from './document';
|
|
58
58
|
export { floatingLayouts, isRichMediaInsideOfBlockNode, calculateSnapPoints, alignAttributes, nonWrappedLayouts, } from './rich-media-utils';
|
|
59
59
|
export { sanitizeNodeForPrivacy } from './filter/privacy-filter';
|
|
60
60
|
export { canRenderDatasource } from './datasource';
|
|
61
61
|
export { filterCommand, isEmptySelectionAtStart, isEmptySelectionAtEnd, insertContentDeleteRange, deleteEmptyParagraphAndMoveBlockUp, insertNewLineWithAnalytics, createNewParagraphAbove, createNewParagraphBelow, createParagraphNear, walkNextNode, walkPrevNode, } from './commands';
|
|
62
62
|
export type { WalkNode } from './commands';
|
|
63
63
|
export { GUTTER_SELECTOR, GUTTER_SIZE_IN_PX, GUTTER_SIZE_MOBILE_IN_PX, } from './scroll-gutter';
|
|
64
|
+
export { getTimeSince } from './performance/get-performance-timing';
|
|
65
|
+
export { countNodes } from './count-nodes';
|
|
64
66
|
export declare function shallowEqual(obj1?: any, obj2?: any): boolean;
|
|
65
67
|
export { inputRuleWithAnalytics, createWrappingJoinRule, createRule, } from './input-rules';
|
|
66
68
|
export declare function isSelectionInsideLastNodeInDocument(selection: Selection): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculate the difference between performance.now() and the given startTime.
|
|
3
|
+
* This allows for the timing to be overridable during tests.
|
|
4
|
+
*
|
|
5
|
+
* @param startTime DOMHighResTimeStamp
|
|
6
|
+
* @returns DOMHighResTimeStamp
|
|
7
|
+
*/
|
|
8
|
+
export declare const getTimeSince: (startTime: DOMHighResTimeStamp) => DOMHighResTimeStamp;
|
|
@@ -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;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
type NodeCount = Record<string, number>;
|
|
3
|
+
type NodesCount = {
|
|
4
|
+
nodeCount: NodeCount;
|
|
5
|
+
extensionNodeCount: NodeCount;
|
|
6
|
+
};
|
|
7
|
+
export declare function countNodes(state: EditorState): NodesCount;
|
|
8
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ResolvedPos, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
3
|
import type { EditorState, ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { DispatchAnalyticsEvent } from '../analytics';
|
|
4
|
+
import type { DispatchAnalyticsEvent } from '../analytics';
|
|
4
5
|
import type { ProviderFactory } from '../provider-factory';
|
|
5
6
|
import type { ReplaceRawValue, Transformer } from '../types';
|
|
6
7
|
type ChangedFn = (node: Node, pos: number, parent: Node | null, index: number) => boolean | void;
|
|
@@ -20,4 +21,5 @@ export declare function processRawValue(schema: Schema, value?: ReplaceRawValue,
|
|
|
20
21
|
* Returns false if node contains only empty inline nodes and hardBreaks.
|
|
21
22
|
*/
|
|
22
23
|
export declare function hasVisibleContent(node: Node): boolean;
|
|
24
|
+
export declare const isSelectionEndOfParagraph: (state: EditorState) => boolean;
|
|
23
25
|
export {};
|
|
@@ -54,13 +54,15 @@ export { getItemCounterDigitsSize, getOrderFromOrderedListNode, resolveOrder, is
|
|
|
54
54
|
export { isFromCurrentDomain, LinkMatcher, normalizeUrl, linkifyContent, getLinkDomain, findFilepaths, isLinkInMatches, FILEPATH_REGEXP, DONTLINKIFY_REGEXP, getLinkCreationAnalyticsEvent, canLinkBeCreatedInRange, } from './hyperlink';
|
|
55
55
|
export declare const pmHistoryPluginKey = "history$";
|
|
56
56
|
export { gridTypeForLayout } from './grid';
|
|
57
|
-
export { nodesBetweenChanged, getStepRange, isEmptyDocument, processRawValue, hasDocAsParent, bracketTyped, hasVisibleContent, } from './document';
|
|
57
|
+
export { nodesBetweenChanged, getStepRange, isEmptyDocument, processRawValue, hasDocAsParent, bracketTyped, hasVisibleContent, isSelectionEndOfParagraph, } from './document';
|
|
58
58
|
export { floatingLayouts, isRichMediaInsideOfBlockNode, calculateSnapPoints, alignAttributes, nonWrappedLayouts, } from './rich-media-utils';
|
|
59
59
|
export { sanitizeNodeForPrivacy } from './filter/privacy-filter';
|
|
60
60
|
export { canRenderDatasource } from './datasource';
|
|
61
61
|
export { filterCommand, isEmptySelectionAtStart, isEmptySelectionAtEnd, insertContentDeleteRange, deleteEmptyParagraphAndMoveBlockUp, insertNewLineWithAnalytics, createNewParagraphAbove, createNewParagraphBelow, createParagraphNear, walkNextNode, walkPrevNode, } from './commands';
|
|
62
62
|
export type { WalkNode } from './commands';
|
|
63
63
|
export { GUTTER_SELECTOR, GUTTER_SIZE_IN_PX, GUTTER_SIZE_MOBILE_IN_PX, } from './scroll-gutter';
|
|
64
|
+
export { getTimeSince } from './performance/get-performance-timing';
|
|
65
|
+
export { countNodes } from './count-nodes';
|
|
64
66
|
export declare function shallowEqual(obj1?: any, obj2?: any): boolean;
|
|
65
67
|
export { inputRuleWithAnalytics, createWrappingJoinRule, createRule, } from './input-rules';
|
|
66
68
|
export declare function isSelectionInsideLastNodeInDocument(selection: Selection): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculate the difference between performance.now() and the given startTime.
|
|
3
|
+
* This allows for the timing to be overridable during tests.
|
|
4
|
+
*
|
|
5
|
+
* @param startTime DOMHighResTimeStamp
|
|
6
|
+
* @returns DOMHighResTimeStamp
|
|
7
|
+
*/
|
|
8
|
+
export declare const getTimeSince: (startTime: DOMHighResTimeStamp) => DOMHighResTimeStamp;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "74.
|
|
3
|
+
"version": "74.51.1",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"@atlaskit/menu": "^1.9.0",
|
|
109
109
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
110
110
|
"@atlaskit/profilecard": "^19.5.0",
|
|
111
|
-
"@atlaskit/smart-user-picker": "^6.
|
|
111
|
+
"@atlaskit/smart-user-picker": "^6.2.0",
|
|
112
112
|
"@atlaskit/spinner": "^15.5.0",
|
|
113
113
|
"@atlaskit/task-decision": "^17.7.0",
|
|
114
114
|
"@atlaskit/theme": "^12.5.0",
|