@hansenexus/hud 0.3.0 → 0.5.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/README.md +782 -6
- package/dist/a11y-B5DUaiCs.js +246 -0
- package/dist/a11y-panel-p_t4eD7p.js +207 -0
- package/dist/access-C7zlaqj6.js +100 -0
- package/dist/access-D_ewAEJG.d.ts +61 -0
- package/dist/access-panel-CEfTr9ZI.js +123 -0
- package/dist/adapter-BYoxPYTI.d.ts +33 -0
- package/dist/adapter-hcwmJtNx.js +65 -0
- package/dist/auto/runtime.d.ts +65 -0
- package/dist/auto/runtime.js +50 -0
- package/dist/auto.d.ts +15 -0
- package/dist/auto.js +33 -0
- package/dist/capabilities-rDSKjXpq.js +110 -0
- package/dist/capture-CwrIwLqi.js +300 -0
- package/dist/capture-buffer-Bbbo6omF.d.ts +35 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +275 -0
- package/dist/data-panel-DhxAmP91.js +817 -0
- package/dist/data-store-ChF1td_P.js +164 -0
- package/dist/define-hud-CHPedaQ5.d.ts +50 -0
- package/dist/design-D0kGgPoP.js +87 -0
- package/dist/detect-BxHZ0pxW.d.ts +25 -0
- package/dist/detect-CHZiSeZs.js +63 -0
- package/dist/dispatch-panel-B-xr_Giy.js +279 -0
- package/dist/env-CApnbI0r.d.ts +19 -0
- package/dist/env-CaiFPIhF.js +31 -0
- package/dist/file-xdSaQ2uR.js +103 -0
- package/dist/flags-DVtaJ8pQ.d.ts +58 -0
- package/dist/flags.d.ts +2 -0
- package/dist/flags.js +82 -0
- package/dist/force-state-BaqWsmrf.js +153 -0
- package/dist/force-state-CCqoTfVB.d.ts +23 -0
- package/dist/force-state-panel-_otVYh9i.js +97 -0
- package/dist/generate-C8lQl3Eh.js +53 -0
- package/dist/handler-BpVhxEmU.js +106 -0
- package/dist/handler-DtYVCZY6.d.ts +39 -0
- package/dist/index-BAV_1W8a.d.ts +43 -0
- package/dist/index-BJ26pse9.d.ts +70 -0
- package/dist/index-BnQ0dTZf.d.ts +19 -0
- package/dist/index-CwfX-W87.d.ts +72 -0
- package/dist/index-DcH9V3cU.d.ts +48 -0
- package/dist/index-DqOyNf1u.d.ts +65 -0
- package/dist/index-DstI_ike.d.ts +66 -0
- package/dist/index-Dxz4fn4j.d.ts +42 -0
- package/dist/index-Hhh7OXzU.d.ts +129 -0
- package/dist/index-ReFbhQ9p.d.ts +25 -0
- package/dist/index-RgXfMBuW.d.ts +48 -0
- package/dist/index-gCZBO53s.d.ts +73 -0
- package/dist/index.d.ts +6 -36
- package/dist/index.js +798 -240
- package/dist/inspect-C9Ft8fqn.js +142 -0
- package/dist/inspect-root-BkaupBMp.js +429 -0
- package/dist/marker-C66LxOhJ.d.ts +9 -0
- package/dist/marker-CMrvxPmS.d.ts +12 -0
- package/dist/marker-DjeGvL-F.js +9 -0
- package/dist/marker-uZYPOJ4M.js +12 -0
- package/dist/markers.d.ts +3 -0
- package/dist/markers.js +3 -0
- package/dist/meta-Bv0sEao3.js +6 -0
- package/dist/meta-C_G7MB5w.d.ts +49 -0
- package/dist/mocks-CA-wM2SB.d.ts +109 -0
- package/dist/mocks-ESiRqk9o.js +150 -0
- package/dist/msw-browser-wjaYgkB7.d.ts +31 -0
- package/dist/next/config.d.ts +52 -0
- package/dist/next/config.js +78 -0
- package/dist/next.d.ts +14 -19
- package/dist/next.js +7 -30
- package/dist/observe-CdDnDBRP.js +89 -0
- package/dist/observe-panel-Cgp1M8oT.js +347 -0
- package/dist/ops-panel-CEqDe_UT.js +234 -0
- package/dist/payload-MUQ9ciER.d.ts +92 -0
- package/dist/plugins/a11y.d.ts +2 -0
- package/dist/plugins/a11y.js +2 -0
- package/dist/plugins/access/server.d.ts +122 -0
- package/dist/plugins/access/server.js +340 -0
- package/dist/plugins/access.d.ts +41 -0
- package/dist/plugins/access.js +51 -0
- package/dist/plugins/agent/server.d.ts +94 -0
- package/dist/plugins/agent/server.js +455 -0
- package/dist/plugins/agent.d.ts +37 -0
- package/dist/plugins/agent.js +69 -0
- package/dist/plugins/capture/server.d.ts +92 -0
- package/dist/plugins/capture/server.js +248 -0
- package/dist/plugins/capture.d.ts +24 -0
- package/dist/plugins/capture.js +70 -0
- package/dist/plugins/data/msw-browser.d.ts +2 -0
- package/dist/plugins/data/msw-browser.js +39 -0
- package/dist/plugins/data/msw-node.d.ts +36 -0
- package/dist/plugins/data/msw-node.js +68 -0
- package/dist/plugins/data/server.d.ts +257 -0
- package/dist/plugins/data/server.js +717 -0
- package/dist/plugins/data.d.ts +6 -0
- package/dist/plugins/data.js +51 -0
- package/dist/plugins/design/server.d.ts +54 -0
- package/dist/plugins/design/server.js +198 -0
- package/dist/plugins/design.d.ts +5 -0
- package/dist/plugins/design.js +4 -0
- package/dist/plugins/inspect/convex.d.ts +2 -0
- package/dist/plugins/inspect/convex.js +486 -0
- package/dist/plugins/inspect/react-query.d.ts +2 -0
- package/dist/plugins/inspect/react-query.js +225 -0
- package/dist/plugins/inspect/sockets.d.ts +51 -0
- package/dist/plugins/inspect/sockets.js +397 -0
- package/dist/plugins/inspect/swr.d.ts +2 -0
- package/dist/plugins/inspect/swr.js +218 -0
- package/dist/plugins/inspect.d.ts +4 -0
- package/dist/plugins/inspect.js +3 -0
- package/dist/plugins/observe.d.ts +4 -0
- package/dist/plugins/observe.js +2 -0
- package/dist/plugins/ops/server.d.ts +82 -0
- package/dist/plugins/ops/server.js +381 -0
- package/dist/plugins/ops.d.ts +27 -0
- package/dist/plugins/ops.js +41 -0
- package/dist/plugins/routes/server.d.ts +88 -0
- package/dist/plugins/routes/server.js +62 -0
- package/dist/plugins/routes.d.ts +3 -0
- package/dist/plugins/routes.js +216 -0
- package/dist/plugins/seo.d.ts +2 -0
- package/dist/plugins/seo.js +2 -0
- package/dist/plugins/vitals.d.ts +2 -25
- package/dist/plugins/vitals.js +4 -86
- package/dist/plugins-BZvDqGx5.d.ts +144 -0
- package/dist/{plugins-CzUiTn_r.js → plugins-DVy_vaYr.js} +3 -1
- package/dist/poll-CjKsWZi8.js +89 -0
- package/dist/requests-BwD6MKEq.js +282 -0
- package/dist/requests-CJrUf465.d.ts +50 -0
- package/dist/review.d.ts +181 -0
- package/dist/review.js +1017 -0
- package/dist/same-origin-BGet22CC.js +21 -0
- package/dist/scan-DzJNXqOk.js +165 -0
- package/dist/selector-NSYSe7AZ.js +28 -0
- package/dist/seo-Dq9q_QkO.js +551 -0
- package/dist/seo-panel-CfiY-TnT.js +124 -0
- package/dist/server.d.ts +3 -39
- package/dist/server.js +2 -105
- package/dist/sessions-panel-COvhPAzv.js +98 -0
- package/dist/shortcut-s_mjGeU8.js +179 -0
- package/dist/state-CjjZPjPJ.js +40 -0
- package/dist/state-boundary.d.ts +26 -0
- package/dist/state-boundary.js +61 -0
- package/dist/store/convex.d.ts +33 -0
- package/dist/store/convex.js +52 -0
- package/dist/store-CQqIIKTc.js +59 -0
- package/dist/store-Ync9eb1G.js +67 -0
- package/dist/store.d.ts +76 -0
- package/dist/store.js +188 -0
- package/dist/styles-BA8ueHoV.js +342 -0
- package/dist/styles-DKU_P8MH.js +139 -0
- package/dist/styles-DPpDPmzi.js +68 -0
- package/dist/tokens-panel-CbMQfasZ.js +142 -0
- package/dist/types-B-ulf2Jp.js +8 -0
- package/dist/types-BIgGf-0C.d.ts +25 -0
- package/dist/types-BIkI-qN8.js +30 -0
- package/dist/types-Cxh4twqc.d.ts +50 -0
- package/dist/types-DIdPfjtV.js +6 -0
- package/dist/types-DaJcsEjO.d.ts +44 -0
- package/dist/types-Dn68psVz.d.ts +118 -0
- package/dist/types-f3jlNxzw.d.ts +92 -0
- package/dist/types-szkr2QOF.d.ts +39 -0
- package/dist/unlock-store-4V3vR4Eg.js +96 -0
- package/dist/variant-groups-TIfO3NIj.js +137 -0
- package/dist/variant-groups-aAIrcNK5.d.ts +36 -0
- package/dist/variants-panel-BDoSkwBJ.js +457 -0
- package/dist/variants-types-CcRf119M.d.ts +63 -0
- package/dist/variants.d.ts +43 -0
- package/dist/variants.js +83 -0
- package/dist/vitals-panel-BCmMUntW.js +30 -0
- package/dist/vite.d.ts +37 -0
- package/dist/vite.js +134 -0
- package/package.json +85 -5
- package/dist/define-hud-BHQR8Lbv.d.ts +0 -31
- package/dist/plugins-1QmTmZyL.d.ts +0 -76
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { c as HudPluginProps } from "./plugins-BZvDqGx5.js";
|
|
2
|
+
//#region src/plugins/design/force-state-panel.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Toggles every mounted `StateBoundary` between its real state and a forced
|
|
5
|
+
* loading, empty or error. Toggles live in memory: a reload returns every
|
|
6
|
+
* boundary to auto, so a forgotten toggle cannot outlive the page.
|
|
7
|
+
*/
|
|
8
|
+
declare function ForceStatePanel(): import("react").JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/plugins/design/force-state-pill.d.ts
|
|
11
|
+
/**
|
|
12
|
+
* Pill content: how many boundaries are forced, by toggle or param. Uses the
|
|
13
|
+
* core `.dot`, since the plugin stylesheet only loads with the panel.
|
|
14
|
+
*/
|
|
15
|
+
declare function ForceStatePill(): import("react").JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/plugins/design/tokens.d.ts
|
|
18
|
+
interface HudTokenDescriptor {
|
|
19
|
+
/** CSS custom property, including the leading dashes (e.g. `--primary`). */
|
|
20
|
+
cssVar: string;
|
|
21
|
+
/** Short display label; defaults to the var name without its leading dashes. */
|
|
22
|
+
label?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Scope attribute the design system hangs its tokens on, with an optional
|
|
26
|
+
* value: `{ attribute: "data-theme", value: "brand" }` matches
|
|
27
|
+
* `[data-theme="brand"] { --primary: … }`. Omit for `:root`-scoped tokens.
|
|
28
|
+
*/
|
|
29
|
+
interface HudTokenScope {
|
|
30
|
+
attribute: string;
|
|
31
|
+
value?: string;
|
|
32
|
+
}
|
|
33
|
+
interface HudTokenGroup {
|
|
34
|
+
label: string;
|
|
35
|
+
/** Var names (`"--primary"`) or descriptors with a label. */
|
|
36
|
+
tokens: readonly (string | HudTokenDescriptor)[];
|
|
37
|
+
scope?: HudTokenScope;
|
|
38
|
+
}
|
|
39
|
+
/** What an app tells the Tokens panel about its design system. */
|
|
40
|
+
interface HudTokensAdapter {
|
|
41
|
+
groups: readonly HudTokenGroup[];
|
|
42
|
+
/** Where the tokens live, shown as a hint (e.g. `src/app/globals.css`). */
|
|
43
|
+
sourceHint?: string;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/plugins/design/variants-panel.d.ts
|
|
47
|
+
interface HudVariantCategory {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
/** Registry status: "active" renders as votable, "decided" as settled. */
|
|
51
|
+
status: string;
|
|
52
|
+
alternativeCount: number;
|
|
53
|
+
/** Domain bucket (marketing, admin, shared …) for grouping. Default "shared". */
|
|
54
|
+
domain?: string;
|
|
55
|
+
}
|
|
56
|
+
interface HudGenerateRequest {
|
|
57
|
+
/** Repo-relative component path. */
|
|
58
|
+
path: string;
|
|
59
|
+
brief: string;
|
|
60
|
+
count: number;
|
|
61
|
+
}
|
|
62
|
+
interface HudGenerateResult {
|
|
63
|
+
ok: boolean;
|
|
64
|
+
/** Where the queued brief landed, on success. */
|
|
65
|
+
markerPath?: string;
|
|
66
|
+
error?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Optional: what an app tells the Variants panel about a variant registry
|
|
70
|
+
* of its own, beyond the live groups on the page. The HUD owns no registry:
|
|
71
|
+
* an app maps its own onto this shape.
|
|
72
|
+
*/
|
|
73
|
+
interface HudVariantsAdapter {
|
|
74
|
+
/** The categories, or a loader the panel calls each time it opens. */
|
|
75
|
+
categories: readonly HudVariantCategory[] | (() => Promise<readonly HudVariantCategory[]>);
|
|
76
|
+
/** Deep link to the full review dashboard, where voting happens. */
|
|
77
|
+
reviewHref?: string;
|
|
78
|
+
/** Deep link for one category's drill-in page. */
|
|
79
|
+
categoryHref?: (categoryId: string) => string;
|
|
80
|
+
/** Opens an in-page preview for a category; wins over `categoryHref`. */
|
|
81
|
+
openPreview?: (categoryId: string) => void;
|
|
82
|
+
/**
|
|
83
|
+
* Queues a variant-generation brief. Shown only when the tier grants
|
|
84
|
+
* `variants.generate`. The human stays in the loop: queue, not dispatch.
|
|
85
|
+
*/
|
|
86
|
+
generate?: (request: HudGenerateRequest) => Promise<HudGenerateResult>;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/plugins/design/index.d.ts
|
|
90
|
+
/**
|
|
91
|
+
* Live swatches of the host app's design tokens. Values are read from the
|
|
92
|
+
* host document, outside the HUD's shadow root, so scoped and themed tokens
|
|
93
|
+
* show what the page actually renders. Client only.
|
|
94
|
+
*/
|
|
95
|
+
declare function tokens(adapter: HudTokensAdapter): {
|
|
96
|
+
readonly id: "tokens";
|
|
97
|
+
readonly title: "Tokens";
|
|
98
|
+
readonly panel: () => import("react").JSX.Element;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* The page's live variant groups (`VariantGroup` from `@hansenexus/hud/variants`)
|
|
102
|
+
* with a switcher, agent scores from the storage seam and Decide, which
|
|
103
|
+
* needs `variants.decide` and `variantsServer()` from
|
|
104
|
+
* `@hansenexus/hud/plugins/design/server`. An adapter adds the app's own
|
|
105
|
+
* variant registry and the generate-brief queue (`variants.generate`). Client only.
|
|
106
|
+
*/
|
|
107
|
+
declare function variants(adapter?: HudVariantsAdapter): {
|
|
108
|
+
readonly id: "variants";
|
|
109
|
+
readonly title: "Variants";
|
|
110
|
+
readonly panel: ({ ctx }: HudPluginProps) => import("react").JSX.Element;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Forces the page's `StateBoundary`s (`@hansenexus/hud/state-boundary`) to
|
|
114
|
+
* loading, empty or error. The pill shows how many are forced. Client only.
|
|
115
|
+
*/
|
|
116
|
+
declare function forceState(): {
|
|
117
|
+
readonly id: "states";
|
|
118
|
+
readonly title: "States";
|
|
119
|
+
readonly capability: "state.force";
|
|
120
|
+
readonly pill: typeof ForceStatePill;
|
|
121
|
+
readonly panel: import("react").LazyExoticComponent<typeof ForceStatePanel>;
|
|
122
|
+
readonly commands: readonly [{
|
|
123
|
+
readonly id: "reset";
|
|
124
|
+
readonly title: "Reset forced states";
|
|
125
|
+
readonly run: () => void;
|
|
126
|
+
}];
|
|
127
|
+
};
|
|
128
|
+
//#endregion
|
|
129
|
+
export { HudGenerateResult as a, HudTokenDescriptor as c, HudTokensAdapter as d, HudGenerateRequest as i, HudTokenGroup as l, tokens as n, HudVariantCategory as o, variants as r, HudVariantsAdapter as s, forceState as t, HudTokenScope as u };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Metric } from "web-vitals";
|
|
2
|
+
//#region src/plugins/vitals/vitals-panel.d.ts
|
|
3
|
+
declare function VitalsPanel(): import("react").JSX.Element;
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/plugins/vitals/store.d.ts
|
|
6
|
+
type VitalName = Metric["name"];
|
|
7
|
+
type VitalRating = Metric["rating"];
|
|
8
|
+
interface Vital {
|
|
9
|
+
name: VitalName;
|
|
10
|
+
value: number;
|
|
11
|
+
rating: VitalRating;
|
|
12
|
+
}
|
|
13
|
+
type VitalsSnapshot = Partial<Record<VitalName, Vital>>;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/plugins/vitals/index.d.ts
|
|
16
|
+
declare function VitalsPill(): import("react").JSX.Element;
|
|
17
|
+
/** Core Web Vitals: LCP in the pill, all five metrics in the panel. Client only. */
|
|
18
|
+
declare function vitals(): {
|
|
19
|
+
readonly id: "vitals";
|
|
20
|
+
readonly title: "Vitals";
|
|
21
|
+
readonly pill: typeof VitalsPill;
|
|
22
|
+
readonly panel: import("react").LazyExoticComponent<typeof VitalsPanel>;
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { VitalsSnapshot as a, VitalRating as i, Vital as n, VitalName as r, vitals as t };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { t as InspectAdapter } from "./adapter-BYoxPYTI.js";
|
|
2
|
+
//#region src/plugins/inspect/react-query/index.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* The slice of `@tanstack/query-core` the adapter reads, structurally, so
|
|
5
|
+
* the package is neither imported nor a peer: a real `QueryClient` fits.
|
|
6
|
+
*/
|
|
7
|
+
interface QueryLike {
|
|
8
|
+
queryKey: readonly unknown[];
|
|
9
|
+
queryHash: string;
|
|
10
|
+
state: {
|
|
11
|
+
data: unknown;
|
|
12
|
+
error: unknown;
|
|
13
|
+
status: "pending" | "error" | "success";
|
|
14
|
+
fetchStatus: "fetching" | "paused" | "idle";
|
|
15
|
+
dataUpdatedAt: number;
|
|
16
|
+
dataUpdateCount: number;
|
|
17
|
+
isInvalidated: boolean;
|
|
18
|
+
};
|
|
19
|
+
isStale(): boolean;
|
|
20
|
+
isActive(): boolean;
|
|
21
|
+
getObserversCount(): number;
|
|
22
|
+
}
|
|
23
|
+
interface QueryClientLike {
|
|
24
|
+
getQueryCache(): {
|
|
25
|
+
subscribe(listener: (event: unknown) => void): () => void;
|
|
26
|
+
getAll(): QueryLike[];
|
|
27
|
+
};
|
|
28
|
+
invalidateQueries(filters?: {
|
|
29
|
+
queryKey?: readonly unknown[];
|
|
30
|
+
exact?: boolean;
|
|
31
|
+
}): Promise<void>;
|
|
32
|
+
removeQueries(filters?: {
|
|
33
|
+
queryKey?: readonly unknown[];
|
|
34
|
+
exact?: boolean;
|
|
35
|
+
}): void;
|
|
36
|
+
}
|
|
37
|
+
interface InspectReactQueryOptions {
|
|
38
|
+
queryClient: QueryClientLike;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* React Query tab for the inspect plugin: every cache entry with its key,
|
|
42
|
+
* status, staleness, observer count and age, data redacted like a response
|
|
43
|
+
* body, and Invalidate / Remove per key. Subscribes to the query cache when
|
|
44
|
+
* called; `dispose()` unsubscribes.
|
|
45
|
+
*/
|
|
46
|
+
declare function inspectReactQuery({ queryClient }: InspectReactQueryOptions): InspectAdapter;
|
|
47
|
+
//#endregion
|
|
48
|
+
export { inspectReactQuery as i, QueryClientLike as n, QueryLike as r, InspectReactQueryOptions as t };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { o as HudPlugin, r as HudCapability } from "./plugins-BZvDqGx5.js";
|
|
2
|
+
import "./define-hud-CHPedaQ5.js";
|
|
3
|
+
//#region src/core/grabber/outline.d.ts
|
|
4
|
+
interface ElementOutlineProps {
|
|
5
|
+
/** The element to outline; `null` renders nothing. */
|
|
6
|
+
element: Element | null;
|
|
7
|
+
label: string;
|
|
8
|
+
/** Called on Escape, on a pointer press outside the overlay's own root, or once the element leaves the DOM. */
|
|
9
|
+
onDismiss: () => void;
|
|
10
|
+
/** Scroll the element into view when it changes. Default true. */
|
|
11
|
+
reveal?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Outlines one element with the grabber's overlay without entering grab mode:
|
|
15
|
+
* findings in a panel point at the page this way. The box follows scrolling
|
|
16
|
+
* and resizes; the outline goes away on Escape, on a press on the page, or
|
|
17
|
+
* when the element is removed.
|
|
18
|
+
*/
|
|
19
|
+
declare function ElementOutline({ element, label, onDismiss, reveal }: ElementOutlineProps): import("react").JSX.Element;
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/core/grabber/picker.d.ts
|
|
22
|
+
interface PickPoint {
|
|
23
|
+
clientX: number;
|
|
24
|
+
clientY: number;
|
|
25
|
+
}
|
|
26
|
+
interface ElementPickerProps {
|
|
27
|
+
active: boolean;
|
|
28
|
+
onPick: (element: Element, point: PickPoint) => void;
|
|
29
|
+
onCancel: () => void;
|
|
30
|
+
/** Banner text while active. */
|
|
31
|
+
hint?: string;
|
|
32
|
+
/** Label next to the hover outline. Default: the tag name. */
|
|
33
|
+
describe?: (element: Element) => string;
|
|
34
|
+
/** Extra elements to leave alone, on top of the picker's own shadow host. */
|
|
35
|
+
ignore?: (element: Element) => boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Styles for the picker overlay. The picker renders where it is mounted, so
|
|
39
|
+
* the caller puts these into the same (shadow) root. Colours fall back when
|
|
40
|
+
* the `--hud-*` tokens are absent.
|
|
41
|
+
*/
|
|
42
|
+
declare const PICKER_CSS = "\n.grab-layer { position: fixed; inset: 0; pointer-events: none; }\n.grab-hint {\n position: fixed;\n top: 0;\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 12px;\n border-radius: 0 0 6px 6px;\n white-space: nowrap;\n background: var(--hud-accent, #0369a1);\n color: var(--hud-accent-fg, #ffffff);\n font: 600 11px/1.5 var(--hud-mono, ui-monospace, monospace);\n}\n.grab-outline {\n position: fixed;\n border: 1.5px solid var(--hud-accent, #0369a1);\n background: color-mix(in srgb, var(--hud-accent, #0369a1) 8%, transparent);\n border-radius: 3px;\n}\n.grab-label {\n position: fixed;\n max-width: min(480px, calc(100vw - 8px));\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 1px 6px;\n border-radius: 3px;\n background: var(--hud-accent, #0369a1);\n color: var(--hud-accent-fg, #ffffff);\n font: 600 10px/1.6 var(--hud-mono, ui-monospace, monospace);\n}\n";
|
|
43
|
+
/**
|
|
44
|
+
* Click-to-pick controller: crosshair, hover outline with a label, the next
|
|
45
|
+
* click picks, Escape cancels. Events inside the picker's own shadow host
|
|
46
|
+
* (the HUD's pill and panels) pass through untouched, so panels stay usable
|
|
47
|
+
* and mounted during a grab.
|
|
48
|
+
*/
|
|
49
|
+
declare function ElementPicker({ active, onPick, onCancel, hint, describe, ignore }: ElementPickerProps): import("react").JSX.Element;
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/shell/hud.d.ts
|
|
52
|
+
interface HudProps {
|
|
53
|
+
/** App slug: labels the pill and keys the persisted layout. */
|
|
54
|
+
appSlug: string;
|
|
55
|
+
/** Badge shown at the start of the pill. Default "DEV". */
|
|
56
|
+
envLabel?: string;
|
|
57
|
+
/** Client halves of the plugins, in pill order. Keep the array stable across renders. */
|
|
58
|
+
plugins?: readonly HudPlugin[];
|
|
59
|
+
/** Base path of the plugin routes. Default "/api/hud". */
|
|
60
|
+
apiBase?: string;
|
|
61
|
+
/** Capability check. Default: grant all (core assumes development). Keep it stable. */
|
|
62
|
+
can?: (capability: HudCapability) => boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The HUD shell: a shadow-rooted status pill and floating panels.
|
|
66
|
+
*
|
|
67
|
+
* It renders unconditionally. Keeping it out of production builds is the
|
|
68
|
+
* loader's job, at the import site, so a bundler can drop the whole module
|
|
69
|
+
* (see `@hansenexus/hud/next`).
|
|
70
|
+
*/
|
|
71
|
+
declare function Hud({ appSlug, envLabel, plugins, apiBase, can }: HudProps): import("react").JSX.Element;
|
|
72
|
+
//#endregion
|
|
73
|
+
export { PICKER_CSS as a, ElementOutlineProps as c, ElementPickerProps as i, HudProps as n, PickPoint as o, ElementPicker as r, ElementOutline as s, Hud as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,36 +1,6 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { n as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* while keeping the HUD, and it is unmistakably deliberate rather than an
|
|
8
|
-
* incidental string a refactor could rename away.
|
|
9
|
-
*/
|
|
10
|
-
export declare const HUD_DEV_MARKER = "__HANSENEXUS_HUD_DEV__";
|
|
11
|
-
/** Tag name of the element that hosts the HUD's shadow root. */
|
|
12
|
-
export declare const HUD_HOST_TAG = "hn-hud";
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/shell/hud.d.ts
|
|
15
|
-
interface HudProps {
|
|
16
|
-
/** App slug: labels the pill and keys the persisted layout. */
|
|
17
|
-
appSlug: string;
|
|
18
|
-
/** Badge shown at the start of the pill. Default "DEV". */
|
|
19
|
-
envLabel?: string;
|
|
20
|
-
/** Client halves of the plugins, in pill order. Keep the array stable across renders. */
|
|
21
|
-
plugins?: readonly HudPlugin[];
|
|
22
|
-
/** Base path of the plugin routes. Default "/api/hud". */
|
|
23
|
-
apiBase?: string;
|
|
24
|
-
/** Capability check. Default: grant all (core assumes development). Keep it stable. */
|
|
25
|
-
can?: (capability: HudCapability) => boolean;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* The HUD shell: a shadow-rooted status pill and floating panels.
|
|
29
|
-
*
|
|
30
|
-
* It renders unconditionally. Keeping it out of production builds is the
|
|
31
|
-
* loader's job, at the import site, so a bundler can drop the whole module
|
|
32
|
-
* (see `@hansenexus/hud/next`).
|
|
33
|
-
*/
|
|
34
|
-
export declare function Hud({ appSlug, envLabel, plugins, apiBase, can }: HudProps): import("react").JSX.Element;
|
|
35
|
-
//#endregion
|
|
36
|
-
export { type DefineHudOptions, HudApiError, type HudCapability, type HudCommand, type HudMountProps, type HudPlugin, type HudPluginContext, type HudPluginProps, type HudProps, type PinEdge, defineHud, definePlugin };
|
|
1
|
+
import { a as GrabScreenshotImage, i as GrabScreenshot, n as GrabAnchor, o as matchComponentHints, r as GrabPayload, s as GrabComponent, t as ComponentHint } from "./payload-MUQ9ciER.js";
|
|
2
|
+
import { _ as useGrab, c as HudPluginProps, f as PinEdge, g as HudHighlight, h as HudGrabState, i as HudCommand, m as HudGrab, n as HudApiError, o as HudPlugin, p as definePlugin, r as HudCapability, s as HudPluginContext, t as HudAccessControl } from "./plugins-BZvDqGx5.js";
|
|
3
|
+
import { i as defineHud, n as HudAutoPlugins, r as HudMountProps, t as DefineHudOptions } from "./define-hud-CHPedaQ5.js";
|
|
4
|
+
import { a as PICKER_CSS, c as ElementOutlineProps, i as ElementPickerProps, n as HudProps, o as PickPoint, r as ElementPicker, s as ElementOutline, t as Hud } from "./index-gCZBO53s.js";
|
|
5
|
+
import { n as HUD_HOST_TAG, t as HUD_DEV_MARKER } from "./marker-CMrvxPmS.js";
|
|
6
|
+
export { type ComponentHint, type DefineHudOptions, ElementOutline, type ElementOutlineProps, ElementPicker, type ElementPickerProps, type GrabAnchor, type GrabComponent, type GrabPayload, type GrabScreenshot, type GrabScreenshotImage, HUD_DEV_MARKER, HUD_HOST_TAG, Hud, type HudAccessControl, HudApiError, type HudAutoPlugins, type HudCapability, type HudCommand, type HudGrab, type HudGrabState, type HudHighlight, type HudMountProps, type HudPlugin, type HudPluginContext, type HudPluginProps, type HudProps, PICKER_CSS, type PickPoint, type PinEdge, defineHud, definePlugin, matchComponentHints, useGrab };
|