@hyperfixi/core 3.2.0 → 3.3.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/bundle-generator/index.cjs +12 -8
- package/dist/bundle-generator/index.mjs +12 -8
- package/dist/chunks/{bridge-Cnj8dQFV.js → bridge-CI9SOl8u.js} +2 -2
- package/dist/chunks/browser-modular-7CpI5VF2.js +2 -0
- package/dist/chunks/{index-LLuwEQp0.js → index-BwXDEK0m.js} +2 -2
- package/dist/commands/index.cjs +9 -0
- package/dist/commands/index.mjs +9 -0
- 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-hx.js +1 -1
- package/dist/hyperfixi-hybrid-complete.js +1 -1
- package/dist/hyperfixi-hybrid-hx.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 +10 -1
- package/dist/index.min.js +1 -1
- package/dist/index.mjs +10 -1
- package/dist/lokascript-browser-classic-i18n.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/metadata.cjs +1 -1
- package/dist/metadata.d.ts +1 -1
- package/dist/metadata.mjs +1 -1
- package/dist/parser/full-parser.cjs +9 -0
- package/dist/parser/full-parser.mjs +9 -0
- package/dist/registry/index.cjs +9 -0
- package/dist/registry/index.mjs +9 -0
- package/dist/version.d.ts +1 -1
- package/package.json +5 -5
- package/dist/chunks/browser-modular-BNDYF6Dq.js +0 -2
|
@@ -323,13 +323,15 @@ const COMMAND_IMPLEMENTATIONS_TS = {
|
|
|
323
323
|
return newVal;
|
|
324
324
|
}
|
|
325
325
|
|
|
326
|
-
if (target.type === 'possessive'
|
|
326
|
+
if (target.type === 'possessive') {
|
|
327
|
+
const style = isStyleProp(target.property);
|
|
327
328
|
const obj = await evaluate(target.object, ctx);
|
|
328
329
|
const elements = toElementArray(obj);
|
|
329
330
|
for (const el of elements) {
|
|
330
|
-
const
|
|
331
|
-
const newVal =
|
|
332
|
-
setStyleProp(el, target.property, newVal);
|
|
331
|
+
const was = style ? getStyleProp(el, target.property) : Reflect.get(el, target.property);
|
|
332
|
+
const newVal = (parseFloat(was || '0') || 0) + amount;
|
|
333
|
+
if (style) setStyleProp(el, target.property, newVal);
|
|
334
|
+
else Reflect.set(el, target.property, newVal);
|
|
333
335
|
ctx.it = newVal;
|
|
334
336
|
}
|
|
335
337
|
return ctx.it;
|
|
@@ -359,13 +361,15 @@ const COMMAND_IMPLEMENTATIONS_TS = {
|
|
|
359
361
|
return newVal;
|
|
360
362
|
}
|
|
361
363
|
|
|
362
|
-
if (target.type === 'possessive'
|
|
364
|
+
if (target.type === 'possessive') {
|
|
365
|
+
const style = isStyleProp(target.property);
|
|
363
366
|
const obj = await evaluate(target.object, ctx);
|
|
364
367
|
const elements = toElementArray(obj);
|
|
365
368
|
for (const el of elements) {
|
|
366
|
-
const
|
|
367
|
-
const newVal =
|
|
368
|
-
setStyleProp(el, target.property, newVal);
|
|
369
|
+
const was = style ? getStyleProp(el, target.property) : Reflect.get(el, target.property);
|
|
370
|
+
const newVal = (parseFloat(was || '0') || 0) - amount;
|
|
371
|
+
if (style) setStyleProp(el, target.property, newVal);
|
|
372
|
+
else Reflect.set(el, target.property, newVal);
|
|
369
373
|
ctx.it = newVal;
|
|
370
374
|
}
|
|
371
375
|
return ctx.it;
|
|
@@ -321,13 +321,15 @@ const COMMAND_IMPLEMENTATIONS_TS = {
|
|
|
321
321
|
return newVal;
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
-
if (target.type === 'possessive'
|
|
324
|
+
if (target.type === 'possessive') {
|
|
325
|
+
const style = isStyleProp(target.property);
|
|
325
326
|
const obj = await evaluate(target.object, ctx);
|
|
326
327
|
const elements = toElementArray(obj);
|
|
327
328
|
for (const el of elements) {
|
|
328
|
-
const
|
|
329
|
-
const newVal =
|
|
330
|
-
setStyleProp(el, target.property, newVal);
|
|
329
|
+
const was = style ? getStyleProp(el, target.property) : Reflect.get(el, target.property);
|
|
330
|
+
const newVal = (parseFloat(was || '0') || 0) + amount;
|
|
331
|
+
if (style) setStyleProp(el, target.property, newVal);
|
|
332
|
+
else Reflect.set(el, target.property, newVal);
|
|
331
333
|
ctx.it = newVal;
|
|
332
334
|
}
|
|
333
335
|
return ctx.it;
|
|
@@ -357,13 +359,15 @@ const COMMAND_IMPLEMENTATIONS_TS = {
|
|
|
357
359
|
return newVal;
|
|
358
360
|
}
|
|
359
361
|
|
|
360
|
-
if (target.type === 'possessive'
|
|
362
|
+
if (target.type === 'possessive') {
|
|
363
|
+
const style = isStyleProp(target.property);
|
|
361
364
|
const obj = await evaluate(target.object, ctx);
|
|
362
365
|
const elements = toElementArray(obj);
|
|
363
366
|
for (const el of elements) {
|
|
364
|
-
const
|
|
365
|
-
const newVal =
|
|
366
|
-
setStyleProp(el, target.property, newVal);
|
|
367
|
+
const was = style ? getStyleProp(el, target.property) : Reflect.get(el, target.property);
|
|
368
|
+
const newVal = (parseFloat(was || '0') || 0) - amount;
|
|
369
|
+
if (style) setStyleProp(el, target.property, newVal);
|
|
370
|
+
else Reflect.set(el, target.property, newVal);
|
|
367
371
|
ctx.it = newVal;
|
|
368
372
|
}
|
|
369
373
|
return ctx.it;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{D as n,d as e}from"./browser-modular-
|
|
2
|
-
//# sourceMappingURL=bridge-
|
|
1
|
+
import{D as n,d as e}from"./browser-modular-7CpI5VF2.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-BwXDEK0m.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-CI9SOl8u.js.map
|