@atlaskit/adf-schema 25.4.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.
Files changed (112) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/schema/jira-schema.js +4 -0
  3. package/dist/cjs/schema/marks/alignment.js +4 -0
  4. package/dist/cjs/schema/marks/annotation.js +8 -8
  5. package/dist/cjs/schema/marks/border.js +6 -0
  6. package/dist/cjs/schema/marks/breakout.js +5 -0
  7. package/dist/cjs/schema/marks/code.js +4 -0
  8. package/dist/cjs/schema/marks/data-consumer.js +17 -0
  9. package/dist/cjs/schema/marks/em.js +4 -0
  10. package/dist/cjs/schema/marks/fragment.js +6 -0
  11. package/dist/cjs/schema/marks/indentation.js +4 -0
  12. package/dist/cjs/schema/marks/link.js +4 -0
  13. package/dist/cjs/schema/marks/strike.js +4 -0
  14. package/dist/cjs/schema/marks/strong.js +4 -0
  15. package/dist/cjs/schema/marks/subsup.js +4 -0
  16. package/dist/cjs/schema/marks/text-color.js +4 -0
  17. package/dist/cjs/schema/marks/underline.js +4 -0
  18. package/dist/cjs/schema/nodes/bodied-extension.js +8 -0
  19. package/dist/cjs/schema/nodes/code-block.js +12 -0
  20. package/dist/cjs/schema/nodes/decision-item.js +4 -0
  21. package/dist/cjs/schema/nodes/decision-list.js +4 -0
  22. package/dist/cjs/schema/nodes/emoji.js +4 -0
  23. package/dist/cjs/schema/nodes/extension.js +8 -0
  24. package/dist/cjs/schema/nodes/inline-extension.js +8 -0
  25. package/dist/cjs/schema/nodes/media-inline.js +4 -0
  26. package/dist/cjs/schema/nodes/media.js +4 -0
  27. package/dist/cjs/schema/nodes/mention.js +7 -4
  28. package/dist/cjs/schema/nodes/panel.js +7 -4
  29. package/dist/cjs/schema/nodes/paragraph.js +0 -3
  30. package/dist/cjs/schema/nodes/status.js +4 -0
  31. package/dist/cjs/schema/nodes/tableNodes.js +23 -0
  32. package/dist/cjs/schema/nodes/task-item.js +4 -0
  33. package/dist/cjs/schema/nodes/task-list.js +4 -0
  34. package/dist/cjs/steps/analytics.js +3 -3
  35. package/dist/cjs/steps/link-meta-step.js +112 -0
  36. package/dist/cjs/steps/table/add-column.js +1 -1
  37. package/dist/cjs/steps/table/constants.js +4 -4
  38. package/dist/cjs/steps/table/utils/cells-at-column.js +48 -50
  39. package/dist/cjs/steps/table/utils/side-effects/rows.js +1 -1
  40. package/dist/cjs/steps/type-ahead.js +4 -4
  41. package/dist/cjs/steps.js +8 -1
  42. package/dist/cjs/version.json +1 -1
  43. package/dist/es2019/schema/jira-schema.js +5 -0
  44. package/dist/es2019/schema/marks/alignment.js +5 -0
  45. package/dist/es2019/schema/marks/annotation.js +6 -6
  46. package/dist/es2019/schema/marks/border.js +7 -0
  47. package/dist/es2019/schema/marks/breakout.js +5 -0
  48. package/dist/es2019/schema/marks/data-consumer.js +6 -0
  49. package/dist/es2019/schema/marks/fragment.js +7 -0
  50. package/dist/es2019/schema/marks/indentation.js +5 -0
  51. package/dist/es2019/schema/marks/link.js +5 -0
  52. package/dist/es2019/schema/marks/subsup.js +5 -0
  53. package/dist/es2019/schema/marks/text-color.js +5 -0
  54. package/dist/es2019/schema/nodes/bodied-extension.js +9 -0
  55. package/dist/es2019/schema/nodes/code-block.js +13 -0
  56. package/dist/es2019/schema/nodes/decision-item.js +5 -0
  57. package/dist/es2019/schema/nodes/extension.js +9 -0
  58. package/dist/es2019/schema/nodes/heading.js +0 -2
  59. package/dist/es2019/schema/nodes/inline-extension.js +9 -0
  60. package/dist/es2019/schema/nodes/layout-section.js +0 -3
  61. package/dist/es2019/schema/nodes/media-inline.js +5 -0
  62. package/dist/es2019/schema/nodes/media.js +5 -0
  63. package/dist/es2019/schema/nodes/mention.js +8 -3
  64. package/dist/es2019/schema/nodes/panel.js +8 -3
  65. package/dist/es2019/schema/nodes/paragraph.js +0 -3
  66. package/dist/es2019/schema/nodes/tableNodes.js +23 -0
  67. package/dist/es2019/schema/nodes/task-item.js +5 -0
  68. package/dist/es2019/schema/nodes/task-list.js +5 -0
  69. package/dist/es2019/steps/analytics.js +3 -3
  70. package/dist/es2019/steps/link-meta-step.js +71 -0
  71. package/dist/es2019/steps/table/constants.js +3 -3
  72. package/dist/es2019/steps/type-ahead.js +3 -3
  73. package/dist/es2019/steps.js +2 -1
  74. package/dist/es2019/version.json +1 -1
  75. package/dist/esm/schema/jira-schema.js +5 -0
  76. package/dist/esm/schema/marks/alignment.js +5 -0
  77. package/dist/esm/schema/marks/annotation.js +6 -6
  78. package/dist/esm/schema/marks/border.js +7 -0
  79. package/dist/esm/schema/marks/breakout.js +5 -0
  80. package/dist/esm/schema/marks/data-consumer.js +6 -0
  81. package/dist/esm/schema/marks/fragment.js +7 -0
  82. package/dist/esm/schema/marks/indentation.js +5 -0
  83. package/dist/esm/schema/marks/link.js +5 -0
  84. package/dist/esm/schema/marks/subsup.js +5 -0
  85. package/dist/esm/schema/marks/text-color.js +5 -0
  86. package/dist/esm/schema/nodes/bodied-extension.js +9 -0
  87. package/dist/esm/schema/nodes/code-block.js +13 -0
  88. package/dist/esm/schema/nodes/decision-item.js +5 -0
  89. package/dist/esm/schema/nodes/extension.js +9 -0
  90. package/dist/esm/schema/nodes/heading.js +0 -2
  91. package/dist/esm/schema/nodes/inline-extension.js +9 -0
  92. package/dist/esm/schema/nodes/layout-section.js +0 -3
  93. package/dist/esm/schema/nodes/media-inline.js +5 -0
  94. package/dist/esm/schema/nodes/media.js +5 -0
  95. package/dist/esm/schema/nodes/mention.js +8 -3
  96. package/dist/esm/schema/nodes/panel.js +8 -3
  97. package/dist/esm/schema/nodes/paragraph.js +0 -3
  98. package/dist/esm/schema/nodes/tableNodes.js +23 -0
  99. package/dist/esm/schema/nodes/task-item.js +5 -0
  100. package/dist/esm/schema/nodes/task-list.js +5 -0
  101. package/dist/esm/steps/analytics.js +3 -3
  102. package/dist/esm/steps/link-meta-step.js +103 -0
  103. package/dist/esm/steps/table/add-column.js +1 -1
  104. package/dist/esm/steps/table/constants.js +3 -3
  105. package/dist/esm/steps/table/utils/cells-at-column.js +48 -50
  106. package/dist/esm/steps/table/utils/side-effects/rows.js +1 -1
  107. package/dist/esm/steps/type-ahead.js +3 -3
  108. package/dist/esm/steps.js +2 -1
  109. package/dist/esm/version.json +1 -1
  110. package/dist/types/steps/link-meta-step.d.ts +51 -0
  111. package/dist/types/steps.d.ts +2 -0
  112. package/package.json +2 -2
@@ -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
- })(SortOrder || (exports.SortOrder = SortOrder = {}));
10
+ return SortOrder;
11
+ }({});
12
+ exports.SortOrder = SortOrder;
@@ -19,57 +19,55 @@ var _marked = /*#__PURE__*/_regenerator.default.mark(cellsAtColumn);
19
19
  function cellsAtColumn(rect, col) {
20
20
  var map, tableStart, table, refColumn, row, index, pos, hasMergedCells, type, cell, cellInfo, skippedRows;
21
21
  return _regenerator.default.wrap(function cellsAtColumn$(_context) {
22
- while (1) {
23
- switch (_context.prev = _context.next) {
24
- case 0:
25
- map = rect.map, tableStart = rect.tableStart, table = rect.table;
26
- refColumn = col > 0 ? -1 : 0;
27
- if ((0, _utils.columnIsHeader)(map, table, col + refColumn)) {
28
- refColumn = col === 0 || col === map.width ? null : 0;
29
- }
30
- row = 0;
31
- case 4:
32
- if (!(row < map.height)) {
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;
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
- case 20:
70
- case "end":
71
- return _context.stop();
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++) { arr2[i] = arr[i]; } return arr2; }
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
- })(InsertTypeAheadStages || (exports.InsertTypeAheadStages = InsertTypeAheadStages = {}));
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/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");
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "25.4.0",
3
+ "version": "25.5.1",
4
4
  "sideEffects": false
5
5
  }
@@ -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,
@@ -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
- })(AnnotationTypes || (AnnotationTypes = {}));
9
- export let AnnotationMarkStates;
10
- (function (AnnotationMarkStates) {
7
+ return AnnotationTypes;
8
+ }({});
9
+ export let AnnotationMarkStates = /*#__PURE__*/function (AnnotationMarkStates) {
11
10
  AnnotationMarkStates["RESOLVED"] = "resolved";
12
11
  AnnotationMarkStates["ACTIVE"] = "active";
13
- })(AnnotationMarkStates || (AnnotationMarkStates = {}));
12
+ return AnnotationMarkStates;
13
+ }({});
14
14
  export function buildDataAttributes({
15
15
  id,
16
16
  annotationType,
@@ -1,5 +1,12 @@
1
1
  import { hexToEditorBorderPaletteColor } from '@atlaskit/editor-palette';
2
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
+
3
10
  const borderColorArrayPalette = [[N300A, 'Subtle gray'], [N600, 'Gray'], [N1000, 'Bold gray']];
4
11
  export const borderColorPalette = new Map();
5
12
  borderColorArrayPalette.forEach(([color, label]) => borderColorPalette.set(color.toLowerCase(), label));
@@ -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,
@@ -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',
@@ -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);
@@ -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: ''
@@ -1,9 +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
- })(USER_TYPES || (USER_TYPES = {}));
5
+ return USER_TYPES;
6
+ }({});
7
+
8
+ /**
9
+ * @name mention_node
10
+ */
11
+
7
12
  export const mention = {
8
13
  inline: true,
9
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,7 +6,13 @@ export let PanelType;
7
6
  PanelType["ERROR"] = "error";
8
7
  PanelType["SUCCESS"] = "success";
9
8
  PanelType["CUSTOM"] = "custom";
10
- })(PanelType || (PanelType = {}));
9
+ return PanelType;
10
+ }({});
11
+
12
+ /**
13
+ * @name panel_node
14
+ */
15
+
11
16
  const getDefaultAttrs = () => {
12
17
  let attrs = {
13
18
  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
  };
@@ -114,6 +114,29 @@ export const tableBackgroundColorNames = new Map();
114
114
  tableBackgroundColorPalette.set(colorValue.toLowerCase(), colorName);
115
115
  tableBackgroundColorNames.set(colorName.toLowerCase(), colorValue.toLowerCase());
116
116
  });
117
+
118
+ /**
119
+ * @name table_node
120
+ */
121
+
122
+ /**
123
+ * @name table_row_node
124
+ */
125
+
126
+ /**
127
+ * @name table_cell_content
128
+ * @minItems 1
129
+ * @allowUnsupportedBlock true
130
+ */
131
+
132
+ /**
133
+ * @name table_cell_node
134
+ */
135
+
136
+ /**
137
+ * @name table_header_node
138
+ */
139
+
117
140
  // TODO: Fix any, potential issue. ED-5048
118
141
  const createTableSpec = () => {
119
142
  const attrs = {
@@ -1,4 +1,9 @@
1
1
  import { uuid } from '../../utils/uuid';
2
+
3
+ /**
4
+ * @name taskItem_node
5
+ */
6
+
2
7
  export const taskItem = {
3
8
  content: 'inline*',
4
9
  defining: true,
@@ -1,4 +1,9 @@
1
1
  import { uuid } from '../../utils/uuid';
2
+
3
+ /**
4
+ * @name taskList_node
5
+ */
6
+
2
7
  const name = 'actionList';
3
8
  export const taskListSelector = `[data-node-type="${name}"]`;
4
9
  export const taskList = {
@@ -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
- })(HISTORY_ACTIONS || (HISTORY_ACTIONS = {}));
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;
@@ -0,0 +1,71 @@
1
+ import { Slice } from 'prosemirror-model';
2
+ import { ReplaceStep, Step, StepMap, StepResult } from 'prosemirror-transform';
3
+ export const stepType = 'editor-linking-meta';
4
+ export const invertStepType = 'editor-linking-meta-invert';
5
+ /**
6
+ * Custom Prosemirror Step to attach metadata about user interactions with links
7
+ * Using a Step means that it will work with prosemirror-history and we get utilise when
8
+ * firing events on history change
9
+ */
10
+ export class LinkMetaStep extends Step {
11
+ constructor(pos, metadata, isInverted = false) {
12
+ super();
13
+ this.pos = pos;
14
+ this.metadata = metadata;
15
+ this.isInverted = isInverted;
16
+ }
17
+ getMetadata() {
18
+ return this.metadata;
19
+ }
20
+
21
+ /**
22
+ * Generate new undo/redo analytics event when step is inverted
23
+ */
24
+ invert() {
25
+ /**
26
+ * Omit sourceEvent in history
27
+ */
28
+ const {
29
+ sourceEvent,
30
+ ...metadata
31
+ } = this.metadata;
32
+ return new LinkMetaStep(this.pos, metadata, true);
33
+ }
34
+
35
+ // Should make no modifications to the doc
36
+ apply(doc) {
37
+ return StepResult.ok(doc);
38
+ }
39
+ map(mapping) {
40
+ let newPos = this.pos;
41
+ if (typeof newPos === 'number') {
42
+ newPos = mapping.map(newPos);
43
+ }
44
+ // Return the same events, this step will never be removed
45
+ return new LinkMetaStep(newPos, this.metadata, this.isInverted);
46
+ }
47
+ getMap() {
48
+ return new StepMap([this.pos || 0, 0, 0]);
49
+ }
50
+
51
+ // Return null to avoid merging events
52
+ merge() {
53
+ return null;
54
+ }
55
+ toJSON() {
56
+ // When serialized we should create a noop Replace step
57
+ return {
58
+ stepType: 'replace',
59
+ from: 0,
60
+ to: 0
61
+ };
62
+ }
63
+ static fromJSON(_, __) {
64
+ // This is a "local custom step" once serialized
65
+ // we need to transform it in a no-operation action
66
+ return new ReplaceStep(0, 0, Slice.empty);
67
+ }
68
+ }
69
+
70
+ /** Register this step with Prosemirror */
71
+ Step.jsonID(stepType, LinkMetaStep);
@@ -1,5 +1,5 @@
1
- export let SortOrder;
2
- (function (SortOrder) {
1
+ export let SortOrder = /*#__PURE__*/function (SortOrder) {
3
2
  SortOrder["ASC"] = "asc";
4
3
  SortOrder["DESC"] = "desc";
5
- })(SortOrder || (SortOrder = {}));
4
+ return SortOrder;
5
+ }({});