@tonconnect/ui 2.0.6 → 2.0.7-beta.0
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 +212 -208
- package/dist/tonconnect-ui.min.js.map +1 -1
- package/lib/index.cjs +53 -21
- package/lib/index.cjs.map +1 -1
- package/lib/index.mjs +53 -21
- package/lib/index.mjs.map +1 -1
- package/package.json +2 -2
package/lib/index.cjs
CHANGED
|
@@ -2886,7 +2886,7 @@ const ButtonStyled$1 = styled.button`
|
|
|
2886
2886
|
cursor: ${(props) => props.disabled ? "not-allowed" : "pointer"};
|
|
2887
2887
|
|
|
2888
2888
|
font-size: 14px;
|
|
2889
|
-
font-weight:
|
|
2889
|
+
font-weight: 510;
|
|
2890
2890
|
line-height: 18px;
|
|
2891
2891
|
|
|
2892
2892
|
transition: transform 0.125s ease-in-out;
|
|
@@ -3302,7 +3302,7 @@ const ROUTE_STATE_KEY = "androidBackHandler";
|
|
|
3302
3302
|
const ROUTE_STATE = {
|
|
3303
3303
|
[ROUTE_STATE_KEY]: true
|
|
3304
3304
|
};
|
|
3305
|
-
const _tmpl$$
|
|
3305
|
+
const _tmpl$$w = /* @__PURE__ */ template$1(`<svg><path fill-rule="evenodd" clip-rule="evenodd" d="M10.2122 14.3407C10.5384 14.0854 10.5959 13.614 10.3406 13.2878L6.20237 8.00003L10.3406 2.71227C10.5959 2.38607 10.5384 1.91469 10.2122 1.6594C9.88604 1.40412 9.41465 1.46161 9.15937 1.7878L4.65937 7.5378C4.44688 7.80932 4.44688 8.19074 4.65937 8.46226L9.15937 14.2123C9.41465 14.5385 9.88604 14.5959 10.2122 14.3407Z"></path></svg>`, 4, true);
|
|
3306
3306
|
const rotationDegrees = {
|
|
3307
3307
|
left: 0,
|
|
3308
3308
|
top: 90,
|
|
@@ -3327,18 +3327,18 @@ const ArrowIcon = (props) => {
|
|
|
3327
3327
|
return direction();
|
|
3328
3328
|
},
|
|
3329
3329
|
get children() {
|
|
3330
|
-
const _el$ = _tmpl$$
|
|
3330
|
+
const _el$ = _tmpl$$w.cloneNode(true);
|
|
3331
3331
|
createRenderEffect(() => setAttribute(_el$, "fill", fill()));
|
|
3332
3332
|
return _el$;
|
|
3333
3333
|
}
|
|
3334
3334
|
});
|
|
3335
3335
|
};
|
|
3336
|
-
const _tmpl$$
|
|
3336
|
+
const _tmpl$$v = /* @__PURE__ */ template$1(`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.71966 2.71968C3.01255 2.42678 3.48743 2.42677 3.78032 2.71966L8.00002 6.93925L12.2197 2.71967C12.5126 2.42677 12.9874 2.42678 13.2803 2.71967C13.5732 3.01257 13.5732 3.48744 13.2803 3.78033L9.06068 7.99991L13.2803 12.2197C13.5732 12.5126 13.5732 12.9874 13.2803 13.2803C12.9874 13.5732 12.5126 13.5732 12.2197 13.2803L8.00002 9.06057L3.78033 13.2803C3.48744 13.5732 3.01257 13.5732 2.71967 13.2803C2.42678 12.9874 2.42677 12.5126 2.71967 12.2197L6.93936 7.99991L2.71968 3.78034C2.42678 3.48745 2.42677 3.01257 2.71966 2.71968Z"></path></svg>`);
|
|
3337
3337
|
const CloseIcon = (props) => {
|
|
3338
3338
|
const theme = useTheme();
|
|
3339
3339
|
const fill = () => props.fill || theme.colors.icon.secondary;
|
|
3340
3340
|
return (() => {
|
|
3341
|
-
const _el$ = _tmpl$$
|
|
3341
|
+
const _el$ = _tmpl$$v.cloneNode(true), _el$2 = _el$.firstChild;
|
|
3342
3342
|
createRenderEffect(() => setAttribute(_el$2, "fill", fill()));
|
|
3343
3343
|
return _el$;
|
|
3344
3344
|
})();
|
|
@@ -3572,7 +3572,7 @@ function animate(element, keyframes, options) {
|
|
|
3572
3572
|
}
|
|
3573
3573
|
return AnimationNoop.create();
|
|
3574
3574
|
}
|
|
3575
|
-
const _tmpl$$
|
|
3575
|
+
const _tmpl$$u = /* @__PURE__ */ template$1(`<div></div>`);
|
|
3576
3576
|
const clickOutside = clickOutside$1;
|
|
3577
3577
|
const keyPressed = escPressed;
|
|
3578
3578
|
const androidBackHandler = androidBackHandler$1;
|
|
@@ -3638,7 +3638,7 @@ const Modal = (props) => {
|
|
|
3638
3638
|
"data-tc-modal": "true"
|
|
3639
3639
|
}, dataAttrs, {
|
|
3640
3640
|
get children() {
|
|
3641
|
-
const _el$ = _tmpl$$
|
|
3641
|
+
const _el$ = _tmpl$$u.cloneNode(true);
|
|
3642
3642
|
use(androidBackHandler, _el$, () => ({
|
|
3643
3643
|
isEnabled: props.enableAndroidBackHandler,
|
|
3644
3644
|
onClose: () => props.onClose()
|
|
@@ -5585,7 +5585,7 @@ function fallbackCopyTextToClipboard(text) {
|
|
|
5585
5585
|
document.body.removeChild(textArea);
|
|
5586
5586
|
}
|
|
5587
5587
|
}
|
|
5588
|
-
const _tmpl$$
|
|
5588
|
+
const _tmpl$$t = /* @__PURE__ */ template$1(`<div></div>`);
|
|
5589
5589
|
const QRCode = (props) => {
|
|
5590
5590
|
let qrCodeCanvasRef;
|
|
5591
5591
|
let qrCodeWrapperRef;
|
|
@@ -5634,7 +5634,7 @@ const QRCode = (props) => {
|
|
|
5634
5634
|
},
|
|
5635
5635
|
get children() {
|
|
5636
5636
|
return [(() => {
|
|
5637
|
-
const _el$ = _tmpl$$
|
|
5637
|
+
const _el$ = _tmpl$$t.cloneNode(true);
|
|
5638
5638
|
const _ref$2 = qrCodeCanvasRef;
|
|
5639
5639
|
typeof _ref$2 === "function" ? use(_ref$2, _el$) : qrCodeCanvasRef = _el$;
|
|
5640
5640
|
return _el$;
|
|
@@ -5904,7 +5904,7 @@ const BadgeStyled = styled(Image)`
|
|
|
5904
5904
|
`;
|
|
5905
5905
|
const StyledText = styled(Text)`
|
|
5906
5906
|
max-width: 90px;
|
|
5907
|
-
font-weight:
|
|
5907
|
+
font-weight: 510;
|
|
5908
5908
|
white-space: nowrap;
|
|
5909
5909
|
text-overflow: ellipsis;
|
|
5910
5910
|
overflow: hidden;
|
|
@@ -5914,7 +5914,7 @@ const StyledText = styled(Text)`
|
|
|
5914
5914
|
}
|
|
5915
5915
|
`;
|
|
5916
5916
|
const StyledSecondLine = styled(Text)`
|
|
5917
|
-
font-weight: 510;
|
|
5917
|
+
font-weight: ${(props) => props.colorPrimary ? "510" : "400"};
|
|
5918
5918
|
max-width: 90px;
|
|
5919
5919
|
white-space: nowrap;
|
|
5920
5920
|
text-overflow: ellipsis;
|
|
@@ -5925,7 +5925,29 @@ const StyledSecondLine = styled(Text)`
|
|
|
5925
5925
|
max-width: 80px;
|
|
5926
5926
|
}
|
|
5927
5927
|
`;
|
|
5928
|
+
const _tmpl$$s = /* @__PURE__ */ template$1(`<div></div>`);
|
|
5928
5929
|
const WalletItem = (props) => {
|
|
5930
|
+
let ctxRef = null;
|
|
5931
|
+
const adjustLetterSpacing = () => {
|
|
5932
|
+
const name = ctxRef == null ? void 0 : ctxRef.querySelector("div");
|
|
5933
|
+
if (name && name.scrollWidth > name.clientWidth) {
|
|
5934
|
+
let spacing = 0;
|
|
5935
|
+
const minSpacing = -0.4;
|
|
5936
|
+
const step = 0.05;
|
|
5937
|
+
while (name.scrollWidth > name.clientWidth && spacing >= minSpacing) {
|
|
5938
|
+
spacing -= step;
|
|
5939
|
+
name.style.letterSpacing = `${spacing}px`;
|
|
5940
|
+
}
|
|
5941
|
+
if (spacing !== 0) {
|
|
5942
|
+
spacing -= step;
|
|
5943
|
+
name.style.letterSpacing = `${spacing}px`;
|
|
5944
|
+
}
|
|
5945
|
+
}
|
|
5946
|
+
};
|
|
5947
|
+
onMount(() => adjustLetterSpacing());
|
|
5948
|
+
createEffect(() => {
|
|
5949
|
+
adjustLetterSpacing();
|
|
5950
|
+
});
|
|
5929
5951
|
return createComponent(WalletItemStyled, {
|
|
5930
5952
|
get ["class"]() {
|
|
5931
5953
|
return props.class;
|
|
@@ -5941,11 +5963,16 @@ const WalletItem = (props) => {
|
|
|
5941
5963
|
get src() {
|
|
5942
5964
|
return props.badgeUrl;
|
|
5943
5965
|
}
|
|
5944
|
-
})),
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5966
|
+
})), (() => {
|
|
5967
|
+
const _el$ = _tmpl$$s.cloneNode(true);
|
|
5968
|
+
use((el) => ctxRef = el, _el$);
|
|
5969
|
+
insert(_el$, createComponent(StyledText, {
|
|
5970
|
+
get children() {
|
|
5971
|
+
return props.name;
|
|
5972
|
+
}
|
|
5973
|
+
}));
|
|
5974
|
+
return _el$;
|
|
5975
|
+
})(), createMemo(() => createMemo(() => !!props.secondLine)() && createComponent(StyledSecondLine, {
|
|
5949
5976
|
get colorPrimary() {
|
|
5950
5977
|
var _a2;
|
|
5951
5978
|
return (_a2 = props.secondLineColorPrimary) != null ? _a2 : true;
|
|
@@ -5959,7 +5986,7 @@ const WalletItem = (props) => {
|
|
|
5959
5986
|
};
|
|
5960
5987
|
const H1Styled$9 = styled.h1`
|
|
5961
5988
|
font-style: normal;
|
|
5962
|
-
font-weight:
|
|
5989
|
+
font-weight: 590;
|
|
5963
5990
|
font-size: 20px;
|
|
5964
5991
|
line-height: 28px;
|
|
5965
5992
|
|
|
@@ -5987,7 +6014,7 @@ const H1 = (props) => {
|
|
|
5987
6014
|
};
|
|
5988
6015
|
const H2Styled$5 = styled.h2`
|
|
5989
6016
|
font-style: normal;
|
|
5990
|
-
font-weight:
|
|
6017
|
+
font-weight: 400;
|
|
5991
6018
|
font-size: 16px;
|
|
5992
6019
|
line-height: 22px;
|
|
5993
6020
|
|
|
@@ -6015,7 +6042,7 @@ const H2 = (props) => {
|
|
|
6015
6042
|
};
|
|
6016
6043
|
const H3Styled$1 = styled.h3`
|
|
6017
6044
|
font-style: normal;
|
|
6018
|
-
font-weight:
|
|
6045
|
+
font-weight: 510;
|
|
6019
6046
|
font-size: 16px;
|
|
6020
6047
|
line-height: 20px;
|
|
6021
6048
|
|
|
@@ -9582,6 +9609,9 @@ const H2Styled$2 = styled(H2)`
|
|
|
9582
9609
|
margin-bottom: 24px;
|
|
9583
9610
|
padding: 0 24px;
|
|
9584
9611
|
min-height: 44px;
|
|
9612
|
+
max-width: ${(props) => props.maxWidth}px;
|
|
9613
|
+
margin-left: ${(props) => props.maxWidth ? "auto" : "0px"};
|
|
9614
|
+
margin-right: ${(props) => props.maxWidth ? "auto" : "0px"};
|
|
9585
9615
|
`;
|
|
9586
9616
|
styled(Button)`
|
|
9587
9617
|
display: block;
|
|
@@ -9595,11 +9625,12 @@ const TelegramButtonStyled = styled(Button)`
|
|
|
9595
9625
|
background-color: ${(props) => props.theme.colors.telegramButton};
|
|
9596
9626
|
|
|
9597
9627
|
color: ${(props) => props.theme.colors.constant.white};
|
|
9598
|
-
font-weight:
|
|
9628
|
+
font-weight: 510;
|
|
9599
9629
|
font-size: 16px;
|
|
9600
9630
|
line-height: 20px;
|
|
9601
9631
|
`;
|
|
9602
9632
|
const TGImageStyled = styled(Image)`
|
|
9633
|
+
background-color: transparent;
|
|
9603
9634
|
border-radius: ${(props) => tgBorders[props.theme.borderRadius]};
|
|
9604
9635
|
width: 24px;
|
|
9605
9636
|
height: 24px;
|
|
@@ -9755,6 +9786,7 @@ const MobileUniversalModal = (props) => {
|
|
|
9755
9786
|
children: "Connect your wallet"
|
|
9756
9787
|
}), createComponent(H2Styled$2, {
|
|
9757
9788
|
translationKey: "walletModal.mobileUniversalModal.openWalletOnTelegramOrSelect",
|
|
9789
|
+
maxWidth: 342,
|
|
9758
9790
|
children: "Open Wallet in Telegram or select your wallet to connect"
|
|
9759
9791
|
}), createComponent(TelegramButtonStyled, {
|
|
9760
9792
|
get leftIcon() {
|
|
@@ -10911,7 +10943,7 @@ class TonConnectUITracker {
|
|
|
10911
10943
|
}
|
|
10912
10944
|
}
|
|
10913
10945
|
}
|
|
10914
|
-
const tonConnectUiVersion = "2.0.
|
|
10946
|
+
const tonConnectUiVersion = "2.0.7-beta.0";
|
|
10915
10947
|
class TonConnectUI {
|
|
10916
10948
|
constructor(options) {
|
|
10917
10949
|
__publicField(this, "walletInfoStorage", new WalletInfoStorage());
|