Commit 15bde68
committed
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments