@strapi/i18n 0.0.0-experimental.e60ec1829240dae21c1e1d29076681c322288813 → 0.0.0-experimental.e81b49f196c3dd00856818d61a256a3ff8ec2011

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 (412) hide show
  1. package/LICENSE +18 -3
  2. package/dist/admin/components/BulkLocaleActionModal.js +262 -0
  3. package/dist/admin/components/BulkLocaleActionModal.js.map +1 -0
  4. package/dist/admin/components/BulkLocaleActionModal.mjs +260 -0
  5. package/dist/admin/components/BulkLocaleActionModal.mjs.map +1 -0
  6. package/dist/admin/components/CMHeaderActions.js +721 -0
  7. package/dist/admin/components/CMHeaderActions.js.map +1 -0
  8. package/dist/admin/components/CMHeaderActions.mjs +696 -0
  9. package/dist/admin/components/CMHeaderActions.mjs.map +1 -0
  10. package/dist/admin/components/CMListViewModalsAdditionalInformation.js +69 -0
  11. package/dist/admin/components/CMListViewModalsAdditionalInformation.js.map +1 -0
  12. package/dist/admin/components/CMListViewModalsAdditionalInformation.mjs +65 -0
  13. package/dist/admin/components/CMListViewModalsAdditionalInformation.mjs.map +1 -0
  14. package/dist/admin/components/CheckboxConfirmation.js +155 -0
  15. package/dist/admin/components/CheckboxConfirmation.js.map +1 -0
  16. package/dist/admin/components/CheckboxConfirmation.mjs +134 -0
  17. package/dist/admin/components/CheckboxConfirmation.mjs.map +1 -0
  18. package/dist/admin/components/CreateLocale.js +395 -0
  19. package/dist/admin/components/CreateLocale.js.map +1 -0
  20. package/dist/admin/components/CreateLocale.mjs +369 -0
  21. package/dist/admin/components/CreateLocale.mjs.map +1 -0
  22. package/dist/admin/components/DeleteLocale.js +90 -0
  23. package/dist/admin/components/DeleteLocale.js.map +1 -0
  24. package/dist/admin/components/DeleteLocale.mjs +69 -0
  25. package/dist/admin/components/DeleteLocale.mjs.map +1 -0
  26. package/dist/admin/components/EditLocale.js +212 -0
  27. package/dist/admin/components/EditLocale.js.map +1 -0
  28. package/dist/admin/components/EditLocale.mjs +190 -0
  29. package/dist/admin/components/EditLocale.mjs.map +1 -0
  30. package/dist/admin/components/LocaleListCell.js +82 -0
  31. package/dist/admin/components/LocaleListCell.js.map +1 -0
  32. package/dist/admin/components/LocaleListCell.mjs +80 -0
  33. package/dist/admin/components/LocaleListCell.mjs.map +1 -0
  34. package/dist/admin/components/LocalePicker.js +98 -0
  35. package/dist/admin/components/LocalePicker.js.map +1 -0
  36. package/dist/admin/components/LocalePicker.mjs +77 -0
  37. package/dist/admin/components/LocalePicker.mjs.map +1 -0
  38. package/dist/admin/components/LocaleTable.js +143 -0
  39. package/dist/admin/components/LocaleTable.js.map +1 -0
  40. package/dist/admin/components/LocaleTable.mjs +122 -0
  41. package/dist/admin/components/LocaleTable.mjs.map +1 -0
  42. package/dist/admin/constants.js +37 -0
  43. package/dist/admin/constants.js.map +1 -0
  44. package/dist/admin/constants.mjs +35 -0
  45. package/dist/admin/constants.mjs.map +1 -0
  46. package/dist/admin/contentManagerHooks/editView.js +106 -0
  47. package/dist/admin/contentManagerHooks/editView.js.map +1 -0
  48. package/dist/admin/contentManagerHooks/editView.mjs +85 -0
  49. package/dist/admin/contentManagerHooks/editView.mjs.map +1 -0
  50. package/dist/admin/contentManagerHooks/listView.js +43 -0
  51. package/dist/admin/contentManagerHooks/listView.js.map +1 -0
  52. package/dist/admin/contentManagerHooks/listView.mjs +41 -0
  53. package/dist/admin/contentManagerHooks/listView.mjs.map +1 -0
  54. package/dist/admin/contentReleasesHooks/releaseDetailsView.js +20 -0
  55. package/dist/admin/contentReleasesHooks/releaseDetailsView.js.map +1 -0
  56. package/dist/admin/contentReleasesHooks/releaseDetailsView.mjs +18 -0
  57. package/dist/admin/contentReleasesHooks/releaseDetailsView.mjs.map +1 -0
  58. package/dist/admin/hooks/useI18n.js +78 -0
  59. package/dist/admin/hooks/useI18n.js.map +1 -0
  60. package/dist/admin/hooks/useI18n.mjs +57 -0
  61. package/dist/admin/hooks/useI18n.mjs.map +1 -0
  62. package/dist/admin/index.js +225 -5
  63. package/dist/admin/index.js.map +1 -1
  64. package/dist/admin/index.mjs +201 -5
  65. package/dist/admin/index.mjs.map +1 -1
  66. package/dist/admin/middlewares/extendCTBAttributeInitialData.js +71 -0
  67. package/dist/admin/middlewares/extendCTBAttributeInitialData.js.map +1 -0
  68. package/dist/admin/middlewares/extendCTBAttributeInitialData.mjs +69 -0
  69. package/dist/admin/middlewares/extendCTBAttributeInitialData.mjs.map +1 -0
  70. package/dist/admin/middlewares/extendCTBInitialData.js +40 -0
  71. package/dist/admin/middlewares/extendCTBInitialData.js.map +1 -0
  72. package/dist/admin/middlewares/extendCTBInitialData.mjs +38 -0
  73. package/dist/admin/middlewares/extendCTBInitialData.mjs.map +1 -0
  74. package/dist/admin/middlewares/rbac-middleware.js +49 -0
  75. package/dist/admin/middlewares/rbac-middleware.js.map +1 -0
  76. package/dist/admin/middlewares/rbac-middleware.mjs +28 -0
  77. package/dist/admin/middlewares/rbac-middleware.mjs.map +1 -0
  78. package/dist/admin/pages/SettingsPage.js +107 -0
  79. package/dist/admin/pages/SettingsPage.js.map +1 -0
  80. package/dist/admin/pages/SettingsPage.mjs +85 -0
  81. package/dist/admin/pages/SettingsPage.mjs.map +1 -0
  82. package/dist/admin/pluginId.js +6 -0
  83. package/dist/admin/pluginId.js.map +1 -0
  84. package/dist/admin/pluginId.mjs +4 -0
  85. package/dist/admin/pluginId.mjs.map +1 -0
  86. package/dist/admin/services/api.js +13 -0
  87. package/dist/admin/services/api.js.map +1 -0
  88. package/dist/admin/services/api.mjs +11 -0
  89. package/dist/admin/services/api.mjs.map +1 -0
  90. package/dist/admin/services/locales.js +72 -0
  91. package/dist/admin/services/locales.js.map +1 -0
  92. package/dist/admin/services/locales.mjs +66 -0
  93. package/dist/admin/services/locales.mjs.map +1 -0
  94. package/dist/admin/services/relations.js +23 -0
  95. package/dist/admin/services/relations.js.map +1 -0
  96. package/dist/admin/services/relations.mjs +21 -0
  97. package/dist/admin/services/relations.mjs.map +1 -0
  98. package/dist/admin/src/components/BulkLocaleActionModal.d.ts +16 -0
  99. package/dist/admin/src/components/CMHeaderActions.d.ts +35 -3
  100. package/dist/admin/src/components/CreateLocale.d.ts +6 -6
  101. package/dist/admin/src/components/EditLocale.d.ts +5 -4
  102. package/dist/admin/src/components/LocaleListCell.d.ts +4 -4
  103. package/dist/admin/src/components/tests/CreateLocale.test.d.ts +1 -0
  104. package/dist/admin/src/components/tests/DeleteLocale.test.d.ts +1 -0
  105. package/dist/admin/src/components/tests/EditLocale.test.d.ts +1 -0
  106. package/dist/admin/src/components/tests/LocaleListCell.test.d.ts +1 -0
  107. package/dist/admin/src/contentReleasesHooks/releaseDetailsView.d.ts +10 -6
  108. package/dist/admin/src/pages/tests/SettingsPage.test.d.ts +1 -0
  109. package/dist/admin/src/services/api.d.ts +2 -3
  110. package/dist/admin/src/services/locales.d.ts +1 -1
  111. package/dist/admin/src/services/relations.d.ts +7 -0
  112. package/dist/admin/src/utils/baseQuery.d.ts +4 -19
  113. package/dist/admin/src/utils/clean.d.ts +4 -0
  114. package/dist/admin/src/utils/schemas.d.ts +642 -15
  115. package/dist/admin/tests/server.d.ts +1 -0
  116. package/dist/admin/tests/utils.d.ts +6 -0
  117. package/dist/admin/translations/de.json.js +66 -0
  118. package/dist/admin/translations/de.json.js.map +1 -0
  119. package/dist/admin/translations/de.json.mjs +64 -0
  120. package/dist/admin/translations/de.json.mjs.map +1 -0
  121. package/dist/admin/translations/dk.json.js +66 -0
  122. package/dist/admin/translations/dk.json.js.map +1 -0
  123. package/dist/admin/translations/dk.json.mjs +64 -0
  124. package/dist/admin/translations/dk.json.mjs.map +1 -0
  125. package/dist/admin/translations/en.json.js +81 -0
  126. package/dist/admin/translations/en.json.js.map +1 -0
  127. package/dist/admin/translations/en.json.mjs +79 -0
  128. package/dist/admin/translations/en.json.mjs.map +1 -0
  129. package/dist/admin/translations/es.json.js +66 -0
  130. package/dist/admin/translations/es.json.js.map +1 -0
  131. package/dist/admin/translations/es.json.mjs +64 -0
  132. package/dist/admin/translations/es.json.mjs.map +1 -0
  133. package/dist/admin/translations/fr.json.js +66 -0
  134. package/dist/admin/translations/fr.json.js.map +1 -0
  135. package/dist/admin/translations/fr.json.mjs +64 -0
  136. package/dist/admin/translations/fr.json.mjs.map +1 -0
  137. package/dist/admin/translations/ko.json.js +65 -0
  138. package/dist/admin/translations/ko.json.js.map +1 -0
  139. package/dist/admin/translations/ko.json.mjs +63 -0
  140. package/dist/admin/translations/ko.json.mjs.map +1 -0
  141. package/dist/admin/translations/pl.json.js +66 -0
  142. package/dist/admin/translations/pl.json.js.map +1 -0
  143. package/dist/admin/translations/pl.json.mjs +64 -0
  144. package/dist/admin/translations/pl.json.mjs.map +1 -0
  145. package/dist/admin/translations/ru.json.js +68 -0
  146. package/dist/admin/translations/ru.json.js.map +1 -0
  147. package/dist/admin/translations/ru.json.mjs +66 -0
  148. package/dist/admin/translations/ru.json.mjs.map +1 -0
  149. package/dist/admin/translations/tr.json.js +66 -0
  150. package/dist/admin/translations/tr.json.js.map +1 -0
  151. package/dist/admin/translations/tr.json.mjs +64 -0
  152. package/dist/admin/translations/tr.json.mjs.map +1 -0
  153. package/dist/admin/translations/uk.json.js +82 -0
  154. package/dist/admin/translations/uk.json.js.map +1 -0
  155. package/dist/admin/translations/uk.json.mjs +80 -0
  156. package/dist/admin/translations/uk.json.mjs.map +1 -0
  157. package/dist/admin/translations/zh-Hans.json.js +57 -0
  158. package/dist/admin/translations/zh-Hans.json.js.map +1 -0
  159. package/dist/admin/translations/zh-Hans.json.mjs +55 -0
  160. package/dist/admin/translations/zh-Hans.json.mjs.map +1 -0
  161. package/dist/admin/translations/zh.json.js +66 -0
  162. package/dist/admin/translations/zh.json.js.map +1 -0
  163. package/dist/admin/translations/zh.json.mjs +64 -0
  164. package/dist/admin/translations/zh.json.mjs.map +1 -0
  165. package/dist/admin/utils/baseQuery.js +8 -0
  166. package/dist/admin/utils/baseQuery.js.map +1 -0
  167. package/dist/admin/utils/baseQuery.mjs +6 -0
  168. package/dist/admin/utils/baseQuery.mjs.map +1 -0
  169. package/dist/admin/utils/clean.js +70 -0
  170. package/dist/admin/utils/clean.js.map +1 -0
  171. package/dist/admin/utils/clean.mjs +68 -0
  172. package/dist/admin/utils/clean.mjs.map +1 -0
  173. package/dist/admin/utils/fields.js +34 -0
  174. package/dist/admin/utils/fields.js.map +1 -0
  175. package/dist/admin/utils/fields.mjs +31 -0
  176. package/dist/admin/utils/fields.mjs.map +1 -0
  177. package/dist/admin/utils/getTranslation.js +8 -0
  178. package/dist/admin/utils/getTranslation.js.map +1 -0
  179. package/dist/admin/utils/getTranslation.mjs +6 -0
  180. package/dist/admin/utils/getTranslation.mjs.map +1 -0
  181. package/dist/admin/utils/prefixPluginTranslations.js +11 -0
  182. package/dist/admin/utils/prefixPluginTranslations.js.map +1 -0
  183. package/dist/admin/utils/prefixPluginTranslations.mjs +9 -0
  184. package/dist/admin/utils/prefixPluginTranslations.mjs.map +1 -0
  185. package/dist/admin/utils/schemas.js +74 -0
  186. package/dist/admin/utils/schemas.js.map +1 -0
  187. package/dist/admin/utils/schemas.mjs +72 -0
  188. package/dist/admin/utils/schemas.mjs.map +1 -0
  189. package/dist/admin/utils/strings.js +6 -0
  190. package/dist/admin/utils/strings.js.map +1 -0
  191. package/dist/admin/utils/strings.mjs +4 -0
  192. package/dist/admin/utils/strings.mjs.map +1 -0
  193. package/dist/server/bootstrap.js +79 -0
  194. package/dist/server/bootstrap.js.map +1 -0
  195. package/dist/server/bootstrap.mjs +77 -0
  196. package/dist/server/bootstrap.mjs.map +1 -0
  197. package/dist/server/constants/index.js +29 -0
  198. package/dist/server/constants/index.js.map +1 -0
  199. package/dist/server/constants/index.mjs +25 -0
  200. package/dist/server/constants/index.mjs.map +1 -0
  201. package/dist/server/constants/iso-locales.json.js +2423 -0
  202. package/dist/server/constants/iso-locales.json.js.map +1 -0
  203. package/dist/server/constants/iso-locales.json.mjs +2421 -0
  204. package/dist/server/constants/iso-locales.json.mjs.map +1 -0
  205. package/dist/server/content-types/index.js +10 -0
  206. package/dist/server/content-types/index.js.map +1 -0
  207. package/dist/server/content-types/index.mjs +8 -0
  208. package/dist/server/content-types/index.mjs.map +1 -0
  209. package/dist/server/content-types/locale/index.js +10 -0
  210. package/dist/server/content-types/locale/index.js.map +1 -0
  211. package/dist/server/content-types/locale/index.mjs +8 -0
  212. package/dist/server/content-types/locale/index.mjs.map +1 -0
  213. package/dist/server/content-types/locale/schema.json.js +46 -0
  214. package/dist/server/content-types/locale/schema.json.js.map +1 -0
  215. package/dist/server/content-types/locale/schema.json.mjs +38 -0
  216. package/dist/server/content-types/locale/schema.json.mjs.map +1 -0
  217. package/dist/server/controllers/content-types.js +76 -0
  218. package/dist/server/controllers/content-types.js.map +1 -0
  219. package/dist/server/controllers/content-types.mjs +74 -0
  220. package/dist/server/controllers/content-types.mjs.map +1 -0
  221. package/dist/server/controllers/index.js +14 -0
  222. package/dist/server/controllers/index.js.map +1 -0
  223. package/dist/server/controllers/index.mjs +12 -0
  224. package/dist/server/controllers/index.mjs.map +1 -0
  225. package/dist/server/controllers/iso-locales.js +13 -0
  226. package/dist/server/controllers/iso-locales.js.map +1 -0
  227. package/dist/server/controllers/iso-locales.mjs +11 -0
  228. package/dist/server/controllers/iso-locales.mjs.map +1 -0
  229. package/dist/server/controllers/locales.js +108 -0
  230. package/dist/server/controllers/locales.js.map +1 -0
  231. package/dist/server/controllers/locales.mjs +87 -0
  232. package/dist/server/controllers/locales.mjs.map +1 -0
  233. package/dist/server/controllers/validate-locale-creation.js +47 -0
  234. package/dist/server/controllers/validate-locale-creation.js.map +1 -0
  235. package/dist/server/controllers/validate-locale-creation.mjs +45 -0
  236. package/dist/server/controllers/validate-locale-creation.mjs.map +1 -0
  237. package/dist/server/domain/locale.js +11 -0
  238. package/dist/server/domain/locale.js.map +1 -0
  239. package/dist/server/domain/locale.mjs +9 -0
  240. package/dist/server/domain/locale.mjs.map +1 -0
  241. package/dist/server/graphql.js +115 -0
  242. package/dist/server/graphql.js.map +1 -0
  243. package/dist/server/graphql.mjs +113 -0
  244. package/dist/server/graphql.mjs.map +1 -0
  245. package/dist/server/index.js +18 -3520
  246. package/dist/server/index.js.map +1 -1
  247. package/dist/server/index.mjs +17 -3502
  248. package/dist/server/index.mjs.map +1 -1
  249. package/dist/server/register.js +79 -0
  250. package/dist/server/register.js.map +1 -0
  251. package/dist/server/register.mjs +77 -0
  252. package/dist/server/register.mjs.map +1 -0
  253. package/dist/server/routes/admin.js +102 -0
  254. package/dist/server/routes/admin.js.map +1 -0
  255. package/dist/server/routes/admin.mjs +100 -0
  256. package/dist/server/routes/admin.mjs.map +1 -0
  257. package/dist/server/routes/content-api.js +19 -0
  258. package/dist/server/routes/content-api.js.map +1 -0
  259. package/dist/server/routes/content-api.mjs +17 -0
  260. package/dist/server/routes/content-api.mjs.map +1 -0
  261. package/dist/server/routes/index.js +12 -0
  262. package/dist/server/routes/index.js.map +1 -0
  263. package/dist/server/routes/index.mjs +10 -0
  264. package/dist/server/routes/index.mjs.map +1 -0
  265. package/dist/server/routes/validation/locale.js +57 -0
  266. package/dist/server/routes/validation/locale.js.map +1 -0
  267. package/dist/server/routes/validation/locale.mjs +36 -0
  268. package/dist/server/routes/validation/locale.mjs.map +1 -0
  269. package/dist/server/services/content-types.js +157 -0
  270. package/dist/server/services/content-types.js.map +1 -0
  271. package/dist/server/services/content-types.mjs +155 -0
  272. package/dist/server/services/content-types.mjs.map +1 -0
  273. package/dist/server/services/index.js +22 -0
  274. package/dist/server/services/index.js.map +1 -0
  275. package/dist/server/services/index.mjs +20 -0
  276. package/dist/server/services/index.mjs.map +1 -0
  277. package/dist/server/services/iso-locales.js +12 -0
  278. package/dist/server/services/iso-locales.js.map +1 -0
  279. package/dist/server/services/iso-locales.mjs +10 -0
  280. package/dist/server/services/iso-locales.mjs.map +1 -0
  281. package/dist/server/services/locales.js +114 -0
  282. package/dist/server/services/locales.js.map +1 -0
  283. package/dist/server/services/locales.mjs +112 -0
  284. package/dist/server/services/locales.mjs.map +1 -0
  285. package/dist/server/services/localizations.js +68 -0
  286. package/dist/server/services/localizations.js.map +1 -0
  287. package/dist/server/services/localizations.mjs +66 -0
  288. package/dist/server/services/localizations.mjs.map +1 -0
  289. package/dist/server/services/metrics.js +30 -0
  290. package/dist/server/services/metrics.js.map +1 -0
  291. package/dist/server/services/metrics.mjs +28 -0
  292. package/dist/server/services/metrics.mjs.map +1 -0
  293. package/dist/server/services/permissions/actions.js +136 -0
  294. package/dist/server/services/permissions/actions.js.map +1 -0
  295. package/dist/server/services/permissions/actions.mjs +134 -0
  296. package/dist/server/services/permissions/actions.mjs.map +1 -0
  297. package/dist/server/services/permissions/engine.js +52 -0
  298. package/dist/server/services/permissions/engine.js.map +1 -0
  299. package/dist/server/services/permissions/engine.mjs +50 -0
  300. package/dist/server/services/permissions/engine.mjs.map +1 -0
  301. package/dist/server/services/permissions/sections-builder.js +45 -0
  302. package/dist/server/services/permissions/sections-builder.js.map +1 -0
  303. package/dist/server/services/permissions/sections-builder.mjs +43 -0
  304. package/dist/server/services/permissions/sections-builder.mjs.map +1 -0
  305. package/dist/server/services/permissions.js +14 -0
  306. package/dist/server/services/permissions.js.map +1 -0
  307. package/dist/server/services/permissions.mjs +12 -0
  308. package/dist/server/services/permissions.mjs.map +1 -0
  309. package/dist/server/services/sanitize/index.js +34 -0
  310. package/dist/server/services/sanitize/index.js.map +1 -0
  311. package/dist/server/services/sanitize/index.mjs +32 -0
  312. package/dist/server/services/sanitize/index.mjs.map +1 -0
  313. package/dist/server/src/bootstrap.d.ts +1 -4
  314. package/dist/server/src/bootstrap.d.ts.map +1 -1
  315. package/dist/server/src/index.d.ts +24 -20
  316. package/dist/server/src/index.d.ts.map +1 -1
  317. package/dist/server/src/register.d.ts.map +1 -1
  318. package/dist/server/src/routes/content-api.d.ts +5 -8
  319. package/dist/server/src/routes/content-api.d.ts.map +1 -1
  320. package/dist/server/src/routes/index.d.ts +3 -7
  321. package/dist/server/src/routes/index.d.ts.map +1 -1
  322. package/dist/server/src/routes/validation/index.d.ts +2 -0
  323. package/dist/server/src/routes/validation/index.d.ts.map +1 -0
  324. package/dist/server/src/routes/validation/locale.d.ts +41 -0
  325. package/dist/server/src/routes/validation/locale.d.ts.map +1 -0
  326. package/dist/server/src/services/index.d.ts +20 -10
  327. package/dist/server/src/services/index.d.ts.map +1 -1
  328. package/dist/server/src/services/localizations.d.ts +1 -1
  329. package/dist/server/src/services/localizations.d.ts.map +1 -1
  330. package/dist/server/src/services/permissions/actions.d.ts +14 -2
  331. package/dist/server/src/services/permissions/actions.d.ts.map +1 -1
  332. package/dist/server/src/services/permissions.d.ts +14 -2
  333. package/dist/server/src/services/permissions.d.ts.map +1 -1
  334. package/dist/server/src/services/sanitize/index.d.ts +11 -0
  335. package/dist/server/src/services/sanitize/index.d.ts.map +1 -0
  336. package/dist/server/src/utils/index.d.ts +2 -2
  337. package/dist/server/src/utils/index.d.ts.map +1 -1
  338. package/dist/server/utils/index.js +16 -0
  339. package/dist/server/utils/index.js.map +1 -0
  340. package/dist/server/utils/index.mjs +13 -0
  341. package/dist/server/utils/index.mjs.map +1 -0
  342. package/dist/server/validation/content-types.js +18 -0
  343. package/dist/server/validation/content-types.js.map +1 -0
  344. package/dist/server/validation/content-types.mjs +16 -0
  345. package/dist/server/validation/content-types.mjs.map +1 -0
  346. package/dist/server/validation/locales.js +23 -0
  347. package/dist/server/validation/locales.js.map +1 -0
  348. package/dist/server/validation/locales.mjs +20 -0
  349. package/dist/server/validation/locales.mjs.map +1 -0
  350. package/dist/shared/contracts/content-manager.d.ts +20 -1
  351. package/dist/shared/contracts/shared.d.ts +1 -1
  352. package/package.json +26 -24
  353. package/dist/_chunks/SettingsPage-CeqfDjsb.mjs +0 -565
  354. package/dist/_chunks/SettingsPage-CeqfDjsb.mjs.map +0 -1
  355. package/dist/_chunks/SettingsPage-Djqsdrzs.js +0 -585
  356. package/dist/_chunks/SettingsPage-Djqsdrzs.js.map +0 -1
  357. package/dist/_chunks/de-9eCAqqrB.mjs +0 -66
  358. package/dist/_chunks/de-9eCAqqrB.mjs.map +0 -1
  359. package/dist/_chunks/de-DtWiGdHl.js +0 -66
  360. package/dist/_chunks/de-DtWiGdHl.js.map +0 -1
  361. package/dist/_chunks/dk-2qBjxt-P.mjs +0 -66
  362. package/dist/_chunks/dk-2qBjxt-P.mjs.map +0 -1
  363. package/dist/_chunks/dk-D8C-casx.js +0 -66
  364. package/dist/_chunks/dk-D8C-casx.js.map +0 -1
  365. package/dist/_chunks/en-BuBc6LKZ.js +0 -69
  366. package/dist/_chunks/en-BuBc6LKZ.js.map +0 -1
  367. package/dist/_chunks/en-CnrTsjWS.mjs +0 -69
  368. package/dist/_chunks/en-CnrTsjWS.mjs.map +0 -1
  369. package/dist/_chunks/es-DS-XFGSw.js +0 -66
  370. package/dist/_chunks/es-DS-XFGSw.js.map +0 -1
  371. package/dist/_chunks/es-DlmMVaBG.mjs +0 -66
  372. package/dist/_chunks/es-DlmMVaBG.mjs.map +0 -1
  373. package/dist/_chunks/fr-3S6ke71d.mjs +0 -66
  374. package/dist/_chunks/fr-3S6ke71d.mjs.map +0 -1
  375. package/dist/_chunks/fr-BTjekDpq.js +0 -66
  376. package/dist/_chunks/fr-BTjekDpq.js.map +0 -1
  377. package/dist/_chunks/index-BDU1w_fd.mjs +0 -1058
  378. package/dist/_chunks/index-BDU1w_fd.mjs.map +0 -1
  379. package/dist/_chunks/index-DMXJeGjN.js +0 -1082
  380. package/dist/_chunks/index-DMXJeGjN.js.map +0 -1
  381. package/dist/_chunks/ko-DmcGUBQ3.js +0 -65
  382. package/dist/_chunks/ko-DmcGUBQ3.js.map +0 -1
  383. package/dist/_chunks/ko-qTjQ8IMw.mjs +0 -65
  384. package/dist/_chunks/ko-qTjQ8IMw.mjs.map +0 -1
  385. package/dist/_chunks/pl-B67TSHqT.mjs +0 -66
  386. package/dist/_chunks/pl-B67TSHqT.mjs.map +0 -1
  387. package/dist/_chunks/pl-Cn5RYonZ.js +0 -66
  388. package/dist/_chunks/pl-Cn5RYonZ.js.map +0 -1
  389. package/dist/_chunks/ru-BMBgVL3s.js +0 -68
  390. package/dist/_chunks/ru-BMBgVL3s.js.map +0 -1
  391. package/dist/_chunks/ru-hagMa57T.mjs +0 -68
  392. package/dist/_chunks/ru-hagMa57T.mjs.map +0 -1
  393. package/dist/_chunks/tr-CarUU76c.js +0 -66
  394. package/dist/_chunks/tr-CarUU76c.js.map +0 -1
  395. package/dist/_chunks/tr-Dw_jmkG-.mjs +0 -66
  396. package/dist/_chunks/tr-Dw_jmkG-.mjs.map +0 -1
  397. package/dist/_chunks/zh-57YM4amO.mjs +0 -66
  398. package/dist/_chunks/zh-57YM4amO.mjs.map +0 -1
  399. package/dist/_chunks/zh-CukOviB0.js +0 -66
  400. package/dist/_chunks/zh-CukOviB0.js.map +0 -1
  401. package/dist/_chunks/zh-Hans-DSHIXAa3.js +0 -57
  402. package/dist/_chunks/zh-Hans-DSHIXAa3.js.map +0 -1
  403. package/dist/_chunks/zh-Hans-Dyc-aR-h.mjs +0 -57
  404. package/dist/_chunks/zh-Hans-Dyc-aR-h.mjs.map +0 -1
  405. package/dist/admin/src/components/Initializer.d.ts +0 -5
  406. package/dist/server/src/migrations/content-type/disable/index.d.ts +0 -3
  407. package/dist/server/src/migrations/content-type/disable/index.d.ts.map +0 -1
  408. package/dist/server/src/migrations/content-type/enable/index.d.ts +0 -3
  409. package/dist/server/src/migrations/content-type/enable/index.d.ts.map +0 -1
  410. package/dist/server/src/services/entity-service-decorator.d.ts +0 -29
  411. package/dist/server/src/services/entity-service-decorator.d.ts.map +0 -1
  412. package/strapi-server.js +0 -3
@@ -1,585 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const React = require("react");
5
- const strapiAdmin = require("@strapi/admin/strapi-admin");
6
- const designSystem = require("@strapi/design-system");
7
- const symbols = require("@strapi/icons/symbols");
8
- const reactIntl = require("react-intl");
9
- const icons = require("@strapi/icons");
10
- const yup = require("yup");
11
- const index = require("./index-DMXJeGjN.js");
12
- function _interopNamespace(e) {
13
- if (e && e.__esModule)
14
- return e;
15
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
16
- if (e) {
17
- for (const k in e) {
18
- if (k !== "default") {
19
- const d = Object.getOwnPropertyDescriptor(e, k);
20
- Object.defineProperty(n, k, d.get ? d : {
21
- enumerable: true,
22
- get: () => e[k]
23
- });
24
- }
25
- }
26
- }
27
- n.default = e;
28
- return Object.freeze(n);
29
- }
30
- const React__namespace = /* @__PURE__ */ _interopNamespace(React);
31
- const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
32
- const CreateLocale = ({ disabled, variant = "default" }) => {
33
- const { formatMessage } = reactIntl.useIntl();
34
- const [visible, setVisible] = React__namespace.useState(false);
35
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
36
- /* @__PURE__ */ jsxRuntime.jsx(
37
- designSystem.Button,
38
- {
39
- variant,
40
- disabled,
41
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Plus, {}),
42
- onClick: () => setVisible(true),
43
- size: "S",
44
- children: formatMessage({
45
- id: index.getTranslation("Settings.list.actions.add"),
46
- defaultMessage: "Add new locale"
47
- })
48
- }
49
- ),
50
- visible ? /* @__PURE__ */ jsxRuntime.jsx(CreateModal, { onClose: () => setVisible(false) }) : null
51
- ] });
52
- };
53
- const LOCALE_SCHEMA = yup__namespace.object().shape({
54
- code: yup__namespace.string().required({
55
- id: "Settings.locales.modal.create.code.error",
56
- defaultMessage: "Please select a locale"
57
- }),
58
- name: yup__namespace.string().max(50, {
59
- id: "Settings.locales.modal.create.name.error.min",
60
- defaultMessage: "The locale display name can only be less than 50 characters."
61
- }).required({
62
- id: "Settings.locales.modal.create.name.error.required",
63
- defaultMessage: "Please give the locale a display name"
64
- }),
65
- isDefault: yup__namespace.boolean()
66
- });
67
- const initialFormValues = {
68
- code: "",
69
- name: "",
70
- isDefault: false
71
- };
72
- const CreateModal = ({ onClose }) => {
73
- const { toggleNotification } = strapiAdmin.useNotification();
74
- const {
75
- _unstableFormatAPIError: formatAPIError,
76
- _unstableFormatValidationErrors: formatValidationErrors
77
- } = strapiAdmin.useAPIErrorHandler();
78
- const [createLocale] = index.useCreateLocaleMutation();
79
- const { formatMessage } = reactIntl.useIntl();
80
- const refetchPermissions = strapiAdmin.useAuth("CreateModal", (state) => state.refetchPermissions);
81
- const handleSubmit = async (values, helpers) => {
82
- try {
83
- const res = await createLocale(values);
84
- if ("error" in res) {
85
- if (index.isBaseQueryError(res.error) && res.error.name === "ValidationError") {
86
- helpers.setErrors(formatValidationErrors(res.error));
87
- } else {
88
- toggleNotification({ type: "danger", message: formatAPIError(res.error) });
89
- }
90
- return;
91
- }
92
- toggleNotification({
93
- type: "success",
94
- message: formatMessage({
95
- id: index.getTranslation("Settings.locales.modal.create.success"),
96
- defaultMessage: "Created locale"
97
- })
98
- });
99
- refetchPermissions();
100
- onClose();
101
- } catch (err) {
102
- toggleNotification({
103
- type: "danger",
104
- message: formatMessage({
105
- id: "notification.error",
106
- defaultMessage: "An error occurred, please try again"
107
- })
108
- });
109
- }
110
- };
111
- const titleId = React__namespace.useId();
112
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalLayout, { onClose, labelledBy: titleId, children: /* @__PURE__ */ jsxRuntime.jsxs(
113
- strapiAdmin.Form,
114
- {
115
- method: "POST",
116
- initialValues: initialFormValues,
117
- validationSchema: LOCALE_SCHEMA,
118
- onSubmit: handleSubmit,
119
- children: [
120
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "bold", textColor: "neutral800", as: "h2", id: titleId, children: formatMessage({
121
- id: index.getTranslation("Settings.list.actions.add"),
122
- defaultMessage: "Add new locale"
123
- }) }) }),
124
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalBody, { children: /* @__PURE__ */ jsxRuntime.jsxs(
125
- designSystem.TabGroup,
126
- {
127
- label: formatMessage({
128
- id: index.getTranslation("Settings.locales.modal.title"),
129
- defaultMessage: "Configurations"
130
- }),
131
- variant: "simple",
132
- children: [
133
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", children: [
134
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { as: "h2", variant: "beta", children: formatMessage({
135
- id: index.getTranslation("Settings.locales.modal.title"),
136
- defaultMessage: "Configuration"
137
- }) }),
138
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tabs, { children: [
139
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tab, { children: formatMessage({
140
- id: index.getTranslation("Settings.locales.modal.base"),
141
- defaultMessage: "Basic settings"
142
- }) }),
143
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tab, { children: formatMessage({
144
- id: index.getTranslation("Settings.locales.modal.advanced"),
145
- defaultMessage: "Advanced settings"
146
- }) })
147
- ] })
148
- ] }),
149
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, {}),
150
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingTop: 7, paddingBottom: 7, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.TabPanels, { children: [
151
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.TabPanel, { children: /* @__PURE__ */ jsxRuntime.jsx(BaseForm, {}) }),
152
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.TabPanel, { children: /* @__PURE__ */ jsxRuntime.jsx(AdvancedForm, {}) })
153
- ] }) })
154
- ]
155
- }
156
- ) }),
157
- /* @__PURE__ */ jsxRuntime.jsx(
158
- designSystem.ModalFooter,
159
- {
160
- startActions: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: onClose, children: formatMessage({ id: "app.components.Button.cancel", defaultMessage: "Cancel" }) }),
161
- endActions: /* @__PURE__ */ jsxRuntime.jsx(SubmitButton, {})
162
- }
163
- )
164
- ]
165
- }
166
- ) });
167
- };
168
- const SubmitButton = () => {
169
- const { formatMessage } = reactIntl.useIntl();
170
- const isSubmitting = strapiAdmin.useForm("SubmitButton", (state) => state.isSubmitting);
171
- const modified = strapiAdmin.useForm("SubmitButton", (state) => state.modified);
172
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { type: "submit", startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {}), disabled: isSubmitting || !modified, children: formatMessage({ id: "global.save", defaultMessage: "Save" }) });
173
- };
174
- const BaseForm = ({ mode = "create" }) => {
175
- const { formatMessage } = reactIntl.useIntl();
176
- const { toggleNotification } = strapiAdmin.useNotification();
177
- const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
178
- const { data: defaultLocales = [], error } = index.useGetDefaultLocalesQuery();
179
- const { data: locales = [] } = index.useGetLocalesQuery();
180
- React__namespace.useEffect(() => {
181
- if (error) {
182
- toggleNotification({
183
- type: "danger",
184
- message: formatAPIError(error)
185
- });
186
- }
187
- }, [error, formatAPIError, toggleNotification]);
188
- if (!Array.isArray(defaultLocales) || !Array.isArray(locales)) {
189
- return null;
190
- }
191
- const options = defaultLocales.map((locale) => ({
192
- label: locale.name,
193
- value: locale.code
194
- }));
195
- const translatedForm = [
196
- {
197
- disabled: mode !== "create",
198
- label: {
199
- id: index.getTranslation("Settings.locales.modal.create.code.label"),
200
- defaultMessage: "Locales"
201
- },
202
- name: "code",
203
- options,
204
- placeholder: {
205
- id: "components.placeholder.select",
206
- defaultMessage: "Select"
207
- },
208
- required: true,
209
- size: 6,
210
- type: "enumeration"
211
- },
212
- {
213
- hint: {
214
- id: index.getTranslation("Settings.locales.modal.create.name.label.description"),
215
- defaultMessage: "Locale will be displayed under that name in the administration panel"
216
- },
217
- label: {
218
- id: index.getTranslation("Settings.locales.modal.create.name.label"),
219
- defaultMessage: "Locale display name"
220
- },
221
- name: "name",
222
- required: true,
223
- size: 6,
224
- type: "string"
225
- }
226
- ].map((field) => ({
227
- ...field,
228
- hint: field.hint ? formatMessage(field.hint) : void 0,
229
- label: formatMessage(field.label),
230
- placeholder: field.placeholder ? formatMessage(field.placeholder) : void 0
231
- }));
232
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: translatedForm.map(({ size, ...field }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: size, children: /* @__PURE__ */ jsxRuntime.jsx(FormRenderer, { ...field }) }, field.name)) });
233
- };
234
- const AdvancedForm = ({ isDefaultLocale }) => {
235
- const { formatMessage } = reactIntl.useIntl();
236
- const form = [
237
- {
238
- disabled: isDefaultLocale,
239
- hint: {
240
- id: index.getTranslation("Settings.locales.modal.advanced.setAsDefault.hint"),
241
- defaultMessage: "One default locale is required, change it by selecting another one"
242
- },
243
- label: {
244
- id: index.getTranslation("Settings.locales.modal.advanced.setAsDefault"),
245
- defaultMessage: "Set as default locale"
246
- },
247
- name: "isDefault",
248
- size: 6,
249
- type: "boolean"
250
- }
251
- ].map((field) => ({
252
- ...field,
253
- hint: field.hint ? formatMessage(field.hint) : void 0,
254
- label: formatMessage(field.label)
255
- }));
256
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: form.map(({ size, ...field }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: size, children: /* @__PURE__ */ jsxRuntime.jsx(FormRenderer, { ...field }) }, field.name)) });
257
- };
258
- const FormRenderer = (field) => {
259
- switch (field.type) {
260
- case "enumeration":
261
- return /* @__PURE__ */ jsxRuntime.jsx(EnumerationInput, { ...field });
262
- default:
263
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.InputRenderer, { ...field });
264
- }
265
- };
266
- const EnumerationInput = ({
267
- disabled,
268
- hint,
269
- label,
270
- name,
271
- options,
272
- placeholder,
273
- required
274
- }) => {
275
- const { value, error, onChange } = strapiAdmin.useField(name);
276
- const { data: defaultLocales = [] } = index.useGetDefaultLocalesQuery();
277
- const handleChange = (value2) => {
278
- if (Array.isArray(defaultLocales)) {
279
- const locale = defaultLocales.find((locale2) => locale2.code === value2);
280
- onChange(name, value2);
281
- onChange("name", locale.name);
282
- } else {
283
- onChange(name, value2);
284
- }
285
- };
286
- return /* @__PURE__ */ jsxRuntime.jsx(
287
- designSystem.SingleSelect,
288
- {
289
- disabled,
290
- error,
291
- hint,
292
- label,
293
- name,
294
- onChange: handleChange,
295
- placeholder,
296
- required,
297
- value,
298
- children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: option.value, children: option.label }, option.value))
299
- }
300
- );
301
- };
302
- const DeleteLocale = ({ id, name }) => {
303
- const { formatMessage } = reactIntl.useIntl();
304
- const { toggleNotification } = strapiAdmin.useNotification();
305
- const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
306
- const [visible, setVisible] = React__namespace.useState(false);
307
- const [deleteLocale] = index.useDeleteLocaleMutation();
308
- const handleConfirm = async () => {
309
- try {
310
- const res = await deleteLocale(id);
311
- if ("error" in res) {
312
- toggleNotification({ type: "danger", message: formatAPIError(res.error) });
313
- return;
314
- }
315
- toggleNotification({
316
- type: "success",
317
- message: formatMessage({
318
- id: index.getTranslation("Settings.locales.modal.delete.success"),
319
- defaultMessage: "Deleted locale"
320
- })
321
- });
322
- } catch (err) {
323
- toggleNotification({
324
- type: "danger",
325
- message: formatMessage({
326
- id: "notification.error",
327
- defaultMessage: "An error occurred, please try again"
328
- })
329
- });
330
- }
331
- };
332
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
333
- /* @__PURE__ */ jsxRuntime.jsx(
334
- designSystem.IconButton,
335
- {
336
- onClick: () => setVisible(true),
337
- label: formatMessage(
338
- {
339
- id: index.getTranslation("Settings.list.actions.delete"),
340
- defaultMessage: "Delete {name} locale"
341
- },
342
- {
343
- name
344
- }
345
- ),
346
- icon: /* @__PURE__ */ jsxRuntime.jsx(icons.Trash, {}),
347
- borderWidth: 0
348
- }
349
- ),
350
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.ConfirmDialog, { onConfirm: handleConfirm, onClose: () => setVisible(false), isOpen: visible })
351
- ] });
352
- };
353
- const EditLocale = (props) => {
354
- const { formatMessage } = reactIntl.useIntl();
355
- const [visible, setVisible] = React__namespace.useState(false);
356
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
357
- /* @__PURE__ */ jsxRuntime.jsx(
358
- designSystem.IconButton,
359
- {
360
- onClick: () => setVisible(true),
361
- label: formatMessage(
362
- {
363
- id: index.getTranslation("Settings.list.actions.edit"),
364
- defaultMessage: "Edit {name} locale"
365
- },
366
- {
367
- name: props.name
368
- }
369
- ),
370
- icon: /* @__PURE__ */ jsxRuntime.jsx(icons.Pencil, {}),
371
- borderWidth: 0
372
- }
373
- ),
374
- visible ? /* @__PURE__ */ jsxRuntime.jsx(EditModal, { ...props, onClose: () => setVisible(false) }) : null
375
- ] });
376
- };
377
- const EditModal = ({ id, code, isDefault, name, onClose }) => {
378
- const { toggleNotification } = strapiAdmin.useNotification();
379
- const {
380
- _unstableFormatAPIError: formatAPIError,
381
- _unstableFormatValidationErrors: formatValidationErrors
382
- } = strapiAdmin.useAPIErrorHandler();
383
- const refetchPermissions = strapiAdmin.useAuth("EditModal", (state) => state.refetchPermissions);
384
- const { formatMessage } = reactIntl.useIntl();
385
- const titleId = React__namespace.useId();
386
- const [updateLocale] = index.useUpdateLocaleMutation();
387
- const handleSubmit = async ({ code: _code, ...data }, helpers) => {
388
- try {
389
- const res = await updateLocale({
390
- id,
391
- ...data
392
- });
393
- if ("error" in res) {
394
- if (index.isBaseQueryError(res.error) && res.error.name === "ValidationError") {
395
- helpers.setErrors(formatValidationErrors(res.error));
396
- } else {
397
- toggleNotification({ type: "danger", message: formatAPIError(res.error) });
398
- }
399
- return;
400
- }
401
- toggleNotification({
402
- type: "success",
403
- message: formatMessage({
404
- id: index.getTranslation("Settings.locales.modal.edit.success"),
405
- defaultMessage: "Updated locale"
406
- })
407
- });
408
- refetchPermissions();
409
- onClose();
410
- } catch (err) {
411
- toggleNotification({
412
- type: "danger",
413
- message: formatMessage({
414
- id: "notification.error",
415
- defaultMessage: "An error occurred, please try again"
416
- })
417
- });
418
- }
419
- };
420
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalLayout, { onClose, labelledBy: titleId, children: /* @__PURE__ */ jsxRuntime.jsxs(
421
- strapiAdmin.Form,
422
- {
423
- method: "PUT",
424
- onSubmit: handleSubmit,
425
- initialValues: {
426
- code,
427
- name,
428
- isDefault
429
- },
430
- validationSchema: LOCALE_SCHEMA,
431
- children: [
432
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "bold", textColor: "neutral800", as: "h2", id: titleId, children: formatMessage({
433
- id: index.getTranslation("Settings.list.actions.edit"),
434
- defaultMessage: "Edit a locale"
435
- }) }) }),
436
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalBody, { children: /* @__PURE__ */ jsxRuntime.jsxs(
437
- designSystem.TabGroup,
438
- {
439
- label: formatMessage({
440
- id: index.getTranslation("Settings.locales.modal.title"),
441
- defaultMessage: "Configurations"
442
- }),
443
- variant: "simple",
444
- children: [
445
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", children: [
446
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { as: "h2", variant: "beta", children: formatMessage({
447
- id: index.getTranslation("Settings.locales.modal.title"),
448
- defaultMessage: "Configuration"
449
- }) }),
450
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tabs, { children: [
451
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tab, { children: formatMessage({
452
- id: index.getTranslation("Settings.locales.modal.base"),
453
- defaultMessage: "Basic settings"
454
- }) }),
455
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tab, { children: formatMessage({
456
- id: index.getTranslation("Settings.locales.modal.advanced"),
457
- defaultMessage: "Advanced settings"
458
- }) })
459
- ] })
460
- ] }),
461
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, {}),
462
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingTop: 7, paddingBottom: 7, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.TabPanels, { children: [
463
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.TabPanel, { children: /* @__PURE__ */ jsxRuntime.jsx(BaseForm, { mode: "edit" }) }),
464
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.TabPanel, { children: /* @__PURE__ */ jsxRuntime.jsx(AdvancedForm, { isDefaultLocale: isDefault }) })
465
- ] }) })
466
- ]
467
- }
468
- ) }),
469
- /* @__PURE__ */ jsxRuntime.jsx(
470
- designSystem.ModalFooter,
471
- {
472
- startActions: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: onClose, children: formatMessage({ id: "app.components.Button.cancel", defaultMessage: "Cancel" }) }),
473
- endActions: /* @__PURE__ */ jsxRuntime.jsx(SubmitButton, {})
474
- }
475
- )
476
- ]
477
- }
478
- ) });
479
- };
480
- const LocaleTable = ({ locales = [], canDelete, canUpdate }) => {
481
- const [editLocaleId, setEditLocaleId] = React__namespace.useState();
482
- const { formatMessage } = reactIntl.useIntl();
483
- const handleClick = (localeId) => () => {
484
- if (canUpdate) {
485
- setEditLocaleId(localeId);
486
- }
487
- };
488
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Table, { colCount: 4, rowCount: locales.length + 1, children: [
489
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Thead, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
490
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", children: formatMessage({
491
- id: index.getTranslation("Settings.locales.row.id"),
492
- defaultMessage: "ID"
493
- }) }) }),
494
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", children: formatMessage({
495
- id: index.getTranslation("Settings.locales.row.displayName"),
496
- defaultMessage: "Display name"
497
- }) }) }),
498
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", children: formatMessage({
499
- id: index.getTranslation("Settings.locales.row.default-locale"),
500
- defaultMessage: "Default locale"
501
- }) }) }),
502
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { children: "Actions" }) })
503
- ] }) }),
504
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tbody, { children: locales.map((locale) => /* @__PURE__ */ jsxRuntime.jsxs(React__namespace.Fragment, { children: [
505
- /* @__PURE__ */ jsxRuntime.jsxs(
506
- designSystem.Tr,
507
- {
508
- onClick: handleClick(locale.id),
509
- style: { cursor: canUpdate ? "pointer" : "default" },
510
- children: [
511
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: locale.id }) }),
512
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: locale.name }) }),
513
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: locale.isDefault ? formatMessage({
514
- id: index.getTranslation("Settings.locales.default"),
515
- defaultMessage: "Default"
516
- }) : null }) }),
517
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 1, justifyContent: "flex-end", onClick: (e) => e.stopPropagation(), children: [
518
- canUpdate && /* @__PURE__ */ jsxRuntime.jsx(EditLocale, { ...locale }),
519
- canDelete && !locale.isDefault && /* @__PURE__ */ jsxRuntime.jsx(DeleteLocale, { ...locale })
520
- ] }) })
521
- ]
522
- }
523
- ),
524
- editLocaleId === locale.id ? /* @__PURE__ */ jsxRuntime.jsx(EditModal, { ...locale, onClose: () => setEditLocaleId(void 0) }) : null
525
- ] }, locale.id)) })
526
- ] });
527
- };
528
- const SettingsPage = () => {
529
- const { formatMessage } = reactIntl.useIntl();
530
- const { toggleNotification } = strapiAdmin.useNotification();
531
- const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
532
- const { data: locales, isLoading: isLoadingLocales, error } = index.useGetLocalesQuery();
533
- const {
534
- isLoading: isLoadingRBAC,
535
- allowedActions: { canUpdate, canCreate, canDelete }
536
- } = strapiAdmin.useRBAC(index.PERMISSIONS);
537
- React__namespace.useEffect(() => {
538
- if (error) {
539
- toggleNotification({
540
- type: "danger",
541
- message: formatAPIError(error)
542
- });
543
- }
544
- }, [error, formatAPIError, toggleNotification]);
545
- const isLoading = isLoadingLocales || isLoadingRBAC;
546
- if (isLoading) {
547
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
548
- }
549
- if (error || !Array.isArray(locales)) {
550
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
551
- }
552
- return /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Page.Main, { tabIndex: -1, children: [
553
- /* @__PURE__ */ jsxRuntime.jsx(
554
- strapiAdmin.Layouts.Header,
555
- {
556
- primaryAction: /* @__PURE__ */ jsxRuntime.jsx(CreateLocale, { disabled: !canCreate }),
557
- title: formatMessage({
558
- id: index.getTranslation("plugin.name"),
559
- defaultMessage: "Internationalization"
560
- }),
561
- subtitle: formatMessage({
562
- id: index.getTranslation("Settings.list.description"),
563
- defaultMessage: "Configure the settings"
564
- })
565
- }
566
- ),
567
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: locales.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(LocaleTable, { locales, canDelete, canUpdate }) : /* @__PURE__ */ jsxRuntime.jsx(
568
- designSystem.EmptyStateLayout,
569
- {
570
- icon: /* @__PURE__ */ jsxRuntime.jsx(symbols.EmptyDocuments, { width: void 0, height: void 0 }),
571
- content: formatMessage({
572
- id: index.getTranslation("Settings.list.empty.title"),
573
- defaultMessage: "There are no locales"
574
- }),
575
- action: /* @__PURE__ */ jsxRuntime.jsx(CreateLocale, { disabled: !canCreate, variant: "secondary" })
576
- }
577
- ) })
578
- ] });
579
- };
580
- const ProtectedSettingsPage = () => {
581
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Protect, { permissions: index.PERMISSIONS.read, children: /* @__PURE__ */ jsxRuntime.jsx(SettingsPage, {}) });
582
- };
583
- exports.ProtectedSettingsPage = ProtectedSettingsPage;
584
- exports.SettingsPage = SettingsPage;
585
- //# sourceMappingURL=SettingsPage-Djqsdrzs.js.map