You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make the clause library a single-use inclusion checklist instead of a duplicate
stamp tool. A clause is either "In contract" or available to "Add clause": a
clause already placed can't be inserted again - clicking its card reveals the
existing section, while an available card adds it (click or drag) and then flips
to "In contract". Drops the "used N times" surface. This teaches the right model:
fields are reusable variables, clauses are governed sections included once.
- Add a library-only "Return of Materials" clause carrying a nested Receiving
party slot, so insert-with-nested-fields stays demonstrable now that the seeded
Permitted Use is "In contract" and no longer insertable.
- Recolor fields and clauses to the SuperDoc brand blue (--sd-color-blue-500/600,
per brand.md) instead of amber. They render as tinted/outlined pills, so they
stay distinct from the solid-blue primary buttons.
- Update tests (single-use status badges, add-once-no-duplicate, nested-field on
add), the README, and code comments to the single-use + blue model.
Copy file name to clipboardExpand all lines: demos/contract-templates/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,8 @@ The starting document is `public/nda-template.docx`: inline plain-text fields an
12
12
13
13
**Template tab, the building-block library.** Two catalogs, fields and clauses, each styled to match what it inserts:
14
14
15
-
- Smart-field chips wear the same amber token look as the in-document field (CSS on `.superdoc-structured-content-inline[data-sdt-tag*='smartField']`). Drag a chip onto the document, or click to insert it at the cursor. An unfilled field shows its field-name token (e.g. `DISCLOSING_PARTY`) as a stand-in placeholder. That token is literal text content, not a native SDT placeholder.
16
-
- Clause cards wear the same amber block look as the in-document clause and carry metadata: category, jurisdiction, version, and how many times the clause is placed ("Used 2 times"). The catalog includes clauses that aren't in the document yet. Drag a card onto the document, or click to insert it at the cursor.
15
+
- Smart-field chips wear the same blue token look as the in-document field (CSS on `.superdoc-structured-content-inline[data-sdt-tag*='smartField']`). Drag a chip onto the document, or click to insert it at the cursor. An unfilled field shows its field-name token (e.g. `DISCLOSING_PARTY`) as a stand-in placeholder. That token is literal text content, not a native SDT placeholder.
16
+
- Clause cards wear the same blue block look as the in-document clause and carry metadata (category, jurisdiction, version) and a status. A clause is single-use, like an inclusion checklist: a card already in the contract reads **In contract**and clicking it reveals the existing clause; an available card reads **Add clause** and drags or clicks in. The catalog includes clauses that aren't in the document yet (e.g. Indemnification, Return of Materials).
17
17
18
18
Inserts resolve the drop point with `ui.viewport.positionAt({ x, y })` and create the control with `editor.doc.create.contentControl({ kind, at, content, tag, lockMode })`. A field inserts inline at the exact caret; a clause snaps to a block boundary so it lands as a clean section instead of splitting a paragraph. Clicking a control in the document highlights its chip or card (`content-control:click`).
0 commit comments