PageSourceSearch

https://vilniusfounders.lt/assets/TiptapEditor-Byfx-fQl.js

js vilniusfounders.lt collected 2026-10-05 08:57:16 UTC 14,184 bytes, 91 lines download raw bytes

1import{j as e}from"./vendor-motion-Bc9XJ73_.js";import{r as h}from"./vendor-react-CWSmzibK.js";import{u as y,i as f,a as m,b as j,c as v,d as M,T as L,F as z,E as A}from"./vendor-tiptap-BnuPHub8.js";import{c as i,a as H}from"./index-Bj8jHkTW.js";import{S as C,a as w,b as S,c as T,d as E}from"./select-Cp9MEKJS.js";import{D as q,a as D,b as U,c as N,d as R,e as I,M as V}from"./ImageUpload-DIVLWdMk.js";import{Y}from"./youtube-fBilJWbT.js";import"./vendor-query-Ca3ifJmV.js";import"./vendor-radix-D0pYc2g7.js";import"./index-Bk4aS46l.js";import"./chevron-down-Dvj6Ob8z.js";import"./alert-dialog-pE3inVZX.js";import"./client-BvGHaZM9.js";import"./trash-2-BNNPQ7y5.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const F=i("AlignCenter",[["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 18H5",key:"18s9l3"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const O=i("AlignLeft",[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);/**
12 * @license lucide-react v0.462.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const B=i("AlignRight",[["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 18H7",key:"1ygte8"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);/**
17 * @license lucide-react v0.462.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const _=i("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
22 * @license lucide-react v0.462.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */const P=i("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);/**
27 * @license lucide-react v0.462.0 - ISC
28 *
29 * This source code is licensed under the ISC license.
30 * See the LICENSE file in the root directory of this source tree.
31 */const $=i("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);/**
32 * @license lucide-react v0.462.0 - ISC
33 *
34 * This source code is licensed under the ISC license.
35 * See the LICENSE file in the root directory of this source tree.
36 */const Q=i("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);/**
37 * @license lucide-react v0.462.0 - ISC
38 *
39 * This source code is licensed under the ISC license.
40 * See the LICENSE file in the root directory of this source tree.
41 */const K=i("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
42 * @license lucide-react v0.462.0 - ISC
43 *
44 * This source code is licensed under the ISC license.
45 * See the LICENSE file in the root directory of this source tree.
46 */const X=i("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/**
47 * @license lucide-react v0.462.0 - ISC
48 *
49 * This source code is licensed under the ISC license.
50 * See the LICENSE file in the root directory of this source tree.
51 */const Z=i("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
52 * @license lucide-react v0.462.0 - ISC
53 *
54 * This source code is licensed under the ISC license.
55 * See the LICENSE file in the root directory of this source tree.
56 */const G=i("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
57 * @license lucide-react v0.462.0 - ISC
58 *
59 * This source code is licensed under the ISC license.
60 * See the LICENSE file in the root directory of this source tree.
61 */const J=i("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
62 * @license lucide-react v0.462.0 - ISC
63 *
64 * This source code is licensed under the ISC license.
65 * See the LICENSE file in the root directory of this source tree.
66 */const W=i("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
67 * @license lucide-react v0.462.0 - ISC
68 *
69 * This source code is licensed under the ISC license.
70 * See the LICENSE file in the root directory of this source tree.
71 */const ee=i("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
72 * @license lucide-react v0.462.0 - ISC
73 *
74 * This source code is licensed under the ISC license.
75 * See the LICENSE file in the root directory of this source tree.
76 */const te=i("Redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);/**
77 * @license lucide-react v0.462.0 - ISC
78 *
79 * This source code is licensed under the ISC license.
80 * See the LICENSE file in the root directory of this source tree.
81 */const ae=i("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
82 * @license lucide-react v0.462.0 - ISC
83 *
84 * This source code is licensed under the ISC license.
85 * See the LICENSE file in the root directory of this source tree.
86 */const ne=i("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",ke
86y:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
87 * @license lucide-react v0.462.0 - ISC
88 *
89 * This source code is licensed under the ISC license.
90 * See the LICENSE file in the root directory of this source tree.
91 */const ie=i("Undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]),re=/^(?:https?:\/\/)?(?:www\.|m\.)?(?:youtube\.com\/(?:watch\?v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{11})/;function se({open:t,onOpenChange:c,onSubmit:o}){const[r,l]=h.useState(""),[p,d]=h.useState(null);h.useEffect(()=>{t||(l(""),d(null))},[t]);const x=s=>{s.preventDefault(),s.stopPropagation();const a=r.trim();if(!a){d("Paste a YouTube URL.");return}if(!re.test(a)){d("That doesn't look like a YouTube URL.");return}o(a)},k=s=>{s.key==="Enter"&&(s.preventDefault(),s.stopPropagation(),x(s))};return e.jsx(q,{open:t,onOpenChange:c,children:e.jsxs(D,{children:[e.jsxs(U,{children:[e.jsx(N,{children:"Embed a YouTube video"}),e.jsx(R,{children:"Paste a YouTube URL — full link, short link, or shorts."})]}),e.jsxs("div",{className:"my-6",children:[e.jsx("input",{type:"url",value:r,onChange:s=>{l(s.target.value),d(null)},onKeyDown:k,placeholder:"https://www.youtube.com/watch?v=...",className:"form-input w-full",autoFocus:!0}),p&&e.jsx("p",{className:"mt-2 text-xs text-destructive",children:p})]}),e.jsxs(I,{children:[e.jsx("button",{type:"button",onClick:s=>{s.stopPropagation(),c(!1)},className:"rounded-pill border border-border px-4 py-2 text-sm font-medium text-foreground/80 transition hover:border-primary hover:text-primary",children:"Cancel"}),e.jsx("button",{type:"button",onClick:x,className:"btn-primary",children:"Embed"})]})]})})}function n({onClick:t,active:c,disabled:o,ariaLabel:r,children:l}){return e.jsx("button",{type:"button",onClick:t,disabled:o,"aria-label":r,className:H("inline-flex h-9 w-9 items-center justify-center rounded-lg border text-foreground/80 transition","disabled:cursor-not-allowed disabled:opacity-50",c?"border-primary bg-primary/10 text-primary":"border-border hover:border-primary hover:text-primary"),children:l})}function u(){return e.jsx("span",{className:"mx-0.5 h-6 w-px bg-border","aria-hidden":"true"})}const g="default",le=[{label:"Default",value:g},{label:"Small",value:"14px"},{label:"Normal",value:"16px"},{label:"Medium",value:"18px"},{label:"Large",value:"22px"},{label:"X-Large",value:"28px"},{label:"Huge",value:"36px"}];function oe({editor:t}){const[c,o]=h.useState(!1),[r,l]=h.useState(!1);if(!t)return null;const p=a=>{t.chain().focus().setImage({src:a}).run(),l(!1)},d=()=>{const a=t.getAttributes("link").href,b=window.prompt("Link URL",a??"https://");if(b!==null){if(b===""){t.chain().focus().extendMarkRange("link").unsetLink().run();return}t.chain().focus().extendMarkRange("link").setLink({href:b}).run()}},x=a=>{t.commands.setYoutubeVideo({src:a,width:640,height:360}),o(!1)},k=t.getAttributes("textStyle").fontSize||g,s=a=>{a===g?t.chain().focus().unsetFontSize().run():t.chain().focus().setFontSize(a).run()};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sticky top-16 z-20 flex flex-wrap items-center gap-1 rounded-t-xl border-b border-border bg-card/95 p-2 backdrop-blur",children:[e.jsx(n,{onClick:()=>t.chain().focus().toggleBold().run(),active:t.isActive("bold"),ariaLabel:"Bold",children:e.jsx(_,{size:16})}),e.jsx(n,{onClick:()=>t.chain().focus().toggleItalic().run(),active:t.isActive("italic"),ariaLabel:"Italic",children:e.jsx(X,{size:16})}),e.jsx(n,{onClick:()=>t.chain().focus().toggleUnderline().run(),active:t.isActive("underline"),ariaLabel:"Underline",children:e.jsx(ne,{size:16})}),e.jsx(u,{}),e.jsx(n,{onClick:()=>t.chain().focus().toggleHeading({level:1}).run(),active:t.isActive("heading",{level:1}),ariaLabel:"Heading 1",children:e.jsx(P,{size:16})}),e.jsx(n,{onClick:()=>t.chain().focus().toggleHeading({level:2}).run(),active:t.isActive("heading",{level:2}),ariaLabel:"Heading 2",children:e.jsx($,{size:16})}),e.jsx(n,{onClick:()=>t.chain().focus().toggleHeading({level:3}).run(),active:t.isActive("heading",{level:3}),ariaLabel:"Heading 3",children:e.jsx(Q,{size:16})}),e.jsx(u,{}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ae,{size:14,className:"text-foreground
91/60","aria-hidden":"true"}),e.jsxs(C,{value:k,onValueChange:s,children:[e.jsx(w,{className:"h-9 w-[120px] rounded-lg border-border bg-transparent text-xs",children:e.jsx(S,{placeholder:"Size"})}),e.jsx(T,{children:le.map(a=>e.jsxs(E,{value:a.value,children:[a.label,a.value!==g&&e.jsx("span",{className:"ml-2 text-xs text-foreground/50",children:a.value})]},a.value))})]})]}),e.jsx(u,{}),e.jsx(n,{onClick:()=>t.chain().focus().setTextAlign("left").run(),active:t.isActive({textAlign:"left"}),ariaLabel:"Align left",children:e.jsx(O,{size:16})}),e.jsx(n,{onClick:()=>t.chain().focus().setTextAlign("center").run(),active:t.isActive({textAlign:"center"}),ariaLabel:"Align center",children:e.jsx(F,{size:16})}),e.jsx(n,{onClick:()=>t.chain().focus().setTextAlign("right").run(),active:t.isActive({textAlign:"right"}),ariaLabel:"Align right",children:e.jsx(B,{size:16})}),e.jsx(u,{}),e.jsx(n,{onClick:()=>t.chain().focus().toggleBulletList().run(),active:t.isActive("bulletList"),ariaLabel:"Bullet list",children:e.jsx(J,{size:16})}),e.jsx(n,{onClick:()=>t.chain().focus().toggleOrderedList().run(),active:t.isActive("orderedList"),ariaLabel:"Numbered list",children:e.jsx(G,{size:16})}),e.jsx(n,{onClick:()=>t.chain().focus().toggleBlockquote().run(),active:t.isActive("blockquote"),ariaLabel:"Quote",children:e.jsx(ee,{size:16})}),e.jsx(n,{onClick:()=>t.chain().focus().setHorizontalRule().run(),ariaLabel:"Horizontal rule",children:e.jsx(W,{size:16})}),e.jsx(u,{}),e.jsx(n,{onClick:d,active:t.isActive("link"),ariaLabel:"Link",children:e.jsx(Z,{size:16})}),e.jsx(n,{onClick:()=>l(!0),ariaLabel:"Insert image",children:e.jsx(K,{size:16})}),e.jsx(n,{onClick:()=>o(!0),ariaLabel:"Embed YouTube video",children:e.jsx(Y,{size:16})}),e.jsx(u,{}),e.jsx(n,{onClick:()=>t.chain().focus().undo().run(),disabled:!t.can().undo(),ariaLabel:"Undo",children:e.jsx(ie,{size:16})}),e.jsx(n,{onClick:()=>t.chain().focus().redo().run(),disabled:!t.can().redo(),ariaLabel:"Redo",children:e.jsx(te,{size:16})})]}),e.jsx(se,{open:c,onOpenChange:o,onSubmit:x}),e.jsx(V,{open:r,onOpenChange:l,onSelect:p})]})}function Me({value:t,onChange:c,placeholder:o="Start writing your post..."}){const r=y({extensions:[f.configure({heading:{levels:[1,2,3]},link:{openOnClick:!1,autolink:!0,HTMLAttributes:{rel:"noopener noreferrer",target:"_blank"}}}),m.configure({HTMLAttributes:{class:"rounded-2xl"}}),j.configure({controls:!0,nocookie:!0,modestBranding:!0}),v.configure({placeholder:o}),M.configure({types:["heading","paragraph"],alignments:["left","center","right"],defaultAlignment:"left"}),L,z],content:t,onUpdate:({editor:l})=>{c(l.getHTML())},editorProps:{attributes:{class:"prose prose-invert max-w-none min-h-[500px] px-6 py-6 focus:outline-none prose-headings:font-bold prose-headings:text-foreground prose-p:text-foreground/80 prose-p:leading-relaxed prose-strong:text-foreground prose-blockquote:border-l-primary prose-blockquote:text-foreground/70 prose-blockquote:not-italic prose-li:text-foreground/80 prose-hr:border-border"}}});return h.useEffect(()=>{if(!r)return;const l=r.getHTML();t!==l&&r.commands.setContent(t||"",{emitUpdate:!1})},[t,r]),e.jsxs("div",{className:"rounded-xl border border-border bg-card",children:[e.jsx(oe,{editor:r}),e.jsx(A,{editor:r})]})}export{Me as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.