@veltdev/types-dev 6.0.0-beta.29 → 6.0.0-beta.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -98,8 +98,24 @@ export interface TargetEditDetails<T = unknown> {
98
98
  * auto-commit so a subscriber to `targetEditCommit` can drive it explicitly.
99
99
  */
100
100
  export interface TargetEditCommitResult {
101
- /** Override the SDK's default `${targetId}: ${old} → ${new}` summary. */
101
+ /**
102
+ * Override the SDK's default diff summary (`Replace: "{old}" with "{new}"`;
103
+ * `Add:`/`Remove:` when one side is absent; a per-key op list when both
104
+ * values are plain objects). When provided without `summaryHtml`, it is
105
+ * used for BOTH the plain `commentText` and (escaped) the `commentHtml`
106
+ * of the seeded first comment.
107
+ */
102
108
  summary?: string;
109
+ /**
110
+ * Optional HTML version of the summary, used as the `commentHtml` of the
111
+ * suggestion's seeded first comment (the plain `summary` — or the SDK's
112
+ * default diff summary — stays in `commentText`). When BOTH are omitted,
113
+ * the SDK renders a default styled HTML diff (old/removed values in red
114
+ * italic, new/added values in green italic). Sanitized with DOMPurify at
115
+ * render time — script/event-handler content is stripped; inline `style`
116
+ * attributes are preserved.
117
+ */
118
+ summaryHtml?: string;
103
119
  /** Customer metadata persisted on the resulting Suggestion. */
104
120
  metadata?: Record<string, unknown>;
105
121
  }
@@ -134,6 +150,19 @@ export interface EnableSuggestionModeConfig {
134
150
  * to event subscribers.
135
151
  */
136
152
  onTargetEditCommit?: TargetEditCommitHandler;
153
+ /**
154
+ * Opt-in: when true AND no `onTargetEditCommit` handler is provided,
155
+ * every detected commit auto-commits with the SDK's default
156
+ * summary/summaryHtml (equivalent to a handler returning `{}`).
157
+ *
158
+ * A provided `onTargetEditCommit` handler always wins — including its
159
+ * null-return deferral contract — so existing integrations are
160
+ * unaffected. The `targetEditCommit` event still fires; its pre-bound
161
+ * `commitSuggestion` builder becomes a no-op for edits already
162
+ * auto-committed by this flag (same double-commit guard as the handler
163
+ * path). Default: false (commits require explicit authorization).
164
+ */
165
+ autoCommit?: boolean;
137
166
  }
138
167
  /**
139
168
  * SDK-managed suggestion data persisted on a CommentAnnotation.
@@ -245,8 +274,24 @@ export interface CommitSuggestionConfig<T = unknown> {
245
274
  targetId: string;
246
275
  /** Any JSON-serializable value. Customer's apply handler interprets it. */
247
276
  newValue: T;
248
- /** Optional human-readable string for logs and notifications. */
277
+ /**
278
+ * Optional human-readable string for logs and notifications. When provided
279
+ * without `summaryHtml`, it is used for BOTH the seeded comment's plain
280
+ * `commentText` and (escaped) its `commentHtml`. When omitted, the seeded
281
+ * comment falls back to the SDK's default diff summary
282
+ * (`Replace: "{old}" with "{new}"`; `Add:`/`Remove:` when one side is
283
+ * absent; a per-key op list when both values are plain objects).
284
+ */
249
285
  summary?: string;
286
+ /**
287
+ * Optional HTML version of the summary — becomes the `commentHtml` of the
288
+ * suggestion's seeded first comment (plain `summary` or the default diff
289
+ * summary stays in `commentText`). When BOTH are omitted, the SDK renders
290
+ * a default styled HTML diff (old/removed values in red italic, new/added
291
+ * values in green italic). Sanitized with DOMPurify at render time; inline
292
+ * `style` attributes are preserved so rich diff styling survives.
293
+ */
294
+ summaryHtml?: string;
250
295
  /** Optional customer-defined metadata. Stored on Suggestion.metadata. */
251
296
  metadata?: Record<string, unknown>;
252
297
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltdev/types-dev",
3
- "version": "6.0.0-beta.29",
3
+ "version": "6.0.0-beta.30",
4
4
  "description": "Velt is an SDK to add collaborative features to your product within minutes. Example: Comments like Figma, Frame.io, Google docs or sheets, Recording like Loom, Huddles like Slack and much more.",
5
5
  "homepage": "https://velt.dev",
6
6
  "keywords": [