3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-21 15:42:58 +01:00

13a - rule's color, style and weight and layoutSection's columnRuleStyle join the tables

This commit is contained in:
2026-09-16 22:34:12 +02:00
parent 0f2c7b1e9d
commit d44aa3c358
7 changed files with 19 additions and 6 deletions
@@ -133,6 +133,14 @@
}, },
"type": "rule" "type": "rule"
}, },
{
"attrs": {
"color": "#ff5630",
"style": "dashed",
"weight": 2
},
"type": "rule"
},
{ {
"attrs": { "attrs": {
"localId": "01a0431d-201a-7a65-bea7-84b441c85bd6" "localId": "01a0431d-201a-7a65-bea7-84b441c85bd6"
@@ -31,5 +31,7 @@ Loosen the clamp
!adf:rule {localId=01a0431d-2019-76b7-bf6f-13841363b111} !adf:rule {localId=01a0431d-2019-76b7-bf6f-13841363b111}
!adf:rule {color="#ff5630" style=dashed weight=2}
!adf:paragraph {localId=01a0431d-201a-7a65-bea7-84b441c85bd6} !adf:paragraph {localId=01a0431d-201a-7a65-bea7-84b441c85bd6}
!adf:/paragraph !adf:/paragraph
@@ -2,6 +2,7 @@
"content": [ "content": [
{ {
"attrs": { "attrs": {
"columnRuleStyle": "solid",
"localId": "01a033cc-4b60-7b5e-85f4-34f27f039e9a" "localId": "01a033cc-4b60-7b5e-85f4-34f27f039e9a"
}, },
"content": [ "content": [
+1 -1
View File
@@ -1,4 +1,4 @@
!adf:layoutSection {localId=01a033cc-4b60-7b5e-85f4-34f27f039e9a} !adf:layoutSection {columnRuleStyle=solid localId=01a033cc-4b60-7b5e-85f4-34f27f039e9a}
!adf:layoutColumn {localId=01a03389-a5fb-747d-b418-e91f1b161e7f width=50} !adf:layoutColumn {localId=01a03389-a5fb-747d-b418-e91f1b161e7f width=50}
Left. Left.
!adf:/layoutColumn !adf:/layoutColumn
+4 -2
View File
@@ -229,7 +229,8 @@ form.
(number). `order` is the first marker, so a list carrying none, one that is no whole number (number). `order` is the first marker, so a list carrying none, one that is no whole number
from 0, or one whose markers would run past 999999999, has no CommonMark spelling. from 0, or one whose markers would run past 999999999, has no CommonMark spelling.
- `paragraph` — container, inline body. Attributes: `localId` (string). - `paragraph` — container, inline body. Attributes: `localId` (string).
- `rule` — leaf. Attributes: `localId` (string). - `rule` — leaf. Attributes: `color` (string, `#rrggbb`), `localId` (string), `style` (`dashed`
`dotted` `fade` `sketch` `solid`), `weight` (number, 1–3).
```` ````
!adf:codeBlock {localId=01a03d5c-9b21-73f4-8e6a-0c47b1d9e2f8 wrap=true} !adf:codeBlock {localId=01a03d5c-9b21-73f4-8e6a-0c47b1d9e2f8 wrap=true}
@@ -380,7 +381,8 @@ Ship it
### Layout ### Layout
- `layoutSection` — container of `layoutColumn` containers. Attributes: `localId` (string). - `layoutSection` — container of `layoutColumn` containers. Attributes: `columnRuleStyle` (`solid`),
`localId` (string).
- `layoutColumn` — container, block body. Attributes: `localId` (string), `valign` (`bottom` - `layoutColumn` — container, block body. Attributes: `localId` (string), `valign` (`bottom`
`middle` `top`), `width` (number — percent). `middle` `top`), `width` (number — percent).
+1 -1
View File
@@ -18,7 +18,7 @@ type Spelled = [string, Map<string, AttributeKind>]
const carried = ['alignment', 'annotation', 'backgroundColor', 'blockCard', 'bodiedRule', 'breakout', 'dataConsumer', 'embedCard', 'fontSize', 'fragment', 'indentation', 'inlineExtension', 'placeholder'] const carried = ['alignment', 'annotation', 'backgroundColor', 'blockCard', 'bodiedRule', 'breakout', 'dataConsumer', 'embedCard', 'fontSize', 'fragment', 'indentation', 'inlineExtension', 'placeholder']
const definitionReference = '#/definitions/' const definitionReference = '#/definitions/'
const gaps = ['layoutSection.columnRuleStyle', 'link.collection', 'link.id', 'link.occurrenceKey', 'rule.color', 'rule.style', 'rule.weight'] const gaps = ['link.collection', 'link.id', 'link.occurrenceKey']
const grammarOwn = ['doc', 'text'] const grammarOwn = ['doc', 'text']
const readKeywords = ['$ref', 'additionalProperties', 'allOf', 'anyOf', 'enum', 'items', 'maxItems', 'maximum', 'minItems', 'minLength', 'minimum', 'pattern', 'properties', 'required', 'type'] const readKeywords = ['$ref', 'additionalProperties', 'allOf', 'anyOf', 'enum', 'items', 'maxItems', 'maximum', 'minItems', 'minLength', 'minimum', 'pattern', 'properties', 'required', 'type']
const root = join(dirname(fileURLToPath(import.meta.url)), '..', 'spec', 'adf-schema') const root = join(dirname(fileURLToPath(import.meta.url)), '..', 'spec', 'adf-schema')
+2 -2
View File
@@ -59,7 +59,7 @@ export const blockDirectives = {
extensionFrame: { attributes: {}, contentModel: 'block' }, extensionFrame: { attributes: {}, contentModel: 'block' },
heading: { attributes: { level: 'number', localId: 'string' }, contentModel: 'inline' }, heading: { attributes: { level: 'number', localId: 'string' }, contentModel: 'inline' },
layoutColumn: { attributes: { localId: 'string', valign: 'string', width: 'number' }, contentModel: 'block' }, layoutColumn: { attributes: { localId: 'string', valign: 'string', width: 'number' }, contentModel: 'block' },
layoutSection: { attributes: localIdAttributes, contentModel: 'block' }, layoutSection: { attributes: { columnRuleStyle: 'string', localId: 'string' }, contentModel: 'block' },
listItem: { attributes: localIdAttributes, contentModel: 'block' }, listItem: { attributes: localIdAttributes, contentModel: 'block' },
media: { attributes: mediaAttributes, contentModel: 'none' }, media: { attributes: mediaAttributes, contentModel: 'none' },
mediaGroup: { attributes: {}, contentModel: 'block' }, mediaGroup: { attributes: {}, contentModel: 'block' },
@@ -72,7 +72,7 @@ export const blockDirectives = {
contentModel: 'block', contentModel: 'block',
}, },
paragraph: { attributes: localIdAttributes, contentModel: 'inline' }, paragraph: { attributes: localIdAttributes, contentModel: 'inline' },
rule: { attributes: localIdAttributes, contentModel: 'none' }, rule: { attributes: { color: 'string', localId: 'string', style: 'string', weight: 'number' }, contentModel: 'none' },
syncBlock: { attributes: syncBlockAttributes, contentModel: 'none' }, syncBlock: { attributes: syncBlockAttributes, contentModel: 'none' },
table: { attributes: { displayMode: 'string', isNumberColumnEnabled: 'boolean', layout: 'string', localId: 'string', width: 'number' }, contentModel: 'block' }, table: { attributes: { displayMode: 'string', isNumberColumnEnabled: 'boolean', layout: 'string', localId: 'string', width: 'number' }, contentModel: 'block' },
tableCell: { attributes: cellAttributes, contentModel: 'block' }, tableCell: { attributes: cellAttributes, contentModel: 'block' },