Skip to content

Commit 218cb0b

Browse files
committed
fix(docs): remove lockMode from onReady SDT insertions
lockMode is not available in the published version yet (PR #1939). Remove it from onReady field insertions so the demo works with the current superdoc@latest on unpkg.
1 parent f99ded3 commit 218cb0b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { SuperDocEditor } from '/snippets/components/superdoc-editor.jsx'
1616
const editor = superdoc?.activeEditor || superdoc?.editor
1717
if (!editor?.commands) return
1818

19-
// Find "________" in "Client name:" paragraph and replace with inline sdtLocked field
19+
// Find "________" in "Client name:" paragraph and replace with inline field
2020
let inlinePos = null
2121
editor.state.doc.descendants((node, pos) => {
2222
if (node.isText && node.text.includes('________') && inlinePos === null) {
@@ -26,12 +26,12 @@ import { SuperDocEditor } from '/snippets/components/superdoc-editor.jsx'
2626
if (inlinePos !== null) {
2727
editor.commands.setTextSelection({ from: inlinePos, to: inlinePos + 8 })
2828
editor.commands.insertStructuredContentInline({
29-
attrs: { id: '1', alias: 'Client Name', lockMode: 'sdtLocked' },
29+
attrs: { id: '1', alias: 'Client Name' },
3030
text: 'John Doe',
3131
})
3232
}
3333

34-
// Find the second "________" paragraph and replace with block sdtLocked field
34+
// Find the second "________" paragraph and replace with block field
3535
let blockPos = null
3636
editor.state.doc.descendants((node, pos) => {
3737
if (node.isText && node.text.includes('________')) {
@@ -41,7 +41,7 @@ import { SuperDocEditor } from '/snippets/components/superdoc-editor.jsx'
4141
if (blockPos !== null) {
4242
editor.commands.setTextSelection({ from: blockPos, to: blockPos + 8 })
4343
editor.commands.insertStructuredContentBlock({
44-
attrs: { id: '2', alias: 'Payment Terms', lockMode: 'sdtLocked' },
44+
attrs: { id: '2', alias: 'Payment Terms' },
4545
json: { type: 'paragraph', content: [{ type: 'text', text: 'Payment is due within 30 days of invoice date. Late payments incur a 1.5% monthly fee.' }] },
4646
})
4747
}

0 commit comments

Comments
 (0)