@helpai/elements 0.30.1 → 0.31.0

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.
package/configurator.mjs CHANGED
@@ -174,7 +174,7 @@ var calloutShapeSchema = z6.enum(["pill", "bubble", "callout"]);
174
174
  var calloutPositionSchema = z6.enum(["auto", "horizontal", "vertical"]);
175
175
  var launcherCalloutSchema = z6.object({
176
176
  text: z6.string().min(1).max(500).default("\u{1F44B} Hi! Need any help?").describe(
177
- "The message to show in the bubble. Defaults to a friendly greeting; replace with your own copy (e.g. 'Click here \u2192' or 'Try our new feature!')."
177
+ "The message to show in the bubble. Defaults to a friendly greeting; replace with your own copy (e.g. 'Click here \u2192'). May also be an i18n key (e.g. `launcherCallout`) resolved against `i18n.strings` for per-locale copy; a non-key literal renders as-is."
178
178
  ),
179
179
  shape: calloutShapeSchema.default("pill").describe("Visual shape \u2014 `pill` (slim label + arrow), `bubble` (speech-bubble tail), `callout` (loud variant)."),
180
180
  position: calloutPositionSchema.default("auto").describe(
@@ -420,6 +420,25 @@ var formConditionSchema = z12.object({
420
420
  minMessages: z12.number().int().min(0).max(1e3).optional(),
421
421
  maxMessages: z12.number().int().min(0).max(1e3).optional()
422
422
  }).loose();
423
+ var fieldOptionTranslationSchema = z12.object({
424
+ value: z12.string().min(1).max(200).describe("The canonical option `value` this localizes."),
425
+ label: z12.string().min(1).max(200).optional(),
426
+ description: z12.string().max(280).optional()
427
+ }).loose();
428
+ var formFieldTranslationSchema = z12.object({
429
+ name: z12.string().min(1).max(80).describe("The canonical field `name` this localizes."),
430
+ label: z12.string().min(1).max(200).optional(),
431
+ placeholder: z12.string().max(200).optional(),
432
+ validationHint: z12.string().max(280).optional(),
433
+ options: z12.array(fieldOptionTranslationSchema).max(50).optional()
434
+ }).loose();
435
+ var formTranslationSchema = z12.object({
436
+ locale: localeSchema,
437
+ title: z12.string().max(120).optional(),
438
+ description: z12.string().max(500).optional(),
439
+ submitLabel: z12.string().max(60).optional(),
440
+ fields: z12.array(formFieldTranslationSchema).max(50).optional()
441
+ }).loose();
423
442
  var formDefSchema = z12.object({
424
443
  id: z12.string().min(1).max(80).describe("Stable id \u2014 persistence dedupe + `manual` openForm(id)."),
425
444
  on: z12.union([formTriggerSchema, z12.array(formTriggerSchema).min(1).max(8)]).describe("Trigger(s) that surface this form."),
@@ -438,6 +457,10 @@ var formDefSchema = z12.object({
438
457
  ),
439
458
  reviewable: z12.boolean().default(true).describe(
440
459
  "Submitted marker expands in place to a read-only list of the visitor's answers. Set `false` for sensitive answers that shouldn't linger on screen."
460
+ ),
461
+ defaultLocale: localeSchema.optional().describe("BCP-47 locale the top-level strings (title / fields copy) are authored in."),
462
+ translations: z12.array(formTranslationSchema).max(50).optional().describe(
463
+ "Per-locale string overrides \u2014 the data module trims to the bootstrap `?locale=` (\u22641); the widget overlays it onto the default copy."
441
464
  )
442
465
  }).loose();
443
466
  var formsSchema = z12.array(formDefSchema).max(20).describe(