@wix/form-public 0.172.0 → 0.174.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/dist/index.cjs CHANGED
@@ -384,9 +384,9 @@ var init_types_impl = __esm({
384
384
  LayoutDataImagePosition4["BOTTOM_LEFT"] = "BOTTOM_LEFT";
385
385
  LayoutDataImagePosition4["BOTTOM_RIGHT"] = "BOTTOM_RIGHT";
386
386
  })(LayoutDataImagePosition || (LayoutDataImagePosition = {}));
387
- (function(Origin2) {
388
- Origin2["IMAGE"] = "IMAGE";
389
- Origin2["LAYOUT"] = "LAYOUT";
387
+ (function(Origin3) {
388
+ Origin3["IMAGE"] = "IMAGE";
389
+ Origin3["LAYOUT"] = "LAYOUT";
390
390
  })(Origin || (Origin = {}));
391
391
  (function(VerticalAlignmentAlignment5) {
392
392
  VerticalAlignmentAlignment5["TOP"] = "TOP";
@@ -666,10 +666,10 @@ var init_types_impl = __esm({
666
666
  ResultsDisplay3["PASSING_STATUS"] = "PASSING_STATUS";
667
667
  ResultsDisplay3["SCORE_AND_PASSING_STATUS"] = "SCORE_AND_PASSING_STATUS";
668
668
  })(ResultsDisplay || (ResultsDisplay = {}));
669
- (function(ContactAutofill2) {
670
- ContactAutofill2["UNKNOWN_CONTACT_AUTOFILL"] = "UNKNOWN_CONTACT_AUTOFILL";
671
- ContactAutofill2["MEMBER_DATA"] = "MEMBER_DATA";
672
- ContactAutofill2["FORM_INPUT"] = "FORM_INPUT";
669
+ (function(ContactAutofill3) {
670
+ ContactAutofill3["UNKNOWN_CONTACT_AUTOFILL"] = "UNKNOWN_CONTACT_AUTOFILL";
671
+ ContactAutofill3["MEMBER_DATA"] = "MEMBER_DATA";
672
+ ContactAutofill3["FORM_INPUT"] = "FORM_INPUT";
673
673
  })(ContactAutofill || (ContactAutofill = {}));
674
674
  (function(Fieldset2) {
675
675
  Fieldset2["UNKNOWN"] = "UNKNOWN";
@@ -4895,7 +4895,7 @@ var init_max = __esm({
4895
4895
  });
4896
4896
 
4897
4897
  // ../../node_modules/@wix/ambassador-forms-v1-validation-result/es/build/types.impl.js
4898
- var ErrorType, Format2, ValidationFormat2, ProductType2, PriceType2, FieldFieldType2, StringTypeFormatEnumFormat2, InputFieldStringComponentType2, NodeType2, WidthType2, PluginContainerDataAlignment2, Type2, Target2, TextAlignment2, LineStyle2, Width2, Alignment2, ViewMode2, LayoutType2, Orientation2, Crop2, ThumbnailsAlignment2, GIFType2, Source2, Position2, MapType3, ViewRole2, VoteRole2, PollLayoutType2, PollLayoutDirection2, BackgroundType2, DecorationType2, FontType2, ImageStylesPosition2, AspectRatio2, Resizing2, Placement2, CardStylesType2, CardStylesAlignment2, CardStylesLayout2, AppType2, InitialExpandedItems2, Direction2, VerticalAlignment2, NullValue2, Scaling2, LayoutDataImagePosition2, VerticalAlignmentAlignment2, ResponsivenessBehaviour2, DesignTarget2, ImagePosition2, AlignmentEnumAlignment2, ImageFit2, NumberOfColumns2, FirstDayOfWeekEnumFirstDayOfWeek2, InputFieldNumberComponentType2, InputFieldBooleanComponentType2, ArrayItemsItemType2, PropertiesTypePropertiesTypeEnum2, ArrayComponentType2, InputFieldWixFileComponentType2, UploadFileFormat2, InputFieldPaymentComponentType2, AddressComponentType2, DefaultCountryConfigType2, ObjectArrayComponentType2, InputFieldSchedulingComponentType2, AppointmentFormat2, InputFieldInputType2, FormFieldContactInfoEmailInfoTag2, FormFieldContactInfoPhoneInfoTag2, AddressInfoTag2, ConfirmationLevel2, FormFieldContactInfoContactField2, DisplayFieldDisplayFieldType2, OverrideEntityType2, Kind2, EmailInfoTag2, PhoneInfoTag2, Tag2, OptInLevel2, ContactField2, SpamFilterProtectionLevel2, RequiredIndicator2, RequiredIndicatorPlacement2, UrlTargetEnumTarget2, SubmitSuccessAction2, ChangeableProperty2, OverrideEntityTypeEnumOverrideEntityType2, Operator2, ResultsDisplay2, ValidationMode, Feature, AscendPlan, ActionType;
4898
+ var ErrorType, Format2, ValidationFormat2, ProductType2, PriceType2, FieldFieldType2, StringTypeFormatEnumFormat2, InputFieldStringComponentType2, NodeType2, WidthType2, PluginContainerDataAlignment2, Type2, Target2, TextAlignment2, LineStyle2, Width2, Alignment2, ViewMode2, LayoutType2, Orientation2, Crop2, ThumbnailsAlignment2, GIFType2, Source2, Position2, MapType3, ViewRole2, VoteRole2, PollLayoutType2, PollLayoutDirection2, BackgroundType2, DecorationType2, FontType2, ImageStylesPosition2, AspectRatio2, Resizing2, Placement2, CardStylesType2, CardStylesAlignment2, CardStylesLayout2, AppType2, InitialExpandedItems2, Direction2, VerticalAlignment2, NullValue2, Scaling2, LayoutDataImagePosition2, Origin2, VerticalAlignmentAlignment2, ResponsivenessBehaviour2, DesignTarget2, ImagePosition2, AlignmentEnumAlignment2, ImageFit2, NumberOfColumns2, FirstDayOfWeekEnumFirstDayOfWeek2, InputFieldNumberComponentType2, InputFieldBooleanComponentType2, ArrayItemsItemType2, PropertiesTypePropertiesTypeEnum2, ArrayComponentType2, InputFieldWixFileComponentType2, UploadFileFormat2, InputFieldPaymentComponentType2, AddressComponentType2, DefaultCountryConfigType2, ObjectArrayComponentType2, InputFieldSchedulingComponentType2, AppointmentFormat2, InputFieldInputType2, FormFieldContactInfoEmailInfoTag2, FormFieldContactInfoPhoneInfoTag2, AddressInfoTag2, ConfirmationLevel2, SubscriptionChannel, FormFieldContactInfoContactField2, DisplayFieldDisplayFieldType2, OverrideEntityType2, Kind2, EmailInfoTag2, PhoneInfoTag2, Tag2, OptInLevel2, ContactField2, SpamFilterProtectionLevel2, RequiredIndicator2, RequiredIndicatorPlacement2, UrlTargetEnumTarget2, SubmitSuccessAction2, ChangeableProperty2, OverrideEntityTypeEnumOverrideEntityType2, Operator2, ResultsDisplay2, ContactAutofill2, ValidationMode, Feature, AscendPlan, ActionType;
4899
4899
  var init_types_impl2 = __esm({
4900
4900
  "../../node_modules/@wix/ambassador-forms-v1-validation-result/es/build/types.impl.js"() {
4901
4901
  (function(ErrorType2) {
@@ -4933,6 +4933,7 @@ var init_types_impl2 = __esm({
4933
4933
  ErrorType2["DECIMAL_POINT_ERROR"] = "DECIMAL_POINT_ERROR";
4934
4934
  ErrorType2["INCOMPLETE_DATE_ERROR"] = "INCOMPLETE_DATE_ERROR";
4935
4935
  ErrorType2["INVALID_VALUE_FOR_PATTERN_ERROR"] = "INVALID_VALUE_FOR_PATTERN_ERROR";
4936
+ ErrorType2["INVALID_DEFAULT_VALUE_ERROR"] = "INVALID_DEFAULT_VALUE_ERROR";
4936
4937
  })(ErrorType || (ErrorType = {}));
4937
4938
  (function(Format6) {
4938
4939
  Format6["UNDEFINED"] = "UNDEFINED";
@@ -5245,6 +5246,10 @@ var init_types_impl2 = __esm({
5245
5246
  LayoutDataImagePosition4["BOTTOM_LEFT"] = "BOTTOM_LEFT";
5246
5247
  LayoutDataImagePosition4["BOTTOM_RIGHT"] = "BOTTOM_RIGHT";
5247
5248
  })(LayoutDataImagePosition2 || (LayoutDataImagePosition2 = {}));
5249
+ (function(Origin3) {
5250
+ Origin3["IMAGE"] = "IMAGE";
5251
+ Origin3["LAYOUT"] = "LAYOUT";
5252
+ })(Origin2 || (Origin2 = {}));
5248
5253
  (function(VerticalAlignmentAlignment5) {
5249
5254
  VerticalAlignmentAlignment5["TOP"] = "TOP";
5250
5255
  VerticalAlignmentAlignment5["MIDDLE"] = "MIDDLE";
@@ -5388,6 +5393,11 @@ var init_types_impl2 = __esm({
5388
5393
  ConfirmationLevel4["SINGLE_CONFIRMATION"] = "SINGLE_CONFIRMATION";
5389
5394
  ConfirmationLevel4["DOUBLE_CONFIRMATION"] = "DOUBLE_CONFIRMATION";
5390
5395
  })(ConfirmationLevel2 || (ConfirmationLevel2 = {}));
5396
+ (function(SubscriptionChannel2) {
5397
+ SubscriptionChannel2["UNKNOWN_SUBSCRIPTION_CHANNEL"] = "UNKNOWN_SUBSCRIPTION_CHANNEL";
5398
+ SubscriptionChannel2["EMAIL"] = "EMAIL";
5399
+ SubscriptionChannel2["SMS"] = "SMS";
5400
+ })(SubscriptionChannel || (SubscriptionChannel = {}));
5391
5401
  (function(FormFieldContactInfoContactField3) {
5392
5402
  FormFieldContactInfoContactField3["UNKNOWN_CONTACT_FIELD"] = "UNKNOWN_CONTACT_FIELD";
5393
5403
  FormFieldContactInfoContactField3["FIRST_NAME"] = "FIRST_NAME";
@@ -5523,6 +5533,11 @@ var init_types_impl2 = __esm({
5523
5533
  ResultsDisplay3["PASSING_STATUS"] = "PASSING_STATUS";
5524
5534
  ResultsDisplay3["SCORE_AND_PASSING_STATUS"] = "SCORE_AND_PASSING_STATUS";
5525
5535
  })(ResultsDisplay2 || (ResultsDisplay2 = {}));
5536
+ (function(ContactAutofill3) {
5537
+ ContactAutofill3["UNKNOWN_CONTACT_AUTOFILL"] = "UNKNOWN_CONTACT_AUTOFILL";
5538
+ ContactAutofill3["MEMBER_DATA"] = "MEMBER_DATA";
5539
+ ContactAutofill3["FORM_INPUT"] = "FORM_INPUT";
5540
+ })(ContactAutofill2 || (ContactAutofill2 = {}));
5526
5541
  (function(ValidationMode2) {
5527
5542
  ValidationMode2["UNKNOWN"] = "UNKNOWN";
5528
5543
  ValidationMode2["UNRESTRICTED_UPDATE"] = "UNRESTRICTED_UPDATE";
@@ -25350,7 +25365,9 @@ var NOW_VALUE = "$now";
25350
25365
 
25351
25366
  // ../form-fields/dist/esm/constants/experiments.js
25352
25367
  var EXPERIMENTS = {
25353
- USE_FIELDS_V2: "specs.forms.UseFieldsV2"};
25368
+ USE_FIELDS_V2: "specs.forms.UseFieldsV2",
25369
+ SUBMIT_SUCCESS_NO_FOCUS: "specs.forms.SubmitSuccessNoFocus"
25370
+ };
25354
25371
 
25355
25372
  // ../form-fields/dist/esm/constants/breakpoints.js
25356
25373
  var Breakpoint = /* @__PURE__ */ (function(Breakpoint2) {
@@ -25974,7 +25991,8 @@ var defaultErrorKeys = {
25974
25991
  [ErrorType.EXACT_ITEMS_NUMBER_ERROR]: "input.error.message.exact-items-number-error",
25975
25992
  [ErrorType.DECIMAL_POINT_ERROR]: "input.error.message.decimal_point_error",
25976
25993
  [ErrorType.INCOMPLETE_DATE_ERROR]: "input.error.message.incomplete-date-error",
25977
- [ErrorType.INVALID_VALUE_FOR_PATTERN_ERROR]: "input.error.message.invalid-value-for-pattern"
25994
+ [ErrorType.INVALID_VALUE_FOR_PATTERN_ERROR]: "input.error.message.invalid-value-for-pattern",
25995
+ [ErrorType.INVALID_DEFAULT_VALUE_ERROR]: "input.error.message.invalid-default-value-error"
25978
25996
  };
25979
25997
  var getTranslatedError = (_ref) => {
25980
25998
  let {
@@ -32126,6 +32144,8 @@ var useSubmit = ({ validateAndScrollToError, submitAction, onSubmit, onSubmitSuc
32126
32144
  const { report } = useBi();
32127
32145
  const fireSubmitSuccess = useSubmitSuccessTrigger();
32128
32146
  const panorama = usePanorama();
32147
+ const { isExperimentEnabled } = useExperiments();
32148
+ const focusOnSubmitSuccess = !isExperimentEnabled(EXPERIMENTS.SUBMIT_SUCCESS_NO_FOCUS);
32129
32149
  const reportSubmitFormBi = React42.useCallback(({ status, id }) => report(submitFormClick({
32130
32150
  submission_status: status,
32131
32151
  submission_id: id ?? void 0
@@ -32141,9 +32161,11 @@ var useSubmit = ({ validateAndScrollToError, submitAction, onSubmit, onSubmitSuc
32141
32161
  if (submitSettings?.thankYouMessageOptions?.durationInSeconds) {
32142
32162
  setTimeout(() => {
32143
32163
  setSubmitSuccessMessage(void 0);
32144
- handleStepChange(0);
32164
+ if (focusOnSubmitSuccess) {
32165
+ handleStepChange(0);
32166
+ }
32145
32167
  }, submitSettings?.thankYouMessageOptions?.durationInSeconds * 1e3);
32146
- } else {
32168
+ } else if (focusOnSubmitSuccess) {
32147
32169
  handleStepChange(0);
32148
32170
  }
32149
32171
  } else if (action === SubmitSuccessAction.REDIRECT) {
@@ -32155,6 +32177,7 @@ var useSubmit = ({ validateAndScrollToError, submitAction, onSubmit, onSubmitSuc
32155
32177
  t,
32156
32178
  submitSettings,
32157
32179
  handleStepChange,
32180
+ focusOnSubmitSuccess,
32158
32181
  navigateToCheckout,
32159
32182
  setSubmitSuccessMessage,
32160
32183
  setSubmitFailureCode,