@thi.ng/meta-css 0.3.0 → 0.5.0
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 +16 -1
- package/README.md +123 -63
- package/index.js +6 -6
- package/package.json +18 -18
- package/specs/a11y.json +32 -0
- package/specs/anim.json +11 -2
- package/specs/aspect.json +38 -0
- package/specs/background.json +26 -0
- package/specs/borders.json +17 -0
- package/specs/dimensions.json +43 -25
- package/specs/display.json +6 -0
- package/specs/grids.json +60 -0
- package/specs/icons.json +30 -0
- package/specs/normalize.json +158 -0
- package/specs/positions.json +1 -1
- package/specs/selection.json +15 -0
- package/specs/shadows.json +43 -0
- package/specs/typography.json +15 -5
- package/specs/grid.json +0 -39
- package/specs/shadow.json +0 -26
- /package/specs/{overflow.json → overflows.json} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2023-12-
|
|
3
|
+
- **Last updated**: 2023-12-28T23:24:39Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,21 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
## [0.5.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.5.0) (2023-12-28)
|
|
13
|
+
|
|
14
|
+
#### 🚀 Features
|
|
15
|
+
|
|
16
|
+
- add supported for quoted fns ([5d8e2fc](https://github.com/thi-ng/umbrella/commit/5d8e2fc))
|
|
17
|
+
- update generate cmd input handling ([c156762](https://github.com/thi-ng/umbrella/commit/c156762))
|
|
18
|
+
|
|
19
|
+
## [0.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.4.0) (2023-12-26)
|
|
20
|
+
|
|
21
|
+
#### 🚀 Features
|
|
22
|
+
|
|
23
|
+
- add support for file-local variation defs ([3a8e1a3](https://github.com/thi-ng/umbrella/commit/3a8e1a3))
|
|
24
|
+
- support parametric units in generator specs ([004a23d](https://github.com/thi-ng/umbrella/commit/004a23d))
|
|
25
|
+
- add support for hiccup-css declarations ([cd2ceca](https://github.com/thi-ng/umbrella/commit/cd2ceca))
|
|
26
|
+
|
|
12
27
|
## [0.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.3.0) (2023-12-22)
|
|
13
28
|
|
|
14
29
|
#### 🚀 Features
|
package/README.md
CHANGED
|
@@ -45,14 +45,20 @@ This project is part of the
|
|
|
45
45
|
Data-driven CSS framework codegen, transpiler & bundler.
|
|
46
46
|
|
|
47
47
|
This toolchain and the overall workflow proposed by it is heavily building atop
|
|
48
|
-
the concept of _CSS utility classes_
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
the concept of _CSS utility classes_ (as known from Tachyons, Turret or the
|
|
49
|
+
newer Tailwind projects). How and where those CSS classes are applied is however
|
|
50
|
+
a defining point of difference to other existing approaches. Furthermore, using
|
|
51
|
+
JSON as data format for expressing generative rules and as intermediate format
|
|
52
|
+
for generated frameworks, removes the need for any complex CSS-related
|
|
53
|
+
dependencies and makes it trivial to build secondary tooling around (e.g. part
|
|
54
|
+
of this readme is an auto-generated report of the included base framework
|
|
55
|
+
specs).
|
|
56
|
+
|
|
57
|
+
This readme aims to provide a thorough overview of this toolchain and some
|
|
52
58
|
concrete usage examples...
|
|
53
59
|
|
|
54
60
|
Note: In all cases, final CSS generation itself is handled by
|
|
55
|
-
[thi.ng/hiccup-css](https://github.com/thi-ng/umbrella/blob/develop/packages/hiccup-css/)
|
|
61
|
+
[thi.ng/hiccup-css](https://github.com/thi-ng/umbrella/blob/develop/packages/hiccup-css/).
|
|
56
62
|
|
|
57
63
|
**👷🏻 This is all WIP!** Also see included & linked examples for basic usage...
|
|
58
64
|
|
|
@@ -78,7 +84,7 @@ frameworks (in the hope they'll be shared back similarly)...
|
|
|
78
84
|
```text
|
|
79
85
|
metacss generate --help
|
|
80
86
|
|
|
81
|
-
Usage: metacss generate [opts]
|
|
87
|
+
Usage: metacss generate [opts] inputs...
|
|
82
88
|
|
|
83
89
|
Flags:
|
|
84
90
|
|
|
@@ -98,8 +104,8 @@ frameworks of dozens (usually hundreds) of utility classes, including many
|
|
|
98
104
|
possible variations (per spec).
|
|
99
105
|
|
|
100
106
|
Generation specs use a simple JSON structure as shown below. The specs can be
|
|
101
|
-
split over multiple files
|
|
102
|
-
|
|
107
|
+
split over multiple files and will all be merged by the `generate` command of
|
|
108
|
+
the toolchain.
|
|
103
109
|
|
|
104
110
|
```json5
|
|
105
111
|
{
|
|
@@ -108,15 +114,25 @@ split over multiple files within a directory and will all be merged by the
|
|
|
108
114
|
"name": "Framework name",
|
|
109
115
|
"version": "0.0.0",
|
|
110
116
|
},
|
|
111
|
-
// optional media queries and their criteria
|
|
117
|
+
// optional media queries and their criteria, will be merged from multiple spec files
|
|
112
118
|
"media": {
|
|
113
119
|
"large": { "min-width": "60rem" },
|
|
114
120
|
"dark": { "prefers-color-scheme": "dark" }
|
|
115
121
|
},
|
|
116
122
|
// optional shared values/LUTs (arrays or objects)
|
|
123
|
+
// tables are always local to the current spec file only...
|
|
117
124
|
"tables": {
|
|
118
125
|
"margins": [0, 0.25, 0.5, 1, 2, 4]
|
|
119
126
|
},
|
|
127
|
+
// optional shared variations
|
|
128
|
+
"vars": {
|
|
129
|
+
"size": ["width", "height"]
|
|
130
|
+
},
|
|
131
|
+
// optional thi.ng/hiccup-css declarations which will be part of the framework
|
|
132
|
+
// (e.g. for CSS reset purposes), will be merged from multiple spec files
|
|
133
|
+
"decls": [
|
|
134
|
+
["html", { "box-sizing": "border-box" }]
|
|
135
|
+
],
|
|
120
136
|
// array of actual generation specs
|
|
121
137
|
"specs": [
|
|
122
138
|
//...
|
|
@@ -151,15 +167,12 @@ will be explained in more detail further below.
|
|
|
151
167
|
}
|
|
152
168
|
```
|
|
153
169
|
|
|
154
|
-
Assuming the above spec has been saved to
|
|
155
|
-
directory...
|
|
170
|
+
Assuming the above spec has been saved to file `myspecs.json`...
|
|
156
171
|
|
|
157
172
|
```bash
|
|
158
|
-
# the
|
|
159
|
-
# JSON files in the provided dir (recursively)...
|
|
160
|
-
|
|
173
|
+
# the generate cmd can merge specs from multiple input files
|
|
161
174
|
# if no `--out` file is given, the result will go to stdout
|
|
162
|
-
metacss generate --pretty myspecs
|
|
175
|
+
metacss generate --pretty myspecs.json
|
|
163
176
|
```
|
|
164
177
|
|
|
165
178
|
...this command (with the above spec) will generate the following output (here
|
|
@@ -427,6 +440,7 @@ Usage: metacss convert [opts] input [...]
|
|
|
427
440
|
|
|
428
441
|
Flags:
|
|
429
442
|
|
|
443
|
+
-d, --no-decls Don't emit framework decls
|
|
430
444
|
--no-header Don't emit generated header comment
|
|
431
445
|
-p, --pretty Pretty print output
|
|
432
446
|
-v, --verbose Display extra process information
|
|
@@ -434,8 +448,8 @@ Flags:
|
|
|
434
448
|
|
|
435
449
|
Main:
|
|
436
450
|
|
|
437
|
-
-e STR, --eval STR eval meta stylesheet in given string (ignores other
|
|
438
|
-
|
|
451
|
+
-e STR, --eval STR eval meta stylesheet in given string (ignores other
|
|
452
|
+
inputs & includes)
|
|
439
453
|
-f STR, --force STR [multiple] CSS classes to force include (wildcards are
|
|
440
454
|
supported, @-prefix will read from file)
|
|
441
455
|
-I STR, --include STR [multiple] Include CSS files (prepend)
|
|
@@ -699,6 +713,7 @@ Usage: metacss export [opts] input
|
|
|
699
713
|
|
|
700
714
|
Flags:
|
|
701
715
|
|
|
716
|
+
-d, --no-decls Don't emit framework decls
|
|
702
717
|
--no-header Don't emit generated header comment
|
|
703
718
|
-p, --pretty Pretty print output
|
|
704
719
|
-v, --verbose Display extra process information
|
|
@@ -706,7 +721,7 @@ Flags:
|
|
|
706
721
|
Main:
|
|
707
722
|
|
|
708
723
|
-I STR, --include STR [multiple] Include CSS files (prepend)
|
|
709
|
-
-m
|
|
724
|
+
-m ID, --media ID [multiple] Media query IDs (use 'ALL' for all)
|
|
710
725
|
-o STR, --out STR Output file (or stdout)
|
|
711
726
|
```
|
|
712
727
|
|
|
@@ -718,17 +733,29 @@ Currently available CSS classes in MetaCSS base v0.0.1:
|
|
|
718
733
|
|
|
719
734
|
### Classes by category
|
|
720
735
|
|
|
736
|
+
#### Accessibility <!-- notoc -->
|
|
737
|
+
|
|
738
|
+
`screen-reader` / `screen-reader-focus`
|
|
739
|
+
|
|
721
740
|
#### Animations / transitions <!-- notoc -->
|
|
722
741
|
|
|
723
|
-
`bg-anim1` / `bg-anim2` / `bg-anim3`
|
|
742
|
+
`bg-anim1` / `bg-anim2` / `bg-anim3` / `fadein1` / `fadein2` / `fadein3`
|
|
743
|
+
|
|
744
|
+
#### Aspect ratios <!-- notoc -->
|
|
745
|
+
|
|
746
|
+
`aspect-ratio-16x9` / `aspect-ratio-1x1` / `aspect-ratio-3x4` / `aspect-ratio-4x3` / `aspect-ratio-4x6` / `aspect-ratio-6x4` / `aspect-ratio-9x16` / `aspect-ratio-object`
|
|
747
|
+
|
|
748
|
+
#### Background <!-- notoc -->
|
|
749
|
+
|
|
750
|
+
`bg-contain` / `bg-cover` / `bg-pos-center` / `bg-pos-e` / `bg-pos-n` / `bg-pos-ne` / `bg-pos-nw` / `bg-pos-s` / `bg-pos-se` / `bg-pos-sw` / `bg-pos-w`
|
|
724
751
|
|
|
725
752
|
#### Border radius <!-- notoc -->
|
|
726
753
|
|
|
727
|
-
`br0` / `br1` / `br2` / `br3` / `br4` / `brb0` / `brb1` / `brb2` / `brb3` / `brb4` / `brl0` / `brl1` / `brl2` / `brl3` / `brl4` / `brr0` / `brr1` / `brr2` / `brr3` / `brr4` / `brt0` / `brt1` / `brt2` / `brt3` / `brt4`
|
|
754
|
+
`br-100` / `br-pill` / `br0` / `br1` / `br2` / `br3` / `br4` / `brb0` / `brb1` / `brb2` / `brb3` / `brb4` / `brl0` / `brl1` / `brl2` / `brl3` / `brl4` / `brr0` / `brr1` / `brr2` / `brr3` / `brr4` / `brt0` / `brt1` / `brt2` / `brt3` / `brt4`
|
|
728
755
|
|
|
729
756
|
#### Border width <!-- notoc -->
|
|
730
757
|
|
|
731
|
-
`bw0` / `bw1` / `bw2` / `bw3` / `bw4` / `bw5` / `bwb0` / `bwb1` / `bwb2` / `bwb3` / `bwb4` / `bwb5` / `bwl0` / `bwl1` / `bwl2` / `bwl3` / `bwl4` / `bwl5` / `bwr0` / `bwr1` / `bwr2` / `bwr3` / `bwr4` / `bwr5` / `bwt0` / `bwt1` / `bwt2` / `bwt3` / `bwt4` / `bwt5`
|
|
758
|
+
`bw-1px` / `bw0` / `bw1` / `bw2` / `bw3` / `bw4` / `bw5` / `bwb-1px` / `bwb0` / `bwb1` / `bwb2` / `bwb3` / `bwb4` / `bwb5` / `bwl-1px` / `bwl0` / `bwl1` / `bwl2` / `bwl3` / `bwl4` / `bwl5` / `bwr-1px` / `bwr0` / `bwr1` / `bwr2` / `bwr3` / `bwr4` / `bwr5` / `bwt-1px` / `bwt0` / `bwt1` / `bwt2` / `bwt3` / `bwt4` / `bwt5`
|
|
732
759
|
|
|
733
760
|
#### Colors <!-- notoc -->
|
|
734
761
|
|
|
@@ -738,69 +765,97 @@ Currently available CSS classes in MetaCSS base v0.0.1:
|
|
|
738
765
|
|
|
739
766
|
`cursor-alias` / `cursor-auto` / `cursor-cell` / `cursor-col` / `cursor-context` / `cursor-copy` / `cursor-cross` / `cursor-default` / `cursor-e` / `cursor-ew` / `cursor-forbidden` / `cursor-grab` / `cursor-grabbing` / `cursor-help` / `cursor-in` / `cursor-move` / `cursor-n` / `cursor-ne` / `cursor-news` / `cursor-no-drop` / `cursor-none` / `cursor-ns` / `cursor-nw` / `cursor-nwse` / `cursor-out` / `cursor-pointer` / `cursor-progress` / `cursor-row` / `cursor-s` / `cursor-scroll` / `cursor-se` / `cursor-sw` / `cursor-text` / `cursor-vtext` / `cursor-w` / `cursor-wait`
|
|
740
767
|
|
|
741
|
-
####
|
|
768
|
+
#### Display mode <!-- notoc -->
|
|
742
769
|
|
|
743
|
-
`
|
|
770
|
+
`db` / `df` / `dg` / `di` / `dib` / `dif` / `dig` / `dn` / `dt` / `dtc` / `dtr`
|
|
744
771
|
|
|
745
|
-
####
|
|
772
|
+
#### Font families <!-- notoc -->
|
|
746
773
|
|
|
747
|
-
`
|
|
774
|
+
`monospace` / `sans-serif` / `serif` / `system` / `system-sans-serif` / `system-serif`
|
|
748
775
|
|
|
749
|
-
####
|
|
776
|
+
#### Font sizes <!-- notoc -->
|
|
750
777
|
|
|
751
|
-
`
|
|
778
|
+
`f-subtitle` / `f-title` / `f1` / `f2` / `f3` / `f4` / `f5` / `f6` / `f7`
|
|
752
779
|
|
|
753
|
-
####
|
|
780
|
+
#### Font style <!-- notoc -->
|
|
754
781
|
|
|
755
|
-
`
|
|
782
|
+
`italic`
|
|
783
|
+
|
|
784
|
+
#### Font variants <!-- notoc -->
|
|
785
|
+
|
|
786
|
+
`small-caps`
|
|
787
|
+
|
|
788
|
+
#### Font weights <!-- notoc -->
|
|
789
|
+
|
|
790
|
+
`b` / `fw100` / `fw200` / `fw300` / `fw400` / `fw500` / `fw600` / `fw700` / `fw800` / `fw900` / `normal`
|
|
756
791
|
|
|
757
792
|
#### Grid layout <!-- notoc -->
|
|
758
793
|
|
|
759
|
-
`gap0` / `gap1` / `gap2` / `gap3` / `gap4` / `gap5` / `
|
|
794
|
+
`align-items-center` / `align-items-end` / `align-items-start` / `align-items-stretch` / `align-self-center` / `align-self-end` / `align-self-start` / `align-self-stretch` / `gap-1px` / `gap-2px` / `gap-4px` / `gap-8px` / `gap0` / `gap1` / `gap2` / `gap3` / `gap4` / `gap5` / `grid-cols-1` / `grid-cols-10` / `grid-cols-2` / `grid-cols-3` / `grid-cols-4` / `grid-cols-5` / `grid-cols-6` / `grid-cols-7` / `grid-cols-8` / `grid-cols-9` / `grid-rows-1` / `grid-rows-10` / `grid-rows-2` / `grid-rows-3` / `grid-rows-4` / `grid-rows-5` / `grid-rows-6` / `grid-rows-7` / `grid-rows-8` / `grid-rows-9` / `justify-items-center` / `justify-items-end` / `justify-items-start` / `justify-items-stretch` / `justify-self-center` / `justify-self-end` / `justify-self-start` / `justify-self-stretch`
|
|
760
795
|
|
|
761
|
-
####
|
|
796
|
+
#### Height <!-- notoc -->
|
|
762
797
|
|
|
763
|
-
`
|
|
798
|
+
`h-10` / `h-100` / `h-16` / `h-17` / `h-20` / `h-25` / `h-30` / `h-33` / `h-34` / `h-40` / `h-50` / `h-60` / `h-66` / `h-67` / `h-70` / `h-75` / `h-80` / `h-83` / `h-84` / `h-90` / `h1` / `h2` / `h3` / `h4` / `h5`
|
|
764
799
|
|
|
765
|
-
####
|
|
800
|
+
#### Icons <!-- notoc -->
|
|
766
801
|
|
|
767
|
-
`
|
|
802
|
+
`icon-1` / `icon-2` / `icon-3` / `icon-4` / `icon-5` / `icon-6` / `icon-7` / `icon-subtitle` / `icon-title`
|
|
803
|
+
|
|
804
|
+
#### Letter spacing <!-- notoc -->
|
|
805
|
+
|
|
806
|
+
`ls--1` / `ls--2` / `ls-0` / `ls-1` / `ls-2` / `ls-3`
|
|
807
|
+
|
|
808
|
+
#### Line heights <!-- notoc -->
|
|
809
|
+
|
|
810
|
+
`lh-0` / `lh-copy` / `lh-double` / `lh-solid` / `lh-title`
|
|
811
|
+
|
|
812
|
+
#### Lists <!-- notoc -->
|
|
813
|
+
|
|
814
|
+
`list`
|
|
768
815
|
|
|
769
816
|
#### Margin <!-- notoc -->
|
|
770
817
|
|
|
771
818
|
`center` / `ma0` / `ma1` / `ma2` / `ma3` / `ma4` / `mb0` / `mb1` / `mb2` / `mb3` / `mb4` / `mh0` / `mh1` / `mh2` / `mh3` / `mh4` / `ml0` / `ml1` / `ml2` / `ml3` / `ml4` / `mr0` / `mr1` / `mr2` / `mr3` / `mr4` / `mt0` / `mt1` / `mt2` / `mt3` / `mt4` / `mv0` / `mv1` / `mv2` / `mv3` / `mv4`
|
|
772
819
|
|
|
773
|
-
####
|
|
820
|
+
#### Max. height <!-- notoc -->
|
|
774
821
|
|
|
775
|
-
`
|
|
822
|
+
`maxh-10` / `maxh-100` / `maxh-16` / `maxh-17` / `maxh-20` / `maxh-25` / `maxh-30` / `maxh-33` / `maxh-34` / `maxh-40` / `maxh-50` / `maxh-60` / `maxh-66` / `maxh-67` / `maxh-70` / `maxh-75` / `maxh-80` / `maxh-83` / `maxh-84` / `maxh-90` / `maxh1` / `maxh2` / `maxh3` / `maxh4` / `maxh5`
|
|
776
823
|
|
|
777
|
-
####
|
|
824
|
+
#### Max. width <!-- notoc -->
|
|
778
825
|
|
|
779
|
-
`
|
|
826
|
+
`maxw-10` / `maxw-100` / `maxw-16` / `maxw-17` / `maxw-20` / `maxw-25` / `maxw-30` / `maxw-33` / `maxw-34` / `maxw-40` / `maxw-50` / `maxw-60` / `maxw-66` / `maxw-67` / `maxw-70` / `maxw-75` / `maxw-80` / `maxw-83` / `maxw-84` / `maxw-90` / `maxw1` / `maxw2` / `maxw3` / `maxw4` / `maxw5`
|
|
780
827
|
|
|
781
|
-
####
|
|
828
|
+
#### Min. height <!-- notoc -->
|
|
782
829
|
|
|
783
|
-
`
|
|
830
|
+
`minh-10` / `minh-100` / `minh-16` / `minh-17` / `minh-20` / `minh-25` / `minh-30` / `minh-33` / `minh-34` / `minh-40` / `minh-50` / `minh-60` / `minh-66` / `minh-67` / `minh-70` / `minh-75` / `minh-80` / `minh-83` / `minh-84` / `minh-90` / `minh1` / `minh2` / `minh3` / `minh4` / `minh5`
|
|
784
831
|
|
|
785
|
-
####
|
|
832
|
+
#### Min. width <!-- notoc -->
|
|
786
833
|
|
|
787
|
-
`
|
|
834
|
+
`minw-10` / `minw-100` / `minw-16` / `minw-17` / `minw-20` / `minw-25` / `minw-30` / `minw-33` / `minw-34` / `minw-40` / `minw-50` / `minw-60` / `minw-66` / `minw-67` / `minw-70` / `minw-75` / `minw-80` / `minw-83` / `minw-84` / `minw-90` / `minw1` / `minw2` / `minw3` / `minw4` / `minw5`
|
|
788
835
|
|
|
789
|
-
####
|
|
836
|
+
#### Overflow <!-- notoc -->
|
|
790
837
|
|
|
791
|
-
`
|
|
838
|
+
`overflow-auto` / `overflow-hidden` / `overflow-scroll` / `overflow-visible` / `overflow-x-auto` / `overflow-x-hidden` / `overflow-x-scroll` / `overflow-x-visible` / `overflow-y-auto` / `overflow-y-hidden` / `overflow-y-scroll` / `overflow-y-visible`
|
|
792
839
|
|
|
793
|
-
####
|
|
840
|
+
#### Padding <!-- notoc -->
|
|
794
841
|
|
|
795
|
-
`
|
|
842
|
+
`pa0` / `pa1` / `pa2` / `pa3` / `pa4` / `pb0` / `pb1` / `pb2` / `pb3` / `pb4` / `ph0` / `ph1` / `ph2` / `ph3` / `ph4` / `pl0` / `pl1` / `pl2` / `pl3` / `pl4` / `pr0` / `pr1` / `pr2` / `pr3` / `pr4` / `pt0` / `pt1` / `pt2` / `pt3` / `pt4` / `pv0` / `pv1` / `pv2` / `pv3` / `pv4`
|
|
796
843
|
|
|
797
|
-
####
|
|
844
|
+
#### Positions <!-- notoc -->
|
|
798
845
|
|
|
799
|
-
`
|
|
846
|
+
`absolute` / `bottom--1` / `bottom--2` / `bottom-0` / `bottom-1` / `bottom-2` / `fixed` / `left--1` / `left--2` / `left-0` / `left-1` / `left-2` / `relative` / `right--1` / `right--2` / `right-0` / `right-1` / `right-2` / `static` / `sticky` / `top--1` / `top--2` / `top-0` / `top-1` / `top-2`
|
|
800
847
|
|
|
801
|
-
####
|
|
848
|
+
#### Selection <!-- notoc -->
|
|
802
849
|
|
|
803
|
-
`
|
|
850
|
+
`noselect`
|
|
851
|
+
|
|
852
|
+
#### Shadow <!-- notoc -->
|
|
853
|
+
|
|
854
|
+
`box-shadow-1` / `box-shadow-2` / `box-shadow-3` / `box-shadow-4` / `box-shadow-i-1` / `box-shadow-i-2` / `box-shadow-i-3` / `box-shadow-i-4` / `text-shadow-1` / `text-shadow-2` / `text-shadow-3` / `text-shadow-4` / `text-shadow-5` / `text-shadow-6` / `text-shadow-7` / `text-shadow-8` / `text-shadow-9`
|
|
855
|
+
|
|
856
|
+
#### Text align <!-- notoc -->
|
|
857
|
+
|
|
858
|
+
`tc` / `tj` / `tl` / `tr`
|
|
804
859
|
|
|
805
860
|
#### Text decorations <!-- notoc -->
|
|
806
861
|
|
|
@@ -810,25 +865,29 @@ Currently available CSS classes in MetaCSS base v0.0.1:
|
|
|
810
865
|
|
|
811
866
|
`ttc` / `ttfsk` / `ttfw` / `tti` / `ttl` / `ttn` / `ttu`
|
|
812
867
|
|
|
813
|
-
####
|
|
868
|
+
#### Undefined <!-- notoc -->
|
|
814
869
|
|
|
815
|
-
`
|
|
870
|
+
`vh-100` / `vh-25` / `vh-50` / `vh-75` / `vw-100` / `vw-25` / `vw-50` / `vw-75`
|
|
816
871
|
|
|
817
872
|
#### Vertical align <!-- notoc -->
|
|
818
873
|
|
|
819
|
-
`v-btm` / `v-mid` / `v-top`
|
|
874
|
+
`v-base` / `v-btm` / `v-mid` / `v-top`
|
|
820
875
|
|
|
821
|
-
####
|
|
876
|
+
#### Visibility <!-- notoc -->
|
|
822
877
|
|
|
823
|
-
`
|
|
878
|
+
`hidden` / `visible`
|
|
824
879
|
|
|
825
880
|
#### Whitespace <!-- notoc -->
|
|
826
881
|
|
|
827
882
|
`ws-0` / `ws-1` / `ws-2`
|
|
828
883
|
|
|
829
|
-
####
|
|
884
|
+
#### Width <!-- notoc -->
|
|
830
885
|
|
|
831
|
-
`
|
|
886
|
+
`w-10` / `w-100` / `w-16` / `w-17` / `w-20` / `w-25` / `w-30` / `w-33` / `w-34` / `w-40` / `w-50` / `w-60` / `w-66` / `w-67` / `w-70` / `w-75` / `w-80` / `w-83` / `w-84` / `w-90` / `w1` / `w2` / `w3` / `w4` / `w5`
|
|
887
|
+
|
|
888
|
+
#### Z-indices <!-- notoc -->
|
|
889
|
+
|
|
890
|
+
`z-0` / `z-1` / `z-2` / `z-3` / `z-4` / `z-5` / `z-999` / `z-9999`
|
|
832
891
|
|
|
833
892
|
### Media queries
|
|
834
893
|
|
|
@@ -861,7 +920,7 @@ distributed as CLI bundle with **no runtime dependencies**. The following
|
|
|
861
920
|
dependencies are only shown for informational purposes and are (partially)
|
|
862
921
|
included in the bundle.
|
|
863
922
|
|
|
864
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 11.
|
|
923
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 11.46 KB
|
|
865
924
|
|
|
866
925
|
## Dependencies
|
|
867
926
|
|
|
@@ -881,13 +940,14 @@ Package sizes (brotli'd, pre-treeshake): ESM: 11.31 KB
|
|
|
881
940
|
|
|
882
941
|
## Usage examples
|
|
883
942
|
|
|
884
|
-
|
|
943
|
+
Several projects in this repo's
|
|
885
944
|
[/examples](https://github.com/thi-ng/umbrella/tree/develop/examples)
|
|
886
|
-
directory
|
|
945
|
+
directory are using this package:
|
|
887
946
|
|
|
888
|
-
| Screenshot | Description
|
|
889
|
-
|
|
890
|
-
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/meta-css-basics.png" width="240"/> | Basic thi.ng/meta-css usage & testbed
|
|
947
|
+
| Screenshot | Description | Live demo | Source |
|
|
948
|
+
|:-----------------------------------------------------------------------------------------------------------------------|:-----------------------------------------|:------------------------------------------------------|:-----------------------------------------------------------------------------------|
|
|
949
|
+
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/meta-css-basics.png" width="240"/> | Basic thi.ng/meta-css usage & testbed | [Demo](https://demo.thi.ng/umbrella/meta-css-basics/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/meta-css-basics) |
|
|
950
|
+
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-lazy-load.png" width="240"/> | Lazy loading components via @thi.ng/rdom | [Demo](https://demo.thi.ng/umbrella/rdom-lazy-load/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-lazy-load) |
|
|
891
951
|
|
|
892
952
|
## Authors
|
|
893
953
|
|
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
3
|
-
`)}}var
|
|
4
|
-
`]:[],...Y(
|
|
5
|
-
`),v1(X,W);const Q=await X.ctx({logger:new m0(process.stderr,X.name,"INFO"),format:J?H0:N1,opts:B.result,inputs:B.rest},U);if(await U.fn(Q),X.post)await X.post(Q,U)}catch(Y){process.stderr.write(Y.message+"\n\n"),process.exit(1)}},v1=(X,Z)=>{process.stderr.write(J0(X.opts,Z)),process.exit(1)},XX=(X)=>["\nAvailable commands:\n",...Object.keys(X).map((Z)=>`${K0(16)(Z)}: ${X[Z].desc}`),"\n"].join("\n");import{existsSync as ZX,mkdirSync as JX,statSync as WX} from"fs";import{sep as YX} from"path";var b1=(X)=>{const Z=X.substring(0,X.lastIndexOf(YX));return Z.length>0&&!ZX(Z)?(JX(Z,{recursive:!0}),!0):!1},L1=(X)=>WX(X).isDirectory();var k=(X)=>typeof X==="function";var F=(X)=>typeof X==="string";import{readdirSync as UX,statSync as k5} from"fs";import{sep as VX} from"path";function*y1(X,Z="",J,W=Infinity,Y=0){if(Y>=W)return;const U=QX(Z);for(let V of UX(X).sort()){const B=X+VX+V;try{if(L1(B))yield*y1(B,Z,J,W,Y+1);else if(U(B))yield B}catch(Q){J&&J.warn(`ignoring file: ${V} (${Q.message})`)}}}var S1=(X,Z="",J=Infinity,W)=>y1(X,Z,W,J,0);var BX=(X)=>F(X)?new RegExp(`${X.replace(/\./g,"\\.")}\$`):X,QX=(X)=>k(X)?X:(X=BX(X),(Z)=>X.test(Z));import{readFileSync as qX} from"fs";import{writeFileSync as zX} from"fs";var h1=(X,Z,J,W,Y=!1)=>{if(W&&W.info(`${Y?"[dryrun] ":""}writing file: ${X}`),Y)return;b1(X),zX(X,Z,!J&&F(Z)?"utf-8":J)};var A=(X,Z,J="utf-8")=>{return Z&&Z.debug("reading file:",X),qX(X,J)},n0=(X,Z,J,W=!1)=>h1(X,P(Z)?Z.join("\n"):Z,"utf-8",J,W);var b=(X,Z)=>JSON.parse(A(X,Z));var M0=Object.freeze({level:C.NONE,enabled:()=>!1,fine(){},debug(){},info(){},warn(){},severe(){}});import{join as nX} from"path";var KX=I(()=>"Assertion failed"),F0=(typeof process!=="undefined"&&process.env!==void 0?!0:import.meta.env?import.meta.env.MODE!=="production"||!!import.meta.env.UMBRELLA_ASSERTS||!!import.meta.env.VITE_UMBRELLA_ASSERTS:!0)?(X,Z)=>{if(typeof X==="function"&&!X()||!X)throw new KX(typeof Z==="function"?Z():Z)}:()=>{};var P0=(X)=>X!=null&&typeof X!=="function"&&X.length!==void 0;var f1=(X)=>{return(X==null||!X[Symbol.iterator])&&H(`value is not iterable: ${X}`),X};var m1=(X)=>P0(X)?X:[...f1(X)];var Y0=(X)=>X[X.length-1];var $X=I(()=>"illegal arity"),i=(X)=>{throw new $X(X)};var HX=I(()=>"illegal state"),a=(X)=>{throw new HX(X)};var l0=function(...X){let[Z,J,W,Y,U,V,B,Q,q,z]=X;switch(X.length){case 0:i(0);case 1:return Z;case 2:return(...$)=>Z(J(...$));case 3:return(...$)=>Z(J(W(...$)));case 4:return(...$)=>Z(J(W(Y(...$))));case 5:return(...$)=>Z(J(W(Y(U(...$)))));case 6:return(...$)=>Z(J(W(Y(U(V(...$))))));case 7:return(...$)=>Z(J(W(Y(U(V(B(...$)))))));case 8:return(...$)=>Z(J(W(Y(U(V(B(Q(...$))))))));case 9:return(...$)=>Z(J(W(Y(U(V(B(Q(q(...$)))))))));case 10:default:const K=(...$)=>Z(J(W(Y(U(V(B(Q(q(z(...$))))))))));return X.length===10?K:l0(K,...X.slice(10))}};var u1=(X,Z)=>new Promise((J)=>setTimeout(()=>J(X),Z));var g1=(X)=>X;var x1=["-moz-","-ms-","-o-","-webkit-"],t={rules:"",ruleSep:",",valSep:"",decls:"",declStart:"{",declEnd:"}",indent:"",comments:!1},w0={rules:"\n",ruleSep:", ",valSep:" ",decls:"\n",declStart:" {\n",declEnd:"}\n",indent:" ",comments:!0};var G=(X)=>X!=null&&typeof X[Symbol.iterator]==="function";var N0=(X,Z)=>X!=null&&typeof X[Z]==="function";var u=(X)=>N0(X,"xform")?X.xform():X;var L=function(...X){return X=X.map(u),l0.apply(null,X)};var O0=(X)=>X!=null&&typeof X!=="string"&&typeof X[Symbol.iterator]==="function";var c=(X,Z)=>[X[0],X[1],Z];var S=Symbol(),p0=()=>{};class o0{value;constructor(X){this.value=X}deref(){return this.value}}var j=(X)=>X instanceof o0;var y=(X)=>X instanceof o0?X.deref():X;var D0=function(...X){const Z=X[0],J=Z[0],W=Z[1],Y=Z[2];X=CX(X);const U=X[0]==null?J():X[0],V=X[1];return y(W(N0(V,"$reduce")?V.$reduce(Y,U):P0(V)?MX(Y,U,V):FX(Y,U,V)))};var CX=(X)=>X.length===2?[void 0,X[1]]:X.length===3?[X[1],X[2]]:i(X.length),MX=(X,Z,J)=>{for(let W=0,Y=J.length;W<Y;W++)if(Z=X(Z,J[W]),j(Z)){Z=Z.deref();break}return Z},FX=(X,Z,J)=>{for(let W of J)if(Z=X(Z,W),j(Z)){Z=Z.deref();break}return Z},r=(X,Z)=>[X,(J)=>J,Z];var G0=function(X){return X?[...X]:r(()=>[],(Z,J)=>(Z.push(J),Z))};function*j0(X,Z){const J=u(X)(G0()),W=J[1],Y=J[2];for(let U of Z){const V=Y([],U);if(j(V)){yield*y(W(V.deref()));return}if(V.length)yield*V}yield*y(W([]))}function*g(X,Z){const J=u(X)([p0,p0,(W,Y)=>Y])[2];for(let W of Z){let Y=J(S,W);if(j(Y)){if(Y=y(Y.deref()),Y!==S)yield Y;return}if(Y!==S)yield Y}}var k0=(X,Z,J=g)=>{const W=Z.length-1;return G(Z[W])?Z.length>1?J(X.apply(null,Z.slice(0,W)),Z[W]):J(X(),Z[0]):void 0};var i0=function(X,Z){return G(Z)?j0(i0(X),F(Z)?[Z]:Z):(J)=>{const W=J[2],Y=(U,V)=>{const B=X(V);if(B){for(let Q of B)if(U=Y(U,Q),j(U))break;return U}return W(U,V)};return c(J,Y)}};var d1=function(X){return i0((Z)=>O0(Z)?Z:void 0,X)};var w=function(X,Z){return G(Z)?g(w(X),Z):(J)=>{const W=J[2];return c(J,(Y,U)=>W(Y,X(U)))}};function*T0(...X){const Z=X.length-1;if(Z<0)return;const J=new Array(Z+1).fill(0),W=X.map(m1),Y=W.reduce((U,V)=>U*V.length,1);for(let U=0;U<Y;U++){const V=[];for(let B=Z;B>=0;B--){const Q=W[B];let q=J[B];if(q===Q.length)J[B]=q=0,B>0&&J[B-1]++;V[B]=Q[q]}J[Z]++,yield V}}function*n1(X,Z=Infinity){while(Z-- >0)yield X}var a0=function(X,Z){X=X||"";let J=!0;return Z?[...Z].join(X):r(()=>"",(W,Y)=>(W=J?W+Y:W+X+Y,J=!1,W))};var I0=function(...X){return PX(I0,D0,X)};var PX=(X,Z,J)=>{let W,Y;switch(J.length){case 4:Y=J[3],W=J[2];break;case 3:Y=J[2];break;case 2:return w((U)=>X(J[0],J[1],U));default:i(J.length)}return Z(u(J[0])(J[1]),W,Y)};var wX=new Set,NX=":[",l1=L(d1(),w((X)=>NX.indexOf(X.charAt(0))>=0?X:" "+X)),OX=(X,Z)=>L(X,w((J)=>F(J)&&J.indexOf(" .")==0?J+Z:J)),s=(X,Z,J,W)=>{const Y=J.length,U=[];let V,B;const Q=(q,z)=>{let K=null;if(P(z))s(X,t0(Z,U),z,W);else if(G(z)&&!F(z))s(X,t0(Z,U),[...z],W);else if((B=k(z))||(K=W.fns[z]))if(!Z.length){if(K)return K.apply(null,J.slice(q+1))(X,W),!0;z(X,W)}else if(B)Q(q,z());else H(`quoted fn ('${z}') only allowed at head position`);else if(R(z))V=Object.assign(V||{},z);else if(z!=null)U.push(z)};for(let q=0;q<Y;q++)if(Q(q,J[q]))return X;return V&&X.push(DX(Z,U,V,W)),X},t0=(X,Z)=>X.length?[...T0(X,Z)]:Z,DX=(X,Z,J,W)=>{const Y=W.format,U=R0(W),V=W.scope?OX(l1,W.scope):l1;return[U,I0(w((B)=>I0(V,a0(),P(B)?B:[B]).trim()),a0(Y.ruleSep),t0(X,Z)),Y.declStart,c0(J,W),U,Y.declEnd].join("")},c0=(X,Z)=>{const J=Z.format,W=Z.autoprefix||wX,Y=R0(Z,Z.depth+1),U=[];for(let V in X)if(X.hasOwnProperty(V)){let B=X[V];if(k(B))B=B(X);if(P(B))B=B.map((Q)=>P(Q)?Q.join(" "):Q).join(J.ruleSep);if(W.has(V))for(let Q of Z.vendors)U.push(`${Y}${Q}${V}:${J.valSep}${B};`);U.push(`${Y}${V}:${J.valSep}${B};`)}return U.join(J.decls)+J.decls},R0=(X,Z=X.depth)=>Z>1?[...n1(X.format.indent,Z)].join(""):Z>0?X.format.indent:"";var o1=(X,Z,J)=>(W,Y)=>{const U=R0(Y);return W.push(`${U}${X} ${GX(Z)}${Y.format.declStart}`),Y.depth++,s(W,[],J,Y),Y.depth--,W.push(U+Y.format.declEnd),W},GX=(X)=>{if(F(X))return X;const Z=[];for(let J in X)if(X.hasOwnProperty(J)){let W=X[J];if(W===!0)W=p1.has(J)?J:`(${J})`;else if(W===!1)W=`(not ${p1.has(J)?J:`(${J})`})`;else if(W==="only")W+=" "+J;else W=`(${J}:${W})`;Z.push(W)}return Z.join(" and ")},p1=new Set(["all","print","screen"]);var U0=(X,Z)=>{return Z={format:t,vendors:x1,fns:{},depth:0,...Z},P(Z.autoprefix)&&(Z.autoprefix=new Set(Z.autoprefix)),R(X)?c0(X,Z):k(X)?X([],Z).join(Z.format.rules):s([],[],P(X)?X:O0(X)?[...X]:H("invalid rules"),Z).join(Z.format.rules)};var A0=(X,Z)=>o1("@media",X,Z);var i1=4,a1=(X)=>i1=X,D=(X)=>X===(X|0)?String(X):X.toFixed(i1).replace(/^0./,".").replace(/^-0./,"-.").replace(/0+$/,""),t1=(X)=>`${D(X)}em`,c1=(X)=>`${D(X)}ex`,r1=(X)=>`${D(X)}rem`,r0=(X)=>`${D(X)}%`,s1=(X)=>`${D(X)}px`,e1=(X)=>`${D(X)}vh`,X8=(X)=>`${D(X)}vw`,Z8=(X)=>`${D(X)}vmin`,J8=(X)=>`${D(X)}vmax`,W8=(X)=>`${X|0}ms`,Y8=(X)=>`${D(X)}s`;var U8=(X)=>`${D(X)}deg`,V8=(X)=>`${D(X)}rad`,B8=(X)=>`${D(X)}turn`,Q8=(X)=>`url(${X})`;var N=((X)=>{return X[X.IDLE=0]="IDLE",X[X.ACTIVE=1]="ACTIVE",X[X.DONE=2]="DONE",X[X.UNSUBSCRIBED=3]="UNSUBSCRIBED",X[X.ERROR=4]="ERROR",X})(N||{}),T=((X)=>{return X[X.NEVER=0]="NEVER",X[X.FIRST=1]="FIRST",X[X.LAST=2]="LAST",X})(T||{});var jX=0,kX=()=>jX++,x=(X,Z)=>!Z||!Z.id?{...Z,id:X+"-"+kX()}:Z;var O=M0;class h{constructor(X,Z){this.wrapped=X,Z=x("sub",{closeIn:T.LAST,closeOut:T.LAST,cache:!0,...Z}),this.parent=Z.parent,this.id=Z.id,this.closeIn=Z.closeIn,this.closeOut=Z.closeOut,this.cacheLast=Z.cache,Z.xform&&(this.xform=Z.xform(G0()))}id;closeIn;closeOut;parent;__owner;xform;cacheLast;last=S;state=N.IDLE;subs=[];deref(){return this.last!==S?this.last:void 0}getState(){return this.state}setState(X){this.state=X}subscribe(X,Z={}){this.ensureState();let J;if(X instanceof h&&!Z.xform)X.ensureState(),F0(!X.parent,`sub '${X.id}' already has a parent`),X.parent=this,J=X;else J=new h(X,{...Z,parent:this});return this.subs.push(J),this.setState(N.ACTIVE),J.setState(N.ACTIVE),this.last!=S&&J.next(this.last),J}transform(...X){let Z,J;if(R(Y0(X)))J=X.pop(),Z={error:J.error};return this.subscribe(Z,x("xform",X.length>0?{...J,xform:L(...X)}:J))}map(X,Z){return this.transform(w(X),Z||{})}unsubscribe(X){return X?this.unsubscribeChild(X):this.unsubscribeSelf()}unsubscribeSelf(){return O.debug(this.id,"unsub self"),this.parent&&this.parent.unsubscribe(this),this.state<N.UNSUBSCRIBED&&(this.state=N.UNSUBSCRIBED),this.release(),!0}unsubscribeChild(X){O.debug(this.id,"unsub child",X.id);const Z=this.subs.indexOf(X);if(Z>=0){if(this.subs.splice(Z,1),this.closeOut===T.FIRST||!this.subs.length&&this.closeOut!==T.NEVER)this.unsubscribe();return!0}return!1}next(X){if(this.state>=N.DONE)return;this.xform?this.dispatchXform(X):this.dispatch(X)}done(){if(O.debug(this.id,"entering done()"),this.state>=N.DONE)return;if(this.xform){if(!this.dispatchXformDone())return}if(this.state=N.DONE,this.dispatchTo("done"))this.state<N.UNSUBSCRIBED&&this.unsubscribe();O.debug(this.id,"exiting done()")}error(X){const Z=this.wrapped,J=Z&&Z.error;return J&&O.debug(this.id,"attempting wrapped error handler"),J&&Z.error(X)||this.unhandledError(X)}unhandledError(X){return(O!==M0?O:console).warn(this.id,"unhandled error:",X),this.unsubscribe(),this.state=N.ERROR,!1}dispatchTo(X,Z){let J=this.wrapped;if(J)try{J[X]&&J[X](Z)}catch(Y){if(!this.error(Y))return!1}const W=X==="next"?this.subs:[...this.subs];for(let Y=W.length;Y-- >0;){J=W[Y];try{J[X]&&J[X](Z)}catch(U){if(X==="error"||!J.error||!J.error(U))return this.unhandledError(U)}}return!0}dispatch(X){O.debug(this.id,"dispatch",X),this.cacheLast&&(this.last=X),this.dispatchTo("next",X)}dispatchXform(X){let Z;try{Z=this.xform[2]([],X)}catch(J){this.error(J);return}if(this.dispatchXformVals(Z))j(Z)&&this.done()}dispatchXformDone(){let X;try{X=this.xform[1]([])}catch(Z){return this.error(Z)}return this.dispatchXformVals(X)}dispatchXformVals(X){const Z=y(X);for(let J=0,W=Z.length;J<W&&this.state<N.DONE;J++)this.dispatch(Z[J]);return this.state<N.ERROR}ensureState(){if(this.state>=N.DONE)a(`operation not allowed in state ${this.state}`)}release(){this.subs.length=0,delete this.parent,delete this.xform,delete this.last}}var z8=(X,Z)=>{const J=new q8(Z);return J.next(X),J};class q8 extends h{src;_cancel;_inited;constructor(X,Z){const[J,W]=k(X)?[X,Z||{}]:[void 0,X||{}];super(W.error?{error:W.error}:void 0,x("stream",W));this.src=J,this._inited=!1}subscribe(X,Z={}){const J=super.subscribe(X,Z);if(!this._inited){if(this.src)try{this._cancel=this.src(this)||(()=>{return})}catch(W){let Y=this.wrapped;if(!Y||!Y.error||!Y.error(W))this.unhandledError(W)}this._inited=!0}return J}unsubscribe(X){const Z=super.unsubscribe(X);if(Z&&(!X||(!this.subs||!this.subs.length)&&this.closeOut!==T.NEVER))this.cancel();return Z}done(){this.cancel(),super.done(),delete this.src,delete this._cancel}error(X){if(super.error(X))return!0;return this.cancel(),!1}cancel(){if(this._cancel){O.debug(this.id,"cancel");const X=this._cancel;delete this._cancel,X()}}}var K8=(X,Z)=>X===T.FIRST||X===T.LAST&&!Z;var s0=function(X){return X?D0(s0(),X):r(()=>({}),(Z,[J,W])=>(Z[J]=W,Z))};var e0=function(X,Z){return G(Z)?g(e0(X),Z):w(k(X)?(J)=>[X(J),J]:(J)=>[X,J])};var X1=function(...X){const Z=k0(X1,X);if(Z)return Z;const J=X[0],W=X[1]!==!1;return w((Y)=>{const U=W?{}:Y;for(let V in Y)U[V]=J(Y[V]);return U})};var Z1=function(...X){const Z=k0(Z1,X,j0);if(Z)return Z;const{key:J,mergeOnly:W,reset:Y,all:U,backPressure:V}={key:g1,mergeOnly:!1,reset:!0,all:!0,backPressure:0,...X[1]},B=P(X[0])?new Set(X[0]):X[0],Q=new Set,q=new Map;let z={};const K=([$,v,_])=>{let f=!0;if(W||V<1)return[$,(M)=>{if(Y&&U&&Q.size>0||!Y&&f)M=_(M,z),z={},Q.clear(),f=!1;return v(M)},(M,Z0)=>{const E=J(Z0);if(B.has(E)){if(z[E]=Z0,Q.add(E),W||$8(B,Q))if(M=_(M,z),f=!1,Y)z={},Q.clear();else z={...z}}return M}];else return[$,(M)=>{if(U&&Q.size>0)M=_(M,H8(q,Q)),q.clear(),Q.clear();return v(M)},(M,Z0)=>{const E=J(Z0);if(B.has(E)){let Q0=q.get(E);!Q0&&q.set(E,Q0=[]),Q0.length>=V&&a(`max back pressure (${V}) exceeded for input: ${String(E)}`),Q0.push(Z0),Q.add(E);while($8(B,Q))if(M=_(M,H8(q,Q)),f=!1,j(M))break}return M}]};return K.keys=()=>B,K.clear=()=>{q.clear(),B.clear(),Q.clear(),z={}},K.add=($)=>{B.add($)},K.delete=($,v=!0)=>{if(q.delete($),B.delete($),v)Q.delete($),delete z[$]},K},$8=(X,Z)=>{if(Z.size<X.size)return!1;for(let J of X)if(!Z.has(J))return!1;return!0},H8=(X,Z)=>{const J={};for(let W of Z){const Y=X.get(W);J[W]=Y.shift(),!Y.length&&Z.delete(W)}return J};var C8=(X,Z)=>{let J=!0;for(let W of Z)J=X.removeID(W)&&J;return J};var M8=(X)=>new F8(X);class F8 extends h{sources;idSources;realSourceIDs;invRealSourceIDs;psync;clean;constructor(X){const Z=Z1(new Set,{key:(W)=>W[0],mergeOnly:X.mergeOnly===!0,reset:X.reset===!0,all:X.all!==!1,backPressure:X.backPressure||0}),J=X1((W)=>W[1]);super(void 0,x("streamsync",{...X,xform:X.xform?L(Z,J,X.xform):L(Z,J)}));this.sources=new Map,this.realSourceIDs=new Map,this.invRealSourceIDs=new Map,this.idSources=new Map,this.psync=Z,this.clean=!!X.clean,X.src&&this.addAll(X.src)}add(X,Z){Z||(Z=X.id),this.ensureState(),this.psync.add(Z),this.realSourceIDs.set(Z,X.id),this.invRealSourceIDs.set(X.id,Z),this.idSources.set(X.id,X),this.sources.set(X,X.subscribe({next:(J)=>J[1]instanceof h?this.add(J[1]):this.next(J),done:()=>this.markDone(X),__owner:this},{xform:e0(Z),id:`in-${Z}`}))}addAll(X){for(let Z in X)this.psync.add(Z);for(let Z in X)this.add(X[Z],Z)}remove(X){const Z=this.sources.get(X);if(Z){const J=this.invRealSourceIDs.get(X.id);return O.info(`removing src: ${X.id} (${J})`),this.psync.delete(J,this.clean),this.realSourceIDs.delete(J),this.invRealSourceIDs.delete(X.id),this.idSources.delete(X.id),this.sources.delete(X),Z.unsubscribe(),!0}return!1}removeID(X){const Z=this.getSourceForID(X);return Z?this.remove(Z):!1}removeAll(X){for(let J of X)this.psync.delete(this.invRealSourceIDs.get(J.id));let Z=!0;for(let J of X)Z=this.remove(J)&&Z;return Z}removeAllIDs(X){return C8(this,X)}getSourceForID(X){return this.idSources.get(this.realSourceIDs.get(X))}getSources(){const X={};for(let[Z,J]of this.idSources)X[this.invRealSourceIDs.get(Z)]=J;return X}unsubscribe(X){if(!X){O.debug(this.id,"unsub sources");for(let Z of this.sources.values())Z.unsubscribe();this.sources.clear(),this.psync.clear(),this.realSourceIDs.clear(),this.invRealSourceIDs.clear(),this.idSources.clear()}return super.unsubscribe(X)}markDone(X){this.remove(X),K8(this.closeIn,this.sources.size)&&this.done()}}var J1=d((X,Z=" ")=>{const J=n(String(Z),X);return(W,Y)=>{if(W==null)return J;return W=W.toString(),Y=Y!==void 0?Y:W.length,Y<X?J.substring(Y)+W:W}}),R2=J1(2,"0"),P8=J1(3,"0"),A2=J1(4,"0");var W1=function(X,Z){return G(Z)?g(W1(X),Z):(J)=>{const W=J[2];return c(J,(Y,U)=>X(U)?W(Y,U):Y)}};import{watch as IX} from"fs";import{resolve as B0} from"path";var w8={specs:p({alias:"s",optional:!1,desc:"Path to generated JSON defs"})},E0={include:o({alias:"I",desc:"Include CSS files (prepend)"})},e={pretty:l({alias:"p",desc:"Pretty print output"})},v0={noHeader:l({desc:"Don't emit generated header comment"})},N8={watch:l({alias:"w",desc:"Watch input files for changes"})};import{resolve as TX} from"path";var X0=(X,Z,J)=>{Z=F(Z)?Z:Z.join("\n"),X?n0(TX(X),Z,J):console.log(Z)},_0=({info:{name:X,version:Z}})=>`/*! ${X} v${Z} - generated by thi.ng/meta-css @ ${(new Date()).toISOString()} */`;var D8={desc:"Transpile & bundle meta stylesheets to CSS",opts:{...w8,...E0,...e,...v0,...N8,eval:p({alias:"e",desc:"eval meta stylesheet in given string (ignores other inputs & includes)"}),force:o({alias:"f",hint:"STR",desc:"CSS classes to force include (wildcards are supported, @-prefix will read from file)",delim:","})},fn:async(X)=>{const Z=b(B0(X.opts.specs),X.logger),J=vX(Z,X.opts.force||[],X.logger);if(X.opts.watch)await RX(X,Z,J);else if(X.opts.eval)Y1(X,Z,J,[X.opts.eval]);else Y1(X,Z,J,X.inputs.map((W)=>A(B0(W),X.logger)))}},RX=async(X,Z,J)=>{let W=!0;const Y=()=>{X.logger.info("closing watchers..."),U.forEach((V)=>V.watcher.close()),W=!1},U=X.inputs.map((V,B)=>{V=B0(V);const Q=z8(A(V,X.logger),{id:`in${P8(B)}`});return{input:Q,watcher:IX(V,{},(q)=>{if(q==="change")try{Q.next(A(V,X.logger))}catch(z){X.logger.warn(z.message),Y()}else X.logger.warn("input removed:",V),Y()})}});M8({src:s0(w(({input:V})=>[V.id,V],U))}).subscribe({next(V){try{Y1(X,Z,J,Object.keys(V).sort().map((B)=>V[B]))}catch(B){X.logger.warn(B.message)}}}),process.on("SIGINT",Y);while(W)await u1(null,250)},Y1=({logger:X,opts:{include:Z,noHeader:J,out:W,pretty:Y}},U,V,B)=>{const Q={logger:X,specs:U,format:Y?w0:t,mediaQueryIDs:new Set(Object.keys(U.media)),mediaQueryRules:{...V.mediaQueryRules},plainRules:{...V.plainRules}},q=Z?Z.map((z)=>A(B0(z),X).trim()):[];if(!J)q.push(_0(U));B.forEach((z)=>_X(z,Q)),EX(q,Q),AX(q,Q),X0(W,q,X)},AX=(X,{logger:Z,specs:J,format:W,mediaQueryRules:Y})=>{for(let U in Y){const V=j8(Y[U],J);Z.debug("mediaquery rules",U,V),X.push(U0(A0(SX(J.media,U),V),{format:W}))}},EX=(X,{logger:Z,specs:J,format:W,plainRules:Y})=>{const U=j8(Y,J);Z.debug("plain rules",U),X.push(U0(U,{format:W}))},vX=(X,Z,J)=>{const W=new Set(Object.keys(X.media)),Y=new Set(Object.keys(X.classes)),U={},V={};if(Z.length&&Z[0][0]==="@")Z=[...m(A(B0(Z[0].substring(1)),J))];for(let B of Z){if(!B||B.startsWith("//"))continue;const{token:Q,query:q}=k8(B,W);let z;if(Q.includes("*")){const K=new RegExp(`^${Q.replace("*",".*")}\$`);z=[...W1(($)=>K.test($),Y)]}else if(Y.has(Q))z=[Q];else{J.warn(`unknown include rule ID: ${B}, skipping...`);continue}for(let K of z)J.debug("including class:",K),q?T8(U,q,`.${K}`,K):I8(V,`.${K}`,K)}return{mediaQueryRules:U,plainRules:V}},_X=(X,{specs:Z,mediaQueryIDs:J,mediaQueryRules:W,plainRules:Y})=>{const U=V0(),V=V0(U),B={root:U,curr:V,scopes:[V]};for(let Q of m(X)){if(!Q||/^\s*\/\//.test(Q))continue;for(let q of m(Q,/\s+/g)){if(!q)continue;let z=B.curr;switch(z.state){case"sel":case"nest":if(q==="{"){if(z.state==="sel")z.sel=z.sel.map((K)=>K.replace(",","")),z.path=bX(B.scopes);z.state="class"}else if(q==="}")O8(B);else{const K=Y0(z.sel);if(!K||K.endsWith(","))z.sel.push(q);else z.sel[z.sel.length-1]+=" "+q}break;case"class":if(q==="{")z.state="nest",B.scopes.push(B.curr=V0(z));else if(q==="}")O8(B);else{let{token:K,query:$}=k8(q,J);if(!Z.classes[K])H(`unknown class ID: ${K}`);if($)T8(W,$,z.path,K);else I8(Y,z.path,K)}break;default:a(z.state)}}}},U1=":",G8="///",V0=(X)=>({state:"sel",sel:X?[]:["<root>"],path:"",parent:X}),O8=(X)=>{const Z=!X.curr.sel.length;if(F0(!!X.curr.parent,"stack underflow"),X.scopes.pop(),X.scopes.length>0){if(X.curr=Y0(X.scopes),!Z&&X.curr.state==="nest")X.scopes.push(X.curr=V0(X.curr))}else X.scopes.push(X.curr=V0(X.root))},bX=(X)=>X.map((Z)=>Z.sel.join(",")).join(G8),j8=(X,Z)=>Object.entries(X).map(([J,W])=>LX(J,W,Z)),LX=(X,Z,J)=>{const W=[];let Y=W;const U=X.split(G8);for(let V=0;V<U.length;V++){const B=U[V].split(",");if(V==U.length-1){const Q=Object.assign({},...w((q)=>J.classes[q],Z));if("__user"in Q)delete Q.__user;B.push(Q)}Y.push(B),Y=B}return W[0]},k8=(X,Z)=>{if(/^::?/.test(X))return{token:X};const J=X.lastIndexOf(U1);if(J<0)return{token:X};const W=X.substring(0,J);if(!W.split(U1).every((U)=>Z.has(U)))H(`invalid media query in token: ${X}`);return{token:X.substring(J+1),query:W}},SX=(X,Z)=>Z.split(U1).reduce((J,W)=>Object.assign(J,X[W]),{}),T8=(X,Z,J,W)=>{if(!X[Z])X[Z]={};(X[Z][J]||(X[Z][J]=new Set)).add(W)},I8=(X,Z,J)=>(X[Z]||(X[Z]=new Set)).add(J);import{resolve as R8} from"path";var E8={desc:"Export entire generated framework as CSS",opts:{...E0,...e,...v0,media:o({alias:"m",desc:"Media query IDs (use 'ALL' for all)",delim:","})},inputs:1,fn:async(X)=>{const{logger:Z,opts:{include:J,media:W,noHeader:Y,pretty:U,out:V},inputs:B}=X,Q=b(R8(B[0]),Z),q=J?J.map((z)=>A(R8(z),Z).trim()):[];if(!Y)q.push(_0(Q));q.push(yX(Q,W,U,Z)),X0(V,q,Z)}},yX=(X,Z,J,W)=>{const Y=A8("",X);if(Z){const U=Z[0]==="ALL"?Object.keys(X.media):Z;for(let V of U)if(X.media[V])Y.push(A0(X.media[V],A8("-"+V,X)));else W.warn(`invalid media query ID: ${V}, skipping...`)}return U0(Y,{format:J?w0:t})},A8=(X,Z)=>Object.entries(Z.classes).map(([J,W])=>[`.${J}${X}`,hX(W)]),hX=(X)=>{if("__user"in X)X={...X},delete X.__user;return X};import{statSync as fX} from"fs";import{resolve as mX} from"path";var v8={deg:U8,em:t1,ex:c1,ms:W8,percent:r0,px:s1,rad:V8,rem:r1,second:Y8,turn:B8,url:Q8,vh:e1,vmax:J8,vmin:Z8,vw:X8,"%":r0},uX={"":[""],a:[""],h:["-left","-right"],v:["-top","-bottom"],t:["-top"],top:["top"],b:["-bottom"],bottom:["bottom"],r:["-right"],right:["right"],l:["-left"],left:["left"],x:["-x"],y:["-y"]},_8={desc:"Generate framework rules from specs",opts:{...e,prec:C1({default:3,desc:"Number of fractional digits"})},inputs:1,fn:async(X)=>{const{logger:Z,opts:{prec:J,out:W,pretty:Y},inputs:U}=X,V=mX(U[0]);if(!fX(V).isDirectory())H(`${V} is not a directory`);const B={info:{name:"TODO",version:"0.0.0"},media:{},classes:{}};a1(J);for(let Q of S1(V,".json")){const q=b(Q,Z);Object.assign(B.info,q.info),Object.assign(B.media,q.media);for(let z of q.specs)gX(q,z,B.classes,Z)}X0(W,JSON.stringify(B,null,Y?4:0),Z)}},gX=(X,Z,J,W)=>{const Y=P(Z.var)?Z.var:[""],U=F(Z.props)?{[Z.props]:"<v>"}:Z.props,V=xX(Z,X),B=new Set;for(let Q of Y)for(let[q,z]of T0(uX[Q],Object.keys(V))){const K=V1(Z.name,Q,q,z,V[z]),$=dX(V[z],Z.unit);if(!J[K])J[K]=Z.user!=null?{__user:Z.user}:{};else if(!B.has(K))H(`duplicate class ID: ${K}`);B.add(K);for(let[v,_]of Object.entries(U)){const f=V1(v,Q,q,z,V[z]),M=V1(!Z.unit||F(_)?_:v8[Z.unit](_),Q,q,z,$);J[K][f]=M,W.debug(K,f,M)}}return J},xX=(X,Z)=>{const J=F(X.values)?Z.tables?.[X.values]||H(`invalid table ID: ${X.values}`):X.values;if(R(J))return J;const W=X.key==="v"?(Y)=>String(Y):X.key==="i1"?(Y,U)=>String(U+1):X.key===void 0?(Y,U)=>String(U):H(`invalid key type: ${X.key}`);return J.reduce((Y,U,V)=>{return Y[W(U,V)]=U,Y},{})},dX=(X,Z)=>{if(!Z||F(X))return X;const J=v8[Z];if(!J)H(`invalid unit: ${Z}`);return J(X)},V1=(X,Z,J,W,Y)=>X.replace("<vid>",Z).replace("<var>",J).replace("<k>",W).replace("<v>",String(Y));var B1=b(nX(import.meta.dir,"package.json"));_1({name:"metacss",opts:{out:p({alias:"o",desc:"Output file (or stdout)"}),verbose:l({alias:"v",desc:"Display extra process information"})},commands:{convert:D8,export:E8,generate:_8},ctx:async(X)=>{if(X.opts.verbose)X.logger.level=C.DEBUG;return{...X,format:H0}},usage:{prefix:`
|
|
2
|
+
var f0={default:95,hint:90,multi:90,param:96,required:33};var m0=(Z)=>Z;var a=function(Z,X){return!X&&(X={}),(...J)=>{const W=JSON.stringify(J);if(W!==void 0)return W in X?X[W]:X[W]=Z.apply(null,J);return Z.apply(null,J)}};var t=a((Z,X)=>Z.repeat(X));var $1=(Z)=>/^[a-f0-9]+$/i.test(Z);var H1=(Z)=>/^[-+]?\d+$/.test(Z),K1=(Z)=>/^[-+]?\d*\.?\d+(e[-+]?\d+)?$/i.test(Z);var T=(Z,X=(J)=>J!==void 0?": "+J:"")=>class extends Error{constructor(J){super(Z(J)+X(J))}};var h5=T(()=>"illegal argument(s)"),K=(Z)=>{throw new h5(Z)};var u0=(Z)=>K1(Z)?parseFloat(Z):K(`not a numeric value: ${Z}`),C1=(Z)=>Z.map(u0),g0=(Z)=>$1(Z)?parseInt(Z,16):K(`not a hex value: ${Z}`),M1=(Z)=>Z.map(g0),x0=(Z)=>H1(Z)?parseInt(Z):K(`not an integer: ${Z}`),F1=(Z)=>Z.map(x0);var M0=(Z,X)=>(J)=>({coerce:Z,hint:X,group:"main",...J}),F0=(Z,X)=>(J)=>({hint:f5(X,J.delim),multi:!0,coerce:Z,group:"main",...J}),f5=(Z,X)=>Z+(X?`[${X}..]`:""),u=(Z)=>({flag:!0,default:!1,group:"flags",...Z}),r=M0(m0,"STR"),c=F0(m0,"STR"),Q4=M0(u0,"NUM"),q4=M0(g0,"HEX"),P1=M0(x0,"INT"),$4=F0(C1,"NUM"),H4=F0(M1,"HEX"),K4=F0(F1,"INT");var C=((Z)=>{return Z[Z.FINE=0]="FINE",Z[Z.DEBUG=1]="DEBUG",Z[Z.INFO=2]="INFO",Z[Z.WARN=3]="WARN",Z[Z.SEVERE=4]="SEVERE",Z[Z.NONE=5]="NONE",Z})(C||{});class d0{id;level;constructor(Z,X=C.FINE){this.id=Z,this.level=typeof X==="string"?C[X]:X}enabled(Z){return this.level<=Z}fine(...Z){this.level<=C.FINE&&this.log(C.FINE,Z)}debug(...Z){this.level<=C.DEBUG&&this.log(C.DEBUG,Z)}info(...Z){this.level<=C.INFO&&this.log(C.INFO,Z)}warn(...Z){this.level<=C.WARN&&this.log(C.WARN,Z)}severe(...Z){this.level<=C.SEVERE&&this.log(C.SEVERE,Z)}}var w1=(Z)=>Z.map((X)=>{if(typeof X==="function")X=X();if(!(typeof X==="string"||typeof X==="number"))X=JSON.stringify(X);return X}).join(" ");class n0 extends d0{constructor(Z,X,J=C.FINE){super(X,J);this.target=Z}log(Z,X){this.target.write(`[${C[Z]}] ${this.id}: ${w1(X)}
|
|
3
|
+
`)}}var P0=a((Z,X=" ")=>{const J=t(String(X),Z);return(W,Y)=>{if(W==null)return J;return W=W.toString(),Y=Y!==void 0?Y:W.length,Y<Z?W+J.substring(Y):W}});var N1=(Z,X)=>{return!X&&(X=new Map),(J)=>{let W;return X.has(J)?X.get(J):(X.set(J,W=Z(J)),W)}};var l0={black:1,blue:5,cyan:7,gray:17,green:3,magenta:6,red:2,white:24,yellow:4,lightBlue:21,lightCyan:23,lightGray:8,lightGreen:19,lightMagenta:22,lightRed:18,lightYellow:20,bgBlack:32,bgBlue:160,bgCyan:224,bgGray:544,bgGreen:96,bgMagenta:192,bgRed:64,bgWhite:768,bgYellow:128,bgLightBlue:672,bgLightCyan:736,bgLightGray:256,bgLightGreen:608,bgLightMagenta:704,bgLightRed:576,bgLightYellow:640};var m5=(Z,X)=>(J)=>Z.format(X,J),p0=(Z)=>Object.keys(l0).reduce((X,J)=>(X[J]=m5(Z,l0[J]),X),{format:Z});var O1="\x1B[0m",u5=["","1","2","1;2","4","1;4","2;4","1;2;4"],w0={format:(Z,X)=>w0.start(Z)+X+w0.end,start:N1((Z)=>{let X=[],J=Z&15;return J&&X.push(29+(Z>>4&1)*60+J),J=Z>>5&15,J&&X.push(39+(Z>>9&1)*60+J),J=Z>>10,J&&X.push(u5[J]),"\x1B["+X.join(";")+"m"}),end:O1,prefix:O1,suffix:"\n"};var D1={format:(Z,X)=>String(X),prefix:"",suffix:"\n",start:()=>"",end:""};var N0=p0(w0),G1=p0(D1);var F=Array.isArray;var g5=(Z)=>Z.toUpperCase(),k1=(Z)=>Z.toLowerCase(),j1=(Z)=>Z.length?Z[0].toUpperCase()+Z.substring(1):Z,T1=(Z,X="-")=>k1(Z.replace(/([a-z0-9\u00e0-\u00fd])([A-Z\u00c0-\u00dd])/g,(J,W,Y)=>W+X+Y));var I1=(Z,X="-")=>k1(Z).replace(new RegExp(`\\${X}+(\\w)`,"g"),(J,W)=>g5(W));var R1=Object.getPrototypeOf,I=(Z)=>{let X;return Z!=null&&typeof Z==="object"&&((X=R1(Z))===null||R1(X)===null)};var x5=/\x1b\[[0-9;]+m/g,d5=(Z)=>Z.replace(x5,"");var O0=(Z)=>d5(Z).length;var A1=(Z=!1,X)=>(J)=>Z||typeof J!=="string"&&typeof J!=="number"?JSON.stringify(J,null,X):String(J);function*g(Z,X=/\r?\n/g,J=!1){let W=0;const Y=Z.length,B=~~J;let U;if(typeof X==="string")U=new RegExp(X,"g");else if(!X.flags.includes("g"))U=new RegExp(X,X.flags+"g");else U=X;for(;W<Y;){const V=U.exec(Z);if(!V){yield Z.substring(W);return}const z=V[0].length;yield Z.substring(W,V.index+B*z),W=V.index+z}}class o0{n=0;w=[];constructor(Z,X){Z!=null&&this.add(Z,X)}add(Z,X=Z.length){return this.w.push(Z),this.n+=X+~~(this.n>0),this}toString(){return this.w.join(" ")}}var n5={length:(Z)=>Z.length,split:(Z,X)=>X},v1={length:O0,split:(Z,X)=>{const J=/\x1b\[[0-9;]+m/g;let W=X,Y;while(Y=J.exec(Z)){if(Y.index>=X)break;const B=Y[0].length;W+=B,X+=B}return W}},E1=(Z,X,J,W)=>{const Y=Z[Z.length-1];Y&&W-Y.n>J?Y.add(X,J):Z.push(new o0(X,J))},l5=(Z,{width:X,min:J,hard:W,splitter:Y},B=0,U=[])=>{let V=Y.length(Z),z=X-B;if(z<J&&z<V)z=X;while(W&&V>z){const q=Y.split(Z,z),Q=Z.substring(0,q);E1(U,Q,z,X),Z=Z.substring(q),z=X,V=Y.length(Z)}return E1(U,Z,V,X),U},p5=(Z,X,J=[])=>{if(!Z.length)return J.push(new o0),J;const W={width:80,min:4,hard:!1,splitter:n5,...X};for(let Y of g(Z,X.delimWord||/\s/g)){const B=J[J.length-1];l5(Y,W,B&&B.n>0?B.n+1:0,J)}return J},_1=(Z,X)=>{let J=[];for(let W of g(Z,X.delimLine))J=J.concat(p5(W,X));return J};var U0=(Z,X={})=>{X={lineWidth:80,paramWidth:32,showDefaults:!0,prefix:"",suffix:"",groups:["flags","main"],...X};const J=I(X.color)?{...f0,...X.color}:X.color?f0:{},W=t(" ",X.paramWidth),Y=(V)=>V.map((z)=>o5(z,Z[z],X,J,W)),B=Object.keys(Z).sort(),U=X.groups?X.groups.map((V)=>[V,B.filter((z)=>Z[z].group===V)]).filter((V)=>!!V[1].length):[["options",B]];return[...i0(X.prefix,X.lineWidth),...U.map(([V,z])=>[...X.showGroupNames?[`${j1(V)}:
|
|
4
|
+
`]:[],...Y(z),""].join("\n")),...i0(X.suffix,X.lineWidth)].join("\n")},o5=(Z,X,J,W,Y)=>{const B=i5(X,W),U=a5(X,W,B),V=V0(`--${T1(Z)}`,W.param),z=`${U}${V}${B}`,q=X.optional===!1&&X.default===void 0,Q=[];q&&Q.push("required"),X.multi&&Q.push("multiple");const $=t5(Q,W,q)+(X.desc||"")+r5(X,J,W);return P0(J.paramWidth)(z,O0(z))+i0($,J.lineWidth-J.paramWidth).map((H,_)=>_>0?Y+H:H).join("\n")},i5=(Z,X)=>Z.hint?V0(" "+Z.hint,X.hint):"",a5=(Z,X,J)=>Z.alias?`${V0("-"+Z.alias,X.param)}${J}, `:"",t5=(Z,X,J)=>Z.length?V0(`[${Z.join(", ")}] `,J?X.required:X.multi):"",r5=(Z,X,J)=>X.showDefaults&&Z.default!=null&&Z.default!==!1?V0(` (default: ${A1(!0)(Z.defaultHint!=null?Z.defaultHint:Z.default)})`,J.default):"",V0=(Z,X)=>X!=null?`\x1B[${X}m${Z}\x1B[0m`:Z,i0=(Z,X)=>Z?_1(Z,{width:X,splitter:v1,hard:!1}):[];var c5=T(()=>"parse error"),b1=(Z,X,J)=>{J={start:2,showUsage:!0,help:["--help","-h"],...J};try{return s5(Z,X,J)}catch(W){if(J.showUsage)console.log(W.message+"\n\n"+U0(Z,J.usageOpts));throw new c5(W.message)}},s5=(Z,X,J)=>{const W=e5(Z),Y={};let B,U,V=J.start;for(;V<X.length;){const z=X[V];if(!B){if(J.help.includes(z)){console.log(U0(Z,J.usageOpts));return}const q=Z8(Z,W,Y,z);if(B=q.id,U=q.spec,V=V+~~(q.state<2),q.state)break}else{if(X8(U,Y,B,z))break;B=null,V++}}return B&&K(`missing value for: --${B}`),{result:J8(Z,Y),index:V,rest:X.slice(V),done:V>=X.length}},e5=(Z)=>Object.entries(Z).reduce((X,[J,W])=>W.alias?(X[W.alias]=J,X):X,{}),Z8=(Z,X,J,W)=>{if(W[0]==="-"){let Y;if(W[1]==="-"){if(W==="--")return{state:1};Y=I1(W.substring(2))}else Y=X[W.substring(1)],!Y&&K(`unknown option: ${W}`);const B=Z[Y];if(!B&&K(Y),B.flag){if(J[Y]=!0,Y=void 0,B.fn&&!B.fn("true"))return{state:1,spec:B}}return{state:0,id:Y,spec:B}}return{state:2}},X8=(Z,X,J,W)=>{if(/^-[a-z]/i.test(W)&&K(`missing value for: --${J}`),Z.multi)F(X[J])?X[J].push(W):X[J]=[W];else X[J]=W;return Z.fn&&!Z.fn(W)},J8=(Z,X)=>{let J;for(let W in Z)if(J=Z[W],X[W]===void 0){if(J.default!==void 0)X[W]=J.default;else if(J.optional===!1)K(`missing arg: --${W}`)}else if(J.coerce)W8(J,X,W);return X},W8=(Z,X,J)=>{try{if(Z.multi&&Z.delim)X[J]=X[J].reduce((W,Y)=>(W.push(...Y.split(Z.delim)),W),[]);X[J]=Z.coerce(X[J])}catch(W){throw new Error(`arg --${J}: ${W.message}`)}};var L1=async(Z)=>{const X=Z.argv||process.argv,J=!process.env.NO_COLOR,W={prefix:"",color:J,...Z.usage};try{let Y,B,U=Z.start??2;if(Z.single){if(Y=Object.keys(Z.commands)[0],!Y)K("no command provided");B=Z.commands[Y]}else{if(Y=X[U],B=Z.commands[Y],W.prefix+=Y8(Z.commands),!B)S1(Z,W);U++}let V;try{V=b1({...Z.opts,...B.opts},X,{showUsage:!0,usageOpts:W,start:U})}catch(q){}if(!V)process.exit(1);if(B.inputs!==void 0&&B.inputs!==V.rest.length)process.stderr.write(`expected ${B.inputs||0} input(s)
|
|
5
|
+
`),S1(Z,W);const z=await Z.ctx({logger:new n0(process.stderr,Z.name,"INFO"),format:J?N0:G1,opts:V.result,inputs:V.rest},B);if(await B.fn(z),Z.post)await Z.post(z,B)}catch(Y){process.stderr.write(Y.message+"\n\n"),process.exit(1)}},S1=(Z,X)=>{process.stderr.write(U0(Z.opts,X)),process.exit(1)},Y8=(Z)=>["\nAvailable commands:\n",...Object.keys(Z).map((X)=>`${P0(16)(X)}: ${Z[X].desc}`),"\n"].join("\n");import{existsSync as B8,mkdirSync as U8,statSync as MZ} from"fs";import{sep as V8} from"path";var y1=(Z)=>{const X=Z.substring(0,Z.lastIndexOf(V8));return X.length>0&&!B8(X)?(U8(X,{recursive:!0}),!0):!1};var v=(Z)=>typeof Z==="function";var P=(Z)=>typeof Z==="string";import{readFileSync as Q8} from"fs";import{writeFileSync as z8} from"fs";var h1=(Z,X,J,W,Y=!1)=>{if(W&&W.info(`${Y?"[dryrun] ":""}writing file: ${Z}`),Y)return;y1(Z),z8(Z,X,!J&&P(X)?"utf-8":J)};var R=(Z,X,J="utf-8")=>{return X&&X.debug("reading file:",Z),Q8(Z,J)},a0=(Z,X,J,W=!1)=>h1(Z,F(X)?X.join("\n"):X,"utf-8",J,W);var L=(Z,X)=>JSON.parse(R(Z,X));var D0=Object.freeze({level:C.NONE,enabled:()=>!1,fine(){},debug(){},info(){},warn(){},severe(){}});import{join as x8} from"path";var q8=T(()=>"Assertion failed"),G0=(typeof process!=="undefined"&&process.env!==void 0?!0:import.meta.env?import.meta.env.MODE!=="production"||!!import.meta.env.UMBRELLA_ASSERTS||!!import.meta.env.VITE_UMBRELLA_ASSERTS:!0)?(Z,X)=>{if(typeof Z==="function"&&!Z()||!Z)throw new q8(typeof X==="function"?X():X)}:()=>{};var k0=(Z)=>Z!=null&&typeof Z!=="function"&&Z.length!==void 0;var f1=(Z)=>{return(Z==null||!Z[Symbol.iterator])&&K(`value is not iterable: ${Z}`),Z};var m1=(Z)=>k0(Z)?Z:[...f1(Z)];var z0=(Z)=>Z[Z.length-1];var $8=T(()=>"illegal arity"),s=(Z)=>{throw new $8(Z)};var H8=T(()=>"illegal state"),e=(Z)=>{throw new H8(Z)};var t0=function(...Z){let[X,J,W,Y,B,U,V,z,q,Q]=Z;switch(Z.length){case 0:s(0);case 1:return X;case 2:return(...H)=>X(J(...H));case 3:return(...H)=>X(J(W(...H)));case 4:return(...H)=>X(J(W(Y(...H))));case 5:return(...H)=>X(J(W(Y(B(...H)))));case 6:return(...H)=>X(J(W(Y(B(U(...H))))));case 7:return(...H)=>X(J(W(Y(B(U(V(...H)))))));case 8:return(...H)=>X(J(W(Y(B(U(V(z(...H))))))));case 9:return(...H)=>X(J(W(Y(B(U(V(z(q(...H)))))))));case 10:default:const $=(...H)=>X(J(W(Y(B(U(V(z(q(Q(...H))))))))));return Z.length===10?$:t0($,...Z.slice(10))}};var u1=(Z,X)=>new Promise((J)=>setTimeout(()=>J(Z),X));var g1=(Z)=>Z;var x1=["-moz-","-ms-","-o-","-webkit-"],x={rules:"",ruleSep:",",valSep:"",decls:"",declStart:"{",declEnd:"}",indent:"",comments:!1},Q0={rules:"\n",ruleSep:", ",valSep:" ",decls:"\n",declStart:" {\n",declEnd:"}\n",indent:" ",comments:!0};var G=(Z)=>Z!=null&&typeof Z[Symbol.iterator]==="function";var j0=(Z,X)=>Z!=null&&typeof Z[X]==="function";var d=(Z)=>j0(Z,"xform")?Z.xform():Z;var y=function(...Z){return Z=Z.map(d),t0.apply(null,Z)};var T0=(Z)=>Z!=null&&typeof Z!=="string"&&typeof Z[Symbol.iterator]==="function";var Z0=(Z,X)=>[Z[0],Z[1],X];var h=Symbol(),r0=()=>{};class c0{value;constructor(Z){this.value=Z}deref(){return this.value}}var k=(Z)=>Z instanceof c0;var f=(Z)=>Z instanceof c0?Z.deref():Z;var I0=function(...Z){const X=Z[0],J=X[0],W=X[1],Y=X[2];Z=K8(Z);const B=Z[0]==null?J():Z[0],U=Z[1];return f(W(j0(U,"$reduce")?U.$reduce(Y,B):k0(U)?C8(Y,B,U):M8(Y,B,U)))};var K8=(Z)=>Z.length===2?[void 0,Z[1]]:Z.length===3?[Z[1],Z[2]]:s(Z.length),C8=(Z,X,J)=>{for(let W=0,Y=J.length;W<Y;W++)if(X=Z(X,J[W]),k(X)){X=X.deref();break}return X},M8=(Z,X,J)=>{for(let W of J)if(X=Z(X,W),k(X)){X=X.deref();break}return X},X0=(Z,X)=>[Z,(J)=>J,X];var R0=function(Z){return Z?[...Z]:X0(()=>[],(X,J)=>(X.push(J),X))};function*A0(Z,X){const J=d(Z)(R0()),W=J[1],Y=J[2];for(let B of X){const U=Y([],B);if(k(U)){yield*f(W(U.deref()));return}if(U.length)yield*U}yield*f(W([]))}function*n(Z,X){const J=d(Z)([r0,r0,(W,Y)=>Y])[2];for(let W of X){let Y=J(h,W);if(k(Y)){if(Y=f(Y.deref()),Y!==h)yield Y;return}if(Y!==h)yield Y}}var E0=(Z,X,J=n)=>{const W=X.length-1;return G(X[W])?X.length>1?J(Z.apply(null,X.slice(0,W)),X[W]):J(Z(),X[0]):void 0};var s0=function(Z,X){return G(X)?A0(s0(Z),P(X)?[X]:X):(J)=>{const W=J[2],Y=(B,U)=>{const V=Z(U);if(V){for(let z of V)if(B=Y(B,z),k(B))break;return B}return W(B,U)};return Z0(J,Y)}};var d1=function(Z){return s0((X)=>T0(X)?X:void 0,Z)};var w=function(Z,X){return G(X)?n(w(Z),X):(J)=>{const W=J[2];return Z0(J,(Y,B)=>W(Y,Z(B)))}};function*v0(...Z){const X=Z.length-1;if(X<0)return;const J=new Array(X+1).fill(0),W=Z.map(m1),Y=W.reduce((B,U)=>B*U.length,1);for(let B=0;B<Y;B++){const U=[];for(let V=X;V>=0;V--){const z=W[V];let q=J[V];if(q===z.length)J[V]=q=0,V>0&&J[V-1]++;U[V]=z[q]}J[X]++,yield U}}function*n1(Z,X=Infinity){while(X-- >0)yield Z}var e0=function(Z,X){Z=Z||"";let J=!0;return X?[...X].join(Z):X0(()=>"",(W,Y)=>(W=J?W+Y:W+Z+Y,J=!1,W))};var _0=function(...Z){return F8(_0,I0,Z)};var F8=(Z,X,J)=>{let W,Y;switch(J.length){case 4:Y=J[3],W=J[2];break;case 3:Y=J[2];break;case 2:return w((B)=>Z(J[0],J[1],B));default:s(J.length)}return X(d(J[0])(J[1]),W,Y)};var P8=new Set,w8=":[",l1=y(d1(),w((Z)=>w8.indexOf(Z.charAt(0))>=0?Z:" "+Z)),N8=(Z,X)=>y(Z,w((J)=>P(J)&&J.indexOf(" .")==0?J+X:J)),J0=(Z,X,J,W)=>{const Y=J.length,B=[];let U,V;const z=(q,Q)=>{let $=null;if(F(Q))J0(Z,Z1(X,B),Q,W);else if(G(Q)&&!P(Q))J0(Z,Z1(X,B),[...Q],W);else if((V=v(Q))||($=W.fns[Q]))if(!X.length){if($)return $.apply(null,J.slice(q+1))(Z,W),!0;Q(Z,W)}else if(V)z(q,Q());else K(`quoted fn ('${Q}') only allowed at head position`);else if(I(Q))U=Object.assign(U||{},Q);else if(Q!=null)B.push(Q)};for(let q=0;q<Y;q++)if(z(q,J[q]))return Z;return U&&Z.push(O8(X,B,U,W)),Z},Z1=(Z,X)=>Z.length?[...v0(Z,X)]:X,O8=(Z,X,J,W)=>{const Y=W.format,B=A(W),U=W.scope?N8(l1,W.scope):l1;return[B,_0(w((V)=>_0(U,e0(),F(V)?V:[V]).trim()),e0(Y.ruleSep),Z1(Z,X)),Y.declStart,q0(J,W),B,Y.declEnd].join("")},q0=(Z,X)=>{const J=X.format,W=X.autoprefix||P8,Y=A(X,X.depth+1),B=[];for(let U in Z)if(Z.hasOwnProperty(U)){let V=Z[U];if(v(V))V=V(Z);if(F(V))V=V.map((z)=>F(z)?z.join(" "):z).join(J.ruleSep);if(W.has(U))for(let z of X.vendors)B.push(`${Y}${z}${U}:${J.valSep}${V};`);B.push(`${Y}${U}:${J.valSep}${V};`)}return B.join(J.decls)+J.decls},A=(Z,X=Z.depth)=>X>1?[...n1(Z.format.indent,X)].join(""):X>0?Z.format.indent:"";var p1=function(Z,...X){const J=X.length===1?X[0]:{0:X[0],100:X[1]};return(W,Y)=>{const B=A(Y);Y.depth++;const U=A(Y);W.push(`${B}@keyframes ${Z}${Y.format.declStart}`);for(let V in J)if(J.hasOwnProperty(V))W.push([U,V+"%",Y.format.declStart,q0(J[V],Y),U,Y.format.declEnd].join(""));return Y.depth--,W.push(B+Y.format.declEnd),W}};var o1=(Z,X=!1)=>(J,W)=>{const Y=A(W),B=A(W,W.depth+1);if(W.format.comments||X)J.push(Y+"/*",Z.split("\n").map((U)=>B+U).join("\n"),Y+"*/");return J};var b0=(Z,X,J)=>(W,Y)=>{const B=A(Y);return W.push(`${B}${Z} ${D8(X)}${Y.format.declStart}`),Y.depth++,J0(W,[],J,Y),Y.depth--,W.push(B+Y.format.declEnd),W},D8=(Z)=>{if(P(Z))return Z;const X=[];for(let J in Z)if(Z.hasOwnProperty(J)){let W=Z[J];if(W===!0)W=i1.has(J)?J:`(${J})`;else if(W===!1)W=`(not ${i1.has(J)?J:`(${J})`})`;else if(W==="only")W+=" "+J;else W=`(${J}:${W})`;X.push(W)}return X.join(" and ")},i1=new Set(["all","print","screen"]);var l=(Z,X)=>{return X={format:x,vendors:x1,fns:{},depth:0,...X},F(X.autoprefix)&&(X.autoprefix=new Set(X.autoprefix)),I(Z)?q0(Z,X):v(Z)?Z([],X).join(X.format.rules):J0([],[],F(Z)?Z:T0(Z)?[...Z]:K("invalid rules"),X).join(X.format.rules)};var a1=(Z,...X)=>(J,W)=>(J.push(X.length?`@import url(${Z}) ${X.join(W.format.ruleSep)};`:`@import url(${Z});`),J);var W0=(Z,X)=>b0("@media",Z,X);var t1=function(...Z){return(X,J)=>(X.push(Z.length>1?`@namespace ${Z[0]} url(${Z[1]});`:`@namespace url(${Z[0]});`),X)};var r1=(Z,X)=>b0("@supports",Z,X);var p={"@comment":o1,"@import":a1,"@keyframes":p1,"@media":W0,"@namespace":t1,"@supports":r1};var c1=4,s1=(Z)=>c1=Z,D=(Z)=>Z===(Z|0)?String(Z):Z.toFixed(c1).replace(/^0./,".").replace(/^-0./,"-.").replace(/0+$/,""),e1=(Z)=>`${D(Z)}em`,Z5=(Z)=>`${D(Z)}ex`,X5=(Z)=>`${D(Z)}rem`,X1=(Z)=>`${D(Z)}%`,J5=(Z)=>`${D(Z)}px`,W5=(Z)=>`${D(Z)}vh`,Y5=(Z)=>`${D(Z)}vw`,B5=(Z)=>`${D(Z)}vmin`,U5=(Z)=>`${D(Z)}vmax`,V5=(Z)=>`${Z|0}ms`,z5=(Z)=>`${D(Z)}s`;var Q5=(Z)=>`${D(Z)}deg`,q5=(Z)=>`${D(Z)}rad`,$5=(Z)=>`${D(Z)}turn`,H5=(Z)=>`url(${Z})`;var N=((Z)=>{return Z[Z.IDLE=0]="IDLE",Z[Z.ACTIVE=1]="ACTIVE",Z[Z.DONE=2]="DONE",Z[Z.UNSUBSCRIBED=3]="UNSUBSCRIBED",Z[Z.ERROR=4]="ERROR",Z})(N||{}),j=((Z)=>{return Z[Z.NEVER=0]="NEVER",Z[Z.FIRST=1]="FIRST",Z[Z.LAST=2]="LAST",Z})(j||{});var G8=0,k8=()=>G8++,o=(Z,X)=>!X||!X.id?{...X,id:Z+"-"+k8()}:X;var O=D0;class m{constructor(Z,X){this.wrapped=Z,X=o("sub",{closeIn:j.LAST,closeOut:j.LAST,cache:!0,...X}),this.parent=X.parent,this.id=X.id,this.closeIn=X.closeIn,this.closeOut=X.closeOut,this.cacheLast=X.cache,X.xform&&(this.xform=X.xform(R0()))}id;closeIn;closeOut;parent;__owner;xform;cacheLast;last=h;state=N.IDLE;subs=[];deref(){return this.last!==h?this.last:void 0}getState(){return this.state}setState(Z){this.state=Z}subscribe(Z,X={}){this.ensureState();let J;if(Z instanceof m&&!X.xform)Z.ensureState(),G0(!Z.parent,`sub '${Z.id}' already has a parent`),Z.parent=this,J=Z;else J=new m(Z,{...X,parent:this});return this.subs.push(J),this.setState(N.ACTIVE),J.setState(N.ACTIVE),this.last!=h&&J.next(this.last),J}transform(...Z){let X,J;if(I(z0(Z)))J=Z.pop(),X={error:J.error};return this.subscribe(X,o("xform",Z.length>0?{...J,xform:y(...Z)}:J))}map(Z,X){return this.transform(w(Z),X||{})}unsubscribe(Z){return Z?this.unsubscribeChild(Z):this.unsubscribeSelf()}unsubscribeSelf(){return O.debug(this.id,"unsub self"),this.parent&&this.parent.unsubscribe(this),this.state<N.UNSUBSCRIBED&&(this.state=N.UNSUBSCRIBED),this.release(),!0}unsubscribeChild(Z){O.debug(this.id,"unsub child",Z.id);const X=this.subs.indexOf(Z);if(X>=0){if(this.subs.splice(X,1),this.closeOut===j.FIRST||!this.subs.length&&this.closeOut!==j.NEVER)this.unsubscribe();return!0}return!1}next(Z){if(this.state>=N.DONE)return;this.xform?this.dispatchXform(Z):this.dispatch(Z)}done(){if(O.debug(this.id,"entering done()"),this.state>=N.DONE)return;if(this.xform){if(!this.dispatchXformDone())return}if(this.state=N.DONE,this.dispatchTo("done"))this.state<N.UNSUBSCRIBED&&this.unsubscribe();O.debug(this.id,"exiting done()")}error(Z){const X=this.wrapped,J=X&&X.error;return J&&O.debug(this.id,"attempting wrapped error handler"),J&&X.error(Z)||this.unhandledError(Z)}unhandledError(Z){return(O!==D0?O:console).warn(this.id,"unhandled error:",Z),this.unsubscribe(),this.state=N.ERROR,!1}dispatchTo(Z,X){let J=this.wrapped;if(J)try{J[Z]&&J[Z](X)}catch(Y){if(!this.error(Y))return!1}const W=Z==="next"?this.subs:[...this.subs];for(let Y=W.length;Y-- >0;){J=W[Y];try{J[Z]&&J[Z](X)}catch(B){if(Z==="error"||!J.error||!J.error(B))return this.unhandledError(B)}}return!0}dispatch(Z){O.debug(this.id,"dispatch",Z),this.cacheLast&&(this.last=Z),this.dispatchTo("next",Z)}dispatchXform(Z){let X;try{X=this.xform[2]([],Z)}catch(J){this.error(J);return}if(this.dispatchXformVals(X))k(X)&&this.done()}dispatchXformDone(){let Z;try{Z=this.xform[1]([])}catch(X){return this.error(X)}return this.dispatchXformVals(Z)}dispatchXformVals(Z){const X=f(Z);for(let J=0,W=X.length;J<W&&this.state<N.DONE;J++)this.dispatch(X[J]);return this.state<N.ERROR}ensureState(){if(this.state>=N.DONE)e(`operation not allowed in state ${this.state}`)}release(){this.subs.length=0,delete this.parent,delete this.xform,delete this.last}}var K5=(Z,X)=>{const J=new C5(X);return J.next(Z),J};class C5 extends m{src;_cancel;_inited;constructor(Z,X){const[J,W]=v(Z)?[Z,X||{}]:[void 0,Z||{}];super(W.error?{error:W.error}:void 0,o("stream",W));this.src=J,this._inited=!1}subscribe(Z,X={}){const J=super.subscribe(Z,X);if(!this._inited){if(this.src)try{this._cancel=this.src(this)||(()=>{return})}catch(W){let Y=this.wrapped;if(!Y||!Y.error||!Y.error(W))this.unhandledError(W)}this._inited=!0}return J}unsubscribe(Z){const X=super.unsubscribe(Z);if(X&&(!Z||(!this.subs||!this.subs.length)&&this.closeOut!==j.NEVER))this.cancel();return X}done(){this.cancel(),super.done(),delete this.src,delete this._cancel}error(Z){if(super.error(Z))return!0;return this.cancel(),!1}cancel(){if(this._cancel){O.debug(this.id,"cancel");const Z=this._cancel;delete this._cancel,Z()}}}var M5=(Z,X)=>Z===j.FIRST||Z===j.LAST&&!X;var J1=function(Z){return Z?I0(J1(),Z):X0(()=>({}),(X,[J,W])=>(X[J]=W,X))};var W1=function(Z,X){return G(X)?n(W1(Z),X):w(v(Z)?(J)=>[Z(J),J]:(J)=>[Z,J])};var Y1=function(...Z){const X=E0(Y1,Z);if(X)return X;const J=Z[0],W=Z[1]!==!1;return w((Y)=>{const B=W?{}:Y;for(let U in Y)B[U]=J(Y[U]);return B})};var B1=function(...Z){const X=E0(B1,Z,A0);if(X)return X;const{key:J,mergeOnly:W,reset:Y,all:B,backPressure:U}={key:g1,mergeOnly:!1,reset:!0,all:!0,backPressure:0,...Z[1]},V=F(Z[0])?new Set(Z[0]):Z[0],z=new Set,q=new Map;let Q={};const $=([H,_,i])=>{let b=!0;if(W||U<1)return[H,(M)=>{if(Y&&B&&z.size>0||!Y&&b)M=i(M,Q),Q={},z.clear(),b=!1;return _(M)},(M,S)=>{const E=J(S);if(V.has(E)){if(Q[E]=S,z.add(E),W||F5(V,z))if(M=i(M,Q),b=!1,Y)Q={},z.clear();else Q={...Q}}return M}];else return[H,(M)=>{if(B&&z.size>0)M=i(M,P5(q,z)),q.clear(),z.clear();return _(M)},(M,S)=>{const E=J(S);if(V.has(E)){let C0=q.get(E);!C0&&q.set(E,C0=[]),C0.length>=U&&e(`max back pressure (${U}) exceeded for input: ${String(E)}`),C0.push(S),z.add(E);while(F5(V,z))if(M=i(M,P5(q,z)),b=!1,k(M))break}return M}]};return $.keys=()=>V,$.clear=()=>{q.clear(),V.clear(),z.clear(),Q={}},$.add=(H)=>{V.add(H)},$.delete=(H,_=!0)=>{if(q.delete(H),V.delete(H),_)z.delete(H),delete Q[H]},$},F5=(Z,X)=>{if(X.size<Z.size)return!1;for(let J of Z)if(!X.has(J))return!1;return!0},P5=(Z,X)=>{const J={};for(let W of X){const Y=Z.get(W);J[W]=Y.shift(),!Y.length&&X.delete(W)}return J};var w5=(Z,X)=>{let J=!0;for(let W of X)J=Z.removeID(W)&&J;return J};var N5=(Z)=>new O5(Z);class O5 extends m{sources;idSources;realSourceIDs;invRealSourceIDs;psync;clean;constructor(Z){const X=B1(new Set,{key:(W)=>W[0],mergeOnly:Z.mergeOnly===!0,reset:Z.reset===!0,all:Z.all!==!1,backPressure:Z.backPressure||0}),J=Y1((W)=>W[1]);super(void 0,o("streamsync",{...Z,xform:Z.xform?y(X,J,Z.xform):y(X,J)}));this.sources=new Map,this.realSourceIDs=new Map,this.invRealSourceIDs=new Map,this.idSources=new Map,this.psync=X,this.clean=!!Z.clean,Z.src&&this.addAll(Z.src)}add(Z,X){X||(X=Z.id),this.ensureState(),this.psync.add(X),this.realSourceIDs.set(X,Z.id),this.invRealSourceIDs.set(Z.id,X),this.idSources.set(Z.id,Z),this.sources.set(Z,Z.subscribe({next:(J)=>J[1]instanceof m?this.add(J[1]):this.next(J),done:()=>this.markDone(Z),__owner:this},{xform:W1(X),id:`in-${X}`}))}addAll(Z){for(let X in Z)this.psync.add(X);for(let X in Z)this.add(Z[X],X)}remove(Z){const X=this.sources.get(Z);if(X){const J=this.invRealSourceIDs.get(Z.id);return O.info(`removing src: ${Z.id} (${J})`),this.psync.delete(J,this.clean),this.realSourceIDs.delete(J),this.invRealSourceIDs.delete(Z.id),this.idSources.delete(Z.id),this.sources.delete(Z),X.unsubscribe(),!0}return!1}removeID(Z){const X=this.getSourceForID(Z);return X?this.remove(X):!1}removeAll(Z){for(let J of Z)this.psync.delete(this.invRealSourceIDs.get(J.id));let X=!0;for(let J of Z)X=this.remove(J)&&X;return X}removeAllIDs(Z){return w5(this,Z)}getSourceForID(Z){return this.idSources.get(this.realSourceIDs.get(Z))}getSources(){const Z={};for(let[X,J]of this.idSources)Z[this.invRealSourceIDs.get(X)]=J;return Z}unsubscribe(Z){if(!Z){O.debug(this.id,"unsub sources");for(let X of this.sources.values())X.unsubscribe();this.sources.clear(),this.psync.clear(),this.realSourceIDs.clear(),this.invRealSourceIDs.clear(),this.idSources.clear()}return super.unsubscribe(Z)}markDone(Z){this.remove(Z),M5(this.closeIn,this.sources.size)&&this.done()}}var U1=a((Z,X=" ")=>{const J=t(String(X),Z);return(W,Y)=>{if(W==null)return J;return W=W.toString(),Y=Y!==void 0?Y:W.length,Y<Z?J.substring(Y)+W:W}}),L2=U1(2,"0"),D5=U1(3,"0"),y2=U1(4,"0");var V1=function(Z,X){return G(X)?n(V1(Z),X):(J)=>{const W=J[2];return Z0(J,(Y,B)=>Z(B)?W(Y,B):Y)}};import{watch as T8} from"fs";import{resolve as H0} from"path";var G5={specs:r({alias:"s",optional:!1,desc:"Path to generated JSON defs"})},S0={include:c({alias:"I",desc:"Include CSS files (prepend)"})},L0={noDecls:u({alias:"d",desc:"Don't emit framework decls"})},Y0={pretty:u({alias:"p",desc:"Pretty print output"})},y0={noHeader:u({desc:"Don't emit generated header comment"})},k5={watch:u({alias:"w",desc:"Watch input files for changes"})};import{resolve as j8} from"path";var B0=(Z,X,J)=>{X=P(X)?X:X.join("\n"),Z?a0(j8(Z),X,J):console.log(X)},h0=({info:{name:Z,version:X}})=>`/*! ${Z} v${X} - generated by thi.ng/meta-css @ ${(new Date()).toISOString()} */`;var T5={desc:"Transpile & bundle meta stylesheets to CSS",opts:{...G5,...S0,...L0,...Y0,...y0,...k5,eval:r({alias:"e",desc:"eval meta stylesheet in given string (ignores other inputs & includes)"}),force:c({alias:"f",hint:"STR",desc:"CSS classes to force include (wildcards are supported, @-prefix will read from file)",delim:","})},fn:async(Z)=>{const X=L(H0(Z.opts.specs),Z.logger),J=E8(X,Z.opts.force||[],Z.logger);if(Z.opts.watch)await I8(Z,X,J);else if(Z.opts.eval)z1(Z,X,J,[Z.opts.eval]);else z1(Z,X,J,Z.inputs.map((W)=>R(H0(W),Z.logger)))}},I8=async(Z,X,J)=>{let W=!0;const Y=()=>{Z.logger.info("closing watchers..."),B.forEach((U)=>U.watcher.close()),W=!1},B=Z.inputs.map((U,V)=>{U=H0(U);const z=K5(R(U,Z.logger),{id:`in${D5(V)}`});return{input:z,watcher:T8(U,{},(q)=>{if(q==="change")try{z.next(R(U,Z.logger))}catch(Q){Z.logger.warn(Q.message),Y()}else Z.logger.warn("input removed:",U),Y()})}});N5({src:J1(w(({input:U})=>[U.id,U],B))}).subscribe({next(U){try{z1(Z,X,J,Object.keys(U).sort().map((V)=>U[V]))}catch(V){Z.logger.warn(V.message)}}}),process.on("SIGINT",Y);while(W)await u1(null,250)},z1=({logger:Z,opts:{include:X,noDecls:J,noHeader:W,out:Y,pretty:B}},U,V,z)=>{const q={logger:Z,specs:U,format:B?Q0:x,mediaQueryIDs:new Set(Object.keys(U.media)),mediaQueryRules:{...V.mediaQueryRules},plainRules:{...V.plainRules}},Q=X?X.map(($)=>R(H0($),Z).trim()):[];if(!W)Q.push(h0(U));if(!J&&U.decls.length)Q.push(l(U.decls,{format:q.format,fns:p}));z.forEach(($)=>v8($,q)),A8(Q,q),R8(Q,q),B0(Y,Q,Z)},R8=(Z,{logger:X,specs:J,format:W,mediaQueryRules:Y})=>{for(let B in Y){const U=R5(Y[B],J);X.debug("mediaquery rules",B,U),Z.push(l(W0(S8(J.media,B),U),{format:W,fns:p}))}},A8=(Z,{logger:X,specs:J,format:W,plainRules:Y})=>{const B=R5(Y,J);X.debug("plain rules",B),Z.push(l(B,{format:W,fns:p}))},E8=(Z,X,J)=>{const W=new Set(Object.keys(Z.media)),Y=new Set(Object.keys(Z.classes)),B={},U={};if(X.length&&X[0][0]==="@")X=[...g(R(H0(X[0].substring(1)),J))];for(let V of X){if(!V||V.startsWith("//"))continue;const{token:z,query:q}=A5(V,W);let Q;if(z.includes("*")){const $=new RegExp(`^${z.replace("*",".*")}\$`);Q=[...V1((H)=>$.test(H),Y)]}else if(Y.has(z))Q=[z];else{J.warn(`unknown include rule ID: ${V}, skipping...`);continue}for(let $ of Q)J.debug("including class:",$),q?E5(B,q,`.${$}`,$):v5(U,`.${$}`,$)}return{mediaQueryRules:B,plainRules:U}},v8=(Z,{specs:X,mediaQueryIDs:J,mediaQueryRules:W,plainRules:Y})=>{const B=$0(),U=$0(B),V={root:B,curr:U,scopes:[U]};for(let z of g(Z)){if(!z||/^\s*\/\//.test(z))continue;for(let q of g(z,/\s+/g)){if(!q)continue;let Q=V.curr;switch(Q.state){case"sel":case"nest":if(q==="{"){if(Q.state==="sel")Q.sel=Q.sel.map(($)=>$.replace(",","")),Q.path=_8(V.scopes);Q.state="class"}else if(q==="}")j5(V);else{const $=z0(Q.sel);if(!$||$.endsWith(","))Q.sel.push(q);else Q.sel[Q.sel.length-1]+=" "+q}break;case"class":if(q==="{")Q.state="nest",V.scopes.push(V.curr=$0(Q));else if(q==="}")j5(V);else{let{token:$,query:H}=A5(q,J);if(!X.classes[$])K(`unknown class ID: ${$}`);if(H)E5(W,H,Q.path,$);else v5(Y,Q.path,$)}break;default:e(Q.state)}}}},Q1=":",I5="///",$0=(Z)=>({state:"sel",sel:Z?[]:["<root>"],path:"",parent:Z}),j5=(Z)=>{const X=!Z.curr.sel.length;if(G0(!!Z.curr.parent,"stack underflow"),Z.scopes.pop(),Z.scopes.length>0){if(Z.curr=z0(Z.scopes),!X&&Z.curr.state==="nest")Z.scopes.push(Z.curr=$0(Z.curr))}else Z.scopes.push(Z.curr=$0(Z.root))},_8=(Z)=>Z.map((X)=>X.sel.join(",")).join(I5),R5=(Z,X)=>Object.entries(Z).map(([J,W])=>b8(J,W,X)),b8=(Z,X,J)=>{const W=[];let Y=W;const B=Z.split(I5);for(let U=0;U<B.length;U++){const V=B[U].split(",");if(U==B.length-1){const z=Object.assign({},...w((q)=>J.classes[q],X));if("__user"in z)delete z.__user;V.push(z)}Y.push(V),Y=V}return W[0]},A5=(Z,X)=>{if(/^::?/.test(Z))return{token:Z};const J=Z.lastIndexOf(Q1);if(J<0)return{token:Z};const W=Z.substring(0,J);if(!W.split(Q1).every((B)=>X.has(B)))K(`invalid media query in token: ${Z}`);return{token:Z.substring(J+1),query:W}},S8=(Z,X)=>X.split(Q1).reduce((J,W)=>Object.assign(J,Z[W]),{}),E5=(Z,X,J,W)=>{if(!Z[X])Z[X]={};(Z[X][J]||(Z[X][J]=new Set)).add(W)},v5=(Z,X,J)=>(Z[X]||(Z[X]=new Set)).add(J);import{resolve as _5} from"path";var S5={desc:"Export entire generated framework as CSS",opts:{...S0,...L0,...Y0,...y0,media:c({alias:"m",hint:"ID",desc:"Media query IDs (use 'ALL' for all)",delim:","})},inputs:1,fn:async(Z)=>{const{logger:X,opts:{include:J,media:W,noDecls:Y,noHeader:B,pretty:U,out:V},inputs:z}=Z,q=L(_5(z[0]),X),Q=J?J.map(($)=>R(_5($),X).trim()):[];if(!B)Q.push(h0(q));if(!Y&&q.decls.length)Q.push(l(q.decls,{format:U?Q0:x,fns:p}));Q.push(L8(q,W,U,X)),B0(V,Q,X)}},L8=(Z,X,J,W)=>{const Y=b5("",Z);if(X){const B=X[0]==="ALL"?Object.keys(Z.media):X;for(let U of B)if(Z.media[U])Y.push(W0(Z.media[U],b5("-"+U,Z)));else W.warn(`invalid media query ID: ${U}, skipping...`)}return l(Y,{format:J?Q0:x,fns:p})},b5=(Z,X)=>Object.entries(X.classes).map(([J,W])=>[`.${J}${Z}`,y8(W)]),y8=(Z)=>{if("__user"in Z)Z={...Z},delete Z.__user;return Z};import{resolve as h8} from"path";var L5={deg:Q5,em:e1,ex:Z5,ms:V5,percent:X1,px:J5,rad:q5,rem:X5,second:z5,turn:$5,url:H5,vh:W5,vmax:U5,vmin:B5,vw:Y5,"%":X1},f8={"":[""],a:[""],h:["-left","-right"],v:["-top","-bottom"],t:["-top"],top:["top"],b:["-bottom"],bottom:["bottom"],r:["-right"],right:["right"],l:["-left"],left:["left"],x:["-x"],y:["-y"]},y5={desc:"Generate framework rules from specs",opts:{...Y0,prec:P1({default:3,desc:"Number of fractional digits"})},fn:async(Z)=>{const{logger:X,opts:{prec:J,out:W,pretty:Y},inputs:B}=Z,U={info:{name:"TODO",version:"0.0.0"},media:{},classes:{},decls:[]};s1(J);for(let V of B){const z=L(h8(V),X);if(Object.assign(U.info,z.info),Object.assign(U.media,z.media),z.decls)U.decls.push(...z.decls);for(let q of z.specs)m8(z,q,U.classes,X)}B0(W,JSON.stringify(U,null,Y?4:0),X)}},m8=(Z,X,J,W)=>{const Y=F(X.var)?X.var:[""],B=P(X.props)?{[X.props]:"<v>"}:X.props,U=u8(X,Z),V=new Set;for(let z of Y)for(let[q,Q]of v0(Z.vars?.[z]||f8[z],Object.keys(U))){const $=K0(X.name,z,q,Q,U[Q]),H=X.unit?K0(X.unit,z,q,Q,U[Q]):void 0,_=g8(U[Q],H);if(!J[$])J[$]=X.user!=null?{__user:K0(X.user,z,q,Q,U[Q])}:{};else if(!V.has($))K(`duplicate class ID: ${$}`);V.add($);for(let[i,b]of Object.entries(B)){const M=K0(i,z,q,Q,U[Q]),S=K0(!H||P(b)?String(b):L5[H](b),z,q,Q,_);J[$][M]=S,W.debug($,M,S)}}return J},u8=(Z,X)=>{const J=P(Z.values)?X.tables?.[Z.values]||K(`invalid table ID: ${Z.values}`):Z.values;if(I(J))return J;const W=Z.key==="v"?(Y)=>String(Y):Z.key==="i1"?(Y,B)=>String(B+1):Z.key===void 0?(Y,B)=>String(B):K(`invalid key type: ${Z.key}`);return J.reduce((Y,B,U)=>{return Y[W(B,U)]=B,Y},{})},g8=(Z,X)=>{if(!X||P(Z))return Z;const J=L5[X];if(!J)K(`invalid unit: ${X}`);return J(Z)},K0=(Z,X,J,W,Y)=>Z.replace("<vid>",X).replace("<var>",J).replace("<k>",W).replace("<v>",String(Y));var q1=L(x8(import.meta.dir,"package.json"));L1({name:"metacss",opts:{out:r({alias:"o",desc:"Output file (or stdout)"}),verbose:u({alias:"v",desc:"Display extra process information"})},commands:{convert:T5,export:S5,generate:y5},ctx:async(Z)=>{if(Z.opts.verbose)Z.logger.level=C.DEBUG;return{...Z,format:N0}},usage:{prefix:`
|
|
6
6
|
\u2588 \u2588 \u2588 \u2502
|
|
7
7
|
\u2588\u2588 \u2588 \u2502
|
|
8
|
-
\u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2502 ${
|
|
9
|
-
\u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2502 ${
|
|
8
|
+
\u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2502 ${q1.name} ${q1.version}
|
|
9
|
+
\u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2502 ${q1.description}
|
|
10
10
|
\u2588 \u2502
|
|
11
11
|
\u2588 \u2588 \u2502
|
|
12
12
|
|