@levo-so/react 0.0.2-alpha → 0.1.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/Checbox-sq-atGlJ.js +28 -0
- package/dist/CheckboxWidget-CD4lv7B4.js +118 -0
- package/dist/CollectionFormBuilder-a0pzMkWL.js +734 -0
- package/dist/CurrencyWidget-DRMqUgbP.js +60 -0
- package/dist/DateTimeWidget-FmBvE_lk.js +103 -0
- package/dist/DefaultFormVariant-BzHB74Ie.js +80 -0
- package/dist/DropdownWidget-CW0GSjwE.js +115 -0
- package/dist/EmailWidget-Nyc76pT8.js +42 -0
- package/dist/GeocoderWidget-Ib15NJcx.js +309 -0
- package/dist/Input-2CvZ90f8.js +54 -0
- package/dist/LevoProvider-DNbYyEaf.js +21 -0
- package/dist/MultiGeocoderWidget-BuW8i48_.js +49 -0
- package/dist/PhoneWidget-COo3SBNU.js +47 -0
- package/dist/RadioWidget-C8syq1dO.js +109 -0
- package/dist/RichTextWidget-B5qxi5OE.js +309 -0
- package/dist/Sonner-t6JVKA0a.js +39 -0
- package/dist/Spinner-CuUosd-S.js +297 -0
- package/dist/StepsFormVariant-NSTSIoVV.js +137 -0
- package/dist/SwitchWidget-C-p7lICr.js +53 -0
- package/dist/TextWidget-BtZp3DRk.js +34 -0
- package/dist/TextareaWidget-D0TbFUjX.js +30 -0
- package/dist/ToggleCheckboxWidget-BbVq_dAC.js +44 -0
- package/dist/Tooltip-CI4i4mYr.js +144 -0
- package/dist/URLWidget-00u8Svwt.js +14 -0
- package/dist/UploadWidget-Dim2TEFc.js +503 -0
- package/dist/audience/{block.d.ts → components/block.d.ts} +1 -1
- package/dist/audience/components/block.d.ts.map +1 -0
- package/dist/audience/{component.d.ts → components/component.d.ts} +1 -1
- package/dist/audience/components/component.d.ts.map +1 -0
- package/dist/audience/{page.d.ts → components/page.d.ts} +1 -1
- package/dist/audience/components/page.d.ts.map +1 -0
- package/dist/audience/components/useScrollDepth.d.ts.map +1 -0
- package/dist/audience/index.d.ts +3 -3
- package/dist/audience/index.d.ts.map +1 -1
- package/dist/audience/index.js +4 -2303
- package/dist/byteToSize-BFKZSBu1.js +8 -0
- package/dist/cn-C9QoOYNG.js +6 -0
- package/dist/collection/components/CollectionFormBuilder.d.ts +12 -0
- package/dist/collection/components/CollectionFormBuilder.d.ts.map +1 -0
- package/dist/collection/components/FieldRenderer.d.ts +9 -0
- package/dist/collection/components/FieldRenderer.d.ts.map +1 -0
- package/dist/collection/components/core/AsyncSelectPaginate/AsyncSelectPaginate.d.ts +5 -0
- package/dist/collection/components/core/AsyncSelectPaginate/AsyncSelectPaginate.d.ts.map +1 -0
- package/dist/collection/components/core/Checkbox/Checbox.d.ts +5 -0
- package/dist/collection/components/core/Checkbox/Checbox.d.ts.map +1 -0
- package/dist/collection/components/core/Input/Input.d.ts +11 -0
- package/dist/collection/components/core/Input/Input.d.ts.map +1 -0
- package/dist/collection/components/core/Switch/Switch.d.ts +5 -0
- package/dist/collection/components/core/Switch/Switch.d.ts.map +1 -0
- package/dist/collection/components/renderer/RenderArrayWidget.d.ts +5 -0
- package/dist/collection/components/renderer/RenderArrayWidget.d.ts.map +1 -0
- package/dist/collection/components/renderer/RenderCommonField.d.ts +5 -0
- package/dist/collection/components/renderer/RenderCommonField.d.ts.map +1 -0
- package/dist/collection/components/renderer/RenderRecordWidget.d.ts +4 -0
- package/dist/collection/components/renderer/RenderRecordWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/ErrorMessage.d.ts +6 -0
- package/dist/collection/components/widgets/ErrorMessage.d.ts.map +1 -0
- package/dist/collection/components/widgets/FieldWrapper.d.ts +14 -0
- package/dist/collection/components/widgets/FieldWrapper.d.ts.map +1 -0
- package/dist/collection/components/widgets/FormHelperText.d.ts +6 -0
- package/dist/collection/components/widgets/FormHelperText.d.ts.map +1 -0
- package/dist/collection/components/widgets/FormLabel.d.ts +8 -0
- package/dist/collection/components/widgets/FormLabel.d.ts.map +1 -0
- package/dist/collection/components/widgets/checkboxWidget/CheckboxWidget.d.ts +8 -0
- package/dist/collection/components/widgets/checkboxWidget/CheckboxWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/collectionWidget/CollectionWidget.d.ts +7 -0
- package/dist/collection/components/widgets/collectionWidget/CollectionWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/currencyWidget/CurrencyWidget.d.ts +9 -0
- package/dist/collection/components/widgets/currencyWidget/CurrencyWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/dateTimeWidget/DateTimeWidget.d.ts +10 -0
- package/dist/collection/components/widgets/dateTimeWidget/DateTimeWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/dropdownWidget/DropdownWidget.d.ts +9 -0
- package/dist/collection/components/widgets/dropdownWidget/DropdownWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/emailWidget/EmailWidget.d.ts +9 -0
- package/dist/collection/components/widgets/emailWidget/EmailWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/geocoderWidget/GeocoderWidget.d.ts +8 -0
- package/dist/collection/components/widgets/geocoderWidget/GeocoderWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/multiGeocoderWidget/MultiGeocoderWidget.d.ts +8 -0
- package/dist/collection/components/widgets/multiGeocoderWidget/MultiGeocoderWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/phoneWidget/PhoneWidget.d.ts +8 -0
- package/dist/collection/components/widgets/phoneWidget/PhoneWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/radioWidget/RadioWidget.d.ts +11 -0
- package/dist/collection/components/widgets/radioWidget/RadioWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/richTextWidget/RichTextWidget.d.ts +12 -0
- package/dist/collection/components/widgets/richTextWidget/RichTextWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/switchWidget/SwitchWidget.d.ts +8 -0
- package/dist/collection/components/widgets/switchWidget/SwitchWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/textWidget/TextWidget.d.ts +10 -0
- package/dist/collection/components/widgets/textWidget/TextWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/textareaWidget/TextareaWidget.d.ts +8 -0
- package/dist/collection/components/widgets/textareaWidget/TextareaWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/toggleCheckboxWidget/ToggleCheckboxWidget.d.ts +8 -0
- package/dist/collection/components/widgets/toggleCheckboxWidget/ToggleCheckboxWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/uploadWidget/FileUploadDropBox.d.ts +10 -0
- package/dist/collection/components/widgets/uploadWidget/FileUploadDropBox.d.ts.map +1 -0
- package/dist/collection/components/widgets/uploadWidget/FileUploadModal.d.ts +13 -0
- package/dist/collection/components/widgets/uploadWidget/FileUploadModal.d.ts.map +1 -0
- package/dist/collection/components/widgets/uploadWidget/ImportFromAssets.d.ts +11 -0
- package/dist/collection/components/widgets/uploadWidget/ImportFromAssets.d.ts.map +1 -0
- package/dist/collection/components/widgets/uploadWidget/UploadWidget.d.ts +19 -0
- package/dist/collection/components/widgets/uploadWidget/UploadWidget.d.ts.map +1 -0
- package/dist/collection/components/widgets/urlWidget/URLWidget.d.ts +5 -0
- package/dist/collection/components/widgets/urlWidget/URLWidget.d.ts.map +1 -0
- package/dist/collection/index.d.ts +5 -0
- package/dist/collection/index.d.ts.map +1 -0
- package/dist/collection/index.js +19 -0
- package/dist/collection/lib/FormBuilder.d.ts +8 -0
- package/dist/collection/lib/FormBuilder.d.ts.map +1 -0
- package/dist/collection/lib/SaveDraftValues.d.ts +7 -0
- package/dist/collection/lib/SaveDraftValues.d.ts.map +1 -0
- package/dist/collection/lib/hooks/useLevoForm.d.ts +18 -0
- package/dist/collection/lib/hooks/useLevoForm.d.ts.map +1 -0
- package/dist/collection/lib/provider/LevoFormProvider.d.ts +9 -0
- package/dist/collection/lib/provider/LevoFormProvider.d.ts.map +1 -0
- package/dist/collection/lib/variants/DefaultFormVariant.d.ts +3 -0
- package/dist/collection/lib/variants/DefaultFormVariant.d.ts.map +1 -0
- package/dist/collection/lib/variants/StepsFormVariant.d.ts +4 -0
- package/dist/collection/lib/variants/StepsFormVariant.d.ts.map +1 -0
- package/dist/collection/types/context.d.ts +34 -0
- package/dist/collection/types/context.d.ts.map +1 -0
- package/dist/collection/types/errors.d.ts +7 -0
- package/dist/collection/types/errors.d.ts.map +1 -0
- package/dist/collection/types/formVariant.d.ts +18 -0
- package/dist/collection/types/formVariant.d.ts.map +1 -0
- package/dist/collection/types/forms.d.ts +31 -0
- package/dist/collection/types/forms.d.ts.map +1 -0
- package/dist/collection/types/index.d.ts +4 -0
- package/dist/collection/types/index.d.ts.map +1 -0
- package/dist/collection/types/renderer.d.ts +6 -0
- package/dist/collection/types/renderer.d.ts.map +1 -0
- package/dist/collection/utils/formHelpers.d.ts +47 -0
- package/dist/collection/utils/formHelpers.d.ts.map +1 -0
- package/dist/collection/utils/getFieldValidations.d.ts +6 -0
- package/dist/collection/utils/getFieldValidations.d.ts.map +1 -0
- package/dist/collection/utils/index.d.ts +4 -0
- package/dist/collection/utils/index.d.ts.map +1 -0
- package/dist/collection/utils/schema.d.ts +3 -0
- package/dist/collection/utils/schema.d.ts.map +1 -0
- package/dist/collection/utils/setFormErrors.d.ts +4 -0
- package/dist/collection/utils/setFormErrors.d.ts.map +1 -0
- package/dist/collection/utils/storage.d.ts +11 -0
- package/dist/collection/utils/storage.d.ts.map +1 -0
- package/dist/components/Dialog.d.ts +21 -0
- package/dist/components/Dialog.d.ts.map +1 -0
- package/dist/components/DialogWrapper.d.ts +11 -0
- package/dist/components/DialogWrapper.d.ts.map +1 -0
- package/dist/components/Sonner.d.ts +7 -0
- package/dist/components/Sonner.d.ts.map +1 -0
- package/dist/components/Spinner.d.ts +5 -0
- package/dist/components/Spinner.d.ts.map +1 -0
- package/dist/components/Tabs.d.ts +8 -0
- package/dist/components/Tabs.d.ts.map +1 -0
- package/dist/components/Tooltip.d.ts +16 -0
- package/dist/components/Tooltip.d.ts.map +1 -0
- package/dist/components/button/Button.d.ts +12 -0
- package/dist/components/button/Button.d.ts.map +1 -0
- package/dist/components/button/buttonVariants.d.ts +6 -0
- package/dist/components/button/buttonVariants.d.ts.map +1 -0
- package/dist/components/button/index.d.ts +3 -0
- package/dist/components/button/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +33 -0
- package/dist/constants/fileUploadPresets.d.ts +34 -0
- package/dist/constants/fileUploadPresets.d.ts.map +1 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/errorHandler-BJcFS2qV.js +26 -0
- package/dist/fileUploadPresets-2raQmHT0.js +74 -0
- package/dist/index-wTf_TtOG.js +131 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +84 -0
- package/dist/isEmptyObject-C5s4GzLE.js +8 -0
- package/dist/jsx-runtime-B6kdoens.js +634 -0
- package/dist/membership/components/OAuth/Button.d.ts +8 -0
- package/dist/membership/components/OAuth/Button.d.ts.map +1 -0
- package/dist/membership/components/OAuth/Container.d.ts +24 -0
- package/dist/membership/components/OAuth/Container.d.ts.map +1 -0
- package/dist/membership/components/OAuth/Core.d.ts +17 -0
- package/dist/membership/components/OAuth/Core.d.ts.map +1 -0
- package/dist/membership/components/OAuth/Popup.d.ts +15 -0
- package/dist/membership/components/OAuth/Popup.d.ts.map +1 -0
- package/dist/membership/components/index.d.ts +8 -0
- package/dist/membership/components/index.d.ts.map +1 -0
- package/dist/membership/index.d.ts +2 -0
- package/dist/membership/index.d.ts.map +1 -0
- package/dist/membership/index.js +4 -0
- package/dist/page-CxaKoH22.js +205 -0
- package/dist/providers/LevoProvider.d.ts +25 -0
- package/dist/providers/LevoProvider.d.ts.map +1 -0
- package/dist/style.css +1 -0
- package/dist/useLevoForm-CR3q-L5Z.js +166 -0
- package/dist/utils/byteToSize.d.ts +3 -0
- package/dist/utils/byteToSize.d.ts.map +1 -0
- package/dist/utils/cn.d.ts +4 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils/errorHandler.d.ts +2 -0
- package/dist/utils/errorHandler.d.ts.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +14 -0
- package/dist/utils/isDateObject.d.ts +2 -0
- package/dist/utils/isDateObject.d.ts.map +1 -0
- package/dist/utils/isEmptyObject.d.ts +5 -0
- package/dist/utils/isEmptyObject.d.ts.map +1 -0
- package/dist/utils/isNullOrUndefined.d.ts +2 -0
- package/dist/utils/isNullOrUndefined.d.ts.map +1 -0
- package/dist/utils/isObject.d.ts +3 -0
- package/dist/utils/isObject.d.ts.map +1 -0
- package/package.json +82 -5
- package/dist/audience/block.d.ts.map +0 -1
- package/dist/audience/component.d.ts.map +0 -1
- package/dist/audience/page.d.ts.map +0 -1
- package/dist/audience/useScrollDepth.d.ts.map +0 -1
- /package/dist/audience/{useScrollDepth.d.ts → components/useScrollDepth.d.ts} +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type IWindowProps = {
|
|
3
|
+
url: string;
|
|
4
|
+
title: string;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
};
|
|
8
|
+
type IPopupProps = IWindowProps & {
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
onCode: (code: string, params: URLSearchParams) => void;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
};
|
|
13
|
+
declare const Popup: React.FC<IPopupProps>;
|
|
14
|
+
export default Popup;
|
|
15
|
+
//# sourceMappingURL=Popup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../../../../src/membership/components/OAuth/Popup.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,YAAY,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,WAAW,GAAG,YAAY,GAAG;IAChC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IACxD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAaF,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAkEhC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class LevoOAuth {
|
|
2
|
+
static Container: import('react').FC<import('./OAuth/Container').LevoOAuthProps>;
|
|
3
|
+
static Button: import('react').FC<{
|
|
4
|
+
provider: import('@levo-so/core').ILevoOAuthProvider;
|
|
5
|
+
children: import('react').ReactNode;
|
|
6
|
+
}>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/membership/components/index.ts"],"names":[],"mappings":"AAIA,qBAAa,SAAS;IACpB,MAAM,CAAC,SAAS,iEAAa;IAE7B,MAAM,CAAC,MAAM;;;OAAU;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/membership/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { j as R } from "./jsx-runtime-B6kdoens.js";
|
|
3
|
+
import { useEffect as d, useState as S } from "react";
|
|
4
|
+
import { useInView as H } from "react-intersection-observer";
|
|
5
|
+
import { u as O } from "./LevoProvider-DNbYyEaf.js";
|
|
6
|
+
import { usePageLifecycle as F, LifecycleState as I } from "use-page-lifecycle";
|
|
7
|
+
const G = ({ id: e, properties: r = {} }) => {
|
|
8
|
+
const { audience: n } = O(), { ref: c, inView: t } = H({
|
|
9
|
+
triggerOnce: !0
|
|
10
|
+
});
|
|
11
|
+
return d(() => {
|
|
12
|
+
n != null && n.instance && t && (n == null || n.track("block.view", {
|
|
13
|
+
...r,
|
|
14
|
+
resource: "block",
|
|
15
|
+
identifier: e
|
|
16
|
+
}));
|
|
17
|
+
}, [t]), /* @__PURE__ */ R.jsx("div", { ref: c, style: { height: "0px" } });
|
|
18
|
+
}, Se = G, U = ({ event: e, properties: r }) => {
|
|
19
|
+
const { audience: n } = O();
|
|
20
|
+
return d(() => {
|
|
21
|
+
n != null && n.instance && (n == null || n.track(e, r));
|
|
22
|
+
}, [n == null ? void 0 : n.instance, e, r]), null;
|
|
23
|
+
}, Le = U;
|
|
24
|
+
function L(e) {
|
|
25
|
+
var r = typeof e;
|
|
26
|
+
return e != null && (r == "object" || r == "function");
|
|
27
|
+
}
|
|
28
|
+
var V = typeof global == "object" && global && global.Object === Object && global, _ = typeof self == "object" && self && self.Object === Object && self, D = V || _ || Function("return this")(), j = function() {
|
|
29
|
+
return D.Date.now();
|
|
30
|
+
}, X = /\s/;
|
|
31
|
+
function Y(e) {
|
|
32
|
+
for (var r = e.length; r-- && X.test(e.charAt(r)); )
|
|
33
|
+
;
|
|
34
|
+
return r;
|
|
35
|
+
}
|
|
36
|
+
var Z = /^\s+/;
|
|
37
|
+
function q(e) {
|
|
38
|
+
return e && e.slice(0, Y(e) + 1).replace(Z, "");
|
|
39
|
+
}
|
|
40
|
+
var v = D.Symbol, N = Object.prototype, z = N.hasOwnProperty, J = N.toString, b = v ? v.toStringTag : void 0;
|
|
41
|
+
function K(e) {
|
|
42
|
+
var r = z.call(e, b), n = e[b];
|
|
43
|
+
try {
|
|
44
|
+
e[b] = void 0;
|
|
45
|
+
var c = !0;
|
|
46
|
+
} catch {
|
|
47
|
+
}
|
|
48
|
+
var t = J.call(e);
|
|
49
|
+
return c && (r ? e[b] = n : delete e[b]), t;
|
|
50
|
+
}
|
|
51
|
+
var Q = Object.prototype, ee = Q.toString;
|
|
52
|
+
function te(e) {
|
|
53
|
+
return ee.call(e);
|
|
54
|
+
}
|
|
55
|
+
var ne = "[object Null]", re = "[object Undefined]", $ = v ? v.toStringTag : void 0;
|
|
56
|
+
function ie(e) {
|
|
57
|
+
return e == null ? e === void 0 ? re : ne : $ && $ in Object(e) ? K(e) : te(e);
|
|
58
|
+
}
|
|
59
|
+
function oe(e) {
|
|
60
|
+
return e != null && typeof e == "object";
|
|
61
|
+
}
|
|
62
|
+
var ce = "[object Symbol]";
|
|
63
|
+
function se(e) {
|
|
64
|
+
return typeof e == "symbol" || oe(e) && ie(e) == ce;
|
|
65
|
+
}
|
|
66
|
+
var A = NaN, fe = /^[-+]0x[0-9a-f]+$/i, ae = /^0b[01]+$/i, le = /^0o[0-7]+$/i, ue = parseInt;
|
|
67
|
+
function P(e) {
|
|
68
|
+
if (typeof e == "number")
|
|
69
|
+
return e;
|
|
70
|
+
if (se(e))
|
|
71
|
+
return A;
|
|
72
|
+
if (L(e)) {
|
|
73
|
+
var r = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
74
|
+
e = L(r) ? r + "" : r;
|
|
75
|
+
}
|
|
76
|
+
if (typeof e != "string")
|
|
77
|
+
return e === 0 ? e : +e;
|
|
78
|
+
e = q(e);
|
|
79
|
+
var n = ae.test(e);
|
|
80
|
+
return n || le.test(e) ? ue(e.slice(2), n ? 2 : 8) : fe.test(e) ? A : +e;
|
|
81
|
+
}
|
|
82
|
+
var de = "Expected a function", ge = Math.max, me = Math.min;
|
|
83
|
+
function pe(e, r, n) {
|
|
84
|
+
var c, t, f, l, o, a, s = 0, g = !1, m = !1, y = !0;
|
|
85
|
+
if (typeof e != "function")
|
|
86
|
+
throw new TypeError(de);
|
|
87
|
+
r = P(r) || 0, L(n) && (g = !!n.leading, m = "maxWait" in n, f = m ? ge(P(n.maxWait) || 0, r) : f, y = "trailing" in n ? !!n.trailing : y);
|
|
88
|
+
function T(i) {
|
|
89
|
+
var u = c, p = t;
|
|
90
|
+
return c = t = void 0, s = i, l = e.apply(p, u), l;
|
|
91
|
+
}
|
|
92
|
+
function B(i) {
|
|
93
|
+
return s = i, o = setTimeout(h, r), g ? T(i) : l;
|
|
94
|
+
}
|
|
95
|
+
function C(i) {
|
|
96
|
+
var u = i - a, p = i - s, k = r - u;
|
|
97
|
+
return m ? me(k, f - p) : k;
|
|
98
|
+
}
|
|
99
|
+
function x(i) {
|
|
100
|
+
var u = i - a, p = i - s;
|
|
101
|
+
return a === void 0 || u >= r || u < 0 || m && p >= f;
|
|
102
|
+
}
|
|
103
|
+
function h() {
|
|
104
|
+
var i = j();
|
|
105
|
+
if (x(i))
|
|
106
|
+
return E(i);
|
|
107
|
+
o = setTimeout(h, C(i));
|
|
108
|
+
}
|
|
109
|
+
function E(i) {
|
|
110
|
+
return o = void 0, y && c ? T(i) : (c = t = void 0, l);
|
|
111
|
+
}
|
|
112
|
+
function M() {
|
|
113
|
+
o !== void 0 && clearTimeout(o), s = 0, c = a = t = o = void 0;
|
|
114
|
+
}
|
|
115
|
+
function W() {
|
|
116
|
+
return o === void 0 ? l : E(j());
|
|
117
|
+
}
|
|
118
|
+
function w() {
|
|
119
|
+
var i = j(), u = x(i);
|
|
120
|
+
if (c = arguments, t = this, a = i, u) {
|
|
121
|
+
if (o === void 0)
|
|
122
|
+
return B(a);
|
|
123
|
+
if (m)
|
|
124
|
+
return clearTimeout(o), o = setTimeout(h, r), T(a);
|
|
125
|
+
}
|
|
126
|
+
return o === void 0 && (o = setTimeout(h, r)), l;
|
|
127
|
+
}
|
|
128
|
+
return w.cancel = M, w.flush = W, w;
|
|
129
|
+
}
|
|
130
|
+
const be = () => {
|
|
131
|
+
const [e, r] = S(0), [n, c] = S(0), t = pe((f) => {
|
|
132
|
+
c(f), r(f);
|
|
133
|
+
}, 250);
|
|
134
|
+
return d(() => {
|
|
135
|
+
const f = () => {
|
|
136
|
+
const l = window.scrollY, o = document.documentElement.scrollHeight, a = window.innerHeight, s = Math.round(
|
|
137
|
+
l / (o - a) * 100
|
|
138
|
+
);
|
|
139
|
+
s % 10 === 0 && s > n && t(s);
|
|
140
|
+
};
|
|
141
|
+
return window.addEventListener("scroll", f), () => window.removeEventListener("scroll", f);
|
|
142
|
+
}, [n]), e;
|
|
143
|
+
}, he = ({
|
|
144
|
+
id: e,
|
|
145
|
+
workspace_id: r,
|
|
146
|
+
baseUrl: n = "/.levo/insights/api",
|
|
147
|
+
properties: c = {}
|
|
148
|
+
}) => {
|
|
149
|
+
const { audience: t } = O(), [f, l] = S(), o = be(), a = typeof window < "u" ? window.location.href : void 0;
|
|
150
|
+
d(() => {
|
|
151
|
+
a && l(a);
|
|
152
|
+
}, [a]), d(() => {
|
|
153
|
+
t != null && t.instance && (t == null || t.track("page.scroll", {
|
|
154
|
+
resource: "page",
|
|
155
|
+
identifier: e,
|
|
156
|
+
percent: o
|
|
157
|
+
}));
|
|
158
|
+
}, [t == null ? void 0 : t.instance, o]), d(() => {
|
|
159
|
+
const g = () => {
|
|
160
|
+
t == null || t.track("page.bounce", {
|
|
161
|
+
resource: "page",
|
|
162
|
+
identifier: e
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
return window && window.addEventListener("beforeunload", g), () => {
|
|
166
|
+
window && window.removeEventListener("beforeunload", g);
|
|
167
|
+
};
|
|
168
|
+
}, [a]);
|
|
169
|
+
const [s] = F();
|
|
170
|
+
return d(() => {
|
|
171
|
+
s === I.TERMINATED && (t == null || t.track("page.bounce", {
|
|
172
|
+
resource: "page",
|
|
173
|
+
identifier: e,
|
|
174
|
+
state: s
|
|
175
|
+
})), s === I.FROZEN && (t == null || t.track("page.bounce", {
|
|
176
|
+
resource: "page",
|
|
177
|
+
identifier: e,
|
|
178
|
+
state: s
|
|
179
|
+
}));
|
|
180
|
+
}, [s]), n && f ? /* @__PURE__ */ R.jsx(
|
|
181
|
+
"img",
|
|
182
|
+
{
|
|
183
|
+
alt: "",
|
|
184
|
+
src: `${n}/v1/insights/event/hello.gif?url=${f}`,
|
|
185
|
+
style: {
|
|
186
|
+
height: "0px"
|
|
187
|
+
},
|
|
188
|
+
onLoad: () => {
|
|
189
|
+
t != null && t.instance ? t == null || t.instance.page({
|
|
190
|
+
resource: "page",
|
|
191
|
+
identifier: c.id
|
|
192
|
+
}) : t == null || t.initiate({
|
|
193
|
+
baseUrl: n,
|
|
194
|
+
workspace_id: r,
|
|
195
|
+
properties: { ...c, id: e }
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
) : null;
|
|
200
|
+
}, Oe = he;
|
|
201
|
+
export {
|
|
202
|
+
Se as L,
|
|
203
|
+
Le as a,
|
|
204
|
+
Oe as b
|
|
205
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LevoClient } from '@levo-so/core';
|
|
2
|
+
import { LevoAudience } from '@levo-so/core/audience-plugin';
|
|
3
|
+
import { LevoMembership } from '@levo-so/core/membership-plugin';
|
|
4
|
+
import { LevoCollection } from '@levo-so/core/collection-plugin';
|
|
5
|
+
import { LevoMedia } from '@levo-so/core/media-plugin';
|
|
6
|
+
import { LevoBlog } from '@levo-so/core/blog-plugin';
|
|
7
|
+
import { LevoLogger } from '@levo-so/core/logger-plugin';
|
|
8
|
+
import { default as React } from 'react';
|
|
9
|
+
interface ILevoContext {
|
|
10
|
+
client: LevoClient;
|
|
11
|
+
audience?: LevoAudience;
|
|
12
|
+
membership?: LevoMembership;
|
|
13
|
+
collection?: LevoCollection;
|
|
14
|
+
media?: LevoMedia;
|
|
15
|
+
blog?: LevoBlog;
|
|
16
|
+
logger?: LevoLogger;
|
|
17
|
+
}
|
|
18
|
+
interface ILevoProps extends Partial<ILevoContext> {
|
|
19
|
+
client: LevoClient;
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export declare const LevoProvider: React.FC<ILevoProps>;
|
|
23
|
+
export declare const useLevo: () => ILevoContext;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=LevoProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LevoProvider.d.ts","sourceRoot":"","sources":["../../src/providers/LevoProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,UAAU,YAAY;IACpB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAID,UAAU,UAAW,SAAQ,OAAO,CAAC,YAAY,CAAC;IAChD,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAU7C,CAAC;AAEF,eAAO,MAAM,OAAO,QAOS,YAC5B,CAAC"}
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.react-international-phone-country-selector{position:relative}.react-international-phone-country-selector-button{display:flex;height:var(--react-international-phone-height, 36px);box-sizing:border-box;align-items:center;justify-content:center;padding:0;border:1px solid var(--react-international-phone-country-selector-border-color, var(--react-international-phone-border-color, gainsboro));margin:0;-moz-appearance:button;appearance:button;-webkit-appearance:button;background-color:var(--react-international-phone-country-selector-background-color, var(--react-international-phone-background-color, white));cursor:pointer;text-transform:none;-webkit-user-select:none;user-select:none}.react-international-phone-country-selector-button:hover{background-color:var(--react-international-phone-country-selector-background-color-hover, whitesmoke)}.react-international-phone-country-selector-button--hide-dropdown{cursor:auto}.react-international-phone-country-selector-button--hide-dropdown:hover{background-color:transparent}.react-international-phone-country-selector-button__button-content{display:flex;align-items:center;justify-content:center}.react-international-phone-country-selector-button__flag-emoji{margin:0 4px}.react-international-phone-country-selector-button__flag-emoji--disabled{opacity:.75}.react-international-phone-country-selector-button__dropdown-arrow{border-top:var(--react-international-phone-country-selector-arrow-size, 4px) solid var(--react-international-phone-country-selector-arrow-color, #777);border-right:var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;border-left:var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;margin-right:4px;transition:all .1s ease-out}.react-international-phone-country-selector-button__dropdown-arrow--active{transform:rotateX(180deg)}.react-international-phone-country-selector-button__dropdown-arrow--disabled{border-top-color:var(--react-international-phone-disabled-country-selector-arrow-color, #999)}.react-international-phone-country-selector-button--disabled{background-color:var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));cursor:auto}.react-international-phone-country-selector-button--disabled:hover{background-color:var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke))}.react-international-phone-flag-emoji{width:var(--react-international-phone-flag-width, 24px);height:var(--react-international-phone-flag-height, 24px);box-sizing:border-box}.react-international-phone-country-selector-dropdown{position:absolute;z-index:1;top:var(--react-international-phone-dropdown-top, 44px);left:var(--react-international-phone-dropdown-left, 0);display:flex;width:300px;max-height:200px;flex-direction:column;padding:4px 0;margin:0;background-color:var(--react-international-phone-dropdown-item-background-color, var(--react-international-phone-background-color, white));box-shadow:var(--react-international-phone-dropdown-shadow, 2px 2px 16px rgba(0, 0, 0, .25));color:var(--react-international-phone-dropdown-item-text-color, var(--react-international-phone-text-color, #222));list-style:none;overflow-y:scroll}.react-international-phone-country-selector-dropdown__preferred-list-divider{height:1px;border:none;margin:var(--react-international-phone-dropdown-preferred-list-divider-margin, 0);background:var(--react-international-phone-dropdown-preferred-list-divider-color, var(--react-international-phone-border-color, gainsboro))}.react-international-phone-country-selector-dropdown__list-item{display:flex;min-height:var(--react-international-phone-dropdown-item-height, 28px);box-sizing:border-box;align-items:center;padding:2px 8px}.react-international-phone-country-selector-dropdown__list-item-flag-emoji{margin-right:8px}.react-international-phone-country-selector-dropdown__list-item-country-name{overflow:hidden;margin-right:8px;font-size:var(--react-international-phone-dropdown-item-font-size, 14px);text-overflow:ellipsis;white-space:nowrap}.react-international-phone-country-selector-dropdown__list-item-dial-code{color:var(--react-international-phone-dropdown-item-dial-code-color, gray);font-size:var(--react-international-phone-dropdown-item-font-size, 14px)}.react-international-phone-country-selector-dropdown__list-item:hover{background-color:var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke));cursor:pointer}.react-international-phone-country-selector-dropdown__list-item--selected,.react-international-phone-country-selector-dropdown__list-item--focused{background-color:var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke);color:var(--react-international-phone-selected-dropdown-item-text-color, var(--react-international-phone-text-color, #222))}.react-international-phone-country-selector-dropdown__list-item--selected .react-international-phone-country-selector-dropdown__list-item-dial-code,.react-international-phone-country-selector-dropdown__list-item--focused .react-international-phone-country-selector-dropdown__list-item-dial-code{color:var(--react-international-phone-selected-dropdown-item-dial-code-color, var(--react-international-phone-dropdown-item-dial-code-color, gray))}.react-international-phone-country-selector-dropdown__list-item--focused{background-color:var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke))}.react-international-phone-dial-code-preview{display:flex;align-items:center;justify-content:center;padding:0 8px;border:1px solid var(--react-international-phone-dial-code-preview-border-color, var(--react-international-phone-border-color, gainsboro));margin-right:-1px;background-color:var(--react-international-phone-dial-code-preview-background-color, var(--react-international-phone-background-color, white));color:var(--react-international-phone-dial-code-preview-text-color, var(--react-international-phone-text-color, #222));font-size:var(--react-international-phone-dial-code-preview-font-size, var(--react-international-phone-font-size, 13px))}.react-international-phone-dial-code-preview--disabled{background-color:var(--react-international-phone-dial-code-preview-disabled-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));color:var(--react-international-phone-dial-code-preview-disabled-text-color, var(--react-international-phone-disabled-text-color, #666))}.react-international-phone-input-container{display:flex}.react-international-phone-input-container .react-international-phone-country-selector-button{border-radius:var(--react-international-phone-border-radius, 4px);margin-right:-1px;border-bottom-right-radius:0;border-top-right-radius:0}.react-international-phone-input-container .react-international-phone-input{overflow:visible;height:var(--react-international-phone-height, 36px);box-sizing:border-box;padding:0 8px;border:1px solid var(--react-international-phone-border-color, gainsboro);border-radius:var(--react-international-phone-border-radius, 4px);margin:0;background-color:var(--react-international-phone-background-color, white);border-bottom-left-radius:0;border-top-left-radius:0;color:var(--react-international-phone-text-color, #222);font-family:inherit;font-size:var(--react-international-phone-font-size, 13px)}.react-international-phone-input-container .react-international-phone-input:focus{outline:none}.react-international-phone-input-container .react-international-phone-input--disabled{background-color:var(--react-international-phone-disabled-background-color, whitesmoke);color:var(--react-international-phone-disabled-text-color, #666)}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect as F, useState as O, useRef as B } from "react";
|
|
3
|
+
import { useFormContext as G, useWatch as H, useForm as W } from "react-hook-form";
|
|
4
|
+
import { useDebouncedCallback as q } from "use-debounce";
|
|
5
|
+
import { m as U, b as C, s as z, f as Q } from "./CollectionFormBuilder-a0pzMkWL.js";
|
|
6
|
+
import { u as j } from "./LevoProvider-DNbYyEaf.js";
|
|
7
|
+
import { s as X } from "./Sonner-t6JVKA0a.js";
|
|
8
|
+
import { a as Z } from "./isEmptyObject-C5s4GzLE.js";
|
|
9
|
+
import { e as x } from "./errorHandler-BJcFS2qV.js";
|
|
10
|
+
const A = {
|
|
11
|
+
FORM_DIRTY: "form-dirty",
|
|
12
|
+
FORM_VALUES: "form-values"
|
|
13
|
+
}, m = (t) => {
|
|
14
|
+
const s = localStorage.getItem(`${t}-${A.FORM_VALUES}`);
|
|
15
|
+
return s ? JSON.parse(s) : {};
|
|
16
|
+
}, h = (t, s) => {
|
|
17
|
+
localStorage.setItem(
|
|
18
|
+
`${t}-${A.FORM_VALUES}`,
|
|
19
|
+
JSON.stringify(s)
|
|
20
|
+
);
|
|
21
|
+
}, M = (t) => {
|
|
22
|
+
localStorage.removeItem(`${t}-${A.FORM_VALUES}`);
|
|
23
|
+
}, tt = async ({
|
|
24
|
+
collection_key: t,
|
|
25
|
+
data: s
|
|
26
|
+
}) => {
|
|
27
|
+
const { client: E } = j(), r = await fetch(
|
|
28
|
+
`${E.apiUrl}/v1/bevy/content/${t}/save-entry`,
|
|
29
|
+
{
|
|
30
|
+
method: "POST",
|
|
31
|
+
body: JSON.stringify({ ...s }),
|
|
32
|
+
headers: {
|
|
33
|
+
"Content-Type": "application/json"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
return r != null && r.ok ? await r.json() : null;
|
|
38
|
+
}, ft = ({ currentValues: t, isError: s, getContentId: E }) => {
|
|
39
|
+
var v;
|
|
40
|
+
const { schema: r, isLoggedIn: d } = U(), e = G(), y = H(), V = q((p) => {
|
|
41
|
+
r != null && r.key && !s && r != null && r.allow_draft && (d ? tt({
|
|
42
|
+
collection_key: r == null ? void 0 : r.key,
|
|
43
|
+
data: p
|
|
44
|
+
}).then((u) => {
|
|
45
|
+
var I, k, _, f;
|
|
46
|
+
(k = (I = u == null ? void 0 : u.content) == null ? void 0 : I.data) != null && k._id && E((f = (_ = u == null ? void 0 : u.content) == null ? void 0 : _.data) == null ? void 0 : f._id);
|
|
47
|
+
}) : h(r == null ? void 0 : r.key, p));
|
|
48
|
+
}, 2500);
|
|
49
|
+
return F(() => {
|
|
50
|
+
var p, u;
|
|
51
|
+
!s && d && (p = e == null ? void 0 : e.formState) != null && p.isDirty && ((u = Object == null ? void 0 : Object.keys(y || {})) == null ? void 0 : u.length) > 0 && V({
|
|
52
|
+
currentValues: t,
|
|
53
|
+
...y
|
|
54
|
+
});
|
|
55
|
+
}, [(v = e == null ? void 0 : e.formState) == null ? void 0 : v.isDirty, s, d, y]), null;
|
|
56
|
+
}, ct = ({
|
|
57
|
+
schema: t,
|
|
58
|
+
saveToRemote: s,
|
|
59
|
+
onSubmit: E,
|
|
60
|
+
onSubmitSuccess: r,
|
|
61
|
+
onSubmitError: d
|
|
62
|
+
}) => {
|
|
63
|
+
const { collection: e } = j(), {
|
|
64
|
+
toastConfig: y,
|
|
65
|
+
onSuccess: V,
|
|
66
|
+
onError: v,
|
|
67
|
+
isLoggedIn: p,
|
|
68
|
+
isDisabled: u,
|
|
69
|
+
externalInitialValues: I = {}
|
|
70
|
+
} = U(), [k, _] = O({}), [f, L] = O(null), [J, R] = O(!1), [N, T] = O(!1), n = B({}), P = C(t), g = W({
|
|
71
|
+
mode: "all",
|
|
72
|
+
disabled: u,
|
|
73
|
+
defaultValues: P,
|
|
74
|
+
values: k,
|
|
75
|
+
resetOptions: {
|
|
76
|
+
keepErrors: !0
|
|
77
|
+
}
|
|
78
|
+
}), K = g.handleSubmit(async (c) => {
|
|
79
|
+
var b, S, a, o, $, D;
|
|
80
|
+
if (n.current = {
|
|
81
|
+
...n.current || {},
|
|
82
|
+
...c
|
|
83
|
+
}, s && e) {
|
|
84
|
+
if (t)
|
|
85
|
+
try {
|
|
86
|
+
const l = z(n == null ? void 0 : n.current, t);
|
|
87
|
+
let i = null;
|
|
88
|
+
if (f ? i = await (e == null ? void 0 : e.submitDraftEntry(t == null ? void 0 : t.key, l).catch((w) => (x(w), null))) : i = await (e == null ? void 0 : e.saveCollectionData({
|
|
89
|
+
collection_id: t == null ? void 0 : t.id,
|
|
90
|
+
data: l
|
|
91
|
+
}).catch((w) => (x(w), null))), (b = i == null ? void 0 : i.content) != null && b.data)
|
|
92
|
+
return y != null && y.showSuccessToast && X(
|
|
93
|
+
y.successToastText || "Form submitted successfully."
|
|
94
|
+
), n.current = Z(I) ? {} : { ...I }, M(t == null ? void 0 : t.key), L(null), V && V({
|
|
95
|
+
schemaId: t == null ? void 0 : t.id,
|
|
96
|
+
response: (S = i == null ? void 0 : i.content) == null ? void 0 : S.data
|
|
97
|
+
}), !0;
|
|
98
|
+
throw new Error("Failed to save form details, API response invalid");
|
|
99
|
+
} catch (l) {
|
|
100
|
+
const i = ($ = (o = (a = l == null ? void 0 : l.response) == null ? void 0 : a.data) == null ? void 0 : o.content) == null ? void 0 : $.errors;
|
|
101
|
+
return Q(i, g.setError), d && d(i), v && v(((D = l == null ? void 0 : l.response) == null ? void 0 : D.data) || l), !1;
|
|
102
|
+
}
|
|
103
|
+
return !1;
|
|
104
|
+
}
|
|
105
|
+
c && E && E(c);
|
|
106
|
+
}), Y = (c) => {
|
|
107
|
+
c && c !== f && L(c);
|
|
108
|
+
};
|
|
109
|
+
return F(() => {
|
|
110
|
+
if (t && e) {
|
|
111
|
+
const c = C(t);
|
|
112
|
+
if (n.current = {
|
|
113
|
+
...c,
|
|
114
|
+
...I || {},
|
|
115
|
+
...n.current || {}
|
|
116
|
+
}, !f && t != null && t.allow_draft) {
|
|
117
|
+
if (p) {
|
|
118
|
+
R(!0), e == null || e.getDraftEntry(t == null ? void 0 : t.key).then((S) => {
|
|
119
|
+
if (S === null) {
|
|
120
|
+
T(!0);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
T(!1);
|
|
124
|
+
const a = Array.isArray(S) ? S == null ? void 0 : S.filter((o) => (o == null ? void 0 : o._status) === "draft") : [];
|
|
125
|
+
if ((a == null ? void 0 : a.length) > 0) {
|
|
126
|
+
const o = (a == null ? void 0 : a[0]) || {};
|
|
127
|
+
o != null && o._id && (n.current = {
|
|
128
|
+
...n.current || {},
|
|
129
|
+
...o
|
|
130
|
+
}, L(o == null ? void 0 : o._id));
|
|
131
|
+
}
|
|
132
|
+
}).catch(() => null).finally(() => {
|
|
133
|
+
_({
|
|
134
|
+
...n == null ? void 0 : n.current
|
|
135
|
+
}), R(!1);
|
|
136
|
+
});
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const b = m(t == null ? void 0 : t.key);
|
|
140
|
+
b && (n.current = {
|
|
141
|
+
...b,
|
|
142
|
+
...n.current || {}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
_({
|
|
146
|
+
...(n == null ? void 0 : n.current) || {}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}, [t]), F(() => {
|
|
150
|
+
t && f && M(t == null ? void 0 : t.key);
|
|
151
|
+
}, [f]), F(() => {
|
|
152
|
+
g.formState.isSubmitSuccessful && (r && r(), g.reset(), g.clearErrors());
|
|
153
|
+
}, [g.formState.isSubmitSuccessful]), {
|
|
154
|
+
methods: g,
|
|
155
|
+
isLoading: J,
|
|
156
|
+
isError: N,
|
|
157
|
+
contentId: f,
|
|
158
|
+
allFormValues: n.current,
|
|
159
|
+
handleContentId: Y,
|
|
160
|
+
handleSubmit: K
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
export {
|
|
164
|
+
ft as S,
|
|
165
|
+
ct as u
|
|
166
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"byteToSize.d.ts","sourceRoot":"","sources":["../../src/utils/byteToSize.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,UAAW,MAAM,8BAQvC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C,eAAO,MAAM,EAAE,cAAe,UAAU,EAAE,WAEzC,CAAC;AAEF,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorHandler.d.ts","sourceRoot":"","sources":["../../src/utils/errorHandler.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,UAAW,GAAG,SAiCtC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,MAAM,CAAC;AACrB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { b as s } from "../byteToSize-BFKZSBu1.js";
|
|
2
|
+
import { e as t } from "../errorHandler-BJcFS2qV.js";
|
|
3
|
+
import { c as i } from "../cn-C9QoOYNG.js";
|
|
4
|
+
import { i as c, a as p, b as f, d as m, c as O } from "../isEmptyObject-C5s4GzLE.js";
|
|
5
|
+
export {
|
|
6
|
+
s as byteToSize,
|
|
7
|
+
i as cn,
|
|
8
|
+
t as errorHandler,
|
|
9
|
+
c as isDateObject,
|
|
10
|
+
p as isEmptyObject,
|
|
11
|
+
f as isNullOrUndefined,
|
|
12
|
+
m as isObject,
|
|
13
|
+
O as isObjectType
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isDateObject.d.ts","sourceRoot":"","sources":["../../src/utils/isDateObject.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,UAAW,OAAO,KAAG,KAAK,IAAI,IAChC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isEmptyObject.d.ts","sourceRoot":"","sources":["../../src/utils/isEmptyObject.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GAAG;KAAG,CAAC,IAAI,MAAM,GAAG,MAAM,GAAG,KAAK;CAAE,CAAC;AAE5D,eAAO,MAAM,aAAa,UAAW,OAAO,KAAG,KAAK,IAAI,WACT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isNullOrUndefined.d.ts","sourceRoot":"","sources":["../../src/utils/isNullOrUndefined.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,UAAW,OAAO,KAAG,KAAK,IAAI,IAAI,GAAG,SACpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isObject.d.ts","sourceRoot":"","sources":["../../src/utils/isObject.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,UAAW,OAAO,KAAG,KAAK,IAAI,MAC5B,CAAC;AAE5B,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,MAAM,SAAS,OAAO,KAAG,KAAK,IAAI,CAI/C,CAAC"}
|