@hanzo/rooms 0.1.0 → 0.1.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.
package/dist/Directory.js CHANGED
@@ -85,15 +85,18 @@ const ENDPOINT = {
85
85
  * provider the registry publishes is always drawn.
86
86
  */
87
87
  const LEAD = ['tiktok', 'instagram', 'linkedin', 'slack', 'x', 'whatsapp', 'discord', 'telegram', 'facebook', 'teams', 'threads', 'youtube'];
88
- /** The host's published integrations, as directory rows. Real, public, counted. */
89
- const apps = () => (where().integrations ?? []).map((i) => ({
88
+ /** The host's published integrations, as directory rows. Real, public, counted. Read once. */
89
+ let listing = null;
90
+ const apps = () => (listing ??= (where().integrations?.() ?? Promise.resolve([]))
91
+ .then((all) => all.map((i) => ({
90
92
  id: i.slug,
91
93
  name: i.name,
92
94
  publisher: i.creator,
93
95
  // The catalog's own sentence, trimmed to the card's two lines.
94
96
  description: i.description.split('. ')[0] + '.',
95
97
  kind: 'native',
96
- }));
98
+ })))
99
+ .catch(() => []));
97
100
  const CHANNELS_CATALOG = [
98
101
  { id: 'slack', name: 'Slack', publisher: 'Hanzo Auto', description: 'Bidirectional sync with FoundationDAO & workspace Slack channels and threads.', kind: 'native', available: true, connected: true },
99
102
  { id: 'discord', name: 'Discord', publisher: 'Hanzo Auto', description: 'Bot and webhook integration for community server announcements and chat.', kind: 'native', available: true, connected: true },
@@ -131,7 +134,7 @@ const SKILLS_CATALOG = [
131
134
  function catalogFor(tab) {
132
135
  switch (tab) {
133
136
  case 'apps':
134
- return apps();
137
+ return [];
135
138
  case 'channels':
136
139
  return CHANNELS_CATALOG;
137
140
  case 'plugins':
@@ -228,14 +231,20 @@ export function Catalog({ tab }) {
228
231
  // also mark which providers the org has actually connected, from the one
229
232
  // read that names them.
230
233
  if (tab === 'apps') {
234
+ apps().then((list) => {
235
+ if (live)
236
+ setRows(list);
237
+ });
231
238
  if (auth) {
232
- fetch(`${api()}/v1/integrations/connectors`, { headers: auth })
233
- .then((r) => (r.ok ? r.json() : null))
234
- .then((j) => {
239
+ Promise.all([
240
+ apps(),
241
+ fetch(`${api()}/v1/integrations/connectors`, { headers: auth }).then((r) => (r.ok ? r.json() : null)),
242
+ ])
243
+ .then(([list, j]) => {
235
244
  if (!live || !j?.connectors)
236
245
  return;
237
246
  const on = new Set(j.connectors.map((c) => String(c.provider)));
238
- setRows(apps().map((a) => (on.has(a.id) ? { ...a, connected: true } : a)));
247
+ setRows(list.map((a) => (on.has(a.id) ? { ...a, connected: true } : a)));
239
248
  })
240
249
  .catch(() => { });
241
250
  }
package/dist/Orgs.js CHANGED
@@ -56,9 +56,10 @@ function checkout(plan) {
56
56
  export function Orgs({ children, front = false, forward, signup = false, }) {
57
57
  const hydrated = useHydrated();
58
58
  const { isAuthenticated, isLoading, accessToken } = useIam();
59
- const { Landing, Signup } = where();
60
- // The front door's own flow: naming a team, inviting it, the per-seat plan.
61
- const door = front || signup;
59
+ const { Landing, Signup, team } = where();
60
+ // The front door's own flow: naming a team, inviting it, the per-seat plan —
61
+ // at hanzo.ai's Home and /start, and in every room of hanzo.team.
62
+ const door = front || signup || Boolean(team);
62
63
  const arriving = useArrival(door, hydrated, isLoading, isAuthenticated);
63
64
  const members = useMemo(() => claimed(), [accessToken]); // eslint-disable-line react-hooks/exhaustive-deps
64
65
  const [current, setCurrent] = useState(() => org());
@@ -302,7 +303,7 @@ function Step({ at, of }) {
302
303
  return (_jsxs(Text, { render: "p", mb: 10, fontSize: "$2", fontFamily: "$mono", color: "$soft", children: ["Step ", at, " of ", of] }));
303
304
  }
304
305
  function Brand() {
305
- return (_jsx(Text, { fontSize: "$6", fontWeight: "500", mb: 28, color: "var(--foreground)", children: "Hanzo" }));
306
+ return (_jsx(Text, { fontSize: "$6", fontWeight: "500", mb: 28, color: "var(--foreground)", children: where().brand ?? 'Hanzo' }));
306
307
  }
307
308
  /** The free rung's name in the billing catalog. */
308
309
  const FREE_TIER = 'free';
@@ -1,4 +1,3 @@
1
- 'use client';
2
1
  import { jsx as _jsx } from "react/jsx-runtime";
3
2
  /**
4
3
  * A lab's brand mark, or one of ours, painted in the current text colour.
@@ -25,9 +24,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
25
24
  * substitute for a logo that exists: of the labs on the endpoint today, only the
26
25
  * community fine-tuners and a handful of new labs reach it.
27
26
  */
28
- // A client boundary of its own, with one export: a server page that draws a
29
- // mark loads this module, not the whole @hanzo/ui barrel behind it.
30
- import { Text, View } from '@hanzo/ui';
27
+ import { Text, View } from './ui.js';
31
28
  import { getOrgAndSlug, orgDisplayName } from './lib/models.js';
32
29
  import { ENSO_MARK, MARK_PATHS } from '@hanzo/logo/logos';
33
30
  import { siAdroll, siCloudflare, siDiscord, siFacebook, siFarcaster, siGithub, siGitlab, siGoogleads, siGooglechrome, siInstagram, siMeta, siPinterest, siReddit, siTelegram, siThreads, siTiktok, siTwitch, siWhatsapp, siX, siYoutube, } from 'simple-icons';
package/dist/Shell.js CHANGED
@@ -127,7 +127,9 @@ const HOME = {
127
127
  get route() {
128
128
  return where().home;
129
129
  },
130
- title: "Hanzo",
130
+ get title() {
131
+ return where().brand ?? "Hanzo";
132
+ },
131
133
  label: "Home",
132
134
  // The chat bubble. Home IS the conversation with the org — the rooms it talks
133
135
  // in and the people in them — so it is drawn as one. It shared this glyph with
@@ -23,5 +23,5 @@ export declare function attach(client: Analytics): void;
23
23
  export declare function link(url: string): string;
24
24
  /** `link` for the redirect to IAM: the same, and the queue is sent before the page leaves. */
25
25
  export declare function authorize(url: string): string;
26
- /** One funnel moment, to every place it is counted, under one event_id. */
26
+ /** One funnel moment, to every place it is counted, under one event_id: the host's own call where it states one. */
27
27
  export declare function track(name: string, params?: Record<string, unknown>): void;
package/dist/lib/tags.js CHANGED
@@ -10,6 +10,7 @@
10
10
  * page's one client, from inside its provider.
11
11
  */
12
12
  import { mirror, startTags, tagsReady, track as fire, visit } from '@hanzo/event';
13
+ import { where } from '../where.js';
13
14
  export { mirror, startTags, tagsReady, visit };
14
15
  /** The sites one visit can cross; GA4 keeps it one session across them. */
15
16
  export const DOMAINS = [
@@ -40,7 +41,11 @@ export function link(url) {
40
41
  export function authorize(url) {
41
42
  return stream ? stream.authorize(url) : url;
42
43
  }
43
- /** One funnel moment, to every place it is counted, under one event_id. */
44
+ /** One funnel moment, to every place it is counted, under one event_id: the host's own call where it states one. */
44
45
  export function track(name, params = {}) {
45
- fire(stream, name, params);
46
+ const own = where().track;
47
+ if (own)
48
+ own(name, params);
49
+ else
50
+ fire(stream, name, params);
46
51
  }
package/dist/ui.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @hanzo/ui, for the modules here that a server component renders.
3
+ *
4
+ * The package's root barrel re-exports its whole surface, and a server
5
+ * component that reaches it registers every 'use client' module behind it as a
6
+ * client entry of the route — 81 KB on a model page. Through this module the
7
+ * server sees one client reference, and the client keeps only what is named.
8
+ * Rooms are client components and import `@hanzo/ui` directly.
9
+ */
10
+ export { Text, View } from '@hanzo/ui';
package/dist/ui.js ADDED
@@ -0,0 +1,11 @@
1
+ 'use client';
2
+ /**
3
+ * @hanzo/ui, for the modules here that a server component renders.
4
+ *
5
+ * The package's root barrel re-exports its whole surface, and a server
6
+ * component that reaches it registers every 'use client' module behind it as a
7
+ * client entry of the route — 81 KB on a model page. Through this module the
8
+ * server sees one client reference, and the client keeps only what is named.
9
+ * Rooms are client components and import `@hanzo/ui` directly.
10
+ */
11
+ export { Text, View } from '@hanzo/ui';
package/dist/where.d.ts CHANGED
@@ -25,12 +25,18 @@ export interface Addresses {
25
25
  home: string;
26
26
  /** Where a new account starts: `/signup`, or hanzo.team's `/start`. */
27
27
  signUp: string;
28
+ /** The product's name where the rooms print it: Home's title, the setup's wordmark. Default `Hanzo`. */
29
+ brand?: string;
28
30
  /** The publishable key anonymous calls carry. */
29
31
  key?: string;
30
32
  /** The plan catalogue as the host's build last read it: the first paint. */
31
33
  plans?: BillingPlan[];
32
- /** The SDKs and frameworks Directory lists, which the host publishes. */
33
- integrations?: Integration[];
34
+ /**
35
+ * The SDKs and frameworks Directory lists, which the host publishes. A loader,
36
+ * so the catalogue — every guide's code, and the model counts it quotes — is
37
+ * fetched when Directory's Apps tab opens, not on every page the rooms frame.
38
+ */
39
+ integrations?: () => Promise<Integration[]>;
34
40
  /**
35
41
  * The host's front door, for a workspace rooted at `/` (hanzo.team): what a
36
42
  * stranger at Home is shown instead of the sign-in, and the business sign-up
@@ -40,12 +46,23 @@ export interface Addresses {
40
46
  member?: boolean;
41
47
  }>;
42
48
  Signup?: ComponentType;
49
+ /**
50
+ * The rooms are hanzo.team's: every room is behind the per-seat Team plan,
51
+ * and an organization is founded through the team's setup, never the create
52
+ * dialog a person on hanzo.ai uses.
53
+ */
54
+ team?: boolean;
55
+ /**
56
+ * The host's funnel call, for a host that counts moments in tags of its own
57
+ * (hanzo.team's GA4 and Pixel boot). Unset, a moment goes to @hanzo/event's
58
+ * tag manager.
59
+ */
60
+ track?: (name: string, params: Record<string, unknown>) => void;
43
61
  }
44
62
  /**
45
63
  * State the host's addresses, at module scope, before anything renders. Each
46
64
  * call adds to what is stated, so a host can name its cheap addresses at its
47
- * root and the heavy ones (the plan catalogue, the integrations) only where the
48
- * rooms are drawn.
65
+ * root and the heavier ones only where the rooms are drawn.
49
66
  */
50
67
  export declare function configure(given: Partial<Addresses>): void;
51
68
  /** The host's addresses, for code that runs outside a component. */
package/dist/where.js CHANGED
@@ -2,8 +2,7 @@ let addresses = { site: '', home: '/home', signUp: '/signup' };
2
2
  /**
3
3
  * State the host's addresses, at module scope, before anything renders. Each
4
4
  * call adds to what is stated, so a host can name its cheap addresses at its
5
- * root and the heavy ones (the plan catalogue, the integrations) only where the
6
- * rooms are drawn.
5
+ * root and the heavier ones only where the rooms are drawn.
7
6
  */
8
7
  export function configure(given) {
9
8
  addresses = { ...addresses, ...given };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/rooms",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "The workspace rooms — Home, Chat, Inbox, Contacts, Meet, Cal, Drive, Board, Work, Bots — and the frame that holds them, once, for every Hanzo surface.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -102,7 +102,7 @@
102
102
  "gen": "node scripts/team.mjs",
103
103
  "build": "rm -rf dist && node scripts/team.mjs && tsc -p tsconfig.build.json && node scripts/specifiers.mjs",
104
104
  "typecheck": "tsc --noEmit",
105
- "test": "vitest run --passWithNoTests",
105
+ "test": "vitest run",
106
106
  "lint:design": "hanzo-design-lint src"
107
107
  }
108
108
  }