@oktis-works/admin 0.3.5 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/client/_astro/ActivityWidget.B1PK1jNM.js +16 -0
  2. package/dist/client/_astro/AdminBar.DGqkNINI.js +234 -0
  3. package/dist/client/_astro/AtGlanceWidget.CbAM9D09.js +43 -0
  4. package/dist/client/_astro/BaseLayout.B2MfKf6B.css +1 -0
  5. package/dist/client/_astro/ContentEditor.BG7DWach.js +1 -0
  6. package/dist/client/_astro/ContentList.CfGc6HN5.js +1 -0
  7. package/dist/client/_astro/DashboardHome._7yIrBzf.js +1 -0
  8. package/dist/client/_astro/DashboardLayout.DrKf2Klk.css +1 -0
  9. package/dist/client/_astro/DashboardLayout.astro_astro_type_script_index_0_lang.BrC4PbPa.js +1 -0
  10. package/dist/client/_astro/Footer.CjhzORqz.js +74 -0
  11. package/dist/client/_astro/GeneralSettings.BwnPXbvc.js +1 -0
  12. package/dist/client/_astro/HelpTabs.Ddud8gs3.js +103 -0
  13. package/dist/client/_astro/LanguageSelector.Dx6zaHYm.js +14 -0
  14. package/dist/client/_astro/MediaLibrary.BXUJ5yFA.js +1 -0
  15. package/dist/client/_astro/PostTypesManager.CA2yTVB_.js +1 -0
  16. package/dist/client/_astro/QuickDraftWidget.CCKwWLpX.js +17 -0
  17. package/dist/client/_astro/ScreenOptions.Dgiw-9ow.js +70 -0
  18. package/dist/client/_astro/TaxonomiesManager.D3HNo_oM.js +1 -0
  19. package/dist/client/_astro/UserCreateForm.CTv1Gd43.js +1 -0
  20. package/dist/client/_astro/UsersManager.DPpSVGNe.js +1 -0
  21. package/dist/client/_astro/api.DTNuyqvx.js +1 -0
  22. package/dist/client/_astro/ar.CzsjUutD.js +1 -0
  23. package/dist/client/_astro/{client.BY0Z100j.js → client.C7p516_9.js} +1 -1
  24. package/dist/client/_astro/en.DmN7xy_a.js +1 -0
  25. package/dist/client/_astro/es-ES.p2TLEMlZ.js +1 -0
  26. package/dist/client/_astro/{extensions.JQggUqT5.js → extensions.DfxrGzbo.js} +1 -1
  27. package/dist/client/_astro/he.BnYHiYpn.js +1 -0
  28. package/dist/client/_astro/i18n.CLOpd2JA.js +1 -0
  29. package/dist/client/_astro/it.WrWKBEAD.js +1 -0
  30. package/dist/client/_astro/ja.DxnfhIdt.js +1 -0
  31. package/dist/client/_astro/login.astro_astro_type_script_index_0_lang.CLM9X6sQ.js +1 -0
  32. package/dist/client/_astro/pl.jUj-RfZS.js +1 -0
  33. package/dist/client/_astro/pt-BR.DtNwEO0i.js +1 -0
  34. package/dist/client/_astro/ru.KFSfdjWn.js +1 -0
  35. package/dist/client/_astro/{src.DX_xrAwd.js → src.Cgonpfb5.js} +1 -1
  36. package/dist/client/_astro/sw.3jlAOLOv.js +1 -0
  37. package/dist/client/_astro/tr.tnLMnGPg.js +1 -0
  38. package/dist/client/_astro/uk.VquHY_xc.js +1 -0
  39. package/dist/client/_astro/version.BAM_tCGw.js +1 -0
  40. package/dist/client/_astro/{web.D_vCtCLj.js → web.D1H9RxZL.js} +1 -1
  41. package/dist/client/_astro/yo.Cr8hCb5u.js +1 -0
  42. package/dist/client/_astro/zh-CN.E32QqP4v.js +1 -0
  43. package/dist/server/chunks/{BaseLayout_CcUFilW5.mjs → BaseLayout_GUKuUGNt.mjs} +4 -1
  44. package/dist/server/chunks/{ContentEditor_DtKBw5Nv.mjs → ContentEditor_D_mc9cIc.mjs} +38 -24
  45. package/dist/server/chunks/DashboardLayout_DVdPm1iI.mjs +2084 -0
  46. package/dist/server/chunks/{MediaLibrary_BDyBahZ3.mjs → MediaLibrary_BV1YB_7x.mjs} +90 -65
  47. package/dist/server/chunks/{_slug__DNJwUFYD.mjs → _slug__D0xMd1Ym.mjs} +1 -1
  48. package/dist/server/chunks/ar_DBjdWIJ0.mjs +408 -0
  49. package/dist/server/chunks/{edit_CSA-bTD0.mjs → edit_DmKkdawE.mjs} +8 -4
  50. package/dist/server/chunks/en_C750mYKk.mjs +408 -0
  51. package/dist/server/chunks/es-ES_TJ4oK1yi.mjs +408 -0
  52. package/dist/server/chunks/{general_D8esOFBG.mjs → general_CfZaFpuy.mjs} +50 -39
  53. package/dist/server/chunks/he_TWsuTphz.mjs +408 -0
  54. package/dist/server/chunks/index_BHrVcd5b.mjs +27 -0
  55. package/dist/server/chunks/{index_BzJtUv3l.mjs → index_BjydUJNY.mjs} +9 -5
  56. package/dist/server/chunks/{index__EF7aYFm.mjs → index_BoeLyrhK.mjs} +91 -45
  57. package/dist/server/chunks/{index_CSD_Oyb4.mjs → index_D_aAiDE0.mjs} +61 -38
  58. package/dist/server/chunks/index_GAl799IJ.mjs +152 -0
  59. package/dist/server/chunks/it_CEVFVWh1.mjs +408 -0
  60. package/dist/server/chunks/ja_CqDirMqf.mjs +408 -0
  61. package/dist/server/chunks/login_B7FSWUaM.mjs +24 -0
  62. package/dist/server/chunks/{new_C7iXK0wp.mjs → new_BRMGHdiW.mjs} +8 -4
  63. package/dist/server/chunks/{new_Dg7GlHuV.mjs → new_DkKhl-3k.mjs} +30 -14
  64. package/dist/server/chunks/pl_ChIKxfZG.mjs +408 -0
  65. package/dist/server/chunks/post-types_B7f9RrsE.mjs +158 -0
  66. package/dist/server/chunks/pt-BR_4d4jZWL0.mjs +408 -0
  67. package/dist/server/chunks/ru_CIc6O5Q7.mjs +408 -0
  68. package/dist/server/chunks/sw_Bs3iYVDM.mjs +408 -0
  69. package/dist/server/chunks/{taxonomies_BJehVfgw.mjs → taxonomies_DadZj79u.mjs} +31 -14
  70. package/dist/server/chunks/tr_C7JbXuoQ.mjs +408 -0
  71. package/dist/server/chunks/uk_Dibs8Wkc.mjs +408 -0
  72. package/dist/server/chunks/{upload_CeK7uSwz.mjs → upload_CMYjz_4a.mjs} +9 -5
  73. package/dist/server/chunks/yo_B6MPvz_U.mjs +408 -0
  74. package/dist/server/chunks/zh-CN_G1Dc2b28.mjs +408 -0
  75. package/dist/server/entry.mjs +15 -15
  76. package/package.json +4 -4
  77. package/dist/client/_astro/BaseLayout.BPkaFsmK.css +0 -1
  78. package/dist/client/_astro/ContentEditor.Buc5ptK0.js +0 -1
  79. package/dist/client/_astro/ContentList.Bo_ok2oa.js +0 -1
  80. package/dist/client/_astro/DashboardHome.DKuoH-SO.js +0 -1
  81. package/dist/client/_astro/DashboardLayout.astro_astro_type_script_index_0_lang.DfB7XHS-.js +0 -1
  82. package/dist/client/_astro/GeneralSettings.BNzHpRY6.js +0 -1
  83. package/dist/client/_astro/MediaLibrary.Dn4DRbZb.js +0 -1
  84. package/dist/client/_astro/PostTypesManager.6GQ4vWY1.js +0 -1
  85. package/dist/client/_astro/TaxonomiesManager.B25xOjSO.js +0 -1
  86. package/dist/client/_astro/UserCreateForm.DtBifGTo.js +0 -1
  87. package/dist/client/_astro/UsersManager.-5jU3GxA.js +0 -1
  88. package/dist/client/_astro/api.BEC1o0dT.js +0 -1
  89. package/dist/client/_astro/login.astro_astro_type_script_index_0_lang.Dz6HvEV3.js +0 -1
  90. package/dist/server/chunks/DashboardLayout_Bpur473M.mjs +0 -442
  91. package/dist/server/chunks/api_i8T-MI6L.mjs +0 -278
  92. package/dist/server/chunks/index_BCUHGT54.mjs +0 -133
  93. package/dist/server/chunks/index_X49R9glL.mjs +0 -23
  94. package/dist/server/chunks/login_C04LKHw3.mjs +0 -23
  95. package/dist/server/chunks/post-types_CJt6sMSh.mjs +0 -137
@@ -1,278 +0,0 @@
1
- //#region src/lib/api.ts
2
- var API_BASE = "http://localhost:3000";
3
- var ApiClient = class {
4
- baseUrl;
5
- csrfToken = null;
6
- isRefreshing = false;
7
- constructor(baseUrl = API_BASE) {
8
- this.baseUrl = baseUrl;
9
- }
10
- /** Inicializa lendo CSRF do cookie (chamado no boot da app) */
11
- async init() {
12
- try {
13
- await fetch(`${this.baseUrl}/api/v1/auth/me`, { credentials: "include" });
14
- } catch {}
15
- }
16
- /** Sessão válida — verifica via /me (usa cookies HttpOnly automaticamente) */
17
- async isLoggedIn() {
18
- try {
19
- return (await fetch(`${this.baseUrl}/api/v1/auth/me`, { credentials: "include" })).ok;
20
- } catch {
21
- return false;
22
- }
23
- }
24
- /** Obtém tenantId do backend via /me */
25
- async getTenantId() {
26
- try {
27
- const res = await fetch(`${this.baseUrl}/api/v1/auth/me`, { credentials: "include" });
28
- if (!res.ok) return null;
29
- return (await res.json()).tenantId ?? null;
30
- } catch {
31
- return null;
32
- }
33
- }
34
- /** Login — o backend seta cookies HttpOnly e CSRF; retorna user + tenantId */
35
- async login(input) {
36
- return await this.request("POST", "/api/v1/auth/login", input);
37
- }
38
- /** Logout — limpa cookies no backend */
39
- async logout() {
40
- await this.request("POST", "/api/v1/auth/logout", {});
41
- this.csrfToken = null;
42
- }
43
- /** Refresh de access token via cookie refresh_token */
44
- async refreshTokens() {
45
- if (this.isRefreshing) return;
46
- this.isRefreshing = true;
47
- try {
48
- await this.request("POST", "/api/v1/auth/refresh", {});
49
- } finally {
50
- this.isRefreshing = false;
51
- }
52
- }
53
- /** Requisição genérica com:
54
- * - credentials: 'include' (envia cookies HttpOnly)
55
- * - auto-refresh em 401
56
- * - CSRF header para mutações
57
- */
58
- async request(method, path, body, headers) {
59
- const url = `${this.baseUrl}${path}`;
60
- const requestHeaders = {
61
- "Content-Type": "application/json",
62
- ...headers
63
- };
64
- if (![
65
- "GET",
66
- "HEAD",
67
- "OPTIONS"
68
- ].includes(method.toUpperCase())) {
69
- const csrf = this.getCsrfToken();
70
- if (csrf) requestHeaders["x-csrf-token"] = csrf;
71
- }
72
- let response = await fetch(url, {
73
- method,
74
- headers: requestHeaders,
75
- credentials: "include",
76
- body: body ? JSON.stringify(body) : void 0
77
- });
78
- if (response.status === 401 && !path.includes("/auth/refresh") && !path.includes("/auth/logout")) {
79
- await this.refreshTokens();
80
- response = await fetch(url, {
81
- method,
82
- headers: requestHeaders,
83
- credentials: "include",
84
- body: body ? JSON.stringify(body) : void 0
85
- });
86
- }
87
- if (!response.ok) {
88
- const error = await response.json().catch(() => ({ error: "Request failed" }));
89
- throw new Error(error.error ?? `Request failed: ${response.status}`);
90
- }
91
- const setCookie = response.headers.get("set-cookie");
92
- if (setCookie) {
93
- const csrfMatch = setCookie.match(/csrf_token=([^;]+)/);
94
- if (csrfMatch?.[1]) this.csrfToken = csrfMatch[1];
95
- }
96
- return response.json();
97
- }
98
- /** Lê CSRF token do cookie (document.cookie) */
99
- getCsrfToken() {
100
- if (this.csrfToken) return this.csrfToken;
101
- if (typeof document !== "undefined") {
102
- const match = document.cookie.match(/(?:^|;\s*)csrf_token=([^;]+)/);
103
- if (match?.[1]) return match[1];
104
- }
105
- return null;
106
- }
107
- async getContent(options) {
108
- const params = new URLSearchParams();
109
- if (options?.page) params.set("page", String(options.page));
110
- if (options?.limit) params.set("limit", String(options.limit));
111
- if (options?.type) params.set("type", options.type);
112
- if (options?.status) params.set("status", options.status);
113
- if (options?.search) params.set("search", options.search);
114
- return this.request("GET", `/api/v1/content?${params.toString()}`);
115
- }
116
- async getContentById(id) {
117
- return this.request("GET", `/api/v1/content/${id}`);
118
- }
119
- async createContent(data) {
120
- return this.request("POST", `/api/v1/content`, data);
121
- }
122
- async updateContent(id, data) {
123
- return this.request("PUT", `/api/v1/content/${id}`, data);
124
- }
125
- async deleteContent(id) {
126
- await this.request("DELETE", `/api/v1/content/${id}`);
127
- }
128
- /** A2: publica via rota real do publisher (eventBus + cache + revisions). */
129
- async publishContent(id) {
130
- return this.request("POST", `/api/v1/content/${id}/publish`);
131
- }
132
- /** A2: despublica via rota real do publisher. */
133
- async unpublishContent(id) {
134
- return this.request("POST", `/api/v1/content/${id}/unpublish`);
135
- }
136
- /** Atalho usado pela ContentList: publish/unpublish conforme status atual. */
137
- async publishToggle(id, isPublished) {
138
- return isPublished ? this.unpublishContent(id) : this.publishContent(id);
139
- }
140
- async getContentTypes() {
141
- return this.request("GET", "/api/v1/content-types");
142
- }
143
- async createContentType(data) {
144
- return this.request("POST", "/api/v1/content-types", data);
145
- }
146
- async updateContentType(slug, data) {
147
- return this.request("PUT", `/api/v1/content-types/${slug}`, data);
148
- }
149
- async deleteContentType(slug) {
150
- await this.request("DELETE", `/api/v1/content-types/${slug}`);
151
- }
152
- async getTaxonomies() {
153
- return this.request("GET", "/api/v1/taxonomies");
154
- }
155
- async createTaxonomy(data) {
156
- return this.request("POST", "/api/v1/taxonomies", data);
157
- }
158
- async attachTaxonomy(slug, contentType) {
159
- await this.request("POST", `/api/v1/taxonomies/${slug}/attach`, { contentType });
160
- }
161
- async detachTaxonomy(slug, contentType) {
162
- await this.request("POST", `/api/v1/taxonomies/${slug}/detach`, { contentType });
163
- }
164
- async deleteTaxonomy(slug) {
165
- await this.request("DELETE", `/api/v1/taxonomies/${slug}`);
166
- }
167
- async getFieldGroups(context) {
168
- if (context?.type) {
169
- const qs = new URLSearchParams({ type: context.type });
170
- for (const [key, value] of Object.entries(context)) if (key !== "type" && value) qs.set(key, value);
171
- return this.request("GET", `/api/v1/field-groups?${qs.toString()}`);
172
- }
173
- return this.request("GET", "/api/v1/field-groups");
174
- }
175
- async getFieldGroup(id) {
176
- return this.request("GET", `/api/v1/field-groups/${id}`);
177
- }
178
- async createFieldGroup(data) {
179
- return this.request("POST", "/api/v1/field-groups", data);
180
- }
181
- async getFieldTypes(category) {
182
- const query = category ? `?category=${encodeURIComponent(category)}` : "";
183
- return this.request("GET", `/api/v1/field-types${query}`);
184
- }
185
- async listMedia(options) {
186
- const params = new URLSearchParams();
187
- if (options?.page) params.set("page", String(options.page));
188
- if (options?.limit) params.set("limit", String(options.limit));
189
- if (options?.mimeType) params.set("mimeType", options.mimeType);
190
- if (options?.search) params.set("search", options.search);
191
- return this.request("GET", `/api/v1/media?${params.toString()}`);
192
- }
193
- async getMedia(id) {
194
- return this.request("GET", `/api/v1/media/${id}`);
195
- }
196
- /** Upload multipart — NÃO seta Content-Type (o fetch precisa do boundary). */
197
- async uploadMedia(file, options) {
198
- const formData = new FormData();
199
- formData.append("file", file);
200
- if (options?.alt) formData.append("alt", options.alt);
201
- if (options?.caption) formData.append("caption", options.caption);
202
- const url = `${this.baseUrl}/api/v1/media/upload`;
203
- const requestHeaders = {};
204
- const csrf = this.getCsrfToken();
205
- if (csrf) requestHeaders["x-csrf-token"] = csrf;
206
- const response = await fetch(url, {
207
- method: "POST",
208
- headers: requestHeaders,
209
- credentials: "include",
210
- body: formData
211
- });
212
- if (!response.ok) {
213
- const error = await response.json().catch(() => ({ error: `Upload failed: ${response.status}` }));
214
- throw new Error(error.error ?? `Upload failed: ${response.status}`);
215
- }
216
- return response.json();
217
- }
218
- async updateMedia(id, data) {
219
- return this.request("PUT", `/api/v1/media/${id}`, data);
220
- }
221
- async deleteMedia(id) {
222
- await this.request("DELETE", `/api/v1/media/${id}`);
223
- }
224
- async listUsers(options) {
225
- const params = new URLSearchParams();
226
- if (options?.page) params.set("page", String(options.page));
227
- if (options?.limit) params.set("limit", String(options.limit));
228
- if (options?.search) params.set("search", options.search);
229
- if (options?.status) params.set("status", options.status);
230
- return this.request("GET", `/api/v1/users?${params.toString()}`);
231
- }
232
- async getUser(id) {
233
- return this.request("GET", `/api/v1/users/${id}`);
234
- }
235
- async createUser(data) {
236
- return this.request("POST", "/api/v1/users", data);
237
- }
238
- async updateUser(id, data) {
239
- return this.request("PUT", `/api/v1/users/${id}`, data);
240
- }
241
- async deleteUser(id) {
242
- await this.request("DELETE", `/api/v1/users/${id}`);
243
- }
244
- async setUserPassword(id, password) {
245
- await this.request("PUT", `/api/v1/users/${id}/password`, { password });
246
- }
247
- async assignRole(userId, roleId) {
248
- return this.request("POST", `/api/v1/users/${userId}/roles`, { roleId });
249
- }
250
- async removeRole(userId, roleId) {
251
- return this.request("DELETE", `/api/v1/users/${userId}/roles/${roleId}`);
252
- }
253
- async listRoles() {
254
- return this.request("GET", "/api/v1/roles");
255
- }
256
- async getSettings(group) {
257
- const query = group ? `?group=${encodeURIComponent(group)}` : "";
258
- return this.request("GET", `/api/v1/settings${query}`);
259
- }
260
- async updateSettings(items) {
261
- await this.request("PUT", "/api/v1/settings", items);
262
- }
263
- async healthCheck() {
264
- return this.request("GET", "/health");
265
- }
266
- async getThemes() {
267
- return (await this.request("GET", "/api/v1/themes")).map((theme) => ({
268
- id: String(theme["id"] ?? ""),
269
- name: String(theme["name"] ?? ""),
270
- version: theme["version"] ? String(theme["version"]) : void 0,
271
- status: String(theme["status"] ?? "INSTALLED"),
272
- manifest: theme["manifest"] ?? null
273
- }));
274
- }
275
- };
276
- var apiClient = new ApiClient();
277
- //#endregion
278
- export { apiClient as t };
@@ -1,133 +0,0 @@
1
- import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
2
- import { d as maybeRenderHead, i as renderComponent, u as renderTemplate } from "./server_B5N27szj.mjs";
3
- import { t as createComponent$1 } from "./compiler_O7J1rlsi.mjs";
4
- import { t as $$DashboardLayout } from "./DashboardLayout_Bpur473M.mjs";
5
- import { t as apiClient } from "./api_i8T-MI6L.mjs";
6
- import { createComponent, escape, ssr, ssrHydrationKey } from "solid-js/web";
7
- import { For, Show, createSignal, onMount } from "solid-js";
8
- //#region src/components/apps/dashboard/DashboardHome.tsx
9
- var _tmpl$ = [
10
- "<div",
11
- " class=\"notice notice--error\">",
12
- "</div>"
13
- ];
14
- var _tmpl$2 = [
15
- "<table",
16
- " class=\"table\"><thead><tr><th>Title</th><th>Type</th><th>Status</th><th>Updated</th></tr></thead><tbody>",
17
- "</tbody></table>"
18
- ];
19
- var _tmpl$3 = [
20
- "<div",
21
- " class=\"dashboard-home\"><!--$-->",
22
- "<!--/--><div class=\"stats-grid\"><div class=\"card stat-card\"><h3 class=\"stat-label\">Total Content</h3><p class=\"stat-value\">",
23
- "</p></div><div class=\"card stat-card\"><h3 class=\"stat-label\">Published</h3><p class=\"stat-value\">",
24
- "</p></div><div class=\"card stat-card\"><h3 class=\"stat-label\">Drafts</h3><p class=\"stat-value\">",
25
- "</p></div><div class=\"card stat-card\"><h3 class=\"stat-label\">Media Files</h3><p class=\"stat-value\">",
26
- "</p></div><div class=\"card stat-card\"><h3 class=\"stat-label\">Users</h3><p class=\"stat-value\">",
27
- "</p></div></div><div class=\"card\"><div class=\"card-header\"><h3>Recent Content</h3><a href=\"/content\" class=\"btn btn-secondary btn-sm\">View All</a></div><!--$-->",
28
- "<!--/--></div></div>"
29
- ];
30
- var _tmpl$4 = ["<p", " class=\"muted\">Nenhum conteúdo ainda — crie o primeiro!</p>"];
31
- var _tmpl$5 = [
32
- "<tr",
33
- "><td><a href=\"",
34
- "\">",
35
- "</a></td><td>",
36
- "</td><td>",
37
- "</td><td class=\"muted\">",
38
- "</td></tr>"
39
- ];
40
- function raw(row) {
41
- return row;
42
- }
43
- function formatDate(row) {
44
- const value = raw(row)["updated_at"] ?? raw(row)["updatedAt"] ?? raw(row)["created_at"];
45
- if (typeof value !== "string") return "—";
46
- const date = new Date(value);
47
- return Number.isNaN(date.getTime()) ? "—" : date.toLocaleString("pt-BR");
48
- }
49
- function DashboardHome() {
50
- const [stats, setStats] = createSignal({
51
- total: "—",
52
- published: "—",
53
- drafts: "—",
54
- media: "—",
55
- users: "—"
56
- });
57
- const [recent, setRecent] = createSignal([]);
58
- const [error, setError] = createSignal("");
59
- onMount(async () => {
60
- const [all, published, drafts, media, users, recentList] = await Promise.allSettled([
61
- apiClient.getContent({ limit: 1 }),
62
- apiClient.getContent({
63
- limit: 1,
64
- status: "PUBLISHED"
65
- }),
66
- apiClient.getContent({
67
- limit: 1,
68
- status: "DRAFT"
69
- }),
70
- apiClient.listMedia({ limit: 1 }),
71
- apiClient.listUsers({ limit: 1 }),
72
- apiClient.getContent({ limit: 5 })
73
- ]);
74
- const count = (result) => result.status === "fulfilled" ? String(result.value.total) : "?";
75
- setStats({
76
- total: count(all),
77
- published: count(published),
78
- drafts: count(drafts),
79
- media: count(media),
80
- users: count(users)
81
- });
82
- if (recentList.status === "fulfilled") setRecent(recentList.value.data ?? []);
83
- else setError(recentList.reason instanceof Error ? recentList.reason.message : String(recentList.reason));
84
- });
85
- return ssr(_tmpl$3, ssrHydrationKey(), escape(createComponent(Show, {
86
- get when() {
87
- return error();
88
- },
89
- get children() {
90
- return ssr(_tmpl$, ssrHydrationKey(), escape(error()));
91
- }
92
- })), escape(stats().total), escape(stats().published), escape(stats().drafts), escape(stats().media), escape(stats().users), escape(createComponent(Show, {
93
- get when() {
94
- return recent().length > 0;
95
- },
96
- get fallback() {
97
- return ssr(_tmpl$4, ssrHydrationKey());
98
- },
99
- get children() {
100
- return ssr(_tmpl$2, ssrHydrationKey(), escape(createComponent(For, {
101
- get each() {
102
- return recent();
103
- },
104
- children: (row) => ssr(_tmpl$5, ssrHydrationKey(), `/content/edit?id=${escape(encodeURIComponent(String(raw(row)["id"] ?? "")), true)}`, escape(String(raw(row)["title"] ?? "—")), escape(String(raw(row)["type"] ?? "—")), escape(String(raw(row)["status"] ?? "—")), escape(formatDate(row)))
105
- })));
106
- }
107
- })));
108
- }
109
- //#endregion
110
- //#region src/pages/index.astro
111
- var pages_exports = /* @__PURE__ */ __exportAll({
112
- default: () => $$Index,
113
- file: () => $$file,
114
- url: () => ""
115
- });
116
- var $$Index = createComponent$1(($$result, $$props, $$slots) => {
117
- return renderTemplate`${renderComponent($$result, "DashboardLayout", $$DashboardLayout, {
118
- "title": "Dashboard",
119
- "data-astro-cid-lcdefpme": true
120
- }, { "default": ($$result) => renderTemplate`${maybeRenderHead($$result)}<div class="dashboard" data-astro-cid-lcdefpme>${renderComponent($$result, "DashboardHome", DashboardHome, {
121
- "client:load": true,
122
- "data-astro-cid-lcdefpme": true,
123
- "client:component-hydration": "load",
124
- "client:component-path": "/home/runner/work/cms/cms/apps/admin/src/components/apps/dashboard/DashboardHome.tsx",
125
- "client:component-export": "DashboardHome"
126
- })}<div class="quick-actions" data-astro-cid-lcdefpme><div class="card" data-astro-cid-lcdefpme><h3 class="card-header" data-astro-cid-lcdefpme>Quick Actions</h3><div class="actions-grid" data-astro-cid-lcdefpme><a href="/content/new" class="action-card" data-astro-cid-lcdefpme><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-astro-cid-lcdefpme><line x1="12" y1="5" x2="12" y2="19" data-astro-cid-lcdefpme></line><line x1="5" y1="12" x2="19" y2="12" data-astro-cid-lcdefpme></line></svg><span data-astro-cid-lcdefpme>New Post</span></a><a href="/media/upload" class="action-card" data-astro-cid-lcdefpme><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-astro-cid-lcdefpme><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" data-astro-cid-lcdefpme></path><polyline points="17 8 12 3 7 8" data-astro-cid-lcdefpme></polyline><line x1="12" y1="3" x2="12" y2="15" data-astro-cid-lcdefpme></line></svg><span data-astro-cid-lcdefpme>Upload Media</span></a><a href="/users/new" class="action-card" data-astro-cid-lcdefpme><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-astro-cid-lcdefpme><path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" data-astro-cid-lcdefpme></path><circle cx="8.5" cy="7" r="4" data-astro-cid-lcdefpme></circle><line x1="20" y1="8" x2="20" y2="14" data-astro-cid-lcdefpme></line><line x1="23" y1="11" x2="17" y2="11" data-astro-cid-lcdefpme></line></svg><span data-astro-cid-lcdefpme>Add User</span></a><a href="/settings" class="action-card" data-astro-cid-lcdefpme><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-astro-cid-lcdefpme><circle cx="12" cy="12" r="3" data-astro-cid-lcdefpme></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" data-astro-cid-lcdefpme></path></svg><span data-astro-cid-lcdefpme>Settings</span></a></div></div></div></div>` })}`;
127
- }, "/home/runner/work/cms/cms/apps/admin/src/pages/index.astro", void 0);
128
- var $$file = "/home/runner/work/cms/cms/apps/admin/src/pages/index.astro";
129
- //#endregion
130
- //#region \0virtual:astro:page:src/pages/index@_@astro
131
- var page = () => pages_exports;
132
- //#endregion
133
- export { page };
@@ -1,23 +0,0 @@
1
- import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
2
- import { d as maybeRenderHead, i as renderComponent, u as renderTemplate } from "./server_B5N27szj.mjs";
3
- import { t as createComponent } from "./compiler_O7J1rlsi.mjs";
4
- import { t as $$DashboardLayout } from "./DashboardLayout_Bpur473M.mjs";
5
- //#region src/pages/settings/index.astro
6
- var settings_exports = /* @__PURE__ */ __exportAll({
7
- default: () => $$Index,
8
- file: () => $$file,
9
- url: () => $$url
10
- });
11
- var $$Index = createComponent(($$result, $$props, $$slots) => {
12
- return renderTemplate`${renderComponent($$result, "DashboardLayout", $$DashboardLayout, {
13
- "title": "Settings",
14
- "data-astro-cid-pvy7orjg": true
15
- }, { "default": ($$result) => renderTemplate`${maybeRenderHead($$result)}<div class="settings-page" data-astro-cid-pvy7orjg><div class="page-header" data-astro-cid-pvy7orjg><h2 data-astro-cid-pvy7orjg>Configurações</h2><p data-astro-cid-pvy7orjg>Escolha uma seção para configurar o projeto.</p></div><div class="settings-cards" data-astro-cid-pvy7orjg><a class="card settings-card" href="/settings/general" data-astro-cid-pvy7orjg><h3 data-astro-cid-pvy7orjg>Geral</h3><p class="muted" data-astro-cid-pvy7orjg>Título, descrição, idioma e fuso horário do site.</p></a><a class="card settings-card" href="/settings/post-types" data-astro-cid-pvy7orjg><h3 data-astro-cid-pvy7orjg>Content Types</h3><p class="muted" data-astro-cid-pvy7orjg>Tipos de conteúdo personalizados (CPTs) além de Posts e Páginas.</p></a><a class="card settings-card" href="/settings/taxonomies" data-astro-cid-pvy7orjg><h3 data-astro-cid-pvy7orjg>Taxonomias</h3><p class="muted" data-astro-cid-pvy7orjg>Categorias, tags e taxonomias personalizadas.</p></a></div></div>` })}`;
16
- }, "/home/runner/work/cms/cms/apps/admin/src/pages/settings/index.astro", void 0);
17
- var $$file = "/home/runner/work/cms/cms/apps/admin/src/pages/settings/index.astro";
18
- var $$url = "/settings";
19
- //#endregion
20
- //#region \0virtual:astro:page:src/pages/settings/index@_@astro
21
- var page = () => settings_exports;
22
- //#endregion
23
- export { page };
@@ -1,23 +0,0 @@
1
- import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
2
- import { d as maybeRenderHead, i as renderComponent, u as renderTemplate } from "./server_B5N27szj.mjs";
3
- import { t as createComponent } from "./compiler_O7J1rlsi.mjs";
4
- import { n as renderScript, t as $$BaseLayout } from "./BaseLayout_CcUFilW5.mjs";
5
- //#region src/pages/login.astro
6
- var login_exports = /* @__PURE__ */ __exportAll({
7
- default: () => $$Login,
8
- file: () => $$file,
9
- url: () => $$url
10
- });
11
- var $$Login = createComponent(($$result, $$props, $$slots) => {
12
- return renderTemplate`${renderComponent($$result, "BaseLayout", $$BaseLayout, {
13
- "title": "Login",
14
- "data-astro-cid-sjqh5bze": true
15
- }, { "default": ($$result) => renderTemplate`${maybeRenderHead($$result)}<div class="login-page" data-astro-cid-sjqh5bze><div class="login-card" data-astro-cid-sjqh5bze><div class="login-header" data-astro-cid-sjqh5bze><h1 data-astro-cid-sjqh5bze>OkCMS</h1><p data-astro-cid-sjqh5bze>Sign in to your account</p></div><form id="login-form" class="login-form" data-astro-cid-sjqh5bze><div class="form-group" data-astro-cid-sjqh5bze><label for="email" data-astro-cid-sjqh5bze>Email</label><input type="email" id="email" name="email" class="input" required placeholder="admin@example.com" data-astro-cid-sjqh5bze></div><div class="form-group" data-astro-cid-sjqh5bze><label for="password" data-astro-cid-sjqh5bze>Password</label><input type="password" id="password" name="password" class="input" required placeholder="••••••••" data-astro-cid-sjqh5bze></div><div id="error-message" class="error-message" style="display: none;" data-astro-cid-sjqh5bze></div><button type="submit" class="btn btn-primary btn-block" data-astro-cid-sjqh5bze><span id="submit-text" data-astro-cid-sjqh5bze>Sign In</span><span id="submit-spinner" class="spinner" style="display: none;" data-astro-cid-sjqh5bze></span></button></form></div></div>` })}${renderScript($$result, "/home/runner/work/cms/cms/apps/admin/src/pages/login.astro?astro&type=script&index=0&lang.ts")}`;
16
- }, "/home/runner/work/cms/cms/apps/admin/src/pages/login.astro", void 0);
17
- var $$file = "/home/runner/work/cms/cms/apps/admin/src/pages/login.astro";
18
- var $$url = "/login";
19
- //#endregion
20
- //#region \0virtual:astro:page:src/pages/login@_@astro
21
- var page = () => login_exports;
22
- //#endregion
23
- export { page };
@@ -1,137 +0,0 @@
1
- import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
2
- import { d as maybeRenderHead, i as renderComponent, u as renderTemplate } from "./server_B5N27szj.mjs";
3
- import { t as createComponent$1 } from "./compiler_O7J1rlsi.mjs";
4
- import { t as $$DashboardLayout } from "./DashboardLayout_Bpur473M.mjs";
5
- import { t as apiClient } from "./api_i8T-MI6L.mjs";
6
- import { createComponent, escape, ssr, ssrAttribute, ssrHydrationKey } from "solid-js/web";
7
- import { For, Show, createSignal, onMount } from "solid-js";
8
- //#region src/components/apps/settings/PostTypesManager.tsx
9
- var _tmpl$ = [
10
- "<div",
11
- " class=\"notice notice--error\">",
12
- "</div>"
13
- ];
14
- var _tmpl$2 = [
15
- "<div",
16
- " class=\"post-types-manager\"><!--$-->",
17
- "<!--/--><form class=\"card\"><h3>Criar Content Type</h3><div class=\"form-grid\"><label>Slug (singular, ex.: portfolio)<input class=\"input\" required pattern=\"[a-z0-9_]+\" title=\"Apenas letras minúsculas, números e underscore\"",
18
- "></label><label>Nome no singular<input class=\"input\" required",
19
- "></label><label>Nome no plural<input class=\"input\" required",
20
- "></label></div><fieldset class=\"supports\"><legend>Suporta</legend><!--$-->",
21
- "<!--/--><label><input type=\"checkbox\"",
22
- "> Possui arquivo público (/slug)</label></fieldset><button type=\"submit\" class=\"btn btn-primary\"",
23
- ">Criar</button></form><table class=\"table\"><thead><tr><th>Slug</th><th>Singular</th><th>Plural</th><th>Origem</th><th>Suporta</th><th>Arquivo</th><th></th></tr></thead><tbody>",
24
- "</tbody></table></div>"
25
- ];
26
- var _tmpl$3 = [
27
- "<label",
28
- "><input type=\"checkbox\"",
29
- "> <!--$-->",
30
- "<!--/--></label>"
31
- ];
32
- var _tmpl$4 = ["<button", " type=\"button\" class=\"btn btn-danger\">Remover</button>"];
33
- var _tmpl$5 = [
34
- "<tr",
35
- "><td>",
36
- "</td><td>",
37
- "</td><td>",
38
- "</td><td>",
39
- "</td><td>",
40
- "</td><td>",
41
- "</td><td>",
42
- "</td></tr>"
43
- ];
44
- var SUPPORTS_OPTIONS = [
45
- {
46
- value: "title",
47
- label: "Título"
48
- },
49
- {
50
- value: "editor",
51
- label: "Editor"
52
- },
53
- {
54
- value: "thumbnail",
55
- label: "Imagem destacada"
56
- },
57
- {
58
- value: "excerpt",
59
- label: "Resumo"
60
- },
61
- {
62
- value: "revisions",
63
- label: "Revisões"
64
- }
65
- ];
66
- function PostTypesManager() {
67
- const [types, setTypes] = createSignal([]);
68
- const [error, setError] = createSignal("");
69
- const [saving, setSaving] = createSignal(false);
70
- const [form, setForm] = createSignal({
71
- name: "",
72
- slug: "",
73
- singularLabel: "",
74
- pluralLabel: "",
75
- hasArchive: false,
76
- supports: ["title", "editor"]
77
- });
78
- const load = async () => {
79
- try {
80
- setTypes(await apiClient.getContentTypes());
81
- } catch (err) {
82
- setError(err instanceof Error ? err.message : String(err));
83
- }
84
- };
85
- onMount(load);
86
- return ssr(_tmpl$2, ssrHydrationKey(), escape(createComponent(Show, {
87
- get when() {
88
- return error();
89
- },
90
- get children() {
91
- return ssr(_tmpl$, ssrHydrationKey(), escape(error()));
92
- }
93
- })), ssrAttribute("value", escape(form().slug, true), false), ssrAttribute("value", escape(form().singularLabel, true), false), ssrAttribute("value", escape(form().pluralLabel, true), false), escape(createComponent(For, {
94
- get each() {
95
- return [...SUPPORTS_OPTIONS];
96
- },
97
- children: (option) => ssr(_tmpl$3, ssrHydrationKey(), ssrAttribute("checked", form().supports.includes(option.value), true), escape(option.label))
98
- })), ssrAttribute("checked", form().hasArchive, true), ssrAttribute("disabled", saving(), true), escape(createComponent(For, {
99
- get each() {
100
- return types();
101
- },
102
- children: (type) => ssr(_tmpl$5, ssrHydrationKey(), escape(type.slug), escape(type.singularLabel), escape(type.pluralLabel), escape(type.source ?? "ADMIN"), escape((type.supports ?? []).join(", ")), type.hasArchive ? "Sim" : "Não", escape(createComponent(Show, {
103
- get when() {
104
- return type.source !== "CORE";
105
- },
106
- get children() {
107
- return ssr(_tmpl$4, ssrHydrationKey());
108
- }
109
- })))
110
- })));
111
- }
112
- //#endregion
113
- //#region src/pages/settings/post-types.astro
114
- var post_types_exports = /* @__PURE__ */ __exportAll({
115
- default: () => $$PostTypes,
116
- file: () => $$file,
117
- url: () => $$url
118
- });
119
- var $$PostTypes = createComponent$1(($$result, $$props, $$slots) => {
120
- return renderTemplate`${renderComponent($$result, "DashboardLayout", $$DashboardLayout, {
121
- "title": "Post Types",
122
- "data-astro-cid-jfwjjply": true
123
- }, { "default": ($$result) => renderTemplate`${maybeRenderHead($$result)}<div class="settings-page" data-astro-cid-jfwjjply><div class="page-header" data-astro-cid-jfwjjply><h2 data-astro-cid-jfwjjply>Content Types</h2><p data-astro-cid-jfwjjply>Crie tipos de conteúdo personalizados (CPTs) além de Posts e Páginas.</p></div>${renderComponent($$result, "PostTypesManager", PostTypesManager, {
124
- "client:load": true,
125
- "data-astro-cid-jfwjjply": true,
126
- "client:component-hydration": "load",
127
- "client:component-path": "/home/runner/work/cms/cms/apps/admin/src/components/apps/settings/PostTypesManager.tsx",
128
- "client:component-export": "PostTypesManager"
129
- })}</div>` })}`;
130
- }, "/home/runner/work/cms/cms/apps/admin/src/pages/settings/post-types.astro", void 0);
131
- var $$file = "/home/runner/work/cms/cms/apps/admin/src/pages/settings/post-types.astro";
132
- var $$url = "/settings/post-types";
133
- //#endregion
134
- //#region \0virtual:astro:page:src/pages/settings/post-types@_@astro
135
- var page = () => post_types_exports;
136
- //#endregion
137
- export { page };