@servicetitan/onboarding-ui 1.6.0 → 1.10.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/address-suggestion-popover/components/address-suggestion-popover.d.ts +2 -2
- package/dist/address-suggestion-popover/components/address-suggestion-popover.d.ts.map +1 -1
- package/dist/address-suggestion-popover/components/address-suggestion-popover.js +7 -6
- package/dist/address-suggestion-popover/components/address-suggestion-popover.js.map +1 -1
- package/dist/address-suggestion-popover/utils/google-geocoder-suggestions-provider.d.ts.map +1 -1
- package/dist/address-suggestion-popover/utils/google-geocoder-suggestions-provider.js +2 -1
- package/dist/address-suggestion-popover/utils/google-geocoder-suggestions-provider.js.map +1 -1
- package/dist/company-profile/components/company-profile-form.js +3 -3
- package/dist/company-profile/components/company-profile-form.js.map +1 -1
- package/dist/company-profile/components/country-dropdown-input.d.ts.map +1 -1
- package/dist/company-profile/components/country-dropdown-input.js +2 -2
- package/dist/company-profile/components/country-dropdown-input.js.map +1 -1
- package/dist/company-profile/components/state-and-province-dropdown-input.js +3 -3
- package/dist/company-profile/components/state-and-province-dropdown-input.js.map +1 -1
- package/dist/company-profile/stores/company-profile-form.store.js +6 -6
- package/dist/company-profile/stores/company-profile-form.store.js.map +1 -1
- package/dist/contentful/contentful.api.js +1 -1
- package/dist/contentful/contentful.api.js.map +1 -1
- package/dist/contentful/contentful.data.store.js +3 -3
- package/dist/contentful/contentful.data.store.js.map +1 -1
- package/dist/contentful/document-to-react-component.d.ts +13 -0
- package/dist/contentful/document-to-react-component.d.ts.map +1 -0
- package/dist/contentful/document-to-react-component.js +20 -0
- package/dist/contentful/document-to-react-component.js.map +1 -0
- package/dist/contentful/index.d.ts +1 -0
- package/dist/contentful/index.d.ts.map +1 -1
- package/dist/contentful/index.js +1 -0
- package/dist/contentful/index.js.map +1 -1
- package/dist/contentful/marketing-carousel.store.js +5 -5
- package/dist/contentful/marketing-carousel.store.js.map +1 -1
- package/dist/contentful/page-contentful.store.js +6 -6
- package/dist/contentful/page-contentful.store.js.map +1 -1
- package/dist/contentful/utils.js +2 -2
- package/dist/contentful/utils.js.map +1 -1
- package/dist/hooks/use-scroll-to-error/use-scroll-to-error.js +2 -2
- package/dist/hooks/use-scroll-to-error/use-scroll-to-error.js.map +1 -1
- package/package.json +4 -3
- package/src/address-suggestion-popover/components/address-suggestion-popover.tsx +5 -3
- package/src/address-suggestion-popover/utils/google-geocoder-suggestions-provider.ts +3 -1
- package/src/company-profile/components/company-profile-form.tsx +2 -2
- package/src/company-profile/components/country-dropdown-input.tsx +0 -1
- package/src/company-profile/components/state-and-province-dropdown-input.tsx +1 -1
- package/src/contentful/document-to-react-component.tsx +39 -0
- package/src/contentful/index.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
import { PopoverProps } from '@servicetitan/design-system';
|
|
3
3
|
export interface AddressModel {
|
|
4
4
|
street?: string;
|
|
@@ -21,5 +21,5 @@ export interface AddressSuggestionPopoverProps extends PopoverProps {
|
|
|
21
21
|
addressSuggestionsProvider: AddressSuggestionsProvider;
|
|
22
22
|
onSuggestionSelect(suggestion: AddressModel): void;
|
|
23
23
|
}
|
|
24
|
-
export declare const AddressSuggestionPopover:
|
|
24
|
+
export declare const AddressSuggestionPopover: FC<AddressSuggestionPopoverProps>;
|
|
25
25
|
//# sourceMappingURL=address-suggestion-popover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-suggestion-popover.d.ts","sourceRoot":"","sources":["../../../src/address-suggestion-popover/components/address-suggestion-popover.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"address-suggestion-popover.d.ts","sourceRoot":"","sources":["../../../src/address-suggestion-popover/components/address-suggestion-popover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAA6B,YAAY,EAAW,MAAM,6BAA6B,CAAC;AAI/F,MAAM,WAAW,YAAY;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,uBAAuB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,YAAY,CAAC;CACvB;AAED,MAAM,WAAW,0BAA0B;IACvC,cAAc,CACV,OAAO,EAAE,YAAY,GACtB,OAAO,CAAC,uBAAuB,EAAE,GAAG,SAAS,CAAC,GAAG,uBAAuB,EAAE,GAAG,SAAS,CAAC;CAC7F;AAED,MAAM,WAAW,6BAA8B,SAAQ,YAAY;IAC/D,cAAc,EAAE,YAAY,CAAC;IAC7B,0BAA0B,EAAE,0BAA0B,CAAC;IACvD,kBAAkB,CAAC,UAAU,EAAE,YAAY,GAAG,IAAI,CAAC;CACtD;AAED,eAAO,MAAM,wBAAwB,EAAE,EAAE,CAAC,6BAA6B,CAmEtE,CAAC"}
|
|
@@ -46,14 +46,15 @@ const react_hooks_1 = require("@servicetitan/react-hooks");
|
|
|
46
46
|
const design_system_1 = require("@servicetitan/design-system");
|
|
47
47
|
const mobx_react_1 = require("mobx-react");
|
|
48
48
|
const styles = __importStar(require("./styles.module.less"));
|
|
49
|
-
exports.AddressSuggestionPopover = mobx_react_1.observer((_a) => {
|
|
49
|
+
exports.AddressSuggestionPopover = (0, mobx_react_1.observer)((_a) => {
|
|
50
50
|
var { portal = true, width = 'm', direction = 'l', padding = 's', currentAddress, addressSuggestionsProvider, onSuggestionSelect } = _a, restProps = __rest(_a, ["portal", "width", "direction", "padding", "currentAddress", "addressSuggestionsProvider", "onSuggestionSelect"]);
|
|
51
|
-
const [isLoading, { setFalse: disableLoading, setTrue: enabledLoading }] = react_hooks_1.useBoolean(true);
|
|
52
|
-
const [results, setResults] = react_1.useState(undefined);
|
|
53
|
-
react_1.useEffect(() => {
|
|
51
|
+
const [isLoading, { setFalse: disableLoading, setTrue: enabledLoading }] = (0, react_hooks_1.useBoolean)(true);
|
|
52
|
+
const [results, setResults] = (0, react_1.useState)(undefined);
|
|
53
|
+
(0, react_1.useEffect)(() => {
|
|
54
54
|
const bootstrap = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
55
|
-
if (!restProps.open)
|
|
55
|
+
if (!restProps.open) {
|
|
56
56
|
return;
|
|
57
|
+
}
|
|
57
58
|
enabledLoading();
|
|
58
59
|
setResults(undefined);
|
|
59
60
|
try {
|
|
@@ -67,6 +68,6 @@ exports.AddressSuggestionPopover = mobx_react_1.observer((_a) => {
|
|
|
67
68
|
bootstrap();
|
|
68
69
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
69
70
|
}, [restProps.open]);
|
|
70
|
-
return (jsx_runtime_1.jsx(design_system_1.Popover, Object.assign({ portal: portal, width: width, direction: direction, padding: padding }, restProps, { children: isLoading ? (jsx_runtime_1.jsx("div", Object.assign({ className: "d-f justify-content-center" }, { children: jsx_runtime_1.jsx(design_system_1.Spinner, { size: "tiny" }, void 0) }), void 0)) : (results === null || results === void 0 ? void 0 : results.length) ? (results.map(result => (jsx_runtime_1.jsx(design_system_1.Button, Object.assign({ full: true, fill: "subtle", className: styles.verifyAddressBtn, color: "primary", onClick: () => onSuggestionSelect(result.value) }, { children: result.title }), result.key)))) : (jsx_runtime_1.jsx(design_system_1.BodyText, Object.assign({ className: "c-blue-400 ta-center", bold: true }, { children: "No suggestions" }), void 0)) }), void 0));
|
|
71
|
+
return ((0, jsx_runtime_1.jsx)(design_system_1.Popover, Object.assign({ portal: portal, width: width, direction: direction, padding: padding }, restProps, { children: isLoading ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "d-f justify-content-center" }, { children: (0, jsx_runtime_1.jsx)(design_system_1.Spinner, { size: "tiny" }, void 0) }), void 0)) : (results === null || results === void 0 ? void 0 : results.length) ? (results.map(result => ((0, jsx_runtime_1.jsx)(design_system_1.Button, Object.assign({ full: true, fill: "subtle", className: styles.verifyAddressBtn, color: "primary", onClick: () => onSuggestionSelect(result.value) }, { children: result.title }), result.key)))) : ((0, jsx_runtime_1.jsx)(design_system_1.BodyText, Object.assign({ className: "c-blue-400 ta-center", bold: true }, { children: "No suggestions" }), void 0)) }), void 0));
|
|
71
72
|
});
|
|
72
73
|
//# sourceMappingURL=address-suggestion-popover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-suggestion-popover.js","sourceRoot":"","sources":["../../../src/address-suggestion-popover/components/address-suggestion-popover.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"address-suggestion-popover.js","sourceRoot":"","sources":["../../../src/address-suggestion-popover/components/address-suggestion-popover.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAgD;AAChD,2DAAuD;AACvD,+DAA+F;AAC/F,2CAAsC;AACtC,6DAA+C;AA6BlC,QAAA,wBAAwB,GAAsC,IAAA,qBAAQ,EAC/E,CAAC,EASA,EAAE,EAAE;QATJ,EACG,MAAM,GAAG,IAAI,EACb,KAAK,GAAG,GAAG,EACX,SAAS,GAAG,GAAG,EACf,OAAO,GAAG,GAAG,EACb,cAAc,EACd,0BAA0B,EAC1B,kBAAkB,OAErB,EADM,SAAS,cARf,iHASA,CADe;IAEZ,MAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,GAAG,IAAA,wBAAU,EAAC,IAAI,CAAC,CAAC;IAC5F,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAwC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sBAAsB,EAAC,IAAI,kDAEpC,CACd,YACK,CACb,CAAC;AACN,CAAC,CACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-geocoder-suggestions-provider.d.ts","sourceRoot":"","sources":["../../../src/address-suggestion-popover/utils/google-geocoder-suggestions-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAEpG,qBAAa,iCAAkC,YAAW,0BAA0B;IAChF,cAAc,YAAmB,YAAY;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"google-geocoder-suggestions-provider.d.ts","sourceRoot":"","sources":["../../../src/address-suggestion-popover/utils/google-geocoder-suggestions-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAEpG,qBAAa,iCAAkC,YAAW,0BAA0B;IAChF,cAAc,YAAmB,YAAY;;;;;;;;;;;qBAa3C;IAEF,OAAO,CAAC,eAAe,CAiBrB;IAEF,OAAO,CAAC,uBAAuB,CAmC7B;IAEF,OAAO,CAAC,yBAAyB,CAO3B;IAEN,OAAO,CAAC,OAAO,CAuBb;CACL"}
|
|
@@ -17,8 +17,9 @@ class GoogleGeocoderSuggestionsProvider {
|
|
|
17
17
|
configurable: true,
|
|
18
18
|
writable: true,
|
|
19
19
|
value: (address) => __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
if (!window.google)
|
|
20
|
+
if (!window.google) {
|
|
21
21
|
return;
|
|
22
|
+
}
|
|
22
23
|
const addressStr = this.addressToString(address);
|
|
23
24
|
const countryCode = address.country === 'Canada' ? 'ca' : 'us';
|
|
24
25
|
const params = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-geocoder-suggestions-provider.js","sourceRoot":"","sources":["../../../src/address-suggestion-popover/utils/google-geocoder-suggestions-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,iCAAiC;IAA9C;QACI;;;;mBAAiB,CAAO,OAAqB,EAAE,EAAE;gBAC7C,IAAI,CAAC,MAAM,CAAC,MAAM;
|
|
1
|
+
{"version":3,"file":"google-geocoder-suggestions-provider.js","sourceRoot":"","sources":["../../../src/address-suggestion-popover/utils/google-geocoder-suggestions-provider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,MAAa,iCAAiC;IAA9C;QACI;;;;mBAAiB,CAAO,OAAqB,EAAE,EAAE;gBAC7C,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;oBAChB,OAAO;iBACV;gBACD,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;gBACjD,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;gBAC/D,MAAM,MAAM,GAAG;oBACX,OAAO,EAAE,UAAU;oBACnB,MAAM,EAAE,WAAW;iBACtB,CAAC;gBACF,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAC5C,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBACnD,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;YACrD,CAAC,CAAA;WAAC;QAEF;;;;mBAA0B,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAgB,EAAE,EAAE;gBACpF,MAAM,YAAY,GAAa,EAAE,CAAC;gBAElC,MAAM,UAAU,GAAG,CAAC,MAAc,EAAE,IAAa,EAAE,EAAE;oBACjD,IAAI,IAAI,EAAE;wBACN,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;qBACnC;gBACL,CAAC,CAAC;gBAEF,UAAU,CA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AChB;gBACD,MAAM,WAAW,GAAG,IAAI,CAAC,yBAAyB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;gBAC9E,IAAI,WAAW,IAAI,yBAAyB,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;oBACrE,OAAO,WAAW,CAAC;iBACtB;gBACD,MAAM,YAAY,GAAG,IAAI,CAAC,yBAAyB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;gBAChF,IAAI,YAAY,IAAI,yBAAyB,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;oBACvE,OAAO,YAAY,CAAC;iBACvB;gBAED,OAAO,MAAA,MAAA,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,KAAK,mCAAI,WAAW,mCAAI,YAAY,CAAC;YAC5D,CAAC;WAAC;IACN,CAAC;CAAA;AAzGD,8EAyGC"}
|
|
@@ -13,8 +13,8 @@ const react_ioc_1 = require("@servicetitan/react-ioc");
|
|
|
13
13
|
const state_and_province_dropdown_input_1 = require("./state-and-province-dropdown-input");
|
|
14
14
|
const company_profile_form_store_1 = require("../stores/company-profile-form.store");
|
|
15
15
|
const form_1 = require("@servicetitan/form");
|
|
16
|
-
exports.CompanyProfileForm = mobx_react_1.observer((props) => {
|
|
17
|
-
const [store] = react_ioc_1.useDependencies(company_profile_form_store_1.CompanyProfileFormStore);
|
|
16
|
+
exports.CompanyProfileForm = (0, mobx_react_1.observer)((props) => {
|
|
17
|
+
const [store] = (0, react_ioc_1.useDependencies)(company_profile_form_store_1.CompanyProfileFormStore);
|
|
18
18
|
const { form, showFormError, zipCodeMask, einOrBnMask, einOrBnInputProps } = store;
|
|
19
19
|
const zipCodeOnChangeHandler = (zip) => {
|
|
20
20
|
form.$.companyZipCode.onChange(zip);
|
|
@@ -33,6 +33,6 @@ exports.CompanyProfileForm = mobx_react_1.observer((props) => {
|
|
|
33
33
|
};
|
|
34
34
|
const { companyName, companyStreetAddress, companyCity, companyCountry, companyStateCode, companyZipCode, adminPhone, einOrBn, } = store.form.$;
|
|
35
35
|
const zipCodeHasError = companyZipCode.hasError;
|
|
36
|
-
return (jsx_runtime_1.jsxs(design_system_1.Form, Object.assign({ size: "tiny", className: classnames_1.default(props.className, 'ta-left', 'p-x-6') }, { children: [jsx_runtime_1.jsx(design_system_1.Form.Input, { label: "Company Name", placeholder: "Company Name", value: companyName.value, onChange: companyName.onChangeHandler, error: (companyName.dirty || showFormError) && companyName.hasError }, void 0), jsx_runtime_1.jsx(design_system_1.Form.Input, { label: "Street Address", placeholder: "Street Address", value: companyStreetAddress.value, onChange: companyStreetAddress.onChangeHandler, error: (companyStreetAddress.dirty || showFormError) && companyStreetAddress.hasError }, void 0), jsx_runtime_1.jsxs(design_system_1.Form.Group, Object.assign({ width: "equal" }, { children: [jsx_runtime_1.jsx(design_system_1.Form.Input, { fluid: true, label: "City", placeholder: "City", className: "p-r-0", width: "6", value: companyCity.value, onChange: companyCity.onChangeHandler, error: (companyCity.dirty || showFormError) && companyCity.hasError }, void 0), jsx_runtime_1.jsx(state_and_province_dropdown_input_1.StateAndProvinceDropdownInput, { width: "6", countryCode: companyCountry.value || 'USA', fieldState: companyStateCode, error: (companyStateCode.dirty || showFormError) && companyStateCode.hasError, countryAndRegionData: store.countryAndRegionData, regionNameToCodeMap: store.regionToCodeMap }, void 0)] }), void 0), jsx_runtime_1.jsxs(design_system_1.Form.Group, Object.assign({ width: "equal" }, { children: [jsx_runtime_1.jsx(form_1.MaskedInput, { fluid: true, label: "ZIP Code", placeholder: "ZIP Code", value: companyZipCode.value, onChange: zipCodeOnChangeHandler, mask: zipCodeMask, className: "p-r-0", maskChar: " ", error: (companyZipCode.dirty || showFormError) && zipCodeHasError, width: 6 }, void 0), jsx_runtime_1.jsx(country_dropdown_input_1.CountryDropdownInput, { width: "6", value: companyCountry.value, onChange: countryOnChangeHandler, error: (companyCountry.dirty || showFormError) && companyCountry.hasError, options: store.countries.map(x => ({ key: x, value: x, text: x })) }, void 0)] }), void 0), jsx_runtime_1.jsxs(design_system_1.Form.Group, Object.assign({ width: "equal" }, { children: [jsx_runtime_1.jsx(form_1.MaskedInput, { fluid: true, label: "Phone Number", placeholder: "Phone Number", value: adminPhone.value, onChange: phoneOnChangeHandler, error: (adminPhone.dirty || showFormError) && adminPhone.hasError, mask: store.phoneMask, width: 6 }, void 0), jsx_runtime_1.jsx(form_1.MaskedInput, { fluid: true, label: einOrBnInputProps.label, placeholder: einOrBnInputProps.placeholder, value: einOrBn.value, onChange: einOrBnOnChangeHandler, mask: einOrBnMask, className: "p-r-0", maskChar: " ", error: (einOrBn.dirty || showFormError) && einOrBn.hasError, width: 6 }, void 0)] }), void 0)] }), void 0));
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)(design_system_1.Form, Object.assign({ size: "tiny", className: (0, classnames_1.default)(props.className, 'ta-left', 'p-x-6') }, { children: [(0, jsx_runtime_1.jsx)(design_system_1.Form.Input, { label: "Company Name", placeholder: "Company Name", value: companyName.value, onChange: companyName.onChangeHandler, error: (companyName.dirty || showFormError) && companyName.hasError }, void 0), (0, jsx_runtime_1.jsx)(design_system_1.Form.Input, { label: "Street Address", placeholder: "Street Address", value: companyStreetAddress.value, onChange: companyStreetAddress.onChangeHandler, error: (companyStreetAddress.dirty || showFormError) && companyStreetAddress.hasError }, void 0), (0, jsx_runtime_1.jsxs)(design_system_1.Form.Group, Object.assign({ width: "equal" }, { children: [(0, jsx_runtime_1.jsx)(design_system_1.Form.Input, { fluid: true, label: "City", placeholder: "City", className: "p-r-0", width: "6", value: companyCity.value, onChange: companyCity.onChangeHandler, error: (companyCity.dirty || showFormError) && companyCity.hasError }, void 0), (0, jsx_runtime_1.jsx)(state_and_province_dropdown_input_1.StateAndProvinceDropdownInput, { width: "6", countryCode: companyCountry.value || 'USA', fieldState: companyStateCode, error: (companyStateCode.dirty || showFormError) && companyStateCode.hasError, countryAndRegionData: store.countryAndRegionData, regionNameToCodeMap: store.regionToCodeMap }, void 0)] }), void 0), (0, jsx_runtime_1.jsxs)(design_system_1.Form.Group, Object.assign({ width: "equal" }, { children: [(0, jsx_runtime_1.jsx)(form_1.MaskedInput, { fluid: true, label: "ZIP Code", placeholder: "ZIP Code", value: companyZipCode.value, onChange: zipCodeOnChangeHandler, mask: zipCodeMask, className: "p-r-0", maskChar: " ", error: (companyZipCode.dirty || showFormError) && zipCodeHasError, width: 6 }, void 0), (0, jsx_runtime_1.jsx)(country_dropdown_input_1.CountryDropdownInput, { width: "6", value: companyCountry.value, onChange: countryOnChangeHandler, error: (companyCountry.dirty || showFormError) && companyCountry.hasError, options: store.countries.map(x => ({ key: x, value: x, text: x })) }, void 0)] }), void 0), (0, jsx_runtime_1.jsxs)(design_system_1.Form.Group, Object.assign({ width: "equal" }, { children: [(0, jsx_runtime_1.jsx)(form_1.MaskedInput, { fluid: true, label: "Phone Number", placeholder: "Phone Number", value: adminPhone.value, onChange: phoneOnChangeHandler, error: (adminPhone.dirty || showFormError) && adminPhone.hasError, mask: store.phoneMask, width: 6 }, void 0), (0, jsx_runtime_1.jsx)(form_1.MaskedInput, { fluid: true, label: einOrBnInputProps.label, placeholder: einOrBnInputProps.placeholder, value: einOrBn.value, onChange: einOrBnOnChangeHandler, mask: einOrBnMask, className: "p-r-0", maskChar: " ", error: (einOrBn.dirty || showFormError) && einOrBn.hasError, width: 6 }, void 0)] }), void 0)] }), void 0));
|
|
37
37
|
});
|
|
38
38
|
//# sourceMappingURL=company-profile-form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"company-profile-form.js","sourceRoot":"","sources":["../../../src/company-profile/components/company-profile-form.tsx"],"names":[],"mappings":";;;;;;;AACA,+DAAsE;AACtE,4DAAoC;AACpC,qEAAgE;AAChE,2CAAsC;AACtC,uDAA0D;AAC1D,2FAAoF;AACpF,qFAA+E;AAC/E,6CAAiD;AAEpC,QAAA,kBAAkB,GAAG,qBAAQ,
|
|
1
|
+
{"version":3,"file":"company-profile-form.js","sourceRoot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E,oBAAoB,EAC9B,KAAK,EAAE,CAAC,UAAU,CAAC,KAAK,IAAI,aAAa,CAAC,IAAI,UAAU,CAAC,QAAQ,EACjE,IAAI,EAAE,KAAK,CAAC,SAAS,EACrB,KAAK,EAAE,CAAC,WACV,EACF,uBAAC,kBAAW,IACR,KAAK,QACL,KAAK,EAAE,iBAAiB,CAAC,KAAK,EAC9B,WAAW,EAAE,iBAAiB,CAAC,WAAW,EAC1C,KAAK,EAAE,OAAO,CAAC,KAAK,EACpB,QAAQ,EAAE,sBAAsB,EAChC,IAAI,EAAE,WAAW,EACjB,SAAS,EAAC,OAAO,EACjB,QAAQ,EAAC,GAAG,EACZ,KAAK,EAAE,CAAC,OAAO,CAAC,KAAK,IAAI,aAAa,CAAC,IAAI,OAAO,CAAC,QAAQ,EAC3D,KAAK,EAAE,CAAC,WACV,aACO,aACV,CACV,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"country-dropdown-input.d.ts","sourceRoot":"","sources":["../../../src/company-profile/components/country-dropdown-input.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"country-dropdown-input.d.ts","sourceRoot":"","sources":["../../../src/company-profile/components/country-dropdown-input.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAQ,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAEtF,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC5D,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,eAAO,MAAM,oBAAoB,UAAoB,qBAAqB,gBAexE,CAAC"}
|
|
@@ -15,10 +15,10 @@ exports.CountryDropdownInput = void 0;
|
|
|
15
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
16
|
const design_system_1 = require("@servicetitan/design-system");
|
|
17
17
|
const mobx_react_1 = require("mobx-react");
|
|
18
|
-
exports.CountryDropdownInput = mobx_react_1.observer((props) => {
|
|
18
|
+
exports.CountryDropdownInput = (0, mobx_react_1.observer)((props) => {
|
|
19
19
|
const { value: propsValue, width, placeholder } = props, rest = __rest(props, ["value", "width", "placeholder"]);
|
|
20
20
|
const value = propsValue && propsValue.toString().toLowerCase();
|
|
21
21
|
const country = value && (value === 'canada' || value === 'ca' ? 'Canada' : 'USA');
|
|
22
|
-
return (jsx_runtime_1.jsx(design_system_1.Form.Select, Object.assign({ fluid: true, search: true, width: width !== null && width !== void 0 ? width : '12', label: "Country", placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : 'Country', value: country }, rest), void 0));
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(design_system_1.Form.Select, Object.assign({ fluid: true, search: true, width: width !== null && width !== void 0 ? width : '12', label: "Country", placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : 'Country', value: country }, rest), void 0));
|
|
23
23
|
});
|
|
24
24
|
//# sourceMappingURL=country-dropdown-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"country-dropdown-input.js","sourceRoot":"","sources":["../../../src/company-profile/components/country-dropdown-input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"country-dropdown-input.js","sourceRoot":"","sources":["../../../src/company-profile/components/country-dropdown-input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAAsF;AACtF,2CAAsC;AAQzB,QAAA,oBAAoB,GAAG,IAAA,qBAAQ,EAAC,CAAC,KAA4B,EAAE,EAAE;IAC1E,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,KAAc,KAAK,EAAd,IAAI,UAAK,KAAK,EAA1D,iCAAkD,CAAQ,CAAC;IACjE,MAAM,KAAK,GAAG,UAAU,IAAI,UAAW,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC;IACjE,MAAM,OAAO,GAAG,KAAK,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACnF,OAAO,CACH,uBAAC,oBAAI,CAAC,MAAM,kBACR,KAAK,QACL,MAAM,QACN,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,IAAI,EACpB,KAAK,EAAC,SAAS,EACf,WAAW,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,SAAS,EACrC,KAAK,EAAE,OAAO,IACV,IAAI,UACV,CACL,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -17,10 +17,10 @@ const react_1 = require("react");
|
|
|
17
17
|
const design_system_1 = require("@servicetitan/design-system");
|
|
18
18
|
const mobx_react_1 = require("mobx-react");
|
|
19
19
|
const toTitleCase = (str) => str.replace(/\w\S*/g, txt => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());
|
|
20
|
-
exports.StateAndProvinceDropdownInput = mobx_react_1.observer((props) => {
|
|
20
|
+
exports.StateAndProvinceDropdownInput = (0, mobx_react_1.observer)((props) => {
|
|
21
21
|
const { fieldState, regionNameToCodeMap, countryAndRegionData, countryCode, width, placeholder } = props, rest = __rest(props, ["fieldState", "regionNameToCodeMap", "countryAndRegionData", "countryCode", "width", "placeholder"]);
|
|
22
22
|
const { value, onChange, onChangeHandler } = fieldState;
|
|
23
|
-
react_1.useEffect(() => {
|
|
23
|
+
(0, react_1.useEffect)(() => {
|
|
24
24
|
var _a;
|
|
25
25
|
/*
|
|
26
26
|
* requirement: convert any incoming state value that is a full state/province name
|
|
@@ -53,6 +53,6 @@ exports.StateAndProvinceDropdownInput = mobx_react_1.observer((props) => {
|
|
|
53
53
|
? 'Province'
|
|
54
54
|
: 'State';
|
|
55
55
|
const options = regionType === 'Province' ? canadianRegionalData : americanRegionalData;
|
|
56
|
-
return (jsx_runtime_1.jsx(design_system_1.Form.Select, Object.assign({ search: true, fluid: true, width: width !== null && width !== void 0 ? width : '12', label: regionType, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : regionType, value: value, onChange: onChangeHandler, options: options }, rest), void 0));
|
|
56
|
+
return ((0, jsx_runtime_1.jsx)(design_system_1.Form.Select, Object.assign({ search: true, fluid: true, width: width !== null && width !== void 0 ? width : '12', label: regionType, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : regionType, value: value, onChange: onChangeHandler, options: options }, rest), void 0));
|
|
57
57
|
});
|
|
58
58
|
//# sourceMappingURL=state-and-province-dropdown-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-and-province-dropdown-input.js","sourceRoot":"","sources":["../../../src/company-profile/components/state-and-province-dropdown-input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"state-and-province-dropdown-input.js","sourceRoot":"","sources":["../../../src/company-profile/components/state-and-province-dropdown-input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iCAAkC;AAClC,+DAAsF;AACtF,2CAAsC;AAYtC,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,EAAE,CAChC,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAE/E,QAAA,6BAA6B,GAAG,IAAA,qBAAQ,EACjD,CAAC,KAAyC,EAAE,EAAE;IAC1C,MAAM,EACF,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,KAAK,EACL,WAAW,KAEX,KAAK,EADF,IAAI,UACP,KAAK,EARH,oGAQL,CAAQ,CAAC;IACV,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG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AAI,IAAI,EACpB,KAAK,EAAE,UAAU,EACjB,WAAW,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,UAAU,EACtC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,OAAQ,IACb,IAAI,UACV,CACL,CAAC;AACN,CAAC,CACJ,CAAC"}
|
|
@@ -95,22 +95,22 @@ let CompanyProfileFormStore = class CompanyProfileFormStore {
|
|
|
95
95
|
configurable: true,
|
|
96
96
|
writable: true,
|
|
97
97
|
value: (formData, options) => {
|
|
98
|
-
this.form.$.adminPhone.validators(validators_1.PhoneValidator(options.phonePattern, false));
|
|
98
|
+
this.form.$.adminPhone.validators((0, validators_1.PhoneValidator)(options.phonePattern, false));
|
|
99
99
|
this.countries = options.countries;
|
|
100
100
|
this.countryAndRegionData = options.countryAndRegionData;
|
|
101
101
|
this.phoneMask = options.phoneMask;
|
|
102
102
|
this.regionToCodeMap = options.regionToCodeMap;
|
|
103
|
-
form_1.setFormStateValues(this.form, formData);
|
|
104
|
-
form_1.commitFormState(this.form);
|
|
103
|
+
(0, form_1.setFormStateValues)(this.form, formData);
|
|
104
|
+
(0, form_1.commitFormState)(this.form);
|
|
105
105
|
}
|
|
106
106
|
});
|
|
107
107
|
Object.defineProperty(this, "commitForm", {
|
|
108
108
|
enumerable: true,
|
|
109
109
|
configurable: true,
|
|
110
110
|
writable: true,
|
|
111
|
-
value: () => form_1.commitFormState(this.form)
|
|
111
|
+
value: () => (0, form_1.commitFormState)(this.form)
|
|
112
112
|
});
|
|
113
|
-
mobx_1.makeObservable(this);
|
|
113
|
+
(0, mobx_1.makeObservable)(this);
|
|
114
114
|
this.form.$.companyZipCode.validators(($) => {
|
|
115
115
|
const country = this.form.$.companyCountry.value;
|
|
116
116
|
const zip = ($ || '').toLowerCase().replace(/ /g, '');
|
|
@@ -193,7 +193,7 @@ __decorate([
|
|
|
193
193
|
__metadata("design:type", Object)
|
|
194
194
|
], CompanyProfileFormStore.prototype, "commitForm", void 0);
|
|
195
195
|
CompanyProfileFormStore = __decorate([
|
|
196
|
-
react_ioc_1.injectable(),
|
|
196
|
+
(0, react_ioc_1.injectable)(),
|
|
197
197
|
__metadata("design:paramtypes", [])
|
|
198
198
|
], CompanyProfileFormStore);
|
|
199
199
|
exports.CompanyProfileFormStore = CompanyProfileFormStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"company-profile-form.store.js","sourceRoot":"","sources":["../../../src/company-profile/stores/company-profile-form.store.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAkD;AAClD,6CAK4B;AAC5B,uDAAqD;AACrD,oDAAqD;AACrD,+BAAoE;AAEpE,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,IAAI,wBAAwB,CAAC;AAuB/F,MAAM,SAAS,GAAG,OAAO,CAAC;AAC1B,MAAM,aAAa,GAAG,SAAS,CAAC;AAChC,MAAM,YAAY,GAAG,WAAW,CAAC;AACjC,MAAM,SAAS,GAAG,YAAY,CAAC;AA6B/B,IAAa,uBAAuB,GAApC,MAAa,uBAAuB;IAmBhC;QAlBY;;;;mBAAgB,KAAK;WAAC;QACtB;;;;mBAAiB,KAAK;WAAC;QACvB;;;;mBAAsB,EAAE;WAAC;QACzB;;;;mBAA6C,EAAE;WAAC;QAChD;;;;mBAAY,EAAE;WAAC;QACf;;;;mBAAuC,IAAI,GAAG,EAAE;WAAC;QAE7D;;;;mBAA2C,IAAI,qBAAS,CAAC;gBACrD,WAAW,EAAE,IAAI,sBAAe,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC;gBACzD,UAAU,EAAE,IAAI,sBAAe,CAAC,EAAE,CAAC;gBACnC,oBAAoB,EAAE,IAAI,sBAAe,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC;gBAClE,cAAc,EAAE,IAAI,yBAAkB,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC;gBAC/D,gBAAgB,EAAE,IAAI,yBAAkB,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC;gBACjE,WAAW,EAAE,IAAI,sBAAe,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC;gBACzD,cAAc,EAAE,IAAI,sBAAe,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC;gBAC5D,OAAO,EAAE,IAAI,sBAAe,CAAC,EAAE,CAAC;aACnC,CAAC;WAAC;QAsBH;;;;mBAAoB,CAAC,KAAc,EAAE,EAAE;gBACnC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;YAC/B,CAAC;WAAC;QAEF;;;;mBAAW,CAAC,OAAe,EAAE,EAAE;gBAC3B,MAAM,YAAY,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAE,CAAC;gBAC5C,OAAO,YAAY,KAAK,IAAI,IAAI,YAAY,KAAK,QAAQ,CAAC;YAC9D,CAAC;WAAC;QA0BF;;;;mBAAW,CAAC,QAAsB,EAAE,OAAkC,EAAE,EAAE;gBACtE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,2BAAc,
|
|
1
|
+
{"version":3,"file":"company-profile-form.store.js","sourceRoot":"","sources":["../../../src/company-profile/stores/company-profile-form.store.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAkD;AAClD,6CAK4B;AAC5B,uDAAqD;AACrD,oDAAqD;AACrD,+BAAoE;AAEpE,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,IAAI,wBAAwB,CAAC;AAuB/F,MAAM,SAAS,GAAG,OAAO,CAAC;AAC1B,MAAM,aAAa,GAAG,SAAS,CAAC;AAChC,MAAM,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BAAkB,GAAG;gEAA6B;AAiC7D;IADC,aAAM;;kEAGL;AAQF;IADC,eAAQ;;;0DAGR;AAGD;IADC,eAAQ;;;0DAGR;AAGD;IADC,eAAQ;;;gEAWR;AAGD;IADC,aAAM;;yDASL;AAGF;IADC,aAAM;;2DACuC;AAnFrC,uBAAuB;IADnC,IAAA,sBAAU,GAAE;;GACA,uBAAuB,CAoFnC;AApFY,0DAAuB"}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CONTENTFUL_API_TOKEN = void 0;
|
|
4
4
|
const react_ioc_1 = require("@servicetitan/react-ioc");
|
|
5
|
-
exports.CONTENTFUL_API_TOKEN = react_ioc_1.symbolToken('CONTENTFUL_API_TOKEN');
|
|
5
|
+
exports.CONTENTFUL_API_TOKEN = (0, react_ioc_1.symbolToken)('CONTENTFUL_API_TOKEN');
|
|
6
6
|
//# sourceMappingURL=contentful.api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentful.api.js","sourceRoot":"","sources":["../../src/contentful/contentful.api.ts"],"names":[],"mappings":";;;AAAA,uDAAsD;AAEzC,QAAA,oBAAoB,GAAG,uBAAW,
|
|
1
|
+
{"version":3,"file":"contentful.api.js","sourceRoot":"","sources":["../../src/contentful/contentful.api.ts"],"names":[],"mappings":";;;AAAA,uDAAsD;AAEzC,QAAA,oBAAoB,GAAG,IAAA,uBAAW,EAAiB,sBAAsB,CAAC,CAAC"}
|
|
@@ -43,14 +43,14 @@ let ContentfulDataStore = class ContentfulDataStore {
|
|
|
43
43
|
value: ({ entryType, codeId, isPreview = false, }) => __awaiter(this, void 0, void 0, function* () {
|
|
44
44
|
var _a;
|
|
45
45
|
const { data } = yield this.contentfulApi.getContentfulContent(entryType, codeId, 10, isPreview);
|
|
46
|
-
return (_a = contentful_resolve_response_1.default(data)) === null || _a === void 0 ? void 0 : _a[0];
|
|
46
|
+
return (_a = (0, contentful_resolve_response_1.default)(data)) === null || _a === void 0 ? void 0 : _a[0];
|
|
47
47
|
})
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
ContentfulDataStore = __decorate([
|
|
52
|
-
react_ioc_1.injectable(),
|
|
53
|
-
__param(0, react_ioc_1.inject(_1.CONTENTFUL_API_TOKEN)),
|
|
52
|
+
(0, react_ioc_1.injectable)(),
|
|
53
|
+
__param(0, (0, react_ioc_1.inject)(_1.CONTENTFUL_API_TOKEN)),
|
|
54
54
|
__metadata("design:paramtypes", [Object])
|
|
55
55
|
], ContentfulDataStore);
|
|
56
56
|
exports.ContentfulDataStore = ContentfulDataStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentful.data.store.js","sourceRoot":"","sources":["../../src/contentful/contentful.data.store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA0D;AAC1D,uDAA6D;AAC7D,wBAAgE;AAShE,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;IAC5B,YAAkD,aAA6B;;;;;mBAA7B;;QAElD;;;;mBAAoB,CAAU,EAC1B,SAAS,EACT,MAAM,EACN,SAAS,GAAG,KAAK,GACG,EAAE,EAAE;;gBACxB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,oBAAoB,CAC1D,SAAS,EACT,MAAM,EACN,EAAE,EACF,SAAS,CACZ,CAAC;gBACF,OAAO,MAAA,qCAAe,
|
|
1
|
+
{"version":3,"file":"contentful.data.store.js","sourceRoot":"","sources":["../../src/contentful/contentful.data.store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA0D;AAC1D,uDAA6D;AAC7D,wBAAgE;AAShE,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;IAC5B,YAAkD,aAA6B;;;;;mBAA7B;;QAElD;;;;mBAAoB,CAAU,EAC1B,SAAS,EACT,MAAM,EACN,SAAS,GAAG,KAAK,GACG,EAAE,EAAE;;gBACxB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,oBAAoB,CAC1D,SAAS,EACT,MAAM,EACN,EAAE,EACF,SAAS,CACZ,CAAC;gBACF,OAAO,MAAA,IAAA,qCAAe,EAAC,IAAI,CAAC,0CAAG,CAAC,CAAyB,CAAC;YAC9D,CAAC,CAAA;WAAC;IAdgF,CAAC;CAetF,CAAA;AAhBY,mBAAmB;IAD/B,IAAA,sBAAU,GAAE;IAEI,WAAA,IAAA,kBAAM,EAAC,uBAAoB,CAAC,CAAA;;GADhC,mBAAmB,CAgB/B;AAhBY,kDAAmB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Options, RenderNode } from '@contentful/rich-text-react-renderer';
|
|
3
|
+
import { RichText } from '.';
|
|
4
|
+
export declare const richTextRenderOptions: {
|
|
5
|
+
openHyperlinkInNewTab: RenderNode;
|
|
6
|
+
};
|
|
7
|
+
export interface RichTextConfig {
|
|
8
|
+
document?: RichText;
|
|
9
|
+
options?: Options;
|
|
10
|
+
renderNodes?: RenderNode[];
|
|
11
|
+
}
|
|
12
|
+
export declare const documentToReactComponent: (config: RichTextConfig) => ReactNode;
|
|
13
|
+
//# sourceMappingURL=document-to-react-component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-to-react-component.d.ts","sourceRoot":"","sources":["../../src/contentful/document-to-react-component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAEH,OAAO,EACP,UAAU,EACb,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AAE7B,eAAO,MAAM,qBAAqB;;CAUjC,CAAC;AAEF,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;CAC9B;AAED,eAAO,MAAM,wBAAwB,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,SAUlE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.documentToReactComponent = exports.richTextRenderOptions = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const rich_text_react_renderer_1 = require("@contentful/rich-text-react-renderer");
|
|
6
|
+
const rich_text_types_1 = require("@contentful/rich-text-types");
|
|
7
|
+
const design_system_1 = require("@servicetitan/design-system");
|
|
8
|
+
exports.richTextRenderOptions = {
|
|
9
|
+
openHyperlinkInNewTab: {
|
|
10
|
+
[rich_text_types_1.INLINES.HYPERLINK]: (node, children) => {
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(design_system_1.Link, Object.assign({ primary: true, href: node.data.uri, target: "_blank", rel: "noopener noreferrer" }, { children: children }), void 0));
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
const documentToReactComponent = ({ document, options, renderNodes, }) => {
|
|
16
|
+
const renderOptions = Object.assign(Object.assign({}, options), { renderNode: renderNodes === null || renderNodes === void 0 ? void 0 : renderNodes.reduce((acc, x) => (Object.assign(Object.assign({}, acc), x))) });
|
|
17
|
+
return document ? (0, rich_text_react_renderer_1.documentToReactComponents)(document, renderOptions) : undefined;
|
|
18
|
+
};
|
|
19
|
+
exports.documentToReactComponent = documentToReactComponent;
|
|
20
|
+
//# sourceMappingURL=document-to-react-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-to-react-component.js","sourceRoot":"","sources":["../../src/contentful/document-to-react-component.tsx"],"names":[],"mappings":";;;;AACA,mFAI8C;AAC9C,iEAAqE;AACrE,+DAAmD;AAGtC,QAAA,qBAAqB,GAAG;IACjC,qBAAqB,EAAE;QACnB,CAAC,yBAAO,CAAC,SAAS,CAAC,EAAE,CAAC,IAAoB,EAAE,QAAmB,EAAE,EAAE;YAC/D,OAAO,CACH,uBAAC,oBAAI,kBAAC,OAAO,QAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,gBACvE,QAAQ,YACN,CACV,CAAC;QACN,CAAC;KACU;CAClB,CAAC;AAQK,MAAM,wBAAwB,GAA0C,CAAC,EAC5E,QAAQ,EACR,OAAO,EACP,WAAW,GACd,EAAE,EAAE;IACD,MAAM,aAAa,mCACZ,OAAO,KACV,UAAU,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,iCAAM,GAAG,GAAK,CAAC,EAAG,CAAC,GAClE,CAAC;IACF,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAA,oDAAyB,EAAC,QAAQ,EAAE,aAAwB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAChG,CAAC,CAAC;AAVW,QAAA,wBAAwB,4BAUnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contentful/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contentful/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,+BAA+B,CAAC"}
|
package/dist/contentful/index.js
CHANGED
|
@@ -16,4 +16,5 @@ __exportStar(require("./marketing-carousel.store"), exports);
|
|
|
16
16
|
__exportStar(require("./page-contentful.store"), exports);
|
|
17
17
|
__exportStar(require("./interfaces"), exports);
|
|
18
18
|
__exportStar(require("./utils"), exports);
|
|
19
|
+
__exportStar(require("./document-to-react-component"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contentful/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAiC;AACjC,0DAAwC;AACxC,6DAA2C;AAC3C,0DAAwC;AACxC,+CAA6B;AAC7B,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contentful/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAiC;AACjC,0DAAwC;AACxC,6DAA2C;AAC3C,0DAAwC;AACxC,+CAA6B;AAC7B,0CAAwB;AACxB,gEAA8C"}
|
|
@@ -92,12 +92,12 @@ let MarketingCarouselStore = class MarketingCarouselStore {
|
|
|
92
92
|
codeId,
|
|
93
93
|
isPreview,
|
|
94
94
|
});
|
|
95
|
-
mobx_1.runInAction(() => {
|
|
95
|
+
(0, mobx_1.runInAction)(() => {
|
|
96
96
|
this.photoGalleryData = data;
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
finally {
|
|
100
|
-
mobx_1.runInAction(() => {
|
|
100
|
+
(0, mobx_1.runInAction)(() => {
|
|
101
101
|
this.isInitializing = false;
|
|
102
102
|
});
|
|
103
103
|
}
|
|
@@ -132,7 +132,7 @@ let MarketingCarouselStore = class MarketingCarouselStore {
|
|
|
132
132
|
return inStartRange && inEndRange;
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
|
-
mobx_1.makeObservable(this);
|
|
135
|
+
(0, mobx_1.makeObservable)(this);
|
|
136
136
|
}
|
|
137
137
|
// colorTheme and backgroundImageUrl are not not part of initial release of contentful
|
|
138
138
|
get carouselSettings() {
|
|
@@ -183,8 +183,8 @@ __decorate([
|
|
|
183
183
|
__metadata("design:paramtypes", [])
|
|
184
184
|
], MarketingCarouselStore.prototype, "carouselData", null);
|
|
185
185
|
MarketingCarouselStore = __decorate([
|
|
186
|
-
react_ioc_1.injectable(),
|
|
187
|
-
__param(0, react_ioc_1.inject(_1.ContentfulDataStore)),
|
|
186
|
+
(0, react_ioc_1.injectable)(),
|
|
187
|
+
__param(0, (0, react_ioc_1.inject)(_1.ContentfulDataStore)),
|
|
188
188
|
__metadata("design:paramtypes", [_1.ContentfulDataStore])
|
|
189
189
|
], MarketingCarouselStore);
|
|
190
190
|
exports.MarketingCarouselStore = MarketingCarouselStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marketing-carousel.store.js","sourceRoot":"","sources":["../../src/contentful/marketing-carousel.store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAA6D;AAC7D,+BAAiF;AACjF,gEAAuC;AACvC,wBAAqE;AAErE,MAAM,2BAA2B,GAC7B,0EAA0E,CAAC;AAE/E,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACnC,8CAAe,CAAA;IACf,4CAAa,CAAA;AACjB,CAAC,EAHW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAGtC;AAyBD,IAAa,sBAAsB,GAAnC,MAAa,sBAAsB;IAM/B,YAAiD,mBAAwC;;;;;mBAAxC;;QALrC;;;;mBAAiB,KAAK;WAAC;QACvB;;;;;WAAuD;QACvD;;;;;WAA2B;QAC3B;;;;;WAAqD;QAOjE;;;;mBAAa,CAAO,EAChB,MAAM,EACN,SAAS,EACT,YAAY,EACZ,SAAS,GAAG,KAAK,GACW,EAAE,EAAE;gBAChC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;gBAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;gBAC3B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;gBACjC,IAAI;oBACA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,CAAuB;wBAChF,SAAS,EAAE,gBAAgB;wBAC3B,MAAM;wBACN,SAAS;qBACZ,CAAC,CAAC;oBACH,kBAAW,
|
|
1
|
+
{"version":3,"file":"marketing-carousel.store.js","sourceRoot":"","sources":["../../src/contentful/marketing-carousel.store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAA6D;AAC7D,+BAAiF;AACjF,gEAAuC;AACvC,wBAAqE;AAErE,MAAM,2BAA2B,GAC7B,0EAA0E,CAAC;AAE/E,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACnC,8CAAe,CAAA;IACf,4CAAa,CAAA;AACjB,CAAC,EAHW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAGtC;AAyBD,IAAa,sBAAsB,GAAnC,MAAa,sBAAsB;IAM/B,YAAiD,mBAAwC;;;;;mBAAxC;;QALrC;;;;mBAAiB,KAAK;WAAC;QACvB;;;;;WAAuD;QACvD;;;;;WAA2B;QAC3B;;;;;WAAqD;QAOjE;;;;mBAAa,CAAO,EAChB,MAAM,EACN,SAAS,EACT,YAAY,EACZ,SAAS,GAAG,KAAK,GACW,EAAE,EAAE;gBAChC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;gBAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;gBAC3B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;gBACjC,IAAI;oBACA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,CAAuB;wBAChF,SAAS,EAAE,gBAAgB;wBAC3B,MAAM;wBACN,SAAS;qBACZ,CAAC,CAAC;oBACH,IAAA,kBAAW,EAAC,GAA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 let PageContentfulStore = class PageContentfulStore {
|
|
|
64
64
|
codeId,
|
|
65
65
|
isPreview,
|
|
66
66
|
});
|
|
67
|
-
mobx_1.runInAction(() => {
|
|
67
|
+
(0, mobx_1.runInAction)(() => {
|
|
68
68
|
this.pageData = data;
|
|
69
69
|
this.isInitialized = true;
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
finally {
|
|
73
|
-
mobx_1.runInAction(() => {
|
|
73
|
+
(0, mobx_1.runInAction)(() => {
|
|
74
74
|
this.isInitializing = false;
|
|
75
75
|
});
|
|
76
76
|
}
|
|
@@ -98,11 +98,11 @@ let PageContentfulStore = class PageContentfulStore {
|
|
|
98
98
|
return content === '%none%' ? undefined : content;
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
|
-
mobx_1.makeObservable(this);
|
|
101
|
+
(0, mobx_1.makeObservable)(this);
|
|
102
102
|
}
|
|
103
103
|
get tooltipsByObjectId() {
|
|
104
104
|
var _a;
|
|
105
|
-
return __1.arrayToMap((_a = this.pageData) === null || _a === void 0 ? void 0 : _a.fields.tooltips, entry => entry.fields.objectId);
|
|
105
|
+
return (0, __1.arrayToMap)((_a = this.pageData) === null || _a === void 0 ? void 0 : _a.fields.tooltips, entry => entry.fields.objectId);
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
__decorate([
|
|
@@ -131,8 +131,8 @@ __decorate([
|
|
|
131
131
|
__metadata("design:paramtypes", [])
|
|
132
132
|
], PageContentfulStore.prototype, "tooltipsByObjectId", null);
|
|
133
133
|
PageContentfulStore = __decorate([
|
|
134
|
-
react_ioc_1.injectable(),
|
|
135
|
-
__param(0, react_ioc_1.inject(_1.ContentfulDataStore)),
|
|
134
|
+
(0, react_ioc_1.injectable)(),
|
|
135
|
+
__param(0, (0, react_ioc_1.inject)(_1.ContentfulDataStore)),
|
|
136
136
|
__metadata("design:paramtypes", [_1.ContentfulDataStore])
|
|
137
137
|
], PageContentfulStore);
|
|
138
138
|
exports.PageContentfulStore = PageContentfulStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-contentful.store.js","sourceRoot":"","sources":["../../src/contentful/page-contentful.store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAA6D;AAC7D,+BAAiF;AACjF,0BAAgC;AAChC,wBAAgE;AAQhE,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;IAK5B,YAAiD,mBAAwC;;;;;mBAAxC;;QAJrC;;;;mBAAiB,KAAK;WAAC;QACvB;;;;mBAAgB,KAAK;WAAC;QACtB;;;;;WAAkC;QAO9C;;;;mBAAa,CAAO,EAAE,MAAM,EAAE,SAAS,GAAG,KAAK,EAA8B,EAAE,EAAE;gBAC7E,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;gBAC3B,IAAI;oBACA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,CAAkB;wBAC3E,SAAS,EAAE,kBAAkB;wBAC7B,MAAM;wBACN,SAAS;qBACZ,CAAC,CAAC;oBACH,kBAAW,
|
|
1
|
+
{"version":3,"file":"page-contentful.store.js","sourceRoot":"","sources":["../../src/contentful/page-contentful.store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAA6D;AAC7D,+BAAiF;AACjF,0BAAgC;AAChC,wBAAgE;AAQhE,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;IAK5B,YAAiD,mBAAwC;;;;;mBAAxC;;QAJrC;;;;mBAAiB,KAAK;WAAC;QACvB;;;;mBAAgB,KAAK;WAAC;QACtB;;;;;WAAkC;QAO9C;;;;mBAAa,CAAO,EAAE,MAAM,EAAE,SAAS,GAAG,KAAK,EAA8B,EAAE,EAAE;gBAC7E,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;gBAC3B,IAAI;oBACA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,iBAAiB,CAAkB;wBAC3E,SAAS,EAAE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,0CAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACtF,CAAC;CAQJ,CAAA;AA/Ce;IAAX,iBAAU;;2DAAwB;AACvB;IAAX,iBAAU;;0DAAuB;AACtB;IAAX,iBAAU;;qDAAmC;AAO9C;IADC,aAAM;;uDAkBL;AAGF;IADC,aAAM;;2DAML;AAGF;IADC,eAAQ;;;6DAGR;AAxCQ,mBAAmB;IAD/B,IAAA,sBAAU,GAAE;IAMI,WAAA,IAAA,kBAAM,EAAC,sBAAmB,CAAC,CAAA;qCAA8B,sBAAmB;GALhF,mBAAmB,CAgD/B;AAhDY,kDAAmB"}
|
package/dist/contentful/utils.js
CHANGED
|
@@ -11,11 +11,11 @@ const isTextEntry = (entry) => {
|
|
|
11
11
|
};
|
|
12
12
|
exports.isTextEntry = isTextEntry;
|
|
13
13
|
const isHeaderEntry = (entry) => {
|
|
14
|
-
return exports.isTextEntry(entry) && entry.fields.codeId.endsWith('-header');
|
|
14
|
+
return (0, exports.isTextEntry)(entry) && entry.fields.codeId.endsWith('-header');
|
|
15
15
|
};
|
|
16
16
|
exports.isHeaderEntry = isHeaderEntry;
|
|
17
17
|
const isDescriptionEntry = (entry) => {
|
|
18
|
-
return exports.isTextEntry(entry) && entry.fields.codeId.endsWith('-description');
|
|
18
|
+
return (0, exports.isTextEntry)(entry) && entry.fields.codeId.endsWith('-description');
|
|
19
19
|
};
|
|
20
20
|
exports.isDescriptionEntry = isDescriptionEntry;
|
|
21
21
|
const isOxPermissionsEntry = (entry) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/contentful/utils.ts"],"names":[],"mappings":";;;AAEA,MAAM,aAAa,GAAG,CAAC,KAAqB,EAAE,IAAY,EAAE,EAAE,CAC1D,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,KAAK,IAAI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AAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;AAC9E,CAAC,CAAC;AAFW,QAAA,kBAAkB,sBAE7B;AAEK,MAAM,oBAAoB,GAAG,CAAC,KAAqB,EAAsC,EAAE;IAC9F,OAAO,aAAa,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;AAChD,CAAC,CAAC;AAFW,QAAA,oBAAoB,wBAE/B"}
|
|
@@ -9,8 +9,8 @@ exports.errorClassNamesDefault = [
|
|
|
9
9
|
'.FormField--error',
|
|
10
10
|
];
|
|
11
11
|
const useScrollToError = (errorClassNames = exports.errorClassNamesDefault) => {
|
|
12
|
-
const ref = react_1.useRef(null);
|
|
13
|
-
const scrollToErrorHandler = react_1.useCallback(() => {
|
|
12
|
+
const ref = (0, react_1.useRef)(null);
|
|
13
|
+
const scrollToErrorHandler = (0, react_1.useCallback)(() => {
|
|
14
14
|
setTimeout(() => {
|
|
15
15
|
if (ref.current) {
|
|
16
16
|
for (const errorClassName of errorClassNames) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-scroll-to-error.js","sourceRoot":"","sources":["../../../src/hooks/use-scroll-to-error/use-scroll-to-error.ts"],"names":[],"mappings":";;;AAAA,iCAAuD;AAE1C,QAAA,sBAAsB,GAAG;IAClC,mBAAmB;IACnB,gBAAgB;IAChB,QAAQ;IACR,mBAAmB;CACtB,CAAC;AAEK,MAAM,gBAAgB,GAAG,CAC5B,eAAe,GAAG,8BAAsB,EACd,EAAE;IAC5B,MAAM,GAAG,GAAG,cAAM,
|
|
1
|
+
{"version":3,"file":"use-scroll-to-error.js","sourceRoot":"","sources":["../../../src/hooks/use-scroll-to-error/use-scroll-to-error.ts"],"names":[],"mappings":";;;AAAA,iCAAuD;AAE1C,QAAA,sBAAsB,GAAG;IAClC,mBAAmB;IACnB,gBAAgB;IAChB,QAAQ;IACR,mBAAmB;CACtB,CAAC;AAEK,MAAM,gBAAgB,GAAG,CAC5B,eAAe,GAAG,8BAAsB,EACd,EAAE;IAC5B,MAAM,GAAG,GAAG,IAAA,cAAM,EAAI,IAAI,CAAC,CAAC;IAC5B,MAAM,oBAAoB,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QAC1C,UAAU,CAAC,GAAG,EAAE;YACZ,IAAI,GAAG,CAAC,OAAO,EAAE;gBACb,KAAK,MAAM,cAAc,IAAI,eAAe,EAAE;oBAC1C,MAAM,KAAK,GAAG,GAAG,CAAC,OAAQ,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;oBACzD,IAAI,KAAK,EAAE;wBACP,KAAK,CAAC,cAAc,CAAC;4BACjB,KAAK,EAAE,QAAQ;4BACf,QAAQ,EAAE,QAAQ;yBACrB,CAAC,CAAC;wBACH,MAAM;qBACT;iBACJ;aACJ;QACL,CAAC,EAAE,CAAC,CAAC,CAAC;IACV,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;IACtB,OAAO,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;AACvC,CAAC,CAAC;AArBW,QAAA,gBAAgB,oBAqB3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/onboarding-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "Shared components between servicetitan monolith and Onboarding",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -50,8 +50,9 @@
|
|
|
50
50
|
"resumablejs": "~1.0.2"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
+
"@contentful/rich-text-react-renderer": "^15.6.2",
|
|
53
54
|
"@contentful/rich-text-types": "^15.7.0",
|
|
54
|
-
"@servicetitan/react-hooks": "^2.
|
|
55
|
+
"@servicetitan/react-hooks": "^2.3.0",
|
|
55
56
|
"classnames": "~2.3.1",
|
|
56
57
|
"contentful-resolve-response": "^1.3.0",
|
|
57
58
|
"query-string": "^7.0.1"
|
|
@@ -68,5 +69,5 @@
|
|
|
68
69
|
"less": true,
|
|
69
70
|
"webpack": false
|
|
70
71
|
},
|
|
71
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "3c8665339ec145e4faccdc601d2d1864ad2dda5a"
|
|
72
73
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect, useState, FC } from 'react';
|
|
2
2
|
import { useBoolean } from '@servicetitan/react-hooks';
|
|
3
3
|
import { BodyText, Button, Popover, PopoverProps, Spinner } from '@servicetitan/design-system';
|
|
4
4
|
import { observer } from 'mobx-react';
|
|
@@ -31,7 +31,7 @@ export interface AddressSuggestionPopoverProps extends PopoverProps {
|
|
|
31
31
|
onSuggestionSelect(suggestion: AddressModel): void;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export const AddressSuggestionPopover:
|
|
34
|
+
export const AddressSuggestionPopover: FC<AddressSuggestionPopoverProps> = observer(
|
|
35
35
|
({
|
|
36
36
|
portal = true,
|
|
37
37
|
width = 'm',
|
|
@@ -47,7 +47,9 @@ export const AddressSuggestionPopover: React.FC<AddressSuggestionPopoverProps> =
|
|
|
47
47
|
|
|
48
48
|
useEffect(() => {
|
|
49
49
|
const bootstrap = async () => {
|
|
50
|
-
if (!restProps.open)
|
|
50
|
+
if (!restProps.open) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
51
53
|
|
|
52
54
|
enabledLoading();
|
|
53
55
|
setResults(undefined);
|
|
@@ -2,7 +2,9 @@ import { AddressModel, AddressSuggestionsProvider } from '../components/address-
|
|
|
2
2
|
|
|
3
3
|
export class GoogleGeocoderSuggestionsProvider implements AddressSuggestionsProvider {
|
|
4
4
|
getSuggestions = async (address: AddressModel) => {
|
|
5
|
-
if (!window.google)
|
|
5
|
+
if (!window.google) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
6
8
|
const addressStr = this.addressToString(address);
|
|
7
9
|
const countryCode = address.country === 'Canada' ? 'ca' : 'us';
|
|
8
10
|
const params = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SyntheticEvent } from 'react';
|
|
2
2
|
import { Form, FormDropdownProps } from '@servicetitan/design-system';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { CountryDropdownInput } from './country-dropdown-input';
|
|
@@ -26,7 +26,7 @@ export const CompanyProfileForm = observer((props: { className?: string }) => {
|
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
const countryOnChangeHandler = (
|
|
29
|
-
event:
|
|
29
|
+
event: SyntheticEvent<HTMLElement>,
|
|
30
30
|
data: FormDropdownProps
|
|
31
31
|
) => {
|
|
32
32
|
if (form.$.companyCountry.$ && data.value !== form.$.companyCountry.$) {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
documentToReactComponents,
|
|
4
|
+
Options,
|
|
5
|
+
RenderNode,
|
|
6
|
+
} from '@contentful/rich-text-react-renderer';
|
|
7
|
+
import { Block, Inline, INLINES } from '@contentful/rich-text-types';
|
|
8
|
+
import { Link } from '@servicetitan/design-system';
|
|
9
|
+
import { RichText } from '.';
|
|
10
|
+
|
|
11
|
+
export const richTextRenderOptions = {
|
|
12
|
+
openHyperlinkInNewTab: {
|
|
13
|
+
[INLINES.HYPERLINK]: (node: Block | Inline, children: ReactNode) => {
|
|
14
|
+
return (
|
|
15
|
+
<Link primary href={node.data.uri} target="_blank" rel="noopener noreferrer">
|
|
16
|
+
{children}
|
|
17
|
+
</Link>
|
|
18
|
+
);
|
|
19
|
+
},
|
|
20
|
+
} as RenderNode,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export interface RichTextConfig {
|
|
24
|
+
document?: RichText;
|
|
25
|
+
options?: Options;
|
|
26
|
+
renderNodes?: RenderNode[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const documentToReactComponent: (config: RichTextConfig) => ReactNode = ({
|
|
30
|
+
document,
|
|
31
|
+
options,
|
|
32
|
+
renderNodes,
|
|
33
|
+
}) => {
|
|
34
|
+
const renderOptions = {
|
|
35
|
+
...options,
|
|
36
|
+
renderNode: renderNodes?.reduce((acc, x) => ({ ...acc, ...x })),
|
|
37
|
+
};
|
|
38
|
+
return document ? documentToReactComponents(document, renderOptions as Options) : undefined;
|
|
39
|
+
};
|
package/src/contentful/index.ts
CHANGED