@agent-native/core 0.128.1 → 0.128.2
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/corpus/README.md +1 -1
- package/corpus/core/CHANGELOG.md +6 -0
- package/corpus/core/package.json +2 -1
- package/corpus/core/src/server/email-template.ts +33 -0
- package/corpus/templates/chat/_gitignore +2 -0
- package/corpus/templates/clips/AGENTS.md +6 -1
- package/corpus/templates/clips/actions/complete-transactional-email-summary.ts +56 -0
- package/corpus/templates/clips/actions/import-loom-recording.ts +258 -76
- package/corpus/templates/clips/actions/lib/direct-video.ts +96 -0
- package/corpus/templates/clips/actions/lib/loom-import-job.ts +53 -2
- package/corpus/templates/clips/actions/lib/loom-video.ts +2 -62
- package/corpus/templates/clips/actions/lib/video-download-limits.ts +62 -0
- package/corpus/templates/clips/actions/list-transactional-email-ai-requests.ts +249 -0
- package/corpus/templates/clips/app/components/library/library-grid.tsx +65 -0
- package/corpus/templates/clips/app/components/library/library-layout.tsx +55 -0
- package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +28 -126
- package/corpus/templates/clips/app/global.css +23 -0
- package/corpus/templates/clips/app/hooks/use-transactional-email-bridge.ts +98 -0
- package/corpus/templates/clips/app/i18n/en-US.ts +20 -0
- package/corpus/templates/clips/app/routes/_app.tsx +2 -0
- package/corpus/templates/clips/app/routes/import.tsx +396 -0
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +8 -6
- package/corpus/templates/clips/app/routes/record.tsx +13 -71
- package/corpus/templates/clips/changelog/2026-07-25-two-clip-emails-now-include-a-concise-summary-generated-secu.md +6 -0
- package/corpus/templates/clips/data/clips-transactional-emails/config.json +3 -0
- package/corpus/templates/clips/server/jobs/transactional-emails.ts +1034 -0
- package/corpus/templates/clips/server/lib/transactional-email-store.ts +865 -0
- package/corpus/templates/clips/server/lib/transactional-email-templates.ts +270 -0
- package/corpus/templates/clips/server/plugins/calendar-jobs.ts +2 -0
- package/corpus/templates/clips/server/routes/api/view-event.post.ts +59 -2
- package/corpus/templates/content/.agents/skills/document-editing/references/databases.md +8 -2
- package/corpus/templates/content/AGENTS.md +8 -0
- package/corpus/templates/content/actions/_content-database-personal-view.ts +28 -3
- package/corpus/templates/content/actions/_property-utils.ts +32 -2
- package/corpus/templates/content/actions/configure-document-property.ts +12 -2
- package/corpus/templates/content/actions/delete-document-property.ts +13 -3
- package/corpus/templates/content/actions/duplicate-document-property.ts +13 -3
- package/corpus/templates/content/actions/list-content-spaces.ts +5 -2
- package/corpus/templates/content/actions/list-document-properties.ts +12 -3
- package/corpus/templates/content/actions/move-database-item.ts +74 -55
- package/corpus/templates/content/actions/reorder-document-property.ts +20 -4
- package/corpus/templates/content/actions/set-document-property.ts +10 -1
- package/corpus/templates/content/actions/update-content-database-personal-view.ts +7 -0
- package/corpus/templates/content/app/components/editor/DocumentBlockFields.tsx +31 -21
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +30 -3
- package/corpus/templates/content/app/components/editor/DocumentInfoPanel.tsx +8 -1
- package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +72 -20
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +79 -10
- package/corpus/templates/content/app/components/editor/database/TimelineView.tsx +8 -1
- package/corpus/templates/content/app/components/editor/database/settings.tsx +6 -0
- package/corpus/templates/content/app/components/editor/database/sidebar.tsx +246 -26
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +491 -197
- package/corpus/templates/content/app/components/sidebar/DocumentTreeItem.tsx +3 -3
- package/corpus/templates/content/app/components/sidebar/sidebar-reorder.tsx +409 -0
- package/corpus/templates/content/app/hooks/use-content-database.ts +117 -3
- package/corpus/templates/content/app/hooks/use-content-spaces.ts +1 -0
- package/corpus/templates/content/app/hooks/use-document-properties.ts +62 -18
- package/corpus/templates/content/app/hooks/use-documents.ts +13 -5
- package/corpus/templates/content/app/i18n-data.ts +261 -3
- package/corpus/templates/content/app/routes/_app.page.$id.tsx +9 -2
- package/corpus/templates/content/changelog/2026-07-24-database-page-properties-keep-their-context.md +6 -0
- package/corpus/templates/content/changelog/2026-07-26-sidebar-references-can-now-be-personally-reordered.md +6 -0
- package/corpus/templates/content/docs/solutions/2026-07-24-database-property-context-switch-diagnosis.md +249 -0
- package/corpus/templates/content/docs/solutions/content-sidebar-order-shape.md +389 -0
- package/corpus/templates/content/shared/api.ts +28 -0
- package/corpus/toolkit/CHANGELOG.md +6 -0
- package/corpus/toolkit/package.json +1 -1
- package/corpus/toolkit/src/editor/DragHandle.ts +63 -9
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +3 -3
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/email-template.d.ts +7 -0
- package/dist/server/email-template.d.ts.map +1 -1
- package/dist/server/email-template.js +24 -0
- package/dist/server/email-template.js.map +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/templates/chat/_gitignore +2 -0
- package/package.json +4 -3
- package/src/server/email-template.ts +33 -0
- package/src/templates/chat/_gitignore +2 -0
|
@@ -132,6 +132,7 @@ import {
|
|
|
132
132
|
} from "@/components/ui/tooltip";
|
|
133
133
|
import { applySourceFieldPropertyToDatabaseResponse } from "@/hooks/use-content-database";
|
|
134
134
|
import {
|
|
135
|
+
documentPropertiesResponseMatchesScope,
|
|
135
136
|
useConfigureDocumentProperty,
|
|
136
137
|
useDeleteDocumentProperty,
|
|
137
138
|
useDocumentProperties,
|
|
@@ -165,6 +166,7 @@ function tWithFallback(
|
|
|
165
166
|
|
|
166
167
|
interface DocumentPropertiesProps {
|
|
167
168
|
documentId: string;
|
|
169
|
+
databaseId: string;
|
|
168
170
|
databaseDocumentId: string;
|
|
169
171
|
canEdit: boolean;
|
|
170
172
|
popoversPortalled?: boolean;
|
|
@@ -797,18 +799,23 @@ function scalarPlaceholder(type: DocumentPropertyType, t: TFunction) {
|
|
|
797
799
|
|
|
798
800
|
export function DocumentProperties({
|
|
799
801
|
documentId,
|
|
802
|
+
databaseId,
|
|
800
803
|
databaseDocumentId,
|
|
801
804
|
canEdit,
|
|
802
805
|
popoversPortalled = true,
|
|
803
806
|
}: DocumentPropertiesProps) {
|
|
804
807
|
const t = useT();
|
|
805
|
-
const { data, isLoading } = useDocumentProperties(documentId);
|
|
808
|
+
const { data, isLoading } = useDocumentProperties(documentId, databaseId);
|
|
809
|
+
const loaded = documentPropertiesResponseMatchesScope(
|
|
810
|
+
documentId,
|
|
811
|
+
databaseId,
|
|
812
|
+
data,
|
|
813
|
+
);
|
|
806
814
|
// Blocks fields are rendered as body content (below the database/title), not
|
|
807
815
|
// as scalar property rows in this panel — exclude them here.
|
|
808
|
-
const properties = (data
|
|
816
|
+
const properties = (loaded ? data.properties : []).filter(
|
|
809
817
|
(property) => property.definition.type !== "blocks",
|
|
810
818
|
);
|
|
811
|
-
const databaseId = data?.databaseId ?? null;
|
|
812
819
|
const visibleProperties = properties.filter(isPropertyVisible);
|
|
813
820
|
const hiddenProperties = properties.filter(
|
|
814
821
|
(property) => !isPropertyVisible(property),
|
|
@@ -816,7 +823,7 @@ export function DocumentProperties({
|
|
|
816
823
|
|
|
817
824
|
return (
|
|
818
825
|
<div className="mt-5 border-y border-transparent py-1">
|
|
819
|
-
{isLoading ? (
|
|
826
|
+
{isLoading || !loaded ? (
|
|
820
827
|
<div className="flex h-8 items-center gap-2 text-sm text-muted-foreground">
|
|
821
828
|
<Spinner className="size-3.5" />
|
|
822
829
|
{t("editor.properties.loadingProperties")}
|
|
@@ -837,17 +844,19 @@ export function DocumentProperties({
|
|
|
837
844
|
</div>
|
|
838
845
|
) : null}
|
|
839
846
|
|
|
840
|
-
{canEdit && hiddenProperties.length > 0 ? (
|
|
847
|
+
{loaded && canEdit && hiddenProperties.length > 0 ? (
|
|
841
848
|
<HiddenPropertiesMenu
|
|
842
849
|
documentId={documentId}
|
|
850
|
+
databaseId={databaseId}
|
|
843
851
|
properties={hiddenProperties}
|
|
844
852
|
t={t}
|
|
845
853
|
/>
|
|
846
854
|
) : null}
|
|
847
855
|
|
|
848
|
-
{canEdit && databaseId ? (
|
|
856
|
+
{loaded && canEdit && databaseId ? (
|
|
849
857
|
<AddProperty
|
|
850
858
|
documentId={documentId}
|
|
859
|
+
databaseId={databaseId}
|
|
851
860
|
popoversPortalled={popoversPortalled}
|
|
852
861
|
/>
|
|
853
862
|
) : null}
|
|
@@ -866,14 +875,16 @@ function isPropertyVisible(property: DocumentProperty) {
|
|
|
866
875
|
|
|
867
876
|
function HiddenPropertiesMenu({
|
|
868
877
|
documentId,
|
|
878
|
+
databaseId,
|
|
869
879
|
properties,
|
|
870
880
|
t,
|
|
871
881
|
}: {
|
|
872
882
|
documentId: string;
|
|
883
|
+
databaseId: string;
|
|
873
884
|
properties: DocumentProperty[];
|
|
874
885
|
t: TFunction;
|
|
875
886
|
}) {
|
|
876
|
-
const configure = useConfigureDocumentProperty(documentId);
|
|
887
|
+
const configure = useConfigureDocumentProperty(documentId, databaseId);
|
|
877
888
|
|
|
878
889
|
async function showProperty(property: DocumentProperty) {
|
|
879
890
|
await configure.mutateAsync({
|
|
@@ -955,6 +966,7 @@ function PropertyRow({
|
|
|
955
966
|
<PropertyManagementPopover
|
|
956
967
|
property={property}
|
|
957
968
|
documentId={documentId}
|
|
969
|
+
databaseId={property.definition.databaseId!}
|
|
958
970
|
icon={Icon}
|
|
959
971
|
/>
|
|
960
972
|
) : (
|
|
@@ -1018,6 +1030,7 @@ export function propertyTypeForSourceFieldType(
|
|
|
1018
1030
|
export function PropertyManagementPopover({
|
|
1019
1031
|
property,
|
|
1020
1032
|
documentId,
|
|
1033
|
+
databaseId,
|
|
1021
1034
|
icon: Icon,
|
|
1022
1035
|
triggerClassName,
|
|
1023
1036
|
onTriggerPointerDown,
|
|
@@ -1034,6 +1047,7 @@ export function PropertyManagementPopover({
|
|
|
1034
1047
|
}: {
|
|
1035
1048
|
property: DocumentProperty;
|
|
1036
1049
|
documentId: string;
|
|
1050
|
+
databaseId: string;
|
|
1037
1051
|
icon: Icon;
|
|
1038
1052
|
triggerClassName?: string;
|
|
1039
1053
|
onTriggerPointerDown?: (event: ReactPointerEvent<HTMLButtonElement>) => void;
|
|
@@ -1064,10 +1078,13 @@ export function PropertyManagementPopover({
|
|
|
1064
1078
|
const quickFilters = databaseQuickFilterOptionsForColumn(
|
|
1065
1079
|
property.definition.type,
|
|
1066
1080
|
);
|
|
1067
|
-
const configure = useConfigureDocumentProperty(documentId);
|
|
1068
|
-
const duplicate = useDuplicateDocumentProperty(documentId);
|
|
1069
|
-
const remove = useDeleteDocumentProperty(documentId);
|
|
1070
|
-
const { data: propertiesData } = useDocumentProperties(
|
|
1081
|
+
const configure = useConfigureDocumentProperty(documentId, databaseId);
|
|
1082
|
+
const duplicate = useDuplicateDocumentProperty(documentId, databaseId);
|
|
1083
|
+
const remove = useDeleteDocumentProperty(documentId, databaseId);
|
|
1084
|
+
const { data: propertiesData } = useDocumentProperties(
|
|
1085
|
+
documentId,
|
|
1086
|
+
databaseId,
|
|
1087
|
+
);
|
|
1071
1088
|
const bindQueryClient = useQueryClient();
|
|
1072
1089
|
const bindSourceField = useActionMutation<
|
|
1073
1090
|
ContentDatabaseResponse,
|
|
@@ -1078,7 +1095,11 @@ export function PropertyManagementPopover({
|
|
|
1078
1095
|
queryKey: ["action", "get-content-database"],
|
|
1079
1096
|
});
|
|
1080
1097
|
bindQueryClient.invalidateQueries({
|
|
1081
|
-
queryKey: [
|
|
1098
|
+
queryKey: [
|
|
1099
|
+
"action",
|
|
1100
|
+
"list-document-properties",
|
|
1101
|
+
{ documentId, databaseId },
|
|
1102
|
+
],
|
|
1082
1103
|
});
|
|
1083
1104
|
},
|
|
1084
1105
|
});
|
|
@@ -2132,7 +2153,11 @@ function PersonValueEditor({
|
|
|
2132
2153
|
onDone: () => void;
|
|
2133
2154
|
}) {
|
|
2134
2155
|
const t = useT();
|
|
2135
|
-
const mutation = useSetDocumentProperty(
|
|
2156
|
+
const mutation = useSetDocumentProperty(
|
|
2157
|
+
documentId,
|
|
2158
|
+
property.definition.databaseId!,
|
|
2159
|
+
databaseDocumentId,
|
|
2160
|
+
);
|
|
2136
2161
|
const { session } = useSession();
|
|
2137
2162
|
const [people, setPeople] = useState(() => personItems(property.value));
|
|
2138
2163
|
const [query, setQuery] = useState("");
|
|
@@ -2333,7 +2358,11 @@ function FilesMediaValueEditor({
|
|
|
2333
2358
|
onDone: () => void;
|
|
2334
2359
|
}) {
|
|
2335
2360
|
const t = useT();
|
|
2336
|
-
const mutation = useSetDocumentProperty(
|
|
2361
|
+
const mutation = useSetDocumentProperty(
|
|
2362
|
+
documentId,
|
|
2363
|
+
property.definition.databaseId!,
|
|
2364
|
+
databaseDocumentId,
|
|
2365
|
+
);
|
|
2337
2366
|
const [items, setItems] = useState(() => filesMediaItems(property.value));
|
|
2338
2367
|
const [linkValue, setLinkValue] = useState("");
|
|
2339
2368
|
const [uploading, setUploading] = useState(false);
|
|
@@ -2536,7 +2565,11 @@ function DateValueEditor({
|
|
|
2536
2565
|
onDone: () => void;
|
|
2537
2566
|
}) {
|
|
2538
2567
|
const t = useT();
|
|
2539
|
-
const mutation = useSetDocumentProperty(
|
|
2568
|
+
const mutation = useSetDocumentProperty(
|
|
2569
|
+
documentId,
|
|
2570
|
+
property.definition.databaseId!,
|
|
2571
|
+
databaseDocumentId,
|
|
2572
|
+
);
|
|
2540
2573
|
const [includeTime, setIncludeTime] = useState(
|
|
2541
2574
|
documentPropertyDateIncludesTime(property.value),
|
|
2542
2575
|
);
|
|
@@ -2765,7 +2798,11 @@ function ScalarValueEditor({
|
|
|
2765
2798
|
onDone: () => void;
|
|
2766
2799
|
}) {
|
|
2767
2800
|
const t = useT();
|
|
2768
|
-
const mutation = useSetDocumentProperty(
|
|
2801
|
+
const mutation = useSetDocumentProperty(
|
|
2802
|
+
documentId,
|
|
2803
|
+
property.definition.databaseId!,
|
|
2804
|
+
databaseDocumentId,
|
|
2805
|
+
);
|
|
2769
2806
|
const type = property.definition.type;
|
|
2770
2807
|
const inputType =
|
|
2771
2808
|
type === "number"
|
|
@@ -2875,7 +2912,11 @@ function CheckboxValueEditor({
|
|
|
2875
2912
|
onDone: () => void;
|
|
2876
2913
|
}) {
|
|
2877
2914
|
const t = useT();
|
|
2878
|
-
const mutation = useSetDocumentProperty(
|
|
2915
|
+
const mutation = useSetDocumentProperty(
|
|
2916
|
+
documentId,
|
|
2917
|
+
property.definition.databaseId!,
|
|
2918
|
+
databaseDocumentId,
|
|
2919
|
+
);
|
|
2879
2920
|
const checked = Boolean(property.value);
|
|
2880
2921
|
|
|
2881
2922
|
return (
|
|
@@ -2916,9 +2957,14 @@ function OptionValueEditor({
|
|
|
2916
2957
|
onDone: () => void;
|
|
2917
2958
|
}) {
|
|
2918
2959
|
const t = useT();
|
|
2919
|
-
const setValue = useSetDocumentProperty(
|
|
2960
|
+
const setValue = useSetDocumentProperty(
|
|
2961
|
+
documentId,
|
|
2962
|
+
property.definition.databaseId!,
|
|
2963
|
+
databaseDocumentId,
|
|
2964
|
+
);
|
|
2920
2965
|
const configure = useConfigureDocumentProperty(
|
|
2921
2966
|
documentId,
|
|
2967
|
+
property.definition.databaseId!,
|
|
2922
2968
|
databaseDocumentId,
|
|
2923
2969
|
);
|
|
2924
2970
|
const options = property.definition.options.options ?? [];
|
|
@@ -3085,6 +3131,7 @@ function OptionValueEditor({
|
|
|
3085
3131
|
|
|
3086
3132
|
export function AddProperty({
|
|
3087
3133
|
documentId,
|
|
3134
|
+
databaseId,
|
|
3088
3135
|
variant = "default",
|
|
3089
3136
|
label,
|
|
3090
3137
|
popoversPortalled = true,
|
|
@@ -3092,6 +3139,7 @@ export function AddProperty({
|
|
|
3092
3139
|
sources,
|
|
3093
3140
|
}: {
|
|
3094
3141
|
documentId: string;
|
|
3142
|
+
databaseId: string;
|
|
3095
3143
|
variant?: "default" | "header" | "icon";
|
|
3096
3144
|
label?: string;
|
|
3097
3145
|
popoversPortalled?: boolean;
|
|
@@ -3099,7 +3147,7 @@ export function AddProperty({
|
|
|
3099
3147
|
sources?: ContentDatabaseSource[];
|
|
3100
3148
|
}) {
|
|
3101
3149
|
const t = useT();
|
|
3102
|
-
const configure = useConfigureDocumentProperty(documentId);
|
|
3150
|
+
const configure = useConfigureDocumentProperty(documentId, databaseId);
|
|
3103
3151
|
const queryClient = useQueryClient();
|
|
3104
3152
|
const addSourceFieldProperty = useActionMutation<
|
|
3105
3153
|
ContentDatabaseSourceFieldPropertyResponse,
|
|
@@ -3111,7 +3159,11 @@ export function AddProperty({
|
|
|
3111
3159
|
(current) => applySourceFieldPropertyToDatabaseResponse(current, data),
|
|
3112
3160
|
);
|
|
3113
3161
|
queryClient.invalidateQueries({
|
|
3114
|
-
queryKey: [
|
|
3162
|
+
queryKey: [
|
|
3163
|
+
"action",
|
|
3164
|
+
"list-document-properties",
|
|
3165
|
+
{ documentId, databaseId },
|
|
3166
|
+
],
|
|
3115
3167
|
});
|
|
3116
3168
|
},
|
|
3117
3169
|
});
|
|
@@ -392,7 +392,12 @@ export function previewDraftMissingCasRecovery(args: {
|
|
|
392
392
|
}
|
|
393
393
|
|
|
394
394
|
type DatabaseMessageKey = keyof (typeof messagesByLocale)["en-US"]["database"];
|
|
395
|
-
type
|
|
395
|
+
type SidebarMessages = (typeof messagesByLocale)["en-US"]["sidebar"];
|
|
396
|
+
type SidebarMessageKey = {
|
|
397
|
+
[Key in keyof SidebarMessages]: SidebarMessages[Key] extends string
|
|
398
|
+
? Key
|
|
399
|
+
: never;
|
|
400
|
+
}[keyof SidebarMessages];
|
|
396
401
|
|
|
397
402
|
export function dbText(
|
|
398
403
|
key: DatabaseMessageKey,
|
|
@@ -783,7 +788,11 @@ function DatabaseTable({
|
|
|
783
788
|
document.id,
|
|
784
789
|
);
|
|
785
790
|
const setSourceWriteMode = useSetContentDatabaseSourceWriteMode(document.id);
|
|
786
|
-
const setProperty = useSetDocumentProperty(
|
|
791
|
+
const setProperty = useSetDocumentProperty(
|
|
792
|
+
document.id,
|
|
793
|
+
expectedDatabaseId,
|
|
794
|
+
document.id,
|
|
795
|
+
);
|
|
787
796
|
const updateView = useUpdateContentDatabaseView(document.id);
|
|
788
797
|
// A deleted/missing database resolves to the unavailable union (no
|
|
789
798
|
// `database` field) — treat it as no data; the inline-block wrapper owns
|
|
@@ -1437,7 +1446,7 @@ function DatabaseTable({
|
|
|
1437
1446
|
if (openWorkspaceFiles(item)) return;
|
|
1438
1447
|
seedDatabaseItemDocumentCaches(queryClient, item);
|
|
1439
1448
|
prioritizeBuilderBodyHydrationForItem(item);
|
|
1440
|
-
navigate(
|
|
1449
|
+
navigate(databaseItemPagePath(item.document.id, databaseId, document.id));
|
|
1441
1450
|
}
|
|
1442
1451
|
|
|
1443
1452
|
function openWorkspaceFiles(item: ContentDatabaseItem) {
|
|
@@ -2428,7 +2437,13 @@ function DatabaseTable({
|
|
|
2428
2437
|
aria-label={dbText("openAsFullPage")}
|
|
2429
2438
|
className={databaseToolbarIconButtonClass()}
|
|
2430
2439
|
>
|
|
2431
|
-
<Link
|
|
2440
|
+
<Link
|
|
2441
|
+
to={databaseItemPagePath(
|
|
2442
|
+
databaseDocumentId,
|
|
2443
|
+
databaseId,
|
|
2444
|
+
databaseDocumentId,
|
|
2445
|
+
)}
|
|
2446
|
+
>
|
|
2432
2447
|
<IconArrowsDiagonal className="size-3.5" />
|
|
2433
2448
|
</Link>
|
|
2434
2449
|
</Button>
|
|
@@ -2606,6 +2621,7 @@ function DatabaseTable({
|
|
|
2606
2621
|
/>
|
|
2607
2622
|
) : activeView.type === "board" ? (
|
|
2608
2623
|
<DatabaseBoardView
|
|
2624
|
+
databaseId={databaseId}
|
|
2609
2625
|
activeView={activeView}
|
|
2610
2626
|
properties={orderedProperties}
|
|
2611
2627
|
items={visibleItems}
|
|
@@ -2684,6 +2700,7 @@ function DatabaseTable({
|
|
|
2684
2700
|
/>
|
|
2685
2701
|
) : activeView.type === "calendar" ? (
|
|
2686
2702
|
<DatabaseCalendarView
|
|
2703
|
+
databaseId={databaseId}
|
|
2687
2704
|
activeView={activeView}
|
|
2688
2705
|
properties={orderedProperties}
|
|
2689
2706
|
items={visibleItems}
|
|
@@ -2711,6 +2728,7 @@ function DatabaseTable({
|
|
|
2711
2728
|
/>
|
|
2712
2729
|
) : activeView.type === "timeline" ? (
|
|
2713
2730
|
<DatabaseTimelineView
|
|
2731
|
+
databaseId={databaseId}
|
|
2714
2732
|
activeView={activeView}
|
|
2715
2733
|
properties={orderedProperties}
|
|
2716
2734
|
items={visibleItems}
|
|
@@ -2744,6 +2762,7 @@ function DatabaseTable({
|
|
|
2744
2762
|
/>
|
|
2745
2763
|
) : (
|
|
2746
2764
|
<DatabaseTableView
|
|
2765
|
+
databaseId={databaseId}
|
|
2747
2766
|
newRowLabel={newDatabaseRowLabel}
|
|
2748
2767
|
properties={tableProperties}
|
|
2749
2768
|
groupableProperties={orderedProperties}
|
|
@@ -3063,6 +3082,15 @@ export function databaseItemPreviewTitle(
|
|
|
3063
3082
|
return item?.document.title?.trim() || "Untitled";
|
|
3064
3083
|
}
|
|
3065
3084
|
|
|
3085
|
+
export function databaseItemPagePath(
|
|
3086
|
+
documentId: string,
|
|
3087
|
+
databaseId: string,
|
|
3088
|
+
databaseDocumentId: string,
|
|
3089
|
+
) {
|
|
3090
|
+
const search = new URLSearchParams({ databaseId, databaseDocumentId });
|
|
3091
|
+
return `/page/${documentId}?${search.toString()}`;
|
|
3092
|
+
}
|
|
3093
|
+
|
|
3066
3094
|
export function databaseNavigationState({
|
|
3067
3095
|
document,
|
|
3068
3096
|
databaseId,
|
|
@@ -4943,6 +4971,7 @@ function DatabaseItemPreview({
|
|
|
4943
4971
|
{previewDocument.databaseMembership ? (
|
|
4944
4972
|
<DocumentProperties
|
|
4945
4973
|
documentId={previewDocument.id}
|
|
4974
|
+
databaseId={item.databaseId}
|
|
4946
4975
|
databaseDocumentId={databaseDocumentId}
|
|
4947
4976
|
canEdit={previewCanEdit}
|
|
4948
4977
|
popoversPortalled={false}
|
|
@@ -4981,6 +5010,7 @@ function DatabaseItemPreview({
|
|
|
4981
5010
|
const editor = previewDocument.databaseMembership ? (
|
|
4982
5011
|
<DocumentBlockFields
|
|
4983
5012
|
documentId={previewDocument.id}
|
|
5013
|
+
databaseId={item.databaseId}
|
|
4984
5014
|
databaseDocumentId={databaseDocumentId}
|
|
4985
5015
|
canEdit={previewCanEdit}
|
|
4986
5016
|
primaryEditor={primaryEditor}
|
|
@@ -5084,6 +5114,7 @@ function DatabaseItemPreview({
|
|
|
5084
5114
|
}
|
|
5085
5115
|
|
|
5086
5116
|
function DatabaseTableView({
|
|
5117
|
+
databaseId,
|
|
5087
5118
|
newRowLabel,
|
|
5088
5119
|
properties,
|
|
5089
5120
|
groupableProperties,
|
|
@@ -5130,6 +5161,7 @@ function DatabaseTableView({
|
|
|
5130
5161
|
onDeletedPreviewItems,
|
|
5131
5162
|
onOpenPage,
|
|
5132
5163
|
}: {
|
|
5164
|
+
databaseId: string;
|
|
5133
5165
|
newRowLabel: string;
|
|
5134
5166
|
properties: DocumentProperty[];
|
|
5135
5167
|
groupableProperties: DocumentProperty[];
|
|
@@ -5194,7 +5226,11 @@ function DatabaseTableView({
|
|
|
5194
5226
|
const contentSpaces = useContentSpaces();
|
|
5195
5227
|
const moveItem = useMoveDatabaseItem(databaseDocumentId);
|
|
5196
5228
|
const duplicateItems = useDuplicateDatabaseItems(databaseDocumentId);
|
|
5197
|
-
const setProperty = useSetDocumentProperty(
|
|
5229
|
+
const setProperty = useSetDocumentProperty(
|
|
5230
|
+
databaseDocumentId,
|
|
5231
|
+
databaseId,
|
|
5232
|
+
databaseDocumentId,
|
|
5233
|
+
);
|
|
5198
5234
|
const deleteItems = useDeleteDatabaseItems(databaseDocumentId);
|
|
5199
5235
|
const [draggedItemId, setDraggedItemId] = useState<string | null>(null);
|
|
5200
5236
|
const [dropTargetItemId, setDropTargetItemId] = useState<string | null>(null);
|
|
@@ -5648,6 +5684,7 @@ function DatabaseTableView({
|
|
|
5648
5684
|
>
|
|
5649
5685
|
<AddProperty
|
|
5650
5686
|
documentId={databaseDocumentId}
|
|
5687
|
+
databaseId={databaseId}
|
|
5651
5688
|
variant={cleanDefaultTable ? "header" : "icon"}
|
|
5652
5689
|
label={dbText("addProperty")}
|
|
5653
5690
|
source={source}
|
|
@@ -7399,6 +7436,7 @@ function DatabaseSettingsPanelSheet({
|
|
|
7399
7436
|
) : panel === "property_visibility" ? (
|
|
7400
7437
|
<DatabaseSettingsPropertyVisibilityPanel
|
|
7401
7438
|
documentId={documentId}
|
|
7439
|
+
databaseId={databaseId}
|
|
7402
7440
|
properties={properties}
|
|
7403
7441
|
activeView={activeView}
|
|
7404
7442
|
items={items}
|
|
@@ -10652,6 +10690,7 @@ function DatabaseOpenPagesInSetting({
|
|
|
10652
10690
|
|
|
10653
10691
|
function DatabaseSettingsPropertyVisibilityPanel({
|
|
10654
10692
|
documentId,
|
|
10693
|
+
databaseId,
|
|
10655
10694
|
properties,
|
|
10656
10695
|
activeView,
|
|
10657
10696
|
items,
|
|
@@ -10662,6 +10701,7 @@ function DatabaseSettingsPropertyVisibilityPanel({
|
|
|
10662
10701
|
onPropertiesHiddenChange,
|
|
10663
10702
|
}: {
|
|
10664
10703
|
documentId: string;
|
|
10704
|
+
databaseId: string;
|
|
10665
10705
|
properties: DocumentProperty[];
|
|
10666
10706
|
activeView: ContentDatabaseView;
|
|
10667
10707
|
items: ContentDatabaseItem[];
|
|
@@ -10761,6 +10801,7 @@ function DatabaseSettingsPropertyVisibilityPanel({
|
|
|
10761
10801
|
<div className="border-t border-border/70 pt-3">
|
|
10762
10802
|
<AddProperty
|
|
10763
10803
|
documentId={documentId}
|
|
10804
|
+
databaseId={databaseId}
|
|
10764
10805
|
label={dbText("newProperty")}
|
|
10765
10806
|
source={source}
|
|
10766
10807
|
sources={sources}
|
|
@@ -11667,6 +11708,7 @@ export function DatabaseGroupHeader({
|
|
|
11667
11708
|
}
|
|
11668
11709
|
|
|
11669
11710
|
function DatabaseCalendarView({
|
|
11711
|
+
databaseId,
|
|
11670
11712
|
activeView,
|
|
11671
11713
|
properties,
|
|
11672
11714
|
items,
|
|
@@ -11687,6 +11729,7 @@ function DatabaseCalendarView({
|
|
|
11687
11729
|
onDeletedPreviewItem,
|
|
11688
11730
|
onOpenPage,
|
|
11689
11731
|
}: {
|
|
11732
|
+
databaseId: string;
|
|
11690
11733
|
activeView: ContentDatabaseView;
|
|
11691
11734
|
properties: DocumentProperty[];
|
|
11692
11735
|
items: ContentDatabaseItem[];
|
|
@@ -11838,7 +11881,12 @@ function DatabaseCalendarView({
|
|
|
11838
11881
|
) : dateProperties.length === 0 ? (
|
|
11839
11882
|
<div className="flex min-h-24 items-center justify-between gap-3 px-2 py-4 text-sm text-muted-foreground">
|
|
11840
11883
|
<span>{dbText("addADatePropertyToUseCalendarView")}</span>
|
|
11841
|
-
{canEdit ?
|
|
11884
|
+
{canEdit ? (
|
|
11885
|
+
<AddProperty
|
|
11886
|
+
documentId={databaseDocumentId}
|
|
11887
|
+
databaseId={databaseId}
|
|
11888
|
+
/>
|
|
11889
|
+
) : null}
|
|
11842
11890
|
</div>
|
|
11843
11891
|
) : databaseViewHasNoMatchingPages(
|
|
11844
11892
|
items.length,
|
|
@@ -12118,6 +12166,7 @@ export interface DatabaseBoardGroup {
|
|
|
12118
12166
|
}
|
|
12119
12167
|
|
|
12120
12168
|
function DatabaseBoardView({
|
|
12169
|
+
databaseId,
|
|
12121
12170
|
activeView,
|
|
12122
12171
|
properties,
|
|
12123
12172
|
items,
|
|
@@ -12142,6 +12191,7 @@ function DatabaseBoardView({
|
|
|
12142
12191
|
onDeletedPreviewItem,
|
|
12143
12192
|
onOpenPage,
|
|
12144
12193
|
}: {
|
|
12194
|
+
databaseId: string;
|
|
12145
12195
|
activeView: ContentDatabaseView;
|
|
12146
12196
|
properties: DocumentProperty[];
|
|
12147
12197
|
items: ContentDatabaseItem[];
|
|
@@ -12187,7 +12237,10 @@ function DatabaseBoardView({
|
|
|
12187
12237
|
null,
|
|
12188
12238
|
);
|
|
12189
12239
|
const [dropGroupId, setDropGroupId] = useState<string | null>(null);
|
|
12190
|
-
const configureProperty = useConfigureDocumentProperty(
|
|
12240
|
+
const configureProperty = useConfigureDocumentProperty(
|
|
12241
|
+
databaseDocumentId,
|
|
12242
|
+
databaseId,
|
|
12243
|
+
);
|
|
12191
12244
|
const canCreateGroup =
|
|
12192
12245
|
canEdit && !!groupProperty && databaseBoardCanCreateGroup(groupProperty);
|
|
12193
12246
|
|
|
@@ -12372,7 +12425,12 @@ function DatabaseBoardView({
|
|
|
12372
12425
|
) : groupableProperties.length === 0 ? (
|
|
12373
12426
|
<div className="flex min-h-24 items-center justify-between gap-3 px-2 py-4 text-sm text-muted-foreground">
|
|
12374
12427
|
<span>{dbText("addAStatusSelectMultiSelectOrCheckbox2")}</span>
|
|
12375
|
-
{canEdit ?
|
|
12428
|
+
{canEdit ? (
|
|
12429
|
+
<AddProperty
|
|
12430
|
+
documentId={databaseDocumentId}
|
|
12431
|
+
databaseId={databaseId}
|
|
12432
|
+
/>
|
|
12433
|
+
) : null}
|
|
12376
12434
|
</div>
|
|
12377
12435
|
) : (
|
|
12378
12436
|
<>
|
|
@@ -15900,6 +15958,7 @@ function DatabasePropertyHeader({
|
|
|
15900
15958
|
<PropertyManagementPopover
|
|
15901
15959
|
property={property}
|
|
15902
15960
|
documentId={documentId}
|
|
15961
|
+
databaseId={property.definition.databaseId!}
|
|
15903
15962
|
icon={Icon}
|
|
15904
15963
|
triggerClassName="h-full min-w-0 flex-1 rounded-none text-xs text-muted-foreground"
|
|
15905
15964
|
onTriggerPointerDown={(event) => {
|
|
@@ -16137,6 +16196,7 @@ function ColumnHeaderMenuContent({
|
|
|
16137
16196
|
|
|
16138
16197
|
function DatabasePropertiesMenu({
|
|
16139
16198
|
documentId,
|
|
16199
|
+
databaseId,
|
|
16140
16200
|
properties,
|
|
16141
16201
|
hiddenCount,
|
|
16142
16202
|
activeView,
|
|
@@ -16145,6 +16205,7 @@ function DatabasePropertiesMenu({
|
|
|
16145
16205
|
onPropertiesHiddenChange,
|
|
16146
16206
|
}: {
|
|
16147
16207
|
documentId: string;
|
|
16208
|
+
databaseId: string;
|
|
16148
16209
|
properties: DocumentProperty[];
|
|
16149
16210
|
hiddenCount: number;
|
|
16150
16211
|
activeView: ContentDatabaseView;
|
|
@@ -16279,7 +16340,11 @@ function DatabasePropertiesMenu({
|
|
|
16279
16340
|
className="border-t border-border p-2"
|
|
16280
16341
|
onKeyDown={(event) => event.stopPropagation()}
|
|
16281
16342
|
>
|
|
16282
|
-
<AddProperty
|
|
16343
|
+
<AddProperty
|
|
16344
|
+
documentId={documentId}
|
|
16345
|
+
databaseId={databaseId}
|
|
16346
|
+
label={dbText("newProperty")}
|
|
16347
|
+
/>
|
|
16283
16348
|
</div>
|
|
16284
16349
|
</DropdownMenuContent>
|
|
16285
16350
|
</DropdownMenu>
|
|
@@ -17259,7 +17324,11 @@ function DatabaseFilterValueControl({
|
|
|
17259
17324
|
hideOptionsUntilQuery?: boolean;
|
|
17260
17325
|
onValueChange: (value: string) => void;
|
|
17261
17326
|
}) {
|
|
17262
|
-
const configureProperty = useConfigureDocumentProperty(
|
|
17327
|
+
const configureProperty = useConfigureDocumentProperty(
|
|
17328
|
+
documentId,
|
|
17329
|
+
properties.find((property) => property.definition.id === filter.key)
|
|
17330
|
+
?.definition.databaseId ?? "",
|
|
17331
|
+
);
|
|
17263
17332
|
const { session } = useSession();
|
|
17264
17333
|
const currentUserEmail = session?.email?.trim() ?? "";
|
|
17265
17334
|
const options = databaseFilterOptionChoices(
|
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
} from "./DatabaseView";
|
|
47
47
|
|
|
48
48
|
export function DatabaseTimelineView({
|
|
49
|
+
databaseId,
|
|
49
50
|
activeView,
|
|
50
51
|
properties,
|
|
51
52
|
items,
|
|
@@ -67,6 +68,7 @@ export function DatabaseTimelineView({
|
|
|
67
68
|
onDeletedPreviewItem,
|
|
68
69
|
onOpenPage,
|
|
69
70
|
}: {
|
|
71
|
+
databaseId: string;
|
|
70
72
|
activeView: ContentDatabaseView;
|
|
71
73
|
properties: DocumentProperty[];
|
|
72
74
|
items: ContentDatabaseItem[];
|
|
@@ -287,7 +289,12 @@ export function DatabaseTimelineView({
|
|
|
287
289
|
) : dateProperties.length === 0 ? (
|
|
288
290
|
<div className="flex min-h-24 items-center justify-between gap-3 px-2 py-4 text-sm text-muted-foreground">
|
|
289
291
|
<span>{dbText("addADatePropertyToUseTimelineView")}</span>
|
|
290
|
-
{canEdit ?
|
|
292
|
+
{canEdit ? (
|
|
293
|
+
<AddProperty
|
|
294
|
+
documentId={databaseDocumentId}
|
|
295
|
+
databaseId={databaseId}
|
|
296
|
+
/>
|
|
297
|
+
) : null}
|
|
291
298
|
</div>
|
|
292
299
|
) : (
|
|
293
300
|
<>
|
|
@@ -176,6 +176,7 @@ function NotionLogoMark({ className }: { className?: string }) {
|
|
|
176
176
|
export function DatabaseSettingsPanelSheet({
|
|
177
177
|
open,
|
|
178
178
|
panel,
|
|
179
|
+
databaseId,
|
|
179
180
|
documentId,
|
|
180
181
|
canEdit,
|
|
181
182
|
activeView,
|
|
@@ -208,6 +209,7 @@ export function DatabaseSettingsPanelSheet({
|
|
|
208
209
|
}: {
|
|
209
210
|
open: boolean;
|
|
210
211
|
panel: DatabaseSettingsPanel;
|
|
212
|
+
databaseId: string;
|
|
211
213
|
documentId: string;
|
|
212
214
|
canEdit: boolean;
|
|
213
215
|
activeView: ContentDatabaseView;
|
|
@@ -348,6 +350,7 @@ export function DatabaseSettingsPanelSheet({
|
|
|
348
350
|
) : panel === "property_visibility" ? (
|
|
349
351
|
<DatabaseSettingsPropertyVisibilityPanel
|
|
350
352
|
documentId={documentId}
|
|
353
|
+
databaseId={databaseId}
|
|
351
354
|
properties={properties}
|
|
352
355
|
activeView={activeView}
|
|
353
356
|
items={items}
|
|
@@ -2796,6 +2799,7 @@ function DatabaseOpenPagesInSetting({
|
|
|
2796
2799
|
|
|
2797
2800
|
function DatabaseSettingsPropertyVisibilityPanel({
|
|
2798
2801
|
documentId,
|
|
2802
|
+
databaseId,
|
|
2799
2803
|
properties,
|
|
2800
2804
|
activeView,
|
|
2801
2805
|
items,
|
|
@@ -2806,6 +2810,7 @@ function DatabaseSettingsPropertyVisibilityPanel({
|
|
|
2806
2810
|
onPropertiesHiddenChange,
|
|
2807
2811
|
}: {
|
|
2808
2812
|
documentId: string;
|
|
2813
|
+
databaseId: string;
|
|
2809
2814
|
properties: DocumentProperty[];
|
|
2810
2815
|
activeView: ContentDatabaseView;
|
|
2811
2816
|
items: ContentDatabaseItem[];
|
|
@@ -2905,6 +2910,7 @@ function DatabaseSettingsPropertyVisibilityPanel({
|
|
|
2905
2910
|
<div className="border-t border-border/70 pt-3">
|
|
2906
2911
|
<AddProperty
|
|
2907
2912
|
documentId={documentId}
|
|
2913
|
+
databaseId={databaseId}
|
|
2908
2914
|
label={dbText("newProperty")}
|
|
2909
2915
|
source={source}
|
|
2910
2916
|
sources={sources}
|