@atlaskit/adf-schema 25.1.0 → 25.2.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 (249) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/index.js +0 -2
  3. package/dist/cjs/json-schema/index.js +0 -3
  4. package/dist/cjs/schema/bitbucket-schema.js +0 -2
  5. package/dist/cjs/schema/confluence-schema.js +1 -4
  6. package/dist/cjs/schema/create-schema.js +12 -38
  7. package/dist/cjs/schema/default-schema.js +3 -16
  8. package/dist/cjs/schema/groups.js +13 -6
  9. package/dist/cjs/schema/index.js +0 -5
  10. package/dist/cjs/schema/inline-nodes.js +0 -5
  11. package/dist/cjs/schema/jira-schema.js +0 -36
  12. package/dist/cjs/schema/marks/alignment.js +0 -2
  13. package/dist/cjs/schema/marks/annotation.js +2 -14
  14. package/dist/cjs/schema/marks/code.js +0 -5
  15. package/dist/cjs/schema/marks/confluence-inline-comment.js +1 -1
  16. package/dist/cjs/schema/marks/data-consumer.js +2 -7
  17. package/dist/cjs/schema/marks/em.js +0 -2
  18. package/dist/cjs/schema/marks/fragment.js +0 -13
  19. package/dist/cjs/schema/marks/indentation.js +0 -2
  20. package/dist/cjs/schema/marks/index.js +0 -18
  21. package/dist/cjs/schema/marks/link.js +0 -17
  22. package/dist/cjs/schema/marks/strike.js +0 -2
  23. package/dist/cjs/schema/marks/strong.js +2 -3
  24. package/dist/cjs/schema/marks/subsup.js +0 -5
  25. package/dist/cjs/schema/marks/text-color.js +46 -37
  26. package/dist/cjs/schema/marks/type-ahead-query.js +0 -3
  27. package/dist/cjs/schema/marks/underline.js +0 -2
  28. package/dist/cjs/schema/nodes/block-card.js +1 -2
  29. package/dist/cjs/schema/nodes/blockquote.js +1 -1
  30. package/dist/cjs/schema/nodes/bodied-extension.js +0 -3
  31. package/dist/cjs/schema/nodes/caption.js +1 -1
  32. package/dist/cjs/schema/nodes/code-block.js +11 -29
  33. package/dist/cjs/schema/nodes/date.js +1 -1
  34. package/dist/cjs/schema/nodes/decision-item.js +2 -4
  35. package/dist/cjs/schema/nodes/decision-list.js +0 -2
  36. package/dist/cjs/schema/nodes/doc.js +1 -1
  37. package/dist/cjs/schema/nodes/embed-card.js +6 -6
  38. package/dist/cjs/schema/nodes/emoji.js +11 -9
  39. package/dist/cjs/schema/nodes/expand.js +1 -4
  40. package/dist/cjs/schema/nodes/extension.js +0 -3
  41. package/dist/cjs/schema/nodes/hard-break.js +1 -1
  42. package/dist/cjs/schema/nodes/heading.js +2 -2
  43. package/dist/cjs/schema/nodes/index.js +0 -45
  44. package/dist/cjs/schema/nodes/inline-card.js +4 -4
  45. package/dist/cjs/schema/nodes/inline-extension.js +0 -3
  46. package/dist/cjs/schema/nodes/layout-column.js +4 -5
  47. package/dist/cjs/schema/nodes/layout-section.js +1 -1
  48. package/dist/cjs/schema/nodes/media-group.js +1 -1
  49. package/dist/cjs/schema/nodes/media-inline.js +0 -2
  50. package/dist/cjs/schema/nodes/media-single.js +3 -14
  51. package/dist/cjs/schema/nodes/media.js +10 -28
  52. package/dist/cjs/schema/nodes/mention.js +4 -14
  53. package/dist/cjs/schema/nodes/nested-expand.js +1 -1
  54. package/dist/cjs/schema/nodes/ordered-list.js +3 -17
  55. package/dist/cjs/schema/nodes/panel.js +1 -13
  56. package/dist/cjs/schema/nodes/paragraph.js +1 -6
  57. package/dist/cjs/schema/nodes/placeholder.js +1 -1
  58. package/dist/cjs/schema/nodes/rule.js +1 -1
  59. package/dist/cjs/schema/nodes/status.js +4 -6
  60. package/dist/cjs/schema/nodes/tableNodes.js +12 -39
  61. package/dist/cjs/schema/nodes/task-item.js +2 -4
  62. package/dist/cjs/schema/nodes/task-list.js +0 -2
  63. package/dist/cjs/schema/nodes/text.js +1 -1
  64. package/dist/cjs/steps/analytics.js +4 -38
  65. package/dist/cjs/steps/set-attrs.js +0 -26
  66. package/dist/cjs/steps/table/add-column.js +33 -105
  67. package/dist/cjs/steps/table/constants.js +0 -1
  68. package/dist/cjs/steps/table/sort-column.js +0 -19
  69. package/dist/cjs/steps/table/utils/cell-step.js +18 -49
  70. package/dist/cjs/steps/table/utils/cells-at-column.js +2 -21
  71. package/dist/cjs/steps/table/utils/find-column.js +13 -17
  72. package/dist/cjs/steps/table/utils/get-table-rect-from-doc.js +6 -8
  73. package/dist/cjs/steps/table/utils/side-effects/rows.js +23 -78
  74. package/dist/cjs/steps/table/utils/side-effects/side-effects.js +0 -23
  75. package/dist/cjs/steps/table/utils/side-effects/table.js +2 -18
  76. package/dist/cjs/steps/table/utils/table-map.js +0 -6
  77. package/dist/cjs/steps/type-ahead.js +5 -25
  78. package/dist/cjs/steps.js +0 -6
  79. package/dist/cjs/utils/colors.js +13 -36
  80. package/dist/cjs/utils/confluence/emoji.js +6 -13
  81. package/dist/cjs/utils/extensions.js +0 -8
  82. package/dist/cjs/utils/index.js +0 -4
  83. package/dist/cjs/utils/parseDOM.js +0 -2
  84. package/dist/cjs/utils/url.js +3 -20
  85. package/dist/cjs/utils/uuid.js +0 -3
  86. package/dist/cjs/version.json +1 -1
  87. package/dist/es2019/index.js +1 -2
  88. package/dist/es2019/schema/bitbucket-schema.js +1 -1
  89. package/dist/es2019/schema/confluence-schema.js +1 -2
  90. package/dist/es2019/schema/create-schema.js +12 -25
  91. package/dist/es2019/schema/default-schema.js +3 -11
  92. package/dist/es2019/schema/groups.js +13 -6
  93. package/dist/es2019/schema/index.js +1 -2
  94. package/dist/es2019/schema/jira-schema.js +0 -24
  95. package/dist/es2019/schema/marks/alignment.js +1 -3
  96. package/dist/es2019/schema/marks/annotation.js +3 -9
  97. package/dist/es2019/schema/marks/breakout.js +0 -4
  98. package/dist/es2019/schema/marks/code.js +1 -5
  99. package/dist/es2019/schema/marks/confluence-inline-comment.js +1 -2
  100. package/dist/es2019/schema/marks/data-consumer.js +3 -5
  101. package/dist/es2019/schema/marks/em.js +1 -2
  102. package/dist/es2019/schema/marks/fragment.js +0 -8
  103. package/dist/es2019/schema/marks/indentation.js +0 -4
  104. package/dist/es2019/schema/marks/link.js +2 -11
  105. package/dist/es2019/schema/marks/strike.js +1 -2
  106. package/dist/es2019/schema/marks/strong.js +3 -7
  107. package/dist/es2019/schema/marks/subsup.js +0 -6
  108. package/dist/es2019/schema/marks/text-color.js +44 -29
  109. package/dist/es2019/schema/marks/type-ahead-query.js +0 -2
  110. package/dist/es2019/schema/marks/underline.js +1 -2
  111. package/dist/es2019/schema/marks/unsupported-mark.js +0 -1
  112. package/dist/es2019/schema/marks/unsupported-node-attributes.js +0 -1
  113. package/dist/es2019/schema/nodes/block-card.js +1 -3
  114. package/dist/es2019/schema/nodes/blockquote.js +1 -2
  115. package/dist/es2019/schema/nodes/bodied-extension.js +0 -4
  116. package/dist/es2019/schema/nodes/bullet-list.js +0 -2
  117. package/dist/es2019/schema/nodes/caption.js +1 -2
  118. package/dist/es2019/schema/nodes/code-block.js +11 -28
  119. package/dist/es2019/schema/nodes/confluence-jira-issue.js +0 -2
  120. package/dist/es2019/schema/nodes/confluence-unsupported-block.js +0 -4
  121. package/dist/es2019/schema/nodes/confluence-unsupported-inline.js +0 -4
  122. package/dist/es2019/schema/nodes/date.js +1 -2
  123. package/dist/es2019/schema/nodes/decision-item.js +0 -2
  124. package/dist/es2019/schema/nodes/decision-list.js +1 -2
  125. package/dist/es2019/schema/nodes/doc.js +1 -0
  126. package/dist/es2019/schema/nodes/embed-card.js +1 -2
  127. package/dist/es2019/schema/nodes/emoji.js +9 -6
  128. package/dist/es2019/schema/nodes/expand.js +1 -3
  129. package/dist/es2019/schema/nodes/extension.js +0 -4
  130. package/dist/es2019/schema/nodes/hard-break.js +1 -2
  131. package/dist/es2019/schema/nodes/heading.js +2 -3
  132. package/dist/es2019/schema/nodes/image.js +0 -4
  133. package/dist/es2019/schema/nodes/inline-card.js +4 -5
  134. package/dist/es2019/schema/nodes/inline-extension.js +0 -4
  135. package/dist/es2019/schema/nodes/layout-column.js +4 -6
  136. package/dist/es2019/schema/nodes/layout-section.js +1 -4
  137. package/dist/es2019/schema/nodes/list-item.js +0 -2
  138. package/dist/es2019/schema/nodes/media-group.js +1 -2
  139. package/dist/es2019/schema/nodes/media-single.js +3 -6
  140. package/dist/es2019/schema/nodes/media.js +10 -20
  141. package/dist/es2019/schema/nodes/mention.js +0 -11
  142. package/dist/es2019/schema/nodes/nested-expand.js +1 -2
  143. package/dist/es2019/schema/nodes/ordered-list.js +4 -14
  144. package/dist/es2019/schema/nodes/panel.js +3 -10
  145. package/dist/es2019/schema/nodes/paragraph.js +1 -7
  146. package/dist/es2019/schema/nodes/placeholder.js +1 -2
  147. package/dist/es2019/schema/nodes/rule.js +1 -2
  148. package/dist/es2019/schema/nodes/status.js +1 -2
  149. package/dist/es2019/schema/nodes/tableNodes.js +10 -26
  150. package/dist/es2019/schema/nodes/task-item.js +0 -2
  151. package/dist/es2019/schema/nodes/task-list.js +0 -2
  152. package/dist/es2019/schema/nodes/text.js +1 -0
  153. package/dist/es2019/schema/nodes/unknown-block.js +0 -2
  154. package/dist/es2019/schema/nodes/unsupported-block.js +0 -2
  155. package/dist/es2019/schema/nodes/unsupported-inline.js +0 -2
  156. package/dist/es2019/steps/analytics.js +13 -30
  157. package/dist/es2019/steps/set-attrs.js +3 -12
  158. package/dist/es2019/steps/table/add-column.js +33 -76
  159. package/dist/es2019/steps/table/constants.js +0 -1
  160. package/dist/es2019/steps/table/sort-column.js +1 -8
  161. package/dist/es2019/steps/table/utils/cell-step.js +15 -32
  162. package/dist/es2019/steps/table/utils/cells-at-column.js +6 -11
  163. package/dist/es2019/steps/table/utils/find-column.js +12 -15
  164. package/dist/es2019/steps/table/utils/get-table-rect-from-doc.js +7 -6
  165. package/dist/es2019/steps/table/utils/side-effects/rows.js +19 -59
  166. package/dist/es2019/steps/table/utils/side-effects/side-effects.js +0 -21
  167. package/dist/es2019/steps/table/utils/side-effects/table.js +0 -17
  168. package/dist/es2019/steps/type-ahead.js +3 -15
  169. package/dist/es2019/utils/colors.js +8 -18
  170. package/dist/es2019/utils/confluence/emoji.js +5 -8
  171. package/dist/es2019/utils/extensions.js +0 -4
  172. package/dist/es2019/utils/url.js +2 -12
  173. package/dist/es2019/utils/uuid.js +0 -2
  174. package/dist/es2019/version.json +1 -1
  175. package/dist/esm/index.js +1 -2
  176. package/dist/esm/schema/bitbucket-schema.js +1 -1
  177. package/dist/esm/schema/confluence-schema.js +1 -2
  178. package/dist/esm/schema/create-schema.js +12 -31
  179. package/dist/esm/schema/default-schema.js +3 -11
  180. package/dist/esm/schema/groups.js +13 -6
  181. package/dist/esm/schema/index.js +1 -2
  182. package/dist/esm/schema/jira-schema.js +0 -24
  183. package/dist/esm/schema/marks/alignment.js +1 -1
  184. package/dist/esm/schema/marks/annotation.js +3 -11
  185. package/dist/esm/schema/marks/code.js +1 -3
  186. package/dist/esm/schema/marks/confluence-inline-comment.js +1 -0
  187. package/dist/esm/schema/marks/data-consumer.js +3 -3
  188. package/dist/esm/schema/marks/em.js +1 -0
  189. package/dist/esm/schema/marks/fragment.js +0 -9
  190. package/dist/esm/schema/marks/link.js +0 -12
  191. package/dist/esm/schema/marks/strike.js +1 -0
  192. package/dist/esm/schema/marks/strong.js +3 -1
  193. package/dist/esm/schema/marks/subsup.js +0 -4
  194. package/dist/esm/schema/marks/text-color.js +46 -30
  195. package/dist/esm/schema/marks/underline.js +1 -0
  196. package/dist/esm/schema/nodes/block-card.js +1 -1
  197. package/dist/esm/schema/nodes/blockquote.js +1 -0
  198. package/dist/esm/schema/nodes/bodied-extension.js +0 -2
  199. package/dist/esm/schema/nodes/caption.js +1 -0
  200. package/dist/esm/schema/nodes/code-block.js +11 -26
  201. package/dist/esm/schema/nodes/date.js +1 -0
  202. package/dist/esm/schema/nodes/decision-item.js +2 -2
  203. package/dist/esm/schema/nodes/decision-list.js +1 -0
  204. package/dist/esm/schema/nodes/doc.js +1 -0
  205. package/dist/esm/schema/nodes/embed-card.js +6 -5
  206. package/dist/esm/schema/nodes/emoji.js +12 -7
  207. package/dist/esm/schema/nodes/expand.js +1 -1
  208. package/dist/esm/schema/nodes/extension.js +0 -2
  209. package/dist/esm/schema/nodes/hard-break.js +1 -0
  210. package/dist/esm/schema/nodes/heading.js +2 -1
  211. package/dist/esm/schema/nodes/inline-card.js +4 -3
  212. package/dist/esm/schema/nodes/inline-extension.js +0 -2
  213. package/dist/esm/schema/nodes/layout-column.js +4 -4
  214. package/dist/esm/schema/nodes/layout-section.js +1 -0
  215. package/dist/esm/schema/nodes/media-group.js +1 -0
  216. package/dist/esm/schema/nodes/media-single.js +3 -8
  217. package/dist/esm/schema/nodes/media.js +10 -18
  218. package/dist/esm/schema/nodes/mention.js +4 -13
  219. package/dist/esm/schema/nodes/nested-expand.js +1 -0
  220. package/dist/esm/schema/nodes/ordered-list.js +3 -13
  221. package/dist/esm/schema/nodes/panel.js +1 -10
  222. package/dist/esm/schema/nodes/paragraph.js +1 -5
  223. package/dist/esm/schema/nodes/placeholder.js +1 -0
  224. package/dist/esm/schema/nodes/rule.js +1 -0
  225. package/dist/esm/schema/nodes/status.js +5 -4
  226. package/dist/esm/schema/nodes/tableNodes.js +12 -25
  227. package/dist/esm/schema/nodes/task-item.js +2 -2
  228. package/dist/esm/schema/nodes/text.js +1 -0
  229. package/dist/esm/steps/analytics.js +5 -31
  230. package/dist/esm/steps/set-attrs.js +1 -17
  231. package/dist/esm/steps/table/add-column.js +33 -91
  232. package/dist/esm/steps/table/constants.js +0 -1
  233. package/dist/esm/steps/table/sort-column.js +1 -10
  234. package/dist/esm/steps/table/utils/cell-step.js +18 -42
  235. package/dist/esm/steps/table/utils/cells-at-column.js +2 -18
  236. package/dist/esm/steps/table/utils/find-column.js +13 -16
  237. package/dist/esm/steps/table/utils/get-table-rect-from-doc.js +7 -6
  238. package/dist/esm/steps/table/utils/side-effects/rows.js +23 -76
  239. package/dist/esm/steps/table/utils/side-effects/side-effects.js +0 -18
  240. package/dist/esm/steps/table/utils/side-effects/table.js +2 -13
  241. package/dist/esm/steps/type-ahead.js +6 -18
  242. package/dist/esm/utils/colors.js +12 -23
  243. package/dist/esm/utils/confluence/emoji.js +6 -10
  244. package/dist/esm/utils/extensions.js +0 -4
  245. package/dist/esm/utils/url.js +2 -12
  246. package/dist/esm/version.json +1 -1
  247. package/dist/types/schema/default-schema.d.ts +1 -1
  248. package/dist/types/utils/colors.d.ts +1 -1
  249. package/package.json +2 -2
@@ -1,41 +1,33 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
-
3
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; }
4
-
5
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; }
6
-
7
4
  /**
8
5
  * @name annotation_mark
9
6
  */
10
- export var AnnotationTypes;
11
7
 
8
+ export var AnnotationTypes;
12
9
  (function (AnnotationTypes) {
13
10
  AnnotationTypes["INLINE_COMMENT"] = "inlineComment";
14
11
  })(AnnotationTypes || (AnnotationTypes = {}));
15
-
16
12
  export var AnnotationMarkStates;
17
-
18
13
  (function (AnnotationMarkStates) {
19
14
  AnnotationMarkStates["RESOLVED"] = "resolved";
20
15
  AnnotationMarkStates["ACTIVE"] = "active";
21
16
  })(AnnotationMarkStates || (AnnotationMarkStates = {}));
22
-
23
17
  export function buildDataAttributes(_ref) {
24
18
  var id = _ref.id,
25
- annotationType = _ref.annotationType,
26
- state = _ref.state;
19
+ annotationType = _ref.annotationType,
20
+ state = _ref.state;
27
21
  var data = {
28
22
  'data-mark-type': 'annotation',
29
23
  'data-mark-annotation-type': annotationType,
30
24
  'data-id': id
31
25
  };
32
-
33
26
  if (state) {
34
27
  return _objectSpread(_objectSpread({}, data), {}, {
35
28
  'data-mark-annotation-state': state
36
29
  });
37
30
  }
38
-
39
31
  return data;
40
32
  }
41
33
  export var annotation = {
@@ -1,4 +1,5 @@
1
1
  import { COLOR, FONT_STYLE, LINK, SEARCH_QUERY } from '../groups';
2
+
2
3
  /**
3
4
  * @name code_mark
4
5
  */
@@ -20,15 +21,12 @@ export var code = {
20
21
  preserveWhitespace: true,
21
22
  getAttrs: function getAttrs(domNode) {
22
23
  var dom = domNode;
23
-
24
24
  if (dom.style.whiteSpace === 'pre') {
25
25
  return {};
26
26
  }
27
-
28
27
  if (dom.style.fontFamily && dom.style.fontFamily.toLowerCase().indexOf('monospace') >= 0) {
29
28
  return {};
30
29
  }
31
-
32
30
  return false;
33
31
  }
34
32
  }],
@@ -2,6 +2,7 @@
2
2
  * @name inline_comment_marker
3
3
  * @description This temporary mark represents a Confluence-backed inline comment that wraps a piece of text. It will be replaced with a cross-product inline comment solution at later date.
4
4
  */
5
+
5
6
  export var confluenceInlineComment = {
6
7
  inclusive: false,
7
8
  excludes: '',
@@ -1,4 +1,5 @@
1
1
  import { isDOMElement } from '../../utils/parseDOM';
2
+
2
3
  /**
3
4
  * This annotation is purely for reference, & does _nothing_ given annotating
4
5
  * `minLength` on an array of strings is not supported with our schema+spec
@@ -12,7 +13,6 @@ import { isDOMElement } from '../../utils/parseDOM';
12
13
 
13
14
  var parseDataConsumer = function parseDataConsumer(maybeValue) {
14
15
  var sources = isDOMElement(maybeValue) && maybeValue.getAttribute('data-sources');
15
-
16
16
  try {
17
17
  return sources ? {
18
18
  sources: JSON.parse(sources)
@@ -21,7 +21,6 @@ var parseDataConsumer = function parseDataConsumer(maybeValue) {
21
21
  return false;
22
22
  }
23
23
  };
24
-
25
24
  export var dataConsumer = {
26
25
  attrs: {
27
26
  sources: {
@@ -42,6 +41,7 @@ export var dataConsumer = {
42
41
  }];
43
42
  }
44
43
  };
44
+
45
45
  /**
46
46
  * We want to ensure any "invalid ADF" doesn't get serialised, but the entire
47
47
  * mark itself is not valid without a non-empty `sources`.
@@ -52,12 +52,12 @@ export var dataConsumer = {
52
52
  * So we'll leave any extra transformation checks in
53
53
  * `editor-json-transformer`(?)
54
54
  */
55
-
56
55
  export var toJSON = function toJSON(mark) {
57
56
  // // Remove intemediary state if we don't have any sources on data consumer
58
57
  // if (mark.attrs?.sources?.length < 1) {
59
58
  // return null;
60
59
  // }
60
+
61
61
  return {
62
62
  type: mark.type.name,
63
63
  attrs: Object.keys(mark.attrs).filter(function (key) {
@@ -1,4 +1,5 @@
1
1
  import { FONT_STYLE } from '../groups';
2
+
2
3
  /**
3
4
  * @name em_mark
4
5
  */
@@ -1,31 +1,22 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
-
3
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; }
4
-
5
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; }
6
-
7
4
  import { isDOMElement } from '../../utils/parseDOM';
8
-
9
5
  var parseFragment = function parseFragment(maybeValue) {
10
6
  var _maybeValue$getAttrib;
11
-
12
7
  if (!isDOMElement(maybeValue)) {
13
8
  return false;
14
9
  }
15
-
16
10
  var name = (_maybeValue$getAttrib = maybeValue.getAttribute('data-name')) !== null && _maybeValue$getAttrib !== void 0 ? _maybeValue$getAttrib : undefined;
17
11
  var localId = maybeValue.getAttribute('data-localId');
18
-
19
12
  if (!localId) {
20
13
  return false;
21
14
  }
22
-
23
15
  return {
24
16
  localId: localId,
25
17
  name: name
26
18
  };
27
19
  };
28
-
29
20
  export var fragment = {
30
21
  inclusive: false,
31
22
  excludes: '',
@@ -1,12 +1,8 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
-
3
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; }
4
-
5
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; }
6
-
7
4
  import { LINK } from '../groups';
8
5
  import { isSafeUrl, normalizeUrl } from '../../utils/url';
9
-
10
6
  var getLinkAttrs = function getLinkAttrs(attribute) {
11
7
  return function (domNode) {
12
8
  var dom = domNode;
@@ -14,17 +10,14 @@ var getLinkAttrs = function getLinkAttrs(attribute) {
14
10
  var attrs = {
15
11
  __confluenceMetadata: dom.hasAttribute('__confluenceMetadata') ? JSON.parse(dom.getAttribute('__confluenceMetadata') || '') : undefined
16
12
  };
17
-
18
13
  if (isSafeUrl(href)) {
19
14
  attrs.href = normalizeUrl(href);
20
15
  } else {
21
16
  return false;
22
17
  }
23
-
24
18
  return attrs;
25
19
  };
26
20
  };
27
-
28
21
  export var link = {
29
22
  excludes: "".concat(LINK),
30
23
  // ED-5844 No multiple links in media node
@@ -53,7 +46,6 @@ export var link = {
53
46
  }],
54
47
  toDOM: function toDOM(node, isInline) {
55
48
  var _objectSpread2;
56
-
57
49
  var attrs = Object.keys(node.attrs).reduce(function (attrs, key) {
58
50
  if (key === '__confluenceMetadata') {
59
51
  if (node.attrs[key] !== null) {
@@ -64,14 +56,11 @@ export var link = {
64
56
  } else {
65
57
  attrs[key] = node.attrs[key];
66
58
  }
67
-
68
59
  return attrs;
69
60
  }, {});
70
-
71
61
  if (isInline) {
72
62
  return ['a', attrs];
73
63
  }
74
-
75
64
  return ['a', _objectSpread(_objectSpread({}, attrs), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, 'data-block-link', 'true'), _defineProperty(_objectSpread2, "class", 'blockLink'), _objectSpread2)), 0];
76
65
  }
77
66
  };
@@ -83,7 +72,6 @@ export var toJSON = function toJSON(mark) {
83
72
  if (OPTIONAL_ATTRS.indexOf(key) === -1 || mark.attrs[key] !== null) {
84
73
  attrs[key] = mark.attrs[key];
85
74
  }
86
-
87
75
  return attrs;
88
76
  }, {})
89
77
  };
@@ -1,4 +1,5 @@
1
1
  import { FONT_STYLE } from '../groups';
2
+
2
3
  /**
3
4
  * @name strike_mark
4
5
  */
@@ -1,4 +1,5 @@
1
1
  import { FONT_STYLE } from '../groups';
2
+
2
3
  /**
3
4
  * @name strong_mark
4
5
  */
@@ -9,7 +10,8 @@ export var strong = {
9
10
  group: FONT_STYLE,
10
11
  parseDOM: [{
11
12
  tag: 'strong'
12
- }, // This works around a Google Docs misbehavior where
13
+ },
14
+ // This works around a Google Docs misbehavior where
13
15
  // pasted content will be inexplicably wrapped in `<b>`
14
16
  // tags with a font-weight normal.
15
17
  {
@@ -1,19 +1,15 @@
1
1
  import { FONT_STYLE } from '../groups';
2
-
3
2
  function getAttrFromVerticalAlign(node) {
4
3
  if (node.style.verticalAlign) {
5
4
  var type = node.style.verticalAlign.slice(0, 3);
6
-
7
5
  if (type === 'sub' || type === 'sup') {
8
6
  return {
9
7
  type: type
10
8
  };
11
9
  }
12
10
  }
13
-
14
11
  return false;
15
12
  }
16
-
17
13
  export var subsup = {
18
14
  inclusive: true,
19
15
  group: FONT_STYLE,
@@ -4,40 +4,58 @@ import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
4
4
  import { COLOR } from '../groups';
5
5
  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';
6
6
  // used for extended palette in text color picker
7
- var colorArrayPalette = [// default row - first color is added programatically
7
+ var colorArrayPalette = [
8
+ // default row - first color is added programatically
8
9
  // [N800, 'Squid ink'], // default dark gray
9
- [B500, 'Dark blue'], // Chore coat
10
- [T500, 'Dark teal'], // Shabby chic
11
- [G500, 'Dark green'], // Keen green
12
- [Y400, 'Orange'], // Cheezy blasters
13
- [R500, 'Dark red'], // Dragon's blood
14
- [P500, 'Dark purple'], // Prince
10
+ [B500, 'Dark blue'],
11
+ // Chore coat
12
+ [T500, 'Dark teal'],
13
+ // Shabby chic
14
+ [G500, 'Dark green'],
15
+ // Keen green
16
+ [Y400, 'Orange'],
17
+ // Cheezy blasters
18
+ [R500, 'Dark red'],
19
+ // Dragon's blood
20
+ [P500, 'Dark purple'],
21
+ // Prince
15
22
  // row 2
16
- [N80, 'Light gray'], // Spooky ghost
17
- [B100, 'Blue'], // Arvo breeze
18
- [T300, 'Teal'], // Tamarama
19
- [G300, 'Green'], // Fine pine
20
- [Y200, 'Yellow'], // Pub mix
21
- [R300, 'Red'], // Poppy surprise
22
- [P300, 'Purple'], // Da' juice
23
+ [N80, 'Light gray'],
24
+ // Spooky ghost
25
+ [B100, 'Blue'],
26
+ // Arvo breeze
27
+ [T300, 'Teal'],
28
+ // Tamarama
29
+ [G300, 'Green'],
30
+ // Fine pine
31
+ [Y200, 'Yellow'],
32
+ // Pub mix
33
+ [R300, 'Red'],
34
+ // Poppy surprise
35
+ [P300, 'Purple'],
36
+ // Da' juice
23
37
  // row 3
24
- [N0, 'White'], [B75, 'Light blue'], // Schwag
25
- [T75, 'Light teal'], // Arctic chill
26
- [G75, 'Light green'], // Mintie
27
- [Y75, 'Light yellow'], // Dandelion whisper
28
- [R75, 'Light red'], // Bondi sunburn
38
+ [N0, 'White'], [B75, 'Light blue'],
39
+ // Schwag
40
+ [T75, 'Light teal'],
41
+ // Arctic chill
42
+ [G75, 'Light green'],
43
+ // Mintie
44
+ [Y75, 'Light yellow'],
45
+ // Dandelion whisper
46
+ [R75, 'Light red'],
47
+ // Bondi sunburn
29
48
  [P50, 'Light purple'] // Lavender secret
30
- ]; // @see https://product-fabric.atlassian.net/wiki/spaces/E/pages/55979455/Colour+picker+decisions#Colourpickerdecisions-Visualdesigndecisions
49
+ ];
31
50
 
51
+ // @see https://product-fabric.atlassian.net/wiki/spaces/E/pages/55979455/Colour+picker+decisions#Colourpickerdecisions-Visualdesigndecisions
32
52
  export var colorPalette = new Map();
33
53
  /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
34
-
35
54
  export var colorPaletteExtended = colorPalette;
36
55
  colorArrayPalette.forEach(function (_ref) {
37
56
  var _ref2 = _slicedToArray(_ref, 2),
38
- color = _ref2[0],
39
- label = _ref2[1];
40
-
57
+ color = _ref2[0],
58
+ label = _ref2[1];
41
59
  return colorPalette.set(color.toLowerCase(), label);
42
60
  });
43
61
  export var textColor = {
@@ -51,19 +69,18 @@ export var textColor = {
51
69
  getAttrs: function getAttrs(maybeValue) {
52
70
  var value = maybeValue;
53
71
  var hexColor;
54
-
55
72
  if (value.match(/^rgb/i)) {
56
73
  hexColor = rgbToHex(value);
57
74
  } else if (value[0] === '#') {
58
75
  hexColor = value.toLowerCase();
59
- } // else handle other colour formats
60
-
61
-
76
+ }
77
+ // else handle other colour formats
62
78
  return hexColor && colorPalette.has(hexColor) ? {
63
79
  color: hexColor
64
80
  } : false;
65
81
  }
66
- }, // This rule ensures when loading from a renderer or editor where the
82
+ },
83
+ // This rule ensures when loading from a renderer or editor where the
67
84
  // presented text color does not match the stored hex color -- that the
68
85
  // text color is preserved.
69
86
  //
@@ -77,7 +94,6 @@ export var textColor = {
77
94
  if (!(maybeElement instanceof HTMLElement)) {
78
95
  return false;
79
96
  }
80
-
81
97
  var hexColor = maybeElement.dataset.textCustomColor;
82
98
  return hexColor && colorPalette.has(hexColor) ? {
83
99
  color: hexColor
@@ -1,4 +1,5 @@
1
1
  import { FONT_STYLE } from '../groups';
2
+
2
3
  /**
3
4
  * @name underline_mark
4
5
  */
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @name blockCard_node
3
3
  */
4
+
4
5
  export var blockCard = {
5
6
  inline: false,
6
7
  group: 'block',
@@ -39,7 +40,6 @@ export var blockCard = {
39
40
  }],
40
41
  toDOM: function toDOM(node) {
41
42
  var _node$attrs;
42
-
43
43
  var attrs = {
44
44
  'data-block-card': '',
45
45
  href: node.attrs.url || '',
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @name blockquote_node
3
3
  */
4
+
4
5
  export var blockquote = {
5
6
  content: '(paragraph | unsupportedBlock)+',
6
7
  group: 'block',
@@ -1,5 +1,4 @@
1
1
  import { getExtensionAttrs } from '../../utils/extensions';
2
-
3
2
  var createBodiedExtensionNodeSpec = function createBodiedExtensionNodeSpec() {
4
3
  var nodeSpec = {
5
4
  inline: false,
@@ -54,5 +53,4 @@ var createBodiedExtensionNodeSpec = function createBodiedExtensionNodeSpec() {
54
53
  };
55
54
  return nodeSpec;
56
55
  };
57
-
58
56
  export var bodiedExtension = createBodiedExtensionNodeSpec();
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @name caption_node
3
3
  */
4
+
4
5
  export var caption = {
5
6
  content: '(text|hardBreak|mention|emoji|date|placeholder|inlineCard|status)*',
6
7
  isolating: true,
@@ -1,50 +1,40 @@
1
1
  import { Fragment } from 'prosemirror-model';
2
-
3
2
  var getLanguageFromEditorStyle = function getLanguageFromEditorStyle(dom) {
4
3
  return dom.getAttribute('data-language') || undefined;
5
- }; // example of BB style:
6
- // <div class="codehilite language-javascript"><pre><span>hello world</span><span>\n</span></pre></div>
7
-
4
+ };
8
5
 
6
+ // example of BB style:
7
+ // <div class="codehilite language-javascript"><pre><span>hello world</span><span>\n</span></pre></div>
9
8
  var getLanguageFromBitbucketStyle = function getLanguageFromBitbucketStyle(dom) {
10
9
  if (dom && dom.classList.contains('codehilite')) {
11
10
  // code block html from Bitbucket always contains an extra new line
12
11
  return extractLanguageFromClass(dom.className);
13
12
  }
14
-
15
13
  return;
16
- }; // If there is a child code element, check that for data-language
17
-
14
+ };
18
15
 
16
+ // If there is a child code element, check that for data-language
19
17
  var getLanguageFromCode = function getLanguageFromCode(dom) {
20
18
  var firstChild = dom.firstElementChild;
21
-
22
19
  if (firstChild && firstChild.nodeName === 'CODE') {
23
20
  return firstChild.getAttribute('data-language') || undefined;
24
21
  }
25
22
  };
26
-
27
23
  var extractLanguageFromClass = function extractLanguageFromClass(className) {
28
24
  var languageRegex = /(?:^|\s)language-([^\s]+)/;
29
25
  var result = languageRegex.exec(className);
30
-
31
26
  if (result && result[1]) {
32
27
  return result[1];
33
28
  }
34
-
35
29
  return;
36
30
  };
37
-
38
31
  var removeLastNewLine = function removeLastNewLine(dom) {
39
32
  var parent = dom && dom.parentElement;
40
-
41
33
  if (parent && parent.classList.contains('codehilite')) {
42
34
  dom.textContent = dom.textContent.replace(/\n$/, '');
43
35
  }
44
-
45
36
  return dom;
46
37
  };
47
-
48
38
  export var codeBlock = {
49
39
  attrs: {
50
40
  language: {
@@ -70,18 +60,17 @@ export var codeBlock = {
70
60
  language: language
71
61
  };
72
62
  }
73
- }, // Handle VSCode paste
63
+ },
64
+ // Handle VSCode paste
74
65
  // Checking `white-space: pre-wrap` is too aggressive @see ED-2627
75
66
  {
76
67
  tag: 'div[style]',
77
68
  preserveWhitespace: 'full',
78
69
  getAttrs: function getAttrs(domNode) {
79
70
  var dom = domNode;
80
-
81
71
  if (dom.style.whiteSpace === 'pre' || dom.style.fontFamily && dom.style.fontFamily.toLowerCase().indexOf('monospace') > -1) {
82
72
  return {};
83
73
  }
84
-
85
74
  return false;
86
75
  },
87
76
  // @see ED-5682
@@ -94,7 +83,8 @@ export var codeBlock = {
94
83
  }).join('\n');
95
84
  return code ? Fragment.from(schema.text(code)) : Fragment.empty;
96
85
  }
97
- }, // Handle GitHub/Gist paste
86
+ },
87
+ // Handle GitHub/Gist paste
98
88
  {
99
89
  tag: 'table[style]',
100
90
  preserveWhitespace: 'full',
@@ -102,18 +92,16 @@ export var codeBlock = {
102
92
  if (dom.querySelector('td[class*="blob-code"]')) {
103
93
  return {};
104
94
  }
105
-
106
95
  return false;
107
96
  }
108
97
  }, {
109
98
  tag: 'div.code-block',
110
99
  preserveWhitespace: 'full',
111
100
  getAttrs: function getAttrs(domNode) {
112
- var dom = domNode; // TODO: ED-5604 Fix it inside `react-syntax-highlighter`
101
+ var dom = domNode;
102
+ // TODO: ED-5604 Fix it inside `react-syntax-highlighter`
113
103
  // Remove line numbers
114
-
115
104
  var lineNumber = dom.querySelectorAll('.react-syntax-highlighter-line-number');
116
-
117
105
  if (lineNumber.length > 0) {
118
106
  // It's possible to copy without the line numbers too hence this
119
107
  // `react-syntax-highlighter-line-number` check, so that we don't remove real code
@@ -121,7 +109,6 @@ export var codeBlock = {
121
109
  return line.remove();
122
110
  });
123
111
  }
124
-
125
112
  return {};
126
113
  }
127
114
  }],
@@ -137,11 +124,9 @@ export var toJSON = function toJSON(node) {
137
124
  if (key === 'uniqueId') {
138
125
  return memo;
139
126
  }
140
-
141
127
  if (key === 'language' && node.attrs.language === null) {
142
128
  return memo;
143
129
  }
144
-
145
130
  memo[key] = node.attrs[key];
146
131
  return memo;
147
132
  }, {})
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @name date_node
3
3
  */
4
+
4
5
  export var date = {
5
6
  inline: true,
6
7
  group: 'inline',
@@ -25,8 +25,8 @@ export var decisionItem = {
25
25
  }],
26
26
  toDOM: function toDOM(node) {
27
27
  var _node$attrs = node.attrs,
28
- localId = _node$attrs.localId,
29
- state = _node$attrs.state;
28
+ localId = _node$attrs.localId,
29
+ state = _node$attrs.state;
30
30
  var attrs = {
31
31
  'data-decision-local-id': localId || 'local-decision',
32
32
  'data-decision-state': state
@@ -1,4 +1,5 @@
1
1
  import { uuid } from '../../utils/uuid';
2
+
2
3
  /**
3
4
  * @name decisionList_node
4
5
  */
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @name doc_node
3
3
  */
4
+
4
5
  export var doc = {
5
6
  content: '(block|layoutSection)+',
6
7
  marks: 'alignment breakout dataConsumer fragment indentation unsupportedMark unsupportedNodeAttribute'
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @name embedCard_node
3
3
  */
4
+
4
5
  export var embedCard = {
5
6
  inline: false,
6
7
  group: 'block',
@@ -36,11 +37,11 @@ export var embedCard = {
36
37
  }],
37
38
  toDOM: function toDOM(node) {
38
39
  var _node$attrs = node.attrs,
39
- url = _node$attrs.url,
40
- layout = _node$attrs.layout,
41
- width = _node$attrs.width,
42
- originalWidth = _node$attrs.originalWidth,
43
- originalHeight = _node$attrs.originalHeight;
40
+ url = _node$attrs.url,
41
+ layout = _node$attrs.layout,
42
+ width = _node$attrs.width,
43
+ originalWidth = _node$attrs.originalWidth,
44
+ originalHeight = _node$attrs.originalHeight;
44
45
  var attrs = {
45
46
  'data-embed-card': '',
46
47
  'data-card-url': url,