@almadar/ui 2.1.2 → 2.1.3
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/{chunk-LB3HXNAR.js → chunk-LX4G4SVJ.js} +2 -2
- package/dist/{chunk-BTXQJGFB.js → chunk-QU4JHKVC.js} +24 -24
- package/dist/components/index.d.ts +80 -19
- package/dist/components/index.js +740 -623
- package/dist/context/index.js +2 -2
- package/dist/providers/index.js +4 -4
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useTheme, useUISlots } from './chunk-
|
|
1
|
+
import { useTheme, useUISlots } from './chunk-QU4JHKVC.js';
|
|
2
|
+
import { cn, debugGroup, debug, debugGroupEnd, getNestedValue, isDebugEnabled } from './chunk-KKCVDUK7.js';
|
|
2
3
|
import { useTranslate, useQuerySingleton, useEntityList } from './chunk-PE2H3NAW.js';
|
|
3
4
|
import { useEventBus } from './chunk-YXZM3WCF.js';
|
|
4
|
-
import { cn, debugGroup, debug, debugGroupEnd, getNestedValue, isDebugEnabled } from './chunk-KKCVDUK7.js';
|
|
5
5
|
import { __publicField } from './chunk-PKBMQBKP.js';
|
|
6
6
|
import * as React41 from 'react';
|
|
7
7
|
import React41__default, { useCallback, useRef, useState, useLayoutEffect, useEffect, createContext, useMemo, useContext, Suspense } from 'react';
|
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
import { useUISlotManager } from './chunk-7NEWMNNU.js';
|
|
2
|
-
import { createContext, useMemo, useState, useEffect, useCallback
|
|
2
|
+
import { createContext, useMemo, useContext, useState, useEffect, useCallback } from 'react';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
+
var UISlotContext = createContext(null);
|
|
6
|
+
function UISlotProvider({ children }) {
|
|
7
|
+
const slotManager = useUISlotManager();
|
|
8
|
+
const contextValue = useMemo(() => slotManager, [slotManager]);
|
|
9
|
+
return /* @__PURE__ */ jsx(UISlotContext.Provider, { value: contextValue, children });
|
|
10
|
+
}
|
|
11
|
+
function useUISlots() {
|
|
12
|
+
const context = useContext(UISlotContext);
|
|
13
|
+
if (!context) {
|
|
14
|
+
throw new Error(
|
|
15
|
+
"useUISlots must be used within a UISlotProvider. Make sure your component tree is wrapped with <UISlotProvider>."
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
return context;
|
|
19
|
+
}
|
|
20
|
+
function useSlotContent(slot) {
|
|
21
|
+
const { getContent } = useUISlots();
|
|
22
|
+
return getContent(slot);
|
|
23
|
+
}
|
|
24
|
+
function useSlotHasContent(slot) {
|
|
25
|
+
const { hasContent } = useUISlots();
|
|
26
|
+
return hasContent(slot);
|
|
27
|
+
}
|
|
5
28
|
var BUILT_IN_THEMES = [
|
|
6
29
|
{
|
|
7
30
|
name: "wireframe",
|
|
@@ -252,28 +275,5 @@ function useTheme() {
|
|
|
252
275
|
return context;
|
|
253
276
|
}
|
|
254
277
|
var ThemeContext_default = ThemeContext;
|
|
255
|
-
var UISlotContext = createContext(null);
|
|
256
|
-
function UISlotProvider({ children }) {
|
|
257
|
-
const slotManager = useUISlotManager();
|
|
258
|
-
const contextValue = useMemo(() => slotManager, [slotManager]);
|
|
259
|
-
return /* @__PURE__ */ jsx(UISlotContext.Provider, { value: contextValue, children });
|
|
260
|
-
}
|
|
261
|
-
function useUISlots() {
|
|
262
|
-
const context = useContext(UISlotContext);
|
|
263
|
-
if (!context) {
|
|
264
|
-
throw new Error(
|
|
265
|
-
"useUISlots must be used within a UISlotProvider. Make sure your component tree is wrapped with <UISlotProvider>."
|
|
266
|
-
);
|
|
267
|
-
}
|
|
268
|
-
return context;
|
|
269
|
-
}
|
|
270
|
-
function useSlotContent(slot) {
|
|
271
|
-
const { getContent } = useUISlots();
|
|
272
|
-
return getContent(slot);
|
|
273
|
-
}
|
|
274
|
-
function useSlotHasContent(slot) {
|
|
275
|
-
const { hasContent } = useUISlots();
|
|
276
|
-
return hasContent(slot);
|
|
277
|
-
}
|
|
278
278
|
|
|
279
279
|
export { BUILT_IN_THEMES, ThemeContext_default, ThemeProvider, UISlotContext, UISlotProvider, useSlotContent, useSlotHasContent, useTheme, useUISlots };
|
|
@@ -5465,6 +5465,13 @@ interface BattleUnit {
|
|
|
5465
5465
|
unitType?: string;
|
|
5466
5466
|
heroId?: string;
|
|
5467
5467
|
sprite?: string;
|
|
5468
|
+
/** Optional sprite sheet for animation (null = use static sprite) */
|
|
5469
|
+
spriteSheet?: {
|
|
5470
|
+
se: string;
|
|
5471
|
+
sw: string;
|
|
5472
|
+
frameWidth: number;
|
|
5473
|
+
frameHeight: number;
|
|
5474
|
+
} | null;
|
|
5468
5475
|
team: 'player' | 'enemy';
|
|
5469
5476
|
position: {
|
|
5470
5477
|
x: number;
|
|
@@ -5548,7 +5555,7 @@ interface BattleSlotContext {
|
|
|
5548
5555
|
y: number;
|
|
5549
5556
|
};
|
|
5550
5557
|
}
|
|
5551
|
-
interface BattleBoardProps {
|
|
5558
|
+
interface BattleBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
5552
5559
|
/** Entity containing all board data */
|
|
5553
5560
|
entity: BattleEntity;
|
|
5554
5561
|
/** Canvas render scale */
|
|
@@ -5678,6 +5685,13 @@ interface MapHero {
|
|
|
5678
5685
|
};
|
|
5679
5686
|
movement: number;
|
|
5680
5687
|
sprite?: string;
|
|
5688
|
+
/** Optional sprite sheet for animation (null = use static sprite) */
|
|
5689
|
+
spriteSheet?: {
|
|
5690
|
+
se: string;
|
|
5691
|
+
sw: string;
|
|
5692
|
+
frameWidth: number;
|
|
5693
|
+
frameHeight: number;
|
|
5694
|
+
} | null;
|
|
5681
5695
|
level?: number;
|
|
5682
5696
|
}
|
|
5683
5697
|
/** A hex on the map */
|
|
@@ -5733,13 +5747,9 @@ interface WorldMapEntity {
|
|
|
5733
5747
|
};
|
|
5734
5748
|
backgroundImage?: string;
|
|
5735
5749
|
}
|
|
5736
|
-
interface WorldMapBoardProps {
|
|
5750
|
+
interface WorldMapBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
5737
5751
|
/** World map entity data */
|
|
5738
5752
|
entity: WorldMapEntity;
|
|
5739
|
-
/** Loading state indicator */
|
|
5740
|
-
isLoading?: boolean;
|
|
5741
|
-
/** Error state */
|
|
5742
|
-
error?: Error | null;
|
|
5743
5753
|
/** Canvas render scale */
|
|
5744
5754
|
scale?: number;
|
|
5745
5755
|
/** Unit draw-size multiplier */
|
|
@@ -6122,7 +6132,7 @@ declare namespace EditorToolbar {
|
|
|
6122
6132
|
* @packageDocumentation
|
|
6123
6133
|
*/
|
|
6124
6134
|
|
|
6125
|
-
interface ActionTileProps {
|
|
6135
|
+
interface ActionTileProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
6126
6136
|
/** The action data */
|
|
6127
6137
|
action: SlotItemData;
|
|
6128
6138
|
/** Size variant */
|
|
@@ -6134,8 +6144,6 @@ interface ActionTileProps {
|
|
|
6134
6144
|
bg: string;
|
|
6135
6145
|
border: string;
|
|
6136
6146
|
}>;
|
|
6137
|
-
/** Additional CSS classes */
|
|
6138
|
-
className?: string;
|
|
6139
6147
|
}
|
|
6140
6148
|
declare function ActionTile({ action, size, disabled, categoryColors, className, }: ActionTileProps): React__default.JSX.Element;
|
|
6141
6149
|
declare namespace ActionTile {
|
|
@@ -6257,6 +6265,13 @@ interface SequencerPuzzleEntity {
|
|
|
6257
6265
|
x: number;
|
|
6258
6266
|
y: number;
|
|
6259
6267
|
}>;
|
|
6268
|
+
/** Header image URL displayed above the title */
|
|
6269
|
+
headerImage?: string;
|
|
6270
|
+
/** Visual theme overrides */
|
|
6271
|
+
theme?: {
|
|
6272
|
+
background?: string;
|
|
6273
|
+
accentColor?: string;
|
|
6274
|
+
};
|
|
6260
6275
|
}
|
|
6261
6276
|
interface SequencerBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
6262
6277
|
/** Puzzle data */
|
|
@@ -6424,6 +6439,13 @@ interface EventHandlerPuzzleEntity {
|
|
|
6424
6439
|
failMessage?: string;
|
|
6425
6440
|
/** Progressive hint shown after 3 failures */
|
|
6426
6441
|
hint?: string;
|
|
6442
|
+
/** Header image URL displayed above the title */
|
|
6443
|
+
headerImage?: string;
|
|
6444
|
+
/** Visual theme overrides */
|
|
6445
|
+
theme?: {
|
|
6446
|
+
background?: string;
|
|
6447
|
+
accentColor?: string;
|
|
6448
|
+
};
|
|
6427
6449
|
}
|
|
6428
6450
|
interface EventHandlerBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
6429
6451
|
/** Puzzle data */
|
|
@@ -6612,6 +6634,13 @@ interface StateArchitectPuzzleEntity {
|
|
|
6612
6634
|
/** Feedback */
|
|
6613
6635
|
successMessage?: string;
|
|
6614
6636
|
failMessage?: string;
|
|
6637
|
+
/** Header image URL displayed above the title */
|
|
6638
|
+
headerImage?: string;
|
|
6639
|
+
/** Visual theme overrides */
|
|
6640
|
+
theme?: {
|
|
6641
|
+
background?: string;
|
|
6642
|
+
accentColor?: string;
|
|
6643
|
+
};
|
|
6615
6644
|
}
|
|
6616
6645
|
interface StateArchitectBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
6617
6646
|
/** Puzzle data */
|
|
@@ -6665,11 +6694,17 @@ interface SimulatorPuzzleEntity {
|
|
|
6665
6694
|
successMessage?: string;
|
|
6666
6695
|
failMessage?: string;
|
|
6667
6696
|
hint?: string;
|
|
6697
|
+
/** Header image URL displayed above the title */
|
|
6698
|
+
headerImage?: string;
|
|
6699
|
+
/** Visual theme overrides */
|
|
6700
|
+
theme?: {
|
|
6701
|
+
background?: string;
|
|
6702
|
+
accentColor?: string;
|
|
6703
|
+
};
|
|
6668
6704
|
}
|
|
6669
|
-
interface SimulatorBoardProps {
|
|
6705
|
+
interface SimulatorBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
6670
6706
|
entity: SimulatorPuzzleEntity;
|
|
6671
6707
|
completeEvent?: string;
|
|
6672
|
-
className?: string;
|
|
6673
6708
|
}
|
|
6674
6709
|
declare function SimulatorBoard({ entity, completeEvent, className, }: SimulatorBoardProps): React__default.JSX.Element;
|
|
6675
6710
|
declare namespace SimulatorBoard {
|
|
@@ -6708,11 +6743,17 @@ interface ClassifierPuzzleEntity {
|
|
|
6708
6743
|
successMessage?: string;
|
|
6709
6744
|
failMessage?: string;
|
|
6710
6745
|
hint?: string;
|
|
6746
|
+
/** Header image URL displayed above the title */
|
|
6747
|
+
headerImage?: string;
|
|
6748
|
+
/** Visual theme overrides */
|
|
6749
|
+
theme?: {
|
|
6750
|
+
background?: string;
|
|
6751
|
+
accentColor?: string;
|
|
6752
|
+
};
|
|
6711
6753
|
}
|
|
6712
|
-
interface ClassifierBoardProps {
|
|
6754
|
+
interface ClassifierBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
6713
6755
|
entity: ClassifierPuzzleEntity;
|
|
6714
6756
|
completeEvent?: string;
|
|
6715
|
-
className?: string;
|
|
6716
6757
|
}
|
|
6717
6758
|
declare function ClassifierBoard({ entity, completeEvent, className, }: ClassifierBoardProps): React__default.JSX.Element;
|
|
6718
6759
|
declare namespace ClassifierBoard {
|
|
@@ -6735,6 +6776,8 @@ interface BuilderComponent {
|
|
|
6735
6776
|
label: string;
|
|
6736
6777
|
description?: string;
|
|
6737
6778
|
iconEmoji?: string;
|
|
6779
|
+
/** Image URL icon (takes precedence over iconEmoji) */
|
|
6780
|
+
iconUrl?: string;
|
|
6738
6781
|
category?: string;
|
|
6739
6782
|
}
|
|
6740
6783
|
interface BuilderSlot {
|
|
@@ -6752,11 +6795,17 @@ interface BuilderPuzzleEntity {
|
|
|
6752
6795
|
successMessage?: string;
|
|
6753
6796
|
failMessage?: string;
|
|
6754
6797
|
hint?: string;
|
|
6798
|
+
/** Header image URL displayed above the title */
|
|
6799
|
+
headerImage?: string;
|
|
6800
|
+
/** Visual theme overrides */
|
|
6801
|
+
theme?: {
|
|
6802
|
+
background?: string;
|
|
6803
|
+
accentColor?: string;
|
|
6804
|
+
};
|
|
6755
6805
|
}
|
|
6756
|
-
interface BuilderBoardProps {
|
|
6806
|
+
interface BuilderBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
6757
6807
|
entity: BuilderPuzzleEntity;
|
|
6758
6808
|
completeEvent?: string;
|
|
6759
|
-
className?: string;
|
|
6760
6809
|
}
|
|
6761
6810
|
declare function BuilderBoard({ entity, completeEvent, className, }: BuilderBoardProps): React__default.JSX.Element;
|
|
6762
6811
|
declare namespace BuilderBoard {
|
|
@@ -6791,11 +6840,17 @@ interface DebuggerPuzzleEntity {
|
|
|
6791
6840
|
successMessage?: string;
|
|
6792
6841
|
failMessage?: string;
|
|
6793
6842
|
hint?: string;
|
|
6843
|
+
/** Header image URL displayed above the title */
|
|
6844
|
+
headerImage?: string;
|
|
6845
|
+
/** Visual theme overrides */
|
|
6846
|
+
theme?: {
|
|
6847
|
+
background?: string;
|
|
6848
|
+
accentColor?: string;
|
|
6849
|
+
};
|
|
6794
6850
|
}
|
|
6795
|
-
interface DebuggerBoardProps {
|
|
6851
|
+
interface DebuggerBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
6796
6852
|
entity: DebuggerPuzzleEntity;
|
|
6797
6853
|
completeEvent?: string;
|
|
6798
|
-
className?: string;
|
|
6799
6854
|
}
|
|
6800
6855
|
declare function DebuggerBoard({ entity, completeEvent, className, }: DebuggerBoardProps): React__default.JSX.Element;
|
|
6801
6856
|
declare namespace DebuggerBoard {
|
|
@@ -6839,11 +6894,17 @@ interface NegotiatorPuzzleEntity {
|
|
|
6839
6894
|
successMessage?: string;
|
|
6840
6895
|
failMessage?: string;
|
|
6841
6896
|
hint?: string;
|
|
6897
|
+
/** Header image URL displayed above the title */
|
|
6898
|
+
headerImage?: string;
|
|
6899
|
+
/** Visual theme overrides */
|
|
6900
|
+
theme?: {
|
|
6901
|
+
background?: string;
|
|
6902
|
+
accentColor?: string;
|
|
6903
|
+
};
|
|
6842
6904
|
}
|
|
6843
|
-
interface NegotiatorBoardProps {
|
|
6905
|
+
interface NegotiatorBoardProps extends Omit<EntityDisplayProps, 'entity'> {
|
|
6844
6906
|
entity: NegotiatorPuzzleEntity;
|
|
6845
6907
|
completeEvent?: string;
|
|
6846
|
-
className?: string;
|
|
6847
6908
|
}
|
|
6848
6909
|
declare function NegotiatorBoard({ entity, completeEvent, className, }: NegotiatorBoardProps): React__default.JSX.Element;
|
|
6849
6910
|
declare namespace NegotiatorBoard {
|