@strapi/content-type-builder 5.9.0 → 5.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/dist/admin/chunks/ListView-CDnrvVrV.mjs +1184 -0
  2. package/dist/admin/chunks/ListView-CDnrvVrV.mjs.map +1 -0
  3. package/dist/admin/chunks/ListView-CQwvSbZH.js +1186 -0
  4. package/dist/admin/chunks/ListView-CQwvSbZH.js.map +1 -0
  5. package/dist/admin/chunks/ar-Df0f0-PT.js +52 -0
  6. package/dist/admin/chunks/ar-Df0f0-PT.js.map +1 -0
  7. package/dist/admin/chunks/ar-sRW9VFC-.mjs +49 -0
  8. package/dist/admin/chunks/ar-sRW9VFC-.mjs.map +1 -0
  9. package/dist/admin/chunks/cs-BpQ26jiq.mjs +136 -0
  10. package/dist/{_chunks/cs-ChL4LaFY.mjs.map → admin/chunks/cs-BpQ26jiq.mjs.map} +1 -1
  11. package/dist/admin/chunks/cs-DeTwqc7p.js +140 -0
  12. package/dist/{_chunks/cs-Ci3js5EC.js.map → admin/chunks/cs-DeTwqc7p.js.map} +1 -1
  13. package/dist/admin/chunks/de-BJkS06jF.js +194 -0
  14. package/dist/{_chunks/de-DnlblIOh.js.map → admin/chunks/de-BJkS06jF.js.map} +1 -1
  15. package/dist/admin/chunks/de-DSxx5_x-.mjs +190 -0
  16. package/dist/{_chunks/de-DsHQNzp2.mjs.map → admin/chunks/de-DSxx5_x-.mjs.map} +1 -1
  17. package/dist/admin/chunks/dk-BnjVZ7A_.mjs +180 -0
  18. package/dist/{_chunks/es-BE_zx2_w.mjs.map → admin/chunks/dk-BnjVZ7A_.mjs.map} +1 -1
  19. package/dist/admin/chunks/dk-CGm-qVH7.js +184 -0
  20. package/dist/{_chunks/dk-D3XnOjYz.js.map → admin/chunks/dk-CGm-qVH7.js.map} +1 -1
  21. package/dist/admin/chunks/en-BJUu34b0.js +217 -0
  22. package/dist/{_chunks/en-CXG5y_vo.js.map → admin/chunks/en-BJUu34b0.js.map} +1 -1
  23. package/dist/admin/chunks/en-Bhut8Yay.mjs +213 -0
  24. package/dist/{_chunks/en-jBwb53yg.mjs.map → admin/chunks/en-Bhut8Yay.mjs.map} +1 -1
  25. package/dist/admin/chunks/es-DG8g9igJ.mjs +180 -0
  26. package/dist/admin/chunks/es-DG8g9igJ.mjs.map +1 -0
  27. package/dist/admin/chunks/es-J8kvHlNy.js +184 -0
  28. package/dist/{_chunks/es-DL8lez9W.js.map → admin/chunks/es-J8kvHlNy.js.map} +1 -1
  29. package/dist/admin/chunks/fr-C6y35iY7.js +76 -0
  30. package/dist/admin/chunks/fr-C6y35iY7.js.map +1 -0
  31. package/dist/admin/chunks/fr-UpV34MHY.mjs +73 -0
  32. package/dist/admin/chunks/fr-UpV34MHY.mjs.map +1 -0
  33. package/dist/admin/chunks/id-BWM18ljw.mjs +163 -0
  34. package/dist/{_chunks/ru-DGSjru5m.mjs.map → admin/chunks/id-BWM18ljw.mjs.map} +1 -1
  35. package/dist/admin/chunks/id-BvxV6wLP.js +167 -0
  36. package/dist/{_chunks/ru-C8A_4j0w.js.map → admin/chunks/id-BvxV6wLP.js.map} +1 -1
  37. package/dist/admin/chunks/index-BQ2VO38W.js +7781 -0
  38. package/dist/admin/chunks/index-BQ2VO38W.js.map +1 -0
  39. package/dist/admin/chunks/index-BZeN5KRn.js +1421 -0
  40. package/dist/admin/chunks/index-BZeN5KRn.js.map +1 -0
  41. package/dist/admin/chunks/index-BhX2euW0.mjs +1384 -0
  42. package/dist/admin/chunks/index-BhX2euW0.mjs.map +1 -0
  43. package/dist/admin/chunks/index-Cr5tfW7U.mjs +7754 -0
  44. package/dist/admin/chunks/index-Cr5tfW7U.mjs.map +1 -0
  45. package/dist/admin/chunks/it-1_vd9gV4.mjs +164 -0
  46. package/dist/{_chunks/tr-DsUerr-c.mjs.map → admin/chunks/it-1_vd9gV4.mjs.map} +1 -1
  47. package/dist/admin/chunks/it-C_IgFU-G.js +168 -0
  48. package/dist/{_chunks/sk-raWRcmPT.js.map → admin/chunks/it-C_IgFU-G.js.map} +1 -1
  49. package/dist/admin/chunks/ja-CWo4Qqq6.js +51 -0
  50. package/dist/admin/chunks/ja-CWo4Qqq6.js.map +1 -0
  51. package/dist/admin/chunks/ja-Cx23a2Ui.mjs +48 -0
  52. package/dist/admin/chunks/ja-Cx23a2Ui.mjs.map +1 -0
  53. package/dist/admin/chunks/ko-BsByJNEl.js +184 -0
  54. package/dist/admin/chunks/ko-BsByJNEl.js.map +1 -0
  55. package/dist/admin/chunks/ko-DC7paEx5.mjs +180 -0
  56. package/dist/admin/chunks/ko-DC7paEx5.mjs.map +1 -0
  57. package/dist/admin/chunks/ms-C3s4kxq6.mjs +160 -0
  58. package/dist/{_chunks/id-W1sKBFEw.mjs.map → admin/chunks/ms-C3s4kxq6.mjs.map} +1 -1
  59. package/dist/admin/chunks/ms-DPTzS7SH.js +164 -0
  60. package/dist/{_chunks/th-C83Bb_kR.js.map → admin/chunks/ms-DPTzS7SH.js.map} +1 -1
  61. package/dist/admin/chunks/nl-TzvfktV_.mjs +153 -0
  62. package/dist/{_chunks/nl-BaTAuelQ.mjs.map → admin/chunks/nl-TzvfktV_.mjs.map} +1 -1
  63. package/dist/admin/chunks/nl-db29QMOx.js +157 -0
  64. package/dist/{_chunks/nl-DQjrDEw0.js.map → admin/chunks/nl-db29QMOx.js.map} +1 -1
  65. package/dist/admin/chunks/pl-BdvupIN_.mjs +190 -0
  66. package/dist/admin/chunks/pl-BdvupIN_.mjs.map +1 -0
  67. package/dist/admin/chunks/pl-pYy1djj3.js +194 -0
  68. package/dist/admin/chunks/pl-pYy1djj3.js.map +1 -0
  69. package/dist/admin/chunks/pt-BQmWcdeG.js +52 -0
  70. package/dist/admin/chunks/pt-BQmWcdeG.js.map +1 -0
  71. package/dist/admin/chunks/pt-BR-CTPuXGWF.js +194 -0
  72. package/dist/{_chunks/pt-BR-DPd5nRnl.js.map → admin/chunks/pt-BR-CTPuXGWF.js.map} +1 -1
  73. package/dist/admin/chunks/pt-BR-DPrVmKeZ.mjs +190 -0
  74. package/dist/{_chunks/pt-BR-CCQGwXs0.mjs.map → admin/chunks/pt-BR-DPrVmKeZ.mjs.map} +1 -1
  75. package/dist/admin/chunks/pt-BTLIwmCv.mjs +49 -0
  76. package/dist/admin/chunks/pt-BTLIwmCv.mjs.map +1 -0
  77. package/dist/admin/chunks/ru-D46no502.mjs +165 -0
  78. package/dist/{_chunks/dk-BC7NAQR2.mjs.map → admin/chunks/ru-D46no502.mjs.map} +1 -1
  79. package/dist/admin/chunks/ru-DQiDXgUV.js +169 -0
  80. package/dist/admin/chunks/ru-DQiDXgUV.js.map +1 -0
  81. package/dist/admin/chunks/sk-Byr_l4Jc.mjs +164 -0
  82. package/dist/{_chunks/ko-DoNsXHXA.mjs.map → admin/chunks/sk-Byr_l4Jc.mjs.map} +1 -1
  83. package/dist/admin/chunks/sk-DrnebmXb.js +168 -0
  84. package/dist/{_chunks/it-DS4sM3km.js.map → admin/chunks/sk-DrnebmXb.js.map} +1 -1
  85. package/dist/admin/chunks/sv-Bbam7IDm.mjs +199 -0
  86. package/dist/admin/chunks/sv-Bbam7IDm.mjs.map +1 -0
  87. package/dist/admin/chunks/sv-CrWlNosi.js +203 -0
  88. package/dist/admin/chunks/sv-CrWlNosi.js.map +1 -0
  89. package/dist/admin/chunks/th-BbrCkfgX.js +165 -0
  90. package/dist/{_chunks/id-DYuTgqcc.js.map → admin/chunks/th-BbrCkfgX.js.map} +1 -1
  91. package/dist/admin/chunks/th-hfS0Wmk_.mjs +161 -0
  92. package/dist/{_chunks/it-D04lb2Wc.mjs.map → admin/chunks/th-hfS0Wmk_.mjs.map} +1 -1
  93. package/dist/admin/chunks/tr-CHdMj8m6.js +180 -0
  94. package/dist/admin/chunks/tr-CHdMj8m6.js.map +1 -0
  95. package/dist/admin/chunks/tr-DS7DBOhC.mjs +176 -0
  96. package/dist/admin/chunks/tr-DS7DBOhC.mjs.map +1 -0
  97. package/dist/admin/chunks/uk-BQEQ3weH.js +165 -0
  98. package/dist/{_chunks/uk-VwB0oiuV.js.map → admin/chunks/uk-BQEQ3weH.js.map} +1 -1
  99. package/dist/admin/chunks/uk-Cj8-BKeu.mjs +161 -0
  100. package/dist/{_chunks/sk-DVK4HfSC.mjs.map → admin/chunks/uk-Cj8-BKeu.mjs.map} +1 -1
  101. package/dist/admin/chunks/zh-BUVXH75-.mjs +199 -0
  102. package/dist/admin/chunks/zh-BUVXH75-.mjs.map +1 -0
  103. package/dist/admin/chunks/zh-CWj4avQA.js +203 -0
  104. package/dist/admin/chunks/zh-CWj4avQA.js.map +1 -0
  105. package/dist/admin/chunks/zh-Hans-BElOnuRb.mjs +144 -0
  106. package/dist/{_chunks/zh-Hans-Cc0M5PXr.mjs.map → admin/chunks/zh-Hans-BElOnuRb.mjs.map} +1 -1
  107. package/dist/admin/chunks/zh-Hans-lXbNiMp9.js +148 -0
  108. package/dist/{_chunks/zh-Hans-CLTLm_nt.js.map → admin/chunks/zh-Hans-lXbNiMp9.js.map} +1 -1
  109. package/dist/admin/index.js +24 -4
  110. package/dist/admin/index.js.map +1 -1
  111. package/dist/admin/index.mjs +17 -7
  112. package/dist/admin/index.mjs.map +1 -1
  113. package/dist/admin/src/components/ContentTypeBuilderNav/useContentTypeBuilderMenu.d.ts +5 -2
  114. package/dist/admin/src/components/DataManagerProvider/reducer.d.ts +97 -6
  115. package/dist/admin/src/components/FormModal/reducer.d.ts +110 -4
  116. package/dist/admin/src/components/ListRow.d.ts +2 -1
  117. package/dist/admin/src/contexts/DataManagerContext.d.ts +4 -4
  118. package/dist/admin/src/index.d.ts +2 -1
  119. package/dist/admin/src/pages/ListView/LinkToCMSettingsView.d.ts +1 -2
  120. package/dist/admin/src/pluginId.d.ts +1 -1
  121. package/dist/admin/src/reducers.d.ts +8 -1
  122. package/dist/admin/src/types.d.ts +2 -5
  123. package/dist/server/index.js +2504 -2151
  124. package/dist/server/index.js.map +1 -1
  125. package/dist/server/index.mjs +2500 -2147
  126. package/dist/server/index.mjs.map +1 -1
  127. package/package.json +13 -10
  128. package/dist/_chunks/ListView-B7k6NgwS.mjs +0 -959
  129. package/dist/_chunks/ListView-B7k6NgwS.mjs.map +0 -1
  130. package/dist/_chunks/ListView-CsRxS9zZ.js +0 -964
  131. package/dist/_chunks/ListView-CsRxS9zZ.js.map +0 -1
  132. package/dist/_chunks/ar-BYDB75EB.mjs +0 -51
  133. package/dist/_chunks/ar-BYDB75EB.mjs.map +0 -1
  134. package/dist/_chunks/ar-OCxhAFUy.js +0 -51
  135. package/dist/_chunks/ar-OCxhAFUy.js.map +0 -1
  136. package/dist/_chunks/cs-ChL4LaFY.mjs +0 -139
  137. package/dist/_chunks/cs-Ci3js5EC.js +0 -139
  138. package/dist/_chunks/de-DnlblIOh.js +0 -193
  139. package/dist/_chunks/de-DsHQNzp2.mjs +0 -193
  140. package/dist/_chunks/dk-BC7NAQR2.mjs +0 -183
  141. package/dist/_chunks/dk-D3XnOjYz.js +0 -183
  142. package/dist/_chunks/en-CXG5y_vo.js +0 -216
  143. package/dist/_chunks/en-jBwb53yg.mjs +0 -216
  144. package/dist/_chunks/es-BE_zx2_w.mjs +0 -183
  145. package/dist/_chunks/es-DL8lez9W.js +0 -183
  146. package/dist/_chunks/fr-DnTxugIo.js +0 -75
  147. package/dist/_chunks/fr-DnTxugIo.js.map +0 -1
  148. package/dist/_chunks/fr-lU_OMJma.mjs +0 -75
  149. package/dist/_chunks/fr-lU_OMJma.mjs.map +0 -1
  150. package/dist/_chunks/id-DYuTgqcc.js +0 -166
  151. package/dist/_chunks/id-W1sKBFEw.mjs +0 -166
  152. package/dist/_chunks/index-97hm9i_H.mjs +0 -1331
  153. package/dist/_chunks/index-97hm9i_H.mjs.map +0 -1
  154. package/dist/_chunks/index-B5tHY87r.mjs +0 -6694
  155. package/dist/_chunks/index-B5tHY87r.mjs.map +0 -1
  156. package/dist/_chunks/index-BgMd59JL.js +0 -6730
  157. package/dist/_chunks/index-BgMd59JL.js.map +0 -1
  158. package/dist/_chunks/index-Cr85ijm8.js +0 -1357
  159. package/dist/_chunks/index-Cr85ijm8.js.map +0 -1
  160. package/dist/_chunks/it-D04lb2Wc.mjs +0 -167
  161. package/dist/_chunks/it-DS4sM3km.js +0 -167
  162. package/dist/_chunks/ja-BHLK_2_g.mjs +0 -50
  163. package/dist/_chunks/ja-BHLK_2_g.mjs.map +0 -1
  164. package/dist/_chunks/ja-BjouJgZf.js +0 -50
  165. package/dist/_chunks/ja-BjouJgZf.js.map +0 -1
  166. package/dist/_chunks/ko-D_71Pdfn.js +0 -183
  167. package/dist/_chunks/ko-D_71Pdfn.js.map +0 -1
  168. package/dist/_chunks/ko-DoNsXHXA.mjs +0 -183
  169. package/dist/_chunks/ms-BtGFDB9t.mjs +0 -163
  170. package/dist/_chunks/ms-BtGFDB9t.mjs.map +0 -1
  171. package/dist/_chunks/ms-Re1pSHmx.js +0 -163
  172. package/dist/_chunks/ms-Re1pSHmx.js.map +0 -1
  173. package/dist/_chunks/nl-BaTAuelQ.mjs +0 -156
  174. package/dist/_chunks/nl-DQjrDEw0.js +0 -156
  175. package/dist/_chunks/pl-BGwXgwH7.js +0 -193
  176. package/dist/_chunks/pl-BGwXgwH7.js.map +0 -1
  177. package/dist/_chunks/pl-CP2Zgp01.mjs +0 -193
  178. package/dist/_chunks/pl-CP2Zgp01.mjs.map +0 -1
  179. package/dist/_chunks/pt-BR-CCQGwXs0.mjs +0 -193
  180. package/dist/_chunks/pt-BR-DPd5nRnl.js +0 -193
  181. package/dist/_chunks/pt-CJoUDTHQ.js +0 -51
  182. package/dist/_chunks/pt-CJoUDTHQ.js.map +0 -1
  183. package/dist/_chunks/pt-DMeTMW2x.mjs +0 -51
  184. package/dist/_chunks/pt-DMeTMW2x.mjs.map +0 -1
  185. package/dist/_chunks/ru-C8A_4j0w.js +0 -168
  186. package/dist/_chunks/ru-DGSjru5m.mjs +0 -168
  187. package/dist/_chunks/sk-DVK4HfSC.mjs +0 -167
  188. package/dist/_chunks/sk-raWRcmPT.js +0 -167
  189. package/dist/_chunks/sv-BGb12eW3.mjs +0 -202
  190. package/dist/_chunks/sv-BGb12eW3.mjs.map +0 -1
  191. package/dist/_chunks/sv-BNN71SFE.js +0 -202
  192. package/dist/_chunks/sv-BNN71SFE.js.map +0 -1
  193. package/dist/_chunks/th--u3VqsON.mjs +0 -164
  194. package/dist/_chunks/th--u3VqsON.mjs.map +0 -1
  195. package/dist/_chunks/th-C83Bb_kR.js +0 -164
  196. package/dist/_chunks/tr-BW20CfcO.js +0 -179
  197. package/dist/_chunks/tr-BW20CfcO.js.map +0 -1
  198. package/dist/_chunks/tr-DsUerr-c.mjs +0 -179
  199. package/dist/_chunks/uk-Bx5IlOKX.mjs +0 -164
  200. package/dist/_chunks/uk-Bx5IlOKX.mjs.map +0 -1
  201. package/dist/_chunks/uk-VwB0oiuV.js +0 -164
  202. package/dist/_chunks/zh-BiOCwPJu.js +0 -202
  203. package/dist/_chunks/zh-BiOCwPJu.js.map +0 -1
  204. package/dist/_chunks/zh-CsUDN13W.mjs +0 -202
  205. package/dist/_chunks/zh-CsUDN13W.mjs.map +0 -1
  206. package/dist/_chunks/zh-Hans-CLTLm_nt.js +0 -147
  207. package/dist/_chunks/zh-Hans-Cc0M5PXr.mjs +0 -147
  208. package/dist/admin/src/components/DataManagerProvider/constants.d.ts +0 -17
  209. package/dist/admin/src/components/FormModal/constants.d.ts +0 -12
  210. package/dist/admin/src/pages/RecursivePath/RecursivePath.d.ts +0 -1
@@ -1,1331 +0,0 @@
1
- import { ArrowClockwise, Clock, Layout } from "@strapi/icons";
2
- import produce, { current, produce as produce$1 } from "immer";
3
- import get from "lodash/get";
4
- import set from "lodash/set";
5
- import snakeCase from "lodash/snakeCase";
6
- import pluralize from "pluralize";
7
- import slugify from "@sindresorhus/slugify";
8
- import cloneDeep from "lodash/cloneDeep";
9
- import * as yup from "yup";
10
- import { jsxs, jsx } from "react/jsx-runtime";
11
- import * as React from "react";
12
- import { Flex, Box, Typography, Link } from "@strapi/design-system";
13
- import { createPortal } from "react-dom";
14
- import { useIntl } from "react-intl";
15
- import { keyframes, styled } from "styled-components";
16
- const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
17
- const v = glob[path];
18
- if (v) {
19
- return typeof v === "function" ? v() : Promise.resolve(v);
20
- }
21
- return new Promise((_, reject) => {
22
- (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
23
- reject.bind(
24
- null,
25
- new Error(
26
- "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
27
- )
28
- )
29
- );
30
- });
31
- };
32
- const name$1 = "@strapi/content-type-builder";
33
- const version = "5.8.1";
34
- const description = "Create and manage content types";
35
- const repository = {
36
- type: "git",
37
- url: "git://github.com/strapi/strapi.git"
38
- };
39
- const license = "SEE LICENSE IN LICENSE";
40
- const author = {
41
- name: "Strapi Solutions SAS",
42
- email: "hi@strapi.io",
43
- url: "https://strapi.io"
44
- };
45
- const maintainers = [
46
- {
47
- name: "Strapi Solutions SAS",
48
- email: "hi@strapi.io",
49
- url: "https://strapi.io"
50
- }
51
- ];
52
- const exports = {
53
- "./strapi-admin": {
54
- types: "./dist/admin/src/index.d.ts",
55
- source: "./admin/src/index.ts",
56
- "import": "./dist/admin/index.mjs",
57
- require: "./dist/admin/index.js",
58
- "default": "./dist/admin/index.js"
59
- },
60
- "./strapi-server": {
61
- types: "./dist/server/src/index.d.ts",
62
- source: "./server/src/index.ts",
63
- "import": "./dist/server/index.mjs",
64
- require: "./dist/server/index.js",
65
- "default": "./dist/server/index.js"
66
- },
67
- "./package.json": "./package.json"
68
- };
69
- const types = "./dist/index.d.ts";
70
- const files = [
71
- "dist/",
72
- "strapi-server.js"
73
- ];
74
- const scripts = {
75
- build: "pack-up build",
76
- clean: "run -T rimraf ./dist",
77
- lint: "run -T eslint .",
78
- "test:front": "run -T cross-env IS_EE=true jest --config ./jest.config.front.js",
79
- "test:front:ce": "run -T cross-env IS_EE=false jest --config ./jest.config.front.js",
80
- "test:front:watch": "run -T cross-env IS_EE=true jest --config ./jest.config.front.js --watchAll",
81
- "test:front:watch:ce": "run -T cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll",
82
- "test:ts:back": "run -T tsc -p server/tsconfig.eslint.json",
83
- "test:ts:front": "run -T tsc -p admin/tsconfig.json",
84
- "test:unit": "run -T jest",
85
- "test:unit:watch": "run -T jest --watch",
86
- watch: "pack-up watch"
87
- };
88
- const dependencies = {
89
- "@reduxjs/toolkit": "1.9.7",
90
- "@sindresorhus/slugify": "1.1.0",
91
- "@strapi/design-system": "2.0.0-rc.14",
92
- "@strapi/generators": "5.8.1",
93
- "@strapi/icons": "2.0.0-rc.14",
94
- "@strapi/utils": "5.8.1",
95
- "date-fns": "2.30.0",
96
- "fs-extra": "11.2.0",
97
- immer: "9.0.21",
98
- lodash: "4.17.21",
99
- pluralize: "8.0.0",
100
- qs: "6.11.1",
101
- "react-intl": "6.6.2",
102
- "react-redux": "8.1.3",
103
- yup: "0.32.9"
104
- };
105
- const devDependencies = {
106
- "@strapi/admin": "5.8.1",
107
- "@strapi/pack-up": "5.0.2",
108
- "@strapi/types": "5.8.1",
109
- "@testing-library/dom": "10.1.0",
110
- "@testing-library/react": "15.0.7",
111
- "@testing-library/user-event": "14.5.2",
112
- "@types/fs-extra": "11.0.4",
113
- "@types/pluralize": "0.0.30",
114
- koa: "2.15.2",
115
- "koa-body": "6.0.1",
116
- react: "18.3.1",
117
- "react-dom": "18.3.1",
118
- "react-query": "3.39.3",
119
- "react-router-dom": "6.22.3",
120
- "styled-components": "6.1.8"
121
- };
122
- const peerDependencies = {
123
- "@strapi/admin": "^5.0.0",
124
- react: "^17.0.0 || ^18.0.0",
125
- "react-dom": "^17.0.0 || ^18.0.0",
126
- "react-router-dom": "^6.0.0",
127
- "styled-components": "^6.0.0"
128
- };
129
- const engines = {
130
- node: ">=18.0.0 <=22.x.x",
131
- npm: ">=6.0.0"
132
- };
133
- const strapi = {
134
- name: "content-type-builder",
135
- displayName: "Content Type Builder",
136
- description: "Modelize the data structure of your API. Create new fields and relations in just a minute. The files are automatically created and updated in your project.",
137
- kind: "plugin",
138
- required: true
139
- };
140
- const pluginPkg = {
141
- name: name$1,
142
- version,
143
- description,
144
- repository,
145
- license,
146
- author,
147
- maintainers,
148
- exports,
149
- types,
150
- files,
151
- scripts,
152
- dependencies,
153
- devDependencies,
154
- peerDependencies,
155
- engines,
156
- strapi
157
- };
158
- const PERMISSIONS = {
159
- // This permission regards the main component (App) and is used to tell
160
- // If the plugin link should be displayed in the menu
161
- // And also if the plugin is accessible. This use case is found when a user types the url of the
162
- // plugin directly in the browser
163
- main: [{ action: "plugin::content-type-builder.read", subject: null }]
164
- };
165
- const MAX_COMPONENT_DEPTH = 6;
166
- const pluginId = pluginPkg.name.replace(/^@strapi\//i, "");
167
- const getRelationType = (relation, targetAttribute) => {
168
- const hasNotTargetAttribute = targetAttribute === void 0 || targetAttribute === null;
169
- if (relation === "oneToOne" && hasNotTargetAttribute) {
170
- return "oneWay";
171
- }
172
- if (relation === "oneToMany" && hasNotTargetAttribute) {
173
- return "manyWay";
174
- }
175
- return relation;
176
- };
177
- const makeUnique = (array) => [...new Set(array)];
178
- const ADD_ATTRIBUTE = "ContentTypeBuilder/DataManagerProvider/ADD_ATTRIBUTE";
179
- const ADD_CUSTOM_FIELD_ATTRIBUTE = "ContentTypeBuilder/DataManagerProvider/ADD_CUSTOM_FIELD_ATTRIBUTE";
180
- const ADD_CREATED_COMPONENT_TO_DYNAMIC_ZONE = "ContentTypeBuilder/DataManagerProvider/ADD_CREATED_COMPONENT_TO_DYNAMIC_ZONE";
181
- const CHANGE_DYNAMIC_ZONE_COMPONENTS = "ContentTypeBuilder/DataManagerProvider/CHANGE_DYNAMIC_ZONE_COMPONENTS";
182
- const CREATE_SCHEMA = "ContentTypeBuilder/DataManagerProvider/CREATE_SCHEMA";
183
- const CREATE_COMPONENT_SCHEMA = "ContentTypeBuilder/DataManagerProvider/CREATE_COMPONENT_SCHEMA";
184
- const DELETE_NOT_SAVED_TYPE = "ContentTypeBuilder/DataManagerProvider/DELETE_NOT_SAVED_TYPE";
185
- const EDIT_ATTRIBUTE = "ContentTypeBuilder/DataManagerProvider/EDIT_ATTRIBUTE";
186
- const EDIT_CUSTOM_FIELD_ATTRIBUTE = "ContentTypeBuilder/DataManagerProvider/EDIT_CUSTOM_FIELD_ATTRIBUTE";
187
- const GET_DATA_SUCCEEDED = "ContentTypeBuilder/DataManagerProvider/GET_DATA_SUCCEEDED";
188
- const RELOAD_PLUGIN = "ContentTypeBuilder/DataManagerProvider/RELOAD_PLUGIN";
189
- const REMOVE_FIELD_FROM_DISPLAYED_COMPONENT = "ContentTypeBuilder/DataManagerProvider/REMOVE_FIELD_FROM_DISPLAYED_COMPONENT";
190
- const REMOVE_COMPONENT_FROM_DYNAMIC_ZONE = "ContentTypeBuilder/DataManagerProvider/REMOVE_COMPONENT_FROM_DYNAMIC_ZONE";
191
- const REMOVE_FIELD = "ContentTypeBuilder/DataManagerProvider/REMOVE_FIELD";
192
- const SET_MODIFIED_DATA = "ContentTypeBuilder/DataManagerProvider/SET_MODIFIED_DATA";
193
- const UPDATE_SCHEMA = "ContentTypeBuilder/DataManagerProvider/UPDATE_SCHEMA";
194
- const UPDATE_INITIAL_STATE = "ContentTypeBuilder/DataManagerProvider/UPDATE_INITIAL_STATE";
195
- const retrieveComponentsFromSchema = (attributes, allComponentsData) => {
196
- const allComponents = attributes.reduce((acc, current2) => {
197
- const type = current2.type;
198
- if (type === "component") {
199
- const currentComponentName = current2.component;
200
- acc.push(currentComponentName);
201
- const currentComponentAttributes = get(
202
- allComponentsData,
203
- [currentComponentName, "schema", "attributes"],
204
- []
205
- );
206
- acc.push(...retrieveComponentsFromSchema(currentComponentAttributes, allComponentsData));
207
- }
208
- if (type === "dynamiczone") {
209
- const dynamicZoneComponents = current2.components;
210
- const componentsFromDZComponents = dynamicZoneComponents.reduce((acc2, currentUid) => {
211
- const compoAttrs = get(allComponentsData, [currentUid, "schema", "attributes"], []);
212
- return [...acc2, ...retrieveComponentsFromSchema(compoAttrs, allComponentsData)];
213
- }, []);
214
- return [...acc, ...dynamicZoneComponents, ...componentsFromDZComponents];
215
- }
216
- return acc;
217
- }, []);
218
- return makeUnique(allComponents);
219
- };
220
- const initialState$1 = {
221
- components: {},
222
- contentTypes: {},
223
- initialComponents: {},
224
- initialContentTypes: {},
225
- initialData: {},
226
- modifiedData: {
227
- components: {},
228
- contentTypes: {}
229
- },
230
- reservedNames: {},
231
- isLoading: true,
232
- isLoadingForDataToBeSet: true
233
- };
234
- const ONE_SIDE_RELATIONS = ["oneWay", "manyWay"];
235
- const getOppositeRelation = (originalRelation) => {
236
- if (originalRelation === "manyToOne") {
237
- return "oneToMany";
238
- }
239
- if (originalRelation === "oneToMany") {
240
- return "manyToOne";
241
- }
242
- return originalRelation;
243
- };
244
- const findAttributeIndex = (schema, attributeToFind) => {
245
- return schema.schema.attributes.findIndex(
246
- ({ name: name2 }) => name2 === attributeToFind
247
- );
248
- };
249
- const reducer$1 = (state = initialState$1, action) => produce(state, (draftState) => {
250
- switch (action.type) {
251
- case ADD_ATTRIBUTE: {
252
- const {
253
- attributeToSet: { name: name2, ...rest },
254
- forTarget,
255
- targetUid
256
- } = action;
257
- delete rest.createComponent;
258
- const pathToDataToEdit = ["component", "contentType"].includes(forTarget) ? [forTarget] : [forTarget, targetUid];
259
- const currentAttributes = get(
260
- state,
261
- ["modifiedData", ...pathToDataToEdit, "schema", "attributes"],
262
- []
263
- ).slice();
264
- const updatedAttributes = [...currentAttributes, { ...rest, name: name2 }];
265
- set(
266
- draftState,
267
- ["modifiedData", ...pathToDataToEdit, "schema", "attributes"],
268
- updatedAttributes
269
- );
270
- if (action.shouldAddComponentToData) {
271
- const componentToAddUID = rest.component;
272
- const componentToAdd = state.components[componentToAddUID];
273
- const isTemporaryComponent = componentToAdd?.isTemporary;
274
- const hasComponentAlreadyBeenAdded = state.modifiedData.components?.[componentToAddUID] !== void 0;
275
- if (isTemporaryComponent || hasComponentAlreadyBeenAdded) {
276
- break;
277
- }
278
- if (!draftState.modifiedData.components) {
279
- draftState.modifiedData.components = {};
280
- }
281
- draftState.modifiedData.components[componentToAddUID] = componentToAdd;
282
- const nestedComponents = retrieveComponentsFromSchema(
283
- componentToAdd.schema.attributes,
284
- state.components
285
- );
286
- const nestedComponentsToAddInModifiedData = nestedComponents.filter(
287
- (compoUID) => {
288
- return get(state, ["modifiedData", "components", compoUID]) === void 0;
289
- }
290
- );
291
- nestedComponentsToAddInModifiedData.forEach((compoUID) => {
292
- const compoSchema = get(state, ["components", compoUID], {});
293
- const isTemporary = compoSchema.isTemporary || false;
294
- if (!isTemporary) {
295
- if (!draftState.modifiedData.components) {
296
- draftState.modifiedData.components = {};
297
- }
298
- draftState.modifiedData.components[compoUID] = compoSchema;
299
- }
300
- });
301
- break;
302
- }
303
- const isCreatingRelationAttribute = rest.type === "relation";
304
- if (isCreatingRelationAttribute) {
305
- const target = rest.target;
306
- const targetAttribute = rest.targetAttribute || null;
307
- const relation = rest.relation;
308
- const relationType = getRelationType(relation, targetAttribute);
309
- const currentUid = get(state, ["modifiedData", ...pathToDataToEdit, "uid"]);
310
- if (rest.type === "relation" && relationType !== "oneWay" && relationType !== "manyWay" && target === currentUid) {
311
- const oppositeAttribute = {
312
- name: targetAttribute,
313
- relation: getOppositeRelation(relationType),
314
- target,
315
- targetAttribute: name2,
316
- type: "relation"
317
- };
318
- if (rest.private) {
319
- oppositeAttribute.private = rest.private;
320
- }
321
- const attributesToSet = [...updatedAttributes, oppositeAttribute];
322
- set(
323
- draftState,
324
- ["modifiedData", ...pathToDataToEdit, "schema", "attributes"],
325
- attributesToSet
326
- );
327
- }
328
- }
329
- break;
330
- }
331
- case ADD_CREATED_COMPONENT_TO_DYNAMIC_ZONE: {
332
- const { dynamicZoneTarget, componentsToAdd } = action;
333
- const dzAttributeIndex = findAttributeIndex(
334
- state.modifiedData.contentType,
335
- dynamicZoneTarget
336
- );
337
- componentsToAdd.forEach((componentUid) => {
338
- if (!draftState.modifiedData.contentType?.schema.attributes[dzAttributeIndex].components) {
339
- draftState.modifiedData.contentType.schema.attributes[dzAttributeIndex].components = [];
340
- }
341
- draftState.modifiedData.contentType.schema.attributes[dzAttributeIndex].components.push(
342
- componentUid
343
- );
344
- });
345
- break;
346
- }
347
- case ADD_CUSTOM_FIELD_ATTRIBUTE: {
348
- const {
349
- attributeToSet: { name: name2, ...rest },
350
- forTarget,
351
- targetUid
352
- } = action;
353
- const pathToDataToEdit = ["component", "contentType"].includes(forTarget) ? [forTarget] : [forTarget, targetUid];
354
- const currentAttributes = get(
355
- state,
356
- ["modifiedData", ...pathToDataToEdit, "schema", "attributes"],
357
- []
358
- ).slice();
359
- const updatedAttributes = [...currentAttributes, { ...rest, name: name2 }];
360
- set(
361
- draftState,
362
- ["modifiedData", ...pathToDataToEdit, "schema", "attributes"],
363
- updatedAttributes
364
- );
365
- break;
366
- }
367
- case CHANGE_DYNAMIC_ZONE_COMPONENTS: {
368
- const { dynamicZoneTarget, newComponents } = action;
369
- const dzAttributeIndex = findAttributeIndex(
370
- state.modifiedData.contentType,
371
- dynamicZoneTarget
372
- );
373
- const currentDZComponents = (state.modifiedData.contentType?.schema.attributes[dzAttributeIndex]).components;
374
- const updatedComponents = makeUnique([...currentDZComponents, ...newComponents]);
375
- (draftState.modifiedData.contentType?.schema.attributes[dzAttributeIndex]).components = updatedComponents;
376
- const nestedComponents = retrieveComponentsFromSchema(
377
- current(draftState.modifiedData.contentType.schema.attributes),
378
- state.components
379
- );
380
- const nestedComponentsToAddInModifiedData = nestedComponents.filter((compoUID) => {
381
- return get(state, ["modifiedData", "components", compoUID]) === void 0;
382
- });
383
- nestedComponentsToAddInModifiedData.forEach((compoUID) => {
384
- const compoSchema = get(state, ["components", compoUID], {});
385
- const isTemporary = compoSchema.isTemporary || false;
386
- if (!isTemporary) {
387
- if (!draftState.modifiedData.components) {
388
- draftState.modifiedData.components = {};
389
- }
390
- draftState.modifiedData.components[compoUID] = compoSchema;
391
- }
392
- });
393
- break;
394
- }
395
- case CREATE_COMPONENT_SCHEMA: {
396
- const newSchema = {
397
- uid: action.uid,
398
- isTemporary: true,
399
- category: action.componentCategory,
400
- schema: {
401
- ...action.data,
402
- attributes: []
403
- }
404
- };
405
- draftState.components[action.uid] = newSchema;
406
- if (action.shouldAddComponentToData) {
407
- draftState.modifiedData.components[action.uid] = newSchema;
408
- }
409
- break;
410
- }
411
- case CREATE_SCHEMA: {
412
- const newSchema = {
413
- uid: action.uid,
414
- isTemporary: true,
415
- schema: {
416
- ...action.data,
417
- attributes: []
418
- }
419
- };
420
- draftState.contentTypes[action.uid] = newSchema;
421
- break;
422
- }
423
- case EDIT_ATTRIBUTE: {
424
- const {
425
- attributeToSet: { name: name2, ...rest },
426
- forTarget,
427
- targetUid,
428
- initialAttribute
429
- } = action;
430
- const initialAttributeName = initialAttribute.name;
431
- const pathToDataToEdit = ["component", "contentType"].includes(forTarget) ? [forTarget] : [forTarget, targetUid];
432
- const initialAttributeIndex = findAttributeIndex(
433
- get(state, ["modifiedData", ...pathToDataToEdit]),
434
- initialAttributeName
435
- );
436
- const isEditingRelation = rest.type === "relation";
437
- if (!isEditingRelation) {
438
- set(
439
- draftState,
440
- ["modifiedData", ...pathToDataToEdit, "schema", "attributes", initialAttributeIndex],
441
- action.attributeToSet
442
- );
443
- break;
444
- }
445
- const updatedAttributes = get(state, [
446
- "modifiedData",
447
- ...pathToDataToEdit,
448
- "schema",
449
- "attributes"
450
- ]).slice();
451
- const toSet = {
452
- name: name2,
453
- relation: rest.relation,
454
- target: rest.target,
455
- targetAttribute: rest.targetAttribute,
456
- type: "relation"
457
- };
458
- if (rest.private) {
459
- toSet.private = rest.private;
460
- }
461
- if (rest.pluginOptions) {
462
- toSet.pluginOptions = rest.pluginOptions;
463
- }
464
- const currentAttributeIndex = updatedAttributes.findIndex((value) => {
465
- return value.name !== void 0 && value.name === initialAttribute.name;
466
- });
467
- if (currentAttributeIndex !== -1) {
468
- updatedAttributes.splice(currentAttributeIndex, 1, toSet);
469
- }
470
- let oppositeAttributeNameToRemove = null;
471
- let oppositeAttributeNameToUpdate = null;
472
- let oppositeAttributeToCreate = null;
473
- let initialOppositeAttribute = null;
474
- const currentUid = get(state, ["modifiedData", ...pathToDataToEdit, "uid"]);
475
- const didChangeTargetRelation = initialAttribute.target !== rest.target;
476
- const didCreateInternalRelation = rest.target === currentUid;
477
- const relationType = getRelationType(rest.relation, rest.targetAttribute);
478
- const initialRelationType = getRelationType(
479
- initialAttribute.relation,
480
- initialAttribute.targetAttribute
481
- );
482
- const hadInternalRelation = initialAttribute.target === currentUid;
483
- const didChangeRelationType = initialRelationType !== relationType;
484
- const shouldRemoveOppositeAttributeBecauseOfTargetChange = didChangeTargetRelation && !didCreateInternalRelation && hadInternalRelation && isEditingRelation;
485
- const shouldRemoveOppositeAttributeBecauseOfRelationTypeChange = didChangeRelationType && hadInternalRelation && ["oneWay", "manyWay"].includes(relationType) && isEditingRelation;
486
- const shouldUpdateOppositeAttributeBecauseOfRelationTypeChange = !ONE_SIDE_RELATIONS.includes(initialRelationType) && !ONE_SIDE_RELATIONS.includes(relationType) && hadInternalRelation && didCreateInternalRelation && isEditingRelation;
487
- const shouldCreateOppositeAttributeBecauseOfRelationTypeChange = ONE_SIDE_RELATIONS.includes(initialRelationType) && !ONE_SIDE_RELATIONS.includes(relationType) && hadInternalRelation && didCreateInternalRelation && isEditingRelation;
488
- const shouldCreateOppositeAttributeBecauseOfTargetChange = didChangeTargetRelation && didCreateInternalRelation && !ONE_SIDE_RELATIONS.includes(relationType);
489
- if (shouldRemoveOppositeAttributeBecauseOfTargetChange || shouldRemoveOppositeAttributeBecauseOfRelationTypeChange) {
490
- oppositeAttributeNameToRemove = initialAttribute.targetAttribute;
491
- }
492
- if (oppositeAttributeNameToRemove) {
493
- const indexToRemove = updatedAttributes.findIndex(
494
- (value) => value.name === oppositeAttributeNameToRemove
495
- );
496
- updatedAttributes.splice(indexToRemove, 1);
497
- }
498
- if (!shouldRemoveOppositeAttributeBecauseOfTargetChange) {
499
- const initialTargetContentType = get(state, [
500
- "initialContentTypes",
501
- initialAttribute.target
502
- ]);
503
- if (initialTargetContentType) {
504
- const oppositeAttributeIndex = findAttributeIndex(
505
- initialTargetContentType,
506
- initialAttribute.targetAttribute
507
- );
508
- initialOppositeAttribute = get(state, [
509
- "initialContentTypes",
510
- initialAttribute.target,
511
- "schema",
512
- "attributes",
513
- oppositeAttributeIndex
514
- ]);
515
- }
516
- }
517
- if (shouldCreateOppositeAttributeBecauseOfRelationTypeChange || shouldCreateOppositeAttributeBecauseOfTargetChange) {
518
- oppositeAttributeToCreate = {
519
- name: rest.targetAttribute,
520
- relation: getOppositeRelation(relationType),
521
- target: rest.target,
522
- targetAttribute: name2,
523
- type: "relation"
524
- };
525
- if (rest.private) {
526
- oppositeAttributeToCreate.private = rest.private;
527
- }
528
- if (initialOppositeAttribute && initialOppositeAttribute.pluginOptions) {
529
- oppositeAttributeToCreate.pluginOptions = initialOppositeAttribute.pluginOptions;
530
- }
531
- const indexOfInitialAttribute = updatedAttributes.findIndex(
532
- ({ name: name22 }) => name22 === initialAttribute.name
533
- );
534
- const indexOfUpdatedAttribute = updatedAttributes.findIndex(
535
- ({ name: attrName }) => name2 === attrName
536
- );
537
- const indexToInsert = (indexOfInitialAttribute === -1 ? indexOfUpdatedAttribute : indexOfInitialAttribute) + 1;
538
- updatedAttributes.splice(indexToInsert, 0, oppositeAttributeToCreate);
539
- }
540
- if (shouldUpdateOppositeAttributeBecauseOfRelationTypeChange) {
541
- oppositeAttributeNameToUpdate = initialAttribute.targetAttribute;
542
- oppositeAttributeToCreate = {
543
- name: rest.targetAttribute,
544
- relation: getOppositeRelation(relationType),
545
- target: rest.target,
546
- targetAttribute: name2,
547
- type: "relation"
548
- };
549
- if (rest.private) {
550
- oppositeAttributeToCreate.private = rest.private;
551
- }
552
- if (initialOppositeAttribute && initialOppositeAttribute.pluginOptions) {
553
- oppositeAttributeToCreate.pluginOptions = initialOppositeAttribute.pluginOptions;
554
- }
555
- if (oppositeAttributeNameToUpdate) {
556
- const indexToUpdate = updatedAttributes.findIndex(
557
- ({ name: name22 }) => name22 === oppositeAttributeNameToUpdate
558
- );
559
- updatedAttributes.splice(indexToUpdate, 1, oppositeAttributeToCreate);
560
- }
561
- }
562
- set(
563
- draftState,
564
- ["modifiedData", ...pathToDataToEdit, "schema", "attributes"],
565
- updatedAttributes
566
- );
567
- break;
568
- }
569
- case EDIT_CUSTOM_FIELD_ATTRIBUTE: {
570
- const { forTarget, targetUid, initialAttribute, attributeToSet } = action;
571
- const initialAttributeName = initialAttribute.name;
572
- const pathToDataToEdit = ["component", "contentType"].includes(forTarget) ? [forTarget] : [forTarget, targetUid];
573
- const initialAttributeIndex = findAttributeIndex(
574
- get(state, ["modifiedData", ...pathToDataToEdit]),
575
- initialAttributeName
576
- );
577
- set(
578
- draftState,
579
- ["modifiedData", ...pathToDataToEdit, "schema", "attributes", initialAttributeIndex],
580
- attributeToSet
581
- );
582
- break;
583
- }
584
- case GET_DATA_SUCCEEDED: {
585
- draftState.components = action.components;
586
- draftState.initialComponents = action.components;
587
- draftState.initialContentTypes = action.contentTypes;
588
- draftState.contentTypes = action.contentTypes;
589
- draftState.reservedNames = action.reservedNames;
590
- draftState.isLoading = false;
591
- break;
592
- }
593
- case UPDATE_INITIAL_STATE: {
594
- draftState.initialData = draftState.modifiedData;
595
- break;
596
- }
597
- case DELETE_NOT_SAVED_TYPE: {
598
- draftState.contentTypes = state.initialContentTypes;
599
- draftState.components = state.initialComponents;
600
- break;
601
- }
602
- case RELOAD_PLUGIN: {
603
- return initialState$1;
604
- }
605
- case REMOVE_COMPONENT_FROM_DYNAMIC_ZONE: {
606
- const dzAttributeIndex = findAttributeIndex(state.modifiedData.contentType, action.dzName);
607
- draftState.modifiedData.contentType.schema.attributes[dzAttributeIndex].components.splice(
608
- action.componentToRemoveIndex,
609
- 1
610
- );
611
- break;
612
- }
613
- case REMOVE_FIELD: {
614
- const { mainDataKey, attributeToRemoveName } = action;
615
- const pathToAttributes = ["modifiedData", mainDataKey, "schema", "attributes"];
616
- const attributeToRemoveIndex = findAttributeIndex(
617
- state.modifiedData[mainDataKey],
618
- attributeToRemoveName
619
- );
620
- const pathToAttributeToRemove = [...pathToAttributes, attributeToRemoveIndex];
621
- const attributeToRemoveData = get(state, pathToAttributeToRemove);
622
- const isRemovingRelationAttribute = attributeToRemoveData.type === "relation";
623
- const canTheAttributeToRemoveHaveARelationWithItself = mainDataKey === "contentType";
624
- if (isRemovingRelationAttribute && canTheAttributeToRemoveHaveARelationWithItself) {
625
- const { target, relation, targetAttribute } = attributeToRemoveData;
626
- const relationType = getRelationType(relation, targetAttribute);
627
- const uid = state.modifiedData.contentType?.uid;
628
- const shouldRemoveOppositeAttribute = target === uid && !ONE_SIDE_RELATIONS.includes(relationType);
629
- if (shouldRemoveOppositeAttribute) {
630
- const attributes = state.modifiedData[mainDataKey]?.schema.attributes.slice();
631
- const nextAttributes = attributes.filter((attribute) => {
632
- if (attribute.name === attributeToRemoveName) {
633
- return false;
634
- }
635
- if (attribute.target === uid && attribute.targetAttribute === attributeToRemoveName) {
636
- return false;
637
- }
638
- return true;
639
- });
640
- draftState.modifiedData[mainDataKey].schema.attributes = nextAttributes;
641
- break;
642
- }
643
- }
644
- const uidFieldsToUpdate = state.modifiedData[mainDataKey].schema.attributes.slice().reduce((acc, current2) => {
645
- if (current2.type !== "uid") {
646
- return acc;
647
- }
648
- if (current2.targetField !== attributeToRemoveName) {
649
- return acc;
650
- }
651
- acc.push(current2.name);
652
- return acc;
653
- }, []);
654
- uidFieldsToUpdate.forEach((fieldName) => {
655
- const fieldIndex = findAttributeIndex(state.modifiedData[mainDataKey], fieldName);
656
- delete draftState.modifiedData[mainDataKey]?.schema.attributes[fieldIndex].targetField;
657
- });
658
- draftState.modifiedData[mainDataKey]?.schema.attributes.splice(attributeToRemoveIndex, 1);
659
- break;
660
- }
661
- case REMOVE_FIELD_FROM_DISPLAYED_COMPONENT: {
662
- const { attributeToRemoveName, componentUid } = action;
663
- const attributeToRemoveIndex = findAttributeIndex(
664
- state.modifiedData.components?.[componentUid],
665
- attributeToRemoveName
666
- );
667
- draftState.modifiedData.components?.[componentUid]?.schema?.attributes?.splice(
668
- attributeToRemoveIndex,
669
- 1
670
- );
671
- break;
672
- }
673
- case SET_MODIFIED_DATA: {
674
- draftState.isLoadingForDataToBeSet = false;
675
- draftState.initialData = action.schemaToSet;
676
- draftState.modifiedData = action.schemaToSet;
677
- if (!action.hasJustCreatedSchema) {
678
- draftState.components = state.initialComponents;
679
- draftState.contentTypes = state.initialContentTypes;
680
- }
681
- break;
682
- }
683
- case UPDATE_SCHEMA: {
684
- const {
685
- data: { displayName, category, icon, kind },
686
- schemaType,
687
- uid
688
- } = action;
689
- draftState.modifiedData[schemaType].schema.displayName = displayName;
690
- if (action.schemaType === "component") {
691
- draftState.modifiedData.component.category = category;
692
- draftState.modifiedData.component.schema.icon = icon;
693
- const addedComponent = current(draftState.modifiedData.component);
694
- draftState.components[uid] = addedComponent;
695
- break;
696
- }
697
- draftState.modifiedData.contentType.schema.kind = kind;
698
- break;
699
- }
700
- default:
701
- return draftState;
702
- }
703
- });
704
- const nameToSlug = (name2) => slugify(name2, { separator: "-" });
705
- const ON_CHANGE = "ContentTypeBuilder/FormModal/ON_CHANGE";
706
- const ON_CHANGE_RELATION_TARGET = "ContentTypeBuilder/FormModal/ON_CHANGE_RELATION_TARGET";
707
- const ON_CHANGE_RELATION_TYPE = "ContentTypeBuilder/FormModal/ON_CHANGE_RELATION_TYPE";
708
- const RESET_PROPS = "ContentTypeBuilder/FormModal/RESET_PROPS";
709
- const RESET_PROPS_AND_SET_FORM_FOR_ADDING_AN_EXISTING_COMPO = "ContentTypeBuilder/FormModal/RESET_PROPS_AND_SET_FORM_FOR_ADDING_AN_EXISTING_COMPO";
710
- const RESET_PROPS_AND_SAVE_CURRENT_DATA = "ContentTypeBuilder/FormModal/RESET_PROPS_AND_SAVE_CURRENT_DATA";
711
- const RESET_PROPS_AND_SET_THE_FORM_FOR_ADDING_A_COMPO_TO_A_DZ = "ContentTypeBuilder/FormModal/RESET_PROPS_AND_SET_THE_FORM_FOR_ADDING_A_COMPO_TO_A_DZ";
712
- const SET_DATA_TO_EDIT = "ContentTypeBuilder/FormModal/SET_DATA_TO_EDIT";
713
- const SET_ATTRIBUTE_DATA_SCHEMA = "ContentTypeBuilder/FormModal/SET_ATTRIBUTE_DATA_SCHEMA";
714
- const SET_CUSTOM_FIELD_DATA_SCHEMA = "ContentTypeBuilder/FormModal/SET_CUSTOM_FIELD_DATA_SCHEMA";
715
- const SET_DYNAMIC_ZONE_DATA_SCHEMA = "ContentTypeBuilder/FormModal/SET_DYNAMIC_ZONE_DATA_SCHEMA";
716
- const SET_ERRORS = "ContentTypeBuilder/FormModal/SET_ERRORS";
717
- const createUid = (name2) => {
718
- const modelName = nameToSlug(name2);
719
- return `api::${modelName}.${modelName}`;
720
- };
721
- const createComponentUid = (name2, category) => {
722
- return `${nameToSlug(category)}.${nameToSlug(name2)}`;
723
- };
724
- const customFieldDefaultOptionsReducer = (acc, option) => {
725
- if (option.items) {
726
- return option.items.reduce(customFieldDefaultOptionsReducer, acc);
727
- }
728
- if ("defaultValue" in option) {
729
- const { name: name2, defaultValue } = option;
730
- acc.push({ name: name2, defaultValue });
731
- }
732
- return acc;
733
- };
734
- const shouldPluralizeName = (nature) => ["manyToMany", "oneToMany", "manyWay"].includes(nature) ? 2 : 1;
735
- const shouldPluralizeTargetAttribute = (nature) => ["manyToMany", "manyToOne"].includes(nature) ? 2 : 1;
736
- const initialState = {
737
- formErrors: {},
738
- modifiedData: {},
739
- initialData: {},
740
- componentToCreate: {},
741
- isCreatingComponentWhileAddingAField: false
742
- };
743
- const reducer = (state = initialState, action) => (
744
- // eslint-disable-next-line consistent-return
745
- produce$1(state, (draftState) => {
746
- switch (action.type) {
747
- case ON_CHANGE: {
748
- const { keys, value } = action;
749
- const obj = state.modifiedData;
750
- const hasDefaultValue = Boolean(obj.default);
751
- if (hasDefaultValue && keys.length === 1 && keys.includes("type")) {
752
- const previousType = obj.type;
753
- if (previousType && ["date", "datetime", "time"].includes(previousType)) {
754
- delete draftState.modifiedData.default;
755
- }
756
- }
757
- set(draftState, ["modifiedData", ...keys], value);
758
- break;
759
- }
760
- case ON_CHANGE_RELATION_TARGET: {
761
- const {
762
- target: {
763
- oneThatIsCreatingARelationWithAnother,
764
- selectedContentTypeFriendlyName,
765
- targetContentTypeAllowedRelations,
766
- value
767
- }
768
- } = action;
769
- let didChangeRelationTypeBecauseOfRestrictedRelation = false;
770
- let changedRelationType = null;
771
- set(draftState, ["modifiedData", "target"], value);
772
- const modifiedData = state.modifiedData;
773
- if (Array.isArray(targetContentTypeAllowedRelations)) {
774
- const currentRelationType = getRelationType(
775
- modifiedData.relation,
776
- modifiedData.targetAttribute
777
- );
778
- if (!targetContentTypeAllowedRelations.includes(currentRelationType)) {
779
- const relationToSet = targetContentTypeAllowedRelations[0];
780
- didChangeRelationTypeBecauseOfRestrictedRelation = true;
781
- changedRelationType = relationToSet;
782
- if (relationToSet === "oneWay") {
783
- set(draftState, ["modifiedData", "relation"], "oneToOne");
784
- } else if (relationToSet === "manyWay") {
785
- set(draftState, ["modifiedData", "relation"], "oneToMany");
786
- } else {
787
- set(draftState, ["modifiedData", "relation"], relationToSet);
788
- }
789
- }
790
- }
791
- let nameToSet;
792
- if (didChangeRelationTypeBecauseOfRestrictedRelation) {
793
- nameToSet = pluralize(
794
- snakeCase(nameToSlug(selectedContentTypeFriendlyName)),
795
- shouldPluralizeName(changedRelationType)
796
- );
797
- } else {
798
- nameToSet = pluralize(
799
- snakeCase(nameToSlug(selectedContentTypeFriendlyName)),
800
- shouldPluralizeName(modifiedData.relation)
801
- );
802
- }
803
- set(draftState, ["modifiedData", "name"], nameToSet);
804
- const currentTargetAttribute = state.modifiedData.targetAttribute;
805
- if (currentTargetAttribute === null) {
806
- break;
807
- }
808
- if (didChangeRelationTypeBecauseOfRestrictedRelation && ["oneWay", "manyWay"].includes(changedRelationType)) {
809
- set(draftState, ["modifiedData", "targetAttribute"], null);
810
- break;
811
- }
812
- const targetAttributeToSet = pluralize(
813
- snakeCase(nameToSlug(oneThatIsCreatingARelationWithAnother)),
814
- shouldPluralizeTargetAttribute(modifiedData.relation)
815
- );
816
- set(draftState, ["modifiedData", "targetAttribute"], targetAttributeToSet);
817
- break;
818
- }
819
- case ON_CHANGE_RELATION_TYPE: {
820
- const {
821
- target: { oneThatIsCreatingARelationWithAnother, value }
822
- } = action;
823
- const currentName = state.modifiedData.name;
824
- if (!["oneWay", "manyWay"].includes(value)) {
825
- set(draftState, ["modifiedData", "relation"], value);
826
- const currentTargetAttribute = state.modifiedData.targetAttribute;
827
- set(
828
- draftState,
829
- ["modifiedData", "name"],
830
- pluralize(snakeCase(nameToSlug(currentName)), shouldPluralizeName(value))
831
- );
832
- set(
833
- draftState,
834
- ["modifiedData", "targetAttribute"],
835
- pluralize(
836
- currentTargetAttribute || snakeCase(nameToSlug(oneThatIsCreatingARelationWithAnother)),
837
- shouldPluralizeTargetAttribute(value)
838
- )
839
- );
840
- break;
841
- }
842
- if (value === "oneWay") {
843
- set(draftState, ["modifiedData", "relation"], "oneToOne");
844
- set(draftState, ["modifiedData", "targetAttribute"], null);
845
- set(draftState, ["modifiedData", "name"], pluralize(snakeCase(currentName), 1));
846
- break;
847
- }
848
- set(draftState, ["modifiedData", "relation"], "oneToMany");
849
- set(draftState, ["modifiedData", "targetAttribute"], null);
850
- set(draftState, ["modifiedData", "name"], pluralize(snakeCase(currentName), 2));
851
- break;
852
- }
853
- case RESET_PROPS:
854
- return initialState;
855
- case RESET_PROPS_AND_SET_FORM_FOR_ADDING_AN_EXISTING_COMPO: {
856
- const nextState = {
857
- ...initialState,
858
- modifiedData: {
859
- type: "component",
860
- repeatable: true,
861
- ...action.options
862
- }
863
- };
864
- return nextState;
865
- }
866
- case RESET_PROPS_AND_SAVE_CURRENT_DATA: {
867
- const componentToCreate = state.modifiedData.componentToCreate;
868
- const modifiedData = {
869
- displayName: componentToCreate.displayName,
870
- type: "component",
871
- repeatable: false,
872
- ...action.options,
873
- component: createComponentUid(componentToCreate.displayName, componentToCreate.category)
874
- };
875
- const nextState = {
876
- ...initialState,
877
- componentToCreate,
878
- modifiedData,
879
- isCreatingComponentWhileAddingAField: state.modifiedData.createComponent
880
- };
881
- return nextState;
882
- }
883
- case RESET_PROPS_AND_SET_THE_FORM_FOR_ADDING_A_COMPO_TO_A_DZ: {
884
- const createdDZ = state.modifiedData;
885
- const dataToSet = {
886
- ...createdDZ,
887
- createComponent: true,
888
- componentToCreate: { type: "component" }
889
- };
890
- return { ...initialState, modifiedData: dataToSet };
891
- }
892
- case SET_DATA_TO_EDIT: {
893
- draftState.modifiedData = action.data;
894
- draftState.initialData = action.data;
895
- break;
896
- }
897
- case SET_ATTRIBUTE_DATA_SCHEMA: {
898
- const {
899
- attributeType,
900
- isEditing,
901
- modifiedDataToSetForEditing,
902
- nameToSetForRelation,
903
- targetUid,
904
- step,
905
- options = {}
906
- } = action;
907
- if (isEditing) {
908
- draftState.modifiedData = modifiedDataToSetForEditing;
909
- draftState.initialData = modifiedDataToSetForEditing;
910
- break;
911
- }
912
- let dataToSet;
913
- if (attributeType === "component") {
914
- if (step === "1") {
915
- dataToSet = {
916
- type: "component",
917
- createComponent: true,
918
- componentToCreate: { type: "component" }
919
- };
920
- } else {
921
- dataToSet = {
922
- ...options,
923
- type: "component",
924
- repeatable: true
925
- };
926
- }
927
- } else if (attributeType === "dynamiczone") {
928
- dataToSet = {
929
- ...options,
930
- type: "dynamiczone",
931
- components: []
932
- };
933
- } else if (attributeType === "text") {
934
- dataToSet = { ...options, type: "string" };
935
- } else if (attributeType === "number" || attributeType === "date") {
936
- dataToSet = options;
937
- } else if (attributeType === "media") {
938
- dataToSet = {
939
- allowedTypes: ["images", "files", "videos", "audios"],
940
- type: "media",
941
- multiple: true,
942
- ...options
943
- };
944
- } else if (attributeType === "enumeration") {
945
- dataToSet = { ...options, type: "enumeration", enum: [] };
946
- } else if (attributeType === "relation") {
947
- dataToSet = {
948
- name: snakeCase(nameToSetForRelation),
949
- relation: "oneToOne",
950
- targetAttribute: null,
951
- target: targetUid,
952
- type: "relation"
953
- };
954
- } else {
955
- dataToSet = { ...options, type: attributeType, default: null };
956
- }
957
- draftState.modifiedData = dataToSet;
958
- break;
959
- }
960
- case SET_CUSTOM_FIELD_DATA_SCHEMA: {
961
- const { customField, isEditing, modifiedDataToSetForEditing, options = {} } = action;
962
- if (isEditing) {
963
- draftState.modifiedData = modifiedDataToSetForEditing;
964
- draftState.initialData = modifiedDataToSetForEditing;
965
- break;
966
- }
967
- draftState.modifiedData = { ...options, type: customField.type };
968
- const allOptions = [
969
- ...customField?.options?.base || [],
970
- ...customField?.options?.advanced || []
971
- ];
972
- const optionDefaults = allOptions.reduce(customFieldDefaultOptionsReducer, []);
973
- if (optionDefaults.length) {
974
- optionDefaults.forEach(
975
- ({ name: name2, defaultValue }) => set(draftState.modifiedData, name2, defaultValue)
976
- );
977
- }
978
- break;
979
- }
980
- case SET_DYNAMIC_ZONE_DATA_SCHEMA: {
981
- draftState.modifiedData = action.attributeToEdit;
982
- draftState.initialData = action.attributeToEdit;
983
- break;
984
- }
985
- case SET_ERRORS: {
986
- draftState.formErrors = action.errors;
987
- break;
988
- }
989
- default:
990
- return draftState;
991
- }
992
- })
993
- );
994
- const reducers = {
995
- [`${pluginId}_formModal`]: reducer,
996
- [`${pluginId}_dataManagerProvider`]: reducer$1
997
- };
998
- const formsAPI = {
999
- components: {
1000
- inputs: {},
1001
- add({ id, component }) {
1002
- if (!this.inputs[id]) {
1003
- this.inputs[id] = component;
1004
- }
1005
- }
1006
- },
1007
- types: {
1008
- attribute: {
1009
- // test: {
1010
- // validators: [],
1011
- // form: {
1012
- // advanced: [
1013
- // /* cb */
1014
- // ],
1015
- // base: [
1016
- // /* cb */
1017
- // ],
1018
- // },
1019
- // },
1020
- },
1021
- contentType: {
1022
- validators: [],
1023
- form: {
1024
- advanced: [],
1025
- base: []
1026
- }
1027
- },
1028
- component: {
1029
- validators: [],
1030
- form: {
1031
- advanced: [],
1032
- base: []
1033
- }
1034
- }
1035
- },
1036
- contentTypeSchemaMutations: [],
1037
- addContentTypeSchemaMutation(cb) {
1038
- this.contentTypeSchemaMutations.push(cb);
1039
- },
1040
- extendContentType({ validator, form: { advanced, base } }) {
1041
- const { contentType } = this.types;
1042
- contentType.validators.push(validator);
1043
- contentType.form.advanced.push(advanced);
1044
- contentType.form.base.push(base);
1045
- },
1046
- extendFields(fields, { validator, form: { advanced, base } }) {
1047
- const formType = this.types.attribute;
1048
- fields.forEach((field) => {
1049
- if (!formType[field]) {
1050
- formType[field] = {
1051
- validators: [],
1052
- form: {
1053
- advanced: [
1054
- /* cb */
1055
- ],
1056
- base: [
1057
- /* cb */
1058
- ]
1059
- }
1060
- };
1061
- }
1062
- formType[field].validators.push(validator);
1063
- formType[field].form.advanced.push(advanced);
1064
- formType[field].form.base.push(base);
1065
- });
1066
- },
1067
- getAdvancedForm(target, props = null) {
1068
- const sectionsToAdd = get(this.types, [...target, "form", "advanced"], []).reduce(
1069
- (acc, current2) => {
1070
- const sections = current2(props);
1071
- return [...acc, ...sections];
1072
- },
1073
- []
1074
- );
1075
- return sectionsToAdd;
1076
- },
1077
- makeCustomFieldValidator(attributeShape, validator, ...validatorArgs) {
1078
- if (!validator) return attributeShape;
1079
- return attributeShape.shape({ options: yup.object().shape(validator(validatorArgs)) });
1080
- },
1081
- makeValidator(target, initShape, ...args) {
1082
- const validators = get(this.types, [...target, "validators"], []);
1083
- const pluginOptionsShape = validators.reduce((acc, current2) => {
1084
- const pluginOptionShape = current2(args);
1085
- return { ...acc, ...pluginOptionShape };
1086
- }, {});
1087
- return initShape.shape({ pluginOptions: yup.object().shape(pluginOptionsShape) });
1088
- },
1089
- mutateContentTypeSchema(data, initialData) {
1090
- let enhancedData = cloneDeep(data);
1091
- const refData = cloneDeep(initialData);
1092
- this.contentTypeSchemaMutations.forEach((cb) => {
1093
- enhancedData = cb(enhancedData, refData);
1094
- });
1095
- return enhancedData;
1096
- }
1097
- };
1098
- const prefixPluginTranslations = (trad, pluginId2) => {
1099
- if (!pluginId2) {
1100
- throw new TypeError("pluginId can't be empty");
1101
- }
1102
- return Object.keys(trad).reduce((acc, current2) => {
1103
- acc[`${pluginId2}.${current2}`] = trad[current2];
1104
- return acc;
1105
- }, {});
1106
- };
1107
- const AutoReloadOverlayBlockerContext = React.createContext(
1108
- {}
1109
- );
1110
- const MAX_ELAPSED_TIME = 30 * 1e3;
1111
- const AutoReloadOverlayBlockerProvider = ({ children }) => {
1112
- const [isOpen, setIsOpen] = React.useState(false);
1113
- const [config, setConfig] = React.useState({});
1114
- const [failed, setFailed] = React.useState(false);
1115
- const lockAppWithAutoreload = React.useCallback((config2 = {}) => {
1116
- setIsOpen(true);
1117
- setConfig(config2);
1118
- }, []);
1119
- const unlockAppWithAutoreload = React.useCallback(() => {
1120
- setIsOpen(false);
1121
- setConfig({});
1122
- }, []);
1123
- React.useEffect(() => {
1124
- if (isOpen) {
1125
- const timeout = setTimeout(() => {
1126
- setFailed(true);
1127
- }, MAX_ELAPSED_TIME);
1128
- return () => {
1129
- clearTimeout(timeout);
1130
- };
1131
- }
1132
- }, [isOpen]);
1133
- let displayedIcon = config?.icon || "reload";
1134
- let description2 = {
1135
- id: config?.description || "components.OverlayBlocker.description",
1136
- defaultMessage: "You're using a feature that needs the server to restart. The page will reload automatically."
1137
- };
1138
- let title = {
1139
- id: config?.title || "components.OverlayBlocker.title",
1140
- defaultMessage: "Waiting for restart"
1141
- };
1142
- if (failed) {
1143
- displayedIcon = "time";
1144
- description2 = {
1145
- id: "components.OverlayBlocker.description.serverError",
1146
- defaultMessage: "The server should have restarted, please check your logs in the terminal."
1147
- };
1148
- title = {
1149
- id: "components.OverlayBlocker.title.serverError",
1150
- defaultMessage: "The restart is taking longer than expected"
1151
- };
1152
- }
1153
- const autoReloadValue = React.useMemo(
1154
- () => ({
1155
- lockAppWithAutoreload,
1156
- unlockAppWithAutoreload
1157
- }),
1158
- [lockAppWithAutoreload, unlockAppWithAutoreload]
1159
- );
1160
- return /* @__PURE__ */ jsxs(AutoReloadOverlayBlockerContext.Provider, { value: autoReloadValue, children: [
1161
- /* @__PURE__ */ jsx(
1162
- Blocker,
1163
- {
1164
- displayedIcon,
1165
- isOpen,
1166
- description: description2,
1167
- title
1168
- }
1169
- ),
1170
- children
1171
- ] });
1172
- };
1173
- const Blocker = ({ displayedIcon, description: description2, title, isOpen }) => {
1174
- const { formatMessage } = useIntl();
1175
- return isOpen && globalThis?.document?.body ? createPortal(
1176
- /* @__PURE__ */ jsxs(Overlay, { id: "autoReloadOverlayBlocker", direction: "column", alignItems: "center", gap: 6, children: [
1177
- /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "center", gap: 2, children: [
1178
- /* @__PURE__ */ jsx(Typography, { tag: "h1", variant: "alpha", children: formatMessage(title) }),
1179
- /* @__PURE__ */ jsx(Typography, { tag: "h2", textColor: "neutral600", fontSize: 4, fontWeight: "regular", children: formatMessage(description2) })
1180
- ] }),
1181
- displayedIcon === "reload" && /* @__PURE__ */ jsx(IconBox, { padding: 6, background: "primary100", borderColor: "primary200", children: /* @__PURE__ */ jsx(LoaderReload, { width: "4rem", height: "4rem" }) }),
1182
- displayedIcon === "time" && /* @__PURE__ */ jsx(IconBox, { padding: 6, background: "primary100", borderColor: "primary200", children: /* @__PURE__ */ jsx(Clock, { width: "4rem", height: "4rem" }) }),
1183
- /* @__PURE__ */ jsx(Box, { marginTop: 2, children: /* @__PURE__ */ jsx(Link, { href: "https://docs.strapi.io", isExternal: true, children: formatMessage({
1184
- id: "global.documentation",
1185
- defaultMessage: "Read the documentation"
1186
- }) }) })
1187
- ] }),
1188
- // eslint-disable-next-line no-undef
1189
- globalThis.document.body
1190
- ) : null;
1191
- };
1192
- const rotation = keyframes`
1193
- from {
1194
- transform: rotate(0deg);
1195
- }
1196
- to {
1197
- transform: rotate(359deg);
1198
- }
1199
- `;
1200
- const LoaderReload = styled(ArrowClockwise)`
1201
- animation: ${rotation} 1s infinite linear;
1202
- `;
1203
- const Overlay = styled(Flex)`
1204
- position: fixed;
1205
- top: 0;
1206
- right: 0;
1207
- bottom: 0;
1208
- left: 0;
1209
- /* TODO: set this up in the theme for consistence z-index values */
1210
- z-index: 1140;
1211
- padding-top: 16rem;
1212
-
1213
- & > * {
1214
- position: relative;
1215
- z-index: 1;
1216
- }
1217
-
1218
- &:before {
1219
- content: '';
1220
- position: fixed;
1221
- top: 0;
1222
- right: 0;
1223
- bottom: 0;
1224
- left: 0;
1225
- background: ${({ theme }) => theme.colors.neutral0};
1226
- opacity: 0.9;
1227
- }
1228
- `;
1229
- const IconBox = styled(Box)`
1230
- border-radius: 50%;
1231
- display: flex;
1232
- align-items: center;
1233
- justify-content: center;
1234
- svg {
1235
- > path {
1236
- fill: ${({ theme }) => theme.colors.primary600} !important;
1237
- }
1238
- }
1239
- `;
1240
- const useAutoReloadOverlayBlocker = () => React.useContext(AutoReloadOverlayBlockerContext);
1241
- const name = pluginPkg.strapi.name;
1242
- const index = {
1243
- register(app) {
1244
- app.addReducers(reducers);
1245
- app.addMenuLink({
1246
- to: `plugins/${pluginId}`,
1247
- icon: Layout,
1248
- intlLabel: {
1249
- id: `${pluginId}.plugin.name`,
1250
- defaultMessage: "Content Types Builder"
1251
- },
1252
- permissions: PERMISSIONS.main,
1253
- Component: () => import("./index-B5tHY87r.mjs").then((n) => n.i),
1254
- position: 5
1255
- });
1256
- app.registerPlugin({
1257
- id: pluginId,
1258
- name,
1259
- // Internal APIs exposed by the CTB for the other plugins to use
1260
- apis: {
1261
- forms: formsAPI
1262
- }
1263
- });
1264
- },
1265
- bootstrap() {
1266
- },
1267
- async registerTrads({ locales }) {
1268
- const importedTrads = await Promise.all(
1269
- locales.map((locale) => {
1270
- return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => import("./ar-BYDB75EB.mjs"), "./translations/cs.json": () => import("./cs-ChL4LaFY.mjs"), "./translations/de.json": () => import("./de-DsHQNzp2.mjs"), "./translations/dk.json": () => import("./dk-BC7NAQR2.mjs"), "./translations/en.json": () => import("./en-jBwb53yg.mjs"), "./translations/es.json": () => import("./es-BE_zx2_w.mjs"), "./translations/fr.json": () => import("./fr-lU_OMJma.mjs"), "./translations/id.json": () => import("./id-W1sKBFEw.mjs"), "./translations/it.json": () => import("./it-D04lb2Wc.mjs"), "./translations/ja.json": () => import("./ja-BHLK_2_g.mjs"), "./translations/ko.json": () => import("./ko-DoNsXHXA.mjs"), "./translations/ms.json": () => import("./ms-BtGFDB9t.mjs"), "./translations/nl.json": () => import("./nl-BaTAuelQ.mjs"), "./translations/pl.json": () => import("./pl-CP2Zgp01.mjs"), "./translations/pt-BR.json": () => import("./pt-BR-CCQGwXs0.mjs"), "./translations/pt.json": () => import("./pt-DMeTMW2x.mjs"), "./translations/ru.json": () => import("./ru-DGSjru5m.mjs"), "./translations/sk.json": () => import("./sk-DVK4HfSC.mjs"), "./translations/sv.json": () => import("./sv-BGb12eW3.mjs"), "./translations/th.json": () => import("./th--u3VqsON.mjs"), "./translations/tr.json": () => import("./tr-DsUerr-c.mjs"), "./translations/uk.json": () => import("./uk-Bx5IlOKX.mjs"), "./translations/zh-Hans.json": () => import("./zh-Hans-Cc0M5PXr.mjs"), "./translations/zh.json": () => import("./zh-CsUDN13W.mjs") }), `./translations/${locale}.json`, 3).then(({ default: data }) => {
1271
- return {
1272
- data: prefixPluginTranslations(data, pluginId),
1273
- locale
1274
- };
1275
- }).catch(() => {
1276
- return {
1277
- data: {},
1278
- locale
1279
- };
1280
- });
1281
- })
1282
- );
1283
- return Promise.resolve(importedTrads);
1284
- }
1285
- };
1286
- export {
1287
- ADD_CUSTOM_FIELD_ATTRIBUTE as A,
1288
- CREATE_SCHEMA as B,
1289
- CHANGE_DYNAMIC_ZONE_COMPONENTS as C,
1290
- DELETE_NOT_SAVED_TYPE as D,
1291
- EDIT_CUSTOM_FIELD_ATTRIBUTE as E,
1292
- CREATE_COMPONENT_SCHEMA as F,
1293
- GET_DATA_SUCCEEDED as G,
1294
- REMOVE_FIELD_FROM_DISPLAYED_COMPONENT as H,
1295
- REMOVE_FIELD as I,
1296
- AutoReloadOverlayBlockerProvider as J,
1297
- index as K,
1298
- MAX_COMPONENT_DEPTH as M,
1299
- ON_CHANGE_RELATION_TARGET as O,
1300
- PERMISSIONS as P,
1301
- RESET_PROPS as R,
1302
- SET_DATA_TO_EDIT as S,
1303
- UPDATE_INITIAL_STATE as U,
1304
- ON_CHANGE_RELATION_TYPE as a,
1305
- createUid as b,
1306
- createComponentUid as c,
1307
- SET_DYNAMIC_ZONE_DATA_SCHEMA as d,
1308
- SET_CUSTOM_FIELD_DATA_SCHEMA as e,
1309
- SET_ATTRIBUTE_DATA_SCHEMA as f,
1310
- getRelationType as g,
1311
- SET_ERRORS as h,
1312
- initialState as i,
1313
- ON_CHANGE as j,
1314
- RESET_PROPS_AND_SET_THE_FORM_FOR_ADDING_A_COMPO_TO_A_DZ as k,
1315
- RESET_PROPS_AND_SET_FORM_FOR_ADDING_AN_EXISTING_COMPO as l,
1316
- RESET_PROPS_AND_SAVE_CURRENT_DATA as m,
1317
- nameToSlug as n,
1318
- initialState$1 as o,
1319
- pluginId as p,
1320
- makeUnique as q,
1321
- RELOAD_PLUGIN as r,
1322
- retrieveComponentsFromSchema as s,
1323
- SET_MODIFIED_DATA as t,
1324
- useAutoReloadOverlayBlocker as u,
1325
- ADD_CREATED_COMPONENT_TO_DYNAMIC_ZONE as v,
1326
- REMOVE_COMPONENT_FROM_DYNAMIC_ZONE as w,
1327
- UPDATE_SCHEMA as x,
1328
- EDIT_ATTRIBUTE as y,
1329
- ADD_ATTRIBUTE as z
1330
- };
1331
- //# sourceMappingURL=index-97hm9i_H.mjs.map