@thi.ng/meta-css 0.5.1 → 0.6.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2023-12-31T09:44:23Z
3
+ - **Last updated**: 2024-01-23T15:58:26Z
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,20 @@ 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.6.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.6.0) (2024-01-23)
13
+
14
+ #### 🚀 Features
15
+
16
+ - update .mcss syntax, support var assignments ([468c9c5](https://github.com/thi-ng/umbrella/commit/468c9c5))
17
+ - update syntax to support `varname=value` assignments (incl. media prefixes)
18
+ - add tests
19
+ - add --only-decls option for export cmd ([ef8ef65](https://github.com/thi-ng/umbrella/commit/ef8ef65))
20
+ - update/add/rename commands ([3628c4c](https://github.com/thi-ng/umbrella/commit/3628c4c))
21
+ - rename `convert` => `bundle`
22
+ - add new `convert` command to transpile individual stylesheets
23
+ - update CLI arg specs/re-use
24
+ - merge bundle & convert cmds ([a2187cb](https://github.com/thi-ng/umbrella/commit/a2187cb))
25
+
12
26
  ### [0.5.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/meta-css@0.5.1) (2023-12-31)
13
27
 
14
28
  #### ♻️ Refactoring
package/README.md CHANGED
@@ -22,6 +22,7 @@ anti-framework.
22
22
  - [Properties](#properties)
23
23
  - [Key value generation](#key-value-generation)
24
24
  - [Media query definitions](#media-query-definitions)
25
+ - [Custom declarations](#custom-declarations)
25
26
  - [Converting meta stylesheets to CSS](#converting-meta-stylesheets-to-css)
26
27
  - [Meta-stylesheets syntax](#meta-stylesheets-syntax)
27
28
  - [Class identifiers & media query prefixes](#class-identifiers--media-query-prefixes)
@@ -79,10 +80,11 @@ parametric JSON rule specs. This process generates all desired, combinatorial
79
80
  versions of various rules/declarations and exports them to a framework JSON file
80
81
  used as intermediary stage for the other commands provided by this toolchain.
81
82
  The [syntax/format of the generator rules](#framework-generation-specs--syntax)
82
- is explained further on. These rule specs can be split up into multiple files
83
- for better handling, can define [arbitrary media query
84
- criteria](#media-query-definitions) (all later combinable), shared lookup tables
85
- for colors, margins, sizes, timings etc.
83
+ is explained further on. These framework specs can be split up into multiple
84
+ files for better handling and organization, can define [CSS base
85
+ declarations](#custom-declarations) (e.g. for normalization purposes),
86
+ [arbitrary media query criteria](#media-query-definitions) (all later
87
+ combinable), shared lookup tables for colors, margins, sizes, timings etc.
86
88
 
87
89
  The package includes dozens of generator specs for a basic, fully customizable,
88
90
  Tachyons-derived [CSS framework](#bundled-css-base-framework). These specs and
@@ -457,16 +459,37 @@ ALWAYS combined using `and`:
457
459
  See [media queries in the bundled base
458
460
  specs](https://github.com/thi-ng/umbrella/blob/982fff7bfcc48f108b6ad88f854ef00be4078510/packages/meta-css/specs/_info.json#L6-L24)
459
461
 
462
+ ### Custom declarations
463
+
464
+ Each of the JSON spec files can provide fixed CSS declarations via the `decls`
465
+ key. These declarations are to be given in
466
+ [thi.ng/hiccup-css](https://github.com/thi-ng/umbrella/blob/develop/packages/hiccup-css/)
467
+ format and are passed as is to the CSS serializer used by the `convert` and
468
+ `export` commands. Please see
469
+ [`/specs/normalize.mcss.json`](https://github.com/thi-ng/umbrella/blob/develop/packages/meta-css/specs/normalize.mcss.json)
470
+ for examples and the [thi.ng/hiccup-css
471
+ readme](https://github.com/thi-ng/umbrella/blob/develop/packages/hiccup-css/README.md)
472
+ for detailed reference.
473
+
474
+ ```json
475
+ {
476
+ "decls": [
477
+ [":root", { "font-size": "16px" }],
478
+ ["*", { "margin": 0 }]
479
+ ]
480
+ }
481
+ ```
482
+
460
483
  ## Converting meta stylesheets to CSS
461
484
 
462
485
  The `convert` command is used to compile & bundle actual CSS from user-provided
463
- MetaCSS stylesheets (`*.mcss` files) and the JSON framework specs created by the
486
+ MetaCSS stylesheets (`.mcss` files) and the JSON framework specs created by the
464
487
  `generate` command. The meta-stylesheets support any CSS selectors, are nestable
465
488
  and compose full CSS declarations from lists of the utility classes in the
466
489
  generated framework.
467
490
 
468
491
  Each item (aka utility class name) can be prefixed with an arbitrary number of
469
- media query IDs (also custom defined in the framework): e.g. `dark:bg-black`
492
+ media query IDs (also custom defined in the framework): e.g. `dark:bg-color-black`
470
493
  might refer to a CSS class to set a black ground, with the `dark:` prefix
471
494
  referring to a defined media query which only applies this class when dark mode
472
495
  is enabled...
@@ -477,8 +500,7 @@ rules** and can be generated in minified or pretty printed formats (it's also
477
500
  possible to [force include CSS classes which are otherwise
478
501
  unreferenced](#force-inclusion-of-unreferenced-classes)). Additionally, multiple
479
502
  `.mcss` stylesheets can be watched for changes (their definitions getting
480
- merged), and existing CSS files can be included (prepended) in the bundled
481
- output too.
503
+ merged), and existing CSS files can be included (prepended) in the output(s) too.
482
504
 
483
505
  ```text
484
506
  metacss convert --help
@@ -487,8 +509,10 @@ Usage: metacss convert [opts] input [...]
487
509
 
488
510
  Flags:
489
511
 
512
+ -b, --bundle Bundle inputs (see `out` option)
490
513
  -d, --no-decls Don't emit framework decls
491
514
  --no-header Don't emit generated header comment
515
+ --no-write Don't write files, use stdout only
492
516
  -p, --pretty Pretty print output
493
517
  -v, --verbose Display extra process information
494
518
  -w, --watch Watch input files for changes
@@ -504,6 +528,16 @@ Main:
504
528
  -s STR, --specs STR [required] Path to generated JSON defs
505
529
  ```
506
530
 
531
+ Notes:
532
+
533
+ - The `--no-write` flag is only used if `--bundle` is **disabled**
534
+ - The `--out` file arg is only used if `--bundle` is **enabled**
535
+
536
+ If bundling is disabled (default), each input `.mcss` file is converted
537
+ individually and results are written to the same directory, but using `.css` as
538
+ file extension (and unless `--no-write` is enabled). This behavior is intended
539
+ for local style definitions of web components.
540
+
507
541
  ### Meta-stylesheets syntax
508
542
 
509
543
  As mentioned earlier, the `convert` command transpiles meta-stylesheets into
@@ -527,7 +561,7 @@ selector {
527
561
 
528
562
  #### Class identifiers & media query prefixes
529
563
 
530
- As indicated by the above file structure, `*.mcss` stylesheets purely consist of
564
+ As indicated by the above file structure, `.mcss` stylesheets purely consist of
531
565
  CSS selectors and the names of the utility classes defined in a generated framework.
532
566
  For example, using the [bundled framework specs](#bundled-css-base-framework),
533
567
  this simple meta-stylesheet `body { ma0 monospace blue }` creates a CSS rule for
@@ -549,7 +583,7 @@ class, and any utility class ID/token can be prefixed with any number of media
549
583
  query IDs (separated by `:`). These [media queries are defined as part of the
550
584
  framework generation specs](#media-query-definitions) and when used as a prefix,
551
585
  multiple query IDs can be combined freely. For example, the meta-stylesheet
552
- `a:hover { dark:bg-blue dark:anim:bg-anim2 }` will auto-create two separate CSS
586
+ `a:hover { dark:bg-color-blue dark:anim:bg-anim2 }` will auto-create two separate CSS
553
587
  `@media`-query blocks for the query IDs `dark` and `(dark AND anim)`:
554
588
 
555
589
  ```css
@@ -575,21 +609,21 @@ body {
575
609
  // no margins
576
610
  ma0
577
611
  // default colors
578
- bg-white black
612
+ bg-color-white color-black
579
613
  // colors for dark mode
580
- dark:bg-black dark:white
614
+ dark:bg-color-black dark:color-white
581
615
  }
582
616
 
583
617
  #app { ma3 }
584
618
 
585
619
  .bt-group-v > a {
586
620
  db w-100 l:w-50 ph3 pv2 bwb1
587
- dark:bg-purple dark:white dark:b--black
588
- light:bg-light-blue light:black light:b--white
621
+ dark:bg-color-purple dark:color-white dark:b--color-black
622
+ light:bg-color-light-blue light:color-black light:b--color-white
589
623
 
590
624
  // nested selectors
591
625
  {
592
- :hover { bg-gold black anim:bg-anim2 }
626
+ :hover { bg-color-gold color-black anim:bg-anim2 }
593
627
  :first-child { brt3 }
594
628
  :last-child { brb3 bwb0 }
595
629
  }
@@ -737,23 +771,13 @@ framework generation aspects of this toolchain. This command merely takes an
737
771
  existing generated framework JSON file and serializes it to a single CSS file,
738
772
  e.g. to be then used with other CSS tooling (e.g. `postcss`).
739
773
 
740
- ### Media query variations
741
-
742
- Users can choose to generate variations of all defined utility classes for any
743
- of the framework-defined media query IDs. This will create additional suffixed
744
- versions of all classes (with their appropriate media query wrappers) and cause
745
- a potentially massive output (depending on the overall number/complexity of the
746
- generated classes). Again, the idea is that the resulting CSS file will be
747
- post-processed with 3rd party CSS tooling...
748
-
749
- For example, if the framework contains a CSS class `w-50` (e.g. to set the width
750
- to 50%) and media queries for different screen sizes (e.g. named `ns`, `l`),
751
- then the export with said media queries will also generate classes `w-50-ns`
752
- and `w-50-l` (incl. their corresponding `@media` wrappers).
753
-
754
774
  As with the `convert` command, additional CSS files can also be included
755
775
  (prepended) in the output file.
756
776
 
777
+ If the `--only-decls` option is used, **only** the [framework
778
+ declarations](#custom-declarations) but none of the generated utility classes
779
+ will be exported.
780
+
757
781
  ```text
758
782
  metacss export --help
759
783
 
@@ -763,6 +787,7 @@ Flags:
763
787
 
764
788
  -d, --no-decls Don't emit framework decls
765
789
  --no-header Don't emit generated header comment
790
+ --only-decls Only emit framework decls
766
791
  -p, --pretty Pretty print output
767
792
  -v, --verbose Display extra process information
768
793
 
@@ -773,11 +798,25 @@ Main:
773
798
  -o STR, --out STR Output file (or stdout)
774
799
  ```
775
800
 
801
+ ### Media query variations
802
+
803
+ Users can choose to generate variations of all defined utility classes for any
804
+ of the framework-defined media query IDs. This will create additional suffixed
805
+ versions of all classes (with their appropriate media query wrappers) and cause
806
+ a potentially massive output (depending on the overall number/complexity of the
807
+ generated classes). Again, the idea is that the resulting CSS file will be
808
+ post-processed with 3rd party CSS tooling...
809
+
810
+ For example, if the framework contains a CSS class `w-50` (e.g. to set the width
811
+ to 50%) and media queries for different screen sizes (e.g. named `ns`, `l`),
812
+ then the export with said media queries will also generate classes `w-50-ns`
813
+ and `w-50-l` (incl. their corresponding `@media` wrappers).
814
+
776
815
  ## Bundled CSS base framework
777
816
 
778
- The package includes a large number of useful specs in [/specs](https://github.com/thi-ng/umbrella/blob/develop/packages/meta-css/specs/). These are provided as starting point to define your custom framework(s)...
817
+ The package includes a large number of useful specs in [/specs](https://github.com/thi-ng/umbrella/blob/develop/packages/meta-css/specs/). These are readily usable, but also are provided as starting point to define your own custom framework(s)...
779
818
 
780
- Currently available CSS classes in MetaCSS base v0.0.1:
819
+ Currently, there are 940 CSS utility classes defined in MetaCSS base v0.0.1:
781
820
 
782
821
  ### Classes by category
783
822
 
@@ -787,11 +826,11 @@ Currently available CSS classes in MetaCSS base v0.0.1:
787
826
 
788
827
  #### Animations / transitions <!-- notoc -->
789
828
 
790
- `bg-anim1` / `bg-anim2` / `bg-anim3` / `fadein1` / `fadein2` / `fadein3`
829
+ `anim-alternate` / `anim-alternate-reverse` / `anim-normal` / `anim-reverse` / `bg-anim1` / `bg-anim2` / `bg-anim3` / `fadein1` / `fadein2` / `fadein3` / `fadeout1` / `fadeout2` / `fadeout3` / `spin1` / `spin2` / `spin3`
791
830
 
792
831
  #### Aspect ratios <!-- notoc -->
793
832
 
794
- `aspect-ratio-16x9` / `aspect-ratio-1x1` / `aspect-ratio-3x4` / `aspect-ratio-4x3` / `aspect-ratio-4x6` / `aspect-ratio-6x4` / `aspect-ratio-9x16` / `aspect-ratio-object`
833
+ `aspect-ratio-1x1` / `aspect-ratio-1x2` / `aspect-ratio-2x1` / `aspect-ratio-2x3` / `aspect-ratio-3x2` / `aspect-ratio-3x4` / `aspect-ratio-4x3` / `aspect-ratio-5x7` / `aspect-ratio-7x5` / `aspect-ratio-9x16` / `aspect-ratio-16x9` / `bg-aspect-ratio-1x1` / `bg-aspect-ratio-1x2` / `bg-aspect-ratio-2x1` / `bg-aspect-ratio-2x3` / `bg-aspect-ratio-3x2` / `bg-aspect-ratio-3x4` / `bg-aspect-ratio-4x3` / `bg-aspect-ratio-5x7` / `bg-aspect-ratio-7x5` / `bg-aspect-ratio-9x16` / `bg-aspect-ratio-16x9` / `bg-aspect-ratio-object`
795
834
 
796
835
  #### Background <!-- notoc -->
797
836
 
@@ -799,15 +838,19 @@ Currently available CSS classes in MetaCSS base v0.0.1:
799
838
 
800
839
  #### Border radius <!-- notoc -->
801
840
 
802
- `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`
841
+ `br0` / `br1` / `br2` / `br3` / `br4` / `br-100` / `br-pill` / `brb0` / `brb1` / `brb2` / `brb3` / `brb4` / `brl0` / `brl1` / `brl2` / `brl3` / `brl4` / `brr0` / `brr1` / `brr2` / `brr3` / `brr4` / `brt0` / `brt1` / `brt2` / `brt3` / `brt4`
803
842
 
804
843
  #### Border width <!-- notoc -->
805
844
 
806
- `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`
845
+ `bw0` / `bw1` / `bw2` / `bw3` / `bw4` / `bw5` / `bw-1px` / `bwb0` / `bwb1` / `bwb2` / `bwb3` / `bwb4` / `bwb5` / `bwb-1px` / `bwl0` / `bwl1` / `bwl2` / `bwl3` / `bwl4` / `bwl5` / `bwl-1px` / `bwr0` / `bwr1` / `bwr2` / `bwr3` / `bwr4` / `bwr5` / `bwr-1px` / `bwt0` / `bwt1` / `bwt2` / `bwt3` / `bwt4` / `bwt5` / `bwt-1px`
807
846
 
808
847
  #### Colors <!-- notoc -->
809
848
 
810
- `b--black` / `b--blue` / `b--current` / `b--dark-blue` / `b--dark-gray` / `b--dark-green` / `b--dark-pink` / `b--dark-red` / `b--gold` / `b--gray` / `b--green` / `b--hot-pink` / `b--light-blue` / `b--light-gray` / `b--light-green` / `b--light-pink` / `b--light-purple` / `b--light-red` / `b--light-silver` / `b--light-yellow` / `b--lightest-blue` / `b--mid-gray` / `b--moon-gray` / `b--navy` / `b--near-black` / `b--near-white` / `b--orange` / `b--pink` / `b--purple` / `b--red` / `b--silver` / `b--transparent` / `b--vcol1` / `b--vcol10` / `b--vcol11` / `b--vcol12` / `b--vcol13` / `b--vcol14` / `b--vcol15` / `b--vcol16` / `b--vcol2` / `b--vcol3` / `b--vcol4` / `b--vcol5` / `b--vcol6` / `b--vcol7` / `b--vcol8` / `b--vcol9` / `b--washed-blue` / `b--washed-green` / `b--washed-red` / `b--washed-yellow` / `b--white` / `b--yellow` / `bg-black` / `bg-blue` / `bg-current` / `bg-dark-blue` / `bg-dark-gray` / `bg-dark-green` / `bg-dark-pink` / `bg-dark-red` / `bg-gold` / `bg-gray` / `bg-green` / `bg-hot-pink` / `bg-light-blue` / `bg-light-gray` / `bg-light-green` / `bg-light-pink` / `bg-light-purple` / `bg-light-red` / `bg-light-silver` / `bg-light-yellow` / `bg-lightest-blue` / `bg-mid-gray` / `bg-moon-gray` / `bg-navy` / `bg-near-black` / `bg-near-white` / `bg-orange` / `bg-pink` / `bg-purple` / `bg-red` / `bg-silver` / `bg-transparent` / `bg-vcol1` / `bg-vcol10` / `bg-vcol11` / `bg-vcol12` / `bg-vcol13` / `bg-vcol14` / `bg-vcol15` / `bg-vcol16` / `bg-vcol2` / `bg-vcol3` / `bg-vcol4` / `bg-vcol5` / `bg-vcol6` / `bg-vcol7` / `bg-vcol8` / `bg-vcol9` / `bg-washed-blue` / `bg-washed-green` / `bg-washed-red` / `bg-washed-yellow` / `bg-white` / `bg-yellow` / `black` / `blue` / `current` / `dark-blue` / `dark-gray` / `dark-green` / `dark-pink` / `dark-red` / `fill-black` / `fill-blue` / `fill-current` / `fill-dark-blue` / `fill-dark-gray` / `fill-dark-green` / `fill-dark-pink` / `fill-dark-red` / `fill-gold` / `fill-gray` / `fill-green` / `fill-hot-pink` / `fill-light-blue` / `fill-light-gray` / `fill-light-green` / `fill-light-pink` / `fill-light-purple` / `fill-light-red` / `fill-light-silver` / `fill-light-yellow` / `fill-lightest-blue` / `fill-mid-gray` / `fill-moon-gray` / `fill-navy` / `fill-near-black` / `fill-near-white` / `fill-orange` / `fill-pink` / `fill-purple` / `fill-red` / `fill-silver` / `fill-transparent` / `fill-vcol1` / `fill-vcol10` / `fill-vcol11` / `fill-vcol12` / `fill-vcol13` / `fill-vcol14` / `fill-vcol15` / `fill-vcol16` / `fill-vcol2` / `fill-vcol3` / `fill-vcol4` / `fill-vcol5` / `fill-vcol6` / `fill-vcol7` / `fill-vcol8` / `fill-vcol9` / `fill-washed-blue` / `fill-washed-green` / `fill-washed-red` / `fill-washed-yellow` / `fill-white` / `fill-yellow` / `gold` / `gray` / `green` / `hot-pink` / `light-blue` / `light-gray` / `light-green` / `light-pink` / `light-purple` / `light-red` / `light-silver` / `light-yellow` / `lightest-blue` / `mid-gray` / `moon-gray` / `navy` / `near-black` / `near-white` / `o-0` / `o-10` / `o-100` / `o-20` / `o-30` / `o-40` / `o-50` / `o-60` / `o-70` / `o-80` / `o-90` / `orange` / `pink` / `purple` / `red` / `silver` / `stroke-black` / `stroke-blue` / `stroke-current` / `stroke-dark-blue` / `stroke-dark-gray` / `stroke-dark-green` / `stroke-dark-pink` / `stroke-dark-red` / `stroke-gold` / `stroke-gray` / `stroke-green` / `stroke-hot-pink` / `stroke-light-blue` / `stroke-light-gray` / `stroke-light-green` / `stroke-light-pink` / `stroke-light-purple` / `stroke-light-red` / `stroke-light-silver` / `stroke-light-yellow` / `stroke-lightest-blue` / `stroke-mid-gray` / `stroke-moon-gray` / `stroke-navy` / `stroke-near-black` / `stroke-near-white` / `stroke-orange` / `stroke-pink` / `stroke-purple` / `stroke-red` / `stroke-silver` / `stroke-transparent` / `stroke-vcol1` / `stroke-vcol10` / `stroke-vcol11` / `stroke-vcol12` / `stroke-vcol13` / `stroke-vcol14` / `stroke-vcol15` / `stroke-vcol16` / `stroke-vcol2` / `stroke-vcol3` / `stroke-vcol4` / `stroke-vcol5` / `stroke-vcol6` / `stroke-vcol7` / `stroke-vcol8` / `stroke-vcol9` / `stroke-washed-blue` / `stroke-washed-green` / `stroke-washed-red` / `stroke-washed-yellow` / `stroke-white` / `stroke-yellow` / `transparent` / `vcol1` / `vcol10` / `vcol11` / `vcol12` / `vcol13` / `vcol14` / `vcol15` / `vcol16` / `vcol2` / `vcol3` / `vcol4` / `vcol5` / `vcol6` / `vcol7` / `vcol8` / `vcol9` / `washed-blue` / `washed-green` / `washed-red` / `washed-yellow` / `white` / `yellow`
849
+ `b--color-black` / `b--color-blue` / `b--color-current` / `b--color-dark-blue` / `b--color-dark-gray` / `b--color-dark-green` / `b--color-dark-pink` / `b--color-dark-red` / `b--color-gold` / `b--color-gray` / `b--color-green` / `b--color-hot-pink` / `b--color-light-blue` / `b--color-light-gray` / `b--color-light-green` / `b--color-light-pink` / `b--color-light-purple` / `b--color-light-red` / `b--color-light-silver` / `b--color-light-yellow` / `b--color-lightest-blue` / `b--color-mid-gray` / `b--color-moon-gray` / `b--color-navy` / `b--color-near-black` / `b--color-near-white` / `b--color-orange` / `b--color-pink` / `b--color-purple` / `b--color-red` / `b--color-silver` / `b--color-transparent` / `b--color-washed-blue` / `b--color-washed-green` / `b--color-washed-red` / `b--color-washed-yellow` / `b--color-white` / `b--color-yellow` / `b--color1` / `b--color2` / `b--color3` / `b--color4` / `b--color5` / `b--color6` / `b--color7` / `b--color8` / `b--color9` / `b--color10` / `b--color11` / `b--color12` / `b--color13` / `b--color14` / `b--color15` / `b--color16` / `bg-color-black` / `bg-color-blue` / `bg-color-current` / `bg-color-dark-blue` / `bg-color-dark-gray` / `bg-color-dark-green` / `bg-color-dark-pink` / `bg-color-dark-red` / `bg-color-gold` / `bg-color-gray` / `bg-color-green` / `bg-color-hot-pink` / `bg-color-light-blue` / `bg-color-light-gray` / `bg-color-light-green` / `bg-color-light-pink` / `bg-color-light-purple` / `bg-color-light-red` / `bg-color-light-silver` / `bg-color-light-yellow` / `bg-color-lightest-blue` / `bg-color-mid-gray` / `bg-color-moon-gray` / `bg-color-navy` / `bg-color-near-black` / `bg-color-near-white` / `bg-color-orange` / `bg-color-pink` / `bg-color-purple` / `bg-color-red` / `bg-color-silver` / `bg-color-transparent` / `bg-color-washed-blue` / `bg-color-washed-green` / `bg-color-washed-red` / `bg-color-washed-yellow` / `bg-color-white` / `bg-color-yellow` / `bg-color1` / `bg-color2` / `bg-color3` / `bg-color4` / `bg-color5` / `bg-color6` / `bg-color7` / `bg-color8` / `bg-color9` / `bg-color10` / `bg-color11` / `bg-color12` / `bg-color13` / `bg-color14` / `bg-color15` / `bg-color16` / `color-black` / `color-blue` / `color-current` / `color-dark-blue` / `color-dark-gray` / `color-dark-green` / `color-dark-pink` / `color-dark-red` / `color-gold` / `color-gray` / `color-green` / `color-hot-pink` / `color-light-blue` / `color-light-gray` / `color-light-green` / `color-light-pink` / `color-light-purple` / `color-light-red` / `color-light-silver` / `color-light-yellow` / `color-lightest-blue` / `color-mid-gray` / `color-moon-gray` / `color-navy` / `color-near-black` / `color-near-white` / `color-orange` / `color-pink` / `color-purple` / `color-red` / `color-silver` / `color-transparent` / `color-washed-blue` / `color-washed-green` / `color-washed-red` / `color-washed-yellow` / `color-white` / `color-yellow` / `color1` / `color2` / `color3` / `color4` / `color5` / `color6` / `color7` / `color8` / `color9` / `color10` / `color11` / `color12` / `color13` / `color14` / `color15` / `color16` / `fill-color-black` / `fill-color-blue` / `fill-color-current` / `fill-color-dark-blue` / `fill-color-dark-gray` / `fill-color-dark-green` / `fill-color-dark-pink` / `fill-color-dark-red` / `fill-color-gold` / `fill-color-gray` / `fill-color-green` / `fill-color-hot-pink` / `fill-color-light-blue` / `fill-color-light-gray` / `fill-color-light-green` / `fill-color-light-pink` / `fill-color-light-purple` / `fill-color-light-red` / `fill-color-light-silver` / `fill-color-light-yellow` / `fill-color-lightest-blue` / `fill-color-mid-gray` / `fill-color-moon-gray` / `fill-color-navy` / `fill-color-near-black` / `fill-color-near-white` / `fill-color-orange` / `fill-color-pink` / `fill-color-purple` / `fill-color-red` / `fill-color-silver` / `fill-color-transparent` / `fill-color-washed-blue` / `fill-color-washed-green` / `fill-color-washed-red` / `fill-color-washed-yellow` / `fill-color-white` / `fill-color-yellow` / `fill-color1` / `fill-color2` / `fill-color3` / `fill-color4` / `fill-color5` / `fill-color6` / `fill-color7` / `fill-color8` / `fill-color9` / `fill-color10` / `fill-color11` / `fill-color12` / `fill-color13` / `fill-color14` / `fill-color15` / `fill-color16` / `o-0` / `o-10` / `o-20` / `o-30` / `o-40` / `o-50` / `o-60` / `o-70` / `o-80` / `o-90` / `o-100` / `stroke-color-black` / `stroke-color-blue` / `stroke-color-current` / `stroke-color-dark-blue` / `stroke-color-dark-gray` / `stroke-color-dark-green` / `stroke-color-dark-pink` / `stroke-color-dark-red` / `stroke-color-gold` / `stroke-color-gray` / `stroke-color-green` / `stroke-color-hot-pink` / `stroke-color-light-blue` / `stroke-color-light-gray` / `stroke-color-light-green` / `stroke-color-light-pink` / `stroke-color-light-purple` / `stroke-color-light-red` / `stroke-color-light-silver` / `stroke-color-light-yellow` / `stroke-color-lightest-blue` / `stroke-color-mid-gray` / `stroke-color-moon-gray` / `stroke-color-navy` / `stroke-color-near-black` / `stroke-color-near-white` / `stroke-color-orange` / `stroke-color-pink` / `stroke-color-purple` / `stroke-color-red` / `stroke-color-silver` / `stroke-color-transparent` / `stroke-color-washed-blue` / `stroke-color-washed-green` / `stroke-color-washed-red` / `stroke-color-washed-yellow` / `stroke-color-white` / `stroke-color-yellow` / `stroke-color1` / `stroke-color2` / `stroke-color3` / `stroke-color4` / `stroke-color5` / `stroke-color6` / `stroke-color7` / `stroke-color8` / `stroke-color9` / `stroke-color10` / `stroke-color11` / `stroke-color12` / `stroke-color13` / `stroke-color14` / `stroke-color15` / `stroke-color16`
850
+
851
+ #### Content <!-- notoc -->
852
+
853
+ `content-data-lang` / `content-href` / `content-id` / `content-name` / `content-slot` / `content-title`
811
854
 
812
855
  #### Cursors <!-- notoc -->
813
856
 
@@ -815,7 +858,11 @@ Currently available CSS classes in MetaCSS base v0.0.1:
815
858
 
816
859
  #### Display mode <!-- notoc -->
817
860
 
818
- `db` / `df` / `dg` / `di` / `dib` / `dif` / `dig` / `dn` / `dt` / `dtc` / `dtr`
861
+ `db` / `di` / `dib` / `dif` / `dig` / `dn` / `dt` / `dtc` / `dtr` / `flex` / `grid`
862
+
863
+ #### Flex layout <!-- notoc -->
864
+
865
+ `align-content-center` / `align-content-end` / `align-content-start` / `flex-column` / `flex-column-reverse` / `flex-grow0` / `flex-grow1` / `flex-nowrap` / `flex-row` / `flex-row-reverse` / `flex-shrink0` / `flex-shrink1` / `flex-wrap` / `flex-wrap-reverse` / `justify-content-center` / `justify-content-end` / `justify-content-start`
819
866
 
820
867
  #### Font families <!-- notoc -->
821
868
 
@@ -839,11 +886,11 @@ Currently available CSS classes in MetaCSS base v0.0.1:
839
886
 
840
887
  #### Grid layout <!-- notoc -->
841
888
 
842
- `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`
889
+ `align-items-center` / `align-items-end` / `align-items-start` / `align-items-stretch` / `align-self-center` / `align-self-end` / `align-self-start` / `align-self-stretch` / `gap0` / `gap1` / `gap2` / `gap3` / `gap4` / `gap5` / `gap-1px` / `gap-2px` / `gap-4px` / `gap-8px` / `grid-cols-1` / `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-cols-10` / `grid-rows-1` / `grid-rows-2` / `grid-rows-3` / `grid-rows-4` / `grid-rows-5` / `grid-rows-6` / `grid-rows-7` / `grid-rows-8` / `grid-rows-9` / `grid-rows-10` / `justify-items-center` / `justify-items-end` / `justify-items-start` / `justify-items-stretch` / `justify-self-center` / `justify-self-end` / `justify-self-start` / `justify-self-stretch`
843
890
 
844
891
  #### Height <!-- notoc -->
845
892
 
846
- `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`
893
+ `h1` / `h2` / `h3` / `h4` / `h5` / `h-10` / `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` / `h-100` / `vh-25` / `vh-50` / `vh-75` / `vh-100`
847
894
 
848
895
  #### Icons <!-- notoc -->
849
896
 
@@ -851,7 +898,7 @@ Currently available CSS classes in MetaCSS base v0.0.1:
851
898
 
852
899
  #### Letter spacing <!-- notoc -->
853
900
 
854
- `ls--1` / `ls--2` / `ls-0` / `ls-1` / `ls-2` / `ls-3`
901
+ `ls-0` / `ls-1` / `ls-2` / `ls-3` / `ls--1` / `ls--2`
855
902
 
856
903
  #### Line heights <!-- notoc -->
857
904
 
@@ -863,23 +910,23 @@ Currently available CSS classes in MetaCSS base v0.0.1:
863
910
 
864
911
  #### Margin <!-- notoc -->
865
912
 
866
- `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`
913
+ `center` / `ma0` / `ma1` / `ma2` / `ma3` / `ma4` / `ma5` / `mb0` / `mb1` / `mb2` / `mb3` / `mb4` / `mb5` / `mbe-0` / `mbe-1` / `mbe-2` / `mbe-3` / `mbe-4` / `mbe-5` / `mbs-0` / `mbs-1` / `mbs-2` / `mbs-3` / `mbs-4` / `mbs-5` / `mh0` / `mh1` / `mh2` / `mh3` / `mh4` / `mh5` / `ml0` / `ml1` / `ml2` / `ml3` / `ml4` / `ml5` / `mr0` / `mr1` / `mr2` / `mr3` / `mr4` / `mr5` / `mt0` / `mt1` / `mt2` / `mt3` / `mt4` / `mt5` / `mv0` / `mv1` / `mv2` / `mv3` / `mv4` / `mv5`
867
914
 
868
915
  #### Max. height <!-- notoc -->
869
916
 
870
- `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`
917
+ `maxh1` / `maxh2` / `maxh3` / `maxh4` / `maxh5` / `maxh-10` / `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` / `maxh-100`
871
918
 
872
919
  #### Max. width <!-- notoc -->
873
920
 
874
- `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`
921
+ `maxw1` / `maxw2` / `maxw3` / `maxw4` / `maxw5` / `maxw-10` / `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` / `maxw-100`
875
922
 
876
923
  #### Min. height <!-- notoc -->
877
924
 
878
- `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`
925
+ `minh1` / `minh2` / `minh3` / `minh4` / `minh5` / `minh-10` / `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` / `minh-100`
879
926
 
880
927
  #### Min. width <!-- notoc -->
881
928
 
882
- `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`
929
+ `minw1` / `minw2` / `minw3` / `minw4` / `minw5` / `minw-10` / `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` / `minw-100`
883
930
 
884
931
  #### Overflow <!-- notoc -->
885
932
 
@@ -887,11 +934,19 @@ Currently available CSS classes in MetaCSS base v0.0.1:
887
934
 
888
935
  #### Padding <!-- notoc -->
889
936
 
890
- `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`
937
+ `pa0` / `pa1` / `pa2` / `pa3` / `pa4` / `pa5` / `pb0` / `pb1` / `pb2` / `pb3` / `pb4` / `pb5` / `pbe-0` / `pbe-1` / `pbe-2` / `pbe-3` / `pbe-4` / `pbe-5` / `pbs-0` / `pbs-1` / `pbs-2` / `pbs-3` / `pbs-4` / `pbs-5` / `ph0` / `ph1` / `ph2` / `ph3` / `ph4` / `ph5` / `pl0` / `pl1` / `pl2` / `pl3` / `pl4` / `pl5` / `pr0` / `pr1` / `pr2` / `pr3` / `pr4` / `pr5` / `pt0` / `pt1` / `pt2` / `pt3` / `pt4` / `pt5` / `pv0` / `pv1` / `pv2` / `pv3` / `pv4` / `pv5`
891
938
 
892
939
  #### Positions <!-- notoc -->
893
940
 
894
- `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`
941
+ `absolute` / `bottom-0` / `bottom-1` / `bottom-2` / `bottom--1` / `bottom--2` / `fixed` / `left-0` / `left-1` / `left-2` / `left--1` / `left--2` / `relative` / `right-0` / `right-1` / `right-2` / `right--1` / `right--2` / `static` / `sticky` / `top-0` / `top-1` / `top-2` / `top--1` / `top--2`
942
+
943
+ #### Print <!-- notoc -->
944
+
945
+ `break-after-avoid` / `break-after-avoid-column` / `break-after-avoid-page` / `break-after-column` / `break-after-left` / `break-after-page` / `break-after-recto` / `break-after-right` / `break-after-verso` / `break-before-avoid` / `break-before-avoid-column` / `break-before-avoid-page` / `break-before-column` / `break-before-left` / `break-before-page` / `break-before-recto` / `break-before-right` / `break-before-verso`
946
+
947
+ #### Scrolling <!-- notoc -->
948
+
949
+ `ss-always` / `ss-both` / `ss-center` / `ss-end` / `ss-normal` / `ss-start` / `ss-x` / `ss-y`
895
950
 
896
951
  #### Selection <!-- notoc -->
897
952
 
@@ -913,17 +968,13 @@ Currently available CSS classes in MetaCSS base v0.0.1:
913
968
 
914
969
  `ttc` / `ttfsk` / `ttfw` / `tti` / `ttl` / `ttn` / `ttu`
915
970
 
916
- #### Undefined <!-- notoc -->
917
-
918
- `vh-100` / `vh-25` / `vh-50` / `vh-75` / `vw-100` / `vw-25` / `vw-50` / `vw-75`
919
-
920
971
  #### Vertical align <!-- notoc -->
921
972
 
922
973
  `v-base` / `v-btm` / `v-mid` / `v-top`
923
974
 
924
975
  #### Visibility <!-- notoc -->
925
976
 
926
- `hidden` / `visible`
977
+ `collapse` / `hidden` / `visible`
927
978
 
928
979
  #### Whitespace <!-- notoc -->
929
980
 
@@ -931,7 +982,7 @@ Currently available CSS classes in MetaCSS base v0.0.1:
931
982
 
932
983
  #### Width <!-- notoc -->
933
984
 
934
- `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`
985
+ `vw-25` / `vw-50` / `vw-75` / `vw-100` / `w1` / `w2` / `w3` / `w4` / `w5` / `w-10` / `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` / `w-100`
935
986
 
936
987
  #### Z-indices <!-- notoc -->
937
988
 
@@ -968,7 +1019,7 @@ distributed as CLI bundle with **no runtime dependencies**. The following
968
1019
  dependencies are only shown for informational purposes and are (partially)
969
1020
  included in the bundle.
970
1021
 
971
- Package sizes (brotli'd, pre-treeshake): ESM: 11.46 KB
1022
+ Package sizes (brotli'd, pre-treeshake): ESM: 11.77 KB
972
1023
 
973
1024
  ## Dependencies
974
1025
 
@@ -1015,4 +1066,4 @@ If this project contributes to an academic publication, please cite it as:
1015
1066
 
1016
1067
  ## License
1017
1068
 
1018
- &copy; 2023 Karsten Schmidt // Apache License 2.0
1069
+ &copy; 2023 - 2024 Karsten Schmidt // Apache License 2.0
package/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  // @bun
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 l0 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 n0={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(n0).reduce((X,J)=>(X[J]=m5(Z,n0[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 l5={length:(Z)=>Z.length,split:(Z,X)=>X},E1={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}},v1=(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))},n5=(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);v1(U,Q,z,X),Z=Z.substring(q),z=X,V=Y.length(Z)}return v1(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:l5,...X};for(let Y of g(Z,X.delimWord||/\s/g)){const B=J[J.length-1];n5(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:E1,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 S1=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)L1(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
- `),L1(Z,W);const z=await Z.ctx({logger:new l0(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)}},L1=(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 E=(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 S=(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*l(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 v0=(Z,X,J=l)=>{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)?l(w(Z),X):(J)=>{const W=J[2];return Z0(J,(Y,B)=>W(Y,Z(B)))}};function*E0(...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*l1(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=":[",n1=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=E(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?[...E0(Z,X)]:X,O8=(Z,X,J,W)=>{const Y=W.format,B=A(W),U=W.scope?N8(n1,W.scope):n1;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(E(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?[...l1(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 n=(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):E(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]=E(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)?l(W1(Z),X):w(E(Z)?(J)=>[Z(J),J]:(J)=>[Z,J])};var Y1=function(...Z){const X=v0(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=v0(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,L)=>{const v=J(L);if(V.has(v)){if(Q[v]=L,z.add(v),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,L)=>{const v=J(L);if(V.has(v)){let C0=q.get(v);!C0&&q.set(v,C0=[]),C0.length>=U&&e(`max back pressure (${U}) exceeded for input: ${String(v)}`),C0.push(L),z.add(v);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}}),S2=U1(2,"0"),D5=U1(3,"0"),y2=U1(4,"0");var V1=function(Z,X){return G(X)?l(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"})},L0={include:c({alias:"I",desc:"Include CSS files (prepend)"})},S0={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,...L0,...S0,...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=S(H0(Z.opts.specs),Z.logger),J=v8(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(n(U.decls,{format:q.format,fns:p}));z.forEach(($)=>E8($,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(n(W0(L8(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(n(B,{format:W,fns:p}))},v8=(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?v5(B,q,`.${$}`,$):E5(U,`.${$}`,$)}return{mediaQueryRules:B,plainRules:U}},E8=(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)v5(W,H,Q.path,$);else E5(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}},L8=(Z,X)=>X.split(Q1).reduce((J,W)=>Object.assign(J,Z[W]),{}),v5=(Z,X,J,W)=>{if(!Z[X])Z[X]={};(Z[X][J]||(Z[X][J]=new Set)).add(W)},E5=(Z,X,J)=>(Z[X]||(Z[X]=new Set)).add(J);import{resolve as _5} from"path";var L5={desc:"Export entire generated framework as CSS",opts:{...L0,...S0,...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=S(_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(n(q.decls,{format:U?Q0:x,fns:p}));Q.push(S8(q,W,U,X)),B0(V,Q,X)}},S8=(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 n(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 S5={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=S(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.vars)?X.vars:[""],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 E0(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]),L=K0(!H||P(b)?String(b):S5[H](b),z,q,Q,_);J[$][M]=L,W.debug($,M,L)}}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==="i+1"?(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=S5[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=S(x8(import.meta.dir,"package.json"));S1({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:L5,generate:y5},ctx:async(Z)=>{if(Z.opts.verbose)Z.logger.level=C.DEBUG;return{...Z,format:N0}},usage:{prefix:`
2
+ var u0={default:95,hint:90,multi:90,param:96,required:33};var g0=(X)=>X;var t=function(X,Z){return!Z&&(Z={}),(...J)=>{const W=JSON.stringify(J);if(W!==void 0)return W in Z?Z[W]:Z[W]=X.apply(null,J);return X.apply(null,J)}};var r=t((X,Z)=>X.repeat(Z));var H1=(X)=>/^[a-f0-9]+$/i.test(X);var C1=(X)=>/^[-+]?\d+$/.test(X),M1=(X)=>/^[-+]?\d*\.?\d+(e[-+]?\d+)?$/i.test(X);var R=(X,Z=(J)=>J!==void 0?": "+J:"")=>class extends Error{constructor(J){super(X(J)+Z(J))}};var d4=R(()=>"illegal argument(s)"),H=(X)=>{throw new d4(X)};var x0=(X)=>M1(X)?parseFloat(X):H(`not a numeric value: ${X}`),F1=(X)=>X.map(x0),d0=(X)=>H1(X)?parseInt(X,16):H(`not a hex value: ${X}`),P1=(X)=>X.map(d0),n0=(X)=>C1(X)?parseInt(X):H(`not an integer: ${X}`),w1=(X)=>X.map(n0);var M0=(X,Z)=>(J)=>({coerce:X,hint:Z,group:"main",...J}),F0=(X,Z)=>(J)=>({hint:n4(Z,J.delim),multi:!0,coerce:X,group:"main",...J}),n4=(X,Z)=>X+(Z?`[${Z}..]`:""),T=(X)=>({flag:!0,default:!1,group:"flags",...X}),P0=M0(g0,"STR"),w0=F0(g0,"STR"),F5=M0(x0,"NUM"),P5=M0(d0,"HEX"),N1=M0(n0,"INT"),w5=F0(F1,"NUM"),N5=F0(P1,"HEX"),O5=F0(w1,"INT");var C=((X)=>{return X[X.FINE=0]="FINE",X[X.DEBUG=1]="DEBUG",X[X.INFO=2]="INFO",X[X.WARN=3]="WARN",X[X.SEVERE=4]="SEVERE",X[X.NONE=5]="NONE",X})(C||{});class l0{id;level;constructor(X,Z=C.FINE){this.id=X,this.level=typeof Z==="string"?C[Z]:Z}enabled(X){return this.level<=X}fine(...X){this.level<=C.FINE&&this.log(C.FINE,X)}debug(...X){this.level<=C.DEBUG&&this.log(C.DEBUG,X)}info(...X){this.level<=C.INFO&&this.log(C.INFO,X)}warn(...X){this.level<=C.WARN&&this.log(C.WARN,X)}severe(...X){this.level<=C.SEVERE&&this.log(C.SEVERE,X)}}var O1=(X)=>X.map((Z)=>{if(typeof Z==="function")Z=Z();if(!(typeof Z==="string"||typeof Z==="number"))Z=JSON.stringify(Z);return Z}).join(" ");class p0 extends l0{constructor(X,Z,J=C.FINE){super(Z,J);this.target=X}log(X,Z){this.target.write(`[${C[X]}] ${this.id}: ${O1(Z)}
3
+ `)}}var N0=t((X,Z=" ")=>{const J=r(String(Z),X);return(W,Y)=>{if(W==null)return J;return W=W.toString(),Y=Y!==void 0?Y:W.length,Y<X?W+J.substring(Y):W}});var D1=(X,Z)=>{return!Z&&(Z=new Map),(J)=>{let W;return Z.has(J)?Z.get(J):(Z.set(J,W=X(J)),W)}};var o0={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 l4=(X,Z)=>(J)=>X.format(Z,J),i0=(X)=>Object.keys(o0).reduce((Z,J)=>(Z[J]=l4(X,o0[J]),Z),{format:X});var G1="\x1B[0m",p4=["","1","2","1;2","4","1;4","2;4","1;2;4"],O0={format:(X,Z)=>O0.start(X)+Z+O0.end,start:D1((X)=>{let Z=[],J=X&15;return J&&Z.push(29+(X>>4&1)*60+J),J=X>>5&15,J&&Z.push(39+(X>>9&1)*60+J),J=X>>10,J&&Z.push(p4[J]),"\x1B["+Z.join(";")+"m"}),end:G1,prefix:G1,suffix:"\n"};var k1={format:(X,Z)=>String(Z),prefix:"",suffix:"\n",start:()=>"",end:""};var D0=i0(O0),j1=i0(k1);var F=Array.isArray;var o4=(X)=>X.toUpperCase(),T1=(X)=>X.toLowerCase(),I1=(X)=>X.length?X[0].toUpperCase()+X.substring(1):X,R1=(X,Z="-")=>T1(X.replace(/([a-z0-9\u00e0-\u00fd])([A-Z\u00c0-\u00dd])/g,(J,W,Y)=>W+Z+Y));var A1=(X,Z="-")=>T1(X).replace(new RegExp(`\\${Z}+(\\w)`,"g"),(J,W)=>o4(W));var v1=Object.getPrototypeOf,A=(X)=>{let Z;return X!=null&&typeof X==="object"&&((Z=v1(X))===null||v1(Z)===null)};var i4=/\x1b\[[0-9;]+m/g,a4=(X)=>X.replace(i4,"");var G0=(X)=>a4(X).length;var E1=(X=!1,Z)=>(J)=>X||typeof J!=="string"&&typeof J!=="number"?JSON.stringify(J,null,Z):String(J);function*g(X,Z=/\r?\n/g,J=!1){let W=0;const Y=X.length,B=~~J;let V;if(typeof Z==="string")V=new RegExp(Z,"g");else if(!Z.flags.includes("g"))V=new RegExp(Z,Z.flags+"g");else V=Z;for(;W<Y;){const z=V.exec(X);if(!z){yield X.substring(W);return}const Q=z[0].length;yield X.substring(W,z.index+B*Q),W=z.index+Q}}class a0{n=0;w=[];constructor(X,Z){X!=null&&this.add(X,Z)}add(X,Z=X.length){return this.w.push(X),this.n+=Z+~~(this.n>0),this}toString(){return this.w.join(" ")}}var t4={length:(X)=>X.length,split:(X,Z)=>Z},L1={length:G0,split:(X,Z)=>{const J=/\x1b\[[0-9;]+m/g;let W=Z,Y;while(Y=J.exec(X)){if(Y.index>=Z)break;const B=Y[0].length;W+=B,Z+=B}return W}},b1=(X,Z,J,W)=>{const Y=X[X.length-1];Y&&W-Y.n>J?Y.add(Z,J):X.push(new a0(Z,J))},r4=(X,{width:Z,min:J,hard:W,splitter:Y},B=0,V=[])=>{let z=Y.length(X),Q=Z-B;if(Q<J&&Q<z)Q=Z;while(W&&z>Q){const $=Y.split(X,Q),U=X.substring(0,$);b1(V,U,Q,Z),X=X.substring($),Q=Z,z=Y.length(X)}return b1(V,X,z,Z),V},c4=(X,Z,J=[])=>{if(!X.length)return J.push(new a0),J;const W={width:80,min:4,hard:!1,splitter:t4,...Z};for(let Y of g(X,Z.delimWord||/\s/g)){const B=J[J.length-1];r4(Y,W,B&&B.n>0?B.n+1:0,J)}return J},S1=(X,Z)=>{let J=[];for(let W of g(X,Z.delimLine))J=J.concat(c4(W,Z));return J};var V0=(X,Z={})=>{Z={lineWidth:80,paramWidth:32,showDefaults:!0,prefix:"",suffix:"",groups:["flags","main"],...Z};const J=A(Z.color)?{...u0,...Z.color}:Z.color?u0:{},W=r(" ",Z.paramWidth),Y=(z)=>z.map((Q)=>s4(Q,X[Q],Z,J,W)),B=Object.keys(X).sort(),V=Z.groups?Z.groups.map((z)=>[z,B.filter((Q)=>X[Q].group===z)]).filter((z)=>!!z[1].length):[["options",B]];return[...t0(Z.prefix,Z.lineWidth),...V.map(([z,Q])=>[...Z.showGroupNames?[`${I1(z)}:
4
+ `]:[],...Y(Q),""].join("\n")),...t0(Z.suffix,Z.lineWidth)].join("\n")},s4=(X,Z,J,W,Y)=>{const B=e4(Z,W),V=X8(Z,W,B),z=z0(`--${R1(X)}`,W.param),Q=`${V}${z}${B}`,$=Z.optional===!1&&Z.default===void 0,U=[];$&&U.push("required"),Z.multi&&U.push("multiple");const q=Z8(U,W,$)+(Z.desc||"")+J8(Z,J,W);return N0(J.paramWidth)(Q,G0(Q))+t0(q,J.lineWidth-J.paramWidth).map((K,L)=>L>0?Y+K:K).join("\n")},e4=(X,Z)=>X.hint?z0(" "+X.hint,Z.hint):"",X8=(X,Z,J)=>X.alias?`${z0("-"+X.alias,Z.param)}${J}, `:"",Z8=(X,Z,J)=>X.length?z0(`[${X.join(", ")}] `,J?Z.required:Z.multi):"",J8=(X,Z,J)=>Z.showDefaults&&X.default!=null&&X.default!==!1?z0(` (default: ${E1(!0)(X.defaultHint!=null?X.defaultHint:X.default)})`,J.default):"",z0=(X,Z)=>Z!=null?`\x1B[${Z}m${X}\x1B[0m`:X,t0=(X,Z)=>X?S1(X,{width:Z,splitter:L1,hard:!1}):[];var W8=R(()=>"parse error"),_1=(X,Z,J)=>{J={start:2,showUsage:!0,help:["--help","-h"],...J};try{return Y8(X,Z,J)}catch(W){if(J.showUsage)console.log(W.message+"\n\n"+V0(X,J.usageOpts));throw new W8(W.message)}},Y8=(X,Z,J)=>{const W=B8(X),Y={};let B,V,z=J.start;for(;z<Z.length;){const Q=Z[z];if(!B){if(J.help.includes(Q)){console.log(V0(X,J.usageOpts));return}const $=V8(X,W,Y,Q);if(B=$.id,V=$.spec,z=z+~~($.state<2),$.state)break}else{if(z8(V,Y,B,Q))break;B=null,z++}}return B&&H(`missing value for: --${B}`),{result:Q8(X,Y),index:z,rest:Z.slice(z),done:z>=Z.length}},B8=(X)=>Object.entries(X).reduce((Z,[J,W])=>W.alias?(Z[W.alias]=J,Z):Z,{}),V8=(X,Z,J,W)=>{if(W[0]==="-"){let Y;if(W[1]==="-"){if(W==="--")return{state:1};Y=A1(W.substring(2))}else Y=Z[W.substring(1)],!Y&&H(`unknown option: ${W}`);const B=X[Y];if(!B&&H(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}},z8=(X,Z,J,W)=>{if(/^-[a-z]/i.test(W)&&H(`missing value for: --${J}`),X.multi)F(Z[J])?Z[J].push(W):Z[J]=[W];else Z[J]=W;return X.fn&&!X.fn(W)},Q8=(X,Z)=>{let J;for(let W in X)if(J=X[W],Z[W]===void 0){if(J.default!==void 0)Z[W]=J.default;else if(J.optional===!1)H(`missing arg: --${W}`)}else if(J.coerce)U8(J,Z,W);return Z},U8=(X,Z,J)=>{try{if(X.multi&&X.delim)Z[J]=Z[J].reduce((W,Y)=>(W.push(...Y.split(X.delim)),W),[]);Z[J]=X.coerce(Z[J])}catch(W){throw new Error(`arg --${J}: ${W.message}`)}};var h1=async(X)=>{const Z=X.argv||process.argv,J=!process.env.NO_COLOR,W={prefix:"",color:J,...X.usage};try{let Y,B,V=X.start??2;if(X.single){if(Y=Object.keys(X.commands)[0],!Y)H("no command provided");B=X.commands[Y]}else{if(Y=Z[V],B=X.commands[Y],W.prefix+=$8(X.commands),!B)y1(X,W);V++}let z;try{z=_1({...X.opts,...B.opts},Z,{showUsage:!0,usageOpts:W,start:V})}catch($){}if(!z)process.exit(1);if(B.inputs!==void 0&&B.inputs!==z.rest.length)process.stderr.write(`expected ${B.inputs||0} input(s)
5
+ `),y1(X,W);const Q=await X.ctx({logger:new p0(process.stderr,X.name,"INFO"),format:J?D0:j1,opts:z.result,inputs:z.rest},B);if(await B.fn(Q),X.post)await X.post(Q,B)}catch(Y){process.stderr.write(Y.message+"\n\n"),process.exit(1)}},y1=(X,Z)=>{process.stderr.write(V0(X.opts,Z)),process.exit(1)},$8=(X)=>["\nAvailable commands:\n",...Object.keys(X).map((Z)=>`${N0(16)(Z)}: ${X[Z].desc}`),"\n"].join("\n");import{existsSync as q8,mkdirSync as K8,statSync as GX} from"fs";import{sep as H8} from"path";var m1=(X)=>{const Z=X.substring(0,X.lastIndexOf(H8));return Z.length>0&&!q8(Z)?(K8(Z,{recursive:!0}),!0):!1};var b=(X)=>typeof X==="function";var P=(X)=>typeof X==="string";import{readFileSync as M8} from"fs";import{writeFileSync as C8} from"fs";var f1=(X,Z,J,W,Y=!1)=>{if(W&&W.info(`${Y?"[dryrun] ":""}writing file: ${X}`),Y)return;m1(X),C8(X,Z,!J&&P(Z)?"utf-8":J)};var G=(X,Z,J="utf-8")=>{return Z&&Z.debug("reading file:",X),M8(X,J)},r0=(X,Z,J,W=!1)=>f1(X,F(Z)?Z.join("\n"):Z,"utf-8",J,W);var y=(X,Z)=>JSON.parse(G(X,Z));var k0=Object.freeze({level:C.NONE,enabled:()=>!1,fine(){},debug(){},info(){},warn(){},severe(){}});import{join as a8} from"path";var F8=R(()=>"Assertion failed"),j0=(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 F8(typeof Z==="function"?Z():Z)}:()=>{};var T0=(X)=>X!=null&&typeof X!=="function"&&X.length!==void 0;var u1=(X)=>{return(X==null||!X[Symbol.iterator])&&H(`value is not iterable: ${X}`),X};var g1=(X)=>T0(X)?X:[...u1(X)];var Q0=(X)=>X[X.length-1];var P8=R(()=>"illegal arity"),c=(X)=>{throw new P8(X)};var w8=R(()=>"illegal state"),s=(X)=>{throw new w8(X)};var c0=function(...X){let[Z,J,W,Y,B,V,z,Q,$,U]=X;switch(X.length){case 0:c(0);case 1:return Z;case 2:return(...K)=>Z(J(...K));case 3:return(...K)=>Z(J(W(...K)));case 4:return(...K)=>Z(J(W(Y(...K))));case 5:return(...K)=>Z(J(W(Y(B(...K)))));case 6:return(...K)=>Z(J(W(Y(B(V(...K))))));case 7:return(...K)=>Z(J(W(Y(B(V(z(...K)))))));case 8:return(...K)=>Z(J(W(Y(B(V(z(Q(...K))))))));case 9:return(...K)=>Z(J(W(Y(B(V(z(Q($(...K)))))))));case 10:default:const q=(...K)=>Z(J(W(Y(B(V(z(Q($(U(...K))))))))));return X.length===10?q:c0(q,...X.slice(10))}};var s0=(X,Z)=>new Promise((J)=>setTimeout(()=>J(X),Z));var x1=(X)=>X;var d1=["-moz-","-ms-","-o-","-webkit-"],x={rules:"",ruleSep:",",valSep:"",decls:"",declStart:"{",declEnd:"}",indent:"",comments:!1},U0={rules:"\n",ruleSep:", ",valSep:" ",decls:"\n",declStart:" {\n",declEnd:"}\n",indent:" ",comments:!0};var k=(X)=>X!=null&&typeof X[Symbol.iterator]==="function";var I0=(X,Z)=>X!=null&&typeof X[Z]==="function";var d=(X)=>I0(X,"xform")?X.xform():X;var h=function(...X){return X=X.map(d),c0.apply(null,X)};var R0=(X)=>X!=null&&typeof X!=="string"&&typeof X[Symbol.iterator]==="function";var e=(X,Z)=>[X[0],X[1],Z];var m=Symbol(),e0=()=>{};class X1{value;constructor(X){this.value=X}deref(){return this.value}}var j=(X)=>X instanceof X1;var f=(X)=>X instanceof X1?X.deref():X;var A0=function(...X){const Z=X[0],J=Z[0],W=Z[1],Y=Z[2];X=N8(X);const B=X[0]==null?J():X[0],V=X[1];return f(W(I0(V,"$reduce")?V.$reduce(Y,B):T0(V)?O8(Y,B,V):D8(Y,B,V)))};var N8=(X)=>X.length===2?[void 0,X[1]]:X.length===3?[X[1],X[2]]:c(X.length),O8=(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},D8=(X,Z,J)=>{for(let W of J)if(Z=X(Z,W),j(Z)){Z=Z.deref();break}return Z},X0=(X,Z)=>[X,(J)=>J,Z];var v0=function(X){return X?[...X]:X0(()=>[],(Z,J)=>(Z.push(J),Z))};function*E0(X,Z){const J=d(X)(v0()),W=J[1],Y=J[2];for(let B of Z){const V=Y([],B);if(j(V)){yield*f(W(V.deref()));return}if(V.length)yield*V}yield*f(W([]))}function*n(X,Z){const J=d(X)([e0,e0,(W,Y)=>Y])[2];for(let W of Z){let Y=J(m,W);if(j(Y)){if(Y=f(Y.deref()),Y!==m)yield Y;return}if(Y!==m)yield Y}}var b0=(X,Z,J=n)=>{const W=Z.length-1;return k(Z[W])?Z.length>1?J(X.apply(null,Z.slice(0,W)),Z[W]):J(X(),Z[0]):void 0};var Z1=function(X,Z){return k(Z)?E0(Z1(X),P(Z)?[Z]:Z):(J)=>{const W=J[2],Y=(B,V)=>{const z=X(V);if(z){for(let Q of z)if(B=Y(B,Q),j(B))break;return B}return W(B,V)};return e(J,Y)}};var n1=function(X){return Z1((Z)=>R0(Z)?Z:void 0,X)};var w=function(X,Z){return k(Z)?n(w(X),Z):(J)=>{const W=J[2];return e(J,(Y,B)=>W(Y,X(B)))}};function*L0(...X){const Z=X.length-1;if(Z<0)return;const J=new Array(Z+1).fill(0),W=X.map(g1),Y=W.reduce((B,V)=>B*V.length,1);for(let B=0;B<Y;B++){const V=[];for(let z=Z;z>=0;z--){const Q=W[z];let $=J[z];if($===Q.length)J[z]=$=0,z>0&&J[z-1]++;V[z]=Q[$]}J[Z]++,yield V}}function*l1(X,Z=Infinity){while(Z-- >0)yield X}var J1=function(X,Z){X=X||"";let J=!0;return Z?[...Z].join(X):X0(()=>"",(W,Y)=>(W=J?W+Y:W+X+Y,J=!1,W))};var S0=function(...X){return G8(S0,A0,X)};var G8=(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((B)=>X(J[0],J[1],B));default:c(J.length)}return Z(d(J[0])(J[1]),W,Y)};var k8=new Set,j8=":[",p1=h(n1(),w((X)=>j8.indexOf(X.charAt(0))>=0?X:" "+X)),T8=(X,Z)=>h(X,w((J)=>P(J)&&J.indexOf(" .")==0?J+Z:J)),Z0=(X,Z,J,W)=>{const Y=J.length,B=[];let V,z;const Q=($,U)=>{let q=null;if(F(U))Z0(X,W1(Z,B),U,W);else if(k(U)&&!P(U))Z0(X,W1(Z,B),[...U],W);else if((z=b(U))||(q=W.fns[U]))if(!Z.length){if(q)return q.apply(null,J.slice($+1))(X,W),!0;U(X,W)}else if(z)Q($,U());else H(`quoted fn ('${U}') only allowed at head position`);else if(A(U))V=Object.assign(V||{},U);else if(U!=null)B.push(U)};for(let $=0;$<Y;$++)if(Q($,J[$]))return X;return V&&X.push(I8(Z,B,V,W)),X},W1=(X,Z)=>X.length?[...L0(X,Z)]:Z,I8=(X,Z,J,W)=>{const Y=W.format,B=v(W),V=W.scope?T8(p1,W.scope):p1;return[B,S0(w((z)=>S0(V,J1(),F(z)?z:[z]).trim()),J1(Y.ruleSep),W1(X,Z)),Y.declStart,$0(J,W),B,Y.declEnd].join("")},$0=(X,Z)=>{const J=Z.format,W=Z.autoprefix||k8,Y=v(Z,Z.depth+1),B=[];for(let V in X)if(X.hasOwnProperty(V)){let z=X[V];if(b(z))z=z(X);if(F(z))z=z.map((Q)=>F(Q)?Q.join(" "):Q).join(J.ruleSep);if(W.has(V))for(let Q of Z.vendors)B.push(`${Y}${Q}${V}:${J.valSep}${z};`);B.push(`${Y}${V}:${J.valSep}${z};`)}return B.join(J.decls)+J.decls},v=(X,Z=X.depth)=>Z>1?[...l1(X.format.indent,Z)].join(""):Z>0?X.format.indent:"";var o1=function(X,...Z){const J=Z.length===1?Z[0]:{0:Z[0],100:Z[1]};return(W,Y)=>{const B=v(Y);Y.depth++;const V=v(Y);W.push(`${B}@keyframes ${X}${Y.format.declStart}`);for(let z in J)if(J.hasOwnProperty(z))W.push([V,z+"%",Y.format.declStart,$0(J[z],Y),V,Y.format.declEnd].join(""));return Y.depth--,W.push(B+Y.format.declEnd),W}};var i1=(X,Z=!1)=>(J,W)=>{const Y=v(W),B=v(W,W.depth+1);if(W.format.comments||Z)J.push(Y+"/*",X.split("\n").map((V)=>B+V).join("\n"),Y+"*/");return J};var _0=(X,Z,J)=>(W,Y)=>{const B=v(Y);return W.push(`${B}${X} ${R8(Z)}${Y.format.declStart}`),Y.depth++,Z0(W,[],J,Y),Y.depth--,W.push(B+Y.format.declEnd),W},R8=(X)=>{if(P(X))return X;const Z=[];for(let J in X)if(X.hasOwnProperty(J)){let W=X[J];if(W===!0)W=a1.has(J)?J:`(${J})`;else if(W===!1)W=`(not ${a1.has(J)?J:`(${J})`})`;else if(W==="only")W+=" "+J;else W=`(${J}:${W})`;Z.push(W)}return Z.join(" and ")},a1=new Set(["all","print","screen"]);var l=(X,Z)=>{return Z={format:x,vendors:d1,fns:{},depth:0,...Z},F(Z.autoprefix)&&(Z.autoprefix=new Set(Z.autoprefix)),A(X)?$0(X,Z):b(X)?X([],Z).join(Z.format.rules):Z0([],[],F(X)?X:R0(X)?[...X]:H("invalid rules"),Z).join(Z.format.rules)};var t1=(X,...Z)=>(J,W)=>(J.push(Z.length?`@import url(${X}) ${Z.join(W.format.ruleSep)};`:`@import url(${X});`),J);var J0=(X,Z)=>_0("@media",X,Z);var r1=function(...X){return(Z,J)=>(Z.push(X.length>1?`@namespace ${X[0]} url(${X[1]});`:`@namespace url(${X[0]});`),Z)};var c1=(X,Z)=>_0("@supports",X,Z);var p={"@comment":i1,"@import":t1,"@keyframes":o1,"@media":J0,"@namespace":r1,"@supports":c1};var s1=4,e1=(X)=>s1=X,D=(X)=>X===(X|0)?String(X):X.toFixed(s1).replace(/^0./,".").replace(/^-0./,"-.").replace(/0+$/,""),X4=(X)=>`${D(X)}em`,Z4=(X)=>`${D(X)}ex`,J4=(X)=>`${D(X)}rem`,Y1=(X)=>`${D(X)}%`,W4=(X)=>`${D(X)}px`,Y4=(X)=>`${D(X)}vh`,B4=(X)=>`${D(X)}vw`,V4=(X)=>`${D(X)}vmin`,z4=(X)=>`${D(X)}vmax`,Q4=(X)=>`${X|0}ms`,U4=(X)=>`${D(X)}s`;var $4=(X)=>`${D(X)}deg`,q4=(X)=>`${D(X)}rad`,K4=(X)=>`${D(X)}turn`,H4=(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||{}),I=((X)=>{return X[X.NEVER=0]="NEVER",X[X.FIRST=1]="FIRST",X[X.LAST=2]="LAST",X})(I||{});var A8=0,v8=()=>A8++,o=(X,Z)=>!Z||!Z.id?{...Z,id:X+"-"+v8()}:Z;var O=k0;class u{constructor(X,Z){this.wrapped=X,Z=o("sub",{closeIn:I.LAST,closeOut:I.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(v0()))}id;closeIn;closeOut;parent;__owner;xform;cacheLast;last=m;state=N.IDLE;subs=[];deref(){return this.last!==m?this.last:void 0}getState(){return this.state}setState(X){this.state=X}subscribe(X,Z={}){this.ensureState();let J;if(X instanceof u&&!Z.xform)X.ensureState(),j0(!X.parent,`sub '${X.id}' already has a parent`),X.parent=this,J=X;else J=new u(X,{...Z,parent:this});return this.subs.push(J),this.setState(N.ACTIVE),J.setState(N.ACTIVE),this.last!=m&&J.next(this.last),J}transform(...X){let Z,J;if(A(Q0(X)))J=X.pop(),Z={error:J.error};return this.subscribe(Z,o("xform",X.length>0?{...J,xform:h(...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===I.FIRST||!this.subs.length&&this.closeOut!==I.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!==k0?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(B){if(X==="error"||!J.error||!J.error(B))return this.unhandledError(B)}}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=f(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)s(`operation not allowed in state ${this.state}`)}release(){this.subs.length=0,delete this.parent,delete this.xform,delete this.last}}var C4=(X,Z)=>{const J=new M4(Z);return J.next(X),J};class M4 extends u{src;_cancel;_inited;constructor(X,Z){const[J,W]=b(X)?[X,Z||{}]:[void 0,X||{}];super(W.error?{error:W.error}:void 0,o("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!==I.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 F4=(X,Z)=>X===I.FIRST||X===I.LAST&&!Z;var B1=function(X){return X?A0(B1(),X):X0(()=>({}),(Z,[J,W])=>(Z[J]=W,Z))};var V1=function(X,Z){return k(Z)?n(V1(X),Z):w(b(X)?(J)=>[X(J),J]:(J)=>[X,J])};var z1=function(...X){const Z=b0(z1,X);if(Z)return Z;const J=X[0],W=X[1]!==!1;return w((Y)=>{const B=W?{}:Y;for(let V in Y)B[V]=J(Y[V]);return B})};var Q1=function(...X){const Z=b0(Q1,X,E0);if(Z)return Z;const{key:J,mergeOnly:W,reset:Y,all:B,backPressure:V}={key:x1,mergeOnly:!1,reset:!0,all:!0,backPressure:0,...X[1]},z=F(X[0])?new Set(X[0]):X[0],Q=new Set,$=new Map;let U={};const q=([K,L,a])=>{let S=!0;if(W||V<1)return[K,(M)=>{if(Y&&B&&Q.size>0||!Y&&S)M=a(M,U),U={},Q.clear(),S=!1;return L(M)},(M,_)=>{const E=J(_);if(z.has(E)){if(U[E]=_,Q.add(E),W||P4(z,Q))if(M=a(M,U),S=!1,Y)U={},Q.clear();else U={...U}}return M}];else return[K,(M)=>{if(B&&Q.size>0)M=a(M,w4($,Q)),$.clear(),Q.clear();return L(M)},(M,_)=>{const E=J(_);if(z.has(E)){let C0=$.get(E);!C0&&$.set(E,C0=[]),C0.length>=V&&s(`max back pressure (${V}) exceeded for input: ${String(E)}`),C0.push(_),Q.add(E);while(P4(z,Q))if(M=a(M,w4($,Q)),S=!1,j(M))break}return M}]};return q.keys=()=>z,q.clear=()=>{$.clear(),z.clear(),Q.clear(),U={}},q.add=(K)=>{z.add(K)},q.delete=(K,L=!0)=>{if($.delete(K),z.delete(K),L)Q.delete(K),delete U[K]},q},P4=(X,Z)=>{if(Z.size<X.size)return!1;for(let J of X)if(!Z.has(J))return!1;return!0},w4=(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 N4=(X,Z)=>{let J=!0;for(let W of Z)J=X.removeID(W)&&J;return J};var O4=(X)=>new D4(X);class D4 extends u{sources;idSources;realSourceIDs;invRealSourceIDs;psync;clean;constructor(X){const Z=Q1(new Set,{key:(W)=>W[0],mergeOnly:X.mergeOnly===!0,reset:X.reset===!0,all:X.all!==!1,backPressure:X.backPressure||0}),J=z1((W)=>W[1]);super(void 0,o("streamsync",{...X,xform:X.xform?h(Z,J,X.xform):h(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 u?this.add(J[1]):this.next(J),done:()=>this.markDone(X),__owner:this},{xform:V1(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 N4(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),F4(this.closeIn,this.sources.size)&&this.done()}}var U1=t((X,Z=" ")=>{const J=r(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}}),x2=U1(2,"0"),d2=U1(3,"0"),G4=U1(4,"0");var $1=function(X,Z){return k(Z)?n($1(X),Z):(J)=>{const W=J[2];return e(J,(Y,B)=>X(B)?W(Y,B):Y)}};import{watch as E4} from"fs";import{resolve as i} from"path";var k4={specs:P0({alias:"s",optional:!1,desc:"Path to generated JSON defs"})},y0={include:w0({alias:"I",desc:"Include CSS files (prepend)"})},j4={eval:P0({alias:"e",desc:"eval meta stylesheet in given string (ignores other inputs & includes)"})},T4={force:w0({alias:"f",hint:"STR",desc:"CSS classes to force include (wildcards are supported, @-prefix will read from file)",delim:","})},I4={media:w0({alias:"m",hint:"ID",desc:"Media query IDs (use 'ALL' for all)",delim:","})},R4={onlyDecls:T({desc:"Only emit framework decls"})},W0={out:P0({alias:"o",desc:"Output file (or stdout)"})},Y0={pretty:T({alias:"p",desc:"Pretty print output"})},h0={noDecls:T({alias:"d",desc:"Don't emit framework decls"})},m0={noHeader:T({desc:"Don't emit generated header comment"})},A4={watch:T({alias:"w",desc:"Watch input files for changes"})};import{resolve as E8} from"path";var B0=(X,Z,J)=>{Z=P(Z)?Z:Z.join("\n"),X?r0(E8(X),Z,J):process.stdout.write(Z+"\n")},f0=({info:{name:X,version:Z}})=>`/*! ${X} v${Z} - generated by thi.ng/meta-css @ ${(new Date()).toISOString()} */`;var b4={desc:"Transpile (and optionally bundle) meta stylesheets to CSS",opts:{...j4,...h0,...T4,...y0,...m0,...W0,...Y0,...k4,...A4,bundle:T({alias:"b",desc:"Bundle inputs (see `out` option)"}),noWrite:T({desc:"Don't write files, use stdout only"})},fn:async(X)=>{const Z=y(i(X.opts.specs),X.logger),J=y8(Z,X.opts.force||[],X.logger);if(X.opts.bundle)if(X.opts.watch)await L8(X,Z,J);else q0(X,Z,J,X.opts.eval?[X.opts.eval]:X.inputs.map((W)=>G(i(W),X.logger)),X.opts.out);else if(X.opts.watch)await b8(X,Z,J);else if(X.opts.eval)try{q0(X,Z,J,[X.opts.eval])}catch(W){X.logger.warn(W.message)}else for(let W of X.inputs)try{W=i(W);const Y=!X.opts.noWrite?W.replace(/\.mcss$/,".css"):void 0;q0(X,Z,J,[G(W,X.logger)],Y)}catch(Y){X.logger.warn(Y.message)}}},b8=async(X,Z,J)=>{let W=!0,Y;const B=()=>{X.logger.info("closing watchers..."),Y.forEach((V)=>V.close()),W=!1};Y=X.inputs.map((V)=>{V=i(V);const z=!X.opts.noWrite?V.replace(/\.mcss$/,".css"):void 0,Q=()=>{try{return q0(X,Z,J,[G(V,X.logger)],z),!0}catch($){if(X.logger.warn($.message+": "+V),Y)B()}};if(!Q())process.exit(1);return E4(V,{},($)=>{if($==="change")Q();else X.logger.warn("input removed:",V),B()})}),X.logger.info("waiting for changes, press ctrl+c to cancel..."),process.on("SIGINT",B);while(W)await s0(null,250)},L8=async(X,Z,J)=>{let W=!0;const Y=()=>{X.logger.info("closing watchers..."),B.forEach((V)=>V.watcher.close()),W=!1},B=X.inputs.map((V,z)=>{V=i(V);const Q=C4(G(V,X.logger),{id:`in${G4(z)}`});return{input:Q,watcher:E4(V,{},($)=>{if($==="change")try{Q.next(G(V,X.logger))}catch(U){X.logger.warn(U.message),Y()}else X.logger.warn("input removed:",V),Y()})}});O4({src:B1(w(({input:V})=>[V.id,V],B))}).subscribe({next(V){try{q0(X,Z,J,Object.keys(V).sort().map((z)=>V[z]),X.opts.out)}catch(z){X.logger.warn(z.message)}}}),process.on("SIGINT",Y);while(W)await s0(null,250)},q0=({logger:X,opts:{include:Z,noDecls:J,noHeader:W,pretty:Y}},B,V,z,Q)=>{const $={logger:X,specs:B,format:Y?U0:x,mediaQueryIDs:new Set(Object.keys(B.media)),mediaQueryRules:{...V.mediaQueryRules},plainRules:{...V.plainRules}},U=Z?Z.map((q)=>G(i(q),X).trim()):[];if(!W)U.push(f0(B));if(!J&&B.decls.length)U.push(l(B.decls,{format:$.format,fns:p}));z.forEach((q)=>h8(q,$)),_8(U,$),S8(U,$),B0(Q,U,X)},S8=(X,{logger:Z,specs:J,format:W,mediaQueryRules:Y})=>{for(let B in Y){const V=S4(Y[B],J);Z.debug("mediaquery rules",B,V),X.push(l(J0(u8(J.media,B),V),{format:W,fns:p}))}},_8=(X,{logger:Z,specs:J,format:W,plainRules:Y})=>{const B=S4(Y,J);Z.debug("plain rules",B),X.push(l(B,{format:W,fns:p}))},y8=(X,Z,J)=>{const W=new Set(Object.keys(X.media)),Y=new Set(Object.keys(X.classes)),B={},V={};if(Z.length&&Z[0][0]==="@")Z=[...g(G(i(Z[0].substring(1)),J))];for(let z of Z){if(!z||z.startsWith("//"))continue;const{token:Q,query:$}=_4(z,W);let U;if(Q.includes("*")){const q=new RegExp(`^${Q.replace("*",".*")}\$`);U=[...$1((K)=>q.test(K),Y)]}else if(Y.has(Q))U=[Q];else{J.warn(`unknown include rule ID: ${z}, skipping...`);continue}for(let q of U)J.debug("including class:",q),$?y4(B,$,`.${q}`,q):h4(V,`.${q}`,q)}return{mediaQueryRules:B,plainRules:V}},h8=(X,{specs:Z,mediaQueryIDs:J,mediaQueryRules:W,plainRules:Y})=>{const B=K0(),V=K0(B),z={root:B,curr:V,scopes:[V]};for(let Q of g(X)){if(!Q||/^\s*\/\//.test(Q))continue;for(let $ of g(Q,/\s+/g)){if(!$)continue;let U=z.curr;switch(U.state){case"sel":case"nest":if($==="{"){if(U.state==="sel")U.sel=U.sel.map((q)=>q.replace(",","")),U.path=m8(z.scopes);U.state="class"}else if($==="}")v4(z);else{const q=Q0(U.sel);if(!q||q.endsWith(","))U.sel.push($);else U.sel[U.sel.length-1]+=" "+$}break;case"class":if($==="{")U.state="nest",z.scopes.push(z.curr=K0(U));else if($==="}")v4(z);else{let{token:q,query:K}=_4($,J);if(!Z.classes[q]&&!q.includes("="))H(`unknown class ID: ${q}`);if(K)y4(W,K,U.path,q);else h4(Y,U.path,q)}break;default:s(U.state)}}}},q1=":",L4="///",K0=(X)=>({state:"sel",sel:X?[]:["<root>"],path:"",parent:X}),v4=(X)=>{const Z=!X.curr.sel.length;if(j0(!!X.curr.parent,"stack underflow"),X.scopes.pop(),X.scopes.length>0){if(X.curr=Q0(X.scopes),!Z&&X.curr.state==="nest")X.scopes.push(X.curr=K0(X.curr))}else X.scopes.push(X.curr=K0(X.root))},m8=(X)=>X.map((Z)=>Z.sel.join(",")).join(L4),S4=(X,Z)=>Object.entries(X).map(([J,W])=>f8(J,W,Z)),f8=(X,Z,J)=>{const W=[];let Y=W;const B=X.split(L4);for(let V=0;V<B.length;V++){const z=B[V].split(",");if(V==B.length-1){const Q=Object.assign({},...w(($)=>g8(J,$),Z));if("__user"in Q)delete Q.__user;z.push(Q)}Y.push(z),Y=z}return W[0]},_4=(X,Z)=>{if(/^::?/.test(X))return{token:X};const J=X.lastIndexOf(q1);if(J<0)return{token:X};const W=X.substring(0,J);if(!W.split(q1).every((B)=>Z.has(B)))H(`invalid media query in token: ${X}`);return{token:X.substring(J+1),query:W}},u8=(X,Z)=>Z.split(q1).reduce((J,W)=>Object.assign(J,X[W]),{}),y4=(X,Z,J,W)=>{if(!X[Z])X[Z]={};(X[Z][J]||(X[Z][J]=new Set)).add(W)},h4=(X,Z,J)=>(X[Z]||(X[Z]=new Set)).add(J),g8=(X,Z)=>{const J=Z.indexOf("=");return J>0?{[`--${Z.substring(0,J)}`]:Z.substring(J+1)}:X.classes[Z]};import{resolve as m4} from"path";var u4={desc:"Export entire generated framework as CSS",opts:{...y0,...h0,...R4,...W0,...Y0,...m0,...I4},inputs:1,fn:async(X)=>{const{logger:Z,opts:{include:J,media:W,noDecls:Y,noHeader:B,onlyDecls:V,pretty:z,out:Q},inputs:$}=X,U=y(m4($[0]),Z),q=J?J.map((K)=>G(m4(K),Z).trim()):[];if(!B)q.push(f0(U));if(!Y&&U.decls.length)q.push(l(U.decls,{format:z?U0:x,fns:p}));if(!V)q.push(x8(U,W,z,Z));B0(Q,q,Z)}},x8=(X,Z,J,W)=>{const Y=f4("",X);if(Z){const B=Z[0]==="ALL"?Object.keys(X.media):Z;for(let V of B)if(X.media[V])Y.push(J0(X.media[V],f4("-"+V,X)));else W.warn(`invalid media query ID: ${V}, skipping...`)}return l(Y,{format:J?U0:x,fns:p})},f4=(X,Z)=>Object.entries(Z.classes).map(([J,W])=>[`.${J}${X}`,d8(W)]),d8=(X)=>{if("__user"in X)X={...X},delete X.__user;return X};import{resolve as n8} from"path";var g4={deg:$4,em:X4,ex:Z4,ms:Q4,percent:Y1,px:W4,rad:q4,rem:J4,second:U4,turn:K4,url:H4,vh:Y4,vmax:z4,vmin:V4,vw:B4,"%":Y1},l8={"":[""],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"]},x4={desc:"Generate framework rules from specs",opts:{...W0,...Y0,prec:N1({default:3,desc:"Number of fractional digits"})},fn:async(X)=>{const{logger:Z,opts:{prec:J,out:W,pretty:Y},inputs:B}=X,V={info:{name:"TODO",version:"0.0.0"},media:{},classes:{},decls:[]};e1(J);for(let z of B){const Q=y(n8(z),Z);if(Object.assign(V.info,Q.info),Object.assign(V.media,Q.media),Q.decls)V.decls.push(...Q.decls);for(let $ of Q.specs)p8(Q,$,V.classes,Z)}B0(W,JSON.stringify(V,null,Y?4:0),Z)}},p8=(X,Z,J,W)=>{const Y=F(Z.vars)?Z.vars:[""],B=P(Z.props)?{[Z.props]:"<v>"}:Z.props,V=o8(Z,X),z=new Set;for(let Q of Y)for(let[$,U]of L0(X.vars?.[Q]||l8[Q],Object.keys(V))){const q=H0(Z.name,Q,$,U,V[U]),K=Z.unit?H0(Z.unit,Q,$,U,V[U]):void 0,L=i8(V[U],K);if(!J[q])J[q]=Z.user!=null?{__user:H0(Z.user,Q,$,U,V[U])}:{};else if(!z.has(q))H(`duplicate class ID: ${q}`);z.add(q);for(let[a,S]of Object.entries(B)){const M=H0(a,Q,$,U,V[U]),_=H0(!K||P(S)?String(S):g4[K](S),Q,$,U,L);J[q][M]=_,W.debug(q,M,_)}}return J},o8=(X,Z)=>{const J=P(X.values)?Z.tables?.[X.values]||H(`invalid table ID: ${X.values}`):X.values;if(A(J))return J;const W=X.key==="v"?(Y)=>String(Y):X.key==="i+1"?(Y,B)=>String(B+1):X.key===void 0?(Y,B)=>String(B):H(`invalid key type: ${X.key}`);return J.reduce((Y,B,V)=>{return Y[W(B,V)]=B,Y},{})},i8=(X,Z)=>{if(!Z||P(X))return X;const J=g4[Z];if(!J)H(`invalid unit: ${Z}`);return J(X)},H0=(X,Z,J,W,Y)=>X.replace("<vid>",Z).replace("<var>",J).replace("<k>",W).replace("<v>",String(Y));var K1=y(a8(import.meta.dir,"package.json"));h1({name:"metacss",opts:{verbose:T({alias:"v",desc:"Display extra process information"})},commands:{convert:b4,export:u4,generate:x4},ctx:async(X)=>{if(X.opts.verbose)X.logger.level=C.DEBUG;return{...X,format:D0}},usage:{prefix:`
6
6
  \u2588 \u2588 \u2588 \u2502
7
7
  \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}
8
+ \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2502 ${K1.name} ${K1.version}
9
+ \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2502 ${K1.description}
10
10
  \u2588 \u2502
11
11
  \u2588 \u2588 \u2502
12
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/meta-css",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "Data-driven CSS framework codegen, transpiler & bundler",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -38,19 +38,19 @@
38
38
  "test": "bun test"
39
39
  },
40
40
  "dependencies": {
41
- "@thi.ng/api": "^8.9.16",
42
- "@thi.ng/args": "^2.3.4",
43
- "@thi.ng/arrays": "^2.7.13",
44
- "@thi.ng/checks": "^3.4.16",
45
- "@thi.ng/compose": "^2.1.55",
46
- "@thi.ng/errors": "^2.4.10",
47
- "@thi.ng/file-io": "^1.1.4",
48
- "@thi.ng/hiccup-css": "^2.3.6",
49
- "@thi.ng/logger": "^2.1.3",
50
- "@thi.ng/rstream": "^8.2.19",
51
- "@thi.ng/strings": "^3.7.7",
52
- "@thi.ng/text-format": "^2.0.3",
53
- "@thi.ng/transducers": "^8.8.20"
41
+ "@thi.ng/api": "^8.9.17",
42
+ "@thi.ng/args": "^2.3.5",
43
+ "@thi.ng/arrays": "^2.7.14",
44
+ "@thi.ng/checks": "^3.4.17",
45
+ "@thi.ng/compose": "^2.1.56",
46
+ "@thi.ng/errors": "^2.4.11",
47
+ "@thi.ng/file-io": "^1.1.5",
48
+ "@thi.ng/hiccup-css": "^2.4.0",
49
+ "@thi.ng/logger": "^2.1.4",
50
+ "@thi.ng/rstream": "^8.2.20",
51
+ "@thi.ng/strings": "^3.7.8",
52
+ "@thi.ng/text-format": "^2.0.4",
53
+ "@thi.ng/transducers": "^8.8.21"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@microsoft/api-extractor": "^7.39.0",
@@ -105,5 +105,5 @@
105
105
  "status": "alpha",
106
106
  "year": 2023
107
107
  },
108
- "gitHead": "b3db173682e1148cf08a6bd907b8d90b47b7c066\n"
108
+ "gitHead": "417b5a7ea7bd54a3b4f086fe0fc2ce8e8933c9b2\n"
109
109
  }
@@ -1,13 +1,22 @@
1
1
  {
2
- "decls": [["@keyframes", "fadein", { "opacity": 0 }, { "opacity": 1 }]],
2
+ "decls": [
3
+ ["@keyframes", "fadein", { "opacity": 0 }, { "opacity": 1 }],
4
+ ["@keyframes", "fadeout", { "opacity": 1 }, { "opacity": 0 }],
5
+ ["@keyframes", "spin", { "rotate": 0 }, { "rotate": "1turn" }]
6
+ ],
7
+ "vars": {
8
+ "in": [""],
9
+ "out": [""]
10
+ },
3
11
  "specs": [
4
12
  {
5
13
  "user": "animations / transitions",
6
- "name": "fadein<k>",
14
+ "name": "fade<vid><k>",
7
15
  "key": "i+1",
8
- "props": { "animation": "fadein <v> ease-in-out forwards" },
16
+ "props": { "animation": "fade<vid> <v> ease-in-out forwards" },
9
17
  "values": [0.25, 0.5, 1],
10
- "unit": "second"
18
+ "unit": "second",
19
+ "vars": ["in", "out"]
11
20
  },
12
21
  {
13
22
  "user": "animations / transitions",
@@ -16,6 +25,20 @@
16
25
  "props": { "transition": "<v> background-color ease-in-out" },
17
26
  "values": [0.15, 0.25, 0.5],
18
27
  "unit": "second"
28
+ },
29
+ {
30
+ "user": "animations / transitions",
31
+ "name": "spin<k>",
32
+ "key": "i+1",
33
+ "props": { "animation": "spin <v> linear infinite" },
34
+ "values": [0.75, 1.5, 2.5],
35
+ "unit": "second"
36
+ },
37
+ {
38
+ "user": "animations / transitions",
39
+ "name": "anim-<v>",
40
+ "props": "animation-direction",
41
+ "values": ["normal", "reverse", "alternate", "alternate-reverse"]
19
42
  }
20
43
  ]
21
44
  }
@@ -3,25 +3,47 @@
3
3
  {
4
4
  "user": "aspect ratios",
5
5
  "name": "aspect-ratio-<k>",
6
+ "props": "aspect-ratio",
7
+ "values": {
8
+ "1x1": "1/1",
9
+ "1x2": "1/2",
10
+ "2x1": "2/1",
11
+ "2x3": "2/3",
12
+ "3x2": "3/2",
13
+ "3x4": "3/4",
14
+ "4x3": "4/3",
15
+ "5x7": "5/7",
16
+ "7x5": "7/5",
17
+ "9x16": "9/16",
18
+ "16x9": "16/9"
19
+ }
20
+ },
21
+ {
22
+ "user": "aspect ratios",
23
+ "name": "bg-aspect-ratio-<k>",
6
24
  "props": {
7
25
  "height": 0,
8
26
  "position": "relative",
9
27
  "padding-bottom": "<v>"
10
28
  },
11
29
  "values": {
12
- "16x9": 56.25,
13
- "9x16": 177.7777,
14
- "4x3": 75,
30
+ "1x1": 100,
31
+ "1x2": 200,
32
+ "2x1": 50,
33
+ "2x3": 150,
34
+ "3x2": 66.6666,
15
35
  "3x4": 133.3333,
16
- "6x4": 66.6666,
17
- "4x6": 150,
18
- "1x1": 100
36
+ "4x3": 75,
37
+ "5x7": 140,
38
+ "7x5": 71.4286,
39
+ "9x16": 177.7777,
40
+ "16x9": 56.25
19
41
  },
20
42
  "unit": "%"
21
43
  },
22
44
  {
23
45
  "user": "aspect ratios",
24
- "name": "aspect-ratio-object",
46
+ "name": "bg-aspect-ratio-object",
25
47
  "props": {
26
48
  "position": "absolute",
27
49
  "top": 0,
@@ -70,64 +70,64 @@
70
70
  "specs": [
71
71
  {
72
72
  "user": "colors",
73
- "name": "b--vcol<k>",
73
+ "name": "b--color<k>",
74
74
  "key": "i+1",
75
75
  "props": { "border-color": "<v>" },
76
76
  "values": "var-palette"
77
77
  },
78
78
  {
79
79
  "user": "colors",
80
- "name": "b--<k>",
80
+ "name": "b--color-<k>",
81
81
  "props": "border-color",
82
82
  "values": "palette"
83
83
  },
84
84
  {
85
85
  "user": "colors",
86
- "name": "b--<k>",
86
+ "name": "b--color-<k>",
87
87
  "props": "border-color",
88
88
  "values": "grays"
89
89
  },
90
90
  {
91
91
  "user": "colors",
92
- "name": "vcol<k>",
92
+ "name": "color<k>",
93
93
  "key": "i+1",
94
94
  "props": { "color": "<v>" },
95
95
  "values": "var-palette"
96
96
  },
97
97
  {
98
98
  "user": "colors",
99
- "name": "<k>",
99
+ "name": "color-<k>",
100
100
  "props": "color",
101
101
  "values": "palette"
102
102
  },
103
103
  {
104
104
  "user": "colors",
105
- "name": "<k>",
105
+ "name": "color-<k>",
106
106
  "props": "color",
107
107
  "values": "grays"
108
108
  },
109
109
  {
110
110
  "user": "colors",
111
- "name": "bg-vcol<k>",
111
+ "name": "bg-color<k>",
112
112
  "key": "i+1",
113
113
  "props": { "background-color": "<v>" },
114
114
  "values": "var-palette"
115
115
  },
116
116
  {
117
117
  "user": "colors",
118
- "name": "bg-<k>",
118
+ "name": "bg-color-<k>",
119
119
  "props": "background-color",
120
120
  "values": "palette"
121
121
  },
122
122
  {
123
123
  "user": "colors",
124
- "name": "bg-<k>",
124
+ "name": "bg-color-<k>",
125
125
  "props": "background-color",
126
126
  "values": "grays"
127
127
  },
128
128
  {
129
129
  "user": "colors",
130
- "name": "<var>-vcol<k>",
130
+ "name": "<var>-color<k>",
131
131
  "key": "i+1",
132
132
  "props": { "<var>": "<v>" },
133
133
  "values": "var-palette",
@@ -135,14 +135,14 @@
135
135
  },
136
136
  {
137
137
  "user": "colors",
138
- "name": "<var>-<k>",
138
+ "name": "<var>-color-<k>",
139
139
  "props": { "<var>": "<v>" },
140
140
  "values": "palette",
141
141
  "vars": ["fill-stroke"]
142
142
  },
143
143
  {
144
144
  "user": "colors",
145
- "name": "<var>-<k>",
145
+ "name": "<var>-color-<k>",
146
146
  "props": { "<var>": "<v>" },
147
147
  "values": "grays",
148
148
  "vars": ["fill-stroke"]
@@ -0,0 +1,10 @@
1
+ {
2
+ "specs": [
3
+ {
4
+ "user": "content",
5
+ "name": "content-<v>",
6
+ "props": { "content": "attr(<v>)" },
7
+ "values": ["id", "href", "name", "slot", "title", "data-lang"]
8
+ }
9
+ ]
10
+ }
@@ -63,6 +63,7 @@
63
63
  "vars": ["w", "h"]
64
64
  },
65
65
  {
66
+ "user": "<var>",
66
67
  "name": "v<vid>-<v>",
67
68
  "props": "<var>",
68
69
  "values": [25, 50, 75, 100],
@@ -2,27 +2,27 @@
2
2
  "specs": [
3
3
  {
4
4
  "user": "display mode",
5
- "name": "d<k>",
5
+ "name": "<k>",
6
6
  "props": "display",
7
7
  "values": {
8
- "b": "block",
9
- "f": "flex",
10
- "g": "grid",
11
- "i": "inline",
12
- "ib": "inline-block",
13
- "if": "inline-flex",
14
- "ig": "inline-grid",
15
- "n": "none",
16
- "t": "table",
17
- "tc": "table-cell",
18
- "tr": "table-row"
8
+ "db": "block",
9
+ "flex": "flex",
10
+ "grid": "grid",
11
+ "di": "inline",
12
+ "dib": "inline-block",
13
+ "dif": "inline-flex",
14
+ "dig": "inline-grid",
15
+ "dn": "none",
16
+ "dt": "table",
17
+ "dtc": "table-cell",
18
+ "dtr": "table-row"
19
19
  }
20
20
  },
21
21
  {
22
22
  "user": "visibility",
23
23
  "name": "<v>",
24
24
  "props": { "visibility": "<v> !important" },
25
- "values": ["hidden", "visible"]
25
+ "values": ["hidden", "visible", "collapse"]
26
26
  }
27
27
  ]
28
28
  }
@@ -0,0 +1,39 @@
1
+ {
2
+ "tables": {
3
+ "align": ["start", "end", "center"]
4
+ },
5
+ "vars": {
6
+ "align": [""],
7
+ "justify": [""],
8
+ "grow": [""],
9
+ "shrink": [""]
10
+ },
11
+ "specs": [
12
+ {
13
+ "user": "flex layout",
14
+ "name": "flex-<v>",
15
+ "props": "flex-direction",
16
+ "values": ["column", "column-reverse", "row", "row-reverse"]
17
+ },
18
+ {
19
+ "user": "flex layout",
20
+ "name": "<vid>-content-<v>",
21
+ "props": "<vid>-content",
22
+ "values": "align",
23
+ "vars": ["align", "justify"]
24
+ },
25
+ {
26
+ "user": "flex layout",
27
+ "name": "flex-<v>",
28
+ "props": "flex-wrap",
29
+ "values": ["wrap", "nowrap", "wrap-reverse"]
30
+ },
31
+ {
32
+ "user": "flex layout",
33
+ "name": "flex-<vid><v>",
34
+ "props": "flex-<vid>",
35
+ "values": [0, 1],
36
+ "vars": ["grow", "shrink"]
37
+ }
38
+ ]
39
+ }
@@ -3,8 +3,8 @@
3
3
  "align": ["start", "end", "center", "stretch"]
4
4
  },
5
5
  "vars": {
6
- "align": ["align"],
7
- "justify": ["justify"],
6
+ "align": [""],
7
+ "justify": [""],
8
8
  "cols": ["columns"],
9
9
  "rows": ["rows"]
10
10
  },
@@ -44,15 +44,15 @@
44
44
  },
45
45
  {
46
46
  "user": "grid layout",
47
- "name": "<var>-self-<v>",
48
- "props": "<var>-self",
47
+ "name": "<vid>-self-<v>",
48
+ "props": "<vid>-self",
49
49
  "values": "align",
50
50
  "vars": ["align", "justify"]
51
51
  },
52
52
  {
53
53
  "user": "grid layout",
54
- "name": "<var>-items-<v>",
55
- "props": "<var>-items",
54
+ "name": "<vid>-items-<v>",
55
+ "props": "<vid>-items",
56
56
  "values": "align",
57
57
  "vars": ["align", "justify"]
58
58
  }
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "tables": {
3
- "margins": [0, 0.25, 0.5, 1, 2]
3
+ "margins": [0, 0.25, 0.5, 1, 2, 4]
4
+ },
5
+ "vars": {
6
+ "s": ["start"],
7
+ "e": ["end"]
4
8
  },
5
9
  "specs": [
6
10
  {
@@ -27,6 +31,22 @@
27
31
  "margin-right": "<v>"
28
32
  },
29
33
  "values": { "center": "auto" }
34
+ },
35
+ {
36
+ "user": "padding",
37
+ "name": "pb<vid>-<k>",
38
+ "props": "padding-block-<var>",
39
+ "values": "margins",
40
+ "unit": "rem",
41
+ "vars": ["s", "e"]
42
+ },
43
+ {
44
+ "user": "margin",
45
+ "name": "mb<vid>-<k>",
46
+ "props": "margin-block-<var>",
47
+ "values": "margins",
48
+ "unit": "rem",
49
+ "vars": ["s", "e"]
30
50
  }
31
51
  ]
32
52
  }
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "decls": [
3
3
  ["@comment", "----- start: CSS normalization -----"],
4
+ ["@comment", "based on: https://github.com/necolas/normalize.css"],
4
5
  [":root", { "font-size": "16px" }],
5
6
  ["html", { "line-height": 1.15, "-webkit-text-size-adjust": "100%" }],
6
7
  ["body", { "margin": 0 }],
@@ -0,0 +1,25 @@
1
+ {
2
+ "vars": {
3
+ "after": [""],
4
+ "before": [""]
5
+ },
6
+ "specs": [
7
+ {
8
+ "user": "print",
9
+ "name": "break-<vid>-<v>",
10
+ "props": "break-<vid>",
11
+ "values": [
12
+ "avoid",
13
+ "avoid-column",
14
+ "avoid-page",
15
+ "column",
16
+ "left",
17
+ "right",
18
+ "page",
19
+ "recto",
20
+ "verso"
21
+ ],
22
+ "vars": ["after", "before"]
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "specs": [
3
+ {
4
+ "user": "scrolling",
5
+ "name": "ss-<v>",
6
+ "props": {
7
+ "scroll-snap-type": "<v> mandatory"
8
+ },
9
+ "values": ["x", "y", "both"]
10
+ },
11
+ {
12
+ "user": "scrolling",
13
+ "name": "ss-<v>",
14
+ "props": "scroll-snap-align",
15
+ "values": ["start", "end", "center"]
16
+ },
17
+ {
18
+ "user": "scrolling",
19
+ "name": "ss-<v>",
20
+ "props": "scroll-snap-stop",
21
+ "values": ["normal", "always"]
22
+ }
23
+ ]
24
+ }