@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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Runtime, type RuntimeOptions } from '../runtime/runtime';
|
|
2
2
|
import type { ASTNode, ExecutionContext } from '../types/base-types';
|
|
3
3
|
import type { RuntimeHooks } from '../types/hooks';
|
|
4
|
+
import type { FrontEnd } from '../parser/semantic-integration';
|
|
4
5
|
import { type ConversionConfig } from '../expressions/conversion';
|
|
5
6
|
import { DebugController } from '../debug/debug-controller';
|
|
6
7
|
declare global {
|
|
@@ -76,6 +77,7 @@ export interface HyperscriptAPI {
|
|
|
76
77
|
toLSE(code: string, language?: string): Promise<string>;
|
|
77
78
|
fromLSE(lse: string, language: string): Promise<string>;
|
|
78
79
|
clearCache(): void;
|
|
80
|
+
use(frontEnd: FrontEnd): void;
|
|
79
81
|
getCacheStats(): {
|
|
80
82
|
size: number;
|
|
81
83
|
hits: number;
|
|
@@ -1133,4 +1133,4 @@ exports.historySwapHyperscript = historySwapHyperscript;
|
|
|
1133
1133
|
exports.registerAllBehaviors = registerAllBehaviors;
|
|
1134
1134
|
exports.registerBoosted = registerBoosted;
|
|
1135
1135
|
exports.registerHistorySwap = registerHistorySwap;
|
|
1136
|
-
//# sourceMappingURL=index.
|
|
1136
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -2782,4 +2782,4 @@ exports.isAvailableBlock = isAvailableBlock;
|
|
|
2782
2782
|
exports.isAvailableCommand = isAvailableCommand;
|
|
2783
2783
|
exports.requiresFullRuntime = requiresFullRuntime;
|
|
2784
2784
|
exports.resolveCommandKey = resolveCommandKey;
|
|
2785
|
-
//# sourceMappingURL=index.
|
|
2785
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{D as n,d as e}from"./browser-modular-sLPMdxR7.js";function i(n){const e=n.diagnostics;return e?.length?e.filter(n=>"unconsumed-input"===n.code).map(n=>n.message):[]}let t=null;async function a(){return t||(t=await import("./index-C7lqD4mo.js")),t}class s{constructor(e={}){this._initialized=!1,this.config={confidenceThreshold:e.confidenceThreshold??n,fallbackOnLowConfidence:e.fallbackOnLowConfidence??!0}}async initialize(){await a(),this._initialized=!0}isInitialized(){return this._initialized}async transform(n,e,i){if(this.isInitialized()||await this.initialize(),e===i)return{output:n,usedSemantic:!1,confidence:1,sourceLang:e,targetLang:i};const t=await a();try{const a=t.translate(n,e,i);if(a!==n)return{output:a,usedSemantic:!0,confidence:.9,sourceLang:e,targetLang:i}}catch{}return{output:n,usedSemantic:!1,confidence:0,sourceLang:e,targetLang:i}}async parse(n,e){this.isInitialized()||await this.initialize();return(await a()).parseSemantic(n,e).node??null}async render(n,e){return(await a()).render(n,e)}async parseToAST(n,e){this.isInitialized()||await this.initialize();const i=await a(),t=i.parseSemantic(n,e);if(t.confidence>=this.config.confidenceThreshold&&t.node)try{return i.buildAST(t.node).ast}catch(n){}return null}async parseToASTWithDetails(n,e){this.isInitialized()||await this.initialize();const t=await a(),s=t.parseSemantic(n,e);if(s.confidence>=this.config.confidenceThreshold&&s.node)try{const n=t.buildAST(s.node);return{ast:n.ast,usedDirectPath:!0,confidence:s.confidence,lang:e,fallbackText:null,warnings:[...n.warnings??[],...i(s.node)]}}catch{}if(s.node&&this.config.fallbackOnLowConfidence){const n=t.render(s.node,"en");return{ast:null,usedDirectPath:!1,confidence:s.confidence,lang:e,fallbackText:n}}return{ast:null,usedDirectPath:!1,confidence:s.confidence,lang:e,fallbackText:null}}async getAllTranslations(n,e){const i=(await a()).getSupportedLanguages(),t={};for(const a of i)t[a]=await this.transform(n,e,a);return t}}function c(n){return{name:"semantic-bridge",parseToAST:(e,i)=>n.parseToASTWithDetails(e,i),parse:(e,i)=>n.parse(e,i),render:(e,i)=>n.render(e,i)}}export{s as SemanticGrammarBridge,c as createBridgeFrontEnd};
|
|
2
|
+
//# sourceMappingURL=bridge-DylVo1oZ.js.map
|