@wix/headless-forms 0.0.32 → 0.0.34
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/cjs/dist/react/index.d.ts +1 -1
- package/cjs/dist/react/index.js +2 -1
- package/cjs/dist/services/form-service.d.ts +1 -1
- package/cjs/dist/services/form-service.js +8 -8
- package/cjs/dist/services/utils/fetch-site-config.js +2 -2
- package/cjs/dist/services/utils/index.d.ts +3 -3
- package/cjs/dist/services/utils/index.js +10 -10
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/dist/services/form-service.d.ts +1 -1
- package/dist/services/form-service.js +1 -1
- package/dist/services/utils/fetch-site-config.js +1 -1
- package/dist/services/utils/index.d.ts +3 -3
- package/dist/services/utils/index.js +3 -3
- package/package.json +3 -3
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * as Form from './Form.js';
|
|
2
2
|
export * from './types.js';
|
|
3
|
-
export { Checkbox, CheckboxGroup, DateInput, DatePicker, DateTimeInput, Dropdown, FileUpload, MultilineAddress, NumberInput, PhoneInput, RadioGroup, RatingInput, Tags, TextArea, TextInput, TimeInput, LoginBar, SubmitButton, FormProvider, FixedPayment, ProductList, Donation, PaymentInput, Signature, } from '@wix/form-public';
|
|
3
|
+
export { Checkbox, CheckboxGroup, DateInput, DatePicker, DateTimeInput, Dropdown, FileUpload, MultilineAddress, NumberInput, PhoneInput, RadioGroup, RatingInput, Tags, TextArea, TextInput, TimeInput, LoginBar, SubmitButton, FormProvider, FixedPayment, ProductList, Donation, PaymentInput, Signature, RichText, } from '@wix/form-public';
|
package/cjs/dist/react/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.Signature = exports.PaymentInput = exports.Donation = exports.ProductList = exports.FixedPayment = exports.FormProvider = exports.SubmitButton = exports.LoginBar = exports.TimeInput = exports.TextInput = exports.TextArea = exports.Tags = exports.RatingInput = exports.RadioGroup = exports.PhoneInput = exports.NumberInput = exports.MultilineAddress = exports.FileUpload = exports.Dropdown = exports.DateTimeInput = exports.DatePicker = exports.DateInput = exports.CheckboxGroup = exports.Checkbox = exports.Form = void 0;
|
|
39
|
+
exports.RichText = exports.Signature = exports.PaymentInput = exports.Donation = exports.ProductList = exports.FixedPayment = exports.FormProvider = exports.SubmitButton = exports.LoginBar = exports.TimeInput = exports.TextInput = exports.TextArea = exports.Tags = exports.RatingInput = exports.RadioGroup = exports.PhoneInput = exports.NumberInput = exports.MultilineAddress = exports.FileUpload = exports.Dropdown = exports.DateTimeInput = exports.DatePicker = exports.DateInput = exports.CheckboxGroup = exports.Checkbox = exports.Form = void 0;
|
|
40
40
|
exports.Form = __importStar(require("./Form.js"));
|
|
41
41
|
__exportStar(require("./types.js"), exports);
|
|
42
42
|
var form_public_1 = require("@wix/form-public");
|
|
@@ -64,3 +64,4 @@ Object.defineProperty(exports, "ProductList", { enumerable: true, get: function
|
|
|
64
64
|
Object.defineProperty(exports, "Donation", { enumerable: true, get: function () { return form_public_1.Donation; } });
|
|
65
65
|
Object.defineProperty(exports, "PaymentInput", { enumerable: true, get: function () { return form_public_1.PaymentInput; } });
|
|
66
66
|
Object.defineProperty(exports, "Signature", { enumerable: true, get: function () { return form_public_1.Signature; } });
|
|
67
|
+
Object.defineProperty(exports, "RichText", { enumerable: true, get: function () { return form_public_1.RichText; } });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { forms } from '@wix/forms';
|
|
2
2
|
import { type ReadOnlySignal } from '@wix/services-definitions/core-services/signals';
|
|
3
3
|
import { FormValues } from '../react/types.js';
|
|
4
|
-
import { type SiteConfig } from './utils';
|
|
4
|
+
import { type SiteConfig } from './utils/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Response type for form submission operations.
|
|
7
7
|
* Represents the different states a form submission can be in.
|
|
@@ -5,7 +5,7 @@ exports.loadFormServiceConfig = loadFormServiceConfig;
|
|
|
5
5
|
const forms_1 = require("@wix/forms");
|
|
6
6
|
const services_definitions_1 = require("@wix/services-definitions");
|
|
7
7
|
const signals_1 = require("@wix/services-definitions/core-services/signals");
|
|
8
|
-
const
|
|
8
|
+
const index_js_1 = require("./utils/index.js");
|
|
9
9
|
const auto_sdk_forms_forms_1 = require("@wix/auto_sdk_forms_forms");
|
|
10
10
|
/**
|
|
11
11
|
* Service definition for the Form service.
|
|
@@ -77,18 +77,18 @@ exports.FormService = services_definitions_1.implementService.withConfig()(expor
|
|
|
77
77
|
isLoadingSignal.set(false);
|
|
78
78
|
throw err;
|
|
79
79
|
}
|
|
80
|
-
if (!hasAddressTemplates && (0,
|
|
80
|
+
if (!hasAddressTemplates && (0, index_js_1.hasMultilineAddressField)(form)) {
|
|
81
81
|
loadAddressTemplates();
|
|
82
82
|
}
|
|
83
83
|
isLoadingSignal.set(false);
|
|
84
84
|
}
|
|
85
85
|
async function loadAddressTemplates() {
|
|
86
86
|
const form = formSignal.get();
|
|
87
|
-
if (!form || !(0,
|
|
87
|
+
if (!form || !(0, index_js_1.hasMultilineAddressField)(form)) {
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
try {
|
|
91
|
-
const addressTemplates = await (0,
|
|
91
|
+
const addressTemplates = await (0, index_js_1.fetchAddressForms)();
|
|
92
92
|
if (addressTemplates) {
|
|
93
93
|
addressTemplatesSignal.set(addressTemplates);
|
|
94
94
|
}
|
|
@@ -103,7 +103,7 @@ exports.FormService = services_definitions_1.implementService.withConfig()(expor
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
async function loadSiteConfig() {
|
|
106
|
-
const siteConfig = await (0,
|
|
106
|
+
const siteConfig = await (0, index_js_1.fetchSiteConfig)();
|
|
107
107
|
if (siteConfig) {
|
|
108
108
|
siteConfigSignal.set(siteConfig);
|
|
109
109
|
}
|
|
@@ -205,9 +205,9 @@ async function fetchForm({ id, namespace = 'wix.form_app.form', additionalMetada
|
|
|
205
205
|
async function loadFormServiceConfig(formId, namespace, additionalMetadata) {
|
|
206
206
|
const form = await fetchForm({ id: formId, namespace, additionalMetadata });
|
|
207
207
|
let addressTemplates;
|
|
208
|
-
if ((0,
|
|
209
|
-
addressTemplates = await (0,
|
|
208
|
+
if ((0, index_js_1.hasMultilineAddressField)(form)) {
|
|
209
|
+
addressTemplates = await (0, index_js_1.fetchAddressForms)();
|
|
210
210
|
}
|
|
211
|
-
const siteConfig = await (0,
|
|
211
|
+
const siteConfig = await (0, index_js_1.fetchSiteConfig)();
|
|
212
212
|
return { form, addressTemplates, siteConfig };
|
|
213
213
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEFAULT_CURRENCY = exports.DEFAULT_LOCALE = void 0;
|
|
4
4
|
exports.fetchSiteConfig = fetchSiteConfig;
|
|
5
|
-
const
|
|
5
|
+
const currencies_js_1 = require("./currencies.js");
|
|
6
6
|
const essentials_1 = require("@wix/essentials");
|
|
7
7
|
exports.DEFAULT_LOCALE = { country: 'US', lang: 'en' };
|
|
8
8
|
exports.DEFAULT_CURRENCY = { sign: '$', code: 'USD' };
|
|
@@ -21,7 +21,7 @@ async function fetchSiteConfig() {
|
|
|
21
21
|
}
|
|
22
22
|
const country = siteProperties?.localeCountry ?? exports.DEFAULT_LOCALE.country;
|
|
23
23
|
const languageCode = siteProperties?.localeLanguageCode ?? exports.DEFAULT_LOCALE.lang;
|
|
24
|
-
const currency =
|
|
24
|
+
const currency = currencies_js_1.currencies.find(({ key }) => key === siteProperties?.paymentCurrency);
|
|
25
25
|
return {
|
|
26
26
|
locale: {
|
|
27
27
|
country,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { getUploadUrl, uploadFile } from './file-upload-utils';
|
|
2
|
-
export { hasMultilineAddressField, fetchAddressForms } from './address-forms';
|
|
3
|
-
export { fetchSiteConfig, DEFAULT_CURRENCY, DEFAULT_LOCALE, type SiteConfig, } from './fetch-site-config';
|
|
1
|
+
export { getUploadUrl, uploadFile } from './file-upload-utils.js';
|
|
2
|
+
export { hasMultilineAddressField, fetchAddressForms, } from './address-forms.js';
|
|
3
|
+
export { fetchSiteConfig, DEFAULT_CURRENCY, DEFAULT_LOCALE, type SiteConfig, } from './fetch-site-config.js';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DEFAULT_LOCALE = exports.DEFAULT_CURRENCY = exports.fetchSiteConfig = exports.fetchAddressForms = exports.hasMultilineAddressField = exports.uploadFile = exports.getUploadUrl = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "getUploadUrl", { enumerable: true, get: function () { return
|
|
6
|
-
Object.defineProperty(exports, "uploadFile", { enumerable: true, get: function () { return
|
|
7
|
-
var
|
|
8
|
-
Object.defineProperty(exports, "hasMultilineAddressField", { enumerable: true, get: function () { return
|
|
9
|
-
Object.defineProperty(exports, "fetchAddressForms", { enumerable: true, get: function () { return
|
|
10
|
-
var
|
|
11
|
-
Object.defineProperty(exports, "fetchSiteConfig", { enumerable: true, get: function () { return
|
|
12
|
-
Object.defineProperty(exports, "DEFAULT_CURRENCY", { enumerable: true, get: function () { return
|
|
13
|
-
Object.defineProperty(exports, "DEFAULT_LOCALE", { enumerable: true, get: function () { return
|
|
4
|
+
var file_upload_utils_js_1 = require("./file-upload-utils.js");
|
|
5
|
+
Object.defineProperty(exports, "getUploadUrl", { enumerable: true, get: function () { return file_upload_utils_js_1.getUploadUrl; } });
|
|
6
|
+
Object.defineProperty(exports, "uploadFile", { enumerable: true, get: function () { return file_upload_utils_js_1.uploadFile; } });
|
|
7
|
+
var address_forms_js_1 = require("./address-forms.js");
|
|
8
|
+
Object.defineProperty(exports, "hasMultilineAddressField", { enumerable: true, get: function () { return address_forms_js_1.hasMultilineAddressField; } });
|
|
9
|
+
Object.defineProperty(exports, "fetchAddressForms", { enumerable: true, get: function () { return address_forms_js_1.fetchAddressForms; } });
|
|
10
|
+
var fetch_site_config_js_1 = require("./fetch-site-config.js");
|
|
11
|
+
Object.defineProperty(exports, "fetchSiteConfig", { enumerable: true, get: function () { return fetch_site_config_js_1.fetchSiteConfig; } });
|
|
12
|
+
Object.defineProperty(exports, "DEFAULT_CURRENCY", { enumerable: true, get: function () { return fetch_site_config_js_1.DEFAULT_CURRENCY; } });
|
|
13
|
+
Object.defineProperty(exports, "DEFAULT_LOCALE", { enumerable: true, get: function () { return fetch_site_config_js_1.DEFAULT_LOCALE; } });
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * as Form from './Form.js';
|
|
2
2
|
export * from './types.js';
|
|
3
|
-
export { Checkbox, CheckboxGroup, DateInput, DatePicker, DateTimeInput, Dropdown, FileUpload, MultilineAddress, NumberInput, PhoneInput, RadioGroup, RatingInput, Tags, TextArea, TextInput, TimeInput, LoginBar, SubmitButton, FormProvider, FixedPayment, ProductList, Donation, PaymentInput, Signature, } from '@wix/form-public';
|
|
3
|
+
export { Checkbox, CheckboxGroup, DateInput, DatePicker, DateTimeInput, Dropdown, FileUpload, MultilineAddress, NumberInput, PhoneInput, RadioGroup, RatingInput, Tags, TextArea, TextInput, TimeInput, LoginBar, SubmitButton, FormProvider, FixedPayment, ProductList, Donation, PaymentInput, Signature, RichText, } from '@wix/form-public';
|
package/dist/react/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * as Form from './Form.js';
|
|
2
2
|
export * from './types.js';
|
|
3
|
-
export { Checkbox, CheckboxGroup, DateInput, DatePicker, DateTimeInput, Dropdown, FileUpload, MultilineAddress, NumberInput, PhoneInput, RadioGroup, RatingInput, Tags, TextArea, TextInput, TimeInput, LoginBar, SubmitButton, FormProvider, FixedPayment, ProductList, Donation, PaymentInput, Signature, } from '@wix/form-public';
|
|
3
|
+
export { Checkbox, CheckboxGroup, DateInput, DatePicker, DateTimeInput, Dropdown, FileUpload, MultilineAddress, NumberInput, PhoneInput, RadioGroup, RatingInput, Tags, TextArea, TextInput, TimeInput, LoginBar, SubmitButton, FormProvider, FixedPayment, ProductList, Donation, PaymentInput, Signature, RichText, } from '@wix/form-public';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { forms } from '@wix/forms';
|
|
2
2
|
import { type ReadOnlySignal } from '@wix/services-definitions/core-services/signals';
|
|
3
3
|
import { FormValues } from '../react/types.js';
|
|
4
|
-
import { type SiteConfig } from './utils';
|
|
4
|
+
import { type SiteConfig } from './utils/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Response type for form submission operations.
|
|
7
7
|
* Represents the different states a form submission can be in.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { forms, submissions } from '@wix/forms';
|
|
2
2
|
import { defineService, implementService } from '@wix/services-definitions';
|
|
3
3
|
import { SignalsServiceDefinition, } from '@wix/services-definitions/core-services/signals';
|
|
4
|
-
import { fetchAddressForms, hasMultilineAddressField, fetchSiteConfig, } from './utils';
|
|
4
|
+
import { fetchAddressForms, hasMultilineAddressField, fetchSiteConfig, } from './utils/index.js';
|
|
5
5
|
import { Fieldset } from '@wix/auto_sdk_forms_forms';
|
|
6
6
|
/**
|
|
7
7
|
* Service definition for the Form service.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { getUploadUrl, uploadFile } from './file-upload-utils';
|
|
2
|
-
export { hasMultilineAddressField, fetchAddressForms } from './address-forms';
|
|
3
|
-
export { fetchSiteConfig, DEFAULT_CURRENCY, DEFAULT_LOCALE, type SiteConfig, } from './fetch-site-config';
|
|
1
|
+
export { getUploadUrl, uploadFile } from './file-upload-utils.js';
|
|
2
|
+
export { hasMultilineAddressField, fetchAddressForms, } from './address-forms.js';
|
|
3
|
+
export { fetchSiteConfig, DEFAULT_CURRENCY, DEFAULT_LOCALE, type SiteConfig, } from './fetch-site-config.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { getUploadUrl, uploadFile } from './file-upload-utils';
|
|
2
|
-
export { hasMultilineAddressField, fetchAddressForms } from './address-forms';
|
|
3
|
-
export { fetchSiteConfig, DEFAULT_CURRENCY, DEFAULT_LOCALE, } from './fetch-site-config';
|
|
1
|
+
export { getUploadUrl, uploadFile } from './file-upload-utils.js';
|
|
2
|
+
export { hasMultilineAddressField, fetchAddressForms, } from './address-forms.js';
|
|
3
|
+
export { fetchSiteConfig, DEFAULT_CURRENCY, DEFAULT_LOCALE, } from './fetch-site-config.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/headless-forms",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.34",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"vitest": "^3.1.4"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@wix/form-public": "^0.
|
|
48
|
+
"@wix/form-public": "^0.124.0",
|
|
49
49
|
"@wix/forms": "^1.0.373",
|
|
50
50
|
"@wix/headless-utils": "0.0.8",
|
|
51
51
|
"@wix/services-definitions": "^1.0.1",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"groupId": "com.wixpress.headless-components"
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
|
-
"falconPackageHash": "
|
|
65
|
+
"falconPackageHash": "98a84cb3bd4e10f958ce30fc7086dd74a21befa94f398e234e7c2092"
|
|
66
66
|
}
|