@strapi/admin 4.10.4 → 4.10.6
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/admin/src/components/AuthenticatedApp/utils/api.js +5 -4
- package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +1 -2
- package/admin/src/content-manager/components/DynamicZone/index.js +1 -1
- package/admin/src/content-manager/components/FieldComponent/index.js +1 -1
- package/admin/src/content-manager/components/Inputs/index.js +1 -1
- package/admin/src/content-manager/components/Wysiwyg/WysiwygNav.js +67 -71
- package/admin/src/content-manager/hooks/useFetchContentTypeLayout/index.js +3 -5
- package/admin/src/content-manager/pages/App/useContentManagerInitData.js +2 -3
- package/admin/src/content-manager/pages/ComponentSetttingsView/index.js +2 -5
- package/admin/src/content-manager/pages/EditView/DeleteLink/index.js +1 -1
- package/admin/src/content-manager/pages/EditView/Header/index.js +1 -1
- package/admin/src/content-manager/pages/EditViewLayoutManager/Permissions.js +1 -1
- package/admin/src/content-manager/pages/ListView/index.js +1 -2
- package/admin/src/hooks/marketplace/constants.js +1 -0
- package/admin/src/hooks/{useFetchMarketplacePlugins → marketplace/useFetchMarketplacePlugins}/index.js +21 -1
- package/admin/src/hooks/{useFetchMarketplaceProviders → marketplace/useFetchMarketplaceProviders}/index.js +21 -1
- package/admin/src/hooks/useReleaseNotification/utils/api.js +6 -5
- package/admin/src/pages/Admin/Onboarding/index.js +89 -91
- package/admin/src/pages/App/index.js +1 -5
- package/admin/src/pages/AuthPage/components/Register/index.js +3 -4
- package/admin/src/pages/AuthPage/index.js +11 -26
- package/admin/src/pages/MarketplacePage/components/NpmPackagesFilters/FiltersPopover.js +39 -41
- package/admin/src/pages/MarketplacePage/utils/useMarketplaceData.js +2 -2
- package/admin/src/pages/SettingsPage/components/Tokens/TokenDescription/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/urlToFile.js +3 -2
- package/admin/src/pages/SettingsPage/pages/Roles/CreatePage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/RoleForm/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/index.js +12 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/index.js +120 -205
- package/admin/src/pages/UseCasePage/index.js +13 -15
- package/admin/src/translations/en.json +11 -9
- package/build/1387.a86ac314.chunk.js +1 -0
- package/build/{1657.85034334.chunk.js → 1657.ca8562dd.chunk.js} +46 -46
- package/build/{3816.2b58bc1a.chunk.js → 3816.60f858cf.chunk.js} +19 -22
- package/build/{5542.5328b662.chunk.js → 5542.002522eb.chunk.js} +13 -13
- package/build/{5563.44e0ef15.chunk.js → 5563.2c8334ef.chunk.js} +1 -1
- package/build/617.87b2fe96.chunk.js +155 -0
- package/build/{6970.e8422af3.chunk.js → 6970.36d3ffff.chunk.js} +1 -1
- package/build/7259.116a9960.chunk.js +1 -0
- package/build/Admin-authenticatedApp.0318dfb3.chunk.js +79 -0
- package/build/{Admin_marketplace.87f51b29.chunk.js → Admin_marketplace.f446ba2b.chunk.js} +10 -10
- package/build/Admin_settingsPage.f8c46a9a.chunk.js +79 -0
- package/build/admin-app.6d48536c.chunk.js +63 -0
- package/build/{admin-edit-roles-page.6fe9de49.chunk.js → admin-edit-roles-page.02c3b136.chunk.js} +3 -3
- package/build/{admin-users.16bb6e77.chunk.js → admin-users.69f4900a.chunk.js} +11 -11
- package/build/audit-logs-settings-page.482909d7.chunk.js +129 -0
- package/build/{content-manager.a837bfcd.chunk.js → content-manager.cd71cb6e.chunk.js} +95 -95
- package/build/content-type-builder-translation-en-json.af293c9e.chunk.js +1 -0
- package/build/content-type-builder.b10576e7.chunk.js +126 -0
- package/build/{email-settings-page.5bc22e5a.chunk.js → email-settings-page.dba83275.chunk.js} +4 -4
- package/build/en-json.d965e364.chunk.js +1 -0
- package/build/i18n-settings-page.55628f74.chunk.js +114 -0
- package/build/index.html +1 -1
- package/build/main.adab8b96.js +2630 -0
- package/build/{runtime~main.a096f3d0.js → runtime~main.0201a49b.js} +2 -2
- package/build/upload-settings.63d99bf5.chunk.js +14 -0
- package/build/upload.c50d8c7a.chunk.js +34 -0
- package/build/{users-advanced-settings-page.dd2a4954.chunk.js → users-advanced-settings-page.4f49ca57.chunk.js} +3 -3
- package/build/users-email-settings-page.d2429d0a.chunk.js +24 -0
- package/build/users-providers-settings-page.50c5ba27.chunk.js +29 -0
- package/build/{users-roles-settings-page.eeb3a339.chunk.js → users-roles-settings-page.2549794b.chunk.js} +2 -2
- package/build/webhook-edit-page.cb2cf1a5.chunk.js +128 -0
- package/build/webhook-list-page.e2fca9f8.chunk.js +71 -0
- package/ee/LICENSE +1 -21
- package/ee/admin/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/getTableColumn.js +6 -1
- package/ee/admin/pages/AuthPage/components/Login/index.js +1 -1
- package/ee/admin/pages/AuthPage/components/Providers/SSOProviders.js +1 -1
- package/ee/admin/pages/AuthPage/components/Providers/index.js +1 -1
- package/ee/admin/pages/SettingsPage/pages/Users/ListPage/ModalForm/utils/formDataModel.js +1 -1
- package/ee/admin/pages/SettingsPage/pages/Users/ListPage/ModalForm/utils/roleSettingsForm.js +1 -1
- package/package.json +13 -15
- package/webpack.alias.js +0 -1
- package/admin/src/hooks/useFetchMarketplacePlugins/utils/api.js +0 -18
- package/admin/src/hooks/useFetchMarketplaceProviders/utils/api.js +0 -18
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/utils/formatValue.js +0 -13
- package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/reducer.js +0 -72
- package/build/1387.437eb420.chunk.js +0 -1
- package/build/617.ce23dea8.chunk.js +0 -155
- package/build/7259.3ed2b60e.chunk.js +0 -1
- package/build/Admin-authenticatedApp.dbb99d34.chunk.js +0 -79
- package/build/Admin_settingsPage.20884a40.chunk.js +0 -79
- package/build/admin-app.d4fd9379.chunk.js +0 -63
- package/build/audit-logs-settings-page.48b921f9.chunk.js +0 -129
- package/build/content-type-builder-translation-en-json.5e5f8607.chunk.js +0 -1
- package/build/content-type-builder.51c64fe5.chunk.js +0 -126
- package/build/en-json.1f6af924.chunk.js +0 -1
- package/build/i18n-settings-page.1581894e.chunk.js +0 -114
- package/build/main.31bdf27e.js +0 -2679
- package/build/upload-settings.4d962053.chunk.js +0 -14
- package/build/upload.4dcd513f.chunk.js +0 -34
- package/build/users-email-settings-page.510648ab.chunk.js +0 -24
- package/build/users-providers-settings-page.0ee7d54f.chunk.js +0 -29
- package/build/webhook-edit-page.36c9f20d.chunk.js +0 -128
- package/build/webhook-list-page.0983d83f.chunk.js +0 -71
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[931],{20392:function(e){e.exports=JSON.parse(`{"attribute.boolean":"Boolean","attribute.boolean.description":"Yes or no, 1 or 0, true or false","attribute.component":"Component","attribute.component.description":"Group of fields that you can repeat or reuse","attribute.customField":"Custom field","attribute.date":"Date","attribute.date.description":"A date picker with hours, minutes and seconds","attribute.datetime":"Datetime","attribute.dynamiczone":"Dynamic zone","attribute.dynamiczone.description":"Dynamically pick component when editing content","attribute.email":"Email","attribute.email.description":"Email field with validations format","attribute.enumeration":"Enumeration","attribute.enumeration.description":"List of values, then pick one","attribute.json":"JSON","attribute.json.description":"Data in JSON format","attribute.media":"Media","attribute.media.description":"Files like images, videos, etc","attribute.null":" ","attribute.number":"Number","attribute.number.description":"Numbers (integer, float, decimal)","attribute.password":"Password","attribute.password.description":"Password field with encryption","attribute.relation":"Relation","attribute.relation.description":"Refers to a Collection Type","attribute.richtext":"Rich text","attribute.richtext.description":"A rich text editor with formatting options","attribute.text":"Text","attribute.text.description":"Small or long text like title or description","attribute.time":"Time","attribute.timestamp":"Timestamp","attribute.uid":"UID","attribute.uid.description":"Unique identifier","button.attributes.add.another":"Add another field","button.component.add":"Add a component","button.component.create":"Create new component","button.model.create":"Create new collection type","button.single-types.create":"Create new single type","component.repeatable":"(repeatable)","components.SelectComponents.displayed-value":"{number, plural, =0 {# components} one {# component} other {# components}} selected","components.componentSelect.no-component-available":"You have already added all your components","components.componentSelect.no-component-available.with-search":"There is no component matching your search","components.componentSelect.value-component":"{number} component selected (type to search for a component)","components.componentSelect.value-components":"{number} components selected","configurations":"Configurations","contentType.apiId-plural.description":"Pluralized API ID","contentType.apiId-plural.label":"API ID (Plural)","contentType.apiId-singular.description":"The UID is used to generate the API routes and databases tables/collections","contentType.apiId-singular.label":"API ID (Singular)","contentType.collectionName.description":"Useful when the name of your Content Type and your table name differ","contentType.collectionName.label":"Collection name","contentType.displayName.label":"Display name","contentType.draftAndPublish.description":"Allows writing a draft version of an entry, before it is published","contentType.draftAndPublish.label":"Draft & publish","contentType.kind.change.warning":"You just changed the kind of a content type: API will be reset (routes, controllers, and services will be overwritten).","contentType.reviewWorkflows.label":"Review Workflows","contentType.reviewWorkflows.description":"Allows having content in different review stages","error.attributeName.reserved-name":"This name cannot be used in your content type as it might break other functionalities","error.contentType.pluralName-used":"This value cannot be the same as the singular one","error.contentType.singularName-used":"This value cannot be the same as the plural one","error.contentType.singularName-equals-pluralName":"This value cannot be the same as the Plural API ID of another content type.","error.contentType.pluralName-equals-singularName":"This value cannot be the same as the Singular API ID of another content type.","error.contentType.pluralName-equals-collectionName":"This value is already in use by another content type.","error.contentTypeName.reserved-name":"This name cannot be used in your project as it might break other functionalities","error.validation.enum-duplicate":"Duplicate values are not allowed (only alphanumeric characters are taken into account).","error.validation.enum-empty-string":"Empty strings are not allowed","error.validation.enum-regex":"At least one value is invalid. Values should have at least one alphabetical character preceding the first occurence of a number.","error.validation.minSupMax":"Can't be superior","error.validation.positive":"Must be a positive number","error.validation.regex":"Regex pattern is invalid","error.validation.relation.targetAttribute-taken":"This name exists in the target","form.attribute.component.option.add":"Add a component","form.attribute.component.option.create":"Create a new component","form.attribute.component.option.create.description":"A component is shared across types and components, it will be available and accessible everywhere.","form.attribute.component.option.repeatable":"Repeatable component","form.attribute.component.option.repeatable.description":"Best for multiple instances (array) of ingredients, meta tags, etc..","form.attribute.component.option.reuse-existing":"Use an existing component","form.attribute.component.option.reuse-existing.description":"Reuse a component already created to keep your data consistent across content-types.","form.attribute.component.option.single":"Single component","form.attribute.component.option.single.description":"Best for grouping fields like full address, main information, etc...","form.attribute.item.customColumnName":"Custom column names","form.attribute.item.customColumnName.description":"This is useful to rename database column names in a more comprehensive format for the API's responses","form.attribute.item.date.type.date":"date (ex: 01/01/{currentYear})","form.attribute.item.date.type.datetime":"datetime (ex: 01/01/{currentYear} 00:00 AM)","form.attribute.item.date.type.time":"time (ex: 00:00 AM)","form.attribute.item.defineRelation.fieldName":"Field name","form.attribute.item.enumeration.graphql":"Name override for GraphQL","form.attribute.item.enumeration.graphql.description":"Allows you to override the default generated name for GraphQL","form.attribute.item.enumeration.placeholder":"Ex:\\nmorning\\nnoon\\nevening","form.attribute.item.enumeration.rules":"Values (one line per value)","form.attribute.item.maximum":"Maximum value","form.attribute.item.maximumLength":"Maximum length","form.attribute.item.minimum":"Minimum value","form.attribute.item.minimumLength":"Minimum length","form.attribute.item.number.type":"Number format","form.attribute.item.number.type.biginteger":"big integer (ex: 123456789)","form.attribute.item.number.type.decimal":"decimal (ex: 2.22)","form.attribute.item.number.type.float":"float (ex: 3.33333333)","form.attribute.item.number.type.integer":"integer (ex: 10)","form.attribute.item.privateField":"Private field","form.attribute.item.privateField.description":"This field will not show up in the API response","form.attribute.item.requiredField":"Required field","form.attribute.item.requiredField.description":"You won't be able to create an entry if this field is empty","form.attribute.item.text.regex":"RegExp pattern","form.attribute.item.text.regex.description":"The text of the regular expression","form.attribute.item.uniqueField":"Unique field","form.attribute.item.uniqueField.description":"You won't be able to create an entry if there is an existing entry with identical content","form.attribute.media.allowed-types":"Select allowed types of media","form.attribute.media.allowed-types.option-files":"Files","form.attribute.media.allowed-types.option-images":"Images","form.attribute.media.allowed-types.option-videos":"Videos","form.attribute.media.option.multiple":"Multiple media","form.attribute.media.option.multiple.description":"Best for sliders, carousels or multiple files download","form.attribute.media.option.single":"Single media","form.attribute.media.option.single.description":"Best for avatar, profile picture or cover","form.attribute.settings.default":"Default value","form.attribute.text.option.long-text":"Long text","form.attribute.text.option.long-text.description":"Best for descriptions, biography. Exact search is disabled.","form.attribute.text.option.short-text":"Short text","form.attribute.text.option.short-text.description":"Best for titles, names, links (URL). It also enables exact search on the field.","form.button.add-components-to-dynamiczone":"Add components to the zone","form.button.add-field":"Add another field","form.button.add-first-field-to-created-component":"Add first field to the component","form.button.add.field.to.collectionType":"Add another field to this collection type","form.button.add.field.to.component":"Add another field to this component","form.button.add.field.to.contentType":"Add another field to this content type","form.button.add.field.to.singleType":"Add another field to this single type","form.button.cancel":"Cancel","form.button.collection-type.description":"Best for multiple instances like articles, products, comments, etc.","form.button.collection-type.name":"Collection Type","form.button.configure-component":"Configure the component","form.button.configure-view":"Configure the view","form.button.select-component":"Select a component","form.button.single-type.description":"Best for single instance like about us, homepage, etc.","form.button.single-type.name":"Single Type","from":"from","listView.headerLayout.description":"Build the data architecture of your content","menu.section.components.name":"Components","menu.section.models.name":"Collection Types","menu.section.single-types.name":"Single Types","modalForm.attribute.form.base.name.description":"No space is allowed for the name of the attribute","modalForm.attribute.form.base.name.placeholder":"e.g. slug, seoUrl, canonicalUrl","modalForm.attribute.target-field":"Attached field","modalForm.attributes.select-component":"Select a component","modalForm.attributes.select-components":"Select the components","modalForm.collectionType.header-create":"Create a collection type","modalForm.component.header-create":"Create a component","modalForm.components.create-component.category.label":"Select a category or enter a name to create a new one","modalForm.components.icon.label":"Icon","modalForm.empty.button":"Add custom fields","modalForm.empty.heading":"Nothing in here yet.","modalForm.empty.sub-heading":"Find what you are looking for through a wide range of extensions.","modalForm.editCategory.base.name.description":"No space is allowed for the name of the category","modalForm.header-edit":"Edit {name}","modalForm.header.categories":"Categories","modalForm.singleType.header-create":"Create a single type","modalForm.sub-header.addComponentToDynamicZone":"Add new component to the dynamic zone","modalForm.sub-header.attribute.create":"Add new {type} field","modalForm.sub-header.attribute.create.step":"Add new component ({step}/2)","modalForm.sub-header.attribute.edit":"Edit {name}","modalForm.sub-header.chooseAttribute.collectionType":"Select a field for your collection type","modalForm.sub-header.chooseAttribute.component":"Select a field for your component","modalForm.sub-header.chooseAttribute.singleType":"Select a field for your single type","modalForm.custom-fields.advanced.settings.extended":"Extended settings","modalForm.tabs.custom":"Custom","modalForm.tabs.custom.howToLink":"How to add custom fields","modalForm.tabs.default":"Default","modalForm.tabs.label":"Default and Custom types tabs","modelPage.attribute.relation-polymorphic":"Relation (polymorphic)","modelPage.attribute.relationWith":"Relation with","notification.error.dynamiczone-min.validation":"At least one component is required in a dynamic zone to be able to save a content type","notification.info.autoreaload-disable":"Strapi is in production mode, editing content types is disabled. Please switch to development mode by starting your server with strapi develop.","notification.info.creating.notSaved":"Please save your work before creating a new collection type or component","plugin.description.long":"Modelize the data structure of your API. Create new fields and relations in just a minute. The files are automatically created and updated in your project.","plugin.description.short":"Modelize the data structure of your API.","plugin.name":"Content-Type Builder","popUpForm.navContainer.advanced":"Advanced settings","popUpForm.navContainer.base":"Basic settings","popUpWarning.bodyMessage.cancel-modifications":"Are you sure you want to cancel your modifications?","popUpWarning.bodyMessage.cancel-modifications.with-components":"Are you sure you want to cancel your modifications? Some components have been created or modified...","popUpWarning.bodyMessage.category.delete":"Are you sure you want to delete this category? All the components will also be deleted.","popUpWarning.bodyMessage.component.delete":"Are you sure you want to delete this component?","popUpWarning.bodyMessage.contentType.delete":"Are you sure you want to delete this collection type?","popUpWarning.draft-publish.button.confirm":"Yes, disable","popUpWarning.draft-publish.message":"If you disable the Draft & publish, your drafts will be deleted.","popUpWarning.draft-publish.second-message":"Are you sure you want to disable it?","popUpWarning.review-workflows.message":"If you disable the review workflows feature, all stage-related information will be removed for this content-type. Are you sure you want to disable it?","prompt.unsaved":"Are you sure you want to leave? All your modifications will be lost.","relation.attributeName.placeholder":"Ex: author, category, tag","relation.manyToMany":"has and belongs to many","relation.manyToOne":"has many","relation.manyWay":"has many","relation.oneToMany":"belongs to many","relation.oneToOne":"has and belongs to one","relation.oneWay":"has one","table.button.no-fields":"Add new field","table.content.create-first-content-type":"Create your first Collection-Type","table.content.no-fields.collection-type":"Add your first field to this Collection-Type","table.content.no-fields.component":"Add your first field to this component"}`)}}]);
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[8880],{25747:function(Fe,oe,u){var a=u(32735),B=u(8471),he=u(60216),P=u.n(he),C=u(72850),Se=u(32031),rt=u(73779),w=u(35071),it=u(1176),t=u(88675),lt=u(15431),T=u(22348),He=u(7184),We=u(43475),Ye=u(872),Qe=u(89135),ut=u(82512),dt=u(61642),ve=u(58656),Xe=u(83218),ct=u(17757),Te=u(24989);const d={biginteger:Se.Z,boolean:rt.Z,collectionType:w.Z,component:it.Z,contentType:w.Z,date:t.Z,datetime:t.Z,decimal:Se.Z,dynamiczone:lt.Z,email:T.Z,enum:He.Z,enumeration:He.Z,file:We.Z,files:We.Z,float:Se.Z,integer:Se.Z,json:Ye.Z,JSON:Ye.Z,media:We.Z,number:Se.Z,password:Qe.Z,relation:ut.Z,richtext:dt.Z,singleType:ve.Z,string:Xe.Z,text:Xe.Z,time:t.Z,timestamp:t.Z,uid:ct.Z},Re=(0,B.ZP)(C.x)`
|
|
2
|
+
svg {
|
|
3
|
+
height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
}
|
|
6
|
+
`,Be=({type:Je,customField:_e,...je})=>{const mt=(0,Te.mZ)();let we=d[Je];if(_e){const{icon:ze}=mt.get(_e);ze&&(we=ze)}return d[Je]?a.createElement(Re,{height:(0,Te.Q1)(24),width:(0,Te.Q1)(32),shrink:0,...je,"aria-hidden":!0},a.createElement(C.x,{as:we})):null};Be.defaultProps={customField:null},Be.propTypes={type:P().string.isRequired,customField:P().string},oe.Z=Be},74753:function(Fe,oe,u){var a=u(32735);const B=(0,a.createContext)();oe.Z=B},51216:function(Fe,oe,u){var a=u(32735);const B=(0,a.createContext)();oe.Z=B},198:function(Fe,oe,u){var a=u(32735),B=u(74753);const he=()=>(0,a.useContext)(B.Z);oe.Z=he},32237:function(Fe,oe,u){var a=u(32735),B=u(51216);const he=()=>(0,a.useContext)(B.Z);oe.Z=he},33184:function(Fe,oe,u){u.r(oe),u.d(oe,{default:function(){return mo}});var a=u(32735),B=u(53038),he=u(74758),P=u(67879),C=u(24989),Se=u(96709),rt=u(3633),w=u(25158),it=u(60216),t=u.n(it),lt=u(33795),T=u.n(lt),He=u(81346),We=u.n(He),Ye=u(3040),Qe=u.n(Ye),ut=u(61868),dt=u.n(ut),ve=u(15062),Xe=u(6680),ct=u(74753),Te=u(32237),d=u(92318),Re=u(37087),Be=u(23973),Je=u.n(Be),_e=u(59578),je=u.n(_e),mt=u(85025),we=u(31600),ze=u(91215),$=u(87933),Oe=u(90980),pt=u(9026),j=u(72850),Le=u(3653),ra=u(11406),Y=u(41415),ia=u(89793),gt=u.n(ia),Ze=u(198),cn=u(27799),la=u(23940),Ce=u.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:n,onChange:s,value:r})=>{const{formatMessage:o}=(0,P.Z)(),l=r===null||r.length===0?o({id:"global.none",defaultMessage:"None"}):[...r].sort().map(c=>Ce()(c)).join(", "),i=e.id?o({id:e.id,defaultMessage:e.defaultMessage}):n;return a.createElement(cn.Q,{id:"select1",label:i,customizeContent:()=>l,onChange:c=>{c.length>0?s({target:{name:n,value:c,type:"allowed-types-select"}}):s({target:{name:n,value:null,type:"allowed-types-select"}})},options:ua,value:r||[]})};ft.defaultProps={value:null},ft.propTypes={intlLabel:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}).isRequired,name:t().string.isRequired,onChange:t().func.isRequired,value:t().oneOfType([t().object,t().array])};var da=ft,X=u(49372),mn=e=>e.kind==="collectionType"&&(e.restrictRelationsTo===null||Array.isArray(e.restrictRelationsTo)&&e.restrictRelationsTo.length>0),yt=u(861),bt=u(15335),et=u(5803),tt=u(25747),Ie=u(8471),pn=(0,Ie.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:n}=(0,P.Z)(),{onClickSelectField:s}=(0,Te.Z)(),r=()=>{s({attributeType:e,step:e==="component"?"1":null})};return a.createElement(pn,{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(X.Z,{fontWeight:"bold"},n({id:(0,d.Z)(`attribute.${e}`),defaultMessage:e}))),a.createElement($.k,null,a.createElement(X.Z,{variant:"pi",textColor:"neutral600"},n({id:(0,d.Z)(`attribute.${e}.description`),defaultMessage:"A type for modeling data"}))))))};ht.defaultProps={type:"text"},ht.propTypes={type:t().string};var ca=ht,gn=e=>{const n=e%2===1;return{paddingLeft:n?2:0,paddingRight:n?0:2}};const fn=({attributes:e})=>a.createElement(yt.k,{tagName:"button"},a.createElement($.k,{direction:"column",alignItems:"stretch",gap:8},e.map((n,s)=>a.createElement(bt.r,{key:s,gap:0},n.map((r,o)=>{const{paddingLeft:l,paddingRight:i}=gn(o);return a.createElement(et.P,{key:r,col:6,style:{height:"100%"}},a.createElement(j.x,{paddingLeft:l,paddingRight:i,paddingBottom:1,style:{height:"100%"}},a.createElement(ca,{type:r})))})))));fn.propTypes={attributes:t().array.isRequired};var ma=fn,pa=u(50428),ga=u(33348),fa=u.n(ga),yn=u(99140),ya=u(25148),ba=u(54725),Ne=u(19406);const ha=(0,Ie.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,n)=>a.createElement(ha,{key:`empty-card-${n}`,height:"138px",width:"375px",hasRadius:!0})));var Ta=()=>{const{formatMessage:e}=(0,P.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(yn.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(X.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(X.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(Ne.Z,null)},e({id:(0,d.Z)("modalForm.empty.button"),defaultMessage:"Add custom fields"})))))};const bn=({customFieldUid:e,customField:n})=>{const{type:s,intlLabel:r,intlDescription:o}=n,{formatMessage:l}=(0,P.Z)(),{onClickSelectCustomField:i}=(0,Te.Z)(),c=()=>{i({attributeType:s,customFieldUid:e})};return a.createElement(pn,{padding:4,as:"button",hasRadius:!0,type:"button",onClick:c},a.createElement($.k,null,a.createElement(tt.Z,{type:s,customField:e}),a.createElement(j.x,{paddingLeft:4},a.createElement($.k,null,a.createElement(X.Z,{fontWeight:"bold"},l(r))),a.createElement($.k,null,a.createElement(X.Z,{variant:"pi",textColor:"neutral600"},l(o))))))};bn.propTypes={customFieldUid:t().string.isRequired,customField:t().shape({type:t().string.isRequired,icon:t().func,intlLabel:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired}).isRequired,intlDescription:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired}).isRequired}).isRequired};var Ca=bn,Ma=()=>{const{formatMessage:e}=(0,P.Z)(),n=(0,C.mZ)(),s=Object.entries(n.getAll());if(!s.length)return a.createElement(Ta,null);const r=s.sort((o,l)=>o[1].name>l[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(([o,l],i)=>{const{paddingLeft:c,paddingRight:m}=gn(i);return a.createElement(et.P,{key:o,col:6,style:{height:"100%"}},a.createElement(j.x,{paddingLeft:c,paddingRight:m,paddingBottom:1,style:{height:"100%"}},a.createElement(Ca,{key:o,customFieldUid:o,customField:l})))})),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 hn=({attributes:e,forTarget:n,kind:s})=>{const{formatMessage:r}=(0,P.Z)(),o=(0,d.Z)("modalForm.tabs.default"),l=(0,d.Z)("modalForm.tabs.custom"),i=n.includes("component")?"component":s,c=(0,d.Z)(`modalForm.sub-header.chooseAttribute.${i}`);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(X.Z,{variant:"beta",as:"h2"},r({id:c,defaultMessage:"Select a field"})),a.createElement(Oe.m,null,a.createElement(Oe.O,null,r({id:o,defaultMessage:"Default"})),a.createElement(Oe.O,null,r({id:l,defaultMessage:"Custom"})))),a.createElement(j.x,{paddingBottom:6},a.createElement(pt.i,null)),a.createElement(Le.n,null,a.createElement(Le.x,null,a.createElement(ma,{attributes:e})),a.createElement(Le.x,null,a.createElement(Ma,null)))))};hn.propTypes={attributes:t().array.isRequired,forTarget:t().string.isRequired,kind:t().string.isRequired};var Ea=hn,vt=u(8284);const Tt=({description:e,disabled:n,intlLabel:s,isCreating:r,name:o,onChange:l,value:i})=>{const{formatMessage:c}=(0,P.Z)(),[m,g]=(0,a.useState)(!1),f=s.id?c({id:s.id,defaultMessage:s.defaultMessage},{...s.values}):o,p=e?c({id:e.id,defaultMessage:e.defaultMessage},{...e.values}):"",Z=()=>g(A=>!A),h=()=>{l({target:{name:o,value:!1}}),Z()},v=({target:{checked:A}})=>{if(!A&&!r){Z();return}l({target:{name:o,value:A}})};return a.createElement(a.Fragment,null,a.createElement(vt.X,{checked:i,disabled:n,hint:p,name:o,onChange:v},f),a.createElement(C.QH,{isOpen:m,onToggleDialog:Z,onConfirm:h,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"}}))};Tt.defaultProps={description:null,disabled:!1,value:!1},Tt.propTypes={description:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}),disabled:t().bool,intlLabel:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}).isRequired,isCreating:t().bool.isRequired,name:t().string.isRequired,onChange:t().func.isRequired,value:t().bool};var Ra=Tt;const Ct=({description:e,disabled:n,intlLabel:s,isCreating:r,name:o,onChange:l,value:i})=>{const{trackUsage:c}=(0,C.rS)(),{formatMessage:m}=(0,P.Z)(),[g,f]=(0,a.useState)(!1),p=s.id?m({id:s.id,defaultMessage:s.defaultMessage},{...s.values}):o,Z=e?m({id:e.id,defaultMessage:e.defaultMessage},{...e.values}):"",h=()=>f(O=>!O),v=()=>{l({target:{name:o,value:!1}}),c("willDisableWorkflow"),h()},A=({target:{checked:O}})=>{if(!O&&!r){h();return}O&&c("willEnableWorkflow"),l({target:{name:o,value:O}})};return a.createElement(a.Fragment,null,a.createElement(vt.X,{checked:i,disabled:n,hint:Z,name:o,onChange:A},p),a.createElement(C.QH,{isOpen:g,onToggleDialog:h,onConfirm:v,bodyText:{id:(0,d.Z)("popUpWarning.review-workflows.message"),defaultMessage:"If you disable the review workflows feature, all stage-related information will be removed for this content-type. Are you sure you want to disable it?"},leftButtonText:{id:"components.popUpWarning.button.cancel",defaultMessage:"No, cancel"},rightButtonText:{id:(0,d.Z)("popUpWarning.review-workflows.button.confirm"),defaultMessage:"Yes, disable"}}))};Ct.defaultProps={description:null,disabled:!1,value:!1},Ct.propTypes={description:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}),disabled:t().bool,intlLabel:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}).isRequired,isCreating:t().bool.isRequired,name:t().string.isRequired,onChange:t().func.isRequired,value:t().bool};var Za=Ct,vn=u(55225),Mt=u(11299);const Et=({actionType:e,attributeName:n,attributeType:s,categoryName:r,contentTypeKind:o,dynamicZoneTarget:l,forTarget:i,modalType:c,targetUid:m,customFieldUid:g})=>{const{formatMessage:f}=(0,P.Z)(),{modifiedData:p}=(0,Ze.Z)();let Z,h=[];const v=p?.[i]?.[m]||p?.[i]||null;let A=v?.schema.displayName;if(c==="contentType"&&(Z=o),["component","editCategory"].includes(c)&&(Z="component"),["component","contentType"].includes(c)){let M=(0,d.Z)(`modalForm.component.header-${e}`);return c==="contentType"&&(M=(0,d.Z)(`modalForm.${o}.header-create`)),e==="edit"&&(M=(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:Z})),a.createElement(j.x,{paddingLeft:3},a.createElement(X.Z,{fontWeight:"bold",textColor:"neutral800",as:"h2",id:"title"},f({id:M},{name:A})))))}h=[{label:A,info:{category:v?.category||null,name:v?.schema.displayName}}],c==="chooseAttribute"&&(Z=["component","components"].includes(i)?"component":v.schema.kind),c==="addComponentToDynamicZone"&&(Z="dynamiczone",h.push({label:l})),(c==="attribute"||c==="customField")&&(Z=s,h.push({label:n})),c==="editCategory"&&(h=[{label:f({id:(0,d.Z)("modalForm.header.categories"),defaultMessage:"Categories"})},{label:r}]);const E=h.map(({label:M})=>M).join(",");return a.createElement(vn.x,null,a.createElement($.k,{gap:3},a.createElement(tt.Z,{type:Z,customField:g}),a.createElement(Mt.O,{label:E},h.map((M,S)=>{const U=Ce()(M.label);if(!U)return null;const z=`${M.label}.${S}`;if(M.info?.category){const J=`${U} (${Ce()(M.info.category)} - ${Ce()(M.info.name)})`;return a.createElement(Mt.$,{key:z},J)}return a.createElement(Mt.$,{key:z},U)}))))};Et.defaultProps={actionType:null,attributeName:null,attributeType:null,categoryName:null,dynamicZoneTarget:null,forTarget:null,contentTypeKind:null,targetUid:null,customFieldUid:null},Et.propTypes={actionType:t().string,attributeName:t().string,attributeType:t().string,categoryName:t().string,contentTypeKind:t().string,dynamicZoneTarget:t().string,forTarget:t().oneOf(["contentType","component","components"]),modalType:t().string.isRequired,targetUid:t().string,customFieldUid:t().string};var Aa=Et;const Rt=({categoryName:e,deleteCategory:n,deleteComponent:s,deleteContentType:r,isAttributeModal:o,isCustomFieldModal:l,isComponentAttribute:i,isComponentToDzModal:c,isContentTypeModal:m,isCreatingComponent:g,isCreatingComponentAttribute:f,isCreatingComponentInDz:p,isCreatingComponentWhileAddingAField:Z,isCreatingContentType:h,isCreatingDz:v,isComponentModal:A,isDzAttribute:O,isEditingAttribute:E,isEditingCategory:M,isInFirstComponentStep:S,onSubmitAddComponentAttribute:U,onSubmitAddComponentToDz:z,onSubmitCreateContentType:J,onSubmitCreateComponent:ne,onSubmitCreateDz:I,onSubmitEditAttribute:ge,onSubmitEditCategory:G,onSubmitEditComponent:V,onSubmitEditContentType:ye,onSubmitEditCustomFieldAttribute:K,onSubmitEditDz:Pe,onClickFinish:te})=>{const{formatMessage:W}=(0,P.Z)();return c?p?a.createElement(Y.z,{variant:"secondary",type:"submit",onClick:R=>{R.preventDefault(),z(R,!0)},startIcon:a.createElement(Ne.Z,null)},W({id:(0,d.Z)("form.button.add-first-field-to-created-component"),defaultMessage:"Add first field to the component"})):a.createElement(Y.z,{variant:"default",type:"submit",onClick:R=>{R.preventDefault(),z(R,!1)}},W({id:"global.finish",defaultMessage:"Finish"})):o&&O&&!v?a.createElement(Y.z,{variant:"default",type:"submit",onClick:R=>{R.preventDefault(),te(),Pe(R,!1)}},W({id:"global.finish",defaultMessage:"Finish"})):o&&O&&v?a.createElement(a.Fragment,null,a.createElement(Y.z,{variant:"secondary",type:"submit",onClick:R=>{R.preventDefault(),I(R,!0)},startIcon:a.createElement(Ne.Z,null)},W({id:(0,d.Z)("form.button.add-components-to-dynamiczone"),defaultMessage:"Add components to the zone"}))):o&&i?S?a.createElement(Y.z,{variant:"secondary",type:"submit",onClick:R=>{R.preventDefault(),U(R,!0)}},W(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(Y.z,{variant:"secondary",type:"submit",onClick:R=>{R.preventDefault(),U(R,!0)},startIcon:a.createElement(Ne.Z,null)},W(Z?{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(Y.z,{variant:"default",type:"button",onClick:R=>{R.preventDefault(),te(),U(R,!1)}},W({id:"global.finish",defaultMessage:"Finish"}))):o&&!i&&!O?a.createElement(a.Fragment,null,a.createElement(Y.z,{type:E?"button":"submit",variant:"secondary",onClick:R=>{R.preventDefault(),ge(R,!0)},startIcon:a.createElement(Ne.Z,null)},W({id:(0,d.Z)("form.button.add-field"),defaultMessage:"Add another field"})),a.createElement(Y.z,{type:E?"submit":"button",variant:"default",onClick:R=>{R.preventDefault(),te(),ge(R,!1)}},W({id:"global.finish",defaultMessage:"Finish"}))):m?a.createElement(a.Fragment,null,!h&&a.createElement(a.Fragment,null,a.createElement(Y.z,{type:"button",variant:"danger",onClick:R=>{R.preventDefault(),r()}},W({id:"global.delete",defaultMessage:"Delete"})),a.createElement(Y.z,{type:"submit",variant:"default",onClick:R=>{R.preventDefault(),ye(R,!1)}},W({id:"global.finish",defaultMessage:"Finish"}))),h&&a.createElement(Y.z,{type:"submit",variant:"secondary",onClick:R=>{R.preventDefault(),J(R,!0)}},W({id:"global.continue",defaultMessage:"Continue"}))):A?a.createElement(a.Fragment,null,!g&&a.createElement(a.Fragment,null,a.createElement(Y.z,{type:"button",variant:"danger",onClick:R=>{R.preventDefault(),s()}},W({id:"global.delete",defaultMessage:"Delete"})),a.createElement(Y.z,{type:"submit",variant:"default",onClick:R=>{R.preventDefault(),V(R,!1)}},W({id:"global.finish",defaultMessage:"Finish"}))),g&&a.createElement(Y.z,{type:"submit",variant:"secondary",onClick:R=>{R.preventDefault(),ne(R,!0)}},W({id:"global.continue",defaultMessage:"Continue"}))):M?a.createElement(a.Fragment,null,a.createElement(Y.z,{type:"button",variant:"danger",onClick:R=>{R.preventDefault(),n(e)}},W({id:"global.delete",defaultMessage:"Delete"})),a.createElement(Y.z,{type:"submit",variant:"default",onClick:R=>{R.preventDefault(),G(R)}},W({id:"global.finish",defaultMessage:"finish"}))):l?a.createElement(a.Fragment,null,a.createElement(Y.z,{type:E?"button":"submit",variant:"secondary",onClick:R=>{R.preventDefault(),K(R,!0)},startIcon:a.createElement(Ne.Z,null)},W({id:(0,d.Z)("form.button.add-field"),defaultMessage:"Add another field"})),a.createElement(Y.z,{type:E?"submit":"button",variant:"default",onClick:R=>{R.preventDefault(),te(),K(R,!1)}},W({id:"global.finish",defaultMessage:"Finish"}))):null};Rt.defaultProps={categoryName:null,onClickFinish(){}},Rt.propTypes={categoryName:t().string,deleteCategory:t().func.isRequired,deleteComponent:t().func.isRequired,deleteContentType:t().func.isRequired,isAttributeModal:t().bool.isRequired,isCustomFieldModal:t().bool.isRequired,isComponentAttribute:t().bool.isRequired,isComponentModal:t().bool.isRequired,isComponentToDzModal:t().bool.isRequired,isContentTypeModal:t().bool.isRequired,isCreatingComponent:t().bool.isRequired,isCreatingComponentAttribute:t().bool.isRequired,isCreatingComponentInDz:t().bool.isRequired,isCreatingComponentWhileAddingAField:t().bool.isRequired,isCreatingContentType:t().bool.isRequired,isCreatingDz:t().bool.isRequired,isDzAttribute:t().bool.isRequired,isEditingAttribute:t().bool.isRequired,isEditingCategory:t().bool.isRequired,isInFirstComponentStep:t().bool.isRequired,onSubmitAddComponentAttribute:t().func.isRequired,onSubmitAddComponentToDz:t().func.isRequired,onSubmitCreateContentType:t().func.isRequired,onSubmitCreateComponent:t().func.isRequired,onSubmitCreateDz:t().func.isRequired,onSubmitEditAttribute:t().func.isRequired,onSubmitEditCategory:t().func.isRequired,onSubmitEditComponent:t().func.isRequired,onSubmitEditContentType:t().func.isRequired,onSubmitEditCustomFieldAttribute:t().func.isRequired,onSubmitEditDz:t().func.isRequired,onClickFinish:t().func};var xa=Rt,Sa=({modalType:e,forTarget:n,kind:s,actionType:r,step:o})=>{switch(e){case"chooseAttribute":return(0,d.Z)(`modalForm.sub-header.chooseAttribute.${n.includes("component")?"component":s||"collectionType"}`);case"attribute":return(0,d.Z)(`modalForm.sub-header.attribute.${r}${o!=="null"&&o!==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 Zt=({actionType:e,modalType:n,forTarget:s,kind:r,step:o,attributeType:l,attributeName:i,customField:c})=>{const{formatMessage:m}=(0,P.Z)(),g=n==="customField"?c.intlLabel:{id:(0,d.Z)(`attribute.${l}`)};return a.createElement($.k,{direction:"column",alignItems:"flex-start",paddingBottom:2,gap:1},a.createElement(X.Z,{as:"h2",variant:"beta"},m({id:Sa({actionType:e,forTarget:s,kind:r,step:o,modalType:n}),defaultMessage:"Add new field"},{type:Ce()(m(g)),name:Ce()(i),step:o})),a.createElement(X.Z,{variant:"pi",textColor:"neutral600"},m({id:(0,d.Z)(`attribute.${l}.description`),defaultMessage:"A type for modeling data"})))};Zt.defaultProps={actionType:null,modalType:null,forTarget:null,kind:null,step:null,attributeType:null,attributeName:null,customField:null},Zt.propTypes={actionType:t().string,modalType:t().string,forTarget:t().string,kind:t().string,step:t().string,attributeType:t().string,attributeName:t().string,customField:t().object};var Na=Zt,nt=u(68465),at=u(84967);const At=({intlLabel:e,name:n,options:s,onChange:r,value:o})=>{const{formatMessage:l}=(0,P.Z)(),i=e.id?l({id:e.id,defaultMessage:e.defaultMessage},{...e.values}):n,c=m=>{let g="";m==="true"&&(g=!0),m==="false"&&(g=!1),r({target:{name:n,value:g,type:"select-default-boolean"}})};return a.createElement(nt.P,{label:i,id:n,name:n,onChange:c,value:(o===null?"":o).toString()},s.map(({metadatas:{intlLabel:m,disabled:g,hidden:f},key:p,value:Z})=>a.createElement(at.W,{key:p,value:Z,disabled:g,hidden:f},m.defaultMessage)))};At.defaultProps={value:null},At.propTypes={intlLabel:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}).isRequired,name:t().string.isRequired,onChange:t().func.isRequired,options:t().arrayOf(t().shape({metadatas:t().shape({intlLabel:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired}).isRequired,disabled:t().bool,hidden:t().bool}).isRequired,key:t().oneOfType([t().string,t().number]).isRequired,value:t().oneOfType([t().string,t().number]).isRequired}).isRequired).isRequired,value:t().any};var Fa=At,Oa=u(30350);const La=(0,Ie.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,Oa.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
|
+
${X.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
|
+
`,xt=({intlLabel:e,name:n,onChange:s,radios:r,value:o})=>{const{formatMessage:l}=(0,P.Z)();return a.createElement($.k,{direction:"column",alignItems:"stretch",gap:2},a.createElement(X.Z,{variant:"pi",fontWeight:"bold",textColor:"neutral800",htmlFor:n,as:"label"},l(e)),a.createElement(La,{gap:4,alignItems:"stretch"},r.map(i=>a.createElement("label",{htmlFor:i.value.toString(),key:i.value,className:"container"},a.createElement("input",{id:i.value.toString(),name:n,className:"option-input",checked:i.value===o,value:i.value,key:i.value,onChange:s,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(X.Z,{fontWeight:"bold"},l(i.title)),a.createElement(X.Z,{variant:"pi",textColor:"neutral600"},l(i.description)))))))))};xt.defaultProps={radios:[]},xt.propTypes={intlLabel:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}).isRequired,name:t().string.isRequired,onChange:t().func.isRequired,radios:t().arrayOf(t().shape({title:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired}),description:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired}),value:t().any.isRequired})),value:t().oneOfType([t().string,t().bool]).isRequired};var St=xt;const Tn=({onChange:e,name:n,...s})=>{const r=o=>{const l=o.target.value!=="false";e({target:{name:n,value:l,type:"boolean-radio-group"}})};return a.createElement(St,{...s,name:n,onChange:r})};Tn.propTypes={name:t().string.isRequired,onChange:t().func.isRequired};var Ia=Tn,Nt=u(10369),qa=u(32382);const Ft=({error:e,intlLabel:n,modifiedData:s,name:r,onChange:o,value:l})=>{const{formatMessage:i}=(0,P.Z)(),[c,m]=(0,a.useState)(!!l||l===0),g=n.id?i({id:n.id,defaultMessage:n.defaultMessage},{...n.values}):r,f=s.type==="biginteger"?"text":"number",p=!s.type,Z=e?i({id:e,defaultMessage:e}):"";return a.createElement($.k,{direction:"column",alignItems:"stretch",gap:2},a.createElement(vt.X,{id:r,name:r,onValueChange:h=>{o({target:{name:r,value:h?f==="text"?"0":0:null}}),m(O=>!O)},value:c},g),c&&a.createElement(j.x,{paddingLeft:6,style:{maxWidth:"200px"}},f==="text"?a.createElement(Nt.o,{"aria-label":g,disabled:p,error:Z,id:r,name:r,onChange:o,value:l===null?"":l}):a.createElement(qa.Y,{"aria-label":g,disabled:p,error:Z,id:r,name:r,onValueChange:h=>{o({target:{name:r,value:h,type:f}})},value:l||0})))};Ft.defaultProps={error:null,value:null},Ft.propTypes={error:t().string,intlLabel:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}).isRequired,modifiedData:t().object.isRequired,name:t().string.isRequired,onChange:t().func.isRequired,value:t().oneOfType([t().string,t().object,t().bool,t().number])};var Da=Ft;const Cn=({onChange:e,...n})=>{const s=(0,C.lm)(),r=o=>{s({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(o)};return a.createElement(St,{...n,onChange:r})};Cn.propTypes={onChange:t().func.isRequired};var Pa=Cn,Ot=u(49561),Mn=u(34853),Q=u(91559);const Lt=({oneThatIsCreatingARelationWithAnother:e,target:n})=>{const{contentTypes:s,sortedContentTypesList:r}=(0,Ze.Z)(),o=(0,ve.I0)(),l=r.filter(mn),i=T()(s,[n,"plugin"],null),c=T()(s,[n,"schema","displayName"],"error");return a.createElement(Mn.O,{id:"label",label:`${c}
|
|
88
|
+
${i?`(from: ${i})`:""}`},l.map(({uid:m,title:g,restrictRelationsTo:f,plugin:p})=>{const Z=()=>{const h=p?`${p}_${g}`:g;o({type:Q.aG,target:{value:m,oneThatIsCreatingARelationWithAnother:e,selectedContentTypeFriendlyName:h,targetContentTypeAllowedRelations:f}})};return a.createElement(Mn.s,{key:m,onClick:Z},g,"\xA0",p&&a.createElement(a.Fragment,null,"(from: ",p,")"))}))};Lt.defaultProps={target:null},Lt.propTypes={oneThatIsCreatingARelationWithAnother:t().string.isRequired,target:t().string};var ka=Lt;const It=({disabled:e,error:n,header:s,isMain:r,name:o,onChange:l,oneThatIsCreatingARelationWithAnother:i,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(X.Z,{variant:"pi",fontWeight:"bold",textColor:"neutral800"},s):a.createElement(ka,{target:c,oneThatIsCreatingARelationWithAnother:i})),a.createElement(pt.i,{background:"neutral200"}),a.createElement(j.x,{padding:4},a.createElement(C.jm,{disabled:e,error:n?.id||null,intlLabel:{id:(0,d.Z)("form.attribute.item.defineRelation.fieldName"),defaultMessage:"Field name"},name:o,onChange:l,type:"text",value:m})));It.defaultProps={disabled:!1,error:null,header:null,isMain:!1,onChange(){},oneThatIsCreatingARelationWithAnother:null,target:null,value:""},It.propTypes={disabled:t().bool,error:t().object,header:t().string,isMain:t().bool,name:t().string.isRequired,onChange:t().func,oneThatIsCreatingARelationWithAnother:t().string,target:t().string,value:t().string};var En=It,$a=u(51382),Rn=u.n($a),Ua=u(24443),qt=u.n(Ua),Wa=u(25449),Ba=u(10168),ja=u(7733),wa=u(79634),za=u(26253),Va=u(32548);const Ka=(0,Ie.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
|
+
`,Ga=(0,Ie.ZP)(j.x)`
|
|
101
|
+
background: ${({theme:e,isSelected:n})=>e.colors[n?"primary100":"neutral0"]};
|
|
102
|
+
border: 1px solid
|
|
103
|
+
${({theme:e,isSelected:n})=>e.colors[n?"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:n})=>e.colors[n?"primary700":"neutral500"]};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
&:disabled {
|
|
114
|
+
cursor: not-allowed;
|
|
115
|
+
}
|
|
116
|
+
`,Ha=(0,Ie.ZP)($.k)`
|
|
117
|
+
position: absolute;
|
|
118
|
+
bottom: 0;
|
|
119
|
+
left: 0;
|
|
120
|
+
right: 0;
|
|
121
|
+
`,Ya={oneWay:Wa.Z,oneToOne:Ba.Z,oneToMany:ja.Z,manyToOne:wa.Z,manyToMany:za.Z,manyWay:Va.Z},Dt=({naturePickerType:e,oneThatIsCreatingARelationWithAnother:n,relationType:s,target:r})=>{const o=(0,ve.I0)(),{formatMessage:l}=(0,P.Z)(),{contentTypes:i,modifiedData:c}=(0,Ze.Z)(),m=["oneWay","oneToOne","oneToMany","manyToOne","manyToMany","manyWay"],g=["oneWay","manyWay"],p=(e==="contentType"?T()(c,[e,"schema","kind"],""):e)==="collectionType"?m:g,Z=s==="manyToOne",h=T()(i,[r,"schema","displayName"],"unknown"),v=Z?h:n,A=Z?n:h,O=qt()(v,s==="manyToMany"?2:1),E=T()(i,[r,"schema","restrictRelationsTo"],null),M=qt()(A,["manyToMany","oneToMany","manyToOne","manyWay"].includes(s)?2:1);return s?a.createElement($.k,{style:{flex:1}},a.createElement(Ka,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(S=>{const U=Ya[S],z=E===null||E.includes(S);return a.createElement(Ga,{as:"button",isSelected:s===S,disabled:!z,key:S,onClick:()=>{z&&o({type:Q.QQ,target:{oneThatIsCreatingARelationWithAnother:n,targetContentType:r,value:S}})},padding:2,type:"button"},a.createElement(U,{key:S}))}))))),a.createElement(Ha,{justifyContent:"center"},a.createElement(X.Z,null,Rn()(O,{length:24}),"\xA0"),a.createElement(X.Z,{textColor:"primary600"},l({id:(0,d.Z)(`relation.${s}`)}),"\xA0"),a.createElement(X.Z,null,Rn()(M,{length:24})))):null};Dt.defaultProps={relationType:null,target:null},Dt.propTypes={naturePickerType:t().string.isRequired,oneThatIsCreatingARelationWithAnother:t().string.isRequired,relationType:t().string,target:t().string};var Qa=Dt;const Zn=({formErrors:e,mainBoxHeader:n,modifiedData:s,naturePickerType:r,onChange:o})=>{const l=(0,Ot.Z)(s.relation,s.targetAttribute);return a.createElement($.k,{style:{position:"relative"}},a.createElement(En,{isMain:!0,header:n,error:e?.name||null,name:"name",onChange:o,value:s?.name||""}),a.createElement(Qa,{naturePickerType:r,oneThatIsCreatingARelationWithAnother:n,relationType:l,target:s.target}),a.createElement(En,{disabled:["oneWay","manyWay"].includes(l),error:e?.targetAttribute||null,name:"targetAttribute",onChange:o,oneThatIsCreatingARelationWithAnother:n,target:s.target,value:s?.targetAttribute||""}))};Zn.propTypes={formErrors:t().object.isRequired,mainBoxHeader:t().string.isRequired,modifiedData:t().object.isRequired,naturePickerType:t().string.isRequired,onChange:t().func.isRequired};var Xa=Zn,An=u(45251);const Pt=({description:e,error:n,intlLabel:s,modifiedData:r,name:o,onChange:l,value:i})=>{const{formatMessage:c}=(0,P.Z)(),m=(0,a.useRef)(l),g=r?.displayName||"";(0,a.useEffect)(()=>{if(g){const h=(0,An.Z)(g);try{const v=qt()(h,2);m.current({target:{name:o,value:v}})}catch{m.current({target:{name:o,value:h}})}}else m.current({target:{name:o,value:""}})},[g,o]);const f=n?c({id:n,defaultMessage:n}):"",p=e?c({id:e.id,defaultMessage:e.defaultMessage},{...e.values}):"",Z=c(s);return a.createElement(Nt.o,{error:f,label:Z,id:o,hint:p,name:o,onChange:l,value:i||""})};Pt.defaultProps={description:null,error:null,value:null},Pt.propTypes={description:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}),error:t().string,intlLabel:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}).isRequired,modifiedData:t().object.isRequired,name:t().string.isRequired,onChange:t().func.isRequired,value:t().string};var Ja=Pt,_a=u(21428),es=u(90333);const kt=({error:e,intlLabel:n,name:s,onChange:r,value:o})=>{const{formatMessage:l}=(0,P.Z)(),{allComponentsCategories:i}=(0,Ze.Z)(),[c,m]=(0,a.useState)(i),g=e?l({id:e,defaultMessage:e}):"",f=l(n),p=h=>{r({target:{name:s,value:h,type:"select-category"}})},Z=h=>{m(v=>[...v,h]),p(h)};return a.createElement(_a.XU,{error:g,id:s,label:f,name:s,onChange:p,onCreateOption:Z,value:o},c.map(h=>a.createElement(es.O,{key:h,value:h},h)))};kt.defaultProps={error:null,value:null},kt.propTypes={error:t().string,intlLabel:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}).isRequired,name:t().string.isRequired,onChange:t().func.isRequired,value:t().string};var ts=kt;const $t=({error:e,intlLabel:n,isAddingAComponentToAnotherComponent:s,isCreating:r,isCreatingComponentWhileAddingAField:o,componentToCreate:l,name:i,onChange:c,targetUid:m,forTarget:g,value:f})=>{const{formatMessage:p}=(0,P.Z)(),Z=e?p({id:e,defaultMessage:e}):"",h=p(n),{componentsGroupedByCategory:v,componentsThatHaveOtherComponentInTheirAttributes:A}=(0,Ze.Z)(),O=["component","components"].includes(g);let E=Object.entries(v).reduce((M,S)=>{const[U,z]=S,J=z.map(ne=>({uid:ne.uid,label:ne.schema.displayName,categoryName:U}));return[...M,...J]},[]);return s&&(E=E.filter(M=>!A.includes(M.uid))),O&&(E=E.filter(M=>M.uid!==m)),o&&(E=[{uid:f,label:l.displayName,categoryName:l.category}]),a.createElement(nt.P,{disabled:o||!r,error:Z,label:h,id:i,name:i,onChange:M=>{c({target:{name:i,value:M,type:"select-category"}})},value:f||""},E.map(M=>a.createElement(at.W,{key:M.uid,value:M.uid},`${M.categoryName} - ${M.label}`)))};$t.defaultProps={componentToCreate:null,error:null},$t.propTypes={componentToCreate:t().object,forTarget:t().string.isRequired,error:t().string,intlLabel:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}).isRequired,isAddingAComponentToAnotherComponent:t().bool.isRequired,isCreating:t().bool.isRequired,isCreatingComponentWhileAddingAField:t().bool.isRequired,name:t().string.isRequired,onChange:t().func.isRequired,targetUid:t().string.isRequired,value:t().string.isRequired};var ns=$t,Ut=(e,n)=>e.find(({name:s})=>s===n);const xn=({dynamicZoneTarget:e,intlLabel:n,name:s,onChange:r,value:o})=>{const{formatMessage:l}=(0,P.Z)(),{componentsGroupedByCategory:i,modifiedData:c}=(0,Ze.Z)(),g=(Ut(c.contentType.schema.attributes,e)||{}).components||[],f=Object.keys(i).reduce((h,v)=>{const A=i[v].filter(({uid:O})=>!g.includes(O));return A.length>0&&(h[v]=A),h},{}),p=Object.entries(f).reduce((h,v)=>{const[A,O]=v,E={label:A,children:O.map(({uid:M,schema:{displayName:S}})=>({label:S,value:M}))};return h.push(E),h},[]),Z=l({id:(0,d.Z)("components.SelectComponents.displayed-value"),defaultMessage:"{number, plural, =0 {# components} one {# component} other {# components}} selected"},{number:o.length});return a.createElement(cn.Q,{id:"select1",label:l(n),customizeContent:()=>Z,name:s,onChange:h=>{r({target:{name:s,value:h,type:"select-components"}})},options:p,value:o||[]})};xn.propTypes={intlLabel:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}).isRequired,dynamicZoneTarget:t().string.isRequired,name:t().string.isRequired,onChange:t().func.isRequired,value:t().array.isRequired};var as=xn;const Wt=({intlLabel:e,error:n,modifiedData:s,name:r,onChange:o,options:l,value:i})=>{const{formatMessage:c}=(0,P.Z)(),m=c(e),g=n?c({id:n,defaultMessage:n}):"",f=p=>{o({target:{name:r,value:p,type:"select"}}),i&&s.default!==void 0&&s.default!==null&&o({target:{name:"default",value:null}})};return a.createElement(nt.P,{error:g,label:m,id:r,name:r,onChange:f,value:i||""},l.map(({metadatas:{intlLabel:p,disabled:Z,hidden:h},key:v,value:A})=>a.createElement(at.W,{key:v,value:A,disabled:Z,hidden:h},c({id:p.id,defaultMessage:p.defaultMessage},p.values))))};Wt.defaultProps={error:void 0,value:""},Wt.propTypes={error:t().string,intlLabel:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}).isRequired,modifiedData:t().object.isRequired,name:t().string.isRequired,onChange:t().func.isRequired,options:t().arrayOf(t().shape({metadatas:t().shape({intlLabel:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired}).isRequired,disabled:t().bool,hidden:t().bool}).isRequired,key:t().oneOfType([t().string,t().number]).isRequired,value:t().oneOfType([t().string,t().number]).isRequired}).isRequired).isRequired,value:t().string};var ss=Wt;const Bt=({intlLabel:e,error:n,modifiedData:s,name:r,onChange:o,options:l,value:i})=>{const{formatMessage:c}=(0,P.Z)(),m=c(e),g=n?c({id:n,defaultMessage:n}):"",f=p=>{o({target:{name:r,value:p,type:"select"}}),i&&(p==="biginteger"&&i!=="biginteger"&&(s.default!==void 0&&s.default!==null&&o({target:{name:"default",value:null}}),s.max!==void 0&&s.max!==null&&o({target:{name:"max",value:null}}),s.min!==void 0&&s.min!==null&&o({target:{name:"min",value:null}})),["decimal","float","integer"].includes(p)&&i==="biginteger"&&(s.default!==void 0&&s.default!==null&&o({target:{name:"default",value:null}}),s.max!==void 0&&s.max!==null&&o({target:{name:"max",value:null}}),s.min!==void 0&&s.min!==null&&o({target:{name:"min",value:null}})))};return a.createElement(nt.P,{error:g,label:m,id:r,name:r,onChange:f,value:i||""},l.map(({metadatas:{intlLabel:p,disabled:Z,hidden:h},key:v,value:A})=>a.createElement(at.W,{key:v,value:A,disabled:Z,hidden:h},c(p))))};Bt.defaultProps={error:void 0,value:""},Bt.propTypes={error:t().string,intlLabel:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}).isRequired,modifiedData:t().object.isRequired,name:t().string.isRequired,onChange:t().func.isRequired,options:t().arrayOf(t().shape({metadatas:t().shape({intlLabel:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired}).isRequired,disabled:t().bool,hidden:t().bool}).isRequired,key:t().oneOfType([t().string,t().number]).isRequired,value:t().oneOfType([t().string,t().number]).isRequired}).isRequired).isRequired,value:t().string};var os=Bt;const jt=({description:e,error:n,intlLabel:s,modifiedData:r,name:o,onChange:l,value:i})=>{const{formatMessage:c}=(0,P.Z)(),m=(0,a.useRef)(l),g=r?.displayName||"";(0,a.useEffect)(()=>{g?m.current({target:{name:o,value:(0,An.Z)(g)}}):m.current({target:{name:o,value:""}})},[g,o]);const f=n?c({id:n,defaultMessage:n}):"",p=e?c({id:e.id,defaultMessage:e.defaultMessage},{...e.values}):"",Z=c(s);return a.createElement(Nt.o,{error:f,label:Z,id:o,hint:p,name:o,onChange:l,value:i||""})};jt.defaultProps={description:null,error:null,value:null},jt.propTypes={description:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}),error:t().string,intlLabel:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}).isRequired,modifiedData:t().object.isRequired,name:t().string.isRequired,onChange:t().func.isRequired,value:t().string};var rs=jt;const Sn=({form:e,formErrors:n,genericInputProps:s,modifiedData:r,onChange:o})=>{const{formatMessage:l}=(0,P.Z)();return e.map((i,c)=>i.items.length===0?null:a.createElement(j.x,{key:c},i.sectionTitle&&a.createElement(j.x,{paddingBottom:4},a.createElement(X.Z,{variant:"delta",as:"h3"},l(i.sectionTitle))),a.createElement(bt.r,{gap:4},i.items.map((m,g)=>{const f=`${c}.${g}`,p=T()(r,m.name,""),Z=Object.keys(n).find(v=>v===m.name),h=Z?n[Z].id:T()(n,[...m.name.split(".").filter(v=>v!=="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(C.jm,{...m,...s,error:h,onChange:o,value:p}))}))))};Sn.propTypes={form:t().arrayOf(t().object).isRequired,formErrors:t().object.isRequired,genericInputProps:t().object.isRequired,modifiedData:t().object.isRequired,onChange:t().func.isRequired};var Nn=Sn,is=u(33475);const wt=({description:e,disabled:n,error:s,intlLabel:r,labelAction:o,name:l,onChange:i,placeholder:c,value:m})=>{const{formatMessage:g}=(0,P.Z)(),f=s?g({id:s,defaultMessage:s}):"",p=e?g({id:e.id,defaultMessage:e.defaultMessage},{...e.values}):"",Z=g(r),h=c?g({id:c.id,defaultMessage:c.defaultMessage},{...c.values}):"",v=Array.isArray(m)?m.join(`
|
|
122
|
+
`):"",A=O=>{const E=O.target.value.split(`
|
|
123
|
+
`);i({target:{name:l,value:E}})};return a.createElement(is.g,{disabled:n,error:f,label:Z,labelAction:o,id:l,hint:p,name:l,onChange:A,placeholder:h,value:v},v)};wt.defaultProps={description:null,disabled:!1,error:"",labelAction:void 0,placeholder:null,value:""},wt.propTypes={description:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}),disabled:t().bool,error:t().string,intlLabel:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}).isRequired,labelAction:t().element,name:t().string.isRequired,onChange:t().func.isRequired,placeholder:t().shape({id:t().string.isRequired,defaultMessage:t().string.isRequired,values:t().object}),value:t().oneOfType([t().array,t().string])};var ls=wt,us=(e,n)=>{const s=T()(e,["contentType","schema","kind"],"");return s==="singleType"||s===n.kind?!0:T()(e,["contentType","schema","attributes"],[]).filter(({relation:l,type:i,targetAttribute:c})=>{const m=(0,Ot.Z)(l,c);return i==="relation"&&!["oneWay","manyWay"].includes(m)}).length===0},ds=(e="",n,s)=>{const r=["text","email","richtext","password","number","enumeration","date","media","boolean","json","relation"],o=e==="contentType",l=s.includes(n),i=!o&&!l;return o?[[...r,"uid"],["component","dynamiczone"]]:i?[r,["component"]]:[r]},Fn=e=>e.reduce((n,s)=>{const r=s.items.reduce((o,l)=>(l.name&&o.push(l.name),o),[]);return[...n,...r]},[]),b=u(24346),qe=u(2158),cs={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]*$/,ms=e=>{const n={name:b.Z_().matches(On,C.I0.regex).test({name:"nameNotAllowed",message:C.I0.unique,test(s){return s?!e.includes(s?.toLowerCase()):!1}}).required(C.I0.required)};return b.Ry(n)},ps=(e,n,s)=>{const r={displayName:b.Z_().test({name:"nameAlreadyUsed",message:C.I0.unique,test(o){if(!o)return!1;const l=(0,qe.N)(o,s);return!e.includes(l)}}).test({name:"nameNotAllowed",message:(0,d.Z)("error.contentTypeName.reserved-name"),test(o){return o?!n.includes(o?.trim()?.toLowerCase()):!1}}).required(C.I0.required),category:b.Z_().matches(On,C.I0.regex).required(C.I0.required),icon:b.Z_()};return b.Ry(r)},zt={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[]}},x={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"}}},gs={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:[x.required,x.private]}]}},component({repeatable:e},n){return n==="1"?{sections:De.advanced("componentToCreate")}:e?{sections:[{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[x.required,x.private,x.max,x.min]}]}:{sections:[{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[x.required,x.private]}]}},date({type:e}){return{sections:[{sectionTitle:null,items:[{...x.default,type:e||"date",value:null,withDefaultValue:!1,disabled:!e,autoFocus:!1}]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[x.required,x.unique,x.private]}]}},dynamiczone(){return{sections:[{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[x.required,x.max,x.min]}]}},email(){return{sections:[{sectionTitle:null,items:[{...x.default,type:"email"}]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[x.required,x.unique,x.maxLength,x.minLength,x.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((n,s)=>e.enum.indexOf(n)===s&&n).map(n=>({key:n,value:n,metadatas:{intlLabel:{id:`${n}.no-override`,defaultMessage:n}}}))]},{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:[x.required,x.private]}]}},json(){return{sections:[{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[x.required,x.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:[x.required,x.private]}]}},number(e){const n=e.type==="decimal"||e.type==="float"?"any":1;return{sections:[{sectionTitle:null,items:[{autoFocus:!0,name:"default",type:e.type==="biginteger"?"text":"number",step:n,intlLabel:{id:(0,d.Z)("form.attribute.settings.default"),defaultMessage:"Default value"},validations:{}}]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[x.required,x.unique,x.max,x.min,x.private]}]}},password(){return{sections:[{sectionTitle:null,items:[x.default]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[x.required,x.maxLength,x.minLength,x.private]}]}},relation(){return{sections:[{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[x.private]}]}},richtext(){return{sections:[{sectionTitle:null,items:[x.default]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[x.required,x.maxLength,x.minLength,x.private]}]}},text(){return{sections:[{sectionTitle:null,items:[x.default,x.regex]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[x.required,x.unique,x.maxLength,x.minLength,x.private]}]}},uid(e){return{sections:[{sectionTitle:null,items:[{...x.default,disabled:Boolean(e.targetField),type:"text"}]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[x.required,x.maxLength,x.minLength,x.private]}]}}};const fe={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 fs={component(e,n){if(n==="1"){const s=e.createComponent===!0?De.base("componentToCreate."):[];return{sections:[{sectionTitle:null,items:[zt]},...s]}}return{sections:[{sectionTitle:null,items:[fe,{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:[fe,{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:[fe]},{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:[fe]},{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:[fe,{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:[fe]},{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:[fe]},{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,n,s){const r=s.filter(({type:o})=>["string","text"].includes(o)).map(({name:o})=>({key:o,value:o,metadatas:{intlLabel:{id:`${o}.no-override`,defaultMessage:o}}}));return{sections:[{sectionTitle:null,items:[{...fe,placeholder:{id:(0,d.Z)("modalForm.attribute.form.base.name.placeholder"),defaultMessage:"e.g. slug, seoUrl, canonicalUrl"}},{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:gs,base:fs},ys={sections:[{sectionTitle:null,items:[fe]}]},bs=u(91815),hs=u.n(bs),vs=u(40791),Ts=u.n(vs),Vt=e=>Ts()(e,{decamelize:!1,lowercase:!1,separator:"_"}),Cs=u(78746),Kt=u.n(Cs);const In=/^[A-Za-z][_0-9A-Za-z]*$/,qn=e=>({name:"attributeNameAlreadyUsed",message:C.I0.unique,test(n){return n?!e.includes(n):!1}}),Jo=(e,n,s)=>{const r=e?.schema?.attributes??{};return Object.keys(r).filter(o=>n?o!==s:!0)},Gt=e=>({name:"forbiddenAttributeName",message:(0,d.Z)("error.attributeName.reserved-name"),test(n){return n?!e.includes(n):!1}}),y={default:()=>b.Z_().nullable(),max:()=>b.Rx().integer().nullable(),min:()=>b.Rx().integer().when("max",(e,n)=>e?n.max(e,(0,d.Z)("error.validation.minSupMax")):n).nullable(),maxLength:()=>b.Rx().integer().positive((0,d.Z)("error.validation.positive")).nullable(),minLength:()=>b.Rx().integer().min(0).when("maxLength",(e,n)=>e?n.max(e,(0,d.Z)("error.validation.minSupMax")):n).nullable(),name(e,n){return b.Z_().test(qn(e)).test(Gt(n)).matches(In,C.I0.regex).required(C.I0.required)},required:()=>b.O7(),type:()=>b.Z_().required(C.I0.required),unique:()=>b.O7().nullable()},Ht=(e,n)=>({name:y.name(e,n),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()}),Yt={name:"isMinSuperiorThanMax",message:(0,d.Z)("error.validation.minSupMax"),test(e){if(!e)return!0;const{max:n}=this.parent;return!n||Number.isNaN(Kt()(e))?!0:Kt()(n)>=Kt()(e)}};var Qt={date(e,n){const s={name:y.name(e,n),type:y.type()};return b.Ry(s)},datetime(e,n){const s={name:y.name(e,n),type:y.type()};return b.Ry(s)},time(e,n){const s={name:y.name(e,n),type:y.type()};return b.Ry(s)},default(e,n){const s={name:y.name(e,n),type:y.type()};return b.Ry(s)},biginteger(e,n){const s={name:y.name(e,n),type:y.type(),default:b.Z_().nullable().matches(/^-?\d*$/),unique:y.unique(),required:y.required(),max:b.Z_().nullable().matches(/^-?\d*$/,C.I0.regex),min:b.Z_().nullable().test(Yt).matches(/^-?\d*$/,C.I0.regex)};return b.Ry(s)},boolean(e,n){const s={name:y.name(e,n),default:b.O7().nullable(),required:y.required(),unique:y.unique()};return b.Ry(s)},component(e,n){const s={name:y.name(e,n),type:y.type(),required:y.required(),max:y.max(),min:y.min(),component:b.Z_().required(C.I0.required)};return b.Ry(s)},decimal(e,n){const s={name:y.name(e,n),type:y.type(),default:b.Rx(),required:y.required(),max:b.Rx(),min:b.Rx().test(Yt)};return b.Ry(s)},dynamiczone(e,n){const s={name:y.name(e,n),type:y.type(),required:y.required(),max:y.max(),min:y.min()};return b.Ry(s)},email(e,n){const s={name:y.name(e,n),type:y.type(),default:b.Z_().email().nullable(),unique:y.unique(),required:y.required(),maxLength:y.maxLength(),minLength:y.minLength()};return b.Ry(s)},enumeration(e,n){const s=/^[_A-Za-z][_0-9A-Za-z]*$/,r={name:b.Z_().test(qn(e)).test(Gt(n)).matches(s,C.I0.regex).required(C.I0.required),type:y.type(),default:y.default(),unique:y.unique(),required:y.required(),enum:b.IX().of(b.Z_()).min(1,C.I0.min).test({name:"areEnumValuesUnique",message:(0,d.Z)("error.validation.enum-duplicate"),test(o){return!hs()(o.map(Vt).filter((i,c,m)=>m.indexOf(i)!==c)).length}}).test({name:"doesNotHaveEmptyValues",message:(0,d.Z)("error.validation.enum-empty-string"),test:o=>!o.map(Vt).some(l=>l==="")}).test({name:"doesMatchRegex",message:(0,d.Z)("error.validation.enum-regex"),test:o=>o.map(Vt).every(l=>s.test(l))}),enumName:b.Z_().nullable()};return b.Ry(r)},float(e,n){const s={name:y.name(e,n),type:y.type(),required:y.required(),default:b.Rx(),max:b.Rx(),min:b.Rx().test(Yt)};return b.Ry(s)},integer(e,n){const s={name:y.name(e,n),type:y.type(),default:b.Rx().integer(),unique:y.unique(),required:y.required(),max:y.max(),min:y.min()};return b.Ry(s)},json(e,n){const s={name:y.name(e,n),type:y.type(),required:y.required(),unique:y.unique()};return b.Ry(s)},media(e,n){const s={name:y.name(e,n),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(s)},password(e,n){const s={name:y.name(e,n),type:y.type(),default:y.default(),unique:y.unique(),required:y.required(),maxLength:y.maxLength(),minLength:y.minLength()};return b.Ry(s)},relation(e,n,s,{initialData:r,modifiedData:o}){const l={name:y.name(e,n),target:b.Z_().required(C.I0.required),relation:b.Z_().required(),type:b.Z_().required(),targetAttribute:b.Vo(()=>{const i=(0,Ot.Z)(o.relation,o.targetAttribute);if(i==="oneWay"||i==="manyWay")return b.Z_().nullable();let c=b.Z_().test(Gt(n)),g=[...s.map(({name:f})=>f),o.name].filter(f=>f!==r.targetAttribute);return c.matches(In,C.I0.regex).test({name:"forbiddenTargetAttributeName",message:(0,d.Z)("error.validation.relation.targetAttribute-taken"),test(f){return f?!g.includes(f):!1}}).required(C.I0.required)})};return b.Ry(l)},richtext(e,n){const s={name:y.name(e,n),type:y.type(),default:y.default(),unique:y.unique(),required:y.required(),maxLength:y.maxLength(),minLength:y.minLength()};return b.Ry(s)},string(e,n){const s=Ht(e,n);return b.Ry(s)},text(e,n){const s=Ht(e,n);return b.Ry(s)},uid(e,n){const s=Ht(e,n);return b.Ry(s)}};const Dn={name:"displayName",type:"text",intlLabel:{id:(0,d.Z)("contentType.displayName.label"),defaultMessage:"Display name"}};var Xt={advanced:{default(){const e=[{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:{}}];return window.strapi.features.isEnabled(window.strapi.features.REVIEW_WORKFLOWS)&&e.push({intlLabel:{id:(0,d.Z)("contentType.reviewWorkflows.label"),defaultMessage:"Review Workflows"},description:{id:(0,d.Z)("contentType.reviewWorkflows.description"),defaultMessage:"Allows having content in different review stages"},name:"reviewWorkflows",type:"toggle-review-workflows",validations:{}}),{sections:[{items:e}]}}},base:{create(){return{sections:[{sectionTitle:null,items:[Dn,{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:[Dn,{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"}]}]}]}}}},Ms=({usedContentTypeNames:e=[],reservedModels:n=[],singularNames:s=[],pluralNames:r=[],collectionNames:o=[]})=>{const l={displayName:b.Z_().test({name:"nameAlreadyUsed",message:C.I0.unique,test(i){if(!i)return!1;const c=(0,qe.E)(i);return!e.includes(c)}}).test({name:"nameNotAllowed",message:(0,d.Z)("error.contentTypeName.reserved-name"),test(i){return i?!n.includes(i?.trim()?.toLowerCase()):!1}}).required(C.I0.required),pluralName:b.Z_().test({name:"pluralNameAlreadyUsed",message:C.I0.unique,test(i){return i?!r.includes(i):!1}}).test({name:"pluralNameAlreadyUsedAsSingular",message:(0,d.Z)("error.contentType.pluralName-equals-singularName"),test(i){return i?!s.includes(i):!1}}).test({name:"pluralAndSingularAreUnique",message:(0,d.Z)("error.contentType.pluralName-used"),test(i,c){return i?c.parent.singularName!==i:!1}}).test({name:"pluralNameNotAllowed",message:(0,d.Z)("error.contentTypeName.reserved-name"),test(i){return i?!n.includes(i?.trim()?.toLowerCase()):!1}}).test({name:"pluralNameNotAlreadyUsedInCollectionName",message:(0,d.Z)("error.contentType.pluralName-equals-collectionName"),test(i){return i?!o.includes(i?.trim()?.toLowerCase()):!1}}).required(C.I0.required),singularName:b.Z_().test({name:"singularNameAlreadyUsed",message:C.I0.unique,test(i){return i?!s.includes(i):!1}}).test({name:"singularNameAlreadyUsedAsPlural",message:(0,d.Z)("error.contentType.singularName-equals-pluralName"),test(i){return i?!r.includes(i):!1}}).test({name:"pluralAndSingularAreUnique",message:(0,d.Z)("error.contentType.singularName-used"),test(i,c){return i?c.parent.pluralName!==i:!1}}).test({name:"singularNameNotAllowed",message:(0,d.Z)("error.contentTypeName.reserved-name"),test(i){return i?!n.includes(i?.trim()?.toLowerCase()):!1}}).required(C.I0.required),draftAndPublish:b.O7(),kind:b.Z_().oneOf(["singleType","collectionType"]),reviewWorkflows:b.O7()};return b.Ry(l)},Jt={advanced:{default(){return{sections:De.advanced("componentToCreate.")}}},base:{createComponent(){return{sections:[{sectionTitle:null,items:[zt]},...De.base("componentToCreate.")]}},default(){return{sections:[{sectionTitle:null,items:[zt]},{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}]}]}}}},Pn=(e,n)=>{e.forEach(s=>{if(!("sectionTitle"in s)){n[0].items.push(s);return}n.push(s)})},kn=(e,n)=>e.filter(({name:s})=>s!==n.initialData.name).map(({name:s})=>s),Ae={customField:{schema({schemaAttributes:e,attributeType:n,customFieldValidator:s,reservedNames:r,schemaData:o,ctbFormsAPI:l}){const i=kn(e,o),c=Qt[n](i,r.attributes);return l.makeCustomFieldValidator(c,s,i,r.attributes,o)},form:{base({customField:e}){const n=[{sectionTitle:null,items:[fe]}];return e.options?.base&&Pn(e.options.base,n),{sections:n}},advanced({customField:e,data:n,step:s,extensions:r,...o}){const l=[{sectionTitle:null,items:[]}],i=r.getAdvancedForm(["attribute",e.type],{data:n,type:e.type,step:s,...o});if(e.options?.advanced&&Pn(e.options.advanced,l),i){const c={sectionTitle:{id:(0,d.Z)("modalForm.custom-fields.advanced.settings.extended"),defaultMessage:"Extended settings"},items:i};l.push(c)}return{sections:l}}}},attribute:{schema(e,n,s,r,o,l){const i=T()(e,["schema","attributes"],[]),c=kn(i,o);try{let m=Qt[n](c,s.attributes,r,o);return l.makeValidator(["attribute",n],m,c,s.attributes,r,o)}catch(m){return console.error("Error yup build schema",m),Qt.default(c,s.attributes)}},form:{advanced({data:e,type:n,step:s,extensions:r,...o}){try{const l=Ln.advanced[n](e,s).sections,i=r.getAdvancedForm(["attribute",n],{data:e,type:n,step:s,...o});return{sections:l.reduce((m,g)=>(g.sectionTitle===null?m.push(g):m.push({...g,items:[...g.items,...i]}),m),[])}}catch(l){return console.error(l),{sections:[]}}},base({data:e,type:n,step:s,attributes:r}){try{return Ln.base[n](e,s,r)}catch{return ys}}}},contentType:{schema(e,n,s,r,o,l){const i=Object.values(l).map(v=>v.schema.singularName),c=Object.values(l).map(v=>T()(v,["schema","pluralName"],"")),m=n?e.filter(v=>v!==s):e,g=n?i.filter(v=>T()(l,[s,"schema","singularName"],"")!==v):i,f=n?c.filter(v=>T()(l,[s,"schema","pluralName"],"")!==v):c,p=Object.values(l).map(v=>T()(v,["schema","collectionName"],"")),Z=n?p.filter(v=>{const A=T()(l,[s,"schema","pluralName"],""),O=T()(l,[s,"schema","collectionName"],"");return v!==A||v!==O}):p,h=Ms({usedContentTypeNames:m,reservedModels:r.models,singularNames:g,pluralNames:f,collectionNames:Z});return o.makeValidator(["contentType"],h,m,r.models,g,f)},form:{base({actionType:e}){return e==="create"?Xt.base.create():Xt.base.edit()},advanced({extensions:e}){const n=Xt.advanced.default().sections.map(r=>r.items).flat(),s=e.getAdvancedForm(["contentType"]);return{sections:[{items:[...n,...s]}]}}}},component:{schema(e,n,s,r=!1,o=null){const l=r?e.filter(i=>i!==o):e;return ps(l,s.models,n)},form:{advanced(){return{sections:De.advanced()}},base(){return{sections:De.base()}}}},addComponentToDynamicZone:{form:{advanced(){return Jt.advanced.default()},base({data:e}){return T()(e,"createComponent",!1)?Jt.base.createComponent():Jt.base.default()}}},editCategory:{schema(e,n){const s=e.filter(r=>r!==n.name).map(r=>je()(r));return ms(s)},form:{advanced:()=>({sections:[]}),base(){return cs.base}}}},$n=u(98178),Es=u(25061);const Rs=()=>e=>e[`${w.Z}_formModal`]||Es.E;var Zs=()=>(0,$n.P1)(Rs(),e=>e),As=()=>{const{onCloseModal:e,onNavigateToChooseAttributeModal:n,onNavigateToAddCompoToDZModal:s,onNavigateToCreateComponentStep2:r,actionType:o,attributeName:l,attributeType:i,customFieldUid:c,categoryName:m,dynamicZoneTarget:g,forTarget:f,modalType:p,isOpen:Z,kind:h,step:v,targetUid:A}=(0,Te.Z)(),O=(0,C.mZ)().get(c),E=(0,a.useRef)(),M=(0,a.useMemo)(Zs,[]),S=(0,ve.I0)(),U=(0,C.lm)(),z=(0,ve.v9)(D=>M(D),ve.wU),{push:J}=(0,B.k6)(),{trackUsage:ne}=(0,C.rS)(),{formatMessage:I}=(0,P.Z)(),{getPlugin:ge}=(0,C.j1)(),V=ge(w.Z).apis.forms,ye=V.components.inputs,{addAttribute:K,addCustomFieldAttribute:Pe,addCreatedComponentToDynamicZone:te,allComponentsCategories:W,changeDynamicZoneComponents:R,contentTypes:ke,components:Ke,createSchema:$e,deleteCategory:en,deleteData:ot,editCategory:tn,editCustomFieldAttribute:nn,submitData:an,modifiedData:ae,nestedComponents:sn,setModifiedData:on,sortedContentTypesList:rn,updateSchema:ln,reservedNames:Me}=(0,Ze.Z)(),{componentToCreate:Ge,formErrors:Ee,initialData:re,isCreatingComponentWhileAddingAField:xe,modifiedData:L}=z,N=f==="contentType"||f==="component"?[f]:[f,A];(0,a.useEffect)(()=>{if(Z){const D=rn.filter(mn);p==="editCategory"&&on(),o==="edit"&&p==="attribute"&&f==="contentType"&&ne("willEditFieldOfContentType");const ue=[...N,"schema","attributes"],me=Ut(T()(ae,ue,[]),g)||null;if(p==="editCategory"&&o==="edit"&&S({type:Q._H,modalType:p,actionType:o,data:{name:m}}),p==="contentType"&&o==="create"&&S({type:Q._H,modalType:p,actionType:o,data:{draftAndPublish:!0,reviewWorkflows:!1},pluginOptions:{}}),p==="contentType"&&o==="edit"){const{displayName:k,draftAndPublish:_,kind:pe,pluginOptions:se,pluralName:xo,reviewWorkflows:So,singularName:No}=T()(ae,[...N,"schema"],{displayName:null,pluginOptions:{},singularName:null,pluralName:null});S({type:Q._H,actionType:o,modalType:p,data:{displayName:k,draftAndPublish:_,kind:pe,pluginOptions:se,pluralName:xo,reviewWorkflows:So??!1,singularName:No}})}if(p==="component"&&o==="edit"){const k=T()(ae,N,{});S({type:Q._H,actionType:o,modalType:p,data:{displayName:k.schema.displayName,category:k.category}})}if(p==="addComponentToDynamicZone"&&o==="edit"){const k={...me,components:[],name:g,createComponent:!1,componentToCreate:{type:"component"}};S({type:Q.VZ,attributeToEdit:k})}if(i){const _={...Ut(T()(ae,ue,[]),l),name:l};i==="component"&&o==="edit"&&(_.repeatable||Qe()(_,"repeatable",!1)),S(p==="customField"?{type:Q.OY,customField:O,isEditing:o==="edit",modifiedDataToSetForEditing:_,forTarget:f}:{type:Q.S0,attributeType:i,nameToSetForRelation:T()(D,["0","title"],"error"),targetUid:T()(D,["0","uid"],"error"),isEditing:o==="edit",modifiedDataToSetForEditing:_,step:v,forTarget:f})}}else S({type:Q.c2})},[o,l,i,m,g,f,Z,p]);const F=p==="contentType",q=p==="component",H=p==="attribute",ie=p==="customField",le=i==="component"&&H,de=o==="create",be=T()(L,"createComponent",!1)||xe,Ue=v==="1",Jn=p==="editCategory",_n=p==="chooseAttribute",un=(0,qe.E)(L.displayName||""),dn=T()(ae,[...N,"schema","attributes"],null),po=async()=>{let D;const ue=be&&v==="1"?T()(L,"componentToCreate",{}):L;if(F)D=Ae.contentType.schema(Object.keys(ke),o==="edit",T()(ae,[...N,"uid"],null),Me,V,ke);else if(q)D=Ae.component.schema(Object.keys(Ke),L.category||"",Me,o==="edit",T()(ae,[...N,"uid"],null),V);else if(ie)D=Ae.customField.schema({schemaAttributes:T()(ae,[...N,"schema","attributes"],[]),attributeType:O.type,reservedNames:Me,schemaData:{modifiedData:L,initialData:re},ctbFormsAPI:V,customFieldValidator:O.options?.validator});else if(le&&be&&Ue)D=Ae.component.schema(Object.keys(Ke),T()(L,"componentToCreate.category",""),Me,V);else if(H&&!Ue){const me=i==="relation"?"relation":L.type;let k=[];if(me==="relation"){const _=T()(L,["target"],null);k=T()(ke,[_,"schema","attributes"],[]).filter(({name:se})=>o!=="edit"?!0:se!==re.targetAttribute)}D=Ae.attribute.schema(T()(ae,N,{}),me,Me,k,{modifiedData:L,initialData:re},V)}else if(Jn)D=Ae.editCategory.schema(W,re,V);else if(Ue&&be)D=Ae.component.schema(Object.keys(Ke),T()(L,"componentToCreate.category",""),Me,V);else return;await D.validate(ue,{abortEarly:!1})},ea=(0,a.useCallback)(({target:{name:D,value:ue,type:me,...k}})=>{const _=["enumName","max","min","maxLength","minLength","regex","default"];let pe;_.includes(D)&&ue===""?pe=null:pe=ue;const se=Object.assign({},Ee);D==="max"&&delete se.min,D==="maxLength"&&delete se.minLength,delete se[D],S({type:Q.Ey,errors:se}),S({type:Q.P0,keys:D.split("."),value:pe,...k})},[S,Ee]),ce=async(D,ue=de)=>{D.preventDefault();try{await po(),yo(ue);const me=f==="components"?A:un;if(F)if(de)$e({...L,kind:h},p,un),J({pathname:`/plugins/${w.Z}/content-types/${un}`}),n({forTarget:f,targetUid:me});else{us(ae,L)?(e(),an(L)):U({type:"warning",message:{id:"notification.contentType.relations.conflict"}});return}else if(p==="component")if(de){const k=(0,qe.N)(L.displayName,L.category),{category:_,...pe}=L;$e(pe,"component",k,_),J({pathname:`/plugins/${w.Z}/component-categories/${_}/${k}`}),n({forTarget:f,targetUid:k})}else{ln(L,p,A),e();return}else if(Jn){if(je()(re.name)===je()(L.name)){e();return}tn(re.name,L);return}else if(ie){const k={attributeToSet:{...L,customField:c},forTarget:f,targetUid:A,initialAttribute:re};o==="edit"?nn(k):Pe(k),ue?n({forTarget:f,targetUid:me}):e();return}else if(H&&!be){if(i==="dynamiczone"){K(L,f,A,o==="edit",re),de?(S({type:Q.I}),E.current._handlers.setSelectedTabIndex(0),s({dynamicZoneTarget:L.name})):e();return}if(!le){K(L,f,A,o==="edit",re),ue?n({forTarget:f,targetUid:me}):e();return}if(Ue){r(),S({type:Q.yC,forTarget:f});return}K(L,f,A,o==="edit",re,!0),ue?n({forTarget:f,targetUid:A}):e()}else if(H&&be){if(Ue){ne("willCreateComponentFromAttributesModal"),S({type:Q.oF,forTarget:f}),r();return}const{category:k,type:_,...pe}=Ge,se=(0,qe.N)(Ge.displayName,k);$e(pe,_,se,k,be),K(L,f,A,!1),S({type:Q.c2}),ue?n({forTarget:"components",targetUid:se}):e();return}else{if(Ue)if(be){const{category:k,type:_,...pe}=L.componentToCreate,se=(0,qe.N)(L.componentToCreate.displayName,k);$e(pe,_,se,k,be),te(g,[se]),n({forTarget:"components",targetUid:se})}else R(g,L.components),e();else console.error("This case is not handled");return}S({type:Q.c2})}catch(me){const k=(0,C.CJ)(me);console.log({err:me,errors:k}),S({type:Q.Ey,errors:k})}},go=()=>{window.confirm(I({id:"window.confirm.close-modal.file",defaultMessage:"Are you sure? Your changes will be lost."}))&&(e(),S({type:Q.c2}))},ta=()=>{gt()(L,re)?(e(),S({type:Q.c2})):go()},fo=D=>{if(D==="advanced"){if(F){ne("didSelectContentTypeSettings");return}f==="contentType"&&ne("didSelectContentTypeFieldSettings")}},yo=D=>{p==="attribute"&&f==="contentType"&&i!=="dynamiczone"&&D&&ne("willAddMoreFieldToContentType")},bo=()=>!!(p==="editCategory"||p==="component"||Je()(L,"createComponent")),ho=ds(f,A,sn);if(!Z||!p)return null;const na=T()(Ae,[p,"form"],{advanced:()=>({sections:[]}),base:()=>({sections:[]})}),vo=f==="components"||f==="component",aa={customInputs:{"allowed-types-select":da,"boolean-radio-group":Ia,"checkbox-with-number-field":Da,"content-type-radio-group":Pa,"radio-group":St,relation:Xa,"select-category":ts,"select-component":ns,"select-components":as,"select-default-boolean":Fa,"select-number":os,"select-date":ss,"toggle-draft-publish":Ra,"toggle-review-workflows":Za,"text-plural":Ja,"text-singular":rs,"textarea-enum":ls,...ye},componentToCreate:Ge,dynamicZoneTarget:g,formErrors:Ee,isAddingAComponentToAnotherComponent:vo,isCreatingComponentWhileAddingAField:xe,mainBoxHeader:T()(ae,[...N,"schema","displayName"],""),modifiedData:L,naturePickerType:f,isCreating:de,targetUid:A,forTarget:f},sa=na.advanced({data:L,type:i,step:v,actionType:o,attributes:dn,extensions:V,forTarget:f,contentTypeSchema:ae.contentType||{},customField:O}).sections,oa=na.base({data:L,type:i,step:v,actionType:o,attributes:dn,extensions:V,forTarget:f,contentTypeSchema:ae.contentType||{},customField:O}).sections,To=Fn(oa),Co=Fn(sa),Mo=Object.keys(Ee).some(D=>To.includes(D)),Eo=Object.keys(Ee).some(D=>Co.includes(D)),Ro=T()(ke,[A,"schema","kind"]),Zo=()=>o==="edit"&&dn.every(({name:D})=>D!==L?.name),Ao=()=>{Zo()&&ne("didEditFieldNameOnContentType")};return a.createElement(mt.P,{onClose:ta,labelledBy:"title"},a.createElement(Aa,{actionType:o,attributeName:l,categoryName:m,contentTypeKind:h,dynamicZoneTarget:g,modalType:p,forTarget:f,targetUid:A,attributeType:i,customFieldUid:c}),_n&&a.createElement(Ea,{attributes:ho,forTarget:f,kind:Ro||"collectionType"}),!_n&&a.createElement("form",{onSubmit:ce},a.createElement(we.f,null,a.createElement(ze.v,{label:"todo",id:"tabs",variant:"simple",ref:E,onTabChange:D=>{D===1&&fo("advanced")}},a.createElement($.k,{justifyContent:"space-between"},a.createElement(Na,{actionType:o,forTarget:f,kind:h,step:v,modalType:p,attributeType:i,attributeName:l,customField:O}),a.createElement(Oe.m,null,a.createElement(Oe.O,{hasError:Mo},I({id:(0,d.Z)("popUpForm.navContainer.base"),defaultMessage:"Basic settings"})),a.createElement(Oe.O,{hasError:Eo,disabled:bo()},I({id:(0,d.Z)("popUpForm.navContainer.advanced"),defaultMessage:"Advanced settings"})))),a.createElement(pt.i,null),a.createElement(j.x,{paddingTop:6},a.createElement(Le.n,null,a.createElement(Le.x,null,a.createElement($.k,{direction:"column",alignItems:"stretch",gap:6},a.createElement(Nn,{form:oa,formErrors:Ee,genericInputProps:aa,modifiedData:L,onChange:ea}))),a.createElement(Le.x,null,a.createElement($.k,{direction:"column",alignItems:"stretch",gap:6},a.createElement(Nn,{form:sa,formErrors:Ee,genericInputProps:aa,modifiedData:L,onChange:ea}))))))),a.createElement(ra.m,{endActions:a.createElement(xa,{deleteCategory:en,deleteContentType:ot,deleteComponent:ot,categoryName:re.name,isAttributeModal:p==="attribute",isCustomFieldModal:p==="customField",isComponentToDzModal:p==="addComponentToDynamicZone",isComponentAttribute:i==="component",isComponentModal:p==="component",isContentTypeModal:p==="contentType",isCreatingComponent:o==="create",isCreatingDz:o==="create",isCreatingComponentAttribute:L.createComponent||!1,isCreatingComponentInDz:L.createComponent||!1,isCreatingComponentWhileAddingAField:xe,isCreatingContentType:o==="create",isEditingAttribute:o==="edit",isDzAttribute:i==="dynamiczone",isEditingCategory:p==="editCategory",isInFirstComponentStep:v==="1",onSubmitAddComponentAttribute:ce,onSubmitAddComponentToDz:ce,onSubmitCreateComponent:ce,onSubmitCreateContentType:ce,onSubmitCreateDz:ce,onSubmitEditAttribute:ce,onSubmitEditCategory:ce,onSubmitEditComponent:ce,onSubmitEditContentType:ce,onSubmitEditCustomFieldAttribute:ce,onSubmitEditDz:ce,onClickFinish:Ao}),startActions:a.createElement(Y.z,{variant:"tertiary",onClick:ta},I({id:"app.components.Button.cancel",defaultMessage:"Cancel"}))})))},Un=e=>e.reduce((n,s)=>(n[s.uid]=s,n),{}),xs=(e,n,s,r)=>{const o=n.reduce((c,m)=>{const g=T()(s,m,{});return c[m]=g,c},{});return{[r?"contentType":"component"]:e,components:o}},Ss=(e,n)=>{const s=Object.keys(e).map(r=>T()(e,[r,...n],""));return(0,Re.Z)(s)},Ns=u(13339);const Fs=e=>{const n=Object.keys(e).reduce((s,r)=>{const o=e?.[r]?.schema?.attributes??[],l=Os(o);return[...s,...l]},[]);return(0,Re.Z)(n)},Os=e=>e.reduce((n,s)=>{const{type:r,component:o}=s;return r==="component"&&n.push(o),n},[]);var Wn=Fs;const Ls=e=>{const n=Object.keys(e).reduce((s,r)=>{const o=T()(e,[r],{}),l=o.uid;return Is(o)&&s.push(l),s},[]);return(0,Re.Z)(n)},Is=e=>T()(e,["schema","attributes"],[]).some(s=>{const{type:r}=s;return r==="component"});var qs=u(9086),Bn=u.n(qs),Ds=u(98978),Ps=u.n(Ds),ks=u(39935),$s=u.n(ks);const Us=(e,n)=>{const s=Object.keys(e).filter(r=>{const o=T()(e,r,{}),l=T()(n,r,{}),i=T()(o,["isTemporary"],!1),c=!gt()(o,l);return i||c});return(0,Re.Z)(s)},Ws=(e,n)=>{const s=wn(T()(e,"schema.attributes",[]),n),r=T()(e,"isTemporary",!1)?{tmpUID:e.uid}:{uid:e.uid};return Object.assign({},r,{category:e.category},Bn()(e.schema,"attributes"),{attributes:s})},jn=(e,n=!1)=>{const s=T()(e,"uid",null),r=wn(T()(e,"schema.attributes",[]),s),o=n?{category:T()(e,"category","")}:{},l=Object.assign(o,Bn()(e.schema,"attributes"),{attributes:r});return delete l.uid,delete l.isTemporary,delete l.visible,delete l.restrictRelationsTo,l},wn=(e,n)=>e.reduce((s,{name:r,...o})=>{const l=o,i=l.target===n,c=l.type==="relation",m=T()(l,"targetAttribute",null);if(!i)if(c){const g=Object.assign({},l,{targetAttribute:zn(m)});s[r]=st(g)}else s[r]=st(l);if(i){const g=l.target,f=Object.assign({},l,{target:g,targetAttribute:zn(m)});s[r]=st(f)}if(l.customField){const g={...l,type:"customField"};s[r]=st(g)}return s},{}),zn=e=>e==="-"?null:e,st=e=>Object.keys(e).reduce((n,s)=>(e[s]!==null&&s!=="plugin"&&(n[s]=e[s]),n),{}),Bs=(e,n,s,r=!1)=>Us(e,n).map(i=>{const c=T()(e,i,{});return Ws(c,s,r)}),js=e=>Ps()(Object.keys(e).map(n=>({visible:e[n].schema.visible,name:n,title:e[n].schema.displayName,plugin:e[n].plugin||null,uid:n,to:`/plugins/${w.Z}/content-types/${n}`,kind:e[n].schema.kind,restrictRelationsTo:e[n].schema.restrictRelationsTo})).filter(n=>n!==null),n=>$s()(n.title)),Vn="did-not-kill-server",ws="server is down";function Ve(e,n){return new Promise(s=>{fetch(`${window.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(ws);if(!n)throw new Error(Vn);s(e)}).catch(r=>{setTimeout(()=>Ve(e,r.message!==Vn).then(s),100)})})}var zs=e=>Object.values(e.attributes).filter(({type:s})=>s==="dynamiczone").every(({components:s})=>Array.isArray(s)&&s.length>0),ee=u(31947),Vs=u(54370);const Ks=()=>e=>e[`${w.Z}_dataManagerProvider`]||Vs.E;var Gs=()=>(0,$n.P1)(Ks(),e=>e);const Hs=e=>Object.keys(e).reduce((n,s)=>{const r=e[s].schema;return n[s]={...e[s],schema:{...r,attributes:Ys(r.attributes)}},n},{}),Ys=e=>Object.keys(e).reduce((n,s)=>(n.push({...e[s],name:s}),n),[]);var Kn=Hs;const _t=({children:e,components:n,contentTypes:s,isLoading:r,isLoadingForDataToBeSet:o,initialData:l,modifiedData:i,reservedNames:c})=>{const m=(0,ve.I0)(),g=(0,C.lm)(),{lockAppWithAutoreload:f,unlockAppWithAutoreload:p}=(0,C.Vu)(),{setCurrentStep:Z}=(0,C.c1)(),{getPlugin:h}=(0,C.j1)(),{apis:v}=h(w.Z),{autoReload:A}=(0,C.L7)(),{formatMessage:O}=(0,P.Z)(),{trackUsage:E}=(0,C.rS)(),{refetchPermissions:M}=(0,C.vn)(),{pathname:S}=(0,B.TH)(),{onCloseModal:U}=(0,Te.Z)(),z=(0,B.$B)(`/plugins/${w.Z}/content-types/:uid`),J=(0,B.$B)(`/plugins/${w.Z}/component-categories/:categoryUid/:componentUid`),ne=(0,C.kY)(),{put:I,post:ge,del:G}=ne,V=(0,a.useRef)();V.current=O;const ye=A,K=z!==null,Pe=K?"contentType":"component",te=K?T()(z,"params.uid",null):T()(J,"params.componentUid",null),W=(0,a.useRef)(),R=K?"content-types":"components";W.current=async()=>{try{const[{data:{data:N}},{data:{data:F}},{data:q}]=await Promise.all(["components","content-types","reserved-names"].map(be=>ne.get(`/${w.Z}/${be}`))),H=Un(N),ie=Kn(H),le=Un(F),de=Kn(le);m({type:ee.Id,components:ie,contentTypes:de,reservedNames:q})}catch(N){console.error({err:N}),g({type:"warning",message:{id:"notification.error"}})}},(0,a.useEffect)(()=>(W.current(),()=>{m({type:ee.Zl})}),[]),(0,a.useEffect)(()=>{!r&&te&&Me()},[r,S,te]),(0,a.useEffect)(()=>{A||g({type:"info",message:{id:(0,d.Z)("notification.info.autoreaload-disable")}})},[A,g]);const ke=(N,F,q,H=!1,ie,le=!1)=>{const de=H?ee.JO:ee.gz;m({type:de,attributeToSet:N,forTarget:F,targetUid:q,initialAttribute:ie,shouldAddComponentToData:le})},Ke=({attributeToSet:N,forTarget:F,targetUid:q,initialAttribute:H})=>{m({type:ee.Ir,attributeToSet:N,forTarget:F,targetUid:q,initialAttribute:H})},$e=({attributeToSet:N,forTarget:F,targetUid:q,initialAttribute:H})=>{m({type:ee.Ly,attributeToSet:N,forTarget:F,targetUid:q,initialAttribute:H})},en=(N,F)=>{m({type:ee.Uu,dynamicZoneTarget:N,componentsToAdd:F})},ot=(N,F,q,H,ie=!1)=>{const le=F==="contentType"?ee.Sh:ee.VR;m({type:le,data:N,componentCategory:H,schemaType:F,uid:q,shouldAddComponentToData:ie})},tn=(N,F)=>{m({type:ee.o_,dynamicZoneTarget:N,newComponents:F})},nn=(N,F,q="")=>{const H=N==="components"?ee.lw:ee.ai;N==="contentType"&&E("willDeleteFieldOfContentType"),m({type:H,mainDataKey:N,attributeToRemoveName:F,componentUid:q})},an=async N=>{try{const F=`/${w.Z}/component-categories/${N}`,q=window.confirm(O({id:(0,d.Z)("popUpWarning.bodyMessage.category.delete")}));U(),q&&(f(),await G(F),await Ve(!0),await p(),await xe())}catch(F){console.error({err:F}),g({type:"warning",message:{id:"notification.error"}})}finally{p()}},ae=async()=>{try{const N=`/${w.Z}/${R}/${te}`,F=T()(i,[Pe,"isTemporary"],!1),q=window.confirm(O({id:(0,d.Z)(`popUpWarning.bodyMessage.${K?"contentType":"component"}.delete`)}));if(U(),q){if(F){m({type:ee.Ap});return}f(),await G(N),await Ve(!0),await p(),await xe()}}catch(N){console.error({err:N}),g({type:"warning",message:{id:"notification.error"}})}finally{p()}},sn=async(N,F)=>{try{const q=`/${w.Z}/component-categories/${N}`;U(),f(),await I(q,F),await Ve(!0),await p(),await xe()}catch(q){console.error({err:q}),g({type:"warning",message:{id:"notification.error"}})}finally{p()}},on=()=>{const N=Object.assign({},n,i.components);if(!K){const q=T()(i,"component",{});Qe()(N,T()(q,["uid"],""),q)}const F=Ls(N);return(0,Re.Z)(F)},rn=()=>{const N=Wn(n),F=Wn(i.components||{});return(0,Re.Z)([...F,...N])},ln=(N,F)=>{m({type:ee.NG,dzName:N,componentToRemoveIndex:F})},Me=()=>{const N=K?s:n,F=T()(N,te,{schema:{attributes:[]}}),q=(0,Ns.Z)(F.schema.attributes,n),H=xs(F,q,n,K),ie=T()(F,"isTemporary",!1)&&dt()(T()(F,"schema.attributes",[]))===0;m({type:ee.xx,schemaToSet:H,hasJustCreatedSchema:ie})},Ge=(0,a.useMemo)(()=>{const N=K?s:n;return te==="create-content-type"?!1:!Object.keys(N).includes(te)&&!r},[n,s,te,K,r]),Ee=(0,a.useMemo)(()=>{const N=Object.keys(s).filter(F=>T()(s,[F,"schema","visible"],!0)).sort();return T()(N,"0","create-content-type")},[s]);if(Ge)return a.createElement(B.l_,{to:`/plugins/${w.Z}/content-types/${Ee}`});const re=async N=>{try{const F=T()(i,[Pe,"isTemporary"],!1),q={components:Bs(i.components,n,te,F)};if(K){const le=v.forms.mutateContentTypeSchema({...jn(i.contentType),...N},l.contentType);if(!zs(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}q.contentType=le,E("willSaveContentType")}else q.component=jn(i.component,!0),E("willSaveComponent");f();const H=`/${w.Z}/${R}`,ie=F?H:`${H}/${te}`;if(F?await ge(ie,q):await I(ie,q),await Ve(!0),await p(),F&&(l.contentType?.schema.kind==="collectionType"||l.contentType?.schema.kind==="singleType")&&Z("contentTypeBuilder.success"),K){E("didSaveContentType");const le=T()(q,["contentType","schema","name"],""),de=T()(l,["contentType","schema","name"],"");!F&&le!==de&&E("didEditNameOfContentType")}else E("didSaveComponent");await xe()}catch(F){K||E("didNotSaveComponent"),console.error({err:F.response}),g({type:"warning",message:{id:"notification.error"}})}finally{p()}},xe=async()=>{await M()},L=(N,F,q)=>{m({type:ee.bi,data:N,schemaType:F,uid:q})};return a.createElement(ct.Z.Provider,{value:{addAttribute:ke,addCustomFieldAttribute:Ke,addCreatedComponentToDynamicZone:en,allComponentsCategories:Ss(n,["category"]),changeDynamicZoneComponents:tn,components:n,componentsGroupedByCategory:We()(n,"category"),componentsThatHaveOtherComponentInTheirAttributes:on(),contentTypes:s,createSchema:ot,deleteCategory:an,deleteData:ae,editCategory:sn,editCustomFieldAttribute:$e,isInDevelopmentMode:ye,initialData:l,isInContentTypeView:K,modifiedData:i,nestedComponents:rn(),removeAttribute:nn,removeComponentFromDynamicZone:ln,reservedNames:c,setModifiedData:Me,sortedContentTypesList:js(s),submitData:re,updateSchema:L}},o?a.createElement(C.dO,null):a.createElement(a.Fragment,null,e,ye&&a.createElement(As,null)))};_t.defaultProps={components:{}},_t.propTypes={children:t().node.isRequired,components:t().object,contentTypes:t().object.isRequired,isLoading:t().bool.isRequired,isLoadingForDataToBeSet:t().bool.isRequired,initialData:t().object.isRequired,modifiedData:t().object.isRequired,reservedNames:t().object.isRequired};const Qs=Gs(),Xs=(0,ve.$j)(Qs,null);var Js=(0,Xe.compose)(Xs)((0,a.memo)(_t)),_s=u(51216);const Gn={actionType:null,attributeName:null,attributeType:null,categoryName:null,dynamicZoneTarget:null,forTarget:null,modalType:null,isOpen:!1,kind:null,step:null,targetUid:null,customFieldUid:null},Hn=({children:e})=>{const[n,s]=(0,a.useState)(Gn),{trackUsage:r}=(0,C.rS)(),o=({attributeType:E,customFieldUid:M})=>{s(S=>({...S,actionType:"create",modalType:"customField",attributeType:E,customFieldUid:M}))},l=({attributeType:E,step:M})=>{n.forTarget==="contentType"&&r("didSelectContentTypeFieldType",{type:E}),s(S=>({...S,actionType:"create",modalType:"attribute",step:M,attributeType:E}))},i=({dynamicZoneTarget:E,targetUid:M})=>{s(S=>({...S,dynamicZoneTarget:E,targetUid:M,modalType:"addComponentToDynamicZone",forTarget:"contentType",step:"1",actionType:"edit",isOpen:!0}))},c=({forTarget:E,targetUid:M})=>{s(S=>({...S,actionType:"create",forTarget:E,targetUid:M,modalType:"chooseAttribute",isOpen:!0}))},m=E=>{s(M=>({...M,...E,isOpen:!0}))},g=E=>{s(M=>({...M,categoryName:E,actionType:"edit",modalType:"editCategory",isOpen:!0}))},f=({forTarget:E,targetUid:M,attributeName:S,attributeType:U,customFieldUid:z})=>{s(J=>({...J,modalType:"customField",customFieldUid:z,actionType:"edit",forTarget:E,targetUid:M,attributeName:S,attributeType:U,isOpen:!0}))},p=({forTarget:E,targetUid:M,attributeName:S,attributeType:U,step:z})=>{s(J=>({...J,modalType:"attribute",actionType:"edit",forTarget:E,targetUid:M,attributeName:S,attributeType:U,step:z,isOpen:!0}))},Z=({modalType:E,forTarget:M,targetUid:S,kind:U})=>{s(z=>({...z,modalType:E,actionType:"edit",forTarget:M,targetUid:S,kind:U,isOpen:!0}))},h=()=>{s(Gn)},v=({forTarget:E,targetUid:M})=>{s(S=>({...S,forTarget:E,targetUid:M,modalType:"chooseAttribute"}))},A=()=>{s(E=>({...E,attributeType:"component",modalType:"attribute",step:"2"}))},O=({dynamicZoneTarget:E})=>{s(M=>({...M,dynamicZoneTarget:E,modalType:"addComponentToDynamicZone",actionType:"create",step:"1",attributeType:null,attributeName:null}))};return a.createElement(_s.Z.Provider,{value:{...n,onClickSelectField:l,onClickSelectCustomField:o,onCloseModal:h,onNavigateToChooseAttributeModal:v,onNavigateToAddCompoToDZModal:O,onOpenModalAddComponentsToDZ:i,onNavigateToCreateComponentStep2:A,onOpenModalAddField:c,onOpenModalCreateSchema:m,onOpenModalEditCategory:g,onOpenModalEditField:p,onOpenModalEditCustomField:f,onOpenModalEditSchema:Z,setFormModalNavigationState:s}},e)};Hn.propTypes={children:t().node.isRequired};var eo=Hn;const to=(0,a.lazy)(()=>u.e(5905).then(u.bind(u,69073)));var no=()=>{const{url:e}=(0,B.$B)(),{categoryUid:n}=(0,B.UO)();return a.createElement(a.Suspense,{fallback:a.createElement(C.dO,null)},a.createElement(B.rs,null,a.createElement(B.AW,{path:`${e}/:componentUid`},a.createElement(to,{categoryId:n}))))},Yn=u(14911),ao=u(7563),so=u(90700),oo=u(78090),ro=u(77013),io=u(79318),lo=u(28832),Qn=u(66618),uo=()=>{const{components:e,componentsGroupedByCategory:n,contentTypes:s,isInDevelopmentMode:r,sortedContentTypesList:o,modifiedData:l,initialData:i}=(0,Ze.Z)(),c=(0,C.lm)(),{trackUsage:m}=(0,C.rS)(),[g,f]=(0,a.useState)(""),{onOpenModalCreateSchema:p,onOpenModalEditCategory:Z}=(0,Te.Z)(),{locale:h}=(0,P.Z)(),{startsWith:v}=(0,C.L0)(h,{sensitivity:"base"}),A=(0,C.Xe)(h,{sensitivity:"base"}),O=!Object.keys(s).some(I=>s[I].isTemporary===!0)&&!Object.keys(e).some(I=>e[I].isTemporary===!0)&>()(l,i),E=()=>{O?(m("willCreateContentType"),p({modalType:"contentType",kind:"collectionType",actionType:"create",forTarget:"contentType"})):U()},M=()=>{O?(m("willCreateSingleType"),p({modalType:"contentType",kind:"singleType",actionType:"create",forTarget:"contentType"})):U()},S=()=>{O?(m("willCreateComponent"),p({modalType:"component",kind:null,actionType:"create",forTarget:"component"})):U()},U=()=>{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"}})},z=Object.entries(n).map(([I,ge])=>({name:I,title:I,isEditable:r,onClickEdit(G,V){G.stopPropagation(),O?Z(V.name):U()},links:ge.map(G=>({name:G.uid,to:`/plugins/${w.Z}/component-categories/${I}/${G.uid}`,title:G.schema.displayName})).sort((G,V)=>A.compare(G.title,V.title))})).sort((I,ge)=>A.compare(I.title,ge.title)),J=o.filter(I=>I.visible);return{menu:[{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:E},links:J.filter(I=>I.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:M},links:J.filter(I=>I.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:S},links:z}].map(I=>I.links.some(G=>Array.isArray(G.links))?{...I,links:I.links.map(G=>{const V=G.links.filter(ye=>v(ye.title,g));return V.length===0?null:{...G,links:V.sort((ye,K)=>A.compare(ye.title,K.title))}}).filter(Boolean)}:{...I,links:I.links.filter(G=>v(G.title,g)).sort((G,V)=>A.compare(G.title,V.title))}),searchValue:g,onSearchChange:f}},co=()=>{const{menu:e,searchValue:n,onSearchChange:s}=uo(),{formatMessage:r}=(0,P.Z)();return a.createElement(so.m,{ariaLabel:r({id:`${(0,d.Z)("plugin.name")}`,defaultMessage:"Content-Types Builder"})},a.createElement(oo.p,{searchable:!0,value:n,onClear:()=>s(""),onChange:o=>s(o.target.value),label:r({id:`${(0,d.Z)("plugin.name")}`,defaultMessage:"Content-Types Builder"}),searchLabel:r({id:"global.search",defaultMessage:"Search"})}),a.createElement(ro.Z,null,e.map(o=>a.createElement(a.Fragment,{key:o.name},a.createElement(io.D,{label:r({id:o.title.id,defaultMessage:o.title.defaultMessage}),collapsable:!0,badgeLabel:o.links.length.toString()},o.links.map(l=>l.links?a.createElement(lo.z,{key:l.name,label:Ce()(l.title)},l.links.map(i=>a.createElement(Qn.E,{as:Yn.OL,to:i.to,active:i.active,key:i.name,isSubSectionChild:!0},Ce()(r({id:i.name,defaultMessage:i.title}))))):a.createElement(Qn.E,{as:Yn.OL,to:l.to,active:l.active,key:l.name},Ce()(r({id:l.name,defaultMessage:l.title}))))),o.customLink&&a.createElement(j.x,{paddingLeft:7},a.createElement(ao.A,{onClick:o.customLink.onClick,startIcon:a.createElement(yn.J,{as:Ne.Z,width:(0,C.Q1)(8),height:(0,C.Q1)(8)}),marginTop:2},r({id:o.customLink.id,defaultMessage:o.customLink.defaultMessage})))))))};const Xn=(0,a.lazy)(()=>u.e(5905).then(u.bind(u,69073)));var mo=()=>{const{formatMessage:e}=(0,P.Z)(),n=e({id:`${w.Z}.plugin.name`,defaultMessage:"Content Types Builder"}),{startSection:s}=(0,C.c1)(),r=(0,a.useRef)(s);return(0,a.useEffect)(()=>{r.current&&r.current("contentTypeBuilder")},[]),a.createElement(C.O4,{permissions:rt.Z.main},a.createElement(he.q,{title:n}),a.createElement(eo,null,a.createElement(Js,null,a.createElement(Se.A,{sideNav:a.createElement(co,null)},a.createElement(a.Suspense,{fallback:a.createElement(C.dO,null)},a.createElement(B.rs,null,a.createElement(B.AW,{path:`/plugins/${w.Z}/content-types/create-content-type`,component:Xn}),a.createElement(B.AW,{path:`/plugins/${w.Z}/content-types/:uid`,component:Xn}),a.createElement(B.AW,{path:`/plugins/${w.Z}/component-categories/:categoryUid`,component:no})))))))}},92318:function(Fe,oe,u){var a=u(25158);const B=he=>`${a.Z}.${he}`;oe.Z=B}}]);
|
package/build/{email-settings-page.5bc22e5a.chunk.js → email-settings-page.dba83275.chunk.js}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[1495],{97744:function(b,m,t){t.r(m),t.d(m,{default:function(){return J}});var e=t(32735),
|
|
1
|
+
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[1495],{97744:function(b,m,t){t.r(m),t.d(m,{default:function(){return J}});var e=t(32735),d=t(67879),n=t(24989),p=t(94638),f=t(27649),v=t(17e3),E=t(87933),g=t(72850),h=t(49372),x=t(15335),M=t(5803),y=t(10369),P=t(41415),S=t(7961),a=t(60216),l=t.n(a),c=t(8471),o=t(68465),u=t(84967),i=t(85684);const A=c.ZP.a`
|
|
2
2
|
color: ${({theme:r})=>r.colors.primary600};
|
|
3
|
-
`,R=({config:r})=>{const{formatMessage:s}=(0,
|
|
3
|
+
`,R=({config:r})=>{const{formatMessage:s}=(0,d.Z)();return e.createElement(E.k,{direction:"column",alignItems:"stretch",gap:4},e.createElement(E.k,{direction:"column",alignItems:"stretch",gap:1},e.createElement(h.Z,{variant:"delta",as:"h2"},s({id:(0,i.Z)("Settings.email.plugin.title.config"),defaultMessage:"Configuration"})),e.createElement(h.Z,null,s({id:(0,i.Z)("Settings.email.plugin.text.configuration"),defaultMessage:"The plugin is configured through the {file} file, checkout this {link} for the documentation."},{file:"./config/plugins.js",link:e.createElement(A,{href:"https://docs.strapi.io/developer-docs/latest/plugins/email.html",target:"_blank",rel:"noopener noreferrer"},s({id:(0,i.Z)("link"),defaultMessage:"Link"}))}))),e.createElement(x.r,{gap:5},e.createElement(M.P,{col:6,s:12},e.createElement(y.o,{name:"shipper-email",label:s({id:(0,i.Z)("Settings.email.plugin.label.defaultFrom"),defaultMessage:"Default sender email"}),placeholder:s({id:(0,i.Z)("Settings.email.plugin.placeholder.defaultFrom"),defaultMessage:"ex: Strapi No-Reply '<'no-reply@strapi.io'>'"}),disabled:!0,onChange:()=>{},value:r.settings.defaultFrom})),e.createElement(M.P,{col:6,s:12},e.createElement(y.o,{name:"response-email",label:s({id:(0,i.Z)("Settings.email.plugin.label.defaultReplyTo"),defaultMessage:"Default response email"}),placeholder:s({id:(0,i.Z)("Settings.email.plugin.placeholder.defaultReplyTo"),defaultMessage:"ex: Strapi '<'example@strapi.io'>'"}),disabled:!0,onChange:()=>{},value:r.settings.defaultReplyTo})),e.createElement(M.P,{col:6,s:12},e.createElement(o.P,{name:"email-provider",label:s({id:(0,i.Z)("Settings.email.plugin.label.provider"),defaultMessage:"Email provider"}),disabled:!0,onChange:()=>{},value:r.provider},e.createElement(u.W,{value:r.provider},r.provider)))))};R.propTypes={config:l().shape({provider:l().string,settings:l().shape({defaultFrom:l().string,defaultReplyTo:l().string})}).isRequired};var B=R,j=t(24346),D=j.Ry().shape({email:j.Z_().email(n.I0.email).required(n.I0.required)}),z=t(59990);const V=async()=>{const{get:r}=(0,n.tg)(),{data:s}=await r("/email/settings");return s.config},N=async r=>{const{post:s}=(0,n.tg)();await s("/email/test",r)};var $=t(82055),I=()=>{const{formatMessage:r}=(0,d.Z)();return e.createElement(e.Fragment,null,e.createElement(n.SL,{name:r({id:(0,i.Z)("Settings.email.plugin.title"),defaultMessage:"Configuration"})}),e.createElement($.T,{id:"title",title:r({id:(0,i.Z)("Settings.email.plugin.title"),defaultMessage:"Configuration"}),subtitle:r({id:(0,i.Z)("Settings.email.plugin.subTitle"),defaultMessage:"Test the settings for the Email plugin"})}))};const w=()=>e.createElement(n.O4,{permissions:z.Z.settings},e.createElement(G,null)),G=()=>{const r=(0,n.lm)(),{formatMessage:s}=(0,d.Z)(),{lockApp:k,unlockApp:Q}=(0,n.o1)(),{notifyStatus:O}=(0,p.G)();(0,n.go)();const[C,X]=(0,e.useState)({}),[Y,F]=(0,e.useState)(!1),[H,W]=(0,e.useState)(!1),[T,K]=(0,e.useState)(""),[q,U]=(0,e.useState)(!1),[_,ee]=(0,e.useState)({provider:"",settings:{defaultFrom:"",defaultReplyTo:"",testAddress:""}});(0,e.useEffect)(()=>{F(!0),V().then(Z=>{O(s({id:(0,i.Z)("Settings.email.plugin.notification.data.loaded"),defaultMessage:"Email settings data has been loaded"})),ee(Z);const L=Z?.settings?.testAddress;L&&K(L)}).catch(()=>r({type:"warning",message:s({id:(0,i.Z)("Settings.email.plugin.notification.config.error"),defaultMessage:"Failed to retrieve the email config"})})).finally(()=>F(!1))},[s,r,O]),(0,e.useEffect)(()=>{C.email&&document.querySelector("#test-address-input").focus()},[C]),(0,e.useEffect)(()=>{D.validate({email:T},{abortEarly:!1}).then(()=>U(!0)).catch(()=>U(!1))},[T]);const te=Z=>{K(()=>Z.target.value)},ne=async Z=>{Z.preventDefault();try{await D.validate({email:T},{abortEarly:!1}),W(!0),k(),N({to:T}).then(()=>{r({type:"success",message:s({id:(0,i.Z)("Settings.email.plugin.notification.test.success"),defaultMessage:"Email test succeeded, check the {to} mailbox"},{to:T})})}).catch(()=>{r({type:"warning",message:s({id:(0,i.Z)("Settings.email.plugin.notification.test.error"),defaultMessage:"Failed to send a test mail to {to}"},{to:T})})}).finally(()=>{W(!1),Q()})}catch(L){X((0,n.CJ)(L))}};return Y?e.createElement(f.o,{labelledBy:"title","aria-busy":"true"},e.createElement(I,null),e.createElement(v.D,null,e.createElement(n.dO,null))):e.createElement(f.o,{labelledBy:"title","aria-busy":H},e.createElement(I,null),e.createElement(v.D,null,e.createElement("form",{onSubmit:ne},e.createElement(E.k,{direction:"column",alignItems:"stretch",gap:7},e.createElement(g.x,{background:"neutral0",hasRadius:!0,shadow:"filterShadow",paddingTop:6,paddingBottom:6,paddingLeft:7,paddingRight:7},e.createElement(B,{config:_})),e.createElement(g.x,{background:"neutral0",hasRadius:!0,shadow:"filterShadow",paddingTop:6,paddingBottom:6,paddingLeft:7,paddingRight:7},e.createElement(E.k,{direction:"column",alignItems:"stretch",gap:4},e.createElement(h.Z,{variant:"delta",as:"h2"},s({id:(0,i.Z)("Settings.email.plugin.title.test"),defaultMessage:"Test email delivery"})),e.createElement(x.r,{gap:5,alignItems:"end"},e.createElement(M.P,{col:6,s:12},e.createElement(y.o,{id:"test-address-input",name:"test-address",onChange:te,label:s({id:(0,i.Z)("Settings.email.plugin.label.testAddress"),defaultMessage:"Recipient email"}),value:T,error:C.email?.id&&s({id:(0,i.Z)(`${C.email?.id}`),defaultMessage:"This is an invalid email"}),placeholder:s({id:(0,i.Z)("Settings.email.plugin.placeholder.testAddress"),defaultMessage:"ex: developer@example.com"})})),e.createElement(M.P,{col:7,s:12},e.createElement(P.z,{loading:H,disabled:!q,type:"submit",startIcon:e.createElement(S.Z,null)},s({id:(0,i.Z)("Settings.email.plugin.button.test-email"),defaultMessage:"Send test email"}))))))))))};var J=w},17e3:function(b,m,t){t.d(m,{D:function(){return f}});var e=t(74512),d=t(32735),n=t(60216),p=t(72850);const f=({children:v})=>(0,e.jsx)(p.x,{paddingLeft:10,paddingRight:10,children:v});f.propTypes={children:n.node.isRequired}},82055:function(b,m,t){t.d(m,{T:function(){return y}});var e=t(74512),d=t(32735),n=t(60216),p=t(8471);const f=a=>{const l=(0,d.useRef)(null),[c,o]=(0,d.useState)(!0),u=([i])=>{o(i.isIntersecting)};return(0,d.useEffect)(()=>{const i=l.current,A=new IntersectionObserver(u,a);return i&&A.observe(l.current),()=>{i&&A.disconnect()}},[l,a]),[l,c]};var v=t(63060);const E=(a,l)=>{const c=(0,v.W)(l);(0,d.useLayoutEffect)(()=>{const o=new ResizeObserver(c);return Array.isArray(a)?a.forEach(u=>{u.current&&o.observe(u.current)}):a.current&&o.observe(a.current),()=>{o.disconnect()}},[a,c])};var g=t(72850),h=t(87933),x=t(49372);const M=()=>{const a=(0,d.useRef)(null),[l,c]=(0,d.useState)(null),[o,u]=f({root:null,rootMargin:"0px",threshold:0});return E(o,()=>{o.current&&c(o.current.getBoundingClientRect())}),(0,d.useEffect)(()=>{a.current&&c(a.current.getBoundingClientRect())},[a]),{containerRef:o,isVisible:u,baseHeaderLayoutRef:a,headerSize:l}},y=a=>{const{containerRef:l,isVisible:c,baseHeaderLayoutRef:o,headerSize:u}=M();return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{style:{height:u?.height},ref:l,children:c&&(0,e.jsx)(S,{ref:o,...a})}),!c&&(0,e.jsx)(S,{...a,sticky:!0,width:u?.width})]})};y.displayName="HeaderLayout";const P=(0,p.ZP)(g.x)`
|
|
4
4
|
width: ${a=>a.width}px;
|
|
5
5
|
z-index: ${({theme:a})=>a.zIndices[1]};
|
|
6
|
-
`,S=
|
|
6
|
+
`,S=d.forwardRef(({navigationAction:a,primaryAction:l,secondaryAction:c,subtitle:o,title:u,sticky:i,width:A,...R},B)=>{const j=typeof o=="string";return i?(0,e.jsx)(P,{paddingLeft:6,paddingRight:6,paddingTop:3,paddingBottom:3,position:"fixed",top:0,right:0,background:"neutral0",shadow:"tableShadow",width:A,"data-strapi-header-sticky":!0,children:(0,e.jsxs)(h.k,{justifyContent:"space-between",children:[(0,e.jsxs)(h.k,{children:[a&&(0,e.jsx)(g.x,{paddingRight:3,children:a}),(0,e.jsxs)(g.x,{children:[(0,e.jsx)(x.Z,{variant:"beta",as:"h1",...R,children:u}),j?(0,e.jsx)(x.Z,{variant:"pi",textColor:"neutral600",children:o}):o]}),c?(0,e.jsx)(g.x,{paddingLeft:4,children:c}):null]}),(0,e.jsx)(h.k,{children:l?(0,e.jsx)(g.x,{paddingLeft:2,children:l}):void 0})]})}):(0,e.jsxs)(g.x,{ref:B,paddingLeft:10,paddingRight:10,paddingBottom:8,paddingTop:a?6:8,background:"neutral100","data-strapi-header":!0,children:[a?(0,e.jsx)(g.x,{paddingBottom:2,children:a}):null,(0,e.jsxs)(h.k,{justifyContent:"space-between",children:[(0,e.jsxs)(h.k,{minWidth:0,children:[(0,e.jsx)(x.Z,{as:"h1",variant:"alpha",...R,children:u}),c?(0,e.jsx)(g.x,{paddingLeft:4,children:c}):null]}),l]}),j?(0,e.jsx)(x.Z,{variant:"epsilon",textColor:"neutral600",as:"p",children:o}):o]})});S.displayName="BaseHeaderLayout",S.defaultProps={navigationAction:void 0,primaryAction:void 0,secondaryAction:void 0,subtitle:void 0,sticky:!1,width:void 0},S.propTypes={navigationAction:n.node,primaryAction:n.node,secondaryAction:n.node,sticky:n.bool,subtitle:n.oneOfType([n.string,n.node]),title:n.string.isRequired,width:n.number},y.defaultProps={navigationAction:void 0,primaryAction:void 0,secondaryAction:void 0,subtitle:void 0},y.propTypes={navigationAction:n.node,primaryAction:n.node,secondaryAction:n.node,subtitle:n.oneOfType([n.string,n.node]),title:n.string.isRequired}},27649:function(b,m,t){t.d(m,{o:function(){return f}});var e=t(74512),d=t(8471),n=t(72850);const p=(0,d.ZP)(n.x)`
|
|
7
7
|
// To prevent global outline on focus visible to force an outline when Main is focused
|
|
8
8
|
&:focus-visible {
|
|
9
9
|
outline: none;
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`,f=({labelledBy:v="main-content-title",...E})=>(0,e.jsx)(p,{"aria-labelledby":v,as:"main",id:"main-content",tabIndex:-1,...E})},7961:function(b,m,t){t.d(m,{Z:function(){return n}});var e=t(74512);const d=p=>(0,e.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",fill:"none",viewBox:"0 0 24 24",...p,children:[(0,e.jsx)("path",{fill:"#32324D",d:"M0 2.8A.8.8 0 0 1 .8 2h22.4a.8.8 0 0 1 .8.8v2.71a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V2.8Z"}),(0,e.jsx)("path",{fill:"#32324D",d:"M1.922 7.991C.197 6.675 0 6.252 0 5.289h23.953c.305 1.363-1.594 2.506-2.297 3.125-1.953 1.363-6.253 4.36-7.828 5.45-1.575 1.09-3.031.455-3.562 0-2.063-1.41-6.62-4.557-8.344-5.873ZM22.8 18H1.2c-.663 0-1.2.471-1.2 1.053v1.894C0 21.529.537 22 1.2 22h21.6c.663 0 1.2-.471 1.2-1.053v-1.894c0-.582-.537-1.053-1.2-1.053Z"}),(0,e.jsx)("path",{fill:"#32324D",d:"M0 9.555v10.972h24V9.554c-2.633 1.95-8.367 6.113-9.96 7.166-1.595 1.052-3.352.438-4.032 0L0 9.555Z"})]}),n=d}}]);
|