@sunggang/ui-lib 0.3.35 → 0.3.37
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/index.esm.css +188 -0
- package/index.esm2.js +85 -19
- package/package.json +1 -1
- package/src/lib/Provider/LiffProvider.d.ts +4 -1
package/index.esm.css
CHANGED
|
@@ -574,35 +574,58 @@ video {
|
|
|
574
574
|
color: hsl(var(--foreground));
|
|
575
575
|
font-feature-settings: 'rlig' 1, 'calt' 1;
|
|
576
576
|
}
|
|
577
|
+
.\!container {
|
|
578
|
+
width: 100% !important;
|
|
579
|
+
}
|
|
577
580
|
.container {
|
|
578
581
|
width: 100%;
|
|
579
582
|
}
|
|
580
583
|
@media (min-width: 640px) {
|
|
581
584
|
|
|
585
|
+
.\!container {
|
|
586
|
+
max-width: 640px !important;
|
|
587
|
+
}
|
|
588
|
+
|
|
582
589
|
.container {
|
|
583
590
|
max-width: 640px;
|
|
584
591
|
}
|
|
585
592
|
}
|
|
586
593
|
@media (min-width: 768px) {
|
|
587
594
|
|
|
595
|
+
.\!container {
|
|
596
|
+
max-width: 768px !important;
|
|
597
|
+
}
|
|
598
|
+
|
|
588
599
|
.container {
|
|
589
600
|
max-width: 768px;
|
|
590
601
|
}
|
|
591
602
|
}
|
|
592
603
|
@media (min-width: 1024px) {
|
|
593
604
|
|
|
605
|
+
.\!container {
|
|
606
|
+
max-width: 1024px !important;
|
|
607
|
+
}
|
|
608
|
+
|
|
594
609
|
.container {
|
|
595
610
|
max-width: 1024px;
|
|
596
611
|
}
|
|
597
612
|
}
|
|
598
613
|
@media (min-width: 1280px) {
|
|
599
614
|
|
|
615
|
+
.\!container {
|
|
616
|
+
max-width: 1280px !important;
|
|
617
|
+
}
|
|
618
|
+
|
|
600
619
|
.container {
|
|
601
620
|
max-width: 1280px;
|
|
602
621
|
}
|
|
603
622
|
}
|
|
604
623
|
@media (min-width: 1536px) {
|
|
605
624
|
|
|
625
|
+
.\!container {
|
|
626
|
+
max-width: 1536px !important;
|
|
627
|
+
}
|
|
628
|
+
|
|
606
629
|
.container {
|
|
607
630
|
max-width: 1536px;
|
|
608
631
|
}
|
|
@@ -613,6 +636,9 @@ video {
|
|
|
613
636
|
.pointer-events-auto {
|
|
614
637
|
pointer-events: auto;
|
|
615
638
|
}
|
|
639
|
+
.\!visible {
|
|
640
|
+
visibility: visible !important;
|
|
641
|
+
}
|
|
616
642
|
.visible {
|
|
617
643
|
visibility: visible;
|
|
618
644
|
}
|
|
@@ -625,15 +651,24 @@ video {
|
|
|
625
651
|
.static {
|
|
626
652
|
position: static;
|
|
627
653
|
}
|
|
654
|
+
.\!fixed {
|
|
655
|
+
position: fixed !important;
|
|
656
|
+
}
|
|
628
657
|
.fixed {
|
|
629
658
|
position: fixed;
|
|
630
659
|
}
|
|
631
660
|
.absolute {
|
|
632
661
|
position: absolute;
|
|
633
662
|
}
|
|
663
|
+
.\!relative {
|
|
664
|
+
position: relative !important;
|
|
665
|
+
}
|
|
634
666
|
.relative {
|
|
635
667
|
position: relative;
|
|
636
668
|
}
|
|
669
|
+
.sticky {
|
|
670
|
+
position: sticky;
|
|
671
|
+
}
|
|
637
672
|
.inset-0 {
|
|
638
673
|
inset: 0px;
|
|
639
674
|
}
|
|
@@ -696,6 +731,9 @@ video {
|
|
|
696
731
|
.top-\[72px\] {
|
|
697
732
|
top: 72px;
|
|
698
733
|
}
|
|
734
|
+
.isolate {
|
|
735
|
+
isolation: isolate;
|
|
736
|
+
}
|
|
699
737
|
.z-10 {
|
|
700
738
|
z-index: 10;
|
|
701
739
|
}
|
|
@@ -711,6 +749,9 @@ video {
|
|
|
711
749
|
.z-\[9999\] {
|
|
712
750
|
z-index: 9999;
|
|
713
751
|
}
|
|
752
|
+
.m-1 {
|
|
753
|
+
margin: 0.25rem;
|
|
754
|
+
}
|
|
714
755
|
.m-4 {
|
|
715
756
|
margin: 1rem;
|
|
716
757
|
}
|
|
@@ -795,6 +836,9 @@ video {
|
|
|
795
836
|
.mt-5 {
|
|
796
837
|
margin-top: 1.25rem;
|
|
797
838
|
}
|
|
839
|
+
.\!block {
|
|
840
|
+
display: block !important;
|
|
841
|
+
}
|
|
798
842
|
.block {
|
|
799
843
|
display: block;
|
|
800
844
|
}
|
|
@@ -810,12 +854,42 @@ video {
|
|
|
810
854
|
.inline-flex {
|
|
811
855
|
display: inline-flex;
|
|
812
856
|
}
|
|
857
|
+
.\!table {
|
|
858
|
+
display: table !important;
|
|
859
|
+
}
|
|
813
860
|
.table {
|
|
814
861
|
display: table;
|
|
815
862
|
}
|
|
863
|
+
.inline-table {
|
|
864
|
+
display: inline-table;
|
|
865
|
+
}
|
|
866
|
+
.table-caption {
|
|
867
|
+
display: table-caption;
|
|
868
|
+
}
|
|
869
|
+
.table-cell {
|
|
870
|
+
display: table-cell;
|
|
871
|
+
}
|
|
872
|
+
.flow-root {
|
|
873
|
+
display: flow-root;
|
|
874
|
+
}
|
|
875
|
+
.\!grid {
|
|
876
|
+
display: grid !important;
|
|
877
|
+
}
|
|
816
878
|
.grid {
|
|
817
879
|
display: grid;
|
|
818
880
|
}
|
|
881
|
+
.inline-grid {
|
|
882
|
+
display: inline-grid;
|
|
883
|
+
}
|
|
884
|
+
.\!contents {
|
|
885
|
+
display: contents !important;
|
|
886
|
+
}
|
|
887
|
+
.contents {
|
|
888
|
+
display: contents;
|
|
889
|
+
}
|
|
890
|
+
.list-item {
|
|
891
|
+
display: list-item;
|
|
892
|
+
}
|
|
819
893
|
.hidden {
|
|
820
894
|
display: none;
|
|
821
895
|
}
|
|
@@ -1029,9 +1103,18 @@ video {
|
|
|
1029
1103
|
.flex-none {
|
|
1030
1104
|
flex: none;
|
|
1031
1105
|
}
|
|
1106
|
+
.flex-shrink {
|
|
1107
|
+
flex-shrink: 1;
|
|
1108
|
+
}
|
|
1109
|
+
.shrink {
|
|
1110
|
+
flex-shrink: 1;
|
|
1111
|
+
}
|
|
1032
1112
|
.shrink-0 {
|
|
1033
1113
|
flex-shrink: 0;
|
|
1034
1114
|
}
|
|
1115
|
+
.flex-grow {
|
|
1116
|
+
flex-grow: 1;
|
|
1117
|
+
}
|
|
1035
1118
|
.grow {
|
|
1036
1119
|
flex-grow: 1;
|
|
1037
1120
|
}
|
|
@@ -1072,6 +1155,9 @@ video {
|
|
|
1072
1155
|
--tw-rotate: 90deg;
|
|
1073
1156
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
1074
1157
|
}
|
|
1158
|
+
.\!transform {
|
|
1159
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;
|
|
1160
|
+
}
|
|
1075
1161
|
.transform {
|
|
1076
1162
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
1077
1163
|
}
|
|
@@ -1098,6 +1184,11 @@ video {
|
|
|
1098
1184
|
-moz-user-select: none;
|
|
1099
1185
|
user-select: none;
|
|
1100
1186
|
}
|
|
1187
|
+
.select-all {
|
|
1188
|
+
-webkit-user-select: all;
|
|
1189
|
+
-moz-user-select: all;
|
|
1190
|
+
user-select: all;
|
|
1191
|
+
}
|
|
1101
1192
|
.resize {
|
|
1102
1193
|
resize: both;
|
|
1103
1194
|
}
|
|
@@ -1322,6 +1413,9 @@ video {
|
|
|
1322
1413
|
.border-\[\#ffffff33\] {
|
|
1323
1414
|
border-color: #ffffff33;
|
|
1324
1415
|
}
|
|
1416
|
+
.border-\[top\2c left\2c right\2c bottom\] {
|
|
1417
|
+
border-color: top,left,right,bottom;
|
|
1418
|
+
}
|
|
1325
1419
|
.border-gray-200 {
|
|
1326
1420
|
--tw-border-opacity: 1;
|
|
1327
1421
|
border-color: rgb(229 231 235 / var(--tw-border-opacity, 1));
|
|
@@ -1718,6 +1812,9 @@ video {
|
|
|
1718
1812
|
.text-right {
|
|
1719
1813
|
text-align: right;
|
|
1720
1814
|
}
|
|
1815
|
+
.text-justify {
|
|
1816
|
+
text-align: justify;
|
|
1817
|
+
}
|
|
1721
1818
|
.indent-1 {
|
|
1722
1819
|
text-indent: 0.25rem;
|
|
1723
1820
|
}
|
|
@@ -1766,6 +1863,9 @@ video {
|
|
|
1766
1863
|
.font-bold {
|
|
1767
1864
|
font-weight: 700;
|
|
1768
1865
|
}
|
|
1866
|
+
.font-light {
|
|
1867
|
+
font-weight: 300;
|
|
1868
|
+
}
|
|
1769
1869
|
.font-medium {
|
|
1770
1870
|
font-weight: 500;
|
|
1771
1871
|
}
|
|
@@ -1787,6 +1887,10 @@ video {
|
|
|
1787
1887
|
.italic {
|
|
1788
1888
|
font-style: italic;
|
|
1789
1889
|
}
|
|
1890
|
+
.ordinal {
|
|
1891
|
+
--tw-ordinal: ordinal;
|
|
1892
|
+
font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
|
|
1893
|
+
}
|
|
1790
1894
|
.tracking-tight {
|
|
1791
1895
|
letter-spacing: -0.025em;
|
|
1792
1896
|
}
|
|
@@ -1998,12 +2102,23 @@ video {
|
|
|
1998
2102
|
.underline {
|
|
1999
2103
|
text-decoration-line: underline;
|
|
2000
2104
|
}
|
|
2105
|
+
.overline {
|
|
2106
|
+
text-decoration-line: overline;
|
|
2107
|
+
}
|
|
2001
2108
|
.line-through {
|
|
2002
2109
|
text-decoration-line: line-through;
|
|
2003
2110
|
}
|
|
2004
2111
|
.underline-offset-4 {
|
|
2005
2112
|
text-underline-offset: 4px;
|
|
2006
2113
|
}
|
|
2114
|
+
.antialiased {
|
|
2115
|
+
-webkit-font-smoothing: antialiased;
|
|
2116
|
+
-moz-osx-font-smoothing: grayscale;
|
|
2117
|
+
}
|
|
2118
|
+
.subpixel-antialiased {
|
|
2119
|
+
-webkit-font-smoothing: auto;
|
|
2120
|
+
-moz-osx-font-smoothing: auto;
|
|
2121
|
+
}
|
|
2007
2122
|
.opacity-0 {
|
|
2008
2123
|
opacity: 0;
|
|
2009
2124
|
}
|
|
@@ -2091,9 +2206,28 @@ video {
|
|
|
2091
2206
|
--tw-drop-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / 0.1)) drop-shadow(0 1px 1px rgb(0 0 0 / 0.06));
|
|
2092
2207
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
2093
2208
|
}
|
|
2209
|
+
.grayscale {
|
|
2210
|
+
--tw-grayscale: grayscale(100%);
|
|
2211
|
+
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
2212
|
+
}
|
|
2213
|
+
.invert {
|
|
2214
|
+
--tw-invert: invert(100%);
|
|
2215
|
+
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
2216
|
+
}
|
|
2217
|
+
.sepia {
|
|
2218
|
+
--tw-sepia: sepia(100%);
|
|
2219
|
+
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
2220
|
+
}
|
|
2221
|
+
.\!filter {
|
|
2222
|
+
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important;
|
|
2223
|
+
}
|
|
2094
2224
|
.filter {
|
|
2095
2225
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
2096
2226
|
}
|
|
2227
|
+
.backdrop-filter {
|
|
2228
|
+
-webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
|
|
2229
|
+
backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
|
|
2230
|
+
}
|
|
2097
2231
|
.transition {
|
|
2098
2232
|
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
|
|
2099
2233
|
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
|
|
@@ -2133,6 +2267,9 @@ video {
|
|
|
2133
2267
|
.duration-500 {
|
|
2134
2268
|
transition-duration: 500ms;
|
|
2135
2269
|
}
|
|
2270
|
+
.ease-in {
|
|
2271
|
+
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
|
2272
|
+
}
|
|
2136
2273
|
.ease-in-out {
|
|
2137
2274
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
2138
2275
|
}
|
|
@@ -2153,6 +2290,12 @@ video {
|
|
|
2153
2290
|
transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));
|
|
2154
2291
|
}
|
|
2155
2292
|
}
|
|
2293
|
+
.zoom-in {
|
|
2294
|
+
--tw-enter-scale: 0;
|
|
2295
|
+
}
|
|
2296
|
+
.zoom-out {
|
|
2297
|
+
--tw-exit-scale: 0;
|
|
2298
|
+
}
|
|
2156
2299
|
.duration-1000 {
|
|
2157
2300
|
animation-duration: 1000ms;
|
|
2158
2301
|
}
|
|
@@ -2165,12 +2308,57 @@ video {
|
|
|
2165
2308
|
.duration-500 {
|
|
2166
2309
|
animation-duration: 500ms;
|
|
2167
2310
|
}
|
|
2311
|
+
.ease-in {
|
|
2312
|
+
animation-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
|
2313
|
+
}
|
|
2168
2314
|
.ease-in-out {
|
|
2169
2315
|
animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
2170
2316
|
}
|
|
2171
2317
|
.ease-out {
|
|
2172
2318
|
animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
|
2173
2319
|
}
|
|
2320
|
+
.\!running {
|
|
2321
|
+
animation-play-state: running !important;
|
|
2322
|
+
}
|
|
2323
|
+
.running {
|
|
2324
|
+
animation-play-state: running;
|
|
2325
|
+
}
|
|
2326
|
+
.paused {
|
|
2327
|
+
animation-play-state: paused;
|
|
2328
|
+
}
|
|
2329
|
+
.\[a-zA-Z0-9\:\\\\-\\\\\._\$\] {
|
|
2330
|
+
a-z-a--z0-9: \\-\\. $;
|
|
2331
|
+
}
|
|
2332
|
+
.\[hash\:base64\] {
|
|
2333
|
+
hash: base64;
|
|
2334
|
+
}
|
|
2335
|
+
.\[key\:string\] {
|
|
2336
|
+
key: string;
|
|
2337
|
+
}
|
|
2338
|
+
.\[module\:ckbox\/ckbox\~CKBoxConfig\#assetsOrigin\] {
|
|
2339
|
+
module: ckbox/ckbox~CKBoxConfig#assetsOrigin;
|
|
2340
|
+
}
|
|
2341
|
+
.\[module\:ckbox\/ckbox\~CKBoxConfig\#defaultUploadCategories\] {
|
|
2342
|
+
module: ckbox/ckbox~CKBoxConfig#defaultUploadCategories;
|
|
2343
|
+
}
|
|
2344
|
+
.\[module\:ckbox\/ckbox\~CKBoxConfig\#ignoreDataId\] {
|
|
2345
|
+
module: ckbox/ckbox~CKBoxConfig#ignoreDataId;
|
|
2346
|
+
}
|
|
2347
|
+
.\[module\:ckbox\/ckbox\~CKBoxConfig\#language\] {
|
|
2348
|
+
module: ckbox/ckbox~CKBoxConfig#language;
|
|
2349
|
+
}
|
|
2350
|
+
.\[module\:ckbox\/ckbox\~CKBoxConfig\#serviceOrigin\] {
|
|
2351
|
+
module: ckbox/ckbox~CKBoxConfig#serviceOrigin;
|
|
2352
|
+
}
|
|
2353
|
+
.\[module\:media-embed\/mediaembed\~MediaEmbedConfig\#elementName\] {
|
|
2354
|
+
module: media-embed/mediaembed~MediaEmbedConfig#elementName;
|
|
2355
|
+
}
|
|
2356
|
+
.\[module\:media-embed\/mediaembed\~MediaEmbedConfig\#previewsInData\=false\] {
|
|
2357
|
+
module: media-embed/mediaembed~MediaEmbedConfig#previewsInData=false;
|
|
2358
|
+
}
|
|
2359
|
+
.\[module\:ui\/template\~TemplateBinding\#callback\] {
|
|
2360
|
+
module: ui/template~TemplateBinding#callback;
|
|
2361
|
+
}
|
|
2174
2362
|
|
|
2175
2363
|
/* gary */
|
|
2176
2364
|
|
package/index.esm2.js
CHANGED
|
@@ -47619,8 +47619,7 @@ var BaseTemplate = function(param) {
|
|
|
47619
47619
|
children: [
|
|
47620
47620
|
field.value && /*#__PURE__*/ jsx("div", {
|
|
47621
47621
|
className: "absolute -right-4 top-0",
|
|
47622
|
-
children: /*#__PURE__*/ jsx("
|
|
47623
|
-
type: "button",
|
|
47622
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
47624
47623
|
onClick: function(e) {
|
|
47625
47624
|
e.stopPropagation();
|
|
47626
47625
|
field.onChange(null);
|
|
@@ -78338,13 +78337,14 @@ function _ts_generator(thisArg, body) {
|
|
|
78338
78337
|
}
|
|
78339
78338
|
var LiffContext = /*#__PURE__*/ createContext(undefined);
|
|
78340
78339
|
var LiffProvider = function(param) {
|
|
78341
|
-
var children = param.children, liffId = param.liffId, _param_localStorageKey = param.localStorageKey, localStorageKey = _param_localStorageKey === void 0 ? "one-gobo-global-login" : _param_localStorageKey, checkTokenUrl = param.checkTokenUrl, loginUrl = param.loginUrl, memberInfoUrl = param.memberInfoUrl, _param_openInApp = param.openInApp, openInApp = _param_openInApp === void 0 ? false : _param_openInApp, _param_ignoreCheckAddFriend = param.ignoreCheckAddFriend, ignoreCheckAddFriend = _param_ignoreCheckAddFriend === void 0 ? false : _param_ignoreCheckAddFriend
|
|
78340
|
+
var children = param.children, liffId = param.liffId, _param_localStorageKey = param.localStorageKey, localStorageKey = _param_localStorageKey === void 0 ? "one-gobo-global-login" : _param_localStorageKey, checkTokenUrl = param.checkTokenUrl, loginUrl = param.loginUrl, accountLoginUrl = param.accountLoginUrl, memberInfoUrl = param.memberInfoUrl, _param_openInApp = param.openInApp, openInApp = _param_openInApp === void 0 ? false : _param_openInApp, _param_ignoreCheckAddFriend = param.ignoreCheckAddFriend, ignoreCheckAddFriend = _param_ignoreCheckAddFriend === void 0 ? false : _param_ignoreCheckAddFriend, _param_ignoreRoute = param.ignoreRoute, ignoreRoute = _param_ignoreRoute === void 0 ? false : _param_ignoreRoute, _param_loginByUser = param.loginByUser, loginByUser = _param_loginByUser === void 0 ? false : _param_loginByUser, customerRedirectUrl = param.customerRedirectUrl, inviteCode = param.inviteCode, handleLoginError = param.handleLoginError;
|
|
78342
78341
|
var _useState = _sliced_to_array(useState(null), 2), liffObject = _useState[0], setLiffObject = _useState[1];
|
|
78343
78342
|
var _useState1 = _sliced_to_array(useState(""), 2), accessToken = _useState1[0], setAccessToken = _useState1[1];
|
|
78344
78343
|
var _useState2 = _sliced_to_array(useState(null), 2), liffError = _useState2[0], setLiffError = _useState2[1];
|
|
78345
78344
|
var _useState3 = _sliced_to_array(useState(null), 2), loginData = _useState3[0], setLoginData = _useState3[1];
|
|
78346
78345
|
var _useState4 = _sliced_to_array(useState(null), 2), userInfo = _useState4[0], setUserInfo = _useState4[1];
|
|
78347
78346
|
var _useState5 = _sliced_to_array(useState(null), 2), isFriendship = _useState5[0], setFriendship = _useState5[1];
|
|
78347
|
+
var _useState6 = _sliced_to_array(useState(null), 2), loginType = _useState6[0], setLoginType = _useState6[1];
|
|
78348
78348
|
var fetchMemberInfo = function() {
|
|
78349
78349
|
var _ref = _async_to_generator(function(token) {
|
|
78350
78350
|
var response, err;
|
|
@@ -78492,6 +78492,7 @@ var LiffProvider = function(param) {
|
|
|
78492
78492
|
loginToken = resData === null || resData === void 0 ? void 0 : (_resData_data1 = resData.data) === null || _resData_data1 === void 0 ? void 0 : _resData_data1.access_token;
|
|
78493
78493
|
if (loginToken) {
|
|
78494
78494
|
setAccessToken(loginToken);
|
|
78495
|
+
setLoginType("line");
|
|
78495
78496
|
if (memberInfoUrl) fetchMemberInfo(loginToken);
|
|
78496
78497
|
} else {
|
|
78497
78498
|
setUserInfo(response);
|
|
@@ -78522,7 +78523,7 @@ var LiffProvider = function(param) {
|
|
|
78522
78523
|
// 初始化 LIFF
|
|
78523
78524
|
var initializeLiff = function() {
|
|
78524
78525
|
var _ref = _async_to_generator(function(isValid) {
|
|
78525
|
-
var customFetch, liff, originalFetch, lineToken,
|
|
78526
|
+
var customFetch, liff, originalFetch, lineToken, redirectUri, tempFriendship, friendship, friendFlag, error, err;
|
|
78526
78527
|
return _ts_generator(this, function(_state) {
|
|
78527
78528
|
switch(_state.label){
|
|
78528
78529
|
case 0:
|
|
@@ -78561,19 +78562,12 @@ var LiffProvider = function(param) {
|
|
|
78561
78562
|
console.log("LIFF init succeeded.");
|
|
78562
78563
|
setLiffObject(liff);
|
|
78563
78564
|
lineToken = liff === null || liff === void 0 ? void 0 : liff.getAccessToken();
|
|
78564
|
-
|
|
78565
|
-
|
|
78566
|
-
|
|
78567
|
-
|
|
78568
|
-
|
|
78569
|
-
|
|
78570
|
-
window.location.replace(decodeURIComponent(liffState));
|
|
78571
|
-
}
|
|
78572
|
-
} else {
|
|
78573
|
-
// 處理登入邏輯
|
|
78574
|
-
currentPath = customerRedirectUrl || window.location.pathname + window.location.search || "";
|
|
78575
|
-
origin = window.location.origin;
|
|
78576
|
-
redirectUri = "".concat(origin).concat(currentPath);
|
|
78565
|
+
// 未登入先進行登入
|
|
78566
|
+
if (!liff.isLoggedIn()) {
|
|
78567
|
+
redirectUri = customerRedirectUrl || "".concat(window.location.href);
|
|
78568
|
+
if (loginByUser || ignoreRoute) return [
|
|
78569
|
+
2
|
|
78570
|
+
];
|
|
78577
78571
|
liff.login({
|
|
78578
78572
|
redirectUri: redirectUri
|
|
78579
78573
|
});
|
|
@@ -78648,6 +78642,74 @@ var LiffProvider = function(param) {
|
|
|
78648
78642
|
return _ref.apply(this, arguments);
|
|
78649
78643
|
};
|
|
78650
78644
|
}();
|
|
78645
|
+
var accountLogin = function() {
|
|
78646
|
+
var _ref = _async_to_generator(function(username, password) {
|
|
78647
|
+
var response, _response_data, _response_data1, token, tokenType, finalToken, err;
|
|
78648
|
+
return _ts_generator(this, function(_state) {
|
|
78649
|
+
switch(_state.label){
|
|
78650
|
+
case 0:
|
|
78651
|
+
_state.trys.push([
|
|
78652
|
+
0,
|
|
78653
|
+
4,
|
|
78654
|
+
,
|
|
78655
|
+
5
|
|
78656
|
+
]);
|
|
78657
|
+
return [
|
|
78658
|
+
4,
|
|
78659
|
+
fetchAPI(accountLoginUrl || "", {
|
|
78660
|
+
method: "POST",
|
|
78661
|
+
body: {
|
|
78662
|
+
username: username,
|
|
78663
|
+
password: password
|
|
78664
|
+
}
|
|
78665
|
+
})
|
|
78666
|
+
];
|
|
78667
|
+
case 1:
|
|
78668
|
+
response = _state.sent();
|
|
78669
|
+
if (!(response === null || response === void 0 ? void 0 : response.status)) return [
|
|
78670
|
+
3,
|
|
78671
|
+
3
|
|
78672
|
+
];
|
|
78673
|
+
token = response === null || response === void 0 ? void 0 : (_response_data = response.data) === null || _response_data === void 0 ? void 0 : _response_data.access_token;
|
|
78674
|
+
tokenType = response === null || response === void 0 ? void 0 : (_response_data1 = response.data) === null || _response_data1 === void 0 ? void 0 : _response_data1.token_type;
|
|
78675
|
+
finalToken = "".concat(tokenType, " ").concat(token);
|
|
78676
|
+
setAccessToken(finalToken);
|
|
78677
|
+
setLoginType("account");
|
|
78678
|
+
window.localStorage.setItem(localStorageKey, JSON.stringify(response));
|
|
78679
|
+
if (!token) return [
|
|
78680
|
+
3,
|
|
78681
|
+
3
|
|
78682
|
+
];
|
|
78683
|
+
return [
|
|
78684
|
+
4,
|
|
78685
|
+
fetchMemberInfo(finalToken)
|
|
78686
|
+
];
|
|
78687
|
+
case 2:
|
|
78688
|
+
_state.sent();
|
|
78689
|
+
_state.label = 3;
|
|
78690
|
+
case 3:
|
|
78691
|
+
return [
|
|
78692
|
+
2,
|
|
78693
|
+
response
|
|
78694
|
+
];
|
|
78695
|
+
case 4:
|
|
78696
|
+
err = _state.sent();
|
|
78697
|
+
console.error("帳密登入失敗:", err);
|
|
78698
|
+
return [
|
|
78699
|
+
2,
|
|
78700
|
+
null
|
|
78701
|
+
];
|
|
78702
|
+
case 5:
|
|
78703
|
+
return [
|
|
78704
|
+
2
|
|
78705
|
+
];
|
|
78706
|
+
}
|
|
78707
|
+
});
|
|
78708
|
+
});
|
|
78709
|
+
return function accountLogin(username, password) {
|
|
78710
|
+
return _ref.apply(this, arguments);
|
|
78711
|
+
};
|
|
78712
|
+
}();
|
|
78651
78713
|
var ensureLiffTokenValid = useCallback$1(/*#__PURE__*/ _async_to_generator(function() {
|
|
78652
78714
|
var _parsedStore_data, _parsedStore_state, jwtTokenValue, jwtToken, parsedStore, isValid, _tmp, err;
|
|
78653
78715
|
return _ts_generator(this, function(_state) {
|
|
@@ -78797,7 +78859,9 @@ var LiffProvider = function(param) {
|
|
|
78797
78859
|
return initializeLiff(false);
|
|
78798
78860
|
},
|
|
78799
78861
|
isFriendship: isFriendship,
|
|
78800
|
-
ensureLiffTokenValid: ensureLiffTokenValid
|
|
78862
|
+
ensureLiffTokenValid: ensureLiffTokenValid,
|
|
78863
|
+
accountLogin: accountLogin,
|
|
78864
|
+
loginType: loginType
|
|
78801
78865
|
};
|
|
78802
78866
|
}, [
|
|
78803
78867
|
liffObject,
|
|
@@ -78806,7 +78870,9 @@ var LiffProvider = function(param) {
|
|
|
78806
78870
|
accessToken,
|
|
78807
78871
|
liffError,
|
|
78808
78872
|
isFriendship,
|
|
78809
|
-
ensureLiffTokenValid
|
|
78873
|
+
ensureLiffTokenValid,
|
|
78874
|
+
accountLogin,
|
|
78875
|
+
loginType
|
|
78810
78876
|
]);
|
|
78811
78877
|
return /*#__PURE__*/ jsx(LiffContext.Provider, {
|
|
78812
78878
|
value: contextValue,
|
package/package.json
CHANGED
|
@@ -8,14 +8,17 @@ type LiffContextType = {
|
|
|
8
8
|
initializeLiff: () => Promise<void>;
|
|
9
9
|
isFriendship: boolean | null;
|
|
10
10
|
ensureLiffTokenValid: () => Promise<boolean>;
|
|
11
|
+
loginType: string | null;
|
|
12
|
+
accountLogin: (username: string, password: string) => Promise<void>;
|
|
11
13
|
};
|
|
12
14
|
export declare const LiffContext: React.Context<LiffContextType | undefined>;
|
|
13
|
-
export declare const LiffProvider: ({ children, liffId, localStorageKey, checkTokenUrl, loginUrl, memberInfoUrl, openInApp, ignoreCheckAddFriend, ignoreRoute, loginByUser, customerRedirectUrl, inviteCode, handleLoginError, }: {
|
|
15
|
+
export declare const LiffProvider: ({ children, liffId, localStorageKey, checkTokenUrl, loginUrl, accountLoginUrl, memberInfoUrl, openInApp, ignoreCheckAddFriend, ignoreRoute, loginByUser, customerRedirectUrl, inviteCode, handleLoginError, }: {
|
|
14
16
|
children: React.ReactNode;
|
|
15
17
|
liffId: string;
|
|
16
18
|
localStorageKey: string;
|
|
17
19
|
checkTokenUrl: string;
|
|
18
20
|
loginUrl?: string | undefined;
|
|
21
|
+
accountLoginUrl?: string | undefined;
|
|
19
22
|
memberInfoUrl: string;
|
|
20
23
|
openInApp?: boolean | undefined;
|
|
21
24
|
ignoreCheckAddFriend?: boolean | undefined;
|