Skip to content

docs: add content controls page, examples, and demo (IT-1046)#3265

Merged
caio-pizzol merged 5 commits into
mainfrom
caio-pizzol/IT-1046-content-controls-demo
May 13, 2026
Merged

docs: add content controls page, examples, and demo (IT-1046)#3265
caio-pizzol merged 5 commits into
mainfrom
caio-pizzol/IT-1046-content-controls-demo

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

Customer asked whether SuperDoc supports composable reusable sections and "smart fields" — placeholders that update everywhere when edited centrally. Both map cleanly to Word content controls (OOXML SDT), and the surface is fully wired in the Document API. Ships two narrow examples plus a composed runtime demo, plus a conceptual docs page so the Document API surface gets the same hand-written narrative the Editor extensions already have.

  • examples/document-api/content-controls/smart-fields/ and reusable-section/ each teach one pattern in isolation, copy-pasteable.
  • demos/contract-templates/ is a composed workflow that detects stale section versions and applies updates in place. Not yet gallery-ready (homepage: false) pending the lock-mutation fix.
  • apps/docs/document-api/features/content-controls.mdx is a new home for hand-written feature narratives, slotted under a new Features sidebar group inside Document API. Frames Template Builder and the raw Document API as two valid paths.
  • Document API path is fully editor.doc.*. The same operation set runs headless via the Node SDK and CLI.

Follow-ups: SD-3123 (locked-SDT mutations silently no-op via the legacy command path), SD-3124 (filter-rejected transactions report false success), SD-3125 (imported-controls example with a Word-authored fixture).

Customer asked whether SuperDoc supports composable reusable sections and "smart fields" — placeholders that update everywhere when edited centrally. Both map cleanly to Word content controls (OOXML SDT), and the surface is fully wired in the Document API. Ships two narrow examples plus a composed runtime demo, plus a conceptual docs page so the Document API surface gets the same hand-written narrative the Editor extensions already have.

- examples/document-api/content-controls/smart-fields/ and reusable-section/ each teach one pattern in isolation, copy-pasteable.
- demos/contract-templates/ is a composed workflow that detects stale section versions and applies updates in place. Not yet gallery-ready (homepage: false) pending the lock-mutation fix.
- apps/docs/document-api/features/content-controls.mdx is a new home for hand-written feature narratives, slotted under a new Features sidebar group inside Document API. Frames Template Builder and the raw Document API as two valid paths.
- Document API path is fully editor.doc.*. The same operation set runs headless via the Node SDK and CLI.

Follow-ups: SD-3123 (locked-SDT mutations silently no-op via the legacy command path), SD-3124 (filter-rejected transactions report false success), SD-3125 (imported-controls example with a Word-authored fixture).
@caio-pizzol caio-pizzol requested a review from a team as a code owner May 13, 2026 16:13
@linear
Copy link
Copy Markdown

linear Bot commented May 13, 2026

IT-1046

@github-actions
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6cd05460e6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread apps/docs/document-api/features/content-controls.mdx Outdated
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…ne-text (IT-1046)

The first pass shipped two examples (smart-fields, reusable-section) that read as demo decompositions: same primitives as demos/contract-templates, ~200 lines each, with markdown seeds and panel chrome. They didn't earn their place against the demo.

Replaced with one tight example, modelled on examples/editor/custom-ui/selection-capture: smallest readable form of the canonical create-find-update loop, with a README that distinguishes setup mutations from the teaching surface (selectByTag + text.setValue). Sets the template that future content-control examples copy.

- examples/document-api/content-controls/tagged-inline-text/ is the new single example.
- Old smart-fields/, reusable-section/, and the parent README.md removed.
- features/content-controls.mdx Next steps cards updated to point at the new example.
- Manifest and README rows replaced.
Captures the conventions IT-1046 produced so future contributors don't rediscover them. Examples and demos each get a scoped AGENTS.md (with a CLAUDE.md symlink for compat) defining what belongs in each surface, the cross-surface Document API placement rule, and the "don't ship known-bug or unverified paths" rule that drove the lockMode: 'unlocked' choice in the tagged-inline-text example.

- examples/README.md and demos/README.md rewritten with clear definitions, contributor checklists, and homepage-readiness criteria.
- examples/AGENTS.md (+ CLAUDE.md symlink) covers Document API placement, setup-vs-teaching separation, and verification rules.
- demos/AGENTS.md (+ CLAUDE.md symlink) covers composed-workflow criteria and source-vs-live demo distinction.
- demos/README.md adds contract-templates to the curated demos table.
- demos/contract-templates/README.md calls out its demo status and links back to the tagged-inline-text example.
- tagged-inline-text/README.md notes the lockMode: 'unlocked' choice and points at SD-3123.
- Both style.css files now read from --sd-* tokens with fallbacks, so examples and demos pick up the host SuperDoc theme.
…1046)

Replaces internal-status framing with API guidance. Removes references to engine internals, legacy paths, known bugs, and 'not yet' language.

- Lock modes: behavior table, then concrete guidance for programmatic use.
- Data binding: describe what the API supports and what to drive instead.
- Replacing content: scope replaceContent to plain text and point at doc.insert + contentControls.wrap for richer fragments.
contentControls.wrap takes an existing SDT target, not a selection range. Use create.contentControl with an at: SelectionTarget to wrap an inserted range.
@caio-pizzol caio-pizzol merged commit c446999 into main May 13, 2026
66 of 67 checks passed
@caio-pizzol caio-pizzol deleted the caio-pizzol/IT-1046-content-controls-demo branch May 13, 2026 17:48
msviderok pushed a commit to msviderok/superdoc that referenced this pull request May 16, 2026
…oc-dev#3265)

* docs: add content controls page, examples, and demo (IT-1046)

Customer asked whether SuperDoc supports composable reusable sections and "smart fields" — placeholders that update everywhere when edited centrally. Both map cleanly to Word content controls (OOXML SDT), and the surface is fully wired in the Document API. Ships two narrow examples plus a composed runtime demo, plus a conceptual docs page so the Document API surface gets the same hand-written narrative the Editor extensions already have.

- examples/document-api/content-controls/smart-fields/ and reusable-section/ each teach one pattern in isolation, copy-pasteable.
- demos/contract-templates/ is a composed workflow that detects stale section versions and applies updates in place. Not yet gallery-ready (homepage: false) pending the lock-mutation fix.
- apps/docs/document-api/features/content-controls.mdx is a new home for hand-written feature narratives, slotted under a new Features sidebar group inside Document API. Frames Template Builder and the raw Document API as two valid paths.
- Document API path is fully editor.doc.*. The same operation set runs headless via the Node SDK and CLI.

Follow-ups: SD-3123 (locked-SDT mutations silently no-op via the legacy command path), SD-3124 (filter-rejected transactions report false success), SD-3125 (imported-controls example with a Word-authored fixture).

* docs: replace content-control examples with one canonical tagged-inline-text (IT-1046)

The first pass shipped two examples (smart-fields, reusable-section) that read as demo decompositions: same primitives as demos/contract-templates, ~200 lines each, with markdown seeds and panel chrome. They didn't earn their place against the demo.

Replaced with one tight example, modelled on examples/editor/custom-ui/selection-capture: smallest readable form of the canonical create-find-update loop, with a README that distinguishes setup mutations from the teaching surface (selectByTag + text.setValue). Sets the template that future content-control examples copy.

- examples/document-api/content-controls/tagged-inline-text/ is the new single example.
- Old smart-fields/, reusable-section/, and the parent README.md removed.
- features/content-controls.mdx Next steps cards updated to point at the new example.
- Manifest and README rows replaced.

* docs: add examples/demos contributor guidance and align styles (IT-1046)

Captures the conventions IT-1046 produced so future contributors don't rediscover them. Examples and demos each get a scoped AGENTS.md (with a CLAUDE.md symlink for compat) defining what belongs in each surface, the cross-surface Document API placement rule, and the "don't ship known-bug or unverified paths" rule that drove the lockMode: 'unlocked' choice in the tagged-inline-text example.

- examples/README.md and demos/README.md rewritten with clear definitions, contributor checklists, and homepage-readiness criteria.
- examples/AGENTS.md (+ CLAUDE.md symlink) covers Document API placement, setup-vs-teaching separation, and verification rules.
- demos/AGENTS.md (+ CLAUDE.md symlink) covers composed-workflow criteria and source-vs-live demo distinction.
- demos/README.md adds contract-templates to the curated demos table.
- demos/contract-templates/README.md calls out its demo status and links back to the tagged-inline-text example.
- tagged-inline-text/README.md notes the lockMode: 'unlocked' choice and points at SD-3123.
- Both style.css files now read from --sd-* tokens with fallbacks, so examples and demos pick up the host SuperDoc theme.

* docs: rewrite content-controls limits sections in customer voice (IT-1046)

Replaces internal-status framing with API guidance. Removes references to engine internals, legacy paths, known bugs, and 'not yet' language.

- Lock modes: behavior table, then concrete guidance for programmatic use.
- Data binding: describe what the API supports and what to drive instead.
- Replacing content: scope replaceContent to plain text and point at doc.insert + contentControls.wrap for richer fragments.

* docs: correct rich-fragment wrap guidance (IT-1046)

contentControls.wrap takes an existing SDT target, not a selection range. Use create.contentControl with an at: SelectionTarget to wrap an inserted range.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants