Skip to content

Commit 3d924fc

Browse files
committed
docs(structured-content): remove toggle lock buttons from demo
1 parent 1e7ee83 commit 3d924fc

1 file changed

Lines changed: 0 additions & 30 deletions

File tree

apps/docs/snippets/extensions/structured-content.mdx

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -67,36 +67,6 @@ import { SuperDocEditor } from '/snippets/components/superdoc-editor.jsx'
6767
}
6868
},
6969
],
70-
[
71-
{
72-
label: 'Toggle inline lock',
73-
onClick: (superdoc) => {
74-
const editor = superdoc?.activeEditor || superdoc?.editor
75-
if (!editor?.commands) return
76-
const tags = editor.helpers.structuredContentCommands.getStructuredContentTags(editor.state)
77-
const field = tags.find(t => String(t.node.attrs.id) === '1')
78-
if (!field) return
79-
const locked = field.node.attrs.lockMode && field.node.attrs.lockMode !== 'unlocked'
80-
editor.commands.updateStructuredContentById('1', {
81-
attrs: { lockMode: locked ? 'unlocked' : 'sdtContentLocked' },
82-
})
83-
}
84-
},
85-
{
86-
label: 'Toggle block lock',
87-
onClick: (superdoc) => {
88-
const editor = superdoc?.activeEditor || superdoc?.editor
89-
if (!editor?.commands) return
90-
const tags = editor.helpers.structuredContentCommands.getStructuredContentTags(editor.state)
91-
const field = tags.find(t => String(t.node.attrs.id) === '2')
92-
if (!field) return
93-
const locked = field.node.attrs.lockMode && field.node.attrs.lockMode !== 'unlocked'
94-
editor.commands.updateStructuredContentById('2', {
95-
attrs: { lockMode: locked ? 'unlocked' : 'sdtContentLocked' },
96-
})
97-
}
98-
},
99-
],
10070
[
10171
{
10272
label: 'Delete all fields',

0 commit comments

Comments
 (0)