@oktis-works/admin 0.4.32 → 0.5.4

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 (50) hide show
  1. package/dist/client/_astro/{AtGlanceWidget.VTQ1s6gO.js → AtGlanceWidget.h60KI_JU.js} +1 -1
  2. package/dist/client/_astro/{ContentEditor.BqA8tXwY.js → ContentEditor.BDb6qSSI.js} +1 -1
  3. package/dist/client/_astro/ContentEditor.QGAstGzA.js +1 -0
  4. package/dist/client/_astro/ContentTypeWorkspace.K35mfD2P.js +1 -0
  5. package/dist/client/_astro/{Footer.C2Ztvfxs.js → Footer.BwLmoHuk.js} +1 -1
  6. package/dist/client/_astro/GeneralSettings.EU3z_sSD.js +1 -0
  7. package/dist/client/_astro/MediaLibrary.D56bkgPF.js +1 -0
  8. package/dist/client/_astro/{QuickDraftWidget.CGODgKWz.js → QuickDraftWidget.CfUR8qmY.js} +1 -1
  9. package/dist/client/_astro/UsersManager.t4-9GwDK.js +1 -0
  10. package/dist/client/_astro/dist.D-evrPNi.js +1 -0
  11. package/dist/client/_astro/extensions.OpEcHTzv.js +1 -0
  12. package/dist/client/_astro/{version.BHn8EOUk.js → version.B4bPYHRP.js} +1 -1
  13. package/dist/server/chunks/{ContentEditor_BWd9SjpC.mjs → ContentEditor_DfYDk5IM.mjs} +1 -524
  14. package/dist/server/chunks/{DashboardLayout_BgR_3Kmg.mjs → DashboardLayout_7Gcd6oTS.mjs} +4 -7
  15. package/dist/server/chunks/{MediaLibrary_DjCznDtr.mjs → MediaLibrary_fu8AtNog.mjs} +1 -1
  16. package/dist/server/chunks/{_id__BPCZskdx.mjs → _id__BVLdyCKg.mjs} +1 -1
  17. package/dist/server/chunks/{_slug__CZh0NSsk.mjs → _slug__DG6xjEan.mjs} +1 -1
  18. package/dist/server/chunks/{access_BbB60vMX.mjs → access_B8fU0pWq.mjs} +1 -1
  19. package/dist/server/chunks/{custom-fields_gkSu7mus.mjs → custom-fields_BOqCiSPQ.mjs} +1 -1
  20. package/dist/server/chunks/{dist_CP9QIrJI.mjs → dist_D98LO9y-.mjs} +1394 -2
  21. package/dist/server/chunks/{edit_B_XZOs-2.mjs → edit_C27RHq7N.mjs} +2 -2
  22. package/dist/server/chunks/{general_C12Fsjmt.mjs → general_TSviTaPT.mjs} +1 -1
  23. package/dist/server/chunks/{index_-3JgsCPE.mjs → index_40l_yCUu.mjs} +1 -1
  24. package/dist/server/chunks/{index_DogVC9St.mjs → index_BwaqRmvv.mjs} +2 -2
  25. package/dist/server/chunks/{index_Cv-61rVw.mjs → index_CCNhQxvS.mjs} +1 -1
  26. package/dist/server/chunks/{index_DtxMxpNt.mjs → index_CRSTdqw0.mjs} +1 -1
  27. package/dist/server/chunks/{index_CTPkLmuV.mjs → index_t5k7sOZ8.mjs} +2 -2
  28. package/dist/server/chunks/{logs_Czef3YX3.mjs → logs_DrjJ6S6J.mjs} +1 -1
  29. package/dist/server/chunks/{menus_Rpk2_4Kh.mjs → menus_DjfOcrez.mjs} +1 -1
  30. package/dist/server/chunks/{new_WebRzl3r.mjs → new_B484WwaA.mjs} +2 -2
  31. package/dist/server/chunks/{new_CRKYoxj9.mjs → new_DNNbQ1Zw.mjs} +1 -1
  32. package/dist/server/chunks/{node_kWZa8y--.mjs → node_CECPlmah.mjs} +1 -1
  33. package/dist/server/chunks/{plugins_BzyVlp45.mjs → plugins_Bhuk-oUR.mjs} +1 -1
  34. package/dist/server/chunks/{post-types_mkGPxnoA.mjs → post-types_BtisIanW.mjs} +1 -1
  35. package/dist/server/chunks/{sharp_37gnUicY.mjs → sharp_DQfjpH-u.mjs} +2 -2
  36. package/dist/server/chunks/{taxonomies_DjiyW42Q.mjs → taxonomies_CHJK2gT1.mjs} +1 -1
  37. package/dist/server/chunks/{taxonomy_CSF3swtW.mjs → taxonomy_DboKpEOu.mjs} +1 -1
  38. package/dist/server/chunks/{themes_BK0W-bTo.mjs → themes_MC8vERGL.mjs} +1 -1
  39. package/dist/server/chunks/{upload_8S15ilw9.mjs → upload_BMoVV-rt.mjs} +2 -2
  40. package/dist/server/chunks/{webhooks_DBxN5SHZ.mjs → webhooks_EHN9q7Yv.mjs} +1 -1
  41. package/dist/server/entry.mjs +24 -24
  42. package/package.json +1 -1
  43. package/dist/client/_astro/ContentEditor.Dn2kdVzL.js +0 -1
  44. package/dist/client/_astro/ContentTypeWorkspace.Dou_h7cE.js +0 -1
  45. package/dist/client/_astro/GeneralSettings.B5RHRwp3.js +0 -1
  46. package/dist/client/_astro/MediaLibrary.D-y-C-DJ.js +0 -1
  47. package/dist/client/_astro/UsersManager.BYnb8Q4f.js +0 -1
  48. package/dist/client/_astro/extensions.DjCcPZ-S.js +0 -1
  49. package/dist/client/_astro/src.DQwsXUur.js +0 -1
  50. package/dist/server/chunks/semver_WbqCUY_o.mjs +0 -1395
@@ -1,530 +1,7 @@
1
1
  import { n as useTranslation, r as apiClient } from "./i18n_Co0XNC0I.mjs";
2
- import { a as For2, f as createMemo$1, p as createSignal$1, u as Show2 } from "./DashboardLayout_BgR_3Kmg.mjs";
2
+ import { a as For2, f as createMemo$1, g as validateFieldClient, m as expandCloneFields, p as createSignal$1, u as Show2 } from "./DashboardLayout_7Gcd6oTS.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
528
5
  //#region src/lib/sanitize.ts
529
6
  /**
530
7
  * Sanitizador de HTML em allowlist para pontos de injeção (innerHTML).
@@ -1,14 +1,11 @@
1
- import "./rolldown-runtime_BMI-E3GI.mjs";
2
1
  import { S as createAstro, d as maybeRenderHead, i as renderComponent, p as addAttribute, s as renderSlot, u as renderTemplate } from "./server_B5N27szj.mjs";
3
2
  import { t as createComponent$1 } from "./compiler_O7J1rlsi.mjs";
4
3
  import { n as renderScript, t as $$BaseLayout } from "./BaseLayout_CHj9u5wO.mjs";
5
4
  import { a as LOCALE_LABELS, i as LOCALE_FLAGS, n as useTranslation, o as SUPPORTED_LOCALES, r as apiClient } from "./i18n_Co0XNC0I.mjs";
6
- import { t as require_semver } from "./semver_WbqCUY_o.mjs";
7
5
  import { createComponent, escape, ssr, ssrAttribute, ssrHydrationKey, ssrStyle } from "solid-js/web";
8
6
  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";
9
- require_semver();
10
- //#endregion
11
- //#region ../../packages/ui/dist/server.js
7
+ import { expandCloneFields, validateFieldClient } from "@oktis-works/validation";
8
+ //#region ../../node_modules/.bun/@oktis-works+ui@0.4.28/node_modules/@oktis-works/ui/dist/server.js
12
9
  var _tmpl$$7 = ["<span", " class=\"spinner\" aria-label=\"Carregando\"></span>"];
13
10
  var _tmpl$2$6 = [
14
11
  "<button",
@@ -610,7 +607,7 @@ function AdminBar(props) {
610
607
  /** Versão do release atual (ex.: "0.4.0"). */
611
608
  var APP_VERSION = {
612
609
  name: "okcms",
613
- version: "0.5.3",
610
+ version: "0.5.4",
614
611
  "private": true,
615
612
  description: "Hybrid, modular, API-first CMS",
616
613
  engines: {
@@ -1088,4 +1085,4 @@ var $$DashboardLayout = createComponent$1(($$result, $$props, $$slots) => {
1088
1085
  })}</div>` })}${renderScript($$result, "/home/runner/work/cms/cms/apps/admin/src/layouts/DashboardLayout.astro?astro&type=script&index=0&lang.ts")}`;
1089
1086
  }, "/home/runner/work/cms/cms/apps/admin/src/layouts/DashboardLayout.astro", void 0);
1090
1087
  //#endregion
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 };
1088
+ export { For2 as a, Pagination as c, Table as d, createMemo$1 as f, validateFieldClient as g, onMount$1 as h, Card as i, Select as l, expandCloneFields 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
1
  import { n as useTranslation, r as apiClient } from "./i18n_Co0XNC0I.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_BgR_3Kmg.mjs";
2
+ import { a as For2, c as Pagination, h as onMount, l as Select, o as Input, p as createSignal, r as Button, s as Modal, u as Show2 } from "./DashboardLayout_7Gcd6oTS.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$ = [
@@ -2,7 +2,7 @@ import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
2
2
  import { S as createAstro, d as maybeRenderHead, i as renderComponent, u as renderTemplate } from "./server_B5N27szj.mjs";
3
3
  import { t as createComponent$1 } from "./compiler_O7J1rlsi.mjs";
4
4
  import { n as useTranslation, r as apiClient } from "./i18n_Co0XNC0I.mjs";
5
- import { t as $$DashboardLayout } from "./DashboardLayout_BgR_3Kmg.mjs";
5
+ import { t as $$DashboardLayout } from "./DashboardLayout_7Gcd6oTS.mjs";
6
6
  import { t as FbIcon } from "./FbIcon_D0f6QiFJ.mjs";
7
7
  import { createComponent, escape, memo, ssr, ssrAttribute, ssrHydrationKey } from "solid-js/web";
8
8
  import { For, Show, batch, createContext, createEffect, createMemo, createSignal, on, onCleanup, onMount, splitProps, useContext } from "solid-js";
@@ -1,7 +1,7 @@
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 "./DashboardLayout_BgR_3Kmg.mjs";
4
+ import { t as $$DashboardLayout } from "./DashboardLayout_7Gcd6oTS.mjs";
5
5
  //#region src/pages/plugins/[slug].astro
6
6
  var _slug__exports = /* @__PURE__ */ __exportAll({
7
7
  default: () => $$Slug,
@@ -2,7 +2,7 @@ import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
2
2
  import { S as createAstro, d as maybeRenderHead, i as renderComponent, u as renderTemplate } from "./server_B5N27szj.mjs";
3
3
  import { t as createComponent$1 } from "./compiler_O7J1rlsi.mjs";
4
4
  import { n as useTranslation, r as apiClient } from "./i18n_Co0XNC0I.mjs";
5
- import { t as $$DashboardLayout } from "./DashboardLayout_BgR_3Kmg.mjs";
5
+ import { t as $$DashboardLayout } from "./DashboardLayout_7Gcd6oTS.mjs";
6
6
  import { createComponent, escape, ssr, ssrAttribute, ssrHydrationKey } from "solid-js/web";
7
7
  import { For, Show, createSignal, onMount } from "solid-js";
8
8
  //#region src/components/apps/settings/ResourceHubs.tsx
@@ -2,7 +2,7 @@ import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
2
2
  import { S as createAstro, d as maybeRenderHead, i as renderComponent, u as renderTemplate } from "./server_B5N27szj.mjs";
3
3
  import { t as createComponent$1 } from "./compiler_O7J1rlsi.mjs";
4
4
  import { n as useTranslation, r as apiClient } from "./i18n_Co0XNC0I.mjs";
5
- import { t as $$DashboardLayout } from "./DashboardLayout_BgR_3Kmg.mjs";
5
+ import { t as $$DashboardLayout } from "./DashboardLayout_7Gcd6oTS.mjs";
6
6
  import { t as FbIcon } from "./FbIcon_D0f6QiFJ.mjs";
7
7
  import { createComponent, escape, ssr, ssrAttribute, ssrHydrationKey } from "solid-js/web";
8
8
  import { For, Show, createMemo, createSignal, onMount } from "solid-js";