@almadar/ui 2.11.1 → 2.11.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.
@@ -18534,18 +18534,33 @@ function UISlotComponent({
18534
18534
  }
18535
18535
  );
18536
18536
  }
18537
+ function getOrCreatePortalRoot() {
18538
+ let root = document.getElementById("ui-slot-portal-root");
18539
+ if (!root) {
18540
+ root = document.createElement("div");
18541
+ root.id = "ui-slot-portal-root";
18542
+ root.style.position = "relative";
18543
+ root.style.zIndex = "9999";
18544
+ document.body.appendChild(root);
18545
+ }
18546
+ const themed = document.querySelector('[data-theme*="-"]') ?? document.querySelector("[data-theme]");
18547
+ if (themed) {
18548
+ const theme = themed.getAttribute("data-theme");
18549
+ if (theme && root.getAttribute("data-theme") !== theme) {
18550
+ root.setAttribute("data-theme", theme);
18551
+ }
18552
+ }
18553
+ return root;
18554
+ }
18537
18555
  function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
18538
18556
  const [portalRoot, setPortalRoot] = useState(null);
18539
18557
  const eventBus = useUISlots();
18540
18558
  useEffect(() => {
18541
- let root = document.getElementById("ui-slot-portal-root");
18542
- if (!root) {
18543
- root = document.createElement("div");
18544
- root.id = "ui-slot-portal-root";
18545
- document.body.appendChild(root);
18546
- }
18547
- setPortalRoot(root);
18559
+ setPortalRoot(getOrCreatePortalRoot());
18548
18560
  }, []);
18561
+ useEffect(() => {
18562
+ if (portalRoot) getOrCreatePortalRoot();
18563
+ });
18549
18564
  const handleDismiss = () => {
18550
18565
  eventBus.clear(slot);
18551
18566
  };
@@ -18606,14 +18621,11 @@ function SlotPortal({
18606
18621
  }) {
18607
18622
  const [portalRoot, setPortalRoot] = useState(null);
18608
18623
  useEffect(() => {
18609
- let root = document.getElementById("ui-slot-portal-root");
18610
- if (!root) {
18611
- root = document.createElement("div");
18612
- root.id = "ui-slot-portal-root";
18613
- document.body.appendChild(root);
18614
- }
18615
- setPortalRoot(root);
18624
+ setPortalRoot(getOrCreatePortalRoot());
18616
18625
  }, []);
18626
+ useEffect(() => {
18627
+ if (portalRoot) getOrCreatePortalRoot();
18628
+ });
18617
18629
  if (!portalRoot) return null;
18618
18630
  let wrapper;
18619
18631
  switch (slot) {
@@ -1,4 +1,4 @@
1
- import { SuspenseConfigProvider } from './chunk-QAFNBUDT.js';
1
+ import { SuspenseConfigProvider } from './chunk-D54SBLJJ.js';
2
2
  import { ThemeProvider } from './chunk-DKQN5FVU.js';
3
3
  import { SelectionProvider, EntityDataProvider } from './chunk-WGJIL4YR.js';
4
4
  import { useEventBus, EventBusProvider } from './chunk-YXZM3WCF.js';
@@ -3,8 +3,8 @@ import { useAuthContext } from '../chunk-GTIAVPI5.js';
3
3
  export { ENTITY_EVENTS, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity as useEntityById, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePinchZoom, usePlayer, usePreview, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../chunk-GTIAVPI5.js';
4
4
  export { clearEntities, getAllEntities, getByType, getEntity, getSingleton, removeEntity, spawnEntity, updateEntity, updateSingleton } from '../chunk-N7MVUW4R.js';
5
5
  import '../chunk-3HJHHULT.js';
6
- import { VStack, HStack, Typography, Button, Icon, Box, Card, Avatar, Badge, SearchInput, Checkbox, Menu as Menu$1, Pagination, LoadingState, EmptyState, Modal, ErrorState, QuizBlock, CodeBlock, ScaledDiagram, MarkdownContent, Divider, ProgressBar, isoToScreen, IsometricCanvas_default, Stack, Select, Drawer, Toast, Tabs, Input, ThemeToggle, TILE_WIDTH, EntityDisplayEvents, StateIndicator, Accordion, ButtonGroup, Container } from '../chunk-QAFNBUDT.js';
7
- export { ALL_PRESETS, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, Alert, AnimatedCounter, Avatar, Badge, Box, Breadcrumb, Button, ButtonGroup, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, Center, Chart, ChartLegend, Checkbox, ChoiceButton, CodeBlock, CombatLog, ComboCounter, ConditionalWrapper, ConfettiEffect, Container, ControlButton, CraftingRecipe, DIAMOND_TOP_Y, DPad, DamageNumber, DataGrid, DataList, DataTable, DateRangeSelector, DayCell, DetailPanel, DialogueBox, DialogueBubble, Divider, Drawer, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, FEATURE_COLORS, FLOOR_HEIGHT, FilterGroup, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormField, FormSectionHeader, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GraphView, Grid, HStack, Heading, HealthBar, HealthPanel, Icon, InfiniteScrollSentinel, Input, InputGroup, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, Label, LawReferenceTooltip, Lightbox, LineChart, LoadingState, MapView, MarkdownContent, MasterDetail, Menu, Meter, MiniMap, Modal, NumberStepper, Overlay, PageHeader, Pagination, PlatformerCanvas, Popover, PowerupSlots, ProgressBar, ProgressDots, PullToRefresh, QuestTracker, QuizBlock, Radio, RangeSlider, RelationSelect, RepeatableFormSection, ResourceBar, ResourceCounter, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Select, SidePanel, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, Skeleton, SlotContentRenderer, SortableList, Spacer, Spinner, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateIndicator, StatusDot, StatusEffect, SwipeableRow, Switch, TILE_HEIGHT, TILE_WIDTH, Tabs, Text, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, TimerDisplay, Toast, Tooltip, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UnitCommandBar, UploadDropZone, VStack, ViolationAlert, WaypointMarker, WizardNavigation, WizardProgress, XPBar, drawSprite, isoToScreen, pendulum, projectileMotion, screenToIso, springOscillator, useCamera, useImageCache } from '../chunk-QAFNBUDT.js';
6
+ import { VStack, HStack, Typography, Button, Icon, Box, Card, Avatar, Badge, SearchInput, Checkbox, Menu as Menu$1, Pagination, LoadingState, EmptyState, Modal, ErrorState, QuizBlock, CodeBlock, ScaledDiagram, MarkdownContent, Divider, ProgressBar, isoToScreen, IsometricCanvas_default, Stack, Select, Drawer, Toast, Tabs, Input, ThemeToggle, TILE_WIDTH, EntityDisplayEvents, StateIndicator, Accordion, ButtonGroup, Container } from '../chunk-D54SBLJJ.js';
7
+ export { ALL_PRESETS, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, Alert, AnimatedCounter, Avatar, Badge, Box, Breadcrumb, Button, ButtonGroup, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, Center, Chart, ChartLegend, Checkbox, ChoiceButton, CodeBlock, CombatLog, ComboCounter, ConditionalWrapper, ConfettiEffect, Container, ControlButton, CraftingRecipe, DIAMOND_TOP_Y, DPad, DamageNumber, DataGrid, DataList, DataTable, DateRangeSelector, DayCell, DetailPanel, DialogueBox, DialogueBubble, Divider, Drawer, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, FEATURE_COLORS, FLOOR_HEIGHT, FilterGroup, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormField, FormSectionHeader, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GraphView, Grid, HStack, Heading, HealthBar, HealthPanel, Icon, InfiniteScrollSentinel, Input, InputGroup, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, Label, LawReferenceTooltip, Lightbox, LineChart, LoadingState, MapView, MarkdownContent, MasterDetail, Menu, Meter, MiniMap, Modal, NumberStepper, Overlay, PageHeader, Pagination, PlatformerCanvas, Popover, PowerupSlots, ProgressBar, ProgressDots, PullToRefresh, QuestTracker, QuizBlock, Radio, RangeSlider, RelationSelect, RepeatableFormSection, ResourceBar, ResourceCounter, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Select, SidePanel, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, Skeleton, SlotContentRenderer, SortableList, Spacer, Spinner, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateIndicator, StatusDot, StatusEffect, SwipeableRow, Switch, TILE_HEIGHT, TILE_WIDTH, Tabs, Text, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, TimerDisplay, Toast, Tooltip, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UnitCommandBar, UploadDropZone, VStack, ViolationAlert, WaypointMarker, WizardNavigation, WizardProgress, XPBar, drawSprite, isoToScreen, pendulum, projectileMotion, screenToIso, springOscillator, useCamera, useImageCache } from '../chunk-D54SBLJJ.js';
8
8
  import '../chunk-DKQN5FVU.js';
9
9
  import { useTranslate } from '../chunk-WGJIL4YR.js';
10
10
  export { EntityDataProvider, I18nProvider, createTranslate, entityDataKeys, parseQueryBinding, useDragReorder, useEntity, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntitySuspense, useInfiniteScroll, useLongPress, usePullToRefresh, useQuerySingleton, useSwipeGesture, useTranslate } from '../chunk-WGJIL4YR.js';
@@ -1,5 +1,5 @@
1
- export { FetchedDataContext, FetchedDataProvider, OfflineModeProvider, OrbitalProvider, VerificationProvider, useFetchedData, useFetchedDataContext, useFetchedEntity, useOfflineMode, useOptionalOfflineMode } from '../chunk-HQZV4PYL.js';
2
- import '../chunk-QAFNBUDT.js';
1
+ export { FetchedDataContext, FetchedDataProvider, OfflineModeProvider, OrbitalProvider, VerificationProvider, useFetchedData, useFetchedDataContext, useFetchedEntity, useOfflineMode, useOptionalOfflineMode } from '../chunk-SSJZTICC.js';
2
+ import '../chunk-D54SBLJJ.js';
3
3
  import '../chunk-DKQN5FVU.js';
4
4
  export { SelectionContext, SelectionProvider, useSelection, useSelectionOptional } from '../chunk-WGJIL4YR.js';
5
5
  export { EventBusContext, EventBusProvider } from '../chunk-YXZM3WCF.js';
@@ -1,8 +1,8 @@
1
1
  import '../chunk-GTIAVPI5.js';
2
2
  import '../chunk-N7MVUW4R.js';
3
3
  import '../chunk-3HJHHULT.js';
4
- import { useFetchedDataContext } from '../chunk-HQZV4PYL.js';
5
- import '../chunk-QAFNBUDT.js';
4
+ import { useFetchedDataContext } from '../chunk-SSJZTICC.js';
5
+ import '../chunk-D54SBLJJ.js';
6
6
  import '../chunk-DKQN5FVU.js';
7
7
  import '../chunk-WGJIL4YR.js';
8
8
  import { useEventBus } from '../chunk-YXZM3WCF.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "2.11.1",
3
+ "version": "2.11.2",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "main": "./dist/components/index.js",