@atlaskit/adf-schema 30.1.0 → 30.2.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,11 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 30.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 9a8af3a: Promote widthType to full schema
8
+
3
9
  ## 30.1.0
4
10
 
5
11
  ### 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) {
@@ -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
 
@@ -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
 
@@ -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.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
  "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",