@almadar/ui 5.53.0 → 5.54.0

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.
@@ -31538,12 +31538,18 @@ function PlatformerCanvas({
31538
31538
  camX = Math.max(0, Math.min(px - cw / 2, ww - cw));
31539
31539
  camY = Math.max(0, Math.min(py - ch / 2 - 50, wh - ch));
31540
31540
  }
31541
- if (plats.length !== lastPlatCountRef.current) {
31541
+ const shouldDiag = plats.length !== lastPlatCountRef.current;
31542
+ if (shouldDiag) {
31542
31543
  lastPlatCountRef.current = plats.length;
31543
31544
  canvasLog.debug("draw:platforms", {
31544
31545
  platformCount: plats.length,
31545
31546
  camX,
31546
31547
  camY,
31548
+ plat0: JSON.stringify(plats[0]),
31549
+ plat2: JSON.stringify(plats[2]),
31550
+ tSpritesType: tSprites ? tSprites instanceof Map ? "Map" : typeof tSprites : "none",
31551
+ canvasW: canvas.width,
31552
+ canvasH: canvas.height,
31547
31553
  player: { x: px, y: py },
31548
31554
  worldWidth: ww,
31549
31555
  canvasWidth: cw,
@@ -31584,6 +31590,19 @@ function PlatformerCanvas({
31584
31590
  const platType = plat.type ?? "ground";
31585
31591
  const spriteUrl = tSprites?.[platType];
31586
31592
  const tileImg = spriteUrl ? loadImage(spriteUrl) : null;
31593
+ if (shouldDiag) {
31594
+ canvasLog.debug("plat:draw", {
31595
+ platType,
31596
+ platX,
31597
+ platY,
31598
+ w: plat.width,
31599
+ h: plat.height,
31600
+ branch: tileImg ? "tile" : "color",
31601
+ natW: tileImg?.naturalWidth,
31602
+ natH: tileImg?.naturalHeight,
31603
+ spriteUrl: spriteUrl ?? null
31604
+ });
31605
+ }
31587
31606
  if (tileImg) {
31588
31607
  const tileW = tileImg.naturalWidth;
31589
31608
  const tileH = tileImg.naturalHeight;
package/dist/avl/index.js CHANGED
@@ -31491,12 +31491,18 @@ function PlatformerCanvas({
31491
31491
  camX = Math.max(0, Math.min(px - cw / 2, ww - cw));
31492
31492
  camY = Math.max(0, Math.min(py - ch / 2 - 50, wh - ch));
31493
31493
  }
31494
- if (plats.length !== lastPlatCountRef.current) {
31494
+ const shouldDiag = plats.length !== lastPlatCountRef.current;
31495
+ if (shouldDiag) {
31495
31496
  lastPlatCountRef.current = plats.length;
31496
31497
  canvasLog.debug("draw:platforms", {
31497
31498
  platformCount: plats.length,
31498
31499
  camX,
31499
31500
  camY,
31501
+ plat0: JSON.stringify(plats[0]),
31502
+ plat2: JSON.stringify(plats[2]),
31503
+ tSpritesType: tSprites ? tSprites instanceof Map ? "Map" : typeof tSprites : "none",
31504
+ canvasW: canvas.width,
31505
+ canvasH: canvas.height,
31500
31506
  player: { x: px, y: py },
31501
31507
  worldWidth: ww,
31502
31508
  canvasWidth: cw,
@@ -31537,6 +31543,19 @@ function PlatformerCanvas({
31537
31543
  const platType = plat.type ?? "ground";
31538
31544
  const spriteUrl = tSprites?.[platType];
31539
31545
  const tileImg = spriteUrl ? loadImage(spriteUrl) : null;
31546
+ if (shouldDiag) {
31547
+ canvasLog.debug("plat:draw", {
31548
+ platType,
31549
+ platX,
31550
+ platY,
31551
+ w: plat.width,
31552
+ h: plat.height,
31553
+ branch: tileImg ? "tile" : "color",
31554
+ natW: tileImg?.naturalWidth,
31555
+ natH: tileImg?.naturalHeight,
31556
+ spriteUrl: spriteUrl ?? null
31557
+ });
31558
+ }
31540
31559
  if (tileImg) {
31541
31560
  const tileW = tileImg.naturalWidth;
31542
31561
  const tileH = tileImg.naturalHeight;
@@ -29334,12 +29334,18 @@ function PlatformerCanvas({
29334
29334
  camX = Math.max(0, Math.min(px - cw / 2, ww - cw));
29335
29335
  camY = Math.max(0, Math.min(py - ch / 2 - 50, wh - ch));
29336
29336
  }
29337
- if (plats.length !== lastPlatCountRef.current) {
29337
+ const shouldDiag = plats.length !== lastPlatCountRef.current;
29338
+ if (shouldDiag) {
29338
29339
  lastPlatCountRef.current = plats.length;
29339
29340
  canvasLog.debug("draw:platforms", {
29340
29341
  platformCount: plats.length,
29341
29342
  camX,
29342
29343
  camY,
29344
+ plat0: JSON.stringify(plats[0]),
29345
+ plat2: JSON.stringify(plats[2]),
29346
+ tSpritesType: tSprites ? tSprites instanceof Map ? "Map" : typeof tSprites : "none",
29347
+ canvasW: canvas.width,
29348
+ canvasH: canvas.height,
29343
29349
  player: { x: px, y: py },
29344
29350
  worldWidth: ww,
29345
29351
  canvasWidth: cw,
@@ -29380,6 +29386,19 @@ function PlatformerCanvas({
29380
29386
  const platType = plat.type ?? "ground";
29381
29387
  const spriteUrl = tSprites?.[platType];
29382
29388
  const tileImg = spriteUrl ? loadImage(spriteUrl) : null;
29389
+ if (shouldDiag) {
29390
+ canvasLog.debug("plat:draw", {
29391
+ platType,
29392
+ platX,
29393
+ platY,
29394
+ w: plat.width,
29395
+ h: plat.height,
29396
+ branch: tileImg ? "tile" : "color",
29397
+ natW: tileImg?.naturalWidth,
29398
+ natH: tileImg?.naturalHeight,
29399
+ spriteUrl: spriteUrl ?? null
29400
+ });
29401
+ }
29383
29402
  if (tileImg) {
29384
29403
  const tileW = tileImg.naturalWidth;
29385
29404
  const tileH = tileImg.naturalHeight;
@@ -29288,12 +29288,18 @@ function PlatformerCanvas({
29288
29288
  camX = Math.max(0, Math.min(px - cw / 2, ww - cw));
29289
29289
  camY = Math.max(0, Math.min(py - ch / 2 - 50, wh - ch));
29290
29290
  }
29291
- if (plats.length !== lastPlatCountRef.current) {
29291
+ const shouldDiag = plats.length !== lastPlatCountRef.current;
29292
+ if (shouldDiag) {
29292
29293
  lastPlatCountRef.current = plats.length;
29293
29294
  canvasLog.debug("draw:platforms", {
29294
29295
  platformCount: plats.length,
29295
29296
  camX,
29296
29297
  camY,
29298
+ plat0: JSON.stringify(plats[0]),
29299
+ plat2: JSON.stringify(plats[2]),
29300
+ tSpritesType: tSprites ? tSprites instanceof Map ? "Map" : typeof tSprites : "none",
29301
+ canvasW: canvas.width,
29302
+ canvasH: canvas.height,
29297
29303
  player: { x: px, y: py },
29298
29304
  worldWidth: ww,
29299
29305
  canvasWidth: cw,
@@ -29334,6 +29340,19 @@ function PlatformerCanvas({
29334
29340
  const platType = plat.type ?? "ground";
29335
29341
  const spriteUrl = tSprites?.[platType];
29336
29342
  const tileImg = spriteUrl ? loadImage(spriteUrl) : null;
29343
+ if (shouldDiag) {
29344
+ canvasLog.debug("plat:draw", {
29345
+ platType,
29346
+ platX,
29347
+ platY,
29348
+ w: plat.width,
29349
+ h: plat.height,
29350
+ branch: tileImg ? "tile" : "color",
29351
+ natW: tileImg?.naturalWidth,
29352
+ natH: tileImg?.naturalHeight,
29353
+ spriteUrl: spriteUrl ?? null
29354
+ });
29355
+ }
29337
29356
  if (tileImg) {
29338
29357
  const tileW = tileImg.naturalWidth;
29339
29358
  const tileH = tileImg.naturalHeight;
@@ -28930,12 +28930,18 @@ function PlatformerCanvas({
28930
28930
  camX = Math.max(0, Math.min(px - cw / 2, ww - cw));
28931
28931
  camY = Math.max(0, Math.min(py - ch / 2 - 50, wh - ch));
28932
28932
  }
28933
- if (plats.length !== lastPlatCountRef.current) {
28933
+ const shouldDiag = plats.length !== lastPlatCountRef.current;
28934
+ if (shouldDiag) {
28934
28935
  lastPlatCountRef.current = plats.length;
28935
28936
  canvasLog.debug("draw:platforms", {
28936
28937
  platformCount: plats.length,
28937
28938
  camX,
28938
28939
  camY,
28940
+ plat0: JSON.stringify(plats[0]),
28941
+ plat2: JSON.stringify(plats[2]),
28942
+ tSpritesType: tSprites ? tSprites instanceof Map ? "Map" : typeof tSprites : "none",
28943
+ canvasW: canvas.width,
28944
+ canvasH: canvas.height,
28939
28945
  player: { x: px, y: py },
28940
28946
  worldWidth: ww,
28941
28947
  canvasWidth: cw,
@@ -28976,6 +28982,19 @@ function PlatformerCanvas({
28976
28982
  const platType = plat.type ?? "ground";
28977
28983
  const spriteUrl = tSprites?.[platType];
28978
28984
  const tileImg = spriteUrl ? loadImage(spriteUrl) : null;
28985
+ if (shouldDiag) {
28986
+ canvasLog.debug("plat:draw", {
28987
+ platType,
28988
+ platX,
28989
+ platY,
28990
+ w: plat.width,
28991
+ h: plat.height,
28992
+ branch: tileImg ? "tile" : "color",
28993
+ natW: tileImg?.naturalWidth,
28994
+ natH: tileImg?.naturalHeight,
28995
+ spriteUrl: spriteUrl ?? null
28996
+ });
28997
+ }
28979
28998
  if (tileImg) {
28980
28999
  const tileW = tileImg.naturalWidth;
28981
29000
  const tileH = tileImg.naturalHeight;
@@ -28883,12 +28883,18 @@ function PlatformerCanvas({
28883
28883
  camX = Math.max(0, Math.min(px - cw / 2, ww - cw));
28884
28884
  camY = Math.max(0, Math.min(py - ch / 2 - 50, wh - ch));
28885
28885
  }
28886
- if (plats.length !== lastPlatCountRef.current) {
28886
+ const shouldDiag = plats.length !== lastPlatCountRef.current;
28887
+ if (shouldDiag) {
28887
28888
  lastPlatCountRef.current = plats.length;
28888
28889
  canvasLog.debug("draw:platforms", {
28889
28890
  platformCount: plats.length,
28890
28891
  camX,
28891
28892
  camY,
28893
+ plat0: JSON.stringify(plats[0]),
28894
+ plat2: JSON.stringify(plats[2]),
28895
+ tSpritesType: tSprites ? tSprites instanceof Map ? "Map" : typeof tSprites : "none",
28896
+ canvasW: canvas.width,
28897
+ canvasH: canvas.height,
28892
28898
  player: { x: px, y: py },
28893
28899
  worldWidth: ww,
28894
28900
  canvasWidth: cw,
@@ -28929,6 +28935,19 @@ function PlatformerCanvas({
28929
28935
  const platType = plat.type ?? "ground";
28930
28936
  const spriteUrl = tSprites?.[platType];
28931
28937
  const tileImg = spriteUrl ? loadImage(spriteUrl) : null;
28938
+ if (shouldDiag) {
28939
+ canvasLog.debug("plat:draw", {
28940
+ platType,
28941
+ platX,
28942
+ platY,
28943
+ w: plat.width,
28944
+ h: plat.height,
28945
+ branch: tileImg ? "tile" : "color",
28946
+ natW: tileImg?.naturalWidth,
28947
+ natH: tileImg?.naturalHeight,
28948
+ spriteUrl: spriteUrl ?? null
28949
+ });
28950
+ }
28932
28951
  if (tileImg) {
28933
28952
  const tileW = tileImg.naturalWidth;
28934
28953
  const tileH = tileImg.naturalHeight;
@@ -28628,12 +28628,18 @@ function PlatformerCanvas({
28628
28628
  camX = Math.max(0, Math.min(px - cw / 2, ww - cw));
28629
28629
  camY = Math.max(0, Math.min(py - ch / 2 - 50, wh - ch));
28630
28630
  }
28631
- if (plats.length !== lastPlatCountRef.current) {
28631
+ const shouldDiag = plats.length !== lastPlatCountRef.current;
28632
+ if (shouldDiag) {
28632
28633
  lastPlatCountRef.current = plats.length;
28633
28634
  canvasLog.debug("draw:platforms", {
28634
28635
  platformCount: plats.length,
28635
28636
  camX,
28636
28637
  camY,
28638
+ plat0: JSON.stringify(plats[0]),
28639
+ plat2: JSON.stringify(plats[2]),
28640
+ tSpritesType: tSprites ? tSprites instanceof Map ? "Map" : typeof tSprites : "none",
28641
+ canvasW: canvas.width,
28642
+ canvasH: canvas.height,
28637
28643
  player: { x: px, y: py },
28638
28644
  worldWidth: ww,
28639
28645
  canvasWidth: cw,
@@ -28674,6 +28680,19 @@ function PlatformerCanvas({
28674
28680
  const platType = plat.type ?? "ground";
28675
28681
  const spriteUrl = tSprites?.[platType];
28676
28682
  const tileImg = spriteUrl ? loadImage(spriteUrl) : null;
28683
+ if (shouldDiag) {
28684
+ canvasLog.debug("plat:draw", {
28685
+ platType,
28686
+ platX,
28687
+ platY,
28688
+ w: plat.width,
28689
+ h: plat.height,
28690
+ branch: tileImg ? "tile" : "color",
28691
+ natW: tileImg?.naturalWidth,
28692
+ natH: tileImg?.naturalHeight,
28693
+ spriteUrl: spriteUrl ?? null
28694
+ });
28695
+ }
28677
28696
  if (tileImg) {
28678
28697
  const tileW = tileImg.naturalWidth;
28679
28698
  const tileH = tileImg.naturalHeight;
@@ -28581,12 +28581,18 @@ function PlatformerCanvas({
28581
28581
  camX = Math.max(0, Math.min(px - cw / 2, ww - cw));
28582
28582
  camY = Math.max(0, Math.min(py - ch / 2 - 50, wh - ch));
28583
28583
  }
28584
- if (plats.length !== lastPlatCountRef.current) {
28584
+ const shouldDiag = plats.length !== lastPlatCountRef.current;
28585
+ if (shouldDiag) {
28585
28586
  lastPlatCountRef.current = plats.length;
28586
28587
  canvasLog.debug("draw:platforms", {
28587
28588
  platformCount: plats.length,
28588
28589
  camX,
28589
28590
  camY,
28591
+ plat0: JSON.stringify(plats[0]),
28592
+ plat2: JSON.stringify(plats[2]),
28593
+ tSpritesType: tSprites ? tSprites instanceof Map ? "Map" : typeof tSprites : "none",
28594
+ canvasW: canvas.width,
28595
+ canvasH: canvas.height,
28590
28596
  player: { x: px, y: py },
28591
28597
  worldWidth: ww,
28592
28598
  canvasWidth: cw,
@@ -28627,6 +28633,19 @@ function PlatformerCanvas({
28627
28633
  const platType = plat.type ?? "ground";
28628
28634
  const spriteUrl = tSprites?.[platType];
28629
28635
  const tileImg = spriteUrl ? loadImage(spriteUrl) : null;
28636
+ if (shouldDiag) {
28637
+ canvasLog.debug("plat:draw", {
28638
+ platType,
28639
+ platX,
28640
+ platY,
28641
+ w: plat.width,
28642
+ h: plat.height,
28643
+ branch: tileImg ? "tile" : "color",
28644
+ natW: tileImg?.naturalWidth,
28645
+ natH: tileImg?.naturalHeight,
28646
+ spriteUrl: spriteUrl ?? null
28647
+ });
28648
+ }
28630
28649
  if (tileImg) {
28631
28650
  const tileW = tileImg.naturalWidth;
28632
28651
  const tileH = tileImg.naturalHeight;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "5.53.0",
3
+ "version": "5.54.0",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [