@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.
- package/dist/{EmojiGrid-xK5mPJPo.js → EmojiGrid-THzuvC4K.js} +75 -84
- package/dist/blockeditor/BlockEditor.d.ts +16 -0
- package/dist/blockeditor/EmojiMenu.d.ts +17 -0
- package/dist/blockeditor/__tests__/EmojiMenu.test.d.ts +1 -0
- package/dist/blockeditor/__tests__/readOnly.test.d.ts +1 -0
- package/dist/blockeditor/__tests__/titleHandoff.test.d.ts +1 -0
- package/dist/blockeditor/__tests__/triggerMenus.test.d.ts +1 -0
- package/dist/blockeditor/kit/KitFrame.d.ts +5 -0
- package/dist/blockeditor/kit/lock.d.ts +14 -0
- package/dist/components/LastEditedBy.d.ts +11 -0
- package/dist/components/OnboardingNudge.d.ts +11 -0
- package/dist/components/ShareDialog.d.ts +25 -0
- package/dist/components/__tests__/lastEditedBy.test.d.ts +1 -0
- package/dist/components/__tests__/membersSettings.test.d.ts +1 -0
- package/dist/components/__tests__/sharingSettings.test.d.ts +1 -0
- package/dist/components/settings/AccountSettings.d.ts +4 -0
- package/dist/components/settings/AccountSwitcher.d.ts +12 -0
- package/dist/components/settings/MembersSettings.d.ts +1 -0
- package/dist/components/settings/SharingSettings.d.ts +9 -0
- package/dist/emoji-Bmft6RPl.js +11 -0
- package/dist/{format-CLQoRoYP.js → format-D9FO3jG9.js} +114 -114
- package/dist/i18n/messages/en.d.ts +169 -0
- package/dist/index.js +7238 -5976
- package/dist/lib/__tests__/useCanWrite.test.d.ts +1 -0
- package/dist/lib/hud.d.ts +2 -2
- package/dist/lib/sidebarStyles.d.ts +7 -0
- package/dist/lib/useCanWrite.d.ts +45 -0
- package/dist/{lucideIcons-B6pmC-WQ.js → lucideIcons-Dv5yzk2L.js} +1916 -1016
- package/dist/providers/AccountProvider.d.ts +47 -7
- package/dist/providers/ForwardingProvider.d.ts +19 -0
- package/dist/providers/PlatformLibraryProvider.d.ts +20 -0
- package/dist/providers/__tests__/AccountProvider.test.d.ts +1 -0
- package/dist/providers/__tests__/forwardingAudience.test.d.ts +9 -0
- package/dist/providers/forwardingAudience.d.ts +165 -0
- package/dist/screens/pageChrome.d.ts +11 -0
- package/dist/style.css +1 -1
- package/dist/{toHtml-BoPr8Ce4.js → toHtml-DeWpCU0o.js} +2 -2
- package/package.json +7 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as e,
|
|
1
|
+
import { B as e, Mt as t, V as n, a as r, g as i, kt as a, p as o, r as s, tt as c } from "./lucideIcons-Dv5yzk2L.js";
|
|
2
2
|
import { i as l } from "./pageIcon-BWTy7hAh.js";
|
|
3
3
|
import { t as u } from "./exportBlocks-33D7P_8Q.js";
|
|
4
4
|
import * as d from "react";
|
|
@@ -12,24 +12,24 @@ import { BadgeCheck as ge, Check as _e, ChevronDown as ve, ExternalLink as ye, M
|
|
|
12
12
|
import * as O from "@radix-ui/react-dropdown-menu";
|
|
13
13
|
import * as k from "@radix-ui/react-popover";
|
|
14
14
|
//#region src/components/PageIcon.tsx
|
|
15
|
-
function A({ value: e, fallback:
|
|
16
|
-
if (e &&
|
|
17
|
-
let
|
|
18
|
-
return
|
|
15
|
+
function A({ value: e, fallback: n = "📄", className: i }) {
|
|
16
|
+
if (e && r(e)) {
|
|
17
|
+
let r = s(e);
|
|
18
|
+
return r ? /* @__PURE__ */ v(r, {
|
|
19
19
|
"aria-hidden": !0,
|
|
20
|
-
className:
|
|
20
|
+
className: t("inline-block shrink-0 align-[-0.125em]", i),
|
|
21
21
|
style: {
|
|
22
22
|
width: "1em",
|
|
23
23
|
height: "1em"
|
|
24
24
|
}
|
|
25
|
-
}) :
|
|
26
|
-
className:
|
|
27
|
-
children:
|
|
25
|
+
}) : n ? /* @__PURE__ */ v("span", {
|
|
26
|
+
className: i,
|
|
27
|
+
children: n
|
|
28
28
|
}) : null;
|
|
29
29
|
}
|
|
30
|
-
let a = e ||
|
|
30
|
+
let a = e || n;
|
|
31
31
|
return a ? /* @__PURE__ */ v("span", {
|
|
32
|
-
className:
|
|
32
|
+
className: i,
|
|
33
33
|
children: a
|
|
34
34
|
}) : null;
|
|
35
35
|
}
|
|
@@ -41,77 +41,77 @@ var xe = he("inline-flex shrink-0 items-center justify-center rounded-md text-mu
|
|
|
41
41
|
md: "p-1.5"
|
|
42
42
|
} },
|
|
43
43
|
defaultVariants: { size: "md" }
|
|
44
|
-
}), j = d.forwardRef(({ className: e, size:
|
|
44
|
+
}), j = d.forwardRef(({ className: e, size: n, asChild: r = !1, type: i, ...a }, o) => /* @__PURE__ */ v(r ? me : "button", {
|
|
45
45
|
ref: o,
|
|
46
46
|
type: r ? void 0 : i ?? "button",
|
|
47
|
-
className:
|
|
47
|
+
className: t(xe({ size: n }), e),
|
|
48
48
|
...a
|
|
49
49
|
}));
|
|
50
50
|
j.displayName = "IconButton";
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region src/components/ui/dropdown-menu.tsx
|
|
53
|
-
var M = O.Root, N = O.Trigger, Se = O.Sub, Ce = O.RadioGroup, we = d.forwardRef(({ className: e, inset:
|
|
53
|
+
var M = O.Root, N = O.Trigger, Se = O.Sub, Ce = O.RadioGroup, we = d.forwardRef(({ className: e, inset: n, children: r, ...i }, a) => /* @__PURE__ */ y(O.SubTrigger, {
|
|
54
54
|
ref: a,
|
|
55
|
-
className:
|
|
55
|
+
className: t("flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-hover data-[state=open]:bg-hover", n && "pl-8", e),
|
|
56
56
|
...i,
|
|
57
57
|
children: [r, /* @__PURE__ */ v(x, { className: "ml-auto h-4 w-4" })]
|
|
58
58
|
}));
|
|
59
59
|
we.displayName = O.SubTrigger.displayName;
|
|
60
|
-
var Te = d.forwardRef(({ className: e, ...
|
|
60
|
+
var Te = d.forwardRef(({ className: e, ...n }, r) => /* @__PURE__ */ v(O.SubContent, {
|
|
61
61
|
ref: r,
|
|
62
|
-
className:
|
|
63
|
-
...
|
|
62
|
+
className: t("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", e),
|
|
63
|
+
...n
|
|
64
64
|
}));
|
|
65
65
|
Te.displayName = O.SubContent.displayName;
|
|
66
|
-
var P = d.forwardRef(({ className: e, sideOffset:
|
|
66
|
+
var P = d.forwardRef(({ className: e, sideOffset: n = 4, ...r }, i) => /* @__PURE__ */ v(O.Portal, { children: /* @__PURE__ */ v(O.Content, {
|
|
67
67
|
ref: i,
|
|
68
|
-
sideOffset:
|
|
69
|
-
className:
|
|
68
|
+
sideOffset: n,
|
|
69
|
+
className: t("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-overlay", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", e),
|
|
70
70
|
...r
|
|
71
71
|
}) }));
|
|
72
72
|
P.displayName = O.Content.displayName;
|
|
73
|
-
var F = d.forwardRef(({ className: e, inset:
|
|
73
|
+
var F = d.forwardRef(({ className: e, inset: n, ...r }, i) => /* @__PURE__ */ v(O.Item, {
|
|
74
74
|
ref: i,
|
|
75
|
-
className:
|
|
75
|
+
className: t("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-hover focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", n && "pl-8", e),
|
|
76
76
|
...r
|
|
77
77
|
}));
|
|
78
78
|
F.displayName = O.Item.displayName;
|
|
79
|
-
var Ee = d.forwardRef(({ className: e, children:
|
|
79
|
+
var Ee = d.forwardRef(({ className: e, children: n, checked: r, ...i }, a) => /* @__PURE__ */ y(O.CheckboxItem, {
|
|
80
80
|
ref: a,
|
|
81
|
-
className:
|
|
81
|
+
className: t("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-hover focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", e),
|
|
82
82
|
checked: r,
|
|
83
83
|
...i,
|
|
84
84
|
children: [/* @__PURE__ */ v("span", {
|
|
85
85
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
86
86
|
children: /* @__PURE__ */ v(O.ItemIndicator, { children: /* @__PURE__ */ v(b, { className: "h-4 w-4" }) })
|
|
87
|
-
}),
|
|
87
|
+
}), n]
|
|
88
88
|
}));
|
|
89
89
|
Ee.displayName = O.CheckboxItem.displayName;
|
|
90
|
-
var De = d.forwardRef(({ className: e, children:
|
|
90
|
+
var De = d.forwardRef(({ className: e, children: n, ...r }, i) => /* @__PURE__ */ y(O.RadioItem, {
|
|
91
91
|
ref: i,
|
|
92
|
-
className:
|
|
92
|
+
className: t("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-hover focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", e),
|
|
93
93
|
...r,
|
|
94
94
|
children: [/* @__PURE__ */ v("span", {
|
|
95
95
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
96
96
|
children: /* @__PURE__ */ v(O.ItemIndicator, { children: /* @__PURE__ */ v(ee, { className: "h-4 w-4 fill-current" }) })
|
|
97
|
-
}),
|
|
97
|
+
}), n]
|
|
98
98
|
}));
|
|
99
99
|
De.displayName = O.RadioItem.displayName;
|
|
100
|
-
var Oe = d.forwardRef(({ className: e, inset:
|
|
100
|
+
var Oe = d.forwardRef(({ className: e, inset: n, ...r }, i) => /* @__PURE__ */ v(O.Label, {
|
|
101
101
|
ref: i,
|
|
102
|
-
className:
|
|
102
|
+
className: t("px-2 py-1.5 text-sm font-semibold", n && "pl-8", e),
|
|
103
103
|
...r
|
|
104
104
|
}));
|
|
105
105
|
Oe.displayName = O.Label.displayName;
|
|
106
|
-
var I = d.forwardRef(({ className: e, ...
|
|
106
|
+
var I = d.forwardRef(({ className: e, ...n }, r) => /* @__PURE__ */ v(O.Separator, {
|
|
107
107
|
ref: r,
|
|
108
|
-
className:
|
|
109
|
-
...
|
|
108
|
+
className: t("-mx-1 my-1 h-px bg-muted", e),
|
|
109
|
+
...n
|
|
110
110
|
}));
|
|
111
111
|
I.displayName = O.Separator.displayName;
|
|
112
|
-
var ke = ({ className: e, ...
|
|
113
|
-
className:
|
|
114
|
-
...
|
|
112
|
+
var ke = ({ className: e, ...n }) => /* @__PURE__ */ v("span", {
|
|
113
|
+
className: t("ml-auto text-xs tracking-widest opacity-60", e),
|
|
114
|
+
...n
|
|
115
115
|
});
|
|
116
116
|
ke.displayName = "DropdownMenuShortcut";
|
|
117
117
|
//#endregion
|
|
@@ -162,7 +162,7 @@ function Re(e) {
|
|
|
162
162
|
}
|
|
163
163
|
function ze(e) {
|
|
164
164
|
if (!e || typeof e != "object") return null;
|
|
165
|
-
let t =
|
|
165
|
+
let t = o(e);
|
|
166
166
|
return t && Object.keys(t).length > 0 ? t : null;
|
|
167
167
|
}
|
|
168
168
|
function Be(e, t) {
|
|
@@ -208,12 +208,12 @@ function We(e, t) {
|
|
|
208
208
|
}
|
|
209
209
|
//#endregion
|
|
210
210
|
//#region src/components/ui/popover.tsx
|
|
211
|
-
var W = k.Root, G = k.Trigger, K = d.forwardRef(({ className: e, align:
|
|
211
|
+
var W = k.Root, G = k.Trigger, K = d.forwardRef(({ className: e, align: n = "center", sideOffset: r = 4, collisionPadding: i = 8, ...a }, o) => /* @__PURE__ */ v(k.Portal, { children: /* @__PURE__ */ v(k.Content, {
|
|
212
212
|
ref: o,
|
|
213
|
-
align:
|
|
213
|
+
align: n,
|
|
214
214
|
sideOffset: r,
|
|
215
215
|
collisionPadding: i,
|
|
216
|
-
className:
|
|
216
|
+
className: t("z-50 max-h-[var(--radix-popover-content-available-height)] w-72 max-w-[calc(100vw-1rem)] overflow-y-auto overflow-x-hidden overscroll-contain rounded-md border bg-popover p-4 text-popover-foreground shadow-overlay outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", e),
|
|
217
217
|
...a
|
|
218
218
|
}) }));
|
|
219
219
|
K.displayName = k.Content.displayName;
|
|
@@ -301,7 +301,7 @@ function Xe(e) {
|
|
|
301
301
|
}
|
|
302
302
|
//#endregion
|
|
303
303
|
//#region src/components/database/DatabaseCard.tsx
|
|
304
|
-
var Ze = ({ data: e, onOpen:
|
|
304
|
+
var Ze = ({ data: e, onOpen: n }) => /* @__PURE__ */ y("div", {
|
|
305
305
|
className: "w-full overflow-hidden",
|
|
306
306
|
children: [e.cover && /* @__PURE__ */ v("div", {
|
|
307
307
|
className: "h-14 w-full",
|
|
@@ -311,9 +311,9 @@ var Ze = ({ data: e, onOpen: t }) => /* @__PURE__ */ y("div", {
|
|
|
311
311
|
className: "flex flex-col gap-2 p-3",
|
|
312
312
|
children: [/* @__PURE__ */ y("button", {
|
|
313
313
|
type: "button",
|
|
314
|
-
onClick:
|
|
315
|
-
disabled: !
|
|
316
|
-
className:
|
|
314
|
+
onClick: n,
|
|
315
|
+
disabled: !n,
|
|
316
|
+
className: t("flex items-center gap-1.5 text-left text-sm font-medium", n && "cursor-pointer hover:underline"),
|
|
317
317
|
children: [e.icon && /* @__PURE__ */ v(A, {
|
|
318
318
|
value: e.icon,
|
|
319
319
|
className: "shrink-0 leading-none"
|
|
@@ -386,27 +386,27 @@ function $e(t, n) {
|
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
388
|
var et = /* @__PURE__ */ new Map();
|
|
389
|
-
function tt(e,
|
|
390
|
-
let
|
|
389
|
+
function tt(e, t) {
|
|
390
|
+
let n = c(), [r, i] = h(() => et.get(e) ?? null);
|
|
391
391
|
return p(() => {
|
|
392
|
-
if (!
|
|
393
|
-
let
|
|
392
|
+
if (!t || r) return;
|
|
393
|
+
let a = !0;
|
|
394
394
|
return (async () => {
|
|
395
|
-
let
|
|
396
|
-
if (!
|
|
397
|
-
let
|
|
398
|
-
for (let e of
|
|
395
|
+
let t = await n.getPage(e);
|
|
396
|
+
if (!t || !a) return;
|
|
397
|
+
let r = t.databaseId ? (await n.getDatabase(t.databaseId))?.schema.properties ?? [] : [], o = Je(e), s = [];
|
|
398
|
+
for (let e of r) {
|
|
399
399
|
if (s.length >= 5) break;
|
|
400
400
|
if (e.id === ie || e.pageHidden) continue;
|
|
401
|
-
let
|
|
402
|
-
|
|
401
|
+
let n = $e(e, t.properties[e.id]);
|
|
402
|
+
n != null && s.push({
|
|
403
403
|
id: e.id,
|
|
404
404
|
label: e.name,
|
|
405
|
-
node:
|
|
405
|
+
node: n
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
let c = {
|
|
409
|
-
title:
|
|
409
|
+
title: t.name?.trim() || "Untitled",
|
|
410
410
|
icon: l(e),
|
|
411
411
|
cover: o?.kind === "gradient" ? { background: o.css } : o?.kind === "image" ? {
|
|
412
412
|
backgroundImage: `url("${o.url}")`,
|
|
@@ -415,16 +415,16 @@ function tt(e, n) {
|
|
|
415
415
|
} : void 0,
|
|
416
416
|
fields: s
|
|
417
417
|
};
|
|
418
|
-
et.set(e, c),
|
|
418
|
+
et.set(e, c), a && i(c);
|
|
419
419
|
})(), () => {
|
|
420
|
-
|
|
420
|
+
a = !1;
|
|
421
421
|
};
|
|
422
422
|
}, [
|
|
423
|
-
|
|
423
|
+
t,
|
|
424
424
|
e,
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
]),
|
|
425
|
+
r,
|
|
426
|
+
n
|
|
427
|
+
]), r;
|
|
428
428
|
}
|
|
429
429
|
var nt = ({ rowId: t, children: n, openDelay: r = 280 }) => {
|
|
430
430
|
let [i, a] = h(!1), o = m(void 0), s = tt(t, i), c = () => {
|
|
@@ -464,7 +464,7 @@ function rt(e, t, n, r) {
|
|
|
464
464
|
return t.type === "expr" ? e.exports[t.cellName ?? t.name] : t.type === "formula" || t.type === "rollup" ? pe(e, t, n, r) : t.type === "created_time" ? e.createdAt : t.type === "last_edited_time" ? e.updatedAt : e.properties[t.id];
|
|
465
465
|
}
|
|
466
466
|
function it() {
|
|
467
|
-
let { preferences: e } =
|
|
467
|
+
let { preferences: e } = a();
|
|
468
468
|
return e.profile.displayName.trim() || e.profile.name.trim() || "You";
|
|
469
469
|
}
|
|
470
470
|
var at = ({ name: e }) => /* @__PURE__ */ y("span", {
|
|
@@ -477,10 +477,10 @@ var at = ({ name: e }) => /* @__PURE__ */ y("span", {
|
|
|
477
477
|
children: e
|
|
478
478
|
})]
|
|
479
479
|
}), ot = ({ value: e }) => {
|
|
480
|
-
let
|
|
480
|
+
let n = ue(e);
|
|
481
481
|
return /* @__PURE__ */ y("span", {
|
|
482
|
-
className:
|
|
483
|
-
children: [/* @__PURE__ */ v(ge, { className:
|
|
482
|
+
className: t("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs", n ? "text-green-700 dark:text-green-300" : "text-muted-foreground"),
|
|
483
|
+
children: [/* @__PURE__ */ v(ge, { className: t("h-3.5 w-3.5", n ? "text-green-600 dark:text-green-400" : "text-muted-foreground/50") }), n ? "Verified" : "Unverified"]
|
|
484
484
|
});
|
|
485
485
|
}, st = {
|
|
486
486
|
gray: "bg-zinc-200 text-zinc-700 dark:bg-zinc-700/60 dark:text-zinc-200",
|
|
@@ -493,7 +493,7 @@ var at = ({ name: e }) => /* @__PURE__ */ y("span", {
|
|
|
493
493
|
pink: "bg-pink-200 text-pink-800 dark:bg-pink-900/40 dark:text-pink-200",
|
|
494
494
|
red: "bg-red-200 text-red-800 dark:bg-red-900/40 dark:text-red-200"
|
|
495
495
|
}, ct = (e) => st[e ?? "gray"] ?? st.gray, lt = (e, t) => e.options?.find((e) => e.id === t), J = ({ option: e }) => /* @__PURE__ */ v("span", {
|
|
496
|
-
className:
|
|
496
|
+
className: t("inline-flex max-w-full items-center truncate rounded px-1.5 py-0.5 text-xs", ct(e.color)),
|
|
497
497
|
children: e.label
|
|
498
498
|
});
|
|
499
499
|
function ut(e) {
|
|
@@ -581,7 +581,7 @@ function _t(e) {
|
|
|
581
581
|
}
|
|
582
582
|
return (i !== "" || r.length > 0) && (r.push(i), n.push(r)), n.filter((e) => e.some((e) => e !== ""));
|
|
583
583
|
}
|
|
584
|
-
var X = "w-full bg-transparent px-2 py-1 text-sm outline-hidden placeholder:text-muted-foreground/40 placeholder:opacity-0 placeholder:transition-opacity group-hover:placeholder:opacity-100 focus:placeholder:opacity-100 focus:bg-hover", Z = "text-muted-foreground/40 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100", vt = ({ property: e, value:
|
|
584
|
+
var X = "w-full bg-transparent px-2 py-1 text-sm outline-hidden placeholder:text-muted-foreground/40 placeholder:opacity-0 placeholder:transition-opacity group-hover:placeholder:opacity-100 focus:placeholder:opacity-100 focus:bg-hover", Z = "text-muted-foreground/40 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100", vt = ({ property: e, value: n, exprValue: r, onChange: i, onAddOption: a, rowOptions: o }) => {
|
|
585
585
|
switch (e.type) {
|
|
586
586
|
case "expr": return /* @__PURE__ */ v("div", {
|
|
587
587
|
className: "px-2 py-1 text-sm tabular-nums text-foreground/80",
|
|
@@ -589,14 +589,14 @@ var X = "w-full bg-transparent px-2 py-1 text-sm outline-hidden placeholder:text
|
|
|
589
589
|
children: mt(r, e.numberFormat)
|
|
590
590
|
});
|
|
591
591
|
case "formula": return /* @__PURE__ */ v("div", {
|
|
592
|
-
className:
|
|
593
|
-
title:
|
|
594
|
-
children: pt(
|
|
592
|
+
className: t("px-2 py-1 text-sm tabular-nums", n instanceof C ? "text-destructive" : "text-foreground/80"),
|
|
593
|
+
title: n instanceof C ? n.message : "Computed from other properties",
|
|
594
|
+
children: pt(n, e.numberFormat)
|
|
595
595
|
});
|
|
596
596
|
case "rollup": return /* @__PURE__ */ v("div", {
|
|
597
597
|
className: "px-2 py-1 text-sm tabular-nums text-foreground/80",
|
|
598
598
|
title: "Rolled up from related rows",
|
|
599
|
-
children: ft(e,
|
|
599
|
+
children: ft(e, n) || /* @__PURE__ */ v("span", {
|
|
600
600
|
className: "text-muted-foreground/40",
|
|
601
601
|
children: "—"
|
|
602
602
|
})
|
|
@@ -605,7 +605,7 @@ var X = "w-full bg-transparent px-2 py-1 text-sm outline-hidden placeholder:text
|
|
|
605
605
|
className: "flex items-center px-2 py-1",
|
|
606
606
|
children: /* @__PURE__ */ v("input", {
|
|
607
607
|
type: "checkbox",
|
|
608
|
-
checked:
|
|
608
|
+
checked: n === !0,
|
|
609
609
|
onChange: (e) => i(e.target.checked),
|
|
610
610
|
className: "h-4 w-4 cursor-pointer accent-primary",
|
|
611
611
|
"aria-label": e.name
|
|
@@ -613,85 +613,85 @@ var X = "w-full bg-transparent px-2 py-1 text-sm outline-hidden placeholder:text
|
|
|
613
613
|
});
|
|
614
614
|
case "number": return /* @__PURE__ */ v(xt, {
|
|
615
615
|
property: e,
|
|
616
|
-
value:
|
|
616
|
+
value: n,
|
|
617
617
|
onChange: i
|
|
618
618
|
});
|
|
619
619
|
case "rating": return /* @__PURE__ */ v(St, {
|
|
620
620
|
property: e,
|
|
621
|
-
value:
|
|
621
|
+
value: n,
|
|
622
622
|
onChange: i
|
|
623
623
|
});
|
|
624
624
|
case "date": return /* @__PURE__ */ v(Tt, {
|
|
625
625
|
property: e,
|
|
626
|
-
value:
|
|
626
|
+
value: n,
|
|
627
627
|
onChange: i
|
|
628
628
|
});
|
|
629
629
|
case "select": return /* @__PURE__ */ v(Nt, {
|
|
630
630
|
property: e,
|
|
631
|
-
value:
|
|
631
|
+
value: n,
|
|
632
632
|
onChange: i,
|
|
633
633
|
onAddOption: a
|
|
634
634
|
});
|
|
635
635
|
case "status": return /* @__PURE__ */ v(Pt, {
|
|
636
636
|
property: e,
|
|
637
|
-
value:
|
|
637
|
+
value: n,
|
|
638
638
|
onChange: i
|
|
639
639
|
});
|
|
640
640
|
case "multi_select": return /* @__PURE__ */ v(jt, {
|
|
641
641
|
property: e,
|
|
642
|
-
value:
|
|
642
|
+
value: n,
|
|
643
643
|
onChange: i,
|
|
644
644
|
onAddOption: a
|
|
645
645
|
});
|
|
646
646
|
case "relation": return /* @__PURE__ */ v(Mt, {
|
|
647
647
|
property: e,
|
|
648
|
-
value:
|
|
648
|
+
value: n,
|
|
649
649
|
onChange: i
|
|
650
650
|
});
|
|
651
651
|
case "dependency": return /* @__PURE__ */ v(Et, {
|
|
652
|
-
value:
|
|
652
|
+
value: n,
|
|
653
653
|
onChange: i,
|
|
654
654
|
rowOptions: o ?? []
|
|
655
655
|
});
|
|
656
656
|
case "files": return /* @__PURE__ */ v(Ot, {
|
|
657
|
-
value:
|
|
657
|
+
value: n,
|
|
658
658
|
onChange: i
|
|
659
659
|
});
|
|
660
660
|
case "url":
|
|
661
661
|
case "email":
|
|
662
662
|
case "phone": return /* @__PURE__ */ v(kt, {
|
|
663
663
|
kind: e.type,
|
|
664
|
-
value:
|
|
664
|
+
value: n,
|
|
665
665
|
onChange: i
|
|
666
666
|
});
|
|
667
667
|
case "location": return /* @__PURE__ */ v(At, {
|
|
668
|
-
value:
|
|
668
|
+
value: n,
|
|
669
669
|
onChange: i
|
|
670
670
|
});
|
|
671
671
|
case "created_time":
|
|
672
672
|
case "last_edited_time": return /* @__PURE__ */ v("div", {
|
|
673
673
|
className: "px-2 py-1 text-sm text-muted-foreground/80",
|
|
674
674
|
title: "Set automatically",
|
|
675
|
-
children: Y(e,
|
|
675
|
+
children: Y(e, n)
|
|
676
676
|
});
|
|
677
677
|
case "unique_id": return /* @__PURE__ */ v("div", {
|
|
678
678
|
className: "px-2 py-1 font-mono text-xs text-muted-foreground/80 tabular-nums",
|
|
679
679
|
title: "Assigned automatically",
|
|
680
|
-
children: ce(
|
|
680
|
+
children: ce(n, e.idPrefix) || /* @__PURE__ */ v("span", {
|
|
681
681
|
className: "text-muted-foreground/40",
|
|
682
682
|
children: "—"
|
|
683
683
|
})
|
|
684
684
|
});
|
|
685
685
|
case "person": return /* @__PURE__ */ v("input", {
|
|
686
686
|
type: "text",
|
|
687
|
-
defaultValue: typeof
|
|
687
|
+
defaultValue: typeof n == "string" ? n : n == null ? "" : String(n),
|
|
688
688
|
onBlur: (e) => i(e.target.value.trim() || null),
|
|
689
689
|
className: X,
|
|
690
690
|
placeholder: "Add a person…",
|
|
691
691
|
"aria-label": e.name
|
|
692
692
|
});
|
|
693
693
|
case "verification": return /* @__PURE__ */ v(Ct, {
|
|
694
|
-
value:
|
|
694
|
+
value: n,
|
|
695
695
|
onChange: i
|
|
696
696
|
});
|
|
697
697
|
case "backlinks": return /* @__PURE__ */ v("div", {
|
|
@@ -700,7 +700,7 @@ var X = "w-full bg-transparent px-2 py-1 text-sm outline-hidden placeholder:text
|
|
|
700
700
|
});
|
|
701
701
|
default: return /* @__PURE__ */ v("input", {
|
|
702
702
|
type: "text",
|
|
703
|
-
defaultValue: typeof
|
|
703
|
+
defaultValue: typeof n == "string" ? n : n == null ? "" : String(n),
|
|
704
704
|
onBlur: (e) => i(e.target.value),
|
|
705
705
|
className: X,
|
|
706
706
|
placeholder: "Empty"
|
|
@@ -740,17 +740,17 @@ var X = "w-full bg-transparent px-2 py-1 text-sm outline-hidden placeholder:text
|
|
|
740
740
|
strokeDashoffset: t * (1 - e)
|
|
741
741
|
})]
|
|
742
742
|
});
|
|
743
|
-
}, xt = ({ property: e, value:
|
|
743
|
+
}, xt = ({ property: e, value: n, onChange: r }) => {
|
|
744
744
|
let i = /* @__PURE__ */ v("input", {
|
|
745
745
|
type: "number",
|
|
746
|
-
defaultValue:
|
|
746
|
+
defaultValue: n == null ? "" : String(n),
|
|
747
747
|
onBlur: (e) => r(e.target.value === "" ? null : Number(e.target.value)),
|
|
748
|
-
className:
|
|
748
|
+
className: t(X, "tabular-nums", e.numberDisplay === "bar" && "w-14 flex-none", e.numberDisplay === "ring" && "flex-1"),
|
|
749
749
|
placeholder: "—",
|
|
750
750
|
"aria-label": e.name
|
|
751
751
|
});
|
|
752
752
|
if (e.numberDisplay !== "bar" && e.numberDisplay !== "ring") return i;
|
|
753
|
-
let a = fe(
|
|
753
|
+
let a = fe(n, e.numberTarget);
|
|
754
754
|
return /* @__PURE__ */ y("div", {
|
|
755
755
|
className: "flex items-center gap-2 pr-2",
|
|
756
756
|
"data-number-display": e.numberDisplay,
|
|
@@ -763,8 +763,8 @@ var X = "w-full bg-transparent px-2 py-1 text-sm outline-hidden placeholder:text
|
|
|
763
763
|
e.numberDisplay === "bar" && /* @__PURE__ */ v(yt, { frac: a })
|
|
764
764
|
]
|
|
765
765
|
});
|
|
766
|
-
}, St = ({ property: e, value:
|
|
767
|
-
let i = e.numberTarget && e.numberTarget > 0 ? Math.min(10, Math.round(e.numberTarget)) : 5, a = typeof
|
|
766
|
+
}, St = ({ property: e, value: n, onChange: r }) => {
|
|
767
|
+
let i = e.numberTarget && e.numberTarget > 0 ? Math.min(10, Math.round(e.numberTarget)) : 5, a = typeof n == "number" ? n : typeof n == "string" && n.trim() !== "" ? Number(n) : 0;
|
|
768
768
|
return /* @__PURE__ */ v("div", {
|
|
769
769
|
className: "flex items-center gap-0.5 px-2 py-1",
|
|
770
770
|
role: "group",
|
|
@@ -772,7 +772,7 @@ var X = "w-full bg-transparent px-2 py-1 text-sm outline-hidden placeholder:text
|
|
|
772
772
|
children: Array.from({ length: i }, (e, t) => t + 1).map((e) => /* @__PURE__ */ v("button", {
|
|
773
773
|
type: "button",
|
|
774
774
|
onClick: () => r(a === e ? null : e),
|
|
775
|
-
className:
|
|
775
|
+
className: t("text-base leading-none transition-colors", e <= a ? "text-amber-400" : "text-muted-foreground/30 hover:text-amber-400/60"),
|
|
776
776
|
"aria-label": `${e} ${e === 1 ? "star" : "stars"}`,
|
|
777
777
|
"aria-pressed": e <= a,
|
|
778
778
|
children: "★"
|
|
@@ -793,15 +793,15 @@ var X = "w-full bg-transparent px-2 py-1 text-sm outline-hidden placeholder:text
|
|
|
793
793
|
url: (e) => /^https?:\/\//i.test(e) ? e : `https://${e}`,
|
|
794
794
|
email: (e) => `mailto:${e}`,
|
|
795
795
|
phone: (e) => `tel:${e}`
|
|
796
|
-
}, Tt = ({ property: e, value:
|
|
797
|
-
let i = e.includeTime ? "datetime-local" : "date", [a, o] = h(!1), s = se(
|
|
796
|
+
}, Tt = ({ property: e, value: n, onChange: r }) => {
|
|
797
|
+
let i = e.includeTime ? "datetime-local" : "date", [a, o] = h(!1), s = se(n), c = oe(n);
|
|
798
798
|
if ((s ?? c) && !a) {
|
|
799
|
-
let
|
|
799
|
+
let t = Y(e, n);
|
|
800
800
|
return /* @__PURE__ */ v("button", {
|
|
801
801
|
onClick: () => o(!0),
|
|
802
802
|
className: "flex w-full items-center px-2 py-1 text-left text-sm outline-hidden hover:bg-hover",
|
|
803
803
|
"aria-label": e.name,
|
|
804
|
-
children:
|
|
804
|
+
children: t || /* @__PURE__ */ v("span", {
|
|
805
805
|
className: Z,
|
|
806
806
|
children: "Empty"
|
|
807
807
|
})
|
|
@@ -816,7 +816,7 @@ var X = "w-full bg-transparent px-2 py-1 text-sm outline-hidden placeholder:text
|
|
|
816
816
|
onFocus: l,
|
|
817
817
|
onChange: (e) => r(e.target.value || null),
|
|
818
818
|
onBlur: u,
|
|
819
|
-
className:
|
|
819
|
+
className: t(X, "ob-date-empty"),
|
|
820
820
|
"aria-label": e.name
|
|
821
821
|
});
|
|
822
822
|
let d = (e) => r(e.start || e.end ? e : null);
|
|
@@ -838,7 +838,7 @@ var X = "w-full bg-transparent px-2 py-1 text-sm outline-hidden placeholder:text
|
|
|
838
838
|
"aria-label": `${e.name} start`
|
|
839
839
|
}),
|
|
840
840
|
/* @__PURE__ */ v("span", {
|
|
841
|
-
className:
|
|
841
|
+
className: t("text-muted-foreground/50", !s && !c && "opacity-0 transition-opacity group-hover:opacity-100 group-focus-within/dates:opacity-100"),
|
|
842
842
|
children: "→"
|
|
843
843
|
}),
|
|
844
844
|
/* @__PURE__ */ v("input", {
|
|
@@ -1145,10 +1145,10 @@ var X = "w-full bg-transparent px-2 py-1 text-sm outline-hidden placeholder:text
|
|
|
1145
1145
|
})]
|
|
1146
1146
|
})] })]
|
|
1147
1147
|
})] });
|
|
1148
|
-
}, Mt = ({ property:
|
|
1149
|
-
let
|
|
1150
|
-
f.useEffect(() =>
|
|
1151
|
-
if (!b || p !== null || !u &&
|
|
1148
|
+
}, Mt = ({ property: t, value: r, onChange: a }) => {
|
|
1149
|
+
let o = Array.isArray(r) ? r : [], [s, l] = h(""), [u, d] = h(!1), [p, m] = h(null), g = c(), { setPageHint: _ } = i(), b = t.relationDatabaseId, x = !!t.relationSingle, [, ee] = f.useReducer((e) => e + 1, 0);
|
|
1150
|
+
f.useEffect(() => n(ee), []), f.useEffect(() => {
|
|
1151
|
+
if (!b || p !== null || !u && o.length === 0) return;
|
|
1152
1152
|
let t = !0;
|
|
1153
1153
|
return g.listRows(b).then((n) => {
|
|
1154
1154
|
if (!t) return;
|
|
@@ -1164,17 +1164,17 @@ var X = "w-full bg-transparent px-2 py-1 text-sm outline-hidden placeholder:text
|
|
|
1164
1164
|
}, [
|
|
1165
1165
|
u,
|
|
1166
1166
|
b,
|
|
1167
|
-
|
|
1167
|
+
o.length,
|
|
1168
1168
|
p,
|
|
1169
1169
|
g,
|
|
1170
1170
|
_
|
|
1171
1171
|
]);
|
|
1172
|
-
let te = (t) => p?.find((e) => e.id === t)?.label ?? e.label(t), ne =
|
|
1173
|
-
|
|
1174
|
-
}, re = (e) => o
|
|
1172
|
+
let te = (t) => p?.find((e) => e.id === t)?.label ?? e.label(t), ne = s.trim().toLowerCase(), S = b ? (p ?? []).filter((e) => !o.includes(e.id) && (!ne || e.label.toLowerCase().includes(ne))) : e.searchPages(s).filter((e) => !o.includes(e.id)), C = (e) => {
|
|
1173
|
+
a(x ? [e] : [...o, e]), l(""), x && d(!1);
|
|
1174
|
+
}, re = (e) => a(o.filter((t) => t !== e)), w = b ? "row" : "page";
|
|
1175
1175
|
return /* @__PURE__ */ y("div", {
|
|
1176
1176
|
className: "flex min-h-[28px] flex-wrap items-center gap-1 px-2 py-1",
|
|
1177
|
-
children: [
|
|
1177
|
+
children: [o.map((t) => /* @__PURE__ */ y("span", {
|
|
1178
1178
|
className: "inline-flex max-w-full items-center gap-1 rounded-md border border-border/60 px-1.5 py-0.5 text-xs",
|
|
1179
1179
|
children: [/* @__PURE__ */ v(nt, {
|
|
1180
1180
|
rowId: t,
|
|
@@ -1195,7 +1195,7 @@ var X = "w-full bg-transparent px-2 py-1 text-sm outline-hidden placeholder:text
|
|
|
1195
1195
|
"aria-label": "Remove link",
|
|
1196
1196
|
children: /* @__PURE__ */ v(D, { className: "h-3 w-3" })
|
|
1197
1197
|
})]
|
|
1198
|
-
}, t)), (!x ||
|
|
1198
|
+
}, t)), (!x || o.length === 0) && /* @__PURE__ */ y(W, {
|
|
1199
1199
|
open: u,
|
|
1200
1200
|
onOpenChange: d,
|
|
1201
1201
|
children: [/* @__PURE__ */ v(G, {
|
|
@@ -1211,7 +1211,7 @@ var X = "w-full bg-transparent px-2 py-1 text-sm outline-hidden placeholder:text
|
|
|
1211
1211
|
className: "w-60 p-1",
|
|
1212
1212
|
children: [/* @__PURE__ */ v("input", {
|
|
1213
1213
|
autoFocus: !0,
|
|
1214
|
-
value:
|
|
1214
|
+
value: s,
|
|
1215
1215
|
onChange: (e) => l(e.target.value),
|
|
1216
1216
|
placeholder: `Link a ${w}…`,
|
|
1217
1217
|
className: "mb-1 w-full rounded bg-accent/40 px-1.5 py-1 text-sm outline-hidden"
|