@book.dev/ui 1.64.0 → 1.65.1
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-THzuvC4K.js → EmojiGrid-BjFEmkhL.js} +1 -1
- package/dist/blockeditor/kit/groupSync.d.ts +10 -1
- package/dist/{format-D9FO3jG9.js → format-BXeG5xQH.js} +121 -121
- package/dist/index.js +3951 -3942
- package/dist/{lucideIcons-Dv5yzk2L.js → lucideIcons-DvomlmkS.js} +523 -510
- package/dist/providers/PreferencesProvider.d.ts +8 -1
- package/dist/providers/WorkspaceProvider.d.ts +4 -2
- package/dist/{toHtml-DeWpCU0o.js → toHtml-B6gQeUnu.js} +2 -2
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Nt as e, U as t, i as n, n as r, t as i } from "./lucideIcons-DvomlmkS.js";
|
|
2
2
|
import { t as a } from "./emoji-Bmft6RPl.js";
|
|
3
3
|
import { useMemo as o, useRef as s, useState as c } from "react";
|
|
4
4
|
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
@@ -18,6 +18,15 @@ export declare const readGroupSync: (key: string) => Values;
|
|
|
18
18
|
*/
|
|
19
19
|
export declare function writeGroupSync(key: string, values: Values): boolean;
|
|
20
20
|
export declare function subscribeGroupSync(key: string, cb: () => void): () => void;
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Loose deep equality for the small value shapes inputs publish: scalars,
|
|
23
|
+
* arrays, and plain objects (e.g. the `location` input's `{lat,lng,label}`).
|
|
24
|
+
*
|
|
25
|
+
* Object-valued inputs MUST compare structurally, not by reference. A render
|
|
26
|
+
* recomputes `inputValue` into a fresh object each time, so a reference compare
|
|
27
|
+
* always reports "changed" — which makes the GroupView publish effect re-write
|
|
28
|
+
* the store and `notify()` every synced pane on every edit (a latent publish↔
|
|
29
|
+
* adopt ping-pong once any object-valued input gains a real `setInputValue`).
|
|
30
|
+
*/
|
|
22
31
|
export declare function valueEqual(a: unknown, b: unknown): boolean;
|
|
23
32
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { At as e, B as t, Nt as n, V as r, a as i, g as a, p as o, r as s, tt as c } from "./lucideIcons-DvomlmkS.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: t = "📄", className: r }) {
|
|
16
|
+
if (e && i(e)) {
|
|
17
|
+
let i = s(e);
|
|
18
|
+
return i ? /* @__PURE__ */ v(i, {
|
|
19
19
|
"aria-hidden": !0,
|
|
20
|
-
className:
|
|
20
|
+
className: n("inline-block shrink-0 align-[-0.125em]", r),
|
|
21
21
|
style: {
|
|
22
22
|
width: "1em",
|
|
23
23
|
height: "1em"
|
|
24
24
|
}
|
|
25
|
-
}) :
|
|
26
|
-
className:
|
|
27
|
-
children:
|
|
25
|
+
}) : t ? /* @__PURE__ */ v("span", {
|
|
26
|
+
className: r,
|
|
27
|
+
children: t
|
|
28
28
|
}) : null;
|
|
29
29
|
}
|
|
30
|
-
let a = e ||
|
|
30
|
+
let a = e || t;
|
|
31
31
|
return a ? /* @__PURE__ */ v("span", {
|
|
32
|
-
className:
|
|
32
|
+
className: r,
|
|
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: t, 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: n(xe({ size: t }), 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: t, children: r, ...i }, a) => /* @__PURE__ */ y(O.SubTrigger, {
|
|
54
54
|
ref: a,
|
|
55
|
-
className:
|
|
55
|
+
className: n("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", t && "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, ...t }, r) => /* @__PURE__ */ v(O.SubContent, {
|
|
61
61
|
ref: r,
|
|
62
|
-
className:
|
|
63
|
-
...
|
|
62
|
+
className: n("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
|
+
...t
|
|
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: t = 4, ...r }, i) => /* @__PURE__ */ v(O.Portal, { children: /* @__PURE__ */ v(O.Content, {
|
|
67
67
|
ref: i,
|
|
68
|
-
sideOffset:
|
|
69
|
-
className:
|
|
68
|
+
sideOffset: t,
|
|
69
|
+
className: n("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: t, ...r }, i) => /* @__PURE__ */ v(O.Item, {
|
|
74
74
|
ref: i,
|
|
75
|
-
className:
|
|
75
|
+
className: n("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", t && "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: t, checked: r, ...i }, a) => /* @__PURE__ */ y(O.CheckboxItem, {
|
|
80
80
|
ref: a,
|
|
81
|
-
className:
|
|
81
|
+
className: n("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
|
+
}), t]
|
|
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: t, ...r }, i) => /* @__PURE__ */ y(O.RadioItem, {
|
|
91
91
|
ref: i,
|
|
92
|
-
className:
|
|
92
|
+
className: n("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
|
+
}), t]
|
|
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: t, ...r }, i) => /* @__PURE__ */ v(O.Label, {
|
|
101
101
|
ref: i,
|
|
102
|
-
className:
|
|
102
|
+
className: n("px-2 py-1.5 text-sm font-semibold", t && "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, ...t }, r) => /* @__PURE__ */ v(O.Separator, {
|
|
107
107
|
ref: r,
|
|
108
|
-
className:
|
|
109
|
-
...
|
|
108
|
+
className: n("-mx-1 my-1 h-px bg-muted", e),
|
|
109
|
+
...t
|
|
110
110
|
}));
|
|
111
111
|
I.displayName = O.Separator.displayName;
|
|
112
|
-
var ke = ({ className: e, ...
|
|
113
|
-
className:
|
|
114
|
-
...
|
|
112
|
+
var ke = ({ className: e, ...t }) => /* @__PURE__ */ v("span", {
|
|
113
|
+
className: n("ml-auto text-xs tracking-widest opacity-60", e),
|
|
114
|
+
...t
|
|
115
115
|
});
|
|
116
116
|
ke.displayName = "DropdownMenuShortcut";
|
|
117
117
|
//#endregion
|
|
@@ -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: t = "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: t,
|
|
214
214
|
sideOffset: r,
|
|
215
215
|
collisionPadding: i,
|
|
216
|
-
className:
|
|
216
|
+
className: n("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: t }) => /* @__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: n }) => /* @__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: t,
|
|
315
|
+
disabled: !t,
|
|
316
|
+
className: n("flex items-center gap-1.5 text-left text-sm font-medium", t && "cursor-pointer hover:underline"),
|
|
317
317
|
children: [e.icon && /* @__PURE__ */ v(A, {
|
|
318
318
|
value: e.icon,
|
|
319
319
|
className: "shrink-0 leading-none"
|
|
@@ -348,19 +348,19 @@ var Ze = ({ data: e, onOpen: n }) => /* @__PURE__ */ y("div", {
|
|
|
348
348
|
children: e
|
|
349
349
|
})]
|
|
350
350
|
});
|
|
351
|
-
function $e(
|
|
351
|
+
function $e(e, n) {
|
|
352
352
|
if (n == null || n === "" || Array.isArray(n) && n.length === 0) return null;
|
|
353
|
-
switch (
|
|
353
|
+
switch (e.type) {
|
|
354
354
|
case "select":
|
|
355
355
|
case "status": {
|
|
356
|
-
let
|
|
357
|
-
return
|
|
358
|
-
label:
|
|
359
|
-
color:
|
|
356
|
+
let t = e.options?.find((e) => e.id === n);
|
|
357
|
+
return t ? /* @__PURE__ */ v(Qe, {
|
|
358
|
+
label: t.label,
|
|
359
|
+
color: t.color
|
|
360
360
|
}) : null;
|
|
361
361
|
}
|
|
362
362
|
case "multi_select": {
|
|
363
|
-
let
|
|
363
|
+
let t = Array.isArray(n) ? n : [], r = (e.options ?? []).filter((e) => t.includes(e.id));
|
|
364
364
|
return r.length ? /* @__PURE__ */ v("span", {
|
|
365
365
|
className: "truncate",
|
|
366
366
|
children: r.map((e) => e.label).join(", ")
|
|
@@ -368,10 +368,10 @@ function $e(t, n) {
|
|
|
368
368
|
}
|
|
369
369
|
case "relation":
|
|
370
370
|
case "dependency": {
|
|
371
|
-
let
|
|
372
|
-
return
|
|
371
|
+
let e = Array.isArray(n) ? n : [];
|
|
372
|
+
return e.length ? /* @__PURE__ */ v("span", {
|
|
373
373
|
className: "truncate",
|
|
374
|
-
children:
|
|
374
|
+
children: e.map((e) => t.label(e)).join(", ")
|
|
375
375
|
}) : null;
|
|
376
376
|
}
|
|
377
377
|
case "checkbox": return n === !0 ? "✓" : null;
|
|
@@ -426,8 +426,8 @@ function tt(e, t) {
|
|
|
426
426
|
n
|
|
427
427
|
]), r;
|
|
428
428
|
}
|
|
429
|
-
var nt = ({ rowId:
|
|
430
|
-
let [i, a] = h(!1), o = m(void 0), s = tt(
|
|
429
|
+
var nt = ({ rowId: e, children: n, openDelay: r = 280 }) => {
|
|
430
|
+
let [i, a] = h(!1), o = m(void 0), s = tt(e, i), c = () => {
|
|
431
431
|
clearTimeout(o.current), o.current = setTimeout(() => a(!0), r);
|
|
432
432
|
}, l = () => {
|
|
433
433
|
clearTimeout(o.current), o.current = setTimeout(() => a(!1), 140);
|
|
@@ -450,7 +450,7 @@ var nt = ({ rowId: t, children: n, openDelay: r = 280 }) => {
|
|
|
450
450
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
451
451
|
children: s ? /* @__PURE__ */ v(Ze, {
|
|
452
452
|
data: s,
|
|
453
|
-
onOpen: () =>
|
|
453
|
+
onOpen: () => t.openPage(e)
|
|
454
454
|
}) : /* @__PURE__ */ v("div", {
|
|
455
455
|
className: "p-3 text-xs text-muted-foreground",
|
|
456
456
|
children: "Loading…"
|
|
@@ -464,8 +464,8 @@ 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:
|
|
468
|
-
return
|
|
467
|
+
let { preferences: t } = e();
|
|
468
|
+
return t.profile.displayName.trim() || t.profile.name.trim() || "You";
|
|
469
469
|
}
|
|
470
470
|
var at = ({ name: e }) => /* @__PURE__ */ y("span", {
|
|
471
471
|
className: "inline-flex max-w-full items-center gap-1 truncate rounded-full bg-muted px-2 py-0.5 text-xs",
|
|
@@ -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 t = ue(e);
|
|
481
481
|
return /* @__PURE__ */ y("span", {
|
|
482
|
-
className:
|
|
483
|
-
children: [/* @__PURE__ */ v(ge, { className:
|
|
482
|
+
className: n("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs", t ? "text-green-700 dark:text-green-300" : "text-muted-foreground"),
|
|
483
|
+
children: [/* @__PURE__ */ v(ge, { className: n("h-3.5 w-3.5", t ? "text-green-600 dark:text-green-400" : "text-muted-foreground/50") }), t ? "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: n("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) {
|
|
@@ -561,9 +561,9 @@ function mt(e, t) {
|
|
|
561
561
|
return String(e);
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
|
-
function ht(
|
|
565
|
-
let a = rt(
|
|
566
|
-
return n.type === "relation" ? (Array.isArray(a) ? a : []).map((
|
|
564
|
+
function ht(e, n, r, i) {
|
|
565
|
+
let a = rt(e, n, r, i);
|
|
566
|
+
return n.type === "relation" ? (Array.isArray(a) ? a : []).map((e) => t.label(e)).join("; ") : n.type === "dependency" ? (Array.isArray(a) ? a : []).map((e) => i.find((t) => t.id === e)?.name?.trim() || "Untitled").join("; ") : n.type === "files" ? (Array.isArray(a) ? a : []).join("; ") : Y(n, a);
|
|
567
567
|
}
|
|
568
568
|
function gt(e, t, n) {
|
|
569
569
|
let r = (e) => /[",\n]/.test(e) ? `"${e.replace(/"/g, "\"\"")}"` : e, i = [["Name", ...t.map((e) => e.name)].map(r).join(",")];
|
|
@@ -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: t, 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: n("px-2 py-1 text-sm tabular-nums", t instanceof C ? "text-destructive" : "text-foreground/80"),
|
|
593
|
+
title: t instanceof C ? t.message : "Computed from other properties",
|
|
594
|
+
children: pt(t, 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, t) || /* @__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: t === !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: t,
|
|
617
617
|
onChange: i
|
|
618
618
|
});
|
|
619
619
|
case "rating": return /* @__PURE__ */ v(St, {
|
|
620
620
|
property: e,
|
|
621
|
-
value:
|
|
621
|
+
value: t,
|
|
622
622
|
onChange: i
|
|
623
623
|
});
|
|
624
624
|
case "date": return /* @__PURE__ */ v(Tt, {
|
|
625
625
|
property: e,
|
|
626
|
-
value:
|
|
626
|
+
value: t,
|
|
627
627
|
onChange: i
|
|
628
628
|
});
|
|
629
629
|
case "select": return /* @__PURE__ */ v(Nt, {
|
|
630
630
|
property: e,
|
|
631
|
-
value:
|
|
631
|
+
value: t,
|
|
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: t,
|
|
638
638
|
onChange: i
|
|
639
639
|
});
|
|
640
640
|
case "multi_select": return /* @__PURE__ */ v(jt, {
|
|
641
641
|
property: e,
|
|
642
|
-
value:
|
|
642
|
+
value: t,
|
|
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: t,
|
|
649
649
|
onChange: i
|
|
650
650
|
});
|
|
651
651
|
case "dependency": return /* @__PURE__ */ v(Et, {
|
|
652
|
-
value:
|
|
652
|
+
value: t,
|
|
653
653
|
onChange: i,
|
|
654
654
|
rowOptions: o ?? []
|
|
655
655
|
});
|
|
656
656
|
case "files": return /* @__PURE__ */ v(Ot, {
|
|
657
|
-
value:
|
|
657
|
+
value: t,
|
|
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: t,
|
|
665
665
|
onChange: i
|
|
666
666
|
});
|
|
667
667
|
case "location": return /* @__PURE__ */ v(At, {
|
|
668
|
-
value:
|
|
668
|
+
value: t,
|
|
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, t)
|
|
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(t, 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 t == "string" ? t : t == null ? "" : String(t),
|
|
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: t,
|
|
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 t == "string" ? t : t == null ? "" : String(t),
|
|
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: t, onChange: r }) => {
|
|
744
744
|
let i = /* @__PURE__ */ v("input", {
|
|
745
745
|
type: "number",
|
|
746
|
-
defaultValue:
|
|
746
|
+
defaultValue: t == null ? "" : String(t),
|
|
747
747
|
onBlur: (e) => r(e.target.value === "" ? null : Number(e.target.value)),
|
|
748
|
-
className:
|
|
748
|
+
className: n(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(t, 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: t, onChange: r }) => {
|
|
767
|
+
let i = e.numberTarget && e.numberTarget > 0 ? Math.min(10, Math.round(e.numberTarget)) : 5, a = typeof t == "number" ? t : typeof t == "string" && t.trim() !== "" ? Number(t) : 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: n("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: t, onChange: r }) => {
|
|
797
|
+
let i = e.includeTime ? "datetime-local" : "date", [a, o] = h(!1), s = se(t), c = oe(t);
|
|
798
798
|
if ((s ?? c) && !a) {
|
|
799
|
-
let
|
|
799
|
+
let n = Y(e, t);
|
|
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: n || /* @__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: n(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: n("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,21 +1145,21 @@ 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 o = Array.isArray(
|
|
1150
|
-
f.useEffect(() =>
|
|
1148
|
+
}, Mt = ({ property: e, value: n, onChange: i }) => {
|
|
1149
|
+
let o = Array.isArray(n) ? n : [], [s, l] = h(""), [u, d] = h(!1), [p, m] = h(null), g = c(), { setPageHint: _ } = a(), b = e.relationDatabaseId, x = !!e.relationSingle, [, ee] = f.useReducer((e) => e + 1, 0);
|
|
1150
|
+
f.useEffect(() => r(ee), []), f.useEffect(() => {
|
|
1151
1151
|
if (!b || p !== null || !u && o.length === 0) return;
|
|
1152
|
-
let
|
|
1152
|
+
let e = !0;
|
|
1153
1153
|
return g.listRows(b).then((n) => {
|
|
1154
|
-
if (!
|
|
1155
|
-
let r = n.map((
|
|
1156
|
-
id:
|
|
1157
|
-
label:
|
|
1158
|
-
icon:
|
|
1154
|
+
if (!e) return;
|
|
1155
|
+
let r = n.map((e) => ({
|
|
1156
|
+
id: e.id,
|
|
1157
|
+
label: e.name?.trim() || t.label(e.id),
|
|
1158
|
+
icon: t.icon(e.id)
|
|
1159
1159
|
}));
|
|
1160
1160
|
m(r), r.forEach((e) => _(e.id, e.label));
|
|
1161
|
-
}).catch(() =>
|
|
1162
|
-
|
|
1161
|
+
}).catch(() => e && m([])), () => {
|
|
1162
|
+
e = !1;
|
|
1163
1163
|
};
|
|
1164
1164
|
}, [
|
|
1165
1165
|
u,
|
|
@@ -1169,33 +1169,33 @@ var X = "w-full bg-transparent px-2 py-1 text-sm outline-hidden placeholder:text
|
|
|
1169
1169
|
g,
|
|
1170
1170
|
_
|
|
1171
1171
|
]);
|
|
1172
|
-
let te = (
|
|
1173
|
-
|
|
1174
|
-
}, re = (e) =>
|
|
1172
|
+
let te = (e) => p?.find((t) => t.id === e)?.label ?? t.label(e), ne = s.trim().toLowerCase(), S = b ? (p ?? []).filter((e) => !o.includes(e.id) && (!ne || e.label.toLowerCase().includes(ne))) : t.searchPages(s).filter((e) => !o.includes(e.id)), C = (e) => {
|
|
1173
|
+
i(x ? [e] : [...o, e]), l(""), x && d(!1);
|
|
1174
|
+
}, re = (e) => i(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: [o.map((
|
|
1177
|
+
children: [o.map((e) => /* @__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
|
-
rowId:
|
|
1180
|
+
rowId: e,
|
|
1181
1181
|
children: /* @__PURE__ */ y("span", {
|
|
1182
1182
|
className: "inline-flex min-w-0 items-center gap-1",
|
|
1183
1183
|
children: [/* @__PURE__ */ v("span", {
|
|
1184
1184
|
className: "leading-none",
|
|
1185
|
-
children:
|
|
1185
|
+
children: t.icon(e)
|
|
1186
1186
|
}), /* @__PURE__ */ v("span", {
|
|
1187
1187
|
className: "max-w-[120px] truncate",
|
|
1188
|
-
children: te(
|
|
1188
|
+
children: te(e)
|
|
1189
1189
|
})]
|
|
1190
1190
|
})
|
|
1191
1191
|
}), /* @__PURE__ */ v("button", {
|
|
1192
1192
|
type: "button",
|
|
1193
|
-
onClick: () => re(
|
|
1193
|
+
onClick: () => re(e),
|
|
1194
1194
|
className: "text-muted-foreground/70 transition-colors hover:text-destructive",
|
|
1195
1195
|
"aria-label": "Remove link",
|
|
1196
1196
|
children: /* @__PURE__ */ v(D, { className: "h-3 w-3" })
|
|
1197
1197
|
})]
|
|
1198
|
-
},
|
|
1198
|
+
}, e)), (!x || o.length === 0) && /* @__PURE__ */ y(W, {
|
|
1199
1199
|
open: u,
|
|
1200
1200
|
onOpenChange: d,
|
|
1201
1201
|
children: [/* @__PURE__ */ v(G, {
|