From bc906ce4d6f5fcf3553a0807e194502a12134138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gu=CC=88nther?= Date: Tue, 29 Oct 2024 10:39:52 +0100 Subject: [PATCH] TASK: Improve german translation --- Resources/Private/Translations/de/Main.xlf | 4 ++-- Resources/Public/AssetEditor/Plugin.js | 2 +- Resources/Public/Assets/main.bundle.js | 16 ++++++++-------- Resources/Public/Assets/main.bundle.js.map | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Resources/Private/Translations/de/Main.xlf b/Resources/Private/Translations/de/Main.xlf index 2a4ba96d0..c9e0362b5 100644 --- a/Resources/Private/Translations/de/Main.xlf +++ b/Resources/Private/Translations/de/Main.xlf @@ -341,11 +341,11 @@ Please provide a tag label - Bitte geben Sie ein Tag-Title an + Bitte geben Sie einen Tag-Namen ein This tag is already exists. Please choose a different one. - Dieses Tag existiert bereits. Bitte wählen Sie eine andere aus. + Dieser Tag existiert bereits. Bitte wählen Sie einen anderen aus. Tag was created diff --git a/Resources/Public/AssetEditor/Plugin.js b/Resources/Public/AssetEditor/Plugin.js index a9730001a..20467829e 100644 --- a/Resources/Public/AssetEditor/Plugin.js +++ b/Resources/Public/AssetEditor/Plugin.js @@ -415,7 +415,7 @@ var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Arr } } ${w} -`;var T=n(46),A=n.n(T);var j=({presetIdentifier:e,variantName:t,width:n,height:r,previewUrl:a})=>o.a.createElement("div",{className:A.a.variantContainer},o.a.createElement("picture",{className:A.a.picture},o.a.createElement("img",{className:A.a.image,src:a,alt:t})),o.a.createElement("figcaption",{className:A.a.caption},o.a.createElement("div",{className:A.a.infoContainer},e?o.a.createElement("span",{className:A.a.info},"Preset: ",e):null,t?o.a.createElement("span",{className:A.a.info},"Variant: ",t):null,o.a.createElement("span",{className:A.a.variantSizes},"W: ",n," H: ",r)))),k=n(117),I=n.n(k);var N=()=>{var e,t;const{translate:n}=Object(s.d)(),r=Object(S.i)(),a=function(e){const{data:t,loading:n,refetch:r}=Object(E.useQuery)(C,{variables:{id:null==e?void 0:e.assetId,assetSourceId:null==e?void 0:e.assetSourceId},skip:!e});return{variants:(null==t?void 0:t.assetVariants)||null,loading:n,refetch:r}}(r?{assetId:r.id,assetSourceId:r.assetSource.id}:null);return r?o.a.createElement("div",{className:I.a.variantsContainer},a.loading?o.a.createElement("div",null,n("assetVariants.loadingVariants","Loading Variants…")):o.a.createElement(o.a.Fragment,null,o.a.createElement("h1",null,n("assetVariants.title","Image Variants")),o.a.createElement("ul",null,(null===(e=a.variants)||void 0===e?void 0:e.length)>0?null===(t=a.variants)||void 0===t?void 0:t.map(e=>o.a.createElement("li",{className:I.a.variantItem,key:"variant-"+e.id},o.a.createElement(j,{...e}))):o.a.createElement("li",null,n("assetVariants.noVariantsFound","No variants found"))))):null},x=n(19),R=n(56),D=n(54),M=n(84),L=n(66),P=n(103),F=n(118),B=n.n(F);var U=o.a.memo(()=>{const{translate:e}=Object(s.d)(),t=Object(S.i)(),n=Object(a.g)(l.a),{showSimilarAssets:r}=Object(a.g)(l.f);return t?o.a.createElement("div",{className:B.a.tasks},o.a.createElement(i.Headline,{type:"h2"},o.a.createElement(b.d,{icon:"tasks",label:e("inspector.actions","Tasks")})),o.a.createElement("div",{className:B.a.buttonWrapper},o.a.createElement(x.b,null),r&&o.a.createElement(R.b,null),o.a.createElement(L.a,{asset:t,style:"lighter"}),!t.assetSource.readOnly&&"details"!==n&&o.a.createElement(o.a.Fragment,null,o.a.createElement(M.b,null),o.a.createElement(D.a,null)),o.a.createElement(P.a,{asset:t,style:"lighter"}))):null}),V=n(71),q=n.n(V),z=n(23);var Q=o.a.memo(()=>{const e=Object(S.i)(),{assetSources:t}=Object(z.e)(),n=Object(s.f)(),{translate:c}=Object(s.d)(),{approvalAttainmentStrategy:{obtainApprovalToUpdateAsset:u}}=Object(s.e)(),d=Object(a.g)(l.f),[h,m]=Object(r.useState)(null),[y,g]=Object(r.useState)(null),[_,O]=Object(r.useState)(null),[E,w]=Object(r.useState)(d.propertyEditor.collapsed),{updateAsset:C,loading:T}=Object(S.l)(),A=(null==e?void 0:e.localId)&&!T,j=e&&(h!==e.label||y!==e.caption||_!==e.copyrightNotice),k=e?t.find(({id:t})=>t===e.assetSource.id):null,I=Object(r.useCallback)(()=>{e&&(m(e.label),g(e.caption),O(e.copyrightNotice))},[e,m,g,O]),N=Object(r.useCallback)(async()=>{if(h!==e.label||y!==e.caption||_!==e.copyrightNotice){if(await u({asset:e}))try{await C({asset:e,label:h,caption:y,copyrightNotice:_}),n.ok(c("actions.updateAsset.success","The asset has been updated"))}catch({message:e}){n.error(c("actions.deleteAsset.error","Error while updating the asset"),e)}}},[n,c,y,_,h,e,C,u]);return Object(r.useEffect)(()=>{I()},[null==e?void 0:e.id]),e?o.a.createElement(v,null,o.a.createElement(i.ToggablePanel,{closesToBottom:!0,className:q.a.propertyPanel,isOpen:!E,onPanelToggle:()=>w(e=>!e)},o.a.createElement(i.ToggablePanel.Header,{className:q.a.propertyPanelHeader},o.a.createElement(b.d,{icon:"pencil",label:c("propertyPanel.header","Properties")})),o.a.createElement(i.ToggablePanel.Contents,{className:q.a.propertyPanelContents},o.a.createElement(p,{label:c("inspector.title","Title")},o.a.createElement(i.TextInput,{name:"label",disabled:!A,type:"text",value:h||"",onChange:m,onEnterKey:N})),o.a.createElement(p,{label:c("inspector.caption","Caption")},o.a.createElement(i.TextArea,{name:"caption",className:q.a.textArea,disabled:!A,minRows:3,expandedRows:6,value:y||"",onChange:g})),o.a.createElement(p,{label:c("inspector.copyrightNotice","Copyright notice")},o.a.createElement(i.TextArea,{name:"copyrightNotice",className:q.a.textArea,disabled:!A,minRows:2,expandedRows:4,value:_||"",onChange:O})),A&&o.a.createElement(f,{handleApply:N,handleDiscard:I,hasUnpublishedChanges:j,inputValid:!!h}))),(null==k?void 0:k.supportsCollections)&&o.a.createElement(G,null),(null==k?void 0:k.supportsTagging)&&o.a.createElement(ae,null),o.a.createElement(U,null),o.a.createElement(ee,null)):null}),$=n(170),W=n.n($);var H=o.a.memo(()=>{const e=Object(a.g)(l.l),{showVariantsEditor:t}=Object(a.g)(l.f),n=Object(a.g)(l.n);return e&&"asset"===n?t?o.a.createElement(i.Tabs,{theme:{tabs__content:W.a.tabContent}},o.a.createElement(i.Tabs.Panel,{icon:"info-circle",key:"editor",id:"editor"},o.a.createElement(Q,null)),o.a.createElement(i.Tabs.Panel,{icon:"images"},o.a.createElement(N,null))):o.a.createElement(Q,null):null}),K=n(119);var G=o.a.memo(()=>{const e=Object(s.f)(),{translate:t}=Object(s.d)(),{approvalAttainmentStrategy:{obtainApprovalToSetAssetCollections:n}}=Object(s.e)(),{assetCollections:u}=Object(c.g)(),{setAssetCollections:d,loading:f}=Object(S.j)(),p=Object(S.i)(),{limitToSingleAssetCollectionPerAsset:h}=Object(a.g)(l.f),[m,v]=Object(r.useState)(""),g=Object(r.useMemo)(()=>u.map(e=>({label:e.title,id:e.id,secondaryLabel:e.parent?"/"+Object(c.d)(e,u).map(({title:e})=>e).join("/"):""})),[u]),_=Object(r.useMemo)(()=>g.filter(({label:e})=>e.toLowerCase().includes(m)),[g,m]),[O,E]=Object(r.useState)([]),w=Object(r.useCallback)(()=>E((null==p?void 0:p.collections.map(({id:e})=>e))||[]),[null==p?void 0:p.collections]),C=Object(r.useCallback)(async r=>{if(null===r?r=[]:"string"==typeof r&&(r=[r]),o=p,r.join(",")!==o.collections.map(e=>e.id).join(",")){const o=p,a=u.filter(e=>r.includes(e.id));if(await n({asset:o,newAssetCollections:a}))try{await d({asset:o,assetCollections:a}),e.ok(t("actions.setAssetCollections.success","The collections for the asset have been set"))}catch({message:n}){e.error(t("actions.setAssetCollections.error","Error while setting the collections for the asset"),n)}else w()}var o},[e,p,d,u,t,w,n]),T=Object(r.useCallback)(e=>{v(e.toLowerCase())},[]);return Object(r.useEffect)(w,[w]),p?o.a.createElement("div",{className:"collectionSelectBox"},h?o.a.createElement(o.a.Fragment,null,o.a.createElement(i.Headline,{type:"h2"},o.a.createElement(b.d,{icon:"folder",label:t("inspector.assetCollection","Collection")})),o.a.createElement(i.SelectBox,{className:K.collectionSelectBox,disabled:f||p.assetSource.readOnly,placeholder:t("inspector.collections.placeholder","Select a collection"),value:O.length?O[0]:null,optionValueField:"id",options:_,noMatchesFoundLabel:t("general.noMatchesFound","No matches found"),onValueChange:C,onSearchTermChange:T,ListPreviewElement:y,displaySearchBox:!0,allowEmpty:!0,threshold:0})):o.a.createElement(o.a.Fragment,null,o.a.createElement(i.Headline,{type:"h2"},o.a.createElement(b.d,{icon:"folder",label:t("inspector.assetCollections","Collections")})),o.a.createElement(i.MultiSelectBox,{className:K.collectionSelectBox,disabled:f||p.assetSource.readOnly,placeholder:t("inspector.collections.placeholder","Select a collection"),values:O,optionValueField:"id",options:g,searchOptions:_,noMatchesFoundLabel:t("general.noMatchesFound","No matches found"),onValuesChange:C,onSearchTermChange:T,ListPreviewElement:y,displaySearchBox:!0,allowEmpty:!0,threshold:0}))):null}),Y=n(171),X=n.n(Y);var J=o.a.memo(()=>{var e;const t=Object(S.i)(),{translate:n}=Object(s.d)();return(null===(e=null==t?void 0:t.iptcProperties)||void 0===e?void 0:e.length)?o.a.createElement("div",{className:X.a.iptcData},o.a.createElement(i.Headline,{type:"h2"},o.a.createElement(b.d,{icon:"camera",label:n("inspector.iptcMetadata","IPTC Metadata")})),o.a.createElement(b.f,null,t.iptcProperties.map(e=>o.a.createElement(b.g,{key:e.propertyName,label:e.propertyName,value:e.value})))):null}),Z=n(52);var ee=r.memo(()=>{const{translate:e}=Object(s.d)(),t=Object(S.i)();return t?r.createElement("div",null,r.createElement(i.Headline,{type:"h2"},r.createElement(b.d,{icon:"info-circle",label:e("inspector.metadata","Metadata")})),r.createElement(b.f,null,r.createElement(b.g,{label:e("inspector.property.dimensions","Dimensions"),value:`${t.width}px x ${t.height}px`}),t.file.size>0&&r.createElement(b.g,{label:e("inspector.property.fileSize","Size"),value:Object(Z.a)(t.file.size)}),r.createElement(b.g,{label:e("inspector.property.filename","Filename"),value:t.filename}),r.createElement(b.g,{label:e("inspector.property.lastModified","Last modified"),value:new Date(t.lastModified).toLocaleString()}),r.createElement(b.g,{label:e("inspector.property.mediaType","MIME type"),value:t.file.mediaType}))):null}),te=n(14);var ne=r.memo(()=>{const e=Object(te.f)(),t=Object(a.g)(l.n),n=Object(s.f)(),{translate:o}=Object(s.d)(),[c,u]=Object(r.useState)(null),{updateTag:d}=Object(te.h)(),h=e&&c!==e.label,m=Object(r.useCallback)(()=>{e&&u(e.label)},[e,u]),b=Object(r.useCallback)(()=>{c!==e.label&&d({tag:e,label:c}).then(()=>{n.ok(o("actions.updateTag.success","The tag has been updated"))}).catch(({message:e})=>{n.error(o("actions.updateTag.error","Error while updating the tag"),e)})},[n,o,e,d,c]);return Object(r.useEffect)(()=>{m()},[null==e?void 0:e.id]),e&&"tag"===t?r.createElement(v,null,r.createElement(p,{label:o("inspector.label","Label")},r.createElement(i.TextInput,{type:"text",value:c||"",onChange:u,onEnterKey:b})),r.createElement(f,{handleApply:b,handleDiscard:m,hasUnpublishedChanges:h})):null}),re=n(172);var oe=o.a.memo(({values:e,options:t,onChange:n,disabled:a=!1})=>{const{translate:l}=Object(s.d)(),[c,u]=Object(r.useState)(""),d=Object(r.useMemo)(()=>t.filter(({label:e})=>e.toLowerCase().includes(c.toLowerCase())),[t,c]),f=Object(r.useCallback)(e=>{u(e)},[]);return o.a.createElement("div",{className:"tagSelectBoxWrapper"},o.a.createElement(i.Headline,{type:"h2"},o.a.createElement(b.d,{icon:"tags",label:l("inspector.tags","Tags")})),o.a.createElement(i.MultiSelectBox,{className:re.tagSelectBox,disabled:a,placeholder:l("inspector.tags.placeholder","Select a tag"),noMatchesFoundLabel:l("general.noMatchesFound","No matches found"),values:e,optionValueField:"id",options:t,searchOptions:d,onValuesChange:e=>n(e.map(e=>t.find(t=>t.id===e))),searchTerm:c,onSearchTermChange:f,displaySearchBox:!0,allowEmpty:!0,threshold:0}))});var ae=o.a.memo(()=>{const e=Object(s.f)(),{translate:t}=Object(s.d)(),{approvalAttainmentStrategy:{obtainApprovalToSetAssetTags:n}}=Object(s.e)(),{tags:a}=Object(te.g)(),{setAssetTags:i,loading:l}=Object(S.k)(),c=Object(S.i)(),[u,d]=Object(r.useState)([]),f=Object(r.useCallback)(()=>d(null==c?void 0:c.tags.map(({id:e})=>e).sort()),[null==c?void 0:c.tags]),p=Object(r.useCallback)(async r=>{if(o=c,r.map(e=>e.id).sort().join(",")!==o.tags.map(e=>e.id).sort().join(",")){if(await n({asset:c,newTags:r}))try{await i({asset:c,tags:r}),e.ok(t("actions.setAssetTags.success","The asset has been tagged"))}catch({message:n}){e.error(t("actions.setAssetTags.error","Error while tagging the asset"),n)}else f()}var o},[e,c,i,t,f,n]);return Object(r.useEffect)(()=>f(),[f]),c?o.a.createElement(oe,{values:u,options:a,onChange:p,disabled:l||c.assetSource.readOnly}):null});var ie=o.a.memo(()=>{const e=Object(s.f)(),{translate:t}=Object(s.d)(),{tags:n}=Object(te.g)(),{updateAssetCollection:a}=Object(c.j)(),i=Object(c.h)(),l=Object(r.useMemo)(()=>null==i?void 0:i.tags.map(({id:e})=>e).sort(),[null==i?void 0:i.tags]),u=Object(r.useCallback)(n=>{var r;r=i,n.map(e=>e.id).sort().join(",")!==r.tags.map(e=>e.id).sort().join(",")&&a({assetCollection:i,tags:n}).then(()=>{e.ok(t("actions.tagAssetCollection.success","The asset collection has been tagged"))}).catch(({message:n})=>{e.error(t("actions.tagAssetCollection.error","Error while tagging the asset collection"),n)})},[e,i,a,t]);return i?o.a.createElement(oe,{values:l,options:n,onChange:u}):null})},function(e,t,n){e.exports={thumb:"FilePreview-module__thumb___3Pr8a",thumbInner:"FilePreview-module__thumbInner___IvQdB",img:"FilePreview-module__img___8ejzf",loading:"FilePreview-module__loading___1237G",success:"FilePreview-module__success___3O3RF",error:"FilePreview-module__error___2Vwak",warning:"FilePreview-module__warning___3LWQm"}},function(e,t,n){e.exports={uploadArea:"ReplaceAssetDialog-module__uploadArea___1jzR5",optionSection:"ReplaceAssetDialog-module__optionSection___1SaG0",option:"ReplaceAssetDialog-module__option___2K8FB",label:"ReplaceAssetDialog-module__label___huLhV"}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e,t,n,r,o){this.message=e,this.path=t,this.query=n,this.clientOnly=r,this.variables=o}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(5),o=n(50);const a=r.gql` +`;var T=n(46),A=n.n(T);var j=({presetIdentifier:e,variantName:t,width:n,height:r,previewUrl:a})=>o.a.createElement("div",{className:A.a.variantContainer},o.a.createElement("picture",{className:A.a.picture},o.a.createElement("img",{className:A.a.image,src:a,alt:t})),o.a.createElement("figcaption",{className:A.a.caption},o.a.createElement("div",{className:A.a.infoContainer},e?o.a.createElement("span",{className:A.a.info},"Preset: ",e):null,t?o.a.createElement("span",{className:A.a.info},"Variant: ",t):null,o.a.createElement("span",{className:A.a.variantSizes},"W: ",n," H: ",r)))),k=n(117),I=n.n(k);var N=()=>{var e,t;const{translate:n}=Object(s.d)(),r=Object(S.i)(),a=function(e){const{data:t,loading:n,refetch:r}=Object(E.useQuery)(C,{variables:{id:null==e?void 0:e.assetId,assetSourceId:null==e?void 0:e.assetSourceId},skip:!e});return{variants:(null==t?void 0:t.assetVariants)||null,loading:n,refetch:r}}(r?{assetId:r.id,assetSourceId:r.assetSource.id}:null);return r?o.a.createElement("div",{className:I.a.variantsContainer},a.loading?o.a.createElement("div",null,n("assetVariants.loadingVariants","Loading Variants…")):o.a.createElement(o.a.Fragment,null,o.a.createElement("h1",null,n("assetVariants.title","Image Variants")),o.a.createElement("ul",null,(null===(e=a.variants)||void 0===e?void 0:e.length)>0?null===(t=a.variants)||void 0===t?void 0:t.map(e=>o.a.createElement("li",{className:I.a.variantItem,key:"variant-"+e.id},o.a.createElement(j,{...e}))):o.a.createElement("li",null,n("assetVariants.noVariantsFound","No variants found"))))):null},x=n(19),R=n(56),D=n(54),M=n(84),L=n(66),P=n(103),F=n(118),B=n.n(F);var U=o.a.memo(()=>{const{translate:e}=Object(s.d)(),t=Object(S.i)(),n=Object(a.g)(l.a),{showSimilarAssets:r}=Object(a.g)(l.f);return t?o.a.createElement("div",{className:B.a.tasks},o.a.createElement(i.Headline,{type:"h2"},o.a.createElement(b.d,{icon:"tasks",label:e("inspector.actions","Tasks")})),o.a.createElement("div",{className:B.a.buttonWrapper},o.a.createElement(x.b,null),r&&o.a.createElement(R.b,null),o.a.createElement(L.a,{asset:t,style:"lighter"}),!t.assetSource.readOnly&&"details"!==n&&o.a.createElement(o.a.Fragment,null,o.a.createElement(M.b,null),o.a.createElement(D.a,null)),o.a.createElement(P.a,{asset:t,style:"lighter"}))):null}),V=n(71),q=n.n(V),z=n(23);var Q=o.a.memo(()=>{const e=Object(S.i)(),{assetSources:t}=Object(z.e)(),n=Object(s.f)(),{translate:c}=Object(s.d)(),{approvalAttainmentStrategy:{obtainApprovalToUpdateAsset:u}}=Object(s.e)(),d=Object(a.g)(l.f),[h,m]=Object(r.useState)(null),[y,g]=Object(r.useState)(null),[_,O]=Object(r.useState)(null),[E,w]=Object(r.useState)(d.propertyEditor.collapsed),{updateAsset:C,loading:T}=Object(S.l)(),A=(null==e?void 0:e.localId)&&!T,j=e&&(h!==e.label||y!==e.caption||_!==e.copyrightNotice),k=e?t.find(({id:t})=>t===e.assetSource.id):null,I=Object(r.useCallback)(()=>{e&&(m(e.label),g(e.caption),O(e.copyrightNotice))},[e,m,g,O]),N=Object(r.useCallback)(async()=>{if(h!==e.label||y!==e.caption||_!==e.copyrightNotice){if(await u({asset:e}))try{await C({asset:e,label:h,caption:y,copyrightNotice:_}),n.ok(c("actions.updateAsset.success","The asset has been updated"))}catch({message:e}){n.error(c("actions.deleteAsset.error","Error while updating the asset"),e)}}},[n,c,y,_,h,e,C,u]);return Object(r.useEffect)(()=>{I()},[null==e?void 0:e.id]),e?o.a.createElement(v,null,o.a.createElement(i.ToggablePanel,{closesToBottom:!0,className:q.a.propertyPanel,isOpen:!E,onPanelToggle:()=>w(e=>!e)},o.a.createElement(i.ToggablePanel.Header,{className:q.a.propertyPanelHeader},o.a.createElement(b.d,{icon:"pencil",label:c("propertyPanel.header","Properties")})),o.a.createElement(i.ToggablePanel.Contents,{className:q.a.propertyPanelContents},o.a.createElement(p,{label:c("inspector.title","Title")},o.a.createElement(i.TextInput,{name:"label",disabled:!A,type:"text",value:h||"",onChange:m,onEnterKey:N})),o.a.createElement(p,{label:c("inspector.caption","Caption")},o.a.createElement(i.TextArea,{name:"caption",className:q.a.textArea,disabled:!A,minRows:3,expandedRows:6,value:y||"",onChange:g})),o.a.createElement(p,{label:c("inspector.copyrightNotice","Copyright notice")},o.a.createElement(i.TextArea,{name:"copyrightNotice",className:q.a.textArea,disabled:!A,minRows:2,expandedRows:4,value:_||"",onChange:O})),A&&o.a.createElement(f,{handleApply:N,handleDiscard:I,hasUnpublishedChanges:j,inputValid:!!h}))),(null==k?void 0:k.supportsCollections)&&o.a.createElement(G,null),(null==k?void 0:k.supportsTagging)&&o.a.createElement(ae,null),o.a.createElement(U,null),o.a.createElement(ee,null)):null}),$=n(170),W=n.n($);var H=o.a.memo(()=>{const e=Object(a.g)(l.l),{showVariantsEditor:t}=Object(a.g)(l.f),n=Object(a.g)(l.n);return e&&"asset"===n?t?o.a.createElement(i.Tabs,{theme:{tabs__content:W.a.tabContent}},o.a.createElement(i.Tabs.Panel,{icon:"info-circle",key:"editor",id:"editor"},o.a.createElement(Q,null)),o.a.createElement(i.Tabs.Panel,{icon:"images"},o.a.createElement(N,null))):o.a.createElement(Q,null):null}),K=n(119);var G=o.a.memo(()=>{const e=Object(s.f)(),{translate:t}=Object(s.d)(),{approvalAttainmentStrategy:{obtainApprovalToSetAssetCollections:n}}=Object(s.e)(),{assetCollections:u}=Object(c.g)(),{setAssetCollections:d,loading:f}=Object(S.j)(),p=Object(S.i)(),{limitToSingleAssetCollectionPerAsset:h}=Object(a.g)(l.f),[m,v]=Object(r.useState)(""),g=Object(r.useMemo)(()=>u.map(e=>({label:e.title,id:e.id,secondaryLabel:e.parent?"/"+Object(c.d)(e,u).map(({title:e})=>e).join("/"):""})),[u]),_=Object(r.useMemo)(()=>g.filter(({label:e})=>e.toLowerCase().includes(m)),[g,m]),[O,E]=Object(r.useState)([]),w=Object(r.useCallback)(()=>E((null==p?void 0:p.collections.map(({id:e})=>e))||[]),[null==p?void 0:p.collections]),C=Object(r.useCallback)(async r=>{if(null===r?r=[]:"string"==typeof r&&(r=[r]),o=p,r.join(",")!==o.collections.map(e=>e.id).join(",")){const o=p,a=u.filter(e=>r.includes(e.id));if(await n({asset:o,newAssetCollections:a}))try{await d({asset:o,assetCollections:a}),e.ok(t("actions.setAssetCollections.success","The collections for the asset have been set"))}catch({message:n}){e.error(t("actions.setAssetCollections.error","Error while setting the collections for the asset"),n)}else w()}var o},[e,p,d,u,t,w,n]),T=Object(r.useCallback)(e=>{v(e.toLowerCase())},[]);return Object(r.useEffect)(w,[w]),p?o.a.createElement("div",{className:"collectionSelectBox"},h?o.a.createElement(o.a.Fragment,null,o.a.createElement(i.Headline,{type:"h2"},o.a.createElement(b.d,{icon:"folder",label:t("inspector.assetCollection","Collection")})),o.a.createElement(i.SelectBox,{className:K.collectionSelectBox,disabled:f||p.assetSource.readOnly,placeholder:t("inspector.collections.placeholder","Select a collection"),value:O.length?O[0]:null,optionValueField:"id",options:_,noMatchesFoundLabel:t("general.noMatchesFound","No matches found"),onValueChange:C,onSearchTermChange:T,ListPreviewElement:y,displaySearchBox:!0,allowEmpty:!0,threshold:0})):o.a.createElement(o.a.Fragment,null,o.a.createElement(i.Headline,{type:"h2"},o.a.createElement(b.d,{icon:"folder",label:t("inspector.assetCollections","Collections")})),o.a.createElement(i.MultiSelectBox,{className:K.collectionSelectBox,disabled:f||p.assetSource.readOnly,placeholder:t("inspector.collections.placeholder","Select a collection"),values:O,optionValueField:"id",options:g,searchOptions:_,noMatchesFoundLabel:t("general.noMatchesFound","No matches found"),onValuesChange:C,onSearchTermChange:T,ListPreviewElement:y,displaySearchBox:!0,allowEmpty:!0,threshold:0}))):null}),Y=n(171),X=n.n(Y);var J=o.a.memo(()=>{var e;const t=Object(S.i)(),{translate:n}=Object(s.d)();return(null===(e=null==t?void 0:t.iptcProperties)||void 0===e?void 0:e.length)?o.a.createElement("div",{className:X.a.iptcData},o.a.createElement(i.Headline,{type:"h2"},o.a.createElement(b.d,{icon:"camera",label:n("inspector.iptcMetadata","IPTC Metadata")})),o.a.createElement(b.f,null,t.iptcProperties.map(e=>o.a.createElement(b.g,{key:e.propertyName,label:e.propertyName,value:e.value})))):null}),Z=n(52);var ee=r.memo(()=>{const{translate:e}=Object(s.d)(),t=Object(S.i)();return t?r.createElement("div",null,r.createElement(i.Headline,{type:"h2"},r.createElement(b.d,{icon:"info-circle",label:e("inspector.metadata","Metadata")})),r.createElement(b.f,null,r.createElement(b.g,{label:e("inspector.property.dimensions","Dimensions"),value:`${t.width}px x ${t.height}px`}),t.file.size>0&&r.createElement(b.g,{label:e("inspector.property.fileSize","Size"),value:Object(Z.a)(t.file.size)}),r.createElement(b.g,{label:e("inspector.property.filename","Filename"),value:t.filename}),r.createElement(b.g,{label:e("inspector.property.lastModified","Last modified"),value:new Date(t.lastModified).toLocaleString()}),r.createElement(b.g,{label:e("inspector.property.mediaType","MIME type"),value:t.file.mediaType}),r.createElement(b.g,{label:e("inspector.property.identifier","Identifier"),value:t.id}))):null}),te=n(14);var ne=r.memo(()=>{const e=Object(te.f)(),t=Object(a.g)(l.n),n=Object(s.f)(),{translate:o}=Object(s.d)(),[c,u]=Object(r.useState)(null),{updateTag:d}=Object(te.h)(),h=e&&c!==e.label,m=Object(r.useCallback)(()=>{e&&u(e.label)},[e,u]),b=Object(r.useCallback)(()=>{c!==e.label&&d({tag:e,label:c}).then(()=>{n.ok(o("actions.updateTag.success","The tag has been updated"))}).catch(({message:e})=>{n.error(o("actions.updateTag.error","Error while updating the tag"),e)})},[n,o,e,d,c]);return Object(r.useEffect)(()=>{m()},[null==e?void 0:e.id]),e&&"tag"===t?r.createElement(v,null,r.createElement(p,{label:o("inspector.label","Label")},r.createElement(i.TextInput,{type:"text",value:c||"",onChange:u,onEnterKey:b})),r.createElement(f,{handleApply:b,handleDiscard:m,hasUnpublishedChanges:h})):null}),re=n(172);var oe=o.a.memo(({values:e,options:t,onChange:n,disabled:a=!1})=>{const{translate:l}=Object(s.d)(),[c,u]=Object(r.useState)(""),d=Object(r.useMemo)(()=>t.filter(({label:e})=>e.toLowerCase().includes(c.toLowerCase())),[t,c]),f=Object(r.useCallback)(e=>{u(e)},[]);return o.a.createElement("div",{className:"tagSelectBoxWrapper"},o.a.createElement(i.Headline,{type:"h2"},o.a.createElement(b.d,{icon:"tags",label:l("inspector.tags","Tags")})),o.a.createElement(i.MultiSelectBox,{className:re.tagSelectBox,disabled:a,placeholder:l("inspector.tags.placeholder","Select a tag"),noMatchesFoundLabel:l("general.noMatchesFound","No matches found"),values:e,optionValueField:"id",options:t,searchOptions:d,onValuesChange:e=>n(e.map(e=>t.find(t=>t.id===e))),searchTerm:c,onSearchTermChange:f,displaySearchBox:!0,allowEmpty:!0,threshold:0}))});var ae=o.a.memo(()=>{const e=Object(s.f)(),{translate:t}=Object(s.d)(),{approvalAttainmentStrategy:{obtainApprovalToSetAssetTags:n}}=Object(s.e)(),{tags:a}=Object(te.g)(),{setAssetTags:i,loading:l}=Object(S.k)(),c=Object(S.i)(),[u,d]=Object(r.useState)([]),f=Object(r.useCallback)(()=>d(null==c?void 0:c.tags.map(({id:e})=>e).sort()),[null==c?void 0:c.tags]),p=Object(r.useCallback)(async r=>{if(o=c,r.map(e=>e.id).sort().join(",")!==o.tags.map(e=>e.id).sort().join(",")){if(await n({asset:c,newTags:r}))try{await i({asset:c,tags:r}),e.ok(t("actions.setAssetTags.success","The asset has been tagged"))}catch({message:n}){e.error(t("actions.setAssetTags.error","Error while tagging the asset"),n)}else f()}var o},[e,c,i,t,f,n]);return Object(r.useEffect)(()=>f(),[f]),c?o.a.createElement(oe,{values:u,options:a,onChange:p,disabled:l||c.assetSource.readOnly}):null});var ie=o.a.memo(()=>{const e=Object(s.f)(),{translate:t}=Object(s.d)(),{tags:n}=Object(te.g)(),{updateAssetCollection:a}=Object(c.j)(),i=Object(c.h)(),l=Object(r.useMemo)(()=>null==i?void 0:i.tags.map(({id:e})=>e).sort(),[null==i?void 0:i.tags]),u=Object(r.useCallback)(n=>{var r;r=i,n.map(e=>e.id).sort().join(",")!==r.tags.map(e=>e.id).sort().join(",")&&a({assetCollection:i,tags:n}).then(()=>{e.ok(t("actions.tagAssetCollection.success","The asset collection has been tagged"))}).catch(({message:n})=>{e.error(t("actions.tagAssetCollection.error","Error while tagging the asset collection"),n)})},[e,i,a,t]);return i?o.a.createElement(oe,{values:l,options:n,onChange:u}):null})},function(e,t,n){e.exports={thumb:"FilePreview-module__thumb___3Pr8a",thumbInner:"FilePreview-module__thumbInner___IvQdB",img:"FilePreview-module__img___8ejzf",loading:"FilePreview-module__loading___1237G",success:"FilePreview-module__success___3O3RF",error:"FilePreview-module__error___2Vwak",warning:"FilePreview-module__warning___3LWQm"}},function(e,t,n){e.exports={uploadArea:"ReplaceAssetDialog-module__uploadArea___1jzR5",optionSection:"ReplaceAssetDialog-module__optionSection___1SaG0",option:"ReplaceAssetDialog-module__option___2K8FB",label:"ReplaceAssetDialog-module__label___huLhV"}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e,t,n,r,o){this.message=e,this.path=t,this.query=n,this.clientOnly=r,this.variables=o}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(5),o=n(50);const a=r.gql` query ASSET_COLLECTION($id: AssetCollectionId!) { assetCollection(id: $id) { ...AssetCollectionProps diff --git a/Resources/Public/Assets/main.bundle.js b/Resources/Public/Assets/main.bundle.js index 9e3d48ba8..6de0a3b49 100644 --- a/Resources/Public/Assets/main.bundle.js +++ b/Resources/Public/Assets/main.bundle.js @@ -1,11 +1,11 @@ -!function(e,t,r,n,o){var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},s="function"==typeof a[n]&&a[n],i=s.cache||{},l="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function c(t,r){if(!i[t]){if(!e[t]){var o="function"==typeof a[n]&&a[n];if(!r&&o)return o(t,!0);if(s)return s(t,!0);if(l&&"string"==typeof t)return l(t);var u=Error("Cannot find module '"+t+"'");throw u.code="MODULE_NOT_FOUND",u}d.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},d.cache={};var f=i[t]=new c.Module(t);e[t][0].call(f.exports,d,f,f.exports,this)}return i[t].exports;function d(e){var t=d.resolve(e);return!1===t?{}:c(t)}}c.isParcelRequire=!0,c.Module=function(e){this.id=e,this.bundle=c,this.exports={}},c.modules=e,c.cache=i,c.parent=s,c.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(c,"root",{get:function(){return a[n]}}),a[n]=c;for(var u=0;u{for(;!window.NeosCMS?.I18n?.initialized;)await new Promise(e=>setTimeout(e,50));let e=document.getElementById("media-ui-app"),{dummyImage:t}=e.dataset,r=JSON.parse(e.dataset.endpoints),n=JSON.parse(e.dataset.features);(0,l.default).setAppElement(e);let i=(0,v.CacheFactory).createCache(n),d=(0,a.createRef)(),{Notification:g}=window.NeosCMS,b=new c.ApolloClient({connectToDevTools:!0,cache:i,link:(0,c.ApolloLink).from([(0,v.createErrorHandler)(g),(0,u.createUploadLink)({uri:r.graphql,credentials:"same-origin"})]),typeDefs:[f.typeDefs,h.typeDefs]});(0,s.render)((0,o.jsx)(p.default,{client:b,translate:(e,t=null,r={},n="Flowpack.Media.Ui",o="Main")=>window.NeosCMS.I18n.translate(e,t,n,o,r),notificationApi:g,initialState:{applicationContext:"browser",featureFlags:n,constraints:{},assetType:"all"},children:(0,o.jsx)(j.default,{children:(0,o.jsx)(f.MediaUiProvider,{dummyImage:t,containerRef:d,children:(0,o.jsx)(m.AssetCollectionTreeDndProvider,{children:(0,o.jsx)(y.default,{})})})})}),e)}},{"react/jsx-runtime":"gaGEj",react:"6uln9","react-dom":"b8T3j","react-modal":"8mlRL","@apollo/client":"bWmmR","apollo-upload-client":"eiZnp","@media-ui/core":"j3EAa","@media-ui/core/src/components/MediaApplicationWrapper":"HGtGw","@media-ui/feature-asset-usage":"lWHpb","@media-ui/feature-asset-collections/src/provider/AssetCollectionTreeDndProvider":"g189o","./core":"1xlGQ","./components/App":"2lMwS","./components/ErrorBoundary":"cumtn","./lib/FontAwesome":"3DZN8","@parcel/transformer-js/src/esmodule-helpers.js":"k3151"}],gaGEj:[function(e,t,r){"use strict";t.exports=e("e5e9711c2edf1a4e")},{e5e9711c2edf1a4e:"kbpKW"}],kbpKW:[function(e,t,r){"use strict";e("ea59cf80247f96ff");var n=e("3fd2a064dc1f3641"),o=60103;if(r.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var a=Symbol.for;o=a("react.element"),r.Fragment=a("react.fragment")}var s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,a={},c=null,u=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,n)&&!l.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===a[n]&&(a[n]=t[n]);return{$$typeof:o,type:e,key:c,ref:u,props:a,_owner:s.current}}r.jsx=c,r.jsxs=c},{ea59cf80247f96ff:"hdgcG","3fd2a064dc1f3641":"6uln9"}],hdgcG:[function(e,t,r){"use strict";var n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;t.exports=!function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==n.join(""))return!1;var o={};if("abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},o)).join(""))return!1;return!0}catch(e){return!1}}()?function(e,t){for(var r,s,i=function(e){if(null==e)throw TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l