@hyperfixi/core 2.2.1 → 2.3.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.
Files changed (43) hide show
  1. package/README.md +8 -11
  2. package/dist/bundle-generator/index.js +25 -4
  3. package/dist/bundle-generator/index.mjs +25 -4
  4. package/dist/chunks/{bridge-BELRwj7r.js → bridge-Clbh_xAj.js} +2 -2
  5. package/dist/chunks/browser-modular-DIOxQqhV.js +2 -0
  6. package/dist/chunks/{index-lsDi6izr.js → index-DcxoRUBe.js} +2 -2
  7. package/dist/commands/index.js +36 -6
  8. package/dist/commands/index.mjs +36 -6
  9. package/dist/core/base-expression-evaluator.d.ts +4 -0
  10. package/dist/expressions/index.js +10 -0
  11. package/dist/expressions/index.mjs +10 -0
  12. package/dist/hyperfixi-classic-i18n.js +1 -1
  13. package/dist/hyperfixi-hx.js +1 -1
  14. package/dist/hyperfixi-hybrid-complete.js +1 -1
  15. package/dist/hyperfixi-minimal.js +1 -1
  16. package/dist/hyperfixi-multilingual.js +1 -1
  17. package/dist/hyperfixi-standard.js +1 -1
  18. package/dist/hyperfixi.js +1 -1
  19. package/dist/hyperfixi.mjs +1 -1
  20. package/dist/index.js +175 -79
  21. package/dist/index.min.js +1 -1
  22. package/dist/index.mjs +175 -79
  23. package/dist/lokascript-browser-classic-i18n.js +1 -1
  24. package/dist/lokascript-browser-minimal.js +1 -1
  25. package/dist/lokascript-browser-standard.js +1 -1
  26. package/dist/lokascript-browser.js +1 -1
  27. package/dist/lokascript-hybrid-complete.js +1 -1
  28. package/dist/lokascript-hybrid-hx.js +1 -1
  29. package/dist/lokascript-multilingual.js +1 -1
  30. package/dist/parser/full-parser.js +119 -70
  31. package/dist/parser/full-parser.mjs +119 -70
  32. package/dist/parser/hybrid/index.js +7 -0
  33. package/dist/parser/hybrid/index.mjs +7 -0
  34. package/dist/parser/hybrid/parser-core.js +7 -0
  35. package/dist/parser/hybrid/parser-core.mjs +7 -0
  36. package/dist/parser/hybrid/tokenizer.js +7 -0
  37. package/dist/parser/hybrid/tokenizer.mjs +7 -0
  38. package/dist/parser/hybrid-parser.js +7 -0
  39. package/dist/parser/hybrid-parser.mjs +7 -0
  40. package/dist/registry/index.js +10 -0
  41. package/dist/registry/index.mjs +10 -0
  42. package/package.json +1 -1
  43. package/dist/chunks/browser-modular-B7Bb-ABs.js +0 -2
@@ -1645,6 +1645,8 @@ class BaseExpressionEvaluator {
1645
1645
  return this.evaluateIdSelector(node, context);
1646
1646
  case 'attributeAccess':
1647
1647
  return this.evaluateAttributeAccess(node, context);
1648
+ case 'asExpression':
1649
+ return this.evaluateAsExpression(node, context);
1648
1650
  default:
1649
1651
  throw new Error(`Unsupported AST node type for evaluation: ${node.type}`);
1650
1652
  }
@@ -1930,6 +1932,14 @@ class BaseExpressionEvaluator {
1930
1932
  }
1931
1933
  return `@${node.attributeName}`;
1932
1934
  }
1935
+ async evaluateAsExpression(node, context) {
1936
+ const value = await this.evaluate(node.expression, context);
1937
+ const asExpr = this.expressionRegistry.get('as');
1938
+ if (asExpr) {
1939
+ return asExpr.evaluate(context, value, node.targetType);
1940
+ }
1941
+ throw new Error(`Conversion type 'as' not registered`);
1942
+ }
1933
1943
  getAvailableExpressions() {
1934
1944
  return Array.from(this.expressionRegistry.keys());
1935
1945
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperfixi/core",
3
- "version": "2.2.1",
3
+ "version": "2.3.1",
4
4
  "description": "Multilingual, tree-shakeable hyperscript",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",