@atlaskit/adf-schema 24.0.3 → 25.1.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 (78) hide show
  1. package/CHANGELOG.md +110 -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/marks/text-color.js +7 -15
  11. package/dist/cjs/schema/nodes/bullet-list.js +0 -5
  12. package/dist/cjs/schema/nodes/index.js +6 -0
  13. package/dist/cjs/schema/nodes/list-item.js +0 -6
  14. package/dist/cjs/schema/nodes/media.js +3 -0
  15. package/dist/cjs/schema/nodes/ordered-list.js +66 -6
  16. package/dist/cjs/schema/nodes/tableNodes.js +11 -6
  17. package/dist/cjs/schema/nodes/types/list.js +5 -0
  18. package/dist/cjs/utils/url.js +7 -2
  19. package/dist/cjs/version.json +1 -1
  20. package/dist/es2019/index.js +3 -1
  21. package/dist/es2019/schema/bitbucket-schema.js +4 -0
  22. package/dist/es2019/schema/confluence-schema.js +8 -0
  23. package/dist/es2019/schema/create-schema.js +2 -2
  24. package/dist/es2019/schema/index.js +4 -2
  25. package/dist/es2019/schema/jira-schema.js +48 -0
  26. package/dist/es2019/schema/marks/alignment.js +1 -1
  27. package/dist/es2019/schema/marks/annotation.js +1 -1
  28. package/dist/es2019/schema/marks/text-color.js +7 -9
  29. package/dist/es2019/schema/nodes/bullet-list.js +0 -5
  30. package/dist/es2019/schema/nodes/index.js +1 -1
  31. package/dist/es2019/schema/nodes/list-item.js +0 -6
  32. package/dist/es2019/schema/nodes/media.js +3 -0
  33. package/dist/es2019/schema/nodes/ordered-list.js +55 -5
  34. package/dist/es2019/schema/nodes/tableNodes.js +11 -6
  35. package/dist/es2019/schema/nodes/types/list.js +1 -0
  36. package/dist/es2019/utils/url.js +7 -2
  37. package/dist/es2019/version.json +1 -1
  38. package/dist/esm/index.js +3 -1
  39. package/dist/esm/schema/bitbucket-schema.js +4 -0
  40. package/dist/esm/schema/confluence-schema.js +8 -0
  41. package/dist/esm/schema/create-schema.js +2 -2
  42. package/dist/esm/schema/index.js +4 -2
  43. package/dist/esm/schema/jira-schema.js +48 -0
  44. package/dist/esm/schema/marks/alignment.js +1 -1
  45. package/dist/esm/schema/marks/annotation.js +1 -1
  46. package/dist/esm/schema/marks/text-color.js +7 -15
  47. package/dist/esm/schema/nodes/bullet-list.js +0 -5
  48. package/dist/esm/schema/nodes/index.js +1 -1
  49. package/dist/esm/schema/nodes/list-item.js +0 -6
  50. package/dist/esm/schema/nodes/media.js +3 -0
  51. package/dist/esm/schema/nodes/ordered-list.js +59 -5
  52. package/dist/esm/schema/nodes/tableNodes.js +11 -6
  53. package/dist/esm/schema/nodes/types/list.js +1 -0
  54. package/dist/esm/utils/url.js +7 -2
  55. package/dist/esm/version.json +1 -1
  56. package/dist/json-schema/v1/full.json +38 -41
  57. package/dist/json-schema/v1/stage-0.json +38 -41
  58. package/dist/types/index.d.ts +3 -1
  59. package/dist/types/schema/bitbucket-schema.d.ts +3 -0
  60. package/dist/types/schema/confluence-schema.d.ts +6 -0
  61. package/dist/types/schema/index.d.ts +4 -2
  62. package/dist/types/schema/jira-schema.d.ts +39 -0
  63. package/dist/types/schema/marks/text-color.d.ts +1 -0
  64. package/dist/types/schema/nodes/bullet-list.d.ts +0 -11
  65. package/dist/types/schema/nodes/index.d.ts +4 -4
  66. package/dist/types/schema/nodes/list-item.d.ts +0 -18
  67. package/dist/types/schema/nodes/media.d.ts +1 -0
  68. package/dist/types/schema/nodes/ordered-list.d.ts +1 -17
  69. package/dist/types/schema/nodes/panel.d.ts +2 -2
  70. package/dist/types/schema/nodes/tableNodes.d.ts +2 -2
  71. package/dist/types/schema/nodes/types/block-content.d.ts +2 -2
  72. package/dist/types/schema/nodes/types/list.d.ts +42 -0
  73. package/dist/types/schema/nodes/types/non-nestable-block-content.d.ts +2 -2
  74. package/dist/types/utils/url.d.ts +4 -0
  75. package/json-schema/v1/full.json +38 -41
  76. package/json-schema/v1/stage-0.json +38 -41
  77. package/package.json +3 -3
  78. package/report.api.md +19 -3
@@ -1,5 +1,7 @@
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';
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';
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
+ export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette,
3
+ /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
4
+ colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute } from './marks';
3
5
  export { unsupportedNodeTypesForMediaCards } from './unsupported';
4
6
  export { inlineNodes } from './inline-nodes';
5
7
  export { sanitizeNodes, createSchema } from './create-schema';
@@ -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
  const nodes = ['doc', 'paragraph', 'text', 'hardBreak', 'heading', 'rule'];
4
8
  const marks = ['strong', 'em', 'underline', 'typeAheadQuery', 'unsupportedMark', 'unsupportedNodeAttribute'];
@@ -53,36 +57,80 @@ export default function makeSchema(config) {
53
57
  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
  }
@@ -24,7 +24,7 @@ export const alignment = {
24
24
 
25
25
  toDOM(mark) {
26
26
  return ['div', {
27
- class: `fabric-editor-block-mark fabric-editor-align-${mark.attrs.align}`,
27
+ class: `fabric-editor-block-mark fabric-editor-alignment fabric-editor-align-${mark.attrs.align}`,
28
28
  'data-align': mark.attrs.align
29
29
  }, 0];
30
30
  }
@@ -34,7 +34,7 @@ export function buildDataAttributes({
34
34
  return data;
35
35
  }
36
36
  export const annotation = {
37
- inclusive: false,
37
+ inclusive: true,
38
38
  group: 'annotation',
39
39
  excludes: '',
40
40
  attrs: {
@@ -1,11 +1,8 @@
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
- const colorArrayPalette = [// default row
5
- // [N800, default],
6
- [N80, 'Light gray'], [P300, 'Purple'], [T300, 'Teal'], [G300, 'Green'], [R300, 'Red'], [Y400, 'Orange']]; // used for extended palette in text color picker
7
-
8
- const colorArrayPaletteExtended = [// default row - first color is added programatically
4
+ // used for extended palette in text color picker
5
+ const colorArrayPalette = [// default row - first color is added programatically
9
6
  // [N800, 'Squid ink'], // default dark gray
10
7
  [B500, 'Dark blue'], // Chore coat
11
8
  [T500, 'Dark teal'], // Shabby chic
@@ -31,9 +28,10 @@ const colorArrayPaletteExtended = [// default row - first color is added program
31
28
  ]; // @see https://product-fabric.atlassian.net/wiki/spaces/E/pages/55979455/Colour+picker+decisions#Colourpickerdecisions-Visualdesigndecisions
32
29
 
33
30
  export const colorPalette = new Map();
34
- export const colorPaletteExtended = new Map();
31
+ /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
32
+
33
+ export const colorPaletteExtended = colorPalette;
35
34
  colorArrayPalette.forEach(([color, label]) => colorPalette.set(color.toLowerCase(), label));
36
- colorArrayPaletteExtended.forEach(([color, label]) => colorPaletteExtended.set(color.toLowerCase(), label));
37
35
  export const textColor = {
38
36
  attrs: {
39
37
  color: {}
@@ -53,7 +51,7 @@ export const textColor = {
53
51
  } // else handle other colour formats
54
52
 
55
53
 
56
- return hexColor && (colorPalette.has(hexColor) || colorPaletteExtended.has(hexColor)) ? {
54
+ return hexColor && colorPalette.has(hexColor) ? {
57
55
  color: hexColor
58
56
  } : false;
59
57
  }
@@ -73,7 +71,7 @@ export const textColor = {
73
71
  }
74
72
 
75
73
  const hexColor = maybeElement.dataset.textCustomColor;
76
- return hexColor && (colorPalette.has(hexColor) || colorPaletteExtended.has(hexColor)) ? {
74
+ return hexColor && colorPalette.has(hexColor) ? {
77
75
  color: hexColor
78
76
  } : false;
79
77
  }
@@ -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.1.0",
4
4
  "sideEffects": false
5
5
  }
package/dist/esm/index.js CHANGED
@@ -1,2 +1,4 @@
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,
2
+ /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
3
+ 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
4
  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,5 +1,7 @@
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';
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';
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
+ export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette,
3
+ /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
4
+ colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute } from './marks';
3
5
  export { unsupportedNodeTypesForMediaCards } from './unsupported';
4
6
  export { inlineNodes } from './inline-nodes';
5
7
  export { sanitizeNodes, createSchema } from './create-schema';
@@ -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: {
@@ -3,11 +3,8 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  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
- var colorArrayPalette = [// default row
7
- // [N800, default],
8
- [N80, 'Light gray'], [P300, 'Purple'], [T300, 'Teal'], [G300, 'Green'], [R300, 'Red'], [Y400, 'Orange']]; // used for extended palette in text color picker
9
-
10
- var colorArrayPaletteExtended = [// default row - first color is added programatically
6
+ // used for extended palette in text color picker
7
+ var colorArrayPalette = [// default row - first color is added programatically
11
8
  // [N800, 'Squid ink'], // default dark gray
12
9
  [B500, 'Dark blue'], // Chore coat
13
10
  [T500, 'Dark teal'], // Shabby chic
@@ -33,7 +30,9 @@ var colorArrayPaletteExtended = [// default row - first color is added programat
33
30
  ]; // @see https://product-fabric.atlassian.net/wiki/spaces/E/pages/55979455/Colour+picker+decisions#Colourpickerdecisions-Visualdesigndecisions
34
31
 
35
32
  export var colorPalette = new Map();
36
- export var colorPaletteExtended = new Map();
33
+ /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
34
+
35
+ export var colorPaletteExtended = colorPalette;
37
36
  colorArrayPalette.forEach(function (_ref) {
38
37
  var _ref2 = _slicedToArray(_ref, 2),
39
38
  color = _ref2[0],
@@ -41,13 +40,6 @@ colorArrayPalette.forEach(function (_ref) {
41
40
 
42
41
  return colorPalette.set(color.toLowerCase(), label);
43
42
  });
44
- colorArrayPaletteExtended.forEach(function (_ref3) {
45
- var _ref4 = _slicedToArray(_ref3, 2),
46
- color = _ref4[0],
47
- label = _ref4[1];
48
-
49
- return colorPaletteExtended.set(color.toLowerCase(), label);
50
- });
51
43
  export var textColor = {
52
44
  attrs: {
53
45
  color: {}
@@ -67,7 +59,7 @@ export var textColor = {
67
59
  } // else handle other colour formats
68
60
 
69
61
 
70
- return hexColor && (colorPalette.has(hexColor) || colorPaletteExtended.has(hexColor)) ? {
62
+ return hexColor && colorPalette.has(hexColor) ? {
71
63
  color: hexColor
72
64
  } : false;
73
65
  }
@@ -87,7 +79,7 @@ export var textColor = {
87
79
  }
88
80
 
89
81
  var hexColor = maybeElement.dataset.textCustomColor;
90
- return hexColor && (colorPalette.has(hexColor) || colorPaletteExtended.has(hexColor)) ? {
82
+ return hexColor && colorPalette.has(hexColor) ? {
91
83
  color: hexColor
92
84
  } : false;
93
85
  }
@@ -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
  }