@hypergood/css-core 0.0.1
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/.prettierignore +1 -0
- package/.prettierrc +1 -0
- package/dist/index.cjs +54 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.cjs +68267 -0
- package/dist/plugin.cjs.map +1 -0
- package/dist/plugin.d.cts +9 -0
- package/dist/plugin.d.ts +9 -0
- package/dist/plugin.js +68266 -0
- package/dist/plugin.js.map +1 -0
- package/package.json +46 -0
- package/src/atomizer/css-tree.ts +579 -0
- package/src/atomizer/index.ts +291 -0
- package/src/atomizer/tokens.ts +0 -0
- package/src/atomizer/types.ts +3 -0
- package/src/css-js-logger.ts +57 -0
- package/src/evaluate.ts +136 -0
- package/src/index.ts +1 -0
- package/src/plugin.ts +573 -0
- package/src/print.ts +101 -0
- package/src/runtime.ts +27 -0
- package/src/string.ts +37 -0
- package/src/style-cache.ts +171 -0
- package/src/style-object.ts +181 -0
- package/src/style-rule.ts +9 -0
- package/tests/style-object.test.ts +151 -0
- package/tsconfig.json +7 -0
- package/tsup.config.ts +12 -0
package/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dist
|
package/.prettierrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
css: () => css,
|
|
24
|
+
keyframes: () => keyframes,
|
|
25
|
+
mergeClassNames: () => mergeClassNames
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(index_exports);
|
|
28
|
+
|
|
29
|
+
// src/runtime.ts
|
|
30
|
+
function css(styleObject) {
|
|
31
|
+
throw new Error("RAHHH");
|
|
32
|
+
}
|
|
33
|
+
function keyframes(styleObject) {
|
|
34
|
+
throw new Error("RAHHH");
|
|
35
|
+
}
|
|
36
|
+
function mergeClassNames(classNames) {
|
|
37
|
+
let cleanNames = classNames.filter((element) => typeof element === "string").join(" ").split(/\s+/);
|
|
38
|
+
let classMap = /* @__PURE__ */ Object.create(null);
|
|
39
|
+
for (let className of cleanNames) {
|
|
40
|
+
if (className.startsWith("x") && className.includes("-")) {
|
|
41
|
+
classMap[className.split("-")[0]] = className;
|
|
42
|
+
} else {
|
|
43
|
+
classMap[className] = className;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return Object.values(classMap).join(" ");
|
|
47
|
+
}
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
css,
|
|
51
|
+
keyframes,
|
|
52
|
+
mergeClassNames
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/runtime.ts"],"sourcesContent":["export * from \"./runtime.js\";\n","export function css(styleObject: any): string {\n throw new Error(\"RAHHH\");\n}\n\nexport function keyframes(styleObject: any): string {\n throw new Error(\"RAHHH\");\n}\n\nexport function mergeClassNames(\n classNames: Array<string | boolean | null | undefined>,\n): string {\n let cleanNames = classNames\n .filter((element) => typeof element === \"string\")\n .join(\" \")\n .split(/\\s+/);\n\n let classMap = Object.create(null) as Record<string, string>;\n for (let className of cleanNames) {\n if (className.startsWith(\"x\") && className.includes(\"-\")) {\n classMap[className.split(\"-\")[0]!] = className;\n } else {\n classMap[className] = className;\n }\n }\n\n return Object.values(classMap).join(\" \");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,SAAS,IAAI,aAA0B;AAC5C,QAAM,IAAI,MAAM,OAAO;AACzB;AAEO,SAAS,UAAU,aAA0B;AAClD,QAAM,IAAI,MAAM,OAAO;AACzB;AAEO,SAAS,gBACd,YACQ;AACR,MAAI,aAAa,WACd,OAAO,CAAC,YAAY,OAAO,YAAY,QAAQ,EAC/C,KAAK,GAAG,EACR,MAAM,KAAK;AAEd,MAAI,WAAW,uBAAO,OAAO,IAAI;AACjC,WAAS,aAAa,YAAY;AAChC,QAAI,UAAU,WAAW,GAAG,KAAK,UAAU,SAAS,GAAG,GAAG;AACxD,eAAS,UAAU,MAAM,GAAG,EAAE,CAAC,CAAE,IAAI;AAAA,IACvC,OAAO;AACL,eAAS,SAAS,IAAI;AAAA,IACxB;AAAA,EACF;AAEA,SAAO,OAAO,OAAO,QAAQ,EAAE,KAAK,GAAG;AACzC;","names":[]}
|
package/dist/index.d.cts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/runtime.ts
|
|
2
|
+
function css(styleObject) {
|
|
3
|
+
throw new Error("RAHHH");
|
|
4
|
+
}
|
|
5
|
+
function keyframes(styleObject) {
|
|
6
|
+
throw new Error("RAHHH");
|
|
7
|
+
}
|
|
8
|
+
function mergeClassNames(classNames) {
|
|
9
|
+
let cleanNames = classNames.filter((element) => typeof element === "string").join(" ").split(/\s+/);
|
|
10
|
+
let classMap = /* @__PURE__ */ Object.create(null);
|
|
11
|
+
for (let className of cleanNames) {
|
|
12
|
+
if (className.startsWith("x") && className.includes("-")) {
|
|
13
|
+
classMap[className.split("-")[0]] = className;
|
|
14
|
+
} else {
|
|
15
|
+
classMap[className] = className;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return Object.values(classMap).join(" ");
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
css,
|
|
22
|
+
keyframes,
|
|
23
|
+
mergeClassNames
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/runtime.ts"],"sourcesContent":["export function css(styleObject: any): string {\n throw new Error(\"RAHHH\");\n}\n\nexport function keyframes(styleObject: any): string {\n throw new Error(\"RAHHH\");\n}\n\nexport function mergeClassNames(\n classNames: Array<string | boolean | null | undefined>,\n): string {\n let cleanNames = classNames\n .filter((element) => typeof element === \"string\")\n .join(\" \")\n .split(/\\s+/);\n\n let classMap = Object.create(null) as Record<string, string>;\n for (let className of cleanNames) {\n if (className.startsWith(\"x\") && className.includes(\"-\")) {\n classMap[className.split(\"-\")[0]!] = className;\n } else {\n classMap[className] = className;\n }\n }\n\n return Object.values(classMap).join(\" \");\n}\n"],"mappings":";AAAO,SAAS,IAAI,aAA0B;AAC5C,QAAM,IAAI,MAAM,OAAO;AACzB;AAEO,SAAS,UAAU,aAA0B;AAClD,QAAM,IAAI,MAAM,OAAO;AACzB;AAEO,SAAS,gBACd,YACQ;AACR,MAAI,aAAa,WACd,OAAO,CAAC,YAAY,OAAO,YAAY,QAAQ,EAC/C,KAAK,GAAG,EACR,MAAM,KAAK;AAEd,MAAI,WAAW,uBAAO,OAAO,IAAI;AACjC,WAAS,aAAa,YAAY;AAChC,QAAI,UAAU,WAAW,GAAG,KAAK,UAAU,SAAS,GAAG,GAAG;AACxD,eAAS,UAAU,MAAM,GAAG,EAAE,CAAC,CAAE,IAAI;AAAA,IACvC,OAAO;AACL,eAAS,SAAS,IAAI;AAAA,IACxB;AAAA,EACF;AAEA,SAAO,OAAO,OAAO,QAAQ,EAAE,KAAK,GAAG;AACzC;","names":[]}
|