@salty-css/core 0.0.1-alpha.3 → 0.0.1-alpha.30
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 +23 -19
- package/bin/bin-util.d.ts +2 -0
- package/bin/index.cjs +2 -0
- package/bin/index.d.ts +2 -0
- package/bin/index.js +3 -0
- package/bin/logger.d.ts +2 -0
- package/bin/main.cjs +8 -0
- package/bin/main.d.ts +1 -0
- package/bin/main.js +141 -0
- package/bin/prettier.d.ts +1 -0
- package/compiler/index.cjs +11 -0
- package/{dist/compiler → compiler}/index.d.ts +4 -4
- package/compiler/index.js +174 -0
- package/{dist/config → config}/config-types.d.ts +3 -3
- package/dash-case-DKzpenwY.cjs +1 -0
- package/{dist/util/index.js → dash-case-DMQMcCO6.js} +5 -5
- package/generator/index.cjs +1 -0
- package/generator/index.js +61 -0
- package/{dist/generator → generator}/style-generator.d.ts +9 -8
- package/index-84Wroia-.cjs +1 -0
- package/index-D_732b92.js +4 -0
- package/package.json +39 -20
- package/{dist/parse-templates-BOSK0Tb6.js → parse-templates-D4p3pgQR.js} +26 -24
- package/parse-templates-W0YfTmOT.cjs +8 -0
- package/pascal-case-BQpR5PdN.js +6 -0
- package/pascal-case-iWoaJWwT.cjs +1 -0
- package/react-styled-file-CGVf5n1B.js +11 -0
- package/react-styled-file-Dkubsz-U.cjs +8 -0
- package/salty.config-BupieCfE.cjs +6 -0
- package/salty.config-D9ANEDiH.js +9 -0
- package/{dist/types → types}/index.d.ts +7 -2
- package/util/camel-case.d.ts +1 -0
- package/util/index.cjs +1 -0
- package/util/index.d.ts +4 -0
- package/util/index.js +11 -0
- package/util/pascal-case.d.ts +1 -0
- package/dist/README.md +0 -107
- package/dist/compiler/index.cjs +0 -11
- package/dist/compiler/index.js +0 -180
- package/dist/generator/index.cjs +0 -1
- package/dist/generator/index.js +0 -51
- package/dist/package.json +0 -50
- package/dist/parse-templates-BY1Xai-_.cjs +0 -8
- package/dist/util/index.cjs +0 -1
- package/dist/util/index.d.ts +0 -2
- /package/{dist/config → config}/define-config.d.ts +0 -0
- /package/{dist/config → config}/index.cjs +0 -0
- /package/{dist/config → config}/index.d.ts +0 -0
- /package/{dist/config → config}/index.js +0 -0
- /package/{dist/css → css}/index.cjs +0 -0
- /package/{dist/css → css}/index.d.ts +0 -0
- /package/{dist/css → css}/index.js +0 -0
- /package/{dist/generator → generator}/index.d.ts +0 -0
- /package/{dist/generator → generator}/parse-modifiers.d.ts +0 -0
- /package/{dist/generator → generator}/parse-styles.d.ts +0 -0
- /package/{dist/generator → generator}/parse-templates.d.ts +0 -0
- /package/{dist/generator → generator}/parse-tokens.d.ts +0 -0
- /package/{dist/generator → generator}/parser-types.d.ts +0 -0
- /package/{dist/types → types}/index.cjs +0 -0
- /package/{dist/types → types}/index.js +0 -0
- /package/{dist/types → types}/util-types.d.ts +0 -0
- /package/{dist/util → util}/dash-case.d.ts +0 -0
- /package/{dist/util → util}/to-hash.d.ts +0 -0
package/dist/generator/index.js
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
import { toHash as a } from "../util/index.js";
|
2
|
-
import { g as n, p as o } from "../parse-templates-BOSK0Tb6.js";
|
3
|
-
class p {
|
4
|
-
constructor(t, s, e) {
|
5
|
-
this.tagName = t, this.styles = s, this.options = e;
|
6
|
-
}
|
7
|
-
get hash() {
|
8
|
-
return a(this.styles);
|
9
|
-
}
|
10
|
-
get priority() {
|
11
|
-
var t;
|
12
|
-
return typeof this.tagName == "function" ? (((t = this.tagName.generator) == null ? void 0 : t.priority) || 0) + 1 : 0;
|
13
|
-
}
|
14
|
-
get classNames() {
|
15
|
-
const t = [this.hash], { className: s } = this.options;
|
16
|
-
return s && t.push(s), t.join(" ");
|
17
|
-
}
|
18
|
-
get cssClassName() {
|
19
|
-
return this.hash;
|
20
|
-
}
|
21
|
-
get cssDisplayNameVar() {
|
22
|
-
return `--${this.hash}-display-name: ${this._callerName};`;
|
23
|
-
}
|
24
|
-
get templateKeys() {
|
25
|
-
var t;
|
26
|
-
return (t = this._context) != null && t.config.templates ? n(this._context.config.templates) : [];
|
27
|
-
}
|
28
|
-
get css() {
|
29
|
-
var t;
|
30
|
-
return o(this.styles, `.${this.cssClassName}`, this.priority, (t = this._context) == null ? void 0 : t.config);
|
31
|
-
}
|
32
|
-
get props() {
|
33
|
-
const { element: t } = this.options, s = this.styles.variants ? Object.keys(this.styles.variants).map((e) => {
|
34
|
-
var r;
|
35
|
-
const i = (r = this.styles.defaultVariants) == null ? void 0 : r[e];
|
36
|
-
return i !== void 0 ? `${e}=${String(i)}` : e;
|
37
|
-
}) : void 0;
|
38
|
-
return {
|
39
|
-
element: t,
|
40
|
-
variantKeys: s
|
41
|
-
};
|
42
|
-
}
|
43
|
-
_withBuildContext(t) {
|
44
|
-
this._context = t;
|
45
|
-
const { name: s, config: e } = t;
|
46
|
-
return this._callerName = s, this;
|
47
|
-
}
|
48
|
-
}
|
49
|
-
export {
|
50
|
-
p as StyleComponentGenerator
|
51
|
-
};
|
package/dist/package.json
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "@salty-css/core",
|
3
|
-
"version": "0.0.1-alpha.3",
|
4
|
-
"main": "./dist/index.js",
|
5
|
-
"module": "./dist/index.mjs",
|
6
|
-
"typings": "./dist/index.d.ts",
|
7
|
-
"type": "module",
|
8
|
-
"license": "MIT",
|
9
|
-
"private": false,
|
10
|
-
"publishConfig": {
|
11
|
-
"access": "public"
|
12
|
-
},
|
13
|
-
"homepage": "https://github.com/margarita-form/salty-css",
|
14
|
-
"bugs": {
|
15
|
-
"url": "https://github.com/margarita-form/salty-css/issues"
|
16
|
-
},
|
17
|
-
"files": [
|
18
|
-
"dist",
|
19
|
-
"!**/*.tsbuildinfo"
|
20
|
-
],
|
21
|
-
"nx": {
|
22
|
-
"name": "core"
|
23
|
-
},
|
24
|
-
"exports": {
|
25
|
-
".": {
|
26
|
-
"import": "./index.js",
|
27
|
-
"require": "./index.cjs"
|
28
|
-
},
|
29
|
-
"./react/styled": {
|
30
|
-
"import": "./react/styled.js",
|
31
|
-
"require": "./react/styled.cjs"
|
32
|
-
},
|
33
|
-
"./react/styled-client": {
|
34
|
-
"import": "./react/styled-client.js",
|
35
|
-
"require": "./react/styled-client.cjs"
|
36
|
-
},
|
37
|
-
"./react/css-helpers": {
|
38
|
-
"import": "./react/css-helpers.js",
|
39
|
-
"require": "./react/css-helpers.cjs"
|
40
|
-
},
|
41
|
-
"./vite": {
|
42
|
-
"import": "./vite/index.js",
|
43
|
-
"require": "./vite/index.cjs"
|
44
|
-
},
|
45
|
-
"./webpack/salty-loader": {
|
46
|
-
"import": "./webpack/salty-loader.js",
|
47
|
-
"require": "./webpack/salty-loader.cjs"
|
48
|
-
}
|
49
|
-
}
|
50
|
-
}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
"use strict";const O=require("./util/index.cjs"),K=(s,e)=>{if(typeof s!="string")return{result:s};if(!e)return{result:s};const r=[];return Object.values(e).forEach(n=>{const{pattern:o,transform:c}=n;s=s.replace(o,a=>{const{value:i,css:l}=c(a);return l&&r.push(l),i})}),{result:s,additionalCss:r}},k=s=>typeof s!="string"?{result:s}:/\{[^{}]+\}/g.test(s)?{result:s.replace(/\{([^{}]+)\}/g,(...n)=>`var(--${O.dashCase(n[1].replaceAll(".","-"))})`)}:{result:s},h=(s,e,r,n)=>{const o=[],c=Object.entries(s).reduce((i,[l,t])=>{const p=l.trim();if(typeof t=="function"&&(t=t()),typeof t=="object"){if(!t)return i;if(p==="variants")return Object.entries(t).forEach(([u,f])=>{f&&Object.entries(f).forEach(([m,j])=>{if(!j)return;const y=`${e}.${u}-${m}`,b=h(j,y,r);o.push(b)})}),i;if(p==="defaultVariants")return i;if(p==="compoundVariants")return t.forEach(u=>{const{css:f,...m}=u,j=Object.entries(m).reduce((b,[_,q])=>`${b}.${_}-${q}`,e),y=h(f,j,r);o.push(y)}),i;if(p.startsWith("@")){const u=h(t,e,r),f=`${p} {
|
2
|
-
${u.replace(`
|
3
|
-
`,`
|
4
|
-
`)}
|
5
|
-
}`;return o.push(f),i}const $=l.includes("&")?p.replace("&",e):p.startsWith(":")?`${e}${p}`:`${e} ${p}`,d=h(t,$,r);return o.push(d),i}if(n!=null&&n.templates&&n.templates[p]){const d=t.split(".").reduce((f,m)=>f[m],n.templates[p]),u=h(d,"");return`${i}${u}`}const V=p.startsWith("-")?p:O.dashCase(p),T=($,d=";")=>i=`${i}${$}${d}`,S=$=>T(`${V}:${$}`);if(typeof t=="number")return S(t);if(typeof t!="string")if("toString"in t)t=t.toString();else return i;const{modifiers:g}=n||{},W=function*(){yield k(t),yield K(t,g)}();for(const{result:$,additionalCss:d=[]}of W)t=$,d.forEach(u=>{const f=h(u,"");T(f,"")});return S(t)},"");if(!c)return o.join(`
|
6
|
-
`);if(!e)return c;let a="";return r!==void 0?a=`@layer l${r} { ${e} { ${c} } }`:a=`${e} { ${c} }`,[a,...o].join(`
|
7
|
-
`)},E=(s,e=[])=>{const r=[],n={};if(Object.entries(s).forEach(([o,c])=>{if(typeof c=="object"){if(!c)return;const a=o.trim(),i=E(c,[...e,a]);r.push(i)}else n[o]=c}),Object.keys(n).length){const o=e.map(O.dashCase).join("-"),c=h(n,`.${o}`);r.push(c)}return r.join(`
|
8
|
-
`)},N=s=>Object.keys(s);exports.getTemplateKeys=N;exports.parseStyles=h;exports.parseTemplates=E;exports.parseValueTokens=k;
|
package/dist/util/index.cjs
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=t=>String.fromCharCode(t+(t>25?39:97)),o=(t,r)=>{let e="",a;for(a=Math.abs(t);a>52;a=a/52|0)e=n(a%52)+e;return e=n(a%52)+e,e.length<r?e=e.padStart(r,"a"):e.length>r&&(e=e.slice(-r)),e},i=(t,r)=>{let e=r.length;for(;e;)t=t*33^r.charCodeAt(--e);return t},s=(t,r=3)=>{const e=i(5381,JSON.stringify(t))>>>0;return o(e,r)};function c(t){return t?typeof t!="string"?String(t):t.replace(/\s/g,"-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(r,e)=>(e>0?"-":"")+r.toLowerCase()):""}exports.dashCase=c;exports.toHash=s;
|
package/dist/util/index.d.ts
DELETED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|