Loheide-eu-mitarbeiterplatt.../public/build/assets/HomepageEditor-BQ_GLLl7.js
Friederich Loheide 800e267e1c
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 7m29s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 7m31s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 9m3s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 9m36s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 13m33s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 13m56s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 12m35s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 11m58s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 50s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m13s
Neue Seitenköpfe, global wählbar (0.48.0)
- PageHeader: Kopfband (Standard, kompakt), Kopfband mit Symbol, mit Symbol,
  kräftiger Titel – Einstellung page_header im Erscheinungsbild
- Symbol vom passenden Menüpunkt (aktiv oder per Adresse), Prop icon
- In Spalten (z. B. Downloads) schlichte Form statt Band
- Zurück-Links als breadcrumbs (IT-Service), Profil bearbeiten mit PageHeader
- Plugin-Assets: Fingerabdruck berücksichtigt Änderungszeiten der Dateien

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 20:05:37 +00:00

1 line
No EOL
11 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{At as e,G as t,K as n,Ot as r,P as i,Q as ee,U as te,W as a,X as ne,Y as re,Z as ie,et as ae,ft as oe,it as se,tt as ce}from"./ui-DTELwomD.js";import{C as o,Et as s,J as c,O as l,Q as le,S as u,T as d,U as ue,W as de,Y as f,_t as p,gt as m,k as h,kt as g,ot as _,q as v,r as fe,rt as pe,v as y,w as b,wt as x,x as S}from"./framework-CFqPLBV8.js";import{t as me}from"./arrow-left-CMu6dfzA.js";import{a as he,c as ge,i as C,n as w,o as _e,r as T,s as E,t as D}from"./EditorBlockList-TBYiRetP.js";import{d as ve,o as ye}from"./useMediaList-BYAVxHdw.js";import{t as be}from"./cloud-alert-a2zJrWlN.js";import{t as xe}from"./eye-CaCQtjAn.js";import{t as Se}from"./plus-DBUMooLa.js";import{t as O}from"./rotate-ccw-clock-BiXvHGvX.js";import{t as Ce}from"./send-BEFYa2vh.js";import{t as we}from"./smartphone-BeKI25Lh.js";import{t as Te}from"./tablet-DQtaSTHm.js";import{E as k,I as Ee,X as De}from"./app-DPANCdgI.js";import{n as Oe,t as ke}from"./useMediaPicker-CMSKJWry.js";var Ae={class:`flex h-dvh flex-col bg-background`},je={class:`flex shrink-0 items-center gap-3 border-b bg-card px-3 py-2 sm:px-4`},Me=[`href`],Ne={class:`min-w-0 flex-1`},Pe={class:`truncate text-sm font-semibold`},Fe={class:`flex items-center gap-1.5 text-xs text-muted-foreground`},Ie={key:3},Le={key:4},Re={key:5},ze={key:6},Be={key:7},Ve={key:8,class:`max-sm:sr-only`},He={class:`hidden items-center rounded-md border p-0.5 md:flex`,role:`group`,"aria-label":`Geräte-Vorschau`},Ue=[`title`,`aria-pressed`,`onClick`],We={class:`ml-auto truncate text-xs text-muted-foreground`},Ge={key:2,class:`px-2 py-1.5 text-[13px] text-muted-foreground`},Ke={class:`flex min-h-0 flex-1`},qe={key:0,class:`rounded-lg border border-dashed bg-card p-8 text-center text-sm text-muted-foreground`},Je={class:`@container`},Ye={class:`hidden w-[340px] shrink-0 flex-col border-l bg-card lg:flex`},Xe={class:`flex shrink-0 border-b px-2`,role:`tablist`},Ze=[`aria-selected`,`disabled`,`onClick`],Qe={key:0,class:`absolute inset-x-2 bottom-0 h-[3px] rounded-t-full bg-brand`},$e={class:`min-h-0 flex-1 overflow-y-auto p-4`},et={class:`mb-4 text-xs text-muted-foreground`},A={__name:`HomepageEditor`,props:{content:{type:Object,required:!0},state:{type:Object,required:!0},revisions:{type:Array,default:()=>[]},blockTypes:{type:Array,required:!0},blockGroups:{type:Object,required:!0},audienceOptions:{type:Object,required:!0},uploadsUrl:{type:String,required:!0},config:{type:Object,required:!0}},setup(A){let j=A,M=j.config.base,N=j.config.kind===`homepage`,P=Object.fromEntries(j.blockTypes.map(e=>[e.key,e])),F=m({content:C(j.content)}),I=p(j.state),L=p(j.revisions),R=p(null),z=p(null),B=m({}),V=p(`blocks`),H=p(!1),U=p(`desktop`),W=S(()=>R.value?E(F.content.blocks,R.value)?.block??null:null);pe(R,e=>V.value=e?`block`:`blocks`);let G=e=>R.value=e??null;function K(e,t,n){let r=he(n);e.splice(t,0,r),G(r.id)}function tt(e){let t=W.value?E(F.content.blocks,W.value.id):null;t?K(t.list,t.index+1,e):K(F.content.blocks,F.content.blocks.length,e),H.value=!1}function nt(e){let t=E(F.content.blocks,e);t&&(t.list.splice(t.index,1),R.value===e&&G(null))}function rt(e,t){let n=E(F.content.blocks,e),r=n?n.index+t:-1;n&&r>=0&&r<n.list.length&&n.list.splice(r,0,n.list.splice(n.index,1)[0])}function it(e){let t=E(F.content.blocks,e);if(!t)return;let n=_e(t.block);t.list.splice(t.index+1,0,n),Object.assign(B,{[n.id]:B[e]}),G(n.id)}function at(e){return[W.value,z.value?E(F.content.blocks,z.value)?.block:null].filter(Boolean).some(t=>t.items?.includes(e)||E(e.blocks,t.id))}let ot=(e,t)=>ve(`${M}/bilder`,e,{onProgress:t}),st=ke({upload:ot,contextLabel:j.config.media_label,contextPaths:()=>ye(F.content)});c(`pagebuilder:editor`,{types:P,groups:j.blockGroups,selectedId:R,hoveredId:z,previews:B,readOnly:p(!1),files:p([]),peopleCache:m({}),audienceOptions:j.audienceOptions,select:G,insert:K,remove:nt,move:rt,duplicate:it,containsActive:at,uploadImage:ot,uploadFile:()=>Promise.reject(Error(`Dateien zum Herunterladen gehören zu einer Seite – bitte dort hochladen und verlinken.`)),pickMedia:e=>st.pick(e),imageUrl:e=>`${j.uploadsUrl}/${e}`,saveAsSnippet:null}),c(`pagebuilder:list`,D),c(`pagebuilder:types`,P),c(`pagebuilder:editing`,S(()=>!0));let q={},ct;function J(){let e=[];ge(F.content.blocks,t=>{if(!P[t.type]?.dynamic)return;let n=JSON.stringify(t.data);q[t.id]!==n&&(q[t.id]=n,e.push({id:t.id,type:t.type,data:t.data}))}),e.length&&k.post(`${M}/vorschau`,{blocks:e.slice(0,100)}).then(e=>Object.assign(B,e.props)).catch(()=>{})}let Y=p(`saved`),X=JSON.stringify(F.content),Z;async function lt(){clearTimeout(Z);let e=JSON.stringify(F.content);if(e===X){Y.value=`saved`;return}Y.value=`saving`;try{let t=await k.put(`${M}/entwurf`,{content:F.content});X=e,I.value=t.state,Y.value=JSON.stringify(F.content)===X?`saved`:`dirty`}catch(e){Y.value=`error`,a.error(e.message||`Speichern fehlgeschlagen`)}}pe(()=>F.content,()=>{Y.value=`dirty`,clearTimeout(Z),Z=setTimeout(lt,1200),clearTimeout(ct),ct=setTimeout(J,500)},{deep:!0});function ut(e){F.content=C(e),X=JSON.stringify(F.content),Object.keys(q).forEach(e=>delete q[e]),G(null),setTimeout(()=>Y.value=`saved`),J()}let Q=p(!1);async function dt(){let e=N&&I.value.mode!==`builder`;if(!e||window.confirm(`Veröffentlichen und die frei gestaltete Startseite für alle einschalten? Die bisherige Kachel-Startseite bleibt erhalten und lässt sich im Backend unter „Startseite“ wieder wählen.`)){Q.value=!0;try{let t=await k.post(`${M}/veroeffentlichen`,{content:F.content,activate:e});X=JSON.stringify(F.content),I.value=t.state,L.value=t.revisions,Y.value=`saved`,a.success(e?`Veröffentlicht – die Startseite ist jetzt frei gestaltet.`:N?`Veröffentlicht – die Startseite ist aktualisiert.`:`Veröffentlicht – die Fußzeile ist aktualisiert.`)}catch(e){a.error(e.message)}finally{Q.value=!1}}}async function ft(){if(!window.confirm(`Alle Änderungen seit der letzten Veröffentlichung verwerfen?`))return;let e=await k.delete(`${M}/entwurf`);I.value=e.state,ut(e.content),a.success(`Entwurf verworfen`)}async function pt(e){if(!window.confirm(`Diese frühere Fassung als Entwurf zurückholen? Veröffentlicht wird sie erst mit „Veröffentlichen“.`))return;let t=await k.post(`${M}/versionen/${e.id}/wiederherstellen`);I.value=t.state,ut(t.content),a.success(`Frühere Fassung als Entwurf geladen`)}async function mt(){await lt(),window.open(j.config.preview,`_blank`)}let ht=[{key:`desktop`,label:`Desktop`,icon:De,width:`max-w-[1400px]`},{key:`tablet`,label:`Tablet`,icon:Te,width:`max-w-[768px]`},{key:`mobile`,label:`Smartphone`,icon:we,width:`max-w-[390px]`}],gt=S(()=>ht.find(e=>e.key===U.value).width),_t=new Intl.DateTimeFormat(`de-DE`,{dateStyle:`medium`,timeStyle:`short`}),$=e=>Y.value===`dirty`&&e.preventDefault();return de(()=>{J(),window.addEventListener(`beforeunload`,$)}),ue(()=>window.removeEventListener(`beforeunload`,$)),(a,c)=>(v(),d(y,null,[h(x(fe),{title:A.config.title},null,8,[`title`]),u(`div`,Ae,[u(`header`,je,[u(`a`,{href:A.config.back,class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent`,"aria-label":`Zurück ins Backend`},[h(x(me),{class:`size-5`})],8,Me),u(`div`,Ne,[u(`p`,Pe,g(A.config.title),1),u(`p`,Fe,[Y.value===`saving`?(v(),o(x(r),{key:0,class:`size-3 animate-spin`})):Y.value===`error`?(v(),o(x(be),{key:1,class:`size-3 text-destructive`})):(v(),o(x(e),{key:2,class:`size-3`})),Y.value===`error`?(v(),d(`span`,Ie,`Nicht gespeichert`)):Y.value===`saved`?I.value.has_draft?(v(),d(`span`,Re,`Entwurf gespeichert – noch nicht veröffentlicht`)):I.value.published?(v(),d(`span`,Be,`Veröffentlicht`)):(v(),d(`span`,ze,g(A.config.initial),1)):(v(),d(`span`,Le,`Entwurf wird gespeichert …`)),N?(v(),d(`span`,Ve,`· Startseite zeigt derzeit: `+g(I.value.mode===`builder`?`diese Gestaltung`:`Kacheln (wie bisher)`),1)):b(``,!0)])]),u(`div`,He,[(v(),d(y,null,f(ht,e=>u(`button`,{key:e.key,type:`button`,class:s([`grid size-8 place-items-center rounded`,U.value===e.key?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`]),title:e.label,"aria-pressed":U.value===e.key,onClick:t=>U.value=e.key},[(v(),o(le(e.icon),{class:`size-4`}))],10,Ue)),64))]),h(x(i),{variant:`outline`,size:`icon`,class:`lg:hidden`,"aria-label":`Block hinzufügen`,onClick:c[0]||=e=>H.value=!0},{default:_(()=>[h(x(Se))]),_:1}),h(x(i),{variant:`outline`,class:`hidden sm:inline-flex`,onClick:mt},{default:_(()=>[h(x(xe)),c[3]||=l(` Vorschau`,-1)]),_:1}),h(x(ee),null,{default:_(()=>[h(x(t),{"as-child":``},{default:_(()=>[h(x(i),{variant:`outline`,size:`icon`,"aria-label":`Versionen und mehr`},{default:_(()=>[h(x(O))]),_:1})]),_:1}),h(x(ie),{align:`end`,class:`w-72`},{default:_(()=>[I.value.has_draft&&I.value.published?(v(),o(x(ne),{key:0,onSelect:ft},{default:_(()=>[h(x(Ee)),c[4]||=l(` Entwurf verwerfen`,-1)]),_:1})):b(``,!0),I.value.has_draft&&I.value.published?(v(),o(x(n),{key:1})):b(``,!0),h(x(re),{class:`text-xs text-muted-foreground`},{default:_(()=>[...c[5]||=[l(`Frühere Fassungen`,-1)]]),_:1}),(v(!0),d(y,null,f(L.value,e=>(v(),o(x(ne),{key:e.id,onSelect:t=>pt(e)},{default:_(()=>[h(x(O)),l(` `+g(x(_t).format(new Date(e.at))),1),u(`span`,We,g(e.user),1)]),_:2},1032,[`onSelect`]))),128)),L.value.length?b(``,!0):(v(),d(`p`,Ge,`Noch nichts veröffentlicht.`))]),_:1})]),_:1}),h(x(i),{disabled:Q.value,onClick:dt},{default:_(()=>[Q.value?(v(),o(x(r),{key:0,class:`animate-spin`})):(v(),o(x(Ce),{key:1})),c[6]||=l(),c[7]||=u(`span`,{class:`max-sm:sr-only`},`Veröffentlichen`,-1)]),_:1},8,[`disabled`])]),u(`div`,Ke,[u(`main`,{class:`min-w-0 flex-1 overflow-y-auto bg-muted/40`,onClick:c[1]||=e=>G(null)},[u(`div`,{class:s([`mx-auto px-4 py-8 transition-[max-width] duration-300 sm:px-6`,gt.value])},[F.content.blocks.length?b(``,!0):(v(),d(`p`,qe,g(A.config.empty),1)),u(`div`,Je,[h(D,{item:F.content,root:``},null,8,[`item`])])],2)]),u(`aside`,Ye,[u(`div`,Xe,[(v(),d(y,null,f([{key:`blocks`,label:`Blöcke`},{key:`block`,label:`Ausgewählter Block`}],e=>u(`button`,{key:e.key,type:`button`,role:`tab`,class:s([`relative px-3 py-3 text-sm font-medium disabled:opacity-40`,V.value===e.key?`text-foreground`:`text-muted-foreground hover:text-foreground`]),"aria-selected":V.value===e.key,disabled:e.key===`block`&&!W.value,onClick:t=>V.value=e.key},[l(g(e.label)+` `,1),V.value===e.key?(v(),d(`span`,Qe)):b(``,!0)],10,Ze)),64))]),u(`div`,$e,[V.value===`block`&&W.value?(v(),o(w,{key:W.value.id,block:W.value},null,8,[`block`])):(v(),d(y,{key:1},[u(`p`,et,g(A.config.hint),1),h(T,{onPick:tt})],64))])])]),h(x(oe),{open:H.value,"onUpdate:open":c[2]||=e=>H.value=e},{default:_(()=>[h(x(se),{side:`right`,class:`w-[340px] overflow-y-auto p-4`},{default:_(()=>[h(x(ce),{class:`p-0`},{default:_(()=>[h(x(ae),null,{default:_(()=>[l(g(W.value?`Block bearbeiten`:`Block hinzufügen`),1)]),_:1})]),_:1}),W.value?(v(),o(w,{key:W.value.id,block:W.value},null,8,[`block`])):(v(),o(T,{key:1,onPick:tt}))]),_:1})]),_:1},8,[`open`])]),h(Oe,{picker:x(st)},null,8,[`picker`]),h(x(te),{position:`bottom-left`})],64))}};export{A as default};