@atlaskit/adf-schema 25.4.0 → 25.5.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.
Files changed (96) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/cjs/schema/jira-schema.js +4 -0
  3. package/dist/cjs/schema/marks/alignment.js +4 -0
  4. package/dist/cjs/schema/marks/border.js +6 -0
  5. package/dist/cjs/schema/marks/breakout.js +5 -0
  6. package/dist/cjs/schema/marks/code.js +4 -0
  7. package/dist/cjs/schema/marks/data-consumer.js +17 -0
  8. package/dist/cjs/schema/marks/em.js +4 -0
  9. package/dist/cjs/schema/marks/fragment.js +6 -0
  10. package/dist/cjs/schema/marks/indentation.js +4 -0
  11. package/dist/cjs/schema/marks/link.js +4 -0
  12. package/dist/cjs/schema/marks/strike.js +4 -0
  13. package/dist/cjs/schema/marks/strong.js +4 -0
  14. package/dist/cjs/schema/marks/subsup.js +4 -0
  15. package/dist/cjs/schema/marks/text-color.js +4 -0
  16. package/dist/cjs/schema/marks/underline.js +4 -0
  17. package/dist/cjs/schema/nodes/bodied-extension.js +8 -0
  18. package/dist/cjs/schema/nodes/code-block.js +12 -0
  19. package/dist/cjs/schema/nodes/decision-item.js +4 -0
  20. package/dist/cjs/schema/nodes/decision-list.js +4 -0
  21. package/dist/cjs/schema/nodes/emoji.js +4 -0
  22. package/dist/cjs/schema/nodes/extension.js +8 -0
  23. package/dist/cjs/schema/nodes/inline-extension.js +8 -0
  24. package/dist/cjs/schema/nodes/media-inline.js +4 -0
  25. package/dist/cjs/schema/nodes/media.js +4 -0
  26. package/dist/cjs/schema/nodes/mention.js +3 -0
  27. package/dist/cjs/schema/nodes/panel.js +3 -0
  28. package/dist/cjs/schema/nodes/paragraph.js +0 -3
  29. package/dist/cjs/schema/nodes/status.js +4 -0
  30. package/dist/cjs/schema/nodes/tableNodes.js +23 -0
  31. package/dist/cjs/schema/nodes/task-item.js +4 -0
  32. package/dist/cjs/schema/nodes/task-list.js +4 -0
  33. package/dist/cjs/steps/link-meta-step.js +112 -0
  34. package/dist/cjs/steps/table/utils/cells-at-column.js +4 -4
  35. package/dist/cjs/steps.js +8 -1
  36. package/dist/cjs/version.json +1 -1
  37. package/dist/es2019/schema/jira-schema.js +5 -0
  38. package/dist/es2019/schema/marks/alignment.js +5 -0
  39. package/dist/es2019/schema/marks/border.js +7 -0
  40. package/dist/es2019/schema/marks/breakout.js +5 -0
  41. package/dist/es2019/schema/marks/data-consumer.js +6 -0
  42. package/dist/es2019/schema/marks/fragment.js +7 -0
  43. package/dist/es2019/schema/marks/indentation.js +5 -0
  44. package/dist/es2019/schema/marks/link.js +5 -0
  45. package/dist/es2019/schema/marks/subsup.js +5 -0
  46. package/dist/es2019/schema/marks/text-color.js +5 -0
  47. package/dist/es2019/schema/nodes/bodied-extension.js +9 -0
  48. package/dist/es2019/schema/nodes/code-block.js +13 -0
  49. package/dist/es2019/schema/nodes/decision-item.js +5 -0
  50. package/dist/es2019/schema/nodes/extension.js +9 -0
  51. package/dist/es2019/schema/nodes/heading.js +0 -2
  52. package/dist/es2019/schema/nodes/inline-extension.js +9 -0
  53. package/dist/es2019/schema/nodes/layout-section.js +0 -3
  54. package/dist/es2019/schema/nodes/media-inline.js +5 -0
  55. package/dist/es2019/schema/nodes/media.js +5 -0
  56. package/dist/es2019/schema/nodes/mention.js +3 -0
  57. package/dist/es2019/schema/nodes/panel.js +3 -0
  58. package/dist/es2019/schema/nodes/paragraph.js +0 -3
  59. package/dist/es2019/schema/nodes/tableNodes.js +23 -0
  60. package/dist/es2019/schema/nodes/task-item.js +5 -0
  61. package/dist/es2019/schema/nodes/task-list.js +5 -0
  62. package/dist/es2019/steps/link-meta-step.js +71 -0
  63. package/dist/es2019/steps.js +2 -1
  64. package/dist/es2019/version.json +1 -1
  65. package/dist/esm/schema/jira-schema.js +5 -0
  66. package/dist/esm/schema/marks/alignment.js +5 -0
  67. package/dist/esm/schema/marks/border.js +7 -0
  68. package/dist/esm/schema/marks/breakout.js +5 -0
  69. package/dist/esm/schema/marks/data-consumer.js +6 -0
  70. package/dist/esm/schema/marks/fragment.js +7 -0
  71. package/dist/esm/schema/marks/indentation.js +5 -0
  72. package/dist/esm/schema/marks/link.js +5 -0
  73. package/dist/esm/schema/marks/subsup.js +5 -0
  74. package/dist/esm/schema/marks/text-color.js +5 -0
  75. package/dist/esm/schema/nodes/bodied-extension.js +9 -0
  76. package/dist/esm/schema/nodes/code-block.js +13 -0
  77. package/dist/esm/schema/nodes/decision-item.js +5 -0
  78. package/dist/esm/schema/nodes/extension.js +9 -0
  79. package/dist/esm/schema/nodes/heading.js +0 -2
  80. package/dist/esm/schema/nodes/inline-extension.js +9 -0
  81. package/dist/esm/schema/nodes/layout-section.js +0 -3
  82. package/dist/esm/schema/nodes/media-inline.js +5 -0
  83. package/dist/esm/schema/nodes/media.js +5 -0
  84. package/dist/esm/schema/nodes/mention.js +3 -0
  85. package/dist/esm/schema/nodes/panel.js +3 -0
  86. package/dist/esm/schema/nodes/paragraph.js +0 -3
  87. package/dist/esm/schema/nodes/tableNodes.js +23 -0
  88. package/dist/esm/schema/nodes/task-item.js +5 -0
  89. package/dist/esm/schema/nodes/task-list.js +5 -0
  90. package/dist/esm/steps/link-meta-step.js +103 -0
  91. package/dist/esm/steps/table/utils/cells-at-column.js +4 -3
  92. package/dist/esm/steps.js +2 -1
  93. package/dist/esm/version.json +1 -1
  94. package/dist/types/steps/link-meta-step.d.ts +51 -0
  95. package/dist/types/steps.d.ts +2 -0
  96. package/package.json +2 -2
@@ -1,4 +1,9 @@
1
1
  import { N30 } from '../../utils/colors';
2
+
3
+ /**
4
+ * @name media_node
5
+ */
6
+
2
7
  export var defaultAttrs = {
3
8
  id: {
4
9
  default: ''
@@ -4,6 +4,9 @@ export var USER_TYPES;
4
4
  USER_TYPES["SPECIAL"] = "SPECIAL";
5
5
  USER_TYPES["APP"] = "APP";
6
6
  })(USER_TYPES || (USER_TYPES = {}));
7
+ /**
8
+ * @name mention_node
9
+ */
7
10
  export var mention = {
8
11
  inline: true,
9
12
  group: 'inline',
@@ -11,6 +11,9 @@ export var PanelType;
11
11
  PanelType["SUCCESS"] = "success";
12
12
  PanelType["CUSTOM"] = "custom";
13
13
  })(PanelType || (PanelType = {}));
14
+ /**
15
+ * @name panel_node
16
+ */
14
17
  var getDefaultAttrs = function getDefaultAttrs() {
15
18
  var attrs = {
16
19
  panelType: {
@@ -14,15 +14,12 @@
14
14
  * type T1 = X | Y
15
15
  * type T2 = A | T1 | B // T2 = A | X | Y | B
16
16
  */
17
-
18
17
  /**
19
18
  * @name paragraph_with_alignment_node
20
19
  */
21
-
22
20
  /**
23
21
  * @name paragraph_with_indentation_node
24
22
  */
25
-
26
23
  var isImageNode = function isImageNode(node) {
27
24
  return Boolean(node && node.nodeName.toLowerCase() === 'img');
28
25
  };
@@ -117,6 +117,29 @@ export var tableBackgroundColorNames = new Map();
117
117
  tableBackgroundColorPalette.set(colorValue.toLowerCase(), colorName);
118
118
  tableBackgroundColorNames.set(colorName.toLowerCase(), colorValue.toLowerCase());
119
119
  });
120
+
121
+ /**
122
+ * @name table_node
123
+ */
124
+
125
+ /**
126
+ * @name table_row_node
127
+ */
128
+
129
+ /**
130
+ * @name table_cell_content
131
+ * @minItems 1
132
+ * @allowUnsupportedBlock true
133
+ */
134
+
135
+ /**
136
+ * @name table_cell_node
137
+ */
138
+
139
+ /**
140
+ * @name table_header_node
141
+ */
142
+
120
143
  // TODO: Fix any, potential issue. ED-5048
121
144
  var createTableSpec = function createTableSpec() {
122
145
  var attrs = {
@@ -1,4 +1,9 @@
1
1
  import { uuid } from '../../utils/uuid';
2
+
3
+ /**
4
+ * @name taskItem_node
5
+ */
6
+
2
7
  export var taskItem = {
3
8
  content: 'inline*',
4
9
  defining: true,
@@ -1,4 +1,9 @@
1
1
  import { uuid } from '../../utils/uuid';
2
+
3
+ /**
4
+ * @name taskList_node
5
+ */
6
+
2
7
  var name = 'actionList';
3
8
  export var taskListSelector = "[data-node-type=\"".concat(name, "\"]");
4
9
  export var taskList = {
@@ -0,0 +1,103 @@
1
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/createClass";
4
+ import _inherits from "@babel/runtime/helpers/inherits";
5
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
+ var _excluded = ["sourceEvent"];
8
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
+ 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; } }
10
+ import { Slice } from 'prosemirror-model';
11
+ import { ReplaceStep, Step, StepMap, StepResult } from 'prosemirror-transform';
12
+ export var stepType = 'editor-linking-meta';
13
+ export var invertStepType = 'editor-linking-meta-invert';
14
+ /**
15
+ * Custom Prosemirror Step to attach metadata about user interactions with links
16
+ * Using a Step means that it will work with prosemirror-history and we get utilise when
17
+ * firing events on history change
18
+ */
19
+ export var LinkMetaStep = /*#__PURE__*/function (_Step) {
20
+ _inherits(LinkMetaStep, _Step);
21
+ var _super = _createSuper(LinkMetaStep);
22
+ function LinkMetaStep(pos, metadata) {
23
+ var _this;
24
+ var isInverted = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
25
+ _classCallCheck(this, LinkMetaStep);
26
+ _this = _super.call(this);
27
+ _this.pos = pos;
28
+ _this.metadata = metadata;
29
+ _this.isInverted = isInverted;
30
+ return _this;
31
+ }
32
+ _createClass(LinkMetaStep, [{
33
+ key: "getMetadata",
34
+ value: function getMetadata() {
35
+ return this.metadata;
36
+ }
37
+
38
+ /**
39
+ * Generate new undo/redo analytics event when step is inverted
40
+ */
41
+ }, {
42
+ key: "invert",
43
+ value: function invert() {
44
+ /**
45
+ * Omit sourceEvent in history
46
+ */
47
+ var _this$metadata = this.metadata,
48
+ sourceEvent = _this$metadata.sourceEvent,
49
+ metadata = _objectWithoutProperties(_this$metadata, _excluded);
50
+ return new LinkMetaStep(this.pos, metadata, true);
51
+ }
52
+
53
+ // Should make no modifications to the doc
54
+ }, {
55
+ key: "apply",
56
+ value: function apply(doc) {
57
+ return StepResult.ok(doc);
58
+ }
59
+ }, {
60
+ key: "map",
61
+ value: function map(mapping) {
62
+ var newPos = this.pos;
63
+ if (typeof newPos === 'number') {
64
+ newPos = mapping.map(newPos);
65
+ }
66
+ // Return the same events, this step will never be removed
67
+ return new LinkMetaStep(newPos, this.metadata, this.isInverted);
68
+ }
69
+ }, {
70
+ key: "getMap",
71
+ value: function getMap() {
72
+ return new StepMap([this.pos || 0, 0, 0]);
73
+ }
74
+
75
+ // Return null to avoid merging events
76
+ }, {
77
+ key: "merge",
78
+ value: function merge() {
79
+ return null;
80
+ }
81
+ }, {
82
+ key: "toJSON",
83
+ value: function toJSON() {
84
+ // When serialized we should create a noop Replace step
85
+ return {
86
+ stepType: 'replace',
87
+ from: 0,
88
+ to: 0
89
+ };
90
+ }
91
+ }], [{
92
+ key: "fromJSON",
93
+ value: function fromJSON(_, __) {
94
+ // This is a "local custom step" once serialized
95
+ // we need to transform it in a no-operation action
96
+ return new ReplaceStep(0, 0, Slice.empty);
97
+ }
98
+ }]);
99
+ return LinkMetaStep;
100
+ }(Step);
101
+
102
+ /** Register this step with Prosemirror */
103
+ Step.jsonID(stepType, LinkMetaStep);
@@ -1,5 +1,6 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
- var _marked = /*#__PURE__*/_regeneratorRuntime.mark(cellsAtColumn);
1
+ import _typeof from "@babel/runtime/helpers/typeof";
2
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
3
+ var _marked = /*#__PURE__*/_regeneratorRuntime().mark(cellsAtColumn);
3
4
  import { columnIsHeader, tableNodeTypes } from '@atlaskit/editor-tables/utils';
4
5
  import { getCellIndex, hasMergedColumns, isRootRow } from './table-map';
5
6
  /**
@@ -11,7 +12,7 @@ import { getCellIndex, hasMergedColumns, isRootRow } from './table-map';
11
12
  */
12
13
  export function cellsAtColumn(rect, col) {
13
14
  var map, tableStart, table, refColumn, row, index, pos, hasMergedCells, type, cell, cellInfo, skippedRows;
14
- return _regeneratorRuntime.wrap(function cellsAtColumn$(_context) {
15
+ return _regeneratorRuntime().wrap(function cellsAtColumn$(_context) {
15
16
  while (1) {
16
17
  switch (_context.prev = _context.next) {
17
18
  case 0:
package/dist/esm/steps.js CHANGED
@@ -3,4 +3,5 @@ export { TableSortStep } from './steps/table/sort-column';
3
3
  export { InsertTypeAheadStages, InsertTypeAheadStep } from './steps/type-ahead';
4
4
  export { AddColumnStep } from './steps/table/add-column';
5
5
  export { SetAttrsStep } from './steps/set-attrs';
6
- export { AnalyticsStep } from './steps/analytics';
6
+ export { AnalyticsStep } from './steps/analytics';
7
+ export { LinkMetaStep } from './steps/link-meta-step';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "25.4.0",
3
+ "version": "25.5.0",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,51 @@
1
+ import { Node as PMNode, Schema } from 'prosemirror-model';
2
+ import { ReplaceStep, Step, StepMap, StepResult, Mappable } from 'prosemirror-transform';
3
+ export declare const stepType = "editor-linking-meta";
4
+ export declare const invertStepType = "editor-linking-meta-invert";
5
+ export declare type LinkStepMetadata = {
6
+ /**
7
+ * Editor action performed
8
+ */
9
+ action?: string;
10
+ /**
11
+ * Editor input method that triggered the transaction
12
+ */
13
+ inputMethod?: string;
14
+ /**
15
+ * The applicable card action for this step
16
+ * if is RESOLVE then the undo/redo steps should be considered "updates" of a link
17
+ */
18
+ cardAction?: 'RESOLVE';
19
+ /**
20
+ * Source UI that tiggered this step, if available/applicable
21
+ */
22
+ sourceEvent?: unknown;
23
+ };
24
+ /**
25
+ * Custom Prosemirror Step to attach metadata about user interactions with links
26
+ * Using a Step means that it will work with prosemirror-history and we get utilise when
27
+ * firing events on history change
28
+ */
29
+ export declare class LinkMetaStep extends Step {
30
+ private pos;
31
+ private metadata;
32
+ private isInverted;
33
+ constructor(pos: number | null, metadata: LinkStepMetadata, isInverted?: boolean);
34
+ getMetadata(): LinkStepMetadata;
35
+ /**
36
+ * Generate new undo/redo analytics event when step is inverted
37
+ */
38
+ invert(): LinkMetaStep;
39
+ apply(doc: PMNode): StepResult<any>;
40
+ map(mapping: Mappable): LinkMetaStep;
41
+ getMap(): StepMap;
42
+ merge(): null;
43
+ toJSON(): {
44
+ stepType: string;
45
+ from: number;
46
+ to: number;
47
+ };
48
+ static fromJSON<S extends Schema = any>(_: S, __: {
49
+ [key: string]: any;
50
+ }): ReplaceStep<any>;
51
+ }
@@ -6,3 +6,5 @@ export { SetAttrsStep } from './steps/set-attrs';
6
6
  export { AnalyticsStep } from './steps/analytics';
7
7
  export type { TableColumnOrdering } from './steps/table/types';
8
8
  export type { AnalyticsInvertStep, AnalyticsWithChannel, AnalyticsPayload, } from './steps/analytics';
9
+ export { LinkMetaStep } from './steps/link-meta-step';
10
+ export type { LinkStepMetadata } from './steps/link-meta-step';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "25.4.0",
3
+ "version": "25.5.0",
4
4
  "description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@atlaskit/codemod-utils": "^4.1.0",
43
- "@atlaskit/editor-palette": "1.2.0",
43
+ "@atlaskit/editor-palette": "1.3.0",
44
44
  "@atlaskit/editor-tables": "^2.2.0",
45
45
  "@atlaskit/tokens": "^1.2.1",
46
46
  "@babel/runtime": "^7.0.0",