@canonical/anatomy-dsl 0.5.1 → 0.43.0-experimental.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/LICENSE +166 -0
- package/README.md +10 -6
- package/definitions/ontology.ttl +8 -4
- package/definitions/registry.ttl +21 -19
- package/definitions/shapes.ttl +9 -2
- package/definitions/style-keys.yaml +39 -24
- package/dist/esm/registry.generated.js +18 -18
- package/dist/types/registry.generated.d.ts +4 -1
- package/dist/types/types.d.ts +6 -3
- package/package.json +15 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
|
6
|
+
of this license document, but changing it is not allowed.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
|
11
|
+
License, supplemented by the additional permissions listed below.
|
|
12
|
+
|
|
13
|
+
0. Additional Definitions.
|
|
14
|
+
|
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
17
|
+
General Public License.
|
|
18
|
+
|
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
|
20
|
+
other than an Application or a Combined Work as defined below.
|
|
21
|
+
|
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
|
25
|
+
of using an interface provided by the Library.
|
|
26
|
+
|
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
|
28
|
+
Application with the Library. The particular version of the Library
|
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
|
30
|
+
Version".
|
|
31
|
+
|
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
|
35
|
+
based on the Application, and not on the Linked Version.
|
|
36
|
+
|
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
|
38
|
+
object code and/or source code for the Application, including any data
|
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
|
41
|
+
|
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
|
43
|
+
|
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
|
46
|
+
|
|
47
|
+
2. Conveying Modified Versions.
|
|
48
|
+
|
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
|
51
|
+
that uses the facility (other than as an argument passed when the
|
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
|
53
|
+
version:
|
|
54
|
+
|
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
|
56
|
+
ensure that, in the event an Application does not supply the
|
|
57
|
+
function or data, the facility still operates, and performs
|
|
58
|
+
whatever part of its purpose remains meaningful, or
|
|
59
|
+
|
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
|
61
|
+
this License applicable to that copy.
|
|
62
|
+
|
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
|
64
|
+
|
|
65
|
+
The object code form of an Application may incorporate material from
|
|
66
|
+
a header file that is part of the Library. You may convey such object
|
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
|
68
|
+
material is not limited to numerical parameters, data structure
|
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
|
71
|
+
|
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
|
73
|
+
Library is used in it and that the Library and its use are
|
|
74
|
+
covered by this License.
|
|
75
|
+
|
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
77
|
+
document.
|
|
78
|
+
|
|
79
|
+
4. Combined Works.
|
|
80
|
+
|
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
|
82
|
+
taken together, effectively do not restrict modification of the
|
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
|
85
|
+
the following:
|
|
86
|
+
|
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
|
88
|
+
the Library is used in it and that the Library and its use are
|
|
89
|
+
covered by this License.
|
|
90
|
+
|
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
92
|
+
document.
|
|
93
|
+
|
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
|
95
|
+
execution, include the copyright notice for the Library among
|
|
96
|
+
these notices, as well as a reference directing the user to the
|
|
97
|
+
copies of the GNU GPL and this license document.
|
|
98
|
+
|
|
99
|
+
d) Do one of the following:
|
|
100
|
+
|
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
|
102
|
+
License, and the Corresponding Application Code in a form
|
|
103
|
+
suitable for, and under terms that permit, the user to
|
|
104
|
+
recombine or relink the Application with a modified version of
|
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
|
107
|
+
Corresponding Source.
|
|
108
|
+
|
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
|
111
|
+
a copy of the Library already present on the user's computer
|
|
112
|
+
system, and (b) will operate properly with a modified version
|
|
113
|
+
of the Library that is interface-compatible with the Linked
|
|
114
|
+
Version.
|
|
115
|
+
|
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
|
117
|
+
be required to provide such information under section 6 of the
|
|
118
|
+
GNU GPL, and only to the extent that such information is
|
|
119
|
+
necessary to install and execute a modified version of the
|
|
120
|
+
Combined Work produced by recombining or relinking the
|
|
121
|
+
Application with a modified version of the Linked Version. (If
|
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
|
126
|
+
for conveying Corresponding Source.)
|
|
127
|
+
|
|
128
|
+
5. Combined Libraries.
|
|
129
|
+
|
|
130
|
+
You may place library facilities that are a work based on the
|
|
131
|
+
Library side by side in a single library together with other library
|
|
132
|
+
facilities that are not Applications and are not covered by this
|
|
133
|
+
License, and convey such a combined library under terms of your
|
|
134
|
+
choice, if you do both of the following:
|
|
135
|
+
|
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
|
137
|
+
on the Library, uncombined with any other library facilities,
|
|
138
|
+
conveyed under the terms of this License.
|
|
139
|
+
|
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
|
141
|
+
is a work based on the Library, and explaining where to find the
|
|
142
|
+
accompanying uncombined form of the same work.
|
|
143
|
+
|
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
|
145
|
+
|
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
|
148
|
+
versions will be similar in spirit to the present version, but may
|
|
149
|
+
differ in detail to address new problems or concerns.
|
|
150
|
+
|
|
151
|
+
Each version is given a distinguishing version number. If the
|
|
152
|
+
Library as you received it specifies that a certain numbered version
|
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
|
154
|
+
applies to it, you have the option of following the terms and
|
|
155
|
+
conditions either of that published version or of any later version
|
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
|
160
|
+
|
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
|
164
|
+
permanent authorization for you to choose that version for the
|
|
165
|
+
Library.
|
|
166
|
+
|
package/README.md
CHANGED
|
@@ -196,12 +196,16 @@ styles:
|
|
|
196
196
|
```
|
|
197
197
|
|
|
198
198
|
The state vocabulary is **closed and registry-governed**: `hover`, `active`,
|
|
199
|
-
`focus`, `disabled`, `selected
|
|
200
|
-
systems diverge — `active`
|
|
201
|
-
*down* (and matches Canonical's
|
|
202
|
-
`:focus-visible` (Spectrum's
|
|
203
|
-
|
|
204
|
-
`
|
|
199
|
+
`focus`, `disabled`, `selected`, `expanded`, `indeterminate`, `invalid`.
|
|
200
|
+
Naming follows the industry consensus where systems diverge — `active`
|
|
201
|
+
subsumes Material's *pressed* and Spectrum's *down* (and matches Canonical's
|
|
202
|
+
own token tree); `focus` maps to CSS `:focus-visible` (Spectrum's
|
|
203
|
+
*key-focus*); `expanded` is a disclosure's open state (`[open]`,
|
|
204
|
+
`aria-expanded`); `indeterminate` is a mixed checkbox or progress bar, on
|
|
205
|
+
neither setting; `invalid` is a failed validation (`:invalid`,
|
|
206
|
+
`aria-invalid`). `@default` is not admitted — absence is the default.
|
|
207
|
+
Candidate additions (`checked`, `visited`, `dragged`, `pending`, `error`,
|
|
208
|
+
`read-only`) go through the registry, never by loosening the schema.
|
|
205
209
|
|
|
206
210
|
The boundaries that keep "state machines out of scope" true:
|
|
207
211
|
|
package/definitions/ontology.ttl
CHANGED
|
@@ -340,13 +340,17 @@ anatomy:styleState a owl:DatatypeProperty ;
|
|
|
340
340
|
rdfs:range xsd:string ;
|
|
341
341
|
skos:definition """Interaction state this style value applies in. Absent
|
|
342
342
|
means the default state. Closed vocabulary (hover, active, focus,
|
|
343
|
-
disabled, selected), governed by
|
|
344
|
-
'pressed' and Spectrum's 'down';
|
|
345
|
-
(Spectrum's 'key-focus')
|
|
343
|
+
disabled, selected, expanded, indeterminate, invalid), governed by
|
|
344
|
+
registry — 'active' subsumes Material's 'pressed' and Spectrum's 'down';
|
|
345
|
+
'focus' maps to CSS :focus-visible (Spectrum's 'key-focus'); 'expanded'
|
|
346
|
+
is a disclosure's open state ([open], aria-expanded); 'indeterminate' is
|
|
347
|
+
a mixed checkbox or progress bar; 'invalid' is a failed validation
|
|
348
|
+
(:invalid, aria-invalid). States re-value style channels only: they never
|
|
346
349
|
add structure (that is the Switch construct) and never define transitions
|
|
347
350
|
or interaction logic (state machines stay out of scope). Authored as an
|
|
348
351
|
@state suffix on the style key.""" ;
|
|
349
|
-
skos:example "hover" , "active" , "focus" , "disabled" , "selected"
|
|
352
|
+
skos:example "hover" , "active" , "focus" , "disabled" , "selected" ,
|
|
353
|
+
"expanded" , "indeterminate" , "invalid" .
|
|
350
354
|
|
|
351
355
|
anatomy:projectionType a owl:DatatypeProperty ;
|
|
352
356
|
rdfs:label "projection type" ;
|
package/definitions/registry.ttl
CHANGED
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
# shapes state that disjunction.
|
|
15
15
|
# anatomy:tokenNamespace the dotted prefixes whose symbols the key admits,
|
|
16
16
|
# multi-valued: N., modifier.N. and surface.N., so a
|
|
17
|
-
# channel binding is not a namespace violation.
|
|
17
|
+
# channel binding is not a namespace violation. A key
|
|
18
|
+
# may admit more than one base namespace, and then it
|
|
19
|
+
# carries the three spellings of each.
|
|
18
20
|
#
|
|
19
21
|
# PROVENANCE. The roster is not designed: these 111 keys were measured from
|
|
20
22
|
# the 89 published component stylesheets of
|
|
@@ -460,109 +462,109 @@ anatomy:key.spacing.external.block.end
|
|
|
460
462
|
a anatomy:StyleKey ;
|
|
461
463
|
rdfs:label "spacing.external.block.end" ;
|
|
462
464
|
anatomy:valueKind "either" ;
|
|
463
|
-
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." .
|
|
465
|
+
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." , "dimension." , "modifier.dimension." , "surface.dimension." .
|
|
464
466
|
|
|
465
467
|
anatomy:key.spacing.external.block.start
|
|
466
468
|
a anatomy:StyleKey ;
|
|
467
469
|
rdfs:label "spacing.external.block.start" ;
|
|
468
470
|
anatomy:valueKind "either" ;
|
|
469
|
-
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." .
|
|
471
|
+
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." , "dimension." , "modifier.dimension." , "surface.dimension." .
|
|
470
472
|
|
|
471
473
|
anatomy:key.spacing.external.bottom
|
|
472
474
|
a anatomy:StyleKey ;
|
|
473
475
|
rdfs:label "spacing.external.bottom" ;
|
|
474
476
|
anatomy:valueKind "either" ;
|
|
475
|
-
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." .
|
|
477
|
+
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." , "dimension." , "modifier.dimension." , "surface.dimension." .
|
|
476
478
|
|
|
477
479
|
anatomy:key.spacing.external.inline.end
|
|
478
480
|
a anatomy:StyleKey ;
|
|
479
481
|
rdfs:label "spacing.external.inline.end" ;
|
|
480
482
|
anatomy:valueKind "either" ;
|
|
481
|
-
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." .
|
|
483
|
+
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." , "dimension." , "modifier.dimension." , "surface.dimension." .
|
|
482
484
|
|
|
483
485
|
anatomy:key.spacing.external.inline.start
|
|
484
486
|
a anatomy:StyleKey ;
|
|
485
487
|
rdfs:label "spacing.external.inline.start" ;
|
|
486
488
|
anatomy:valueKind "either" ;
|
|
487
|
-
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." .
|
|
489
|
+
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." , "dimension." , "modifier.dimension." , "surface.dimension." .
|
|
488
490
|
|
|
489
491
|
anatomy:key.spacing.external.left
|
|
490
492
|
a anatomy:StyleKey ;
|
|
491
493
|
rdfs:label "spacing.external.left" ;
|
|
492
494
|
anatomy:valueKind "either" ;
|
|
493
|
-
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." .
|
|
495
|
+
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." , "dimension." , "modifier.dimension." , "surface.dimension." .
|
|
494
496
|
|
|
495
497
|
anatomy:key.spacing.external.right
|
|
496
498
|
a anatomy:StyleKey ;
|
|
497
499
|
rdfs:label "spacing.external.right" ;
|
|
498
500
|
anatomy:valueKind "either" ;
|
|
499
|
-
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." .
|
|
501
|
+
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." , "dimension." , "modifier.dimension." , "surface.dimension." .
|
|
500
502
|
|
|
501
503
|
anatomy:key.spacing.external.top
|
|
502
504
|
a anatomy:StyleKey ;
|
|
503
505
|
rdfs:label "spacing.external.top" ;
|
|
504
506
|
anatomy:valueKind "either" ;
|
|
505
|
-
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." .
|
|
507
|
+
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." , "dimension." , "modifier.dimension." , "surface.dimension." .
|
|
506
508
|
|
|
507
509
|
anatomy:key.spacing.gap
|
|
508
510
|
a anatomy:StyleKey ;
|
|
509
511
|
rdfs:label "spacing.gap" ;
|
|
510
512
|
anatomy:valueKind "either" ;
|
|
511
|
-
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." .
|
|
513
|
+
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." , "dimension." , "modifier.dimension." , "surface.dimension." .
|
|
512
514
|
|
|
513
515
|
anatomy:key.spacing.gap.block
|
|
514
516
|
a anatomy:StyleKey ;
|
|
515
517
|
rdfs:label "spacing.gap.block" ;
|
|
516
518
|
anatomy:valueKind "token" ;
|
|
517
|
-
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." .
|
|
519
|
+
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." , "dimension." , "modifier.dimension." , "surface.dimension." .
|
|
518
520
|
|
|
519
521
|
anatomy:key.spacing.gap.inline
|
|
520
522
|
a anatomy:StyleKey ;
|
|
521
523
|
rdfs:label "spacing.gap.inline" ;
|
|
522
524
|
anatomy:valueKind "token" ;
|
|
523
|
-
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." .
|
|
525
|
+
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." , "dimension." , "modifier.dimension." , "surface.dimension." .
|
|
524
526
|
|
|
525
527
|
anatomy:key.spacing.internal.block.end
|
|
526
528
|
a anatomy:StyleKey ;
|
|
527
529
|
rdfs:label "spacing.internal.block.end" ;
|
|
528
530
|
anatomy:valueKind "either" ;
|
|
529
|
-
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." .
|
|
531
|
+
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." , "dimension." , "modifier.dimension." , "surface.dimension." .
|
|
530
532
|
|
|
531
533
|
anatomy:key.spacing.internal.block.start
|
|
532
534
|
a anatomy:StyleKey ;
|
|
533
535
|
rdfs:label "spacing.internal.block.start" ;
|
|
534
536
|
anatomy:valueKind "either" ;
|
|
535
|
-
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." .
|
|
537
|
+
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." , "dimension." , "modifier.dimension." , "surface.dimension." .
|
|
536
538
|
|
|
537
539
|
anatomy:key.spacing.internal.bottom
|
|
538
540
|
a anatomy:StyleKey ;
|
|
539
541
|
rdfs:label "spacing.internal.bottom" ;
|
|
540
542
|
anatomy:valueKind "either" ;
|
|
541
|
-
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." .
|
|
543
|
+
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." , "dimension." , "modifier.dimension." , "surface.dimension." .
|
|
542
544
|
|
|
543
545
|
anatomy:key.spacing.internal.inline.end
|
|
544
546
|
a anatomy:StyleKey ;
|
|
545
547
|
rdfs:label "spacing.internal.inline.end" ;
|
|
546
548
|
anatomy:valueKind "either" ;
|
|
547
|
-
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." .
|
|
549
|
+
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." , "dimension." , "modifier.dimension." , "surface.dimension." .
|
|
548
550
|
|
|
549
551
|
anatomy:key.spacing.internal.inline.start
|
|
550
552
|
a anatomy:StyleKey ;
|
|
551
553
|
rdfs:label "spacing.internal.inline.start" ;
|
|
552
554
|
anatomy:valueKind "either" ;
|
|
553
|
-
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." .
|
|
555
|
+
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." , "dimension." , "modifier.dimension." , "surface.dimension." .
|
|
554
556
|
|
|
555
557
|
anatomy:key.spacing.internal.left
|
|
556
558
|
a anatomy:StyleKey ;
|
|
557
559
|
rdfs:label "spacing.internal.left" ;
|
|
558
560
|
anatomy:valueKind "either" ;
|
|
559
|
-
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." .
|
|
561
|
+
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." , "dimension." , "modifier.dimension." , "surface.dimension." .
|
|
560
562
|
|
|
561
563
|
anatomy:key.spacing.internal.top
|
|
562
564
|
a anatomy:StyleKey ;
|
|
563
565
|
rdfs:label "spacing.internal.top" ;
|
|
564
566
|
anatomy:valueKind "either" ;
|
|
565
|
-
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." .
|
|
567
|
+
anatomy:tokenNamespace "spacing." , "modifier.spacing." , "surface.spacing." , "dimension." , "modifier.dimension." , "surface.dimension." .
|
|
566
568
|
|
|
567
569
|
anatomy:key.typography.align
|
|
568
570
|
a anatomy:StyleKey ;
|
package/definitions/shapes.ttl
CHANGED
|
@@ -511,6 +511,13 @@ anatomy:StyleShape a sh:NodeShape ;
|
|
|
511
511
|
# candidates), never through loosening this list ad hoc. There is no
|
|
512
512
|
# "default" state: an absent styleState IS the default.
|
|
513
513
|
#
|
|
514
|
+
# expanded, indeterminate and invalid entered that way, and the line they
|
|
515
|
+
# sit on is worth stating: a state is admitted where the implementation
|
|
516
|
+
# RE-VALUES a channel in it, and refused where it changes what exists. A
|
|
517
|
+
# disclosure header with a different background while open is the first;
|
|
518
|
+
# the panel that exists only while open is the second, and stays the
|
|
519
|
+
# Switch construct's.
|
|
520
|
+
#
|
|
514
521
|
# A state value that differs from its base state's is a LINT, not a
|
|
515
522
|
# constraint (AT.11): the reference does it — Button's :disabled reads a
|
|
516
523
|
# different symbol — so it is reported with its ranks and never rejected,
|
|
@@ -519,8 +526,8 @@ anatomy:StyleShape a sh:NodeShape ;
|
|
|
519
526
|
sh:path anatomy:styleState ;
|
|
520
527
|
sh:maxCount 1 ;
|
|
521
528
|
sh:datatype xsd:string ;
|
|
522
|
-
sh:in ( "hover" "active" "focus" "disabled" "selected" ) ;
|
|
523
|
-
sh:message "styleState must be one of: hover, active, focus, disabled, selected (absent = default state)." ;
|
|
529
|
+
sh:in ( "hover" "active" "focus" "disabled" "selected" "expanded" "indeterminate" "invalid" ) ;
|
|
530
|
+
sh:message "styleState must be one of: hover, active, focus, disabled, selected, expanded, indeterminate, invalid (absent = default state)." ;
|
|
524
531
|
] ;
|
|
525
532
|
|
|
526
533
|
# BEGIN GENERATED valueKind sh:or — bun run generate:shapes
|
|
@@ -49,19 +49,30 @@
|
|
|
49
49
|
# needs: `N.`, `modifier.N.` and `surface.N.`, because a
|
|
50
50
|
# channel of a symbol in `N.` is what the anatomy consumes
|
|
51
51
|
# where the implementation reads the channel.
|
|
52
|
+
# A key that admits symbols from more than one namespace
|
|
53
|
+
# states them as a LIST — `[spacing., dimension.]` — and each
|
|
54
|
+
# one is projected into its own three spellings, grouped by
|
|
55
|
+
# namespace and in the order written here. One namespace and
|
|
56
|
+
# a one-element list mean the same thing; the scalar form is
|
|
57
|
+
# the ordinary one, and the list says a key really does draw
|
|
58
|
+
# on two populations.
|
|
52
59
|
# why: required on a `primitive` key whose reference values read a
|
|
53
60
|
# `var()` anyway — a component-local count, an asset — and
|
|
54
61
|
# emitted as the key's `rdfs:comment`, so the exception is
|
|
55
62
|
# stated and not silent. Forbidden on a key that takes a token.
|
|
56
63
|
#
|
|
57
|
-
# `spacing.*` keys admit `spacing.`
|
|
58
|
-
# reference binds `dimension.*` there throughout, and
|
|
59
|
-
# the
|
|
64
|
+
# `spacing.*` keys admit `spacing.` and, for now, `dimension.` too: the
|
|
65
|
+
# reference binds `dimension.*` there throughout, and until semantic spacing
|
|
66
|
+
# lands the roster admits both rather than leaving every real binding out
|
|
67
|
+
# with a comment in its place. The second namespace is temporary and is
|
|
68
|
+
# marked as such below.
|
|
60
69
|
#
|
|
61
70
|
# `motion.` is declared as a namespace though no stratum publishes one yet,
|
|
62
|
-
# so a `motion.duration.fast` binding is admitted
|
|
63
|
-
#
|
|
64
|
-
#
|
|
71
|
+
# so a `motion.duration.fast` binding is admitted where a symbol declares it
|
|
72
|
+
# — and where none does, the binding is not written: the `#` comment on the
|
|
73
|
+
# line is the record (`# reads --motion-duration-fast; no symbol declares
|
|
74
|
+
# it`). `shadow.` is NOT declared, for the same reason in reverse — nothing
|
|
75
|
+
# names it — so no shadow key is in the roster.
|
|
65
76
|
# ═══════════════════════════════════════════════════════════════════════════
|
|
66
77
|
|
|
67
78
|
version: 1
|
|
@@ -291,60 +302,64 @@ keys:
|
|
|
291
302
|
valueKind: either
|
|
292
303
|
namespace: dimension.
|
|
293
304
|
|
|
305
|
+
# dimension. is admitted temporarily — the implementations read
|
|
306
|
+
# `--dimension-*` directly for padding and gaps, and the semantic spacing
|
|
307
|
+
# namespace is still thin (twelve symbols). Remove `dimension.` here once
|
|
308
|
+
# semantic spacing lands (ADR J ledger, row G1).
|
|
294
309
|
spacing.external.block.end:
|
|
295
310
|
valueKind: either
|
|
296
|
-
namespace: spacing.
|
|
311
|
+
namespace: [spacing., dimension.]
|
|
297
312
|
spacing.external.block.start:
|
|
298
313
|
valueKind: either
|
|
299
|
-
namespace: spacing.
|
|
314
|
+
namespace: [spacing., dimension.]
|
|
300
315
|
spacing.external.bottom:
|
|
301
316
|
valueKind: either
|
|
302
|
-
namespace: spacing.
|
|
317
|
+
namespace: [spacing., dimension.]
|
|
303
318
|
spacing.external.inline.end:
|
|
304
319
|
valueKind: either
|
|
305
|
-
namespace: spacing.
|
|
320
|
+
namespace: [spacing., dimension.]
|
|
306
321
|
spacing.external.inline.start:
|
|
307
322
|
valueKind: either
|
|
308
|
-
namespace: spacing.
|
|
323
|
+
namespace: [spacing., dimension.]
|
|
309
324
|
spacing.external.left:
|
|
310
325
|
valueKind: either
|
|
311
|
-
namespace: spacing.
|
|
326
|
+
namespace: [spacing., dimension.]
|
|
312
327
|
spacing.external.right:
|
|
313
328
|
valueKind: either
|
|
314
|
-
namespace: spacing.
|
|
329
|
+
namespace: [spacing., dimension.]
|
|
315
330
|
spacing.external.top:
|
|
316
331
|
valueKind: either
|
|
317
|
-
namespace: spacing.
|
|
332
|
+
namespace: [spacing., dimension.]
|
|
318
333
|
spacing.gap:
|
|
319
334
|
valueKind: either
|
|
320
|
-
namespace: spacing.
|
|
335
|
+
namespace: [spacing., dimension.]
|
|
321
336
|
spacing.gap.block:
|
|
322
337
|
valueKind: token
|
|
323
|
-
namespace: spacing.
|
|
338
|
+
namespace: [spacing., dimension.]
|
|
324
339
|
spacing.gap.inline:
|
|
325
340
|
valueKind: token
|
|
326
|
-
namespace: spacing.
|
|
341
|
+
namespace: [spacing., dimension.]
|
|
327
342
|
spacing.internal.block.end:
|
|
328
343
|
valueKind: either
|
|
329
|
-
namespace: spacing.
|
|
344
|
+
namespace: [spacing., dimension.]
|
|
330
345
|
spacing.internal.block.start:
|
|
331
346
|
valueKind: either
|
|
332
|
-
namespace: spacing.
|
|
347
|
+
namespace: [spacing., dimension.]
|
|
333
348
|
spacing.internal.bottom:
|
|
334
349
|
valueKind: either
|
|
335
|
-
namespace: spacing.
|
|
350
|
+
namespace: [spacing., dimension.]
|
|
336
351
|
spacing.internal.inline.end:
|
|
337
352
|
valueKind: either
|
|
338
|
-
namespace: spacing.
|
|
353
|
+
namespace: [spacing., dimension.]
|
|
339
354
|
spacing.internal.inline.start:
|
|
340
355
|
valueKind: either
|
|
341
|
-
namespace: spacing.
|
|
356
|
+
namespace: [spacing., dimension.]
|
|
342
357
|
spacing.internal.left:
|
|
343
358
|
valueKind: either
|
|
344
|
-
namespace: spacing.
|
|
359
|
+
namespace: [spacing., dimension.]
|
|
345
360
|
spacing.internal.top:
|
|
346
361
|
valueKind: either
|
|
347
|
-
namespace: spacing.
|
|
362
|
+
namespace: [spacing., dimension.]
|
|
348
363
|
|
|
349
364
|
typography.align:
|
|
350
365
|
valueKind: primitive
|
|
@@ -319,75 +319,75 @@ export const STYLE_KEYS = {
|
|
|
319
319
|
},
|
|
320
320
|
"spacing.external.block.end": {
|
|
321
321
|
valueKind: "either",
|
|
322
|
-
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing."],
|
|
322
|
+
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing.", "dimension.", "modifier.dimension.", "surface.dimension."],
|
|
323
323
|
},
|
|
324
324
|
"spacing.external.block.start": {
|
|
325
325
|
valueKind: "either",
|
|
326
|
-
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing."],
|
|
326
|
+
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing.", "dimension.", "modifier.dimension.", "surface.dimension."],
|
|
327
327
|
},
|
|
328
328
|
"spacing.external.bottom": {
|
|
329
329
|
valueKind: "either",
|
|
330
|
-
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing."],
|
|
330
|
+
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing.", "dimension.", "modifier.dimension.", "surface.dimension."],
|
|
331
331
|
},
|
|
332
332
|
"spacing.external.inline.end": {
|
|
333
333
|
valueKind: "either",
|
|
334
|
-
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing."],
|
|
334
|
+
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing.", "dimension.", "modifier.dimension.", "surface.dimension."],
|
|
335
335
|
},
|
|
336
336
|
"spacing.external.inline.start": {
|
|
337
337
|
valueKind: "either",
|
|
338
|
-
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing."],
|
|
338
|
+
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing.", "dimension.", "modifier.dimension.", "surface.dimension."],
|
|
339
339
|
},
|
|
340
340
|
"spacing.external.left": {
|
|
341
341
|
valueKind: "either",
|
|
342
|
-
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing."],
|
|
342
|
+
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing.", "dimension.", "modifier.dimension.", "surface.dimension."],
|
|
343
343
|
},
|
|
344
344
|
"spacing.external.right": {
|
|
345
345
|
valueKind: "either",
|
|
346
|
-
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing."],
|
|
346
|
+
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing.", "dimension.", "modifier.dimension.", "surface.dimension."],
|
|
347
347
|
},
|
|
348
348
|
"spacing.external.top": {
|
|
349
349
|
valueKind: "either",
|
|
350
|
-
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing."],
|
|
350
|
+
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing.", "dimension.", "modifier.dimension.", "surface.dimension."],
|
|
351
351
|
},
|
|
352
352
|
"spacing.gap": {
|
|
353
353
|
valueKind: "either",
|
|
354
|
-
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing."],
|
|
354
|
+
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing.", "dimension.", "modifier.dimension.", "surface.dimension."],
|
|
355
355
|
},
|
|
356
356
|
"spacing.gap.block": {
|
|
357
357
|
valueKind: "token",
|
|
358
|
-
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing."],
|
|
358
|
+
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing.", "dimension.", "modifier.dimension.", "surface.dimension."],
|
|
359
359
|
},
|
|
360
360
|
"spacing.gap.inline": {
|
|
361
361
|
valueKind: "token",
|
|
362
|
-
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing."],
|
|
362
|
+
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing.", "dimension.", "modifier.dimension.", "surface.dimension."],
|
|
363
363
|
},
|
|
364
364
|
"spacing.internal.block.end": {
|
|
365
365
|
valueKind: "either",
|
|
366
|
-
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing."],
|
|
366
|
+
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing.", "dimension.", "modifier.dimension.", "surface.dimension."],
|
|
367
367
|
},
|
|
368
368
|
"spacing.internal.block.start": {
|
|
369
369
|
valueKind: "either",
|
|
370
|
-
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing."],
|
|
370
|
+
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing.", "dimension.", "modifier.dimension.", "surface.dimension."],
|
|
371
371
|
},
|
|
372
372
|
"spacing.internal.bottom": {
|
|
373
373
|
valueKind: "either",
|
|
374
|
-
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing."],
|
|
374
|
+
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing.", "dimension.", "modifier.dimension.", "surface.dimension."],
|
|
375
375
|
},
|
|
376
376
|
"spacing.internal.inline.end": {
|
|
377
377
|
valueKind: "either",
|
|
378
|
-
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing."],
|
|
378
|
+
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing.", "dimension.", "modifier.dimension.", "surface.dimension."],
|
|
379
379
|
},
|
|
380
380
|
"spacing.internal.inline.start": {
|
|
381
381
|
valueKind: "either",
|
|
382
|
-
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing."],
|
|
382
|
+
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing.", "dimension.", "modifier.dimension.", "surface.dimension."],
|
|
383
383
|
},
|
|
384
384
|
"spacing.internal.left": {
|
|
385
385
|
valueKind: "either",
|
|
386
|
-
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing."],
|
|
386
|
+
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing.", "dimension.", "modifier.dimension.", "surface.dimension."],
|
|
387
387
|
},
|
|
388
388
|
"spacing.internal.top": {
|
|
389
389
|
valueKind: "either",
|
|
390
|
-
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing."],
|
|
390
|
+
tokenNamespace: ["spacing.", "modifier.spacing.", "surface.spacing.", "dimension.", "modifier.dimension.", "surface.dimension."],
|
|
391
391
|
},
|
|
392
392
|
"typography.align": {
|
|
393
393
|
valueKind: "primitive",
|
|
@@ -8,7 +8,10 @@ export type ValueKind = "token" | "primitive" | "either";
|
|
|
8
8
|
export interface StyleKeyEntry {
|
|
9
9
|
/** What the key admits: a symbol, a primitive, or either. */
|
|
10
10
|
readonly valueKind: ValueKind;
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Dotted prefixes whose symbols the key admits, channels included. A key
|
|
13
|
+
* that admits several base namespaces carries the three spellings of each.
|
|
14
|
+
*/
|
|
12
15
|
readonly tokenNamespace: readonly string[];
|
|
13
16
|
}
|
|
14
17
|
/** Segments that mark a value as a placeholder rather than a symbol (§4.1). */
|
package/dist/types/types.d.ts
CHANGED
|
@@ -60,9 +60,12 @@ export interface Style {
|
|
|
60
60
|
*/
|
|
61
61
|
symbols: string[];
|
|
62
62
|
/**
|
|
63
|
-
* Interaction state this value applies in
|
|
64
|
-
* `
|
|
65
|
-
*
|
|
63
|
+
* Interaction state this value applies in — one of the closed set
|
|
64
|
+
* `hover`, `active`, `focus`, `disabled`, `selected`, `expanded`,
|
|
65
|
+
* `indeterminate`, `invalid`. Absent = the default state. Authored as an
|
|
66
|
+
* `@state` suffix on the style key (`appearance.background@hover`). The
|
|
67
|
+
* set is closed by the shapes rather than by the parser: the parser splits
|
|
68
|
+
* the marker off and carries it verbatim.
|
|
66
69
|
*/
|
|
67
70
|
state?: string;
|
|
68
71
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canonical/anatomy-dsl",
|
|
3
3
|
"description": "Anatomy DSL meta-model: TypeScript types mirroring the OWL ontology, and a YAML-to-Turtle transform",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.43.0-experimental.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/types/index.d.ts",
|
|
@@ -35,15 +35,24 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@biomejs/biome": "^2.4.6",
|
|
38
|
-
"@canonical/biome-config": "^0.
|
|
39
|
-
"@canonical/token-ontology": "^0.
|
|
40
|
-
"@canonical/typescript-config": "^0.
|
|
38
|
+
"@canonical/biome-config": "^0.43.0-experimental.0",
|
|
39
|
+
"@canonical/token-ontology": "^0.43.0-experimental.1",
|
|
40
|
+
"@canonical/typescript-config": "^0.43.0-experimental.0",
|
|
41
41
|
"@types/n3": "^1.26.3",
|
|
42
42
|
"@types/node": "^26.4.0",
|
|
43
43
|
"expect-type": "^1.3.0",
|
|
44
44
|
"n3": "^1.26.0",
|
|
45
45
|
"rdf-validate-shacl": "^0.6.5",
|
|
46
|
-
"typescript": "^
|
|
46
|
+
"typescript": "^7.0.2",
|
|
47
47
|
"vitest": "^4.0.18"
|
|
48
|
-
}
|
|
48
|
+
},
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "https://github.com/canonical/pragma-core"
|
|
52
|
+
},
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "https://github.com/canonical/pragma-core/issues"
|
|
55
|
+
},
|
|
56
|
+
"homepage": "https://github.com/canonical/pragma-core#readme",
|
|
57
|
+
"gitHead": "5c1b1bdbb95844fac6211f1fe6ba10c29238d6ee"
|
|
49
58
|
}
|