@hanzo/rooms 0.1.47 → 0.1.49
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/Upgrade.js +8 -7
- package/dist/lib/destination.d.ts +15 -0
- package/dist/lib/destination.js +32 -3
- package/package.json +1 -1
package/dist/Upgrade.js
CHANGED
|
@@ -8,7 +8,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
// says who is on Free; `Upgrade` draws the ask it is handed and nothing when it
|
|
9
9
|
// is handed none. A refusal's ask is read by `planRequired` in `failure.ts`.
|
|
10
10
|
import { useEffect, useState } from 'react';
|
|
11
|
-
import {
|
|
11
|
+
import { Gauge, Sparkles, Users, Workflow, X } from 'lucide-react';
|
|
12
12
|
import { Anchor, Box, Dialog, DialogContent, DialogTitle, Text, ToggleGroup, ToggleGroupItem, XStack, YStack } from '@hanzo/ui';
|
|
13
13
|
import { track } from './lib/tags.js';
|
|
14
14
|
import { org } from './lib/session.js';
|
|
@@ -22,12 +22,13 @@ export function useFree(signedIn) {
|
|
|
22
22
|
const { tier } = useTier(signedIn, org());
|
|
23
23
|
return signedIn && tier?.tier?.name === FREE;
|
|
24
24
|
}
|
|
25
|
+
// What the first paid personal plan adds to Free, in the words of the plan
|
|
26
|
+
// catalog (@hanzo/plans subscription.json, the `dev` plan's features).
|
|
25
27
|
const ROWS = [
|
|
26
|
-
[Gauge, '
|
|
27
|
-
[Sparkles, '
|
|
28
|
-
[
|
|
29
|
-
[
|
|
30
|
-
[ListChecks, 'Power through tasks with Hanzo Team'],
|
|
28
|
+
[Gauge, 'Usage included on every model'],
|
|
29
|
+
[Sparkles, 'Every model, including Enso Ultra and Kai'],
|
|
30
|
+
[Users, 'Hanzo Team: chat, meetings, calendar and contacts'],
|
|
31
|
+
[Workflow, 'Automations, with daily runs included'],
|
|
31
32
|
];
|
|
32
33
|
/** The page checkout returns to: this one, query and all. */
|
|
33
34
|
function here() {
|
|
@@ -71,5 +72,5 @@ export function Upgrade({ ask, onClose }) {
|
|
|
71
72
|
}, disableDeactivation: true, "aria-label": "Billing term", ...{ width: '100%', p: 4, rounded: 9999, bg: 'var(--surface-2)' }, children: [
|
|
72
73
|
['month', 'Monthly'],
|
|
73
74
|
['year', `Yearly · Save ${save}%`],
|
|
74
|
-
].map(([value, name]) => (_jsx(ToggleGroupItem, { value: value, variant: "outline", flex: 1, rounded: "$10", borderColor: "transparent", children: name }, value))) })), _jsxs(YStack, { gap: "$3", children: [_jsx(Anchor, { href: href, onPress: buy, "data-ga": true, bg: "var(--primary)", color: "var(--primary-foreground)", rounded: "$4", py: "$3", px: "$4", fontSize: "$4", fontWeight: "500", text: "center", textDecorationLine: "none", hoverStyle: { bg: 'var(--primary-hover)' }, children: label }), _jsxs(XStack, { justify: "center", gap: "$5", children: [_jsx(Anchor, { href: site("/pricing"), fontSize: "$3", color: "$soft", hoverStyle: { color: '$ink' }, children: "See all plans" }), _jsx(Box, { render: "button", onClick: onClose, bg: "transparent", borderWidth: 0, p: 0, cursor: "pointer", children: _jsx(Text, { fontSize: "$3", color: "$soft", hoverStyle: { color: '$ink' }, children: "Not now" }) })] })] })
|
|
75
|
+
].map(([value, name]) => (_jsx(ToggleGroupItem, { value: value, variant: "outline", flex: 1, rounded: "$10", borderColor: "transparent", children: name }, value))) })), _jsxs(YStack, { gap: "$3", children: [_jsx(Anchor, { href: href, onPress: buy, "data-ga": true, bg: "var(--primary)", color: "var(--primary-foreground)", rounded: "$4", py: "$3", px: "$4", fontSize: "$4", fontWeight: "500", text: "center", textDecorationLine: "none", hoverStyle: { bg: 'var(--primary-hover)' }, children: label }), _jsxs(XStack, { justify: "center", gap: "$5", children: [_jsx(Anchor, { href: site("/pricing"), fontSize: "$3", color: "$soft", hoverStyle: { color: '$ink' }, children: "See all plans" }), _jsx(Box, { render: "button", onClick: onClose, bg: "transparent", borderWidth: 0, p: 0, cursor: "pointer", children: _jsx(Text, { fontSize: "$3", color: "$soft", hoverStyle: { color: '$ink' }, children: "Not now" }) })] })] })] }) }));
|
|
75
76
|
}
|
|
@@ -54,6 +54,21 @@ export declare function door(): string;
|
|
|
54
54
|
* the page is `door()`'s; a control that says "Sign in" names LOGIN.
|
|
55
55
|
*/
|
|
56
56
|
export declare function enter(to?: string): void;
|
|
57
|
+
/**
|
|
58
|
+
* The campaign a visit arrived with: the UTM parameters and the ad platforms'
|
|
59
|
+
* click ids. They ride to the sign-in page as its own parameters, so the page a
|
|
60
|
+
* campaign's visitor signs up on is a landing with that campaign, not one with
|
|
61
|
+
* it folded inside `next=`.
|
|
62
|
+
*/
|
|
63
|
+
export declare const CAMPAIGN: readonly ["utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content", "gclid", "gbraid", "wbraid", "fbclid", "li_fat_id", "twclid", "ttclid"];
|
|
64
|
+
/**
|
|
65
|
+
* The sign-in address for a reader on `here`: `to`, with `here` as its `next=`
|
|
66
|
+
* when that is a page worth coming back to, and the campaign `here` carries as
|
|
67
|
+
* `to`'s own parameters. The page itself is written in the address too, so the
|
|
68
|
+
* place (a room, a prompt in `?q=`) survives what sessionStorage does not: a new
|
|
69
|
+
* tab, a pasted link.
|
|
70
|
+
*/
|
|
71
|
+
export declare function entry(to: string, here: string): string;
|
|
57
72
|
/**
|
|
58
73
|
* The `?next=` a sign-in page was opened with, when it is an address on this
|
|
59
74
|
* site (`safe`): where the sign-in goes on to. Anything else is undefined.
|
package/dist/lib/destination.js
CHANGED
|
@@ -119,10 +119,39 @@ export function enter(to = door()) {
|
|
|
119
119
|
if (handoff(here))
|
|
120
120
|
return;
|
|
121
121
|
rememberDestination();
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
window.location.assign(entry(to, here));
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* The campaign a visit arrived with: the UTM parameters and the ad platforms'
|
|
126
|
+
* click ids. They ride to the sign-in page as its own parameters, so the page a
|
|
127
|
+
* campaign's visitor signs up on is a landing with that campaign, not one with
|
|
128
|
+
* it folded inside `next=`.
|
|
129
|
+
*/
|
|
130
|
+
export const CAMPAIGN = [
|
|
131
|
+
"utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content",
|
|
132
|
+
"gclid", "gbraid", "wbraid", "fbclid", "li_fat_id", "twclid", "ttclid",
|
|
133
|
+
];
|
|
134
|
+
/**
|
|
135
|
+
* The sign-in address for a reader on `here`: `to`, with `here` as its `next=`
|
|
136
|
+
* when that is a page worth coming back to, and the campaign `here` carries as
|
|
137
|
+
* `to`'s own parameters. The page itself is written in the address too, so the
|
|
138
|
+
* place (a room, a prompt in `?q=`) survives what sessionStorage does not: a new
|
|
139
|
+
* tab, a pasted link.
|
|
140
|
+
*/
|
|
141
|
+
export function entry(to, here) {
|
|
142
|
+
const [path, query = ""] = to.split("?");
|
|
143
|
+
const out = new URLSearchParams(query);
|
|
124
144
|
const back = safe(here, "");
|
|
125
|
-
|
|
145
|
+
if (back && back !== "/")
|
|
146
|
+
out.set("next", back);
|
|
147
|
+
const from = new URLSearchParams(here.split("#")[0].split("?")[1] ?? "");
|
|
148
|
+
for (const k of CAMPAIGN) {
|
|
149
|
+
const v = from.get(k)?.trim();
|
|
150
|
+
if (v && !out.has(k))
|
|
151
|
+
out.set(k, v);
|
|
152
|
+
}
|
|
153
|
+
const q = out.toString();
|
|
154
|
+
return q ? `${path}?${q}` : path;
|
|
126
155
|
}
|
|
127
156
|
/**
|
|
128
157
|
* The `?next=` a sign-in page was opened with, when it is an address on this
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/rooms",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.49",
|
|
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",
|