@oktis-works/admin 0.4.13 → 0.4.15

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 (127) hide show
  1. package/dist/client/_astro/{ActivityWidget.DeayROhc.js → ActivityWidget.B83CLwGG.js} +2 -2
  2. package/dist/client/_astro/AdminBar.BNESswxs.js +253 -0
  3. package/dist/client/_astro/{AtGlanceWidget.CDFVi_eX.js → AtGlanceWidget.Cqbb9anJ.js} +3 -3
  4. package/dist/client/_astro/BaseLayout.B3A9-IS6.css +1 -0
  5. package/dist/client/_astro/ContentEditor.CBH227Ni.js +1 -0
  6. package/dist/client/_astro/ContentList.hmLCz5_S.js +1 -0
  7. package/dist/client/_astro/CustomFieldsManager.Dzhp_sZl.js +3 -0
  8. package/dist/client/_astro/DashboardHome.DawF-CZ9.js +1 -0
  9. package/dist/client/_astro/DashboardLayout.CEvRGr78.css +1 -0
  10. package/dist/client/_astro/DashboardLayout.astro_astro_type_script_index_0_lang.Ckp0okyg.js +1 -0
  11. package/dist/client/_astro/FieldTypePicker.BEuYPzV8.js +1 -0
  12. package/dist/client/_astro/{Footer.KkyZkNxH.js → Footer.dcA-nmBA.js} +10 -12
  13. package/dist/client/_astro/GeneralSettings.DdAwp-oL.js +1 -0
  14. package/dist/client/_astro/MediaLibrary.B9SPVPYH.js +1 -0
  15. package/dist/client/_astro/PluginManager.DN5xhAsV.js +93 -0
  16. package/dist/client/_astro/PostTypesManager.BZH1eM3c.js +1 -0
  17. package/dist/client/_astro/{QuickDraftWidget.Drp_cL_D.js → QuickDraftWidget.DBvLubay.js} +2 -2
  18. package/dist/client/_astro/ResourceHubs.BvrE39A0.js +1 -0
  19. package/dist/client/_astro/TaxonomiesManager.BrjG05jb.js +1 -0
  20. package/dist/client/_astro/ThemeManager.CsrK3HXj.js +129 -0
  21. package/dist/client/_astro/UserCreateForm.Dxq80Bqx.js +1 -0
  22. package/dist/client/_astro/UsersManager.DmBadxWw.js +1 -0
  23. package/dist/client/_astro/api.BfxYC8bU.js +1 -0
  24. package/dist/client/_astro/ar.DsV0P0EN.js +1 -0
  25. package/dist/client/_astro/{client.C7p516_9.js → client.BY0Z100j.js} +1 -1
  26. package/dist/client/_astro/custom-fields.IjuRIdAC.css +1 -0
  27. package/dist/client/_astro/es-ES.etPSaiLd.js +1 -0
  28. package/dist/client/_astro/extensions.C6GOqTCd.js +1 -0
  29. package/dist/client/_astro/he.U1Vtp3zT.js +1 -0
  30. package/dist/client/_astro/i18n.B4BuieMb.js +1 -0
  31. package/dist/client/_astro/it.DJuI8oO_.js +1 -0
  32. package/dist/client/_astro/ja.Cw8I_NUV.js +1 -0
  33. package/dist/client/_astro/{login.astro_astro_type_script_index_0_lang.D6nHqYm6.js → login.astro_astro_type_script_index_0_lang.yH8kNMtD.js} +1 -1
  34. package/dist/client/_astro/pl.Dsz-4G_z.js +1 -0
  35. package/dist/client/_astro/pt-BR.CyQAHnXs.js +1 -0
  36. package/dist/client/_astro/ru.CwIIcTdy.js +1 -0
  37. package/dist/client/_astro/src.HVGUo-fm.js +1 -0
  38. package/dist/client/_astro/sw.DwpL3sb6.js +1 -0
  39. package/dist/client/_astro/tr.CY2JWJ7Y.js +1 -0
  40. package/dist/client/_astro/uk.BudEWIU8.js +1 -0
  41. package/dist/client/_astro/{version.C0f0jrCn.js → version.CilNJ_fk.js} +1 -1
  42. package/dist/client/_astro/{web.D1H9RxZL.js → web.D_vCtCLj.js} +1 -1
  43. package/dist/client/_astro/yo.BmoZs0fO.js +1 -0
  44. package/dist/client/_astro/zh-CN.khaXV6fv.js +1 -0
  45. package/dist/server/chunks/{BaseLayout_BsR68tOH.mjs → BaseLayout_BmkfK9tu.mjs} +19 -2
  46. package/dist/server/chunks/{ContentEditor_BtclxOqH.mjs → ContentEditor_C-kz5cS4.mjs} +31 -101
  47. package/dist/server/chunks/{DashboardLayout_B9pE8ZBQ.mjs → DashboardLayout_KIUq60Dv.mjs} +52 -566
  48. package/dist/server/chunks/FieldTypePicker_CXwpmcQ3.mjs +79 -0
  49. package/dist/server/chunks/{MediaLibrary_DLO2K_4d.mjs → MediaLibrary_C-lJBpPG.mjs} +2 -2
  50. package/dist/server/chunks/ResourceHubs_T-WuZoVF.mjs +453 -0
  51. package/dist/server/chunks/{_slug__yqDK_Ow8.mjs → _slug__DjcyD19w.mjs} +1 -1
  52. package/dist/server/chunks/access_Bjuw_Gvp.mjs +34 -0
  53. package/dist/server/chunks/{ar_DBjdWIJ0.mjs → ar_DMC8HaoP.mjs} +3 -1
  54. package/dist/server/chunks/custom-fields_CxntKU56.mjs +488 -0
  55. package/dist/server/chunks/{edit_0bCUPzfW.mjs → edit_CFKKfQux.mjs} +2 -2
  56. package/dist/server/chunks/{es-ES_TJ4oK1yi.mjs → es-ES_DZvHskAD.mjs} +3 -1
  57. package/dist/server/chunks/{general_D-MMl9p8.mjs → general_CVsJAP2e.mjs} +6 -6
  58. package/dist/server/chunks/{he_TWsuTphz.mjs → he_zy3stNhR.mjs} +3 -1
  59. package/dist/server/chunks/i18n_CH59YTvE.mjs +1406 -0
  60. package/dist/server/chunks/{index_Z7GukanS.mjs → index_2Y9ZC7Gs.mjs} +8 -6
  61. package/dist/server/chunks/{index_CTpEX5iK.mjs → index_Bb3w_UqS.mjs} +2 -2
  62. package/dist/server/chunks/{index_DB6MLU0v.mjs → index_BqyoH4bc.mjs} +3 -3
  63. package/dist/server/chunks/{index_CALAZTDB.mjs → index_G7lx2uke.mjs} +2 -2
  64. package/dist/server/chunks/{index_Bq7o-ZHF.mjs → index_TyNyWm6y.mjs} +1 -1
  65. package/dist/server/chunks/{it_CEVFVWh1.mjs → it_BiUDLszZ.mjs} +3 -1
  66. package/dist/server/chunks/{ja_CqDirMqf.mjs → ja_DjFAG7hL.mjs} +3 -1
  67. package/dist/server/chunks/{login_BcWk_36h.mjs → login_BCjtaOE9.mjs} +1 -2
  68. package/dist/server/chunks/{new_DlqbYYA1.mjs → new_BZOJIQfZ.mjs} +2 -2
  69. package/dist/server/chunks/{new_BbKoexYG.mjs → new_DkHY3O0r.mjs} +2 -2
  70. package/dist/server/chunks/operations_DYc6rwSI.mjs +34 -0
  71. package/dist/server/chunks/{pl_ChIKxfZG.mjs → pl_0Xe9Qom2.mjs} +3 -1
  72. package/dist/server/chunks/{plugins_BLJAzLX4.mjs → plugins_p805vlEb.mjs} +55 -22
  73. package/dist/server/chunks/{post-types_BvVl0hZs.mjs → post-types_C7YAi_V0.mjs} +6 -6
  74. package/dist/server/chunks/{pt-BR_4d4jZWL0.mjs → pt-BR_DIZpU2Mk.mjs} +206 -2
  75. package/dist/server/chunks/resources_BVP5krU_.mjs +34 -0
  76. package/dist/server/chunks/{ru_CIc6O5Q7.mjs → ru_DFvIxd0Y.mjs} +3 -1
  77. package/dist/server/chunks/{sw_Bs3iYVDM.mjs → sw_CmaPgGYa.mjs} +3 -1
  78. package/dist/server/chunks/{taxonomies_Dkx7d-vc.mjs → taxonomies_CWhPYZDq.mjs} +2 -2
  79. package/dist/server/chunks/themes_iwb1637h.mjs +155 -0
  80. package/dist/server/chunks/{tr_C7JbXuoQ.mjs → tr_B_acwl2e.mjs} +3 -1
  81. package/dist/server/chunks/{uk_Dibs8Wkc.mjs → uk_DXnk4imL.mjs} +3 -1
  82. package/dist/server/chunks/{upload_CpGGKDEH.mjs → upload_BE7qzxe7.mjs} +2 -2
  83. package/dist/server/chunks/{yo_B6MPvz_U.mjs → yo_DDQ8a-0v.mjs} +3 -1
  84. package/dist/server/chunks/{zh-CN_G1Dc2b28.mjs → zh-CN_763uzTMQ.mjs} +3 -1
  85. package/dist/server/entry.mjs +149 -25
  86. package/dist/server/virtual_astro_middleware.mjs +6 -3
  87. package/package.json +1 -1
  88. package/dist/client/_astro/AdminBar.DQilvzQe.js +0 -234
  89. package/dist/client/_astro/BaseLayout.B2MfKf6B.css +0 -1
  90. package/dist/client/_astro/ContentEditor.WyLHMY9o.js +0 -1
  91. package/dist/client/_astro/ContentList.BWtiYbDy.js +0 -1
  92. package/dist/client/_astro/DashboardHome.-0s3t1kG.js +0 -1
  93. package/dist/client/_astro/DashboardLayout.DWuCsemN.css +0 -1
  94. package/dist/client/_astro/DashboardLayout.astro_astro_type_script_index_0_lang.Bm7kqhGo.js +0 -1
  95. package/dist/client/_astro/GeneralSettings.CaEyAV2f.js +0 -1
  96. package/dist/client/_astro/HelpTabs.99giF0f1.js +0 -103
  97. package/dist/client/_astro/LanguageSelector.DPBYaSN4.js +0 -14
  98. package/dist/client/_astro/MediaLibrary.DBfw3BM0.js +0 -1
  99. package/dist/client/_astro/PluginManager.BFoAz05U.js +0 -93
  100. package/dist/client/_astro/PostTypesManager.y9aB2d3_.js +0 -1
  101. package/dist/client/_astro/ScreenOptions.C8K8Bufc.js +0 -70
  102. package/dist/client/_astro/TaxonomiesManager.Cj54HB7P.js +0 -1
  103. package/dist/client/_astro/ThemeManager.BuULAG8h.js +0 -124
  104. package/dist/client/_astro/UserCreateForm.BMWIRfb2.js +0 -1
  105. package/dist/client/_astro/UsersManager.BogkOfCQ.js +0 -1
  106. package/dist/client/_astro/api.PfLklAa1.js +0 -1
  107. package/dist/client/_astro/ar.CzsjUutD.js +0 -1
  108. package/dist/client/_astro/en.DmN7xy_a.js +0 -1
  109. package/dist/client/_astro/es-ES.p2TLEMlZ.js +0 -1
  110. package/dist/client/_astro/extensions.DfxrGzbo.js +0 -1
  111. package/dist/client/_astro/he.BnYHiYpn.js +0 -1
  112. package/dist/client/_astro/i18n.BMDVwjZM.js +0 -1
  113. package/dist/client/_astro/it.WrWKBEAD.js +0 -1
  114. package/dist/client/_astro/ja.DxnfhIdt.js +0 -1
  115. package/dist/client/_astro/pl.jUj-RfZS.js +0 -1
  116. package/dist/client/_astro/pt-BR.DtNwEO0i.js +0 -1
  117. package/dist/client/_astro/ru.KFSfdjWn.js +0 -1
  118. package/dist/client/_astro/src.Cgonpfb5.js +0 -1
  119. package/dist/client/_astro/sw.3jlAOLOv.js +0 -1
  120. package/dist/client/_astro/tr.tnLMnGPg.js +0 -1
  121. package/dist/client/_astro/uk.VquHY_xc.js +0 -1
  122. package/dist/client/_astro/yo.Cr8hCb5u.js +0 -1
  123. package/dist/client/_astro/zh-CN.E32QqP4v.js +0 -1
  124. package/dist/server/chunks/en_C750mYKk.mjs +0 -408
  125. package/dist/server/chunks/i18n_Dj2ieo-N.mjs +0 -548
  126. package/dist/server/chunks/script_CPGt5jAh.mjs +0 -19
  127. package/dist/server/chunks/themes_CCDPOhVZ.mjs +0 -127
@@ -0,0 +1,488 @@
1
+ import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
2
+ import { S as createAstro, 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 { n as useTranslation, r as apiClient } from "./i18n_CH59YTvE.mjs";
5
+ import { t as $$DashboardLayout } from "./DashboardLayout_KIUq60Dv.mjs";
6
+ import { t as FieldTypePicker } from "./FieldTypePicker_CXwpmcQ3.mjs";
7
+ import { createComponent, escape, ssr, ssrAttribute, ssrHydrationKey } from "solid-js/web";
8
+ import { For, Show, createMemo, createSignal, onMount } from "solid-js";
9
+ //#region src/components/apps/settings/CustomFieldsManager.tsx
10
+ var _tmpl$ = [
11
+ "<div",
12
+ " class=\"notice notice--error\">",
13
+ "</div>"
14
+ ];
15
+ var _tmpl$2 = [
16
+ "<div",
17
+ " class=\"notice\">",
18
+ "</div>"
19
+ ];
20
+ var _tmpl$3 = [
21
+ "<div",
22
+ " class=\"custom-fields-toolbar\"><label><!--$-->",
23
+ "<!--/--><select class=\"input\"",
24
+ ">",
25
+ "</select></label><button type=\"button\" class=\"btn btn-primary\">+ <!--$-->",
26
+ "<!--/--></button></div>"
27
+ ];
28
+ var _tmpl$4 = [
29
+ "<section",
30
+ " class=\"card standard-fields-card\"><div class=\"section-heading\"><div><h3>",
31
+ "</h3><p class=\"muted\">",
32
+ "</p></div></div><div class=\"standard-fields-list\">",
33
+ "</div></section>"
34
+ ];
35
+ var _tmpl$5 = [
36
+ "<div",
37
+ " class=\"groups-list\">",
38
+ "</div>"
39
+ ];
40
+ var _tmpl$6 = [
41
+ "<section",
42
+ " class=\"card groups-card\"><div class=\"section-heading\"><h3>",
43
+ "</h3></div><!--$-->",
44
+ "<!--/--></section>"
45
+ ];
46
+ var _tmpl$7 = [
47
+ "<div",
48
+ " class=\"custom-fields-manager\"><!--$-->",
49
+ "<!--/--><!--$-->",
50
+ "<!--/--><!--$-->",
51
+ "<!--/--></div>"
52
+ ];
53
+ var _tmpl$8 = [
54
+ "<p",
55
+ " class=\"muted\">",
56
+ "</p>"
57
+ ];
58
+ var _tmpl$9 = [
59
+ "<option",
60
+ "><!--$-->",
61
+ "<!--/--> (<!--$-->",
62
+ "<!--/-->)</option>"
63
+ ];
64
+ var _tmpl$0 = [
65
+ "<span",
66
+ " class=\"badge badge-secondary\">",
67
+ "</span>"
68
+ ];
69
+ var _tmpl$1 = [
70
+ "<span",
71
+ " class=\"muted\">",
72
+ "</span>"
73
+ ];
74
+ var _tmpl$10 = [
75
+ "<label",
76
+ " class=\"",
77
+ "\"><span><strong>",
78
+ "</strong><small><!--$-->",
79
+ "<!--/--> · <!--$-->",
80
+ "<!--/--></small></span><span class=\"standard-field-control\"><!--$-->",
81
+ "<!--/--><!--$-->",
82
+ "<!--/--></span></label>"
83
+ ];
84
+ var _tmpl$11 = [
85
+ "<input",
86
+ " type=\"checkbox\"",
87
+ ">"
88
+ ];
89
+ var _tmpl$12 = [
90
+ "<section",
91
+ " class=\"card field-group-editor\"><div class=\"section-heading\"><h3>",
92
+ "</h3><button type=\"button\" class=\"btn\">",
93
+ "</button></div><form><div class=\"form-grid\"><label><!--$-->",
94
+ "<!--/--><input class=\"input\" required",
95
+ "></label><label><!--$-->",
96
+ "<!--/--><select class=\"input\"",
97
+ "><option value=\"normal\">",
98
+ "</option><option value=\"side\">",
99
+ "</option><option value=\"acf_after_title\">",
100
+ "</option></select></label><label><!--$-->",
101
+ "<!--/--><select class=\"input\"",
102
+ "><option value=\"standard\">",
103
+ "</option><option value=\"seamless\">",
104
+ "</option><option value=\"grouped\">",
105
+ "</option></select></label><label class=\"checkbox-label\"><input type=\"checkbox\"",
106
+ "><!--$-->",
107
+ "<!--/--></label></div><div class=\"location-rules-editor\"><div class=\"fields-editor-heading\"><div><h4>",
108
+ "</h4><p class=\"muted\">",
109
+ "</p></div><button type=\"button\" class=\"btn\">+ <!--$-->",
110
+ "<!--/--></button></div><!--$-->",
111
+ "<!--/--></div><div class=\"fields-editor-heading\"><h4>",
112
+ "</h4><button type=\"button\" class=\"btn\">+ <!--$-->",
113
+ "<!--/--></button></div><div class=\"editable-fields-list\">",
114
+ "</div><div class=\"editor-actions\"><button type=\"submit\" class=\"btn btn-primary\"",
115
+ ">",
116
+ "</button></div></form></section>"
117
+ ];
118
+ var _tmpl$13 = [
119
+ "<div",
120
+ " class=\"rule-connector\">",
121
+ "</div>"
122
+ ];
123
+ var _tmpl$14 = [
124
+ "<div",
125
+ " class=\"location-rule-group\"><!--$-->",
126
+ "<!--/--><!--$-->",
127
+ "<!--/--><button type=\"button\" class=\"btn rule-add\">+ <!--$-->",
128
+ "<!--/--></button></div>"
129
+ ];
130
+ var _tmpl$15 = [
131
+ "<select",
132
+ " class=\"input\" required",
133
+ "><option value>",
134
+ "</option><!--$-->",
135
+ "<!--/--></select>"
136
+ ];
137
+ var _tmpl$16 = [
138
+ "<div",
139
+ " class=\"location-rule-row\"><select class=\"input\"",
140
+ ">",
141
+ "</select><select class=\"input\"",
142
+ "><option value=\"eq\">",
143
+ "</option><option value=\"neq\">",
144
+ "</option></select><!--$-->",
145
+ "<!--/--><button type=\"button\" class=\"btn btn-danger\">",
146
+ "</button></div>"
147
+ ];
148
+ var _tmpl$17 = [
149
+ "<option",
150
+ ">",
151
+ "</option>"
152
+ ];
153
+ var _tmpl$18 = [
154
+ "<input",
155
+ " class=\"input\" required",
156
+ ">"
157
+ ];
158
+ var _tmpl$19 = [
159
+ "<label",
160
+ "><!--$-->",
161
+ "<!--/--><textarea class=\"input\" rows=\"3\"",
162
+ "></textarea><small class=\"muted\">",
163
+ "</small></label>"
164
+ ];
165
+ var _tmpl$20 = [
166
+ "<article",
167
+ " class=\"",
168
+ "\" draggable=\"true\"><div class=\"editable-field__topline\"><span class=\"drag-handle\"",
169
+ ">⠿</span><strong><!--$-->",
170
+ "<!--/--> <!--$-->",
171
+ "<!--/--></strong><span class=\"muted\">",
172
+ "</span><button type=\"button\" class=\"btn btn-danger\">",
173
+ "</button></div><div class=\"field-grid\"><label><!--$-->",
174
+ "<!--/--><input class=\"input\" required",
175
+ "></label><label><!--$-->",
176
+ "<!--/--><input class=\"input\" required pattern=\"[a-zA-Z0-9_-]+\"",
177
+ "></label><label><!--$-->",
178
+ "<!--/--><!--$-->",
179
+ "<!--/--></label><label class=\"checkbox-label field-required\"><input type=\"checkbox\"",
180
+ "><!--$-->",
181
+ "<!--/--></label></div><label><!--$-->",
182
+ "<!--/--><input class=\"input\"",
183
+ "></label><!--$-->",
184
+ "<!--/--></article>"
185
+ ];
186
+ var _tmpl$21 = [
187
+ "<div",
188
+ " class=\"group-row\"><div><strong>",
189
+ "</strong><small><!--$-->",
190
+ "<!--/--> · <!--$-->",
191
+ "<!--/--> <!--$-->",
192
+ "<!--/--></small></div><div class=\"group-row__actions\"><span class=\"",
193
+ "\">",
194
+ "</span><button type=\"button\" class=\"btn\">",
195
+ "</button><button type=\"button\" class=\"btn btn-danger\">",
196
+ "</button></div></div>"
197
+ ];
198
+ var STANDARD_FIELD_KEYS = [
199
+ "title",
200
+ "slug",
201
+ "content",
202
+ "excerpt",
203
+ "featured_image",
204
+ "seo_title",
205
+ "seo_description",
206
+ "status",
207
+ "author"
208
+ ];
209
+ var LOCATION_PARAMS = [
210
+ "content_type",
211
+ "content_slug",
212
+ "taxonomy",
213
+ "term",
214
+ "user_role",
215
+ "page_template",
216
+ "post_status"
217
+ ];
218
+ function CustomFieldsManager() {
219
+ const { t } = useTranslation();
220
+ const [contentTypes, setContentTypes] = createSignal([]);
221
+ const [taxonomies, setTaxonomies] = createSignal([]);
222
+ const [groups, setGroups] = createSignal([]);
223
+ const [fieldTypes, setFieldTypes] = createSignal([]);
224
+ const [categories, setCategories] = createSignal([]);
225
+ const [selectedType, setSelectedType] = createSignal("");
226
+ const [draft, setDraft] = createSignal(null);
227
+ const [draggedIndex, setDraggedIndex] = createSignal(null);
228
+ const [loading, setLoading] = createSignal(true);
229
+ const [saving, setSaving] = createSignal(false);
230
+ const [error, setError] = createSignal("");
231
+ const [notice, setNotice] = createSignal("");
232
+ const selectedContentType = createMemo(() => contentTypes().find((type) => type.slug === selectedType()));
233
+ const coreGroup = createMemo(() => groups().find((group) => group.key === `core-fields-${selectedType()}`));
234
+ const customGroups = createMemo(() => groups().filter((group) => !group.key.startsWith("core-fields-")));
235
+ const standardFields = createMemo(() => STANDARD_FIELD_KEYS.map((key) => {
236
+ const definition = coreGroup()?.fields.find((field) => field.coreFieldKey === key || field.name === key);
237
+ return {
238
+ key,
239
+ label: t(`settings.customFields.standard.fields.${key}`),
240
+ type: definition?.type ?? "text",
241
+ locked: key === "title" || key === "slug" || Boolean(definition?.isLocked)
242
+ };
243
+ }));
244
+ const enabledStandardFields = createMemo(() => {
245
+ const configured = selectedContentType()?.defaultFields;
246
+ return new Set(configured?.length ? configured : STANDARD_FIELD_KEYS);
247
+ });
248
+ const load = async () => {
249
+ setLoading(true);
250
+ setError("");
251
+ try {
252
+ const [types, taxonomyList, catalog, summaries] = await Promise.all([
253
+ apiClient.getContentTypes(),
254
+ apiClient.getTaxonomies(),
255
+ apiClient.getFieldTypes(),
256
+ apiClient.getFieldGroups()
257
+ ]);
258
+ const details = await Promise.all(summaries.map((summary) => apiClient.getFieldGroup(summary.id)));
259
+ setContentTypes(types);
260
+ setTaxonomies(taxonomyList);
261
+ setFieldTypes(catalog.types);
262
+ setCategories(catalog.categories);
263
+ setGroups(details);
264
+ if (!selectedType() && types[0]) setSelectedType(types[0].slug);
265
+ } catch (err) {
266
+ setError(err instanceof Error ? err.message : t("settings.customFields.loadError"));
267
+ } finally {
268
+ setLoading(false);
269
+ }
270
+ };
271
+ onMount(load);
272
+ const updateField = (index, patch) => {
273
+ setDraft((current) => current ? {
274
+ ...current,
275
+ fields: current.fields.map((field, fieldIndex) => fieldIndex === index ? {
276
+ ...field,
277
+ ...patch
278
+ } : field)
279
+ } : current);
280
+ };
281
+ const locationParamLabel = (param) => t(`settings.customFields.location.params.${param}`);
282
+ const locationOperatorLabel = (operator) => operator === "eq" ? t("settings.customFields.location.operators.eq") : t("settings.customFields.location.operators.neq");
283
+ const locationValueOptions = (param) => {
284
+ if (param === "content_type") return contentTypes().map((type) => ({
285
+ value: type.slug,
286
+ label: `${type.pluralLabel} (${type.slug})`
287
+ }));
288
+ if (param === "taxonomy") return taxonomies().map((taxonomy) => ({
289
+ value: taxonomy.slug,
290
+ label: `${taxonomy.name} (${taxonomy.slug})`
291
+ }));
292
+ if (param === "post_status") return [
293
+ "DRAFT",
294
+ "PUBLISHED",
295
+ "ARCHIVED",
296
+ "TRASHED"
297
+ ].map((status) => ({
298
+ value: status,
299
+ label: status
300
+ }));
301
+ return [];
302
+ };
303
+ const optionsText = (field) => {
304
+ const options = field.config["options"];
305
+ if (!Array.isArray(options)) return "";
306
+ return options.map((option) => {
307
+ if (option && typeof option === "object") {
308
+ const row = option;
309
+ return `${String(row.value ?? "")}|${String(row.label ?? row.value ?? "")}`;
310
+ }
311
+ return String(option);
312
+ }).join("\n");
313
+ };
314
+ return ssr(_tmpl$7, ssrHydrationKey(), escape(createComponent(Show, {
315
+ get when() {
316
+ return error();
317
+ },
318
+ get children() {
319
+ return ssr(_tmpl$, ssrHydrationKey(), escape(error()));
320
+ }
321
+ })), escape(createComponent(Show, {
322
+ get when() {
323
+ return notice();
324
+ },
325
+ get children() {
326
+ return ssr(_tmpl$2, ssrHydrationKey(), escape(notice()));
327
+ }
328
+ })), escape(createComponent(Show, {
329
+ get when() {
330
+ return !loading();
331
+ },
332
+ get fallback() {
333
+ return ssr(_tmpl$8, ssrHydrationKey(), escape(t("settings.customFields.loading")));
334
+ },
335
+ get children() {
336
+ return [
337
+ ssr(_tmpl$3, ssrHydrationKey(), escape(t("settings.customFields.contentType")), ssrAttribute("value", escape(selectedType(), true), false), escape(createComponent(For, {
338
+ get each() {
339
+ return contentTypes();
340
+ },
341
+ children: (type) => ssr(_tmpl$9, ssrHydrationKey() + ssrAttribute("value", escape(type.slug, true), false), escape(type.pluralLabel), escape(type.slug))
342
+ })), escape(t("settings.customFields.groups.new"))),
343
+ ssr(_tmpl$4, ssrHydrationKey(), escape(t("settings.customFields.standard.title")), escape(t("settings.customFields.standard.description")), escape(createComponent(For, {
344
+ get each() {
345
+ return standardFields();
346
+ },
347
+ children: (field) => ssr(_tmpl$10, ssrHydrationKey(), `standard-field-row ${field.locked ? "is-locked" : ""}`, escape(field.label), escape(field.key), escape(field.type), escape(createComponent(Show, {
348
+ get when() {
349
+ return field.locked;
350
+ },
351
+ get fallback() {
352
+ return ssr(_tmpl$11, ssrHydrationKey(), ssrAttribute("checked", enabledStandardFields().has(field.key), true));
353
+ },
354
+ get children() {
355
+ return ssr(_tmpl$0, ssrHydrationKey(), escape(t("settings.customFields.standard.locked")));
356
+ }
357
+ })), escape(createComponent(Show, {
358
+ get when() {
359
+ return !field.locked;
360
+ },
361
+ get children() {
362
+ return ssr(_tmpl$1, ssrHydrationKey(), enabledStandardFields().has(field.key) ? escape(t("settings.customFields.standard.enabled")) : escape(t("settings.customFields.groups.inactive")));
363
+ }
364
+ })))
365
+ }))),
366
+ createComponent(Show, {
367
+ get when() {
368
+ return draft();
369
+ },
370
+ children: (current) => ssr(_tmpl$12, ssrHydrationKey(), current().id ? escape(t("settings.customFields.form.editTitle")) : escape(t("settings.customFields.form.createTitle")), escape(t("settings.customFields.form.cancel")), escape(t("settings.customFields.form.title")), ssrAttribute("value", escape(current().title, true), false) + ssrAttribute("placeholder", escape(t("settings.customFields.form.titlePlaceholder"), true), false), escape(t("settings.customFields.form.position")), ssrAttribute("value", escape(current().position, true), false), escape(t("settings.customFields.form.positions.normal")), escape(t("settings.customFields.form.positions.side")), escape(t("settings.customFields.form.positions.acf_after_title")), escape(t("settings.customFields.form.displayStyle")), ssrAttribute("value", escape(current().displayStyle, true), false), escape(t("settings.customFields.form.displayStyles.standard")), escape(t("settings.customFields.form.displayStyles.seamless")), escape(t("settings.customFields.form.displayStyles.grouped")), ssrAttribute("checked", current().active, true), escape(t("settings.customFields.groups.active")), escape(t("settings.customFields.location.title")), escape(t("settings.customFields.location.description")), escape(t("settings.customFields.location.addGroup")), escape(createComponent(For, {
371
+ get each() {
372
+ return current().locationRules;
373
+ },
374
+ children: (ruleGroup, groupIndex) => ssr(_tmpl$14, ssrHydrationKey(), escape(createComponent(Show, {
375
+ get when() {
376
+ return groupIndex() > 0;
377
+ },
378
+ get children() {
379
+ return ssr(_tmpl$13, ssrHydrationKey(), escape(t("settings.customFields.location.or")));
380
+ }
381
+ })), escape(createComponent(For, {
382
+ each: ruleGroup,
383
+ children: (rule, ruleIndex) => [createComponent(Show, {
384
+ get when() {
385
+ return ruleIndex() > 0;
386
+ },
387
+ get children() {
388
+ return ssr(_tmpl$13, ssrHydrationKey(), escape(t("settings.customFields.location.and")));
389
+ }
390
+ }), ssr(_tmpl$16, ssrHydrationKey(), ssrAttribute("value", escape(rule.param, true), false) + ssrAttribute("aria-label", escape(t("settings.customFields.location.parameter"), true), false), escape(createComponent(For, {
391
+ each: LOCATION_PARAMS,
392
+ children: (param) => ssr(_tmpl$17, ssrHydrationKey() + ssrAttribute("value", escape(param, true), false), escape(locationParamLabel(param)))
393
+ })), ssrAttribute("value", escape(rule.operator, true), false) + ssrAttribute("aria-label", escape(t("settings.customFields.location.operator"), true), false), escape(locationOperatorLabel("eq")), escape(locationOperatorLabel("neq")), escape(createComponent(Show, {
394
+ get when() {
395
+ return locationValueOptions(rule.param).length > 0;
396
+ },
397
+ get fallback() {
398
+ return ssr(_tmpl$18, ssrHydrationKey(), ssrAttribute("value", escape(rule.value, true), false) + ssrAttribute("placeholder", escape(t("settings.customFields.location.valuePlaceholder"), true), false));
399
+ },
400
+ get children() {
401
+ return ssr(_tmpl$15, ssrHydrationKey(), ssrAttribute("value", escape(rule.value, true), false), escape(t("settings.customFields.location.chooseValue")), escape(createComponent(For, {
402
+ get each() {
403
+ return locationValueOptions(rule.param);
404
+ },
405
+ children: (option) => ssr(_tmpl$17, ssrHydrationKey() + ssrAttribute("value", escape(option.value, true), false), escape(option.label))
406
+ })));
407
+ }
408
+ })), escape(t("settings.customFields.location.remove")))]
409
+ })), escape(t("settings.customFields.location.addRule")))
410
+ })), escape(t("settings.customFields.form.field")), escape(t("settings.customFields.form.addField")), escape(createComponent(For, {
411
+ get each() {
412
+ return current().fields;
413
+ },
414
+ children: (field, index) => ssr(_tmpl$20, ssrHydrationKey(), `editable-field ${draggedIndex() === index() ? "is-dragging" : ""}`, ssrAttribute("title", escape(t("settings.customFields.form.dragHint"), true), false) + ssrAttribute("aria-label", escape(t("settings.customFields.form.dragHint"), true), false), escape(t("settings.customFields.form.field")), escape(index()) + 1, escape(t("settings.customFields.form.dragHint")), escape(t("settings.customFields.form.removeField")), escape(t("settings.customFields.form.fieldLabel")), ssrAttribute("value", escape(field.label, true), false) + ssrAttribute("placeholder", escape(t("settings.customFields.form.fieldLabelPlaceholder"), true), false), escape(t("settings.customFields.form.fieldName")), ssrAttribute("value", escape(field.name, true), false) + ssrAttribute("placeholder", escape(t("settings.customFields.form.fieldNamePlaceholder"), true), false), escape(t("settings.customFields.form.fieldType")), escape(createComponent(FieldTypePicker, {
415
+ get categories() {
416
+ return categories();
417
+ },
418
+ get types() {
419
+ return fieldTypes();
420
+ },
421
+ get value() {
422
+ return field.type;
423
+ },
424
+ onChange: (type) => updateField(index(), { type })
425
+ })), ssrAttribute("checked", field.required, true), escape(t("settings.customFields.form.required")), escape(t("settings.customFields.form.instructions")), ssrAttribute("value", escape(field.instructions ?? "", true), false) + ssrAttribute("placeholder", escape(t("settings.customFields.form.instructionsPlaceholder"), true), false), escape(createComponent(Show, {
426
+ get when() {
427
+ return [
428
+ "select",
429
+ "checkbox",
430
+ "radio"
431
+ ].includes(field.type);
432
+ },
433
+ get children() {
434
+ return ssr(_tmpl$19, ssrHydrationKey(), escape(t("settings.customFields.form.options")), ssrAttribute("value", escape(optionsText(field), true), false) + ssrAttribute("placeholder", escape(t("settings.customFields.form.optionsHint"), true), false), escape(t("settings.customFields.form.optionsHint")));
435
+ }
436
+ })))
437
+ })), ssrAttribute("disabled", saving(), true), saving() ? escape(t("common.loading")) : escape(t("settings.customFields.form.save")))
438
+ }),
439
+ ssr(_tmpl$6, ssrHydrationKey(), escape(t("settings.customFields.groups.title")), escape(createComponent(Show, {
440
+ get when() {
441
+ return customGroups().length > 0;
442
+ },
443
+ get fallback() {
444
+ return ssr(_tmpl$8, ssrHydrationKey(), escape(t("settings.customFields.groups.empty")));
445
+ },
446
+ get children() {
447
+ return ssr(_tmpl$5, ssrHydrationKey(), escape(createComponent(For, {
448
+ get each() {
449
+ return customGroups();
450
+ },
451
+ children: (group) => ssr(_tmpl$21, ssrHydrationKey(), escape(group.title), escape(group.key), escape(group.fields.length), escape(t("settings.customFields.groups.fields")), `badge ${group.active !== false ? "badge-success" : ""} ${group.active === false ? "badge-secondary" : ""}`, group.active !== false ? escape(t("settings.customFields.groups.active")) : escape(t("settings.customFields.groups.inactive")), escape(t("settings.customFields.groups.edit")), escape(t("settings.customFields.actions.delete")))
452
+ })));
453
+ }
454
+ })))
455
+ ];
456
+ }
457
+ })));
458
+ }
459
+ //#endregion
460
+ //#region src/pages/settings/custom-fields.astro
461
+ var custom_fields_exports = /* @__PURE__ */ __exportAll({
462
+ default: () => $$CustomFields,
463
+ file: () => $$file,
464
+ url: () => $$url
465
+ });
466
+ createAstro("https://astro.build");
467
+ var $$CustomFields = createComponent$1(($$result, $$props, $$slots) => {
468
+ const Astro = $$result.createAstro($$props, $$slots);
469
+ Astro.self = $$CustomFields;
470
+ const { t } = Astro.locals;
471
+ return renderTemplate`${renderComponent($$result, "DashboardLayout", $$DashboardLayout, {
472
+ "title": t("settings.customFields.title"),
473
+ "data-astro-cid-2wrpkwch": true
474
+ }, { "default": ($$result) => renderTemplate`${maybeRenderHead($$result)}<div class="settings-page" data-astro-cid-2wrpkwch><div class="page-header" data-astro-cid-2wrpkwch><h2 data-astro-cid-2wrpkwch>${t("settings.customFields.title")}</h2><p data-astro-cid-2wrpkwch>${t("settings.customFields.description")}</p></div>${renderComponent($$result, "CustomFieldsManager", CustomFieldsManager, {
475
+ "client:load": true,
476
+ "data-astro-cid-2wrpkwch": true,
477
+ "client:component-hydration": "load",
478
+ "client:component-path": "/home/runner/work/cms/cms/apps/admin/src/components/apps/settings/CustomFieldsManager.tsx",
479
+ "client:component-export": "CustomFieldsManager"
480
+ })}</div>` })}`;
481
+ }, "/home/runner/work/cms/cms/apps/admin/src/pages/settings/custom-fields.astro", void 0);
482
+ var $$file = "/home/runner/work/cms/cms/apps/admin/src/pages/settings/custom-fields.astro";
483
+ var $$url = "/settings/custom-fields";
484
+ //#endregion
485
+ //#region \0virtual:astro:page:src/pages/settings/custom-fields@_@astro
486
+ var page = () => custom_fields_exports;
487
+ //#endregion
488
+ export { page };
@@ -1,8 +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, u as renderTemplate } from "./server_B5N27szj.mjs";
3
3
  import { t as createComponent } from "./compiler_O7J1rlsi.mjs";
4
- import { t as $$DashboardLayout } from "./DashboardLayout_B9pE8ZBQ.mjs";
5
- import { t as ContentEditor } from "./ContentEditor_BtclxOqH.mjs";
4
+ import { t as $$DashboardLayout } from "./DashboardLayout_KIUq60Dv.mjs";
5
+ import { t as ContentEditor } from "./ContentEditor_C-kz5cS4.mjs";
6
6
  //#region src/pages/content/edit.astro
7
7
  var edit_exports = /* @__PURE__ */ __exportAll({
8
8
  default: () => $$Edit,
@@ -7,7 +7,9 @@ var layout = {
7
7
  "content": "Contenido",
8
8
  "media": "Medios",
9
9
  "users": "Usuarios",
10
- "settings": "Ajustes"
10
+ "settings": "Ajustes",
11
+ "plugins": "Plugins",
12
+ "themes": "Temas"
11
13
  },
12
14
  "actions": {
13
15
  "logout": "Salir",
@@ -1,8 +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, 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 "./i18n_Dj2ieo-N.mjs";
5
- import { c as Select, f as createSignal, i as Card, l as Show2, o as Input, p as onMount, r as Button, t as $$DashboardLayout } from "./DashboardLayout_B9pE8ZBQ.mjs";
4
+ import { n as useTranslation, r as apiClient } from "./i18n_CH59YTvE.mjs";
5
+ import { c as Select, d as createMemo, f as createSignal, i as Card, l as Show2, o as Input, p as onMount, r as Button, t as $$DashboardLayout } from "./DashboardLayout_KIUq60Dv.mjs";
6
6
  import { createComponent, escape, memo, ssr, ssrHydrationKey } from "solid-js/web";
7
7
  //#region src/components/apps/settings/GeneralSettings.tsx
8
8
  var _tmpl$ = [
@@ -41,7 +41,7 @@ function GeneralSettings() {
41
41
  const [error, setError] = createSignal("");
42
42
  const [info, setInfo] = createSignal("");
43
43
  const [saving, setSaving] = createSignal(false);
44
- const FIELDS = [
44
+ const fields = createMemo(() => [
45
45
  {
46
46
  key: "siteTitle",
47
47
  label: t("settings.general.fields.siteTitle"),
@@ -70,13 +70,13 @@ function GeneralSettings() {
70
70
  type: "text",
71
71
  placeholder: t("settings.general.fields.timezonePlaceholder")
72
72
  }
73
- ];
73
+ ]);
74
74
  onMount(async () => {
75
75
  try {
76
76
  const rows = await apiClient.getSettings("general");
77
77
  const map = {};
78
78
  for (const row of rows) map[row.key] = typeof row.value === "string" ? row.value : JSON.stringify(row.value ?? "");
79
- for (const field of FIELDS) if (map[field.key] === void 0) map[field.key] = "";
79
+ for (const field of fields()) if (map[field.key] === void 0) map[field.key] = "";
80
80
  setValues(map);
81
81
  setLoaded(true);
82
82
  } catch (err) {
@@ -106,7 +106,7 @@ function GeneralSettings() {
106
106
  },
107
107
  get children() {
108
108
  return createComponent(Card, { get children() {
109
- return ssr(_tmpl$3, ssrHydrationKey(), escape(t("settings.general.title")), escape(FIELDS.map((field) => field.type === "select" ? createComponent(Select, {
109
+ return ssr(_tmpl$3, ssrHydrationKey(), escape(t("settings.general.title")), escape(fields().map((field) => field.type === "select" ? createComponent(Select, {
110
110
  get name() {
111
111
  return field.key;
112
112
  },
@@ -7,7 +7,9 @@ var layout = {
7
7
  "content": "תוכן",
8
8
  "media": "מדיה",
9
9
  "users": "משתמשים",
10
- "settings": "הגדרות"
10
+ "settings": "הגדרות",
11
+ "plugins": "תוספים",
12
+ "themes": "ערכות נושא"
11
13
  },
12
14
  "actions": {
13
15
  "logout": "התנתקות",