@atlaskit/adf-schema 57.3.3 → 57.4.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 57.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`3bae5cd6dc118`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3bae5cd6dc118) -
8
+ EDITOR-8815: On stage-0 ADF, `status.attrs.color` is no longer a closed enum of six names. It is a
9
+ string that must match `neutral | purple | blue | red | yellow | green | #[0-9a-fA-F]{6}`.
10
+ Existing named colors stay valid. Full-schema status color is unchanged and still validates those
11
+ six names only. The public `StatusDefinition` type now types `color` as `string`.
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
17
+ ## 57.3.4
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 57.3.3
4
24
 
5
25
  ### Patch Changes
@@ -1,40 +1,52 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.status = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
9
  var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
10
  var _annotation = require("../marks/annotation");
9
11
  var _unsupportedMark = require("../marks/unsupportedMark");
10
12
  var _unsupportedNodeAttribute = require("../marks/unsupportedNodeAttribute");
13
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
15
+ var statusAttrs = {
16
+ text: {
17
+ minLength: 1,
18
+ type: 'string',
19
+ default: ''
20
+ },
21
+ color: {
22
+ type: 'enum',
23
+ values: ['neutral', 'purple', 'blue', 'red', 'yellow', 'green'],
24
+ default: ''
25
+ },
26
+ localId: {
27
+ type: 'string',
28
+ optional: true,
29
+ default: ''
30
+ },
31
+ style: {
32
+ type: 'string',
33
+ optional: true,
34
+ default: ''
35
+ }
36
+ };
11
37
  var status = exports.status = (0, _adfSchemaGenerator.adfNode)('status').define({
12
38
  inline: true,
13
39
  selectable: true,
14
40
  marks: [_unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark],
15
- attrs: {
16
- text: {
17
- minLength: 1,
18
- type: 'string',
19
- default: ''
20
- },
21
- color: {
22
- type: 'enum',
23
- values: ['neutral', 'purple', 'blue', 'red', 'yellow', 'green'],
24
- default: ''
25
- },
26
- localId: {
27
- type: 'string',
28
- optional: true,
29
- default: ''
30
- },
31
- style: {
32
- type: 'string',
33
- optional: true,
34
- default: ''
35
- }
36
- },
41
+ attrs: statusAttrs,
37
42
  stage0: {
38
- marks: [_unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark, _annotation.annotation]
43
+ marks: [_unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark, _annotation.annotation],
44
+ attrs: _objectSpread(_objectSpread({}, statusAttrs), {}, {
45
+ color: {
46
+ type: 'string',
47
+ pattern: '^(neutral|purple|blue|red|yellow|green|#[0-9a-fA-F]{6})$',
48
+ default: ''
49
+ }
50
+ })
39
51
  }
40
52
  });
@@ -1872,8 +1872,8 @@ var status = exports.status = {
1872
1872
  attrs: {
1873
1873
  props: {
1874
1874
  color: {
1875
- type: 'enum',
1876
- values: ['neutral', 'purple', 'blue', 'red', 'yellow', 'green']
1875
+ pattern: '^(neutral|purple|blue|red|yellow|green|#[0-9a-fA-F]{6})$',
1876
+ type: 'string'
1877
1877
  },
1878
1878
  localId: {
1879
1879
  optional: true,
@@ -2,33 +2,42 @@ import { adfNode } from '@atlaskit/adf-schema-generator';
2
2
  import { annotation } from '../marks/annotation';
3
3
  import { unsupportedMark } from '../marks/unsupportedMark';
4
4
  import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute';
5
+ const statusAttrs = {
6
+ text: {
7
+ minLength: 1,
8
+ type: 'string',
9
+ default: ''
10
+ },
11
+ color: {
12
+ type: 'enum',
13
+ values: ['neutral', 'purple', 'blue', 'red', 'yellow', 'green'],
14
+ default: ''
15
+ },
16
+ localId: {
17
+ type: 'string',
18
+ optional: true,
19
+ default: ''
20
+ },
21
+ style: {
22
+ type: 'string',
23
+ optional: true,
24
+ default: ''
25
+ }
26
+ };
5
27
  export const status = adfNode('status').define({
6
28
  inline: true,
7
29
  selectable: true,
8
30
  marks: [unsupportedNodeAttribute, unsupportedMark],
9
- attrs: {
10
- text: {
11
- minLength: 1,
12
- type: 'string',
13
- default: ''
14
- },
15
- color: {
16
- type: 'enum',
17
- values: ['neutral', 'purple', 'blue', 'red', 'yellow', 'green'],
18
- default: ''
19
- },
20
- localId: {
21
- type: 'string',
22
- optional: true,
23
- default: ''
24
- },
25
- style: {
26
- type: 'string',
27
- optional: true,
28
- default: ''
29
- }
30
- },
31
+ attrs: statusAttrs,
31
32
  stage0: {
32
- marks: [unsupportedNodeAttribute, unsupportedMark, annotation]
33
+ marks: [unsupportedNodeAttribute, unsupportedMark, annotation],
34
+ attrs: {
35
+ ...statusAttrs,
36
+ color: {
37
+ type: 'string',
38
+ pattern: '^(neutral|purple|blue|red|yellow|green|#[0-9a-fA-F]{6})$',
39
+ default: ''
40
+ }
41
+ }
33
42
  }
34
43
  });
@@ -1865,8 +1865,8 @@ export const status = {
1865
1865
  attrs: {
1866
1866
  props: {
1867
1867
  color: {
1868
- type: 'enum',
1869
- values: ['neutral', 'purple', 'blue', 'red', 'yellow', 'green']
1868
+ pattern: '^(neutral|purple|blue|red|yellow|green|#[0-9a-fA-F]{6})$',
1869
+ type: 'string'
1870
1870
  },
1871
1871
  localId: {
1872
1872
  optional: true,
@@ -1,34 +1,45 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1
4
  import { adfNode } from '@atlaskit/adf-schema-generator';
2
5
  import { annotation } from '../marks/annotation';
3
6
  import { unsupportedMark } from '../marks/unsupportedMark';
4
7
  import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute';
8
+ var statusAttrs = {
9
+ text: {
10
+ minLength: 1,
11
+ type: 'string',
12
+ default: ''
13
+ },
14
+ color: {
15
+ type: 'enum',
16
+ values: ['neutral', 'purple', 'blue', 'red', 'yellow', 'green'],
17
+ default: ''
18
+ },
19
+ localId: {
20
+ type: 'string',
21
+ optional: true,
22
+ default: ''
23
+ },
24
+ style: {
25
+ type: 'string',
26
+ optional: true,
27
+ default: ''
28
+ }
29
+ };
5
30
  export var status = adfNode('status').define({
6
31
  inline: true,
7
32
  selectable: true,
8
33
  marks: [unsupportedNodeAttribute, unsupportedMark],
9
- attrs: {
10
- text: {
11
- minLength: 1,
12
- type: 'string',
13
- default: ''
14
- },
15
- color: {
16
- type: 'enum',
17
- values: ['neutral', 'purple', 'blue', 'red', 'yellow', 'green'],
18
- default: ''
19
- },
20
- localId: {
21
- type: 'string',
22
- optional: true,
23
- default: ''
24
- },
25
- style: {
26
- type: 'string',
27
- optional: true,
28
- default: ''
29
- }
30
- },
34
+ attrs: statusAttrs,
31
35
  stage0: {
32
- marks: [unsupportedNodeAttribute, unsupportedMark, annotation]
36
+ marks: [unsupportedNodeAttribute, unsupportedMark, annotation],
37
+ attrs: _objectSpread(_objectSpread({}, statusAttrs), {}, {
38
+ color: {
39
+ type: 'string',
40
+ pattern: '^(neutral|purple|blue|red|yellow|green|#[0-9a-fA-F]{6})$',
41
+ default: ''
42
+ }
43
+ })
33
44
  }
34
45
  });
@@ -1865,8 +1865,8 @@ export var status = {
1865
1865
  attrs: {
1866
1866
  props: {
1867
1867
  color: {
1868
- type: 'enum',
1869
- values: ['neutral', 'purple', 'blue', 'red', 'yellow', 'green']
1868
+ pattern: '^(neutral|purple|blue|red|yellow|green|#[0-9a-fA-F]{6})$',
1869
+ type: 'string'
1870
1870
  },
1871
1871
  localId: {
1872
1872
  optional: true,
@@ -3416,7 +3416,8 @@
3416
3416
  "type": "string"
3417
3417
  },
3418
3418
  "color": {
3419
- "enum": ["neutral", "purple", "blue", "red", "yellow", "green"]
3419
+ "type": "string",
3420
+ "pattern": "^(neutral|purple|blue|red|yellow|green|#[0-9a-fA-F]{6})$"
3420
3421
  },
3421
3422
  "localId": {
3422
3423
  "type": "string"
@@ -946,7 +946,7 @@ export interface StatusStage0Definition {
946
946
  marks: Array<AnnotationMark | UnsupportedMarkMark | UnsupportedNodeAttributeMark>;
947
947
  attrs: {
948
948
  text: string;
949
- color: 'neutral' | 'purple' | 'blue' | 'red' | 'yellow' | 'green';
949
+ color: string;
950
950
  localId?: string;
951
951
  style?: string;
952
952
  };
@@ -5,7 +5,7 @@ import type { NodeSpec } from '@atlaskit/editor-prosemirror/model';
5
5
  */
6
6
  export interface StatusDefinition {
7
7
  attrs: {
8
- color: 'neutral' | 'purple' | 'blue' | 'red' | 'yellow' | 'green';
8
+ color: string;
9
9
  localId?: string;
10
10
  /**
11
11
  * Supported values are bold, subtle, and mixedCase
@@ -1884,8 +1884,8 @@ export declare const status: {
1884
1884
  attrs: {
1885
1885
  props: {
1886
1886
  color: {
1887
+ pattern: string;
1887
1888
  type: string;
1888
- values: string[];
1889
1889
  };
1890
1890
  localId: {
1891
1891
  optional: boolean;
@@ -3416,7 +3416,8 @@
3416
3416
  "type": "string"
3417
3417
  },
3418
3418
  "color": {
3419
- "enum": ["neutral", "purple", "blue", "red", "yellow", "green"]
3419
+ "type": "string",
3420
+ "pattern": "^(neutral|purple|blue|red|yellow|green|#[0-9a-fA-F]{6})$"
3420
3421
  },
3421
3422
  "localId": {
3422
3423
  "type": "string"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "57.3.3",
3
+ "version": "57.4.0",
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/"
@@ -40,7 +40,7 @@
40
40
  "@atlaskit/adf-schema-generator": "^4.0.0",
41
41
  "@atlaskit/editor-prosemirror": "^8.0.0",
42
42
  "@atlaskit/platform-feature-flags": "^2.2.0",
43
- "@atlaskit/tmp-editor-statsig": "^177.0.0",
43
+ "@atlaskit/tmp-editor-statsig": "^179.0.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "css-color-names": "0.0.4",
46
46
  "linkify-it": "^5.0.2",