@hyperfixi/core 3.0.0 → 3.1.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/dist/api/hyperscript-api.d.ts +2 -0
- package/dist/ast-utils/{index.js → index.cjs} +1 -1
- package/dist/behaviors/{index.js → index.cjs} +1 -1
- package/dist/bundle-generator/{index.js → index.cjs} +1 -1
- package/dist/chunks/bridge-DylVo1oZ.js +2 -0
- package/dist/chunks/browser-modular-sLPMdxR7.js +2 -0
- package/dist/chunks/index-C7lqD4mo.js +2 -0
- package/dist/commands/{index.js → index.cjs} +39 -1
- package/dist/commands/index.mjs +38 -0
- package/dist/dom/attribute-processor.d.ts +35 -1
- package/dist/dom/detect-language.d.ts +3 -0
- package/dist/expressions/{index.js → index.cjs} +1 -1
- package/dist/hyperfixi-browser-classic-i18n.js +1 -1
- package/dist/hyperfixi-browser.js +1 -1
- package/dist/hyperfixi-classic-i18n.js +1 -1
- package/dist/hyperfixi-hx-v4.js +1 -1
- package/dist/hyperfixi-multilingual.js +1 -1
- package/dist/hyperfixi.js +1 -1
- package/dist/hyperfixi.mjs +1 -1
- package/dist/index.cjs +28495 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.min.js +1 -1
- package/dist/index.mjs +630 -57829
- package/dist/lokascript-browser-classic-i18n.js +1 -1
- package/dist/lokascript-browser.js +1 -1
- package/dist/lokascript-multilingual.js +1 -1
- package/dist/lse/{index.js → index.cjs} +1 -1
- package/dist/{lsp-metadata.js → lsp-metadata.cjs} +1 -1
- package/dist/{metadata.js → metadata.cjs} +2 -2
- package/dist/metadata.d.ts +1 -1
- package/dist/metadata.mjs +1 -1
- package/dist/multilingual/bridge.d.ts +2 -0
- package/dist/multilingual/{index.js → index.cjs} +3 -105
- package/dist/multilingual/index.mjs +1 -103
- package/dist/parser/{full-parser.js → full-parser.cjs} +39 -1
- package/dist/parser/full-parser.mjs +38 -0
- package/dist/parser/hybrid/{aliases.js → aliases.cjs} +1 -1
- package/dist/parser/hybrid/ast-types.cjs +3 -0
- package/dist/parser/hybrid/{index.js → index.cjs} +1 -1
- package/dist/parser/hybrid/{parser-core.js → parser-core.cjs} +1 -1
- package/dist/parser/hybrid/{tokenizer.js → tokenizer.cjs} +1 -1
- package/dist/parser/{hybrid-parser.js → hybrid-parser.cjs} +1 -1
- package/dist/parser/{regex-parser.js → regex-parser.cjs} +1 -1
- package/dist/parser/semantic-integration.d.ts +15 -0
- package/dist/reference/{index.js → index.cjs} +1 -1
- package/dist/registry/{browser-types.js → browser-types.cjs} +1 -1
- package/dist/registry/{environment.js → environment.cjs} +1 -1
- package/dist/registry/{index.js → index.cjs} +39 -1
- package/dist/registry/index.mjs +38 -0
- package/dist/registry/{universal-types.js → universal-types.cjs} +1 -1
- package/dist/runtime/runtime-base.d.ts +1 -0
- package/dist/runtime/runtime.d.ts +1 -0
- package/dist/version.d.ts +1 -1
- package/package.json +28 -28
- package/dist/api/dom-processor.d.ts +0 -21
- package/dist/chunks/bridge-8SRzBI2K.js +0 -2
- package/dist/chunks/browser-modular-L1qgqF_N.js +0 -2
- package/dist/chunks/index-SorDzXmq.js +0 -2
- package/dist/index.js +0 -85694
- package/dist/parser/hybrid/ast-types.js +0 -3
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperfixi/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Multilingual, tree-shakeable hyperscript",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/index.
|
|
6
|
+
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.mjs",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"import": "./dist/index.mjs",
|
|
13
|
-
"require": "./dist/index.
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
14
|
},
|
|
15
15
|
"./browser": {
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
@@ -32,47 +32,47 @@
|
|
|
32
32
|
"./commands": {
|
|
33
33
|
"types": "./dist/commands/index.d.ts",
|
|
34
34
|
"import": "./dist/commands/index.mjs",
|
|
35
|
-
"require": "./dist/commands/index.
|
|
35
|
+
"require": "./dist/commands/index.cjs"
|
|
36
36
|
},
|
|
37
37
|
"./expressions": {
|
|
38
38
|
"types": "./dist/expressions/index.d.ts",
|
|
39
39
|
"import": "./dist/expressions/index.mjs",
|
|
40
|
-
"require": "./dist/expressions/index.
|
|
40
|
+
"require": "./dist/expressions/index.cjs"
|
|
41
41
|
},
|
|
42
42
|
"./parser/full": {
|
|
43
43
|
"types": "./dist/parser/full-parser.d.ts",
|
|
44
44
|
"import": "./dist/parser/full-parser.mjs",
|
|
45
|
-
"require": "./dist/parser/full-parser.
|
|
45
|
+
"require": "./dist/parser/full-parser.cjs"
|
|
46
46
|
},
|
|
47
47
|
"./parser/hybrid": {
|
|
48
48
|
"types": "./dist/parser/hybrid-parser.d.ts",
|
|
49
49
|
"import": "./dist/parser/hybrid-parser.mjs",
|
|
50
|
-
"require": "./dist/parser/hybrid-parser.
|
|
50
|
+
"require": "./dist/parser/hybrid-parser.cjs"
|
|
51
51
|
},
|
|
52
52
|
"./parser/hybrid/parser-core": {
|
|
53
53
|
"types": "./dist/parser/hybrid/parser-core.d.ts",
|
|
54
54
|
"import": "./dist/parser/hybrid/parser-core.mjs",
|
|
55
|
-
"require": "./dist/parser/hybrid/parser-core.
|
|
55
|
+
"require": "./dist/parser/hybrid/parser-core.cjs"
|
|
56
56
|
},
|
|
57
57
|
"./parser/hybrid/ast-types": {
|
|
58
58
|
"types": "./dist/parser/hybrid/ast-types.d.ts",
|
|
59
59
|
"import": "./dist/parser/hybrid/ast-types.mjs",
|
|
60
|
-
"require": "./dist/parser/hybrid/ast-types.
|
|
60
|
+
"require": "./dist/parser/hybrid/ast-types.cjs"
|
|
61
61
|
},
|
|
62
62
|
"./parser/hybrid/tokenizer": {
|
|
63
63
|
"types": "./dist/parser/hybrid/tokenizer.d.ts",
|
|
64
64
|
"import": "./dist/parser/hybrid/tokenizer.mjs",
|
|
65
|
-
"require": "./dist/parser/hybrid/tokenizer.
|
|
65
|
+
"require": "./dist/parser/hybrid/tokenizer.cjs"
|
|
66
66
|
},
|
|
67
67
|
"./parser/hybrid/aliases": {
|
|
68
68
|
"types": "./dist/parser/hybrid/aliases.d.ts",
|
|
69
69
|
"import": "./dist/parser/hybrid/aliases.mjs",
|
|
70
|
-
"require": "./dist/parser/hybrid/aliases.
|
|
70
|
+
"require": "./dist/parser/hybrid/aliases.cjs"
|
|
71
71
|
},
|
|
72
72
|
"./parser/regex": {
|
|
73
73
|
"types": "./dist/parser/regex-parser.d.ts",
|
|
74
74
|
"import": "./dist/parser/regex-parser.mjs",
|
|
75
|
-
"require": "./dist/parser/regex-parser.
|
|
75
|
+
"require": "./dist/parser/regex-parser.cjs"
|
|
76
76
|
},
|
|
77
77
|
"./browser/modular": {
|
|
78
78
|
"default": "./dist/hyperfixi.mjs"
|
|
@@ -80,63 +80,63 @@
|
|
|
80
80
|
"./behaviors": {
|
|
81
81
|
"types": "./dist/behaviors/index.d.ts",
|
|
82
82
|
"import": "./dist/behaviors/index.mjs",
|
|
83
|
-
"require": "./dist/behaviors/index.
|
|
83
|
+
"require": "./dist/behaviors/index.cjs"
|
|
84
84
|
},
|
|
85
85
|
"./multilingual": {
|
|
86
86
|
"types": "./dist/multilingual/index.d.ts",
|
|
87
87
|
"import": "./dist/multilingual/index.mjs",
|
|
88
|
-
"require": "./dist/multilingual/index.
|
|
88
|
+
"require": "./dist/multilingual/index.cjs"
|
|
89
89
|
},
|
|
90
90
|
"./bundle-generator": {
|
|
91
91
|
"types": "./dist/bundle-generator/index.d.ts",
|
|
92
92
|
"import": "./dist/bundle-generator/index.mjs",
|
|
93
|
-
"require": "./dist/bundle-generator/index.
|
|
93
|
+
"require": "./dist/bundle-generator/index.cjs"
|
|
94
94
|
},
|
|
95
95
|
"./registry": {
|
|
96
96
|
"types": "./dist/registry/index.d.ts",
|
|
97
97
|
"import": "./dist/registry/index.mjs",
|
|
98
|
-
"require": "./dist/registry/index.
|
|
98
|
+
"require": "./dist/registry/index.cjs"
|
|
99
99
|
},
|
|
100
100
|
"./registry/browser": {
|
|
101
101
|
"types": "./dist/registry/browser-types.d.ts",
|
|
102
102
|
"import": "./dist/registry/browser-types.mjs",
|
|
103
|
-
"require": "./dist/registry/browser-types.
|
|
103
|
+
"require": "./dist/registry/browser-types.cjs"
|
|
104
104
|
},
|
|
105
105
|
"./registry/universal": {
|
|
106
106
|
"types": "./dist/registry/universal-types.d.ts",
|
|
107
107
|
"import": "./dist/registry/universal-types.mjs",
|
|
108
|
-
"require": "./dist/registry/universal-types.
|
|
108
|
+
"require": "./dist/registry/universal-types.cjs"
|
|
109
109
|
},
|
|
110
110
|
"./registry/environment": {
|
|
111
111
|
"types": "./dist/registry/environment.d.ts",
|
|
112
112
|
"import": "./dist/registry/environment.mjs",
|
|
113
|
-
"require": "./dist/registry/environment.
|
|
113
|
+
"require": "./dist/registry/environment.cjs"
|
|
114
114
|
},
|
|
115
115
|
"./package.json": "./package.json",
|
|
116
116
|
"./reference": {
|
|
117
117
|
"types": "./dist/reference/index.d.ts",
|
|
118
118
|
"import": "./dist/reference/index.mjs",
|
|
119
|
-
"require": "./dist/reference/index.
|
|
119
|
+
"require": "./dist/reference/index.cjs"
|
|
120
120
|
},
|
|
121
121
|
"./metadata": {
|
|
122
122
|
"types": "./dist/metadata.d.ts",
|
|
123
123
|
"import": "./dist/metadata.mjs",
|
|
124
|
-
"require": "./dist/metadata.
|
|
124
|
+
"require": "./dist/metadata.cjs"
|
|
125
125
|
},
|
|
126
126
|
"./lsp-metadata": {
|
|
127
127
|
"types": "./dist/lsp-metadata.d.ts",
|
|
128
128
|
"import": "./dist/lsp-metadata.mjs",
|
|
129
|
-
"require": "./dist/lsp-metadata.
|
|
129
|
+
"require": "./dist/lsp-metadata.cjs"
|
|
130
130
|
},
|
|
131
131
|
"./ast-utils": {
|
|
132
132
|
"types": "./dist/ast-utils/index.d.ts",
|
|
133
133
|
"import": "./dist/ast-utils/index.mjs",
|
|
134
|
-
"require": "./dist/ast-utils/index.
|
|
134
|
+
"require": "./dist/ast-utils/index.cjs"
|
|
135
135
|
},
|
|
136
136
|
"./lse": {
|
|
137
137
|
"types": "./dist/lse/index.d.ts",
|
|
138
138
|
"import": "./dist/lse/index.mjs",
|
|
139
|
-
"require": "./dist/lse/index.
|
|
139
|
+
"require": "./dist/lse/index.cjs"
|
|
140
140
|
}
|
|
141
141
|
},
|
|
142
142
|
"files": [
|
|
@@ -271,14 +271,14 @@
|
|
|
271
271
|
"access": "public"
|
|
272
272
|
},
|
|
273
273
|
"dependencies": {
|
|
274
|
-
"@lokascript/intent": "^3.
|
|
275
|
-
"@lokascript/semantic": "^3.
|
|
274
|
+
"@lokascript/intent": "^3.1.0",
|
|
275
|
+
"@lokascript/semantic": "^3.1.0",
|
|
276
276
|
"morphlex": "^1.4.0",
|
|
277
277
|
"tslib": "^2.8.1"
|
|
278
278
|
},
|
|
279
279
|
"peerDependencies": {
|
|
280
|
-
"@hyperfixi/patterns-reference": "^3.
|
|
281
|
-
"@lokascript/framework": "^3.
|
|
280
|
+
"@hyperfixi/patterns-reference": "^3.1.0",
|
|
281
|
+
"@lokascript/framework": "^3.1.0"
|
|
282
282
|
},
|
|
283
283
|
"peerDependenciesMeta": {
|
|
284
284
|
"@hyperfixi/patterns-reference": {
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ASTNode, ExecutionContext } from '../types/core';
|
|
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;
|
|
10
|
-
export declare function initializeDOMProcessor(compileSync: CompileFunction, compileAsync: CompileAsyncFunction, getRuntime: GetRuntimeFunction): void;
|
|
11
|
-
export declare function detectLanguage(element: Element): string;
|
|
12
|
-
export declare function extractEventInfo(ast: ASTNode): {
|
|
13
|
-
eventType: string;
|
|
14
|
-
body: ASTNode;
|
|
15
|
-
} | null;
|
|
16
|
-
export declare function setupEventHandler(element: Element, ast: ASTNode, context: ExecutionContext): void;
|
|
17
|
-
export declare function createHyperscriptContext(element?: HTMLElement | null): ExecutionContext;
|
|
18
|
-
export declare function processHyperscriptAttribute(element: Element, hyperscriptCode: string): void;
|
|
19
|
-
export declare function process(element: Element): void;
|
|
20
|
-
export {};
|
|
21
|
-
//# sourceMappingURL=dom-processor.d.ts.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{D as n,d as i}from"./browser-modular-L1qgqF_N.js";function e(n){const i=n.diagnostics;return i?.length?i.filter(n=>"unconsumed-input"===n.code).map(n=>n.message):[]}let t=null;async function a(){return t||(t=await import("./index-SorDzXmq.js")),t}class c{constructor(i={}){this._initialized=!1,this.config={confidenceThreshold:i.confidenceThreshold??n,fallbackOnLowConfidence:i.fallbackOnLowConfidence??!0}}async initialize(){await a(),this._initialized=!0}isInitialized(){return this._initialized}async transform(n,i,e){if(this.isInitialized()||await this.initialize(),i===e)return{output:n,usedSemantic:!1,confidence:1,sourceLang:i,targetLang:e};const t=await a();try{const a=t.translate(n,i,e);if(a!==n)return{output:a,usedSemantic:!0,confidence:.9,sourceLang:i,targetLang:e}}catch{}return{output:n,usedSemantic:!1,confidence:0,sourceLang:i,targetLang:e}}async parse(n,i){this.isInitialized()||await this.initialize();return(await a()).parseSemantic(n,i).node??null}async render(n,i){return(await a()).render(n,i)}async parseToAST(n,i){this.isInitialized()||await this.initialize();const e=await a(),t=e.parseSemantic(n,i);if(t.confidence>=this.config.confidenceThreshold&&t.node)try{return e.buildAST(t.node).ast}catch(n){}return null}async parseToASTWithDetails(n,i){this.isInitialized()||await this.initialize();const t=await a(),c=t.parseSemantic(n,i);if(c.confidence>=this.config.confidenceThreshold&&c.node)try{const n=t.buildAST(c.node);return{ast:n.ast,usedDirectPath:!0,confidence:c.confidence,lang:i,fallbackText:null,warnings:[...n.warnings??[],...e(c.node)]}}catch{}if(c.node&&this.config.fallbackOnLowConfidence){const n=t.render(c.node,"en");return{ast:null,usedDirectPath:!1,confidence:c.confidence,lang:i,fallbackText:n}}return{ast:null,usedDirectPath:!1,confidence:c.confidence,lang:i,fallbackText:null}}async getAllTranslations(n,i){const e=(await a()).getSupportedLanguages(),t={};for(const a of e)t[a]=await this.transform(n,i,a);return t}}export{c as SemanticGrammarBridge};
|
|
2
|
-
//# sourceMappingURL=bridge-8SRzBI2K.js.map
|