@redneckz/wildless-cms-uni-blocks 0.14.846 → 0.14.850
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/bundle/bundle.umd.js +22 -74
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Header/HeaderChatBotButton.d.ts +0 -1
- package/bundle/hooks/useAspects/aspects/forwardQuery.d.ts +1 -1
- package/bundle/hooks/useAspects/handleAspects.d.ts +1 -1
- package/bundle/hooks/useAspects/useAspects.d.ts +1 -1
- package/dist/components/Header/HeaderChatBotButton.d.ts +0 -1
- package/dist/components/Header/HeaderChatBotButton.js +15 -4
- package/dist/components/Header/HeaderChatBotButton.js.map +1 -1
- package/dist/components/Header/HeaderSubMenu.js +1 -1
- package/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/dist/components/Header/HeaderTop.js +1 -1
- package/dist/components/Header/HeaderTop.js.map +1 -1
- package/dist/hooks/useAspects/aspects/forwardQuery.d.ts +1 -1
- package/dist/hooks/useAspects/aspects/forwardQuery.js +1 -1
- package/dist/hooks/useAspects/aspects/forwardQuery.js.map +1 -1
- package/dist/hooks/useAspects/handleAspects.d.ts +1 -1
- package/dist/hooks/useAspects/handleAspects.js +5 -2
- package/dist/hooks/useAspects/handleAspects.js.map +1 -1
- package/dist/hooks/useAspects/useAspects.d.ts +1 -1
- package/dist/retail/utils/renderStep.js +3 -1
- package/dist/retail/utils/renderStep.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/Header/HeaderChatBotButton.d.ts +0 -1
- package/lib/components/Header/HeaderChatBotButton.js +15 -4
- package/lib/components/Header/HeaderChatBotButton.js.map +1 -1
- package/lib/components/Header/HeaderSubMenu.js +1 -1
- package/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/lib/components/Header/HeaderTop.js +1 -1
- package/lib/components/Header/HeaderTop.js.map +1 -1
- package/lib/hooks/useAspects/aspects/forwardQuery.d.ts +1 -1
- package/lib/hooks/useAspects/aspects/forwardQuery.js +1 -1
- package/lib/hooks/useAspects/aspects/forwardQuery.js.map +1 -1
- package/lib/hooks/useAspects/handleAspects.d.ts +1 -1
- package/lib/hooks/useAspects/handleAspects.js +5 -2
- package/lib/hooks/useAspects/handleAspects.js.map +1 -1
- package/lib/hooks/useAspects/useAspects.d.ts +1 -1
- package/lib/retail/utils/renderStep.js +3 -1
- package/lib/retail/utils/renderStep.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +22 -74
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Header/HeaderChatBotButton.d.ts +0 -1
- package/mobile/bundle/hooks/useAspects/aspects/forwardQuery.d.ts +1 -1
- package/mobile/bundle/hooks/useAspects/handleAspects.d.ts +1 -1
- package/mobile/bundle/hooks/useAspects/useAspects.d.ts +1 -1
- package/mobile/dist/components/Header/HeaderChatBotButton.d.ts +0 -1
- package/mobile/dist/components/Header/HeaderChatBotButton.js +15 -4
- package/mobile/dist/components/Header/HeaderChatBotButton.js.map +1 -1
- package/mobile/dist/components/Header/HeaderSubMenu.js +1 -1
- package/mobile/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/mobile/dist/components/Header/HeaderTop.js +1 -1
- package/mobile/dist/components/Header/HeaderTop.js.map +1 -1
- package/mobile/dist/hooks/useAspects/aspects/forwardQuery.d.ts +1 -1
- package/mobile/dist/hooks/useAspects/aspects/forwardQuery.js +1 -1
- package/mobile/dist/hooks/useAspects/aspects/forwardQuery.js.map +1 -1
- package/mobile/dist/hooks/useAspects/handleAspects.d.ts +1 -1
- package/mobile/dist/hooks/useAspects/handleAspects.js +5 -2
- package/mobile/dist/hooks/useAspects/handleAspects.js.map +1 -1
- package/mobile/dist/hooks/useAspects/useAspects.d.ts +1 -1
- package/mobile/dist/retail/utils/renderStep.js +3 -1
- package/mobile/dist/retail/utils/renderStep.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/Header/HeaderChatBotButton.d.ts +0 -1
- package/mobile/lib/components/Header/HeaderChatBotButton.js +15 -4
- package/mobile/lib/components/Header/HeaderChatBotButton.js.map +1 -1
- package/mobile/lib/components/Header/HeaderSubMenu.js +1 -1
- package/mobile/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/mobile/lib/components/Header/HeaderTop.js +1 -1
- package/mobile/lib/components/Header/HeaderTop.js.map +1 -1
- package/mobile/lib/hooks/useAspects/aspects/forwardQuery.d.ts +1 -1
- package/mobile/lib/hooks/useAspects/aspects/forwardQuery.js +1 -1
- package/mobile/lib/hooks/useAspects/aspects/forwardQuery.js.map +1 -1
- package/mobile/lib/hooks/useAspects/handleAspects.d.ts +1 -1
- package/mobile/lib/hooks/useAspects/handleAspects.js +5 -2
- package/mobile/lib/hooks/useAspects/handleAspects.js.map +1 -1
- package/mobile/lib/hooks/useAspects/useAspects.d.ts +1 -1
- package/mobile/lib/retail/utils/renderStep.js +3 -1
- package/mobile/lib/retail/utils/renderStep.js.map +1 -1
- package/mobile/src/components/Header/HeaderChatBotButton.tsx +18 -12
- package/mobile/src/components/Header/HeaderSubMenu.tsx +0 -1
- package/mobile/src/components/Header/HeaderTop.tsx +1 -6
- package/mobile/src/hooks/useAspects/aspects/forwardQuery.ts +1 -1
- package/mobile/src/hooks/useAspects/handleAspects.ts +6 -2
- package/mobile/src/hooks/useAspects/useAspects.ts +1 -1
- package/mobile/src/retail/utils/renderStep.tsx +3 -1
- package/package.json +1 -1
- package/src/components/Header/HeaderChatBotButton.tsx +18 -12
- package/src/components/Header/HeaderSubMenu.tsx +0 -1
- package/src/components/Header/HeaderTop.tsx +1 -6
- package/src/hooks/useAspects/aspects/forwardQuery.ts +1 -1
- package/src/hooks/useAspects/handleAspects.ts +6 -2
- package/src/hooks/useAspects/useAspects.ts +1 -1
- package/src/retail/utils/renderStep.tsx +3 -1
- package/bundle/components/Header/useChatBot.d.ts +0 -5
- package/dist/components/Header/useChatBot.d.ts +0 -5
- package/dist/components/Header/useChatBot.js +0 -61
- package/dist/components/Header/useChatBot.js.map +0 -1
- package/lib/components/Header/useChatBot.d.ts +0 -5
- package/lib/components/Header/useChatBot.js +0 -58
- package/lib/components/Header/useChatBot.js.map +0 -1
- package/mobile/bundle/components/Header/useChatBot.d.ts +0 -5
- package/mobile/dist/components/Header/useChatBot.d.ts +0 -5
- package/mobile/dist/components/Header/useChatBot.js +0 -61
- package/mobile/dist/components/Header/useChatBot.js.map +0 -1
- package/mobile/lib/components/Header/useChatBot.d.ts +0 -5
- package/mobile/lib/components/Header/useChatBot.js +0 -58
- package/mobile/lib/components/Header/useChatBot.js.map +0 -1
- package/mobile/src/components/Header/useChatBot.ts +0 -86
- package/src/components/Header/useChatBot.ts +0 -86
package/bundle/bundle.umd.js
CHANGED
|
@@ -1057,9 +1057,12 @@
|
|
|
1057
1057
|
: { secondaryPhoneNumber: formatPhone(secondaryPhone) };
|
|
1058
1058
|
};
|
|
1059
1059
|
|
|
1060
|
-
const handleAspects = ({ aspectsAttributes, aspects, ev }) => {
|
|
1060
|
+
const handleAspects = async ({ aspectsAttributes, aspects, ev }) => {
|
|
1061
1061
|
for (const { aspectName, params } of aspectsAttributes ?? []) {
|
|
1062
|
-
aspects[aspectName ?? '']
|
|
1062
|
+
const aspectFn = aspects[aspectName ?? ''];
|
|
1063
|
+
if (aspectFn) {
|
|
1064
|
+
await aspectFn(ev, params);
|
|
1065
|
+
}
|
|
1063
1066
|
}
|
|
1064
1067
|
};
|
|
1065
1068
|
|
|
@@ -1102,7 +1105,7 @@
|
|
|
1102
1105
|
return url.toString();
|
|
1103
1106
|
};
|
|
1104
1107
|
|
|
1105
|
-
const forwardQuery = (ev) => {
|
|
1108
|
+
const forwardQuery = async (ev) => {
|
|
1106
1109
|
const anchor = ev.target?.closest('a');
|
|
1107
1110
|
const navigator = locationNavigator();
|
|
1108
1111
|
if (isURL(anchor?.href) && !anchor?.href?.startsWith(navigator.origin)) {
|
|
@@ -3510,16 +3513,6 @@
|
|
|
3510
3513
|
});
|
|
3511
3514
|
}
|
|
3512
3515
|
};
|
|
3513
|
-
const initializeExternalStylesheet = (url = '') => {
|
|
3514
|
-
const link = globalThis.document.getElementById(url);
|
|
3515
|
-
if (!link) {
|
|
3516
|
-
const newLink = globalThis.document.createElement('link');
|
|
3517
|
-
newLink.href = url;
|
|
3518
|
-
newLink.id = url;
|
|
3519
|
-
newLink.rel = 'stylesheet';
|
|
3520
|
-
globalThis.document.head.appendChild(newLink);
|
|
3521
|
-
}
|
|
3522
|
-
};
|
|
3523
3516
|
function useExternalNS(namespaceName, url, unmountNS = true) {
|
|
3524
3517
|
const [externalNS, setExternalNS] = useState(undefined);
|
|
3525
3518
|
useEffect(() => {
|
|
@@ -7807,7 +7800,9 @@
|
|
|
7807
7800
|
const cleanElements = [
|
|
7808
7801
|
!checkCondition({ condition }, getValue(field)) ? renderTitle(title) : null,
|
|
7809
7802
|
...renderInputs({ field, inputs, params }),
|
|
7810
|
-
]
|
|
7803
|
+
]
|
|
7804
|
+
.filter(Boolean)
|
|
7805
|
+
.map((_, j) => ({ ..._, key: _.key ?? `elem-${j}` }));
|
|
7811
7806
|
return cleanElements.length ? (jsx("div", { className: style(inputColumnStyles(columns), 'grid gap-x-m'), children: cleanElements }, `section-${i}`)) : null;
|
|
7812
7807
|
});
|
|
7813
7808
|
const getValue = (field) => (name) => field(name)?.value;
|
|
@@ -9860,65 +9855,18 @@
|
|
|
9860
9855
|
});
|
|
9861
9856
|
const getDataTestIdAttribute = (dataTestId) => dataTestId ? { 'data-test-id': dataTestId } : null;
|
|
9862
9857
|
|
|
9863
|
-
const
|
|
9864
|
-
const
|
|
9865
|
-
|
|
9866
|
-
|
|
9867
|
-
|
|
9868
|
-
|
|
9869
|
-
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
};
|
|
9873
|
-
const useChatBot = (chat) => {
|
|
9874
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
9875
|
-
useEffect(() => globalThis.localStorage?.setItem(CHAT_STORAGE_NAME, String(Date.now())), []);
|
|
9876
|
-
const chatUrl = CHATBOT_URL[chat ?? ''];
|
|
9877
|
-
const load = useCallback((ev) => {
|
|
9878
|
-
if (!chatUrl) {
|
|
9879
|
-
return;
|
|
9880
|
-
}
|
|
9881
|
-
setIsLoading(true);
|
|
9882
|
-
if (chat === 'business') {
|
|
9883
|
-
renderBusinessChatBot(chatUrl).finally(() => setIsLoading(false));
|
|
9884
|
-
}
|
|
9885
|
-
else {
|
|
9886
|
-
renderPersonalChatBot(ev, chatUrl).finally(() => setIsLoading(false));
|
|
9858
|
+
const CHAT_BOT_ASPECT_NAME = 'openChatBot';
|
|
9859
|
+
const HeaderChatBotButton = JSX(({ iconVersion, className, ariaLabel = 'Чат', version, buttonSize = 'large' }) => {
|
|
9860
|
+
const [isLoading, { setTrue: startLoad, setFalse: endLoad }] = useBool(false);
|
|
9861
|
+
const aspects = useAspects();
|
|
9862
|
+
const handleClick = useCallback((ev) => {
|
|
9863
|
+
const openChatBot = aspects[CHAT_BOT_ASPECT_NAME];
|
|
9864
|
+
if (openChatBot) {
|
|
9865
|
+
startLoad();
|
|
9866
|
+
openChatBot(ev).finally(endLoad);
|
|
9887
9867
|
}
|
|
9888
|
-
}, [
|
|
9889
|
-
return {
|
|
9890
|
-
};
|
|
9891
|
-
const renderPersonalChatBot = async (ev, chatUrl) => {
|
|
9892
|
-
const target = ev.target;
|
|
9893
|
-
if (!target?.classList.contains(CHAT_BUTTON_EXTERNAL_NAME)) {
|
|
9894
|
-
target?.classList.add(CHAT_BUTTON_EXTERNAL_NAME);
|
|
9895
|
-
}
|
|
9896
|
-
const chatFrame = globalThis.document.getElementById(CHAT_FRAME_ID);
|
|
9897
|
-
if (!chatFrame) {
|
|
9898
|
-
await initializeExternalNS(CHAT_NAMESPACE, chatUrl);
|
|
9899
|
-
}
|
|
9900
|
-
};
|
|
9901
|
-
const renderBusinessChatBot = async (chatUrl) => {
|
|
9902
|
-
const businessChat = (await initializeExternalNS(CHAT_NAMESPACE, `${chatUrl}/bundle.js`, true));
|
|
9903
|
-
initializeExternalStylesheet(`${chatUrl}/bundle.css`);
|
|
9904
|
-
const chatFrame = globalThis.document.getElementById(CHAT_FRAME_ID);
|
|
9905
|
-
if (chatFrame) {
|
|
9906
|
-
businessChat?.chatOpen?.();
|
|
9907
|
-
}
|
|
9908
|
-
else {
|
|
9909
|
-
createChatFrame();
|
|
9910
|
-
businessChat?.render?.(CHAT_FRAME_ID, true, BUSINESS_CHAT_PREFIX, BUSINESS_CHAT_CLASSNAME);
|
|
9911
|
-
}
|
|
9912
|
-
};
|
|
9913
|
-
const createChatFrame = () => {
|
|
9914
|
-
const chatFrame = globalThis.document.createElement('div');
|
|
9915
|
-
chatFrame.id = CHAT_FRAME_ID;
|
|
9916
|
-
globalThis.document.body.appendChild(chatFrame);
|
|
9917
|
-
};
|
|
9918
|
-
|
|
9919
|
-
const HeaderChatBotButton = JSX(({ chat = 'personal', iconVersion, className, ariaLabel = 'Чат', version, buttonSize = 'large', }) => {
|
|
9920
|
-
const { load, isLoading } = useChatBot(chat);
|
|
9921
|
-
return (jsx(HeaderSecondaryMenuButton, { className: className, image: { icon: 'ChatBotIcon', iconVersion }, ariaLabel: ariaLabel, onClick: load, buttonSize: buttonSize, isGrayBg: true, version: version, isLoading: isLoading, dataTestId: "chat icon" }));
|
|
9868
|
+
}, []);
|
|
9869
|
+
return (jsx(HeaderSecondaryMenuButton, { className: className, image: { icon: 'ChatBotIcon', iconVersion }, ariaLabel: ariaLabel, onClick: handleClick, buttonSize: buttonSize, isGrayBg: true, version: version, isLoading: isLoading, disabled: isLoading, dataTestId: "chat icon" }));
|
|
9922
9870
|
});
|
|
9923
9871
|
|
|
9924
9872
|
const HeaderItem = JSX(({ className = '', active, dataItemName, children, data, ...rest }) => {
|
|
@@ -9963,7 +9911,7 @@
|
|
|
9963
9911
|
? handleIntersectionActivation$1(index)
|
|
9964
9912
|
: handleIntersectionDeactivation$1(index));
|
|
9965
9913
|
}), [subItems]);
|
|
9966
|
-
return (jsxs("nav", { className: "mt-s flex gap-s items-center justify-between", children: [jsx("div", { ref: subItemsListRef, className: "overflow-hidden whitespace-nowrap pb-s mt-xs space-x-lg", role: "menu", children: subItems.map((_, i) => (jsx(HeaderSubMenuItem, { className: visibleItemsCount - 1 < i ? 'invisible' : '', active: _ === activeSubItem, observerOptions: observerOptions, onVisibilityChange: subItemsVisibilityHandlers[i], data: _.dataHeader, ..._ }, String(i)))) }), dropDownMenuItems.length ? (jsx(DropdownMenu, { items: dropDownMenuItems, activeItem: activeSubItem, ariaLabel: dropdownMenuAriaLabel })) : null, projectSettings.CHAT_BOT ? (jsx(HeaderChatBotButton, { version: version, iconVersion: iconVersion,
|
|
9914
|
+
return (jsxs("nav", { className: "mt-s flex gap-s items-center justify-between", children: [jsx("div", { ref: subItemsListRef, className: "overflow-hidden whitespace-nowrap pb-s mt-xs space-x-lg", role: "menu", children: subItems.map((_, i) => (jsx(HeaderSubMenuItem, { className: visibleItemsCount - 1 < i ? 'invisible' : '', active: _ === activeSubItem, observerOptions: observerOptions, onVisibilityChange: subItemsVisibilityHandlers[i], data: _.dataHeader, ..._ }, String(i)))) }), dropDownMenuItems.length ? (jsx(DropdownMenu, { items: dropDownMenuItems, activeItem: activeSubItem, ariaLabel: dropdownMenuAriaLabel })) : null, projectSettings.CHAT_BOT ? (jsx(HeaderChatBotButton, { version: version, iconVersion: iconVersion, ariaLabel: chatBotAriaLabel })) : null, jsx(InternetBankButton, { version: version, ...internetBankButton })] }));
|
|
9967
9915
|
});
|
|
9968
9916
|
const handleIntersectionActivation$1 = (index) => (prev) => Math.max(prev, index + 1);
|
|
9969
9917
|
const handleIntersectionDeactivation$1 = (index) => (prev) => Math.min(prev, index);
|
|
@@ -11037,7 +10985,7 @@
|
|
|
11037
10985
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
11038
10986
|
});
|
|
11039
10987
|
|
|
11040
|
-
const packageVersion = "0.14.
|
|
10988
|
+
const packageVersion = "0.14.849";
|
|
11041
10989
|
|
|
11042
10990
|
exports.Blocks = Blocks;
|
|
11043
10991
|
exports.ContentPage = ContentPage;
|