@tightknitai/block-kitchen 0.10.0 → 0.10.1
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/README.md +31 -0
- package/dist/index.cjs +403 -198
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +404 -199
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -494,6 +494,37 @@ Pass [`customEmojis`](#props) to add your workspace's custom emoji: image entrie
|
|
|
494
494
|
|
|
495
495
|
Defense-in-depth: blocks are validated against [slack-block-kit-validator](https://github.com/TightknitAI/slack-block-kit-validator) before send. Issues are surfaced in the issues sheet with line numbers — users can fix them inline before posting.
|
|
496
496
|
|
|
497
|
+
## Undo & redo
|
|
498
|
+
|
|
499
|
+
Every edit to the draft is undoable — adding, deleting, duplicating,
|
|
500
|
+
reordering, dragging in and out of containers, editing a block's fields, and
|
|
501
|
+
the toolbar's **Clear** and **View JSON → apply**. The toolbar shows **Undo**
|
|
502
|
+
and **Redo** buttons (disabled when there's nothing to step to), and the
|
|
503
|
+
keyboard shortcuts work whenever focus is inside the builder:
|
|
504
|
+
|
|
505
|
+
| Shortcut | Action |
|
|
506
|
+
|---|---|
|
|
507
|
+
| `Ctrl`/`Cmd` + `Z` | Undo |
|
|
508
|
+
| `Ctrl`/`Cmd` + `Shift` + `Z`, or `Ctrl` + `Y` | Redo |
|
|
509
|
+
|
|
510
|
+
Notes:
|
|
511
|
+
|
|
512
|
+
- **Typing coalesces.** A run of edits to the *same* field collapses into a
|
|
513
|
+
single undo step, so one `Ctrl+Z` rewinds the whole edit rather than one
|
|
514
|
+
character at a time. Editing a different block, or any structural change,
|
|
515
|
+
starts a new step.
|
|
516
|
+
- **Native text undo is preserved.** While a text input, textarea, or the
|
|
517
|
+
inline rich-text editor is focused, `Ctrl/Cmd+Z` performs the browser's
|
|
518
|
+
own per-character undo — the builder only takes over when focus is on the
|
|
519
|
+
canvas or toolbar. The shortcut is scoped to the builder, so it never
|
|
520
|
+
hijacks the host app's own `Ctrl/Cmd+Z`.
|
|
521
|
+
- **Loading is a fresh baseline.** [Loading an existing
|
|
522
|
+
message](#loading-an-existing-message-opt-in) (or "open as new") starts a
|
|
523
|
+
new document with an empty history — undo won't step back across the load
|
|
524
|
+
into the previous draft. **Clear**, by contrast, is undoable.
|
|
525
|
+
- Undo and redo are ordinary draft changes, so they flow through `onChange`
|
|
526
|
+
(and re-run validation) like any other edit.
|
|
527
|
+
|
|
497
528
|
## Styling
|
|
498
529
|
|
|
499
530
|
Ships a compiled stylesheet at `@tightknitai/block-kitchen/styles.css`. The styles use CSS custom properties (`--background`, `--primary`, `--border`, etc.) for theming. Consumers must provide values for these vars — the standard shadcn/ui token set works as-is.
|