@atlaskit/adf-schema 30.1.0 → 30.2.1

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,19 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 30.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - fb8dcc0: Loosen eslint rules and change comments
8
+ - Updated dependencies [fb8dcc0]
9
+ - @atlaskit/editor-prosemirror@1.1.7
10
+
11
+ ## 30.2.0
12
+
13
+ ### Minor Changes
14
+
15
+ - 9a8af3a: Promote widthType to full schema
16
+
3
17
  ## 30.1.0
4
18
 
5
19
  ### Minor Changes
@@ -114,7 +114,7 @@ var nodesInOrder = [{
114
114
  spec: _nodes.mediaGroup
115
115
  }, {
116
116
  name: 'mediaSingle',
117
- spec: _nodes.mediaSingleWithCaption
117
+ spec: _nodes.mediaSingleFull
118
118
  }, {
119
119
  name: 'mediaInline',
120
120
  spec: _nodes.mediaInline
@@ -24,8 +24,7 @@ var getSchemaBasedOnStage = (0, _memoizeOne.default)(function () {
24
24
  var defaultSchemaConfig = getDefaultSchemaConfig();
25
25
  if (stage === 'stage0') {
26
26
  defaultSchemaConfig.customNodeSpecs = {
27
- layoutSection: _nodes.layoutSectionWithSingleColumn,
28
- mediaSingle: _nodes.mediaSingleFull
27
+ layoutSection: _nodes.layoutSectionWithSingleColumn
29
28
  };
30
29
  }
31
30
  return (0, _createSchema.createSchema)(defaultSchemaConfig);
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.WidthType = void 0;
7
7
  /**
8
- * @stage 0
9
8
  * @description The widthType attribute is used to support fixed with media single
10
9
  */
11
10
  var WidthType = /*#__PURE__*/function (WidthType) {
@@ -16,8 +16,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
16
16
  var namedColors = _interopRequireWildcard(require("css-color-names"));
17
17
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
18
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
- // eslint-disable-line import/extensions
20
-
21
19
  /**
22
20
  * We're avoding importing these colors from @atlaskit/theme since we
23
21
  * do not want to have react as a dependency of this package.
@@ -25,9 +25,8 @@ exports.hexToEditorTextPaletteColor = hexToEditorTextPaletteColor;
25
25
  * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
26
26
  */
27
27
  function hexToEditorBorderPaletteColor(hexColor) {
28
- // Ts ignore used to allow use of conditional return type
28
+ // Ts ignore was used to allow use of conditional return type
29
29
  // (preferencing better type on consumption over safety in implementation)
30
- // @ts-ignore
31
30
  return editorBorderPalette[hexColor.toUpperCase()];
32
31
  }
33
32
  var editorBorderPalette = {
@@ -58,9 +57,8 @@ var editorBorderPalette = {
58
57
  */
59
58
  exports.editorBorderPalette = editorBorderPalette;
60
59
  function hexToEditorTextPaletteColor(hexColor) {
61
- // Ts ignore used to allow use of conditional return type
60
+ // Ts ignore was used to allow use of conditional return type
62
61
  // (preferencing better type on consumption over safety in implementation)
63
- // @ts-ignore
64
62
  return editorTextPalette[hexColor.toUpperCase()];
65
63
  }
66
64
  var editorTextPalette = {
@@ -123,9 +121,8 @@ var editorTextPalette = {
123
121
  */
124
122
  exports.editorTextPalette = editorTextPalette;
125
123
  function hexToEditorBackgroundPaletteRawValue(hexColor) {
126
- // Ts ignore used to allow use of conditional return type
124
+ // Ts ignore was used to allow use of conditional return type
127
125
  // (preferencing better type on consumption over safety in implementation)
128
- // @ts-ignore
129
126
  var tokenData = editorBackgroundPalette[hexColor.toUpperCase()];
130
127
  return tokenData ? tokenData.getValue(hexColor) : undefined;
131
128
  }
@@ -1,7 +1,7 @@
1
1
  import { Schema } from '@atlaskit/editor-prosemirror/model';
2
2
  import { COLOR, FONT_STYLE, SEARCH_QUERY, LINK } from './groups';
3
3
  import { link, em, strong, textColor, strike, subsup, underline, code, typeAheadQuery, confluenceInlineComment, breakout, alignment, indentation, annotation, unsupportedMark, unsupportedNodeAttribute, dataConsumer, fragment, border } from './marks';
4
- import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder, listItem, heading, blockquote, codeBlock, panel, rule, image, mention, media, mediaInline, mediaSingleWithCaption, mediaGroup, 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';
4
+ import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder, listItem, heading, blockquote, codeBlock, panel, rule, image, mention, media, mediaInline, mediaSingleFull, mediaGroup, 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';
5
5
  function addItems(builtInItems, config, customSpecs = {}) {
6
6
  if (!config) {
7
7
  return {};
@@ -99,7 +99,7 @@ const nodesInOrder = [{
99
99
  spec: mediaGroup
100
100
  }, {
101
101
  name: 'mediaSingle',
102
- spec: mediaSingleWithCaption
102
+ spec: mediaSingleFull
103
103
  }, {
104
104
  name: 'mediaInline',
105
105
  spec: mediaInline
@@ -1,5 +1,5 @@
1
1
  import memoizeOne from 'memoize-one';
2
- import { mediaSingleFull, layoutSectionWithSingleColumn } from './nodes';
2
+ import { layoutSectionWithSingleColumn } from './nodes';
3
3
  import { createSchema } from './create-schema';
4
4
  const getDefaultSchemaConfig = () => {
5
5
  let defaultSchemaConfig = {
@@ -15,8 +15,7 @@ export const getSchemaBasedOnStage = memoizeOne((stage = 'final') => {
15
15
  const defaultSchemaConfig = getDefaultSchemaConfig();
16
16
  if (stage === 'stage0') {
17
17
  defaultSchemaConfig.customNodeSpecs = {
18
- layoutSection: layoutSectionWithSingleColumn,
19
- mediaSingle: mediaSingleFull
18
+ layoutSection: layoutSectionWithSingleColumn
20
19
  };
21
20
  }
22
21
  return createSchema(defaultSchemaConfig);
@@ -1,5 +1,4 @@
1
1
  /**
2
- * @stage 0
3
2
  * @description The widthType attribute is used to support fixed with media single
4
3
  */
5
4
 
@@ -1,4 +1,4 @@
1
- import * as namedColors from 'css-color-names'; // eslint-disable-line import/extensions
1
+ import * as namedColors from 'css-color-names';
2
2
 
3
3
  /**
4
4
  * We're avoding importing these colors from @atlaskit/theme since we
@@ -16,9 +16,8 @@
16
16
  * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
17
17
  */
18
18
  export function hexToEditorBorderPaletteColor(hexColor) {
19
- // Ts ignore used to allow use of conditional return type
19
+ // Ts ignore was used to allow use of conditional return type
20
20
  // (preferencing better type on consumption over safety in implementation)
21
- // @ts-ignore
22
21
  return editorBorderPalette[hexColor.toUpperCase()];
23
22
  }
24
23
  export const editorBorderPalette = {
@@ -48,9 +47,8 @@ export const editorBorderPalette = {
48
47
  * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
49
48
  */
50
49
  export function hexToEditorTextPaletteColor(hexColor) {
51
- // Ts ignore used to allow use of conditional return type
50
+ // Ts ignore was used to allow use of conditional return type
52
51
  // (preferencing better type on consumption over safety in implementation)
53
- // @ts-ignore
54
52
  return editorTextPalette[hexColor.toUpperCase()];
55
53
  }
56
54
  export const editorTextPalette = {
@@ -112,9 +110,8 @@ export const editorTextPalette = {
112
110
  * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color.
113
111
  */
114
112
  export function hexToEditorBackgroundPaletteRawValue(hexColor) {
115
- // Ts ignore used to allow use of conditional return type
113
+ // Ts ignore was used to allow use of conditional return type
116
114
  // (preferencing better type on consumption over safety in implementation)
117
- // @ts-ignore
118
115
  const tokenData = editorBackgroundPalette[hexColor.toUpperCase()];
119
116
  return tokenData ? tokenData.getValue(hexColor) : undefined;
120
117
  }
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import { Schema } from '@atlaskit/editor-prosemirror/model';
5
5
  import { COLOR, FONT_STYLE, SEARCH_QUERY, LINK } from './groups';
6
6
  import { link, em, strong, textColor, strike, subsup, underline, code, typeAheadQuery, confluenceInlineComment, breakout, alignment, indentation, annotation, unsupportedMark, unsupportedNodeAttribute, dataConsumer, fragment, border } from './marks';
7
- import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder, listItem, heading, blockquote, codeBlock, panel, rule, image, mention, media, mediaInline, mediaSingleWithCaption, mediaGroup, 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';
7
+ import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder, listItem, heading, blockquote, codeBlock, panel, rule, image, mention, media, mediaInline, mediaSingleFull, mediaGroup, 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';
8
8
  function addItems(builtInItems, config) {
9
9
  var customSpecs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
10
10
  if (!config) {
@@ -104,7 +104,7 @@ var nodesInOrder = [{
104
104
  spec: mediaGroup
105
105
  }, {
106
106
  name: 'mediaSingle',
107
- spec: mediaSingleWithCaption
107
+ spec: mediaSingleFull
108
108
  }, {
109
109
  name: 'mediaInline',
110
110
  spec: mediaInline
@@ -1,5 +1,5 @@
1
1
  import memoizeOne from 'memoize-one';
2
- import { mediaSingleFull, layoutSectionWithSingleColumn } from './nodes';
2
+ import { layoutSectionWithSingleColumn } from './nodes';
3
3
  import { createSchema } from './create-schema';
4
4
  var getDefaultSchemaConfig = function getDefaultSchemaConfig() {
5
5
  var defaultSchemaConfig = {
@@ -16,8 +16,7 @@ export var getSchemaBasedOnStage = memoizeOne(function () {
16
16
  var defaultSchemaConfig = getDefaultSchemaConfig();
17
17
  if (stage === 'stage0') {
18
18
  defaultSchemaConfig.customNodeSpecs = {
19
- layoutSection: layoutSectionWithSingleColumn,
20
- mediaSingle: mediaSingleFull
19
+ layoutSection: layoutSectionWithSingleColumn
21
20
  };
22
21
  }
23
22
  return createSchema(defaultSchemaConfig);
@@ -1,5 +1,4 @@
1
1
  /**
2
- * @stage 0
3
2
  * @description The widthType attribute is used to support fixed with media single
4
3
  */
5
4
 
@@ -1,5 +1,5 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import * as namedColors from 'css-color-names'; // eslint-disable-line import/extensions
2
+ import * as namedColors from 'css-color-names';
3
3
 
4
4
  /**
5
5
  * We're avoding importing these colors from @atlaskit/theme since we
@@ -16,9 +16,8 @@
16
16
  * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
17
17
  */
18
18
  export function hexToEditorBorderPaletteColor(hexColor) {
19
- // Ts ignore used to allow use of conditional return type
19
+ // Ts ignore was used to allow use of conditional return type
20
20
  // (preferencing better type on consumption over safety in implementation)
21
- // @ts-ignore
22
21
  return editorBorderPalette[hexColor.toUpperCase()];
23
22
  }
24
23
  export var editorBorderPalette = {
@@ -48,9 +47,8 @@ export var editorBorderPalette = {
48
47
  * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color
49
48
  */
50
49
  export function hexToEditorTextPaletteColor(hexColor) {
51
- // Ts ignore used to allow use of conditional return type
50
+ // Ts ignore was used to allow use of conditional return type
52
51
  // (preferencing better type on consumption over safety in implementation)
53
- // @ts-ignore
54
52
  return editorTextPalette[hexColor.toUpperCase()];
55
53
  }
56
54
  export var editorTextPalette = {
@@ -112,9 +110,8 @@ export var editorTextPalette = {
112
110
  * - **DO**: store the ADF hex color, and use these utilities at render time to display the themed version of the color.
113
111
  */
114
112
  export function hexToEditorBackgroundPaletteRawValue(hexColor) {
115
- // Ts ignore used to allow use of conditional return type
113
+ // Ts ignore was used to allow use of conditional return type
116
114
  // (preferencing better type on consumption over safety in implementation)
117
- // @ts-ignore
118
115
  var tokenData = editorBackgroundPalette[hexColor.toUpperCase()];
119
116
  return tokenData ? tokenData.getValue(hexColor) : undefined;
120
117
  }
@@ -1243,28 +1243,68 @@
1243
1243
  ]
1244
1244
  },
1245
1245
  "attrs": {
1246
- "type": "object",
1247
- "properties": {
1248
- "width": {
1249
- "type": "number",
1250
- "minimum": 0,
1251
- "maximum": 100
1252
- },
1253
- "layout": {
1254
- "enum": [
1255
- "wide",
1256
- "full-width",
1257
- "center",
1258
- "wrap-right",
1259
- "wrap-left",
1260
- "align-end",
1261
- "align-start"
1246
+ "anyOf": [
1247
+ {
1248
+ "type": "object",
1249
+ "properties": {
1250
+ "widthType": {
1251
+ "enum": [
1252
+ "percentage"
1253
+ ]
1254
+ },
1255
+ "width": {
1256
+ "type": "number",
1257
+ "minimum": 0,
1258
+ "maximum": 100
1259
+ },
1260
+ "layout": {
1261
+ "enum": [
1262
+ "wide",
1263
+ "full-width",
1264
+ "center",
1265
+ "wrap-right",
1266
+ "wrap-left",
1267
+ "align-end",
1268
+ "align-start"
1269
+ ]
1270
+ }
1271
+ },
1272
+ "additionalProperties": false,
1273
+ "required": [
1274
+ "layout"
1262
1275
  ]
1276
+ },
1277
+ {
1278
+ "type": "object",
1279
+ "properties": {
1280
+ "width": {
1281
+ "type": "number",
1282
+ "minimum": 0
1283
+ },
1284
+ "widthType": {
1285
+ "enum": [
1286
+ "pixel"
1287
+ ]
1288
+ },
1289
+ "layout": {
1290
+ "enum": [
1291
+ "wide",
1292
+ "full-width",
1293
+ "center",
1294
+ "wrap-right",
1295
+ "wrap-left",
1296
+ "align-end",
1297
+ "align-start"
1298
+ ]
1299
+ }
1300
+ },
1301
+ "required": [
1302
+ "width",
1303
+ "widthType",
1304
+ "layout"
1305
+ ],
1306
+ "additionalProperties": false
1263
1307
  }
1264
- },
1265
- "additionalProperties": false,
1266
- "required": [
1267
- "layout"
1268
1308
  ]
1269
1309
  },
1270
1310
  "marks": {
@@ -13,13 +13,11 @@ export interface OptionalRichMediaAttributes {
13
13
  }
14
14
  interface DefaultMediaAttributes extends RichMediaAttributes {
15
15
  /**
16
- * @stage 0
17
16
  * @description optional widthType attribute for media with percentage layout
18
17
  */
19
18
  widthType?: 'percentage';
20
19
  }
21
20
  /**
22
- * @stage 0
23
21
  * @description The widthType attribute is used to support fixed with media single
24
22
  */
25
23
  interface FixedLayoutMediaAttributes {
@@ -1243,28 +1243,68 @@
1243
1243
  ]
1244
1244
  },
1245
1245
  "attrs": {
1246
- "type": "object",
1247
- "properties": {
1248
- "width": {
1249
- "type": "number",
1250
- "minimum": 0,
1251
- "maximum": 100
1252
- },
1253
- "layout": {
1254
- "enum": [
1255
- "wide",
1256
- "full-width",
1257
- "center",
1258
- "wrap-right",
1259
- "wrap-left",
1260
- "align-end",
1261
- "align-start"
1246
+ "anyOf": [
1247
+ {
1248
+ "type": "object",
1249
+ "properties": {
1250
+ "widthType": {
1251
+ "enum": [
1252
+ "percentage"
1253
+ ]
1254
+ },
1255
+ "width": {
1256
+ "type": "number",
1257
+ "minimum": 0,
1258
+ "maximum": 100
1259
+ },
1260
+ "layout": {
1261
+ "enum": [
1262
+ "wide",
1263
+ "full-width",
1264
+ "center",
1265
+ "wrap-right",
1266
+ "wrap-left",
1267
+ "align-end",
1268
+ "align-start"
1269
+ ]
1270
+ }
1271
+ },
1272
+ "additionalProperties": false,
1273
+ "required": [
1274
+ "layout"
1262
1275
  ]
1276
+ },
1277
+ {
1278
+ "type": "object",
1279
+ "properties": {
1280
+ "width": {
1281
+ "type": "number",
1282
+ "minimum": 0
1283
+ },
1284
+ "widthType": {
1285
+ "enum": [
1286
+ "pixel"
1287
+ ]
1288
+ },
1289
+ "layout": {
1290
+ "enum": [
1291
+ "wide",
1292
+ "full-width",
1293
+ "center",
1294
+ "wrap-right",
1295
+ "wrap-left",
1296
+ "align-end",
1297
+ "align-start"
1298
+ ]
1299
+ }
1300
+ },
1301
+ "required": [
1302
+ "width",
1303
+ "widthType",
1304
+ "layout"
1305
+ ],
1306
+ "additionalProperties": false
1263
1307
  }
1264
- },
1265
- "additionalProperties": false,
1266
- "required": [
1267
- "layout"
1268
1308
  ]
1269
1309
  },
1270
1310
  "marks": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "30.1.0",
3
+ "version": "30.2.1",
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
  "memoize-one": "^6.0.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@atlassian/adf-schema-json": "^1.0.3",
43
+ "@atlassian/adf-schema-json": "^1.1.0",
44
44
  "@babel/cli": "^7.22.9",
45
45
  "@babel/core": "^7.22.9",
46
46
  "@babel/plugin-proposal-class-properties": "^7.18.6",