@tonconnect/ui 2.0.1-beta.5 → 2.0.1-beta.6
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/tonconnect-ui.min.js +204 -204
- package/dist/tonconnect-ui.min.js.map +1 -1
- package/lib/index.cjs +116 -92
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.mjs +116 -92
- package/lib/index.mjs.map +1 -1
- package/package.json +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -331,7 +331,8 @@ declare class TonConnectUI {
|
|
|
331
331
|
*/
|
|
332
332
|
private readonly transactionModal;
|
|
333
333
|
/**
|
|
334
|
-
* Promise that resolves after end of th connection restoring process (promise will fire after `onStatusChange`,
|
|
334
|
+
* Promise that resolves after end of th connection restoring process (promise will fire after `onStatusChange`,
|
|
335
|
+
* so you can get actual information about wallet and session after when promise resolved).
|
|
335
336
|
* Resolved value `true`/`false` indicates if the session was restored successfully.
|
|
336
337
|
*/
|
|
337
338
|
readonly connectionRestored: Promise<boolean>;
|
package/lib/index.mjs
CHANGED
|
@@ -6848,7 +6848,7 @@ const Notification = (props) => {
|
|
|
6848
6848
|
}
|
|
6849
6849
|
}));
|
|
6850
6850
|
};
|
|
6851
|
-
const LoaderIconStyled$
|
|
6851
|
+
const LoaderIconStyled$2 = styled(LoaderIcon)`
|
|
6852
6852
|
align-self: center;
|
|
6853
6853
|
`;
|
|
6854
6854
|
const ConfirmOperationNotification = (props) => {
|
|
@@ -6868,7 +6868,7 @@ const ConfirmOperationNotification = (props) => {
|
|
|
6868
6868
|
return props.class;
|
|
6869
6869
|
},
|
|
6870
6870
|
get icon() {
|
|
6871
|
-
return createComponent(LoaderIconStyled$
|
|
6871
|
+
return createComponent(LoaderIconStyled$2, {});
|
|
6872
6872
|
},
|
|
6873
6873
|
"data-tc-notification-confirm": "true",
|
|
6874
6874
|
children: "Confirm operation in your wallet"
|
|
@@ -7048,7 +7048,7 @@ const DropdownButtonStyled = styled(AccountButtonStyled)`
|
|
|
7048
7048
|
justify-content: center;
|
|
7049
7049
|
background-color: ${(props) => props.theme.colors.background.primary};
|
|
7050
7050
|
`;
|
|
7051
|
-
styled(Button)`
|
|
7051
|
+
const LoaderButtonStyled$1 = styled(Button)`
|
|
7052
7052
|
min-width: 148px;
|
|
7053
7053
|
height: 40px;
|
|
7054
7054
|
|
|
@@ -7060,7 +7060,7 @@ styled(Button)`
|
|
|
7060
7060
|
align-items: center;
|
|
7061
7061
|
justify-content: center;
|
|
7062
7062
|
`;
|
|
7063
|
-
styled(LoaderIcon)`
|
|
7063
|
+
const LoaderIconStyled$1 = styled(LoaderIcon)`
|
|
7064
7064
|
height: 18px;
|
|
7065
7065
|
width: 18px;
|
|
7066
7066
|
`;
|
|
@@ -7831,6 +7831,7 @@ const AccountButton = () => {
|
|
|
7831
7831
|
const tonConnectUI = useContext(TonConnectUiContext);
|
|
7832
7832
|
const [isOpened, setIsOpened] = createSignal(false);
|
|
7833
7833
|
const [account, setAccount] = createSignal(connector.account);
|
|
7834
|
+
const [restoringProcess, setRestoringProcess] = createSignal(true);
|
|
7834
7835
|
let dropDownRef;
|
|
7835
7836
|
const [floating, setFloating] = createSignal();
|
|
7836
7837
|
const [anchor, setAnchor] = createSignal();
|
|
@@ -7846,13 +7847,16 @@ const AccountButton = () => {
|
|
|
7846
7847
|
}
|
|
7847
7848
|
return "";
|
|
7848
7849
|
};
|
|
7850
|
+
tonConnectUI.connectionRestored.then(() => setRestoringProcess(false));
|
|
7849
7851
|
const unsubscribe = connector.onStatusChange((wallet) => {
|
|
7850
7852
|
if (!wallet) {
|
|
7851
7853
|
setIsOpened(false);
|
|
7852
7854
|
setAccount(null);
|
|
7855
|
+
setRestoringProcess(false);
|
|
7853
7856
|
return;
|
|
7854
7857
|
}
|
|
7855
7858
|
setAccount(wallet.account);
|
|
7859
|
+
setRestoringProcess(false);
|
|
7856
7860
|
});
|
|
7857
7861
|
const onClick = (e2) => {
|
|
7858
7862
|
if (!account() || !isOpened()) {
|
|
@@ -7876,123 +7880,143 @@ const AccountButton = () => {
|
|
|
7876
7880
|
get children() {
|
|
7877
7881
|
return [createComponent(Show, {
|
|
7878
7882
|
get when() {
|
|
7879
|
-
return
|
|
7883
|
+
return restoringProcess();
|
|
7880
7884
|
},
|
|
7881
7885
|
get children() {
|
|
7882
|
-
return createComponent(
|
|
7883
|
-
|
|
7884
|
-
"data-tc-connect-button": "true",
|
|
7885
|
-
scale: "s",
|
|
7886
|
+
return createComponent(LoaderButtonStyled$1, {
|
|
7887
|
+
disabled: true,
|
|
7888
|
+
"data-tc-connect-button-loading": "true",
|
|
7886
7889
|
get children() {
|
|
7887
|
-
return
|
|
7888
|
-
get fill() {
|
|
7889
|
-
return theme.colors.connectButton.foreground;
|
|
7890
|
-
}
|
|
7891
|
-
}), createComponent(Text, {
|
|
7892
|
-
translationKey: "button.connectWallet",
|
|
7893
|
-
fontSize: "15px",
|
|
7894
|
-
lineHeight: "18px",
|
|
7895
|
-
fontWeight: "590",
|
|
7896
|
-
get color() {
|
|
7897
|
-
return theme.colors.connectButton.foreground;
|
|
7898
|
-
},
|
|
7899
|
-
children: "Connect wallet"
|
|
7900
|
-
})];
|
|
7890
|
+
return createComponent(LoaderIconStyled$1, {});
|
|
7901
7891
|
}
|
|
7902
7892
|
});
|
|
7903
7893
|
}
|
|
7904
7894
|
}), createComponent(Show, {
|
|
7905
7895
|
get when() {
|
|
7906
|
-
return
|
|
7896
|
+
return !restoringProcess();
|
|
7907
7897
|
},
|
|
7908
7898
|
get children() {
|
|
7909
|
-
return createComponent(
|
|
7899
|
+
return [createComponent(Show, {
|
|
7900
|
+
get when() {
|
|
7901
|
+
return !account();
|
|
7902
|
+
},
|
|
7910
7903
|
get children() {
|
|
7911
|
-
return
|
|
7912
|
-
onClick: () =>
|
|
7913
|
-
|
|
7914
|
-
"data-tc-dropdown-button": "true",
|
|
7904
|
+
return createComponent(AccountButtonStyled, {
|
|
7905
|
+
onClick: () => tonConnectUI.openModal(),
|
|
7906
|
+
"data-tc-connect-button": "true",
|
|
7915
7907
|
scale: "s",
|
|
7916
7908
|
get children() {
|
|
7917
|
-
return [createComponent(
|
|
7909
|
+
return [createComponent(TonIcon, {
|
|
7910
|
+
get fill() {
|
|
7911
|
+
return theme.colors.connectButton.foreground;
|
|
7912
|
+
}
|
|
7913
|
+
}), createComponent(Text, {
|
|
7914
|
+
translationKey: "button.connectWallet",
|
|
7918
7915
|
fontSize: "15px",
|
|
7919
|
-
fontWeight: "590",
|
|
7920
7916
|
lineHeight: "18px",
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7917
|
+
fontWeight: "590",
|
|
7918
|
+
get color() {
|
|
7919
|
+
return theme.colors.connectButton.foreground;
|
|
7920
|
+
},
|
|
7921
|
+
children: "Connect wallet"
|
|
7926
7922
|
})];
|
|
7927
7923
|
}
|
|
7928
|
-
})
|
|
7924
|
+
});
|
|
7925
|
+
}
|
|
7926
|
+
}), createComponent(Show, {
|
|
7927
|
+
get when() {
|
|
7928
|
+
return account();
|
|
7929
|
+
},
|
|
7930
|
+
get children() {
|
|
7931
|
+
return createComponent(DropdownContainerStyled, {
|
|
7929
7932
|
get children() {
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
onBeforeEnter: (el) => {
|
|
7936
|
-
animate(el, [{
|
|
7937
|
-
opacity: 0,
|
|
7938
|
-
transform: "translateY(-8px)"
|
|
7939
|
-
}, {
|
|
7940
|
-
opacity: 1,
|
|
7941
|
-
transform: "translateY(0)"
|
|
7942
|
-
}], {
|
|
7943
|
-
duration: 150
|
|
7944
|
-
});
|
|
7945
|
-
},
|
|
7946
|
-
onExit: (el, done) => {
|
|
7947
|
-
const a2 = animate(el, [{
|
|
7948
|
-
opacity: 1,
|
|
7949
|
-
transform: "translateY(0)"
|
|
7950
|
-
}, {
|
|
7951
|
-
opacity: 0,
|
|
7952
|
-
transform: "translateY(-8px)"
|
|
7953
|
-
}], {
|
|
7954
|
-
duration: 150
|
|
7955
|
-
});
|
|
7956
|
-
a2.finished.then(done);
|
|
7957
|
-
},
|
|
7933
|
+
return [createComponent(DropdownButtonStyled, {
|
|
7934
|
+
onClick: () => setIsOpened((v) => !v),
|
|
7935
|
+
ref: setAnchor,
|
|
7936
|
+
"data-tc-dropdown-button": "true",
|
|
7937
|
+
scale: "s",
|
|
7958
7938
|
get children() {
|
|
7959
|
-
return createComponent(
|
|
7960
|
-
|
|
7961
|
-
|
|
7939
|
+
return [createComponent(Text, {
|
|
7940
|
+
fontSize: "15px",
|
|
7941
|
+
fontWeight: "590",
|
|
7942
|
+
lineHeight: "18px",
|
|
7943
|
+
get children() {
|
|
7944
|
+
return normalizedAddress();
|
|
7945
|
+
}
|
|
7946
|
+
}), createComponent(ArrowIcon, {
|
|
7947
|
+
direction: "bottom"
|
|
7948
|
+
})];
|
|
7949
|
+
}
|
|
7950
|
+
}), createComponent(Portal, {
|
|
7951
|
+
get children() {
|
|
7952
|
+
const _el$ = untrack(() => document.importNode(_tmpl$$3, true));
|
|
7953
|
+
use(setFloating, _el$);
|
|
7954
|
+
_el$.style.setProperty("z-index", "999");
|
|
7955
|
+
_el$._$owner = getOwner();
|
|
7956
|
+
insert(_el$, createComponent(Transition, {
|
|
7957
|
+
onBeforeEnter: (el) => {
|
|
7958
|
+
animate(el, [{
|
|
7959
|
+
opacity: 0,
|
|
7960
|
+
transform: "translateY(-8px)"
|
|
7961
|
+
}, {
|
|
7962
|
+
opacity: 1,
|
|
7963
|
+
transform: "translateY(0)"
|
|
7964
|
+
}], {
|
|
7965
|
+
duration: 150
|
|
7966
|
+
});
|
|
7967
|
+
},
|
|
7968
|
+
onExit: (el, done) => {
|
|
7969
|
+
const a2 = animate(el, [{
|
|
7970
|
+
opacity: 1,
|
|
7971
|
+
transform: "translateY(0)"
|
|
7972
|
+
}, {
|
|
7973
|
+
opacity: 0,
|
|
7974
|
+
transform: "translateY(-8px)"
|
|
7975
|
+
}], {
|
|
7976
|
+
duration: 150
|
|
7977
|
+
});
|
|
7978
|
+
a2.finished.then(done);
|
|
7962
7979
|
},
|
|
7963
7980
|
get children() {
|
|
7964
|
-
return createComponent(
|
|
7965
|
-
get
|
|
7966
|
-
return
|
|
7981
|
+
return createComponent(Show, {
|
|
7982
|
+
get when() {
|
|
7983
|
+
return isOpened();
|
|
7967
7984
|
},
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7985
|
+
get children() {
|
|
7986
|
+
return createComponent(DropdownStyled, {
|
|
7987
|
+
get hidden() {
|
|
7988
|
+
return !isOpened();
|
|
7989
|
+
},
|
|
7990
|
+
onClose: () => setIsOpened(false),
|
|
7991
|
+
ref(r$) {
|
|
7992
|
+
const _ref$ = dropDownRef;
|
|
7993
|
+
typeof _ref$ === "function" ? _ref$(r$) : dropDownRef = r$;
|
|
7994
|
+
}
|
|
7995
|
+
});
|
|
7972
7996
|
}
|
|
7973
7997
|
});
|
|
7974
7998
|
}
|
|
7999
|
+
}), null);
|
|
8000
|
+
insert(_el$, createComponent(NotificationsStyled, {}), null);
|
|
8001
|
+
createRenderEffect((_p$) => {
|
|
8002
|
+
var _a2, _b2;
|
|
8003
|
+
const _v$ = position.strategy, _v$2 = `${(_a2 = position.y) != null ? _a2 : 0}px`, _v$3 = `${(_b2 = position.x) != null ? _b2 : 0}px`;
|
|
8004
|
+
_v$ !== _p$._v$ && _el$.style.setProperty("position", _p$._v$ = _v$);
|
|
8005
|
+
_v$2 !== _p$._v$2 && _el$.style.setProperty("top", _p$._v$2 = _v$2);
|
|
8006
|
+
_v$3 !== _p$._v$3 && _el$.style.setProperty("left", _p$._v$3 = _v$3);
|
|
8007
|
+
return _p$;
|
|
8008
|
+
}, {
|
|
8009
|
+
_v$: void 0,
|
|
8010
|
+
_v$2: void 0,
|
|
8011
|
+
_v$3: void 0
|
|
7975
8012
|
});
|
|
8013
|
+
return _el$;
|
|
7976
8014
|
}
|
|
7977
|
-
})
|
|
7978
|
-
insert(_el$, createComponent(NotificationsStyled, {}), null);
|
|
7979
|
-
createRenderEffect((_p$) => {
|
|
7980
|
-
var _a2, _b2;
|
|
7981
|
-
const _v$ = position.strategy, _v$2 = `${(_a2 = position.y) != null ? _a2 : 0}px`, _v$3 = `${(_b2 = position.x) != null ? _b2 : 0}px`;
|
|
7982
|
-
_v$ !== _p$._v$ && _el$.style.setProperty("position", _p$._v$ = _v$);
|
|
7983
|
-
_v$2 !== _p$._v$2 && _el$.style.setProperty("top", _p$._v$2 = _v$2);
|
|
7984
|
-
_v$3 !== _p$._v$3 && _el$.style.setProperty("left", _p$._v$3 = _v$3);
|
|
7985
|
-
return _p$;
|
|
7986
|
-
}, {
|
|
7987
|
-
_v$: void 0,
|
|
7988
|
-
_v$2: void 0,
|
|
7989
|
-
_v$3: void 0
|
|
7990
|
-
});
|
|
7991
|
-
return _el$;
|
|
8015
|
+
})];
|
|
7992
8016
|
}
|
|
7993
|
-
})
|
|
8017
|
+
});
|
|
7994
8018
|
}
|
|
7995
|
-
});
|
|
8019
|
+
})];
|
|
7996
8020
|
}
|
|
7997
8021
|
})];
|
|
7998
8022
|
}
|