@drincs/pixi-vn-json 1.6.3 → 1.7.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/importer.cjs +1 -0
- package/dist/importer.d.cts +613 -0
- package/dist/importer.d.ts +613 -0
- package/dist/importer.mjs +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +608 -19
- package/dist/index.d.ts +608 -19
- package/dist/index.mjs +3 -0
- package/dist/unifier.cjs +1 -0
- package/dist/unifier.d.cts +594 -0
- package/dist/unifier.d.ts +594 -0
- package/dist/unifier.mjs +1 -0
- package/package.json +26 -3
- package/dist/PixiVNJsonConditionalStatements-S3pFEkW9.d.cts +0 -249
- package/dist/PixiVNJsonConditionalStatements-S3pFEkW9.d.ts +0 -249
- package/dist/classes/LabelJson.cjs +0 -3
- package/dist/classes/LabelJson.d.cts +0 -44
- package/dist/classes/LabelJson.d.ts +0 -44
- package/dist/classes/LabelJson.js +0 -3
- package/dist/classes/index.cjs +0 -3
- package/dist/classes/index.d.cts +0 -12
- package/dist/classes/index.d.ts +0 -12
- package/dist/classes/index.js +0 -3
- package/dist/constants.cjs +0 -1
- package/dist/constants.d.cts +0 -3
- package/dist/constants.d.ts +0 -3
- package/dist/constants.js +0 -1
- package/dist/functions/assets.cjs +0 -3
- package/dist/functions/assets.d.cts +0 -14
- package/dist/functions/assets.d.ts +0 -14
- package/dist/functions/assets.js +0 -3
- package/dist/functions/importer.cjs +0 -3
- package/dist/functions/importer.d.cts +0 -24
- package/dist/functions/importer.d.ts +0 -24
- package/dist/functions/importer.js +0 -3
- package/dist/functions/index.cjs +0 -3
- package/dist/functions/index.d.cts +0 -16
- package/dist/functions/index.d.ts +0 -16
- package/dist/functions/index.js +0 -3
- package/dist/functions/operation-utility.cjs +0 -3
- package/dist/functions/operation-utility.d.cts +0 -16
- package/dist/functions/operation-utility.d.ts +0 -16
- package/dist/functions/operation-utility.js +0 -3
- package/dist/functions/utility.cjs +0 -3
- package/dist/functions/utility.d.cts +0 -17
- package/dist/functions/utility.d.ts +0 -17
- package/dist/functions/utility.js +0 -3
- package/dist/index.js +0 -3
- package/dist/interface/PixiVNJson.cjs +0 -1
- package/dist/interface/PixiVNJson.d.cts +0 -30
- package/dist/interface/PixiVNJson.d.ts +0 -30
- package/dist/interface/PixiVNJson.js +0 -0
- package/dist/interface/PixiVNJsonArithmeticOperations.cjs +0 -1
- package/dist/interface/PixiVNJsonArithmeticOperations.d.cts +0 -2
- package/dist/interface/PixiVNJsonArithmeticOperations.d.ts +0 -2
- package/dist/interface/PixiVNJsonArithmeticOperations.js +0 -0
- package/dist/interface/PixiVNJsonCanvas.cjs +0 -1
- package/dist/interface/PixiVNJsonCanvas.d.cts +0 -71
- package/dist/interface/PixiVNJsonCanvas.d.ts +0 -71
- package/dist/interface/PixiVNJsonCanvas.js +0 -0
- package/dist/interface/PixiVNJsonCanvasAnimate.cjs +0 -1
- package/dist/interface/PixiVNJsonCanvasAnimate.d.cts +0 -19
- package/dist/interface/PixiVNJsonCanvasAnimate.d.ts +0 -19
- package/dist/interface/PixiVNJsonCanvasAnimate.js +0 -0
- package/dist/interface/PixiVNJsonCanvasEffect.cjs +0 -1
- package/dist/interface/PixiVNJsonCanvasEffect.d.cts +0 -11
- package/dist/interface/PixiVNJsonCanvasEffect.d.ts +0 -11
- package/dist/interface/PixiVNJsonCanvasEffect.js +0 -0
- package/dist/interface/PixiVNJsonCanvasTicker.cjs +0 -1
- package/dist/interface/PixiVNJsonCanvasTicker.d.cts +0 -48
- package/dist/interface/PixiVNJsonCanvasTicker.d.ts +0 -48
- package/dist/interface/PixiVNJsonCanvasTicker.js +0 -0
- package/dist/interface/PixiVNJsonConditionalResultToCombine.cjs +0 -1
- package/dist/interface/PixiVNJsonConditionalResultToCombine.d.cts +0 -2
- package/dist/interface/PixiVNJsonConditionalResultToCombine.d.ts +0 -2
- package/dist/interface/PixiVNJsonConditionalResultToCombine.js +0 -0
- package/dist/interface/PixiVNJsonConditionalStatements.cjs +0 -1
- package/dist/interface/PixiVNJsonConditionalStatements.d.cts +0 -2
- package/dist/interface/PixiVNJsonConditionalStatements.d.ts +0 -2
- package/dist/interface/PixiVNJsonConditionalStatements.js +0 -0
- package/dist/interface/PixiVNJsonConditions.cjs +0 -1
- package/dist/interface/PixiVNJsonConditions.d.cts +0 -2
- package/dist/interface/PixiVNJsonConditions.d.ts +0 -2
- package/dist/interface/PixiVNJsonConditions.js +0 -0
- package/dist/interface/PixiVNJsonIfElse.cjs +0 -1
- package/dist/interface/PixiVNJsonIfElse.d.cts +0 -2
- package/dist/interface/PixiVNJsonIfElse.d.ts +0 -2
- package/dist/interface/PixiVNJsonIfElse.js +0 -0
- package/dist/interface/PixiVNJsonInput.cjs +0 -1
- package/dist/interface/PixiVNJsonInput.d.cts +0 -9
- package/dist/interface/PixiVNJsonInput.d.ts +0 -9
- package/dist/interface/PixiVNJsonInput.js +0 -0
- package/dist/interface/PixiVNJsonLabelStep.cjs +0 -1
- package/dist/interface/PixiVNJsonLabelStep.d.cts +0 -114
- package/dist/interface/PixiVNJsonLabelStep.d.ts +0 -114
- package/dist/interface/PixiVNJsonLabelStep.js +0 -0
- package/dist/interface/PixiVNJsonLabels.cjs +0 -1
- package/dist/interface/PixiVNJsonLabels.d.cts +0 -20
- package/dist/interface/PixiVNJsonLabels.d.ts +0 -20
- package/dist/interface/PixiVNJsonLabels.js +0 -0
- package/dist/interface/PixiVNJsonMediaTransiotions.cjs +0 -1
- package/dist/interface/PixiVNJsonMediaTransiotions.d.cts +0 -30
- package/dist/interface/PixiVNJsonMediaTransiotions.d.ts +0 -30
- package/dist/interface/PixiVNJsonMediaTransiotions.js +0 -0
- package/dist/interface/PixiVNJsonOperations.cjs +0 -1
- package/dist/interface/PixiVNJsonOperations.d.cts +0 -18
- package/dist/interface/PixiVNJsonOperations.d.ts +0 -18
- package/dist/interface/PixiVNJsonOperations.js +0 -0
- package/dist/interface/PixiVNJsonSound.cjs +0 -1
- package/dist/interface/PixiVNJsonSound.d.cts +0 -27
- package/dist/interface/PixiVNJsonSound.d.ts +0 -27
- package/dist/interface/PixiVNJsonSound.js +0 -0
- package/dist/interface/PixiVNJsonStepSwitch.cjs +0 -1
- package/dist/interface/PixiVNJsonStepSwitch.d.cts +0 -2
- package/dist/interface/PixiVNJsonStepSwitch.d.ts +0 -2
- package/dist/interface/PixiVNJsonStepSwitch.js +0 -0
- package/dist/interface/PixiVNJsonUnionCondition.cjs +0 -1
- package/dist/interface/PixiVNJsonUnionCondition.d.cts +0 -2
- package/dist/interface/PixiVNJsonUnionCondition.d.ts +0 -2
- package/dist/interface/PixiVNJsonUnionCondition.js +0 -0
- package/dist/interface/PixiVNJsonValue.cjs +0 -1
- package/dist/interface/PixiVNJsonValue.d.cts +0 -2
- package/dist/interface/PixiVNJsonValue.d.ts +0 -2
- package/dist/interface/PixiVNJsonValue.js +0 -0
- package/dist/interface/index.cjs +0 -1
- package/dist/interface/index.d.cts +0 -13
- package/dist/interface/index.d.ts +0 -13
- package/dist/interface/index.js +0 -0
- package/dist/managers/TranslateManager.cjs +0 -1
- package/dist/managers/TranslateManager.d.cts +0 -42
- package/dist/managers/TranslateManager.d.ts +0 -42
- package/dist/managers/TranslateManager.js +0 -1
- package/dist/managers/index.cjs +0 -1
- package/dist/managers/index.d.cts +0 -16
- package/dist/managers/index.d.ts +0 -16
- package/dist/managers/index.js +0 -1
- package/dist/utils/log-utility.cjs +0 -1
- package/dist/utils/log-utility.d.cts +0 -8
- package/dist/utils/log-utility.d.ts +0 -8
- package/dist/utils/log-utility.js +0 -1
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { SoundPlayOptions } from '@drincs/pixi-vn';
|
|
2
|
-
|
|
3
|
-
type PixiVNJsonSoundPlay = {
|
|
4
|
-
type: "sound";
|
|
5
|
-
operationType: "play";
|
|
6
|
-
alias: string;
|
|
7
|
-
props?: SoundPlayOptions;
|
|
8
|
-
};
|
|
9
|
-
type PixiVNJsonSoundRemove = {
|
|
10
|
-
type: "sound";
|
|
11
|
-
operationType: "stop";
|
|
12
|
-
alias: string;
|
|
13
|
-
};
|
|
14
|
-
type PixiVNJsonSoundPauseResume = {
|
|
15
|
-
type: "sound";
|
|
16
|
-
operationType: "pause" | "resume";
|
|
17
|
-
alias: string;
|
|
18
|
-
};
|
|
19
|
-
type PixiVNJsonSoundVolume = {
|
|
20
|
-
type: "sound";
|
|
21
|
-
operationType: "volume";
|
|
22
|
-
alias: string;
|
|
23
|
-
value: number;
|
|
24
|
-
};
|
|
25
|
-
type PixiVNJsonSound = PixiVNJsonSoundPlay | PixiVNJsonSoundRemove | PixiVNJsonSoundPauseResume | PixiVNJsonSoundVolume;
|
|
26
|
-
|
|
27
|
-
export type { PixiVNJsonSound as default };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { SoundPlayOptions } from '@drincs/pixi-vn';
|
|
2
|
-
|
|
3
|
-
type PixiVNJsonSoundPlay = {
|
|
4
|
-
type: "sound";
|
|
5
|
-
operationType: "play";
|
|
6
|
-
alias: string;
|
|
7
|
-
props?: SoundPlayOptions;
|
|
8
|
-
};
|
|
9
|
-
type PixiVNJsonSoundRemove = {
|
|
10
|
-
type: "sound";
|
|
11
|
-
operationType: "stop";
|
|
12
|
-
alias: string;
|
|
13
|
-
};
|
|
14
|
-
type PixiVNJsonSoundPauseResume = {
|
|
15
|
-
type: "sound";
|
|
16
|
-
operationType: "pause" | "resume";
|
|
17
|
-
alias: string;
|
|
18
|
-
};
|
|
19
|
-
type PixiVNJsonSoundVolume = {
|
|
20
|
-
type: "sound";
|
|
21
|
-
operationType: "volume";
|
|
22
|
-
alias: string;
|
|
23
|
-
value: number;
|
|
24
|
-
};
|
|
25
|
-
type PixiVNJsonSound = PixiVNJsonSoundPlay | PixiVNJsonSoundRemove | PixiVNJsonSoundPauseResume | PixiVNJsonSoundVolume;
|
|
26
|
-
|
|
27
|
-
export type { PixiVNJsonSound as default };
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
File without changes
|
package/dist/interface/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { default as PixiVNJson } from './PixiVNJson.cjs';
|
|
2
|
-
export { P as PixiVNJsonArithmeticOperations, a as PixiVNJsonArithmeticOperationsArithmetic, b as PixiVNJsonArithmeticOperationsArithmeticSingle, l as PixiVNJsonChoiceGet, e as PixiVNJsonComparation, c as PixiVNJsonConditionalResultToCombine, d as PixiVNJsonConditionalStatements, f as PixiVNJsonConditions, g as PixiVNJsonIfElse, m as PixiVNJsonLabelGet, n as PixiVNJsonLogicGet, o as PixiVNJsonParamGet, h as PixiVNJsonStepSwitch, j as PixiVNJsonStepSwitchElementType, i as PixiVNJsonStepSwitchElementsType, p as PixiVNJsonStorageGet, k as PixiVNJsonUnionCondition, q as PixiVNJsonValueGet, r as PixiVNJsonValueSet } from '../PixiVNJsonConditionalStatements-S3pFEkW9.cjs';
|
|
3
|
-
export { default as PixiVNJsonCanvas, PixiVNJsonCanvasEdit, PixiVNJsonCanvasRemove, PixiVNJsonCanvasShow } from './PixiVNJsonCanvas.cjs';
|
|
4
|
-
export { PixiVNJsonAnimateBase, PixiVNJsonAnimateSequence, default as PixiVNJsonCanvasAnimate } from './PixiVNJsonCanvasAnimate.cjs';
|
|
5
|
-
export { default as PixiVNJsonCanvasEffect } from './PixiVNJsonCanvasEffect.cjs';
|
|
6
|
-
export { default as PixiVNJsonCanvasTicker } from './PixiVNJsonCanvasTicker.cjs';
|
|
7
|
-
export { default as PixiVNJsonInput } from './PixiVNJsonInput.cjs';
|
|
8
|
-
export { default as PixiVNJsonLabels } from './PixiVNJsonLabels.cjs';
|
|
9
|
-
export { PixiVNJsonChoice, PixiVNJsonChoices, PixiVNJsonDialog, PixiVNJsonDialogText, default as PixiVNJsonLabelStep, PixiVNJsonLabelToOpen } from './PixiVNJsonLabelStep.cjs';
|
|
10
|
-
export { default as PixiVNJsonMediaTransiotions } from './PixiVNJsonMediaTransiotions.cjs';
|
|
11
|
-
export { default as PixiVNJsonConditionalOperation, PixiVNJsonOperation, PixiVNJsonOperationString } from './PixiVNJsonOperations.cjs';
|
|
12
|
-
export { default as PixiVNJsonSound } from './PixiVNJsonSound.cjs';
|
|
13
|
-
import '@drincs/pixi-vn';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { default as PixiVNJson } from './PixiVNJson.js';
|
|
2
|
-
export { P as PixiVNJsonArithmeticOperations, a as PixiVNJsonArithmeticOperationsArithmetic, b as PixiVNJsonArithmeticOperationsArithmeticSingle, l as PixiVNJsonChoiceGet, e as PixiVNJsonComparation, c as PixiVNJsonConditionalResultToCombine, d as PixiVNJsonConditionalStatements, f as PixiVNJsonConditions, g as PixiVNJsonIfElse, m as PixiVNJsonLabelGet, n as PixiVNJsonLogicGet, o as PixiVNJsonParamGet, h as PixiVNJsonStepSwitch, j as PixiVNJsonStepSwitchElementType, i as PixiVNJsonStepSwitchElementsType, p as PixiVNJsonStorageGet, k as PixiVNJsonUnionCondition, q as PixiVNJsonValueGet, r as PixiVNJsonValueSet } from '../PixiVNJsonConditionalStatements-S3pFEkW9.js';
|
|
3
|
-
export { default as PixiVNJsonCanvas, PixiVNJsonCanvasEdit, PixiVNJsonCanvasRemove, PixiVNJsonCanvasShow } from './PixiVNJsonCanvas.js';
|
|
4
|
-
export { PixiVNJsonAnimateBase, PixiVNJsonAnimateSequence, default as PixiVNJsonCanvasAnimate } from './PixiVNJsonCanvasAnimate.js';
|
|
5
|
-
export { default as PixiVNJsonCanvasEffect } from './PixiVNJsonCanvasEffect.js';
|
|
6
|
-
export { default as PixiVNJsonCanvasTicker } from './PixiVNJsonCanvasTicker.js';
|
|
7
|
-
export { default as PixiVNJsonInput } from './PixiVNJsonInput.js';
|
|
8
|
-
export { default as PixiVNJsonLabels } from './PixiVNJsonLabels.js';
|
|
9
|
-
export { PixiVNJsonChoice, PixiVNJsonChoices, PixiVNJsonDialog, PixiVNJsonDialogText, default as PixiVNJsonLabelStep, PixiVNJsonLabelToOpen } from './PixiVNJsonLabelStep.js';
|
|
10
|
-
export { default as PixiVNJsonMediaTransiotions } from './PixiVNJsonMediaTransiotions.js';
|
|
11
|
-
export { default as PixiVNJsonConditionalOperation, PixiVNJsonOperation, PixiVNJsonOperationString } from './PixiVNJsonOperations.js';
|
|
12
|
-
export { default as PixiVNJsonSound } from './PixiVNJsonSound.js';
|
|
13
|
-
import '@drincs/pixi-vn';
|
package/dist/interface/index.js
DELETED
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var h=class i{static _beforeToTranslate=void 0;static _translate=e=>e;static _afterToTranslate=void 0;static t(e){return Array.isArray(e)?e.map(t=>i.translate(`${t}`)):i.translate(`${e}`)}static set beforeToTranslate(e){i._beforeToTranslate=e;}static set translate(e){i._translate=e;}static get translate(){return e=>{let t=e;return i._beforeToTranslate&&(t=i._beforeToTranslate(t)),t=i._translate(t),i._afterToTranslate&&(t=i._afterToTranslate(t)),t}}static set afterToTranslate(e){i._afterToTranslate=e;}static addKey(e,t,r){let n=r.defaultValue||"empty_string";typeof t=="string"&&(t=[t]),Array.isArray(t)&&t.forEach(s=>{e[s]===void 0&&(n==="empty_string"?e[s]="":n==="copy_key"&&(i._beforeToTranslate?e[s]=i._beforeToTranslate(s):e[s]=s));});}static getConditionalsThenElse(e,t=[]){if(typeof e=="object"&&e&&"type"in e)if(e.type==="ifelse")e.then&&i.getConditionalsThenElse(e.then,t),e.else&&i.getConditionalsThenElse(e.else,t);else if(e.type==="stepswitch"){if(e.elements)if(Array.isArray(e.elements))e.elements.forEach(r=>{i.getConditionalsThenElse(r,t);});else if(e.elements.type==="ifelse"){let r=[];i.getConditionalsThenElse(e.elements,r),r.forEach(n=>{t.push(...n);});}else if(e.elements.type==="stepswitch"){let r=[];i.getConditionalsThenElse(e.elements,r),r.forEach(n=>{t.push(...n);});}else i.getConditionalsThenElse(e.elements,t);}else e.type==="resulttocombine"?(e.firstItem&&i.getConditionalsThenElse(e.firstItem,t),e.secondConditionalItem&&e.secondConditionalItem.forEach(r=>{i.getConditionalsThenElse(r,t);})):t.push(e);else e&&t.push(e);return t}static generateJsonTranslation(e,t={},r={}){let{defaultValue:n="copy_key"}=r;return e.forEach(s=>{if(s.choices){let f=[];Array.isArray(s.choices)?f=[s.choices]:f=i.getConditionalsThenElse(s.choices),f.forEach(o=>o.forEach(l=>{if("type"in l){let g=[];l.type==="ifelse"||l.type==="stepswitch"?i.getConditionalsThenElse(l,g):g=[l],g.map(a=>i.getConditionalsThenElse(a.text)).forEach(a=>{Array.isArray(a)&&a.forEach(y=>{Array.isArray(y)?y.forEach(T=>{typeof T=="string"?i.addKey(t,T,{defaultValue:n}):i.getConditionalsThenElse(T).forEach(c=>{Array.isArray(c)?c.forEach(p=>{typeof p=="string"&&i.addKey(t,p,{defaultValue:n});}):typeof c=="string"&&i.addKey(t,c,{defaultValue:n});});}):typeof y=="string"&&i.addKey(t,y,{defaultValue:n});});});}}));}if(s.dialogue){let f=[];Array.isArray(s.dialogue)?f=[s.dialogue]:f=i.getConditionalsThenElse(s.dialogue),f.forEach(o=>{if(typeof o=="string")i.addKey(t,o,{defaultValue:n});else if("text"in o){let l=i.getConditionalsThenElse(o.text);typeof l=="string"&&(l=[l]),l.forEach(g=>{typeof g=="string"?i.addKey(t,g,{defaultValue:n}):i.getConditionalsThenElse(g).forEach(a=>{typeof a=="string"?i.addKey(t,a,{defaultValue:n}):Array.isArray(a)&&a.forEach(y=>{typeof y=="string"?i.addKey(t,y,{defaultValue:n}):i.getConditionalsThenElse(y).forEach(T=>{typeof T=="string"&&i.addKey(t,T,{defaultValue:n});});});});});}});}s.conditionalStep&&i.getConditionalsThenElse(s.conditionalStep).forEach(o=>{Array.isArray(o)?i.generateJsonTranslation(o,t,r):i.generateJsonTranslation([o],t,r);});}),t}};module.exports=h;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import PixiVNJsonLabelStep from '../interface/PixiVNJsonLabelStep.cjs';
|
|
2
|
-
import '@drincs/pixi-vn';
|
|
3
|
-
import '../PixiVNJsonConditionalStatements-S3pFEkW9.cjs';
|
|
4
|
-
import '../interface/PixiVNJsonOperations.cjs';
|
|
5
|
-
import '../interface/PixiVNJsonCanvas.cjs';
|
|
6
|
-
import '../interface/PixiVNJsonCanvasAnimate.cjs';
|
|
7
|
-
import '../interface/PixiVNJsonCanvasEffect.cjs';
|
|
8
|
-
import '../interface/PixiVNJsonCanvasTicker.cjs';
|
|
9
|
-
import '../interface/PixiVNJsonMediaTransiotions.cjs';
|
|
10
|
-
import '../interface/PixiVNJsonInput.cjs';
|
|
11
|
-
import '../interface/PixiVNJsonSound.cjs';
|
|
12
|
-
|
|
13
|
-
declare class TranslatorManager {
|
|
14
|
-
private static _beforeToTranslate;
|
|
15
|
-
private static _translate;
|
|
16
|
-
private static _afterToTranslate;
|
|
17
|
-
static t<T = string | string[]>(key: T): T;
|
|
18
|
-
static set beforeToTranslate(value: (key: string) => string);
|
|
19
|
-
static set translate(value: (key: string) => string);
|
|
20
|
-
static get translate(): (key: string) => string;
|
|
21
|
-
static set afterToTranslate(value: (key: string) => string);
|
|
22
|
-
private static addKey;
|
|
23
|
-
private static getConditionalsThenElse;
|
|
24
|
-
/**
|
|
25
|
-
* Generates a JSON translation object from the provided labels.
|
|
26
|
-
* @param labels The labels to translate.
|
|
27
|
-
* @param json The JSON object to populate with translations.
|
|
28
|
-
* @param options Options for translation, including default value handling.
|
|
29
|
-
* @returns The populated JSON object with translations.
|
|
30
|
-
*/
|
|
31
|
-
static generateJsonTranslation(labels: PixiVNJsonLabelStep[], json?: object, options?: {
|
|
32
|
-
/**
|
|
33
|
-
* Default value to use when a key is not found.
|
|
34
|
-
* - "empty_string": Use an empty string as the default value.
|
|
35
|
-
* - "copy_key": Use the key itself as the default value.
|
|
36
|
-
* @default "copy_key"
|
|
37
|
-
*/
|
|
38
|
-
defaultValue?: "empty_string" | "copy_key";
|
|
39
|
-
}): object;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export { TranslatorManager as default };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import PixiVNJsonLabelStep from '../interface/PixiVNJsonLabelStep.js';
|
|
2
|
-
import '@drincs/pixi-vn';
|
|
3
|
-
import '../PixiVNJsonConditionalStatements-S3pFEkW9.js';
|
|
4
|
-
import '../interface/PixiVNJsonOperations.js';
|
|
5
|
-
import '../interface/PixiVNJsonCanvas.js';
|
|
6
|
-
import '../interface/PixiVNJsonCanvasAnimate.js';
|
|
7
|
-
import '../interface/PixiVNJsonCanvasEffect.js';
|
|
8
|
-
import '../interface/PixiVNJsonCanvasTicker.js';
|
|
9
|
-
import '../interface/PixiVNJsonMediaTransiotions.js';
|
|
10
|
-
import '../interface/PixiVNJsonInput.js';
|
|
11
|
-
import '../interface/PixiVNJsonSound.js';
|
|
12
|
-
|
|
13
|
-
declare class TranslatorManager {
|
|
14
|
-
private static _beforeToTranslate;
|
|
15
|
-
private static _translate;
|
|
16
|
-
private static _afterToTranslate;
|
|
17
|
-
static t<T = string | string[]>(key: T): T;
|
|
18
|
-
static set beforeToTranslate(value: (key: string) => string);
|
|
19
|
-
static set translate(value: (key: string) => string);
|
|
20
|
-
static get translate(): (key: string) => string;
|
|
21
|
-
static set afterToTranslate(value: (key: string) => string);
|
|
22
|
-
private static addKey;
|
|
23
|
-
private static getConditionalsThenElse;
|
|
24
|
-
/**
|
|
25
|
-
* Generates a JSON translation object from the provided labels.
|
|
26
|
-
* @param labels The labels to translate.
|
|
27
|
-
* @param json The JSON object to populate with translations.
|
|
28
|
-
* @param options Options for translation, including default value handling.
|
|
29
|
-
* @returns The populated JSON object with translations.
|
|
30
|
-
*/
|
|
31
|
-
static generateJsonTranslation(labels: PixiVNJsonLabelStep[], json?: object, options?: {
|
|
32
|
-
/**
|
|
33
|
-
* Default value to use when a key is not found.
|
|
34
|
-
* - "empty_string": Use an empty string as the default value.
|
|
35
|
-
* - "copy_key": Use the key itself as the default value.
|
|
36
|
-
* @default "copy_key"
|
|
37
|
-
*/
|
|
38
|
-
defaultValue?: "empty_string" | "copy_key";
|
|
39
|
-
}): object;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export { TranslatorManager as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var h=class i{static _beforeToTranslate=void 0;static _translate=e=>e;static _afterToTranslate=void 0;static t(e){return Array.isArray(e)?e.map(t=>i.translate(`${t}`)):i.translate(`${e}`)}static set beforeToTranslate(e){i._beforeToTranslate=e;}static set translate(e){i._translate=e;}static get translate(){return e=>{let t=e;return i._beforeToTranslate&&(t=i._beforeToTranslate(t)),t=i._translate(t),i._afterToTranslate&&(t=i._afterToTranslate(t)),t}}static set afterToTranslate(e){i._afterToTranslate=e;}static addKey(e,t,r){let n=r.defaultValue||"empty_string";typeof t=="string"&&(t=[t]),Array.isArray(t)&&t.forEach(s=>{e[s]===void 0&&(n==="empty_string"?e[s]="":n==="copy_key"&&(i._beforeToTranslate?e[s]=i._beforeToTranslate(s):e[s]=s));});}static getConditionalsThenElse(e,t=[]){if(typeof e=="object"&&e&&"type"in e)if(e.type==="ifelse")e.then&&i.getConditionalsThenElse(e.then,t),e.else&&i.getConditionalsThenElse(e.else,t);else if(e.type==="stepswitch"){if(e.elements)if(Array.isArray(e.elements))e.elements.forEach(r=>{i.getConditionalsThenElse(r,t);});else if(e.elements.type==="ifelse"){let r=[];i.getConditionalsThenElse(e.elements,r),r.forEach(n=>{t.push(...n);});}else if(e.elements.type==="stepswitch"){let r=[];i.getConditionalsThenElse(e.elements,r),r.forEach(n=>{t.push(...n);});}else i.getConditionalsThenElse(e.elements,t);}else e.type==="resulttocombine"?(e.firstItem&&i.getConditionalsThenElse(e.firstItem,t),e.secondConditionalItem&&e.secondConditionalItem.forEach(r=>{i.getConditionalsThenElse(r,t);})):t.push(e);else e&&t.push(e);return t}static generateJsonTranslation(e,t={},r={}){let{defaultValue:n="copy_key"}=r;return e.forEach(s=>{if(s.choices){let f=[];Array.isArray(s.choices)?f=[s.choices]:f=i.getConditionalsThenElse(s.choices),f.forEach(o=>o.forEach(l=>{if("type"in l){let g=[];l.type==="ifelse"||l.type==="stepswitch"?i.getConditionalsThenElse(l,g):g=[l],g.map(a=>i.getConditionalsThenElse(a.text)).forEach(a=>{Array.isArray(a)&&a.forEach(y=>{Array.isArray(y)?y.forEach(T=>{typeof T=="string"?i.addKey(t,T,{defaultValue:n}):i.getConditionalsThenElse(T).forEach(c=>{Array.isArray(c)?c.forEach(p=>{typeof p=="string"&&i.addKey(t,p,{defaultValue:n});}):typeof c=="string"&&i.addKey(t,c,{defaultValue:n});});}):typeof y=="string"&&i.addKey(t,y,{defaultValue:n});});});}}));}if(s.dialogue){let f=[];Array.isArray(s.dialogue)?f=[s.dialogue]:f=i.getConditionalsThenElse(s.dialogue),f.forEach(o=>{if(typeof o=="string")i.addKey(t,o,{defaultValue:n});else if("text"in o){let l=i.getConditionalsThenElse(o.text);typeof l=="string"&&(l=[l]),l.forEach(g=>{typeof g=="string"?i.addKey(t,g,{defaultValue:n}):i.getConditionalsThenElse(g).forEach(a=>{typeof a=="string"?i.addKey(t,a,{defaultValue:n}):Array.isArray(a)&&a.forEach(y=>{typeof y=="string"?i.addKey(t,y,{defaultValue:n}):i.getConditionalsThenElse(y).forEach(T=>{typeof T=="string"&&i.addKey(t,T,{defaultValue:n});});});});});}});}s.conditionalStep&&i.getConditionalsThenElse(s.conditionalStep).forEach(o=>{Array.isArray(o)?i.generateJsonTranslation(o,t,r):i.generateJsonTranslation([o],t,r);});}),t}};export{h as default};
|
package/dist/managers/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var c=class i{static _beforeToTranslate=void 0;static _translate=e=>e;static _afterToTranslate=void 0;static t(e){return Array.isArray(e)?e.map(t=>i.translate(`${t}`)):i.translate(`${e}`)}static set beforeToTranslate(e){i._beforeToTranslate=e;}static set translate(e){i._translate=e;}static get translate(){return e=>{let t=e;return i._beforeToTranslate&&(t=i._beforeToTranslate(t)),t=i._translate(t),i._afterToTranslate&&(t=i._afterToTranslate(t)),t}}static set afterToTranslate(e){i._afterToTranslate=e;}static addKey(e,t,r){let n=r.defaultValue||"empty_string";typeof t=="string"&&(t=[t]),Array.isArray(t)&&t.forEach(s=>{e[s]===void 0&&(n==="empty_string"?e[s]="":n==="copy_key"&&(i._beforeToTranslate?e[s]=i._beforeToTranslate(s):e[s]=s));});}static getConditionalsThenElse(e,t=[]){if(typeof e=="object"&&e&&"type"in e)if(e.type==="ifelse")e.then&&i.getConditionalsThenElse(e.then,t),e.else&&i.getConditionalsThenElse(e.else,t);else if(e.type==="stepswitch"){if(e.elements)if(Array.isArray(e.elements))e.elements.forEach(r=>{i.getConditionalsThenElse(r,t);});else if(e.elements.type==="ifelse"){let r=[];i.getConditionalsThenElse(e.elements,r),r.forEach(n=>{t.push(...n);});}else if(e.elements.type==="stepswitch"){let r=[];i.getConditionalsThenElse(e.elements,r),r.forEach(n=>{t.push(...n);});}else i.getConditionalsThenElse(e.elements,t);}else e.type==="resulttocombine"?(e.firstItem&&i.getConditionalsThenElse(e.firstItem,t),e.secondConditionalItem&&e.secondConditionalItem.forEach(r=>{i.getConditionalsThenElse(r,t);})):t.push(e);else e&&t.push(e);return t}static generateJsonTranslation(e,t={},r={}){let{defaultValue:n="copy_key"}=r;return e.forEach(s=>{if(s.choices){let f=[];Array.isArray(s.choices)?f=[s.choices]:f=i.getConditionalsThenElse(s.choices),f.forEach(o=>o.forEach(l=>{if("type"in l){let g=[];l.type==="ifelse"||l.type==="stepswitch"?i.getConditionalsThenElse(l,g):g=[l],g.map(a=>i.getConditionalsThenElse(a.text)).forEach(a=>{Array.isArray(a)&&a.forEach(y=>{Array.isArray(y)?y.forEach(T=>{typeof T=="string"?i.addKey(t,T,{defaultValue:n}):i.getConditionalsThenElse(T).forEach(h=>{Array.isArray(h)?h.forEach(p=>{typeof p=="string"&&i.addKey(t,p,{defaultValue:n});}):typeof h=="string"&&i.addKey(t,h,{defaultValue:n});});}):typeof y=="string"&&i.addKey(t,y,{defaultValue:n});});});}}));}if(s.dialogue){let f=[];Array.isArray(s.dialogue)?f=[s.dialogue]:f=i.getConditionalsThenElse(s.dialogue),f.forEach(o=>{if(typeof o=="string")i.addKey(t,o,{defaultValue:n});else if("text"in o){let l=i.getConditionalsThenElse(o.text);typeof l=="string"&&(l=[l]),l.forEach(g=>{typeof g=="string"?i.addKey(t,g,{defaultValue:n}):i.getConditionalsThenElse(g).forEach(a=>{typeof a=="string"?i.addKey(t,a,{defaultValue:n}):Array.isArray(a)&&a.forEach(y=>{typeof y=="string"?i.addKey(t,y,{defaultValue:n}):i.getConditionalsThenElse(y).forEach(T=>{typeof T=="string"&&i.addKey(t,T,{defaultValue:n});});});});});}});}s.conditionalStep&&i.getConditionalsThenElse(s.conditionalStep).forEach(o=>{Array.isArray(o)?i.generateJsonTranslation(o,t,r):i.generateJsonTranslation([o],t,r);});}),t}};var C=c;exports.translator=C;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import TranslatorManager from './TranslateManager.cjs';
|
|
2
|
-
import '../interface/PixiVNJsonLabelStep.cjs';
|
|
3
|
-
import '@drincs/pixi-vn';
|
|
4
|
-
import '../PixiVNJsonConditionalStatements-S3pFEkW9.cjs';
|
|
5
|
-
import '../interface/PixiVNJsonOperations.cjs';
|
|
6
|
-
import '../interface/PixiVNJsonCanvas.cjs';
|
|
7
|
-
import '../interface/PixiVNJsonCanvasAnimate.cjs';
|
|
8
|
-
import '../interface/PixiVNJsonCanvasEffect.cjs';
|
|
9
|
-
import '../interface/PixiVNJsonCanvasTicker.cjs';
|
|
10
|
-
import '../interface/PixiVNJsonMediaTransiotions.cjs';
|
|
11
|
-
import '../interface/PixiVNJsonInput.cjs';
|
|
12
|
-
import '../interface/PixiVNJsonSound.cjs';
|
|
13
|
-
|
|
14
|
-
declare const translator: typeof TranslatorManager;
|
|
15
|
-
|
|
16
|
-
export { translator };
|
package/dist/managers/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import TranslatorManager from './TranslateManager.js';
|
|
2
|
-
import '../interface/PixiVNJsonLabelStep.js';
|
|
3
|
-
import '@drincs/pixi-vn';
|
|
4
|
-
import '../PixiVNJsonConditionalStatements-S3pFEkW9.js';
|
|
5
|
-
import '../interface/PixiVNJsonOperations.js';
|
|
6
|
-
import '../interface/PixiVNJsonCanvas.js';
|
|
7
|
-
import '../interface/PixiVNJsonCanvasAnimate.js';
|
|
8
|
-
import '../interface/PixiVNJsonCanvasEffect.js';
|
|
9
|
-
import '../interface/PixiVNJsonCanvasTicker.js';
|
|
10
|
-
import '../interface/PixiVNJsonMediaTransiotions.js';
|
|
11
|
-
import '../interface/PixiVNJsonInput.js';
|
|
12
|
-
import '../interface/PixiVNJsonSound.js';
|
|
13
|
-
|
|
14
|
-
declare const translator: typeof TranslatorManager;
|
|
15
|
-
|
|
16
|
-
export { translator };
|
package/dist/managers/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var c=class i{static _beforeToTranslate=void 0;static _translate=e=>e;static _afterToTranslate=void 0;static t(e){return Array.isArray(e)?e.map(t=>i.translate(`${t}`)):i.translate(`${e}`)}static set beforeToTranslate(e){i._beforeToTranslate=e;}static set translate(e){i._translate=e;}static get translate(){return e=>{let t=e;return i._beforeToTranslate&&(t=i._beforeToTranslate(t)),t=i._translate(t),i._afterToTranslate&&(t=i._afterToTranslate(t)),t}}static set afterToTranslate(e){i._afterToTranslate=e;}static addKey(e,t,r){let n=r.defaultValue||"empty_string";typeof t=="string"&&(t=[t]),Array.isArray(t)&&t.forEach(s=>{e[s]===void 0&&(n==="empty_string"?e[s]="":n==="copy_key"&&(i._beforeToTranslate?e[s]=i._beforeToTranslate(s):e[s]=s));});}static getConditionalsThenElse(e,t=[]){if(typeof e=="object"&&e&&"type"in e)if(e.type==="ifelse")e.then&&i.getConditionalsThenElse(e.then,t),e.else&&i.getConditionalsThenElse(e.else,t);else if(e.type==="stepswitch"){if(e.elements)if(Array.isArray(e.elements))e.elements.forEach(r=>{i.getConditionalsThenElse(r,t);});else if(e.elements.type==="ifelse"){let r=[];i.getConditionalsThenElse(e.elements,r),r.forEach(n=>{t.push(...n);});}else if(e.elements.type==="stepswitch"){let r=[];i.getConditionalsThenElse(e.elements,r),r.forEach(n=>{t.push(...n);});}else i.getConditionalsThenElse(e.elements,t);}else e.type==="resulttocombine"?(e.firstItem&&i.getConditionalsThenElse(e.firstItem,t),e.secondConditionalItem&&e.secondConditionalItem.forEach(r=>{i.getConditionalsThenElse(r,t);})):t.push(e);else e&&t.push(e);return t}static generateJsonTranslation(e,t={},r={}){let{defaultValue:n="copy_key"}=r;return e.forEach(s=>{if(s.choices){let f=[];Array.isArray(s.choices)?f=[s.choices]:f=i.getConditionalsThenElse(s.choices),f.forEach(o=>o.forEach(l=>{if("type"in l){let g=[];l.type==="ifelse"||l.type==="stepswitch"?i.getConditionalsThenElse(l,g):g=[l],g.map(a=>i.getConditionalsThenElse(a.text)).forEach(a=>{Array.isArray(a)&&a.forEach(y=>{Array.isArray(y)?y.forEach(T=>{typeof T=="string"?i.addKey(t,T,{defaultValue:n}):i.getConditionalsThenElse(T).forEach(h=>{Array.isArray(h)?h.forEach(p=>{typeof p=="string"&&i.addKey(t,p,{defaultValue:n});}):typeof h=="string"&&i.addKey(t,h,{defaultValue:n});});}):typeof y=="string"&&i.addKey(t,y,{defaultValue:n});});});}}));}if(s.dialogue){let f=[];Array.isArray(s.dialogue)?f=[s.dialogue]:f=i.getConditionalsThenElse(s.dialogue),f.forEach(o=>{if(typeof o=="string")i.addKey(t,o,{defaultValue:n});else if("text"in o){let l=i.getConditionalsThenElse(o.text);typeof l=="string"&&(l=[l]),l.forEach(g=>{typeof g=="string"?i.addKey(t,g,{defaultValue:n}):i.getConditionalsThenElse(g).forEach(a=>{typeof a=="string"?i.addKey(t,a,{defaultValue:n}):Array.isArray(a)&&a.forEach(y=>{typeof y=="string"?i.addKey(t,y,{defaultValue:n}):i.getConditionalsThenElse(y).forEach(T=>{typeof T=="string"&&i.addKey(t,T,{defaultValue:n});});});});});}});}s.conditionalStep&&i.getConditionalsThenElse(s.conditionalStep).forEach(o=>{Array.isArray(o)?i.generateJsonTranslation(o,t,r):i.generateJsonTranslation([o],t,r);});}),t}};var C=c;export{C as translator};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';exports.logger=void 0;(s=>(s.log=(n,...o)=>console.log(`[Pixi\u2019VN Json] ${n}`,...o),s.warn=(n,...o)=>console.warn(`[Pixi\u2019VN Json] ${n}`,...o),s.error=(n,...o)=>console.error(`[Pixi\u2019VN Json] ${n}`,...o),s.info=(n,...o)=>console.info(`[Pixi\u2019VN Json] ${n}`,...o)))(exports.logger||={});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
declare namespace logger {
|
|
2
|
-
const log: (message?: any, ...optionalParams: any[]) => void;
|
|
3
|
-
const warn: (message?: any, ...optionalParams: any[]) => void;
|
|
4
|
-
const error: (message?: any, ...optionalParams: any[]) => void;
|
|
5
|
-
const info: (message?: any, ...optionalParams: any[]) => void;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export { logger };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
declare namespace logger {
|
|
2
|
-
const log: (message?: any, ...optionalParams: any[]) => void;
|
|
3
|
-
const warn: (message?: any, ...optionalParams: any[]) => void;
|
|
4
|
-
const error: (message?: any, ...optionalParams: any[]) => void;
|
|
5
|
-
const info: (message?: any, ...optionalParams: any[]) => void;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export { logger };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var a;(s=>(s.log=(n,...o)=>console.log(`[Pixi\u2019VN Json] ${n}`,...o),s.warn=(n,...o)=>console.warn(`[Pixi\u2019VN Json] ${n}`,...o),s.error=(n,...o)=>console.error(`[Pixi\u2019VN Json] ${n}`,...o),s.info=(n,...o)=>console.info(`[Pixi\u2019VN Json] ${n}`,...o)))(a||={});export{a as logger};
|