@drincs/pixi-vn-json 1.0.2 → 1.0.4
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/{PixiVNJsonConditionalStatements-BBopD3ft.d.cts → PixiVNJsonConditionalStatements-CVkQSKpq.d.cts} +15 -4
- package/dist/{PixiVNJsonConditionalStatements-CSzbVYiW.d.ts → PixiVNJsonConditionalStatements-CVkQSKpq.d.ts} +15 -4
- package/dist/classes/LabelJson.cjs +2 -6
- package/dist/classes/LabelJson.d.cts +14 -5
- package/dist/classes/LabelJson.d.ts +14 -5
- package/dist/classes/LabelJson.js +2 -4
- package/dist/classes/index.cjs +2 -6
- package/dist/classes/index.d.cts +1 -2
- package/dist/classes/index.d.ts +1 -2
- package/dist/classes/index.js +2 -4
- package/dist/constants.cjs +1 -5
- package/dist/constants.js +1 -3
- package/dist/functions/importer.cjs +2 -6
- package/dist/functions/importer.d.cts +6 -6
- package/dist/functions/importer.d.ts +6 -6
- package/dist/functions/importer.js +2 -4
- package/dist/functions/index.cjs +2 -10
- package/dist/functions/index.d.cts +6 -6
- package/dist/functions/index.d.ts +6 -6
- package/dist/functions/index.js +2 -4
- package/dist/functions/operation-utility.cjs +3 -0
- package/dist/functions/operation-utility.d.cts +11 -0
- package/dist/functions/operation-utility.d.ts +11 -0
- package/dist/functions/operation-utility.js +3 -0
- package/dist/functions/utility.cjs +2 -9
- package/dist/functions/utility.d.cts +11 -17
- package/dist/functions/utility.d.ts +11 -17
- package/dist/functions/utility.js +2 -4
- package/dist/index.cjs +2 -12
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -4
- package/dist/interface/PixiVNJson.cjs +1 -2
- package/dist/interface/PixiVNJson.d.cts +1 -2
- package/dist/interface/PixiVNJson.d.ts +1 -2
- package/dist/interface/PixiVNJson.js +0 -1
- package/dist/interface/PixiVNJsonArithmeticOperations.cjs +1 -2
- package/dist/interface/PixiVNJsonArithmeticOperations.d.cts +1 -2
- package/dist/interface/PixiVNJsonArithmeticOperations.d.ts +1 -2
- package/dist/interface/PixiVNJsonArithmeticOperations.js +0 -1
- package/dist/interface/PixiVNJsonConditionalResultToCombine.cjs +1 -2
- package/dist/interface/PixiVNJsonConditionalResultToCombine.d.cts +1 -2
- package/dist/interface/PixiVNJsonConditionalResultToCombine.d.ts +1 -2
- package/dist/interface/PixiVNJsonConditionalResultToCombine.js +0 -1
- package/dist/interface/PixiVNJsonConditionalStatements.cjs +1 -2
- package/dist/interface/PixiVNJsonConditionalStatements.d.cts +1 -2
- package/dist/interface/PixiVNJsonConditionalStatements.d.ts +1 -2
- package/dist/interface/PixiVNJsonConditionalStatements.js +0 -1
- package/dist/interface/PixiVNJsonConditions.cjs +1 -2
- package/dist/interface/PixiVNJsonConditions.d.cts +1 -2
- package/dist/interface/PixiVNJsonConditions.d.ts +1 -2
- package/dist/interface/PixiVNJsonConditions.js +0 -1
- package/dist/interface/PixiVNJsonIfElse.cjs +1 -2
- package/dist/interface/PixiVNJsonIfElse.d.cts +1 -2
- package/dist/interface/PixiVNJsonIfElse.d.ts +1 -2
- package/dist/interface/PixiVNJsonIfElse.js +0 -1
- package/dist/interface/PixiVNJsonInput.cjs +1 -2
- package/dist/interface/PixiVNJsonInput.js +0 -1
- package/dist/interface/PixiVNJsonLabelStep.cjs +1 -2
- package/dist/interface/PixiVNJsonLabelStep.d.cts +12 -5
- package/dist/interface/PixiVNJsonLabelStep.d.ts +12 -5
- package/dist/interface/PixiVNJsonLabelStep.js +0 -1
- package/dist/interface/PixiVNJsonLabels.cjs +1 -2
- package/dist/interface/PixiVNJsonLabels.d.cts +1 -2
- package/dist/interface/PixiVNJsonLabels.d.ts +1 -2
- package/dist/interface/PixiVNJsonLabels.js +0 -1
- package/dist/interface/PixiVNJsonMedia.cjs +1 -2
- package/dist/interface/PixiVNJsonMedia.js +0 -1
- package/dist/interface/PixiVNJsonMediaTransiotions.cjs +1 -2
- package/dist/interface/PixiVNJsonMediaTransiotions.js +0 -1
- package/dist/interface/PixiVNJsonOperations.cjs +1 -2
- package/dist/interface/PixiVNJsonOperations.d.cts +1 -2
- package/dist/interface/PixiVNJsonOperations.d.ts +1 -2
- package/dist/interface/PixiVNJsonOperations.js +0 -1
- package/dist/interface/PixiVNJsonStepSwitch.cjs +1 -2
- package/dist/interface/PixiVNJsonStepSwitch.d.cts +1 -2
- package/dist/interface/PixiVNJsonStepSwitch.d.ts +1 -2
- package/dist/interface/PixiVNJsonStepSwitch.js +0 -1
- package/dist/interface/PixiVNJsonUnionCondition.cjs +1 -2
- package/dist/interface/PixiVNJsonUnionCondition.d.cts +1 -2
- package/dist/interface/PixiVNJsonUnionCondition.d.ts +1 -2
- package/dist/interface/PixiVNJsonUnionCondition.js +0 -1
- package/dist/interface/PixiVNJsonValue.cjs +1 -2
- package/dist/interface/PixiVNJsonValue.d.cts +1 -2
- package/dist/interface/PixiVNJsonValue.d.ts +1 -2
- package/dist/interface/PixiVNJsonValue.js +0 -1
- package/dist/interface/index.cjs +1 -2
- package/dist/interface/index.d.cts +1 -2
- package/dist/interface/index.d.ts +1 -2
- package/dist/interface/index.js +0 -1
- package/dist/managers/TranslateManager.cjs +1 -0
- package/dist/managers/TranslateManager.d.cts +27 -0
- package/dist/managers/TranslateManager.d.ts +27 -0
- package/dist/managers/TranslateManager.js +1 -0
- package/dist/managers/index.cjs +1 -0
- package/dist/managers/index.d.cts +9 -0
- package/dist/managers/index.d.ts +9 -0
- package/dist/managers/index.js +1 -0
- package/package.json +2 -2
- package/dist/interface/PixiVNJsonLabelCondition.cjs +0 -2
- package/dist/interface/PixiVNJsonLabelCondition.d.cts +0 -16
- package/dist/interface/PixiVNJsonLabelCondition.d.ts +0 -16
- package/dist/interface/PixiVNJsonLabelCondition.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var g=class c{static _translate=e=>e;static t(e){return Array.isArray(e)?e.map(i=>c._translate(`${i}`)):c._translate(`${e}`)}static set translate(e){c._translate=e;}addKey(e,i,s){let t=s.defaultValue||"empty_string";typeof i=="string"&&(i=[i]),Array.isArray(i)&&i.forEach(n=>{e[n]===void 0&&(t==="empty_string"?e[n]="":t==="copy_key"&&(e[n]=n));});}getConditionalsThenElse(e,i=[]){if(typeof e=="object"&&e&&"type"in e)if(e.type==="ifelse")e.then&&this.getConditionalsThenElse(e.then,i),e.else&&this.getConditionalsThenElse(e.else,i);else if(e.type==="stepswitch"){if(e.elements)if(Array.isArray(e.elements))e.elements.forEach(s=>{this.getConditionalsThenElse(s,i);});else if(e.elements.type==="ifelse"){let s=[];this.getConditionalsThenElse(e.elements,s),s.forEach(t=>{i.push(...t);});}else if(e.elements.type==="stepswitch"){let s=[];this.getConditionalsThenElse(e.elements,s),s.forEach(t=>{i.push(...t);});}else this.getConditionalsThenElse(e.elements,i);}else e.type==="resulttocombine"?(e.firstItem&&this.getConditionalsThenElse(e.firstItem,i),e.secondConditionalItem&&e.secondConditionalItem.forEach(s=>{this.getConditionalsThenElse(s,i);})):i.push(e);else e&&i.push(e);return i}generateNewTranslateFile(e,i={},s={}){return e.forEach(t=>{if(t.choices){let n=[];Array.isArray(t.choices)?n=[t.choices]:n=this.getConditionalsThenElse(t.choices),n.forEach(r=>r.forEach(l=>{if("type"in l){let a=[];l.type==="ifelse"||l.type==="stepswitch"?this.getConditionalsThenElse(l,a):a=[l],a.map(o=>this.getConditionalsThenElse(o.text)).forEach(o=>{Array.isArray(o)&&o.forEach(f=>{Array.isArray(f)?f.forEach(T=>{typeof T=="string"?this.addKey(i,T,s):this.getConditionalsThenElse(T).forEach(y=>{Array.isArray(y)?y.forEach(p=>{typeof p=="string"&&this.addKey(i,p,s);}):typeof y=="string"&&this.addKey(i,y,s);});}):typeof f=="string"&&this.addKey(i,f,s);});});}}));}if(t.dialogue){let n=[];Array.isArray(t.dialogue)?n=[t.dialogue]:n=this.getConditionalsThenElse(t.dialogue),n.forEach(r=>{typeof r=="string"?this.addKey(i,r,s):"text"in r&&Array.isArray(r.text)&&r.text.forEach(l=>{typeof l=="string"?this.addKey(i,l,s):this.getConditionalsThenElse(l).forEach(h=>{typeof h=="string"?this.addKey(i,h,s):Array.isArray(h)&&h.forEach(o=>{typeof o=="string"?this.addKey(i,o,s):this.getConditionalsThenElse(o).forEach(f=>{typeof f=="string"&&this.addKey(i,f,s);});});});});});}t.conditionalStep&&this.getConditionalsThenElse(t.conditionalStep).forEach(r=>{Array.isArray(r)?this.generateNewTranslateFile(r,i,s):this.generateNewTranslateFile([r],i,s);});}),i}};exports.TranslateManager=g;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as TranslateManager } from './TranslateManager.cjs';
|
|
2
|
+
import '../interface/PixiVNJsonLabelStep.cjs';
|
|
3
|
+
import '@drincs/pixi-vn';
|
|
4
|
+
import '../PixiVNJsonConditionalStatements-CVkQSKpq.cjs';
|
|
5
|
+
import '../interface/PixiVNJsonOperations.cjs';
|
|
6
|
+
import '../interface/PixiVNJsonInput.cjs';
|
|
7
|
+
import '../interface/PixiVNJsonMedia.cjs';
|
|
8
|
+
import '../interface/PixiVNJsonMediaTransiotions.cjs';
|
|
9
|
+
import 'pixi.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as TranslateManager } from './TranslateManager.js';
|
|
2
|
+
import '../interface/PixiVNJsonLabelStep.js';
|
|
3
|
+
import '@drincs/pixi-vn';
|
|
4
|
+
import '../PixiVNJsonConditionalStatements-CVkQSKpq.js';
|
|
5
|
+
import '../interface/PixiVNJsonOperations.js';
|
|
6
|
+
import '../interface/PixiVNJsonInput.js';
|
|
7
|
+
import '../interface/PixiVNJsonMedia.js';
|
|
8
|
+
import '../interface/PixiVNJsonMediaTransiotions.js';
|
|
9
|
+
import 'pixi.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var g=class c{static _translate=e=>e;static t(e){return Array.isArray(e)?e.map(i=>c._translate(`${i}`)):c._translate(`${e}`)}static set translate(e){c._translate=e;}addKey(e,i,s){let t=s.defaultValue||"empty_string";typeof i=="string"&&(i=[i]),Array.isArray(i)&&i.forEach(n=>{e[n]===void 0&&(t==="empty_string"?e[n]="":t==="copy_key"&&(e[n]=n));});}getConditionalsThenElse(e,i=[]){if(typeof e=="object"&&e&&"type"in e)if(e.type==="ifelse")e.then&&this.getConditionalsThenElse(e.then,i),e.else&&this.getConditionalsThenElse(e.else,i);else if(e.type==="stepswitch"){if(e.elements)if(Array.isArray(e.elements))e.elements.forEach(s=>{this.getConditionalsThenElse(s,i);});else if(e.elements.type==="ifelse"){let s=[];this.getConditionalsThenElse(e.elements,s),s.forEach(t=>{i.push(...t);});}else if(e.elements.type==="stepswitch"){let s=[];this.getConditionalsThenElse(e.elements,s),s.forEach(t=>{i.push(...t);});}else this.getConditionalsThenElse(e.elements,i);}else e.type==="resulttocombine"?(e.firstItem&&this.getConditionalsThenElse(e.firstItem,i),e.secondConditionalItem&&e.secondConditionalItem.forEach(s=>{this.getConditionalsThenElse(s,i);})):i.push(e);else e&&i.push(e);return i}generateNewTranslateFile(e,i={},s={}){return e.forEach(t=>{if(t.choices){let n=[];Array.isArray(t.choices)?n=[t.choices]:n=this.getConditionalsThenElse(t.choices),n.forEach(r=>r.forEach(l=>{if("type"in l){let a=[];l.type==="ifelse"||l.type==="stepswitch"?this.getConditionalsThenElse(l,a):a=[l],a.map(o=>this.getConditionalsThenElse(o.text)).forEach(o=>{Array.isArray(o)&&o.forEach(f=>{Array.isArray(f)?f.forEach(T=>{typeof T=="string"?this.addKey(i,T,s):this.getConditionalsThenElse(T).forEach(y=>{Array.isArray(y)?y.forEach(p=>{typeof p=="string"&&this.addKey(i,p,s);}):typeof y=="string"&&this.addKey(i,y,s);});}):typeof f=="string"&&this.addKey(i,f,s);});});}}));}if(t.dialogue){let n=[];Array.isArray(t.dialogue)?n=[t.dialogue]:n=this.getConditionalsThenElse(t.dialogue),n.forEach(r=>{typeof r=="string"?this.addKey(i,r,s):"text"in r&&Array.isArray(r.text)&&r.text.forEach(l=>{typeof l=="string"?this.addKey(i,l,s):this.getConditionalsThenElse(l).forEach(h=>{typeof h=="string"?this.addKey(i,h,s):Array.isArray(h)&&h.forEach(o=>{typeof o=="string"?this.addKey(i,o,s):this.getConditionalsThenElse(o).forEach(f=>{typeof f=="string"&&this.addKey(i,f,s);});});});});});}t.conditionalStep&&this.getConditionalsThenElse(t.conditionalStep).forEach(r=>{Array.isArray(r)?this.generateNewTranslateFile(r,i,s):this.generateNewTranslateFile([r],i,s);});}),i}};export{g as TranslateManager};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drincs/pixi-vn-json",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Pixi'VN can be integrated with JSON files to create a visual novel.",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"typescript": "^5.6.2"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@drincs/pixi-vn": ">=0.8.
|
|
35
|
+
"@drincs/pixi-vn": ">=0.8.2"
|
|
36
36
|
},
|
|
37
37
|
"keywords": [
|
|
38
38
|
"game",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a condition that checks the status of a label.
|
|
3
|
-
*/
|
|
4
|
-
interface PixiVNJsonLabelCondition {
|
|
5
|
-
type: "labelcondition";
|
|
6
|
-
/**
|
|
7
|
-
* The condition to be checked.
|
|
8
|
-
*/
|
|
9
|
-
operator: "started" | "completed";
|
|
10
|
-
/**
|
|
11
|
-
* The label to be checked.
|
|
12
|
-
*/
|
|
13
|
-
label: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export type { PixiVNJsonLabelCondition as default };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a condition that checks the status of a label.
|
|
3
|
-
*/
|
|
4
|
-
interface PixiVNJsonLabelCondition {
|
|
5
|
-
type: "labelcondition";
|
|
6
|
-
/**
|
|
7
|
-
* The condition to be checked.
|
|
8
|
-
*/
|
|
9
|
-
operator: "started" | "completed";
|
|
10
|
-
/**
|
|
11
|
-
* The label to be checked.
|
|
12
|
-
*/
|
|
13
|
-
label: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export type { PixiVNJsonLabelCondition as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|