Implementation
To enable artifact editing, you need to pass theenableArtifactEdit: true flag to the C1 component you are using.
Using <C1Component>
Pass the enableArtifactEdit prop directly to the component.
Using <C1Chat>
Pass enableArtifactEdit: true inside the customizeC1 prop object.
How It Works
WhenenableArtifactEdit is set to true, the C1 UI renders an “Edit” button on the artifact. Clicking this button makes the artifact’s content fields editable, allowing the user to make direct changes.
Persisting the Changes
After a user finishes editing and saves their changes, the component’s internal state is updated. To ensure these changes are not lost, a callback is triggered with the new, modified content.- For
<C1Component>, theupdateMessagecallback fires. - For
<C1Chat>(or when usinguseThreadManager), theonUpdateMessagecallback fires.