@atlaskit/adf-schema 36.17.0 → 36.18.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,17 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 36.18.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 53dce02: Add autogenerated warning to the top of the autogenerated files
8
+
9
+ ## 36.18.0
10
+
11
+ ### Minor Changes
12
+
13
+ - fc86a6a: added function to adfNode, updated buildContent and added buildMarks
14
+
3
15
  ## 36.17.0
4
16
 
5
17
  ### Minor Changes
@@ -5,6 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.unsupportedNodeAttribute = exports.unsupportedMark = exports.underline = exports.textColor = exports.subsup = exports.strong = exports.strike = exports.link = exports.indentation = exports.fragment = exports.em = exports.dataConsumer = exports.code = exports.breakout = exports.border = exports.backgroundColor = exports.annotation = exports.alignment = void 0;
7
7
  var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
+ /**
9
+ * This file was automatically generated by @atlaskit/adf-schema-generator
10
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source files in "packages/adf-schema/src/next-schema" ,
11
+ * and run "yarn workspace @atlaskit/adf-schema build:pm:full" to regenerate this file.
12
+ */
13
+
8
14
  var unsupportedNodeAttribute = exports.unsupportedNodeAttribute = (0, _adfSchemaGenerator.createPMMarkSpecFactory)({
9
15
  attrs: {
10
16
  type: {
@@ -5,6 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.unsupportedInline = exports.unsupportedBlock = exports.textFormatted = exports.textCodeInline = exports.text = exports.taskList = exports.taskItem = exports.tableRow = exports.tableHeader = exports.tableCell = exports.table = exports.status = exports.rule = exports.placeholder = exports.paragraphWithNoMarks = exports.paragraphWithMarks = exports.paragraphWithAlignment = exports.paragraph = exports.panel = exports.orderedList = exports.nestedExpandWithNoMarks = exports.multiBodiedExtension = exports.mention = exports.mediaSingleFull = exports.mediaSingleCaption = exports.mediaSingle = exports.mediaInline = exports.mediaGroup = exports.media = exports.listItem = exports.layoutSection = exports.layoutColumn = exports.inlineExtensionWithMarks = exports.inlineCard = exports.image = exports.headingWithNoMarks = exports.headingWithIndentation = exports.headingWithAlignment = exports.heading = exports.hardBreak = exports.extensionWithMarks = exports.extensionFrame = exports.extension = exports.expandWithNoMark = exports.emoji = exports.embedCard = exports.doc = exports.decisionList = exports.decisionItem = exports.date = exports.confluenceUnsupportedInline = exports.confluenceUnsupportedBlock = exports.confluenceJiraIssue = exports.codeBlockWithNoMarks = exports.codeBlock = exports.caption = exports.bulletList = exports.bodiedExtensionWithMarks = exports.bodiedExtension = exports.blockquoteWithList = exports.blockquote = exports.blockCard = void 0;
7
7
  var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
+ /**
9
+ * This file was automatically generated by @atlaskit/adf-schema-generator
10
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source files in "packages/adf-schema/src/next-schema" ,
11
+ * and run "yarn workspace @atlaskit/adf-schema build:pm:full" to regenerate this file.
12
+ */
13
+
8
14
  var text = exports.text = (0, _adfSchemaGenerator.createPMNodeSpecFactory)({
9
15
  group: 'inline'
10
16
  });
@@ -1,3 +1,9 @@
1
+ /**
2
+ * This file was automatically generated by @atlaskit/adf-schema-generator
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source files in "packages/adf-schema/src/next-schema" ,
4
+ * and run "yarn workspace @atlaskit/adf-schema build:pm:full" to regenerate this file.
5
+ */
6
+
1
7
  import { createPMMarkSpecFactory } from '@atlaskit/adf-schema-generator';
2
8
  export const unsupportedNodeAttribute = createPMMarkSpecFactory({
3
9
  attrs: {
@@ -1,3 +1,9 @@
1
+ /**
2
+ * This file was automatically generated by @atlaskit/adf-schema-generator
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source files in "packages/adf-schema/src/next-schema" ,
4
+ * and run "yarn workspace @atlaskit/adf-schema build:pm:full" to regenerate this file.
5
+ */
6
+
1
7
  import { createPMNodeSpecFactory } from '@atlaskit/adf-schema-generator';
2
8
  export const text = createPMNodeSpecFactory({
3
9
  group: 'inline'
@@ -1,3 +1,9 @@
1
+ /**
2
+ * This file was automatically generated by @atlaskit/adf-schema-generator
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source files in "packages/adf-schema/src/next-schema" ,
4
+ * and run "yarn workspace @atlaskit/adf-schema build:pm:full" to regenerate this file.
5
+ */
6
+
1
7
  import { createPMMarkSpecFactory } from '@atlaskit/adf-schema-generator';
2
8
  export var unsupportedNodeAttribute = createPMMarkSpecFactory({
3
9
  attrs: {
@@ -1,3 +1,9 @@
1
+ /**
2
+ * This file was automatically generated by @atlaskit/adf-schema-generator
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source files in "packages/adf-schema/src/next-schema" ,
4
+ * and run "yarn workspace @atlaskit/adf-schema build:pm:full" to regenerate this file.
5
+ */
6
+
1
7
  import { createPMNodeSpecFactory } from '@atlaskit/adf-schema-generator';
2
8
  export var text = createPMNodeSpecFactory({
3
9
  group: 'inline'
@@ -1,3 +1,8 @@
1
+ /**
2
+ * This file was automatically generated by @atlaskit/adf-schema-generator
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source files in "packages/adf-schema/src/next-schema" ,
4
+ * and run "yarn workspace @atlaskit/adf-schema build:pm:full" to regenerate this file.
5
+ */
1
6
  import { Mark } from '@atlaskit/editor-prosemirror/model';
2
7
  export interface UnsupportedNodeAttributeMarkAttributes {
3
8
  type: string;
@@ -1,3 +1,8 @@
1
+ /**
2
+ * This file was automatically generated by @atlaskit/adf-schema-generator
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source files in "packages/adf-schema/src/next-schema" ,
4
+ * and run "yarn workspace @atlaskit/adf-schema build:pm:full" to regenerate this file.
5
+ */
1
6
  import { TextDefinition, TextFormattedDefinition, TextCodeInlineDefinition, DateDefinition, EmojiDefinition, HardBreakDefinition, InlineCardDefinition, MentionDefinition, PlaceholderDefinition, StatusDefinition, InlineExtensionWithMarksDefinition, MediaInlineDefinition, ImageDefinition, ConfluenceJiraIssueDefinition, ConfluenceUnsupportedInlineDefinition, UnsupportedInlineDefinition } from './nodeTypes';
2
7
  export type InlineDefinition = Array<TextDefinition | TextFormattedDefinition | TextCodeInlineDefinition | DateDefinition | EmojiDefinition | HardBreakDefinition | InlineCardDefinition | MentionDefinition | PlaceholderDefinition | StatusDefinition | InlineExtensionWithMarksDefinition | MediaInlineDefinition | ImageDefinition | ConfluenceJiraIssueDefinition | ConfluenceUnsupportedInlineDefinition | UnsupportedInlineDefinition>;
3
8
  import { PanelDefinition, ParagraphDefinition, ParagraphWithMarksDefinition, BlockquoteWithListDefinition, OrderedListDefinition, BulletListDefinition, RuleDefinition, HeadingWithNoMarksDefinition, HeadingWithAlignmentDefinition, HeadingWithIndentationDefinition, CodeBlockWithNoMarksDefinition, MediaGroupDefinition, MediaSingleCaptionDefinition, MediaSingleFullDefinition, DecisionListDefinition, TaskListDefinition, TableDefinition, ExpandWithNoMarkDefinition, ExtensionWithMarksDefinition, BodiedExtensionWithMarksDefinition, BlockCardDefinition, EmbedCardDefinition, ConfluenceUnsupportedBlockDefinition, UnsupportedBlockDefinition } from './nodeTypes';
@@ -1,3 +1,8 @@
1
+ /**
2
+ * This file was automatically generated by @atlaskit/adf-schema-generator
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source files in "packages/adf-schema/src/next-schema" ,
4
+ * and run "yarn workspace @atlaskit/adf-schema build:pm:full" to regenerate this file.
5
+ */
1
6
  import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
7
  import { InlineDefinition, BlockDefinition, BlockRootOnlyDefinition } from './nodeGroupTypes';
3
8
  import { UnsupportedNodeAttributeMark, UnsupportedMarkMark, LinkMark, EmMark, StrongMark, StrikeMark, SubsupMark, UnderlineMark, TextColorMark, AnnotationMark, BackgroundColorMark, CodeMark, DataConsumerMark, FragmentMark, BorderMark, AlignmentMark, IndentationMark, BreakoutMark } from './markTypes';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "36.17.0",
3
+ "version": "36.18.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/"
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@atlassian/adf-schema-json": "^1.15.0",
47
- "@atlaskit/adf-schema-generator": "^1.16.0",
47
+ "@atlaskit/adf-schema-generator": "^1.17.1",
48
48
  "@atlaskit/codemod-utils": "^4.2.4",
49
49
  "@atlaskit/json-schema-generator": "^3.3.9",
50
50
  "@babel/cli": "^7.22.9",
@@ -1,8 +1,7 @@
1
1
  import { adfToValidatorSpec } from '@atlaskit/adf-schema-generator';
2
2
  import adfNode from '@atlaskit/adf-schema/src/next-schema/full-schema.adf';
3
3
 
4
- // currently doesn't work, will fix with next PR
5
- test.skip('should be able to handle heading', () => {
4
+ test('should be able to handle heading', () => {
6
5
  const result = sortNestedArrays(adfToValidatorSpec(adfNode));
7
6
 
8
7
  expect(result.heading.json).toEqual(sortNestedArrays(heading));
@@ -20,6 +19,20 @@ test('should be able to handle mentions', () => {
20
19
  expect(result.mention.json).toEqual(sortNestedArrays(mention));
21
20
  });
22
21
 
22
+ test('should be able to handle paragraphs', () => {
23
+ const result = sortNestedArrays(adfToValidatorSpec(adfNode));
24
+
25
+ expect(result.paragraph.json).toEqual(sortNestedArrays(paragraph));
26
+ });
27
+
28
+ // i don't know what node on the results object is nested_expand because
29
+ // nested_expand doesn't exist in the adfNode object :hmmmmmm:
30
+ test.skip('should be able to handle nested expand', () => {
31
+ const result = sortNestedArrays(adfToValidatorSpec(adfNode));
32
+
33
+ expect(result.nested_expand.json).toEqual(sortNestedArrays(nested_expand));
34
+ });
35
+
23
36
  function sortNestedArrays(obj: any): any {
24
37
  if (Array.isArray(obj)) {
25
38
  return obj.sort();
@@ -32,6 +45,28 @@ function sortNestedArrays(obj: any): any {
32
45
  return obj;
33
46
  }
34
47
 
48
+ const nested_expand = {
49
+ props: {
50
+ type: { type: 'enum', values: ['nestedExpand'] },
51
+ attrs: { props: { title: { type: 'string', optional: true } } },
52
+ content: 'nestedExpand_content',
53
+ },
54
+ required: ['content'],
55
+ };
56
+
57
+ const paragraph = {
58
+ props: {
59
+ type: { type: 'enum', values: ['paragraph'] },
60
+ content: {
61
+ type: 'array',
62
+ items: ['inline'],
63
+ allowUnsupportedInline: true, // currently not supported by DSL
64
+ optional: true,
65
+ },
66
+ marks: { type: 'array', items: [], optional: true },
67
+ },
68
+ };
69
+
35
70
  const mention = {
36
71
  props: {
37
72
  type: { type: 'enum', values: ['mention'] },
@@ -103,6 +138,7 @@ const heading = {
103
138
  content: {
104
139
  type: 'array',
105
140
  items: ['inline'],
141
+ allowUnsupportedInline: true,
106
142
  optional: true,
107
143
  },
108
144
  marks: { type: 'array', items: [], optional: true },