@book.dev/ui 1.60.0 → 1.64.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 (38) hide show
  1. package/dist/{EmojiGrid-xK5mPJPo.js → EmojiGrid-THzuvC4K.js} +75 -84
  2. package/dist/blockeditor/BlockEditor.d.ts +16 -0
  3. package/dist/blockeditor/EmojiMenu.d.ts +17 -0
  4. package/dist/blockeditor/__tests__/EmojiMenu.test.d.ts +1 -0
  5. package/dist/blockeditor/__tests__/readOnly.test.d.ts +1 -0
  6. package/dist/blockeditor/__tests__/titleHandoff.test.d.ts +1 -0
  7. package/dist/blockeditor/__tests__/triggerMenus.test.d.ts +1 -0
  8. package/dist/blockeditor/kit/KitFrame.d.ts +5 -0
  9. package/dist/blockeditor/kit/lock.d.ts +14 -0
  10. package/dist/components/LastEditedBy.d.ts +11 -0
  11. package/dist/components/OnboardingNudge.d.ts +11 -0
  12. package/dist/components/ShareDialog.d.ts +25 -0
  13. package/dist/components/__tests__/lastEditedBy.test.d.ts +1 -0
  14. package/dist/components/__tests__/membersSettings.test.d.ts +1 -0
  15. package/dist/components/__tests__/sharingSettings.test.d.ts +1 -0
  16. package/dist/components/settings/AccountSettings.d.ts +4 -0
  17. package/dist/components/settings/AccountSwitcher.d.ts +12 -0
  18. package/dist/components/settings/MembersSettings.d.ts +1 -0
  19. package/dist/components/settings/SharingSettings.d.ts +9 -0
  20. package/dist/emoji-Bmft6RPl.js +11 -0
  21. package/dist/{format-CLQoRoYP.js → format-D9FO3jG9.js} +114 -114
  22. package/dist/i18n/messages/en.d.ts +169 -0
  23. package/dist/index.js +7238 -5976
  24. package/dist/lib/__tests__/useCanWrite.test.d.ts +1 -0
  25. package/dist/lib/hud.d.ts +2 -2
  26. package/dist/lib/sidebarStyles.d.ts +7 -0
  27. package/dist/lib/useCanWrite.d.ts +45 -0
  28. package/dist/{lucideIcons-B6pmC-WQ.js → lucideIcons-Dv5yzk2L.js} +1916 -1016
  29. package/dist/providers/AccountProvider.d.ts +47 -7
  30. package/dist/providers/ForwardingProvider.d.ts +19 -0
  31. package/dist/providers/PlatformLibraryProvider.d.ts +20 -0
  32. package/dist/providers/__tests__/AccountProvider.test.d.ts +1 -0
  33. package/dist/providers/__tests__/forwardingAudience.test.d.ts +9 -0
  34. package/dist/providers/forwardingAudience.d.ts +165 -0
  35. package/dist/screens/pageChrome.d.ts +11 -0
  36. package/dist/style.css +1 -1
  37. package/dist/{toHtml-BoPr8Ce4.js → toHtml-DeWpCU0o.js} +2 -2
  38. package/package.json +7 -2
@@ -0,0 +1 @@
1
+ export {};
package/dist/lib/hud.d.ts CHANGED
@@ -9,11 +9,11 @@ export declare const SETTINGS_SECTIONS: readonly [{
9
9
  readonly tabs: readonly ["profile", "signup", "signin", "support"];
10
10
  }, {
11
11
  readonly id: "workspace";
12
- readonly tabs: readonly ["connection", "integrations", "extensions", "ai", "admin"];
12
+ readonly tabs: readonly ["connection", "members", "integrations", "extensions", "ai", "admin"];
13
13
  }];
14
14
  export type SettingsSectionId = (typeof SETTINGS_SECTIONS)[number]['id'];
15
15
  /** Settings panels, flattened in display order (derived from the sections). */
16
- export declare const SETTINGS_TABS: ("appearance" | "ai" | "extensions" | "general" | "profile" | "customisation" | "connection" | "integrations" | "admin" | "signup" | "signin" | "support")[];
16
+ export declare const SETTINGS_TABS: ("appearance" | "ai" | "extensions" | "general" | "profile" | "customisation" | "connection" | "members" | "integrations" | "admin" | "signup" | "signin" | "support")[];
17
17
  export type SettingsTab = (typeof SETTINGS_SECTIONS)[number]['tabs'][number];
18
18
  /** The first sub-screen — the default when nothing (valid) is persisted. */
19
19
  export declare const DEFAULT_SETTINGS_TAB: SettingsTab;
@@ -8,3 +8,10 @@
8
8
  export declare const SIDEBAR_HOVER = "hover:bg-primary/10 hover:text-foreground dark:hover:bg-primary/20";
9
9
  /** The selected / active sidebar item — a stronger tint of the same colour. */
10
10
  export declare const SIDEBAR_ACTIVE = "bg-primary/15 text-foreground dark:bg-primary/25";
11
+ /**
12
+ * Press feedback for sidebar control buttons (settings, menu toggle). Cancels
13
+ * the shared Button's shrink-on-press (`active:scale-[0.97]`) and deepens the
14
+ * highlight instead — a darker tint in light mode, a lighter one in dark mode.
15
+ * Applied via `cn` so it overrides the Button base through tailwind-merge.
16
+ */
17
+ export declare const SIDEBAR_PRESS = "active:scale-100 active:bg-primary/20 dark:active:bg-primary/30";
@@ -0,0 +1,45 @@
1
+ import type { InstanceInfo } from '@book.dev/sdk';
2
+ /**
3
+ * Whether the current caller may WRITE this instance — the signal that decides
4
+ * if a page renders editable or whole-document read-only (OB-205; contract roles
5
+ * admin=full, viewer=locked).
6
+ *
7
+ * ## Sourcing (coarse, UI-only, documented)
8
+ * The brief's preferred shape is a per-page `authorize()` over the page's
9
+ * visibility + `listPageAcl` + `getInstanceInfo().youRole` + the principal. On
10
+ * this branch that can't be assembled UI-side and stay isolated from the server:
11
+ *
12
+ * - `getInstanceInfo().youRole` does **not exist** yet (the brief assumed it);
13
+ * adding it is a server change, out of scope for this UI-isolated slice.
14
+ * - the roster role (`listMembers`) and per-page ACL (`listPageAcl`) are **not on
15
+ * the `DataClient` interface** `useData()` returns (only `getInstanceInfo` is),
16
+ * and `GET /api/members` is admin-gated anyway (a viewer 403s).
17
+ * - `StoredPage` carries no `visibility`, and the post-`inherit` effective
18
+ * visibility isn't resolvable client-side.
19
+ *
20
+ * So this falls back to the coarse signal the brief sanctions ("v1 hide-not-break,
21
+ * the server is the real enforcement — writes 403 regardless"), read from the one
22
+ * sharing method on the interface, {@link DataClient.getInstanceInfo}:
23
+ *
24
+ * - the loopback owner (`verifiedVia==='local'`) and any signed-in (`jws`) user
25
+ * are treated as writers — keeping owner / admin / writer editing unchanged;
26
+ * - a guest (or other non-`jws`) is a writer only when the guest gate is open
27
+ * (`guestAccess==='write'`) — so an anonymous reader on a `read`/`off` instance
28
+ * renders read-only;
29
+ * - everything else renders read-only.
30
+ *
31
+ * ### Known v1 gap (errs toward writable = hide-not-break)
32
+ * A signed-in **roster viewer** (a `jws` user with role `viewer`) is rendered
33
+ * editable here, not locked — we can't tell them from an admin without the role.
34
+ * Their writes are still rejected by the server (403), so it's "show chrome that
35
+ * no-ops", never data corruption. The seam below already reads `youRole` if a
36
+ * future server build adds it to `InstanceInfo` — at which point jws viewers lock
37
+ * correctly with **no UI change**. ACL-write grantees and per-page visibility are
38
+ * likewise out of this coarse v1 (they'd need the per-page `authorize()` inputs).
39
+ *
40
+ * Defaults to writable while loading / on error, so the common owner case never
41
+ * flashes locked and a transient failure never strands a writer.
42
+ */
43
+ export declare function useCanWrite(): boolean;
44
+ /** The coarse decision (see {@link useCanWrite}). Pure, so it's unit-testable. */
45
+ export declare function canWriteFromInstance(info: InstanceInfo): boolean;