planet-editor 0.1.0 → 0.1.1
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/dist/lib/components/planet-templates/simple/simple-editor.d.ts +8 -0
- package/dist/lib/components/planet-ui-primitive/toolbar/index.d.ts +1 -0
- package/dist/lib/components/planet-ui-primitive/toolbar/toolbar-overflow.d.ts +13 -0
- package/dist/lib/index.js +1179 -1082
- package/dist/lib/styles.css +1 -1
- package/dist/web-component/planet-editor.css +1 -1
- package/dist/web-component/planet-editor.html +12 -12
- package/dist/web-component/planet-editor.js +11 -11
- package/package.json +1 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { useEditor } from '../../../planet-core/react';
|
|
2
|
+
/** The live Tiptap editor instance created by SimpleEditor. */
|
|
3
|
+
export type PlanetEditorInstance = NonNullable<ReturnType<typeof useEditor>>;
|
|
1
4
|
export interface SimpleEditorProps {
|
|
2
5
|
/** Initial content as HTML string or Planet JSON. Defaults to demo content. */
|
|
3
6
|
content?: string | Record<string, unknown>;
|
|
@@ -8,6 +11,11 @@ export interface SimpleEditorProps {
|
|
|
8
11
|
html: string;
|
|
9
12
|
json: Record<string, unknown>;
|
|
10
13
|
}) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Fired once the editor instance is ready. Use it to run commands on the
|
|
16
|
+
* editor from outside — e.g. `editor.chain().focus().insertContent("...").run()`.
|
|
17
|
+
*/
|
|
18
|
+
onEditorReady?: (editor: PlanetEditorInstance) => void;
|
|
11
19
|
/**
|
|
12
20
|
* Image upload handler. Receives the picked File and resolves to a URL/src.
|
|
13
21
|
* Defaults to an offline base64 (data URL) handler. Pass your own to upload
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ToolbarSection {
|
|
3
|
+
key: string;
|
|
4
|
+
node: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Priority-plus toolbar: renders as many sections as fit on one row and
|
|
8
|
+
* collapses the rest into a "⋯ More" popover. Responsive — the split is
|
|
9
|
+
* recomputed whenever the toolbar is resized.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ToolbarOverflow({ sections }: {
|
|
12
|
+
sections: ToolbarSection[];
|
|
13
|
+
}): import("react").JSX.Element;
|