@atlaskit/adf-schema 56.7.1 → 56.7.3

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,22 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 56.7.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 56.7.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`21f16025e3e5c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/21f16025e3e5c) -
14
+ Internal refactor of the next-schema DSL: `panel_c1` and `panel_c1_root_only` now list `table`
15
+ directly in their content specs (single source of truth), referenced via a new import-cycle-free
16
+ `tableStub` leaf module instead of the removed `ADFNode#addContent` runtime wiring. The generated
17
+ ProseMirror, JSON, and validator schema output is unchanged.
18
+ - Updated dependencies
19
+
3
20
  ## 56.7.1
4
21
 
5
22
  ### Patch Changes
@@ -18,11 +18,6 @@ var _extension = require("./nodes/extension");
18
18
  var _multiBodiedExtension = require("./nodes/multiBodiedExtension");
19
19
  var _panel = require("./nodes/panel");
20
20
  var _rule = require("./nodes/rule");
21
- var _tableNodes = require("./nodes/tableNodes");
22
- // Wire cross-container content after all node modules are fully evaluated,
23
- // so neither import is undefined when the $or() expression is constructed.
24
- _panel.panel.use('c1').addContent(_tableNodes.table);
25
- _panel.panel.use('c1_root_only').addContent(_tableNodes.table);
26
21
  var doc = (0, _adfSchemaGenerator.adfNode)('doc').define({
27
22
  root: true,
28
23
  version: 1,
@@ -20,6 +20,7 @@ var _rule = require("./rule");
20
20
  var _task = require("./task");
21
21
  var _unsupportedBlock = require("./unsupportedBlock");
22
22
  var _extension = require("./extension");
23
+ var _tableStub = require("./tableStub");
23
24
  var panelContent = [_paragraph.paragraph.use('with_no_marks'), _paragraph.paragraph.use('with_font_size'), _heading.heading.use('with_no_marks'), _list.bulletList, _list.orderedList, _blockCard.blockCard, _mediaGroup.mediaGroup, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _codeBlock.codeBlock, _task.taskList, _rule.rule, _decisionList.decisionList, _unsupportedBlock.unsupportedBlock];
24
25
  var panel = exports.panel = (0, _adfSchemaGenerator.adfNode)('panel').define({
25
26
  selectable: true,
@@ -58,9 +59,8 @@ var panel = exports.panel = (0, _adfSchemaGenerator.adfNode)('panel').define({
58
59
  },
59
60
  content: [(0, _adfSchemaGenerator.$onePlus)(_adfSchemaGenerator.$or.apply(void 0, panelContent.concat([_extension.extension.use('with_marks')])))]
60
61
  }).variant('c1', {
61
- // panel_c1 allows all standard panel content plus table (wired via addContent
62
- // in full-schema.adf.ts to avoid a circular module import).
63
- content: [(0, _adfSchemaGenerator.$onePlus)(_adfSchemaGenerator.$or.apply(void 0, panelContent.concat([_extension.extension.use('with_marks')])))],
62
+ // panel_c1 allows all standard panel content plus table.
63
+ content: [(0, _adfSchemaGenerator.$onePlus)(_adfSchemaGenerator.$or.apply(void 0, panelContent.concat([_extension.extension.use('with_marks'), _tableStub.table])))],
64
64
  ignore: ['json-schema', 'validator-spec'],
65
65
  preserveVariantNameInPm: true
66
66
  })
@@ -73,9 +73,8 @@ var panel = exports.panel = (0, _adfSchemaGenerator.adfNode)('panel').define({
73
73
  .variant('c1_root_only', {
74
74
  stage0: true,
75
75
  marks: [_breakout.breakout, _unsupportedMark.unsupportedMark, _unsupportedNodeAttribute.unsupportedNodeAttribute],
76
- // panel_c1 allows all standard panel content plus table (wired via addContent
77
- // in full-schema.adf.ts to avoid a circular module import).
78
- content: [(0, _adfSchemaGenerator.$onePlus)(_adfSchemaGenerator.$or.apply(void 0, panelContent.concat([_extension.extension.use('with_marks')])))],
76
+ // panel_c1_root_only allows all standard panel content plus table.
77
+ content: [(0, _adfSchemaGenerator.$onePlus)(_adfSchemaGenerator.$or.apply(void 0, panelContent.concat([_extension.extension.use('with_marks'), _tableStub.table])))],
79
78
  ignore: ['json-schema', 'validator-spec'],
80
79
  preserveVariantNameInPm: true
81
80
  });
@@ -4,7 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.table = void 0;
7
+ Object.defineProperty(exports, "table", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _tableStub.table;
11
+ }
12
+ });
8
13
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
14
  var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
10
15
  var _fragment = require("../marks/fragment");
@@ -14,8 +19,7 @@ var _tableCellContentPseudoGroup = require("../groups/tableCellContentPseudoGrou
14
19
  var _tableCellContent = require("./tableCellContent");
15
20
  var _nestedExpand = require("./nestedExpand");
16
21
  var _unsupportedBlock = require("./unsupportedBlock");
17
- // Declare early to allow for circular references within the file
18
- var table = exports.table = (0, _adfSchemaGenerator.adfNode)('table');
22
+ var _tableStub = require("./tableStub");
19
23
  var valign = {
20
24
  type: 'enum',
21
25
  values: ['top', 'middle', 'bottom'],
@@ -69,7 +73,7 @@ var tableCell = (0, _adfSchemaGenerator.adfNode)('tableCell').define({
69
73
  }
70
74
  }
71
75
  }).variant('with_nested_table', {
72
- content: [(0, _adfSchemaGenerator.$onePlus)(_adfSchemaGenerator.$or.apply(void 0, (0, _toConsumableArray2.default)(_tableCellContentPseudoGroup.tableCellContentNodes).concat([_unsupportedBlock.unsupportedBlock, table])))],
76
+ content: [(0, _adfSchemaGenerator.$onePlus)(_adfSchemaGenerator.$or.apply(void 0, (0, _toConsumableArray2.default)(_tableCellContentPseudoGroup.tableCellContentNodes).concat([_unsupportedBlock.unsupportedBlock, _tableStub.table])))],
73
77
  ignore: ['json-schema', 'validator-spec']
74
78
  });
75
79
  var tableHeader = (0, _adfSchemaGenerator.adfNode)('tableHeader').define({
@@ -88,7 +92,7 @@ var tableHeader = (0, _adfSchemaGenerator.adfNode)('tableHeader').define({
88
92
  }
89
93
  }
90
94
  }).variant('with_nested_table', {
91
- content: [(0, _adfSchemaGenerator.$onePlus)(_adfSchemaGenerator.$or.apply(void 0, (0, _toConsumableArray2.default)(_tableCellContentPseudoGroup.tableCellContentNodes).concat([_nestedExpand.nestedExpand, table])))],
95
+ content: [(0, _adfSchemaGenerator.$onePlus)(_adfSchemaGenerator.$or.apply(void 0, (0, _toConsumableArray2.default)(_tableCellContentPseudoGroup.tableCellContentNodes).concat([_nestedExpand.nestedExpand, _tableStub.table])))],
92
96
  ignore: ['json-schema', 'validator-spec']
93
97
  });
94
98
  var tableRow = (0, _adfSchemaGenerator.adfNode)('tableRow').define({
@@ -115,7 +119,7 @@ var tableRow = (0, _adfSchemaGenerator.adfNode)('tableRow').define({
115
119
  content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(tableCell.use('with_nested_table'), tableHeader.use('with_nested_table')))],
116
120
  ignore: ['json-schema', 'validator-spec']
117
121
  });
118
- table.define({
122
+ _tableStub.table.define({
119
123
  isolating: true,
120
124
  selectable: true,
121
125
  tableRole: 'table',
@@ -159,4 +163,9 @@ table.define({
159
163
  }).variant('with_nested_table', {
160
164
  content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(tableRow.use('with_nested_table')))],
161
165
  ignore: ['json-schema', 'validator-spec']
162
- });
166
+ });
167
+
168
+ // Re-export the now-defined `table` stub as this module's public API. Importing `table` from here
169
+ // (rather than from `./tableStub`) forces this definition module to evaluate first, so consumers
170
+ // that eagerly call `table.use('with_nested_table')` see the defined variant.
171
+ // eslint-disable-next-line @atlaskit/editor/no-re-export
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.table = void 0;
7
+ var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
+ // A bare `table` node stub, declared in an import-cycle-free leaf module so that other node
9
+ // modules (e.g. `panel`) can reference `table` in their content WITHOUT importing the heavy
10
+ // `tableNodes.ts` definition module. Importing `tableNodes.ts` from `panel.ts` would form a
11
+ // module import cycle (panel -> tableNodes -> nestedExpand / tableCellContentPseudoGroup ->
12
+ // panel) and crash at module-eval time.
13
+ //
14
+ // `tableNodes.ts` imports this same stub and calls `.define()` / `.variant()` on it, so the
15
+ // object here is the one and only `table` node. Spec resolution is deferred to codegen traversal,
16
+ // which is cycle-aware, so referencing this stub before it is defined is safe.
17
+ var table = exports.table = (0, _adfSchemaGenerator.adfNode)('table');
@@ -12,12 +12,6 @@ import { extension } from './nodes/extension';
12
12
  import { multiBodiedExtension } from './nodes/multiBodiedExtension';
13
13
  import { panel } from './nodes/panel';
14
14
  import { rule } from './nodes/rule';
15
- import { table } from './nodes/tableNodes';
16
-
17
- // Wire cross-container content after all node modules are fully evaluated,
18
- // so neither import is undefined when the $or() expression is constructed.
19
- panel.use('c1').addContent(table);
20
- panel.use('c1_root_only').addContent(table);
21
15
  const doc = adfNode('doc').define({
22
16
  root: true,
23
17
  version: 1,
@@ -14,6 +14,7 @@ import { rule } from './rule';
14
14
  import { taskList } from './task';
15
15
  import { unsupportedBlock } from './unsupportedBlock';
16
16
  import { extension } from './extension';
17
+ import { table } from './tableStub';
17
18
  const panelContent = [paragraph.use('with_no_marks'), paragraph.use('with_font_size'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, taskList, rule, decisionList, unsupportedBlock];
18
19
  export const panel = adfNode('panel').define({
19
20
  selectable: true,
@@ -52,9 +53,8 @@ export const panel = adfNode('panel').define({
52
53
  },
53
54
  content: [$onePlus($or(...panelContent, extension.use('with_marks')))]
54
55
  }).variant('c1', {
55
- // panel_c1 allows all standard panel content plus table (wired via addContent
56
- // in full-schema.adf.ts to avoid a circular module import).
57
- content: [$onePlus($or(...panelContent, extension.use('with_marks')))],
56
+ // panel_c1 allows all standard panel content plus table.
57
+ content: [$onePlus($or(...panelContent, extension.use('with_marks'), table))],
58
58
  ignore: ['json-schema', 'validator-spec'],
59
59
  preserveVariantNameInPm: true
60
60
  })
@@ -67,9 +67,8 @@ export const panel = adfNode('panel').define({
67
67
  .variant('c1_root_only', {
68
68
  stage0: true,
69
69
  marks: [breakout, unsupportedMark, unsupportedNodeAttribute],
70
- // panel_c1 allows all standard panel content plus table (wired via addContent
71
- // in full-schema.adf.ts to avoid a circular module import).
72
- content: [$onePlus($or(...panelContent, extension.use('with_marks')))],
70
+ // panel_c1_root_only allows all standard panel content plus table.
71
+ content: [$onePlus($or(...panelContent, extension.use('with_marks'), table))],
73
72
  ignore: ['json-schema', 'validator-spec'],
74
73
  preserveVariantNameInPm: true
75
74
  });
@@ -6,9 +6,7 @@ import { tableCellContentPseudoGroup, tableCellContentNodes, tableHeaderContentP
6
6
  import { tableCellContent } from './tableCellContent';
7
7
  import { nestedExpand } from './nestedExpand';
8
8
  import { unsupportedBlock } from './unsupportedBlock';
9
-
10
- // Declare early to allow for circular references within the file
11
- const table = adfNode('table');
9
+ import { table } from './tableStub';
12
10
  const valign = {
13
11
  type: 'enum',
14
12
  values: ['top', 'middle', 'bottom'],
@@ -153,4 +151,9 @@ table.define({
153
151
  content: [$onePlus($or(tableRow.use('with_nested_table')))],
154
152
  ignore: ['json-schema', 'validator-spec']
155
153
  });
154
+
155
+ // Re-export the now-defined `table` stub as this module's public API. Importing `table` from here
156
+ // (rather than from `./tableStub`) forces this definition module to evaluate first, so consumers
157
+ // that eagerly call `table.use('with_nested_table')` see the defined variant.
158
+ // eslint-disable-next-line @atlaskit/editor/no-re-export
156
159
  export { table };
@@ -0,0 +1,12 @@
1
+ import { adfNode } from '@atlaskit/adf-schema-generator';
2
+
3
+ // A bare `table` node stub, declared in an import-cycle-free leaf module so that other node
4
+ // modules (e.g. `panel`) can reference `table` in their content WITHOUT importing the heavy
5
+ // `tableNodes.ts` definition module. Importing `tableNodes.ts` from `panel.ts` would form a
6
+ // module import cycle (panel -> tableNodes -> nestedExpand / tableCellContentPseudoGroup ->
7
+ // panel) and crash at module-eval time.
8
+ //
9
+ // `tableNodes.ts` imports this same stub and calls `.define()` / `.variant()` on it, so the
10
+ // object here is the one and only `table` node. Spec resolution is deferred to codegen traversal,
11
+ // which is cycle-aware, so referencing this stub before it is defined is safe.
12
+ export const table = adfNode('table');
@@ -12,12 +12,6 @@ import { extension } from './nodes/extension';
12
12
  import { multiBodiedExtension } from './nodes/multiBodiedExtension';
13
13
  import { panel } from './nodes/panel';
14
14
  import { rule } from './nodes/rule';
15
- import { table } from './nodes/tableNodes';
16
-
17
- // Wire cross-container content after all node modules are fully evaluated,
18
- // so neither import is undefined when the $or() expression is constructed.
19
- panel.use('c1').addContent(table);
20
- panel.use('c1_root_only').addContent(table);
21
15
  var doc = adfNode('doc').define({
22
16
  root: true,
23
17
  version: 1,
@@ -14,6 +14,7 @@ import { rule } from './rule';
14
14
  import { taskList } from './task';
15
15
  import { unsupportedBlock } from './unsupportedBlock';
16
16
  import { extension } from './extension';
17
+ import { table } from './tableStub';
17
18
  var panelContent = [paragraph.use('with_no_marks'), paragraph.use('with_font_size'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock, taskList, rule, decisionList, unsupportedBlock];
18
19
  export var panel = adfNode('panel').define({
19
20
  selectable: true,
@@ -52,9 +53,8 @@ export var panel = adfNode('panel').define({
52
53
  },
53
54
  content: [$onePlus($or.apply(void 0, panelContent.concat([extension.use('with_marks')])))]
54
55
  }).variant('c1', {
55
- // panel_c1 allows all standard panel content plus table (wired via addContent
56
- // in full-schema.adf.ts to avoid a circular module import).
57
- content: [$onePlus($or.apply(void 0, panelContent.concat([extension.use('with_marks')])))],
56
+ // panel_c1 allows all standard panel content plus table.
57
+ content: [$onePlus($or.apply(void 0, panelContent.concat([extension.use('with_marks'), table])))],
58
58
  ignore: ['json-schema', 'validator-spec'],
59
59
  preserveVariantNameInPm: true
60
60
  })
@@ -67,9 +67,8 @@ export var panel = adfNode('panel').define({
67
67
  .variant('c1_root_only', {
68
68
  stage0: true,
69
69
  marks: [breakout, unsupportedMark, unsupportedNodeAttribute],
70
- // panel_c1 allows all standard panel content plus table (wired via addContent
71
- // in full-schema.adf.ts to avoid a circular module import).
72
- content: [$onePlus($or.apply(void 0, panelContent.concat([extension.use('with_marks')])))],
70
+ // panel_c1_root_only allows all standard panel content plus table.
71
+ content: [$onePlus($or.apply(void 0, panelContent.concat([extension.use('with_marks'), table])))],
73
72
  ignore: ['json-schema', 'validator-spec'],
74
73
  preserveVariantNameInPm: true
75
74
  });
@@ -7,9 +7,7 @@ import { tableCellContentPseudoGroup, tableCellContentNodes, tableHeaderContentP
7
7
  import { tableCellContent } from './tableCellContent';
8
8
  import { nestedExpand } from './nestedExpand';
9
9
  import { unsupportedBlock } from './unsupportedBlock';
10
-
11
- // Declare early to allow for circular references within the file
12
- var table = adfNode('table');
10
+ import { table } from './tableStub';
13
11
  var valign = {
14
12
  type: 'enum',
15
13
  values: ['top', 'middle', 'bottom'],
@@ -154,4 +152,9 @@ table.define({
154
152
  content: [$onePlus($or(tableRow.use('with_nested_table')))],
155
153
  ignore: ['json-schema', 'validator-spec']
156
154
  });
155
+
156
+ // Re-export the now-defined `table` stub as this module's public API. Importing `table` from here
157
+ // (rather than from `./tableStub`) forces this definition module to evaluate first, so consumers
158
+ // that eagerly call `table.use('with_nested_table')` see the defined variant.
159
+ // eslint-disable-next-line @atlaskit/editor/no-re-export
157
160
  export { table };
@@ -0,0 +1,12 @@
1
+ import { adfNode } from '@atlaskit/adf-schema-generator';
2
+
3
+ // A bare `table` node stub, declared in an import-cycle-free leaf module so that other node
4
+ // modules (e.g. `panel`) can reference `table` in their content WITHOUT importing the heavy
5
+ // `tableNodes.ts` definition module. Importing `tableNodes.ts` from `panel.ts` would form a
6
+ // module import cycle (panel -> tableNodes -> nestedExpand / tableCellContentPseudoGroup ->
7
+ // panel) and crash at module-eval time.
8
+ //
9
+ // `tableNodes.ts` imports this same stub and calls `.define()` / `.variant()` on it, so the
10
+ // object here is the one and only `table` node. Spec resolution is deferred to codegen traversal,
11
+ // which is cycle-aware, so referencing this stub before it is defined is safe.
12
+ export var table = adfNode('table');
@@ -1,3 +1,2 @@
1
- import type { ADFNode, ADFCommonNodeSpec } from '@atlaskit/adf-schema-generator';
2
- declare const table: ADFNode<[string], ADFCommonNodeSpec>;
1
+ import { table } from './tableStub';
3
2
  export { table };
@@ -0,0 +1,2 @@
1
+ import type { ADFCommonNodeSpec, ADFNode } from '@atlaskit/adf-schema-generator';
2
+ export declare const table: ADFNode<[string], ADFCommonNodeSpec>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "56.7.1",
3
+ "version": "56.7.3",
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/"
@@ -37,10 +37,10 @@
37
37
  "build:schema:all": "yarn build:schema:pm && yarn build:schema:json && yarn build:schema:validator"
38
38
  },
39
39
  "dependencies": {
40
- "@atlaskit/adf-schema-generator": "^3.1.0",
40
+ "@atlaskit/adf-schema-generator": "^4.0.0",
41
41
  "@atlaskit/editor-prosemirror": "^8.0.0",
42
42
  "@atlaskit/platform-feature-flags": "^2.1.0",
43
- "@atlaskit/tmp-editor-statsig": "^146.0.0",
43
+ "@atlaskit/tmp-editor-statsig": "^147.0.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "css-color-names": "0.0.4",
46
46
  "linkify-it": "^5.0.2",