@blockslides/extension-add-slide-button 0.1.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.
@@ -0,0 +1,43 @@
1
+ import { Extension } from '@blockslides/core';
2
+ import { EditorView } from 'prosemirror-view';
3
+
4
+ interface AddSlideButtonOptions {
5
+ /**
6
+ * Whether to inject CSS styles for the button.
7
+ * @default true
8
+ */
9
+ injectCSS?: boolean;
10
+ /**
11
+ * Nonce for Content Security Policy.
12
+ * @default undefined
13
+ */
14
+ injectNonce?: string;
15
+ /**
16
+ * Custom CSS styles for the button element.
17
+ * These will override or extend the default theme styles.
18
+ * Supports both camelCase (React) and kebab-case (Vue/CSS) property names.
19
+ * @default {}
20
+ * @example { backgroundColor: '#000', color: '#fff' } // React/camelCase
21
+ * @example { 'background-color': '#000', 'color': '#fff' } // Vue/kebab-case
22
+ */
23
+ buttonStyle: Record<string, string>;
24
+ /**
25
+ * Button content - can be text, HTML, icon, emoji, etc.
26
+ * @default '+'
27
+ * @example '+' | 'Add Slide' | '➕' | '<svg>...</svg>'
28
+ */
29
+ content: string;
30
+ /**
31
+ * Custom click handler for the button.
32
+ * If not provided, will insert a new slide at the clicked position.
33
+ */
34
+ onClick: ((params: {
35
+ slideIndex: number;
36
+ position: number;
37
+ view: EditorView;
38
+ event: MouseEvent;
39
+ }) => void) | null;
40
+ }
41
+ declare const AddSlideButton: Extension<AddSlideButtonOptions, any>;
42
+
43
+ export { AddSlideButton, type AddSlideButtonOptions, AddSlideButton as default };
@@ -0,0 +1,43 @@
1
+ import { Extension } from '@blockslides/core';
2
+ import { EditorView } from 'prosemirror-view';
3
+
4
+ interface AddSlideButtonOptions {
5
+ /**
6
+ * Whether to inject CSS styles for the button.
7
+ * @default true
8
+ */
9
+ injectCSS?: boolean;
10
+ /**
11
+ * Nonce for Content Security Policy.
12
+ * @default undefined
13
+ */
14
+ injectNonce?: string;
15
+ /**
16
+ * Custom CSS styles for the button element.
17
+ * These will override or extend the default theme styles.
18
+ * Supports both camelCase (React) and kebab-case (Vue/CSS) property names.
19
+ * @default {}
20
+ * @example { backgroundColor: '#000', color: '#fff' } // React/camelCase
21
+ * @example { 'background-color': '#000', 'color': '#fff' } // Vue/kebab-case
22
+ */
23
+ buttonStyle: Record<string, string>;
24
+ /**
25
+ * Button content - can be text, HTML, icon, emoji, etc.
26
+ * @default '+'
27
+ * @example '+' | 'Add Slide' | '➕' | '<svg>...</svg>'
28
+ */
29
+ content: string;
30
+ /**
31
+ * Custom click handler for the button.
32
+ * If not provided, will insert a new slide at the clicked position.
33
+ */
34
+ onClick: ((params: {
35
+ slideIndex: number;
36
+ position: number;
37
+ view: EditorView;
38
+ event: MouseEvent;
39
+ }) => void) | null;
40
+ }
41
+ declare const AddSlideButton: Extension<AddSlideButtonOptions, any>;
42
+
43
+ export { AddSlideButton, type AddSlideButtonOptions, AddSlideButton as default };