@hansenexus/hud 0.1.0 → 0.2.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.
Files changed (91) hide show
  1. package/README.md +42 -23
  2. package/dist/index.d.ts +39 -0
  3. package/dist/index.js +399 -0
  4. package/package.json +45 -136
  5. package/chunk-0cj8dkk7.js +0 -127
  6. package/chunk-1atxwdhw.js +0 -48
  7. package/chunk-24vrg16w.js +0 -39
  8. package/chunk-3j9sm249.js +0 -26
  9. package/chunk-50pq4sg6.js +0 -41
  10. package/chunk-5gtx3pza.js +0 -9
  11. package/chunk-6gw4x08j.js +0 -264
  12. package/chunk-6jt8yg4m.js +0 -117
  13. package/chunk-71se605m.js +0 -85
  14. package/chunk-82nm9wcg.js +0 -316
  15. package/chunk-8tam7r3h.js +0 -68
  16. package/chunk-babjpqkb.js +0 -52
  17. package/chunk-c5y856ad.js +0 -98
  18. package/chunk-ghxh8926.js +0 -172
  19. package/chunk-hc2g0n35.js +0 -24
  20. package/chunk-k0vr8dsy.js +0 -179
  21. package/chunk-k50yfp5d.js +0 -166
  22. package/chunk-kyeb6qeq.js +0 -95
  23. package/chunk-msqkkqw7.js +0 -140
  24. package/chunk-nm82wr8r.js +0 -58
  25. package/chunk-r06bpmy6.js +0 -79
  26. package/chunk-t9eh4t0b.js +0 -89
  27. package/chunk-tf774c4w.js +0 -115
  28. package/chunk-v086j53b.js +0 -19
  29. package/chunk-wspz08q7.js +0 -67
  30. package/chunk-xezxydm3.js +0 -47
  31. package/chunk-xjn0896g.js +0 -574
  32. package/chunk-xztw0xyt.js +0 -113
  33. package/chunk-zzrpd92r.js +0 -172
  34. package/core/access.d.mts +0 -53
  35. package/core/access.js +0 -27
  36. package/core/api-types.d.mts +0 -146
  37. package/core/api-types.js +0 -9
  38. package/core/capabilities.d.mts +0 -27
  39. package/core/capabilities.js +0 -14
  40. package/core/capture-buffer.d.mts +0 -37
  41. package/core/capture-buffer.js +0 -9
  42. package/core/force-state.d.mts +0 -68
  43. package/core/force-state.js +0 -21
  44. package/core/mock-cookie.d.mts +0 -30
  45. package/core/mock-cookie.js +0 -15
  46. package/core/types.d.mts +0 -59
  47. package/core/types.js +0 -9
  48. package/hud-provider.d.mts +0 -38
  49. package/hud-provider.js +0 -15
  50. package/hud.d.mts +0 -15
  51. package/hud.js +0 -18
  52. package/index.d.mts +0 -94
  53. package/index.js +0 -170
  54. package/lazy-panel.d.mts +0 -28
  55. package/lazy-panel.js +0 -11
  56. package/panels/cicd-panel.d.mts +0 -9
  57. package/panels/cicd-panel.js +0 -13
  58. package/panels/debug-info-panel.d.mts +0 -21
  59. package/panels/debug-info-panel.js +0 -9
  60. package/panels/dispatch-panel.d.mts +0 -10
  61. package/panels/dispatch-panel.js +0 -14
  62. package/panels/env-info-panel.d.mts +0 -9
  63. package/panels/env-info-panel.js +0 -12
  64. package/panels/feature-flags-panel.d.mts +0 -26
  65. package/panels/feature-flags-panel.js +0 -9
  66. package/panels/force-state-panel.d.mts +0 -11
  67. package/panels/force-state-panel.js +0 -113
  68. package/panels/info-row.d.mts +0 -21
  69. package/panels/info-row.js +0 -14
  70. package/panels/mock-seed-panel.d.mts +0 -15
  71. package/panels/mock-seed-panel.js +0 -14
  72. package/panels/network-console-panel.d.mts +0 -6
  73. package/panels/network-console-panel.js +0 -9
  74. package/panels/role-switcher-panel.d.mts +0 -28
  75. package/panels/role-switcher-panel.js +0 -9
  76. package/panels/sessions-panel.d.mts +0 -6
  77. package/panels/sessions-panel.js +0 -13
  78. package/panels/tokens-panel.d.mts +0 -38
  79. package/panels/tokens-panel.js +0 -9
  80. package/panels/unlock-panel.d.mts +0 -33
  81. package/panels/unlock-panel.js +0 -14
  82. package/panels/variants-panel.d.mts +0 -51
  83. package/panels/variants-panel.js +0 -12
  84. package/panels/vitals-panel.d.mts +0 -11
  85. package/panels/vitals-panel.js +0 -15
  86. package/server/guard.d.mts +0 -42
  87. package/server/guard.js +0 -12
  88. package/server/unlock.d.mts +0 -28
  89. package/server/unlock.js +0 -108
  90. package/state-boundary.d.mts +0 -25
  91. package/state-boundary.js +0 -54
@@ -1,25 +0,0 @@
1
- import * as react from 'react';
2
- import { ReactNode } from 'react';
3
- import { ForcedState } from './core/force-state.mjs';
4
-
5
- interface StateBoundaryProps {
6
- /** Stable, page-unique id; the HUD force-state panel lists boundaries by it. */
7
- id: string;
8
- /** Renders the boundary; `forced` is the state to show instead of the real one, or null. */
9
- children: (forced: ForcedState | null) => ReactNode;
10
- }
11
- /**
12
- * Registers a loading/empty/error boundary with the HUD force-state panel and
13
- * `?__state=`. Wrap the part of a page that branches on a query result:
14
- *
15
- * ```tsx
16
- * <StateBoundary id="blog-post">
17
- * {(forced) => forced === "loading" || post === undefined ? <Skeleton /> : …}
18
- * </StateBoundary>
19
- * ```
20
- *
21
- * In production it renders `children(null)` and nothing else.
22
- */
23
- declare function StateBoundary({ id, children }: StateBoundaryProps): string | number | bigint | boolean | react.JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
24
-
25
- export { StateBoundary, type StateBoundaryProps };
package/state-boundary.js DELETED
@@ -1,54 +0,0 @@
1
- import {
2
- getForceStateStore,
3
- resolveForcedState
4
- } from "./chunk-c5y856ad.js";
5
- import"./chunk-5gtx3pza.js";
6
-
7
- // state-boundary.tsx
8
- import { createContext, useContext, useEffect, useSyncExternalStore } from "react";
9
- import { jsx } from "react/jsx-runtime";
10
- "use client";
11
- var FORCE_STATE_ENABLED = false;
12
- function StateBoundary({ id, children }) {
13
- if (!FORCE_STATE_ENABLED)
14
- return children(null);
15
- return /* @__PURE__ */ jsx(DevStateBoundary, {
16
- id,
17
- children
18
- });
19
- }
20
- var ParentBoundary = /* @__PURE__ */ createContext(null);
21
- var SERVER_SNAPSHOT = { boundaries: [], overrides: {}, param: null };
22
- function subscribe(listener) {
23
- const store = getForceStateStore();
24
- const onPopState = () => store.syncSearch(window.location.search);
25
- window.addEventListener("popstate", onPopState);
26
- const unsubscribe = store.subscribe(listener);
27
- return () => {
28
- window.removeEventListener("popstate", onPopState);
29
- unsubscribe();
30
- };
31
- }
32
- function getSnapshot() {
33
- return getForceStateStore().getSnapshot();
34
- }
35
- function getServerSnapshot() {
36
- return SERVER_SNAPSHOT;
37
- }
38
- function DevStateBoundary({ id, children }) {
39
- const parentId = useContext(ParentBoundary);
40
- const snapshot = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
41
- useEffect(() => {
42
- const store = getForceStateStore();
43
- store.syncSearch(window.location.search);
44
- return store.register(id, parentId);
45
- }, [id, parentId]);
46
- const forced = resolveForcedState(snapshot, { id, parentId });
47
- return /* @__PURE__ */ jsx(ParentBoundary.Provider, {
48
- value: id,
49
- children: children(forced)
50
- });
51
- }
52
- export {
53
- StateBoundary
54
- };