@strapi/content-manager 0.0.0-experimental.d954d57341a6623992a0d211daaec8e245c3517d → 0.0.0-experimental.dd1d47ef78ef6cfec4ed62576108500bd9f13740
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +18 -3
- package/dist/_chunks/{ComponentConfigurationPage-gdUj_t-O.mjs → ComponentConfigurationPage-BpM_Hc7r.mjs} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-gdUj_t-O.mjs.map → ComponentConfigurationPage-BpM_Hc7r.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-WRPUXGd6.js → ComponentConfigurationPage-CL9CAMaL.js} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-WRPUXGd6.js.map → ComponentConfigurationPage-CL9CAMaL.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-C1vjMBgy.js → EditConfigurationPage-ILWo0h1e.js} +4 -4
- package/dist/_chunks/{EditConfigurationPage-C1vjMBgy.js.map → EditConfigurationPage-ILWo0h1e.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-BwuIPOJG.mjs → EditConfigurationPage-_prbqpTM.mjs} +4 -4
- package/dist/_chunks/{EditConfigurationPage-BwuIPOJG.mjs.map → EditConfigurationPage-_prbqpTM.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-DbcGfyqK.js → EditViewPage-BqZvBN4s.js} +30 -9
- package/dist/_chunks/EditViewPage-BqZvBN4s.js.map +1 -0
- package/dist/_chunks/{EditViewPage-0MiFkXa8.mjs → EditViewPage-DAtscabN.mjs} +30 -9
- package/dist/_chunks/EditViewPage-DAtscabN.mjs.map +1 -0
- package/dist/_chunks/{Field-BG1xu38N.js → Field-CcoQiiz1.js} +520 -156
- package/dist/_chunks/Field-CcoQiiz1.js.map +1 -0
- package/dist/_chunks/{Field-BDMSCcy5.mjs → Field-D-mgn1tH.mjs} +518 -154
- package/dist/_chunks/Field-D-mgn1tH.mjs.map +1 -0
- package/dist/_chunks/{Form-CPVWavB8.mjs → Form-BxyeWiXW.mjs} +40 -18
- package/dist/_chunks/Form-BxyeWiXW.mjs.map +1 -0
- package/dist/_chunks/{Form-9BnFyUjy.js → Form-CmLbZDfi.js} +40 -18
- package/dist/_chunks/Form-CmLbZDfi.js.map +1 -0
- package/dist/_chunks/{History-BVpd8LP3.mjs → History-BOhLaq_g.mjs} +78 -56
- package/dist/_chunks/History-BOhLaq_g.mjs.map +1 -0
- package/dist/_chunks/{History-BWWxLt2Z.js → History-uECUbCZB.js} +77 -55
- package/dist/_chunks/History-uECUbCZB.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-DozVMKcR.mjs → ListConfigurationPage-D0vQez6F.mjs} +21 -9
- package/dist/_chunks/ListConfigurationPage-D0vQez6F.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-6swzjdAZ.js → ListConfigurationPage-D_bBSFNW.js} +21 -9
- package/dist/_chunks/ListConfigurationPage-D_bBSFNW.js.map +1 -0
- package/dist/_chunks/{ListViewPage-BlzfjS2Q.js → ListViewPage-BkZ83b1A.js} +73 -44
- package/dist/_chunks/ListViewPage-BkZ83b1A.js.map +1 -0
- package/dist/_chunks/{ListViewPage-Ds0ulgfG.mjs → ListViewPage-ns-bmy5C.mjs} +71 -42
- package/dist/_chunks/ListViewPage-ns-bmy5C.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-BH11kaKt.mjs → NoContentTypePage-BA5ZKMDR.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-BH11kaKt.mjs.map → NoContentTypePage-BA5ZKMDR.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-D2nCCWEl.js → NoContentTypePage-C1439s4s.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-D2nCCWEl.js.map → NoContentTypePage-C1439s4s.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-BT2Tn0D_.mjs → NoPermissionsPage-B0GdMw1Q.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-BT2Tn0D_.mjs.map → NoPermissionsPage-B0GdMw1Q.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DN_JlsU2.js → NoPermissionsPage-CPGwsVfb.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DN_JlsU2.js.map → NoPermissionsPage-CPGwsVfb.js.map} +1 -1
- package/dist/_chunks/{Relations-Dnag3fhV.mjs → Relations-BIGPMSW4.mjs} +73 -37
- package/dist/_chunks/Relations-BIGPMSW4.mjs.map +1 -0
- package/dist/_chunks/{Relations-CcgFTcWo.js → Relations-d-8Uef_-.js} +72 -36
- package/dist/_chunks/Relations-d-8Uef_-.js.map +1 -0
- package/dist/_chunks/{en-fbKQxLGn.js → en-Bdpa50w3.js} +22 -16
- package/dist/_chunks/{en-fbKQxLGn.js.map → en-Bdpa50w3.js.map} +1 -1
- package/dist/_chunks/{en-Ux26r5pl.mjs → en-CZw4xdPY.mjs} +22 -16
- package/dist/_chunks/{en-Ux26r5pl.mjs.map → en-CZw4xdPY.mjs.map} +1 -1
- package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
- package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
- package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
- package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
- package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
- package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
- package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
- package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
- package/dist/_chunks/{index-JNNNKUHs.mjs → index-3_WeHXYp.mjs} +1084 -663
- package/dist/_chunks/index-3_WeHXYp.mjs.map +1 -0
- package/dist/_chunks/{index-CWpLBSt0.js → index-BgaeYWIy.js} +1073 -651
- package/dist/_chunks/index-BgaeYWIy.js.map +1 -0
- package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
- package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
- package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
- package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
- package/dist/_chunks/{layout--iHdZzRk.js → layout-ByFyQRDH.js} +25 -12
- package/dist/_chunks/layout-ByFyQRDH.js.map +1 -0
- package/dist/_chunks/{layout-DC503LnF.mjs → layout-CrTxOnCy.mjs} +27 -14
- package/dist/_chunks/layout-CrTxOnCy.mjs.map +1 -0
- package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
- package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
- package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
- package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
- package/dist/_chunks/{relations-CTje5t-a.mjs → relations-BlpLgngh.mjs} +3 -7
- package/dist/_chunks/relations-BlpLgngh.mjs.map +1 -0
- package/dist/_chunks/{relations-BbHizA5K.js → relations-C5RSW926.js} +3 -7
- package/dist/_chunks/relations-C5RSW926.js.map +1 -0
- package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
- package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
- package/dist/admin/index.js +2 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +3 -2
- package/dist/admin/src/exports.d.ts +1 -1
- package/dist/admin/src/history/index.d.ts +3 -0
- package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
- package/dist/admin/src/hooks/useDocument.d.ts +32 -1
- package/dist/admin/src/index.d.ts +1 -0
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +20 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +4 -48
- package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
- package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
- package/dist/admin/src/preview/constants.d.ts +1 -0
- package/dist/admin/src/preview/index.d.ts +4 -0
- package/dist/admin/src/preview/services/preview.d.ts +3 -0
- package/dist/admin/src/services/api.d.ts +1 -1
- package/dist/admin/src/services/components.d.ts +2 -2
- package/dist/admin/src/services/contentTypes.d.ts +3 -3
- package/dist/admin/src/services/documents.d.ts +19 -17
- package/dist/admin/src/services/init.d.ts +1 -1
- package/dist/admin/src/services/relations.d.ts +2 -2
- package/dist/admin/src/services/uid.d.ts +3 -3
- package/dist/admin/src/utils/validation.d.ts +4 -1
- package/dist/server/index.js +551 -266
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +552 -267
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/index.d.ts.map +1 -1
- package/dist/server/src/controllers/relations.d.ts.map +1 -1
- package/dist/server/src/controllers/uid.d.ts.map +1 -1
- package/dist/server/src/controllers/utils/metadata.d.ts +15 -1
- package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
- package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -1
- package/dist/server/src/history/services/history.d.ts.map +1 -1
- package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts +4 -4
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +4 -4
- package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
- package/dist/server/src/preview/constants.d.ts +2 -0
- package/dist/server/src/preview/constants.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/index.d.ts +2 -0
- package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/preview.d.ts +13 -0
- package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
- package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
- package/dist/server/src/preview/index.d.ts +4 -0
- package/dist/server/src/preview/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/index.d.ts +8 -0
- package/dist/server/src/preview/routes/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/preview.d.ts +4 -0
- package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
- package/dist/server/src/preview/services/index.d.ts +15 -0
- package/dist/server/src/preview/services/index.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview-config.d.ts +30 -0
- package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview.d.ts +12 -0
- package/dist/server/src/preview/services/preview.d.ts.map +1 -0
- package/dist/server/src/preview/utils.d.ts +18 -0
- package/dist/server/src/preview/utils.d.ts.map +1 -0
- package/dist/server/src/routes/index.d.ts.map +1 -1
- package/dist/server/src/services/document-manager.d.ts.map +1 -1
- package/dist/server/src/services/document-metadata.d.ts +8 -8
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +4 -4
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/permission-checker.d.ts.map +1 -1
- package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
- package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/dist/server/src/utils/index.d.ts +2 -0
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/shared/contracts/collection-types.d.ts +3 -1
- package/dist/shared/contracts/collection-types.d.ts.map +1 -1
- package/dist/shared/contracts/index.d.ts +1 -0
- package/dist/shared/contracts/index.d.ts.map +1 -1
- package/dist/shared/contracts/preview.d.ts +27 -0
- package/dist/shared/contracts/preview.d.ts.map +1 -0
- package/dist/shared/index.js +4 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/index.mjs +4 -0
- package/dist/shared/index.mjs.map +1 -1
- package/package.json +13 -13
- package/dist/_chunks/EditViewPage-0MiFkXa8.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-DbcGfyqK.js.map +0 -1
- package/dist/_chunks/Field-BDMSCcy5.mjs.map +0 -1
- package/dist/_chunks/Field-BG1xu38N.js.map +0 -1
- package/dist/_chunks/Form-9BnFyUjy.js.map +0 -1
- package/dist/_chunks/Form-CPVWavB8.mjs.map +0 -1
- package/dist/_chunks/History-BVpd8LP3.mjs.map +0 -1
- package/dist/_chunks/History-BWWxLt2Z.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-6swzjdAZ.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-DozVMKcR.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-BlzfjS2Q.js.map +0 -1
- package/dist/_chunks/ListViewPage-Ds0ulgfG.mjs.map +0 -1
- package/dist/_chunks/Relations-CcgFTcWo.js.map +0 -1
- package/dist/_chunks/Relations-Dnag3fhV.mjs.map +0 -1
- package/dist/_chunks/index-CWpLBSt0.js.map +0 -1
- package/dist/_chunks/index-JNNNKUHs.mjs.map +0 -1
- package/dist/_chunks/layout--iHdZzRk.js.map +0 -1
- package/dist/_chunks/layout-DC503LnF.mjs.map +0 -1
- package/dist/_chunks/relations-BbHizA5K.js.map +0 -1
- package/dist/_chunks/relations-CTje5t-a.mjs.map +0 -1
- package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
- package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
- package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
- package/strapi-server.js +0 -3
@@ -5,19 +5,19 @@ const strapiAdmin = require("@strapi/admin/strapi-admin");
|
|
5
5
|
const designSystem = require("@strapi/design-system");
|
6
6
|
const pipe$1 = require("lodash/fp/pipe");
|
7
7
|
const reactIntl = require("react-intl");
|
8
|
-
const index = require("./index-
|
8
|
+
const index = require("./index-BgaeYWIy.js");
|
9
9
|
const fractionalIndexing = require("fractional-indexing");
|
10
|
-
const Relations = require("./Relations-
|
10
|
+
const Relations = require("./Relations-d-8Uef_-.js");
|
11
11
|
const Icons = require("@strapi/icons");
|
12
12
|
const styledComponents = require("styled-components");
|
13
13
|
const ComponentIcon = require("./ComponentIcon-BXdiCGQp.js");
|
14
14
|
const reactDndHtml5Backend = require("react-dnd-html5-backend");
|
15
15
|
const useDragAndDrop = require("./useDragAndDrop-J0TUUbR6.js");
|
16
|
-
const objects = require("./objects-
|
16
|
+
const objects = require("./objects-BcXOv6_9.js");
|
17
17
|
const slate = require("slate");
|
18
18
|
const slateHistory = require("slate-history");
|
19
19
|
const slateReact = require("slate-react");
|
20
|
-
const
|
20
|
+
const useDebounce = require("./useDebounce-CtcjDB3L.js");
|
21
21
|
const Toolbar = require("@radix-ui/react-toolbar");
|
22
22
|
const reactRouterDom = require("react-router-dom");
|
23
23
|
const CodeMirror = require("codemirror5");
|
@@ -194,6 +194,220 @@ const useLazyComponents = (componentUids = []) => {
|
|
194
194
|
}, []);
|
195
195
|
return { isLazyLoading: loading, lazyComponentStore, cleanup };
|
196
196
|
};
|
197
|
+
const codeLanguages = [
|
198
|
+
{
|
199
|
+
value: "asm",
|
200
|
+
label: "Assembly"
|
201
|
+
},
|
202
|
+
{
|
203
|
+
value: "bash",
|
204
|
+
label: "Bash"
|
205
|
+
},
|
206
|
+
{
|
207
|
+
value: "c",
|
208
|
+
label: "C"
|
209
|
+
},
|
210
|
+
{
|
211
|
+
value: "clojure",
|
212
|
+
label: "Clojure"
|
213
|
+
},
|
214
|
+
{
|
215
|
+
value: "cobol",
|
216
|
+
label: "COBOL"
|
217
|
+
},
|
218
|
+
{
|
219
|
+
value: "cpp",
|
220
|
+
label: "C++"
|
221
|
+
},
|
222
|
+
{
|
223
|
+
value: "csharp",
|
224
|
+
label: "C#"
|
225
|
+
},
|
226
|
+
{
|
227
|
+
value: "css",
|
228
|
+
label: "CSS"
|
229
|
+
},
|
230
|
+
{
|
231
|
+
value: "dart",
|
232
|
+
label: "Dart"
|
233
|
+
},
|
234
|
+
{
|
235
|
+
value: "dockerfile",
|
236
|
+
label: "Dockerfile"
|
237
|
+
},
|
238
|
+
{
|
239
|
+
value: "elixir",
|
240
|
+
label: "Elixir"
|
241
|
+
},
|
242
|
+
{
|
243
|
+
value: "erlang",
|
244
|
+
label: "Erlang"
|
245
|
+
},
|
246
|
+
{
|
247
|
+
value: "fortran",
|
248
|
+
label: "Fortran"
|
249
|
+
},
|
250
|
+
{
|
251
|
+
value: "fsharp",
|
252
|
+
label: "F#"
|
253
|
+
},
|
254
|
+
{
|
255
|
+
value: "go",
|
256
|
+
label: "Go"
|
257
|
+
},
|
258
|
+
{
|
259
|
+
value: "graphql",
|
260
|
+
label: "GraphQL"
|
261
|
+
},
|
262
|
+
{
|
263
|
+
value: "groovy",
|
264
|
+
label: "Groovy"
|
265
|
+
},
|
266
|
+
{
|
267
|
+
value: "haskell",
|
268
|
+
label: "Haskell"
|
269
|
+
},
|
270
|
+
{
|
271
|
+
value: "haxe",
|
272
|
+
label: "Haxe"
|
273
|
+
},
|
274
|
+
{
|
275
|
+
value: "html",
|
276
|
+
label: "HTML"
|
277
|
+
},
|
278
|
+
{
|
279
|
+
value: "ini",
|
280
|
+
label: "INI"
|
281
|
+
},
|
282
|
+
{
|
283
|
+
value: "java",
|
284
|
+
label: "Java"
|
285
|
+
},
|
286
|
+
{
|
287
|
+
value: "javascript",
|
288
|
+
label: "JavaScript"
|
289
|
+
},
|
290
|
+
{
|
291
|
+
value: "jsx",
|
292
|
+
label: "JavaScript (React)"
|
293
|
+
},
|
294
|
+
{
|
295
|
+
value: "json",
|
296
|
+
label: "JSON"
|
297
|
+
},
|
298
|
+
{
|
299
|
+
value: "julia",
|
300
|
+
label: "Julia"
|
301
|
+
},
|
302
|
+
{
|
303
|
+
value: "kotlin",
|
304
|
+
label: "Kotlin"
|
305
|
+
},
|
306
|
+
{
|
307
|
+
value: "latex",
|
308
|
+
label: "LaTeX"
|
309
|
+
},
|
310
|
+
{
|
311
|
+
value: "lua",
|
312
|
+
label: "Lua"
|
313
|
+
},
|
314
|
+
{
|
315
|
+
value: "markdown",
|
316
|
+
label: "Markdown"
|
317
|
+
},
|
318
|
+
{
|
319
|
+
value: "matlab",
|
320
|
+
label: "MATLAB"
|
321
|
+
},
|
322
|
+
{
|
323
|
+
value: "makefile",
|
324
|
+
label: "Makefile"
|
325
|
+
},
|
326
|
+
{
|
327
|
+
value: "objectivec",
|
328
|
+
label: "Objective-C"
|
329
|
+
},
|
330
|
+
{
|
331
|
+
value: "perl",
|
332
|
+
label: "Perl"
|
333
|
+
},
|
334
|
+
{
|
335
|
+
value: "php",
|
336
|
+
label: "PHP"
|
337
|
+
},
|
338
|
+
{
|
339
|
+
value: "plaintext",
|
340
|
+
label: "Plain text"
|
341
|
+
},
|
342
|
+
{
|
343
|
+
value: "powershell",
|
344
|
+
label: "PowerShell"
|
345
|
+
},
|
346
|
+
{
|
347
|
+
value: "python",
|
348
|
+
label: "Python"
|
349
|
+
},
|
350
|
+
{
|
351
|
+
value: "r",
|
352
|
+
label: "R"
|
353
|
+
},
|
354
|
+
{
|
355
|
+
value: "ruby",
|
356
|
+
label: "Ruby"
|
357
|
+
},
|
358
|
+
{
|
359
|
+
value: "rust",
|
360
|
+
label: "Rust"
|
361
|
+
},
|
362
|
+
{
|
363
|
+
value: "sas",
|
364
|
+
label: "SAS"
|
365
|
+
},
|
366
|
+
{
|
367
|
+
value: "scala",
|
368
|
+
label: "Scala"
|
369
|
+
},
|
370
|
+
{
|
371
|
+
value: "scheme",
|
372
|
+
label: "Scheme"
|
373
|
+
},
|
374
|
+
{
|
375
|
+
value: "shell",
|
376
|
+
label: "Shell"
|
377
|
+
},
|
378
|
+
{
|
379
|
+
value: "sql",
|
380
|
+
label: "SQL"
|
381
|
+
},
|
382
|
+
{
|
383
|
+
value: "stata",
|
384
|
+
label: "Stata"
|
385
|
+
},
|
386
|
+
{
|
387
|
+
value: "swift",
|
388
|
+
label: "Swift"
|
389
|
+
},
|
390
|
+
{
|
391
|
+
value: "typescript",
|
392
|
+
label: "TypeScript"
|
393
|
+
},
|
394
|
+
{
|
395
|
+
value: "tsx",
|
396
|
+
label: "TypeScript (React)"
|
397
|
+
},
|
398
|
+
{
|
399
|
+
value: "vbnet",
|
400
|
+
label: "VB.NET"
|
401
|
+
},
|
402
|
+
{
|
403
|
+
value: "xml",
|
404
|
+
label: "XML"
|
405
|
+
},
|
406
|
+
{
|
407
|
+
value: "yaml",
|
408
|
+
label: "YAML"
|
409
|
+
}
|
410
|
+
];
|
197
411
|
const baseHandleConvert = (editor, attributesToSet) => {
|
198
412
|
const [_, lastNodePath] = slate.Editor.last(editor, []);
|
199
413
|
slate.Transforms.unwrapNodes(editor, {
|
@@ -264,6 +478,7 @@ const CodeBlock = styledComponents.styled.pre`
|
|
264
478
|
overflow: auto;
|
265
479
|
padding: ${({ theme }) => `${theme.spaces[3]} ${theme.spaces[4]}`};
|
266
480
|
flex-shrink: 1;
|
481
|
+
|
267
482
|
& > code {
|
268
483
|
font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas,
|
269
484
|
monospace;
|
@@ -272,9 +487,61 @@ const CodeBlock = styledComponents.styled.pre`
|
|
272
487
|
max-width: 100%;
|
273
488
|
}
|
274
489
|
`;
|
490
|
+
const CodeEditor = (props) => {
|
491
|
+
const { editor } = useBlocksEditorContext("ImageDialog");
|
492
|
+
const editorIsFocused = slateReact.useFocused();
|
493
|
+
const imageIsSelected = slateReact.useSelected();
|
494
|
+
const { formatMessage } = reactIntl.useIntl();
|
495
|
+
const [isSelectOpen, setIsSelectOpen] = React__namespace.useState(false);
|
496
|
+
const shouldDisplayLanguageSelect = editorIsFocused && imageIsSelected || isSelectOpen;
|
497
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { position: "relative", width: "100%", children: [
|
498
|
+
/* @__PURE__ */ jsxRuntime.jsx(CodeBlock, { ...props.attributes, children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: props.children }) }),
|
499
|
+
shouldDisplayLanguageSelect && /* @__PURE__ */ jsxRuntime.jsx(
|
500
|
+
designSystem.Box,
|
501
|
+
{
|
502
|
+
position: "absolute",
|
503
|
+
background: "neutral0",
|
504
|
+
borderColor: "neutral150",
|
505
|
+
borderStyle: "solid",
|
506
|
+
borderWidth: "0.5px",
|
507
|
+
shadow: "tableShadow",
|
508
|
+
top: "100%",
|
509
|
+
marginTop: 1,
|
510
|
+
right: 0,
|
511
|
+
padding: 1,
|
512
|
+
hasRadius: true,
|
513
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
514
|
+
designSystem.SingleSelect,
|
515
|
+
{
|
516
|
+
onChange: (open) => {
|
517
|
+
slate.Transforms.setNodes(
|
518
|
+
editor,
|
519
|
+
{ language: open.toString() },
|
520
|
+
{ match: (node) => !slate.Editor.isEditor(node) && node.type === "code" }
|
521
|
+
);
|
522
|
+
},
|
523
|
+
value: props.element.type === "code" && props.element.language || "plaintext",
|
524
|
+
onOpenChange: (open) => {
|
525
|
+
setIsSelectOpen(open);
|
526
|
+
if (!open) {
|
527
|
+
slateReact.ReactEditor.focus(editor);
|
528
|
+
}
|
529
|
+
},
|
530
|
+
onCloseAutoFocus: (e) => e.preventDefault(),
|
531
|
+
"aria-label": formatMessage({
|
532
|
+
id: "components.Blocks.blocks.code.languageLabel",
|
533
|
+
defaultMessage: "Select a language"
|
534
|
+
}),
|
535
|
+
children: codeLanguages.map(({ value, label }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value, children: label }, value))
|
536
|
+
}
|
537
|
+
)
|
538
|
+
}
|
539
|
+
)
|
540
|
+
] });
|
541
|
+
};
|
275
542
|
const codeBlocks = {
|
276
543
|
code: {
|
277
|
-
renderElement: (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
544
|
+
renderElement: (props) => /* @__PURE__ */ jsxRuntime.jsx(CodeEditor, { ...props }),
|
278
545
|
icon: Icons.Code,
|
279
546
|
label: {
|
280
547
|
id: "components.Blocks.blocks.code",
|
@@ -283,7 +550,7 @@ const codeBlocks = {
|
|
283
550
|
matchNode: (node) => node.type === "code",
|
284
551
|
isInBlocksSelector: true,
|
285
552
|
handleConvert(editor) {
|
286
|
-
baseHandleConvert(editor, { type: "code" });
|
553
|
+
baseHandleConvert(editor, { type: "code", language: "plaintext" });
|
287
554
|
},
|
288
555
|
handleEnterKey(editor) {
|
289
556
|
pressEnterTwiceToExit(editor);
|
@@ -501,7 +768,7 @@ const ImageDialog = () => {
|
|
501
768
|
const nodeImage = {
|
502
769
|
...expectedImage,
|
503
770
|
alternativeText: expectedImage.alternativeText || expectedImage.name,
|
504
|
-
url:
|
771
|
+
url: useDebounce.prefixFileUrlWithBackendUrl(image.url)
|
505
772
|
};
|
506
773
|
return nodeImage;
|
507
774
|
});
|
@@ -627,20 +894,8 @@ const LinkContent = React__namespace.forwardRef(
|
|
627
894
|
const [linkText, setLinkText] = React__namespace.useState(elementText);
|
628
895
|
const [linkUrl, setLinkUrl] = React__namespace.useState(link.url);
|
629
896
|
const linkInputRef = React__namespace.useRef(null);
|
630
|
-
const
|
897
|
+
const isLastInsertedLink = editor.lastInsertedLinkPath ? !slate.Path.equals(path, editor.lastInsertedLinkPath) : true;
|
631
898
|
const [isSaveDisabled, setIsSaveDisabled] = React__namespace.useState(false);
|
632
|
-
const handleOpenChange = (isOpen) => {
|
633
|
-
if (isOpen) {
|
634
|
-
setPopoverOpen(isOpen);
|
635
|
-
setShowRemoveButton(isOpen);
|
636
|
-
} else {
|
637
|
-
setPopoverOpen(isOpen);
|
638
|
-
if (link.url === "") {
|
639
|
-
removeLink(editor);
|
640
|
-
}
|
641
|
-
slateReact.ReactEditor.focus(editor);
|
642
|
-
}
|
643
|
-
};
|
644
899
|
const onLinkChange = (e) => {
|
645
900
|
setIsSaveDisabled(false);
|
646
901
|
setLinkUrl(e.target.value);
|
@@ -661,15 +916,33 @@ const LinkContent = React__namespace.forwardRef(
|
|
661
916
|
editLink(editor, { url: linkUrl, text: linkText });
|
662
917
|
setPopoverOpen(false);
|
663
918
|
editor.lastInsertedLinkPath = null;
|
919
|
+
slateReact.ReactEditor.focus(editor);
|
920
|
+
};
|
921
|
+
const handleClose = () => {
|
922
|
+
if (link.url === "") {
|
923
|
+
removeLink(editor);
|
924
|
+
}
|
925
|
+
setPopoverOpen(false);
|
926
|
+
slateReact.ReactEditor.focus(editor);
|
664
927
|
};
|
665
928
|
React__namespace.useEffect(() => {
|
666
929
|
if (popoverOpen)
|
667
930
|
linkInputRef.current?.focus();
|
668
931
|
}, [popoverOpen]);
|
669
932
|
const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
|
670
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, {
|
671
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
672
|
-
|
933
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, { open: popoverOpen, children: [
|
934
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
935
|
+
StyledBaseLink,
|
936
|
+
{
|
937
|
+
...attributes,
|
938
|
+
ref: forwardedRef,
|
939
|
+
href: link.url,
|
940
|
+
onClick: () => setPopoverOpen(true),
|
941
|
+
color: "primary600",
|
942
|
+
children
|
943
|
+
}
|
944
|
+
) }),
|
945
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { onPointerDownOutside: handleClose, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 4, direction: "column", gap: 4, children: [
|
673
946
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { width: "368px", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, alignItems: "stretch", children: [
|
674
947
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
675
948
|
id: "components.Blocks.popover.text",
|
@@ -715,7 +988,7 @@ const LinkContent = React__namespace.forwardRef(
|
|
715
988
|
{
|
716
989
|
variant: "danger-light",
|
717
990
|
onClick: () => removeLink(editor),
|
718
|
-
$visible:
|
991
|
+
$visible: isLastInsertedLink,
|
719
992
|
children: formatMessage({
|
720
993
|
id: "components.Blocks.popover.remove",
|
721
994
|
defaultMessage: "Remove"
|
@@ -723,11 +996,11 @@ const LinkContent = React__namespace.forwardRef(
|
|
723
996
|
}
|
724
997
|
),
|
725
998
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
726
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick:
|
999
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: handleClose, children: formatMessage({
|
727
1000
|
id: "components.Blocks.popover.cancel",
|
728
1001
|
defaultMessage: "Cancel"
|
729
1002
|
}) }),
|
730
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, {
|
1003
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { disabled: Boolean(inputNotDirty) || isSaveDisabled, onClick: handleSave, children: formatMessage({
|
731
1004
|
id: "components.Blocks.popover.save",
|
732
1005
|
defaultMessage: "Save"
|
733
1006
|
}) })
|
@@ -1168,7 +1441,7 @@ const ToolbarButton = ({
|
|
1168
1441
|
width: 7,
|
1169
1442
|
height: 7,
|
1170
1443
|
hasRadius: true,
|
1171
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, {
|
1444
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { fill: disabled ? "neutral300" : enabledColor })
|
1172
1445
|
}
|
1173
1446
|
)
|
1174
1447
|
}
|
@@ -1313,6 +1586,26 @@ const ListButton = ({ block, format }) => {
|
|
1313
1586
|
}
|
1314
1587
|
return false;
|
1315
1588
|
};
|
1589
|
+
const isListDisabled = () => {
|
1590
|
+
if (disabled) {
|
1591
|
+
return true;
|
1592
|
+
}
|
1593
|
+
if (!editor.selection) {
|
1594
|
+
return false;
|
1595
|
+
}
|
1596
|
+
const anchorNodeEntry = slate.Editor.above(editor, {
|
1597
|
+
at: editor.selection.anchor,
|
1598
|
+
match: (node) => !slate.Editor.isEditor(node) && node.type !== "text"
|
1599
|
+
});
|
1600
|
+
const focusNodeEntry = slate.Editor.above(editor, {
|
1601
|
+
at: editor.selection.focus,
|
1602
|
+
match: (node) => !slate.Editor.isEditor(node) && node.type !== "text"
|
1603
|
+
});
|
1604
|
+
if (!anchorNodeEntry || !focusNodeEntry) {
|
1605
|
+
return false;
|
1606
|
+
}
|
1607
|
+
return anchorNodeEntry[0] !== focusNodeEntry[0];
|
1608
|
+
};
|
1316
1609
|
const toggleList = (format2) => {
|
1317
1610
|
let currentListEntry;
|
1318
1611
|
if (editor.selection) {
|
@@ -1346,7 +1639,7 @@ const ListButton = ({ block, format }) => {
|
|
1346
1639
|
name: format,
|
1347
1640
|
label: block.label,
|
1348
1641
|
isActive: isListActive(),
|
1349
|
-
disabled,
|
1642
|
+
disabled: isListDisabled(),
|
1350
1643
|
handleClick: () => toggleList(format)
|
1351
1644
|
}
|
1352
1645
|
);
|
@@ -1490,6 +1783,7 @@ const DragItem = styledComponents.styled(designSystem.Flex)`
|
|
1490
1783
|
}
|
1491
1784
|
`;
|
1492
1785
|
const DragIconButton = styledComponents.styled(designSystem.IconButton)`
|
1786
|
+
user-select: none;
|
1493
1787
|
display: flex;
|
1494
1788
|
align-items: center;
|
1495
1789
|
justify-content: center;
|
@@ -1513,7 +1807,7 @@ const DragIconButton = styledComponents.styled(designSystem.IconButton)`
|
|
1513
1807
|
}
|
1514
1808
|
svg {
|
1515
1809
|
height: auto;
|
1516
|
-
width: ${({ theme }) => theme.spaces[3]};
|
1810
|
+
min-width: ${({ theme }) => theme.spaces[3]};
|
1517
1811
|
|
1518
1812
|
path {
|
1519
1813
|
fill: ${({ theme }) => theme.colors.neutral700};
|
@@ -1618,6 +1912,7 @@ const DragAndDropElement = ({
|
|
1618
1912
|
DragIconButton,
|
1619
1913
|
{
|
1620
1914
|
tag: "div",
|
1915
|
+
contentEditable: false,
|
1621
1916
|
role: "button",
|
1622
1917
|
tabIndex: 0,
|
1623
1918
|
withTooltip: false,
|
@@ -1630,7 +1925,7 @@ const DragAndDropElement = ({
|
|
1630
1925
|
disabled,
|
1631
1926
|
draggable: true,
|
1632
1927
|
$dragHandleTopMargin: dragHandleTopMargin,
|
1633
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Drag, { color: "
|
1928
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Drag, { color: "primary500" })
|
1634
1929
|
}
|
1635
1930
|
),
|
1636
1931
|
children
|
@@ -1954,7 +2249,7 @@ const EditorLayout$1 = ({
|
|
1954
2249
|
/* @__PURE__ */ jsxRuntime.jsx(
|
1955
2250
|
CollapseIconButton,
|
1956
2251
|
{
|
1957
|
-
|
2252
|
+
label: formatMessage({
|
1958
2253
|
id: index.getTranslation("components.Blocks.collapse"),
|
1959
2254
|
defaultMessage: "Collapse"
|
1960
2255
|
}),
|
@@ -2293,7 +2588,7 @@ const BlocksEditor = React__namespace.forwardRef(
|
|
2293
2588
|
!isExpandedMode && /* @__PURE__ */ jsxRuntime.jsx(
|
2294
2589
|
ExpandIconButton,
|
2295
2590
|
{
|
2296
|
-
|
2591
|
+
label: formatMessage({
|
2297
2592
|
id: index.getTranslation("components.Blocks.expand"),
|
2298
2593
|
defaultMessage: "Expand"
|
2299
2594
|
}),
|
@@ -2359,30 +2654,27 @@ const createDefaultForm = (contentType, components = {}) => {
|
|
2359
2654
|
const Initializer = ({ disabled, name: name2, onClick }) => {
|
2360
2655
|
const { formatMessage } = reactIntl.useIntl();
|
2361
2656
|
const field = strapiAdmin.useField(name2);
|
2362
|
-
return /* @__PURE__ */ jsxRuntime.
|
2363
|
-
|
2364
|
-
|
2365
|
-
|
2366
|
-
|
2367
|
-
|
2368
|
-
|
2369
|
-
|
2370
|
-
|
2371
|
-
|
2372
|
-
|
2373
|
-
|
2374
|
-
|
2375
|
-
|
2376
|
-
|
2377
|
-
|
2378
|
-
|
2379
|
-
|
2380
|
-
|
2381
|
-
|
2382
|
-
|
2383
|
-
),
|
2384
|
-
field.error && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "danger600", variant: "pi", children: field.error })
|
2385
|
-
] });
|
2657
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
2658
|
+
designSystem.Box,
|
2659
|
+
{
|
2660
|
+
tag: "button",
|
2661
|
+
background: "neutral100",
|
2662
|
+
borderColor: field.error ? "danger600" : "neutral200",
|
2663
|
+
hasRadius: true,
|
2664
|
+
disabled,
|
2665
|
+
onClick,
|
2666
|
+
paddingTop: 9,
|
2667
|
+
paddingBottom: 9,
|
2668
|
+
type: "button",
|
2669
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
|
2670
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(CircleIcon, {}) }),
|
2671
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
|
2672
|
+
id: index.getTranslation("components.empty-repeatable"),
|
2673
|
+
defaultMessage: "No entry yet. Click to add one."
|
2674
|
+
}) }) })
|
2675
|
+
] })
|
2676
|
+
}
|
2677
|
+
) });
|
2386
2678
|
};
|
2387
2679
|
const CircleIcon = styledComponents.styled(Icons.PlusCircle)`
|
2388
2680
|
width: 2.4rem;
|
@@ -2416,7 +2708,18 @@ const NonRepeatableComponent = ({
|
|
2416
2708
|
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index2) => {
|
2417
2709
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2418
2710
|
const completeFieldName = `${name2}.${field.name}`;
|
2419
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
2711
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
2712
|
+
designSystem.Grid.Item,
|
2713
|
+
{
|
2714
|
+
col: size,
|
2715
|
+
s: 12,
|
2716
|
+
xs: 12,
|
2717
|
+
direction: "column",
|
2718
|
+
alignItems: "stretch",
|
2719
|
+
children: children({ ...field, name: completeFieldName })
|
2720
|
+
},
|
2721
|
+
completeFieldName
|
2722
|
+
);
|
2420
2723
|
}) }, index2);
|
2421
2724
|
}) })
|
2422
2725
|
}
|
@@ -2435,13 +2738,34 @@ const RepeatableComponent = ({
|
|
2435
2738
|
const { search: searchString } = reactRouterDom.useLocation();
|
2436
2739
|
const search = React__namespace.useMemo(() => new URLSearchParams(searchString), [searchString]);
|
2437
2740
|
const { components } = index.useDoc();
|
2438
|
-
const {
|
2741
|
+
const {
|
2742
|
+
value = [],
|
2743
|
+
error,
|
2744
|
+
rawError
|
2745
|
+
} = strapiAdmin.useField(name2);
|
2439
2746
|
const addFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.addFieldRow);
|
2440
2747
|
const moveFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.moveFieldRow);
|
2441
2748
|
const removeFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.removeFieldRow);
|
2442
2749
|
const { max = Infinity } = attribute;
|
2443
2750
|
const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
|
2444
2751
|
const [liveText, setLiveText] = React__namespace.useState("");
|
2752
|
+
React__namespace.useEffect(() => {
|
2753
|
+
const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;
|
2754
|
+
const hasNestedValue = value && Array.isArray(value) && value.length > 0;
|
2755
|
+
if (hasNestedErrors && hasNestedValue) {
|
2756
|
+
const errorOpenItems = rawError.map((_, idx) => {
|
2757
|
+
return value[idx] ? value[idx].__temp_key__ : null;
|
2758
|
+
}).filter((value2) => !!value2);
|
2759
|
+
if (errorOpenItems && errorOpenItems.length > 0) {
|
2760
|
+
setCollapseToOpen((collapseToOpen2) => {
|
2761
|
+
if (!errorOpenItems.includes(collapseToOpen2)) {
|
2762
|
+
return errorOpenItems[0];
|
2763
|
+
}
|
2764
|
+
return collapseToOpen2;
|
2765
|
+
});
|
2766
|
+
}
|
2767
|
+
}
|
2768
|
+
}, [rawError, value]);
|
2445
2769
|
const componentTmpKeyWithFocussedField = React__namespace.useMemo(() => {
|
2446
2770
|
if (search.has("field")) {
|
2447
2771
|
const fieldParam = search.get("field");
|
@@ -2456,7 +2780,7 @@ const RepeatableComponent = ({
|
|
2456
2780
|
}
|
2457
2781
|
return void 0;
|
2458
2782
|
}, [search, name2, value]);
|
2459
|
-
const prevValue =
|
2783
|
+
const prevValue = useDebounce.usePrev(value);
|
2460
2784
|
React__namespace.useEffect(() => {
|
2461
2785
|
if (prevValue && prevValue.length < value.length) {
|
2462
2786
|
setCollapseToOpen(value[value.length - 1].__temp_key__);
|
@@ -2594,7 +2918,18 @@ const RepeatableComponent = ({
|
|
2594
2918
|
children: layout.map((row, index22) => {
|
2595
2919
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2596
2920
|
const completeFieldName = `${nameWithIndex}.${field.name}`;
|
2597
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
2921
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
2922
|
+
designSystem.Grid.Item,
|
2923
|
+
{
|
2924
|
+
col: size,
|
2925
|
+
s: 12,
|
2926
|
+
xs: 12,
|
2927
|
+
direction: "column",
|
2928
|
+
alignItems: "stretch",
|
2929
|
+
children: children({ ...field, name: completeFieldName })
|
2930
|
+
},
|
2931
|
+
completeFieldName
|
2932
|
+
);
|
2598
2933
|
}) }, index22);
|
2599
2934
|
})
|
2600
2935
|
}
|
@@ -2689,7 +3024,7 @@ const Component = ({
|
|
2689
3024
|
/* @__PURE__ */ jsxRuntime.jsx(
|
2690
3025
|
designSystem.IconButton,
|
2691
3026
|
{
|
2692
|
-
|
3027
|
+
variant: "ghost",
|
2693
3028
|
onClick: onDeleteComponent,
|
2694
3029
|
label: formatMessage({
|
2695
3030
|
id: index.getTranslation("containers.Edit.delete"),
|
@@ -2702,7 +3037,7 @@ const Component = ({
|
|
2702
3037
|
designSystem.IconButton,
|
2703
3038
|
{
|
2704
3039
|
ref: composedAccordionRefs,
|
2705
|
-
|
3040
|
+
variant: "ghost",
|
2706
3041
|
onClick: (e) => e.stopPropagation(),
|
2707
3042
|
"data-handler-id": handlerId,
|
2708
3043
|
label: formatMessage({
|
@@ -2772,7 +3107,7 @@ const ComponentInput = ({
|
|
2772
3107
|
id: index.getTranslation("components.reset-entry"),
|
2773
3108
|
defaultMessage: "Reset Entry"
|
2774
3109
|
}),
|
2775
|
-
|
3110
|
+
variant: "ghost",
|
2776
3111
|
onClick: () => {
|
2777
3112
|
field.onChange(name2, null);
|
2778
3113
|
},
|
@@ -2801,11 +3136,8 @@ const AddComponentButton = ({
|
|
2801
3136
|
onClick,
|
2802
3137
|
disabled: isDisabled,
|
2803
3138
|
background: "neutral0",
|
2804
|
-
paddingTop: 3,
|
2805
|
-
paddingBottom: 3,
|
2806
|
-
paddingLeft: 4,
|
2807
|
-
paddingRight: 4,
|
2808
3139
|
style: { cursor: isDisabled ? "not-allowed" : "pointer" },
|
3140
|
+
variant: "tertiary",
|
2809
3141
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { tag: "span", gap: 2, children: [
|
2810
3142
|
/* @__PURE__ */ jsxRuntime.jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
|
2811
3143
|
/* @__PURE__ */ jsxRuntime.jsx(
|
@@ -2834,10 +3166,11 @@ const StyledAddIcon = styledComponents.styled(Icons.PlusCircle)`
|
|
2834
3166
|
}
|
2835
3167
|
`;
|
2836
3168
|
const AddComponentTitle = styledComponents.styled(designSystem.Typography)``;
|
2837
|
-
const StyledButton = styledComponents.styled(designSystem.
|
3169
|
+
const StyledButton = styledComponents.styled(designSystem.Button)`
|
2838
3170
|
border-radius: 26px;
|
2839
3171
|
border-color: ${({ theme }) => theme.colors.neutral150};
|
2840
3172
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
3173
|
+
height: 5rem;
|
2841
3174
|
|
2842
3175
|
&:hover {
|
2843
3176
|
${AddComponentTitle} {
|
@@ -2849,7 +3182,7 @@ const StyledButton = styledComponents.styled(designSystem.BaseButton)`
|
|
2849
3182
|
fill: ${({ theme }) => theme.colors.primary600};
|
2850
3183
|
}
|
2851
3184
|
> path {
|
2852
|
-
fill: ${({ theme }) => theme.colors.
|
3185
|
+
fill: ${({ theme }) => theme.colors.primary600};
|
2853
3186
|
}
|
2854
3187
|
}
|
2855
3188
|
}
|
@@ -2980,18 +3313,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
|
|
2980
3313
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
|
2981
3314
|
] });
|
2982
3315
|
};
|
2983
|
-
function useDebounce(value, delay) {
|
2984
|
-
const [debouncedValue, setDebouncedValue] = React.useState(value);
|
2985
|
-
React.useEffect(() => {
|
2986
|
-
const handler = setTimeout(() => {
|
2987
|
-
setDebouncedValue(value);
|
2988
|
-
}, delay);
|
2989
|
-
return () => {
|
2990
|
-
clearTimeout(handler);
|
2991
|
-
};
|
2992
|
-
}, [value, delay]);
|
2993
|
-
return debouncedValue;
|
2994
|
-
}
|
2995
3316
|
const uidApi = index.contentManagerApi.injectEndpoints({
|
2996
3317
|
endpoints: (builder) => ({
|
2997
3318
|
getDefaultUID: builder.query({
|
@@ -3026,7 +3347,10 @@ const uidApi = index.contentManagerApi.injectEndpoints({
|
|
3026
3347
|
config: {
|
3027
3348
|
params
|
3028
3349
|
}
|
3029
|
-
})
|
3350
|
+
}),
|
3351
|
+
providesTags: (_res, _error, params) => [
|
3352
|
+
{ type: "UidAvailability", id: params.contentTypeUID }
|
3353
|
+
]
|
3030
3354
|
})
|
3031
3355
|
})
|
3032
3356
|
});
|
@@ -3038,8 +3362,10 @@ const UIDInput = React__namespace.forwardRef(
|
|
3038
3362
|
const allFormValues = strapiAdmin.useForm("InputUID", (form) => form.values);
|
3039
3363
|
const [availability, setAvailability] = React__namespace.useState();
|
3040
3364
|
const [showRegenerate, setShowRegenerate] = React__namespace.useState(false);
|
3365
|
+
const isCloning = reactRouterDom.useMatch(index.CLONE_PATH) !== null;
|
3041
3366
|
const field = strapiAdmin.useField(name2);
|
3042
|
-
const debouncedValue = useDebounce(field.value, 300);
|
3367
|
+
const debouncedValue = useDebounce.useDebounce(field.value, 300);
|
3368
|
+
const hasChanged = debouncedValue !== field.initialValue;
|
3043
3369
|
const { toggleNotification } = strapiAdmin.useNotification();
|
3044
3370
|
const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
3045
3371
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -3115,8 +3441,9 @@ const UIDInput = React__namespace.forwardRef(
|
|
3115
3441
|
params
|
3116
3442
|
},
|
3117
3443
|
{
|
3444
|
+
// Don't check availability if the value is empty or wasn't changed
|
3118
3445
|
skip: !Boolean(
|
3119
|
-
|
3446
|
+
(hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())
|
3120
3447
|
)
|
3121
3448
|
}
|
3122
3449
|
);
|
@@ -3145,6 +3472,7 @@ const UIDInput = React__namespace.forwardRef(
|
|
3145
3472
|
const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
|
3146
3473
|
const fieldRef = strapiAdmin.useFocusInputField(name2);
|
3147
3474
|
const composedRefs = designSystem.useComposedRefs(ref, fieldRef);
|
3475
|
+
const shouldShowAvailability = (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;
|
3148
3476
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { hint, name: name2, error: field.error, required, children: [
|
3149
3477
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: labelAction, children: label }),
|
3150
3478
|
/* @__PURE__ */ jsxRuntime.jsx(
|
@@ -3153,7 +3481,7 @@ const UIDInput = React__namespace.forwardRef(
|
|
3153
3481
|
ref: composedRefs,
|
3154
3482
|
disabled: props.disabled,
|
3155
3483
|
endAction: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { position: "relative", gap: 1, children: [
|
3156
|
-
|
3484
|
+
shouldShowAvailability && /* @__PURE__ */ jsxRuntime.jsxs(
|
3157
3485
|
TextValidation,
|
3158
3486
|
{
|
3159
3487
|
alignItems: "center",
|
@@ -3987,7 +4315,7 @@ const EditorLayout = ({
|
|
3987
4315
|
justifyContent: "flex-end",
|
3988
4316
|
shrink: 0,
|
3989
4317
|
width: "100%",
|
3990
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, children: [
|
4318
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, variant: "tertiary", size: "M", children: [
|
3991
4319
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
3992
4320
|
id: "components.Wysiwyg.collapse",
|
3993
4321
|
defaultMessage: "Collapse"
|
@@ -4005,12 +4333,14 @@ const EditorLayout = ({
|
|
4005
4333
|
) }) });
|
4006
4334
|
}
|
4007
4335
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
4008
|
-
designSystem.
|
4336
|
+
designSystem.Flex,
|
4009
4337
|
{
|
4010
4338
|
borderColor: error ? "danger600" : "neutral200",
|
4011
4339
|
borderStyle: "solid",
|
4012
4340
|
borderWidth: "1px",
|
4013
4341
|
hasRadius: true,
|
4342
|
+
direction: "column",
|
4343
|
+
alignItems: "stretch",
|
4014
4344
|
children
|
4015
4345
|
}
|
4016
4346
|
);
|
@@ -4021,11 +4351,19 @@ const ExpandWrapper = styledComponents.styled(designSystem.Flex)`
|
|
4021
4351
|
const BoxWithBorder = styledComponents.styled(designSystem.Box)`
|
4022
4352
|
border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
|
4023
4353
|
`;
|
4024
|
-
const ExpandButton$1 = styledComponents.styled(designSystem.
|
4354
|
+
const ExpandButton$1 = styledComponents.styled(designSystem.Button)`
|
4025
4355
|
background-color: transparent;
|
4026
4356
|
border: none;
|
4027
4357
|
align-items: center;
|
4028
4358
|
|
4359
|
+
& > span {
|
4360
|
+
display: flex;
|
4361
|
+
justify-content: space-between;
|
4362
|
+
align-items: center;
|
4363
|
+
width: 100%;
|
4364
|
+
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
4365
|
+
}
|
4366
|
+
|
4029
4367
|
svg {
|
4030
4368
|
margin-left: ${({ theme }) => `${theme.spaces[2]}`};
|
4031
4369
|
|
@@ -4292,40 +4630,28 @@ const quoteAndCodeHandler = (editor, markdownType) => {
|
|
4292
4630
|
insertWithoutTextToEdit(editor, markdownType, line, contentLength);
|
4293
4631
|
}
|
4294
4632
|
};
|
4295
|
-
const CustomIconButton = styledComponents.styled(designSystem.IconButton)`
|
4296
|
-
padding: ${({ theme }) => theme.spaces[2]};
|
4297
|
-
|
4298
|
-
svg {
|
4299
|
-
width: 1.8rem;
|
4300
|
-
height: 1.8rem;
|
4301
|
-
}
|
4302
|
-
`;
|
4303
|
-
const CustomLinkIconButton = styledComponents.styled(CustomIconButton)`
|
4304
|
-
svg {
|
4305
|
-
width: 0.8rem;
|
4306
|
-
height: 0.8rem;
|
4307
|
-
}
|
4308
|
-
`;
|
4309
4633
|
const MainButtons = styledComponents.styled(designSystem.IconButtonGroup)`
|
4310
4634
|
margin-left: ${({ theme }) => theme.spaces[4]};
|
4311
4635
|
`;
|
4312
4636
|
const MoreButton = styledComponents.styled(designSystem.IconButton)`
|
4313
4637
|
margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
|
4314
|
-
padding: ${({ theme }) => theme.spaces[2]};
|
4315
|
-
|
4316
|
-
svg {
|
4317
|
-
width: 1.8rem;
|
4318
|
-
height: 1.8rem;
|
4319
|
-
}
|
4320
4638
|
`;
|
4321
4639
|
const IconButtonGroupMargin = styledComponents.styled(designSystem.IconButtonGroup)`
|
4322
4640
|
margin-right: ${({ theme }) => `${theme.spaces[2]}`};
|
4323
4641
|
`;
|
4324
|
-
const ExpandButton = styledComponents.styled(designSystem.
|
4642
|
+
const ExpandButton = styledComponents.styled(designSystem.Button)`
|
4325
4643
|
background-color: transparent;
|
4326
4644
|
border: none;
|
4327
4645
|
align-items: center;
|
4328
4646
|
|
4647
|
+
& > span {
|
4648
|
+
display: flex;
|
4649
|
+
justify-content: space-between;
|
4650
|
+
align-items: center;
|
4651
|
+
width: 100%;
|
4652
|
+
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
4653
|
+
}
|
4654
|
+
|
4329
4655
|
svg {
|
4330
4656
|
margin-left: ${({ theme }) => `${theme.spaces[2]}`};
|
4331
4657
|
path {
|
@@ -4337,8 +4663,8 @@ const ExpandButton = styledComponents.styled(designSystem.BaseButton)`
|
|
4337
4663
|
`;
|
4338
4664
|
const WysiwygFooter = ({ onToggleExpand }) => {
|
4339
4665
|
const { formatMessage } = reactIntl.useIntl();
|
4340
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, children: [
|
4341
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
4666
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, variant: "tertiary", size: "M", children: [
|
4667
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: formatMessage({
|
4342
4668
|
id: "components.WysiwygBottomControls.fullscreen",
|
4343
4669
|
defaultMessage: "Expand"
|
4344
4670
|
}) }),
|
@@ -4374,18 +4700,27 @@ const WysiwygNav = ({
|
|
4374
4700
|
borderRadius: `0.4rem 0.4rem 0 0`,
|
4375
4701
|
children: [
|
4376
4702
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
|
4377
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
4378
|
-
|
4379
|
-
|
4380
|
-
|
4381
|
-
|
4382
|
-
|
4383
|
-
|
4384
|
-
|
4703
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
4704
|
+
designSystem.SingleSelect,
|
4705
|
+
{
|
4706
|
+
disabled: true,
|
4707
|
+
placeholder: selectPlaceholder,
|
4708
|
+
"aria-label": selectPlaceholder,
|
4709
|
+
size: "S",
|
4710
|
+
children: [
|
4711
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
|
4712
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
|
4713
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h3", children: "h3" }),
|
4714
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h4", children: "h4" }),
|
4715
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h5", children: "h5" }),
|
4716
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h6", children: "h6" })
|
4717
|
+
]
|
4718
|
+
}
|
4719
|
+
) }),
|
4385
4720
|
/* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
|
4386
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4387
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4388
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4721
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
|
4722
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
|
4723
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {}) })
|
4389
4724
|
] }),
|
4390
4725
|
/* @__PURE__ */ jsxRuntime.jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.More, {}) })
|
4391
4726
|
] }),
|
@@ -4412,6 +4747,7 @@ const WysiwygNav = ({
|
|
4412
4747
|
placeholder: selectPlaceholder,
|
4413
4748
|
"aria-label": selectPlaceholder,
|
4414
4749
|
onChange: (value) => onActionClick(value, editorRef),
|
4750
|
+
size: "S",
|
4415
4751
|
children: [
|
4416
4752
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
|
4417
4753
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
|
@@ -4423,17 +4759,9 @@ const WysiwygNav = ({
|
|
4423
4759
|
}
|
4424
4760
|
) }),
|
4425
4761
|
/* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
|
4762
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
|
4426
4763
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4427
|
-
|
4428
|
-
{
|
4429
|
-
onClick: () => onActionClick("Bold", editorRef),
|
4430
|
-
label: "Bold",
|
4431
|
-
name: "Bold",
|
4432
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {})
|
4433
|
-
}
|
4434
|
-
),
|
4435
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4436
|
-
CustomIconButton,
|
4764
|
+
designSystem.IconButton,
|
4437
4765
|
{
|
4438
4766
|
onClick: () => onActionClick("Italic", editorRef),
|
4439
4767
|
label: "Italic",
|
@@ -4442,7 +4770,7 @@ const WysiwygNav = ({
|
|
4442
4770
|
}
|
4443
4771
|
),
|
4444
4772
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4445
|
-
|
4773
|
+
designSystem.IconButton,
|
4446
4774
|
{
|
4447
4775
|
onClick: () => onActionClick("Underline", editorRef),
|
4448
4776
|
label: "Underline",
|
@@ -4456,7 +4784,7 @@ const WysiwygNav = ({
|
|
4456
4784
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 2, children: [
|
4457
4785
|
/* @__PURE__ */ jsxRuntime.jsxs(IconButtonGroupMargin, { children: [
|
4458
4786
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4459
|
-
|
4787
|
+
designSystem.IconButton,
|
4460
4788
|
{
|
4461
4789
|
onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
|
4462
4790
|
label: "Strikethrough",
|
@@ -4465,7 +4793,7 @@ const WysiwygNav = ({
|
|
4465
4793
|
}
|
4466
4794
|
),
|
4467
4795
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4468
|
-
|
4796
|
+
designSystem.IconButton,
|
4469
4797
|
{
|
4470
4798
|
onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
|
4471
4799
|
label: "BulletList",
|
@@ -4474,7 +4802,7 @@ const WysiwygNav = ({
|
|
4474
4802
|
}
|
4475
4803
|
),
|
4476
4804
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4477
|
-
|
4805
|
+
designSystem.IconButton,
|
4478
4806
|
{
|
4479
4807
|
onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
|
4480
4808
|
label: "NumberList",
|
@@ -4485,7 +4813,7 @@ const WysiwygNav = ({
|
|
4485
4813
|
] }),
|
4486
4814
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.IconButtonGroup, { children: [
|
4487
4815
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4488
|
-
|
4816
|
+
designSystem.IconButton,
|
4489
4817
|
{
|
4490
4818
|
onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
|
4491
4819
|
label: "Code",
|
@@ -4494,7 +4822,7 @@ const WysiwygNav = ({
|
|
4494
4822
|
}
|
4495
4823
|
),
|
4496
4824
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4497
|
-
|
4825
|
+
designSystem.IconButton,
|
4498
4826
|
{
|
4499
4827
|
onClick: () => {
|
4500
4828
|
handleTogglePopover();
|
@@ -4506,7 +4834,7 @@ const WysiwygNav = ({
|
|
4506
4834
|
}
|
4507
4835
|
),
|
4508
4836
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4509
|
-
|
4837
|
+
designSystem.IconButton,
|
4510
4838
|
{
|
4511
4839
|
onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
|
4512
4840
|
label: "Link",
|
@@ -4515,7 +4843,7 @@ const WysiwygNav = ({
|
|
4515
4843
|
}
|
4516
4844
|
),
|
4517
4845
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4518
|
-
|
4846
|
+
designSystem.IconButton,
|
4519
4847
|
{
|
4520
4848
|
onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
|
4521
4849
|
label: "Quote",
|
@@ -4593,7 +4921,7 @@ const Wysiwyg = React__namespace.forwardRef(
|
|
4593
4921
|
const handleSelectAssets = (files) => {
|
4594
4922
|
const formattedFiles = files.map((f) => ({
|
4595
4923
|
alt: f.alternativeText || f.name,
|
4596
|
-
url:
|
4924
|
+
url: useDebounce.prefixFileUrlWithBackendUrl(f.url),
|
4597
4925
|
mime: f.mime
|
4598
4926
|
}));
|
4599
4927
|
insertFile(editorRef, formattedFiles);
|
@@ -4652,15 +4980,19 @@ const Wysiwyg = React__namespace.forwardRef(
|
|
4652
4980
|
);
|
4653
4981
|
const MemoizedWysiwyg = React__namespace.memo(Wysiwyg);
|
4654
4982
|
const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
4655
|
-
const { id } = index.useDoc();
|
4983
|
+
const { id, document: document2, collectionType } = index.useDoc();
|
4656
4984
|
const isFormDisabled = strapiAdmin.useForm("InputRenderer", (state) => state.disabled);
|
4657
4985
|
const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
|
4658
4986
|
const canCreateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
|
4659
4987
|
const canReadFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
|
4660
4988
|
const canUpdateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
|
4661
4989
|
const canUserAction = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
|
4662
|
-
|
4663
|
-
|
4990
|
+
let idToCheck = id;
|
4991
|
+
if (collectionType === index.SINGLE_TYPES) {
|
4992
|
+
idToCheck = document2?.documentId;
|
4993
|
+
}
|
4994
|
+
const editableFields = idToCheck ? canUpdateFields : canCreateFields;
|
4995
|
+
const readableFields = idToCheck ? canReadFields : canCreateFields;
|
4664
4996
|
const canUserReadField = canUserAction(props.name, readableFields, props.type);
|
4665
4997
|
const canUserEditField = canUserAction(props.name, editableFields, props.type);
|
4666
4998
|
const fields = strapiAdmin.useStrapiApp("InputRenderer", (app) => app.fields);
|
@@ -4671,6 +5003,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4671
5003
|
const {
|
4672
5004
|
edit: { components }
|
4673
5005
|
} = index.useDocLayout();
|
5006
|
+
const field = strapiAdmin.useField(props.name);
|
4674
5007
|
if (!visible) {
|
4675
5008
|
return null;
|
4676
5009
|
}
|
@@ -4681,7 +5014,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4681
5014
|
if (attributeHasCustomFieldProperty(props.attribute)) {
|
4682
5015
|
const CustomInput = lazyComponentStore[props.attribute.customField];
|
4683
5016
|
if (CustomInput) {
|
4684
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
|
5017
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
|
4685
5018
|
}
|
4686
5019
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
4687
5020
|
strapiAdmin.InputRenderer,
|
@@ -4751,7 +5084,9 @@ const useFieldHint = (hint = void 0, attribute) => {
|
|
4751
5084
|
if (!maximum && !minimum) {
|
4752
5085
|
return hint;
|
4753
5086
|
}
|
4754
|
-
const units = !["biginteger", "integer", "number"].includes(
|
5087
|
+
const units = !["biginteger", "integer", "number", "dynamiczone", "component"].includes(
|
5088
|
+
attribute.type
|
5089
|
+
) ? formatMessage(
|
4755
5090
|
{
|
4756
5091
|
id: "content-manager.form.Input.hint.character.unit",
|
4757
5092
|
defaultMessage: "{maxValue, plural, one { character} other { characters}}"
|
@@ -4840,12 +5175,20 @@ const DynamicComponent = ({
|
|
4840
5175
|
React__namespace.useEffect(() => {
|
4841
5176
|
dragPreviewRef(reactDndHtml5Backend.getEmptyImage(), { captureDraggingState: false });
|
4842
5177
|
}, [dragPreviewRef, index$1]);
|
5178
|
+
const accordionValue = React__namespace.useId();
|
5179
|
+
const { value = [], rawError } = strapiAdmin.useField(`${name2}.${index$1}`);
|
5180
|
+
const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
|
5181
|
+
React__namespace.useEffect(() => {
|
5182
|
+
if (rawError && value) {
|
5183
|
+
setCollapseToOpen(accordionValue);
|
5184
|
+
}
|
5185
|
+
}, [rawError, value, accordionValue]);
|
4843
5186
|
const composedBoxRefs = designSystem.useComposedRefs(boxRef, dropRef);
|
4844
5187
|
const accordionActions = disabled ? null : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
4845
5188
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4846
5189
|
designSystem.IconButton,
|
4847
5190
|
{
|
4848
|
-
|
5191
|
+
variant: "ghost",
|
4849
5192
|
label: formatMessage(
|
4850
5193
|
{
|
4851
5194
|
id: index.getTranslation("components.DynamicZone.delete-label"),
|
@@ -4860,7 +5203,7 @@ const DynamicComponent = ({
|
|
4860
5203
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4861
5204
|
designSystem.IconButton,
|
4862
5205
|
{
|
4863
|
-
|
5206
|
+
variant: "ghost",
|
4864
5207
|
onClick: (e) => e.stopPropagation(),
|
4865
5208
|
"data-handler-id": handlerId,
|
4866
5209
|
ref: dragRef,
|
@@ -4905,10 +5248,9 @@ const DynamicComponent = ({
|
|
4905
5248
|
] })
|
4906
5249
|
] });
|
4907
5250
|
const accordionTitle = title ? `${displayName} ${title}` : displayName;
|
4908
|
-
const accordionValue = React__namespace.useId();
|
4909
5251
|
return /* @__PURE__ */ jsxRuntime.jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
|
4910
5252
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Rectangle, { background: "neutral200" }) }),
|
4911
|
-
/* @__PURE__ */ jsxRuntime.jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsxRuntime.jsx(Preview, {}) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: accordionValue, children: [
|
5253
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsxRuntime.jsx(Preview, {}) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Root, { value: collapseToOpen, onValueChange: setCollapseToOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: accordionValue, children: [
|
4912
5254
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Header, { children: [
|
4913
5255
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4914
5256
|
designSystem.Accordion.Trigger,
|
@@ -4919,10 +5261,32 @@ const DynamicComponent = ({
|
|
4919
5261
|
),
|
4920
5262
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Actions, { children: accordionActions })
|
4921
5263
|
] }),
|
4922
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children:
|
4923
|
-
|
4924
|
-
|
4925
|
-
|
5264
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsxRuntime.jsx(
|
5265
|
+
designSystem.Grid.Item,
|
5266
|
+
{
|
5267
|
+
col: 12,
|
5268
|
+
s: 12,
|
5269
|
+
xs: 12,
|
5270
|
+
direction: "column",
|
5271
|
+
alignItems: "stretch",
|
5272
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
5273
|
+
const fieldName = `${name2}.${index$1}.${field.name}`;
|
5274
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
5275
|
+
designSystem.Grid.Item,
|
5276
|
+
{
|
5277
|
+
col: size,
|
5278
|
+
s: 12,
|
5279
|
+
xs: 12,
|
5280
|
+
direction: "column",
|
5281
|
+
alignItems: "stretch",
|
5282
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...field, name: fieldName })
|
5283
|
+
},
|
5284
|
+
fieldName
|
5285
|
+
);
|
5286
|
+
}) })
|
5287
|
+
},
|
5288
|
+
rowInd
|
5289
|
+
)) }) }) }) })
|
4926
5290
|
] }) }) })
|
4927
5291
|
] });
|
4928
5292
|
};
|
@@ -5114,7 +5478,7 @@ const DynamicZone = ({
|
|
5114
5478
|
const handleRemoveComponent = (name22, currentIndex) => () => {
|
5115
5479
|
removeFieldRow(name22, currentIndex);
|
5116
5480
|
};
|
5117
|
-
const hasError = error !== void 0
|
5481
|
+
const hasError = error !== void 0;
|
5118
5482
|
const renderButtonLabel = () => {
|
5119
5483
|
if (addComponentIsOpen) {
|
5120
5484
|
return formatMessage({ id: "app.utils.close-label", defaultMessage: "Close" });
|
@@ -5228,4 +5592,4 @@ exports.transformDocument = transformDocument;
|
|
5228
5592
|
exports.useDynamicZone = useDynamicZone;
|
5229
5593
|
exports.useFieldHint = useFieldHint;
|
5230
5594
|
exports.useLazyComponents = useLazyComponents;
|
5231
|
-
//# sourceMappingURL=Field-
|
5595
|
+
//# sourceMappingURL=Field-CcoQiiz1.js.map
|