Cal.comdesign-system

Editor

Lexical rich-text editor with Cal variable insertion for workflows, event types, and profiles.

Cross-domain product editor used for workflow reminder bodies, event descriptions, private notes, and profile bios. Callers own form persistence; the Feature control owns Lexical composition and optional Cal variables.

Ownership

Feature — not @coss/ui/shared. Lives under packages/features/components/editor because it depends on Lexical, Cal variable nodes/plugins, markdown lifecycle helpers, and domain variable catalogs. Reuse the Feature import; do not relocate for docs and do not reimplement Lexical plugins in product or documentation.

Use when

  • A Cal surface needs the shared rich-text (or plain-text SMS) editor with the standard toolbar.
  • The caller may pass workflow/event variables and optional booking-field variables.
  • The surrounding form owns getText / setText persistence and dirty state.

Do not import Lexical plugins directly or document internal plugin files as product patterns. Import Editor (and AddVariablesDropdown when inserting variables outside the editor toolbar).

Canonical usage

Workflow reminder bodies exercise the widest public surface — variables, height, toolbar exclusion, plain text, and editable gating:

apps/web/modules/ee/workflows/components/canvas/node-config-sheet.tsx

This matches production. Keep Lexical internals, variable node rendering, and markdown transformers inside Editor.

Booking-field variables

Private note templates also pass bookingFieldVariables for attendee custom fields:

apps/web/modules/event-types/components/tabs/privacy/event-privacy-tab.tsx

Standalone variable dropdown

Use AddVariablesDropdown next to a plain input when variables are inserted outside the editor toolbar (for example email subject in the same workflow step):

apps/web/modules/ee/workflows/components/canvas/node-config-sheet.tsx

API

Also exports AddVariablesDropdown and BookingFieldVariable.

Call sites

Example URLs

Not exhaustive — a few places you can open locally (e.g. http://localhost:3000) to see this in product.

Source