@fnd-platform/cms 1.0.0-alpha.15 → 1.0.0-alpha.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.
- package/lib/cms-project.d.ts.map +1 -1
- package/lib/cms-project.js +4 -0
- package/lib/cms-project.js.map +1 -1
- package/lib/templates/admin-content-edit-route.d.ts.map +1 -1
- package/lib/templates/admin-content-edit-route.js +3 -1
- package/lib/templates/admin-content-edit-route.js.map +1 -1
- package/lib/templates/admin-content-new-route.d.ts.map +1 -1
- package/lib/templates/admin-content-new-route.js +2 -1
- package/lib/templates/admin-content-new-route.js.map +1 -1
- package/lib/templates/admin-layout.d.ts.map +1 -1
- package/lib/templates/admin-layout.js +18 -6
- package/lib/templates/admin-layout.js.map +1 -1
- package/lib/templates/admin-settings-route.d.ts +9 -0
- package/lib/templates/admin-settings-route.d.ts.map +1 -0
- package/lib/templates/admin-settings-route.js +79 -0
- package/lib/templates/admin-settings-route.js.map +1 -0
- package/lib/templates/content-api.d.ts.map +1 -1
- package/lib/templates/content-api.js +3 -0
- package/lib/templates/content-api.js.map +1 -1
- package/lib/templates/content-editor.d.ts.map +1 -1
- package/lib/templates/content-editor.js +67 -29
- package/lib/templates/content-editor.js.map +1 -1
- package/lib/templates/content-schema.d.ts.map +1 -1
- package/lib/templates/content-schema.js +12 -5
- package/lib/templates/content-schema.js.map +1 -1
- package/lib/templates/index.d.ts +1 -0
- package/lib/templates/index.d.ts.map +1 -1
- package/lib/templates/index.js +4 -2
- package/lib/templates/index.js.map +1 -1
- package/lib/templates/media/media-api.d.ts.map +1 -1
- package/lib/templates/media/media-api.js +20 -8
- package/lib/templates/media/media-api.js.map +1 -1
- package/package.json +4 -4
package/lib/cms-project.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cms-project.d.ts","sourceRoot":"","sources":["../src/cms-project.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"cms-project.d.ts","sourceRoot":"","sources":["../src/cms-project.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AA6DtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,qBAAa,aAAc,SAAQ,kBAAkB;IACnD;;OAEG;IACH,SAAgB,WAAW,EAAE,OAAO,CAAC;IAErC;;OAEG;IACH,SAAgB,cAAc,EAAE,QAAQ,GAAG,SAAS,CAAC;IAErD;;;;;OAKG;gBACS,OAAO,EAAE,oBAAoB;IAoEzC;;;;;;;;;OASG;IACH,OAAO,CAAC,oBAAoB;IA0B5B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,uBAAuB;IA0B/B;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,mBAAmB;IA+C3B;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,yBAAyB;IA0FjC;;;;;;OAMG;IACH,OAAO,CAAC,wBAAwB;IAUhC;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,uBAAuB;CAqChC"}
|
package/lib/cms-project.js
CHANGED
|
@@ -218,6 +218,10 @@ class FndCmsProject extends frontend_1.FndFrontendProject {
|
|
|
218
218
|
new projen_1.SampleFile(this, 'app/routes/admin.content.$type.$id.tsx', {
|
|
219
219
|
contents: (0, templates_1.getAdminContentEditRouteTemplate)(),
|
|
220
220
|
});
|
|
221
|
+
// Settings route
|
|
222
|
+
new projen_1.SampleFile(this, 'app/routes/admin.settings.tsx', {
|
|
223
|
+
contents: (0, templates_1.getAdminSettingsRouteTemplate)(),
|
|
224
|
+
});
|
|
221
225
|
// Content API client
|
|
222
226
|
new projen_1.SampleFile(this, 'app/lib/content-api.ts', {
|
|
223
227
|
contents: (0, templates_1.getContentApiTemplate)(),
|
package/lib/cms-project.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cms-project.js","sourceRoot":"","sources":["../src/cms-project.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AACpC,qDAA4D;AAE5D,
|
|
1
|
+
{"version":3,"file":"cms-project.js","sourceRoot":"","sources":["../src/cms-project.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AACpC,qDAA4D;AAE5D,2CA0DqB;AAErB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAa,aAAc,SAAQ,6BAAkB;IACnD;;OAEG;IACa,WAAW,CAAU;IAErC;;OAEG;IACa,cAAc,CAAuB;IAErD;;;;;OAKG;IACH,YAAY,OAA6B;QACvC,4BAA4B;QAC5B,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC5D,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAC1D,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAC1D,CAAC;QAED,gCAAgC;QAChC,oEAAoE;QACpE,KAAK,CAAC;YACJ,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,IAAI,EAAE,IAAI,EAAE,2BAA2B;YACvC,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,IAAI,EAAE,sCAAsC;YAClE,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,oBAAoB,EAAE,QAAQ,EAAE,wCAAwC;SACzE,CAAC,C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YACnD,QAAQ,EAAE,IAAA,6BAAiB,GAAE;SAC9B,CAAC,CAAC;QAEH,IAAI,mBAAU,CAAC,IAAI,EAAE,4BAA4B,EAAE;YACjD,QAAQ,EAAE,IAAA,2BAAe,GAAE;SAC5B,CAAC,CAAC;IACL,CAAC;CACF;AAtYD,sCAsYC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-content-edit-route.d.ts","sourceRoot":"","sources":["../../src/templates/admin-content-edit-route.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,gCAAgC,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"admin-content-edit-route.d.ts","sourceRoot":"","sources":["../../src/templates/admin-content-edit-route.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,gCAAgC,IAAI,MAAM,CAyLzD"}
|
|
@@ -145,10 +145,12 @@ export async function action({ request, params }: ActionFunctionArgs) {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
try {
|
|
148
|
+
// Strip system fields that shouldn't be sent back to the API
|
|
149
|
+
const { id: _id, createdAt: _ca, updatedAt: _ua, authorId: _ai, contentType: _ct, ...fields } = data;
|
|
148
150
|
const input: UpdateContentInput = {
|
|
151
|
+
...fields,
|
|
149
152
|
slug: data.slug as string,
|
|
150
153
|
title: data.title as string,
|
|
151
|
-
excerpt: data.excerpt as string | undefined,
|
|
152
154
|
content: data.content as string,
|
|
153
155
|
status,
|
|
154
156
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-content-edit-route.js","sourceRoot":"","sources":["../../src/templates/admin-content-edit-route.ts"],"names":[],"mappings":";;AAOA,
|
|
1
|
+
{"version":3,"file":"admin-content-edit-route.js","sourceRoot":"","sources":["../../src/templates/admin-content-edit-route.ts"],"names":[],"mappings":";;AAOA,4EAyLC;AAhMD;;;;;;GAMG;AACH,SAAgB,gCAAgC;IAC9C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuLR,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-content-new-route.d.ts","sourceRoot":"","sources":["../../src/templates/admin-content-new-route.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,+BAA+B,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"admin-content-new-route.d.ts","sourceRoot":"","sources":["../../src/templates/admin-content-new-route.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,+BAA+B,IAAI,MAAM,CA0JxD"}
|
|
@@ -109,10 +109,11 @@ export async function action({ request, params }: ActionFunctionArgs) {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
try {
|
|
112
|
+
const { id: _id, createdAt: _ca, updatedAt: _ua, authorId: _ai, contentType: _ct, ...fields } = data;
|
|
112
113
|
const input: CreateContentInput = {
|
|
114
|
+
...fields,
|
|
113
115
|
slug: data.slug as string,
|
|
114
116
|
title: data.title as string,
|
|
115
|
-
excerpt: data.excerpt as string | undefined,
|
|
116
117
|
content: data.content as string,
|
|
117
118
|
contentType: type,
|
|
118
119
|
status,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-content-new-route.js","sourceRoot":"","sources":["../../src/templates/admin-content-new-route.ts"],"names":[],"mappings":";;AAOA,
|
|
1
|
+
{"version":3,"file":"admin-content-new-route.js","sourceRoot":"","sources":["../../src/templates/admin-content-new-route.ts"],"names":[],"mappings":";;AAOA,0EA0JC;AAjKD;;;;;;GAMG;AACH,SAAgB,+BAA+B;IAC7C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwJR,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-layout.d.ts","sourceRoot":"","sources":["../../src/templates/admin-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"admin-layout.d.ts","sourceRoot":"","sources":["../../src/templates/admin-layout.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CA6C/C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAdminLayoutTemplate = getAdminLayoutTemplate;
|
|
4
4
|
/**
|
|
5
5
|
* Generates the admin layout route template.
|
|
@@ -10,7 +10,7 @@ exports.getAdminLayoutTemplate = getAdminLayoutTemplate;
|
|
|
10
10
|
* @returns Template string for _admin.tsx
|
|
11
11
|
*/
|
|
12
12
|
function getAdminLayoutTemplate() {
|
|
13
|
-
|
|
13
|
+
return `import { json, type LoaderFunctionArgs } from '@remix-run/node';
|
|
14
14
|
import { Outlet, useLoaderData } from '@remix-run/react';
|
|
15
15
|
import { requireAuth, getOptionalUser, hasRole, hasAnyRole } from '~/lib/auth.server';
|
|
16
16
|
import { AdminSidebar } from '~/components/admin/sidebar';
|
|
@@ -23,11 +23,18 @@ export async function loader({ request }: LoaderFunctionArgs) {
|
|
|
23
23
|
const isAdmin = hasRole(user, 'admin');
|
|
24
24
|
const isEditor = hasAnyRole(user, ['admin', 'editor']);
|
|
25
25
|
|
|
26
|
-
return json({
|
|
26
|
+
return json({
|
|
27
|
+
user,
|
|
28
|
+
isAdmin,
|
|
29
|
+
isEditor,
|
|
30
|
+
ENV: {
|
|
31
|
+
API_URL: process.env.API_URL ?? '',
|
|
32
|
+
},
|
|
33
|
+
});
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
export default function AdminLayout() {
|
|
30
|
-
const { user, isAdmin, isEditor } = useLoaderData<typeof loader>();
|
|
37
|
+
const { user, isAdmin, isEditor, ENV } = useLoaderData<typeof loader>();
|
|
31
38
|
|
|
32
39
|
return (
|
|
33
40
|
<div className="flex h-screen bg-muted/30">
|
|
@@ -38,9 +45,14 @@ export default function AdminLayout() {
|
|
|
38
45
|
<Outlet context={{ user, isAdmin, isEditor }} />
|
|
39
46
|
</main>
|
|
40
47
|
</div>
|
|
48
|
+
<script
|
|
49
|
+
dangerouslySetInnerHTML={{
|
|
50
|
+
__html: \`window.ENV = \${JSON.stringify(ENV)}\`,
|
|
51
|
+
}}
|
|
52
|
+
/>
|
|
41
53
|
</div>
|
|
42
54
|
);
|
|
43
55
|
}
|
|
44
56
|
`;
|
|
45
57
|
}
|
|
46
|
-
//# sourceMappingURL=admin-layout.js.map
|
|
58
|
+
//# sourceMappingURL=admin-layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-layout.js","sourceRoot":"","sources":["../../src/templates/admin-layout.ts"],"names":[],"mappings":";;AAQA,
|
|
1
|
+
{"version":3,"file":"admin-layout.js","sourceRoot":"","sources":["../../src/templates/admin-layout.ts"],"names":[],"mappings":";;AAQA,wDA6CC;AArDD;;;;;;;GAOG;AACH,SAAgB,sBAAsB;IACpC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CR,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates the admin settings route template.
|
|
3
|
+
*
|
|
4
|
+
* This route provides a placeholder settings page with site configuration fields.
|
|
5
|
+
*
|
|
6
|
+
* @returns Template string for app/routes/admin.settings.tsx
|
|
7
|
+
*/
|
|
8
|
+
export declare function getAdminSettingsRouteTemplate(): string;
|
|
9
|
+
//# sourceMappingURL=admin-settings-route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-settings-route.d.ts","sourceRoot":"","sources":["../../src/templates/admin-settings-route.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,6BAA6B,IAAI,MAAM,CAmEtD"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAdminSettingsRouteTemplate = getAdminSettingsRouteTemplate;
|
|
4
|
+
/**
|
|
5
|
+
* Generates the admin settings route template.
|
|
6
|
+
*
|
|
7
|
+
* This route provides a placeholder settings page with site configuration fields.
|
|
8
|
+
*
|
|
9
|
+
* @returns Template string for app/routes/admin.settings.tsx
|
|
10
|
+
*/
|
|
11
|
+
function getAdminSettingsRouteTemplate() {
|
|
12
|
+
return `import { type MetaFunction, type LoaderFunctionArgs } from '@remix-run/node';
|
|
13
|
+
import { requireAuth } from '~/lib/auth.server';
|
|
14
|
+
|
|
15
|
+
export const meta: MetaFunction = () => {
|
|
16
|
+
return [{ title: 'Settings - CMS Admin' }];
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export async function loader({ request }: LoaderFunctionArgs) {
|
|
20
|
+
await requireAuth(request);
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default function SettingsPage() {
|
|
25
|
+
return (
|
|
26
|
+
<div className="space-y-6">
|
|
27
|
+
<div>
|
|
28
|
+
<h1 className="text-2xl font-bold">Settings</h1>
|
|
29
|
+
<p className="text-muted-foreground">
|
|
30
|
+
Configure your site settings.
|
|
31
|
+
</p>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div className="max-w-2xl space-y-6">
|
|
35
|
+
<div className="rounded-lg border bg-card p-6 space-y-4">
|
|
36
|
+
<div>
|
|
37
|
+
<h2 className="text-lg font-semibold">General</h2>
|
|
38
|
+
<p className="text-sm text-muted-foreground">
|
|
39
|
+
Basic site configuration.
|
|
40
|
+
</p>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div className="space-y-2">
|
|
44
|
+
<label htmlFor="site-name" className="text-sm font-medium">
|
|
45
|
+
Site Name
|
|
46
|
+
</label>
|
|
47
|
+
<input
|
|
48
|
+
id="site-name"
|
|
49
|
+
type="text"
|
|
50
|
+
placeholder="My Site"
|
|
51
|
+
className="flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"
|
|
52
|
+
disabled
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<div className="space-y-2">
|
|
57
|
+
<label htmlFor="site-description" className="text-sm font-medium">
|
|
58
|
+
Site Description
|
|
59
|
+
</label>
|
|
60
|
+
<textarea
|
|
61
|
+
id="site-description"
|
|
62
|
+
placeholder="A brief description of your site"
|
|
63
|
+
rows={3}
|
|
64
|
+
className="flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm"
|
|
65
|
+
disabled
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<p className="text-sm text-muted-foreground">
|
|
70
|
+
Settings management will be available in a future update.
|
|
71
|
+
</p>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
`;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=admin-settings-route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-settings-route.js","sourceRoot":"","sources":["../../src/templates/admin-settings-route.ts"],"names":[],"mappings":";;AAOA,sEAmEC;AA1ED;;;;;;GAMG;AACH,SAAgB,6BAA6B;IAC3C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiER,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-api.d.ts","sourceRoot":"","sources":["../../src/templates/content-api.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"content-api.d.ts","sourceRoot":"","sources":["../../src/templates/content-api.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CA0L9C"}
|
|
@@ -32,6 +32,7 @@ export interface ContentItem {
|
|
|
32
32
|
createdAt: string;
|
|
33
33
|
updatedAt: string;
|
|
34
34
|
publishedAt?: string;
|
|
35
|
+
[key: string]: unknown;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
/**
|
|
@@ -62,6 +63,7 @@ export interface CreateContentInput {
|
|
|
62
63
|
content: string;
|
|
63
64
|
contentType: string;
|
|
64
65
|
status?: 'draft' | 'published';
|
|
66
|
+
[key: string]: unknown;
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
/**
|
|
@@ -73,6 +75,7 @@ export interface UpdateContentInput {
|
|
|
73
75
|
excerpt?: string;
|
|
74
76
|
content?: string;
|
|
75
77
|
status?: 'draft' | 'published';
|
|
78
|
+
[key: string]: unknown;
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-api.js","sourceRoot":"","sources":["../../src/templates/content-api.ts"],"names":[],"mappings":";;AAOA,
|
|
1
|
+
{"version":3,"file":"content-api.js","sourceRoot":"","sources":["../../src/templates/content-api.ts"],"names":[],"mappings":";;AAOA,sDA0LC;AAjMD;;;;;;GAMG;AACH,SAAgB,qBAAqB;IACnC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwLR,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-editor.d.ts","sourceRoot":"","sources":["../../src/templates/content-editor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"content-editor.d.ts","sourceRoot":"","sources":["../../src/templates/content-editor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAoZjD"}
|
|
@@ -10,8 +10,8 @@ exports.getContentEditorTemplate = getContentEditorTemplate;
|
|
|
10
10
|
* @returns Template string for app/components/admin/content-editor.tsx
|
|
11
11
|
*/
|
|
12
12
|
function getContentEditorTemplate() {
|
|
13
|
-
return `import { useState, useEffect, useMemo } from 'react';
|
|
14
|
-
import {
|
|
13
|
+
return `import { useState, useEffect, useMemo, useRef, useCallback } from 'react';
|
|
14
|
+
import { useActionData, useFetcher, Link } from '@remix-run/react';
|
|
15
15
|
import { Save, Eye, Archive, Trash2, ArrowLeft } from 'lucide-react';
|
|
16
16
|
import type { ContentType, FieldDefinition } from '~/lib/content-types';
|
|
17
17
|
import { generateContentSchema, validateContent, getFieldError } from '~/lib/content-schema';
|
|
@@ -77,24 +77,56 @@ export function ContentEditor({
|
|
|
77
77
|
cancelUrl,
|
|
78
78
|
permissions,
|
|
79
79
|
}: ContentEditorProps) {
|
|
80
|
-
const navigation = useNavigation();
|
|
81
80
|
const actionData = useActionData<ContentActionData>();
|
|
82
81
|
const fetcher = useFetcher<ContentActionData>();
|
|
82
|
+
const formRef = useRef<HTMLFormElement>(null);
|
|
83
83
|
|
|
84
|
-
//
|
|
85
|
-
const isSubmitting =
|
|
84
|
+
// Track submission manually - hydration errors can break fetcher.state transitions
|
|
85
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
86
|
+
const submissionCount = useRef(0);
|
|
86
87
|
|
|
87
88
|
// Use fetcher data if available, otherwise fall back to actionData
|
|
88
89
|
const responseData = fetcher.data ?? actionData;
|
|
89
90
|
|
|
91
|
+
// When fetcher gets data back, clear submitting state
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
if (fetcher.data) {
|
|
94
|
+
setIsSubmitting(false);
|
|
95
|
+
}
|
|
96
|
+
}, [fetcher.data]);
|
|
97
|
+
|
|
98
|
+
// Safety: clear submitting after timeout in case fetcher state gets stuck
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
if (!isSubmitting) return;
|
|
101
|
+
const timer = setTimeout(() => setIsSubmitting(false), 15000);
|
|
102
|
+
return () => clearTimeout(timer);
|
|
103
|
+
}, [isSubmitting]);
|
|
104
|
+
|
|
90
105
|
// Handle redirect after successful action
|
|
91
106
|
useEffect(() => {
|
|
92
107
|
if (responseData?.success && responseData?.redirectTo) {
|
|
93
|
-
// Use window.location for reliable navigation with CloudFront/Lambda
|
|
94
108
|
window.location.href = responseData.redirectTo;
|
|
95
109
|
}
|
|
96
110
|
}, [responseData]);
|
|
97
111
|
|
|
112
|
+
// Submit using fetcher but track state manually
|
|
113
|
+
const handleSubmit = useCallback((formEl: HTMLFormElement, actionValue: string) => {
|
|
114
|
+
if (isSubmitting) return;
|
|
115
|
+
setIsSubmitting(true);
|
|
116
|
+
const count = ++submissionCount.current;
|
|
117
|
+
|
|
118
|
+
const fd = new FormData(formEl);
|
|
119
|
+
fd.set('_action', actionValue);
|
|
120
|
+
fetcher.submit(fd, { method: 'post' });
|
|
121
|
+
|
|
122
|
+
// Fallback: if fetcher.data never fires, clear after delay
|
|
123
|
+
setTimeout(() => {
|
|
124
|
+
if (submissionCount.current === count) {
|
|
125
|
+
setIsSubmitting(false);
|
|
126
|
+
}
|
|
127
|
+
}, 10000);
|
|
128
|
+
}, [isSubmitting, fetcher]);
|
|
129
|
+
|
|
98
130
|
// Initialize form data from initial data or defaults
|
|
99
131
|
const [formData, setFormData] = useState<Record<string, unknown>>(() => {
|
|
100
132
|
const data: Record<string, unknown> = {
|
|
@@ -181,10 +213,10 @@ export function ContentEditor({
|
|
|
181
213
|
<div className="flex items-center justify-between">
|
|
182
214
|
<div className="flex items-center gap-4">
|
|
183
215
|
<Button variant="ghost" size="sm" asChild>
|
|
184
|
-
<
|
|
216
|
+
<Link to={cancelUrl}>
|
|
185
217
|
<ArrowLeft className="h-4 w-4 mr-2" />
|
|
186
218
|
Back
|
|
187
|
-
</
|
|
219
|
+
</Link>
|
|
188
220
|
</Button>
|
|
189
221
|
<div>
|
|
190
222
|
<h1 className="text-2xl font-bold">
|
|
@@ -206,13 +238,12 @@ export function ContentEditor({
|
|
|
206
238
|
</div>
|
|
207
239
|
</div>
|
|
208
240
|
|
|
209
|
-
{/* Form
|
|
210
|
-
<
|
|
241
|
+
{/* Form */}
|
|
242
|
+
<form
|
|
243
|
+
ref={formRef}
|
|
211
244
|
method="post"
|
|
212
245
|
onSubmit={(e) => {
|
|
213
|
-
|
|
214
|
-
e.preventDefault();
|
|
215
|
-
}
|
|
246
|
+
e.preventDefault();
|
|
216
247
|
}}
|
|
217
248
|
>
|
|
218
249
|
{/* Hidden field with serialized form data */}
|
|
@@ -257,11 +288,14 @@ export function ContentEditor({
|
|
|
257
288
|
<CardContent className="space-y-3">
|
|
258
289
|
{/* Save Draft */}
|
|
259
290
|
<Button
|
|
260
|
-
type="
|
|
261
|
-
name="_action"
|
|
262
|
-
value="save"
|
|
291
|
+
type="button"
|
|
263
292
|
className="w-full"
|
|
264
293
|
disabled={isSubmitting}
|
|
294
|
+
onClick={() => {
|
|
295
|
+
if (validateForm() && formRef.current) {
|
|
296
|
+
handleSubmit(formRef.current, 'save');
|
|
297
|
+
}
|
|
298
|
+
}}
|
|
265
299
|
>
|
|
266
300
|
<Save className="h-4 w-4 mr-2" />
|
|
267
301
|
{isSubmitting ? 'Saving...' : 'Save Draft'}
|
|
@@ -272,24 +306,30 @@ export function ContentEditor({
|
|
|
272
306
|
<>
|
|
273
307
|
{!isPublished ? (
|
|
274
308
|
<Button
|
|
275
|
-
type="
|
|
276
|
-
name="_action"
|
|
277
|
-
value="publish"
|
|
309
|
+
type="button"
|
|
278
310
|
variant="secondary"
|
|
279
311
|
className="w-full"
|
|
280
312
|
disabled={isSubmitting}
|
|
313
|
+
onClick={() => {
|
|
314
|
+
if (validateForm() && formRef.current) {
|
|
315
|
+
handleSubmit(formRef.current, 'publish');
|
|
316
|
+
}
|
|
317
|
+
}}
|
|
281
318
|
>
|
|
282
319
|
<Eye className="h-4 w-4 mr-2" />
|
|
283
320
|
Publish
|
|
284
321
|
</Button>
|
|
285
322
|
) : (
|
|
286
323
|
<Button
|
|
287
|
-
type="
|
|
288
|
-
name="_action"
|
|
289
|
-
value="unpublish"
|
|
324
|
+
type="button"
|
|
290
325
|
variant="secondary"
|
|
291
326
|
className="w-full"
|
|
292
327
|
disabled={isSubmitting}
|
|
328
|
+
onClick={() => {
|
|
329
|
+
if (validateForm() && formRef.current) {
|
|
330
|
+
handleSubmit(formRef.current, 'unpublish');
|
|
331
|
+
}
|
|
332
|
+
}}
|
|
293
333
|
>
|
|
294
334
|
<Archive className="h-4 w-4 mr-2" />
|
|
295
335
|
Unpublish
|
|
@@ -301,15 +341,13 @@ export function ContentEditor({
|
|
|
301
341
|
{/* Delete */}
|
|
302
342
|
{mode === 'edit' && permissions.canDelete && (
|
|
303
343
|
<Button
|
|
304
|
-
type="
|
|
305
|
-
name="_action"
|
|
306
|
-
value="delete"
|
|
344
|
+
type="button"
|
|
307
345
|
variant="destructive"
|
|
308
346
|
className="w-full"
|
|
309
347
|
disabled={isSubmitting}
|
|
310
|
-
onClick={(
|
|
311
|
-
if (
|
|
312
|
-
|
|
348
|
+
onClick={() => {
|
|
349
|
+
if (confirm('Are you sure you want to delete this content?') && formRef.current) {
|
|
350
|
+
handleSubmit(formRef.current, 'delete');
|
|
313
351
|
}
|
|
314
352
|
}}
|
|
315
353
|
>
|
|
@@ -361,7 +399,7 @@ export function ContentEditor({
|
|
|
361
399
|
<p className="text-sm text-destructive">{responseData.message}</p>
|
|
362
400
|
</div>
|
|
363
401
|
)}
|
|
364
|
-
</
|
|
402
|
+
</form>
|
|
365
403
|
</div>
|
|
366
404
|
);
|
|
367
405
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-editor.js","sourceRoot":"","sources":["../../src/templates/content-editor.ts"],"names":[],"mappings":";;AAQA,
|
|
1
|
+
{"version":3,"file":"content-editor.js","sourceRoot":"","sources":["../../src/templates/content-editor.ts"],"names":[],"mappings":";;AAQA,4DAoZC;AA5ZD;;;;;;;GAOG;AACH,SAAgB,wBAAwB;IACtC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkZR,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-schema.d.ts","sourceRoot":"","sources":["../../src/templates/content-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"content-schema.d.ts","sourceRoot":"","sources":["../../src/templates/content-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CA4QjD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getContentSchemaTemplate = getContentSchemaTemplate;
|
|
4
4
|
/**
|
|
5
5
|
* Generates the content schema template for Zod validation.
|
|
@@ -10,7 +10,7 @@ exports.getContentSchemaTemplate = getContentSchemaTemplate;
|
|
|
10
10
|
* @returns Template string for app/lib/content-schema.ts
|
|
11
11
|
*/
|
|
12
12
|
function getContentSchemaTemplate() {
|
|
13
|
-
|
|
13
|
+
return `/**
|
|
14
14
|
* Content Schema Generation
|
|
15
15
|
*
|
|
16
16
|
* This module generates Zod schemas from content type field definitions
|
|
@@ -179,7 +179,14 @@ export function generateFieldSchema(field: FieldDefinition): z.ZodTypeAny {
|
|
|
179
179
|
|
|
180
180
|
// Make optional if not required
|
|
181
181
|
if (!field.required) {
|
|
182
|
-
|
|
182
|
+
// For fields that default to empty string in the form,
|
|
183
|
+
// allow empty string as equivalent to "not provided"
|
|
184
|
+
const emptyStringTypes = ['date', 'datetime', 'select', 'text', 'textarea', 'richtext', 'slug', 'media', 'reference'];
|
|
185
|
+
if (emptyStringTypes.includes(field.type)) {
|
|
186
|
+
schema = z.union([z.literal(''), schema]).optional();
|
|
187
|
+
} else {
|
|
188
|
+
schema = schema.optional();
|
|
189
|
+
}
|
|
183
190
|
}
|
|
184
191
|
|
|
185
192
|
return schema;
|
|
@@ -271,4 +278,4 @@ export function hasFieldError(
|
|
|
271
278
|
}
|
|
272
279
|
`;
|
|
273
280
|
}
|
|
274
|
-
//# sourceMappingURL=content-schema.js.map
|
|
281
|
+
//# sourceMappingURL=content-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-schema.js","sourceRoot":"","sources":["../../src/templates/content-schema.ts"],"names":[],"mappings":";;AAQA,
|
|
1
|
+
{"version":3,"file":"content-schema.js","sourceRoot":"","sources":["../../src/templates/content-schema.ts"],"names":[],"mappings":";;AAQA,4DA4QC;AApRD;;;;;;;GAOG;AACH,SAAgB,wBAAwB;IACtC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0QR,CAAC;AACF,CAAC"}
|
package/lib/templates/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { getAdminContentRouteTemplate, getAdminContentIndexTemplate } from './ad
|
|
|
10
10
|
export { getAdminContentTypeRouteTemplate } from './admin-content-type-route';
|
|
11
11
|
export { getAdminContentNewRouteTemplate } from './admin-content-new-route';
|
|
12
12
|
export { getAdminContentEditRouteTemplate } from './admin-content-edit-route';
|
|
13
|
+
export { getAdminSettingsRouteTemplate } from './admin-settings-route';
|
|
13
14
|
export { getContentApiTemplate } from './content-api';
|
|
14
15
|
export { getAdminSidebarTemplate } from './admin-sidebar';
|
|
15
16
|
export { getAdminHeaderTemplate } from './admin-header';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAC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AO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAG/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EACL,8BAA8B,EAC9B,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC3B,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC"}
|
package/lib/templates/index.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* in the user's CMS package when FndCmsProject is synthesized.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
10
|
-
exports.getTabsTemplate = void 0;
|
|
9
|
+
exports.getProgressTemplate = exports.getMediaLibraryRouteTemplate = exports.getMediaApiTemplate = exports.getMediaPickerTemplate = exports.getMediaGridTemplate = exports.getMediaUploaderTemplate = exports.getReferenceFieldTemplate = exports.getTagsFieldTemplate = exports.getNumberFieldTemplate = exports.getBooleanFieldTemplate = exports.getDatetimeFieldTemplate = exports.getDateFieldTemplate = exports.getMultiselectFieldTemplate = exports.getSelectFieldTemplate = exports.getMediaFieldTemplate = exports.getSlugFieldTemplate = exports.getRichtextFieldTemplate = exports.getTextareaFieldTemplate = exports.getTextFieldTemplate = exports.getFormFieldsIndexTemplate = exports.getPageContentTypeTemplate = exports.getBlogPostContentTypeTemplate = exports.getContentEditorTemplate = exports.getContentTypesRegistryTemplate = exports.getSlugUtilsTemplate = exports.getContentSchemaTemplate = exports.getContentTypesTemplate = exports.getRichTextEditorTemplate = exports.getEditorToolbarTemplate = exports.getSelectTemplate = exports.getPopoverTemplate = exports.getTableTemplate = exports.getDropdownMenuTemplate = exports.getAvatarTemplate = exports.getBadgeTemplate = exports.getContentTableTemplate = exports.getRecentContentTemplate = exports.getDashboardStatsTemplate = exports.getAdminBreadcrumbsTemplate = exports.getAdminHeaderTemplate = exports.getAdminSidebarTemplate = exports.getContentApiTemplate = exports.getAdminSettingsRouteTemplate = exports.getAdminContentEditRouteTemplate = exports.getAdminContentNewRouteTemplate = exports.getAdminContentTypeRouteTemplate = exports.getAdminContentIndexTemplate = exports.getAdminContentRouteTemplate = exports.getAdminIndexTemplate = exports.getAdminLayoutTemplate = void 0;
|
|
10
|
+
exports.getTabsTemplate = exports.getDialogTemplate = void 0;
|
|
11
11
|
// Route templates
|
|
12
12
|
var admin_layout_1 = require("./admin-layout");
|
|
13
13
|
Object.defineProperty(exports, "getAdminLayoutTemplate", { enumerable: true, get: function () { return admin_layout_1.getAdminLayoutTemplate; } });
|
|
@@ -22,6 +22,8 @@ var admin_content_new_route_1 = require("./admin-content-new-route");
|
|
|
22
22
|
Object.defineProperty(exports, "getAdminContentNewRouteTemplate", { enumerable: true, get: function () { return admin_content_new_route_1.getAdminContentNewRouteTemplate; } });
|
|
23
23
|
var admin_content_edit_route_1 = require("./admin-content-edit-route");
|
|
24
24
|
Object.defineProperty(exports, "getAdminContentEditRouteTemplate", { enumerable: true, get: function () { return admin_content_edit_route_1.getAdminContentEditRouteTemplate; } });
|
|
25
|
+
var admin_settings_route_1 = require("./admin-settings-route");
|
|
26
|
+
Object.defineProperty(exports, "getAdminSettingsRouteTemplate", { enumerable: true, get: function () { return admin_settings_route_1.getAdminSettingsRouteTemplate; } });
|
|
25
27
|
// Content API client
|
|
26
28
|
var content_api_1 = require("./content-api");
|
|
27
29
|
Object.defineProperty(exports, "getContentApiTemplate", { enumerable: true, get: function () { return content_api_1.getContentApiTemplate; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,kBAAkB;AAClB,+CAAwD;AAA/C,sHAAA,sBAAsB,OAAA;AAC/B,6CAAsD;AAA7C,oHAAA,qBAAqB,OAAA;AAC9B,6DAAmG;AAA1F,mIAAA,4BAA4B,OAAA;AAAE,mIAAA,4BAA4B,OAAA;AACnE,uEAA8E;AAArE,4IAAA,gCAAgC,OAAA;AACzC,qEAA4E;AAAnE,0IAAA,+BAA+B,OAAA;AACxC,uEAA8E;AAArE,4IAAA,gCAAgC,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,kBAAkB;AAClB,+CAAwD;AAA/C,sHAAA,sBAAsB,OAAA;AAC/B,6CAAsD;AAA7C,oHAAA,qBAAqB,OAAA;AAC9B,6DAAmG;AAA1F,mIAAA,4BAA4B,OAAA;AAAE,mIAAA,4BAA4B,OAAA;AACnE,uEAA8E;AAArE,4IAAA,gCAAgC,OAAA;AACzC,qEAA4E;AAAnE,0IAAA,+BAA+B,OAAA;AACxC,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mHAAA,oBAAoB,OAAA;AACpB,oHAAA,qBAAqB,OAAA;AACrB,qHAAA,sBAAsB,OAAA;AACtB,0HAAA,2BAA2B,OAAA;AAC3B,mHAAA,oBAAoB,OAAA;AACpB,uHAAA,wBAAwB,OAAA;AACxB,sHAAA,uBAAuB,OAAA;AACvB,qHAAA,sBAAsB,OAAA;AACtB,mHAAA,oBAAoB,OAAA;AACpB,wHAAA,yBAAyB,OAAA;AAG3B,0BAA0B;AAC1B,iCAMiB;AALf,iHAAA,wBAAwB,OAAA;AACxB,6GAAA,oBAAoB,OAAA;AACpB,+GAAA,sBAAsB,OAAA;AACtB,4GAAA,mBAAmB,OAAA;AACnB,qHAAA,4BAA4B,OAAA;AAG9B,oCAAoC;AACpC,6CAAoD;AAA3C,kHAAA,mBAAmB,OAAA;AAC5B,yCAAgD;AAAvC,8GAAA,iBAAiB,OAAA;AAC1B,qCAA4C;AAAnC,0GAAA,eAAe,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-api.d.ts","sourceRoot":"","sources":["../../../src/templates/media/media-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"media-api.d.ts","sourceRoot":"","sources":["../../../src/templates/media/media-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CA8Q5C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getMediaApiTemplate = getMediaApiTemplate;
|
|
4
4
|
/**
|
|
5
5
|
* Generates the media API client template.
|
|
@@ -13,7 +13,7 @@ exports.getMediaApiTemplate = getMediaApiTemplate;
|
|
|
13
13
|
* @returns Template string for app/lib/media-api.ts
|
|
14
14
|
*/
|
|
15
15
|
function getMediaApiTemplate() {
|
|
16
|
-
|
|
16
|
+
return `/**
|
|
17
17
|
* Media API client for presigned URL uploads.
|
|
18
18
|
*
|
|
19
19
|
* This module handles the upload flow:
|
|
@@ -43,6 +43,18 @@ export interface UploadOptions {
|
|
|
43
43
|
signal?: AbortSignal;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Get the API base URL.
|
|
48
|
+
* In the browser, reads from window.ENV.API_URL (set by the root loader).
|
|
49
|
+
* Falls back to '/api' for local development.
|
|
50
|
+
*/
|
|
51
|
+
function getApiUrl(): string {
|
|
52
|
+
if (typeof window !== 'undefined' && (window as any).ENV?.API_URL) {
|
|
53
|
+
return (window as any).ENV.API_URL.replace(/\\/$/, '');
|
|
54
|
+
}
|
|
55
|
+
return '/api';
|
|
56
|
+
}
|
|
57
|
+
|
|
46
58
|
/**
|
|
47
59
|
* Allowed media MIME types.
|
|
48
60
|
*/
|
|
@@ -89,7 +101,7 @@ export async function getUploadUrl(file: File): Promise<{
|
|
|
89
101
|
id: string;
|
|
90
102
|
expiresIn: number;
|
|
91
103
|
}> {
|
|
92
|
-
const response = await fetch(
|
|
104
|
+
const response = await fetch(\`\${getApiUrl()}/media/upload-url\`, {
|
|
93
105
|
method: 'POST',
|
|
94
106
|
headers: {
|
|
95
107
|
'Content-Type': 'application/json',
|
|
@@ -169,7 +181,7 @@ export async function createMediaRecord(params: {
|
|
|
169
181
|
mimeType: string;
|
|
170
182
|
size: number;
|
|
171
183
|
}): Promise<MediaItem> {
|
|
172
|
-
const response = await fetch(
|
|
184
|
+
const response = await fetch(\`\${getApiUrl()}/media\`, {
|
|
173
185
|
method: 'POST',
|
|
174
186
|
headers: {
|
|
175
187
|
'Content-Type': 'application/json',
|
|
@@ -233,7 +245,7 @@ export async function listMedia(params: {
|
|
|
233
245
|
if (params.cursor) searchParams.set('cursor', params.cursor);
|
|
234
246
|
if (params.type) searchParams.set('type', params.type);
|
|
235
247
|
|
|
236
|
-
const url =
|
|
248
|
+
const url = \`\${getApiUrl()}/media?\${searchParams.toString()}\`;
|
|
237
249
|
const response = await fetch(url);
|
|
238
250
|
|
|
239
251
|
if (!response.ok) {
|
|
@@ -249,7 +261,7 @@ export async function listMedia(params: {
|
|
|
249
261
|
* Delete a media item.
|
|
250
262
|
*/
|
|
251
263
|
export async function deleteMedia(id: string): Promise<void> {
|
|
252
|
-
const response = await fetch(
|
|
264
|
+
const response = await fetch(\`\${getApiUrl()}/media/\${id}\`, {
|
|
253
265
|
method: 'DELETE',
|
|
254
266
|
});
|
|
255
267
|
|
|
@@ -271,4 +283,4 @@ export function formatFileSize(bytes: number): string {
|
|
|
271
283
|
}
|
|
272
284
|
`;
|
|
273
285
|
}
|
|
274
|
-
//# sourceMappingURL=media-api.js.map
|
|
286
|
+
//# sourceMappingURL=media-api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-api.js","sourceRoot":"","sources":["../../../src/templates/media/media-api.ts"],"names":[],"mappings":";;AAWA,
|
|
1
|
+
{"version":3,"file":"media-api.js","sourceRoot":"","sources":["../../../src/templates/media/media-api.ts"],"names":[],"mappings":";;AAWA,kDA8QC;AAzRD;;;;;;;;;;GAUG;AACH,SAAgB,mBAAmB;IACjC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4QR,CAAC;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fnd-platform/cms",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.17",
|
|
4
4
|
"description": "Projen project class for generating CMS admin packages in fnd-platform",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"projen": "^0.91.0",
|
|
12
|
-
"@fnd-platform/api": "^1.0.0-alpha.
|
|
13
|
-
"@fnd-platform/core": "^1.0.0-alpha.
|
|
14
|
-
"@fnd-platform/frontend": "^1.0.0-alpha.
|
|
12
|
+
"@fnd-platform/api": "^1.0.0-alpha.11",
|
|
13
|
+
"@fnd-platform/core": "^1.0.0-alpha.6",
|
|
14
|
+
"@fnd-platform/frontend": "^1.0.0-alpha.15"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"projen": "^0.91.0"
|