@backmatter/studio 0.0.17 → 0.0.19
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/chunks/{UiKitApp-D7vllRQE.js → UiKitApp-B1ANqCac.js} +528 -481
- package/dist/chunks/{WorkspaceRoutes-DH1LD-2Q.js → WorkspaceRoutes-BHNGrf-j.js} +24955 -24119
- package/dist/chunks/{dashboard-Dsaeud2x.js → dashboard-b-W6dGm5.js} +586 -565
- package/dist/chunks/{index-CGMqw2NH.js → index-HYioDjux.js} +104 -104
- package/dist/dashboard.js +2 -2
- package/dist/index.js +166 -159
- package/dist/site-widget.css +25 -6
- package/dist/site-widget.js +6925 -6840
- package/dist/studio.css +171 -42
- package/package.json +2 -2
- package/src/api.ts +44 -1
- package/src/chat/ChatMessage.tsx +4 -4
- package/src/chat/ChatProvider.tsx +6 -0
- package/src/chat/chat-helpers.ts +54 -2
- package/src/chrome/CommandPalette.tsx +3 -3
- package/src/chrome/ContentExplorerSidebar.tsx +421 -74
- package/src/chrome/WorkspaceStatusBar.tsx +24 -24
- package/src/chrome/commit-error.ts +48 -60
- package/src/chrome/commit-failure.tsx +2 -2
- package/src/chrome/content-path-tree.ts +4 -0
- package/src/chrome/explorer-row-menu.ts +28 -0
- package/src/chrome/folder-create-context.ts +14 -0
- package/src/chrome/use-publish-check.ts +75 -0
- package/src/{pages/code-session-routes.ts → content-routes.ts} +6 -6
- package/src/fields/FieldControl.tsx +198 -64
- package/src/fields/LinkFieldInput.tsx +315 -0
- package/src/fields/choose-field-input.ts +5 -0
- package/src/fields/link-targets.ts +60 -0
- package/src/host-path.ts +13 -0
- package/src/pages/CodeSessionPage.tsx +6 -241
- package/src/pages/DocEditorPage.tsx +121 -178
- package/src/pages/EmbedPublishPage.tsx +13 -5
- package/src/pages/GithubConnectPage.tsx +1 -1
- package/src/pages/LoginPage.tsx +67 -5
- package/src/pages/MediaFieldInput.tsx +712 -37
- package/src/pages/MediaGalleryPage.tsx +69 -5
- package/src/pages/PreviewAddress.tsx +293 -0
- package/src/pages/WorkspaceHomePage.tsx +1 -1
- package/src/pages/code-session-boot.ts +0 -12
- package/src/pages/media-selection.ts +79 -0
- package/src/pages/ui-kit/colors.tsx +2 -0
- package/src/pages/ui-kit/fields.tsx +60 -0
- package/src/styles/themes.ts +2 -0
- package/src/styles/tokens.stylex.ts +1 -0
- package/src/ui/Button.tsx +14 -0
- package/src/ui/Field.tsx +12 -1
- package/src/ui/Input.tsx +191 -97
- package/src/ui/popup.ts +13 -6
package/src/pages/LoginPage.tsx
CHANGED
|
@@ -11,6 +11,12 @@ import { Text } from "../ui/Text";
|
|
|
11
11
|
|
|
12
12
|
const hover = "@media (hover: hover)";
|
|
13
13
|
|
|
14
|
+
const legal = {
|
|
15
|
+
terms: "https://backmatter.app/legal/terms",
|
|
16
|
+
privacy: "https://backmatter.app/legal/privacy",
|
|
17
|
+
dpa: "https://backmatter.app/legal/dpa",
|
|
18
|
+
} as const;
|
|
19
|
+
|
|
14
20
|
export function LoginPage() {
|
|
15
21
|
const [params] = useSearchParams();
|
|
16
22
|
const [error, setError] = useState<string | null>(null);
|
|
@@ -22,6 +28,8 @@ export function LoginPage() {
|
|
|
22
28
|
const [password, setPassword] = useState("");
|
|
23
29
|
const [name, setName] = useState("");
|
|
24
30
|
const [mode, setMode] = useState<"signin" | "signup">("signin");
|
|
31
|
+
const [accepted, setAccepted] = useState(false);
|
|
32
|
+
const signupBlocked = mode === "signup" && !accepted;
|
|
25
33
|
|
|
26
34
|
useEffect(() => {
|
|
27
35
|
void fetchAuthConfig()
|
|
@@ -95,6 +103,26 @@ export function LoginPage() {
|
|
|
95
103
|
<div {...stylex.props(styles.actions)}>
|
|
96
104
|
{error ? <Text tone="danger">{error}</Text> : null}
|
|
97
105
|
{notice ? <Text tone="muted">{notice}</Text> : null}
|
|
106
|
+
<p {...stylex.props(styles.legal)}>
|
|
107
|
+
By continuing you agree to the{" "}
|
|
108
|
+
<a href={legal.terms} {...stylex.props(styles.legalLink)}>Terms</a> and the{" "}
|
|
109
|
+
<a href={legal.dpa} {...stylex.props(styles.legalLink)}>Data Processing Agreement</a>,
|
|
110
|
+
and you acknowledge the{" "}
|
|
111
|
+
<a href={legal.privacy} {...stylex.props(styles.legalLink)}>Privacy policy</a>.
|
|
112
|
+
A consumer who asks us to start the service now loses the 14-day right of withdrawal
|
|
113
|
+
once it has begun.
|
|
114
|
+
</p>
|
|
115
|
+
{mode === "signup" ? (
|
|
116
|
+
<label {...stylex.props(styles.accept)}>
|
|
117
|
+
<input
|
|
118
|
+
type="checkbox"
|
|
119
|
+
checked={accepted}
|
|
120
|
+
onChange={(event) => setAccepted(event.target.checked)}
|
|
121
|
+
{...stylex.props(styles.checkbox)}
|
|
122
|
+
/>
|
|
123
|
+
<span>I agree, and I ask Backmatter to start the service now.</span>
|
|
124
|
+
</label>
|
|
125
|
+
) : null}
|
|
98
126
|
<form onSubmit={(e) => void onPassword(e)} {...stylex.props(styles.form)}>
|
|
99
127
|
{mode === "signup" ? (
|
|
100
128
|
<input
|
|
@@ -125,15 +153,19 @@ export function LoginPage() {
|
|
|
125
153
|
autoComplete={mode === "signup" ? "new-password" : "current-password"}
|
|
126
154
|
{...stylex.props(styles.field)}
|
|
127
155
|
/>
|
|
128
|
-
<button
|
|
156
|
+
<button
|
|
157
|
+
type="submit"
|
|
158
|
+
disabled={busy || signupBlocked}
|
|
159
|
+
{...stylex.props(styles.cta, (busy || signupBlocked) && styles.ctaDisabled)}
|
|
160
|
+
>
|
|
129
161
|
{mode === "signup" ? "Create account" : "Sign in"}
|
|
130
162
|
</button>
|
|
131
163
|
</form>
|
|
132
164
|
<button
|
|
133
165
|
type="button"
|
|
134
|
-
disabled={busy || !email}
|
|
166
|
+
disabled={busy || !email || signupBlocked}
|
|
135
167
|
onClick={() => void onMagicLink()}
|
|
136
|
-
{...stylex.props(styles.secondary, (busy || !email) && styles.ctaDisabled)}
|
|
168
|
+
{...stylex.props(styles.secondary, (busy || !email || signupBlocked) && styles.ctaDisabled)}
|
|
137
169
|
>
|
|
138
170
|
Email me a magic link
|
|
139
171
|
</button>
|
|
@@ -147,9 +179,9 @@ export function LoginPage() {
|
|
|
147
179
|
</button>
|
|
148
180
|
<button
|
|
149
181
|
type="button"
|
|
150
|
-
disabled={busy || github !== true}
|
|
182
|
+
disabled={busy || github !== true || signupBlocked}
|
|
151
183
|
onClick={() => void onGithub()}
|
|
152
|
-
{...stylex.props(styles.cta, (busy || github !== true) && styles.ctaDisabled)}
|
|
184
|
+
{...stylex.props(styles.cta, (busy || github !== true || signupBlocked) && styles.ctaDisabled)}
|
|
153
185
|
>
|
|
154
186
|
<GithubIcon size={18} />
|
|
155
187
|
Continue with GitHub
|
|
@@ -332,4 +364,34 @@ const styles = stylex.create({
|
|
|
332
364
|
fontSize: type.sm,
|
|
333
365
|
color: colors.textMuted,
|
|
334
366
|
},
|
|
367
|
+
legal: {
|
|
368
|
+
margin: 0,
|
|
369
|
+
fontSize: type.sm,
|
|
370
|
+
lineHeight: 1.5,
|
|
371
|
+
color: colors.textMuted,
|
|
372
|
+
textAlign: "left",
|
|
373
|
+
},
|
|
374
|
+
legalLink: {
|
|
375
|
+
color: colors.text,
|
|
376
|
+
textUnderlineOffset: "2px",
|
|
377
|
+
},
|
|
378
|
+
accept: {
|
|
379
|
+
display: "flex",
|
|
380
|
+
width: "100%",
|
|
381
|
+
gap: space.sm,
|
|
382
|
+
alignItems: "flex-start",
|
|
383
|
+
minHeight: "44px",
|
|
384
|
+
textAlign: "left",
|
|
385
|
+
fontSize: type.sm,
|
|
386
|
+
lineHeight: 1.5,
|
|
387
|
+
color: colors.text,
|
|
388
|
+
cursor: "pointer",
|
|
389
|
+
},
|
|
390
|
+
checkbox: {
|
|
391
|
+
width: "18px",
|
|
392
|
+
height: "18px",
|
|
393
|
+
marginTop: "2px",
|
|
394
|
+
flexShrink: 0,
|
|
395
|
+
accentColor: "#fafafa",
|
|
396
|
+
},
|
|
335
397
|
});
|