@sethumadhavan004/ink-editor 0.0.1 → 0.0.2
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/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -19,7 +19,9 @@ interface InkEditorProps {
|
|
|
19
19
|
onChange?: (json: object) => void;
|
|
20
20
|
theme?: Theme;
|
|
21
21
|
toolbar?: ToolbarKey[];
|
|
22
|
+
initialFont?: FontKey;
|
|
23
|
+
initialColors?: Partial<ThemeColors>;
|
|
22
24
|
}
|
|
23
|
-
declare function InkEditor({ pageSize, onChange, theme, toolbar, }: InkEditorProps): react_jsx_runtime.JSX.Element;
|
|
25
|
+
declare function InkEditor({ pageSize, onChange, theme, toolbar, initialFont, initialColors, }: InkEditorProps): react_jsx_runtime.JSX.Element;
|
|
24
26
|
|
|
25
27
|
export { type FontKey, InkEditor, type InkEditorProps, MINIMAL_DEFAULTS, PARCHMENT_DEFAULTS, type PageSize, type Theme, type ThemeColors, type ToolbarKey };
|
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,9 @@ interface InkEditorProps {
|
|
|
19
19
|
onChange?: (json: object) => void;
|
|
20
20
|
theme?: Theme;
|
|
21
21
|
toolbar?: ToolbarKey[];
|
|
22
|
+
initialFont?: FontKey;
|
|
23
|
+
initialColors?: Partial<ThemeColors>;
|
|
22
24
|
}
|
|
23
|
-
declare function InkEditor({ pageSize, onChange, theme, toolbar, }: InkEditorProps): react_jsx_runtime.JSX.Element;
|
|
25
|
+
declare function InkEditor({ pageSize, onChange, theme, toolbar, initialFont, initialColors, }: InkEditorProps): react_jsx_runtime.JSX.Element;
|
|
24
26
|
|
|
25
27
|
export { type FontKey, InkEditor, type InkEditorProps, MINIMAL_DEFAULTS, PARCHMENT_DEFAULTS, type PageSize, type Theme, type ThemeColors, type ToolbarKey };
|
package/dist/index.js
CHANGED
|
@@ -2621,13 +2621,16 @@ function InkEditor({
|
|
|
2621
2621
|
pageSize = "A4",
|
|
2622
2622
|
onChange,
|
|
2623
2623
|
theme = "parchment",
|
|
2624
|
-
toolbar = DEFAULT_TOOLBAR
|
|
2624
|
+
toolbar = DEFAULT_TOOLBAR,
|
|
2625
|
+
initialFont = "cursive",
|
|
2626
|
+
initialColors
|
|
2625
2627
|
}) {
|
|
2626
2628
|
const [ruled, setRuled] = (0, import_react6.useState)(false);
|
|
2627
|
-
const [font, setFont] = (0, import_react6.useState)(
|
|
2628
|
-
const [colors, setColors] = (0, import_react6.useState)(
|
|
2629
|
-
theme === "minimal" ? MINIMAL_DEFAULTS : PARCHMENT_DEFAULTS
|
|
2630
|
-
|
|
2629
|
+
const [font, setFont] = (0, import_react6.useState)(initialFont);
|
|
2630
|
+
const [colors, setColors] = (0, import_react6.useState)({
|
|
2631
|
+
...theme === "minimal" ? MINIMAL_DEFAULTS : PARCHMENT_DEFAULTS,
|
|
2632
|
+
...initialColors
|
|
2633
|
+
});
|
|
2631
2634
|
const editor = (0, import_react5.useEditor)({
|
|
2632
2635
|
extensions: [
|
|
2633
2636
|
import_starter_kit.default,
|