Skip to content

Commit 15bde68

Browse files
chore(template-builder): 1.4.0 [skip ci]
### What's New **Field locking** — Set default lock modes on inserted fields to protect template structure from end-user edits. Add `defaultLockMode` to your props, or let template authors set it per-field with a checkbox when creating fields. Fields display a lock icon in the sidebar. **Field color styling** — Pass a `fieldColors` map to color-code fields by type in both the document and sidebar. No CSS import needed; colors are scoped and injected automatically. **Reactive mode switching** — Change `document.mode` without scrolling the editor or destroying its state. Mode changes queue correctly during initialization. **`refresh()` method** — Re-discover fields from the editor after async data delivery. Useful when templates load field definitions dynamically. ### Improvements - Lock mode is properly threaded through field insertion, selection, and update paths. - Lock badges appear in the sidebar for any field with an active lock mode. - Scoped field-color CSS uses `color-mix()` for light background colors — no need to append opacity values. - Partial `fieldColors` objects only apply defaults for explicitly defined types. - Mode changes no longer cause scroll jumps or content flashes. - Mode changes that arrive during editor initialization are queued and applied once the editor is ready. ### Fixes - Lock mode now included in field equality checks, so lock-only changes persist correctly. - Field deletion respects lock mode state without forcing removal when the editor command fails. - Unchecking the "Locked" checkbox correctly emits `lockMode: 'unlocked'` to override `defaultLockMode`.
1 parent d2a012a commit 15bde68

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/template-builder/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@superdoc-dev/template-builder",
3-
"version": "1.3.1",
3+
"version": "1.4.0",
44
"description": "React template builder component for SuperDoc",
55
"type": "module",
66
"main": "./dist/index.js",

0 commit comments

Comments
 (0)