@kuma-ui/compiler
Advanced tools
Comparing version 0.0.0-dev-20230828153144 to 0.0.0-dev-20230830161006
@@ -128,3 +128,3 @@ "use strict"; | ||
if (import_ts_morph4.Node.isJsxAttribute(jsxAttribute)) { | ||
const propName = jsxAttribute.getNameNode().getFullText(); | ||
const propName = jsxAttribute.getNameNode().getText(); | ||
let propValue; | ||
@@ -131,0 +131,0 @@ if (propName.trim().startsWith("_")) { |
@@ -130,3 +130,3 @@ "use strict"; | ||
if (import_ts_morph4.Node.isJsxAttribute(jsxAttribute)) { | ||
const propName = jsxAttribute.getNameNode().getFullText(); | ||
const propName = jsxAttribute.getNameNode().getText(); | ||
let propValue; | ||
@@ -133,0 +133,0 @@ if (propName.trim().startsWith("_")) { |
@@ -6,5 +6,5 @@ "use strict"; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all2) => { | ||
for (var name in all2) | ||
__defProp(target, name, { get: all2[name], enumerable: true }); | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
@@ -132,3 +132,3 @@ var __copyProps = (to, from, except, desc) => { | ||
if (import_ts_morph4.Node.isJsxAttribute(jsxAttribute)) { | ||
const propName = jsxAttribute.getNameNode().getFullText(); | ||
const propName = jsxAttribute.getNameNode().getText(); | ||
let propValue; | ||
@@ -169,49 +169,2 @@ if (propName.trim().startsWith("_")) { | ||
var import_sheet = require("@kuma-ui/sheet"); | ||
// src/utils/stableStringify.ts | ||
function stableStringify(data) { | ||
const seen = []; | ||
return function stringify(node) { | ||
if (node && node.toJSON && typeof node.toJSON === "function") { | ||
node = node.toJSON(); | ||
} | ||
if (node === void 0) | ||
return; | ||
if (typeof node == "number") | ||
return isFinite(node) ? "" + node : "null"; | ||
if (typeof node !== "object") | ||
return JSON.stringify(node); | ||
let i, out; | ||
if (Array.isArray(node)) { | ||
out = "["; | ||
for (i = 0; i < node.length; i++) { | ||
if (i) | ||
out += ","; | ||
out += stringify(node[i]) || "null"; | ||
} | ||
return out + "]"; | ||
} | ||
if (node === null) | ||
return "null"; | ||
if (seen.indexOf(node) !== -1) { | ||
throw new TypeError("Converting circular structure to JSON"); | ||
} | ||
const seenIndex = seen.push(node) - 1; | ||
const keys = Object.keys(node).sort(); | ||
out = ""; | ||
for (i = 0; i < keys.length; i++) { | ||
const key = keys[i]; | ||
const value = stringify(node[key]); | ||
if (!value) | ||
continue; | ||
if (out) | ||
out += ","; | ||
out += JSON.stringify(key) + ":" + value; | ||
} | ||
seen.splice(seenIndex, 1); | ||
return "{" + out + "}"; | ||
}(data); | ||
} | ||
// src/extractor/extract.ts | ||
var extractProps = (componentName, jsx, propsMap) => { | ||
@@ -231,9 +184,9 @@ const styledProps = {}; | ||
})) { | ||
if ((0, import_system.isStyledProp)(propName.trim())) { | ||
styledProps[propName.trim()] = propValue; | ||
} else if ((0, import_system.isPseudoProps)(propName.trim())) { | ||
pseudoProps[propName.trim()] = propValue; | ||
} else if ((0, import_componentList.isComponentProps)(componentName)(propName.trim())) { | ||
componentProps[propName.trim()] = propValue; | ||
} else if (propName.trim() === "variant") { | ||
if ((0, import_system.isStyledProp)(propName)) { | ||
styledProps[propName] = propValue; | ||
} else if ((0, import_system.isPseudoProps)(propName)) { | ||
pseudoProps[propName] = propValue; | ||
} else if ((0, import_componentList.isComponentProps)(componentName)(propName)) { | ||
componentProps[propName] = propValue; | ||
} else if (propName === "variant") { | ||
Object.assign( | ||
@@ -244,3 +197,3 @@ componentVariantProps, | ||
jsx.getAttribute("variant")?.remove(); | ||
} else if (propName.trim() === "IS_KUMA_DEFAULT") { | ||
} else if (propName === "IS_KUMA_DEFAULT") { | ||
isDefault = true; | ||
@@ -266,9 +219,5 @@ } | ||
}; | ||
const key = stableStringify(combinedProps); | ||
let generatedStyle = styleCache[key]; | ||
if (!generatedStyle) { | ||
generatedStyle = new import_system.StyleGenerator(combinedProps).getStyle(); | ||
styleCache[key] = generatedStyle; | ||
} | ||
const { className: generatedClassName, css } = generatedStyle; | ||
const { className: generatedClassName, css } = new import_system.StyleGenerator( | ||
combinedProps | ||
).getStyle(); | ||
if (!generatedClassName) | ||
@@ -311,3 +260,2 @@ return { css }; | ||
}; | ||
var styleCache = {}; | ||
@@ -314,0 +262,0 @@ // src/compile.ts |
@@ -6,5 +6,5 @@ "use strict"; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all2) => { | ||
for (var name in all2) | ||
__defProp(target, name, { get: all2[name], enumerable: true }); | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
@@ -31,49 +31,2 @@ var __copyProps = (to, from, except, desc) => { | ||
var import_sheet = require("@kuma-ui/sheet"); | ||
// src/utils/stableStringify.ts | ||
function stableStringify(data) { | ||
const seen = []; | ||
return function stringify(node) { | ||
if (node && node.toJSON && typeof node.toJSON === "function") { | ||
node = node.toJSON(); | ||
} | ||
if (node === void 0) | ||
return; | ||
if (typeof node == "number") | ||
return isFinite(node) ? "" + node : "null"; | ||
if (typeof node !== "object") | ||
return JSON.stringify(node); | ||
let i, out; | ||
if (Array.isArray(node)) { | ||
out = "["; | ||
for (i = 0; i < node.length; i++) { | ||
if (i) | ||
out += ","; | ||
out += stringify(node[i]) || "null"; | ||
} | ||
return out + "]"; | ||
} | ||
if (node === null) | ||
return "null"; | ||
if (seen.indexOf(node) !== -1) { | ||
throw new TypeError("Converting circular structure to JSON"); | ||
} | ||
const seenIndex = seen.push(node) - 1; | ||
const keys = Object.keys(node).sort(); | ||
out = ""; | ||
for (i = 0; i < keys.length; i++) { | ||
const key = keys[i]; | ||
const value = stringify(node[key]); | ||
if (!value) | ||
continue; | ||
if (out) | ||
out += ","; | ||
out += JSON.stringify(key) + ":" + value; | ||
} | ||
seen.splice(seenIndex, 1); | ||
return "{" + out + "}"; | ||
}(data); | ||
} | ||
// src/extractor/extract.ts | ||
var extractProps = (componentName, jsx, propsMap) => { | ||
@@ -93,9 +46,9 @@ const styledProps = {}; | ||
})) { | ||
if ((0, import_system.isStyledProp)(propName.trim())) { | ||
styledProps[propName.trim()] = propValue; | ||
} else if ((0, import_system.isPseudoProps)(propName.trim())) { | ||
pseudoProps[propName.trim()] = propValue; | ||
} else if ((0, import_componentList.isComponentProps)(componentName)(propName.trim())) { | ||
componentProps[propName.trim()] = propValue; | ||
} else if (propName.trim() === "variant") { | ||
if ((0, import_system.isStyledProp)(propName)) { | ||
styledProps[propName] = propValue; | ||
} else if ((0, import_system.isPseudoProps)(propName)) { | ||
pseudoProps[propName] = propValue; | ||
} else if ((0, import_componentList.isComponentProps)(componentName)(propName)) { | ||
componentProps[propName] = propValue; | ||
} else if (propName === "variant") { | ||
Object.assign( | ||
@@ -106,3 +59,3 @@ componentVariantProps, | ||
jsx.getAttribute("variant")?.remove(); | ||
} else if (propName.trim() === "IS_KUMA_DEFAULT") { | ||
} else if (propName === "IS_KUMA_DEFAULT") { | ||
isDefault = true; | ||
@@ -128,9 +81,5 @@ } | ||
}; | ||
const key = stableStringify(combinedProps); | ||
let generatedStyle = styleCache[key]; | ||
if (!generatedStyle) { | ||
generatedStyle = new import_system.StyleGenerator(combinedProps).getStyle(); | ||
styleCache[key] = generatedStyle; | ||
} | ||
const { className: generatedClassName, css } = generatedStyle; | ||
const { className: generatedClassName, css } = new import_system.StyleGenerator( | ||
combinedProps | ||
).getStyle(); | ||
if (!generatedClassName) | ||
@@ -173,3 +122,2 @@ return { css }; | ||
}; | ||
var styleCache = {}; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
@@ -176,0 +124,0 @@ 0 && (module.exports = { |
@@ -6,5 +6,5 @@ "use strict"; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all2) => { | ||
for (var name in all2) | ||
__defProp(target, name, { get: all2[name], enumerable: true }); | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
@@ -33,49 +33,2 @@ var __copyProps = (to, from, except, desc) => { | ||
var import_sheet = require("@kuma-ui/sheet"); | ||
// src/utils/stableStringify.ts | ||
function stableStringify(data) { | ||
const seen = []; | ||
return function stringify(node) { | ||
if (node && node.toJSON && typeof node.toJSON === "function") { | ||
node = node.toJSON(); | ||
} | ||
if (node === void 0) | ||
return; | ||
if (typeof node == "number") | ||
return isFinite(node) ? "" + node : "null"; | ||
if (typeof node !== "object") | ||
return JSON.stringify(node); | ||
let i, out; | ||
if (Array.isArray(node)) { | ||
out = "["; | ||
for (i = 0; i < node.length; i++) { | ||
if (i) | ||
out += ","; | ||
out += stringify(node[i]) || "null"; | ||
} | ||
return out + "]"; | ||
} | ||
if (node === null) | ||
return "null"; | ||
if (seen.indexOf(node) !== -1) { | ||
throw new TypeError("Converting circular structure to JSON"); | ||
} | ||
const seenIndex = seen.push(node) - 1; | ||
const keys = Object.keys(node).sort(); | ||
out = ""; | ||
for (i = 0; i < keys.length; i++) { | ||
const key = keys[i]; | ||
const value = stringify(node[key]); | ||
if (!value) | ||
continue; | ||
if (out) | ||
out += ","; | ||
out += JSON.stringify(key) + ":" + value; | ||
} | ||
seen.splice(seenIndex, 1); | ||
return "{" + out + "}"; | ||
}(data); | ||
} | ||
// src/extractor/extract.ts | ||
var extractProps = (componentName, jsx, propsMap) => { | ||
@@ -95,9 +48,9 @@ const styledProps = {}; | ||
})) { | ||
if ((0, import_system.isStyledProp)(propName.trim())) { | ||
styledProps[propName.trim()] = propValue; | ||
} else if ((0, import_system.isPseudoProps)(propName.trim())) { | ||
pseudoProps[propName.trim()] = propValue; | ||
} else if ((0, import_componentList.isComponentProps)(componentName)(propName.trim())) { | ||
componentProps[propName.trim()] = propValue; | ||
} else if (propName.trim() === "variant") { | ||
if ((0, import_system.isStyledProp)(propName)) { | ||
styledProps[propName] = propValue; | ||
} else if ((0, import_system.isPseudoProps)(propName)) { | ||
pseudoProps[propName] = propValue; | ||
} else if ((0, import_componentList.isComponentProps)(componentName)(propName)) { | ||
componentProps[propName] = propValue; | ||
} else if (propName === "variant") { | ||
Object.assign( | ||
@@ -108,3 +61,3 @@ componentVariantProps, | ||
jsx.getAttribute("variant")?.remove(); | ||
} else if (propName.trim() === "IS_KUMA_DEFAULT") { | ||
} else if (propName === "IS_KUMA_DEFAULT") { | ||
isDefault = true; | ||
@@ -130,9 +83,5 @@ } | ||
}; | ||
const key = stableStringify(combinedProps); | ||
let generatedStyle = styleCache[key]; | ||
if (!generatedStyle) { | ||
generatedStyle = new import_system.StyleGenerator(combinedProps).getStyle(); | ||
styleCache[key] = generatedStyle; | ||
} | ||
const { className: generatedClassName, css } = generatedStyle; | ||
const { className: generatedClassName, css } = new import_system.StyleGenerator( | ||
combinedProps | ||
).getStyle(); | ||
if (!generatedClassName) | ||
@@ -175,3 +124,2 @@ return { css }; | ||
}; | ||
var styleCache = {}; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
@@ -178,0 +126,0 @@ 0 && (module.exports = { |
@@ -6,5 +6,5 @@ "use strict"; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all2) => { | ||
for (var name in all2) | ||
__defProp(target, name, { get: all2[name], enumerable: true }); | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
@@ -134,3 +134,3 @@ var __copyProps = (to, from, except, desc) => { | ||
if (import_ts_morph4.Node.isJsxAttribute(jsxAttribute)) { | ||
const propName = jsxAttribute.getNameNode().getFullText(); | ||
const propName = jsxAttribute.getNameNode().getText(); | ||
let propValue; | ||
@@ -171,49 +171,2 @@ if (propName.trim().startsWith("_")) { | ||
var import_sheet = require("@kuma-ui/sheet"); | ||
// src/utils/stableStringify.ts | ||
function stableStringify(data) { | ||
const seen = []; | ||
return function stringify(node) { | ||
if (node && node.toJSON && typeof node.toJSON === "function") { | ||
node = node.toJSON(); | ||
} | ||
if (node === void 0) | ||
return; | ||
if (typeof node == "number") | ||
return isFinite(node) ? "" + node : "null"; | ||
if (typeof node !== "object") | ||
return JSON.stringify(node); | ||
let i, out; | ||
if (Array.isArray(node)) { | ||
out = "["; | ||
for (i = 0; i < node.length; i++) { | ||
if (i) | ||
out += ","; | ||
out += stringify(node[i]) || "null"; | ||
} | ||
return out + "]"; | ||
} | ||
if (node === null) | ||
return "null"; | ||
if (seen.indexOf(node) !== -1) { | ||
throw new TypeError("Converting circular structure to JSON"); | ||
} | ||
const seenIndex = seen.push(node) - 1; | ||
const keys = Object.keys(node).sort(); | ||
out = ""; | ||
for (i = 0; i < keys.length; i++) { | ||
const key = keys[i]; | ||
const value = stringify(node[key]); | ||
if (!value) | ||
continue; | ||
if (out) | ||
out += ","; | ||
out += JSON.stringify(key) + ":" + value; | ||
} | ||
seen.splice(seenIndex, 1); | ||
return "{" + out + "}"; | ||
}(data); | ||
} | ||
// src/extractor/extract.ts | ||
var extractProps = (componentName, jsx, propsMap) => { | ||
@@ -233,9 +186,9 @@ const styledProps = {}; | ||
})) { | ||
if ((0, import_system.isStyledProp)(propName.trim())) { | ||
styledProps[propName.trim()] = propValue; | ||
} else if ((0, import_system.isPseudoProps)(propName.trim())) { | ||
pseudoProps[propName.trim()] = propValue; | ||
} else if ((0, import_componentList.isComponentProps)(componentName)(propName.trim())) { | ||
componentProps[propName.trim()] = propValue; | ||
} else if (propName.trim() === "variant") { | ||
if ((0, import_system.isStyledProp)(propName)) { | ||
styledProps[propName] = propValue; | ||
} else if ((0, import_system.isPseudoProps)(propName)) { | ||
pseudoProps[propName] = propValue; | ||
} else if ((0, import_componentList.isComponentProps)(componentName)(propName)) { | ||
componentProps[propName] = propValue; | ||
} else if (propName === "variant") { | ||
Object.assign( | ||
@@ -246,3 +199,3 @@ componentVariantProps, | ||
jsx.getAttribute("variant")?.remove(); | ||
} else if (propName.trim() === "IS_KUMA_DEFAULT") { | ||
} else if (propName === "IS_KUMA_DEFAULT") { | ||
isDefault = true; | ||
@@ -268,9 +221,5 @@ } | ||
}; | ||
const key = stableStringify(combinedProps); | ||
let generatedStyle = styleCache[key]; | ||
if (!generatedStyle) { | ||
generatedStyle = new import_system.StyleGenerator(combinedProps).getStyle(); | ||
styleCache[key] = generatedStyle; | ||
} | ||
const { className: generatedClassName, css } = generatedStyle; | ||
const { className: generatedClassName, css } = new import_system.StyleGenerator( | ||
combinedProps | ||
).getStyle(); | ||
if (!generatedClassName) | ||
@@ -313,3 +262,2 @@ return { css }; | ||
}; | ||
var styleCache = {}; | ||
@@ -316,0 +264,0 @@ // src/compile.ts |
{ | ||
"name": "@kuma-ui/compiler", | ||
"version": "0.0.0-dev-20230828153144", | ||
"version": "0.0.0-dev-20230830161006", | ||
"description": "🐻 Kuma UI is a utility-first, zero-runtime CSS-in-JS library that offers an outstanding developer experience and optimized performance.", | ||
@@ -34,5 +34,5 @@ "repository": { | ||
"ts-pattern": "^5.0.1", | ||
"@kuma-ui/core": "^0.0.0-dev-20230828153144", | ||
"@kuma-ui/sheet": "^1.2.0", | ||
"@kuma-ui/system": "^1.4.0" | ||
"@kuma-ui/core": "^0.0.0-dev-20230830161006", | ||
"@kuma-ui/sheet": "^0.0.0-dev-20230830161006", | ||
"@kuma-ui/system": "^0.0.0-dev-20230830161006" | ||
}, | ||
@@ -39,0 +39,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78187
42
1950
+ Added@kuma-ui/sheet@0.0.0-dev-20240508134912(transitive)
+ Added@kuma-ui/system@0.0.0-dev-20240903071402(transitive)