@jackuait/blok 0.4.1-beta.3 → 0.4.1-beta.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.
@@ -1,4 +1,4 @@
1
- import { t as f, a as i } from "./blok-BkmkDl60.mjs";
1
+ import { t as f, a as i } from "./blok-DvN73wsH.mjs";
2
2
  const a = {
3
3
  wrapper: i(
4
4
  "fixed z-[2] bottom-5 left-5",
@@ -378,108 +378,6 @@ Apache License
378
378
 
379
379
  ---
380
380
 
381
- Name: react
382
- Version: 18.3.1
383
- License: MIT
384
- Private: false
385
- Description: React is a JavaScript library for building user interfaces.
386
- Repository: https://github.com/facebook/react.git
387
- Homepage: https://reactjs.org/
388
- License Copyright:
389
- ===
390
-
391
- MIT License
392
-
393
- Copyright (c) Facebook, Inc. and its affiliates.
394
-
395
- Permission is hereby granted, free of charge, to any person obtaining a copy
396
- of this software and associated documentation files (the "Software"), to deal
397
- in the Software without restriction, including without limitation the rights
398
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
399
- copies of the Software, and to permit persons to whom the Software is
400
- furnished to do so, subject to the following conditions:
401
-
402
- The above copyright notice and this permission notice shall be included in all
403
- copies or substantial portions of the Software.
404
-
405
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
406
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
407
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
408
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
409
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
410
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
411
- SOFTWARE.
412
-
413
- ---
414
-
415
- Name: react-dom
416
- Version: 18.3.1
417
- License: MIT
418
- Private: false
419
- Description: React package for working with the DOM.
420
- Repository: https://github.com/facebook/react.git
421
- Homepage: https://reactjs.org/
422
- License Copyright:
423
- ===
424
-
425
- MIT License
426
-
427
- Copyright (c) Facebook, Inc. and its affiliates.
428
-
429
- Permission is hereby granted, free of charge, to any person obtaining a copy
430
- of this software and associated documentation files (the "Software"), to deal
431
- in the Software without restriction, including without limitation the rights
432
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
433
- copies of the Software, and to permit persons to whom the Software is
434
- furnished to do so, subject to the following conditions:
435
-
436
- The above copyright notice and this permission notice shall be included in all
437
- copies or substantial portions of the Software.
438
-
439
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
440
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
441
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
442
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
443
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
444
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
445
- SOFTWARE.
446
-
447
- ---
448
-
449
- Name: scheduler
450
- Version: 0.23.2
451
- License: MIT
452
- Private: false
453
- Description: Cooperative scheduler for the browser environment.
454
- Repository: https://github.com/facebook/react.git
455
- Homepage: https://reactjs.org/
456
- License Copyright:
457
- ===
458
-
459
- MIT License
460
-
461
- Copyright (c) Facebook, Inc. and its affiliates.
462
-
463
- Permission is hereby granted, free of charge, to any person obtaining a copy
464
- of this software and associated documentation files (the "Software"), to deal
465
- in the Software without restriction, including without limitation the rights
466
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
467
- copies of the Software, and to permit persons to whom the Software is
468
- furnished to do so, subject to the following conditions:
469
-
470
- The above copyright notice and this permission notice shall be included in all
471
- copies or substantial portions of the Software.
472
-
473
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
474
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
475
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
476
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
477
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
478
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
479
- SOFTWARE.
480
-
481
- ---
482
-
483
381
  Name: sortablejs
484
382
  Version: 1.15.6
485
383
  License: MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jackuait/blok",
3
- "version": "0.4.1-beta.3",
3
+ "version": "0.4.1-beta.5",
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",
@@ -49,14 +49,15 @@
49
49
  "prepublishOnly": "yarn build",
50
50
  "prepare": "husky",
51
51
  "release": "./scripts/release.sh release",
52
- "release:beta": "./scripts/release.sh prerelease beta",
53
52
  "release:alpha": "./scripts/release.sh prerelease alpha",
54
53
  "release:rc": "./scripts/release.sh prerelease rc",
55
54
  "release:dry": "./scripts/release.sh release beta true",
56
55
  "storybook": "storybook dev -p 6006 --no-open",
57
56
  "storybook:build": "storybook build",
58
57
  "storybook:test": "vitest --project=storybook --run",
59
- "chromatic": "chromatic --exit-zero-on-changes"
58
+ "chromatic": "chromatic --exit-zero-on-changes",
59
+ "release:beta": "npm version prerelease --preid=beta",
60
+ "publish:beta": "npm publish --tag beta"
60
61
  },
61
62
  "author": "JackUait",
62
63
  "contributors": [
@@ -73,7 +74,6 @@
73
74
  "@chromatic-com/storybook": "4.1.3",
74
75
  "@commitlint/cli": "20.1.0",
75
76
  "@commitlint/config-conventional": "20.0.0",
76
- "@eslint-react/eslint-plugin": "^2.3.12",
77
77
  "@playwright/test": "1.57.0",
78
78
  "@storybook/addon-a11y": "10.1.1",
79
79
  "@storybook/addon-vitest": "10.1.1",
@@ -81,8 +81,6 @@
81
81
  "@storybook/html-vite": "10.1.1",
82
82
  "@types/eslint-plugin-tailwindcss": "3",
83
83
  "@types/node": "22.19.0",
84
- "@types/react": "18.3.1",
85
- "@types/react-dom": "18.3.1",
86
84
  "@types/sortablejs": "1.15.9",
87
85
  "@vitest/browser-playwright": "4.0.14",
88
86
  "@vitest/coverage-v8": "4.0.14",
@@ -94,8 +92,6 @@
94
92
  "eslint-plugin-jest": "29.2.1",
95
93
  "eslint-plugin-jsdoc": "61.4.1",
96
94
  "eslint-plugin-playwright": "2.3.0",
97
- "eslint-plugin-react": "^7.37.5",
98
- "eslint-plugin-react-hooks": "^7.0.1",
99
95
  "eslint-plugin-sonarjs": "3.0.5",
100
96
  "eslint-plugin-storybook": "10.1.1",
101
97
  "eslint-plugin-tailwindcss": "3.18.2",
@@ -120,8 +116,6 @@
120
116
  "dependencies": {
121
117
  "@types/lodash": "4.17.21",
122
118
  "lodash": "4.17.21",
123
- "react": "18.3.1",
124
- "react-dom": "18.3.1",
125
119
  "sortablejs": "1.15.6",
126
120
  "tailwind-merge": "3.4.0"
127
121
  }
@@ -30,4 +30,11 @@ export interface History {
30
30
  * Clears the history stacks, removing all undo/redo history
31
31
  */
32
32
  clear(): void;
33
+
34
+ /**
35
+ * Captures the initial document state for undo/redo
36
+ * Typically called after the editor is fully initialized
37
+ * @returns Promise that resolves when the initial state is captured
38
+ */
39
+ captureInitialState(): Promise<void>;
33
40
  }
@@ -1,10 +1,23 @@
1
+ /**
2
+ * Style class names for tool styling.
3
+ * These are single CSS class names that can be safely used with element.classList.add().
4
+ * The actual styles are defined using Tailwind's @apply directive in the CSS.
5
+ *
6
+ * @example
7
+ * // Add styles to an element
8
+ * element.classList.add(api.styles.block);
9
+ *
10
+ * // Combine with other classes using tailwind-merge
11
+ * import { twMerge } from '@jackuait/blok/utils/tw';
12
+ * element.className = twMerge(api.styles.block, 'my-4 bg-gray-100');
13
+ */
1
14
  export interface Styles {
2
15
  /**
3
16
  * Base block styles - applied to block tool wrappers.
4
17
  * Provides vertical padding for consistent block spacing.
5
18
  * Includes placeholder styling via pseudo-element.
6
19
  *
7
- * @example 'py-[theme(spacing.block-padding-vertical)] px-0 [&::-webkit-input-placeholder]:!leading-normal'
20
+ * @example 'blok-block'
8
21
  */
9
22
  block: string;
10
23
 
@@ -12,7 +25,7 @@ export interface Styles {
12
25
  * Styles for Inline Toolbar button.
13
26
  * Provides flexbox centering, transparent background, and proper sizing.
14
27
  *
15
- * @example 'flex justify-center items-center border-0 rounded h-full p-0 w-7 bg-transparent cursor-pointer'
28
+ * @example 'blok-inline-tool-button'
16
29
  */
17
30
  inlineToolButton: string;
18
31
 
@@ -20,7 +33,7 @@ export interface Styles {
20
33
  * Styles for active Inline Toolbar button.
21
34
  * Apply alongside inlineToolButton when the tool is active.
22
35
  *
23
- * @example 'bg-icon-active-bg text-icon-active-text'
36
+ * @example 'blok-inline-tool-button--active'
24
37
  */
25
38
  inlineToolButtonActive: string;
26
39
 
@@ -28,7 +41,7 @@ export interface Styles {
28
41
  * Styles for input elements.
29
42
  * Provides full width, border, padding, shadow, and Firefox placeholder workaround.
30
43
  *
31
- * @example 'w-full rounded-[3px] border border-line-gray px-3 py-2.5 outline-none shadow-input'
44
+ * @example 'blok-input'
32
45
  */
33
46
  input: string;
34
47
 
@@ -36,7 +49,7 @@ export interface Styles {
36
49
  * Loader styles for loading states.
37
50
  * Provides relative positioning, border, and spinning animation.
38
51
  *
39
- * @example 'relative border border-line-gray before:animate-rotation'
52
+ * @example 'blok-loader'
40
53
  */
41
54
  loader: string;
42
55
 
@@ -45,7 +58,7 @@ export interface Styles {
45
58
  * Provides flexbox centering, transparent background, minimum sizing,
46
59
  * mobile responsive sizing, and hover states.
47
60
  *
48
- * @example 'inline-flex items-center justify-center rounded-[3px] cursor-pointer'
61
+ * @example 'blok-settings-button'
49
62
  */
50
63
  settingsButton: string;
51
64
 
@@ -53,7 +66,7 @@ export interface Styles {
53
66
  * Styles for active Settings box buttons.
54
67
  * Apply alongside settingsButton when the button is active.
55
68
  *
56
- * @example 'text-active-icon'
69
+ * @example 'blok-settings-button--active'
57
70
  */
58
71
  settingsButtonActive: string;
59
72
 
@@ -61,7 +74,7 @@ export interface Styles {
61
74
  * Styles for focused Settings box buttons.
62
75
  * Apply alongside settingsButton when the button has focus.
63
76
  *
64
- * @example 'shadow-button-focused bg-item-focus-bg'
77
+ * @example 'blok-settings-button--focused'
65
78
  */
66
79
  settingsButtonFocused: string;
67
80
 
@@ -69,7 +82,7 @@ export interface Styles {
69
82
  * Styles for focused Settings box buttons with animation.
70
83
  * Apply alongside settingsButton and settingsButtonFocused for click animation.
71
84
  *
72
- * @example 'animate-button-clicked'
85
+ * @example 'blok-settings-button--focused-animated'
73
86
  */
74
87
  settingsButtonFocusedAnimated: string;
75
88
 
@@ -77,7 +90,12 @@ export interface Styles {
77
90
  * Styles for general buttons.
78
91
  * Provides padding, border, background, shadow, hover states, and SVG styling.
79
92
  *
80
- * @example 'p-[13px] rounded-[3px] border border-line-gray text-[14.9px] bg-white'
93
+ * @example 'blok-button'
81
94
  */
82
95
  button: string;
83
96
  }
97
+
98
+ /**
99
+ * @deprecated Use Styles instead
100
+ */
101
+ export type StyleClasses = Styles;
@@ -52,6 +52,14 @@ export interface BlokConfig {
52
52
  */
53
53
  historyDebounceTime?: number;
54
54
 
55
+ /**
56
+ * Enable document-level undo/redo shortcuts.
57
+ * When true, Cmd+Z / Ctrl+Z and Cmd+Shift+Z / Ctrl+Shift+Z work even when
58
+ * the editor is not focused (e.g., after dragging a block).
59
+ * @default true
60
+ */
61
+ globalUndoRedo?: boolean;
62
+
55
63
  /**
56
64
  * Map of Tools to use
57
65
  */
@@ -182,6 +182,12 @@ export interface PopoverItemDefaultBaseParams {
182
182
  */
183
183
  hint?: HintParams;
184
184
 
185
+ /**
186
+ * Custom data attributes to be added to the item element.
187
+ * Keys should be in camelCase (e.g., 'headerLevel' becomes 'data-header-level')
188
+ */
189
+ dataset?: Record<string, string>;
190
+
185
191
  /**
186
192
  * Popover item activation handler
187
193
  *