@atlaskit/adf-schema 25.5.0 → 25.5.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 +6 -0
- package/dist/cjs/schema/marks/annotation.js +8 -8
- package/dist/cjs/schema/nodes/mention.js +4 -4
- package/dist/cjs/schema/nodes/panel.js +4 -4
- package/dist/cjs/steps/analytics.js +3 -3
- package/dist/cjs/steps/table/add-column.js +1 -1
- package/dist/cjs/steps/table/constants.js +4 -4
- package/dist/cjs/steps/table/utils/cells-at-column.js +52 -54
- package/dist/cjs/steps/table/utils/side-effects/rows.js +1 -1
- package/dist/cjs/steps/type-ahead.js +4 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/schema/marks/annotation.js +6 -6
- package/dist/es2019/schema/nodes/mention.js +5 -3
- package/dist/es2019/schema/nodes/panel.js +5 -3
- package/dist/es2019/steps/analytics.js +3 -3
- package/dist/es2019/steps/table/constants.js +3 -3
- package/dist/es2019/steps/type-ahead.js +3 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/schema/marks/annotation.js +6 -6
- package/dist/esm/schema/nodes/mention.js +5 -3
- package/dist/esm/schema/nodes/panel.js +5 -3
- package/dist/esm/steps/analytics.js +3 -3
- package/dist/esm/steps/table/add-column.js +1 -1
- package/dist/esm/steps/table/constants.js +3 -3
- package/dist/esm/steps/table/utils/cells-at-column.js +51 -54
- package/dist/esm/steps/table/utils/side-effects/rows.js +1 -1
- package/dist/esm/steps/type-ahead.js +3 -3
- package/dist/esm/version.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 25.5.1
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [`0ffb55018c9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0ffb55018c9) - Revert "[ED-17172] Bumped prosemirror-view from 1.23.2 to 1.23.7 and removed work-around for fixed issues"
|
8
|
+
|
3
9
|
## 25.5.0
|
4
10
|
|
5
11
|
### Minor Changes
|
@@ -12,17 +12,17 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
12
12
|
/**
|
13
13
|
* @name annotation_mark
|
14
14
|
*/
|
15
|
-
var AnnotationTypes
|
16
|
-
exports.AnnotationTypes = AnnotationTypes;
|
17
|
-
(function (AnnotationTypes) {
|
15
|
+
var AnnotationTypes = /*#__PURE__*/function (AnnotationTypes) {
|
18
16
|
AnnotationTypes["INLINE_COMMENT"] = "inlineComment";
|
19
|
-
|
20
|
-
|
21
|
-
exports.
|
22
|
-
|
17
|
+
return AnnotationTypes;
|
18
|
+
}({});
|
19
|
+
exports.AnnotationTypes = AnnotationTypes;
|
20
|
+
var AnnotationMarkStates = /*#__PURE__*/function (AnnotationMarkStates) {
|
23
21
|
AnnotationMarkStates["RESOLVED"] = "resolved";
|
24
22
|
AnnotationMarkStates["ACTIVE"] = "active";
|
25
|
-
|
23
|
+
return AnnotationMarkStates;
|
24
|
+
}({});
|
25
|
+
exports.AnnotationMarkStates = AnnotationMarkStates;
|
26
26
|
function buildDataAttributes(_ref) {
|
27
27
|
var id = _ref.id,
|
28
28
|
annotationType = _ref.annotationType,
|
@@ -4,16 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.toJSON = exports.mention = exports.USER_TYPES = void 0;
|
7
|
-
var USER_TYPES
|
8
|
-
exports.USER_TYPES = USER_TYPES;
|
9
|
-
(function (USER_TYPES) {
|
7
|
+
var USER_TYPES = /*#__PURE__*/function (USER_TYPES) {
|
10
8
|
USER_TYPES["DEFAULT"] = "DEFAULT";
|
11
9
|
USER_TYPES["SPECIAL"] = "SPECIAL";
|
12
10
|
USER_TYPES["APP"] = "APP";
|
13
|
-
|
11
|
+
return USER_TYPES;
|
12
|
+
}({});
|
14
13
|
/**
|
15
14
|
* @name mention_node
|
16
15
|
*/
|
16
|
+
exports.USER_TYPES = USER_TYPES;
|
17
17
|
var mention = {
|
18
18
|
inline: true,
|
19
19
|
group: 'inline',
|
@@ -8,9 +8,7 @@ exports.panel = exports.PanelType = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
9
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
10
10
|
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) { (0, _defineProperty2.default)(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; }
|
11
|
-
var PanelType
|
12
|
-
exports.PanelType = PanelType;
|
13
|
-
(function (PanelType) {
|
11
|
+
var PanelType = /*#__PURE__*/function (PanelType) {
|
14
12
|
PanelType["INFO"] = "info";
|
15
13
|
PanelType["NOTE"] = "note";
|
16
14
|
PanelType["TIP"] = "tip";
|
@@ -18,10 +16,12 @@ exports.PanelType = PanelType;
|
|
18
16
|
PanelType["ERROR"] = "error";
|
19
17
|
PanelType["SUCCESS"] = "success";
|
20
18
|
PanelType["CUSTOM"] = "custom";
|
21
|
-
|
19
|
+
return PanelType;
|
20
|
+
}({});
|
22
21
|
/**
|
23
22
|
* @name panel_node
|
24
23
|
*/
|
24
|
+
exports.PanelType = PanelType;
|
25
25
|
var getDefaultAttrs = function getDefaultAttrs() {
|
26
26
|
var attrs = {
|
27
27
|
panelType: {
|
@@ -23,11 +23,11 @@ var analyticsStepType = 'atlaskit-analytics';
|
|
23
23
|
exports.analyticsStepType = analyticsStepType;
|
24
24
|
var analyticsInvertStepType = 'atlaskit-analytics-invert';
|
25
25
|
exports.analyticsInvertStepType = analyticsInvertStepType;
|
26
|
-
var HISTORY_ACTIONS
|
27
|
-
(function (HISTORY_ACTIONS) {
|
26
|
+
var HISTORY_ACTIONS = /*#__PURE__*/function (HISTORY_ACTIONS) {
|
28
27
|
HISTORY_ACTIONS["UNDID"] = "undid";
|
29
28
|
HISTORY_ACTIONS["REDID"] = "redid";
|
30
|
-
|
29
|
+
return HISTORY_ACTIONS;
|
30
|
+
}(HISTORY_ACTIONS || {});
|
31
31
|
/** Creates undo event from a normal analytics event */
|
32
32
|
function createUndoEvent(analyticsEvent) {
|
33
33
|
var _analyticsEvent$paylo;
|
@@ -25,7 +25,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
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; } }
|
26
26
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
27
27
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
28
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
28
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
29
29
|
var ADD_COLUMN_STEP = 'ak-add-column';
|
30
30
|
function printColumnInfo(columnInfo) {
|
31
31
|
var cellsFrom = [];
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.SortOrder = void 0;
|
7
|
-
var SortOrder
|
8
|
-
exports.SortOrder = SortOrder;
|
9
|
-
(function (SortOrder) {
|
7
|
+
var SortOrder = /*#__PURE__*/function (SortOrder) {
|
10
8
|
SortOrder["ASC"] = "asc";
|
11
9
|
SortOrder["DESC"] = "desc";
|
12
|
-
|
10
|
+
return SortOrder;
|
11
|
+
}({});
|
12
|
+
exports.SortOrder = SortOrder;
|
@@ -1,14 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
var
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
5
5
|
value: true
|
6
6
|
});
|
7
7
|
exports.cellsAtColumn = cellsAtColumn;
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
8
9
|
var _utils = require("@atlaskit/editor-tables/utils");
|
9
10
|
var _tableMap = require("./table-map");
|
10
|
-
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; }
|
11
|
-
var _marked = /*#__PURE__*/_regeneratorRuntime().mark(cellsAtColumn);
|
11
|
+
var _marked = /*#__PURE__*/_regenerator.default.mark(cellsAtColumn);
|
12
12
|
/**
|
13
13
|
* Helper to have a consistent way to iterate for all the cells in a column.
|
14
14
|
* You can skip rows by passing the rows to skipped in the next arguments.
|
@@ -18,58 +18,56 @@ var _marked = /*#__PURE__*/_regeneratorRuntime().mark(cellsAtColumn);
|
|
18
18
|
*/
|
19
19
|
function cellsAtColumn(rect, col) {
|
20
20
|
var map, tableStart, table, refColumn, row, index, pos, hasMergedCells, type, cell, cellInfo, skippedRows;
|
21
|
-
return
|
22
|
-
while (1) {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
_context.next = 20;
|
34
|
-
break;
|
35
|
-
}
|
36
|
-
index = (0, _tableMap.getCellIndex)(rect.map, row, col);
|
37
|
-
pos = map.map[index]; // We only consider to has merged cell to the first cell in a rowspan.
|
38
|
-
hasMergedCells = (0, _tableMap.hasMergedColumns)(rect.map, row, col) && (0, _tableMap.isRootRow)(rect.map, row, col); // If this position falls inside a col-spanning cell
|
39
|
-
type = refColumn == null ? (0, _utils.tableNodeTypes)(table.type.schema).cell : table.nodeAt(map.map[index + refColumn]).type;
|
40
|
-
if (!hasMergedCells) {
|
41
|
-
pos = map.positionAt(row, col, table);
|
42
|
-
}
|
43
|
-
cell = table.nodeAt(pos);
|
44
|
-
cellInfo = {
|
45
|
-
from: tableStart + pos,
|
46
|
-
to: tableStart + pos,
|
47
|
-
row: row,
|
48
|
-
col: hasMergedCells ? map.colCount(pos) : col,
|
49
|
-
type: type,
|
50
|
-
hasMergedCells: hasMergedCells
|
51
|
-
};
|
52
|
-
if (cell) {
|
53
|
-
cellInfo.attrs = cell.attrs;
|
54
|
-
cellInfo.to = tableStart + pos + cell.nodeSize;
|
55
|
-
}
|
56
|
-
|
57
|
-
// We let the consumer to pass the rows that we want to skip
|
58
|
-
_context.next = 15;
|
59
|
-
return cellInfo;
|
60
|
-
case 15:
|
61
|
-
skippedRows = _context.sent;
|
62
|
-
if (skippedRows && skippedRows > 0) {
|
63
|
-
row += skippedRows;
|
64
|
-
}
|
65
|
-
case 17:
|
66
|
-
row++;
|
67
|
-
_context.next = 4;
|
21
|
+
return _regenerator.default.wrap(function cellsAtColumn$(_context) {
|
22
|
+
while (1) switch (_context.prev = _context.next) {
|
23
|
+
case 0:
|
24
|
+
map = rect.map, tableStart = rect.tableStart, table = rect.table;
|
25
|
+
refColumn = col > 0 ? -1 : 0;
|
26
|
+
if ((0, _utils.columnIsHeader)(map, table, col + refColumn)) {
|
27
|
+
refColumn = col === 0 || col === map.width ? null : 0;
|
28
|
+
}
|
29
|
+
row = 0;
|
30
|
+
case 4:
|
31
|
+
if (!(row < map.height)) {
|
32
|
+
_context.next = 20;
|
68
33
|
break;
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
34
|
+
}
|
35
|
+
index = (0, _tableMap.getCellIndex)(rect.map, row, col);
|
36
|
+
pos = map.map[index]; // We only consider to has merged cell to the first cell in a rowspan.
|
37
|
+
hasMergedCells = (0, _tableMap.hasMergedColumns)(rect.map, row, col) && (0, _tableMap.isRootRow)(rect.map, row, col); // If this position falls inside a col-spanning cell
|
38
|
+
type = refColumn == null ? (0, _utils.tableNodeTypes)(table.type.schema).cell : table.nodeAt(map.map[index + refColumn]).type;
|
39
|
+
if (!hasMergedCells) {
|
40
|
+
pos = map.positionAt(row, col, table);
|
41
|
+
}
|
42
|
+
cell = table.nodeAt(pos);
|
43
|
+
cellInfo = {
|
44
|
+
from: tableStart + pos,
|
45
|
+
to: tableStart + pos,
|
46
|
+
row: row,
|
47
|
+
col: hasMergedCells ? map.colCount(pos) : col,
|
48
|
+
type: type,
|
49
|
+
hasMergedCells: hasMergedCells
|
50
|
+
};
|
51
|
+
if (cell) {
|
52
|
+
cellInfo.attrs = cell.attrs;
|
53
|
+
cellInfo.to = tableStart + pos + cell.nodeSize;
|
54
|
+
}
|
55
|
+
|
56
|
+
// We let the consumer to pass the rows that we want to skip
|
57
|
+
_context.next = 15;
|
58
|
+
return cellInfo;
|
59
|
+
case 15:
|
60
|
+
skippedRows = _context.sent;
|
61
|
+
if (skippedRows && skippedRows > 0) {
|
62
|
+
row += skippedRows;
|
63
|
+
}
|
64
|
+
case 17:
|
65
|
+
row++;
|
66
|
+
_context.next = 4;
|
67
|
+
break;
|
68
|
+
case 20:
|
69
|
+
case "end":
|
70
|
+
return _context.stop();
|
73
71
|
}
|
74
72
|
}, _marked);
|
75
73
|
}
|
@@ -12,7 +12,7 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
12
12
|
var _tableMap = require("../table-map");
|
13
13
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
14
14
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
15
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
15
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
16
16
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
17
17
|
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) { (0, _defineProperty2.default)(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; }
|
18
18
|
function mergedRanges(first, second) {
|
@@ -16,12 +16,12 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
16
16
|
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; } }
|
17
17
|
var insertTypeAheadStepType = 'atlaskit-insert-type-ahead';
|
18
18
|
exports.insertTypeAheadStepType = insertTypeAheadStepType;
|
19
|
-
var InsertTypeAheadStages
|
20
|
-
exports.InsertTypeAheadStages = InsertTypeAheadStages;
|
21
|
-
(function (InsertTypeAheadStages) {
|
19
|
+
var InsertTypeAheadStages = /*#__PURE__*/function (InsertTypeAheadStages) {
|
22
20
|
InsertTypeAheadStages["DELETING_RAW_QUERY"] = "DELETING_RAW_QUERY";
|
23
21
|
InsertTypeAheadStages["INSERTING_ITEM"] = "INSERTING_ITEM";
|
24
|
-
|
22
|
+
return InsertTypeAheadStages;
|
23
|
+
}({});
|
24
|
+
exports.InsertTypeAheadStages = InsertTypeAheadStages;
|
25
25
|
var InsertTypeAheadStep = /*#__PURE__*/function (_Step) {
|
26
26
|
(0, _inherits2.default)(InsertTypeAheadStep, _Step);
|
27
27
|
var _super = _createSuper(InsertTypeAheadStep);
|
package/dist/cjs/version.json
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
* @name annotation_mark
|
3
3
|
*/
|
4
4
|
|
5
|
-
export let AnnotationTypes
|
6
|
-
(function (AnnotationTypes) {
|
5
|
+
export let AnnotationTypes = /*#__PURE__*/function (AnnotationTypes) {
|
7
6
|
AnnotationTypes["INLINE_COMMENT"] = "inlineComment";
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
return AnnotationTypes;
|
8
|
+
}({});
|
9
|
+
export let AnnotationMarkStates = /*#__PURE__*/function (AnnotationMarkStates) {
|
11
10
|
AnnotationMarkStates["RESOLVED"] = "resolved";
|
12
11
|
AnnotationMarkStates["ACTIVE"] = "active";
|
13
|
-
|
12
|
+
return AnnotationMarkStates;
|
13
|
+
}({});
|
14
14
|
export function buildDataAttributes({
|
15
15
|
id,
|
16
16
|
annotationType,
|
@@ -1,12 +1,14 @@
|
|
1
|
-
export let USER_TYPES
|
2
|
-
(function (USER_TYPES) {
|
1
|
+
export let USER_TYPES = /*#__PURE__*/function (USER_TYPES) {
|
3
2
|
USER_TYPES["DEFAULT"] = "DEFAULT";
|
4
3
|
USER_TYPES["SPECIAL"] = "SPECIAL";
|
5
4
|
USER_TYPES["APP"] = "APP";
|
6
|
-
|
5
|
+
return USER_TYPES;
|
6
|
+
}({});
|
7
|
+
|
7
8
|
/**
|
8
9
|
* @name mention_node
|
9
10
|
*/
|
11
|
+
|
10
12
|
export const mention = {
|
11
13
|
inline: true,
|
12
14
|
group: 'inline',
|
@@ -1,5 +1,4 @@
|
|
1
|
-
export let PanelType
|
2
|
-
(function (PanelType) {
|
1
|
+
export let PanelType = /*#__PURE__*/function (PanelType) {
|
3
2
|
PanelType["INFO"] = "info";
|
4
3
|
PanelType["NOTE"] = "note";
|
5
4
|
PanelType["TIP"] = "tip";
|
@@ -7,10 +6,13 @@ export let PanelType;
|
|
7
6
|
PanelType["ERROR"] = "error";
|
8
7
|
PanelType["SUCCESS"] = "success";
|
9
8
|
PanelType["CUSTOM"] = "custom";
|
10
|
-
|
9
|
+
return PanelType;
|
10
|
+
}({});
|
11
|
+
|
11
12
|
/**
|
12
13
|
* @name panel_node
|
13
14
|
*/
|
15
|
+
|
14
16
|
const getDefaultAttrs = () => {
|
15
17
|
let attrs = {
|
16
18
|
panelType: {
|
@@ -3,11 +3,11 @@ import { Step, StepResult, StepMap, ReplaceStep } from 'prosemirror-transform';
|
|
3
3
|
import { Slice } from 'prosemirror-model';
|
4
4
|
export const analyticsStepType = 'atlaskit-analytics';
|
5
5
|
export const analyticsInvertStepType = 'atlaskit-analytics-invert';
|
6
|
-
var HISTORY_ACTIONS
|
7
|
-
(function (HISTORY_ACTIONS) {
|
6
|
+
var HISTORY_ACTIONS = /*#__PURE__*/function (HISTORY_ACTIONS) {
|
8
7
|
HISTORY_ACTIONS["UNDID"] = "undid";
|
9
8
|
HISTORY_ACTIONS["REDID"] = "redid";
|
10
|
-
|
9
|
+
return HISTORY_ACTIONS;
|
10
|
+
}(HISTORY_ACTIONS || {});
|
11
11
|
/** Creates undo event from a normal analytics event */
|
12
12
|
function createUndoEvent(analyticsEvent) {
|
13
13
|
var _analyticsEvent$paylo;
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { Slice } from 'prosemirror-model';
|
2
2
|
import { ReplaceStep, Step, StepMap, StepResult } from 'prosemirror-transform';
|
3
3
|
export const insertTypeAheadStepType = 'atlaskit-insert-type-ahead';
|
4
|
-
export let InsertTypeAheadStages
|
5
|
-
(function (InsertTypeAheadStages) {
|
4
|
+
export let InsertTypeAheadStages = /*#__PURE__*/function (InsertTypeAheadStages) {
|
6
5
|
InsertTypeAheadStages["DELETING_RAW_QUERY"] = "DELETING_RAW_QUERY";
|
7
6
|
InsertTypeAheadStages["INSERTING_ITEM"] = "INSERTING_ITEM";
|
8
|
-
|
7
|
+
return InsertTypeAheadStages;
|
8
|
+
}({});
|
9
9
|
export class InsertTypeAheadStep extends Step {
|
10
10
|
constructor({
|
11
11
|
stage,
|
package/dist/es2019/version.json
CHANGED
@@ -5,15 +5,15 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
5
5
|
* @name annotation_mark
|
6
6
|
*/
|
7
7
|
|
8
|
-
export var AnnotationTypes
|
9
|
-
(function (AnnotationTypes) {
|
8
|
+
export var AnnotationTypes = /*#__PURE__*/function (AnnotationTypes) {
|
10
9
|
AnnotationTypes["INLINE_COMMENT"] = "inlineComment";
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
return AnnotationTypes;
|
11
|
+
}({});
|
12
|
+
export var AnnotationMarkStates = /*#__PURE__*/function (AnnotationMarkStates) {
|
14
13
|
AnnotationMarkStates["RESOLVED"] = "resolved";
|
15
14
|
AnnotationMarkStates["ACTIVE"] = "active";
|
16
|
-
|
15
|
+
return AnnotationMarkStates;
|
16
|
+
}({});
|
17
17
|
export function buildDataAttributes(_ref) {
|
18
18
|
var id = _ref.id,
|
19
19
|
annotationType = _ref.annotationType,
|
@@ -1,12 +1,14 @@
|
|
1
|
-
export var USER_TYPES
|
2
|
-
(function (USER_TYPES) {
|
1
|
+
export var USER_TYPES = /*#__PURE__*/function (USER_TYPES) {
|
3
2
|
USER_TYPES["DEFAULT"] = "DEFAULT";
|
4
3
|
USER_TYPES["SPECIAL"] = "SPECIAL";
|
5
4
|
USER_TYPES["APP"] = "APP";
|
6
|
-
|
5
|
+
return USER_TYPES;
|
6
|
+
}({});
|
7
|
+
|
7
8
|
/**
|
8
9
|
* @name mention_node
|
9
10
|
*/
|
11
|
+
|
10
12
|
export var mention = {
|
11
13
|
inline: true,
|
12
14
|
group: 'inline',
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
3
3
|
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; }
|
4
|
-
export var PanelType
|
5
|
-
(function (PanelType) {
|
4
|
+
export var PanelType = /*#__PURE__*/function (PanelType) {
|
6
5
|
PanelType["INFO"] = "info";
|
7
6
|
PanelType["NOTE"] = "note";
|
8
7
|
PanelType["TIP"] = "tip";
|
@@ -10,10 +9,13 @@ export var PanelType;
|
|
10
9
|
PanelType["ERROR"] = "error";
|
11
10
|
PanelType["SUCCESS"] = "success";
|
12
11
|
PanelType["CUSTOM"] = "custom";
|
13
|
-
|
12
|
+
return PanelType;
|
13
|
+
}({});
|
14
|
+
|
14
15
|
/**
|
15
16
|
* @name panel_node
|
16
17
|
*/
|
18
|
+
|
17
19
|
var getDefaultAttrs = function getDefaultAttrs() {
|
18
20
|
var attrs = {
|
19
21
|
panelType: {
|
@@ -14,11 +14,11 @@ import { Step, StepResult, StepMap, ReplaceStep } from 'prosemirror-transform';
|
|
14
14
|
import { Slice } from 'prosemirror-model';
|
15
15
|
export var analyticsStepType = 'atlaskit-analytics';
|
16
16
|
export var analyticsInvertStepType = 'atlaskit-analytics-invert';
|
17
|
-
var HISTORY_ACTIONS
|
18
|
-
(function (HISTORY_ACTIONS) {
|
17
|
+
var HISTORY_ACTIONS = /*#__PURE__*/function (HISTORY_ACTIONS) {
|
19
18
|
HISTORY_ACTIONS["UNDID"] = "undid";
|
20
19
|
HISTORY_ACTIONS["REDID"] = "redid";
|
21
|
-
|
20
|
+
return HISTORY_ACTIONS;
|
21
|
+
}(HISTORY_ACTIONS || {});
|
22
22
|
/** Creates undo event from a normal analytics event */
|
23
23
|
function createUndoEvent(analyticsEvent) {
|
24
24
|
var _analyticsEvent$paylo;
|
@@ -11,7 +11,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
11
11
|
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; } }
|
12
12
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
13
13
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
14
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
14
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
15
15
|
import { Step, StepMap, StepResult, Transform } from 'prosemirror-transform';
|
16
16
|
import { cellsAtColumn } from './utils/cells-at-column';
|
17
17
|
import { findColumn } from './utils/find-column';
|
@@ -1,6 +1,5 @@
|
|
1
|
-
import
|
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);
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
2
|
+
var _marked = /*#__PURE__*/_regeneratorRuntime.mark(cellsAtColumn);
|
4
3
|
import { columnIsHeader, tableNodeTypes } from '@atlaskit/editor-tables/utils';
|
5
4
|
import { getCellIndex, hasMergedColumns, isRootRow } from './table-map';
|
6
5
|
/**
|
@@ -12,58 +11,56 @@ import { getCellIndex, hasMergedColumns, isRootRow } from './table-map';
|
|
12
11
|
*/
|
13
12
|
export function cellsAtColumn(rect, col) {
|
14
13
|
var map, tableStart, table, refColumn, row, index, pos, hasMergedCells, type, cell, cellInfo, skippedRows;
|
15
|
-
return _regeneratorRuntime
|
16
|
-
while (1) {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
_context.next = 20;
|
28
|
-
break;
|
29
|
-
}
|
30
|
-
index = getCellIndex(rect.map, row, col);
|
31
|
-
pos = map.map[index]; // We only consider to has merged cell to the first cell in a rowspan.
|
32
|
-
hasMergedCells = hasMergedColumns(rect.map, row, col) && isRootRow(rect.map, row, col); // If this position falls inside a col-spanning cell
|
33
|
-
type = refColumn == null ? tableNodeTypes(table.type.schema).cell : table.nodeAt(map.map[index + refColumn]).type;
|
34
|
-
if (!hasMergedCells) {
|
35
|
-
pos = map.positionAt(row, col, table);
|
36
|
-
}
|
37
|
-
cell = table.nodeAt(pos);
|
38
|
-
cellInfo = {
|
39
|
-
from: tableStart + pos,
|
40
|
-
to: tableStart + pos,
|
41
|
-
row: row,
|
42
|
-
col: hasMergedCells ? map.colCount(pos) : col,
|
43
|
-
type: type,
|
44
|
-
hasMergedCells: hasMergedCells
|
45
|
-
};
|
46
|
-
if (cell) {
|
47
|
-
cellInfo.attrs = cell.attrs;
|
48
|
-
cellInfo.to = tableStart + pos + cell.nodeSize;
|
49
|
-
}
|
50
|
-
|
51
|
-
// We let the consumer to pass the rows that we want to skip
|
52
|
-
_context.next = 15;
|
53
|
-
return cellInfo;
|
54
|
-
case 15:
|
55
|
-
skippedRows = _context.sent;
|
56
|
-
if (skippedRows && skippedRows > 0) {
|
57
|
-
row += skippedRows;
|
58
|
-
}
|
59
|
-
case 17:
|
60
|
-
row++;
|
61
|
-
_context.next = 4;
|
14
|
+
return _regeneratorRuntime.wrap(function cellsAtColumn$(_context) {
|
15
|
+
while (1) switch (_context.prev = _context.next) {
|
16
|
+
case 0:
|
17
|
+
map = rect.map, tableStart = rect.tableStart, table = rect.table;
|
18
|
+
refColumn = col > 0 ? -1 : 0;
|
19
|
+
if (columnIsHeader(map, table, col + refColumn)) {
|
20
|
+
refColumn = col === 0 || col === map.width ? null : 0;
|
21
|
+
}
|
22
|
+
row = 0;
|
23
|
+
case 4:
|
24
|
+
if (!(row < map.height)) {
|
25
|
+
_context.next = 20;
|
62
26
|
break;
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
27
|
+
}
|
28
|
+
index = getCellIndex(rect.map, row, col);
|
29
|
+
pos = map.map[index]; // We only consider to has merged cell to the first cell in a rowspan.
|
30
|
+
hasMergedCells = hasMergedColumns(rect.map, row, col) && isRootRow(rect.map, row, col); // If this position falls inside a col-spanning cell
|
31
|
+
type = refColumn == null ? tableNodeTypes(table.type.schema).cell : table.nodeAt(map.map[index + refColumn]).type;
|
32
|
+
if (!hasMergedCells) {
|
33
|
+
pos = map.positionAt(row, col, table);
|
34
|
+
}
|
35
|
+
cell = table.nodeAt(pos);
|
36
|
+
cellInfo = {
|
37
|
+
from: tableStart + pos,
|
38
|
+
to: tableStart + pos,
|
39
|
+
row: row,
|
40
|
+
col: hasMergedCells ? map.colCount(pos) : col,
|
41
|
+
type: type,
|
42
|
+
hasMergedCells: hasMergedCells
|
43
|
+
};
|
44
|
+
if (cell) {
|
45
|
+
cellInfo.attrs = cell.attrs;
|
46
|
+
cellInfo.to = tableStart + pos + cell.nodeSize;
|
47
|
+
}
|
48
|
+
|
49
|
+
// We let the consumer to pass the rows that we want to skip
|
50
|
+
_context.next = 15;
|
51
|
+
return cellInfo;
|
52
|
+
case 15:
|
53
|
+
skippedRows = _context.sent;
|
54
|
+
if (skippedRows && skippedRows > 0) {
|
55
|
+
row += skippedRows;
|
56
|
+
}
|
57
|
+
case 17:
|
58
|
+
row++;
|
59
|
+
_context.next = 4;
|
60
|
+
break;
|
61
|
+
case 20:
|
62
|
+
case "end":
|
63
|
+
return _context.stop();
|
67
64
|
}
|
68
65
|
}, _marked);
|
69
66
|
}
|
@@ -4,7 +4,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
4
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
5
5
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
6
6
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
7
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
8
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
9
9
|
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; }
|
10
10
|
import { hasMergedColumns } from '../table-map';
|
@@ -8,11 +8,11 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
8
8
|
import { Slice } from 'prosemirror-model';
|
9
9
|
import { ReplaceStep, Step, StepMap, StepResult } from 'prosemirror-transform';
|
10
10
|
export var insertTypeAheadStepType = 'atlaskit-insert-type-ahead';
|
11
|
-
export var InsertTypeAheadStages
|
12
|
-
(function (InsertTypeAheadStages) {
|
11
|
+
export var InsertTypeAheadStages = /*#__PURE__*/function (InsertTypeAheadStages) {
|
13
12
|
InsertTypeAheadStages["DELETING_RAW_QUERY"] = "DELETING_RAW_QUERY";
|
14
13
|
InsertTypeAheadStages["INSERTING_ITEM"] = "INSERTING_ITEM";
|
15
|
-
|
14
|
+
return InsertTypeAheadStages;
|
15
|
+
}({});
|
16
16
|
export var InsertTypeAheadStep = /*#__PURE__*/function (_Step) {
|
17
17
|
_inherits(InsertTypeAheadStep, _Step);
|
18
18
|
var _super = _createSuper(InsertTypeAheadStep);
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED