@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.
Files changed (48) hide show
  1. package/dist/chunks/{UiKitApp-D7vllRQE.js → UiKitApp-B1ANqCac.js} +528 -481
  2. package/dist/chunks/{WorkspaceRoutes-DH1LD-2Q.js → WorkspaceRoutes-BHNGrf-j.js} +24955 -24119
  3. package/dist/chunks/{dashboard-Dsaeud2x.js → dashboard-b-W6dGm5.js} +586 -565
  4. package/dist/chunks/{index-CGMqw2NH.js → index-HYioDjux.js} +104 -104
  5. package/dist/dashboard.js +2 -2
  6. package/dist/index.js +166 -159
  7. package/dist/site-widget.css +25 -6
  8. package/dist/site-widget.js +6925 -6840
  9. package/dist/studio.css +171 -42
  10. package/package.json +2 -2
  11. package/src/api.ts +44 -1
  12. package/src/chat/ChatMessage.tsx +4 -4
  13. package/src/chat/ChatProvider.tsx +6 -0
  14. package/src/chat/chat-helpers.ts +54 -2
  15. package/src/chrome/CommandPalette.tsx +3 -3
  16. package/src/chrome/ContentExplorerSidebar.tsx +421 -74
  17. package/src/chrome/WorkspaceStatusBar.tsx +24 -24
  18. package/src/chrome/commit-error.ts +48 -60
  19. package/src/chrome/commit-failure.tsx +2 -2
  20. package/src/chrome/content-path-tree.ts +4 -0
  21. package/src/chrome/explorer-row-menu.ts +28 -0
  22. package/src/chrome/folder-create-context.ts +14 -0
  23. package/src/chrome/use-publish-check.ts +75 -0
  24. package/src/{pages/code-session-routes.ts → content-routes.ts} +6 -6
  25. package/src/fields/FieldControl.tsx +198 -64
  26. package/src/fields/LinkFieldInput.tsx +315 -0
  27. package/src/fields/choose-field-input.ts +5 -0
  28. package/src/fields/link-targets.ts +60 -0
  29. package/src/host-path.ts +13 -0
  30. package/src/pages/CodeSessionPage.tsx +6 -241
  31. package/src/pages/DocEditorPage.tsx +121 -178
  32. package/src/pages/EmbedPublishPage.tsx +13 -5
  33. package/src/pages/GithubConnectPage.tsx +1 -1
  34. package/src/pages/LoginPage.tsx +67 -5
  35. package/src/pages/MediaFieldInput.tsx +712 -37
  36. package/src/pages/MediaGalleryPage.tsx +69 -5
  37. package/src/pages/PreviewAddress.tsx +293 -0
  38. package/src/pages/WorkspaceHomePage.tsx +1 -1
  39. package/src/pages/code-session-boot.ts +0 -12
  40. package/src/pages/media-selection.ts +79 -0
  41. package/src/pages/ui-kit/colors.tsx +2 -0
  42. package/src/pages/ui-kit/fields.tsx +60 -0
  43. package/src/styles/themes.ts +2 -0
  44. package/src/styles/tokens.stylex.ts +1 -0
  45. package/src/ui/Button.tsx +14 -0
  46. package/src/ui/Field.tsx +12 -1
  47. package/src/ui/Input.tsx +191 -97
  48. package/src/ui/popup.ts +13 -6
@@ -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 type="submit" disabled={busy} {...stylex.props(styles.cta, busy && styles.ctaDisabled)}>
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
  });