mancha 0.21.2 → 0.21.4
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/biome.json +1 -1
- package/dist/browser.d.ts +8 -3
- package/dist/browser.js +3 -3
- package/dist/browser.js.map +1 -1
- package/dist/css_custom.d.ts +20 -0
- package/dist/css_custom.js +166 -0
- package/dist/css_custom.js.map +1 -0
- package/dist/css_gen_utils.js +28 -27
- package/dist/css_gen_utils.js.map +1 -1
- package/dist/mancha.js +33 -33
- package/dist/mancha.js.map +1 -1
- package/dist/{renderer-C2znMiAH.js → renderer-D5EM0ZYN.js} +1 -1
- package/dist/safe_browser.js +1 -1
- package/dist/store.js +5 -2
- package/dist/store.js.map +1 -1
- package/docs/00_quickstart.md +52 -1
- package/docs/01_syntax.md +7 -2
- package/docs/02_initialization.md +191 -4
- package/docs/04_components.md +76 -1
- package/docs/05_css.md +90 -1
- package/package.json +5 -3
package/biome.json
CHANGED
package/dist/browser.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { a as StoreState, i as IRenderer, n as RenderParams, r as RendererPlugin, t as ParserParams } from "./interfaces-CEwZWoH1.js";
|
|
2
2
|
import { SafeStyleSheet } from "safevalues";
|
|
3
3
|
|
|
4
|
+
//#region src/css_custom.d.ts
|
|
5
|
+
|
|
6
|
+
/** For testing: reset module state. */
|
|
7
|
+
declare function _resetForTesting(): void;
|
|
8
|
+
//#endregion
|
|
4
9
|
//#region src/css_gen_basic.d.ts
|
|
5
10
|
declare function rules(): SafeStyleSheet;
|
|
6
11
|
//#endregion
|
|
@@ -24,10 +29,10 @@ declare class Renderer<T extends StoreState = StoreState> extends IRenderer<T> {
|
|
|
24
29
|
}
|
|
25
30
|
declare const Mancha: Renderer<StoreState>;
|
|
26
31
|
/** Options for CSS injection. */
|
|
27
|
-
type CssName = "minimal" | "utils" | "basic";
|
|
32
|
+
type CssName = "minimal" | "utils" | "basic" | "custom";
|
|
28
33
|
/**
|
|
29
34
|
* Injects CSS rules into the document head.
|
|
30
|
-
* @param names - Array of CSS names to inject ("minimal", "utils", "basic").
|
|
35
|
+
* @param names - Array of CSS names to inject ("minimal", "utils", "basic", "custom").
|
|
31
36
|
*/
|
|
32
37
|
declare function injectCss(names: CssName[]): void;
|
|
33
38
|
/** Options for cloaking (hiding content until rendered). */
|
|
@@ -75,4 +80,4 @@ interface InitManchaOptions<T extends StoreState = StoreState> {
|
|
|
75
80
|
*/
|
|
76
81
|
declare function initMancha<T extends StoreState = StoreState>(options?: InitManchaOptions<T>): Promise<Renderer<T>>;
|
|
77
82
|
//#endregion
|
|
78
|
-
export { CloakOptions, CssName, IRenderer, InitManchaOptions, Mancha, type ParserParams, type RenderParams, Renderer, type RendererPlugin, rules as basicCssRules, initMancha, injectCss, rules$1 as minimalCssRules, rules$2 as utilsCssRules };
|
|
83
|
+
export { CloakOptions, CssName, IRenderer, InitManchaOptions, Mancha, type ParserParams, type RenderParams, Renderer, type RendererPlugin, _resetForTesting as _resetCustomCssForTesting, rules as basicCssRules, initMancha, injectCss, rules$1 as minimalCssRules, rules$2 as utilsCssRules };
|
package/dist/browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,t}from"./renderer-C2znMiAH.js";import{safeStyleEl as n}from"safevalues/dom";import{concatStyleSheets as r,safeStyleSheet as i}from"safevalues";function a(){return r([i`*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}`,i`html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}`,i`body{margin:0;line-height:inherit}`,i`hr{height:0;color:inherit;border-top-width:1px}`,i`abbr:where([title]){text-decoration:underline dotted}`,i`b,strong{font-weight:bolder}`,i`code,kbd,samp,pre{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-size:1em}`,i`small{font-size:80%}`,i`sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}`,i`sub{bottom:-0.25em}`,i`sup{top:-0.5em}`,i`button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}`,i`button,select{text-transform:none}`,i`button,[type='button'],[type='reset'],[type='submit']{-webkit-appearance:button;background-color:transparent;background-image:none;cursor:pointer}`,i`:-moz-focusring{outline:auto}`,i`:-moz-ui-invalid{box-shadow:none}`,i`progress{vertical-align:baseline}`,i`::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}`,i`[type='search']{-webkit-appearance:textfield;outline-offset:-2px}`,i`::-webkit-search-decoration{-webkit-appearance:none}`,i`::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}`,i`summary{display:list-item}`,i`blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}`,i`fieldset{margin:0;padding:0}`,i`legend{padding:0}`,i`ol,ul,menu{list-style:none;margin:0;padding:0}`,i`textarea{resize:vertical}`,i`::placeholder{opacity:1;color:#9ca3af}`,i`button,[role="button"]{cursor:pointer}`,i`:disabled{cursor:default;pointer-events:none;opacity:0.75}`,i`img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}`,i`img,video{max-width:100%;height:auto}`,i`[hidden]{display:none}`,i`dialog{padding:0}`,i`dialog::backdrop{background:rgba(0,0,0,0.5)}`])}function o(){return r([i`html{`,i`max-width: 70ch;`,i`padding: 2em 1em;`,i`margin: auto;`,i`line-height: 1.75;`,i`font-size: 1.25em;`,i`font-family: sans-serif;`,i`}`,i`h1,h2,h3,h4,h5,h6{`,i`margin: 1em 0 0.5em;`,i`}`,i`p,ul,ol{`,i`margin-bottom: 1em;`,i`color: #1d1d1d;`,i`}`])}const s={sm:640,md:768,lg:1024,xl:1280},c=Object.entries(s),l=.25,u=[...Array(15)].map((e,t)=>t+1),d=[16,20,24,28,32,36,40,48,56,64],f=[72,80,96,128,160,192,256,320,384,512],p=[...u,...d,...f,...Object.values(s)],m=Array.from({length:20},(e,t)=>(t+1)*5),h=[0,10,20,30,40,50,60,70,80,90,100],g=[25,50,75,100,150,200,300,500,700,1e3],_=[`hover`,`focus`,`disabled`],v={margin:`m`,padding:`p`},y={width:`w`,height:`h`},b={top:`top`,right:`right`,bottom:`bottom`,left:`left`},x={"min-width":`min-w`,"min-height":`min-h`,"max-width":`max-w`,"max-height":`max-h`},S={"font-mono":{"font-family":`monospace`},"font-sans":{"font-family":`sans-serif`},"font-serif":{"font-family":`serif`},"font-cursive":{"font-family":`cursive`},"text-xs":{"font-size":`.75rem`,"line-height":`calc(1 / 0.75)`},"text-sm":{"font-size":`.875rem`,"line-height":`calc(1.25 / 0.875)`},"text-base":{"font-size":`1rem`,"line-height":`calc(1.5 / 1)`},"text-lg":{"font-size":`1.125rem`,"line-height":`calc(1.75 / 1.125)`},"text-xl":{"font-size":`1.25rem`,"line-height":`calc(1.75 / 1.25)`},"text-2xl":{"font-size":`1.5rem`,"line-height":`calc(2 / 1.5)`},"text-3xl":{"font-size":`1.875rem`,"line-height":`calc(2.25 / 1.875)`},"text-4xl":{"font-size":`2.25rem`,"line-height":`calc(2.5 / 2.25)`},"text-5xl":{"font-size":`3rem`,"line-height":`1`},"text-6xl":{"font-size":`3.75rem`,"line-height":`1`},"text-7xl":{"font-size":`4.5rem`,"line-height":`1`},"font-thin":{"font-weight":100},"font-extralight":{"font-weight":200},"font-light":{"font-weight":300},"font-normal":{"font-weight":400},"font-medium":{"font-weight":500},"font-semibold":{"font-weight":600},"font-bold":{"font-weight":700},"font-extrabold":{"font-weight":800},"font-black":{"font-weight":900},italic:{"font-style":`italic`},"not-italic":{"font-style":`normal`},"w-max":{width:`max-content`},"w-min":{width:`min-content`},"w-fit":{width:`fit-content`},"h-max":{height:`max-content`},"h-min":{height:`min-content`},"h-fit":{height:`fit-content`},"size-auto":{width:`auto`,height:`auto`},"size-px":{width:`1px`,height:`1px`},"size-full":{width:`100%`,height:`100%`},"size-dvw":{width:`100dvw`,height:`100dvw`},"size-dvh":{width:`100dvh`,height:`100dvh`},"size-lvw":{width:`100lvw`,height:`100lvw`},"size-lvh":{width:`100lvh`,height:`100lvh`},"size-svw":{width:`100svw`,height:`100svw`},"size-svh":{width:`100svh`,height:`100svh`},"size-min":{width:`min-content`,height:`min-content`},"size-max":{width:`max-content`,height:`max-content`},"size-fit":{width:`fit-content`,height:`fit-content`},"tracking-tighter":{"letter-spacing":`-0.05em`},"tracking-tight":{"letter-spacing":`-0.025em`},"tracking-normal":{"letter-spacing":`0`},"tracking-wide":{"letter-spacing":`0.025em`},"tracking-wider":{"letter-spacing":`0.05em`},"tracking-widest":{"letter-spacing":`0.1em`},"leading-none":{"line-height":`1`},"leading-tight":{"line-height":`1.25`},"leading-snug":{"line-height":`1.375`},"leading-normal":{"line-height":`1.5`},"leading-relaxed":{"line-height":`1.625`},"leading-loose":{"line-height":`2`},"text-left":{"text-align":`left`},"text-right":{"text-align":`right`},"text-center":{"text-align":`center`},"text-justify":{"text-align":`justify`},underline:{"text-decoration":`underline`},"no-underline":{"text-decoration":`none`},"decoration-none":{"text-decoration":`none`},"line-through":{"text-decoration":`line-through`},uppercase:{"text-transform":`uppercase`},lowercase:{"text-transform":`lowercase`},capitalize:{"text-transform":`capitalize`},truncate:{"white-space":`nowrap`,overflow:`hidden`,"text-overflow":`ellipsis`},"text-elipsis":{"text-overflow":`ellipsis`},"text-clip":{"text-overflow":`clip`},"text-wrap":{"text-wrap":`wrap`},"text-nowrap":{"text-wrap":`nowrap`},"text-balance":{"text-wrap":`balance`},"text-pretty":{"text-wrap":`pretty`},"whitespace-normal":{"white-space":`normal`},"whitespace-nowrap":{"white-space":`nowrap`},"whitespace-pre":{"white-space":`pre`},"whitespace-pre-line":{"white-space":`pre-line`},"whitespace-pre-wrap":{"white-space":`pre-wrap`},"whitespace-break-spaces":{"white-space":`break-spaces`},relative:{position:`relative`},fixed:{position:`fixed`},absolute:{position:`absolute`},sticky:{position:`sticky`},"object-contain":{"object-fit":`contain`},"object-cover":{"object-fit":`cover`},"object-fill":{"object-fit":`fill`},"object-none":{"object-fit":`none`},block:{display:`block`},contents:{display:`contents`},hidden:{display:`none`},inline:{display:`inline`},"inline-block":{display:`inline-block`},visible:{visibility:`visible`},invisible:{visibility:`hidden`},collapse:{visibility:`collapse`},"list-none":{"list-style-type":`none`},"list-disc":{"list-style-type":`disc`},"list-decimal":{"list-style-type":`decimal`},flex:{display:`flex`},grid:{display:`grid`},"flex-1":{flex:`1 1 0%`},"flex-inline":{display:`inline-flex`},"flex-row":{"flex-direction":`row`},"flex-col":{"flex-direction":`column`},"flex-row-reverse":{"flex-direction":`row-reverse`},"flex-col-reverse":{"flex-direction":`column-reverse`},"flex-wrap":{"flex-wrap":`wrap`},"flex-wrap-reverse":{"flex-wrap":`wrap-reverse`},"flex-nowrap":{"flex-wrap":`nowrap`},"justify-start":{"justify-content":`flex-start`},"justify-end":{"justify-content":`flex-end`},"justify-center":{"justify-content":`center`},"justify-between":{"justify-content":`space-between`},"justify-around":{"justify-content":`space-around`},"justify-evenly":{"justify-content":`space-evenly`},"justify-stretch":{"justify-content":`stretch`},"items-start":{"align-items":`flex-start`},"items-end":{"align-items":`flex-end`},"items-center":{"align-items":`center`},"items-stretch":{"align-items":`stretch`},"flex-grow":{"flex-grow":1},"flex-shrink":{"flex-shrink":1},"align-baseline":{"vertical-align":`baseline`},"align-top":{"vertical-align":`top`},"align-middle":{"vertical-align":`middle`},"align-bottom":{"vertical-align":`bottom`},"align-text-top":{"vertical-align":`text-top`},"align-text-bottom":{"vertical-align":`text-bottom`},"overflow-auto":{overflow:`auto`},"overflow-x-auto":{"overflow-x":`auto`},"overflow-y-auto":{"overflow-y":`auto`},"overflow-hidden":{overflow:`hidden`},"overflow-x-hidden":{"overflow-x":`hidden`},"overflow-y-hidden":{"overflow-y":`hidden`},"overflow-visible":{overflow:`visible`},"overscroll-auto":{"overscroll-behavior":`auto`},"overscroll-contain":{"overscroll-behavior":`contain`},"overscroll-none":{"overscroll-behavior":`none`},"overscroll-x-auto":{"overscroll-behavior-x":`auto`},"overscroll-x-contain":{"overscroll-behavior-x":`contain`},"overscroll-x-none":{"overscroll-behavior-x":`none`},"overscroll-y-auto":{"overscroll-behavior-y":`auto`},"overscroll-y-contain":{"overscroll-behavior-y":`contain`},"overscroll-y-none":{"overscroll-behavior-y":`none`},"z-auto":{"z-index":`auto`},"cursor-pointer":{cursor:`pointer`},"cursor-wait":{cursor:`wait`},"cursor-not-allowed":{cursor:`not-allowed`},"select-none":{"user-select":`none`},"select-all":{"user-select":`all`},"pointer-events-auto":{"pointer-events":`auto`},"pointer-events-none":{"pointer-events":`none`},"box-border":{"box-sizing":`border-box`},"box-content":{"box-sizing":`content-box`},resize:{resize:`both`},"resize-x":{resize:`horizontal`},"resize-y":{resize:`vertical`},"resize-none":{resize:`none`},"appearance-none":{appearance:`none`,"-webkit-appearance":`none`,"-moz-appearance":`none`},border:{border:`1px solid`},"border-none":{border:`none`},"border-solid":{"border-style":`solid`},"border-dashed":{"border-style":`dashed`},"border-dotted":{"border-style":`dotted`},"border-collapse":{"border-collapse":`collapse`},"rounded-none":{"border-radius":`0`},rounded:{"border-radius":`.25rem`},"rounded-sm":{"border-radius":`.125rem`},"rounded-md":{"border-radius":`.375rem`},"rounded-lg":{"border-radius":`.5rem`},"rounded-xl":{"border-radius":`.75rem`},"rounded-full":{"border-radius":`9999px`},"shadow-2xs":{"box-shadow":`0 1px rgb(0 0 0 / 0.05)`},"shadow-xs":{"box-shadow":`0 1px 2px 0 rgb(0 0 0 / 0.05)`},shadow:{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-sm":{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-md":{"box-shadow":`0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)`},"shadow-lg":{"box-shadow":`0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)`},"shadow-xl":{"box-shadow":`0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)`},"shadow-2xl":{"box-shadow":`0 25px 50px -12px rgb(0 0 0 / 0.25)`},"shadow-inner":{"box-shadow":`inset 0 2px 4px 0 rgb(0 0 0 / 0.05)`},"shadow-none":{"box-shadow":`0 0 #0000`},ring:{"box-shadow":`var(--ring-inset, ) 0 0 0 3px rgb(59 130 246 / 0.5)`},"ring-0":{"box-shadow":`var(--ring-inset, ) 0 0 0 0px rgb(59 130 246 / 0.5)`},"ring-1":{"box-shadow":`var(--ring-inset, ) 0 0 0 1px rgb(59 130 246 / 0.5)`},"ring-2":{"box-shadow":`var(--ring-inset, ) 0 0 0 2px rgb(59 130 246 / 0.5)`},"ring-4":{"box-shadow":`var(--ring-inset, ) 0 0 0 4px rgb(59 130 246 / 0.5)`},"ring-8":{"box-shadow":`var(--ring-inset, ) 0 0 0 8px rgb(59 130 246 / 0.5)`},"ring-inset":{"--ring-inset":`inset`},outline:{"outline-style":`solid`},"outline-none":{outline:`2px solid transparent`,"outline-offset":`2px`},"outline-dashed":{"outline-style":`dashed`},"outline-dotted":{"outline-style":`dotted`},"outline-double":{"outline-style":`double`},"outline-0":{"outline-width":`0px`},"outline-1":{"outline-width":`1px`},"outline-2":{"outline-width":`2px`},"outline-4":{"outline-width":`4px`},"outline-8":{"outline-width":`8px`},"outline-offset-0":{"outline-offset":`0px`},"outline-offset-1":{"outline-offset":`1px`},"outline-offset-2":{"outline-offset":`2px`},"outline-offset-4":{"outline-offset":`4px`},"outline-offset-8":{"outline-offset":`8px`},"aspect-auto":{"aspect-ratio":`auto`},"aspect-square":{"aspect-ratio":`1 / 1`},"aspect-video":{"aspect-ratio":`16 / 9`},"backdrop-blur-none":{"backdrop-filter":`blur(0)`},"backdrop-blur-sm":{"backdrop-filter":`blur(4px)`},"backdrop-blur":{"backdrop-filter":`blur(8px)`},"backdrop-blur-md":{"backdrop-filter":`blur(12px)`},"backdrop-blur-lg":{"backdrop-filter":`blur(16px)`},"backdrop-blur-xl":{"backdrop-filter":`blur(24px)`},"backdrop-blur-2xl":{"backdrop-filter":`blur(40px)`},"backdrop-blur-3xl":{"backdrop-filter":`blur(64px)`},"transition-none":{transition:`none`},transition:{"transition-property":`all`,"transition-timing-function":`ease-in-out`,"transition-duration":`var(--transition-duration, 150ms)`},"animate-none":{animation:`none`},"animate-spin":{animation:`spin 1s linear infinite`},"animate-ping":{animation:`ping 1s cubic-bezier(0, 0, 0.2, 1) infinite`},"animate-pulse":{animation:`pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite`},"bg-auto":{"background-size":`auto`},"bg-cover":{"background-size":`cover`},"bg-contain":{"background-size":`contain`},"bg-no-repeat":{"background-repeat":`no-repeat`},"bg-fixed":{"background-attachment":`fixed`},"bg-local":{"background-attachment":`local`},"bg-scroll":{"background-attachment":`scroll`},"min-h-screen":{"min-height":`100vh`},"max-h-screen":{"max-height":`100vh`},"min-w-screen":{"min-width":`100vw`},"h-dvh":{height:`100dvh`},"h-svh":{height:`100svh`},"h-lvh":{height:`100lvh`},"w-dvw":{width:`100dvw`},"w-svw":{width:`100svw`},"w-lvw":{width:`100lvw`},"min-h-dvh":{"min-height":`100dvh`},"min-h-svh":{"min-height":`100svh`},"min-h-lvh":{"min-height":`100lvh`},"flex-none":{flex:`none`},"flex-auto":{flex:`1 1 auto`},"flex-initial":{flex:`0 1 auto`},grow:{"flex-grow":`1`},"grow-0":{"flex-grow":`0`},shrink:{"flex-shrink":`1`},"shrink-0":{"flex-shrink":`0`},"self-auto":{"align-self":`auto`},"self-start":{"align-self":`flex-start`},"self-end":{"align-self":`flex-end`},"self-center":{"align-self":`center`},"self-stretch":{"align-self":`stretch`},"self-baseline":{"align-self":`baseline`},"content-normal":{"align-content":`normal`},"content-start":{"align-content":`flex-start`},"content-end":{"align-content":`flex-end`},"content-center":{"align-content":`center`},"content-between":{"align-content":`space-between`},"content-around":{"align-content":`space-around`},"content-evenly":{"align-content":`space-evenly`},"content-stretch":{"align-content":`stretch`},"items-baseline":{"align-items":`baseline`},"inset-0":{inset:`0`},"inset-auto":{inset:`auto`},"inset-x-0":{left:`0`,right:`0`},"inset-y-0":{top:`0`,bottom:`0`},"inset-x-auto":{left:`auto`,right:`auto`},"inset-y-auto":{top:`auto`,bottom:`auto`},"sr-only":{position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,"white-space":`nowrap`,"border-width":`0`},"not-sr-only":{position:`static`,width:`auto`,height:`auto`,padding:`0`,margin:`0`,overflow:`visible`,clip:`auto`,"white-space":`normal`}},C=[`@keyframes spin {
|
|
1
|
+
import{n as e,t}from"./renderer-D5EM0ZYN.js";import{safeStyleEl as n}from"safevalues/dom";import{concatStyleSheets as r,safeStyleSheet as i}from"safevalues";const a={sm:640,md:768,lg:1024,xl:1280},o=Object.entries(a),s=.25,c=[...Array(15)].map((e,t)=>t+1),l=[16,20,24,28,32,36,40,48,56,64],ee=[72,80,96,128,160,192,256,320,384,512],u=[...c,...l,...ee,...Object.values(a)],d=Array.from({length:20},(e,t)=>(t+1)*5),te=[0,10,20,30,40,50,60,70,80,90,100],f=[25,50,75,100,150,200,300,500,700,1e3],p=[`hover`,`focus`,`disabled`],m={margin:`m`,padding:`p`},h={width:`w`,height:`h`},ne={top:`top`,right:`right`,bottom:`bottom`,left:`left`},g={"min-width":`min-w`,"min-height":`min-h`,"max-width":`max-w`,"max-height":`max-h`},_={"font-mono":{"font-family":`monospace`},"font-sans":{"font-family":`sans-serif`},"font-serif":{"font-family":`serif`},"font-cursive":{"font-family":`cursive`},"text-xs":{"font-size":`.75rem`,"line-height":`calc(1 / 0.75)`},"text-sm":{"font-size":`.875rem`,"line-height":`calc(1.25 / 0.875)`},"text-base":{"font-size":`1rem`,"line-height":`calc(1.5 / 1)`},"text-lg":{"font-size":`1.125rem`,"line-height":`calc(1.75 / 1.125)`},"text-xl":{"font-size":`1.25rem`,"line-height":`calc(1.75 / 1.25)`},"text-2xl":{"font-size":`1.5rem`,"line-height":`calc(2 / 1.5)`},"text-3xl":{"font-size":`1.875rem`,"line-height":`calc(2.25 / 1.875)`},"text-4xl":{"font-size":`2.25rem`,"line-height":`calc(2.5 / 2.25)`},"text-5xl":{"font-size":`3rem`,"line-height":`1`},"text-6xl":{"font-size":`3.75rem`,"line-height":`1`},"text-7xl":{"font-size":`4.5rem`,"line-height":`1`},"font-thin":{"font-weight":100},"font-extralight":{"font-weight":200},"font-light":{"font-weight":300},"font-normal":{"font-weight":400},"font-medium":{"font-weight":500},"font-semibold":{"font-weight":600},"font-bold":{"font-weight":700},"font-extrabold":{"font-weight":800},"font-black":{"font-weight":900},italic:{"font-style":`italic`},"not-italic":{"font-style":`normal`},"w-max":{width:`max-content`},"w-min":{width:`min-content`},"w-fit":{width:`fit-content`},"h-max":{height:`max-content`},"h-min":{height:`min-content`},"h-fit":{height:`fit-content`},"size-auto":{width:`auto`,height:`auto`},"size-px":{width:`1px`,height:`1px`},"size-full":{width:`100%`,height:`100%`},"size-dvw":{width:`100dvw`,height:`100dvw`},"size-dvh":{width:`100dvh`,height:`100dvh`},"size-lvw":{width:`100lvw`,height:`100lvw`},"size-lvh":{width:`100lvh`,height:`100lvh`},"size-svw":{width:`100svw`,height:`100svw`},"size-svh":{width:`100svh`,height:`100svh`},"size-min":{width:`min-content`,height:`min-content`},"size-max":{width:`max-content`,height:`max-content`},"size-fit":{width:`fit-content`,height:`fit-content`},"tracking-tighter":{"letter-spacing":`-0.05em`},"tracking-tight":{"letter-spacing":`-0.025em`},"tracking-normal":{"letter-spacing":`0`},"tracking-wide":{"letter-spacing":`0.025em`},"tracking-wider":{"letter-spacing":`0.05em`},"tracking-widest":{"letter-spacing":`0.1em`},"leading-none":{"line-height":`1`},"leading-tight":{"line-height":`1.25`},"leading-snug":{"line-height":`1.375`},"leading-normal":{"line-height":`1.5`},"leading-relaxed":{"line-height":`1.625`},"leading-loose":{"line-height":`2`},"text-left":{"text-align":`left`},"text-right":{"text-align":`right`},"text-center":{"text-align":`center`},"text-justify":{"text-align":`justify`},underline:{"text-decoration":`underline`},"no-underline":{"text-decoration":`none`},"decoration-none":{"text-decoration":`none`},"line-through":{"text-decoration":`line-through`},uppercase:{"text-transform":`uppercase`},lowercase:{"text-transform":`lowercase`},capitalize:{"text-transform":`capitalize`},truncate:{"white-space":`nowrap`,overflow:`hidden`,"text-overflow":`ellipsis`},"text-elipsis":{"text-overflow":`ellipsis`},"text-clip":{"text-overflow":`clip`},"text-wrap":{"text-wrap":`wrap`},"text-nowrap":{"text-wrap":`nowrap`},"text-balance":{"text-wrap":`balance`},"text-pretty":{"text-wrap":`pretty`},"whitespace-normal":{"white-space":`normal`},"whitespace-nowrap":{"white-space":`nowrap`},"whitespace-pre":{"white-space":`pre`},"whitespace-pre-line":{"white-space":`pre-line`},"whitespace-pre-wrap":{"white-space":`pre-wrap`},"whitespace-break-spaces":{"white-space":`break-spaces`},relative:{position:`relative`},fixed:{position:`fixed`},absolute:{position:`absolute`},sticky:{position:`sticky`},"object-contain":{"object-fit":`contain`},"object-cover":{"object-fit":`cover`},"object-fill":{"object-fit":`fill`},"object-none":{"object-fit":`none`},block:{display:`block`},contents:{display:`contents`},hidden:{display:`none`},inline:{display:`inline`},"inline-block":{display:`inline-block`},visible:{visibility:`visible`},invisible:{visibility:`hidden`},collapse:{visibility:`collapse`},"list-none":{"list-style-type":`none`},"list-disc":{"list-style-type":`disc`},"list-decimal":{"list-style-type":`decimal`},flex:{display:`flex`},grid:{display:`grid`},"flex-1":{flex:`1 1 0%`},"flex-inline":{display:`inline-flex`},"flex-row":{"flex-direction":`row`},"flex-col":{"flex-direction":`column`},"flex-row-reverse":{"flex-direction":`row-reverse`},"flex-col-reverse":{"flex-direction":`column-reverse`},"flex-wrap":{"flex-wrap":`wrap`},"flex-wrap-reverse":{"flex-wrap":`wrap-reverse`},"flex-nowrap":{"flex-wrap":`nowrap`},"justify-start":{"justify-content":`flex-start`},"justify-end":{"justify-content":`flex-end`},"justify-center":{"justify-content":`center`},"justify-between":{"justify-content":`space-between`},"justify-around":{"justify-content":`space-around`},"justify-evenly":{"justify-content":`space-evenly`},"justify-stretch":{"justify-content":`stretch`},"items-start":{"align-items":`flex-start`},"items-end":{"align-items":`flex-end`},"items-center":{"align-items":`center`},"items-stretch":{"align-items":`stretch`},"flex-grow":{"flex-grow":1},"flex-shrink":{"flex-shrink":1},"align-baseline":{"vertical-align":`baseline`},"align-top":{"vertical-align":`top`},"align-middle":{"vertical-align":`middle`},"align-bottom":{"vertical-align":`bottom`},"align-text-top":{"vertical-align":`text-top`},"align-text-bottom":{"vertical-align":`text-bottom`},"overflow-auto":{overflow:`auto`},"overflow-x-auto":{"overflow-x":`auto`},"overflow-y-auto":{"overflow-y":`auto`},"overflow-hidden":{overflow:`hidden`},"overflow-x-hidden":{"overflow-x":`hidden`},"overflow-y-hidden":{"overflow-y":`hidden`},"overflow-visible":{overflow:`visible`},"overscroll-auto":{"overscroll-behavior":`auto`},"overscroll-contain":{"overscroll-behavior":`contain`},"overscroll-none":{"overscroll-behavior":`none`},"overscroll-x-auto":{"overscroll-behavior-x":`auto`},"overscroll-x-contain":{"overscroll-behavior-x":`contain`},"overscroll-x-none":{"overscroll-behavior-x":`none`},"overscroll-y-auto":{"overscroll-behavior-y":`auto`},"overscroll-y-contain":{"overscroll-behavior-y":`contain`},"overscroll-y-none":{"overscroll-behavior-y":`none`},"z-auto":{"z-index":`auto`},"cursor-pointer":{cursor:`pointer`},"cursor-wait":{cursor:`wait`},"cursor-not-allowed":{cursor:`not-allowed`},"select-none":{"user-select":`none`},"select-all":{"user-select":`all`},"pointer-events-auto":{"pointer-events":`auto`},"pointer-events-none":{"pointer-events":`none`},"box-border":{"box-sizing":`border-box`},"box-content":{"box-sizing":`content-box`},resize:{resize:`both`},"resize-x":{resize:`horizontal`},"resize-y":{resize:`vertical`},"resize-none":{resize:`none`},"appearance-none":{appearance:`none`,"-webkit-appearance":`none`,"-moz-appearance":`none`},border:{border:`1px solid`},"border-none":{border:`none`},"border-solid":{"border-style":`solid`},"border-dashed":{"border-style":`dashed`},"border-dotted":{"border-style":`dotted`},"border-collapse":{"border-collapse":`collapse`},"rounded-none":{"border-radius":`0`},rounded:{"border-radius":`.25rem`},"rounded-sm":{"border-radius":`.125rem`},"rounded-md":{"border-radius":`.375rem`},"rounded-lg":{"border-radius":`.5rem`},"rounded-xl":{"border-radius":`.75rem`},"rounded-full":{"border-radius":`9999px`},"shadow-2xs":{"box-shadow":`0 1px rgb(0 0 0 / 0.05)`},"shadow-xs":{"box-shadow":`0 1px 2px 0 rgb(0 0 0 / 0.05)`},shadow:{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-sm":{"box-shadow":`0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)`},"shadow-md":{"box-shadow":`0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)`},"shadow-lg":{"box-shadow":`0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)`},"shadow-xl":{"box-shadow":`0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)`},"shadow-2xl":{"box-shadow":`0 25px 50px -12px rgb(0 0 0 / 0.25)`},"shadow-inner":{"box-shadow":`inset 0 2px 4px 0 rgb(0 0 0 / 0.05)`},"shadow-none":{"box-shadow":`0 0 #0000`},ring:{"box-shadow":`var(--ring-inset, ) 0 0 0 3px rgb(59 130 246 / 0.5)`},"ring-0":{"box-shadow":`var(--ring-inset, ) 0 0 0 0px rgb(59 130 246 / 0.5)`},"ring-1":{"box-shadow":`var(--ring-inset, ) 0 0 0 1px rgb(59 130 246 / 0.5)`},"ring-2":{"box-shadow":`var(--ring-inset, ) 0 0 0 2px rgb(59 130 246 / 0.5)`},"ring-4":{"box-shadow":`var(--ring-inset, ) 0 0 0 4px rgb(59 130 246 / 0.5)`},"ring-8":{"box-shadow":`var(--ring-inset, ) 0 0 0 8px rgb(59 130 246 / 0.5)`},"ring-inset":{"--ring-inset":`inset`},outline:{"outline-style":`solid`},"outline-none":{outline:`2px solid transparent`,"outline-offset":`2px`},"outline-dashed":{"outline-style":`dashed`},"outline-dotted":{"outline-style":`dotted`},"outline-double":{"outline-style":`double`},"outline-0":{"outline-width":`0px`},"outline-1":{"outline-width":`1px`},"outline-2":{"outline-width":`2px`},"outline-4":{"outline-width":`4px`},"outline-8":{"outline-width":`8px`},"outline-offset-0":{"outline-offset":`0px`},"outline-offset-1":{"outline-offset":`1px`},"outline-offset-2":{"outline-offset":`2px`},"outline-offset-4":{"outline-offset":`4px`},"outline-offset-8":{"outline-offset":`8px`},"aspect-auto":{"aspect-ratio":`auto`},"aspect-square":{"aspect-ratio":`1 / 1`},"aspect-video":{"aspect-ratio":`16 / 9`},"backdrop-blur-none":{"backdrop-filter":`blur(0)`},"backdrop-blur-sm":{"backdrop-filter":`blur(4px)`},"backdrop-blur":{"backdrop-filter":`blur(8px)`},"backdrop-blur-md":{"backdrop-filter":`blur(12px)`},"backdrop-blur-lg":{"backdrop-filter":`blur(16px)`},"backdrop-blur-xl":{"backdrop-filter":`blur(24px)`},"backdrop-blur-2xl":{"backdrop-filter":`blur(40px)`},"backdrop-blur-3xl":{"backdrop-filter":`blur(64px)`},"transition-none":{transition:`none`},transition:{"transition-property":`all`,"transition-timing-function":`ease-in-out`,"transition-duration":`var(--transition-duration, 150ms)`},"animate-none":{animation:`none`},"animate-spin":{animation:`spin 1s linear infinite`},"animate-ping":{animation:`ping 1s cubic-bezier(0, 0, 0.2, 1) infinite`},"animate-pulse":{animation:`pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite`},"bg-auto":{"background-size":`auto`},"bg-cover":{"background-size":`cover`},"bg-contain":{"background-size":`contain`},"bg-no-repeat":{"background-repeat":`no-repeat`},"bg-fixed":{"background-attachment":`fixed`},"bg-local":{"background-attachment":`local`},"bg-scroll":{"background-attachment":`scroll`},"min-h-screen":{"min-height":`100vh`},"max-h-screen":{"max-height":`100vh`},"min-w-screen":{"min-width":`100vw`},"h-dvh":{height:`100dvh`},"h-svh":{height:`100svh`},"h-lvh":{height:`100lvh`},"w-dvw":{width:`100dvw`},"w-svw":{width:`100svw`},"w-lvw":{width:`100lvw`},"min-h-dvh":{"min-height":`100dvh`},"min-h-svh":{"min-height":`100svh`},"min-h-lvh":{"min-height":`100lvh`},"flex-none":{flex:`none`},"flex-auto":{flex:`1 1 auto`},"flex-initial":{flex:`0 1 auto`},grow:{"flex-grow":`1`},"grow-0":{"flex-grow":`0`},shrink:{"flex-shrink":`1`},"shrink-0":{"flex-shrink":`0`},"self-auto":{"align-self":`auto`},"self-start":{"align-self":`flex-start`},"self-end":{"align-self":`flex-end`},"self-center":{"align-self":`center`},"self-stretch":{"align-self":`stretch`},"self-baseline":{"align-self":`baseline`},"content-normal":{"align-content":`normal`},"content-start":{"align-content":`flex-start`},"content-end":{"align-content":`flex-end`},"content-center":{"align-content":`center`},"content-between":{"align-content":`space-between`},"content-around":{"align-content":`space-around`},"content-evenly":{"align-content":`space-evenly`},"content-stretch":{"align-content":`stretch`},"items-baseline":{"align-items":`baseline`},"inset-0":{inset:`0`},"inset-auto":{inset:`auto`},"inset-x-0":{left:`0`,right:`0`},"inset-y-0":{top:`0`,bottom:`0`},"inset-x-auto":{left:`auto`,right:`auto`},"inset-y-auto":{top:`auto`,bottom:`auto`},"sr-only":{position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,"white-space":`nowrap`,"border-width":`0`},"not-sr-only":{position:`static`,width:`auto`,height:`auto`,padding:`0`,margin:`0`,overflow:`visible`,clip:`auto`,"white-space":`normal`}},v=[`@keyframes spin {
|
|
2
2
|
from { transform: rotate(0deg) }
|
|
3
3
|
to { transform: rotate(360deg) }
|
|
4
4
|
}`,`@keyframes ping {
|
|
@@ -9,5 +9,5 @@ import{n as e,t}from"./renderer-C2znMiAH.js";import{safeStyleEl as n}from"safeva
|
|
|
9
9
|
}`,`@keyframes pulse {
|
|
10
10
|
0%, 100% { opacity: 1 }
|
|
11
11
|
50% { opacity: .5 }
|
|
12
|
-
}`],
|
|
13
|
-
`)),U}
|
|
12
|
+
}`],re={red:{50:`#ffebee`,100:`#ffcdd2`,200:`#ef9a9a`,300:`#e57373`,400:`#ef5350`,500:`#f44336`,600:`#e53935`,700:`#d32f2f`,800:`#c62828`,900:`#b71c1c`},pink:{50:`#fce4ec`,100:`#f8bbd0`,200:`#f48fb1`,300:`#f06292`,400:`#ec407a`,500:`#e91e63`,600:`#d81b60`,700:`#c2185b`,800:`#ad1457`,900:`#880e4f`},purple:{50:`#f3e5f5`,100:`#e1bee7`,200:`#ce93d8`,300:`#ba68c8`,400:`#ab47bc`,500:`#9c27b0`,600:`#8e24aa`,700:`#7b1fa2`,800:`#6a1b9a`,900:`#4a148c`},"deep-purple":{50:`#ede7f6`,100:`#d1c4e9`,200:`#b39ddb`,300:`#9575cd`,400:`#7e57c2`,500:`#673ab7`,600:`#5e35b1`,700:`#512da8`,800:`#4527a0`,900:`#311b92`},indigo:{50:`#e8eaf6`,100:`#c5cae9`,200:`#9fa8da`,300:`#7986cb`,400:`#5c6bc0`,500:`#3f51b5`,600:`#3949ab`,700:`#303f9f`,800:`#283593`,900:`#1a237e`},blue:{50:`#e3f2fd`,100:`#bbdefb`,200:`#90caf9`,300:`#64b5f6`,400:`#42a5f5`,500:`#2196f3`,600:`#1e88e5`,700:`#1976d2`,800:`#1565c0`,900:`#0d47a1`},"light-blue":{50:`#e1f5fe`,100:`#b3e5fc`,200:`#81d4fa`,300:`#4fc3f7`,400:`#29b6f6`,500:`#03a9f4`,600:`#039be5`,700:`#0288d1`,800:`#0277bd`,900:`#01579b`},cyan:{50:`#e0f7fa`,100:`#b2ebf2`,200:`#80deea`,300:`#4dd0e1`,400:`#26c6da`,500:`#00bcd4`,600:`#00acc1`,700:`#0097a7`,800:`#00838f`,900:`#006064`},teal:{50:`#e0f2f1`,100:`#b2dfdb`,200:`#80cbc4`,300:`#4db6ac`,400:`#26a69a`,500:`#009688`,600:`#00897b`,700:`#00796b`,800:`#00695c`,900:`#004d40`},green:{50:`#e8f5e9`,100:`#c8e6c9`,200:`#a5d6a7`,300:`#81c784`,400:`#66bb6a`,500:`#4caf50`,600:`#43a047`,700:`#388e3c`,800:`#2e7d32`,900:`#1b5e20`},"light-green":{50:`#f1f8e9`,100:`#dcedc8`,200:`#c5e1a5`,300:`#aed581`,400:`#9ccc65`,500:`#8bc34a`,600:`#7cb342`,700:`#689f38`,800:`#558b2f`,900:`#33691e`},lime:{50:`#f9fbe7`,100:`#f0f4c3`,200:`#e6ee9c`,300:`#dce775`,400:`#d4e157`,500:`#cddc39`,600:`#c0ca33`,700:`#afb42b`,800:`#9e9d24`,900:`#827717`},yellow:{50:`#fffde7`,100:`#fff9c4`,200:`#fff59d`,300:`#fff176`,400:`#ffee58`,500:`#ffeb3b`,600:`#fdd835`,700:`#fbc02d`,800:`#f9a825`,900:`#f57f17`},amber:{50:`#fff8e1`,100:`#ffecb3`,200:`#ffe082`,300:`#ffd54f`,400:`#ffca28`,500:`#ffc107`,600:`#ffb300`,700:`#ffa000`,800:`#ff8f00`,900:`#ff6f00`},orange:{50:`#fff3e0`,100:`#ffe0b2`,200:`#ffcc80`,300:`#ffb74d`,400:`#ffa726`,500:`#ff9800`,600:`#fb8c00`,700:`#f57c00`,800:`#ef6c00`,900:`#e65100`},"deep-orange":{50:`#fbe9e7`,100:`#ffccbc`,200:`#ffab91`,300:`#ff8a65`,400:`#ff7043`,500:`#ff5722`,600:`#f4511e`,700:`#e64a19`,800:`#d84315`,900:`#bf360c`},brown:{50:`#efebe9`,100:`#d7ccc8`,200:`#bcaaa4`,300:`#a1887f`,400:`#8d6e63`,500:`#795548`,600:`#6d4c41`,700:`#5d4037`,800:`#4e342e`,900:`#3e2723`},gray:{50:`#fafafa`,100:`#f5f5f5`,200:`#eeeeee`,300:`#e0e0e0`,400:`#bdbdbd`,500:`#9e9e9e`,600:`#757575`,700:`#616161`,800:`#424242`,900:`#212121`},"blue-gray":{50:`#eceff1`,100:`#cfd8dc`,200:`#b0bec5`,300:`#90a4ae`,400:`#78909c`,500:`#607d8b`,600:`#546e7a`,700:`#455a64`,800:`#37474f`,900:`#263238`}};function y(e){return p.map(t=>`.${t}\\:${e}:${t}`)}function b(e,t){return o.map(([n,r])=>`@media (min-width: ${r}px) { .${n}\\:${e} { ${t} } }`)}function x(e){return e.flatMap(([e,t])=>[`.${e} { ${t} }`,`${y(e).join(`,`)} { ${t} }`,...b(e,t)])}function ie(e){return e.flatMap(([e,t])=>[`.${e} { ${t} }`,`${y(e).join(`,`)} { ${t} }`])}function ae(e,t){let n=e[0]===`@`,r=t[0]===`@`;return n&&!r?1:!n&&r?-1:e.localeCompare(t)}function S(e){return x(Object.entries(e).flatMap(([e,t])=>[[`${t}-0`,`${e}: 0`],[`${t}-screen`,`${e}: 100v${e.includes(`height`)?`h`:`w`}`],[`${t}-full`,`${e}: 100%`],...u.map(n=>[`${t}-${n}`,`${e}: ${n*s}rem`]),...u.map(n=>[`-${t}-${n}`,`${e}: -${n*s}rem`]),...u.map(n=>[`${t}-${n}px`,`${e}: ${n}px`]),...u.map(n=>[`-${t}-${n}px`,`${e}: -${n}px`]),...d.map(n=>[`${t}-${n}\\%`,`${e}: ${n}%`]),...d.map(n=>[`-${t}-${n}\\%`,`${e}: -${n}%`]),...o.map(([n,r])=>[`${t}-${n}`,`${e}: ${r}px`])]))}function C(e){return x(Object.entries(e).flatMap(([e,t])=>[[`${t}-auto`,`${e}: auto`],[`${t}x-auto`,`${e}-left: auto; ${e}-right: auto;`],[`${t}y-auto`,`${e}-top: auto; ${e}-bottom: auto;`],[`${t}x-0`,`${e}-left: 0; ${e}-right: 0;`],[`${t}y-0`,`${e}-top: 0; ${e}-bottom: 0;`],...u.map(n=>[`${t}x-${n}`,`${e}-left: ${n*s}rem; ${e}-right: ${n*s}rem;`]),...u.map(n=>[`${t}y-${n}`,`${e}-top: ${n*s}rem; ${e}-bottom: ${n*s}rem;`]),...u.map(n=>[`${t}x-${n}px`,`${e}-left: ${n}px; ${e}-right: ${n}px;`]),...u.map(n=>[`${t}y-${n}px`,`${e}-top: ${n}px; ${e}-bottom: ${n}px;`]),...d.map(n=>[`${t}x-${n}\\%`,`${e}-left: ${n}%; ${e}-right: ${n}%;`]),...d.map(n=>[`${t}y-${n}\\%`,`${e}-top: ${n}%; ${e}-bottom: ${n}%;`])]))}function oe(e){return x(Object.entries(e).flatMap(([e,t])=>[[`${t}t-0`,`${e}-top: 0`],[`${t}b-0`,`${e}-bottom: 0`],[`${t}l-0`,`${e}-left: 0`],[`${t}r-0`,`${e}-right: 0`],[`${t}t-auto`,`${e}-top: auto`],[`${t}b-auto`,`${e}-bottom: auto`],[`${t}l-auto`,`${e}-left: auto`],[`${t}r-auto`,`${e}-right: auto`],...[``,`-`].flatMap(n=>[...u.map(r=>[`${n}${t}t-${r}`,`${e}-top: ${n}${r*s}rem`]),...u.map(r=>[`${n}${t}b-${r}`,`${e}-bottom: ${n}${r*s}rem`]),...u.map(r=>[`${n}${t}l-${r}`,`${e}-left: ${n}${r*s}rem`]),...u.map(r=>[`${n}${t}r-${r}`,`${e}-right: ${n}${r*s}rem`]),...u.map(r=>[`${n}${t}t-${r}px`,`${e}-top: ${n}${r}px`]),...u.map(r=>[`${n}${t}b-${r}px`,`${e}-bottom: ${n}${r}px`]),...u.map(r=>[`${n}${t}l-${r}px`,`${e}-left: ${n}${r}px`]),...u.map(r=>[`${n}${t}r-${r}px`,`${e}-right: ${n}${r}px`]),...d.map(r=>[`${n}${t}t-${r}\\%`,`${e}-top: ${n}${r}%`]),...d.map(r=>[`${n}${t}b-${r}\\%`,`${e}-bottom: ${n}${r}%`]),...d.map(r=>[`${n}${t}l-${r}\\%`,`${e}-left: ${n}${r}%`]),...d.map(r=>[`${n}${t}r-${r}\\%`,`${e}-right: ${n}${r}%`])])]))}function se(){return x([[`border`,`border: 1px`],[`border-x`,`border-inline-width: 1px`],[`border-y`,`border-block-width: 1px`],...[0,...c].map(e=>[`border-${e}`,`border-width: ${e}px`]),...[0,...c].map(e=>[`border-x-${e}`,`border-inline-width: ${e}px;`]),...[0,...c].map(e=>[`border-y-${e}`,`border-block-width: ${e}px;`]),...[`top`,`bottom`,`left`,`right`].flatMap(e=>[[`border-${e.slice(0,1)}`,`border-${e}: 1px`],...[0,...c].map(t=>[`border-${e.slice(0,1)}-${t}`,`border-${e}-width: ${t}px`])])])}function w(){return x(d.map(e=>[`z-${e}`,`z-index: ${e}`]))}function T(){return x(f.map(e=>[`duration-${e}`,`--transition-duration: ${e}ms; transition-duration: ${e}ms`]))}function E(){return x([[`space-x-0 > *`,`margin-left: 0`],[`space-y-0 > *`,`margin-top: 0`],...u.map(e=>[`space-x-${e} > :not(:first-child)`,`margin-left: ${e*s}rem`]),...u.map(e=>[`space-y-${e} > :not(:first-child)`,`margin-top: ${e*s}rem`]),...u.map(e=>[`space-x-${e}px > :not(:first-child)`,`margin-left: ${e}px`]),...u.map(e=>[`space-y-${e}px > :not(:first-child)`,`margin-top: ${e}px`]),[`gap-0`,`gap: 0`],...u.map(e=>[`gap-${e}`,`gap: ${e*s}rem`]),...u.map(e=>[`gap-${e}px`,`gap: ${e}px`]),...u.map(e=>[`gap-x-${e}`,`column-gap: ${e*s}rem`]),...u.map(e=>[`gap-y-${e}`,`row-gap: ${e*s}rem`]),...u.map(e=>[`gap-x-${e}px`,`column-gap: ${e}px`]),...u.map(e=>[`gap-y-${e}px`,`row-gap: ${e}px`]),[`divide-x > :not(:last-child)`,`border-inline-end-width: 1px`],[`divide-y > :not(:last-child)`,`border-bottom-width: 1px`],[`divide-x-0 > :not(:last-child)`,`border-inline-end-width: 0px`],[`divide-y-0 > :not(:last-child)`,`border-bottom-width: 0px`],...[2,4,8].map(e=>[`divide-x-${e} > :not(:last-child)`,`border-inline-end-width: ${e}px`]),...[2,4,8].map(e=>[`divide-y-${e} > :not(:last-child)`,`border-bottom-width: ${e}px`]),[`divide-solid > :not(:last-child)`,`border-style: solid`],[`divide-dashed > :not(:last-child)`,`border-style: dashed`],[`divide-dotted > :not(:last-child)`,`border-style: dotted`],[`divide-none > :not(:last-child)`,`border-style: none`]])}function D(){return x([...Array.from({length:100},(e,t)=>[`text-${t}px`,`font-size: ${t}px`]),...Array.from({length:100},(e,t)=>[`text-${t*s}rem`,`font-size: ${t*s}rem`])])}function O(){return x([`column`,`row`].flatMap(e=>{let t=e.slice(0,3);return[...Array.from({length:12},(e,t)=>t+1).map(n=>[`grid-${t}s-${n}`,`grid-template-${e}s: repeat(${n}, minmax(0, 1fr))`]),[`grid-${t}s-none`,`grid-template-${e}s: none`],...Array.from({length:12},(e,t)=>t+1).map(n=>[`${t}-span-${n}`,`grid-${e}: span ${n} / span ${n}`]),[`${t}-span-full`,`grid-${e}: 1 / -1`],...Array.from({length:13},(e,t)=>t+1).map(n=>[`${t}-start-${n}`,`grid-${e}-start: ${n}`]),[`${t}-start-auto`,`grid-${e}-start: auto`],...Array.from({length:13},(e,t)=>t+1).map(n=>[`${t}-end-${n}`,`grid-${e}-end: ${n}`]),[`${t}-end-auto`,`grid-${e}-end: auto`]]}))}function k(){return Object.entries(_).flatMap(([e,t])=>{let n=Object.entries(t).map(([e,t])=>`${e}: ${t}`).join(`; `);return[`.${e} { ${n} }`,`${y(e).join(`,`)} { ${n} }`,...b(e,n)]})}function A(e){let t=0,n=0,r=0;return e.length===4?(t=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16)):e.length===7&&(t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16)),`${t} ${n} ${r}`}function j(){let e=(e,t)=>{let n=[[`text-${e}`,`color: ${t}`],[`fill-${e}`,`fill: ${t}`],[`bg-${e}`,`background-color: ${t}`],[`border-${e}`,`border-color: ${t}`]];if(t.startsWith(`#`)){let r=A(t);for(let t of te){let i=t/100;n.push([`text-${e}\\/${t}`,`color: rgb(${r} / ${i})`],[`bg-${e}\\/${t}`,`background-color: rgb(${r} / ${i})`],[`border-${e}\\/${t}`,`border-color: rgb(${r} / ${i})`])}}return n};return ie([...e(`white`,`#fff`),...e(`black`,`#000`),...e(`transparent`,`transparent`),...Object.entries(re).flatMap(([t,n])=>[...e(t,n[500]),...Object.entries(n).flatMap(([n,r])=>e(`${t}-${n}`,r))])])}function M(){return x([[`opacity-0`,`opacity: 0`],...d.map(e=>[`opacity-${e}`,`opacity: ${e/100}`])])}let N=null;function P(){return N===null&&(N=[...v,...k(),...j(),...M(),...w(),...T(),...S(ne),...S(h),...C(h),...oe(m),...S(m),...C(m),...E(),...S(g),...se(),...D(),...O()].sort(ae).join(`
|
|
13
|
+
`)),N}const F={w:`width`,h:`height`,"min-w":`min-width`,"min-h":`min-height`,"max-w":`max-width`,"max-h":`max-height`,m:`margin`,mt:`margin-top`,mr:`margin-right`,mb:`margin-bottom`,ml:`margin-left`,mx:`margin-inline`,my:`margin-block`,p:`padding`,pt:`padding-top`,pr:`padding-right`,pb:`padding-bottom`,pl:`padding-left`,px:`padding-inline`,py:`padding-block`,top:`top`,right:`right`,bottom:`bottom`,left:`left`,gap:`gap`,"gap-x":`column-gap`,"gap-y":`row-gap`,text:`font-size`,z:`z-index`,bg:`background-color`,border:`border-color`},I=/^(-?)([\w-]+)-\[(.+)\]$/,L=/^(hover|focus|disabled|sm|md|lg|xl):(.+)$/,R=[`hover`,`focus`,`disabled`],z=new Set;let B=null;function V(){return typeof document<`u`&&typeof CSSStyleSheet<`u`&&typeof document.createElement==`function`}function H(e){return e.replace(/[[\]#.:>+~()'"]/g,`\\$&`)}function U(){if(!V())return null;if(B)return B;let e=document.createElement(`style`);return e.setAttribute(`data-mancha`,`custom`),document.head.appendChild(e),e.sheet?(B=e.sheet,B):null}function W(e){let t=e.match(I);if(!t)return null;let[,n,r,i]=t,a=F[r];return a?{property:a,value:n?`-${i}`:i}:null}function G(e,t){let n=t?`${t.name}:${e}`:e;if(z.has(n))return!0;let r=W(e);if(!r)return!1;let i=U();if(!i)return!1;let{property:o,value:s}=r,c=H(n),l;l=t?t.type===`pseudo`?`.${c}:${t.name} { ${o}: ${s}; }`:`@media (min-width: ${a[t.name]}px) { .${c} { ${o}: ${s}; } }`:`.${c} { ${o}: ${s}; }`;try{return i.insertRule(l,i.cssRules.length),z.add(n),!0}catch(e){return console.warn(`Failed to inject CSS rule: ${l}`,e),!1}}function K(e){if(!(!e||!e.includes(`[`)))for(let t of e.trim().split(/\s+/)){let e=t.match(L);if(e){let[,t,n]=e,r=R.includes(t),i=t in a;if(r||i){G(n,{type:r?`pseudo`:`media`,name:t});continue}}G(t)}}function ce(e=document){if(!V())return;let t=e.querySelectorAll(`[class]`);for(let e of t){let t=e.getAttribute(`class`);t&&K(t)}}function le(){z.clear(),B?.ownerNode&&B.ownerNode.remove(),B=null}function q(){return r([i`*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}`,i`html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}`,i`body{margin:0;line-height:inherit}`,i`hr{height:0;color:inherit;border-top-width:1px}`,i`abbr:where([title]){text-decoration:underline dotted}`,i`b,strong{font-weight:bolder}`,i`code,kbd,samp,pre{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-size:1em}`,i`small{font-size:80%}`,i`sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}`,i`sub{bottom:-0.25em}`,i`sup{top:-0.5em}`,i`button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}`,i`button,select{text-transform:none}`,i`button,[type='button'],[type='reset'],[type='submit']{-webkit-appearance:button;background-color:transparent;background-image:none;cursor:pointer}`,i`:-moz-focusring{outline:auto}`,i`:-moz-ui-invalid{box-shadow:none}`,i`progress{vertical-align:baseline}`,i`::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}`,i`[type='search']{-webkit-appearance:textfield;outline-offset:-2px}`,i`::-webkit-search-decoration{-webkit-appearance:none}`,i`::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}`,i`summary{display:list-item}`,i`blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}`,i`fieldset{margin:0;padding:0}`,i`legend{padding:0}`,i`ol,ul,menu{list-style:none;margin:0;padding:0}`,i`textarea{resize:vertical}`,i`::placeholder{opacity:1;color:#9ca3af}`,i`button,[role="button"]{cursor:pointer}`,i`:disabled{cursor:default;pointer-events:none;opacity:0.75}`,i`img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}`,i`img,video{max-width:100%;height:auto}`,i`[hidden]{display:none}`,i`dialog{padding:0}`,i`dialog::backdrop{background:rgba(0,0,0,0.5)}`])}function J(){return r([i`html{`,i`max-width: 70ch;`,i`padding: 2em 1em;`,i`margin: auto;`,i`line-height: 1.75;`,i`font-size: 1.25em;`,i`font-family: sans-serif;`,i`}`,i`h1,h2,h3,h4,h5,h6{`,i`margin: 1em 0 0.5em;`,i`}`,i`p,ul,ol{`,i`margin-bottom: 1em;`,i`color: #1d1d1d;`,i`}`])}var Y=class extends t{impl=`browser`;dirpath=e(globalThis.location?.href??`http://localhost/`);parseHTML(e,t={rootDocument:!1}){if(t.rootDocument)return new DOMParser().parseFromString(e,`text/html`);{let t=document.createRange();return t.selectNodeContents(document.body),t.createContextualFragment(e)}}serializeHTML(e){return new XMLSerializer().serializeToString(e).replace(/\s?xmlns="[^"]+"/gm,``)}preprocessLocal(e,t){return this.preprocessRemote(e,t)}createElement(e,t){return(t||document).createElement(e)}createComment(e,t){return(t||document).createComment(e)}textContent(e,t){e.textContent=t}};const X=new Y;function Z(e){for(let t of e){if(t=t.trim(),t===`custom`){ce(document);continue}let e=document.createElement(`style`);switch(t){case`minimal`:n.setTextContent(e,J());break;case`basic`:n.setTextContent(e,q());break;case`utils`:e.textContent=P();break;default:console.error(`Unknown style name: "${t}"`);continue}globalThis.document.head.appendChild(e)}}const Q=`mancha-cloak`;function ue(e,t){let n=`${e.join(`, `)} { opacity: 0 !important; ${t>0?`transition: opacity ${t}ms ease-in-out !important;`:``} }`,r=document.getElementById(Q);r||(r=document.createElement(`style`),r.id=Q,document.head.appendChild(r)),r.textContent=n}function $(e){let t=!1;return async()=>{if(t)return;t=!0;let n=document.getElementById(Q);if(n){if(e!==!1){let t=n.sheet;t&&t.cssRules.length>0&&t.cssRules[0].style.setProperty(`opacity`,`1`,`important`),await new Promise(t=>setTimeout(t,e))}n.remove()}}}async function de(e={}){let t;document.documentElement.classList.add(`mancha-loading`);let n=e.cloak?e.cloak===!0?{}:e.cloak:void 0;if(n){let r=e.target?Array.isArray(e.target)?e.target:[e.target]:[`body`],i=n.selector&&(Array.isArray(n.selector)||typeof n.selector==`string`)?Array.isArray(n.selector)?n.selector:[n.selector]:r,a=n.duration??0;ue(i,a),t=$(a>0?a:!1)}else t=$(!1);document.readyState===`loading`&&await new Promise(e=>{window.addEventListener(`DOMContentLoaded`,()=>e(),{once:!0})});let r=e.renderer??new Y;if(e.css&&e.css.length>0&&Z(e.css),e.debug&&r.debug(!0),e.state)for(let[t,n]of Object.entries(e.state))await r.set(t,n);try{if(e.callback)await e.callback(r);else if(e.target){let t=Array.isArray(e.target)?e.target:[e.target];for(let n of t){let t=globalThis.document.querySelector(n);t?await r.mount(t,{cache:e.cache}):console.error(`Target element not found: "${n}"`)}}}finally{document.documentElement.classList.remove(`mancha-loading`),t&&await t()}return r}export{t as IRenderer,X as Mancha,Y as Renderer,le as _resetCustomCssForTesting,q as basicCssRules,de as initMancha,Z as injectCss,J as minimalCssRules,P as utilsCssRules};
|
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,eAAe,MAAM,sBAAsB,CAAC;AACnD,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAE/C,MAAM,OAAO,QAA4C,SAAQ,SAAY;IACnE,IAAI,GAAG,SAAS,CAAC;IACP,OAAO,GAAW,OAAO,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,IAAI,mBAAmB,CAAC,CAAC;IAC/F,SAAS,CACR,OAAe,EACf,SAAuB,EAAE,YAAY,EAAE,KAAK,EAAE;QAE9C,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YACzB,OAAO,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE,W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D;QAC1D,IAAI,OAAO,EAAE,CAAC;YACb,MAAM,OAAO,EAAE,CAAC;QACjB,CAAC;IACF,CAAC;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Check if CSSStyleSheet API is available. */
|
|
2
|
+
export declare function isSupported(): boolean;
|
|
3
|
+
/** Parse a custom value class. */
|
|
4
|
+
export declare function parseCustomValueClass(className: string): {
|
|
5
|
+
property: string;
|
|
6
|
+
value: string;
|
|
7
|
+
} | null;
|
|
8
|
+
/** Inject a single custom value class (with optional variant). */
|
|
9
|
+
export declare function injectCustomClass(className: string, variant?: {
|
|
10
|
+
type: "pseudo" | "media";
|
|
11
|
+
name: string;
|
|
12
|
+
}): boolean;
|
|
13
|
+
/** Process a class string, inject CSS for any custom values. */
|
|
14
|
+
export declare function processClassString(classString: string): void;
|
|
15
|
+
/** Scan a DOM tree and inject CSS for all custom values found. */
|
|
16
|
+
export declare function scanAndInject(root?: Element | Document): void;
|
|
17
|
+
/** For testing: reset module state. */
|
|
18
|
+
export declare function _resetForTesting(): void;
|
|
19
|
+
/** For testing: get injected rules. */
|
|
20
|
+
export declare function _getInjectedRules(): Set<string>;
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { MEDIA_BREAKPOINTS } from "./css_gen_utils.js";
|
|
2
|
+
// Property prefix to CSS property mapping.
|
|
3
|
+
const PROPERTY_MAP = {
|
|
4
|
+
// Sizing.
|
|
5
|
+
w: "width",
|
|
6
|
+
h: "height",
|
|
7
|
+
"min-w": "min-width",
|
|
8
|
+
"min-h": "min-height",
|
|
9
|
+
"max-w": "max-width",
|
|
10
|
+
"max-h": "max-height",
|
|
11
|
+
// Spacing.
|
|
12
|
+
m: "margin",
|
|
13
|
+
mt: "margin-top",
|
|
14
|
+
mr: "margin-right",
|
|
15
|
+
mb: "margin-bottom",
|
|
16
|
+
ml: "margin-left",
|
|
17
|
+
mx: "margin-inline",
|
|
18
|
+
my: "margin-block",
|
|
19
|
+
p: "padding",
|
|
20
|
+
pt: "padding-top",
|
|
21
|
+
pr: "padding-right",
|
|
22
|
+
pb: "padding-bottom",
|
|
23
|
+
pl: "padding-left",
|
|
24
|
+
px: "padding-inline",
|
|
25
|
+
py: "padding-block",
|
|
26
|
+
// Position.
|
|
27
|
+
top: "top",
|
|
28
|
+
right: "right",
|
|
29
|
+
bottom: "bottom",
|
|
30
|
+
left: "left",
|
|
31
|
+
// Other.
|
|
32
|
+
gap: "gap",
|
|
33
|
+
"gap-x": "column-gap",
|
|
34
|
+
"gap-y": "row-gap",
|
|
35
|
+
text: "font-size",
|
|
36
|
+
z: "z-index",
|
|
37
|
+
// Colors.
|
|
38
|
+
bg: "background-color",
|
|
39
|
+
border: "border-color",
|
|
40
|
+
};
|
|
41
|
+
// Pattern: optional-negative + prefix + bracket-value.
|
|
42
|
+
const CUSTOM_VALUE_PATTERN = /^(-?)([\w-]+)-\[(.+)\]$/;
|
|
43
|
+
const VARIANT_PATTERN = /^(hover|focus|disabled|sm|md|lg|xl):(.+)$/;
|
|
44
|
+
const PSEUDO_STATES = ["hover", "focus", "disabled"];
|
|
45
|
+
// Module state.
|
|
46
|
+
const injectedRules = new Set();
|
|
47
|
+
let styleSheet = null;
|
|
48
|
+
/** Check if CSSStyleSheet API is available. */
|
|
49
|
+
export function isSupported() {
|
|
50
|
+
return (typeof document !== "undefined" &&
|
|
51
|
+
typeof CSSStyleSheet !== "undefined" &&
|
|
52
|
+
typeof document.createElement === "function");
|
|
53
|
+
}
|
|
54
|
+
/** Escape CSS selector special characters. */
|
|
55
|
+
function escapeSelector(str) {
|
|
56
|
+
return str.replace(/[[\]#.:>+~()'"]/g, "\\$&");
|
|
57
|
+
}
|
|
58
|
+
/** Get or create the stylesheet. */
|
|
59
|
+
function getStyleSheet() {
|
|
60
|
+
if (!isSupported())
|
|
61
|
+
return null;
|
|
62
|
+
if (styleSheet)
|
|
63
|
+
return styleSheet;
|
|
64
|
+
const style = document.createElement("style");
|
|
65
|
+
style.setAttribute("data-mancha", "custom");
|
|
66
|
+
document.head.appendChild(style);
|
|
67
|
+
// style.sheet may be null if the style element hasn't been attached to the DOM yet.
|
|
68
|
+
if (!style.sheet)
|
|
69
|
+
return null;
|
|
70
|
+
styleSheet = style.sheet;
|
|
71
|
+
return styleSheet;
|
|
72
|
+
}
|
|
73
|
+
/** Parse a custom value class. */
|
|
74
|
+
export function parseCustomValueClass(className) {
|
|
75
|
+
const match = className.match(CUSTOM_VALUE_PATTERN);
|
|
76
|
+
if (!match)
|
|
77
|
+
return null;
|
|
78
|
+
const [, negative, prefix, rawValue] = match;
|
|
79
|
+
const property = PROPERTY_MAP[prefix];
|
|
80
|
+
if (!property)
|
|
81
|
+
return null;
|
|
82
|
+
const value = negative ? `-${rawValue}` : rawValue;
|
|
83
|
+
return { property, value };
|
|
84
|
+
}
|
|
85
|
+
/** Inject a single custom value class (with optional variant). */
|
|
86
|
+
export function injectCustomClass(className, variant) {
|
|
87
|
+
const fullClassName = variant ? `${variant.name}:${className}` : className;
|
|
88
|
+
// Already injected.
|
|
89
|
+
if (injectedRules.has(fullClassName))
|
|
90
|
+
return true;
|
|
91
|
+
const parsed = parseCustomValueClass(className);
|
|
92
|
+
if (!parsed)
|
|
93
|
+
return false;
|
|
94
|
+
const sheet = getStyleSheet();
|
|
95
|
+
if (!sheet)
|
|
96
|
+
return false;
|
|
97
|
+
const { property, value } = parsed;
|
|
98
|
+
const escapedClass = escapeSelector(fullClassName);
|
|
99
|
+
let rule;
|
|
100
|
+
if (!variant) {
|
|
101
|
+
rule = `.${escapedClass} { ${property}: ${value}; }`;
|
|
102
|
+
}
|
|
103
|
+
else if (variant.type === "pseudo") {
|
|
104
|
+
rule = `.${escapedClass}:${variant.name} { ${property}: ${value}; }`;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
const bp = MEDIA_BREAKPOINTS[variant.name];
|
|
108
|
+
rule = `@media (min-width: ${bp}px) { .${escapedClass} { ${property}: ${value}; } }`;
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
sheet.insertRule(rule, sheet.cssRules.length);
|
|
112
|
+
injectedRules.add(fullClassName);
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
catch (e) {
|
|
116
|
+
console.warn(`Failed to inject CSS rule: ${rule}`, e);
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/** Process a class string, inject CSS for any custom values. */
|
|
121
|
+
export function processClassString(classString) {
|
|
122
|
+
if (!classString || !classString.includes("["))
|
|
123
|
+
return;
|
|
124
|
+
for (const cls of classString.trim().split(/\s+/)) {
|
|
125
|
+
// Check for variant prefix.
|
|
126
|
+
const variantMatch = cls.match(VARIANT_PATTERN);
|
|
127
|
+
if (variantMatch) {
|
|
128
|
+
const [, variantName, baseClass] = variantMatch;
|
|
129
|
+
const isPseudo = PSEUDO_STATES.includes(variantName);
|
|
130
|
+
const isMedia = variantName in MEDIA_BREAKPOINTS;
|
|
131
|
+
if (isPseudo || isMedia) {
|
|
132
|
+
injectCustomClass(baseClass, {
|
|
133
|
+
type: isPseudo ? "pseudo" : "media",
|
|
134
|
+
name: variantName,
|
|
135
|
+
});
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
// Try as base class.
|
|
140
|
+
injectCustomClass(cls);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/** Scan a DOM tree and inject CSS for all custom values found. */
|
|
144
|
+
export function scanAndInject(root = document) {
|
|
145
|
+
if (!isSupported())
|
|
146
|
+
return;
|
|
147
|
+
const elements = root.querySelectorAll("[class]");
|
|
148
|
+
for (const el of elements) {
|
|
149
|
+
const classAttr = el.getAttribute("class");
|
|
150
|
+
if (classAttr)
|
|
151
|
+
processClassString(classAttr);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/** For testing: reset module state. */
|
|
155
|
+
export function _resetForTesting() {
|
|
156
|
+
injectedRules.clear();
|
|
157
|
+
if (styleSheet?.ownerNode) {
|
|
158
|
+
styleSheet.ownerNode.remove();
|
|
159
|
+
}
|
|
160
|
+
styleSheet = null;
|
|
161
|
+
}
|
|
162
|
+
/** For testing: get injected rules. */
|
|
163
|
+
export function _getInjectedRules() {
|
|
164
|
+
return injectedRules;
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=css_custom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css_custom.js","sourceRoot":"","sources":["../src/css_custom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,2CAA2C;AAC3C,MAAM,YAAY,GAA2B;IAC5C,UAAU;IACV,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,QAAQ;IACX,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,YAAY;IAErB,WAAW;IACX,CAAC,EAAE,QAAQ;IACX,EAAE,EAAE,YAAY;IAChB,EAAE,EAAE,cAAc;IAClB,EAAE,EAAE,eAAe;IACnB,EAAE,EAAE,aAAa;IACjB,EAAE,EAAE,eAAe;IACnB,EAAE,EAAE,cAAc;IAClB,CAAC,EAAE,SAAS;IACZ,EAAE,EAAE,aAAa;IACjB,EAAE,EAAE,eAAe;IACnB,EAAE,EAAE,gBAAgB;IACpB,EAAE,EAAE,cAAc;IAClB,EAAE,EAAE,gBAAgB;IACpB,EAAE,EAAE,eAAe;IAEnB,YAAY;IACZ,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IAEZ,SAAS;IACT,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,WAAW;IACjB,CAAC,EAAE,SAAS;IAEZ,UAAU;IACV,EAAE,EAAE,kBAAkB;IACtB,MAA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,EAAE,WAAW;iBACjB,CAAC,CAAC;gBACH,SAAS;YACV,CAAC;QACF,CAAC;QAED,qBAAqB;QACrB,iBAAiB,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;AACF,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,aAAa,CAAC,OAA2B,QAAQ;IAChE,IAAI,CAAC,WAAW,EAAE;QAAE,OAAO;IAE3B,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAClD,KAAK,MAAM,EAAE,IAAI,QAAQ,EAAE,CAAC;QAC3B,MAAM,SAAS,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC3C,IAAI,SAAS;YAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC9C,CAAC;AACF,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,gBAAgB;IAC/B,aAAa,CAAC,KAAK,EAAE,CAAC;IACtB,IAAI,UAAU,EAAE,SAAS,EAAE,CAAC;QAC1B,UAAU,CAAC,SAAqB,CAAC,MAAM,EAAE,CAAC;IAC5C,CAAC;IACD,UAAU,GAAG,IAAI,CAAC;AACnB,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,iBAAiB;IAChC,OAAO,aAAa,CAAC;AACtB,CAAC"}
|
package/dist/css_gen_utils.js
CHANGED
|
@@ -807,33 +807,34 @@ function textSizes() {
|
|
|
807
807
|
]);
|
|
808
808
|
}
|
|
809
809
|
function gridPatterns() {
|
|
810
|
-
return wrapAll([
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
810
|
+
return wrapAll(["column", "row"].flatMap((axis) => {
|
|
811
|
+
const short = axis.slice(0, 3);
|
|
812
|
+
return [
|
|
813
|
+
// Grid template: grid-cols-*, grid-rows-*
|
|
814
|
+
...Array.from({ length: 12 }, (_, i) => i + 1).map((n) => [
|
|
815
|
+
`grid-${short}s-${n}`,
|
|
816
|
+
`grid-template-${axis}s: repeat(${n}, minmax(0, 1fr))`,
|
|
817
|
+
]),
|
|
818
|
+
[`grid-${short}s-none`, `grid-template-${axis}s: none`],
|
|
819
|
+
// Grid span: col-span-*, row-span-*
|
|
820
|
+
...Array.from({ length: 12 }, (_, i) => i + 1).map((n) => [
|
|
821
|
+
`${short}-span-${n}`,
|
|
822
|
+
`grid-${axis}: span ${n} / span ${n}`,
|
|
823
|
+
]),
|
|
824
|
+
[`${short}-span-full`, `grid-${axis}: 1 / -1`],
|
|
825
|
+
// Grid start/end: col-start-*, row-start-*, col-end-*, row-end-*
|
|
826
|
+
...Array.from({ length: 13 }, (_, i) => i + 1).map((n) => [
|
|
827
|
+
`${short}-start-${n}`,
|
|
828
|
+
`grid-${axis}-start: ${n}`,
|
|
829
|
+
]),
|
|
830
|
+
[`${short}-start-auto`, `grid-${axis}-start: auto`],
|
|
831
|
+
...Array.from({ length: 13 }, (_, i) => i + 1).map((n) => [
|
|
832
|
+
`${short}-end-${n}`,
|
|
833
|
+
`grid-${axis}-end: ${n}`,
|
|
834
|
+
]),
|
|
835
|
+
[`${short}-end-auto`, `grid-${axis}-end: auto`],
|
|
836
|
+
];
|
|
837
|
+
}));
|
|
837
838
|
}
|
|
838
839
|
function custom() {
|
|
839
840
|
return Object.entries(PROPS_CUSTOM).flatMap(([klass, props]) => {
|