@drincs/pixi-vn-json 1.13.12 → 1.13.13
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/{PixiVNJsonLabelStep-BsGHNfkq.d.cts → PixiVNJsonLabelStep-DKmA62M_.d.cts} +11 -3
- package/dist/{PixiVNJsonLabelStep-BsGHNfkq.d.ts → PixiVNJsonLabelStep-DKmA62M_.d.ts} +11 -3
- package/dist/actions.cjs +2 -2
- package/dist/actions.d.cts +8 -2
- package/dist/actions.d.ts +8 -2
- package/dist/actions.mjs +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +5 -1
- package/dist/core.d.ts +5 -1
- package/dist/core.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/interpreter.cjs +1 -1
- package/dist/interpreter.d.cts +1 -1
- package/dist/interpreter.d.ts +1 -1
- package/dist/interpreter.mjs +1 -1
- package/dist/schema.d.cts +2 -2
- package/dist/schema.d.ts +2 -2
- package/dist/translator.d.cts +1 -1
- package/dist/translator.d.ts +1 -1
- package/package.json +1 -1
|
@@ -716,6 +716,13 @@ type PixiVNJsonCanvasRemove = {
|
|
|
716
716
|
*/
|
|
717
717
|
transition?: PixiVNJsonMediaTransiotions;
|
|
718
718
|
};
|
|
719
|
+
/**
|
|
720
|
+
* Removes every element currently on the canvas.
|
|
721
|
+
*/
|
|
722
|
+
type PixiVNJsonCanvasClear = {
|
|
723
|
+
type: "canvas";
|
|
724
|
+
operationType: "clear";
|
|
725
|
+
};
|
|
719
726
|
/**
|
|
720
727
|
* Pauses or resumes playback of a video sprite on the canvas.
|
|
721
728
|
*/
|
|
@@ -744,9 +751,10 @@ type PixiVNJsonCanvasShow = PixiVNJsonCanvasImageContainerShow | PixiVNJsonCanva
|
|
|
744
751
|
*/
|
|
745
752
|
type PixiVNJsonCanvasEdit = PixiVNJsonImageEdit | PixiVNJsonVideoEdit | PixiVNJsonImageContainerEdit | PixiVNJsonTextEdit | PixiVNJsonUnknownEdit<ImageSpriteMemory | VideoSpriteMemory | ContainerMemory | TextMemory>;
|
|
746
753
|
/**
|
|
747
|
-
* Union of all canvas operations — show, edit, remove, animate, apply effects, and asset
|
|
754
|
+
* Union of all canvas operations — show, edit, remove, clear, animate, apply effects, and asset
|
|
755
|
+
* loading.
|
|
748
756
|
*/
|
|
749
|
-
type PixiVNJsonCanvas = PixiVNJsonCanvasShow | PixiVNJsonCanvasEdit | PixiVNJsonCanvasRemove | PixiVNJsonVideoPauseResume | PixiVNJsonAssetsLoad | PixiVNJsonCanvasAnimate | PixiVNJsonCanvasEffect;
|
|
757
|
+
type PixiVNJsonCanvas = PixiVNJsonCanvasShow | PixiVNJsonCanvasEdit | PixiVNJsonCanvasRemove | PixiVNJsonCanvasClear | PixiVNJsonVideoPauseResume | PixiVNJsonAssetsLoad | PixiVNJsonCanvasAnimate | PixiVNJsonCanvasEffect;
|
|
750
758
|
|
|
751
759
|
/**
|
|
752
760
|
* Requests user input during the narrative.
|
|
@@ -996,4 +1004,4 @@ type PixiVNJsonLabelStep = {
|
|
|
996
1004
|
conditionalStep?: PixiVNJsonConditionalStatements<PixiVNJsonLabelStep | PixiVNJsonLabelStep[]>;
|
|
997
1005
|
};
|
|
998
1006
|
|
|
999
|
-
export type {
|
|
1007
|
+
export type { PixiVNJsonStepSwitch as $, PixiVNJsonAnimateSequence as A, PixiVNJsonArithmeticOperationsArithmetic as B, PixiVNJsonArithmeticOperationsArithmeticSingle as C, PixiVNJsonCanvas as D, PixiVNJsonCanvasEdit as E, PixiVNJsonCanvasShow as F, PixiVNJsonChoice as G, PixiVNJsonChoiceGet as H, PixiVNJsonChoices as I, PixiVNJsonComparation as J, PixiVNJsonConditionalOperation as K, PixiVNJsonConditionalResultToCombine as L, PixiVNJsonDialog as M, PixiVNJsonDialogText as N, PixiVNJsonDialogue as O, PixiVNJsonOperation as P, PixiVNJsonFunction as Q, PixiVNJsonInputRequest as R, PixiVNJsonLabelGet as S, PixiVNJsonLabelToOpen as T, PixiVNJsonLogicGet as U, PixiVNJsonMediaTransiotions as V, PixiVNJsonParamGet as W, PixiVNJsonSoundEdit as X, PixiVNJsonSoundPauseResume as Y, PixiVNJsonSoundPlay as Z, PixiVNJsonSoundRemove as _, PixiVNJsonIfElse as a, PixiVNJsonStepSwitchElementType as a0, PixiVNJsonStepSwitchElementsType as a1, PixiVNJsonStorageGet as a2, PixiVNJsonUnionCondition as a3, PixiVNJsonOperationString as b, PixiVNJsonSound as c, PixiVNJsonCanvasImageVideoShow as d, PixiVNJsonImageEdit as e, PixiVNJsonCanvasRemove as f, PixiVNJsonVideoEdit as g, PixiVNJsonVideoPauseResume as h, PixiVNJsonCanvasImageContainerShow as i, PixiVNJsonImageContainerEdit as j, PixiVNJsonCanvasTextShow as k, PixiVNJsonTextEdit as l, PixiVNJsonUnknownEdit as m, PixiVNJsonValueSet as n, PixiVNJsonOnlyStorageSet as o, PixiVNJsonNarration as p, PixiVNJsonCanvasEffect as q, PixiVNJsonCanvasAnimate as r, PixiVNJsonCanvasClear as s, PixiVNJsonValueGet as t, PixiVNJsonArithmeticOperations as u, PixiVNJsonConditions as v, PixiVNJsonConditionalStatements as w, PixiVNJsonLabelStep as x, PixiVNJsonComparationOperatorsType as y, PixiVNJsonAnimateBase as z };
|
|
@@ -716,6 +716,13 @@ type PixiVNJsonCanvasRemove = {
|
|
|
716
716
|
*/
|
|
717
717
|
transition?: PixiVNJsonMediaTransiotions;
|
|
718
718
|
};
|
|
719
|
+
/**
|
|
720
|
+
* Removes every element currently on the canvas.
|
|
721
|
+
*/
|
|
722
|
+
type PixiVNJsonCanvasClear = {
|
|
723
|
+
type: "canvas";
|
|
724
|
+
operationType: "clear";
|
|
725
|
+
};
|
|
719
726
|
/**
|
|
720
727
|
* Pauses or resumes playback of a video sprite on the canvas.
|
|
721
728
|
*/
|
|
@@ -744,9 +751,10 @@ type PixiVNJsonCanvasShow = PixiVNJsonCanvasImageContainerShow | PixiVNJsonCanva
|
|
|
744
751
|
*/
|
|
745
752
|
type PixiVNJsonCanvasEdit = PixiVNJsonImageEdit | PixiVNJsonVideoEdit | PixiVNJsonImageContainerEdit | PixiVNJsonTextEdit | PixiVNJsonUnknownEdit<ImageSpriteMemory | VideoSpriteMemory | ContainerMemory | TextMemory>;
|
|
746
753
|
/**
|
|
747
|
-
* Union of all canvas operations — show, edit, remove, animate, apply effects, and asset
|
|
754
|
+
* Union of all canvas operations — show, edit, remove, clear, animate, apply effects, and asset
|
|
755
|
+
* loading.
|
|
748
756
|
*/
|
|
749
|
-
type PixiVNJsonCanvas = PixiVNJsonCanvasShow | PixiVNJsonCanvasEdit | PixiVNJsonCanvasRemove | PixiVNJsonVideoPauseResume | PixiVNJsonAssetsLoad | PixiVNJsonCanvasAnimate | PixiVNJsonCanvasEffect;
|
|
757
|
+
type PixiVNJsonCanvas = PixiVNJsonCanvasShow | PixiVNJsonCanvasEdit | PixiVNJsonCanvasRemove | PixiVNJsonCanvasClear | PixiVNJsonVideoPauseResume | PixiVNJsonAssetsLoad | PixiVNJsonCanvasAnimate | PixiVNJsonCanvasEffect;
|
|
750
758
|
|
|
751
759
|
/**
|
|
752
760
|
* Requests user input during the narrative.
|
|
@@ -996,4 +1004,4 @@ type PixiVNJsonLabelStep = {
|
|
|
996
1004
|
conditionalStep?: PixiVNJsonConditionalStatements<PixiVNJsonLabelStep | PixiVNJsonLabelStep[]>;
|
|
997
1005
|
};
|
|
998
1006
|
|
|
999
|
-
export type {
|
|
1007
|
+
export type { PixiVNJsonStepSwitch as $, PixiVNJsonAnimateSequence as A, PixiVNJsonArithmeticOperationsArithmetic as B, PixiVNJsonArithmeticOperationsArithmeticSingle as C, PixiVNJsonCanvas as D, PixiVNJsonCanvasEdit as E, PixiVNJsonCanvasShow as F, PixiVNJsonChoice as G, PixiVNJsonChoiceGet as H, PixiVNJsonChoices as I, PixiVNJsonComparation as J, PixiVNJsonConditionalOperation as K, PixiVNJsonConditionalResultToCombine as L, PixiVNJsonDialog as M, PixiVNJsonDialogText as N, PixiVNJsonDialogue as O, PixiVNJsonOperation as P, PixiVNJsonFunction as Q, PixiVNJsonInputRequest as R, PixiVNJsonLabelGet as S, PixiVNJsonLabelToOpen as T, PixiVNJsonLogicGet as U, PixiVNJsonMediaTransiotions as V, PixiVNJsonParamGet as W, PixiVNJsonSoundEdit as X, PixiVNJsonSoundPauseResume as Y, PixiVNJsonSoundPlay as Z, PixiVNJsonSoundRemove as _, PixiVNJsonIfElse as a, PixiVNJsonStepSwitchElementType as a0, PixiVNJsonStepSwitchElementsType as a1, PixiVNJsonStorageGet as a2, PixiVNJsonUnionCondition as a3, PixiVNJsonOperationString as b, PixiVNJsonSound as c, PixiVNJsonCanvasImageVideoShow as d, PixiVNJsonImageEdit as e, PixiVNJsonCanvasRemove as f, PixiVNJsonVideoEdit as g, PixiVNJsonVideoPauseResume as h, PixiVNJsonCanvasImageContainerShow as i, PixiVNJsonImageContainerEdit as j, PixiVNJsonCanvasTextShow as k, PixiVNJsonTextEdit as l, PixiVNJsonUnknownEdit as m, PixiVNJsonValueSet as n, PixiVNJsonOnlyStorageSet as o, PixiVNJsonNarration as p, PixiVNJsonCanvasEffect as q, PixiVNJsonCanvasAnimate as r, PixiVNJsonCanvasClear as s, PixiVNJsonValueGet as t, PixiVNJsonArithmeticOperations as u, PixiVNJsonConditions as v, PixiVNJsonConditionalStatements as w, PixiVNJsonLabelStep as x, PixiVNJsonComparationOperatorsType as y, PixiVNJsonAnimateBase as z };
|
package/dist/actions.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var core=require('@drincs/pixi-vn-json/core'),canvas=require('@drincs/pixi-vn/canvas'),translator=require('@drincs/pixi-vn-json/translator'),narration=require('@drincs/pixi-vn/narration'),sound=require('@drincs/pixi-vn/sound'),pixiVn=require('@drincs/pixi-vn'),storage=require('@drincs/pixi-vn/storage');async function Je(e){let t=core.JsonUnifier.getLogichValue(e,{});if(t)switch(t.type){case "assets":switch(t.operationType){case "load":await canvas.Assets.load(t.aliases);break;case "lazyload":canvas.Assets.backgroundLoad(t.aliases);break}break;case "bundle":switch(t.operationType){case "load":await canvas.Assets.loadBundle(t.aliases);break;case "lazyload":canvas.Assets.backgroundLoadBundle(t.aliases);break}break}}var a;(o=>(o.log=(r,...c)=>console.log(`[Pixi\u2019VN Json] ${r}`,...c),o.warn=(r,...c)=>console.warn(`[Pixi\u2019VN Json] ${r}`,...c),o.error=(r,...c)=>console.error(`[Pixi\u2019VN Json] ${r}`,...c),o.info=(r,...c)=>console.info(`[Pixi\u2019VN Json] ${r}`,...c)))(a||={});async function b(e,t,i){switch(i.type){case "fade":await canvas.showWithFade(t.alias,e,i.props,i.priority);break;case "dissolve":await canvas.showWithDissolve(t.alias,e,i.props,i.priority);break;case "movein":case "moveout":await canvas.moveIn(t.alias,e,i.props,i.priority);break;case "zoomin":case "zoomout":await canvas.zoomIn(t.alias,e,i.props,i.priority);break;case "pushin":case "pushout":await canvas.pushIn(t.alias,e,i.props,i.priority);break}}function v(e){if(e.transition)switch(e.transition.type){case "fade":canvas.removeWithFade(e.alias,e.transition.props,e.transition.priority);break;case "dissolve":canvas.removeWithDissolve(e.alias,e.transition.props,e.transition.priority);break;case "movein":case "moveout":canvas.moveOut(e.alias,e.transition.props,e.transition.priority);break;case "zoomin":case "zoomout":canvas.zoomOut(e.alias,e.transition.props,e.transition.priority);break;case "pushin":case "pushout":canvas.pushOut(e.alias,e.transition.props,e.transition.priority);break}else canvas.canvas.remove(e.alias);}async function Oe(e){switch(e.operationType){case "show":if(e.transition){let t=new canvas.ImageSprite(e.props,e.url||e.alias);await b(t,e,e.transition);}else await canvas.showImage(e.alias,e.url,e.props);break;case "edit":{let t=canvas.canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):a.error(`Image with alias ${e.alias} not found.`);break}case "remove":v(e);break}}async function Ae(e){switch(e.operationType){case "show":if(e.transition){let t=new canvas.VideoSprite(e.props,e.url||e.alias);await b(t,e,e.transition);}else await canvas.showVideo(e.alias,e.url,e.props);break;case "edit":{let t=canvas.canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):a.error(`Video with alias ${e.alias} not found.`);break}case "remove":v(e);break;case "pause":case "resume":{let t=canvas.canvas.find(e.alias);t?t.paused=e.operationType==="pause":a.error(`Video with alias ${e.alias} not found.`);break}}}async function ke(e){switch(e.operationType){case "show":if(e.transition){let t=new canvas.ImageContainer(e.props,e.urls);await b(t,e,e.transition);}else await canvas.showImageContainer(e.alias,e.urls,e.props);break;case "edit":{let t=canvas.canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):a.error(`ImageContainer with alias ${e.alias} not found.`);break}case "remove":v(e);break}}async function Le(e){switch(e.operationType){case "show":if(e.props=e.props||{},e.props.text=translator.translator.t(e.text),e.transition){let t=new canvas.Text(e.props);await b(t,e,e.transition);}else canvas.showText(e.alias,e.text,e.props);break;case "edit":{let t=canvas.canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):a.error(`Text with alias ${e.alias} not found.`);break}case "remove":v(e);break}}async function je(e){switch(e.operationType){case "edit":try{let t=canvas.canvas.find(e.alias);t?e.props&&t.setMemory({...t.memory,...e.props}):a.error(`Canvas Element with alias ${e.alias} not found.`);}catch(t){a.error(`There was an error while trying to edit the canvas element with alias ${e.alias}.`,t);}break;case "remove":v(e);break}}async function Ie(e){e.type==="shake"&&await canvas.shakeEffect(e.alias,e.props,e.priority);}function Ee(e){switch(e.type){case "animate":canvas.canvas.animate(e.alias,e.keyframes,e.options,e.priority);break;case "animate-sequence":canvas.canvas.animate(e.alias,e.sequence,e.options,e.priority);break}}function ze(e){switch(e.type){case "input":narration.narration.requestInput({type:e.valueType},e.defaultValue);break;case "dialogue":narration.narration.dialogue=void 0;break}}function $e(e){switch(e.operationType){case "play":e.url?sound.sound.play(e.alias,e.url,e.props):sound.sound.play(e.alias,e.props);break;case "stop":switch(e.type){case "sound":sound.sound.stop(e.alias);break;case "all":sound.sound.stopAll();break}break;case "pause":switch(e.type){case "sound":sound.sound.pause(e.alias);break;case "channel":sound.sound.findChannel(e.alias).pauseAll();break;case "all":sound.sound.pauseAll();break}break;case "resume":switch(e.type){case "sound":sound.sound.resume(e.alias);break;case "channel":sound.sound.findChannel(e.alias).resumeAll();break;case "all":sound.sound.resumeAll();break}break;case "edit":Object.entries(e.props).forEach(([t,i])=>{let n=sound.sound.find(e.alias);n&&(t==="volume"?n.volume.value=i:n.paused=i);});break}}var T="___param___";var h=class e{static init(t){t.loadAssets&&(e._loadAssets=t.loadAssets),t.soundOperation&&(e._soundOperation=t.soundOperation),t.imageOperation&&(e._imageOperation=t.imageOperation),t.videoOperation&&(e._videoOperation=t.videoOperation),t.imageContainerOperation&&(e._imageContainerOperation=t.imageContainerOperation),t.textOperation&&(e._textOperation=t.textOperation),t.canvasElementOperation&&(e._canvasElementOperation=t.canvasElementOperation),t.setStorageValue&&(e._setStorageValue=t.setStorageValue),t.setInitialStorageValue&&(e._setInitialStorageValue=t.setInitialStorageValue),t.narrationOperation&&(e._narrationOperation=t.narrationOperation),t.effectOperation&&(e._effectOperation=t.effectOperation),t.animateOperation&&(e._animateOperation=t.animateOperation),t.getLogichValue&&(e._getLogichValue=t.getLogichValue),t.getConditionalStep&&(e._getConditionalStep=t.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return e._loadAssets}static _soundOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return e._soundOperation}static _imageOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return e._imageOperation}static _videoOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return e._videoOperation}static _imageContainerOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return e._imageContainerOperation}static _textOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return e._textOperation}static _canvasElementOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return e._canvasElementOperation}static _setStorageValue=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return e._setStorageValue}static _setInitialStorageValue=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return e._setInitialStorageValue}static _narrationOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return e._narrationOperation}static _effectOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return e._effectOperation}static _animateOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return e._animateOperation}static _getLogichValue=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return e._getLogichValue}static _getConditionalStep=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return e._getConditionalStep}};function _(e,t){if(t&&typeof t=="object"&&typeof e.functionName=="string"&&e.functionName in t){let i=t[e.functionName];if(typeof i=="function"){let n=e.args.map(o=>h.getLogichValue(o,t));return i(...n)}else a.warn(`getLogichValue function ${e.functionName} not found in props`);}}function z(e,t){let i=core.JsonUnifier.getLogichValue(e,t);return i&&typeof i=="object"&&"type"in i?core.JsonUnifier.getLogichValue(i,t):i}function ci(e,t={}){let i=z(e.value,t);switch(e.storageType){case "flagStorage":storage.storage.setFlag(e.key,e.value);break;case "storage":storage.storage.set(e.key,i);break;case "tempstorage":storage.storage.setTempVariable(e.key,i);break;case "params":{let n=storage.storage.get(`${T}${narration.narration.openedLabels.length-1}`)||[];n.length>e.key&&(n[e.key]=i),storage.storage.setTempVariable(`${T}${narration.narration.openedLabels.length-1}`,n);break}}}function ui(e,t={}){let i=z(e.value,t);switch(e.storageType){case "storage":case "tempstorage":storage.storage.default={[e.key]:i};break}}function k(e,t={}){let i=L(e,t);if(i&&typeof i=="object"&&"type"in i)switch(i.type){case "value":return ge(i,t);case "arithmetic":case "arithmeticsingle":return me(i,t);case "compare":case "union":return xe(i,t);case "function":return _(i,t)}return i}function me(e,t){let i=core.JsonUnifier.getLogichValue(e.leftValue,t);switch(e.type){case "arithmetic":{let n=core.JsonUnifier.getLogichValue(e.rightValue,t);switch(e.operator){case "*":return i*n;case "/":return i/n;case "+":return typeof i=="string"||typeof n=="string"?`${i}${n}`:Array.isArray(i)&&Array.isArray(n)?[...i,...n]:Array.isArray(i)?[...i,n]:Array.isArray(n)?[i,...n]:i+n;case "-":if(Array.isArray(i)&&Array.isArray(n))return i.filter(o=>!n.includes(o));if(Array.isArray(i))return i.filter(o=>o!==n);if(Array.isArray(n)){a.warn("getValueFromArithmeticOperations cannot subtract array from non-array");return}return i-n;case "%":return i%n;case "POW":return i**n;case "RANDOM":return narration.narration.getRandomNumber(i,n);case "INTERSECTION":if(Array.isArray(i)&&Array.isArray(n))return i.filter(o=>n.includes(o));a.warn("getValueFromArithmeticOperations cannot intersect non-array values");return;default:a.warn("getValueFromArithmeticOperations unknown operator",e);return}}case "arithmeticsingle":switch(e.operator){case "INT":return Number(i);case "FLOOR":return Math.floor(i);}break}}function ge(e,t){if(e&&typeof e=="object"&&"type"in e&&e.type==="value"&&e.storageOperationType==="get")switch(e.storageType){case "storage":case "tempstorage":return e.key==="_input_value_"?narration.narration.inputValue:storage.storage.get(e.key);case "flagStorage":return storage.storage.getFlag(e.key);case "label":return narration.narration.getTimesLabelOpened(e.label);case "choice":return narration.narration.getTimesChoiceMade(e.index);case "logic":return core.JsonUnifier.getLogichValue(e.operation,t);case "params":{let i=storage.storage.get(`${T}${narration.narration.openedLabels.length-1}`)||[];if(i&&i.length>e.key)return i[e.key];a.warn("getValue params not found");return}}return e}function xe(e,t){if(!e)return false;if(typeof e!="object"||!("type"in e))return !!e;switch(e.type){case "compare":{let i=core.JsonUnifier.getLogichValue(e.leftValue,t),n=core.JsonUnifier.getLogichValue(e.rightValue,t);switch(e.operator){case "==":return Array.isArray(i)&&Array.isArray(n)?i.length===n.length&&i.every(o=>n.includes(o)):i===n;case "!=":return Array.isArray(i)&&Array.isArray(n)?i.length!==n.length||!i.every(o=>n.includes(o)):i!==n;case "<":return typeof i=="string"&&typeof n=="string"?i.localeCompare(n)<0:Array.isArray(i)&&Array.isArray(n)?i.length<n.length:i<n;case "<=":return typeof i=="string"&&typeof n=="string"?i.localeCompare(n)<=0:Array.isArray(i)&&Array.isArray(n)?i.length<=n.length:i<=n;case ">":return typeof i=="string"&&typeof n=="string"?i.localeCompare(n)>0:Array.isArray(i)&&Array.isArray(n)?i.length>n.length:i>n;case ">=":return typeof i=="string"&&typeof n=="string"?i.localeCompare(n)>=0:Array.isArray(i)&&Array.isArray(n)?i.length>=n.length:i>=n;case "CONTAINS":return Array.isArray(i)&&Array.isArray(n)?n.every(o=>i.includes(o)):Array.isArray(i)?i.includes(n):i.toString().includes(n.toString())}break}case "value":{let i=core.JsonUnifier.getLogichValue(e,t);return Array.isArray(i)?i.length>0:i&&typeof i=="object"?Object.keys(i).length>0:!!i}case "union":return Ve(e,t)}return !!e}function Ve(e,t){if(e.unionType==="not"){let n=k(e.condition,t);return Array.isArray(n)?n.length===0:n&&typeof n=="object"?Object.keys(n).length===0:!n}let i=n=>core.JsonUnifier.getLogichValue(n,t)||false;return e.unionType==="and"?e.conditions.every(i):e.conditions.some(i)}function fe(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function L(e,t={}){if(Array.isArray(e)||!e)return e;if(e&&typeof e=="object"&&"type"in e)switch(e.type){case "resulttocombine":return ye(e,t);case "ifelse":return core.JsonUnifier.getLogichValue(e.condition,t)?core.JsonUnifier.getLogichValue(e.then,t):core.JsonUnifier.getLogichValue(e.else,t);case "stepswitch":{let i=core.JsonUnifier.getLogichValue(e.elements,t)||[];if(i.length===0){a.error("getValueFromConditionalStatements elements.length === 0");return}switch(e.choiceType){case "random":{let n=fe(0,i.length-1);return core.JsonUnifier.getLogichValue(i[n],t)}case "loop":{let n=narration.NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return n>i.length-1?(n=n%i.length,core.JsonUnifier.getLogichValue(i[n],t)):core.JsonUnifier.getLogichValue(i[n],t)}case "sequential":{let n,o=narration.NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return e.end==="lastItem"&&(n=core.JsonUnifier.getLogichValue(i[i.length-1],t)),o>i.length-1?n:core.JsonUnifier.getLogichValue(i[o],t)}case "sequentialrandom":{let n=narration.NarrationManagerStatic.getRandomNumber(0,i.length-1,{nestedId:e.nestedId,onceOnly:true});if(n===void 0&&e.end==="lastItem"){let o=narration.NarrationManagerStatic.getCurrentStepTimesCounterData(e.nestedId);if(!o?.usedRandomNumbers){a.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}let r=o.usedRandomNumbers[`0-${i.length-1}`];return core.JsonUnifier.getLogichValue(i[r[r.length-1]],t)}if(n===void 0){a.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}return core.JsonUnifier.getLogichValue(i[n],t)}}}}return e}function M(e,t={}){if(e.conditionalStep){let i=pixiVn.createExportableElement(core.JsonUnifier.getLogichValue(e.conditionalStep,t));if(i?.glueEnabled===void 0&&delete i?.glueEnabled,i?.goNextStep===void 0&&delete i?.goNextStep,i?.end===void 0&&delete i?.end,i?.choices===void 0&&delete i?.choices,i?.dialogue===void 0&&delete i?.dialogue,i?.labelToOpen===void 0&&delete i?.labelToOpen,i?.operations===void 0&&delete i?.operations,i){let n={...e,conditionalStep:void 0,...i};return M(n,t)}else narration.narration.dialogGlue&&(narration.narration.dialogGlue=false);}return e}function ye(e,t){let i=e.firstItem,n=(e.secondConditionalItem??[]).flatMap(r=>Array.isArray(r)?r.map(c=>core.JsonUnifier.getLogichValue(c,t)):[core.JsonUnifier.getLogichValue(r,t)]),o=i?[i,...n]:n;if(o.length===0){a.warn("combinateResult toCheck.length === 0");return}if(typeof o[0]=="string")return translator.translator.t(o);if(typeof o[0]=="object"){let r=o,c,P=false,N=r.map((l,f)=>{l=M(l,t);let u=core.JsonUnifier.getLogichValue(l.dialogue,t)||"";return f===0?(c=core.JsonUnifier.getLogichValue(l.glueEnabled,t)||false,u):(typeof u=="object"&&"text"in u&&(u=`${u.character}: ${u.text}`),c===false&&P&&(u=`
|
|
1
|
+
'use strict';var core=require('@drincs/pixi-vn-json/core'),canvas=require('@drincs/pixi-vn/canvas'),translator=require('@drincs/pixi-vn-json/translator'),narration=require('@drincs/pixi-vn/narration'),sound=require('@drincs/pixi-vn/sound'),pixiVn=require('@drincs/pixi-vn'),storage=require('@drincs/pixi-vn/storage');async function Je(e){let t=core.JsonUnifier.getLogichValue(e,{});if(t)switch(t.type){case "assets":switch(t.operationType){case "load":await canvas.Assets.load(t.aliases);break;case "lazyload":canvas.Assets.backgroundLoad(t.aliases);break}break;case "bundle":switch(t.operationType){case "load":await canvas.Assets.loadBundle(t.aliases);break;case "lazyload":canvas.Assets.backgroundLoadBundle(t.aliases);break}break}}var n;(o=>(o.log=(r,...l)=>console.log(`[Pixi\u2019VN Json] ${r}`,...l),o.warn=(r,...l)=>console.warn(`[Pixi\u2019VN Json] ${r}`,...l),o.error=(r,...l)=>console.error(`[Pixi\u2019VN Json] ${r}`,...l),o.info=(r,...l)=>console.info(`[Pixi\u2019VN Json] ${r}`,...l)))(n||={});async function w(e,t,i){switch(i.type){case "fade":await canvas.showWithFade(t.alias,e,i.props,i.priority);break;case "dissolve":await canvas.showWithDissolve(t.alias,e,i.props,i.priority);break;case "movein":case "moveout":await canvas.moveIn(t.alias,e,i.props,i.priority);break;case "zoomin":case "zoomout":await canvas.zoomIn(t.alias,e,i.props,i.priority);break;case "pushin":case "pushout":await canvas.pushIn(t.alias,e,i.props,i.priority);break}}function v(e){if(e.transition)switch(e.transition.type){case "fade":canvas.removeWithFade(e.alias,e.transition.props,e.transition.priority);break;case "dissolve":canvas.removeWithDissolve(e.alias,e.transition.props,e.transition.priority);break;case "movein":case "moveout":canvas.moveOut(e.alias,e.transition.props,e.transition.priority);break;case "zoomin":case "zoomout":canvas.zoomOut(e.alias,e.transition.props,e.transition.priority);break;case "pushin":case "pushout":canvas.pushOut(e.alias,e.transition.props,e.transition.priority);break}else canvas.canvas.remove(e.alias);}async function Oe(e){switch(e.operationType){case "show":if(e.transition){let t=new canvas.ImageSprite(e.props,e.url||e.alias);await w(t,e,e.transition);}else await canvas.showImage(e.alias,e.url,e.props);break;case "edit":{let t=canvas.canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):n.error(`Image with alias ${e.alias} not found.`);break}case "remove":v(e);break}}async function Ae(e){switch(e.operationType){case "show":if(e.transition){let t=new canvas.VideoSprite(e.props,e.url||e.alias);await w(t,e,e.transition);}else await canvas.showVideo(e.alias,e.url,e.props);break;case "edit":{let t=canvas.canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):n.error(`Video with alias ${e.alias} not found.`);break}case "remove":v(e);break;case "pause":case "resume":{let t=canvas.canvas.find(e.alias);t?t.paused=e.operationType==="pause":n.error(`Video with alias ${e.alias} not found.`);break}}}async function ke(e){switch(e.operationType){case "show":if(e.transition){let t=new canvas.ImageContainer(e.props,e.urls);await w(t,e,e.transition);}else await canvas.showImageContainer(e.alias,e.urls,e.props);break;case "edit":{let t=canvas.canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):n.error(`ImageContainer with alias ${e.alias} not found.`);break}case "remove":v(e);break}}async function Le(e){switch(e.operationType){case "show":if(e.props=e.props||{},e.props.text=translator.translator.t(e.text),e.transition){let t=new canvas.Text(e.props);await w(t,e,e.transition);}else canvas.showText(e.alias,e.text,e.props);break;case "edit":{let t=canvas.canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):n.error(`Text with alias ${e.alias} not found.`);break}case "remove":v(e);break}}async function je(e){switch(e.operationType){case "edit":try{let t=canvas.canvas.find(e.alias);t?e.props&&t.setMemory({...t.memory,...e.props}):n.error(`Canvas Element with alias ${e.alias} not found.`);}catch(t){n.error(`There was an error while trying to edit the canvas element with alias ${e.alias}.`,t);}break;case "remove":v(e);break}}function Ie(e){e.operationType==="clear"&&canvas.canvas.removeAll();}async function Ee(e){e.type==="shake"&&await canvas.shakeEffect(e.alias,e.props,e.priority);}function Re(e){switch(e.type){case "animate":canvas.canvas.animate(e.alias,e.keyframes,e.options,e.priority);break;case "animate-sequence":canvas.canvas.animate(e.alias,e.sequence,e.options,e.priority);break}}function Me(e){switch(e.type){case "input":narration.narration.requestInput({type:e.valueType},e.defaultValue);break;case "dialogue":narration.narration.dialogue=void 0;break}}function Fe(e){switch(e.operationType){case "play":e.url?sound.sound.play(e.alias,e.url,e.props):sound.sound.play(e.alias,e.props);break;case "stop":switch(e.type){case "sound":sound.sound.stop(e.alias);break;case "all":sound.sound.stopAll();break}break;case "pause":switch(e.type){case "sound":sound.sound.pause(e.alias);break;case "channel":sound.sound.findChannel(e.alias).pauseAll();break;case "all":sound.sound.pauseAll();break}break;case "resume":switch(e.type){case "sound":sound.sound.resume(e.alias);break;case "channel":sound.sound.findChannel(e.alias).resumeAll();break;case "all":sound.sound.resumeAll();break}break;case "edit":Object.entries(e.props).forEach(([t,i])=>{let a=sound.sound.find(e.alias);a&&(t==="volume"?a.volume.value=i:a.paused=i);});break}}var b="___param___";var h=class e{static init(t){t.loadAssets&&(e._loadAssets=t.loadAssets),t.soundOperation&&(e._soundOperation=t.soundOperation),t.imageOperation&&(e._imageOperation=t.imageOperation),t.videoOperation&&(e._videoOperation=t.videoOperation),t.imageContainerOperation&&(e._imageContainerOperation=t.imageContainerOperation),t.textOperation&&(e._textOperation=t.textOperation),t.canvasElementOperation&&(e._canvasElementOperation=t.canvasElementOperation),t.setStorageValue&&(e._setStorageValue=t.setStorageValue),t.setInitialStorageValue&&(e._setInitialStorageValue=t.setInitialStorageValue),t.narrationOperation&&(e._narrationOperation=t.narrationOperation),t.effectOperation&&(e._effectOperation=t.effectOperation),t.animateOperation&&(e._animateOperation=t.animateOperation),t.canvasOperation&&(e._canvasOperation=t.canvasOperation),t.getLogichValue&&(e._getLogichValue=t.getLogichValue),t.getConditionalStep&&(e._getConditionalStep=t.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return e._loadAssets}static _soundOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return e._soundOperation}static _imageOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return e._imageOperation}static _videoOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return e._videoOperation}static _imageContainerOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return e._imageContainerOperation}static _textOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return e._textOperation}static _canvasElementOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return e._canvasElementOperation}static _setStorageValue=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return e._setStorageValue}static _setInitialStorageValue=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return e._setInitialStorageValue}static _narrationOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return e._narrationOperation}static _effectOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return e._effectOperation}static _animateOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return e._animateOperation}static _canvasOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasOperation(){return e._canvasOperation}static _getLogichValue=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return e._getLogichValue}static _getConditionalStep=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return e._getConditionalStep}};function _(e,t){if(t&&typeof t=="object"&&typeof e.functionName=="string"&&e.functionName in t){let i=t[e.functionName];if(typeof i=="function"){let a=e.args.map(o=>h.getLogichValue(o,t));return i(...a)}else n.warn(`getLogichValue function ${e.functionName} not found in props`);}}function z(e,t){let i=core.JsonUnifier.getLogichValue(e,t);return i&&typeof i=="object"&&"type"in i?core.JsonUnifier.getLogichValue(i,t):i}function ui(e,t={}){let i=z(e.value,t);switch(e.storageType){case "flagStorage":storage.storage.setFlag(e.key,e.value);break;case "storage":storage.storage.set(e.key,i);break;case "tempstorage":storage.storage.setTempVariable(e.key,i);break;case "params":{let a=storage.storage.get(`${b}${narration.narration.openedLabels.length-1}`)||[];a.length>e.key&&(a[e.key]=i),storage.storage.setTempVariable(`${b}${narration.narration.openedLabels.length-1}`,a);break}}}function di(e,t={}){let i=z(e.value,t);switch(e.storageType){case "storage":case "tempstorage":storage.storage.default={[e.key]:i};break}}function k(e,t={}){let i=L(e,t);if(i&&typeof i=="object"&&"type"in i)switch(i.type){case "value":return xe(i,t);case "arithmetic":case "arithmeticsingle":return me(i,t);case "compare":case "union":return ge(i,t);case "function":return _(i,t)}return i}function me(e,t){let i=core.JsonUnifier.getLogichValue(e.leftValue,t);switch(e.type){case "arithmetic":{let a=core.JsonUnifier.getLogichValue(e.rightValue,t);switch(e.operator){case "*":return i*a;case "/":return i/a;case "+":return typeof i=="string"||typeof a=="string"?`${i}${a}`:Array.isArray(i)&&Array.isArray(a)?[...i,...a]:Array.isArray(i)?[...i,a]:Array.isArray(a)?[i,...a]:i+a;case "-":if(Array.isArray(i)&&Array.isArray(a))return i.filter(o=>!a.includes(o));if(Array.isArray(i))return i.filter(o=>o!==a);if(Array.isArray(a)){n.warn("getValueFromArithmeticOperations cannot subtract array from non-array");return}return i-a;case "%":return i%a;case "POW":return i**a;case "RANDOM":return narration.narration.getRandomNumber(i,a);case "INTERSECTION":if(Array.isArray(i)&&Array.isArray(a))return i.filter(o=>a.includes(o));n.warn("getValueFromArithmeticOperations cannot intersect non-array values");return;default:n.warn("getValueFromArithmeticOperations unknown operator",e);return}}case "arithmeticsingle":switch(e.operator){case "INT":return Number(i);case "FLOOR":return Math.floor(i);}break}}function xe(e,t){if(e&&typeof e=="object"&&"type"in e&&e.type==="value"&&e.storageOperationType==="get")switch(e.storageType){case "storage":case "tempstorage":return e.key==="_input_value_"?narration.narration.inputValue:storage.storage.get(e.key);case "flagStorage":return storage.storage.getFlag(e.key);case "label":return narration.narration.getTimesLabelOpened(e.label);case "choice":return narration.narration.getTimesChoiceMade(e.index);case "logic":return core.JsonUnifier.getLogichValue(e.operation,t);case "params":{let i=storage.storage.get(`${b}${narration.narration.openedLabels.length-1}`)||[];if(i&&i.length>e.key)return i[e.key];n.warn("getValue params not found");return}}return e}function ge(e,t){if(!e)return false;if(typeof e!="object"||!("type"in e))return !!e;switch(e.type){case "compare":{let i=core.JsonUnifier.getLogichValue(e.leftValue,t),a=core.JsonUnifier.getLogichValue(e.rightValue,t);switch(e.operator){case "==":return Array.isArray(i)&&Array.isArray(a)?i.length===a.length&&i.every(o=>a.includes(o)):i===a;case "!=":return Array.isArray(i)&&Array.isArray(a)?i.length!==a.length||!i.every(o=>a.includes(o)):i!==a;case "<":return typeof i=="string"&&typeof a=="string"?i.localeCompare(a)<0:Array.isArray(i)&&Array.isArray(a)?i.length<a.length:i<a;case "<=":return typeof i=="string"&&typeof a=="string"?i.localeCompare(a)<=0:Array.isArray(i)&&Array.isArray(a)?i.length<=a.length:i<=a;case ">":return typeof i=="string"&&typeof a=="string"?i.localeCompare(a)>0:Array.isArray(i)&&Array.isArray(a)?i.length>a.length:i>a;case ">=":return typeof i=="string"&&typeof a=="string"?i.localeCompare(a)>=0:Array.isArray(i)&&Array.isArray(a)?i.length>=a.length:i>=a;case "CONTAINS":return Array.isArray(i)&&Array.isArray(a)?a.every(o=>i.includes(o)):Array.isArray(i)?i.includes(a):i.toString().includes(a.toString())}break}case "value":{let i=core.JsonUnifier.getLogichValue(e,t);return Array.isArray(i)?i.length>0:i&&typeof i=="object"?Object.keys(i).length>0:!!i}case "union":return Ve(e,t)}return !!e}function Ve(e,t){if(e.unionType==="not"){let a=k(e.condition,t);return Array.isArray(a)?a.length===0:a&&typeof a=="object"?Object.keys(a).length===0:!a}let i=a=>core.JsonUnifier.getLogichValue(a,t)||false;return e.unionType==="and"?e.conditions.every(i):e.conditions.some(i)}function fe(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function L(e,t={}){if(Array.isArray(e)||!e)return e;if(e&&typeof e=="object"&&"type"in e)switch(e.type){case "resulttocombine":return ye(e,t);case "ifelse":return core.JsonUnifier.getLogichValue(e.condition,t)?core.JsonUnifier.getLogichValue(e.then,t):core.JsonUnifier.getLogichValue(e.else,t);case "stepswitch":{let i=core.JsonUnifier.getLogichValue(e.elements,t)||[];if(i.length===0){n.error("getValueFromConditionalStatements elements.length === 0");return}switch(e.choiceType){case "random":{let a=fe(0,i.length-1);return core.JsonUnifier.getLogichValue(i[a],t)}case "loop":{let a=narration.NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return a>i.length-1?(a=a%i.length,core.JsonUnifier.getLogichValue(i[a],t)):core.JsonUnifier.getLogichValue(i[a],t)}case "sequential":{let a,o=narration.NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return e.end==="lastItem"&&(a=core.JsonUnifier.getLogichValue(i[i.length-1],t)),o>i.length-1?a:core.JsonUnifier.getLogichValue(i[o],t)}case "sequentialrandom":{let a=narration.NarrationManagerStatic.getRandomNumber(0,i.length-1,{nestedId:e.nestedId,onceOnly:true});if(a===void 0&&e.end==="lastItem"){let o=narration.NarrationManagerStatic.getCurrentStepTimesCounterData(e.nestedId);if(!o?.usedRandomNumbers){n.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}let r=o.usedRandomNumbers[`0-${i.length-1}`];return core.JsonUnifier.getLogichValue(i[r[r.length-1]],t)}if(a===void 0){n.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}return core.JsonUnifier.getLogichValue(i[a],t)}}}}return e}function M(e,t={}){if(e.conditionalStep){let i=pixiVn.createExportableElement(core.JsonUnifier.getLogichValue(e.conditionalStep,t));if(i?.glueEnabled===void 0&&delete i?.glueEnabled,i?.goNextStep===void 0&&delete i?.goNextStep,i?.end===void 0&&delete i?.end,i?.choices===void 0&&delete i?.choices,i?.dialogue===void 0&&delete i?.dialogue,i?.labelToOpen===void 0&&delete i?.labelToOpen,i?.operations===void 0&&delete i?.operations,i){let a={...e,conditionalStep:void 0,...i};return M(a,t)}else narration.narration.dialogGlue&&(narration.narration.dialogGlue=false);}return e}function ye(e,t){let i=e.firstItem,a=(e.secondConditionalItem??[]).flatMap(r=>Array.isArray(r)?r.map(l=>core.JsonUnifier.getLogichValue(l,t)):[core.JsonUnifier.getLogichValue(r,t)]),o=i?[i,...a]:a;if(o.length===0){n.warn("combinateResult toCheck.length === 0");return}if(typeof o[0]=="string")return translator.translator.t(o);if(typeof o[0]=="object"){let r=o,l,P=false,N=r.map((c,f)=>{c=M(c,t);let u=core.JsonUnifier.getLogichValue(c.dialogue,t)||"";return f===0?(l=core.JsonUnifier.getLogichValue(c.glueEnabled,t)||false,u):(typeof u=="object"&&"text"in u&&(u=`${u.character}: ${u.text}`),l===false&&P&&(u=`
|
|
2
2
|
|
|
3
|
-
${u}`),u&&(P=true),
|
|
3
|
+
${u}`),u&&(P=true),l=core.JsonUnifier.getLogichValue(c.glueEnabled,t)||false,u)}),V=core.JsonUnifier.getLogichValue(N[0],t),y=typeof V=="object"&&"character"in V?V.character:void 0,J=N.flatMap(c=>{let f;c&&typeof c=="object"&&"text"in c?f=c.text:f=c;let u;return Array.isArray(f)?u=f.map(F=>{let D=core.JsonUnifier.getLogichValue(F,t);return translator.translator.t(`${D}`)}):u=core.JsonUnifier.getLogichValue(f,t)||"",translator.translator.t(u)}),C=r.find(c=>c.end),G=r.find(c=>c.choices),j=false,I=false;r.length>0&&(r[0].glueEnabled&&r[0].goNextStep&&r[0].dialogue===void 0&&(narration.narration.dialogGlue=true),j=r[r.length-1].glueEnabled,I=r.reverse().find(c=>!(c.operations&&(!c.dialogue||!c.choices)))?.goNextStep);let $=r.find(c=>c.labelToOpen),O=[];return r.forEach(c=>{c.operations&&(O=[...O,...c.operations]);}),{dialogue:y?{character:y,text:J}:J,end:C?.end,choices:G?.choices,glueEnabled:j,goNextStep:I,labelToOpen:$?.labelToOpen,operations:O}}}exports.VariableGetter=void 0;(o=>{let e=new Set;function t(r){e.add(r);}o.add=t;function i(){e.clear();}o.clear=i;function a(r,l={}){let P=y=>k(y,l)??void 0,N=L(r,l);if(e.size===0)return P(N);let V=P;for(let y of e){let J=V;V=C=>y(C,J)??void 0;}return V(N)}o.getLogichValue=a;})(exports.VariableGetter||={});exports.animateOperation=Re;exports.canvasElementOperation=je;exports.canvasOperation=Ie;exports.effectOperation=Ee;exports.getConditionalStep=M;exports.getLogichValue=k;exports.getValueFromConditionalStatements=L;exports.imageContainerOperation=ke;exports.imageOperation=Oe;exports.loadAssets=Je;exports.narrationOperation=Me;exports.setInitialStorageValue=di;exports.setStorageValue=ui;exports.soundOperation=Fe;exports.textOperation=Le;exports.videoOperation=Ae;
|
package/dist/actions.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PixiVNJsonOperation, a as PixiVNJsonIfElse, b as PixiVNJsonOperationString, r as PixiVNJsonCanvasAnimate, m as PixiVNJsonUnknownEdit, f as PixiVNJsonCanvasRemove, q as PixiVNJsonCanvasEffect, i as PixiVNJsonCanvasImageContainerShow, j as PixiVNJsonImageContainerEdit, d as PixiVNJsonCanvasImageVideoShow, e as PixiVNJsonImageEdit, k as PixiVNJsonCanvasTextShow, l as PixiVNJsonTextEdit, g as PixiVNJsonVideoEdit, h as PixiVNJsonVideoPauseResume, p as PixiVNJsonNarration, c as PixiVNJsonSound,
|
|
1
|
+
import { P as PixiVNJsonOperation, a as PixiVNJsonIfElse, b as PixiVNJsonOperationString, r as PixiVNJsonCanvasAnimate, m as PixiVNJsonUnknownEdit, f as PixiVNJsonCanvasRemove, s as PixiVNJsonCanvasClear, q as PixiVNJsonCanvasEffect, i as PixiVNJsonCanvasImageContainerShow, j as PixiVNJsonImageContainerEdit, d as PixiVNJsonCanvasImageVideoShow, e as PixiVNJsonImageEdit, k as PixiVNJsonCanvasTextShow, l as PixiVNJsonTextEdit, g as PixiVNJsonVideoEdit, h as PixiVNJsonVideoPauseResume, p as PixiVNJsonNarration, c as PixiVNJsonSound, x as PixiVNJsonLabelStep, t as PixiVNJsonValueGet, u as PixiVNJsonArithmeticOperations, v as PixiVNJsonConditions, Q as PixiVNJsonFunction, w as PixiVNJsonConditionalStatements, L as PixiVNJsonConditionalResultToCombine, o as PixiVNJsonOnlyStorageSet, n as PixiVNJsonValueSet } from './PixiVNJsonLabelStep-DKmA62M_.cjs';
|
|
2
2
|
import { ImageSpriteMemory, VideoSpriteMemory, ContainerMemory, ContainerChild } from '@drincs/pixi-vn/canvas';
|
|
3
3
|
import { StepLabelPropsType } from '@drincs/pixi-vn/narration';
|
|
4
4
|
import { StorageElementType } from '@drincs/pixi-vn/storage';
|
|
@@ -48,6 +48,12 @@ declare function textOperation(operation: PixiVNJsonCanvasRemove | PixiVNJsonCan
|
|
|
48
48
|
* @param operation - The generic canvas-element operation descriptor.
|
|
49
49
|
*/
|
|
50
50
|
declare function canvasElementOperation(operation: PixiVNJsonUnknownEdit<ImageSpriteMemory | VideoSpriteMemory | ContainerMemory<ContainerChild>> | PixiVNJsonCanvasRemove): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Handles generic canvas-wide operations (e.g. clearing every element).
|
|
53
|
+
*
|
|
54
|
+
* @param operation - The canvas operation descriptor.
|
|
55
|
+
*/
|
|
56
|
+
declare function canvasOperation(operation: PixiVNJsonCanvasClear): void;
|
|
51
57
|
/**
|
|
52
58
|
* Applies a visual effect (e.g. shake) to a canvas element.
|
|
53
59
|
*
|
|
@@ -125,4 +131,4 @@ declare function getValueFromConditionalStatements<T>(statement: PixiVNJsonCondi
|
|
|
125
131
|
*/
|
|
126
132
|
declare function getConditionalStep(originalStep: PixiVNJsonLabelStep, props?: StepLabelPropsType): PixiVNJsonLabelStep;
|
|
127
133
|
|
|
128
|
-
export { animateOperation, canvasElementOperation, effectOperation, getConditionalStep, getLogichValue, getValueFromConditionalStatements, imageContainerOperation, imageOperation, loadAssets, narrationOperation, setInitialStorageValue, setStorageValue, soundOperation, textOperation, videoOperation };
|
|
134
|
+
export { animateOperation, canvasElementOperation, canvasOperation, effectOperation, getConditionalStep, getLogichValue, getValueFromConditionalStatements, imageContainerOperation, imageOperation, loadAssets, narrationOperation, setInitialStorageValue, setStorageValue, soundOperation, textOperation, videoOperation };
|
package/dist/actions.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PixiVNJsonOperation, a as PixiVNJsonIfElse, b as PixiVNJsonOperationString, r as PixiVNJsonCanvasAnimate, m as PixiVNJsonUnknownEdit, f as PixiVNJsonCanvasRemove, q as PixiVNJsonCanvasEffect, i as PixiVNJsonCanvasImageContainerShow, j as PixiVNJsonImageContainerEdit, d as PixiVNJsonCanvasImageVideoShow, e as PixiVNJsonImageEdit, k as PixiVNJsonCanvasTextShow, l as PixiVNJsonTextEdit, g as PixiVNJsonVideoEdit, h as PixiVNJsonVideoPauseResume, p as PixiVNJsonNarration, c as PixiVNJsonSound,
|
|
1
|
+
import { P as PixiVNJsonOperation, a as PixiVNJsonIfElse, b as PixiVNJsonOperationString, r as PixiVNJsonCanvasAnimate, m as PixiVNJsonUnknownEdit, f as PixiVNJsonCanvasRemove, s as PixiVNJsonCanvasClear, q as PixiVNJsonCanvasEffect, i as PixiVNJsonCanvasImageContainerShow, j as PixiVNJsonImageContainerEdit, d as PixiVNJsonCanvasImageVideoShow, e as PixiVNJsonImageEdit, k as PixiVNJsonCanvasTextShow, l as PixiVNJsonTextEdit, g as PixiVNJsonVideoEdit, h as PixiVNJsonVideoPauseResume, p as PixiVNJsonNarration, c as PixiVNJsonSound, x as PixiVNJsonLabelStep, t as PixiVNJsonValueGet, u as PixiVNJsonArithmeticOperations, v as PixiVNJsonConditions, Q as PixiVNJsonFunction, w as PixiVNJsonConditionalStatements, L as PixiVNJsonConditionalResultToCombine, o as PixiVNJsonOnlyStorageSet, n as PixiVNJsonValueSet } from './PixiVNJsonLabelStep-DKmA62M_.js';
|
|
2
2
|
import { ImageSpriteMemory, VideoSpriteMemory, ContainerMemory, ContainerChild } from '@drincs/pixi-vn/canvas';
|
|
3
3
|
import { StepLabelPropsType } from '@drincs/pixi-vn/narration';
|
|
4
4
|
import { StorageElementType } from '@drincs/pixi-vn/storage';
|
|
@@ -48,6 +48,12 @@ declare function textOperation(operation: PixiVNJsonCanvasRemove | PixiVNJsonCan
|
|
|
48
48
|
* @param operation - The generic canvas-element operation descriptor.
|
|
49
49
|
*/
|
|
50
50
|
declare function canvasElementOperation(operation: PixiVNJsonUnknownEdit<ImageSpriteMemory | VideoSpriteMemory | ContainerMemory<ContainerChild>> | PixiVNJsonCanvasRemove): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Handles generic canvas-wide operations (e.g. clearing every element).
|
|
53
|
+
*
|
|
54
|
+
* @param operation - The canvas operation descriptor.
|
|
55
|
+
*/
|
|
56
|
+
declare function canvasOperation(operation: PixiVNJsonCanvasClear): void;
|
|
51
57
|
/**
|
|
52
58
|
* Applies a visual effect (e.g. shake) to a canvas element.
|
|
53
59
|
*
|
|
@@ -125,4 +131,4 @@ declare function getValueFromConditionalStatements<T>(statement: PixiVNJsonCondi
|
|
|
125
131
|
*/
|
|
126
132
|
declare function getConditionalStep(originalStep: PixiVNJsonLabelStep, props?: StepLabelPropsType): PixiVNJsonLabelStep;
|
|
127
133
|
|
|
128
|
-
export { animateOperation, canvasElementOperation, effectOperation, getConditionalStep, getLogichValue, getValueFromConditionalStatements, imageContainerOperation, imageOperation, loadAssets, narrationOperation, setInitialStorageValue, setStorageValue, soundOperation, textOperation, videoOperation };
|
|
134
|
+
export { animateOperation, canvasElementOperation, canvasOperation, effectOperation, getConditionalStep, getLogichValue, getValueFromConditionalStatements, imageContainerOperation, imageOperation, loadAssets, narrationOperation, setInitialStorageValue, setStorageValue, soundOperation, textOperation, videoOperation };
|
package/dist/actions.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {JsonUnifier}from'@drincs/pixi-vn-json/core';import {Assets,canvas,ImageSprite,showImage,VideoSprite,showVideo,ImageContainer,showImageContainer,Text,showText,shakeEffect,pushOut,zoomOut,moveOut,removeWithDissolve,removeWithFade,pushIn,zoomIn,moveIn,showWithDissolve,showWithFade}from'@drincs/pixi-vn/canvas';import {translator}from'@drincs/pixi-vn-json/translator';import {NarrationManagerStatic,narration}from'@drincs/pixi-vn/narration';import {sound}from'@drincs/pixi-vn/sound';import {createExportableElement,PixiError}from'@drincs/pixi-vn';import {storage}from'@drincs/pixi-vn/storage';async function Je(e){let t=JsonUnifier.getLogichValue(e,{});if(t)switch(t.type){case "assets":switch(t.operationType){case "load":await Assets.load(t.aliases);break;case "lazyload":Assets.backgroundLoad(t.aliases);break}break;case "bundle":switch(t.operationType){case "load":await Assets.loadBundle(t.aliases);break;case "lazyload":Assets.backgroundLoadBundle(t.aliases);break}break}}var a;(o=>(o.log=(r,...c)=>console.log(`[Pixi\u2019VN Json] ${r}`,...c),o.warn=(r,...c)=>console.warn(`[Pixi\u2019VN Json] ${r}`,...c),o.error=(r,...c)=>console.error(`[Pixi\u2019VN Json] ${r}`,...c),o.info=(r,...c)=>console.info(`[Pixi\u2019VN Json] ${r}`,...c)))(a||={});async function b(e,t,i){switch(i.type){case "fade":await showWithFade(t.alias,e,i.props,i.priority);break;case "dissolve":await showWithDissolve(t.alias,e,i.props,i.priority);break;case "movein":case "moveout":await moveIn(t.alias,e,i.props,i.priority);break;case "zoomin":case "zoomout":await zoomIn(t.alias,e,i.props,i.priority);break;case "pushin":case "pushout":await pushIn(t.alias,e,i.props,i.priority);break}}function v(e){if(e.transition)switch(e.transition.type){case "fade":removeWithFade(e.alias,e.transition.props,e.transition.priority);break;case "dissolve":removeWithDissolve(e.alias,e.transition.props,e.transition.priority);break;case "movein":case "moveout":moveOut(e.alias,e.transition.props,e.transition.priority);break;case "zoomin":case "zoomout":zoomOut(e.alias,e.transition.props,e.transition.priority);break;case "pushin":case "pushout":pushOut(e.alias,e.transition.props,e.transition.priority);break}else canvas.remove(e.alias);}async function Oe(e){switch(e.operationType){case "show":if(e.transition){let t=new ImageSprite(e.props,e.url||e.alias);await b(t,e,e.transition);}else await showImage(e.alias,e.url,e.props);break;case "edit":{let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):a.error(`Image with alias ${e.alias} not found.`);break}case "remove":v(e);break}}async function Ae(e){switch(e.operationType){case "show":if(e.transition){let t=new VideoSprite(e.props,e.url||e.alias);await b(t,e,e.transition);}else await showVideo(e.alias,e.url,e.props);break;case "edit":{let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):a.error(`Video with alias ${e.alias} not found.`);break}case "remove":v(e);break;case "pause":case "resume":{let t=canvas.find(e.alias);t?t.paused=e.operationType==="pause":a.error(`Video with alias ${e.alias} not found.`);break}}}async function ke(e){switch(e.operationType){case "show":if(e.transition){let t=new ImageContainer(e.props,e.urls);await b(t,e,e.transition);}else await showImageContainer(e.alias,e.urls,e.props);break;case "edit":{let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):a.error(`ImageContainer with alias ${e.alias} not found.`);break}case "remove":v(e);break}}async function Le(e){switch(e.operationType){case "show":if(e.props=e.props||{},e.props.text=translator.t(e.text),e.transition){let t=new Text(e.props);await b(t,e,e.transition);}else showText(e.alias,e.text,e.props);break;case "edit":{let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):a.error(`Text with alias ${e.alias} not found.`);break}case "remove":v(e);break}}async function je(e){switch(e.operationType){case "edit":try{let t=canvas.find(e.alias);t?e.props&&t.setMemory({...t.memory,...e.props}):a.error(`Canvas Element with alias ${e.alias} not found.`);}catch(t){a.error(`There was an error while trying to edit the canvas element with alias ${e.alias}.`,t);}break;case "remove":v(e);break}}async function Ie(e){e.type==="shake"&&await shakeEffect(e.alias,e.props,e.priority);}function Ee(e){switch(e.type){case "animate":canvas.animate(e.alias,e.keyframes,e.options,e.priority);break;case "animate-sequence":canvas.animate(e.alias,e.sequence,e.options,e.priority);break}}function ze(e){switch(e.type){case "input":narration.requestInput({type:e.valueType},e.defaultValue);break;case "dialogue":narration.dialogue=void 0;break}}function $e(e){switch(e.operationType){case "play":e.url?sound.play(e.alias,e.url,e.props):sound.play(e.alias,e.props);break;case "stop":switch(e.type){case "sound":sound.stop(e.alias);break;case "all":sound.stopAll();break}break;case "pause":switch(e.type){case "sound":sound.pause(e.alias);break;case "channel":sound.findChannel(e.alias).pauseAll();break;case "all":sound.pauseAll();break}break;case "resume":switch(e.type){case "sound":sound.resume(e.alias);break;case "channel":sound.findChannel(e.alias).resumeAll();break;case "all":sound.resumeAll();break}break;case "edit":Object.entries(e.props).forEach(([t,i])=>{let n=sound.find(e.alias);n&&(t==="volume"?n.volume.value=i:n.paused=i);});break}}var T="___param___";var h=class e{static init(t){t.loadAssets&&(e._loadAssets=t.loadAssets),t.soundOperation&&(e._soundOperation=t.soundOperation),t.imageOperation&&(e._imageOperation=t.imageOperation),t.videoOperation&&(e._videoOperation=t.videoOperation),t.imageContainerOperation&&(e._imageContainerOperation=t.imageContainerOperation),t.textOperation&&(e._textOperation=t.textOperation),t.canvasElementOperation&&(e._canvasElementOperation=t.canvasElementOperation),t.setStorageValue&&(e._setStorageValue=t.setStorageValue),t.setInitialStorageValue&&(e._setInitialStorageValue=t.setInitialStorageValue),t.narrationOperation&&(e._narrationOperation=t.narrationOperation),t.effectOperation&&(e._effectOperation=t.effectOperation),t.animateOperation&&(e._animateOperation=t.animateOperation),t.getLogichValue&&(e._getLogichValue=t.getLogichValue),t.getConditionalStep&&(e._getConditionalStep=t.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return e._loadAssets}static _soundOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return e._soundOperation}static _imageOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return e._imageOperation}static _videoOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return e._videoOperation}static _imageContainerOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return e._imageContainerOperation}static _textOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return e._textOperation}static _canvasElementOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return e._canvasElementOperation}static _setStorageValue=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return e._setStorageValue}static _setInitialStorageValue=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return e._setInitialStorageValue}static _narrationOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return e._narrationOperation}static _effectOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return e._effectOperation}static _animateOperation=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return e._animateOperation}static _getLogichValue=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return e._getLogichValue}static _getConditionalStep=()=>{throw a.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return e._getConditionalStep}};function _(e,t){if(t&&typeof t=="object"&&typeof e.functionName=="string"&&e.functionName in t){let i=t[e.functionName];if(typeof i=="function"){let n=e.args.map(o=>h.getLogichValue(o,t));return i(...n)}else a.warn(`getLogichValue function ${e.functionName} not found in props`);}}function z(e,t){let i=JsonUnifier.getLogichValue(e,t);return i&&typeof i=="object"&&"type"in i?JsonUnifier.getLogichValue(i,t):i}function ci(e,t={}){let i=z(e.value,t);switch(e.storageType){case "flagStorage":storage.setFlag(e.key,e.value);break;case "storage":storage.set(e.key,i);break;case "tempstorage":storage.setTempVariable(e.key,i);break;case "params":{let n=storage.get(`${T}${narration.openedLabels.length-1}`)||[];n.length>e.key&&(n[e.key]=i),storage.setTempVariable(`${T}${narration.openedLabels.length-1}`,n);break}}}function ui(e,t={}){let i=z(e.value,t);switch(e.storageType){case "storage":case "tempstorage":storage.default={[e.key]:i};break}}function k(e,t={}){let i=L(e,t);if(i&&typeof i=="object"&&"type"in i)switch(i.type){case "value":return ge(i,t);case "arithmetic":case "arithmeticsingle":return me(i,t);case "compare":case "union":return xe(i,t);case "function":return _(i,t)}return i}function me(e,t){let i=JsonUnifier.getLogichValue(e.leftValue,t);switch(e.type){case "arithmetic":{let n=JsonUnifier.getLogichValue(e.rightValue,t);switch(e.operator){case "*":return i*n;case "/":return i/n;case "+":return typeof i=="string"||typeof n=="string"?`${i}${n}`:Array.isArray(i)&&Array.isArray(n)?[...i,...n]:Array.isArray(i)?[...i,n]:Array.isArray(n)?[i,...n]:i+n;case "-":if(Array.isArray(i)&&Array.isArray(n))return i.filter(o=>!n.includes(o));if(Array.isArray(i))return i.filter(o=>o!==n);if(Array.isArray(n)){a.warn("getValueFromArithmeticOperations cannot subtract array from non-array");return}return i-n;case "%":return i%n;case "POW":return i**n;case "RANDOM":return narration.getRandomNumber(i,n);case "INTERSECTION":if(Array.isArray(i)&&Array.isArray(n))return i.filter(o=>n.includes(o));a.warn("getValueFromArithmeticOperations cannot intersect non-array values");return;default:a.warn("getValueFromArithmeticOperations unknown operator",e);return}}case "arithmeticsingle":switch(e.operator){case "INT":return Number(i);case "FLOOR":return Math.floor(i);}break}}function ge(e,t){if(e&&typeof e=="object"&&"type"in e&&e.type==="value"&&e.storageOperationType==="get")switch(e.storageType){case "storage":case "tempstorage":return e.key==="_input_value_"?narration.inputValue:storage.get(e.key);case "flagStorage":return storage.getFlag(e.key);case "label":return narration.getTimesLabelOpened(e.label);case "choice":return narration.getTimesChoiceMade(e.index);case "logic":return JsonUnifier.getLogichValue(e.operation,t);case "params":{let i=storage.get(`${T}${narration.openedLabels.length-1}`)||[];if(i&&i.length>e.key)return i[e.key];a.warn("getValue params not found");return}}return e}function xe(e,t){if(!e)return false;if(typeof e!="object"||!("type"in e))return !!e;switch(e.type){case "compare":{let i=JsonUnifier.getLogichValue(e.leftValue,t),n=JsonUnifier.getLogichValue(e.rightValue,t);switch(e.operator){case "==":return Array.isArray(i)&&Array.isArray(n)?i.length===n.length&&i.every(o=>n.includes(o)):i===n;case "!=":return Array.isArray(i)&&Array.isArray(n)?i.length!==n.length||!i.every(o=>n.includes(o)):i!==n;case "<":return typeof i=="string"&&typeof n=="string"?i.localeCompare(n)<0:Array.isArray(i)&&Array.isArray(n)?i.length<n.length:i<n;case "<=":return typeof i=="string"&&typeof n=="string"?i.localeCompare(n)<=0:Array.isArray(i)&&Array.isArray(n)?i.length<=n.length:i<=n;case ">":return typeof i=="string"&&typeof n=="string"?i.localeCompare(n)>0:Array.isArray(i)&&Array.isArray(n)?i.length>n.length:i>n;case ">=":return typeof i=="string"&&typeof n=="string"?i.localeCompare(n)>=0:Array.isArray(i)&&Array.isArray(n)?i.length>=n.length:i>=n;case "CONTAINS":return Array.isArray(i)&&Array.isArray(n)?n.every(o=>i.includes(o)):Array.isArray(i)?i.includes(n):i.toString().includes(n.toString())}break}case "value":{let i=JsonUnifier.getLogichValue(e,t);return Array.isArray(i)?i.length>0:i&&typeof i=="object"?Object.keys(i).length>0:!!i}case "union":return Ve(e,t)}return !!e}function Ve(e,t){if(e.unionType==="not"){let n=k(e.condition,t);return Array.isArray(n)?n.length===0:n&&typeof n=="object"?Object.keys(n).length===0:!n}let i=n=>JsonUnifier.getLogichValue(n,t)||false;return e.unionType==="and"?e.conditions.every(i):e.conditions.some(i)}function fe(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function L(e,t={}){if(Array.isArray(e)||!e)return e;if(e&&typeof e=="object"&&"type"in e)switch(e.type){case "resulttocombine":return ye(e,t);case "ifelse":return JsonUnifier.getLogichValue(e.condition,t)?JsonUnifier.getLogichValue(e.then,t):JsonUnifier.getLogichValue(e.else,t);case "stepswitch":{let i=JsonUnifier.getLogichValue(e.elements,t)||[];if(i.length===0){a.error("getValueFromConditionalStatements elements.length === 0");return}switch(e.choiceType){case "random":{let n=fe(0,i.length-1);return JsonUnifier.getLogichValue(i[n],t)}case "loop":{let n=NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return n>i.length-1?(n=n%i.length,JsonUnifier.getLogichValue(i[n],t)):JsonUnifier.getLogichValue(i[n],t)}case "sequential":{let n,o=NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return e.end==="lastItem"&&(n=JsonUnifier.getLogichValue(i[i.length-1],t)),o>i.length-1?n:JsonUnifier.getLogichValue(i[o],t)}case "sequentialrandom":{let n=NarrationManagerStatic.getRandomNumber(0,i.length-1,{nestedId:e.nestedId,onceOnly:true});if(n===void 0&&e.end==="lastItem"){let o=NarrationManagerStatic.getCurrentStepTimesCounterData(e.nestedId);if(!o?.usedRandomNumbers){a.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}let r=o.usedRandomNumbers[`0-${i.length-1}`];return JsonUnifier.getLogichValue(i[r[r.length-1]],t)}if(n===void 0){a.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}return JsonUnifier.getLogichValue(i[n],t)}}}}return e}function M(e,t={}){if(e.conditionalStep){let i=createExportableElement(JsonUnifier.getLogichValue(e.conditionalStep,t));if(i?.glueEnabled===void 0&&delete i?.glueEnabled,i?.goNextStep===void 0&&delete i?.goNextStep,i?.end===void 0&&delete i?.end,i?.choices===void 0&&delete i?.choices,i?.dialogue===void 0&&delete i?.dialogue,i?.labelToOpen===void 0&&delete i?.labelToOpen,i?.operations===void 0&&delete i?.operations,i){let n={...e,conditionalStep:void 0,...i};return M(n,t)}else narration.dialogGlue&&(narration.dialogGlue=false);}return e}function ye(e,t){let i=e.firstItem,n=(e.secondConditionalItem??[]).flatMap(r=>Array.isArray(r)?r.map(c=>JsonUnifier.getLogichValue(c,t)):[JsonUnifier.getLogichValue(r,t)]),o=i?[i,...n]:n;if(o.length===0){a.warn("combinateResult toCheck.length === 0");return}if(typeof o[0]=="string")return translator.t(o);if(typeof o[0]=="object"){let r=o,c,P=false,N=r.map((l,f)=>{l=M(l,t);let u=JsonUnifier.getLogichValue(l.dialogue,t)||"";return f===0?(c=JsonUnifier.getLogichValue(l.glueEnabled,t)||false,u):(typeof u=="object"&&"text"in u&&(u=`${u.character}: ${u.text}`),c===false&&P&&(u=`
|
|
1
|
+
import {JsonUnifier}from'@drincs/pixi-vn-json/core';import {Assets,canvas,ImageSprite,showImage,VideoSprite,showVideo,ImageContainer,showImageContainer,Text,showText,shakeEffect,pushOut,zoomOut,moveOut,removeWithDissolve,removeWithFade,pushIn,zoomIn,moveIn,showWithDissolve,showWithFade}from'@drincs/pixi-vn/canvas';import {translator}from'@drincs/pixi-vn-json/translator';import {NarrationManagerStatic,narration}from'@drincs/pixi-vn/narration';import {sound}from'@drincs/pixi-vn/sound';import {createExportableElement,PixiError}from'@drincs/pixi-vn';import {storage}from'@drincs/pixi-vn/storage';async function Je(e){let t=JsonUnifier.getLogichValue(e,{});if(t)switch(t.type){case "assets":switch(t.operationType){case "load":await Assets.load(t.aliases);break;case "lazyload":Assets.backgroundLoad(t.aliases);break}break;case "bundle":switch(t.operationType){case "load":await Assets.loadBundle(t.aliases);break;case "lazyload":Assets.backgroundLoadBundle(t.aliases);break}break}}var n;(o=>(o.log=(r,...l)=>console.log(`[Pixi\u2019VN Json] ${r}`,...l),o.warn=(r,...l)=>console.warn(`[Pixi\u2019VN Json] ${r}`,...l),o.error=(r,...l)=>console.error(`[Pixi\u2019VN Json] ${r}`,...l),o.info=(r,...l)=>console.info(`[Pixi\u2019VN Json] ${r}`,...l)))(n||={});async function w(e,t,i){switch(i.type){case "fade":await showWithFade(t.alias,e,i.props,i.priority);break;case "dissolve":await showWithDissolve(t.alias,e,i.props,i.priority);break;case "movein":case "moveout":await moveIn(t.alias,e,i.props,i.priority);break;case "zoomin":case "zoomout":await zoomIn(t.alias,e,i.props,i.priority);break;case "pushin":case "pushout":await pushIn(t.alias,e,i.props,i.priority);break}}function v(e){if(e.transition)switch(e.transition.type){case "fade":removeWithFade(e.alias,e.transition.props,e.transition.priority);break;case "dissolve":removeWithDissolve(e.alias,e.transition.props,e.transition.priority);break;case "movein":case "moveout":moveOut(e.alias,e.transition.props,e.transition.priority);break;case "zoomin":case "zoomout":zoomOut(e.alias,e.transition.props,e.transition.priority);break;case "pushin":case "pushout":pushOut(e.alias,e.transition.props,e.transition.priority);break}else canvas.remove(e.alias);}async function Oe(e){switch(e.operationType){case "show":if(e.transition){let t=new ImageSprite(e.props,e.url||e.alias);await w(t,e,e.transition);}else await showImage(e.alias,e.url,e.props);break;case "edit":{let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):n.error(`Image with alias ${e.alias} not found.`);break}case "remove":v(e);break}}async function Ae(e){switch(e.operationType){case "show":if(e.transition){let t=new VideoSprite(e.props,e.url||e.alias);await w(t,e,e.transition);}else await showVideo(e.alias,e.url,e.props);break;case "edit":{let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):n.error(`Video with alias ${e.alias} not found.`);break}case "remove":v(e);break;case "pause":case "resume":{let t=canvas.find(e.alias);t?t.paused=e.operationType==="pause":n.error(`Video with alias ${e.alias} not found.`);break}}}async function ke(e){switch(e.operationType){case "show":if(e.transition){let t=new ImageContainer(e.props,e.urls);await w(t,e,e.transition);}else await showImageContainer(e.alias,e.urls,e.props);break;case "edit":{let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):n.error(`ImageContainer with alias ${e.alias} not found.`);break}case "remove":v(e);break}}async function Le(e){switch(e.operationType){case "show":if(e.props=e.props||{},e.props.text=translator.t(e.text),e.transition){let t=new Text(e.props);await w(t,e,e.transition);}else showText(e.alias,e.text,e.props);break;case "edit":{let t=canvas.find(e.alias);t?e.props&&await t.setMemory({...t.memory,...e.props}):n.error(`Text with alias ${e.alias} not found.`);break}case "remove":v(e);break}}async function je(e){switch(e.operationType){case "edit":try{let t=canvas.find(e.alias);t?e.props&&t.setMemory({...t.memory,...e.props}):n.error(`Canvas Element with alias ${e.alias} not found.`);}catch(t){n.error(`There was an error while trying to edit the canvas element with alias ${e.alias}.`,t);}break;case "remove":v(e);break}}function Ie(e){e.operationType==="clear"&&canvas.removeAll();}async function Ee(e){e.type==="shake"&&await shakeEffect(e.alias,e.props,e.priority);}function Re(e){switch(e.type){case "animate":canvas.animate(e.alias,e.keyframes,e.options,e.priority);break;case "animate-sequence":canvas.animate(e.alias,e.sequence,e.options,e.priority);break}}function Me(e){switch(e.type){case "input":narration.requestInput({type:e.valueType},e.defaultValue);break;case "dialogue":narration.dialogue=void 0;break}}function Fe(e){switch(e.operationType){case "play":e.url?sound.play(e.alias,e.url,e.props):sound.play(e.alias,e.props);break;case "stop":switch(e.type){case "sound":sound.stop(e.alias);break;case "all":sound.stopAll();break}break;case "pause":switch(e.type){case "sound":sound.pause(e.alias);break;case "channel":sound.findChannel(e.alias).pauseAll();break;case "all":sound.pauseAll();break}break;case "resume":switch(e.type){case "sound":sound.resume(e.alias);break;case "channel":sound.findChannel(e.alias).resumeAll();break;case "all":sound.resumeAll();break}break;case "edit":Object.entries(e.props).forEach(([t,i])=>{let a=sound.find(e.alias);a&&(t==="volume"?a.volume.value=i:a.paused=i);});break}}var b="___param___";var h=class e{static init(t){t.loadAssets&&(e._loadAssets=t.loadAssets),t.soundOperation&&(e._soundOperation=t.soundOperation),t.imageOperation&&(e._imageOperation=t.imageOperation),t.videoOperation&&(e._videoOperation=t.videoOperation),t.imageContainerOperation&&(e._imageContainerOperation=t.imageContainerOperation),t.textOperation&&(e._textOperation=t.textOperation),t.canvasElementOperation&&(e._canvasElementOperation=t.canvasElementOperation),t.setStorageValue&&(e._setStorageValue=t.setStorageValue),t.setInitialStorageValue&&(e._setInitialStorageValue=t.setInitialStorageValue),t.narrationOperation&&(e._narrationOperation=t.narrationOperation),t.effectOperation&&(e._effectOperation=t.effectOperation),t.animateOperation&&(e._animateOperation=t.animateOperation),t.canvasOperation&&(e._canvasOperation=t.canvasOperation),t.getLogichValue&&(e._getLogichValue=t.getLogichValue),t.getConditionalStep&&(e._getConditionalStep=t.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return e._loadAssets}static _soundOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return e._soundOperation}static _imageOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return e._imageOperation}static _videoOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return e._videoOperation}static _imageContainerOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return e._imageContainerOperation}static _textOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return e._textOperation}static _canvasElementOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return e._canvasElementOperation}static _setStorageValue=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return e._setStorageValue}static _setInitialStorageValue=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return e._setInitialStorageValue}static _narrationOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return e._narrationOperation}static _effectOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return e._effectOperation}static _animateOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return e._animateOperation}static _canvasOperation=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasOperation(){return e._canvasOperation}static _getLogichValue=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return e._getLogichValue}static _getConditionalStep=()=>{throw n.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return e._getConditionalStep}};function _(e,t){if(t&&typeof t=="object"&&typeof e.functionName=="string"&&e.functionName in t){let i=t[e.functionName];if(typeof i=="function"){let a=e.args.map(o=>h.getLogichValue(o,t));return i(...a)}else n.warn(`getLogichValue function ${e.functionName} not found in props`);}}function z(e,t){let i=JsonUnifier.getLogichValue(e,t);return i&&typeof i=="object"&&"type"in i?JsonUnifier.getLogichValue(i,t):i}function ui(e,t={}){let i=z(e.value,t);switch(e.storageType){case "flagStorage":storage.setFlag(e.key,e.value);break;case "storage":storage.set(e.key,i);break;case "tempstorage":storage.setTempVariable(e.key,i);break;case "params":{let a=storage.get(`${b}${narration.openedLabels.length-1}`)||[];a.length>e.key&&(a[e.key]=i),storage.setTempVariable(`${b}${narration.openedLabels.length-1}`,a);break}}}function di(e,t={}){let i=z(e.value,t);switch(e.storageType){case "storage":case "tempstorage":storage.default={[e.key]:i};break}}function k(e,t={}){let i=L(e,t);if(i&&typeof i=="object"&&"type"in i)switch(i.type){case "value":return xe(i,t);case "arithmetic":case "arithmeticsingle":return me(i,t);case "compare":case "union":return ge(i,t);case "function":return _(i,t)}return i}function me(e,t){let i=JsonUnifier.getLogichValue(e.leftValue,t);switch(e.type){case "arithmetic":{let a=JsonUnifier.getLogichValue(e.rightValue,t);switch(e.operator){case "*":return i*a;case "/":return i/a;case "+":return typeof i=="string"||typeof a=="string"?`${i}${a}`:Array.isArray(i)&&Array.isArray(a)?[...i,...a]:Array.isArray(i)?[...i,a]:Array.isArray(a)?[i,...a]:i+a;case "-":if(Array.isArray(i)&&Array.isArray(a))return i.filter(o=>!a.includes(o));if(Array.isArray(i))return i.filter(o=>o!==a);if(Array.isArray(a)){n.warn("getValueFromArithmeticOperations cannot subtract array from non-array");return}return i-a;case "%":return i%a;case "POW":return i**a;case "RANDOM":return narration.getRandomNumber(i,a);case "INTERSECTION":if(Array.isArray(i)&&Array.isArray(a))return i.filter(o=>a.includes(o));n.warn("getValueFromArithmeticOperations cannot intersect non-array values");return;default:n.warn("getValueFromArithmeticOperations unknown operator",e);return}}case "arithmeticsingle":switch(e.operator){case "INT":return Number(i);case "FLOOR":return Math.floor(i);}break}}function xe(e,t){if(e&&typeof e=="object"&&"type"in e&&e.type==="value"&&e.storageOperationType==="get")switch(e.storageType){case "storage":case "tempstorage":return e.key==="_input_value_"?narration.inputValue:storage.get(e.key);case "flagStorage":return storage.getFlag(e.key);case "label":return narration.getTimesLabelOpened(e.label);case "choice":return narration.getTimesChoiceMade(e.index);case "logic":return JsonUnifier.getLogichValue(e.operation,t);case "params":{let i=storage.get(`${b}${narration.openedLabels.length-1}`)||[];if(i&&i.length>e.key)return i[e.key];n.warn("getValue params not found");return}}return e}function ge(e,t){if(!e)return false;if(typeof e!="object"||!("type"in e))return !!e;switch(e.type){case "compare":{let i=JsonUnifier.getLogichValue(e.leftValue,t),a=JsonUnifier.getLogichValue(e.rightValue,t);switch(e.operator){case "==":return Array.isArray(i)&&Array.isArray(a)?i.length===a.length&&i.every(o=>a.includes(o)):i===a;case "!=":return Array.isArray(i)&&Array.isArray(a)?i.length!==a.length||!i.every(o=>a.includes(o)):i!==a;case "<":return typeof i=="string"&&typeof a=="string"?i.localeCompare(a)<0:Array.isArray(i)&&Array.isArray(a)?i.length<a.length:i<a;case "<=":return typeof i=="string"&&typeof a=="string"?i.localeCompare(a)<=0:Array.isArray(i)&&Array.isArray(a)?i.length<=a.length:i<=a;case ">":return typeof i=="string"&&typeof a=="string"?i.localeCompare(a)>0:Array.isArray(i)&&Array.isArray(a)?i.length>a.length:i>a;case ">=":return typeof i=="string"&&typeof a=="string"?i.localeCompare(a)>=0:Array.isArray(i)&&Array.isArray(a)?i.length>=a.length:i>=a;case "CONTAINS":return Array.isArray(i)&&Array.isArray(a)?a.every(o=>i.includes(o)):Array.isArray(i)?i.includes(a):i.toString().includes(a.toString())}break}case "value":{let i=JsonUnifier.getLogichValue(e,t);return Array.isArray(i)?i.length>0:i&&typeof i=="object"?Object.keys(i).length>0:!!i}case "union":return Ve(e,t)}return !!e}function Ve(e,t){if(e.unionType==="not"){let a=k(e.condition,t);return Array.isArray(a)?a.length===0:a&&typeof a=="object"?Object.keys(a).length===0:!a}let i=a=>JsonUnifier.getLogichValue(a,t)||false;return e.unionType==="and"?e.conditions.every(i):e.conditions.some(i)}function fe(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function L(e,t={}){if(Array.isArray(e)||!e)return e;if(e&&typeof e=="object"&&"type"in e)switch(e.type){case "resulttocombine":return ye(e,t);case "ifelse":return JsonUnifier.getLogichValue(e.condition,t)?JsonUnifier.getLogichValue(e.then,t):JsonUnifier.getLogichValue(e.else,t);case "stepswitch":{let i=JsonUnifier.getLogichValue(e.elements,t)||[];if(i.length===0){n.error("getValueFromConditionalStatements elements.length === 0");return}switch(e.choiceType){case "random":{let a=fe(0,i.length-1);return JsonUnifier.getLogichValue(i[a],t)}case "loop":{let a=NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return a>i.length-1?(a=a%i.length,JsonUnifier.getLogichValue(i[a],t)):JsonUnifier.getLogichValue(i[a],t)}case "sequential":{let a,o=NarrationManagerStatic.getCurrentStepTimesCounter(e.nestedId)-1;return e.end==="lastItem"&&(a=JsonUnifier.getLogichValue(i[i.length-1],t)),o>i.length-1?a:JsonUnifier.getLogichValue(i[o],t)}case "sequentialrandom":{let a=NarrationManagerStatic.getRandomNumber(0,i.length-1,{nestedId:e.nestedId,onceOnly:true});if(a===void 0&&e.end==="lastItem"){let o=NarrationManagerStatic.getCurrentStepTimesCounterData(e.nestedId);if(!o?.usedRandomNumbers){n.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}let r=o.usedRandomNumbers[`0-${i.length-1}`];return JsonUnifier.getLogichValue(i[r[r.length-1]],t)}if(a===void 0){n.warn("getValueFromConditionalStatements randomIndexWhitExclude == undefined");return}return JsonUnifier.getLogichValue(i[a],t)}}}}return e}function M(e,t={}){if(e.conditionalStep){let i=createExportableElement(JsonUnifier.getLogichValue(e.conditionalStep,t));if(i?.glueEnabled===void 0&&delete i?.glueEnabled,i?.goNextStep===void 0&&delete i?.goNextStep,i?.end===void 0&&delete i?.end,i?.choices===void 0&&delete i?.choices,i?.dialogue===void 0&&delete i?.dialogue,i?.labelToOpen===void 0&&delete i?.labelToOpen,i?.operations===void 0&&delete i?.operations,i){let a={...e,conditionalStep:void 0,...i};return M(a,t)}else narration.dialogGlue&&(narration.dialogGlue=false);}return e}function ye(e,t){let i=e.firstItem,a=(e.secondConditionalItem??[]).flatMap(r=>Array.isArray(r)?r.map(l=>JsonUnifier.getLogichValue(l,t)):[JsonUnifier.getLogichValue(r,t)]),o=i?[i,...a]:a;if(o.length===0){n.warn("combinateResult toCheck.length === 0");return}if(typeof o[0]=="string")return translator.t(o);if(typeof o[0]=="object"){let r=o,l,P=false,N=r.map((c,f)=>{c=M(c,t);let u=JsonUnifier.getLogichValue(c.dialogue,t)||"";return f===0?(l=JsonUnifier.getLogichValue(c.glueEnabled,t)||false,u):(typeof u=="object"&&"text"in u&&(u=`${u.character}: ${u.text}`),l===false&&P&&(u=`
|
|
2
2
|
|
|
3
|
-
${u}`),u&&(P=true),
|
|
3
|
+
${u}`),u&&(P=true),l=JsonUnifier.getLogichValue(c.glueEnabled,t)||false,u)}),V=JsonUnifier.getLogichValue(N[0],t),y=typeof V=="object"&&"character"in V?V.character:void 0,J=N.flatMap(c=>{let f;c&&typeof c=="object"&&"text"in c?f=c.text:f=c;let u;return Array.isArray(f)?u=f.map(F=>{let D=JsonUnifier.getLogichValue(F,t);return translator.t(`${D}`)}):u=JsonUnifier.getLogichValue(f,t)||"",translator.t(u)}),C=r.find(c=>c.end),G=r.find(c=>c.choices),j=false,I=false;r.length>0&&(r[0].glueEnabled&&r[0].goNextStep&&r[0].dialogue===void 0&&(narration.dialogGlue=true),j=r[r.length-1].glueEnabled,I=r.reverse().find(c=>!(c.operations&&(!c.dialogue||!c.choices)))?.goNextStep);let $=r.find(c=>c.labelToOpen),O=[];return r.forEach(c=>{c.operations&&(O=[...O,...c.operations]);}),{dialogue:y?{character:y,text:J}:J,end:C?.end,choices:G?.choices,glueEnabled:j,goNextStep:I,labelToOpen:$?.labelToOpen,operations:O}}}var he;(o=>{let e=new Set;function t(r){e.add(r);}o.add=t;function i(){e.clear();}o.clear=i;function a(r,l={}){let P=y=>k(y,l)??void 0,N=L(r,l);if(e.size===0)return P(N);let V=P;for(let y of e){let J=V;V=C=>y(C,J)??void 0;}return V(N)}o.getLogichValue=a;})(he||={});export{he as VariableGetter,Re as animateOperation,je as canvasElementOperation,Ie as canvasOperation,Ee as effectOperation,M as getConditionalStep,k as getLogichValue,L as getValueFromConditionalStatements,ke as imageContainerOperation,Oe as imageOperation,Je as loadAssets,Me as narrationOperation,di as setInitialStorageValue,ui as setStorageValue,Fe as soundOperation,Le as textOperation,Ae as videoOperation};
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var pixiVn=require('@drincs/pixi-vn');var t;(r=>(r.log=(a,...n)=>console.log(`[Pixi\u2019VN Json] ${a}`,...n),r.warn=(a,...n)=>console.warn(`[Pixi\u2019VN Json] ${a}`,...n),r.error=(a,...n)=>console.error(`[Pixi\u2019VN Json] ${a}`,...n),r.info=(a,...n)=>console.info(`[Pixi\u2019VN Json] ${a}`,...n)))(t||={});var s=class e{static init(i){i.loadAssets&&(e._loadAssets=i.loadAssets),i.soundOperation&&(e._soundOperation=i.soundOperation),i.imageOperation&&(e._imageOperation=i.imageOperation),i.videoOperation&&(e._videoOperation=i.videoOperation),i.imageContainerOperation&&(e._imageContainerOperation=i.imageContainerOperation),i.textOperation&&(e._textOperation=i.textOperation),i.canvasElementOperation&&(e._canvasElementOperation=i.canvasElementOperation),i.setStorageValue&&(e._setStorageValue=i.setStorageValue),i.setInitialStorageValue&&(e._setInitialStorageValue=i.setInitialStorageValue),i.narrationOperation&&(e._narrationOperation=i.narrationOperation),i.effectOperation&&(e._effectOperation=i.effectOperation),i.animateOperation&&(e._animateOperation=i.animateOperation),i.getLogichValue&&(e._getLogichValue=i.getLogichValue),i.getConditionalStep&&(e._getConditionalStep=i.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return e._loadAssets}static _soundOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return e._soundOperation}static _imageOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return e._imageOperation}static _videoOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return e._videoOperation}static _imageContainerOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return e._imageContainerOperation}static _textOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return e._textOperation}static _canvasElementOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return e._canvasElementOperation}static _setStorageValue=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return e._setStorageValue}static _setInitialStorageValue=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return e._setInitialStorageValue}static _narrationOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return e._narrationOperation}static _effectOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return e._effectOperation}static _animateOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return e._animateOperation}static _getLogichValue=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return e._getLogichValue}static _getConditionalStep=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return e._getConditionalStep}};exports.JsonUnifier=s;
|
|
1
|
+
'use strict';var pixiVn=require('@drincs/pixi-vn');var t;(r=>(r.log=(a,...n)=>console.log(`[Pixi\u2019VN Json] ${a}`,...n),r.warn=(a,...n)=>console.warn(`[Pixi\u2019VN Json] ${a}`,...n),r.error=(a,...n)=>console.error(`[Pixi\u2019VN Json] ${a}`,...n),r.info=(a,...n)=>console.info(`[Pixi\u2019VN Json] ${a}`,...n)))(t||={});var s=class e{static init(i){i.loadAssets&&(e._loadAssets=i.loadAssets),i.soundOperation&&(e._soundOperation=i.soundOperation),i.imageOperation&&(e._imageOperation=i.imageOperation),i.videoOperation&&(e._videoOperation=i.videoOperation),i.imageContainerOperation&&(e._imageContainerOperation=i.imageContainerOperation),i.textOperation&&(e._textOperation=i.textOperation),i.canvasElementOperation&&(e._canvasElementOperation=i.canvasElementOperation),i.setStorageValue&&(e._setStorageValue=i.setStorageValue),i.setInitialStorageValue&&(e._setInitialStorageValue=i.setInitialStorageValue),i.narrationOperation&&(e._narrationOperation=i.narrationOperation),i.effectOperation&&(e._effectOperation=i.effectOperation),i.animateOperation&&(e._animateOperation=i.animateOperation),i.canvasOperation&&(e._canvasOperation=i.canvasOperation),i.getLogichValue&&(e._getLogichValue=i.getLogichValue),i.getConditionalStep&&(e._getConditionalStep=i.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return e._loadAssets}static _soundOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return e._soundOperation}static _imageOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return e._imageOperation}static _videoOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return e._videoOperation}static _imageContainerOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return e._imageContainerOperation}static _textOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return e._textOperation}static _canvasElementOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return e._canvasElementOperation}static _setStorageValue=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return e._setStorageValue}static _setInitialStorageValue=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return e._setInitialStorageValue}static _narrationOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return e._narrationOperation}static _effectOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return e._effectOperation}static _animateOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return e._animateOperation}static _canvasOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasOperation(){return e._canvasOperation}static _getLogichValue=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return e._getLogichValue}static _getConditionalStep=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return e._getConditionalStep}};exports.JsonUnifier=s;
|
package/dist/core.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ImageSpriteMemory, VideoSpriteMemory, ContainerMemory, ContainerChild, StepLabelPropsType, StorageElementType } from '@drincs/pixi-vn';
|
|
2
|
-
import { P as PixiVNJsonOperation, a as PixiVNJsonIfElse, b as PixiVNJsonOperationString, c as PixiVNJsonSound, d as PixiVNJsonCanvasImageVideoShow, e as PixiVNJsonImageEdit, f as PixiVNJsonCanvasRemove, g as PixiVNJsonVideoEdit, h as PixiVNJsonVideoPauseResume, i as PixiVNJsonCanvasImageContainerShow, j as PixiVNJsonImageContainerEdit, k as PixiVNJsonCanvasTextShow, l as PixiVNJsonTextEdit, m as PixiVNJsonUnknownEdit, n as PixiVNJsonValueSet, o as PixiVNJsonOnlyStorageSet, p as PixiVNJsonNarration, q as PixiVNJsonCanvasEffect, r as PixiVNJsonCanvasAnimate, s as
|
|
2
|
+
import { P as PixiVNJsonOperation, a as PixiVNJsonIfElse, b as PixiVNJsonOperationString, c as PixiVNJsonSound, d as PixiVNJsonCanvasImageVideoShow, e as PixiVNJsonImageEdit, f as PixiVNJsonCanvasRemove, g as PixiVNJsonVideoEdit, h as PixiVNJsonVideoPauseResume, i as PixiVNJsonCanvasImageContainerShow, j as PixiVNJsonImageContainerEdit, k as PixiVNJsonCanvasTextShow, l as PixiVNJsonTextEdit, m as PixiVNJsonUnknownEdit, n as PixiVNJsonValueSet, o as PixiVNJsonOnlyStorageSet, p as PixiVNJsonNarration, q as PixiVNJsonCanvasEffect, r as PixiVNJsonCanvasAnimate, s as PixiVNJsonCanvasClear, t as PixiVNJsonValueGet, u as PixiVNJsonArithmeticOperations, v as PixiVNJsonConditions, w as PixiVNJsonConditionalStatements, x as PixiVNJsonLabelStep } from './PixiVNJsonLabelStep-DKmA62M_.cjs';
|
|
3
3
|
import '@drincs/pixi-vn/motion';
|
|
4
4
|
import 'pixi.js';
|
|
5
5
|
|
|
@@ -24,6 +24,7 @@ declare class JsonUnifier {
|
|
|
24
24
|
narrationOperation?: (operation: PixiVNJsonNarration) => void;
|
|
25
25
|
effectOperation?: (operation: PixiVNJsonCanvasEffect) => Promise<void>;
|
|
26
26
|
animateOperation?: (operation: PixiVNJsonCanvasAnimate) => void;
|
|
27
|
+
canvasOperation?: (operation: PixiVNJsonCanvasClear) => void;
|
|
27
28
|
getLogichValue?: <T = StorageElementType>(value: T | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations | PixiVNJsonConditions | PixiVNJsonConditionalStatements<T | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations | PixiVNJsonConditions>, props?: StepLabelPropsType) => T | undefined;
|
|
28
29
|
getConditionalStep?: (originalStep: PixiVNJsonLabelStep, props?: StepLabelPropsType) => PixiVNJsonLabelStep;
|
|
29
30
|
}): void;
|
|
@@ -62,6 +63,9 @@ declare class JsonUnifier {
|
|
|
62
63
|
private static _animateOperation;
|
|
63
64
|
/** Registered handler for keyframe animation operations. */
|
|
64
65
|
static get animateOperation(): (operation: PixiVNJsonCanvasAnimate) => void;
|
|
66
|
+
private static _canvasOperation;
|
|
67
|
+
/** Registered handler for generic canvas-wide operations (e.g. clear). */
|
|
68
|
+
static get canvasOperation(): (operation: PixiVNJsonCanvasClear) => void;
|
|
65
69
|
private static _getLogichValue;
|
|
66
70
|
/** Registered handler that evaluates a JSON logic expression to a plain value. */
|
|
67
71
|
static get getLogichValue(): <T = StorageElementType>(value: T | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations | PixiVNJsonConditions | PixiVNJsonConditionalStatements<T | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations | PixiVNJsonConditions>, props?: StepLabelPropsType) => T | undefined;
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ImageSpriteMemory, VideoSpriteMemory, ContainerMemory, ContainerChild, StepLabelPropsType, StorageElementType } from '@drincs/pixi-vn';
|
|
2
|
-
import { P as PixiVNJsonOperation, a as PixiVNJsonIfElse, b as PixiVNJsonOperationString, c as PixiVNJsonSound, d as PixiVNJsonCanvasImageVideoShow, e as PixiVNJsonImageEdit, f as PixiVNJsonCanvasRemove, g as PixiVNJsonVideoEdit, h as PixiVNJsonVideoPauseResume, i as PixiVNJsonCanvasImageContainerShow, j as PixiVNJsonImageContainerEdit, k as PixiVNJsonCanvasTextShow, l as PixiVNJsonTextEdit, m as PixiVNJsonUnknownEdit, n as PixiVNJsonValueSet, o as PixiVNJsonOnlyStorageSet, p as PixiVNJsonNarration, q as PixiVNJsonCanvasEffect, r as PixiVNJsonCanvasAnimate, s as
|
|
2
|
+
import { P as PixiVNJsonOperation, a as PixiVNJsonIfElse, b as PixiVNJsonOperationString, c as PixiVNJsonSound, d as PixiVNJsonCanvasImageVideoShow, e as PixiVNJsonImageEdit, f as PixiVNJsonCanvasRemove, g as PixiVNJsonVideoEdit, h as PixiVNJsonVideoPauseResume, i as PixiVNJsonCanvasImageContainerShow, j as PixiVNJsonImageContainerEdit, k as PixiVNJsonCanvasTextShow, l as PixiVNJsonTextEdit, m as PixiVNJsonUnknownEdit, n as PixiVNJsonValueSet, o as PixiVNJsonOnlyStorageSet, p as PixiVNJsonNarration, q as PixiVNJsonCanvasEffect, r as PixiVNJsonCanvasAnimate, s as PixiVNJsonCanvasClear, t as PixiVNJsonValueGet, u as PixiVNJsonArithmeticOperations, v as PixiVNJsonConditions, w as PixiVNJsonConditionalStatements, x as PixiVNJsonLabelStep } from './PixiVNJsonLabelStep-DKmA62M_.js';
|
|
3
3
|
import '@drincs/pixi-vn/motion';
|
|
4
4
|
import 'pixi.js';
|
|
5
5
|
|
|
@@ -24,6 +24,7 @@ declare class JsonUnifier {
|
|
|
24
24
|
narrationOperation?: (operation: PixiVNJsonNarration) => void;
|
|
25
25
|
effectOperation?: (operation: PixiVNJsonCanvasEffect) => Promise<void>;
|
|
26
26
|
animateOperation?: (operation: PixiVNJsonCanvasAnimate) => void;
|
|
27
|
+
canvasOperation?: (operation: PixiVNJsonCanvasClear) => void;
|
|
27
28
|
getLogichValue?: <T = StorageElementType>(value: T | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations | PixiVNJsonConditions | PixiVNJsonConditionalStatements<T | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations | PixiVNJsonConditions>, props?: StepLabelPropsType) => T | undefined;
|
|
28
29
|
getConditionalStep?: (originalStep: PixiVNJsonLabelStep, props?: StepLabelPropsType) => PixiVNJsonLabelStep;
|
|
29
30
|
}): void;
|
|
@@ -62,6 +63,9 @@ declare class JsonUnifier {
|
|
|
62
63
|
private static _animateOperation;
|
|
63
64
|
/** Registered handler for keyframe animation operations. */
|
|
64
65
|
static get animateOperation(): (operation: PixiVNJsonCanvasAnimate) => void;
|
|
66
|
+
private static _canvasOperation;
|
|
67
|
+
/** Registered handler for generic canvas-wide operations (e.g. clear). */
|
|
68
|
+
static get canvasOperation(): (operation: PixiVNJsonCanvasClear) => void;
|
|
65
69
|
private static _getLogichValue;
|
|
66
70
|
/** Registered handler that evaluates a JSON logic expression to a plain value. */
|
|
67
71
|
static get getLogichValue(): <T = StorageElementType>(value: T | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations | PixiVNJsonConditions | PixiVNJsonConditionalStatements<T | PixiVNJsonValueGet | PixiVNJsonArithmeticOperations | PixiVNJsonConditions>, props?: StepLabelPropsType) => T | undefined;
|
package/dist/core.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {PixiError}from'@drincs/pixi-vn';var t;(r=>(r.log=(a,...n)=>console.log(`[Pixi\u2019VN Json] ${a}`,...n),r.warn=(a,...n)=>console.warn(`[Pixi\u2019VN Json] ${a}`,...n),r.error=(a,...n)=>console.error(`[Pixi\u2019VN Json] ${a}`,...n),r.info=(a,...n)=>console.info(`[Pixi\u2019VN Json] ${a}`,...n)))(t||={});var s=class e{static init(i){i.loadAssets&&(e._loadAssets=i.loadAssets),i.soundOperation&&(e._soundOperation=i.soundOperation),i.imageOperation&&(e._imageOperation=i.imageOperation),i.videoOperation&&(e._videoOperation=i.videoOperation),i.imageContainerOperation&&(e._imageContainerOperation=i.imageContainerOperation),i.textOperation&&(e._textOperation=i.textOperation),i.canvasElementOperation&&(e._canvasElementOperation=i.canvasElementOperation),i.setStorageValue&&(e._setStorageValue=i.setStorageValue),i.setInitialStorageValue&&(e._setInitialStorageValue=i.setInitialStorageValue),i.narrationOperation&&(e._narrationOperation=i.narrationOperation),i.effectOperation&&(e._effectOperation=i.effectOperation),i.animateOperation&&(e._animateOperation=i.animateOperation),i.getLogichValue&&(e._getLogichValue=i.getLogichValue),i.getConditionalStep&&(e._getConditionalStep=i.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return e._loadAssets}static _soundOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return e._soundOperation}static _imageOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return e._imageOperation}static _videoOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return e._videoOperation}static _imageContainerOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return e._imageContainerOperation}static _textOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return e._textOperation}static _canvasElementOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return e._canvasElementOperation}static _setStorageValue=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return e._setStorageValue}static _setInitialStorageValue=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return e._setInitialStorageValue}static _narrationOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return e._narrationOperation}static _effectOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return e._effectOperation}static _animateOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return e._animateOperation}static _getLogichValue=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return e._getLogichValue}static _getConditionalStep=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return e._getConditionalStep}};export{s as JsonUnifier};
|
|
1
|
+
import {PixiError}from'@drincs/pixi-vn';var t;(r=>(r.log=(a,...n)=>console.log(`[Pixi\u2019VN Json] ${a}`,...n),r.warn=(a,...n)=>console.warn(`[Pixi\u2019VN Json] ${a}`,...n),r.error=(a,...n)=>console.error(`[Pixi\u2019VN Json] ${a}`,...n),r.info=(a,...n)=>console.info(`[Pixi\u2019VN Json] ${a}`,...n)))(t||={});var s=class e{static init(i){i.loadAssets&&(e._loadAssets=i.loadAssets),i.soundOperation&&(e._soundOperation=i.soundOperation),i.imageOperation&&(e._imageOperation=i.imageOperation),i.videoOperation&&(e._videoOperation=i.videoOperation),i.imageContainerOperation&&(e._imageContainerOperation=i.imageContainerOperation),i.textOperation&&(e._textOperation=i.textOperation),i.canvasElementOperation&&(e._canvasElementOperation=i.canvasElementOperation),i.setStorageValue&&(e._setStorageValue=i.setStorageValue),i.setInitialStorageValue&&(e._setInitialStorageValue=i.setInitialStorageValue),i.narrationOperation&&(e._narrationOperation=i.narrationOperation),i.effectOperation&&(e._effectOperation=i.effectOperation),i.animateOperation&&(e._animateOperation=i.animateOperation),i.canvasOperation&&(e._canvasOperation=i.canvasOperation),i.getLogichValue&&(e._getLogichValue=i.getLogichValue),i.getConditionalStep&&(e._getConditionalStep=i.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return e._loadAssets}static _soundOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return e._soundOperation}static _imageOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return e._imageOperation}static _videoOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return e._videoOperation}static _imageContainerOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return e._imageContainerOperation}static _textOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return e._textOperation}static _canvasElementOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return e._canvasElementOperation}static _setStorageValue=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return e._setStorageValue}static _setInitialStorageValue=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return e._setInitialStorageValue}static _narrationOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return e._narrationOperation}static _effectOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return e._effectOperation}static _animateOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return e._animateOperation}static _canvasOperation=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasOperation(){return e._canvasOperation}static _getLogichValue=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return e._getLogichValue}static _getConditionalStep=()=>{throw t.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return e._getConditionalStep}};export{s as JsonUnifier};
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var actions=require('@drincs/pixi-vn-json/actions'),core=require('@drincs/pixi-vn-json/core'),interpreter=require('@drincs/pixi-vn-json/interpreter'),translator=require('@drincs/pixi-vn-json/translator');var t={version:"1.13.
|
|
2
|
-
Object.defineProperty(exports,"VariableGetter",{enumerable:true,get:function(){return actions.VariableGetter}});exports.PIXIVNJSON_PARAM_ID=i;exports.PIXIVNJSON_SCHEMA_URL=s;exports.PixiVNJsonComparationOperators=r;exports.init=
|
|
1
|
+
'use strict';var actions=require('@drincs/pixi-vn-json/actions'),core=require('@drincs/pixi-vn-json/core'),interpreter=require('@drincs/pixi-vn-json/interpreter'),translator=require('@drincs/pixi-vn-json/translator');var t={version:"1.13.13"};var i="___param___",s=`https://pixi-vn.com/schemas/${t.version}/schema.json`,r=["==","!=","<","<=",">",">=","CONTAINS"];function _(){core.JsonUnifier.init({animateOperation:actions.animateOperation,canvasElementOperation:actions.canvasElementOperation,canvasOperation:actions.canvasOperation,effectOperation:actions.effectOperation,imageContainerOperation:actions.imageContainerOperation,imageOperation:actions.imageOperation,textOperation:actions.textOperation,narrationOperation:actions.narrationOperation,loadAssets:actions.loadAssets,soundOperation:actions.soundOperation,videoOperation:actions.videoOperation,setStorageValue:actions.setStorageValue,setInitialStorageValue:actions.setInitialStorageValue,getLogichValue:actions.VariableGetter.getLogichValue,getConditionalStep:actions.getConditionalStep});}
|
|
2
|
+
Object.defineProperty(exports,"VariableGetter",{enumerable:true,get:function(){return actions.VariableGetter}});exports.PIXIVNJSON_PARAM_ID=i;exports.PIXIVNJSON_SCHEMA_URL=s;exports.PixiVNJsonComparationOperators=r;exports.init=_;Object.keys(interpreter).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return interpreter[k]}})});Object.keys(translator).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return translator[k]}})});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { y as PixiVNJsonComparationOperatorsType } from './PixiVNJsonLabelStep-DKmA62M_.cjs';
|
|
2
|
+
export { z as PixiVNJsonAnimateBase, A as PixiVNJsonAnimateSequence, u as PixiVNJsonArithmeticOperations, B as PixiVNJsonArithmeticOperationsArithmetic, C as PixiVNJsonArithmeticOperationsArithmeticSingle, D as PixiVNJsonCanvas, r as PixiVNJsonCanvasAnimate, s as PixiVNJsonCanvasClear, E as PixiVNJsonCanvasEdit, q as PixiVNJsonCanvasEffect, i as PixiVNJsonCanvasImageContainerShow, d as PixiVNJsonCanvasImageVideoShow, f as PixiVNJsonCanvasRemove, F as PixiVNJsonCanvasShow, k as PixiVNJsonCanvasTextShow, G as PixiVNJsonChoice, H as PixiVNJsonChoiceGet, I as PixiVNJsonChoices, J as PixiVNJsonComparation, K as PixiVNJsonConditionalOperation, L as PixiVNJsonConditionalResultToCombine, w as PixiVNJsonConditionalStatements, v as PixiVNJsonConditions, M as PixiVNJsonDialog, N as PixiVNJsonDialogText, O as PixiVNJsonDialogue, Q as PixiVNJsonFunction, a as PixiVNJsonIfElse, j as PixiVNJsonImageContainerEdit, e as PixiVNJsonImageEdit, R as PixiVNJsonInputRequest, S as PixiVNJsonLabelGet, x as PixiVNJsonLabelStep, T as PixiVNJsonLabelToOpen, U as PixiVNJsonLogicGet, V as PixiVNJsonMediaTransiotions, p as PixiVNJsonNarration, o as PixiVNJsonOnlyStorageSet, P as PixiVNJsonOperation, b as PixiVNJsonOperationString, W as PixiVNJsonParamGet, c as PixiVNJsonSound, X as PixiVNJsonSoundEdit, Y as PixiVNJsonSoundPauseResume, Z as PixiVNJsonSoundPlay, _ as PixiVNJsonSoundRemove, $ as PixiVNJsonStepSwitch, a0 as PixiVNJsonStepSwitchElementType, a1 as PixiVNJsonStepSwitchElementsType, a2 as PixiVNJsonStorageGet, l as PixiVNJsonTextEdit, a3 as PixiVNJsonUnionCondition, m as PixiVNJsonUnknownEdit, t as PixiVNJsonValueGet, n as PixiVNJsonValueSet, g as PixiVNJsonVideoEdit, h as PixiVNJsonVideoPauseResume } from './PixiVNJsonLabelStep-DKmA62M_.cjs';
|
|
3
3
|
export { PixiVNJson, PixiVNJsonLabels } from './schema.cjs';
|
|
4
4
|
export { V as VariableGetter, a as VariableGetterHandler } from './VariableGetter-ZDA6kdah.cjs';
|
|
5
5
|
export { LabelJson, importPixiVNJson } from './interpreter.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { y as PixiVNJsonComparationOperatorsType } from './PixiVNJsonLabelStep-DKmA62M_.js';
|
|
2
|
+
export { z as PixiVNJsonAnimateBase, A as PixiVNJsonAnimateSequence, u as PixiVNJsonArithmeticOperations, B as PixiVNJsonArithmeticOperationsArithmetic, C as PixiVNJsonArithmeticOperationsArithmeticSingle, D as PixiVNJsonCanvas, r as PixiVNJsonCanvasAnimate, s as PixiVNJsonCanvasClear, E as PixiVNJsonCanvasEdit, q as PixiVNJsonCanvasEffect, i as PixiVNJsonCanvasImageContainerShow, d as PixiVNJsonCanvasImageVideoShow, f as PixiVNJsonCanvasRemove, F as PixiVNJsonCanvasShow, k as PixiVNJsonCanvasTextShow, G as PixiVNJsonChoice, H as PixiVNJsonChoiceGet, I as PixiVNJsonChoices, J as PixiVNJsonComparation, K as PixiVNJsonConditionalOperation, L as PixiVNJsonConditionalResultToCombine, w as PixiVNJsonConditionalStatements, v as PixiVNJsonConditions, M as PixiVNJsonDialog, N as PixiVNJsonDialogText, O as PixiVNJsonDialogue, Q as PixiVNJsonFunction, a as PixiVNJsonIfElse, j as PixiVNJsonImageContainerEdit, e as PixiVNJsonImageEdit, R as PixiVNJsonInputRequest, S as PixiVNJsonLabelGet, x as PixiVNJsonLabelStep, T as PixiVNJsonLabelToOpen, U as PixiVNJsonLogicGet, V as PixiVNJsonMediaTransiotions, p as PixiVNJsonNarration, o as PixiVNJsonOnlyStorageSet, P as PixiVNJsonOperation, b as PixiVNJsonOperationString, W as PixiVNJsonParamGet, c as PixiVNJsonSound, X as PixiVNJsonSoundEdit, Y as PixiVNJsonSoundPauseResume, Z as PixiVNJsonSoundPlay, _ as PixiVNJsonSoundRemove, $ as PixiVNJsonStepSwitch, a0 as PixiVNJsonStepSwitchElementType, a1 as PixiVNJsonStepSwitchElementsType, a2 as PixiVNJsonStorageGet, l as PixiVNJsonTextEdit, a3 as PixiVNJsonUnionCondition, m as PixiVNJsonUnknownEdit, t as PixiVNJsonValueGet, n as PixiVNJsonValueSet, g as PixiVNJsonVideoEdit, h as PixiVNJsonVideoPauseResume } from './PixiVNJsonLabelStep-DKmA62M_.js';
|
|
3
3
|
export { PixiVNJson, PixiVNJsonLabels } from './schema.js';
|
|
4
4
|
export { V as VariableGetter, a as VariableGetterHandler } from './VariableGetter-ZDA6kdah.js';
|
|
5
5
|
export { LabelJson, importPixiVNJson } from './interpreter.js';
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {getConditionalStep,VariableGetter,setInitialStorageValue,setStorageValue,videoOperation,soundOperation,loadAssets,narrationOperation,textOperation,imageOperation,imageContainerOperation,effectOperation,canvasElementOperation,animateOperation}from'@drincs/pixi-vn-json/actions';export{VariableGetter}from'@drincs/pixi-vn-json/actions';import {JsonUnifier}from'@drincs/pixi-vn-json/core';export*from'@drincs/pixi-vn-json/interpreter';export*from'@drincs/pixi-vn-json/translator';var t={version:"1.13.
|
|
2
|
-
export{i as PIXIVNJSON_PARAM_ID,s as PIXIVNJSON_SCHEMA_URL,r as PixiVNJsonComparationOperators,
|
|
1
|
+
import {getConditionalStep,VariableGetter,setInitialStorageValue,setStorageValue,videoOperation,soundOperation,loadAssets,narrationOperation,textOperation,imageOperation,imageContainerOperation,effectOperation,canvasOperation,canvasElementOperation,animateOperation}from'@drincs/pixi-vn-json/actions';export{VariableGetter}from'@drincs/pixi-vn-json/actions';import {JsonUnifier}from'@drincs/pixi-vn-json/core';export*from'@drincs/pixi-vn-json/interpreter';export*from'@drincs/pixi-vn-json/translator';var t={version:"1.13.13"};var i="___param___",s=`https://pixi-vn.com/schemas/${t.version}/schema.json`,r=["==","!=","<","<=",">",">=","CONTAINS"];function _(){JsonUnifier.init({animateOperation:animateOperation,canvasElementOperation:canvasElementOperation,canvasOperation:canvasOperation,effectOperation:effectOperation,imageContainerOperation:imageContainerOperation,imageOperation:imageOperation,textOperation:textOperation,narrationOperation:narrationOperation,loadAssets:loadAssets,soundOperation:soundOperation,videoOperation:videoOperation,setStorageValue:setStorageValue,setInitialStorageValue:setInitialStorageValue,getLogichValue:VariableGetter.getLogichValue,getConditionalStep:getConditionalStep});}
|
|
2
|
+
export{i as PIXIVNJSON_PARAM_ID,s as PIXIVNJSON_SCHEMA_URL,r as PixiVNJsonComparationOperators,_ as init};
|
package/dist/interpreter.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var pixiVn=require('@drincs/pixi-vn'),core=require('@drincs/pixi-vn-json/core'),translator=require('@drincs/pixi-vn-json/translator'),narration=require('@drincs/pixi-vn/narration'),storage=require('@drincs/pixi-vn/storage');var Z=Object.create;var $=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var B=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var M=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var oe=(n,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ie(e))!ne.call(n,s)&&s!==o&&$(n,s,{get:()=>e[s],enumerable:!(t=ee(e,s))||t.enumerable});return n};var re=(n,e,o)=>(o=n!=null?Z(te(n)):{},oe($(o,"default",{value:n,enumerable:true}),n));var F=M((A,G)=>{(function(n,e){typeof A=="object"?G.exports=A=e():typeof define=="function"&&define.amd?define([],e):n.CryptoJS=e();})(A,function(){var n=n||(function(e,o){var t;if(typeof window<"u"&&window.crypto&&(t=window.crypto),typeof self<"u"&&self.crypto&&(t=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(t=globalThis.crypto),!t&&typeof window<"u"&&window.msCrypto&&(t=window.msCrypto),!t&&typeof global<"u"&&global.crypto&&(t=global.crypto),!t&&typeof B=="function")try{t=B("crypto");}catch{}var s=function(){if(t){if(typeof t.getRandomValues=="function")try{return t.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof t.randomBytes=="function")try{return t.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},p=Object.create||(function(){function i(){}return function(a){var c;return i.prototype=a,c=new i,i.prototype=null,c}})(),r={},x=r.lib={},f=x.Base=(function(){return {extend:function(i){var a=p(this);return i&&a.mixIn(i),(!a.hasOwnProperty("init")||this.init===a.init)&&(a.init=function(){a.$super.init.apply(this,arguments);}),a.init.prototype=a,a.$super=this,a},create:function(){var i=this.extend();return i.init.apply(i,arguments),i},init:function(){},mixIn:function(i){for(var a in i)i.hasOwnProperty(a)&&(this[a]=i[a]);i.hasOwnProperty("toString")&&(this.toString=i.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),h=x.WordArray=f.extend({init:function(i,a){i=this.words=i||[],a!=o?this.sigBytes=a:this.sigBytes=i.length*4;},toString:function(i){return (i||N).stringify(this)},concat:function(i){var a=this.words,c=i.words,d=this.sigBytes,y=i.sigBytes;if(this.clamp(),d%4)for(var J=0;J<y;J++){var I=c[J>>>2]>>>24-J%4*8&255;a[d+J>>>2]|=I<<24-(d+J)%4*8;}else for(var C=0;C<y;C+=4)a[d+C>>>2]=c[C>>>2];return this.sigBytes+=y,this},clamp:function(){var i=this.words,a=this.sigBytes;i[a>>>2]&=4294967295<<32-a%4*8,i.length=e.ceil(a/4);},clone:function(){var i=f.clone.call(this);return i.words=this.words.slice(0),i},random:function(i){for(var a=[],c=0;c<i;c+=4)a.push(s());return new h.init(a,i)}}),u=r.enc={},N=u.Hex={stringify:function(i){for(var a=i.words,c=i.sigBytes,d=[],y=0;y<c;y++){var J=a[y>>>2]>>>24-y%4*8&255;d.push((J>>>4).toString(16)),d.push((J&15).toString(16));}return d.join("")},parse:function(i){for(var a=i.length,c=[],d=0;d<a;d+=2)c[d>>>3]|=parseInt(i.substr(d,2),16)<<24-d%8*4;return new h.init(c,a/2)}},V=u.Latin1={stringify:function(i){for(var a=i.words,c=i.sigBytes,d=[],y=0;y<c;y++){var J=a[y>>>2]>>>24-y%4*8&255;d.push(String.fromCharCode(J));}return d.join("")},parse:function(i){for(var a=i.length,c=[],d=0;d<a;d++)c[d>>>2]|=(i.charCodeAt(d)&255)<<24-d%4*8;return new h.init(c,a)}},m=u.Utf8={stringify:function(i){try{return decodeURIComponent(escape(V.stringify(i)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(i){return V.parse(unescape(encodeURIComponent(i)))}},l=x.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new h.init,this._nDataBytes=0;},_append:function(i){typeof i=="string"&&(i=m.parse(i)),this._data.concat(i),this._nDataBytes+=i.sigBytes;},_process:function(i){var a,c=this._data,d=c.words,y=c.sigBytes,J=this.blockSize,I=J*4,C=y/I;i?C=e.ceil(C):C=e.max((C|0)-this._minBufferSize,0);var T=C*J,H=e.min(T*4,y);if(T){for(var z=0;z<T;z+=J)this._doProcessBlock(d,z);a=d.splice(0,T),c.sigBytes-=H;}return new h.init(a,H)},clone:function(){var i=f.clone.call(this);return i._data=this._data.clone(),i},_minBufferSize:0});x.Hasher=l.extend({cfg:f.extend(),init:function(i){this.cfg=this.cfg.extend(i),this.reset();},reset:function(){l.reset.call(this),this._doReset();},update:function(i){return this._append(i),this._process(),this},finalize:function(i){i&&this._append(i);var a=this._doFinalize();return a},blockSize:512/32,_createHelper:function(i){return function(a,c){return new i.init(c).finalize(a)}},_createHmacHelper:function(i){return function(a,c){return new P.HMAC.init(i,c).finalize(a)}}});var P=r.algo={};return r})(Math);return n});});var K=M((E,X)=>{(function(n,e){typeof E=="object"?X.exports=E=e(F()):typeof define=="function"&&define.amd?define(["./core"],e):e(n.CryptoJS);})(E,function(n){return (function(){var e=n,o=e.lib,t=o.WordArray,s=o.Hasher,p=e.algo,r=[],x=p.SHA1=s.extend({_doReset:function(){this._hash=new t.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(f,h){for(var u=this._hash.words,N=u[0],V=u[1],m=u[2],l=u[3],w=u[4],P=0;P<80;P++){if(P<16)r[P]=f[h+P]|0;else {var i=r[P-3]^r[P-8]^r[P-14]^r[P-16];r[P]=i<<1|i>>>31;}var a=(N<<5|N>>>27)+w+r[P];P<20?a+=(V&m|~V&l)+1518500249:P<40?a+=(V^m^l)+1859775393:P<60?a+=(V&m|V&l|m&l)-1894007588:a+=(V^m^l)-899497514,w=l,l=m,m=V<<30|V>>>2,V=N,N=a;}u[0]=u[0]+N|0,u[1]=u[1]+V|0,u[2]=u[2]+m|0,u[3]=u[3]+l|0,u[4]=u[4]+w|0;},_doFinalize:function(){var f=this._data,h=f.words,u=this._nDataBytes*8,N=f.sigBytes*8;return h[N>>>5]|=128<<24-N%32,h[(N+64>>>9<<4)+14]=Math.floor(u/4294967296),h[(N+64>>>9<<4)+15]=u,f.sigBytes=h.length*4,this._process(),this._hash},clone:function(){var f=s.clone.call(this);return f._hash=this._hash.clone(),f}});e.SHA1=s._createHelper(x),e.HmacSHA1=s._createHmacHelper(x);})(),n.SHA1});});var k="___param___";var g;(s=>(s.log=(p,...r)=>console.log(`[Pixi\u2019VN Json] ${p}`,...r),s.warn=(p,...r)=>console.warn(`[Pixi\u2019VN Json] ${p}`,...r),s.error=(p,...r)=>console.error(`[Pixi\u2019VN Json] ${p}`,...r),s.info=(p,...r)=>console.info(`[Pixi\u2019VN Json] ${p}`,...r)))(g||={});var L=class n{static init(e){e.loadAssets&&(n._loadAssets=e.loadAssets),e.soundOperation&&(n._soundOperation=e.soundOperation),e.imageOperation&&(n._imageOperation=e.imageOperation),e.videoOperation&&(n._videoOperation=e.videoOperation),e.imageContainerOperation&&(n._imageContainerOperation=e.imageContainerOperation),e.textOperation&&(n._textOperation=e.textOperation),e.canvasElementOperation&&(n._canvasElementOperation=e.canvasElementOperation),e.setStorageValue&&(n._setStorageValue=e.setStorageValue),e.setInitialStorageValue&&(n._setInitialStorageValue=e.setInitialStorageValue),e.narrationOperation&&(n._narrationOperation=e.narrationOperation),e.effectOperation&&(n._effectOperation=e.effectOperation),e.animateOperation&&(n._animateOperation=e.animateOperation),e.getLogichValue&&(n._getLogichValue=e.getLogichValue),e.getConditionalStep&&(n._getConditionalStep=e.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return n._loadAssets}static _soundOperation=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return n._soundOperation}static _imageOperation=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return n._imageOperation}static _videoOperation=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return n._videoOperation}static _imageContainerOperation=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return n._imageContainerOperation}static _textOperation=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return n._textOperation}static _canvasElementOperation=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return n._canvasElementOperation}static _setStorageValue=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return n._setStorageValue}static _setInitialStorageValue=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return n._setInitialStorageValue}static _narrationOperation=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return n._narrationOperation}static _effectOperation=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return n._effectOperation}static _animateOperation=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return n._animateOperation}static _getLogichValue=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return n._getLogichValue}static _getConditionalStep=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return n._getConditionalStep}};function q(n,e){if(e&&typeof e=="object"&&typeof n.functionName=="string"&&n.functionName in e){let o=e[n.functionName];if(typeof o=="function"){let t=n.args.map(s=>L.getLogichValue(s,e));return o(...t)}else g.warn(`getLogichValue function ${n.functionName} not found in props`);}}function W(n,e={}){let o="";return n.values.forEach(t=>{if(typeof t=="string")o+=t;else {let s=core.JsonUnifier.getLogichValue(t,e);o+=`${s}`;}}),o}async function R(n,e,o){let t=core.JsonUnifier.getLogichValue(n,e);if(t)switch(t.type){case "sound":core.JsonUnifier.soundOperation(t);break;case "assets":case "bundle":await core.JsonUnifier.loadAssets(t);break;case "image":await core.JsonUnifier.imageOperation(t);break;case "video":await core.JsonUnifier.videoOperation(t);break;case "imagecontainer":await core.JsonUnifier.imageContainerOperation(t);break;case "text":await core.JsonUnifier.textOperation(t);break;case "canvaselement":await core.JsonUnifier.canvasElementOperation(t);break;case "value":core.JsonUnifier.setStorageValue(t,e);break;case "operationtoconvert":if(o){let s=W(t,e),p=await o(s);p&&await R(p,e,o);}break;case "input":case "dialogue":core.JsonUnifier.narrationOperation(t);break;case "shake":await core.JsonUnifier.effectOperation(t);break;case "animate":case "animate-sequence":core.JsonUnifier.animateOperation(t);break;case "function":await q(t,e);break}}function D(n){let e=core.JsonUnifier.getLogichValue(n,{});e&&e.type==="value"&&e.storageOperationType==="set"&&(e.storageType==="storage"||e.storageType==="tempstorage")&&core.JsonUnifier.setInitialStorageValue(e);}var Y=re(K());var _=class extends narration.LabelAbstract{constructor(e,o,t,s={}){t||(t={}),t.onLoadingLabel=async()=>{for(let p of o){let r;if(typeof p=="function"?r=p():r=p,r=core.JsonUnifier.getConditionalStep(r),r.operations)try{let x=r.operations.map(f=>core.JsonUnifier.loadAssets(f));await Promise.all(x);}catch(x){g.error("The operation in the onLoadingLabel function of the label has an error:",x);}}},super(e,t),this._steps=o,this.operationStringConvert=s.operationStringConvert,this.skipEmptyDialogs=s.skipEmptyDialogs||false;}_steps;get steps(){return this._steps.map(e=>this.stepConverter(e))}get stepCount(){return this._steps.length}getStepById(e){if(e<0||e>=this._steps.length)return;let o=this._steps[e];return this.stepConverter(o)}operationStringConvert;skipEmptyDialogs=false;getStepSha(e){if(e<0||e>=this.steps.length)return;let o=this._steps[e];return (0, Y.default)(o.toString().toLocaleLowerCase()).toString()}getDialogueText(e,o){let t="";if(Array.isArray(e)){let s=[];e.forEach(p=>{if(typeof p=="string")s.push(p);else if(p&&typeof p=="object"){let r=core.JsonUnifier.getLogichValue(p,o);r?(r&&!Array.isArray(r)&&typeof r=="object"&&(r=core.JsonUnifier.getLogichValue(r,o)||""),Array.isArray(r)?s=s.map(x=>`${x}`).concat(r):s.push(`${r}`)):s.push(`${p}`);}else s.push(`${p}`);}),t=s;}else {let s=core.JsonUnifier.getLogichValue(e,o);s&&!Array.isArray(s)&&typeof s=="object"&&(s=core.JsonUnifier.getLogichValue(s,o)),s&&Array.isArray(s)?t=s.map(p=>`${p}`):t=`${s}`;}return t}getDialogue(e,o){if(e==null)return;let t=core.JsonUnifier.getLogichValue(e,o);return t==null?`${t}`:typeof t=="object"&&"character"in t&&"text"in t?{character:t.character,text:translator.translator.t(this.getDialogueText(t.text,o))}:translator.translator.t(this.getDialogueText(t,o))}getChoices(e,o){return core.JsonUnifier.getLogichValue(e,o)?.map(p=>core.JsonUnifier.getLogichValue(p,o)).filter(p=>p!==void 0)}stepConverter(e){return async o=>{let t=typeof e=="function"?e():e;t=pixiVn.createExportableElement(t),t=core.JsonUnifier.getConditionalStep(t,o);let s=this.operationStringConvert?m=>this.operationStringConvert(m,t,o):void 0,{operations:p=[]}=t;for(let m of p)await R(m,o,s);let{labelToOpen:r=[]}=t,x=this.getChoices(t.choices,o),f=core.JsonUnifier.getLogichValue(t.glueEnabled,o),h=this.getDialogue(t.dialogue,o),u=[];Array.isArray(r)||(r=[r]),r.forEach(m=>{let l=core.JsonUnifier.getLogichValue(m,o);l&&u.push(l);});let N=core.JsonUnifier.getLogichValue(t.goNextStep,o),V=core.JsonUnifier.getLogichValue(t.end,o);if(x){let m=x.map(l=>{let w="";if(Array.isArray(l.text)){let i=[];l.text.forEach(a=>{if(typeof a=="string")i.push(translator.translator.t(a));else if(a&&typeof a=="object"){let c=core.JsonUnifier.getLogichValue(a,o);c&&!Array.isArray(c)&&typeof c=="object"&&(c=core.JsonUnifier.getLogichValue(c,o)||""),c&&(Array.isArray(c)?i=i.concat(translator.translator.t(c)):i.push(translator.translator.t(c)));}}),w=i;}else typeof l.text=="string"&&(w=translator.translator.t(l.text));return {label:l.label,text:w,props:l.props,type:l.type,oneTime:l.oneTime,onlyHaveNoChoice:l.onlyHaveNoChoice,autoSelect:l.autoSelect}});narration.narration.choices=m;}else narration.narration.choices=void 0;h!==void 0&&(narration.narration.dialogue=h,this.skipEmptyDialogs&&typeof h=="string"&&(h===""||RegExp(/^\s+$/).test(h))&&(N=true)),f?narration.narration.dialogGlue=true:f===false&&(narration.narration.dialogGlue=false);for(let m of u){let l=m.label;typeof l=="object"&&(l=core.JsonUnifier.getLogichValue(l,o)||"");let w=m.params?.map(P=>core.JsonUnifier.getLogichValue(P,o));o={...o,...m.props},m.type==="jump"?(narration.narration.openedLabels.length>0&&narration.narration.closeCurrentLabel(),storage.storage.setTempVariable(`${k}${narration.narration.openedLabels.length}`,w),await narration.narration.call(l,o)):(storage.storage.setTempVariable(`${k}${narration.narration.openedLabels.length}`,w),await narration.narration.call(l,o));}V==="game_end"?(narration.narration.closeAllLabels(),await narration.narration.continue(o,{runNow:true})):V==="label_end"&&narration.narration.closeCurrentLabel(),N&&await narration.narration.continue(o,{runNow:true});}}};async function de(n,e={}){if(!Array.isArray(n))if(typeof n=="object"||typeof n=="string")n=[n];else {g.error("Error parsing imported Pixi'VN JSON: data is not an object");return}let o=n.map(p=>{if(typeof p=="string")try{return JSON.parse(p)}catch(r){return g.error("Error parsing imported Pixi'VN JSON",r),{}}return p}),t=o.map(async p=>{if(p.initialOperations)for(let r of p.initialOperations)r.type==="value"&&(typeof r.value!="object"||!r.value||!("type"in r.value))&&D(r);return Promise.resolve()});await Promise.all(t);let s=o.map(async p=>{if(p.initialOperations)for(let r of p.initialOperations)(r.type!=="value"||r.type==="value"&&typeof r.value=="object"&&r.value&&"type"in r.value)&&D(r);if(p.labels){let r=p.labels;for(let x in r)try{let f=r[x],h=new _(x,f,void 0,e);narration.RegisteredLabels.add(h);}catch(f){g.error(`Error creating JSON label ${x}`,f);}}return Promise.resolve()});await Promise.all(s);}exports.LabelJson=_;exports.importPixiVNJson=de;
|
|
1
|
+
'use strict';var pixiVn=require('@drincs/pixi-vn'),core=require('@drincs/pixi-vn-json/core'),translator=require('@drincs/pixi-vn-json/translator'),narration=require('@drincs/pixi-vn/narration'),storage=require('@drincs/pixi-vn/storage');var Z=Object.create;var $=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var k=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var M=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var oe=(n,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ie(e))!ne.call(n,s)&&s!==o&&$(n,s,{get:()=>e[s],enumerable:!(t=ee(e,s))||t.enumerable});return n};var re=(n,e,o)=>(o=n!=null?Z(te(n)):{},oe($(o,"default",{value:n,enumerable:true}),n));var F=M((T,G)=>{(function(n,e){typeof T=="object"?G.exports=T=e():typeof define=="function"&&define.amd?define([],e):n.CryptoJS=e();})(T,function(){var n=n||(function(e,o){var t;if(typeof window<"u"&&window.crypto&&(t=window.crypto),typeof self<"u"&&self.crypto&&(t=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(t=globalThis.crypto),!t&&typeof window<"u"&&window.msCrypto&&(t=window.msCrypto),!t&&typeof global<"u"&&global.crypto&&(t=global.crypto),!t&&typeof k=="function")try{t=k("crypto");}catch{}var s=function(){if(t){if(typeof t.getRandomValues=="function")try{return t.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof t.randomBytes=="function")try{return t.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},p=Object.create||(function(){function i(){}return function(a){var c;return i.prototype=a,c=new i,i.prototype=null,c}})(),r={},x=r.lib={},m=x.Base=(function(){return {extend:function(i){var a=p(this);return i&&a.mixIn(i),(!a.hasOwnProperty("init")||this.init===a.init)&&(a.init=function(){a.$super.init.apply(this,arguments);}),a.init.prototype=a,a.$super=this,a},create:function(){var i=this.extend();return i.init.apply(i,arguments),i},init:function(){},mixIn:function(i){for(var a in i)i.hasOwnProperty(a)&&(this[a]=i[a]);i.hasOwnProperty("toString")&&(this.toString=i.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),h=x.WordArray=m.extend({init:function(i,a){i=this.words=i||[],a!=o?this.sigBytes=a:this.sigBytes=i.length*4;},toString:function(i){return (i||N).stringify(this)},concat:function(i){var a=this.words,c=i.words,d=this.sigBytes,y=i.sigBytes;if(this.clamp(),d%4)for(var J=0;J<y;J++){var I=c[J>>>2]>>>24-J%4*8&255;a[d+J>>>2]|=I<<24-(d+J)%4*8;}else for(var C=0;C<y;C+=4)a[d+C>>>2]=c[C>>>2];return this.sigBytes+=y,this},clamp:function(){var i=this.words,a=this.sigBytes;i[a>>>2]&=4294967295<<32-a%4*8,i.length=e.ceil(a/4);},clone:function(){var i=m.clone.call(this);return i.words=this.words.slice(0),i},random:function(i){for(var a=[],c=0;c<i;c+=4)a.push(s());return new h.init(a,i)}}),u=r.enc={},N=u.Hex={stringify:function(i){for(var a=i.words,c=i.sigBytes,d=[],y=0;y<c;y++){var J=a[y>>>2]>>>24-y%4*8&255;d.push((J>>>4).toString(16)),d.push((J&15).toString(16));}return d.join("")},parse:function(i){for(var a=i.length,c=[],d=0;d<a;d+=2)c[d>>>3]|=parseInt(i.substr(d,2),16)<<24-d%8*4;return new h.init(c,a/2)}},V=u.Latin1={stringify:function(i){for(var a=i.words,c=i.sigBytes,d=[],y=0;y<c;y++){var J=a[y>>>2]>>>24-y%4*8&255;d.push(String.fromCharCode(J));}return d.join("")},parse:function(i){for(var a=i.length,c=[],d=0;d<a;d++)c[d>>>2]|=(i.charCodeAt(d)&255)<<24-d%4*8;return new h.init(c,a)}},g=u.Utf8={stringify:function(i){try{return decodeURIComponent(escape(V.stringify(i)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(i){return V.parse(unescape(encodeURIComponent(i)))}},l=x.BufferedBlockAlgorithm=m.extend({reset:function(){this._data=new h.init,this._nDataBytes=0;},_append:function(i){typeof i=="string"&&(i=g.parse(i)),this._data.concat(i),this._nDataBytes+=i.sigBytes;},_process:function(i){var a,c=this._data,d=c.words,y=c.sigBytes,J=this.blockSize,I=J*4,C=y/I;i?C=e.ceil(C):C=e.max((C|0)-this._minBufferSize,0);var A=C*J,H=e.min(A*4,y);if(A){for(var z=0;z<A;z+=J)this._doProcessBlock(d,z);a=d.splice(0,A),c.sigBytes-=H;}return new h.init(a,H)},clone:function(){var i=m.clone.call(this);return i._data=this._data.clone(),i},_minBufferSize:0});x.Hasher=l.extend({cfg:m.extend(),init:function(i){this.cfg=this.cfg.extend(i),this.reset();},reset:function(){l.reset.call(this),this._doReset();},update:function(i){return this._append(i),this._process(),this},finalize:function(i){i&&this._append(i);var a=this._doFinalize();return a},blockSize:512/32,_createHelper:function(i){return function(a,c){return new i.init(c).finalize(a)}},_createHmacHelper:function(i){return function(a,c){return new v.HMAC.init(i,c).finalize(a)}}});var v=r.algo={};return r})(Math);return n});});var K=M((E,X)=>{(function(n,e){typeof E=="object"?X.exports=E=e(F()):typeof define=="function"&&define.amd?define(["./core"],e):e(n.CryptoJS);})(E,function(n){return (function(){var e=n,o=e.lib,t=o.WordArray,s=o.Hasher,p=e.algo,r=[],x=p.SHA1=s.extend({_doReset:function(){this._hash=new t.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(m,h){for(var u=this._hash.words,N=u[0],V=u[1],g=u[2],l=u[3],w=u[4],v=0;v<80;v++){if(v<16)r[v]=m[h+v]|0;else {var i=r[v-3]^r[v-8]^r[v-14]^r[v-16];r[v]=i<<1|i>>>31;}var a=(N<<5|N>>>27)+w+r[v];v<20?a+=(V&g|~V&l)+1518500249:v<40?a+=(V^g^l)+1859775393:v<60?a+=(V&g|V&l|g&l)-1894007588:a+=(V^g^l)-899497514,w=l,l=g,g=V<<30|V>>>2,V=N,N=a;}u[0]=u[0]+N|0,u[1]=u[1]+V|0,u[2]=u[2]+g|0,u[3]=u[3]+l|0,u[4]=u[4]+w|0;},_doFinalize:function(){var m=this._data,h=m.words,u=this._nDataBytes*8,N=m.sigBytes*8;return h[N>>>5]|=128<<24-N%32,h[(N+64>>>9<<4)+14]=Math.floor(u/4294967296),h[(N+64>>>9<<4)+15]=u,m.sigBytes=h.length*4,this._process(),this._hash},clone:function(){var m=s.clone.call(this);return m._hash=this._hash.clone(),m}});e.SHA1=s._createHelper(x),e.HmacSHA1=s._createHmacHelper(x);})(),n.SHA1});});var B="___param___";var f;(s=>(s.log=(p,...r)=>console.log(`[Pixi\u2019VN Json] ${p}`,...r),s.warn=(p,...r)=>console.warn(`[Pixi\u2019VN Json] ${p}`,...r),s.error=(p,...r)=>console.error(`[Pixi\u2019VN Json] ${p}`,...r),s.info=(p,...r)=>console.info(`[Pixi\u2019VN Json] ${p}`,...r)))(f||={});var L=class n{static init(e){e.loadAssets&&(n._loadAssets=e.loadAssets),e.soundOperation&&(n._soundOperation=e.soundOperation),e.imageOperation&&(n._imageOperation=e.imageOperation),e.videoOperation&&(n._videoOperation=e.videoOperation),e.imageContainerOperation&&(n._imageContainerOperation=e.imageContainerOperation),e.textOperation&&(n._textOperation=e.textOperation),e.canvasElementOperation&&(n._canvasElementOperation=e.canvasElementOperation),e.setStorageValue&&(n._setStorageValue=e.setStorageValue),e.setInitialStorageValue&&(n._setInitialStorageValue=e.setInitialStorageValue),e.narrationOperation&&(n._narrationOperation=e.narrationOperation),e.effectOperation&&(n._effectOperation=e.effectOperation),e.animateOperation&&(n._animateOperation=e.animateOperation),e.canvasOperation&&(n._canvasOperation=e.canvasOperation),e.getLogichValue&&(n._getLogichValue=e.getLogichValue),e.getConditionalStep&&(n._getConditionalStep=e.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return n._loadAssets}static _soundOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return n._soundOperation}static _imageOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return n._imageOperation}static _videoOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return n._videoOperation}static _imageContainerOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return n._imageContainerOperation}static _textOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return n._textOperation}static _canvasElementOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return n._canvasElementOperation}static _setStorageValue=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return n._setStorageValue}static _setInitialStorageValue=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return n._setInitialStorageValue}static _narrationOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return n._narrationOperation}static _effectOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return n._effectOperation}static _animateOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return n._animateOperation}static _canvasOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasOperation(){return n._canvasOperation}static _getLogichValue=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return n._getLogichValue}static _getConditionalStep=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new pixiVn.PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return n._getConditionalStep}};function q(n,e){if(e&&typeof e=="object"&&typeof n.functionName=="string"&&n.functionName in e){let o=e[n.functionName];if(typeof o=="function"){let t=n.args.map(s=>L.getLogichValue(s,e));return o(...t)}else f.warn(`getLogichValue function ${n.functionName} not found in props`);}}function W(n,e={}){let o="";return n.values.forEach(t=>{if(typeof t=="string")o+=t;else {let s=core.JsonUnifier.getLogichValue(t,e);o+=`${s}`;}}),o}async function R(n,e,o){let t=core.JsonUnifier.getLogichValue(n,e);if(t)switch(t.type){case "sound":core.JsonUnifier.soundOperation(t);break;case "assets":case "bundle":await core.JsonUnifier.loadAssets(t);break;case "image":await core.JsonUnifier.imageOperation(t);break;case "video":await core.JsonUnifier.videoOperation(t);break;case "imagecontainer":await core.JsonUnifier.imageContainerOperation(t);break;case "text":await core.JsonUnifier.textOperation(t);break;case "canvaselement":await core.JsonUnifier.canvasElementOperation(t);break;case "canvas":core.JsonUnifier.canvasOperation(t);break;case "value":core.JsonUnifier.setStorageValue(t,e);break;case "operationtoconvert":if(o){let s=W(t,e),p=await o(s);p&&await R(p,e,o);}break;case "input":case "dialogue":core.JsonUnifier.narrationOperation(t);break;case "shake":await core.JsonUnifier.effectOperation(t);break;case "animate":case "animate-sequence":core.JsonUnifier.animateOperation(t);break;case "function":await q(t,e);break}}function D(n){let e=core.JsonUnifier.getLogichValue(n,{});e&&e.type==="value"&&e.storageOperationType==="set"&&(e.storageType==="storage"||e.storageType==="tempstorage")&&core.JsonUnifier.setInitialStorageValue(e);}var Y=re(K());var _=class extends narration.LabelAbstract{constructor(e,o,t,s={}){t||(t={}),t.onLoadingLabel=async()=>{for(let p of o){let r;if(typeof p=="function"?r=p():r=p,r=core.JsonUnifier.getConditionalStep(r),r.operations)try{let x=r.operations.map(m=>core.JsonUnifier.loadAssets(m));await Promise.all(x);}catch(x){f.error("The operation in the onLoadingLabel function of the label has an error:",x);}}},super(e,t),this._steps=o,this.operationStringConvert=s.operationStringConvert,this.skipEmptyDialogs=s.skipEmptyDialogs||false;}_steps;get steps(){return this._steps.map(e=>this.stepConverter(e))}get stepCount(){return this._steps.length}getStepById(e){if(e<0||e>=this._steps.length)return;let o=this._steps[e];return this.stepConverter(o)}operationStringConvert;skipEmptyDialogs=false;getStepSha(e){if(e<0||e>=this.steps.length)return;let o=this._steps[e];return (0, Y.default)(o.toString().toLocaleLowerCase()).toString()}getDialogueText(e,o){let t="";if(Array.isArray(e)){let s=[];e.forEach(p=>{if(typeof p=="string")s.push(p);else if(p&&typeof p=="object"){let r=core.JsonUnifier.getLogichValue(p,o);r?(r&&!Array.isArray(r)&&typeof r=="object"&&(r=core.JsonUnifier.getLogichValue(r,o)||""),Array.isArray(r)?s=s.map(x=>`${x}`).concat(r):s.push(`${r}`)):s.push(`${p}`);}else s.push(`${p}`);}),t=s;}else {let s=core.JsonUnifier.getLogichValue(e,o);s&&!Array.isArray(s)&&typeof s=="object"&&(s=core.JsonUnifier.getLogichValue(s,o)),s&&Array.isArray(s)?t=s.map(p=>`${p}`):t=`${s}`;}return t}getDialogue(e,o){if(e==null)return;let t=core.JsonUnifier.getLogichValue(e,o);return t==null?`${t}`:typeof t=="object"&&"character"in t&&"text"in t?{character:t.character,text:translator.translator.t(this.getDialogueText(t.text,o))}:translator.translator.t(this.getDialogueText(t,o))}getChoices(e,o){return core.JsonUnifier.getLogichValue(e,o)?.map(p=>core.JsonUnifier.getLogichValue(p,o)).filter(p=>p!==void 0)}stepConverter(e){return async o=>{let t=typeof e=="function"?e():e;t=pixiVn.createExportableElement(t),t=core.JsonUnifier.getConditionalStep(t,o);let s=this.operationStringConvert?g=>this.operationStringConvert(g,t,o):void 0,{operations:p=[]}=t;for(let g of p)await R(g,o,s);let{labelToOpen:r=[]}=t,x=this.getChoices(t.choices,o),m=core.JsonUnifier.getLogichValue(t.glueEnabled,o),h=this.getDialogue(t.dialogue,o),u=[];Array.isArray(r)||(r=[r]),r.forEach(g=>{let l=core.JsonUnifier.getLogichValue(g,o);l&&u.push(l);});let N=core.JsonUnifier.getLogichValue(t.goNextStep,o),V=core.JsonUnifier.getLogichValue(t.end,o);if(x){let g=x.map(l=>{let w="";if(Array.isArray(l.text)){let i=[];l.text.forEach(a=>{if(typeof a=="string")i.push(translator.translator.t(a));else if(a&&typeof a=="object"){let c=core.JsonUnifier.getLogichValue(a,o);c&&!Array.isArray(c)&&typeof c=="object"&&(c=core.JsonUnifier.getLogichValue(c,o)||""),c&&(Array.isArray(c)?i=i.concat(translator.translator.t(c)):i.push(translator.translator.t(c)));}}),w=i;}else typeof l.text=="string"&&(w=translator.translator.t(l.text));return {label:l.label,text:w,props:l.props,type:l.type,oneTime:l.oneTime,onlyHaveNoChoice:l.onlyHaveNoChoice,autoSelect:l.autoSelect}});narration.narration.choices=g;}else narration.narration.choices=void 0;h!==void 0&&(narration.narration.dialogue=h,this.skipEmptyDialogs&&typeof h=="string"&&(h===""||RegExp(/^\s+$/).test(h))&&(N=true)),m?narration.narration.dialogGlue=true:m===false&&(narration.narration.dialogGlue=false);for(let g of u){let l=g.label;typeof l=="object"&&(l=core.JsonUnifier.getLogichValue(l,o)||"");let w=g.params?.map(v=>core.JsonUnifier.getLogichValue(v,o));o={...o,...g.props},g.type==="jump"?(narration.narration.openedLabels.length>0&&narration.narration.closeCurrentLabel(),storage.storage.setTempVariable(`${B}${narration.narration.openedLabels.length}`,w),await narration.narration.call(l,o)):(storage.storage.setTempVariable(`${B}${narration.narration.openedLabels.length}`,w),await narration.narration.call(l,o));}V==="game_end"?(narration.narration.closeAllLabels(),await narration.narration.continue(o,{runNow:true})):V==="label_end"&&narration.narration.closeCurrentLabel(),N&&await narration.narration.continue(o,{runNow:true});}}};async function de(n,e={}){if(!Array.isArray(n))if(typeof n=="object"||typeof n=="string")n=[n];else {f.error("Error parsing imported Pixi'VN JSON: data is not an object");return}let o=n.map(p=>{if(typeof p=="string")try{return JSON.parse(p)}catch(r){return f.error("Error parsing imported Pixi'VN JSON",r),{}}return p}),t=o.map(async p=>{if(p.initialOperations)for(let r of p.initialOperations)r.type==="value"&&(typeof r.value!="object"||!r.value||!("type"in r.value))&&D(r);return Promise.resolve()});await Promise.all(t);let s=o.map(async p=>{if(p.initialOperations)for(let r of p.initialOperations)(r.type!=="value"||r.type==="value"&&typeof r.value=="object"&&r.value&&"type"in r.value)&&D(r);if(p.labels){let r=p.labels;for(let x in r)try{let m=r[x],h=new _(x,m,void 0,e);narration.RegisteredLabels.add(h);}catch(m){f.error(`Error creating JSON label ${x}`,m);}}return Promise.resolve()});await Promise.all(s);}exports.LabelJson=_;exports.importPixiVNJson=de;
|
package/dist/interpreter.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { x as PixiVNJsonLabelStep, P as PixiVNJsonOperation } from './PixiVNJsonLabelStep-DKmA62M_.cjs';
|
|
2
2
|
import { LabelAbstract, LabelProps, StepLabelPropsType, StepLabelType } from '@drincs/pixi-vn/narration';
|
|
3
3
|
import { PixiVNJson } from './schema.cjs';
|
|
4
4
|
import '@drincs/pixi-vn';
|
package/dist/interpreter.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { x as PixiVNJsonLabelStep, P as PixiVNJsonOperation } from './PixiVNJsonLabelStep-DKmA62M_.js';
|
|
2
2
|
import { LabelAbstract, LabelProps, StepLabelPropsType, StepLabelType } from '@drincs/pixi-vn/narration';
|
|
3
3
|
import { PixiVNJson } from './schema.js';
|
|
4
4
|
import '@drincs/pixi-vn';
|
package/dist/interpreter.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {createExportableElement,PixiError}from'@drincs/pixi-vn';import {JsonUnifier}from'@drincs/pixi-vn-json/core';import {translator}from'@drincs/pixi-vn-json/translator';import {LabelAbstract,narration,RegisteredLabels}from'@drincs/pixi-vn/narration';import {storage}from'@drincs/pixi-vn/storage';var Z=Object.create;var $=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var B=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var M=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var oe=(n,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ie(e))!ne.call(n,s)&&s!==o&&$(n,s,{get:()=>e[s],enumerable:!(t=ee(e,s))||t.enumerable});return n};var re=(n,e,o)=>(o=n!=null?Z(te(n)):{},oe($(o,"default",{value:n,enumerable:true}),n));var F=M((A,G)=>{(function(n,e){typeof A=="object"?G.exports=A=e():typeof define=="function"&&define.amd?define([],e):n.CryptoJS=e();})(A,function(){var n=n||(function(e,o){var t;if(typeof window<"u"&&window.crypto&&(t=window.crypto),typeof self<"u"&&self.crypto&&(t=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(t=globalThis.crypto),!t&&typeof window<"u"&&window.msCrypto&&(t=window.msCrypto),!t&&typeof global<"u"&&global.crypto&&(t=global.crypto),!t&&typeof B=="function")try{t=B("crypto");}catch{}var s=function(){if(t){if(typeof t.getRandomValues=="function")try{return t.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof t.randomBytes=="function")try{return t.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},p=Object.create||(function(){function i(){}return function(a){var c;return i.prototype=a,c=new i,i.prototype=null,c}})(),r={},x=r.lib={},f=x.Base=(function(){return {extend:function(i){var a=p(this);return i&&a.mixIn(i),(!a.hasOwnProperty("init")||this.init===a.init)&&(a.init=function(){a.$super.init.apply(this,arguments);}),a.init.prototype=a,a.$super=this,a},create:function(){var i=this.extend();return i.init.apply(i,arguments),i},init:function(){},mixIn:function(i){for(var a in i)i.hasOwnProperty(a)&&(this[a]=i[a]);i.hasOwnProperty("toString")&&(this.toString=i.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),h=x.WordArray=f.extend({init:function(i,a){i=this.words=i||[],a!=o?this.sigBytes=a:this.sigBytes=i.length*4;},toString:function(i){return (i||N).stringify(this)},concat:function(i){var a=this.words,c=i.words,d=this.sigBytes,y=i.sigBytes;if(this.clamp(),d%4)for(var J=0;J<y;J++){var I=c[J>>>2]>>>24-J%4*8&255;a[d+J>>>2]|=I<<24-(d+J)%4*8;}else for(var C=0;C<y;C+=4)a[d+C>>>2]=c[C>>>2];return this.sigBytes+=y,this},clamp:function(){var i=this.words,a=this.sigBytes;i[a>>>2]&=4294967295<<32-a%4*8,i.length=e.ceil(a/4);},clone:function(){var i=f.clone.call(this);return i.words=this.words.slice(0),i},random:function(i){for(var a=[],c=0;c<i;c+=4)a.push(s());return new h.init(a,i)}}),u=r.enc={},N=u.Hex={stringify:function(i){for(var a=i.words,c=i.sigBytes,d=[],y=0;y<c;y++){var J=a[y>>>2]>>>24-y%4*8&255;d.push((J>>>4).toString(16)),d.push((J&15).toString(16));}return d.join("")},parse:function(i){for(var a=i.length,c=[],d=0;d<a;d+=2)c[d>>>3]|=parseInt(i.substr(d,2),16)<<24-d%8*4;return new h.init(c,a/2)}},V=u.Latin1={stringify:function(i){for(var a=i.words,c=i.sigBytes,d=[],y=0;y<c;y++){var J=a[y>>>2]>>>24-y%4*8&255;d.push(String.fromCharCode(J));}return d.join("")},parse:function(i){for(var a=i.length,c=[],d=0;d<a;d++)c[d>>>2]|=(i.charCodeAt(d)&255)<<24-d%4*8;return new h.init(c,a)}},m=u.Utf8={stringify:function(i){try{return decodeURIComponent(escape(V.stringify(i)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(i){return V.parse(unescape(encodeURIComponent(i)))}},l=x.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new h.init,this._nDataBytes=0;},_append:function(i){typeof i=="string"&&(i=m.parse(i)),this._data.concat(i),this._nDataBytes+=i.sigBytes;},_process:function(i){var a,c=this._data,d=c.words,y=c.sigBytes,J=this.blockSize,I=J*4,C=y/I;i?C=e.ceil(C):C=e.max((C|0)-this._minBufferSize,0);var T=C*J,H=e.min(T*4,y);if(T){for(var z=0;z<T;z+=J)this._doProcessBlock(d,z);a=d.splice(0,T),c.sigBytes-=H;}return new h.init(a,H)},clone:function(){var i=f.clone.call(this);return i._data=this._data.clone(),i},_minBufferSize:0});x.Hasher=l.extend({cfg:f.extend(),init:function(i){this.cfg=this.cfg.extend(i),this.reset();},reset:function(){l.reset.call(this),this._doReset();},update:function(i){return this._append(i),this._process(),this},finalize:function(i){i&&this._append(i);var a=this._doFinalize();return a},blockSize:512/32,_createHelper:function(i){return function(a,c){return new i.init(c).finalize(a)}},_createHmacHelper:function(i){return function(a,c){return new P.HMAC.init(i,c).finalize(a)}}});var P=r.algo={};return r})(Math);return n});});var K=M((E,X)=>{(function(n,e){typeof E=="object"?X.exports=E=e(F()):typeof define=="function"&&define.amd?define(["./core"],e):e(n.CryptoJS);})(E,function(n){return (function(){var e=n,o=e.lib,t=o.WordArray,s=o.Hasher,p=e.algo,r=[],x=p.SHA1=s.extend({_doReset:function(){this._hash=new t.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(f,h){for(var u=this._hash.words,N=u[0],V=u[1],m=u[2],l=u[3],w=u[4],P=0;P<80;P++){if(P<16)r[P]=f[h+P]|0;else {var i=r[P-3]^r[P-8]^r[P-14]^r[P-16];r[P]=i<<1|i>>>31;}var a=(N<<5|N>>>27)+w+r[P];P<20?a+=(V&m|~V&l)+1518500249:P<40?a+=(V^m^l)+1859775393:P<60?a+=(V&m|V&l|m&l)-1894007588:a+=(V^m^l)-899497514,w=l,l=m,m=V<<30|V>>>2,V=N,N=a;}u[0]=u[0]+N|0,u[1]=u[1]+V|0,u[2]=u[2]+m|0,u[3]=u[3]+l|0,u[4]=u[4]+w|0;},_doFinalize:function(){var f=this._data,h=f.words,u=this._nDataBytes*8,N=f.sigBytes*8;return h[N>>>5]|=128<<24-N%32,h[(N+64>>>9<<4)+14]=Math.floor(u/4294967296),h[(N+64>>>9<<4)+15]=u,f.sigBytes=h.length*4,this._process(),this._hash},clone:function(){var f=s.clone.call(this);return f._hash=this._hash.clone(),f}});e.SHA1=s._createHelper(x),e.HmacSHA1=s._createHmacHelper(x);})(),n.SHA1});});var k="___param___";var g;(s=>(s.log=(p,...r)=>console.log(`[Pixi\u2019VN Json] ${p}`,...r),s.warn=(p,...r)=>console.warn(`[Pixi\u2019VN Json] ${p}`,...r),s.error=(p,...r)=>console.error(`[Pixi\u2019VN Json] ${p}`,...r),s.info=(p,...r)=>console.info(`[Pixi\u2019VN Json] ${p}`,...r)))(g||={});var L=class n{static init(e){e.loadAssets&&(n._loadAssets=e.loadAssets),e.soundOperation&&(n._soundOperation=e.soundOperation),e.imageOperation&&(n._imageOperation=e.imageOperation),e.videoOperation&&(n._videoOperation=e.videoOperation),e.imageContainerOperation&&(n._imageContainerOperation=e.imageContainerOperation),e.textOperation&&(n._textOperation=e.textOperation),e.canvasElementOperation&&(n._canvasElementOperation=e.canvasElementOperation),e.setStorageValue&&(n._setStorageValue=e.setStorageValue),e.setInitialStorageValue&&(n._setInitialStorageValue=e.setInitialStorageValue),e.narrationOperation&&(n._narrationOperation=e.narrationOperation),e.effectOperation&&(n._effectOperation=e.effectOperation),e.animateOperation&&(n._animateOperation=e.animateOperation),e.getLogichValue&&(n._getLogichValue=e.getLogichValue),e.getConditionalStep&&(n._getConditionalStep=e.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return n._loadAssets}static _soundOperation=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return n._soundOperation}static _imageOperation=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return n._imageOperation}static _videoOperation=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return n._videoOperation}static _imageContainerOperation=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return n._imageContainerOperation}static _textOperation=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return n._textOperation}static _canvasElementOperation=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return n._canvasElementOperation}static _setStorageValue=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return n._setStorageValue}static _setInitialStorageValue=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return n._setInitialStorageValue}static _narrationOperation=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return n._narrationOperation}static _effectOperation=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return n._effectOperation}static _animateOperation=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return n._animateOperation}static _getLogichValue=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return n._getLogichValue}static _getConditionalStep=()=>{throw g.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return n._getConditionalStep}};function q(n,e){if(e&&typeof e=="object"&&typeof n.functionName=="string"&&n.functionName in e){let o=e[n.functionName];if(typeof o=="function"){let t=n.args.map(s=>L.getLogichValue(s,e));return o(...t)}else g.warn(`getLogichValue function ${n.functionName} not found in props`);}}function W(n,e={}){let o="";return n.values.forEach(t=>{if(typeof t=="string")o+=t;else {let s=JsonUnifier.getLogichValue(t,e);o+=`${s}`;}}),o}async function R(n,e,o){let t=JsonUnifier.getLogichValue(n,e);if(t)switch(t.type){case "sound":JsonUnifier.soundOperation(t);break;case "assets":case "bundle":await JsonUnifier.loadAssets(t);break;case "image":await JsonUnifier.imageOperation(t);break;case "video":await JsonUnifier.videoOperation(t);break;case "imagecontainer":await JsonUnifier.imageContainerOperation(t);break;case "text":await JsonUnifier.textOperation(t);break;case "canvaselement":await JsonUnifier.canvasElementOperation(t);break;case "value":JsonUnifier.setStorageValue(t,e);break;case "operationtoconvert":if(o){let s=W(t,e),p=await o(s);p&&await R(p,e,o);}break;case "input":case "dialogue":JsonUnifier.narrationOperation(t);break;case "shake":await JsonUnifier.effectOperation(t);break;case "animate":case "animate-sequence":JsonUnifier.animateOperation(t);break;case "function":await q(t,e);break}}function D(n){let e=JsonUnifier.getLogichValue(n,{});e&&e.type==="value"&&e.storageOperationType==="set"&&(e.storageType==="storage"||e.storageType==="tempstorage")&&JsonUnifier.setInitialStorageValue(e);}var Y=re(K());var _=class extends LabelAbstract{constructor(e,o,t,s={}){t||(t={}),t.onLoadingLabel=async()=>{for(let p of o){let r;if(typeof p=="function"?r=p():r=p,r=JsonUnifier.getConditionalStep(r),r.operations)try{let x=r.operations.map(f=>JsonUnifier.loadAssets(f));await Promise.all(x);}catch(x){g.error("The operation in the onLoadingLabel function of the label has an error:",x);}}},super(e,t),this._steps=o,this.operationStringConvert=s.operationStringConvert,this.skipEmptyDialogs=s.skipEmptyDialogs||false;}_steps;get steps(){return this._steps.map(e=>this.stepConverter(e))}get stepCount(){return this._steps.length}getStepById(e){if(e<0||e>=this._steps.length)return;let o=this._steps[e];return this.stepConverter(o)}operationStringConvert;skipEmptyDialogs=false;getStepSha(e){if(e<0||e>=this.steps.length)return;let o=this._steps[e];return (0, Y.default)(o.toString().toLocaleLowerCase()).toString()}getDialogueText(e,o){let t="";if(Array.isArray(e)){let s=[];e.forEach(p=>{if(typeof p=="string")s.push(p);else if(p&&typeof p=="object"){let r=JsonUnifier.getLogichValue(p,o);r?(r&&!Array.isArray(r)&&typeof r=="object"&&(r=JsonUnifier.getLogichValue(r,o)||""),Array.isArray(r)?s=s.map(x=>`${x}`).concat(r):s.push(`${r}`)):s.push(`${p}`);}else s.push(`${p}`);}),t=s;}else {let s=JsonUnifier.getLogichValue(e,o);s&&!Array.isArray(s)&&typeof s=="object"&&(s=JsonUnifier.getLogichValue(s,o)),s&&Array.isArray(s)?t=s.map(p=>`${p}`):t=`${s}`;}return t}getDialogue(e,o){if(e==null)return;let t=JsonUnifier.getLogichValue(e,o);return t==null?`${t}`:typeof t=="object"&&"character"in t&&"text"in t?{character:t.character,text:translator.t(this.getDialogueText(t.text,o))}:translator.t(this.getDialogueText(t,o))}getChoices(e,o){return JsonUnifier.getLogichValue(e,o)?.map(p=>JsonUnifier.getLogichValue(p,o)).filter(p=>p!==void 0)}stepConverter(e){return async o=>{let t=typeof e=="function"?e():e;t=createExportableElement(t),t=JsonUnifier.getConditionalStep(t,o);let s=this.operationStringConvert?m=>this.operationStringConvert(m,t,o):void 0,{operations:p=[]}=t;for(let m of p)await R(m,o,s);let{labelToOpen:r=[]}=t,x=this.getChoices(t.choices,o),f=JsonUnifier.getLogichValue(t.glueEnabled,o),h=this.getDialogue(t.dialogue,o),u=[];Array.isArray(r)||(r=[r]),r.forEach(m=>{let l=JsonUnifier.getLogichValue(m,o);l&&u.push(l);});let N=JsonUnifier.getLogichValue(t.goNextStep,o),V=JsonUnifier.getLogichValue(t.end,o);if(x){let m=x.map(l=>{let w="";if(Array.isArray(l.text)){let i=[];l.text.forEach(a=>{if(typeof a=="string")i.push(translator.t(a));else if(a&&typeof a=="object"){let c=JsonUnifier.getLogichValue(a,o);c&&!Array.isArray(c)&&typeof c=="object"&&(c=JsonUnifier.getLogichValue(c,o)||""),c&&(Array.isArray(c)?i=i.concat(translator.t(c)):i.push(translator.t(c)));}}),w=i;}else typeof l.text=="string"&&(w=translator.t(l.text));return {label:l.label,text:w,props:l.props,type:l.type,oneTime:l.oneTime,onlyHaveNoChoice:l.onlyHaveNoChoice,autoSelect:l.autoSelect}});narration.choices=m;}else narration.choices=void 0;h!==void 0&&(narration.dialogue=h,this.skipEmptyDialogs&&typeof h=="string"&&(h===""||RegExp(/^\s+$/).test(h))&&(N=true)),f?narration.dialogGlue=true:f===false&&(narration.dialogGlue=false);for(let m of u){let l=m.label;typeof l=="object"&&(l=JsonUnifier.getLogichValue(l,o)||"");let w=m.params?.map(P=>JsonUnifier.getLogichValue(P,o));o={...o,...m.props},m.type==="jump"?(narration.openedLabels.length>0&&narration.closeCurrentLabel(),storage.setTempVariable(`${k}${narration.openedLabels.length}`,w),await narration.call(l,o)):(storage.setTempVariable(`${k}${narration.openedLabels.length}`,w),await narration.call(l,o));}V==="game_end"?(narration.closeAllLabels(),await narration.continue(o,{runNow:true})):V==="label_end"&&narration.closeCurrentLabel(),N&&await narration.continue(o,{runNow:true});}}};async function de(n,e={}){if(!Array.isArray(n))if(typeof n=="object"||typeof n=="string")n=[n];else {g.error("Error parsing imported Pixi'VN JSON: data is not an object");return}let o=n.map(p=>{if(typeof p=="string")try{return JSON.parse(p)}catch(r){return g.error("Error parsing imported Pixi'VN JSON",r),{}}return p}),t=o.map(async p=>{if(p.initialOperations)for(let r of p.initialOperations)r.type==="value"&&(typeof r.value!="object"||!r.value||!("type"in r.value))&&D(r);return Promise.resolve()});await Promise.all(t);let s=o.map(async p=>{if(p.initialOperations)for(let r of p.initialOperations)(r.type!=="value"||r.type==="value"&&typeof r.value=="object"&&r.value&&"type"in r.value)&&D(r);if(p.labels){let r=p.labels;for(let x in r)try{let f=r[x],h=new _(x,f,void 0,e);RegisteredLabels.add(h);}catch(f){g.error(`Error creating JSON label ${x}`,f);}}return Promise.resolve()});await Promise.all(s);}export{_ as LabelJson,de as importPixiVNJson};
|
|
1
|
+
import {createExportableElement,PixiError}from'@drincs/pixi-vn';import {JsonUnifier}from'@drincs/pixi-vn-json/core';import {translator}from'@drincs/pixi-vn-json/translator';import {LabelAbstract,narration,RegisteredLabels}from'@drincs/pixi-vn/narration';import {storage}from'@drincs/pixi-vn/storage';var Z=Object.create;var $=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var k=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var M=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var oe=(n,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ie(e))!ne.call(n,s)&&s!==o&&$(n,s,{get:()=>e[s],enumerable:!(t=ee(e,s))||t.enumerable});return n};var re=(n,e,o)=>(o=n!=null?Z(te(n)):{},oe($(o,"default",{value:n,enumerable:true}),n));var F=M((T,G)=>{(function(n,e){typeof T=="object"?G.exports=T=e():typeof define=="function"&&define.amd?define([],e):n.CryptoJS=e();})(T,function(){var n=n||(function(e,o){var t;if(typeof window<"u"&&window.crypto&&(t=window.crypto),typeof self<"u"&&self.crypto&&(t=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(t=globalThis.crypto),!t&&typeof window<"u"&&window.msCrypto&&(t=window.msCrypto),!t&&typeof global<"u"&&global.crypto&&(t=global.crypto),!t&&typeof k=="function")try{t=k("crypto");}catch{}var s=function(){if(t){if(typeof t.getRandomValues=="function")try{return t.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof t.randomBytes=="function")try{return t.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},p=Object.create||(function(){function i(){}return function(a){var c;return i.prototype=a,c=new i,i.prototype=null,c}})(),r={},x=r.lib={},m=x.Base=(function(){return {extend:function(i){var a=p(this);return i&&a.mixIn(i),(!a.hasOwnProperty("init")||this.init===a.init)&&(a.init=function(){a.$super.init.apply(this,arguments);}),a.init.prototype=a,a.$super=this,a},create:function(){var i=this.extend();return i.init.apply(i,arguments),i},init:function(){},mixIn:function(i){for(var a in i)i.hasOwnProperty(a)&&(this[a]=i[a]);i.hasOwnProperty("toString")&&(this.toString=i.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),h=x.WordArray=m.extend({init:function(i,a){i=this.words=i||[],a!=o?this.sigBytes=a:this.sigBytes=i.length*4;},toString:function(i){return (i||N).stringify(this)},concat:function(i){var a=this.words,c=i.words,d=this.sigBytes,y=i.sigBytes;if(this.clamp(),d%4)for(var J=0;J<y;J++){var I=c[J>>>2]>>>24-J%4*8&255;a[d+J>>>2]|=I<<24-(d+J)%4*8;}else for(var C=0;C<y;C+=4)a[d+C>>>2]=c[C>>>2];return this.sigBytes+=y,this},clamp:function(){var i=this.words,a=this.sigBytes;i[a>>>2]&=4294967295<<32-a%4*8,i.length=e.ceil(a/4);},clone:function(){var i=m.clone.call(this);return i.words=this.words.slice(0),i},random:function(i){for(var a=[],c=0;c<i;c+=4)a.push(s());return new h.init(a,i)}}),u=r.enc={},N=u.Hex={stringify:function(i){for(var a=i.words,c=i.sigBytes,d=[],y=0;y<c;y++){var J=a[y>>>2]>>>24-y%4*8&255;d.push((J>>>4).toString(16)),d.push((J&15).toString(16));}return d.join("")},parse:function(i){for(var a=i.length,c=[],d=0;d<a;d+=2)c[d>>>3]|=parseInt(i.substr(d,2),16)<<24-d%8*4;return new h.init(c,a/2)}},V=u.Latin1={stringify:function(i){for(var a=i.words,c=i.sigBytes,d=[],y=0;y<c;y++){var J=a[y>>>2]>>>24-y%4*8&255;d.push(String.fromCharCode(J));}return d.join("")},parse:function(i){for(var a=i.length,c=[],d=0;d<a;d++)c[d>>>2]|=(i.charCodeAt(d)&255)<<24-d%4*8;return new h.init(c,a)}},g=u.Utf8={stringify:function(i){try{return decodeURIComponent(escape(V.stringify(i)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(i){return V.parse(unescape(encodeURIComponent(i)))}},l=x.BufferedBlockAlgorithm=m.extend({reset:function(){this._data=new h.init,this._nDataBytes=0;},_append:function(i){typeof i=="string"&&(i=g.parse(i)),this._data.concat(i),this._nDataBytes+=i.sigBytes;},_process:function(i){var a,c=this._data,d=c.words,y=c.sigBytes,J=this.blockSize,I=J*4,C=y/I;i?C=e.ceil(C):C=e.max((C|0)-this._minBufferSize,0);var A=C*J,H=e.min(A*4,y);if(A){for(var z=0;z<A;z+=J)this._doProcessBlock(d,z);a=d.splice(0,A),c.sigBytes-=H;}return new h.init(a,H)},clone:function(){var i=m.clone.call(this);return i._data=this._data.clone(),i},_minBufferSize:0});x.Hasher=l.extend({cfg:m.extend(),init:function(i){this.cfg=this.cfg.extend(i),this.reset();},reset:function(){l.reset.call(this),this._doReset();},update:function(i){return this._append(i),this._process(),this},finalize:function(i){i&&this._append(i);var a=this._doFinalize();return a},blockSize:512/32,_createHelper:function(i){return function(a,c){return new i.init(c).finalize(a)}},_createHmacHelper:function(i){return function(a,c){return new v.HMAC.init(i,c).finalize(a)}}});var v=r.algo={};return r})(Math);return n});});var K=M((E,X)=>{(function(n,e){typeof E=="object"?X.exports=E=e(F()):typeof define=="function"&&define.amd?define(["./core"],e):e(n.CryptoJS);})(E,function(n){return (function(){var e=n,o=e.lib,t=o.WordArray,s=o.Hasher,p=e.algo,r=[],x=p.SHA1=s.extend({_doReset:function(){this._hash=new t.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(m,h){for(var u=this._hash.words,N=u[0],V=u[1],g=u[2],l=u[3],w=u[4],v=0;v<80;v++){if(v<16)r[v]=m[h+v]|0;else {var i=r[v-3]^r[v-8]^r[v-14]^r[v-16];r[v]=i<<1|i>>>31;}var a=(N<<5|N>>>27)+w+r[v];v<20?a+=(V&g|~V&l)+1518500249:v<40?a+=(V^g^l)+1859775393:v<60?a+=(V&g|V&l|g&l)-1894007588:a+=(V^g^l)-899497514,w=l,l=g,g=V<<30|V>>>2,V=N,N=a;}u[0]=u[0]+N|0,u[1]=u[1]+V|0,u[2]=u[2]+g|0,u[3]=u[3]+l|0,u[4]=u[4]+w|0;},_doFinalize:function(){var m=this._data,h=m.words,u=this._nDataBytes*8,N=m.sigBytes*8;return h[N>>>5]|=128<<24-N%32,h[(N+64>>>9<<4)+14]=Math.floor(u/4294967296),h[(N+64>>>9<<4)+15]=u,m.sigBytes=h.length*4,this._process(),this._hash},clone:function(){var m=s.clone.call(this);return m._hash=this._hash.clone(),m}});e.SHA1=s._createHelper(x),e.HmacSHA1=s._createHmacHelper(x);})(),n.SHA1});});var B="___param___";var f;(s=>(s.log=(p,...r)=>console.log(`[Pixi\u2019VN Json] ${p}`,...r),s.warn=(p,...r)=>console.warn(`[Pixi\u2019VN Json] ${p}`,...r),s.error=(p,...r)=>console.error(`[Pixi\u2019VN Json] ${p}`,...r),s.info=(p,...r)=>console.info(`[Pixi\u2019VN Json] ${p}`,...r)))(f||={});var L=class n{static init(e){e.loadAssets&&(n._loadAssets=e.loadAssets),e.soundOperation&&(n._soundOperation=e.soundOperation),e.imageOperation&&(n._imageOperation=e.imageOperation),e.videoOperation&&(n._videoOperation=e.videoOperation),e.imageContainerOperation&&(n._imageContainerOperation=e.imageContainerOperation),e.textOperation&&(n._textOperation=e.textOperation),e.canvasElementOperation&&(n._canvasElementOperation=e.canvasElementOperation),e.setStorageValue&&(n._setStorageValue=e.setStorageValue),e.setInitialStorageValue&&(n._setInitialStorageValue=e.setInitialStorageValue),e.narrationOperation&&(n._narrationOperation=e.narrationOperation),e.effectOperation&&(n._effectOperation=e.effectOperation),e.animateOperation&&(n._animateOperation=e.animateOperation),e.canvasOperation&&(n._canvasOperation=e.canvasOperation),e.getLogichValue&&(n._getLogichValue=e.getLogichValue),e.getConditionalStep&&(n._getConditionalStep=e.getConditionalStep);}static _loadAssets=()=>{};static get loadAssets(){return n._loadAssets}static _soundOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get soundOperation(){return n._soundOperation}static _imageOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageOperation(){return n._imageOperation}static _videoOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get videoOperation(){return n._videoOperation}static _imageContainerOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get imageContainerOperation(){return n._imageContainerOperation}static _textOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get textOperation(){return n._textOperation}static _canvasElementOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasElementOperation(){return n._canvasElementOperation}static _setStorageValue=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setStorageValue(){return n._setStorageValue}static _setInitialStorageValue=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get setInitialStorageValue(){return n._setInitialStorageValue}static _narrationOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get narrationOperation(){return n._narrationOperation}static _effectOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get effectOperation(){return n._effectOperation}static _animateOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get animateOperation(){return n._animateOperation}static _canvasOperation=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get canvasOperation(){return n._canvasOperation}static _getLogichValue=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getLogichValue(){return n._getLogichValue}static _getConditionalStep=()=>{throw f.error("An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue."),new PixiError("invalid_usage","An error occurred! pixi-vn-json was not initialized. Please contact the Pixi'VN team to report the issue.")};static get getConditionalStep(){return n._getConditionalStep}};function q(n,e){if(e&&typeof e=="object"&&typeof n.functionName=="string"&&n.functionName in e){let o=e[n.functionName];if(typeof o=="function"){let t=n.args.map(s=>L.getLogichValue(s,e));return o(...t)}else f.warn(`getLogichValue function ${n.functionName} not found in props`);}}function W(n,e={}){let o="";return n.values.forEach(t=>{if(typeof t=="string")o+=t;else {let s=JsonUnifier.getLogichValue(t,e);o+=`${s}`;}}),o}async function R(n,e,o){let t=JsonUnifier.getLogichValue(n,e);if(t)switch(t.type){case "sound":JsonUnifier.soundOperation(t);break;case "assets":case "bundle":await JsonUnifier.loadAssets(t);break;case "image":await JsonUnifier.imageOperation(t);break;case "video":await JsonUnifier.videoOperation(t);break;case "imagecontainer":await JsonUnifier.imageContainerOperation(t);break;case "text":await JsonUnifier.textOperation(t);break;case "canvaselement":await JsonUnifier.canvasElementOperation(t);break;case "canvas":JsonUnifier.canvasOperation(t);break;case "value":JsonUnifier.setStorageValue(t,e);break;case "operationtoconvert":if(o){let s=W(t,e),p=await o(s);p&&await R(p,e,o);}break;case "input":case "dialogue":JsonUnifier.narrationOperation(t);break;case "shake":await JsonUnifier.effectOperation(t);break;case "animate":case "animate-sequence":JsonUnifier.animateOperation(t);break;case "function":await q(t,e);break}}function D(n){let e=JsonUnifier.getLogichValue(n,{});e&&e.type==="value"&&e.storageOperationType==="set"&&(e.storageType==="storage"||e.storageType==="tempstorage")&&JsonUnifier.setInitialStorageValue(e);}var Y=re(K());var _=class extends LabelAbstract{constructor(e,o,t,s={}){t||(t={}),t.onLoadingLabel=async()=>{for(let p of o){let r;if(typeof p=="function"?r=p():r=p,r=JsonUnifier.getConditionalStep(r),r.operations)try{let x=r.operations.map(m=>JsonUnifier.loadAssets(m));await Promise.all(x);}catch(x){f.error("The operation in the onLoadingLabel function of the label has an error:",x);}}},super(e,t),this._steps=o,this.operationStringConvert=s.operationStringConvert,this.skipEmptyDialogs=s.skipEmptyDialogs||false;}_steps;get steps(){return this._steps.map(e=>this.stepConverter(e))}get stepCount(){return this._steps.length}getStepById(e){if(e<0||e>=this._steps.length)return;let o=this._steps[e];return this.stepConverter(o)}operationStringConvert;skipEmptyDialogs=false;getStepSha(e){if(e<0||e>=this.steps.length)return;let o=this._steps[e];return (0, Y.default)(o.toString().toLocaleLowerCase()).toString()}getDialogueText(e,o){let t="";if(Array.isArray(e)){let s=[];e.forEach(p=>{if(typeof p=="string")s.push(p);else if(p&&typeof p=="object"){let r=JsonUnifier.getLogichValue(p,o);r?(r&&!Array.isArray(r)&&typeof r=="object"&&(r=JsonUnifier.getLogichValue(r,o)||""),Array.isArray(r)?s=s.map(x=>`${x}`).concat(r):s.push(`${r}`)):s.push(`${p}`);}else s.push(`${p}`);}),t=s;}else {let s=JsonUnifier.getLogichValue(e,o);s&&!Array.isArray(s)&&typeof s=="object"&&(s=JsonUnifier.getLogichValue(s,o)),s&&Array.isArray(s)?t=s.map(p=>`${p}`):t=`${s}`;}return t}getDialogue(e,o){if(e==null)return;let t=JsonUnifier.getLogichValue(e,o);return t==null?`${t}`:typeof t=="object"&&"character"in t&&"text"in t?{character:t.character,text:translator.t(this.getDialogueText(t.text,o))}:translator.t(this.getDialogueText(t,o))}getChoices(e,o){return JsonUnifier.getLogichValue(e,o)?.map(p=>JsonUnifier.getLogichValue(p,o)).filter(p=>p!==void 0)}stepConverter(e){return async o=>{let t=typeof e=="function"?e():e;t=createExportableElement(t),t=JsonUnifier.getConditionalStep(t,o);let s=this.operationStringConvert?g=>this.operationStringConvert(g,t,o):void 0,{operations:p=[]}=t;for(let g of p)await R(g,o,s);let{labelToOpen:r=[]}=t,x=this.getChoices(t.choices,o),m=JsonUnifier.getLogichValue(t.glueEnabled,o),h=this.getDialogue(t.dialogue,o),u=[];Array.isArray(r)||(r=[r]),r.forEach(g=>{let l=JsonUnifier.getLogichValue(g,o);l&&u.push(l);});let N=JsonUnifier.getLogichValue(t.goNextStep,o),V=JsonUnifier.getLogichValue(t.end,o);if(x){let g=x.map(l=>{let w="";if(Array.isArray(l.text)){let i=[];l.text.forEach(a=>{if(typeof a=="string")i.push(translator.t(a));else if(a&&typeof a=="object"){let c=JsonUnifier.getLogichValue(a,o);c&&!Array.isArray(c)&&typeof c=="object"&&(c=JsonUnifier.getLogichValue(c,o)||""),c&&(Array.isArray(c)?i=i.concat(translator.t(c)):i.push(translator.t(c)));}}),w=i;}else typeof l.text=="string"&&(w=translator.t(l.text));return {label:l.label,text:w,props:l.props,type:l.type,oneTime:l.oneTime,onlyHaveNoChoice:l.onlyHaveNoChoice,autoSelect:l.autoSelect}});narration.choices=g;}else narration.choices=void 0;h!==void 0&&(narration.dialogue=h,this.skipEmptyDialogs&&typeof h=="string"&&(h===""||RegExp(/^\s+$/).test(h))&&(N=true)),m?narration.dialogGlue=true:m===false&&(narration.dialogGlue=false);for(let g of u){let l=g.label;typeof l=="object"&&(l=JsonUnifier.getLogichValue(l,o)||"");let w=g.params?.map(v=>JsonUnifier.getLogichValue(v,o));o={...o,...g.props},g.type==="jump"?(narration.openedLabels.length>0&&narration.closeCurrentLabel(),storage.setTempVariable(`${B}${narration.openedLabels.length}`,w),await narration.call(l,o)):(storage.setTempVariable(`${B}${narration.openedLabels.length}`,w),await narration.call(l,o));}V==="game_end"?(narration.closeAllLabels(),await narration.continue(o,{runNow:true})):V==="label_end"&&narration.closeCurrentLabel(),N&&await narration.continue(o,{runNow:true});}}};async function de(n,e={}){if(!Array.isArray(n))if(typeof n=="object"||typeof n=="string")n=[n];else {f.error("Error parsing imported Pixi'VN JSON: data is not an object");return}let o=n.map(p=>{if(typeof p=="string")try{return JSON.parse(p)}catch(r){return f.error("Error parsing imported Pixi'VN JSON",r),{}}return p}),t=o.map(async p=>{if(p.initialOperations)for(let r of p.initialOperations)r.type==="value"&&(typeof r.value!="object"||!r.value||!("type"in r.value))&&D(r);return Promise.resolve()});await Promise.all(t);let s=o.map(async p=>{if(p.initialOperations)for(let r of p.initialOperations)(r.type!=="value"||r.type==="value"&&typeof r.value=="object"&&r.value&&"type"in r.value)&&D(r);if(p.labels){let r=p.labels;for(let x in r)try{let m=r[x],h=new _(x,m,void 0,e);RegisteredLabels.add(h);}catch(m){f.error(`Error creating JSON label ${x}`,m);}}return Promise.resolve()});await Promise.all(s);}export{_ as LabelJson,de as importPixiVNJson};
|
package/dist/schema.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { x as PixiVNJsonLabelStep, n as PixiVNJsonValueSet, a as PixiVNJsonIfElse } from './PixiVNJsonLabelStep-DKmA62M_.cjs';
|
|
2
|
+
export { z as PixiVNJsonAnimateBase, A as PixiVNJsonAnimateSequence, u as PixiVNJsonArithmeticOperations, B as PixiVNJsonArithmeticOperationsArithmetic, C as PixiVNJsonArithmeticOperationsArithmeticSingle, D as PixiVNJsonCanvas, r as PixiVNJsonCanvasAnimate, s as PixiVNJsonCanvasClear, E as PixiVNJsonCanvasEdit, q as PixiVNJsonCanvasEffect, i as PixiVNJsonCanvasImageContainerShow, d as PixiVNJsonCanvasImageVideoShow, f as PixiVNJsonCanvasRemove, F as PixiVNJsonCanvasShow, k as PixiVNJsonCanvasTextShow, G as PixiVNJsonChoice, H as PixiVNJsonChoiceGet, I as PixiVNJsonChoices, J as PixiVNJsonComparation, y as PixiVNJsonComparationOperatorsType, K as PixiVNJsonConditionalOperation, L as PixiVNJsonConditionalResultToCombine, w as PixiVNJsonConditionalStatements, v as PixiVNJsonConditions, M as PixiVNJsonDialog, N as PixiVNJsonDialogText, O as PixiVNJsonDialogue, Q as PixiVNJsonFunction, j as PixiVNJsonImageContainerEdit, e as PixiVNJsonImageEdit, R as PixiVNJsonInputRequest, S as PixiVNJsonLabelGet, T as PixiVNJsonLabelToOpen, U as PixiVNJsonLogicGet, V as PixiVNJsonMediaTransiotions, p as PixiVNJsonNarration, o as PixiVNJsonOnlyStorageSet, P as PixiVNJsonOperation, b as PixiVNJsonOperationString, W as PixiVNJsonParamGet, c as PixiVNJsonSound, X as PixiVNJsonSoundEdit, Y as PixiVNJsonSoundPauseResume, Z as PixiVNJsonSoundPlay, _ as PixiVNJsonSoundRemove, $ as PixiVNJsonStepSwitch, a0 as PixiVNJsonStepSwitchElementType, a1 as PixiVNJsonStepSwitchElementsType, a2 as PixiVNJsonStorageGet, l as PixiVNJsonTextEdit, a3 as PixiVNJsonUnionCondition, m as PixiVNJsonUnknownEdit, t as PixiVNJsonValueGet, g as PixiVNJsonVideoEdit, h as PixiVNJsonVideoPauseResume } from './PixiVNJsonLabelStep-DKmA62M_.cjs';
|
|
3
3
|
import '@drincs/pixi-vn';
|
|
4
4
|
import '@drincs/pixi-vn/motion';
|
|
5
5
|
import 'pixi.js';
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { x as PixiVNJsonLabelStep, n as PixiVNJsonValueSet, a as PixiVNJsonIfElse } from './PixiVNJsonLabelStep-DKmA62M_.js';
|
|
2
|
+
export { z as PixiVNJsonAnimateBase, A as PixiVNJsonAnimateSequence, u as PixiVNJsonArithmeticOperations, B as PixiVNJsonArithmeticOperationsArithmetic, C as PixiVNJsonArithmeticOperationsArithmeticSingle, D as PixiVNJsonCanvas, r as PixiVNJsonCanvasAnimate, s as PixiVNJsonCanvasClear, E as PixiVNJsonCanvasEdit, q as PixiVNJsonCanvasEffect, i as PixiVNJsonCanvasImageContainerShow, d as PixiVNJsonCanvasImageVideoShow, f as PixiVNJsonCanvasRemove, F as PixiVNJsonCanvasShow, k as PixiVNJsonCanvasTextShow, G as PixiVNJsonChoice, H as PixiVNJsonChoiceGet, I as PixiVNJsonChoices, J as PixiVNJsonComparation, y as PixiVNJsonComparationOperatorsType, K as PixiVNJsonConditionalOperation, L as PixiVNJsonConditionalResultToCombine, w as PixiVNJsonConditionalStatements, v as PixiVNJsonConditions, M as PixiVNJsonDialog, N as PixiVNJsonDialogText, O as PixiVNJsonDialogue, Q as PixiVNJsonFunction, j as PixiVNJsonImageContainerEdit, e as PixiVNJsonImageEdit, R as PixiVNJsonInputRequest, S as PixiVNJsonLabelGet, T as PixiVNJsonLabelToOpen, U as PixiVNJsonLogicGet, V as PixiVNJsonMediaTransiotions, p as PixiVNJsonNarration, o as PixiVNJsonOnlyStorageSet, P as PixiVNJsonOperation, b as PixiVNJsonOperationString, W as PixiVNJsonParamGet, c as PixiVNJsonSound, X as PixiVNJsonSoundEdit, Y as PixiVNJsonSoundPauseResume, Z as PixiVNJsonSoundPlay, _ as PixiVNJsonSoundRemove, $ as PixiVNJsonStepSwitch, a0 as PixiVNJsonStepSwitchElementType, a1 as PixiVNJsonStepSwitchElementsType, a2 as PixiVNJsonStorageGet, l as PixiVNJsonTextEdit, a3 as PixiVNJsonUnionCondition, m as PixiVNJsonUnknownEdit, t as PixiVNJsonValueGet, g as PixiVNJsonVideoEdit, h as PixiVNJsonVideoPauseResume } from './PixiVNJsonLabelStep-DKmA62M_.js';
|
|
3
3
|
import '@drincs/pixi-vn';
|
|
4
4
|
import '@drincs/pixi-vn/motion';
|
|
5
5
|
import 'pixi.js';
|
package/dist/translator.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ZodType } from 'zod';
|
|
2
2
|
import { StepLabelPropsType } from '@drincs/pixi-vn';
|
|
3
|
-
import {
|
|
3
|
+
import { x as PixiVNJsonLabelStep, P as PixiVNJsonOperation } from './PixiVNJsonLabelStep-DKmA62M_.cjs';
|
|
4
4
|
import '@drincs/pixi-vn/motion';
|
|
5
5
|
import 'pixi.js';
|
|
6
6
|
|
package/dist/translator.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ZodType } from 'zod';
|
|
2
2
|
import { StepLabelPropsType } from '@drincs/pixi-vn';
|
|
3
|
-
import {
|
|
3
|
+
import { x as PixiVNJsonLabelStep, P as PixiVNJsonOperation } from './PixiVNJsonLabelStep-DKmA62M_.js';
|
|
4
4
|
import '@drincs/pixi-vn/motion';
|
|
5
5
|
import 'pixi.js';
|
|
6
6
|
|