@malilion/block-ui-react 0.1.0 → 0.3.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/components/actions/BlockMenu/BlockMenu.d.ts +9 -0
- package/dist/components/actions/BlockMenu/BlockMenu.d.ts.map +1 -0
- package/dist/components/actions/BlockMenu/BlockMenu.js +211 -0
- package/dist/components/actions/BlockMenu/BlockMenu.js.map +1 -0
- package/dist/components/actions/BlockMenu/BlockMenu.module.js +23 -0
- package/dist/components/actions/BlockMenu/BlockMenu.module.js.map +1 -0
- package/dist/components/actions/BlockMenu/BlockMenu.types.d.ts +42 -0
- package/dist/components/actions/BlockMenu/BlockMenu.types.d.ts.map +1 -0
- package/dist/components/actions/BlockMenu/BlockMenu.utils.d.ts +10 -0
- package/dist/components/actions/BlockMenu/BlockMenu.utils.d.ts.map +1 -0
- package/dist/components/actions/BlockMenu/BlockMenu.utils.js +26 -0
- package/dist/components/actions/BlockMenu/BlockMenu.utils.js.map +1 -0
- package/dist/components/actions/BlockMenu/index.d.ts +3 -0
- package/dist/components/actions/BlockMenu/index.d.ts.map +1 -0
- package/dist/components/actions/index.d.ts +1 -0
- package/dist/components/actions/index.d.ts.map +1 -1
- package/dist/components/cards/ServerBrowser/ServerBrowser.d.ts +7 -0
- package/dist/components/cards/ServerBrowser/ServerBrowser.d.ts.map +1 -0
- package/dist/components/cards/ServerBrowser/ServerBrowser.js +106 -0
- package/dist/components/cards/ServerBrowser/ServerBrowser.js.map +1 -0
- package/dist/components/cards/ServerBrowser/ServerBrowser.types.d.ts +22 -0
- package/dist/components/cards/ServerBrowser/ServerBrowser.types.d.ts.map +1 -0
- package/dist/components/cards/ServerBrowser/ServerBrowser.utils.d.ts +8 -0
- package/dist/components/cards/ServerBrowser/ServerBrowser.utils.d.ts.map +1 -0
- package/dist/components/cards/ServerBrowser/ServerBrowser.utils.js +16 -0
- package/dist/components/cards/ServerBrowser/ServerBrowser.utils.js.map +1 -0
- package/dist/components/cards/ServerBrowser/index.d.ts +4 -0
- package/dist/components/cards/ServerBrowser/index.d.ts.map +1 -0
- package/dist/components/cards/WorldBrowser/WorldBrowser.d.ts +4 -0
- package/dist/components/cards/WorldBrowser/WorldBrowser.d.ts.map +1 -0
- package/dist/components/cards/WorldBrowser/WorldBrowser.js +101 -0
- package/dist/components/cards/WorldBrowser/WorldBrowser.js.map +1 -0
- package/dist/components/cards/WorldBrowser/WorldBrowser.types.d.ts +22 -0
- package/dist/components/cards/WorldBrowser/WorldBrowser.types.d.ts.map +1 -0
- package/dist/components/cards/WorldBrowser/WorldBrowser.utils.d.ts +10 -0
- package/dist/components/cards/WorldBrowser/WorldBrowser.utils.d.ts.map +1 -0
- package/dist/components/cards/WorldBrowser/WorldBrowser.utils.js +12 -0
- package/dist/components/cards/WorldBrowser/WorldBrowser.utils.js.map +1 -0
- package/dist/components/cards/WorldBrowser/index.d.ts +4 -0
- package/dist/components/cards/WorldBrowser/index.d.ts.map +1 -0
- package/dist/components/cards/browser.module.js +23 -0
- package/dist/components/cards/browser.module.js.map +1 -0
- package/dist/components/cards/index.d.ts +2 -0
- package/dist/components/cards/index.d.ts.map +1 -1
- package/dist/components/crafting/Anvil/Anvil.d.ts +7 -0
- package/dist/components/crafting/Anvil/Anvil.d.ts.map +1 -0
- package/dist/components/crafting/Anvil/Anvil.js +94 -0
- package/dist/components/crafting/Anvil/Anvil.js.map +1 -0
- package/dist/components/crafting/Anvil/Anvil.module.js +21 -0
- package/dist/components/crafting/Anvil/Anvil.module.js.map +1 -0
- package/dist/components/crafting/Anvil/Anvil.types.d.ts +25 -0
- package/dist/components/crafting/Anvil/Anvil.types.d.ts.map +1 -0
- package/dist/components/crafting/Anvil/Anvil.utils.d.ts +3 -0
- package/dist/components/crafting/Anvil/Anvil.utils.d.ts.map +1 -0
- package/dist/components/crafting/Anvil/Anvil.utils.js +11 -0
- package/dist/components/crafting/Anvil/Anvil.utils.js.map +1 -0
- package/dist/components/crafting/Anvil/index.d.ts +5 -0
- package/dist/components/crafting/Anvil/index.d.ts.map +1 -0
- package/dist/components/crafting/BrewingStand/BrewingStand.d.ts +7 -0
- package/dist/components/crafting/BrewingStand/BrewingStand.d.ts.map +1 -0
- package/dist/components/crafting/BrewingStand/BrewingStand.js +116 -0
- package/dist/components/crafting/BrewingStand/BrewingStand.js.map +1 -0
- package/dist/components/crafting/BrewingStand/BrewingStand.module.js +29 -0
- package/dist/components/crafting/BrewingStand/BrewingStand.module.js.map +1 -0
- package/dist/components/crafting/BrewingStand/BrewingStand.types.d.ts +22 -0
- package/dist/components/crafting/BrewingStand/BrewingStand.types.d.ts.map +1 -0
- package/dist/components/crafting/BrewingStand/BrewingStand.types.js +11 -0
- package/dist/components/crafting/BrewingStand/BrewingStand.types.js.map +1 -0
- package/dist/components/crafting/BrewingStand/BrewingStand.utils.d.ts +6 -0
- package/dist/components/crafting/BrewingStand/BrewingStand.utils.d.ts.map +1 -0
- package/dist/components/crafting/BrewingStand/BrewingStand.utils.js +13 -0
- package/dist/components/crafting/BrewingStand/BrewingStand.utils.js.map +1 -0
- package/dist/components/crafting/BrewingStand/index.d.ts +5 -0
- package/dist/components/crafting/BrewingStand/index.d.ts.map +1 -0
- package/dist/components/crafting/EnchantingTable/EnchantingTable.d.ts +7 -0
- package/dist/components/crafting/EnchantingTable/EnchantingTable.d.ts.map +1 -0
- package/dist/components/crafting/EnchantingTable/EnchantingTable.js +105 -0
- package/dist/components/crafting/EnchantingTable/EnchantingTable.js.map +1 -0
- package/dist/components/crafting/EnchantingTable/EnchantingTable.module.js +32 -0
- package/dist/components/crafting/EnchantingTable/EnchantingTable.module.js.map +1 -0
- package/dist/components/crafting/EnchantingTable/EnchantingTable.types.d.ts +29 -0
- package/dist/components/crafting/EnchantingTable/EnchantingTable.types.d.ts.map +1 -0
- package/dist/components/crafting/EnchantingTable/EnchantingTable.utils.d.ts +11 -0
- package/dist/components/crafting/EnchantingTable/EnchantingTable.utils.d.ts.map +1 -0
- package/dist/components/crafting/EnchantingTable/EnchantingTable.utils.js +14 -0
- package/dist/components/crafting/EnchantingTable/EnchantingTable.utils.js.map +1 -0
- package/dist/components/crafting/EnchantingTable/index.d.ts +3 -0
- package/dist/components/crafting/EnchantingTable/index.d.ts.map +1 -0
- package/dist/components/crafting/RecipeBook/RecipeBook.d.ts +7 -0
- package/dist/components/crafting/RecipeBook/RecipeBook.d.ts.map +1 -0
- package/dist/components/crafting/RecipeBook/RecipeBook.js +149 -0
- package/dist/components/crafting/RecipeBook/RecipeBook.js.map +1 -0
- package/dist/components/crafting/RecipeBook/RecipeBook.module.js +39 -0
- package/dist/components/crafting/RecipeBook/RecipeBook.module.js.map +1 -0
- package/dist/components/crafting/RecipeBook/RecipeBook.types.d.ts +36 -0
- package/dist/components/crafting/RecipeBook/RecipeBook.types.d.ts.map +1 -0
- package/dist/components/crafting/RecipeBook/RecipeBook.utils.d.ts +9 -0
- package/dist/components/crafting/RecipeBook/RecipeBook.utils.d.ts.map +1 -0
- package/dist/components/crafting/RecipeBook/RecipeBook.utils.js +21 -0
- package/dist/components/crafting/RecipeBook/RecipeBook.utils.js.map +1 -0
- package/dist/components/crafting/RecipeBook/index.d.ts +4 -0
- package/dist/components/crafting/RecipeBook/index.d.ts.map +1 -0
- package/dist/components/crafting/TradingUI/TradingUI.d.ts +7 -0
- package/dist/components/crafting/TradingUI/TradingUI.d.ts.map +1 -0
- package/dist/components/crafting/TradingUI/TradingUI.js +181 -0
- package/dist/components/crafting/TradingUI/TradingUI.js.map +1 -0
- package/dist/components/crafting/TradingUI/TradingUI.module.js +39 -0
- package/dist/components/crafting/TradingUI/TradingUI.module.js.map +1 -0
- package/dist/components/crafting/TradingUI/TradingUI.types.d.ts +36 -0
- package/dist/components/crafting/TradingUI/TradingUI.types.d.ts.map +1 -0
- package/dist/components/crafting/TradingUI/TradingUI.types.js +12 -0
- package/dist/components/crafting/TradingUI/TradingUI.types.js.map +1 -0
- package/dist/components/crafting/TradingUI/TradingUI.utils.d.ts +3 -0
- package/dist/components/crafting/TradingUI/TradingUI.utils.d.ts.map +1 -0
- package/dist/components/crafting/TradingUI/TradingUI.utils.js +8 -0
- package/dist/components/crafting/TradingUI/TradingUI.utils.js.map +1 -0
- package/dist/components/crafting/TradingUI/index.d.ts +4 -0
- package/dist/components/crafting/TradingUI/index.d.ts.map +1 -0
- package/dist/components/crafting/index.d.ts +5 -0
- package/dist/components/crafting/index.d.ts.map +1 -1
- package/dist/components/display/BlockTable/BlockTable.d.ts +8 -0
- package/dist/components/display/BlockTable/BlockTable.d.ts.map +1 -0
- package/dist/components/display/BlockTable/BlockTable.js +92 -0
- package/dist/components/display/BlockTable/BlockTable.js.map +1 -0
- package/dist/components/display/BlockTable/BlockTable.module.js +31 -0
- package/dist/components/display/BlockTable/BlockTable.module.js.map +1 -0
- package/dist/components/display/BlockTable/BlockTable.types.d.ts +49 -0
- package/dist/components/display/BlockTable/BlockTable.types.d.ts.map +1 -0
- package/dist/components/display/BlockTable/BlockTable.utils.d.ts +8 -0
- package/dist/components/display/BlockTable/BlockTable.utils.d.ts.map +1 -0
- package/dist/components/display/BlockTable/BlockTable.utils.js +48 -0
- package/dist/components/display/BlockTable/BlockTable.utils.js.map +1 -0
- package/dist/components/display/BlockTable/index.d.ts +3 -0
- package/dist/components/display/BlockTable/index.d.ts.map +1 -0
- package/dist/components/display/BlockTooltip/BlockTooltip.d.ts +8 -0
- package/dist/components/display/BlockTooltip/BlockTooltip.d.ts.map +1 -0
- package/dist/components/display/BlockTooltip/BlockTooltip.js +83 -0
- package/dist/components/display/BlockTooltip/BlockTooltip.js.map +1 -0
- package/dist/components/display/BlockTooltip/BlockTooltip.module.js +11 -0
- package/dist/components/display/BlockTooltip/BlockTooltip.module.js.map +1 -0
- package/dist/components/display/BlockTooltip/BlockTooltip.types.d.ts +20 -0
- package/dist/components/display/BlockTooltip/BlockTooltip.types.d.ts.map +1 -0
- package/dist/components/display/BlockTooltip/BlockTooltip.types.js +11 -0
- package/dist/components/display/BlockTooltip/BlockTooltip.types.js.map +1 -0
- package/dist/components/display/BlockTooltip/index.d.ts +4 -0
- package/dist/components/display/BlockTooltip/index.d.ts.map +1 -0
- package/dist/components/display/SkillTree/SkillTree.d.ts +8 -0
- package/dist/components/display/SkillTree/SkillTree.d.ts.map +1 -0
- package/dist/components/display/SkillTree/SkillTree.js +138 -0
- package/dist/components/display/SkillTree/SkillTree.js.map +1 -0
- package/dist/components/display/SkillTree/SkillTree.module.js +33 -0
- package/dist/components/display/SkillTree/SkillTree.module.js.map +1 -0
- package/dist/components/display/SkillTree/SkillTree.types.d.ts +29 -0
- package/dist/components/display/SkillTree/SkillTree.types.d.ts.map +1 -0
- package/dist/components/display/SkillTree/SkillTree.utils.d.ts +8 -0
- package/dist/components/display/SkillTree/SkillTree.utils.d.ts.map +1 -0
- package/dist/components/display/SkillTree/SkillTree.utils.js +16 -0
- package/dist/components/display/SkillTree/SkillTree.utils.js.map +1 -0
- package/dist/components/display/SkillTree/index.d.ts +4 -0
- package/dist/components/display/SkillTree/index.d.ts.map +1 -0
- package/dist/components/display/index.d.ts +3 -0
- package/dist/components/display/index.d.ts.map +1 -1
- package/dist/components/hud/BiomeIndicator/BiomeIndicator.d.ts +4 -0
- package/dist/components/hud/BiomeIndicator/BiomeIndicator.d.ts.map +1 -0
- package/dist/components/hud/BiomeIndicator/BiomeIndicator.js +39 -0
- package/dist/components/hud/BiomeIndicator/BiomeIndicator.js.map +1 -0
- package/dist/components/hud/BiomeIndicator/BiomeIndicator.module.js +11 -0
- package/dist/components/hud/BiomeIndicator/BiomeIndicator.module.js.map +1 -0
- package/dist/components/hud/BiomeIndicator/BiomeIndicator.types.d.ts +16 -0
- package/dist/components/hud/BiomeIndicator/BiomeIndicator.types.d.ts.map +1 -0
- package/dist/components/hud/BiomeIndicator/BiomeIndicator.types.js +18 -0
- package/dist/components/hud/BiomeIndicator/BiomeIndicator.types.js.map +1 -0
- package/dist/components/hud/BiomeIndicator/BiomeIndicator.utils.d.ts +8 -0
- package/dist/components/hud/BiomeIndicator/BiomeIndicator.utils.d.ts.map +1 -0
- package/dist/components/hud/BiomeIndicator/BiomeIndicator.utils.js +55 -0
- package/dist/components/hud/BiomeIndicator/BiomeIndicator.utils.js.map +1 -0
- package/dist/components/hud/BiomeIndicator/index.d.ts +4 -0
- package/dist/components/hud/BiomeIndicator/index.d.ts.map +1 -0
- package/dist/components/hud/BossBar/BossBar.d.ts +4 -0
- package/dist/components/hud/BossBar/BossBar.d.ts.map +1 -0
- package/dist/components/hud/BossBar/BossBar.js +56 -0
- package/dist/components/hud/BossBar/BossBar.js.map +1 -0
- package/dist/components/hud/BossBar/BossBar.module.js +19 -0
- package/dist/components/hud/BossBar/BossBar.module.js.map +1 -0
- package/dist/components/hud/BossBar/BossBar.types.d.ts +22 -0
- package/dist/components/hud/BossBar/BossBar.types.d.ts.map +1 -0
- package/dist/components/hud/BossBar/BossBar.types.js +21 -0
- package/dist/components/hud/BossBar/BossBar.types.js.map +1 -0
- package/dist/components/hud/BossBar/index.d.ts +4 -0
- package/dist/components/hud/BossBar/index.d.ts.map +1 -0
- package/dist/components/hud/CoordinatesHUD/CoordinatesHUD.d.ts +4 -0
- package/dist/components/hud/CoordinatesHUD/CoordinatesHUD.d.ts.map +1 -0
- package/dist/components/hud/CoordinatesHUD/CoordinatesHUD.js +96 -0
- package/dist/components/hud/CoordinatesHUD/CoordinatesHUD.js.map +1 -0
- package/dist/components/hud/CoordinatesHUD/CoordinatesHUD.module.js +17 -0
- package/dist/components/hud/CoordinatesHUD/CoordinatesHUD.module.js.map +1 -0
- package/dist/components/hud/CoordinatesHUD/CoordinatesHUD.types.d.ts +19 -0
- package/dist/components/hud/CoordinatesHUD/CoordinatesHUD.types.d.ts.map +1 -0
- package/dist/components/hud/CoordinatesHUD/CoordinatesHUD.types.js +11 -0
- package/dist/components/hud/CoordinatesHUD/CoordinatesHUD.types.js.map +1 -0
- package/dist/components/hud/CoordinatesHUD/CoordinatesHUD.utils.d.ts +7 -0
- package/dist/components/hud/CoordinatesHUD/CoordinatesHUD.utils.d.ts.map +1 -0
- package/dist/components/hud/CoordinatesHUD/CoordinatesHUD.utils.js +24 -0
- package/dist/components/hud/CoordinatesHUD/CoordinatesHUD.utils.js.map +1 -0
- package/dist/components/hud/CoordinatesHUD/index.d.ts +4 -0
- package/dist/components/hud/CoordinatesHUD/index.d.ts.map +1 -0
- package/dist/components/hud/DayNightIndicator/DayNightIndicator.d.ts +4 -0
- package/dist/components/hud/DayNightIndicator/DayNightIndicator.d.ts.map +1 -0
- package/dist/components/hud/DayNightIndicator/DayNightIndicator.js +70 -0
- package/dist/components/hud/DayNightIndicator/DayNightIndicator.js.map +1 -0
- package/dist/components/hud/DayNightIndicator/DayNightIndicator.module.js +19 -0
- package/dist/components/hud/DayNightIndicator/DayNightIndicator.module.js.map +1 -0
- package/dist/components/hud/DayNightIndicator/DayNightIndicator.types.d.ts +17 -0
- package/dist/components/hud/DayNightIndicator/DayNightIndicator.types.d.ts.map +1 -0
- package/dist/components/hud/DayNightIndicator/DayNightIndicator.utils.d.ts +15 -0
- package/dist/components/hud/DayNightIndicator/DayNightIndicator.utils.d.ts.map +1 -0
- package/dist/components/hud/DayNightIndicator/DayNightIndicator.utils.js +43 -0
- package/dist/components/hud/DayNightIndicator/DayNightIndicator.utils.js.map +1 -0
- package/dist/components/hud/DayNightIndicator/index.d.ts +4 -0
- package/dist/components/hud/DayNightIndicator/index.d.ts.map +1 -0
- package/dist/components/hud/MiniMap/MiniMap.d.ts +8 -0
- package/dist/components/hud/MiniMap/MiniMap.d.ts.map +1 -0
- package/dist/components/hud/MiniMap/MiniMap.js +76 -0
- package/dist/components/hud/MiniMap/MiniMap.js.map +1 -0
- package/dist/components/hud/MiniMap/MiniMap.module.js +17 -0
- package/dist/components/hud/MiniMap/MiniMap.module.js.map +1 -0
- package/dist/components/hud/MiniMap/MiniMap.types.d.ts +43 -0
- package/dist/components/hud/MiniMap/MiniMap.types.d.ts.map +1 -0
- package/dist/components/hud/MiniMap/MiniMap.types.js +26 -0
- package/dist/components/hud/MiniMap/MiniMap.types.js.map +1 -0
- package/dist/components/hud/MiniMap/MiniMap.utils.d.ts +14 -0
- package/dist/components/hud/MiniMap/MiniMap.utils.d.ts.map +1 -0
- package/dist/components/hud/MiniMap/MiniMap.utils.js +47 -0
- package/dist/components/hud/MiniMap/MiniMap.utils.js.map +1 -0
- package/dist/components/hud/MiniMap/index.d.ts +5 -0
- package/dist/components/hud/MiniMap/index.d.ts.map +1 -0
- package/dist/components/hud/Scoreboard/Scoreboard.d.ts +7 -0
- package/dist/components/hud/Scoreboard/Scoreboard.d.ts.map +1 -0
- package/dist/components/hud/Scoreboard/Scoreboard.js +89 -0
- package/dist/components/hud/Scoreboard/Scoreboard.js.map +1 -0
- package/dist/components/hud/Scoreboard/Scoreboard.module.js +25 -0
- package/dist/components/hud/Scoreboard/Scoreboard.module.js.map +1 -0
- package/dist/components/hud/Scoreboard/Scoreboard.types.d.ts +23 -0
- package/dist/components/hud/Scoreboard/Scoreboard.types.d.ts.map +1 -0
- package/dist/components/hud/Scoreboard/Scoreboard.utils.d.ts +5 -0
- package/dist/components/hud/Scoreboard/Scoreboard.utils.d.ts.map +1 -0
- package/dist/components/hud/Scoreboard/Scoreboard.utils.js +15 -0
- package/dist/components/hud/Scoreboard/Scoreboard.utils.js.map +1 -0
- package/dist/components/hud/Scoreboard/index.d.ts +3 -0
- package/dist/components/hud/Scoreboard/index.d.ts.map +1 -0
- package/dist/components/hud/WeatherIndicator/WeatherIndicator.d.ts +4 -0
- package/dist/components/hud/WeatherIndicator/WeatherIndicator.d.ts.map +1 -0
- package/dist/components/hud/WeatherIndicator/WeatherIndicator.js +52 -0
- package/dist/components/hud/WeatherIndicator/WeatherIndicator.js.map +1 -0
- package/dist/components/hud/WeatherIndicator/WeatherIndicator.module.js +15 -0
- package/dist/components/hud/WeatherIndicator/WeatherIndicator.module.js.map +1 -0
- package/dist/components/hud/WeatherIndicator/WeatherIndicator.types.d.ts +17 -0
- package/dist/components/hud/WeatherIndicator/WeatherIndicator.types.d.ts.map +1 -0
- package/dist/components/hud/WeatherIndicator/WeatherIndicator.types.js +12 -0
- package/dist/components/hud/WeatherIndicator/WeatherIndicator.types.js.map +1 -0
- package/dist/components/hud/WeatherIndicator/WeatherIndicator.utils.d.ts +5 -0
- package/dist/components/hud/WeatherIndicator/WeatherIndicator.utils.d.ts.map +1 -0
- package/dist/components/hud/WeatherIndicator/WeatherIndicator.utils.js +22 -0
- package/dist/components/hud/WeatherIndicator/WeatherIndicator.utils.js.map +1 -0
- package/dist/components/hud/WeatherIndicator/index.d.ts +4 -0
- package/dist/components/hud/WeatherIndicator/index.d.ts.map +1 -0
- package/dist/components/hud/hudChip.module.js +15 -0
- package/dist/components/hud/hudChip.module.js.map +1 -0
- package/dist/components/hud/index.d.ts +7 -0
- package/dist/components/hud/index.d.ts.map +1 -1
- package/dist/components/layout/BlockDivider/BlockDivider.d.ts +7 -0
- package/dist/components/layout/BlockDivider/BlockDivider.d.ts.map +1 -0
- package/dist/components/layout/BlockDivider/BlockDivider.js +54 -0
- package/dist/components/layout/BlockDivider/BlockDivider.js.map +1 -0
- package/dist/components/layout/BlockDivider/BlockDivider.module.js +13 -0
- package/dist/components/layout/BlockDivider/BlockDivider.module.js.map +1 -0
- package/dist/components/layout/BlockDivider/BlockDivider.types.d.ts +14 -0
- package/dist/components/layout/BlockDivider/BlockDivider.types.d.ts.map +1 -0
- package/dist/components/layout/BlockDivider/BlockDivider.types.js +10 -0
- package/dist/components/layout/BlockDivider/BlockDivider.types.js.map +1 -0
- package/dist/components/layout/BlockDivider/index.d.ts +4 -0
- package/dist/components/layout/BlockDivider/index.d.ts.map +1 -0
- package/dist/components/layout/BlockStack/BlockStack.d.ts +4 -0
- package/dist/components/layout/BlockStack/BlockStack.d.ts.map +1 -0
- package/dist/components/layout/BlockStack/BlockStack.js +22 -0
- package/dist/components/layout/BlockStack/BlockStack.js.map +1 -0
- package/dist/components/layout/BlockStack/BlockStack.module.js +7 -0
- package/dist/components/layout/BlockStack/BlockStack.module.js.map +1 -0
- package/dist/components/layout/BlockStack/BlockStack.types.d.ts +24 -0
- package/dist/components/layout/BlockStack/BlockStack.types.d.ts.map +1 -0
- package/dist/components/layout/BlockStack/BlockStack.types.js +18 -0
- package/dist/components/layout/BlockStack/BlockStack.types.js.map +1 -0
- package/dist/components/layout/BlockStack/index.d.ts +4 -0
- package/dist/components/layout/BlockStack/index.d.ts.map +1 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/components/navigation/BlockPagination/BlockPagination.d.ts +7 -0
- package/dist/components/navigation/BlockPagination/BlockPagination.d.ts.map +1 -0
- package/dist/components/navigation/BlockPagination/BlockPagination.js +83 -0
- package/dist/components/navigation/BlockPagination/BlockPagination.js.map +1 -0
- package/dist/components/navigation/BlockPagination/BlockPagination.module.js +19 -0
- package/dist/components/navigation/BlockPagination/BlockPagination.module.js.map +1 -0
- package/dist/components/navigation/BlockPagination/BlockPagination.types.d.ts +22 -0
- package/dist/components/navigation/BlockPagination/BlockPagination.types.d.ts.map +1 -0
- package/dist/components/navigation/BlockPagination/BlockPagination.utils.d.ts +7 -0
- package/dist/components/navigation/BlockPagination/BlockPagination.utils.d.ts.map +1 -0
- package/dist/components/navigation/BlockPagination/BlockPagination.utils.js +26 -0
- package/dist/components/navigation/BlockPagination/BlockPagination.utils.js.map +1 -0
- package/dist/components/navigation/BlockPagination/index.d.ts +5 -0
- package/dist/components/navigation/BlockPagination/index.d.ts.map +1 -0
- package/dist/components/navigation/index.d.ts +1 -0
- package/dist/components/navigation/index.d.ts.map +1 -1
- package/dist/components/social/ChatWindow/ChatWindow.d.ts +8 -0
- package/dist/components/social/ChatWindow/ChatWindow.d.ts.map +1 -0
- package/dist/components/social/ChatWindow/ChatWindow.js +146 -0
- package/dist/components/social/ChatWindow/ChatWindow.js.map +1 -0
- package/dist/components/social/ChatWindow/ChatWindow.module.js +27 -0
- package/dist/components/social/ChatWindow/ChatWindow.module.js.map +1 -0
- package/dist/components/social/ChatWindow/ChatWindow.types.d.ts +29 -0
- package/dist/components/social/ChatWindow/ChatWindow.types.d.ts.map +1 -0
- package/dist/components/social/ChatWindow/ChatWindow.types.js +12 -0
- package/dist/components/social/ChatWindow/ChatWindow.types.js.map +1 -0
- package/dist/components/social/ChatWindow/index.d.ts +4 -0
- package/dist/components/social/ChatWindow/index.d.ts.map +1 -0
- package/dist/components/social/CommandConsole/CommandConsole.d.ts +7 -0
- package/dist/components/social/CommandConsole/CommandConsole.d.ts.map +1 -0
- package/dist/components/social/CommandConsole/CommandConsole.js +187 -0
- package/dist/components/social/CommandConsole/CommandConsole.js.map +1 -0
- package/dist/components/social/CommandConsole/CommandConsole.module.js +31 -0
- package/dist/components/social/CommandConsole/CommandConsole.module.js.map +1 -0
- package/dist/components/social/CommandConsole/CommandConsole.types.d.ts +28 -0
- package/dist/components/social/CommandConsole/CommandConsole.types.d.ts.map +1 -0
- package/dist/components/social/CommandConsole/CommandConsole.types.js +11 -0
- package/dist/components/social/CommandConsole/CommandConsole.types.js.map +1 -0
- package/dist/components/social/CommandConsole/CommandConsole.utils.d.ts +4 -0
- package/dist/components/social/CommandConsole/CommandConsole.utils.d.ts.map +1 -0
- package/dist/components/social/CommandConsole/CommandConsole.utils.js +11 -0
- package/dist/components/social/CommandConsole/CommandConsole.utils.js.map +1 -0
- package/dist/components/social/CommandConsole/index.d.ts +5 -0
- package/dist/components/social/CommandConsole/index.d.ts.map +1 -0
- package/dist/components/social/index.d.ts +3 -0
- package/dist/components/social/index.d.ts.map +1 -0
- package/dist/hooks/useAnchoredPosition.d.ts +17 -0
- package/dist/hooks/useAnchoredPosition.d.ts.map +1 -0
- package/dist/hooks/useAnchoredPosition.js +62 -0
- package/dist/hooks/useAnchoredPosition.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -1
- package/dist/styles.css +2452 -354
- package/dist/utils/position.d.ts +41 -0
- package/dist/utils/position.d.ts.map +1 -0
- package/dist/utils/position.js +48 -0
- package/dist/utils/position.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { cx } from "../../../utils/cx.js";
|
|
2
|
+
import CommandConsole_module_default from "./CommandConsole.module.js";
|
|
3
|
+
import { suggestCommands } from "./CommandConsole.utils.js";
|
|
4
|
+
import { forwardRef, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/social/CommandConsole/CommandConsole.tsx
|
|
7
|
+
var STICK_THRESHOLD = 24;
|
|
8
|
+
/**
|
|
9
|
+
* Command console: an output log above a "/" command line with suggestions
|
|
10
|
+
* (WAI-ARIA combobox). Tab completes, ↑ / ↓ pick a suggestion or recall history.
|
|
11
|
+
*/
|
|
12
|
+
var CommandConsole = forwardRef(function CommandConsole({ entries, commands = [], onRun, size = "md", label = "Console", className, ...rest }, ref) {
|
|
13
|
+
const baseId = useId();
|
|
14
|
+
const listId = `${baseId}-suggestions`;
|
|
15
|
+
const logRef = useRef(null);
|
|
16
|
+
const stick = useRef(true);
|
|
17
|
+
const [draft, setDraft] = useState("");
|
|
18
|
+
const [active, setActive] = useState(0);
|
|
19
|
+
const [dismissed, setDismissed] = useState(false);
|
|
20
|
+
const [history, setHistory] = useState([]);
|
|
21
|
+
const [historyIndex, setHistoryIndex] = useState(null);
|
|
22
|
+
const suggestions = dismissed ? [] : suggestCommands(draft, commands);
|
|
23
|
+
const open = suggestions.length > 0;
|
|
24
|
+
const activeIndex = Math.min(active, suggestions.length - 1);
|
|
25
|
+
useLayoutEffect(() => {
|
|
26
|
+
const log = logRef.current;
|
|
27
|
+
if (log && stick.current) log.scrollTop = log.scrollHeight;
|
|
28
|
+
}, [entries]);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const log = logRef.current;
|
|
31
|
+
if (!log) return void 0;
|
|
32
|
+
const onScroll = () => {
|
|
33
|
+
stick.current = log.scrollHeight - log.scrollTop - log.clientHeight <= STICK_THRESHOLD;
|
|
34
|
+
};
|
|
35
|
+
log.addEventListener("scroll", onScroll);
|
|
36
|
+
return () => log.removeEventListener("scroll", onScroll);
|
|
37
|
+
}, []);
|
|
38
|
+
const update = (value) => {
|
|
39
|
+
setDraft(value);
|
|
40
|
+
setActive(0);
|
|
41
|
+
setDismissed(false);
|
|
42
|
+
setHistoryIndex(null);
|
|
43
|
+
};
|
|
44
|
+
const complete = (index) => {
|
|
45
|
+
const command = suggestions[index];
|
|
46
|
+
if (!command) return;
|
|
47
|
+
setDraft(`/${command.name} `);
|
|
48
|
+
setActive(0);
|
|
49
|
+
};
|
|
50
|
+
const submit = (event) => {
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
const command = draft.trim();
|
|
53
|
+
if (!command) return;
|
|
54
|
+
onRun?.(command);
|
|
55
|
+
setHistory((previous) => [...previous, command]);
|
|
56
|
+
update("");
|
|
57
|
+
stick.current = true;
|
|
58
|
+
};
|
|
59
|
+
const recall = (direction) => {
|
|
60
|
+
if (history.length === 0) return;
|
|
61
|
+
if (direction === -1) {
|
|
62
|
+
const next = historyIndex === null ? history.length - 1 : Math.max(0, historyIndex - 1);
|
|
63
|
+
setHistoryIndex(next);
|
|
64
|
+
setDraft(history[next] ?? "");
|
|
65
|
+
} else if (historyIndex !== null) {
|
|
66
|
+
const next = historyIndex + 1;
|
|
67
|
+
setHistoryIndex(next >= history.length ? null : next);
|
|
68
|
+
setDraft(next >= history.length ? "" : history[next] ?? "");
|
|
69
|
+
}
|
|
70
|
+
setDismissed(true);
|
|
71
|
+
};
|
|
72
|
+
const onKeyDown = (event) => {
|
|
73
|
+
if (open) {
|
|
74
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
const step = event.key === "ArrowDown" ? 1 : -1;
|
|
77
|
+
setActive((activeIndex + step + suggestions.length) % suggestions.length);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (event.key === "Tab" && !event.shiftKey) {
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
complete(activeIndex);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (event.key === "Escape") {
|
|
86
|
+
event.preventDefault();
|
|
87
|
+
setDismissed(true);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (event.key === "ArrowUp") {
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
recall(-1);
|
|
94
|
+
} else if (event.key === "ArrowDown") {
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
recall(1);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
100
|
+
ref,
|
|
101
|
+
role: "region",
|
|
102
|
+
"aria-label": label,
|
|
103
|
+
"data-size": size,
|
|
104
|
+
className: cx(CommandConsole_module_default.console, className),
|
|
105
|
+
...rest,
|
|
106
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
107
|
+
ref: logRef,
|
|
108
|
+
role: "log",
|
|
109
|
+
"aria-label": `${label} output`,
|
|
110
|
+
tabIndex: 0,
|
|
111
|
+
className: CommandConsole_module_default.log,
|
|
112
|
+
children: /* @__PURE__ */ jsx("ol", {
|
|
113
|
+
className: CommandConsole_module_default.list,
|
|
114
|
+
children: entries.map((entry) => /* @__PURE__ */ jsx("li", {
|
|
115
|
+
className: CommandConsole_module_default.entry,
|
|
116
|
+
"data-kind": entry.kind ?? "output",
|
|
117
|
+
children: entry.text
|
|
118
|
+
}, entry.id))
|
|
119
|
+
})
|
|
120
|
+
}), onRun ? /* @__PURE__ */ jsxs("form", {
|
|
121
|
+
className: CommandConsole_module_default.form,
|
|
122
|
+
onSubmit: submit,
|
|
123
|
+
children: [
|
|
124
|
+
open ? /* @__PURE__ */ jsx("ul", {
|
|
125
|
+
id: listId,
|
|
126
|
+
role: "listbox",
|
|
127
|
+
"aria-label": "Command suggestions",
|
|
128
|
+
className: CommandConsole_module_default.suggestions,
|
|
129
|
+
children: suggestions.map((command, index) => /* @__PURE__ */ jsxs("li", {
|
|
130
|
+
id: `${listId}-${index}`,
|
|
131
|
+
role: "option",
|
|
132
|
+
"aria-selected": index === activeIndex,
|
|
133
|
+
className: CommandConsole_module_default.suggestion,
|
|
134
|
+
onMouseDown: (event) => {
|
|
135
|
+
event.preventDefault();
|
|
136
|
+
complete(index);
|
|
137
|
+
},
|
|
138
|
+
children: [
|
|
139
|
+
/* @__PURE__ */ jsxs("span", {
|
|
140
|
+
className: CommandConsole_module_default.name,
|
|
141
|
+
children: ["/", command.name]
|
|
142
|
+
}),
|
|
143
|
+
command.usage ? /* @__PURE__ */ jsxs("span", {
|
|
144
|
+
className: CommandConsole_module_default.usage,
|
|
145
|
+
children: [" ", command.usage]
|
|
146
|
+
}) : null,
|
|
147
|
+
command.description ? /* @__PURE__ */ jsxs("span", {
|
|
148
|
+
className: CommandConsole_module_default.description,
|
|
149
|
+
children: [" — ", command.description]
|
|
150
|
+
}) : null
|
|
151
|
+
]
|
|
152
|
+
}, command.name))
|
|
153
|
+
}) : null,
|
|
154
|
+
/* @__PURE__ */ jsx("label", {
|
|
155
|
+
htmlFor: `${baseId}-input`,
|
|
156
|
+
className: "block-visually-hidden",
|
|
157
|
+
children: "Command"
|
|
158
|
+
}),
|
|
159
|
+
/* @__PURE__ */ jsx("span", {
|
|
160
|
+
className: CommandConsole_module_default.prompt,
|
|
161
|
+
"aria-hidden": "true",
|
|
162
|
+
children: ">"
|
|
163
|
+
}),
|
|
164
|
+
/* @__PURE__ */ jsx("input", {
|
|
165
|
+
id: `${baseId}-input`,
|
|
166
|
+
type: "text",
|
|
167
|
+
role: "combobox",
|
|
168
|
+
"aria-autocomplete": "list",
|
|
169
|
+
"aria-expanded": open,
|
|
170
|
+
"aria-controls": open ? listId : void 0,
|
|
171
|
+
"aria-activedescendant": open ? `${listId}-${activeIndex}` : void 0,
|
|
172
|
+
value: draft,
|
|
173
|
+
placeholder: "/help",
|
|
174
|
+
autoComplete: "off",
|
|
175
|
+
spellCheck: false,
|
|
176
|
+
className: CommandConsole_module_default.input,
|
|
177
|
+
onChange: (event) => update(event.target.value),
|
|
178
|
+
onKeyDown
|
|
179
|
+
})
|
|
180
|
+
]
|
|
181
|
+
}) : null]
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
//#endregion
|
|
185
|
+
export { CommandConsole };
|
|
186
|
+
|
|
187
|
+
//# sourceMappingURL=CommandConsole.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandConsole.js","names":["styles"],"sources":["../../../../src/components/social/CommandConsole/CommandConsole.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type FormEvent,\n type KeyboardEvent,\n} from \"react\";\nimport { cx } from \"../../../utils/cx\";\nimport styles from \"./CommandConsole.module.css\";\nimport type { CommandConsoleProps } from \"./CommandConsole.types\";\nimport { suggestCommands } from \"./CommandConsole.utils\";\n\nconst STICK_THRESHOLD = 24;\n\n/**\n * Command console: an output log above a \"/\" command line with suggestions\n * (WAI-ARIA combobox). Tab completes, ↑ / ↓ pick a suggestion or recall history.\n */\nexport const CommandConsole = forwardRef<HTMLDivElement, CommandConsoleProps>(\n function CommandConsole(\n { entries, commands = [], onRun, size = \"md\", label = \"Console\", className, ...rest },\n ref,\n ) {\n const baseId = useId();\n const listId = `${baseId}-suggestions`;\n const logRef = useRef<HTMLDivElement>(null);\n const stick = useRef(true);\n const [draft, setDraft] = useState(\"\");\n const [active, setActive] = useState(0);\n const [dismissed, setDismissed] = useState(false);\n const [history, setHistory] = useState<string[]>([]);\n const [historyIndex, setHistoryIndex] = useState<number | null>(null);\n\n const suggestions = dismissed ? [] : suggestCommands(draft, commands);\n const open = suggestions.length > 0;\n const activeIndex = Math.min(active, suggestions.length - 1);\n\n useLayoutEffect(() => {\n const log = logRef.current;\n if (log && stick.current) log.scrollTop = log.scrollHeight;\n }, [entries]);\n\n useEffect(() => {\n const log = logRef.current;\n if (!log) return undefined;\n const onScroll = () => {\n stick.current = log.scrollHeight - log.scrollTop - log.clientHeight <= STICK_THRESHOLD;\n };\n log.addEventListener(\"scroll\", onScroll);\n return () => log.removeEventListener(\"scroll\", onScroll);\n }, []);\n\n const update = (value: string) => {\n setDraft(value);\n setActive(0);\n setDismissed(false);\n setHistoryIndex(null);\n };\n\n const complete = (index: number) => {\n const command = suggestions[index];\n if (!command) return;\n setDraft(`/${command.name} `);\n setActive(0);\n };\n\n const submit = (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n const command = draft.trim();\n if (!command) return;\n onRun?.(command);\n setHistory((previous) => [...previous, command]);\n update(\"\");\n stick.current = true;\n };\n\n const recall = (direction: -1 | 1) => {\n if (history.length === 0) return;\n if (direction === -1) {\n const next = historyIndex === null ? history.length - 1 : Math.max(0, historyIndex - 1);\n setHistoryIndex(next);\n setDraft(history[next] ?? \"\");\n } else if (historyIndex !== null) {\n const next = historyIndex + 1;\n setHistoryIndex(next >= history.length ? null : next);\n setDraft(next >= history.length ? \"\" : (history[next] ?? \"\"));\n }\n setDismissed(true);\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (open) {\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n const step = event.key === \"ArrowDown\" ? 1 : -1;\n setActive((activeIndex + step + suggestions.length) % suggestions.length);\n return;\n }\n if (event.key === \"Tab\" && !event.shiftKey) {\n event.preventDefault();\n complete(activeIndex);\n return;\n }\n if (event.key === \"Escape\") {\n event.preventDefault();\n setDismissed(true);\n return;\n }\n }\n if (event.key === \"ArrowUp\") {\n event.preventDefault();\n recall(-1);\n } else if (event.key === \"ArrowDown\") {\n event.preventDefault();\n recall(1);\n }\n };\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={label}\n data-size={size}\n className={cx(styles.console, className)}\n {...rest}\n >\n <div\n ref={logRef}\n role=\"log\"\n aria-label={`${label} output`}\n // Scrollable log: keyboard users must be able to focus it to scroll.\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}\n className={styles.log}\n >\n <ol className={styles.list}>\n {entries.map((entry) => (\n <li key={entry.id} className={styles.entry} data-kind={entry.kind ?? \"output\"}>\n {entry.text}\n </li>\n ))}\n </ol>\n </div>\n {onRun ? (\n <form className={styles.form} onSubmit={submit}>\n {open ? (\n <ul\n id={listId}\n role=\"listbox\"\n aria-label=\"Command suggestions\"\n className={styles.suggestions}\n >\n {suggestions.map((command, index) => (\n <li\n key={command.name}\n id={`${listId}-${index}`}\n role=\"option\"\n aria-selected={index === activeIndex}\n className={styles.suggestion}\n // Pointer users pick with a click; keyboard users use the input's arrow keys.\n onMouseDown={(event) => {\n event.preventDefault();\n complete(index);\n }}\n >\n <span className={styles.name}>/{command.name}</span>\n {command.usage ? <span className={styles.usage}> {command.usage}</span> : null}\n {command.description ? (\n <span className={styles.description}> — {command.description}</span>\n ) : null}\n </li>\n ))}\n </ul>\n ) : null}\n <label htmlFor={`${baseId}-input`} className=\"block-visually-hidden\">\n Command\n </label>\n <span className={styles.prompt} aria-hidden=\"true\">\n >\n </span>\n <input\n id={`${baseId}-input`}\n type=\"text\"\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded={open}\n aria-controls={open ? listId : undefined}\n aria-activedescendant={open ? `${listId}-${activeIndex}` : undefined}\n value={draft}\n placeholder=\"/help\"\n autoComplete=\"off\"\n spellCheck={false}\n className={styles.input}\n onChange={(event) => update(event.target.value)}\n onKeyDown={onKeyDown}\n />\n </form>\n ) : null}\n </div>\n );\n },\n);\n"],"mappings":"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"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/components/social/CommandConsole/CommandConsole.module.css
|
|
2
|
+
var console = "block-console-qcWGr";
|
|
3
|
+
var log = "block-log-pWlGe";
|
|
4
|
+
var list = "block-list-MIIVP";
|
|
5
|
+
var entry = "block-entry--mmGM";
|
|
6
|
+
var form = "block-form-tWoQQ";
|
|
7
|
+
var prompt = "block-prompt-BftNf";
|
|
8
|
+
var input = "block-input-GFfLX";
|
|
9
|
+
var suggestions = "block-suggestions-kbQEK";
|
|
10
|
+
var suggestion = "block-suggestion-gbqGK";
|
|
11
|
+
var name = "block-name-V4HmU";
|
|
12
|
+
var usage = "block-usage-58Sl7";
|
|
13
|
+
var description = "block-description-hVsJo";
|
|
14
|
+
var CommandConsole_module_default = {
|
|
15
|
+
console,
|
|
16
|
+
log,
|
|
17
|
+
list,
|
|
18
|
+
entry,
|
|
19
|
+
form,
|
|
20
|
+
prompt,
|
|
21
|
+
input,
|
|
22
|
+
suggestions,
|
|
23
|
+
suggestion,
|
|
24
|
+
name,
|
|
25
|
+
usage,
|
|
26
|
+
description
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { console, CommandConsole_module_default as default, description, entry, form, input, list, log, name, prompt, suggestion, suggestions, usage };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=CommandConsole.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandConsole.module.js","names":[],"sources":["../../../../src/components/social/CommandConsole/CommandConsole.module.css"],"sourcesContent":[".console {\n --console-height: 240px;\n display: flex;\n flex-direction: column;\n width: 100%;\n max-width: 640px;\n font-family: var(--block-font-mono);\n font-size: var(--block-font-size-sm);\n color: var(--block-text-primary);\n background-color: color-mix(in srgb, var(--block-black) 88%, transparent);\n border: var(--block-border-width-thin) solid var(--block-obsidian-light);\n}\n\n.console[data-size=\"sm\"] {\n --console-height: 160px;\n}\n\n.console[data-size=\"lg\"] {\n --console-height: 360px;\n}\n\n.log {\n display: flex;\n flex-direction: column;\n height: var(--console-height);\n padding: var(--block-space-2);\n overflow-y: auto;\n scrollbar-width: thin;\n}\n\n.log:focus-visible {\n outline: 3px solid var(--block-focus);\n outline-offset: -3px;\n}\n\n.list {\n display: flex;\n flex-direction: column;\n gap: 2px;\n margin: auto 0 0;\n padding: 0;\n list-style: none;\n}\n\n.entry {\n line-height: var(--block-line-height-normal);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n\n.entry[data-kind=\"input\"] {\n color: var(--block-text-secondary);\n}\n\n.entry[data-kind=\"input\"]::before {\n content: \"> \";\n}\n\n.entry[data-kind=\"success\"] {\n color: var(--block-emerald-light);\n}\n\n.entry[data-kind=\"error\"] {\n color: var(--block-redstone-light);\n}\n\n.form {\n position: relative;\n display: flex;\n align-items: center;\n gap: var(--block-space-1);\n padding: var(--block-space-1) var(--block-space-2);\n border-top: var(--block-border-width-thin) solid var(--block-obsidian-light);\n}\n\n.prompt {\n color: var(--block-emerald-light);\n}\n\n.input {\n flex: 1;\n min-width: 0;\n min-height: 36px;\n padding: 0 var(--block-space-1);\n font: inherit;\n color: var(--block-text-primary);\n background: transparent;\n border: 0;\n}\n\n.input::placeholder {\n color: var(--block-text-secondary);\n}\n\n.input:focus-visible {\n outline: 3px solid var(--block-focus);\n outline-offset: 0;\n}\n\n.suggestions {\n position: absolute;\n bottom: 100%;\n left: 0;\n right: 0;\n z-index: var(--block-z-dropdown);\n max-height: 180px;\n margin: 0;\n padding: var(--block-space-1);\n overflow-y: auto;\n list-style: none;\n background-color: var(--block-obsidian-dark);\n border: var(--block-border-width-thin) solid var(--block-obsidian-light);\n}\n\n.suggestion {\n padding: 2px var(--block-space-1);\n cursor: pointer;\n overflow-wrap: anywhere;\n}\n\n.suggestion[aria-selected=\"true\"] {\n background-color: var(--block-obsidian-light);\n}\n\n.name {\n color: var(--block-gold-light);\n}\n\n.usage {\n color: var(--block-text-primary);\n}\n\n.description {\n color: var(--block-text-secondary);\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export declare const consoleEntryKinds: readonly ["input", "output", "success", "error"];
|
|
3
|
+
export type ConsoleEntryKind = (typeof consoleEntryKinds)[number];
|
|
4
|
+
export interface ConsoleEntry {
|
|
5
|
+
id: string;
|
|
6
|
+
/** `input` echoes a command; the others are responses. @default "output" */
|
|
7
|
+
kind?: ConsoleEntryKind;
|
|
8
|
+
text: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface ConsoleCommand {
|
|
11
|
+
/** Command name without the slash, e.g. "gamemode". */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Argument hint, e.g. "<mode> [player]". */
|
|
14
|
+
usage?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface CommandConsoleProps extends HTMLAttributes<HTMLDivElement> {
|
|
18
|
+
entries: ConsoleEntry[];
|
|
19
|
+
/** Commands offered as suggestions after typing "/". */
|
|
20
|
+
commands?: ConsoleCommand[];
|
|
21
|
+
/** Called with the trimmed command line (including the leading "/") on Enter. */
|
|
22
|
+
onRun?: (command: string) => void;
|
|
23
|
+
/** Log height. @default "md" */
|
|
24
|
+
size?: "sm" | "md" | "lg";
|
|
25
|
+
/** Accessible name. @default "Console" */
|
|
26
|
+
label?: string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=CommandConsole.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandConsole.types.d.ts","sourceRoot":"","sources":["../../../../src/components/social/CommandConsole/CommandConsole.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,eAAO,MAAM,iBAAiB,kDAAmD,CAAC;AAElF,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,4EAA4E;IAC5E,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAoB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACzE,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B,iFAAiF;IACjF,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,gCAAgC;IAChC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandConsole.types.js","names":[],"sources":["../../../../src/components/social/CommandConsole/CommandConsole.types.ts"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from \"react\";\n\nexport const consoleEntryKinds = [\"input\", \"output\", \"success\", \"error\"] as const;\n\nexport type ConsoleEntryKind = (typeof consoleEntryKinds)[number];\n\nexport interface ConsoleEntry {\n id: string;\n /** `input` echoes a command; the others are responses. @default \"output\" */\n kind?: ConsoleEntryKind;\n text: ReactNode;\n}\n\nexport interface ConsoleCommand {\n /** Command name without the slash, e.g. \"gamemode\". */\n name: string;\n /** Argument hint, e.g. \"<mode> [player]\". */\n usage?: string;\n description?: string;\n}\n\nexport interface CommandConsoleProps extends HTMLAttributes<HTMLDivElement> {\n entries: ConsoleEntry[];\n /** Commands offered as suggestions after typing \"/\". */\n commands?: ConsoleCommand[];\n /** Called with the trimmed command line (including the leading \"/\") on Enter. */\n onRun?: (command: string) => void;\n /** Log height. @default \"md\" */\n size?: \"sm\" | \"md\" | \"lg\";\n /** Accessible name. @default \"Console\" */\n label?: string;\n}\n"],"mappings":";AAEA,IAAa,oBAAoB;CAAC;CAAS;CAAU;CAAW;AAAO"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ConsoleCommand } from "./CommandConsole.types";
|
|
2
|
+
/** Commands whose name starts with the typed word, while the user is still typing the name. */
|
|
3
|
+
export declare function suggestCommands(input: string, commands: ConsoleCommand[]): ConsoleCommand[];
|
|
4
|
+
//# sourceMappingURL=CommandConsole.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandConsole.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/social/CommandConsole/CommandConsole.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,+FAA+F;AAC/F,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAI3F"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/components/social/CommandConsole/CommandConsole.utils.ts
|
|
2
|
+
/** Commands whose name starts with the typed word, while the user is still typing the name. */
|
|
3
|
+
function suggestCommands(input, commands) {
|
|
4
|
+
if (!input.startsWith("/") || input.includes(" ")) return [];
|
|
5
|
+
const word = input.slice(1).toLowerCase();
|
|
6
|
+
return commands.filter((command) => command.name.toLowerCase().startsWith(word));
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { suggestCommands };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=CommandConsole.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandConsole.utils.js","names":[],"sources":["../../../../src/components/social/CommandConsole/CommandConsole.utils.ts"],"sourcesContent":["import type { ConsoleCommand } from \"./CommandConsole.types\";\n\n/** Commands whose name starts with the typed word, while the user is still typing the name. */\nexport function suggestCommands(input: string, commands: ConsoleCommand[]): ConsoleCommand[] {\n if (!input.startsWith(\"/\") || input.includes(\" \")) return [];\n const word = input.slice(1).toLowerCase();\n return commands.filter((command) => command.name.toLowerCase().startsWith(word));\n}\n"],"mappings":";;AAGA,SAAgB,gBAAgB,OAAe,UAA8C;CAC3F,IAAI,CAAC,MAAM,WAAW,GAAG,KAAK,MAAM,SAAS,GAAG,GAAG,OAAO,CAAC;CAC3D,MAAM,OAAO,MAAM,MAAM,CAAC,CAAC,CAAC,YAAY;CACxC,OAAO,SAAS,QAAQ,YAAY,QAAQ,KAAK,YAAY,CAAC,CAAC,WAAW,IAAI,CAAC;AACjF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { CommandConsole } from "./CommandConsole";
|
|
2
|
+
export { consoleEntryKinds } from "./CommandConsole.types";
|
|
3
|
+
export { suggestCommands } from "./CommandConsole.utils";
|
|
4
|
+
export type { CommandConsoleProps, ConsoleCommand, ConsoleEntry, ConsoleEntryKind, } from "./CommandConsole.types";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/social/CommandConsole/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,gBAAgB,GACjB,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/social/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type CSSProperties, type RefObject } from "react";
|
|
2
|
+
import { type FloatingAlign, type FloatingPosition, type FloatingSide } from "../utils/position";
|
|
3
|
+
export interface AnchoredPosition extends FloatingPosition {
|
|
4
|
+
/** Custom properties for the floating element (`--block-float-*`). */
|
|
5
|
+
style: CSSProperties;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Keeps a `position: fixed` floating element (rendered in a portal) next to
|
|
9
|
+
* its anchor while open, following scroll and resize. Returns `null` until
|
|
10
|
+
* the first measurement.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useAnchoredPosition(anchorRef: RefObject<HTMLElement | null>, floatingRef: RefObject<HTMLElement | null>, open: boolean, { side, align, gap }: {
|
|
13
|
+
side: FloatingSide;
|
|
14
|
+
align?: FloatingAlign;
|
|
15
|
+
gap?: number;
|
|
16
|
+
}): AnchoredPosition | null;
|
|
17
|
+
//# sourceMappingURL=useAnchoredPosition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAnchoredPosition.d.ts","sourceRoot":"","sources":["../../src/hooks/useAnchoredPosition.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtF,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACxD,sEAAsE;IACtE,KAAK,EAAE,aAAa,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EACxC,WAAW,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAC1C,IAAI,EAAE,OAAO,EACb,EAAE,IAAI,EAAE,KAAgB,EAAE,GAAO,EAAE,EAAE;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,KAAK,CAAC,EAAE,aAAa,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/F,gBAAgB,GAAG,IAAI,CA8CzB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { computePosition } from "../utils/position.js";
|
|
2
|
+
import { useLayoutEffect, useState } from "react";
|
|
3
|
+
//#region src/hooks/useAnchoredPosition.ts
|
|
4
|
+
/**
|
|
5
|
+
* Keeps a `position: fixed` floating element (rendered in a portal) next to
|
|
6
|
+
* its anchor while open, following scroll and resize. Returns `null` until
|
|
7
|
+
* the first measurement.
|
|
8
|
+
*/
|
|
9
|
+
function useAnchoredPosition(anchorRef, floatingRef, open, { side, align = "center", gap = 8 }) {
|
|
10
|
+
const [position, setPosition] = useState(null);
|
|
11
|
+
useLayoutEffect(() => {
|
|
12
|
+
if (!open) return void 0;
|
|
13
|
+
const update = () => {
|
|
14
|
+
const anchor = anchorRef.current;
|
|
15
|
+
const floating = floatingRef.current;
|
|
16
|
+
if (!anchor || !floating) return;
|
|
17
|
+
const anchorRect = anchor.getBoundingClientRect();
|
|
18
|
+
const next = computePosition({
|
|
19
|
+
anchor: anchorRect,
|
|
20
|
+
floating: {
|
|
21
|
+
width: floating.offsetWidth,
|
|
22
|
+
height: floating.offsetHeight
|
|
23
|
+
},
|
|
24
|
+
viewport: {
|
|
25
|
+
width: window.innerWidth,
|
|
26
|
+
height: window.innerHeight
|
|
27
|
+
},
|
|
28
|
+
side,
|
|
29
|
+
align,
|
|
30
|
+
gap
|
|
31
|
+
});
|
|
32
|
+
setPosition((previous) => previous && previous.x === next.x && previous.y === next.y && previous.side === next.side && previous.arrow === next.arrow ? previous : {
|
|
33
|
+
...next,
|
|
34
|
+
style: {
|
|
35
|
+
"--block-float-x": `${next.x}px`,
|
|
36
|
+
"--block-float-y": `${next.y}px`,
|
|
37
|
+
"--block-float-arrow": `${next.arrow}px`,
|
|
38
|
+
"--block-float-anchor-width": `${anchorRect.width}px`
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
update();
|
|
43
|
+
window.addEventListener("scroll", update, true);
|
|
44
|
+
window.addEventListener("resize", update);
|
|
45
|
+
return () => {
|
|
46
|
+
window.removeEventListener("scroll", update, true);
|
|
47
|
+
window.removeEventListener("resize", update);
|
|
48
|
+
};
|
|
49
|
+
}, [
|
|
50
|
+
open,
|
|
51
|
+
side,
|
|
52
|
+
align,
|
|
53
|
+
gap,
|
|
54
|
+
anchorRef,
|
|
55
|
+
floatingRef
|
|
56
|
+
]);
|
|
57
|
+
return open ? position : null;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { useAnchoredPosition };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=useAnchoredPosition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAnchoredPosition.js","names":[],"sources":["../../src/hooks/useAnchoredPosition.ts"],"sourcesContent":["import { useLayoutEffect, useState, type CSSProperties, type RefObject } from \"react\";\nimport {\n computePosition,\n type FloatingAlign,\n type FloatingPosition,\n type FloatingSide,\n} from \"../utils/position\";\n\nexport interface AnchoredPosition extends FloatingPosition {\n /** Custom properties for the floating element (`--block-float-*`). */\n style: CSSProperties;\n}\n\n/**\n * Keeps a `position: fixed` floating element (rendered in a portal) next to\n * its anchor while open, following scroll and resize. Returns `null` until\n * the first measurement.\n */\nexport function useAnchoredPosition(\n anchorRef: RefObject<HTMLElement | null>,\n floatingRef: RefObject<HTMLElement | null>,\n open: boolean,\n { side, align = \"center\", gap = 8 }: { side: FloatingSide; align?: FloatingAlign; gap?: number },\n): AnchoredPosition | null {\n const [position, setPosition] = useState<AnchoredPosition | null>(null);\n\n useLayoutEffect(() => {\n if (!open) return undefined;\n const update = () => {\n const anchor = anchorRef.current;\n const floating = floatingRef.current;\n if (!anchor || !floating) return;\n const anchorRect = anchor.getBoundingClientRect();\n const next = computePosition({\n anchor: anchorRect,\n floating: { width: floating.offsetWidth, height: floating.offsetHeight },\n viewport: { width: window.innerWidth, height: window.innerHeight },\n side,\n align,\n gap,\n });\n setPosition((previous) =>\n previous &&\n previous.x === next.x &&\n previous.y === next.y &&\n previous.side === next.side &&\n previous.arrow === next.arrow\n ? previous\n : {\n ...next,\n style: {\n \"--block-float-x\": `${next.x}px`,\n \"--block-float-y\": `${next.y}px`,\n \"--block-float-arrow\": `${next.arrow}px`,\n \"--block-float-anchor-width\": `${anchorRect.width}px`,\n } as CSSProperties,\n },\n );\n };\n update();\n window.addEventListener(\"scroll\", update, true);\n window.addEventListener(\"resize\", update);\n return () => {\n window.removeEventListener(\"scroll\", update, true);\n window.removeEventListener(\"resize\", update);\n };\n }, [open, side, align, gap, anchorRef, floatingRef]);\n\n return open ? position : null;\n}\n"],"mappings":";;;;;;;;AAkBA,SAAgB,oBACd,WACA,aACA,MACA,EAAE,MAAM,QAAQ,UAAU,MAAM,KACP;CACzB,MAAM,CAAC,UAAU,eAAe,SAAkC,IAAI;CAEtE,sBAAsB;EACpB,IAAI,CAAC,MAAM,OAAO,KAAA;EAClB,MAAM,eAAe;GACnB,MAAM,SAAS,UAAU;GACzB,MAAM,WAAW,YAAY;GAC7B,IAAI,CAAC,UAAU,CAAC,UAAU;GAC1B,MAAM,aAAa,OAAO,sBAAsB;GAChD,MAAM,OAAO,gBAAgB;IAC3B,QAAQ;IACR,UAAU;KAAE,OAAO,SAAS;KAAa,QAAQ,SAAS;IAAa;IACvE,UAAU;KAAE,OAAO,OAAO;KAAY,QAAQ,OAAO;IAAY;IACjE;IACA;IACA;GACF,CAAC;GACD,aAAa,aACX,YACA,SAAS,MAAM,KAAK,KACpB,SAAS,MAAM,KAAK,KACpB,SAAS,SAAS,KAAK,QACvB,SAAS,UAAU,KAAK,QACpB,WACA;IACE,GAAG;IACH,OAAO;KACL,mBAAmB,GAAG,KAAK,EAAE;KAC7B,mBAAmB,GAAG,KAAK,EAAE;KAC7B,uBAAuB,GAAG,KAAK,MAAM;KACrC,8BAA8B,GAAG,WAAW,MAAM;IACpD;GACF,CACN;EACF;EACA,OAAO;EACP,OAAO,iBAAiB,UAAU,QAAQ,IAAI;EAC9C,OAAO,iBAAiB,UAAU,MAAM;EACxC,aAAa;GACX,OAAO,oBAAoB,UAAU,QAAQ,IAAI;GACjD,OAAO,oBAAoB,UAAU,MAAM;EAC7C;CACF,GAAG;EAAC;EAAM;EAAM;EAAO;EAAK;EAAW;CAAW,CAAC;CAEnD,OAAO,OAAO,WAAW;AAC3B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./components/crafting";
|
|
|
7
7
|
export * from "./components/hud";
|
|
8
8
|
export * from "./components/cards";
|
|
9
9
|
export * from "./components/display";
|
|
10
|
+
export * from "./components/social";
|
|
10
11
|
export * from "./components/navigation";
|
|
11
12
|
export * from "./components/layout";
|
|
12
13
|
export * from "./components/feedback";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAE5B,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAE5B,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { BlockUIProvider } from "./provider/BlockUIProvider.js";
|
|
|
9
9
|
import { BlockButton } from "./components/actions/BlockButton/BlockButton.js";
|
|
10
10
|
import { blockButtonVariants } from "./components/actions/BlockButton/BlockButton.types.js";
|
|
11
11
|
import { IconButton } from "./components/actions/IconButton/IconButton.js";
|
|
12
|
+
import { BlockMenu } from "./components/actions/BlockMenu/BlockMenu.js";
|
|
12
13
|
import { BlockInput } from "./components/forms/BlockInput/BlockInput.js";
|
|
13
14
|
import { BlockTextarea } from "./components/forms/BlockTextarea/BlockTextarea.js";
|
|
14
15
|
import { BlockSelect } from "./components/forms/BlockSelect/BlockSelect.js";
|
|
@@ -38,11 +39,35 @@ import { CraftingTable } from "./components/crafting/CraftingTable/CraftingTable
|
|
|
38
39
|
import { getFurnaceState } from "./components/crafting/Furnace/Furnace.utils.js";
|
|
39
40
|
import { Furnace } from "./components/crafting/Furnace/Furnace.js";
|
|
40
41
|
import { furnaceStates } from "./components/crafting/Furnace/Furnace.types.js";
|
|
42
|
+
import { EnchantingTable } from "./components/crafting/EnchantingTable/EnchantingTable.js";
|
|
43
|
+
import { getBrewingState } from "./components/crafting/BrewingStand/BrewingStand.utils.js";
|
|
44
|
+
import { BrewingStand } from "./components/crafting/BrewingStand/BrewingStand.js";
|
|
45
|
+
import { brewingStates } from "./components/crafting/BrewingStand/BrewingStand.types.js";
|
|
46
|
+
import { anvilCostState } from "./components/crafting/Anvil/Anvil.utils.js";
|
|
47
|
+
import { Anvil } from "./components/crafting/Anvil/Anvil.js";
|
|
48
|
+
import { villagerLevels } from "./components/crafting/TradingUI/TradingUI.types.js";
|
|
49
|
+
import { TradingUI } from "./components/crafting/TradingUI/TradingUI.js";
|
|
50
|
+
import { filterRecipes } from "./components/crafting/RecipeBook/RecipeBook.utils.js";
|
|
51
|
+
import { RecipeBook } from "./components/crafting/RecipeBook/RecipeBook.js";
|
|
41
52
|
import { HealthBar } from "./components/hud/HealthBar/HealthBar.js";
|
|
42
53
|
import { ArmorBar } from "./components/hud/ArmorBar/ArmorBar.js";
|
|
43
54
|
import { HungerBar } from "./components/hud/HungerBar/HungerBar.js";
|
|
44
55
|
import { XPBar } from "./components/hud/XPBar/XPBar.js";
|
|
45
56
|
import { PlayerHUD } from "./components/hud/PlayerHUD/PlayerHUD.js";
|
|
57
|
+
import { BossBar } from "./components/hud/BossBar/BossBar.js";
|
|
58
|
+
import { bossBarColors, bossBarSegments } from "./components/hud/BossBar/BossBar.types.js";
|
|
59
|
+
import { Scoreboard } from "./components/hud/Scoreboard/Scoreboard.js";
|
|
60
|
+
import { CoordinatesHUD } from "./components/hud/CoordinatesHUD/CoordinatesHUD.js";
|
|
61
|
+
import { facings } from "./components/hud/CoordinatesHUD/CoordinatesHUD.types.js";
|
|
62
|
+
import { BiomeIndicator } from "./components/hud/BiomeIndicator/BiomeIndicator.js";
|
|
63
|
+
import { biomeTypes } from "./components/hud/BiomeIndicator/BiomeIndicator.types.js";
|
|
64
|
+
import { dayPhase, formatClock } from "./components/hud/DayNightIndicator/DayNightIndicator.utils.js";
|
|
65
|
+
import { DayNightIndicator } from "./components/hud/DayNightIndicator/DayNightIndicator.js";
|
|
66
|
+
import { WeatherIndicator } from "./components/hud/WeatherIndicator/WeatherIndicator.js";
|
|
67
|
+
import { weatherTypes } from "./components/hud/WeatherIndicator/WeatherIndicator.types.js";
|
|
68
|
+
import { miniMapMarkerKinds, miniMapTerrain } from "./components/hud/MiniMap/MiniMap.types.js";
|
|
69
|
+
import { compassName, describeMarker } from "./components/hud/MiniMap/MiniMap.utils.js";
|
|
70
|
+
import { MiniMap } from "./components/hud/MiniMap/MiniMap.js";
|
|
46
71
|
import { BlockCard } from "./components/cards/BlockCard/BlockCard.js";
|
|
47
72
|
import { cardMaterials } from "./components/cards/BlockCard/BlockCard.types.js";
|
|
48
73
|
import { BlockProgress } from "./components/feedback/Progress/BlockProgress.js";
|
|
@@ -53,16 +78,36 @@ import { PlayerCard } from "./components/cards/PlayerCard/PlayerCard.js";
|
|
|
53
78
|
import { pingQuality } from "./components/cards/ServerCard/ServerCard.utils.js";
|
|
54
79
|
import { ServerCard } from "./components/cards/ServerCard/ServerCard.js";
|
|
55
80
|
import { WorldCard } from "./components/cards/WorldCard/WorldCard.js";
|
|
81
|
+
import { browseServers } from "./components/cards/ServerBrowser/ServerBrowser.utils.js";
|
|
82
|
+
import { ServerBrowser } from "./components/cards/ServerBrowser/ServerBrowser.js";
|
|
83
|
+
import { browseWorlds } from "./components/cards/WorldBrowser/WorldBrowser.utils.js";
|
|
84
|
+
import { WorldBrowser } from "./components/cards/WorldBrowser/WorldBrowser.js";
|
|
56
85
|
import { badgeVariants } from "./components/display/BlockBadge/BlockBadge.types.js";
|
|
86
|
+
import { BlockTooltip } from "./components/display/BlockTooltip/BlockTooltip.js";
|
|
87
|
+
import { tooltipPlacements } from "./components/display/BlockTooltip/BlockTooltip.types.js";
|
|
88
|
+
import { BlockTable } from "./components/display/BlockTable/BlockTable.js";
|
|
89
|
+
import { skillState } from "./components/display/SkillTree/SkillTree.utils.js";
|
|
90
|
+
import { SkillTree } from "./components/display/SkillTree/SkillTree.js";
|
|
91
|
+
import { ChatWindow } from "./components/social/ChatWindow/ChatWindow.js";
|
|
92
|
+
import { chatMessageTypes } from "./components/social/ChatWindow/ChatWindow.types.js";
|
|
93
|
+
import { suggestCommands } from "./components/social/CommandConsole/CommandConsole.utils.js";
|
|
94
|
+
import { CommandConsole } from "./components/social/CommandConsole/CommandConsole.js";
|
|
95
|
+
import { consoleEntryKinds } from "./components/social/CommandConsole/CommandConsole.types.js";
|
|
57
96
|
import { useMediaQuery } from "./hooks/useMediaQuery.js";
|
|
58
97
|
import { BlockSidebar, SidebarItem } from "./components/navigation/BlockSidebar/BlockSidebar.js";
|
|
59
98
|
import { BlockTabs } from "./components/navigation/BlockTabs/BlockTabs.js";
|
|
60
99
|
import { Breadcrumb } from "./components/navigation/Breadcrumb/Breadcrumb.js";
|
|
61
100
|
import { HotbarNavigation } from "./components/navigation/HotbarNavigation/HotbarNavigation.js";
|
|
101
|
+
import { getPaginationRange } from "./components/navigation/BlockPagination/BlockPagination.utils.js";
|
|
102
|
+
import { BlockPagination } from "./components/navigation/BlockPagination/BlockPagination.js";
|
|
103
|
+
import { BlockStack } from "./components/layout/BlockStack/BlockStack.js";
|
|
104
|
+
import { stackGaps } from "./components/layout/BlockStack/BlockStack.types.js";
|
|
105
|
+
import { BlockDivider } from "./components/layout/BlockDivider/BlockDivider.js";
|
|
106
|
+
import { dividerVariants } from "./components/layout/BlockDivider/BlockDivider.types.js";
|
|
62
107
|
import { alertVariants } from "./components/feedback/Alert/BlockAlert.types.js";
|
|
63
108
|
import { useFocusTrap } from "./hooks/useFocusTrap.js";
|
|
64
109
|
import { BlockModal } from "./components/feedback/Modal/BlockModal.js";
|
|
65
110
|
import { ConfirmDialog } from "./components/feedback/ConfirmDialog/ConfirmDialog.js";
|
|
66
111
|
import { progressVariants } from "./components/feedback/Progress/BlockProgress.types.js";
|
|
67
112
|
import { BlockLoading } from "./components/feedback/Loading/BlockLoading.js";
|
|
68
|
-
export { AchievementCard, ArmorBar, BlockAlert, BlockBadge, BlockButton, BlockCard, BlockCheckbox, BlockInput, BlockLoading, BlockModal, BlockPanel, BlockProgress, BlockRadio, BlockRadioGroup, BlockSelect, BlockSidebar, BlockSlider, BlockTabs, BlockTextarea, BlockToaster, BlockToggle, BlockUIProvider, Breadcrumb, ConfirmDialog, CraftingGrid, CraftingResult, CraftingSlot, CraftingTable, DEFAULT_TOAST_DURATION, DurabilityBar, Furnace, HealthBar, Hotbar, HotbarNavigation, HungerBar, IconButton, Inventory, InventoryGrid, InventorySection, InventorySlot, ItemStack, ItemTooltip, PlayerCard, PlayerHUD, QuestCard, ServerCard, SidebarItem, WorldCard, XPBar, alertVariants, badgeVariants, blockButtonVariants, cardMaterials, clamp, cx, describeItemStack, durabilityLevel, formatNumber, furnaceStates, getFurnaceState, itemRarities, normalizeRarity, pingQuality, progressVariants, ratio, toast, useBlockUI, useControllableState, useDigitHotkeys, useFocusTrap, useMediaQuery, usePortalContainer, useToasts };
|
|
113
|
+
export { AchievementCard, Anvil, ArmorBar, BiomeIndicator, BlockAlert, BlockBadge, BlockButton, BlockCard, BlockCheckbox, BlockDivider, BlockInput, BlockLoading, BlockMenu, BlockModal, BlockPagination, BlockPanel, BlockProgress, BlockRadio, BlockRadioGroup, BlockSelect, BlockSidebar, BlockSlider, BlockStack, BlockTable, BlockTabs, BlockTextarea, BlockToaster, BlockToggle, BlockTooltip, BlockUIProvider, BossBar, Breadcrumb, BrewingStand, ChatWindow, CommandConsole, ConfirmDialog, CoordinatesHUD, CraftingGrid, CraftingResult, CraftingSlot, CraftingTable, DEFAULT_TOAST_DURATION, DayNightIndicator, DurabilityBar, EnchantingTable, Furnace, HealthBar, Hotbar, HotbarNavigation, HungerBar, IconButton, Inventory, InventoryGrid, InventorySection, InventorySlot, ItemStack, ItemTooltip, MiniMap, PlayerCard, PlayerHUD, QuestCard, RecipeBook, Scoreboard, ServerBrowser, ServerCard, SidebarItem, SkillTree, TradingUI, WeatherIndicator, WorldBrowser, WorldCard, XPBar, alertVariants, anvilCostState, badgeVariants, biomeTypes, blockButtonVariants, bossBarColors, bossBarSegments, brewingStates, browseServers, browseWorlds, cardMaterials, chatMessageTypes, clamp, compassName, consoleEntryKinds, cx, dayPhase, describeItemStack, describeMarker, dividerVariants, durabilityLevel, facings, filterRecipes, formatClock, formatNumber, furnaceStates, getBrewingState, getFurnaceState, getPaginationRange, itemRarities, miniMapMarkerKinds, miniMapTerrain, normalizeRarity, pingQuality, progressVariants, ratio, skillState, stackGaps, suggestCommands, toast, tooltipPlacements, useBlockUI, useControllableState, useDigitHotkeys, useFocusTrap, useMediaQuery, usePortalContainer, useToasts, villagerLevels, weatherTypes };
|