dh-remixer-sdk 0.0.34 → 0.0.35-0fafa3b

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dh-remixer-sdk",
3
- "version": "0.0.34",
3
+ "version": "0.0.35-0fafa3b",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "templates",
@@ -0,0 +1,87 @@
1
+ import { createContext, useContext, useEffect, useState, ReactNode } from "react";
2
+
3
+ type LocaleDict = Record<string, string>;
4
+
5
+ // All locale JSON is bundled at build time and merged into one dictionary per language.
6
+ //
7
+ // New layout: mirrored per-source-file files under assets/locales/<lang>/** (keys are
8
+ // path-prefixed and unique). Adding a namespace = drop in a new file; adding a language =
9
+ // copy the assets/locales/<lang>/ subtree — no edits to this file are ever needed.
10
+ //
11
+ // Legacy layout (kept for backward compatibility with sites not yet migrated): the flat
12
+ // assets/<lang>.json file. Both are merged; mirrored files win on a key clash so a
13
+ // half-migrated project (some keys moved, the rest still in assets/<lang>.json) stays
14
+ // correct.
15
+ const mirroredModules = import.meta.glob("@/assets/locales/**/*.json", { eager: true });
16
+ const legacyModules = import.meta.glob("@/assets/*.json", { eager: true });
17
+
18
+ const asDict = (mod: unknown): LocaleDict => {
19
+ const value = (mod as { default?: unknown })?.default ?? mod;
20
+ return value && typeof value === "object" ? (value as LocaleDict) : {};
21
+ };
22
+
23
+ const buildLocales = (): Record<string, LocaleDict> => {
24
+ const locales: Record<string, LocaleDict> = {};
25
+ const merge = (lang: string, dict: LocaleDict) => {
26
+ locales[lang] = { ...(locales[lang] ?? {}), ...dict };
27
+ };
28
+
29
+ // Legacy first (lower precedence).
30
+ for (const [path, mod] of Object.entries(legacyModules)) {
31
+ // Only files named with a 2-letter ISO code are locales; skip assets/images.json etc.
32
+ const match = path.match(/\/assets\/([A-Za-z]{2}(?:-[A-Za-z]{2})?)\.json$/);
33
+ if (!match) continue;
34
+ merge(match[1], asDict(mod));
35
+ }
36
+
37
+ // Mirrored second (higher precedence — wins on key clash during migration).
38
+ for (const [path, mod] of Object.entries(mirroredModules)) {
39
+ // assets/locales/<lang>/<...>.json — the language is the first segment after assets/locales/.
40
+ const match = path.match(/\/assets\/locales\/([^/]+)\//);
41
+ if (!match) continue;
42
+ merge(match[1], asDict(mod));
43
+ }
44
+
45
+ return locales;
46
+ };
47
+
48
+ const locales = buildLocales();
49
+
50
+ interface LanguageContextType {
51
+ language: string;
52
+ setLanguage: (lang: string) => void;
53
+ t: (key: string) => string;
54
+ }
55
+
56
+ const LanguageContext = createContext<LanguageContextType | undefined>(undefined);
57
+
58
+ interface LanguageProviderProps {
59
+ children: ReactNode;
60
+ }
61
+
62
+ export const LanguageProvider = ({ children }: LanguageProviderProps) => {
63
+ const [language, setLanguage] = useState<string>("en");
64
+
65
+ // Reflect the active language on <html lang> (a11y/SEO, and so tools can read it).
66
+ useEffect(() => {
67
+ document.documentElement.lang = language;
68
+ }, [language]);
69
+
70
+ const t = (key: string): string => {
71
+ return locales[language]?.[key] || key;
72
+ };
73
+
74
+ return (
75
+ <LanguageContext.Provider value={{ language, setLanguage, t }}>
76
+ {children}
77
+ </LanguageContext.Provider>
78
+ );
79
+ };
80
+
81
+ export const useLanguage = () => {
82
+ const context = useContext(LanguageContext);
83
+ if (!context) {
84
+ throw new Error("useLanguage must be used within a LanguageProvider");
85
+ }
86
+ return context;
87
+ };
@@ -8,6 +8,7 @@
8
8
  "vite.config.ts": "vite.config.ts",
9
9
  "robots.txt": "public/robots.txt",
10
10
  ".htaccess": "public/.htaccess",
11
+ "context/LanguageContext.tsx": "context/LanguageContext.tsx",
11
12
  "remixer.ts": "lib/remixer.ts",
12
13
  "remixer/actions.ts": "lib/remixer/actions.ts",
13
14
  "remixer/anonToken.ts": "lib/remixer/anonToken.ts",
@@ -14,12 +14,18 @@
14
14
  "@internationalized/date": "3.10.0",
15
15
  "@openobserve/browser-logs": "0.3.1",
16
16
  "@openobserve/browser-rum-slim": "0.3.1",
17
+ "@radix-ui/react-accordion": "1.2.14",
17
18
  "@react-three/drei": "10.0.6",
18
19
  "@react-three/fiber": "9.5.0",
19
20
  "@react-three/postprocessing": "3.0.4",
20
21
  "@supabase/supabase-js": "2.86.0",
22
+ "class-variance-authority": "0.7.1",
23
+ "clsx": "2.1.1",
21
24
  "date-fns": "4.1.0",
22
25
  "framer-motion": "12.23.24",
26
+ "gsap": "3.15.0",
27
+ "hls.js": "1.6.16",
28
+ "lenis": "1.3.25",
23
29
  "lucide-react": "0.554.0",
24
30
  "motion-dom": "12.40.0",
25
31
  "postprocessing": "6.37.0",
@@ -28,6 +34,9 @@
28
34
  "react-dom": "19.2.0",
29
35
  "react-helmet-async": "3.0.0",
30
36
  "react-router-dom": "7.9.6",
37
+ "recharts": "3.9.0",
38
+ "swiper": "14.0.1",
39
+ "tailwind-merge": "2.6.1",
31
40
  "three": "0.171.0"
32
41
  },
33
42
  "devDependencies": {
@@ -36,6 +45,7 @@
36
45
  "autoprefixer": "10.4.21",
37
46
  "postcss": "8.5.3",
38
47
  "tailwindcss": "3.4.17",
48
+ "tailwindcss-animate": "1.0.7",
39
49
  "typescript": "5.8.3",
40
50
  "vite": "6.4.1"
41
51
  }
@@ -15,7 +15,9 @@ async function brokerEmailAuth(path: 'signin' | 'signup', email: string, passwor
15
15
  email,
16
16
  password,
17
17
  metadata,
18
- return_to: window.location.origin,
18
+ // Land email-confirmation on /account so the generated Account page's
19
+ // exchange handler redeems the code — same return target as Google sign-in.
20
+ return_to: `${window.location.origin}/account`,
19
21
  }),
20
22
  });
21
23