@wix/cli-app 1.1.81 → 1.1.83
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/{AddPermissionCommand-SFC44F4N.js → AddPermissionCommand-5X3K4KUG.js} +2 -2
- package/build/{CreateVersionCommand-DMS7UHEW.js → CreateVersionCommand-XWWXAFOX.js} +3 -3
- package/build/{DevCommand-IMACMU76.js → DevCommand-EOEGQX2B.js} +14 -14
- package/build/{GenerateCommand-BXBYWPR6.js → GenerateCommand-IOFKL3RC.js} +1009 -868
- package/build/GenerateCommand-IOFKL3RC.js.map +1 -0
- package/build/{LogsCommand-DXPP2Y63.js → LogsCommand-23QQRT3D.js} +3 -3
- package/build/PreviewCommand-FBODGF7Y.js +19 -0
- package/build/ReleaseCommand-SNCMQQXK.js +28 -0
- package/build/{ReleaseCommand-ZZFTWS7J.js.map → ReleaseCommand-SNCMQQXK.js.map} +1 -1
- package/build/ServeCommand-SGREOUDA.js +43 -0
- package/build/ServeCommand-SGREOUDA.js.map +1 -0
- package/build/{build-5B2A76I7.js → build-PYB5PAZO.js} +8 -8
- package/build/{chunk-GCHPKOS2.js → chunk-3X2VYRBF.js} +13 -7
- package/build/chunk-3X2VYRBF.js.map +1 -0
- package/build/{chunk-R3BD56LW.js → chunk-4PXJSX4C.js} +2 -2
- package/build/{chunk-32DDGTGH.js → chunk-5TP6T6QK.js} +84 -17
- package/build/chunk-5TP6T6QK.js.map +1 -0
- package/build/{chunk-PJJ6F4A3.js → chunk-63VDDLLQ.js} +2 -2
- package/build/{chunk-6GF7ZOLW.js → chunk-AN77SZN2.js} +9 -11
- package/build/{chunk-6GF7ZOLW.js.map → chunk-AN77SZN2.js.map} +1 -1
- package/build/{chunk-RZHKF2FT.js → chunk-E4UNGBQY.js} +2 -2
- package/build/{chunk-JYPZQDKR.js → chunk-GGDJQXOX.js} +3 -3
- package/build/{chunk-3BX4VLQC.js → chunk-KLBXSZ6R.js} +3 -3
- package/build/{chunk-ZVADFZDF.js → chunk-QREADZZF.js} +5 -5
- package/build/{chunk-DBASREIW.js → chunk-SIJDKP2Q.js} +1312 -534
- package/build/chunk-SIJDKP2Q.js.map +1 -0
- package/build/{chunk-D7ONS7OD.js → chunk-TJFERWU7.js} +5 -5
- package/build/{chunk-VV2OOBF3.js → chunk-VB3AXXRP.js} +2 -2
- package/build/{chunk-OPFPQV74.js → chunk-VLQG5SQF.js} +79 -4
- package/build/{chunk-OPFPQV74.js.map → chunk-VLQG5SQF.js.map} +1 -1
- package/build/{chunk-LNBDMMJU.js → chunk-WNR36YTI.js} +2 -2
- package/build/{chunk-42T5NHSS.js → chunk-Y4GJ3NS4.js} +2 -2
- package/build/{chunk-S426UONM.js → chunk-ZCUJ356B.js} +2 -2
- package/build/{chunk-2Y6DEXNR.js → chunk-ZLLXHWZF.js} +957 -375
- package/build/{chunk-2Y6DEXNR.js.map → chunk-ZLLXHWZF.js.map} +1 -1
- package/build/{chunk-CYJERK24.js → chunk-ZOZ5LJV7.js} +7 -7
- package/build/{chunk-CYJERK24.js.map → chunk-ZOZ5LJV7.js.map} +1 -1
- package/build/cloudflare-runtime/entry.js +33 -9
- package/build/cloudflare-runtime/getRegisteredExtensions.js +33 -9
- package/build/index.js +34 -31
- package/build/index.js.map +1 -1
- package/build/platform-sdk/chunk-MM2KVUBI.js +2 -0
- package/build/platform-sdk/chunk-MM2KVUBI.js.map +1 -0
- package/build/platform-sdk/dashboard.js +1 -1
- package/build/platform-sdk/editor.js +1 -1
- package/build/platform-sdk/site.js +1 -1
- package/build/{preview-XTPTMI6C.js → preview-PIFWQKW3.js} +13 -14
- package/build/{preview-XTPTMI6C.js.map → preview-PIFWQKW3.js.map} +1 -1
- package/build/{release-MNTPIKSG.js → release-6Z6LMTRW.js} +15 -16
- package/build/{release-MNTPIKSG.js.map → release-6Z6LMTRW.js.map} +1 -1
- package/build/{render-command-HQXTOVW5.js → render-command-3G25G5MU.js} +6 -6
- package/build/src-MHMTXBSY.js +1120 -0
- package/build/src-MHMTXBSY.js.map +1 -0
- package/package.json +8 -7
- package/build/GenerateCommand-BXBYWPR6.js.map +0 -1
- package/build/PreviewCommand-IKMUVCVS.js +0 -20
- package/build/ReleaseCommand-ZZFTWS7J.js +0 -29
- package/build/ServeCommand-2ESXE2E2.js +0 -169
- package/build/ServeCommand-2ESXE2E2.js.map +0 -1
- package/build/chunk-32DDGTGH.js.map +0 -1
- package/build/chunk-3FL4P2SD.js +0 -92
- package/build/chunk-3FL4P2SD.js.map +0 -1
- package/build/chunk-DBASREIW.js.map +0 -1
- package/build/chunk-GCHPKOS2.js.map +0 -1
- package/build/platform-sdk/chunk-BGEA2LRQ.js +0 -2
- package/build/platform-sdk/chunk-BGEA2LRQ.js.map +0 -1
- /package/build/{AddPermissionCommand-SFC44F4N.js.map → AddPermissionCommand-5X3K4KUG.js.map} +0 -0
- /package/build/{CreateVersionCommand-DMS7UHEW.js.map → CreateVersionCommand-XWWXAFOX.js.map} +0 -0
- /package/build/{DevCommand-IMACMU76.js.map → DevCommand-EOEGQX2B.js.map} +0 -0
- /package/build/{LogsCommand-DXPP2Y63.js.map → LogsCommand-23QQRT3D.js.map} +0 -0
- /package/build/{PreviewCommand-IKMUVCVS.js.map → PreviewCommand-FBODGF7Y.js.map} +0 -0
- /package/build/{build-5B2A76I7.js.map → build-PYB5PAZO.js.map} +0 -0
- /package/build/{chunk-R3BD56LW.js.map → chunk-4PXJSX4C.js.map} +0 -0
- /package/build/{chunk-PJJ6F4A3.js.map → chunk-63VDDLLQ.js.map} +0 -0
- /package/build/{chunk-RZHKF2FT.js.map → chunk-E4UNGBQY.js.map} +0 -0
- /package/build/{chunk-JYPZQDKR.js.map → chunk-GGDJQXOX.js.map} +0 -0
- /package/build/{chunk-3BX4VLQC.js.map → chunk-KLBXSZ6R.js.map} +0 -0
- /package/build/{chunk-ZVADFZDF.js.map → chunk-QREADZZF.js.map} +0 -0
- /package/build/{chunk-D7ONS7OD.js.map → chunk-TJFERWU7.js.map} +0 -0
- /package/build/{chunk-VV2OOBF3.js.map → chunk-VB3AXXRP.js.map} +0 -0
- /package/build/{chunk-LNBDMMJU.js.map → chunk-WNR36YTI.js.map} +0 -0
- /package/build/{chunk-42T5NHSS.js.map → chunk-Y4GJ3NS4.js.map} +0 -0
- /package/build/{chunk-S426UONM.js.map → chunk-ZCUJ356B.js.map} +0 -0
- /package/build/{render-command-HQXTOVW5.js.map → render-command-3G25G5MU.js.map} +0 -0
|
@@ -3,20 +3,20 @@ const require = _createRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
createPackageManager,
|
|
5
5
|
getRepoType
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-E4UNGBQY.js";
|
|
7
7
|
import {
|
|
8
8
|
createI18nT
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-KLBXSZ6R.js";
|
|
10
|
+
import "./chunk-3X2VYRBF.js";
|
|
11
11
|
import {
|
|
12
12
|
useWixCliAppBi
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZCUJ356B.js";
|
|
14
14
|
import {
|
|
15
15
|
componentGenerator,
|
|
16
16
|
dependenciesUpdater,
|
|
17
17
|
require_lodash,
|
|
18
18
|
useBackendComponents
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-63VDDLLQ.js";
|
|
20
20
|
import "./chunk-ZR3N5INU.js";
|
|
21
21
|
import {
|
|
22
22
|
getEcomRequiredApps,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
require_setToArray,
|
|
34
34
|
require_toSource,
|
|
35
35
|
useExtensionDataClient
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-VLQG5SQF.js";
|
|
37
37
|
import {
|
|
38
38
|
AsyncCallbackStatus,
|
|
39
39
|
BLOCKS_TYPES_PATH,
|
|
@@ -54,6 +54,7 @@ import {
|
|
|
54
54
|
Key,
|
|
55
55
|
Learn,
|
|
56
56
|
Link,
|
|
57
|
+
Rocket,
|
|
57
58
|
SERVICE_PLUGINS_DIR,
|
|
58
59
|
SITE_PLUGINS_DIR,
|
|
59
60
|
SITE_WIDGETS_DIR,
|
|
@@ -82,6 +83,7 @@ import {
|
|
|
82
83
|
getSiteWidgetsDir,
|
|
83
84
|
getTSConfigFilePath,
|
|
84
85
|
getTestOverrides,
|
|
86
|
+
normalizeGlobbyPattern,
|
|
85
87
|
pRetry,
|
|
86
88
|
pathValidation,
|
|
87
89
|
relativeFolderName,
|
|
@@ -112,7 +114,7 @@ import {
|
|
|
112
114
|
uuidValidation,
|
|
113
115
|
writeJson,
|
|
114
116
|
z
|
|
115
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-ZLLXHWZF.js";
|
|
116
118
|
import {
|
|
117
119
|
__commonJS,
|
|
118
120
|
__dirname,
|
|
@@ -1249,8 +1251,8 @@ var require_stringToPath = __commonJS({
|
|
|
1249
1251
|
if (string.charCodeAt(0) === 46) {
|
|
1250
1252
|
result.push("");
|
|
1251
1253
|
}
|
|
1252
|
-
string.replace(rePropName, function(
|
|
1253
|
-
result.push(quote ? subString.replace(reEscapeChar, "$1") : number ||
|
|
1254
|
+
string.replace(rePropName, function(match15, number, quote, subString) {
|
|
1255
|
+
result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match15);
|
|
1254
1256
|
});
|
|
1255
1257
|
return result;
|
|
1256
1258
|
});
|
|
@@ -1360,11 +1362,11 @@ var require_baseGet = __commonJS({
|
|
|
1360
1362
|
init_esm_shims();
|
|
1361
1363
|
var castPath = require_castPath();
|
|
1362
1364
|
var toKey = require_toKey();
|
|
1363
|
-
function baseGet(object,
|
|
1364
|
-
|
|
1365
|
-
var index = 0, length =
|
|
1365
|
+
function baseGet(object, path14) {
|
|
1366
|
+
path14 = castPath(path14, object);
|
|
1367
|
+
var index = 0, length = path14.length;
|
|
1366
1368
|
while (object != null && index < length) {
|
|
1367
|
-
object = object[toKey(
|
|
1369
|
+
object = object[toKey(path14[index++])];
|
|
1368
1370
|
}
|
|
1369
1371
|
return index && index == length ? object : void 0;
|
|
1370
1372
|
}
|
|
@@ -1378,8 +1380,8 @@ var require_get = __commonJS({
|
|
|
1378
1380
|
"use strict";
|
|
1379
1381
|
init_esm_shims();
|
|
1380
1382
|
var baseGet = require_baseGet();
|
|
1381
|
-
function get(object,
|
|
1382
|
-
var result = object == null ? void 0 : baseGet(object,
|
|
1383
|
+
function get(object, path14, defaultValue) {
|
|
1384
|
+
var result = object == null ? void 0 : baseGet(object, path14);
|
|
1383
1385
|
return result === void 0 ? defaultValue : result;
|
|
1384
1386
|
}
|
|
1385
1387
|
module.exports = get;
|
|
@@ -1409,11 +1411,11 @@ var require_hasPath = __commonJS({
|
|
|
1409
1411
|
var isIndex = require_isIndex();
|
|
1410
1412
|
var isLength = require_isLength();
|
|
1411
1413
|
var toKey = require_toKey();
|
|
1412
|
-
function hasPath(object,
|
|
1413
|
-
|
|
1414
|
-
var index = -1, length =
|
|
1414
|
+
function hasPath(object, path14, hasFunc) {
|
|
1415
|
+
path14 = castPath(path14, object);
|
|
1416
|
+
var index = -1, length = path14.length, result = false;
|
|
1415
1417
|
while (++index < length) {
|
|
1416
|
-
var key = toKey(
|
|
1418
|
+
var key = toKey(path14[index]);
|
|
1417
1419
|
if (!(result = object != null && hasFunc(object, key))) {
|
|
1418
1420
|
break;
|
|
1419
1421
|
}
|
|
@@ -1436,8 +1438,8 @@ var require_hasIn = __commonJS({
|
|
|
1436
1438
|
init_esm_shims();
|
|
1437
1439
|
var baseHasIn = require_baseHasIn();
|
|
1438
1440
|
var hasPath = require_hasPath();
|
|
1439
|
-
function hasIn(object,
|
|
1440
|
-
return object != null && hasPath(object,
|
|
1441
|
+
function hasIn(object, path14) {
|
|
1442
|
+
return object != null && hasPath(object, path14, baseHasIn);
|
|
1441
1443
|
}
|
|
1442
1444
|
module.exports = hasIn;
|
|
1443
1445
|
}
|
|
@@ -1457,13 +1459,13 @@ var require_baseMatchesProperty = __commonJS({
|
|
|
1457
1459
|
var toKey = require_toKey();
|
|
1458
1460
|
var COMPARE_PARTIAL_FLAG = 1;
|
|
1459
1461
|
var COMPARE_UNORDERED_FLAG = 2;
|
|
1460
|
-
function baseMatchesProperty(
|
|
1461
|
-
if (isKey(
|
|
1462
|
-
return matchesStrictComparable(toKey(
|
|
1462
|
+
function baseMatchesProperty(path14, srcValue) {
|
|
1463
|
+
if (isKey(path14) && isStrictComparable(srcValue)) {
|
|
1464
|
+
return matchesStrictComparable(toKey(path14), srcValue);
|
|
1463
1465
|
}
|
|
1464
1466
|
return function(object) {
|
|
1465
|
-
var objValue = get(object,
|
|
1466
|
-
return objValue === void 0 && objValue === srcValue ? hasIn(object,
|
|
1467
|
+
var objValue = get(object, path14);
|
|
1468
|
+
return objValue === void 0 && objValue === srcValue ? hasIn(object, path14) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
1467
1469
|
};
|
|
1468
1470
|
}
|
|
1469
1471
|
module.exports = baseMatchesProperty;
|
|
@@ -1502,9 +1504,9 @@ var require_basePropertyDeep = __commonJS({
|
|
|
1502
1504
|
"use strict";
|
|
1503
1505
|
init_esm_shims();
|
|
1504
1506
|
var baseGet = require_baseGet();
|
|
1505
|
-
function basePropertyDeep(
|
|
1507
|
+
function basePropertyDeep(path14) {
|
|
1506
1508
|
return function(object) {
|
|
1507
|
-
return baseGet(object,
|
|
1509
|
+
return baseGet(object, path14);
|
|
1508
1510
|
};
|
|
1509
1511
|
}
|
|
1510
1512
|
module.exports = basePropertyDeep;
|
|
@@ -1520,8 +1522,8 @@ var require_property = __commonJS({
|
|
|
1520
1522
|
var basePropertyDeep = require_basePropertyDeep();
|
|
1521
1523
|
var isKey = require_isKey();
|
|
1522
1524
|
var toKey = require_toKey();
|
|
1523
|
-
function property(
|
|
1524
|
-
return isKey(
|
|
1525
|
+
function property(path14) {
|
|
1526
|
+
return isKey(path14) ? baseProperty(toKey(path14)) : basePropertyDeep(path14);
|
|
1525
1527
|
}
|
|
1526
1528
|
module.exports = property;
|
|
1527
1529
|
}
|
|
@@ -1572,8 +1574,8 @@ init_esm_shims();
|
|
|
1572
1574
|
|
|
1573
1575
|
// src/components/GenerateCommand/GenerateCommand.tsx
|
|
1574
1576
|
init_esm_shims();
|
|
1575
|
-
var
|
|
1576
|
-
var
|
|
1577
|
+
var import_react36 = __toESM(require_react(), 1);
|
|
1578
|
+
var import_variant14 = __toESM(require_lib(), 1);
|
|
1577
1579
|
|
|
1578
1580
|
// src/components/GenerateCommand/dashboad-page/DashboardPage.tsx
|
|
1579
1581
|
init_esm_shims();
|
|
@@ -1647,7 +1649,7 @@ function createServicePluginValidation(servicePlugins, servicePluginType) {
|
|
|
1647
1649
|
"Plugin name must be unique"
|
|
1648
1650
|
],
|
|
1649
1651
|
[
|
|
1650
|
-
(
|
|
1652
|
+
(path14) => path14.length < 20,
|
|
1651
1653
|
"Plugin name must be shorter than 20 characters"
|
|
1652
1654
|
],
|
|
1653
1655
|
[
|
|
@@ -1941,11 +1943,11 @@ var InstallationStateVariant = (0, import_variant2.variant)({
|
|
|
1941
1943
|
});
|
|
1942
1944
|
var InstallDependencies = ({
|
|
1943
1945
|
onFinish,
|
|
1944
|
-
|
|
1946
|
+
onSubmit
|
|
1945
1947
|
}) => {
|
|
1946
1948
|
const { model } = useProjectModel();
|
|
1947
1949
|
const { t: t2 } = useTranslation();
|
|
1948
|
-
const [
|
|
1950
|
+
const [installState, setInstallState] = (0, import_react4.useState)(
|
|
1949
1951
|
InstallationStateVariant.NotStarted()
|
|
1950
1952
|
);
|
|
1951
1953
|
return /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(Box_default, { marginBottom: 1 }, /* @__PURE__ */ import_react4.default.createElement(
|
|
@@ -1957,28 +1959,27 @@ var InstallDependencies = ({
|
|
|
1957
1959
|
const { projectFolder } = model;
|
|
1958
1960
|
const repoType = await getRepoType(projectFolder);
|
|
1959
1961
|
const pkgManager = await createPackageManager(repoType);
|
|
1962
|
+
onSubmit?.();
|
|
1960
1963
|
if (confirmed) {
|
|
1961
|
-
|
|
1962
|
-
setInstalState(InstallationStateVariant.Installing());
|
|
1964
|
+
setInstallState(InstallationStateVariant.Installing());
|
|
1963
1965
|
try {
|
|
1964
1966
|
await pkgManager.runInstall(projectFolder);
|
|
1965
1967
|
} catch (e) {
|
|
1966
|
-
|
|
1968
|
+
setInstallState(InstallationStateVariant.Failure());
|
|
1967
1969
|
throw e;
|
|
1968
1970
|
}
|
|
1969
|
-
|
|
1970
|
-
onFinish();
|
|
1971
|
+
setInstallState(InstallationStateVariant.Success());
|
|
1971
1972
|
} else {
|
|
1972
|
-
|
|
1973
|
+
setInstallState(
|
|
1973
1974
|
InstallationStateVariant.Skipped({
|
|
1974
1975
|
pkgManagerName: pkgManager.name
|
|
1975
1976
|
})
|
|
1976
1977
|
);
|
|
1977
|
-
onFinish();
|
|
1978
1978
|
}
|
|
1979
|
+
onFinish();
|
|
1979
1980
|
}
|
|
1980
1981
|
}
|
|
1981
|
-
)), (0, import_variant2.match)(
|
|
1982
|
+
)), (0, import_variant2.match)(installState, {
|
|
1982
1983
|
NotStarted: () => null,
|
|
1983
1984
|
Failure: () => null,
|
|
1984
1985
|
Skipped: ({ pkgManagerName }) => /* @__PURE__ */ import_react4.default.createElement(Box_default, { flexDirection: "column" }, /* @__PURE__ */ import_react4.default.createElement(Text, { skin: "warning" }, /* @__PURE__ */ import_react4.default.createElement(
|
|
@@ -2050,11 +2051,15 @@ var Folder = ({
|
|
|
2050
2051
|
};
|
|
2051
2052
|
|
|
2052
2053
|
// src/components/GenerateCommand/CompleteGeneration.tsx
|
|
2054
|
+
var CompleteGenerationMessage = (0, import_variant3.variant)({
|
|
2055
|
+
SuccessMessage: (0, import_variant3.fields)(),
|
|
2056
|
+
CustomSuccessMessage: (0, import_variant3.fields)()
|
|
2057
|
+
});
|
|
2053
2058
|
var CompleteGeneration = ({
|
|
2054
2059
|
generationTask,
|
|
2055
2060
|
extensionType,
|
|
2056
|
-
|
|
2057
|
-
|
|
2061
|
+
route,
|
|
2062
|
+
successMessage
|
|
2058
2063
|
}) => {
|
|
2059
2064
|
const { t: t2 } = useTranslation();
|
|
2060
2065
|
const { completeWizard } = useWizardStep();
|
|
@@ -2071,17 +2076,20 @@ var CompleteGeneration = ({
|
|
|
2071
2076
|
Success: ({ hasUpdatedDependencies, newFiles }) => /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, hasUpdatedDependencies && /* @__PURE__ */ import_react6.default.createElement(
|
|
2072
2077
|
InstallDependencies,
|
|
2073
2078
|
{
|
|
2074
|
-
|
|
2079
|
+
onSubmit: () => completeWizard(),
|
|
2075
2080
|
onFinish: () => setFinishedInstallation(true)
|
|
2076
2081
|
}
|
|
2077
|
-
), finishedInstallation &&
|
|
2078
|
-
|
|
2079
|
-
{
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2082
|
+
), finishedInstallation && (0, import_variant3.match)(successMessage, {
|
|
2083
|
+
CustomSuccessMessage: ({ comp }) => comp,
|
|
2084
|
+
SuccessMessage: ({ learnMoreUrl }) => /* @__PURE__ */ import_react6.default.createElement(
|
|
2085
|
+
GenerationSuccessMessage,
|
|
2086
|
+
{
|
|
2087
|
+
extensionType,
|
|
2088
|
+
generatedFiles: newFiles,
|
|
2089
|
+
learnMoreUrl
|
|
2090
|
+
}
|
|
2091
|
+
)
|
|
2092
|
+
})),
|
|
2085
2093
|
Error: () => null,
|
|
2086
2094
|
Loading: () => /* @__PURE__ */ import_react6.default.createElement(
|
|
2087
2095
|
Spinner,
|
|
@@ -2097,11 +2105,11 @@ var CompleteGeneration = ({
|
|
|
2097
2105
|
t2,
|
|
2098
2106
|
generationTask,
|
|
2099
2107
|
extensionType,
|
|
2100
|
-
learnMoreUrl,
|
|
2101
2108
|
route,
|
|
2102
2109
|
finishedInstallation,
|
|
2103
2110
|
setFinishedInstallation,
|
|
2104
|
-
completeWizard
|
|
2111
|
+
completeWizard,
|
|
2112
|
+
successMessage
|
|
2105
2113
|
]
|
|
2106
2114
|
);
|
|
2107
2115
|
};
|
|
@@ -2162,7 +2170,9 @@ var useGenerateDashboardPage = () => {
|
|
|
2162
2170
|
{
|
|
2163
2171
|
generationTask,
|
|
2164
2172
|
extensionType,
|
|
2165
|
-
|
|
2173
|
+
successMessage: CompleteGenerationMessage.SuccessMessage({
|
|
2174
|
+
learnMoreUrl: "https://wix.to/7W3nYUg"
|
|
2175
|
+
}),
|
|
2166
2176
|
route: pageRoute
|
|
2167
2177
|
}
|
|
2168
2178
|
)
|
|
@@ -2171,8 +2181,44 @@ var useGenerateDashboardPage = () => {
|
|
|
2171
2181
|
|
|
2172
2182
|
// src/components/GenerateCommand/embedded-script/EmbeddedScript.tsx
|
|
2173
2183
|
init_esm_shims();
|
|
2184
|
+
var import_react9 = __toESM(require_react(), 1);
|
|
2185
|
+
|
|
2186
|
+
// src/components/GenerateCommand/embedded-script/generate.ts
|
|
2187
|
+
init_esm_shims();
|
|
2188
|
+
import path4 from "node:path";
|
|
2189
|
+
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
2190
|
+
var EMBEDDED_SCRIPT_TEMPLATE = path4.resolve(
|
|
2191
|
+
__dirname,
|
|
2192
|
+
"../templates/embedded-script"
|
|
2193
|
+
);
|
|
2194
|
+
async function generateEmbeddedScript(projectFolder, folder, name, scriptType, placement) {
|
|
2195
|
+
const cwd = path4.join(getEmbeddedScriptsDir(projectFolder), folder);
|
|
2196
|
+
const embeddedScriptConfig = {
|
|
2197
|
+
$schema: "https://dev.wix.com/wix-cli/schemas/embedded-script.json",
|
|
2198
|
+
id: randomUUID2(),
|
|
2199
|
+
name,
|
|
2200
|
+
scriptType,
|
|
2201
|
+
placement
|
|
2202
|
+
};
|
|
2203
|
+
const embeddedScriptConfigJSON = toJsonString(embeddedScriptConfig, {
|
|
2204
|
+
spaces: 2
|
|
2205
|
+
});
|
|
2206
|
+
return await componentGenerator({
|
|
2207
|
+
template: EMBEDDED_SCRIPT_TEMPLATE,
|
|
2208
|
+
projectFolder,
|
|
2209
|
+
cwd,
|
|
2210
|
+
data: {
|
|
2211
|
+
embeddedScriptConfigJSON,
|
|
2212
|
+
name,
|
|
2213
|
+
scriptType,
|
|
2214
|
+
placement
|
|
2215
|
+
}
|
|
2216
|
+
});
|
|
2217
|
+
}
|
|
2218
|
+
|
|
2219
|
+
// src/components/GenerateCommand/embedded-script/steps.tsx
|
|
2220
|
+
init_esm_shims();
|
|
2174
2221
|
var import_react8 = __toESM(require_react(), 1);
|
|
2175
|
-
var import_variant4 = __toESM(require_lib(), 1);
|
|
2176
2222
|
var import_lodash2 = __toESM(require_lodash(), 1);
|
|
2177
2223
|
|
|
2178
2224
|
// src/components/GenerateCommand/embedded-script/const.ts
|
|
@@ -2218,74 +2264,20 @@ var SCRIPT_PLACEMENTS = [
|
|
|
2218
2264
|
}
|
|
2219
2265
|
];
|
|
2220
2266
|
|
|
2221
|
-
// src/components/GenerateCommand/embedded-script/
|
|
2222
|
-
|
|
2223
|
-
import path4 from "node:path";
|
|
2224
|
-
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
2225
|
-
var EMBEDDED_SCRIPT_TEMPLATE = path4.resolve(
|
|
2226
|
-
__dirname,
|
|
2227
|
-
"../templates/embedded-script"
|
|
2228
|
-
);
|
|
2229
|
-
async function generateEmbeddedScript(projectFolder, folder, name, scriptType, placement) {
|
|
2230
|
-
const cwd = path4.join(getEmbeddedScriptsDir(projectFolder), folder);
|
|
2231
|
-
const embeddedScriptConfig = {
|
|
2232
|
-
$schema: "https://dev.wix.com/wix-cli/schemas/embedded-script.json",
|
|
2233
|
-
id: randomUUID2(),
|
|
2234
|
-
name,
|
|
2235
|
-
scriptType,
|
|
2236
|
-
placement
|
|
2237
|
-
};
|
|
2238
|
-
const embeddedScriptConfigJSON = toJsonString(embeddedScriptConfig, {
|
|
2239
|
-
spaces: 2
|
|
2240
|
-
});
|
|
2241
|
-
return await componentGenerator({
|
|
2242
|
-
template: EMBEDDED_SCRIPT_TEMPLATE,
|
|
2243
|
-
projectFolder,
|
|
2244
|
-
cwd,
|
|
2245
|
-
data: {
|
|
2246
|
-
embeddedScriptConfigJSON,
|
|
2247
|
-
name,
|
|
2248
|
-
scriptType,
|
|
2249
|
-
placement
|
|
2250
|
-
}
|
|
2251
|
-
});
|
|
2252
|
-
}
|
|
2253
|
-
|
|
2254
|
-
// src/components/GenerateCommand/embedded-script/EmbeddedScript.tsx
|
|
2255
|
-
var GenerateEmbeddedScript = () => {
|
|
2256
|
-
const bi = useWixCliAppBi();
|
|
2267
|
+
// src/components/GenerateCommand/embedded-script/steps.tsx
|
|
2268
|
+
var ChooseScriptNameStep = ({ onSubmit, scriptName }) => {
|
|
2257
2269
|
const { t: t2 } = useTranslation();
|
|
2258
|
-
const
|
|
2259
|
-
const { getExtensions } = useExtensions();
|
|
2270
|
+
const bi = useWixCliAppBi();
|
|
2260
2271
|
const extensionType = t2(
|
|
2261
2272
|
"generate_command.flow.embedded_script"
|
|
2262
2273
|
).toLowerCase();
|
|
2263
|
-
const
|
|
2264
|
-
|
|
2265
|
-
const [scriptName, setScriptName] = (0, import_react8.useState)();
|
|
2266
|
-
const [scriptType, setScriptType] = (0, import_react8.useState)();
|
|
2267
|
-
const [scriptPlacement, setScriptPlacement] = (0, import_react8.useState)();
|
|
2268
|
-
const [finishedInstallation, setFinishedInstallation] = (0, import_react8.useState)(false);
|
|
2269
|
-
const defaultScriptFolder = (0, import_lodash2.kebabCase)(scriptName);
|
|
2270
|
-
const validateEmbeddedScriptFolder = useValidation(
|
|
2271
|
-
createEmbeddedScriptFolderValidation(embeddedScripts)
|
|
2272
|
-
);
|
|
2273
|
-
const generationTask = useGenerationTask(async () => {
|
|
2274
|
-
if (scriptFolder && scriptName && scriptType && scriptPlacement) {
|
|
2275
|
-
return generateEmbeddedScript(
|
|
2276
|
-
model.projectFolder,
|
|
2277
|
-
scriptFolder,
|
|
2278
|
-
scriptName,
|
|
2279
|
-
scriptType,
|
|
2280
|
-
scriptPlacement
|
|
2281
|
-
);
|
|
2282
|
-
}
|
|
2283
|
-
}, [scriptFolder, scriptName, scriptType, scriptPlacement]);
|
|
2284
|
-
return /* @__PURE__ */ import_react8.default.createElement(import_react8.default.Fragment, null, /* @__PURE__ */ import_react8.default.createElement(
|
|
2274
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
2275
|
+
return /* @__PURE__ */ import_react8.default.createElement(
|
|
2285
2276
|
TextInput,
|
|
2286
2277
|
{
|
|
2278
|
+
isActive,
|
|
2287
2279
|
label: t2("generate_command.embedded_script.choose_name"),
|
|
2288
|
-
placeholder: t2("generate_command.embedded_script.name_placeholder"),
|
|
2280
|
+
placeholder: scriptName ?? t2("generate_command.embedded_script.name_placeholder"),
|
|
2289
2281
|
onSubmit: (value) => {
|
|
2290
2282
|
bi.cliFlowStepAnswered({
|
|
2291
2283
|
question: t2("generate_command.embedded_script.choose_name"),
|
|
@@ -2293,14 +2285,31 @@ var GenerateEmbeddedScript = () => {
|
|
|
2293
2285
|
answer: value,
|
|
2294
2286
|
additionalInfo: { extensionType }
|
|
2295
2287
|
});
|
|
2296
|
-
|
|
2288
|
+
onSubmit(value);
|
|
2289
|
+
goToNextStep();
|
|
2297
2290
|
}
|
|
2298
2291
|
}
|
|
2299
|
-
)
|
|
2292
|
+
);
|
|
2293
|
+
};
|
|
2294
|
+
var ChooseScriptFolderStep = ({ onSubmit, scriptFolder, scriptName }) => {
|
|
2295
|
+
const { t: t2 } = useTranslation();
|
|
2296
|
+
const bi = useWixCliAppBi();
|
|
2297
|
+
const extensionType = t2(
|
|
2298
|
+
"generate_command.flow.embedded_script"
|
|
2299
|
+
).toLowerCase();
|
|
2300
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
2301
|
+
const { getExtensions } = useExtensions();
|
|
2302
|
+
const embeddedScripts = getExtensions("EmbeddedScript");
|
|
2303
|
+
const defaultScriptFolder = (0, import_lodash2.kebabCase)(scriptName);
|
|
2304
|
+
const validateEmbeddedScriptFolder = useValidation(
|
|
2305
|
+
createEmbeddedScriptFolderValidation(embeddedScripts)
|
|
2306
|
+
);
|
|
2307
|
+
return /* @__PURE__ */ import_react8.default.createElement(
|
|
2300
2308
|
TextInput,
|
|
2301
2309
|
{
|
|
2310
|
+
isActive,
|
|
2302
2311
|
label: t2("generate_command.embedded_script.choose_folder"),
|
|
2303
|
-
placeholder: defaultScriptFolder,
|
|
2312
|
+
placeholder: scriptFolder ?? defaultScriptFolder,
|
|
2304
2313
|
onSubmit: (value) => {
|
|
2305
2314
|
bi.cliFlowStepAnswered({
|
|
2306
2315
|
question: t2("generate_command.embedded_script.choose_folder"),
|
|
@@ -2308,20 +2317,32 @@ var GenerateEmbeddedScript = () => {
|
|
|
2308
2317
|
answer: value,
|
|
2309
2318
|
additionalInfo: { extensionType }
|
|
2310
2319
|
});
|
|
2311
|
-
|
|
2320
|
+
onSubmit(value);
|
|
2321
|
+
goToNextStep();
|
|
2312
2322
|
},
|
|
2313
2323
|
validate: validateEmbeddedScriptFolder
|
|
2314
2324
|
}
|
|
2315
|
-
)
|
|
2325
|
+
);
|
|
2326
|
+
};
|
|
2327
|
+
var ChooseScriptTypeStep = ({ onSubmit }) => {
|
|
2328
|
+
const { t: t2 } = useTranslation();
|
|
2329
|
+
const bi = useWixCliAppBi();
|
|
2330
|
+
const extensionType = t2(
|
|
2331
|
+
"generate_command.flow.embedded_script"
|
|
2332
|
+
).toLowerCase();
|
|
2333
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
2334
|
+
return /* @__PURE__ */ import_react8.default.createElement(
|
|
2316
2335
|
SelectInput,
|
|
2317
2336
|
{
|
|
2337
|
+
isActive,
|
|
2318
2338
|
label: t2("generate_command.embedded_script.choose_type"),
|
|
2319
2339
|
info: /* @__PURE__ */ import_react8.default.createElement(
|
|
2320
2340
|
Trans,
|
|
2321
2341
|
{
|
|
2322
2342
|
i18nKey: "generate_command.embedded_script.type_info",
|
|
2323
2343
|
components: [
|
|
2324
|
-
|
|
2344
|
+
// https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/site-extensions/embedded-scripts/embedded-script-extension-files-and-code
|
|
2345
|
+
/* @__PURE__ */ import_react8.default.createElement(Link, { url: "https://wix.to/0GEdYOs" })
|
|
2325
2346
|
]
|
|
2326
2347
|
}
|
|
2327
2348
|
),
|
|
@@ -2333,12 +2354,23 @@ var GenerateEmbeddedScript = () => {
|
|
|
2333
2354
|
answer: option.title,
|
|
2334
2355
|
additionalInfo: { extensionType }
|
|
2335
2356
|
});
|
|
2336
|
-
|
|
2357
|
+
onSubmit(option.value);
|
|
2358
|
+
goToNextStep();
|
|
2337
2359
|
}
|
|
2338
2360
|
}
|
|
2339
|
-
)
|
|
2361
|
+
);
|
|
2362
|
+
};
|
|
2363
|
+
var ChooseScriptPlacementStep = ({ onSubmit }) => {
|
|
2364
|
+
const { t: t2 } = useTranslation();
|
|
2365
|
+
const bi = useWixCliAppBi();
|
|
2366
|
+
const extensionType = t2(
|
|
2367
|
+
"generate_command.flow.embedded_script"
|
|
2368
|
+
).toLowerCase();
|
|
2369
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
2370
|
+
return /* @__PURE__ */ import_react8.default.createElement(
|
|
2340
2371
|
SelectInput,
|
|
2341
2372
|
{
|
|
2373
|
+
isActive,
|
|
2342
2374
|
label: t2("generate_command.embedded_script.choose_placement"),
|
|
2343
2375
|
info: t2("generate_command.embedded_script.placement_info"),
|
|
2344
2376
|
options: SCRIPT_PLACEMENTS,
|
|
@@ -2349,54 +2381,64 @@ var GenerateEmbeddedScript = () => {
|
|
|
2349
2381
|
answer: option.title,
|
|
2350
2382
|
additionalInfo: { extensionType }
|
|
2351
2383
|
});
|
|
2352
|
-
|
|
2384
|
+
onSubmit(option.value);
|
|
2385
|
+
goToNextStep();
|
|
2353
2386
|
}
|
|
2354
2387
|
}
|
|
2355
|
-
)
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2388
|
+
);
|
|
2389
|
+
};
|
|
2390
|
+
|
|
2391
|
+
// src/components/GenerateCommand/embedded-script/EmbeddedScript.tsx
|
|
2392
|
+
var useGenerateEmbeddedScript = () => {
|
|
2393
|
+
const { t: t2 } = useTranslation();
|
|
2394
|
+
const { model } = useProjectModel();
|
|
2395
|
+
const extensionType = t2(
|
|
2396
|
+
"generate_command.flow.embedded_script"
|
|
2397
|
+
).toLowerCase();
|
|
2398
|
+
const [scriptFolder, setScriptFolder] = (0, import_react9.useState)();
|
|
2399
|
+
const [scriptName, setScriptName] = (0, import_react9.useState)();
|
|
2400
|
+
const [scriptType, setScriptType] = (0, import_react9.useState)();
|
|
2401
|
+
const [scriptPlacement, setScriptPlacement] = (0, import_react9.useState)();
|
|
2402
|
+
const generationTask = useGenerationTask(async () => {
|
|
2403
|
+
if (scriptFolder && scriptName && scriptType && scriptPlacement) {
|
|
2404
|
+
return generateEmbeddedScript(
|
|
2405
|
+
model.projectFolder,
|
|
2406
|
+
scriptFolder,
|
|
2407
|
+
scriptName,
|
|
2408
|
+
scriptType,
|
|
2409
|
+
scriptPlacement
|
|
2410
|
+
);
|
|
2411
|
+
}
|
|
2412
|
+
}, [scriptFolder, scriptName, scriptType, scriptPlacement]);
|
|
2413
|
+
return [
|
|
2414
|
+
/* @__PURE__ */ import_react9.default.createElement(ChooseScriptNameStep, { onSubmit: setScriptName, scriptName }),
|
|
2415
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
2416
|
+
ChooseScriptFolderStep,
|
|
2417
|
+
{
|
|
2418
|
+
onSubmit: setScriptFolder,
|
|
2419
|
+
scriptName,
|
|
2420
|
+
scriptFolder
|
|
2421
|
+
}
|
|
2422
|
+
),
|
|
2423
|
+
/* @__PURE__ */ import_react9.default.createElement(ChooseScriptTypeStep, { onSubmit: setScriptType }),
|
|
2424
|
+
/* @__PURE__ */ import_react9.default.createElement(ChooseScriptPlacementStep, { onSubmit: setScriptPlacement }),
|
|
2425
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
2426
|
+
CompleteGeneration,
|
|
2427
|
+
{
|
|
2428
|
+
generationTask,
|
|
2429
|
+
extensionType,
|
|
2430
|
+
successMessage: CompleteGenerationMessage.SuccessMessage({
|
|
2431
|
+
// https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/site-extensions/embedded-scripts/about-embedded-scripts-and-the-cli
|
|
2432
|
+
learnMoreUrl: "https://wix.to/CDGhNZG"
|
|
2433
|
+
})
|
|
2434
|
+
}
|
|
2435
|
+
)
|
|
2436
|
+
];
|
|
2394
2437
|
};
|
|
2395
2438
|
|
|
2396
2439
|
// src/components/GenerateCommand/sidebar-category/SidebarCategory.tsx
|
|
2397
2440
|
init_esm_shims();
|
|
2398
|
-
var
|
|
2399
|
-
var import_variant5 = __toESM(require_lib(), 1);
|
|
2441
|
+
var import_react10 = __toESM(require_react(), 1);
|
|
2400
2442
|
|
|
2401
2443
|
// src/components/GenerateCommand/sidebar-category/generate.ts
|
|
2402
2444
|
init_esm_shims();
|
|
@@ -2419,27 +2461,19 @@ async function generateSidebarCategory(projectFolder, config, categoryLabel) {
|
|
|
2419
2461
|
}
|
|
2420
2462
|
|
|
2421
2463
|
// src/components/GenerateCommand/sidebar-category/SidebarCategory.tsx
|
|
2422
|
-
var
|
|
2423
|
-
const bi = useWixCliAppBi();
|
|
2464
|
+
var ChooseCategoryLabelStep = ({ onSubmit, categoryLabel }) => {
|
|
2424
2465
|
const { t: t2 } = useTranslation();
|
|
2425
|
-
const
|
|
2426
|
-
model: { projectFolder, config }
|
|
2427
|
-
} = useProjectModel();
|
|
2466
|
+
const bi = useWixCliAppBi();
|
|
2428
2467
|
const extensionType = t2(
|
|
2429
2468
|
"generate_command.flow.sidebar_category"
|
|
2430
2469
|
).toLowerCase();
|
|
2431
|
-
const
|
|
2432
|
-
|
|
2433
|
-
const generationTask = useGenerationTask(async () => {
|
|
2434
|
-
if (categoryLabel) {
|
|
2435
|
-
return generateSidebarCategory(projectFolder, config, categoryLabel);
|
|
2436
|
-
}
|
|
2437
|
-
}, [categoryLabel]);
|
|
2438
|
-
return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement(
|
|
2470
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
2471
|
+
return /* @__PURE__ */ import_react10.default.createElement(
|
|
2439
2472
|
TextInput,
|
|
2440
2473
|
{
|
|
2474
|
+
isActive,
|
|
2441
2475
|
label: t2("generate_command.sidebar_category.choose_label"),
|
|
2442
|
-
placeholder: t2("generate_command.sidebar_category.label_placeholder"),
|
|
2476
|
+
placeholder: categoryLabel ?? t2("generate_command.sidebar_category.label_placeholder"),
|
|
2443
2477
|
onSubmit: (value) => {
|
|
2444
2478
|
bi.cliFlowStepAnswered({
|
|
2445
2479
|
question: t2("generate_command.sidebar_category.choose_label"),
|
|
@@ -2447,50 +2481,51 @@ var GenerateSidebarCategory = () => {
|
|
|
2447
2481
|
answer: value,
|
|
2448
2482
|
additionalInfo: { extensionType }
|
|
2449
2483
|
});
|
|
2450
|
-
|
|
2484
|
+
onSubmit(value);
|
|
2485
|
+
goToNextStep();
|
|
2451
2486
|
}
|
|
2452
2487
|
}
|
|
2453
|
-
)
|
|
2454
|
-
() => (0, import_variant5.match)(generationTask, {
|
|
2455
|
-
Error: () => null,
|
|
2456
|
-
Success: ({ hasUpdatedDependencies }) => {
|
|
2457
|
-
if (hasUpdatedDependencies) {
|
|
2458
|
-
return /* @__PURE__ */ import_react9.default.createElement(
|
|
2459
|
-
InstallDependencies,
|
|
2460
|
-
{
|
|
2461
|
-
onFinish: () => setFinishedInstallation(true)
|
|
2462
|
-
}
|
|
2463
|
-
);
|
|
2464
|
-
}
|
|
2465
|
-
setFinishedInstallation(true);
|
|
2466
|
-
return null;
|
|
2467
|
-
},
|
|
2468
|
-
Loading: () => /* @__PURE__ */ import_react9.default.createElement(
|
|
2469
|
-
Spinner,
|
|
2470
|
-
{
|
|
2471
|
-
text: t2("generate_command.generation.loading", {
|
|
2472
|
-
subject: extensionType
|
|
2473
|
-
})
|
|
2474
|
-
}
|
|
2475
|
-
),
|
|
2476
|
-
NotRequested: () => null
|
|
2477
|
-
}),
|
|
2478
|
-
[generationTask, setFinishedInstallation, t2, extensionType]
|
|
2479
|
-
), finishedInstallation && /* @__PURE__ */ import_react9.default.createElement(Box_default, { flexDirection: "column" }, /* @__PURE__ */ import_react9.default.createElement(Text, null, t2("generate_command.generation.done", {
|
|
2480
|
-
extensionType
|
|
2481
|
-
})), /* @__PURE__ */ import_react9.default.createElement(
|
|
2482
|
-
Trans,
|
|
2483
|
-
{
|
|
2484
|
-
i18nKey: "generate_command.generation.learn_more",
|
|
2485
|
-
values: { extensionType },
|
|
2486
|
-
components: [/* @__PURE__ */ import_react9.default.createElement(Learn, null), /* @__PURE__ */ import_react9.default.createElement(Link, { url: "https://wix.to/7W3nYUg" })]
|
|
2487
|
-
}
|
|
2488
|
-
)));
|
|
2488
|
+
);
|
|
2489
2489
|
};
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2490
|
+
var useGenerateSidebarCategory = () => {
|
|
2491
|
+
const { t: t2 } = useTranslation();
|
|
2492
|
+
const {
|
|
2493
|
+
model: { projectFolder, config }
|
|
2494
|
+
} = useProjectModel();
|
|
2495
|
+
const extensionType = t2(
|
|
2496
|
+
"generate_command.flow.sidebar_category"
|
|
2497
|
+
).toLowerCase();
|
|
2498
|
+
const [categoryLabel, setCategoryLabel] = (0, import_react10.useState)();
|
|
2499
|
+
const generationTask = useGenerationTask(async () => {
|
|
2500
|
+
if (categoryLabel) {
|
|
2501
|
+
return generateSidebarCategory(projectFolder, config, categoryLabel);
|
|
2502
|
+
}
|
|
2503
|
+
}, [categoryLabel]);
|
|
2504
|
+
return [
|
|
2505
|
+
/* @__PURE__ */ import_react10.default.createElement(
|
|
2506
|
+
ChooseCategoryLabelStep,
|
|
2507
|
+
{
|
|
2508
|
+
onSubmit: setCategoryLabel,
|
|
2509
|
+
categoryLabel
|
|
2510
|
+
}
|
|
2511
|
+
),
|
|
2512
|
+
/* @__PURE__ */ import_react10.default.createElement(
|
|
2513
|
+
CompleteGeneration,
|
|
2514
|
+
{
|
|
2515
|
+
generationTask,
|
|
2516
|
+
extensionType,
|
|
2517
|
+
successMessage: CompleteGenerationMessage.SuccessMessage({
|
|
2518
|
+
// https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/dashboard-extensions/dashboard-pages/dashboard-page-extension-files-and-code
|
|
2519
|
+
learnMoreUrl: "https://wix.to/7W3nYUg"
|
|
2520
|
+
})
|
|
2521
|
+
}
|
|
2522
|
+
)
|
|
2523
|
+
];
|
|
2524
|
+
};
|
|
2525
|
+
|
|
2526
|
+
// src/components/GenerateCommand/dashboard-modal/DashboardModal.tsx
|
|
2527
|
+
init_esm_shims();
|
|
2528
|
+
var import_react12 = __toESM(require_react(), 1);
|
|
2494
2529
|
|
|
2495
2530
|
// src/components/GenerateCommand/dashboard-modal/generate.ts
|
|
2496
2531
|
init_esm_shims();
|
|
@@ -2525,7 +2560,7 @@ async function generateDashboardModal(projectFolder, route, title) {
|
|
|
2525
2560
|
|
|
2526
2561
|
// src/components/GenerateCommand/dashboard-modal/steps.tsx
|
|
2527
2562
|
init_esm_shims();
|
|
2528
|
-
var
|
|
2563
|
+
var import_react11 = __toESM(require_react(), 1);
|
|
2529
2564
|
var import_lodash3 = __toESM(require_lodash(), 1);
|
|
2530
2565
|
var ChooseTitleStep = ({
|
|
2531
2566
|
onSubmit
|
|
@@ -2536,7 +2571,7 @@ var ChooseTitleStep = ({
|
|
|
2536
2571
|
const extensionType = t2(
|
|
2537
2572
|
"generate_command.flow.dashboard_modal"
|
|
2538
2573
|
).toLowerCase();
|
|
2539
|
-
return /* @__PURE__ */
|
|
2574
|
+
return /* @__PURE__ */ import_react11.default.createElement(
|
|
2540
2575
|
TextInput,
|
|
2541
2576
|
{
|
|
2542
2577
|
isActive,
|
|
@@ -2585,7 +2620,7 @@ var ChooseFolderStep = ({ onSubmit, modalTitle, modalFolder }) => {
|
|
|
2585
2620
|
]
|
|
2586
2621
|
])
|
|
2587
2622
|
);
|
|
2588
|
-
return /* @__PURE__ */
|
|
2623
|
+
return /* @__PURE__ */ import_react11.default.createElement(
|
|
2589
2624
|
TextInput,
|
|
2590
2625
|
{
|
|
2591
2626
|
isActive,
|
|
@@ -2613,8 +2648,8 @@ var useGenerateDashboardModal = () => {
|
|
|
2613
2648
|
const extensionType = t2(
|
|
2614
2649
|
"generate_command.flow.dashboard_modal"
|
|
2615
2650
|
).toLowerCase();
|
|
2616
|
-
const [modalFolder, setModalFolder] = (0,
|
|
2617
|
-
const [modalTitle, setModalTitle] = (0,
|
|
2651
|
+
const [modalFolder, setModalFolder] = (0, import_react12.useState)();
|
|
2652
|
+
const [modalTitle, setModalTitle] = (0, import_react12.useState)();
|
|
2618
2653
|
const modalQuestionsAnswered = modalFolder && modalTitle;
|
|
2619
2654
|
const generationTask = useGenerationTask(async () => {
|
|
2620
2655
|
if (!modalQuestionsAnswered) {
|
|
@@ -2623,8 +2658,8 @@ var useGenerateDashboardModal = () => {
|
|
|
2623
2658
|
return generateDashboardModal(model.projectFolder, modalFolder, modalTitle);
|
|
2624
2659
|
}, [modalQuestionsAnswered]);
|
|
2625
2660
|
return [
|
|
2626
|
-
/* @__PURE__ */
|
|
2627
|
-
/* @__PURE__ */
|
|
2661
|
+
/* @__PURE__ */ import_react12.default.createElement(ChooseTitleStep, { onSubmit: setModalTitle }),
|
|
2662
|
+
/* @__PURE__ */ import_react12.default.createElement(
|
|
2628
2663
|
ChooseFolderStep,
|
|
2629
2664
|
{
|
|
2630
2665
|
onSubmit: setModalFolder,
|
|
@@ -2632,12 +2667,15 @@ var useGenerateDashboardModal = () => {
|
|
|
2632
2667
|
modalFolder
|
|
2633
2668
|
}
|
|
2634
2669
|
),
|
|
2635
|
-
/* @__PURE__ */
|
|
2670
|
+
/* @__PURE__ */ import_react12.default.createElement(
|
|
2636
2671
|
CompleteGeneration,
|
|
2637
2672
|
{
|
|
2638
2673
|
generationTask,
|
|
2639
2674
|
extensionType,
|
|
2640
|
-
|
|
2675
|
+
successMessage: CompleteGenerationMessage.SuccessMessage({
|
|
2676
|
+
// https://dev.wix.com/docs/build-apps/developer-tools/cli/wix-cli-for-apps/extensions/dashboard-modal-extensions-files-and-code
|
|
2677
|
+
learnMoreUrl: "https://wix.to/zh5ZfMK"
|
|
2678
|
+
}),
|
|
2641
2679
|
route: modalFolder
|
|
2642
2680
|
}
|
|
2643
2681
|
)
|
|
@@ -2649,14 +2687,13 @@ init_esm_shims();
|
|
|
2649
2687
|
|
|
2650
2688
|
// src/components/GenerateCommand/service-plugin/ServicePlugin.tsx
|
|
2651
2689
|
init_esm_shims();
|
|
2652
|
-
var
|
|
2653
|
-
var import_variant7 = __toESM(require_lib(), 1);
|
|
2690
|
+
var import_react14 = __toESM(require_react(), 1);
|
|
2654
2691
|
|
|
2655
2692
|
// src/components/GenerateCommand/service-plugin/generate.ts
|
|
2656
2693
|
init_esm_shims();
|
|
2657
2694
|
import path6 from "node:path";
|
|
2658
2695
|
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
2659
|
-
var
|
|
2696
|
+
var import_variant4 = __toESM(require_lib(), 1);
|
|
2660
2697
|
var SERVICE_PLUGIN_TEMPLATE = path6.resolve(
|
|
2661
2698
|
__dirname,
|
|
2662
2699
|
"../templates/service-plugin"
|
|
@@ -2673,7 +2710,7 @@ async function generateServicePlugin(projectFolder, servicePluginType, name) {
|
|
|
2673
2710
|
id: randomUUID5(),
|
|
2674
2711
|
name
|
|
2675
2712
|
};
|
|
2676
|
-
const servicePluginConfig = (0,
|
|
2713
|
+
const servicePluginConfig = (0, import_variant4.match)(servicePluginType, {
|
|
2677
2714
|
ECOM_ADDITIONAL_FEES: () => ({}),
|
|
2678
2715
|
ECOM_SHIPPING_RATES: () => ({
|
|
2679
2716
|
name: "Shipping Rates Provider",
|
|
@@ -2705,16 +2742,14 @@ async function generateServicePlugin(projectFolder, servicePluginType, name) {
|
|
|
2705
2742
|
});
|
|
2706
2743
|
}
|
|
2707
2744
|
|
|
2708
|
-
// src/components/GenerateCommand/service-plugin/
|
|
2709
|
-
|
|
2745
|
+
// src/components/GenerateCommand/service-plugin/steps.tsx
|
|
2746
|
+
init_esm_shims();
|
|
2747
|
+
var import_react13 = __toESM(require_react(), 1);
|
|
2748
|
+
var SelectServicePluginStep = ({ onSubmit, typeOption }) => {
|
|
2710
2749
|
const bi = useWixCliAppBi();
|
|
2711
2750
|
const { t: t2 } = useTranslation();
|
|
2712
|
-
const {
|
|
2713
|
-
const
|
|
2714
|
-
const [type, setType] = (0, import_react12.useState)();
|
|
2715
|
-
const [name, setName] = (0, import_react12.useState)();
|
|
2716
|
-
const [finishedInstallation, setFinishedInstallation] = (0, import_react12.useState)(false);
|
|
2717
|
-
const generateServicePluginOptions = (0, import_react12.useMemo)(
|
|
2751
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
2752
|
+
const generateServicePluginOptions = (0, import_react13.useMemo)(
|
|
2718
2753
|
() => [
|
|
2719
2754
|
{
|
|
2720
2755
|
title: t2("generate_command.service_plugin.groups.stores"),
|
|
@@ -2750,44 +2785,43 @@ var GenerateServicePlugin = () => {
|
|
|
2750
2785
|
],
|
|
2751
2786
|
[t2]
|
|
2752
2787
|
);
|
|
2753
|
-
const
|
|
2754
|
-
const selectSupportedServicePlugin = (0, import_react12.useCallback)(
|
|
2788
|
+
const selectSupportedServicePlugin = (0, import_react13.useCallback)(
|
|
2755
2789
|
(supportedServicePlugin) => {
|
|
2756
2790
|
bi.cliFlowStepAnswered({
|
|
2757
2791
|
question: t2("generate_command.service_plugin.choose_type"),
|
|
2758
2792
|
questionKey: "generate_command.service_plugin.choose_type",
|
|
2759
2793
|
answer: supportedServicePlugin.title
|
|
2760
2794
|
});
|
|
2761
|
-
|
|
2795
|
+
onSubmit(supportedServicePlugin);
|
|
2796
|
+
goToNextStep();
|
|
2762
2797
|
},
|
|
2763
|
-
[bi, t2]
|
|
2764
|
-
);
|
|
2765
|
-
const validateServicePluginFolder = useValidation(
|
|
2766
|
-
createServicePluginValidation(getExtensions("ServicePlugin"), type)
|
|
2798
|
+
[bi, t2, onSubmit, goToNextStep]
|
|
2767
2799
|
);
|
|
2768
|
-
|
|
2769
|
-
if (name && type) {
|
|
2770
|
-
const result = await generateServicePlugin(
|
|
2771
|
-
model.projectFolder,
|
|
2772
|
-
type,
|
|
2773
|
-
name
|
|
2774
|
-
);
|
|
2775
|
-
return result;
|
|
2776
|
-
}
|
|
2777
|
-
}, [name, type]);
|
|
2778
|
-
return /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, /* @__PURE__ */ import_react12.default.createElement(
|
|
2800
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
2779
2801
|
SelectGroupsInput,
|
|
2780
2802
|
{
|
|
2803
|
+
value: !isActive && typeOption ? InputState.Submitted(typeOption) : InputState.NotSubmitted(typeOption),
|
|
2781
2804
|
label: t2("generate_command.service_plugin.choose_type"),
|
|
2782
2805
|
groups: generateServicePluginOptions,
|
|
2783
2806
|
onSubmit: selectSupportedServicePlugin,
|
|
2784
2807
|
maxHeight: 14
|
|
2785
2808
|
}
|
|
2786
|
-
)
|
|
2809
|
+
);
|
|
2810
|
+
};
|
|
2811
|
+
var ChooseNameStep = ({ onSubmit, type, name }) => {
|
|
2812
|
+
const bi = useWixCliAppBi();
|
|
2813
|
+
const { t: t2 } = useTranslation();
|
|
2814
|
+
const { getExtensions } = useExtensions();
|
|
2815
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
2816
|
+
const validateServicePluginFolder = useValidation(
|
|
2817
|
+
createServicePluginValidation(getExtensions("ServicePlugin"), type)
|
|
2818
|
+
);
|
|
2819
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
2787
2820
|
TextInput,
|
|
2788
2821
|
{
|
|
2822
|
+
isActive,
|
|
2789
2823
|
label: t2("generate_command.service_plugin.choose_name"),
|
|
2790
|
-
placeholder: t2("generate_command.service_plugin.name_placeholder"),
|
|
2824
|
+
placeholder: name ?? t2("generate_command.service_plugin.name_placeholder"),
|
|
2791
2825
|
onSubmit: (value) => {
|
|
2792
2826
|
bi.cliFlowStepAnswered({
|
|
2793
2827
|
question: t2("generate_command.service_plugin.choose_name"),
|
|
@@ -2795,60 +2829,63 @@ var GenerateServicePlugin = () => {
|
|
|
2795
2829
|
answer: value,
|
|
2796
2830
|
additionalInfo: { servicePluginType: type }
|
|
2797
2831
|
});
|
|
2798
|
-
|
|
2832
|
+
onSubmit(value);
|
|
2833
|
+
goToNextStep();
|
|
2799
2834
|
},
|
|
2800
2835
|
validate: validateServicePluginFolder
|
|
2801
2836
|
}
|
|
2802
|
-
)
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2837
|
+
);
|
|
2838
|
+
};
|
|
2839
|
+
|
|
2840
|
+
// src/components/GenerateCommand/service-plugin/ServicePlugin.tsx
|
|
2841
|
+
var useGenerateServicePlugin = () => {
|
|
2842
|
+
const { t: t2 } = useTranslation();
|
|
2843
|
+
const { model } = useProjectModel();
|
|
2844
|
+
const [typeOption, setTypeOption] = (0, import_react14.useState)();
|
|
2845
|
+
const [name, setName] = (0, import_react14.useState)();
|
|
2846
|
+
const extensionType = t2("generate_command.flow.service_plugin").toLowerCase();
|
|
2847
|
+
const generationTask = useGenerationTask(async () => {
|
|
2848
|
+
if (name && typeOption) {
|
|
2849
|
+
const result = await generateServicePlugin(
|
|
2850
|
+
model.projectFolder,
|
|
2851
|
+
typeOption.value,
|
|
2852
|
+
name
|
|
2853
|
+
);
|
|
2854
|
+
return result;
|
|
2855
|
+
}
|
|
2856
|
+
}, [name, typeOption]);
|
|
2857
|
+
return [
|
|
2858
|
+
/* @__PURE__ */ import_react14.default.createElement(
|
|
2859
|
+
SelectServicePluginStep,
|
|
2860
|
+
{
|
|
2861
|
+
onSubmit: setTypeOption,
|
|
2862
|
+
typeOption
|
|
2863
|
+
}
|
|
2864
|
+
),
|
|
2865
|
+
/* @__PURE__ */ import_react14.default.createElement(ChooseNameStep, { onSubmit: setName, name, type: typeOption?.value }),
|
|
2866
|
+
/* @__PURE__ */ import_react14.default.createElement(
|
|
2867
|
+
CompleteGeneration,
|
|
2868
|
+
{
|
|
2869
|
+
generationTask,
|
|
2870
|
+
extensionType,
|
|
2871
|
+
successMessage: CompleteGenerationMessage.SuccessMessage({
|
|
2872
|
+
// Original URL: https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/backend-extensions/service-plugins/add-service-plugin-extensions-with-the-cli
|
|
2873
|
+
learnMoreUrl: "https://wix.to/YWyluDf"
|
|
2874
|
+
})
|
|
2875
|
+
}
|
|
2876
|
+
)
|
|
2877
|
+
];
|
|
2841
2878
|
};
|
|
2842
2879
|
|
|
2843
2880
|
// src/components/GenerateCommand/plugins/DashboardPlugin.tsx
|
|
2844
2881
|
init_esm_shims();
|
|
2845
|
-
var
|
|
2846
|
-
var
|
|
2882
|
+
var import_react23 = __toESM(require_react(), 1);
|
|
2883
|
+
var import_variant11 = __toESM(require_lib(), 1);
|
|
2847
2884
|
|
|
2848
2885
|
// src/components/GenerateCommand/plugins/dashboard-plugin/DashboardPluginWizard.tsx
|
|
2849
2886
|
init_esm_shims();
|
|
2850
|
-
var
|
|
2851
|
-
var
|
|
2887
|
+
var import_react18 = __toESM(require_react(), 1);
|
|
2888
|
+
var import_variant7 = __toESM(require_lib(), 1);
|
|
2852
2889
|
var import_lodash4 = __toESM(require_lodash(), 1);
|
|
2853
2890
|
|
|
2854
2891
|
// src/components/GenerateCommand/plugins/dashboard-plugin/generate.ts
|
|
@@ -2882,8 +2919,8 @@ async function generateDashboardPlugin(projectFolder, extended, folder, title, i
|
|
|
2882
2919
|
|
|
2883
2920
|
// src/components/GenerateCommand/AppRequirement.tsx
|
|
2884
2921
|
init_esm_shims();
|
|
2885
|
-
var
|
|
2886
|
-
var
|
|
2922
|
+
var import_react15 = __toESM(require_react(), 1);
|
|
2923
|
+
var import_variant5 = __toESM(require_lib(), 1);
|
|
2887
2924
|
var AppRequirement = ({
|
|
2888
2925
|
appId,
|
|
2889
2926
|
requiredApps,
|
|
@@ -2910,9 +2947,9 @@ var AppRequirement = ({
|
|
|
2910
2947
|
}
|
|
2911
2948
|
return appsToRequire;
|
|
2912
2949
|
}, []);
|
|
2913
|
-
const handleSubmit = (0,
|
|
2950
|
+
const handleSubmit = (0, import_react15.useCallback)(
|
|
2914
2951
|
(shouldRequire) => {
|
|
2915
|
-
if ((0,
|
|
2952
|
+
if ((0, import_variant5.isType)(status, "Success")) {
|
|
2916
2953
|
bi.cliFlowStepAnswered({
|
|
2917
2954
|
question: t2("generate_command.required_app", {
|
|
2918
2955
|
appsNames: status.result.map((requiredApp) => requiredApp.name).join(", ")
|
|
@@ -2932,37 +2969,37 @@ var AppRequirement = ({
|
|
|
2932
2969
|
},
|
|
2933
2970
|
[bi, onSubmit, t2, status]
|
|
2934
2971
|
);
|
|
2935
|
-
return /* @__PURE__ */
|
|
2936
|
-
Success: ({ result: appsToRequire }) => appsToRequire.length > 0 && /* @__PURE__ */
|
|
2972
|
+
return /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, (0, import_variant5.match)(status, {
|
|
2973
|
+
Success: ({ result: appsToRequire }) => appsToRequire.length > 0 && /* @__PURE__ */ import_react15.default.createElement(Box_default, { marginBottom: 1 }, /* @__PURE__ */ import_react15.default.createElement(
|
|
2937
2974
|
ConfirmInput,
|
|
2938
2975
|
{
|
|
2939
2976
|
label: t2("generate_command.required_app", {
|
|
2940
2977
|
appsNames: appsToRequire.map((requiredApp) => requiredApp.name).join(", ")
|
|
2941
2978
|
}),
|
|
2942
|
-
info: /* @__PURE__ */
|
|
2979
|
+
info: /* @__PURE__ */ import_react15.default.createElement(
|
|
2943
2980
|
Trans,
|
|
2944
2981
|
{
|
|
2945
2982
|
i18nKey: "generate_command.required_app.description",
|
|
2946
2983
|
values: {
|
|
2947
2984
|
appsNames: appsToRequire.map((requiredApp) => requiredApp.name).join(", ")
|
|
2948
2985
|
},
|
|
2949
|
-
components: [/* @__PURE__ */
|
|
2986
|
+
components: [/* @__PURE__ */ import_react15.default.createElement(Link, { url: "https://wix.to/YAydHiJ" })]
|
|
2950
2987
|
}
|
|
2951
2988
|
),
|
|
2952
2989
|
onSubmit: handleSubmit
|
|
2953
2990
|
}
|
|
2954
2991
|
)),
|
|
2955
|
-
Loading: () => /* @__PURE__ */
|
|
2992
|
+
Loading: () => /* @__PURE__ */ import_react15.default.createElement(Spinner, null),
|
|
2956
2993
|
Error: () => null
|
|
2957
2994
|
}));
|
|
2958
2995
|
};
|
|
2959
2996
|
|
|
2960
2997
|
// src/components/GenerateCommand/MultipleAppRequirement.tsx
|
|
2961
2998
|
init_esm_shims();
|
|
2962
|
-
var
|
|
2963
|
-
var
|
|
2964
|
-
var RequiredAppOptions = (0,
|
|
2965
|
-
Available: (0,
|
|
2999
|
+
var import_react16 = __toESM(require_react(), 1);
|
|
3000
|
+
var import_variant6 = __toESM(require_lib(), 1);
|
|
3001
|
+
var RequiredAppOptions = (0, import_variant6.variant)({
|
|
3002
|
+
Available: (0, import_variant6.fields)(),
|
|
2966
3003
|
FailedToGetRequiredApps: {}
|
|
2967
3004
|
});
|
|
2968
3005
|
var MultipleAppRequirement = ({
|
|
@@ -2974,7 +3011,7 @@ var MultipleAppRequirement = ({
|
|
|
2974
3011
|
const { t: t2 } = useTranslation();
|
|
2975
3012
|
const { getRequiredApps } = useDevCenterClient();
|
|
2976
3013
|
const { reportError } = useErrorReporter();
|
|
2977
|
-
const handleSubmit = (0,
|
|
3014
|
+
const handleSubmit = (0, import_react16.useCallback)(
|
|
2978
3015
|
(option) => {
|
|
2979
3016
|
bi.cliFlowStepAnswered({
|
|
2980
3017
|
question: t2("generate_command.required_business_solution"),
|
|
@@ -3008,12 +3045,12 @@ var MultipleAppRequirement = ({
|
|
|
3008
3045
|
value: ""
|
|
3009
3046
|
});
|
|
3010
3047
|
const initialIndex = options.findIndex(
|
|
3011
|
-
(_) => !(0,
|
|
3048
|
+
(_) => !(0, import_variant6.isType)(_.availability, SelectOptionAvailability.Disabled)
|
|
3012
3049
|
);
|
|
3013
3050
|
return RequiredAppOptions.Available({ options, initialIndex });
|
|
3014
3051
|
}, [getRequiredApps, appId]);
|
|
3015
|
-
return /* @__PURE__ */
|
|
3016
|
-
Loading: () => /* @__PURE__ */
|
|
3052
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, (0, import_variant6.match)(status, {
|
|
3053
|
+
Loading: () => /* @__PURE__ */ import_react16.default.createElement(
|
|
3017
3054
|
Spinner,
|
|
3018
3055
|
{
|
|
3019
3056
|
text: t2("generate_command.required_business_solution.loading")
|
|
@@ -3021,8 +3058,8 @@ var MultipleAppRequirement = ({
|
|
|
3021
3058
|
),
|
|
3022
3059
|
Error: () => null,
|
|
3023
3060
|
Success: ({ result }) => {
|
|
3024
|
-
return (0,
|
|
3025
|
-
Available: ({ options, initialIndex }) => /* @__PURE__ */
|
|
3061
|
+
return (0, import_variant6.match)(result, {
|
|
3062
|
+
Available: ({ options, initialIndex }) => /* @__PURE__ */ import_react16.default.createElement(
|
|
3026
3063
|
SelectInput,
|
|
3027
3064
|
{
|
|
3028
3065
|
label: t2("generate_command.required_business_solution"),
|
|
@@ -3034,18 +3071,18 @@ var MultipleAppRequirement = ({
|
|
|
3034
3071
|
onSubmit: handleSubmit
|
|
3035
3072
|
}
|
|
3036
3073
|
),
|
|
3037
|
-
FailedToGetRequiredApps: () => /* @__PURE__ */
|
|
3074
|
+
FailedToGetRequiredApps: () => /* @__PURE__ */ import_react16.default.createElement(Box_default, { marginBottom: 1, gap: 1, flexDirection: "column" }, /* @__PURE__ */ import_react16.default.createElement(InputLabel, null, t2("generate_command.required_business_solution")), /* @__PURE__ */ import_react16.default.createElement(
|
|
3038
3075
|
ErrorDetails,
|
|
3039
3076
|
{
|
|
3040
3077
|
message: t2(
|
|
3041
3078
|
"generate_command.required_business_solution.error"
|
|
3042
3079
|
),
|
|
3043
|
-
hint: /* @__PURE__ */
|
|
3080
|
+
hint: /* @__PURE__ */ import_react16.default.createElement(
|
|
3044
3081
|
Trans,
|
|
3045
3082
|
{
|
|
3046
3083
|
i18nKey: "generate_command.required_business_solution.error.hint",
|
|
3047
3084
|
components: [
|
|
3048
|
-
/* @__PURE__ */
|
|
3085
|
+
/* @__PURE__ */ import_react16.default.createElement(
|
|
3049
3086
|
Link,
|
|
3050
3087
|
{
|
|
3051
3088
|
url: `https://manage.wix.com/apps/${appId}/dev-center-giza-market-listing/app-audience?referralInfo=wix-cli`
|
|
@@ -3063,7 +3100,7 @@ var MultipleAppRequirement = ({
|
|
|
3063
3100
|
|
|
3064
3101
|
// src/components/GenerateCommand/plugins/dashboard-plugin/DashboardPluginGeneratedNote.tsx
|
|
3065
3102
|
init_esm_shims();
|
|
3066
|
-
var
|
|
3103
|
+
var import_react17 = __toESM(require_react(), 1);
|
|
3067
3104
|
var customGroupMessages = /* @__PURE__ */ new Map([
|
|
3068
3105
|
["Checkout & Orders", "generate_command.generation.ecommerce_notification"]
|
|
3069
3106
|
]);
|
|
@@ -3073,14 +3110,14 @@ var DashboardPluginGeneratedNote = ({ backofficeExtensionWidget, generatedFiles
|
|
|
3073
3110
|
"generate_command.flow.dashboard_plugin"
|
|
3074
3111
|
).toLowerCase();
|
|
3075
3112
|
const customKey = customGroupMessages.get(backofficeExtensionWidget.appName);
|
|
3076
|
-
return /* @__PURE__ */
|
|
3113
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
3077
3114
|
GenerationSuccessMessage,
|
|
3078
3115
|
{
|
|
3079
3116
|
extensionType,
|
|
3080
3117
|
generatedFiles,
|
|
3081
3118
|
learnMoreUrl: "https://wix.to/dFFuEki"
|
|
3082
3119
|
},
|
|
3083
|
-
customKey ? /* @__PURE__ */
|
|
3120
|
+
customKey ? /* @__PURE__ */ import_react17.default.createElement(Text, null, t2(customKey)) : null
|
|
3084
3121
|
);
|
|
3085
3122
|
};
|
|
3086
3123
|
|
|
@@ -3097,15 +3134,15 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3097
3134
|
const { getExtensions } = useExtensions();
|
|
3098
3135
|
const { reportError } = useErrorReporter();
|
|
3099
3136
|
const { getSdkSlotData } = useExtensionDataClient();
|
|
3100
|
-
const [backofficeExtensionWidget, setBackofficeExtensionWidget] = (0,
|
|
3137
|
+
const [backofficeExtensionWidget, setBackofficeExtensionWidget] = (0, import_react18.useState)();
|
|
3101
3138
|
const extensionType = t2(
|
|
3102
3139
|
"generate_command.flow.dashboard_plugin"
|
|
3103
3140
|
).toLowerCase();
|
|
3104
3141
|
const dashboardPlugins = getExtensions("DashboardPlugin");
|
|
3105
|
-
const [folder, setFolder] = (0,
|
|
3106
|
-
const [title, setTitle] = (0,
|
|
3107
|
-
const [requireAppsIds, setRequireAppsIds] = (0,
|
|
3108
|
-
const [finishedInstallation, setFinishedInstallation] = (0,
|
|
3142
|
+
const [folder, setFolder] = (0, import_react18.useState)();
|
|
3143
|
+
const [title, setTitle] = (0, import_react18.useState)();
|
|
3144
|
+
const [requireAppsIds, setRequireAppsIds] = (0, import_react18.useState)();
|
|
3145
|
+
const [finishedInstallation, setFinishedInstallation] = (0, import_react18.useState)(false);
|
|
3109
3146
|
const defaultFolderName = (0, import_lodash4.kebabCase)(title);
|
|
3110
3147
|
const validatePluginFolder = useValidation(
|
|
3111
3148
|
createDashboardPluginValidation(dashboardPlugins)
|
|
@@ -3151,12 +3188,12 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3151
3188
|
if (backofficeExtensionWidget2) {
|
|
3152
3189
|
extensionsByApps[backofficePage.component.componentId]?.items.push({
|
|
3153
3190
|
title: backofficeExtensionWidget2.component.data.backOfficeExtensionContainer.slotData?.displayName ?? backofficeExtensionWidget2.component.name,
|
|
3154
|
-
description: /* @__PURE__ */
|
|
3191
|
+
description: /* @__PURE__ */ import_react18.default.createElement(
|
|
3155
3192
|
Trans,
|
|
3156
3193
|
{
|
|
3157
3194
|
i18nKey: "generate_command.dashboard_plugin.what_to_extend.item_description",
|
|
3158
3195
|
components: [
|
|
3159
|
-
/* @__PURE__ */
|
|
3196
|
+
/* @__PURE__ */ import_react18.default.createElement(
|
|
3160
3197
|
Link,
|
|
3161
3198
|
{
|
|
3162
3199
|
url: docsLink(
|
|
@@ -3183,18 +3220,18 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3183
3220
|
backofficeExtensionWidgets.sort((a, b) => a.title.localeCompare(b.title));
|
|
3184
3221
|
return backofficeExtensionWidgets;
|
|
3185
3222
|
}, []);
|
|
3186
|
-
const task = (0,
|
|
3187
|
-
() => (0,
|
|
3223
|
+
const task = (0, import_react18.useMemo)(
|
|
3224
|
+
() => (0, import_variant7.match)(generationTask, {
|
|
3188
3225
|
Success: ({ hasUpdatedDependencies, newFiles }) => {
|
|
3189
3226
|
if (!hasUpdatedDependencies) {
|
|
3190
3227
|
setFinishedInstallation(true);
|
|
3191
3228
|
}
|
|
3192
|
-
return /* @__PURE__ */
|
|
3229
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, hasUpdatedDependencies && /* @__PURE__ */ import_react18.default.createElement(
|
|
3193
3230
|
InstallDependencies,
|
|
3194
3231
|
{
|
|
3195
3232
|
onFinish: () => setFinishedInstallation(true)
|
|
3196
3233
|
}
|
|
3197
|
-
), finishedInstallation && backofficeExtensionWidget && /* @__PURE__ */
|
|
3234
|
+
), finishedInstallation && backofficeExtensionWidget && /* @__PURE__ */ import_react18.default.createElement(
|
|
3198
3235
|
DashboardPluginGeneratedNote,
|
|
3199
3236
|
{
|
|
3200
3237
|
backofficeExtensionWidget,
|
|
@@ -3202,7 +3239,7 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3202
3239
|
}
|
|
3203
3240
|
));
|
|
3204
3241
|
},
|
|
3205
|
-
Loading: () => /* @__PURE__ */
|
|
3242
|
+
Loading: () => /* @__PURE__ */ import_react18.default.createElement(
|
|
3206
3243
|
Spinner,
|
|
3207
3244
|
{
|
|
3208
3245
|
text: t2("generate_command.generation.loading", {
|
|
@@ -3221,18 +3258,18 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3221
3258
|
backofficeExtensionWidget
|
|
3222
3259
|
]
|
|
3223
3260
|
);
|
|
3224
|
-
return (0,
|
|
3261
|
+
return (0, import_variant7.match)(status, {
|
|
3225
3262
|
Error: () => null,
|
|
3226
|
-
Loading: () => /* @__PURE__ */
|
|
3227
|
-
Success: ({ result: backofficeExtensionWidgets }) => /* @__PURE__ */
|
|
3263
|
+
Loading: () => /* @__PURE__ */ import_react18.default.createElement(Spinner, { text: t2("general.loading") }),
|
|
3264
|
+
Success: ({ result: backofficeExtensionWidgets }) => /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement(
|
|
3228
3265
|
SelectGroupsInput,
|
|
3229
3266
|
{
|
|
3230
3267
|
label: t2("generate_command.dashboard_plugin.what_to_extend"),
|
|
3231
|
-
info: /* @__PURE__ */
|
|
3268
|
+
info: /* @__PURE__ */ import_react18.default.createElement(
|
|
3232
3269
|
Trans,
|
|
3233
3270
|
{
|
|
3234
3271
|
i18nKey: "generate_command.dashboard_plugin.what_to_extend.description",
|
|
3235
|
-
components: [/* @__PURE__ */
|
|
3272
|
+
components: [/* @__PURE__ */ import_react18.default.createElement(Link, { url: "https://wix.to/ZeCt07g" })]
|
|
3236
3273
|
}
|
|
3237
3274
|
),
|
|
3238
3275
|
hideScroll: true,
|
|
@@ -3247,7 +3284,7 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3247
3284
|
setBackofficeExtensionWidget(option.value);
|
|
3248
3285
|
}
|
|
3249
3286
|
}
|
|
3250
|
-
), backofficeExtensionWidget && (slotsApp.requiredApps.length === 1 ? /* @__PURE__ */
|
|
3287
|
+
), backofficeExtensionWidget && (slotsApp.requiredApps.length === 1 ? /* @__PURE__ */ import_react18.default.createElement(
|
|
3251
3288
|
AppRequirement,
|
|
3252
3289
|
{
|
|
3253
3290
|
appId: model.config.appId,
|
|
@@ -3259,7 +3296,7 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3259
3296
|
],
|
|
3260
3297
|
onSubmit: setRequireAppsIds
|
|
3261
3298
|
}
|
|
3262
|
-
) : /* @__PURE__ */
|
|
3299
|
+
) : /* @__PURE__ */ import_react18.default.createElement(
|
|
3263
3300
|
MultipleAppRequirement,
|
|
3264
3301
|
{
|
|
3265
3302
|
appId: model.config.appId,
|
|
@@ -3269,7 +3306,7 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3269
3306
|
})),
|
|
3270
3307
|
onSubmit: setRequireAppsIds
|
|
3271
3308
|
}
|
|
3272
|
-
)), requireAppsIds && /* @__PURE__ */
|
|
3309
|
+
)), requireAppsIds && /* @__PURE__ */ import_react18.default.createElement(
|
|
3273
3310
|
TextInput,
|
|
3274
3311
|
{
|
|
3275
3312
|
label: t2("generate_command.dashboard_plugin.choose_title"),
|
|
@@ -3286,7 +3323,7 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3286
3323
|
setTitle(value);
|
|
3287
3324
|
}
|
|
3288
3325
|
}
|
|
3289
|
-
), title && /* @__PURE__ */
|
|
3326
|
+
), title && /* @__PURE__ */ import_react18.default.createElement(
|
|
3290
3327
|
TextInput,
|
|
3291
3328
|
{
|
|
3292
3329
|
label: t2("generate_command.dashboard_plugin.choose_folder"),
|
|
@@ -3308,8 +3345,8 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3308
3345
|
|
|
3309
3346
|
// src/components/GenerateCommand/plugins/dashboad-menu-plugin/DashboardMenuPluginWizard.tsx
|
|
3310
3347
|
init_esm_shims();
|
|
3311
|
-
var
|
|
3312
|
-
var
|
|
3348
|
+
var import_react22 = __toESM(require_react(), 1);
|
|
3349
|
+
var import_variant10 = __toESM(require_lib(), 1);
|
|
3313
3350
|
var import_lodash5 = __toESM(require_lodash(), 1);
|
|
3314
3351
|
|
|
3315
3352
|
// src/components/GenerateCommand/plugins/dashboad-menu-plugin/generate.ts
|
|
@@ -3343,20 +3380,20 @@ async function generateDashboardMenuPlugin(projectFolder, extended, action, fold
|
|
|
3343
3380
|
|
|
3344
3381
|
// src/components/GenerateCommand/plugins/dashboad-menu-plugin/NavigateToPage.tsx
|
|
3345
3382
|
init_esm_shims();
|
|
3346
|
-
var
|
|
3347
|
-
var
|
|
3348
|
-
var NavigateToPageOption = (0,
|
|
3349
|
-
Page: (0,
|
|
3383
|
+
var import_react19 = __toESM(require_react(), 1);
|
|
3384
|
+
var import_variant8 = __toESM(require_lib(), 1);
|
|
3385
|
+
var NavigateToPageOption = (0, import_variant8.variant)({
|
|
3386
|
+
Page: (0, import_variant8.fields)(),
|
|
3350
3387
|
Other: {}
|
|
3351
3388
|
});
|
|
3352
3389
|
var NavigateToPage = ({ onActionSelected }) => {
|
|
3353
3390
|
const bi = useWixCliAppBi();
|
|
3354
3391
|
const { model } = useProjectModel();
|
|
3355
3392
|
const { t: t2 } = useTranslation();
|
|
3356
|
-
const [pageId, setPageId] = (0,
|
|
3357
|
-
const [shouldUseCustomPageId, setShouldUseCustomPageId] = (0,
|
|
3358
|
-
const dashboardPages = (0,
|
|
3359
|
-
() => model.components.filter((0,
|
|
3393
|
+
const [pageId, setPageId] = (0, import_react19.useState)();
|
|
3394
|
+
const [shouldUseCustomPageId, setShouldUseCustomPageId] = (0, import_react19.useState)(false);
|
|
3395
|
+
const dashboardPages = (0, import_react19.useMemo)(
|
|
3396
|
+
() => model.components.filter((0, import_variant8.isType)(DevCenterComponent.DashboardPage)),
|
|
3360
3397
|
[model.components]
|
|
3361
3398
|
);
|
|
3362
3399
|
const validatePageId = useValidation(
|
|
@@ -3369,7 +3406,7 @@ var NavigateToPage = ({ onActionSelected }) => {
|
|
|
3369
3406
|
]
|
|
3370
3407
|
])
|
|
3371
3408
|
);
|
|
3372
|
-
(0,
|
|
3409
|
+
(0, import_react19.useEffect)(() => {
|
|
3373
3410
|
if (pageId) {
|
|
3374
3411
|
onActionSelected({
|
|
3375
3412
|
navigateToPage: {
|
|
@@ -3378,7 +3415,7 @@ var NavigateToPage = ({ onActionSelected }) => {
|
|
|
3378
3415
|
});
|
|
3379
3416
|
}
|
|
3380
3417
|
}, [pageId, onActionSelected]);
|
|
3381
|
-
return /* @__PURE__ */
|
|
3418
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, /* @__PURE__ */ import_react19.default.createElement(
|
|
3382
3419
|
SelectInput,
|
|
3383
3420
|
{
|
|
3384
3421
|
label: t2(
|
|
@@ -3409,13 +3446,13 @@ var NavigateToPage = ({ onActionSelected }) => {
|
|
|
3409
3446
|
questionKey: "generate_command.dashboard_menu_plugin.what_to_do.navigate_to_page.choose_page",
|
|
3410
3447
|
answer: option.title
|
|
3411
3448
|
});
|
|
3412
|
-
return (0,
|
|
3449
|
+
return (0, import_variant8.match)(option.value, {
|
|
3413
3450
|
Page: ({ pageId: pageId2 }) => setPageId(pageId2),
|
|
3414
3451
|
Other: () => setShouldUseCustomPageId(true)
|
|
3415
3452
|
});
|
|
3416
3453
|
}
|
|
3417
3454
|
}
|
|
3418
|
-
), shouldUseCustomPageId && /* @__PURE__ */
|
|
3455
|
+
), shouldUseCustomPageId && /* @__PURE__ */ import_react19.default.createElement(
|
|
3419
3456
|
TextInput,
|
|
3420
3457
|
{
|
|
3421
3458
|
label: t2(
|
|
@@ -3438,20 +3475,20 @@ var NavigateToPage = ({ onActionSelected }) => {
|
|
|
3438
3475
|
|
|
3439
3476
|
// src/components/GenerateCommand/plugins/dashboad-menu-plugin/OpenModal.tsx
|
|
3440
3477
|
init_esm_shims();
|
|
3441
|
-
var
|
|
3442
|
-
var
|
|
3443
|
-
var OpenModalOption = (0,
|
|
3444
|
-
Component: (0,
|
|
3478
|
+
var import_react20 = __toESM(require_react(), 1);
|
|
3479
|
+
var import_variant9 = __toESM(require_lib(), 1);
|
|
3480
|
+
var OpenModalOption = (0, import_variant9.variant)({
|
|
3481
|
+
Component: (0, import_variant9.fields)(),
|
|
3445
3482
|
Other: {}
|
|
3446
3483
|
});
|
|
3447
3484
|
var OpenModal = ({ onActionSelected }) => {
|
|
3448
3485
|
const bi = useWixCliAppBi();
|
|
3449
3486
|
const { model } = useProjectModel();
|
|
3450
3487
|
const { t: t2 } = useTranslation();
|
|
3451
|
-
const [componentId, setComponentId] = (0,
|
|
3452
|
-
const [shouldUseCustomComponentId, setShouldUseCustomComponentId] = (0,
|
|
3453
|
-
const dashboardModals = (0,
|
|
3454
|
-
() => model.components.filter((0,
|
|
3488
|
+
const [componentId, setComponentId] = (0, import_react20.useState)();
|
|
3489
|
+
const [shouldUseCustomComponentId, setShouldUseCustomComponentId] = (0, import_react20.useState)(false);
|
|
3490
|
+
const dashboardModals = (0, import_react20.useMemo)(
|
|
3491
|
+
() => model.components.filter((0, import_variant9.isType)(DevCenterComponent.DashboardModal)),
|
|
3455
3492
|
[model.components]
|
|
3456
3493
|
);
|
|
3457
3494
|
const validateComponentId = useValidation(
|
|
@@ -3464,7 +3501,7 @@ var OpenModal = ({ onActionSelected }) => {
|
|
|
3464
3501
|
]
|
|
3465
3502
|
])
|
|
3466
3503
|
);
|
|
3467
|
-
(0,
|
|
3504
|
+
(0, import_react20.useEffect)(() => {
|
|
3468
3505
|
if (componentId) {
|
|
3469
3506
|
onActionSelected({
|
|
3470
3507
|
openModal: {
|
|
@@ -3473,7 +3510,7 @@ var OpenModal = ({ onActionSelected }) => {
|
|
|
3473
3510
|
});
|
|
3474
3511
|
}
|
|
3475
3512
|
}, [componentId, onActionSelected]);
|
|
3476
|
-
return /* @__PURE__ */
|
|
3513
|
+
return /* @__PURE__ */ import_react20.default.createElement(import_react20.default.Fragment, null, /* @__PURE__ */ import_react20.default.createElement(
|
|
3477
3514
|
SelectInput,
|
|
3478
3515
|
{
|
|
3479
3516
|
label: t2(
|
|
@@ -3502,13 +3539,13 @@ var OpenModal = ({ onActionSelected }) => {
|
|
|
3502
3539
|
questionKey: "generate_command.dashboard_menu_plugin.what_to_do.open_modal.choose_component",
|
|
3503
3540
|
answer: option.title
|
|
3504
3541
|
});
|
|
3505
|
-
return (0,
|
|
3542
|
+
return (0, import_variant9.match)(option.value, {
|
|
3506
3543
|
Component: ({ componentId: componentId2 }) => setComponentId(componentId2),
|
|
3507
3544
|
Other: () => setShouldUseCustomComponentId(true)
|
|
3508
3545
|
});
|
|
3509
3546
|
}
|
|
3510
3547
|
}
|
|
3511
|
-
), shouldUseCustomComponentId && /* @__PURE__ */
|
|
3548
|
+
), shouldUseCustomComponentId && /* @__PURE__ */ import_react20.default.createElement(
|
|
3512
3549
|
TextInput,
|
|
3513
3550
|
{
|
|
3514
3551
|
label: t2(
|
|
@@ -3531,7 +3568,7 @@ var OpenModal = ({ onActionSelected }) => {
|
|
|
3531
3568
|
|
|
3532
3569
|
// src/components/GenerateCommand/plugins/dashboad-menu-plugin/DashboardMenuPluginGeneratedNote.tsx
|
|
3533
3570
|
init_esm_shims();
|
|
3534
|
-
var
|
|
3571
|
+
var import_react21 = __toESM(require_react(), 1);
|
|
3535
3572
|
var customGroupMessages2 = /* @__PURE__ */ new Map([
|
|
3536
3573
|
["Checkout & Orders", "generate_command.generation.ecommerce_notification"]
|
|
3537
3574
|
]);
|
|
@@ -3541,19 +3578,19 @@ var DashboardMenuPluginGeneratedNote = ({ backofficeMenuItem, generatedFiles })
|
|
|
3541
3578
|
"generate_command.flow.dashboard_menu_plugin"
|
|
3542
3579
|
).toLowerCase();
|
|
3543
3580
|
const customKey = customGroupMessages2.get(backofficeMenuItem.appName);
|
|
3544
|
-
return /* @__PURE__ */
|
|
3581
|
+
return /* @__PURE__ */ import_react21.default.createElement(Box_default, { flexDirection: "column" }, /* @__PURE__ */ import_react21.default.createElement(
|
|
3545
3582
|
GenerationSuccessMessage,
|
|
3546
3583
|
{
|
|
3547
3584
|
extensionType,
|
|
3548
3585
|
generatedFiles,
|
|
3549
3586
|
learnMoreUrl: "https://wix.to/YwaogfU"
|
|
3550
3587
|
},
|
|
3551
|
-
customKey ? /* @__PURE__ */
|
|
3588
|
+
customKey ? /* @__PURE__ */ import_react21.default.createElement(Text, null, t2(customKey)) : null
|
|
3552
3589
|
));
|
|
3553
3590
|
};
|
|
3554
3591
|
|
|
3555
3592
|
// src/components/GenerateCommand/plugins/dashboad-menu-plugin/DashboardMenuPluginWizard.tsx
|
|
3556
|
-
var DashboardMenuPluginAction = (0,
|
|
3593
|
+
var DashboardMenuPluginAction = (0, import_variant10.variant)({
|
|
3557
3594
|
NavigateToPage: {},
|
|
3558
3595
|
OpenModal: {}
|
|
3559
3596
|
});
|
|
@@ -3571,15 +3608,15 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3571
3608
|
"generate_command.flow.dashboard_menu_plugin"
|
|
3572
3609
|
).toLowerCase();
|
|
3573
3610
|
const dashboardMenuPlugins = getExtensions("DashboardMenuPlugin");
|
|
3574
|
-
const [backofficeMenuItem, setBackofficeMenuItem] = (0,
|
|
3575
|
-
const [actionType, setActionType] = (0,
|
|
3576
|
-
const [requireAppsIds, setRequireAppsIds] = (0,
|
|
3577
|
-
const [action, setAction] = (0,
|
|
3578
|
-
const [folder, setFolder] = (0,
|
|
3579
|
-
const [title, setTitle] = (0,
|
|
3580
|
-
const [finishedInstallation, setFinishedInstallation] = (0,
|
|
3611
|
+
const [backofficeMenuItem, setBackofficeMenuItem] = (0, import_react22.useState)();
|
|
3612
|
+
const [actionType, setActionType] = (0, import_react22.useState)();
|
|
3613
|
+
const [requireAppsIds, setRequireAppsIds] = (0, import_react22.useState)();
|
|
3614
|
+
const [action, setAction] = (0, import_react22.useState)();
|
|
3615
|
+
const [folder, setFolder] = (0, import_react22.useState)();
|
|
3616
|
+
const [title, setTitle] = (0, import_react22.useState)();
|
|
3617
|
+
const [finishedInstallation, setFinishedInstallation] = (0, import_react22.useState)(false);
|
|
3581
3618
|
const defaultFolderName = (0, import_lodash5.kebabCase)(title);
|
|
3582
|
-
const [additionalInfo, setAdditionalInfo] = (0,
|
|
3619
|
+
const [additionalInfo, setAdditionalInfo] = (0, import_react22.useState)();
|
|
3583
3620
|
const validateMenuPluginFolder = useValidation(
|
|
3584
3621
|
createDashboardMenuPluginValidation(dashboardMenuPlugins)
|
|
3585
3622
|
);
|
|
@@ -3601,7 +3638,7 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3601
3638
|
);
|
|
3602
3639
|
}
|
|
3603
3640
|
}, [backofficeMenuItem, action, folder, title]);
|
|
3604
|
-
const handleActionSelected = (0,
|
|
3641
|
+
const handleActionSelected = (0, import_react22.useCallback)(
|
|
3605
3642
|
(action2) => setAction(action2),
|
|
3606
3643
|
[]
|
|
3607
3644
|
);
|
|
@@ -3618,12 +3655,12 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3618
3655
|
extensionsByPages[backofficePage.component.componentId]?.items.push(
|
|
3619
3656
|
{
|
|
3620
3657
|
title: backofficeMenuItem2.component.data.backOfficeExtensionContainer.slotData?.displayName ?? backofficeMenuItem2.component.name,
|
|
3621
|
-
description: /* @__PURE__ */
|
|
3658
|
+
description: /* @__PURE__ */ import_react22.default.createElement(
|
|
3622
3659
|
Trans,
|
|
3623
3660
|
{
|
|
3624
3661
|
i18nKey: "generate_command.dashboard_menu_plugin.what_to_extend.item_description",
|
|
3625
3662
|
components: [
|
|
3626
|
-
/* @__PURE__ */
|
|
3663
|
+
/* @__PURE__ */ import_react22.default.createElement(
|
|
3627
3664
|
Link,
|
|
3628
3665
|
{
|
|
3629
3666
|
url: docsLink2(backofficeMenuItem2.component.externalId)
|
|
@@ -3649,18 +3686,18 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3649
3686
|
backofficeExtensionWidgets.sort((a, b) => a.title.localeCompare(b.title));
|
|
3650
3687
|
return backofficeExtensionWidgets;
|
|
3651
3688
|
}, []);
|
|
3652
|
-
const task = (0,
|
|
3653
|
-
() => (0,
|
|
3689
|
+
const task = (0, import_react22.useMemo)(
|
|
3690
|
+
() => (0, import_variant10.match)(generationTask, {
|
|
3654
3691
|
Success: ({ hasUpdatedDependencies, newFiles }) => {
|
|
3655
3692
|
if (!hasUpdatedDependencies) {
|
|
3656
3693
|
setFinishedInstallation(true);
|
|
3657
3694
|
}
|
|
3658
|
-
return /* @__PURE__ */
|
|
3695
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, hasUpdatedDependencies && /* @__PURE__ */ import_react22.default.createElement(
|
|
3659
3696
|
InstallDependencies,
|
|
3660
3697
|
{
|
|
3661
3698
|
onFinish: () => setFinishedInstallation(true)
|
|
3662
3699
|
}
|
|
3663
|
-
), finishedInstallation && backofficeMenuItem && /* @__PURE__ */
|
|
3700
|
+
), finishedInstallation && backofficeMenuItem && /* @__PURE__ */ import_react22.default.createElement(
|
|
3664
3701
|
DashboardMenuPluginGeneratedNote,
|
|
3665
3702
|
{
|
|
3666
3703
|
backofficeMenuItem,
|
|
@@ -3668,7 +3705,7 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3668
3705
|
}
|
|
3669
3706
|
));
|
|
3670
3707
|
},
|
|
3671
|
-
Loading: () => /* @__PURE__ */
|
|
3708
|
+
Loading: () => /* @__PURE__ */ import_react22.default.createElement(
|
|
3672
3709
|
Spinner,
|
|
3673
3710
|
{
|
|
3674
3711
|
text: t2("generate_command.generation.loading", {
|
|
@@ -3688,19 +3725,19 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3688
3725
|
backofficeMenuItem
|
|
3689
3726
|
]
|
|
3690
3727
|
);
|
|
3691
|
-
return (0,
|
|
3728
|
+
return (0, import_variant10.match)(status, {
|
|
3692
3729
|
Error: () => null,
|
|
3693
|
-
Loading: () => /* @__PURE__ */
|
|
3694
|
-
Success: ({ result: menuItemsGroups }) => /* @__PURE__ */
|
|
3730
|
+
Loading: () => /* @__PURE__ */ import_react22.default.createElement(Spinner, { text: t2("general.loading") }),
|
|
3731
|
+
Success: ({ result: menuItemsGroups }) => /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, /* @__PURE__ */ import_react22.default.createElement(
|
|
3695
3732
|
SelectGroupsInput,
|
|
3696
3733
|
{
|
|
3697
3734
|
label: t2("generate_command.dashboard_menu_plugin.what_to_extend"),
|
|
3698
3735
|
hideScroll: true,
|
|
3699
|
-
info: /* @__PURE__ */
|
|
3736
|
+
info: /* @__PURE__ */ import_react22.default.createElement(
|
|
3700
3737
|
Trans,
|
|
3701
3738
|
{
|
|
3702
3739
|
i18nKey: "generate_command.dashboard_menu_plugin.what_to_extend.description",
|
|
3703
|
-
components: [/* @__PURE__ */
|
|
3740
|
+
components: [/* @__PURE__ */ import_react22.default.createElement(Link, { url: "https://wix.to/h8AJ7f5" })]
|
|
3704
3741
|
}
|
|
3705
3742
|
),
|
|
3706
3743
|
groups: menuItemsGroups,
|
|
@@ -3722,7 +3759,7 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3722
3759
|
setBackofficeMenuItem(item.value);
|
|
3723
3760
|
}
|
|
3724
3761
|
}
|
|
3725
|
-
), backofficeMenuItem && (slotsApp.requiredApps.length === 1 ? /* @__PURE__ */
|
|
3762
|
+
), backofficeMenuItem && (slotsApp.requiredApps.length === 1 ? /* @__PURE__ */ import_react22.default.createElement(
|
|
3726
3763
|
AppRequirement,
|
|
3727
3764
|
{
|
|
3728
3765
|
appId: model.config.appId,
|
|
@@ -3734,7 +3771,7 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3734
3771
|
],
|
|
3735
3772
|
onSubmit: setRequireAppsIds
|
|
3736
3773
|
}
|
|
3737
|
-
) : /* @__PURE__ */
|
|
3774
|
+
) : /* @__PURE__ */ import_react22.default.createElement(
|
|
3738
3775
|
MultipleAppRequirement,
|
|
3739
3776
|
{
|
|
3740
3777
|
appId: model.config.appId,
|
|
@@ -3744,7 +3781,7 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3744
3781
|
})),
|
|
3745
3782
|
onSubmit: setRequireAppsIds
|
|
3746
3783
|
}
|
|
3747
|
-
)), requireAppsIds && /* @__PURE__ */
|
|
3784
|
+
)), requireAppsIds && /* @__PURE__ */ import_react22.default.createElement(
|
|
3748
3785
|
SelectInput,
|
|
3749
3786
|
{
|
|
3750
3787
|
label: t2("generate_command.dashboard_menu_plugin.what_to_do"),
|
|
@@ -3776,10 +3813,10 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3776
3813
|
setActionType(action2.value);
|
|
3777
3814
|
}
|
|
3778
3815
|
}
|
|
3779
|
-
), actionType && (0,
|
|
3780
|
-
NavigateToPage: () => /* @__PURE__ */
|
|
3781
|
-
OpenModal: () => /* @__PURE__ */
|
|
3782
|
-
}), action && /* @__PURE__ */
|
|
3816
|
+
), actionType && (0, import_variant10.match)(actionType, {
|
|
3817
|
+
NavigateToPage: () => /* @__PURE__ */ import_react22.default.createElement(NavigateToPage, { onActionSelected: handleActionSelected }),
|
|
3818
|
+
OpenModal: () => /* @__PURE__ */ import_react22.default.createElement(OpenModal, { onActionSelected: handleActionSelected })
|
|
3819
|
+
}), action && /* @__PURE__ */ import_react22.default.createElement(
|
|
3783
3820
|
TextInput,
|
|
3784
3821
|
{
|
|
3785
3822
|
label: t2("generate_command.dashboard_menu_plugin.choose_title"),
|
|
@@ -3798,7 +3835,7 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
3798
3835
|
setTitle(value);
|
|
3799
3836
|
}
|
|
3800
3837
|
}
|
|
3801
|
-
), title && /* @__PURE__ */
|
|
3838
|
+
), title && /* @__PURE__ */ import_react22.default.createElement(
|
|
3802
3839
|
TextInput,
|
|
3803
3840
|
{
|
|
3804
3841
|
label: t2("generate_command.dashboard_menu_plugin.choose_folder"),
|
|
@@ -3829,14 +3866,14 @@ var DashboardPlugin = ({ flow }) => {
|
|
|
3829
3866
|
getBackofficeExtensionWidgets,
|
|
3830
3867
|
getBackofficeMenuItems
|
|
3831
3868
|
} = useExtensionDataClient();
|
|
3832
|
-
const [slotsApp, setSlotsApp] = (0,
|
|
3869
|
+
const [slotsApp, setSlotsApp] = (0, import_react23.useState)();
|
|
3833
3870
|
const { status } = useAsync(async () => {
|
|
3834
3871
|
const [ecomRequiredApps, backofficePages, backofficeExtensionContainers] = await Promise.all([
|
|
3835
3872
|
getEcomRequiredApps(),
|
|
3836
3873
|
getBackofficePages(),
|
|
3837
|
-
(0,
|
|
3874
|
+
(0, import_variant11.match)(
|
|
3838
3875
|
flow,
|
|
3839
|
-
(0,
|
|
3876
|
+
(0, import_variant11.partial)({
|
|
3840
3877
|
DashboardPlugin: () => getBackofficeExtensionWidgets(),
|
|
3841
3878
|
DashboardMenuPlugin: () => getBackofficeMenuItems(),
|
|
3842
3879
|
default: () => []
|
|
@@ -3880,18 +3917,18 @@ var DashboardPlugin = ({ flow }) => {
|
|
|
3880
3917
|
pluginsMap
|
|
3881
3918
|
};
|
|
3882
3919
|
}, []);
|
|
3883
|
-
return (0,
|
|
3920
|
+
return (0, import_variant11.match)(status, {
|
|
3884
3921
|
Error: () => null,
|
|
3885
|
-
Loading: () => /* @__PURE__ */
|
|
3886
|
-
Success: ({ result: { supportedApps, pluginsMap } }) => /* @__PURE__ */
|
|
3922
|
+
Loading: () => /* @__PURE__ */ import_react23.default.createElement(Spinner, { text: t2("general.loading") }),
|
|
3923
|
+
Success: ({ result: { supportedApps, pluginsMap } }) => /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, /* @__PURE__ */ import_react23.default.createElement(
|
|
3887
3924
|
SelectInput,
|
|
3888
3925
|
{
|
|
3889
3926
|
label: t2("generate_command.dashboard.plugin_app"),
|
|
3890
|
-
info: /* @__PURE__ */
|
|
3927
|
+
info: /* @__PURE__ */ import_react23.default.createElement(
|
|
3891
3928
|
Trans,
|
|
3892
3929
|
{
|
|
3893
3930
|
i18nKey: "generate_command.dashboard.plugin_app.description",
|
|
3894
|
-
components: [/* @__PURE__ */
|
|
3931
|
+
components: [/* @__PURE__ */ import_react23.default.createElement(Link, { url: "https://wix.to/QUp5DLl" })]
|
|
3895
3932
|
}
|
|
3896
3933
|
),
|
|
3897
3934
|
options: supportedApps,
|
|
@@ -3908,10 +3945,10 @@ var DashboardPlugin = ({ flow }) => {
|
|
|
3908
3945
|
setSlotsApp(option.value);
|
|
3909
3946
|
}
|
|
3910
3947
|
}
|
|
3911
|
-
), slotsApp && (0,
|
|
3948
|
+
), slotsApp && (0, import_variant11.match)(
|
|
3912
3949
|
flow,
|
|
3913
|
-
(0,
|
|
3914
|
-
DashboardPlugin: () => /* @__PURE__ */
|
|
3950
|
+
(0, import_variant11.partial)({
|
|
3951
|
+
DashboardPlugin: () => /* @__PURE__ */ import_react23.default.createElement(
|
|
3915
3952
|
DashboardPluginWizard,
|
|
3916
3953
|
{
|
|
3917
3954
|
slotsApp,
|
|
@@ -3922,7 +3959,7 @@ var DashboardPlugin = ({ flow }) => {
|
|
|
3922
3959
|
)
|
|
3923
3960
|
}
|
|
3924
3961
|
),
|
|
3925
|
-
DashboardMenuPlugin: () => /* @__PURE__ */
|
|
3962
|
+
DashboardMenuPlugin: () => /* @__PURE__ */ import_react23.default.createElement(
|
|
3926
3963
|
DashboardMenuPluginWizard,
|
|
3927
3964
|
{
|
|
3928
3965
|
slotsApp,
|
|
@@ -3941,8 +3978,8 @@ var DashboardPlugin = ({ flow }) => {
|
|
|
3941
3978
|
|
|
3942
3979
|
// src/components/GenerateCommand/site-plugin/SitePlugin.tsx
|
|
3943
3980
|
init_esm_shims();
|
|
3944
|
-
var
|
|
3945
|
-
var
|
|
3981
|
+
var import_react26 = __toESM(require_react(), 1);
|
|
3982
|
+
var import_variant13 = __toESM(require_lib(), 1);
|
|
3946
3983
|
|
|
3947
3984
|
// ../site-plugin-client/src/index.ts
|
|
3948
3985
|
init_esm_shims();
|
|
@@ -4010,16 +4047,16 @@ var SitePluginClient = class {
|
|
|
4010
4047
|
|
|
4011
4048
|
// ../site-plugin-client/src/useSitePluginClient.ts
|
|
4012
4049
|
init_esm_shims();
|
|
4013
|
-
var
|
|
4050
|
+
var import_react24 = __toESM(require_react(), 1);
|
|
4014
4051
|
function useSitePluginClient() {
|
|
4015
4052
|
const httpClient = useHttpClient({ type: "general" });
|
|
4016
|
-
return (0,
|
|
4053
|
+
return (0, import_react24.useMemo)(() => new SitePluginClient(httpClient), [httpClient]);
|
|
4017
4054
|
}
|
|
4018
4055
|
|
|
4019
4056
|
// src/components/GenerateCommand/site-plugin/SitePluginWizard.tsx
|
|
4020
4057
|
init_esm_shims();
|
|
4021
|
-
var
|
|
4022
|
-
var
|
|
4058
|
+
var import_react25 = __toESM(require_react(), 1);
|
|
4059
|
+
var import_variant12 = __toESM(require_lib(), 1);
|
|
4023
4060
|
var import_lodash6 = __toESM(require_lodash(), 1);
|
|
4024
4061
|
var import_uniqBy = __toESM(require_uniqBy(), 1);
|
|
4025
4062
|
|
|
@@ -4078,7 +4115,7 @@ var SitePluginWizard = ({ placements }) => {
|
|
|
4078
4115
|
const { model } = useProjectModel();
|
|
4079
4116
|
const { addRequiredApp } = useDevCenterClient();
|
|
4080
4117
|
const { getWidgetDocsUrl } = useSitePluginClient();
|
|
4081
|
-
const pluginApplications = (0,
|
|
4118
|
+
const pluginApplications = (0, import_react25.useMemo)(
|
|
4082
4119
|
() => (0, import_uniqBy.default)(placements, "appName").map((pluginPlacement) => ({
|
|
4083
4120
|
value: pluginPlacement.appName,
|
|
4084
4121
|
title: pluginPlacement.appName
|
|
@@ -4088,23 +4125,23 @@ var SitePluginWizard = ({ placements }) => {
|
|
|
4088
4125
|
const extensionType = t2("generate_command.flow.site_plugin").toLowerCase();
|
|
4089
4126
|
const validateFolderName = useCustomElementDirectoryValidation("Site plugin");
|
|
4090
4127
|
const validateName = useCustomElementNameValidation();
|
|
4091
|
-
const [appsToRequire, setAppsToRequire] = (0,
|
|
4092
|
-
const [placement, setPlacement] = (0,
|
|
4093
|
-
const [placementApp, setPlacementApp] = (0,
|
|
4094
|
-
const [pluginFolder, setPluginFolder] = (0,
|
|
4095
|
-
const [pluginName, setPluginName] = (0,
|
|
4096
|
-
const [finishedInstallation, setFinishedInstallation] = (0,
|
|
4128
|
+
const [appsToRequire, setAppsToRequire] = (0, import_react25.useState)();
|
|
4129
|
+
const [placement, setPlacement] = (0, import_react25.useState)();
|
|
4130
|
+
const [placementApp, setPlacementApp] = (0, import_react25.useState)();
|
|
4131
|
+
const [pluginFolder, setPluginFolder] = (0, import_react25.useState)();
|
|
4132
|
+
const [pluginName, setPluginName] = (0, import_react25.useState)();
|
|
4133
|
+
const [finishedInstallation, setFinishedInstallation] = (0, import_react25.useState)(false);
|
|
4097
4134
|
const defaultPluginFolder = (0, import_lodash6.kebabCase)(pluginName);
|
|
4098
|
-
const widgetSlots = (0,
|
|
4135
|
+
const widgetSlots = (0, import_react25.useMemo)(
|
|
4099
4136
|
() => placementApp ? Object.values(
|
|
4100
4137
|
placements.filter((placement2) => placement2.appName === placementApp).reduce(
|
|
4101
4138
|
(_widgetSlots, placement2) => {
|
|
4102
4139
|
const widgetDocsUrl = getWidgetDocsUrl(placement2.widgetId);
|
|
4103
|
-
const description = widgetDocsUrl && /* @__PURE__ */
|
|
4140
|
+
const description = widgetDocsUrl && /* @__PURE__ */ import_react25.default.createElement(Text, { skin: "secondary" }, /* @__PURE__ */ import_react25.default.createElement(
|
|
4104
4141
|
Trans,
|
|
4105
4142
|
{
|
|
4106
4143
|
i18nKey: "generate_command.site_plugin.widget_docs",
|
|
4107
|
-
components: [/* @__PURE__ */
|
|
4144
|
+
components: [/* @__PURE__ */ import_react25.default.createElement(Link, { url: widgetDocsUrl })]
|
|
4108
4145
|
}
|
|
4109
4146
|
));
|
|
4110
4147
|
_widgetSlots[placement2.widgetId] ??= {
|
|
@@ -4144,15 +4181,15 @@ var SitePluginWizard = ({ placements }) => {
|
|
|
4144
4181
|
);
|
|
4145
4182
|
}
|
|
4146
4183
|
}, [pluginFolder, pluginName, placement, appsToRequire]);
|
|
4147
|
-
return /* @__PURE__ */
|
|
4184
|
+
return /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement(
|
|
4148
4185
|
SelectInput,
|
|
4149
4186
|
{
|
|
4150
4187
|
label: t2("generate_command.site_plugin.plugin_app"),
|
|
4151
|
-
info: /* @__PURE__ */
|
|
4188
|
+
info: /* @__PURE__ */ import_react25.default.createElement(
|
|
4152
4189
|
Trans,
|
|
4153
4190
|
{
|
|
4154
4191
|
i18nKey: "generate_command.site_plugin.plugin_app.description",
|
|
4155
|
-
components: [/* @__PURE__ */
|
|
4192
|
+
components: [/* @__PURE__ */ import_react25.default.createElement(Link, { url: "https://wix.to/Onfe4XJ" })]
|
|
4156
4193
|
}
|
|
4157
4194
|
),
|
|
4158
4195
|
options: pluginApplications,
|
|
@@ -4166,7 +4203,7 @@ var SitePluginWizard = ({ placements }) => {
|
|
|
4166
4203
|
setPlacementApp(option.value);
|
|
4167
4204
|
}
|
|
4168
4205
|
}
|
|
4169
|
-
), placementApp && /* @__PURE__ */
|
|
4206
|
+
), placementApp && /* @__PURE__ */ import_react25.default.createElement(
|
|
4170
4207
|
SelectGroupsInput,
|
|
4171
4208
|
{
|
|
4172
4209
|
label: t2("generate_command.site_plugin.choose_placement"),
|
|
@@ -4181,7 +4218,7 @@ var SitePluginWizard = ({ placements }) => {
|
|
|
4181
4218
|
setPlacement(option.value);
|
|
4182
4219
|
}
|
|
4183
4220
|
}
|
|
4184
|
-
), placement && /* @__PURE__ */
|
|
4221
|
+
), placement && /* @__PURE__ */ import_react25.default.createElement(
|
|
4185
4222
|
AppRequirement,
|
|
4186
4223
|
{
|
|
4187
4224
|
appId: model.config.appId,
|
|
@@ -4193,7 +4230,7 @@ var SitePluginWizard = ({ placements }) => {
|
|
|
4193
4230
|
],
|
|
4194
4231
|
onSubmit: setAppsToRequire
|
|
4195
4232
|
}
|
|
4196
|
-
), appsToRequire && /* @__PURE__ */
|
|
4233
|
+
), appsToRequire && /* @__PURE__ */ import_react25.default.createElement(
|
|
4197
4234
|
TextInput,
|
|
4198
4235
|
{
|
|
4199
4236
|
label: t2("generate_command.site_plugin.choose_name"),
|
|
@@ -4211,7 +4248,7 @@ var SitePluginWizard = ({ placements }) => {
|
|
|
4211
4248
|
},
|
|
4212
4249
|
validate: validateName
|
|
4213
4250
|
}
|
|
4214
|
-
), pluginName && /* @__PURE__ */
|
|
4251
|
+
), pluginName && /* @__PURE__ */ import_react25.default.createElement(
|
|
4215
4252
|
TextInput,
|
|
4216
4253
|
{
|
|
4217
4254
|
label: t2("generate_command.site_plugin.choose_folder"),
|
|
@@ -4229,18 +4266,18 @@ var SitePluginWizard = ({ placements }) => {
|
|
|
4229
4266
|
},
|
|
4230
4267
|
validate: validateFolderName
|
|
4231
4268
|
}
|
|
4232
|
-
), (0,
|
|
4233
|
-
() => (0,
|
|
4269
|
+
), (0, import_react25.useMemo)(
|
|
4270
|
+
() => (0, import_variant12.match)(generationTask, {
|
|
4234
4271
|
Success: ({ hasUpdatedDependencies, newFiles }) => {
|
|
4235
4272
|
if (!hasUpdatedDependencies) {
|
|
4236
4273
|
setFinishedInstallation(true);
|
|
4237
4274
|
}
|
|
4238
|
-
return /* @__PURE__ */
|
|
4275
|
+
return /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, hasUpdatedDependencies && /* @__PURE__ */ import_react25.default.createElement(
|
|
4239
4276
|
InstallDependencies,
|
|
4240
4277
|
{
|
|
4241
4278
|
onFinish: () => setFinishedInstallation(true)
|
|
4242
4279
|
}
|
|
4243
|
-
), finishedInstallation && /* @__PURE__ */
|
|
4280
|
+
), finishedInstallation && /* @__PURE__ */ import_react25.default.createElement(
|
|
4244
4281
|
GenerationSuccessMessage,
|
|
4245
4282
|
{
|
|
4246
4283
|
extensionType,
|
|
@@ -4249,7 +4286,7 @@ var SitePluginWizard = ({ placements }) => {
|
|
|
4249
4286
|
}
|
|
4250
4287
|
));
|
|
4251
4288
|
},
|
|
4252
|
-
Loading: () => /* @__PURE__ */
|
|
4289
|
+
Loading: () => /* @__PURE__ */ import_react25.default.createElement(
|
|
4253
4290
|
Spinner,
|
|
4254
4291
|
{
|
|
4255
4292
|
text: t2("generate_command.generation.loading", {
|
|
@@ -4275,22 +4312,22 @@ var GenerateSitePlugin = () => {
|
|
|
4275
4312
|
const { t: t2 } = useTranslation();
|
|
4276
4313
|
const { getPlacements } = useSitePluginClient();
|
|
4277
4314
|
const { status } = useAsync(getPlacements, []);
|
|
4278
|
-
return (0,
|
|
4315
|
+
return (0, import_variant13.match)(status, {
|
|
4279
4316
|
Error: () => null,
|
|
4280
|
-
Loading: () => /* @__PURE__ */
|
|
4281
|
-
Success: ({ result }) => /* @__PURE__ */
|
|
4317
|
+
Loading: () => /* @__PURE__ */ import_react26.default.createElement(Spinner, { text: t2("general.loading") }),
|
|
4318
|
+
Success: ({ result }) => /* @__PURE__ */ import_react26.default.createElement(SitePluginWizard, { placements: result.placements })
|
|
4282
4319
|
});
|
|
4283
4320
|
};
|
|
4284
4321
|
|
|
4285
4322
|
// src/components/GenerateCommand/api/Api.tsx
|
|
4286
4323
|
init_esm_shims();
|
|
4287
|
-
var
|
|
4288
|
-
var import_variant17 = __toESM(require_lib(), 1);
|
|
4324
|
+
var import_react28 = __toESM(require_react(), 1);
|
|
4289
4325
|
|
|
4290
4326
|
// src/components/GenerateCommand/api/generate.ts
|
|
4291
4327
|
init_esm_shims();
|
|
4292
|
-
import path10 from "node:path";
|
|
4328
|
+
import path10, { join } from "node:path";
|
|
4293
4329
|
var API_TEMPLATE = path10.resolve(__dirname, "../templates/api");
|
|
4330
|
+
var WEB_METHOD_TEMPLATE = path10.resolve(__dirname, "../templates/web-method");
|
|
4294
4331
|
async function generateApi(projectFolder, folderName) {
|
|
4295
4332
|
const cwd = path10.join(getApiFolder(projectFolder), folderName);
|
|
4296
4333
|
return await componentGenerator({
|
|
@@ -4302,17 +4339,70 @@ async function generateApi(projectFolder, folderName) {
|
|
|
4302
4339
|
}
|
|
4303
4340
|
});
|
|
4304
4341
|
}
|
|
4342
|
+
async function generateWebMethod(projectFolder, folderPath) {
|
|
4343
|
+
const filePath = join(WEB_METHOD_DIR, folderPath);
|
|
4344
|
+
return await componentGenerator({
|
|
4345
|
+
template: WEB_METHOD_TEMPLATE,
|
|
4346
|
+
cwd: projectFolder,
|
|
4347
|
+
projectFolder,
|
|
4348
|
+
data: {
|
|
4349
|
+
filePath,
|
|
4350
|
+
fileName: path10.basename(filePath)
|
|
4351
|
+
}
|
|
4352
|
+
});
|
|
4353
|
+
}
|
|
4305
4354
|
|
|
4306
|
-
// src/components/GenerateCommand/api/
|
|
4307
|
-
|
|
4355
|
+
// src/components/GenerateCommand/api/steps.tsx
|
|
4356
|
+
init_esm_shims();
|
|
4357
|
+
var import_react27 = __toESM(require_react(), 1);
|
|
4358
|
+
import { join as join2 } from "node:path";
|
|
4359
|
+
var SelectApiTypeStep = ({ onSubmit }) => {
|
|
4360
|
+
const { t: t2 } = useTranslation();
|
|
4361
|
+
const bi = useWixCliAppBi();
|
|
4362
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
4363
|
+
return /* @__PURE__ */ import_react27.default.createElement(
|
|
4364
|
+
SelectInput,
|
|
4365
|
+
{
|
|
4366
|
+
isActive,
|
|
4367
|
+
info: /* @__PURE__ */ import_react27.default.createElement(
|
|
4368
|
+
Trans,
|
|
4369
|
+
{
|
|
4370
|
+
i18nKey: "generate_command.api.choose_type.info",
|
|
4371
|
+
components: [/* @__PURE__ */ import_react27.default.createElement(Link, { url: "https://wix.to/pX4xyEn" })]
|
|
4372
|
+
}
|
|
4373
|
+
),
|
|
4374
|
+
label: t2("generate_command.api.choose_type"),
|
|
4375
|
+
options: [
|
|
4376
|
+
{
|
|
4377
|
+
title: t2("generate_command.api.web_method"),
|
|
4378
|
+
description: t2("generate_command.api.web_method.description"),
|
|
4379
|
+
value: "WebMethod"
|
|
4380
|
+
},
|
|
4381
|
+
{
|
|
4382
|
+
title: t2("generate_command.api.api_route"),
|
|
4383
|
+
description: t2("generate_command.api.api_route.description"),
|
|
4384
|
+
value: "Api"
|
|
4385
|
+
}
|
|
4386
|
+
],
|
|
4387
|
+
onSubmit: (option) => {
|
|
4388
|
+
bi.cliFlowStepAnswered({
|
|
4389
|
+
question: t2("generate_command.api.choose_type"),
|
|
4390
|
+
questionKey: "generate_command.api.choose_type",
|
|
4391
|
+
answer: option.title,
|
|
4392
|
+
additionalInfo: { extensionType: option.value }
|
|
4393
|
+
});
|
|
4394
|
+
onSubmit(option.value);
|
|
4395
|
+
goToNextStep();
|
|
4396
|
+
}
|
|
4397
|
+
}
|
|
4398
|
+
);
|
|
4399
|
+
};
|
|
4400
|
+
var ApiFolderStep = ({ onSubmit }) => {
|
|
4308
4401
|
const { t: t2 } = useTranslation();
|
|
4309
|
-
const { model } = useProjectModel();
|
|
4310
4402
|
const { cliFlowStepAnswered } = useWixCliAppBi();
|
|
4311
|
-
const
|
|
4403
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
4312
4404
|
const { backendComponentsByType } = useBackendComponents();
|
|
4313
|
-
const [finishedInstallation, setFinishedInstallation] = (0, import_react25.useState)(false);
|
|
4314
4405
|
const apis = backendComponentsByType.Api;
|
|
4315
|
-
const extensionType = t2("generate_command.flow.api.title").toLowerCase();
|
|
4316
4406
|
const validateApiFolder = useValidation(
|
|
4317
4407
|
composeValidations([
|
|
4318
4408
|
[
|
|
@@ -4321,14 +4411,10 @@ var GenerateApi = () => {
|
|
|
4321
4411
|
]
|
|
4322
4412
|
])
|
|
4323
4413
|
);
|
|
4324
|
-
|
|
4325
|
-
if (apiFolder) {
|
|
4326
|
-
return generateApi(model.projectFolder, apiFolder);
|
|
4327
|
-
}
|
|
4328
|
-
}, [model.projectFolder, apiFolder]);
|
|
4329
|
-
return /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, /* @__PURE__ */ import_react25.default.createElement(
|
|
4414
|
+
return /* @__PURE__ */ import_react27.default.createElement(
|
|
4330
4415
|
TextInput,
|
|
4331
4416
|
{
|
|
4417
|
+
isActive,
|
|
4332
4418
|
label: t2("generate_command.api.choose_api_name"),
|
|
4333
4419
|
placeholder: t2("generate_command.api.api_placeholder"),
|
|
4334
4420
|
onSubmit: (value) => {
|
|
@@ -4337,55 +4423,95 @@ var GenerateApi = () => {
|
|
|
4337
4423
|
questionKey: "generate_command.api.choose_api_name",
|
|
4338
4424
|
answer: value
|
|
4339
4425
|
});
|
|
4340
|
-
|
|
4426
|
+
onSubmit(value);
|
|
4427
|
+
goToNextStep();
|
|
4341
4428
|
},
|
|
4342
4429
|
validate: validateApiFolder
|
|
4343
4430
|
}
|
|
4344
|
-
)
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
)
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
)
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
)
|
|
4431
|
+
);
|
|
4432
|
+
};
|
|
4433
|
+
var WebMethodFolderStep = ({ onSubmit }) => {
|
|
4434
|
+
const { t: t2 } = useTranslation();
|
|
4435
|
+
const { cliFlowStepAnswered } = useWixCliAppBi();
|
|
4436
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
4437
|
+
const { backendComponentsByType } = useBackendComponents();
|
|
4438
|
+
const webMethods = backendComponentsByType.WebMethod;
|
|
4439
|
+
const validateWebMethodFolder = useValidation(
|
|
4440
|
+
composeValidations([
|
|
4441
|
+
[
|
|
4442
|
+
(filePath) => {
|
|
4443
|
+
const resolvedFolderPath = `${join2(WEB_METHOD_DIR, filePath)}.web.ts`;
|
|
4444
|
+
return pathValidation(filePath) && webMethods.every(
|
|
4445
|
+
(webMethod) => webMethod.relativePath !== resolvedFolderPath
|
|
4446
|
+
);
|
|
4447
|
+
},
|
|
4448
|
+
t2("generate_command.web_method.choose_filename.error")
|
|
4449
|
+
]
|
|
4450
|
+
])
|
|
4451
|
+
);
|
|
4452
|
+
return /* @__PURE__ */ import_react27.default.createElement(
|
|
4453
|
+
TextInput,
|
|
4454
|
+
{
|
|
4455
|
+
isActive,
|
|
4456
|
+
label: t2("generate_command.web_method.choose_filename"),
|
|
4457
|
+
placeholder: t2("generate_command.web_method.choose_filename.placeholder"),
|
|
4458
|
+
onSubmit: (folderPath) => {
|
|
4459
|
+
cliFlowStepAnswered({
|
|
4460
|
+
question: t2("generate_command.web_method.choose_filename"),
|
|
4461
|
+
questionKey: "generate_command.web_method.choose_filename",
|
|
4462
|
+
answer: folderPath
|
|
4463
|
+
});
|
|
4464
|
+
onSubmit(folderPath);
|
|
4465
|
+
goToNextStep();
|
|
4466
|
+
},
|
|
4467
|
+
validate: validateWebMethodFolder
|
|
4468
|
+
}
|
|
4469
|
+
);
|
|
4470
|
+
};
|
|
4471
|
+
|
|
4472
|
+
// src/components/GenerateCommand/api/Api.tsx
|
|
4473
|
+
var useGenerateApi = () => {
|
|
4474
|
+
const { t: t2 } = useTranslation();
|
|
4475
|
+
const { model } = useProjectModel();
|
|
4476
|
+
const [apiType, setApiType] = (0, import_react28.useState)();
|
|
4477
|
+
const [apiFolder, setApiFolder] = (0, import_react28.useState)();
|
|
4478
|
+
const extensionType = apiType === "Api" ? t2("generate_command.flow.api.title").toLowerCase() : t2("generate_command.api.web_method.title").toLowerCase();
|
|
4479
|
+
const generationTask = useGenerationTask(async () => {
|
|
4480
|
+
if (apiFolder) {
|
|
4481
|
+
if (apiType === "Api") {
|
|
4482
|
+
return generateApi(model.projectFolder, apiFolder);
|
|
4483
|
+
}
|
|
4484
|
+
if (apiType === "WebMethod") {
|
|
4485
|
+
return generateWebMethod(model.projectFolder, apiFolder);
|
|
4486
|
+
}
|
|
4487
|
+
}
|
|
4488
|
+
}, [model.projectFolder, apiFolder]);
|
|
4489
|
+
return [
|
|
4490
|
+
/* @__PURE__ */ import_react28.default.createElement(SelectApiTypeStep, { onSubmit: setApiType }),
|
|
4491
|
+
apiType === "Api" ? /* @__PURE__ */ import_react28.default.createElement(ApiFolderStep, { onSubmit: setApiFolder }) : /* @__PURE__ */ import_react28.default.createElement(WebMethodFolderStep, { onSubmit: setApiFolder }),
|
|
4492
|
+
/* @__PURE__ */ import_react28.default.createElement(
|
|
4493
|
+
CompleteGeneration,
|
|
4494
|
+
{
|
|
4495
|
+
generationTask,
|
|
4496
|
+
extensionType,
|
|
4497
|
+
successMessage: CompleteGenerationMessage.SuccessMessage({
|
|
4498
|
+
learnMoreUrl: apiType === "Api" ? (
|
|
4499
|
+
// https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/backend-extensions/api/add-api-extensions-with-the-cli
|
|
4500
|
+
"https://wix.to/3wEnGrE"
|
|
4501
|
+
) : (
|
|
4502
|
+
// https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/backend-extensions/web-methods/add-web-method-extensions-with-the-cli
|
|
4503
|
+
"https://wix.to/hjf9SQX"
|
|
4504
|
+
)
|
|
4505
|
+
}),
|
|
4506
|
+
route: apiFolder
|
|
4507
|
+
}
|
|
4508
|
+
)
|
|
4509
|
+
];
|
|
4383
4510
|
};
|
|
4384
4511
|
|
|
4385
4512
|
// src/components/GenerateCommand/event/Event.tsx
|
|
4386
4513
|
init_esm_shims();
|
|
4387
|
-
var
|
|
4388
|
-
var import_variant18 = __toESM(require_lib(), 1);
|
|
4514
|
+
var import_react30 = __toESM(require_react(), 1);
|
|
4389
4515
|
|
|
4390
4516
|
// src/components/GenerateCommand/event/generate.ts
|
|
4391
4517
|
init_esm_shims();
|
|
@@ -4400,16 +4526,15 @@ async function generateEvent(projectFolder, folderName) {
|
|
|
4400
4526
|
});
|
|
4401
4527
|
}
|
|
4402
4528
|
|
|
4403
|
-
// src/components/GenerateCommand/event/
|
|
4404
|
-
|
|
4529
|
+
// src/components/GenerateCommand/event/steps.tsx
|
|
4530
|
+
init_esm_shims();
|
|
4531
|
+
var import_react29 = __toESM(require_react(), 1);
|
|
4532
|
+
var ChooseFolderStep2 = ({ onSubmit, eventFolder }) => {
|
|
4533
|
+
const bi = useWixCliAppBi();
|
|
4405
4534
|
const { t: t2 } = useTranslation();
|
|
4406
|
-
const { model } = useProjectModel();
|
|
4407
4535
|
const { backendComponentsByType } = useBackendComponents();
|
|
4408
|
-
const {
|
|
4409
|
-
const [eventFolder, setEventFolder] = (0, import_react26.useState)();
|
|
4410
|
-
const [finishedInstallation, setFinishedInstallation] = (0, import_react26.useState)(false);
|
|
4536
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
4411
4537
|
const events = backendComponentsByType.Event;
|
|
4412
|
-
const extensionType = t2("generate_command.flow.event").toLowerCase();
|
|
4413
4538
|
const validateEventFolder = useValidation(
|
|
4414
4539
|
composeValidations([
|
|
4415
4540
|
[
|
|
@@ -4418,176 +4543,52 @@ var GenerateEvent = () => {
|
|
|
4418
4543
|
]
|
|
4419
4544
|
])
|
|
4420
4545
|
);
|
|
4421
|
-
|
|
4422
|
-
if (eventFolder) {
|
|
4423
|
-
return generateEvent(model.projectFolder, eventFolder);
|
|
4424
|
-
}
|
|
4425
|
-
}, [model.projectFolder, eventFolder]);
|
|
4426
|
-
return /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, /* @__PURE__ */ import_react26.default.createElement(
|
|
4546
|
+
return /* @__PURE__ */ import_react29.default.createElement(
|
|
4427
4547
|
TextInput,
|
|
4428
4548
|
{
|
|
4549
|
+
isActive,
|
|
4429
4550
|
label: t2("generate_command.event.choose_folder"),
|
|
4430
|
-
placeholder: t2("generate_command.event.folder_placeholder"),
|
|
4551
|
+
placeholder: eventFolder ?? t2("generate_command.event.folder_placeholder"),
|
|
4431
4552
|
onSubmit: (value) => {
|
|
4432
|
-
cliFlowStepAnswered({
|
|
4553
|
+
bi.cliFlowStepAnswered({
|
|
4433
4554
|
question: t2("generate_command.event.choose_folder"),
|
|
4434
4555
|
questionKey: "generate_command.event.choose_folder",
|
|
4435
4556
|
answer: value
|
|
4436
4557
|
});
|
|
4437
|
-
|
|
4558
|
+
onSubmit(value);
|
|
4559
|
+
goToNextStep();
|
|
4438
4560
|
},
|
|
4439
4561
|
validate: validateEventFolder
|
|
4440
4562
|
}
|
|
4441
|
-
)
|
|
4442
|
-
() => (0, import_variant18.match)(generationTask, {
|
|
4443
|
-
Success: ({ hasUpdatedDependencies, newFiles }) => {
|
|
4444
|
-
if (!hasUpdatedDependencies) {
|
|
4445
|
-
setFinishedInstallation(true);
|
|
4446
|
-
}
|
|
4447
|
-
return /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, hasUpdatedDependencies && /* @__PURE__ */ import_react26.default.createElement(
|
|
4448
|
-
InstallDependencies,
|
|
4449
|
-
{
|
|
4450
|
-
onFinish: () => setFinishedInstallation(true)
|
|
4451
|
-
}
|
|
4452
|
-
), finishedInstallation && /* @__PURE__ */ import_react26.default.createElement(
|
|
4453
|
-
GenerationSuccessMessage,
|
|
4454
|
-
{
|
|
4455
|
-
extensionType,
|
|
4456
|
-
generatedFiles: newFiles,
|
|
4457
|
-
learnMoreUrl: "https://wix.to/BEkD5a1"
|
|
4458
|
-
}
|
|
4459
|
-
));
|
|
4460
|
-
},
|
|
4461
|
-
Loading: () => /* @__PURE__ */ import_react26.default.createElement(
|
|
4462
|
-
Spinner,
|
|
4463
|
-
{
|
|
4464
|
-
text: t2("generate_command.generation.loading", {
|
|
4465
|
-
subject: extensionType
|
|
4466
|
-
})
|
|
4467
|
-
}
|
|
4468
|
-
),
|
|
4469
|
-
Error: () => null,
|
|
4470
|
-
NotRequested: () => null
|
|
4471
|
-
}),
|
|
4472
|
-
[
|
|
4473
|
-
generationTask,
|
|
4474
|
-
setFinishedInstallation,
|
|
4475
|
-
t2,
|
|
4476
|
-
extensionType,
|
|
4477
|
-
finishedInstallation
|
|
4478
|
-
]
|
|
4479
|
-
));
|
|
4563
|
+
);
|
|
4480
4564
|
};
|
|
4481
4565
|
|
|
4482
|
-
// src/components/GenerateCommand/
|
|
4483
|
-
|
|
4484
|
-
var import_react27 = __toESM(require_react(), 1);
|
|
4485
|
-
var import_variant19 = __toESM(require_lib(), 1);
|
|
4486
|
-
import { join as join2 } from "node:path";
|
|
4487
|
-
|
|
4488
|
-
// src/components/GenerateCommand/web-method-module/generate.ts
|
|
4489
|
-
init_esm_shims();
|
|
4490
|
-
import path12, { join } from "node:path";
|
|
4491
|
-
var WEB_METHOD_TEMPLATE = path12.resolve(__dirname, "../templates/web-method");
|
|
4492
|
-
async function generateWebMethod(projectFolder, folderPath) {
|
|
4493
|
-
const filePath = join(WEB_METHOD_DIR, folderPath);
|
|
4494
|
-
return await componentGenerator({
|
|
4495
|
-
template: WEB_METHOD_TEMPLATE,
|
|
4496
|
-
cwd: projectFolder,
|
|
4497
|
-
projectFolder,
|
|
4498
|
-
data: {
|
|
4499
|
-
filePath,
|
|
4500
|
-
fileName: path12.basename(filePath)
|
|
4501
|
-
}
|
|
4502
|
-
});
|
|
4503
|
-
}
|
|
4504
|
-
|
|
4505
|
-
// src/components/GenerateCommand/web-method-module/WebMethod.tsx
|
|
4506
|
-
var GenerateWebMethod = () => {
|
|
4566
|
+
// src/components/GenerateCommand/event/Event.tsx
|
|
4567
|
+
var useGenerateEvent = () => {
|
|
4507
4568
|
const { t: t2 } = useTranslation();
|
|
4508
4569
|
const { model } = useProjectModel();
|
|
4509
|
-
const
|
|
4510
|
-
const
|
|
4511
|
-
const { backendComponentsByType } = useBackendComponents();
|
|
4512
|
-
const [finishedInstallation, setFinishedInstallation] = (0, import_react27.useState)(false);
|
|
4513
|
-
const webMethods = backendComponentsByType.WebMethod;
|
|
4514
|
-
const extensionType = t2(
|
|
4515
|
-
"generate_command.flow.web_method.title"
|
|
4516
|
-
).toLowerCase();
|
|
4517
|
-
const validateWebMethodFolder = useValidation(
|
|
4518
|
-
composeValidations([
|
|
4519
|
-
[
|
|
4520
|
-
(filePath) => {
|
|
4521
|
-
const resolvedFolderPath = `${join2(WEB_METHOD_DIR, filePath)}.web.ts`;
|
|
4522
|
-
return pathValidation(filePath) && webMethods.every(
|
|
4523
|
-
(webMethod) => webMethod.relativePath !== resolvedFolderPath
|
|
4524
|
-
);
|
|
4525
|
-
},
|
|
4526
|
-
t2("generate_command.web_method.choose_filename.error")
|
|
4527
|
-
]
|
|
4528
|
-
])
|
|
4529
|
-
);
|
|
4570
|
+
const [eventFolder, setEventFolder] = (0, import_react30.useState)();
|
|
4571
|
+
const extensionType = t2("generate_command.flow.event").toLowerCase();
|
|
4530
4572
|
const generationTask = useGenerationTask(async () => {
|
|
4531
|
-
if (
|
|
4532
|
-
return
|
|
4533
|
-
}
|
|
4534
|
-
}, [model.projectFolder, webMethodFolder]);
|
|
4535
|
-
return /* @__PURE__ */ import_react27.default.createElement(import_react27.default.Fragment, null, /* @__PURE__ */ import_react27.default.createElement(
|
|
4536
|
-
TextInput,
|
|
4537
|
-
{
|
|
4538
|
-
label: t2("generate_command.web_method.choose_filename"),
|
|
4539
|
-
placeholder: t2(
|
|
4540
|
-
"generate_command.web_method.choose_filename.placeholder"
|
|
4541
|
-
),
|
|
4542
|
-
onSubmit: (folderPath) => {
|
|
4543
|
-
cliFlowStepAnswered({
|
|
4544
|
-
question: t2("generate_command.web_method.choose_filename"),
|
|
4545
|
-
questionKey: "generate_command.web_method.choose_filename",
|
|
4546
|
-
answer: folderPath
|
|
4547
|
-
});
|
|
4548
|
-
setWebMethodFolder(folderPath);
|
|
4549
|
-
},
|
|
4550
|
-
validate: validateWebMethodFolder
|
|
4573
|
+
if (eventFolder) {
|
|
4574
|
+
return generateEvent(model.projectFolder, eventFolder);
|
|
4551
4575
|
}
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
),
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
learnMoreUrl: "https://wix.to/BEkD5a1"
|
|
4569
|
-
}
|
|
4570
|
-
));
|
|
4571
|
-
},
|
|
4572
|
-
Loading: () => /* @__PURE__ */ import_react27.default.createElement(
|
|
4573
|
-
Spinner,
|
|
4574
|
-
{
|
|
4575
|
-
text: t2("generate_command.generation.loading", {
|
|
4576
|
-
subject: extensionType
|
|
4577
|
-
})
|
|
4578
|
-
}
|
|
4579
|
-
),
|
|
4580
|
-
Error: () => null,
|
|
4581
|
-
NotRequested: () => null
|
|
4582
|
-
}),
|
|
4583
|
-
[
|
|
4584
|
-
generationTask,
|
|
4585
|
-
setFinishedInstallation,
|
|
4586
|
-
t2,
|
|
4587
|
-
extensionType,
|
|
4588
|
-
finishedInstallation
|
|
4589
|
-
]
|
|
4590
|
-
));
|
|
4576
|
+
}, [model.projectFolder, eventFolder]);
|
|
4577
|
+
return [
|
|
4578
|
+
/* @__PURE__ */ import_react30.default.createElement(ChooseFolderStep2, { onSubmit: setEventFolder, eventFolder }),
|
|
4579
|
+
/* @__PURE__ */ import_react30.default.createElement(
|
|
4580
|
+
CompleteGeneration,
|
|
4581
|
+
{
|
|
4582
|
+
generationTask,
|
|
4583
|
+
extensionType,
|
|
4584
|
+
successMessage: CompleteGenerationMessage.SuccessMessage({
|
|
4585
|
+
// https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/backend-extensions/events/add-event-extensions-with-the-cli
|
|
4586
|
+
learnMoreUrl: "https://wix.to/7XWf4LU"
|
|
4587
|
+
}),
|
|
4588
|
+
route: eventFolder
|
|
4589
|
+
}
|
|
4590
|
+
)
|
|
4591
|
+
];
|
|
4591
4592
|
};
|
|
4592
4593
|
|
|
4593
4594
|
// src/components/GenerateCommand/site-widget/index.ts
|
|
@@ -4595,31 +4596,29 @@ init_esm_shims();
|
|
|
4595
4596
|
|
|
4596
4597
|
// src/components/GenerateCommand/site-widget/SiteWidgetWizard.tsx
|
|
4597
4598
|
init_esm_shims();
|
|
4598
|
-
var
|
|
4599
|
+
var import_react35 = __toESM(require_react(), 1);
|
|
4599
4600
|
|
|
4600
4601
|
// src/components/GenerateCommand/site-widget/custom-element/CustomElement.tsx
|
|
4601
4602
|
init_esm_shims();
|
|
4602
|
-
var
|
|
4603
|
-
var import_variant20 = __toESM(require_lib(), 1);
|
|
4604
|
-
var import_lodash7 = __toESM(require_lodash(), 1);
|
|
4603
|
+
var import_react32 = __toESM(require_react(), 1);
|
|
4605
4604
|
|
|
4606
4605
|
// src/components/GenerateCommand/site-widget/custom-element/generate.ts
|
|
4607
4606
|
init_esm_shims();
|
|
4608
|
-
import
|
|
4607
|
+
import path12 from "node:path";
|
|
4609
4608
|
import { randomUUID as randomUUID9 } from "node:crypto";
|
|
4610
|
-
var CUSTOM_ELEMENT_TEMPLATE =
|
|
4609
|
+
var CUSTOM_ELEMENT_TEMPLATE = path12.resolve(
|
|
4611
4610
|
__dirname,
|
|
4612
4611
|
"../templates/custom-element"
|
|
4613
4612
|
);
|
|
4614
4613
|
async function generateCustomElement(projectFolder, folder, name, dashboardPageId) {
|
|
4615
|
-
const readablePath =
|
|
4616
|
-
const cwd =
|
|
4614
|
+
const readablePath = path12.join(SITE_WIDGETS_DIR, folder);
|
|
4615
|
+
const cwd = path12.join(getSiteWidgetsDir(projectFolder), folder);
|
|
4617
4616
|
const behaviorsConfig = dashboardPageId ? {
|
|
4618
4617
|
dashboard: {
|
|
4619
4618
|
dashboardPageComponentId: dashboardPageId
|
|
4620
4619
|
}
|
|
4621
4620
|
} : void 0;
|
|
4622
|
-
const defaultThumbnailPath =
|
|
4621
|
+
const defaultThumbnailPath = path12.join(
|
|
4623
4622
|
projectFolder,
|
|
4624
4623
|
"src/assets",
|
|
4625
4624
|
folder,
|
|
@@ -4643,7 +4642,9 @@ async function generateCustomElement(projectFolder, folder, name, dashboardPageI
|
|
|
4643
4642
|
presets: [
|
|
4644
4643
|
{
|
|
4645
4644
|
id: randomUUID9(),
|
|
4646
|
-
thumbnailUrl:
|
|
4645
|
+
thumbnailUrl: normalizeGlobbyPattern(
|
|
4646
|
+
path12.relative(cwd, defaultThumbnailPath)
|
|
4647
|
+
)
|
|
4647
4648
|
}
|
|
4648
4649
|
]
|
|
4649
4650
|
};
|
|
@@ -4663,44 +4664,22 @@ async function generateCustomElement(projectFolder, folder, name, dashboardPageI
|
|
|
4663
4664
|
});
|
|
4664
4665
|
}
|
|
4665
4666
|
|
|
4666
|
-
// src/components/GenerateCommand/site-widget/custom-element/
|
|
4667
|
-
|
|
4667
|
+
// src/components/GenerateCommand/site-widget/custom-element/steps.tsx
|
|
4668
|
+
init_esm_shims();
|
|
4669
|
+
var import_react31 = __toESM(require_react(), 1);
|
|
4670
|
+
var import_lodash7 = __toESM(require_lodash(), 1);
|
|
4671
|
+
var ChooseNameStep2 = ({ onSubmit, elementName }) => {
|
|
4668
4672
|
const bi = useWixCliAppBi();
|
|
4669
4673
|
const { t: t2 } = useTranslation();
|
|
4670
|
-
const {
|
|
4671
|
-
const [elementName, setElementName] = (0, import_react28.useState)();
|
|
4672
|
-
const [elementFolder, setElementFolder] = (0, import_react28.useState)();
|
|
4673
|
-
const [linkDashboardPage, setLinkDashboardPage] = (0, import_react28.useState)();
|
|
4674
|
-
const [generationData, setGenerationData] = (0, import_react28.useState)();
|
|
4675
|
-
const validateFolderName = useCustomElementDirectoryValidation("Site widget");
|
|
4676
|
-
const validateName = useCustomElementNameValidation();
|
|
4677
|
-
const { getExtensions } = useExtensions();
|
|
4678
|
-
const [finishedInstallation, setFinishedInstallation] = (0, import_react28.useState)(false);
|
|
4679
|
-
const defaultElementFolder = (0, import_lodash7.kebabCase)(elementName);
|
|
4680
|
-
const dashboardPages = getExtensions("DashboardPage");
|
|
4681
|
-
const dashboardPagesOptions = dashboardPages.map(
|
|
4682
|
-
({ id, title }) => ({
|
|
4683
|
-
value: id,
|
|
4684
|
-
title
|
|
4685
|
-
})
|
|
4686
|
-
);
|
|
4687
|
-
const dashboardPagesExist = Boolean(dashboardPages.length);
|
|
4674
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
4688
4675
|
const extensionType = t2("generate_command.flow.custom_element").toLowerCase();
|
|
4689
|
-
const
|
|
4690
|
-
|
|
4691
|
-
return generateCustomElement(
|
|
4692
|
-
model.projectFolder,
|
|
4693
|
-
generationData.folder,
|
|
4694
|
-
generationData.name,
|
|
4695
|
-
generationData.dashboardPageId
|
|
4696
|
-
);
|
|
4697
|
-
}
|
|
4698
|
-
}, [generationData]);
|
|
4699
|
-
return /* @__PURE__ */ import_react28.default.createElement(import_react28.default.Fragment, null, /* @__PURE__ */ import_react28.default.createElement(
|
|
4676
|
+
const validateName = useCustomElementNameValidation();
|
|
4677
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
4700
4678
|
TextInput,
|
|
4701
4679
|
{
|
|
4680
|
+
isActive,
|
|
4702
4681
|
label: t2("generate_command.custom_element.choose_name"),
|
|
4703
|
-
placeholder: t2("generate_command.custom_element.name_placeholder"),
|
|
4682
|
+
placeholder: elementName ?? t2("generate_command.custom_element.name_placeholder"),
|
|
4704
4683
|
onSubmit: (value) => {
|
|
4705
4684
|
bi.cliFlowStepAnswered({
|
|
4706
4685
|
question: t2("generate_command.custom_element.choose_name"),
|
|
@@ -4710,15 +4689,26 @@ var GenerateCustomElement = () => {
|
|
|
4710
4689
|
extensionType
|
|
4711
4690
|
}
|
|
4712
4691
|
});
|
|
4713
|
-
|
|
4692
|
+
onSubmit(value);
|
|
4693
|
+
goToNextStep();
|
|
4714
4694
|
},
|
|
4715
4695
|
validate: validateName
|
|
4716
4696
|
}
|
|
4717
|
-
)
|
|
4697
|
+
);
|
|
4698
|
+
};
|
|
4699
|
+
var ChooseFolderStep3 = ({ onSubmit, elementFolder, elementName }) => {
|
|
4700
|
+
const bi = useWixCliAppBi();
|
|
4701
|
+
const { t: t2 } = useTranslation();
|
|
4702
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
4703
|
+
const defaultElementFolder = (0, import_lodash7.kebabCase)(elementName);
|
|
4704
|
+
const extensionType = t2("generate_command.flow.custom_element").toLowerCase();
|
|
4705
|
+
const validateFolderName = useCustomElementDirectoryValidation("Site widget");
|
|
4706
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
4718
4707
|
TextInput,
|
|
4719
4708
|
{
|
|
4709
|
+
isActive,
|
|
4720
4710
|
label: t2("generate_command.custom_element.choose_folder"),
|
|
4721
|
-
placeholder: defaultElementFolder,
|
|
4711
|
+
placeholder: elementFolder ?? defaultElementFolder,
|
|
4722
4712
|
onSubmit: (value) => {
|
|
4723
4713
|
bi.cliFlowStepAnswered({
|
|
4724
4714
|
question: t2("generate_command.custom_element.choose_folder"),
|
|
@@ -4728,102 +4718,125 @@ var GenerateCustomElement = () => {
|
|
|
4728
4718
|
extensionType
|
|
4729
4719
|
}
|
|
4730
4720
|
});
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
setGenerationData({
|
|
4734
|
-
name: elementName,
|
|
4735
|
-
folder: value
|
|
4736
|
-
});
|
|
4737
|
-
}
|
|
4721
|
+
onSubmit(value);
|
|
4722
|
+
goToNextStep();
|
|
4738
4723
|
},
|
|
4739
4724
|
validate: validateFolderName
|
|
4740
4725
|
}
|
|
4741
|
-
)
|
|
4726
|
+
);
|
|
4727
|
+
};
|
|
4728
|
+
var LinkDashboardPageStep = ({ onSubmit }) => {
|
|
4729
|
+
const bi = useWixCliAppBi();
|
|
4730
|
+
const { t: t2 } = useTranslation();
|
|
4731
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
4732
|
+
const extensionType = t2("generate_command.flow.custom_element").toLowerCase();
|
|
4733
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
4742
4734
|
ConfirmInput,
|
|
4743
4735
|
{
|
|
4736
|
+
isActive,
|
|
4744
4737
|
label: t2("generate_command.custom_element.link_dashboard_page"),
|
|
4745
4738
|
onSubmit: (shouldLinkDashboardPage) => {
|
|
4746
4739
|
bi.cliFlowStepAnswered({
|
|
4747
|
-
question: t2(
|
|
4748
|
-
"generate_command.custom_element.link_dashboard_page"
|
|
4749
|
-
),
|
|
4740
|
+
question: t2("generate_command.custom_element.link_dashboard_page"),
|
|
4750
4741
|
questionKey: "generate_command.custom_element.link_dashboard_page",
|
|
4751
4742
|
answer: String(shouldLinkDashboardPage),
|
|
4752
4743
|
additionalInfo: { extensionType }
|
|
4753
4744
|
});
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
setGenerationData({
|
|
4757
|
-
name: elementName,
|
|
4758
|
-
folder: elementFolder
|
|
4759
|
-
});
|
|
4760
|
-
}
|
|
4745
|
+
onSubmit(shouldLinkDashboardPage);
|
|
4746
|
+
goToNextStep();
|
|
4761
4747
|
}
|
|
4762
4748
|
}
|
|
4763
|
-
)
|
|
4749
|
+
);
|
|
4750
|
+
};
|
|
4751
|
+
var ChooseDashboardPageStep = ({ onSubmit }) => {
|
|
4752
|
+
const bi = useWixCliAppBi();
|
|
4753
|
+
const { t: t2 } = useTranslation();
|
|
4754
|
+
const { getExtensions } = useExtensions();
|
|
4755
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
4756
|
+
const extensionType = t2("generate_command.flow.custom_element").toLowerCase();
|
|
4757
|
+
const dashboardPages = getExtensions("DashboardPage");
|
|
4758
|
+
const dashboardPagesOptions = dashboardPages.map(
|
|
4759
|
+
({ id, title }) => ({
|
|
4760
|
+
value: id,
|
|
4761
|
+
title
|
|
4762
|
+
})
|
|
4763
|
+
);
|
|
4764
|
+
return /* @__PURE__ */ import_react31.default.createElement(
|
|
4764
4765
|
SelectInput,
|
|
4765
4766
|
{
|
|
4767
|
+
isActive,
|
|
4766
4768
|
label: t2("generate_command.custom_element.choose_dashboard_page"),
|
|
4767
4769
|
options: dashboardPagesOptions,
|
|
4768
4770
|
onSubmit: (option) => {
|
|
4769
4771
|
bi.cliFlowStepAnswered({
|
|
4770
|
-
question: t2(
|
|
4771
|
-
"generate_command.custom_element.choose_dashboard_page"
|
|
4772
|
-
),
|
|
4772
|
+
question: t2("generate_command.custom_element.choose_dashboard_page"),
|
|
4773
4773
|
questionKey: "generate_command.custom_element.choose_dashboard_page",
|
|
4774
4774
|
answer: option.title,
|
|
4775
4775
|
additionalInfo: { extensionType }
|
|
4776
4776
|
});
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
folder: elementFolder,
|
|
4780
|
-
dashboardPageId: option.value
|
|
4781
|
-
});
|
|
4777
|
+
onSubmit(option.value);
|
|
4778
|
+
goToNextStep();
|
|
4782
4779
|
}
|
|
4783
4780
|
}
|
|
4784
|
-
)
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4781
|
+
);
|
|
4782
|
+
};
|
|
4783
|
+
|
|
4784
|
+
// src/components/GenerateCommand/site-widget/custom-element/CustomElement.tsx
|
|
4785
|
+
var useGenerateCustomElement = () => {
|
|
4786
|
+
const { t: t2 } = useTranslation();
|
|
4787
|
+
const { model } = useProjectModel();
|
|
4788
|
+
const { getExtensions } = useExtensions();
|
|
4789
|
+
const [elementName, setElementName] = (0, import_react32.useState)();
|
|
4790
|
+
const [elementFolder, setElementFolder] = (0, import_react32.useState)();
|
|
4791
|
+
const [linkDashboardPage, setLinkDashboardPage] = (0, import_react32.useState)();
|
|
4792
|
+
const [dashboardPageId, setDashboardPageId] = (0, import_react32.useState)();
|
|
4793
|
+
const dashboardPages = getExtensions("DashboardPage");
|
|
4794
|
+
const dashboardPagesExist = Boolean(dashboardPages.length);
|
|
4795
|
+
const extensionType = t2("generate_command.flow.custom_element").toLowerCase();
|
|
4796
|
+
const shouldGenerate = !dashboardPagesExist || (linkDashboardPage === false ? true : dashboardPageId);
|
|
4797
|
+
const generationTask = useGenerationTask(async () => {
|
|
4798
|
+
if (elementName && elementFolder && shouldGenerate) {
|
|
4799
|
+
return generateCustomElement(
|
|
4800
|
+
model.projectFolder,
|
|
4801
|
+
elementFolder,
|
|
4802
|
+
elementName,
|
|
4803
|
+
dashboardPageId
|
|
4804
|
+
);
|
|
4805
|
+
}
|
|
4806
|
+
}, [elementFolder, elementName, shouldGenerate]);
|
|
4807
|
+
return [
|
|
4808
|
+
/* @__PURE__ */ import_react32.default.createElement(ChooseNameStep2, { onSubmit: setElementName, elementName }),
|
|
4809
|
+
/* @__PURE__ */ import_react32.default.createElement(
|
|
4810
|
+
ChooseFolderStep3,
|
|
4811
|
+
{
|
|
4812
|
+
onSubmit: setElementFolder,
|
|
4813
|
+
elementFolder,
|
|
4814
|
+
elementName
|
|
4815
|
+
}
|
|
4816
|
+
),
|
|
4817
|
+
...dashboardPagesExist ? [/* @__PURE__ */ import_react32.default.createElement(LinkDashboardPageStep, { onSubmit: setLinkDashboardPage })] : [],
|
|
4818
|
+
...dashboardPagesExist && linkDashboardPage ? [/* @__PURE__ */ import_react32.default.createElement(ChooseDashboardPageStep, { onSubmit: setDashboardPageId })] : [],
|
|
4819
|
+
/* @__PURE__ */ import_react32.default.createElement(
|
|
4820
|
+
CompleteGeneration,
|
|
4821
|
+
{
|
|
4822
|
+
generationTask,
|
|
4823
|
+
extensionType,
|
|
4824
|
+
successMessage: CompleteGenerationMessage.SuccessMessage({
|
|
4825
|
+
// https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/site-extensions/site-widgets/site-widget-extension-files-and-code
|
|
4826
|
+
learnMoreUrl: "https://wix.to/rEfCfbY"
|
|
4827
|
+
})
|
|
4828
|
+
}
|
|
4829
|
+
)
|
|
4830
|
+
];
|
|
4817
4831
|
};
|
|
4818
4832
|
|
|
4819
4833
|
// src/components/GenerateCommand/site-widget/blocks/Blocks.tsx
|
|
4820
4834
|
init_esm_shims();
|
|
4821
|
-
var
|
|
4822
|
-
var import_variant21 = __toESM(require_lib(), 1);
|
|
4835
|
+
var import_react34 = __toESM(require_react(), 1);
|
|
4823
4836
|
|
|
4824
4837
|
// src/components/GenerateCommand/site-widget/blocks/generate.ts
|
|
4825
4838
|
init_esm_shims();
|
|
4826
|
-
import
|
|
4839
|
+
import path13 from "node:path";
|
|
4827
4840
|
|
|
4828
4841
|
// src/files/tsconfig.ts
|
|
4829
4842
|
init_esm_shims();
|
|
@@ -4870,7 +4883,7 @@ async function saveTSConfig(projectFolder, config) {
|
|
|
4870
4883
|
}
|
|
4871
4884
|
|
|
4872
4885
|
// src/components/GenerateCommand/site-widget/blocks/generate.ts
|
|
4873
|
-
var BLOCKS_SUPPORT_TEMPLATE =
|
|
4886
|
+
var BLOCKS_SUPPORT_TEMPLATE = path13.resolve(
|
|
4874
4887
|
__dirname,
|
|
4875
4888
|
"../templates/blocks-support"
|
|
4876
4889
|
);
|
|
@@ -4890,7 +4903,7 @@ async function enableBlocksInProject(projectFolder, config) {
|
|
|
4890
4903
|
}
|
|
4891
4904
|
const newDependencies = await dependenciesUpdater({
|
|
4892
4905
|
projectFolder,
|
|
4893
|
-
dependenciesJsonPath:
|
|
4906
|
+
dependenciesJsonPath: path13.join(
|
|
4894
4907
|
BLOCKS_SUPPORT_TEMPLATE,
|
|
4895
4908
|
"dependencies.json"
|
|
4896
4909
|
)
|
|
@@ -4898,64 +4911,82 @@ async function enableBlocksInProject(projectFolder, config) {
|
|
|
4898
4911
|
return { newDependencies, newFiles: [] };
|
|
4899
4912
|
}
|
|
4900
4913
|
|
|
4914
|
+
// src/components/GenerateCommand/site-widget/blocks/BlocksGenerationSuccessMessage.tsx
|
|
4915
|
+
init_esm_shims();
|
|
4916
|
+
var import_react33 = __toESM(require_react(), 1);
|
|
4917
|
+
var BlockGenerationSuccessMessage = () => {
|
|
4918
|
+
const { t: t2 } = useTranslation();
|
|
4919
|
+
return /* @__PURE__ */ import_react33.default.createElement(
|
|
4920
|
+
Box_default,
|
|
4921
|
+
{
|
|
4922
|
+
borderColor: "blue",
|
|
4923
|
+
borderStyle: "round",
|
|
4924
|
+
flexDirection: "column",
|
|
4925
|
+
paddingY: 1,
|
|
4926
|
+
paddingX: 3,
|
|
4927
|
+
gap: 1,
|
|
4928
|
+
marginTop: 1
|
|
4929
|
+
},
|
|
4930
|
+
/* @__PURE__ */ import_react33.default.createElement(Box_default, { marginTop: -2, marginLeft: 0 }, /* @__PURE__ */ import_react33.default.createElement(Text, { skin: "question", bold: true }, t2("generate_command.blocks.success.title"))),
|
|
4931
|
+
/* @__PURE__ */ import_react33.default.createElement(
|
|
4932
|
+
Trans,
|
|
4933
|
+
{
|
|
4934
|
+
i18nKey: "generate_command.blocks.success.info.title",
|
|
4935
|
+
components: [/* @__PURE__ */ import_react33.default.createElement(Rocket, null)]
|
|
4936
|
+
}
|
|
4937
|
+
),
|
|
4938
|
+
/* @__PURE__ */ import_react33.default.createElement(Box_default, { paddingLeft: 3 }, /* @__PURE__ */ import_react33.default.createElement(Trans, { i18nKey: "generate_command.blocks.success.info.steps" })),
|
|
4939
|
+
/* @__PURE__ */ import_react33.default.createElement(
|
|
4940
|
+
Trans,
|
|
4941
|
+
{
|
|
4942
|
+
i18nKey: "generate_command.generation.learn_more",
|
|
4943
|
+
values: { extensionType: "blocks widgets" },
|
|
4944
|
+
components: [/* @__PURE__ */ import_react33.default.createElement(Learn, null), /* @__PURE__ */ import_react33.default.createElement(Link, { url: "https://wix.to/HuMifhw" })]
|
|
4945
|
+
}
|
|
4946
|
+
)
|
|
4947
|
+
);
|
|
4948
|
+
};
|
|
4949
|
+
|
|
4901
4950
|
// src/components/GenerateCommand/site-widget/blocks/Blocks.tsx
|
|
4902
|
-
var
|
|
4951
|
+
var useAddBlocksSupportToProject = ({
|
|
4952
|
+
siteWidgetType
|
|
4953
|
+
}) => {
|
|
4903
4954
|
const { t: t2 } = useTranslation();
|
|
4904
4955
|
const { model } = useProjectModel();
|
|
4905
|
-
const [finishedInstallation, setFinishedInstallation] = (0, import_react29.useState)(false);
|
|
4906
4956
|
const extensionType = t2(
|
|
4907
4957
|
"generate_command.site_widget_wizard.blocks.title"
|
|
4908
4958
|
).toLowerCase();
|
|
4909
4959
|
const supportBlocksTask = useGenerationTask(async () => {
|
|
4910
|
-
if (
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
return /* @__PURE__ */ import_react29.default.createElement(import_react29.default.Fragment, null, (0, import_react29.useMemo)(
|
|
4916
|
-
() => (0, import_variant21.match)(supportBlocksTask, {
|
|
4917
|
-
Success: ({ hasUpdatedDependencies }) => {
|
|
4918
|
-
if (hasUpdatedDependencies) {
|
|
4919
|
-
return /* @__PURE__ */ import_react29.default.createElement(
|
|
4920
|
-
InstallDependencies,
|
|
4921
|
-
{
|
|
4922
|
-
onFinish: () => setFinishedInstallation(true)
|
|
4923
|
-
}
|
|
4924
|
-
);
|
|
4925
|
-
}
|
|
4926
|
-
setFinishedInstallation(true);
|
|
4927
|
-
},
|
|
4928
|
-
Loading: () => /* @__PURE__ */ import_react29.default.createElement(
|
|
4929
|
-
Spinner,
|
|
4930
|
-
{
|
|
4931
|
-
text: t2("generate_command.generation.loading", {
|
|
4932
|
-
subject: extensionType
|
|
4933
|
-
})
|
|
4934
|
-
}
|
|
4935
|
-
),
|
|
4936
|
-
NotRequested: () => null,
|
|
4937
|
-
Error: () => null
|
|
4938
|
-
}),
|
|
4939
|
-
[supportBlocksTask, t2, extensionType]
|
|
4940
|
-
), finishedInstallation && /* @__PURE__ */ import_react29.default.createElement(Box_default, { marginTop: 1 }, /* @__PURE__ */ import_react29.default.createElement(
|
|
4941
|
-
Trans,
|
|
4942
|
-
{
|
|
4943
|
-
i18nKey: "generate_command.blocks.success",
|
|
4944
|
-
components: [
|
|
4945
|
-
/* @__PURE__ */ import_react29.default.createElement(Link, { url: "https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/site-extensions/blocks-site-widgets/add-a-blocks-site-widget-extension-in-the-cli" })
|
|
4946
|
-
]
|
|
4960
|
+
if (siteWidgetType === "blocks") {
|
|
4961
|
+
if (model.config.blocks) {
|
|
4962
|
+
return;
|
|
4963
|
+
}
|
|
4964
|
+
return enableBlocksInProject(model.projectFolder, model.config);
|
|
4947
4965
|
}
|
|
4948
|
-
)
|
|
4966
|
+
}, [siteWidgetType]);
|
|
4967
|
+
return [
|
|
4968
|
+
/* @__PURE__ */ import_react34.default.createElement(
|
|
4969
|
+
CompleteGeneration,
|
|
4970
|
+
{
|
|
4971
|
+
generationTask: supportBlocksTask,
|
|
4972
|
+
extensionType,
|
|
4973
|
+
successMessage: CompleteGenerationMessage.CustomSuccessMessage({
|
|
4974
|
+
comp: /* @__PURE__ */ import_react34.default.createElement(BlockGenerationSuccessMessage, null)
|
|
4975
|
+
})
|
|
4976
|
+
}
|
|
4977
|
+
)
|
|
4978
|
+
];
|
|
4949
4979
|
};
|
|
4950
4980
|
|
|
4951
4981
|
// src/components/GenerateCommand/site-widget/SiteWidgetWizard.tsx
|
|
4952
|
-
var
|
|
4982
|
+
var SelectSiteWidgetTypeStep = ({ onSubmit }) => {
|
|
4953
4983
|
const bi = useWixCliAppBi();
|
|
4954
4984
|
const { t: t2 } = useTranslation();
|
|
4955
|
-
const
|
|
4956
|
-
return /* @__PURE__ */
|
|
4985
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
4986
|
+
return /* @__PURE__ */ import_react35.default.createElement(
|
|
4957
4987
|
SelectInput,
|
|
4958
4988
|
{
|
|
4989
|
+
isActive,
|
|
4959
4990
|
label: t2("generate_command.site_widget_wizard.choose_extention.title"),
|
|
4960
4991
|
info: t2("generate_command.site_widget_wizard.choose_extention.info"),
|
|
4961
4992
|
options: [
|
|
@@ -4963,12 +4994,12 @@ var GenerateSiteWidgetWizard = () => {
|
|
|
4963
4994
|
title: t2(
|
|
4964
4995
|
"generate_command.site_widget_wizard.custom_element_option.title"
|
|
4965
4996
|
),
|
|
4966
|
-
description: /* @__PURE__ */
|
|
4997
|
+
description: /* @__PURE__ */ import_react35.default.createElement(
|
|
4967
4998
|
Trans,
|
|
4968
4999
|
{
|
|
4969
5000
|
i18nKey: "generate_command.site_widget_wizard.custom_element_option.description",
|
|
4970
5001
|
components: [
|
|
4971
|
-
/* @__PURE__ */
|
|
5002
|
+
/* @__PURE__ */ import_react35.default.createElement(Link, { url: "https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/site-extensions/site-widgets/add-a-site-widget-extension-in-the-cli" })
|
|
4972
5003
|
]
|
|
4973
5004
|
}
|
|
4974
5005
|
),
|
|
@@ -4976,12 +5007,12 @@ var GenerateSiteWidgetWizard = () => {
|
|
|
4976
5007
|
},
|
|
4977
5008
|
{
|
|
4978
5009
|
title: t2("generate_command.site_widget_wizard.blocks.title"),
|
|
4979
|
-
description: /* @__PURE__ */
|
|
5010
|
+
description: /* @__PURE__ */ import_react35.default.createElement(
|
|
4980
5011
|
Trans,
|
|
4981
5012
|
{
|
|
4982
5013
|
i18nKey: "generate_command.site_widget_wizard.blocks.description",
|
|
4983
5014
|
components: [
|
|
4984
|
-
/* @__PURE__ */
|
|
5015
|
+
/* @__PURE__ */ import_react35.default.createElement(Link, { url: "https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/site-extensions/blocks-site-widgets/add-a-blocks-site-widget-extension-in-the-cli" })
|
|
4985
5016
|
]
|
|
4986
5017
|
}
|
|
4987
5018
|
),
|
|
@@ -4996,19 +5027,33 @@ var GenerateSiteWidgetWizard = () => {
|
|
|
4996
5027
|
questionKey: "generate_command.site_widget_wizard.choose_extention.title",
|
|
4997
5028
|
answer: option.title
|
|
4998
5029
|
});
|
|
4999
|
-
|
|
5030
|
+
onSubmit(option.value);
|
|
5031
|
+
goToNextStep();
|
|
5000
5032
|
}
|
|
5001
5033
|
}
|
|
5002
|
-
)
|
|
5034
|
+
);
|
|
5035
|
+
};
|
|
5036
|
+
var useGenerateSiteWidget = () => {
|
|
5037
|
+
const [siteWidgetType, setSiteWidgetType] = (0, import_react35.useState)();
|
|
5038
|
+
const generateCustomElementSteps = useGenerateCustomElement();
|
|
5039
|
+
const addBlocksSupportToProjectSteps = useAddBlocksSupportToProject({
|
|
5040
|
+
siteWidgetType
|
|
5041
|
+
});
|
|
5042
|
+
return [
|
|
5043
|
+
/* @__PURE__ */ import_react35.default.createElement(SelectSiteWidgetTypeStep, { onSubmit: setSiteWidgetType }),
|
|
5044
|
+
...siteWidgetType === "customElement" ? generateCustomElementSteps : [],
|
|
5045
|
+
...siteWidgetType === "blocks" ? addBlocksSupportToProjectSteps : [],
|
|
5046
|
+
...siteWidgetType === void 0 ? [/* @__PURE__ */ import_react35.default.createElement(import_react35.default.Fragment, null)] : []
|
|
5047
|
+
];
|
|
5003
5048
|
};
|
|
5004
5049
|
|
|
5005
5050
|
// src/components/GenerateCommand/GenerateCommand.tsx
|
|
5006
|
-
var DevCenterGenerateFlow = (0,
|
|
5051
|
+
var DevCenterGenerateFlow = (0, import_variant14.variant)((0, import_variant14.types)(DevCenterComponent));
|
|
5007
5052
|
var FlowSelector = ({ onSubmit, generateFlow, generateFlows }) => {
|
|
5008
5053
|
const { t: t2 } = useTranslation();
|
|
5009
5054
|
const bi = useWixCliAppBi();
|
|
5010
5055
|
const { goToNextStep, isActive } = useWizardStep();
|
|
5011
|
-
const selectFlow = (0,
|
|
5056
|
+
const selectFlow = (0, import_react36.useCallback)(
|
|
5012
5057
|
(selectedType) => {
|
|
5013
5058
|
bi.cliFlowStepAnswered({
|
|
5014
5059
|
question: t2("generate_command.flow.choose_flow"),
|
|
@@ -5020,27 +5065,33 @@ var FlowSelector = ({ onSubmit, generateFlow, generateFlows }) => {
|
|
|
5020
5065
|
},
|
|
5021
5066
|
[bi, t2, onSubmit, goToNextStep]
|
|
5022
5067
|
);
|
|
5023
|
-
(0,
|
|
5068
|
+
(0, import_react36.useEffect)(() => {
|
|
5024
5069
|
goToNextStep();
|
|
5025
5070
|
}, []);
|
|
5026
|
-
return /* @__PURE__ */
|
|
5071
|
+
return /* @__PURE__ */ import_react36.default.createElement(
|
|
5027
5072
|
SelectGroupsInput,
|
|
5028
5073
|
{
|
|
5029
5074
|
value: !isActive ? InputState.Submitted(generateFlow) : InputState.NotSubmitted(generateFlow),
|
|
5030
5075
|
label: t2("generate_command.flow.choose_flow"),
|
|
5031
5076
|
groups: generateFlows,
|
|
5032
5077
|
onSubmit: selectFlow,
|
|
5033
|
-
maxHeight:
|
|
5078
|
+
maxHeight: 15
|
|
5034
5079
|
}
|
|
5035
5080
|
);
|
|
5036
5081
|
};
|
|
5037
5082
|
var GenerateCommand = () => {
|
|
5038
5083
|
const { t: t2 } = useTranslation();
|
|
5039
5084
|
const bi = useWixCliAppBi();
|
|
5040
|
-
const
|
|
5085
|
+
const dashboardPageSteps = useGenerateDashboardPage();
|
|
5041
5086
|
const dashboardModalSteps = useGenerateDashboardModal();
|
|
5042
|
-
const
|
|
5043
|
-
const
|
|
5087
|
+
const apiSteps = useGenerateApi();
|
|
5088
|
+
const generateEventsSteps = useGenerateEvent();
|
|
5089
|
+
const generateServicePluginSteps = useGenerateServicePlugin();
|
|
5090
|
+
const generateEmbeddedScriptSteps = useGenerateEmbeddedScript();
|
|
5091
|
+
const generateSidebarCategorySteps = useGenerateSidebarCategory();
|
|
5092
|
+
const generateSiteWidgetSteps = useGenerateSiteWidget();
|
|
5093
|
+
const [generateFlow, setGenerateFlow] = (0, import_react36.useState)();
|
|
5094
|
+
const generateFlows = (0, import_react36.useMemo)(
|
|
5044
5095
|
() => [
|
|
5045
5096
|
{
|
|
5046
5097
|
title: t2("generate_command.flow.dashboard_category"),
|
|
@@ -5101,11 +5152,6 @@ var GenerateCommand = () => {
|
|
|
5101
5152
|
title: t2("generate_command.flow.api.title"),
|
|
5102
5153
|
value: DevCenterGenerateFlow.Api()
|
|
5103
5154
|
},
|
|
5104
|
-
{
|
|
5105
|
-
key: "web-method-module",
|
|
5106
|
-
title: t2("generate_command.flow.web_method.title"),
|
|
5107
|
-
value: DevCenterGenerateFlow.WebMethod()
|
|
5108
|
-
},
|
|
5109
5155
|
{
|
|
5110
5156
|
key: "event",
|
|
5111
5157
|
title: t2("generate_command.flow.event"),
|
|
@@ -5121,7 +5167,7 @@ var GenerateCommand = () => {
|
|
|
5121
5167
|
],
|
|
5122
5168
|
[t2]
|
|
5123
5169
|
);
|
|
5124
|
-
const selectFlow = (0,
|
|
5170
|
+
const selectFlow = (0, import_react36.useCallback)(
|
|
5125
5171
|
(selectedType) => {
|
|
5126
5172
|
bi.cliFlowStepAnswered({
|
|
5127
5173
|
question: t2("generate_command.flow.choose_flow"),
|
|
@@ -5132,25 +5178,25 @@ var GenerateCommand = () => {
|
|
|
5132
5178
|
},
|
|
5133
5179
|
[bi, t2]
|
|
5134
5180
|
);
|
|
5135
|
-
const shouldEditFlow = (0,
|
|
5136
|
-
return /* @__PURE__ */
|
|
5181
|
+
const shouldEditFlow = (0, import_variant14.isType)(generateFlow?.value, "DashboardPage") || (0, import_variant14.isType)(generateFlow?.value, "DashboardModal") || (0, import_variant14.isType)(generateFlow?.value, "Api") || (0, import_variant14.isType)(generateFlow?.value, "DashboardSidebarCategory") || (0, import_variant14.isType)(generateFlow?.value, "EmbeddedScript") || (0, import_variant14.isType)(generateFlow?.value, "CustomElement") || (0, import_variant14.isType)(generateFlow?.value, "ServicePlugin") || (0, import_variant14.isType)(generateFlow?.value, "Event");
|
|
5182
|
+
return /* @__PURE__ */ import_react36.default.createElement(Box_default, { flexDirection: "column", paddingTop: 1 }, !shouldEditFlow && /* @__PURE__ */ import_react36.default.createElement(
|
|
5137
5183
|
SelectGroupsInput,
|
|
5138
5184
|
{
|
|
5139
5185
|
value: generateFlow ? InputState.Submitted(generateFlow) : InputState.NotSubmitted(generateFlow),
|
|
5140
5186
|
label: t2("generate_command.flow.choose_flow"),
|
|
5141
5187
|
groups: generateFlows,
|
|
5142
5188
|
onSubmit: selectFlow,
|
|
5143
|
-
maxHeight:
|
|
5189
|
+
maxHeight: 15
|
|
5144
5190
|
}
|
|
5145
|
-
), generateFlow && (0,
|
|
5191
|
+
), generateFlow && (0, import_variant14.match)(
|
|
5146
5192
|
generateFlow.value,
|
|
5147
|
-
(0,
|
|
5148
|
-
DashboardPage: () => /* @__PURE__ */
|
|
5193
|
+
(0, import_variant14.partial)({
|
|
5194
|
+
DashboardPage: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
5149
5195
|
Wizard,
|
|
5150
5196
|
{
|
|
5151
5197
|
name: generateFlow.value.type,
|
|
5152
5198
|
steps: [
|
|
5153
|
-
/* @__PURE__ */
|
|
5199
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
5154
5200
|
FlowSelector,
|
|
5155
5201
|
{
|
|
5156
5202
|
generateFlows,
|
|
@@ -5158,16 +5204,16 @@ var GenerateCommand = () => {
|
|
|
5158
5204
|
onSubmit: setGenerateFlow
|
|
5159
5205
|
}
|
|
5160
5206
|
),
|
|
5161
|
-
...
|
|
5207
|
+
...dashboardPageSteps
|
|
5162
5208
|
]
|
|
5163
5209
|
}
|
|
5164
5210
|
),
|
|
5165
|
-
DashboardModal: () => /* @__PURE__ */
|
|
5211
|
+
DashboardModal: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
5166
5212
|
Wizard,
|
|
5167
5213
|
{
|
|
5168
5214
|
name: generateFlow.value.type,
|
|
5169
5215
|
steps: [
|
|
5170
|
-
/* @__PURE__ */
|
|
5216
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
5171
5217
|
FlowSelector,
|
|
5172
5218
|
{
|
|
5173
5219
|
generateFlows,
|
|
@@ -5179,16 +5225,111 @@ var GenerateCommand = () => {
|
|
|
5179
5225
|
]
|
|
5180
5226
|
}
|
|
5181
5227
|
),
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5228
|
+
Api: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
5229
|
+
Wizard,
|
|
5230
|
+
{
|
|
5231
|
+
name: generateFlow.value.type,
|
|
5232
|
+
steps: [
|
|
5233
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
5234
|
+
FlowSelector,
|
|
5235
|
+
{
|
|
5236
|
+
generateFlows,
|
|
5237
|
+
generateFlow,
|
|
5238
|
+
onSubmit: setGenerateFlow
|
|
5239
|
+
}
|
|
5240
|
+
),
|
|
5241
|
+
...apiSteps
|
|
5242
|
+
]
|
|
5243
|
+
}
|
|
5244
|
+
),
|
|
5245
|
+
DashboardSidebarCategory: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
5246
|
+
Wizard,
|
|
5247
|
+
{
|
|
5248
|
+
name: generateFlow.value.type,
|
|
5249
|
+
steps: [
|
|
5250
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
5251
|
+
FlowSelector,
|
|
5252
|
+
{
|
|
5253
|
+
generateFlows,
|
|
5254
|
+
generateFlow,
|
|
5255
|
+
onSubmit: setGenerateFlow
|
|
5256
|
+
}
|
|
5257
|
+
),
|
|
5258
|
+
...generateSidebarCategorySteps
|
|
5259
|
+
]
|
|
5260
|
+
}
|
|
5261
|
+
),
|
|
5262
|
+
EmbeddedScript: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
5263
|
+
Wizard,
|
|
5264
|
+
{
|
|
5265
|
+
name: generateFlow.value.type,
|
|
5266
|
+
steps: [
|
|
5267
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
5268
|
+
FlowSelector,
|
|
5269
|
+
{
|
|
5270
|
+
generateFlows,
|
|
5271
|
+
generateFlow,
|
|
5272
|
+
onSubmit: setGenerateFlow
|
|
5273
|
+
}
|
|
5274
|
+
),
|
|
5275
|
+
...generateEmbeddedScriptSteps
|
|
5276
|
+
]
|
|
5277
|
+
}
|
|
5278
|
+
),
|
|
5279
|
+
CustomElement: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
5280
|
+
Wizard,
|
|
5281
|
+
{
|
|
5282
|
+
name: generateFlow.value.type,
|
|
5283
|
+
steps: [
|
|
5284
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
5285
|
+
FlowSelector,
|
|
5286
|
+
{
|
|
5287
|
+
generateFlows,
|
|
5288
|
+
generateFlow,
|
|
5289
|
+
onSubmit: setGenerateFlow
|
|
5290
|
+
}
|
|
5291
|
+
),
|
|
5292
|
+
...generateSiteWidgetSteps
|
|
5293
|
+
]
|
|
5294
|
+
}
|
|
5295
|
+
),
|
|
5296
|
+
ServicePlugin: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
5297
|
+
Wizard,
|
|
5298
|
+
{
|
|
5299
|
+
name: generateFlow.value.type,
|
|
5300
|
+
steps: [
|
|
5301
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
5302
|
+
FlowSelector,
|
|
5303
|
+
{
|
|
5304
|
+
generateFlows,
|
|
5305
|
+
generateFlow,
|
|
5306
|
+
onSubmit: setGenerateFlow
|
|
5307
|
+
}
|
|
5308
|
+
),
|
|
5309
|
+
...generateServicePluginSteps
|
|
5310
|
+
]
|
|
5311
|
+
}
|
|
5312
|
+
),
|
|
5313
|
+
Event: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
5314
|
+
Wizard,
|
|
5315
|
+
{
|
|
5316
|
+
name: generateFlow.value.type,
|
|
5317
|
+
steps: [
|
|
5318
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
5319
|
+
FlowSelector,
|
|
5320
|
+
{
|
|
5321
|
+
generateFlows,
|
|
5322
|
+
generateFlow,
|
|
5323
|
+
onSubmit: setGenerateFlow
|
|
5324
|
+
}
|
|
5325
|
+
),
|
|
5326
|
+
...generateEventsSteps
|
|
5327
|
+
]
|
|
5328
|
+
}
|
|
5329
|
+
),
|
|
5330
|
+
SitePlugin: () => /* @__PURE__ */ import_react36.default.createElement(GenerateSitePlugin, null),
|
|
5331
|
+
DashboardPlugin: () => /* @__PURE__ */ import_react36.default.createElement(DashboardPlugin, { flow: generateFlow.value }),
|
|
5332
|
+
DashboardMenuPlugin: () => /* @__PURE__ */ import_react36.default.createElement(DashboardPlugin, { flow: generateFlow.value }),
|
|
5192
5333
|
default: () => null
|
|
5193
5334
|
})
|
|
5194
5335
|
));
|
|
@@ -5196,4 +5337,4 @@ var GenerateCommand = () => {
|
|
|
5196
5337
|
export {
|
|
5197
5338
|
GenerateCommand
|
|
5198
5339
|
};
|
|
5199
|
-
//# sourceMappingURL=GenerateCommand-
|
|
5340
|
+
//# sourceMappingURL=GenerateCommand-IOFKL3RC.js.map
|