@strapi/admin 4.9.0-exp.90df253ba90fd6879eb56a720a1f80d04ff745b8 → 4.9.1
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/.eslintignore +4 -0
- package/.eslintrc.js +14 -0
- package/admin/src/components/LocalesProvider/__mocks__/useLocalesProvider.js +7 -0
- package/admin/src/content-manager/components/DynamicZone/utils/select.js +1 -1
- package/admin/src/content-manager/components/EditViewDataManagerProvider/reducer.js +3 -1
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/findAllAndReplace.js +10 -3
- package/admin/src/content-manager/components/FieldComponent/utils/select.js +2 -1
- package/admin/src/content-manager/components/InputUID/endActionStyle.js +4 -13
- package/admin/src/content-manager/components/InputUID/index.js +94 -71
- package/admin/src/content-manager/components/Inputs/utils/getInputType.js +1 -1
- package/admin/src/content-manager/components/Inputs/utils/select.js +1 -1
- package/admin/src/content-manager/hooks/useContentTypeLayout/index.js +1 -2
- package/admin/src/content-manager/hooks/useFetchContentTypeLayout/utils/formatLayouts.js +4 -1
- package/admin/src/content-manager/pages/App/index.js +2 -2
- package/admin/src/content-manager/pages/CollectionTypeRecursivePath/index.js +1 -2
- package/admin/src/content-manager/pages/EditSettingsView/init.js +3 -1
- package/admin/src/content-manager/pages/EditSettingsView/utils/createPossibleMainFieldsForModelsAndComponents.js +2 -4
- package/admin/src/content-manager/pages/EditView/DeleteLink/utils/select.js +1 -1
- package/admin/src/content-manager/pages/EditView/utils/createAttributesLayout.js +2 -1
- package/admin/src/content-manager/pages/EditView/utils/getFieldsActionMatchingPermissions.js +2 -1
- package/admin/src/content-manager/utils/checkIfAttributeIsDisplayable.js +1 -1
- package/admin/src/content-manager/utils/createDefaultForm.js +2 -2
- package/admin/src/content-manager/utils/formatLayoutToApi.js +2 -1
- package/admin/src/content-manager/utils/getFieldName.js +1 -1
- package/admin/src/content-manager/utils/mergeMetasWithSchema.js +1 -1
- package/admin/src/content-manager/utils/paths.js +1 -1
- package/admin/src/content-manager/utils/removePasswordFieldsFromData.js +1 -1
- package/admin/src/hooks/useConfigurations/__mocks__/index.js +7 -0
- package/admin/src/hooks/useRegenerate/index.js +12 -7
- package/admin/src/hooks/useSettingsForm/index.js +3 -3
- package/admin/src/hooks/useSettingsForm/reducer.js +3 -1
- package/admin/src/hooks/useSettingsMenu/reducer.js +1 -1
- package/admin/src/pages/AuthPage/components/Register/index.js +46 -38
- package/admin/src/pages/AuthPage/reducer.js +1 -1
- package/admin/src/pages/MarketplacePage/components/EmptyNpmPackageSearch/index.js +2 -2
- package/admin/src/pages/SettingsPage/components/Tokens/FormHead/index.js +4 -0
- package/admin/src/pages/SettingsPage/components/Tokens/Regenerate/index.js +5 -3
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/CollapsableContentType/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/reducer.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/utils/transformPermissionsData.js +6 -8
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ConditionsModal/utils/createDefaultConditionsForm.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/Collapse/utils/generateCheckboxesActions.js +2 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ContentTypeCollapse/CollapsePropertyMatrix/ActionRow/utils/getRowLabelCheckboxeState.js +2 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/GlobalActions/utils/getRowLabelCheckboxesState.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/reducer.js +6 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/createDefaultCTFormFromLayout.js +5 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/createDefaultPluginsFormFromLayout.js +1 -2
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/formatContentTypesPermissionToAPI.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/updateConditionsToFalse.js +4 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/Permissions/utils/updateValues.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/PluginsAndSettings/SubCategory/utils/formatActions.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/utils/createArrayOfValues.js +2 -1
- package/admin/src/pages/SettingsPage/pages/Roles/ListPage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/index.js +47 -5
- package/admin/src/pages/SettingsPage/pages/TransferTokens/ListView/index.js +27 -5
- package/admin/src/pages/SettingsPage/pages/Users/ProtectedEditPage/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/utils/formatData.js +1 -7
- package/admin/src/permissions/index.js +1 -1
- package/admin/src/translations/en.json +1 -0
- package/admin/src/utils/getAttributesToDisplay.js +2 -4
- package/admin/src/utils/getExistingActions.js +1 -3
- package/admin/src/utils/sortLinks.js +1 -1
- package/build/1387.84b454d3.chunk.js +1 -0
- package/build/1657.45231968.chunk.js +168 -0
- package/build/3081.bcf9a12f.chunk.js +108 -0
- package/build/462.8fff7f3b.chunk.js +71 -0
- package/build/4628.20631dd1.chunk.js +1 -0
- package/build/5542.b8240e3f.chunk.js +70 -0
- package/build/5563.905daa13.chunk.js +79 -0
- package/build/6404.68405699.chunk.js +100 -0
- package/build/7259.b7d00cea.chunk.js +1 -0
- package/build/8694.6522968d.chunk.js +247 -0
- package/build/9347.058ddb22.chunk.js +1 -0
- package/build/Admin-authenticatedApp.a168aa38.chunk.js +79 -0
- package/build/Admin_InternalErrorPage.15c6bf07.chunk.js +1 -0
- package/build/Admin_homePage.da2181fe.chunk.js +73 -0
- package/build/Admin_marketplace.99e25059.chunk.js +31 -0
- package/build/Admin_pluginsPage.f6b52ee9.chunk.js +6 -0
- package/build/Admin_profilePage.9112cffc.chunk.js +15 -0
- package/build/Admin_settingsPage.cb63220f.chunk.js +79 -0
- package/build/Upload_ConfigureTheView.eaaec495.chunk.js +1 -0
- package/build/admin-app.8cde5b22.chunk.js +110 -0
- package/build/admin-edit-roles-page.4f1858e9.chunk.js +280 -0
- package/build/admin-edit-users.7e14d85f.chunk.js +10 -0
- package/build/admin-roles-list.97e198f9.chunk.js +31 -0
- package/build/admin-users.d02de059.chunk.js +34 -0
- package/build/api-tokens-create-page.97595e12.chunk.js +1 -0
- package/build/api-tokens-edit-page.cd36e30e.chunk.js +1 -0
- package/build/api-tokens-list-page.6757c7b9.chunk.js +16 -0
- package/build/audit-logs-settings-page.ca9a3c46.chunk.js +76 -0
- package/build/content-manager.ba088a66.chunk.js +1132 -0
- package/build/content-type-builder-list-view.9c2c020c.chunk.js +214 -0
- package/build/content-type-builder.fef159db.chunk.js +126 -0
- package/build/email-settings-page.1095e1ab.chunk.js +10 -0
- package/build/{en-json.01a88a30.chunk.js → en-json.b052667a.chunk.js} +1 -1
- package/build/{highlight.js.26ef649f.chunk.js → highlight.js.28a1547e.chunk.js} +2 -2
- package/build/i18n-settings-page.7d80aae0.chunk.js +60 -0
- package/build/index.html +1 -1
- package/build/main.0df5f5ca.js +2280 -0
- package/build/{runtime~main.a40b1b57.js → runtime~main.03cdff31.js} +2 -2
- package/build/sso-settings-page.1dd4886e.chunk.js +1 -0
- package/build/transfer-tokens-create-page.ec2ca215.chunk.js +1 -0
- package/build/transfer-tokens-edit-page.22bf28e5.chunk.js +1 -0
- package/build/transfer-tokens-list-page.cf8c77f2.chunk.js +16 -0
- package/build/upload-settings.945fdcfa.chunk.js +13 -0
- package/build/upload-translation-fr-json.baab9911.chunk.js +1 -0
- package/build/{upload-translation-th-json.3847dae0.chunk.js → upload-translation-th-json.98d35574.chunk.js} +1 -1
- package/build/upload.a86b1054.chunk.js +33 -0
- package/build/users-advanced-settings-page.5b5a9baa.chunk.js +8 -0
- package/build/users-email-settings-page.e5506eb4.chunk.js +23 -0
- package/build/users-providers-settings-page.e32089c2.chunk.js +28 -0
- package/build/users-roles-settings-page.9359e4d1.chunk.js +30 -0
- package/build/webhook-edit-page.213f0075.chunk.js +75 -0
- package/build/webhook-list-page.5beb2a5c.chunk.js +71 -0
- package/ee/server/bootstrap.js +3 -0
- package/ee/server/register.js +3 -2
- package/ee/server/services/audit-logs.js +75 -16
- package/ee/server/utils/persisted-tables.js +49 -0
- package/jest.config.front.js +1 -6
- package/package.json +27 -25
- package/server/middlewares/data-transfer.js +4 -1
- package/server/services/permission/permissions-manager/sanitize.js +2 -0
- package/webpack.config.js +1 -1
- package/build/2637.679b590b.chunk.js +0 -1
- package/build/4049.64715f20.chunk.js +0 -1
- package/build/5563.451e91ee.chunk.js +0 -30
- package/build/7112.2bf13da3.chunk.js +0 -14
- package/build/7259.7744297b.chunk.js +0 -1
- package/build/8469.853c822b.chunk.js +0 -1
- package/build/8580.b0dcf37c.chunk.js +0 -98
- package/build/9816.01ee964f.chunk.js +0 -2
- package/build/Admin-authenticatedApp.5aa08bf5.chunk.js +0 -79
- package/build/Admin_InternalErrorPage.4ad8b0df.chunk.js +0 -1
- package/build/Admin_homePage.1411fb7c.chunk.js +0 -68
- package/build/Admin_marketplace.0f6c8ee2.chunk.js +0 -22
- package/build/Admin_pluginsPage.15e3b0fd.chunk.js +0 -1
- package/build/Admin_profilePage.d2a8f9ab.chunk.js +0 -15
- package/build/Admin_settingsPage.489ec4eb.chunk.js +0 -9
- package/build/Upload_ConfigureTheView.34dde278.chunk.js +0 -1
- package/build/admin-app.4b313104.chunk.js +0 -112
- package/build/admin-edit-roles-page.3b196317.chunk.js +0 -216
- package/build/admin-edit-users.af3b0f15.chunk.js +0 -10
- package/build/admin-roles-list.0ad504a7.chunk.js +0 -2
- package/build/admin-users.af8c3123.chunk.js +0 -11
- package/build/api-tokens-create-page.2a6e22bd.chunk.js +0 -1
- package/build/api-tokens-edit-page.fa38cd63.chunk.js +0 -1
- package/build/api-tokens-list-page.93f24348.chunk.js +0 -16
- package/build/audit-logs-settings-page.7be97e82.chunk.js +0 -1
- package/build/content-manager.f530e141.chunk.js +0 -1139
- package/build/content-type-builder-list-view.cf38fe2f.chunk.js +0 -191
- package/build/content-type-builder.6ecd201d.chunk.js +0 -126
- package/build/email-settings-page.4bdbef9a.chunk.js +0 -3
- package/build/i18n-settings-page.2bb5be96.chunk.js +0 -1
- package/build/main.43b93ff3.js +0 -3843
- package/build/sso-settings-page.5a8588ef.chunk.js +0 -1
- package/build/transfer-tokens-create-page.a1f14bb1.chunk.js +0 -1
- package/build/transfer-tokens-edit-page.00ee1c74.chunk.js +0 -1
- package/build/transfer-tokens-list-page.ce37354b.chunk.js +0 -16
- package/build/upload-settings.0200561d.chunk.js +0 -1
- package/build/upload-translation-fr-json.84429734.chunk.js +0 -1
- package/build/upload.c7da1611.chunk.js +0 -13
- package/build/users-advanced-settings-page.c0cae03a.chunk.js +0 -1
- package/build/users-email-settings-page.a3c80419.chunk.js +0 -1
- package/build/users-providers-settings-page.5f86e45c.chunk.js +0 -1
- package/build/users-roles-settings-page.b02986df.chunk.js +0 -30
- package/build/webhook-edit-page.a2a2b7bb.chunk.js +0 -23
- package/build/webhook-list-page.029957a4.chunk.js +0 -1
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[5905],{69073:function(H,R,n){n.r(R),n.d(R,{default:function(){return it}});var e=n(32735),a=n(43383),C=n(19406),p=n(66456),A=n(68625),X=n(29439),G=n(82055),T=n(87933),P=n(41415),z=n(17e3),s=n(72850),J=n(33795),f=n.n(J),m=n(23973),x=n.n(m),h=n(89793),u=n.n(h),$=n(23940),F=n.n($),B=n(67879),Q=n(53038),oe=n(60216),o=n.n(oe),ge=n(56755),fe=n(33827),ye=n(94547),_=n(19786),D=n(49372),Pe=n(73269),he=n(32237),K=n(198),M=n(8471),Z=n(92318),we=n(35331);const Be=(0,M.ZP)(T.k)`
|
|
2
|
+
border-radius: 50%;
|
|
3
|
+
color: ${({theme:t,isActive:r})=>r?t.colors.primary600:t.colors.neutral600};
|
|
4
|
+
height: ${({theme:t})=>t.spaces[8]};
|
|
5
|
+
width: ${({theme:t})=>t.spaces[8]};
|
|
6
|
+
|
|
7
|
+
svg {
|
|
8
|
+
height: ${({theme:t})=>t.spaces[5]};
|
|
9
|
+
width: ${({theme:t})=>t.spaces[5]};
|
|
10
|
+
}
|
|
11
|
+
`;function ae({isActive:t}){return e.createElement(Be,{alignItems:"center",background:t?"primary200":"neutral200",justifyContent:"center",isActive:t},e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},e.createElement("path",{d:"M216.3 2c4.8-2.6 10.5-2.6 15.3 0L422.3 106c5.1 2.8 8.3 8.2 8.3 14s-3.2 11.2-8.3 14L231.7 238c-4.8 2.6-10.5 2.6-15.3 0L25.7 134c-5.1-2.8-8.3-8.2-8.3-14s3.2-11.2 8.3-14L216.3 2zM23.7 170l176 96c5.1 2.8 8.3 8.2 8.3 14V496c0 5.6-3 10.9-7.8 13.8s-10.9 3-15.8 .3L8.3 414C3.2 411.2 0 405.9 0 400V184c0-5.6 3-10.9 7.8-13.8s10.9-3 15.8-.3zm400.7 0c5-2.7 11-2.6 15.8 .3s7.8 8.1 7.8 13.8V400c0 5.9-3.2 11.2-8.3 14l-176 96c-5 2.7-11 2.6-15.8-.3s-7.8-8.1-7.8-13.8V280c0-5.9 3.2-11.2 8.3-14l176-96z",fill:"currentColor"})))}ae.defaultProps={isActive:!1},ae.propTypes={isActive:o().bool};const Ee=(0,M.ZP)(s.x)`
|
|
12
|
+
position: absolute;
|
|
13
|
+
display: none;
|
|
14
|
+
top: 5px;
|
|
15
|
+
right: ${(0,a.Q1)(8)};
|
|
16
|
+
|
|
17
|
+
svg {
|
|
18
|
+
width: ${(0,a.Q1)(10)};
|
|
19
|
+
height: ${(0,a.Q1)(10)};
|
|
20
|
+
|
|
21
|
+
path {
|
|
22
|
+
fill: ${({theme:t})=>t.colors.primary600};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`,ke=(0,M.ZP)(T.k)`
|
|
26
|
+
width: ${(0,a.Q1)(140)};
|
|
27
|
+
height: ${(0,a.Q1)(80)};
|
|
28
|
+
position: relative;
|
|
29
|
+
border: 1px solid ${({theme:t})=>t.colors.neutral200};
|
|
30
|
+
background: ${({theme:t})=>t.colors.neutral100};
|
|
31
|
+
border-radius: ${({theme:t})=>t.borderRadius};
|
|
32
|
+
max-width: 100%;
|
|
33
|
+
|
|
34
|
+
&.active,
|
|
35
|
+
&:focus,
|
|
36
|
+
&:hover {
|
|
37
|
+
border: 1px solid ${({theme:t})=>t.colors.primary200};
|
|
38
|
+
background: ${({theme:t})=>t.colors.primary100};
|
|
39
|
+
|
|
40
|
+
${Ee} {
|
|
41
|
+
display: block;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
${D.Z} {
|
|
45
|
+
color: ${({theme:t})=>t.colors.primary600};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* > ComponentIcon */
|
|
49
|
+
> div:first-child {
|
|
50
|
+
background: ${({theme:t})=>t.colors.primary200};
|
|
51
|
+
color: ${({theme:t})=>t.colors.primary600};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`;function re({component:t,dzName:r,index:l,isActive:c,isInDevelopmentMode:g,onClick:i}){const{modifiedData:E,removeComponentFromDynamicZone:k}=(0,K.Z)(),{schema:{displayName:w}}=f()(E,["components",t],{schema:{}}),L=v=>{v.stopPropagation(),k(r,l)};return e.createElement(ke,{as:"button",alignItems:"center",direction:"column",className:c?"active":"",borderRadius:"borderRadius",justifyContent:"center",paddingLeft:4,paddingRight:4,shrink:0,type:"button",onClick:i},e.createElement(ae,{isActive:c}),e.createElement(s.x,{marginTop:1,maxWidth:"100%"},e.createElement(D.Z,{variant:"pi",fontWeight:"bold",ellipsis:!0},w)),g&&e.createElement(Ee,{as:"button",onClick:L,type:"button"},e.createElement(we.Z,null)))}re.defaultProps={component:null,isActive:!1,isInDevelopmentMode:!1,onClick(){}},re.propTypes={component:o().string,dzName:o().string.isRequired,index:o().number.isRequired,isActive:o().bool,isInDevelopmentMode:o().bool,onClick:o().func};var Ie=re,ve=M.ZP.tr`
|
|
55
|
+
&.component-row,
|
|
56
|
+
&.dynamiczone-row {
|
|
57
|
+
position: relative;
|
|
58
|
+
border-top: none !important;
|
|
59
|
+
|
|
60
|
+
table tr:first-child {
|
|
61
|
+
border-top: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
> td:first-of-type {
|
|
65
|
+
padding: 0 0 0 ${(0,a.Q1)(20)};
|
|
66
|
+
position: relative;
|
|
67
|
+
|
|
68
|
+
&::before {
|
|
69
|
+
content: '';
|
|
70
|
+
width: ${(0,a.Q1)(4)};
|
|
71
|
+
height: calc(100% - 40px);
|
|
72
|
+
position: absolute;
|
|
73
|
+
top: -7px;
|
|
74
|
+
left: 1.625rem;
|
|
75
|
+
border-radius: 4px;
|
|
76
|
+
|
|
77
|
+
${({isFromDynamicZone:t,isChildOfDynamicZone:r,theme:l})=>r?`background-color: ${l.colors.primary200};`:t?`background-color: ${l.colors.primary200};`:`background: ${l.colors.neutral150};`}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&.dynamiczone-row > td:first-of-type {
|
|
83
|
+
padding: 0;
|
|
84
|
+
}
|
|
85
|
+
`;function le({customRowComponent:t,component:r,isFromDynamicZone:l,isNestedInDZComponent:c,firstLoopComponentUid:g}){const{modifiedData:i}=(0,K.Z)(),{schema:{attributes:E}}=f()(i,["components",r],{schema:{attributes:[]}});return e.createElement(ve,{isChildOfDynamicZone:l,className:"component-row"},e.createElement("td",{colSpan:12},e.createElement(Te,{customRowComponent:t,items:E,targetUid:r,firstLoopComponentUid:g||r,editTarget:"components",isFromDynamicZone:l,isNestedInDZComponent:c,isSub:!0,secondLoopComponentUid:g?r:null})))}le.defaultProps={component:null,customRowComponent:null,firstLoopComponentUid:null,isFromDynamicZone:!1,isNestedInDZComponent:!1},le.propTypes={component:o().string,customRowComponent:o().func,firstLoopComponentUid:o().string,isFromDynamicZone:o().bool,isNestedInDZComponent:o().bool};var be=le;const Oe=(0,M.ZP)(C.Z)`
|
|
86
|
+
width: ${(0,a.Q1)(32)};
|
|
87
|
+
height: ${(0,a.Q1)(32)};
|
|
88
|
+
padding: ${(0,a.Q1)(9)};
|
|
89
|
+
border-radius: ${(0,a.Q1)(64)};
|
|
90
|
+
background: ${({theme:t})=>t.colors.primary100};
|
|
91
|
+
path {
|
|
92
|
+
fill: ${({theme:t})=>t.colors.primary600};
|
|
93
|
+
}
|
|
94
|
+
`,Fe=(0,M.ZP)(s.x)`
|
|
95
|
+
height: ${(0,a.Q1)(90)};
|
|
96
|
+
position: absolute;
|
|
97
|
+
width: 100%;
|
|
98
|
+
top: 0;
|
|
99
|
+
left: 0;
|
|
100
|
+
`,We=(0,M.ZP)(T.k)`
|
|
101
|
+
width: 100%;
|
|
102
|
+
overflow-x: auto;
|
|
103
|
+
`,Ue=(0,M.ZP)(s.x)`
|
|
104
|
+
padding-top: ${(0,a.Q1)(90)};
|
|
105
|
+
`,Se=(0,M.ZP)(T.k)`
|
|
106
|
+
flex-shrink: 0;
|
|
107
|
+
width: ${(0,a.Q1)(140)};
|
|
108
|
+
height: ${(0,a.Q1)(80)};
|
|
109
|
+
justify-content: center;
|
|
110
|
+
align-items: center;
|
|
111
|
+
`;function ie({customRowComponent:t,components:r,addComponent:l,name:c,targetUid:g}){const{isInDevelopmentMode:i}=(0,K.Z)(),[E,k]=(0,e.useState)(0),{formatMessage:w}=(0,B.Z)(),L=d=>{E!==d&&k(d)},v=()=>{l(c)};return e.createElement(ve,{className:"dynamiczone-row",isFromDynamicZone:!0},e.createElement("td",{colSpan:12},e.createElement(Fe,{paddingLeft:8},e.createElement(We,{gap:2},i&&e.createElement("button",{type:"button",onClick:v},e.createElement(Se,{direction:"column",alignItems:"stretch",gap:1},e.createElement(Oe,null),e.createElement(D.Z,{variant:"pi",fontWeight:"bold",textColor:"primary600"},w({id:(0,Z.Z)("button.component.add"),formatMessage:"Add a component"})))),r.map((d,y)=>e.createElement(Ie,{key:d,dzName:c,index:y,component:d,isActive:E===y,isInDevelopmentMode:i,onClick:()=>L(y)})))),e.createElement(Ue,null,r.map((d,y)=>{const b={customRowComponent:t,component:d};return e.createElement(s.x,{tabId:`${y}`,key:d,style:{display:E===y?"block":"none"}},e.createElement("table",null,e.createElement("tbody",null,e.createElement(be,{...b,isFromDynamicZone:!0,targetUid:g,key:d}))))}))))}ie.defaultProps={addComponent(){},components:[],customRowComponent:null,name:null},ie.propTypes={addComponent:o().func,components:o().instanceOf(Array),customRowComponent:o().func,name:o().string,targetUid:o().string.isRequired};var je=ie,Ne=(0,M.ZP)(s.x)`
|
|
112
|
+
table {
|
|
113
|
+
width: 100%;
|
|
114
|
+
white-space: nowrap;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
thead {
|
|
118
|
+
border-bottom: 1px solid ${({theme:t})=>t.colors.neutral150};
|
|
119
|
+
|
|
120
|
+
tr {
|
|
121
|
+
border-top: 0;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
tr {
|
|
126
|
+
border-top: 1px solid ${({theme:t})=>t.colors.neutral150};
|
|
127
|
+
|
|
128
|
+
& td,
|
|
129
|
+
& th {
|
|
130
|
+
padding: ${({theme:t})=>t.spaces[4]};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
& td:first-of-type,
|
|
134
|
+
& th:first-of-type {
|
|
135
|
+
padding: 0 ${({theme:t})=>t.spaces[1]};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
th,
|
|
140
|
+
td {
|
|
141
|
+
vertical-align: middle;
|
|
142
|
+
text-align: left;
|
|
143
|
+
color: ${({theme:t})=>t.colors.neutral600};
|
|
144
|
+
outline-offset: -4px;
|
|
145
|
+
}
|
|
146
|
+
`;const Ve=(0,M.ZP)(s.x)`
|
|
147
|
+
height: ${24/16}rem;
|
|
148
|
+
width: ${24/16}rem;
|
|
149
|
+
border-radius: 50%;
|
|
150
|
+
display: flex;
|
|
151
|
+
justify-content: center;
|
|
152
|
+
align-items: center;
|
|
153
|
+
|
|
154
|
+
svg {
|
|
155
|
+
height: ${10/16}rem;
|
|
156
|
+
width: ${10/16}rem;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
svg path {
|
|
160
|
+
fill: ${({theme:t,color:r})=>t.colors[`${r}600`]};
|
|
161
|
+
}
|
|
162
|
+
`,ze=(0,M.ZP)(s.x)`
|
|
163
|
+
border-radius: 0 0 ${({theme:t})=>t.borderRadius} ${({theme:t})=>t.borderRadius};
|
|
164
|
+
display: block;
|
|
165
|
+
width: 100%;
|
|
166
|
+
border: none;
|
|
167
|
+
position: relative;
|
|
168
|
+
left: -0.25rem;
|
|
169
|
+
`,Ce=({children:t,icon:r,color:l,...c})=>e.createElement(ze,{paddingBottom:4,paddingTop:4,as:"button",type:"button",...c},e.createElement(T.k,null,e.createElement(Ve,{color:l,"aria-hidden":!0,background:`${l}200`},r),e.createElement(s.x,{paddingLeft:3},e.createElement(D.Z,{variant:"pi",fontWeight:"bold",textColor:`${l}600`},t))));Ce.propTypes={color:o().string.isRequired,children:o().string.isRequired,icon:o().node.isRequired};var Qe=Ce;function se({addComponentToDZ:t,customRowComponent:r,editTarget:l,firstLoopComponentUid:c,isFromDynamicZone:g,isMain:i,isNestedInDZComponent:E,isSub:k,items:w,secondLoopComponentUid:L,targetUid:v}){const{formatMessage:d}=(0,B.Z)(),{trackUsage:y}=(0,a.rS)(),{isInDevelopmentMode:b,modifiedData:N,isInContentTypeView:W}=(0,K.Z)(),{onOpenModalAddField:S}=(0,he.Z)(),I=()=>{y("hasClickedCTBAddFieldBanner"),S({forTarget:l,targetUid:v})};return v?w.length===0&&i?e.createElement(ge.i,{colCount:2,rowCount:2},e.createElement(fe.h,null,e.createElement(ye.Tr,null,e.createElement(_.Th,null,e.createElement(D.Z,{variant:"sigma",textColor:"neutral600"},d({id:"global.name",defaultMessage:"Name"}))),e.createElement(_.Th,null,e.createElement(D.Z,{variant:"sigma",textColor:"neutral600"},d({id:"global.type",defaultMessage:"Type"}))))),e.createElement(a.c4,{action:e.createElement(P.z,{onClick:I,size:"L",startIcon:e.createElement(C.Z,null),variant:"secondary"},d({id:(0,Z.Z)("table.button.no-fields"),defaultMessage:"Add new field"})),colSpan:2,content:W?{id:(0,Z.Z)("table.content.no-fields.collection-type"),defaultMessage:"Add your first field to this Collection-Type"}:{id:(0,Z.Z)("table.content.no-fields.component"),defaultMessage:"Add your first field to this component"}})):e.createElement(Ne,null,e.createElement(s.x,{paddingLeft:6,paddingRight:i?6:0,...i&&{style:{overflowX:"auto"}}},e.createElement("table",null,i&&e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,e.createElement(D.Z,{variant:"sigma",textColor:"neutral600"},d({id:"global.name",defaultMessage:"Name"}))),e.createElement("th",{colSpan:"2"},e.createElement(D.Z,{variant:"sigma",textColor:"neutral600"},d({id:"global.type",defaultMessage:"Type"}))))),e.createElement("tbody",null,w.map(U=>{const{type:V}=U,Y=r;return e.createElement(e.Fragment,{key:U.name},e.createElement(Y,{...U,isNestedInDZComponent:E,targetUid:v,editTarget:l,firstLoopComponentUid:c,isFromDynamicZone:g,secondLoopComponentUid:L}),V==="component"&&e.createElement(be,{...U,customRowComponent:r,targetUid:v,isNestedInDZComponent:g,editTarget:l,firstLoopComponentUid:c}),V==="dynamiczone"&&e.createElement(je,{...U,customRowComponent:r,addComponent:t,targetUid:v}))})))),i&&b&&e.createElement(Pe.c,{icon:e.createElement(C.Z,null),onClick:I},d({id:(0,Z.Z)(`form.button.add.field.to.${N.contentType?N.contentType.schema.kind:l||"collectionType"}`),defaultMessage:"Add another field"})),k&&b&&e.createElement(Qe,{icon:e.createElement(C.Z,null),onClick:I,color:g?"primary":"neutral"},d({id:(0,Z.Z)("form.button.add.field.to.component"),defaultMessage:"Add another field"}))):e.createElement(ge.i,{colCount:2,rowCount:2},e.createElement(fe.h,null,e.createElement(ye.Tr,null,e.createElement(_.Th,null,e.createElement(D.Z,{variant:"sigma",textColor:"neutral600"},d({id:"global.name",defaultMessage:"Name"}))),e.createElement(_.Th,null,e.createElement(D.Z,{variant:"sigma",textColor:"neutral600"},d({id:"global.type",defaultMessage:"Type"}))))),e.createElement(a.c4,{colSpan:2,content:{id:(0,Z.Z)("table.content.create-first-content-type"),defaultMessage:"Create your first Collection-Type"}}))}se.defaultProps={addComponentToDZ(){},customRowComponent:null,firstLoopComponentUid:null,isFromDynamicZone:!1,isNestedInDZComponent:!1,isMain:!1,isSub:!1,items:[],secondLoopComponentUid:null,targetUid:null},se.propTypes={addComponentToDZ:o().func,customRowComponent:o().func,editTarget:o().string.isRequired,firstLoopComponentUid:o().string,isFromDynamicZone:o().bool,isNestedInDZComponent:o().bool,isMain:o().bool,items:o().instanceOf(Array),secondLoopComponentUid:o().string,targetUid:o().string,isSub:o().bool};var Te=se,xe=n(50563),Ke=n(4038),Ze=n(74512);const He=t=>(0,Ze.jsx)("svg",{width:"1rem",height:"1rem",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,Ze.jsx)("path",{d:"M19 10h1a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V11a1 1 0 0 1 1-1h1V9a7 7 0 0 1 14 0v1Zm-2 0V9A5 5 0 0 0 7 9v1h10Zm-6 4v4h2v-4h-2Z",fill:"#8E8EA9"})}),Xe=He,Ge=(0,M.ZP)(s.x)`
|
|
170
|
+
position: absolute;
|
|
171
|
+
left: -1.125rem;
|
|
172
|
+
top: 0px;
|
|
173
|
+
|
|
174
|
+
&:before {
|
|
175
|
+
content: '';
|
|
176
|
+
width: ${4/16}rem;
|
|
177
|
+
height: ${12/16}rem;
|
|
178
|
+
background: ${({theme:t,color:r})=>t.colors[r]};
|
|
179
|
+
display: block;
|
|
180
|
+
}
|
|
181
|
+
`,Je=M.ZP.svg`
|
|
182
|
+
position: relative;
|
|
183
|
+
flex-shrink: 0;
|
|
184
|
+
transform: translate(-0.5px, -1px);
|
|
185
|
+
|
|
186
|
+
* {
|
|
187
|
+
fill: ${({theme:t,color:r})=>t.colors[r]};
|
|
188
|
+
}
|
|
189
|
+
`,Me=t=>e.createElement(Ge,null,e.createElement(Je,{width:"20",height:"23",viewBox:"0 0 20 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.02477 14.7513C8.65865 17.0594 11.6046 18.6059 17.5596 18.8856C18.6836 18.9384 19.5976 19.8435 19.5976 20.9688V20.9688C19.5976 22.0941 18.6841 23.0125 17.5599 22.9643C10.9409 22.6805 6.454 20.9387 3.75496 17.1258C0.937988 13.1464 0.486328 7.39309 0.486328 0.593262H4.50974C4.50974 7.54693 5.06394 11.9813 7.02477 14.7513Z"})));Me.propTypes={color:o().string.isRequired};var Ye=Me;const ce=({content:t})=>F()(t);ce.defaultProps={content:null},ce.propTypes={content:o().string};var qe=ce,_e=(0,M.ZP)(s.x)`
|
|
190
|
+
position: relative;
|
|
191
|
+
`,et=n(25747);const de=({type:t,customField:r,repeatable:l})=>{const{formatMessage:c}=(0,B.Z)();let g=t;return["integer","biginteger","float","decimal"].includes(t)?g="number":["string"].includes(t)&&(g="text"),r?e.createElement(D.Z,null,c({id:(0,Z.Z)("attribute.customField"),defaultMessage:"Custom field"})):e.createElement(D.Z,null,c({id:(0,Z.Z)(`attribute.${g}`),defaultMessage:t}),"\xA0",l&&c({id:(0,Z.Z)("component.repeatable"),defaultMessage:"(repeatable)"}))};de.defaultProps={customField:null,repeatable:!1},de.propTypes={type:o().string.isRequired,customField:o().string,repeatable:o().bool};var tt=de;function me({configurable:t,customField:r,editTarget:l,firstLoopComponentUid:c,isFromDynamicZone:g,name:i,onClick:E,relation:k,repeatable:w,secondLoopComponentUid:L,target:v,targetUid:d,type:y}){const{contentTypes:b,isInDevelopmentMode:N,removeAttribute:W}=(0,K.Z)(),{formatMessage:S}=(0,B.Z)(),I=y==="relation"&&k.includes("morph"),U=["integer","biginteger","float","decimal"].includes(y)?"number":y,V=f()(b,[v],{}),Y=f()(V,["schema","displayName"],""),q=f()(V,"plugin"),ue=v?"relation":U,ee=()=>{I||t!==!1&&E(l,L||c||d,i,y,r)};let j;return L&&c?j=2:c?j=1:j=0,e.createElement(_e,{as:"tr",...(0,a.X7)({fn:ee,condition:N&&t&&!I})},e.createElement("td",{style:{position:"relative"}},j!==0&&e.createElement(Ye,{color:g?"primary200":"neutral150"}),e.createElement(T.k,{paddingLeft:2,gap:4},e.createElement(et.Z,{type:ue,customField:r}),e.createElement(D.Z,{fontWeight:"bold"},i))),e.createElement("td",null,v?e.createElement(D.Z,null,S({id:(0,Z.Z)(`modelPage.attribute.${I?"relation-polymorphic":"relationWith"}`),defaultMessage:"Relation with"}),"\xA0",e.createElement("span",{style:{fontStyle:"italic"}},e.createElement(qe,{content:Y}),"\xA0",q&&`(${S({id:(0,Z.Z)("from"),defaultMessage:"from"})}: ${q})`)):e.createElement(tt,{type:y,customField:r,repeatable:w})),e.createElement("td",null,N?e.createElement(T.k,{justifyContent:"flex-end",...a.UW},t?e.createElement(T.k,{gap:1},!I&&e.createElement(xe.h,{onClick:ee,label:`${S({id:"app.utils.edit",defaultMessage:"Edit"})} ${i}`,noBorder:!0,icon:e.createElement(A.Z,null)}),e.createElement(xe.h,{onClick:te=>{te.stopPropagation(),W(l,i,L||c||"")},label:`${S({id:"global.delete",defaultMessage:"Delete"})} ${i}`,noBorder:!0,icon:e.createElement(Ke.Z,null)})):e.createElement(Xe,null)):e.createElement(s.x,{height:(0,a.Q1)(32)})))}me.defaultProps={configurable:!0,customField:null,firstLoopComponentUid:null,isFromDynamicZone:!1,onClick(){},relation:"",repeatable:!1,secondLoopComponentUid:null,target:null,targetUid:null,type:null},me.propTypes={configurable:o().bool,customField:o().string,editTarget:o().string.isRequired,firstLoopComponentUid:o().string,isFromDynamicZone:o().bool,name:o().string.isRequired,onClick:o().func,relation:o().string,repeatable:o().bool,secondLoopComponentUid:o().string,target:o().string,targetUid:o().string,type:o().string};var nt=(0,e.memo)(me),ot=t=>{let r;switch(t){case"date":case"datetime":case"time":case"timestamp":r="date";break;case"integer":case"biginteger":case"decimal":case"float":r="number";break;case"string":case"text":r="text";break;case"":r="relation";break;default:r=t}return r},at=n(2669);const rt={collectionTypesConfigurations:[{action:"plugin::content-manager.collection-types.configure-view",subject:null}],componentsConfigurations:[{action:"plugin::content-manager.components.configure-layout",subject:null}],singleTypesConfigurations:[{action:"plugin::content-manager.single-types.configure-view",subject:null}]},pe=({disabled:t,isTemporary:r,isInContentTypeView:l,contentTypeKind:c,targetUid:g})=>{const{formatMessage:i}=(0,B.Z)(),{push:E}=(0,Q.k6)(),{collectionTypesConfigurations:k,componentsConfigurations:w,singleTypesConfigurations:L}=rt,v=i({id:"content-type-builder.form.button.configure-view"});let d=k;const y=()=>(r||E(l?`/content-manager/collectionType/${g}/configurations/edit`:`/content-manager/components/${g}/configurations/edit`),!1);return l&&c==="singleType"&&(d=L),l||(d=w),e.createElement(a.jW,{permissions:d},e.createElement(P.z,{startIcon:e.createElement(at.Z,null),variant:"tertiary",onClick:y,disabled:r||t},v))};pe.defaultProps={contentTypeKind:"collectionType",isInContentTypeView:!0,isTemporary:!1,targetUid:""},pe.propTypes={disabled:o().bool.isRequired,contentTypeKind:o().string,isInContentTypeView:o().bool,isTemporary:o().bool,targetUid:o().string};var lt=(0,e.memo)(pe),it=()=>{const{initialData:t,modifiedData:r,isInDevelopmentMode:l,isInContentTypeView:c,submitData:g}=(0,K.Z)(),{formatMessage:i}=(0,B.Z)(),{trackUsage:E}=(0,a.rS)(),k=(0,Q.$B)("/plugins/content-type-builder/:kind/:currentUID"),{onOpenModalAddComponentsToDZ:w,onOpenModalAddField:L,onOpenModalEditField:v,onOpenModalEditSchema:d,onOpenModalEditCustomField:y}=(0,he.Z)(),b=c?"contentType":"component",N=[b,"schema","attributes"],W=f()(r,[b,"uid"]),S=f()(r,[b,"isTemporary"],!1),I=f()(r,[b,"schema","kind"],null),U=f()(r,N,[]),V=x()(t,[b,"plugin"]),Y=!u()(r,t),q=c?"contentType":"component",ue=O=>{w({dynamicZoneTarget:O,targetUid:W})},ee=async(O,$e,De,Le,Re)=>{const Ae=ot(Le);Re?y({forTarget:O,targetUid:$e,attributeName:De,attributeType:Ae,customFieldUid:Re}):v({forTarget:O,targetUid:$e,attributeName:De,attributeType:Ae,step:Le==="component"?"2":null})};let j=f()(r,[b,"schema","displayName"],"");const te=f()(r,[b,"schema","kind"],""),ne=k?.params.currentUID==="create-content-type";!j&&ne&&(j=i({id:(0,Z.Z)("button.model.create"),defaultMessage:"Create new collection type"}));const st=()=>{const O=te||b;O==="collectionType"&&E("willEditNameOfContentType"),O==="singleType"&&E("willEditNameOfSingleType"),d({modalType:b,forTarget:b,targetUid:W,kind:O})};return e.createElement(e.Fragment,null,e.createElement(Q.NL,{message:i({id:(0,Z.Z)("prompt.unsaved")}),when:Y}),e.createElement(G.T,{id:"title",primaryAction:l&&e.createElement(T.k,{gap:2},!ne&&e.createElement(P.z,{startIcon:e.createElement(C.Z,null),variant:"secondary",onClick:()=>{L({forTarget:q,targetUid:W})}},i({id:(0,Z.Z)("button.attributes.add.another")})),e.createElement(P.z,{startIcon:e.createElement(p.Z,null),onClick:()=>g(),type:"submit",disabled:u()(r,t)},i({id:"global.save",defaultMessage:"Save"}))),secondaryAction:l&&!V&&!ne&&e.createElement(P.z,{startIcon:e.createElement(A.Z,null),variant:"tertiary",onClick:st},i({id:"app.utils.edit",defaultMessage:"Edit"})),title:F()(j),subtitle:i({id:(0,Z.Z)("listView.headerLayout.description"),defaultMessage:"Build the data architecture of your content"}),navigationAction:e.createElement(a.rU,{startIcon:e.createElement(X.Z,null),to:"/plugins/content-type-builder/"},i({id:"global.back",defaultMessage:"Back"}))}),e.createElement(z.D,null,e.createElement(T.k,{direction:"column",alignItems:"stretch",gap:4},e.createElement(T.k,{justifyContent:"flex-end"},e.createElement(T.k,{gap:2},e.createElement(lt,{key:"link-to-cm-settings-view",targetUid:W,isTemporary:S,isInContentTypeView:c,contentTypeKind:I,disabled:ne}))),e.createElement(s.x,{background:"neutral0",shadow:"filterShadow",hasRadius:!0},e.createElement(Te,{items:U,customRowComponent:O=>e.createElement(nt,{...O,onClick:ee}),addComponentToDZ:ue,targetUid:W,editTarget:q,isMain:!0})))))}},17e3:function(H,R,n){n.d(R,{D:function(){return p}});var e=n(32735),a=n(60216),C=n(72850);const p=({children:A})=>e.createElement(C.x,{paddingLeft:10,paddingRight:10},A);p.propTypes={children:a.node.isRequired}},82055:function(H,R,n){n.d(R,{T:function(){return s}});var e=n(32735),a=n(60216),C=n(8471),p=n(72850),A=n(87933);const X=m=>{const x=(0,e.useRef)(null),[h,u]=(0,e.useState)(!0),$=([F])=>{u(F.isIntersecting)};return(0,e.useEffect)(()=>{const F=x.current,B=new IntersectionObserver($,m);return F&&B.observe(x.current),()=>{F&&B.disconnect()}},[x,m]),[x,h]};var G=n(63060);const T=(m,x)=>{const h=(0,G.W)(x);(0,e.useLayoutEffect)(()=>{const u=new ResizeObserver(h);return Array.isArray(m)?m.forEach($=>{$.current&&u.observe($.current)}):m.current&&u.observe(m.current),()=>{u.disconnect()}},[m,h])};var P=n(49372);const z=()=>{const m=(0,e.useRef)(null),[x,h]=(0,e.useState)(null),[u,$]=X({root:null,rootMargin:"0px",threshold:0});return T(u,()=>{u.current&&h(u.current.getBoundingClientRect())}),(0,e.useEffect)(()=>{m.current&&h(m.current.getBoundingClientRect())},[m]),{containerRef:u,isVisible:$,baseHeaderLayoutRef:m,headerSize:x}},s=m=>{const{containerRef:x,isVisible:h,baseHeaderLayoutRef:u,headerSize:$}=z();return e.createElement(e.Fragment,null,e.createElement("div",{style:{height:$?.height},ref:x},h&&e.createElement(f,{ref:u,...m})),!h&&e.createElement(f,{...m,sticky:!0,width:$?.width}))};s.displayName="HeaderLayout";const J=(0,C.ZP)(p.x)`
|
|
192
|
+
width: ${m=>m.width}px;
|
|
193
|
+
`,f=e.forwardRef(({navigationAction:m,primaryAction:x,secondaryAction:h,subtitle:u,title:$,sticky:F,width:B,...Q},oe)=>{const o=typeof u=="string";return F?e.createElement(J,{paddingLeft:6,paddingRight:6,paddingTop:3,paddingBottom:3,position:"fixed",top:0,right:0,background:"neutral0",shadow:"tableShadow",width:B,zIndex:4,"data-strapi-header-sticky":!0},e.createElement(A.k,{justifyContent:"space-between"},e.createElement(A.k,null,m&&e.createElement(p.x,{paddingRight:3},m),e.createElement(p.x,null,e.createElement(P.Z,{variant:"beta",as:"h1",...Q},$),o?e.createElement(P.Z,{variant:"pi",textColor:"neutral600"},u):u),h?e.createElement(p.x,{paddingLeft:4},h):null),e.createElement(A.k,null,x?e.createElement(p.x,{paddingLeft:2},x):void 0))):e.createElement(p.x,{ref:oe,paddingLeft:10,paddingRight:10,paddingBottom:8,paddingTop:m?6:8,background:"neutral100","data-strapi-header":!0},m?e.createElement(p.x,{paddingBottom:2},m):null,e.createElement(A.k,{justifyContent:"space-between"},e.createElement(A.k,{minWidth:0},e.createElement(P.Z,{as:"h1",variant:"alpha",...Q},$),h?e.createElement(p.x,{paddingLeft:4},h):null),x),o?e.createElement(P.Z,{variant:"epsilon",textColor:"neutral600",as:"p"},u):u)});f.displayName="BaseHeaderLayout",f.defaultProps={navigationAction:void 0,primaryAction:void 0,secondaryAction:void 0,subtitle:void 0,sticky:!1,width:void 0},f.propTypes={navigationAction:a.node,primaryAction:a.node,secondaryAction:a.node,sticky:a.bool,subtitle:a.oneOfType([a.string,a.node]),title:a.string.isRequired,width:a.number},s.defaultProps={navigationAction:void 0,primaryAction:void 0,secondaryAction:void 0,subtitle:void 0},s.propTypes={navigationAction:a.node,primaryAction:a.node,secondaryAction:a.node,subtitle:a.oneOfType([a.string,a.node]),title:a.string.isRequired}},73269:function(H,R,n){n.d(R,{c:function(){return z}});var e=n(32735),a=n(60216),C=n(8471),p=n(72850),A=n(9026),X=n(87933),G=n(49372);const T=(0,C.ZP)(p.x)`
|
|
194
|
+
height: ${24/16}rem;
|
|
195
|
+
width: ${24/16}rem;
|
|
196
|
+
border-radius: 50%;
|
|
197
|
+
display: flex;
|
|
198
|
+
justify-content: center;
|
|
199
|
+
align-items: center;
|
|
200
|
+
|
|
201
|
+
svg {
|
|
202
|
+
height: ${10/16}rem;
|
|
203
|
+
width: ${10/16}rem;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
svg path {
|
|
207
|
+
fill: ${({theme:s})=>s.colors.primary600};
|
|
208
|
+
}
|
|
209
|
+
`,P=(0,C.ZP)(p.x)`
|
|
210
|
+
border-radius: 0 0 ${({theme:s})=>s.borderRadius} ${({theme:s})=>s.borderRadius};
|
|
211
|
+
display: block;
|
|
212
|
+
width: 100%;
|
|
213
|
+
border: none;
|
|
214
|
+
`,z=({children:s,icon:J,...f})=>e.createElement("div",null,e.createElement(A.i,null),e.createElement(P,{as:"button",background:"primary100",padding:5,...f},e.createElement(X.k,null,e.createElement(T,{"aria-hidden":!0,background:"primary200"},J),e.createElement(p.x,{paddingLeft:3},e.createElement(G.Z,{variant:"pi",fontWeight:"bold",textColor:"primary600"},s)))));z.propTypes={children:a.string.isRequired,icon:a.node.isRequired}},29439:function(H,R,n){n.d(R,{Z:function(){return C}});var e=n(74512);const a=p=>(0,e.jsx)("svg",{width:"1rem",height:"1rem",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...p,children:(0,e.jsx)("path",{d:"M24 13.3a.2.2 0 0 1-.2.2H5.74l8.239 8.239a.2.2 0 0 1 0 .282L12.14 23.86a.2.2 0 0 1-.282 0L.14 12.14a.2.2 0 0 1 0-.282L11.86.14a.2.2 0 0 1 .282 0L13.98 1.98a.2.2 0 0 1 0 .282L5.74 10.5H23.8c.11 0 .2.09.2.2v2.6Z",fill:"#212134"})}),C=a},2669:function(H,R,n){n.d(R,{Z:function(){return C}});var e=n(74512);const a=p=>(0,e.jsx)("svg",{width:"1rem",height:"1rem",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...p,children:(0,e.jsx)("path",{d:"M4.8.2c0-.11.09-.2.2-.2h18.8c.11 0 .2.09.2.2v4.4a.2.2 0 0 1-.2.2H5a.2.2 0 0 1-.2-.2V.2ZM0 9.8c0-.11.09-.2.2-.2H19c.11 0 .2.09.2.2v4.4a.2.2 0 0 1-.2.2H.2a.2.2 0 0 1-.2-.2V9.8ZM5 19.2a.2.2 0 0 0-.2.2v4.4c0 .11.09.2.2.2h18.8a.2.2 0 0 0 .2-.2v-4.4a.2.2 0 0 0-.2-.2H5Z",fill:"#212134"})}),C=a}}]);
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[8880],{25747:function(Fe,ae,l){var a=l(32735),B=l(8471),ye=l(60216),q=l.n(ye),R=l(72850),Ae=l(32031),rt=l(73779),V=l(35071),it=l(1176),n=l(88675),lt=l(15431),h=l(22348),we=l(7184),Be=l(43475),Ye=l(872),Qe=l(89135),ut=l(82512),dt=l(61642),be=l(58656),Xe=l(83218),ct=l(17757),he=l(43383);const d={biginteger:Ae.Z,boolean:rt.Z,collectionType:V.Z,component:it.Z,contentType:V.Z,date:n.Z,datetime:n.Z,decimal:Ae.Z,dynamiczone:lt.Z,email:h.Z,enum:we.Z,enumeration:we.Z,file:Be.Z,files:Be.Z,float:Ae.Z,integer:Ae.Z,json:Ye.Z,JSON:Ye.Z,media:Be.Z,number:Ae.Z,password:Qe.Z,relation:ut.Z,richtext:dt.Z,singleType:be.Z,string:Xe.Z,text:Xe.Z,time:n.Z,timestamp:n.Z,uid:ct.Z},Me=(0,B.ZP)(R.x)`
|
|
2
|
+
svg {
|
|
3
|
+
height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
}
|
|
6
|
+
`,je=({type:Je,customField:_e,...xe})=>{const mt=(0,he.mZ)();let We=d[Je];if(_e){const{icon:ze}=mt.get(_e);ze&&(We=ze)}return d[Je]?a.createElement(Me,{height:(0,he.Q1)(24),width:(0,he.Q1)(32),shrink:0,...xe,"aria-hidden":!0},a.createElement(R.x,{as:We})):null};je.defaultProps={customField:null},je.propTypes={type:q().string.isRequired,customField:q().string},ae.Z=je},74753:function(Fe,ae,l){var a=l(32735);const B=(0,a.createContext)();ae.Z=B},51216:function(Fe,ae,l){var a=l(32735);const B=(0,a.createContext)();ae.Z=B},198:function(Fe,ae,l){var a=l(32735),B=l(74753);const ye=()=>(0,a.useContext)(B.Z);ae.Z=ye},32237:function(Fe,ae,l){var a=l(32735),B=l(51216);const ye=()=>(0,a.useContext)(B.Z);ae.Z=ye},97165:function(Fe,ae,l){l.r(ae),l.d(ae,{default:function(){return ps}});var a=l(32735),B=l(53038),ye=l(74758),q=l(67879),R=l(43383),Ae=l(96709),rt=l(3633),V=l(25158),it=l(60216),n=l.n(it),lt=l(33795),h=l.n(lt),we=l(81346),Be=l.n(we),Ye=l(3040),Qe=l.n(Ye),ut=l(61868),dt=l.n(ut),be=l(15062),Xe=l(6680),ct=l(74753),he=l(32237),d=l(92318),Me=l(37087),je=l(23973),Je=l.n(je),_e=l(59578),xe=l.n(_e),mt=l(85025),We=l(31600),ze=l(91215),$=l(87933),Ne=l(39291),pt=l(9026),j=l(72850),Oe=l(3653),ra=l(11406),H=l(41415),ia=l(89793),gt=l.n(ia),Ee=l(198),dn=l(47328),la=l(23940),ve=l.n(la);const ua=[{label:"All",children:[{label:"images (JPEG, PNG, GIF, SVG, TIFF, ICO, DVU)",value:"images"},{label:"videos (MPEG, MP4, Quicktime, WMV, AVI, FLV)",value:"videos"},{label:"audios (MP3, WAV, OGG)",value:"audios"},{label:"files (CSV, ZIP, PDF, Excel, JSON, ...)",value:"files"}]}],ft=({intlLabel:e,name:t,onChange:o,value:r})=>{const{formatMessage:s}=(0,q.Z)(),i=r===null||r.length===0?s({id:"global.none",defaultMessage:"None"}):[...r].sort().map(c=>ve()(c)).join(", "),u=e.id?s({id:e.id,defaultMessage:e.defaultMessage}):t;return a.createElement(dn.Q,{id:"select1",label:u,customizeContent:()=>i,onChange:c=>{c.length>0?o({target:{name:t,value:c,type:"allowed-types-select"}}):o({target:{name:t,value:null,type:"allowed-types-select"}})},options:ua,value:r||[]})};ft.defaultProps={value:null},ft.propTypes={intlLabel:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired,values:n().object}).isRequired,name:n().string.isRequired,onChange:n().func.isRequired,value:n().oneOfType([n().object,n().array])};var da=ft,Q=l(49372),cn=e=>e.kind==="collectionType"&&(e.restrictRelationsTo===null||Array.isArray(e.restrictRelationsTo)&&e.restrictRelationsTo.length>0),yt=l(861),bt=l(15335),et=l(5803),tt=l(25747),Le=l(8471),mn=(0,Le.ZP)(j.x)`
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
border: 1px solid ${({theme:e})=>e.colors.neutral200};
|
|
10
|
+
text-align: left;
|
|
11
|
+
&:hover {
|
|
12
|
+
background: ${({theme:e})=>e.colors.primary100};
|
|
13
|
+
border: 1px solid ${({theme:e})=>e.colors.primary200};
|
|
14
|
+
}
|
|
15
|
+
`;const ht=({type:e})=>{const{formatMessage:t}=(0,q.Z)(),{onClickSelectField:o}=(0,he.Z)(),r=()=>{o({attributeType:e,step:e==="component"?"1":null})};return a.createElement(mn,{padding:4,as:"button",hasRadius:!0,type:"button",onClick:r},a.createElement($.k,null,a.createElement(tt.Z,{type:e}),a.createElement(j.x,{paddingLeft:4},a.createElement($.k,null,a.createElement(Q.Z,{fontWeight:"bold"},t({id:(0,d.Z)(`attribute.${e}`),defaultMessage:e}))),a.createElement($.k,null,a.createElement(Q.Z,{variant:"pi",textColor:"neutral600"},t({id:(0,d.Z)(`attribute.${e}.description`),defaultMessage:"A type for modeling data"}))))))};ht.defaultProps={type:"text"},ht.propTypes={type:n().string};var ca=ht,pn=e=>{const t=e%2===1;return{paddingLeft:t?2:0,paddingRight:t?0:2}};const gn=({attributes:e})=>a.createElement(yt.k,{tagName:"button"},a.createElement($.k,{direction:"column",alignItems:"stretch",gap:8},e.map((t,o)=>a.createElement(bt.r,{key:o,gap:0},t.map((r,s)=>{const{paddingLeft:i,paddingRight:u}=pn(s);return a.createElement(et.P,{key:r,col:6,style:{height:"100%"}},a.createElement(j.x,{paddingLeft:i,paddingRight:u,paddingBottom:1,style:{height:"100%"}},a.createElement(ca,{type:r})))})))));gn.propTypes={attributes:n().array.isRequired};var ma=gn,pa=l(50428),ga=l(33348),fa=l.n(ga),fn=l(99140),ya=l(25148),ba=l(54725),Se=l(19406);const ha=(0,Le.ZP)(j.x)`
|
|
16
|
+
background: ${({theme:e})=>`linear-gradient(180deg, rgba(234, 234, 239, 0) 0%, ${e.colors.neutral150} 100%)`};
|
|
17
|
+
opacity: 0.33;
|
|
18
|
+
`,va=()=>a.createElement($.k,{wrap:"wrap",gap:4},[...Array(4)].map((e,t)=>a.createElement(ha,{key:`empty-card-${t}`,height:"138px",width:"375px",hasRadius:!0})));var Ta=()=>{const{formatMessage:e}=(0,q.Z)();return a.createElement(j.x,{position:"relative"},a.createElement(va,null),a.createElement(j.x,{position:"absolute",top:6,width:"100%"},a.createElement($.k,{alignItems:"center",justifyContent:"center",direction:"column"},a.createElement(fn.J,{as:ba.Z,color:"",width:"160px",height:"88px"}),a.createElement(j.x,{paddingTop:6,paddingBottom:4},a.createElement(j.x,{textAlign:"center"},a.createElement(Q.Z,{variant:"delta",as:"p",textColor:"neutral600"},e({id:(0,d.Z)("modalForm.empty.heading"),defaultMessage:"Nothing in here yet."})),a.createElement(j.x,{paddingTop:4},a.createElement(Q.Z,{variant:"delta",as:"p",textColor:"neutral600"},e({id:(0,d.Z)("modalForm.empty.sub-heading"),defaultMessage:"Find what you are looking for through a wide range of extensions."}))))),a.createElement(ya.Q,{to:`/marketplace?${fa().stringify({categories:["Custom fields"]})}`,variant:"secondary",startIcon:a.createElement(Se.Z,null)},e({id:(0,d.Z)("modalForm.empty.button"),defaultMessage:"Add custom fields"})))))};const yn=({customFieldUid:e,customField:t})=>{const{type:o,intlLabel:r,intlDescription:s}=t,{formatMessage:i}=(0,q.Z)(),{onClickSelectCustomField:u}=(0,he.Z)(),c=()=>{u({attributeType:o,customFieldUid:e})};return a.createElement(mn,{padding:4,as:"button",hasRadius:!0,type:"button",onClick:c},a.createElement($.k,null,a.createElement(tt.Z,{type:o,customField:e}),a.createElement(j.x,{paddingLeft:4},a.createElement($.k,null,a.createElement(Q.Z,{fontWeight:"bold"},i(r))),a.createElement($.k,null,a.createElement(Q.Z,{variant:"pi",textColor:"neutral600"},i(s))))))};yn.propTypes={customFieldUid:n().string.isRequired,customField:n().shape({type:n().string.isRequired,icon:n().func,intlLabel:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired}).isRequired,intlDescription:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired}).isRequired}).isRequired};var Ca=yn,Ma=()=>{const{formatMessage:e}=(0,q.Z)(),t=(0,R.mZ)(),o=Object.entries(t.getAll());if(!o.length)return a.createElement(Ta,null);const r=o.sort((s,i)=>s[1].name>i[1].name?1:-1);return a.createElement(yt.k,{tagName:"button"},a.createElement($.k,{direction:"column",alignItems:"stretch",gap:3},a.createElement(bt.r,{gap:0},r.map(([s,i],u)=>{const{paddingLeft:c,paddingRight:m}=pn(u);return a.createElement(et.P,{key:s,col:6,style:{height:"100%"}},a.createElement(j.x,{paddingLeft:c,paddingRight:m,paddingBottom:1,style:{height:"100%"}},a.createElement(Ca,{key:s,customFieldUid:s,customField:i})))})),a.createElement(pa.r,{href:"https://docs.strapi.io/developer-docs/latest/development/custom-fields.html",isExternal:!0},e({id:(0,d.Z)("modalForm.tabs.custom.howToLink"),defaultMessage:"How to add custom fields"}))))};const bn=({attributes:e,forTarget:t,kind:o})=>{const{formatMessage:r}=(0,q.Z)(),s=(0,d.Z)("modalForm.tabs.default"),i=(0,d.Z)("modalForm.tabs.custom"),u=t.includes("component")?"component":o,c=(0,d.Z)(`modalForm.sub-header.chooseAttribute.${u}`);return a.createElement(We.f,{padding:6},a.createElement(ze.v,{label:r({id:(0,d.Z)("modalForm.tabs.label"),defaultMessage:"Default and Custom types tabs"}),id:"attribute-type-tabs",variant:"simple"},a.createElement($.k,{justifyContent:"space-between"},a.createElement(Q.Z,{variant:"beta",as:"h2"},r({id:c,defaultMessage:"Select a field"})),a.createElement(Ne.m,null,a.createElement(Ne.O,null,r({id:s,defaultMessage:"Default"})),a.createElement(Ne.O,null,r({id:i,defaultMessage:"Custom"})))),a.createElement(j.x,{paddingBottom:6},a.createElement(pt.i,null)),a.createElement(Oe.n,null,a.createElement(Oe.x,null,a.createElement(ma,{attributes:e})),a.createElement(Oe.x,null,a.createElement(Ma,null)))))};bn.propTypes={attributes:n().array.isRequired,forTarget:n().string.isRequired,kind:n().string.isRequired};var Ea=bn,hn=l(8284);const vt=({description:e,disabled:t,intlLabel:o,isCreating:r,name:s,onChange:i,value:u})=>{const{formatMessage:c}=(0,q.Z)(),[m,g]=(0,a.useState)(!1),f=o.id?c({id:o.id,defaultMessage:o.defaultMessage},{...o.values}):s,p=e?c({id:e.id,defaultMessage:e.defaultMessage},{...e.values}):"",v=()=>g(N=>!N),T=()=>{i({target:{name:s,value:!1}}),v()},S=({target:{checked:N}})=>{if(!N&&!r){v();return}i({target:{name:s,value:N}})};return a.createElement(a.Fragment,null,a.createElement(hn.X,{checked:u,disabled:t,hint:p,name:s,onChange:S},f),a.createElement(R.QH,{isOpen:m,onToggleDialog:v,onConfirm:T,bodyText:{id:(0,d.Z)("popUpWarning.draft-publish.message"),defaultMessage:"If you disable the draft & publish, your drafts will be deleted."},leftButtonText:{id:"components.popUpWarning.button.cancel",defaultMessage:"No, cancel"},rightButtonText:{id:(0,d.Z)("popUpWarning.draft-publish.button.confirm"),defaultMessage:"Yes, disable"}}))};vt.defaultProps={description:null,disabled:!1,value:!1},vt.propTypes={description:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired,values:n().object}),disabled:n().bool,intlLabel:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired,values:n().object}).isRequired,isCreating:n().bool.isRequired,name:n().string.isRequired,onChange:n().func.isRequired,value:n().bool};var Ra=vt,vn=l(55225),Tt=l(11299);const Ct=({actionType:e,attributeName:t,attributeType:o,categoryName:r,contentTypeKind:s,dynamicZoneTarget:i,forTarget:u,modalType:c,targetUid:m,customFieldUid:g})=>{const{formatMessage:f}=(0,q.Z)(),{modifiedData:p}=(0,Ee.Z)();let v,T=[];const S=p?.[u]?.[m]||p?.[u]||null;let N=S?.schema.displayName;if(c==="contentType"&&(v=s),["component","editCategory"].includes(c)&&(v="component"),["component","contentType"].includes(c)){let C=(0,d.Z)(`modalForm.component.header-${e}`);return c==="contentType"&&(C=(0,d.Z)(`modalForm.${s}.header-create`)),e==="edit"&&(C=(0,d.Z)("modalForm.header-edit")),a.createElement(vn.x,null,a.createElement($.k,null,a.createElement(j.x,null,a.createElement(tt.Z,{type:v})),a.createElement(j.x,{paddingLeft:3},a.createElement(Q.Z,{fontWeight:"bold",textColor:"neutral800",as:"h2",id:"title"},f({id:C},{name:N})))))}T=[{label:N,info:{category:S?.category||null,name:S?.schema.displayName}}],c==="chooseAttribute"&&(v=["component","components"].includes(u)?"component":S.schema.kind),c==="addComponentToDynamicZone"&&(v="dynamiczone",T.push({label:i})),(c==="attribute"||c==="customField")&&(v=o,T.push({label:t})),c==="editCategory"&&(T=[{label:f({id:(0,d.Z)("modalForm.header.categories"),defaultMessage:"Categories"})},{label:r}]);const M=T.map(({label:C})=>C).join(",");return a.createElement(vn.x,null,a.createElement($.k,{gap:3},a.createElement(tt.Z,{type:v,customField:g}),a.createElement(Tt.O,{label:M},T.map((C,A)=>{const W=ve()(C.label);if(!W)return null;const z=`${C.label}.${A}`;if(C.info?.category){const ee=`${W} (${ve()(C.info.category)} - ${ve()(C.info.name)})`;return a.createElement(Tt.$,{key:z},ee)}return a.createElement(Tt.$,{key:z},W)}))))};Ct.defaultProps={actionType:null,attributeName:null,attributeType:null,categoryName:null,dynamicZoneTarget:null,forTarget:null,contentTypeKind:null,targetUid:null,customFieldUid:null},Ct.propTypes={actionType:n().string,attributeName:n().string,attributeType:n().string,categoryName:n().string,contentTypeKind:n().string,dynamicZoneTarget:n().string,forTarget:n().oneOf(["contentType","component","components"]),modalType:n().string.isRequired,targetUid:n().string,customFieldUid:n().string};var Za=Ct;const Mt=({categoryName:e,deleteCategory:t,deleteComponent:o,deleteContentType:r,isAttributeModal:s,isCustomFieldModal:i,isComponentAttribute:u,isComponentToDzModal:c,isContentTypeModal:m,isCreatingComponent:g,isCreatingComponentAttribute:f,isCreatingComponentInDz:p,isCreatingComponentWhileAddingAField:v,isCreatingContentType:T,isCreatingDz:S,isComponentModal:N,isDzAttribute:P,isEditingAttribute:M,isEditingCategory:C,isInFirstComponentStep:A,onSubmitAddComponentAttribute:W,onSubmitAddComponentToDz:z,onSubmitCreateContentType:ee,onSubmitCreateComponent:O,onSubmitCreateDz:Y,onSubmitEditAttribute:re,onSubmitEditCategory:Ge,onSubmitEditComponent:oe,onSubmitEditContentType:Pe,onSubmitEditCustomFieldAttribute:G,onSubmitEditDz:qe,onClickFinish:_})=>{const{formatMessage:U}=(0,q.Z)();return c?p?a.createElement(H.z,{variant:"secondary",type:"submit",onClick:E=>{E.preventDefault(),z(E,!0)},startIcon:a.createElement(Se.Z,null)},U({id:(0,d.Z)("form.button.add-first-field-to-created-component"),defaultMessage:"Add first field to the component"})):a.createElement(H.z,{variant:"default",type:"submit",onClick:E=>{E.preventDefault(),z(E,!1)}},U({id:"global.finish",defaultMessage:"Finish"})):s&&P&&!S?a.createElement(H.z,{variant:"default",type:"submit",onClick:E=>{E.preventDefault(),_(),qe(E,!1)}},U({id:"global.finish",defaultMessage:"Finish"})):s&&P&&S?a.createElement(a.Fragment,null,a.createElement(H.z,{variant:"secondary",type:"submit",onClick:E=>{E.preventDefault(),Y(E,!0)},startIcon:a.createElement(Se.Z,null)},U({id:(0,d.Z)("form.button.add-components-to-dynamiczone"),defaultMessage:"Add components to the zone"}))):s&&u?A?a.createElement(H.z,{variant:"secondary",type:"submit",onClick:E=>{E.preventDefault(),W(E,!0)}},U(f?{id:(0,d.Z)("form.button.configure-component"),defaultMessage:"Configure the component"}:{id:(0,d.Z)("form.button.select-component"),defaultMessage:"Configure the component"})):a.createElement(a.Fragment,null,a.createElement(H.z,{variant:"secondary",type:"submit",onClick:E=>{E.preventDefault(),W(E,!0)},startIcon:a.createElement(Se.Z,null)},U(v?{id:(0,d.Z)("form.button.add-first-field-to-created-component"),defaultMessage:"Add first field to the component"}:{id:(0,d.Z)("form.button.add-field"),defaultMessage:"Add another field"})),a.createElement(H.z,{variant:"default",type:"button",onClick:E=>{E.preventDefault(),_(),W(E,!1)}},U({id:"global.finish",defaultMessage:"Finish"}))):s&&!u&&!P?a.createElement(a.Fragment,null,a.createElement(H.z,{type:M?"button":"submit",variant:"secondary",onClick:E=>{E.preventDefault(),re(E,!0)},startIcon:a.createElement(Se.Z,null)},U({id:(0,d.Z)("form.button.add-field"),defaultMessage:"Add another field"})),a.createElement(H.z,{type:M?"submit":"button",variant:"default",onClick:E=>{E.preventDefault(),_(),re(E,!1)}},U({id:"global.finish",defaultMessage:"Finish"}))):m?a.createElement(a.Fragment,null,!T&&a.createElement(a.Fragment,null,a.createElement(H.z,{type:"button",variant:"danger",onClick:E=>{E.preventDefault(),r()}},U({id:"global.delete",defaultMessage:"Delete"})),a.createElement(H.z,{type:"submit",variant:"default",onClick:E=>{E.preventDefault(),Pe(E,!1)}},U({id:"global.finish",defaultMessage:"Finish"}))),T&&a.createElement(H.z,{type:"submit",variant:"secondary",onClick:E=>{E.preventDefault(),ee(E,!0)}},U({id:"global.continue",defaultMessage:"Continue"}))):N?a.createElement(a.Fragment,null,!g&&a.createElement(a.Fragment,null,a.createElement(H.z,{type:"button",variant:"danger",onClick:E=>{E.preventDefault(),o()}},U({id:"global.delete",defaultMessage:"Delete"})),a.createElement(H.z,{type:"submit",variant:"default",onClick:E=>{E.preventDefault(),oe(E,!1)}},U({id:"global.finish",defaultMessage:"Finish"}))),g&&a.createElement(H.z,{type:"submit",variant:"secondary",onClick:E=>{E.preventDefault(),O(E,!0)}},U({id:"global.continue",defaultMessage:"Continue"}))):C?a.createElement(a.Fragment,null,a.createElement(H.z,{type:"button",variant:"danger",onClick:E=>{E.preventDefault(),t(e)}},U({id:"global.delete",defaultMessage:"Delete"})),a.createElement(H.z,{type:"submit",variant:"default",onClick:E=>{E.preventDefault(),Ge(E)}},U({id:"global.finish",defaultMessage:"finish"}))):i?a.createElement(a.Fragment,null,a.createElement(H.z,{type:M?"button":"submit",variant:"secondary",onClick:E=>{E.preventDefault(),G(E,!0)},startIcon:a.createElement(Se.Z,null)},U({id:(0,d.Z)("form.button.add-field"),defaultMessage:"Add another field"})),a.createElement(H.z,{type:M?"submit":"button",variant:"default",onClick:E=>{E.preventDefault(),_(),G(E,!1)}},U({id:"global.finish",defaultMessage:"Finish"}))):null};Mt.defaultProps={categoryName:null,onClickFinish(){}},Mt.propTypes={categoryName:n().string,deleteCategory:n().func.isRequired,deleteComponent:n().func.isRequired,deleteContentType:n().func.isRequired,isAttributeModal:n().bool.isRequired,isCustomFieldModal:n().bool.isRequired,isComponentAttribute:n().bool.isRequired,isComponentModal:n().bool.isRequired,isComponentToDzModal:n().bool.isRequired,isContentTypeModal:n().bool.isRequired,isCreatingComponent:n().bool.isRequired,isCreatingComponentAttribute:n().bool.isRequired,isCreatingComponentInDz:n().bool.isRequired,isCreatingComponentWhileAddingAField:n().bool.isRequired,isCreatingContentType:n().bool.isRequired,isCreatingDz:n().bool.isRequired,isDzAttribute:n().bool.isRequired,isEditingAttribute:n().bool.isRequired,isEditingCategory:n().bool.isRequired,isInFirstComponentStep:n().bool.isRequired,onSubmitAddComponentAttribute:n().func.isRequired,onSubmitAddComponentToDz:n().func.isRequired,onSubmitCreateContentType:n().func.isRequired,onSubmitCreateComponent:n().func.isRequired,onSubmitCreateDz:n().func.isRequired,onSubmitEditAttribute:n().func.isRequired,onSubmitEditCategory:n().func.isRequired,onSubmitEditComponent:n().func.isRequired,onSubmitEditContentType:n().func.isRequired,onSubmitEditCustomFieldAttribute:n().func.isRequired,onSubmitEditDz:n().func.isRequired,onClickFinish:n().func};var Aa=Mt,xa=({modalType:e,forTarget:t,kind:o,actionType:r,step:s})=>{switch(e){case"chooseAttribute":return(0,d.Z)(`modalForm.sub-header.chooseAttribute.${t.includes("component")?"component":o||"collectionType"}`);case"attribute":return(0,d.Z)(`modalForm.sub-header.attribute.${r}${s!=="null"&&s!==null&&r!=="edit"?".step":""}`);case"customField":return(0,d.Z)(`modalForm.sub-header.attribute.${r}`);case"addComponentToDynamicZone":return(0,d.Z)("modalForm.sub-header.addComponentToDynamicZone");default:return(0,d.Z)("configurations")}};const Et=({actionType:e,modalType:t,forTarget:o,kind:r,step:s,attributeType:i,attributeName:u,customField:c})=>{const{formatMessage:m}=(0,q.Z)(),g=t==="customField"?c.intlLabel:{id:(0,d.Z)(`attribute.${i}`)};return a.createElement($.k,{direction:"column",alignItems:"flex-start",paddingBottom:2,gap:1},a.createElement(Q.Z,{as:"h2",variant:"beta"},m({id:xa({actionType:e,forTarget:o,kind:r,step:s,modalType:t}),defaultMessage:"Add new field"},{type:ve()(m(g)),name:ve()(u),step:s})),a.createElement(Q.Z,{variant:"pi",textColor:"neutral600"},m({id:(0,d.Z)(`attribute.${i}.description`),defaultMessage:"A type for modeling data"})))};Et.defaultProps={actionType:null,modalType:null,forTarget:null,kind:null,step:null,attributeType:null,attributeName:null,customField:null},Et.propTypes={actionType:n().string,modalType:n().string,forTarget:n().string,kind:n().string,step:n().string,attributeType:n().string,attributeName:n().string,customField:n().object};var Sa=Et,nt=l(80084),at=l(84967);const Rt=({intlLabel:e,name:t,options:o,onChange:r,value:s})=>{const{formatMessage:i}=(0,q.Z)(),u=e.id?i({id:e.id,defaultMessage:e.defaultMessage},{...e.values}):t,c=m=>{let g="";m==="true"&&(g=!0),m==="false"&&(g=!1),r({target:{name:t,value:g,type:"select-default-boolean"}})};return a.createElement(nt.P,{label:u,id:t,name:t,onChange:c,value:(s===null?"":s).toString()},o.map(({metadatas:{intlLabel:m,disabled:g,hidden:f},key:p,value:v})=>a.createElement(at.W,{key:p,value:v,disabled:g,hidden:f},m.defaultMessage)))};Rt.defaultProps={value:null},Rt.propTypes={intlLabel:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired,values:n().object}).isRequired,name:n().string.isRequired,onChange:n().func.isRequired,options:n().arrayOf(n().shape({metadatas:n().shape({intlLabel:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired}).isRequired,disabled:n().bool,hidden:n().bool}).isRequired,key:n().oneOfType([n().string,n().number]).isRequired,value:n().oneOfType([n().string,n().number]).isRequired}).isRequired).isRequired,value:n().any};var Fa=Rt,Na=l(30350);const Oa=(0,Le.ZP)($.k)`
|
|
19
|
+
position: relative;
|
|
20
|
+
align-items: stretch;
|
|
21
|
+
|
|
22
|
+
label {
|
|
23
|
+
border-radius: 4px;
|
|
24
|
+
max-width: 50%;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
user-select: none;
|
|
27
|
+
flex: 1;
|
|
28
|
+
${(0,Na.k3)()}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
input {
|
|
32
|
+
position: absolute;
|
|
33
|
+
opacity: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.option {
|
|
37
|
+
height: 100%;
|
|
38
|
+
border-radius: 4px;
|
|
39
|
+
border: 1px solid ${({theme:e})=>e.colors.neutral200};
|
|
40
|
+
will-change: transform, opacity;
|
|
41
|
+
background: ${({theme:e})=>e.colors.neutral0};
|
|
42
|
+
|
|
43
|
+
.checkmark {
|
|
44
|
+
position: relative;
|
|
45
|
+
display: block;
|
|
46
|
+
will-change: transform;
|
|
47
|
+
background: ${({theme:e})=>e.colors.neutral0};
|
|
48
|
+
width: ${({theme:e})=>e.spaces[5]};
|
|
49
|
+
height: ${({theme:e})=>e.spaces[5]};
|
|
50
|
+
border: solid 1px ${({theme:e})=>e.colors.neutral300};
|
|
51
|
+
border-radius: 50%;
|
|
52
|
+
|
|
53
|
+
&:before,
|
|
54
|
+
&:after {
|
|
55
|
+
content: '';
|
|
56
|
+
display: block;
|
|
57
|
+
border-radius: 50%;
|
|
58
|
+
width: ${({theme:e})=>e.spaces[3]};
|
|
59
|
+
height: ${({theme:e})=>e.spaces[3]};
|
|
60
|
+
position: absolute;
|
|
61
|
+
top: 3px;
|
|
62
|
+
left: 3px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:after {
|
|
66
|
+
transform: scale(0);
|
|
67
|
+
transition: inherit;
|
|
68
|
+
will-change: transform;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.container input:checked ~ div {
|
|
74
|
+
background: ${({theme:e})=>e.colors.primary100};
|
|
75
|
+
${Q.Z} {
|
|
76
|
+
color: ${({theme:e})=>e.colors.primary600};
|
|
77
|
+
}
|
|
78
|
+
border: 1px solid ${({theme:e})=>e.colors.primary200};
|
|
79
|
+
.checkmark {
|
|
80
|
+
border: solid 1px ${({theme:e})=>e.colors.primary600};
|
|
81
|
+
&::after {
|
|
82
|
+
background: ${({theme:e})=>e.colors.primary600};
|
|
83
|
+
transform: scale(1);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
`,Zt=({intlLabel:e,name:t,onChange:o,radios:r,value:s})=>{const{formatMessage:i}=(0,q.Z)();return a.createElement($.k,{direction:"column",alignItems:"stretch",gap:2},a.createElement(Q.Z,{variant:"pi",fontWeight:"bold",textColor:"neutral800",htmlFor:t,as:"label"},i(e)),a.createElement(Oa,{gap:4,alignItems:"stretch"},r.map(u=>a.createElement("label",{htmlFor:u.value.toString(),key:u.value,className:"container"},a.createElement("input",{id:u.value.toString(),name:t,className:"option-input",checked:u.value===s,value:u.value,key:u.value,onChange:o,type:"radio"}),a.createElement(j.x,{className:"option",padding:4},a.createElement($.k,null,a.createElement(j.x,{paddingRight:4},a.createElement("span",{className:"checkmark"})),a.createElement($.k,{direction:"column",alignItems:"stretch",gap:2},a.createElement(Q.Z,{fontWeight:"bold"},i(u.title)),a.createElement(Q.Z,{variant:"pi",textColor:"neutral600"},i(u.description)))))))))};Zt.defaultProps={radios:[]},Zt.propTypes={intlLabel:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired,values:n().object}).isRequired,name:n().string.isRequired,onChange:n().func.isRequired,radios:n().arrayOf(n().shape({title:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired}),description:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired}),value:n().any.isRequired})),value:n().oneOfType([n().string,n().bool]).isRequired};var At=Zt;const Tn=({onChange:e,name:t,...o})=>{const r=s=>{const i=s.target.value!=="false";e({target:{name:t,value:i,type:"boolean-radio-group"}})};return a.createElement(At,{...o,name:t,onChange:r})};Tn.propTypes={name:n().string.isRequired,onChange:n().func.isRequired};var La=Tn,xt=l(10369),Ia=l(9900);const St=({error:e,intlLabel:t,modifiedData:o,name:r,onChange:s,value:i})=>{const{formatMessage:u}=(0,q.Z)(),[c,m]=(0,a.useState)(!!i||i===0),g=t.id?u({id:t.id,defaultMessage:t.defaultMessage},{...t.values}):r,f=o.type==="biginteger"?"text":"number",p=!o.type,v=e?u({id:e,defaultMessage:e}):"";return a.createElement($.k,{direction:"column",alignItems:"stretch",gap:2},a.createElement(hn.X,{id:r,name:r,onValueChange:T=>{s({target:{name:r,value:T?f==="text"?"0":0:null}}),m(P=>!P)},value:c},g),c&&a.createElement(j.x,{paddingLeft:6,style:{maxWidth:"200px"}},f==="text"?a.createElement(xt.o,{"aria-label":g,disabled:p,error:v,id:r,name:r,onChange:s,value:i===null?"":i}):a.createElement(Ia.Y,{"aria-label":g,disabled:p,error:v,id:r,name:r,onValueChange:T=>{s({target:{name:r,value:T,type:f}})},value:i||0})))};St.defaultProps={error:null,value:null},St.propTypes={error:n().string,intlLabel:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired,values:n().object}).isRequired,modifiedData:n().object.isRequired,name:n().string.isRequired,onChange:n().func.isRequired,value:n().oneOfType([n().string,n().object,n().bool,n().number])};var Da=St;const Cn=({onChange:e,...t})=>{const o=(0,R.lm)(),r=s=>{o({type:"info",message:{id:(0,d.Z)("contentType.kind.change.warning"),defaultMessage:"You just changed the kind of a content type: API will be reset (routes, controllers, and services will be overwritten)."}}),e(s)};return a.createElement(At,{...t,onChange:r})};Cn.propTypes={onChange:n().func.isRequired};var Pa=Cn,Ft=l(49561),Mn=l(34853),w=l(91559);const Nt=({oneThatIsCreatingARelationWithAnother:e,target:t})=>{const{contentTypes:o,sortedContentTypesList:r}=(0,Ee.Z)(),s=(0,be.I0)(),i=r.filter(cn),u=h()(o,[t,"plugin"],null),c=h()(o,[t,"schema","displayName"],"error");return a.createElement(Mn.O,{id:"label",label:`${c}
|
|
88
|
+
${u?`(from: ${u})`:""}`},i.map(({uid:m,title:g,restrictRelationsTo:f,plugin:p})=>{const v=()=>{const T=p?`${p}_${g}`:g;s({type:w.aG,target:{value:m,oneThatIsCreatingARelationWithAnother:e,selectedContentTypeFriendlyName:T,targetContentTypeAllowedRelations:f}})};return a.createElement(Mn.s,{key:m,onClick:v},g,"\xA0",p&&a.createElement(a.Fragment,null,"(from: ",p,")"))}))};Nt.defaultProps={target:null},Nt.propTypes={oneThatIsCreatingARelationWithAnother:n().string.isRequired,target:n().string};var qa=Nt;const Ot=({disabled:e,error:t,header:o,isMain:r,name:s,onChange:i,oneThatIsCreatingARelationWithAnother:u,target:c,value:m})=>a.createElement(j.x,{background:"neutral100",hasRadius:!0,borderColor:"neutral200"},a.createElement($.k,{paddingTop:r?4:1,paddingBottom:r?3:1,justifyContent:"center"},r?a.createElement(Q.Z,{variant:"pi",fontWeight:"bold",textColor:"neutral800"},o):a.createElement(qa,{target:c,oneThatIsCreatingARelationWithAnother:u})),a.createElement(pt.i,{background:"neutral200"}),a.createElement(j.x,{padding:4},a.createElement(R.jm,{disabled:e,error:t?.id||null,intlLabel:{id:(0,d.Z)("form.attribute.item.defineRelation.fieldName"),defaultMessage:"Field name"},name:s,onChange:i,type:"text",value:m})));Ot.defaultProps={disabled:!1,error:null,header:null,isMain:!1,onChange(){},oneThatIsCreatingARelationWithAnother:null,target:null,value:""},Ot.propTypes={disabled:n().bool,error:n().object,header:n().string,isMain:n().bool,name:n().string.isRequired,onChange:n().func,oneThatIsCreatingARelationWithAnother:n().string,target:n().string,value:n().string};var En=Ot,ka=l(51382),Rn=l.n(ka),$a=l(24443),Lt=l.n($a),Ua=l(25449),Ba=l(10168),ja=l(7733),Wa=l(79634),za=l(26253),Va=l(32548);const Ga=(0,Le.ZP)(j.x)`
|
|
89
|
+
position: relative;
|
|
90
|
+
width: 100%;
|
|
91
|
+
&::before {
|
|
92
|
+
content: '';
|
|
93
|
+
position: absolute;
|
|
94
|
+
top: calc(50% - 0px);
|
|
95
|
+
height: 2px;
|
|
96
|
+
width: 100%;
|
|
97
|
+
background-color: ${({theme:e})=>e.colors.primary600};
|
|
98
|
+
z-index: 0;
|
|
99
|
+
}
|
|
100
|
+
`,Ka=(0,Le.ZP)(j.x)`
|
|
101
|
+
background: ${({theme:e,isSelected:t})=>e.colors[t?"primary100":"neutral0"]};
|
|
102
|
+
border: 1px solid
|
|
103
|
+
${({theme:e,isSelected:t})=>e.colors[t?"primary700":"neutral200"]};
|
|
104
|
+
border-radius: ${({theme:e})=>e.borderRadius};
|
|
105
|
+
z-index: 1;
|
|
106
|
+
svg {
|
|
107
|
+
width: 1.5rem;
|
|
108
|
+
height: 100%;
|
|
109
|
+
path {
|
|
110
|
+
fill: ${({theme:e,isSelected:t})=>e.colors[t?"primary700":"neutral500"]};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
&:disabled {
|
|
114
|
+
cursor: not-allowed;
|
|
115
|
+
}
|
|
116
|
+
`,Ha=(0,Le.ZP)($.k)`
|
|
117
|
+
position: absolute;
|
|
118
|
+
bottom: 0;
|
|
119
|
+
left: 0;
|
|
120
|
+
right: 0;
|
|
121
|
+
`,wa={oneWay:Ua.Z,oneToOne:Ba.Z,oneToMany:ja.Z,manyToOne:Wa.Z,manyToMany:za.Z,manyWay:Va.Z},It=({naturePickerType:e,oneThatIsCreatingARelationWithAnother:t,relationType:o,target:r})=>{const s=(0,be.I0)(),{formatMessage:i}=(0,q.Z)(),{contentTypes:u,modifiedData:c}=(0,Ee.Z)(),m=["oneWay","oneToOne","oneToMany","manyToOne","manyToMany","manyWay"],g=["oneWay","manyWay"],p=(e==="contentType"?h()(c,[e,"schema","kind"],""):e)==="collectionType"?m:g,v=o==="manyToOne",T=h()(u,[r,"schema","displayName"],"unknown"),S=v?T:t,N=v?t:T,P=Lt()(S,o==="manyToMany"?2:1),M=h()(u,[r,"schema","restrictRelationsTo"],null),C=Lt()(N,["manyToMany","oneToMany","manyToOne","manyWay"].includes(o)?2:1);return o?a.createElement($.k,{style:{flex:1}},a.createElement(Ga,null,a.createElement($.k,{paddingLeft:9,paddingRight:9,paddingTop:1,justifyContent:"center"},a.createElement(yt.k,{tagName:"button"},a.createElement($.k,{gap:3},p.map(A=>{const W=wa[A],z=M===null||M.includes(A);return a.createElement(Ka,{as:"button",isSelected:o===A,disabled:!z,key:A,onClick:()=>{z&&s({type:w.QQ,target:{oneThatIsCreatingARelationWithAnother:t,targetContentType:r,value:A}})},padding:2,type:"button"},a.createElement(W,{key:A}))}))))),a.createElement(Ha,{justifyContent:"center"},a.createElement(Q.Z,null,Rn()(P,{length:24}),"\xA0"),a.createElement(Q.Z,{textColor:"primary600"},i({id:(0,d.Z)(`relation.${o}`)}),"\xA0"),a.createElement(Q.Z,null,Rn()(C,{length:24})))):null};It.defaultProps={relationType:null,target:null},It.propTypes={naturePickerType:n().string.isRequired,oneThatIsCreatingARelationWithAnother:n().string.isRequired,relationType:n().string,target:n().string};var Ya=It;const Zn=({formErrors:e,mainBoxHeader:t,modifiedData:o,naturePickerType:r,onChange:s})=>{const i=(0,Ft.Z)(o.relation,o.targetAttribute);return a.createElement($.k,{style:{position:"relative"}},a.createElement(En,{isMain:!0,header:t,error:e?.name||null,name:"name",onChange:s,value:o?.name||""}),a.createElement(Ya,{naturePickerType:r,oneThatIsCreatingARelationWithAnother:t,relationType:i,target:o.target}),a.createElement(En,{disabled:["oneWay","manyWay"].includes(i),error:e?.targetAttribute||null,name:"targetAttribute",onChange:s,oneThatIsCreatingARelationWithAnother:t,target:o.target,value:o?.targetAttribute||""}))};Zn.propTypes={formErrors:n().object.isRequired,mainBoxHeader:n().string.isRequired,modifiedData:n().object.isRequired,naturePickerType:n().string.isRequired,onChange:n().func.isRequired};var Qa=Zn,An=l(45251);const Dt=({description:e,error:t,intlLabel:o,modifiedData:r,name:s,onChange:i,value:u})=>{const{formatMessage:c}=(0,q.Z)(),m=(0,a.useRef)(i),g=r?.displayName||"";(0,a.useEffect)(()=>{if(g){const T=(0,An.Z)(g);try{const S=Lt()(T,2);m.current({target:{name:s,value:S}})}catch{m.current({target:{name:s,value:T}})}}else m.current({target:{name:s,value:""}})},[g,s]);const f=t?c({id:t,defaultMessage:t}):"",p=e?c({id:e.id,defaultMessage:e.defaultMessage},{...e.values}):"",v=c(o);return a.createElement(xt.o,{error:f,label:v,id:s,hint:p,name:s,onChange:i,value:u||""})};Dt.defaultProps={description:null,error:null,value:null},Dt.propTypes={description:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired,values:n().object}),error:n().string,intlLabel:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired,values:n().object}).isRequired,modifiedData:n().object.isRequired,name:n().string.isRequired,onChange:n().func.isRequired,value:n().string};var Xa=Dt,Ja=l(42623),_a=l(90333);const Pt=({error:e,intlLabel:t,name:o,onChange:r,value:s})=>{const{formatMessage:i}=(0,q.Z)(),{allComponentsCategories:u}=(0,Ee.Z)(),[c,m]=(0,a.useState)(u),g=e?i({id:e,defaultMessage:e}):"",f=i(t),p=T=>{r({target:{name:o,value:T,type:"select-category"}})},v=T=>{m(S=>[...S,T]),p(T)};return a.createElement(Ja.X,{error:g,id:o,label:f,name:o,onChange:p,onCreateOption:v,value:s},c.map(T=>a.createElement(_a.O,{key:T,value:T},T)))};Pt.defaultProps={error:null,value:null},Pt.propTypes={error:n().string,intlLabel:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired,values:n().object}).isRequired,name:n().string.isRequired,onChange:n().func.isRequired,value:n().string};var eo=Pt;const qt=({error:e,intlLabel:t,isAddingAComponentToAnotherComponent:o,isCreating:r,isCreatingComponentWhileAddingAField:s,componentToCreate:i,name:u,onChange:c,targetUid:m,forTarget:g,value:f})=>{const{formatMessage:p}=(0,q.Z)(),v=e?p({id:e,defaultMessage:e}):"",T=p(t),{componentsGroupedByCategory:S,componentsThatHaveOtherComponentInTheirAttributes:N}=(0,Ee.Z)(),P=["component","components"].includes(g);let M=Object.entries(S).reduce((C,A)=>{const[W,z]=A,ee=z.map(O=>({uid:O.uid,label:O.schema.displayName,categoryName:W}));return[...C,...ee]},[]);return o&&(M=M.filter(C=>!N.includes(C.uid))),P&&(M=M.filter(C=>C.uid!==m)),s&&(M=[{uid:f,label:i.displayName,categoryName:i.category}]),a.createElement(nt.P,{disabled:s||!r,error:v,label:T,id:u,name:u,onChange:C=>{c({target:{name:u,value:C,type:"select-category"}})},value:f||""},M.map(C=>a.createElement(at.W,{key:C.uid,value:C.uid},`${C.categoryName} - ${C.label}`)))};qt.defaultProps={componentToCreate:null,error:null},qt.propTypes={componentToCreate:n().object,forTarget:n().string.isRequired,error:n().string,intlLabel:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired,values:n().object}).isRequired,isAddingAComponentToAnotherComponent:n().bool.isRequired,isCreating:n().bool.isRequired,isCreatingComponentWhileAddingAField:n().bool.isRequired,name:n().string.isRequired,onChange:n().func.isRequired,targetUid:n().string.isRequired,value:n().string.isRequired};var to=qt,kt=(e,t)=>e.find(({name:o})=>o===t);const xn=({dynamicZoneTarget:e,intlLabel:t,name:o,onChange:r,value:s})=>{const{formatMessage:i}=(0,q.Z)(),{componentsGroupedByCategory:u,modifiedData:c}=(0,Ee.Z)(),g=(kt(c.contentType.schema.attributes,e)||{}).components||[],f=Object.keys(u).reduce((T,S)=>{const N=u[S].filter(({uid:P})=>!g.includes(P));return N.length>0&&(T[S]=N),T},{}),p=Object.entries(f).reduce((T,S)=>{const[N,P]=S,M={label:N,children:P.map(({uid:C,schema:{displayName:A}})=>({label:A,value:C}))};return T.push(M),T},[]),v=i({id:(0,d.Z)("components.SelectComponents.displayed-value"),defaultMessage:"{number, plural, =0 {# components} one {# component} other {# components}} selected"},{number:s.length});return a.createElement(dn.Q,{id:"select1",label:i(t),customizeContent:()=>v,name:o,onChange:T=>{r({target:{name:o,value:T,type:"select-components"}})},options:p,value:s||[]})};xn.propTypes={intlLabel:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired,values:n().object}).isRequired,dynamicZoneTarget:n().string.isRequired,name:n().string.isRequired,onChange:n().func.isRequired,value:n().array.isRequired};var no=xn;const $t=({intlLabel:e,error:t,modifiedData:o,name:r,onChange:s,options:i,value:u})=>{const{formatMessage:c}=(0,q.Z)(),m=c(e),g=t?c({id:t,defaultMessage:t}):"",f=p=>{s({target:{name:r,value:p,type:"select"}}),u&&o.default!==void 0&&o.default!==null&&s({target:{name:"default",value:null}})};return a.createElement(nt.P,{error:g,label:m,id:r,name:r,onChange:f,value:u||""},i.map(({metadatas:{intlLabel:p,disabled:v,hidden:T},key:S,value:N})=>a.createElement(at.W,{key:S,value:N,disabled:v,hidden:T},c({id:p.id,defaultMessage:p.defaultMessage},p.values))))};$t.defaultProps={error:void 0,value:""},$t.propTypes={error:n().string,intlLabel:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired,values:n().object}).isRequired,modifiedData:n().object.isRequired,name:n().string.isRequired,onChange:n().func.isRequired,options:n().arrayOf(n().shape({metadatas:n().shape({intlLabel:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired}).isRequired,disabled:n().bool,hidden:n().bool}).isRequired,key:n().oneOfType([n().string,n().number]).isRequired,value:n().oneOfType([n().string,n().number]).isRequired}).isRequired).isRequired,value:n().string};var ao=$t;const Ut=({intlLabel:e,error:t,modifiedData:o,name:r,onChange:s,options:i,value:u})=>{const{formatMessage:c}=(0,q.Z)(),m=c(e),g=t?c({id:t,defaultMessage:t}):"",f=p=>{s({target:{name:r,value:p,type:"select"}}),u&&(p==="biginteger"&&u!=="biginteger"&&(o.default!==void 0&&o.default!==null&&s({target:{name:"default",value:null}}),o.max!==void 0&&o.max!==null&&s({target:{name:"max",value:null}}),o.min!==void 0&&o.min!==null&&s({target:{name:"min",value:null}})),["decimal","float","integer"].includes(p)&&u==="biginteger"&&(o.default!==void 0&&o.default!==null&&s({target:{name:"default",value:null}}),o.max!==void 0&&o.max!==null&&s({target:{name:"max",value:null}}),o.min!==void 0&&o.min!==null&&s({target:{name:"min",value:null}})))};return a.createElement(nt.P,{error:g,label:m,id:r,name:r,onChange:f,value:u||""},i.map(({metadatas:{intlLabel:p,disabled:v,hidden:T},key:S,value:N})=>a.createElement(at.W,{key:S,value:N,disabled:v,hidden:T},c(p))))};Ut.defaultProps={error:void 0,value:""},Ut.propTypes={error:n().string,intlLabel:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired,values:n().object}).isRequired,modifiedData:n().object.isRequired,name:n().string.isRequired,onChange:n().func.isRequired,options:n().arrayOf(n().shape({metadatas:n().shape({intlLabel:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired}).isRequired,disabled:n().bool,hidden:n().bool}).isRequired,key:n().oneOfType([n().string,n().number]).isRequired,value:n().oneOfType([n().string,n().number]).isRequired}).isRequired).isRequired,value:n().string};var oo=Ut;const Bt=({description:e,error:t,intlLabel:o,modifiedData:r,name:s,onChange:i,value:u})=>{const{formatMessage:c}=(0,q.Z)(),m=(0,a.useRef)(i),g=r?.displayName||"";(0,a.useEffect)(()=>{g?m.current({target:{name:s,value:(0,An.Z)(g)}}):m.current({target:{name:s,value:""}})},[g,s]);const f=t?c({id:t,defaultMessage:t}):"",p=e?c({id:e.id,defaultMessage:e.defaultMessage},{...e.values}):"",v=c(o);return a.createElement(xt.o,{error:f,label:v,id:s,hint:p,name:s,onChange:i,value:u||""})};Bt.defaultProps={description:null,error:null,value:null},Bt.propTypes={description:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired,values:n().object}),error:n().string,intlLabel:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired,values:n().object}).isRequired,modifiedData:n().object.isRequired,name:n().string.isRequired,onChange:n().func.isRequired,value:n().string};var so=Bt;const Sn=({form:e,formErrors:t,genericInputProps:o,modifiedData:r,onChange:s})=>{const{formatMessage:i}=(0,q.Z)();return e.map((u,c)=>u.items.length===0?null:a.createElement(j.x,{key:c},u.sectionTitle&&a.createElement(j.x,{paddingBottom:4},a.createElement(Q.Z,{variant:"delta",as:"h3"},i(u.sectionTitle))),a.createElement(bt.r,{gap:4},u.items.map((m,g)=>{const f=`${c}.${g}`,p=h()(r,m.name,""),v=Object.keys(t).find(S=>S===m.name),T=v?t[v].id:h()(t,[...m.name.split(".").filter(S=>S!=="componentToCreate"),"id"],null);return m.type==="pushRight"?a.createElement(et.P,{col:m.size||6,key:m.name||f},a.createElement("div",null)):a.createElement(et.P,{col:m.size||6,key:m.name||f},a.createElement(R.jm,{...m,...o,error:T,onChange:s,value:p}))}))))};Sn.propTypes={form:n().arrayOf(n().object).isRequired,formErrors:n().object.isRequired,genericInputProps:n().object.isRequired,modifiedData:n().object.isRequired,onChange:n().func.isRequired};var Fn=Sn,ro=l(10508);const jt=({description:e,disabled:t,error:o,intlLabel:r,labelAction:s,name:i,onChange:u,placeholder:c,value:m})=>{const{formatMessage:g}=(0,q.Z)(),f=o?g({id:o,defaultMessage:o}):"",p=e?g({id:e.id,defaultMessage:e.defaultMessage},{...e.values}):"",v=g(r),T=c?g({id:c.id,defaultMessage:c.defaultMessage},{...c.values}):"",S=Array.isArray(m)?m.join(`
|
|
122
|
+
`):"",N=P=>{const M=P.target.value.split(`
|
|
123
|
+
`);u({target:{name:i,value:M}})};return a.createElement(ro.g,{disabled:t,error:f,label:v,labelAction:s,id:i,hint:p,name:i,onChange:N,placeholder:T,value:S},S)};jt.defaultProps={description:null,disabled:!1,error:"",labelAction:void 0,placeholder:null,value:""},jt.propTypes={description:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired,values:n().object}),disabled:n().bool,error:n().string,intlLabel:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired,values:n().object}).isRequired,labelAction:n().element,name:n().string.isRequired,onChange:n().func.isRequired,placeholder:n().shape({id:n().string.isRequired,defaultMessage:n().string.isRequired,values:n().object}),value:n().oneOfType([n().array,n().string])};var io=jt,lo=(e,t)=>{const o=h()(e,["contentType","schema","kind"],"");return o==="singleType"||o===t.kind?!0:h()(e,["contentType","schema","attributes"],[]).filter(({relation:i,type:u,targetAttribute:c})=>{const m=(0,Ft.Z)(i,c);return u==="relation"&&!["oneWay","manyWay"].includes(m)}).length===0},uo=(e="",t,o)=>{const r=["text","email","richtext","password","number","enumeration","date","media","boolean","json","relation"],s=e==="contentType",i=o.includes(t),u=!s&&!i;return s?[[...r,"uid"],["component","dynamiczone"]]:u?[r,["component"]]:[r]},Nn=e=>e.reduce((t,o)=>{const r=o.items.reduce((s,i)=>(i.name&&s.push(i.name),s),[]);return[...t,...r]},[]),b=l(24346),Ie=l(2158),co={base:{sections:[{sectionTitle:null,items:[{autoFocus:!0,name:"name",type:"text",intlLabel:{id:"global.name",defaultMessage:"Name"},description:{id:(0,d.Z)("modalForm.editCategory.base.name.description"),defaultMessage:"No space is allowed for the name of the category"}}]}]}},On=/^[A-Za-z][-_0-9A-Za-z]*$/,mo=e=>{const t={name:b.Z_().matches(On,R.I0.regex).test({name:"nameNotAllowed",message:R.I0.unique,test(o){return o?!e.includes(o?.toLowerCase()):!1}}).required(R.I0.required)};return b.Ry(t)},po=(e,t,o)=>{const r={displayName:b.Z_().test({name:"nameAlreadyUsed",message:R.I0.unique,test(s){if(!s)return!1;const i=(0,Ie.N)(s,o);return!e.includes(i)}}).test({name:"nameNotAllowed",message:(0,d.Z)("error.contentTypeName.reserved-name"),test(s){return s?!t.includes(s?.trim()?.toLowerCase()):!1}}).required(R.I0.required),category:b.Z_().matches(On,R.I0.regex).required(R.I0.required),icon:b.Z_()};return b.Ry(r)},Wt={intlLabel:{id:"global.type",defaultMessage:"Type"},name:"createComponent",type:"boolean-radio-group",size:12,radios:[{title:{id:(0,d.Z)("form.attribute.component.option.create"),defaultMessage:"Create a new component"},description:{id:(0,d.Z)("form.attribute.component.option.create.description"),defaultMessage:"A component is shared across types and components, it will be available and accessible everywhere."},value:!0},{title:{id:(0,d.Z)("form.attribute.component.option.reuse-existing"),defaultMessage:"Use an existing component"},description:{id:(0,d.Z)("form.attribute.component.option.reuse-existing.description"),defaultMessage:"Reuse a component already created to keep your data consistent across content-types."},value:!1}]},De={base(e=""){return[{sectionTitle:null,items:[{name:`${e}displayName`,type:"text",intlLabel:{id:(0,d.Z)("contentType.displayName.label"),defaultMessage:"Display Name"}},{name:`${e}category`,type:"select-category",intlLabel:{id:(0,d.Z)("modalForm.components.create-component.category.label"),defaultMessage:"Select a category or enter a name to create a new one"}}]}]},advanced(){return[]}},Z={default:{name:"default",type:"text",intlLabel:{id:(0,d.Z)("form.attribute.settings.default"),defaultMessage:"Default value"}},max:{name:"max",type:"checkbox-with-number-field",intlLabel:{id:(0,d.Z)("form.attribute.item.maximum"),defaultMessage:"Maximum value"}},maxLength:{name:"maxLength",type:"checkbox-with-number-field",intlLabel:{id:(0,d.Z)("form.attribute.item.maximumLength"),defaultMessage:"Maximum length"}},min:{name:"min",type:"checkbox-with-number-field",intlLabel:{id:(0,d.Z)("form.attribute.item.minimum"),defaultMessage:"Minimum value"}},minLength:{name:"minLength",type:"checkbox-with-number-field",intlLabel:{id:(0,d.Z)("form.attribute.item.minimumLength"),defaultMessage:"Minimum length"}},private:{name:"private",type:"checkbox",intlLabel:{id:(0,d.Z)("form.attribute.item.privateField"),defaultMessage:"Private field"},description:{id:(0,d.Z)("form.attribute.item.privateField.description"),defaultMessage:"This field will not show up in the API response"}},regex:{intlLabel:{id:(0,d.Z)("form.attribute.item.text.regex"),defaultMessage:"RegExp pattern"},name:"regex",type:"text",description:{id:(0,d.Z)("form.attribute.item.text.regex.description"),defaultMessage:"The text of the regular expression"}},required:{name:"required",type:"checkbox",intlLabel:{id:(0,d.Z)("form.attribute.item.requiredField"),defaultMessage:"Required field"},description:{id:(0,d.Z)("form.attribute.item.requiredField.description"),defaultMessage:"You won't be able to create an entry if this field is empty"}},unique:{name:"unique",type:"checkbox",intlLabel:{id:(0,d.Z)("form.attribute.item.uniqueField"),defaultMessage:"Unique field"},description:{id:(0,d.Z)("form.attribute.item.uniqueField.description"),defaultMessage:"You won't be able to create an entry if there is an existing entry with identical content"}}},go={boolean(){return{sections:[{sectionTitle:null,items:[{autoFocus:!0,type:"select-default-boolean",intlLabel:{id:(0,d.Z)("form.attribute.settings.default"),defaultMessage:"Default value"},name:"default",options:[{value:"true",key:"true",metadatas:{intlLabel:{id:"true",defaultMessage:"true"}}},{value:"",key:"null",metadatas:{intlLabel:{id:"null",defaultMessage:"null"}}},{value:"false",key:"false",metadatas:{intlLabel:{id:"false",defaultMessage:"false"}}}]}]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Z.required,Z.private]}]}},component({repeatable:e},t){return t==="1"?{sections:De.advanced("componentToCreate")}:e?{sections:[{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Z.required,Z.private,Z.max,Z.min]}]}:{sections:[{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Z.required,Z.private]}]}},date({type:e}){return{sections:[{sectionTitle:null,items:[{...Z.default,type:e||"date",value:null,withDefaultValue:!1,disabled:!e,autoFocus:!1}]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Z.required,Z.unique,Z.private]}]}},dynamiczone(){return{sections:[{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Z.required,Z.max,Z.min]}]}},email(){return{sections:[{sectionTitle:null,items:[{...Z.default,type:"email"}]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Z.required,Z.unique,Z.maxLength,Z.minLength,Z.private]}]}},enumeration(e){return{sections:[{sectionTitle:null,items:[{name:"default",type:"select",intlLabel:{id:(0,d.Z)("form.attribute.settings.default"),defaultMessage:"Default value"},validations:{},options:[{key:"__null_reset_value__",value:"",metadatas:{intlLabel:{id:"components.InputSelect.option.placeholder",defaultMessage:"Choose here"}}},...(e.enum||[]).filter((t,o)=>e.enum.indexOf(t)===o&&t).map(t=>({key:t,value:t,metadatas:{intlLabel:{id:`${t}.no-override`,defaultMessage:t}}}))]},{intlLabel:{id:(0,d.Z)("form.attribute.item.enumeration.graphql"),defaultMessage:"Name override for GraphQL"},name:"enumName",type:"text",validations:{},description:{id:(0,d.Z)("form.attribute.item.enumeration.graphql.description"),defaultMessage:"Allows you to override the default generated name for GraphQL"}}]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Z.required,Z.private]}]}},json(){return{sections:[{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Z.required,Z.private]}]}},media(){return{sections:[{sectionTitle:null,items:[{intlLabel:{id:(0,d.Z)("form.attribute.media.allowed-types"),defaultMessage:"Select allowed types of media"},name:"allowedTypes",type:"allowed-types-select",size:7,value:"",validations:{}}]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Z.required,Z.private]}]}},number(e){const t=e.type==="decimal"||e.type==="float"?"any":1;return{sections:[{sectionTitle:null,items:[{autoFocus:!0,name:"default",type:e.type==="biginteger"?"text":"number",step:t,intlLabel:{id:(0,d.Z)("form.attribute.settings.default"),defaultMessage:"Default value"},validations:{}}]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Z.required,Z.unique,Z.max,Z.min,Z.private]}]}},password(){return{sections:[{sectionTitle:null,items:[Z.default]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Z.required,Z.maxLength,Z.minLength,Z.private]}]}},relation(){return{sections:[{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Z.private]}]}},richtext(){return{sections:[{sectionTitle:null,items:[Z.default]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Z.required,Z.maxLength,Z.minLength,Z.private]}]}},text(){return{sections:[{sectionTitle:null,items:[Z.default,Z.regex]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Z.required,Z.unique,Z.maxLength,Z.minLength,Z.private]}]}},uid(e){return{sections:[{sectionTitle:null,items:[{...Z.default,disabled:Boolean(e.targetField),type:"text"}]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Z.required,Z.maxLength,Z.minLength,Z.private]}]}}};const ge={name:"name",type:"text",intlLabel:{id:"global.name",defaultMessage:"Name"},description:{id:(0,d.Z)("modalForm.attribute.form.base.name.description"),defaultMessage:"No space is allowed for the name of the attribute"}};var fo={component(e,t){if(t==="1"){const o=e.createComponent===!0?De.base("componentToCreate."):[];return{sections:[{sectionTitle:null,items:[Wt]},...o]}}return{sections:[{sectionTitle:null,items:[ge,{name:"component",type:"select-component",intlLabel:{id:(0,d.Z)("modalForm.attributes.select-component"),defaultMessage:"Select a component"},isMultiple:!1}]},{sectionTitle:null,items:[{intlLabel:{id:"global.type",defaultMessage:"Type"},name:"repeatable",type:"boolean-radio-group",size:12,radios:[{title:{id:(0,d.Z)("form.attribute.component.option.repeatable"),defaultMessage:"Repeatable component"},description:{id:(0,d.Z)("form.attribute.component.option.repeatable.description"),defaultMessage:"Best for multiple instances (array) of ingredients, meta tags, etc.."},value:!0},{title:{id:(0,d.Z)("form.attribute.component.option.single"),defaultMessage:"Single component"},description:{id:(0,d.Z)("form.attribute.component.option.single.description"),defaultMessage:"Best for grouping fields like full address, main information, etc..."},value:!1}]}]}]}},date(){return{sections:[{sectionTitle:null,items:[ge,{intlLabel:{id:"global.type",defaultMessage:"Type"},name:"type",type:"select-date",options:[{key:"__null_reset_value__",value:"",metadatas:{intlLabel:{id:"components.InputSelect.option.placeholder",defaultMessage:"Choose here"},hidden:!0}},{key:"date",value:"date",metadatas:{intlLabel:{id:(0,d.Z)("form.attribute.item.date.type.date"),defaultMessage:"date (ex: 01/01/{currentYear})",values:{currentYear:new Date().getFullYear()}}}},{key:"datetime",value:"datetime",metadatas:{intlLabel:{id:(0,d.Z)("form.attribute.item.date.type.datetime"),defaultMessage:"datetime (ex: 01/01/{currentYear} 00:00 AM)",values:{currentYear:new Date().getFullYear()}}}},{key:"time",value:"time",metadatas:{intlLabel:{id:(0,d.Z)("form.attribute.item.date.type.time"),defaultMessage:"time (ex: 00:00 AM)"}}}]}]}]}},enumeration(){return{sections:[{sectionTitle:null,items:[ge]},{sectionTitle:null,items:[{name:"enum",type:"textarea-enum",size:6,intlLabel:{id:(0,d.Z)("form.attribute.item.enumeration.rules"),defaultMessage:"Values (one line per value)"},placeholder:{id:(0,d.Z)("form.attribute.item.enumeration.placeholder"),defaultMessage:`Ex:
|
|
124
|
+
morning
|
|
125
|
+
noon
|
|
126
|
+
evening`},validations:{required:!0}}]}]}},media(){return{sections:[{sectionTitle:null,items:[ge]},{sectionTitle:null,items:[{intlLabel:{id:"global.type",defaultMessage:"Type"},name:"multiple",size:12,type:"boolean-radio-group",radios:[{title:{id:(0,d.Z)("form.attribute.media.option.multiple"),defaultMessage:"Multiple media"},description:{id:(0,d.Z)("form.attribute.media.option.multiple.description"),defaultMessage:"Best for sliders, carousels or multiple files download"},value:!0},{title:{id:(0,d.Z)("form.attribute.media.option.single"),defaultMessage:"Single media"},description:{id:(0,d.Z)("form.attribute.media.option.single.description"),defaultMessage:"Best for avatar, profile picture or cover"},value:!1}]}]}]}},number(){return{sections:[{sectionTitle:null,items:[ge,{intlLabel:{id:(0,d.Z)("form.attribute.item.number.type"),defaultMessage:"Number format"},name:"type",type:"select-number",options:[{key:"__null_reset_value__",value:"",metadatas:{intlLabel:{id:"components.InputSelect.option.placeholder",defaultMessage:"Choose here"},hidden:!0}},{key:"integer",value:"integer",metadatas:{intlLabel:{id:(0,d.Z)("form.attribute.item.number.type.integer"),defaultMessage:"integer (ex: 10)"}}},{key:"biginteger",value:"biginteger",metadatas:{intlLabel:{id:(0,d.Z)("form.attribute.item.number.type.biginteger"),defaultMessage:"biginteger (ex: 123456789)"}}},{key:"decimal",value:"decimal",metadatas:{intlLabel:{id:(0,d.Z)("form.attribute.item.number.type.decimal"),defaultMessage:"decimal (ex: 2.22)"}}},{key:"float",value:"float",metadatas:{intlLabel:{id:(0,d.Z)("form.attribute.item.number.type.float"),defaultMessage:"decimal (ex: 3.3333333)"}}}]}]}]}},relation(){return{sections:[{sectionTitle:null,items:[{intlLabel:{id:"FIXME",defaultMessage:"FIXME"},name:"relation",size:12,type:"relation"}]}]}},string(){return{sections:[{sectionTitle:null,items:[ge]},{sectionTitle:null,items:[{intlLabel:{id:"global.type",defaultMessage:"Type"},name:"type",size:12,type:"radio-group",radios:[{title:{id:(0,d.Z)("form.attribute.text.option.short-text"),defaultMessage:"Sort text"},description:{id:(0,d.Z)("form.attribute.text.option.short-text.description"),defaultMessage:"Best for titles, names, links (URL). It also enables exact search on the field."},value:"string"},{title:{id:(0,d.Z)("form.attribute.text.option.long-text"),defaultMessage:"Long text"},description:{id:(0,d.Z)("form.attribute.text.option.long-text.description"),defaultMessage:"Best for descriptions, biography. Exact search is disabled."},value:"text"}]}]}]}},text(){return{sections:[{sectionTitle:null,items:[ge]},{sectionTitle:null,items:[{intlLabel:{id:"global.type",defaultMessage:"Type"},name:"type",size:12,type:"radio-group",radios:[{title:{id:(0,d.Z)("form.attribute.text.option.short-text"),defaultMessage:"Sort text"},description:{id:(0,d.Z)("form.attribute.text.option.short-text.description"),defaultMessage:"Best for titles, names, links (URL). It also enables exact search on the field."},value:"string"},{title:{id:(0,d.Z)("form.attribute.text.option.long-text"),defaultMessage:"Long text"},description:{id:(0,d.Z)("form.attribute.text.option.long-text.description"),defaultMessage:"Best for descriptions, biography. Exact search is disabled."},value:"text"}]}]}]}},uid(e,t,o){const r=o.filter(({type:s})=>["string","text"].includes(s)).map(({name:s})=>({key:s,value:s,metadatas:{intlLabel:{id:`${s}.no-override`,defaultMessage:s}}}));return{sections:[{sectionTitle:null,items:[{...ge,placeholder:{id:(0,d.Z)("modalForm.attribute.form.base.name.placeholder"),defaultMessage:"e.g. Slug, SEO URL, Canonical URL"}},{intlLabel:{id:(0,d.Z)("modalForm.attribute.target-field"),defaultMessage:"Attached field"},name:"targetField",type:"select",options:[{key:"__null_reset_value__",value:"",metadatas:{intlLabel:{id:"global.none",defaultMessage:"None"}}},...r]}]}]}}},Ln={advanced:go,base:fo},yo={sections:[{sectionTitle:null,items:[ge]}]},bo=l(91815),ho=l.n(bo),vo=l(40791),To=l.n(vo),zt=e=>To()(e,{decamelize:!1,lowercase:!1,separator:"_"}),Co=l(78746),Vt=l.n(Co);const In=/^[A-Za-z][_0-9A-Za-z]*$/,Dn=e=>({name:"attributeNameAlreadyUsed",message:R.I0.unique,test(t){return t?!e.includes(t):!1}}),Js=(e,t,o)=>{const r=e?.schema?.attributes??{};return Object.keys(r).filter(s=>t?s!==o:!0)},Gt=e=>({name:"forbiddenAttributeName",message:(0,d.Z)("error.attributeName.reserved-name"),test(t){return t?!e.includes(t):!1}}),y={default:()=>b.Z_().nullable(),max:()=>b.Rx().integer().nullable(),min:()=>b.Rx().integer().when("max",(e,t)=>e?t.max(e,(0,d.Z)("error.validation.minSupMax")):t).nullable(),maxLength:()=>b.Rx().integer().positive((0,d.Z)("error.validation.positive")).nullable(),minLength:()=>b.Rx().integer().min(0).when("maxLength",(e,t)=>e?t.max(e,(0,d.Z)("error.validation.minSupMax")):t).nullable(),name(e,t){return b.Z_().test(Dn(e)).test(Gt(t)).matches(In,R.I0.regex).required(R.I0.required)},required:()=>b.O7(),type:()=>b.Z_().required(R.I0.required),unique:()=>b.O7().nullable()},Kt=(e,t)=>({name:y.name(e,t),type:y.type(),default:y.default(),unique:y.unique(),required:y.required(),maxLength:y.maxLength(),minLength:y.minLength(),regex:b.Z_().test({name:"isValidRegExpPattern",message:(0,d.Z)("error.validation.regex"),test(r){return new RegExp(r)!==null}}).nullable()}),Ht={name:"isMinSuperiorThanMax",message:(0,d.Z)("error.validation.minSupMax"),test(e){if(!e)return!0;const{max:t}=this.parent;return!t||Number.isNaN(Vt()(e))?!0:Vt()(t)>=Vt()(e)}};var wt={date(e,t){const o={name:y.name(e,t),type:y.type()};return b.Ry(o)},datetime(e,t){const o={name:y.name(e,t),type:y.type()};return b.Ry(o)},time(e,t){const o={name:y.name(e,t),type:y.type()};return b.Ry(o)},default(e,t){const o={name:y.name(e,t),type:y.type()};return b.Ry(o)},biginteger(e,t){const o={name:y.name(e,t),type:y.type(),default:b.Z_().nullable().matches(/^-?\d*$/),unique:y.unique(),required:y.required(),max:b.Z_().nullable().matches(/^-?\d*$/,R.I0.regex),min:b.Z_().nullable().test(Ht).matches(/^-?\d*$/,R.I0.regex)};return b.Ry(o)},boolean(e,t){const o={name:y.name(e,t),default:b.O7().nullable(),required:y.required(),unique:y.unique()};return b.Ry(o)},component(e,t){const o={name:y.name(e,t),type:y.type(),required:y.required(),max:y.max(),min:y.min(),component:b.Z_().required(R.I0.required)};return b.Ry(o)},decimal(e,t){const o={name:y.name(e,t),type:y.type(),default:b.Rx(),required:y.required(),max:b.Rx(),min:b.Rx().test(Ht)};return b.Ry(o)},dynamiczone(e,t){const o={name:y.name(e,t),type:y.type(),required:y.required(),max:y.max(),min:y.min()};return b.Ry(o)},email(e,t){const o={name:y.name(e,t),type:y.type(),default:b.Z_().email().nullable(),unique:y.unique(),required:y.required(),maxLength:y.maxLength(),minLength:y.minLength()};return b.Ry(o)},enumeration(e,t){const o=/^[_A-Za-z][_0-9A-Za-z]*$/,r={name:b.Z_().test(Dn(e)).test(Gt(t)).matches(o,R.I0.regex).required(R.I0.required),type:y.type(),default:y.default(),unique:y.unique(),required:y.required(),enum:b.IX().of(b.Z_()).min(1,R.I0.min).test({name:"areEnumValuesUnique",message:(0,d.Z)("error.validation.enum-duplicate"),test(s){return!ho()(s.map(zt).filter((u,c,m)=>m.indexOf(u)!==c)).length}}).test({name:"doesNotHaveEmptyValues",message:(0,d.Z)("error.validation.enum-empty-string"),test:s=>!s.map(zt).some(i=>i==="")}).test({name:"doesMatchRegex",message:(0,d.Z)("error.validation.enum-regex"),test:s=>s.map(zt).every(i=>o.test(i))}),enumName:b.Z_().nullable()};return b.Ry(r)},float(e,t){const o={name:y.name(e,t),type:y.type(),required:y.required(),default:b.Rx(),max:b.Rx(),min:b.Rx().test(Ht)};return b.Ry(o)},integer(e,t){const o={name:y.name(e,t),type:y.type(),default:b.Rx().integer(),unique:y.unique(),required:y.required(),max:y.max(),min:y.min()};return b.Ry(o)},json(e,t){const o={name:y.name(e,t),type:y.type(),required:y.required(),unique:y.unique()};return b.Ry(o)},media(e,t){const o={name:y.name(e,t),type:y.type(),multiple:b.O7(),required:y.required(),allowedTypes:b.IX().of(b.Z_().oneOf(["images","videos","files","audios"])).min(1).nullable()};return b.Ry(o)},password(e,t){const o={name:y.name(e,t),type:y.type(),default:y.default(),unique:y.unique(),required:y.required(),maxLength:y.maxLength(),minLength:y.minLength()};return b.Ry(o)},relation(e,t,o,{initialData:r,modifiedData:s}){const i={name:y.name(e,t),target:b.Z_().required(R.I0.required),relation:b.Z_().required(),type:b.Z_().required(),targetAttribute:b.Vo(()=>{const u=(0,Ft.Z)(s.relation,s.targetAttribute);if(u==="oneWay"||u==="manyWay")return b.Z_().nullable();let c=b.Z_().test(Gt(t)),g=[...o.map(({name:f})=>f),s.name].filter(f=>f!==r.targetAttribute);return c.matches(In,R.I0.regex).test({name:"forbiddenTargetAttributeName",message:(0,d.Z)("error.validation.relation.targetAttribute-taken"),test(f){return f?!g.includes(f):!1}}).required(R.I0.required)})};return b.Ry(i)},richtext(e,t){const o={name:y.name(e,t),type:y.type(),default:y.default(),unique:y.unique(),required:y.required(),maxLength:y.maxLength(),minLength:y.minLength()};return b.Ry(o)},string(e,t){const o=Kt(e,t);return b.Ry(o)},text(e,t){const o=Kt(e,t);return b.Ry(o)},uid(e,t){const o=Kt(e,t);return b.Ry(o)}};const Pn={name:"displayName",type:"text",intlLabel:{id:(0,d.Z)("contentType.displayName.label"),defaultMessage:"Display name"}};var Yt={advanced:{default(){return{sections:[{items:[{intlLabel:{id:(0,d.Z)("contentType.draftAndPublish.label"),defaultMessage:"Draft & publish"},description:{id:(0,d.Z)("contentType.draftAndPublish.description"),defaultMessage:"Allows writing a draft version of an entry, before it is published"},name:"draftAndPublish",type:"toggle-draft-publish",validations:{}}]}]}}},base:{create(){return{sections:[{sectionTitle:null,items:[Pn,{description:{id:(0,d.Z)("contentType.apiId-singular.description"),defaultMessage:"Used to generate the API routes and databases tables/collections"},intlLabel:{id:(0,d.Z)("contentType.apiId-singular.label"),defaultMessage:"API ID (Singular)"},name:"singularName",type:"text-singular"},{type:"pushRight",size:6,intlLabel:{id:"",defaultMessage:""},name:"pushRight"},{description:{id:(0,d.Z)("contentType.apiId-plural.description"),defaultMessage:"Pluralized API ID"},intlLabel:{id:(0,d.Z)("contentType.apiId-plural.label"),defaultMessage:"API ID (Plural)"},name:"pluralName",type:"text-plural"}]}]}},edit(){return{sections:[{sectionTitle:null,items:[Pn,{disabled:!0,description:{id:(0,d.Z)("contentType.apiId-singular.description"),defaultMessage:"Used to generate the API routes and databases tables/collections"},intlLabel:{id:(0,d.Z)("contentType.apiId-singular.label"),defaultMessage:"API ID (Singular)"},name:"singularName",type:"text"},{type:"pushRight",size:6,intlLabel:{id:"",defaultMessage:""},name:"pushRight"},{disabled:!0,description:{id:(0,d.Z)("contentType.apiId-plural.description"),defaultMessage:"Pluralized API ID"},intlLabel:{id:(0,d.Z)("contentType.apiId-plural.label"),defaultMessage:"API ID (Plural)"},name:"pluralName",type:"text"},{intlLabel:{id:"global.type",defaultMessage:"Type"},name:"kind",type:"content-type-radio-group",size:12,radios:[{title:{id:(0,d.Z)("form.button.collection-type.name"),defaultMessage:"Collection Type"},description:{id:(0,d.Z)("form.button.collection-type.description"),defaultMessage:"Best for multiple instances like articles, products, comments, etc."},value:"collectionType"},{title:{id:(0,d.Z)("form.button.single-type.name"),defaultMessage:"Single Type"},description:{id:(0,d.Z)("form.button.single-type.description"),defaultMessage:"Best for single instance like about us, homepage, etc."},value:"singleType"}]}]}]}}}},Mo=({usedContentTypeNames:e=[],reservedModels:t=[],singularNames:o=[],pluralNames:r=[]})=>{const s={displayName:b.Z_().test({name:"nameAlreadyUsed",message:R.I0.unique,test(i){if(!i)return!1;const u=(0,Ie.E)(i);return!e.includes(u)}}).test({name:"nameNotAllowed",message:(0,d.Z)("error.contentTypeName.reserved-name"),test(i){return i?!t.includes(i?.trim()?.toLowerCase()):!1}}).required(R.I0.required),pluralName:b.Z_().test({name:"pluralNameAlreadyUsed",message:R.I0.unique,test(i){return i?!r.includes(i):!1}}).test({name:"pluralAndSingularAreUnique",message:(0,d.Z)("error.contentType.pluralName-used"),test(i,u){return i?u.parent.singularName!==i:!1}}).test({name:"pluralNameNotAllowed",message:(0,d.Z)("error.contentTypeName.reserved-name"),test(i){return i?!t.includes(i?.trim()?.toLowerCase()):!1}}).required(R.I0.required),singularName:b.Z_().test({name:"singularNameAlreadyUsed",message:R.I0.unique,test(i){return i?!o.includes(i):!1}}).test({name:"pluralAndSingularAreUnique",message:(0,d.Z)("error.contentType.singularName-used"),test(i,u){return i?u.parent.pluralName!==i:!1}}).test({name:"singularNameNotAllowed",message:(0,d.Z)("error.contentTypeName.reserved-name"),test(i){return i?!t.includes(i?.trim()?.toLowerCase()):!1}}).required(R.I0.required),draftAndPublish:b.O7(),kind:b.Z_().oneOf(["singleType","collectionType"])};return b.Ry(s)},Qt={advanced:{default(){return{sections:De.advanced("componentToCreate.")}}},base:{createComponent(){return{sections:[{sectionTitle:null,items:[Wt]},...De.base("componentToCreate.")]}},default(){return{sections:[{sectionTitle:null,items:[Wt]},{sectionTitle:null,items:[{type:"pushRight",size:6,intlLabel:{id:"",defaultMessage:""},name:"pushRight"},{name:"components",type:"select-components",intlLabel:{id:(0,d.Z)("modalForm.attributes.select-components"),defaultMessage:"Select the components"},isMultiple:!0}]}]}}}},qn=(e,t)=>{e.forEach(o=>{if(!("sectionTitle"in o)){t[0].items.push(o);return}t.push(o)})},kn=(e,t)=>e.filter(({name:o})=>o!==t.initialData.name).map(({name:o})=>o),Re={customField:{schema({schemaAttributes:e,attributeType:t,customFieldValidator:o,reservedNames:r,schemaData:s,ctbFormsAPI:i}){const u=kn(e,s),c=wt[t](u,r.attributes);return i.makeCustomFieldValidator(c,o,u,r.attributes,s)},form:{base({customField:e}){const t=[{sectionTitle:null,items:[ge]}];return e.options?.base&&qn(e.options.base,t),{sections:t}},advanced({customField:e,data:t,step:o,extensions:r,...s}){const i=[{sectionTitle:null,items:[]}],u=r.getAdvancedForm(["attribute",e.type],{data:t,type:e.type,step:o,...s});if(e.options?.advanced&&qn(e.options.advanced,i),u){const c={sectionTitle:{id:(0,d.Z)("modalForm.custom-fields.advanced.settings.extended"),defaultMessage:"Extended settings"},items:u};i.push(c)}return{sections:i}}}},attribute:{schema(e,t,o,r,s,i){const u=h()(e,["schema","attributes"],[]),c=kn(u,s);try{let m=wt[t](c,o.attributes,r,s);return i.makeValidator(["attribute",t],m,c,o.attributes,r,s)}catch(m){return console.error("Error yup build schema",m),wt.default(c,o.attributes)}},form:{advanced({data:e,type:t,step:o,extensions:r,...s}){try{const i=Ln.advanced[t](e,o).sections,u=r.getAdvancedForm(["attribute",t],{data:e,type:t,step:o,...s});return{sections:i.reduce((m,g)=>(g.sectionTitle===null?m.push(g):m.push({...g,items:[...g.items,...u]}),m),[])}}catch(i){return console.error(i),{sections:[]}}},base({data:e,type:t,step:o,attributes:r}){try{return Ln.base[t](e,o,r)}catch{return yo}}}},contentType:{schema(e,t,o,r,s,i){const u=Object.values(i).map(v=>v.schema.singularName),c=Object.values(i).map(v=>h()(v,["schema","pluralName"],"")),m=t?e.filter(v=>v!==o):e,g=t?u.filter(v=>h()(i,[o,"schema","singularName"],"")!==v):u,f=t?c.filter(v=>h()(i,[o,"schema","pluralName"],"")!==v):c,p=Mo({usedContentTypeNames:m,reservedModels:r.models,singularNames:g,pluralNames:f});return s.makeValidator(["contentType"],p,m,r.models,g,f)},form:{base({actionType:e}){return e==="create"?Yt.base.create():Yt.base.edit()},advanced({extensions:e}){const t=Yt.advanced.default().sections.map(r=>r.items).flat(),o=e.getAdvancedForm(["contentType"]);return{sections:[{items:[...t,...o]}]}}}},component:{schema(e,t,o,r=!1,s=null){const i=r?e.filter(u=>u!==s):e;return po(i,o.models,t)},form:{advanced(){return{sections:De.advanced()}},base(){return{sections:De.base()}}}},addComponentToDynamicZone:{form:{advanced(){return Qt.advanced.default()},base({data:e}){return h()(e,"createComponent",!1)?Qt.base.createComponent():Qt.base.default()}}},editCategory:{schema(e,t){const o=e.filter(r=>r!==t.name).map(r=>xe()(r));return mo(o)},form:{advanced:()=>({sections:[]}),base(){return co.base}}}},$n=l(98178),Eo=l(25061);const Ro=()=>e=>e[`${V.Z}_formModal`]||Eo.E;var Zo=()=>(0,$n.P1)(Ro(),e=>e),Ao=()=>{const{onCloseModal:e,onNavigateToChooseAttributeModal:t,onNavigateToAddCompoToDZModal:o,onNavigateToCreateComponentStep2:r,actionType:s,attributeName:i,attributeType:u,customFieldUid:c,categoryName:m,dynamicZoneTarget:g,forTarget:f,modalType:p,isOpen:v,kind:T,step:S,targetUid:N}=(0,he.Z)(),P=(0,R.mZ)().get(c),M=(0,a.useRef)(),C=(0,a.useMemo)(Zo,[]),A=(0,be.I0)(),W=(0,R.lm)(),z=(0,be.v9)(D=>C(D),be.wU),{push:ee}=(0,B.k6)(),{trackUsage:O}=(0,R.rS)(),{formatMessage:Y}=(0,q.Z)(),{getPlugin:re}=(0,R.j1)(),oe=re(V.Z).apis.forms,Pe=oe.components.inputs,{addAttribute:G,addCustomFieldAttribute:qe,addCreatedComponentToDynamicZone:_,allComponentsCategories:U,changeDynamicZoneComponents:E,contentTypes:ke,components:Ke,createSchema:$e,deleteCategory:_t,deleteData:st,editCategory:en,editCustomFieldAttribute:tn,submitData:nn,modifiedData:te,nestedComponents:an,setModifiedData:on,sortedContentTypesList:sn,updateSchema:rn,reservedNames:Te}=(0,Ee.Z)(),{componentToCreate:He,formErrors:Ce,initialData:se,isCreatingComponentWhileAddingAField:Ze,modifiedData:L}=z,x=f==="contentType"||f==="component"?[f]:[f,N];(0,a.useEffect)(()=>{if(v){const D=sn.filter(cn);p==="editCategory"&&on(),s==="edit"&&p==="attribute"&&f==="contentType"&&O("willEditFieldOfContentType");const ue=[...x,"schema","attributes"],me=kt(h()(te,ue,[]),g)||null;if(p==="editCategory"&&s==="edit"&&A({type:w._H,modalType:p,actionType:s,data:{name:m}}),p==="contentType"&&s==="create"&&A({type:w._H,modalType:p,actionType:s,data:{draftAndPublish:!0},pluginOptions:{}}),p==="contentType"&&s==="edit"){const{displayName:k,draftAndPublish:X,kind:pe,pluginOptions:ne,pluralName:Ss,singularName:Fs}=h()(te,[...x,"schema"],{displayName:null,pluginOptions:{},singularName:null,pluralName:null});A({type:w._H,actionType:s,modalType:p,data:{displayName:k,draftAndPublish:X,kind:pe,pluginOptions:ne,pluralName:Ss,singularName:Fs}})}if(p==="component"&&s==="edit"){const k=h()(te,x,{});A({type:w._H,actionType:s,modalType:p,data:{displayName:k.schema.displayName,category:k.category}})}if(p==="addComponentToDynamicZone"&&s==="edit"){const k={...me,components:[],name:g,createComponent:!1,componentToCreate:{type:"component"}};A({type:w.VZ,attributeToEdit:k})}if(u){const X={...kt(h()(te,ue,[]),i),name:i};u==="component"&&s==="edit"&&(X.repeatable||Qe()(X,"repeatable",!1)),A(p==="customField"?{type:w.OY,customField:P,isEditing:s==="edit",modifiedDataToSetForEditing:X,forTarget:f}:{type:w.S0,attributeType:u,nameToSetForRelation:h()(D,["0","title"],"error"),targetUid:h()(D,["0","uid"],"error"),isEditing:s==="edit",modifiedDataToSetForEditing:X,step:S,forTarget:f})}}else A({type:w.c2})},[s,i,u,m,g,f,v,p]);const F=p==="contentType",I=p==="component",K=p==="attribute",ie=p==="customField",le=u==="component"&&K,de=s==="create",fe=h()(L,"createComponent",!1)||Ze,Ue=S==="1",Jn=p==="editCategory",_n=p==="chooseAttribute",ln=(0,Ie.E)(L.displayName||""),un=h()(te,[...x,"schema","attributes"],null),gs=async()=>{let D;const ue=fe&&S==="1"?h()(L,"componentToCreate",{}):L;if(F)D=Re.contentType.schema(Object.keys(ke),s==="edit",h()(te,[...x,"uid"],null),Te,oe,ke);else if(I)D=Re.component.schema(Object.keys(Ke),L.category||"",Te,s==="edit",h()(te,[...x,"uid"],null),oe);else if(ie)D=Re.customField.schema({schemaAttributes:h()(te,[...x,"schema","attributes"],[]),attributeType:P.type,reservedNames:Te,schemaData:{modifiedData:L,initialData:se},ctbFormsAPI:oe,customFieldValidator:P.options?.validator});else if(le&&fe&&Ue)D=Re.component.schema(Object.keys(Ke),h()(L,"componentToCreate.category",""),Te,oe);else if(K&&!Ue){const me=u==="relation"?"relation":L.type;let k=[];if(me==="relation"){const X=h()(L,["target"],null);k=h()(ke,[X,"schema","attributes"],[]).filter(({name:ne})=>s!=="edit"?!0:ne!==se.targetAttribute)}D=Re.attribute.schema(h()(te,x,{}),me,Te,k,{modifiedData:L,initialData:se},oe)}else if(Jn)D=Re.editCategory.schema(U,se,oe);else if(Ue&&fe)D=Re.component.schema(Object.keys(Ke),h()(L,"componentToCreate.category",""),Te,oe);else return;await D.validate(ue,{abortEarly:!1})},ea=(0,a.useCallback)(({target:{name:D,value:ue,type:me,...k}})=>{const X=["enumName","max","min","maxLength","minLength","regex","default"];let pe;X.includes(D)&&ue===""?pe=null:pe=ue;const ne=Object.assign({},Ce);D==="max"&&delete ne.min,D==="maxLength"&&delete ne.minLength,delete ne[D],A({type:w.Ey,errors:ne}),A({type:w.P0,keys:D.split("."),value:pe,...k})},[A,Ce]),ce=async(D,ue=de)=>{D.preventDefault();try{await gs(),bs(ue);const me=f==="components"?N:ln;if(F)if(de)$e({...L,kind:T},p,ln),ee({pathname:`/plugins/${V.Z}/content-types/${ln}`}),t({forTarget:f,targetUid:me});else{lo(te,L)?(e(),nn(L)):W({type:"warning",message:{id:"notification.contentType.relations.conflict"}});return}else if(p==="component")if(de){const k=(0,Ie.N)(L.displayName,L.category),{category:X,...pe}=L;$e(pe,"component",k,X),ee({pathname:`/plugins/${V.Z}/component-categories/${X}/${k}`}),t({forTarget:f,targetUid:k})}else{rn(L,p,N),e();return}else if(Jn){if(xe()(se.name)===xe()(L.name)){e();return}en(se.name,L);return}else if(ie){const k={attributeToSet:{...L,customField:c},forTarget:f,targetUid:N,initialAttribute:se};s==="edit"?tn(k):qe(k),ue?t({forTarget:f,targetUid:me}):e();return}else if(K&&!fe){if(u==="dynamiczone"){G(L,f,N,s==="edit",se),de?(A({type:w.I}),M.current._handlers.setSelectedTabIndex(0),o({dynamicZoneTarget:L.name})):e();return}if(!le){G(L,f,N,s==="edit",se),ue?t({forTarget:f,targetUid:me}):e();return}if(Ue){r(),A({type:w.yC,forTarget:f});return}G(L,f,N,s==="edit",se,!0),ue?t({forTarget:f,targetUid:N}):e()}else if(K&&fe){if(Ue){O("willCreateComponentFromAttributesModal"),A({type:w.oF,forTarget:f}),r();return}const{category:k,type:X,...pe}=He,ne=(0,Ie.N)(He.displayName,k);$e(pe,X,ne,k,fe),G(L,f,N,!1),A({type:w.c2}),ue?t({forTarget:"components",targetUid:ne}):e();return}else{if(Ue)if(fe){const{category:k,type:X,...pe}=L.componentToCreate,ne=(0,Ie.N)(L.componentToCreate.displayName,k);$e(pe,X,ne,k,fe),_(g,[ne]),t({forTarget:"components",targetUid:ne})}else E(g,L.components),e();else console.error("This case is not handled");return}A({type:w.c2})}catch(me){const k=(0,R.CJ)(me);console.log({err:me,errors:k}),A({type:w.Ey,errors:k})}},fs=()=>{window.confirm(Y({id:"window.confirm.close-modal.file",defaultMessage:"Are you sure? Your changes will be lost."}))&&(e(),A({type:w.c2}))},ta=()=>{gt()(L,se)?(e(),A({type:w.c2})):fs()},ys=D=>{if(D==="advanced"){if(F){O("didSelectContentTypeSettings");return}f==="contentType"&&O("didSelectContentTypeFieldSettings")}},bs=D=>{p==="attribute"&&f==="contentType"&&u!=="dynamiczone"&&D&&O("willAddMoreFieldToContentType")},hs=()=>!!(p==="editCategory"||p==="component"||Je()(L,"createComponent")),vs=uo(f,N,an);if(!v||!p)return null;const na=h()(Re,[p,"form"],{advanced:()=>({sections:[]}),base:()=>({sections:[]})}),Ts=f==="components"||f==="component",aa={customInputs:{"allowed-types-select":da,"boolean-radio-group":La,"checkbox-with-number-field":Da,"content-type-radio-group":Pa,"radio-group":At,relation:Qa,"select-category":eo,"select-component":to,"select-components":no,"select-default-boolean":Fa,"select-number":oo,"select-date":ao,"toggle-draft-publish":Ra,"text-plural":Xa,"text-singular":so,"textarea-enum":io,...Pe},componentToCreate:He,dynamicZoneTarget:g,formErrors:Ce,isAddingAComponentToAnotherComponent:Ts,isCreatingComponentWhileAddingAField:Ze,mainBoxHeader:h()(te,[...x,"schema","displayName"],""),modifiedData:L,naturePickerType:f,isCreating:de,targetUid:N,forTarget:f},oa=na.advanced({data:L,type:u,step:S,actionType:s,attributes:un,extensions:oe,forTarget:f,contentTypeSchema:te.contentType||{},customField:P}).sections,sa=na.base({data:L,type:u,step:S,actionType:s,attributes:un,extensions:oe,forTarget:f,contentTypeSchema:te.contentType||{},customField:P}).sections,Cs=Nn(sa),Ms=Nn(oa),Es=Object.keys(Ce).some(D=>Cs.includes(D)),Rs=Object.keys(Ce).some(D=>Ms.includes(D)),Zs=h()(ke,[N,"schema","kind"]),As=()=>s==="edit"&&un.every(({name:D})=>D!==L?.name),xs=()=>{As()&&O("didEditFieldNameOnContentType")};return a.createElement(mt.P,{onClose:ta,labelledBy:"title"},a.createElement(Za,{actionType:s,attributeName:i,categoryName:m,contentTypeKind:T,dynamicZoneTarget:g,modalType:p,forTarget:f,targetUid:N,attributeType:u,customFieldUid:c}),_n&&a.createElement(Ea,{attributes:vs,forTarget:f,kind:Zs||"collectionType"}),!_n&&a.createElement("form",{onSubmit:ce},a.createElement(We.f,null,a.createElement(ze.v,{label:"todo",id:"tabs",variant:"simple",ref:M,onTabChange:D=>{D===1&&ys("advanced")}},a.createElement($.k,{justifyContent:"space-between"},a.createElement(Sa,{actionType:s,forTarget:f,kind:T,step:S,modalType:p,attributeType:u,attributeName:i,customField:P}),a.createElement(Ne.m,null,a.createElement(Ne.O,{hasError:Es},Y({id:(0,d.Z)("popUpForm.navContainer.base"),defaultMessage:"Basic settings"})),a.createElement(Ne.O,{hasError:Rs,disabled:hs()},Y({id:(0,d.Z)("popUpForm.navContainer.advanced"),defaultMessage:"Advanced settings"})))),a.createElement(pt.i,null),a.createElement(j.x,{paddingTop:6},a.createElement(Oe.n,null,a.createElement(Oe.x,null,a.createElement($.k,{direction:"column",alignItems:"stretch",gap:6},a.createElement(Fn,{form:sa,formErrors:Ce,genericInputProps:aa,modifiedData:L,onChange:ea}))),a.createElement(Oe.x,null,a.createElement($.k,{direction:"column",alignItems:"stretch",gap:6},a.createElement(Fn,{form:oa,formErrors:Ce,genericInputProps:aa,modifiedData:L,onChange:ea}))))))),a.createElement(ra.m,{endActions:a.createElement(Aa,{deleteCategory:_t,deleteContentType:st,deleteComponent:st,categoryName:se.name,isAttributeModal:p==="attribute",isCustomFieldModal:p==="customField",isComponentToDzModal:p==="addComponentToDynamicZone",isComponentAttribute:u==="component",isComponentModal:p==="component",isContentTypeModal:p==="contentType",isCreatingComponent:s==="create",isCreatingDz:s==="create",isCreatingComponentAttribute:L.createComponent||!1,isCreatingComponentInDz:L.createComponent||!1,isCreatingComponentWhileAddingAField:Ze,isCreatingContentType:s==="create",isEditingAttribute:s==="edit",isDzAttribute:u==="dynamiczone",isEditingCategory:p==="editCategory",isInFirstComponentStep:S==="1",onSubmitAddComponentAttribute:ce,onSubmitAddComponentToDz:ce,onSubmitCreateComponent:ce,onSubmitCreateContentType:ce,onSubmitCreateDz:ce,onSubmitEditAttribute:ce,onSubmitEditCategory:ce,onSubmitEditComponent:ce,onSubmitEditContentType:ce,onSubmitEditCustomFieldAttribute:ce,onSubmitEditDz:ce,onClickFinish:xs}),startActions:a.createElement(H.z,{variant:"tertiary",onClick:ta},Y({id:"app.components.Button.cancel",defaultMessage:"Cancel"}))})))},Un=e=>e.reduce((t,o)=>(t[o.uid]=o,t),{}),xo=(e,t,o,r)=>{const s=t.reduce((c,m)=>{const g=h()(o,m,{});return c[m]=g,c},{});return{[r?"contentType":"component"]:e,components:s}},So=(e,t)=>{const o=Object.keys(e).map(r=>h()(e,[r,...t],""));return(0,Me.Z)(o)},Fo=l(13339);const No=e=>{const t=Object.keys(e).reduce((o,r)=>{const s=e?.[r]?.schema?.attributes??[],i=Oo(s);return[...o,...i]},[]);return(0,Me.Z)(t)},Oo=e=>e.reduce((t,o)=>{const{type:r,component:s}=o;return r==="component"&&t.push(s),t},[]);var Bn=No;const Lo=e=>{const t=Object.keys(e).reduce((o,r)=>{const s=h()(e,[r],{}),i=s.uid;return Io(s)&&o.push(i),o},[]);return(0,Me.Z)(t)},Io=e=>h()(e,["schema","attributes"],[]).some(o=>{const{type:r}=o;return r==="component"});var Do=l(9086),jn=l.n(Do),Po=l(98978),Xt=l.n(Po),qo=l(39935),ko=l.n(qo);const $o=(e,t)=>{const o=Object.keys(e).filter(r=>{const s=h()(e,r,{}),i=h()(t,r,{}),u=h()(s,["isTemporary"],!1),c=!gt()(s,i);return u||c});return(0,Me.Z)(o)},Uo=(e,t)=>{const o=zn(h()(e,"schema.attributes",[]),t),r=h()(e,"isTemporary",!1)?{tmpUID:e.uid}:{uid:e.uid};return Object.assign({},r,{category:e.category},jn()(e.schema,"attributes"),{attributes:o})},Wn=(e,t=!1)=>{const o=h()(e,"uid",null),r=zn(h()(e,"schema.attributes",[]),o),s=t?{category:h()(e,"category","")}:{},i=Object.assign(s,jn()(e.schema,"attributes"),{attributes:r});return delete i.uid,delete i.isTemporary,delete i.visible,delete i.restrictRelationsTo,i},zn=(e,t)=>e.reduce((o,{name:r,...s})=>{const i=s,u=i.target===t,c=i.type==="relation",m=h()(i,"targetAttribute",null);if(!u)if(c){const g=Object.assign({},i,{targetAttribute:Vn(m)});o[r]=ot(g)}else o[r]=ot(i);if(u){const g=i.target,f=Object.assign({},i,{target:g,targetAttribute:Vn(m)});o[r]=ot(f)}if(i.customField){const g={...i,type:"customField"};o[r]=ot(g)}return o},{}),Vn=e=>e==="-"?null:e,ot=e=>Object.keys(e).reduce((t,o)=>(e[o]!==null&&o!=="plugin"&&(t[o]=e[o]),t),{}),Bo=(e,t,o,r=!1)=>$o(e,t).map(u=>{const c=h()(e,u,{});return Uo(c,o,r)}),jo=e=>Xt()(Object.keys(e).map(t=>({visible:e[t].schema.visible,name:t,title:e[t].schema.displayName,plugin:e[t].plugin||null,uid:t,to:`/plugins/${V.Z}/content-types/${t}`,kind:e[t].schema.kind,restrictRelationsTo:e[t].schema.restrictRelationsTo})).filter(t=>t!==null),t=>ko()(t.title)),Gn="did-not-kill-server",Wo="server is down";function Ve(e,t){return new Promise(o=>{fetch(`${strapi.backendURL}/_health`,{method:"HEAD",mode:"no-cors",headers:{"Content-Type":"application/json","Keep-Alive":!1}}).then(r=>{if(r.status>=400)throw new Error(Wo);if(!t)throw new Error(Gn);o(e)}).catch(r=>{setTimeout(()=>Ve(e,r.message!==Gn).then(o),100)})})}var zo=e=>Object.values(e.attributes).filter(({type:o})=>o==="dynamiczone").every(({components:o})=>Array.isArray(o)&&o.length>0),J=l(31947),Vo=l(54370);const Go=()=>e=>e[`${V.Z}_dataManagerProvider`]||Vo.E;var Ko=()=>(0,$n.P1)(Go(),e=>e);const Ho=e=>Object.keys(e).reduce((t,o)=>{const r=e[o].schema;return t[o]={...e[o],schema:{...r,attributes:wo(r.attributes)}},t},{}),wo=e=>Object.keys(e).reduce((t,o)=>(t.push({...e[o],name:o}),t),[]);var Kn=Ho;const Jt=({children:e,components:t,contentTypes:o,isLoading:r,isLoadingForDataToBeSet:s,initialData:i,modifiedData:u,reservedNames:c})=>{const m=(0,be.I0)(),g=(0,R.lm)(),{lockAppWithAutoreload:f,unlockAppWithAutoreload:p}=(0,R.Vu)(),{setCurrentStep:v}=(0,R.c1)(),{getPlugin:T}=(0,R.j1)(),{apis:S}=T(V.Z),{autoReload:N}=(0,R.QI)(),{formatMessage:P}=(0,q.Z)(),{trackUsage:M}=(0,R.rS)(),{refetchPermissions:C}=(0,R.vn)(),{pathname:A}=(0,B.TH)(),{onCloseModal:W}=(0,he.Z)(),z=(0,B.$B)(`/plugins/${V.Z}/content-types/:uid`),ee=(0,B.$B)(`/plugins/${V.Z}/component-categories/:categoryUid/:componentUid`),O=(0,R.kY)(),{put:Y,post:re,del:Ge}=O,oe=(0,a.useRef)();oe.current=P;const Pe=N,G=z!==null,qe=G?"contentType":"component",_=G?h()(z,"params.uid",null):h()(ee,"params.componentUid",null),U=(0,a.useRef)(),E=G?"content-types":"components";U.current=async()=>{try{const[{data:{data:x}},{data:{data:F}},{data:I}]=await Promise.all(["components","content-types","reserved-names"].map(fe=>O.get(`/${V.Z}/${fe}`))),K=Un(x),ie=Kn(K),le=Un(F),de=Kn(le);m({type:J.Id,components:ie,contentTypes:de,reservedNames:I})}catch(x){console.error({err:x}),g({type:"warning",message:{id:"notification.error"}})}},(0,a.useEffect)(()=>(U.current(),()=>{m({type:J.Zl})}),[]),(0,a.useEffect)(()=>{!r&&_&&Te()},[r,A,_]),(0,a.useEffect)(()=>{N||g({type:"info",message:{id:(0,d.Z)("notification.info.autoreaload-disable")}})},[N,g]);const ke=(x,F,I,K=!1,ie,le=!1)=>{const de=K?J.JO:J.gz;m({type:de,attributeToSet:x,forTarget:F,targetUid:I,initialAttribute:ie,shouldAddComponentToData:le})},Ke=({attributeToSet:x,forTarget:F,targetUid:I,initialAttribute:K})=>{m({type:J.Ir,attributeToSet:x,forTarget:F,targetUid:I,initialAttribute:K})},$e=({attributeToSet:x,forTarget:F,targetUid:I,initialAttribute:K})=>{m({type:J.Ly,attributeToSet:x,forTarget:F,targetUid:I,initialAttribute:K})},_t=(x,F)=>{m({type:J.Uu,dynamicZoneTarget:x,componentsToAdd:F})},st=(x,F,I,K,ie=!1)=>{const le=F==="contentType"?J.Sh:J.VR;m({type:le,data:x,componentCategory:K,schemaType:F,uid:I,shouldAddComponentToData:ie})},en=(x,F)=>{m({type:J.o_,dynamicZoneTarget:x,newComponents:F})},tn=(x,F,I="")=>{const K=x==="components"?J.lw:J.ai;x==="contentType"&&M("willDeleteFieldOfContentType"),m({type:K,mainDataKey:x,attributeToRemoveName:F,componentUid:I})},nn=async x=>{try{const F=`/${V.Z}/component-categories/${x}`,I=window.confirm(P({id:(0,d.Z)("popUpWarning.bodyMessage.category.delete")}));W(),I&&(f(),await Ge(F),await Ve(!0),await p(),await Ze())}catch(F){console.error({err:F}),g({type:"warning",message:{id:"notification.error"}})}finally{p()}},te=async()=>{try{const x=`/${V.Z}/${E}/${_}`,F=h()(u,[qe,"isTemporary"],!1),I=window.confirm(P({id:(0,d.Z)(`popUpWarning.bodyMessage.${G?"contentType":"component"}.delete`)}));if(W(),I){if(F){m({type:J.Ap});return}f(),await Ge(x),await Ve(!0),await p(),await Ze()}}catch(x){console.error({err:x}),g({type:"warning",message:{id:"notification.error"}})}finally{p()}},an=async(x,F)=>{try{const I=`/${V.Z}/component-categories/${x}`;W(),f(),await Y(I,F),await Ve(!0),await p(),await Ze()}catch(I){console.error({err:I}),g({type:"warning",message:{id:"notification.error"}})}finally{p()}},on=()=>{const x=Object.assign({},t,u.components);if(!G){const I=h()(u,"component",{});Qe()(x,h()(I,["uid"],""),I)}const F=Lo(x);return(0,Me.Z)(F)},sn=()=>{const x=Bn(t),F=Bn(u.components||{});return(0,Me.Z)([...F,...x])},rn=(x,F)=>{m({type:J.NG,dzName:x,componentToRemoveIndex:F})},Te=()=>{const x=G?o:t,F=h()(x,_,{schema:{attributes:[]}}),I=(0,Fo.Z)(F.schema.attributes,t),K=xo(F,I,t,G),ie=h()(F,"isTemporary",!1)&&dt()(h()(F,"schema.attributes",[]))===0;m({type:J.xx,schemaToSet:K,hasJustCreatedSchema:ie})},He=(0,a.useMemo)(()=>{const x=G?o:t;return _==="create-content-type"?!1:!Object.keys(x).includes(_)&&!r},[t,o,_,G,r]),Ce=(0,a.useMemo)(()=>{const x=Object.keys(o).filter(F=>h()(o,[F,"schema","visible"],!0)).sort();return h()(x,"0","create-content-type")},[o]);if(He)return a.createElement(B.l_,{to:`/plugins/${V.Z}/content-types/${Ce}`});const se=async x=>{try{const F=h()(u,[qe,"isTemporary"],!1),I={components:Bo(u.components,t,_,F)};if(G){const le=S.forms.mutateContentTypeSchema({...Wn(u.contentType),...x},i.contentType);if(!zo(le)){g({type:"warning",message:{id:(0,d.Z)("notification.error.dynamiczone-min.validation"),defaultMessage:"At least one component is required in a dynamic zone to be able to save a content type"}});return}I.contentType=le,M("willSaveContentType")}else I.component=Wn(u.component,!0),M("willSaveComponent");f();const K=`/${V.Z}/${E}`,ie=F?K:`${K}/${_}`;if(F?await re(ie,I):await Y(ie,I),await Ve(!0),await p(),F&&(i.contentType?.schema.kind==="collectionType"||i.contentType?.schema.kind==="singleType")&&v("contentTypeBuilder.success"),G){M("didSaveContentType");const le=h()(I,["contentType","schema","name"],""),de=h()(i,["contentType","schema","name"],"");!F&&le!==de&&M("didEditNameOfContentType")}else M("didSaveComponent");await Ze()}catch(F){G||M("didNotSaveComponent"),console.error({err:F.response}),g({type:"warning",message:{id:"notification.error"}})}finally{p()}},Ze=async()=>{await C()},L=(x,F,I)=>{m({type:J.bi,data:x,schemaType:F,uid:I})};return a.createElement(ct.Z.Provider,{value:{addAttribute:ke,addCustomFieldAttribute:Ke,addCreatedComponentToDynamicZone:_t,allComponentsCategories:So(t,["category"]),changeDynamicZoneComponents:en,components:t,componentsGroupedByCategory:Be()(t,"category"),componentsThatHaveOtherComponentInTheirAttributes:on(),contentTypes:o,createSchema:st,deleteCategory:nn,deleteData:te,editCategory:an,editCustomFieldAttribute:$e,isInDevelopmentMode:Pe,initialData:i,isInContentTypeView:G,modifiedData:u,nestedComponents:sn(),removeAttribute:tn,removeComponentFromDynamicZone:rn,reservedNames:c,setModifiedData:Te,sortedContentTypesList:jo(o),submitData:se,updateSchema:L}},s?a.createElement(R.dO,null):a.createElement(a.Fragment,null,e,Pe&&a.createElement(Ao,null)))};Jt.defaultProps={components:{}},Jt.propTypes={children:n().node.isRequired,components:n().object,contentTypes:n().object.isRequired,isLoading:n().bool.isRequired,isLoadingForDataToBeSet:n().bool.isRequired,initialData:n().object.isRequired,modifiedData:n().object.isRequired,reservedNames:n().object.isRequired};const Yo=Ko(),Qo=(0,be.$j)(Yo,null);var Xo=(0,Xe.compose)(Qo)((0,a.memo)(Jt)),Jo=l(51216);const Hn={actionType:null,attributeName:null,attributeType:null,categoryName:null,dynamicZoneTarget:null,forTarget:null,modalType:null,isOpen:!1,kind:null,step:null,targetUid:null,customFieldUid:null},wn=({children:e})=>{const[t,o]=(0,a.useState)(Hn),{trackUsage:r}=(0,R.rS)(),s=({attributeType:M,customFieldUid:C})=>{o(A=>({...A,actionType:"create",modalType:"customField",attributeType:M,customFieldUid:C}))},i=({attributeType:M,step:C})=>{t.forTarget==="contentType"&&r("didSelectContentTypeFieldType",{type:M}),o(A=>({...A,actionType:"create",modalType:"attribute",step:C,attributeType:M}))},u=({dynamicZoneTarget:M,targetUid:C})=>{o(A=>({...A,dynamicZoneTarget:M,targetUid:C,modalType:"addComponentToDynamicZone",forTarget:"contentType",step:"1",actionType:"edit",isOpen:!0}))},c=({forTarget:M,targetUid:C})=>{o(A=>({...A,actionType:"create",forTarget:M,targetUid:C,modalType:"chooseAttribute",isOpen:!0}))},m=M=>{o(C=>({...C,...M,isOpen:!0}))},g=M=>{o(C=>({...C,categoryName:M,actionType:"edit",modalType:"editCategory",isOpen:!0}))},f=({forTarget:M,targetUid:C,attributeName:A,attributeType:W,customFieldUid:z})=>{o(ee=>({...ee,modalType:"customField",customFieldUid:z,actionType:"edit",forTarget:M,targetUid:C,attributeName:A,attributeType:W,isOpen:!0}))},p=({forTarget:M,targetUid:C,attributeName:A,attributeType:W,step:z})=>{o(ee=>({...ee,modalType:"attribute",actionType:"edit",forTarget:M,targetUid:C,attributeName:A,attributeType:W,step:z,isOpen:!0}))},v=({modalType:M,forTarget:C,targetUid:A,kind:W})=>{o(z=>({...z,modalType:M,actionType:"edit",forTarget:C,targetUid:A,kind:W,isOpen:!0}))},T=()=>{o(Hn)},S=({forTarget:M,targetUid:C})=>{o(A=>({...A,forTarget:M,targetUid:C,modalType:"chooseAttribute"}))},N=()=>{o(M=>({...M,attributeType:"component",modalType:"attribute",step:"2"}))},P=({dynamicZoneTarget:M})=>{o(C=>({...C,dynamicZoneTarget:M,modalType:"addComponentToDynamicZone",actionType:"create",step:"1",attributeType:null,attributeName:null}))};return a.createElement(Jo.Z.Provider,{value:{...t,onClickSelectField:i,onClickSelectCustomField:s,onCloseModal:T,onNavigateToChooseAttributeModal:S,onNavigateToAddCompoToDZModal:P,onOpenModalAddComponentsToDZ:u,onNavigateToCreateComponentStep2:N,onOpenModalAddField:c,onOpenModalCreateSchema:m,onOpenModalEditCategory:g,onOpenModalEditField:p,onOpenModalEditCustomField:f,onOpenModalEditSchema:v,setFormModalNavigationState:o}},e)};wn.propTypes={children:n().node.isRequired};var _o=wn;const es=(0,a.lazy)(()=>l.e(5905).then(l.bind(l,69073)));var ts=()=>{const{url:e}=(0,B.$B)(),{categoryUid:t}=(0,B.UO)();return a.createElement(a.Suspense,{fallback:a.createElement(R.dO,null)},a.createElement(B.rs,null,a.createElement(B.AW,{path:`${e}/:componentUid`},a.createElement(es,{categoryId:t}))))},Yn=l(14911),ns=l(7563),as=l(90700),os=l(78090),ss=l(77013),rs=l(79318),is=l(28832),Qn=l(66618),ls=l(86834),us=l.n(ls),ds=l(9347),cs=()=>{const{components:e,componentsGroupedByCategory:t,contentTypes:o,isInDevelopmentMode:r,sortedContentTypesList:s,modifiedData:i,initialData:u}=(0,Ee.Z)(),c=(0,R.lm)(),{trackUsage:m}=(0,R.rS)(),[g,f]=(0,a.useState)(""),{onOpenModalCreateSchema:p,onOpenModalEditCategory:v}=(0,he.Z)(),T=Xt()(Object.keys(t).map(O=>({name:O,title:O,isEditable:r,onClickEdit(Y,re){Y.stopPropagation(),S?v(re.name):C()},links:Xt()(t[O].map(Y=>({name:Y.uid,to:`/plugins/${V.Z}/component-categories/${O}/${Y.uid}`,title:Y.schema.displayName})),Y=>Y.title)})),O=>O.title),S=!Object.keys(o).some(O=>o[O].isTemporary===!0)&&!Object.keys(e).some(O=>e[O].isTemporary===!0)&>()(i,u),N=()=>{S?(m("willCreateContentType"),p({modalType:"contentType",kind:"collectionType",actionType:"create",forTarget:"contentType"})):C()},P=()=>{S?(m("willCreateSingleType"),p({modalType:"contentType",kind:"singleType",actionType:"create",forTarget:"contentType"})):C()},M=()=>{S?(m("willCreateComponent"),p({modalType:"component",kind:null,actionType:"create",forTarget:"component"})):C()},C=()=>{c({type:"info",message:{id:`${(0,d.Z)("notification.info.creating.notSaved")}`,defaultMessage:"Please save your work before creating a new collection type or component"}})},A=s.filter(O=>O.visible),W=[{name:"models",title:{id:`${(0,d.Z)("menu.section.models.name")}`,defaultMessage:"Collection Types"},customLink:r&&{id:`${(0,d.Z)("button.model.create")}`,defaultMessage:"Create new collection type",onClick:N},links:A.filter(O=>O.kind==="collectionType")},{name:"singleTypes",title:{id:`${(0,d.Z)("menu.section.single-types.name")}`,defaultMessage:"Single Types"},customLink:r&&{id:`${(0,d.Z)("button.single-types.create")}`,defaultMessage:"Create new single type",onClick:P},links:A.filter(O=>O.kind==="singleType")},{name:"components",title:{id:`${(0,d.Z)("menu.section.components.name")}`,defaultMessage:"Components"},customLink:r&&{id:`${(0,d.Z)("button.component.create")}`,defaultMessage:"Create a new component",onClick:M},links:T}],z=O=>g?(0,ds.Z)(O,xe()(g),{keys:[Y=>xe()(Y.title)]}):O;return{menu:(()=>W.map(O=>O.links.some(re=>!us()(re.links))?{...O,links:O.links.map(re=>({...re,links:z(re.links)}))}:{...O,links:z(O.links)}))(),searchValue:g,onSearchChange:f}},ms=()=>{const{menu:e,searchValue:t,onSearchChange:o}=cs(),{formatMessage:r}=(0,q.Z)();return a.createElement(as.m,{ariaLabel:r({id:`${(0,d.Z)("plugin.name")}`,defaultMessage:"Content-Types Builder"})},a.createElement(os.p,{searchable:!0,value:t,onClear:()=>o(""),onChange:s=>o(s.target.value),label:r({id:`${(0,d.Z)("plugin.name")}`,defaultMessage:"Content-Types Builder"}),searchLabel:r({id:"global.search",defaultMessage:"Search"})}),a.createElement(ss.Z,null,e.map(s=>a.createElement(a.Fragment,{key:s.name},a.createElement(rs.D,{label:r({id:s.title.id,defaultMessage:s.title.defaultMessage}),collapsable:!0,badgeLabel:s.links.length.toString()},s.links.map(i=>i.links?a.createElement(is.z,{key:i.name,label:ve()(i.title)},i.links.map(u=>a.createElement(Qn.E,{as:Yn.OL,to:u.to,active:u.active,key:u.name,isSubSectionChild:!0},ve()(r({id:u.name,defaultMessage:u.title}))))):a.createElement(Qn.E,{as:Yn.OL,to:i.to,active:i.active,key:i.name},ve()(r({id:i.name,defaultMessage:i.title}))))),s.customLink&&a.createElement(j.x,{paddingLeft:7},a.createElement(ns.A,{onClick:s.customLink.onClick,startIcon:a.createElement(fn.J,{as:Se.Z,width:(0,R.Q1)(8),height:(0,R.Q1)(8)}),marginTop:2},r({id:s.customLink.id,defaultMessage:s.customLink.defaultMessage})))))))};const Xn=(0,a.lazy)(()=>l.e(5905).then(l.bind(l,69073)));var ps=()=>{const{formatMessage:e}=(0,q.Z)(),t=e({id:`${V.Z}.plugin.name`,defaultMessage:"Content Types Builder"}),{startSection:o}=(0,R.c1)(),r=(0,a.useRef)(o);return(0,a.useEffect)(()=>{r.current&&r.current("contentTypeBuilder")},[]),a.createElement(R.O4,{permissions:rt.Z.main},a.createElement(ye.q,{title:t}),a.createElement(_o,null,a.createElement(Xo,null,a.createElement(Ae.A,{sideNav:a.createElement(ms,null)},a.createElement(a.Suspense,{fallback:a.createElement(R.dO,null)},a.createElement(B.rs,null,a.createElement(B.AW,{path:`/plugins/${V.Z}/content-types/create-content-type`,component:Xn}),a.createElement(B.AW,{path:`/plugins/${V.Z}/content-types/:uid`,component:Xn}),a.createElement(B.AW,{path:`/plugins/${V.Z}/component-categories/:categoryUid`,component:ts})))))))}},92318:function(Fe,ae,l){var a=l(25158);const B=ye=>`${a.Z}.${ye}`;ae.Z=B}}]);
|