@idlapps/t 0.1.3 → 0.1.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/README.md +33 -9
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -201,31 +201,55 @@ Apply styles on hover:
|
|
|
201
201
|
|
|
202
202
|
```css
|
|
203
203
|
._t0:hover {
|
|
204
|
-
background
|
|
204
|
+
background: red !important;
|
|
205
205
|
padding: 15px !important;
|
|
206
206
|
}
|
|
207
207
|
```
|
|
208
208
|
|
|
209
|
-
##
|
|
209
|
+
## Pseudo-Classes (`h:`, `a:`, `f:`, `d:`, ...)
|
|
210
210
|
|
|
211
|
-
|
|
211
|
+
| Prefix | CSS | Description |
|
|
212
|
+
|--------|-----|-------------|
|
|
213
|
+
| `h:` | `:hover` | Hover state |
|
|
214
|
+
| `a:` | `:active` | Click/press state |
|
|
215
|
+
| `f:` | `:focus` | Focus state |
|
|
216
|
+
| `fw:` | `:focus-within` | Focus within container |
|
|
217
|
+
| `fv:` | `:focus-visible` | Keyboard focus indicator |
|
|
218
|
+
| `d:` | `:disabled` | Disabled state |
|
|
219
|
+
| `ch:` | `:checked` | Checkbox/radio checked |
|
|
220
|
+
| `v:` | `:visited` | Visited link |
|
|
221
|
+
| `ln:` | `:link` | Unvisited link |
|
|
222
|
+
|
|
223
|
+
```html
|
|
224
|
+
<div a:bgred f:clwhite d:opacity50>Click me</div>
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
```css
|
|
228
|
+
._t0:active { background: red !important; }
|
|
229
|
+
._t1:focus { color: white !important; }
|
|
230
|
+
._t2:disabled { opacity: 50 !important; }
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Ancestor Pseudo-Classes (`h1:`, `a2:`, `f3:`, ...)
|
|
234
|
+
|
|
235
|
+
Style a child when an ancestor is in a pseudo-state. The number indicates how many levels up:
|
|
212
236
|
|
|
213
237
|
```html
|
|
214
238
|
<div>
|
|
215
|
-
<span
|
|
239
|
+
<span a1:p30>Click parent to pad me</span>
|
|
216
240
|
</div>
|
|
217
241
|
```
|
|
218
242
|
|
|
219
243
|
```css
|
|
220
|
-
._t0:
|
|
244
|
+
._t0:active ._t1 {
|
|
221
245
|
padding: 30px !important;
|
|
222
246
|
}
|
|
223
247
|
```
|
|
224
248
|
|
|
225
|
-
- `h1:` —
|
|
226
|
-
- `h2:` —
|
|
227
|
-
- `h3:` —
|
|
228
|
-
- `hN:` —
|
|
249
|
+
- `h1:` / `a1:` / `f1:` — immediate parent
|
|
250
|
+
- `h2:` / `a2:` / `f2:` — grandparent
|
|
251
|
+
- `h3:` / `f3:` — great-grandparent
|
|
252
|
+
- `hN:` — Nth ancestor
|
|
229
253
|
|
|
230
254
|
## Responsive (`sm:`, `md:`, `lg:`, `xl:`, `2xl:`)
|
|
231
255
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=document.createElement(`template`),t={m:`margin`,p:`padding`,t:`top`,r:`right`,l:`left`,b:`bottom`,x:`$l:$r`,y:`$t:$b`,w:`width`,h:`height`,min:`min`,max:`max`,P:`position`,D:`display`,fd:`flexDirection`,C:`center`,bg:`background`,cl:`color`,tn:`transition`,tx:`translateX`,ty:`translateY`,tr:`rotate`,ts:`scale`,fs:`fontSize`,fw:`fontWeight`,lh:`lineHeight`,ls:`letterSpacing`,ta:`textAlign`,bd:`border`,rounded:`borderRadius`,shadow:`boxShadow`,opacity:`opacity`,z:`zIndex`,overflow:`overflow`,gap:`gap`,justify:`justifyContent`,items:`alignItems`,ml:`$m$l`,mr:`$m$r`,mt:`$m$t`,mb:`$m$b`,mx:`$m$l:$m$r`,my:`$m$t:$m$b`,pl:`$p$l`,pr:`$p$r`,pt:`$p$t`,pb:`$p$b`,px:`$p$l:$p$r`,py:`$p$t:$p$b`,minw:`$min$w`,minh:`$min$h`,maxw:`$max$w`,maxh:`$max$h`,ba:`$bd`,bt:`$bd$t`,br:`$bd$r`,bb:`$bd$b`,bl:`$bd$l`,bc:`borderColor`,bct:`borderTopColor`,bcr:`borderRightColor`,bcb:`borderBottomColor`,bcl:`borderLeftColor`},n={absolute:`$P:absolute`,a:`$P:absolute`,relative:`$P:relative`,r:`$P:relative`,fixed:`$P:fixed`,f:`$P:fixed`,sticky:`$P:sticky`,flex:`$D:flex`,c:`$D:flex;$justify:$C;$items:$C`,h:`$D:flex;$fd:row`,v:`$D:flex;$fd:column`,tac:`$ta:center`,tar:`$ta:right`,tal:`$ta:left`,ba:`$bd`},r=new Set(`transparent.currentcolor.inherit.initial.unset.red.blue.green.white.black.yellow.orange.purple.pink.teal.cyan.magenta.lime.maroon.navy.olive.gray.grey.silver.gold.coral.salmon.tomato.crimson.indigo.violet.turquoise.plum.orchid.khaki.lavender.ivory.beige.tan.wheat.peru.sienna.chocolate.firebrick.darkred.lightgreen.darkgreen.lightblue.darkblue.darkcyan.darkmagenta.darkviolet.darkorange.darkgoldenrod.darkslategray.darkolivegreen.mediumseagreen.mediumturquoise.mediumslateblue.mediumorchid.mediumpurple.hotpink.deeppink.palevioletred.lightsalmon.lightcoral.skyblue.lightskyblue.steelblue.dodgerblue.cornflowerblue.royalblue.slateblue.mediumblue.midnightblue.aquamarine.chartreuse.springgreen.forestgreen.limegreen.lawngreen.darkseagreen.palegreen.lightyellow.lemonchiffon.paleturquoise.powderblue.lightsteelblue.aliceblue.ghostwhite.snow.floralwhite.oldlace.linen.antiquewhite.mintcream.mistyrose.peachpuff.navajowhite.burlywood.sandybrown.darksalmon.rosybrown.darkkhaki.palegoldenrod.cadetblue.lightcyan.azure.honeydew.thistle.gainsboro.whitesmoke.darkgray.dimgray.lightslategray.slategray`.split(`.`)),i=new Set(`bold.bolder.lighter.normal.italic.oblique.thin.hairline.semibold.extrabold.ultrabold.medium.regular.small.xxsmall.xsmall.large.xlarge.xxlarge.smaller.larger.normal.collapse.hidden.visible.scroll.auto.block.inline.inlineblock.inlineflex.grid.inlinegrid.none.contents.unset.inherit.initial.solid.dashed.dotted.double.groove.ridge.inset.outset.cover.contain.fill.stroke.running.paused.forwards.backwards.both.ease.linear.easein.easeout.easeinout.stepstart.stepend.nowrap.pre.prewrap.preline.breakspace.uppercase.lowercase.capitalize.center.justify.start.end.stretch.baseline.sub.super.overline.through.pointer.default.notallowed.text.wait.help.progress.snapstart.snapend.snapcenter.snearest.mandatory.smooth.noerase.erase.vertical.horizontal.row.column.rowreverse.columnreverse.wrap.wrapreverse`.split(`.`)),a=new Set([`z`,`opacity`,`zIndex`]),o=new Set([`tn`,`transition`]),s=new Set([`tx`,`ty`,`translateX`,`translateY`,`tr`,`ts`,`rotate`,`scale`]),c=new Set([`ba`,`bt`,`br`,`bb`,`bl`,`border`,`borderTop`,`borderRight`,`borderBottom`,`borderLeft`]),l=new Set([`tr`,`rotate`]),u=new Set([`ts`,`scale`]),d={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},f=Object.keys(d).sort((e,t)=>t.length-e.length),p=Object.keys(t).sort((e,t)=>t.length-e.length);function m(e){for(;e.includes(`$`);){let n=``,r=0;for(;r<e.length;){if(e[r]===`$`){let i=e.slice(r+1).match(/^[a-zA-Z]+/);if(i){let e=t[i[0]]??i[0];n+=n&&/[a-zA-Z]$/.test(n)?e[0].toUpperCase()+e.slice(1):e,r+=1+i[0].length;continue}}n+=e[r++]}e=n}return e}const h=e=>e.replace(/([A-Z])/g,`-$1`).toLowerCase(),g=e=>e.split(`;`).map(e=>{let t=e.indexOf(`:`);return t>-1?`${h(e.slice(0,t))}:${e.slice(t+1)}`:h(e)}).join(`;`);function _(e,t){return/^-?\d+$/.test(e)?a.has(t)||u.has(t)?e:o.has(t)?`${e}ms`:l.has(t)?`${e}deg`:`${e}px`:/^-?\d+p$/.test(e)?`${e.slice(0,-1)}%`:e}const v=/^#([0-9a-f]{3,8})$/i,y=/^(rgba?|hsla?|oklch|color|linear-gradient|radial-gradient|conic-gradient|repeating-linear-gradient|repeating-radial-gradient)\(.+\)$/i;function b(e){if(n[e])return g(m(n[e]));for(let n of p){if(!e.startsWith(n)||n.length>=e.length)continue;let a=e.slice(n.length),o=_(a,n);if(/^\d/.test(a)||r.has(a.toLowerCase())||i.has(a.toLowerCase())||v.test(a)||y.test(a)||a[0]===`-`&&/^\d/.test(a.slice(1))){let e=m(t[n]);return(e.includes(`:`)?e.split(`:`):[e]).map(e=>s.has(e)?`transform:${e}(${o})`:c.has(n)&&/^\d/.test(a)?`${h(e)}:${o} solid`:`${h(e)}:${o}`).join(`;`)}}return``}let x=0;const S=[],C=[];function
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=document.createElement(`template`),t={m:`margin`,p:`padding`,t:`top`,r:`right`,l:`left`,b:`bottom`,x:`$l:$r`,y:`$t:$b`,w:`width`,h:`height`,min:`min`,max:`max`,P:`position`,D:`display`,fd:`flexDirection`,C:`center`,bg:`background`,cl:`color`,tn:`transition`,tx:`translateX`,ty:`translateY`,tr:`rotate`,ts:`scale`,fs:`fontSize`,fw:`fontWeight`,lh:`lineHeight`,ls:`letterSpacing`,ta:`textAlign`,bd:`border`,rounded:`borderRadius`,shadow:`boxShadow`,opacity:`opacity`,z:`zIndex`,overflow:`overflow`,gap:`gap`,justify:`justifyContent`,items:`alignItems`,ml:`$m$l`,mr:`$m$r`,mt:`$m$t`,mb:`$m$b`,mx:`$m$l:$m$r`,my:`$m$t:$m$b`,pl:`$p$l`,pr:`$p$r`,pt:`$p$t`,pb:`$p$b`,px:`$p$l:$p$r`,py:`$p$t:$p$b`,minw:`$min$w`,minh:`$min$h`,maxw:`$max$w`,maxh:`$max$h`,ba:`$bd`,bt:`$bd$t`,br:`$bd$r`,bb:`$bd$b`,bl:`$bd$l`,bc:`borderColor`,bct:`borderTopColor`,bcr:`borderRightColor`,bcb:`borderBottomColor`,bcl:`borderLeftColor`},n={absolute:`$P:absolute`,a:`$P:absolute`,relative:`$P:relative`,r:`$P:relative`,fixed:`$P:fixed`,f:`$P:fixed`,sticky:`$P:sticky`,flex:`$D:flex`,c:`$D:flex;$justify:$C;$items:$C`,h:`$D:flex;$fd:row`,v:`$D:flex;$fd:column`,tac:`$ta:center`,tar:`$ta:right`,tal:`$ta:left`,ba:`$bd`},r=new Set(`transparent.currentcolor.inherit.initial.unset.red.blue.green.white.black.yellow.orange.purple.pink.teal.cyan.magenta.lime.maroon.navy.olive.gray.grey.silver.gold.coral.salmon.tomato.crimson.indigo.violet.turquoise.plum.orchid.khaki.lavender.ivory.beige.tan.wheat.peru.sienna.chocolate.firebrick.darkred.lightgreen.darkgreen.lightblue.darkblue.darkcyan.darkmagenta.darkviolet.darkorange.darkgoldenrod.darkslategray.darkolivegreen.mediumseagreen.mediumturquoise.mediumslateblue.mediumorchid.mediumpurple.hotpink.deeppink.palevioletred.lightsalmon.lightcoral.skyblue.lightskyblue.steelblue.dodgerblue.cornflowerblue.royalblue.slateblue.mediumblue.midnightblue.aquamarine.chartreuse.springgreen.forestgreen.limegreen.lawngreen.darkseagreen.palegreen.lightyellow.lemonchiffon.paleturquoise.powderblue.lightsteelblue.aliceblue.ghostwhite.snow.floralwhite.oldlace.linen.antiquewhite.mintcream.mistyrose.peachpuff.navajowhite.burlywood.sandybrown.darksalmon.rosybrown.darkkhaki.palegoldenrod.cadetblue.lightcyan.azure.honeydew.thistle.gainsboro.whitesmoke.darkgray.dimgray.lightslategray.slategray`.split(`.`)),i=new Set(`bold.bolder.lighter.normal.italic.oblique.thin.hairline.semibold.extrabold.ultrabold.medium.regular.small.xxsmall.xsmall.large.xlarge.xxlarge.smaller.larger.normal.collapse.hidden.visible.scroll.auto.block.inline.inlineblock.inlineflex.grid.inlinegrid.none.contents.unset.inherit.initial.solid.dashed.dotted.double.groove.ridge.inset.outset.cover.contain.fill.stroke.running.paused.forwards.backwards.both.ease.linear.easein.easeout.easeinout.stepstart.stepend.nowrap.pre.prewrap.preline.breakspace.uppercase.lowercase.capitalize.center.justify.start.end.stretch.baseline.sub.super.overline.through.pointer.default.notallowed.text.wait.help.progress.snapstart.snapend.snapcenter.snearest.mandatory.smooth.noerase.erase.vertical.horizontal.row.column.rowreverse.columnreverse.wrap.wrapreverse.sm.md.lg.xl.2xl`.split(`.`)),a=new Set([`z`,`opacity`,`zIndex`]),o=new Set([`tn`,`transition`]),s=new Set([`tx`,`ty`,`translateX`,`translateY`,`tr`,`ts`,`rotate`,`scale`]),c=new Set([`ba`,`bt`,`br`,`bb`,`bl`,`border`,`borderTop`,`borderRight`,`borderBottom`,`borderLeft`]),l=new Set([`tr`,`rotate`]),u=new Set([`ts`,`scale`]),d={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},f=Object.keys(d).sort((e,t)=>t.length-e.length),p=Object.keys(t).sort((e,t)=>t.length-e.length);function m(e){for(;e.includes(`$`);){let n=``,r=0;for(;r<e.length;){if(e[r]===`$`){let i=e.slice(r+1).match(/^[a-zA-Z]+/);if(i){let e=t[i[0]]??i[0];n+=n&&/[a-zA-Z]$/.test(n)?e[0].toUpperCase()+e.slice(1):e,r+=1+i[0].length;continue}}n+=e[r++]}e=n}return e}const h=e=>e.replace(/([A-Z])/g,`-$1`).toLowerCase(),g=e=>e.split(`;`).map(e=>{let t=e.indexOf(`:`);return t>-1?`${h(e.slice(0,t))}:${e.slice(t+1)}`:h(e)}).join(`;`);function _(e,t){return/^-?\d+$/.test(e)?a.has(t)||u.has(t)?e:o.has(t)?`${e}ms`:l.has(t)?`${e}deg`:`${e}px`:/^-?\d+p$/.test(e)?`${e.slice(0,-1)}%`:e}const v=/^#([0-9a-f]{3,8})$/i,y=/^(rgba?|hsla?|oklch|color|linear-gradient|radial-gradient|conic-gradient|repeating-linear-gradient|repeating-radial-gradient)\(.+\)$/i;function b(e){if(n[e])return g(m(n[e]));for(let n of p){if(!e.startsWith(n)||n.length>=e.length)continue;let a=e.slice(n.length),o=_(a,n);if(/^\d/.test(a)||r.has(a.toLowerCase())||i.has(a.toLowerCase())||v.test(a)||y.test(a)||a[0]===`-`&&/^\d/.test(a.slice(1))){let e=m(t[n]);return(e.includes(`:`)?e.split(`:`):[e]).map(e=>s.has(e)?`transform:${e}(${o})`:c.has(n)&&/^\d/.test(a)?`${h(e)}:${o} solid`:`${h(e)}:${o}`).join(`;`)}}return``}let x=0;const S=[],C={h:`hover`,a:`active`,f:`focus`,fw:`focus-within`,fv:`focus-visible`,d:`disabled`,ch:`checked`,v:`visited`,ln:`link`},w=Object.keys(C).sort((e,t)=>t.length-e.length),T=[];function E(e,t){return e?`@media(min-width:${e}px){${t}}`:t}function D(e){let t=[];for(let n of Array.from(e.attributes)){if(n.name===`ref`)continue;let r=n.name,i;for(let e of f)if(r.startsWith(e+`:`)){i=d[e],r=r.slice(e.length+1);break}let a=!1;for(let t of w){if(!r.startsWith(t+`:`)||r.length<=t.length+1)continue;let o=r.slice(t.length+1);if(!o)continue;let s=b(o);if(s){let n=`_t${x++}`;e.classList.add(n),S.push(E(i,`.${n}:${C[t]}{${s.split(`;`).map(e=>e+`!important`).join(`;`)}}`))}e.removeAttribute(n.name),a=!0;break}if(a)continue;let o=r.match(/^([a-z]+?)(\d+):(.+)$/);if(o&&C[o[1]]){let t=b(o[3]);t&&T.push({el:e,level:+o[2],css:t,media:i,pseudo:C[o[1]]}),e.removeAttribute(n.name);continue}let s=b(r);if(s){if(i){let t=`_t${x++}`;e.classList.add(t),S.push(E(i,`.${t}{${s.split(`;`).map(e=>e+`!important`).join(`;`)}}`))}else t.push(s);e.removeAttribute(n.name)}}t.length&&e.setAttribute(`style`,(e.getAttribute(`style`)||``)+t.join(`;`))}function O(t){e.innerHTML=String(t);let n={},r=document.createTreeWalker(e.content,NodeFilter.SHOW_ELEMENT),i;for(;i=r.nextNode();)D(i),i.hasAttribute(`ref`)&&(n[i.getAttribute(`ref`)]=i,i.removeAttribute(`ref`));for(let{el:e,level:t,css:n,media:r,pseudo:i}of T){let a=e;for(let e=0;e<t;e++)a=a?.parentElement??null;if(a&&a!==e){let t=`_t${x++}`,o=`_t${x++}`;a.classList.add(t),e.classList.add(o),S.push(E(r,`.${t}:${i} .${o}{${n.split(`;`).map(e=>e+`!important`).join(`;`)}}`))}}if(T.length=0,document.body.appendChild(e.content),S.length){let e=document.querySelector(`style[data-t]`)||(()=>{let e=document.createElement(`style`);return e.setAttribute(`data-t`,``),document.head.appendChild(e)})();e.textContent+=S.join(``),S.length=0}return n}exports.t=O;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["const T = document.createElement('template');\n\nconst A: Record<string, string> = {\n m: 'margin', p: 'padding', t: 'top', r: 'right', l: 'left', b: 'bottom',\n x: '$l:$r', y: '$t:$b', w: 'width', h: 'height', min: 'min', max: 'max',\n P: 'position', D: 'display', fd: 'flexDirection', C: 'center',\n bg: 'background', cl: 'color', tn: 'transition',\n tx: 'translateX', ty: 'translateY', tr: 'rotate', ts: 'scale',\n fs: 'fontSize', fw: 'fontWeight', lh: 'lineHeight', ls: 'letterSpacing', ta: 'textAlign',\n bd: 'border', rounded: 'borderRadius', shadow: 'boxShadow',\n opacity: 'opacity', z: 'zIndex', overflow: 'overflow',\n gap: 'gap', justify: 'justifyContent', items: 'alignItems',\n ml: '$m$l', mr: '$m$r', mt: '$m$t', mb: '$m$b',\n mx: '$m$l:$m$r', my: '$m$t:$m$b',\n pl: '$p$l', pr: '$p$r', pt: '$p$t', pb: '$p$b',\n px: '$p$l:$p$r', py: '$p$t:$p$b',\n minw: '$min$w', minh: '$min$h', maxw: '$max$w', maxh: '$max$h',\n ba: '$bd', bt: '$bd$t', br: '$bd$r', bb: '$bd$b', bl: '$bd$l',\n bc: 'borderColor', bct: 'borderTopColor', bcr: 'borderRightColor', bcb: 'borderBottomColor', bcl: 'borderLeftColor',\n};\n\nconst exact: Record<string, string> = {\n absolute: '$P:absolute', a: '$P:absolute',\n relative: '$P:relative', r: '$P:relative',\n fixed: '$P:fixed', f: '$P:fixed', sticky: '$P:sticky',\n flex: '$D:flex', c: '$D:flex;$justify:$C;$items:$C',\n h: '$D:flex;$fd:row', v: '$D:flex;$fd:column',\n tac: '$ta:center', tar: '$ta:right', tal: '$ta:left',\n ba: '$bd',\n};\n\nconst colors = new Set(['transparent','currentcolor','inherit','initial','unset','red','blue','green','white','black','yellow','orange','purple','pink','teal','cyan','magenta','lime','maroon','navy','olive','gray','grey','silver','gold','coral','salmon','tomato','crimson','indigo','violet','turquoise','plum','orchid','khaki','lavender','ivory','beige','tan','wheat','peru','sienna','chocolate','firebrick','darkred','lightgreen','darkgreen','lightblue','darkblue','darkcyan','darkmagenta','darkviolet','darkorange','darkgoldenrod','darkslategray','darkolivegreen','mediumseagreen','mediumturquoise','mediumslateblue','mediumorchid','mediumpurple','hotpink','deeppink','palevioletred','lightsalmon','lightcoral','skyblue','lightskyblue','steelblue','dodgerblue','cornflowerblue','royalblue','slateblue','mediumblue','midnightblue','aquamarine','chartreuse','springgreen','forestgreen','limegreen','lawngreen','darkseagreen','palegreen','lightyellow','lemonchiffon','paleturquoise','powderblue','lightsteelblue','aliceblue','ghostwhite','snow','floralwhite','oldlace','linen','antiquewhite','mintcream','mistyrose','peachpuff','navajowhite','burlywood','sandybrown','darksalmon','rosybrown','darkkhaki','palegoldenrod','cadetblue','lightcyan','azure','honeydew','thistle','gainsboro','whitesmoke','darkgray','dimgray','lightslategray','slategray']);\nconst keywords = new Set(['bold','bolder','lighter','normal','italic','oblique','thin','hairline','semibold','extrabold','ultrabold','medium','regular','small','xxsmall','xsmall','large','xlarge','xxlarge','smaller','larger','normal','collapse','hidden','visible','scroll','auto','block','inline','inlineblock','inlineflex','grid','inlinegrid','none','contents','unset','inherit','initial','solid','dashed','dotted','double','groove','ridge','inset','outset','cover','contain','fill','stroke','running','paused','forwards','backwards','both','ease','linear','easein','easeout','easeinout','stepstart','stepend','nowrap','pre','prewrap','preline','breakspace','uppercase','lowercase','capitalize','center','justify','start','end','stretch','baseline','sub','super','overline','through','pointer','default','notallowed','text','wait','help','progress','snapstart','snapend','snapcenter','snearest','mandatory','smooth','noerase','erase','vertical','horizontal','row','column','rowreverse','columnreverse','wrap','wrapreverse']);\nconst unitless = new Set(['z', 'opacity', 'zIndex']);\nconst ms = new Set(['tn', 'transition']);\nconst transforms = new Set(['tx', 'ty', 'translateX', 'translateY', 'tr', 'ts', 'rotate', 'scale']);\nconst solidSuffix = new Set(['ba', 'bt', 'br', 'bb', 'bl', 'border', 'borderTop', 'borderRight', 'borderBottom', 'borderLeft']);\nconst deg = new Set(['tr', 'rotate']);\nconst unitlessVal = new Set(['ts', 'scale']);\nconst BP: Record<string, number> = { sm: 640, md: 768, lg: 1024, xl: 1280, '2xl': 1536 };\nconst BPS = Object.keys(BP).sort((a, b) => b.length - a.length);\nconst AP = Object.keys(A).sort((a, b) => b.length - a.length);\n\nfunction resolve(s: string): string {\n while (s.includes('$')) {\n let r = '', i = 0;\n while (i < s.length) {\n if (s[i] === '$') {\n const m = s.slice(i + 1).match(/^[a-zA-Z]+/);\n if (m) {\n const v = A[m[0]] ?? m[0];\n r += r && /[a-zA-Z]$/.test(r) ? v[0].toUpperCase() + v.slice(1) : v;\n i += 1 + m[0].length;\n continue;\n }\n }\n r += s[i++];\n }\n s = r;\n }\n return s;\n}\n\nconst kebab = (s: string) => s.replace(/([A-Z])/g, '-$1').toLowerCase();\n\nconst toCSS = (v: string) => v.split(';').map(p => { const i = p.indexOf(':'); return i > -1 ? `${kebab(p.slice(0, i))}:${p.slice(i + 1)}` : kebab(p); }).join(';');\n\nfunction parseVal(raw: string, prop: string): string {\n if (/^-?\\d+$/.test(raw)) return unitless.has(prop) || unitlessVal.has(prop) ? raw : ms.has(prop) ? `${raw}ms` : deg.has(prop) ? `${raw}deg` : `${raw}px`;\n if (/^-?\\d+p$/.test(raw)) return `${raw.slice(0, -1)}%`;\n return raw;\n}\n\nconst hex = /^#([0-9a-f]{3,8})$/i;\nconst fn = /^(rgba?|hsla?|oklch|color|linear-gradient|radial-gradient|conic-gradient|repeating-linear-gradient|repeating-radial-gradient)\\(.+\\)$/i;\n\nfunction parse(attr: string): string {\n if (exact[attr]) return toCSS(resolve(exact[attr]));\n\n for (const p of AP) {\n if (!attr.startsWith(p) || p.length >= attr.length) continue;\n const raw = attr.slice(p.length);\n const val = parseVal(raw, p);\n if (/^\\d/.test(raw) || colors.has(raw.toLowerCase()) || keywords.has(raw.toLowerCase()) || hex.test(raw) || fn.test(raw) || raw[0] === '-' && /^\\d/.test(raw.slice(1))) {\n const resolved = resolve(A[p]);\n const props = resolved.includes(':') ? resolved.split(':') : [resolved];\n return props.map(k => transforms.has(k) ? `transform:${k}(${val})` : solidSuffix.has(p) && /^\\d/.test(raw) ? `${kebab(k)}:${val} solid` : `${kebab(k)}:${val}`).join(';');\n }\n }\n return '';\n}\n\nlet C = 0;\nconst R: string[] = [];\nconst pendingHoverTarget: { el: Element; level: number; css: string; media?: number }[] = [];\n\nfunction mediaWrap(m: number | undefined, css: string): string {\n return m ? `@media(min-width:${m}px){${css}}` : css;\n}\n\nfunction apply(el: Element) {\n const s: string[] = [];\n for (const a of Array.from(el.attributes)) {\n if (a.name === 'ref') continue;\n let attr = a.name;\n let media: number | undefined;\n for (const bp of BPS) {\n if (attr.startsWith(bp + ':')) { media = BP[bp]; attr = attr.slice(bp.length + 1); break; }\n }\n if (attr.startsWith('h:')) {\n const css = parse(attr.slice(2));\n if (css) {\n const cls = `_t${C++}`;\n el.classList.add(cls);\n R.push(mediaWrap(media, `.${cls}:hover{${css.split(';').map(p => p + '!important').join(';')}}`));\n }\n el.removeAttribute(a.name);\n continue;\n }\n const hm = attr.match(/^h(\\d+):(.+)$/);\n if (hm) {\n const css = parse(hm[2]);\n if (css) pendingHoverTarget.push({ el, level: +hm[1], css, media });\n el.removeAttribute(a.name);\n continue;\n }\n const css = parse(attr);\n if (css) {\n if (media) {\n const cls = `_t${C++}`;\n el.classList.add(cls);\n R.push(mediaWrap(media, `.${cls}{${css.split(';').map(p => p + '!important').join(';')}}`));\n } else {\n s.push(css);\n }\n el.removeAttribute(a.name);\n }\n }\n if (s.length) el.setAttribute('style', (el.getAttribute('style') || '') + s.join(';'));\n}\n\nexport function t(value: unknown) {\n T.innerHTML = String(value);\n const refs: Record<string, HTMLElement> = {};\n const w = document.createTreeWalker(T.content, NodeFilter.SHOW_ELEMENT);\n let n: HTMLElement | null;\n while ((n = w.nextNode() as HTMLElement | null)) {\n apply(n);\n if (n.hasAttribute('ref')) { refs[n.getAttribute('ref')!] = n; n.removeAttribute('ref'); }\n }\n for (const { el, level, css, media } of pendingHoverTarget) {\n let ancestor: HTMLElement | null = el as HTMLElement;\n for (let i = 0; i < level; i++) ancestor = ancestor?.parentElement ?? null;\n if (ancestor && ancestor !== el) {\n const tCls = `_t${C++}`;\n const hCls = `_t${C++}`;\n ancestor.classList.add(tCls);\n el.classList.add(hCls);\n R.push(mediaWrap(media, `.${tCls}:hover .${hCls}{${css.split(';').map(p => p + '!important').join(';')}}`));\n }\n }\n pendingHoverTarget.length = 0;\n document.body.appendChild(T.content);\n if (R.length) {\n const el = document.querySelector('style[data-t]') as HTMLStyleElement || (() => { const s = document.createElement('style'); s.setAttribute('data-t', ''); return document.head.appendChild(s); })();\n el.textContent += R.join('');\n R.length = 0;\n }\n return refs;\n}\n"],"mappings":"mEAAA,MAAM,EAAI,SAAS,cAAc,UAAU,EAErC,EAA4B,CAChC,EAAG,SAAU,EAAG,UAAW,EAAG,MAAO,EAAG,QAAS,EAAG,OAAQ,EAAG,SAC/D,EAAG,QAAS,EAAG,QAAS,EAAG,QAAS,EAAG,SAAU,IAAK,MAAO,IAAK,MAClE,EAAG,WAAY,EAAG,UAAW,GAAI,gBAAiB,EAAG,SACrD,GAAI,aAAc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F,CAEA,SAAgB,EAAE,EAAgB,CAChC,EAAE,UAAY,OAAO,CAAK,EAC1B,IAAM,EAAoC,CAAC,EACrC,EAAI,SAAS,iBAAiB,EAAE,QAAS,WAAW,YAAY,EAClE,EACJ,KAAQ,EAAI,EAAE,SAAS,GACrB,EAAM,CAAC,EACH,EAAE,aAAa,KAAK,IAAK,EAAK,EAAE,aAAa,KAAK,GAAM,EAAG,EAAE,gBAAgB,KAAK,GAExF,IAAK,GAAM,CAAE,KAAI,QAAO,MAAK,WAAW,EAAoB,CAC1D,IAAI,EAA+B,EACnC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAO,IAAK,EAAW,GAAU,eAAiB,KACtE,GAAI,GAAY,IAAa,EAAI,CAC/B,IAAM,EAAO,KAAK,MACZ,EAAO,KAAK,MAClB,EAAS,UAAU,IAAI,CAAI,EAC3B,EAAG,UAAU,IAAI,CAAI,EACrB,EAAE,KAAK,EAAU,EAAO,IAAI,EAAK,UAAU,EAAK,GAAG,EAAI,MAAM,GAAG,CAAC,CAAC,IAAI,GAAK,EAAI,YAAY,CAAC,CAAC,KAAK,GAAG,EAAE,EAAE,CAAC,CAC5G,CACF,CAGA,GAFA,EAAmB,OAAS,EAC5B,SAAS,KAAK,YAAY,EAAE,OAAO,EAC/B,EAAE,OAAQ,CACZ,IAAM,EAAK,SAAS,cAAc,eAAe,QAAgC,CAAE,IAAM,EAAI,SAAS,cAAc,OAAO,EAAiC,OAA9B,EAAE,aAAa,SAAU,EAAE,EAAU,SAAS,KAAK,YAAY,CAAC,CAAG,EAAA,CAAG,EACpM,EAAG,aAAe,EAAE,KAAK,EAAE,EAC3B,EAAE,OAAS,CACb,CACA,OAAO,CACT"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["const T = document.createElement('template');\n\nconst A: Record<string, string> = {\n m: 'margin', p: 'padding', t: 'top', r: 'right', l: 'left', b: 'bottom',\n x: '$l:$r', y: '$t:$b', w: 'width', h: 'height', min: 'min', max: 'max',\n P: 'position', D: 'display', fd: 'flexDirection', C: 'center',\n bg: 'background', cl: 'color', tn: 'transition',\n tx: 'translateX', ty: 'translateY', tr: 'rotate', ts: 'scale',\n fs: 'fontSize', fw: 'fontWeight', lh: 'lineHeight', ls: 'letterSpacing', ta: 'textAlign',\n bd: 'border', rounded: 'borderRadius', shadow: 'boxShadow',\n opacity: 'opacity', z: 'zIndex', overflow: 'overflow',\n gap: 'gap', justify: 'justifyContent', items: 'alignItems',\n ml: '$m$l', mr: '$m$r', mt: '$m$t', mb: '$m$b',\n mx: '$m$l:$m$r', my: '$m$t:$m$b',\n pl: '$p$l', pr: '$p$r', pt: '$p$t', pb: '$p$b',\n px: '$p$l:$p$r', py: '$p$t:$p$b',\n minw: '$min$w', minh: '$min$h', maxw: '$max$w', maxh: '$max$h',\n ba: '$bd', bt: '$bd$t', br: '$bd$r', bb: '$bd$b', bl: '$bd$l',\n bc: 'borderColor', bct: 'borderTopColor', bcr: 'borderRightColor', bcb: 'borderBottomColor', bcl: 'borderLeftColor',\n};\n\nconst exact: Record<string, string> = {\n absolute: '$P:absolute', a: '$P:absolute',\n relative: '$P:relative', r: '$P:relative',\n fixed: '$P:fixed', f: '$P:fixed', sticky: '$P:sticky',\n flex: '$D:flex', c: '$D:flex;$justify:$C;$items:$C',\n h: '$D:flex;$fd:row', v: '$D:flex;$fd:column',\n tac: '$ta:center', tar: '$ta:right', tal: '$ta:left',\n ba: '$bd',\n};\n\nconst colors = new Set(['transparent','currentcolor','inherit','initial','unset','red','blue','green','white','black','yellow','orange','purple','pink','teal','cyan','magenta','lime','maroon','navy','olive','gray','grey','silver','gold','coral','salmon','tomato','crimson','indigo','violet','turquoise','plum','orchid','khaki','lavender','ivory','beige','tan','wheat','peru','sienna','chocolate','firebrick','darkred','lightgreen','darkgreen','lightblue','darkblue','darkcyan','darkmagenta','darkviolet','darkorange','darkgoldenrod','darkslategray','darkolivegreen','mediumseagreen','mediumturquoise','mediumslateblue','mediumorchid','mediumpurple','hotpink','deeppink','palevioletred','lightsalmon','lightcoral','skyblue','lightskyblue','steelblue','dodgerblue','cornflowerblue','royalblue','slateblue','mediumblue','midnightblue','aquamarine','chartreuse','springgreen','forestgreen','limegreen','lawngreen','darkseagreen','palegreen','lightyellow','lemonchiffon','paleturquoise','powderblue','lightsteelblue','aliceblue','ghostwhite','snow','floralwhite','oldlace','linen','antiquewhite','mintcream','mistyrose','peachpuff','navajowhite','burlywood','sandybrown','darksalmon','rosybrown','darkkhaki','palegoldenrod','cadetblue','lightcyan','azure','honeydew','thistle','gainsboro','whitesmoke','darkgray','dimgray','lightslategray','slategray']);\nconst keywords = new Set(['bold','bolder','lighter','normal','italic','oblique','thin','hairline','semibold','extrabold','ultrabold','medium','regular','small','xxsmall','xsmall','large','xlarge','xxlarge','smaller','larger','normal','collapse','hidden','visible','scroll','auto','block','inline','inlineblock','inlineflex','grid','inlinegrid','none','contents','unset','inherit','initial','solid','dashed','dotted','double','groove','ridge','inset','outset','cover','contain','fill','stroke','running','paused','forwards','backwards','both','ease','linear','easein','easeout','easeinout','stepstart','stepend','nowrap','pre','prewrap','preline','breakspace','uppercase','lowercase','capitalize','center','justify','start','end','stretch','baseline','sub','super','overline','through','pointer','default','notallowed','text','wait','help','progress','snapstart','snapend','snapcenter','snearest','mandatory','smooth','noerase','erase','vertical','horizontal','row','column','rowreverse','columnreverse','wrap','wrapreverse','sm','md','lg','xl','2xl']);\nconst unitless = new Set(['z', 'opacity', 'zIndex']);\nconst ms = new Set(['tn', 'transition']);\nconst transforms = new Set(['tx', 'ty', 'translateX', 'translateY', 'tr', 'ts', 'rotate', 'scale']);\nconst solidSuffix = new Set(['ba', 'bt', 'br', 'bb', 'bl', 'border', 'borderTop', 'borderRight', 'borderBottom', 'borderLeft']);\nconst deg = new Set(['tr', 'rotate']);\nconst unitlessVal = new Set(['ts', 'scale']);\nconst BP: Record<string, number> = { sm: 640, md: 768, lg: 1024, xl: 1280, '2xl': 1536 };\nconst BPS = Object.keys(BP).sort((a, b) => b.length - a.length);\nconst AP = Object.keys(A).sort((a, b) => b.length - a.length);\n\nfunction resolve(s: string): string {\n while (s.includes('$')) {\n let r = '', i = 0;\n while (i < s.length) {\n if (s[i] === '$') {\n const m = s.slice(i + 1).match(/^[a-zA-Z]+/);\n if (m) {\n const v = A[m[0]] ?? m[0];\n r += r && /[a-zA-Z]$/.test(r) ? v[0].toUpperCase() + v.slice(1) : v;\n i += 1 + m[0].length;\n continue;\n }\n }\n r += s[i++];\n }\n s = r;\n }\n return s;\n}\n\nconst kebab = (s: string) => s.replace(/([A-Z])/g, '-$1').toLowerCase();\n\nconst toCSS = (v: string) => v.split(';').map(p => { const i = p.indexOf(':'); return i > -1 ? `${kebab(p.slice(0, i))}:${p.slice(i + 1)}` : kebab(p); }).join(';');\n\nfunction parseVal(raw: string, prop: string): string {\n if (/^-?\\d+$/.test(raw)) return unitless.has(prop) || unitlessVal.has(prop) ? raw : ms.has(prop) ? `${raw}ms` : deg.has(prop) ? `${raw}deg` : `${raw}px`;\n if (/^-?\\d+p$/.test(raw)) return `${raw.slice(0, -1)}%`;\n return raw;\n}\n\nconst hex = /^#([0-9a-f]{3,8})$/i;\nconst fn = /^(rgba?|hsla?|oklch|color|linear-gradient|radial-gradient|conic-gradient|repeating-linear-gradient|repeating-radial-gradient)\\(.+\\)$/i;\n\nfunction parse(attr: string): string {\n if (exact[attr]) return toCSS(resolve(exact[attr]));\n\n for (const p of AP) {\n if (!attr.startsWith(p) || p.length >= attr.length) continue;\n const raw = attr.slice(p.length);\n const val = parseVal(raw, p);\n if (/^\\d/.test(raw) || colors.has(raw.toLowerCase()) || keywords.has(raw.toLowerCase()) || hex.test(raw) || fn.test(raw) || raw[0] === '-' && /^\\d/.test(raw.slice(1))) {\n const resolved = resolve(A[p]);\n const props = resolved.includes(':') ? resolved.split(':') : [resolved];\n return props.map(k => transforms.has(k) ? `transform:${k}(${val})` : solidSuffix.has(p) && /^\\d/.test(raw) ? `${kebab(k)}:${val} solid` : `${kebab(k)}:${val}`).join(';');\n }\n }\n return '';\n}\n\nlet C = 0;\nconst R: string[] = [];\nconst pseudo: Record<string, string> = { h: 'hover', a: 'active', f: 'focus', fw: 'focus-within', fv: 'focus-visible', d: 'disabled', ch: 'checked', v: 'visited', ln: 'link' };\nconst PS = Object.keys(pseudo).sort((a, b) => b.length - a.length);\nconst pendingTarget: { el: Element; level: number; css: string; media?: number; pseudo: string }[] = [];\n\nfunction mediaWrap(m: number | undefined, css: string): string {\n return m ? `@media(min-width:${m}px){${css}}` : css;\n}\n\nfunction apply(el: Element) {\n const s: string[] = [];\n for (const a of Array.from(el.attributes)) {\n if (a.name === 'ref') continue;\n let attr = a.name;\n let media: number | undefined;\n for (const bp of BPS) {\n if (attr.startsWith(bp + ':')) { media = BP[bp]; attr = attr.slice(bp.length + 1); break; }\n }\n let matched = false;\n for (const p of PS) {\n if (!attr.startsWith(p + ':') || attr.length <= p.length + 1) continue;\n const sel = attr.slice(p.length + 1);\n if (!sel) continue;\n const css = parse(sel);\n if (css) {\n const cls = `_t${C++}`;\n el.classList.add(cls);\n R.push(mediaWrap(media, `.${cls}:${pseudo[p]}{${css.split(';').map(p => p + '!important').join(';')}}`));\n }\n el.removeAttribute(a.name);\n matched = true;\n break;\n }\n if (matched) continue;\n const hm = attr.match(/^([a-z]+?)(\\d+):(.+)$/);\n if (hm && pseudo[hm[1]]) {\n const css = parse(hm[3]);\n if (css) pendingTarget.push({ el, level: +hm[2], css, media, pseudo: pseudo[hm[1]] });\n el.removeAttribute(a.name);\n continue;\n }\n const css = parse(attr);\n if (css) {\n if (media) {\n const cls = `_t${C++}`;\n el.classList.add(cls);\n R.push(mediaWrap(media, `.${cls}{${css.split(';').map(p => p + '!important').join(';')}}`));\n } else {\n s.push(css);\n }\n el.removeAttribute(a.name);\n }\n }\n if (s.length) el.setAttribute('style', (el.getAttribute('style') || '') + s.join(';'));\n}\n\nexport function t(value: unknown) {\n T.innerHTML = String(value);\n const refs: Record<string, HTMLElement> = {};\n const w = document.createTreeWalker(T.content, NodeFilter.SHOW_ELEMENT);\n let n: HTMLElement | null;\n while ((n = w.nextNode() as HTMLElement | null)) {\n apply(n);\n if (n.hasAttribute('ref')) { refs[n.getAttribute('ref')!] = n; n.removeAttribute('ref'); }\n }\n for (const { el, level, css, media, pseudo: ps } of pendingTarget) {\n let ancestor: HTMLElement | null = el as HTMLElement;\n for (let i = 0; i < level; i++) ancestor = ancestor?.parentElement ?? null;\n if (ancestor && ancestor !== el) {\n const tCls = `_t${C++}`;\n const hCls = `_t${C++}`;\n ancestor.classList.add(tCls);\n el.classList.add(hCls);\n R.push(mediaWrap(media, `.${tCls}:${ps} .${hCls}{${css.split(';').map(p => p + '!important').join(';')}}`));\n }\n }\n pendingTarget.length = 0;\n document.body.appendChild(T.content);\n if (R.length) {\n const el = document.querySelector('style[data-t]') as HTMLStyleElement || (() => { const s = document.createElement('style'); s.setAttribute('data-t', ''); return document.head.appendChild(s); })();\n el.textContent += R.join('');\n R.length = 0;\n }\n return refs;\n}\n"],"mappings":"mEAAA,MAAM,EAAI,SAAS,cAAc,UAAU,EAErC,EAA4B,CAChC,EAAG,SAAU,EAAG,UAAW,EAAG,MAAO,EAAG,QAAS,EAAG,OAAQ,EAAG,SAC/D,EAAG,QAAS,EAAG,QAAS,EAAG,QAAS,EAAG,SAAU,IAAK,MAAO,IAAK,MAClE,EAAG,WAAY,EAAG,UAAW,GAAI,gBAAiB,EAAG,SACrD,GAAI,aAAc,GAAI,QAAS,GAAI,aACnC,GAAI,aAAc,GAAI,aAAc,GAAI,SAAU,GAAI,QACtD,GAAI,WAAY,GAAI,aAAc,GAAI,aAAc,GAAI,gBAAiB,GAAI,YAC7E,GAAI,SAAU,QAAS,eAAgB,OAAQ,YAC/C,QAAS,UAAW,EAAG,SAAU,SAAU,WAC3C,IAAK,MAAO,QAAS,iBAAkB,MAAO,aAC9C,GAAI,OAAQ,GAAI,OAAQ,GAAI,OAAQ,GAAI,OACxC,GAAI,YA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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";iBAqJgB,EAAE,iBAAc,eAAA"}
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";iBAqJgB,EAAE,iBAAc,eAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=document.createElement(`template`),t={m:`margin`,p:`padding`,t:`top`,r:`right`,l:`left`,b:`bottom`,x:`$l:$r`,y:`$t:$b`,w:`width`,h:`height`,min:`min`,max:`max`,P:`position`,D:`display`,fd:`flexDirection`,C:`center`,bg:`background`,cl:`color`,tn:`transition`,tx:`translateX`,ty:`translateY`,tr:`rotate`,ts:`scale`,fs:`fontSize`,fw:`fontWeight`,lh:`lineHeight`,ls:`letterSpacing`,ta:`textAlign`,bd:`border`,rounded:`borderRadius`,shadow:`boxShadow`,opacity:`opacity`,z:`zIndex`,overflow:`overflow`,gap:`gap`,justify:`justifyContent`,items:`alignItems`,ml:`$m$l`,mr:`$m$r`,mt:`$m$t`,mb:`$m$b`,mx:`$m$l:$m$r`,my:`$m$t:$m$b`,pl:`$p$l`,pr:`$p$r`,pt:`$p$t`,pb:`$p$b`,px:`$p$l:$p$r`,py:`$p$t:$p$b`,minw:`$min$w`,minh:`$min$h`,maxw:`$max$w`,maxh:`$max$h`,ba:`$bd`,bt:`$bd$t`,br:`$bd$r`,bb:`$bd$b`,bl:`$bd$l`,bc:`borderColor`,bct:`borderTopColor`,bcr:`borderRightColor`,bcb:`borderBottomColor`,bcl:`borderLeftColor`},n={absolute:`$P:absolute`,a:`$P:absolute`,relative:`$P:relative`,r:`$P:relative`,fixed:`$P:fixed`,f:`$P:fixed`,sticky:`$P:sticky`,flex:`$D:flex`,c:`$D:flex;$justify:$C;$items:$C`,h:`$D:flex;$fd:row`,v:`$D:flex;$fd:column`,tac:`$ta:center`,tar:`$ta:right`,tal:`$ta:left`,ba:`$bd`},r=new Set(`transparent.currentcolor.inherit.initial.unset.red.blue.green.white.black.yellow.orange.purple.pink.teal.cyan.magenta.lime.maroon.navy.olive.gray.grey.silver.gold.coral.salmon.tomato.crimson.indigo.violet.turquoise.plum.orchid.khaki.lavender.ivory.beige.tan.wheat.peru.sienna.chocolate.firebrick.darkred.lightgreen.darkgreen.lightblue.darkblue.darkcyan.darkmagenta.darkviolet.darkorange.darkgoldenrod.darkslategray.darkolivegreen.mediumseagreen.mediumturquoise.mediumslateblue.mediumorchid.mediumpurple.hotpink.deeppink.palevioletred.lightsalmon.lightcoral.skyblue.lightskyblue.steelblue.dodgerblue.cornflowerblue.royalblue.slateblue.mediumblue.midnightblue.aquamarine.chartreuse.springgreen.forestgreen.limegreen.lawngreen.darkseagreen.palegreen.lightyellow.lemonchiffon.paleturquoise.powderblue.lightsteelblue.aliceblue.ghostwhite.snow.floralwhite.oldlace.linen.antiquewhite.mintcream.mistyrose.peachpuff.navajowhite.burlywood.sandybrown.darksalmon.rosybrown.darkkhaki.palegoldenrod.cadetblue.lightcyan.azure.honeydew.thistle.gainsboro.whitesmoke.darkgray.dimgray.lightslategray.slategray`.split(`.`)),i=new Set(`bold.bolder.lighter.normal.italic.oblique.thin.hairline.semibold.extrabold.ultrabold.medium.regular.small.xxsmall.xsmall.large.xlarge.xxlarge.smaller.larger.normal.collapse.hidden.visible.scroll.auto.block.inline.inlineblock.inlineflex.grid.inlinegrid.none.contents.unset.inherit.initial.solid.dashed.dotted.double.groove.ridge.inset.outset.cover.contain.fill.stroke.running.paused.forwards.backwards.both.ease.linear.easein.easeout.easeinout.stepstart.stepend.nowrap.pre.prewrap.preline.breakspace.uppercase.lowercase.capitalize.center.justify.start.end.stretch.baseline.sub.super.overline.through.pointer.default.notallowed.text.wait.help.progress.snapstart.snapend.snapcenter.snearest.mandatory.smooth.noerase.erase.vertical.horizontal.row.column.rowreverse.columnreverse.wrap.wrapreverse`.split(`.`)),a=new Set([`z`,`opacity`,`zIndex`]),o=new Set([`tn`,`transition`]),s=new Set([`tx`,`ty`,`translateX`,`translateY`,`tr`,`ts`,`rotate`,`scale`]),c=new Set([`ba`,`bt`,`br`,`bb`,`bl`,`border`,`borderTop`,`borderRight`,`borderBottom`,`borderLeft`]),l=new Set([`tr`,`rotate`]),u=new Set([`ts`,`scale`]),d={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},f=Object.keys(d).sort((e,t)=>t.length-e.length),p=Object.keys(t).sort((e,t)=>t.length-e.length);function m(e){for(;e.includes(`$`);){let n=``,r=0;for(;r<e.length;){if(e[r]===`$`){let i=e.slice(r+1).match(/^[a-zA-Z]+/);if(i){let e=t[i[0]]??i[0];n+=n&&/[a-zA-Z]$/.test(n)?e[0].toUpperCase()+e.slice(1):e,r+=1+i[0].length;continue}}n+=e[r++]}e=n}return e}const h=e=>e.replace(/([A-Z])/g,`-$1`).toLowerCase(),g=e=>e.split(`;`).map(e=>{let t=e.indexOf(`:`);return t>-1?`${h(e.slice(0,t))}:${e.slice(t+1)}`:h(e)}).join(`;`);function _(e,t){return/^-?\d+$/.test(e)?a.has(t)||u.has(t)?e:o.has(t)?`${e}ms`:l.has(t)?`${e}deg`:`${e}px`:/^-?\d+p$/.test(e)?`${e.slice(0,-1)}%`:e}const v=/^#([0-9a-f]{3,8})$/i,y=/^(rgba?|hsla?|oklch|color|linear-gradient|radial-gradient|conic-gradient|repeating-linear-gradient|repeating-radial-gradient)\(.+\)$/i;function b(e){if(n[e])return g(m(n[e]));for(let n of p){if(!e.startsWith(n)||n.length>=e.length)continue;let a=e.slice(n.length),o=_(a,n);if(/^\d/.test(a)||r.has(a.toLowerCase())||i.has(a.toLowerCase())||v.test(a)||y.test(a)||a[0]===`-`&&/^\d/.test(a.slice(1))){let e=m(t[n]);return(e.includes(`:`)?e.split(`:`):[e]).map(e=>s.has(e)?`transform:${e}(${o})`:c.has(n)&&/^\d/.test(a)?`${h(e)}:${o} solid`:`${h(e)}:${o}`).join(`;`)}}return``}let x=0;const S=[],C=[];function
|
|
1
|
+
const e=document.createElement(`template`),t={m:`margin`,p:`padding`,t:`top`,r:`right`,l:`left`,b:`bottom`,x:`$l:$r`,y:`$t:$b`,w:`width`,h:`height`,min:`min`,max:`max`,P:`position`,D:`display`,fd:`flexDirection`,C:`center`,bg:`background`,cl:`color`,tn:`transition`,tx:`translateX`,ty:`translateY`,tr:`rotate`,ts:`scale`,fs:`fontSize`,fw:`fontWeight`,lh:`lineHeight`,ls:`letterSpacing`,ta:`textAlign`,bd:`border`,rounded:`borderRadius`,shadow:`boxShadow`,opacity:`opacity`,z:`zIndex`,overflow:`overflow`,gap:`gap`,justify:`justifyContent`,items:`alignItems`,ml:`$m$l`,mr:`$m$r`,mt:`$m$t`,mb:`$m$b`,mx:`$m$l:$m$r`,my:`$m$t:$m$b`,pl:`$p$l`,pr:`$p$r`,pt:`$p$t`,pb:`$p$b`,px:`$p$l:$p$r`,py:`$p$t:$p$b`,minw:`$min$w`,minh:`$min$h`,maxw:`$max$w`,maxh:`$max$h`,ba:`$bd`,bt:`$bd$t`,br:`$bd$r`,bb:`$bd$b`,bl:`$bd$l`,bc:`borderColor`,bct:`borderTopColor`,bcr:`borderRightColor`,bcb:`borderBottomColor`,bcl:`borderLeftColor`},n={absolute:`$P:absolute`,a:`$P:absolute`,relative:`$P:relative`,r:`$P:relative`,fixed:`$P:fixed`,f:`$P:fixed`,sticky:`$P:sticky`,flex:`$D:flex`,c:`$D:flex;$justify:$C;$items:$C`,h:`$D:flex;$fd:row`,v:`$D:flex;$fd:column`,tac:`$ta:center`,tar:`$ta:right`,tal:`$ta:left`,ba:`$bd`},r=new Set(`transparent.currentcolor.inherit.initial.unset.red.blue.green.white.black.yellow.orange.purple.pink.teal.cyan.magenta.lime.maroon.navy.olive.gray.grey.silver.gold.coral.salmon.tomato.crimson.indigo.violet.turquoise.plum.orchid.khaki.lavender.ivory.beige.tan.wheat.peru.sienna.chocolate.firebrick.darkred.lightgreen.darkgreen.lightblue.darkblue.darkcyan.darkmagenta.darkviolet.darkorange.darkgoldenrod.darkslategray.darkolivegreen.mediumseagreen.mediumturquoise.mediumslateblue.mediumorchid.mediumpurple.hotpink.deeppink.palevioletred.lightsalmon.lightcoral.skyblue.lightskyblue.steelblue.dodgerblue.cornflowerblue.royalblue.slateblue.mediumblue.midnightblue.aquamarine.chartreuse.springgreen.forestgreen.limegreen.lawngreen.darkseagreen.palegreen.lightyellow.lemonchiffon.paleturquoise.powderblue.lightsteelblue.aliceblue.ghostwhite.snow.floralwhite.oldlace.linen.antiquewhite.mintcream.mistyrose.peachpuff.navajowhite.burlywood.sandybrown.darksalmon.rosybrown.darkkhaki.palegoldenrod.cadetblue.lightcyan.azure.honeydew.thistle.gainsboro.whitesmoke.darkgray.dimgray.lightslategray.slategray`.split(`.`)),i=new Set(`bold.bolder.lighter.normal.italic.oblique.thin.hairline.semibold.extrabold.ultrabold.medium.regular.small.xxsmall.xsmall.large.xlarge.xxlarge.smaller.larger.normal.collapse.hidden.visible.scroll.auto.block.inline.inlineblock.inlineflex.grid.inlinegrid.none.contents.unset.inherit.initial.solid.dashed.dotted.double.groove.ridge.inset.outset.cover.contain.fill.stroke.running.paused.forwards.backwards.both.ease.linear.easein.easeout.easeinout.stepstart.stepend.nowrap.pre.prewrap.preline.breakspace.uppercase.lowercase.capitalize.center.justify.start.end.stretch.baseline.sub.super.overline.through.pointer.default.notallowed.text.wait.help.progress.snapstart.snapend.snapcenter.snearest.mandatory.smooth.noerase.erase.vertical.horizontal.row.column.rowreverse.columnreverse.wrap.wrapreverse.sm.md.lg.xl.2xl`.split(`.`)),a=new Set([`z`,`opacity`,`zIndex`]),o=new Set([`tn`,`transition`]),s=new Set([`tx`,`ty`,`translateX`,`translateY`,`tr`,`ts`,`rotate`,`scale`]),c=new Set([`ba`,`bt`,`br`,`bb`,`bl`,`border`,`borderTop`,`borderRight`,`borderBottom`,`borderLeft`]),l=new Set([`tr`,`rotate`]),u=new Set([`ts`,`scale`]),d={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},f=Object.keys(d).sort((e,t)=>t.length-e.length),p=Object.keys(t).sort((e,t)=>t.length-e.length);function m(e){for(;e.includes(`$`);){let n=``,r=0;for(;r<e.length;){if(e[r]===`$`){let i=e.slice(r+1).match(/^[a-zA-Z]+/);if(i){let e=t[i[0]]??i[0];n+=n&&/[a-zA-Z]$/.test(n)?e[0].toUpperCase()+e.slice(1):e,r+=1+i[0].length;continue}}n+=e[r++]}e=n}return e}const h=e=>e.replace(/([A-Z])/g,`-$1`).toLowerCase(),g=e=>e.split(`;`).map(e=>{let t=e.indexOf(`:`);return t>-1?`${h(e.slice(0,t))}:${e.slice(t+1)}`:h(e)}).join(`;`);function _(e,t){return/^-?\d+$/.test(e)?a.has(t)||u.has(t)?e:o.has(t)?`${e}ms`:l.has(t)?`${e}deg`:`${e}px`:/^-?\d+p$/.test(e)?`${e.slice(0,-1)}%`:e}const v=/^#([0-9a-f]{3,8})$/i,y=/^(rgba?|hsla?|oklch|color|linear-gradient|radial-gradient|conic-gradient|repeating-linear-gradient|repeating-radial-gradient)\(.+\)$/i;function b(e){if(n[e])return g(m(n[e]));for(let n of p){if(!e.startsWith(n)||n.length>=e.length)continue;let a=e.slice(n.length),o=_(a,n);if(/^\d/.test(a)||r.has(a.toLowerCase())||i.has(a.toLowerCase())||v.test(a)||y.test(a)||a[0]===`-`&&/^\d/.test(a.slice(1))){let e=m(t[n]);return(e.includes(`:`)?e.split(`:`):[e]).map(e=>s.has(e)?`transform:${e}(${o})`:c.has(n)&&/^\d/.test(a)?`${h(e)}:${o} solid`:`${h(e)}:${o}`).join(`;`)}}return``}let x=0;const S=[],C={h:`hover`,a:`active`,f:`focus`,fw:`focus-within`,fv:`focus-visible`,d:`disabled`,ch:`checked`,v:`visited`,ln:`link`},w=Object.keys(C).sort((e,t)=>t.length-e.length),T=[];function E(e,t){return e?`@media(min-width:${e}px){${t}}`:t}function D(e){let t=[];for(let n of Array.from(e.attributes)){if(n.name===`ref`)continue;let r=n.name,i;for(let e of f)if(r.startsWith(e+`:`)){i=d[e],r=r.slice(e.length+1);break}let a=!1;for(let t of w){if(!r.startsWith(t+`:`)||r.length<=t.length+1)continue;let o=r.slice(t.length+1);if(!o)continue;let s=b(o);if(s){let n=`_t${x++}`;e.classList.add(n),S.push(E(i,`.${n}:${C[t]}{${s.split(`;`).map(e=>e+`!important`).join(`;`)}}`))}e.removeAttribute(n.name),a=!0;break}if(a)continue;let o=r.match(/^([a-z]+?)(\d+):(.+)$/);if(o&&C[o[1]]){let t=b(o[3]);t&&T.push({el:e,level:+o[2],css:t,media:i,pseudo:C[o[1]]}),e.removeAttribute(n.name);continue}let s=b(r);if(s){if(i){let t=`_t${x++}`;e.classList.add(t),S.push(E(i,`.${t}{${s.split(`;`).map(e=>e+`!important`).join(`;`)}}`))}else t.push(s);e.removeAttribute(n.name)}}t.length&&e.setAttribute(`style`,(e.getAttribute(`style`)||``)+t.join(`;`))}function O(t){e.innerHTML=String(t);let n={},r=document.createTreeWalker(e.content,NodeFilter.SHOW_ELEMENT),i;for(;i=r.nextNode();)D(i),i.hasAttribute(`ref`)&&(n[i.getAttribute(`ref`)]=i,i.removeAttribute(`ref`));for(let{el:e,level:t,css:n,media:r,pseudo:i}of T){let a=e;for(let e=0;e<t;e++)a=a?.parentElement??null;if(a&&a!==e){let t=`_t${x++}`,o=`_t${x++}`;a.classList.add(t),e.classList.add(o),S.push(E(r,`.${t}:${i} .${o}{${n.split(`;`).map(e=>e+`!important`).join(`;`)}}`))}}if(T.length=0,document.body.appendChild(e.content),S.length){let e=document.querySelector(`style[data-t]`)||(()=>{let e=document.createElement(`style`);return e.setAttribute(`data-t`,``),document.head.appendChild(e)})();e.textContent+=S.join(``),S.length=0}return n}export{O as t};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["const T = document.createElement('template');\n\nconst A: Record<string, string> = {\n m: 'margin', p: 'padding', t: 'top', r: 'right', l: 'left', b: 'bottom',\n x: '$l:$r', y: '$t:$b', w: 'width', h: 'height', min: 'min', max: 'max',\n P: 'position', D: 'display', fd: 'flexDirection', C: 'center',\n bg: 'background', cl: 'color', tn: 'transition',\n tx: 'translateX', ty: 'translateY', tr: 'rotate', ts: 'scale',\n fs: 'fontSize', fw: 'fontWeight', lh: 'lineHeight', ls: 'letterSpacing', ta: 'textAlign',\n bd: 'border', rounded: 'borderRadius', shadow: 'boxShadow',\n opacity: 'opacity', z: 'zIndex', overflow: 'overflow',\n gap: 'gap', justify: 'justifyContent', items: 'alignItems',\n ml: '$m$l', mr: '$m$r', mt: '$m$t', mb: '$m$b',\n mx: '$m$l:$m$r', my: '$m$t:$m$b',\n pl: '$p$l', pr: '$p$r', pt: '$p$t', pb: '$p$b',\n px: '$p$l:$p$r', py: '$p$t:$p$b',\n minw: '$min$w', minh: '$min$h', maxw: '$max$w', maxh: '$max$h',\n ba: '$bd', bt: '$bd$t', br: '$bd$r', bb: '$bd$b', bl: '$bd$l',\n bc: 'borderColor', bct: 'borderTopColor', bcr: 'borderRightColor', bcb: 'borderBottomColor', bcl: 'borderLeftColor',\n};\n\nconst exact: Record<string, string> = {\n absolute: '$P:absolute', a: '$P:absolute',\n relative: '$P:relative', r: '$P:relative',\n fixed: '$P:fixed', f: '$P:fixed', sticky: '$P:sticky',\n flex: '$D:flex', c: '$D:flex;$justify:$C;$items:$C',\n h: '$D:flex;$fd:row', v: '$D:flex;$fd:column',\n tac: '$ta:center', tar: '$ta:right', tal: '$ta:left',\n ba: '$bd',\n};\n\nconst colors = new Set(['transparent','currentcolor','inherit','initial','unset','red','blue','green','white','black','yellow','orange','purple','pink','teal','cyan','magenta','lime','maroon','navy','olive','gray','grey','silver','gold','coral','salmon','tomato','crimson','indigo','violet','turquoise','plum','orchid','khaki','lavender','ivory','beige','tan','wheat','peru','sienna','chocolate','firebrick','darkred','lightgreen','darkgreen','lightblue','darkblue','darkcyan','darkmagenta','darkviolet','darkorange','darkgoldenrod','darkslategray','darkolivegreen','mediumseagreen','mediumturquoise','mediumslateblue','mediumorchid','mediumpurple','hotpink','deeppink','palevioletred','lightsalmon','lightcoral','skyblue','lightskyblue','steelblue','dodgerblue','cornflowerblue','royalblue','slateblue','mediumblue','midnightblue','aquamarine','chartreuse','springgreen','forestgreen','limegreen','lawngreen','darkseagreen','palegreen','lightyellow','lemonchiffon','paleturquoise','powderblue','lightsteelblue','aliceblue','ghostwhite','snow','floralwhite','oldlace','linen','antiquewhite','mintcream','mistyrose','peachpuff','navajowhite','burlywood','sandybrown','darksalmon','rosybrown','darkkhaki','palegoldenrod','cadetblue','lightcyan','azure','honeydew','thistle','gainsboro','whitesmoke','darkgray','dimgray','lightslategray','slategray']);\nconst keywords = new Set(['bold','bolder','lighter','normal','italic','oblique','thin','hairline','semibold','extrabold','ultrabold','medium','regular','small','xxsmall','xsmall','large','xlarge','xxlarge','smaller','larger','normal','collapse','hidden','visible','scroll','auto','block','inline','inlineblock','inlineflex','grid','inlinegrid','none','contents','unset','inherit','initial','solid','dashed','dotted','double','groove','ridge','inset','outset','cover','contain','fill','stroke','running','paused','forwards','backwards','both','ease','linear','easein','easeout','easeinout','stepstart','stepend','nowrap','pre','prewrap','preline','breakspace','uppercase','lowercase','capitalize','center','justify','start','end','stretch','baseline','sub','super','overline','through','pointer','default','notallowed','text','wait','help','progress','snapstart','snapend','snapcenter','snearest','mandatory','smooth','noerase','erase','vertical','horizontal','row','column','rowreverse','columnreverse','wrap','wrapreverse']);\nconst unitless = new Set(['z', 'opacity', 'zIndex']);\nconst ms = new Set(['tn', 'transition']);\nconst transforms = new Set(['tx', 'ty', 'translateX', 'translateY', 'tr', 'ts', 'rotate', 'scale']);\nconst solidSuffix = new Set(['ba', 'bt', 'br', 'bb', 'bl', 'border', 'borderTop', 'borderRight', 'borderBottom', 'borderLeft']);\nconst deg = new Set(['tr', 'rotate']);\nconst unitlessVal = new Set(['ts', 'scale']);\nconst BP: Record<string, number> = { sm: 640, md: 768, lg: 1024, xl: 1280, '2xl': 1536 };\nconst BPS = Object.keys(BP).sort((a, b) => b.length - a.length);\nconst AP = Object.keys(A).sort((a, b) => b.length - a.length);\n\nfunction resolve(s: string): string {\n while (s.includes('$')) {\n let r = '', i = 0;\n while (i < s.length) {\n if (s[i] === '$') {\n const m = s.slice(i + 1).match(/^[a-zA-Z]+/);\n if (m) {\n const v = A[m[0]] ?? m[0];\n r += r && /[a-zA-Z]$/.test(r) ? v[0].toUpperCase() + v.slice(1) : v;\n i += 1 + m[0].length;\n continue;\n }\n }\n r += s[i++];\n }\n s = r;\n }\n return s;\n}\n\nconst kebab = (s: string) => s.replace(/([A-Z])/g, '-$1').toLowerCase();\n\nconst toCSS = (v: string) => v.split(';').map(p => { const i = p.indexOf(':'); return i > -1 ? `${kebab(p.slice(0, i))}:${p.slice(i + 1)}` : kebab(p); }).join(';');\n\nfunction parseVal(raw: string, prop: string): string {\n if (/^-?\\d+$/.test(raw)) return unitless.has(prop) || unitlessVal.has(prop) ? raw : ms.has(prop) ? `${raw}ms` : deg.has(prop) ? `${raw}deg` : `${raw}px`;\n if (/^-?\\d+p$/.test(raw)) return `${raw.slice(0, -1)}%`;\n return raw;\n}\n\nconst hex = /^#([0-9a-f]{3,8})$/i;\nconst fn = /^(rgba?|hsla?|oklch|color|linear-gradient|radial-gradient|conic-gradient|repeating-linear-gradient|repeating-radial-gradient)\\(.+\\)$/i;\n\nfunction parse(attr: string): string {\n if (exact[attr]) return toCSS(resolve(exact[attr]));\n\n for (const p of AP) {\n if (!attr.startsWith(p) || p.length >= attr.length) continue;\n const raw = attr.slice(p.length);\n const val = parseVal(raw, p);\n if (/^\\d/.test(raw) || colors.has(raw.toLowerCase()) || keywords.has(raw.toLowerCase()) || hex.test(raw) || fn.test(raw) || raw[0] === '-' && /^\\d/.test(raw.slice(1))) {\n const resolved = resolve(A[p]);\n const props = resolved.includes(':') ? resolved.split(':') : [resolved];\n return props.map(k => transforms.has(k) ? `transform:${k}(${val})` : solidSuffix.has(p) && /^\\d/.test(raw) ? `${kebab(k)}:${val} solid` : `${kebab(k)}:${val}`).join(';');\n }\n }\n return '';\n}\n\nlet C = 0;\nconst R: string[] = [];\nconst pendingHoverTarget: { el: Element; level: number; css: string; media?: number }[] = [];\n\nfunction mediaWrap(m: number | undefined, css: string): string {\n return m ? `@media(min-width:${m}px){${css}}` : css;\n}\n\nfunction apply(el: Element) {\n const s: string[] = [];\n for (const a of Array.from(el.attributes)) {\n if (a.name === 'ref') continue;\n let attr = a.name;\n let media: number | undefined;\n for (const bp of BPS) {\n if (attr.startsWith(bp + ':')) { media = BP[bp]; attr = attr.slice(bp.length + 1); break; }\n }\n if (attr.startsWith('h:')) {\n const css = parse(attr.slice(2));\n if (css) {\n const cls = `_t${C++}`;\n el.classList.add(cls);\n R.push(mediaWrap(media, `.${cls}:hover{${css.split(';').map(p => p + '!important').join(';')}}`));\n }\n el.removeAttribute(a.name);\n continue;\n }\n const hm = attr.match(/^h(\\d+):(.+)$/);\n if (hm) {\n const css = parse(hm[2]);\n if (css) pendingHoverTarget.push({ el, level: +hm[1], css, media });\n el.removeAttribute(a.name);\n continue;\n }\n const css = parse(attr);\n if (css) {\n if (media) {\n const cls = `_t${C++}`;\n el.classList.add(cls);\n R.push(mediaWrap(media, `.${cls}{${css.split(';').map(p => p + '!important').join(';')}}`));\n } else {\n s.push(css);\n }\n el.removeAttribute(a.name);\n }\n }\n if (s.length) el.setAttribute('style', (el.getAttribute('style') || '') + s.join(';'));\n}\n\nexport function t(value: unknown) {\n T.innerHTML = String(value);\n const refs: Record<string, HTMLElement> = {};\n const w = document.createTreeWalker(T.content, NodeFilter.SHOW_ELEMENT);\n let n: HTMLElement | null;\n while ((n = w.nextNode() as HTMLElement | null)) {\n apply(n);\n if (n.hasAttribute('ref')) { refs[n.getAttribute('ref')!] = n; n.removeAttribute('ref'); }\n }\n for (const { el, level, css, media } of pendingHoverTarget) {\n let ancestor: HTMLElement | null = el as HTMLElement;\n for (let i = 0; i < level; i++) ancestor = ancestor?.parentElement ?? null;\n if (ancestor && ancestor !== el) {\n const tCls = `_t${C++}`;\n const hCls = `_t${C++}`;\n ancestor.classList.add(tCls);\n el.classList.add(hCls);\n R.push(mediaWrap(media, `.${tCls}:hover .${hCls}{${css.split(';').map(p => p + '!important').join(';')}}`));\n }\n }\n pendingHoverTarget.length = 0;\n document.body.appendChild(T.content);\n if (R.length) {\n const el = document.querySelector('style[data-t]') as HTMLStyleElement || (() => { const s = document.createElement('style'); s.setAttribute('data-t', ''); return document.head.appendChild(s); })();\n el.textContent += R.join('');\n R.length = 0;\n }\n return refs;\n}\n"],"mappings":"AAAA,MAAM,EAAI,SAAS,cAAc,UAAU,EAErC,EAA4B,CAChC,EAAG,SAAU,EAAG,UAAW,EAAG,MAAO,EAAG,QAAS,EAAG,OAAQ,EAAG,SAC/D,EAAG,QAAS,EAAG,QAAS,EAAG,QAAS,EAAG,SAAU,IAAK,MAAO,IAAK,MAClE,EAAG,WAAY,EAAG,UAAW,GAAI,gBAAiB,EAAG,SACrD,GAAI,aAAc,GAAI,QAAS,GAAI,aACnC,GAAI,aAAc,GAAI,aAAc,GAAI,SAAU,GAAI,QACtD,GAAI,WAAY,GAAI,aAAc,GAAI,aAAc,GAAI,gBAAiB,GAAI,YAC7E,GAAI,SAAU,QAAS,eAAgB,OAAQ,YAC/C,QAAS,UAAW,EAAG,SAAU,SAAU,WAC3C,IAAK,MAAO,QAAS,iBAAkB,MAAO,aAC9C,GAAI,OAAQ,GAAI,OAAQ,GAAI,OAAQ,GAAI,OACxC,GAAI,YAAa,GAAI,YACrB,GAAI,OAAQ,GAAI,OAAQ,GAA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AAK,IAAI,EAAI,EAAG,EAAI,EAAO,IAAK,EAAW,GAAU,eAAiB,KACtE,GAAI,GAAY,IAAa,EAAI,CAC/B,IAAM,EAAO,KAAK,MACZ,EAAO,KAAK,MAClB,EAAS,UAAU,IAAI,CAAI,EAC3B,EAAG,UAAU,IAAI,CAAI,EACrB,EAAE,KAAK,EAAU,EAAO,IAAI,EAAK,UAAU,EAAK,GAAG,EAAI,MAAM,GAAG,CAAC,CAAC,IAAI,GAAK,EAAI,YAAY,CAAC,CAAC,KAAK,GAAG,EAAE,EAAE,CAAC,CAC5G,CACF,CAGA,GAFA,EAAmB,OAAS,EAC5B,SAAS,KAAK,YAAY,EAAE,OAAO,EAC/B,EAAE,OAAQ,CACZ,IAAM,EAAK,SAAS,cAAc,eAAe,QAAgC,CAAE,IAAM,EAAI,SAAS,cAAc,OAAO,EAAiC,OAA9B,EAAE,aAAa,SAAU,EAAE,EAAU,SAAS,KAAK,YAAY,CAAC,CAAG,EAAA,CAAG,EACpM,EAAG,aAAe,EAAE,KAAK,EAAE,EAC3B,EAAE,OAAS,CACb,CACA,OAAO,CACT"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["const T = document.createElement('template');\n\nconst A: Record<string, string> = {\n m: 'margin', p: 'padding', t: 'top', r: 'right', l: 'left', b: 'bottom',\n x: '$l:$r', y: '$t:$b', w: 'width', h: 'height', min: 'min', max: 'max',\n P: 'position', D: 'display', fd: 'flexDirection', C: 'center',\n bg: 'background', cl: 'color', tn: 'transition',\n tx: 'translateX', ty: 'translateY', tr: 'rotate', ts: 'scale',\n fs: 'fontSize', fw: 'fontWeight', lh: 'lineHeight', ls: 'letterSpacing', ta: 'textAlign',\n bd: 'border', rounded: 'borderRadius', shadow: 'boxShadow',\n opacity: 'opacity', z: 'zIndex', overflow: 'overflow',\n gap: 'gap', justify: 'justifyContent', items: 'alignItems',\n ml: '$m$l', mr: '$m$r', mt: '$m$t', mb: '$m$b',\n mx: '$m$l:$m$r', my: '$m$t:$m$b',\n pl: '$p$l', pr: '$p$r', pt: '$p$t', pb: '$p$b',\n px: '$p$l:$p$r', py: '$p$t:$p$b',\n minw: '$min$w', minh: '$min$h', maxw: '$max$w', maxh: '$max$h',\n ba: '$bd', bt: '$bd$t', br: '$bd$r', bb: '$bd$b', bl: '$bd$l',\n bc: 'borderColor', bct: 'borderTopColor', bcr: 'borderRightColor', bcb: 'borderBottomColor', bcl: 'borderLeftColor',\n};\n\nconst exact: Record<string, string> = {\n absolute: '$P:absolute', a: '$P:absolute',\n relative: '$P:relative', r: '$P:relative',\n fixed: '$P:fixed', f: '$P:fixed', sticky: '$P:sticky',\n flex: '$D:flex', c: '$D:flex;$justify:$C;$items:$C',\n h: '$D:flex;$fd:row', v: '$D:flex;$fd:column',\n tac: '$ta:center', tar: '$ta:right', tal: '$ta:left',\n ba: '$bd',\n};\n\nconst colors = new Set(['transparent','currentcolor','inherit','initial','unset','red','blue','green','white','black','yellow','orange','purple','pink','teal','cyan','magenta','lime','maroon','navy','olive','gray','grey','silver','gold','coral','salmon','tomato','crimson','indigo','violet','turquoise','plum','orchid','khaki','lavender','ivory','beige','tan','wheat','peru','sienna','chocolate','firebrick','darkred','lightgreen','darkgreen','lightblue','darkblue','darkcyan','darkmagenta','darkviolet','darkorange','darkgoldenrod','darkslategray','darkolivegreen','mediumseagreen','mediumturquoise','mediumslateblue','mediumorchid','mediumpurple','hotpink','deeppink','palevioletred','lightsalmon','lightcoral','skyblue','lightskyblue','steelblue','dodgerblue','cornflowerblue','royalblue','slateblue','mediumblue','midnightblue','aquamarine','chartreuse','springgreen','forestgreen','limegreen','lawngreen','darkseagreen','palegreen','lightyellow','lemonchiffon','paleturquoise','powderblue','lightsteelblue','aliceblue','ghostwhite','snow','floralwhite','oldlace','linen','antiquewhite','mintcream','mistyrose','peachpuff','navajowhite','burlywood','sandybrown','darksalmon','rosybrown','darkkhaki','palegoldenrod','cadetblue','lightcyan','azure','honeydew','thistle','gainsboro','whitesmoke','darkgray','dimgray','lightslategray','slategray']);\nconst keywords = new Set(['bold','bolder','lighter','normal','italic','oblique','thin','hairline','semibold','extrabold','ultrabold','medium','regular','small','xxsmall','xsmall','large','xlarge','xxlarge','smaller','larger','normal','collapse','hidden','visible','scroll','auto','block','inline','inlineblock','inlineflex','grid','inlinegrid','none','contents','unset','inherit','initial','solid','dashed','dotted','double','groove','ridge','inset','outset','cover','contain','fill','stroke','running','paused','forwards','backwards','both','ease','linear','easein','easeout','easeinout','stepstart','stepend','nowrap','pre','prewrap','preline','breakspace','uppercase','lowercase','capitalize','center','justify','start','end','stretch','baseline','sub','super','overline','through','pointer','default','notallowed','text','wait','help','progress','snapstart','snapend','snapcenter','snearest','mandatory','smooth','noerase','erase','vertical','horizontal','row','column','rowreverse','columnreverse','wrap','wrapreverse','sm','md','lg','xl','2xl']);\nconst unitless = new Set(['z', 'opacity', 'zIndex']);\nconst ms = new Set(['tn', 'transition']);\nconst transforms = new Set(['tx', 'ty', 'translateX', 'translateY', 'tr', 'ts', 'rotate', 'scale']);\nconst solidSuffix = new Set(['ba', 'bt', 'br', 'bb', 'bl', 'border', 'borderTop', 'borderRight', 'borderBottom', 'borderLeft']);\nconst deg = new Set(['tr', 'rotate']);\nconst unitlessVal = new Set(['ts', 'scale']);\nconst BP: Record<string, number> = { sm: 640, md: 768, lg: 1024, xl: 1280, '2xl': 1536 };\nconst BPS = Object.keys(BP).sort((a, b) => b.length - a.length);\nconst AP = Object.keys(A).sort((a, b) => b.length - a.length);\n\nfunction resolve(s: string): string {\n while (s.includes('$')) {\n let r = '', i = 0;\n while (i < s.length) {\n if (s[i] === '$') {\n const m = s.slice(i + 1).match(/^[a-zA-Z]+/);\n if (m) {\n const v = A[m[0]] ?? m[0];\n r += r && /[a-zA-Z]$/.test(r) ? v[0].toUpperCase() + v.slice(1) : v;\n i += 1 + m[0].length;\n continue;\n }\n }\n r += s[i++];\n }\n s = r;\n }\n return s;\n}\n\nconst kebab = (s: string) => s.replace(/([A-Z])/g, '-$1').toLowerCase();\n\nconst toCSS = (v: string) => v.split(';').map(p => { const i = p.indexOf(':'); return i > -1 ? `${kebab(p.slice(0, i))}:${p.slice(i + 1)}` : kebab(p); }).join(';');\n\nfunction parseVal(raw: string, prop: string): string {\n if (/^-?\\d+$/.test(raw)) return unitless.has(prop) || unitlessVal.has(prop) ? raw : ms.has(prop) ? `${raw}ms` : deg.has(prop) ? `${raw}deg` : `${raw}px`;\n if (/^-?\\d+p$/.test(raw)) return `${raw.slice(0, -1)}%`;\n return raw;\n}\n\nconst hex = /^#([0-9a-f]{3,8})$/i;\nconst fn = /^(rgba?|hsla?|oklch|color|linear-gradient|radial-gradient|conic-gradient|repeating-linear-gradient|repeating-radial-gradient)\\(.+\\)$/i;\n\nfunction parse(attr: string): string {\n if (exact[attr]) return toCSS(resolve(exact[attr]));\n\n for (const p of AP) {\n if (!attr.startsWith(p) || p.length >= attr.length) continue;\n const raw = attr.slice(p.length);\n const val = parseVal(raw, p);\n if (/^\\d/.test(raw) || colors.has(raw.toLowerCase()) || keywords.has(raw.toLowerCase()) || hex.test(raw) || fn.test(raw) || raw[0] === '-' && /^\\d/.test(raw.slice(1))) {\n const resolved = resolve(A[p]);\n const props = resolved.includes(':') ? resolved.split(':') : [resolved];\n return props.map(k => transforms.has(k) ? `transform:${k}(${val})` : solidSuffix.has(p) && /^\\d/.test(raw) ? `${kebab(k)}:${val} solid` : `${kebab(k)}:${val}`).join(';');\n }\n }\n return '';\n}\n\nlet C = 0;\nconst R: string[] = [];\nconst pseudo: Record<string, string> = { h: 'hover', a: 'active', f: 'focus', fw: 'focus-within', fv: 'focus-visible', d: 'disabled', ch: 'checked', v: 'visited', ln: 'link' };\nconst PS = Object.keys(pseudo).sort((a, b) => b.length - a.length);\nconst pendingTarget: { el: Element; level: number; css: string; media?: number; pseudo: string }[] = [];\n\nfunction mediaWrap(m: number | undefined, css: string): string {\n return m ? `@media(min-width:${m}px){${css}}` : css;\n}\n\nfunction apply(el: Element) {\n const s: string[] = [];\n for (const a of Array.from(el.attributes)) {\n if (a.name === 'ref') continue;\n let attr = a.name;\n let media: number | undefined;\n for (const bp of BPS) {\n if (attr.startsWith(bp + ':')) { media = BP[bp]; attr = attr.slice(bp.length + 1); break; }\n }\n let matched = false;\n for (const p of PS) {\n if (!attr.startsWith(p + ':') || attr.length <= p.length + 1) continue;\n const sel = attr.slice(p.length + 1);\n if (!sel) continue;\n const css = parse(sel);\n if (css) {\n const cls = `_t${C++}`;\n el.classList.add(cls);\n R.push(mediaWrap(media, `.${cls}:${pseudo[p]}{${css.split(';').map(p => p + '!important').join(';')}}`));\n }\n el.removeAttribute(a.name);\n matched = true;\n break;\n }\n if (matched) continue;\n const hm = attr.match(/^([a-z]+?)(\\d+):(.+)$/);\n if (hm && pseudo[hm[1]]) {\n const css = parse(hm[3]);\n if (css) pendingTarget.push({ el, level: +hm[2], css, media, pseudo: pseudo[hm[1]] });\n el.removeAttribute(a.name);\n continue;\n }\n const css = parse(attr);\n if (css) {\n if (media) {\n const cls = `_t${C++}`;\n el.classList.add(cls);\n R.push(mediaWrap(media, `.${cls}{${css.split(';').map(p => p + '!important').join(';')}}`));\n } else {\n s.push(css);\n }\n el.removeAttribute(a.name);\n }\n }\n if (s.length) el.setAttribute('style', (el.getAttribute('style') || '') + s.join(';'));\n}\n\nexport function t(value: unknown) {\n T.innerHTML = String(value);\n const refs: Record<string, HTMLElement> = {};\n const w = document.createTreeWalker(T.content, NodeFilter.SHOW_ELEMENT);\n let n: HTMLElement | null;\n while ((n = w.nextNode() as HTMLElement | null)) {\n apply(n);\n if (n.hasAttribute('ref')) { refs[n.getAttribute('ref')!] = n; n.removeAttribute('ref'); }\n }\n for (const { el, level, css, media, pseudo: ps } of pendingTarget) {\n let ancestor: HTMLElement | null = el as HTMLElement;\n for (let i = 0; i < level; i++) ancestor = ancestor?.parentElement ?? null;\n if (ancestor && ancestor !== el) {\n const tCls = `_t${C++}`;\n const hCls = `_t${C++}`;\n ancestor.classList.add(tCls);\n el.classList.add(hCls);\n R.push(mediaWrap(media, `.${tCls}:${ps} .${hCls}{${css.split(';').map(p => p + '!important').join(';')}}`));\n }\n }\n pendingTarget.length = 0;\n document.body.appendChild(T.content);\n if (R.length) {\n const el = document.querySelector('style[data-t]') as HTMLStyleElement || (() => { const s = document.createElement('style'); s.setAttribute('data-t', ''); return document.head.appendChild(s); })();\n el.textContent += R.join('');\n R.length = 0;\n }\n return refs;\n}\n"],"mappings":"AAAA,MAAM,EAAI,SAAS,cAAc,UAAU,EAErC,EAA4B,CAChC,EAAG,SAAU,EAAG,UAAW,EAAG,MAAO,EAAG,QAAS,EAAG,OAAQ,EAAG,SAC/D,EAAG,QAAS,EAAG,QAAS,EAAG,QAAS,EAAG,SAAU,IAAK,MAAO,IAAK,MAClE,EAAG,WAAY,EAAG,UAAW,GAAI,gBAAiB,EAAG,SACrD,GAAI,aAAc,GAAI,QAAS,GAAI,aACnC,GAAI,aAAc,GAAI,aAAc,GAAI,SAAU,GAAI,QACtD,GAAI,WAAY,GAAI,aAAc,GAAI,aAAc,GAAI,gBAAiB,GAAI,YAC7E,GAAI,SAAU,QAAS,eAAgB,OAAQ,YAC/C,QAAS,UAAW,EAAG,SAAU,SAAU,WAC3C,IAAK,MAAO,QAAS,iBAAkB,MAAO,aAC9C,GAAI,OAAQ,GAAI,OAAQ,GAAI,OAAQ,GAAI,OACxC,GAAI,YAAa,GAAI,YACrB,GAAI,OAAQ,GAAI,OAAQ,GAAI,OAAQ,GAAI,OACxC,GAAI,YAAa,GAAI,YACrB,KAAM,SAAU,KAAM,SAAU,KAAM,SAAU,KAAM,SACtD,GAAI,MAAO,GAAI,QAAS,GAAI,QAAS,GAAI,QAAS,GAAI,QACtD,GAAI,cAAe,IAAK,iBAAkB,IAAK,mBAAoB,IAAK,oBAAqB,IAAK,iBACpG,EAEM,EAAgC,CACpC,SAAU,cAAe,EAAG,cAC5B,SAAU,cAAe,EAAG,cAC5B,MAAO,WAAY,EAAG,WAAY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