@rpgjs/client 5.0.0-alpha.4 → 5.0.0-alpha.6
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/components/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/index10.js +1 -1
- package/dist/index11.js +2 -2
- package/dist/index12.js +1 -1
- package/dist/index13.js +1 -1
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +80 -39
- package/dist/index14.js.map +1 -1
- package/dist/index15.js +45 -186
- package/dist/index15.js.map +1 -1
- package/dist/index16.js +187 -5
- package/dist/index16.js.map +1 -1
- package/dist/index17.js +5 -383
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +384 -28
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +24 -17
- package/dist/index19.js.map +1 -1
- package/dist/index2.js +6 -6
- package/dist/index20.js +16 -2413
- package/dist/index20.js.map +1 -1
- package/dist/index21.js +2395 -88
- package/dist/index21.js.map +1 -1
- package/dist/index22.js +108 -103
- package/dist/index22.js.map +1 -1
- package/dist/index23.js +95 -57
- package/dist/index23.js.map +1 -1
- package/dist/index24.js +62 -12
- package/dist/index24.js.map +1 -1
- package/dist/index25.js +17 -37
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +39 -3
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +1 -318
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +319 -22
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +22 -8
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +2 -2
- package/dist/index30.js +3 -3
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +8 -9
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +9 -4400
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +4394 -307
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +307 -165
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +162 -489
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +496 -86
- package/dist/index36.js.map +1 -1
- package/dist/index37.js.map +1 -1
- package/dist/index38.js.map +1 -1
- package/dist/index4.js +2 -2
- package/dist/index5.js +1 -1
- package/dist/index6.js +1 -1
- package/dist/index7.js +1 -1
- package/dist/index8.js +1 -1
- package/dist/index9.js +2 -2
- package/package.json +8 -6
- package/src/components/index.ts +2 -1
- package/src/components/scenes/draw-map.ce +0 -18
- package/src/components/scenes/event-layer.ce +1 -1
- package/vite.config.ts +1 -1
- package/src/components/scenes/element-map.ce +0 -23
package/dist/index.js
CHANGED
|
@@ -10,4 +10,5 @@ export { PrebuiltGui } from './index10.js';
|
|
|
10
10
|
export { PrebuiltEffects } from './index11.js';
|
|
11
11
|
export { Presets } from './index12.js';
|
|
12
12
|
export { default as EventLayerComponent } from './index13.js';
|
|
13
|
+
export { default as CharacterComponent } from './index14.js';
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
package/dist/index10.js
CHANGED
package/dist/index11.js
CHANGED
package/dist/index12.js
CHANGED
package/dist/index13.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useProps, useDefineProps, h, Container, loop } from 'canvasengine';
|
|
2
2
|
import { inject } from './index6.js';
|
|
3
3
|
import { RpgClientEngine } from './index2.js';
|
|
4
|
-
import component$1 from './
|
|
4
|
+
import component$1 from './index14.js';
|
|
5
5
|
|
|
6
6
|
function component($$props) {
|
|
7
7
|
useProps($$props);
|
package/dist/index13.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index13.js","sources":["../src/components/scenes/event-layer.ce"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index13.js","sources":["../src/components/scenes/event-layer.ce"],"sourcesContent":["\n import { Container } from 'canvasengine';\nimport { h, computed, cond, loop } from 'canvasengine';\nimport { inject } from \"../../core/inject\";\nimport { RpgClientEngine } from \"../../RpgClientEngine\";\nimport Character from \"../character.ce\";\n import { useProps, useDefineProps } from 'canvasengine'\n\n export default function component($$props) {\n const $props = useProps($$props)\n const defineProps = useDefineProps($$props)\n var engine = inject(RpgClientEngine);\nvar players = engine.sceneMap.players;\nvar events = engine.sceneMap.events\n let $this = h(Container, { sortableChildren: true }, [loop(events, (event, id) => h(Character, { id: id, object: event, isMe: false })), loop(players, (player, id) => h(Character, { id: id, object: player, isMe: true }))])\n return $this\n }\n "],"names":["Character"],"mappings":";;;;;AAQqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAA4B,cAAc,CAAC,OAAO;AAClD,QAAQ,IAAI,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC;AAC5C,IAAI,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO;AACrC,IAAI,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC7B,QAAQ,IAAI,KAAK,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,CAACA,WAAS,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,CAACA,WAAS,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACrO,QAAQ,OAAO;AACf;;;;"}
|
package/dist/index14.js
CHANGED
|
@@ -1,48 +1,89 @@
|
|
|
1
|
-
import { useProps, useDefineProps, computed,
|
|
2
|
-
import {
|
|
1
|
+
import { useProps, useDefineProps, computed, signal, h, Container, loop, Sprite } from 'canvasengine';
|
|
2
|
+
import { Particle } from '@canvasengine/presets';
|
|
3
3
|
import { RpgClientEngine } from './index2.js';
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import { inject } from './index6.js';
|
|
5
|
+
import { Direction } from '@rpgjs/common';
|
|
6
6
|
|
|
7
7
|
function component($$props) {
|
|
8
8
|
useProps($$props);
|
|
9
|
-
useDefineProps($$props);
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
9
|
+
const defineProps = useDefineProps($$props);
|
|
10
|
+
var _a = defineProps(), object = _a.object; _a.id; var isMe = _a.isMe;
|
|
11
|
+
var client = inject(RpgClientEngine);
|
|
12
|
+
var spritesheets = client.spritesheets;
|
|
13
|
+
var x = object.x;
|
|
14
|
+
var y = object.y;
|
|
15
|
+
var tint = object.tint;
|
|
16
|
+
var direction = object.direction;
|
|
17
|
+
var animationName = object.animationName;
|
|
18
|
+
var emitParticleTrigger = object.emitParticleTrigger;
|
|
19
|
+
var particleSettings = client.particleSettings;
|
|
20
|
+
var particleName = object.particleName;
|
|
21
|
+
var graphics = object.graphics;
|
|
22
|
+
var hitbox = object.hitbox;
|
|
23
|
+
var widthShadow = 10;
|
|
24
|
+
computed(function () { return ({
|
|
25
|
+
x: hitbox().w / 2,
|
|
26
|
+
y: hitbox().h - (hitbox().h / 2),
|
|
27
|
+
width: hitbox().w + widthShadow,
|
|
28
|
+
height: hitbox().h,
|
|
29
|
+
}); });
|
|
30
|
+
var canControls = function () { return isMe() && object.canMove(); };
|
|
31
|
+
var keyboardControls = client.globalConfig.keyboardControls;
|
|
32
|
+
var controls = signal({
|
|
33
|
+
down: {
|
|
34
|
+
repeat: true,
|
|
35
|
+
bind: keyboardControls.down,
|
|
36
|
+
keyDown: function () {
|
|
37
|
+
if (canControls())
|
|
38
|
+
client.processInput({ input: Direction.Down });
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
up: {
|
|
42
|
+
repeat: true,
|
|
43
|
+
bind: keyboardControls.up,
|
|
44
|
+
keyDown: function () {
|
|
45
|
+
if (canControls())
|
|
46
|
+
client.processInput({ input: Direction.Up });
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
left: {
|
|
50
|
+
repeat: true,
|
|
51
|
+
bind: keyboardControls.left,
|
|
52
|
+
keyDown: function () {
|
|
53
|
+
if (canControls())
|
|
54
|
+
client.processInput({ input: Direction.Left });
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
right: {
|
|
58
|
+
repeat: true,
|
|
59
|
+
bind: keyboardControls.right,
|
|
60
|
+
keyDown: function () {
|
|
61
|
+
if (canControls())
|
|
62
|
+
client.processInput({ input: Direction.Right });
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
action: {
|
|
66
|
+
bind: keyboardControls.action,
|
|
67
|
+
keyDown: function () {
|
|
68
|
+
if (canControls()) {
|
|
69
|
+
client.processAction({ action: 'action' });
|
|
70
|
+
// particleName.set('hit')
|
|
71
|
+
// emitParticleTrigger.start()
|
|
72
|
+
// object.flash('red')
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
},
|
|
31
76
|
});
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
77
|
+
var sheet = function (graphicId) {
|
|
78
|
+
return {
|
|
79
|
+
definition: spritesheets.get(graphicId),
|
|
80
|
+
playing: animationName,
|
|
81
|
+
params: {
|
|
82
|
+
direction: direction
|
|
83
|
+
},
|
|
84
|
+
};
|
|
40
85
|
};
|
|
41
|
-
let $this = h(
|
|
42
|
-
onGuiFinish(gui, data);
|
|
43
|
-
}, onInteraction: (name, data) => {
|
|
44
|
-
onGuiInteraction(gui, name, data);
|
|
45
|
-
} }))))]);
|
|
86
|
+
let $this = h(Container, { x, y, zIndex: y, viewportFollow: isMe, controls }, [h(Particle, { emit: emitParticleTrigger, settings: particleSettings, zIndex: 1000, name: particleName }), loop(graphics, graphicId => h(Sprite, { sheet: sheet(graphicId), direction, tint }))]);
|
|
46
87
|
return $this
|
|
47
88
|
}
|
|
48
89
|
|
package/dist/index14.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index14.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index14.js","sources":["../src/components/character.ce"],"sourcesContent":["\n import { Container } from 'canvasengine';\nimport { Sprite } from 'canvasengine';\nimport { h, cond, loop } from 'canvasengine';\nimport { signal, computed } from \"canvasengine\";\nimport { Particle } from \"@canvasengine/presets\";\nimport { RpgClientEngine } from \"../RpgClientEngine\";\nimport { inject } from \"../core/inject\";\nimport { Direction } from \"@rpgjs/common\";\n import { useProps, useDefineProps } from 'canvasengine'\n\n export default function component($$props) {\n const $props = useProps($$props)\n const defineProps = useDefineProps($$props)\n var _a = defineProps(), object = _a.object, id = _a.id, isMe = _a.isMe;\nvar client = inject(RpgClientEngine);\nvar spritesheets = client.spritesheets;\nvar x = object.x;\nvar y = object.y;\nvar tint = object.tint;\nvar direction = object.direction;\nvar animationName = object.animationName;\nvar emitParticleTrigger = object.emitParticleTrigger;\nvar particleSettings = client.particleSettings;\nvar particleName = object.particleName;\nvar graphics = object.graphics;\nvar hitbox = object.hitbox;\nvar widthShadow = 10;\nvar shadow = computed(function () { return ({\n x: hitbox().w / 2,\n y: hitbox().h - (hitbox().h / 2),\n width: hitbox().w + widthShadow,\n height: hitbox().h,\n}); });\nvar canControls = function () { return isMe() && object.canMove(); };\nvar keyboardControls = client.globalConfig.keyboardControls;\nvar controls = signal({\n down: {\n repeat: true,\n bind: keyboardControls.down,\n keyDown: function () {\n if (canControls())\n client.processInput({ input: Direction.Down });\n },\n },\n up: {\n repeat: true,\n bind: keyboardControls.up,\n keyDown: function () {\n if (canControls())\n client.processInput({ input: Direction.Up });\n },\n },\n left: {\n repeat: true,\n bind: keyboardControls.left,\n keyDown: function () {\n if (canControls())\n client.processInput({ input: Direction.Left });\n },\n },\n right: {\n repeat: true,\n bind: keyboardControls.right,\n keyDown: function () {\n if (canControls())\n client.processInput({ input: Direction.Right });\n },\n },\n action: {\n bind: keyboardControls.action,\n keyDown: function () {\n if (canControls()) {\n client.processAction({ action: 'action' });\n // particleName.set('hit') \n // emitParticleTrigger.start()\n // object.flash('red')\n }\n },\n },\n});\nvar sheet = function (graphicId) {\n return {\n definition: spritesheets.get(graphicId),\n playing: animationName,\n params: {\n direction: direction\n },\n };\n}\n let $this = h(Container, { x, y, zIndex: y, viewportFollow: isMe, controls }, [h(Particle, { emit: emitParticleTrigger, settings: particleSettings, zIndex: 1000, name: particleName }), loop(graphics, graphicId => h(Sprite, { sheet: sheet(graphicId), direction, tint }))])\n return $this\n }\n "],"names":[],"mappings":";;;;;;AAWqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAAQ,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO;AAClD,QAAW,IAAC,EAAE,GAAG,WAAW,EAAE,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC,CAAM,EAAE,CAAC,EAAE,CAAC,KAAC,IAAI,GAAG,EAAE,CAAC;AAC1E,IAAI,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC;AACpC,IAAI,YAAY,GAAG,MAAM,CAAC,YAAY;AACtC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;AAChB,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;AAChB,IAAI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vB,SAAS;AACT,KAAK;AACL;AACA,QAAQ,IAAI,KAAK,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,SAAS,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACtR,QAAQ,OAAO;AACf;;;;"}
|
package/dist/index15.js
CHANGED
|
@@ -1,191 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { useProps, useDefineProps, computed, effect, h, Canvas, loop, Viewport, cond, Container } from 'canvasengine';
|
|
2
|
+
import { inject } from './index6.js';
|
|
3
|
+
import { RpgClientEngine } from './index2.js';
|
|
4
|
+
import component$1 from './index29.js';
|
|
5
|
+
import { RpgGui } from './index9.js';
|
|
3
6
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
__name(isInjected, "isInjected");
|
|
14
|
-
function isProvided(context, name) {
|
|
15
|
-
return context.get("inject:" + name) !== void 0;
|
|
16
|
-
}
|
|
17
|
-
__name(isProvided, "isProvided");
|
|
18
|
-
function inject(context, service, args = []) {
|
|
19
|
-
const isClass = typeof service === "function";
|
|
20
|
-
const name = isClass ? service.name : service;
|
|
21
|
-
const value = context.get("inject:" + name);
|
|
22
|
-
if (value) {
|
|
23
|
-
context.set("injected:" + name, true);
|
|
24
|
-
return value;
|
|
25
|
-
}
|
|
26
|
-
throw new Error(`Injection provider ${name} not found`);
|
|
27
|
-
}
|
|
28
|
-
__name(inject, "inject");
|
|
29
|
-
function override(providers, newProvider, options) {
|
|
30
|
-
let { upsert = false, key } = options ?? {};
|
|
31
|
-
if (!key) {
|
|
32
|
-
key = typeof newProvider === "function" ? newProvider.name : newProvider.provide;
|
|
33
|
-
}
|
|
34
|
-
const flatProviders = providers.flat();
|
|
35
|
-
const exists = flatProviders.some((provider) => {
|
|
36
|
-
if (typeof provider === "function") {
|
|
37
|
-
return provider.name === key;
|
|
38
|
-
} else if (typeof provider === "object") {
|
|
39
|
-
return provider.provide === key;
|
|
40
|
-
}
|
|
41
|
-
return false;
|
|
42
|
-
});
|
|
43
|
-
const mappedProviders = flatProviders.map((provider) => {
|
|
44
|
-
if (typeof provider === "function" && provider.name === key) {
|
|
45
|
-
return newProvider;
|
|
46
|
-
} else if (typeof provider === "object" && provider.provide === key) {
|
|
47
|
-
return newProvider;
|
|
48
|
-
}
|
|
49
|
-
return provider;
|
|
50
|
-
});
|
|
51
|
-
if (upsert && !exists) {
|
|
52
|
-
mappedProviders.push(newProvider);
|
|
53
|
-
}
|
|
54
|
-
return mappedProviders;
|
|
55
|
-
}
|
|
56
|
-
__name(override, "override");
|
|
57
|
-
function findProviders(providers, name) {
|
|
58
|
-
const results = [];
|
|
59
|
-
for (const provider of providers) {
|
|
60
|
-
if (Array.isArray(provider)) {
|
|
61
|
-
results.push(...findProviders(provider, name));
|
|
62
|
-
} else if (findProvider(provider, name)) {
|
|
63
|
-
results.push(provider);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return results;
|
|
67
|
-
}
|
|
68
|
-
__name(findProviders, "findProviders");
|
|
69
|
-
function findProvider(providers, name) {
|
|
70
|
-
if (!Array.isArray(providers)) {
|
|
71
|
-
if (typeof providers === "object" && "provide" in providers) {
|
|
72
|
-
const provider = providers;
|
|
73
|
-
const providerName = typeof provider.provide === "function" ? provider.provide.name : provider.provide;
|
|
74
|
-
if (name instanceof RegExp) {
|
|
75
|
-
if (name.test(providerName)) return providers;
|
|
76
|
-
} else {
|
|
77
|
-
if (providerName === name) return providers;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
for (const provider of providers) {
|
|
83
|
-
if (Array.isArray(provider)) {
|
|
84
|
-
const found = findProvider(provider, name);
|
|
85
|
-
if (found) return found;
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
88
|
-
if (typeof provider === "object" && "provide" in provider) {
|
|
89
|
-
const providerName = typeof provider.provide === "function" ? provider.provide.name : provider.provide;
|
|
90
|
-
if (name instanceof RegExp) {
|
|
91
|
-
if (name.test(providerName)) return provider;
|
|
92
|
-
} else {
|
|
93
|
-
if (providerName === name) return provider;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
__name(findProvider, "findProvider");
|
|
100
|
-
|
|
101
|
-
// src/merge-config.ts
|
|
102
|
-
function processProvider(mergedConfig, baseConfig, provider) {
|
|
103
|
-
if (Array.isArray(provider)) {
|
|
104
|
-
for (const nestedProvider of provider) {
|
|
105
|
-
processProvider(mergedConfig, baseConfig, nestedProvider);
|
|
106
|
-
}
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
const existingProvider = findProvider(baseConfig.providers, provider.provide);
|
|
110
|
-
if (existingProvider) {
|
|
111
|
-
mergedConfig.providers = override(mergedConfig.providers, provider);
|
|
112
|
-
} else {
|
|
113
|
-
mergedConfig.providers.push(provider);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
__name(processProvider, "processProvider");
|
|
117
|
-
function mergeConfig(baseConfig, config) {
|
|
118
|
-
const mergedConfig = {
|
|
119
|
-
...baseConfig,
|
|
120
|
-
...config,
|
|
121
|
-
providers: [
|
|
122
|
-
...baseConfig.providers
|
|
123
|
-
]
|
|
124
|
-
// Start with a copy of base providers
|
|
125
|
-
};
|
|
126
|
-
for (const provider of config.providers) {
|
|
127
|
-
processProvider(mergedConfig, baseConfig, provider);
|
|
128
|
-
}
|
|
129
|
-
return mergedConfig;
|
|
130
|
-
}
|
|
131
|
-
__name(mergeConfig, "mergeConfig");
|
|
132
|
-
|
|
133
|
-
// src/provider.ts
|
|
134
|
-
async function injector(context, providers) {
|
|
135
|
-
providers = providers.flat();
|
|
136
|
-
for (const provider of providers) {
|
|
137
|
-
let token;
|
|
138
|
-
let instance;
|
|
139
|
-
if (typeof provider === "function") {
|
|
140
|
-
token = provider;
|
|
141
|
-
instance = new provider(context);
|
|
142
|
-
} else {
|
|
143
|
-
token = provider.provide;
|
|
144
|
-
const provideUserClass = provider.useClass;
|
|
145
|
-
const isClass = typeof provideUserClass === "function";
|
|
146
|
-
if (isClass) {
|
|
147
|
-
instance = new provideUserClass(context);
|
|
148
|
-
} else if ("useValue" in provider) {
|
|
149
|
-
instance = provider.useValue;
|
|
150
|
-
} else if ("useFactory" in provider) {
|
|
151
|
-
instance = provider.useFactory?.(context);
|
|
152
|
-
if (instance instanceof Promise) {
|
|
153
|
-
instance = await instance;
|
|
7
|
+
function component($$props) {
|
|
8
|
+
useProps($$props);
|
|
9
|
+
useDefineProps($$props);
|
|
10
|
+
var __assign = (this && this.__assign) || function () {
|
|
11
|
+
__assign = Object.assign || function(t) {
|
|
12
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
13
|
+
s = arguments[i];
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
15
|
+
t[p] = s[p];
|
|
154
16
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
const name = typeof token === "function" ? token.name : token;
|
|
160
|
-
provide(context, name, instance);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
__name(injector, "injector");
|
|
164
|
-
|
|
165
|
-
// src/context.ts
|
|
166
|
-
var Context = class {
|
|
167
|
-
static {
|
|
168
|
-
__name(this, "Context");
|
|
169
|
-
}
|
|
170
|
-
/** Internal storage for injected values */
|
|
171
|
-
values = {};
|
|
172
|
-
/**
|
|
173
|
-
* Sets a value in the context
|
|
174
|
-
* @param key - Unique identifier for the value
|
|
175
|
-
* @param value - Value to store
|
|
176
|
-
*/
|
|
177
|
-
set(key, value) {
|
|
178
|
-
this.values[key] = value;
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Retrieves a value from the context
|
|
182
|
-
* @param key - Unique identifier for the value
|
|
183
|
-
* @returns The stored value or undefined if not found
|
|
184
|
-
*/
|
|
185
|
-
get(key) {
|
|
186
|
-
return this.values[key];
|
|
187
|
-
}
|
|
17
|
+
return t;
|
|
18
|
+
};
|
|
19
|
+
return __assign.apply(this, arguments);
|
|
188
20
|
};
|
|
21
|
+
var engine = inject(RpgClientEngine);
|
|
22
|
+
var guiService = inject(RpgGui);
|
|
23
|
+
var sceneData = engine.sceneMap.data;
|
|
24
|
+
var gui = guiService.gui;
|
|
25
|
+
var worldWidth = computed(function () { var _a; return (_a = sceneData()) === null || _a === void 0 ? void 0 : _a.width; });
|
|
26
|
+
var worldHeight = computed(function () { var _a; return (_a = sceneData()) === null || _a === void 0 ? void 0 : _a.height; });
|
|
27
|
+
effect(function () {
|
|
28
|
+
if (sceneData() && !sceneData().component) {
|
|
29
|
+
throw new Error("Warning ! You need to define a component for the scene. Use provideLoadMap() to define a component for the scene.");
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
var onGuiFinish = function (gui, data) {
|
|
33
|
+
guiService.guiClose(gui.name, data);
|
|
34
|
+
};
|
|
35
|
+
var onGuiInteraction = function (gui, name, data) {
|
|
36
|
+
guiService.guiInteraction(gui.name, name, data);
|
|
37
|
+
};
|
|
38
|
+
var clamp = {
|
|
39
|
+
direction: "all"
|
|
40
|
+
};
|
|
41
|
+
let $this = h(Canvas, { width: computed(() => engine.width()), height: computed(() => engine.height()) }, [h(Viewport, { worldWidth, worldHeight, clamp }, cond(sceneData, () => h(component$1))), loop(gui, gui => h(Container, { display: 'flex' }, cond(gui.display, () => h(gui.component, { ...gui.data(), onFinish: (data) => {
|
|
42
|
+
onGuiFinish(gui, data);
|
|
43
|
+
}, onInteraction: (name, data) => {
|
|
44
|
+
onGuiInteraction(gui, name, data);
|
|
45
|
+
} }))))]);
|
|
46
|
+
return $this
|
|
47
|
+
}
|
|
189
48
|
|
|
190
|
-
export {
|
|
49
|
+
export { component as default };
|
|
191
50
|
//# sourceMappingURL=index15.js.map
|
package/dist/index15.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index15.js","sources":["../../../node_modules/.pnpm/@signe+di@2.3.3/node_modules/@signe/di/dist/index.js"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/inject.ts\nfunction provide(context, name, value) {\n context.set(\"inject:\" + name, value);\n return value;\n}\n__name(provide, \"provide\");\nfunction isInjected(context, name) {\n return context.get(\"injected:\" + name) === true;\n}\n__name(isInjected, \"isInjected\");\nfunction isProvided(context, name) {\n return context.get(\"inject:\" + name) !== void 0;\n}\n__name(isProvided, \"isProvided\");\nfunction inject(context, service, args = []) {\n const isClass = typeof service === \"function\";\n const name = isClass ? service.name : service;\n const value = context.get(\"inject:\" + name);\n if (value) {\n context.set(\"injected:\" + name, true);\n return value;\n }\n throw new Error(`Injection provider ${name} not found`);\n}\n__name(inject, \"inject\");\nfunction override(providers, newProvider, options) {\n let { upsert = false, key } = options ?? {};\n if (!key) {\n key = typeof newProvider === \"function\" ? newProvider.name : newProvider.provide;\n }\n const flatProviders = providers.flat();\n const exists = flatProviders.some((provider) => {\n if (typeof provider === \"function\") {\n return provider.name === key;\n } else if (typeof provider === \"object\") {\n return provider.provide === key;\n }\n return false;\n });\n const mappedProviders = flatProviders.map((provider) => {\n if (typeof provider === \"function\" && provider.name === key) {\n return newProvider;\n } else if (typeof provider === \"object\" && provider.provide === key) {\n return newProvider;\n }\n return provider;\n });\n if (upsert && !exists) {\n mappedProviders.push(newProvider);\n }\n return mappedProviders;\n}\n__name(override, \"override\");\nfunction findProviders(providers, name) {\n const results = [];\n for (const provider of providers) {\n if (Array.isArray(provider)) {\n results.push(...findProviders(provider, name));\n } else if (findProvider(provider, name)) {\n results.push(provider);\n }\n }\n return results;\n}\n__name(findProviders, \"findProviders\");\nfunction findProvider(providers, name) {\n if (!Array.isArray(providers)) {\n if (typeof providers === \"object\" && \"provide\" in providers) {\n const provider = providers;\n const providerName = typeof provider.provide === \"function\" ? provider.provide.name : provider.provide;\n if (name instanceof RegExp) {\n if (name.test(providerName)) return providers;\n } else {\n if (providerName === name) return providers;\n }\n }\n return null;\n }\n for (const provider of providers) {\n if (Array.isArray(provider)) {\n const found = findProvider(provider, name);\n if (found) return found;\n continue;\n }\n if (typeof provider === \"object\" && \"provide\" in provider) {\n const providerName = typeof provider.provide === \"function\" ? provider.provide.name : provider.provide;\n if (name instanceof RegExp) {\n if (name.test(providerName)) return provider;\n } else {\n if (providerName === name) return provider;\n }\n }\n }\n return null;\n}\n__name(findProvider, \"findProvider\");\n\n// src/merge-config.ts\nfunction processProvider(mergedConfig, baseConfig, provider) {\n if (Array.isArray(provider)) {\n for (const nestedProvider of provider) {\n processProvider(mergedConfig, baseConfig, nestedProvider);\n }\n return;\n }\n const existingProvider = findProvider(baseConfig.providers, provider.provide);\n if (existingProvider) {\n mergedConfig.providers = override(mergedConfig.providers, provider);\n } else {\n mergedConfig.providers.push(provider);\n }\n}\n__name(processProvider, \"processProvider\");\nfunction mergeConfig(baseConfig, config) {\n const mergedConfig = {\n ...baseConfig,\n ...config,\n providers: [\n ...baseConfig.providers\n ]\n // Start with a copy of base providers\n };\n for (const provider of config.providers) {\n processProvider(mergedConfig, baseConfig, provider);\n }\n return mergedConfig;\n}\n__name(mergeConfig, \"mergeConfig\");\n\n// src/provider.ts\nasync function injector(context, providers) {\n providers = providers.flat();\n for (const provider of providers) {\n let token;\n let instance;\n if (typeof provider === \"function\") {\n token = provider;\n instance = new provider(context);\n } else {\n token = provider.provide;\n const provideUserClass = provider.useClass;\n const isClass = typeof provideUserClass === \"function\";\n if (isClass) {\n instance = new provideUserClass(context);\n } else if (\"useValue\" in provider) {\n instance = provider.useValue;\n } else if (\"useFactory\" in provider) {\n instance = provider.useFactory?.(context);\n if (instance instanceof Promise) {\n instance = await instance;\n }\n } else if (\"useExisting\" in provider) {\n instance = inject(context, provider.useExisting);\n }\n }\n const name = typeof token === \"function\" ? token.name : token;\n provide(context, name, instance);\n }\n}\n__name(injector, \"injector\");\n\n// src/context.ts\nvar Context = class {\n static {\n __name(this, \"Context\");\n }\n /** Internal storage for injected values */\n values = {};\n /**\n * Sets a value in the context\n * @param key - Unique identifier for the value\n * @param value - Value to store\n */\n set(key, value) {\n this.values[key] = value;\n }\n /**\n * Retrieves a value from the context\n * @param key - Unique identifier for the value\n * @returns The stored value or undefined if not found\n */\n get(key) {\n return this.values[key];\n }\n};\nexport {\n Context,\n findProvider,\n findProviders,\n inject,\n injector,\n isInjected,\n isProvided,\n mergeConfig,\n override,\n provide\n};\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":"AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc;AACrC,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,KAAK,KAAK,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;;AAExF;AACA,SAAS,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE;AACvC,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,GAAG,IAAI,EAAE,KAAK,CAAC;AACtC,EAAE,OAAO,KAAK;AACd;AACA,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC;AAC1B,SAAS,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE;AACnC,EAAE,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,KA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AACA,EAAE,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE;AAClB,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,GAAG,CAAC,GAAG,EAAE;AACX,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;AAC3B;AACA;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index15.js","sources":["../src/components/scenes/canvas.ce"],"sourcesContent":["\n import { Container } from 'canvasengine';\nimport { Viewport } from 'canvasengine';\nimport { Canvas } from 'canvasengine';\nimport { h, cond, loop } from 'canvasengine';\nimport { computed, effect } from \"canvasengine\";\nimport { inject } from \"../../core/inject\";\nimport { RpgClientEngine } from \"../../RpgClientEngine\";\nimport SceneMap from './draw-map.ce';\nimport { RpgGui } from \"../../Gui/Gui\";\n import { useProps, useDefineProps } from 'canvasengine'\n\n export default function component($$props) {\n const $props = useProps($$props)\n const defineProps = useDefineProps($$props)\n var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar engine = inject(RpgClientEngine);\nvar guiService = inject(RpgGui);\nvar sceneData = engine.sceneMap.data;\nvar gui = guiService.gui;\nvar worldWidth = computed(function () { var _a; return (_a = sceneData()) === null || _a === void 0 ? void 0 : _a.width; });\nvar worldHeight = computed(function () { var _a; return (_a = sceneData()) === null || _a === void 0 ? void 0 : _a.height; });\neffect(function () {\n if (sceneData() && !sceneData().component) {\n throw new Error(\"Warning ! You need to define a component for the scene. Use provideLoadMap() to define a component for the scene.\");\n }\n});\nvar onGuiFinish = function (gui, data) {\n guiService.guiClose(gui.name, data);\n};\nvar onGuiInteraction = function (gui, name, data) {\n guiService.guiInteraction(gui.name, name, data);\n};\nvar clamp = {\n direction: \"all\"\n}\n let $this = h(Canvas, { width: computed(() => engine.width()), height: computed(() => engine.height()) }, [h(Viewport, { worldWidth, worldHeight, clamp }, cond(sceneData, () => h(SceneMap))), loop(gui, gui => h(Container, { display: 'flex' }, cond(gui.display, () => h(gui.component, { ...gui.data(), onFinish: (data) => {\n onGuiFinish(gui, data)\n }, onInteraction: (name, data) => {\n onGuiInteraction(gui, name, data)\n } }))))])\n return $this\n }\n "],"names":["SceneMap"],"mappings":";;;;;;AAYqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAA4B,cAAc,CAAC,OAAO;AAClD,QAAQ,IAAI,QAAQ,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,YAAY;AAC9D,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,SAAS,CAAC,EAAE;AAC5C,QAAQ,KAAK,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;AAC7D,YAAY,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;AAC5B,YAAY,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;AAC3E,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC3B;AACA,QAAQ,OAAO,CAAC;AAChB,KAAK;AACL,IAAI,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC;AAC1C,CAAC;AACD,IAAI,MAAM,GAAG,MAAM,CAAC,eAAe,CAAC;AACpC,IAAI,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;AAC/B,IAAI,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI;AACpC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