@styleframe/transpiler 3.3.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/dist/constants.d.ts +4 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/consume/css/at-rule.d.ts +8 -0
- package/dist/consume/css/at-rule.d.ts.map +1 -0
- package/dist/consume/css/at-rule.test.d.ts +2 -0
- package/dist/consume/css/at-rule.test.d.ts.map +1 -0
- package/dist/consume/css/consume.d.ts +7 -0
- package/dist/consume/css/consume.d.ts.map +1 -0
- package/dist/consume/css/consume.test.d.ts +2 -0
- package/dist/consume/css/consume.test.d.ts.map +1 -0
- package/dist/consume/css/container.d.ts +11 -0
- package/dist/consume/css/container.d.ts.map +1 -0
- package/dist/consume/css/container.test.d.ts +2 -0
- package/dist/consume/css/container.test.d.ts.map +1 -0
- package/dist/consume/css/css.d.ts +7 -0
- package/dist/consume/css/css.d.ts.map +1 -0
- package/dist/consume/css/css.test.d.ts +2 -0
- package/dist/consume/css/css.test.d.ts.map +1 -0
- package/dist/consume/css/declarations.d.ts +7 -0
- package/dist/consume/css/declarations.d.ts.map +1 -0
- package/dist/consume/css/declarations.test.d.ts +2 -0
- package/dist/consume/css/declarations.test.d.ts.map +1 -0
- package/dist/consume/css/index.d.ts +13 -0
- package/dist/consume/css/index.d.ts.map +1 -0
- package/dist/consume/css/primitive.d.ts +7 -0
- package/dist/consume/css/primitive.d.ts.map +1 -0
- package/dist/consume/css/primitive.test.d.ts +2 -0
- package/dist/consume/css/primitive.test.d.ts.map +1 -0
- package/dist/consume/css/ref.d.ts +7 -0
- package/dist/consume/css/ref.d.ts.map +1 -0
- package/dist/consume/css/ref.test.d.ts +2 -0
- package/dist/consume/css/ref.test.d.ts.map +1 -0
- package/dist/consume/css/root.d.ts +4 -0
- package/dist/consume/css/root.d.ts.map +1 -0
- package/dist/consume/css/root.test.d.ts +2 -0
- package/dist/consume/css/root.test.d.ts.map +1 -0
- package/dist/consume/css/selector.d.ts +7 -0
- package/dist/consume/css/selector.d.ts.map +1 -0
- package/dist/consume/css/selector.test.d.ts +2 -0
- package/dist/consume/css/selector.test.d.ts.map +1 -0
- package/dist/consume/css/theme.d.ts +4 -0
- package/dist/consume/css/theme.d.ts.map +1 -0
- package/dist/consume/css/theme.test.d.ts +2 -0
- package/dist/consume/css/theme.test.d.ts.map +1 -0
- package/dist/consume/css/utility.d.ts +7 -0
- package/dist/consume/css/utility.d.ts.map +1 -0
- package/dist/consume/css/utility.test.d.ts +2 -0
- package/dist/consume/css/utility.test.d.ts.map +1 -0
- package/dist/consume/css/variable.d.ts +4 -0
- package/dist/consume/css/variable.d.ts.map +1 -0
- package/dist/consume/css/variable.test.d.ts +2 -0
- package/dist/consume/css/variable.test.d.ts.map +1 -0
- package/dist/consume/dts/constants.d.ts +25 -0
- package/dist/consume/dts/constants.d.ts.map +1 -0
- package/dist/consume/dts/consume.d.ts +6 -0
- package/dist/consume/dts/consume.d.ts.map +1 -0
- package/dist/consume/dts/index.d.ts +7 -0
- package/dist/consume/dts/index.d.ts.map +1 -0
- package/dist/consume/dts/recipe.d.ts +8 -0
- package/dist/consume/dts/recipe.d.ts.map +1 -0
- package/dist/consume/dts/recipe.test.d.ts +2 -0
- package/dist/consume/dts/recipe.test.d.ts.map +1 -0
- package/dist/consume/dts/root.d.ts +4 -0
- package/dist/consume/dts/root.d.ts.map +1 -0
- package/dist/consume/dts/root.test.d.ts +2 -0
- package/dist/consume/dts/root.test.d.ts.map +1 -0
- package/dist/consume/dts/selector.d.ts +9 -0
- package/dist/consume/dts/selector.d.ts.map +1 -0
- package/dist/consume/dts/shims.d.ts +10 -0
- package/dist/consume/dts/shims.d.ts.map +1 -0
- package/dist/consume/dts/shims.test.d.ts +2 -0
- package/dist/consume/dts/shims.test.d.ts.map +1 -0
- package/dist/consume/ts/consume.d.ts +7 -0
- package/dist/consume/ts/consume.d.ts.map +1 -0
- package/dist/consume/ts/index.d.ts +4 -0
- package/dist/consume/ts/index.d.ts.map +1 -0
- package/dist/consume/ts/recipe.d.ts +8 -0
- package/dist/consume/ts/recipe.d.ts.map +1 -0
- package/dist/consume/ts/recipe.test.d.ts +2 -0
- package/dist/consume/ts/recipe.test.d.ts.map +1 -0
- package/dist/consume/ts/root.d.ts +4 -0
- package/dist/consume/ts/root.d.ts.map +1 -0
- package/dist/consume/ts/root.test.d.ts +2 -0
- package/dist/consume/ts/root.test.d.ts.map +1 -0
- package/dist/consume/ts/selector.d.ts +9 -0
- package/dist/consume/ts/selector.d.ts.map +1 -0
- package/dist/consume/ts/selector.test.d.ts +2 -0
- package/dist/consume/ts/selector.test.d.ts.map +1 -0
- package/dist/defaults.d.ts +5 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/defaults.test.d.ts +2 -0
- package/dist/defaults.test.d.ts.map +1 -0
- package/dist/generator/genAtRuleQuery.d.ts +2 -0
- package/dist/generator/genAtRuleQuery.d.ts.map +1 -0
- package/dist/generator/genAtRuleQuery.test.d.ts +2 -0
- package/dist/generator/genAtRuleQuery.test.d.ts.map +1 -0
- package/dist/generator/genDeclaration.d.ts +2 -0
- package/dist/generator/genDeclaration.d.ts.map +1 -0
- package/dist/generator/genDeclaration.test.d.ts +2 -0
- package/dist/generator/genDeclaration.test.d.ts.map +1 -0
- package/dist/generator/genDeclarationsBlock.d.ts +2 -0
- package/dist/generator/genDeclarationsBlock.d.ts.map +1 -0
- package/dist/generator/genDeclarationsBlock.test.d.ts +2 -0
- package/dist/generator/genDeclarationsBlock.test.d.ts.map +1 -0
- package/dist/generator/genDeclareVariable.d.ts +2 -0
- package/dist/generator/genDeclareVariable.d.ts.map +1 -0
- package/dist/generator/genDeclareVariable.test.d.ts +2 -0
- package/dist/generator/genDeclareVariable.test.d.ts.map +1 -0
- package/dist/generator/genInlineAtRule.d.ts +2 -0
- package/dist/generator/genInlineAtRule.d.ts.map +1 -0
- package/dist/generator/genInlineAtRule.test.d.ts +2 -0
- package/dist/generator/genInlineAtRule.test.d.ts.map +1 -0
- package/dist/generator/genReferenceVariable.d.ts +2 -0
- package/dist/generator/genReferenceVariable.d.ts.map +1 -0
- package/dist/generator/genReferenceVariable.test.d.ts +2 -0
- package/dist/generator/genReferenceVariable.test.d.ts.map +1 -0
- package/dist/generator/genSafePropertyName.d.ts +2 -0
- package/dist/generator/genSafePropertyName.d.ts.map +1 -0
- package/dist/generator/genSafePropertyName.test.d.ts +2 -0
- package/dist/generator/genSafePropertyName.test.d.ts.map +1 -0
- package/dist/generator/genSafeVariableName.d.ts +10 -0
- package/dist/generator/genSafeVariableName.d.ts.map +1 -0
- package/dist/generator/genSafeVariableName.test.d.ts +2 -0
- package/dist/generator/genSafeVariableName.test.d.ts.map +1 -0
- package/dist/generator/genSelector.d.ts +2 -0
- package/dist/generator/genSelector.d.ts.map +1 -0
- package/dist/generator/genSelector.test.d.ts +2 -0
- package/dist/generator/genSelector.test.d.ts.map +1 -0
- package/dist/generator/index.d.ts +10 -0
- package/dist/generator/index.d.ts.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/license.d.ts +3 -0
- package/dist/license.d.ts.map +1 -0
- package/dist/minify/defaults.d.ts +3 -0
- package/dist/minify/defaults.d.ts.map +1 -0
- package/dist/minify/generate-map.d.ts +8 -0
- package/dist/minify/generate-map.d.ts.map +1 -0
- package/dist/minify/generate-map.test.d.ts +2 -0
- package/dist/minify/generate-map.test.d.ts.map +1 -0
- package/dist/minify/index.d.ts +5 -0
- package/dist/minify/index.d.ts.map +1 -0
- package/dist/minify/shorten.d.ts +4 -0
- package/dist/minify/shorten.d.ts.map +1 -0
- package/dist/minify/shorten.test.d.ts +2 -0
- package/dist/minify/shorten.test.d.ts.map +1 -0
- package/dist/transpile.d.ts +5 -0
- package/dist/transpile.d.ts.map +1 -0
- package/dist/transpile.test.d.ts +2 -0
- package/dist/transpile.test.d.ts.map +1 -0
- package/dist/transpiler.js +775 -664
- package/dist/transpiler.umd.cjs +23 -21
- package/dist/types.d.ts +31 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils.d.ts +7 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +10 -13
- package/dist/transpiler.d.ts +0 -72
package/dist/transpiler.umd.cjs
CHANGED
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`).map(
|
|
3
|
-
`)}function
|
|
4
|
-
|
|
5
|
-
`).join("")}}`}function q(e){return`--${(e.startsWith("--")?e.slice(2):e).replace(/[^a-zA-Z0-9_\-\u0080-\uFFFF]/g,"-")||"unknown-variable"}`}function ye(e,t){return K(q(e),t)}function he(e,t){return`var(${q(e)}${t?`, ${t}`:""})`}function z(e,t){return`${e} ${de(t)}`}function be(e){return function(r,o){return Object.entries(r).map(([n,i])=>K(n,e(i,o)))}}function H(e){return function(r,o){const i=(o.variables?.name??O)({name:r.name});return ye(i,e(r.value,o))}}function v(e){const t=H(e),r=be(e);return function(n,i,s){const{variables:a,declarations:c,children:u}=i,f=n===":root",l=(a??[]).map(d=>t(d,s)),m=r(c??{},s),h=(u??[]).map(d=>e(d,s)),y=l.length>0,g=m.length>0,N=h.length>0;return f?`${y||g?z(n,[...l,...y&&g?[""]:[],...m]):""}${N&&(y||g)?`
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.transpiler={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=` `,n=[`charset`,`import`,`namespace`],r=[`layer`];function i(e){return typeof e==`object`&&!!e}function a(e,t){return i(e)&&`type`in e&&e.type===t}function o(e){return a(e,`variable`)}function s(e){return a(e,`reference`)}function c(e){return a(e,`selector`)}function l(e){return a(e,`at-rule`)}function u(e){return a(e,`utility`)}function d(e){return a(e,`css`)}function f(e){return a(e,`theme`)}function p(e){return a(e,`root`)}function m(e){return a(e,`recipe`)}function h(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)&4294967295;return(t>>>0).toString(16).padStart(7,`0`).slice(0,7)}var g=({name:e,value:t,modifiers:n})=>`_${[...n,e,...t===`default`?[]:[t]].filter(Boolean).join(`:`)}`;function _(e){return e.charAt(0).toUpperCase()+e.slice(1)}function v(e){return`.${e.replace(/[[\].#()%,:/]/g,`\\$&`)}`}function y(e){if(e instanceof Buffer)return Buffer.from(e);let t=e.constructor;return new t(e.buffer.slice(0),e.byteOffset,e.byteLength/e.BYTES_PER_ELEMENT||1)}function ee(e){if(e||={},e.circular)return te(e);let t=new Map;if(t.set(Date,e=>new Date(e)),t.set(Map,(e,t)=>new Map(r(Array.from(e),t))),t.set(Set,(e,t)=>new Set(r(Array.from(e),t))),e.constructorHandlers)for(let n of e.constructorHandlers)t.set(n[0],n[1]);let n;return e.proto?a:i;function r(e,r){let i=Object.keys(e),a=Array.from({length:i.length});for(let o=0;o<i.length;o++){let s=i[o],c=e[s];typeof c!=`object`||!c?a[s]=c:c.constructor!==Object&&(n=t.get(c.constructor))?a[s]=n(c,r):ArrayBuffer.isView(c)?a[s]=y(c):a[s]=r(c)}return a}function i(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return r(e,i);if(e.constructor!==Object&&(n=t.get(e.constructor)))return n(e,i);let a={};for(let r in e){if(Object.hasOwnProperty.call(e,r)===!1)continue;let o=e[r];typeof o!=`object`||!o?a[r]=o:o.constructor!==Object&&(n=t.get(o.constructor))?a[r]=n(o,i):ArrayBuffer.isView(o)?a[r]=y(o):a[r]=i(o)}return a}function a(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return r(e,a);if(e.constructor!==Object&&(n=t.get(e.constructor)))return n(e,a);let i={};for(let r in e){let o=e[r];typeof o!=`object`||!o?i[r]=o:o.constructor!==Object&&(n=t.get(o.constructor))?i[r]=n(o,a):ArrayBuffer.isView(o)?i[r]=y(o):i[r]=a(o)}return i}}function te(e){let t=[],n=[],r=new Map;if(r.set(Date,e=>new Date(e)),r.set(Map,(e,t)=>new Map(a(Array.from(e),t))),r.set(Set,(e,t)=>new Set(a(Array.from(e),t))),e.constructorHandlers)for(let t of e.constructorHandlers)r.set(t[0],t[1]);let i;return e.proto?s:o;function a(e,a){let o=Object.keys(e),s=Array.from({length:o.length});for(let c=0;c<o.length;c++){let l=o[c],u=e[l];if(typeof u!=`object`||!u)s[l]=u;else if(u.constructor!==Object&&(i=r.get(u.constructor)))s[l]=i(u,a);else if(ArrayBuffer.isView(u))s[l]=y(u);else{let e=t.indexOf(u);e===-1?s[l]=a(u):s[l]=n[e]}}return s}function o(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return a(e,o);if(e.constructor!==Object&&(i=r.get(e.constructor)))return i(e,o);let s={};t.push(e),n.push(s);for(let a in e){if(Object.hasOwnProperty.call(e,a)===!1)continue;let c=e[a];if(typeof c!=`object`||!c)s[a]=c;else if(c.constructor!==Object&&(i=r.get(c.constructor)))s[a]=i(c,o);else if(ArrayBuffer.isView(c))s[a]=y(c);else{let e=t.indexOf(c);e===-1?s[a]=o(c):s[a]=n[e]}}return t.pop(),n.pop(),s}function s(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return a(e,s);if(e.constructor!==Object&&(i=r.get(e.constructor)))return i(e,s);let o={};t.push(e),n.push(o);for(let a in e){let c=e[a];if(typeof c!=`object`||!c)o[a]=c;else if(c.constructor!==Object&&(i=r.get(c.constructor)))o[a]=i(c,s);else if(ArrayBuffer.isView(c))o[a]=y(c);else{let e=t.indexOf(c);e===-1?o[a]=s(c):o[a]=n[e]}}return t.pop(),n.pop(),o}}ee();function ne(e,t=8){let n=``;for(let e=0;e<t;e++){let e=Math.floor(Math.random()*62);n+=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`[e]}return e?`${e}${n}`:n}var b=({name:e})=>`.${e}-theme, [data-theme="${e}"]`,x=({name:e})=>e.replace(/^\.+|\.+$/g,``).replace(/\.+/g,`--`);function re(e,t){return`@${e}${t?` `:``}${t}`}var ie=/\d/,ae=[`-`,`_`,`/`,`.`];function oe(e=``){if(!ie.test(e))return e!==e.toLowerCase()}function S(e,t){let n=t??ae,r=[];if(!e||typeof e!=`string`)return r;let i=``,a,o;for(let t of e){let e=n.includes(t);if(e===!0){r.push(i),i=``,a=void 0;continue}let s=oe(t);if(o===!1){if(a===!1&&s===!0){r.push(i),i=t,a=s;continue}if(a===!0&&s===!1&&i.length>1){let e=i.at(-1);r.push(i.slice(0,Math.max(0,i.length-1))),i=e+t,a=s;continue}}i+=t,a=s,o=e}return r.push(i),r}function se(e){return e?e[0].toUpperCase()+e.slice(1):``}function C(e){return e?e[0].toLowerCase()+e.slice(1):``}function w(e,t){return e?(Array.isArray(e)?e:S(e)).map(e=>se(t?.normalize?e.toLowerCase():e)).join(``):``}function ce(e,t){return C(w(e||``,t))}function le(e,t){return e?(Array.isArray(e)?e:S(e)).map(e=>e.toLowerCase()).join(t??`-`):``}function T(e){return` ${e}`}function E(e){return e.split(`
|
|
2
|
+
`).map(e=>T(e)).join(`
|
|
3
|
+
`)}function D(e){return e===e.toUpperCase()}function O(e){return ce(e)}function k(e){return le(e)}function ue(e){return k(e)}function A(e,t){return`${e.startsWith(`--`)?e:ue(e)}: ${t};`}function de(e){return`{${e.length>0?`
|
|
4
|
+
`:``}${e.map(e=>`${E(`${e}`)}\n`).join(``)}}`}function j(e){return`--${(e.startsWith(`--`)?e.slice(2):e).replace(/[^a-zA-Z0-9_\-\u0080-\uFFFF]/g,`-`)||`unknown-variable`}`}function fe(e,t){return A(j(e),t)}function pe(e,t){return`var(${j(e)}${t?`, ${t}`:``})`}function M(e,t){return`${e} ${de(t)}`}function me(e){return function(t,n){return Object.entries(t).map(([t,r])=>A(t,e(r,n)))}}function N(e){return function(t,n){return fe((n.variables?.name??x)({name:t.name}),e(t.value,n))}}function P(e){let t=N(e),n=me(e);return function(r,i,a){let{variables:o,declarations:s,children:c}=i,l=r===`:root`,u=(o??[]).map(e=>t(e,a)),d=n(s??{},a),f=(c??[]).map(t=>e(t,a)),p=u.length>0,m=d.length>0,h=f.length>0;return l?`${p||m?M(r,[...u,...p&&m?[``]:[],...d]):``}${h&&(p||m)?`
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
`:``}${f.join(`
|
|
8
7
|
|
|
9
|
-
`)}`:
|
|
8
|
+
`)}`:M(r,[...u,...p&&(h||m)?[``]:[],...d,...m&&h?[``]:[],...f.flatMap((e,t)=>t===f.length-1?[e]:[e,``])])}}function F(e){let t=P(e);return function(e,i){let a=n.includes(e.identifier),o=r.includes(e.identifier),s=Object.keys(e.declarations).length>0,c=e.variables.length>0,l=e.children.length>0,u=re(e.identifier,e.rule);return a||o&&!(s||c||l)?`${u};`:t(u,e,i)}}function I(e){return function(t,n){return t.value.map(t=>e(t,n)).join(``).trim()}}function L(e){return function(e,t){return e==null?``:`${e}`}}function R(e){return function(t,n){return pe((n.variables?.name??x)({name:t.name}),t.fallback?e(t.fallback,n):void 0)}}function z(e){let t=P(e);return function(n,r,i){let a=i?.treeshake??!1,o=i?.scanner??!1,s=n._usage.variables,c=e=>!a||s.has(e.name),l=e=>a?{...e,variables:e.variables.filter(c)}:e,u=a&&o,d=n._usage.utilities,f=e=>e.type!==`utility`||!u?!0:d.has(g({name:e.name,value:e.value,modifiers:e.modifiers})),p=l(n),m=u?{...p,children:p.children.filter(f)}:p;return n.themes.map(l).reduce((t,n)=>(t.push(e(n,r)),t),[t(`:root`,m,r)]).join(`
|
|
10
9
|
|
|
11
|
-
`)}}function
|
|
10
|
+
`)}}function he(e){let t=P(e);return function(e,n){return t(e.query,e,n)}}function ge(e){let t=P(e);return function(e,n){return t((n.themes?.selector??b)({name:e.name}),e,n)}}function _e(e){let t=P(e);return function(e,n){let r=[],i=v((n.utilities?.selector??g)({name:e.name,value:e.value,modifiers:e.modifiers}));return r.push(t(i,e,n)),r.join(`
|
|
12
11
|
|
|
13
|
-
`)}}function
|
|
12
|
+
`)}}function B(e,t,n){let r=z(B),i=he(B),a=_e(B),m=F(B),h=ge(B),g=N(B),_=R(B),v=I(B),y=L(B);switch(!0){case c(e):return i(e,t);case u(e):return a(e,t);case l(e):return m(e,t);case p(e):return r(e,t,n);case f(e):return h(e,t);case o(e):return g(e,t);case s(e):return _(e,t);case d(e):return v(e,t);default:return y(e,t)}}function ve(e){return function(e,t,n){let r=e._exportName;r||(r=O(e.name),e.name[0]&&D(e.name[0])&&(r=_(r)));let i=`${r}Recipe`,a=e._runtime??{},o=n?.shortMap?`, __shortMap`:``,s=`${_(r)}Props`;return`const ${i} = ${JSON.stringify(a,null,4)} as const satisfies RecipeRuntime;
|
|
14
13
|
|
|
15
|
-
export type ${
|
|
16
|
-
export const ${
|
|
17
|
-
`}}function
|
|
18
|
-
|
|
19
|
-
`)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
export type ${s} = RecipeVariantProps<typeof ${i}>;
|
|
15
|
+
export const ${r} = createRecipe("${e.name}", ${i}${o});
|
|
16
|
+
`}}function ye(e){return e.filter(e=>c(e)&&!!e._exportName)}function be(e){return function(t,n,r){let i=ye(t.children),a=t._usage?.recipes,o=a&&a.size>0?t.recipes.filter(e=>a.has(e.name)):t.recipes,s=o.length>0,c=i.length>0;if(!s&&!c)return``;let l=[];if(s){let t=[`import { createRecipe } from '@styleframe/runtime';`,`import type { RecipeRuntime, RecipeVariantProps } from '@styleframe/runtime';`];r?.shortMap&&t.push(`import type { ShorteningMap } from '@styleframe/runtime';`),l.push(`${t.join(`
|
|
17
|
+
`)}\n`),r?.shortMap&&l.push(`const __shortMap: ShorteningMap = ${JSON.stringify(r.shortMap)} as const;\n`),l.push(e(o,n,r))}return c&&l.push(e(i,n)),l.join(`
|
|
18
|
+
`)}}function xe(e){return function(e,t){return e._exportName?`export const ${e._exportName} = ${JSON.stringify(e.query)};
|
|
19
|
+
`:``}}function V(e,t,n){let r=be(V),i=ve(V),a=xe(V);switch(!0){case Array.isArray(e):return e.map(e=>V(e,t,n)).join(`
|
|
20
|
+
`);case p(e):return r(e,t,n);case m(e):return i(e,t,n);case c(e):return a(e,t);default:return``}}var H=`// Auto-generated by @styleframe/plugin - DO NOT EDIT`,U=`styleframe.d.ts`,W=`shims.d.ts`,Se=`virtual:styleframe`,Ce=`virtual:styleframe.css`;function we(e){let t=e?.variants;if(!t||Object.keys(t).length===0)return`Record<string, never>`;let n=[];for(let[e,r]of Object.entries(t)){if(!r)continue;let t=Object.keys(r);if(t.length>0){let r=t.map(e=>`"${e}"`).join(` | `),i=t.includes(`true`)&&t.includes(`false`)?`${r} | boolean`:r;n.push(`${e}?: ${i}`)}}return n.length===0?`Record<string, never>`:`{ ${n.join(`; `)} }`}function Te(e){return function(e,t){let n=e._exportName;n||(n=O(e.name),e.name[0]&&D(e.name[0])&&(n=_(n)));let r=we(e._runtime),i=`${_(n)}Props`;return`export type ${i} = ${r};
|
|
21
|
+
export const ${n}: (props?: ${i}) => string;`}}function Ee(e){return e.filter(e=>c(e)&&!!e._exportName)}function De(e){return function(t,n){let r=Ee(t.children),i=t._usage?.recipes,a=i&&i.size>0?t.recipes.filter(e=>i.has(e.name)):t.recipes,o=a.length>0,s=r.length>0,c=[H,`import type { Styleframe } from "@styleframe/core";`,``,`export function styleframe(): Styleframe;`];if(o){c.push(``);let t=a.map(t=>e(t,n)).filter(Boolean);c.push(...t)}if(s){c.push(``);let t=r.map(t=>e(t,n)).filter(Boolean);c.push(...t)}return c.push(``),c.join(`
|
|
22
|
+
`)}}function Oe(e){return function(e,t){return e._exportName?`export const ${e._exportName}: string;`:``}}function G(e,t){let n=De(G),r=Te(G),i=Oe(G);switch(!0){case Array.isArray(e):return e.map(e=>G(e,t)).join(`
|
|
23
|
+
`);case p(e):return n(e,t);case m(e):return r(e,t);case c(e):return i(e,t);default:return``}}function ke(e){let t=e.split(`
|
|
24
|
+
`).filter((e,t)=>!(t===0&&e===`// Auto-generated by @styleframe/plugin - DO NOT EDIT`)).map(e=>e.length>0?` ${e}`:e).join(`
|
|
25
|
+
`).replace(/\n+$/,``);return[`declare module "${Se}" {`,t,`}`].join(`
|
|
26
|
+
`)}function Ae(e){return`${[H,ke(e),``,`declare module "${Ce}" {`,` const css: string;`,` export default css;`,`}`].join(`
|
|
27
|
+
`)}\n`}var K={display:`d`,position:`pos`,overflow:`ov`,"overflow-x":`ovx`,"overflow-y":`ovy`,visibility:`vis`,"z-index":`z`,float:`fl`,clear:`cl`,margin:`m`,"margin-top":`mt`,"margin-right":`mr`,"margin-bottom":`mb`,"margin-left":`ml`,"margin-inline":`mx`,"margin-block":`my`,padding:`p`,"padding-top":`pt`,"padding-right":`pr`,"padding-bottom":`pb`,"padding-left":`pl`,"padding-inline":`px`,"padding-block":`py`,gap:`g`,width:`w`,"min-width":`miw`,"max-width":`maw`,height:`h`,"min-height":`mih`,"max-height":`mah`,color:`c`,"font-size":`fs`,"font-weight":`fw`,"font-family":`ff`,"font-style":`fst`,"line-height":`lh`,"letter-spacing":`ls`,"text-align":`ta`,"text-transform":`tt`,"text-decoration":`td`,"white-space":`ws`,background:`bg`,"background-color":`bgc`,"border-color":`bc`,"border-width":`bw`,"border-style":`bs`,"border-radius":`br`,"flex-direction":`fd`,"flex-wrap":`fwr`,"align-items":`ai`,"align-content":`ac`,"align-self":`as`,"justify-content":`jc`,"justify-items":`ji`,"justify-self":`js`,opacity:`op`,"box-shadow":`bsh`,cursor:`cur`,"pointer-events":`pe`,transition:`tr`,transform:`tf`,animation:`an`},q={hover:`h`,focus:`f`,active:`a`,disabled:`dis`,"focus-within":`fw`,"focus-visible":`fv`,first:`fi`,last:`la`,dark:`dk`};function J(e,t=0){let n=e.split(/[-.]/);return n.map((e,r)=>{let i=r===n.length-1?1+t:1;return e.slice(0,i)}).join(``)}function je(e,t=0){if(e.length<=2)return e;if(e.startsWith(`[`)){let t=`[${h(e.slice(1,-1))}]`;return t.length<e.length?t:e}if(e.startsWith(`#`)){let t=`[${h(e)}]`;return t.length<e.length?t:e}return e.includes(`-`)||e.includes(`.`)?J(e,t):e.slice(0,1+t)}function Y(e,t,n){let r=[...e].sort(),i={},a=new Set;if(n)for(let e of r){let t=n[e];t&&(i[e]=t,a.add(t))}for(let e of r){if(i[e])continue;let n=0,r=t(e,n);if(r!==e){for(;a.has(r);){n++;let i=t(e,n);if(i===r||i.length>=e.length)break;r=i}!a.has(r)&&r!==e&&(i[e]=r,a.add(r))}}return i}function X(e,t){let n=e.utilities.map(e=>e.name),r=e.modifiers.flatMap(e=>e.key),i=new Set;for(let t of e.utilities)for(let e of t.values)i.add(e.key);let a=t?.properties??K,o=t?.modifiers??q,s=t?.values;return{p:Y(n,J,a),v:Y([...i],je,s),m:Y(r,J,o)}}function Z(e,t){return{name:t.p[e.name]??e.name,value:e.value===`default`?e.value:t.v[e.value]??e.value,modifiers:e.modifiers.map(e=>t.m[e]??e)}}function Me(e,t,n=g){let r={},i=e=>{for(let i of e){if(i.type!==`utility`)continue;let e={name:i.name,value:i.value,modifiers:i.modifiers},a=n(e),o=n(Z(e,t));a!==o&&(r[a]=o)}};i(e.children);for(let t of e.themes)i(t.children);return r}var Ne=`-----BEGIN PUBLIC KEY-----
|
|
23
28
|
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs7zAFssgxOMPeo80iig4
|
|
24
29
|
qSSshgNOLnW1gd4tPUrsezndaUrAKlsAys6XD8kuF+bBEIR0uFNSgKlqINLjWM1n
|
|
25
30
|
BiTUzCctodyRaq6/tyFSoPLD35iblkwtfxKPM42lAJZsyTu9qoBr8MJyXmhDLuqA
|
|
@@ -27,7 +32,4 @@ dQ8di7mQHz+mCy96jQR4lFSDfHMgl27qaAh5VboTBRxgZliN8D5Fl590QkS94wAj
|
|
|
27
32
|
hC7NbH+hPcGc/qIaZSjZfyZeBIZS74qJkrzjEA7/pukROD8UQUrQ512HHZ6XlgMn
|
|
28
33
|
4bWT2K9CpWbbhsKFTecCHuxlmPkFJNMuvAb/LdP08BSnpntlyAJcQeBrna2qBen+
|
|
29
34
|
GwIDAQAB
|
|
30
|
-
-----END PUBLIC KEY-----`,Fe
|
|
31
|
-
export const ${n}: (props?: ${s}) => string;`}}function ke(e){return e.filter(t=>C(t)&&!!t._exportName)}function xe(e){return function(r,o){const n=ke(r.children),i=r.recipes.length>0,s=n.length>0,a=["// Auto-generated by @styleframe/plugin - DO NOT EDIT","",'declare module "virtual:styleframe" {',' import type { Styleframe } from "@styleframe/core";',""," /** Returns the global styleframe instance from styleframe.config.ts */"," export function styleframe(): Styleframe;"];if(i){a.push("");const c=r.recipes.map(u=>e(u,o)).filter(Boolean);a.push(...c)}if(s){a.push("");const c=n.map(u=>e(u,o)).filter(Boolean);a.push(...c)}return a.push("}"),a.push(""),a.push('declare module "virtual:styleframe.css" {'),a.push(" const css: string;"),a.push(" export default css;"),a.push("}"),a.push(""),a.join(`
|
|
32
|
-
`)}}function Me(e){return function(r,o){return r._exportName?` export const ${r._exportName}: string;`:""}}function B(e,t){const r=xe(B),o=Ie(),n=Me();switch(!0){case Array.isArray(e):return e.map(i=>B(i,t)).join(`
|
|
33
|
-
`);case _(e):return r(e,t);case P(e):return o(e,t);case C(e):return n(e,t);default:return""}}function Ve(e){const t=Math.floor(Math.random()*100);e.root.children.push({type:"selector",id:ne("sel-"),query:`html:nth-of-type(${t}n+1)::after`,variables:[],children:[],declarations:{content:'"Styleframe Pro: Development Mode – License required for production use"',zIndex:99999,position:"fixed",display:"block !important",opacity:"1 !important",bottom:0,left:0,background:"rgba(0, 0, 0, 0.5)",color:"white",fontSize:"12px",lineHeight:"1",padding:"0.5rem",fontFamily:"sans-serif"}})}function T(e,t=""){return{name:e,content:t}}async function Ke(e,{type:t="all",treeshake:r=!1,scanner:o=!1,consumers:n={css:b,ts:R,dts:B}}={}){const i={files:[]},s=e.options,a={treeshake:r,scanner:o};if(Le(e)){const c=await Ue(e);(!c.valid||c.instanceId!==e.id)&&Ve(e)}if(t==="all"||t==="css"){const c=T("index.css",n.css(e.root,s,a));i.files.push(c)}if(t==="all"||t==="ts"){const c=T("index.ts",n.ts(e.root,s));i.files.push(c)}if(t==="dts"){const c=T("index.d.ts",n.dts(e.root,s));i.files.push(c)}return i}p.DEFAULT_INDENT=" ",p.STATEMENT_AT_RULES=L,p.STATEMENT_OR_BLOCK_AT_RULES=U,p.addIndentToLine=x,p.consumeCSS=b,p.consumeTS=R,p.createFile=T,p.defaultThemeSelectorFn=I,p.defaultUtilitySelectorFn=E,p.defaultVariableNameFn=O,p.indentLines=M,p.isUppercase=F,p.toCamelCase=w,p.toKebabCase=V,p.transpile=Ke,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}));
|
|
35
|
+
-----END PUBLIC KEY-----`,Pe=`__licenseRequired`,Fe=`__licenseValidated`;async function Q(e){let t=e.replace(/-----BEGIN PUBLIC KEY-----/,``).replace(/-----END PUBLIC KEY-----/,``).replace(/\s/g,``),n=Uint8Array.from(atob(t),e=>e.charCodeAt(0));return await crypto.subtle.importKey(`spki`,n,{name:`RSASSA-PKCS1-v1_5`,hash:`SHA-256`},!0,[`verify`])}async function Ie({payload:e,signature:t}){let n=new TextEncoder().encode(e),r=Uint8Array.from(atob(t),e=>e.charCodeAt(0)),i=await Q(Ne);if(!await crypto.subtle.verify({name:`RSASSA-PKCS1-v1_5`},i,r,n))throw Error(`License validation failed: Invalid signature detected. The license may have been modified or corrupted.`);return JSON.parse(e)}function Le(e){return Object.prototype.hasOwnProperty.call(e,Pe)}async function Re(e){let t=Object.getOwnPropertyDescriptor(e,Fe);if(!t?.value)return{key:``,instanceId:``,environment:``,valid:!1};let n=t.value;if(typeof n!=`object`||!n||!(`payload`in n)||!(`signature`in n)||typeof n.payload!=`string`||typeof n.signature!=`string`)return{key:``,instanceId:``,environment:``,valid:!1};try{return await Ie(n)}catch{return{key:``,instanceId:``,environment:``,valid:!1}}}function ze(e){let t=Math.floor(Math.random()*100);e.root.children.push({type:`selector`,id:ne(`sel-`),query:`html:nth-of-type(${t}n+1)::after`,variables:[],children:[],declarations:{content:`"Styleframe Pro: Development Mode – License required for production use"`,zIndex:99999,position:`fixed`,display:`block !important`,opacity:`1 !important`,bottom:0,left:0,background:`rgba(0, 0, 0, 0.5)`,color:`white`,fontSize:`12px`,lineHeight:`1`,padding:`0.5rem`,fontFamily:`sans-serif`}})}function $(e,t=``){return{name:e,content:t}}async function Be(e,{type:t=`all`,treeshake:n=!1,scanner:r=!1,minify:i=!1,minifyOptions:a,consumers:o={css:B,ts:V,dts:G}}={}){let s={files:[]},c=e.options,l={treeshake:n,scanner:r};if(i&&(l.shortMap=X(e.root,a)),Le(e)){let t=await Re(e);(!t.valid||t.instanceId!==e.id)&&ze(e)}if(t===`all`||t===`css`){let t=Ve(c,l),n=$(`index.css`,o.css(e.root,t,l));s.files.push(n)}if(t===`all`||t===`ts`){let t=$(`index.ts`,o.ts(e.root,c,l));s.files.push(t)}if(t===`dts`){let t=o.dts(e.root,c);s.files.push($(U,t),$(W,Ae(t)))}return s}function Ve(e,t){if(!t.shortMap)return e;let n=e.utilities?.selector??g;return{...e,utilities:{...e.utilities,selector:e=>n(Z(e,t.shortMap))}}}e.DEFAULT_INDENT=t,e.DTS_SHIMS_FILENAME=W,e.DTS_TYPES_FILENAME=U,e.STATEMENT_AT_RULES=n,e.STATEMENT_OR_BLOCK_AT_RULES=r,e.addIndentToLine=T,e.buildClassNameLookup=Me,e.consumeCSS=B,e.consumeTS=V,e.createFile=$,e.defaultModifierShortNames=q,e.defaultPropertyShortNames=K,e.defaultThemeSelectorFn=b,e.defaultUtilitySelectorFn=g,e.defaultVariableNameFn=x,e.generateShorteningMap=X,e.indentLines=E,e.isUppercase=D,e.shortenUtilityOptions=Z,e.toCamelCase=O,e.toKebabCase=k,e.transpile=Be});
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ShorteningMap, StyleframeOptions } from '@styleframe/core';
|
|
2
|
+
export type OutputFile = {
|
|
3
|
+
name: string;
|
|
4
|
+
content: string;
|
|
5
|
+
};
|
|
6
|
+
export type Output = {
|
|
7
|
+
files: OutputFile[];
|
|
8
|
+
};
|
|
9
|
+
export type TranspileContext = {
|
|
10
|
+
treeshake?: boolean;
|
|
11
|
+
scanner?: boolean;
|
|
12
|
+
shortMap?: ShorteningMap;
|
|
13
|
+
};
|
|
14
|
+
export type ConsumeFunction = (instance: unknown, options: StyleframeOptions, context?: TranspileContext) => string;
|
|
15
|
+
export type TranspileOptions = {
|
|
16
|
+
type?: "css" | "ts" | "dts" | "all";
|
|
17
|
+
treeshake?: boolean;
|
|
18
|
+
scanner?: boolean;
|
|
19
|
+
minify?: boolean;
|
|
20
|
+
minifyOptions?: {
|
|
21
|
+
properties?: Record<string, string>;
|
|
22
|
+
values?: Record<string, string>;
|
|
23
|
+
modifiers?: Record<string, string>;
|
|
24
|
+
};
|
|
25
|
+
consumers?: {
|
|
26
|
+
css: ConsumeFunction;
|
|
27
|
+
ts: ConsumeFunction;
|
|
28
|
+
dts: ConsumeFunction;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEzE,MAAM,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE,UAAU,EAAE,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAC7B,QAAQ,EAAE,OAAO,EACjB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,CAAC,EAAE,gBAAgB,KACtB,MAAM,CAAC;AAEZ,MAAM,MAAM,gBAAgB,GAAG;IAC9B,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,CAAC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE;QACf,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACpC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACnC,CAAC;IACF,SAAS,CAAC,EAAE;QACX,GAAG,EAAE,eAAe,CAAC;QACrB,EAAE,EAAE,eAAe,CAAC;QACpB,GAAG,EAAE,eAAe,CAAC;KACrB,CAAC;CACF,CAAC"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { KebabCase, CamelCase } from 'scule';
|
|
2
|
+
export declare function addIndentToLine(line: string): string;
|
|
3
|
+
export declare function indentLines(lines: string): string;
|
|
4
|
+
export declare function isUppercase(char: string): boolean;
|
|
5
|
+
export declare function toCamelCase<S extends string>(str: S): CamelCase<S>;
|
|
6
|
+
export declare function toKebabCase<S extends string>(str: S): KebabCase<S>;
|
|
7
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAElE;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAElE"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@styleframe/transpiler",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"types": "./dist/
|
|
5
|
+
"types": "./dist/index.d.ts",
|
|
6
6
|
"module": "./dist/transpiler.js",
|
|
7
7
|
"main": "./dist/transpiler.umd.cjs",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"types": "./dist/
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
11
|
"import": "./dist/transpiler.js",
|
|
12
12
|
"require": "./dist/transpiler.umd.cjs"
|
|
13
13
|
}
|
|
@@ -22,19 +22,19 @@
|
|
|
22
22
|
"scule": "^1.3.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@styleframe/core": "^3.
|
|
25
|
+
"@styleframe/core": "^3.6.0",
|
|
26
26
|
"@styleframe/license": "^2.0.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@styleframe/config-typescript": "^3.0.0",
|
|
30
|
-
"@styleframe/config-vite": "^3.0.
|
|
31
|
-
"@styleframe/core": "^3.
|
|
30
|
+
"@styleframe/config-vite": "^3.0.1",
|
|
31
|
+
"@styleframe/core": "^3.6.0",
|
|
32
32
|
"@styleframe/license": "^2.0.2",
|
|
33
|
-
"@vitest/coverage-v8": "^
|
|
33
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
34
34
|
"typescript": "^5.8.3",
|
|
35
|
-
"vite": "^
|
|
36
|
-
"vite-plugin-dts": "^
|
|
37
|
-
"vitest": "^
|
|
35
|
+
"vite": "^8.0.14",
|
|
36
|
+
"vite-plugin-dts": "^5.0.1",
|
|
37
|
+
"vitest": "^4.1.7"
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://github.com/styleframe-dev/styleframe#readme",
|
|
40
40
|
"bugs": {
|
|
@@ -45,9 +45,6 @@
|
|
|
45
45
|
"url": "git+https://github.com/styleframe-dev/styleframe.git"
|
|
46
46
|
},
|
|
47
47
|
"author": "Alex Grozav <alex@styleframe.dev>",
|
|
48
|
-
"overrides": {
|
|
49
|
-
"vite": "npm:rolldown-vite@latest"
|
|
50
|
-
},
|
|
51
48
|
"scripts": {
|
|
52
49
|
"dev": "vite build --watch",
|
|
53
50
|
"build": "pnpm typecheck && vite build",
|
package/dist/transpiler.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { CamelCase } from 'scule';
|
|
2
|
-
import { defaultUtilitySelectorFn } from '@styleframe/core';
|
|
3
|
-
import { KebabCase } from 'scule';
|
|
4
|
-
import { Styleframe } from '@styleframe/core';
|
|
5
|
-
import { StyleframeOptions } from '@styleframe/core';
|
|
6
|
-
import { ThemeSelectorFn } from '@styleframe/core';
|
|
7
|
-
import { VariableNameFn } from '@styleframe/core';
|
|
8
|
-
|
|
9
|
-
export declare function addIndentToLine(line: string): string;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Consumes any token instance and returns the CSS string representation
|
|
13
|
-
*/
|
|
14
|
-
export declare function consumeCSS(instance: unknown, options: StyleframeOptions, context?: TranspileContext): string;
|
|
15
|
-
|
|
16
|
-
export declare type ConsumeFunction = (instance: unknown, options: StyleframeOptions, context?: TranspileContext) => string;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Consumes any token instance and returns the TS string representation
|
|
20
|
-
*/
|
|
21
|
-
export declare function consumeTS(instance: unknown, options: StyleframeOptions): string;
|
|
22
|
-
|
|
23
|
-
export declare function createFile(name: string, content?: string): OutputFile;
|
|
24
|
-
|
|
25
|
-
export declare const DEFAULT_INDENT = "\t";
|
|
26
|
-
|
|
27
|
-
export declare const defaultThemeSelectorFn: ThemeSelectorFn;
|
|
28
|
-
|
|
29
|
-
export { defaultUtilitySelectorFn }
|
|
30
|
-
|
|
31
|
-
export declare const defaultVariableNameFn: VariableNameFn;
|
|
32
|
-
|
|
33
|
-
export declare function indentLines(lines: string): string;
|
|
34
|
-
|
|
35
|
-
export declare function isUppercase(char: string): boolean;
|
|
36
|
-
|
|
37
|
-
export declare type Output = {
|
|
38
|
-
files: OutputFile[];
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export declare type OutputFile = {
|
|
42
|
-
name: string;
|
|
43
|
-
content: string;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export declare const STATEMENT_AT_RULES: string[];
|
|
47
|
-
|
|
48
|
-
export declare const STATEMENT_OR_BLOCK_AT_RULES: string[];
|
|
49
|
-
|
|
50
|
-
export declare function toCamelCase<S extends string>(str: S): CamelCase<S>;
|
|
51
|
-
|
|
52
|
-
export declare function toKebabCase<S extends string>(str: S): KebabCase<S>;
|
|
53
|
-
|
|
54
|
-
export declare function transpile(instance: Styleframe, { type, treeshake, scanner, consumers, }?: TranspileOptions): Promise<Output>;
|
|
55
|
-
|
|
56
|
-
export declare type TranspileContext = {
|
|
57
|
-
treeshake?: boolean;
|
|
58
|
-
scanner?: boolean;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export declare type TranspileOptions = {
|
|
62
|
-
type?: "css" | "ts" | "dts" | "all";
|
|
63
|
-
treeshake?: boolean;
|
|
64
|
-
scanner?: boolean;
|
|
65
|
-
consumers?: {
|
|
66
|
-
css: ConsumeFunction;
|
|
67
|
-
ts: ConsumeFunction;
|
|
68
|
-
dts: ConsumeFunction;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export { }
|