@lyfie/luthor 2.4.0 → 2.5.0

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.
Files changed (44) hide show
  1. package/README.md +6 -4
  2. package/dist/LegacyRichEditor-Hzt4pYS-.d.ts +24 -0
  3. package/dist/chunk-4DOFRI6R.js +1 -0
  4. package/dist/chunk-7KHDV6HL.js +1 -0
  5. package/dist/chunk-I7ETX4BN.js +1 -0
  6. package/dist/{chunk-ONBHJIZQ.js → chunk-LG5WRRFQ.js} +3 -3
  7. package/dist/chunk-MYQMH4OW.js +1 -0
  8. package/dist/chunk-PAUOCZCW.js +1 -0
  9. package/dist/chunk-QCGA72CH.js +1 -0
  10. package/dist/chunk-YWKRMBRS.js +13 -0
  11. package/dist/{ExtensiveEditor-6OT-Dmr1.d.ts → index-BjlX1b8G.d.ts} +16 -2
  12. package/dist/{index-DZPcit31.d.ts → index-CtyjH6lX.d.ts} +1 -2
  13. package/dist/index.css +1 -1
  14. package/dist/index.d.ts +10 -8
  15. package/dist/index.js +1 -1
  16. package/dist/presets/compose/index.d.ts +1 -12
  17. package/dist/presets/compose/index.js +1 -1
  18. package/dist/presets/extensive/index.d.ts +2 -3
  19. package/dist/presets/extensive/index.js +1 -1
  20. package/dist/presets/headless-editor/index.d.ts +13 -6
  21. package/dist/presets/headless-editor/index.js +1 -1
  22. package/dist/presets/html-editor/index.d.ts +18 -0
  23. package/dist/presets/html-editor/index.js +1 -0
  24. package/dist/presets/legacy-rich/index.d.ts +8 -0
  25. package/dist/presets/legacy-rich/index.js +1 -0
  26. package/dist/presets/md-editor/index.d.ts +19 -0
  27. package/dist/presets/md-editor/index.js +1 -0
  28. package/dist/presets/{composer → simple-editor}/index.d.ts +14 -15
  29. package/dist/presets/simple-editor/index.js +1 -0
  30. package/dist/presets/slash-editor/index.d.ts +16 -0
  31. package/dist/presets/slash-editor/index.js +1 -0
  32. package/package.json +4 -4
  33. package/dist/chunk-42NSZXCX.js +0 -1
  34. package/dist/chunk-AHHU2IZS.js +0 -1
  35. package/dist/chunk-MDSRHDWB.js +0 -1
  36. package/dist/chunk-MGWT45KA.js +0 -1
  37. package/dist/chunk-TRGIRBLU.js +0 -1
  38. package/dist/chunk-VITE7CVN.js +0 -1
  39. package/dist/index-BtdZVw3X.d.ts +0 -17
  40. package/dist/presets/composer/index.js +0 -1
  41. package/dist/presets/md-friendly/index.d.ts +0 -19
  42. package/dist/presets/md-friendly/index.js +0 -1
  43. package/dist/presets/notion-like/index.d.ts +0 -17
  44. package/dist/presets/notion-like/index.js +0 -1
@@ -0,0 +1,19 @@
1
+ import * as react from 'react';
2
+ import { a as ExtensiveEditorRef, n as EditorPreset } from '../../index-BjlX1b8G.js';
3
+ import { b as LegacyRichEditorProps, a as LegacyRichEditorMode } from '../../LegacyRichEditor-Hzt4pYS-.js';
4
+ import '@lyfie/luthor-headless';
5
+
6
+ type MDEditorMode = Exclude<LegacyRichEditorMode, "html">;
7
+ type MDEditorView = MDEditorMode;
8
+ type MDEditorProps = Omit<LegacyRichEditorProps, "sourceFormat" | "initialMode" | "defaultEditorView"> & {
9
+ initialMode?: MDEditorMode;
10
+ defaultEditorView?: MDEditorView;
11
+ };
12
+ declare const MDEditor: react.ForwardRefExoticComponent<Omit<LegacyRichEditorProps, "initialMode" | "defaultEditorView" | "sourceFormat"> & {
13
+ initialMode?: MDEditorMode;
14
+ defaultEditorView?: MDEditorView;
15
+ } & react.RefAttributes<ExtensiveEditorRef>>;
16
+
17
+ declare const mdEditorPreset: EditorPreset;
18
+
19
+ export { MDEditor, type MDEditorMode, type MDEditorProps, mdEditorPreset };
@@ -0,0 +1 @@
1
+ export{a as MDEditor,b as mdEditorPreset}from'../../chunk-MYQMH4OW.js';import'../../chunk-I7ETX4BN.js';import'../../chunk-LG5WRRFQ.js';
@@ -1,23 +1,22 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode, CSSProperties } from 'react';
3
3
  import { LuthorTheme } from '@lyfie/luthor-headless';
4
- import { o as ExtensiveEditorProps } from '../../ExtensiveEditor-6OT-Dmr1.js';
5
- import { E as EditorPreset } from '../../index-BtdZVw3X.js';
4
+ import { E as ExtensiveEditorProps, n as EditorPreset } from '../../index-BjlX1b8G.js';
6
5
 
7
6
  type SizeValue = number | string;
8
- type ComposerOutputFormat = "md" | "json";
9
- type ComposerEditorSendPayload = {
10
- format: ComposerOutputFormat;
7
+ type SimpleEditorOutputFormat = "md" | "json";
8
+ type SimpleEditorSendPayload = {
9
+ format: SimpleEditorOutputFormat;
11
10
  text: string;
12
11
  markdown: string;
13
12
  json: string;
14
13
  };
15
- type ComposerFormattingOptions = {
14
+ type SimpleFormattingOptions = {
16
15
  bold?: boolean;
17
16
  italic?: boolean;
18
17
  strikethrough?: boolean;
19
18
  };
20
- type ComposerToolbarButton = {
19
+ type SimpleToolbarButton = {
21
20
  id: string;
22
21
  content: ReactNode;
23
22
  ariaLabel: string;
@@ -26,7 +25,7 @@ type ComposerToolbarButton = {
26
25
  title?: string;
27
26
  className?: string;
28
27
  };
29
- type ComposerEditorProps = {
28
+ type SimpleEditorProps = {
30
29
  className?: string;
31
30
  variantClassName?: string;
32
31
  initialTheme?: "light" | "dark";
@@ -35,9 +34,9 @@ type ComposerEditorProps = {
35
34
  defaultContent?: string;
36
35
  showDefaultContent?: boolean;
37
36
  placeholder?: ExtensiveEditorProps["placeholder"];
38
- formattingOptions?: ComposerFormattingOptions;
39
- onSend?: (payload: ComposerEditorSendPayload) => void;
40
- outputFormat?: ComposerOutputFormat;
37
+ formattingOptions?: SimpleFormattingOptions;
38
+ onSend?: (payload: SimpleEditorSendPayload) => void;
39
+ outputFormat?: SimpleEditorOutputFormat;
41
40
  clearOnSend?: boolean;
42
41
  allowEmptySend?: boolean;
43
42
  submitOnEnter?: boolean;
@@ -47,7 +46,7 @@ type ComposerEditorProps = {
47
46
  minWidth?: SizeValue;
48
47
  maxWidth?: SizeValue;
49
48
  showBottomToolbar?: boolean;
50
- toolbarButtons?: readonly ComposerToolbarButton[];
49
+ toolbarButtons?: readonly SimpleToolbarButton[];
51
50
  toolbarClassName?: string;
52
51
  toolbarStyle?: CSSProperties;
53
52
  showSendButton?: boolean;
@@ -57,8 +56,8 @@ type ComposerEditorProps = {
57
56
  sendButtonClassName?: string;
58
57
  scrollAreaClassName?: string;
59
58
  };
60
- declare function ComposerEditor({ className, variantClassName, initialTheme, onThemeChange, theme, defaultContent, showDefaultContent, placeholder, formattingOptions, onSend, outputFormat, clearOnSend, allowEmptySend, submitOnEnter, allowShiftEnter, minHeight, maxHeight, minWidth, maxWidth, showBottomToolbar, toolbarButtons, toolbarClassName, toolbarStyle, showSendButton, sendButtonPlacement, sendButtonContent, sendButtonAriaLabel, sendButtonClassName, scrollAreaClassName, }: ComposerEditorProps): react_jsx_runtime.JSX.Element;
59
+ declare function SimpleEditor({ className, variantClassName, initialTheme, onThemeChange, theme, defaultContent, showDefaultContent, placeholder, formattingOptions, onSend, outputFormat, clearOnSend, allowEmptySend, submitOnEnter, allowShiftEnter, minHeight, maxHeight, minWidth, maxWidth, showBottomToolbar, toolbarButtons, toolbarClassName, toolbarStyle, showSendButton, sendButtonPlacement, sendButtonContent, sendButtonAriaLabel, sendButtonClassName, scrollAreaClassName, }: SimpleEditorProps): react_jsx_runtime.JSX.Element;
61
60
 
62
- declare const composerPreset: EditorPreset;
61
+ declare const simpleEditorPreset: EditorPreset;
63
62
 
64
- export { ComposerEditor, type ComposerEditorProps, type ComposerEditorSendPayload, type ComposerFormattingOptions, type ComposerOutputFormat, type ComposerToolbarButton, composerPreset };
63
+ export { SimpleEditor, type SimpleEditorOutputFormat, type SimpleEditorProps, type SimpleEditorSendPayload, type SimpleFormattingOptions, type SimpleToolbarButton, simpleEditorPreset };
@@ -0,0 +1 @@
1
+ export{a as SimpleEditor,b as simpleEditorPreset}from'../../chunk-QCGA72CH.js';import'../../chunk-LG5WRRFQ.js';
@@ -0,0 +1,16 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { E as ExtensiveEditorProps, x as SlashCommandVisibility, F as FeatureFlagOverrides, n as EditorPreset } from '../../index-BjlX1b8G.js';
3
+ import 'react';
4
+ import '@lyfie/luthor-headless';
5
+
6
+ type SlashEditorProps = Omit<ExtensiveEditorProps, "featureFlags" | "isToolbarEnabled"> & {
7
+ slashVisibility?: SlashCommandVisibility;
8
+ isDraggableEnabled?: boolean;
9
+ featureFlags?: FeatureFlagOverrides;
10
+ isToolbarEnabled?: boolean;
11
+ };
12
+ declare function SlashEditor({ className, variantClassName, slashVisibility, isDraggableEnabled, featureFlags, isToolbarEnabled, ...props }: SlashEditorProps): react_jsx_runtime.JSX.Element;
13
+
14
+ declare const slashEditorPreset: EditorPreset;
15
+
16
+ export { SlashEditor, type SlashEditorProps, slashEditorPreset };
@@ -0,0 +1 @@
1
+ export{a as SlashEditor,b as slashEditorPreset}from'../../chunk-PAUOCZCW.js';import'../../chunk-LG5WRRFQ.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyfie/luthor",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Luthor presets and plug-and-play configuration for the headless editor",
5
5
  "type": "module",
6
6
  "private": false,
@@ -58,7 +58,7 @@
58
58
  "@lexical/table": "^0.40.0",
59
59
  "@lexical/utils": "^0.40.0",
60
60
  "lexical": "^0.40.0",
61
- "@lyfie/luthor-headless": "2.4.0"
61
+ "@lyfie/luthor-headless": "2.5.0"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@types/node": "^20.19.33",
@@ -71,8 +71,8 @@
71
71
  "tsup": "^8.0.0",
72
72
  "typescript": "^5.7.3",
73
73
  "vitest": "^3.2.4",
74
- "@repo/typescript-config": "0.0.0",
75
- "@repo/eslint-config": "0.0.0"
74
+ "@repo/eslint-config": "0.0.0",
75
+ "@repo/typescript-config": "0.0.0"
76
76
  },
77
77
  "peerDependencies": {
78
78
  "react": "^18.0.0 || ^19.0.0",
@@ -1 +0,0 @@
1
- import {qa,ya,Ca,Ba,za,Aa,ha}from'./chunk-ONBHJIZQ.js';import {a}from'./chunk-MDSRHDWB.js';import {useRef,useState}from'react';import {jsonToMarkdown,markdownToJSON}from'@lyfie/luthor-headless';import {jsxs,jsx}from'react/jsx-runtime';function p({className:C,variantClassName:x,initialMode:V="visual",defaultEditorView:P,isEditorViewTabsVisible:S,isEditorViewsTabVisible:T,...O}){let a=useRef(null),i=useRef(ya(["visual"])),s=useRef(""),n=useRef(null),R=(P??V)==="markdown"?"markdown":"visual",J=S??T??true,[o,j]=useState(R),[y,l]=useState(""),[E,M]=useState(null),v=e=>{if(e!==o)try{if(M(null),e==="markdown")if(Aa(i.current,"markdown"))l(s.current);else {let r=a.current?.getJSON()??"",u=r?JSON.parse(r):void 0,w=ha(jsonToMarkdown(u));s.current=w,l(w),Ba(i.current,"markdown");}if(e==="visual"){let r=markdownToJSON(y);n.current=JSON.stringify(r);}j(e),e==="visual"&&setTimeout(()=>{n.current&&(a.current?.injectJSON(n.current),n.current=null);},0);}catch(r){let u=r instanceof Error?r.message:"Failed to parse markdown";M(u);}};return jsxs("div",{className:["luthor-preset-md-friendly",C].filter(Boolean).join(" "),onInputCapture:()=>{o==="visual"&&za(i.current,["visual"]);},children:[J&&jsxs("div",{className:"luthor-md-friendly-tabs",children:[jsx("button",{type:"button",className:o==="visual"?"active":"",onClick:()=>v("visual"),children:"Visual"}),jsx("button",{type:"button",className:o==="markdown"?"active":"",onClick:()=>v("markdown"),children:"Markdown"})]}),o==="visual"&&jsx(Ca,{ref:a,...O,className:"luthor-preset-md-friendly__editor",variantClassName:["luthor-preset-md-friendly__variant",x].filter(Boolean).join(" "),availableModes:["visual"],initialMode:"visual",featureFlags:{table:false,image:false,iframeEmbed:false,youTubeEmbed:false,customNode:false}}),o==="markdown"&&jsxs("div",{className:"luthor-md-friendly-source-shell",children:[jsx("textarea",{className:"luthor-md-friendly-source",value:y,onChange:e=>{l(e.target.value),s.current=e.target.value,Ba(i.current,"markdown");},placeholder:"Write markdown..."}),E&&jsx("p",{className:"luthor-md-friendly-error",children:E})]})]})}var q={id:"md-friendly",label:"MD Editor",description:"Visual and markdown editing with conversion bridge.",extensions:qa({featureFlags:{table:false,image:false,iframeEmbed:false,youTubeEmbed:false,customNode:false}}),components:{Editor:p},toolbar:["bold","italic","underline","strikethrough","link","unorderedList","orderedList"],config:a("md-friendly","Write markdown..."),css:"md-friendly/styles.css"};export{p as a,q as b};
@@ -1 +0,0 @@
1
- import {a}from'./chunk-MDSRHDWB.js';import {createEditorSystem,richTextExtension,historyExtension,boldExtension,italicExtension,underlineExtension,listExtension,RichText}from'@lyfie/luthor-headless';import {jsx,jsxs}from'react/jsx-runtime';var h=[richTextExtension,historyExtension,boldExtension,italicExtension,underlineExtension,listExtension],{Provider:E,useEditor:m}=createEditorSystem();function P(){let{commands:t,activeStates:o}=m();return jsxs("div",{className:"luthor-headless-controls",role:"toolbar","aria-label":"Headless editor controls",children:[jsx("button",{type:"button",onClick:()=>t.toggleBold?.(),"aria-pressed":o.bold===true,children:"bold"}),jsx("button",{type:"button",onClick:()=>t.toggleItalic?.(),"aria-pressed":o.italic===true,children:"italic"}),jsx("button",{type:"button",onClick:()=>t.toggleUnderline?.(),"aria-pressed":o.underline===true,children:"underline"}),jsx("button",{type:"button",onClick:()=>t.toggleUnorderedList?.(),children:"bullet list"}),jsx("button",{type:"button",onClick:()=>t.undo?.(),children:"undo"}),jsx("button",{type:"button",onClick:()=>t.redo?.(),children:"redo"})]})}function s({className:t,placeholder:o="Start writing..."}){return jsx("div",{className:["luthor-headless-preset",t].filter(Boolean).join(" "),children:jsxs(E,{extensions:h,children:[jsx(P,{}),jsx(RichText,{placeholder:o,classNames:{container:"luthor-headless-editor-container",contentEditable:"luthor-headless-editor-content",placeholder:"luthor-headless-editor-placeholder"}})]})})}var x={id:"headless-editor",label:"Headless Text Input",description:"Minimal preset for custom extension and UI composition.",components:{Editor:s},toolbar:["bold","italic","underline","unorderedList","undo","redo"],config:a("headless-editor","Start writing..."),css:"headless-editor/styles.css"};export{s as a,x as b};
@@ -1 +0,0 @@
1
- function o(t,r){let e=`luthor-preset-${t}`;return {placeholder:r,classNames:{container:`luthor-preset ${e} ${e}__container`,contentEditable:`luthor-content-editable ${e}__content`,placeholder:`luthor-placeholder ${e}__placeholder`}}}export{o as a};
@@ -1 +0,0 @@
1
- import {qa,Ca,ha}from'./chunk-ONBHJIZQ.js';import {a}from'./chunk-MDSRHDWB.js';import {jsonToMarkdown}from'@lyfie/luthor-headless';import {useRef,useState,useMemo,useCallback,useEffect}from'react';import {jsx,jsxs}from'react/jsx-runtime';var W=JSON.stringify({root:{children:[{children:[{detail:0,format:0,mode:"normal",style:"",text:"",type:"text",version:1}],direction:null,format:"",indent:0,type:"paragraph",version:1}],direction:null,format:"",indent:0,type:"root",version:1}});function N(o){return typeof o=="number"?`${o}px`:o}function D(o,s){if(typeof o=="number"&&Number.isFinite(o))return o;if(typeof o=="string"){let a=o.trim();if(a.length===0)return s;let g=Number.parseFloat(a.replace("px",""));if(Number.isFinite(g))return g}return s}function me(o){try{let s=o?JSON.parse(o):void 0;return ha(jsonToMarkdown(s))}catch{return ""}}function Z(o,s,a){return a<=s?s:Math.min(a,Math.max(s,o))}function de(o,s,a){o.focus();let P=Array.from(o.children).filter(i=>i instanceof HTMLElement).reduce((i,r)=>{let u=r.getBoundingClientRect(),M=u.top+u.height/2;if(!i)return r;let y=i.getBoundingClientRect(),L=y.top+y.height/2;return Math.abs(M-a)<Math.abs(L-a)?r:i},null)??o.firstElementChild??o,x=o.getBoundingClientRect(),S=P.getBoundingClientRect(),l=Z(s,x.left+1,x.right-1),m=Z(a,S.top+1,S.bottom-1),c=document,d=c.caretPositionFromPoint?.(l,m);if(d){let i=window.getSelection();if(!i)return;let r=document.createRange();r.setStart(d.offsetNode,d.offset),r.collapse(true),i.removeAllRanges(),i.addRange(r);return}let f=c.caretRangeFromPoint?.(l,m);if(!f)return;let p=window.getSelection();p&&(f.collapse(true),p.removeAllRanges(),p.addRange(f));}function j({className:o,variantClassName:s,initialTheme:a,onThemeChange:g,theme:z,defaultContent:P,showDefaultContent:x=false,placeholder:S,formattingOptions:l,onSend:m,outputFormat:c="md",clearOnSend:d=true,allowEmptySend:f=false,submitOnEnter:p=false,allowShiftEnter:i=true,minHeight:r=56,maxHeight:u=220,minWidth:M=240,maxWidth:y="100%",showBottomToolbar:L=true,toolbarButtons:te=[],toolbarClassName:oe,toolbarStyle:re,showSendButton:R=true,sendButtonPlacement:w="inside",sendButtonContent:K="Send",sendButtonAriaLabel:I="Send message",sendButtonClassName:V,scrollAreaClassName:B}){let F=useRef(null),C=useRef(null),[J,ne]=useState(()=>D(r,56)),q=useMemo(()=>D(r,56),[r]),A=useMemo(()=>D(u,220),[u]),O=useMemo(()=>({bold:l?.bold!==false,italic:l?.italic!==false,strikethrough:l?.strikethrough!==false}),[l]),se=useMemo(()=>({disabledCommandIds:["history.undo","history.redo"],bindings:{"format.bold":[{key:"b",ctrlKey:true},{key:"b",metaKey:true}],"format.italic":[{key:"i",ctrlKey:true},{key:"i",metaKey:true}],"format.strikethrough":[{key:"x",ctrlKey:true,shiftKey:true},{key:"x",metaKey:true,shiftKey:true}],"format.code":false,"block.codeblock":false}}),[]),_=useCallback(()=>{let e=F.current?.getJSON()??W,t=me(e);return {json:e,markdown:t,text:c==="json"?e:t}},[c]),T=useCallback(()=>{if(!m)return;let e=_();!f&&!e.markdown.trim()||(m({format:c,text:e.text,markdown:e.markdown,json:e.json}),d&&F.current?.injectJSON(W));},[f,d,m,c,_]),h=useCallback(()=>{let e=C.current;if(!e)return;let t=e.querySelector(".luthor-content-editable");if(!t)return;let n=Math.max(q,Math.min(A,t.scrollHeight));ne(n);},[A,q]),ie=useCallback(e=>{!p||e.key!=="Enter"||e.nativeEvent.isComposing||e.shiftKey&&i||(e.preventDefault(),T());},[i,T,p]),ae=useCallback(e=>{let t=e.target;if(t.closest("button, a, input, textarea, [contenteditable='true']")||t.closest(".luthor-composer-bottom-toolbar"))return;let E=C.current?.querySelector(".luthor-content-editable");E&&(e.preventDefault(),de(E,e.clientX,e.clientY));},[]);useEffect(()=>{h();},[h]),useEffect(()=>{let e=C.current;if(!e)return;let t=e.querySelector(".luthor-content-editable");if(!t)return;let n=()=>h();t.addEventListener("input",n),t.addEventListener("keyup",n),t.addEventListener("paste",n);let E=typeof ResizeObserver<"u"?new ResizeObserver(()=>h()):null;E?.observe(t);let Y=new MutationObserver(()=>h());return Y.observe(t,{childList:true,subtree:true,characterData:true}),()=>{t.removeEventListener("input",n),t.removeEventListener("keyup",n),t.removeEventListener("paste",n),E?.disconnect(),Y.disconnect();}},[h]),useEffect(()=>{let t=C.current?.querySelector(".luthor-richtext-container");if(!t||!B)return;let n=B.split(/\s+/).filter(Boolean);if(n.length!==0)return t.classList.add(...n),()=>{t.classList.remove(...n);}},[B]);let le=useMemo(()=>({"--luthor-composer-min-height":N(r),"--luthor-composer-max-height":N(u),"--luthor-composer-current-height":`${J}px`,"--luthor-composer-min-width":N(M),"--luthor-composer-max-width":N(y)}),[J,u,y,r,M]);return jsx("div",{ref:C,className:["luthor-preset-composer",R&&w==="inside"?"luthor-preset-composer--send-inside":"",o].filter(Boolean).join(" "),style:le,onKeyDownCapture:ie,onMouseDownCapture:ae,children:jsxs("div",{className:"luthor-composer-row",children:[jsxs("div",{className:"luthor-composer-shell",children:[jsx(Ca,{ref:F,initialTheme:a,onThemeChange:g,theme:z,defaultContent:P,showDefaultContent:x,placeholder:S,variantClassName:["luthor-preset-composer__variant",s].filter(Boolean).join(" "),isToolbarEnabled:false,availableModes:["visual"],initialMode:"visual",shortcutConfig:se,featureFlags:{bold:O.bold,italic:O.italic,underline:false,strikethrough:O.strikethrough,fontFamily:false,fontSize:false,lineHeight:false,textColor:false,textHighlight:false,subscript:false,superscript:false,link:false,horizontalRule:false,table:false,list:false,image:false,blockFormat:false,code:false,codeIntelligence:false,codeFormat:false,iframeEmbed:false,youTubeEmbed:false,floatingToolbar:false,contextMenu:false,commandPalette:false,slashCommand:false,emoji:false,draggableBlock:false,customNode:false,themeToggle:false,history:false}}),R&&w==="inside"&&jsx("button",{type:"button",className:["luthor-composer-action","luthor-composer-action-send","luthor-composer-action-send--inside",V].filter(Boolean).join(" "),"data-testid":"composer-send-button",onClick:T,"aria-label":I,children:K}),L&&jsx("div",{className:["luthor-composer-bottom-toolbar",oe].filter(Boolean).join(" "),style:re,"data-testid":"composer-actions",children:te.map(e=>jsx("button",{type:"button",className:["luthor-composer-action",e.className].filter(Boolean).join(" "),"aria-label":e.ariaLabel,disabled:e.disabled,title:e.title,onClick:e.onClick,children:e.content},e.id))})]}),R&&w==="right"&&jsx("button",{type:"button",className:["luthor-composer-action","luthor-composer-action-send","luthor-composer-action-send--right",V].filter(Boolean).join(" "),"data-testid":"composer-send-button",onClick:T,"aria-label":I,children:K})]})})}var fe={id:"composer",label:"Simple Text Input",description:"Message composer with constrained formatting and send controls.",extensions:qa({featureFlags:{bold:true,italic:true,underline:false,strikethrough:true,table:false,image:false,blockFormat:false,code:false,codeIntelligence:false,codeFormat:false,list:false,iframeEmbed:false,youTubeEmbed:false,commandPalette:false,slashCommand:false,draggableBlock:false,customNode:false,history:false}}),components:{Editor:j},toolbar:[],config:a("composer","Type your message..."),css:"composer/styles.css"};export{j as a,fe as b};
@@ -1 +0,0 @@
1
- import {Ca,qa}from'./chunk-ONBHJIZQ.js';import {a}from'./chunk-MDSRHDWB.js';import {forwardRef}from'react';import {jsxs,jsx}from'react/jsx-runtime';var w={bold:true,italic:true,underline:true,strikethrough:true,list:true,history:true,link:true,blockFormat:true,codeFormat:true,image:false,table:false,iframeEmbed:false,youTubeEmbed:false,emoji:false,floatingToolbar:false,contextMenu:false,commandPalette:false,slashCommand:false,draggableBlock:false,customNode:false},t=forwardRef(({className:d,variantClassName:u,compactToolbar:s=false,toolbarClassName:f,featureFlags:b,showRecipients:a=false,showTo:E=false,showCc:r=false,showBcc:l=false,showSubject:h=false,...v},y)=>{let i=a||E,p=a||h,x=i||r||l||p;return jsxs("div",{className:["luthor-preset-compose",d].filter(Boolean).join(" "),children:[x&&jsxs("div",{className:"luthor-compose-shell",children:[i&&jsxs("label",{className:"luthor-compose-row","data-testid":"compose-row-to",children:[jsx("span",{children:"To"}),jsx("input",{type:"text",readOnly:true,value:""})]}),r&&jsxs("label",{className:"luthor-compose-row","data-testid":"compose-row-cc",children:[jsx("span",{children:"Cc"}),jsx("input",{type:"text",readOnly:true,value:""})]}),l&&jsxs("label",{className:"luthor-compose-row","data-testid":"compose-row-bcc",children:[jsx("span",{children:"Bcc"}),jsx("input",{type:"text",readOnly:true,value:""})]}),p&&jsxs("label",{className:"luthor-compose-row","data-testid":"compose-row-subject",children:[jsx("span",{children:"Subject"}),jsx("input",{type:"text",readOnly:true,value:""})]})]}),jsx(Ca,{ref:y,...v,className:"luthor-preset-compose__editor",variantClassName:[s?"luthor-preset-compose--compact":"","luthor-preset-compose__variant",u].filter(Boolean).join(" "),toolbarClassName:[s?"luthor-preset-compose__toolbar--compact":"",f].filter(Boolean).join(" "),availableModes:["visual","json"],featureFlags:{...w,...b??{}}})]})});t.displayName="ComposeEditor";var F={id:"compose",label:"Rich Text Input",description:"Focused rich text composer with optional recipient rows.",extensions:qa({featureFlags:{image:false,table:false,iframeEmbed:false,youTubeEmbed:false,emoji:true,commandPalette:false,slashCommand:false,draggableBlock:false,customNode:false}}),components:{Editor:t},toolbar:["bold","italic","underline","strikethrough","link","unorderedList","orderedList","checkList","undo","redo"],config:a("compose","Write your draft..."),css:"compose/styles.css"};export{t as a,F as b};
@@ -1 +0,0 @@
1
- import {qa,Ca}from'./chunk-ONBHJIZQ.js';import {a}from'./chunk-MDSRHDWB.js';import {jsx}from'react/jsx-runtime';var f={slashCommand:true,draggableBlock:true,commandPalette:true,floatingToolbar:false,contextMenu:false};function o({className:r,variantClassName:a,slashVisibility:s,isDraggableEnabled:l=true,featureFlags:n,isToolbarEnabled:d=false,...m}){return jsx(Ca,{...m,className:["luthor-preset-notion-like",r].filter(Boolean).join(" "),variantClassName:["luthor-preset-notion-like__variant",a].filter(Boolean).join(" "),availableModes:["visual","json"],isToolbarEnabled:d,slashCommandVisibility:s,featureFlags:{...f,draggableBlock:l,...n??{}}})}var b={id:"notion-like",label:"Slash Editor",description:"Slash-first writing with draggable block defaults.",extensions:qa({featureFlags:{slashCommand:true,draggableBlock:true,floatingToolbar:false,contextMenu:false}}),components:{Editor:o},toolbar:[],config:a("notion-like","Type '/' for commands..."),css:"notion-like/styles.css"};export{o as a,b};
@@ -1,17 +0,0 @@
1
- import { Extension, EditorConfig, LuthorTheme } from '@lyfie/luthor-headless';
2
-
3
- interface EditorPreset {
4
- id: string;
5
- label: string;
6
- description?: string;
7
- extensions?: Extension[];
8
- config?: EditorConfig;
9
- theme?: LuthorTheme;
10
- toolbar?: string[];
11
- components?: Record<string, unknown>;
12
- css?: string;
13
- }
14
-
15
- declare const presetRegistry: Record<string, EditorPreset>;
16
-
17
- export { type EditorPreset as E, presetRegistry as p };
@@ -1 +0,0 @@
1
- export{a as ComposerEditor,b as composerPreset}from'../../chunk-MGWT45KA.js';import'../../chunk-ONBHJIZQ.js';import'../../chunk-MDSRHDWB.js';
@@ -1,19 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { o as ExtensiveEditorProps } from '../../ExtensiveEditor-6OT-Dmr1.js';
3
- import { E as EditorPreset } from '../../index-BtdZVw3X.js';
4
- import 'react';
5
- import '@lyfie/luthor-headless';
6
-
7
- type MDFriendlyEditorMode = "visual" | "markdown";
8
- type MDFriendlyEditorView = "visual" | "json" | "markdown" | "html";
9
- type MDFriendlyEditorProps = Omit<ExtensiveEditorProps, "availableModes" | "initialMode"> & {
10
- initialMode?: MDFriendlyEditorMode;
11
- defaultEditorView?: MDFriendlyEditorView;
12
- isEditorViewTabsVisible?: boolean;
13
- isEditorViewsTabVisible?: boolean;
14
- };
15
- declare function MDFriendlyEditor({ className, variantClassName, initialMode, defaultEditorView, isEditorViewTabsVisible, isEditorViewsTabVisible, ...props }: MDFriendlyEditorProps): react_jsx_runtime.JSX.Element;
16
-
17
- declare const mdFriendlyPreset: EditorPreset;
18
-
19
- export { MDFriendlyEditor, type MDFriendlyEditorMode, type MDFriendlyEditorProps, mdFriendlyPreset };
@@ -1 +0,0 @@
1
- export{a as MDFriendlyEditor,b as mdFriendlyPreset}from'../../chunk-42NSZXCX.js';import'../../chunk-ONBHJIZQ.js';import'../../chunk-MDSRHDWB.js';
@@ -1,17 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { o as ExtensiveEditorProps, w as SlashCommandVisibility, r as FeatureFlagOverrides } from '../../ExtensiveEditor-6OT-Dmr1.js';
3
- import { E as EditorPreset } from '../../index-BtdZVw3X.js';
4
- import 'react';
5
- import '@lyfie/luthor-headless';
6
-
7
- type NotionLikeEditorProps = Omit<ExtensiveEditorProps, "featureFlags" | "isToolbarEnabled"> & {
8
- slashVisibility?: SlashCommandVisibility;
9
- isDraggableEnabled?: boolean;
10
- featureFlags?: FeatureFlagOverrides;
11
- isToolbarEnabled?: boolean;
12
- };
13
- declare function NotionLikeEditor({ className, variantClassName, slashVisibility, isDraggableEnabled, featureFlags, isToolbarEnabled, ...props }: NotionLikeEditorProps): react_jsx_runtime.JSX.Element;
14
-
15
- declare const notionLikePreset: EditorPreset;
16
-
17
- export { NotionLikeEditor, type NotionLikeEditorProps, notionLikePreset };
@@ -1 +0,0 @@
1
- export{a as NotionLikeEditor,b as notionLikePreset}from'../../chunk-VITE7CVN.js';import'../../chunk-ONBHJIZQ.js';import'../../chunk-MDSRHDWB.js';