@atlaskit/editor-common 74.51.0 → 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 CHANGED
@@ -1,5 +1,11 @@
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
+
3
9
  ## 74.51.0
4
10
 
5
11
  ### Minor Changes
@@ -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.51.0";
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
@@ -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.51.0";
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;
@@ -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,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.51.0";
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
@@ -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.51.0";
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;
@@ -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.51.0";
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
@@ -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.51.0";
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
+ };
@@ -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
+ };
@@ -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 { Node, ResolvedPos, Schema } from '@atlaskit/editor-prosemirror/model';
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;
@@ -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 { Node, ResolvedPos, Schema } from '@atlaskit/editor-prosemirror/model';
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.51.0",
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.1.0",
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",