jaml-ui 6.0.1 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/motely.js CHANGED
@@ -1,4 +1,5 @@
1
- import { MotelyItemEdition as m, MotelyItemSeal as n, MotelyItemEnhancement as l, MotelyStandardcardRank as o, MotelyStandardcardSuit as c, MotelyItemTypeCategory as k } from "motely-wasm";
1
+ import { MotelyItemEdition as m, MotelyItemSeal as n, MotelyItemEnhancement as l, MotelyStandardcardRank as o, MotelyStandardcardSuit as d, MotelyItemTypeCategory as k } from "motely-wasm";
2
+ import { resolveJamlAssetUrl as v } from "./assets.js";
2
3
  const e = Object.freeze({
3
4
  4096: Object.freeze({ value: 4096, enumName: "TwoOfClubs", displayName: "2 of Clubs", category: "Standardcard" }),
4
5
  4097: Object.freeze({ value: 4097, enumName: "ThreeOfClubs", displayName: "3 of Clubs", category: "Standardcard" }),
@@ -523,26 +524,301 @@ Object.freeze({
523
524
  Yorick: e[23554],
524
525
  ZanyJoker: e[20486]
525
526
  });
526
- const N = {
527
+ const S = /* @__PURE__ */ new Map([
528
+ [4096, 65538],
529
+ [4097, 65794],
530
+ [4098, 66050],
531
+ [4099, 66306],
532
+ [4100, 66562],
533
+ [4101, 66818],
534
+ [4102, 67074],
535
+ [4103, 67330],
536
+ [4104, 67586],
537
+ [4105, 67842],
538
+ [4106, 68098],
539
+ [4107, 68354],
540
+ [4108, 68610],
541
+ [4112, 131074],
542
+ [4113, 131330],
543
+ [4114, 131586],
544
+ [4115, 131842],
545
+ [4116, 132098],
546
+ [4117, 132354],
547
+ [4118, 132610],
548
+ [4119, 132866],
549
+ [4120, 133122],
550
+ [4121, 133378],
551
+ [4122, 133634],
552
+ [4123, 133890],
553
+ [4124, 134146],
554
+ [4128, 2],
555
+ [4129, 258],
556
+ [4130, 514],
557
+ [4131, 770],
558
+ [4132, 1026],
559
+ [4133, 1282],
560
+ [4134, 1538],
561
+ [4135, 1794],
562
+ [4136, 2050],
563
+ [4137, 2306],
564
+ [4138, 2562],
565
+ [4139, 2818],
566
+ [4140, 3074],
567
+ [4144, 196610],
568
+ [4145, 196866],
569
+ [4146, 197122],
570
+ [4147, 197378],
571
+ [4148, 197634],
572
+ [4149, 197890],
573
+ [4150, 198146],
574
+ [4151, 198402],
575
+ [4152, 198658],
576
+ [4153, 198914],
577
+ [4154, 199170],
578
+ [4155, 199426],
579
+ [4156, 199682],
580
+ [8192, 262145],
581
+ [8193, 262401],
582
+ [8194, 262657],
583
+ [8195, 262913],
584
+ [8196, 263169],
585
+ [8197, 263425],
586
+ [8198, 263681],
587
+ [8199, 263937],
588
+ [8200, 264193],
589
+ [8201, 264449],
590
+ [8202, 327681],
591
+ [8203, 327937],
592
+ [8204, 328193],
593
+ [8205, 328449],
594
+ [8206, 328705],
595
+ [8207, 328961],
596
+ [8208, 131585],
597
+ [8209, 198913],
598
+ [12288, 1],
599
+ [12289, 257],
600
+ [12290, 513],
601
+ [12291, 769],
602
+ [12292, 1025],
603
+ [12293, 1281],
604
+ [12294, 1537],
605
+ [12295, 1793],
606
+ [12296, 2049],
607
+ [12297, 2305],
608
+ [12298, 65537],
609
+ [12299, 65793],
610
+ [12300, 66049],
611
+ [12301, 66305],
612
+ [12302, 66561],
613
+ [12303, 66817],
614
+ [12304, 67073],
615
+ [12305, 67329],
616
+ [12306, 67585],
617
+ [12307, 67841],
618
+ [12308, 131073],
619
+ [12309, 131329],
620
+ [16384, 196609],
621
+ [16385, 196865],
622
+ [16386, 197121],
623
+ [16387, 197377],
624
+ [16388, 197633],
625
+ [16389, 197889],
626
+ [16390, 198145],
627
+ [16391, 198401],
628
+ [16392, 198657],
629
+ [16393, 133377],
630
+ [16394, 133121],
631
+ [16395, 131841],
632
+ [20480, 0],
633
+ [20481, 67072],
634
+ [20482, 67328],
635
+ [20483, 67584],
636
+ [20484, 67840],
637
+ [20485, 512],
638
+ [20486, 768],
639
+ [20487, 1024],
640
+ [20488, 1280],
641
+ [20489, 1536],
642
+ [20490, 917504],
643
+ [20491, 917760],
644
+ [20492, 918016],
645
+ [20493, 918272],
646
+ [20494, 918528],
647
+ [20495, 1792],
648
+ [20496, 66816],
649
+ [20497, 131328],
650
+ [20498, 131584],
651
+ [20499, 327680],
652
+ [20500, 132608],
653
+ [20501, 133120],
654
+ [20502, 256],
655
+ [20503, 197120],
656
+ [20504, 197376],
657
+ [20505, 197632],
658
+ [20506, 395008],
659
+ [20507, 198656],
660
+ [20508, 198912],
661
+ [20509, 393984],
662
+ [20510, 262400],
663
+ [20511, 262656],
664
+ [20512, 393472],
665
+ [20513, 655360],
666
+ [20514, 656128],
667
+ [20515, 656384],
668
+ [20516, 656896],
669
+ [20517, 657152],
670
+ [20518, 721152],
671
+ [20519, 721408],
672
+ [20520, 721664],
673
+ [20521, 721920],
674
+ [20522, 722176],
675
+ [20523, 722688],
676
+ [20524, 723200],
677
+ [20525, 786688],
678
+ [20526, 852480],
679
+ [20527, 853504],
680
+ [20528, 853760],
681
+ [20529, 854272],
682
+ [20530, 329472],
683
+ [20531, 65536],
684
+ [20532, 65792],
685
+ [20533, 133376],
686
+ [20534, 983296],
687
+ [20535, 985088],
688
+ [20536, 984576],
689
+ [20537, 197888],
690
+ [20538, 329984],
691
+ [20539, 395520],
692
+ [20540, 393728],
693
+ [21504, 328192],
694
+ [21505, 394752],
695
+ [21506, 66560],
696
+ [21507, 328960],
697
+ [21508, 131840],
698
+ [21509, 132096],
699
+ [21510, 459776],
700
+ [21511, 327936],
701
+ [21512, 132864],
702
+ [21513, 132352],
703
+ [21514, 198144],
704
+ [21515, 328448],
705
+ [21516, 655616],
706
+ [21517, 655872],
707
+ [21518, 657408],
708
+ [21519, 657664],
709
+ [21520, 720896],
710
+ [21521, 722432],
711
+ [21522, 722944],
712
+ [21523, 786432],
713
+ [21524, 786944],
714
+ [21525, 787200],
715
+ [21526, 787456],
716
+ [21527, 788224],
717
+ [21528, 788480],
718
+ [21529, 851968],
719
+ [21530, 852224],
720
+ [21531, 852736],
721
+ [21532, 852992],
722
+ [21533, 853248],
723
+ [21534, 854016],
724
+ [21535, 2304],
725
+ [21536, 918784],
726
+ [21537, 919296],
727
+ [21538, 919552],
728
+ [21539, 919808],
729
+ [21540, 983040],
730
+ [21541, 984064],
731
+ [21542, 983552],
732
+ [21543, 983808],
733
+ [21544, 985344],
734
+ [21545, 262912],
735
+ [21546, 66048],
736
+ [21547, 66304],
737
+ [21548, 131072],
738
+ [21549, 526336],
739
+ [21550, 394240],
740
+ [21551, 460032],
741
+ [21552, 461056],
742
+ [21553, 524288],
743
+ [21554, 524544],
744
+ [21555, 524800],
745
+ [21556, 196864],
746
+ [21557, 329216],
747
+ [21558, 393216],
748
+ [21559, 2048],
749
+ [21560, 394496],
750
+ [21561, 460288],
751
+ [21562, 263168],
752
+ [21563, 328704],
753
+ [21564, 460800],
754
+ [21565, 198400],
755
+ [21566, 459264],
756
+ [21567, 526592],
757
+ [22528, 656640],
758
+ [22529, 787712],
759
+ [22530, 787968],
760
+ [22531, 788736],
761
+ [22532, 919040],
762
+ [22533, 984832],
763
+ [22534, 984320],
764
+ [22535, 196608],
765
+ [22536, 262144],
766
+ [22537, 329728],
767
+ [22538, 263424],
768
+ [22539, 263680],
769
+ [22540, 263936],
770
+ [22541, 264192],
771
+ [22542, 264448],
772
+ [22543, 395264],
773
+ [22544, 459008],
774
+ [22545, 460544],
775
+ [22546, 458752],
776
+ [22547, 459520],
777
+ [23552, 525056],
778
+ [23553, 525312],
779
+ [23554, 525568],
780
+ [23555, 525824],
781
+ [23556, 526080]
782
+ ]), J = ["jokers", "tarots", "deck"], j = [10, 10, 13], z = [16, 6, 4];
783
+ function h(a) {
784
+ return { sheet: a & 255, x: a >>> 8 & 255, y: a >>> 16 & 255 };
785
+ }
786
+ function T(a) {
787
+ const t = S.get(a);
788
+ if (t === void 0) return null;
789
+ const { sheet: r, x: c, y } = h(t), u = J[r];
790
+ return u ? {
791
+ atlasPath: v(u),
792
+ gridCol: c,
793
+ gridRow: y,
794
+ gridCols: j[r] ?? 0,
795
+ gridRows: z[r] ?? 0
796
+ } : null;
797
+ }
798
+ function L(a) {
799
+ const t = typeof a == "number" ? a : a.type;
800
+ return T(t);
801
+ }
802
+ const O = {
527
803
  Standardcard: "playing",
528
804
  SpectralCard: "spectral",
529
805
  TarotCard: "tarot",
530
806
  PlanetCard: "planet",
531
807
  Joker: "joker",
532
808
  Invalid: "unknown"
533
- }, v = {
809
+ }, C = {
534
810
  [m.None]: "Base",
535
811
  [m.Foil]: "Foil",
536
812
  [m.Holographic]: "Holographic",
537
813
  [m.Polychrome]: "Polychrome",
538
814
  [m.Negative]: "Negative"
539
- }, J = {
815
+ }, D = {
540
816
  [n.None]: "None",
541
817
  [n.Gold]: "Gold",
542
818
  [n.Red]: "Red",
543
819
  [n.Blue]: "Blue",
544
820
  [n.Purple]: "Purple"
545
- }, S = {
821
+ }, H = {
546
822
  [l.None]: "None",
547
823
  [l.Bonus]: "Bonus",
548
824
  [l.Mult]: "Mult",
@@ -552,7 +828,7 @@ const N = {
552
828
  [l.Stone]: "Stone",
553
829
  [l.Gold]: "Gold",
554
830
  [l.Lucky]: "Lucky"
555
- }, j = {
831
+ }, M = {
556
832
  [o.Two]: "2",
557
833
  [o.Three]: "3",
558
834
  [o.Four]: "4",
@@ -566,102 +842,102 @@ const N = {
566
842
  [o.Queen]: "Queen",
567
843
  [o.King]: "King",
568
844
  [o.Ace]: "Ace"
569
- }, z = {
570
- [c.Clubs]: "Clubs",
571
- [c.Diamonds]: "Diamonds",
572
- [c.Hearts]: "Hearts",
573
- [c.Spades]: "Spades"
845
+ }, B = {
846
+ [d.Clubs]: "Clubs",
847
+ [d.Diamonds]: "Diamonds",
848
+ [d.Hearts]: "Hearts",
849
+ [d.Spades]: "Spades"
574
850
  };
575
- function u(a) {
851
+ function s(a) {
576
852
  return e[a];
577
853
  }
578
- function f(a) {
854
+ function p(a) {
579
855
  return a.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2");
580
856
  }
581
- function O(a) {
857
+ function g(a) {
582
858
  return a == null ? null : typeof a == "number" ? Number.isFinite(a) ? a : null : a.type ?? a.value ?? null;
583
859
  }
584
- function d(a) {
860
+ function i(a) {
585
861
  if (a != null && typeof a == "object" && a.type != null) return a.type;
586
- const t = O(a);
862
+ const t = g(a);
587
863
  return t !== null ? t & 65535 : null;
588
864
  }
589
- function p(a) {
865
+ function b(a) {
590
866
  var r;
591
- const t = d(a);
592
- return t === null ? "Unknown" : ((r = u(t)) == null ? void 0 : r.enumName) ?? `item#${t}`;
867
+ const t = i(a);
868
+ return t === null ? "Unknown" : ((r = s(t)) == null ? void 0 : r.enumName) ?? `item#${t}`;
593
869
  }
594
- function h(a) {
870
+ function E(a) {
595
871
  var r;
596
- const t = (r = u(a)) == null ? void 0 : r.category;
597
- return t ? N[t] ?? "unknown" : "unknown";
872
+ const t = (r = s(a)) == null ? void 0 : r.category;
873
+ return t ? O[t] ?? "unknown" : "unknown";
598
874
  }
599
- function y(a) {
875
+ function f(a) {
600
876
  if (a != null && typeof a == "object" && a.typeCategory != null) {
601
877
  const r = k[a.typeCategory];
602
- if (r) return N[r] ?? "unknown";
878
+ if (r) return O[r] ?? "unknown";
603
879
  }
604
- const t = d(a);
605
- return t === null ? "unknown" : h(t);
880
+ const t = i(a);
881
+ return t === null ? "unknown" : E(t);
606
882
  }
607
- function E(a) {
883
+ function W(a) {
608
884
  var r;
609
- const t = d(a);
610
- return t === null ? "Unknown" : ((r = u(t)) == null ? void 0 : r.displayName) ?? f(p(a));
885
+ const t = i(a);
886
+ return t === null ? "Unknown" : ((r = s(t)) == null ? void 0 : r.displayName) ?? p(b(a));
611
887
  }
612
- function i(a, t) {
613
- const r = O(a);
888
+ function N(a, t) {
889
+ const r = g(a);
614
890
  return r === null ? !1 : (r & 1 << t) !== 0;
615
891
  }
616
- function T(a) {
892
+ function F(a) {
617
893
  if (a == null) return null;
618
894
  const t = typeof a == "number" ? a >>> 23 & 7 : a.edition;
619
- return t == null || t === m.None ? null : v[t];
895
+ return t == null || t === m.None ? null : C[t];
620
896
  }
621
- function C(a) {
897
+ function A(a) {
622
898
  if (a == null) return null;
623
899
  const t = typeof a == "number" ? a >>> 16 & 7 : a.seal;
624
- return t == null || t === n.None ? null : J[t];
900
+ return t == null || t === n.None ? null : D[t];
625
901
  }
626
- function D(a) {
902
+ function P(a) {
627
903
  if (a == null) return null;
628
904
  const t = typeof a == "number" ? a >>> 19 & 15 : a.enhancement;
629
- return t == null || t === l.None ? null : S[t] ?? null;
905
+ return t == null || t === l.None ? null : H[t] ?? null;
630
906
  }
631
- function H(a) {
632
- if (a == null || y(a) !== "playing") return null;
907
+ function R(a) {
908
+ if (a == null || f(a) !== "playing") return null;
633
909
  const r = typeof a == "number" ? a & 15 : a.standardcardRank ?? a.rank;
634
- return r == null ? null : j[r] ?? null;
910
+ return r == null ? null : M[r] ?? null;
635
911
  }
636
- function M(a) {
637
- if (a == null || y(a) !== "playing") return null;
912
+ function I(a) {
913
+ if (a == null || f(a) !== "playing") return null;
638
914
  const r = typeof a == "number" ? a >>> 4 & 3 : a.standardcardSuit ?? a.suit;
639
- return r == null ? null : z[r] ?? null;
915
+ return r == null ? null : B[r] ?? null;
640
916
  }
641
- function A(a) {
642
- return p(a);
917
+ function K(a) {
918
+ return b(a);
643
919
  }
644
- function B(a) {
645
- const t = d(a);
920
+ function w(a) {
921
+ const t = i(a);
646
922
  if (t === null) return null;
647
- const r = u(t), s = (r == null ? void 0 : r.enumName) ?? `Unknown_${t}`, g = y(a), b = (r == null ? void 0 : r.displayName) ?? f(s);
923
+ const r = s(t), c = (r == null ? void 0 : r.enumName) ?? `Unknown_${t}`, y = f(a), u = (r == null ? void 0 : r.displayName) ?? p(c);
648
924
  return {
649
925
  itemType: t,
650
- enumKey: s,
651
- displayName: b,
652
- category: g,
653
- edition: T(a),
654
- seal: C(a),
655
- enhancement: D(a),
656
- rank: H(a),
657
- suit: M(a),
658
- isEternal: typeof a == "number" ? (a >>> 30 & 1) !== 0 : (a == null ? void 0 : a.isEternal) ?? i(a, 30),
659
- isPerishable: typeof a == "number" ? (a >>> 31 & 1) !== 0 : (a == null ? void 0 : a.isPerishable) ?? i(a, 31),
660
- isRental: typeof a == "number" ? (a >>> 29 & 1) !== 0 : (a == null ? void 0 : a.isRental) ?? i(a, 29)
926
+ enumKey: c,
927
+ displayName: u,
928
+ category: y,
929
+ edition: F(a),
930
+ seal: A(a),
931
+ enhancement: P(a),
932
+ rank: R(a),
933
+ suit: I(a),
934
+ isEternal: typeof a == "number" ? (a >>> 30 & 1) !== 0 : (a == null ? void 0 : a.isEternal) ?? N(a, 30),
935
+ isPerishable: typeof a == "number" ? (a >>> 31 & 1) !== 0 : (a == null ? void 0 : a.isPerishable) ?? N(a, 31),
936
+ isRental: typeof a == "number" ? (a >>> 29 & 1) !== 0 : (a == null ? void 0 : a.isRental) ?? N(a, 29)
661
937
  };
662
938
  }
663
- function P(a, t) {
664
- const r = B(a);
939
+ function Q(a, t) {
940
+ const r = w(a);
665
941
  return r ? {
666
942
  type: r.category === "joker" ? "joker" : r.category === "playing" ? "playing" : "consumable",
667
943
  card: {
@@ -679,18 +955,21 @@ function P(a, t) {
679
955
  } : null;
680
956
  }
681
957
  export {
682
- B as decodeMotelyItem,
683
- A as decodeMotelyItemName,
684
- P as decodeMotelyItemToJamlCard,
685
- h as motelyItemCategory,
686
- E as motelyItemDisplayName,
687
- T as motelyItemEditionName,
688
- D as motelyItemEnhancementName,
689
- y as motelyItemRenderCategory,
690
- C as motelyItemSealName,
691
- p as motelyItemTypeName,
692
- H as motelyStandardcardRankName,
693
- M as motelyStandardcardSuitName,
694
- d as resolveMotelyItemType
958
+ w as decodeMotelyItem,
959
+ K as decodeMotelyItemName,
960
+ Q as decodeMotelyItemToJamlCard,
961
+ E as motelyItemCategory,
962
+ W as motelyItemDisplayName,
963
+ F as motelyItemEditionName,
964
+ P as motelyItemEnhancementName,
965
+ f as motelyItemRenderCategory,
966
+ A as motelyItemSealName,
967
+ L as motelyItemToSprite,
968
+ b as motelyItemTypeName,
969
+ T as motelyItemTypeToSprite,
970
+ R as motelyStandardcardRankName,
971
+ I as motelyStandardcardSuitName,
972
+ i as resolveMotelyItemType,
973
+ h as unpackSpriteCell
695
974
  };
696
975
  //# sourceMappingURL=motely.js.map