@jhits/plugin-website 0.0.16 → 0.0.17

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 (70) hide show
  1. package/dist/131._entry.js +2 -0
  2. package/dist/131._entry.js.LICENSE.txt +6 -0
  3. package/dist/303._entry.js +1 -0
  4. package/dist/_entry.js +2 -0
  5. package/dist/_entry.js.LICENSE.txt +6 -0
  6. package/dist/api/handler.d.ts.map +1 -1
  7. package/dist/api/handler.js +15 -4
  8. package/dist/remoteEntry.js +1 -0
  9. package/dist/server.js +232 -0
  10. package/dist/types/settings.d.ts +18 -11
  11. package/dist/types/settings.d.ts.map +1 -1
  12. package/dist/views/Settings/components/ContactInfoSection.d.ts +12 -0
  13. package/dist/views/Settings/components/ContactInfoSection.d.ts.map +1 -0
  14. package/dist/views/Settings/components/ContactInfoSection.js +14 -0
  15. package/dist/views/Settings/components/DomainLanguagesCard.d.ts +8 -0
  16. package/dist/views/Settings/components/DomainLanguagesCard.d.ts.map +1 -0
  17. package/dist/views/Settings/components/DomainLanguagesCard.js +12 -0
  18. package/dist/views/Settings/components/DomainLanguagesModal.d.ts +12 -0
  19. package/dist/views/Settings/components/DomainLanguagesModal.d.ts.map +1 -0
  20. package/dist/views/Settings/components/DomainLanguagesModal.js +38 -0
  21. package/dist/views/Settings/components/FlagIcon.d.ts +6 -0
  22. package/dist/views/Settings/components/FlagIcon.d.ts.map +1 -0
  23. package/dist/views/Settings/components/FlagIcon.js +11 -0
  24. package/dist/views/Settings/components/LaunchDateSection.d.ts +8 -0
  25. package/dist/views/Settings/components/LaunchDateSection.d.ts.map +1 -0
  26. package/dist/views/Settings/components/LaunchDateSection.js +22 -0
  27. package/dist/views/Settings/components/LocalesManagementCard.d.ts +8 -0
  28. package/dist/views/Settings/components/LocalesManagementCard.d.ts.map +1 -0
  29. package/dist/views/Settings/components/LocalesManagementCard.js +66 -0
  30. package/dist/views/Settings/components/LocalizedContentSection.d.ts +12 -0
  31. package/dist/views/Settings/components/LocalizedContentSection.d.ts.map +1 -0
  32. package/dist/views/Settings/components/LocalizedContentSection.js +17 -0
  33. package/dist/views/Settings/components/SeoIdentitySection.d.ts +9 -0
  34. package/dist/views/Settings/components/SeoIdentitySection.d.ts.map +1 -0
  35. package/dist/views/Settings/components/SeoIdentitySection.js +12 -0
  36. package/dist/views/Settings/components/SocialLinksSection.d.ts +13 -0
  37. package/dist/views/Settings/components/SocialLinksSection.d.ts.map +1 -0
  38. package/dist/views/Settings/components/SocialLinksSection.js +13 -0
  39. package/dist/views/Settings/components/StatusSection.d.ts +8 -0
  40. package/dist/views/Settings/components/StatusSection.d.ts.map +1 -0
  41. package/dist/views/Settings/components/StatusSection.js +27 -0
  42. package/dist/views/Settings/constants.d.ts +12 -0
  43. package/dist/views/Settings/constants.d.ts.map +1 -0
  44. package/dist/views/Settings/constants.js +23 -0
  45. package/dist/views/Settings/hooks/useWebsiteSettings.d.ts +24 -0
  46. package/dist/views/Settings/hooks/useWebsiteSettings.d.ts.map +1 -0
  47. package/dist/views/Settings/hooks/useWebsiteSettings.js +217 -0
  48. package/dist/views/Settings/types.d.ts +5 -0
  49. package/dist/views/Settings/types.d.ts.map +1 -0
  50. package/dist/views/Settings/types.js +1 -0
  51. package/dist/views/SettingsView.d.ts +3 -6
  52. package/dist/views/SettingsView.d.ts.map +1 -1
  53. package/dist/views/SettingsView.js +59 -262
  54. package/package.json +14 -10
  55. package/src/api/handler.ts +41 -4
  56. package/src/types/settings.ts +28 -12
  57. package/src/views/Settings/components/ContactInfoSection.tsx +109 -0
  58. package/src/views/Settings/components/DomainLanguagesCard.tsx +91 -0
  59. package/src/views/Settings/components/DomainLanguagesModal.tsx +216 -0
  60. package/src/views/Settings/components/FlagIcon.tsx +20 -0
  61. package/src/views/Settings/components/LaunchDateSection.tsx +111 -0
  62. package/src/views/Settings/components/LocalesManagementCard.tsx +198 -0
  63. package/src/views/Settings/components/LocalizedContentSection.tsx +155 -0
  64. package/src/views/Settings/components/SeoIdentitySection.tsx +98 -0
  65. package/src/views/Settings/components/SocialLinksSection.tsx +98 -0
  66. package/src/views/Settings/components/StatusSection.tsx +181 -0
  67. package/src/views/Settings/constants.ts +26 -0
  68. package/src/views/Settings/hooks/useWebsiteSettings.ts +240 -0
  69. package/src/views/Settings/types.ts +4 -0
  70. package/src/views/SettingsView.tsx +226 -674
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license lucide-react v0.577.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */
@@ -1 +1 @@
1
- {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/api/handler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGrD,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;GAEG;AACH,wBAAsB,YAAY,CAC9B,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,gBAAgB,GACzB,OAAO,CAAC,YAAY,CAAC,CAuDvB;AAED;;GAEG;AACH,wBAAsB,aAAa,CAC/B,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,gBAAgB,GACzB,OAAO,CAAC,YAAY,CAAC,CAuDvB"}
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/api/handler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGrD,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;GAEG;AACH,wBAAsB,YAAY,CAC9B,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,gBAAgB,GACzB,OAAO,CAAC,YAAY,CAAC,CAsEvB;AAED;;GAEG;AACH,wBAAsB,aAAa,CAC/B,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,gBAAgB,GACzB,OAAO,CAAC,YAAY,CAAC,CAuDvB"}
@@ -42,14 +42,25 @@ export async function GET_SETTINGS(req, config) {
42
42
  }
43
43
  // Convert launch_date from Date to ISO string if it exists
44
44
  const responseData = { ...siteConfig };
45
+ let launchDateObj = null;
45
46
  if (responseData.launch_date instanceof Date) {
46
- responseData.launch_date = responseData.launch_date.toISOString();
47
+ launchDateObj = responseData.launch_date;
48
+ responseData.launch_date = launchDateObj.toISOString();
47
49
  }
48
50
  else if (responseData.launch_date) {
49
- // If it's already a string, keep it as is
50
- responseData.launch_date = responseData.launch_date;
51
+ const parsed = new Date(responseData.launch_date);
52
+ if (!isNaN(parsed.getTime())) {
53
+ launchDateObj = parsed;
54
+ }
51
55
  }
52
- else {
56
+ // AUTO-RELEASE LOGIC:
57
+ // If there is a launch date and it has passed, force launched state to true
58
+ // and maintenance to false unless it's a future date.
59
+ if (launchDateObj && launchDateObj.getTime() <= Date.now()) {
60
+ responseData.launched = true;
61
+ responseData.maintenanceMode = false;
62
+ }
63
+ if (!responseData.launch_date) {
53
64
  responseData.launch_date = '';
54
65
  }
55
66
  return NextResponse.json(responseData);
@@ -0,0 +1 @@
1
+ var pluginWebsite;(()=>{"use strict";var e,r,t={594(e){e.exports=React},713(e){e.exports=ReactJSXRuntime}},o={};function i(e){var r=o[e];if(void 0!==r)return r.exports;var n=o[e]={exports:{}};return t[e](n,n.exports,i),n.exports}i.m=t,i.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return i.d(r,{a:r}),r},i.d=(e,r)=>{for(var t in r)i.o(r,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((r,t)=>(i.f[t](e,r),r),[])),i.u=e=>e+"._entry.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="pluginWebsite:",i.l=(t,o,n,a)=>{if(e[t])e[t].push(o);else{var l,s;if(void 0!==n)for(var u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var p=u[c];if(p.getAttribute("src")==t||p.getAttribute("data-webpack")==r+n){l=p;break}}l||(s=!0,(l=document.createElement("script")).charset="utf-8",i.nc&&l.setAttribute("nonce",i.nc),l.setAttribute("data-webpack",r+n),l.src=t),e[t]=[o];var d=(r,o)=>{l.onerror=l.onload=null,clearTimeout(f);var i=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),i&&i.forEach(e=>e(o)),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),s&&document.head.appendChild(l)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var r=i.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var o=t.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=t[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={605:0};i.f.j=(r,t)=>{var o=i.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var n=new Promise((t,i)=>o=e[r]=[t,i]);t.push(o[2]=n);var a=i.p+i.u(r),l=new Error;i.l(a,t=>{if(i.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var n=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;l.message="Loading chunk "+r+" failed.\n("+n+": "+a+")",l.name="ChunkLoadError",l.type=n,l.request=a,o[1](l)}},"chunk-"+r,r)}};var r=(r,t)=>{var o,n,[a,l,s]=t,u=0;if(a.some(r=>0!==e[r])){for(o in l)i.o(l,o)&&(i.m[o]=l[o]);s&&s(i)}for(r&&r(t);u<a.length;u++)n=a[u],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0},t=self.webpackChunkpluginWebsite=self.webpackChunkpluginWebsite||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var n,a,l,s,u={};n=u,a={"./index":()=>Promise.all([i.e(131),i.e(303)]).then(()=>()=>i(303))},l=(e,r)=>(i.R=r,r=i.o(a,e)?a[e]():Promise.resolve().then(()=>{throw new Error('Module "'+e+'" does not exist in container.')}),i.R=void 0,r),s=(e,r)=>{if(i.S){var t="default",o=i.S[t];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return i.S[t]=e,i.I(t,r)}},i.d(n,{get:()=>l,init:()=>s}),pluginWebsite=u})();
package/dist/server.js ADDED
@@ -0,0 +1,232 @@
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ // The require scope
4
+ /******/ var __webpack_require__ = {};
5
+ /******/
6
+ /************************************************************************/
7
+ /******/ /* webpack/runtime/define property getters */
8
+ /******/ (() => {
9
+ /******/ // define getter functions for harmony exports
10
+ /******/ __webpack_require__.d = (exports, definition) => {
11
+ /******/ for(var key in definition) {
12
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
13
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
14
+ /******/ }
15
+ /******/ }
16
+ /******/ };
17
+ /******/ })();
18
+ /******/
19
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
20
+ /******/ (() => {
21
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
22
+ /******/ })();
23
+ /******/
24
+ /******/ /* webpack/runtime/make namespace object */
25
+ /******/ (() => {
26
+ /******/ // define __esModule on exports
27
+ /******/ __webpack_require__.r = (exports) => {
28
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
29
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
30
+ /******/ }
31
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
32
+ /******/ };
33
+ /******/ })();
34
+ /******/
35
+ /************************************************************************/
36
+ var __webpack_exports__ = {};
37
+ // ESM COMPAT FLAG
38
+ __webpack_require__.r(__webpack_exports__);
39
+
40
+ // EXPORTS
41
+ __webpack_require__.d(__webpack_exports__, {
42
+ handleApi: () => (/* reexport */ handleWebsiteApi),
43
+ handleWebsiteApi: () => (/* reexport */ handleWebsiteApi)
44
+ });
45
+
46
+ ;// external "next/server"
47
+ const server_namespaceObject = require("next/server");
48
+ ;// ./src/api/handler.ts
49
+ /**
50
+ * Website Settings API Handler
51
+ * Handles GET and POST requests for website settings
52
+ */
53
+ 'use server';
54
+
55
+ /**
56
+ * GET /api/plugin-website/settings - Get website settings
57
+ */
58
+ async function GET_SETTINGS(req, config) {
59
+ try {
60
+ const dbConnection = await config.getDb();
61
+ const db = dbConnection.db();
62
+ const settings = db.collection('settings');
63
+ const siteConfig = await settings.findOne({ identifier: 'site_config' });
64
+ if (!siteConfig) {
65
+ // Return default settings if none exist
66
+ return server_namespaceObject.NextResponse.json({
67
+ identifier: 'site_config',
68
+ siteName: '',
69
+ siteTagline: '',
70
+ siteDescription: '',
71
+ keywords: '',
72
+ contactEmail: '',
73
+ phoneNumber: '',
74
+ physicalAddress: '',
75
+ smtpUser: '',
76
+ maintenanceMode: false,
77
+ launch_date: '',
78
+ socials: [],
79
+ localizedContactInfo: {
80
+ en: { physicalAddress: '', phoneNumber: '' },
81
+ sv: { physicalAddress: '', phoneNumber: '' },
82
+ nl: { physicalAddress: '', phoneNumber: '' },
83
+ },
84
+ localizedSocials: {
85
+ en: [],
86
+ sv: [],
87
+ nl: [],
88
+ },
89
+ });
90
+ }
91
+ // Convert launch_date from Date to ISO string if it exists
92
+ const responseData = { ...siteConfig };
93
+ let launchDateObj = null;
94
+ if (responseData.launch_date instanceof Date) {
95
+ launchDateObj = responseData.launch_date;
96
+ responseData.launch_date = launchDateObj.toISOString();
97
+ }
98
+ else if (responseData.launch_date) {
99
+ const parsed = new Date(responseData.launch_date);
100
+ if (!isNaN(parsed.getTime())) {
101
+ launchDateObj = parsed;
102
+ }
103
+ }
104
+ // AUTO-RELEASE LOGIC:
105
+ // If there is a launch date and it has passed, force launched state to true
106
+ // and maintenance to false regardless of what is in the DB.
107
+ if (launchDateObj && launchDateObj.getTime() <= Date.now()) {
108
+ responseData.launched = true;
109
+ responseData.maintenanceMode = false;
110
+ // PERSIST the auto-release back to database IMMEDIATELY
111
+ const currentLaunched = siteConfig.launched === true;
112
+ const currentMaintenance = siteConfig.maintenanceMode === true;
113
+ if (!currentLaunched || currentMaintenance) {
114
+ try {
115
+ console.log(`[WebsiteAPI] PERSISTING AUTO-RELEASE: ${siteConfig.siteName || 'site_config'}`);
116
+ await settings.updateOne({ identifier: 'site_config' }, {
117
+ $set: {
118
+ launched: true,
119
+ maintenanceMode: false,
120
+ updatedAt: new Date()
121
+ }
122
+ });
123
+ }
124
+ catch (e) {
125
+ console.error('[WebsiteAPI] Failed to persist auto-release:', e);
126
+ }
127
+ }
128
+ }
129
+ if (!responseData.launch_date) {
130
+ responseData.launch_date = '';
131
+ }
132
+ return server_namespaceObject.NextResponse.json(responseData);
133
+ }
134
+ catch (error) {
135
+ console.error('[WebsiteAPI] GET_SETTINGS error:', error);
136
+ return server_namespaceObject.NextResponse.json({ error: 'Failed to fetch settings', detail: error.message }, { status: 500 });
137
+ }
138
+ }
139
+ /**
140
+ * POST /api/plugin-website/settings - Update website settings
141
+ */
142
+ async function POST_SETTINGS(req, config) {
143
+ try {
144
+ const userId = await config.getUserId?.(req);
145
+ if (!userId) {
146
+ return server_namespaceObject.NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
147
+ }
148
+ const body = await req.json();
149
+ const dbConnection = await config.getDb();
150
+ const db = dbConnection.db();
151
+ const settings = db.collection('settings');
152
+ // Remove _id and launch_date from updateData (we'll handle launch_date separately)
153
+ const { _id, launch_date, ...updateData } = body;
154
+ // Prepare base update operations
155
+ const updateOps = {
156
+ $set: {
157
+ identifier: 'site_config',
158
+ ...updateData,
159
+ updatedAt: new Date(),
160
+ }
161
+ };
162
+ // Handle launch_date separately
163
+ if (launch_date !== undefined && launch_date !== null && launch_date !== '') {
164
+ // Convert launch_date from datetime-local string to Date if provided
165
+ const date = new Date(launch_date);
166
+ if (!isNaN(date.getTime())) {
167
+ updateOps.$set.launch_date = date;
168
+ }
169
+ else {
170
+ updateOps.$unset = { launch_date: '' };
171
+ }
172
+ }
173
+ else {
174
+ // Remove launch_date field if it's empty, undefined, or null
175
+ updateOps.$unset = { launch_date: '' };
176
+ }
177
+ // Upsert settings
178
+ await settings.updateOne({ identifier: 'site_config' }, updateOps, { upsert: true });
179
+ return server_namespaceObject.NextResponse.json({ success: true, message: 'Settings updated successfully' });
180
+ }
181
+ catch (error) {
182
+ console.error('[WebsiteAPI] POST_SETTINGS error:', error);
183
+ return server_namespaceObject.NextResponse.json({ error: 'Failed to update settings', detail: error.message }, { status: 500 });
184
+ }
185
+ }
186
+
187
+ ;// ./src/api/router.ts
188
+ /**
189
+ * Website Plugin API Router
190
+ * Routes API requests to appropriate handlers
191
+ */
192
+ 'use server';
193
+
194
+
195
+ /**
196
+ * Handle website API requests
197
+ */
198
+ async function handleWebsiteApi(req, path, config) {
199
+ const method = req.method;
200
+ const route = path[0] || '';
201
+ try {
202
+ // Route: /api/plugin-website/settings
203
+ if (route === 'settings') {
204
+ if (method === 'GET') {
205
+ return await GET_SETTINGS(req, config);
206
+ }
207
+ if (method === 'POST' || method === 'PUT') {
208
+ return await POST_SETTINGS(req, config);
209
+ }
210
+ }
211
+ // Method not allowed
212
+ return server_namespaceObject.NextResponse.json({ error: `Method ${method} not allowed for route: ${route || '/'}` }, { status: 405 });
213
+ }
214
+ catch (error) {
215
+ console.error('[WebsiteApiRouter] Error:', error);
216
+ return server_namespaceObject.NextResponse.json({ error: error.message || 'Internal server error' }, { status: 500 });
217
+ }
218
+ }
219
+
220
+ ;// ./src/index.server.ts
221
+
222
+ /**
223
+ * Plugin Website - Server-Only Entry Point
224
+ * This file exports only server-side API handlers
225
+ * Used by the dynamic plugin router via @jhits/plugin-website/server
226
+ */
227
+
228
+ // Keep original export for backward compatibility
229
+
230
+ module.exports = __webpack_exports__;
231
+ /******/ })()
232
+ ;
@@ -1,16 +1,27 @@
1
1
  /**
2
2
  * Website Settings Types
3
3
  */
4
- export type SupportedLocale = 'en' | 'sv' | 'nl';
4
+ export type SupportedLocale = string;
5
+ export interface LocaleDefinition {
6
+ code: string;
7
+ name: string;
8
+ countryCode: string;
9
+ }
5
10
  export interface DomainLocaleConfig {
6
11
  domain: string;
7
- locale: SupportedLocale;
12
+ locale: string;
8
13
  allowUserOverride?: boolean;
9
14
  }
10
15
  export interface LocalizedContactInfo {
11
16
  physicalAddress?: string;
12
17
  phoneNumber?: string;
13
18
  }
19
+ export interface LocalizedIdentity {
20
+ siteName?: string;
21
+ siteTagline?: string;
22
+ siteDescription?: string;
23
+ keywords?: string;
24
+ }
14
25
  export interface LocalizedSocialLink {
15
26
  id: number;
16
27
  platform: string;
@@ -18,19 +29,15 @@ export interface LocalizedSocialLink {
18
29
  }
19
30
  export interface WebsiteSettings {
20
31
  identifier: string;
21
- siteName?: string;
22
- siteTagline?: string;
23
- siteDescription?: string;
24
- keywords?: string;
25
32
  contactEmail?: string;
26
- phoneNumber?: string;
27
- physicalAddress?: string;
28
33
  smtpUser?: string;
29
34
  maintenanceMode?: boolean;
35
+ launched?: boolean;
30
36
  launch_date?: string;
31
- socials?: SocialLink[];
32
- localizedContactInfo?: Partial<Record<SupportedLocale, LocalizedContactInfo>>;
33
- localizedSocials?: Partial<Record<SupportedLocale, LocalizedSocialLink[]>>;
37
+ supportedLocales: LocaleDefinition[];
38
+ localizedIdentity: Record<string, LocalizedIdentity>;
39
+ localizedContactInfo: Record<string, LocalizedContactInfo>;
40
+ localizedSocials: Record<string, LocalizedSocialLink[]>;
34
41
  domainLocaleConfig?: DomainLocaleConfig[];
35
42
  updatedAt?: Date;
36
43
  createdAt?: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/types/settings.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjD,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,eAAe,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,oBAAoB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,oBAAoB,CAAC,CAAC,CAAC;IAC9E,gBAAgB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAC;IAC3E,kBAAkB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC1C,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,GAAG,CAAA;KAAE,CAAC,CAAC;IACxC,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3B,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB"}
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/types/settings.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AAErC,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC5B,UAAU,EAAE,MAAM,CAAC;IAEnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,gBAAgB,EAAE,gBAAgB,EAAE,CAAC;IAGrC,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACrD,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAC3D,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,EAAE,CAAC,CAAC;IAExD,kBAAkB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC1C,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,GAAG,CAAA;KAAE,CAAC,CAAC;IACxC,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACjD,WAAW,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3B,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB"}
@@ -0,0 +1,12 @@
1
+ import { WebsiteSettings, LocaleDefinition } from '../../../types/settings';
2
+ interface ContactInfoSectionProps {
3
+ settings: WebsiteSettings;
4
+ activeTab: string;
5
+ onTabChange: (code: string) => void;
6
+ activeLocales: LocaleDefinition[];
7
+ onUpdate: (updates: Partial<WebsiteSettings>) => void;
8
+ onUpdateLocalized: (field: string, value: string) => void;
9
+ }
10
+ export declare function ContactInfoSection({ settings, activeTab, onTabChange, activeLocales, onUpdate, onUpdateLocalized }: ContactInfoSectionProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
12
+ //# sourceMappingURL=ContactInfoSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContactInfoSection.d.ts","sourceRoot":"","sources":["../../../../src/views/Settings/components/ContactInfoSection.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAS5E,UAAU,uBAAuB;IAC7B,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,aAAa,EAAE,gBAAgB,EAAE,CAAC;IAClC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IACtD,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7D;AAED,wBAAgB,kBAAkB,CAAC,EAC/B,QAAQ,EACR,SAAS,EACT,WAAW,EACX,aAAa,EACb,QAAQ,EACR,iBAAiB,EACpB,EAAE,uBAAuB,2CAgFzB"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { motion } from 'framer-motion';
3
+ import { Mail, Smartphone, MapPin, Globe } from 'lucide-react';
4
+ import { FlagIcon } from './FlagIcon';
5
+ import { clsx } from 'clsx';
6
+ import { twMerge } from 'tailwind-merge';
7
+ function cn(...inputs) {
8
+ return twMerge(clsx(inputs));
9
+ }
10
+ export function ContactInfoSection({ settings, activeTab, onTabChange, activeLocales, onUpdate, onUpdateLocalized }) {
11
+ return (_jsxs(motion.section, { initial: { opacity: 0, y: 20 }, animate: { opacity: 1, y: 0 }, className: "bg-dashboard-card/50 border border-dashboard-border/40 p-8 rounded-[2rem] space-y-6 relative overflow-hidden", children: [_jsx("div", { className: "absolute top-0 right-0 w-64 h-64 blur-3xl opacity-5 bg-primary pointer-events-none" }), _jsxs("div", { className: "flex items-center gap-3 relative z-10 border-b border-dashboard-border/40 pb-4", children: [_jsx("div", { className: "size-8 rounded-lg bg-primary/10 flex items-center justify-center text-primary border border-primary/20 shadow-inner", children: _jsx(Mail, { size: 16 }) }), _jsxs("h3", { className: "text-xl font-bold text-dashboard-text leading-none tracking-tight", children: ["Core ", _jsx("span", { className: "text-primary", children: "Intelligence" })] })] }), _jsx("div", { className: "flex gap-2 relative z-10 overflow-x-auto pb-2 custom-scrollbar", children: activeLocales.map((loc) => (_jsxs("button", { onClick: () => onTabChange(loc.code), className: cn("px-4 py-2 rounded-xl text-[10px] font-bold uppercase tracking-wider transition-all flex items-center gap-2 shrink-0 border", activeTab === loc.code
12
+ ? "bg-primary text-white border-primary shadow-lg shadow-primary/10"
13
+ : "bg-dashboard-bg/30 text-dashboard-text-secondary/50 border-dashboard-border/40 hover:border-primary/30"), children: [_jsx(FlagIcon, { code: loc.code, countryCode: loc.countryCode }), _jsx("span", { children: loc.code })] }, loc.code))) }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6 relative z-10", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-[10px] font-bold text-dashboard-text-secondary/70 uppercase tracking-[0.15em] ml-2 opacity-60", children: "Global Sync Email" }), _jsxs("div", { className: "relative group", children: [_jsx(Globe, { className: "absolute left-5 top-1/2 -translate-y-1/2 size-4 text-dashboard-text-secondary/40 group-focus-within:text-primary transition-colors" }), _jsx("input", { type: "email", value: settings.contactEmail || '', onChange: (e) => onUpdate({ contactEmail: e.target.value }), placeholder: "SYNC_EMAIL_ENDPOINT", className: "w-full pl-12 pr-6 py-3 bg-dashboard-bg/50 border border-dashboard-border/40 rounded-xl text-sm font-bold outline-none focus:ring-2 focus:ring-primary/10 focus:border-primary/30 transition-all text-dashboard-text placeholder:text-dashboard-text-secondary/30" })] })] }), _jsxs("div", { className: "space-y-2", children: [_jsxs("label", { className: "text-[10px] font-bold text-dashboard-text-secondary/70 uppercase tracking-[0.15em] ml-2 opacity-60", children: ["Regional Phone (", activeTab, ")"] }), _jsxs("div", { className: "relative group", children: [_jsx(Smartphone, { className: "absolute left-5 top-1/2 -translate-y-1/2 size-4 text-dashboard-text-secondary/40 group-focus-within:text-primary transition-colors" }), _jsx("input", { type: "tel", value: settings.localizedContactInfo?.[activeTab]?.phoneNumber || '', onChange: (e) => onUpdateLocalized('phoneNumber', e.target.value), placeholder: "INITIALIZE_PHONE", className: "w-full pl-12 pr-6 py-3 bg-dashboard-bg/50 border border-dashboard-border/40 rounded-xl text-sm font-bold outline-none focus:ring-2 focus:ring-primary/10 focus:border-primary/30 transition-all text-dashboard-text placeholder:text-dashboard-text-secondary/30" })] })] })] }), _jsxs("div", { className: "space-y-2 relative z-10", children: [_jsxs("label", { className: "text-[10px] font-bold text-dashboard-text-secondary/70 uppercase tracking-[0.15em] ml-2 opacity-60", children: ["Geospatial Protocol (", activeTab, ")"] }), _jsxs("div", { className: "relative group", children: [_jsx(MapPin, { className: "absolute left-5 top-5 size-4 text-dashboard-text-secondary/40 group-focus-within:text-primary transition-colors" }), _jsx("textarea", { value: settings.localizedContactInfo?.[activeTab]?.physicalAddress || '', onChange: (e) => onUpdateLocalized('physicalAddress', e.target.value), placeholder: "STREET_ADDRESS_ORCHESTRATION", rows: 3, className: "w-full pl-12 pr-6 py-4 bg-dashboard-bg/50 border border-dashboard-border/40 rounded-xl text-sm font-medium leading-relaxed outline-none focus:ring-2 focus:ring-primary/10 focus:border-primary/30 transition-all text-dashboard-text placeholder:text-dashboard-text-secondary/30 resize-none" })] })] })] }));
14
+ }
@@ -0,0 +1,8 @@
1
+ import { DomainLocaleConfig } from '../../../types/settings';
2
+ interface DomainLanguagesCardProps {
3
+ config: DomainLocaleConfig[];
4
+ onEdit: () => void;
5
+ }
6
+ export declare function DomainLanguagesCard({ config, onEdit }: DomainLanguagesCardProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=DomainLanguagesCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DomainLanguagesCard.d.ts","sourceRoot":"","sources":["../../../../src/views/Settings/components/DomainLanguagesCard.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAS7D,UAAU,wBAAwB;IAC9B,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,MAAM,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,wBAAwB,2CAyE/E"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { motion } from 'framer-motion';
3
+ import { Globe2, Edit3, ArrowRight, ShieldCheck } from 'lucide-react';
4
+ import { FlagIcon } from './FlagIcon';
5
+ import { clsx } from 'clsx';
6
+ import { twMerge } from 'tailwind-merge';
7
+ function cn(...inputs) {
8
+ return twMerge(clsx(inputs));
9
+ }
10
+ export function DomainLanguagesCard({ config, onEdit }) {
11
+ return (_jsxs("section", { className: "space-y-8", children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "size-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary border border-primary/20 shadow-inner", children: _jsx(Globe2, { size: 20 }) }), _jsxs("h3", { className: "text-2xl lg:text-3xl font-bold text-dashboard-text leading-none tracking-tight", children: ["Domain ", _jsx("span", { className: "text-primary", children: "Strategy" })] })] }), _jsxs(motion.div, { initial: { opacity: 0, y: 20 }, animate: { opacity: 1, y: 0 }, className: "bg-dashboard-card/50 border border-dashboard-border/40 p-8 rounded-[2rem] relative overflow-hidden", children: [_jsx("div", { className: "space-y-6", children: config && config.length > 0 ? (_jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: config.map((entry, index) => (_jsxs(motion.div, { initial: { opacity: 0, scale: 0.95 }, animate: { opacity: 1, scale: 1 }, transition: { delay: index * 0.1 }, className: "flex items-center justify-between p-4 bg-dashboard-bg/30 border border-dashboard-border/40 rounded-xl group hover:border-primary/30 transition-all duration-500 shadow-sm", children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "size-10 rounded-lg bg-dashboard-card/50 flex items-center justify-center border border-dashboard-border/40 group-hover:bg-primary/10 group-hover:border-primary/20 transition-all duration-500 shadow-inner", children: _jsx(FlagIcon, { code: entry.locale }) }), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { className: "text-sm font-bold text-dashboard-text/90 group-hover:text-primary transition-colors", children: entry.domain }), _jsxs("div", { className: "flex items-center gap-2 mt-0.5", children: [_jsx(ArrowRight, { size: 10, className: "text-primary opacity-40" }), _jsx("p", { className: "text-[10px] font-bold text-dashboard-text-secondary/70 uppercase tracking-widest", children: "Primary Region" })] })] })] }), !entry.allowUserOverride && (_jsx("div", { className: "size-8 bg-dashboard-card/50 flex items-center justify-center text-dashboard-text-secondary/50 rounded-lg border border-dashboard-border/40", title: "Locked to this language", children: _jsx(ShieldCheck, { size: 14 }) }))] }, index))) })) : (_jsx("div", { className: "py-12 text-center bg-dashboard-card/30 border-dashed border border-dashboard-border/40 rounded-2xl", children: _jsx("p", { className: "text-[10px] text-dashboard-text-secondary/40 font-bold uppercase tracking-[0.2em]", children: "No domain-specific routing configured" }) })) }), _jsxs("div", { className: "mt-8 pt-8 border-t border-dashboard-border/40 flex flex-col items-center", children: [_jsxs("button", { onClick: onEdit, className: "w-full max-w-sm relative group/btn flex items-center justify-center gap-4 px-8 py-3 bg-primary text-white rounded-xl text-[10px] font-bold uppercase tracking-[0.2em] transition-all shadow-xl shadow-primary/10 hover:shadow-primary/20 active:scale-[0.98] overflow-hidden", children: [_jsx("div", { className: "absolute inset-0 bg-linear-to-br from-white/20 to-transparent opacity-0 group-hover/btn:opacity-100 transition-opacity" }), _jsx(Edit3, { size: 16 }), _jsx("span", { children: config?.length ? 'Update Configurations' : 'Configure Domain Routing' })] }), _jsx("p", { className: "text-[10px] text-dashboard-text-secondary/60 text-center mt-6 font-medium max-w-md", children: "Domain-based routing allows you to orchestrate specific regional delivery protocols based on the incoming hostname." })] })] })] }));
12
+ }
@@ -0,0 +1,12 @@
1
+ import { DomainLocaleConfig, LocaleDefinition } from '../../../types/settings';
2
+ interface DomainLanguagesModalProps {
3
+ isOpen: boolean;
4
+ config: DomainLocaleConfig[];
5
+ supportedLocales: LocaleDefinition[];
6
+ onClose: () => void;
7
+ onSaveAndClose: (config: DomainLocaleConfig[]) => void;
8
+ isSaving?: boolean;
9
+ }
10
+ export declare function DomainLanguagesModal({ isOpen, config, supportedLocales, onClose, onSaveAndClose, isSaving }: DomainLanguagesModalProps): import("react/jsx-runtime").JSX.Element | null;
11
+ export {};
12
+ //# sourceMappingURL=DomainLanguagesModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DomainLanguagesModal.d.ts","sourceRoot":"","sources":["../../../../src/views/Settings/components/DomainLanguagesModal.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAS/E,UAAU,yBAAyB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,gBAAgB,EAAE,gBAAgB,EAAE,CAAC;IACrC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,cAAc,EAAE,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAC;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,oBAAoB,CAAC,EACjC,MAAM,EACN,MAAM,EACN,gBAAgB,EAChB,OAAO,EACP,cAAc,EACd,QAAgB,EACnB,EAAE,yBAAyB,kDA2L3B"}
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useEffect } from 'react';
3
+ import { motion, AnimatePresence } from 'framer-motion';
4
+ import { X, Trash2, Plus, Globe2, Shield, ArrowRight, Save } from 'lucide-react';
5
+ import { FlagIcon } from './FlagIcon';
6
+ import { clsx } from 'clsx';
7
+ import { twMerge } from 'tailwind-merge';
8
+ function cn(...inputs) {
9
+ return twMerge(clsx(inputs));
10
+ }
11
+ export function DomainLanguagesModal({ isOpen, config, supportedLocales, onClose, onSaveAndClose, isSaving = false }) {
12
+ const [tempConfig, setTempConfig] = useState(config);
13
+ const [expandedIndex, setExpandedIndex] = useState(null);
14
+ useEffect(() => {
15
+ setTempConfig(config);
16
+ setExpandedIndex(null);
17
+ }, [config, isOpen]);
18
+ if (!isOpen)
19
+ return null;
20
+ const handleAdd = () => {
21
+ setTempConfig([...tempConfig, { domain: '', locale: supportedLocales[0]?.code || 'en', allowUserOverride: true }]);
22
+ setExpandedIndex(tempConfig.length);
23
+ };
24
+ const handleUpdate = (index, field, value) => {
25
+ const updated = [...tempConfig];
26
+ updated[index] = { ...updated[index], [field]: value };
27
+ setTempConfig(updated);
28
+ };
29
+ const handleRemove = (index) => {
30
+ setTempConfig(tempConfig.filter((_, i) => i !== index));
31
+ if (expandedIndex === index)
32
+ setExpandedIndex(null);
33
+ };
34
+ const toggleExpand = (index) => {
35
+ setExpandedIndex(expandedIndex === index ? null : index);
36
+ };
37
+ return (_jsx("div", { className: "fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4", children: _jsxs(motion.div, { initial: { opacity: 0, scale: 0.9, y: 20 }, animate: { opacity: 1, scale: 1, y: 0 }, exit: { opacity: 0, scale: 0.9, y: 20 }, className: "bg-dashboard-card/50 w-full max-w-xl rounded-[2rem] border border-dashboard-border/40 shadow-2xl flex flex-col max-h-[90vh] overflow-hidden relative", children: [_jsx("div", { className: "absolute top-0 right-0 w-64 h-64 blur-3xl opacity-5 bg-primary pointer-events-none" }), _jsxs("div", { className: "flex items-center justify-between p-6 border-b border-dashboard-border/40 relative z-10", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "size-8 rounded-lg bg-primary/10 flex items-center justify-center text-primary border border-primary/20 shadow-inner", children: _jsx(Globe2, { size: 16 }) }), _jsxs("h2", { className: "text-xl font-bold text-dashboard-text/90", children: ["Domain ", _jsx("span", { className: "text-primary", children: "Routing" })] })] }), _jsx("button", { onClick: onClose, className: "p-2 text-dashboard-text-secondary/50 hover:text-dashboard-text transition-all hover:bg-white/5 rounded-lg", children: _jsx(X, { size: 18 }) })] }), _jsxs("div", { className: "flex-1 overflow-y-auto p-6 space-y-4 relative z-10 custom-scrollbar", children: [_jsx(AnimatePresence, { mode: "popLayout", children: tempConfig.length > 0 ? (_jsxs("div", { className: "space-y-3", children: [_jsx("span", { className: "text-[10px] font-bold text-primary/60 uppercase tracking-[0.2em] ml-2", children: "Active Configurations" }), tempConfig.map((entry, index) => (_jsxs(motion.div, { layout: true, initial: { opacity: 0, x: -20 }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: 20 }, className: "bg-dashboard-bg/30 rounded-xl border border-dashboard-border/40 overflow-hidden transition-all duration-300 hover:border-primary/20", children: [_jsxs("div", { onClick: () => toggleExpand(index), className: "w-full flex items-center justify-between p-3.5 text-left hover:bg-primary/5 transition-all cursor-pointer", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("span", { className: "text-sm font-bold text-dashboard-text/90", children: entry.domain || 'UNCONFIGURED_HOST' }), _jsx(ArrowRight, { size: 12, className: "text-primary opacity-40" }), _jsxs("div", { className: "px-2 py-0.5 bg-dashboard-card/50 border border-dashboard-border/40 rounded-full flex items-center gap-2 bg-primary/5", children: [_jsx(FlagIcon, { code: entry.locale }), _jsx("span", { className: "text-[9px] font-bold uppercase tracking-wider text-primary", children: entry.locale })] }), entry.allowUserOverride === false && _jsx(Shield, { size: 10, className: "text-dashboard-text-secondary/50" })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("button", { onClick: (e) => { e.stopPropagation(); handleRemove(index); }, className: "p-1.5 text-dashboard-text-secondary/40 hover:text-red-500 hover:bg-red-500/10 rounded-lg transition-all", children: _jsx(Trash2, { size: 14 }) }), _jsx("div", { className: cn("transition-transform duration-300", expandedIndex === index && "rotate-180"), children: _jsx(X, { size: 12, className: "text-dashboard-text-secondary/40 rotate-45" }) })] })] }), _jsx(AnimatePresence, { children: expandedIndex === index && (_jsx(motion.div, { initial: { height: 0, opacity: 0 }, animate: { height: 'auto', opacity: 1 }, exit: { height: 0, opacity: 0 }, className: "overflow-hidden", children: _jsxs("div", { className: "p-4 pt-0 space-y-4 border-t border-dashboard-border/40 bg-dashboard-card/20", children: [_jsxs("div", { className: "space-y-1.5 mt-4", children: [_jsx("label", { className: "text-[10px] font-bold text-dashboard-text-secondary/60 uppercase tracking-[0.15em] ml-1", children: "Hostname Protocol" }), _jsx("input", { type: "text", value: entry.domain, onChange: (e) => handleUpdate(index, 'domain', e.target.value), placeholder: "e.g. jhits.tech", className: "w-full px-4 py-2 bg-dashboard-bg/50 border border-dashboard-border/40 rounded-lg text-sm font-bold outline-none focus:ring-2 focus:ring-primary/10 focus:border-primary/30 transition-all text-dashboard-text placeholder:text-dashboard-text-secondary/30" })] }), _jsxs("div", { className: "flex items-center gap-4", children: [_jsxs("div", { className: "flex-1 space-y-1.5", children: [_jsx("label", { className: "text-[10px] font-bold text-dashboard-text-secondary/60 uppercase tracking-[0.15em] ml-1", children: "Regional Node" }), _jsx("select", { value: entry.locale, onChange: (e) => handleUpdate(index, 'locale', e.target.value), className: "w-full px-4 py-2 bg-dashboard-bg/50 border border-dashboard-border/40 rounded-lg text-sm font-bold uppercase tracking-wider outline-none focus:ring-2 focus:ring-primary/10 focus:border-primary/30 transition-all text-dashboard-text cursor-pointer appearance-none", children: supportedLocales.map(loc => (_jsx("option", { value: loc.code, className: "bg-neutral-900", children: loc.name }, loc.code))) })] }), _jsxs("div", { className: "shrink-0 flex flex-col items-center gap-1.5 pt-4", children: [_jsx("label", { className: "text-[9px] font-bold text-dashboard-text-secondary/50 uppercase tracking-widest", children: "User Override" }), _jsx("button", { onClick: () => handleUpdate(index, 'allowUserOverride', !entry.allowUserOverride), className: cn("relative w-10 h-5 rounded-full transition-all duration-300 p-0.5", entry.allowUserOverride ? "bg-primary" : "bg-neutral-700"), children: _jsx("div", { className: cn("w-4 h-4 bg-white rounded-full transition-transform duration-300 shadow-sm", entry.allowUserOverride ? "translate-x-5" : "translate-x-0") }) })] })] })] }) })) })] }, index)))] })) : (_jsx("div", { className: "py-12 text-center bg-dashboard-card/20 border-dashed border border-dashboard-border/40 rounded-2xl", children: _jsx("p", { className: "text-[10px] text-dashboard-text-secondary/40 font-bold uppercase tracking-[0.2em]", children: "No domain-specific routing configured" }) })) }), _jsx("div", { className: "pt-2", children: _jsxs("button", { onClick: handleAdd, className: "w-full flex items-center justify-center gap-2 px-4 py-3 border border-dashed border-dashboard-border/40 text-dashboard-text-secondary/50 hover:border-primary/40 hover:text-primary rounded-xl transition-all duration-500 font-bold uppercase text-[10px] tracking-[0.2em]", children: [_jsx(Plus, { size: 16 }), "Add System Domain"] }) })] }), _jsxs("div", { className: "flex gap-3 p-6 border-t border-dashboard-border/40 relative z-10", children: [_jsx("button", { onClick: onClose, className: "flex-1 px-4 py-2.5 bg-dashboard-card/30 hover:bg-white/5 text-dashboard-text/80 rounded-xl text-[10px] font-bold uppercase tracking-wider transition-all border border-dashboard-border/40", children: "Cancel" }), _jsxs("button", { onClick: () => onSaveAndClose(tempConfig), disabled: isSaving, className: "flex-1 px-4 py-2.5 bg-primary text-white rounded-xl text-[10px] font-bold uppercase tracking-[0.15em] transition-all shadow-xl shadow-primary/10 hover:shadow-primary/20 disabled:opacity-50 flex items-center justify-center gap-2", children: [isSaving ? (_jsx("div", { className: "size-3.5 border-2 border-white/20 border-t-white rounded-full animate-spin" })) : _jsx(Save, { size: 14 }), _jsx("span", { children: isSaving ? 'Syncing...' : 'Deploy Config' })] })] })] }) }));
38
+ }
@@ -0,0 +1,6 @@
1
+ export declare function FlagIcon({ code, countryCode, className }: {
2
+ code?: string;
3
+ countryCode?: string;
4
+ className?: string;
5
+ }): import("react/jsx-runtime").JSX.Element | null;
6
+ //# sourceMappingURL=FlagIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlagIcon.d.ts","sourceRoot":"","sources":["../../../../src/views/Settings/components/FlagIcon.tsx"],"names":[],"mappings":"AAGA,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,SAAqB,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,kDAgBjI"}
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { GLOBAL_LOCALE_DATABASE } from '../constants';
3
+ export function FlagIcon({ code, countryCode, className = "w-4 h-3" }) {
4
+ let finalCountryCode = countryCode;
5
+ if (!finalCountryCode && code) {
6
+ finalCountryCode = GLOBAL_LOCALE_DATABASE.find(l => l.code === code)?.countryCode || code;
7
+ }
8
+ if (!finalCountryCode)
9
+ return null;
10
+ return (_jsx("img", { src: `https://flagcdn.com/w20/${finalCountryCode.toLowerCase()}.png`, alt: code || finalCountryCode, className: `${className} object-contain rounded-xs shadow-xs` }));
11
+ }
@@ -0,0 +1,8 @@
1
+ import { WebsiteSettings } from '../../../types/settings';
2
+ interface LaunchDateSectionProps {
3
+ settings: WebsiteSettings;
4
+ onUpdate: (updates: Partial<WebsiteSettings>) => void;
5
+ }
6
+ export declare function LaunchDateSection({ settings, onUpdate }: LaunchDateSectionProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=LaunchDateSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LaunchDateSection.d.ts","sourceRoot":"","sources":["../../../../src/views/Settings/components/LaunchDateSection.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAQ1D,UAAU,sBAAsB;IAC5B,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;CACzD;AAED,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,sBAAsB,2CA8F/E"}
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { motion } from 'framer-motion';
3
+ import { Calendar, Timer, Info } from 'lucide-react';
4
+ import { clsx } from 'clsx';
5
+ import { twMerge } from 'tailwind-merge';
6
+ function cn(...inputs) {
7
+ return twMerge(clsx(inputs));
8
+ }
9
+ export function LaunchDateSection({ settings, onUpdate }) {
10
+ if (settings.launched) {
11
+ return (_jsxs("section", { className: "space-y-12", children: [_jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "size-14 rounded-2xl bg-primary/10 flex items-center justify-center text-primary border border-primary/20 shadow-inner", children: _jsx(Calendar, { size: 28 }) }), _jsxs("h3", { className: "text-4xl lg:text-5xl font-bold text-dashboard-text leading-none", children: ["Launch ", _jsx("span", { className: "text-primary", children: "History" })] })] }), _jsxs(motion.div, { initial: { opacity: 0, scale: 0.98 }, animate: { opacity: 1, scale: 1 }, className: "bg-dashboard-card/50 border border-dashboard-border/50 p-10 rounded-[3rem] flex items-center gap-8 relative overflow-hidden group", children: [_jsx("div", { className: "absolute top-0 right-0 w-48 h-48 blur-3xl opacity-5 bg-emerald-500 pointer-events-none" }), _jsx("div", { className: "size-20 rounded-2xl bg-emerald-500/10 flex items-center justify-center border border-emerald-500/20 shadow-inner shrink-0", children: _jsx("div", { className: "size-5 rounded-full bg-emerald-500 animate-pulse shadow-[0_0_20px_rgba(16,185,129,0.4)]" }) }), _jsxs("div", { children: [_jsx("span", { className: "text-[10px] font-bold text-emerald-500 uppercase tracking-[0.3em] mb-2 block opacity-60", children: "System Temporal Status" }), _jsx("h4", { className: "text-2xl font-bold text-dashboard-text", children: "System Fully Operational" }), settings.launch_date && (_jsxs("p", { className: "text-sm text-neutral-500 dark:text-neutral-400 font-medium mt-2", children: ["Initial Deployment Sequence: ", new Date(settings.launch_date).toLocaleDateString(undefined, { dateStyle: 'long' })] }))] })] })] }));
12
+ }
13
+ return (_jsxs("section", { className: "space-y-12", children: [_jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "size-14 rounded-2xl bg-primary/10 flex items-center justify-center text-primary border border-primary/20 shadow-inner", children: _jsx(Timer, { size: 28 }) }), _jsxs("h3", { className: "text-4xl lg:text-5xl font-bold text-dashboard-text leading-none", children: ["Launch ", _jsx("span", { className: "text-primary", children: "Sequence" })] })] }), _jsxs(motion.div, { initial: { opacity: 0, y: 20 }, animate: { opacity: 1, y: 0 }, className: "bg-dashboard-card/50 border border-dashboard-border/50 p-10 rounded-[3rem] space-y-10 relative overflow-hidden", children: [_jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-10", children: [_jsxs("div", { className: "space-y-4", children: [_jsx("label", { className: "text-[10px] font-bold text-primary uppercase tracking-[0.3em] ml-2 opacity-60", children: "Deployment Date" }), _jsx("input", { type: "date", value: settings.launch_date ? settings.launch_date.split('T')[0] : '', onChange: (e) => {
14
+ const dateValue = e.target.value;
15
+ const currentTime = settings.launch_date?.includes('T') ? settings.launch_date.split('T')[1] : '00:00';
16
+ onUpdate({ launch_date: dateValue ? `${dateValue}T${currentTime}` : '' });
17
+ }, className: "w-full px-8 py-5 bg-dashboard-card/50 border border-dashboard-border/50 rounded-[2rem] text-sm font-bold outline-none focus:ring-4 focus:ring-primary/10 transition-all text-dashboard-text placeholder:text-neutral-500" })] }), _jsxs("div", { className: "space-y-4", children: [_jsx("label", { className: "text-[10px] font-bold text-primary uppercase tracking-[0.3em] ml-2 opacity-60", children: "Synchronization Time (24h)" }), _jsx("input", { type: "time", step: "60", value: settings.launch_date?.includes('T') ? settings.launch_date.split('T')[1] : '00:00', onChange: (e) => {
18
+ const timeValue = e.target.value;
19
+ const currentDate = settings.launch_date?.includes('T') ? settings.launch_date.split('T')[0] : new Date().toISOString().split('T')[0];
20
+ onUpdate({ launch_date: timeValue ? `${currentDate}T${timeValue}` : '' });
21
+ }, className: "w-full px-8 py-5 bg-dashboard-card/50 border border-dashboard-border/50 rounded-[2rem] text-sm font-bold outline-none focus:ring-4 focus:ring-primary/10 transition-all text-dashboard-text placeholder:text-neutral-500" })] })] }), _jsxs("div", { className: "bg-dashboard-card/50 border border-dashboard-border/50 p-8 rounded-[2rem] bg-primary/5 flex items-start gap-5 group", children: [_jsx("div", { className: "size-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary shrink-0 border border-primary/20", children: _jsx(Info, { size: 18 }) }), _jsx("p", { className: "text-xs text-neutral-500 dark:text-neutral-400 font-medium leading-relaxed", children: "The temporal countdown will be active on the system frontend. Upon reaching the zero-point, the architecture will automatically transition to an active production state." })] })] })] }));
22
+ }
@@ -0,0 +1,8 @@
1
+ import { LocaleDefinition } from '../../../types/settings';
2
+ interface LocalesManagementCardProps {
3
+ supportedLocales: LocaleDefinition[];
4
+ onUpdate: (locales: LocaleDefinition[]) => void;
5
+ }
6
+ export declare function LocalesManagementCard({ supportedLocales, onUpdate }: LocalesManagementCardProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=LocalesManagementCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalesManagementCard.d.ts","sourceRoot":"","sources":["../../../../src/views/Settings/components/LocalesManagementCard.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAU3D,UAAU,0BAA0B;IAChC,gBAAgB,EAAE,gBAAgB,EAAE,CAAC;IACrC,QAAQ,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;CACnD;AAED,wBAAgB,qBAAqB,CAAC,EAAE,gBAAgB,EAAE,QAAQ,EAAE,EAAE,0BAA0B,2CAmL/F"}