@app-studio/web 0.8.39 → 0.8.41
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/components/Avatar/Avatar/Avatar.props.d.ts +1 -0
- package/dist/components/Avatar/Avatar/Avatar.view.d.ts +1 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Modal/Modal/Modal.layout.d.ts +1 -1
- package/dist/components/Modal/Modal/Modal.store.d.ts +10 -7
- package/dist/components/Table/Table/Table.type.d.ts +10 -10
- package/dist/web.cjs.development.js +56 -51
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +56 -51
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +56 -51
- package/dist/web.umd.development.js.map +1 -1
- package/dist/web.umd.production.min.js +1 -1
- package/dist/web.umd.production.min.js.map +1 -1
- package/package.json +4 -4
package/dist/web.esm.js
CHANGED
|
@@ -1802,7 +1802,8 @@ var AvatarView = _ref => {
|
|
|
1802
1802
|
fallback = 'IM',
|
|
1803
1803
|
styles,
|
|
1804
1804
|
imageError,
|
|
1805
|
-
setImageError
|
|
1805
|
+
setImageError,
|
|
1806
|
+
onClick = () => {}
|
|
1806
1807
|
} = _ref;
|
|
1807
1808
|
// Determines the size of the avatar by mapping the size prop to the predefined AvatarSizeMap.
|
|
1808
1809
|
var avatarSize = AvatarSizeMap[size];
|
|
@@ -1820,7 +1821,8 @@ var AvatarView = _ref => {
|
|
|
1820
1821
|
borderWidth: "1px",
|
|
1821
1822
|
borderStyle: "solid",
|
|
1822
1823
|
borderColor: imageError ? 'black' : 'transparent',
|
|
1823
|
-
boxShadow: "0px 2px 4px rgba(0, 0, 0, 0.25)"
|
|
1824
|
+
boxShadow: "0px 2px 4px rgba(0, 0, 0, 0.25)",
|
|
1825
|
+
onClick: onClick
|
|
1824
1826
|
}, styles == null ? void 0 : styles.container), !imageError ? (/*#__PURE__*/React.createElement(Image, {
|
|
1825
1827
|
alt: "IM",
|
|
1826
1828
|
src: src,
|
|
@@ -1839,7 +1841,8 @@ var AvatarComponent = _ref => {
|
|
|
1839
1841
|
src,
|
|
1840
1842
|
size,
|
|
1841
1843
|
styles,
|
|
1842
|
-
fallback
|
|
1844
|
+
fallback,
|
|
1845
|
+
onClick
|
|
1843
1846
|
} = _ref;
|
|
1844
1847
|
// Uses custom hook useAvatarState to manage the avatar image loading error state.
|
|
1845
1848
|
var {
|
|
@@ -1853,7 +1856,8 @@ var AvatarComponent = _ref => {
|
|
|
1853
1856
|
styles: styles,
|
|
1854
1857
|
fallback: fallback,
|
|
1855
1858
|
imageError: imageError,
|
|
1856
|
-
setImageError: setImageError
|
|
1859
|
+
setImageError: setImageError,
|
|
1860
|
+
onClick: onClick
|
|
1857
1861
|
});
|
|
1858
1862
|
// AvatarComponent is a functional component that wraps the AvatarView with added state logic.
|
|
1859
1863
|
};
|
|
@@ -6618,46 +6622,51 @@ var MessageLayout = _ref => {
|
|
|
6618
6622
|
};
|
|
6619
6623
|
|
|
6620
6624
|
var useModalStore = /*#__PURE__*/create(set => ({
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
isVisible: false
|
|
6624
|
-
},
|
|
6625
|
-
overlayProps: {},
|
|
6626
|
-
show: function show(modal, modalProps, overlayProps) {
|
|
6625
|
+
modals: [],
|
|
6626
|
+
show: function show(name, modalProps, overlayProps) {
|
|
6627
6627
|
if (modalProps === void 0) {
|
|
6628
6628
|
modalProps = {};
|
|
6629
6629
|
}
|
|
6630
6630
|
if (overlayProps === void 0) {
|
|
6631
6631
|
overlayProps = {};
|
|
6632
6632
|
}
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6633
|
+
set(state => ({
|
|
6634
|
+
modals: [...state.modals, {
|
|
6635
|
+
name,
|
|
6636
|
+
props: Object.assign({}, modalProps, {
|
|
6637
|
+
isVisible: true
|
|
6638
|
+
}),
|
|
6639
|
+
overlayProps
|
|
6640
|
+
}]
|
|
6640
6641
|
}));
|
|
6641
6642
|
},
|
|
6642
|
-
hide:
|
|
6643
|
-
set(state =>
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6643
|
+
hide: name => {
|
|
6644
|
+
set(state => {
|
|
6645
|
+
if (!name) {
|
|
6646
|
+
// Hide all modals
|
|
6647
|
+
return {
|
|
6648
|
+
modals: []
|
|
6649
|
+
};
|
|
6650
|
+
}
|
|
6651
|
+
// Hide specific modal by name
|
|
6652
|
+
return {
|
|
6653
|
+
modals: state.modals.filter(modal => modal.name !== name)
|
|
6654
|
+
};
|
|
6655
|
+
});
|
|
6648
6656
|
}
|
|
6649
6657
|
}));
|
|
6650
|
-
var showModal = function showModal(
|
|
6658
|
+
var showModal = function showModal(name, modalProps, overlayProps) {
|
|
6651
6659
|
if (modalProps === void 0) {
|
|
6652
6660
|
modalProps = {};
|
|
6653
6661
|
}
|
|
6654
6662
|
if (overlayProps === void 0) {
|
|
6655
6663
|
overlayProps = {};
|
|
6656
6664
|
}
|
|
6657
|
-
useModalStore.getState().show(
|
|
6665
|
+
useModalStore.getState().show(name, modalProps, overlayProps);
|
|
6658
6666
|
};
|
|
6659
|
-
var hideModal =
|
|
6660
|
-
|
|
6667
|
+
var hideModal = name => {
|
|
6668
|
+
console.log('hideModal', name);
|
|
6669
|
+
useModalStore.getState().hide(typeof name === 'string' ? name : undefined);
|
|
6661
6670
|
};
|
|
6662
6671
|
|
|
6663
6672
|
var ContainerShapes = {
|
|
@@ -6827,33 +6836,29 @@ var ModalFooter = _ref5 => {
|
|
|
6827
6836
|
|
|
6828
6837
|
var ModalLayout = _ref => {
|
|
6829
6838
|
var {
|
|
6830
|
-
modals
|
|
6839
|
+
modals: availableModals
|
|
6831
6840
|
} = _ref;
|
|
6832
|
-
var
|
|
6833
|
-
|
|
6834
|
-
modal,
|
|
6835
|
-
modalProps,
|
|
6836
|
-
overlayProps
|
|
6837
|
-
} = _ref2;
|
|
6838
|
-
return {
|
|
6839
|
-
modal,
|
|
6840
|
-
modalProps,
|
|
6841
|
-
overlayProps
|
|
6842
|
-
};
|
|
6843
|
-
});
|
|
6844
|
-
if (typeof modalStore.modal === 'boolean') {
|
|
6845
|
-
return null;
|
|
6846
|
-
}
|
|
6847
|
-
var Modal = modals[modalStore.modal];
|
|
6848
|
-
if (!Modal) {
|
|
6849
|
-
console.error(modalStore.modal + " modal doesn't exist");
|
|
6841
|
+
var activeModals = useModalStore(state => state.modals);
|
|
6842
|
+
if (activeModals.length === 0) {
|
|
6850
6843
|
return null;
|
|
6851
6844
|
}
|
|
6852
|
-
return /*#__PURE__*/React.createElement(Fragment, null,
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6845
|
+
return /*#__PURE__*/React.createElement(Fragment, null, activeModals.map((modal, index) => {
|
|
6846
|
+
var ModalComponent = availableModals[modal.name];
|
|
6847
|
+
if (!ModalComponent) {
|
|
6848
|
+
console.error(modal.name + " modal doesn't exist");
|
|
6849
|
+
return null;
|
|
6850
|
+
}
|
|
6851
|
+
return /*#__PURE__*/React.createElement(ModalOverlay, Object.assign({
|
|
6852
|
+
key: index,
|
|
6853
|
+
isOpen: modal.props.isVisible,
|
|
6854
|
+
onClose: () => hideModal(modal.name),
|
|
6855
|
+
blur: 5
|
|
6856
|
+
}, modal.overlayProps, {
|
|
6857
|
+
style: {
|
|
6858
|
+
zIndex: 1000 + index
|
|
6859
|
+
}
|
|
6860
|
+
}), /*#__PURE__*/React.createElement(ModalComponent, Object.assign({}, modal.props)));
|
|
6861
|
+
}));
|
|
6857
6862
|
};
|
|
6858
6863
|
|
|
6859
6864
|
/**
|