@helpai/elements 0.13.1 → 0.14.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 +120 -84
- package/elements-web-component.esm.js +25 -25
- package/elements-web-component.esm.js.map +4 -4
- package/elements.cjs.js +27 -27
- package/elements.cjs.js.map +4 -4
- package/elements.esm.js +27 -27
- package/elements.esm.js.map +4 -4
- package/elements.js +25 -25
- package/elements.js.map +4 -4
- package/index.d.ts +101 -38
- package/index.mjs +768 -567
- package/package.json +1 -1
- package/schema.d.ts +126 -36
- package/schema.json +673 -407
- package/schema.mjs +124 -85
- package/style.css +1 -1
- package/web-component.mjs +764 -564
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 StartSessionResponse, 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 startSessionResponseSchema, 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 StartSessionResponse, 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 startSessionResponseSchema, u as userContextSchema, v as uuid7Schema, w as widgetConfigPartialSchema, x as widgetConfigSchema, y as widgetSettingsPartialSchema, z as widgetSettingsSchema } from './deployment-Rtrqo8-b.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -548,50 +548,30 @@ declare const footerSchema: z.ZodObject<{
|
|
|
548
548
|
type FooterOptions = z.infer<typeof footerSchema>;
|
|
549
549
|
|
|
550
550
|
/**
|
|
551
|
-
*
|
|
552
|
-
*
|
|
551
|
+
* Forms section — an **event-driven forms engine**. A deployment declares an
|
|
552
|
+
* ordered array of form definitions, each bound to trigger event(s), shown as a
|
|
553
|
+
* blocking composer gate or inline in the transcript, deduped by frequency, and
|
|
554
|
+
* recorded via one shared submit endpoint (`endpoints.forms`).
|
|
553
555
|
*
|
|
554
|
-
*
|
|
555
|
-
*
|
|
556
|
-
*
|
|
557
|
-
*
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
declare const stringsOverrideSchema: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>]>;
|
|
561
|
-
type StringsOverride = z.infer<typeof stringsOverrideSchema>;
|
|
562
|
-
declare const i18nSchema: z.ZodObject<{
|
|
563
|
-
locale: z.ZodOptional<z.ZodString>;
|
|
564
|
-
defaultLocale: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodString]>>;
|
|
565
|
-
availableLocales: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
566
|
-
strings: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>]>>;
|
|
567
|
-
}, z.core.$loose>;
|
|
568
|
-
type I18nOptions = z.infer<typeof i18nSchema>;
|
|
569
|
-
|
|
570
|
-
/**
|
|
571
|
-
* Intake section — the pre-chat **lead/sales capture form**, modeled as a
|
|
572
|
-
* deterministic array of typed fields with validation. When enabled it renders
|
|
573
|
-
* as a **blocking gate**: the visitor completes (or skips, if `skippable`) the
|
|
574
|
-
* form before the composer unlocks.
|
|
575
|
-
*
|
|
576
|
-
* The same {@link formFieldSchema} shape is reused at runtime by the AI-driven
|
|
577
|
-
* **ask-input tool** (`src/ui/tool-ask-input.tsx`), so a sales/support/lead
|
|
578
|
-
* agent can both capture a lead up-front and ask for more structured info
|
|
579
|
-
* mid-conversation through one form engine.
|
|
580
|
-
*
|
|
581
|
-
* Off by default — existing deployments are unchanged. See
|
|
582
|
-
* `docs/api/hitl-and-forms.md` for the wire contract + agent presets.
|
|
556
|
+
* Generic across verticals (healthcare, insurance, dealerships, clinics) — the
|
|
557
|
+
* widget has NO industry logic; a clinic triage intake, an insurance claim form,
|
|
558
|
+
* a CSAT survey, and a sales lead capture are all just different `forms` config.
|
|
559
|
+
* The same field shape powers the AI ask-input tool. See
|
|
560
|
+
* `docs/api/hitl-and-forms.md` + `docs/features/forms-and-hitl.md`.
|
|
583
561
|
*/
|
|
584
562
|
|
|
585
563
|
declare const fieldTypeSchema: z.ZodEnum<{
|
|
586
564
|
number: "number";
|
|
587
565
|
select: "select";
|
|
588
566
|
textarea: "textarea";
|
|
567
|
+
time: "time";
|
|
589
568
|
text: "text";
|
|
590
569
|
checkbox: "checkbox";
|
|
591
570
|
radio: "radio";
|
|
592
571
|
url: "url";
|
|
593
572
|
email: "email";
|
|
594
573
|
tel: "tel";
|
|
574
|
+
date: "date";
|
|
595
575
|
multiselect: "multiselect";
|
|
596
576
|
}>;
|
|
597
577
|
type FieldType = z.infer<typeof fieldTypeSchema>;
|
|
@@ -618,12 +598,14 @@ declare const formFieldSchema: z.ZodObject<{
|
|
|
618
598
|
number: "number";
|
|
619
599
|
select: "select";
|
|
620
600
|
textarea: "textarea";
|
|
601
|
+
time: "time";
|
|
621
602
|
text: "text";
|
|
622
603
|
checkbox: "checkbox";
|
|
623
604
|
radio: "radio";
|
|
624
605
|
url: "url";
|
|
625
606
|
email: "email";
|
|
626
607
|
tel: "tel";
|
|
608
|
+
date: "date";
|
|
627
609
|
multiselect: "multiselect";
|
|
628
610
|
}>;
|
|
629
611
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
@@ -647,10 +629,87 @@ declare const formFieldSchema: z.ZodObject<{
|
|
|
647
629
|
validationHint: z.ZodOptional<z.ZodString>;
|
|
648
630
|
}, z.core.$loose>;
|
|
649
631
|
type FormField = z.infer<typeof formFieldSchema>;
|
|
650
|
-
|
|
651
|
-
|
|
632
|
+
/**
|
|
633
|
+
* Trigger string: a bare event, or `event:param` for the parameterised ones.
|
|
634
|
+
* `pre-chat` · `after-messages:N` · `conversation-closed` · `panel-close` ·
|
|
635
|
+
* `idle:Nseconds` · `page-area:<area>` · `manual`.
|
|
636
|
+
*/
|
|
637
|
+
declare const formTriggerSchema: z.ZodString;
|
|
638
|
+
declare const formConditionSchema: z.ZodObject<{
|
|
639
|
+
missingContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
640
|
+
pageArea: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
641
|
+
minMessages: z.ZodOptional<z.ZodNumber>;
|
|
642
|
+
maxMessages: z.ZodOptional<z.ZodNumber>;
|
|
643
|
+
}, z.core.$loose>;
|
|
644
|
+
type FormCondition = z.infer<typeof formConditionSchema>;
|
|
645
|
+
declare const formDefSchema: z.ZodObject<{
|
|
646
|
+
id: z.ZodString;
|
|
647
|
+
on: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
648
|
+
when: z.ZodOptional<z.ZodObject<{
|
|
649
|
+
missingContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
650
|
+
pageArea: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
651
|
+
minMessages: z.ZodOptional<z.ZodNumber>;
|
|
652
|
+
maxMessages: z.ZodOptional<z.ZodNumber>;
|
|
653
|
+
}, z.core.$loose>>;
|
|
654
|
+
fields: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
655
|
+
name: z.ZodString;
|
|
656
|
+
label: z.ZodString;
|
|
657
|
+
type: z.ZodEnum<{
|
|
658
|
+
number: "number";
|
|
659
|
+
select: "select";
|
|
660
|
+
textarea: "textarea";
|
|
661
|
+
time: "time";
|
|
662
|
+
text: "text";
|
|
663
|
+
checkbox: "checkbox";
|
|
664
|
+
radio: "radio";
|
|
665
|
+
url: "url";
|
|
666
|
+
email: "email";
|
|
667
|
+
tel: "tel";
|
|
668
|
+
date: "date";
|
|
669
|
+
multiselect: "multiselect";
|
|
670
|
+
}>;
|
|
671
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
672
|
+
required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
673
|
+
defaultValue: z.ZodOptional<z.ZodString>;
|
|
674
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
675
|
+
value: z.ZodString;
|
|
676
|
+
label: z.ZodOptional<z.ZodString>;
|
|
677
|
+
description: z.ZodOptional<z.ZodString>;
|
|
678
|
+
}, z.core.$loose>>>;
|
|
679
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
680
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
681
|
+
minLength: z.ZodOptional<z.ZodNumber>;
|
|
682
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
683
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
684
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
685
|
+
minSelections: z.ZodOptional<z.ZodNumber>;
|
|
686
|
+
maxSelections: z.ZodOptional<z.ZodNumber>;
|
|
687
|
+
}, z.core.$loose>>;
|
|
688
|
+
allowOther: z.ZodOptional<z.ZodBoolean>;
|
|
689
|
+
validationHint: z.ZodOptional<z.ZodString>;
|
|
690
|
+
}, z.core.$loose>>>;
|
|
652
691
|
title: z.ZodOptional<z.ZodString>;
|
|
653
692
|
description: z.ZodOptional<z.ZodString>;
|
|
693
|
+
submitLabel: z.ZodOptional<z.ZodString>;
|
|
694
|
+
skippable: z.ZodDefault<z.ZodBoolean>;
|
|
695
|
+
blocking: z.ZodDefault<z.ZodBoolean>;
|
|
696
|
+
frequency: z.ZodDefault<z.ZodEnum<{
|
|
697
|
+
once: "once";
|
|
698
|
+
session: "session";
|
|
699
|
+
always: "always";
|
|
700
|
+
}>>;
|
|
701
|
+
mirrorToContext: z.ZodDefault<z.ZodBoolean>;
|
|
702
|
+
}, z.core.$loose>;
|
|
703
|
+
type FormDef = z.infer<typeof formDefSchema>;
|
|
704
|
+
declare const formsSchema: z.ZodArray<z.ZodObject<{
|
|
705
|
+
id: z.ZodString;
|
|
706
|
+
on: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
707
|
+
when: z.ZodOptional<z.ZodObject<{
|
|
708
|
+
missingContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
709
|
+
pageArea: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
710
|
+
minMessages: z.ZodOptional<z.ZodNumber>;
|
|
711
|
+
maxMessages: z.ZodOptional<z.ZodNumber>;
|
|
712
|
+
}, z.core.$loose>>;
|
|
654
713
|
fields: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
655
714
|
name: z.ZodString;
|
|
656
715
|
label: z.ZodString;
|
|
@@ -658,12 +717,14 @@ declare const intakeSchema: z.ZodObject<{
|
|
|
658
717
|
number: "number";
|
|
659
718
|
select: "select";
|
|
660
719
|
textarea: "textarea";
|
|
720
|
+
time: "time";
|
|
661
721
|
text: "text";
|
|
662
722
|
checkbox: "checkbox";
|
|
663
723
|
radio: "radio";
|
|
664
724
|
url: "url";
|
|
665
725
|
email: "email";
|
|
666
726
|
tel: "tel";
|
|
727
|
+
date: "date";
|
|
667
728
|
multiselect: "multiselect";
|
|
668
729
|
}>;
|
|
669
730
|
placeholder: z.ZodOptional<z.ZodString>;
|
|
@@ -686,10 +747,39 @@ declare const intakeSchema: z.ZodObject<{
|
|
|
686
747
|
allowOther: z.ZodOptional<z.ZodBoolean>;
|
|
687
748
|
validationHint: z.ZodOptional<z.ZodString>;
|
|
688
749
|
}, z.core.$loose>>>;
|
|
750
|
+
title: z.ZodOptional<z.ZodString>;
|
|
751
|
+
description: z.ZodOptional<z.ZodString>;
|
|
689
752
|
submitLabel: z.ZodOptional<z.ZodString>;
|
|
690
753
|
skippable: z.ZodDefault<z.ZodBoolean>;
|
|
754
|
+
blocking: z.ZodDefault<z.ZodBoolean>;
|
|
755
|
+
frequency: z.ZodDefault<z.ZodEnum<{
|
|
756
|
+
once: "once";
|
|
757
|
+
session: "session";
|
|
758
|
+
always: "always";
|
|
759
|
+
}>>;
|
|
760
|
+
mirrorToContext: z.ZodDefault<z.ZodBoolean>;
|
|
761
|
+
}, z.core.$loose>>;
|
|
762
|
+
type Forms = z.infer<typeof formsSchema>;
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* i18n section schemas — locale resolution + per-instance string
|
|
766
|
+
* overrides.
|
|
767
|
+
*
|
|
768
|
+
* The runtime layers three sources to pick the active locale (highest
|
|
769
|
+
* wins): user picker → server-pushed → `locale` field → `defaultLocale`
|
|
770
|
+
* (or `"auto"` → `navigator.language`). `availableLocales` controls the
|
|
771
|
+
* runtime language switcher's option list.
|
|
772
|
+
*/
|
|
773
|
+
|
|
774
|
+
declare const stringsOverrideSchema: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>]>;
|
|
775
|
+
type StringsOverride = z.infer<typeof stringsOverrideSchema>;
|
|
776
|
+
declare const i18nSchema: z.ZodObject<{
|
|
777
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
778
|
+
defaultLocale: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodString]>>;
|
|
779
|
+
availableLocales: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
780
|
+
strings: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>]>>;
|
|
691
781
|
}, z.core.$loose>;
|
|
692
|
-
type
|
|
782
|
+
type I18nOptions = z.infer<typeof i18nSchema>;
|
|
693
783
|
|
|
694
784
|
/**
|
|
695
785
|
* Modules section — the Intercom-style "messenger" surface, modeled as a
|
|
@@ -811,4 +901,4 @@ declare const ALL_MODES: readonly Mode[];
|
|
|
811
901
|
*/
|
|
812
902
|
declare function emitJsonSchema(): unknown;
|
|
813
903
|
|
|
814
|
-
export { ALL_MODES, type ActionName, type AttachmentLimits, type Behavior, type CalloutPosition, type CalloutShape, type ComposerOptions, type FeatureFlags, type FeedbackEvent, type FeedbackOptions, type FieldOption, type FieldType, type FieldValidation, type FooterOptions, type FormField, type HapticsOptions, type HeaderActions, type HeaderOptions, type I18nOptions, type
|
|
904
|
+
export { ALL_MODES, type ActionName, type AttachmentLimits, type Behavior, type CalloutPosition, type CalloutShape, type ComposerOptions, type FeatureFlags, type FeedbackEvent, type FeedbackOptions, type FieldOption, type FieldType, type FieldValidation, type FooterOptions, type FormCondition, type FormDef, type FormField, type Forms, type HapticsOptions, type HeaderActions, type HeaderOptions, type I18nOptions, type LauncherCallout, type LauncherOptions, type LauncherSize, type LauncherVariant, type Mode, type ModuleLayout, type ModuleOptions, type ModulesOptions, type Position, type PoweredBy, type Presentation, type ResizeOptions, type ResponseMode, type SendButtonOptions, type SizeOptions, type SoundOptions, type StringsOverride, type ThemeOverrides, type ThemePreference, type VoiceMode, type WelcomeAnimation, type WelcomeOptions, actionNameSchema, attachmentLimitsSchema, behaviorSchema, calloutPositionSchema, calloutShapeSchema, composerOptionsSchema, emitJsonSchema, featureFlagsSchema, feedbackEventSchema, feedbackSchema, fieldOptionSchema, fieldTypeSchema, fieldValidationSchema, footerSchema, formConditionSchema, formDefSchema, formFieldSchema, formTriggerSchema, formsSchema, hapticsOptionsSchema, headerActionsSchema, headerSchema, i18nSchema, initialSizeSchema, launcherCalloutSchema, launcherOptionsSchema, launcherSizeSchema, launcherVariantSchema, modeSchema, moduleLayoutSchema, moduleSchema, modulesSchema, positionSchema, poweredBySchema, presentationSchema, resizeOptionsSchema, responseModeSchema, sendButtonIconSchema, sendButtonOptionsSchema, sendButtonShapeSchema, sendButtonVariantSchema, sizeOptionsSchema, soundOptionsSchema, stringsOverrideSchema, themeFieldSchema, themeOverridesSchema, themePreferenceSchema, toolRefSchema, voiceModeSchema, welcomeAnimationSchema, welcomeOptionsSchema, widgetSettingsSchemaForMode };
|