@hyperfixi/core 2.3.0 โ 2.4.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.
- package/README.md +8 -11
- package/dist/api/dom-processor.d.ts +8 -4
- package/dist/api/hyperscript-api.d.ts +5 -1
- package/dist/ast-utils/index.js +25320 -94
- package/dist/ast-utils/index.mjs +25320 -94
- package/dist/ast-utils/interchange/types.d.ts +7 -1
- package/dist/behaviors/index.js +54 -100
- package/dist/behaviors/index.mjs +54 -100
- package/dist/bundle-generator/index.js +44 -6
- package/dist/bundle-generator/index.mjs +44 -6
- package/dist/bundle-generator/parser-templates.d.ts +1 -1
- package/dist/bundle-generator/template-capabilities.d.ts +1 -1
- package/dist/chunks/bridge-C4d3blZX.js +2 -0
- package/dist/chunks/browser-modular-BwIRlrTM.js +2 -0
- package/dist/chunks/feature-eventsource-BpZvPy_K.js +2 -0
- package/dist/chunks/{feature-sockets-ClOH7vk7.js โ feature-sockets-CrYvjZ4j.js} +2 -2
- package/dist/chunks/feature-webworker-BSYguEIW.js +2 -0
- package/dist/chunks/index-Beno_SBy.js +2 -0
- package/dist/commands/advanced/async.d.ts +6 -2
- package/dist/commands/advanced/js.d.ts +1 -1
- package/dist/commands/animation/start-view-transition.d.ts +24 -0
- package/dist/commands/async/fetch.d.ts +6 -1
- package/dist/commands/control-flow/repeat.d.ts +2 -0
- package/dist/commands/data/clear.d.ts +23 -0
- package/dist/commands/data/set.d.ts +6 -0
- package/dist/commands/dom/close.d.ts +19 -0
- package/dist/commands/dom/empty.d.ts +19 -0
- package/dist/commands/dom/open.d.ts +21 -0
- package/dist/commands/dom/reset.d.ts +19 -0
- package/dist/commands/dom/select.d.ts +19 -0
- package/dist/commands/dom/swap.d.ts +7 -4
- package/dist/commands/events/trigger.d.ts +1 -1
- package/dist/commands/execution/blur.d.ts +19 -0
- package/dist/commands/execution/call.d.ts +1 -2
- package/dist/commands/execution/focus.d.ts +19 -0
- package/dist/commands/helpers/element-resolution.d.ts +2 -2
- package/dist/commands/helpers/event-waiting.d.ts +1 -1
- package/dist/commands/helpers/numeric-target-parser.d.ts +7 -0
- package/dist/commands/index.d.ts +34 -2
- package/dist/commands/index.js +19374 -4848
- package/dist/commands/index.mjs +19342 -4849
- package/dist/commands/navigation/go.d.ts +3 -0
- package/dist/commands/navigation/scroll-to.d.ts +26 -0
- package/dist/commands/utility/beep.d.ts +2 -2
- package/dist/commands/utility/breakpoint.d.ts +19 -0
- package/dist/commands/utility/pick.d.ts +11 -2
- package/dist/compatibility/browser-bundle-modular.d.ts +2 -2
- package/dist/compatibility/browser-bundle-multilingual.d.ts +1 -1
- package/dist/compatibility/browser-bundle-semantic-complete.d.ts +3 -3
- package/dist/compatibility/browser-bundle.d.ts +13 -6
- package/dist/compatibility/browser-modular.d.ts +1 -3
- package/dist/core/expression-evaluator.d.ts +4 -4
- package/dist/core/expression-registry.d.ts +8 -0
- package/dist/expressions/bundles/common-expressions.d.ts +2 -2
- package/dist/expressions/bundles/core-expressions.d.ts +2 -2
- package/dist/expressions/bundles/full-expressions.d.ts +2 -2
- package/dist/expressions/bundles/index.d.ts +3 -3
- package/dist/expressions/collection/index.d.ts +35 -0
- package/dist/expressions/conversion/impl/index.d.ts +1 -1
- package/dist/expressions/index.d.ts +4 -3
- package/dist/expressions/index.js +1117 -1590
- package/dist/expressions/index.mjs +1113 -1586
- package/dist/expressions/logical/index.d.ts +2 -0
- package/dist/expressions/mathematical/index.d.ts +11 -0
- package/dist/expressions/shared/index.d.ts +1 -1
- package/dist/expressions/shared/number-utils.d.ts +1 -0
- package/dist/htmx/htmx-attribute-processor.d.ts +37 -1
- package/dist/htmx/htmx-translator.d.ts +2 -0
- package/dist/htmx/i18n-hooks.d.ts +15 -0
- package/dist/htmx/i18n-orchestrator.d.ts +15 -0
- package/dist/htmx/lang-resolver.d.ts +3 -0
- package/dist/htmx/sse.d.ts +60 -0
- package/dist/htmx/ws.d.ts +59 -0
- package/dist/hyperfixi-browser-classic-i18n.js +2 -0
- package/dist/hyperfixi-browser-minimal.js +1 -0
- package/dist/hyperfixi-browser-standard.js +2 -0
- package/dist/hyperfixi-browser.js +2 -0
- package/dist/hyperfixi-classic-i18n.js +1 -1
- package/dist/hyperfixi-hx-v4.js +1 -0
- package/dist/hyperfixi-hx.js +1 -1
- package/dist/hyperfixi-hybrid-complete.js +1 -1
- package/dist/hyperfixi-hybrid-hx.js +1 -0
- package/dist/hyperfixi-minimal.js +1 -1
- package/dist/hyperfixi-multilingual.js +1 -1
- package/dist/hyperfixi-standard.js +1 -1
- package/dist/hyperfixi.js +1 -1
- package/dist/hyperfixi.mjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +43613 -45063
- package/dist/index.min.js +1 -1
- package/dist/index.mjs +43610 -45064
- package/dist/lib/index.d.ts +2 -2
- package/dist/lib/morph-adapter.d.ts +0 -13
- package/dist/lib/swap-executor.d.ts +0 -10
- package/dist/lib/view-transitions.d.ts +1 -30
- package/dist/lokascript-browser-classic-i18n.js +1 -1
- package/dist/lokascript-browser-minimal.js +1 -1
- package/dist/lokascript-browser-standard.js +1 -1
- package/dist/lokascript-browser.js +1 -1
- package/dist/lokascript-hybrid-complete.js +1 -1
- package/dist/lokascript-hybrid-hx.js +1 -1
- package/dist/lokascript-multilingual.js +1 -1
- package/dist/lsp-metadata.d.ts +9 -4
- package/dist/lsp-metadata.js +187 -3
- package/dist/lsp-metadata.mjs +185 -4
- package/dist/metadata.d.ts +1 -1
- package/dist/metadata.js +3 -3
- package/dist/metadata.mjs +3 -3
- package/dist/multilingual/bridge.d.ts +1 -1
- package/dist/multilingual/index.js +79 -22
- package/dist/multilingual/index.mjs +79 -22
- package/dist/parser/command-parsers/animation-commands.d.ts +1 -0
- package/dist/parser/command-parsers/utility-commands.d.ts +1 -0
- package/dist/parser/extensions.d.ts +51 -0
- package/dist/parser/full-parser.js +1224 -899
- package/dist/parser/full-parser.mjs +1224 -899
- package/dist/parser/helpers/ast-helpers.d.ts +1 -0
- package/dist/parser/helpers/parsing-helpers.d.ts +4 -0
- package/dist/parser/hybrid/index.js +7 -0
- package/dist/parser/hybrid/index.mjs +7 -0
- package/dist/parser/hybrid/parser-core.js +7 -0
- package/dist/parser/hybrid/parser-core.mjs +7 -0
- package/dist/parser/hybrid/tokenizer.js +7 -0
- package/dist/parser/hybrid/tokenizer.mjs +7 -0
- package/dist/parser/hybrid-parser.js +7 -0
- package/dist/parser/hybrid-parser.mjs +7 -0
- package/dist/parser/parser-types.d.ts +8 -28
- package/dist/parser/parser.d.ts +3 -7
- package/dist/parser/pratt-parser.d.ts +0 -3
- package/dist/parser/runtime.d.ts +4 -0
- package/dist/parser/semantic-integration.d.ts +17 -0
- package/dist/parser/types.d.ts +7 -1
- package/dist/reference/index.js +91 -0
- package/dist/reference/index.mjs +91 -0
- package/dist/registry/index.js +12866 -5876
- package/dist/registry/index.mjs +12866 -5876
- package/dist/registry/universal-types.d.ts +2 -1
- package/dist/runtime/command-adapter.d.ts +23 -16
- package/dist/runtime/plugin.d.ts +14 -0
- package/dist/runtime/runtime-base.d.ts +32 -7
- package/dist/runtime/runtime-factory.d.ts +3 -3
- package/dist/runtime/runtime.d.ts +2 -2
- package/dist/test-setup.d.ts +1 -0
- package/dist/types/base-types.d.ts +3 -0
- package/dist/types/feature-types.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/package.json +26 -20
- package/vocab/htmx/ar.js +60 -0
- package/vocab/htmx/bn.js +49 -0
- package/vocab/htmx/de.js +60 -0
- package/vocab/htmx/en.js +21 -0
- package/vocab/htmx/es.js +60 -0
- package/vocab/htmx/fr.js +59 -0
- package/vocab/htmx/he.js +40 -0
- package/vocab/htmx/hi.js +60 -0
- package/vocab/htmx/id.js +57 -0
- package/vocab/htmx/it.js +58 -0
- package/vocab/htmx/ja.js +60 -0
- package/vocab/htmx/ko.js +60 -0
- package/vocab/htmx/ms.js +35 -0
- package/vocab/htmx/pl.js +60 -0
- package/vocab/htmx/pt.js +60 -0
- package/vocab/htmx/qu.js +60 -0
- package/vocab/htmx/ru.js +60 -0
- package/vocab/htmx/sw.js +59 -0
- package/vocab/htmx/th.js +49 -0
- package/vocab/htmx/tl.js +33 -0
- package/vocab/htmx/tr.js +60 -0
- package/vocab/htmx/uk.js +60 -0
- package/vocab/htmx/vi.js +51 -0
- package/vocab/htmx/zh.js +60 -0
- package/dist/bundles/test-minimal.d.ts +0 -3
- package/dist/bundles/test-standard.d.ts +0 -3
- package/dist/chunks/bridge-BlRqsZT4.js +0 -2
- package/dist/chunks/browser-modular-AbV0Ql4i.js +0 -2
- package/dist/chunks/feature-eventsource-B5F2-H1r.js +0 -2
- package/dist/chunks/feature-webworker-3bAp0ac9.js +0 -2
- package/dist/chunks/index-BDYQHwCF.js +0 -2
- package/dist/compatibility/browser-bundle-minimal.d.ts +0 -8
- package/dist/compatibility/browser-bundle-standard.d.ts +0 -8
- package/dist/compatibility/hyperscript-tests/test-adapter.d.ts +0 -13
- package/dist/core/base-expression-evaluator.d.ts +0 -74
- package/dist/core/binary-expression-evaluator.d.ts +0 -7
- package/dist/core/call-expression-evaluator.d.ts +0 -7
- package/dist/core/configurable-expression-evaluator.d.ts +0 -5
- package/dist/core/lazy-expression-evaluator.d.ts +0 -22
- package/dist/core/parser.d.ts +0 -21
- package/dist/core/selector-evaluator.d.ts +0 -15
- package/dist/core/template-literal-evaluator.d.ts +0 -5
- package/dist/expressions/comparison/index.d.ts +0 -80
- package/dist/expressions/comparison/utils.d.ts +0 -2
- package/dist/expressions/conversion/impl/bridge.d.ts +0 -117
- package/dist/expressions/logical/impl/pattern-matching.d.ts +0 -58
- package/dist/expressions/positional/impl/bridge.d.ts +0 -95
- package/dist/expressions/property/index.d.ts +0 -55
- package/dist/expressions/references/impl/bridge.d.ts +0 -54
- package/dist/extensions/index.d.ts +0 -3
- package/dist/extensions/tailwind.d.ts +0 -22
- package/dist/mod.d.ts +0 -63
- package/dist/parser/expression-parser.d.ts +0 -6
- package/dist/runtime/runtime-experimental.d.ts +0 -18
- package/dist/scripts/code-generator.d.ts +0 -64
- package/dist/scripts/generate-missing-commands.d.ts +0 -4
package/README.md
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
# @lokascript/core
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
An experimental hyperscript engine that provides fast parsing, command execution, and comprehensive error handling for web applications. Built with TypeScript-first design and full compatibility with the official \_hyperscript library.
|
|
3
|
+
An experimental hyperscript engine that provides fast parsing, command execution, and comprehensive error handling for web applications. Built with TypeScript-first design.
|
|
6
4
|
|
|
7
5
|
## Features
|
|
8
6
|
|
|
9
|
-
- ๐ฏ
|
|
7
|
+
- ๐ฏ **\_hyperscript Compatible** - Tested via gallery examples, bundle compatibility matrix, and command/expression browser tests
|
|
10
8
|
- ๐ **High Performance** - Optimized tokenizer and parser for large expressions
|
|
11
9
|
- ๐ง **TypeScript First** - Complete type safety with comprehensive type definitions
|
|
12
10
|
- ๐งช **Thoroughly Tested** - 2800+ tests with 98.5%+ reliability
|
|
@@ -170,7 +168,7 @@ For complete API documentation, see [API.md](./docs/API.md).
|
|
|
170
168
|
- **Async Operations**: `wait 500ms`, `fetch "/api/data"`
|
|
171
169
|
- **Events**: `send customEvent to me`
|
|
172
170
|
|
|
173
|
-
### Expressions
|
|
171
|
+
### Expressions
|
|
174
172
|
|
|
175
173
|
- **Arithmetic**: `5 + 3 * 2`, `value / 2`, `x mod 3`
|
|
176
174
|
- **Logical**: `true and false`, `value > 10`, `x contains y`
|
|
@@ -204,14 +202,13 @@ npx playwright test --grep "Command Tests"
|
|
|
204
202
|
npx playwright test --grep "Expression Tests"
|
|
205
203
|
```
|
|
206
204
|
|
|
207
|
-
|
|
205
|
+
Compatibility is validated via Playwright browser tests:
|
|
208
206
|
|
|
209
|
-
- **
|
|
210
|
-
- **
|
|
211
|
-
- **
|
|
212
|
-
- **Overall compatibility**: **~95%** across all hyperscript features โ
|
|
207
|
+
- **Gallery examples** โ real hyperscript patterns load and execute without errors
|
|
208
|
+
- **Bundle compatibility matrix** โ each bundle size correctly supports its documented features
|
|
209
|
+
- **Command/expression tests** โ individual commands and expressions verified in browser context
|
|
213
210
|
|
|
214
|
-
|
|
211
|
+
Run `cd packages/core && npx playwright test` for the full browser test suite.
|
|
215
212
|
|
|
216
213
|
## License
|
|
217
214
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { ASTNode, ExecutionContext } from '../types/core';
|
|
2
|
-
import type { CompileResult } from './hyperscript-api';
|
|
3
|
-
type
|
|
4
|
-
type
|
|
5
|
-
type
|
|
2
|
+
import type { CompileResult, NewCompileOptions } from './hyperscript-api';
|
|
3
|
+
import type { Runtime } from '../runtime/runtime';
|
|
4
|
+
type CompileFunction = (code: string, options?: NewCompileOptions) => CompileResult;
|
|
5
|
+
type CompileAsyncFunction = (code: string, options?: NewCompileOptions) => Promise<CompileResult>;
|
|
6
|
+
type GetRuntimeFunction = () => Runtime;
|
|
7
|
+
export declare function setDOMProcessorConfig(cfg: {
|
|
8
|
+
logAll?: boolean;
|
|
9
|
+
}): void;
|
|
6
10
|
export declare function initializeDOMProcessor(compileSync: CompileFunction, compileAsync: CompileAsyncFunction, getRuntime: GetRuntimeFunction): void;
|
|
7
11
|
export declare function detectLanguage(element: Element): string;
|
|
8
12
|
export declare function extractEventInfo(ast: ASTNode): {
|
|
@@ -14,6 +14,7 @@ export interface HyperscriptConfig {
|
|
|
14
14
|
semantic: boolean;
|
|
15
15
|
language: string;
|
|
16
16
|
confidenceThreshold: number;
|
|
17
|
+
logAll: boolean;
|
|
17
18
|
}
|
|
18
19
|
export declare const config: HyperscriptConfig;
|
|
19
20
|
export interface CompileError {
|
|
@@ -30,7 +31,7 @@ export interface CompileResult {
|
|
|
30
31
|
ok: boolean;
|
|
31
32
|
ast?: ASTNode;
|
|
32
33
|
errors?: CompileError[];
|
|
33
|
-
lse?:
|
|
34
|
+
lse?: import('@lokascript/framework').SemanticNode;
|
|
34
35
|
meta: {
|
|
35
36
|
parser: 'semantic' | 'traditional' | 'lse';
|
|
36
37
|
confidence?: number;
|
|
@@ -50,15 +51,18 @@ export interface HyperscriptAPI {
|
|
|
50
51
|
eval(code: string, context?: ExecutionContext | Element, options?: NewCompileOptions): Promise<unknown>;
|
|
51
52
|
validate(code: string, options?: NewCompileOptions): Promise<ValidateResult>;
|
|
52
53
|
process(element: Element): void;
|
|
54
|
+
cleanup(element: Element): number;
|
|
53
55
|
createContext(element?: HTMLElement | null, parent?: ExecutionContext): ExecutionContext;
|
|
54
56
|
version: string;
|
|
55
57
|
config: HyperscriptConfig;
|
|
56
58
|
createRuntime(options?: RuntimeOptions): Runtime;
|
|
59
|
+
getDefaultRuntime(): Runtime;
|
|
57
60
|
registerHooks(name: string, hooks: RuntimeHooks): void;
|
|
58
61
|
unregisterHooks(name: string): boolean;
|
|
59
62
|
getRegisteredHooks(): string[];
|
|
60
63
|
debug: DebugController;
|
|
61
64
|
evalLSE(lse: string, element?: Element): Promise<unknown>;
|
|
65
|
+
evalLSENode(node: import('@lokascript/framework').SemanticNode, element?: Element): Promise<unknown>;
|
|
62
66
|
compileLSE(lse: string): Promise<CompileResult>;
|
|
63
67
|
toLSE(code: string, language?: string): Promise<string>;
|
|
64
68
|
fromLSE(lse: string, language: string): Promise<string>;
|