@atlaskit/adf-schema 25.3.2 → 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 (129) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/index.js +12 -0
  3. package/dist/cjs/schema/create-schema.js +3 -0
  4. package/dist/cjs/schema/default-schema.js +4 -0
  5. package/dist/cjs/schema/index.js +12 -0
  6. package/dist/cjs/schema/jira-schema.js +4 -0
  7. package/dist/cjs/schema/marks/alignment.js +4 -0
  8. package/dist/cjs/schema/marks/border.js +58 -0
  9. package/dist/cjs/schema/marks/breakout.js +5 -0
  10. package/dist/cjs/schema/marks/code.js +4 -0
  11. package/dist/cjs/schema/marks/data-consumer.js +17 -0
  12. package/dist/cjs/schema/marks/em.js +4 -0
  13. package/dist/cjs/schema/marks/fragment.js +6 -0
  14. package/dist/cjs/schema/marks/indentation.js +4 -0
  15. package/dist/cjs/schema/marks/index.js +14 -1
  16. package/dist/cjs/schema/marks/link.js +4 -0
  17. package/dist/cjs/schema/marks/strike.js +4 -0
  18. package/dist/cjs/schema/marks/strong.js +4 -0
  19. package/dist/cjs/schema/marks/subsup.js +4 -0
  20. package/dist/cjs/schema/marks/text-color.js +4 -0
  21. package/dist/cjs/schema/marks/underline.js +4 -0
  22. package/dist/cjs/schema/nodes/bodied-extension.js +8 -0
  23. package/dist/cjs/schema/nodes/code-block.js +12 -0
  24. package/dist/cjs/schema/nodes/decision-item.js +4 -0
  25. package/dist/cjs/schema/nodes/decision-list.js +4 -0
  26. package/dist/cjs/schema/nodes/emoji.js +4 -0
  27. package/dist/cjs/schema/nodes/extension.js +8 -0
  28. package/dist/cjs/schema/nodes/inline-extension.js +8 -0
  29. package/dist/cjs/schema/nodes/media-group.js +4 -1
  30. package/dist/cjs/schema/nodes/media-inline.js +4 -0
  31. package/dist/cjs/schema/nodes/media-single.js +1 -1
  32. package/dist/cjs/schema/nodes/media.js +4 -0
  33. package/dist/cjs/schema/nodes/mention.js +3 -0
  34. package/dist/cjs/schema/nodes/panel.js +3 -0
  35. package/dist/cjs/schema/nodes/paragraph.js +0 -3
  36. package/dist/cjs/schema/nodes/status.js +4 -0
  37. package/dist/cjs/schema/nodes/tableNodes.js +23 -0
  38. package/dist/cjs/schema/nodes/task-item.js +4 -0
  39. package/dist/cjs/schema/nodes/task-list.js +4 -0
  40. package/dist/cjs/steps/link-meta-step.js +112 -0
  41. package/dist/cjs/steps/table/utils/cells-at-column.js +4 -4
  42. package/dist/cjs/steps.js +8 -1
  43. package/dist/cjs/utils/colors.js +7 -1
  44. package/dist/cjs/version.json +1 -1
  45. package/dist/es2019/index.js +1 -1
  46. package/dist/es2019/schema/create-schema.js +4 -1
  47. package/dist/es2019/schema/default-schema.js +4 -0
  48. package/dist/es2019/schema/index.js +1 -1
  49. package/dist/es2019/schema/jira-schema.js +5 -0
  50. package/dist/es2019/schema/marks/alignment.js +5 -0
  51. package/dist/es2019/schema/marks/border.js +44 -0
  52. package/dist/es2019/schema/marks/breakout.js +5 -0
  53. package/dist/es2019/schema/marks/data-consumer.js +6 -0
  54. package/dist/es2019/schema/marks/fragment.js +7 -0
  55. package/dist/es2019/schema/marks/indentation.js +5 -0
  56. package/dist/es2019/schema/marks/index.js +2 -1
  57. package/dist/es2019/schema/marks/link.js +5 -0
  58. package/dist/es2019/schema/marks/subsup.js +5 -0
  59. package/dist/es2019/schema/marks/text-color.js +5 -0
  60. package/dist/es2019/schema/nodes/bodied-extension.js +9 -0
  61. package/dist/es2019/schema/nodes/code-block.js +13 -0
  62. package/dist/es2019/schema/nodes/decision-item.js +5 -0
  63. package/dist/es2019/schema/nodes/extension.js +9 -0
  64. package/dist/es2019/schema/nodes/heading.js +0 -2
  65. package/dist/es2019/schema/nodes/inline-extension.js +9 -0
  66. package/dist/es2019/schema/nodes/layout-section.js +0 -3
  67. package/dist/es2019/schema/nodes/media-group.js +4 -1
  68. package/dist/es2019/schema/nodes/media-inline.js +5 -0
  69. package/dist/es2019/schema/nodes/media-single.js +1 -1
  70. package/dist/es2019/schema/nodes/media.js +5 -0
  71. package/dist/es2019/schema/nodes/mention.js +3 -0
  72. package/dist/es2019/schema/nodes/panel.js +3 -0
  73. package/dist/es2019/schema/nodes/paragraph.js +0 -3
  74. package/dist/es2019/schema/nodes/tableNodes.js +23 -0
  75. package/dist/es2019/schema/nodes/task-item.js +5 -0
  76. package/dist/es2019/schema/nodes/task-list.js +5 -0
  77. package/dist/es2019/steps/link-meta-step.js +71 -0
  78. package/dist/es2019/steps.js +2 -1
  79. package/dist/es2019/utils/colors.js +3 -0
  80. package/dist/es2019/version.json +1 -1
  81. package/dist/esm/index.js +1 -1
  82. package/dist/esm/schema/create-schema.js +4 -1
  83. package/dist/esm/schema/default-schema.js +4 -0
  84. package/dist/esm/schema/index.js +1 -1
  85. package/dist/esm/schema/jira-schema.js +5 -0
  86. package/dist/esm/schema/marks/alignment.js +5 -0
  87. package/dist/esm/schema/marks/border.js +50 -0
  88. package/dist/esm/schema/marks/breakout.js +5 -0
  89. package/dist/esm/schema/marks/data-consumer.js +6 -0
  90. package/dist/esm/schema/marks/fragment.js +7 -0
  91. package/dist/esm/schema/marks/indentation.js +5 -0
  92. package/dist/esm/schema/marks/index.js +2 -1
  93. package/dist/esm/schema/marks/link.js +5 -0
  94. package/dist/esm/schema/marks/subsup.js +5 -0
  95. package/dist/esm/schema/marks/text-color.js +5 -0
  96. package/dist/esm/schema/nodes/bodied-extension.js +9 -0
  97. package/dist/esm/schema/nodes/code-block.js +13 -0
  98. package/dist/esm/schema/nodes/decision-item.js +5 -0
  99. package/dist/esm/schema/nodes/extension.js +9 -0
  100. package/dist/esm/schema/nodes/heading.js +0 -2
  101. package/dist/esm/schema/nodes/inline-extension.js +9 -0
  102. package/dist/esm/schema/nodes/layout-section.js +0 -3
  103. package/dist/esm/schema/nodes/media-group.js +4 -1
  104. package/dist/esm/schema/nodes/media-inline.js +5 -0
  105. package/dist/esm/schema/nodes/media-single.js +1 -1
  106. package/dist/esm/schema/nodes/media.js +5 -0
  107. package/dist/esm/schema/nodes/mention.js +3 -0
  108. package/dist/esm/schema/nodes/panel.js +3 -0
  109. package/dist/esm/schema/nodes/paragraph.js +0 -3
  110. package/dist/esm/schema/nodes/tableNodes.js +23 -0
  111. package/dist/esm/schema/nodes/task-item.js +5 -0
  112. package/dist/esm/schema/nodes/task-list.js +5 -0
  113. package/dist/esm/steps/link-meta-step.js +103 -0
  114. package/dist/esm/steps/table/utils/cells-at-column.js +4 -3
  115. package/dist/esm/steps.js +2 -1
  116. package/dist/esm/utils/colors.js +3 -0
  117. package/dist/esm/version.json +1 -1
  118. package/dist/json-schema/v1/stage-0.json +42 -1
  119. package/dist/types/index.d.ts +2 -2
  120. package/dist/types/schema/index.d.ts +2 -2
  121. package/dist/types/schema/marks/border.d.ts +24 -0
  122. package/dist/types/schema/marks/index.d.ts +2 -0
  123. package/dist/types/schema/nodes/media.d.ts +2 -1
  124. package/dist/types/steps/link-meta-step.d.ts +51 -0
  125. package/dist/types/steps.d.ts +2 -0
  126. package/dist/types/utils/colors.d.ts +3 -0
  127. package/json-schema/v1/stage-0.json +42 -1
  128. package/package.json +4 -4
  129. package/report.api.md +24 -1
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.stepType = exports.invertStepType = exports.LinkMetaStep = void 0;
8
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
14
+ var _prosemirrorModel = require("prosemirror-model");
15
+ var _prosemirrorTransform = require("prosemirror-transform");
16
+ var _excluded = ["sourceEvent"];
17
+ 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); }; }
18
+ 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; } }
19
+ var stepType = 'editor-linking-meta';
20
+ exports.stepType = stepType;
21
+ var invertStepType = 'editor-linking-meta-invert';
22
+ exports.invertStepType = invertStepType;
23
+ /**
24
+ * Custom Prosemirror Step to attach metadata about user interactions with links
25
+ * Using a Step means that it will work with prosemirror-history and we get utilise when
26
+ * firing events on history change
27
+ */
28
+ var LinkMetaStep = /*#__PURE__*/function (_Step) {
29
+ (0, _inherits2.default)(LinkMetaStep, _Step);
30
+ var _super = _createSuper(LinkMetaStep);
31
+ function LinkMetaStep(pos, metadata) {
32
+ var _this;
33
+ var isInverted = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
34
+ (0, _classCallCheck2.default)(this, LinkMetaStep);
35
+ _this = _super.call(this);
36
+ _this.pos = pos;
37
+ _this.metadata = metadata;
38
+ _this.isInverted = isInverted;
39
+ return _this;
40
+ }
41
+ (0, _createClass2.default)(LinkMetaStep, [{
42
+ key: "getMetadata",
43
+ value: function getMetadata() {
44
+ return this.metadata;
45
+ }
46
+
47
+ /**
48
+ * Generate new undo/redo analytics event when step is inverted
49
+ */
50
+ }, {
51
+ key: "invert",
52
+ value: function invert() {
53
+ /**
54
+ * Omit sourceEvent in history
55
+ */
56
+ var _this$metadata = this.metadata,
57
+ sourceEvent = _this$metadata.sourceEvent,
58
+ metadata = (0, _objectWithoutProperties2.default)(_this$metadata, _excluded);
59
+ return new LinkMetaStep(this.pos, metadata, true);
60
+ }
61
+
62
+ // Should make no modifications to the doc
63
+ }, {
64
+ key: "apply",
65
+ value: function apply(doc) {
66
+ return _prosemirrorTransform.StepResult.ok(doc);
67
+ }
68
+ }, {
69
+ key: "map",
70
+ value: function map(mapping) {
71
+ var newPos = this.pos;
72
+ if (typeof newPos === 'number') {
73
+ newPos = mapping.map(newPos);
74
+ }
75
+ // Return the same events, this step will never be removed
76
+ return new LinkMetaStep(newPos, this.metadata, this.isInverted);
77
+ }
78
+ }, {
79
+ key: "getMap",
80
+ value: function getMap() {
81
+ return new _prosemirrorTransform.StepMap([this.pos || 0, 0, 0]);
82
+ }
83
+
84
+ // Return null to avoid merging events
85
+ }, {
86
+ key: "merge",
87
+ value: function merge() {
88
+ return null;
89
+ }
90
+ }, {
91
+ key: "toJSON",
92
+ value: function toJSON() {
93
+ // When serialized we should create a noop Replace step
94
+ return {
95
+ stepType: 'replace',
96
+ from: 0,
97
+ to: 0
98
+ };
99
+ }
100
+ }], [{
101
+ key: "fromJSON",
102
+ value: function fromJSON(_, __) {
103
+ // This is a "local custom step" once serialized
104
+ // we need to transform it in a no-operation action
105
+ return new _prosemirrorTransform.ReplaceStep(0, 0, _prosemirrorModel.Slice.empty);
106
+ }
107
+ }]);
108
+ return LinkMetaStep;
109
+ }(_prosemirrorTransform.Step);
110
+ /** Register this step with Prosemirror */
111
+ exports.LinkMetaStep = LinkMetaStep;
112
+ _prosemirrorTransform.Step.jsonID(stepType, LinkMetaStep);
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _typeof = require("@babel/runtime/helpers/typeof");
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"));
9
8
  var _utils = require("@atlaskit/editor-tables/utils");
10
9
  var _tableMap = require("./table-map");
11
- var _marked = /*#__PURE__*/_regenerator.default.mark(cellsAtColumn);
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);
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,7 +18,7 @@ var _marked = /*#__PURE__*/_regenerator.default.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 _regenerator.default.wrap(function cellsAtColumn$(_context) {
21
+ return _regeneratorRuntime().wrap(function cellsAtColumn$(_context) {
22
22
  while (1) {
23
23
  switch (_context.prev = _context.next) {
24
24
  case 0:
package/dist/cjs/steps.js CHANGED
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "InsertTypeAheadStep", {
27
27
  return _typeAhead.InsertTypeAheadStep;
28
28
  }
29
29
  });
30
+ Object.defineProperty(exports, "LinkMetaStep", {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _linkMetaStep.LinkMetaStep;
34
+ }
35
+ });
30
36
  Object.defineProperty(exports, "SetAttrsStep", {
31
37
  enumerable: true,
32
38
  get: function get() {
@@ -50,4 +56,5 @@ var _sortColumn = require("./steps/table/sort-column");
50
56
  var _typeAhead = require("./steps/type-ahead");
51
57
  var _addColumn = require("./steps/table/add-column");
52
58
  var _setAttrs = require("./steps/set-attrs");
53
- var _analytics = require("./steps/analytics");
59
+ var _analytics = require("./steps/analytics");
60
+ var _linkMetaStep = require("./steps/link-meta-step");
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.Y75 = exports.Y500 = exports.Y50 = exports.Y400 = exports.Y200 = exports.T75 = exports.T500 = exports.T50 = exports.T300 = exports.T100 = exports.R75 = exports.R500 = exports.R50 = exports.R400 = exports.R300 = exports.R100 = exports.P75 = exports.P500 = exports.P50 = exports.P400 = exports.P300 = exports.P100 = exports.N90 = exports.N800 = exports.N80 = exports.N60 = exports.N500 = exports.N50 = exports.N40 = exports.N300 = exports.N30 = exports.N200 = exports.N20 = exports.N0 = exports.G75 = exports.G500 = exports.G50 = exports.G400 = exports.G300 = exports.G200 = exports.B75 = exports.B500 = exports.B50 = exports.B400 = exports.B100 = void 0;
8
+ exports.Y75 = exports.Y500 = exports.Y50 = exports.Y400 = exports.Y200 = exports.T75 = exports.T500 = exports.T50 = exports.T300 = exports.T100 = exports.R75 = exports.R500 = exports.R50 = exports.R400 = exports.R300 = exports.R100 = exports.P75 = exports.P500 = exports.P50 = exports.P400 = exports.P300 = exports.P100 = exports.N90 = exports.N800 = exports.N80 = exports.N600 = exports.N60 = exports.N500 = exports.N50 = exports.N40 = exports.N300A = exports.N300 = exports.N30 = exports.N200 = exports.N20 = exports.N1000 = exports.N0 = exports.G75 = exports.G500 = exports.G50 = exports.G400 = exports.G300 = exports.G200 = exports.B75 = exports.B500 = exports.B50 = exports.B400 = exports.B100 = void 0;
9
9
  exports.hexToRgb = hexToRgb;
10
10
  exports.hexToRgba = hexToRgba;
11
11
  exports.isHex = isHex;
@@ -89,10 +89,16 @@ var N200 = '#6B778C';
89
89
  exports.N200 = N200;
90
90
  var N300 = '#5E6C84';
91
91
  exports.N300 = N300;
92
+ var N300A = '#091E4224';
93
+ exports.N300A = N300A;
92
94
  var N500 = '#42526E';
93
95
  exports.N500 = N500;
96
+ var N600 = '#758195';
97
+ exports.N600 = N600;
94
98
  var N800 = '#172B4D';
95
99
  exports.N800 = N800;
100
+ var N1000 = '#172B4D';
101
+ exports.N1000 = N1000;
96
102
  var P50 = '#EAE6FF';
97
103
  exports.P50 = P50;
98
104
  var P75 = '#C0B6F2';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "25.3.2",
3
+ "version": "25.5.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,3 +1,3 @@
1
1
  export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
2
- colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, textColor, toJSONTableCell, toJSONTableHeader, typeAheadQuery, underline, unknownBlock, unsupportedBlock, unsupportedInline, unsupportedNodeTypesForMediaCards, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute } from './schema';
2
+ colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, textColor, toJSONTableCell, toJSONTableHeader, typeAheadQuery, underline, unknownBlock, unsupportedBlock, unsupportedInline, unsupportedNodeTypesForMediaCards, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette } from './schema';
3
3
  export { B100, B400, B50, B500, B75, G200, G300, G400, G50, G500, G75, N0, N20, N200, N30, N300, N40, N50, N500, N60, N80, N800, N90, P100, P300, P400, P50, P500, P75, R100, R300, R400, R50, R500, R75, T100, T300, T50, T500, T75, Y200, Y400, Y50, Y500, Y75, acNameToEmoji, acShortcutToEmoji, emojiIdToAcName, generateUuid, getEmojiAcName, getLinkMatch, hexToRgb, hexToRgba, isHex, isRgb, isSafeUrl, linkify, linkifyMatch, normalizeHexColor, normalizeUrl, rgbToHex, uuid } from './utils';
@@ -1,6 +1,6 @@
1
1
  import { Schema } from 'prosemirror-model';
2
2
  import { COLOR, FONT_STYLE, SEARCH_QUERY, LINK } from './groups';
3
- import { link, em, strong, textColor, strike, subsup, underline, code, typeAheadQuery, confluenceInlineComment, breakout, alignment, indentation, annotation, unsupportedMark, unsupportedNodeAttribute, dataConsumer, fragment } from './marks';
3
+ import { link, em, strong, textColor, strike, subsup, underline, code, typeAheadQuery, confluenceInlineComment, breakout, alignment, indentation, annotation, unsupportedMark, unsupportedNodeAttribute, dataConsumer, fragment, border } from './marks';
4
4
  import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder, listItem, heading, blockquote, codeBlock, panel, rule, image, mention, media, mediaInline, mediaGroup, mediaSingleWithCaption, hardBreak, emoji, table, tableCell, tableHeader, tableRow, decisionList, decisionItem, taskList, taskItem, unknownBlock, extension, inlineExtension, bodiedExtension, date, placeholder, layoutSection, layoutColumn, inlineCard, blockCard, unsupportedBlock, unsupportedInline, status, expand, nestedExpand, embedCard, caption } from './nodes';
5
5
  function addItems(builtInItems, config, customSpecs = {}) {
6
6
  if (!config) {
@@ -239,6 +239,9 @@ const marksInOrder = [{
239
239
  }, {
240
240
  name: 'indentation',
241
241
  spec: indentation
242
+ }, {
243
+ name: 'border',
244
+ spec: border
242
245
  }, {
243
246
  name: 'unsupportedMark',
244
247
  spec: unsupportedMark
@@ -1,4 +1,5 @@
1
1
  import { layoutSectionWithSingleColumn } from './nodes';
2
+ import { border } from './marks';
2
3
  import { createSchema } from './create-schema';
3
4
  const getDefaultSchemaConfig = () => {
4
5
  let defaultSchemaConfig = {
@@ -16,6 +17,9 @@ export const getSchemaBasedOnStage = (stage = 'final') => {
16
17
  defaultSchemaConfig.customNodeSpecs = {
17
18
  layoutSection: layoutSectionWithSingleColumn
18
19
  };
20
+ defaultSchemaConfig.customMarkSpecs = {
21
+ border
22
+ };
19
23
  }
20
24
  return createSchema(defaultSchemaConfig);
21
25
  };
@@ -1,6 +1,6 @@
1
1
  export { PanelType, blockCard, blockquote, bodiedExtension, bulletList, bulletListSelector, caption, codeBlock, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, decisionItem, decisionList, decisionListSelector, doc, embedCard, emoji, expand, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineExtension, layoutColumn, layoutSection, layoutSectionWithSingleColumn, listItem, media, mediaGroup, mediaSingle, mediaInline, mediaSingleWithCaption, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, getCellAttrs, getCellDomAttrs, status, table, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline } from './nodes';
2
2
  export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
3
- colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute } from './marks';
3
+ colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette } from './marks';
4
4
  export { unsupportedNodeTypesForMediaCards } from './unsupported';
5
5
  export { inlineNodes } from './inline-nodes';
6
6
  export { sanitizeNodes, createSchema } from './create-schema';
@@ -1,4 +1,9 @@
1
1
  import { createSchema } from './create-schema';
2
+
3
+ /**
4
+ * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
5
+ **/
6
+
2
7
  /**
3
8
  * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
4
9
  **/
@@ -6,6 +6,11 @@ export const alignmentPositionMap = {
6
6
  right: 'end',
7
7
  center: 'center'
8
8
  };
9
+
10
+ /**
11
+ * @name alignment_mark
12
+ */
13
+
9
14
  export const alignment = {
10
15
  excludes: `alignment ${INDENTATION}`,
11
16
  group: ALIGNMENT,
@@ -0,0 +1,44 @@
1
+ import { hexToEditorBorderPaletteColor } from '@atlaskit/editor-palette';
2
+ import { N300A, N600, N1000 } from '../../utils/colors';
3
+
4
+ /**
5
+ * @name border_mark
6
+ * @stage 0
7
+ * @description This mark adds decoration to an element, and any element decorated with it will also have a border style.
8
+ */
9
+
10
+ const borderColorArrayPalette = [[N300A, 'Subtle gray'], [N600, 'Gray'], [N1000, 'Bold gray']];
11
+ export const borderColorPalette = new Map();
12
+ borderColorArrayPalette.forEach(([color, label]) => borderColorPalette.set(color.toLowerCase(), label));
13
+ export const border = {
14
+ inclusive: false,
15
+ parseDOM: [{
16
+ tag: 'div[data-mark-type="border"]',
17
+ getAttrs: domNode => {
18
+ var _dom$getAttribute, _dom$getAttribute2;
19
+ const dom = domNode;
20
+ const color = ((_dom$getAttribute = dom.getAttribute('data-color')) !== null && _dom$getAttribute !== void 0 ? _dom$getAttribute : '').toLowerCase();
21
+ const size = +((_dom$getAttribute2 = dom.getAttribute('data-size')) !== null && _dom$getAttribute2 !== void 0 ? _dom$getAttribute2 : '0');
22
+ return {
23
+ size: size > 3 ? 3 : size < 1 ? false : size,
24
+ color: borderColorPalette.has(color) ? color : false
25
+ };
26
+ }
27
+ }],
28
+ attrs: {
29
+ color: {},
30
+ size: {}
31
+ },
32
+ toDOM(mark) {
33
+ // Note -- while there is no way to create custom colors using default tooling
34
+ // the editor does supported ad hoc color values -- and there may be content
35
+ // which has been migrated or created via apis which use such values.
36
+ const paletteColorValue = hexToEditorBorderPaletteColor(mark.attrs.color) || mark.attrs.color;
37
+ return ['div', {
38
+ 'data-mark-type': 'border',
39
+ 'data-color': mark.attrs.color,
40
+ 'data-size': mark.attrs.size,
41
+ style: `--custom-palette-color: ${paletteColorValue}`
42
+ }];
43
+ }
44
+ };
@@ -1,4 +1,9 @@
1
1
  const allowedTypes = ['wide', 'full-width'];
2
+
3
+ /**
4
+ * @name breakout_mark
5
+ */
6
+
2
7
  export const breakout = {
3
8
  spanning: false,
4
9
  inclusive: false,
@@ -11,6 +11,12 @@ import { isDOMElement } from '../../utils/parseDOM';
11
11
  * // @minLength 1
12
12
  */
13
13
 
14
+ /**
15
+ * @name dataConsumer_mark
16
+ * @description This mark is used for metadata surrounding a node consuming data
17
+ * from a given source node
18
+ */
19
+
14
20
  const parseDataConsumer = maybeValue => {
15
21
  const sources = isDOMElement(maybeValue) && maybeValue.getAttribute('data-sources');
16
22
  try {
@@ -1,4 +1,11 @@
1
1
  import { isDOMElement } from '../../utils/parseDOM';
2
+
3
+ /**
4
+ * @name fragment_mark
5
+ * @description Indicates that the elements decorated with this mark belong to a "fragment" entity, which represents a collection of ADF nodes.
6
+ * This entity can be referred to later by its `localId` attribute.
7
+ */
8
+
2
9
  const parseFragment = maybeValue => {
3
10
  var _maybeValue$getAttrib;
4
11
  if (!isDOMElement(maybeValue)) {
@@ -1,4 +1,9 @@
1
1
  import { ALIGNMENT, INDENTATION } from '../groups';
2
+
3
+ /**
4
+ * @name indentation_mark
5
+ */
6
+
2
7
  export const indentation = {
3
8
  excludes: `indentation ${ALIGNMENT}`,
4
9
  group: INDENTATION,
@@ -15,4 +15,5 @@ export { annotation, AnnotationMarkStates, buildDataAttributes as buildAnnotatio
15
15
  export { unsupportedMark } from './unsupported-mark';
16
16
  export { unsupportedNodeAttribute } from './unsupported-node-attributes';
17
17
  export { dataConsumer, toJSON as dataConsumerToJSON } from './data-consumer';
18
- export { fragment, toJSON as fragmentToJSON } from './fragment';
18
+ export { fragment, toJSON as fragmentToJSON } from './fragment';
19
+ export { border, borderColorPalette } from './border';
@@ -1,5 +1,10 @@
1
1
  import { LINK } from '../groups';
2
2
  import { isRootRelative, isSafeUrl, normalizeUrl } from '../../utils/url';
3
+
4
+ /**
5
+ * @name link_mark
6
+ */
7
+
3
8
  const getLinkAttrs = attribute => domNode => {
4
9
  const dom = domNode;
5
10
  const href = dom.getAttribute(attribute) || '';
@@ -1,4 +1,9 @@
1
1
  import { FONT_STYLE } from '../groups';
2
+
3
+ /**
4
+ * @name subsup_mark
5
+ */
6
+
2
7
  function getAttrFromVerticalAlign(node) {
3
8
  if (node.style.verticalAlign) {
4
9
  const type = node.style.verticalAlign.slice(0, 3);
@@ -1,6 +1,11 @@
1
1
  import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
2
2
  import { COLOR } from '../groups';
3
3
  import { rgbToHex, N0, N80, P50, P300, P500, T75, T300, T500, G75, G300, G500, R75, R300, R500, Y75, Y200, Y400, B75, B100, B500 } from '../../utils/colors';
4
+
5
+ /**
6
+ * @name textColor_mark
7
+ */
8
+
4
9
  // used for extended palette in text color picker
5
10
  const colorArrayPalette = [
6
11
  // default row - first color is added programatically
@@ -1,4 +1,13 @@
1
1
  import { getExtensionAttrs } from '../../utils/extensions';
2
+
3
+ /**
4
+ * @name bodiedExtension_node
5
+ */
6
+
7
+ /**
8
+ * @name bodiedExtension_with_marks_node
9
+ */
10
+
2
11
  const createBodiedExtensionNodeSpec = () => {
3
12
  const nodeSpec = {
4
13
  inline: false,
@@ -1,4 +1,17 @@
1
1
  import { Fragment } from 'prosemirror-model';
2
+
3
+ /**
4
+ * @name codeBlock_node
5
+ */
6
+
7
+ /**
8
+ * @name codeBlock_with_no_marks_node
9
+ */
10
+
11
+ /**
12
+ * @name codeBlock_with_marks_node
13
+ */
14
+
2
15
  const getLanguageFromEditorStyle = dom => {
3
16
  return dom.getAttribute('data-language') || undefined;
4
17
  };
@@ -1,4 +1,9 @@
1
1
  import { uuid } from '../../utils/uuid';
2
+
3
+ /**
4
+ * @name decisionItem_node
5
+ */
6
+
2
7
  export const decisionItem = {
3
8
  content: 'inline*',
4
9
  defining: true,
@@ -1,4 +1,13 @@
1
1
  import { getExtensionAttrs } from '../../utils/extensions';
2
+
3
+ /**
4
+ * @name extension_node
5
+ */
6
+
7
+ /**
8
+ * @name extension_with_marks_node
9
+ */
10
+
2
11
  const createExtensionNodeSpec = () => {
3
12
  const nodeSpec = {
4
13
  inline: false,
@@ -10,11 +10,9 @@
10
10
  /**
11
11
  * @name heading_with_alignment_node
12
12
  */
13
-
14
13
  /**
15
14
  * @name heading_with_indentation_node
16
15
  */
17
-
18
16
  export const heading = {
19
17
  attrs: {
20
18
  level: {
@@ -1,4 +1,13 @@
1
1
  import { getExtensionAttrs } from '../../utils/extensions';
2
+
3
+ /**
4
+ * @name inlineExtension_node
5
+ */
6
+
7
+ /**
8
+ * @name inlineExtension_with_marks_node
9
+ */
10
+
2
11
  const createInlineExtensionNodeSpec = () => {
3
12
  const nodeSpec = {
4
13
  inline: true,
@@ -5,16 +5,13 @@
5
5
  /**
6
6
  * Need duplicate `type` and `marks` to make both validator and json-schema satisfied
7
7
  */
8
-
9
8
  /**
10
9
  * @name layoutSection_full_node
11
10
  */
12
-
13
11
  /**
14
12
  * @stage 0
15
13
  * @name layoutSection_with_single_column_node
16
14
  */
17
-
18
15
  export const layoutSection = {
19
16
  content: '(layoutColumn | unsupportedBlock){1,3} unsupportedBlock* | unsupportedBlock+',
20
17
  marks: 'unsupportedMark unsupportedNodeAttribute',
@@ -2,12 +2,15 @@
2
2
  * @name mediaGroup_node
3
3
  */
4
4
 
5
+ // Temporary due to an existing issue in validator below:
6
+ // https://product-fabric.atlassian.net/jira/servicedesk/projects/DTR/queues/issue/DTR-1429
7
+ // TODO: Remove border and link marks from white list
5
8
  export const mediaGroup = {
6
9
  inline: false,
7
10
  group: 'block',
8
11
  content: '(media|unsupportedBlock)+',
9
12
  attrs: {},
10
- marks: 'unsupportedMark unsupportedNodeAttribute',
13
+ marks: 'unsupportedMark unsupportedNodeAttribute border link',
11
14
  selectable: false,
12
15
  parseDOM: [{
13
16
  tag: 'div[data-node-type="mediaGroup"]'
@@ -1,2 +1,7 @@
1
1
  import { createMediaSpec, defaultAttrs } from './media';
2
+
3
+ /**
4
+ * @name mediaInline_node
5
+ */
6
+
2
7
  export const mediaInline = createMediaSpec(defaultAttrs, true);
@@ -35,7 +35,7 @@ export const mediaSingle = {
35
35
  atom: true,
36
36
  content: 'media|unsupportedBlock+|media unsupportedBlock+',
37
37
  attrs: defaultAttrs,
38
- marks: 'unsupportedMark unsupportedNodeAttribute link',
38
+ marks: 'unsupportedMark unsupportedNodeAttribute border link',
39
39
  parseDOM: [{
40
40
  tag: 'div[data-node-type="mediaSingle"]',
41
41
  getAttrs: dom => ({
@@ -1,4 +1,9 @@
1
1
  import { N30 } from '../../utils/colors';
2
+
3
+ /**
4
+ * @name media_node
5
+ */
6
+
2
7
  export const defaultAttrs = {
3
8
  id: {
4
9
  default: ''
@@ -4,6 +4,9 @@ export let 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 const mention = {
8
11
  inline: true,
9
12
  group: 'inline',
@@ -8,6 +8,9 @@ export let PanelType;
8
8
  PanelType["SUCCESS"] = "success";
9
9
  PanelType["CUSTOM"] = "custom";
10
10
  })(PanelType || (PanelType = {}));
11
+ /**
12
+ * @name panel_node
13
+ */
11
14
  const getDefaultAttrs = () => {
12
15
  let attrs = {
13
16
  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
  const isImageNode = node => {
27
24
  return Boolean(node && node.nodeName.toLowerCase() === 'img');
28
25
  };