@hosty-sdk/app 0.46.0 → 0.46.1
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.
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { DynamicIcon, iconNames } from "lucide-react/dynamic.mjs";
|
|
4
|
+
import { SdkIcon } from "./sdk-chrome.js";
|
|
5
|
+
const normalize = (name) => name.replace(/[-_\s]/g, "").toLowerCase();
|
|
6
|
+
const names = new Map(iconNames.map(name => [normalize(name), name]));
|
|
7
|
+
const fallback = () => _jsx(SdkIcon, { name: "tools" });
|
|
8
|
+
/** Panel manifests carry Lucide names, including legacy component-name spellings. */
|
|
9
|
+
export function UiPanelIcon({ name }) {
|
|
10
|
+
const icon = name ? names.get(normalize(name.trim())) : undefined;
|
|
11
|
+
return icon ? _jsx(DynamicIcon, { name: icon, fallback: fallback, className: "hosty-sdk-icon", "aria-hidden": "true", focusable: "false" }, icon) : fallback();
|
|
12
|
+
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
4
4
|
import { SdkIcon } from "./sdk-chrome.js";
|
|
5
|
+
import { UiPanelIcon } from "./ui-panel-icon.js";
|
|
5
6
|
import { UiHostContext } from "./ui-context.js";
|
|
6
7
|
import { useHostyChrome, useHostyNavigation } from "./ui-navigation-react.js";
|
|
7
8
|
import { StandaloneNavigationContext } from "./ui-standalone-context.js";
|
|
@@ -43,5 +44,5 @@ export function StandaloneHeader({ panels, selected, expanded, onSelect, onChoos
|
|
|
43
44
|
const icon = app?.iconUrl && /^(https?:\/\/|\/(?!\/))/.test(app.iconUrl) ? app.iconUrl : null;
|
|
44
45
|
const showNavigation = canNavigate && chrome.navigation === "show" && (navigation.status !== "ready" || navigation.entries.length > 0);
|
|
45
46
|
const toolsVisible = chrome.tools.enabled && chrome.tools.launcher !== "hide";
|
|
46
|
-
return _jsxs("header", { "data-hosty-sdk": true, className: "hosty-standalone-header", children: [_jsxs("div", { className: "hosty-standalone-identity", children: [showNavigation && nav && _jsx("button", { ref: nav.opener, type: "button", className: "hosty-standalone-navigation", disabled: !prefs.ready, "aria-label": nav.narrow ? nav.open ? "Hide navigation" : "Show navigation" : prefs.collapsed ? "Show navigation" : "Hide navigation", title: nav.narrow ? "Page navigation" : prefs.collapsed ? "Show navigation" : "Hide navigation", "aria-expanded": nav.narrow ? nav.open : !prefs.collapsed, onClick: () => nav.narrow ? nav.setOpen(!nav.open) : prefs.setCollapsed(!prefs.collapsed), children: _jsx(SdkIcon, { name: "sidebar" }) }), icon && icon !== failedIcon ? _jsx("img", { src: icon, alt: "", draggable: false, onError: () => setFailedIcon(icon) }) : _jsx(SdkIcon, { name: "app" }), _jsx("strong", { title: name, children: name })] }), toolsVisible && _jsxs("div", { className: "hosty-standalone-tools", children: [_jsx("nav", { className: "hosty-pinned-tools", "aria-label": "Pinned tools", children: prefs.pins.map(key => panels.find(panel => panelKey(panel.panel) === key)).filter((panel) => !!panel).map(panel => _jsxs("button", { type: "button", "aria-label": `Open ${panel.appName} — ${panel.label}`, title: `${panel.appName}: ${panel.label}`, "aria-expanded": expanded && selected === panelKey(panel.panel), onClick: () => onSelect(panel), children: [_jsx(
|
|
47
|
+
return _jsxs("header", { "data-hosty-sdk": true, className: "hosty-standalone-header", children: [_jsxs("div", { className: "hosty-standalone-identity", children: [showNavigation && nav && _jsx("button", { ref: nav.opener, type: "button", className: "hosty-standalone-navigation", disabled: !prefs.ready, "aria-label": nav.narrow ? nav.open ? "Hide navigation" : "Show navigation" : prefs.collapsed ? "Show navigation" : "Hide navigation", title: nav.narrow ? "Page navigation" : prefs.collapsed ? "Show navigation" : "Hide navigation", "aria-expanded": nav.narrow ? nav.open : !prefs.collapsed, onClick: () => nav.narrow ? nav.setOpen(!nav.open) : prefs.setCollapsed(!prefs.collapsed), children: _jsx(SdkIcon, { name: "sidebar" }) }), icon && icon !== failedIcon ? _jsx("img", { src: icon, alt: "", draggable: false, onError: () => setFailedIcon(icon) }) : _jsx(SdkIcon, { name: "app" }), _jsx("strong", { title: name, children: name })] }), toolsVisible && _jsxs("div", { className: "hosty-standalone-tools", children: [_jsx("nav", { className: "hosty-pinned-tools", "aria-label": "Pinned tools", children: prefs.pins.map(key => panels.find(panel => panelKey(panel.panel) === key)).filter((panel) => !!panel).map(panel => _jsxs("button", { type: "button", "aria-label": `Open ${panel.appName} — ${panel.label}`, title: `${panel.appName}: ${panel.label}`, "aria-expanded": expanded && selected === panelKey(panel.panel), onClick: () => onSelect(panel), children: [_jsx(UiPanelIcon, { name: panel.icon }), _jsx("span", { children: panel.label }), attention(panel) && _jsx("span", { className: "hosty-panel-attention", "aria-label": "Needs attention", children: _jsx(SdkIcon, { name: "warning" }) })] }, panelKey(panel.panel))) }), _jsxs("button", { type: "button", "aria-label": "Tools", "aria-haspopup": "dialog", "aria-expanded": chooserOpen, onClick: onChoose, children: [_jsx(SdkIcon, { name: "tools" }), _jsx("span", { children: "Tools" }), _jsx(SdkIcon, { name: "chevron" })] })] })] });
|
|
47
48
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hosty-sdk/app",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.1",
|
|
4
4
|
"description": "Hosty app auth: session state machine, recovery bridge, Core revalidation, and the embedder responder.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"type": "module",
|
|
@@ -176,6 +176,7 @@
|
|
|
176
176
|
},
|
|
177
177
|
"dependencies": {
|
|
178
178
|
"@noble/hashes": "^2.4.0",
|
|
179
|
+
"lucide-react": "^1.55.0",
|
|
179
180
|
"server-only": "^0.0.1"
|
|
180
181
|
},
|
|
181
182
|
"peerDependencies": {
|