@atlaskit/editor-common 76.16.0 → 76.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 76.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#42279](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42279) [`f4fd8d16522`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f4fd8d16522) - ED-20556 Extract Fragment plugin
8
+
3
9
  ## 76.16.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 = "76.16.0";
19
+ var packageVersion = "76.17.0";
20
20
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
21
21
  // Remove URL as it has UGC
22
22
  // TODO: Sanitise the URL instead of just removing it
@@ -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 = "76.16.0";
27
+ var packageVersion = "76.17.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var DropList = /*#__PURE__*/function (_Component) {
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.bracketTyped = bracketTyped;
7
+ exports.getChangedNodes = getChangedNodes;
7
8
  exports.getStepRange = void 0;
8
9
  exports.hasDocAsParent = hasDocAsParent;
9
10
  exports.hasVisibleContent = hasVisibleContent;
@@ -283,4 +284,28 @@ function hasVisibleContent(node) {
283
284
  }
284
285
  var isSelectionEndOfParagraph = exports.isSelectionEndOfParagraph = function isSelectionEndOfParagraph(state) {
285
286
  return state.selection.$to.parent.type === state.schema.nodes.paragraph && state.selection.$to.pos === state.doc.resolve(state.selection.$to.pos).end();
286
- };
287
+ };
288
+ function getChangedNodesIn(_ref2) {
289
+ var tr = _ref2.tr,
290
+ doc = _ref2.doc;
291
+ var nodes = [];
292
+ var stepRange = getStepRange(tr);
293
+ if (!stepRange) {
294
+ return nodes;
295
+ }
296
+ var from = Math.min(doc.nodeSize - 2, stepRange.from);
297
+ var to = Math.min(doc.nodeSize - 2, stepRange.to);
298
+ doc.nodesBetween(from, to, function (node, pos) {
299
+ nodes.push({
300
+ node: node,
301
+ pos: pos
302
+ });
303
+ });
304
+ return nodes;
305
+ }
306
+ function getChangedNodes(tr) {
307
+ return getChangedNodesIn({
308
+ tr: tr,
309
+ doc: tr.doc
310
+ });
311
+ }
@@ -390,6 +390,12 @@ Object.defineProperty(exports, "getAnnotationIdsFromRange", {
390
390
  return _annotation.getAnnotationIdsFromRange;
391
391
  }
392
392
  });
393
+ Object.defineProperty(exports, "getChangedNodes", {
394
+ enumerable: true,
395
+ get: function get() {
396
+ return _document.getChangedNodes;
397
+ }
398
+ });
393
399
  Object.defineProperty(exports, "getChildrenInfo", {
394
400
  enumerable: true,
395
401
  get: function get() {
@@ -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 = "76.16.0";
3
+ const packageVersion = "76.17.0";
4
4
  const sanitiseSentryEvents = (data, _hint) => {
5
5
  // Remove URL as it has UGC
6
6
  // TODO: Sanitise the URL instead of just removing it
@@ -9,7 +9,7 @@ import { themed } from '@atlaskit/theme/components';
9
9
  import { borderRadius } from '@atlaskit/theme/constants';
10
10
  import Layer from '../Layer';
11
11
  const packageName = "@atlaskit/editor-common";
12
- const packageVersion = "76.16.0";
12
+ const packageVersion = "76.17.0";
13
13
  const halfFocusRing = 1;
14
14
  const dropOffset = '0, 8';
15
15
  class DropList extends Component {
@@ -275,4 +275,29 @@ export function hasVisibleContent(node) {
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();
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();
279
+ function getChangedNodesIn({
280
+ tr,
281
+ doc
282
+ }) {
283
+ const nodes = [];
284
+ const stepRange = getStepRange(tr);
285
+ if (!stepRange) {
286
+ return nodes;
287
+ }
288
+ const from = Math.min(doc.nodeSize - 2, stepRange.from);
289
+ const to = Math.min(doc.nodeSize - 2, stepRange.to);
290
+ doc.nodesBetween(from, to, (node, pos) => {
291
+ nodes.push({
292
+ node,
293
+ pos
294
+ });
295
+ });
296
+ return nodes;
297
+ }
298
+ export function getChangedNodes(tr) {
299
+ return getChangedNodesIn({
300
+ tr: tr,
301
+ doc: tr.doc
302
+ });
303
+ }
@@ -44,7 +44,7 @@ export { isFromCurrentDomain, LinkMatcher, normalizeUrl, linkifyContent, getLink
44
44
  // prosemirror-history does not export its plugin key
45
45
  export const pmHistoryPluginKey = 'history$';
46
46
  export { gridTypeForLayout } from './grid';
47
- export { nodesBetweenChanged, getStepRange, isEmptyDocument, processRawValue, hasDocAsParent, bracketTyped, hasVisibleContent, isSelectionEndOfParagraph } from './document';
47
+ export { nodesBetweenChanged, getStepRange, isEmptyDocument, processRawValue, hasDocAsParent, bracketTyped, hasVisibleContent, isSelectionEndOfParagraph, getChangedNodes } from './document';
48
48
  export { floatingLayouts, isRichMediaInsideOfBlockNode, calculateSnapPoints, alignAttributes, nonWrappedLayouts } from './rich-media-utils';
49
49
  export { sanitizeNodeForPrivacy } from './filter/privacy-filter';
50
50
  export { canRenderDatasource, getDatasourceType } from './datasource';
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
6
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
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 = "76.16.0";
9
+ var packageVersion = "76.17.0";
10
10
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
11
11
  // Remove URL as it has UGC
12
12
  // TODO: Sanitise the URL instead of just removing it
@@ -19,7 +19,7 @@ import { themed } from '@atlaskit/theme/components';
19
19
  import { borderRadius } from '@atlaskit/theme/constants';
20
20
  import Layer from '../Layer';
21
21
  var packageName = "@atlaskit/editor-common";
22
- var packageVersion = "76.16.0";
22
+ var packageVersion = "76.17.0";
23
23
  var halfFocusRing = 1;
24
24
  var dropOffset = '0, 8';
25
25
  var DropList = /*#__PURE__*/function (_Component) {
@@ -270,4 +270,28 @@ export function hasVisibleContent(node) {
270
270
  }
271
271
  export var isSelectionEndOfParagraph = function isSelectionEndOfParagraph(state) {
272
272
  return state.selection.$to.parent.type === state.schema.nodes.paragraph && state.selection.$to.pos === state.doc.resolve(state.selection.$to.pos).end();
273
- };
273
+ };
274
+ function getChangedNodesIn(_ref2) {
275
+ var tr = _ref2.tr,
276
+ doc = _ref2.doc;
277
+ var nodes = [];
278
+ var stepRange = getStepRange(tr);
279
+ if (!stepRange) {
280
+ return nodes;
281
+ }
282
+ var from = Math.min(doc.nodeSize - 2, stepRange.from);
283
+ var to = Math.min(doc.nodeSize - 2, stepRange.to);
284
+ doc.nodesBetween(from, to, function (node, pos) {
285
+ nodes.push({
286
+ node: node,
287
+ pos: pos
288
+ });
289
+ });
290
+ return nodes;
291
+ }
292
+ export function getChangedNodes(tr) {
293
+ return getChangedNodesIn({
294
+ tr: tr,
295
+ doc: tr.doc
296
+ });
297
+ }
@@ -44,7 +44,7 @@ export { isFromCurrentDomain, LinkMatcher, normalizeUrl, linkifyContent, getLink
44
44
  // prosemirror-history does not export its plugin key
45
45
  export var pmHistoryPluginKey = 'history$';
46
46
  export { gridTypeForLayout } from './grid';
47
- export { nodesBetweenChanged, getStepRange, isEmptyDocument, processRawValue, hasDocAsParent, bracketTyped, hasVisibleContent, isSelectionEndOfParagraph } from './document';
47
+ export { nodesBetweenChanged, getStepRange, isEmptyDocument, processRawValue, hasDocAsParent, bracketTyped, hasVisibleContent, isSelectionEndOfParagraph, getChangedNodes } from './document';
48
48
  export { floatingLayouts, isRichMediaInsideOfBlockNode, calculateSnapPoints, alignAttributes, nonWrappedLayouts } from './rich-media-utils';
49
49
  export { sanitizeNodeForPrivacy } from './filter/privacy-filter';
50
50
  export { canRenderDatasource, getDatasourceType } from './datasource';
@@ -22,4 +22,8 @@ export declare function processRawValue(schema: Schema, value?: ReplaceRawValue,
22
22
  */
23
23
  export declare function hasVisibleContent(node: Node): boolean;
24
24
  export declare const isSelectionEndOfParagraph: (state: EditorState) => boolean;
25
+ export declare function getChangedNodes(tr: ReadonlyTransaction | Transaction): {
26
+ node: Node;
27
+ pos: number;
28
+ }[];
25
29
  export {};
@@ -54,7 +54,7 @@ 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, isSelectionEndOfParagraph, } from './document';
57
+ export { nodesBetweenChanged, getStepRange, isEmptyDocument, processRawValue, hasDocAsParent, bracketTyped, hasVisibleContent, isSelectionEndOfParagraph, getChangedNodes, } 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, getDatasourceType } from './datasource';
@@ -22,4 +22,8 @@ export declare function processRawValue(schema: Schema, value?: ReplaceRawValue,
22
22
  */
23
23
  export declare function hasVisibleContent(node: Node): boolean;
24
24
  export declare const isSelectionEndOfParagraph: (state: EditorState) => boolean;
25
+ export declare function getChangedNodes(tr: ReadonlyTransaction | Transaction): {
26
+ node: Node;
27
+ pos: number;
28
+ }[];
25
29
  export {};
@@ -54,7 +54,7 @@ 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, isSelectionEndOfParagraph, } from './document';
57
+ export { nodesBetweenChanged, getStepRange, isEmptyDocument, processRawValue, hasDocAsParent, bracketTyped, hasVisibleContent, isSelectionEndOfParagraph, getChangedNodes, } 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, getDatasourceType } from './datasource';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "76.16.0",
3
+ "version": "76.17.0",
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/"
@@ -154,7 +154,7 @@
154
154
  "devDependencies": {
155
155
  "@atlaskit/media-core": "^34.1.0",
156
156
  "@atlaskit/media-test-helpers": "^33.0.0",
157
- "@atlaskit/smart-card": "^26.39.0",
157
+ "@atlaskit/smart-card": "^26.40.0",
158
158
  "@atlaskit/util-data-test": "^17.8.0",
159
159
  "@atlaskit/visual-regression": "*",
160
160
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",