@oktis-works/admin 0.5.4 → 0.6.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.
- package/dist/client/_astro/{ActivityWidget.BNFwjO71.js → ActivityWidget.CLFjbNJf.js} +1 -1
- package/dist/client/_astro/{AdminBar.DRgRB1PC.js → AdminBar.CKYNoMCz.js} +1 -1
- package/dist/client/_astro/{AtGlanceWidget.h60KI_JU.js → AtGlanceWidget.DZLDbAfC.js} +1 -1
- package/dist/client/_astro/{BaseLayout.Du3LchRX.css → BaseLayout.Cb-QSCvc.css} +1 -1
- package/dist/client/_astro/{ContentEditor.BDb6qSSI.js → ContentEditor.BmpwqkNT.js} +1 -1
- package/dist/client/_astro/ContentEditor.saSUoKf0.js +1 -0
- package/dist/client/_astro/ContentTypeWorkspace.00bHkcJD.js +1 -0
- package/dist/client/_astro/{DashboardHome.1vPxu78E.js → DashboardHome.DCz0EiH2.js} +1 -1
- package/dist/client/_astro/DashboardLayout.DH1KnS2w.css +1 -0
- package/dist/client/_astro/{DashboardLayout.astro_astro_type_script_index_0_lang.D3odZySo.js → DashboardLayout.astro_astro_type_script_index_0_lang.DdRNBOsR.js} +1 -1
- package/dist/client/_astro/{FieldGroupEditor.C9U6-zxk.js → FieldGroupEditor.Bdm2FW0L.js} +1 -1
- package/dist/client/_astro/{FieldGroupList.DYFBUBY7.js → FieldGroupList.BaNTs6an.js} +1 -1
- package/dist/client/_astro/{Footer.BwLmoHuk.js → Footer.B3_EZU5m.js} +1 -1
- package/dist/client/_astro/GeneralSettings.BH-f6pL0.js +1 -0
- package/dist/client/_astro/{LogsManager.CBwBkCUP.js → LogsManager.1c_AlgX8.js} +1 -1
- package/dist/client/_astro/MediaLibrary.DH7eqign.js +1 -0
- package/dist/client/_astro/{MenuManager.BhYhygsR.js → MenuManager.CLPv5Ths.js} +1 -1
- package/dist/client/_astro/{PluginManager.DxAKvMfM.js → PluginManager.Duzn64IF.js} +1 -1
- package/dist/client/_astro/{PostTypesManager.DLymaQPT.js → PostTypesManager.BHKbIEwD.js} +1 -1
- package/dist/client/_astro/{QuickDraftWidget.CfUR8qmY.js → QuickDraftWidget.MBRACUqB.js} +1 -1
- package/dist/client/_astro/{ResourceHubs.BnINa0O3.js → ResourceHubs.CL3KxW6a.js} +1 -1
- package/dist/client/_astro/{TaxonomiesManager.1EZYO2u5.js → TaxonomiesManager.DEwFIIP9.js} +1 -1
- package/dist/client/_astro/{TaxonomyTermsManager.YXbuam33.js → TaxonomyTermsManager.DWljfgZH.js} +1 -1
- package/dist/client/_astro/{ThemeManager.EFMZJdmx.js → ThemeManager.CAGeBTsz.js} +1 -1
- package/dist/client/_astro/{UserCreateForm.C_m7ovUU.js → UserCreateForm.wCOVD_YS.js} +1 -1
- package/dist/client/_astro/UsersManager.RHbgYhoE.js +1 -0
- package/dist/client/_astro/{WebhooksManager.CKRtabi3.js → WebhooksManager.B-g7Wbit.js} +1 -1
- package/dist/client/_astro/api.CGA0D2A2.js +1 -0
- package/dist/client/_astro/extensions.CKCZC04g.js +1 -0
- package/dist/client/_astro/{i18n.EKfvSb1v.js → i18n.3zKFZ7KU.js} +1 -1
- package/dist/client/_astro/{login.astro_astro_type_script_index_0_lang.D8XVBan6.js → login.astro_astro_type_script_index_0_lang.DzXBvx_L.js} +1 -1
- package/dist/client/_astro/src.DQwsXUur.js +1 -0
- package/dist/client/_astro/{version.B4bPYHRP.js → version.BrTlYw56.js} +1 -1
- package/dist/server/chunks/{ContentEditor_DfYDk5IM.mjs → ContentEditor_BEGQZSwm.mjs} +525 -2
- package/dist/server/chunks/{DashboardLayout_7Gcd6oTS.mjs → DashboardLayout_BrMujuUY.mjs} +10 -7
- package/dist/server/chunks/{MediaLibrary_fu8AtNog.mjs → MediaLibrary_BnG47fd2.mjs} +2 -2
- package/dist/server/chunks/PageHeader_CBOioOjo.mjs +42 -0
- package/dist/server/chunks/{_id__BVLdyCKg.mjs → _id__CPqaq-or.mjs} +10 -5
- package/dist/server/chunks/{_slug__DG6xjEan.mjs → _slug__B53mL1bx.mjs} +6 -2
- package/dist/server/chunks/{access_B8fU0pWq.mjs → access_CtJtAQdD.mjs} +8 -8
- package/dist/server/chunks/{custom-fields_BOqCiSPQ.mjs → custom-fields_BP_aajHY.mjs} +2 -2
- package/dist/server/chunks/{dist_D98LO9y-.mjs → dist_CP9QIrJI.mjs} +2 -1394
- package/dist/server/chunks/{edit_C27RHq7N.mjs → edit_DG_K-2Qj.mjs} +8 -8
- package/dist/server/chunks/{general_TSviTaPT.mjs → general_q5AGQ36F.mjs} +8 -8
- package/dist/server/chunks/{i18n_Co0XNC0I.mjs → i18n_B-Vk5esc.mjs} +4 -1
- package/dist/server/chunks/{index_CCNhQxvS.mjs → index_C38LMbC9.mjs} +8 -8
- package/dist/server/chunks/index_CM5J56RR.mjs +32 -0
- package/dist/server/chunks/{index_t5k7sOZ8.mjs → index_CxA75vPH.mjs} +7 -10
- package/dist/server/chunks/{index_CRSTdqw0.mjs → index_FRRIyHOL.mjs} +2 -2
- package/dist/server/chunks/{index_BwaqRmvv.mjs → index_wJQJWCXJ.mjs} +8 -8
- package/dist/server/chunks/{login_DWlZa2zd.mjs → login_CNRlK7LB.mjs} +1 -1
- package/dist/server/chunks/{logs_DrjJ6S6J.mjs → logs_jnQGnqA9.mjs} +8 -8
- package/dist/server/chunks/{menus_DjfOcrez.mjs → menus_D5Vn-oIS.mjs} +2 -2
- package/dist/server/chunks/{new_B484WwaA.mjs → new_7JMkKLJt.mjs} +9 -9
- package/dist/server/chunks/{new_DNNbQ1Zw.mjs → new_CBhCftFl.mjs} +8 -8
- package/dist/server/chunks/{node_CECPlmah.mjs → node_kWZa8y--.mjs} +1 -1
- package/dist/server/chunks/{plugins_Bhuk-oUR.mjs → plugins_CfwZhokZ.mjs} +5 -4
- package/dist/server/chunks/{post-types_BtisIanW.mjs → post-types_isCYbGpy.mjs} +10 -5
- package/dist/server/chunks/semver_WbqCUY_o.mjs +1395 -0
- package/dist/server/chunks/{sharp_DQfjpH-u.mjs → sharp_37gnUicY.mjs} +2 -2
- package/dist/server/chunks/{taxonomies_CHJK2gT1.mjs → taxonomies_3rdILM-c.mjs} +10 -5
- package/dist/server/chunks/{taxonomy_DboKpEOu.mjs → taxonomy_APMNQqQ0.mjs} +9 -7
- package/dist/server/chunks/{themes_MC8vERGL.mjs → themes_CmKm5Q2f.mjs} +5 -4
- package/dist/server/chunks/{upload_BMoVV-rt.mjs → upload_5PzqW0LU.mjs} +8 -8
- package/dist/server/chunks/{webhooks_EHN9q7Yv.mjs → webhooks_CuZ4P9Yb.mjs} +8 -8
- package/dist/server/entry.mjs +25 -25
- package/dist/server/virtual_astro_middleware.mjs +1 -1
- package/package.json +5 -5
- package/dist/client/_astro/ContentEditor.QGAstGzA.js +0 -1
- package/dist/client/_astro/ContentTypeWorkspace.K35mfD2P.js +0 -1
- package/dist/client/_astro/DashboardLayout.C1OQ0r8H.css +0 -1
- package/dist/client/_astro/GeneralSettings.EU3z_sSD.js +0 -1
- package/dist/client/_astro/MediaLibrary.D56bkgPF.js +0 -1
- package/dist/client/_astro/UsersManager.t4-9GwDK.js +0 -1
- package/dist/client/_astro/api.CM0tblEa.js +0 -1
- package/dist/client/_astro/dist.D-evrPNi.js +0 -1
- package/dist/client/_astro/extensions.OpEcHTzv.js +0 -1
- package/dist/server/chunks/index_40l_yCUu.mjs +0 -27
- /package/dist/server/chunks/{BaseLayout_CHj9u5wO.mjs → BaseLayout_vNs_yXMd.mjs} +0 -0
|
@@ -1,7 +1,530 @@
|
|
|
1
|
-
import { n as useTranslation, r as apiClient } from "./
|
|
2
|
-
import { a as For2, f as createMemo$1,
|
|
1
|
+
import { n as useTranslation, r as apiClient } from "./i18n_B-Vk5esc.mjs";
|
|
2
|
+
import { a as For2, f as createMemo$1, p as createSignal$1, u as Show2 } from "./DashboardLayout_BrMujuUY.mjs";
|
|
3
3
|
import { createComponent, escape, memo, ssr, ssrAttribute, ssrHydrationKey } from "solid-js/web";
|
|
4
4
|
import { For, Show, createMemo, createSignal, onMount } from "solid-js";
|
|
5
|
+
//#region ../../packages/validation/dist/client-validate.js
|
|
6
|
+
function isEmptyValue(value) {
|
|
7
|
+
if (value === null || value === void 0) return true;
|
|
8
|
+
if (typeof value === "string") return value.trim() === "";
|
|
9
|
+
if (Array.isArray(value)) return value.length === 0;
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
function checkRequired(value, required, field, errors) {
|
|
13
|
+
if (!required) return true;
|
|
14
|
+
if (isEmptyValue(value)) {
|
|
15
|
+
errors.push({
|
|
16
|
+
field,
|
|
17
|
+
code: "REQUIRED",
|
|
18
|
+
message: `${field} é obrigatório`
|
|
19
|
+
});
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
function validateTextLike(value, config, field, errors) {
|
|
25
|
+
if (isEmptyValue(value)) return;
|
|
26
|
+
const str = String(value);
|
|
27
|
+
const minLength = config["minLength"] ?? config["minimum"];
|
|
28
|
+
const characterLimit = config["characterLimit"] ?? config["maxLength"];
|
|
29
|
+
if (minLength !== void 0 && str.length < minLength) errors.push({
|
|
30
|
+
field,
|
|
31
|
+
code: "MIN_LENGTH",
|
|
32
|
+
message: `${field} deve ter pelo menos ${minLength} caracteres`
|
|
33
|
+
});
|
|
34
|
+
if (characterLimit !== void 0 && str.length > characterLimit) errors.push({
|
|
35
|
+
field,
|
|
36
|
+
code: "CHARACTER_LIMIT",
|
|
37
|
+
message: `${field} excede o limite de ${characterLimit} caracteres`
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function validateEmail(value, field, errors) {
|
|
41
|
+
if (isEmptyValue(value)) return;
|
|
42
|
+
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(value))) errors.push({
|
|
43
|
+
field,
|
|
44
|
+
code: "INVALID_EMAIL",
|
|
45
|
+
message: `${field} não é um e-mail válido`
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function validateUrl(value, field, errors) {
|
|
49
|
+
if (isEmptyValue(value)) return;
|
|
50
|
+
try {
|
|
51
|
+
const parsed = new URL(String(value));
|
|
52
|
+
if (!["http:", "https:"].includes(parsed.protocol)) throw new Error("protocol");
|
|
53
|
+
} catch {
|
|
54
|
+
errors.push({
|
|
55
|
+
field,
|
|
56
|
+
code: "INVALID_URL",
|
|
57
|
+
message: `${field} não é uma URL válida (http/https)`
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function validateNumber(value, config, field, errors) {
|
|
62
|
+
if (isEmptyValue(value)) return;
|
|
63
|
+
const num = Number(value);
|
|
64
|
+
if (Number.isNaN(num)) {
|
|
65
|
+
errors.push({
|
|
66
|
+
field,
|
|
67
|
+
code: "NOT_A_NUMBER",
|
|
68
|
+
message: `${field} deve ser um número`
|
|
69
|
+
});
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const minValue = config["minValue"] ?? config["min"];
|
|
73
|
+
const maxValue = config["maxValue"] ?? config["max"];
|
|
74
|
+
const step = config["step"];
|
|
75
|
+
if (minValue !== void 0 && num < minValue) errors.push({
|
|
76
|
+
field,
|
|
77
|
+
code: "MIN_VALUE",
|
|
78
|
+
message: `${field} deve ser maior ou igual a ${minValue}`
|
|
79
|
+
});
|
|
80
|
+
if (maxValue !== void 0 && num > maxValue) errors.push({
|
|
81
|
+
field,
|
|
82
|
+
code: "MAX_VALUE",
|
|
83
|
+
message: `${field} deve ser menor ou igual a ${maxValue}`
|
|
84
|
+
});
|
|
85
|
+
if (step !== void 0 && step > 0) {
|
|
86
|
+
const base = minValue ?? 0;
|
|
87
|
+
if (Math.abs((num - base) / step - Math.round((num - base) / step)) > 1e-9) errors.push({
|
|
88
|
+
field,
|
|
89
|
+
code: "STEP_MISMATCH",
|
|
90
|
+
message: `${field} deve seguir o incremento de ${step}`
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function getValidChoiceValues(config) {
|
|
95
|
+
const choices = config["choices"] ?? [];
|
|
96
|
+
return new Set(choices.map((c) => String(c.value)));
|
|
97
|
+
}
|
|
98
|
+
function checkClosedSet(value, valid, allowCustom, field, errors) {
|
|
99
|
+
if (allowCustom) return;
|
|
100
|
+
if (!valid.has(String(value))) errors.push({
|
|
101
|
+
field,
|
|
102
|
+
code: "INVALID_CHOICE",
|
|
103
|
+
message: `${field} contém um valor fora das opções permitidas`
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
function checkSelectionCount(values, config, field, errors) {
|
|
107
|
+
const min = config["minSelections"];
|
|
108
|
+
const max = config["maxSelections"];
|
|
109
|
+
if (min !== void 0 && values.length < min) errors.push({
|
|
110
|
+
field,
|
|
111
|
+
code: "MIN_SELECTIONS",
|
|
112
|
+
message: `${field} requer no mínimo ${min} seleção(ões)`
|
|
113
|
+
});
|
|
114
|
+
if (max !== void 0 && values.length > max) errors.push({
|
|
115
|
+
field,
|
|
116
|
+
code: "MAX_SELECTIONS",
|
|
117
|
+
message: `${field} permite no máximo ${max} seleção(ões)`
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function validateSelect(value, config, field, errors) {
|
|
121
|
+
if (isEmptyValue(value)) return;
|
|
122
|
+
const multiple = Boolean(config["multiple"]);
|
|
123
|
+
const allowCustom = Boolean(config["allowCustom"] ?? false);
|
|
124
|
+
const valid = getValidChoiceValues(config);
|
|
125
|
+
if (multiple) {
|
|
126
|
+
if (!Array.isArray(value)) {
|
|
127
|
+
errors.push({
|
|
128
|
+
field,
|
|
129
|
+
code: "NOT_ARRAY",
|
|
130
|
+
message: `${field} deve ser uma lista`
|
|
131
|
+
});
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (!allowCustom) for (const item of value) checkClosedSet(item, valid, false, field, errors);
|
|
135
|
+
checkSelectionCount(value, config, field, errors);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
checkClosedSet(value, valid, allowCustom, field, errors);
|
|
139
|
+
if (Array.isArray(value)) errors.push({
|
|
140
|
+
field,
|
|
141
|
+
code: "SINGLE_ONLY",
|
|
142
|
+
message: `${field} aceita apenas um valor`
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
function validateCheckbox(value, config, field, errors) {
|
|
146
|
+
if (isEmptyValue(value)) return;
|
|
147
|
+
if (!Array.isArray(value)) {
|
|
148
|
+
errors.push({
|
|
149
|
+
field,
|
|
150
|
+
code: "NOT_ARRAY",
|
|
151
|
+
message: `${field} deve ser uma lista de valores`
|
|
152
|
+
});
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const valid = getValidChoiceValues(config);
|
|
156
|
+
for (const item of value) checkClosedSet(item, valid, true, field, errors);
|
|
157
|
+
checkSelectionCount(value, config, field, errors);
|
|
158
|
+
}
|
|
159
|
+
function validateRadio(value, config, field, errors) {
|
|
160
|
+
if (isEmptyValue(value)) return;
|
|
161
|
+
checkClosedSet(value, getValidChoiceValues(config), Boolean(config["allowCustom"]), field, errors);
|
|
162
|
+
}
|
|
163
|
+
function validateTrueFalse(value, field, errors) {
|
|
164
|
+
if (value === null || value === void 0) return;
|
|
165
|
+
if (!(typeof value === "boolean" || value === 0 || value === 1 || value === "0" || value === "1")) errors.push({
|
|
166
|
+
field,
|
|
167
|
+
code: "NOT_BOOLEAN",
|
|
168
|
+
message: `${field} deve ser verdadeiro ou falso`
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
function validateMediaItem(item, config, field, errors) {
|
|
172
|
+
if (typeof item !== "object" || item === null || Array.isArray(item)) {
|
|
173
|
+
errors.push({
|
|
174
|
+
field,
|
|
175
|
+
code: "INVALID_MEDIA",
|
|
176
|
+
message: `${field} deve referenciar uma mídia válida`
|
|
177
|
+
});
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
const media = item;
|
|
181
|
+
const mimeTypes = config["mimeTypes"] ?? [];
|
|
182
|
+
if (mimeTypes.length > 0 && media.mimeType) {
|
|
183
|
+
if (!mimeTypes.map((m) => m.toLowerCase()).includes(media.mimeType.toLowerCase())) errors.push({
|
|
184
|
+
field,
|
|
185
|
+
code: "INVALID_MIME",
|
|
186
|
+
message: `${field} não aceita arquivos do tipo ${media.mimeType}`
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
const maxSize = config["maxSize"];
|
|
190
|
+
const minSize = config["minSize"];
|
|
191
|
+
if (media.size !== void 0) {
|
|
192
|
+
if (maxSize !== void 0 && media.size > maxSize) errors.push({
|
|
193
|
+
field,
|
|
194
|
+
code: "FILE_TOO_LARGE",
|
|
195
|
+
message: `${field} excede o tamanho máximo de ${Math.round(maxSize / 1024)}KB`
|
|
196
|
+
});
|
|
197
|
+
if (minSize !== void 0 && media.size < minSize) errors.push({
|
|
198
|
+
field,
|
|
199
|
+
code: "FILE_TOO_SMALL",
|
|
200
|
+
message: `${field} está abaixo do tamanho mínimo de ${Math.round(minSize / 1024)}KB`
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
if (media.width !== void 0 && media.height !== void 0) {
|
|
204
|
+
const minWidth = config["minWidth"];
|
|
205
|
+
const maxWidth = config["maxWidth"];
|
|
206
|
+
const minHeight = config["minHeight"];
|
|
207
|
+
const maxHeight = config["maxHeight"];
|
|
208
|
+
if (minWidth !== void 0 && media.width < minWidth) errors.push({
|
|
209
|
+
field,
|
|
210
|
+
code: "MIN_WIDTH",
|
|
211
|
+
message: `${field} requer largura mínima de ${minWidth}px`
|
|
212
|
+
});
|
|
213
|
+
if (maxWidth !== void 0 && media.width > maxWidth) errors.push({
|
|
214
|
+
field,
|
|
215
|
+
code: "MAX_WIDTH",
|
|
216
|
+
message: `${field} permite largura máxima de ${maxWidth}px`
|
|
217
|
+
});
|
|
218
|
+
if (minHeight !== void 0 && media.height < minHeight) errors.push({
|
|
219
|
+
field,
|
|
220
|
+
code: "MIN_HEIGHT",
|
|
221
|
+
message: `${field} requer altura mínima de ${minHeight}px`
|
|
222
|
+
});
|
|
223
|
+
if (maxHeight !== void 0 && media.height > maxHeight) errors.push({
|
|
224
|
+
field,
|
|
225
|
+
code: "MAX_HEIGHT",
|
|
226
|
+
message: `${field} permite altura máxima de ${maxHeight}px`
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function validateImage(value, config, field, errors) {
|
|
231
|
+
if (isEmptyValue(value)) return;
|
|
232
|
+
validateMediaItem(value, config, field, errors);
|
|
233
|
+
}
|
|
234
|
+
function validateFile(value, config, field, errors) {
|
|
235
|
+
if (isEmptyValue(value)) return;
|
|
236
|
+
validateMediaItem(value, config, field, errors);
|
|
237
|
+
}
|
|
238
|
+
function validateGallery(value, config, field, errors) {
|
|
239
|
+
if (value === null || value === void 0) return;
|
|
240
|
+
if (!Array.isArray(value)) {
|
|
241
|
+
errors.push({
|
|
242
|
+
field,
|
|
243
|
+
code: "NOT_ARRAY",
|
|
244
|
+
message: `${field} deve ser uma lista de imagens`
|
|
245
|
+
});
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
const hasLimits = config["minSelections"] !== void 0 || config["maxSelections"] !== void 0;
|
|
249
|
+
if (value.length === 0 && !hasLimits) return;
|
|
250
|
+
const minSelections = config["minSelections"];
|
|
251
|
+
const maxSelections = config["maxSelections"];
|
|
252
|
+
if (minSelections !== void 0 && value.length < minSelections) errors.push({
|
|
253
|
+
field,
|
|
254
|
+
code: "MIN_SELECTIONS",
|
|
255
|
+
message: `${field} requer no mínimo ${minSelections} imagem(ns)`
|
|
256
|
+
});
|
|
257
|
+
if (maxSelections !== void 0 && value.length > maxSelections) errors.push({
|
|
258
|
+
field,
|
|
259
|
+
code: "MAX_SELECTIONS",
|
|
260
|
+
message: `${field} permite no máximo ${maxSelections} imagem(ns)`
|
|
261
|
+
});
|
|
262
|
+
for (const item of value) validateMediaItem(item, config, field, errors);
|
|
263
|
+
}
|
|
264
|
+
function validateRelationshipIds(value, config, field, errors) {
|
|
265
|
+
if (isEmptyValue(value)) return;
|
|
266
|
+
const multiple = config["multiple"] !== false;
|
|
267
|
+
const minSelections = config["minSelections"];
|
|
268
|
+
const maxSelections = config["maxSelections"];
|
|
269
|
+
const ids = Array.isArray(value) ? value : [value];
|
|
270
|
+
for (const id of ids) if (typeof id !== "string" && typeof id !== "number") {
|
|
271
|
+
errors.push({
|
|
272
|
+
field,
|
|
273
|
+
code: "INVALID_ID",
|
|
274
|
+
message: `${field} contém um identificador inválido`
|
|
275
|
+
});
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
if (multiple) {
|
|
279
|
+
if (maxSelections !== void 0 && ids.length > maxSelections) errors.push({
|
|
280
|
+
field,
|
|
281
|
+
code: "MAX_SELECTIONS",
|
|
282
|
+
message: `${field} permite no máximo ${maxSelections} seleção(ões)`
|
|
283
|
+
});
|
|
284
|
+
if (minSelections !== void 0 && ids.length < minSelections) errors.push({
|
|
285
|
+
field,
|
|
286
|
+
code: "MIN_SELECTIONS",
|
|
287
|
+
message: `${field} requer no mínimo ${minSelections} seleção(ões)`
|
|
288
|
+
});
|
|
289
|
+
} else if (ids.length > 1) errors.push({
|
|
290
|
+
field,
|
|
291
|
+
code: "SINGLE_ONLY",
|
|
292
|
+
message: `${field} aceita apenas um valor`
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
function validateLink(value, field, errors) {
|
|
296
|
+
if (isEmptyValue(value)) return;
|
|
297
|
+
if (typeof value !== "object" || value === null) {
|
|
298
|
+
errors.push({
|
|
299
|
+
field,
|
|
300
|
+
code: "INVALID_LINK",
|
|
301
|
+
message: `${field} deve ser um objeto de link`
|
|
302
|
+
});
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
const link = value;
|
|
306
|
+
if (!link.url || typeof link.url !== "string") {
|
|
307
|
+
errors.push({
|
|
308
|
+
field,
|
|
309
|
+
code: "LINK_URL_REQUIRED",
|
|
310
|
+
message: `${field} requer uma URL`
|
|
311
|
+
});
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
try {
|
|
315
|
+
const parsed = new URL(link.url);
|
|
316
|
+
if (![
|
|
317
|
+
"http:",
|
|
318
|
+
"https:",
|
|
319
|
+
"mailto:",
|
|
320
|
+
"tel:"
|
|
321
|
+
].includes(parsed.protocol) && !link.url.startsWith("#") && !link.url.startsWith("/")) throw new Error("protocol");
|
|
322
|
+
} catch {
|
|
323
|
+
if (!link.url.startsWith("#") && !link.url.startsWith("/") && !link.url.startsWith("?")) errors.push({
|
|
324
|
+
field,
|
|
325
|
+
code: "INVALID_URL",
|
|
326
|
+
message: `${field} contém uma URL inválida`
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
if (link.target !== void 0 && !["_self", "_blank"].includes(String(link.target))) errors.push({
|
|
330
|
+
field,
|
|
331
|
+
code: "INVALID_TARGET",
|
|
332
|
+
message: `${field} aceita apenas _self ou _blank`
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
function validateGoogleMap(value, field, errors) {
|
|
336
|
+
if (isEmptyValue(value)) return;
|
|
337
|
+
if (typeof value !== "object" || value === null) {
|
|
338
|
+
errors.push({
|
|
339
|
+
field,
|
|
340
|
+
code: "INVALID_MAP",
|
|
341
|
+
message: `${field} deve conter endereço e coordenadas`
|
|
342
|
+
});
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
const map = value;
|
|
346
|
+
if (isEmptyValue(map.address)) errors.push({
|
|
347
|
+
field,
|
|
348
|
+
code: "ADDRESS_REQUIRED",
|
|
349
|
+
message: `${field} requer um endereço`
|
|
350
|
+
});
|
|
351
|
+
const lat = Number(map.lat);
|
|
352
|
+
const lng = Number(map.lng);
|
|
353
|
+
if (!Number.isFinite(lat) || lat < -90 || lat > 90) errors.push({
|
|
354
|
+
field,
|
|
355
|
+
code: "INVALID_LATITUDE",
|
|
356
|
+
message: `${field} contém latitude inválida (-90 a 90)`
|
|
357
|
+
});
|
|
358
|
+
if (!Number.isFinite(lng) || lng < -180 || lng > 180) errors.push({
|
|
359
|
+
field,
|
|
360
|
+
code: "INVALID_LONGITUDE",
|
|
361
|
+
message: `${field} contém longitude inválida (-180 a 180)`
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
var HEX_PATTERN = /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;
|
|
365
|
+
function validateColorPicker(value, config, field, errors) {
|
|
366
|
+
if (isEmptyValue(value)) return;
|
|
367
|
+
const color = String(value);
|
|
368
|
+
const isRgba = color.startsWith("rgba(");
|
|
369
|
+
if (isRgba && !config["enableOpacity"]) {
|
|
370
|
+
errors.push({
|
|
371
|
+
field,
|
|
372
|
+
code: "OPACITY_DISABLED",
|
|
373
|
+
message: `${field} não permite transparência`
|
|
374
|
+
});
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
if (!isRgba && !HEX_PATTERN.test(color)) {
|
|
378
|
+
errors.push({
|
|
379
|
+
field,
|
|
380
|
+
code: "INVALID_COLOR",
|
|
381
|
+
message: `${field} deve ser uma cor em formato hexadecimal válido`
|
|
382
|
+
});
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
const palette = config["palette"] ?? [];
|
|
386
|
+
if (palette.length > 0) {
|
|
387
|
+
if (!palette.map((e) => e.toLowerCase()).includes(color.toLowerCase())) errors.push({
|
|
388
|
+
field,
|
|
389
|
+
code: "NOT_IN_PALETTE",
|
|
390
|
+
message: `${field} deve usar uma cor da paleta definida`
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Valida um único campo no cliente e retorna a primeira mensagem de erro
|
|
396
|
+
* ou null quando válido. Não considera lógica condicional.
|
|
397
|
+
*/
|
|
398
|
+
function validateFieldClient(field, value) {
|
|
399
|
+
if (field.type === "clone" || field.type === "repeater" || field.type === "group" || field.type === "flexible_content") return null;
|
|
400
|
+
const config = field.config ?? {};
|
|
401
|
+
const errors = [];
|
|
402
|
+
checkRequired(value, field.required, field.label, errors);
|
|
403
|
+
switch (field.type) {
|
|
404
|
+
case "text":
|
|
405
|
+
case "textarea":
|
|
406
|
+
case "password":
|
|
407
|
+
validateTextLike(value, config, field.label, errors);
|
|
408
|
+
break;
|
|
409
|
+
case "slug":
|
|
410
|
+
validateTextLike(value, config, field.label, errors);
|
|
411
|
+
if (!isEmptyValue(value) && !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(String(value))) errors.push({
|
|
412
|
+
field: field.label,
|
|
413
|
+
code: "INVALID_SLUG",
|
|
414
|
+
message: `${field.label} deve ser um slug válido (a-z, 0-9 e hífens)`
|
|
415
|
+
});
|
|
416
|
+
break;
|
|
417
|
+
case "email":
|
|
418
|
+
validateEmail(value, field.label, errors);
|
|
419
|
+
break;
|
|
420
|
+
case "url":
|
|
421
|
+
case "oembed":
|
|
422
|
+
validateUrl(value, field.label, errors);
|
|
423
|
+
break;
|
|
424
|
+
case "number":
|
|
425
|
+
case "range":
|
|
426
|
+
validateNumber(value, config, field.label, errors);
|
|
427
|
+
break;
|
|
428
|
+
case "wysiwyg":
|
|
429
|
+
validateTextLike(value, config, field.label, errors);
|
|
430
|
+
break;
|
|
431
|
+
case "select":
|
|
432
|
+
validateSelect(value, config, field.label, errors);
|
|
433
|
+
break;
|
|
434
|
+
case "checkbox":
|
|
435
|
+
validateCheckbox(value, config, field.label, errors);
|
|
436
|
+
break;
|
|
437
|
+
case "radio":
|
|
438
|
+
validateRadio(value, config, field.label, errors);
|
|
439
|
+
break;
|
|
440
|
+
case "true_false":
|
|
441
|
+
validateTrueFalse(value, field.label, errors);
|
|
442
|
+
break;
|
|
443
|
+
case "image":
|
|
444
|
+
validateImage(value, config, field.label, errors);
|
|
445
|
+
break;
|
|
446
|
+
case "file":
|
|
447
|
+
validateFile(value, config, field.label, errors);
|
|
448
|
+
break;
|
|
449
|
+
case "gallery":
|
|
450
|
+
validateGallery(value, config, field.label, errors);
|
|
451
|
+
break;
|
|
452
|
+
case "link":
|
|
453
|
+
validateLink(value, field.label, errors);
|
|
454
|
+
break;
|
|
455
|
+
case "page_link":
|
|
456
|
+
case "post_object":
|
|
457
|
+
case "relationship":
|
|
458
|
+
case "taxonomy":
|
|
459
|
+
case "user":
|
|
460
|
+
validateRelationshipIds(value, config, field.label, errors);
|
|
461
|
+
break;
|
|
462
|
+
case "google_map":
|
|
463
|
+
validateGoogleMap(value, field.label, errors);
|
|
464
|
+
break;
|
|
465
|
+
case "color_picker": validateColorPicker(value, config, field.label, errors);
|
|
466
|
+
}
|
|
467
|
+
return errors[0]?.message ?? null;
|
|
468
|
+
}
|
|
469
|
+
//#endregion
|
|
470
|
+
//#region ../../packages/validation/dist/clone.js
|
|
471
|
+
/**
|
|
472
|
+
* Expande campos do tipo `clone` nas definições alvo.
|
|
473
|
+
*
|
|
474
|
+
* - `display: 'seamless'` (default): os campos referenciados entram
|
|
475
|
+
* diretamente na lista, com os mesmos nomes (valores "inline").
|
|
476
|
+
* - `display: 'group'`: os campos viram subcampos de um pseudo-group com o
|
|
477
|
+
* nome do clone, e os nomes internos recebem o prefixo `{clone}_`
|
|
478
|
+
* (valores aninhados em data[clone.name]).
|
|
479
|
+
*
|
|
480
|
+
* Referências inexistentes são ignoradas; clones de clones não são
|
|
481
|
+
* resolvidos recursivamente (profundidade 1).
|
|
482
|
+
*/
|
|
483
|
+
function expandCloneFields(fields) {
|
|
484
|
+
const byName = /* @__PURE__ */ new Map();
|
|
485
|
+
for (const field of fields) byName.set(field.name, field);
|
|
486
|
+
const result = [];
|
|
487
|
+
const emittedNames = /* @__PURE__ */ new Set();
|
|
488
|
+
const emit = (field) => {
|
|
489
|
+
if (emittedNames.has(field.name)) return;
|
|
490
|
+
emittedNames.add(field.name);
|
|
491
|
+
result.push(field);
|
|
492
|
+
};
|
|
493
|
+
for (const field of fields) {
|
|
494
|
+
if (field.type !== "clone") {
|
|
495
|
+
emit(field);
|
|
496
|
+
continue;
|
|
497
|
+
}
|
|
498
|
+
const config = field.config ?? {};
|
|
499
|
+
const display = config["display"] ?? "seamless";
|
|
500
|
+
const targets = config["clone"] ?? [];
|
|
501
|
+
const resolved = [];
|
|
502
|
+
for (const targetName of targets) {
|
|
503
|
+
const target = byName.get(targetName);
|
|
504
|
+
if (!target || target.type === "clone") continue;
|
|
505
|
+
resolved.push(target);
|
|
506
|
+
}
|
|
507
|
+
if (resolved.length === 0) continue;
|
|
508
|
+
if (display === "group") {
|
|
509
|
+
emit({
|
|
510
|
+
...field,
|
|
511
|
+
type: "group",
|
|
512
|
+
name: field.name,
|
|
513
|
+
label: field.label,
|
|
514
|
+
required: false,
|
|
515
|
+
conditionalLogic: void 0,
|
|
516
|
+
subFields: resolved.map((target) => ({
|
|
517
|
+
...target,
|
|
518
|
+
name: `${field.name}_${target.name}`
|
|
519
|
+
}))
|
|
520
|
+
});
|
|
521
|
+
continue;
|
|
522
|
+
}
|
|
523
|
+
for (const target of resolved) emit(target);
|
|
524
|
+
}
|
|
525
|
+
return result;
|
|
526
|
+
}
|
|
527
|
+
//#endregion
|
|
5
528
|
//#region src/lib/sanitize.ts
|
|
6
529
|
/**
|
|
7
530
|
* Sanitizador de HTML em allowlist para pontos de injeção (innerHTML).
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import "./rolldown-runtime_BMI-E3GI.mjs";
|
|
1
2
|
import { S as createAstro, d as maybeRenderHead, i as renderComponent, p as addAttribute, s as renderSlot, u as renderTemplate } from "./server_B5N27szj.mjs";
|
|
2
3
|
import { t as createComponent$1 } from "./compiler_O7J1rlsi.mjs";
|
|
3
|
-
import { n as renderScript, t as $$BaseLayout } from "./
|
|
4
|
-
import { a as LOCALE_LABELS, i as LOCALE_FLAGS, n as useTranslation, o as SUPPORTED_LOCALES, r as apiClient } from "./
|
|
4
|
+
import { n as renderScript, t as $$BaseLayout } from "./BaseLayout_vNs_yXMd.mjs";
|
|
5
|
+
import { a as LOCALE_LABELS, i as LOCALE_FLAGS, n as useTranslation, o as SUPPORTED_LOCALES, r as apiClient } from "./i18n_B-Vk5esc.mjs";
|
|
6
|
+
import { t as require_semver } from "./semver_WbqCUY_o.mjs";
|
|
5
7
|
import { createComponent, escape, ssr, ssrAttribute, ssrHydrationKey, ssrStyle } from "solid-js/web";
|
|
6
8
|
import { For, For as For2, Show, Show as Show2, createEffect, createMemo as createMemo$1, createSignal, createSignal as createSignal$1, onCleanup, onMount, onMount as onMount$1 } from "solid-js";
|
|
7
|
-
|
|
8
|
-
//#
|
|
9
|
+
require_semver();
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region ../../packages/ui/dist/server.js
|
|
9
12
|
var _tmpl$$7 = ["<span", " class=\"spinner\" aria-label=\"Carregando\"></span>"];
|
|
10
13
|
var _tmpl$2$6 = [
|
|
11
14
|
"<button",
|
|
@@ -607,7 +610,7 @@ function AdminBar(props) {
|
|
|
607
610
|
/** Versão do release atual (ex.: "0.4.0"). */
|
|
608
611
|
var APP_VERSION = {
|
|
609
612
|
name: "okcms",
|
|
610
|
-
version: "0.
|
|
613
|
+
version: "0.6.1",
|
|
611
614
|
"private": true,
|
|
612
615
|
description: "Hybrid, modular, API-first CMS",
|
|
613
616
|
engines: {
|
|
@@ -634,7 +637,7 @@ var APP_VERSION = {
|
|
|
634
637
|
"publish:all": "node scripts/prepare-publish.mjs && for pkg in packages/* apps/api apps/admin apps/web apps/worker; do [ -f \"$pkg/package.json\" ] || continue; echo \"→ publishing $pkg\"; (cd \"$pkg\" && npm publish --access public) || exit 1; done"
|
|
635
638
|
},
|
|
636
639
|
devDependencies: {
|
|
637
|
-
"@oktis-works/cms": "^0.
|
|
640
|
+
"@oktis-works/cms": "^0.6.0",
|
|
638
641
|
"@changesets/changelog-github": "^1.0.1",
|
|
639
642
|
"@changesets/cli": "^3.0.3",
|
|
640
643
|
"@types/node": "22.0.0",
|
|
@@ -1085,4 +1088,4 @@ var $$DashboardLayout = createComponent$1(($$result, $$props, $$slots) => {
|
|
|
1085
1088
|
})}</div>` })}${renderScript($$result, "/home/runner/work/cms/cms/apps/admin/src/layouts/DashboardLayout.astro?astro&type=script&index=0&lang.ts")}`;
|
|
1086
1089
|
}, "/home/runner/work/cms/cms/apps/admin/src/layouts/DashboardLayout.astro", void 0);
|
|
1087
1090
|
//#endregion
|
|
1088
|
-
export { For2 as a, Pagination as c, Table as d, createMemo$1 as f,
|
|
1091
|
+
export { For2 as a, Pagination as c, Table as d, createMemo$1 as f, Card as i, Select as l, onMount$1 as m, Badge as n, Input as o, createSignal$1 as p, Button as r, Modal as s, $$DashboardLayout as t, Show2 as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as useTranslation, r as apiClient } from "./
|
|
2
|
-
import { a as For2, c as Pagination,
|
|
1
|
+
import { n as useTranslation, r as apiClient } from "./i18n_B-Vk5esc.mjs";
|
|
2
|
+
import { a as For2, c as Pagination, l as Select, m as onMount, o as Input, p as createSignal, r as Button, s as Modal, u as Show2 } from "./DashboardLayout_BrMujuUY.mjs";
|
|
3
3
|
import { createComponent, escape, memo, ssr, ssrAttribute, ssrHydrationKey, ssrStyleProperty } from "solid-js/web";
|
|
4
4
|
//#region src/components/media/MediaLibrary.tsx
|
|
5
5
|
var _tmpl$ = [
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { escape, mergeProps, ssr, ssrElement, ssrHydrationKey } from "solid-js/web";
|
|
2
|
+
//#region src/components/shared/PageHeader.tsx
|
|
3
|
+
var _tmpl$ = [
|
|
4
|
+
"<div class=\"fb-page-header__main\"><!--$-->",
|
|
5
|
+
"<!--/--><h1>",
|
|
6
|
+
"</h1><!--$-->",
|
|
7
|
+
"<!--/--></div>"
|
|
8
|
+
];
|
|
9
|
+
var _tmpl$2 = [
|
|
10
|
+
"<span",
|
|
11
|
+
" class=\"fb-eyebrow\">",
|
|
12
|
+
"</span>"
|
|
13
|
+
];
|
|
14
|
+
var _tmpl$3 = [
|
|
15
|
+
"<p",
|
|
16
|
+
" class=\"muted\">",
|
|
17
|
+
"</p>"
|
|
18
|
+
];
|
|
19
|
+
var _tmpl$4 = [
|
|
20
|
+
"<div",
|
|
21
|
+
" class=\"fb-page-header__actions\">",
|
|
22
|
+
"</div>"
|
|
23
|
+
];
|
|
24
|
+
var _tmpl$5 = [
|
|
25
|
+
"<div",
|
|
26
|
+
" class=\"fb-page-header__toolbar\">",
|
|
27
|
+
"</div>"
|
|
28
|
+
];
|
|
29
|
+
function PageHeader(props) {
|
|
30
|
+
const { eyebrow, title, description, actions, toolbar, class: className, ...rest } = props;
|
|
31
|
+
return ssrElement("div", mergeProps({ "class": `fb-page-header ${className || ""}` }, rest), () => [
|
|
32
|
+
ssr(_tmpl$, eyebrow && ssr(_tmpl$2, ssrHydrationKey(), escape(eyebrow)), escape(title), description && ssr(_tmpl$3, ssrHydrationKey(), escape(description))),
|
|
33
|
+
"<!--$-->",
|
|
34
|
+
actions && ssr(_tmpl$4, ssrHydrationKey(), escape(actions)),
|
|
35
|
+
"<!--/-->",
|
|
36
|
+
"<!--$-->",
|
|
37
|
+
toolbar && ssr(_tmpl$5, ssrHydrationKey(), escape(toolbar)),
|
|
38
|
+
"<!--/-->"
|
|
39
|
+
], true);
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { PageHeader as t };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
|
|
2
|
-
import { S as createAstro,
|
|
2
|
+
import { S as createAstro, i as renderComponent, u as renderTemplate } from "./server_B5N27szj.mjs";
|
|
3
3
|
import { t as createComponent$1 } from "./compiler_O7J1rlsi.mjs";
|
|
4
|
-
import { n as useTranslation, r as apiClient } from "./
|
|
5
|
-
import { t as $$DashboardLayout } from "./
|
|
4
|
+
import { n as useTranslation, r as apiClient } from "./i18n_B-Vk5esc.mjs";
|
|
5
|
+
import { t as $$DashboardLayout } from "./DashboardLayout_BrMujuUY.mjs";
|
|
6
|
+
import { t as PageHeader } from "./PageHeader_CBOioOjo.mjs";
|
|
6
7
|
import { t as FbIcon } from "./FbIcon_D0f6QiFJ.mjs";
|
|
7
8
|
import { createComponent, escape, memo, ssr, ssrAttribute, ssrHydrationKey } from "solid-js/web";
|
|
8
9
|
import { For, Show, batch, createContext, createEffect, createMemo, createSignal, on, onCleanup, onMount, splitProps, useContext } from "solid-js";
|
|
@@ -7778,13 +7779,17 @@ var $$Id = createComponent$1(($$result, $$props, $$slots) => {
|
|
|
7778
7779
|
Astro.self = $$Id;
|
|
7779
7780
|
const { t } = Astro.locals;
|
|
7780
7781
|
const groupId = Astro.params.id ?? "new";
|
|
7781
|
-
|
|
7782
|
+
const isNew = groupId === "new";
|
|
7783
|
+
return renderTemplate`${renderComponent($$result, "DashboardLayout", $$DashboardLayout, { "title": isNew ? t("settings.customFields.groups.new") : t("settings.customFields.title") }, { "default": ($$result) => renderTemplate`${renderComponent($$result, "PageHeader", PageHeader, {
|
|
7784
|
+
"title": isNew ? t("settings.customFields.groups.new") : t("settings.customFields.title"),
|
|
7785
|
+
"description": isNew ? t("settings.customFields.groups.newHint") : t("settings.customFields.description")
|
|
7786
|
+
})}${renderComponent($$result, "FieldGroupEditor", FieldGroupEditor, {
|
|
7782
7787
|
"groupId": groupId,
|
|
7783
7788
|
"client:load": true,
|
|
7784
7789
|
"client:component-hydration": "load",
|
|
7785
7790
|
"client:component-path": "/home/runner/work/cms/cms/apps/admin/src/components/field-builder/FieldGroupEditor.tsx",
|
|
7786
7791
|
"client:component-export": "FieldGroupEditor"
|
|
7787
|
-
})}
|
|
7792
|
+
})}` })}`;
|
|
7788
7793
|
}, "/home/runner/work/cms/cms/apps/admin/src/pages/settings/custom-fields/[id].astro", void 0);
|
|
7789
7794
|
var $$file = "/home/runner/work/cms/cms/apps/admin/src/pages/settings/custom-fields/[id].astro";
|
|
7790
7795
|
var $$url = "/settings/custom-fields/[id]";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
|
|
2
2
|
import { S as createAstro, d as maybeRenderHead, i as renderComponent, p as addAttribute, u as renderTemplate } from "./server_B5N27szj.mjs";
|
|
3
3
|
import { t as createComponent } from "./compiler_O7J1rlsi.mjs";
|
|
4
|
-
import { t as $$DashboardLayout } from "./
|
|
4
|
+
import { t as $$DashboardLayout } from "./DashboardLayout_BrMujuUY.mjs";
|
|
5
|
+
import { t as PageHeader } from "./PageHeader_CBOioOjo.mjs";
|
|
5
6
|
//#region src/pages/plugins/[slug].astro
|
|
6
7
|
var _slug__exports = /* @__PURE__ */ __exportAll({
|
|
7
8
|
default: () => $$Slug,
|
|
@@ -16,10 +17,13 @@ var $$Slug = createComponent(($$result, $$props, $$slots) => {
|
|
|
16
17
|
const pluginSlug = String(slug ?? "").split("/")[0] ?? "";
|
|
17
18
|
const pageTitle = String(slug ?? "Plugin");
|
|
18
19
|
return renderTemplate`${renderComponent($$result, "DashboardLayout", $$DashboardLayout, {
|
|
20
|
+
"title": pageTitle,
|
|
21
|
+
"data-astro-cid-q2qjpybz": true
|
|
22
|
+
}, { "default": ($$result) => renderTemplate`${renderComponent($$result, "PageHeader", PageHeader, {
|
|
19
23
|
"title": pageTitle,
|
|
20
24
|
"description": `Página de extensão do plugin ${pluginSlug}`,
|
|
21
25
|
"data-astro-cid-q2qjpybz": true
|
|
22
|
-
}
|
|
26
|
+
})}${maybeRenderHead($$result)}<div class="plugin-page"${addAttribute(pluginSlug, "data-plugin")}${addAttribute(slug, "data-plugin-page")} data-astro-cid-q2qjpybz><div class="card plugin-page__container" data-astro-cid-q2qjpybz><div class="plugin-page__mount"${addAttribute(`page:${slug}`, "data-plugin-component")}${addAttribute(pluginSlug, "data-plugin")} data-astro-cid-q2qjpybz><!-- Componente do plugin (declarativo, sem injeção de DOM direta — DECI-027) --></div></div></div>` })}`;
|
|
23
27
|
}, "/home/runner/work/cms/cms/apps/admin/src/pages/plugins/[slug].astro", void 0);
|
|
24
28
|
var $$file = "/home/runner/work/cms/cms/apps/admin/src/pages/plugins/[slug].astro";
|
|
25
29
|
var $$url = "/plugins/[slug]";
|