@redneckz/wildless-cms-uni-blocks 0.14.965 → 0.14.966

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.
Files changed (42) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +23 -5
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +3 -0
  5. package/bundle/components/ApplicationForm/handlers.d.ts +2 -1
  6. package/dist/components/ApplicationForm/ApplicationForm.js +2 -1
  7. package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  8. package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +3 -0
  9. package/dist/components/ApplicationForm/handlers.d.ts +2 -1
  10. package/dist/components/ApplicationForm/handlers.js +20 -3
  11. package/dist/components/ApplicationForm/handlers.js.map +1 -1
  12. package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
  13. package/lib/components/ApplicationForm/ApplicationForm.js +2 -1
  14. package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  15. package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +3 -0
  16. package/lib/components/ApplicationForm/handlers.d.ts +2 -1
  17. package/lib/components/ApplicationForm/handlers.js +20 -3
  18. package/lib/components/ApplicationForm/handlers.js.map +1 -1
  19. package/mobile/bundle/bundle.umd.js +23 -5
  20. package/mobile/bundle/bundle.umd.min.js +1 -1
  21. package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +3 -0
  22. package/mobile/bundle/components/ApplicationForm/handlers.d.ts +2 -1
  23. package/mobile/dist/components/ApplicationForm/ApplicationForm.js +2 -1
  24. package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
  25. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +3 -0
  26. package/mobile/dist/components/ApplicationForm/handlers.d.ts +2 -1
  27. package/mobile/dist/components/ApplicationForm/handlers.js +20 -3
  28. package/mobile/dist/components/ApplicationForm/handlers.js.map +1 -1
  29. package/mobile/lib/components/ApplicationForm/ApplicationForm.js +2 -1
  30. package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
  31. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +3 -0
  32. package/mobile/lib/components/ApplicationForm/handlers.d.ts +2 -1
  33. package/mobile/lib/components/ApplicationForm/handlers.js +20 -3
  34. package/mobile/lib/components/ApplicationForm/handlers.js.map +1 -1
  35. package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +2 -0
  36. package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +3 -0
  37. package/mobile/src/components/ApplicationForm/handlers.ts +26 -3
  38. package/package.json +1 -1
  39. package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +25 -0
  40. package/src/components/ApplicationForm/ApplicationForm.tsx +2 -0
  41. package/src/components/ApplicationForm/ApplicationFormContent.ts +3 -0
  42. package/src/components/ApplicationForm/handlers.ts +26 -3
@@ -1906,11 +1906,28 @@
1906
1906
  }
1907
1907
  }
1908
1908
  };
1909
- const handleDefault = async ({ formatData, data, aspects = {}, ev, router, responseTypeDialog, endpoint, }) => {
1910
- const ok = Boolean(await API$2.send(formatData, router, endpoint === 'lead'));
1909
+ const handleDefault = async ({ formatData, data, aspects = {}, ev, router, responseTypeDialog, endpoint, withSnowplow, }) => {
1910
+ const response = await API$2.send(formatData, router, endpoint === 'lead');
1911
+ const ok = Boolean(response);
1911
1912
  responseTypeDialog.open({ ok });
1912
1913
  if (ok) {
1913
- handleAspects({ aspectsAttributes: data, aspects, ev });
1914
+ const { requestId } = response;
1915
+ const { phone } = formatData;
1916
+ const utms = router.pathname.split('?')[1];
1917
+ const eventJSON = JSON.stringify({
1918
+ id: requestId,
1919
+ phone: String(phone),
1920
+ utm: utms,
1921
+ });
1922
+ const snowplowAspect = {
1923
+ aspectName: 'snowplowEvent',
1924
+ params: {
1925
+ eventAction: 'clickdepapl',
1926
+ eventJSON,
1927
+ },
1928
+ };
1929
+ const aspectsData = withSnowplow ? [...(data ?? []), snowplowAspect] : data;
1930
+ handleAspects({ aspectsAttributes: aspectsData, aspects, ev });
1914
1931
  }
1915
1932
  };
1916
1933
 
@@ -3043,7 +3060,7 @@
3043
3060
  };
3044
3061
  const ApplicationForm = UniBlock(
3045
3062
  // eslint-disable-next-line max-lines-per-function
3046
- ({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, isContacts, data, onSuccess, ...rest }) => {
3063
+ ({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, withSnowplow, isContacts, data, onSuccess, ...rest }) => {
3047
3064
  const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
3048
3065
  const initialFormState = useMemo(() => getInitialFormState$2(inputs, typeForm), [inputs, typeForm]);
3049
3066
  const router = useRouter();
@@ -3064,6 +3081,7 @@
3064
3081
  verifyPhoneDialog,
3065
3082
  onSuccess,
3066
3083
  endpoint,
3084
+ withSnowplow,
3067
3085
  });
3068
3086
  }, [typeForm]);
3069
3087
  const [, { field, onSubmit }] = useForm(initialFormState, {
@@ -13016,7 +13034,7 @@
13016
13034
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
13017
13035
  });
13018
13036
 
13019
- const packageVersion = "0.14.964";
13037
+ const packageVersion = "0.14.965";
13020
13038
 
13021
13039
  exports.Blocks = Blocks;
13022
13040
  exports.ContentPage = ContentPage;