diff --git a/src/components/editors/input-editor.tsx b/src/components/editors/input-editor.tsx index 4aee407..774dfe6 100644 --- a/src/components/editors/input-editor.tsx +++ b/src/components/editors/input-editor.tsx @@ -199,7 +199,11 @@ function PlainTextInputEditor({ return ( <> - + - + - + - + - + - + - + onChange({ ...element, options: next })} @@ -502,7 +506,7 @@ function MultiStaticSelectEditor({ return ( <> - + onChange({ ...element, options: next })} @@ -523,7 +527,7 @@ function UsersSelectEditor({ element, onChange }: { element: UsersSelect; onChan return ( <> - + - + ); @@ -576,7 +580,7 @@ function ChannelsSelectEditor({ return ( <> - + - + ); @@ -634,7 +638,7 @@ function ConversationsSelectEditor({ return ( <> - + - + - + - + - +

Edit the initial rich-text value via the View JSON drawer.

@@ -934,22 +938,32 @@ function ActionIdField({ /** * Shared placeholder field used by every element that supports * `placeholder` (i.e. anything implementing `Placeholdable`). + * + * `example` is shown as the input's own `placeholder` attribute so the + * user gets a per-element-type hint about what to type. The element's + * factory in `default-blocks.ts` intentionally ships without a default + * `placeholder.text` so this hint and the live preview don't render the + * same string twice when the editor first opens. + * * @param props - props * @param props.element - the element being edited * @param props.onChange - called with the updated element + * @param props.example - greyed-out hint shown in the editor input (not + * stored on the block); defaults to a generic suggestion * @returns the rendered field */ function PlaceholderField< T extends { placeholder?: { type: 'plain_text'; text: string; emoji?: boolean }; } ->({ element, onChange }: { element: T; onChange: (next: T) => void }) { +>({ element, onChange, example = 'e.g. Type a hint' }: { element: T; onChange: (next: T) => void; example?: string }) { return ( onChange({ ...element,