@hyperfixi/core 2.3.1 → 2.5.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 (194) hide show
  1. package/dist/api/dom-processor.d.ts +8 -4
  2. package/dist/api/hyperscript-api.d.ts +5 -1
  3. package/dist/ast-utils/index.js +25320 -94
  4. package/dist/ast-utils/index.mjs +25320 -94
  5. package/dist/ast-utils/interchange/types.d.ts +7 -1
  6. package/dist/behaviors/index.js +54 -100
  7. package/dist/behaviors/index.mjs +54 -100
  8. package/dist/bundle-generator/index.js +19 -2
  9. package/dist/bundle-generator/index.mjs +19 -2
  10. package/dist/bundle-generator/parser-templates.d.ts +1 -1
  11. package/dist/bundle-generator/template-capabilities.d.ts +1 -1
  12. package/dist/chunks/bridge-Ce2mO-nk.js +2 -0
  13. package/dist/chunks/browser-modular-D5vPrb2X.js +2 -0
  14. package/dist/chunks/feature-eventsource-BpZvPy_K.js +2 -0
  15. package/dist/chunks/{feature-sockets-ClOH7vk7.js → feature-sockets-CrYvjZ4j.js} +2 -2
  16. package/dist/chunks/feature-webworker-BSYguEIW.js +2 -0
  17. package/dist/chunks/index-DsBHN4zW.js +2 -0
  18. package/dist/commands/advanced/async.d.ts +6 -2
  19. package/dist/commands/advanced/js.d.ts +1 -1
  20. package/dist/commands/animation/start-view-transition.d.ts +24 -0
  21. package/dist/commands/async/fetch.d.ts +6 -1
  22. package/dist/commands/control-flow/repeat.d.ts +2 -0
  23. package/dist/commands/data/clear.d.ts +23 -0
  24. package/dist/commands/data/set.d.ts +6 -0
  25. package/dist/commands/dom/close.d.ts +19 -0
  26. package/dist/commands/dom/empty.d.ts +19 -0
  27. package/dist/commands/dom/open.d.ts +21 -0
  28. package/dist/commands/dom/reset.d.ts +19 -0
  29. package/dist/commands/dom/select.d.ts +19 -0
  30. package/dist/commands/dom/swap.d.ts +7 -4
  31. package/dist/commands/events/trigger.d.ts +1 -1
  32. package/dist/commands/execution/blur.d.ts +19 -0
  33. package/dist/commands/execution/call.d.ts +1 -2
  34. package/dist/commands/execution/focus.d.ts +19 -0
  35. package/dist/commands/helpers/element-resolution.d.ts +2 -2
  36. package/dist/commands/helpers/event-waiting.d.ts +1 -1
  37. package/dist/commands/helpers/numeric-target-parser.d.ts +7 -0
  38. package/dist/commands/index.d.ts +34 -2
  39. package/dist/commands/index.js +19353 -4845
  40. package/dist/commands/index.mjs +19321 -4846
  41. package/dist/commands/navigation/go.d.ts +3 -0
  42. package/dist/commands/navigation/scroll-to.d.ts +26 -0
  43. package/dist/commands/utility/beep.d.ts +2 -2
  44. package/dist/commands/utility/breakpoint.d.ts +19 -0
  45. package/dist/commands/utility/pick.d.ts +11 -2
  46. package/dist/compatibility/browser-bundle-modular.d.ts +2 -2
  47. package/dist/compatibility/browser-bundle-multilingual.d.ts +1 -1
  48. package/dist/compatibility/browser-bundle-semantic-complete.d.ts +3 -3
  49. package/dist/compatibility/browser-bundle.d.ts +13 -6
  50. package/dist/compatibility/browser-modular.d.ts +1 -3
  51. package/dist/core/expression-evaluator.d.ts +4 -4
  52. package/dist/core/expression-registry.d.ts +8 -0
  53. package/dist/expressions/bundles/common-expressions.d.ts +2 -2
  54. package/dist/expressions/bundles/core-expressions.d.ts +2 -2
  55. package/dist/expressions/bundles/full-expressions.d.ts +2 -2
  56. package/dist/expressions/bundles/index.d.ts +3 -3
  57. package/dist/expressions/collection/index.d.ts +35 -0
  58. package/dist/expressions/conversion/impl/index.d.ts +1 -1
  59. package/dist/expressions/index.d.ts +4 -3
  60. package/dist/expressions/index.js +1117 -1590
  61. package/dist/expressions/index.mjs +1113 -1586
  62. package/dist/expressions/logical/index.d.ts +2 -0
  63. package/dist/expressions/mathematical/index.d.ts +11 -0
  64. package/dist/expressions/shared/index.d.ts +1 -1
  65. package/dist/expressions/shared/number-utils.d.ts +1 -0
  66. package/dist/htmx/htmx-attribute-processor.d.ts +37 -1
  67. package/dist/htmx/htmx-translator.d.ts +2 -0
  68. package/dist/htmx/i18n-hooks.d.ts +15 -0
  69. package/dist/htmx/i18n-orchestrator.d.ts +15 -0
  70. package/dist/htmx/lang-resolver.d.ts +3 -0
  71. package/dist/htmx/sse.d.ts +60 -0
  72. package/dist/htmx/ws.d.ts +59 -0
  73. package/dist/hyperfixi-browser-classic-i18n.js +2 -0
  74. package/dist/hyperfixi-browser-minimal.js +1 -0
  75. package/dist/hyperfixi-browser-standard.js +2 -0
  76. package/dist/hyperfixi-browser.js +2 -0
  77. package/dist/hyperfixi-classic-i18n.js +1 -1
  78. package/dist/hyperfixi-hx-v4.js +1 -0
  79. package/dist/hyperfixi-hx.js +1 -1
  80. package/dist/hyperfixi-hybrid-complete.js +1 -1
  81. package/dist/hyperfixi-hybrid-hx.js +1 -0
  82. package/dist/hyperfixi-minimal.js +1 -1
  83. package/dist/hyperfixi-multilingual.js +1 -1
  84. package/dist/hyperfixi-standard.js +1 -1
  85. package/dist/hyperfixi.js +1 -1
  86. package/dist/hyperfixi.mjs +1 -1
  87. package/dist/index.d.ts +2 -0
  88. package/dist/index.js +43592 -45060
  89. package/dist/index.min.js +1 -1
  90. package/dist/index.mjs +43589 -45061
  91. package/dist/lib/index.d.ts +2 -2
  92. package/dist/lib/morph-adapter.d.ts +0 -13
  93. package/dist/lib/swap-executor.d.ts +0 -10
  94. package/dist/lib/view-transitions.d.ts +1 -30
  95. package/dist/lokascript-browser-classic-i18n.js +1 -1
  96. package/dist/lokascript-browser-minimal.js +1 -1
  97. package/dist/lokascript-browser-standard.js +1 -1
  98. package/dist/lokascript-browser.js +1 -1
  99. package/dist/lokascript-hybrid-complete.js +1 -1
  100. package/dist/lokascript-hybrid-hx.js +1 -1
  101. package/dist/lokascript-multilingual.js +1 -1
  102. package/dist/lsp-metadata.d.ts +9 -4
  103. package/dist/lsp-metadata.js +187 -3
  104. package/dist/lsp-metadata.mjs +185 -4
  105. package/dist/metadata.d.ts +1 -1
  106. package/dist/metadata.js +3 -3
  107. package/dist/metadata.mjs +3 -3
  108. package/dist/multilingual/bridge.d.ts +1 -1
  109. package/dist/multilingual/index.js +79 -22
  110. package/dist/multilingual/index.mjs +79 -22
  111. package/dist/parser/command-parsers/animation-commands.d.ts +1 -0
  112. package/dist/parser/command-parsers/utility-commands.d.ts +1 -0
  113. package/dist/parser/extensions.d.ts +51 -0
  114. package/dist/parser/full-parser.js +1223 -897
  115. package/dist/parser/full-parser.mjs +1223 -897
  116. package/dist/parser/helpers/ast-helpers.d.ts +1 -0
  117. package/dist/parser/helpers/parsing-helpers.d.ts +4 -0
  118. package/dist/parser/parser-types.d.ts +8 -28
  119. package/dist/parser/parser.d.ts +3 -7
  120. package/dist/parser/pratt-parser.d.ts +0 -3
  121. package/dist/parser/runtime.d.ts +4 -0
  122. package/dist/parser/semantic-integration.d.ts +17 -0
  123. package/dist/parser/types.d.ts +7 -1
  124. package/dist/reference/index.js +91 -0
  125. package/dist/reference/index.mjs +91 -0
  126. package/dist/registry/index.js +12867 -5876
  127. package/dist/registry/index.mjs +12867 -5876
  128. package/dist/registry/universal-types.d.ts +2 -1
  129. package/dist/runtime/command-adapter.d.ts +23 -16
  130. package/dist/runtime/plugin.d.ts +14 -0
  131. package/dist/runtime/runtime-base.d.ts +32 -7
  132. package/dist/runtime/runtime-factory.d.ts +3 -3
  133. package/dist/runtime/runtime.d.ts +2 -2
  134. package/dist/test-setup.d.ts +1 -0
  135. package/dist/types/base-types.d.ts +3 -0
  136. package/dist/types/feature-types.d.ts +1 -1
  137. package/dist/types/index.d.ts +2 -2
  138. package/package.json +29 -23
  139. package/vocab/htmx/ar.js +60 -0
  140. package/vocab/htmx/bn.js +49 -0
  141. package/vocab/htmx/de.js +60 -0
  142. package/vocab/htmx/en.js +21 -0
  143. package/vocab/htmx/es.js +60 -0
  144. package/vocab/htmx/fr.js +59 -0
  145. package/vocab/htmx/he.js +40 -0
  146. package/vocab/htmx/hi.js +60 -0
  147. package/vocab/htmx/id.js +57 -0
  148. package/vocab/htmx/it.js +58 -0
  149. package/vocab/htmx/ja.js +60 -0
  150. package/vocab/htmx/ko.js +60 -0
  151. package/vocab/htmx/ms.js +35 -0
  152. package/vocab/htmx/pl.js +60 -0
  153. package/vocab/htmx/pt.js +60 -0
  154. package/vocab/htmx/qu.js +60 -0
  155. package/vocab/htmx/ru.js +60 -0
  156. package/vocab/htmx/sw.js +59 -0
  157. package/vocab/htmx/th.js +49 -0
  158. package/vocab/htmx/tl.js +33 -0
  159. package/vocab/htmx/tr.js +60 -0
  160. package/vocab/htmx/uk.js +60 -0
  161. package/vocab/htmx/vi.js +51 -0
  162. package/vocab/htmx/zh.js +60 -0
  163. package/dist/bundles/test-minimal.d.ts +0 -3
  164. package/dist/bundles/test-standard.d.ts +0 -3
  165. package/dist/chunks/bridge-Clbh_xAj.js +0 -2
  166. package/dist/chunks/browser-modular-DIOxQqhV.js +0 -2
  167. package/dist/chunks/feature-eventsource-B5F2-H1r.js +0 -2
  168. package/dist/chunks/feature-webworker-3bAp0ac9.js +0 -2
  169. package/dist/chunks/index-DcxoRUBe.js +0 -2
  170. package/dist/compatibility/browser-bundle-minimal.d.ts +0 -8
  171. package/dist/compatibility/browser-bundle-standard.d.ts +0 -8
  172. package/dist/compatibility/hyperscript-tests/test-adapter.d.ts +0 -13
  173. package/dist/core/base-expression-evaluator.d.ts +0 -74
  174. package/dist/core/binary-expression-evaluator.d.ts +0 -7
  175. package/dist/core/call-expression-evaluator.d.ts +0 -7
  176. package/dist/core/configurable-expression-evaluator.d.ts +0 -5
  177. package/dist/core/lazy-expression-evaluator.d.ts +0 -22
  178. package/dist/core/parser.d.ts +0 -21
  179. package/dist/core/selector-evaluator.d.ts +0 -15
  180. package/dist/core/template-literal-evaluator.d.ts +0 -5
  181. package/dist/expressions/comparison/index.d.ts +0 -80
  182. package/dist/expressions/comparison/utils.d.ts +0 -2
  183. package/dist/expressions/conversion/impl/bridge.d.ts +0 -117
  184. package/dist/expressions/logical/impl/pattern-matching.d.ts +0 -58
  185. package/dist/expressions/positional/impl/bridge.d.ts +0 -95
  186. package/dist/expressions/property/index.d.ts +0 -55
  187. package/dist/expressions/references/impl/bridge.d.ts +0 -54
  188. package/dist/extensions/index.d.ts +0 -3
  189. package/dist/extensions/tailwind.d.ts +0 -22
  190. package/dist/mod.d.ts +0 -63
  191. package/dist/parser/expression-parser.d.ts +0 -6
  192. package/dist/runtime/runtime-experimental.d.ts +0 -18
  193. package/dist/scripts/code-generator.d.ts +0 -64
  194. package/dist/scripts/generate-missing-commands.d.ts +0 -4
@@ -1,15 +1,18 @@
1
- export declare const COMMAND_KEYWORDS: readonly ["toggle", "add", "remove", "show", "hide", "put", "set", "get", "make", "swap", "morph", "append", "take", "render", "wait", "fetch", "settle", "send", "trigger", "go", "pushUrl", "replaceUrl", "if", "else", "unless", "repeat", "for", "while", "break", "continue", "call", "return", "throw", "halt", "exit", "log", "tell", "copy", "pick", "beep", "js", "async", "transition", "measure", "increment", "decrement", "default", "install"];
1
+ export declare const COMMAND_KEYWORDS: readonly ["toggle", "add", "remove", "show", "hide", "put", "set", "get", "make", "empty", "open", "close", "select", "reset", "swap", "morph", "append", "take", "render", "wait", "fetch", "settle", "send", "trigger", "go", "pushUrl", "replaceUrl", "if", "else", "unless", "repeat", "for", "while", "break", "continue", "call", "return", "throw", "halt", "exit", "focus", "blur", "log", "tell", "copy", "pick", "beep", "breakpoint", "js", "async", "transition", "measure", "increment", "decrement", "default", "clear", "install"];
2
2
  export declare const REFERENCE_KEYWORDS: readonly ["me", "you", "it", "result", "event", "target", "detail", "body", "window", "document"];
3
3
  export declare const FEATURE_KEYWORDS: readonly ["on", "behavior", "def", "init", "worker", "socket", "eventsource"];
4
4
  export declare const BLOCK_KEYWORDS: readonly ["then", "end", "from", "to", "into", "with", "as", "in"];
5
+ export declare const DIRECTIVE_KEYWORDS: readonly ["#if", "#else", "#end", "#for", "#continue"];
6
+ export declare const COMPONENT_KEYWORDS: readonly ["attrs", "dom-scope"];
7
+ export declare const REACTIVE_SIGILS: readonly ["^"];
5
8
  export declare const POSITIONAL_KEYWORDS: readonly ["first", "last", "next", "previous", "closest", "parent", "children", "random"];
6
- export declare const LOGICAL_KEYWORDS: readonly ["and", "or", "not", "is", "are", "exists", "empty", "matches", "contains", "includes", "has", "no", "true", "false", "null"];
7
- export declare const ALL_KEYWORDS: readonly ["toggle", "add", "remove", "show", "hide", "put", "set", "get", "make", "swap", "morph", "append", "take", "render", "wait", "fetch", "settle", "send", "trigger", "go", "pushUrl", "replaceUrl", "if", "else", "unless", "repeat", "for", "while", "break", "continue", "call", "return", "throw", "halt", "exit", "log", "tell", "copy", "pick", "beep", "js", "async", "transition", "measure", "increment", "decrement", "default", "install", "me", "you", "it", "result", "event", "target", "detail", "body", "window", "document", "on", "behavior", "def", "init", "worker", "socket", "eventsource", "then", "end", "from", "to", "into", "with", "as", "in", "first", "last", "next", "previous", "closest", "parent", "children", "random", "and", "or", "not", "is", "are", "exists", "empty", "matches", "contains", "includes", "has", "no", "true", "false", "null"];
9
+ export declare const LOGICAL_KEYWORDS: readonly ["and", "or", "not", "is", "are", "exists", "empty", "matches", "contains", "includes", "has", "no", "true", "false", "null", "starts with", "ends with", "between", "ignoring case", "where", "sorted by", "mapped to", "split by", "joined by"];
10
+ export declare const ALL_KEYWORDS: readonly ["toggle", "add", "remove", "show", "hide", "put", "set", "get", "make", "empty", "open", "close", "select", "reset", "swap", "morph", "append", "take", "render", "wait", "fetch", "settle", "send", "trigger", "go", "pushUrl", "replaceUrl", "if", "else", "unless", "repeat", "for", "while", "break", "continue", "call", "return", "throw", "halt", "exit", "focus", "blur", "log", "tell", "copy", "pick", "beep", "breakpoint", "js", "async", "transition", "measure", "increment", "decrement", "default", "clear", "install", "me", "you", "it", "result", "event", "target", "detail", "body", "window", "document", "on", "behavior", "def", "init", "worker", "socket", "eventsource", "then", "end", "from", "to", "into", "with", "as", "in", "first", "last", "next", "previous", "closest", "parent", "children", "random", "and", "or", "not", "is", "are", "exists", "empty", "matches", "contains", "includes", "has", "no", "true", "false", "null", "starts with", "ends with", "between", "ignoring case", "where", "sorted by", "mapped to", "split by", "joined by", "#if", "#else", "#end", "#for", "#continue", "attrs", "dom-scope"];
8
11
  export interface HoverDoc {
9
12
  title: string;
10
13
  description: string;
11
14
  example: string;
12
- category: 'command' | 'reference' | 'feature' | 'block' | 'positional' | 'logical';
15
+ category: 'command' | 'reference' | 'feature' | 'block' | 'positional' | 'logical' | 'directive' | 'component' | 'reactive';
13
16
  since?: string;
14
17
  }
15
18
  export declare const HOVER_DOCS: Record<string, HoverDoc>;
@@ -20,6 +23,8 @@ export type FeatureKeyword = (typeof FEATURE_KEYWORDS)[number];
20
23
  export type BlockKeyword = (typeof BLOCK_KEYWORDS)[number];
21
24
  export type PositionalKeyword = (typeof POSITIONAL_KEYWORDS)[number];
22
25
  export type LogicalKeyword = (typeof LOGICAL_KEYWORDS)[number];
26
+ export type DirectiveKeyword = (typeof DIRECTIVE_KEYWORDS)[number];
27
+ export type ComponentKeyword = (typeof COMPONENT_KEYWORDS)[number];
23
28
  export type AllKeyword = (typeof ALL_KEYWORDS)[number];
24
29
  export type EventName = (typeof EVENT_NAMES)[number];
25
30
  //# sourceMappingURL=lsp-metadata.d.ts.map
@@ -10,6 +10,11 @@ const COMMAND_KEYWORDS = [
10
10
  'set',
11
11
  'get',
12
12
  'make',
13
+ 'empty',
14
+ 'open',
15
+ 'close',
16
+ 'select',
17
+ 'reset',
13
18
  'swap',
14
19
  'morph',
15
20
  'append',
@@ -36,11 +41,14 @@ const COMMAND_KEYWORDS = [
36
41
  'throw',
37
42
  'halt',
38
43
  'exit',
44
+ 'focus',
45
+ 'blur',
39
46
  'log',
40
47
  'tell',
41
48
  'copy',
42
49
  'pick',
43
50
  'beep',
51
+ 'breakpoint',
44
52
  'js',
45
53
  'async',
46
54
  'transition',
@@ -48,6 +56,7 @@ const COMMAND_KEYWORDS = [
48
56
  'increment',
49
57
  'decrement',
50
58
  'default',
59
+ 'clear',
51
60
  'install',
52
61
  ];
53
62
  const REFERENCE_KEYWORDS = [
@@ -72,6 +81,9 @@ const FEATURE_KEYWORDS = [
72
81
  'eventsource',
73
82
  ];
74
83
  const BLOCK_KEYWORDS = ['then', 'end', 'from', 'to', 'into', 'with', 'as', 'in'];
84
+ const DIRECTIVE_KEYWORDS = ['#if', '#else', '#end', '#for', '#continue'];
85
+ const COMPONENT_KEYWORDS = ['attrs', 'dom-scope'];
86
+ const REACTIVE_SIGILS = ['^'];
75
87
  const POSITIONAL_KEYWORDS = [
76
88
  'first',
77
89
  'last',
@@ -98,6 +110,15 @@ const LOGICAL_KEYWORDS = [
98
110
  'true',
99
111
  'false',
100
112
  'null',
113
+ 'starts with',
114
+ 'ends with',
115
+ 'between',
116
+ 'ignoring case',
117
+ 'where',
118
+ 'sorted by',
119
+ 'mapped to',
120
+ 'split by',
121
+ 'joined by',
101
122
  ];
102
123
  const ALL_KEYWORDS = [
103
124
  ...COMMAND_KEYWORDS,
@@ -106,6 +127,8 @@ const ALL_KEYWORDS = [
106
127
  ...BLOCK_KEYWORDS,
107
128
  ...POSITIONAL_KEYWORDS,
108
129
  ...LOGICAL_KEYWORDS,
130
+ ...DIRECTIVE_KEYWORDS,
131
+ ...COMPONENT_KEYWORDS,
109
132
  ];
110
133
  const HOVER_DOCS = {
111
134
  toggle: {
@@ -162,6 +185,36 @@ const HOVER_DOCS = {
162
185
  example: 'make a <div/> then put it after me',
163
186
  category: 'command',
164
187
  },
188
+ open: {
189
+ title: 'open',
190
+ description: 'Opens a dialog (showModal/show), details element, or popover. Accepts `as modal` / `as non-modal` for dialogs.',
191
+ example: 'open #myDialog\nopen #myDialog as non-modal\nopen #details',
192
+ category: 'command',
193
+ },
194
+ close: {
195
+ title: 'close',
196
+ description: 'Closes a dialog, details element, or popover.',
197
+ example: 'close #myDialog\nclose #details\nclose #popup',
198
+ category: 'command',
199
+ },
200
+ select: {
201
+ title: 'select',
202
+ description: 'Selects the text in an <input>/<textarea>, or selects the contents of any DOM element via Selection + Range.',
203
+ example: 'select #search\nselect <textarea/>',
204
+ category: 'command',
205
+ },
206
+ reset: {
207
+ title: 'reset',
208
+ description: 'Resets a <form> to its default values (HTMLFormElement.reset()).',
209
+ example: 'reset #myForm\nreset <form/>',
210
+ category: 'command',
211
+ },
212
+ clear: {
213
+ title: 'clear',
214
+ description: 'Resets a variable to null, or clears the value of a form field (<input>, <textarea>, <select>). For arbitrary elements use `empty` instead.',
215
+ example: 'clear :count\nclear myVar\nclear #search',
216
+ category: 'command',
217
+ },
165
218
  swap: {
166
219
  title: 'swap',
167
220
  description: 'Swaps content between elements.',
@@ -282,6 +335,18 @@ const HOVER_DOCS = {
282
335
  example: 'call myFunction()\ncall element.focus()',
283
336
  category: 'command',
284
337
  },
338
+ focus: {
339
+ title: 'focus',
340
+ description: 'Focuses an element (calls HTMLElement.focus()).',
341
+ example: 'focus #search\nfocus on <input/>',
342
+ category: 'command',
343
+ },
344
+ blur: {
345
+ title: 'blur',
346
+ description: 'Removes focus from an element (calls HTMLElement.blur()).',
347
+ example: 'blur #search\nblur on <input/>',
348
+ category: 'command',
349
+ },
285
350
  return: {
286
351
  title: 'return',
287
352
  description: 'Returns a value from a function.',
@@ -336,6 +401,12 @@ const HOVER_DOCS = {
336
401
  example: 'beep! me\nbeep! #target',
337
402
  category: 'command',
338
403
  },
404
+ breakpoint: {
405
+ title: 'breakpoint',
406
+ description: 'Emits a `debugger;` statement — pauses in DevTools when attached.',
407
+ example: 'breakpoint\non click breakpoint',
408
+ category: 'command',
409
+ },
339
410
  js: {
340
411
  title: 'js',
341
412
  description: 'Executes inline JavaScript.',
@@ -578,9 +649,9 @@ const HOVER_DOCS = {
578
649
  },
579
650
  empty: {
580
651
  title: 'empty',
581
- description: 'Checks if value is empty.',
582
- example: 'if #input.value is empty',
583
- category: 'logical',
652
+ description: 'As a command: removes all children from an element (empty #list). As a logical operator: checks if a value is empty (if #input.value is empty).',
653
+ example: 'empty #list\nif #input.value is empty',
654
+ category: 'command',
584
655
  },
585
656
  matches: {
586
657
  title: 'matches',
@@ -594,12 +665,122 @@ const HOVER_DOCS = {
594
665
  example: 'if #list contains #item',
595
666
  category: 'logical',
596
667
  },
668
+ 'starts with': {
669
+ title: 'starts with',
670
+ description: 'String prefix check (upstream _hyperscript 0.9.90).',
671
+ example: "if str starts with 'hello'\nif str does not start with 'world'",
672
+ category: 'logical',
673
+ },
674
+ 'ends with': {
675
+ title: 'ends with',
676
+ description: 'String suffix check (upstream _hyperscript 0.9.90).',
677
+ example: "if str ends with '.com'\nif str does not end with '.js'",
678
+ category: 'logical',
679
+ },
680
+ between: {
681
+ title: 'between',
682
+ description: 'Inclusive range check: `X is between A and B` (upstream _hyperscript 0.9.90). Bounds are auto-ordered, so `between 10 and 5` works the same as `between 5 and 10`.',
683
+ example: 'if :count is between 1 and 10\nif :score is not between 0 and 100',
684
+ category: 'logical',
685
+ },
686
+ 'ignoring case': {
687
+ title: 'ignoring case',
688
+ description: 'Postfix modifier that makes the preceding string comparator (`is`, `==`, `starts with`, `ends with`, `contains`) case-insensitive. No-op for non-string operands.',
689
+ example: "if name is 'Alice' ignoring case\nif str starts with 'hi' ignoring case",
690
+ category: 'logical',
691
+ },
597
692
  has: {
598
693
  title: 'has',
599
694
  description: 'Checks if element has a class/attribute.',
600
695
  example: 'if me has .active',
601
696
  category: 'logical',
602
697
  },
698
+ where: {
699
+ title: 'where',
700
+ description: 'Filter a collection by a per-element predicate. `it` is bound to each element during evaluation.',
701
+ example: 'set :actives to :items where it has .active\n:names where it starts with "A"',
702
+ category: 'logical',
703
+ },
704
+ 'sorted by': {
705
+ title: 'sorted by',
706
+ description: 'Sort a collection by a per-element key expression. Optional trailing `asc` / `desc` / `ascending` / `descending`; default is ascending.',
707
+ example: 'set :byName to :users sorted by it.name\n:scores sorted by it desc',
708
+ category: 'logical',
709
+ },
710
+ 'mapped to': {
711
+ title: 'mapped to',
712
+ description: 'Transform each element of a collection via a per-element expression.',
713
+ example: 'set :names to :users mapped to it.name\n:words mapped to it.toUpperCase()',
714
+ category: 'logical',
715
+ },
716
+ 'split by': {
717
+ title: 'split by',
718
+ description: 'Split a string into an array by a separator.',
719
+ example: 'set :parts to "a,b,c" split by ","\n"hello" split by ""',
720
+ category: 'logical',
721
+ },
722
+ 'joined by': {
723
+ title: 'joined by',
724
+ description: 'Join an array into a string with a separator.',
725
+ example: 'set :csv to :parts joined by ","\n(:names sorted by it) joined by " and "',
726
+ category: 'logical',
727
+ },
728
+ '#if': {
729
+ title: '#if',
730
+ description: 'Template directive — conditionally render a block. The condition is evaluated against the component scope (with `attrs` and `^var` available). Pair with `#end`; optional `#else` branch.',
731
+ example: '<template component="my-greet">\n #if attrs.name\n <p>Hello, ${attrs.name}!</p>\n #else\n <p>Hello, stranger.</p>\n #end\n</template>',
732
+ category: 'directive',
733
+ since: '2.0',
734
+ },
735
+ '#else': {
736
+ title: '#else',
737
+ description: 'Alternative branch of a template `#if`, or fallback for an empty `#for` collection.',
738
+ example: '#for item in attrs.items\n <li>${item}</li>\n#else\n <p>No items.</p>\n#end',
739
+ category: 'directive',
740
+ since: '2.0',
741
+ },
742
+ '#end': {
743
+ title: '#end',
744
+ description: 'Closes a template `#if` or `#for` block. Required and must occupy its own line.',
745
+ example: '#if ^count > 0\n <span>${^count}</span>\n#end',
746
+ category: 'directive',
747
+ since: '2.0',
748
+ },
749
+ '#for': {
750
+ title: '#for',
751
+ description: 'Template directive — iterate over an iterable. The bound name is visible inside the block. Provide an optional `#else` branch that renders when the collection is empty.',
752
+ example: '#for user in attrs.users\n <li>${user.name}</li>\n#else\n <li>No users yet.</li>\n#end',
753
+ category: 'directive',
754
+ since: '2.0',
755
+ },
756
+ '#continue': {
757
+ title: '#continue',
758
+ description: 'Skip to the next iteration of the enclosing `#for` block. Deferred in v2.0; landing in v2.1+.',
759
+ example: '#for item in attrs.items\n #if item.hidden\n #continue\n #end\n <li>${item.name}</li>\n#end',
760
+ category: 'directive',
761
+ since: '2.1',
762
+ },
763
+ attrs: {
764
+ title: 'attrs',
765
+ description: 'Proxy over the component element\'s HTML attributes. Reading `attrs.fooBar` returns the value of the `foo-bar="..."` attribute, coerced to number/boolean when the value parses cleanly. Available as a hyperscript local inside `<template _="...">` init scripts and inside `${...}` template interpolation.',
766
+ example: '<template component="my-counter" _="set ^count to attrs.initialCount">\n <span>${^count}</span>\n</template>\n<my-counter initial-count="5"></my-counter>',
767
+ category: 'component',
768
+ since: '2.0',
769
+ },
770
+ 'dom-scope': {
771
+ title: 'dom-scope',
772
+ description: 'Host attribute that bounds `^var` lookup. `dom-scope="isolated"` on a component instance prevents descendants\' `^var` reads from walking past it into the parent scope. Set automatically on each `<template component>` instance — set it manually on a regular element to create your own boundary.',
773
+ example: '<my-counter dom-scope="isolated"></my-counter>\n<div dom-scope="isolated">...</div>',
774
+ category: 'component',
775
+ since: '2.1',
776
+ },
777
+ '^': {
778
+ title: '^var',
779
+ description: 'Reactive prefix — `^name` reads from (or writes to) the nearest ancestor that has `name` set. `set ^name to value` writes through to the owner; if no owner is found, the write lands at the current `dom-scope` boundary. Tracked: any reactive effect that reads `^name` re-runs when it changes.',
780
+ example: 'set ^count to 0\nincrement ^count\nlog ^count\n-- target a specific element\nset ^user to attrs.data on closest .root',
781
+ category: 'reactive',
782
+ since: '2.0',
783
+ },
603
784
  };
604
785
  const EVENT_NAMES = [
605
786
  'click',
@@ -671,10 +852,13 @@ const EVENT_NAMES = [
671
852
  exports.ALL_KEYWORDS = ALL_KEYWORDS;
672
853
  exports.BLOCK_KEYWORDS = BLOCK_KEYWORDS;
673
854
  exports.COMMAND_KEYWORDS = COMMAND_KEYWORDS;
855
+ exports.COMPONENT_KEYWORDS = COMPONENT_KEYWORDS;
856
+ exports.DIRECTIVE_KEYWORDS = DIRECTIVE_KEYWORDS;
674
857
  exports.EVENT_NAMES = EVENT_NAMES;
675
858
  exports.FEATURE_KEYWORDS = FEATURE_KEYWORDS;
676
859
  exports.HOVER_DOCS = HOVER_DOCS;
677
860
  exports.LOGICAL_KEYWORDS = LOGICAL_KEYWORDS;
678
861
  exports.POSITIONAL_KEYWORDS = POSITIONAL_KEYWORDS;
862
+ exports.REACTIVE_SIGILS = REACTIVE_SIGILS;
679
863
  exports.REFERENCE_KEYWORDS = REFERENCE_KEYWORDS;
680
864
  //# sourceMappingURL=lsp-metadata.js.map
@@ -8,6 +8,11 @@ const COMMAND_KEYWORDS = [
8
8
  'set',
9
9
  'get',
10
10
  'make',
11
+ 'empty',
12
+ 'open',
13
+ 'close',
14
+ 'select',
15
+ 'reset',
11
16
  'swap',
12
17
  'morph',
13
18
  'append',
@@ -34,11 +39,14 @@ const COMMAND_KEYWORDS = [
34
39
  'throw',
35
40
  'halt',
36
41
  'exit',
42
+ 'focus',
43
+ 'blur',
37
44
  'log',
38
45
  'tell',
39
46
  'copy',
40
47
  'pick',
41
48
  'beep',
49
+ 'breakpoint',
42
50
  'js',
43
51
  'async',
44
52
  'transition',
@@ -46,6 +54,7 @@ const COMMAND_KEYWORDS = [
46
54
  'increment',
47
55
  'decrement',
48
56
  'default',
57
+ 'clear',
49
58
  'install',
50
59
  ];
51
60
  const REFERENCE_KEYWORDS = [
@@ -70,6 +79,9 @@ const FEATURE_KEYWORDS = [
70
79
  'eventsource',
71
80
  ];
72
81
  const BLOCK_KEYWORDS = ['then', 'end', 'from', 'to', 'into', 'with', 'as', 'in'];
82
+ const DIRECTIVE_KEYWORDS = ['#if', '#else', '#end', '#for', '#continue'];
83
+ const COMPONENT_KEYWORDS = ['attrs', 'dom-scope'];
84
+ const REACTIVE_SIGILS = ['^'];
73
85
  const POSITIONAL_KEYWORDS = [
74
86
  'first',
75
87
  'last',
@@ -96,6 +108,15 @@ const LOGICAL_KEYWORDS = [
96
108
  'true',
97
109
  'false',
98
110
  'null',
111
+ 'starts with',
112
+ 'ends with',
113
+ 'between',
114
+ 'ignoring case',
115
+ 'where',
116
+ 'sorted by',
117
+ 'mapped to',
118
+ 'split by',
119
+ 'joined by',
99
120
  ];
100
121
  const ALL_KEYWORDS = [
101
122
  ...COMMAND_KEYWORDS,
@@ -104,6 +125,8 @@ const ALL_KEYWORDS = [
104
125
  ...BLOCK_KEYWORDS,
105
126
  ...POSITIONAL_KEYWORDS,
106
127
  ...LOGICAL_KEYWORDS,
128
+ ...DIRECTIVE_KEYWORDS,
129
+ ...COMPONENT_KEYWORDS,
107
130
  ];
108
131
  const HOVER_DOCS = {
109
132
  toggle: {
@@ -160,6 +183,36 @@ const HOVER_DOCS = {
160
183
  example: 'make a <div/> then put it after me',
161
184
  category: 'command',
162
185
  },
186
+ open: {
187
+ title: 'open',
188
+ description: 'Opens a dialog (showModal/show), details element, or popover. Accepts `as modal` / `as non-modal` for dialogs.',
189
+ example: 'open #myDialog\nopen #myDialog as non-modal\nopen #details',
190
+ category: 'command',
191
+ },
192
+ close: {
193
+ title: 'close',
194
+ description: 'Closes a dialog, details element, or popover.',
195
+ example: 'close #myDialog\nclose #details\nclose #popup',
196
+ category: 'command',
197
+ },
198
+ select: {
199
+ title: 'select',
200
+ description: 'Selects the text in an <input>/<textarea>, or selects the contents of any DOM element via Selection + Range.',
201
+ example: 'select #search\nselect <textarea/>',
202
+ category: 'command',
203
+ },
204
+ reset: {
205
+ title: 'reset',
206
+ description: 'Resets a <form> to its default values (HTMLFormElement.reset()).',
207
+ example: 'reset #myForm\nreset <form/>',
208
+ category: 'command',
209
+ },
210
+ clear: {
211
+ title: 'clear',
212
+ description: 'Resets a variable to null, or clears the value of a form field (<input>, <textarea>, <select>). For arbitrary elements use `empty` instead.',
213
+ example: 'clear :count\nclear myVar\nclear #search',
214
+ category: 'command',
215
+ },
163
216
  swap: {
164
217
  title: 'swap',
165
218
  description: 'Swaps content between elements.',
@@ -280,6 +333,18 @@ const HOVER_DOCS = {
280
333
  example: 'call myFunction()\ncall element.focus()',
281
334
  category: 'command',
282
335
  },
336
+ focus: {
337
+ title: 'focus',
338
+ description: 'Focuses an element (calls HTMLElement.focus()).',
339
+ example: 'focus #search\nfocus on <input/>',
340
+ category: 'command',
341
+ },
342
+ blur: {
343
+ title: 'blur',
344
+ description: 'Removes focus from an element (calls HTMLElement.blur()).',
345
+ example: 'blur #search\nblur on <input/>',
346
+ category: 'command',
347
+ },
283
348
  return: {
284
349
  title: 'return',
285
350
  description: 'Returns a value from a function.',
@@ -334,6 +399,12 @@ const HOVER_DOCS = {
334
399
  example: 'beep! me\nbeep! #target',
335
400
  category: 'command',
336
401
  },
402
+ breakpoint: {
403
+ title: 'breakpoint',
404
+ description: 'Emits a `debugger;` statement — pauses in DevTools when attached.',
405
+ example: 'breakpoint\non click breakpoint',
406
+ category: 'command',
407
+ },
337
408
  js: {
338
409
  title: 'js',
339
410
  description: 'Executes inline JavaScript.',
@@ -576,9 +647,9 @@ const HOVER_DOCS = {
576
647
  },
577
648
  empty: {
578
649
  title: 'empty',
579
- description: 'Checks if value is empty.',
580
- example: 'if #input.value is empty',
581
- category: 'logical',
650
+ description: 'As a command: removes all children from an element (empty #list). As a logical operator: checks if a value is empty (if #input.value is empty).',
651
+ example: 'empty #list\nif #input.value is empty',
652
+ category: 'command',
582
653
  },
583
654
  matches: {
584
655
  title: 'matches',
@@ -592,12 +663,122 @@ const HOVER_DOCS = {
592
663
  example: 'if #list contains #item',
593
664
  category: 'logical',
594
665
  },
666
+ 'starts with': {
667
+ title: 'starts with',
668
+ description: 'String prefix check (upstream _hyperscript 0.9.90).',
669
+ example: "if str starts with 'hello'\nif str does not start with 'world'",
670
+ category: 'logical',
671
+ },
672
+ 'ends with': {
673
+ title: 'ends with',
674
+ description: 'String suffix check (upstream _hyperscript 0.9.90).',
675
+ example: "if str ends with '.com'\nif str does not end with '.js'",
676
+ category: 'logical',
677
+ },
678
+ between: {
679
+ title: 'between',
680
+ description: 'Inclusive range check: `X is between A and B` (upstream _hyperscript 0.9.90). Bounds are auto-ordered, so `between 10 and 5` works the same as `between 5 and 10`.',
681
+ example: 'if :count is between 1 and 10\nif :score is not between 0 and 100',
682
+ category: 'logical',
683
+ },
684
+ 'ignoring case': {
685
+ title: 'ignoring case',
686
+ description: 'Postfix modifier that makes the preceding string comparator (`is`, `==`, `starts with`, `ends with`, `contains`) case-insensitive. No-op for non-string operands.',
687
+ example: "if name is 'Alice' ignoring case\nif str starts with 'hi' ignoring case",
688
+ category: 'logical',
689
+ },
595
690
  has: {
596
691
  title: 'has',
597
692
  description: 'Checks if element has a class/attribute.',
598
693
  example: 'if me has .active',
599
694
  category: 'logical',
600
695
  },
696
+ where: {
697
+ title: 'where',
698
+ description: 'Filter a collection by a per-element predicate. `it` is bound to each element during evaluation.',
699
+ example: 'set :actives to :items where it has .active\n:names where it starts with "A"',
700
+ category: 'logical',
701
+ },
702
+ 'sorted by': {
703
+ title: 'sorted by',
704
+ description: 'Sort a collection by a per-element key expression. Optional trailing `asc` / `desc` / `ascending` / `descending`; default is ascending.',
705
+ example: 'set :byName to :users sorted by it.name\n:scores sorted by it desc',
706
+ category: 'logical',
707
+ },
708
+ 'mapped to': {
709
+ title: 'mapped to',
710
+ description: 'Transform each element of a collection via a per-element expression.',
711
+ example: 'set :names to :users mapped to it.name\n:words mapped to it.toUpperCase()',
712
+ category: 'logical',
713
+ },
714
+ 'split by': {
715
+ title: 'split by',
716
+ description: 'Split a string into an array by a separator.',
717
+ example: 'set :parts to "a,b,c" split by ","\n"hello" split by ""',
718
+ category: 'logical',
719
+ },
720
+ 'joined by': {
721
+ title: 'joined by',
722
+ description: 'Join an array into a string with a separator.',
723
+ example: 'set :csv to :parts joined by ","\n(:names sorted by it) joined by " and "',
724
+ category: 'logical',
725
+ },
726
+ '#if': {
727
+ title: '#if',
728
+ description: 'Template directive — conditionally render a block. The condition is evaluated against the component scope (with `attrs` and `^var` available). Pair with `#end`; optional `#else` branch.',
729
+ example: '<template component="my-greet">\n #if attrs.name\n <p>Hello, ${attrs.name}!</p>\n #else\n <p>Hello, stranger.</p>\n #end\n</template>',
730
+ category: 'directive',
731
+ since: '2.0',
732
+ },
733
+ '#else': {
734
+ title: '#else',
735
+ description: 'Alternative branch of a template `#if`, or fallback for an empty `#for` collection.',
736
+ example: '#for item in attrs.items\n <li>${item}</li>\n#else\n <p>No items.</p>\n#end',
737
+ category: 'directive',
738
+ since: '2.0',
739
+ },
740
+ '#end': {
741
+ title: '#end',
742
+ description: 'Closes a template `#if` or `#for` block. Required and must occupy its own line.',
743
+ example: '#if ^count > 0\n <span>${^count}</span>\n#end',
744
+ category: 'directive',
745
+ since: '2.0',
746
+ },
747
+ '#for': {
748
+ title: '#for',
749
+ description: 'Template directive — iterate over an iterable. The bound name is visible inside the block. Provide an optional `#else` branch that renders when the collection is empty.',
750
+ example: '#for user in attrs.users\n <li>${user.name}</li>\n#else\n <li>No users yet.</li>\n#end',
751
+ category: 'directive',
752
+ since: '2.0',
753
+ },
754
+ '#continue': {
755
+ title: '#continue',
756
+ description: 'Skip to the next iteration of the enclosing `#for` block. Deferred in v2.0; landing in v2.1+.',
757
+ example: '#for item in attrs.items\n #if item.hidden\n #continue\n #end\n <li>${item.name}</li>\n#end',
758
+ category: 'directive',
759
+ since: '2.1',
760
+ },
761
+ attrs: {
762
+ title: 'attrs',
763
+ description: 'Proxy over the component element\'s HTML attributes. Reading `attrs.fooBar` returns the value of the `foo-bar="..."` attribute, coerced to number/boolean when the value parses cleanly. Available as a hyperscript local inside `<template _="...">` init scripts and inside `${...}` template interpolation.',
764
+ example: '<template component="my-counter" _="set ^count to attrs.initialCount">\n <span>${^count}</span>\n</template>\n<my-counter initial-count="5"></my-counter>',
765
+ category: 'component',
766
+ since: '2.0',
767
+ },
768
+ 'dom-scope': {
769
+ title: 'dom-scope',
770
+ description: 'Host attribute that bounds `^var` lookup. `dom-scope="isolated"` on a component instance prevents descendants\' `^var` reads from walking past it into the parent scope. Set automatically on each `<template component>` instance — set it manually on a regular element to create your own boundary.',
771
+ example: '<my-counter dom-scope="isolated"></my-counter>\n<div dom-scope="isolated">...</div>',
772
+ category: 'component',
773
+ since: '2.1',
774
+ },
775
+ '^': {
776
+ title: '^var',
777
+ description: 'Reactive prefix — `^name` reads from (or writes to) the nearest ancestor that has `name` set. `set ^name to value` writes through to the owner; if no owner is found, the write lands at the current `dom-scope` boundary. Tracked: any reactive effect that reads `^name` re-runs when it changes.',
778
+ example: 'set ^count to 0\nincrement ^count\nlog ^count\n-- target a specific element\nset ^user to attrs.data on closest .root',
779
+ category: 'reactive',
780
+ since: '2.0',
781
+ },
601
782
  };
602
783
  const EVENT_NAMES = [
603
784
  'click',
@@ -666,5 +847,5 @@ const EVENT_NAMES = [
666
847
  'appear',
667
848
  ];
668
849
 
669
- export { ALL_KEYWORDS, BLOCK_KEYWORDS, COMMAND_KEYWORDS, EVENT_NAMES, FEATURE_KEYWORDS, HOVER_DOCS, LOGICAL_KEYWORDS, POSITIONAL_KEYWORDS, REFERENCE_KEYWORDS };
850
+ export { ALL_KEYWORDS, BLOCK_KEYWORDS, COMMAND_KEYWORDS, COMPONENT_KEYWORDS, DIRECTIVE_KEYWORDS, EVENT_NAMES, FEATURE_KEYWORDS, HOVER_DOCS, LOGICAL_KEYWORDS, POSITIONAL_KEYWORDS, REACTIVE_SIGILS, REFERENCE_KEYWORDS };
670
851
  //# sourceMappingURL=lsp-metadata.mjs.map
@@ -4,7 +4,7 @@ export declare const packageInfo: {
4
4
  readonly description: "Modern hyperscript engine with fixi/htmx integration";
5
5
  readonly compatibility: "~85% official _hyperscript";
6
6
  readonly languages: 24;
7
- readonly commands: 47;
7
+ readonly commands: 58;
8
8
  readonly repository: "https://github.com/codetalcott/hyperfixi";
9
9
  readonly documentation: "https://github.com/codetalcott/hyperfixi/tree/main/packages/core#readme";
10
10
  };
package/dist/metadata.js CHANGED
@@ -6,7 +6,7 @@ const packageInfo = {
6
6
  description: 'Modern hyperscript engine with fixi/htmx integration',
7
7
  compatibility: '~85% official _hyperscript',
8
8
  languages: 24,
9
- commands: 47,
9
+ commands: 58,
10
10
  repository: 'https://github.com/codetalcott/hyperfixi',
11
11
  documentation: 'https://github.com/codetalcott/hyperfixi/tree/main/packages/core#readme',
12
12
  };
@@ -119,7 +119,7 @@ const bundleInfo = [
119
119
  filename: 'hyperfixi.js',
120
120
  gzipSize: '199.6 KB',
121
121
  rawSize: '943 KB',
122
- commandCount: 47,
122
+ commandCount: 58,
123
123
  parser: 'full',
124
124
  hasBlocks: true,
125
125
  hasEventModifiers: true,
@@ -136,7 +136,7 @@ const bundleInfo = [
136
136
  filename: 'hyperfixi-multilingual.js',
137
137
  gzipSize: '64 KB',
138
138
  rawSize: '200 KB',
139
- commandCount: 47,
139
+ commandCount: 58,
140
140
  parser: 'full',
141
141
  hasBlocks: true,
142
142
  hasEventModifiers: true,
package/dist/metadata.mjs CHANGED
@@ -4,7 +4,7 @@ const packageInfo = {
4
4
  description: 'Modern hyperscript engine with fixi/htmx integration',
5
5
  compatibility: '~85% official _hyperscript',
6
6
  languages: 24,
7
- commands: 47,
7
+ commands: 58,
8
8
  repository: 'https://github.com/codetalcott/hyperfixi',
9
9
  documentation: 'https://github.com/codetalcott/hyperfixi/tree/main/packages/core#readme',
10
10
  };
@@ -117,7 +117,7 @@ const bundleInfo = [
117
117
  filename: 'hyperfixi.js',
118
118
  gzipSize: '199.6 KB',
119
119
  rawSize: '943 KB',
120
- commandCount: 47,
120
+ commandCount: 58,
121
121
  parser: 'full',
122
122
  hasBlocks: true,
123
123
  hasEventModifiers: true,
@@ -134,7 +134,7 @@ const bundleInfo = [
134
134
  filename: 'hyperfixi-multilingual.js',
135
135
  gzipSize: '64 KB',
136
136
  rawSize: '200 KB',
137
- commandCount: 47,
137
+ commandCount: 58,
138
138
  parser: 'full',
139
139
  hasBlocks: true,
140
140
  hasEventModifiers: true,