@jackuait/blok 0.3.1-beta.9 → 0.4.1-beta.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.
@@ -1,4 +1,4 @@
1
- import { t as f, a as i } from "./blok-CAQ0uqEW.mjs";
1
+ import { t as f, a as i } from "./blok-D_baBvTG.mjs";
2
2
  const a = {
3
3
  wrapper: i(
4
4
  "fixed z-[2] bottom-5 left-5",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jackuait/blok",
3
- "version": "0.3.1-beta.9",
3
+ "version": "0.4.1-beta.0",
4
4
  "description": "Blok — headless, highly extensible rich text editor built for developers who need to implement a block-based editing experience (similar to Notion) without building it from scratch",
5
5
  "main": "dist/blok.umd.js",
6
6
  "module": "dist/blok.mjs",
@@ -73,6 +73,7 @@
73
73
  "@chromatic-com/storybook": "4.1.3",
74
74
  "@commitlint/cli": "20.1.0",
75
75
  "@commitlint/config-conventional": "20.0.0",
76
+ "@eslint-react/eslint-plugin": "^2.3.12",
76
77
  "@playwright/test": "1.57.0",
77
78
  "@storybook/addon-a11y": "10.1.1",
78
79
  "@storybook/addon-vitest": "10.1.1",
@@ -93,6 +94,8 @@
93
94
  "eslint-plugin-jest": "29.2.1",
94
95
  "eslint-plugin-jsdoc": "61.4.1",
95
96
  "eslint-plugin-playwright": "2.3.0",
97
+ "eslint-plugin-react": "^7.37.5",
98
+ "eslint-plugin-react-hooks": "^7.0.1",
96
99
  "eslint-plugin-sonarjs": "3.0.5",
97
100
  "eslint-plugin-storybook": "10.1.1",
98
101
  "eslint-plugin-tailwindcss": "3.18.2",
@@ -0,0 +1,33 @@
1
+ /**
2
+ * History API interface for undo/redo operations
3
+ */
4
+ export interface History {
5
+ /**
6
+ * Performs undo operation, reverting to the previous state
7
+ * @returns Promise resolving to true if undo was performed, false if nothing to undo
8
+ */
9
+ undo(): Promise<boolean>;
10
+
11
+ /**
12
+ * Performs redo operation, restoring the previously undone state
13
+ * @returns Promise resolving to true if redo was performed, false if nothing to redo
14
+ */
15
+ redo(): Promise<boolean>;
16
+
17
+ /**
18
+ * Checks if undo is available
19
+ * @returns true if there are states to undo
20
+ */
21
+ canUndo(): boolean;
22
+
23
+ /**
24
+ * Checks if redo is available
25
+ * @returns true if there are states to redo
26
+ */
27
+ canRedo(): boolean;
28
+
29
+ /**
30
+ * Clears the history stacks, removing all undo/redo history
31
+ */
32
+ clear(): void;
33
+ }
@@ -15,3 +15,4 @@ export * from './readonly';
15
15
  export * from './i18n';
16
16
  export * from './ui';
17
17
  export * from './tools';
18
+ export * from './history';
@@ -40,6 +40,18 @@ export interface BlokConfig {
40
40
  */
41
41
  hideToolbar?: boolean;
42
42
 
43
+ /**
44
+ * Maximum number of history entries for undo/redo
45
+ * @default 30
46
+ */
47
+ maxHistoryLength?: number;
48
+
49
+ /**
50
+ * Debounce time in milliseconds for batching rapid content changes
51
+ * @default 300
52
+ */
53
+ historyDebounceTime?: number;
54
+
43
55
  /**
44
56
  * Map of Tools to use
45
57
  */
package/types/index.d.ts CHANGED
@@ -16,6 +16,7 @@ import {
16
16
  Blocks,
17
17
  Caret,
18
18
  Events,
19
+ History,
19
20
  InlineToolbar,
20
21
  Listeners,
21
22
  Notifier,
@@ -108,6 +109,7 @@ export interface API {
108
109
  caret: Caret;
109
110
  tools: Tools;
110
111
  events: Events;
112
+ history: History;
111
113
  listeners: Listeners;
112
114
  notifier: Notifier;
113
115
  sanitizer: Sanitizer;
@@ -52,6 +52,12 @@ export interface PopoverParams {
52
52
  * Popover nesting level. 0 value means that it is a root popover
53
53
  */
54
54
  nestingLevel?: number;
55
+
56
+ /**
57
+ * Callback fired when user navigates back (ArrowLeft) from nested popover.
58
+ * Used to close nested popover and return focus to parent.
59
+ */
60
+ onNavigateBack?: () => void;
55
61
  }
56
62
 
57
63