@wallavi/widget 1.3.2 → 1.3.3
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/index.js +12 -0
- package/dist/index.mjs +12 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -757,6 +757,18 @@ function BubbleWidget({
|
|
|
757
757
|
const [resolvedAutoOpen, setResolvedAutoOpen] = react.useState(autoOpenProp);
|
|
758
758
|
const [resolvedKeyboardShortcut, setResolvedKeyboardShortcut] = react.useState(keyboardShortcutProp);
|
|
759
759
|
const [resolvedPosition, setResolvedPosition] = react.useState(positionProp ?? "bottom-right");
|
|
760
|
+
react.useEffect(() => {
|
|
761
|
+
if (autoOpenProp) setResolvedAutoOpen(true);
|
|
762
|
+
}, [autoOpenProp]);
|
|
763
|
+
react.useEffect(() => {
|
|
764
|
+
if (keyboardShortcutProp) setResolvedKeyboardShortcut(true);
|
|
765
|
+
}, [keyboardShortcutProp]);
|
|
766
|
+
react.useEffect(() => {
|
|
767
|
+
if (bubbleIconUrlProp) setResolvedBubbleIcon(bubbleIconUrlProp);
|
|
768
|
+
}, [bubbleIconUrlProp]);
|
|
769
|
+
react.useEffect(() => {
|
|
770
|
+
if (positionProp) setResolvedPosition(positionProp);
|
|
771
|
+
}, [positionProp]);
|
|
760
772
|
react.useEffect(() => {
|
|
761
773
|
if (!autoConfig) return;
|
|
762
774
|
fetch(`${WALLAVI_API}/api/public/widget/${chatProps.agentId}`).then((r) => r.json()).then((body) => {
|
package/dist/index.mjs
CHANGED
|
@@ -731,6 +731,18 @@ function BubbleWidget({
|
|
|
731
731
|
const [resolvedAutoOpen, setResolvedAutoOpen] = useState(autoOpenProp);
|
|
732
732
|
const [resolvedKeyboardShortcut, setResolvedKeyboardShortcut] = useState(keyboardShortcutProp);
|
|
733
733
|
const [resolvedPosition, setResolvedPosition] = useState(positionProp ?? "bottom-right");
|
|
734
|
+
useEffect(() => {
|
|
735
|
+
if (autoOpenProp) setResolvedAutoOpen(true);
|
|
736
|
+
}, [autoOpenProp]);
|
|
737
|
+
useEffect(() => {
|
|
738
|
+
if (keyboardShortcutProp) setResolvedKeyboardShortcut(true);
|
|
739
|
+
}, [keyboardShortcutProp]);
|
|
740
|
+
useEffect(() => {
|
|
741
|
+
if (bubbleIconUrlProp) setResolvedBubbleIcon(bubbleIconUrlProp);
|
|
742
|
+
}, [bubbleIconUrlProp]);
|
|
743
|
+
useEffect(() => {
|
|
744
|
+
if (positionProp) setResolvedPosition(positionProp);
|
|
745
|
+
}, [positionProp]);
|
|
734
746
|
useEffect(() => {
|
|
735
747
|
if (!autoConfig) return;
|
|
736
748
|
fetch(`${WALLAVI_API}/api/public/widget/${chatProps.agentId}`).then((r) => r.json()).then((body) => {
|