@hyperfixi/core 3.1.1 → 3.2.0

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 (97) hide show
  1. package/README.md +28 -36
  2. package/dist/ast/command-slots.d.ts +1 -1
  3. package/dist/ast/nodes.d.ts +2 -0
  4. package/dist/ast-utils/index.cjs +193 -48
  5. package/dist/ast-utils/index.mjs +193 -48
  6. package/dist/ast-utils/interchange/types.d.ts +19 -1
  7. package/dist/behaviors/index.cjs +19 -0
  8. package/dist/behaviors/index.mjs +19 -0
  9. package/dist/bundle-generator/index.cjs +24 -9
  10. package/dist/bundle-generator/index.mjs +24 -9
  11. package/dist/bundle-generator/parser-templates.d.ts +1 -1
  12. package/dist/chunks/bridge-Cnj8dQFV.js +2 -0
  13. package/dist/chunks/browser-modular-BNDYF6Dq.js +2 -0
  14. package/dist/chunks/index-DQi2o8Lk.js +2 -0
  15. package/dist/chunks/index-LLuwEQp0.js +2 -0
  16. package/dist/chunks/index-uCOQ8Qn0.js +2 -0
  17. package/dist/commands/animation/transition.d.ts +12 -6
  18. package/dist/commands/helpers/loop-executor.d.ts +2 -2
  19. package/dist/commands/helpers/numeric-target-parser.d.ts +1 -1
  20. package/dist/commands/helpers/variable-access.d.ts +5 -2
  21. package/dist/commands/helpers/write-target.d.ts +5 -0
  22. package/dist/commands/index.cjs +929 -425
  23. package/dist/commands/index.mjs +929 -425
  24. package/dist/commands/templates/render.d.ts +4 -4
  25. package/dist/commands/utility/beep.d.ts +0 -3
  26. package/dist/expressions/index.cjs +7 -13
  27. package/dist/expressions/index.mjs +7 -13
  28. package/dist/htmx/i18n-hooks.d.ts +4 -1
  29. package/dist/hyperfixi-browser-classic-i18n.js +1 -1
  30. package/dist/hyperfixi-browser.js +1 -1
  31. package/dist/hyperfixi-classic-i18n.js +1 -1
  32. package/dist/hyperfixi-hx-v4.js +1 -1
  33. package/dist/hyperfixi-hx.js +1 -1
  34. package/dist/hyperfixi-hybrid-complete.js +1 -1
  35. package/dist/hyperfixi-hybrid-hx.js +1 -1
  36. package/dist/hyperfixi-multilingual.js +1 -1
  37. package/dist/hyperfixi.js +1 -1
  38. package/dist/hyperfixi.mjs +1 -1
  39. package/dist/index.cjs +1140 -485
  40. package/dist/index.min.js +1 -1
  41. package/dist/index.mjs +1140 -485
  42. package/dist/lib/swap-executor.d.ts +1 -1
  43. package/dist/lokascript-browser-classic-i18n.js +1 -1
  44. package/dist/lokascript-browser.js +1 -1
  45. package/dist/lokascript-hybrid-complete.js +1 -1
  46. package/dist/lokascript-hybrid-hx.js +1 -1
  47. package/dist/lokascript-multilingual.js +1 -1
  48. package/dist/metadata.cjs +9 -9
  49. package/dist/metadata.d.ts +1 -1
  50. package/dist/metadata.mjs +9 -9
  51. package/dist/parser/command-grammar.d.ts +1 -0
  52. package/dist/parser/full-parser.cjs +387 -153
  53. package/dist/parser/full-parser.mjs +387 -153
  54. package/dist/parser/helpers/parsing-helpers.d.ts +3 -0
  55. package/dist/parser/hybrid/index.cjs +3 -0
  56. package/dist/parser/hybrid/index.mjs +3 -0
  57. package/dist/parser/hybrid/parser-core.cjs +3 -0
  58. package/dist/parser/hybrid/parser-core.mjs +3 -0
  59. package/dist/parser/hybrid-parser.cjs +3 -0
  60. package/dist/parser/hybrid-parser.mjs +3 -0
  61. package/dist/parser/parser-types.d.ts +2 -0
  62. package/dist/parser/parser.d.ts +9 -0
  63. package/dist/parser/pratt-parser.d.ts +2 -0
  64. package/dist/registry/index.cjs +526 -210
  65. package/dist/registry/index.mjs +526 -210
  66. package/dist/utils/beep.d.ts +8 -0
  67. package/dist/version.d.ts +1 -1
  68. package/package.json +21 -18
  69. package/vocab/htmx/ar.js +22 -20
  70. package/vocab/htmx/bn.js +21 -5
  71. package/vocab/htmx/de.js +33 -10
  72. package/vocab/htmx/en.js +4 -1
  73. package/vocab/htmx/es.js +28 -9
  74. package/vocab/htmx/fr.js +28 -8
  75. package/vocab/htmx/he.js +22 -1
  76. package/vocab/htmx/hi.js +28 -7
  77. package/vocab/htmx/id.js +29 -10
  78. package/vocab/htmx/it.js +26 -5
  79. package/vocab/htmx/ja.js +36 -11
  80. package/vocab/htmx/ko.js +27 -6
  81. package/vocab/htmx/ms.js +24 -1
  82. package/vocab/htmx/pl.js +27 -7
  83. package/vocab/htmx/pt.js +30 -9
  84. package/vocab/htmx/qu.js +32 -9
  85. package/vocab/htmx/ru.js +28 -6
  86. package/vocab/htmx/sw.js +28 -8
  87. package/vocab/htmx/th.js +19 -1
  88. package/vocab/htmx/tl.js +24 -1
  89. package/vocab/htmx/tr.js +34 -8
  90. package/vocab/htmx/uk.js +28 -6
  91. package/vocab/htmx/vi.js +27 -19
  92. package/vocab/htmx/zh.js +28 -9
  93. package/dist/chunks/bridge-D7qrHhV0.js +0 -2
  94. package/dist/chunks/browser-modular-C4LFxfoS.js +0 -2
  95. package/dist/chunks/index-C7lqD4mo.js +0 -2
  96. package/dist/chunks/index-CAPhqA6k.js +0 -2
  97. package/dist/chunks/index-CLdRyZaP.js +0 -2
@@ -0,0 +1,2 @@
1
+ let t=null;async function n(){if(!t)try{t=await(import("./index-DQi2o8Lk.js"))}catch{throw Error("@lokascript/framework is required for LSE support. Install it: npm install @lokascript/framework")}return t}function r(){if(t)return!0;try{return require.resolve("@lokascript/framework"),!0}catch{return!1}}async function a(t,r){return(await n()).parseExplicit(t,r)}async function i(t){return(await n()).isExplicitSyntax(t)}async function o(t){return(await n()).renderExplicit(t)}async function e(t){return(await n()).fromInterchangeNode(t)}async function c(t){return(await n()).toProtocolJSON(t)}async function u(t){return(await n()).fromProtocolJSON(t)}async function s(t){return(await n()).validateProtocolJSON(t)}async function f(t){return(await n()).toEnvelopeJSON(t)}async function l(t){return(await n()).fromEnvelopeJSON(t)}async function w(t){return(await n()).isEnvelope(t)}async function p(t){return(await n()).semanticNodeToRuntimeAST(t)}export{l as fromEnvelopeJSON,e as fromInterchangeNode,u as fromProtocolJSON,w as isEnvelope,i as isExplicitSyntax,r as isLSEAvailable,a as parseExplicit,o as renderExplicit,p as semanticNodeToRuntimeAST,f as toEnvelopeJSON,c as toProtocolJSON,s as validateProtocolJSON};
2
+ //# sourceMappingURL=index-uCOQ8Qn0.js.map
@@ -2,12 +2,17 @@ import type { ExecutionContext, TypedExecutionContext } from '../../types/core';
2
2
  import type { ExpressionEvaluator } from '../../core/expression-evaluator';
3
3
  import { type DecoratedCommand } from '../decorators';
4
4
  import type { CommandRaw } from '../../ast/command-slots';
5
- export interface TransitionCommandInput {
6
- target?: string | HTMLElement;
5
+ export interface TransitionPairInput {
6
+ target?: string | HTMLElement | HTMLElement[];
7
7
  property: string;
8
8
  value: string | number;
9
+ from?: string | number;
10
+ }
11
+ export interface TransitionCommandInput extends TransitionPairInput {
9
12
  duration?: number | string;
10
13
  timingFunction?: string;
14
+ using?: string;
15
+ pairs?: TransitionPairInput[];
11
16
  }
12
17
  export interface TransitionCommandOutput {
13
18
  element: HTMLElement;
@@ -20,22 +25,23 @@ export interface TransitionCommandOutput {
20
25
  export declare class TransitionCommand implements DecoratedCommand {
21
26
  static readonly metadata: {
22
27
  readonly description: "Animate CSS properties using CSS transitions";
23
- readonly syntax: "transition [<target>] <property> to <value> [over <duration>] [with <timing>]";
24
- readonly examples: readonly ["transition opacity to 0.5", "transition my *opacity to 0 over 200ms", "transition #box's *opacity to 0 over 200ms", "transition left to 100px over 500ms", "transition background-color to red over 1s with ease-in-out"];
28
+ readonly syntax: "transition <property> [from <value>] to <value> [<property> … to <value>]… [over <duration>] [using <css> | with <timing>]";
29
+ readonly examples: readonly ["transition opacity to 0.5", "transition my *opacity to 0 over 200ms", "transition #box's *opacity to 0 over 200ms", "transition left to 100px over 500ms", "transition background-color to red over 1s with ease-in-out", "transition *width to 100px *height to 50px over 300ms", "transition *opacity of #panel from 0 to 1 over 200ms", "transition my *opacity to 0 using \"opacity 1s ease-in\""];
25
30
  readonly sideEffects: readonly ["style-change", "timing"];
26
31
  readonly category: "animation";
27
32
  readonly compatibility: "standard";
28
33
  };
29
34
  get metadata(): {
30
35
  readonly description: "Animate CSS properties using CSS transitions";
31
- readonly syntax: "transition [<target>] <property> to <value> [over <duration>] [with <timing>]";
32
- readonly examples: readonly ["transition opacity to 0.5", "transition my *opacity to 0 over 200ms", "transition #box's *opacity to 0 over 200ms", "transition left to 100px over 500ms", "transition background-color to red over 1s with ease-in-out"];
36
+ readonly syntax: "transition <property> [from <value>] to <value> [<property> … to <value>]… [over <duration>] [using <css> | with <timing>]";
37
+ readonly examples: readonly ["transition opacity to 0.5", "transition my *opacity to 0 over 200ms", "transition #box's *opacity to 0 over 200ms", "transition left to 100px over 500ms", "transition background-color to red over 1s with ease-in-out", "transition *width to 100px *height to 50px over 300ms", "transition *opacity of #panel from 0 to 1 over 200ms", "transition my *opacity to 0 using \"opacity 1s ease-in\""];
33
38
  readonly sideEffects: readonly ["style-change", "timing"];
34
39
  readonly category: "animation";
35
40
  readonly compatibility: "standard";
36
41
  };
37
42
  readonly name: string;
38
43
  parseInput(raw: CommandRaw<'transition'>, evaluator: ExpressionEvaluator, context: ExecutionContext): Promise<TransitionCommandInput>;
44
+ private laterPairs;
39
45
  execute(input: TransitionCommandInput, context: TypedExecutionContext): Promise<TransitionCommandOutput>;
40
46
  }
41
47
  export declare const createTransitionCommand: () => TransitionCommand;
@@ -37,11 +37,11 @@ export declare function createTimesLoopConfig(count: number, indexVariable?: str
37
37
  config: LoopConfig;
38
38
  iterCtx: LoopIterationContext;
39
39
  };
40
- export declare function createWhileLoopConfig(conditionExpr: unknown, evaluateCondition: (expr: unknown, ctx: TypedExecutionContext) => boolean, context: TypedExecutionContext, indexVariable?: string): {
40
+ export declare function createWhileLoopConfig(conditionExpr: unknown, evaluateCondition: (expr: unknown, ctx: TypedExecutionContext) => boolean | Promise<boolean>, context: TypedExecutionContext, indexVariable?: string): {
41
41
  config: LoopConfig;
42
42
  iterCtx: LoopIterationContext;
43
43
  };
44
- export declare function createUntilLoopConfig(conditionExpr: unknown, evaluateCondition: (expr: unknown, ctx: TypedExecutionContext) => boolean, context: TypedExecutionContext, indexVariable?: string): {
44
+ export declare function createUntilLoopConfig(conditionExpr: unknown, evaluateCondition: (expr: unknown, ctx: TypedExecutionContext) => boolean | Promise<boolean>, context: TypedExecutionContext, indexVariable?: string): {
45
45
  config: LoopConfig;
46
46
  iterCtx: LoopIterationContext;
47
47
  };
@@ -11,7 +11,7 @@ export interface NumericCustomWrite {
11
11
  currentValue: number;
12
12
  }
13
13
  export interface NumericTargetInput {
14
- target: string | HTMLElement | number;
14
+ target: string | HTMLElement | number | Record<string, unknown>;
15
15
  property?: string;
16
16
  scope?: 'global' | 'local';
17
17
  amount: number;
@@ -1,10 +1,13 @@
1
1
  import type { ExecutionContext } from '../../types/base-types';
2
2
  export declare function convertToNumber(value: unknown): number;
3
+ export declare function counterAmount(value: unknown): number;
4
+ export declare function counterValue(value: unknown): number;
3
5
  export declare function getVariableValue(name: string, context: ExecutionContext, preferredScope?: string): unknown;
4
6
  export declare function setVariableValue(name: string, value: unknown, context: ExecutionContext, preferredScope?: string): void;
5
7
  export declare function resolveElementRef(elementRef: string, context: ExecutionContext): unknown;
6
8
  export declare function getElementPropertyValue(propertyPath: string, context: ExecutionContext): number;
7
9
  export declare function setElementPropertyValue(propertyPath: string, value: unknown, context: ExecutionContext): void;
8
- export declare function getCurrentNumericValue(target: string | HTMLElement | number, property: string | undefined, scope: string | undefined, context: ExecutionContext): number;
9
- export declare function setTargetValue(target: string | HTMLElement | number, property: string | undefined, scope: string | undefined, newValue: unknown, context: ExecutionContext): void;
10
+ export declare function isObjectOwner(value: unknown): value is Record<string, unknown>;
11
+ export declare function getCurrentNumericValue(target: string | HTMLElement | number | Record<string, unknown>, property: string | undefined, scope: string | undefined, context: ExecutionContext): number;
12
+ export declare function setTargetValue(target: string | HTMLElement | number | Record<string, unknown>, property: string | undefined, scope: string | undefined, newValue: unknown, context: ExecutionContext): void;
10
13
  //# sourceMappingURL=variable-access.d.ts.map
@@ -21,6 +21,10 @@ export type WriteTarget = {
21
21
  } | {
22
22
  kind: 'property';
23
23
  target: PropertyTarget;
24
+ } | {
25
+ kind: 'member';
26
+ container: Record<string, unknown>;
27
+ property: string;
24
28
  } | {
25
29
  kind: 'variable';
26
30
  name: string;
@@ -31,6 +35,7 @@ export interface WriteTargetOptions {
31
35
  nodeWriters?: boolean;
32
36
  selectorSource?: boolean;
33
37
  styleSplit?: boolean;
38
+ ofAndObjectProperty?: boolean;
34
39
  bareReference?: boolean;
35
40
  }
36
41
  export declare function resolveWriteTarget(node: ASTNode | Record<string, unknown> | undefined, evaluator: ExpressionEvaluator, context: ExecutionContext, options: WriteTargetOptions): Promise<WriteTarget | null>;