@kithinji/arcane 1.0.7 → 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.
@@ -211002,14 +211002,9 @@ function processStyleObject(styleObj, cssRules) {
211002
211002
  }
211003
211003
  return result;
211004
211004
  }
211005
- function style$(style, context) {
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 = context.resolveNodeValue(rStyle);
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
- context.store.set("style_rules", Array.from(cssRules.values()));
211020
+ this.store.set("style_rules", Array.from(cssRules.values()));
211026
211021
  const properties = Object.entries(classNameMap).map(
211027
- ([key, className]) => context.factory.createPropertyAssignment(
211028
- context.factory.createStringLiteral(key),
211029
- context.factory.createStringLiteral(className)
211022
+ ([key, className]) => this.factory.createPropertyAssignment(
211023
+ this.factory.createStringLiteral(key),
211024
+ this.factory.createStringLiteral(className)
211030
211025
  )
211031
211026
  );
211032
- return context.factory.createObjectLiteralExpression(properties, true);
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 context.factory.createObjectLiteralExpression(
211033
+ return self.factory.createObjectLiteralExpression(
211047
211034
  [
211048
- context.factory.createPropertyAssignment(
211049
- context.factory.createIdentifier("className"),
211050
- context.factory.createStringLiteral("")
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 = context.factory;
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 = context.resolveIdentifier(f.createIdentifier(chain[0]));
211080
- let value = context.resolveNodeValue(root);
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)) {