@atlaskit/adf-schema 36.10.6 → 36.10.8

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 (34) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/next-schema/nodes/blockCard.js +2 -1
  3. package/dist/cjs/next-schema/nodes/bodiedExtension.js +0 -1
  4. package/dist/cjs/next-schema/nodes/extension.js +0 -1
  5. package/dist/cjs/next-schema/nodes/hardBreak.js +1 -0
  6. package/dist/cjs/next-schema/nodes/inlineCard.js +0 -1
  7. package/dist/cjs/next-schema/nodes/inlineExtension.js +0 -1
  8. package/dist/cjs/next-schema/nodes/mediaInline.js +0 -1
  9. package/dist/cjs/next-schema/nodes/mention.js +2 -1
  10. package/dist/cjs/next-schema/nodes/multiBodiedExtension.js +0 -1
  11. package/dist/cjs/utils/uuid.js +7 -2
  12. package/dist/es2019/next-schema/nodes/blockCard.js +2 -1
  13. package/dist/es2019/next-schema/nodes/bodiedExtension.js +0 -1
  14. package/dist/es2019/next-schema/nodes/extension.js +0 -1
  15. package/dist/es2019/next-schema/nodes/hardBreak.js +1 -0
  16. package/dist/es2019/next-schema/nodes/inlineCard.js +0 -1
  17. package/dist/es2019/next-schema/nodes/inlineExtension.js +0 -1
  18. package/dist/es2019/next-schema/nodes/mediaInline.js +0 -1
  19. package/dist/es2019/next-schema/nodes/mention.js +2 -1
  20. package/dist/es2019/next-schema/nodes/multiBodiedExtension.js +0 -1
  21. package/dist/es2019/utils/uuid.js +7 -4
  22. package/dist/esm/next-schema/nodes/blockCard.js +2 -1
  23. package/dist/esm/next-schema/nodes/bodiedExtension.js +0 -1
  24. package/dist/esm/next-schema/nodes/extension.js +0 -1
  25. package/dist/esm/next-schema/nodes/hardBreak.js +1 -0
  26. package/dist/esm/next-schema/nodes/inlineCard.js +0 -1
  27. package/dist/esm/next-schema/nodes/inlineExtension.js +0 -1
  28. package/dist/esm/next-schema/nodes/mediaInline.js +0 -1
  29. package/dist/esm/next-schema/nodes/mention.js +2 -1
  30. package/dist/esm/next-schema/nodes/multiBodiedExtension.js +0 -1
  31. package/dist/esm/utils/uuid.js +7 -2
  32. package/dist/types/utils/uuid.d.ts +2 -2
  33. package/package.json +3 -4
  34. package/schema-generators/pm-full-schema.ts +1 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 36.10.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 78e9cf4: Change types to account for parameter and data attributes
8
+
9
+ ## 36.10.7
10
+
11
+ ### Patch Changes
12
+
13
+ - b05b267: reverted uuid migration due to upstream issues with tesseract
14
+
3
15
  ## 36.10.6
4
16
 
5
17
  ### Patch Changes
@@ -21,10 +21,12 @@ var blockCard = exports.blockCard = (0, _adfSchemaGenerator.adfNode)('blockCard'
21
21
  id: {
22
22
  type: 'string'
23
23
  },
24
+ // Empty parameters object carried over from original JSON Schema.
24
25
  parameters: {},
25
26
  views: {
26
27
  items: {
27
28
  properties: {
29
+ // Empty properties object carried over from original JSON Schema
28
30
  properties: {},
29
31
  type: {
30
32
  type: 'string'
@@ -52,7 +54,6 @@ var blockCard = exports.blockCard = (0, _adfSchemaGenerator.adfNode)('blockCard'
52
54
  }
53
55
  }, {
54
56
  data: {
55
- type: 'object',
56
57
  optional: true
57
58
  }
58
59
  }]
@@ -26,7 +26,6 @@ var bodiedExtension = exports.bodiedExtension = (0, _adfSchemaGenerator.adfNode)
26
26
  default: ''
27
27
  },
28
28
  parameters: {
29
- type: 'object',
30
29
  optional: true,
31
30
  default: null
32
31
  },
@@ -22,7 +22,6 @@ var extension = exports.extension = (0, _adfSchemaGenerator.adfNode)('extension'
22
22
  default: ''
23
23
  },
24
24
  parameters: {
25
- type: 'object',
26
25
  optional: true,
27
26
  default: null
28
27
  },
@@ -9,6 +9,7 @@ var hardBreak = exports.hardBreak = (0, _adfSchemaGenerator.adfNode)('hardBreak'
9
9
  inline: true,
10
10
  selectable: false,
11
11
  attrs: {
12
+ // Carried over from original JSON Schema as is
12
13
  text: {
13
14
  type: 'enum',
14
15
  values: ['\n'],
@@ -19,7 +19,6 @@ var inlineCard = exports.inlineCard = (0, _adfSchemaGenerator.adfNode)('inlineCa
19
19
  }
20
20
  }, {
21
21
  data: {
22
- type: 'object',
23
22
  optional: true,
24
23
  default: null
25
24
  }
@@ -20,7 +20,6 @@ var inlineExtension = exports.inlineExtension = (0, _adfSchemaGenerator.adfNode)
20
20
  default: ''
21
21
  },
22
22
  parameters: {
23
- type: 'object',
24
23
  optional: true,
25
24
  default: null
26
25
  },
@@ -14,7 +14,6 @@ var mediaInline = exports.mediaInline = (0, _adfSchemaGenerator.adfNode)('mediaI
14
14
  marks: [_link.link, _annotation.annotation, _border.border],
15
15
  attrs: {
16
16
  data: {
17
- type: 'object',
18
17
  optional: true
19
18
  },
20
19
  type: {
@@ -14,7 +14,8 @@ var mention = exports.mention = (0, _adfSchemaGenerator.adfNode)('mention').defi
14
14
  default: ''
15
15
  },
16
16
  localId: {
17
- type: 'string'
17
+ type: 'string',
18
+ optional: true
18
19
  },
19
20
  text: {
20
21
  type: 'string',
@@ -21,7 +21,6 @@ var multiBodiedExtension = exports.multiBodiedExtension = (0, _adfSchemaGenerato
21
21
  default: ''
22
22
  },
23
23
  parameters: {
24
- type: 'object',
25
24
  optional: true,
26
25
  default: null
27
26
  },
@@ -4,10 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.uuid = exports.generateUuid = void 0;
7
- var _uuid = require("uuid");
7
+ /* eslint-disable no-bitwise */
8
8
  var generateUuid = exports.generateUuid = function generateUuid() {
9
- return (0, _uuid.v4)();
9
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
10
+ var r = Math.random() * 16 | 0;
11
+ return (c === 'x' ? r : r & 0x3 | 0x8).toString(16);
12
+ });
10
13
  };
14
+
15
+ /* eslint-enable no-bitwise */
11
16
  var staticValue = false;
12
17
  var uuid = exports.uuid = {
13
18
  setStatic: function setStatic(value) {
@@ -15,10 +15,12 @@ export const blockCard = adfNode('blockCard').define({
15
15
  id: {
16
16
  type: 'string'
17
17
  },
18
+ // Empty parameters object carried over from original JSON Schema.
18
19
  parameters: {},
19
20
  views: {
20
21
  items: {
21
22
  properties: {
23
+ // Empty properties object carried over from original JSON Schema
22
24
  properties: {},
23
25
  type: {
24
26
  type: 'string'
@@ -46,7 +48,6 @@ export const blockCard = adfNode('blockCard').define({
46
48
  }
47
49
  }, {
48
50
  data: {
49
- type: 'object',
50
51
  optional: true
51
52
  }
52
53
  }]
@@ -18,7 +18,6 @@ export const bodiedExtension = adfNode('bodiedExtension').define({
18
18
  default: ''
19
19
  },
20
20
  parameters: {
21
- type: 'object',
22
21
  optional: true,
23
22
  default: null
24
23
  },
@@ -16,7 +16,6 @@ export const extension = adfNode('extension').define({
16
16
  default: ''
17
17
  },
18
18
  parameters: {
19
- type: 'object',
20
19
  optional: true,
21
20
  default: null
22
21
  },
@@ -3,6 +3,7 @@ export const hardBreak = adfNode('hardBreak').define({
3
3
  inline: true,
4
4
  selectable: false,
5
5
  attrs: {
6
+ // Carried over from original JSON Schema as is
6
7
  text: {
7
8
  type: 'enum',
8
9
  values: ['\n'],
@@ -13,7 +13,6 @@ export const inlineCard = adfNode('inlineCard').define({
13
13
  }
14
14
  }, {
15
15
  data: {
16
- type: 'object',
17
16
  optional: true,
18
17
  default: null
19
18
  }
@@ -14,7 +14,6 @@ export const inlineExtension = adfNode('inlineExtension').define({
14
14
  default: ''
15
15
  },
16
16
  parameters: {
17
- type: 'object',
18
17
  optional: true,
19
18
  default: null
20
19
  },
@@ -8,7 +8,6 @@ export const mediaInline = adfNode('mediaInline').define({
8
8
  marks: [link, annotation, border],
9
9
  attrs: {
10
10
  data: {
11
- type: 'object',
12
11
  optional: true
13
12
  },
14
13
  type: {
@@ -8,7 +8,8 @@ export const mention = adfNode('mention').define({
8
8
  default: ''
9
9
  },
10
10
  localId: {
11
- type: 'string'
11
+ type: 'string',
12
+ optional: true
12
13
  },
13
14
  text: {
14
15
  type: 'string',
@@ -15,7 +15,6 @@ export const multiBodiedExtension = adfNode('multiBodiedExtension').define({
15
15
  default: ''
16
16
  },
17
17
  parameters: {
18
- type: 'object',
19
18
  optional: true,
20
19
  default: null
21
20
  },
@@ -1,7 +1,10 @@
1
- import { v4 as uuidGen } from 'uuid';
2
- export const generateUuid = () => {
3
- return uuidGen();
4
- };
1
+ /* eslint-disable no-bitwise */
2
+ export const generateUuid = () => 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
3
+ const r = Math.random() * 16 | 0;
4
+ return (c === 'x' ? r : r & 0x3 | 0x8).toString(16);
5
+ });
6
+
7
+ /* eslint-enable no-bitwise */
5
8
  let staticValue = false;
6
9
  export const uuid = {
7
10
  setStatic(value) {
@@ -15,10 +15,12 @@ export var blockCard = adfNode('blockCard').define({
15
15
  id: {
16
16
  type: 'string'
17
17
  },
18
+ // Empty parameters object carried over from original JSON Schema.
18
19
  parameters: {},
19
20
  views: {
20
21
  items: {
21
22
  properties: {
23
+ // Empty properties object carried over from original JSON Schema
22
24
  properties: {},
23
25
  type: {
24
26
  type: 'string'
@@ -46,7 +48,6 @@ export var blockCard = adfNode('blockCard').define({
46
48
  }
47
49
  }, {
48
50
  data: {
49
- type: 'object',
50
51
  optional: true
51
52
  }
52
53
  }]
@@ -19,7 +19,6 @@ export var bodiedExtension = adfNode('bodiedExtension').define({
19
19
  default: ''
20
20
  },
21
21
  parameters: {
22
- type: 'object',
23
22
  optional: true,
24
23
  default: null
25
24
  },
@@ -16,7 +16,6 @@ export var extension = adfNode('extension').define({
16
16
  default: ''
17
17
  },
18
18
  parameters: {
19
- type: 'object',
20
19
  optional: true,
21
20
  default: null
22
21
  },
@@ -3,6 +3,7 @@ export var hardBreak = adfNode('hardBreak').define({
3
3
  inline: true,
4
4
  selectable: false,
5
5
  attrs: {
6
+ // Carried over from original JSON Schema as is
6
7
  text: {
7
8
  type: 'enum',
8
9
  values: ['\n'],
@@ -13,7 +13,6 @@ export var inlineCard = adfNode('inlineCard').define({
13
13
  }
14
14
  }, {
15
15
  data: {
16
- type: 'object',
17
16
  optional: true,
18
17
  default: null
19
18
  }
@@ -14,7 +14,6 @@ export var inlineExtension = adfNode('inlineExtension').define({
14
14
  default: ''
15
15
  },
16
16
  parameters: {
17
- type: 'object',
18
17
  optional: true,
19
18
  default: null
20
19
  },
@@ -8,7 +8,6 @@ export var mediaInline = adfNode('mediaInline').define({
8
8
  marks: [link, annotation, border],
9
9
  attrs: {
10
10
  data: {
11
- type: 'object',
12
11
  optional: true
13
12
  },
14
13
  type: {
@@ -8,7 +8,8 @@ export var mention = adfNode('mention').define({
8
8
  default: ''
9
9
  },
10
10
  localId: {
11
- type: 'string'
11
+ type: 'string',
12
+ optional: true
12
13
  },
13
14
  text: {
14
15
  type: 'string',
@@ -15,7 +15,6 @@ export var multiBodiedExtension = adfNode('multiBodiedExtension').define({
15
15
  default: ''
16
16
  },
17
17
  parameters: {
18
- type: 'object',
19
18
  optional: true,
20
19
  default: null
21
20
  },
@@ -1,7 +1,12 @@
1
- import { v4 as uuidGen } from 'uuid';
1
+ /* eslint-disable no-bitwise */
2
2
  export var generateUuid = function generateUuid() {
3
- return uuidGen();
3
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
4
+ var r = Math.random() * 16 | 0;
5
+ return (c === 'x' ? r : r & 0x3 | 0x8).toString(16);
6
+ });
4
7
  };
8
+
9
+ /* eslint-enable no-bitwise */
5
10
  var staticValue = false;
6
11
  export var uuid = {
7
12
  setStatic: function setStatic(value) {
@@ -1,5 +1,5 @@
1
- export declare const generateUuid: () => any;
1
+ export declare const generateUuid: () => string;
2
2
  export declare const uuid: {
3
3
  setStatic(value: string | false): void;
4
- generate(): any;
4
+ generate(): string;
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "36.10.6",
3
+ "version": "36.10.8",
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/"
@@ -41,12 +41,11 @@
41
41
  "@babel/runtime": "^7.0.0",
42
42
  "css-color-names": "0.0.4",
43
43
  "linkify-it": "^2.0.3",
44
- "memoize-one": "^6.0.0",
45
- "uuid": "^9.0.1"
44
+ "memoize-one": "^6.0.0"
46
45
  },
47
46
  "devDependencies": {
48
47
  "@atlassian/adf-schema-json": "^1.15.0",
49
- "@atlaskit/adf-schema-generator": "^1.7.10",
48
+ "@atlaskit/adf-schema-generator": "^1.8.1",
50
49
  "@babel/cli": "^7.22.9",
51
50
  "@babel/core": "^7.22.9",
52
51
  "@babel/plugin-proposal-class-properties": "^7.18.6",
@@ -1,6 +1,5 @@
1
- import { adfToPm } from '@atlaskit/adf-schema-generator';
1
+ import { adfToPm, writeToFile } from '@atlaskit/adf-schema-generator';
2
2
  import adfNode from 'src/next-schema/full-schema.adf';
3
- import { writeToFile } from '../../adf-schema-generator/src/transforms/codeGenHelpers';
4
3
 
5
4
  function main() {
6
5
  const output = adfToPm(adfNode);