@atlaskit/adf-schema 24.0.3 → 25.0.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 (74) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/cjs/index.js +6 -0
  3. package/dist/cjs/schema/bitbucket-schema.js +3 -0
  4. package/dist/cjs/schema/confluence-schema.js +8 -0
  5. package/dist/cjs/schema/create-schema.js +1 -1
  6. package/dist/cjs/schema/index.js +6 -0
  7. package/dist/cjs/schema/jira-schema.js +47 -0
  8. package/dist/cjs/schema/marks/alignment.js +1 -1
  9. package/dist/cjs/schema/marks/annotation.js +1 -1
  10. package/dist/cjs/schema/nodes/bullet-list.js +0 -5
  11. package/dist/cjs/schema/nodes/index.js +6 -0
  12. package/dist/cjs/schema/nodes/list-item.js +0 -6
  13. package/dist/cjs/schema/nodes/media.js +3 -0
  14. package/dist/cjs/schema/nodes/ordered-list.js +66 -6
  15. package/dist/cjs/schema/nodes/tableNodes.js +11 -6
  16. package/dist/cjs/schema/nodes/types/list.js +5 -0
  17. package/dist/cjs/utils/url.js +7 -2
  18. package/dist/cjs/version.json +1 -1
  19. package/dist/es2019/index.js +1 -1
  20. package/dist/es2019/schema/bitbucket-schema.js +4 -0
  21. package/dist/es2019/schema/confluence-schema.js +8 -0
  22. package/dist/es2019/schema/create-schema.js +2 -2
  23. package/dist/es2019/schema/index.js +1 -1
  24. package/dist/es2019/schema/jira-schema.js +48 -0
  25. package/dist/es2019/schema/marks/alignment.js +1 -1
  26. package/dist/es2019/schema/marks/annotation.js +1 -1
  27. package/dist/es2019/schema/nodes/bullet-list.js +0 -5
  28. package/dist/es2019/schema/nodes/index.js +1 -1
  29. package/dist/es2019/schema/nodes/list-item.js +0 -6
  30. package/dist/es2019/schema/nodes/media.js +3 -0
  31. package/dist/es2019/schema/nodes/ordered-list.js +55 -5
  32. package/dist/es2019/schema/nodes/tableNodes.js +11 -6
  33. package/dist/es2019/schema/nodes/types/list.js +1 -0
  34. package/dist/es2019/utils/url.js +7 -2
  35. package/dist/es2019/version.json +1 -1
  36. package/dist/esm/index.js +1 -1
  37. package/dist/esm/schema/bitbucket-schema.js +4 -0
  38. package/dist/esm/schema/confluence-schema.js +8 -0
  39. package/dist/esm/schema/create-schema.js +2 -2
  40. package/dist/esm/schema/index.js +1 -1
  41. package/dist/esm/schema/jira-schema.js +48 -0
  42. package/dist/esm/schema/marks/alignment.js +1 -1
  43. package/dist/esm/schema/marks/annotation.js +1 -1
  44. package/dist/esm/schema/nodes/bullet-list.js +0 -5
  45. package/dist/esm/schema/nodes/index.js +1 -1
  46. package/dist/esm/schema/nodes/list-item.js +0 -6
  47. package/dist/esm/schema/nodes/media.js +3 -0
  48. package/dist/esm/schema/nodes/ordered-list.js +59 -5
  49. package/dist/esm/schema/nodes/tableNodes.js +11 -6
  50. package/dist/esm/schema/nodes/types/list.js +1 -0
  51. package/dist/esm/utils/url.js +7 -2
  52. package/dist/esm/version.json +1 -1
  53. package/dist/json-schema/v1/full.json +38 -41
  54. package/dist/json-schema/v1/stage-0.json +38 -41
  55. package/dist/types/index.d.ts +1 -1
  56. package/dist/types/schema/bitbucket-schema.d.ts +3 -0
  57. package/dist/types/schema/confluence-schema.d.ts +6 -0
  58. package/dist/types/schema/index.d.ts +1 -1
  59. package/dist/types/schema/jira-schema.d.ts +39 -0
  60. package/dist/types/schema/nodes/bullet-list.d.ts +0 -11
  61. package/dist/types/schema/nodes/index.d.ts +4 -4
  62. package/dist/types/schema/nodes/list-item.d.ts +0 -18
  63. package/dist/types/schema/nodes/media.d.ts +1 -0
  64. package/dist/types/schema/nodes/ordered-list.d.ts +1 -17
  65. package/dist/types/schema/nodes/panel.d.ts +2 -2
  66. package/dist/types/schema/nodes/tableNodes.d.ts +2 -2
  67. package/dist/types/schema/nodes/types/block-content.d.ts +2 -2
  68. package/dist/types/schema/nodes/types/list.d.ts +42 -0
  69. package/dist/types/schema/nodes/types/non-nestable-block-content.d.ts +2 -2
  70. package/dist/types/utils/url.d.ts +4 -0
  71. package/json-schema/v1/full.json +38 -41
  72. package/json-schema/v1/stage-0.json +38 -41
  73. package/package.json +3 -3
  74. package/report.api.md +7 -2
@@ -1,8 +1,3 @@
1
- // eslint-disable-next-line import/no-cycle
2
-
3
- /**
4
- * @name bulletList_node
5
- */
6
1
  export const bulletListSelector = '.ak-ul';
7
2
  export const bulletList = {
8
3
  group: 'block',
@@ -9,7 +9,7 @@ export { codeBlock, toJSON as codeBlockToJSON } from './code-block';
9
9
  export { hardBreak } from './hard-break';
10
10
  export { heading } from './heading';
11
11
  export { rule } from './rule';
12
- export { orderedList, orderedListSelector } from './ordered-list';
12
+ export { orderedList, orderedListSelector, orderedListWithOrder } from './ordered-list';
13
13
  export { paragraph } from './paragraph';
14
14
  export { emoji } from './emoji';
15
15
  export { image } from './image';
@@ -1,9 +1,3 @@
1
- // eslint-disable-next-line import/no-cycle
2
- // eslint-disable-next-line import/no-cycle
3
-
4
- /**
5
- * @name listItem_node
6
- */
7
1
  export const listItem = {
8
2
  content: '(paragraph | mediaSingle | codeBlock) (paragraph | bulletList | orderedList | mediaSingle | codeBlock)*',
9
3
  marks: 'unsupportedMark unsupportedNodeAttribute',
@@ -39,6 +39,9 @@ export const defaultAttrs = {
39
39
  __contextId: {
40
40
  default: null
41
41
  },
42
+ __mediaTraceId: {
43
+ default: null
44
+ },
42
45
  __external: {
43
46
  default: false
44
47
  }
@@ -1,11 +1,11 @@
1
- // eslint-disable-next-line import/no-cycle
2
-
3
- /**
4
- * @name orderedList_node
5
- */
6
1
  export const orderedListSelector = '.ak-ol';
7
2
  export const orderedList = {
8
3
  group: 'block',
4
+ attrs: {
5
+ order: {
6
+ default: 1
7
+ }
8
+ },
9
9
  content: 'listItem+',
10
10
  marks: 'unsupportedMark unsupportedNodeAttribute',
11
11
  selectable: false,
@@ -20,4 +20,54 @@ export const orderedList = {
20
20
  return ['ol', attrs, 0];
21
21
  }
22
22
 
23
+ }; // resolve "start" to a safe, 0+ integer, otherwise return undefined
24
+ // Note: Any changes to this function should also be made to "resolveOrder"
25
+ // in packages/editor/editor-common/src/utils/list.ts
26
+
27
+ const resolveStart = start => {
28
+ const num = Number(start);
29
+
30
+ if (Number.isNaN(num)) {
31
+ return;
32
+ }
33
+
34
+ if (num < 0) {
35
+ return;
36
+ }
37
+
38
+ return Math.floor(Math.max(num, 0));
39
+ };
40
+
41
+ export const orderedListWithOrder = { ...orderedList,
42
+ parseDOM: [{
43
+ tag: 'ol',
44
+ getAttrs: domNode => {
45
+ const dom = domNode;
46
+ let startDOMAttr = dom.getAttribute('start');
47
+
48
+ if (startDOMAttr) {
49
+ const start = resolveStart(startDOMAttr);
50
+
51
+ if (typeof start === 'number') {
52
+ return {
53
+ order: start
54
+ };
55
+ }
56
+ }
57
+
58
+ return null;
59
+ }
60
+ }],
61
+
62
+ toDOM(node) {
63
+ var _node$attrs;
64
+
65
+ const start = resolveStart(node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.order);
66
+ const attrs = {
67
+ start: typeof start === 'number' ? String(start) : undefined,
68
+ class: orderedListSelector.substr(1)
69
+ };
70
+ return ['ol', attrs, 0];
71
+ }
72
+
23
73
  };
@@ -12,13 +12,17 @@ export const getCellAttrs = (dom, defaultValues = {}) => {
12
12
  const colspan = Number(dom.getAttribute('colspan') || 1);
13
13
  let {
14
14
  backgroundColor
15
- } = dom.style;
15
+ } = dom.style; // ignore setting background attr if ds neutral token is detected
16
16
 
17
- if (backgroundColor && isRgb(backgroundColor)) {
18
- const result = rgbToHex(backgroundColor);
17
+ if (backgroundColor.includes('--ds-background-neutral')) {
18
+ backgroundColor = '';
19
+ } else {
20
+ if (backgroundColor && isRgb(backgroundColor)) {
21
+ const result = rgbToHex(backgroundColor);
19
22
 
20
- if (result !== null) {
21
- backgroundColor = result;
23
+ if (result !== null) {
24
+ backgroundColor = result;
25
+ }
22
26
  }
23
27
  }
24
28
 
@@ -56,8 +60,9 @@ export const getCellDomAttrs = node => {
56
60
  } = node.attrs; // to ensure that we don't overwrite product's style:
57
61
  // - it clears background color for <th> if its set to gray
58
62
  // - it clears background color for <td> if its set to white
63
+ // - it clears background color for <th> if ds neutral token is detected
59
64
 
60
- const ignored = nodeType === 'tableHeader' && background === tableBackgroundColorNames.get('light gray') || nodeType === 'tableCell' && background === tableBackgroundColorNames.get('white');
65
+ const ignored = nodeType === 'tableHeader' && background === tableBackgroundColorNames.get('light gray') || nodeType === 'tableCell' && background === tableBackgroundColorNames.get('white') || nodeType === 'tableHeader' && background.includes('--ds-background-neutral');
61
66
 
62
67
  if (ignored) {
63
68
  attrs.style = '';
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,9 @@
1
+ /**
2
+ * This file has been duplicated in packages/linking-platform/link-picker/src/common/utils/url.ts
3
+ * Any changes made here should be mirrored there.
4
+ */
1
5
  import LinkifyIt from 'linkify-it';
2
- const whitelistedURLPatterns = [/^https?:\/\//im, /^ftps?:\/\//im, /^\//im, /^mailto:/im, /^skype:/im, /^callto:/im, /^facetime:/im, /^git:/im, /^irc6?:/im, /^news:/im, /^nntp:/im, /^feed:/im, /^cvs:/im, /^svn:/im, /^mvn:/im, /^ssh:/im, /^scp:\/\//im, /^sftp:\/\//im, /^itms:/im, /^notes:/im, /^hipchat:\/\//im, /^sourcetree:/im, /^urn:/im, /^tel:/im, /^xmpp:/im, /^telnet:/im, /^vnc:/im, /^rdp:/im, /^whatsapp:/im, /^slack:/im, /^sips?:/im, /^magnet:/im, /^#/im];
6
+ const whitelistedURLPatterns = [/^https?:\/\//im, /^ftps?:\/\//im, /^jamfselfservice:\/\//im, /^\//im, /^mailto:/im, /^skype:/im, /^callto:/im, /^facetime:/im, /^git:/im, /^irc6?:/im, /^news:/im, /^nntp:/im, /^feed:/im, /^cvs:/im, /^svn:/im, /^mvn:/im, /^ssh:/im, /^scp:\/\//im, /^sftp:\/\//im, /^itms:/im, /^notes:/im, /^hipchat:\/\//im, /^sourcetree:/im, /^urn:/im, /^tel:/im, /^xmpp:/im, /^telnet:/im, /^vnc:/im, /^rdp:/im, /^whatsapp:/im, /^slack:/im, /^sips?:/im, /^magnet:/im, /^#/im];
3
7
  /**
4
8
  * Please notify the Editor Mobile team (Slack: #help-mobilekit) if the logic for this changes.
5
9
  */
@@ -15,11 +19,12 @@ export const isSafeUrl = url => {
15
19
  };
16
20
  export const linkify = LinkifyIt();
17
21
  linkify.add('sourcetree:', 'http:');
22
+ linkify.add('jamfselfservice:', 'http:');
18
23
  const tlds = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
19
24
  const tlds2Char = 'a[cdefgilmnoqrtuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrtuvwxyz]|n[acefgilopruz]|om|p[aefghkmnrtw]|qa|r[eosuw]|s[abcdegijklmnrtuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';
20
25
  tlds.push(tlds2Char);
21
26
  linkify.tlds(tlds, false);
22
- export const LINK_REGEXP = /(https?|ftp):\/\/[^\s]+/;
27
+ export const LINK_REGEXP = /(https?|ftp|jamfselfservice):\/\/[^\s]+/;
23
28
  export const linkifyMatch = text => {
24
29
  const matches = [];
25
30
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "24.0.3",
3
+ "version": "25.0.0",
4
4
  "sideEffects": false
5
5
  }
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette, 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, 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';
1
+ export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette, 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
2
  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,4 +1,8 @@
1
1
  import { createSchema } from './create-schema';
2
+ /**
3
+ * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
4
+ **/
5
+
2
6
  export var bitbucketSchema = createSchema({
3
7
  nodes: ['doc', 'caption', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'hardBreak', 'rule', 'image', 'media', 'mediaSingle', 'mention', 'emoji', 'table', 'tableCell', 'tableHeader', 'tableRow', 'inlineCard', 'unsupportedBlock', 'unsupportedInline'],
4
8
  marks: ['em', 'strong', 'strike', 'link', 'code', 'unsupportedMark', 'unsupportedNodeAttribute']
@@ -1,10 +1,18 @@
1
1
  import { createSchema } from './create-schema';
2
2
  var nodes = ['doc', 'paragraph', 'blockquote', 'codeBlock', 'panel', 'hardBreak', 'orderedList', 'bulletList', 'heading', 'mediaInline', 'mediaGroup', 'mediaSingle', 'media', 'caption', 'confluenceUnsupportedBlock', 'confluenceJiraIssue', 'expand', 'nestedExpand', 'extension', 'inlineExtension', 'bodiedExtension', 'listItem', 'mention', 'text', 'confluenceUnsupportedInline', 'media', 'rule', 'table', 'tableCell', 'tableHeader', 'tableRow', 'emoji', 'taskList', 'taskItem', 'date', 'placeholder', 'decisionList', 'decisionItem', 'layoutSection', 'layoutColumn', 'inlineCard', 'unsupportedBlock', 'unsupportedInline'];
3
3
  var marks = ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'mentionQuery', 'code', 'textColor', 'confluenceInlineComment', 'annotation', 'unsupportedMark', 'unsupportedNodeAttribute'];
4
+ /**
5
+ * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
6
+ **/
7
+
4
8
  export var confluenceSchema = createSchema({
5
9
  nodes: nodes,
6
10
  marks: marks
7
11
  });
12
+ /**
13
+ * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
14
+ **/
15
+
8
16
  export var confluenceSchemaWithMediaSingle = createSchema({
9
17
  nodes: nodes.concat('mediaSingle'),
10
18
  marks: marks
@@ -7,7 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
7
7
  import { Schema } from 'prosemirror-model';
8
8
  import { COLOR, FONT_STYLE, SEARCH_QUERY, LINK } from './groups';
9
9
  import { link, em, strong, textColor, strike, subsup, underline, code, typeAheadQuery, confluenceInlineComment, breakout, alignment, indentation, annotation, unsupportedMark, unsupportedNodeAttribute, dataConsumer, fragment } from './marks';
10
- import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedList, 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';
10
+ 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';
11
11
 
12
12
  function addItems(builtInItems, config) {
13
13
  var customSpecs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
@@ -78,7 +78,7 @@ var nodesInOrder = [{
78
78
  spec: bulletList
79
79
  }, {
80
80
  name: 'orderedList',
81
- spec: orderedList
81
+ spec: orderedListWithOrder
82
82
  }, {
83
83
  name: 'listItem',
84
84
  spec: listItem
@@ -1,4 +1,4 @@
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, 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';
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, colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute } from './marks';
3
3
  export { unsupportedNodeTypesForMediaCards } from './unsupported';
4
4
  export { inlineNodes } from './inline-nodes';
@@ -1,4 +1,8 @@
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
+ **/
2
6
  export default function makeSchema(config) {
3
7
  var nodes = ['doc', 'paragraph', 'text', 'hardBreak', 'heading', 'rule'];
4
8
  var marks = ['strong', 'em', 'underline', 'typeAheadQuery', 'unsupportedMark', 'unsupportedNodeAttribute'];
@@ -53,36 +57,80 @@ export default function makeSchema(config) {
53
57
  marks: marks
54
58
  });
55
59
  }
60
+ /**
61
+ * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
62
+ **/
63
+
56
64
  export function isSchemaWithLists(schema) {
57
65
  return !!schema.nodes.bulletList;
58
66
  }
67
+ /**
68
+ * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
69
+ **/
70
+
59
71
  export function isSchemaWithMentions(schema) {
60
72
  return !!schema.nodes.mention;
61
73
  }
74
+ /**
75
+ * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
76
+ **/
77
+
62
78
  export function isSchemaWithEmojis(schema) {
63
79
  return !!schema.nodes.emoji;
64
80
  }
81
+ /**
82
+ * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
83
+ **/
84
+
65
85
  export function isSchemaWithLinks(schema) {
66
86
  return !!schema.marks.link;
67
87
  }
88
+ /**
89
+ * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
90
+ **/
91
+
68
92
  export function isSchemaWithAdvancedTextFormattingMarks(schema) {
69
93
  return !!schema.marks.code && !!schema.marks.strike;
70
94
  }
95
+ /**
96
+ * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
97
+ **/
98
+
71
99
  export function isSchemaWithSubSupMark(schema) {
72
100
  return !!schema.marks.subsup;
73
101
  }
102
+ /**
103
+ * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
104
+ **/
105
+
74
106
  export function isSchemaWithCodeBlock(schema) {
75
107
  return !!schema.nodes.codeBlock;
76
108
  }
109
+ /**
110
+ * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
111
+ **/
112
+
77
113
  export function isSchemaWithBlockQuotes(schema) {
78
114
  return !!schema.nodes.blockquote;
79
115
  }
116
+ /**
117
+ * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
118
+ **/
119
+
80
120
  export function isSchemaWithMedia(schema) {
81
121
  return !!schema.nodes.mediaGroup && !!schema.nodes.media && !!schema.nodes.mediaInline;
82
122
  }
123
+ /**
124
+ * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
125
+ **/
126
+
83
127
  export function isSchemaWithTextColor(schema) {
84
128
  return !!schema.marks.textColor;
85
129
  }
130
+ /**
131
+ * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
132
+ **/
133
+
86
134
  export function isSchemaWithTables(schema) {
87
135
  return !!schema.nodes.table && !!schema.nodes.tableCell && !!schema.nodes.tableHeader && !!schema.nodes.tableRow;
88
136
  }
@@ -23,7 +23,7 @@ export var alignment = {
23
23
  }],
24
24
  toDOM: function toDOM(mark) {
25
25
  return ['div', {
26
- class: "fabric-editor-block-mark fabric-editor-align-".concat(mark.attrs.align),
26
+ class: "fabric-editor-block-mark fabric-editor-alignment fabric-editor-align-".concat(mark.attrs.align),
27
27
  'data-align': mark.attrs.align
28
28
  }, 0];
29
29
  }
@@ -39,7 +39,7 @@ export function buildDataAttributes(_ref) {
39
39
  return data;
40
40
  }
41
41
  export var annotation = {
42
- inclusive: false,
42
+ inclusive: true,
43
43
  group: 'annotation',
44
44
  excludes: '',
45
45
  attrs: {
@@ -1,8 +1,3 @@
1
- // eslint-disable-next-line import/no-cycle
2
-
3
- /**
4
- * @name bulletList_node
5
- */
6
1
  export var bulletListSelector = '.ak-ul';
7
2
  export var bulletList = {
8
3
  group: 'block',
@@ -9,7 +9,7 @@ export { codeBlock, toJSON as codeBlockToJSON } from './code-block';
9
9
  export { hardBreak } from './hard-break';
10
10
  export { heading } from './heading';
11
11
  export { rule } from './rule';
12
- export { orderedList, orderedListSelector } from './ordered-list';
12
+ export { orderedList, orderedListSelector, orderedListWithOrder } from './ordered-list';
13
13
  export { paragraph } from './paragraph';
14
14
  export { emoji } from './emoji';
15
15
  export { image } from './image';
@@ -1,9 +1,3 @@
1
- // eslint-disable-next-line import/no-cycle
2
- // eslint-disable-next-line import/no-cycle
3
-
4
- /**
5
- * @name listItem_node
6
- */
7
1
  export var listItem = {
8
2
  content: '(paragraph | mediaSingle | codeBlock) (paragraph | bulletList | orderedList | mediaSingle | codeBlock)*',
9
3
  marks: 'unsupportedMark unsupportedNodeAttribute',
@@ -39,6 +39,9 @@ export var defaultAttrs = {
39
39
  __contextId: {
40
40
  default: null
41
41
  },
42
+ __mediaTraceId: {
43
+ default: null
44
+ },
42
45
  __external: {
43
46
  default: false
44
47
  }
@@ -1,11 +1,17 @@
1
- // eslint-disable-next-line import/no-cycle
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
3
+ 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
+ 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; }
2
6
 
3
- /**
4
- * @name orderedList_node
5
- */
6
7
  export var orderedListSelector = '.ak-ol';
7
8
  export var orderedList = {
8
9
  group: 'block',
10
+ attrs: {
11
+ order: {
12
+ default: 1
13
+ }
14
+ },
9
15
  content: 'listItem+',
10
16
  marks: 'unsupportedMark unsupportedNodeAttribute',
11
17
  selectable: false,
@@ -18,4 +24,52 @@ export var orderedList = {
18
24
  };
19
25
  return ['ol', attrs, 0];
20
26
  }
21
- };
27
+ }; // resolve "start" to a safe, 0+ integer, otherwise return undefined
28
+ // Note: Any changes to this function should also be made to "resolveOrder"
29
+ // in packages/editor/editor-common/src/utils/list.ts
30
+
31
+ var resolveStart = function resolveStart(start) {
32
+ var num = Number(start);
33
+
34
+ if (Number.isNaN(num)) {
35
+ return;
36
+ }
37
+
38
+ if (num < 0) {
39
+ return;
40
+ }
41
+
42
+ return Math.floor(Math.max(num, 0));
43
+ };
44
+
45
+ export var orderedListWithOrder = _objectSpread(_objectSpread({}, orderedList), {}, {
46
+ parseDOM: [{
47
+ tag: 'ol',
48
+ getAttrs: function getAttrs(domNode) {
49
+ var dom = domNode;
50
+ var startDOMAttr = dom.getAttribute('start');
51
+
52
+ if (startDOMAttr) {
53
+ var start = resolveStart(startDOMAttr);
54
+
55
+ if (typeof start === 'number') {
56
+ return {
57
+ order: start
58
+ };
59
+ }
60
+ }
61
+
62
+ return null;
63
+ }
64
+ }],
65
+ toDOM: function toDOM(node) {
66
+ var _node$attrs;
67
+
68
+ var start = resolveStart(node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.order);
69
+ var attrs = {
70
+ start: typeof start === 'number' ? String(start) : undefined,
71
+ class: orderedListSelector.substr(1)
72
+ };
73
+ return ['ol', attrs, 0];
74
+ }
75
+ });
@@ -14,13 +14,17 @@ export var getCellAttrs = function getCellAttrs(dom) {
14
14
  return Number(str);
15
15
  }) : null;
16
16
  var colspan = Number(dom.getAttribute('colspan') || 1);
17
- var backgroundColor = dom.style.backgroundColor;
17
+ var backgroundColor = dom.style.backgroundColor; // ignore setting background attr if ds neutral token is detected
18
18
 
19
- if (backgroundColor && isRgb(backgroundColor)) {
20
- var result = rgbToHex(backgroundColor);
19
+ if (backgroundColor.includes('--ds-background-neutral')) {
20
+ backgroundColor = '';
21
+ } else {
22
+ if (backgroundColor && isRgb(backgroundColor)) {
23
+ var result = rgbToHex(backgroundColor);
21
24
 
22
- if (result !== null) {
23
- backgroundColor = result;
25
+ if (result !== null) {
26
+ backgroundColor = result;
27
+ }
24
28
  }
25
29
  }
26
30
 
@@ -56,8 +60,9 @@ export var getCellDomAttrs = function getCellDomAttrs(node) {
56
60
  var background = node.attrs.background; // to ensure that we don't overwrite product's style:
57
61
  // - it clears background color for <th> if its set to gray
58
62
  // - it clears background color for <td> if its set to white
63
+ // - it clears background color for <th> if ds neutral token is detected
59
64
 
60
- var ignored = nodeType === 'tableHeader' && background === tableBackgroundColorNames.get('light gray') || nodeType === 'tableCell' && background === tableBackgroundColorNames.get('white');
65
+ var ignored = nodeType === 'tableHeader' && background === tableBackgroundColorNames.get('light gray') || nodeType === 'tableCell' && background === tableBackgroundColorNames.get('white') || nodeType === 'tableHeader' && background.includes('--ds-background-neutral');
61
66
 
62
67
  if (ignored) {
63
68
  attrs.style = '';
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,9 @@
1
+ /**
2
+ * This file has been duplicated in packages/linking-platform/link-picker/src/common/utils/url.ts
3
+ * Any changes made here should be mirrored there.
4
+ */
1
5
  import LinkifyIt from 'linkify-it';
2
- var whitelistedURLPatterns = [/^https?:\/\//im, /^ftps?:\/\//im, /^\//im, /^mailto:/im, /^skype:/im, /^callto:/im, /^facetime:/im, /^git:/im, /^irc6?:/im, /^news:/im, /^nntp:/im, /^feed:/im, /^cvs:/im, /^svn:/im, /^mvn:/im, /^ssh:/im, /^scp:\/\//im, /^sftp:\/\//im, /^itms:/im, /^notes:/im, /^hipchat:\/\//im, /^sourcetree:/im, /^urn:/im, /^tel:/im, /^xmpp:/im, /^telnet:/im, /^vnc:/im, /^rdp:/im, /^whatsapp:/im, /^slack:/im, /^sips?:/im, /^magnet:/im, /^#/im];
6
+ var whitelistedURLPatterns = [/^https?:\/\//im, /^ftps?:\/\//im, /^jamfselfservice:\/\//im, /^\//im, /^mailto:/im, /^skype:/im, /^callto:/im, /^facetime:/im, /^git:/im, /^irc6?:/im, /^news:/im, /^nntp:/im, /^feed:/im, /^cvs:/im, /^svn:/im, /^mvn:/im, /^ssh:/im, /^scp:\/\//im, /^sftp:\/\//im, /^itms:/im, /^notes:/im, /^hipchat:\/\//im, /^sourcetree:/im, /^urn:/im, /^tel:/im, /^xmpp:/im, /^telnet:/im, /^vnc:/im, /^rdp:/im, /^whatsapp:/im, /^slack:/im, /^sips?:/im, /^magnet:/im, /^#/im];
3
7
  /**
4
8
  * Please notify the Editor Mobile team (Slack: #help-mobilekit) if the logic for this changes.
5
9
  */
@@ -17,11 +21,12 @@ export var isSafeUrl = function isSafeUrl(url) {
17
21
  };
18
22
  export var linkify = LinkifyIt();
19
23
  linkify.add('sourcetree:', 'http:');
24
+ linkify.add('jamfselfservice:', 'http:');
20
25
  var tlds = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
21
26
  var tlds2Char = 'a[cdefgilmnoqrtuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrtuvwxyz]|n[acefgilopruz]|om|p[aefghkmnrtw]|qa|r[eosuw]|s[abcdegijklmnrtuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';
22
27
  tlds.push(tlds2Char);
23
28
  linkify.tlds(tlds, false);
24
- export var LINK_REGEXP = /(https?|ftp):\/\/[^\s]+/;
29
+ export var LINK_REGEXP = /(https?|ftp|jamfselfservice):\/\/[^\s]+/;
25
30
  export var linkifyMatch = function linkifyMatch(text) {
26
31
  var matches = [];
27
32
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "24.0.3",
3
+ "version": "25.0.0",
4
4
  "sideEffects": false
5
5
  }