@kithinji/arcane 1.0.8 → 1.0.9
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/dist/browser/index.mjs +15 -28
- package/dist/browser/index.mjs.map +2 -2
- package/dist/node/index.cjs +191 -49
- package/dist/node/index.cjs.map +3 -3
- package/dist/node/index.mjs +188 -49
- package/dist/node/index.mjs.map +3 -3
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.node.d.ts +1 -1
- package/dist/types/index.node.d.ts.map +1 -1
- package/dist/types/inline/index.d.ts +2 -0
- package/dist/types/inline/index.d.ts.map +1 -0
- package/dist/types/inline/inline.d.ts +17 -0
- package/dist/types/inline/inline.d.ts.map +1 -0
- package/dist/types/style/style.d.ts +2 -2
- package/dist/types/style/style.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/index.node.ts +1 -1
- package/src/index.ts +1 -1
- package/src/inline/inline.ts +320 -0
- package/src/style/style.ts +42 -58
- package/src/inline-file/inline.ts +0 -90
- /package/src/{inline-file → inline}/index.ts +0 -0
package/dist/browser/index.mjs
CHANGED
|
@@ -211002,14 +211002,9 @@ function processStyleObject(styleObj, cssRules) {
|
|
|
211002
211002
|
}
|
|
211003
211003
|
return result;
|
|
211004
211004
|
}
|
|
211005
|
-
function style$(style
|
|
211006
|
-
if (!context) {
|
|
211007
|
-
throw new Error(
|
|
211008
|
-
"style$ macro requires MacroContext. Ensure you're using this as a build-time macro."
|
|
211009
|
-
);
|
|
211010
|
-
}
|
|
211005
|
+
function style$(style) {
|
|
211011
211006
|
const rStyle = style;
|
|
211012
|
-
const value =
|
|
211007
|
+
const value = this.resolveNodeValue(rStyle);
|
|
211013
211008
|
if (value == void 0) {
|
|
211014
211009
|
throw new Error(
|
|
211015
211010
|
`Could not resolve style object at build time. Ensure all values are statically analyzable (no runtime expressions, dynamic imports should be inlined).`
|
|
@@ -211022,38 +211017,30 @@ function style$(style, context) {
|
|
|
211022
211017
|
}
|
|
211023
211018
|
const cssRules = /* @__PURE__ */ new Map();
|
|
211024
211019
|
const classNameMap = processStyleObject(value, cssRules);
|
|
211025
|
-
|
|
211020
|
+
this.store.set("style_rules", Array.from(cssRules.values()));
|
|
211026
211021
|
const properties = Object.entries(classNameMap).map(
|
|
211027
|
-
([key, className]) =>
|
|
211028
|
-
|
|
211029
|
-
|
|
211022
|
+
([key, className]) => this.factory.createPropertyAssignment(
|
|
211023
|
+
this.factory.createStringLiteral(key),
|
|
211024
|
+
this.factory.createStringLiteral(className)
|
|
211030
211025
|
)
|
|
211031
211026
|
);
|
|
211032
|
-
return
|
|
211027
|
+
return this.factory.createObjectLiteralExpression(properties, true);
|
|
211033
211028
|
}
|
|
211034
211029
|
function apply$(...c) {
|
|
211035
|
-
if (c.length < 1) {
|
|
211036
|
-
throw new Error("apply$ requires at least one argument plus MacroContext");
|
|
211037
|
-
}
|
|
211038
|
-
const context = c.pop();
|
|
211039
|
-
if (!context || !context.factory) {
|
|
211040
|
-
throw new Error(
|
|
211041
|
-
"apply$ macro requires MacroContext as the last argument. Ensure you're using this as a build-time macro."
|
|
211042
|
-
);
|
|
211043
|
-
}
|
|
211044
211030
|
const args = c;
|
|
211031
|
+
const self = this;
|
|
211045
211032
|
if (args.length === 0) {
|
|
211046
|
-
return
|
|
211033
|
+
return self.factory.createObjectLiteralExpression(
|
|
211047
211034
|
[
|
|
211048
|
-
|
|
211049
|
-
|
|
211050
|
-
|
|
211035
|
+
self.factory.createPropertyAssignment(
|
|
211036
|
+
self.factory.createIdentifier("className"),
|
|
211037
|
+
self.factory.createStringLiteral("")
|
|
211051
211038
|
)
|
|
211052
211039
|
],
|
|
211053
211040
|
false
|
|
211054
211041
|
);
|
|
211055
211042
|
}
|
|
211056
|
-
const f =
|
|
211043
|
+
const f = self.factory;
|
|
211057
211044
|
function isTrue(e) {
|
|
211058
211045
|
return e.kind === import_typescript.default.SyntaxKind.TrueKeyword;
|
|
211059
211046
|
}
|
|
@@ -211076,8 +211063,8 @@ function apply$(...c) {
|
|
|
211076
211063
|
}
|
|
211077
211064
|
if (!import_typescript.default.isIdentifier(cur)) return null;
|
|
211078
211065
|
chain.unshift(cur.text);
|
|
211079
|
-
const root =
|
|
211080
|
-
let value =
|
|
211066
|
+
const root = self.resolveIdentifier(f.createIdentifier(chain[0]));
|
|
211067
|
+
let value = self.resolveNodeValue(root);
|
|
211081
211068
|
if (value == null) return null;
|
|
211082
211069
|
for (let i = 1; i < chain.length; i++) {
|
|
211083
211070
|
if (typeof value !== "object" || !(chain[i] in value)) {
|