@hyperfixi/core 2.7.0 → 2.7.2
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/behaviors/index.js +10 -1
- package/dist/behaviors/index.mjs +10 -1
- package/dist/chunks/{bridge-lZbOVRDD.js → bridge-DuveK8T4.js} +2 -2
- package/dist/chunks/browser-modular-DW4nC6lH.js +2 -0
- package/dist/chunks/{index-i_j9Z-1e.js → index-D2WUNSCR.js} +2 -2
- package/dist/commands/index.js +10 -1
- package/dist/commands/index.mjs +10 -1
- package/dist/hyperfixi-browser.js +1 -1
- package/dist/hyperfixi-hx-v4.js +1 -1
- package/dist/hyperfixi.js +1 -1
- package/dist/hyperfixi.mjs +1 -1
- package/dist/index.js +10 -1
- package/dist/index.min.js +1 -1
- package/dist/index.mjs +10 -1
- package/dist/lib/dom-globals-shim.d.ts +2 -0
- package/dist/lokascript-browser.js +1 -1
- package/package.json +6 -6
- package/dist/chunks/browser-modular-DegkWQ8d.js +0 -2
package/dist/behaviors/index.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
function ensureDomGlobals() {
|
|
4
|
+
if (typeof globalThis.Element === 'undefined') {
|
|
5
|
+
globalThis.Element = class {
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
ensureDomGlobals();
|
|
11
|
+
|
|
3
12
|
// src/morphlex.ts
|
|
4
13
|
var SUPPORTS_MOVE_BEFORE = "moveBefore" in Element.prototype;
|
|
5
14
|
var ELEMENT_NODE_TYPE = 1;
|
|
@@ -551,7 +560,7 @@ function longestIncreasingSubsequence(sequence) {
|
|
|
551
560
|
//# debugId=3F4BCB911DEC843864756E2164756E21
|
|
552
561
|
|
|
553
562
|
function toMorphlexOptions(options) {
|
|
554
|
-
return { preserveChanges: options?.preserveChanges ?? true };
|
|
563
|
+
return { preserveChanges: (options?.preserveChanges ?? true) };
|
|
555
564
|
}
|
|
556
565
|
const morphAdapter = {
|
|
557
566
|
morph(target, content, options) {
|
package/dist/behaviors/index.mjs
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
function ensureDomGlobals() {
|
|
2
|
+
if (typeof globalThis.Element === 'undefined') {
|
|
3
|
+
globalThis.Element = class {
|
|
4
|
+
};
|
|
5
|
+
}
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
ensureDomGlobals();
|
|
9
|
+
|
|
1
10
|
// src/morphlex.ts
|
|
2
11
|
var SUPPORTS_MOVE_BEFORE = "moveBefore" in Element.prototype;
|
|
3
12
|
var ELEMENT_NODE_TYPE = 1;
|
|
@@ -549,7 +558,7 @@ function longestIncreasingSubsequence(sequence) {
|
|
|
549
558
|
//# debugId=3F4BCB911DEC843864756E2164756E21
|
|
550
559
|
|
|
551
560
|
function toMorphlexOptions(options) {
|
|
552
|
-
return { preserveChanges: options?.preserveChanges ?? true };
|
|
561
|
+
return { preserveChanges: (options?.preserveChanges ?? true) };
|
|
553
562
|
}
|
|
554
563
|
const morphAdapter = {
|
|
555
564
|
morph(target, content, options) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{D as n,d as i}from"./browser-modular-
|
|
2
|
-
//# sourceMappingURL=bridge-
|
|
1
|
+
import{D as n,d as i}from"./browser-modular-DW4nC6lH.js";import"./feature-sockets-CrYvjZ4j.js";let e=null;async function t(){return e||(e=await import("./browser-modular-DW4nC6lH.js").then(function(n){return n.n})),e}class a{constructor(i={}){this._initialized=!1,this.config={confidenceThreshold:i.confidenceThreshold??n,fallbackOnLowConfidence:i.fallbackOnLowConfidence??!0}}async initialize(){await t(),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 a=await t();try{const t=a.translate(n,i,e);if(t!==n)return{output:t,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 t()).parseSemantic(n,i).node??null}async render(n,i){return(await t()).render(n,i)}async parseToAST(n,i){this.isInitialized()||await this.initialize();const e=await t(),a=e.parseSemantic(n,i);if(a.confidence>=this.config.confidenceThreshold&&a.node)try{return e.buildAST(a.node).ast}catch(n){}return null}async parseToASTWithDetails(n,i){this.isInitialized()||await this.initialize();const e=await t(),a=e.parseSemantic(n,i);if(a.confidence>=this.config.confidenceThreshold&&a.node)try{const n=e.buildAST(a.node);return{ast:n.ast,usedDirectPath:!0,confidence:a.confidence,lang:i,fallbackText:null,warnings:n.warnings}}catch{}if(a.node&&this.config.fallbackOnLowConfidence){const n=e.render(a.node,"en");return{ast:null,usedDirectPath:!1,confidence:a.confidence,lang:i,fallbackText:n}}return{ast:null,usedDirectPath:!1,confidence:a.confidence,lang:i,fallbackText:null}}async getAllTranslations(n,i){const e=(await t()).getSupportedLanguages(),a={};for(const t of e)a[t]=await this.transform(n,i,t);return a}}export{a as SemanticGrammarBridge};
|
|
2
|
+
//# sourceMappingURL=bridge-DuveK8T4.js.map
|