@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.
- package/README.md +6 -4
- package/dist/LegacyRichEditor-Hzt4pYS-.d.ts +24 -0
- package/dist/chunk-4DOFRI6R.js +1 -0
- package/dist/chunk-7KHDV6HL.js +1 -0
- package/dist/chunk-I7ETX4BN.js +1 -0
- package/dist/{chunk-ONBHJIZQ.js → chunk-LG5WRRFQ.js} +3 -3
- package/dist/chunk-MYQMH4OW.js +1 -0
- package/dist/chunk-PAUOCZCW.js +1 -0
- package/dist/chunk-QCGA72CH.js +1 -0
- package/dist/chunk-YWKRMBRS.js +13 -0
- package/dist/{ExtensiveEditor-6OT-Dmr1.d.ts → index-BjlX1b8G.d.ts} +16 -2
- package/dist/{index-DZPcit31.d.ts → index-CtyjH6lX.d.ts} +1 -2
- package/dist/index.css +1 -1
- package/dist/index.d.ts +10 -8
- package/dist/index.js +1 -1
- package/dist/presets/compose/index.d.ts +1 -12
- package/dist/presets/compose/index.js +1 -1
- package/dist/presets/extensive/index.d.ts +2 -3
- package/dist/presets/extensive/index.js +1 -1
- package/dist/presets/headless-editor/index.d.ts +13 -6
- package/dist/presets/headless-editor/index.js +1 -1
- package/dist/presets/html-editor/index.d.ts +18 -0
- package/dist/presets/html-editor/index.js +1 -0
- package/dist/presets/legacy-rich/index.d.ts +8 -0
- package/dist/presets/legacy-rich/index.js +1 -0
- package/dist/presets/md-editor/index.d.ts +19 -0
- package/dist/presets/md-editor/index.js +1 -0
- package/dist/presets/{composer → simple-editor}/index.d.ts +14 -15
- package/dist/presets/simple-editor/index.js +1 -0
- package/dist/presets/slash-editor/index.d.ts +16 -0
- package/dist/presets/slash-editor/index.js +1 -0
- package/package.json +4 -4
- package/dist/chunk-42NSZXCX.js +0 -1
- package/dist/chunk-AHHU2IZS.js +0 -1
- package/dist/chunk-MDSRHDWB.js +0 -1
- package/dist/chunk-MGWT45KA.js +0 -1
- package/dist/chunk-TRGIRBLU.js +0 -1
- package/dist/chunk-VITE7CVN.js +0 -1
- package/dist/index-BtdZVw3X.d.ts +0 -17
- package/dist/presets/composer/index.js +0 -1
- package/dist/presets/md-friendly/index.d.ts +0 -19
- package/dist/presets/md-friendly/index.js +0 -1
- package/dist/presets/notion-like/index.d.ts +0 -17
- package/dist/presets/notion-like/index.js +0 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<div align="center">
|
|
8
8
|
|
|
9
|
-
[](https://github.com/lyfie-org/luthor)
|
|
10
10
|
[](https://github.com/lyfie-org/luthor/releases)
|
|
11
11
|
|
|
12
12
|
[](https://www.npmjs.com/package/@lyfie/luthor)
|
|
@@ -51,9 +51,11 @@ export function App() {
|
|
|
51
51
|
|
|
52
52
|
- `ExtensiveEditor`
|
|
53
53
|
- `ComposeEditor`
|
|
54
|
-
- `
|
|
55
|
-
- `
|
|
56
|
-
- `
|
|
54
|
+
- `SimpleEditor`
|
|
55
|
+
- `MDEditor`
|
|
56
|
+
- `HTMLEditor`
|
|
57
|
+
- `LegacyRichEditor`
|
|
58
|
+
- `SlashEditor`
|
|
57
59
|
- `HeadlessEditorPreset`
|
|
58
60
|
|
|
59
61
|
## Compatibility
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { E as ExtensiveEditorProps, F as FeatureFlagOverrides, a as ExtensiveEditorRef, T as ToolbarLayout } from './index-BjlX1b8G.js';
|
|
3
|
+
|
|
4
|
+
declare const LEGACY_RICH_MARKDOWN_MODES: readonly ["visual", "json", "markdown"];
|
|
5
|
+
declare const LEGACY_RICH_HTML_MODES: readonly ["visual", "json", "html"];
|
|
6
|
+
declare const LEGACY_RICH_DUAL_SOURCE_MODES: readonly ["visual", "markdown", "html"];
|
|
7
|
+
type LegacyRichSourceFormat = "markdown" | "html" | "both";
|
|
8
|
+
type LegacyRichEditorMode = (typeof LEGACY_RICH_MARKDOWN_MODES)[number] | (typeof LEGACY_RICH_HTML_MODES)[number] | (typeof LEGACY_RICH_DUAL_SOURCE_MODES)[number];
|
|
9
|
+
declare const LEGACY_RICH_DEFAULT_FEATURE_FLAGS: FeatureFlagOverrides;
|
|
10
|
+
declare const LEGACY_RICH_TOOLBAR_LAYOUT: ToolbarLayout;
|
|
11
|
+
type LegacyRichEditorProps = Omit<ExtensiveEditorProps, "featureFlags" | "availableModes" | "initialMode" | "defaultEditorView"> & {
|
|
12
|
+
sourceFormat?: LegacyRichSourceFormat;
|
|
13
|
+
initialMode?: LegacyRichEditorMode;
|
|
14
|
+
defaultEditorView?: LegacyRichEditorMode;
|
|
15
|
+
featureFlags?: FeatureFlagOverrides;
|
|
16
|
+
};
|
|
17
|
+
declare const LegacyRichEditor: react.ForwardRefExoticComponent<Omit<ExtensiveEditorProps, "availableModes" | "featureFlags" | "initialMode" | "defaultEditorView"> & {
|
|
18
|
+
sourceFormat?: LegacyRichSourceFormat;
|
|
19
|
+
initialMode?: LegacyRichEditorMode;
|
|
20
|
+
defaultEditorView?: LegacyRichEditorMode;
|
|
21
|
+
featureFlags?: FeatureFlagOverrides;
|
|
22
|
+
} & react.RefAttributes<ExtensiveEditorRef>>;
|
|
23
|
+
|
|
24
|
+
export { LegacyRichEditor as L, type LegacyRichEditorMode as a, type LegacyRichEditorProps as b, type LegacyRichSourceFormat as c, LEGACY_RICH_DEFAULT_FEATURE_FLAGS as d, LEGACY_RICH_DUAL_SOURCE_MODES as e, LEGACY_RICH_HTML_MODES as f, LEGACY_RICH_MARKDOWN_MODES as g, LEGACY_RICH_TOOLBAR_LAYOUT as h };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {Da,ga,ra}from'./chunk-LG5WRRFQ.js';import {forwardRef}from'react';import {jsx}from'react/jsx-runtime';var n={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},e=forwardRef(({className:i,variantClassName:l,compactToolbar:o=false,toolbarClassName:m,featureFlags:d,...p},f)=>jsx("div",{className:["luthor-preset-compose",i].filter(Boolean).join(" "),children:jsx(Da,{ref:f,...p,className:"luthor-preset-compose__editor",variantClassName:[o?"luthor-preset-compose--compact":"","luthor-preset-compose__variant",l].filter(Boolean).join(" "),toolbarClassName:[o?"luthor-preset-compose__toolbar--compact":"",m].filter(Boolean).join(" "),availableModes:["visual","json"],featureFlags:{...n,...d??{}}})}));e.displayName="ComposeEditor";var u={id:"compose",label:"Compose Editor",description:"Focused rich text drafting preset with a compact, practical toolbar.",extensions:ra({featureFlags:{image:false,table:false,iframeEmbed:false,youTubeEmbed:false,emoji:true,commandPalette:false,slashCommand:false,draggableBlock:false,customNode:false}}),components:{Editor:e},toolbar:["bold","italic","underline","strikethrough","link","unorderedList","orderedList","checkList","undo","redo"],config:ga("compose","Write your draft..."),css:"compose/styles.css"};export{e as a,u as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {f,e,d}from'./chunk-I7ETX4BN.js';import {ga,ra}from'./chunk-LG5WRRFQ.js';import {forwardRef}from'react';import {jsx}from'react/jsx-runtime';var s=d,M=e,o=forwardRef(({className:l,variantClassName:E,toolbarClassName:a,toolbarLayout:L,initialMode:c="visual",defaultEditorView:n,...m},p)=>jsx(f,{ref:p,...m,className:["luthor-preset-html-editor",l].filter(Boolean).join(" "),variantClassName:["luthor-preset-html-editor__variant",E].filter(Boolean).join(" "),toolbarClassName:["luthor-preset-html-editor__toolbar",a].filter(Boolean).join(" "),sourceFormat:"html",initialMode:c,defaultEditorView:n,toolbarLayout:L??M}));o.displayName="HTMLEditor";var _={id:"html-editor",label:"HTML Editor",description:"HTML-focused preset with visual, JSON, and HTML source views.",extensions:ra({featureFlags:s}),components:{Editor:o},toolbar:["undo","redo","blockFormat","quote","bold","italic","strikethrough","code","codeBlock","link","unorderedList","orderedList","checkList","horizontalRule"],config:ga("html-editor","Write HTML-compatible content..."),css:"html-editor/styles.css"};export{o as a,_ as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {Da,ga,ra}from'./chunk-LG5WRRFQ.js';import {forwardRef}from'react';import {jsx}from'react/jsx-runtime';var c=["visual","json","markdown"],d=["visual","json","html"],n=["visual","markdown","html"],t={bold:true,italic:true,underline:false,strikethrough:true,fontFamily:false,fontSize:false,lineHeight:false,textColor:false,textHighlight:false,subscript:false,superscript:false,link:true,horizontalRule:true,table:false,list:true,history:true,image:false,blockFormat:true,code:true,codeIntelligence:false,codeFormat:true,tabIndent:true,enterKeyBehavior:true,iframeEmbed:false,youTubeEmbed:false,floatingToolbar:false,contextMenu:false,commandPalette:false,slashCommand:false,emoji:false,draggableBlock:false,customNode:false,themeToggle:false},m={sections:[{items:["undo","redo"]},{items:["blockFormat","quote"]},{items:["bold","italic","strikethrough","code","link"]},{items:["unorderedList","orderedList","checkList","indentList","outdentList"]},{items:["codeBlock","horizontalRule"]}]};function b(e){return e==="both"?n:e==="html"?d:c}var o=forwardRef(({className:e,variantClassName:f,toolbarClassName:E,toolbarLayout:u,sourceFormat:L="both",initialMode:h="visual",defaultEditorView:g,featureFlags:_,...R},y)=>{let r=b(L),a=g??h,p=r.includes(a)?a:"visual";return jsx(Da,{ref:y,...R,className:["luthor-preset-legacy-rich",e].filter(Boolean).join(" "),variantClassName:["luthor-preset-legacy-rich__variant",f].filter(Boolean).join(" "),toolbarClassName:["luthor-preset-legacy-rich__toolbar",E].filter(Boolean).join(" "),availableModes:r,initialMode:p,toolbarLayout:u??m,featureFlags:{...t,..._??{},draggableBlock:false,table:false,image:false,iframeEmbed:false,youTubeEmbed:false,customNode:false,emoji:false,commandPalette:false,slashCommand:false,themeToggle:false}})});o.displayName="LegacyRichEditor";var M={id:"legacy-rich",label:"Legacy Rich Editor",description:"Metadata-free rich text profile for native markdown and html compatibility.",extensions:ra({featureFlags:t}),components:{Editor:o},toolbar:["undo","redo","blockFormat","quote","bold","italic","strikethrough","code","link","unorderedList","orderedList","checkList","indentList","outdentList","codeBlock","horizontalRule"],config:ga("legacy-rich","Write metadata-free content...")};export{c as a,d as b,n as c,t as d,m as e,o as f,M as g};
|