@wix/cli-app 1.1.74 → 1.1.75
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/build/{CreateVersionCommand-6PXETRX5.js → CreateVersionCommand-RQXPDP24.js} +14 -16
- package/build/{CreateVersionCommand-6PXETRX5.js.map → CreateVersionCommand-RQXPDP24.js.map} +1 -1
- package/build/{DevCommand-575K76BZ.js → DevCommand-S4Z3WJGP.js} +14 -16
- package/build/{DevCommand-575K76BZ.js.map → DevCommand-S4Z3WJGP.js.map} +1 -1
- package/build/{GenerateCommand-NKJI6L6F.js → GenerateCommand-KJFVXKF6.js} +575 -476
- package/build/GenerateCommand-KJFVXKF6.js.map +1 -0
- package/build/{LogsCommand-LDVXIJRM.js → LogsCommand-BIVRFRK5.js} +4 -4
- package/build/PreviewCommand-LVAVWK5X.js +21 -0
- package/build/{ReleaseCommand-3KMQAZC2.js → ReleaseCommand-D44TLKQN.js} +17 -19
- package/build/{ReleaseCommand-3KMQAZC2.js.map → ReleaseCommand-D44TLKQN.js.map} +1 -1
- package/build/{ServeCommand-JVEHGEQJ.js → ServeCommand-7CZUCKDQ.js} +15 -17
- package/build/{ServeCommand-JVEHGEQJ.js.map → ServeCommand-7CZUCKDQ.js.map} +1 -1
- package/build/{build-LGA2RNYK.js → build-QQOQLG6Q.js} +7 -7
- package/build/{chunk-UR2P6KAA.js → chunk-3R3L4Z4K.js} +3 -3
- package/build/{chunk-A2RC7C33.js → chunk-3T6MWKGJ.js} +3 -3
- package/build/{chunk-7DBU2MOT.js → chunk-3TGCMRM2.js} +3 -2
- package/build/chunk-3TGCMRM2.js.map +1 -0
- package/build/{chunk-KFXL2D65.js → chunk-5MJT77SF.js} +4 -4
- package/build/{chunk-KFXL2D65.js.map → chunk-5MJT77SF.js.map} +1 -1
- package/build/{chunk-2I5H2XRH.js → chunk-5V425DYH.js} +2 -2
- package/build/{chunk-5CXN5MQU.js → chunk-ABAJ2G2M.js} +3 -3
- package/build/{chunk-C2J6X76S.js → chunk-ADIVS46Y.js} +4 -4
- package/build/{chunk-OBKGCJPS.js → chunk-C64MJGM6.js} +3 -3
- package/build/{chunk-YX3VV7BD.js → chunk-FSYOQVCS.js} +54 -11
- package/build/chunk-FSYOQVCS.js.map +1 -0
- package/build/{chunk-4AUIUNWR.js → chunk-GB3SH2IE.js} +3 -3
- package/build/{chunk-HBC2QGBW.js → chunk-I3NQFKY6.js} +33 -14
- package/build/{chunk-HBC2QGBW.js.map → chunk-I3NQFKY6.js.map} +1 -1
- package/build/{chunk-UEWHA4N4.js → chunk-O6IB7IRT.js} +33 -11
- package/build/chunk-O6IB7IRT.js.map +1 -0
- package/build/{chunk-MGWDHTIY.js → chunk-S7FXCJ5N.js} +3 -3
- package/build/{chunk-D4K6HLR5.js → chunk-TSZ32MNC.js} +629 -97
- package/build/chunk-TSZ32MNC.js.map +1 -0
- package/build/{chunk-ETZUKD7Z.js → chunk-YEO2M3TJ.js} +5 -7
- package/build/{chunk-ETZUKD7Z.js.map → chunk-YEO2M3TJ.js.map} +1 -1
- package/build/{chunk-XL6K6NL2.js → chunk-ZILFZBV3.js} +3 -3
- package/build/index.js +38 -30
- package/build/index.js.map +1 -1
- package/build/preview-Q2SJBMOD.js +101 -0
- package/build/preview-Q2SJBMOD.js.map +1 -0
- package/build/{render-command-RYGIULDT.js → render-command-LPGQHYQY.js} +8 -8
- package/package.json +4 -4
- package/build/GenerateCommand-NKJI6L6F.js.map +0 -1
- package/build/PreviewCommand-PMZTMXBO.js +0 -23
- package/build/chunk-7DBU2MOT.js.map +0 -1
- package/build/chunk-D4K6HLR5.js.map +0 -1
- package/build/chunk-UEWHA4N4.js.map +0 -1
- package/build/chunk-YJ5YN5VN.js +0 -579
- package/build/chunk-YJ5YN5VN.js.map +0 -1
- package/build/chunk-YLAUVJYG.js +0 -60
- package/build/chunk-YLAUVJYG.js.map +0 -1
- package/build/chunk-YX3VV7BD.js.map +0 -1
- package/build/preview-S2TF6RDS.js +0 -138
- package/build/preview-S2TF6RDS.js.map +0 -1
- /package/build/{LogsCommand-LDVXIJRM.js.map → LogsCommand-BIVRFRK5.js.map} +0 -0
- /package/build/{PreviewCommand-PMZTMXBO.js.map → PreviewCommand-LVAVWK5X.js.map} +0 -0
- /package/build/{build-LGA2RNYK.js.map → build-QQOQLG6Q.js.map} +0 -0
- /package/build/{chunk-UR2P6KAA.js.map → chunk-3R3L4Z4K.js.map} +0 -0
- /package/build/{chunk-A2RC7C33.js.map → chunk-3T6MWKGJ.js.map} +0 -0
- /package/build/{chunk-2I5H2XRH.js.map → chunk-5V425DYH.js.map} +0 -0
- /package/build/{chunk-5CXN5MQU.js.map → chunk-ABAJ2G2M.js.map} +0 -0
- /package/build/{chunk-C2J6X76S.js.map → chunk-ADIVS46Y.js.map} +0 -0
- /package/build/{chunk-OBKGCJPS.js.map → chunk-C64MJGM6.js.map} +0 -0
- /package/build/{chunk-4AUIUNWR.js.map → chunk-GB3SH2IE.js.map} +0 -0
- /package/build/{chunk-MGWDHTIY.js.map → chunk-S7FXCJ5N.js.map} +0 -0
- /package/build/{chunk-XL6K6NL2.js.map → chunk-ZILFZBV3.js.map} +0 -0
- /package/build/{render-command-RYGIULDT.js.map → render-command-LPGQHYQY.js.map} +0 -0
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
componentGenerator,
|
|
5
5
|
require_lodash,
|
|
6
6
|
useBackendComponents
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-I3NQFKY6.js";
|
|
8
8
|
import {
|
|
9
9
|
useTunnel
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-S7FXCJ5N.js";
|
|
11
11
|
import {
|
|
12
12
|
useDebugLog
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZILFZBV3.js";
|
|
14
14
|
import {
|
|
15
15
|
createAppManifest,
|
|
16
16
|
getComponentDevSourceBuilder,
|
|
@@ -20,13 +20,17 @@ import {
|
|
|
20
20
|
updateAppManifestWithBaseUrl,
|
|
21
21
|
updateBlocksComponents,
|
|
22
22
|
updateWorkerComponentsWithBaseUrl
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-ADIVS46Y.js";
|
|
24
24
|
import {
|
|
25
|
+
APP_CONFIG_PATH,
|
|
25
26
|
BLOCKS_WIDGET_PANELS_DIR,
|
|
27
|
+
BiProvider,
|
|
26
28
|
ComponentType2 as ComponentType,
|
|
27
29
|
DevCenterComponent,
|
|
28
30
|
ErrorViewer,
|
|
29
31
|
PlatformType,
|
|
32
|
+
SiteAuthProvider,
|
|
33
|
+
TimeoutError,
|
|
30
34
|
deepEqual,
|
|
31
35
|
getBlocksTypesPath,
|
|
32
36
|
getBlocksWidgetsDir,
|
|
@@ -34,6 +38,7 @@ import {
|
|
|
34
38
|
openBrowser,
|
|
35
39
|
outputFile,
|
|
36
40
|
pRetry,
|
|
41
|
+
pWaitFor,
|
|
37
42
|
readAppConfig,
|
|
38
43
|
require_mime_types,
|
|
39
44
|
require_ms,
|
|
@@ -42,18 +47,26 @@ import {
|
|
|
42
47
|
saveWixConfig,
|
|
43
48
|
serializer,
|
|
44
49
|
toJsonString,
|
|
50
|
+
useBiLogger,
|
|
45
51
|
useDevCenterClient,
|
|
46
52
|
useErrorReporter,
|
|
47
53
|
useExtensions,
|
|
48
54
|
useHttpClient,
|
|
49
|
-
useProjectModel
|
|
50
|
-
|
|
55
|
+
useProjectModel,
|
|
56
|
+
wixCliAction,
|
|
57
|
+
wixCliAppFlowStepsAnswers
|
|
58
|
+
} from "./chunk-5MJT77SF.js";
|
|
51
59
|
import {
|
|
52
60
|
Alert,
|
|
61
|
+
Badge,
|
|
53
62
|
CliError,
|
|
54
63
|
CliErrorCode,
|
|
64
|
+
I18nProvider,
|
|
65
|
+
Key,
|
|
55
66
|
Link,
|
|
56
67
|
Newline,
|
|
68
|
+
SelectInput,
|
|
69
|
+
SelectOptionAvailability,
|
|
57
70
|
Spinner,
|
|
58
71
|
Text,
|
|
59
72
|
Trans,
|
|
@@ -62,10 +75,12 @@ import {
|
|
|
62
75
|
require_react,
|
|
63
76
|
require_supports_color,
|
|
64
77
|
useAsync,
|
|
78
|
+
useAsyncCallback,
|
|
65
79
|
useExit,
|
|
66
80
|
useTranslation,
|
|
81
|
+
use_input_default,
|
|
67
82
|
z
|
|
68
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-O6IB7IRT.js";
|
|
69
84
|
import {
|
|
70
85
|
__commonJS,
|
|
71
86
|
__dirname,
|
|
@@ -938,12 +953,12 @@ var require_charset = __commonJS({
|
|
|
938
953
|
return accepts;
|
|
939
954
|
}
|
|
940
955
|
function parseCharset(str, i2) {
|
|
941
|
-
var
|
|
942
|
-
if (!
|
|
943
|
-
var charset =
|
|
956
|
+
var match11 = simpleCharsetRegExp.exec(str);
|
|
957
|
+
if (!match11) return null;
|
|
958
|
+
var charset = match11[1];
|
|
944
959
|
var q = 1;
|
|
945
|
-
if (
|
|
946
|
-
var params =
|
|
960
|
+
if (match11[2]) {
|
|
961
|
+
var params = match11[2].split(";");
|
|
947
962
|
for (var j = 0; j < params.length; j++) {
|
|
948
963
|
var p = params[j].trim().split("=");
|
|
949
964
|
if (p[0] === "q") {
|
|
@@ -1037,12 +1052,12 @@ var require_encoding = __commonJS({
|
|
|
1037
1052
|
return accepts;
|
|
1038
1053
|
}
|
|
1039
1054
|
function parseEncoding(str, i2) {
|
|
1040
|
-
var
|
|
1041
|
-
if (!
|
|
1042
|
-
var encoding =
|
|
1055
|
+
var match11 = simpleEncodingRegExp.exec(str);
|
|
1056
|
+
if (!match11) return null;
|
|
1057
|
+
var encoding = match11[1];
|
|
1043
1058
|
var q = 1;
|
|
1044
|
-
if (
|
|
1045
|
-
var params =
|
|
1059
|
+
if (match11[2]) {
|
|
1060
|
+
var params = match11[2].split(";");
|
|
1046
1061
|
for (var j = 0; j < params.length; j++) {
|
|
1047
1062
|
var p = params[j].trim().split("=");
|
|
1048
1063
|
if (p[0] === "q") {
|
|
@@ -1125,15 +1140,15 @@ var require_language = __commonJS({
|
|
|
1125
1140
|
return accepts;
|
|
1126
1141
|
}
|
|
1127
1142
|
function parseLanguage(str, i2) {
|
|
1128
|
-
var
|
|
1129
|
-
if (!
|
|
1130
|
-
var prefix =
|
|
1131
|
-
var suffix =
|
|
1143
|
+
var match11 = simpleLanguageRegExp.exec(str);
|
|
1144
|
+
if (!match11) return null;
|
|
1145
|
+
var prefix = match11[1];
|
|
1146
|
+
var suffix = match11[2];
|
|
1132
1147
|
var full = prefix;
|
|
1133
1148
|
if (suffix) full += "-" + suffix;
|
|
1134
1149
|
var q = 1;
|
|
1135
|
-
if (
|
|
1136
|
-
var params =
|
|
1150
|
+
if (match11[3]) {
|
|
1151
|
+
var params = match11[3].split(";");
|
|
1137
1152
|
for (var j = 0; j < params.length; j++) {
|
|
1138
1153
|
var p = params[j].split("=");
|
|
1139
1154
|
if (p[0] === "q") q = parseFloat(p[1]);
|
|
@@ -1221,14 +1236,14 @@ var require_mediaType = __commonJS({
|
|
|
1221
1236
|
return accepts;
|
|
1222
1237
|
}
|
|
1223
1238
|
function parseMediaType(str, i2) {
|
|
1224
|
-
var
|
|
1225
|
-
if (!
|
|
1239
|
+
var match11 = simpleMediaTypeRegExp.exec(str);
|
|
1240
|
+
if (!match11) return null;
|
|
1226
1241
|
var params = /* @__PURE__ */ Object.create(null);
|
|
1227
1242
|
var q = 1;
|
|
1228
|
-
var subtype =
|
|
1229
|
-
var type =
|
|
1230
|
-
if (
|
|
1231
|
-
var kvps = splitParameters(
|
|
1243
|
+
var subtype = match11[2];
|
|
1244
|
+
var type = match11[1];
|
|
1245
|
+
if (match11[3]) {
|
|
1246
|
+
var kvps = splitParameters(match11[3]).map(splitKeyValuePair);
|
|
1232
1247
|
for (var j = 0; j < kvps.length; j++) {
|
|
1233
1248
|
var pair = kvps[j];
|
|
1234
1249
|
var key = pair[0].toLowerCase();
|
|
@@ -2364,19 +2379,19 @@ var require_common = __commonJS({
|
|
|
2364
2379
|
args.unshift("%O");
|
|
2365
2380
|
}
|
|
2366
2381
|
let index = 0;
|
|
2367
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (
|
|
2368
|
-
if (
|
|
2382
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match11, format) => {
|
|
2383
|
+
if (match11 === "%%") {
|
|
2369
2384
|
return "%";
|
|
2370
2385
|
}
|
|
2371
2386
|
index++;
|
|
2372
2387
|
const formatter = createDebug.formatters[format];
|
|
2373
2388
|
if (typeof formatter === "function") {
|
|
2374
2389
|
const val = args[index];
|
|
2375
|
-
|
|
2390
|
+
match11 = formatter.call(self2, val);
|
|
2376
2391
|
args.splice(index, 1);
|
|
2377
2392
|
index--;
|
|
2378
2393
|
}
|
|
2379
|
-
return
|
|
2394
|
+
return match11;
|
|
2380
2395
|
});
|
|
2381
2396
|
createDebug.formatArgs.call(self2, args);
|
|
2382
2397
|
const logFn = self2.log || createDebug.log;
|
|
@@ -2599,12 +2614,12 @@ var require_browser = __commonJS({
|
|
|
2599
2614
|
args.splice(1, 0, c, "color: inherit");
|
|
2600
2615
|
let index = 0;
|
|
2601
2616
|
let lastC = 0;
|
|
2602
|
-
args[0].replace(/%[a-zA-Z%]/g, (
|
|
2603
|
-
if (
|
|
2617
|
+
args[0].replace(/%[a-zA-Z%]/g, (match11) => {
|
|
2618
|
+
if (match11 === "%%") {
|
|
2604
2619
|
return;
|
|
2605
2620
|
}
|
|
2606
2621
|
index++;
|
|
2607
|
-
if (
|
|
2622
|
+
if (match11 === "%c") {
|
|
2608
2623
|
lastC = index;
|
|
2609
2624
|
}
|
|
2610
2625
|
});
|
|
@@ -3312,8 +3327,8 @@ var require_polling_jsonp = __commonJS({
|
|
|
3312
3327
|
onData(data) {
|
|
3313
3328
|
data = qs.parse(data).d;
|
|
3314
3329
|
if ("string" === typeof data) {
|
|
3315
|
-
data = data.replace(rSlashes, function(
|
|
3316
|
-
return slashes ?
|
|
3330
|
+
data = data.replace(rSlashes, function(match11, slashes) {
|
|
3331
|
+
return slashes ? match11 : "\n";
|
|
3317
3332
|
});
|
|
3318
3333
|
super.onData(data.replace(rDoubleSlashes, "\\n"));
|
|
3319
3334
|
}
|
|
@@ -9851,19 +9866,19 @@ var require_common2 = __commonJS({
|
|
|
9851
9866
|
args.unshift("%O");
|
|
9852
9867
|
}
|
|
9853
9868
|
let index = 0;
|
|
9854
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (
|
|
9855
|
-
if (
|
|
9869
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match11, format) => {
|
|
9870
|
+
if (match11 === "%%") {
|
|
9856
9871
|
return "%";
|
|
9857
9872
|
}
|
|
9858
9873
|
index++;
|
|
9859
9874
|
const formatter = createDebug.formatters[format];
|
|
9860
9875
|
if (typeof formatter === "function") {
|
|
9861
9876
|
const val = args[index];
|
|
9862
|
-
|
|
9877
|
+
match11 = formatter.call(self2, val);
|
|
9863
9878
|
args.splice(index, 1);
|
|
9864
9879
|
index--;
|
|
9865
9880
|
}
|
|
9866
|
-
return
|
|
9881
|
+
return match11;
|
|
9867
9882
|
});
|
|
9868
9883
|
createDebug.formatArgs.call(self2, args);
|
|
9869
9884
|
const logFn = self2.log || createDebug.log;
|
|
@@ -10086,12 +10101,12 @@ var require_browser2 = __commonJS({
|
|
|
10086
10101
|
args.splice(1, 0, c, "color: inherit");
|
|
10087
10102
|
let index = 0;
|
|
10088
10103
|
let lastC = 0;
|
|
10089
|
-
args[0].replace(/%[a-zA-Z%]/g, (
|
|
10090
|
-
if (
|
|
10104
|
+
args[0].replace(/%[a-zA-Z%]/g, (match11) => {
|
|
10105
|
+
if (match11 === "%%") {
|
|
10091
10106
|
return;
|
|
10092
10107
|
}
|
|
10093
10108
|
index++;
|
|
10094
|
-
if (
|
|
10109
|
+
if (match11 === "%c") {
|
|
10095
10110
|
lastC = index;
|
|
10096
10111
|
}
|
|
10097
10112
|
});
|
|
@@ -10651,19 +10666,19 @@ var require_common3 = __commonJS({
|
|
|
10651
10666
|
args.unshift("%O");
|
|
10652
10667
|
}
|
|
10653
10668
|
let index = 0;
|
|
10654
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (
|
|
10655
|
-
if (
|
|
10669
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match11, format) => {
|
|
10670
|
+
if (match11 === "%%") {
|
|
10656
10671
|
return "%";
|
|
10657
10672
|
}
|
|
10658
10673
|
index++;
|
|
10659
10674
|
const formatter = createDebug.formatters[format];
|
|
10660
10675
|
if (typeof formatter === "function") {
|
|
10661
10676
|
const val = args[index];
|
|
10662
|
-
|
|
10677
|
+
match11 = formatter.call(self2, val);
|
|
10663
10678
|
args.splice(index, 1);
|
|
10664
10679
|
index--;
|
|
10665
10680
|
}
|
|
10666
|
-
return
|
|
10681
|
+
return match11;
|
|
10667
10682
|
});
|
|
10668
10683
|
createDebug.formatArgs.call(self2, args);
|
|
10669
10684
|
const logFn = self2.log || createDebug.log;
|
|
@@ -10886,12 +10901,12 @@ var require_browser3 = __commonJS({
|
|
|
10886
10901
|
args.splice(1, 0, c, "color: inherit");
|
|
10887
10902
|
let index = 0;
|
|
10888
10903
|
let lastC = 0;
|
|
10889
|
-
args[0].replace(/%[a-zA-Z%]/g, (
|
|
10890
|
-
if (
|
|
10904
|
+
args[0].replace(/%[a-zA-Z%]/g, (match11) => {
|
|
10905
|
+
if (match11 === "%%") {
|
|
10891
10906
|
return;
|
|
10892
10907
|
}
|
|
10893
10908
|
index++;
|
|
10894
|
-
if (
|
|
10909
|
+
if (match11 === "%c") {
|
|
10895
10910
|
lastC = index;
|
|
10896
10911
|
}
|
|
10897
10912
|
});
|
|
@@ -18246,19 +18261,19 @@ var require_common4 = __commonJS({
|
|
|
18246
18261
|
args.unshift("%O");
|
|
18247
18262
|
}
|
|
18248
18263
|
let index = 0;
|
|
18249
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (
|
|
18250
|
-
if (
|
|
18264
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match11, format) => {
|
|
18265
|
+
if (match11 === "%%") {
|
|
18251
18266
|
return "%";
|
|
18252
18267
|
}
|
|
18253
18268
|
index++;
|
|
18254
18269
|
const formatter = createDebug.formatters[format];
|
|
18255
18270
|
if (typeof formatter === "function") {
|
|
18256
18271
|
const val = args[index];
|
|
18257
|
-
|
|
18272
|
+
match11 = formatter.call(self2, val);
|
|
18258
18273
|
args.splice(index, 1);
|
|
18259
18274
|
index--;
|
|
18260
18275
|
}
|
|
18261
|
-
return
|
|
18276
|
+
return match11;
|
|
18262
18277
|
});
|
|
18263
18278
|
createDebug.formatArgs.call(self2, args);
|
|
18264
18279
|
const logFn = self2.log || createDebug.log;
|
|
@@ -18481,12 +18496,12 @@ var require_browser4 = __commonJS({
|
|
|
18481
18496
|
args.splice(1, 0, c, "color: inherit");
|
|
18482
18497
|
let index = 0;
|
|
18483
18498
|
let lastC = 0;
|
|
18484
|
-
args[0].replace(/%[a-zA-Z%]/g, (
|
|
18485
|
-
if (
|
|
18499
|
+
args[0].replace(/%[a-zA-Z%]/g, (match11) => {
|
|
18500
|
+
if (match11 === "%%") {
|
|
18486
18501
|
return;
|
|
18487
18502
|
}
|
|
18488
18503
|
index++;
|
|
18489
|
-
if (
|
|
18504
|
+
if (match11 === "%c") {
|
|
18490
18505
|
lastC = index;
|
|
18491
18506
|
}
|
|
18492
18507
|
});
|
|
@@ -22551,19 +22566,19 @@ var require_common5 = __commonJS({
|
|
|
22551
22566
|
args.unshift("%O");
|
|
22552
22567
|
}
|
|
22553
22568
|
let index = 0;
|
|
22554
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (
|
|
22555
|
-
if (
|
|
22569
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match11, format) => {
|
|
22570
|
+
if (match11 === "%%") {
|
|
22556
22571
|
return "%";
|
|
22557
22572
|
}
|
|
22558
22573
|
index++;
|
|
22559
22574
|
const formatter = createDebug.formatters[format];
|
|
22560
22575
|
if (typeof formatter === "function") {
|
|
22561
22576
|
const val = args[index];
|
|
22562
|
-
|
|
22577
|
+
match11 = formatter.call(self2, val);
|
|
22563
22578
|
args.splice(index, 1);
|
|
22564
22579
|
index--;
|
|
22565
22580
|
}
|
|
22566
|
-
return
|
|
22581
|
+
return match11;
|
|
22567
22582
|
});
|
|
22568
22583
|
createDebug.formatArgs.call(self2, args);
|
|
22569
22584
|
const logFn = self2.log || createDebug.log;
|
|
@@ -22786,12 +22801,12 @@ var require_browser5 = __commonJS({
|
|
|
22786
22801
|
args.splice(1, 0, c, "color: inherit");
|
|
22787
22802
|
let index = 0;
|
|
22788
22803
|
let lastC = 0;
|
|
22789
|
-
args[0].replace(/%[a-zA-Z%]/g, (
|
|
22790
|
-
if (
|
|
22804
|
+
args[0].replace(/%[a-zA-Z%]/g, (match11) => {
|
|
22805
|
+
if (match11 === "%%") {
|
|
22791
22806
|
return;
|
|
22792
22807
|
}
|
|
22793
22808
|
index++;
|
|
22794
|
-
if (
|
|
22809
|
+
if (match11 === "%c") {
|
|
22795
22810
|
lastC = index;
|
|
22796
22811
|
}
|
|
22797
22812
|
});
|
|
@@ -28296,6 +28311,14 @@ function useDevEnvironment() {
|
|
|
28296
28311
|
return context;
|
|
28297
28312
|
}
|
|
28298
28313
|
|
|
28314
|
+
// src/site/SiteProvider.tsx
|
|
28315
|
+
init_esm_shims();
|
|
28316
|
+
var import_react25 = __toESM(require_react(), 1);
|
|
28317
|
+
var import_variant13 = __toESM(require_lib(), 1);
|
|
28318
|
+
|
|
28319
|
+
// ../site-list-client/src/index.ts
|
|
28320
|
+
init_esm_shims();
|
|
28321
|
+
|
|
28299
28322
|
// ../site-list-client/src/site-list-client.ts
|
|
28300
28323
|
init_esm_shims();
|
|
28301
28324
|
|
|
@@ -28482,16 +28505,443 @@ function useSiteListClient() {
|
|
|
28482
28505
|
return (0, import_react15.useMemo)(() => new SiteListClient(httpClient), [httpClient]);
|
|
28483
28506
|
}
|
|
28484
28507
|
|
|
28485
|
-
//
|
|
28508
|
+
// src/site/ResolveSite.tsx
|
|
28486
28509
|
init_esm_shims();
|
|
28510
|
+
var import_react24 = __toESM(require_react(), 1);
|
|
28511
|
+
var import_variant11 = __toESM(require_lib(), 1);
|
|
28487
28512
|
|
|
28488
|
-
// src/
|
|
28513
|
+
// ../cli-site-selector/src/index.ts
|
|
28489
28514
|
init_esm_shims();
|
|
28515
|
+
|
|
28516
|
+
// ../cli-site-selector/src/SiteSelector.tsx
|
|
28517
|
+
init_esm_shims();
|
|
28518
|
+
var import_react23 = __toESM(require_react(), 1);
|
|
28519
|
+
var import_variant10 = __toESM(require_lib(), 1);
|
|
28520
|
+
|
|
28521
|
+
// ../cli-site-selector/src/SiteTypeSelect.tsx
|
|
28522
|
+
init_esm_shims();
|
|
28523
|
+
var import_react17 = __toESM(require_react(), 1);
|
|
28490
28524
|
var import_variant6 = __toESM(require_lib(), 1);
|
|
28491
|
-
|
|
28525
|
+
|
|
28526
|
+
// ../cli-site-selector/src/bi.ts
|
|
28527
|
+
init_esm_shims();
|
|
28528
|
+
var import_react16 = __toESM(require_react(), 1);
|
|
28529
|
+
function siteSelectorBiEvents(biLogger) {
|
|
28530
|
+
return {
|
|
28531
|
+
cliAction: ({
|
|
28532
|
+
question,
|
|
28533
|
+
action,
|
|
28534
|
+
key,
|
|
28535
|
+
additionalInfo
|
|
28536
|
+
}) => {
|
|
28537
|
+
void biLogger.report(
|
|
28538
|
+
wixCliAction({
|
|
28539
|
+
question,
|
|
28540
|
+
action,
|
|
28541
|
+
key,
|
|
28542
|
+
additionalInfo: JSON.stringify(additionalInfo)
|
|
28543
|
+
})
|
|
28544
|
+
);
|
|
28545
|
+
},
|
|
28546
|
+
cliFlowStepAnswered: ({
|
|
28547
|
+
question,
|
|
28548
|
+
answer,
|
|
28549
|
+
additionalInfo
|
|
28550
|
+
}) => {
|
|
28551
|
+
void biLogger.report(
|
|
28552
|
+
wixCliAppFlowStepsAnswers({
|
|
28553
|
+
question,
|
|
28554
|
+
answer,
|
|
28555
|
+
additionalInfo: JSON.stringify(additionalInfo)
|
|
28556
|
+
})
|
|
28557
|
+
);
|
|
28558
|
+
}
|
|
28559
|
+
};
|
|
28560
|
+
}
|
|
28561
|
+
function useSiteSelectorBi() {
|
|
28562
|
+
const biLogger = useBiLogger();
|
|
28563
|
+
return (0, import_react16.useMemo)(() => siteSelectorBiEvents(biLogger), [biLogger]);
|
|
28564
|
+
}
|
|
28565
|
+
|
|
28566
|
+
// ../cli-site-selector/src/SiteTypeSelect.tsx
|
|
28567
|
+
var SiteTypeSelect = ({ onSubmit, onError, sites }) => {
|
|
28568
|
+
const bi = useSiteSelectorBi();
|
|
28569
|
+
const { t } = useTranslation();
|
|
28570
|
+
const { getDevSitesCount, getDevSitesLimit } = useDevCenterClient();
|
|
28571
|
+
const { status } = useAsync(
|
|
28572
|
+
() => Promise.all([getDevSitesCount(), getDevSitesLimit()]),
|
|
28573
|
+
[],
|
|
28574
|
+
{ onError }
|
|
28575
|
+
);
|
|
28576
|
+
const handleSubmit = (option) => {
|
|
28577
|
+
void bi.cliFlowStepAnswered({
|
|
28578
|
+
question: t("site_type_select.label"),
|
|
28579
|
+
answer: option.title
|
|
28580
|
+
});
|
|
28581
|
+
onSubmit(option.value);
|
|
28582
|
+
};
|
|
28583
|
+
return (0, import_variant6.match)(status, {
|
|
28584
|
+
Error: () => null,
|
|
28585
|
+
Loading: () => /* @__PURE__ */ import_react17.default.createElement(Spinner, { text: t("general.loading") }),
|
|
28586
|
+
Success: ({ result: [devSitesCount, devSitesLimit] }) => {
|
|
28587
|
+
const isDevSitesLimitReached = devSitesCount >= devSitesLimit;
|
|
28588
|
+
const userHasNoSites = sites.length === 0;
|
|
28589
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
28590
|
+
SelectInput,
|
|
28591
|
+
{
|
|
28592
|
+
label: t("site_type_select.label"),
|
|
28593
|
+
options: [
|
|
28594
|
+
{
|
|
28595
|
+
availability: userHasNoSites ? SelectOptionAvailability.Disabled({
|
|
28596
|
+
reason: t("site_type_select.no_sites")
|
|
28597
|
+
}) : SelectOptionAvailability.Enabled(),
|
|
28598
|
+
title: t("site_type_select.pick_existing_site"),
|
|
28599
|
+
value: "select-existing-site"
|
|
28600
|
+
},
|
|
28601
|
+
{
|
|
28602
|
+
title: t("site_type_select.create_new_dev_site"),
|
|
28603
|
+
value: "create-dev-site",
|
|
28604
|
+
availability: isDevSitesLimitReached ? SelectOptionAvailability.Disabled({
|
|
28605
|
+
reason: t("site_type_select.create_new_dev_site.disabled", {
|
|
28606
|
+
limit: devSitesLimit
|
|
28607
|
+
})
|
|
28608
|
+
}) : SelectOptionAvailability.Enabled()
|
|
28609
|
+
}
|
|
28610
|
+
],
|
|
28611
|
+
onSubmit: handleSubmit
|
|
28612
|
+
}
|
|
28613
|
+
);
|
|
28614
|
+
}
|
|
28615
|
+
});
|
|
28616
|
+
};
|
|
28617
|
+
|
|
28618
|
+
// ../cli-site-selector/src/CreateDevSite.tsx
|
|
28619
|
+
init_esm_shims();
|
|
28620
|
+
var import_react20 = __toESM(require_react(), 1);
|
|
28621
|
+
var import_variant8 = __toESM(require_lib(), 1);
|
|
28622
|
+
|
|
28623
|
+
// ../cli-site-selector/src/WaitForAppToBeInstalled.tsx
|
|
28624
|
+
init_esm_shims();
|
|
28625
|
+
var import_react19 = __toESM(require_react(), 1);
|
|
28626
|
+
var import_variant7 = __toESM(require_lib(), 1);
|
|
28627
|
+
|
|
28628
|
+
// ../cli-site-selector/src/OpenBrowser.tsx
|
|
28629
|
+
init_esm_shims();
|
|
28630
|
+
var import_react18 = __toESM(require_react(), 1);
|
|
28631
|
+
var OpenBrowser = ({ siteId, appId }) => {
|
|
28632
|
+
const { t } = useTranslation();
|
|
28633
|
+
const bi = useSiteSelectorBi();
|
|
28634
|
+
use_input_default(async (input, key) => {
|
|
28635
|
+
if (key.return) {
|
|
28636
|
+
bi.cliAction({
|
|
28637
|
+
question: t("install_app_on_site.warning.instructions"),
|
|
28638
|
+
key: "enter",
|
|
28639
|
+
action: "install_app_on_site"
|
|
28640
|
+
});
|
|
28641
|
+
await openBrowser(
|
|
28642
|
+
`https://manage.wix.com/installer/install?metaSiteId=${siteId}&appId=${appId}&platform=cli&version=latest`
|
|
28643
|
+
);
|
|
28644
|
+
}
|
|
28645
|
+
});
|
|
28646
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement(Trans, { i18nKey: "install_app_on_site.warning" }), /* @__PURE__ */ import_react18.default.createElement(
|
|
28647
|
+
Trans,
|
|
28648
|
+
{
|
|
28649
|
+
i18nKey: "install_app_on_site.warning.instructions",
|
|
28650
|
+
components: [/* @__PURE__ */ import_react18.default.createElement(Key, { value: "Enter" })]
|
|
28651
|
+
}
|
|
28652
|
+
));
|
|
28653
|
+
};
|
|
28654
|
+
|
|
28655
|
+
// ../cli-site-selector/src/WaitForAppToBeInstalled.tsx
|
|
28656
|
+
var AppInstallData = (0, import_variant7.variant)({
|
|
28657
|
+
Success: {},
|
|
28658
|
+
Canceled: {}
|
|
28659
|
+
});
|
|
28660
|
+
function isAbortError(error) {
|
|
28661
|
+
return error && typeof error === "object" && "name" in error && error.name === "AbortError";
|
|
28662
|
+
}
|
|
28663
|
+
var WaitForAppToBeInstalled = ({
|
|
28664
|
+
appId,
|
|
28665
|
+
site,
|
|
28666
|
+
onSubmit,
|
|
28667
|
+
onError
|
|
28668
|
+
}) => {
|
|
28669
|
+
const { isAppInstalled } = useDevCenterClient();
|
|
28670
|
+
const { status } = useAsync(
|
|
28671
|
+
async ({ signal }) => {
|
|
28672
|
+
const { pollInterval } = getTestOverrides();
|
|
28673
|
+
try {
|
|
28674
|
+
await pWaitFor(() => isAppInstalled(appId), {
|
|
28675
|
+
// Polling interval is set to 6.5 seconds to avoid rate limiting (429)
|
|
28676
|
+
interval: pollInterval ?? 6500,
|
|
28677
|
+
timeout: {
|
|
28678
|
+
milliseconds: 60 * 1e3 * 2,
|
|
28679
|
+
signal
|
|
28680
|
+
}
|
|
28681
|
+
});
|
|
28682
|
+
return AppInstallData.Success();
|
|
28683
|
+
} catch (error) {
|
|
28684
|
+
if (error instanceof TimeoutError) {
|
|
28685
|
+
throw new CliError({
|
|
28686
|
+
code: CliErrorCode.SiteSelectorTimedout(),
|
|
28687
|
+
cause: error
|
|
28688
|
+
});
|
|
28689
|
+
}
|
|
28690
|
+
if (isAbortError(error)) {
|
|
28691
|
+
return AppInstallData.Canceled();
|
|
28692
|
+
}
|
|
28693
|
+
throw error;
|
|
28694
|
+
}
|
|
28695
|
+
},
|
|
28696
|
+
[],
|
|
28697
|
+
{
|
|
28698
|
+
onError,
|
|
28699
|
+
onSuccess: (result) => {
|
|
28700
|
+
if ((0, import_variant7.isType)(result, AppInstallData.Success)) {
|
|
28701
|
+
onSubmit();
|
|
28702
|
+
}
|
|
28703
|
+
}
|
|
28704
|
+
}
|
|
28705
|
+
);
|
|
28706
|
+
return (0, import_variant7.match)(status, {
|
|
28707
|
+
Error: () => null,
|
|
28708
|
+
Loading: () => /* @__PURE__ */ import_react19.default.createElement(OpenBrowser, { siteId: site.id, appId }),
|
|
28709
|
+
Success: () => /* @__PURE__ */ import_react19.default.createElement(Alert, { type: "success" }, /* @__PURE__ */ import_react19.default.createElement(Badge, { skin: "success" }, /* @__PURE__ */ import_react19.default.createElement(Trans, { i18nKey: "general.success" })), " ", /* @__PURE__ */ import_react19.default.createElement(Trans, { i18nKey: "install_app_on_site.finished_successfully" }))
|
|
28710
|
+
});
|
|
28711
|
+
};
|
|
28712
|
+
|
|
28713
|
+
// ../cli-site-selector/src/CreateDevSite.tsx
|
|
28714
|
+
var CreateDevSite = ({
|
|
28715
|
+
status,
|
|
28716
|
+
appId,
|
|
28717
|
+
onSubmit,
|
|
28718
|
+
onError
|
|
28719
|
+
}) => {
|
|
28720
|
+
const { t } = useTranslation();
|
|
28721
|
+
return (0, import_variant8.match)(status, {
|
|
28722
|
+
NotRequested: () => null,
|
|
28723
|
+
Error: () => null,
|
|
28724
|
+
Loading: () => /* @__PURE__ */ import_react20.default.createElement(Spinner, { text: t("create_dev_site.loading") }),
|
|
28725
|
+
Success: ({ result }) => /* @__PURE__ */ import_react20.default.createElement(import_react20.default.Fragment, null, /* @__PURE__ */ import_react20.default.createElement(
|
|
28726
|
+
Trans,
|
|
28727
|
+
{
|
|
28728
|
+
i18nKey: "create_dev_site.success",
|
|
28729
|
+
components: [/* @__PURE__ */ import_react20.default.createElement(Text, { skin: "success", bold: true })],
|
|
28730
|
+
values: { name: result.displayName }
|
|
28731
|
+
}
|
|
28732
|
+
), /* @__PURE__ */ import_react20.default.createElement(SiteAuthProvider, { siteId: result.id }, /* @__PURE__ */ import_react20.default.createElement(
|
|
28733
|
+
WaitForAppToBeInstalled,
|
|
28734
|
+
{
|
|
28735
|
+
appId,
|
|
28736
|
+
site: result,
|
|
28737
|
+
onSubmit: () => onSubmit(result),
|
|
28738
|
+
onError
|
|
28739
|
+
}
|
|
28740
|
+
)))
|
|
28741
|
+
});
|
|
28742
|
+
};
|
|
28743
|
+
|
|
28744
|
+
// ../cli-site-selector/src/SelectExistingSite.tsx
|
|
28745
|
+
init_esm_shims();
|
|
28746
|
+
var import_react22 = __toESM(require_react(), 1);
|
|
28747
|
+
var import_variant9 = __toESM(require_lib(), 1);
|
|
28748
|
+
|
|
28749
|
+
// ../cli-site-selector/src/SiteListSelect.tsx
|
|
28750
|
+
init_esm_shims();
|
|
28751
|
+
var import_react21 = __toESM(require_react(), 1);
|
|
28752
|
+
var SiteListSelect = ({ onSubmit, sites }) => {
|
|
28753
|
+
const { t } = useTranslation();
|
|
28754
|
+
const bi = useSiteSelectorBi();
|
|
28755
|
+
const handleSubmit = (0, import_react21.useCallback)(
|
|
28756
|
+
(option) => {
|
|
28757
|
+
bi.cliFlowStepAnswered({
|
|
28758
|
+
question: t("site_list_select.label"),
|
|
28759
|
+
answer: option.title
|
|
28760
|
+
});
|
|
28761
|
+
onSubmit(option.value);
|
|
28762
|
+
},
|
|
28763
|
+
[bi, onSubmit, t]
|
|
28764
|
+
);
|
|
28765
|
+
return /* @__PURE__ */ import_react21.default.createElement(
|
|
28766
|
+
SelectInput,
|
|
28767
|
+
{
|
|
28768
|
+
label: t("site_list_select.label"),
|
|
28769
|
+
options: sites.map((site) => ({
|
|
28770
|
+
key: site.id,
|
|
28771
|
+
title: site.displayName,
|
|
28772
|
+
description: site.viewUrl,
|
|
28773
|
+
value: site
|
|
28774
|
+
})),
|
|
28775
|
+
onSubmit: handleSubmit
|
|
28776
|
+
}
|
|
28777
|
+
);
|
|
28778
|
+
};
|
|
28779
|
+
|
|
28780
|
+
// ../cli-site-selector/src/SelectExistingSite.tsx
|
|
28781
|
+
var CheckAppInstalledOnSite = ({ appId, site, onSubmit, onError }) => {
|
|
28782
|
+
const { t } = useTranslation();
|
|
28783
|
+
const { isAppInstalled } = useDevCenterClient();
|
|
28784
|
+
const { status } = useAsync(async () => isAppInstalled(appId), [], {
|
|
28785
|
+
onError,
|
|
28786
|
+
onSuccess: (isInstalled) => {
|
|
28787
|
+
if (isInstalled) {
|
|
28788
|
+
onSubmit(site);
|
|
28789
|
+
}
|
|
28790
|
+
}
|
|
28791
|
+
});
|
|
28792
|
+
return (0, import_variant9.match)(status, {
|
|
28793
|
+
Error: () => null,
|
|
28794
|
+
Loading: () => /* @__PURE__ */ import_react22.default.createElement(Spinner, { text: t("general.loading") }),
|
|
28795
|
+
Success: ({ result: isInstalled }) => {
|
|
28796
|
+
if (isInstalled) {
|
|
28797
|
+
return null;
|
|
28798
|
+
}
|
|
28799
|
+
return /* @__PURE__ */ import_react22.default.createElement(
|
|
28800
|
+
WaitForAppToBeInstalled,
|
|
28801
|
+
{
|
|
28802
|
+
appId,
|
|
28803
|
+
site,
|
|
28804
|
+
onSubmit: () => onSubmit(site),
|
|
28805
|
+
onError
|
|
28806
|
+
}
|
|
28807
|
+
);
|
|
28808
|
+
}
|
|
28809
|
+
});
|
|
28810
|
+
};
|
|
28811
|
+
var SelectExistingSite = ({
|
|
28812
|
+
sites,
|
|
28813
|
+
appId,
|
|
28814
|
+
onSubmit,
|
|
28815
|
+
onError
|
|
28816
|
+
}) => {
|
|
28817
|
+
const [siteToInstallAppOn, setSiteToInstallAppOn] = (0, import_react22.useState)(
|
|
28818
|
+
null
|
|
28819
|
+
);
|
|
28820
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, /* @__PURE__ */ import_react22.default.createElement(
|
|
28821
|
+
SiteListSelect,
|
|
28822
|
+
{
|
|
28823
|
+
onSubmit: (site) => setSiteToInstallAppOn(site),
|
|
28824
|
+
sites
|
|
28825
|
+
}
|
|
28826
|
+
), siteToInstallAppOn && /* @__PURE__ */ import_react22.default.createElement(SiteAuthProvider, { siteId: siteToInstallAppOn.id }, /* @__PURE__ */ import_react22.default.createElement(
|
|
28827
|
+
CheckAppInstalledOnSite,
|
|
28828
|
+
{
|
|
28829
|
+
appId,
|
|
28830
|
+
site: siteToInstallAppOn,
|
|
28831
|
+
onSubmit: () => onSubmit(siteToInstallAppOn),
|
|
28832
|
+
onError
|
|
28833
|
+
}
|
|
28834
|
+
)));
|
|
28835
|
+
};
|
|
28836
|
+
|
|
28837
|
+
// ../cli-site-selector/src/messages.json
|
|
28838
|
+
var messages_default = {
|
|
28839
|
+
"general.loading": "Loading...",
|
|
28840
|
+
"general.success": "Success",
|
|
28841
|
+
"site_type_select.label": "Select Development Site",
|
|
28842
|
+
"site_type_select.create_new_dev_site": "Create a new Development Site",
|
|
28843
|
+
"site_type_select.create_new_dev_site.disabled": "You have reached the maximum number of {limit} Development Sites",
|
|
28844
|
+
"site_type_select.pick_existing_site": "Pick an existing site",
|
|
28845
|
+
"site_type_select.no_sites": "No sites found",
|
|
28846
|
+
"create_dev_site.loading": "Creating your new Development Site...",
|
|
28847
|
+
"create_dev_site.success": "Development Site <0>{name}</0> created successfully! \u{1F680}",
|
|
28848
|
+
"site_list_select.label": "Select Site",
|
|
28849
|
+
"install_app_on_site.warning": "Your new application needs to be installed on the selected Development Site",
|
|
28850
|
+
"install_app_on_site.warning.instructions": "Press <0/> to install the application in your browser",
|
|
28851
|
+
"install_app_on_site.finished_successfully": "App installed on Development Site."
|
|
28852
|
+
};
|
|
28853
|
+
|
|
28854
|
+
// ../cli-site-selector/src/SiteSelector.tsx
|
|
28855
|
+
var SiteSelector = ({
|
|
28856
|
+
appId,
|
|
28857
|
+
biLogger,
|
|
28858
|
+
onSubmit,
|
|
28859
|
+
onError
|
|
28860
|
+
}) => {
|
|
28861
|
+
const [siteType, setSiteType] = (0, import_react23.useState)(null);
|
|
28862
|
+
const { createDevSite } = useDevCenterClient();
|
|
28863
|
+
const siteListClient = useSiteListClient();
|
|
28864
|
+
const { status } = useAsync(
|
|
28865
|
+
() => siteListClient.querySites({
|
|
28866
|
+
query: {
|
|
28867
|
+
cursorPaging: {
|
|
28868
|
+
limit: 100
|
|
28869
|
+
}
|
|
28870
|
+
}
|
|
28871
|
+
}),
|
|
28872
|
+
[],
|
|
28873
|
+
{
|
|
28874
|
+
onError
|
|
28875
|
+
}
|
|
28876
|
+
);
|
|
28877
|
+
const createSite = useAsyncCallback(() => createDevSite(), {
|
|
28878
|
+
onError
|
|
28879
|
+
});
|
|
28880
|
+
function handleSelectSiteType(siteType2) {
|
|
28881
|
+
setSiteType(siteType2);
|
|
28882
|
+
if (siteType2 === "create-dev-site") {
|
|
28883
|
+
void createSite.execute();
|
|
28884
|
+
}
|
|
28885
|
+
}
|
|
28886
|
+
return /* @__PURE__ */ import_react23.default.createElement(BiProvider, { value: biLogger }, /* @__PURE__ */ import_react23.default.createElement(I18nProvider, { messages: messages_default }, (0, import_variant10.match)(status, {
|
|
28887
|
+
Error: () => null,
|
|
28888
|
+
Loading: () => /* @__PURE__ */ import_react23.default.createElement(Spinner, { text: /* @__PURE__ */ import_react23.default.createElement(Trans, { i18nKey: "general.loading" }) }),
|
|
28889
|
+
Success: ({ result: sites }) => /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, /* @__PURE__ */ import_react23.default.createElement(
|
|
28890
|
+
SiteTypeSelect,
|
|
28891
|
+
{
|
|
28892
|
+
onSubmit: handleSelectSiteType,
|
|
28893
|
+
onError,
|
|
28894
|
+
sites
|
|
28895
|
+
}
|
|
28896
|
+
), siteType === "create-dev-site" && /* @__PURE__ */ import_react23.default.createElement(
|
|
28897
|
+
CreateDevSite,
|
|
28898
|
+
{
|
|
28899
|
+
status: createSite.status,
|
|
28900
|
+
appId,
|
|
28901
|
+
onSubmit,
|
|
28902
|
+
onError
|
|
28903
|
+
}
|
|
28904
|
+
), siteType === "select-existing-site" && /* @__PURE__ */ import_react23.default.createElement(
|
|
28905
|
+
SelectExistingSite,
|
|
28906
|
+
{
|
|
28907
|
+
sites,
|
|
28908
|
+
appId,
|
|
28909
|
+
onSubmit,
|
|
28910
|
+
onError
|
|
28911
|
+
}
|
|
28912
|
+
))
|
|
28913
|
+
})));
|
|
28914
|
+
};
|
|
28915
|
+
|
|
28916
|
+
// src/site/ResolveSite.tsx
|
|
28917
|
+
var ResolveSite = ({ state, onSubmit }) => {
|
|
28918
|
+
const exit = useExit();
|
|
28919
|
+
const { t } = useTranslation();
|
|
28920
|
+
const { model } = useProjectModel();
|
|
28921
|
+
const biLogger = useBiLogger();
|
|
28922
|
+
return /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, null, (0, import_variant11.match)(state, {
|
|
28923
|
+
NotConfigured: (0, import_variant11.constant)(
|
|
28924
|
+
/* @__PURE__ */ import_react24.default.createElement(Alert, { type: "insight" }, t("general.no_site_id_configured"))
|
|
28925
|
+
),
|
|
28926
|
+
NotFound: ({ id }) => /* @__PURE__ */ import_react24.default.createElement(Alert, { type: "error" }, t("general.site_id_not_found", { id }))
|
|
28927
|
+
}), /* @__PURE__ */ import_react24.default.createElement(
|
|
28928
|
+
SiteSelector,
|
|
28929
|
+
{
|
|
28930
|
+
appId: model.config.appId,
|
|
28931
|
+
biLogger,
|
|
28932
|
+
onSubmit,
|
|
28933
|
+
onError: exit
|
|
28934
|
+
}
|
|
28935
|
+
));
|
|
28936
|
+
};
|
|
28937
|
+
|
|
28938
|
+
// src/site/site-state.ts
|
|
28939
|
+
init_esm_shims();
|
|
28940
|
+
var import_variant12 = __toESM(require_lib(), 1);
|
|
28941
|
+
var SiteState = (0, import_variant12.variant)({
|
|
28492
28942
|
NotConfigured: {},
|
|
28493
|
-
NotFound: (0,
|
|
28494
|
-
Resolved: (0,
|
|
28943
|
+
NotFound: (0, import_variant12.fields)(),
|
|
28944
|
+
Resolved: (0, import_variant12.fields)()
|
|
28495
28945
|
});
|
|
28496
28946
|
|
|
28497
28947
|
// src/site/resolve-configured-site.ts
|
|
@@ -28513,13 +28963,76 @@ async function resolveConfiguredSite({
|
|
|
28513
28963
|
return SiteState.Resolved({ site });
|
|
28514
28964
|
}
|
|
28515
28965
|
|
|
28966
|
+
// src/site/SiteProvider.tsx
|
|
28967
|
+
var SiteProvider = ({ children, siteId }) => {
|
|
28968
|
+
const exit = useExit();
|
|
28969
|
+
const {
|
|
28970
|
+
model: { projectFolder }
|
|
28971
|
+
} = useProjectModel();
|
|
28972
|
+
const writeDebugLog = useDebugLog();
|
|
28973
|
+
const siteListClient = useSiteListClient();
|
|
28974
|
+
const { t } = useTranslation();
|
|
28975
|
+
const { status, merge } = useAsync(
|
|
28976
|
+
async () => resolveConfiguredSite({
|
|
28977
|
+
projectFolder,
|
|
28978
|
+
siteListClient,
|
|
28979
|
+
siteId,
|
|
28980
|
+
writeDebugLog
|
|
28981
|
+
}),
|
|
28982
|
+
[]
|
|
28983
|
+
);
|
|
28984
|
+
const setSite = (0, import_react25.useCallback)(
|
|
28985
|
+
async (site) => {
|
|
28986
|
+
try {
|
|
28987
|
+
await saveAppConfig(projectFolder, { siteId: site.id });
|
|
28988
|
+
merge({ result: SiteState.Resolved({ site }) });
|
|
28989
|
+
} catch (e) {
|
|
28990
|
+
throw new CliError({
|
|
28991
|
+
code: CliErrorCode.FailedToSaveDevelopmentSite({
|
|
28992
|
+
path: APP_CONFIG_PATH
|
|
28993
|
+
}),
|
|
28994
|
+
cause: e
|
|
28995
|
+
});
|
|
28996
|
+
}
|
|
28997
|
+
},
|
|
28998
|
+
[merge, projectFolder]
|
|
28999
|
+
);
|
|
29000
|
+
const handleResolveSite = (0, import_react25.useCallback)(
|
|
29001
|
+
(site) => setSite(site).catch(exit),
|
|
29002
|
+
[exit, setSite]
|
|
29003
|
+
);
|
|
29004
|
+
return (0, import_variant13.match)(status, {
|
|
29005
|
+
Error: () => null,
|
|
29006
|
+
Loading: () => /* @__PURE__ */ import_react25.default.createElement(Spinner, { text: t("dev_command.site_provider.loading") }),
|
|
29007
|
+
Success: ({ result: state }) => {
|
|
29008
|
+
return (0, import_variant13.match)(state, {
|
|
29009
|
+
NotConfigured: (variant4) => /* @__PURE__ */ import_react25.default.createElement(ResolveSite, { state: variant4, onSubmit: handleResolveSite }),
|
|
29010
|
+
NotFound: (variant4) => /* @__PURE__ */ import_react25.default.createElement(ResolveSite, { state: variant4, onSubmit: handleResolveSite }),
|
|
29011
|
+
Resolved: ({ site }) => /* @__PURE__ */ import_react25.default.createElement(
|
|
29012
|
+
SiteContext.Provider,
|
|
29013
|
+
{
|
|
29014
|
+
value: {
|
|
29015
|
+
site,
|
|
29016
|
+
setSite
|
|
29017
|
+
}
|
|
29018
|
+
},
|
|
29019
|
+
typeof children === "function" ? children(site) : children
|
|
29020
|
+
)
|
|
29021
|
+
});
|
|
29022
|
+
}
|
|
29023
|
+
});
|
|
29024
|
+
};
|
|
29025
|
+
|
|
29026
|
+
// src/site/index.ts
|
|
29027
|
+
init_esm_shims();
|
|
29028
|
+
|
|
28516
29029
|
// src/components/extensions/utils.tsx
|
|
28517
29030
|
init_esm_shims();
|
|
28518
|
-
var
|
|
28519
|
-
var
|
|
29031
|
+
var import_react26 = __toESM(require_react(), 1);
|
|
29032
|
+
var import_variant14 = __toESM(require_lib(), 1);
|
|
28520
29033
|
import { URL as URL2 } from "node:url";
|
|
28521
29034
|
var redirectWithCSMv2FTs = (url2, platformType) => {
|
|
28522
|
-
const elgarBaseURL = (0,
|
|
29035
|
+
const elgarBaseURL = (0, import_variant14.isType)(platformType, PlatformType.Site) ? `${url2.origin}/_api` : "https://apps.wix.com";
|
|
28523
29036
|
const elgarRedirectUrl = new URL2(`${elgarBaseURL}/elgar-server/redirect`);
|
|
28524
29037
|
const petriOvr = [
|
|
28525
29038
|
// TODO: Remove once Dev Versions effort is done https://wix.atlassian.net/browse/FEDINF-13336
|
|
@@ -28552,7 +29065,7 @@ function useResolvePlatformUrl() {
|
|
|
28552
29065
|
const { site } = useSite();
|
|
28553
29066
|
const { armTag } = useArmTag();
|
|
28554
29067
|
const { siteOverrideId } = useSiteOverrideId();
|
|
28555
|
-
return (0,
|
|
29068
|
+
return (0, import_react26.useCallback)(
|
|
28556
29069
|
(platformType) => {
|
|
28557
29070
|
return resolvePlatformUrl(platformType, {
|
|
28558
29071
|
site,
|
|
@@ -28567,7 +29080,7 @@ function useResolvePlatformUrl() {
|
|
|
28567
29080
|
function useResolvePlatformDevUrl() {
|
|
28568
29081
|
const resolvePlatformUrl2 = useResolvePlatformUrl();
|
|
28569
29082
|
const { https, clientDevServerUrl } = useDevEnvironment();
|
|
28570
|
-
return (0,
|
|
29083
|
+
return (0, import_react26.useCallback)(
|
|
28571
29084
|
(platformType) => {
|
|
28572
29085
|
let url2 = resolvePlatformUrl2(platformType);
|
|
28573
29086
|
if (https) {
|
|
@@ -28580,7 +29093,7 @@ function useResolvePlatformDevUrl() {
|
|
|
28580
29093
|
}
|
|
28581
29094
|
function resolvePlatformUrl(platformType, options) {
|
|
28582
29095
|
const { site, tag, siteOverrideId } = options;
|
|
28583
|
-
const url2 = (0,
|
|
29096
|
+
const url2 = (0, import_variant14.match)(platformType, {
|
|
28584
29097
|
Dashboard: () => new URL2(`dashboard/${site.id}`, "https://manage.wix.com/"),
|
|
28585
29098
|
Editor: () => new URL2(`https://wix.com/editor/${site.id}`),
|
|
28586
29099
|
Site: () => {
|
|
@@ -28593,9 +29106,9 @@ function resolvePlatformUrl(platformType, options) {
|
|
|
28593
29106
|
Blocks: () => new URL2(`https://wix.com/editor/${site.id}`)
|
|
28594
29107
|
});
|
|
28595
29108
|
url2.searchParams.append("apps-override", tag);
|
|
28596
|
-
return (0,
|
|
29109
|
+
return (0, import_variant14.isOfVariant)(
|
|
28597
29110
|
platformType,
|
|
28598
|
-
(0,
|
|
29111
|
+
(0, import_variant14.variantList)([PlatformType.Editor, PlatformType.Site])
|
|
28599
29112
|
) ? redirectWithCSMv2FTs(url2, platformType).toString() : url2.toString();
|
|
28600
29113
|
}
|
|
28601
29114
|
function useResolveDashboardExtensionUrl() {
|
|
@@ -28603,7 +29116,7 @@ function useResolveDashboardExtensionUrl() {
|
|
|
28603
29116
|
const { site } = useSite();
|
|
28604
29117
|
const { armTag } = useArmTag();
|
|
28605
29118
|
const { siteOverrideId } = useSiteOverrideId();
|
|
28606
|
-
return (0,
|
|
29119
|
+
return (0, import_react26.useCallback)(
|
|
28607
29120
|
(extension) => {
|
|
28608
29121
|
return resolveDashboardExtensionUrl(extension, {
|
|
28609
29122
|
site,
|
|
@@ -28618,7 +29131,7 @@ function useResolveDashboardExtensionUrl() {
|
|
|
28618
29131
|
function useResolveDashboardExtensionDevUrl() {
|
|
28619
29132
|
const resolveDashboardExtensionUrl2 = useResolveDashboardExtensionUrl();
|
|
28620
29133
|
const { https, clientDevServerUrl } = useDevEnvironment();
|
|
28621
|
-
return (0,
|
|
29134
|
+
return (0, import_react26.useCallback)(
|
|
28622
29135
|
(extension) => {
|
|
28623
29136
|
let url2 = resolveDashboardExtensionUrl2(extension);
|
|
28624
29137
|
if (https) {
|
|
@@ -28639,7 +29152,7 @@ function useResolveBlocksEditorURL() {
|
|
|
28639
29152
|
const { model } = useProjectModel();
|
|
28640
29153
|
const { enabled: cliBlocksServerEnabled, port: cliBlocksServerPort } = useBlocksCLIDevServerProvider();
|
|
28641
29154
|
const { https, clientDevServerUrl } = useDevEnvironment();
|
|
28642
|
-
return (0,
|
|
29155
|
+
return (0, import_react26.useCallback)(() => {
|
|
28643
29156
|
if (!cliBlocksServerEnabled || !cliBlocksServerPort) {
|
|
28644
29157
|
throw new Error("Blocks CLI Server is not running");
|
|
28645
29158
|
}
|
|
@@ -28661,7 +29174,7 @@ function useResolveBlocksEditorURL() {
|
|
|
28661
29174
|
}
|
|
28662
29175
|
function resolveDashboardExtensionUrl(extension, options) {
|
|
28663
29176
|
const { appId, site, tag } = options;
|
|
28664
|
-
const url2 = (0,
|
|
29177
|
+
const url2 = (0, import_variant14.matcher)(extension).with({
|
|
28665
29178
|
DashboardPage: () => new URL2(
|
|
28666
29179
|
`dashboard/${site.id}/app/${appId}${extension.route}`,
|
|
28667
29180
|
"https://manage.wix.com/"
|
|
@@ -28678,20 +29191,20 @@ function resolveDashboardExtensionUrl(extension, options) {
|
|
|
28678
29191
|
}
|
|
28679
29192
|
var useOpenPage = () => {
|
|
28680
29193
|
const { logger } = useDevEnvironment();
|
|
28681
|
-
return (0,
|
|
29194
|
+
return (0, import_react26.useCallback)(
|
|
28682
29195
|
async ({ url: url2, title }) => {
|
|
28683
29196
|
try {
|
|
28684
29197
|
await openBrowser(url2);
|
|
28685
29198
|
} catch {
|
|
28686
29199
|
logger.error(
|
|
28687
|
-
/* @__PURE__ */
|
|
29200
|
+
/* @__PURE__ */ import_react26.default.createElement(Alert, { type: "error" }, /* @__PURE__ */ import_react26.default.createElement(
|
|
28688
29201
|
Trans,
|
|
28689
29202
|
{
|
|
28690
29203
|
i18nKey: "general.open_page_error",
|
|
28691
|
-
components: [/* @__PURE__ */
|
|
29204
|
+
components: [/* @__PURE__ */ import_react26.default.createElement(Text, { bold: true })],
|
|
28692
29205
|
values: { title }
|
|
28693
29206
|
}
|
|
28694
|
-
), /* @__PURE__ */
|
|
29207
|
+
), /* @__PURE__ */ import_react26.default.createElement(Newline, null), /* @__PURE__ */ import_react26.default.createElement(Link, { url: url2 }))
|
|
28695
29208
|
);
|
|
28696
29209
|
}
|
|
28697
29210
|
},
|
|
@@ -28699,13 +29212,33 @@ var useOpenPage = () => {
|
|
|
28699
29212
|
);
|
|
28700
29213
|
};
|
|
28701
29214
|
|
|
29215
|
+
// src/components/Platform/usePlatform.tsx
|
|
29216
|
+
init_esm_shims();
|
|
29217
|
+
var import_react27 = __toESM(require_react(), 1);
|
|
29218
|
+
var import_variant15 = __toESM(require_lib(), 1);
|
|
29219
|
+
function usePlatform() {
|
|
29220
|
+
const { model } = useProjectModel();
|
|
29221
|
+
const isPlatformExists = (0, import_react27.useCallback)(
|
|
29222
|
+
(platformType) => model.components.some(
|
|
29223
|
+
(component) => component.platforms.some((0, import_variant15.isType)(platformType.type))
|
|
29224
|
+
),
|
|
29225
|
+
[model.components]
|
|
29226
|
+
);
|
|
29227
|
+
const hasSinglePlatform = (0, import_react27.useCallback)(
|
|
29228
|
+
(platformType) => model.components.every(
|
|
29229
|
+
(component) => component.platforms.some((0, import_variant15.isType)(platformType.type)) || component.platforms.length === 0
|
|
29230
|
+
),
|
|
29231
|
+
[model.components]
|
|
29232
|
+
);
|
|
29233
|
+
return {
|
|
29234
|
+
isPlatformExists,
|
|
29235
|
+
hasSinglePlatform
|
|
29236
|
+
};
|
|
29237
|
+
}
|
|
29238
|
+
|
|
28702
29239
|
export {
|
|
28703
|
-
|
|
28704
|
-
|
|
28705
|
-
SiteContext,
|
|
28706
|
-
SiteState,
|
|
28707
|
-
resolveConfiguredSite,
|
|
28708
|
-
ARMClient,
|
|
29240
|
+
SiteSelector,
|
|
29241
|
+
SiteProvider,
|
|
28709
29242
|
useARMClient,
|
|
28710
29243
|
useBlocksServicesClient,
|
|
28711
29244
|
ArmTagProvider,
|
|
@@ -28720,12 +29253,11 @@ export {
|
|
|
28720
29253
|
redirectWithCSMv2FTs,
|
|
28721
29254
|
useResolvePlatformUrl,
|
|
28722
29255
|
useResolvePlatformDevUrl,
|
|
28723
|
-
resolvePlatformUrl,
|
|
28724
29256
|
useResolveDashboardExtensionUrl,
|
|
28725
29257
|
useResolveDashboardExtensionDevUrl,
|
|
28726
29258
|
useResolveBlocksEditorURL,
|
|
28727
|
-
|
|
28728
|
-
|
|
29259
|
+
useOpenPage,
|
|
29260
|
+
usePlatform
|
|
28729
29261
|
};
|
|
28730
29262
|
/*! Bundled license information:
|
|
28731
29263
|
|
|
@@ -28790,4 +29322,4 @@ xmlhttprequest-ssl/lib/XMLHttpRequest.js:
|
|
|
28790
29322
|
* @license MIT
|
|
28791
29323
|
*)
|
|
28792
29324
|
*/
|
|
28793
|
-
//# sourceMappingURL=chunk-
|
|
29325
|
+
//# sourceMappingURL=chunk-TSZ32MNC.js.map
|