Skip to content

Build your personal knowledge base with Trilium Notes

Relocate calendar and table imports

BeatLink1d86badb7b25
diff --git a/apps/client/src/services/frontend_script_api_preact.ts b/apps/client/src/services/frontend_script_api_preact.ts
index 6d2efe57e1..3b5269878b 100644
--- a/apps/client/src/services/frontend_script_api_preact.ts
+++ b/apps/client/src/services/frontend_script_api_preact.ts
@@ -4,7 +4,7 @@ import * as hooks from "preact/hooks";
import ActionButton from "../widgets/react/ActionButton";
import Admonition from "../widgets/react/Admonition";
import Button from "../widgets/react/Button";
-import Calendar from "../widgets/react/Calendar";
+import Calendar from "../widgets/collections/calendar/calendar";
import CKEditor from "../widgets/react/CKEditor";
import Collapsible, { ExternallyControlledCollapsible } from "../widgets/react/Collapsible";
import ColorPicker from "../widgets/react/ColorPicker";
@@ -32,7 +32,7 @@ import NoteAutocomplete from "../widgets/react/NoteAutocomplete";
import NoteLink from "../widgets/react/NoteLink";
import RawHtml from "../widgets/react/RawHtml";
import Slider from "../widgets/react/Slider";
-import Table from "../widgets/react/Table";
+import Table from "../widgets/collections/table/tabulator";
import RightPanelWidget from "../widgets/sidebar/RightPanelWidget";
export interface WidgetDefinition {
diff --git a/apps/client/src/widgets/react/Calendar.tsx b/apps/client/src/widgets/react/Calendar.tsx
deleted file mode 100644
index 65ceccc9d8..0000000000
--- a/apps/client/src/widgets/react/Calendar.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
- * Public re-export of the generic FullCalendar-based calendar wrapper as a shared Preact widget.
- *
- * The implementation lives at `../collections/calendar/calendar` for historical reasons; this module
- * exposes it from the reusable `widgets/react/` component folder so features outside the note
- * collection view can consume it without reaching into `collections/calendar`. It is decoupled from
- * Trilium's note model — it deals purely in FullCalendar options and a `calendarRef`.
- */
-export { default, type CalendarProps } from "../collections/calendar/calendar";
diff --git a/apps/client/src/widgets/react/Table.tsx b/apps/client/src/widgets/react/Table.tsx
deleted file mode 100644
index 98596d88fe..0000000000
--- a/apps/client/src/widgets/react/Table.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
- * Public re-export of the generic Tabulator-based table wrapper as a shared Preact widget.
- *
- * The implementation lives at `../collections/table/tabulator` for historical reasons; this module
- * exposes it from the reusable `widgets/react/` component folder so features outside the note
- * collection view can consume it without reaching into `collections/table`. It is decoupled from
- * Trilium's note model — it deals purely in columns, data and events.
- */
-export { default, type TableProps } from "../collections/table/tabulator";
diff --git a/apps/client/src/widgets/react/collection_reexports.spec.ts b/apps/client/src/widgets/react/collection_reexports.spec.ts
deleted file mode 100644
index 248f6ad6f2..0000000000
--- a/apps/client/src/widgets/react/collection_reexports.spec.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { describe, expect, it } from "vitest";
-
-// These modules exist only to re-export the generic collection wrappers from the reusable
-// `widgets/react/` folder. Instantiating Tabulator / FullCalendar needs real layout (out of scope for
-// happy-dom), so we verify the one thing these files are responsible for: that they forward the exact
-// same component (and its props type) as the underlying implementation.
-import Calendar from "./Calendar";
-import CalendarImpl from "../collections/calendar/calendar";
-import Table from "./Table";
-import TableImpl from "../collections/table/tabulator";
-
-describe("collection widget re-exports", () => {
- it("Table re-exports the Tabulator wrapper", () => {
- expect(Table).toBe(TableImpl);
- });
-
- it("Calendar re-exports the FullCalendar wrapper", () => {
- expect(Calendar).toBe(CalendarImpl);
- });
-});