Loheide-eu-mitarbeiterplatt.../public/build/assets/EditorialSnippets-CMhsD8Jc.js
Friederich Loheide 4d58364104
All checks were successful
CI / PHP 8.3 / mariadb:10.6 (pull_request) Has been skipped
CI / PHP 8.4 / mariadb:10.6 (pull_request) Has been skipped
CI / PHP 8.3 / mariadb:11.4 (pull_request) Has been skipped
CI / PHP 8.4 / mariadb:11.4 (pull_request) Has been skipped
CI / PHP 8.3 / mysql:8.0 (pull_request) Has been skipped
CI / PHP 8.4 / mysql:8.0 (pull_request) Has been skipped
CI / PHP 8.3 / mysql:8.4 (pull_request) Has been skipped
CI / PHP 8.4 / mysql:8.4 (pull_request) Has been skipped
CI / Browser-Tests (pull_request) Successful in 14m21s
CI / PHP 8.3 / mysql:8.4-1 (pull_request) Successful in 19m7s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 5m20s
CI / Build-Artefakte aktuell (pull_request) Successful in 5m46s
Frag das Portal als schwebende Blase, Suchliste im Bild (0.65.0)
- AskBubble unten rechts (abschaltbar), Gespräch bleibt beim Seitenwechsel
- Antwortanzeige als gemeinsame Komponente AskAnswer
- Trefferliste der Kopfzeilen-Suche in der App-Oberfläche linksbündig
- CI: optionale Kern-Plugins für Browser-Tests einschalten, Suchtest mit Demo-Inhalt

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 19:02:18 +00:00

1 line
No EOL
4.6 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{C as e,D as t,M as n,P as r,S as i,T as a,W as o,w as s,x as c}from"./ui-DY0WbyhT.js";import{At as l,C as u,Dt as d,O as f,S as p,T as m,Tt as h,Y as g,_t as _,g as v,i as y,k as b,ot as x,q as S,s as C,v as w,w as T,x as E}from"./framework-Cy4cevSy.js";import{t as D}from"./component-B42LdBOJ.js";import{t as O}from"./file-stack-CxQhzRkG.js";import{t as k}from"./plus-BkVfuiNS.js";import{D as A,M as j,U as M,d as N}from"./app-k1_9tffg.js";var P={class:`-mt-1 mb-3 inline-flex rounded-md border p-0.5 text-[13px]`,role:`tablist`},F=[`aria-selected`],I=[`aria-selected`],L={class:`mb-3 text-[13px] text-muted-foreground`},R={key:0,class:`-mx-5 divide-y border-t`},z={class:`min-w-0 flex-1`},B={class:`truncate text-xs text-muted-foreground`},V={key:1,class:`text-sm text-muted-foreground`},H={__name:`EditorialSnippets`,props:{snippets:{type:Array,required:!0}},setup(H){let U=H,W=_(`block`),G=E(()=>U.snippets.filter(e=>e.kind===W.value)),K=_(!1),q=_(``),J=_(!1);async function Y(){J.value=!0;try{let e=await j.post(`/redaktion/bausteine`,{kind:W.value,name:q.value,content:{blocks:[]}});C.visit(e.edit_url)}catch(e){o.error(e.data?.errors?.name?.[0]??e.message),J.value=!1}}function X(e){let t=e.usages.length?`\n\nAchtung: Der Baustein ist auf ${e.usages.length} Seite(n) eingebunden und verschwindet dort.`:``;window.confirm(`„${e.name}“ löschen?${t}`)&&C.delete(`/redaktion/bausteine/${e.id}`,{preserveScroll:!0,onSuccess:()=>o.success(`Gelöscht`)})}return(o,_)=>(S(),u(N,{title:`Bausteine & Vorlagen`},{actions:x(()=>[b(h(r),{size:`sm`,variant:`outline`,onClick:_[0]||=e=>(q.value=``,K.value=!0)},{default:x(()=>[b(h(k)),f(` `+l(W.value===`block`?`Neuer Baustein`:`Neue Vorlage`),1)]),_:1})]),default:x(()=>[p(`div`,P,[p(`button`,{type:`button`,role:`tab`,"aria-selected":W.value===`block`,class:d([`inline-flex items-center gap-1.5 rounded-sm px-3 py-1`,W.value===`block`?`bg-muted font-medium`:`text-muted-foreground`]),onClick:_[1]||=e=>W.value=`block`},[b(h(D),{class:`size-3.5`}),_[6]||=f(` Bausteine`,-1)],10,F),p(`button`,{type:`button`,role:`tab`,"aria-selected":W.value===`template`,class:d([`inline-flex items-center gap-1.5 rounded-sm px-3 py-1`,W.value===`template`?`bg-muted font-medium`:`text-muted-foreground`]),onClick:_[2]||=e=>W.value=`template`},[b(h(O),{class:`size-3.5`}),_[7]||=f(` Seitenvorlagen`,-1)],10,I)]),p(`p`,L,[W.value===`block`?(S(),m(w,{key:0},[f(`Bausteine erscheinen auf vielen Seiten gleich, z. B. ein Kontaktkasten oder Öffnungszeiten. Eine Änderung wirkt überall.`)],64)):(S(),m(w,{key:1},[f(`Vorlagen sind Ausgangspunkt für neue Seiten – beim Anlegen wird der Inhalt kopiert.`)],64))]),G.value.length?(S(),m(`ul`,R,[(S(!0),m(w,null,g(G.value,e=>(S(),m(`li`,{key:e.id,class:`flex items-center gap-3 px-5 py-2.5`},[p(`div`,z,[b(h(y),{href:e.edit_url,class:`block truncate text-sm font-medium hover:underline`},{default:x(()=>[f(l(e.name),1)]),_:2},1032,[`href`]),p(`p`,B,[e.description?(S(),m(w,{key:0},[f(l(e.description)+` · `,1)],64)):T(``,!0),f(` `+l(e.blocks)+` `+l(e.blocks===1?`Block`:`Blöcke`)+` `,1),e.kind===`block`?(S(),m(w,{key:1},[f(` · `+l(e.usages.length?`auf ${e.usages.length} ${e.usages.length===1?`Seite`:`Seiten`}`:`noch nicht eingebunden`),1)],64)):T(``,!0),e.updated_at?(S(),m(w,{key:2},[f(` · `+l(h(A)(e.updated_at))+l(e.editor?` von ${e.editor}`:``),1)],64)):T(``,!0)])]),b(h(r),{size:`icon`,variant:`ghost`,class:`size-8 text-muted-foreground hover:text-destructive`,"aria-label":`${e.name} löschen`,onClick:t=>X(e)},{default:x(()=>[b(h(M))]),_:1},8,[`aria-label`,`onClick`])]))),128))])):(S(),m(`p`,V,l(W.value===`block`?`Noch keine Bausteine. Tipp: Im Seiteneditor lässt sich jeder Block „Als Baustein speichern“.`:`Noch keine Vorlagen. Tipp: Im Seiteneditor unter ⋮ „Als Vorlage speichern“.`),1)),b(h(t),{open:K.value,"onUpdate:open":_[5]||=e=>K.value=e},{default:x(()=>[b(h(a),{class:`sm:max-w-md`},{default:x(()=>[b(h(i),null,{default:x(()=>[b(h(c),null,{default:x(()=>[f(l(W.value===`block`?`Neuer Baustein`:`Neue Seitenvorlage`),1)]),_:1}),b(h(s),null,{default:x(()=>[..._[8]||=[f(`Danach öffnet sich der Editor.`,-1)]]),_:1})]),_:1}),p(`form`,{class:`grid gap-4`,onSubmit:v(Y,[`prevent`])},[b(h(n),{modelValue:q.value,"onUpdate:modelValue":_[3]||=e=>q.value=e,maxlength:`120`,autofocus:``,placeholder:`Name, z. B. „Kontakt Personalabteilung“`,"aria-label":`Name`},null,8,[`modelValue`]),b(h(e),null,{default:x(()=>[b(h(r),{type:`button`,variant:`outline`,onClick:_[4]||=e=>K.value=!1},{default:x(()=>[..._[9]||=[f(`Abbrechen`,-1)]]),_:1}),b(h(r),{type:`submit`,disabled:J.value||!q.value.trim()},{default:x(()=>[..._[10]||=[f(`Anlegen`,-1)]]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`])]),_:1}))}};export{H as default};