autumnnote 1.0.3 → 1.0.5

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/types/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * AutumnNote – TypeScript declarations
3
- * @version 1.0.0
3
+ * @version 1.0.4
4
4
  */
5
5
 
6
6
  // ---------------------------------------------------------------------------
@@ -21,7 +21,7 @@ export interface AsnOptions {
21
21
  /** Show the resize handle in the statusbar. */
22
22
  resizable?: boolean;
23
23
  /** Toolbar button group configuration. */
24
- toolbar?: Array<Array<ButtonDef | DropdownDef>>;
24
+ toolbar?: Array<Array<ToolbarItemDef>>;
25
25
  /** Use Bootstrap button classes on toolbar buttons. */
26
26
  useBootstrap?: boolean;
27
27
  /** CSS class(es) applied to Bootstrap toolbar buttons. */
@@ -127,6 +127,34 @@ export interface ButtonDef {
127
127
  className?: string;
128
128
  }
129
129
 
130
+ export interface GridButtonDef {
131
+ /** Unique identifier used in toolbar config arrays. */
132
+ name: string;
133
+ /** Discriminator for table grid picker buttons. */
134
+ type: 'grid';
135
+ /** Icon identifier (maps to SVG or Font Awesome class). */
136
+ icon: string;
137
+ /** Tooltip text. */
138
+ tooltip: string;
139
+ /** Action executed when a grid size is selected. */
140
+ action: (context: Context, rows: number, cols: number) => void;
141
+ }
142
+
143
+ export interface ColorPickerDef {
144
+ /** Unique identifier used in toolbar config arrays. */
145
+ name: string;
146
+ /** Discriminator for split color picker buttons. */
147
+ type: 'colorpicker';
148
+ /** Icon identifier (maps to SVG or Font Awesome class). */
149
+ icon: string;
150
+ /** Tooltip text. */
151
+ tooltip: string;
152
+ /** Default color shown in the picker. */
153
+ defaultColor: string;
154
+ /** Action executed when a color is selected/applied. */
155
+ action: (context: Context, color: string) => void;
156
+ }
157
+
130
158
  export interface DropdownDef {
131
159
  /** Unique identifier. */
132
160
  name: string;
@@ -135,13 +163,31 @@ export interface DropdownDef {
135
163
  /** Tooltip text. */
136
164
  tooltip: string;
137
165
  /** Static item list (may be overridden at render time from options). */
138
- items?: string[];
166
+ items?: Array<string | { value: string; label: string }>;
139
167
  /** Action executed when a value is selected. */
140
168
  action: (context: Context, value: string) => void;
141
169
  /** Returns the current value to show as selected. */
142
170
  getValue?: (context: Context) => string;
143
171
  }
144
172
 
173
+ export type ToolbarItemDef = ButtonDef | DropdownDef | GridButtonDef | ColorPickerDef;
174
+
175
+ // ---------------------------------------------------------------------------
176
+ // Entry-point re-exports
177
+ // ---------------------------------------------------------------------------
178
+
179
+ /** Runtime default options object (same export as `src/js/index.js`). */
180
+ export declare const defaultOptions: Required<AsnOptions>;
181
+
182
+ // Re-export core utility modules exposed by the package entry-point.
183
+ export * from '../src/js/core/dom.js';
184
+ export * from '../src/js/core/range.js';
185
+ export * from '../src/js/core/func.js';
186
+ export * from '../src/js/core/key.js';
187
+ export * from '../src/js/core/lists.js';
188
+ export * from '../src/js/core/env.js';
189
+ export * from '../src/js/core/sanitise.js';
190
+
145
191
  // ---------------------------------------------------------------------------
146
192
  // Context — per-instance editor hub
147
193
  // ---------------------------------------------------------------------------
@@ -263,8 +309,7 @@ export declare const hrBtn: ButtonDef;
263
309
  export declare const linkBtn: ButtonDef;
264
310
  export declare const imageBtn: ButtonDef;
265
311
  export declare const videoBtn: ButtonDef;
266
- export declare const tableBtn: ButtonDef;
267
- export declare const codeBlockBtn: ButtonDef;
312
+ export declare const tableBtn: GridButtonDef;
268
313
  export declare const codeviewBtn: ButtonDef;
269
314
  export declare const fullscreenBtn: ButtonDef;
270
315
  export declare const emojiBtn: ButtonDef;
@@ -272,16 +317,18 @@ export declare const iconBtn: ButtonDef;
272
317
  export declare const shortcutsBtn: ButtonDef;
273
318
  export declare const findBtn: ButtonDef;
274
319
  export declare const findReplaceBtn: ButtonDef;
320
+ export declare const inlineCodeBtn: ButtonDef;
321
+ export declare const checklistBtn: ButtonDef;
322
+ export declare const printBtn: ButtonDef;
275
323
  export declare const removeFormatBtn: ButtonDef;
276
324
  export declare const directionBtn: ButtonDef;
277
325
  export declare const fontFamilyBtn: DropdownDef;
278
326
  export declare const fontSizeBtn: DropdownDef;
279
- export declare const headingBtn: DropdownDef;
280
327
  export declare const lineHeightBtn: DropdownDef;
281
328
  export declare const paragraphStyleBtn: DropdownDef;
282
- export declare const foreColorBtn: DropdownDef;
283
- export declare const backColorBtn: DropdownDef;
284
- export declare const defaultToolbar: Array<Array<ButtonDef | DropdownDef>>;
329
+ export declare const foreColorBtn: ColorPickerDef;
330
+ export declare const backColorBtn: ColorPickerDef;
331
+ export declare const defaultToolbar: Array<Array<ToolbarItemDef>>;
285
332
 
286
333
  // ---------------------------------------------------------------------------
287
334
  // Main AutumnNote API