@portaki/module-sdk 0.2.1 → 0.2.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.
Files changed (49) hide show
  1. package/dist/components/CopyButton.d.ts +8 -0
  2. package/dist/components/CopyButton.d.ts.map +1 -0
  3. package/dist/components/CopyButton.js +25 -0
  4. package/dist/components/ExternalLink.d.ts +8 -0
  5. package/dist/components/ExternalLink.d.ts.map +1 -0
  6. package/dist/components/ExternalLink.js +11 -0
  7. package/dist/components/GoogleMapsButton.d.ts +8 -0
  8. package/dist/components/GoogleMapsButton.d.ts.map +1 -0
  9. package/dist/components/GoogleMapsButton.js +17 -0
  10. package/dist/components/ModuleCard.d.ts +7 -0
  11. package/dist/components/ModuleCard.d.ts.map +1 -0
  12. package/dist/components/ModuleCard.js +11 -0
  13. package/dist/components/ModuleConfigAlert.d.ts +8 -0
  14. package/dist/components/ModuleConfigAlert.d.ts.map +1 -0
  15. package/dist/components/ModuleConfigAlert.js +48 -0
  16. package/dist/components/ModuleEmpty.d.ts +5 -0
  17. package/dist/components/ModuleEmpty.d.ts.map +1 -0
  18. package/dist/components/ModuleEmpty.js +4 -0
  19. package/dist/components/ModuleError.d.ts +6 -0
  20. package/dist/components/ModuleError.d.ts.map +1 -0
  21. package/dist/components/ModuleError.js +4 -0
  22. package/dist/components/ModuleLoading.d.ts +2 -0
  23. package/dist/components/ModuleLoading.d.ts.map +1 -0
  24. package/dist/components/ModuleLoading.js +10 -0
  25. package/dist/components/ModuleSection.d.ts +8 -0
  26. package/dist/components/ModuleSection.d.ts.map +1 -0
  27. package/dist/components/ModuleSection.js +11 -0
  28. package/dist/components/WazeButton.d.ts +8 -0
  29. package/dist/components/WazeButton.d.ts.map +1 -0
  30. package/dist/components/WazeButton.js +17 -0
  31. package/dist/components/index.d.ts +11 -0
  32. package/dist/components/index.d.ts.map +1 -0
  33. package/dist/components/index.js +10 -0
  34. package/dist/hooks/useTracking.d.ts +11 -0
  35. package/dist/hooks/useTracking.d.ts.map +1 -0
  36. package/dist/hooks/useTracking.js +17 -0
  37. package/dist/index.d.ts +9 -31
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +3 -3
  40. package/dist/types/config.d.ts +46 -0
  41. package/dist/types/config.d.ts.map +1 -0
  42. package/dist/types/config.js +1 -0
  43. package/dist/types/legacy.d.ts +28 -0
  44. package/dist/types/legacy.d.ts.map +1 -0
  45. package/dist/types/legacy.js +1 -0
  46. package/dist/types/module.d.ts +72 -0
  47. package/dist/types/module.d.ts.map +1 -0
  48. package/dist/types/module.js +6 -0
  49. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface CopyButtonProps {
3
+ text: string;
4
+ children?: ReactNode;
5
+ className?: string;
6
+ }
7
+ export declare function CopyButton({ text, children, className }: CopyButtonProps): import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=CopyButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyButton.d.ts","sourceRoot":"","sources":["../../src/components/CopyButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,2CA+BxE"}
@@ -0,0 +1,25 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useCallback, useState } from 'react';
4
+ export function CopyButton({ text, children, className }) {
5
+ const [done, setDone] = useState(false);
6
+ const onClick = useCallback(async () => {
7
+ try {
8
+ await navigator.clipboard.writeText(text);
9
+ setDone(true);
10
+ window.setTimeout(() => setDone(false), 2000);
11
+ }
12
+ catch {
13
+ setDone(false);
14
+ }
15
+ }, [text]);
16
+ return (_jsx("button", { type: "button", className: className, onClick: onClick, style: {
17
+ fontSize: '13px',
18
+ fontWeight: 600,
19
+ padding: '6px 10px',
20
+ borderRadius: '8px',
21
+ border: '1px solid color-mix(in srgb, var(--color-muted, #71717a) 35%, transparent)',
22
+ background: 'var(--color-surface, #fff)',
23
+ cursor: 'pointer',
24
+ }, children: done ? 'Copié ✓' : children ?? 'Copier' }));
25
+ }
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface ExternalLinkProps {
3
+ href: string;
4
+ children: ReactNode;
5
+ className?: string;
6
+ }
7
+ export declare function ExternalLink({ href, children, className }: ExternalLinkProps): import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=ExternalLink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExternalLink.d.ts","sourceRoot":"","sources":["../../src/components/ExternalLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,iBAAiB,2CAsB5E"}
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function ExternalLink({ href, children, className }) {
3
+ return (_jsxs("a", { href: href, target: "_blank", rel: "noopener noreferrer", className: className, style: {
4
+ display: 'inline-flex',
5
+ alignItems: 'center',
6
+ gap: '6px',
7
+ fontSize: '14px',
8
+ fontWeight: 600,
9
+ color: 'var(--color-secondary, #2b7fbf)',
10
+ }, children: [_jsx("span", { "aria-hidden": true, style: { fontSize: '12px' }, children: "\u2197" }), children] }));
11
+ }
@@ -0,0 +1,8 @@
1
+ export interface GoogleMapsButtonProps {
2
+ lat: number;
3
+ lng: number;
4
+ label?: string;
5
+ className?: string;
6
+ }
7
+ export declare function GoogleMapsButton({ lat, lng, label, className, }: GoogleMapsButtonProps): import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=GoogleMapsButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoogleMapsButton.d.ts","sourceRoot":"","sources":["../../src/components/GoogleMapsButton.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,GAAG,EACH,GAAG,EACH,KAAqB,EACrB,SAAS,GACV,EAAE,qBAAqB,2CAwBvB"}
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ export function GoogleMapsButton({ lat, lng, label = 'Google Maps', className, }) {
4
+ const url = `https://www.google.com/maps/search/?api=1&query=${lat},${lng}`;
5
+ return (_jsx("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: className, style: {
6
+ display: 'inline-flex',
7
+ alignItems: 'center',
8
+ gap: '8px',
9
+ padding: '10px 14px',
10
+ borderRadius: '12px',
11
+ fontWeight: 600,
12
+ fontSize: '14px',
13
+ background: 'color-mix(in srgb, var(--color-primary, #e8724a) 14%, white)',
14
+ color: 'var(--color-text, #18181b)',
15
+ textDecoration: 'none',
16
+ }, children: label }));
17
+ }
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface ModuleCardProps {
3
+ children: ReactNode;
4
+ className?: string;
5
+ }
6
+ export declare function ModuleCard({ children, className }: ModuleCardProps): import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=ModuleCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModuleCard.d.ts","sourceRoot":"","sources":["../../src/components/ModuleCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,2CAgBlE"}
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function ModuleCard({ children, className }) {
3
+ return (_jsx("div", { className: className, style: {
4
+ borderRadius: '16px',
5
+ border: '1px solid color-mix(in srgb, var(--color-secondary, #2b7fbf) 18%, transparent)',
6
+ background: 'color-mix(in srgb, var(--color-surface, #fff) 92%, transparent)',
7
+ boxShadow: 'var(--shadow-card, 0 8px 32px rgba(9, 9, 11, 0.08))',
8
+ backdropFilter: 'blur(12px)',
9
+ padding: '20px 22px',
10
+ }, children: children }));
11
+ }
@@ -0,0 +1,8 @@
1
+ import type { LangCode } from '../types/module';
2
+ import type { ModuleConfigAlert as ModuleConfigAlertSpec } from '../types/config';
3
+ export interface ModuleConfigAlertProps {
4
+ alert: ModuleConfigAlertSpec;
5
+ lang: LangCode;
6
+ }
7
+ export declare function ModuleConfigAlert({ alert, lang }: ModuleConfigAlertProps): import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=ModuleConfigAlert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModuleConfigAlert.d.ts","sourceRoot":"","sources":["../../src/components/ModuleConfigAlert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAEjF,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,qBAAqB,CAAA;IAC5B,IAAI,EAAE,QAAQ,CAAA;CACf;AASD,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,sBAAsB,2CA+DxE"}
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ const ICON = {
3
+ info: 'ⓘ',
4
+ warning: '⚠',
5
+ error: '!',
6
+ success: '✓',
7
+ };
8
+ export function ModuleConfigAlert({ alert, lang }) {
9
+ const colors = {
10
+ info: {
11
+ bg: 'rgba(43,127,191,0.08)',
12
+ border: '#2B7FBF',
13
+ text: '#1e40af',
14
+ },
15
+ warning: {
16
+ bg: 'rgba(245,158,11,0.08)',
17
+ border: '#F59E0B',
18
+ text: '#92400e',
19
+ },
20
+ error: {
21
+ bg: 'rgba(239,68,68,0.08)',
22
+ border: '#EF4444',
23
+ text: '#991b1b',
24
+ },
25
+ success: {
26
+ bg: 'rgba(132,204,22,0.08)',
27
+ border: '#84CC16',
28
+ text: '#3f6212',
29
+ },
30
+ };
31
+ const c = colors[alert.type];
32
+ return (_jsxs("div", { style: {
33
+ background: c.bg,
34
+ border: `1px solid ${c.border}`,
35
+ borderRadius: '8px',
36
+ padding: '10px 12px',
37
+ display: 'flex',
38
+ gap: '8px',
39
+ alignItems: 'flex-start',
40
+ marginTop: '8px',
41
+ }, children: [_jsx("span", { style: { flexShrink: 0, marginTop: '2px', fontSize: '14px' }, "aria-hidden": true, children: ICON[alert.type] }), _jsxs("div", { children: [_jsx("p", { style: { fontSize: '13px', color: c.text, lineHeight: 1.5 }, children: alert.message[lang] }), alert.helpUrl ? (_jsx("a", { href: alert.helpUrl, target: "_blank", rel: "noopener noreferrer", style: {
42
+ fontSize: '12px',
43
+ color: c.border,
44
+ textDecoration: 'underline',
45
+ marginTop: '4px',
46
+ display: 'inline-block',
47
+ }, children: "En savoir plus \u2192" })) : null] })] }));
48
+ }
@@ -0,0 +1,5 @@
1
+ export interface ModuleEmptyProps {
2
+ message?: string;
3
+ }
4
+ export declare function ModuleEmpty({ message }: ModuleEmptyProps): import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=ModuleEmpty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModuleEmpty.d.ts","sourceRoot":"","sources":["../../src/components/ModuleEmpty.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,wBAAgB,WAAW,CAAC,EAAE,OAAyC,EAAE,EAAE,gBAAgB,2CAI1F"}
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function ModuleEmpty({ message = 'Aucun contenu pour le moment.' }) {
3
+ return (_jsx("p", { style: { fontSize: '14px', color: 'var(--color-muted, #71717a)' }, children: message }));
4
+ }
@@ -0,0 +1,6 @@
1
+ export interface ModuleErrorProps {
2
+ title?: string;
3
+ message?: string;
4
+ }
5
+ export declare function ModuleError({ title, message, }: ModuleErrorProps): import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=ModuleError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModuleError.d.ts","sourceRoot":"","sources":["../../src/components/ModuleError.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,wBAAgB,WAAW,CAAC,EAC1B,KAAgB,EAChB,OAA4C,GAC7C,EAAE,gBAAgB,2CAQlB"}
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function ModuleError({ title = 'Erreur', message = 'Impossible de charger ce module.', }) {
3
+ return (_jsxs("p", { style: { fontSize: '14px', color: 'var(--color-muted, #71717a)' }, children: [_jsx("strong", { style: { color: 'var(--color-text, #18181b)' }, children: title }), ' · ', message] }));
4
+ }
@@ -0,0 +1,2 @@
1
+ export declare function ModuleLoading(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=ModuleLoading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModuleLoading.d.ts","sourceRoot":"","sources":["../../src/components/ModuleLoading.tsx"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,4CAiB5B"}
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function ModuleLoading() {
3
+ return (_jsx("div", { "aria-busy": true, "aria-label": "Chargement", style: {
4
+ height: '120px',
5
+ borderRadius: '12px',
6
+ background: 'linear-gradient(90deg, rgba(9,9,11,0.06) 25%, rgba(9,9,11,0.12) 37%, rgba(9,9,11,0.06) 63%)',
7
+ backgroundSize: '400% 100%',
8
+ animation: 'portaki-shimmer 1.2s ease-in-out infinite',
9
+ }, children: _jsx("style", { children: `@keyframes portaki-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }` }) }));
10
+ }
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface ModuleSectionProps {
3
+ title: string;
4
+ children: ReactNode;
5
+ className?: string;
6
+ }
7
+ export declare function ModuleSection({ title, children, className }: ModuleSectionProps): import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=ModuleSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModuleSection.d.ts","sourceRoot":"","sources":["../../src/components/ModuleSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,kBAAkB,2CAkB/E"}
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function ModuleSection({ title, children, className }) {
3
+ return (_jsxs("section", { className: className, style: { padding: '24px 0' }, children: [_jsx("h2", { style: {
4
+ fontFamily: 'var(--brand-font-heading, var(--font-cal))',
5
+ fontSize: '22px',
6
+ fontWeight: 600,
7
+ color: 'var(--brand-color, var(--text))',
8
+ marginBottom: '16px',
9
+ letterSpacing: '-0.02em',
10
+ }, children: title }), children] }));
11
+ }
@@ -0,0 +1,8 @@
1
+ export interface WazeButtonProps {
2
+ lat: number;
3
+ lng: number;
4
+ label?: string;
5
+ className?: string;
6
+ }
7
+ export declare function WazeButton({ lat, lng, label, className }: WazeButtonProps): import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=WazeButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WazeButton.d.ts","sourceRoot":"","sources":["../../src/components/WazeButton.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,UAAU,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,KAAc,EAAE,SAAS,EAAE,EAAE,eAAe,2CAwBlF"}
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ export function WazeButton({ lat, lng, label = 'Waze', className }) {
4
+ const url = `https://waze.com/ul?ll=${lat},${lng}&navigate=yes`;
5
+ return (_jsx("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: className, style: {
6
+ display: 'inline-flex',
7
+ alignItems: 'center',
8
+ gap: '8px',
9
+ padding: '10px 14px',
10
+ borderRadius: '12px',
11
+ fontWeight: 600,
12
+ fontSize: '14px',
13
+ background: 'color-mix(in srgb, #33ccff 18%, white)',
14
+ color: '#0369a1',
15
+ textDecoration: 'none',
16
+ }, children: label }));
17
+ }
@@ -0,0 +1,11 @@
1
+ export { ModuleSection } from './ModuleSection';
2
+ export { ModuleCard } from './ModuleCard';
3
+ export { ModuleLoading } from './ModuleLoading';
4
+ export { ModuleError } from './ModuleError';
5
+ export { ModuleEmpty } from './ModuleEmpty';
6
+ export { CopyButton } from './CopyButton';
7
+ export { ExternalLink } from './ExternalLink';
8
+ export { WazeButton } from './WazeButton';
9
+ export { GoogleMapsButton } from './GoogleMapsButton';
10
+ export { ModuleConfigAlert } from './ModuleConfigAlert';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA"}
@@ -0,0 +1,10 @@
1
+ export { ModuleSection } from './ModuleSection';
2
+ export { ModuleCard } from './ModuleCard';
3
+ export { ModuleLoading } from './ModuleLoading';
4
+ export { ModuleError } from './ModuleError';
5
+ export { ModuleEmpty } from './ModuleEmpty';
6
+ export { CopyButton } from './CopyButton';
7
+ export { ExternalLink } from './ExternalLink';
8
+ export { WazeButton } from './WazeButton';
9
+ export { GoogleMapsButton } from './GoogleMapsButton';
10
+ export { ModuleConfigAlert } from './ModuleConfigAlert';
@@ -0,0 +1,11 @@
1
+ import type { TrackingEvent } from '../types/module';
2
+ export interface UseTrackingOptions {
3
+ stayId: string;
4
+ moduleId: string;
5
+ tenantSlug: string;
6
+ accessCode: string;
7
+ }
8
+ export declare function useTracking({ stayId, moduleId, tenantSlug, accessCode, }: UseTrackingOptions): {
9
+ track: (event: TrackingEvent) => void;
10
+ };
11
+ //# sourceMappingURL=useTracking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTracking.d.ts","sourceRoot":"","sources":["../../src/hooks/useTracking.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,QAAQ,EACR,UAAU,EACV,UAAU,GACX,EAAE,kBAAkB;mBAET,aAAa;EAgBxB"}
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+ import { useCallback } from 'react';
3
+ export function useTracking({ stayId, moduleId, tenantSlug, accessCode, }) {
4
+ const track = useCallback((event) => {
5
+ void fetch(`/api/v1/guest/${encodeURIComponent(tenantSlug)}/${encodeURIComponent(accessCode)}/track`, {
6
+ method: 'POST',
7
+ headers: { 'Content-Type': 'application/json' },
8
+ body: JSON.stringify({
9
+ eventType: `module_${event.type}`,
10
+ moduleId,
11
+ metadata: { label: event.label, stayId, ...event.metadata },
12
+ }),
13
+ keepalive: true,
14
+ }).catch(() => { });
15
+ }, [stayId, moduleId, tenantSlug, accessCode]);
16
+ return { track };
17
+ }
package/dist/index.d.ts CHANGED
@@ -1,35 +1,13 @@
1
- import type { ReactNode } from 'react';
2
- export type LangCode = 'fr' | 'en';
3
- export interface PortakiGuestProperty {
4
- id: string;
5
- trainStationCode?: string;
6
- checklistItems?: readonly {
7
- id: string;
8
- labelFr: string;
9
- labelEn: string;
10
- }[];
11
- }
12
- export interface PortakiGuestStay {
13
- id: string;
14
- }
15
- export interface PortakiRenderContext {
16
- property: PortakiGuestProperty;
17
- stay?: PortakiGuestStay;
18
- lang: LangCode;
19
- }
20
- export interface PortakiModuleDefinition {
21
- id: string;
22
- label: Record<string, string>;
23
- icon: string;
24
- navSlot?: 'section' | 'bottom-bar' | 'poi-overlay';
25
- mapOverlay?: boolean;
26
- visibleOnStatus?: readonly string[];
27
- render: (ctx: PortakiRenderContext) => ReactNode;
28
- mapMarkers?: (ctx: PortakiRenderContext) => Promise<unknown[]>;
29
- }
30
- export declare function definePortakiModule(def: PortakiModuleDefinition): PortakiModuleDefinition;
1
+ export type { LangCode } from './types/module';
2
+ export type { StayData, PropertyData, TrackingEvent, ModuleContext, MapMarker, PortakiModuleDefinition, PortakiModuleDefinitionInput, NavSlot, StayStatus, } from './types/module';
3
+ export { definePortakiModule } from './types/module';
4
+ export type { ModuleConfigFieldType, ModuleConfigAlert as ModuleConfigAlertSpec, ModuleConfigField, ModuleConfigSchema, } from './types/config';
5
+ export type { PortakiGuestProperty, PortakiGuestStay, PortakiRenderContext } from './types/legacy';
6
+ export { useTracking } from './hooks/useTracking';
7
+ export type { UseTrackingOptions } from './hooks/useTracking';
8
+ export { ModuleSection, ModuleCard, ModuleLoading, ModuleError, ModuleEmpty, CopyButton, ExternalLink, WazeButton, GoogleMapsButton, ModuleConfigAlert, } from './components';
31
9
  /** Chargement dynamique du module par défaut (`definePortakiModule`). */
32
10
  export type PortakiModuleLoader = () => Promise<{
33
- default: PortakiModuleDefinition;
11
+ default: import('./types/module').PortakiModuleDefinition;
34
12
  }>;
35
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,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mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,YAAY,EACV,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,aAAa,EACb,SAAS,EACT,uBAAuB,EACvB,4BAA4B,EAC5B,OAAO,EACP,UAAU,GACX,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAEpD,YAAY,EACV,qBAAqB,EACrB,iBAAiB,IAAI,qBAAqB,EAC1C,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,gBAAgB,CAAA;AAEvB,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAElG,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAE7D,OAAO,EACL,aAAa,EACb,UAAU,EACV,aAAa,EACb,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,cAAc,CAAA;AAErB,yEAAyE;AACzE,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,CAAC;IAC9C,OAAO,EAAE,OAAO,gBAAgB,EAAE,uBAAuB,CAAA;CAC1D,CAAC,CAAA"}
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export function definePortakiModule(def) {
2
- return def;
3
- }
1
+ export { definePortakiModule } from './types/module';
2
+ export { useTracking } from './hooks/useTracking';
3
+ export { ModuleSection, ModuleCard, ModuleLoading, ModuleError, ModuleEmpty, CopyButton, ExternalLink, WazeButton, GoogleMapsButton, ModuleConfigAlert, } from './components';
@@ -0,0 +1,46 @@
1
+ export type ModuleConfigFieldType = 'text' | 'secret' | 'select' | 'toggle' | 'number' | 'url' | 'textarea';
2
+ export interface ModuleConfigAlert {
3
+ type: 'info' | 'warning' | 'error' | 'success';
4
+ message: {
5
+ fr: string;
6
+ en: string;
7
+ };
8
+ helpUrl?: string;
9
+ }
10
+ export interface ModuleConfigField {
11
+ key: string;
12
+ label: {
13
+ fr: string;
14
+ en: string;
15
+ };
16
+ description?: {
17
+ fr: string;
18
+ en: string;
19
+ };
20
+ type: ModuleConfigFieldType;
21
+ required: boolean;
22
+ default?: string | boolean | number;
23
+ placeholder?: {
24
+ fr: string;
25
+ en: string;
26
+ };
27
+ options?: Array<{
28
+ value: string;
29
+ label: {
30
+ fr: string;
31
+ en: string;
32
+ };
33
+ }>;
34
+ min?: number;
35
+ max?: number;
36
+ /** Runtime-only validation for modules defined in TypeScript code */
37
+ validation?: RegExp;
38
+ /** Serializable pattern for HTTP/registry-backed schemas */
39
+ validationPattern?: string;
40
+ alert?: ModuleConfigAlert;
41
+ }
42
+ export interface ModuleConfigSchema {
43
+ fields: ModuleConfigField[];
44
+ globalAlert?: ModuleConfigAlert;
45
+ }
46
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAC7B,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,UAAU,CAAA;AAEd,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;IAC9C,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IACnC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IACjC,WAAW,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,IAAI,EAAE,qBAAqB,CAAA;IAC3B,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;IACnC,WAAW,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,EAAE,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC,CAAA;IACrE,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,4DAA4D;IAC5D,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,KAAK,CAAC,EAAE,iBAAiB,CAAA;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,iBAAiB,EAAE,CAAA;IAC3B,WAAW,CAAC,EAAE,iBAAiB,CAAA;CAChC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,28 @@
1
+ import type { LangCode } from './module';
2
+ /**
3
+ * @deprecated Prefer {@link ModuleContext} — kept for gradual migration of loaders.
4
+ */
5
+ export interface PortakiGuestProperty {
6
+ id: string;
7
+ trainStationCode?: string;
8
+ checklistItems?: readonly {
9
+ id: string;
10
+ labelFr: string;
11
+ labelEn: string;
12
+ }[];
13
+ }
14
+ /**
15
+ * @deprecated Prefer {@link ModuleContext}
16
+ */
17
+ export interface PortakiGuestStay {
18
+ id: string;
19
+ }
20
+ /**
21
+ * @deprecated Prefer {@link ModuleContext}
22
+ */
23
+ export interface PortakiRenderContext {
24
+ property: PortakiGuestProperty;
25
+ stay?: PortakiGuestStay;
26
+ lang: LangCode;
27
+ }
28
+ //# sourceMappingURL=legacy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy.d.ts","sourceRoot":"","sources":["../../src/types/legacy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,cAAc,CAAC,EAAE,SAAS;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAC7E;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;CACX;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,oBAAoB,CAAA;IAC9B,IAAI,CAAC,EAAE,gBAAgB,CAAA;IACvB,IAAI,EAAE,QAAQ,CAAA;CACf"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,72 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ModuleConfigSchema } from './config';
3
+ export type LangCode = 'fr' | 'en';
4
+ export type NavSlot = 'section' | 'bottom-bar' | 'poi-overlay';
5
+ export type StayStatus = 'PRE_ARRIVAL' | 'UPCOMING' | 'ACTIVE' | 'COMPLETED';
6
+ export interface StayData {
7
+ id: string;
8
+ guestName: string;
9
+ guestLang: string;
10
+ checkinAt: string;
11
+ checkoutAt: string;
12
+ accessCode: string;
13
+ status: string;
14
+ }
15
+ export interface PropertyData {
16
+ id: string;
17
+ trainStationCode?: string;
18
+ checklistItems?: readonly {
19
+ id: string;
20
+ labelFr: string;
21
+ labelEn: string;
22
+ }[];
23
+ name?: string;
24
+ slug?: string;
25
+ address?: string;
26
+ }
27
+ export interface TrackingEvent {
28
+ type: 'click' | 'view' | 'action';
29
+ label: string;
30
+ metadata?: Record<string, unknown>;
31
+ }
32
+ export interface ModuleContext {
33
+ stay: StayData;
34
+ property: PropertyData;
35
+ lang: LangCode;
36
+ config: Record<string, string | boolean | number>;
37
+ track: (event: TrackingEvent) => void;
38
+ }
39
+ export interface MapMarker {
40
+ id: string;
41
+ lat: number;
42
+ lng: number;
43
+ title?: string;
44
+ }
45
+ export interface PortakiModuleDefinition {
46
+ id: string;
47
+ label: {
48
+ fr: string;
49
+ en: string;
50
+ };
51
+ description: {
52
+ fr: string;
53
+ en: string;
54
+ };
55
+ icon: string;
56
+ version: string;
57
+ author?: string;
58
+ navSlot: NavSlot;
59
+ defaultNavLabel?: {
60
+ fr: string;
61
+ en: string;
62
+ };
63
+ defaultNavIcon?: string;
64
+ visibleOnStatus?: StayStatus[];
65
+ mapOverlay?: boolean;
66
+ config?: ModuleConfigSchema;
67
+ render: (ctx: ModuleContext) => ReactNode;
68
+ mapMarkers?: (ctx: Omit<ModuleContext, 'track'>) => Promise<MapMarker[]>;
69
+ }
70
+ export type PortakiModuleDefinitionInput = Partial<Pick<PortakiModuleDefinition, 'description' | 'version' | 'navSlot'>> & Pick<PortakiModuleDefinition, 'id' | 'label' | 'icon' | 'render'> & Omit<PortakiModuleDefinition, 'id' | 'label' | 'icon' | 'render' | 'description' | 'version' | 'navSlot'>;
71
+ export declare function definePortakiModule(def: PortakiModuleDefinitionInput): PortakiModuleDefinition;
72
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/types/module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAElD,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAA;AAElC,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,YAAY,GAAG,aAAa,CAAA;AAE9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 @@
1
+ export function definePortakiModule(def) {
2
+ const description = def.description ?? { fr: '', en: '' };
3
+ const version = def.version ?? '0.1.0';
4
+ const navSlot = def.navSlot ?? 'section';
5
+ return { ...def, description, version, navSlot };
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portaki/module-sdk",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Portaki guest modules SDK for React / Next.js",
5
5
  "license": "MIT",
6
6
  "type": "module",