@almadar/ui 5.112.0 → 5.114.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.
- package/dist/avl/index.cjs +278 -1073
- package/dist/avl/index.js +273 -1068
- package/dist/{avl-schema-parser-DKRm-nyh.d.cts → avl-schema-parser-B8Onmfsu.d.cts} +2 -220
- package/dist/{avl-schema-parser-DKRm-nyh.d.ts → avl-schema-parser-B8Onmfsu.d.ts} +2 -220
- package/dist/{cn-BbPvQLHt.d.ts → cn-D3H9UzCW.d.cts} +2 -1
- package/dist/{cn-BbPvQLHt.d.cts → cn-Dm0VrLRG.d.ts} +2 -1
- package/dist/components/index.cjs +124 -685
- package/dist/components/index.d.cts +9 -4
- package/dist/components/index.d.ts +9 -4
- package/dist/components/index.js +123 -684
- package/dist/lib/drawable/three/index.cjs +52 -37
- package/dist/lib/drawable/three/index.d.cts +5 -3
- package/dist/lib/drawable/three/index.d.ts +5 -3
- package/dist/lib/drawable/three/index.js +52 -37
- package/dist/lib/index.d.cts +2 -1
- package/dist/lib/index.d.ts +2 -1
- package/dist/marketing/index.cjs +16 -637
- package/dist/marketing/index.js +16 -637
- package/dist/paintDispatch-BXJgISot.d.cts +223 -0
- package/dist/paintDispatch-BXJgISot.d.ts +223 -0
- package/dist/providers/index.cjs +124 -685
- package/dist/providers/index.js +123 -684
- package/dist/runtime/index.cjs +305 -1107
- package/dist/runtime/index.d.cts +11 -112
- package/dist/runtime/index.d.ts +11 -112
- package/dist/runtime/index.js +268 -1096
- package/package.json +3 -3
package/dist/providers/index.cjs
CHANGED
|
@@ -11,6 +11,7 @@ var reactDom = require('react-dom');
|
|
|
11
11
|
var hooks = require('@almadar/ui/hooks');
|
|
12
12
|
var context = require('@almadar/ui/context');
|
|
13
13
|
var evaluator = require('@almadar/evaluator');
|
|
14
|
+
var ui = require('@almadar/runtime/ui');
|
|
14
15
|
var reactRouterDom = require('react-router-dom');
|
|
15
16
|
var ELK = require('elkjs/lib/elk.bundled.js');
|
|
16
17
|
var SyntaxHighlighter = require('react-syntax-highlighter/dist/esm/prism-light.js');
|
|
@@ -585,41 +586,6 @@ function kebabToPascal(name) {
|
|
|
585
586
|
return part.charAt(0).toUpperCase() + part.slice(1);
|
|
586
587
|
}).join("");
|
|
587
588
|
}
|
|
588
|
-
function loadLib(key, importer) {
|
|
589
|
-
let p = libPromises.get(key);
|
|
590
|
-
if (!p) {
|
|
591
|
-
p = importer();
|
|
592
|
-
libPromises.set(key, p);
|
|
593
|
-
}
|
|
594
|
-
return p;
|
|
595
|
-
}
|
|
596
|
-
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
597
|
-
const Lazy = React83__namespace.default.lazy(async () => {
|
|
598
|
-
const lib = await loadLib(libKey, importer);
|
|
599
|
-
const Comp = pick(lib);
|
|
600
|
-
if (!Comp) {
|
|
601
|
-
warnFallback(fallbackName, family);
|
|
602
|
-
return { default: makeLucideAdapter(fallbackName, true) };
|
|
603
|
-
}
|
|
604
|
-
return { default: Comp };
|
|
605
|
-
});
|
|
606
|
-
const Wrapped = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
607
|
-
React83__namespace.default.Suspense,
|
|
608
|
-
{
|
|
609
|
-
fallback: /* @__PURE__ */ jsxRuntime.jsx(
|
|
610
|
-
"span",
|
|
611
|
-
{
|
|
612
|
-
"aria-hidden": true,
|
|
613
|
-
className: props.className,
|
|
614
|
-
style: { display: "inline-block", ...props.style }
|
|
615
|
-
}
|
|
616
|
-
),
|
|
617
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Lazy, { ...props })
|
|
618
|
-
}
|
|
619
|
-
);
|
|
620
|
-
Wrapped.displayName = `Lazy.${libKey}.${fallbackName}`;
|
|
621
|
-
return Wrapped;
|
|
622
|
-
}
|
|
623
589
|
function isComponentLike(v) {
|
|
624
590
|
return v != null && (typeof v === "function" || typeof v === "object");
|
|
625
591
|
}
|
|
@@ -633,146 +599,32 @@ function resolveLucide(name) {
|
|
|
633
599
|
if (isComponentLike(asIs)) return asIs;
|
|
634
600
|
return LucideIcons2__namespace.HelpCircle;
|
|
635
601
|
}
|
|
636
|
-
function
|
|
637
|
-
const target = phosphorAliases[name] ?? kebabToPascal(name);
|
|
638
|
-
return lazyFamilyIcon(
|
|
639
|
-
"phosphor",
|
|
640
|
-
() => import('@phosphor-icons/react'),
|
|
641
|
-
(lib) => {
|
|
642
|
-
const PhosphorComp = lib[target];
|
|
643
|
-
if (!PhosphorComp) return null;
|
|
644
|
-
const Component = PhosphorComp;
|
|
645
|
-
const Adapter = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
646
|
-
Component,
|
|
647
|
-
{
|
|
648
|
-
weight,
|
|
649
|
-
className: props.className,
|
|
650
|
-
style: props.style,
|
|
651
|
-
size: props.size ?? "1em"
|
|
652
|
-
}
|
|
653
|
-
);
|
|
654
|
-
Adapter.displayName = `Phosphor.${target}.${weight}`;
|
|
655
|
-
return Adapter;
|
|
656
|
-
},
|
|
657
|
-
name,
|
|
658
|
-
family
|
|
659
|
-
);
|
|
660
|
-
}
|
|
661
|
-
function resolveTabler(name, family) {
|
|
662
|
-
const suffix = tablerAliases[name] ?? kebabToPascal(name);
|
|
663
|
-
const target = `Icon${suffix}`;
|
|
664
|
-
return lazyFamilyIcon(
|
|
665
|
-
"tabler",
|
|
666
|
-
() => import('@tabler/icons-react'),
|
|
667
|
-
(lib) => {
|
|
668
|
-
const TablerComp = lib[target];
|
|
669
|
-
if (!TablerComp) return null;
|
|
670
|
-
const Component = TablerComp;
|
|
671
|
-
const Adapter = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
672
|
-
Component,
|
|
673
|
-
{
|
|
674
|
-
stroke: props.strokeWidth ?? 1.5,
|
|
675
|
-
className: props.className,
|
|
676
|
-
style: props.style,
|
|
677
|
-
size: props.size ?? 24
|
|
678
|
-
}
|
|
679
|
-
);
|
|
680
|
-
Adapter.displayName = `Tabler.${target}`;
|
|
681
|
-
return Adapter;
|
|
682
|
-
},
|
|
683
|
-
name,
|
|
684
|
-
family
|
|
685
|
-
);
|
|
686
|
-
}
|
|
687
|
-
function resolveFa(name, family) {
|
|
688
|
-
const suffix = faAliases[name] ?? kebabToPascal(name);
|
|
689
|
-
const target = `Fa${suffix}`;
|
|
690
|
-
return lazyFamilyIcon(
|
|
691
|
-
"fa",
|
|
692
|
-
() => import('react-icons/fa'),
|
|
693
|
-
(lib) => {
|
|
694
|
-
const FaComp = lib[target];
|
|
695
|
-
if (!FaComp) return null;
|
|
696
|
-
const Component = FaComp;
|
|
697
|
-
const Adapter = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
698
|
-
Component,
|
|
699
|
-
{
|
|
700
|
-
className: props.className,
|
|
701
|
-
style: props.style,
|
|
702
|
-
size: props.size ?? "1em"
|
|
703
|
-
}
|
|
704
|
-
);
|
|
705
|
-
Adapter.displayName = `Fa.${target}`;
|
|
706
|
-
return Adapter;
|
|
707
|
-
},
|
|
708
|
-
name,
|
|
709
|
-
family
|
|
710
|
-
);
|
|
711
|
-
}
|
|
712
|
-
function warnFallback(name, family) {
|
|
713
|
-
const key = `${family}::${name}`;
|
|
714
|
-
if (warned.has(key)) return;
|
|
715
|
-
warned.add(key);
|
|
716
|
-
if (typeof console !== "undefined") {
|
|
717
|
-
console.warn(
|
|
718
|
-
`[iconFamily] No '${name}' mapping in family '${family}'; falling back to lucide. Add an alias in lib/iconFamily.ts.`
|
|
719
|
-
);
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
function makeLucideAdapter(name, isFallback = false) {
|
|
602
|
+
function makeLucideAdapter(name) {
|
|
723
603
|
const LucideComp = resolveLucide(name);
|
|
724
|
-
const Adapter = (props) =>
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
}
|
|
735
|
-
);
|
|
736
|
-
};
|
|
737
|
-
Adapter.displayName = `Lucide.${name}${isFallback ? ".fallback" : ""}`;
|
|
604
|
+
const Adapter = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
605
|
+
LucideComp,
|
|
606
|
+
{
|
|
607
|
+
className: props.className,
|
|
608
|
+
strokeWidth: props.strokeWidth,
|
|
609
|
+
style: props.style,
|
|
610
|
+
size: props.size
|
|
611
|
+
}
|
|
612
|
+
);
|
|
613
|
+
Adapter.displayName = `Lucide.${name}`;
|
|
738
614
|
return Adapter;
|
|
739
615
|
}
|
|
740
|
-
function resolveIconForFamily(name,
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
// Non-lucide families resolve to a lazy, Suspense-wrapped component that
|
|
745
|
-
// dynamic-imports the library on first render and falls back to lucide
|
|
746
|
-
// internally when the family lacks the icon (see lazyFamilyIcon).
|
|
747
|
-
case "phosphor-outline":
|
|
748
|
-
return resolvePhosphor(name, "regular", family);
|
|
749
|
-
case "phosphor-fill":
|
|
750
|
-
return resolvePhosphor(name, "fill", family);
|
|
751
|
-
case "phosphor-duotone":
|
|
752
|
-
return resolvePhosphor(name, "duotone", family);
|
|
753
|
-
case "tabler":
|
|
754
|
-
return resolveTabler(name, family);
|
|
755
|
-
case "fa-solid":
|
|
756
|
-
return resolveFa(name, family);
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
var DEFAULT_FAMILY, VALID_FAMILIES, cachedFamily, listeners, observer, libPromises, lucideAliases, phosphorAliases, tablerAliases, faAliases, warned;
|
|
616
|
+
function resolveIconForFamily(name, _family) {
|
|
617
|
+
return makeLucideAdapter(name);
|
|
618
|
+
}
|
|
619
|
+
var DEFAULT_FAMILY, VALID_FAMILIES, cachedFamily, listeners, observer, lucideAliases;
|
|
760
620
|
var init_iconFamily = __esm({
|
|
761
621
|
"lib/iconFamily.tsx"() {
|
|
762
622
|
"use client";
|
|
763
623
|
DEFAULT_FAMILY = "lucide";
|
|
764
|
-
VALID_FAMILIES = [
|
|
765
|
-
"lucide",
|
|
766
|
-
"phosphor-outline",
|
|
767
|
-
"phosphor-fill",
|
|
768
|
-
"phosphor-duotone",
|
|
769
|
-
"tabler",
|
|
770
|
-
"fa-solid"
|
|
771
|
-
];
|
|
624
|
+
VALID_FAMILIES = [DEFAULT_FAMILY];
|
|
772
625
|
cachedFamily = null;
|
|
773
626
|
listeners = /* @__PURE__ */ new Set();
|
|
774
627
|
observer = null;
|
|
775
|
-
libPromises = /* @__PURE__ */ new Map();
|
|
776
628
|
lucideAliases = {
|
|
777
629
|
close: LucideIcons2__namespace.X,
|
|
778
630
|
trash: LucideIcons2__namespace.Trash2,
|
|
@@ -785,478 +637,6 @@ var init_iconFamily = __esm({
|
|
|
785
637
|
"sort-asc": LucideIcons2__namespace.ArrowUpNarrowWide,
|
|
786
638
|
"sort-desc": LucideIcons2__namespace.ArrowDownNarrowWide
|
|
787
639
|
};
|
|
788
|
-
phosphorAliases = {
|
|
789
|
-
// lucide name → phosphor PascalCase name
|
|
790
|
-
// Actions
|
|
791
|
-
plus: "Plus",
|
|
792
|
-
minus: "Minus",
|
|
793
|
-
x: "X",
|
|
794
|
-
check: "Check",
|
|
795
|
-
close: "X",
|
|
796
|
-
edit: "PencilSimple",
|
|
797
|
-
pencil: "PencilSimple",
|
|
798
|
-
trash: "Trash",
|
|
799
|
-
save: "FloppyDisk",
|
|
800
|
-
copy: "Copy",
|
|
801
|
-
share: "Share",
|
|
802
|
-
send: "PaperPlaneRight",
|
|
803
|
-
download: "DownloadSimple",
|
|
804
|
-
upload: "UploadSimple",
|
|
805
|
-
archive: "Archive",
|
|
806
|
-
refresh: "ArrowsClockwise",
|
|
807
|
-
loader: "CircleNotch",
|
|
808
|
-
link: "Link",
|
|
809
|
-
paperclip: "Paperclip",
|
|
810
|
-
// Navigation
|
|
811
|
-
"chevron-down": "CaretDown",
|
|
812
|
-
"chevron-up": "CaretUp",
|
|
813
|
-
"chevron-left": "CaretLeft",
|
|
814
|
-
"chevron-right": "CaretRight",
|
|
815
|
-
"arrow-up": "ArrowUp",
|
|
816
|
-
"arrow-down": "ArrowDown",
|
|
817
|
-
"arrow-left": "ArrowLeft",
|
|
818
|
-
"arrow-right": "ArrowRight",
|
|
819
|
-
menu: "List",
|
|
820
|
-
more: "DotsThree",
|
|
821
|
-
"more-vertical": "DotsThreeVertical",
|
|
822
|
-
"more-horizontal": "DotsThree",
|
|
823
|
-
external: "ArrowSquareOut",
|
|
824
|
-
"external-link": "ArrowSquareOut",
|
|
825
|
-
// Files
|
|
826
|
-
file: "File",
|
|
827
|
-
"file-text": "FileText",
|
|
828
|
-
"file-plus": "FilePlus",
|
|
829
|
-
"file-minus": "FileMinus",
|
|
830
|
-
folder: "Folder",
|
|
831
|
-
"folder-open": "FolderOpen",
|
|
832
|
-
document: "FileText",
|
|
833
|
-
// Charts
|
|
834
|
-
"bar-chart": "ChartBar",
|
|
835
|
-
"bar-chart-2": "ChartBar",
|
|
836
|
-
"bar-chart-3": "ChartBar",
|
|
837
|
-
"line-chart": "ChartLine",
|
|
838
|
-
"pie-chart": "ChartPie",
|
|
839
|
-
activity: "Pulse",
|
|
840
|
-
"trending-up": "TrendUp",
|
|
841
|
-
"trending-down": "TrendDown",
|
|
842
|
-
// Messages
|
|
843
|
-
message: "ChatCircle",
|
|
844
|
-
"message-circle": "ChatCircle",
|
|
845
|
-
"message-square": "ChatText",
|
|
846
|
-
"messages-square": "ChatsCircle",
|
|
847
|
-
comment: "ChatCircle",
|
|
848
|
-
comments: "ChatsCircle",
|
|
849
|
-
inbox: "Tray",
|
|
850
|
-
mail: "Envelope",
|
|
851
|
-
envelope: "Envelope",
|
|
852
|
-
// Status
|
|
853
|
-
"alert-circle": "WarningCircle",
|
|
854
|
-
"alert-triangle": "Warning",
|
|
855
|
-
"check-circle": "CheckCircle",
|
|
856
|
-
"x-circle": "XCircle",
|
|
857
|
-
info: "Info",
|
|
858
|
-
"help-circle": "Question",
|
|
859
|
-
"life-buoy": "Lifebuoy",
|
|
860
|
-
lifebuoy: "Lifebuoy",
|
|
861
|
-
warning: "Warning",
|
|
862
|
-
error: "WarningCircle",
|
|
863
|
-
// Media
|
|
864
|
-
image: "Image",
|
|
865
|
-
video: "VideoCamera",
|
|
866
|
-
film: "FilmStrip",
|
|
867
|
-
camera: "Camera",
|
|
868
|
-
music: "MusicNote",
|
|
869
|
-
play: "Play",
|
|
870
|
-
pause: "Pause",
|
|
871
|
-
stop: "Stop",
|
|
872
|
-
"skip-forward": "SkipForward",
|
|
873
|
-
"skip-back": "SkipBack",
|
|
874
|
-
volume: "SpeakerHigh",
|
|
875
|
-
"volume-2": "SpeakerHigh",
|
|
876
|
-
"volume-x": "SpeakerX",
|
|
877
|
-
mic: "Microphone",
|
|
878
|
-
"mic-off": "MicrophoneSlash",
|
|
879
|
-
// People
|
|
880
|
-
user: "User",
|
|
881
|
-
users: "Users",
|
|
882
|
-
"user-plus": "UserPlus",
|
|
883
|
-
"user-check": "UserCheck",
|
|
884
|
-
// Time
|
|
885
|
-
calendar: "Calendar",
|
|
886
|
-
clock: "Clock",
|
|
887
|
-
timer: "Timer",
|
|
888
|
-
// Location
|
|
889
|
-
map: "MapTrifold",
|
|
890
|
-
"map-pin": "MapPin",
|
|
891
|
-
navigation: "NavigationArrow",
|
|
892
|
-
compass: "Compass",
|
|
893
|
-
globe: "Globe",
|
|
894
|
-
target: "Target",
|
|
895
|
-
// Project / layout
|
|
896
|
-
kanban: "Kanban",
|
|
897
|
-
list: "List",
|
|
898
|
-
table: "Table",
|
|
899
|
-
grid: "GridFour",
|
|
900
|
-
layout: "Layout",
|
|
901
|
-
columns: "Columns",
|
|
902
|
-
rows: "Rows",
|
|
903
|
-
// Misc
|
|
904
|
-
bell: "Bell",
|
|
905
|
-
bookmark: "Bookmark",
|
|
906
|
-
briefcase: "Briefcase",
|
|
907
|
-
flag: "Flag",
|
|
908
|
-
tag: "Tag",
|
|
909
|
-
tags: "Tag",
|
|
910
|
-
star: "Star",
|
|
911
|
-
heart: "Heart",
|
|
912
|
-
home: "House",
|
|
913
|
-
settings: "Gear",
|
|
914
|
-
eye: "Eye",
|
|
915
|
-
"eye-off": "EyeSlash",
|
|
916
|
-
lock: "Lock",
|
|
917
|
-
unlock: "LockOpen",
|
|
918
|
-
key: "Key",
|
|
919
|
-
shield: "Shield",
|
|
920
|
-
search: "MagnifyingGlass",
|
|
921
|
-
filter: "Funnel",
|
|
922
|
-
"sort-asc": "SortAscending",
|
|
923
|
-
"sort-desc": "SortDescending",
|
|
924
|
-
zap: "Lightning",
|
|
925
|
-
sparkles: "Sparkle",
|
|
926
|
-
// Code
|
|
927
|
-
code: "Code",
|
|
928
|
-
terminal: "Terminal",
|
|
929
|
-
database: "Database",
|
|
930
|
-
server: "HardDrives",
|
|
931
|
-
cloud: "Cloud",
|
|
932
|
-
wifi: "WifiHigh",
|
|
933
|
-
package: "Package",
|
|
934
|
-
box: "Package",
|
|
935
|
-
// Theme
|
|
936
|
-
sun: "Sun",
|
|
937
|
-
moon: "Moon",
|
|
938
|
-
// Phone
|
|
939
|
-
phone: "Phone",
|
|
940
|
-
printer: "Printer",
|
|
941
|
-
// Hierarchy
|
|
942
|
-
tree: "Tree",
|
|
943
|
-
network: "Network"
|
|
944
|
-
};
|
|
945
|
-
tablerAliases = {
|
|
946
|
-
// lucide name → tabler suffix (after the `Icon` prefix)
|
|
947
|
-
// Actions
|
|
948
|
-
plus: "Plus",
|
|
949
|
-
minus: "Minus",
|
|
950
|
-
x: "X",
|
|
951
|
-
check: "Check",
|
|
952
|
-
close: "X",
|
|
953
|
-
edit: "Pencil",
|
|
954
|
-
pencil: "Pencil",
|
|
955
|
-
trash: "Trash",
|
|
956
|
-
save: "DeviceFloppy",
|
|
957
|
-
copy: "Copy",
|
|
958
|
-
share: "Share",
|
|
959
|
-
send: "Send",
|
|
960
|
-
download: "Download",
|
|
961
|
-
upload: "Upload",
|
|
962
|
-
archive: "Archive",
|
|
963
|
-
refresh: "Refresh",
|
|
964
|
-
loader: "Loader2",
|
|
965
|
-
link: "Link",
|
|
966
|
-
paperclip: "Paperclip",
|
|
967
|
-
external: "ExternalLink",
|
|
968
|
-
"external-link": "ExternalLink",
|
|
969
|
-
// Navigation
|
|
970
|
-
"chevron-down": "ChevronDown",
|
|
971
|
-
"chevron-up": "ChevronUp",
|
|
972
|
-
"chevron-left": "ChevronLeft",
|
|
973
|
-
"chevron-right": "ChevronRight",
|
|
974
|
-
"arrow-down": "ArrowDown",
|
|
975
|
-
"arrow-up": "ArrowUp",
|
|
976
|
-
"arrow-left": "ArrowLeft",
|
|
977
|
-
"arrow-right": "ArrowRight",
|
|
978
|
-
menu: "Menu2",
|
|
979
|
-
more: "Dots",
|
|
980
|
-
"more-vertical": "DotsVertical",
|
|
981
|
-
// Files
|
|
982
|
-
file: "File",
|
|
983
|
-
"file-text": "FileText",
|
|
984
|
-
"file-plus": "FilePlus",
|
|
985
|
-
"file-check": "FileCheck",
|
|
986
|
-
"file-minus": "FileMinus",
|
|
987
|
-
folder: "Folder",
|
|
988
|
-
"folder-open": "FolderOpen",
|
|
989
|
-
document: "FileText",
|
|
990
|
-
// Charts
|
|
991
|
-
"bar-chart": "ChartBar",
|
|
992
|
-
"bar-chart-2": "ChartBar",
|
|
993
|
-
"bar-chart-3": "ChartBar",
|
|
994
|
-
"line-chart": "ChartLine",
|
|
995
|
-
"pie-chart": "ChartPie",
|
|
996
|
-
activity: "Activity",
|
|
997
|
-
"trending-up": "TrendingUp",
|
|
998
|
-
"trending-down": "TrendingDown",
|
|
999
|
-
// Messages
|
|
1000
|
-
message: "Message",
|
|
1001
|
-
"message-circle": "MessageCircle",
|
|
1002
|
-
"message-square": "Message2",
|
|
1003
|
-
"messages-square": "Messages",
|
|
1004
|
-
comment: "Message",
|
|
1005
|
-
comments: "Messages",
|
|
1006
|
-
inbox: "Inbox",
|
|
1007
|
-
mail: "Mail",
|
|
1008
|
-
envelope: "Mail",
|
|
1009
|
-
// Status
|
|
1010
|
-
"alert-circle": "AlertCircle",
|
|
1011
|
-
"alert-triangle": "AlertTriangle",
|
|
1012
|
-
"check-circle": "CircleCheck",
|
|
1013
|
-
"x-circle": "CircleX",
|
|
1014
|
-
info: "InfoCircle",
|
|
1015
|
-
"help-circle": "HelpCircle",
|
|
1016
|
-
"life-buoy": "Lifebuoy",
|
|
1017
|
-
warning: "AlertTriangle",
|
|
1018
|
-
error: "AlertOctagon",
|
|
1019
|
-
// Media
|
|
1020
|
-
image: "Photo",
|
|
1021
|
-
video: "Video",
|
|
1022
|
-
camera: "Camera",
|
|
1023
|
-
music: "Music",
|
|
1024
|
-
play: "PlayerPlay",
|
|
1025
|
-
pause: "PlayerPause",
|
|
1026
|
-
stop: "PlayerStop",
|
|
1027
|
-
"skip-forward": "PlayerSkipForward",
|
|
1028
|
-
"skip-back": "PlayerSkipBack",
|
|
1029
|
-
volume: "Volume",
|
|
1030
|
-
"volume-2": "Volume",
|
|
1031
|
-
"volume-x": "VolumeOff",
|
|
1032
|
-
mic: "Microphone",
|
|
1033
|
-
"mic-off": "MicrophoneOff",
|
|
1034
|
-
// People
|
|
1035
|
-
user: "User",
|
|
1036
|
-
users: "Users",
|
|
1037
|
-
"user-plus": "UserPlus",
|
|
1038
|
-
"user-check": "UserCheck",
|
|
1039
|
-
// Time
|
|
1040
|
-
calendar: "Calendar",
|
|
1041
|
-
clock: "Clock",
|
|
1042
|
-
timer: "Hourglass",
|
|
1043
|
-
// Location
|
|
1044
|
-
map: "Map",
|
|
1045
|
-
"map-pin": "MapPin",
|
|
1046
|
-
navigation: "Navigation",
|
|
1047
|
-
compass: "Compass",
|
|
1048
|
-
globe: "World",
|
|
1049
|
-
target: "Target",
|
|
1050
|
-
// Project / layout
|
|
1051
|
-
kanban: "LayoutKanban",
|
|
1052
|
-
list: "List",
|
|
1053
|
-
table: "Table",
|
|
1054
|
-
grid: "LayoutGrid",
|
|
1055
|
-
layout: "Layout",
|
|
1056
|
-
columns: "LayoutColumns",
|
|
1057
|
-
rows: "LayoutRows",
|
|
1058
|
-
// Misc
|
|
1059
|
-
bell: "Bell",
|
|
1060
|
-
bookmark: "Bookmark",
|
|
1061
|
-
briefcase: "Briefcase",
|
|
1062
|
-
flag: "Flag",
|
|
1063
|
-
tag: "Tag",
|
|
1064
|
-
tags: "Tags",
|
|
1065
|
-
star: "Star",
|
|
1066
|
-
heart: "Heart",
|
|
1067
|
-
home: "Home",
|
|
1068
|
-
settings: "Settings",
|
|
1069
|
-
eye: "Eye",
|
|
1070
|
-
"eye-off": "EyeOff",
|
|
1071
|
-
lock: "Lock",
|
|
1072
|
-
unlock: "LockOpen",
|
|
1073
|
-
key: "Key",
|
|
1074
|
-
shield: "Shield",
|
|
1075
|
-
search: "Search",
|
|
1076
|
-
filter: "Filter",
|
|
1077
|
-
"sort-asc": "SortAscending",
|
|
1078
|
-
"sort-desc": "SortDescending",
|
|
1079
|
-
zap: "Bolt",
|
|
1080
|
-
sparkles: "Sparkles",
|
|
1081
|
-
// Code / data
|
|
1082
|
-
code: "Code",
|
|
1083
|
-
terminal: "Terminal",
|
|
1084
|
-
database: "Database",
|
|
1085
|
-
server: "Server",
|
|
1086
|
-
cloud: "Cloud",
|
|
1087
|
-
wifi: "Wifi",
|
|
1088
|
-
package: "Package",
|
|
1089
|
-
box: "Box",
|
|
1090
|
-
// Theme
|
|
1091
|
-
sun: "Sun",
|
|
1092
|
-
moon: "Moon",
|
|
1093
|
-
// Phone
|
|
1094
|
-
phone: "Phone",
|
|
1095
|
-
printer: "Printer",
|
|
1096
|
-
// Hierarchy
|
|
1097
|
-
tree: "Hierarchy",
|
|
1098
|
-
network: "Network"
|
|
1099
|
-
};
|
|
1100
|
-
faAliases = {
|
|
1101
|
-
// lucide name → fa-solid suffix (after the `Fa` prefix).
|
|
1102
|
-
// react-icons/fa ships FontAwesome 5 — names like `FaFileText` don't exist
|
|
1103
|
-
// (FA renamed to `FaFileAlt`). When you see a console.warn from
|
|
1104
|
-
// [iconFamily] about an unmapped lucide name in this family, add the
|
|
1105
|
-
// closest FA5 sibling here so the fallback stays in-family.
|
|
1106
|
-
search: "Search",
|
|
1107
|
-
close: "Times",
|
|
1108
|
-
x: "Times",
|
|
1109
|
-
loader: "Spinner",
|
|
1110
|
-
refresh: "Sync",
|
|
1111
|
-
"sort-asc": "SortAmountUp",
|
|
1112
|
-
"sort-desc": "SortAmountDown",
|
|
1113
|
-
"chevron-down": "ChevronDown",
|
|
1114
|
-
"chevron-up": "ChevronUp",
|
|
1115
|
-
"chevron-left": "ChevronLeft",
|
|
1116
|
-
"chevron-right": "ChevronRight",
|
|
1117
|
-
"help-circle": "QuestionCircle",
|
|
1118
|
-
"alert-triangle": "ExclamationTriangle",
|
|
1119
|
-
"alert-circle": "ExclamationCircle",
|
|
1120
|
-
"check-circle": "CheckCircle",
|
|
1121
|
-
"x-circle": "TimesCircle",
|
|
1122
|
-
edit: "Edit",
|
|
1123
|
-
pencil: "PencilAlt",
|
|
1124
|
-
trash: "Trash",
|
|
1125
|
-
send: "PaperPlane",
|
|
1126
|
-
share: "ShareAlt",
|
|
1127
|
-
external: "ExternalLinkAlt",
|
|
1128
|
-
plus: "Plus",
|
|
1129
|
-
minus: "Minus",
|
|
1130
|
-
check: "Check",
|
|
1131
|
-
star: "Star",
|
|
1132
|
-
heart: "Heart",
|
|
1133
|
-
home: "Home",
|
|
1134
|
-
user: "User",
|
|
1135
|
-
users: "Users",
|
|
1136
|
-
"user-plus": "UserPlus",
|
|
1137
|
-
"user-check": "UserCheck",
|
|
1138
|
-
settings: "Cog",
|
|
1139
|
-
menu: "Bars",
|
|
1140
|
-
"arrow-up": "ArrowUp",
|
|
1141
|
-
"arrow-down": "ArrowDown",
|
|
1142
|
-
"arrow-left": "ArrowLeft",
|
|
1143
|
-
"arrow-right": "ArrowRight",
|
|
1144
|
-
copy: "Copy",
|
|
1145
|
-
download: "Download",
|
|
1146
|
-
upload: "Upload",
|
|
1147
|
-
filter: "Filter",
|
|
1148
|
-
calendar: "Calendar",
|
|
1149
|
-
clock: "Clock",
|
|
1150
|
-
bell: "Bell",
|
|
1151
|
-
mail: "Envelope",
|
|
1152
|
-
envelope: "Envelope",
|
|
1153
|
-
lock: "Lock",
|
|
1154
|
-
unlock: "LockOpen",
|
|
1155
|
-
eye: "Eye",
|
|
1156
|
-
"eye-off": "EyeSlash",
|
|
1157
|
-
more: "EllipsisH",
|
|
1158
|
-
"more-vertical": "EllipsisV",
|
|
1159
|
-
info: "InfoCircle",
|
|
1160
|
-
warning: "ExclamationTriangle",
|
|
1161
|
-
error: "ExclamationCircle",
|
|
1162
|
-
// Time
|
|
1163
|
-
timer: "Hourglass",
|
|
1164
|
-
// Files (FA renamed FileText → FileAlt)
|
|
1165
|
-
file: "File",
|
|
1166
|
-
"file-text": "FileAlt",
|
|
1167
|
-
"file-plus": "FileMedical",
|
|
1168
|
-
"file-minus": "FileExcel",
|
|
1169
|
-
"file-check": "FileSignature",
|
|
1170
|
-
document: "FileAlt",
|
|
1171
|
-
// Charts (lucide BarChart2 / BarChart3 → FA ChartBar)
|
|
1172
|
-
"bar-chart": "ChartBar",
|
|
1173
|
-
"bar-chart-2": "ChartBar",
|
|
1174
|
-
"bar-chart-3": "ChartBar",
|
|
1175
|
-
"line-chart": "ChartLine",
|
|
1176
|
-
"pie-chart": "ChartPie",
|
|
1177
|
-
activity: "ChartLine",
|
|
1178
|
-
"trending-up": "ChartLine",
|
|
1179
|
-
"trending-down": "ChartLine",
|
|
1180
|
-
// Messages (lucide MessageCircle/MessageSquare → FA CommentDots/CommentAlt)
|
|
1181
|
-
message: "Comment",
|
|
1182
|
-
"message-circle": "CommentDots",
|
|
1183
|
-
"message-square": "CommentAlt",
|
|
1184
|
-
"messages-square": "Comments",
|
|
1185
|
-
comment: "Comment",
|
|
1186
|
-
comments: "Comments",
|
|
1187
|
-
inbox: "Inbox",
|
|
1188
|
-
// Support / help
|
|
1189
|
-
"life-buoy": "LifeRing",
|
|
1190
|
-
lifebuoy: "LifeRing",
|
|
1191
|
-
// Project / kanban (FA has no kanban; closest semantic is Tasks/Columns)
|
|
1192
|
-
kanban: "Tasks",
|
|
1193
|
-
columns: "Columns",
|
|
1194
|
-
rows: "Bars",
|
|
1195
|
-
layout: "ThLarge",
|
|
1196
|
-
grid: "Th",
|
|
1197
|
-
list: "List",
|
|
1198
|
-
table: "Table",
|
|
1199
|
-
// Storage / folders
|
|
1200
|
-
folder: "Folder",
|
|
1201
|
-
"folder-open": "FolderOpen",
|
|
1202
|
-
archive: "Archive",
|
|
1203
|
-
bookmark: "Bookmark",
|
|
1204
|
-
briefcase: "Briefcase",
|
|
1205
|
-
package: "Box",
|
|
1206
|
-
box: "Box",
|
|
1207
|
-
// Map / location
|
|
1208
|
-
map: "Map",
|
|
1209
|
-
"map-pin": "MapMarkerAlt",
|
|
1210
|
-
navigation: "LocationArrow",
|
|
1211
|
-
compass: "Compass",
|
|
1212
|
-
globe: "Globe",
|
|
1213
|
-
target: "Bullseye",
|
|
1214
|
-
// Media
|
|
1215
|
-
image: "Image",
|
|
1216
|
-
video: "Video",
|
|
1217
|
-
film: "Film",
|
|
1218
|
-
camera: "Camera",
|
|
1219
|
-
music: "Music",
|
|
1220
|
-
play: "Play",
|
|
1221
|
-
pause: "Pause",
|
|
1222
|
-
stop: "Stop",
|
|
1223
|
-
"skip-forward": "Forward",
|
|
1224
|
-
"skip-back": "Backward",
|
|
1225
|
-
volume: "VolumeUp",
|
|
1226
|
-
"volume-2": "VolumeUp",
|
|
1227
|
-
"volume-x": "VolumeMute",
|
|
1228
|
-
mic: "Microphone",
|
|
1229
|
-
"mic-off": "MicrophoneSlash",
|
|
1230
|
-
phone: "Phone",
|
|
1231
|
-
// Code / data
|
|
1232
|
-
code: "Code",
|
|
1233
|
-
terminal: "Terminal",
|
|
1234
|
-
database: "Database",
|
|
1235
|
-
server: "Server",
|
|
1236
|
-
cloud: "Cloud",
|
|
1237
|
-
wifi: "Wifi",
|
|
1238
|
-
// Security
|
|
1239
|
-
shield: "ShieldAlt",
|
|
1240
|
-
key: "Key",
|
|
1241
|
-
// Misc actions
|
|
1242
|
-
printer: "Print",
|
|
1243
|
-
save: "Save",
|
|
1244
|
-
link: "Link",
|
|
1245
|
-
unlink: "Unlink",
|
|
1246
|
-
paperclip: "Paperclip",
|
|
1247
|
-
flag: "Flag",
|
|
1248
|
-
tag: "Tag",
|
|
1249
|
-
tags: "Tags",
|
|
1250
|
-
zap: "Bolt",
|
|
1251
|
-
sparkles: "Magic",
|
|
1252
|
-
// Theme
|
|
1253
|
-
sun: "Sun",
|
|
1254
|
-
moon: "Moon",
|
|
1255
|
-
// Hierarchy (FA has no Tree icon for hierarchies; Sitemap is the org-chart icon)
|
|
1256
|
-
tree: "Sitemap",
|
|
1257
|
-
network: "NetworkWired"
|
|
1258
|
-
};
|
|
1259
|
-
warned = /* @__PURE__ */ new Set();
|
|
1260
640
|
}
|
|
1261
641
|
});
|
|
1262
642
|
function kebabToPascal2(name) {
|
|
@@ -1337,7 +717,7 @@ var init_Icon = __esm({
|
|
|
1337
717
|
const family = useIconFamily();
|
|
1338
718
|
const RenderedComponent = React83__namespace.default.useMemo(() => {
|
|
1339
719
|
if (directIcon) return null;
|
|
1340
|
-
return effectiveName ? resolveIconForFamily(effectiveName
|
|
720
|
+
return effectiveName ? resolveIconForFamily(effectiveName) : null;
|
|
1341
721
|
}, [directIcon, effectiveName, family]);
|
|
1342
722
|
const effectiveStrokeWidth = strokeWidth ?? void 0;
|
|
1343
723
|
const inlineStyle = {
|
|
@@ -1716,7 +1096,7 @@ var init_Button = __esm({
|
|
|
1716
1096
|
ref,
|
|
1717
1097
|
disabled: disabled || isLoading,
|
|
1718
1098
|
className: cn(
|
|
1719
|
-
"inline-flex items-center justify-center gap-2",
|
|
1099
|
+
"relative inline-flex items-center justify-center gap-2",
|
|
1720
1100
|
"font-medium",
|
|
1721
1101
|
"rounded-sm",
|
|
1722
1102
|
"cursor-pointer",
|
|
@@ -3484,6 +2864,7 @@ var init_Input = __esm({
|
|
|
3484
2864
|
icon: iconProp,
|
|
3485
2865
|
clearable,
|
|
3486
2866
|
onClear,
|
|
2867
|
+
action,
|
|
3487
2868
|
value,
|
|
3488
2869
|
options,
|
|
3489
2870
|
rows = 3,
|
|
@@ -3533,6 +2914,11 @@ var init_Input = __esm({
|
|
|
3533
2914
|
onClear?.();
|
|
3534
2915
|
}
|
|
3535
2916
|
};
|
|
2917
|
+
const handleKeyDown = (e) => {
|
|
2918
|
+
if (action && e.key === "Enter") {
|
|
2919
|
+
eventBus.emit(`UI:${action}`, { value: e.currentTarget.value });
|
|
2920
|
+
}
|
|
2921
|
+
};
|
|
3536
2922
|
const wrapField = (field) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full", children: [
|
|
3537
2923
|
label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-foreground mb-1", children: label }),
|
|
3538
2924
|
field,
|
|
@@ -3606,6 +2992,7 @@ var init_Input = __esm({
|
|
|
3606
2992
|
type,
|
|
3607
2993
|
value,
|
|
3608
2994
|
onChange: handleChange,
|
|
2995
|
+
onKeyDown: handleKeyDown,
|
|
3609
2996
|
className: baseClassName,
|
|
3610
2997
|
...props
|
|
3611
2998
|
}
|
|
@@ -4138,7 +3525,7 @@ var init_Card = __esm({
|
|
|
4138
3525
|
});
|
|
4139
3526
|
function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
|
|
4140
3527
|
const px = typeof size === "number" ? size : sizeMap[size];
|
|
4141
|
-
|
|
3528
|
+
useIconFamily();
|
|
4142
3529
|
if (assetUrl?.url) {
|
|
4143
3530
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4144
3531
|
AtlasImage,
|
|
@@ -4150,7 +3537,7 @@ function GameIcon({ assetUrl, icon, size = "md", alt, className }) {
|
|
|
4150
3537
|
}
|
|
4151
3538
|
);
|
|
4152
3539
|
}
|
|
4153
|
-
const I = typeof icon === "string" ? resolveIconForFamily(icon
|
|
3540
|
+
const I = typeof icon === "string" ? resolveIconForFamily(icon) : icon;
|
|
4154
3541
|
return /* @__PURE__ */ jsxRuntime.jsx(I, { width: px, height: px, className: cn("flex-shrink-0", className) });
|
|
4155
3542
|
}
|
|
4156
3543
|
var sizeMap;
|
|
@@ -9199,9 +8586,9 @@ var init_webPainter2d = __esm({
|
|
|
9199
8586
|
// lib/drawable/projector.ts
|
|
9200
8587
|
function create2DProjector(opts) {
|
|
9201
8588
|
const { scale, baseOffsetX, layout } = opts;
|
|
9202
|
-
const tileWidth = TILE_WIDTH * scale;
|
|
9203
|
-
const floorHeight = FLOOR_HEIGHT * scale;
|
|
9204
|
-
const diamondTopY = (opts.diamondTopY ?? DIAMOND_TOP_Y) * scale;
|
|
8589
|
+
const tileWidth = layout === "free" ? 1 : TILE_WIDTH * scale;
|
|
8590
|
+
const floorHeight = layout === "free" ? 1 : FLOOR_HEIGHT * scale;
|
|
8591
|
+
const diamondTopY = layout === "free" ? 0 : (opts.diamondTopY ?? DIAMOND_TOP_Y) * scale;
|
|
9205
8592
|
const squareGrid = layout === "flat" || layout === "free";
|
|
9206
8593
|
const project = (pos) => layout === "free" ? { x: pos.x, y: pos.y } : isoToScreen(pos.x, pos.y, scale, baseOffsetX, layout);
|
|
9207
8594
|
const anchorPoint = (pos, anchor) => {
|
|
@@ -9242,6 +8629,15 @@ var init_projector = __esm({
|
|
|
9242
8629
|
}
|
|
9243
8630
|
});
|
|
9244
8631
|
|
|
8632
|
+
// lib/drawable/contract.ts
|
|
8633
|
+
function isValidScenePos(pos) {
|
|
8634
|
+
return Number.isFinite(pos?.x) && Number.isFinite(pos?.y);
|
|
8635
|
+
}
|
|
8636
|
+
var init_contract = __esm({
|
|
8637
|
+
"lib/drawable/contract.ts"() {
|
|
8638
|
+
}
|
|
8639
|
+
});
|
|
8640
|
+
|
|
9245
8641
|
// components/game/atoms/DrawSprite.tsx
|
|
9246
8642
|
function DrawSprite(_props) {
|
|
9247
8643
|
return null;
|
|
@@ -9251,10 +8647,12 @@ var init_DrawSprite = __esm({
|
|
|
9251
8647
|
"components/game/atoms/DrawSprite.tsx"() {
|
|
9252
8648
|
"use client";
|
|
9253
8649
|
init_atlasSlice();
|
|
8650
|
+
init_contract();
|
|
9254
8651
|
paintSprite = (painter, node, dctx) => {
|
|
8652
|
+
if (!node.asset?.url || !isValidScenePos(node.position)) return;
|
|
9255
8653
|
const tex = painter.resolveTexture(node.asset.url);
|
|
9256
8654
|
if (!tex) return;
|
|
9257
|
-
let src = node.frame;
|
|
8655
|
+
let src = typeof node.frame === "object" ? node.frame : void 0;
|
|
9258
8656
|
if (!src && isAtlasAsset(node.asset)) {
|
|
9259
8657
|
const atlas = getAtlas(node.asset.atlas, dctx.invalidate);
|
|
9260
8658
|
if (!atlas) return;
|
|
@@ -9299,7 +8697,9 @@ var paintShape;
|
|
|
9299
8697
|
var init_DrawShape = __esm({
|
|
9300
8698
|
"components/game/atoms/DrawShape.tsx"() {
|
|
9301
8699
|
"use client";
|
|
8700
|
+
init_contract();
|
|
9302
8701
|
paintShape = (painter, node, dctx) => {
|
|
8702
|
+
if (!isValidScenePos(node.position)) return;
|
|
9303
8703
|
painter.save();
|
|
9304
8704
|
if (node.opacity !== void 0 && node.opacity !== 1) painter.setAlpha(node.opacity);
|
|
9305
8705
|
switch (node.shape) {
|
|
@@ -9353,7 +8753,9 @@ var paintText;
|
|
|
9353
8753
|
var init_DrawText = __esm({
|
|
9354
8754
|
"components/game/atoms/DrawText.tsx"() {
|
|
9355
8755
|
"use client";
|
|
8756
|
+
init_contract();
|
|
9356
8757
|
paintText = (painter, node, dctx) => {
|
|
8758
|
+
if (!isValidScenePos(node.position)) return;
|
|
9357
8759
|
const p = dctx.projector.anchorPoint(node.position, node.anchor ?? "center");
|
|
9358
8760
|
const x = p.x + (node.offsetX ?? 0);
|
|
9359
8761
|
const y = p.y + (node.offsetY ?? 0);
|
|
@@ -9458,12 +8860,14 @@ function collectDrawnItems(nodes) {
|
|
|
9458
8860
|
case "draw-sprite":
|
|
9459
8861
|
case "draw-shape":
|
|
9460
8862
|
case "draw-text":
|
|
9461
|
-
out.push({ pos: n.position, id: n.id });
|
|
8863
|
+
if (isValidScenePos(n.position)) out.push({ pos: n.position, id: n.id });
|
|
9462
8864
|
break;
|
|
9463
8865
|
case "draw-sprite-layer":
|
|
9464
8866
|
case "draw-shape-layer":
|
|
9465
8867
|
case "draw-text-layer":
|
|
9466
|
-
for (const it of n.items)
|
|
8868
|
+
for (const it of n.items) {
|
|
8869
|
+
if (isValidScenePos(it.position)) out.push({ pos: it.position, id: it.id });
|
|
8870
|
+
}
|
|
9467
8871
|
break;
|
|
9468
8872
|
}
|
|
9469
8873
|
}
|
|
@@ -9478,6 +8882,7 @@ function buildHitIndex(items) {
|
|
|
9478
8882
|
}
|
|
9479
8883
|
var init_hitTest = __esm({
|
|
9480
8884
|
"lib/drawable/hitTest.ts"() {
|
|
8885
|
+
init_contract();
|
|
9481
8886
|
}
|
|
9482
8887
|
});
|
|
9483
8888
|
function normalizeBackdrop(bg) {
|
|
@@ -9503,14 +8908,16 @@ function Canvas2D({
|
|
|
9503
8908
|
cameraPos,
|
|
9504
8909
|
bgColor
|
|
9505
8910
|
}) {
|
|
8911
|
+
const instanceId = React83.useMemo(() => Math.random().toString(36).slice(2, 8), []);
|
|
8912
|
+
function isDrawableLayer(node) {
|
|
8913
|
+
return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
|
|
8914
|
+
}
|
|
9506
8915
|
const layerSummaries = drawables?.map((d) => {
|
|
9507
|
-
if (!d
|
|
9508
|
-
|
|
9509
|
-
return { type: rec.type, itemsLen: Array.isArray(rec.items) ? rec.items.length : void 0, firstItem: Array.isArray(rec.items) ? rec.items[0] : void 0 };
|
|
8916
|
+
if (!isDrawableLayer(d)) return { type: d.type };
|
|
8917
|
+
return { type: d.type, itemsLen: d.items.length, firstItem: d.items[0] };
|
|
9510
8918
|
});
|
|
9511
|
-
|
|
8919
|
+
canvas2DLog.debug("Canvas2D render", { instanceId, projection, scale, cameraMode: camera, cameraPos: cameraPos ? JSON.stringify(cameraPos) : void 0, drawablesCount: drawables?.length, layerSummaries: layerSummaries ? JSON.stringify(layerSummaries) : void 0 });
|
|
9512
8920
|
const backgroundImage = normalizeBackdrop(backgroundImageRaw);
|
|
9513
|
-
const instanceId = React83.useMemo(() => Math.random().toString(36).slice(2, 8), []);
|
|
9514
8921
|
const isFree = projection === "free";
|
|
9515
8922
|
const squareGrid = projection === "flat" || isFree || projection === "side";
|
|
9516
8923
|
const layout = projection === "side" ? "free" : projection;
|
|
@@ -9645,7 +9052,7 @@ function Canvas2D({
|
|
|
9645
9052
|
}
|
|
9646
9053
|
const containerRect = containerRef.current?.getBoundingClientRect();
|
|
9647
9054
|
const canvasRect = canvas.getBoundingClientRect();
|
|
9648
|
-
|
|
9055
|
+
canvas2DLog.debug("Canvas2D draw", { instanceId, viewportSize, baseOffsetX, cam: { x: cam.x, y: cam.y, zoom: cam.zoom }, cameraPos: cameraPos ? JSON.stringify(cameraPos) : void 0, containerRect: containerRect ? { width: containerRect.width, height: containerRect.height } : null, canvasRect: canvasRect ? { width: canvasRect.width, height: canvasRect.height } : null });
|
|
9649
9056
|
const painter = createWebPainter(ctx, bumpAtlas);
|
|
9650
9057
|
painter.save();
|
|
9651
9058
|
painter.translate(viewportSize.width / 2, viewportSize.height / 2);
|
|
@@ -9857,6 +9264,7 @@ function Canvas2D({
|
|
|
9857
9264
|
}
|
|
9858
9265
|
);
|
|
9859
9266
|
}
|
|
9267
|
+
var canvas2DLog;
|
|
9860
9268
|
var init_Canvas2D = __esm({
|
|
9861
9269
|
"components/game/molecules/Canvas2D.tsx"() {
|
|
9862
9270
|
"use client";
|
|
@@ -9878,6 +9286,7 @@ var init_Canvas2D = __esm({
|
|
|
9878
9286
|
init_paintDispatch();
|
|
9879
9287
|
init_hitTest();
|
|
9880
9288
|
init_isometric();
|
|
9289
|
+
canvas2DLog = logger.createLogger("almadar:ui:game-canvas");
|
|
9881
9290
|
Canvas2D.displayName = "Canvas2D";
|
|
9882
9291
|
}
|
|
9883
9292
|
});
|
|
@@ -9916,7 +9325,7 @@ function Canvas({
|
|
|
9916
9325
|
keyMap,
|
|
9917
9326
|
keyUpMap
|
|
9918
9327
|
}) {
|
|
9919
|
-
|
|
9328
|
+
canvasLog.debug("Canvas render", { mode, drawablesCount: drawables?.length, projection, camera: camera ? JSON.stringify(camera) : void 0 });
|
|
9920
9329
|
const zoom = camera?.zoom;
|
|
9921
9330
|
if (mode === "3d") {
|
|
9922
9331
|
const props3d = {
|
|
@@ -9969,7 +9378,7 @@ function Canvas({
|
|
|
9969
9378
|
}
|
|
9970
9379
|
);
|
|
9971
9380
|
}
|
|
9972
|
-
var Canvas3DHost;
|
|
9381
|
+
var Canvas3DHost, canvasLog;
|
|
9973
9382
|
var init_Canvas = __esm({
|
|
9974
9383
|
"components/game/molecules/Canvas.tsx"() {
|
|
9975
9384
|
"use client";
|
|
@@ -9977,6 +9386,7 @@ var init_Canvas = __esm({
|
|
|
9977
9386
|
Canvas3DHost = React83.lazy(
|
|
9978
9387
|
() => import('@almadar/ui/components/molecules/game/three').then((m) => ({ default: m.Canvas3DHost }))
|
|
9979
9388
|
);
|
|
9389
|
+
canvasLog = logger.createLogger("almadar:ui:game-canvas");
|
|
9980
9390
|
Canvas.displayName = "Canvas";
|
|
9981
9391
|
}
|
|
9982
9392
|
});
|
|
@@ -12162,21 +11572,6 @@ var init_renderer = __esm({
|
|
|
12162
11572
|
init_slot_definitions();
|
|
12163
11573
|
}
|
|
12164
11574
|
});
|
|
12165
|
-
|
|
12166
|
-
// lib/wrapCallbackForEvent.ts
|
|
12167
|
-
function wrapCallbackForEvent(qualifiedEvent, callbackArgs, emit) {
|
|
12168
|
-
const argNames = (callbackArgs ?? []).map((a) => a.name);
|
|
12169
|
-
if (argNames.length === 0) {
|
|
12170
|
-
return () => emit(qualifiedEvent);
|
|
12171
|
-
}
|
|
12172
|
-
return (...args) => {
|
|
12173
|
-
const payload = {};
|
|
12174
|
-
for (let i = 0; i < argNames.length; i += 1) {
|
|
12175
|
-
payload[argNames[i]] = args[i];
|
|
12176
|
-
}
|
|
12177
|
-
emit(qualifiedEvent, payload);
|
|
12178
|
-
};
|
|
12179
|
-
}
|
|
12180
11575
|
var init_wrapCallbackForEvent = __esm({
|
|
12181
11576
|
"lib/wrapCallbackForEvent.ts"() {
|
|
12182
11577
|
}
|
|
@@ -23198,7 +22593,8 @@ function DataGrid({
|
|
|
23198
22593
|
const { t } = hooks.useTranslate();
|
|
23199
22594
|
const [selectedIds, setSelectedIds] = React83.useState(/* @__PURE__ */ new Set());
|
|
23200
22595
|
const [visibleCount, setVisibleCount] = React83.useState(pageSize || Infinity);
|
|
23201
|
-
const fieldDefs = fields ?? columns ?? [];
|
|
22596
|
+
const fieldDefs = (Array.isArray(fields) ? fields : void 0) ?? (Array.isArray(columns) ? columns : void 0) ?? [];
|
|
22597
|
+
const actionDefs = Array.isArray(itemActions) ? itemActions : [];
|
|
23202
22598
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
23203
22599
|
const dnd = useDataDnd({
|
|
23204
22600
|
items: allDataRaw,
|
|
@@ -23242,8 +22638,8 @@ function DataGrid({
|
|
|
23242
22638
|
const titleField = fieldDefs.find((f3) => f3.variant === "h3" || f3.variant === "h4") ?? fieldDefs[0];
|
|
23243
22639
|
const badgeFields = fieldDefs.filter((f3) => f3.variant === "badge" && f3 !== titleField);
|
|
23244
22640
|
const bodyFields = fieldDefs.filter((f3) => f3 !== titleField && !badgeFields.includes(f3));
|
|
23245
|
-
const primaryActions =
|
|
23246
|
-
const dangerActions =
|
|
22641
|
+
const primaryActions = actionDefs.filter((a) => a.variant !== "danger");
|
|
22642
|
+
const dangerActions = actionDefs.filter((a) => a.variant === "danger");
|
|
23247
22643
|
const handleActionClick = (action, itemData) => (e) => {
|
|
23248
22644
|
e.stopPropagation();
|
|
23249
22645
|
const payload = {
|
|
@@ -35975,7 +35371,7 @@ function measureLabelWidth(text) {
|
|
|
35975
35371
|
if (typeof document === "undefined") return text.length * 6;
|
|
35976
35372
|
if (!labelMeasureCtx) labelMeasureCtx = document.createElement("canvas").getContext("2d");
|
|
35977
35373
|
if (!labelMeasureCtx) return text.length * 6;
|
|
35978
|
-
labelMeasureCtx.font = "
|
|
35374
|
+
labelMeasureCtx.font = "12px system-ui";
|
|
35979
35375
|
return labelMeasureCtx.measureText(text).width;
|
|
35980
35376
|
}
|
|
35981
35377
|
function getGroupColor(group, groups) {
|
|
@@ -36021,6 +35417,7 @@ var init_GraphCanvas = __esm({
|
|
|
36021
35417
|
actions,
|
|
36022
35418
|
onNodeClick,
|
|
36023
35419
|
onNodeDoubleClick,
|
|
35420
|
+
onBadgeClick,
|
|
36024
35421
|
nodeClickEvent,
|
|
36025
35422
|
selectedNodeId,
|
|
36026
35423
|
repulsion = 800,
|
|
@@ -36168,7 +35565,9 @@ var init_GraphCanvas = __esm({
|
|
|
36168
35565
|
const dx = target.x - source.x;
|
|
36169
35566
|
const dy = target.y - source.y;
|
|
36170
35567
|
const dist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
36171
|
-
const
|
|
35568
|
+
const w2 = edge.weight ?? 1;
|
|
35569
|
+
const linkTarget = linkDistance * (1 + (1 - Math.min(1, Math.max(0, w2))) * 1.5);
|
|
35570
|
+
const force = (dist - linkTarget) * 0.05;
|
|
36172
35571
|
const fx = dx / dist * force;
|
|
36173
35572
|
const fy = dy / dist * force;
|
|
36174
35573
|
source.fx += fx;
|
|
@@ -36190,7 +35589,7 @@ var init_GraphCanvas = __esm({
|
|
|
36190
35589
|
node.y = Math.max(30, Math.min(h - 30, node.y));
|
|
36191
35590
|
}
|
|
36192
35591
|
const LABEL_GAP = 12;
|
|
36193
|
-
const LABEL_H =
|
|
35592
|
+
const LABEL_H = 16;
|
|
36194
35593
|
const pad = nodeSpacing / 2;
|
|
36195
35594
|
for (let i = 0; i < nodes.length; i++) {
|
|
36196
35595
|
for (let j = i + 1; j < nodes.length; j++) {
|
|
@@ -36245,6 +35644,11 @@ var init_GraphCanvas = __esm({
|
|
|
36245
35644
|
const h = height;
|
|
36246
35645
|
const nodes = nodesRef.current;
|
|
36247
35646
|
const accentColor = resolveColor3("var(--color-accent)", canvas);
|
|
35647
|
+
const fontFamily = resolveColor3("var(--font-family)", canvas) || "system-ui";
|
|
35648
|
+
const fgColor = resolveColor3("var(--color-foreground)", canvas);
|
|
35649
|
+
const mutedColor = resolveColor3("var(--color-muted-foreground)", canvas) || fgColor;
|
|
35650
|
+
const bgColor = resolveColor3("var(--color-background)", canvas) || "#ffffff";
|
|
35651
|
+
const accentFg = resolveColor3("var(--color-accent-foreground)", canvas) || "#ffffff";
|
|
36248
35652
|
const dpr = typeof window !== "undefined" && window.devicePixelRatio || 1;
|
|
36249
35653
|
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
|
|
36250
35654
|
ctx.clearRect(0, 0, w, h);
|
|
@@ -36264,19 +35668,21 @@ var init_GraphCanvas = __esm({
|
|
|
36264
35668
|
const target = nodes.find((n) => n.id === edge.target);
|
|
36265
35669
|
if (!source || !target) continue;
|
|
36266
35670
|
const incident = !!hoveredNode && (edge.source === hoveredNode || edge.target === hoveredNode);
|
|
36267
|
-
|
|
35671
|
+
const w2 = edge.weight ?? 1;
|
|
35672
|
+
ctx.globalAlpha = hoveredNode ? incident ? 1 : 0.05 : linkOpacity * w2;
|
|
36268
35673
|
ctx.beginPath();
|
|
36269
35674
|
ctx.moveTo(source.x, source.y);
|
|
36270
35675
|
ctx.lineTo(target.x, target.y);
|
|
36271
35676
|
ctx.strokeStyle = incident ? accentColor : edge.color || "#888888";
|
|
36272
|
-
ctx.lineWidth = incident ? 2 :
|
|
35677
|
+
ctx.lineWidth = incident ? 2 : Math.max(0.75, w2);
|
|
36273
35678
|
ctx.stroke();
|
|
36274
35679
|
if (edge.label && showLabels) {
|
|
36275
35680
|
const mx = (source.x + target.x) / 2;
|
|
36276
35681
|
const my = (source.y + target.y) / 2;
|
|
36277
|
-
ctx.fillStyle =
|
|
36278
|
-
ctx.font =
|
|
35682
|
+
ctx.fillStyle = mutedColor;
|
|
35683
|
+
ctx.font = `9px ${fontFamily}`;
|
|
36279
35684
|
ctx.textAlign = "center";
|
|
35685
|
+
ctx.textBaseline = "alphabetic";
|
|
36280
35686
|
ctx.fillText(edge.label, mx, my - 4);
|
|
36281
35687
|
}
|
|
36282
35688
|
}
|
|
@@ -36301,10 +35707,33 @@ var init_GraphCanvas = __esm({
|
|
|
36301
35707
|
}
|
|
36302
35708
|
ctx.stroke();
|
|
36303
35709
|
if (showLabels && node.label) {
|
|
36304
|
-
ctx.
|
|
36305
|
-
ctx.font = `${isSelected || isHovered ? "bold " : ""}10px system-ui`;
|
|
35710
|
+
ctx.font = `${isSelected || isHovered ? "600" : "500"} 12px ${fontFamily}`;
|
|
36306
35711
|
ctx.textAlign = "center";
|
|
36307
|
-
ctx.
|
|
35712
|
+
ctx.textBaseline = "middle";
|
|
35713
|
+
const ly = node.y + radius + 14;
|
|
35714
|
+
ctx.lineWidth = 3;
|
|
35715
|
+
ctx.lineJoin = "round";
|
|
35716
|
+
ctx.strokeStyle = bgColor;
|
|
35717
|
+
ctx.strokeText(node.label, node.x, ly);
|
|
35718
|
+
ctx.fillStyle = isSelected || isHovered ? fgColor : mutedColor;
|
|
35719
|
+
ctx.fillText(node.label, node.x, ly);
|
|
35720
|
+
}
|
|
35721
|
+
if (node.badge && node.badge > 1) {
|
|
35722
|
+
const bx = node.x + radius * 0.7;
|
|
35723
|
+
const by = node.y - radius * 0.7;
|
|
35724
|
+
const br = Math.max(7, Math.min(11, radius * 0.45));
|
|
35725
|
+
ctx.beginPath();
|
|
35726
|
+
ctx.arc(bx, by, br, 0, Math.PI * 2);
|
|
35727
|
+
ctx.fillStyle = accentColor;
|
|
35728
|
+
ctx.fill();
|
|
35729
|
+
ctx.strokeStyle = bgColor;
|
|
35730
|
+
ctx.lineWidth = 2;
|
|
35731
|
+
ctx.stroke();
|
|
35732
|
+
ctx.fillStyle = accentFg;
|
|
35733
|
+
ctx.font = `600 9px ${fontFamily}`;
|
|
35734
|
+
ctx.textAlign = "center";
|
|
35735
|
+
ctx.textBaseline = "middle";
|
|
35736
|
+
ctx.fillText(String(node.badge), bx, by + 0.5);
|
|
36308
35737
|
}
|
|
36309
35738
|
}
|
|
36310
35739
|
ctx.restore();
|
|
@@ -36397,11 +35826,21 @@ var init_GraphCanvas = __esm({
|
|
|
36397
35826
|
if (!coords) return;
|
|
36398
35827
|
const node = nodeAt(coords.graphX, coords.graphY);
|
|
36399
35828
|
if (node) {
|
|
35829
|
+
if (node.badge && node.badge > 1 && onBadgeClick) {
|
|
35830
|
+
const r = (node.size || 8) + (selectedNodeId === node.id ? 4 : 0);
|
|
35831
|
+
const bx = node.x + r * 0.7;
|
|
35832
|
+
const by = node.y - r * 0.7;
|
|
35833
|
+
const br = Math.max(7, Math.min(11, r * 0.45)) + 3;
|
|
35834
|
+
if (Math.hypot(coords.graphX - bx, coords.graphY - by) <= br) {
|
|
35835
|
+
onBadgeClick(node);
|
|
35836
|
+
return;
|
|
35837
|
+
}
|
|
35838
|
+
}
|
|
36400
35839
|
handleNodeClick(node);
|
|
36401
35840
|
}
|
|
36402
35841
|
}
|
|
36403
35842
|
},
|
|
36404
|
-
[toCoords, nodeAt, handleNodeClick]
|
|
35843
|
+
[toCoords, nodeAt, handleNodeClick, onBadgeClick, selectedNodeId]
|
|
36405
35844
|
);
|
|
36406
35845
|
const handlePointerLeave = React83.useCallback(() => {
|
|
36407
35846
|
setHoveredNode(null);
|
|
@@ -44371,7 +43810,7 @@ function SlotContentRenderer({
|
|
|
44371
43810
|
if (typeof propValue !== "string") continue;
|
|
44372
43811
|
const propDef = propsSchema[propKey];
|
|
44373
43812
|
if (!propDef || propDef.kind !== "callback") continue;
|
|
44374
|
-
renderedProps[propKey] = wrapCallbackForEvent(
|
|
43813
|
+
renderedProps[propKey] = ui.wrapCallbackForEvent(
|
|
44375
43814
|
`UI:${propValue}`,
|
|
44376
43815
|
propDef.callbackArgs,
|
|
44377
43816
|
(eventKey, payload) => eventBus.emit(eventKey, payload)
|