@helpai/elements 0.23.0 → 0.24.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 +6 -0
- package/elements-web-component.esm.js +2 -2
- package/elements-web-component.esm.js.map +3 -3
- package/elements.cjs.js +2 -2
- package/elements.cjs.js.map +3 -3
- package/elements.esm.js +2 -2
- package/elements.esm.js.map +3 -3
- package/elements.js +2 -2
- package/elements.js.map +3 -3
- package/index.d.ts +19 -1
- package/index.mjs +6 -3
- package/package.json +1 -1
- package/schema.d.ts +53 -49
- package/schema.json +26 -2
- package/schema.mjs +6 -0
- package/web-component.mjs +6 -3
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, L as Link, S as ServerConfig, b as SiteConfig, c as StartConversationResponse, W as WidgetConfig, d as WidgetConfigPartial, e as WidgetSettings, f as WidgetSettingsPartial } from './deployment-
|
|
1
|
+
export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, L as Link, S as ServerConfig, b as SiteConfig, c as StartConversationResponse, W as WidgetConfig, d as WidgetConfigPartial, e as WidgetSettings, f as WidgetSettingsPartial } from './deployment-BP2axIFu.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -579,6 +579,20 @@ interface FormDef {
|
|
|
579
579
|
* submit endpoint, never onto the always-on context envelope.
|
|
580
580
|
*/
|
|
581
581
|
mirrorToContext?: boolean;
|
|
582
|
+
/**
|
|
583
|
+
* Skipped marker offers a "Fill out" button that reopens the form (skip is
|
|
584
|
+
* a deferral, not a refusal). Default `true`. Set `false` when a skip must
|
|
585
|
+
* be final — e.g. a consent ask that should not be re-surfaced.
|
|
586
|
+
*/
|
|
587
|
+
reopenable?: boolean;
|
|
588
|
+
/**
|
|
589
|
+
* Submitted marker expands in place to a read-only list of the visitor's
|
|
590
|
+
* answers. Default `true`. Set `false` to keep the marker plain — e.g.
|
|
591
|
+
* sensitive answers that shouldn't linger on screen (pairs with
|
|
592
|
+
* `mirrorToContext: false`; the backend should also omit `values` from the
|
|
593
|
+
* `formSubmissions` echo for such forms).
|
|
594
|
+
*/
|
|
595
|
+
reviewable?: boolean;
|
|
582
596
|
}
|
|
583
597
|
/** The `forms` block is an ordered list (max 20); order = priority. */
|
|
584
598
|
type FormsOptions = FormDef[];
|
|
@@ -595,6 +609,10 @@ interface ResolvedForm {
|
|
|
595
609
|
frequency: FormFrequency;
|
|
596
610
|
/** Mirror answers into `userContext` (false → PII, endpoint only). */
|
|
597
611
|
mirrorToContext: boolean;
|
|
612
|
+
/** Skipped marker offers "Fill out" (false → a skip is final). */
|
|
613
|
+
reopenable: boolean;
|
|
614
|
+
/** Submitted marker expands to a read-only answers list. */
|
|
615
|
+
reviewable: boolean;
|
|
598
616
|
}
|
|
599
617
|
/** Fully-resolved forms block: ordered list + an event→forms index. */
|
|
600
618
|
interface ResolvedForms {
|
package/index.mjs
CHANGED
|
@@ -680,7 +680,9 @@ function resolveForms(overrides) {
|
|
|
680
680
|
submitLabel: def.submitLabel,
|
|
681
681
|
skippable: def.skippable ?? false,
|
|
682
682
|
frequency: def.frequency ?? "once",
|
|
683
|
-
mirrorToContext: def.mirrorToContext ?? true
|
|
683
|
+
mirrorToContext: def.mirrorToContext ?? true,
|
|
684
|
+
reopenable: def.reopenable ?? true,
|
|
685
|
+
reviewable: def.reviewable ?? true
|
|
684
686
|
});
|
|
685
687
|
}
|
|
686
688
|
const byTrigger = {};
|
|
@@ -4302,7 +4304,8 @@ function FormDoneMarker({
|
|
|
4302
4304
|
"\xB7 ",
|
|
4303
4305
|
marker.title
|
|
4304
4306
|
] }) : null;
|
|
4305
|
-
const
|
|
4307
|
+
const reviewable = marker.form?.reviewable ?? false;
|
|
4308
|
+
const values = !skipped && reviewable && marker.values && Object.keys(marker.values).length > 0 ? marker.values : null;
|
|
4306
4309
|
if (values) {
|
|
4307
4310
|
const labelFor = (name) => marker.form?.fields.find((f) => f.name === name)?.label ?? name;
|
|
4308
4311
|
return /* @__PURE__ */ jsxs9("details", { class: `${p11}-form-done`, "data-outcome": marker.outcome, "data-testid": TID.formDone, children: [
|
|
@@ -4322,7 +4325,7 @@ function FormDoneMarker({
|
|
|
4322
4325
|
skipped ? /* @__PURE__ */ jsx11(SkipIcon, {}) : /* @__PURE__ */ jsx11(CheckIcon, {}),
|
|
4323
4326
|
/* @__PURE__ */ jsx11("span", { children: skipped ? strings.formSkipped : strings.formSubmitted }),
|
|
4324
4327
|
title,
|
|
4325
|
-
skipped && marker.form && onFill ? /* @__PURE__ */ jsx11("button", { type: "button", class: `${p11}-form-done-fill`, "data-testid": TID.formFill, onClick: onFill, children: strings.formFillOut }) : null
|
|
4328
|
+
skipped && marker.form?.reopenable && onFill ? /* @__PURE__ */ jsx11("button", { type: "button", class: `${p11}-form-done-fill`, "data-testid": TID.formFill, onClick: onFill, children: strings.formFillOut }) : null
|
|
4326
4329
|
] });
|
|
4327
4330
|
}
|
|
4328
4331
|
|
package/package.json
CHANGED
package/schema.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, E as Endpoints, L as Link, P as PAGE_AREA_SUGGESTIONS, g as PageContext, S as ServerConfig, b as SiteConfig, c as StartConversationResponse, U as UserContext, W as WidgetConfig, d as WidgetConfigPartial, e as WidgetSettings, f as WidgetSettingsPartial, h as assetSchema, i as blocksConfigSchema, j as connectionConfigPartialSchema, k as connectionConfigSchema, l as cssColorSchema, m as cssLengthSchema, n as endpointsSchema, o as linkSchema, p as localeSchema, q as pageContextSchema, s as serverConfigSchema, r as siteConfigSchema, t as startConversationResponseSchema, u as userContextSchema, v as uuid7Schema, w as widgetConfigPartialSchema, x as widgetConfigSchema, y as widgetSettingsPartialSchema, z as widgetSettingsSchema } from './deployment-
|
|
1
|
+
export { A as Asset, B as BlocksConfig, C as ConnectionConfig, a as ConnectionConfigPartial, E as Endpoints, L as Link, P as PAGE_AREA_SUGGESTIONS, g as PageContext, S as ServerConfig, b as SiteConfig, c as StartConversationResponse, U as UserContext, W as WidgetConfig, d as WidgetConfigPartial, e as WidgetSettings, f as WidgetSettingsPartial, h as assetSchema, i as blocksConfigSchema, j as connectionConfigPartialSchema, k as connectionConfigSchema, l as cssColorSchema, m as cssLengthSchema, n as endpointsSchema, o as linkSchema, p as localeSchema, q as pageContextSchema, s as serverConfigSchema, r as siteConfigSchema, t as startConversationResponseSchema, u as userContextSchema, v as uuid7Schema, w as widgetConfigPartialSchema, x as widgetConfigSchema, y as widgetSettingsPartialSchema, z as widgetSettingsSchema } from './deployment-BP2axIFu.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -56,9 +56,9 @@ declare const presentationSchema: z.ZodObject<{
|
|
|
56
56
|
inset: z.ZodOptional<z.ZodString>;
|
|
57
57
|
initialSize: z.ZodDefault<z.ZodEnum<{
|
|
58
58
|
fullscreen: "fullscreen";
|
|
59
|
-
normal: "normal";
|
|
60
59
|
expanded: "expanded";
|
|
61
60
|
auto: "auto";
|
|
61
|
+
normal: "normal";
|
|
62
62
|
}>>;
|
|
63
63
|
autoSizeBreakpoint: z.ZodDefault<z.ZodNumber>;
|
|
64
64
|
}, z.core.$loose>>;
|
|
@@ -148,9 +148,9 @@ declare const launcherSizeSchema: z.ZodEnum<{
|
|
|
148
148
|
}>;
|
|
149
149
|
type LauncherSize = z.infer<typeof launcherSizeSchema>;
|
|
150
150
|
declare const calloutShapeSchema: z.ZodEnum<{
|
|
151
|
+
callout: "callout";
|
|
151
152
|
pill: "pill";
|
|
152
153
|
bubble: "bubble";
|
|
153
|
-
callout: "callout";
|
|
154
154
|
}>;
|
|
155
155
|
type CalloutShape = z.infer<typeof calloutShapeSchema>;
|
|
156
156
|
declare const calloutPositionSchema: z.ZodEnum<{
|
|
@@ -162,9 +162,9 @@ type CalloutPosition = z.infer<typeof calloutPositionSchema>;
|
|
|
162
162
|
declare const launcherCalloutSchema: z.ZodObject<{
|
|
163
163
|
text: z.ZodDefault<z.ZodString>;
|
|
164
164
|
shape: z.ZodDefault<z.ZodEnum<{
|
|
165
|
+
callout: "callout";
|
|
165
166
|
pill: "pill";
|
|
166
167
|
bubble: "bubble";
|
|
167
|
-
callout: "callout";
|
|
168
168
|
}>>;
|
|
169
169
|
position: z.ZodDefault<z.ZodEnum<{
|
|
170
170
|
auto: "auto";
|
|
@@ -195,9 +195,9 @@ declare const launcherOptionsSchema: z.ZodObject<{
|
|
|
195
195
|
callout: z.ZodOptional<z.ZodObject<{
|
|
196
196
|
text: z.ZodDefault<z.ZodString>;
|
|
197
197
|
shape: z.ZodDefault<z.ZodEnum<{
|
|
198
|
+
callout: "callout";
|
|
198
199
|
pill: "pill";
|
|
199
200
|
bubble: "bubble";
|
|
200
|
-
callout: "callout";
|
|
201
201
|
}>>;
|
|
202
202
|
position: z.ZodDefault<z.ZodEnum<{
|
|
203
203
|
auto: "auto";
|
|
@@ -240,9 +240,9 @@ type LauncherOptions = z.infer<typeof launcherOptionsSchema>;
|
|
|
240
240
|
|
|
241
241
|
declare const initialSizeSchema: z.ZodEnum<{
|
|
242
242
|
fullscreen: "fullscreen";
|
|
243
|
-
normal: "normal";
|
|
244
243
|
expanded: "expanded";
|
|
245
244
|
auto: "auto";
|
|
245
|
+
normal: "normal";
|
|
246
246
|
}>;
|
|
247
247
|
declare const resizeOptionsSchema: z.ZodObject<{
|
|
248
248
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -269,9 +269,9 @@ declare const sizeOptionsSchema: z.ZodObject<{
|
|
|
269
269
|
inset: z.ZodOptional<z.ZodString>;
|
|
270
270
|
initialSize: z.ZodDefault<z.ZodEnum<{
|
|
271
271
|
fullscreen: "fullscreen";
|
|
272
|
-
normal: "normal";
|
|
273
272
|
expanded: "expanded";
|
|
274
273
|
auto: "auto";
|
|
274
|
+
normal: "normal";
|
|
275
275
|
}>>;
|
|
276
276
|
autoSizeBreakpoint: z.ZodDefault<z.ZodNumber>;
|
|
277
277
|
}, z.core.$loose>;
|
|
@@ -323,43 +323,43 @@ type FeatureFlags = z.infer<typeof featureFlagsSchema>;
|
|
|
323
323
|
*/
|
|
324
324
|
|
|
325
325
|
declare const actionNameSchema: z.ZodEnum<{
|
|
326
|
+
close: "close";
|
|
326
327
|
expand: "expand";
|
|
327
328
|
fullscreen: "fullscreen";
|
|
328
329
|
popOut: "popOut";
|
|
329
|
-
|
|
330
|
-
language: "language";
|
|
330
|
+
clear: "clear";
|
|
331
331
|
theme: "theme";
|
|
332
|
+
language: "language";
|
|
332
333
|
textSize: "textSize";
|
|
333
334
|
history: "history";
|
|
334
|
-
clear: "clear";
|
|
335
335
|
sound: "sound";
|
|
336
336
|
}>;
|
|
337
337
|
type ActionName = z.infer<typeof actionNameSchema>;
|
|
338
338
|
declare const headerActionsSchema: z.ZodArray<z.ZodEnum<{
|
|
339
|
+
close: "close";
|
|
339
340
|
expand: "expand";
|
|
340
341
|
fullscreen: "fullscreen";
|
|
341
342
|
popOut: "popOut";
|
|
342
|
-
|
|
343
|
-
language: "language";
|
|
343
|
+
clear: "clear";
|
|
344
344
|
theme: "theme";
|
|
345
|
+
language: "language";
|
|
345
346
|
textSize: "textSize";
|
|
346
347
|
history: "history";
|
|
347
|
-
clear: "clear";
|
|
348
348
|
sound: "sound";
|
|
349
349
|
}>>;
|
|
350
350
|
type HeaderActions = z.infer<typeof headerActionsSchema>;
|
|
351
351
|
/** Section wrapper — `actions` list wrapped under `header` in the dashboard form. */
|
|
352
352
|
declare const headerSchema: z.ZodObject<{
|
|
353
353
|
actions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
354
|
+
close: "close";
|
|
354
355
|
expand: "expand";
|
|
355
356
|
fullscreen: "fullscreen";
|
|
356
357
|
popOut: "popOut";
|
|
357
|
-
|
|
358
|
-
language: "language";
|
|
358
|
+
clear: "clear";
|
|
359
359
|
theme: "theme";
|
|
360
|
+
language: "language";
|
|
360
361
|
textSize: "textSize";
|
|
361
362
|
history: "history";
|
|
362
|
-
clear: "clear";
|
|
363
363
|
sound: "sound";
|
|
364
364
|
}>>>;
|
|
365
365
|
}, z.core.$loose>;
|
|
@@ -375,33 +375,33 @@ type HeaderOptions = z.infer<typeof headerSchema>;
|
|
|
375
375
|
*/
|
|
376
376
|
|
|
377
377
|
declare const feedbackEventSchema: z.ZodEnum<{
|
|
378
|
+
voiceStart: "voiceStart";
|
|
379
|
+
voiceStop: "voiceStop";
|
|
378
380
|
error: "error";
|
|
379
381
|
messageReceived: "messageReceived";
|
|
380
382
|
messageSent: "messageSent";
|
|
381
|
-
voiceStart: "voiceStart";
|
|
382
|
-
voiceStop: "voiceStop";
|
|
383
383
|
}>;
|
|
384
384
|
type FeedbackEvent = z.infer<typeof feedbackEventSchema>;
|
|
385
385
|
declare const soundOptionsSchema: z.ZodObject<{
|
|
386
386
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
387
387
|
volume: z.ZodDefault<z.ZodNumber>;
|
|
388
388
|
events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
389
|
+
voiceStart: "voiceStart";
|
|
390
|
+
voiceStop: "voiceStop";
|
|
389
391
|
error: "error";
|
|
390
392
|
messageReceived: "messageReceived";
|
|
391
393
|
messageSent: "messageSent";
|
|
392
|
-
voiceStart: "voiceStart";
|
|
393
|
-
voiceStop: "voiceStop";
|
|
394
394
|
}> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
|
|
395
395
|
}, z.core.$loose>;
|
|
396
396
|
type SoundOptions = z.infer<typeof soundOptionsSchema>;
|
|
397
397
|
declare const hapticsOptionsSchema: z.ZodObject<{
|
|
398
398
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
399
399
|
events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
400
|
+
voiceStart: "voiceStart";
|
|
401
|
+
voiceStop: "voiceStop";
|
|
400
402
|
error: "error";
|
|
401
403
|
messageReceived: "messageReceived";
|
|
402
404
|
messageSent: "messageSent";
|
|
403
|
-
voiceStart: "voiceStart";
|
|
404
|
-
voiceStop: "voiceStop";
|
|
405
405
|
}> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
|
|
406
406
|
}, z.core.$loose>;
|
|
407
407
|
type HapticsOptions = z.infer<typeof hapticsOptionsSchema>;
|
|
@@ -410,21 +410,21 @@ declare const feedbackSchema: z.ZodObject<{
|
|
|
410
410
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
411
411
|
volume: z.ZodDefault<z.ZodNumber>;
|
|
412
412
|
events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
413
|
+
voiceStart: "voiceStart";
|
|
414
|
+
voiceStop: "voiceStop";
|
|
413
415
|
error: "error";
|
|
414
416
|
messageReceived: "messageReceived";
|
|
415
417
|
messageSent: "messageSent";
|
|
416
|
-
voiceStart: "voiceStart";
|
|
417
|
-
voiceStop: "voiceStop";
|
|
418
418
|
}> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>;
|
|
419
419
|
}, z.core.$loose>>;
|
|
420
420
|
haptics: z.ZodOptional<z.ZodObject<{
|
|
421
421
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
422
422
|
events: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
423
|
+
voiceStart: "voiceStart";
|
|
424
|
+
voiceStop: "voiceStop";
|
|
423
425
|
error: "error";
|
|
424
426
|
messageReceived: "messageReceived";
|
|
425
427
|
messageSent: "messageSent";
|
|
426
|
-
voiceStart: "voiceStart";
|
|
427
|
-
voiceStop: "voiceStop";
|
|
428
428
|
}> & z.core.$partial, z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodNumber>]>>>;
|
|
429
429
|
}, z.core.$loose>>;
|
|
430
430
|
}, z.core.$loose>;
|
|
@@ -544,16 +544,16 @@ type FooterOptions = z.infer<typeof footerSchema>;
|
|
|
544
544
|
|
|
545
545
|
declare const fieldTypeSchema: z.ZodEnum<{
|
|
546
546
|
number: "number";
|
|
547
|
+
select: "select";
|
|
548
|
+
textarea: "textarea";
|
|
549
|
+
time: "time";
|
|
547
550
|
text: "text";
|
|
551
|
+
checkbox: "checkbox";
|
|
552
|
+
radio: "radio";
|
|
548
553
|
url: "url";
|
|
549
554
|
email: "email";
|
|
550
555
|
tel: "tel";
|
|
551
556
|
date: "date";
|
|
552
|
-
time: "time";
|
|
553
|
-
textarea: "textarea";
|
|
554
|
-
select: "select";
|
|
555
|
-
radio: "radio";
|
|
556
|
-
checkbox: "checkbox";
|
|
557
557
|
multiselect: "multiselect";
|
|
558
558
|
}>;
|
|
559
559
|
type FieldType = z.infer<typeof fieldTypeSchema>;
|
|
@@ -578,16 +578,16 @@ declare const formFieldSchema: z.ZodObject<{
|
|
|
578
578
|
label: z.ZodString;
|
|
579
579
|
type: z.ZodEnum<{
|
|
580
580
|
number: "number";
|
|
581
|
+
select: "select";
|
|
582
|
+
textarea: "textarea";
|
|
583
|
+
time: "time";
|
|
581
584
|
text: "text";
|
|
585
|
+
checkbox: "checkbox";
|
|
586
|
+
radio: "radio";
|
|
582
587
|
url: "url";
|
|
583
588
|
email: "email";
|
|
584
589
|
tel: "tel";
|
|
585
590
|
date: "date";
|
|
586
|
-
time: "time";
|
|
587
|
-
textarea: "textarea";
|
|
588
|
-
select: "select";
|
|
589
|
-
radio: "radio";
|
|
590
|
-
checkbox: "checkbox";
|
|
591
591
|
multiselect: "multiselect";
|
|
592
592
|
}>;
|
|
593
593
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
@@ -638,16 +638,16 @@ declare const formDefSchema: z.ZodObject<{
|
|
|
638
638
|
label: z.ZodString;
|
|
639
639
|
type: z.ZodEnum<{
|
|
640
640
|
number: "number";
|
|
641
|
+
select: "select";
|
|
642
|
+
textarea: "textarea";
|
|
643
|
+
time: "time";
|
|
641
644
|
text: "text";
|
|
645
|
+
checkbox: "checkbox";
|
|
646
|
+
radio: "radio";
|
|
642
647
|
url: "url";
|
|
643
648
|
email: "email";
|
|
644
649
|
tel: "tel";
|
|
645
650
|
date: "date";
|
|
646
|
-
time: "time";
|
|
647
|
-
textarea: "textarea";
|
|
648
|
-
select: "select";
|
|
649
|
-
radio: "radio";
|
|
650
|
-
checkbox: "checkbox";
|
|
651
651
|
multiselect: "multiselect";
|
|
652
652
|
}>;
|
|
653
653
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
@@ -680,6 +680,8 @@ declare const formDefSchema: z.ZodObject<{
|
|
|
680
680
|
always: "always";
|
|
681
681
|
}>>;
|
|
682
682
|
mirrorToContext: z.ZodDefault<z.ZodBoolean>;
|
|
683
|
+
reopenable: z.ZodDefault<z.ZodBoolean>;
|
|
684
|
+
reviewable: z.ZodDefault<z.ZodBoolean>;
|
|
683
685
|
}, z.core.$loose>;
|
|
684
686
|
type FormDef = z.infer<typeof formDefSchema>;
|
|
685
687
|
declare const formsSchema: z.ZodArray<z.ZodObject<{
|
|
@@ -696,16 +698,16 @@ declare const formsSchema: z.ZodArray<z.ZodObject<{
|
|
|
696
698
|
label: z.ZodString;
|
|
697
699
|
type: z.ZodEnum<{
|
|
698
700
|
number: "number";
|
|
701
|
+
select: "select";
|
|
702
|
+
textarea: "textarea";
|
|
703
|
+
time: "time";
|
|
699
704
|
text: "text";
|
|
705
|
+
checkbox: "checkbox";
|
|
706
|
+
radio: "radio";
|
|
700
707
|
url: "url";
|
|
701
708
|
email: "email";
|
|
702
709
|
tel: "tel";
|
|
703
710
|
date: "date";
|
|
704
|
-
time: "time";
|
|
705
|
-
textarea: "textarea";
|
|
706
|
-
select: "select";
|
|
707
|
-
radio: "radio";
|
|
708
|
-
checkbox: "checkbox";
|
|
709
711
|
multiselect: "multiselect";
|
|
710
712
|
}>;
|
|
711
713
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
@@ -738,6 +740,8 @@ declare const formsSchema: z.ZodArray<z.ZodObject<{
|
|
|
738
740
|
always: "always";
|
|
739
741
|
}>>;
|
|
740
742
|
mirrorToContext: z.ZodDefault<z.ZodBoolean>;
|
|
743
|
+
reopenable: z.ZodDefault<z.ZodBoolean>;
|
|
744
|
+
reviewable: z.ZodDefault<z.ZodBoolean>;
|
|
741
745
|
}, z.core.$loose>>;
|
|
742
746
|
type Forms = z.infer<typeof formsSchema>;
|
|
743
747
|
|
|
@@ -777,18 +781,18 @@ type I18nOptions = z.infer<typeof i18nSchema>;
|
|
|
777
781
|
*/
|
|
778
782
|
|
|
779
783
|
declare const moduleLayoutSchema: z.ZodEnum<{
|
|
784
|
+
home: "home";
|
|
780
785
|
chat: "chat";
|
|
781
786
|
help: "help";
|
|
782
|
-
home: "home";
|
|
783
787
|
news: "news";
|
|
784
788
|
}>;
|
|
785
789
|
type ModuleLayout = z.infer<typeof moduleLayoutSchema>;
|
|
786
790
|
declare const moduleSchema: z.ZodObject<{
|
|
787
791
|
label: z.ZodString;
|
|
788
792
|
layout: z.ZodEnum<{
|
|
793
|
+
home: "home";
|
|
789
794
|
chat: "chat";
|
|
790
795
|
help: "help";
|
|
791
|
-
home: "home";
|
|
792
796
|
news: "news";
|
|
793
797
|
}>;
|
|
794
798
|
contentTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -814,9 +818,9 @@ type ModuleOptions = z.infer<typeof moduleSchema>;
|
|
|
814
818
|
declare const modulesSchema: z.ZodArray<z.ZodObject<{
|
|
815
819
|
label: z.ZodString;
|
|
816
820
|
layout: z.ZodEnum<{
|
|
821
|
+
home: "home";
|
|
817
822
|
chat: "chat";
|
|
818
823
|
help: "help";
|
|
819
|
-
home: "home";
|
|
820
824
|
news: "news";
|
|
821
825
|
}>;
|
|
822
826
|
contentTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
package/schema.json
CHANGED
|
@@ -1568,6 +1568,16 @@
|
|
|
1568
1568
|
"default": true,
|
|
1569
1569
|
"description": "Mirror the answers into `userContext` so they ride every request. Set `false` for PII (DOB, policy #, symptoms) — those then go only to the submit endpoint.",
|
|
1570
1570
|
"type": "boolean"
|
|
1571
|
+
},
|
|
1572
|
+
"reopenable": {
|
|
1573
|
+
"default": true,
|
|
1574
|
+
"description": "Skipped marker offers a \"Fill out\" button that reopens the form. Set `false` when a skip must be final (e.g. a consent ask that should not be re-surfaced).",
|
|
1575
|
+
"type": "boolean"
|
|
1576
|
+
},
|
|
1577
|
+
"reviewable": {
|
|
1578
|
+
"default": true,
|
|
1579
|
+
"description": "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.",
|
|
1580
|
+
"type": "boolean"
|
|
1571
1581
|
}
|
|
1572
1582
|
},
|
|
1573
1583
|
"required": [
|
|
@@ -1576,7 +1586,9 @@
|
|
|
1576
1586
|
"fields",
|
|
1577
1587
|
"skippable",
|
|
1578
1588
|
"frequency",
|
|
1579
|
-
"mirrorToContext"
|
|
1589
|
+
"mirrorToContext",
|
|
1590
|
+
"reopenable",
|
|
1591
|
+
"reviewable"
|
|
1580
1592
|
],
|
|
1581
1593
|
"additionalProperties": {}
|
|
1582
1594
|
},
|
|
@@ -3323,6 +3335,16 @@
|
|
|
3323
3335
|
"default": true,
|
|
3324
3336
|
"description": "Mirror the answers into `userContext` so they ride every request. Set `false` for PII (DOB, policy #, symptoms) — those then go only to the submit endpoint.",
|
|
3325
3337
|
"type": "boolean"
|
|
3338
|
+
},
|
|
3339
|
+
"reopenable": {
|
|
3340
|
+
"default": true,
|
|
3341
|
+
"description": "Skipped marker offers a \"Fill out\" button that reopens the form. Set `false` when a skip must be final (e.g. a consent ask that should not be re-surfaced).",
|
|
3342
|
+
"type": "boolean"
|
|
3343
|
+
},
|
|
3344
|
+
"reviewable": {
|
|
3345
|
+
"default": true,
|
|
3346
|
+
"description": "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.",
|
|
3347
|
+
"type": "boolean"
|
|
3326
3348
|
}
|
|
3327
3349
|
},
|
|
3328
3350
|
"required": [
|
|
@@ -3331,7 +3353,9 @@
|
|
|
3331
3353
|
"fields",
|
|
3332
3354
|
"skippable",
|
|
3333
3355
|
"frequency",
|
|
3334
|
-
"mirrorToContext"
|
|
3356
|
+
"mirrorToContext",
|
|
3357
|
+
"reopenable",
|
|
3358
|
+
"reviewable"
|
|
3335
3359
|
],
|
|
3336
3360
|
"additionalProperties": {}
|
|
3337
3361
|
},
|
package/schema.mjs
CHANGED
|
@@ -429,6 +429,12 @@ var formDefSchema = z12.object({
|
|
|
429
429
|
frequency: z12.enum(["once", "conversation", "always"]).default("once").describe("`once` (per device, persisted), `conversation` (re-eligible each new conversation), or `always`."),
|
|
430
430
|
mirrorToContext: z12.boolean().default(true).describe(
|
|
431
431
|
"Mirror the answers into `userContext` so they ride every request. Set `false` for PII (DOB, policy #, symptoms) \u2014 those then go only to the submit endpoint."
|
|
432
|
+
),
|
|
433
|
+
reopenable: z12.boolean().default(true).describe(
|
|
434
|
+
'Skipped marker offers a "Fill out" button that reopens the form. Set `false` when a skip must be final (e.g. a consent ask that should not be re-surfaced).'
|
|
435
|
+
),
|
|
436
|
+
reviewable: z12.boolean().default(true).describe(
|
|
437
|
+
"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."
|
|
432
438
|
)
|
|
433
439
|
}).loose();
|
|
434
440
|
var formsSchema = z12.array(formDefSchema).max(20).describe(
|
package/web-component.mjs
CHANGED
|
@@ -665,7 +665,9 @@ function resolveForms(overrides) {
|
|
|
665
665
|
submitLabel: def.submitLabel,
|
|
666
666
|
skippable: def.skippable ?? false,
|
|
667
667
|
frequency: def.frequency ?? "once",
|
|
668
|
-
mirrorToContext: def.mirrorToContext ?? true
|
|
668
|
+
mirrorToContext: def.mirrorToContext ?? true,
|
|
669
|
+
reopenable: def.reopenable ?? true,
|
|
670
|
+
reviewable: def.reviewable ?? true
|
|
669
671
|
});
|
|
670
672
|
}
|
|
671
673
|
const byTrigger = {};
|
|
@@ -4357,7 +4359,8 @@ function FormDoneMarker({
|
|
|
4357
4359
|
"\xB7 ",
|
|
4358
4360
|
marker.title
|
|
4359
4361
|
] }) : null;
|
|
4360
|
-
const
|
|
4362
|
+
const reviewable = marker.form?.reviewable ?? false;
|
|
4363
|
+
const values = !skipped && reviewable && marker.values && Object.keys(marker.values).length > 0 ? marker.values : null;
|
|
4361
4364
|
if (values) {
|
|
4362
4365
|
const labelFor = (name) => marker.form?.fields.find((f) => f.name === name)?.label ?? name;
|
|
4363
4366
|
return /* @__PURE__ */ jsxs9("details", { class: `${p11}-form-done`, "data-outcome": marker.outcome, "data-testid": TID.formDone, children: [
|
|
@@ -4377,7 +4380,7 @@ function FormDoneMarker({
|
|
|
4377
4380
|
skipped ? /* @__PURE__ */ jsx11(SkipIcon, {}) : /* @__PURE__ */ jsx11(CheckIcon, {}),
|
|
4378
4381
|
/* @__PURE__ */ jsx11("span", { children: skipped ? strings.formSkipped : strings.formSubmitted }),
|
|
4379
4382
|
title,
|
|
4380
|
-
skipped && marker.form && onFill ? /* @__PURE__ */ jsx11("button", { type: "button", class: `${p11}-form-done-fill`, "data-testid": TID.formFill, onClick: onFill, children: strings.formFillOut }) : null
|
|
4383
|
+
skipped && marker.form?.reopenable && onFill ? /* @__PURE__ */ jsx11("button", { type: "button", class: `${p11}-form-done-fill`, "data-testid": TID.formFill, onClick: onFill, children: strings.formFillOut }) : null
|
|
4381
4384
|
] });
|
|
4382
4385
|
}
|
|
4383
4386
|
|