@atlaskit/adf-schema 56.7.3 → 57.0.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 +66 -0
- package/compass.yml +3 -3
- package/dist/cjs/next-schema/full-schema.adf.js +1 -1
- package/dist/cjs/next-schema/generated/nodeTypes.js +29 -4
- package/dist/cjs/next-schema/nodes/layoutColumn.js +3 -1
- package/dist/cjs/next-schema/nodes/panel.js +9 -4
- package/dist/cjs/schema/marks/background-color.js +0 -2
- package/dist/cjs/schema/marks/strong.js +0 -2
- package/dist/cjs/schema/marks/text-color.js +0 -2
- package/dist/cjs/schema/nodes/code-block.js +0 -3
- package/dist/cjs/schema/nodes/media.js +3 -7
- package/dist/cjs/schema/nodes/panel.js +2 -2
- package/dist/cjs/schema/nodes/status.js +0 -1
- package/dist/cjs/schema/nodes/tableNodes.js +0 -4
- package/dist/cjs/schema/sanitizeNodes.js +0 -3
- package/dist/cjs/steps/batch-attrs-step.js +1 -1
- package/dist/cjs/utils/colors.js +0 -6
- package/dist/cjs/utils/lch-color-inversion.js +0 -2
- package/dist/cjs/utils/uuid.js +4 -7
- package/dist/cjs/validator-schema/generated/validatorSpec.js +29 -4
- package/dist/es2019/next-schema/full-schema.adf.js +1 -1
- package/dist/es2019/next-schema/generated/nodeTypes.js +28 -3
- package/dist/es2019/next-schema/index.js +1 -1
- package/dist/es2019/next-schema/nodes/layoutColumn.js +3 -1
- package/dist/es2019/next-schema/nodes/panel.js +9 -4
- package/dist/es2019/schema/marks/background-color.js +0 -2
- package/dist/es2019/schema/marks/strong.js +0 -2
- package/dist/es2019/schema/marks/text-color.js +0 -2
- package/dist/es2019/schema/nodes/code-block.js +0 -3
- package/dist/es2019/schema/nodes/media.js +1 -4
- package/dist/es2019/schema/nodes/panel.js +1 -1
- package/dist/es2019/schema/nodes/status.js +0 -1
- package/dist/es2019/schema/nodes/tableNodes.js +0 -4
- package/dist/es2019/schema/sanitizeNodes.js +0 -3
- package/dist/es2019/steps/batch-attrs-step.js +1 -0
- package/dist/es2019/utils/colors.js +0 -6
- package/dist/es2019/utils/lch-color-inversion.js +0 -2
- package/dist/es2019/utils/uuid.js +1 -3
- package/dist/es2019/validator-schema/generated/validatorSpec.js +28 -3
- package/dist/esm/next-schema/full-schema.adf.js +1 -1
- package/dist/esm/next-schema/generated/nodeTypes.js +28 -3
- package/dist/esm/next-schema/index.js +1 -1
- package/dist/esm/next-schema/nodes/layoutColumn.js +3 -1
- package/dist/esm/next-schema/nodes/panel.js +9 -4
- package/dist/esm/schema/marks/background-color.js +0 -2
- package/dist/esm/schema/marks/strong.js +0 -2
- package/dist/esm/schema/marks/text-color.js +0 -2
- package/dist/esm/schema/nodes/code-block.js +0 -3
- package/dist/esm/schema/nodes/media.js +3 -7
- package/dist/esm/schema/nodes/panel.js +1 -1
- package/dist/esm/schema/nodes/status.js +0 -1
- package/dist/esm/schema/nodes/tableNodes.js +0 -4
- package/dist/esm/schema/sanitizeNodes.js +0 -3
- package/dist/esm/steps/batch-attrs-step.js +1 -0
- package/dist/esm/utils/colors.js +0 -6
- package/dist/esm/utils/lch-color-inversion.js +0 -2
- package/dist/esm/utils/uuid.js +4 -7
- package/dist/esm/validator-schema/generated/validatorSpec.js +28 -3
- package/dist/json-schema/v1/stage-0.json +215 -1
- package/dist/types/next-schema/generated/nodeGroupTypes.d.ts +2 -2
- package/dist/types/next-schema/generated/nodeTypes.d.ts +21 -6
- package/dist/types/validator-schema/generated/validatorSpec.d.ts +26 -1
- package/json-schema/v1/stage-0.json +215 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,71 @@
|
|
|
1
1
|
# @atlaskit/adf-schema
|
|
2
2
|
|
|
3
|
+
## 57.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 57.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- [`710e3d9ec4c65`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/710e3d9ec4c65) -
|
|
14
|
+
Allow a table nested inside a panel, but only at the document root, inside a synced block, or
|
|
15
|
+
inside a layout column (the `panel_c1` variant).
|
|
16
|
+
|
|
17
|
+
`panel_c1` is now marked `stage0` and emitted as a standalone JSON Schema definition (via
|
|
18
|
+
`noExtend`), so table-in-panel validates in the stage-0 schema at those positions only — a plain
|
|
19
|
+
`panel` elsewhere still rejects a table.
|
|
20
|
+
|
|
21
|
+
The runtime `@atlaskit/adf-utils` validator can now accept table-in-panel via the `panel_c1` spec
|
|
22
|
+
directly, gated behind the `platform_editor_table_in_panel_patch_1` feature gate. Three validator
|
|
23
|
+
fixes make this work (all gated — when the gate is off, the validator behaves exactly as before):
|
|
24
|
+
1. A variant tuple's overridden content-item names are resolved to their base specs the same way
|
|
25
|
+
base-spec content is (e.g. `paragraph_with_no_marks` → `paragraph`). Previously they stayed
|
|
26
|
+
raw, so `panel_c1` matched only plainly-named children (`table`) and rejected variant-named
|
|
27
|
+
ones (a normal `paragraph`).
|
|
28
|
+
2. `createSpec` retains a variant whose overridden content is a nested `$or` list (e.g.
|
|
29
|
+
`panel_c1`) when the validator is built from an explicit node list (as `validateADFEntity`
|
|
30
|
+
does).
|
|
31
|
+
3. When a stored node matches several candidate specs, the multi-branch matcher prefers a branch
|
|
32
|
+
that validates cleanly over one that only "succeeds" by wrapping otherwise-valid content as
|
|
33
|
+
`unsupportedBlock` — so `panel_c1` is chosen instead of the base `panel` repairing the table
|
|
34
|
+
away.
|
|
35
|
+
|
|
36
|
+
The `allowTableInPanel` override in `@atlaskit/editor-common` is retained but gated by the same
|
|
37
|
+
feature gate: when `platform_editor_table_in_panel_patch_1` is on the override is skipped (the
|
|
38
|
+
validator fixes handle table-in-panel); when it is off the override runs as before. So the single
|
|
39
|
+
gate flips between the new validator behaviour (on) and the previous override behaviour (off).
|
|
40
|
+
|
|
41
|
+
Also adds `panel-with-nested-table` validation fixtures.
|
|
42
|
+
|
|
43
|
+
**BREAKING (`@atlaskit/adf-schema`):** marking `panel_c1` as `stage0` (correcting an earlier
|
|
44
|
+
omission) renames its generated `schema-next` exports: `panelC1` → `panelC1Stage0`, `PanelC1Node`
|
|
45
|
+
→ `PanelC1Stage0Node`, `PanelC1Definition` → `PanelC1Stage0Definition`.
|
|
46
|
+
|
|
47
|
+
Migration — update imports from `@atlaskit/adf-schema/schema-next`:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
// Before
|
|
51
|
+
import {
|
|
52
|
+
panelC1,
|
|
53
|
+
type PanelC1Node,
|
|
54
|
+
type PanelC1Definition,
|
|
55
|
+
} from '@atlaskit/adf-schema/schema-next';
|
|
56
|
+
|
|
57
|
+
// After
|
|
58
|
+
import {
|
|
59
|
+
panelC1Stage0,
|
|
60
|
+
type PanelC1Stage0Node,
|
|
61
|
+
type PanelC1Stage0Definition,
|
|
62
|
+
} from '@atlaskit/adf-schema/schema-next';
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- Updated dependencies
|
|
68
|
+
|
|
3
69
|
## 56.7.3
|
|
4
70
|
|
|
5
71
|
### Patch Changes
|
package/compass.yml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
configVersion: 1
|
|
2
2
|
id: ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:component/c5751cc6-3513-4070-9deb-af31e86aed34/1784a7c0-b12e-4c98-892b-bb493bce62c8
|
|
3
3
|
name: '@atlaskit/adf-schema'
|
|
4
|
-
ownerId: ari:cloud:identity::team/
|
|
4
|
+
ownerId: ari:cloud:identity::team/cf6a670b-5252-4c68-a769-9207de366beb # Editor Developers
|
|
5
5
|
labels:
|
|
6
6
|
- platform-code
|
|
7
7
|
- platform-afm
|
|
@@ -16,14 +16,14 @@ links:
|
|
|
16
16
|
url: https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master
|
|
17
17
|
- name: Slack Channel
|
|
18
18
|
type: CHAT_CHANNEL
|
|
19
|
-
url: https://atlassian.enterprise.slack.com/archives/
|
|
19
|
+
url: https://atlassian.enterprise.slack.com/archives/CFG3PSQ9E # #help-editor
|
|
20
20
|
- name: Adf Schema
|
|
21
21
|
type: REPOSITORY
|
|
22
22
|
url: https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master/platform/packages/editor/adf-schema
|
|
23
23
|
customFields:
|
|
24
24
|
- name: Department
|
|
25
25
|
type: text
|
|
26
|
-
value:
|
|
26
|
+
value: Editor Developers
|
|
27
27
|
- name: Trusted Reviewer Teams
|
|
28
28
|
type: text
|
|
29
29
|
value: ari:cloud:identity::team/cf6a670b-5252-4c68-a769-9207de366beb
|
|
@@ -21,7 +21,7 @@ var _rule = require("./nodes/rule");
|
|
|
21
21
|
var doc = (0, _adfSchemaGenerator.adfNode)('doc').define({
|
|
22
22
|
root: true,
|
|
23
23
|
version: 1,
|
|
24
|
-
content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_blockGroup.blockGroup, _blockContentGroup.blockContentGroup, _codeBlock.codeBlock.use('root_only'), _panel.panel.use('root_only'), _rule.rule.use('root_only'), _extension.extension.use('root_only'), _bodiedExtension.bodiedExtension.use('root_only'), _multiBodiedExtension.multiBodiedExtension.use('root_only'), _layoutSection.layoutSection, _layoutSection.layoutSection.use('with_single_column'), _layoutSection.layoutSection.use('full'), _blockRootOnlyGroup.blockRootOnlyGroup, _expand.expand.use('root_only'), _syncBlock.syncBlock, _bodiedSyncBlock.bodiedSyncBlock))],
|
|
24
|
+
content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_blockGroup.blockGroup, _blockContentGroup.blockContentGroup, _codeBlock.codeBlock.use('root_only'), _panel.panel.use('root_only'), _panel.panel.use('c1'), _panel.panel.use('c1_root_only'), _rule.rule.use('root_only'), _extension.extension.use('root_only'), _bodiedExtension.bodiedExtension.use('root_only'), _multiBodiedExtension.multiBodiedExtension.use('root_only'), _layoutSection.layoutSection, _layoutSection.layoutSection.use('with_single_column'), _layoutSection.layoutSection.use('full'), _blockRootOnlyGroup.blockRootOnlyGroup, _expand.expand.use('root_only'), _syncBlock.syncBlock, _bodiedSyncBlock.bodiedSyncBlock))],
|
|
25
25
|
DANGEROUS_MANUAL_OVERRIDE: {
|
|
26
26
|
'validator-spec': {
|
|
27
27
|
'props.content.minItems': {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.unsupportedInline = exports.unsupportedBlock = exports.textWithNoMarks = exports.textFormatted = exports.textCodeInline = exports.text = exports.taskList = exports.taskItem = exports.tableWithNestedTable = exports.tableRowWithNestedTable = exports.tableRow = exports.tableHeaderWithNestedTable = exports.tableHeader = exports.tableCellWithNestedTable = exports.tableCell = exports.table = exports.syncBlock = exports.statusStage0 = exports.status = exports.ruleRootOnlyStage0 = exports.rule = exports.placeholder = exports.paragraphWithNoMarks = exports.paragraphWithIndentation = exports.paragraphWithFontSize = exports.paragraphWithAlignment = exports.paragraph = exports.panelRootOnlyStage0 = exports.
|
|
6
|
+
exports.unsupportedInline = exports.unsupportedBlock = exports.textWithNoMarks = exports.textFormatted = exports.textCodeInline = exports.text = exports.taskList = exports.taskItem = exports.tableWithNestedTable = exports.tableRowWithNestedTable = exports.tableRow = exports.tableHeaderWithNestedTable = exports.tableHeader = exports.tableCellWithNestedTable = exports.tableCell = exports.table = exports.syncBlock = exports.statusStage0 = exports.status = exports.ruleRootOnlyStage0 = exports.rule = exports.placeholder = exports.paragraphWithNoMarks = exports.paragraphWithIndentation = exports.paragraphWithFontSize = exports.paragraphWithAlignment = exports.paragraph = exports.panelRootOnlyStage0 = exports.panelC1Stage0 = exports.panelC1RootOnlyStage0 = exports.panel = exports.orderedList = exports.nestedExpandWithNoMarks = exports.nestedExpand = exports.multiBodiedExtensionStage0 = exports.multiBodiedExtensionRootOnlyStage0 = exports.mentionStage0 = exports.mention = exports.mediaSingleWidthType = exports.mediaSingleFull = exports.mediaSingleCaption = exports.mediaSingle = exports.mediaInline = exports.mediaGroup = exports.media = exports.listItem = exports.layoutSectionWithSingleColumnStage0 = exports.layoutSectionFull = exports.layoutSection = exports.layoutColumn = exports.inlineExtensionWithMarks = exports.inlineExtension = exports.inlineCardStage0 = exports.inlineCard = exports.image = exports.headingWithNoMarks = exports.headingWithIndentation = exports.headingWithAlignment = exports.heading = exports.hardBreak = exports.extensionWithMarks = exports.extensionRootOnlyStage0 = exports.extensionFrameStage0 = exports.extension = exports.expandRootOnly = exports.expand = exports.emojiStage0 = exports.emoji = exports.embedCard = exports.doc = exports.decisionList = exports.decisionItem = exports.dateStage0 = exports.date = exports.confluenceUnsupportedInline = exports.confluenceUnsupportedBlock = exports.confluenceJiraIssue = exports.codeBlockRootOnly = exports.codeBlock = exports.caption = exports.bulletList = exports.bodiedSyncBlock = exports.bodiedExtensionWithMarks = exports.bodiedExtensionRootOnlyStage0 = exports.bodiedExtension = exports.blockquoteLegacy = exports.blockquote = exports.blockTaskItem = exports.blockCard = void 0;
|
|
7
7
|
var _createPMSpecFactory = require("../../schema/createPMSpecFactory");
|
|
8
8
|
/**
|
|
9
9
|
* This file was automatically generated by @atlaskit/adf-schema-generator
|
|
@@ -331,7 +331,7 @@ var decisionList = exports.decisionList = (0, _createPMSpecFactory.createPMNodeS
|
|
|
331
331
|
defining: true
|
|
332
332
|
});
|
|
333
333
|
var doc = exports.doc = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
|
|
334
|
-
content: '(block | codeBlock | panel | rule | extension | bodiedExtension | multiBodiedExtension | layoutSection | blockRootOnly | expand | syncBlock | bodiedSyncBlock)+',
|
|
334
|
+
content: '(block | codeBlock | panel | panel_c1 | panel_c1_root_only | rule | extension | bodiedExtension | multiBodiedExtension | layoutSection | blockRootOnly | expand | syncBlock | bodiedSyncBlock)+',
|
|
335
335
|
marks: 'unsupportedMark unsupportedNodeAttribute fontSize alignment indentation dataConsumer fragment breakout'
|
|
336
336
|
});
|
|
337
337
|
var embedCard = exports.embedCard = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
|
|
@@ -677,7 +677,7 @@ var inlineExtensionWithMarks = exports.inlineExtensionWithMarks = (0, _createPMS
|
|
|
677
677
|
selectable: true
|
|
678
678
|
});
|
|
679
679
|
var layoutColumn = exports.layoutColumn = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
|
|
680
|
-
content: '(block | unsupportedBlock)+',
|
|
680
|
+
content: '(block | unsupportedBlock | panel_c1)+',
|
|
681
681
|
marks: 'unsupportedMark unsupportedNodeAttribute fontSize alignment indentation dataConsumer fragment',
|
|
682
682
|
attrs: {
|
|
683
683
|
width: {
|
|
@@ -1093,7 +1093,32 @@ var panel = exports.panel = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
|
|
|
1093
1093
|
},
|
|
1094
1094
|
selectable: true
|
|
1095
1095
|
});
|
|
1096
|
-
var
|
|
1096
|
+
var panelC1RootOnlyStage0 = exports.panelC1RootOnlyStage0 = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
|
|
1097
|
+
content: '(paragraph | heading | bulletList | orderedList | blockCard | mediaGroup | mediaSingle | codeBlock | taskList | rule | decisionList | unsupportedBlock | extension | table)+',
|
|
1098
|
+
marks: 'fontSize unsupportedMark unsupportedNodeAttribute dataConsumer fragment',
|
|
1099
|
+
attrs: {
|
|
1100
|
+
panelType: {
|
|
1101
|
+
default: 'info'
|
|
1102
|
+
},
|
|
1103
|
+
panelIcon: {
|
|
1104
|
+
default: null
|
|
1105
|
+
},
|
|
1106
|
+
panelIconId: {
|
|
1107
|
+
default: null
|
|
1108
|
+
},
|
|
1109
|
+
panelIconText: {
|
|
1110
|
+
default: null
|
|
1111
|
+
},
|
|
1112
|
+
panelColor: {
|
|
1113
|
+
default: null
|
|
1114
|
+
},
|
|
1115
|
+
localId: {
|
|
1116
|
+
default: null
|
|
1117
|
+
}
|
|
1118
|
+
},
|
|
1119
|
+
selectable: true
|
|
1120
|
+
});
|
|
1121
|
+
var panelC1Stage0 = exports.panelC1Stage0 = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
|
|
1097
1122
|
content: '(paragraph | heading | bulletList | orderedList | blockCard | mediaGroup | mediaSingle | codeBlock | taskList | rule | decisionList | unsupportedBlock | extension | table)+',
|
|
1098
1123
|
marks: 'fontSize unsupportedMark unsupportedNodeAttribute dataConsumer fragment',
|
|
1099
1124
|
group: 'block',
|
|
@@ -10,6 +10,7 @@ var _blockGroup = require("../groups/blockGroup");
|
|
|
10
10
|
var _unsupportedMark = require("../marks/unsupportedMark");
|
|
11
11
|
var _unsupportedNodeAttribute = require("../marks/unsupportedNodeAttribute");
|
|
12
12
|
var _unsupportedBlock = require("../nodes/unsupportedBlock");
|
|
13
|
+
var _panel = require("./panel");
|
|
13
14
|
var layoutColumnAttributes = {
|
|
14
15
|
width: {
|
|
15
16
|
type: 'number',
|
|
@@ -34,5 +35,6 @@ var layoutColumn = exports.layoutColumn = (0, _adfSchemaGenerator.adfNode)('layo
|
|
|
34
35
|
selectable: false,
|
|
35
36
|
marks: [_unsupportedMark.unsupportedMark, _unsupportedNodeAttribute.unsupportedNodeAttribute],
|
|
36
37
|
attrs: layoutColumnAttributes,
|
|
37
|
-
|
|
38
|
+
// panel_c1 (table-in-panel) is also valid inside a layout column.
|
|
39
|
+
content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_blockGroup.blockGroup, _blockContentGroup.blockContentGroup, _unsupportedBlock.unsupportedBlock, _panel.panel.use('c1')))]
|
|
38
40
|
});
|
|
@@ -59,9 +59,14 @@ var panel = exports.panel = (0, _adfSchemaGenerator.adfNode)('panel').define({
|
|
|
59
59
|
},
|
|
60
60
|
content: [(0, _adfSchemaGenerator.$onePlus)(_adfSchemaGenerator.$or.apply(void 0, panelContent.concat([_extension.extension.use('with_marks')])))]
|
|
61
61
|
}).variant('c1', {
|
|
62
|
-
// panel_c1 allows all standard panel content plus table.
|
|
62
|
+
// panel_c1 allows all standard panel content plus table. `stage0: true` includes it in the
|
|
63
|
+
// stage-0 JSON schema (not full) and the validator spec so table-in-panel validates.
|
|
64
|
+
// `noExtend` emits it as a standalone JSON Schema definition because its content is a
|
|
65
|
+
// superset of panel_node (adds table), which an allOf extension cannot express. Runtime
|
|
66
|
+
// acceptance is gated in adf-utils behind the patch flag.
|
|
67
|
+
stage0: true,
|
|
68
|
+
noExtend: true,
|
|
63
69
|
content: [(0, _adfSchemaGenerator.$onePlus)(_adfSchemaGenerator.$or.apply(void 0, panelContent.concat([_extension.extension.use('with_marks'), _tableStub.table])))],
|
|
64
|
-
ignore: ['json-schema', 'validator-spec'],
|
|
65
70
|
preserveVariantNameInPm: true
|
|
66
71
|
})
|
|
67
72
|
// this variant is used to support breakout resizing for panel nodes at the document root
|
|
@@ -72,9 +77,9 @@ var panel = exports.panel = (0, _adfSchemaGenerator.adfNode)('panel').define({
|
|
|
72
77
|
// this variant is used to support breakout resizing for panel_c1 nodes at the document root
|
|
73
78
|
.variant('c1_root_only', {
|
|
74
79
|
stage0: true,
|
|
80
|
+
noExtend: true,
|
|
75
81
|
marks: [_breakout.breakout, _unsupportedMark.unsupportedMark, _unsupportedNodeAttribute.unsupportedNodeAttribute],
|
|
76
|
-
// panel_c1_root_only allows all standard panel content plus table.
|
|
82
|
+
// panel_c1_root_only allows all standard panel content plus table (see c1 above).
|
|
77
83
|
content: [(0, _adfSchemaGenerator.$onePlus)(_adfSchemaGenerator.$or.apply(void 0, panelContent.concat([_extension.extension.use('with_marks'), _tableStub.table])))],
|
|
78
|
-
ignore: ['json-schema', 'validator-spec'],
|
|
79
84
|
preserveVariantNameInPm: true
|
|
80
85
|
});
|
|
@@ -61,8 +61,6 @@ colorArrayPalette.forEach(function (_ref) {
|
|
|
61
61
|
label = _ref2[1];
|
|
62
62
|
return backgroundColorPalette.set(color.toLowerCase(), label);
|
|
63
63
|
});
|
|
64
|
-
|
|
65
|
-
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
66
64
|
var RGB_PREFIX_BG_COLOR_REGEX = /^rgb/i;
|
|
67
65
|
var backgroundColorPaletteNew = exports.backgroundColorPaletteNew = new Map();
|
|
68
66
|
colorArrayPaletteNew.forEach(function (_ref3) {
|
|
@@ -10,8 +10,6 @@ var _markTypes = require("../../next-schema/generated/markTypes");
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
var strongDOM = ['strong'];
|
|
13
|
-
|
|
14
|
-
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
15
13
|
var BOLD_FONT_WEIGHT_REGEX = /^(bold(er)?|[5-9][0-9]{2,})$/;
|
|
16
14
|
var strong = exports.strong = (0, _markTypes.strong)({
|
|
17
15
|
parseDOM: [{
|
|
@@ -153,8 +153,6 @@ var getGlobalTheme = exports.getGlobalTheme = function getGlobalTheme() {
|
|
|
153
153
|
colorMode: colorMode
|
|
154
154
|
};
|
|
155
155
|
};
|
|
156
|
-
|
|
157
|
-
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
158
156
|
var RGB_PREFIX_TEXT_COLOR_REGEX = /^rgb/i;
|
|
159
157
|
var textColor = exports.textColor = (0, _markTypes.textColor)({
|
|
160
158
|
parseDOM: [{
|
|
@@ -36,10 +36,7 @@ var getLanguageFromCode = function getLanguageFromCode(dom) {
|
|
|
36
36
|
return firstChild.getAttribute('data-language') || undefined;
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
|
|
40
|
-
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
41
39
|
var LANGUAGE_CLASS_REGEX = /(?:^|[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])language-((?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)/;
|
|
42
|
-
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
43
40
|
var TRAILING_NEWLINE_REGEX = /\n$/;
|
|
44
41
|
var extractLanguageFromClass = function extractLanguageFromClass(className) {
|
|
45
42
|
var result = LANGUAGE_CLASS_REGEX.exec(className);
|
|
@@ -16,15 +16,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
var defaultAttrs = exports.defaultAttrs = _objectSpread({}, (0, _nodeTypes.media)({}).attrs);
|
|
19
|
-
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
20
19
|
var PRIVATE_ATTR_PREFIX_REGEX = /^__/;
|
|
21
20
|
var camelCaseToKebabCase = exports.camelCaseToKebabCase = function camelCaseToKebabCase(str) {
|
|
22
|
-
return (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return "".concat(x, "-").concat(y.toLowerCase());
|
|
26
|
-
})
|
|
27
|
-
);
|
|
21
|
+
return str.replace(/((?:[\0-@\[-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)([A-Z])/g, function (_, x, y) {
|
|
22
|
+
return "".concat(x, "-").concat(y.toLowerCase());
|
|
23
|
+
});
|
|
28
24
|
};
|
|
29
25
|
var copyPrivateAttributes = exports.copyPrivateAttributes = function copyPrivateAttributes(from, to, attributes, map) {
|
|
30
26
|
var attrs = attributes || {};
|
|
@@ -106,10 +106,10 @@ var extendedPanelWithLocalId = exports.extendedPanelWithLocalId = function exten
|
|
|
106
106
|
* and generateLocalId propagate identically.
|
|
107
107
|
*/
|
|
108
108
|
var extendedPanelC1 = exports.extendedPanelC1 = function extendedPanelC1(allowCustomPanel) {
|
|
109
|
-
return (0, _nodeTypes.
|
|
109
|
+
return (0, _nodeTypes.panelC1Stage0)(createPanelNodeSpecOptions(allowCustomPanel));
|
|
110
110
|
};
|
|
111
111
|
var extendedPanelC1WithLocalId = exports.extendedPanelC1WithLocalId = function extendedPanelC1WithLocalId(allowCustomPanel) {
|
|
112
|
-
return (0, _nodeTypes.
|
|
112
|
+
return (0, _nodeTypes.panelC1Stage0)(createPanelNodeSpecOptions(allowCustomPanel, true));
|
|
113
113
|
};
|
|
114
114
|
|
|
115
115
|
/**
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.status = void 0;
|
|
7
7
|
var _uuid = require("../../utils/uuid");
|
|
8
8
|
var _nodeTypes = require("../../next-schema/generated/nodeTypes");
|
|
9
|
-
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
10
9
|
var NEWLINE_REGEX = /\n/;
|
|
11
10
|
|
|
12
11
|
/**
|
|
@@ -16,8 +16,6 @@ var _valign = require("./types/valign");
|
|
|
16
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
18
|
var tablePrefixSelector = exports.tablePrefixSelector = 'pm-table';
|
|
19
|
-
|
|
20
|
-
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
21
19
|
var COL_WIDTH_ATTR_REGEX = /^[0-9]+(,[0-9]+)*$/;
|
|
22
20
|
var tableCellSelector = exports.tableCellSelector = "".concat(tablePrefixSelector, "-cell-content-wrap");
|
|
23
21
|
var tableHeaderSelector = exports.tableHeaderSelector = "".concat(tablePrefixSelector, "-header-content-wrap");
|
|
@@ -91,8 +89,6 @@ var getGlobalTheme = function getGlobalTheme() {
|
|
|
91
89
|
colorMode: colorMode
|
|
92
90
|
};
|
|
93
91
|
};
|
|
94
|
-
|
|
95
|
-
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
96
92
|
var cssVariablePattern = /^var\(--(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*\)$/;
|
|
97
93
|
|
|
98
94
|
/**
|
|
@@ -26,7 +26,6 @@ function sanitizeNodes(nodes, supportedMarks) {
|
|
|
26
26
|
return nodes;
|
|
27
27
|
}
|
|
28
28
|
function sanitizeNodeSpecContent(nodes, rawContent) {
|
|
29
|
-
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
30
29
|
var content = rawContent.replace(/(?:[\0-\/:-@\[-\^`\{-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g, ' ');
|
|
31
30
|
var contentKeys = content.split(' ');
|
|
32
31
|
var unsupportedContentKeys = Array.from(new Set(contentKeys.filter(function (contentKey) {
|
|
@@ -40,8 +39,6 @@ function sanitizeNodeSpecContent(nodes, rawContent) {
|
|
|
40
39
|
return sanitizedContent(newContent, nodeName);
|
|
41
40
|
}, rawContent);
|
|
42
41
|
}
|
|
43
|
-
|
|
44
|
-
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
45
42
|
var WORD_CHAR_REGEX = /[0-9A-Z_a-z]/;
|
|
46
43
|
function sanitizedContent(content, invalidContent) {
|
|
47
44
|
if (!invalidContent.length) {
|
|
@@ -17,7 +17,7 @@ var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
|
17
17
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18
18
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
19
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
20
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // oxlint-disable-next-line import/no-duplicates
|
|
21
21
|
var stepType = 'batchAttrs';
|
|
22
22
|
var isValidData = function isValidData(data) {
|
|
23
23
|
if (data !== null && !Array.isArray(data)) {
|
package/dist/cjs/utils/colors.js
CHANGED
|
@@ -15,7 +15,6 @@ exports.rgbToHex = rgbToHex;
|
|
|
15
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
16
|
var namedColors = _interopRequireWildcard(require("css-color-names"));
|
|
17
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
|
-
// @ts-ignore
|
|
19
18
|
// eslint-disable-next-line import/no-namespace
|
|
20
19
|
|
|
21
20
|
/**
|
|
@@ -177,7 +176,6 @@ function hexToRgba(rawColor, alpha) {
|
|
|
177
176
|
return null;
|
|
178
177
|
}
|
|
179
178
|
var hex2rgb = function hex2rgb(color) {
|
|
180
|
-
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
181
179
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
182
180
|
return color.match(/[0-9a-z\u017F\u212A]{2}/gi).map(function (hex) {
|
|
183
181
|
return parseInt(hex, 16);
|
|
@@ -186,7 +184,6 @@ function hexToRgba(rawColor, alpha) {
|
|
|
186
184
|
return "rgba(".concat(hex2rgb(color).concat(alpha).join(','), ")");
|
|
187
185
|
}
|
|
188
186
|
function rgbToHex(value) {
|
|
189
|
-
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
190
187
|
var matches = value.match(/(0?\.?[0-9]{1,3})%?\b/g);
|
|
191
188
|
if (matches && matches.length >= 3) {
|
|
192
189
|
var _matches$map = matches.map(Number),
|
|
@@ -198,10 +195,7 @@ function rgbToHex(value) {
|
|
|
198
195
|
}
|
|
199
196
|
return null;
|
|
200
197
|
}
|
|
201
|
-
|
|
202
|
-
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
203
198
|
var IS_RGB_REGEX = /rgba?\(/;
|
|
204
|
-
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
205
199
|
var IS_HEX_REGEX = /^#([0-9A-Fa-f]{3}){1,2}$/;
|
|
206
200
|
function isRgb(color) {
|
|
207
201
|
return IS_RGB_REGEX.test(color);
|
|
@@ -10,9 +10,7 @@ exports.getDarkModeLCHColor = exports.clampLightness = void 0;
|
|
|
10
10
|
|
|
11
11
|
// https://en.wikipedia.org/wiki/CIELAB_color_space
|
|
12
12
|
|
|
13
|
-
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
14
13
|
var SHORTHAND_HEX_REGEX = /^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i;
|
|
15
|
-
// @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
|
|
16
14
|
var FULL_HEX_REGEX = /^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;
|
|
17
15
|
var clamp = function clamp(i, min, max) {
|
|
18
16
|
return Math.round(Math.min(Math.max(i, min), max));
|
package/dist/cjs/utils/uuid.js
CHANGED
|
@@ -5,13 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.uuid = exports.generateUuid = void 0;
|
|
7
7
|
var generateUuid = exports.generateUuid = function generateUuid() {
|
|
8
|
-
return (
|
|
9
|
-
|
|
10
|
-
'
|
|
11
|
-
|
|
12
|
-
return (c === 'x' ? r : r & 0x3 | 0x8).toString(16);
|
|
13
|
-
})
|
|
14
|
-
);
|
|
8
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
9
|
+
var r = Math.random() * 16 | 0;
|
|
10
|
+
return (c === 'x' ? r : r & 0x3 | 0x8).toString(16);
|
|
11
|
+
});
|
|
15
12
|
};
|
|
16
13
|
var staticValue = false;
|
|
17
14
|
var uuid = exports.uuid = {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.underline = exports.text_with_no_marks = exports.text_link_inline = exports.text_formatted = exports.text_code_inline = exports.textColor = exports.text = exports.taskList = exports.taskItem = exports.tableRow = exports.tableHeader = exports.tableCell = exports.table = exports.syncBlock = exports.subsup = exports.strong = exports.strike = exports.status = exports.rule_root_only = exports.rule = exports.placeholder = exports.paragraph_with_no_marks = exports.paragraph_with_indentation = exports.paragraph_with_font_size = exports.paragraph_with_alignment = exports.paragraph = exports.panel_root_only = exports.panel = exports.orderedList = exports.non_nestable_block_content = exports.nestedExpand_with_no_marks = exports.nestedExpand_content = exports.nestedExpand = exports.multiBodiedExtension_root_only = exports.multiBodiedExtension = exports.mention = exports.mediaSingle_width_type = exports.mediaSingle_full = exports.mediaSingle_caption = exports.mediaSingle = exports.mediaInline = exports.mediaGroup = exports.media = exports.listItem = exports.link = exports.layoutSection_with_single_column = exports.layoutSection_full = exports.layoutSection = exports.layoutColumn = exports.inline_content = exports.inlineExtension_with_marks = exports.inlineExtension = exports.inlineCard = exports.indentation = exports.heading_with_no_marks = exports.heading_with_indentation = exports.heading_with_alignment = exports.heading = exports.hardBreak = exports.fragment = exports.fontSize = exports.extension_with_marks = exports.extension_root_only = exports.extensionFrame = exports.extension = exports.expand_root_only = exports.expand = exports.emoji = exports.embedCard = exports.em = exports.doc = exports.decisionList = exports.decisionItem = exports.date = exports.dataConsumer = exports.confluenceInlineComment = exports.codeBlock_root_only = exports.codeBlock = exports.code = exports.caption = exports.bulletList = exports.breakout = exports.border = exports.bodiedSyncBlock = exports.bodiedExtension_with_marks = exports.bodiedExtension_root_only = exports.bodiedExtension = exports.blockquote = exports.block_content = exports.blockTaskItem = exports.blockRootOnly = exports.blockCard = exports.backgroundColor = exports.annotation = exports.alignment = void 0;
|
|
6
|
+
exports.underline = exports.text_with_no_marks = exports.text_link_inline = exports.text_formatted = exports.text_code_inline = exports.textColor = exports.text = exports.taskList = exports.taskItem = exports.tableRow = exports.tableHeader = exports.tableCell = exports.table = exports.syncBlock = exports.subsup = exports.strong = exports.strike = exports.status = exports.rule_root_only = exports.rule = exports.placeholder = exports.paragraph_with_no_marks = exports.paragraph_with_indentation = exports.paragraph_with_font_size = exports.paragraph_with_alignment = exports.paragraph = exports.panel_root_only = exports.panel_c1_root_only = exports.panel_c1 = exports.panel = exports.orderedList = exports.non_nestable_block_content = exports.nestedExpand_with_no_marks = exports.nestedExpand_content = exports.nestedExpand = exports.multiBodiedExtension_root_only = exports.multiBodiedExtension = exports.mention = exports.mediaSingle_width_type = exports.mediaSingle_full = exports.mediaSingle_caption = exports.mediaSingle = exports.mediaInline = exports.mediaGroup = exports.media = exports.listItem = exports.link = exports.layoutSection_with_single_column = exports.layoutSection_full = exports.layoutSection = exports.layoutColumn = exports.inline_content = exports.inlineExtension_with_marks = exports.inlineExtension = exports.inlineCard = exports.indentation = exports.heading_with_no_marks = exports.heading_with_indentation = exports.heading_with_alignment = exports.heading = exports.hardBreak = exports.fragment = exports.fontSize = exports.extension_with_marks = exports.extension_root_only = exports.extensionFrame = exports.extension = exports.expand_root_only = exports.expand = exports.emoji = exports.embedCard = exports.em = exports.doc = exports.decisionList = exports.decisionItem = exports.date = exports.dataConsumer = exports.confluenceInlineComment = exports.codeBlock_root_only = exports.codeBlock = exports.code = exports.caption = exports.bulletList = exports.breakout = exports.border = exports.bodiedSyncBlock = exports.bodiedExtension_with_marks = exports.bodiedExtension_root_only = exports.bodiedExtension = exports.blockquote = exports.block_content = exports.blockTaskItem = exports.blockRootOnly = exports.blockCard = exports.backgroundColor = exports.annotation = exports.alignment = void 0;
|
|
7
7
|
var alignment = exports.alignment = {
|
|
8
8
|
props: {
|
|
9
9
|
attrs: {
|
|
@@ -263,7 +263,7 @@ var bodiedSyncBlock = exports.bodiedSyncBlock = {
|
|
|
263
263
|
},
|
|
264
264
|
content: {
|
|
265
265
|
allowUnsupportedBlock: true,
|
|
266
|
-
items: [['paragraph', 'paragraph_with_alignment', 'paragraph_with_indentation', 'paragraph_with_no_marks', 'blockCard', 'blockquote', 'bulletList', 'codeBlock', 'decisionList', 'embedCard', 'expand', 'heading', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'layoutSection', 'layoutSection_with_single_column', 'layoutSection_full', 'mediaGroup', 'mediaSingle', 'mediaSingle_caption', 'mediaSingle_full', 'mediaSingle_width_type', 'orderedList', 'panel', 'rule', 'table', 'taskList']],
|
|
266
|
+
items: [['paragraph', 'paragraph_with_alignment', 'paragraph_with_indentation', 'paragraph_with_no_marks', 'blockCard', 'blockquote', 'bulletList', 'codeBlock', 'decisionList', 'embedCard', 'expand', 'heading', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'layoutSection', 'layoutSection_with_single_column', 'layoutSection_full', 'mediaGroup', 'mediaSingle', 'mediaSingle_caption', 'mediaSingle_full', 'mediaSingle_width_type', 'orderedList', 'panel', 'panel_c1', 'rule', 'table', 'taskList']],
|
|
267
267
|
minItems: 1,
|
|
268
268
|
type: 'array'
|
|
269
269
|
},
|
|
@@ -528,7 +528,7 @@ var doc = exports.doc = {
|
|
|
528
528
|
props: {
|
|
529
529
|
content: {
|
|
530
530
|
allowUnsupportedBlock: true,
|
|
531
|
-
items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'mediaGroup', 'decisionList', 'rule', 'panel', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks', 'codeBlock_root_only', 'panel_root_only', 'rule_root_only', 'extension_root_only', 'bodiedExtension_root_only', 'multiBodiedExtension_root_only', 'layoutSection_with_single_column', 'layoutSection_full', 'multiBodiedExtension', 'expand_root_only', 'syncBlock', 'bodiedSyncBlock']],
|
|
531
|
+
items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'mediaGroup', 'decisionList', 'rule', 'panel', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks', 'codeBlock_root_only', 'panel_root_only', 'panel_c1', 'panel_c1_root_only', 'rule_root_only', 'extension_root_only', 'bodiedExtension_root_only', 'multiBodiedExtension_root_only', 'layoutSection_with_single_column', 'layoutSection_full', 'multiBodiedExtension', 'expand_root_only', 'syncBlock', 'bodiedSyncBlock']],
|
|
532
532
|
type: 'array'
|
|
533
533
|
},
|
|
534
534
|
type: {
|
|
@@ -975,7 +975,7 @@ var layoutColumn = exports.layoutColumn = {
|
|
|
975
975
|
},
|
|
976
976
|
content: {
|
|
977
977
|
allowUnsupportedBlock: true,
|
|
978
|
-
items: ['
|
|
978
|
+
items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'mediaGroup', 'decisionList', 'rule', 'panel', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks', 'panel_c1']],
|
|
979
979
|
minItems: 1,
|
|
980
980
|
type: 'array'
|
|
981
981
|
},
|
|
@@ -1553,6 +1553,31 @@ var panel = exports.panel = {
|
|
|
1553
1553
|
}
|
|
1554
1554
|
}
|
|
1555
1555
|
};
|
|
1556
|
+
var panel_c1 = exports.panel_c1 = ['panel', {
|
|
1557
|
+
props: {
|
|
1558
|
+
content: {
|
|
1559
|
+
allowUnsupportedBlock: true,
|
|
1560
|
+
items: [['paragraph_with_no_marks', 'paragraph_with_font_size', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'rule', 'decisionList', 'extension_with_marks', 'table']],
|
|
1561
|
+
minItems: 1,
|
|
1562
|
+
type: 'array'
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
}];
|
|
1566
|
+
var panel_c1_root_only = exports.panel_c1_root_only = ['panel', {
|
|
1567
|
+
props: {
|
|
1568
|
+
content: {
|
|
1569
|
+
allowUnsupportedBlock: true,
|
|
1570
|
+
items: [['paragraph_with_no_marks', 'paragraph_with_font_size', 'heading_with_no_marks', 'bulletList', 'orderedList', 'blockCard', 'mediaGroup', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'rule', 'decisionList', 'extension_with_marks', 'table']],
|
|
1571
|
+
minItems: 1,
|
|
1572
|
+
type: 'array'
|
|
1573
|
+
},
|
|
1574
|
+
marks: {
|
|
1575
|
+
items: ['breakout'],
|
|
1576
|
+
optional: true,
|
|
1577
|
+
type: 'array'
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
}];
|
|
1556
1581
|
var panel_root_only = exports.panel_root_only = ['panel', {
|
|
1557
1582
|
props: {
|
|
1558
1583
|
marks: {
|
|
@@ -15,7 +15,7 @@ import { rule } from './nodes/rule';
|
|
|
15
15
|
const doc = adfNode('doc').define({
|
|
16
16
|
root: true,
|
|
17
17
|
version: 1,
|
|
18
|
-
content: [$onePlus($or(blockGroup, blockContentGroup, codeBlock.use('root_only'), panel.use('root_only'), rule.use('root_only'), extension.use('root_only'), bodiedExtension.use('root_only'), multiBodiedExtension.use('root_only'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), blockRootOnlyGroup, expand.use('root_only'), syncBlock, bodiedSyncBlock))],
|
|
18
|
+
content: [$onePlus($or(blockGroup, blockContentGroup, codeBlock.use('root_only'), panel.use('root_only'), panel.use('c1'), panel.use('c1_root_only'), rule.use('root_only'), extension.use('root_only'), bodiedExtension.use('root_only'), multiBodiedExtension.use('root_only'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), blockRootOnlyGroup, expand.use('root_only'), syncBlock, bodiedSyncBlock))],
|
|
19
19
|
DANGEROUS_MANUAL_OVERRIDE: {
|
|
20
20
|
'validator-spec': {
|
|
21
21
|
'props.content.minItems': {
|
|
@@ -325,7 +325,7 @@ export const decisionList = createPMNodeSpecFactory({
|
|
|
325
325
|
defining: true
|
|
326
326
|
});
|
|
327
327
|
export const doc = createPMNodeSpecFactory({
|
|
328
|
-
content: '(block | codeBlock | panel | rule | extension | bodiedExtension | multiBodiedExtension | layoutSection | blockRootOnly | expand | syncBlock | bodiedSyncBlock)+',
|
|
328
|
+
content: '(block | codeBlock | panel | panel_c1 | panel_c1_root_only | rule | extension | bodiedExtension | multiBodiedExtension | layoutSection | blockRootOnly | expand | syncBlock | bodiedSyncBlock)+',
|
|
329
329
|
marks: 'unsupportedMark unsupportedNodeAttribute fontSize alignment indentation dataConsumer fragment breakout'
|
|
330
330
|
});
|
|
331
331
|
export const embedCard = createPMNodeSpecFactory({
|
|
@@ -671,7 +671,7 @@ export const inlineExtensionWithMarks = createPMNodeSpecFactory({
|
|
|
671
671
|
selectable: true
|
|
672
672
|
});
|
|
673
673
|
export const layoutColumn = createPMNodeSpecFactory({
|
|
674
|
-
content: '(block | unsupportedBlock)+',
|
|
674
|
+
content: '(block | unsupportedBlock | panel_c1)+',
|
|
675
675
|
marks: 'unsupportedMark unsupportedNodeAttribute fontSize alignment indentation dataConsumer fragment',
|
|
676
676
|
attrs: {
|
|
677
677
|
width: {
|
|
@@ -1087,7 +1087,32 @@ export const panel = createPMNodeSpecFactory({
|
|
|
1087
1087
|
},
|
|
1088
1088
|
selectable: true
|
|
1089
1089
|
});
|
|
1090
|
-
export const
|
|
1090
|
+
export const panelC1RootOnlyStage0 = createPMNodeSpecFactory({
|
|
1091
|
+
content: '(paragraph | heading | bulletList | orderedList | blockCard | mediaGroup | mediaSingle | codeBlock | taskList | rule | decisionList | unsupportedBlock | extension | table)+',
|
|
1092
|
+
marks: 'fontSize unsupportedMark unsupportedNodeAttribute dataConsumer fragment',
|
|
1093
|
+
attrs: {
|
|
1094
|
+
panelType: {
|
|
1095
|
+
default: 'info'
|
|
1096
|
+
},
|
|
1097
|
+
panelIcon: {
|
|
1098
|
+
default: null
|
|
1099
|
+
},
|
|
1100
|
+
panelIconId: {
|
|
1101
|
+
default: null
|
|
1102
|
+
},
|
|
1103
|
+
panelIconText: {
|
|
1104
|
+
default: null
|
|
1105
|
+
},
|
|
1106
|
+
panelColor: {
|
|
1107
|
+
default: null
|
|
1108
|
+
},
|
|
1109
|
+
localId: {
|
|
1110
|
+
default: null
|
|
1111
|
+
}
|
|
1112
|
+
},
|
|
1113
|
+
selectable: true
|
|
1114
|
+
});
|
|
1115
|
+
export const panelC1Stage0 = createPMNodeSpecFactory({
|
|
1091
1116
|
content: '(paragraph | heading | bulletList | orderedList | blockCard | mediaGroup | mediaSingle | codeBlock | taskList | rule | decisionList | unsupportedBlock | extension | table)+',
|
|
1092
1117
|
marks: 'fontSize unsupportedMark unsupportedNodeAttribute dataConsumer fragment',
|
|
1093
1118
|
group: 'block',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* eslint-disable @
|
|
1
|
+
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
2
2
|
export * from './generated/markTypes';
|
|
3
3
|
export * from './generated/nodeTypes';
|
|
4
4
|
export * from './generated/nodeGroupTypes';
|
|
@@ -4,6 +4,7 @@ import { blockGroup } from '../groups/blockGroup';
|
|
|
4
4
|
import { unsupportedMark } from '../marks/unsupportedMark';
|
|
5
5
|
import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute';
|
|
6
6
|
import { unsupportedBlock } from '../nodes/unsupportedBlock';
|
|
7
|
+
import { panel } from './panel';
|
|
7
8
|
const layoutColumnAttributes = {
|
|
8
9
|
width: {
|
|
9
10
|
type: 'number',
|
|
@@ -28,5 +29,6 @@ export const layoutColumn = adfNode('layoutColumn').define({
|
|
|
28
29
|
selectable: false,
|
|
29
30
|
marks: [unsupportedMark, unsupportedNodeAttribute],
|
|
30
31
|
attrs: layoutColumnAttributes,
|
|
31
|
-
|
|
32
|
+
// panel_c1 (table-in-panel) is also valid inside a layout column.
|
|
33
|
+
content: [$onePlus($or(blockGroup, blockContentGroup, unsupportedBlock, panel.use('c1')))]
|
|
32
34
|
});
|
|
@@ -53,9 +53,14 @@ export const panel = adfNode('panel').define({
|
|
|
53
53
|
},
|
|
54
54
|
content: [$onePlus($or(...panelContent, extension.use('with_marks')))]
|
|
55
55
|
}).variant('c1', {
|
|
56
|
-
// panel_c1 allows all standard panel content plus table.
|
|
56
|
+
// panel_c1 allows all standard panel content plus table. `stage0: true` includes it in the
|
|
57
|
+
// stage-0 JSON schema (not full) and the validator spec so table-in-panel validates.
|
|
58
|
+
// `noExtend` emits it as a standalone JSON Schema definition because its content is a
|
|
59
|
+
// superset of panel_node (adds table), which an allOf extension cannot express. Runtime
|
|
60
|
+
// acceptance is gated in adf-utils behind the patch flag.
|
|
61
|
+
stage0: true,
|
|
62
|
+
noExtend: true,
|
|
57
63
|
content: [$onePlus($or(...panelContent, extension.use('with_marks'), table))],
|
|
58
|
-
ignore: ['json-schema', 'validator-spec'],
|
|
59
64
|
preserveVariantNameInPm: true
|
|
60
65
|
})
|
|
61
66
|
// this variant is used to support breakout resizing for panel nodes at the document root
|
|
@@ -66,9 +71,9 @@ export const panel = adfNode('panel').define({
|
|
|
66
71
|
// this variant is used to support breakout resizing for panel_c1 nodes at the document root
|
|
67
72
|
.variant('c1_root_only', {
|
|
68
73
|
stage0: true,
|
|
74
|
+
noExtend: true,
|
|
69
75
|
marks: [breakout, unsupportedMark, unsupportedNodeAttribute],
|
|
70
|
-
// panel_c1_root_only allows all standard panel content plus table.
|
|
76
|
+
// panel_c1_root_only allows all standard panel content plus table (see c1 above).
|
|
71
77
|
content: [$onePlus($or(...panelContent, extension.use('with_marks'), table))],
|
|
72
|
-
ignore: ['json-schema', 'validator-spec'],
|
|
73
78
|
preserveVariantNameInPm: true
|
|
74
79
|
});
|