@redneckz/wildless-cms-uni-blocks 0.14.274 → 0.14.276

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 (41) hide show
  1. package/bin/migration-scripts/0.14.272.js +25 -0
  2. package/bundle/bundle.umd.js +5 -25
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/dist/components/ApplicationFormCustom/ApplicationFormCustom.js +2 -1
  5. package/dist/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
  6. package/dist/components/ApplicationFormCustom/getFormatData.js +1 -0
  7. package/dist/components/ApplicationFormCustom/getFormatData.js.map +1 -1
  8. package/dist/ui-kit/YandexMap/YandexMap.js +2 -24
  9. package/dist/ui-kit/YandexMap/YandexMap.js.map +1 -1
  10. package/lib/common.css +1 -1
  11. package/lib/components/ApplicationFormCustom/ApplicationFormCustom.js +2 -1
  12. package/lib/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
  13. package/lib/components/ApplicationFormCustom/getFormatData.js +1 -0
  14. package/lib/components/ApplicationFormCustom/getFormatData.js.map +1 -1
  15. package/lib/ui-kit/YandexMap/YandexMap.js +3 -25
  16. package/lib/ui-kit/YandexMap/YandexMap.js.map +1 -1
  17. package/mobile/bundle/bundle.umd.js +5 -25
  18. package/mobile/bundle/bundle.umd.min.js +1 -1
  19. package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustom.js +2 -1
  20. package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
  21. package/mobile/dist/components/ApplicationFormCustom/getFormatData.js +1 -0
  22. package/mobile/dist/components/ApplicationFormCustom/getFormatData.js.map +1 -1
  23. package/mobile/dist/ui-kit/YandexMap/YandexMap.js +2 -24
  24. package/mobile/dist/ui-kit/YandexMap/YandexMap.js.map +1 -1
  25. package/mobile/lib/common.css +1 -1
  26. package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustom.js +2 -1
  27. package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
  28. package/mobile/lib/components/ApplicationFormCustom/getFormatData.js +1 -0
  29. package/mobile/lib/components/ApplicationFormCustom/getFormatData.js.map +1 -1
  30. package/mobile/lib/ui-kit/YandexMap/YandexMap.js +3 -25
  31. package/mobile/lib/ui-kit/YandexMap/YandexMap.js.map +1 -1
  32. package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +1 -1
  33. package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.tsx +6 -1
  34. package/mobile/src/components/ApplicationFormCustom/getFormatData.tsx +1 -0
  35. package/mobile/src/ui-kit/YandexMap/YandexMap.tsx +3 -33
  36. package/package.json +1 -1
  37. package/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +1 -1
  38. package/src/components/ApplicationFormCustom/ApplicationFormCustom.fixture.tsx +1 -1
  39. package/src/components/ApplicationFormCustom/ApplicationFormCustom.tsx +6 -1
  40. package/src/components/ApplicationFormCustom/getFormatData.tsx +1 -0
  41. package/src/ui-kit/YandexMap/YandexMap.tsx +3 -33
@@ -0,0 +1,25 @@
1
+ import { deleteProp, traversePageBlocks } from '../utils.js';
2
+
3
+ export const description = 'v0.14.272';
4
+
5
+ export default traversePageBlocks(adjustApplicationFormUltraPremiumBlock);
6
+
7
+ function adjustApplicationFormUltraPremiumBlock(block) {
8
+ const content = block?.content;
9
+ const isUltraOrPremium =
10
+ content?.typeForm === 'ULTRASERVICE' || content?.typeForm === 'PREMIUMSERVICE';
11
+
12
+ if (!content?.sections || !isUltraOrPremium || block.type !== 'ApplicationFormCustom') {
13
+ return;
14
+ }
15
+ block.content.sections.map((section) => deleteRequired(section?.inputs));
16
+ }
17
+
18
+ const deleteRequired = (inputs) =>
19
+ inputs?.map((_) => {
20
+ if (_?.name === 'email') {
21
+ deleteProp(_, 'required');
22
+ }
23
+
24
+ return _;
25
+ });
@@ -1694,6 +1694,7 @@
1694
1694
  ...getVedTypes(vedTypes),
1695
1695
  ...getRegion(region),
1696
1696
  ...(partnerComments ? { partnerComments } : {}),
1697
+ ...(serviceType ? { typeForm: serviceType } : {}),
1697
1698
  ...(feedbackType ? { typeForm: feedbackType } : {}),
1698
1699
  };
1699
1700
  return Object.fromEntries(Object.entries(formatData)?.map(([k, v]) => [k, v?.key || v]));
@@ -1802,7 +1803,7 @@
1802
1803
  reset();
1803
1804
  }
1804
1805
  }, [responseType]);
1805
- return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, responseType: responseType, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [_?.title ? jsx("div", { className: "@xl:text-center @xl:col-span-2", children: _.title }) : null, (_?.inputs || [])?.map(getField(field, typeForm))] }, `section-${i}`))), renderAgreementSubmit(fieldName ? field('consentDataProcessing') : undefined, link, button)] }), isContacts ? renderContacts() : null] }));
1806
+ return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, responseType: responseType, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [_?.title ? (jsx("div", { className: "@xl:text-center @xl:col-span-2 mb-m", children: jsx(Text, { size: "text-h6", children: _.title }) })) : null, (_?.inputs || [])?.map(getField(field, typeForm))] }, `section-${i}`))), renderAgreementSubmit(fieldName ? field('consentDataProcessing') : undefined, link, button)] }), isContacts ? renderContacts() : null] }));
1806
1807
  });
1807
1808
  const inputColumnStyles = (column) => column === 2 ? '@xl:grid-cols-2' : '';
1808
1809
  const getConsentDataProcessing = (inputs) => inputs?.find((_) => _?.name === 'consentDataProcessing');
@@ -4785,16 +4786,6 @@
4785
4786
  return (jsx("div", { onClick: changeZoom, className: `${Object.values(styles).join(' ')} bg-white select-none cursor-pointer w-12 h-12`, children: jsx(Icon, { name: iconName, width: "20", height: "16" }) }));
4786
4787
  });
4787
4788
 
4788
- const FULLSCREEN_STYLES = {
4789
- border: 'border border-transparent rounded-md ',
4790
- position: 'absolute flex items-center justify-center',
4791
- size: 'w-12 h-12',
4792
- focus: 'focus:border-primary-text focus:border',
4793
- font: 'text-center font-sans',
4794
- active: 'active:bg-primary-active',
4795
- hover: 'hover:bg-primary-hover',
4796
- other: 'select-none cursor-pointer',
4797
- };
4798
4789
  const DEFAULT_CENTER_COORDS = [55.753995, 37.614069];
4799
4790
  // TODO: Поле для поиска: невыяснено среди каких данных делать поиск (искать в имени офиса, в адресе, метро и т.д.).
4800
4791
  // Сейчас реализован поиск среди тестовых данных
@@ -4803,7 +4794,6 @@
4803
4794
  const YandexMap = JSX(({ points, className = '', zoom = 5 }) => {
4804
4795
  const map = useRef(null);
4805
4796
  const yandexMaps = useYandexMaps();
4806
- const [isFullScreen, setIsFullScreen] = useState();
4807
4797
  useEffect(() => {
4808
4798
  if (!map?.current) {
4809
4799
  yandexMaps?.ready(() => {
@@ -4830,18 +4820,8 @@
4830
4820
  if (!yandexMaps) {
4831
4821
  return null;
4832
4822
  }
4833
- const toggleFullscreen = () => {
4834
- const container = map.current.container;
4835
- if (!isFullScreen) {
4836
- container.enterFullscreen();
4837
- }
4838
- else {
4839
- container.exitFullscreen();
4840
- }
4841
- setIsFullScreen(container.isFullscreen());
4842
- };
4843
- const zIndex = isFullScreen ? 'z-[100000]' : 'z-10';
4844
- return (jsxs("div", { id: "map", className: style(!isFullScreen && 'relative', 'w-full', className), children: [jsx("div", { className: style(Object.values(FULLSCREEN_STYLES), zIndex, 'right-2 top-4 bg-white'), onClick: toggleFullscreen, children: jsx(Icon, { name: "FullScreenIcon", width: "16", height: "16" }) }), jsxs("div", { className: style('absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md', zIndex), children: [jsx(ZoomButton, { yandexMaps: map }), jsx(ZoomButton, { yandexMaps: map, direction: "out" })] }), renderUserGeolocation(map.current, yandexMaps, style('right-2 top-80', zIndex))] }));
4823
+ const zIndex = 'z-10';
4824
+ return (jsxs("div", { id: "map", className: style('relative', 'w-full', className), children: [jsxs("div", { className: style('absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md', zIndex), children: [jsx(ZoomButton, { yandexMaps: map }), jsx(ZoomButton, { yandexMaps: map, direction: "out" })] }), renderUserGeolocation(map.current, yandexMaps, style('right-2 top-80', zIndex))] }));
4845
4825
  });
4846
4826
  const getCenterPoint = (points) => [
4847
4827
  getArraySumAndAverage(mapByIndex(points, 0)),
@@ -6126,7 +6106,7 @@
6126
6106
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
6127
6107
  });
6128
6108
 
6129
- const packageVersion = "0.14.273";
6109
+ const packageVersion = "0.14.275";
6130
6110
 
6131
6111
  exports.Blocks = Blocks;
6132
6112
  exports.ContentPage = ContentPage;