@rpgjs/client 5.0.0-alpha.3 → 5.0.0-alpha.30

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.
Files changed (275) hide show
  1. package/dist/Game/AnimationManager.d.ts +8 -0
  2. package/dist/{index19.js → Game/AnimationManager.js} +4 -3
  3. package/dist/Game/AnimationManager.js.map +1 -0
  4. package/dist/{index30.js → Game/Event.js} +2 -2
  5. package/dist/Game/Event.js.map +1 -0
  6. package/dist/Game/Map.d.ts +8 -1
  7. package/dist/Game/Map.js +54 -0
  8. package/dist/Game/Map.js.map +1 -0
  9. package/dist/Game/Object.d.ts +129 -0
  10. package/dist/Game/Object.js +218 -0
  11. package/dist/Game/Object.js.map +1 -0
  12. package/dist/{index29.js → Game/Player.js} +2 -2
  13. package/dist/Game/Player.js.map +1 -0
  14. package/dist/Gui/Gui.d.ts +177 -5
  15. package/dist/Gui/Gui.js +478 -0
  16. package/dist/Gui/Gui.js.map +1 -0
  17. package/dist/Gui/NotificationManager.d.ts +23 -0
  18. package/dist/Gui/NotificationManager.js +51 -0
  19. package/dist/Gui/NotificationManager.js.map +1 -0
  20. package/dist/Resource.d.ts +97 -0
  21. package/dist/Resource.js +114 -0
  22. package/dist/Resource.js.map +1 -0
  23. package/dist/RpgClient.d.ts +259 -59
  24. package/dist/RpgClientEngine.d.ts +632 -9
  25. package/dist/RpgClientEngine.js +1262 -0
  26. package/dist/RpgClientEngine.js.map +1 -0
  27. package/dist/Sound.d.ts +199 -0
  28. package/dist/Sound.js +97 -0
  29. package/dist/Sound.js.map +1 -0
  30. package/dist/components/animations/animation.ce.js +21 -0
  31. package/dist/components/animations/animation.ce.js.map +1 -0
  32. package/dist/{index23.js → components/animations/hit.ce.js} +3 -3
  33. package/dist/components/animations/hit.ce.js.map +1 -0
  34. package/dist/components/animations/index.d.ts +4 -0
  35. package/dist/components/animations/index.js +10 -0
  36. package/dist/components/animations/index.js.map +1 -0
  37. package/dist/components/character.ce.js +316 -0
  38. package/dist/components/character.ce.js.map +1 -0
  39. package/dist/components/dynamics/parse-value.d.ts +1 -0
  40. package/dist/components/dynamics/parse-value.js +54 -0
  41. package/dist/components/dynamics/parse-value.js.map +1 -0
  42. package/dist/components/dynamics/text.ce.js +141 -0
  43. package/dist/components/dynamics/text.ce.js.map +1 -0
  44. package/dist/components/gui/box.ce.js +27 -0
  45. package/dist/components/gui/box.ce.js.map +1 -0
  46. package/dist/components/gui/dialogbox/index.ce.js +152 -0
  47. package/dist/components/gui/dialogbox/index.ce.js.map +1 -0
  48. package/dist/components/gui/gameover.ce.js +141 -0
  49. package/dist/components/gui/gameover.ce.js.map +1 -0
  50. package/dist/components/gui/hud/hud.ce.js +35 -0
  51. package/dist/components/gui/hud/hud.ce.js.map +1 -0
  52. package/dist/components/gui/index.d.ts +15 -3
  53. package/dist/components/gui/menu/equip-menu.ce.js +349 -0
  54. package/dist/components/gui/menu/equip-menu.ce.js.map +1 -0
  55. package/dist/components/gui/menu/exit-menu.ce.js +35 -0
  56. package/dist/components/gui/menu/exit-menu.ce.js.map +1 -0
  57. package/dist/components/gui/menu/items-menu.ce.js +229 -0
  58. package/dist/components/gui/menu/items-menu.ce.js.map +1 -0
  59. package/dist/components/gui/menu/main-menu.ce.js +205 -0
  60. package/dist/components/gui/menu/main-menu.ce.js.map +1 -0
  61. package/dist/components/gui/menu/options-menu.ce.js +28 -0
  62. package/dist/components/gui/menu/options-menu.ce.js.map +1 -0
  63. package/dist/components/gui/menu/skills-menu.ce.js +53 -0
  64. package/dist/components/gui/menu/skills-menu.ce.js.map +1 -0
  65. package/dist/components/gui/mobile/index.d.ts +8 -0
  66. package/dist/components/gui/mobile/index.js +24 -0
  67. package/dist/components/gui/mobile/index.js.map +1 -0
  68. package/dist/components/gui/mobile/mobile.ce.js +17 -0
  69. package/dist/components/gui/mobile/mobile.ce.js.map +1 -0
  70. package/dist/components/gui/notification/notification.ce.js +38 -0
  71. package/dist/components/gui/notification/notification.ce.js.map +1 -0
  72. package/dist/components/gui/save-load.ce.js +242 -0
  73. package/dist/components/gui/save-load.ce.js.map +1 -0
  74. package/dist/components/gui/shop/shop.ce.js +322 -0
  75. package/dist/components/gui/shop/shop.ce.js.map +1 -0
  76. package/dist/components/gui/title-screen.ce.js +148 -0
  77. package/dist/components/gui/title-screen.ce.js.map +1 -0
  78. package/dist/components/index.d.ts +3 -1
  79. package/dist/components/prebuilt/hp-bar.ce.js +106 -0
  80. package/dist/components/prebuilt/hp-bar.ce.js.map +1 -0
  81. package/dist/components/prebuilt/index.d.ts +19 -0
  82. package/dist/components/prebuilt/light-halo.ce.js +76 -0
  83. package/dist/components/prebuilt/light-halo.ce.js.map +1 -0
  84. package/dist/components/scenes/canvas.ce.js +44 -0
  85. package/dist/components/scenes/canvas.ce.js.map +1 -0
  86. package/dist/components/scenes/draw-map.ce.js +34 -0
  87. package/dist/components/scenes/draw-map.ce.js.map +1 -0
  88. package/dist/{index13.js → components/scenes/event-layer.ce.js} +7 -6
  89. package/dist/components/scenes/event-layer.ce.js.map +1 -0
  90. package/dist/{index6.js → core/inject.js} +2 -2
  91. package/dist/core/inject.js.map +1 -0
  92. package/dist/core/setup.js +16 -0
  93. package/dist/core/setup.js.map +1 -0
  94. package/dist/index.d.ts +15 -1
  95. package/dist/index.js +40 -12
  96. package/dist/index.js.map +1 -1
  97. package/dist/module.d.ts +43 -4
  98. package/dist/module.js +175 -0
  99. package/dist/module.js.map +1 -0
  100. package/dist/node_modules/.pnpm/@signe_di@2.8.2/node_modules/@signe/di/dist/index.js +366 -0
  101. package/dist/node_modules/.pnpm/@signe_di@2.8.2/node_modules/@signe/di/dist/index.js.map +1 -0
  102. package/dist/{index27.js → node_modules/.pnpm/@signe_reactive@2.8.2/node_modules/@signe/reactive/dist/index.js} +229 -11
  103. package/dist/node_modules/.pnpm/@signe_reactive@2.8.2/node_modules/@signe/reactive/dist/index.js.map +1 -0
  104. package/dist/{index20.js → node_modules/.pnpm/@signe_room@2.8.2/node_modules/@signe/room/dist/index.js} +308 -40
  105. package/dist/node_modules/.pnpm/@signe_room@2.8.2/node_modules/@signe/room/dist/index.js.map +1 -0
  106. package/dist/{index26.js → node_modules/.pnpm/@signe_sync@2.8.2/node_modules/@signe/sync/dist/chunk-7QVYU63E.js} +1 -1
  107. package/dist/node_modules/.pnpm/@signe_sync@2.8.2/node_modules/@signe/sync/dist/chunk-7QVYU63E.js.map +1 -0
  108. package/dist/{index21.js → node_modules/.pnpm/@signe_sync@2.8.2/node_modules/@signe/sync/dist/client/index.js} +5 -5
  109. package/dist/node_modules/.pnpm/@signe_sync@2.8.2/node_modules/@signe/sync/dist/client/index.js.map +1 -0
  110. package/dist/{index17.js → node_modules/.pnpm/@signe_sync@2.8.2/node_modules/@signe/sync/dist/index.js} +89 -12
  111. package/dist/node_modules/.pnpm/@signe_sync@2.8.2/node_modules/@signe/sync/dist/index.js.map +1 -0
  112. package/dist/{index33.js → node_modules/.pnpm/dset@3.1.4/node_modules/dset/dist/index.js} +1 -1
  113. package/dist/node_modules/.pnpm/dset@3.1.4/node_modules/dset/dist/index.js.map +1 -0
  114. package/dist/{index31.js → node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-HAC622V3.js} +2 -2
  115. package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-HAC622V3.js.map +1 -0
  116. package/dist/{index32.js → node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-S74YV6PU.js} +1 -1
  117. package/dist/node_modules/.pnpm/partysocket@1.1.3/node_modules/partysocket/dist/chunk-S74YV6PU.js.map +1 -0
  118. package/dist/{index34.js → node_modules/.pnpm/zod@3.24.2/node_modules/zod/lib/index.js} +1 -1
  119. package/dist/node_modules/.pnpm/zod@3.24.2/node_modules/zod/lib/index.js.map +1 -0
  120. package/dist/presets/animation.d.ts +31 -0
  121. package/dist/presets/animation.js +27 -0
  122. package/dist/presets/animation.js.map +1 -0
  123. package/dist/presets/faceset.d.ts +30 -0
  124. package/dist/presets/faceset.js +24 -0
  125. package/dist/presets/faceset.js.map +1 -0
  126. package/dist/presets/icon.d.ts +20 -0
  127. package/dist/presets/icon.js +15 -0
  128. package/dist/presets/icon.js.map +1 -0
  129. package/dist/presets/index.d.ts +123 -0
  130. package/dist/presets/index.js +16 -0
  131. package/dist/presets/index.js.map +1 -0
  132. package/dist/presets/lpc.d.ts +89 -0
  133. package/dist/presets/lpc.js +95 -0
  134. package/dist/presets/lpc.js.map +1 -0
  135. package/dist/{index25.js → presets/rmspritesheet.js} +1 -1
  136. package/dist/presets/rmspritesheet.js.map +1 -0
  137. package/dist/{index16.js → services/AbstractSocket.js} +1 -1
  138. package/dist/services/AbstractSocket.js.map +1 -0
  139. package/dist/services/keyboardControls.d.ts +15 -0
  140. package/dist/services/keyboardControls.js +21 -0
  141. package/dist/services/keyboardControls.js.map +1 -0
  142. package/dist/services/loadMap.d.ts +123 -2
  143. package/dist/{index7.js → services/loadMap.js} +12 -4
  144. package/dist/services/loadMap.js.map +1 -0
  145. package/dist/services/mmorpg.d.ts +16 -4
  146. package/dist/services/mmorpg.js +84 -0
  147. package/dist/services/mmorpg.js.map +1 -0
  148. package/dist/services/save.d.ts +19 -0
  149. package/dist/services/save.js +69 -0
  150. package/dist/services/save.js.map +1 -0
  151. package/dist/services/standalone.d.ts +65 -3
  152. package/dist/services/standalone.js +170 -0
  153. package/dist/services/standalone.js.map +1 -0
  154. package/dist/utils/getEntityProp.d.ts +39 -0
  155. package/dist/utils/getEntityProp.js +54 -0
  156. package/dist/utils/getEntityProp.js.map +1 -0
  157. package/package.json +24 -18
  158. package/src/Game/{EffectManager.ts → AnimationManager.ts} +3 -2
  159. package/src/Game/Map.ts +37 -2
  160. package/src/Game/Object.ts +296 -11
  161. package/src/Gui/Gui.ts +506 -18
  162. package/src/Gui/NotificationManager.ts +69 -0
  163. package/src/Resource.ts +150 -0
  164. package/src/RpgClient.ts +264 -58
  165. package/src/RpgClientEngine.ts +1421 -44
  166. package/src/Sound.ts +253 -0
  167. package/src/components/{effects → animations}/animation.ce +3 -6
  168. package/src/components/{effects → animations}/index.ts +1 -1
  169. package/src/components/character.ce +406 -40
  170. package/src/components/dynamics/parse-value.ts +80 -0
  171. package/src/components/dynamics/text.ce +183 -0
  172. package/src/components/gui/box.ce +17 -0
  173. package/src/components/gui/dialogbox/index.ce +204 -187
  174. package/src/components/gui/gameover.ce +158 -0
  175. package/src/components/gui/hud/hud.ce +56 -0
  176. package/src/components/gui/index.ts +30 -4
  177. package/src/components/gui/menu/equip-menu.ce +410 -0
  178. package/src/components/gui/menu/exit-menu.ce +41 -0
  179. package/src/components/gui/menu/items-menu.ce +317 -0
  180. package/src/components/gui/menu/main-menu.ce +291 -0
  181. package/src/components/gui/menu/options-menu.ce +35 -0
  182. package/src/components/gui/menu/skills-menu.ce +83 -0
  183. package/src/components/gui/mobile/index.ts +24 -0
  184. package/src/components/gui/mobile/mobile.ce +80 -0
  185. package/src/components/gui/notification/notification.ce +51 -0
  186. package/src/components/gui/save-load.ce +208 -0
  187. package/src/components/gui/shop/shop.ce +493 -0
  188. package/src/components/gui/title-screen.ce +163 -0
  189. package/src/components/index.ts +5 -1
  190. package/src/components/prebuilt/hp-bar.ce +255 -0
  191. package/src/components/prebuilt/index.ts +24 -0
  192. package/src/components/prebuilt/light-halo.ce +148 -0
  193. package/src/components/scenes/canvas.ce +19 -14
  194. package/src/components/scenes/draw-map.ce +21 -29
  195. package/src/components/scenes/event-layer.ce +10 -3
  196. package/src/components/scenes/transition.ce +60 -0
  197. package/src/core/setup.ts +2 -0
  198. package/src/index.ts +16 -2
  199. package/src/module.ts +145 -9
  200. package/src/presets/animation.ts +46 -0
  201. package/src/presets/faceset.ts +60 -0
  202. package/src/presets/icon.ts +17 -0
  203. package/src/presets/index.ts +9 -1
  204. package/src/presets/lpc.ts +108 -0
  205. package/src/services/keyboardControls.ts +20 -0
  206. package/src/services/loadMap.ts +132 -3
  207. package/src/services/mmorpg.ts +39 -5
  208. package/src/services/save.ts +103 -0
  209. package/src/services/standalone.ts +107 -15
  210. package/src/utils/getEntityProp.ts +87 -0
  211. package/tsconfig.json +1 -1
  212. package/vite.config.ts +5 -3
  213. package/CHANGELOG.md +0 -9
  214. package/dist/Game/EffectManager.d.ts +0 -5
  215. package/dist/components/effects/index.d.ts +0 -4
  216. package/dist/index10.js +0 -8
  217. package/dist/index10.js.map +0 -1
  218. package/dist/index11.js +0 -10
  219. package/dist/index11.js.map +0 -1
  220. package/dist/index12.js +0 -8
  221. package/dist/index12.js.map +0 -1
  222. package/dist/index13.js.map +0 -1
  223. package/dist/index14.js +0 -50
  224. package/dist/index14.js.map +0 -1
  225. package/dist/index15.js +0 -191
  226. package/dist/index15.js.map +0 -1
  227. package/dist/index16.js.map +0 -1
  228. package/dist/index17.js.map +0 -1
  229. package/dist/index18.js +0 -31
  230. package/dist/index18.js.map +0 -1
  231. package/dist/index19.js.map +0 -1
  232. package/dist/index2.js +0 -112
  233. package/dist/index2.js.map +0 -1
  234. package/dist/index20.js.map +0 -1
  235. package/dist/index21.js.map +0 -1
  236. package/dist/index22.js +0 -109
  237. package/dist/index22.js.map +0 -1
  238. package/dist/index23.js.map +0 -1
  239. package/dist/index24.js +0 -21
  240. package/dist/index24.js.map +0 -1
  241. package/dist/index25.js.map +0 -1
  242. package/dist/index26.js.map +0 -1
  243. package/dist/index27.js.map +0 -1
  244. package/dist/index28.js +0 -25
  245. package/dist/index28.js.map +0 -1
  246. package/dist/index29.js.map +0 -1
  247. package/dist/index3.js +0 -87
  248. package/dist/index3.js.map +0 -1
  249. package/dist/index30.js.map +0 -1
  250. package/dist/index31.js.map +0 -1
  251. package/dist/index32.js.map +0 -1
  252. package/dist/index33.js.map +0 -1
  253. package/dist/index34.js.map +0 -1
  254. package/dist/index35.js +0 -91
  255. package/dist/index35.js.map +0 -1
  256. package/dist/index36.js +0 -61
  257. package/dist/index36.js.map +0 -1
  258. package/dist/index37.js +0 -20
  259. package/dist/index37.js.map +0 -1
  260. package/dist/index38.js +0 -20
  261. package/dist/index38.js.map +0 -1
  262. package/dist/index4.js +0 -54
  263. package/dist/index4.js.map +0 -1
  264. package/dist/index5.js +0 -15
  265. package/dist/index5.js.map +0 -1
  266. package/dist/index6.js.map +0 -1
  267. package/dist/index7.js.map +0 -1
  268. package/dist/index8.js +0 -90
  269. package/dist/index8.js.map +0 -1
  270. package/dist/index9.js +0 -76
  271. package/dist/index9.js.map +0 -1
  272. package/src/components/gui/dialogbox/itemMenu.ce +0 -23
  273. package/src/components/gui/dialogbox/selection.ce +0 -67
  274. package/src/components/scenes/element-map.ce +0 -23
  275. /package/src/components/{effects → animations}/hit.ce +0 -0
@@ -0,0 +1,316 @@
1
+ import { useProps, useDefineProps, computed, signal, on, animatedSignal, mount, tick, h, Container, loop, Sprite, cond } from 'canvasengine';
2
+ import { combineLatest, map, startWith, pairwise, filter, lastValueFrom } from 'rxjs';
3
+ import { Particle } from '@canvasengine/presets';
4
+ import { Direction, ModulesToken } from '@rpgjs/common';
5
+ import { RpgClientEngine } from '../RpgClientEngine.js';
6
+ import { inject } from '../core/inject.js';
7
+ import { RpgGui } from '../Gui/Gui.js';
8
+
9
+ function component($$props) {
10
+ useProps($$props);
11
+ const defineProps = useDefineProps($$props);
12
+ var __assign = (this && this.__assign) || function () {
13
+ __assign = Object.assign || function(t) {
14
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
15
+ s = arguments[i];
16
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
17
+ t[p] = s[p];
18
+ }
19
+ return t;
20
+ };
21
+ return __assign.apply(this, arguments);
22
+ };
23
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
24
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
25
+ return new (P || (P = Promise))(function (resolve, reject) {
26
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
27
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
28
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
29
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
30
+ });
31
+ };
32
+ var __generator = (this && this.__generator) || function (thisArg, body) {
33
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
34
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
35
+ function verb(n) { return function (v) { return step([n, v]); }; }
36
+ function step(op) {
37
+ if (f) throw new TypeError("Generator is already executing.");
38
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
39
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
40
+ if (y = 0, t) op = [op[0] & 2, t.value];
41
+ switch (op[0]) {
42
+ case 0: case 1: t = op; break;
43
+ case 4: _.label++; return { value: op[1], done: false };
44
+ case 5: _.label++; y = op[1]; op = [0]; continue;
45
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
46
+ default:
47
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
48
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
49
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
50
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
51
+ if (t[2]) _.ops.pop();
52
+ _.trys.pop(); continue;
53
+ }
54
+ op = body.call(thisArg, _);
55
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
56
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
57
+ }
58
+ };
59
+ var _a = defineProps(), object = _a.object, id = _a.id;
60
+ var client = inject(RpgClientEngine);
61
+ var hooks = inject(ModulesToken);
62
+ var guiService = inject(RpgGui);
63
+ client.spritesheets;
64
+ var playerId = client.playerId;
65
+ var componentsBehind = client.spriteComponentsBehind;
66
+ var componentsInFront = client.spriteComponentsInFront;
67
+ var isMe = computed(function () { return id() === playerId; });
68
+ var normalizeComponent = function (comp) {
69
+ var componentRef;
70
+ var propsValue;
71
+ var dependenciesFn;
72
+ // If it's a direct component reference
73
+ if (typeof comp === 'function' || (comp && typeof comp === 'object' && !comp.component)) {
74
+ componentRef = comp;
75
+ propsValue = undefined;
76
+ dependenciesFn = undefined;
77
+ }
78
+ // If it's a configuration object with component and props
79
+ else if (comp && typeof comp === 'object' && comp.component) {
80
+ componentRef = comp.component;
81
+ // Support both "data" (legacy) and "props" (new) for backward compatibility
82
+ propsValue = comp.props !== undefined ? comp.props : comp.data;
83
+ dependenciesFn = comp.dependencies;
84
+ }
85
+ // Fallback: treat as direct component
86
+ else {
87
+ componentRef = comp;
88
+ propsValue = undefined;
89
+ dependenciesFn = undefined;
90
+ }
91
+ // Return props directly (object or function), not as computed
92
+ // The computed will be created in the template when needed
93
+ return {
94
+ component: componentRef,
95
+ props: typeof propsValue === 'function' ? propsValue(object) : propsValue || {},
96
+ dependencies: dependenciesFn ? dependenciesFn(object) : []
97
+ };
98
+ };
99
+ var normalizeComponents = function (components) {
100
+ return components.map(function (comp) { return normalizeComponent(comp); });
101
+ };
102
+ var normalizedComponentsBehind = computed(function () {
103
+ return normalizeComponents(componentsBehind());
104
+ });
105
+ var normalizedComponentsInFront = computed(function () {
106
+ return normalizeComponents(componentsInFront());
107
+ });
108
+ var shouldFollowCamera = computed(function () {
109
+ var cameraTargetId = client.cameraFollowTargetId();
110
+ // If a target is explicitly set, only follow if this sprite is the target
111
+ if (cameraTargetId !== null) {
112
+ return id() === cameraTargetId;
113
+ }
114
+ // Otherwise, follow the current player (default behavior)
115
+ return isMe();
116
+ });
117
+ var attachedGuis = computed(function () {
118
+ return guiService.getAttachedGuis();
119
+ });
120
+ var shouldDisplayAttachedGui = computed(function () {
121
+ return guiService.shouldDisplayAttachedGui(id());
122
+ });
123
+ var x = object.x, y = object.y, tint = object.tint, direction = object.direction, animationName = object.animationName, animationCurrentIndex = object.animationCurrentIndex, emitParticleTrigger = object.emitParticleTrigger, particleName = object.particleName; object.graphics; var hitbox = object.hitbox, isConnected = object.isConnected, graphicsSignals = object.graphicsSignals, flashTrigger = object.flashTrigger;
124
+ var flashType = signal('alpha');
125
+ var flashDuration = signal(300);
126
+ var flashCycles = signal(1);
127
+ var flashAlpha = signal(0.3);
128
+ var flashTint = signal(0xffffff);
129
+ on(flashTrigger, function (data) {
130
+ if (data && typeof data === 'object') {
131
+ if (data.type !== undefined)
132
+ flashType.set(data.type);
133
+ if (data.duration !== undefined)
134
+ flashDuration.set(data.duration);
135
+ if (data.cycles !== undefined)
136
+ flashCycles.set(data.cycles);
137
+ if (data.alpha !== undefined)
138
+ flashAlpha.set(data.alpha);
139
+ if (data.tint !== undefined)
140
+ flashTint.set(data.tint);
141
+ }
142
+ });
143
+ var flashConfig = computed(function () { return ({
144
+ trigger: flashTrigger,
145
+ type: flashType(),
146
+ duration: flashDuration(),
147
+ cycles: flashCycles(),
148
+ alpha: flashAlpha(),
149
+ tint: flashTint(),
150
+ }); });
151
+ var particleSettings = client.particleSettings;
152
+ var canControls = function () { return isMe() && object.canMove(); };
153
+ var keyboardControls = client.globalConfig.keyboardControls;
154
+ var visible = computed(function () {
155
+ if (object.type === 'event') {
156
+ return true;
157
+ }
158
+ return isConnected();
159
+ });
160
+ var controls = signal({
161
+ down: {
162
+ repeat: true,
163
+ bind: keyboardControls.down,
164
+ keyDown: function () {
165
+ if (canControls())
166
+ client.processInput({ input: Direction.Down });
167
+ },
168
+ },
169
+ up: {
170
+ repeat: true,
171
+ bind: keyboardControls.up,
172
+ keyDown: function () {
173
+ if (canControls())
174
+ client.processInput({ input: Direction.Up });
175
+ },
176
+ },
177
+ left: {
178
+ repeat: true,
179
+ bind: keyboardControls.left,
180
+ keyDown: function () {
181
+ if (canControls())
182
+ client.processInput({ input: Direction.Left });
183
+ },
184
+ },
185
+ right: {
186
+ repeat: true,
187
+ bind: keyboardControls.right,
188
+ keyDown: function () {
189
+ if (canControls())
190
+ client.processInput({ input: Direction.Right });
191
+ },
192
+ },
193
+ action: {
194
+ bind: keyboardControls.action,
195
+ keyDown: function () {
196
+ if (canControls()) {
197
+ client.processAction({ action: 'action' });
198
+ }
199
+ },
200
+ },
201
+ escape: {
202
+ bind: keyboardControls.escape,
203
+ keyDown: function () {
204
+ if (canControls()) {
205
+ client.processAction({ action: 'escape' });
206
+ }
207
+ },
208
+ },
209
+ gamepad: {
210
+ enabled: true
211
+ }
212
+ });
213
+ var smoothX = animatedSignal(x(), {
214
+ duration: isMe() ? 0 : 0
215
+ });
216
+ var smoothY = animatedSignal(y(), {
217
+ duration: isMe() ? 0 : 0,
218
+ });
219
+ var z = computed(function () {
220
+ return object.y() + object.z();
221
+ });
222
+ var realAnimationName = signal(animationName());
223
+ var xSubscription = x.observable.subscribe(function (value) {
224
+ smoothX.set(value);
225
+ });
226
+ var ySubscription = y.observable.subscribe(function (value) {
227
+ smoothY.set(value);
228
+ });
229
+ var sheet = function (graphicObject) {
230
+ return {
231
+ definition: graphicObject,
232
+ playing: realAnimationName(),
233
+ params: {
234
+ direction: direction()
235
+ },
236
+ onFinish: function () {
237
+ animationCurrentIndex.update(function (index) { return index + 1; });
238
+ }
239
+ };
240
+ };
241
+ var movementAnimations = ['walk', 'stand'];
242
+ var epsilon = 0;
243
+ var stateX$ = smoothX.animatedState.observable;
244
+ var stateY$ = smoothY.animatedState.observable;
245
+ var animationName$ = animationName.observable;
246
+ var moving$ = combineLatest([stateX$, stateY$]).pipe(map(function (_a) {
247
+ var sx = _a[0], sy = _a[1];
248
+ var xFinished = Math.abs(sx.value.current - sx.value.end) <= epsilon;
249
+ var yFinished = Math.abs(sy.value.current - sy.value.end) <= epsilon;
250
+ return !xFinished || !yFinished; // moving if X or Y is not finished
251
+ }), startWith(false));
252
+ var animationChange$ = animationName$.pipe(startWith(animationName()), pairwise(), filter(function (_a) {
253
+ var prev = _a[0], curr = _a[1];
254
+ return prev !== curr;
255
+ }));
256
+ var animationMovementSubscription = combineLatest([animationChange$, moving$]).subscribe(function (_a) {
257
+ var _b = _a[0]; _b[0]; var curr = _b[1], isMoving = _a[1];
258
+ if (curr == 'stand' && !isMoving) {
259
+ realAnimationName.set(curr);
260
+ }
261
+ else if (curr == 'walk' && isMoving) {
262
+ realAnimationName.set(curr);
263
+ }
264
+ else if (!movementAnimations.includes(curr)) {
265
+ realAnimationName.set(curr);
266
+ }
267
+ if (!isMoving && object.animationIsPlaying && object.animationIsPlaying()) {
268
+ if (movementAnimations.includes(curr)) {
269
+ if (typeof object.resetAnimationState === 'function') {
270
+ object.resetAnimationState();
271
+ }
272
+ }
273
+ }
274
+ });
275
+ var onBeforeDestroy = function () { return __awaiter(void 0, void 0, void 0, function () {
276
+ return __generator(this, function (_a) {
277
+ switch (_a.label) {
278
+ case 0:
279
+ animationMovementSubscription.unsubscribe();
280
+ xSubscription.unsubscribe();
281
+ ySubscription.unsubscribe();
282
+ return [4 /*yield*/, lastValueFrom(hooks.callHooks("client-sprite-onDestroy", object))];
283
+ case 1:
284
+ _a.sent();
285
+ return [4 /*yield*/, lastValueFrom(hooks.callHooks("client-sceneMap-onRemoveSprite", client.sceneMap, object))];
286
+ case 2:
287
+ _a.sent();
288
+ return [2 /*return*/];
289
+ }
290
+ });
291
+ }); };
292
+ mount(function (element) {
293
+ hooks.callHooks("client-sprite-onAdd", object).subscribe();
294
+ hooks.callHooks("client-sceneMap-onAddSprite", client.sceneMap, object).subscribe();
295
+ if (isMe())
296
+ client.setKeyboardControls(element.directives.controls);
297
+ });
298
+ var onAttachedGuiFinish = function (gui, data) {
299
+ guiService.guiClose(gui.name, data);
300
+ };
301
+ var onAttachedGuiInteraction = function (gui, name, data) {
302
+ guiService.guiInteraction(gui.name, name, data);
303
+ };
304
+ tick(function () {
305
+ hooks.callHooks("client-sprite-onUpdate").subscribe();
306
+ });
307
+ let $this = h(Container, { x: smoothX, y: smoothY, zIndex: z, viewportFollow: shouldFollowCamera, controls, onBeforeDestroy, visible }, [loop(normalizedComponentsBehind, compConfig => h(Container, null, h(compConfig.component, { object, ...compConfig.props }))), h(Particle, { emit: emitParticleTrigger, settings: particleSettings, zIndex: 1000, name: particleName }), h(Container, null, loop(graphicsSignals, graphicObj => h(Sprite, { sheet: computed(() => sheet(graphicObj)), direction, tint, hitbox, flash: flashConfig }))), loop(normalizedComponentsInFront, compConfig => h(Container, { dependencies: compConfig.dependencies }, h(compConfig.component, { object, ...compConfig.props }))), loop(attachedGuis, attachedGui => cond(shouldDisplayAttachedGui, () => h(Container, null, h(attachedGui.component, { ...attachedGui.data(), dependencies: attachedGui.dependencies, object: object, onFinish: (data) => {
308
+ onAttachedGuiFinish(attachedGui, data);
309
+ }, onInteraction: (name, data) => {
310
+ onAttachedGuiInteraction(attachedGui, name, data);
311
+ } }))))]);
312
+ return $this
313
+ }
314
+
315
+ export { component as default };
316
+ //# sourceMappingURL=character.ce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"character.ce.js","sources":["../../src/components/character.ce"],"sourcesContent":["<Container x={smoothX} y={smoothY} zIndex={z} viewportFollow={shouldFollowCamera} controls onBeforeDestroy visible >\n @for (compConfig of normalizedComponentsBehind) {\n <Container>\n <compConfig.component object ...compConfig.props />\n </Container>\n } \n <Particle emit={emitParticleTrigger} settings={particleSettings} zIndex={1000} name={particleName} />\n <Container>\n @for (graphicObj of graphicsSignals) {\n <Sprite \n sheet={sheet(graphicObj)} \n direction \n tint \n hitbox \n flash={flashConfig}\n />\n }\n </Container>\n @for (compConfig of normalizedComponentsInFront) {\n <Container dependencies={compConfig.dependencies}>\n <compConfig.component object ...compConfig.props />\n </Container>\n }\n @for (attachedGui of attachedGuis) {\n @if (shouldDisplayAttachedGui) {\n <Container>\n <attachedGui.component ...attachedGui.data() dependencies={attachedGui.dependencies} object={object} onFinish={(data) => {\n onAttachedGuiFinish(attachedGui, data)\n }} onInteraction={(name, data) => {\n onAttachedGuiInteraction(attachedGui, name, data)\n }} />\n </Container>\n }\n }\n</Container>\n\n<script>\n import { signal, effect, mount, computed, tick, animatedSignal, on } from \"canvasengine\";\n\n import { lastValueFrom, combineLatest, pairwise, filter, map, startWith } from \"rxjs\";\n import { Particle } from \"@canvasengine/presets\";\n import { GameEngineToken, ModulesToken } from \"@rpgjs/common\";\n import { RpgClientEngine } from \"../RpgClientEngine\";\n import { inject } from \"../core/inject\"; \n import { Direction } from \"@rpgjs/common\";\n import Hit from \"./effects/hit.ce\";\n import PlayerComponents from \"./player-components.ce\";\n import { RpgGui } from \"../Gui/Gui\";\n\n const { object, id } = defineProps();\n\n const client = inject(RpgClientEngine);\n const hooks = inject(ModulesToken);\n const guiService = inject(RpgGui);\n\n const spritesheets = client.spritesheets;\n const playerId = client.playerId;\n const componentsBehind = client.spriteComponentsBehind;\n const componentsInFront = client.spriteComponentsInFront;\n const isMe = computed(() => id() === playerId);\n\n /**\n * Normalize a single sprite component configuration\n * \n * Handles both direct component references and configuration objects with optional props and dependencies.\n * Extracts the component reference and creates a computed function that returns the props.\n * \n * ## Design\n * \n * Supports two formats:\n * 1. Direct component: `ShadowComponent`\n * 2. Configuration object: `{ component: LightHalo, props: {...}, dependencies: (object) => [...] }`\n * \n * The normalization process:\n * - Extracts the actual component from either format\n * - Extracts dependencies function if provided\n * - Creates a computed function that returns props (static object or dynamic function result)\n * - Returns a normalized object with `component`, `props`, and `dependencies`\n * \n * @param comp - Component reference or configuration object\n * @returns Normalized component configuration with component, props, and dependencies\n * \n * @example\n * ```ts\n * // Direct component\n * normalizeComponent(ShadowComponent)\n * // => { component: ShadowComponent, props: {}, dependencies: undefined }\n * \n * // With static props\n * normalizeComponent({ component: LightHalo, props: { radius: 30 } })\n * // => { component: LightHalo, props: { radius: 30 }, dependencies: undefined }\n * \n * // With dynamic props and dependencies\n * normalizeComponent({ \n * component: HealthBar, \n * props: (object) => ({ hp: object.hp(), maxHp: object.param.maxHp() }),\n * dependencies: (object) => [object.hp, object.param.maxHp]\n * })\n * // => { component: HealthBar, props: {...}, dependencies: (object) => [...] }\n * ```\n */\n const normalizeComponent = (comp) => {\n let componentRef;\n let propsValue;\n let dependenciesFn;\n \n // If it's a direct component reference\n if (typeof comp === 'function' || (comp && typeof comp === 'object' && !comp.component)) {\n componentRef = comp;\n propsValue = undefined;\n dependenciesFn = undefined;\n }\n // If it's a configuration object with component and props\n else if (comp && typeof comp === 'object' && comp.component) {\n componentRef = comp.component;\n // Support both \"data\" (legacy) and \"props\" (new) for backward compatibility\n propsValue = comp.props !== undefined ? comp.props : comp.data;\n dependenciesFn = comp.dependencies;\n }\n // Fallback: treat as direct component\n else {\n componentRef = comp;\n propsValue = undefined;\n dependenciesFn = undefined;\n }\n \n // Return props directly (object or function), not as computed\n // The computed will be created in the template when needed\n return {\n component: componentRef,\n props: typeof propsValue === 'function' ? propsValue(object) : propsValue || {},\n dependencies: dependenciesFn ? dependenciesFn(object) : []\n };\n };\n\n /**\n * Normalize an array of sprite components\n * \n * Applies normalization to each component in the array using `normalizeComponent`.\n * \n * @param components - Array of component references or configuration objects\n * @returns Array of normalized component configurations\n */\n const normalizeComponents = (components) => {\n return components.map((comp) => normalizeComponent(comp));\n };\n\n\n /**\n * Normalized components to render behind sprites\n * Handles both direct component references and configuration objects with optional props and dependencies\n * \n * Supports multiple formats:\n * 1. Direct component: `ShadowComponent`\n * 2. Configuration object: `{ component: LightHalo, props: {...} }`\n * 3. With dynamic props: `{ component: LightHalo, props: (object) => {...} }`\n * 4. With dependencies: `{ component: HealthBar, dependencies: (object) => [object.hp, object.param.maxHp] }`\n * \n * Components with dependencies will only be displayed when all dependencies are resolved (!= undefined).\n * The object is passed to the dependencies function to allow sprite-specific dependency resolution.\n * \n * @example\n * ```ts\n * // Direct component\n * componentsBehind: [ShadowComponent]\n * \n * // With static props\n * componentsBehind: [{ component: LightHalo, props: { radius: 30 } }]\n * \n * // With dynamic props and dependencies\n * componentsBehind: [{ \n * component: HealthBar, \n * props: (object) => ({ hp: object.hp(), maxHp: object.param.maxHp() }),\n * dependencies: (object) => [object.hp, object.param.maxHp]\n * }]\n * ```\n */\n const normalizedComponentsBehind = computed(() => {\n return normalizeComponents(componentsBehind());\n });\n\n /**\n * Normalized components to render in front of sprites\n * Handles both direct component references and configuration objects with optional props and dependencies\n * \n * See `normalizedComponentsBehind` for format details.\n * Components with dependencies will only be displayed when all dependencies are resolved.\n */\n const normalizedComponentsInFront = computed(() => {\n return normalizeComponents(componentsInFront());\n });\n \n /**\n * Determine if the camera should follow this sprite\n * \n * The camera follows this sprite if:\n * - It's explicitly set as the camera follow target, OR\n * - It's the current player and no explicit target is set (default behavior)\n */\n const shouldFollowCamera = computed(() => {\n const cameraTargetId = client.cameraFollowTargetId();\n // If a target is explicitly set, only follow if this sprite is the target\n if (cameraTargetId !== null) {\n return id() === cameraTargetId;\n }\n // Otherwise, follow the current player (default behavior)\n return isMe();\n });\n\n /**\n * Get all attached GUI components that should be rendered on sprites\n * These are GUIs with attachToSprite: true\n */\n const attachedGuis = computed(() => {\n return guiService.getAttachedGuis();\n });\n\n /**\n * Check if attached GUIs should be displayed for this sprite\n * This is controlled by showAttachedGui/hideAttachedGui on the server\n */\n const shouldDisplayAttachedGui = computed(() => {\n return guiService.shouldDisplayAttachedGui(id());\n });\n\n const { \n x, \n y, \n tint, \n direction, \n animationName, \n animationCurrentIndex,\n emitParticleTrigger, \n particleName, \n graphics, \n hitbox,\n isConnected,\n graphicsSignals,\n flashTrigger\n } = object;\n\n /**\n * Flash configuration signals for dynamic options\n * These signals are updated when the flash trigger is activated with options\n */\n const flashType = signal<'alpha' | 'tint' | 'both'>('alpha');\n const flashDuration = signal(300);\n const flashCycles = signal(1);\n const flashAlpha = signal(0.3);\n const flashTint = signal(0xffffff);\n\n /**\n * Listen to flash trigger to update configuration dynamically\n * When flash is triggered with options, update the signals\n */\n on(flashTrigger, (data) => {\n if (data && typeof data === 'object') {\n if (data.type !== undefined) flashType.set(data.type);\n if (data.duration !== undefined) flashDuration.set(data.duration);\n if (data.cycles !== undefined) flashCycles.set(data.cycles);\n if (data.alpha !== undefined) flashAlpha.set(data.alpha);\n if (data.tint !== undefined) flashTint.set(data.tint);\n }\n });\n\n /**\n * Flash configuration for the sprite\n * \n * This configuration is used by the flash directive to create visual feedback effects.\n * The flash trigger is exposed through the object, allowing both server events and\n * client-side code to trigger flash animations. Options can be passed dynamically\n * through the trigger, which updates the reactive signals.\n */\n const flashConfig = computed(() => ({\n trigger: flashTrigger,\n type: flashType(),\n duration: flashDuration(),\n cycles: flashCycles(),\n alpha: flashAlpha(),\n tint: flashTint(),\n }));\n\n const particleSettings = client.particleSettings;\n\n const canControls = () => isMe() && object.canMove()\n const keyboardControls = client.globalConfig.keyboardControls;\n\n const visible = computed(() => {\n if (object.type === 'event') {\n return true\n }\n return isConnected()\n });\n\n const controls = signal({\n down: {\n repeat: true,\n bind: keyboardControls.down,\n keyDown() {\n if (canControls()) client.processInput({ input: Direction.Down })\n },\n },\n up: {\n repeat: true,\n bind: keyboardControls.up,\n keyDown() {\n if (canControls()) client.processInput({ input: Direction.Up })\n },\n },\n left: {\n repeat: true,\n bind: keyboardControls.left,\n keyDown() {\n if (canControls()) client.processInput({ input: Direction.Left })\n },\n },\n right: {\n repeat: true,\n bind: keyboardControls.right,\n keyDown() {\n if (canControls()) client.processInput({ input: Direction.Right })\n },\n },\n action: {\n bind: keyboardControls.action,\n keyDown() {\n if (canControls()) {\n client.processAction({ action: 'action' })\n }\n },\n },\n escape: {\n bind: keyboardControls.escape,\n keyDown() {\n if (canControls()) {\n client.processAction({ action: 'escape' })\n }\n },\n },\n gamepad: {\n enabled: true\n }\n });\n\n const smoothX = animatedSignal(x(), {\n duration: isMe() ? 0 : 0\n });\n\n const smoothY = animatedSignal(y(), {\n duration: isMe() ? 0 : 0,\n });\n\n const z = computed(() => {\n return object.y() + object.z()\n });\n\n const realAnimationName = signal(animationName());\n\n const xSubscription = x.observable.subscribe((value) => {\n smoothX.set(value);\n });\n\n const ySubscription = y.observable.subscribe((value) => {\n smoothY.set(value);\n });\n \n const sheet = (graphicObject) => {\n return {\n definition: graphicObject,\n playing: realAnimationName(),\n params: {\n direction: direction()\n },\n onFinish() {\n animationCurrentIndex.update(index => index + 1)\n }\n };\n }\n\n // Combine animation change detection with movement state from smoothX/smoothY\n const movementAnimations = ['walk', 'stand'];\n const epsilon = 0; // movement threshold to consider the easing still running\n\n const stateX$ = smoothX.animatedState.observable;\n const stateY$ = smoothY.animatedState.observable;\n const animationName$ = animationName.observable;\n\n const moving$ = combineLatest([stateX$, stateY$]).pipe(\n map(([sx, sy]) => {\n const xFinished = Math.abs(sx.value.current - sx.value.end) <= epsilon;\n const yFinished = Math.abs(sy.value.current - sy.value.end) <= epsilon;\n return !xFinished || !yFinished; // moving if X or Y is not finished\n }),\n startWith(false)\n );\n\n const animationChange$ = animationName$.pipe(\n startWith(animationName()),\n pairwise(),\n filter(([prev, curr]) => prev !== curr)\n );\n\n const animationMovementSubscription = combineLatest([animationChange$, moving$]).subscribe(([[prev, curr], isMoving]) => {\n if (curr == 'stand' && !isMoving) {\n realAnimationName.set(curr);\n }\n else if (curr == 'walk' && isMoving) {\n realAnimationName.set(curr);\n }\n else if (!movementAnimations.includes(curr)) {\n realAnimationName.set(curr);\n }\n if (!isMoving && object.animationIsPlaying && object.animationIsPlaying()) {\n if (movementAnimations.includes(curr)) {\n if (typeof object.resetAnimationState === 'function') {\n object.resetAnimationState();\n }\n }\n }\n });\n\n /**\n * Cleanup subscriptions and call hooks before sprite destruction.\n *\n * # Design\n * - Prevent memory leaks by unsubscribing from all local subscriptions created in this component.\n * - Execute destruction hooks to notify modules and scene map of sprite removal.\n *\n * @example\n * await onBeforeDestroy();\n */\n const onBeforeDestroy = async () => {\n animationMovementSubscription.unsubscribe();\n xSubscription.unsubscribe();\n ySubscription.unsubscribe();\n await lastValueFrom(hooks.callHooks(\"client-sprite-onDestroy\", object)) \n await lastValueFrom(hooks.callHooks(\"client-sceneMap-onRemoveSprite\", client.sceneMap, object))\n }\n\n mount((element) => {\n hooks.callHooks(\"client-sprite-onAdd\", object).subscribe()\n hooks.callHooks(\"client-sceneMap-onAddSprite\", client.sceneMap, object).subscribe()\n if (isMe()) client.setKeyboardControls(element.directives.controls)\n })\n\n /**\n * Handle attached GUI finish event\n * \n * @param gui - The GUI instance\n * @param data - Data passed from the GUI component\n */\n const onAttachedGuiFinish = (gui, data) => {\n guiService.guiClose(gui.name, data);\n };\n\n /**\n * Handle attached GUI interaction event\n * \n * @param gui - The GUI instance\n * @param name - Interaction name\n * @param data - Interaction data\n */\n const onAttachedGuiInteraction = (gui, name, data) => {\n guiService.guiInteraction(gui.name, name, data);\n };\n\n tick(() => {\n hooks.callHooks(\"client-sprite-onUpdate\").subscribe()\n })\n</script>"],"names":[],"mappings":";;;;;;;;AAcqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAAQ,MAAM,WAAW,GAAG,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,C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AAE,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,MAAM,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,2BAA2B,EAAE,UAAU,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,YAAY,EAAE,UAAU,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,WAAW,IAAI,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,SAAS,EAAE,EAAE,GAAG,WAAW,CAAC,IAAI,EAAE,EAAE,YAAY,EAAE,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,KAAK;AACp5B,UAAU,mBAAmB,CAAC,WAAW,EAAE,IAAI;AAC/C,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK;AAC1C,UAAU,wBAAwB,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI;AAC1D,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAChB,QAAQ,OAAO;AACf,MAAM;;;;"}
@@ -0,0 +1 @@
1
+ export declare const parseDynamicValue: (value: any, object?: any) => import('canvasengine').ComputedSignal<string>;
@@ -0,0 +1,54 @@
1
+ import { computed } from 'canvasengine';
2
+
3
+ const parseDynamicValue = (value, object) => {
4
+ if (typeof value !== "string") {
5
+ return computed(() => String(value ?? ""));
6
+ }
7
+ const pattern = /\{([^}]+)\}/g;
8
+ const matches = [];
9
+ let match;
10
+ while ((match = pattern.exec(value)) !== null) {
11
+ matches.push({
12
+ property: match[1],
13
+ fullMatch: match[0],
14
+ index: match.index
15
+ });
16
+ }
17
+ if (matches.length === 0) {
18
+ return computed(() => value);
19
+ }
20
+ return computed(() => {
21
+ let result = value;
22
+ for (let i = matches.length - 1; i >= 0; i--) {
23
+ const { property, fullMatch } = matches[i];
24
+ let propertyValue = "";
25
+ try {
26
+ const propertyPath = property.split(".");
27
+ let currentValue = object;
28
+ for (let j = 0; j < propertyPath.length; j++) {
29
+ const prop = propertyPath[j];
30
+ if (typeof currentValue === "function") {
31
+ currentValue = currentValue();
32
+ }
33
+ if (currentValue && typeof currentValue === "object" && prop in currentValue) {
34
+ currentValue = currentValue[prop];
35
+ } else {
36
+ currentValue = void 0;
37
+ break;
38
+ }
39
+ }
40
+ if (typeof currentValue === "function") {
41
+ currentValue = currentValue();
42
+ }
43
+ propertyValue = currentValue != null ? String(currentValue) : "";
44
+ } catch (error) {
45
+ propertyValue = "";
46
+ }
47
+ result = result.replace(fullMatch, propertyValue);
48
+ }
49
+ return result;
50
+ });
51
+ };
52
+
53
+ export { parseDynamicValue };
54
+ //# sourceMappingURL=parse-value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-value.js","sources":["../../../src/components/dynamics/parse-value.ts"],"sourcesContent":["import { computed } from \"canvasengine\";\n\ninterface MatchResult {\n property: string;\n fullMatch: string;\n index: number;\n}\n\nexport const parseDynamicValue = (value: any, object?: any) => {\n if (typeof value !== 'string') {\n return computed(() => String(value ?? ''));\n }\n\n // Find all dynamic references like {propertyName}\n const pattern = /\\{([^}]+)\\}/g;\n const matches: MatchResult[] = [];\n let match;\n \n while ((match = pattern.exec(value)) !== null) {\n matches.push({\n property: match[1],\n fullMatch: match[0],\n index: match.index!\n });\n }\n\n // If no dynamic references found, return simple computed\n if (matches.length === 0) {\n return computed(() => value);\n }\n\n // Create computed that tracks all referenced signals\n return computed(() => {\n let result = value;\n \n // Replace from end to start to preserve indices\n for (let i = matches.length - 1; i >= 0; i--) {\n const { property, fullMatch } = matches[i];\n \n // Try to access the property from the object\n // Support nested properties like {param.maxHp}\n let propertyValue = '';\n try {\n const propertyPath = property.split('.');\n let currentValue = object;\n \n for (let j = 0; j < propertyPath.length; j++) {\n const prop = propertyPath[j];\n \n // Check if currentValue is a signal (function) and call it\n if (typeof currentValue === 'function') {\n currentValue = currentValue();\n }\n \n // Access the property\n if (currentValue && typeof currentValue === 'object' && prop in currentValue) {\n currentValue = currentValue[prop];\n } else {\n currentValue = undefined;\n break;\n }\n }\n \n // If the final value is a signal, call it\n if (typeof currentValue === 'function') {\n currentValue = currentValue();\n }\n \n propertyValue = currentValue != null ? String(currentValue) : '';\n } catch (error) {\n // If property doesn't exist or can't be accessed, use empty string\n propertyValue = '';\n }\n \n result = result.replace(fullMatch, propertyValue);\n }\n \n return result;\n });\n};\n"],"names":[],"mappings":";;AAQO,MAAM,iBAAA,GAAoB,CAAC,KAAA,EAAY,MAAA,KAAiB;AAC3D,EAAA,IAAI,OAAO,UAAU,QAAA,EAAU;AAC3B,IAAA,OAAO,QAAA,CAAS,MAAM,MAAA,CAAO,KAAA,IAAS,EAAE,CAAC,CAAA;AAAA,EAC7C;AAGA,EAAA,MAAM,OAAA,GAAU,cAAA;AAChB,EAAA,MAAM,UAAyB,EAAC;AAChC,EAAA,IAAI,KAAA;AAEJ,EAAA,OAAA,CAAQ,KAAA,GAAQ,OAAA,CAAQ,IAAA,CAAK,KAAK,OAAO,IAAA,EAAM;AAC3C,IAAA,OAAA,CAAQ,IAAA,CAAK;AAAA,MACT,QAAA,EAAU,MAAM,CAAC,CAAA;AAAA,MACjB,SAAA,EAAW,MAAM,CAAC,CAAA;AAAA,MAClB,OAAO,KAAA,CAAM;AAAA,KAChB,CAAA;AAAA,EACL;AAGA,EAAA,IAAI,OAAA,CAAQ,WAAW,CAAA,EAAG;AACtB,I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aAAa,CAAA;AAAA,IACpD;AAEA,IAAA,OAAO,MAAA;AAAA,EACX,CAAC,CAAA;AACL;;;;"}
@@ -0,0 +1,141 @@
1
+ import { useProps, useDefineProps, h, Text, computed } from 'canvasengine';
2
+ import { parseDynamicValue } from './parse-value.js';
3
+
4
+ function component($$props) {
5
+ useProps($$props);
6
+ const defineProps = useDefineProps($$props);
7
+ var __assign = (this && this.__assign) || function () {
8
+ __assign = Object.assign || function(t) {
9
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
10
+ s = arguments[i];
11
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
12
+ t[p] = s[p];
13
+ }
14
+ return t;
15
+ };
16
+ return __assign.apply(this, arguments);
17
+ };
18
+ var object = defineProps().object;
19
+ var component = object._component;
20
+ var parseNumericStyleValue = function (value, object) {
21
+ if (value === undefined || value === null) {
22
+ return undefined;
23
+ }
24
+ if (typeof value === 'number') {
25
+ return value;
26
+ }
27
+ if (typeof value === 'string') {
28
+ // Check if it contains dynamic references
29
+ if (value.includes('{')) {
30
+ // Parse dynamic value and convert to number
31
+ var parsed_1 = parseDynamicValue(value, object);
32
+ return computed(function () {
33
+ var str = parsed_1();
34
+ var num = parseFloat(str);
35
+ return isNaN(num) ? 0 : num;
36
+ });
37
+ }
38
+ else {
39
+ // Simple string number, convert directly
40
+ var num = parseFloat(value);
41
+ return isNaN(num) ? undefined : num;
42
+ }
43
+ }
44
+ return value;
45
+ };
46
+ var getComponentStyle = function (component) {
47
+ if (!component.style) {
48
+ return {};
49
+ }
50
+ var style = component.style;
51
+ var result = {};
52
+ // Map fill to color (shortcut property)
53
+ // fill can be a string (hex color) or a dynamic string
54
+ if (style.fill !== undefined) {
55
+ if (typeof style.fill === 'string' && style.fill.includes('{')) {
56
+ result.color = parseDynamicValue(style.fill, object);
57
+ }
58
+ else {
59
+ result.color = style.fill;
60
+ }
61
+ }
62
+ // Map fontSize to size (shortcut property)
63
+ // fontSize can be number or string (with dynamic references)
64
+ if (style.fontSize !== undefined) {
65
+ var fontSizeValue = parseNumericStyleValue(style.fontSize, object);
66
+ if (fontSizeValue !== undefined) {
67
+ result.size = fontSizeValue;
68
+ }
69
+ }
70
+ // Map fontFamily (shortcut property)
71
+ if (style.fontFamily !== undefined) {
72
+ if (typeof style.fontFamily === 'string' && style.fontFamily.includes('{')) {
73
+ result.fontFamily = parseDynamicValue(style.fontFamily, object);
74
+ }
75
+ else {
76
+ result.fontFamily = style.fontFamily;
77
+ }
78
+ }
79
+ // Build style object for PixiJS Text properties
80
+ var textStyle = {};
81
+ // Font style properties
82
+ if (style.fontStyle !== undefined) {
83
+ if (typeof style.fontStyle === 'string' && style.fontStyle.includes('{')) {
84
+ textStyle.fontStyle = parseDynamicValue(style.fontStyle, object);
85
+ }
86
+ else {
87
+ textStyle.fontStyle = style.fontStyle;
88
+ }
89
+ }
90
+ if (style.fontWeight !== undefined) {
91
+ if (typeof style.fontWeight === 'string' && style.fontWeight.includes('{')) {
92
+ textStyle.fontWeight = parseDynamicValue(style.fontWeight, object);
93
+ }
94
+ else if (typeof style.fontWeight === 'number') {
95
+ textStyle.fontWeight = style.fontWeight;
96
+ }
97
+ else {
98
+ textStyle.fontWeight = style.fontWeight;
99
+ }
100
+ }
101
+ // Stroke properties
102
+ if (style.stroke !== undefined) {
103
+ if (typeof style.stroke === 'string' && style.stroke.includes('{')) {
104
+ textStyle.stroke = parseDynamicValue(style.stroke, object);
105
+ }
106
+ else {
107
+ textStyle.stroke = style.stroke;
108
+ }
109
+ }
110
+ // Opacity (can be number or string)
111
+ if (style.opacity !== undefined) {
112
+ var opacityValue = parseNumericStyleValue(style.opacity, object);
113
+ if (opacityValue !== undefined) {
114
+ textStyle.opacity = opacityValue;
115
+ }
116
+ }
117
+ // Word wrap
118
+ if (style.wordWrap !== undefined) {
119
+ textStyle.wordWrap = style.wordWrap;
120
+ }
121
+ // Text alignment
122
+ if (style.align !== undefined) {
123
+ if (typeof style.align === 'string' && style.align.includes('{')) {
124
+ textStyle.align = parseDynamicValue(style.align, object);
125
+ }
126
+ else {
127
+ textStyle.align = style.align;
128
+ }
129
+ }
130
+ // Only add style prop if there are style properties
131
+ if (Object.keys(textStyle).length > 0) {
132
+ result.style = textStyle;
133
+ }
134
+ return result;
135
+ };
136
+ let $this = h(Text, { text: computed(() => parseDynamicValue(component.value, object)), ...getComponentStyle(component) });
137
+ return $this
138
+ }
139
+
140
+ export { component as default };
141
+ //# sourceMappingURL=text.ce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.ce.js","sources":["../../../src/components/dynamics/text.ce"],"sourcesContent":["<Text text={parseDynamicValue(component.value, object)} ...getComponentStyle(component) />\n\n<script>\nimport { computed } from \"canvasengine\";\nimport { parseDynamicValue } from \"./parse-value\";\n\nconst { object } = defineProps();\nconst component = object._component;\n\n/**\n * Parses a numeric style value that can be a number or a string\n * \n * If the value is a string, it may contain dynamic references like {hp}\n * which need to be parsed using parseDynamicValue. If it's a number,\n * it's returned as-is wrapped in a computed.\n * \n * @param value - Numeric value (number or string)\n * @param object - Object to resolve dynamic references from\n * @returns Computed signal with the numeric value\n */\nconst parseNumericStyleValue = (value, object) => {\n if (value === undefined || value === null) {\n return undefined;\n }\n \n if (typeof value === 'number') {\n return value;\n }\n \n if (typeof value === 'string') {\n // Check if it contains dynamic references\n if (value.includes('{')) {\n // Parse dynamic value and convert to number\n const parsed = parseDynamicValue(value, object);\n return computed(() => {\n const str = parsed();\n const num = parseFloat(str);\n return isNaN(num) ? 0 : num;\n });\n } else {\n // Simple string number, convert directly\n const num = parseFloat(value);\n return isNaN(num) ? undefined : num;\n }\n }\n \n return value;\n};\n\n/**\n * Maps component style properties to Canvas Engine Text component props\n * \n * Converts TextComponentOptions from the server to the format expected\n * by the Canvas Engine Text component. Supports all text styling properties\n * including fill, fontSize, fontFamily, fontStyle, fontWeight, stroke,\n * opacity, wordWrap, and align. Also supports dynamic values (number | string)\n * for numeric properties like fontSize and opacity.\n * \n * @param component - Component definition with style property\n * @returns Object with Text component props\n * \n * @example\n * ```ts\n * // Component with style\n * const component = {\n * style: {\n * fill: '#000000',\n * fontSize: 20,\n * fontFamily: 'Arial',\n * fontWeight: 'bold'\n * }\n * };\n * \n * const props = getComponentStyle(component);\n * // Returns: { color: '#000000', size: 20, fontFamily: 'Arial', style: { fontWeight: 'bold' } }\n * \n * // Component with dynamic fontSize\n * const component2 = {\n * style: {\n * fill: '#000000',\n * fontSize: '{hp}', // Will be resolved from object.hp\n * opacity: '0.8'\n * }\n * };\n * ```\n */\nconst getComponentStyle = (component) => {\n if (!component.style) {\n return {};\n }\n\n const style = component.style;\n const result = {};\n\n // Map fill to color (shortcut property)\n // fill can be a string (hex color) or a dynamic string\n if (style.fill !== undefined) {\n if (typeof style.fill === 'string' && style.fill.includes('{')) {\n result.color = parseDynamicValue(style.fill, object);\n } else {\n result.color = style.fill;\n }\n }\n\n // Map fontSize to size (shortcut property)\n // fontSize can be number or string (with dynamic references)\n if (style.fontSize !== undefined) {\n const fontSizeValue = parseNumericStyleValue(style.fontSize, object);\n if (fontSizeValue !== undefined) {\n result.size = fontSizeValue;\n }\n }\n\n // Map fontFamily (shortcut property)\n if (style.fontFamily !== undefined) {\n if (typeof style.fontFamily === 'string' && style.fontFamily.includes('{')) {\n result.fontFamily = parseDynamicValue(style.fontFamily, object);\n } else {\n result.fontFamily = style.fontFamily;\n }\n }\n\n // Build style object for PixiJS Text properties\n const textStyle = {};\n\n // Font style properties\n if (style.fontStyle !== undefined) {\n if (typeof style.fontStyle === 'string' && style.fontStyle.includes('{')) {\n textStyle.fontStyle = parseDynamicValue(style.fontStyle, object);\n } else {\n textStyle.fontStyle = style.fontStyle;\n }\n }\n\n if (style.fontWeight !== undefined) {\n if (typeof style.fontWeight === 'string' && style.fontWeight.includes('{')) {\n textStyle.fontWeight = parseDynamicValue(style.fontWeight, object);\n } else if (typeof style.fontWeight === 'number') {\n textStyle.fontWeight = style.fontWeight;\n } else {\n textStyle.fontWeight = style.fontWeight;\n }\n }\n\n // Stroke properties\n if (style.stroke !== undefined) {\n if (typeof style.stroke === 'string' && style.stroke.includes('{')) {\n textStyle.stroke = parseDynamicValue(style.stroke, object);\n } else {\n textStyle.stroke = style.stroke;\n }\n }\n\n // Opacity (can be number or string)\n if (style.opacity !== undefined) {\n const opacityValue = parseNumericStyleValue(style.opacity, object);\n if (opacityValue !== undefined) {\n textStyle.opacity = opacityValue;\n }\n }\n\n // Word wrap\n if (style.wordWrap !== undefined) {\n textStyle.wordWrap = style.wordWrap;\n }\n\n // Text alignment\n if (style.align !== undefined) {\n if (typeof style.align === 'string' && style.align.includes('{')) {\n textStyle.align = parseDynamicValue(style.align, object);\n } else {\n textStyle.align = style.align;\n }\n }\n\n // Only add style prop if there are style properties\n if (Object.keys(textStyle).length > 0) {\n result.style = textStyle;\n }\n\n return result;\n}\n</script>"],"names":[],"mappings":";;;AAOqB,SAAS,SAAS,CAAC,OAAO,EAAE;AACjD,QAAuB,QAAQ,CAAC,OAAO;AACvC,QAAQ,MAAM,WAAW,GAAG,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,QAAQ;AACR,QAAQ,OAAO,CAAC;AACh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,YAAY,KAAK,SAAS,EAAE;AACxC,YAAY,SAAS,CAAC,OAAO,GAAG,YAAY;AAC5C,QAAQ;AACR,IAAI;AACJ;AACA,IAAI,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,EAAE;AACtC,QAAQ,SAAS,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ;AAC3C,IAAI;AACJ;AACA,IAAI,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE;AACnC,QAAQ,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC1E,YAAY,SAAS,CAAC,KAAK,GAAG,iBAAiB,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC;AACpE,QAAQ;AACR,aAAa;AACb,YAAY,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK;AACzC,QAAQ;AACR,IAAI;AACJ;AACA,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;AAC3C,QAAQ,MAAM,CAAC,KAAK,GAAG,SAAS;AAChC,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB;AACA,QAAQ,IAAI,KAAK,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,iBAAiB,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE,GAAG,iBAAiB,CAAC,SAAS,CAAC,EAAE;AACjI,QAAQ,OAAO;AACf,MAAM;;;;"}
@@ -0,0 +1,27 @@
1
+ import { useProps, useDefineProps, computed, h, Container, Rect } from 'canvasengine';
2
+ import { RpgClientEngine } from '../../RpgClientEngine.js';
3
+ import '../../node_modules/.pnpm/@signe_room@2.8.2/node_modules/@signe/room/dist/index.js';
4
+ import '@rpgjs/common';
5
+ import '../../node_modules/.pnpm/@signe_di@2.8.2/node_modules/@signe/di/dist/index.js';
6
+ import { inject } from '../../core/inject.js';
7
+ import './notification/notification.ce.js';
8
+ import 'rxjs';
9
+ import '../../node_modules/.pnpm/@signe_sync@2.8.2/node_modules/@signe/sync/dist/client/index.js';
10
+ import '../../Sound.js';
11
+ import 'pixi.js';
12
+ import '@canvasengine/presets';
13
+ import '../../Resource.js';
14
+
15
+ function component($$props) {
16
+ useProps($$props);
17
+ const defineProps = useDefineProps($$props);
18
+ var _a = defineProps(), width = _a.width, height = _a.height, children = _a.children, color = _a.color, top = _a.top, left = _a.left;
19
+ var engine = inject(RpgClientEngine);
20
+ var child = children[0];
21
+ var _color = computed(function () { var _a; return ((_a = engine.globalConfig.gui) === null || _a === void 0 ? void 0 : _a.windowColor) || (color === null || color === void 0 ? void 0 : color()) || "#1a1a2e"; });
22
+ let $this = h(Container, { positionType: 'absolute', top: top, left: left }, h(Container, { anchor: [0.5, 0.5] }, [h(Rect, { width, height, color: _color }), h(Container, { attach: child })]));
23
+ return $this
24
+ }
25
+
26
+ export { component as default };
27
+ //# sourceMappingURL=box.ce.js.map