@flowselections/floriday-afhandeling-module 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist-lib/_core-safelist.d.ts +2 -0
  2. package/dist-lib/_core-safelist.d.ts.map +1 -0
  3. package/dist-lib/_core-safelist.js +18 -0
  4. package/dist-lib/components/TemplatePage.d.ts +2 -0
  5. package/dist-lib/components/TemplatePage.d.ts.map +1 -0
  6. package/dist-lib/components/TemplatePage.js +4 -0
  7. package/dist-lib/components/settings/MijnModuleSettingsCard.d.ts +2 -0
  8. package/dist-lib/components/settings/MijnModuleSettingsCard.d.ts.map +1 -0
  9. package/dist-lib/components/settings/MijnModuleSettingsCard.js +42 -0
  10. package/dist-lib/hooks/useMijnModuleData.d.ts +13 -0
  11. package/dist-lib/hooks/useMijnModuleData.d.ts.map +1 -0
  12. package/dist-lib/hooks/useMijnModuleData.js +49 -0
  13. package/dist-lib/index.d.ts +5 -0
  14. package/dist-lib/index.d.ts.map +1 -0
  15. package/dist-lib/index.js +17 -0
  16. package/dist-lib/integrations/supabase/auth-attacher.d.ts +2 -0
  17. package/dist-lib/integrations/supabase/auth-attacher.d.ts.map +1 -0
  18. package/dist-lib/integrations/supabase/auth-attacher.js +12 -0
  19. package/dist-lib/integrations/supabase/auth-middleware.d.ts +1560 -0
  20. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -0
  21. package/dist-lib/integrations/supabase/auth-middleware.js +52 -0
  22. package/dist-lib/integrations/supabase/client.d.ts +1556 -0
  23. package/dist-lib/integrations/supabase/client.d.ts.map +1 -0
  24. package/dist-lib/integrations/supabase/client.js +13 -0
  25. package/dist-lib/integrations/supabase/client.server.d.ts +1556 -0
  26. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -0
  27. package/dist-lib/integrations/supabase/client.server.js +30 -0
  28. package/dist-lib/integrations/supabase/types.d.ts +1656 -0
  29. package/dist-lib/integrations/supabase/types.d.ts.map +1 -0
  30. package/dist-lib/integrations/supabase/types.js +8 -0
  31. package/dist-lib/lib/floriday.functions.d.ts +1572 -0
  32. package/dist-lib/lib/floriday.functions.d.ts.map +1 -0
  33. package/dist-lib/lib/floriday.functions.js +125 -0
  34. package/dist-lib/lib/utils.d.ts +3 -0
  35. package/dist-lib/lib/utils.d.ts.map +1 -0
  36. package/dist-lib/lib/utils.js +5 -0
  37. package/dist-lib/lib/validationSchemas.d.ts +15 -0
  38. package/dist-lib/lib/validationSchemas.d.ts.map +1 -0
  39. package/dist-lib/lib/validationSchemas.js +25 -0
  40. package/dist-lib/styles.css +1 -0
  41. package/package.json +66 -0
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=_core-safelist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_core-safelist.d.ts","sourceRoot":"","sources":["../src/_core-safelist.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,CAAC"}
@@ -0,0 +1,18 @@
1
+ // Forceert Tailwind classes die uit @flowselections/core komen of dynamisch
2
+ // opgebouwd worden, maar niet voorkomen in de eigen broncode.
3
+ const _safelist = [
4
+ // Layout — Sidebar en shell structuur
5
+ 'h-full', 'flex-col', 'flex-1', 'min-h-screen', 'ml-64', 'pt-16',
6
+ 'items-start', 'items-center', 'justify-between', 'border-t',
7
+ 'w-64', 'h-screen', 'h-20', 'overflow-y-auto',
8
+ // Grid — InstellingenPage
9
+ 'grid', 'lg:grid-cols-2', 'gap-6', 'p-6', 'space-y-6',
10
+ // Toggle/Switch
11
+ 'data-[state=checked]:bg-primary', 'data-[state=unchecked]:bg-input',
12
+ // Statusbadges (dynamisch opgebouwd in leveringen-tabel)
13
+ 'bg-green-500/10', 'text-green-600',
14
+ 'bg-amber-500/10', 'text-amber-600',
15
+ 'bg-red-500/10', 'text-red-600',
16
+ 'bg-blue-500/10', 'text-blue-600',
17
+ ];
18
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function TemplatePage(): import("react").JSX.Element;
2
+ //# sourceMappingURL=TemplatePage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplatePage.d.ts","sourceRoot":"","sources":["../../src/components/TemplatePage.tsx"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,gCAS3B"}
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function TemplatePage() {
3
+ return (_jsxs("div", { className: "p-6", children: [_jsx("h1", { className: "text-2xl font-semibold", children: "Module pagina" }), _jsx("p", { className: "text-muted-foreground mt-2", children: "Vervang dit component met de pagina's van jouw module." })] }));
4
+ }
@@ -0,0 +1,2 @@
1
+ export declare function MijnModuleSettingsCard(): import("react").JSX.Element;
2
+ //# sourceMappingURL=MijnModuleSettingsCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MijnModuleSettingsCard.d.ts","sourceRoot":"","sources":["../../../src/components/settings/MijnModuleSettingsCard.tsx"],"names":[],"mappings":"AAiCA,wBAAgB,sBAAsB,gCA+CrC"}
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // ============================================================================
3
+ // src/components/settings/MijnModuleSettingsCard.tsx — EXAMPLE SETTINGS CARD
4
+ // ============================================================================
5
+ // This is an example of a settings card for your module.
6
+ // It appears on the main settings page when registered in src/index.ts.
7
+ //
8
+ // RULES:
9
+ // - Must return a <Card> as its root element
10
+ // - Handles its own data fetching — no props are passed by the core
11
+ // - Use the same Card primitives from @flowselections/core
12
+ //
13
+ // WHAT TO DO:
14
+ // - Rename this file to match your card's purpose
15
+ // - Add your real settings UI
16
+ // - Register it in src/index.ts under settingsCards
17
+ // - Delete this file entirely if your module has no settings
18
+ // ============================================================================
19
+ import { useState } from "react";
20
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle, Button, Input, Label, toast, } from "@flowselections/core";
21
+ import { Settings2 } from "lucide-react";
22
+ export function MijnModuleSettingsCard() {
23
+ // Replace with your real settings state
24
+ const [setting, setSetting] = useState("");
25
+ const [saving, setSaving] = useState(false);
26
+ const handleSave = async () => {
27
+ setSaving(true);
28
+ try {
29
+ // Example: save to a table — replace with your real query
30
+ // const { error } = await supabase.from("my_settings").upsert({ ... });
31
+ // if (error) throw error;
32
+ toast.success("Instellingen opgeslagen");
33
+ }
34
+ catch {
35
+ toast.error("Fout bij het opslaan");
36
+ }
37
+ finally {
38
+ setSaving(false);
39
+ }
40
+ };
41
+ return (_jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Settings2, { className: "h-5 w-5 text-primary" }), _jsx(CardTitle, { children: "Module Instellingen" }), " "] }), _jsx(CardDescription, { children: "Beheer de instellingen voor deze module " })] }), _jsxs(CardContent, { className: "space-y-4", children: [_jsxs("div", { className: "space-y-2", children: [_jsx(Label, { htmlFor: "setting", children: "Instelling" }), _jsx(Input, { id: "setting", value: setting, onChange: (e) => setSetting(e.target.value), placeholder: "Waarde..." })] }), _jsx(Button, { onClick: handleSave, disabled: saving, children: saving ? "Opslaan..." : "Opslaan" })] })] }));
42
+ }
@@ -0,0 +1,13 @@
1
+ interface MijnItem {
2
+ id: string;
3
+ created_at: string;
4
+ [key: string]: unknown;
5
+ }
6
+ export declare function useMijnModuleData(): {
7
+ items: MijnItem[];
8
+ loading: boolean;
9
+ error: string | null;
10
+ reload: () => Promise<void>;
11
+ };
12
+ export {};
13
+ //# sourceMappingURL=useMijnModuleData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMijnModuleData.d.ts","sourceRoot":"","sources":["../../src/hooks/useMijnModuleData.ts"],"names":[],"mappings":"AAkBA,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,wBAAgB,iBAAiB;;;;;EAkChC"}
@@ -0,0 +1,49 @@
1
+ // ============================================================================
2
+ // src/hooks/useMijnModuleData.ts — EXAMPLE DATA HOOK
3
+ // ============================================================================
4
+ // Put your data fetching logic in hooks like this, not directly in components.
5
+ // This keeps your pages clean and makes it easy to reuse data across pages.
6
+ //
7
+ // WHAT TO DO:
8
+ // - Rename to match your data (e.g. useProducts, useOrders, useSuppliers)
9
+ // - Replace the example query with your real Supabase query
10
+ // - Replace MijnItem with your actual table's row type
11
+ // - Import and use in your page components
12
+ // - Delete this file if you prefer a different pattern
13
+ // ============================================================================
14
+ import { useState, useEffect, useCallback } from "react";
15
+ import { supabase, toast } from "@flowselections/core";
16
+ export function useMijnModuleData() {
17
+ const [items, setItems] = useState([]);
18
+ const [loading, setLoading] = useState(true);
19
+ const [error, setError] = useState(null);
20
+ const load = useCallback(async () => {
21
+ setLoading(true);
22
+ setError(null);
23
+ try {
24
+ const { data, error } = await supabase
25
+ .from("products") // ← CHANGE THIS to your table
26
+ .select("*")
27
+ .order("created_at", { ascending: false });
28
+ if (error)
29
+ throw error;
30
+ setItems(data ?? []);
31
+ }
32
+ catch {
33
+ setError("Fout bij het laden van gegevens");
34
+ toast.error("Fout bij het laden van gegevens");
35
+ }
36
+ finally {
37
+ setLoading(false);
38
+ }
39
+ }, []);
40
+ useEffect(() => {
41
+ load();
42
+ }, [load]);
43
+ return {
44
+ items,
45
+ loading,
46
+ error,
47
+ reload: load,
48
+ };
49
+ }
@@ -0,0 +1,5 @@
1
+ import type { FlowModule } from "@flowselections/core";
2
+ export * from "./_core-safelist";
3
+ export * from "./components/TemplatePage";
4
+ export declare const myModule: FlowModule;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAE1C,eAAO,MAAM,QAAQ,EAAE,UAatB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { PackageCheck, Truck } from "lucide-react";
2
+ export * from "./_core-safelist";
3
+ export * from "./components/TemplatePage";
4
+ export const myModule = {
5
+ id: "afhandeling",
6
+ name: "Afhandeling",
7
+ version: "1.0.0",
8
+ nav: {
9
+ label: "Afhandeling",
10
+ href: "/afhandeling/leveringen",
11
+ icon: PackageCheck,
12
+ children: [
13
+ { label: "Leveringen", href: "/afhandeling/leveringen", icon: Truck },
14
+ ],
15
+ },
16
+ settingsCards: [],
17
+ };
@@ -0,0 +1,2 @@
1
+ export declare const attachSupabaseAuth: import("@tanstack/start-client-core").FunctionMiddlewareAfterClient<{}, unknown, undefined, undefined, undefined>;
2
+ //# sourceMappingURL=auth-attacher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-attacher.d.ts","sourceRoot":"","sources":["../../../src/integrations/supabase/auth-attacher.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB,mHAQ9B,CAAA"}
@@ -0,0 +1,12 @@
1
+ // This file is automatically generated. Do not edit it directly.
2
+ import { createMiddleware } from '@tanstack/react-start';
3
+ import { supabase } from './client';
4
+ // Must be registered as a global `functionMiddleware` in `src/start.ts`; otherwise
5
+ // the browser never attaches the bearer token to serverFn RPCs.
6
+ export const attachSupabaseAuth = createMiddleware({ type: 'function' }).client(async ({ next }) => {
7
+ const { data } = await supabase.auth.getSession();
8
+ const token = data.session?.access_token;
9
+ return next({
10
+ headers: token ? { Authorization: `Bearer ${token}` } : {},
11
+ });
12
+ });