@atlaskit/adf-schema 24.0.1 → 24.0.3

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 (117) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/schema/marks/text-color.js +16 -2
  3. package/dist/cjs/schema/nodes/block-card.js +3 -1
  4. package/dist/cjs/version.json +1 -1
  5. package/dist/es2019/schema/marks/text-color.js +15 -2
  6. package/dist/es2019/schema/nodes/block-card.js +3 -1
  7. package/dist/es2019/version.json +1 -1
  8. package/dist/esm/schema/marks/text-color.js +15 -2
  9. package/dist/esm/schema/nodes/block-card.js +3 -1
  10. package/dist/esm/version.json +1 -1
  11. package/package.json +8 -11
  12. package/report.api.md +1035 -1044
  13. package/dist/types-ts4.0/index.d.ts +0 -4
  14. package/dist/types-ts4.0/json-schema/index.d.ts +0 -2
  15. package/dist/types-ts4.0/schema/bitbucket-schema.d.ts +0 -2
  16. package/dist/types-ts4.0/schema/confluence-schema.d.ts +0 -3
  17. package/dist/types-ts4.0/schema/create-schema.d.ts +0 -32
  18. package/dist/types-ts4.0/schema/default-schema.d.ts +0 -7
  19. package/dist/types-ts4.0/schema/groups.d.ts +0 -6
  20. package/dist/types-ts4.0/schema/index.d.ts +0 -7
  21. package/dist/types-ts4.0/schema/inline-nodes.d.ts +0 -1
  22. package/dist/types-ts4.0/schema/jira-schema.d.ts +0 -26
  23. package/dist/types-ts4.0/schema/marks/alignment.d.ts +0 -16
  24. package/dist/types-ts4.0/schema/marks/annotation.d.ts +0 -32
  25. package/dist/types-ts4.0/schema/marks/breakout.d.ts +0 -12
  26. package/dist/types-ts4.0/schema/marks/code.d.ts +0 -8
  27. package/dist/types-ts4.0/schema/marks/confluence-inline-comment.d.ts +0 -12
  28. package/dist/types-ts4.0/schema/marks/data-consumer.d.ts +0 -48
  29. package/dist/types-ts4.0/schema/marks/em.d.ts +0 -8
  30. package/dist/types-ts4.0/schema/marks/fragment.d.ts +0 -29
  31. package/dist/types-ts4.0/schema/marks/indentation.d.ts +0 -16
  32. package/dist/types-ts4.0/schema/marks/index.d.ts +0 -32
  33. package/dist/types-ts4.0/schema/marks/link.d.ts +0 -35
  34. package/dist/types-ts4.0/schema/marks/strike.d.ts +0 -8
  35. package/dist/types-ts4.0/schema/marks/strong.d.ts +0 -8
  36. package/dist/types-ts4.0/schema/marks/subsup.d.ts +0 -15
  37. package/dist/types-ts4.0/schema/marks/text-color.d.ts +0 -21
  38. package/dist/types-ts4.0/schema/marks/type-ahead-query.d.ts +0 -2
  39. package/dist/types-ts4.0/schema/marks/underline.d.ts +0 -8
  40. package/dist/types-ts4.0/schema/marks/unsupported-mark.d.ts +0 -2
  41. package/dist/types-ts4.0/schema/marks/unsupported-node-attributes.d.ts +0 -2
  42. package/dist/types-ts4.0/schema/nodes/block-card.d.ts +0 -22
  43. package/dist/types-ts4.0/schema/nodes/blockquote.d.ts +0 -14
  44. package/dist/types-ts4.0/schema/nodes/bodied-extension.d.ts +0 -24
  45. package/dist/types-ts4.0/schema/nodes/bullet-list.d.ts +0 -14
  46. package/dist/types-ts4.0/schema/nodes/caption.d.ts +0 -20
  47. package/dist/types-ts4.0/schema/nodes/code-block.d.ts +0 -31
  48. package/dist/types-ts4.0/schema/nodes/confluence-jira-issue.d.ts +0 -2
  49. package/dist/types-ts4.0/schema/nodes/confluence-unsupported-block.d.ts +0 -2
  50. package/dist/types-ts4.0/schema/nodes/confluence-unsupported-inline.d.ts +0 -2
  51. package/dist/types-ts4.0/schema/nodes/date.d.ts +0 -14
  52. package/dist/types-ts4.0/schema/nodes/decision-item.d.ts +0 -17
  53. package/dist/types-ts4.0/schema/nodes/decision-list.d.ts +0 -18
  54. package/dist/types-ts4.0/schema/nodes/doc.d.ts +0 -18
  55. package/dist/types-ts4.0/schema/nodes/embed-card.d.ts +0 -18
  56. package/dist/types-ts4.0/schema/nodes/emoji.d.ts +0 -14
  57. package/dist/types-ts4.0/schema/nodes/expand.d.ts +0 -33
  58. package/dist/types-ts4.0/schema/nodes/extension.d.ts +0 -18
  59. package/dist/types-ts4.0/schema/nodes/hard-break.d.ts +0 -11
  60. package/dist/types-ts4.0/schema/nodes/heading.d.ts +0 -36
  61. package/dist/types-ts4.0/schema/nodes/image.d.ts +0 -2
  62. package/dist/types-ts4.0/schema/nodes/index.d.ts +0 -93
  63. package/dist/types-ts4.0/schema/nodes/inline-card.d.ts +0 -10
  64. package/dist/types-ts4.0/schema/nodes/inline-extension.d.ts +0 -18
  65. package/dist/types-ts4.0/schema/nodes/layout-column.d.ts +0 -21
  66. package/dist/types-ts4.0/schema/nodes/layout-section.d.ts +0 -44
  67. package/dist/types-ts4.0/schema/nodes/list-item.d.ts +0 -20
  68. package/dist/types-ts4.0/schema/nodes/media-group.d.ts +0 -14
  69. package/dist/types-ts4.0/schema/nodes/media-inline.d.ts +0 -16
  70. package/dist/types-ts4.0/schema/nodes/media-single.d.ts +0 -61
  71. package/dist/types-ts4.0/schema/nodes/media.d.ts +0 -60
  72. package/dist/types-ts4.0/schema/nodes/mention.d.ts +0 -26
  73. package/dist/types-ts4.0/schema/nodes/nested-expand.d.ts +0 -27
  74. package/dist/types-ts4.0/schema/nodes/ordered-list.d.ts +0 -20
  75. package/dist/types-ts4.0/schema/nodes/panel.d.ts +0 -38
  76. package/dist/types-ts4.0/schema/nodes/paragraph.d.ts +0 -37
  77. package/dist/types-ts4.0/schema/nodes/placeholder.d.ts +0 -11
  78. package/dist/types-ts4.0/schema/nodes/rule.d.ts +0 -8
  79. package/dist/types-ts4.0/schema/nodes/status.d.ts +0 -20
  80. package/dist/types-ts4.0/schema/nodes/tableNodes.d.ts +0 -113
  81. package/dist/types-ts4.0/schema/nodes/task-item.d.ts +0 -17
  82. package/dist/types-ts4.0/schema/nodes/task-list.d.ts +0 -21
  83. package/dist/types-ts4.0/schema/nodes/text.d.ts +0 -15
  84. package/dist/types-ts4.0/schema/nodes/types/block-content.d.ts +0 -22
  85. package/dist/types-ts4.0/schema/nodes/types/extensions.d.ts +0 -34
  86. package/dist/types-ts4.0/schema/nodes/types/inline-content.d.ts +0 -32
  87. package/dist/types-ts4.0/schema/nodes/types/mark.d.ts +0 -15
  88. package/dist/types-ts4.0/schema/nodes/types/non-nestable-block-content.d.ts +0 -20
  89. package/dist/types-ts4.0/schema/nodes/types/rich-media-common.d.ts +0 -9
  90. package/dist/types-ts4.0/schema/nodes/unknown-block.d.ts +0 -3
  91. package/dist/types-ts4.0/schema/nodes/unsupported-block.d.ts +0 -2
  92. package/dist/types-ts4.0/schema/nodes/unsupported-inline.d.ts +0 -2
  93. package/dist/types-ts4.0/schema/unsupported.d.ts +0 -1
  94. package/dist/types-ts4.0/steps/analytics.d.ts +0 -59
  95. package/dist/types-ts4.0/steps/set-attrs.d.ts +0 -23
  96. package/dist/types-ts4.0/steps/table/add-column.d.ts +0 -88
  97. package/dist/types-ts4.0/steps/table/constants.d.ts +0 -4
  98. package/dist/types-ts4.0/steps/table/sort-column.d.ts +0 -18
  99. package/dist/types-ts4.0/steps/table/types.d.ts +0 -39
  100. package/dist/types-ts4.0/steps/table/utils/cell-step.d.ts +0 -51
  101. package/dist/types-ts4.0/steps/table/utils/cells-at-column.d.ts +0 -20
  102. package/dist/types-ts4.0/steps/table/utils/find-column.d.ts +0 -8
  103. package/dist/types-ts4.0/steps/table/utils/get-table-rect-from-doc.d.ts +0 -8
  104. package/dist/types-ts4.0/steps/table/utils/side-effects/rows.d.ts +0 -25
  105. package/dist/types-ts4.0/steps/table/utils/side-effects/side-effects.d.ts +0 -15
  106. package/dist/types-ts4.0/steps/table/utils/side-effects/table.d.ts +0 -16
  107. package/dist/types-ts4.0/steps/table/utils/side-effects/types.d.ts +0 -33
  108. package/dist/types-ts4.0/steps/table/utils/table-map.d.ts +0 -6
  109. package/dist/types-ts4.0/steps/type-ahead.d.ts +0 -35
  110. package/dist/types-ts4.0/steps.d.ts +0 -8
  111. package/dist/types-ts4.0/utils/colors.d.ts +0 -71
  112. package/dist/types-ts4.0/utils/confluence/emoji.d.ts +0 -50
  113. package/dist/types-ts4.0/utils/extensions.d.ts +0 -3
  114. package/dist/types-ts4.0/utils/index.d.ts +0 -6
  115. package/dist/types-ts4.0/utils/parseDOM.d.ts +0 -1
  116. package/dist/types-ts4.0/utils/url.d.ts +0 -23
  117. package/dist/types-ts4.0/utils/uuid.d.ts +0 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 24.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c2510fa261f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c2510fa261f) - [ux] ED-15961 [ux] Updates the presentation of text color to use dark and light mode colors when those modes are enabled
8
+ - Updated dependencies
9
+
10
+ ## 24.0.2
11
+
12
+ ### Patch Changes
13
+
14
+ - [`b86981a0cf0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b86981a0cf0) - [ux] ED-15426 fix broken copy paste of block card. Add content to schema toDOM.
15
+ - Updated dependencies
16
+
3
17
  ## 24.0.1
4
18
 
5
19
  ### Patch Changes
@@ -11,6 +11,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
11
11
 
12
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
13
 
14
+ var _editorPalette = require("@atlaskit/editor-palette");
15
+
14
16
  var _groups = require("../groups");
15
17
 
16
18
  var _colors = require("../../utils/colors");
@@ -85,7 +87,15 @@ var textColor = {
85
87
  color: hexColor
86
88
  } : false;
87
89
  }
88
- }, {
90
+ }, // This rule ensures when loading from a renderer or editor where the
91
+ // presented text color does not match the stored hex color -- that the
92
+ // text color is preserved.
93
+ //
94
+ // This was initially introduced to ensure text-color marks were not lost
95
+ // when text-color was used inside a link, and is now also used to support
96
+ // where the hex color stored in ADF is used as an ID for a design system
97
+ // token (and based on theme mode -- the presented color will change).
98
+ {
89
99
  tag: '.fabric-text-color-mark',
90
100
  getAttrs: function getAttrs(maybeElement) {
91
101
  if (!(maybeElement instanceof HTMLElement)) {
@@ -99,9 +109,13 @@ var textColor = {
99
109
  }
100
110
  }],
101
111
  toDOM: function toDOM(mark) {
112
+ // Note -- while there is no way to create custom colors using default tooling
113
+ // the editor does supported ad hoc color values -- and there may be content
114
+ // which has been migrated or created via apis which use such values.
115
+ var paletteColorValue = (0, _editorPalette.hexToEditorTextPaletteColor)(mark.attrs.color) || mark.attrs.color;
102
116
  return ['span', (0, _defineProperty2.default)({
103
117
  class: 'fabric-text-color-mark',
104
- style: "--custom-text-color: ".concat(mark.attrs.color)
118
+ style: "--custom-palette-color: ".concat(paletteColorValue)
105
119
  }, 'data-text-custom-color', mark.attrs.color)];
106
120
  }
107
121
  };
@@ -45,12 +45,14 @@ var blockCard = {
45
45
  }
46
46
  }],
47
47
  toDOM: function toDOM(node) {
48
+ var _node$attrs;
49
+
48
50
  var attrs = {
49
51
  'data-block-card': '',
50
52
  href: node.attrs.url || '',
51
53
  'data-card-data': node.attrs.data ? JSON.stringify(node.attrs.data) : ''
52
54
  };
53
- return ['a', attrs];
55
+ return ['a', attrs, (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.url) || ' '];
54
56
  }
55
57
  };
56
58
  exports.blockCard = blockCard;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "24.0.1",
3
+ "version": "24.0.3",
4
4
  "sideEffects": false
5
5
  }
@@ -1,3 +1,4 @@
1
+ import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
1
2
  import { COLOR } from '../groups';
2
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';
3
4
  const colorArrayPalette = [// default row
@@ -56,7 +57,15 @@ export const textColor = {
56
57
  color: hexColor
57
58
  } : false;
58
59
  }
59
- }, {
60
+ }, // This rule ensures when loading from a renderer or editor where the
61
+ // presented text color does not match the stored hex color -- that the
62
+ // text color is preserved.
63
+ //
64
+ // This was initially introduced to ensure text-color marks were not lost
65
+ // when text-color was used inside a link, and is now also used to support
66
+ // where the hex color stored in ADF is used as an ID for a design system
67
+ // token (and based on theme mode -- the presented color will change).
68
+ {
60
69
  tag: '.fabric-text-color-mark',
61
70
  getAttrs: maybeElement => {
62
71
  if (!(maybeElement instanceof HTMLElement)) {
@@ -71,9 +80,13 @@ export const textColor = {
71
80
  }],
72
81
 
73
82
  toDOM(mark) {
83
+ // Note -- while there is no way to create custom colors using default tooling
84
+ // the editor does supported ad hoc color values -- and there may be content
85
+ // which has been migrated or created via apis which use such values.
86
+ const paletteColorValue = hexToEditorTextPaletteColor(mark.attrs.color) || mark.attrs.color;
74
87
  return ['span', {
75
88
  class: 'fabric-text-color-mark',
76
- style: `--custom-text-color: ${mark.attrs.color}`,
89
+ style: `--custom-palette-color: ${paletteColorValue}`,
77
90
  ['data-text-custom-color']: mark.attrs.color
78
91
  }];
79
92
  }
@@ -39,12 +39,14 @@ export const blockCard = {
39
39
  }],
40
40
 
41
41
  toDOM(node) {
42
+ var _node$attrs;
43
+
42
44
  const attrs = {
43
45
  'data-block-card': '',
44
46
  href: node.attrs.url || '',
45
47
  'data-card-data': node.attrs.data ? JSON.stringify(node.attrs.data) : ''
46
48
  };
47
- return ['a', attrs];
49
+ return ['a', attrs, (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.url) || ' '];
48
50
  }
49
51
 
50
52
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "24.0.1",
3
+ "version": "24.0.3",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
3
4
  import { COLOR } from '../groups';
4
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';
5
6
  var colorArrayPalette = [// default row
@@ -70,7 +71,15 @@ export var textColor = {
70
71
  color: hexColor
71
72
  } : false;
72
73
  }
73
- }, {
74
+ }, // This rule ensures when loading from a renderer or editor where the
75
+ // presented text color does not match the stored hex color -- that the
76
+ // text color is preserved.
77
+ //
78
+ // This was initially introduced to ensure text-color marks were not lost
79
+ // when text-color was used inside a link, and is now also used to support
80
+ // where the hex color stored in ADF is used as an ID for a design system
81
+ // token (and based on theme mode -- the presented color will change).
82
+ {
74
83
  tag: '.fabric-text-color-mark',
75
84
  getAttrs: function getAttrs(maybeElement) {
76
85
  if (!(maybeElement instanceof HTMLElement)) {
@@ -84,9 +93,13 @@ export var textColor = {
84
93
  }
85
94
  }],
86
95
  toDOM: function toDOM(mark) {
96
+ // Note -- while there is no way to create custom colors using default tooling
97
+ // the editor does supported ad hoc color values -- and there may be content
98
+ // which has been migrated or created via apis which use such values.
99
+ var paletteColorValue = hexToEditorTextPaletteColor(mark.attrs.color) || mark.attrs.color;
87
100
  return ['span', _defineProperty({
88
101
  class: 'fabric-text-color-mark',
89
- style: "--custom-text-color: ".concat(mark.attrs.color)
102
+ style: "--custom-palette-color: ".concat(paletteColorValue)
90
103
  }, 'data-text-custom-color', mark.attrs.color)];
91
104
  }
92
105
  };
@@ -38,11 +38,13 @@ export var blockCard = {
38
38
  }
39
39
  }],
40
40
  toDOM: function toDOM(node) {
41
+ var _node$attrs;
42
+
41
43
  var attrs = {
42
44
  'data-block-card': '',
43
45
  href: node.attrs.url || '',
44
46
  'data-card-data': node.attrs.data ? JSON.stringify(node.attrs.data) : ''
45
47
  };
46
- return ['a', attrs];
48
+ return ['a', attrs, (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.url) || ' '];
47
49
  }
48
50
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "24.0.1",
3
+ "version": "24.0.3",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "24.0.1",
3
+ "version": "24.0.3",
4
4
  "description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,13 +12,6 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
- "typesVersions": {
16
- ">=4.0 <4.5": {
17
- "*": [
18
- "dist/types-ts4.0/*"
19
- ]
20
- }
21
- },
22
15
  "sideEffects": false,
23
16
  "atlaskit:src": "src/index.ts",
24
17
  "atlassian": {
@@ -46,7 +39,8 @@
46
39
  },
47
40
  "dependencies": {
48
41
  "@atlaskit/codemod-utils": "^4.1.0",
49
- "@atlaskit/editor-tables": "^2.1.0",
42
+ "@atlaskit/editor-palette": "0.1.0",
43
+ "@atlaskit/editor-tables": "^2.2.0",
50
44
  "@babel/runtime": "^7.0.0",
51
45
  "@types/linkify-it": "^2.0.4",
52
46
  "@types/prosemirror-model": "^1.11.0",
@@ -61,7 +55,7 @@
61
55
  "@atlaskit/adf-utils": "^17.1.0",
62
56
  "@atlaskit/editor-json-transformer": "^8.8.0",
63
57
  "@atlaskit/editor-test-helpers": "^17.2.0",
64
- "@atlaskit/json-schema-generator": "^3.2.0",
58
+ "@atlaskit/json-schema-generator": "^3.3.0",
65
59
  "@atlassian/adf-sample": "^1.1.0",
66
60
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
67
61
  "@types/prosemirror-history": "^1.0.1",
@@ -79,7 +73,10 @@
79
73
  ]
80
74
  },
81
75
  "@repo/internal": {
82
- "deprecation": "no-deprecated-imports"
76
+ "deprecation": "no-deprecated-imports",
77
+ "styling": [
78
+ "emotion"
79
+ ]
83
80
  }
84
81
  },
85
82
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"