@hyperfixi/core 3.1.1 → 3.3.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 +36 -17
  10. package/dist/bundle-generator/index.mjs +36 -17
  11. package/dist/bundle-generator/parser-templates.d.ts +1 -1
  12. package/dist/chunks/bridge-CI9SOl8u.js +2 -0
  13. package/dist/chunks/browser-modular-7CpI5VF2.js +2 -0
  14. package/dist/chunks/index-BwXDEK0m.js +2 -0
  15. package/dist/chunks/index-DQi2o8Lk.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 +938 -425
  23. package/dist/commands/index.mjs +938 -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 +1149 -485
  40. package/dist/index.min.js +1 -1
  41. package/dist/index.mjs +1149 -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 +396 -153
  53. package/dist/parser/full-parser.mjs +396 -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 +535 -210
  65. package/dist/registry/index.mjs +535 -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
@@ -13,4 +13,7 @@ export declare function parseMaybeNamedArgument(ctx: ParserContext): {
13
13
  name?: string;
14
14
  value: ASTNode;
15
15
  };
16
+ export declare function isNakedNamedArgStart(ctx: ParserContext): boolean;
17
+ export declare function parseNakedNamedArgs(ctx: ParserContext, parseValue: () => ASTNode | null, command: string): ASTNode;
18
+ export declare function isGluedBeepBang(beep: Token | null | undefined, bang: Token | null | undefined): boolean;
16
19
  //# sourceMappingURL=parsing-helpers.d.ts.map
@@ -964,6 +964,9 @@ class HybridParser {
964
964
  return left;
965
965
  }
966
966
  parseUnary() {
967
+ if (this.match('beep') && this.peek(1).value === '!') {
968
+ throw new Error(`'beep!' needs the full parser (use hyperfixi.js)`);
969
+ }
967
970
  if (this.match('not', '!')) {
968
971
  this.advance();
969
972
  return { type: 'unary', operator: 'not', operand: this.parseUnary() };
@@ -962,6 +962,9 @@ class HybridParser {
962
962
  return left;
963
963
  }
964
964
  parseUnary() {
965
+ if (this.match('beep') && this.peek(1).value === '!') {
966
+ throw new Error(`'beep!' needs the full parser (use hyperfixi.js)`);
967
+ }
965
968
  if (this.match('not', '!')) {
966
969
  this.advance();
967
970
  return { type: 'unary', operator: 'not', operand: this.parseUnary() };
@@ -958,6 +958,9 @@ class HybridParser {
958
958
  return left;
959
959
  }
960
960
  parseUnary() {
961
+ if (this.match('beep') && this.peek(1).value === '!') {
962
+ throw new Error(`'beep!' needs the full parser (use hyperfixi.js)`);
963
+ }
961
964
  if (this.match('not', '!')) {
962
965
  this.advance();
963
966
  return { type: 'unary', operator: 'not', operand: this.parseUnary() };
@@ -956,6 +956,9 @@ class HybridParser {
956
956
  return left;
957
957
  }
958
958
  parseUnary() {
959
+ if (this.match('beep') && this.peek(1).value === '!') {
960
+ throw new Error(`'beep!' needs the full parser (use hyperfixi.js)`);
961
+ }
959
962
  if (this.match('not', '!')) {
960
963
  this.advance();
961
964
  return { type: 'unary', operator: 'not', operand: this.parseUnary() };
@@ -964,6 +964,9 @@ class HybridParser {
964
964
  return left;
965
965
  }
966
966
  parseUnary() {
967
+ if (this.match('beep') && this.peek(1).value === '!') {
968
+ throw new Error(`'beep!' needs the full parser (use hyperfixi.js)`);
969
+ }
967
970
  if (this.match('not', '!')) {
968
971
  this.advance();
969
972
  return { type: 'unary', operator: 'not', operand: this.parseUnary() };
@@ -962,6 +962,9 @@ class HybridParser {
962
962
  return left;
963
963
  }
964
964
  parseUnary() {
965
+ if (this.match('beep') && this.peek(1).value === '!') {
966
+ throw new Error(`'beep!' needs the full parser (use hyperfixi.js)`);
967
+ }
965
968
  if (this.match('not', '!')) {
966
969
  this.advance();
967
970
  return { type: 'unary', operator: 'not', operand: this.parseUnary() };
@@ -31,6 +31,7 @@ export interface CallExpressionNode extends ASTNode {
31
31
  type: 'callExpression';
32
32
  callee: ASTNode;
33
33
  arguments: ASTNode[];
34
+ closestTo?: ASTNode;
34
35
  }
35
36
  export interface MemberExpressionNode extends ASTNode {
36
37
  type: 'memberExpression';
@@ -90,6 +91,7 @@ export interface TokenStream {
90
91
  match(...types: string[]): boolean;
91
92
  matchOperator(operator: string): boolean;
92
93
  isAtEnd(): boolean;
94
+ atEndOfInput(): boolean;
93
95
  peekAt(offset: number): Token | null;
94
96
  }
95
97
  export interface TokenPredicates {
@@ -21,6 +21,10 @@ export declare class Parser {
21
21
  private parseExpression;
22
22
  private static readonly PRATT_TABLE;
23
23
  private parseExpressionPratt;
24
+ private parseBeepExpression;
25
+ private static readonly BEEP_OPERAND_BP;
26
+ private isStyleRefStar;
27
+ private isSpacedStyleRef;
24
28
  private tryParseStringPostfix;
25
29
  private isNumericPostfixRoot;
26
30
  private canStartOperand;
@@ -63,8 +67,10 @@ export declare class Parser {
63
67
  private parseErrorAndFinallyBlocks;
64
68
  private parseEventNameWithNamespace;
65
69
  private static readonly PSEUDO_COMMAND_PREPOSITIONS;
70
+ private static readonly POSITIONAL_SOURCE_HEADS;
66
71
  private callExprToCommandNode;
67
72
  private createPseudoCommandNode;
73
+ private isArgumentListOnly;
68
74
  private tryParsePseudoCommand;
69
75
  private parseCommandWithErrorRecovery;
70
76
  private parseTemporalKeywordModifiers;
@@ -105,6 +111,7 @@ export declare class Parser {
105
111
  private matchSelector;
106
112
  private checkAnySelector;
107
113
  private checkLiteral;
114
+ private checkEventNamedCall;
108
115
  private checkIdentifierLike;
109
116
  private checkIsCommand;
110
117
  private checkCommandTerminator;
@@ -139,6 +146,8 @@ export declare class Parser {
139
146
  private consumeEvent;
140
147
  private advance;
141
148
  private isAtEnd;
149
+ private atEndOfInput;
150
+ private checkFeatureStart;
142
151
  private peek;
143
152
  private peekAt;
144
153
  private previous;
@@ -33,6 +33,8 @@ export declare function leftAssoc(bp: number, handler?: InfixHandler): Pick<Bind
33
33
  export declare function rightAssoc(bp: number, handler?: InfixHandler): Pick<BindingPowerEntry, 'infix'>;
34
34
  export declare function prefix(bp: number, handler?: PrefixHandler): Pick<BindingPowerEntry, 'prefix'>;
35
35
  export declare const CORE_FRAGMENT: BindingPowerFragment;
36
+ export declare function parseOfOperand(ctx: PrattContext, minBp?: number): ASTNode;
37
+ export declare const THE_OF_TARGET_BP: number;
36
38
  export declare const PARSER_COMPARISON_FRAGMENT: BindingPowerFragment;
37
39
  export declare const ASSIGNMENT_FRAGMENT: BindingPowerFragment;
38
40
  export declare const PARSER_TABLE: BindingPowerFragment;