@drincs/pixi-vn 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 'use strict';var canvas=require('@drincs/pixi-vn/canvas'),characters=require('@drincs/pixi-vn/characters'),narration=require('@drincs/pixi-vn/narration'),pixi_js=require('@drincs/pixi-vn/pixi.js');function l(){try{let e=characters.RegisteredCharacters.values();fetch("/pixi-vn/characters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}try{let e=narration.RegisteredLabels.keys();fetch("/pixi-vn/labels",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}try{let e=pixi_js.Assets.resolver._assetMap,a=pixi_js.Assets.resolver._bundles,s={bundles:[]};Object.entries(a).forEach(([r,p])=>{let t=[];p.forEach(i=>{if(e[i]){let c=e[i];t=[...t,...c];}}),s.bundles.push({name:r,assets:t});}),fetch("/pixi-vn/assets/manifest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});}catch{}try{let e={height:canvas.canvas.app.screen.height,width:canvas.canvas.app.screen.width};fetch("/pixi-vn/canvas/options",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}}exports.setupPixivnViteData=l;
1
+ 'use strict';var canvas=require('@drincs/pixi-vn/canvas'),characters=require('@drincs/pixi-vn/characters'),narration=require('@drincs/pixi-vn/narration'),pixi_js=require('@drincs/pixi-vn/pixi.js');function d(){try{return new Function('return typeof import !== "undefined" && typeof import.meta !== "undefined" && import.meta.env?.DEV === true')()}catch{return false}}function l(){if(d()){try{let e=characters.RegisteredCharacters.values();fetch("/pixi-vn/characters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}try{let e=narration.RegisteredLabels.keys();fetch("/pixi-vn/labels",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}try{let e=pixi_js.Assets.resolver._assetMap,r=pixi_js.Assets.resolver._bundles,s={bundles:[]};Object.entries(r).forEach(([a,p])=>{let t=[];p.forEach(n=>{if(e[n]){let c=e[n];t=[...t,...c];}}),s.bundles.push({name:a,assets:t});}),fetch("/pixi-vn/assets/manifest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});}catch{}try{let e={height:canvas.canvas.app.screen.height,width:canvas.canvas.app.screen.width};fetch("/pixi-vn/canvas/options",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}}}exports.setupPixivnViteData=l;
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Function that setup the pixivn vite data.
3
3
  * This function should be called in the client side, after the RegisteredCharacters and RegisteredLabels are populated.
4
+ * **Note:** This function only runs in development mode and does nothing in production.
4
5
  */
5
6
  declare function setupPixivnViteData(): void;
6
7
 
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Function that setup the pixivn vite data.
3
3
  * This function should be called in the client side, after the RegisteredCharacters and RegisteredLabels are populated.
4
+ * **Note:** This function only runs in development mode and does nothing in production.
4
5
  */
5
6
  declare function setupPixivnViteData(): void;
6
7
 
@@ -1 +1 @@
1
- import'./chunk-TTRUPDAB.mjs';import {canvas}from'@drincs/pixi-vn/canvas';import {RegisteredCharacters}from'@drincs/pixi-vn/characters';import {RegisteredLabels}from'@drincs/pixi-vn/narration';import {Assets}from'@drincs/pixi-vn/pixi.js';function l(){try{let e=RegisteredCharacters.values();fetch("/pixi-vn/characters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}try{let e=RegisteredLabels.keys();fetch("/pixi-vn/labels",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}try{let e=Assets.resolver._assetMap,a=Assets.resolver._bundles,s={bundles:[]};Object.entries(a).forEach(([r,p])=>{let t=[];p.forEach(i=>{if(e[i]){let c=e[i];t=[...t,...c];}}),s.bundles.push({name:r,assets:t});}),fetch("/pixi-vn/assets/manifest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});}catch{}try{let e={height:canvas.app.screen.height,width:canvas.app.screen.width};fetch("/pixi-vn/canvas/options",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}}export{l as setupPixivnViteData};
1
+ import'./chunk-TTRUPDAB.mjs';import {canvas}from'@drincs/pixi-vn/canvas';import {RegisteredCharacters}from'@drincs/pixi-vn/characters';import {RegisteredLabels}from'@drincs/pixi-vn/narration';import {Assets}from'@drincs/pixi-vn/pixi.js';function d(){try{return new Function('return typeof import !== "undefined" && typeof import.meta !== "undefined" && import.meta.env?.DEV === true')()}catch{return false}}function l(){if(d()){try{let e=RegisteredCharacters.values();fetch("/pixi-vn/characters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}try{let e=RegisteredLabels.keys();fetch("/pixi-vn/labels",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}try{let e=Assets.resolver._assetMap,r=Assets.resolver._bundles,s={bundles:[]};Object.entries(r).forEach(([a,p])=>{let t=[];p.forEach(n=>{if(e[n]){let c=e[n];t=[...t,...c];}}),s.bundles.push({name:a,assets:t});}),fetch("/pixi-vn/assets/manifest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});}catch{}try{let e={height:canvas.app.screen.height,width:canvas.app.screen.width};fetch("/pixi-vn/canvas/options",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});}catch{}}}export{l as setupPixivnViteData};
package/dist/vite.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var s=null,o=null,d=null,l=null;function u(){return {name:"vite-plugin-pixi-vn",configureServer(a){a.middlewares.use("/pixi-vn/characters",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!s){t.statusCode=404,t.end(JSON.stringify({error:"Characters not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(s));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{s=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Characters updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/labels",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!o){t.statusCode=404,t.end(JSON.stringify({error:"Labels not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(o));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{o=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Labels updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/assets/manifest",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!d){t.statusCode=404,t.end(JSON.stringify({error:"Manifest not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(d));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{d=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Manifest updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/canvas/options",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!l){t.statusCode=404,t.end(JSON.stringify({error:"Options not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(l));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{l=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Options updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}});}}}exports.vitePluginPixivn=u;
1
+ 'use strict';var s=null,o=null,d=null,l=null;function u(){return {name:"vite-plugin-pixi-vn",apply:"serve",configureServer(a){a.middlewares.use("/pixi-vn/characters",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!s){t.statusCode=404,t.end(JSON.stringify({error:"Characters not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(s));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{s=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Characters updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/labels",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!o){t.statusCode=404,t.end(JSON.stringify({error:"Labels not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(o));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{o=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Labels updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/assets/manifest",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!d){t.statusCode=404,t.end(JSON.stringify({error:"Manifest not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(d));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{d=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Manifest updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/canvas/options",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!l){t.statusCode=404,t.end(JSON.stringify({error:"Options not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(l));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{l=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Options updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}});}}}exports.vitePluginPixivn=u;
package/dist/vite.d.cts CHANGED
@@ -2,6 +2,7 @@ import { Plugin } from 'vite';
2
2
 
3
3
  /**
4
4
  * Vite plugin to handle pixi-vn related endpoints.
5
+ * This plugin only runs in development mode (serve).
5
6
  * Endpoints:
6
7
  * - GET /pixi-vn/characters -> list of registered characters
7
8
  * - POST /pixi-vn/characters -> update the list of registered characters
package/dist/vite.d.ts CHANGED
@@ -2,6 +2,7 @@ import { Plugin } from 'vite';
2
2
 
3
3
  /**
4
4
  * Vite plugin to handle pixi-vn related endpoints.
5
+ * This plugin only runs in development mode (serve).
5
6
  * Endpoints:
6
7
  * - GET /pixi-vn/characters -> list of registered characters
7
8
  * - POST /pixi-vn/characters -> update the list of registered characters
package/dist/vite.mjs CHANGED
@@ -1 +1 @@
1
- import'./chunk-TTRUPDAB.mjs';var s=null,o=null,d=null,l=null;function u(){return {name:"vite-plugin-pixi-vn",configureServer(a){a.middlewares.use("/pixi-vn/characters",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!s){t.statusCode=404,t.end(JSON.stringify({error:"Characters not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(s));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{s=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Characters updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/labels",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!o){t.statusCode=404,t.end(JSON.stringify({error:"Labels not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(o));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{o=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Labels updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/assets/manifest",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!d){t.statusCode=404,t.end(JSON.stringify({error:"Manifest not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(d));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{d=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Manifest updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/canvas/options",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!l){t.statusCode=404,t.end(JSON.stringify({error:"Options not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(l));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{l=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Options updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}});}}}export{u as vitePluginPixivn};
1
+ import'./chunk-TTRUPDAB.mjs';var s=null,o=null,d=null,l=null;function u(){return {name:"vite-plugin-pixi-vn",apply:"serve",configureServer(a){a.middlewares.use("/pixi-vn/characters",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!s){t.statusCode=404,t.end(JSON.stringify({error:"Characters not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(s));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{s=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Characters updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/labels",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!o){t.statusCode=404,t.end(JSON.stringify({error:"Labels not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(o));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{o=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Labels updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/assets/manifest",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!d){t.statusCode=404,t.end(JSON.stringify({error:"Manifest not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(d));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{d=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Manifest updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}}),a.middlewares.use("/pixi-vn/canvas/options",(i,t)=>{if(t.setHeader("Content-Type","application/json"),i.method==="GET"){if(!l){t.statusCode=404,t.end(JSON.stringify({error:"Options not initialized"}));return}t.statusCode=200,t.end(JSON.stringify(l));}if(i.method==="POST"){let n="";i.on("data",e=>n+=e),i.on("end",()=>{try{l=JSON.parse(n),t.statusCode=201,t.end(JSON.stringify({message:"Options updated successfully"}));}catch{t.statusCode=400,t.end(JSON.stringify({error:"Invalid JSON format"}));}});}});}}}export{u as vitePluginPixivn};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drincs/pixi-vn",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "type": "module",
5
5
  "description": "Pixi'VN is a npm package that provides various features for creating visual novels.",
6
6
  "main": "./dist/index.cjs",
@@ -125,10 +125,10 @@
125
125
  "homepage": "https://pixi-vn.web.app/",
126
126
  "funding": "https://github.com/DRincs-Productions/pixi-vn?sponsor=1",
127
127
  "dependencies": {
128
- "@pixi/devtools": "^2.0.1",
129
- "@pixi/sound": "^6.0.1",
130
- "motion": "^12.23.26",
131
- "pixi.js": "^8.14.3"
128
+ "@pixi/devtools": "2.0.1",
129
+ "@pixi/sound": "6.0.1",
130
+ "motion": "12.24.7",
131
+ "pixi.js": "8.15.0"
132
132
  },
133
133
  "devDependencies": {
134
134
  "@types/crypto-js": "^4.2.2",