@atlaskit/adf-schema 35.12.0 → 35.12.2

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,17 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 35.12.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 05ba2ed: [ED-23102] Add background color mark to default schema and move it up in mark order to the inline marks
8
+
9
+ ## 35.12.1
10
+
11
+ ### Patch Changes
12
+
13
+ - aea8879: NO-ISSUE Fixed a serialisation bug resulting in invalid ADF JSON in mention nodes
14
+
3
15
  ## 35.12.0
4
16
 
5
17
  ### Minor Changes
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.confluenceSchemaWithMediaSingle = exports.confluenceSchema = void 0;
7
7
  var _createSchema = require("./create-schema");
8
8
  var nodes = ['doc', 'paragraph', 'blockquote', 'codeBlock', 'panel', 'hardBreak', 'orderedList', 'bulletList', 'heading', 'mediaInline', 'mediaGroup', 'mediaSingle', 'media', 'caption', 'confluenceUnsupportedBlock', 'confluenceJiraIssue', 'expand', 'nestedExpand', 'extension', 'inlineExtension', 'bodiedExtension', 'listItem', 'mention', 'text', 'confluenceUnsupportedInline', 'media', 'rule', 'table', 'tableCell', 'tableHeader', 'tableRow', 'emoji', 'taskList', 'taskItem', 'date', 'placeholder', 'decisionList', 'decisionItem', 'layoutSection', 'layoutColumn', 'inlineCard', 'unsupportedBlock', 'unsupportedInline'];
9
- var marks = ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'mentionQuery', 'code', 'textColor', 'confluenceInlineComment', 'annotation', 'unsupportedMark', 'unsupportedNodeAttribute'];
9
+ var marks = ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'mentionQuery', 'code', 'textColor', 'backgroundColor', 'confluenceInlineComment', 'annotation', 'unsupportedMark', 'unsupportedNodeAttribute'];
10
10
 
11
11
  /**
12
12
  * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
@@ -224,6 +224,9 @@ var marksInOrder = [{
224
224
  }, {
225
225
  name: 'textColor',
226
226
  spec: _marks.textColor
227
+ }, {
228
+ name: 'backgroundColor',
229
+ spec: _marks.backgroundColor
227
230
  }, {
228
231
  name: 'strike',
229
232
  spec: _marks.strike
@@ -263,9 +266,6 @@ var marksInOrder = [{
263
266
  }, {
264
267
  name: 'border',
265
268
  spec: _marks.border
266
- }, {
267
- name: 'backgroundColor',
268
- spec: _marks.backgroundColor
269
269
  }, {
270
270
  name: 'unsupportedMark',
271
271
  spec: _marks.unsupportedMark
@@ -11,7 +11,7 @@ var _createSchema = require("./create-schema");
11
11
  var getDefaultSchemaConfig = function getDefaultSchemaConfig() {
12
12
  var defaultSchemaConfig = {
13
13
  nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'panel', 'rule', 'image', 'caption', 'mention', 'media', 'mediaGroup', 'mediaSingle', 'mediaInline', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'confluenceJiraIssue', 'expand', 'nestedExpand', 'extension', 'inlineExtension', 'bodiedExtension', 'hardBreak', 'emoji', 'table', 'tableCell', 'tableHeader', 'tableRow', 'decisionList', 'decisionItem', 'taskList', 'taskItem', 'unknownBlock', 'date', 'status', 'placeholder', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard', 'unsupportedBlock', 'unsupportedInline'],
14
- marks: ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'code', 'textColor', 'confluenceInlineComment', 'breakout', 'alignment', 'indentation', 'annotation', 'dataConsumer', 'border', 'unsupportedMark', 'unsupportedNodeAttribute', 'typeAheadQuery',
14
+ marks: ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'code', 'textColor', 'backgroundColor', 'confluenceInlineComment', 'breakout', 'alignment', 'indentation', 'annotation', 'dataConsumer', 'border', 'unsupportedMark', 'unsupportedNodeAttribute', 'typeAheadQuery',
15
15
  // https://product-fabric.atlassian.net/browse/ED-10214,
16
16
  'fragment']
17
17
  };
@@ -77,7 +77,7 @@ var mention = exports.mention = {
77
77
  }
78
78
  };
79
79
  var isOptional = function isOptional(key) {
80
- return ['userType'].indexOf(key) > -1;
80
+ return ['userType', 'localId'].indexOf(key) > -1;
81
81
  };
82
82
  var toJSON = exports.toJSON = function toJSON(node) {
83
83
  return {
@@ -34,7 +34,7 @@ var paragraph = exports.paragraph = {
34
34
  selectable: false,
35
35
  content: 'inline*',
36
36
  group: 'block',
37
- marks: 'strong code em link border strike subsup textColor typeAheadQuery underline confluenceInlineComment action annotation unsupportedMark unsupportedNodeAttribute dataConsumer fragment backgroundColor',
37
+ marks: 'strong code em link border strike subsup textColor backgroundColor typeAheadQuery underline confluenceInlineComment action annotation unsupportedMark unsupportedNodeAttribute dataConsumer fragment',
38
38
  parseDOM: [{
39
39
  tag: 'p'
40
40
  }],
@@ -1,6 +1,6 @@
1
1
  import { createSchema } from './create-schema';
2
2
  const nodes = ['doc', 'paragraph', 'blockquote', 'codeBlock', 'panel', 'hardBreak', 'orderedList', 'bulletList', 'heading', 'mediaInline', 'mediaGroup', 'mediaSingle', 'media', 'caption', 'confluenceUnsupportedBlock', 'confluenceJiraIssue', 'expand', 'nestedExpand', 'extension', 'inlineExtension', 'bodiedExtension', 'listItem', 'mention', 'text', 'confluenceUnsupportedInline', 'media', 'rule', 'table', 'tableCell', 'tableHeader', 'tableRow', 'emoji', 'taskList', 'taskItem', 'date', 'placeholder', 'decisionList', 'decisionItem', 'layoutSection', 'layoutColumn', 'inlineCard', 'unsupportedBlock', 'unsupportedInline'];
3
- const marks = ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'mentionQuery', 'code', 'textColor', 'confluenceInlineComment', 'annotation', 'unsupportedMark', 'unsupportedNodeAttribute'];
3
+ const marks = ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'mentionQuery', 'code', 'textColor', 'backgroundColor', 'confluenceInlineComment', 'annotation', 'unsupportedMark', 'unsupportedNodeAttribute'];
4
4
 
5
5
  /**
6
6
  * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
@@ -209,6 +209,9 @@ const marksInOrder = [{
209
209
  }, {
210
210
  name: 'textColor',
211
211
  spec: textColor
212
+ }, {
213
+ name: 'backgroundColor',
214
+ spec: backgroundColor
212
215
  }, {
213
216
  name: 'strike',
214
217
  spec: strike
@@ -248,9 +251,6 @@ const marksInOrder = [{
248
251
  }, {
249
252
  name: 'border',
250
253
  spec: border
251
- }, {
252
- name: 'backgroundColor',
253
- spec: backgroundColor
254
254
  }, {
255
255
  name: 'unsupportedMark',
256
256
  spec: unsupportedMark
@@ -4,7 +4,7 @@ import { createSchema } from './create-schema';
4
4
  const getDefaultSchemaConfig = () => {
5
5
  const defaultSchemaConfig = {
6
6
  nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'panel', 'rule', 'image', 'caption', 'mention', 'media', 'mediaGroup', 'mediaSingle', 'mediaInline', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'confluenceJiraIssue', 'expand', 'nestedExpand', 'extension', 'inlineExtension', 'bodiedExtension', 'hardBreak', 'emoji', 'table', 'tableCell', 'tableHeader', 'tableRow', 'decisionList', 'decisionItem', 'taskList', 'taskItem', 'unknownBlock', 'date', 'status', 'placeholder', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard', 'unsupportedBlock', 'unsupportedInline'],
7
- marks: ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'code', 'textColor', 'confluenceInlineComment', 'breakout', 'alignment', 'indentation', 'annotation', 'dataConsumer', 'border', 'unsupportedMark', 'unsupportedNodeAttribute', 'typeAheadQuery',
7
+ marks: ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'code', 'textColor', 'backgroundColor', 'confluenceInlineComment', 'breakout', 'alignment', 'indentation', 'annotation', 'dataConsumer', 'border', 'unsupportedMark', 'unsupportedNodeAttribute', 'typeAheadQuery',
8
8
  // https://product-fabric.atlassian.net/browse/ED-10214,
9
9
  'fragment']
10
10
  };
@@ -70,7 +70,7 @@ export const mention = {
70
70
  }
71
71
  };
72
72
  const isOptional = key => {
73
- return ['userType'].indexOf(key) > -1;
73
+ return ['userType', 'localId'].indexOf(key) > -1;
74
74
  };
75
75
  export const toJSON = node => ({
76
76
  attrs: Object.keys(node.attrs).reduce((obj, key) => {
@@ -28,7 +28,7 @@ export const paragraph = {
28
28
  selectable: false,
29
29
  content: 'inline*',
30
30
  group: 'block',
31
- marks: 'strong code em link border strike subsup textColor typeAheadQuery underline confluenceInlineComment action annotation unsupportedMark unsupportedNodeAttribute dataConsumer fragment backgroundColor',
31
+ marks: 'strong code em link border strike subsup textColor backgroundColor typeAheadQuery underline confluenceInlineComment action annotation unsupportedMark unsupportedNodeAttribute dataConsumer fragment',
32
32
  parseDOM: [{
33
33
  tag: 'p'
34
34
  }],
@@ -1,6 +1,6 @@
1
1
  import { createSchema } from './create-schema';
2
2
  var nodes = ['doc', 'paragraph', 'blockquote', 'codeBlock', 'panel', 'hardBreak', 'orderedList', 'bulletList', 'heading', 'mediaInline', 'mediaGroup', 'mediaSingle', 'media', 'caption', 'confluenceUnsupportedBlock', 'confluenceJiraIssue', 'expand', 'nestedExpand', 'extension', 'inlineExtension', 'bodiedExtension', 'listItem', 'mention', 'text', 'confluenceUnsupportedInline', 'media', 'rule', 'table', 'tableCell', 'tableHeader', 'tableRow', 'emoji', 'taskList', 'taskItem', 'date', 'placeholder', 'decisionList', 'decisionItem', 'layoutSection', 'layoutColumn', 'inlineCard', 'unsupportedBlock', 'unsupportedInline'];
3
- var marks = ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'mentionQuery', 'code', 'textColor', 'confluenceInlineComment', 'annotation', 'unsupportedMark', 'unsupportedNodeAttribute'];
3
+ var marks = ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'mentionQuery', 'code', 'textColor', 'backgroundColor', 'confluenceInlineComment', 'annotation', 'unsupportedMark', 'unsupportedNodeAttribute'];
4
4
 
5
5
  /**
6
6
  * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
@@ -214,6 +214,9 @@ var marksInOrder = [{
214
214
  }, {
215
215
  name: 'textColor',
216
216
  spec: textColor
217
+ }, {
218
+ name: 'backgroundColor',
219
+ spec: backgroundColor
217
220
  }, {
218
221
  name: 'strike',
219
222
  spec: strike
@@ -253,9 +256,6 @@ var marksInOrder = [{
253
256
  }, {
254
257
  name: 'border',
255
258
  spec: border
256
- }, {
257
- name: 'backgroundColor',
258
- spec: backgroundColor
259
259
  }, {
260
260
  name: 'unsupportedMark',
261
261
  spec: unsupportedMark
@@ -4,7 +4,7 @@ import { createSchema } from './create-schema';
4
4
  var getDefaultSchemaConfig = function getDefaultSchemaConfig() {
5
5
  var defaultSchemaConfig = {
6
6
  nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'panel', 'rule', 'image', 'caption', 'mention', 'media', 'mediaGroup', 'mediaSingle', 'mediaInline', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'confluenceJiraIssue', 'expand', 'nestedExpand', 'extension', 'inlineExtension', 'bodiedExtension', 'hardBreak', 'emoji', 'table', 'tableCell', 'tableHeader', 'tableRow', 'decisionList', 'decisionItem', 'taskList', 'taskItem', 'unknownBlock', 'date', 'status', 'placeholder', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard', 'unsupportedBlock', 'unsupportedInline'],
7
- marks: ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'code', 'textColor', 'confluenceInlineComment', 'breakout', 'alignment', 'indentation', 'annotation', 'dataConsumer', 'border', 'unsupportedMark', 'unsupportedNodeAttribute', 'typeAheadQuery',
7
+ marks: ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'code', 'textColor', 'backgroundColor', 'confluenceInlineComment', 'breakout', 'alignment', 'indentation', 'annotation', 'dataConsumer', 'border', 'unsupportedMark', 'unsupportedNodeAttribute', 'typeAheadQuery',
8
8
  // https://product-fabric.atlassian.net/browse/ED-10214,
9
9
  'fragment']
10
10
  };
@@ -72,7 +72,7 @@ export var mention = {
72
72
  }
73
73
  };
74
74
  var isOptional = function isOptional(key) {
75
- return ['userType'].indexOf(key) > -1;
75
+ return ['userType', 'localId'].indexOf(key) > -1;
76
76
  };
77
77
  export var toJSON = function toJSON(node) {
78
78
  return {
@@ -28,7 +28,7 @@ export var paragraph = {
28
28
  selectable: false,
29
29
  content: 'inline*',
30
30
  group: 'block',
31
- marks: 'strong code em link border strike subsup textColor typeAheadQuery underline confluenceInlineComment action annotation unsupportedMark unsupportedNodeAttribute dataConsumer fragment backgroundColor',
31
+ marks: 'strong code em link border strike subsup textColor backgroundColor typeAheadQuery underline confluenceInlineComment action annotation unsupportedMark unsupportedNodeAttribute dataConsumer fragment',
32
32
  parseDOM: [{
33
33
  tag: 'p'
34
34
  }],
@@ -1,6 +1,6 @@
1
1
  import { SchemaConfig } from './create-schema';
2
2
  type DefaultSchemaNodes = 'doc' | 'paragraph' | 'text' | 'bulletList' | 'orderedList' | 'listItem' | 'heading' | 'blockquote' | 'codeBlock' | 'panel' | 'rule' | 'image' | 'mention' | 'media' | 'caption' | 'mediaGroup' | 'mediaSingle' | 'mediaInline' | 'confluenceUnsupportedBlock' | 'confluenceUnsupportedInline' | 'confluenceJiraIssue' | 'expand' | 'nestedExpand' | 'extension' | 'inlineExtension' | 'bodiedExtension' | 'hardBreak' | 'emoji' | 'table' | 'tableCell' | 'tableHeader' | 'tableRow' | 'decisionList' | 'decisionItem' | 'taskList' | 'taskItem' | 'unknownBlock' | 'date' | 'status' | 'placeholder' | 'layoutSection' | 'layoutColumn' | 'inlineCard' | 'blockCard' | 'embedCard' | 'unsupportedBlock' | 'unsupportedInline';
3
- type DefaultSchemaMarks = 'link' | 'em' | 'strong' | 'strike' | 'subsup' | 'underline' | 'code' | 'textColor' | 'confluenceInlineComment' | 'breakout' | 'alignment' | 'indentation' | 'annotation' | 'border' | 'unsupportedMark' | 'unsupportedNodeAttribute' | 'typeAheadQuery' | 'dataConsumer' | 'fragment';
3
+ type DefaultSchemaMarks = 'link' | 'em' | 'strong' | 'strike' | 'subsup' | 'underline' | 'code' | 'textColor' | 'backgroundColor' | 'confluenceInlineComment' | 'breakout' | 'alignment' | 'indentation' | 'annotation' | 'border' | 'unsupportedMark' | 'unsupportedNodeAttribute' | 'typeAheadQuery' | 'dataConsumer' | 'fragment';
4
4
  export declare const defaultSchemaConfig: SchemaConfig<DefaultSchemaNodes, DefaultSchemaMarks>;
5
5
  export declare const getSchemaBasedOnStage: import("memoize-one").MemoizedFn<(this: any, stage?: any) => import("prosemirror-model").Schema<DefaultSchemaNodes, DefaultSchemaMarks>>;
6
6
  export declare const defaultSchema: import("prosemirror-model").Schema<DefaultSchemaNodes, DefaultSchemaMarks>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "35.12.0",
3
+ "version": "35.12.2",
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/"