@wix/cli 1.1.179 → 1.1.181
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/{ConnectWixVibeCommand-FBY6HXFF.js → ConnectWixVibeCommand-NHQEX6KA.js} +3 -3
- package/build/ConnectWixVibeCommand-NHQEX6KA.js.map +1 -0
- package/build/{DevCommand-YE7ESDNU.js → DevCommand-2YNCASR4.js} +4 -4
- package/build/{EnvPullCommand-3VO35OJL.js → EnvPullCommand-3Y2HT7KM.js} +3 -3
- package/build/{EnvRemoveCommand-ZSMK2BYO.js → EnvRemoveCommand-NPBAIMO2.js} +2 -2
- package/build/{EnvSetCommand-FYHWWXOG.js → EnvSetCommand-WXUUESWT.js} +2 -2
- package/build/{GenerateCommand-QAFIJZ37.js → GenerateCommand-HBDOFKE3.js} +593 -662
- package/build/GenerateCommand-HBDOFKE3.js.map +1 -0
- package/build/{GenerateManifestCommand-GZXHT2NF.js → GenerateManifestCommand-3KYXLCZZ.js} +3 -3
- package/build/{LoginCommand-VAGSZMZX.js → LoginCommand-SANEWDRO.js} +2 -2
- package/build/{PreviewCommand-DUCTAH65.js → PreviewCommand-YOLWH2DS.js} +5 -5
- package/build/{PromoteCommand-W35L42KC.js → PromoteCommand-EHZ7IGKT.js} +5 -5
- package/build/{ReleaseCommand-3MYJDYGJ.js → ReleaseCommand-KO2PKWSG.js} +5 -5
- package/build/{TranslationPullCommand-DD7W3QLG.js → TranslationPullCommand-CYAALEEV.js} +3 -3
- package/build/{TranslationPushCommand-7CRO7EZP.js → TranslationPushCommand-4EUDIOM4.js} +3 -3
- package/build/{chunk-IEZ66U7K.js → chunk-DBU3FYE4.js} +2 -2
- package/build/{chunk-YCVIXPLA.js → chunk-E45X4RFQ.js} +2 -2
- package/build/{chunk-MJZF6YWU.js → chunk-EGTKQWHU.js} +2 -2
- package/build/{chunk-MJZF6YWU.js.map → chunk-EGTKQWHU.js.map} +1 -1
- package/build/{chunk-ZNZQ453D.js → chunk-EKGT7TUO.js} +2 -2
- package/build/{chunk-ZYQ3T54P.js → chunk-JK5XXAQX.js} +4 -4
- package/build/{chunk-4RC6FVRR.js → chunk-JKVSR6GG.js} +2 -2
- package/build/{chunk-JZXCUHHH.js → chunk-JWHJ7OLI.js} +2 -2
- package/build/{chunk-GDPRNEUH.js → chunk-NO7FTQL7.js} +18 -8
- package/build/chunk-NO7FTQL7.js.map +1 -0
- package/build/{chunk-VEC4KARU.js → chunk-QZ7736TO.js} +2 -2
- package/build/{chunk-L5MY6I2S.js → chunk-S526I3JY.js} +21 -10
- package/build/chunk-S526I3JY.js.map +1 -0
- package/build/{chunk-VXDMXASI.js → chunk-X3JDCNCM.js} +2 -2
- package/build/{chunk-ZWHG5WCA.js → chunk-XJE267QM.js} +13 -3
- package/build/chunk-XJE267QM.js.map +1 -0
- package/build/{chunk-MBV3A2NJ.js → chunk-XUXZFTF6.js} +2 -2
- package/build/{env-pull-D6BVONTU.js → env-pull-JUO7U6YO.js} +4 -4
- package/build/index.js +7 -7
- package/build/{preview-WD6OOBHX.js → preview-B66EACAT.js} +6 -6
- package/build/{render-command-MZZJFBCO.js → render-command-S6YTS5JS.js} +3 -3
- package/build/{render-command-YJNOPG4D.js → render-command-ZX7FARMW.js} +3 -3
- package/build/{src-2MD6NZXG.js → src-7WIVSBG4.js} +37 -32
- package/build/src-7WIVSBG4.js.map +1 -0
- package/build/{translation-pull-4SID6NKN.js → translation-pull-MDNH62KX.js} +4 -4
- package/build/{translation-push-2ZNH7E5G.js → translation-push-6DSMU6XP.js} +4 -4
- package/package.json +2 -2
- package/templates/astro/editor-react-component/files/component.tsx.ejs +51 -0
- package/templates/astro/{react-component → editor-react-component}/files/extension.ts.ejs +19 -0
- package/templates/astro/editor-react-component/files/styles.module.css +31 -0
- package/build/ConnectWixVibeCommand-FBY6HXFF.js.map +0 -1
- package/build/GenerateCommand-QAFIJZ37.js.map +0 -1
- package/build/chunk-GDPRNEUH.js.map +0 -1
- package/build/chunk-L5MY6I2S.js.map +0 -1
- package/build/chunk-ZWHG5WCA.js.map +0 -1
- package/build/src-2MD6NZXG.js.map +0 -1
- package/templates/astro/react-component/files/component.tsx.ejs +0 -19
- /package/build/{DevCommand-YE7ESDNU.js.map → DevCommand-2YNCASR4.js.map} +0 -0
- /package/build/{EnvPullCommand-3VO35OJL.js.map → EnvPullCommand-3Y2HT7KM.js.map} +0 -0
- /package/build/{EnvRemoveCommand-ZSMK2BYO.js.map → EnvRemoveCommand-NPBAIMO2.js.map} +0 -0
- /package/build/{EnvSetCommand-FYHWWXOG.js.map → EnvSetCommand-WXUUESWT.js.map} +0 -0
- /package/build/{GenerateManifestCommand-GZXHT2NF.js.map → GenerateManifestCommand-3KYXLCZZ.js.map} +0 -0
- /package/build/{LoginCommand-VAGSZMZX.js.map → LoginCommand-SANEWDRO.js.map} +0 -0
- /package/build/{PreviewCommand-DUCTAH65.js.map → PreviewCommand-YOLWH2DS.js.map} +0 -0
- /package/build/{PromoteCommand-W35L42KC.js.map → PromoteCommand-EHZ7IGKT.js.map} +0 -0
- /package/build/{ReleaseCommand-3MYJDYGJ.js.map → ReleaseCommand-KO2PKWSG.js.map} +0 -0
- /package/build/{TranslationPullCommand-DD7W3QLG.js.map → TranslationPullCommand-CYAALEEV.js.map} +0 -0
- /package/build/{TranslationPushCommand-7CRO7EZP.js.map → TranslationPushCommand-4EUDIOM4.js.map} +0 -0
- /package/build/{chunk-IEZ66U7K.js.map → chunk-DBU3FYE4.js.map} +0 -0
- /package/build/{chunk-YCVIXPLA.js.map → chunk-E45X4RFQ.js.map} +0 -0
- /package/build/{chunk-ZNZQ453D.js.map → chunk-EKGT7TUO.js.map} +0 -0
- /package/build/{chunk-ZYQ3T54P.js.map → chunk-JK5XXAQX.js.map} +0 -0
- /package/build/{chunk-4RC6FVRR.js.map → chunk-JKVSR6GG.js.map} +0 -0
- /package/build/{chunk-JZXCUHHH.js.map → chunk-JWHJ7OLI.js.map} +0 -0
- /package/build/{chunk-VEC4KARU.js.map → chunk-QZ7736TO.js.map} +0 -0
- /package/build/{chunk-VXDMXASI.js.map → chunk-X3JDCNCM.js.map} +0 -0
- /package/build/{chunk-MBV3A2NJ.js.map → chunk-XUXZFTF6.js.map} +0 -0
- /package/build/{env-pull-D6BVONTU.js.map → env-pull-JUO7U6YO.js.map} +0 -0
- /package/build/{preview-WD6OOBHX.js.map → preview-B66EACAT.js.map} +0 -0
- /package/build/{render-command-MZZJFBCO.js.map → render-command-S6YTS5JS.js.map} +0 -0
- /package/build/{render-command-YJNOPG4D.js.map → render-command-ZX7FARMW.js.map} +0 -0
- /package/build/{translation-pull-4SID6NKN.js.map → translation-pull-MDNH62KX.js.map} +0 -0
- /package/build/{translation-push-2ZNH7E5G.js.map → translation-push-6DSMU6XP.js.map} +0 -0
- /package/templates/astro/{react-component → editor-react-component}/dependencies.json +0 -0
|
@@ -3,7 +3,7 @@ const require = _createRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
getGenerateFlowByDocsExtensionType,
|
|
5
5
|
useGenerateFlows
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-S526I3JY.js";
|
|
7
7
|
import {
|
|
8
8
|
require_esprima
|
|
9
9
|
} from "./chunk-SR7TTQEG.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./chunk-H74IDTCR.js";
|
|
16
16
|
import {
|
|
17
17
|
useDevCenterClient
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-NO7FTQL7.js";
|
|
19
19
|
import {
|
|
20
20
|
createPackageManager,
|
|
21
21
|
getRepoType
|
|
@@ -28,8 +28,9 @@ import {
|
|
|
28
28
|
EmbedCategory,
|
|
29
29
|
EmbeddedScriptPlacement,
|
|
30
30
|
getExtensionDir,
|
|
31
|
+
useAppConfig,
|
|
31
32
|
useProjectModel
|
|
32
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-XJE267QM.js";
|
|
33
34
|
import {
|
|
34
35
|
globby
|
|
35
36
|
} from "./chunk-AAUVYJJT.js";
|
|
@@ -407,8 +408,8 @@ function encode_char(c) {
|
|
|
407
408
|
}
|
|
408
409
|
};
|
|
409
410
|
exports.hyphenToCamel = function(str) {
|
|
410
|
-
return str.replace(/-[a-z]/g, function(
|
|
411
|
-
return
|
|
411
|
+
return str.replace(/-[a-z]/g, function(match11) {
|
|
412
|
+
return match11[1].toUpperCase();
|
|
412
413
|
});
|
|
413
414
|
};
|
|
414
415
|
exports.createNullProtoObjWherePossible = function() {
|
|
@@ -546,8 +547,8 @@ var require_ejs = __commonJS({
|
|
|
546
547
|
var includePath;
|
|
547
548
|
var filePath;
|
|
548
549
|
var views = options.views;
|
|
549
|
-
var
|
|
550
|
-
if (
|
|
550
|
+
var match11 = /^[A-Za-z]+:\\|^\//.exec(path15);
|
|
551
|
+
if (match11 && match11.length) {
|
|
551
552
|
path15 = path15.replace(/^\/*/, "");
|
|
552
553
|
if (Array.isArray(options.root)) {
|
|
553
554
|
includePath = resolvePaths(path15, options.root);
|
|
@@ -1745,31 +1746,31 @@ var require_timestamp = __commonJS({
|
|
|
1745
1746
|
return false;
|
|
1746
1747
|
}
|
|
1747
1748
|
function constructYamlTimestamp(data) {
|
|
1748
|
-
var
|
|
1749
|
-
|
|
1750
|
-
if (
|
|
1751
|
-
if (
|
|
1752
|
-
year = +
|
|
1753
|
-
month = +
|
|
1754
|
-
day = +
|
|
1755
|
-
if (!
|
|
1749
|
+
var match11, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
|
|
1750
|
+
match11 = YAML_DATE_REGEXP.exec(data);
|
|
1751
|
+
if (match11 === null) match11 = YAML_TIMESTAMP_REGEXP.exec(data);
|
|
1752
|
+
if (match11 === null) throw new Error("Date resolve error");
|
|
1753
|
+
year = +match11[1];
|
|
1754
|
+
month = +match11[2] - 1;
|
|
1755
|
+
day = +match11[3];
|
|
1756
|
+
if (!match11[4]) {
|
|
1756
1757
|
return new Date(Date.UTC(year, month, day));
|
|
1757
1758
|
}
|
|
1758
|
-
hour = +
|
|
1759
|
-
minute = +
|
|
1760
|
-
second = +
|
|
1761
|
-
if (
|
|
1762
|
-
fraction =
|
|
1759
|
+
hour = +match11[4];
|
|
1760
|
+
minute = +match11[5];
|
|
1761
|
+
second = +match11[6];
|
|
1762
|
+
if (match11[7]) {
|
|
1763
|
+
fraction = match11[7].slice(0, 3);
|
|
1763
1764
|
while (fraction.length < 3) {
|
|
1764
1765
|
fraction += "0";
|
|
1765
1766
|
}
|
|
1766
1767
|
fraction = +fraction;
|
|
1767
1768
|
}
|
|
1768
|
-
if (
|
|
1769
|
-
tz_hour = +
|
|
1770
|
-
tz_minute = +(
|
|
1769
|
+
if (match11[9]) {
|
|
1770
|
+
tz_hour = +match11[10];
|
|
1771
|
+
tz_minute = +(match11[11] || 0);
|
|
1771
1772
|
delta = (tz_hour * 60 + tz_minute) * 6e4;
|
|
1772
|
-
if (
|
|
1773
|
+
if (match11[9] === "-") delta = -delta;
|
|
1773
1774
|
}
|
|
1774
1775
|
date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
|
1775
1776
|
if (delta) date.setTime(date.getTime() - delta);
|
|
@@ -2294,19 +2295,19 @@ var require_loader = __commonJS({
|
|
|
2294
2295
|
}
|
|
2295
2296
|
var directiveHandlers = {
|
|
2296
2297
|
YAML: function handleYamlDirective(state, name, args) {
|
|
2297
|
-
var
|
|
2298
|
+
var match11, major, minor;
|
|
2298
2299
|
if (state.version !== null) {
|
|
2299
2300
|
throwError(state, "duplication of %YAML directive");
|
|
2300
2301
|
}
|
|
2301
2302
|
if (args.length !== 1) {
|
|
2302
2303
|
throwError(state, "YAML directive accepts exactly one argument");
|
|
2303
2304
|
}
|
|
2304
|
-
|
|
2305
|
-
if (
|
|
2305
|
+
match11 = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
|
2306
|
+
if (match11 === null) {
|
|
2306
2307
|
throwError(state, "ill-formed argument of the YAML directive");
|
|
2307
2308
|
}
|
|
2308
|
-
major = parseInt(
|
|
2309
|
-
minor = parseInt(
|
|
2309
|
+
major = parseInt(match11[1], 10);
|
|
2310
|
+
minor = parseInt(match11[2], 10);
|
|
2310
2311
|
if (major !== 1) {
|
|
2311
2312
|
throwError(state, "unacceptable YAML version of the document");
|
|
2312
2313
|
}
|
|
@@ -3553,9 +3554,9 @@ var require_dumper = __commonJS({
|
|
|
3553
3554
|
}();
|
|
3554
3555
|
var prevMoreIndented = string[0] === "\n" || string[0] === " ";
|
|
3555
3556
|
var moreIndented;
|
|
3556
|
-
var
|
|
3557
|
-
while (
|
|
3558
|
-
var prefix =
|
|
3557
|
+
var match11;
|
|
3558
|
+
while (match11 = lineRe.exec(string)) {
|
|
3559
|
+
var prefix = match11[1], line = match11[2];
|
|
3559
3560
|
moreIndented = line[0] === " ";
|
|
3560
3561
|
result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
|
|
3561
3562
|
prevMoreIndented = moreIndented;
|
|
@@ -3565,11 +3566,11 @@ var require_dumper = __commonJS({
|
|
|
3565
3566
|
function foldLine(line, width) {
|
|
3566
3567
|
if (line === "" || line[0] === " ") return line;
|
|
3567
3568
|
var breakRe = / [^ ]/g;
|
|
3568
|
-
var
|
|
3569
|
+
var match11;
|
|
3569
3570
|
var start = 0, end, curr = 0, next = 0;
|
|
3570
3571
|
var result = "";
|
|
3571
|
-
while (
|
|
3572
|
-
next =
|
|
3572
|
+
while (match11 = breakRe.exec(line)) {
|
|
3573
|
+
next = match11.index;
|
|
3573
3574
|
if (next - start > width) {
|
|
3574
3575
|
end = curr > start ? curr : next;
|
|
3575
3576
|
result += "\n" + line.slice(start, end);
|
|
@@ -3906,10 +3907,10 @@ var require_front_matter = __commonJS({
|
|
|
3906
3907
|
};
|
|
3907
3908
|
}
|
|
3908
3909
|
}
|
|
3909
|
-
function computeLocation(
|
|
3910
|
+
function computeLocation(match11, body) {
|
|
3910
3911
|
var line = 1;
|
|
3911
3912
|
var pos = body.indexOf("\n");
|
|
3912
|
-
var offset =
|
|
3913
|
+
var offset = match11.index + match11[0].length;
|
|
3913
3914
|
while (pos !== -1) {
|
|
3914
3915
|
if (pos >= offset) {
|
|
3915
3916
|
return line;
|
|
@@ -3920,8 +3921,8 @@ var require_front_matter = __commonJS({
|
|
|
3920
3921
|
return line;
|
|
3921
3922
|
}
|
|
3922
3923
|
function parse(string, allowUnsafe) {
|
|
3923
|
-
var
|
|
3924
|
-
if (!
|
|
3924
|
+
var match11 = regex.exec(string);
|
|
3925
|
+
if (!match11) {
|
|
3925
3926
|
return {
|
|
3926
3927
|
attributes: {},
|
|
3927
3928
|
body: string,
|
|
@@ -3929,10 +3930,10 @@ var require_front_matter = __commonJS({
|
|
|
3929
3930
|
};
|
|
3930
3931
|
}
|
|
3931
3932
|
var loader = allowUnsafe ? parser.load : parser.safeLoad;
|
|
3932
|
-
var yaml =
|
|
3933
|
+
var yaml = match11[match11.length - 1].replace(/^\s+|\s+$/g, "");
|
|
3933
3934
|
var attributes = loader(yaml) || {};
|
|
3934
|
-
var body = string.replace(
|
|
3935
|
-
var line = computeLocation(
|
|
3935
|
+
var body = string.replace(match11[0], "");
|
|
3936
|
+
var line = computeLocation(match11, string);
|
|
3936
3937
|
return {
|
|
3937
3938
|
attributes,
|
|
3938
3939
|
body,
|
|
@@ -9463,8 +9464,8 @@ var require_lib2 = __commonJS({
|
|
|
9463
9464
|
default:
|
|
9464
9465
|
if (ch >= 48 && ch <= 55) {
|
|
9465
9466
|
const startPos = pos - 1;
|
|
9466
|
-
const
|
|
9467
|
-
let octalStr =
|
|
9467
|
+
const match11 = /^[0-7]+/.exec(input.slice(startPos, pos + 2));
|
|
9468
|
+
let octalStr = match11[0];
|
|
9468
9469
|
let octal = parseInt(octalStr, 8);
|
|
9469
9470
|
if (octal > 255) {
|
|
9470
9471
|
octalStr = octalStr.slice(0, -1);
|
|
@@ -57977,7 +57978,7 @@ var require_core4 = __commonJS({
|
|
|
57977
57978
|
}
|
|
57978
57979
|
return fromAST(recast.parse(source, options));
|
|
57979
57980
|
}
|
|
57980
|
-
function
|
|
57981
|
+
function match11(path14, filter) {
|
|
57981
57982
|
if (!(path14 instanceof NodePath)) {
|
|
57982
57983
|
if (typeof path14.get === "function") {
|
|
57983
57984
|
path14 = path14.get();
|
|
@@ -58013,7 +58014,7 @@ var require_core4 = __commonJS({
|
|
|
58013
58014
|
Object.assign(core2, recast.types.builders);
|
|
58014
58015
|
core2.registerMethods = Collection.registerMethods;
|
|
58015
58016
|
core2.types = recast.types;
|
|
58016
|
-
core2.match =
|
|
58017
|
+
core2.match = match11;
|
|
58017
58018
|
core2.template = template(parser);
|
|
58018
58019
|
core2.filters = {};
|
|
58019
58020
|
core2.mappings = {};
|
|
@@ -59785,8 +59786,8 @@ var require_stringToPath = __commonJS({
|
|
|
59785
59786
|
if (string.charCodeAt(0) === 46) {
|
|
59786
59787
|
result.push("");
|
|
59787
59788
|
}
|
|
59788
|
-
string.replace(rePropName, function(
|
|
59789
|
-
result.push(quote ? subString.replace(reEscapeChar, "$1") : number ||
|
|
59789
|
+
string.replace(rePropName, function(match11, number, quote, subString) {
|
|
59790
|
+
result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match11);
|
|
59790
59791
|
});
|
|
59791
59792
|
return result;
|
|
59792
59793
|
});
|
|
@@ -60228,8 +60229,8 @@ init_esm_shims();
|
|
|
60228
60229
|
|
|
60229
60230
|
// ../cli-astro-commands/src/components/GenerateCommand/GenerateCommand.tsx
|
|
60230
60231
|
init_esm_shims();
|
|
60231
|
-
var
|
|
60232
|
-
var
|
|
60232
|
+
var import_react36 = __toESM(require_react(), 1);
|
|
60233
|
+
var import_variant10 = __toESM(require_lib(), 1);
|
|
60233
60234
|
|
|
60234
60235
|
// ../cli-astro-commands/src/components/GenerateCommand/dashboard-page/DashboardPage.tsx
|
|
60235
60236
|
init_esm_shims();
|
|
@@ -60332,7 +60333,7 @@ function getFiles(cwd) {
|
|
|
60332
60333
|
// ../gena/src/generator.ts
|
|
60333
60334
|
var fm = import_front_matter.default;
|
|
60334
60335
|
function shouldSkipParsing(file) {
|
|
60335
|
-
return [".png", ".jpg", ".gif", ".astro", ".zip"].includes(
|
|
60336
|
+
return [".png", ".jpg", ".gif", ".astro", ".zip", ".css"].includes(
|
|
60336
60337
|
extname(file).toLowerCase()
|
|
60337
60338
|
);
|
|
60338
60339
|
}
|
|
@@ -61800,451 +61801,20 @@ var useGenerateEmbeddedScript = () => {
|
|
|
61800
61801
|
];
|
|
61801
61802
|
};
|
|
61802
61803
|
|
|
61803
|
-
// ../cli-astro-commands/src/components/GenerateCommand/
|
|
61804
|
+
// ../cli-astro-commands/src/components/GenerateCommand/data-collections/DataCollection.tsx
|
|
61804
61805
|
init_esm_shims();
|
|
61805
61806
|
var import_react18 = __toESM(require_react(), 1);
|
|
61806
61807
|
|
|
61807
|
-
// ../cli-astro-commands/src/components/GenerateCommand/
|
|
61808
|
+
// ../cli-astro-commands/src/components/GenerateCommand/data-collections/generate.ts
|
|
61808
61809
|
init_esm_shims();
|
|
61809
|
-
var
|
|
61810
|
+
var import_camelCase6 = __toESM(require_camelCase(), 1);
|
|
61810
61811
|
import path7 from "node:path";
|
|
61811
61812
|
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
61812
|
-
var CUSTOM_ELEMENT_TEMPLATE = path7.resolve(
|
|
61813
|
-
__dirname,
|
|
61814
|
-
"../templates/astro/custom-element"
|
|
61815
|
-
);
|
|
61816
|
-
async function generateCustomElement(projectFolder, route, name, dashboardPageId) {
|
|
61817
|
-
const cwd = getSiteWidgetExtensionPath(projectFolder, route);
|
|
61818
|
-
const {
|
|
61819
|
-
relativePathToCodeFile,
|
|
61820
|
-
relativePathToConfigFile,
|
|
61821
|
-
relativePathToExtensionDir
|
|
61822
|
-
} = getExtensionRelativePaths({
|
|
61823
|
-
cwd,
|
|
61824
|
-
projectFolder,
|
|
61825
|
-
extensionFileName: route,
|
|
61826
|
-
codeFileType: "tsx"
|
|
61827
|
-
});
|
|
61828
|
-
const relativePathToSettingsFile = `./${toPosix(
|
|
61829
|
-
path7.join(relativePathToExtensionDir, `${route}.panel.tsx`)
|
|
61830
|
-
)}`;
|
|
61831
|
-
const config = {
|
|
61832
|
-
id: randomUUID5(),
|
|
61833
|
-
name,
|
|
61834
|
-
dashboardPageId,
|
|
61835
|
-
presetId: randomUUID5(),
|
|
61836
|
-
element: relativePathToCodeFile,
|
|
61837
|
-
settings: relativePathToSettingsFile
|
|
61838
|
-
};
|
|
61839
|
-
await modifyExtensionsEntry(
|
|
61840
|
-
projectFolder,
|
|
61841
|
-
(0, import_camelCase5.default)(route),
|
|
61842
|
-
relativePathToConfigFile
|
|
61843
|
-
);
|
|
61844
|
-
return await componentGenerator({
|
|
61845
|
-
template: CUSTOM_ELEMENT_TEMPLATE,
|
|
61846
|
-
assetsOutputPath: "public",
|
|
61847
|
-
assetsPrefix: route,
|
|
61848
|
-
projectFolder,
|
|
61849
|
-
cwd,
|
|
61850
|
-
data: {
|
|
61851
|
-
route,
|
|
61852
|
-
config
|
|
61853
|
-
}
|
|
61854
|
-
});
|
|
61855
|
-
}
|
|
61856
|
-
|
|
61857
|
-
// ../cli-astro-commands/src/components/GenerateCommand/custom-element/steps.tsx
|
|
61858
|
-
init_esm_shims();
|
|
61859
|
-
var import_react17 = __toESM(require_react(), 1);
|
|
61860
|
-
var import_kebabCase4 = __toESM(require_kebabCase(), 1);
|
|
61861
|
-
var ChooseElementNameStep = ({ onSubmit, elementName }) => {
|
|
61862
|
-
const bi = useWixCliAstroBi();
|
|
61863
|
-
const { isActive, goToNextStep } = useWizardStep();
|
|
61864
|
-
const validateName = useCustomElementNameValidation();
|
|
61865
|
-
return /* @__PURE__ */ import_react17.default.createElement(
|
|
61866
|
-
TextInput,
|
|
61867
|
-
{
|
|
61868
|
-
isActive,
|
|
61869
|
-
label: "Element name:",
|
|
61870
|
-
placeholder: elementName ?? "My Element",
|
|
61871
|
-
onSubmit: (value) => {
|
|
61872
|
-
bi.cliFlowStepAnswered({
|
|
61873
|
-
question: "Element name:",
|
|
61874
|
-
questionKey: "generate_command.custom_element.choose_name",
|
|
61875
|
-
answer: value,
|
|
61876
|
-
additionalInfo: { extensionType: "custom element" }
|
|
61877
|
-
});
|
|
61878
|
-
onSubmit(value);
|
|
61879
|
-
goToNextStep();
|
|
61880
|
-
},
|
|
61881
|
-
validate: validateName
|
|
61882
|
-
}
|
|
61883
|
-
);
|
|
61884
|
-
};
|
|
61885
|
-
var ChooseElementFolderStep = ({ onSubmit, elementFolder, elementName }) => {
|
|
61886
|
-
const { model } = useProjectModel();
|
|
61887
|
-
const bi = useWixCliAstroBi();
|
|
61888
|
-
const { isActive, goToNextStep } = useWizardStep();
|
|
61889
|
-
const defaultElementFolder = (0, import_kebabCase4.default)(elementName);
|
|
61890
|
-
const validateElementFolder = useValidation(
|
|
61891
|
-
createCustomElementFolderValidation(
|
|
61892
|
-
getSiteWidgetExtensionsDir(model.projectFolder)
|
|
61893
|
-
)
|
|
61894
|
-
);
|
|
61895
|
-
return /* @__PURE__ */ import_react17.default.createElement(
|
|
61896
|
-
TextInput,
|
|
61897
|
-
{
|
|
61898
|
-
isActive,
|
|
61899
|
-
label: "Enter the folder for the new element:",
|
|
61900
|
-
placeholder: elementFolder ?? defaultElementFolder,
|
|
61901
|
-
onSubmit: (value) => {
|
|
61902
|
-
bi.cliFlowStepAnswered({
|
|
61903
|
-
question: "Enter the folder for the new element:",
|
|
61904
|
-
questionKey: "generate_command.custom_element.choose_folder",
|
|
61905
|
-
answer: value,
|
|
61906
|
-
additionalInfo: { extensionType: "custom element" }
|
|
61907
|
-
});
|
|
61908
|
-
onSubmit(value);
|
|
61909
|
-
goToNextStep();
|
|
61910
|
-
},
|
|
61911
|
-
validate: validateElementFolder
|
|
61912
|
-
}
|
|
61913
|
-
);
|
|
61914
|
-
};
|
|
61915
|
-
var LinkDashboardPageStep = ({ onSubmit }) => {
|
|
61916
|
-
const bi = useWixCliAstroBi();
|
|
61917
|
-
const { isActive, goToNextStep } = useWizardStep();
|
|
61918
|
-
return /* @__PURE__ */ import_react17.default.createElement(Box_default, { marginBottom: 1 }, /* @__PURE__ */ import_react17.default.createElement(
|
|
61919
|
-
ConfirmInput,
|
|
61920
|
-
{
|
|
61921
|
-
isActive,
|
|
61922
|
-
label: "Link dashboard page to custom element?",
|
|
61923
|
-
onSubmit: (shouldLinkDashboardPage) => {
|
|
61924
|
-
bi.cliFlowStepAnswered({
|
|
61925
|
-
question: "Link dashboard page to custom element?",
|
|
61926
|
-
questionKey: "generate_command.custom_element.link_dashboard_page",
|
|
61927
|
-
answer: String(shouldLinkDashboardPage),
|
|
61928
|
-
additionalInfo: { extensionType: "custom element" }
|
|
61929
|
-
});
|
|
61930
|
-
onSubmit(shouldLinkDashboardPage);
|
|
61931
|
-
goToNextStep();
|
|
61932
|
-
}
|
|
61933
|
-
}
|
|
61934
|
-
));
|
|
61935
|
-
};
|
|
61936
|
-
var ChooseDashboardPageStep = ({ onSubmit }) => {
|
|
61937
|
-
const bi = useWixCliAstroBi();
|
|
61938
|
-
const { isActive, goToNextStep } = useWizardStep();
|
|
61939
|
-
const validatePageId = useValidation(
|
|
61940
|
-
composeValidations([
|
|
61941
|
-
[uuidValidation, "Page id has to be in the format of a uuid"]
|
|
61942
|
-
])
|
|
61943
|
-
);
|
|
61944
|
-
return /* @__PURE__ */ import_react17.default.createElement(
|
|
61945
|
-
TextInput,
|
|
61946
|
-
{
|
|
61947
|
-
isActive,
|
|
61948
|
-
label: "Dashboard page id:",
|
|
61949
|
-
onSubmit: (value) => {
|
|
61950
|
-
bi.cliFlowStepAnswered({
|
|
61951
|
-
question: "Dashboard page id:",
|
|
61952
|
-
questionKey: "generate_command.custom_element.choose_dashboard_page_id",
|
|
61953
|
-
answer: value,
|
|
61954
|
-
additionalInfo: { extensionType: "custom element" }
|
|
61955
|
-
});
|
|
61956
|
-
onSubmit(value);
|
|
61957
|
-
goToNextStep();
|
|
61958
|
-
},
|
|
61959
|
-
validate: validatePageId
|
|
61960
|
-
}
|
|
61961
|
-
);
|
|
61962
|
-
};
|
|
61963
|
-
|
|
61964
|
-
// ../cli-astro-commands/src/components/GenerateCommand/custom-element/CustomElement.tsx
|
|
61965
|
-
var useGenerateCustomElement = () => {
|
|
61966
|
-
const { model } = useProjectModel();
|
|
61967
|
-
const [elementName, setElementName] = (0, import_react18.useState)();
|
|
61968
|
-
const [elementFolder, setElementFolder] = (0, import_react18.useState)();
|
|
61969
|
-
const [linkDashboardPage, setLinkDashboardPage] = (0, import_react18.useState)();
|
|
61970
|
-
const [dashboardPageId, setDashboardPageId] = (0, import_react18.useState)();
|
|
61971
|
-
const shouldGenerate = linkDashboardPage === false ? true : dashboardPageId;
|
|
61972
|
-
const generationTask = useGenerationTask(async () => {
|
|
61973
|
-
if (elementName && elementFolder && shouldGenerate) {
|
|
61974
|
-
return generateCustomElement(
|
|
61975
|
-
model.projectFolder,
|
|
61976
|
-
elementFolder,
|
|
61977
|
-
elementName,
|
|
61978
|
-
dashboardPageId
|
|
61979
|
-
);
|
|
61980
|
-
}
|
|
61981
|
-
}, [elementFolder, elementName, shouldGenerate]);
|
|
61982
|
-
return [
|
|
61983
|
-
/* @__PURE__ */ import_react18.default.createElement(
|
|
61984
|
-
ChooseElementNameStep,
|
|
61985
|
-
{
|
|
61986
|
-
onSubmit: setElementName,
|
|
61987
|
-
elementName
|
|
61988
|
-
}
|
|
61989
|
-
),
|
|
61990
|
-
/* @__PURE__ */ import_react18.default.createElement(
|
|
61991
|
-
ChooseElementFolderStep,
|
|
61992
|
-
{
|
|
61993
|
-
onSubmit: setElementFolder,
|
|
61994
|
-
elementFolder,
|
|
61995
|
-
elementName
|
|
61996
|
-
}
|
|
61997
|
-
),
|
|
61998
|
-
/* @__PURE__ */ import_react18.default.createElement(LinkDashboardPageStep, { onSubmit: setLinkDashboardPage }),
|
|
61999
|
-
...linkDashboardPage ? [/* @__PURE__ */ import_react18.default.createElement(ChooseDashboardPageStep, { onSubmit: setDashboardPageId })] : [],
|
|
62000
|
-
/* @__PURE__ */ import_react18.default.createElement(
|
|
62001
|
-
CompleteGeneration,
|
|
62002
|
-
{
|
|
62003
|
-
generationTask,
|
|
62004
|
-
extensionType: "custom element",
|
|
62005
|
-
successMessage: CompleteGenerationMessage.SuccessMessage({
|
|
62006
|
-
// https://dev.wix.com/docs/wix-cli/guides/extensions/site-extensions/site-widgets/add-a-site-widget-extension
|
|
62007
|
-
learnMoreUrl: "https://wix.to/6aKN8aH"
|
|
62008
|
-
})
|
|
62009
|
-
}
|
|
62010
|
-
)
|
|
62011
|
-
];
|
|
62012
|
-
};
|
|
62013
|
-
|
|
62014
|
-
// ../cli-astro-commands/src/components/GenerateCommand/site-widget/SiteWidget.tsx
|
|
62015
|
-
init_esm_shims();
|
|
62016
|
-
var import_react21 = __toESM(require_react(), 1);
|
|
62017
|
-
var import_variant4 = __toESM(require_lib(), 1);
|
|
62018
|
-
|
|
62019
|
-
// ../cli-astro-commands/src/components/GenerateCommand/react-component/ReactComponent.tsx
|
|
62020
|
-
init_esm_shims();
|
|
62021
|
-
var import_react20 = __toESM(require_react(), 1);
|
|
62022
|
-
|
|
62023
|
-
// ../cli-astro-commands/src/components/GenerateCommand/react-component/generate.ts
|
|
62024
|
-
init_esm_shims();
|
|
62025
|
-
var import_camelCase6 = __toESM(require_camelCase(), 1);
|
|
62026
|
-
var import_capitalize = __toESM(require_capitalize(), 1);
|
|
62027
|
-
import path8 from "node:path";
|
|
62028
|
-
import { randomUUID as randomUUID6 } from "node:crypto";
|
|
62029
|
-
var REACT_COMPONENT_TEMPLATE = path8.resolve(
|
|
62030
|
-
__dirname,
|
|
62031
|
-
"../templates/astro/react-component"
|
|
62032
|
-
);
|
|
62033
|
-
async function generateReactComponent(projectFolder, route, name) {
|
|
62034
|
-
const cwd = getSiteWidgetExtensionPath(projectFolder, route);
|
|
62035
|
-
const { relativePathToCodeFile, relativePathToConfigFile } = getExtensionRelativePaths({
|
|
62036
|
-
cwd,
|
|
62037
|
-
projectFolder,
|
|
62038
|
-
extensionFileName: route,
|
|
62039
|
-
codeFileType: "tsx"
|
|
62040
|
-
});
|
|
62041
|
-
const config = {
|
|
62042
|
-
id: randomUUID6(),
|
|
62043
|
-
name,
|
|
62044
|
-
type: (0, import_capitalize.default)((0, import_camelCase6.default)(route)),
|
|
62045
|
-
selector: `.${route}`,
|
|
62046
|
-
component: relativePathToCodeFile
|
|
62047
|
-
};
|
|
62048
|
-
await modifyExtensionsEntry(
|
|
62049
|
-
projectFolder,
|
|
62050
|
-
(0, import_camelCase6.default)(route),
|
|
62051
|
-
relativePathToConfigFile
|
|
62052
|
-
);
|
|
62053
|
-
return await componentGenerator({
|
|
62054
|
-
template: REACT_COMPONENT_TEMPLATE,
|
|
62055
|
-
projectFolder,
|
|
62056
|
-
cwd,
|
|
62057
|
-
data: {
|
|
62058
|
-
route,
|
|
62059
|
-
config
|
|
62060
|
-
}
|
|
62061
|
-
});
|
|
62062
|
-
}
|
|
62063
|
-
|
|
62064
|
-
// ../cli-astro-commands/src/components/GenerateCommand/react-component/steps.tsx
|
|
62065
|
-
init_esm_shims();
|
|
62066
|
-
var import_react19 = __toESM(require_react(), 1);
|
|
62067
|
-
var import_kebabCase5 = __toESM(require_kebabCase(), 1);
|
|
62068
|
-
var ChooseComponentNameStep = ({ onSubmit, componentName }) => {
|
|
62069
|
-
const bi = useWixCliAstroBi();
|
|
62070
|
-
const { isActive, goToNextStep } = useWizardStep();
|
|
62071
|
-
const validateName = useReactComponentNameValidation();
|
|
62072
|
-
return /* @__PURE__ */ import_react19.default.createElement(
|
|
62073
|
-
TextInput,
|
|
62074
|
-
{
|
|
62075
|
-
isActive,
|
|
62076
|
-
label: "Enter a name for your component:",
|
|
62077
|
-
placeholder: componentName ?? "My Component",
|
|
62078
|
-
onSubmit: (value) => {
|
|
62079
|
-
bi.cliFlowStepAnswered({
|
|
62080
|
-
question: "Enter a name for your component:",
|
|
62081
|
-
questionKey: "generate_command.react_component.choose_name",
|
|
62082
|
-
answer: value,
|
|
62083
|
-
additionalInfo: { extensionType: "editor react component" }
|
|
62084
|
-
});
|
|
62085
|
-
onSubmit(value);
|
|
62086
|
-
goToNextStep();
|
|
62087
|
-
},
|
|
62088
|
-
validate: validateName
|
|
62089
|
-
}
|
|
62090
|
-
);
|
|
62091
|
-
};
|
|
62092
|
-
var ChooseComponentFolderStep = ({ onSubmit, componentFolder, componentName }) => {
|
|
62093
|
-
const { model } = useProjectModel();
|
|
62094
|
-
const bi = useWixCliAstroBi();
|
|
62095
|
-
const { isActive, goToNextStep } = useWizardStep();
|
|
62096
|
-
const defaultComponentFolder = (0, import_kebabCase5.default)(componentName);
|
|
62097
|
-
const validateComponentFolder = useReactComponentFolderValidation(
|
|
62098
|
-
getSiteWidgetExtensionsDir(model.projectFolder)
|
|
62099
|
-
);
|
|
62100
|
-
return /* @__PURE__ */ import_react19.default.createElement(
|
|
62101
|
-
TextInput,
|
|
62102
|
-
{
|
|
62103
|
-
isActive,
|
|
62104
|
-
label: "Enter the folder for the new component:",
|
|
62105
|
-
placeholder: componentFolder ?? defaultComponentFolder,
|
|
62106
|
-
onSubmit: (value) => {
|
|
62107
|
-
bi.cliFlowStepAnswered({
|
|
62108
|
-
question: "Enter the folder for the new component:",
|
|
62109
|
-
questionKey: "generate_command.react_component.choose_folder",
|
|
62110
|
-
answer: value,
|
|
62111
|
-
additionalInfo: { extensionType: "editor react component" }
|
|
62112
|
-
});
|
|
62113
|
-
onSubmit(value);
|
|
62114
|
-
goToNextStep();
|
|
62115
|
-
},
|
|
62116
|
-
validate: validateComponentFolder
|
|
62117
|
-
}
|
|
62118
|
-
);
|
|
62119
|
-
};
|
|
62120
|
-
|
|
62121
|
-
// ../cli-astro-commands/src/components/GenerateCommand/react-component/ReactComponent.tsx
|
|
62122
|
-
var useGenerateReactComponent = () => {
|
|
62123
|
-
const { model } = useProjectModel();
|
|
62124
|
-
const [componentName, setComponentName] = (0, import_react20.useState)();
|
|
62125
|
-
const [componentFolder, setComponentFolder] = (0, import_react20.useState)();
|
|
62126
|
-
const generationTask = useGenerationTask(async () => {
|
|
62127
|
-
if (componentName && componentFolder) {
|
|
62128
|
-
return generateReactComponent(
|
|
62129
|
-
model.projectFolder,
|
|
62130
|
-
componentFolder,
|
|
62131
|
-
componentName
|
|
62132
|
-
);
|
|
62133
|
-
}
|
|
62134
|
-
}, [componentFolder, componentName]);
|
|
62135
|
-
return [
|
|
62136
|
-
/* @__PURE__ */ import_react20.default.createElement(
|
|
62137
|
-
ChooseComponentNameStep,
|
|
62138
|
-
{
|
|
62139
|
-
onSubmit: setComponentName,
|
|
62140
|
-
componentName
|
|
62141
|
-
}
|
|
62142
|
-
),
|
|
62143
|
-
/* @__PURE__ */ import_react20.default.createElement(
|
|
62144
|
-
ChooseComponentFolderStep,
|
|
62145
|
-
{
|
|
62146
|
-
onSubmit: setComponentFolder,
|
|
62147
|
-
componentFolder,
|
|
62148
|
-
componentName
|
|
62149
|
-
}
|
|
62150
|
-
),
|
|
62151
|
-
/* @__PURE__ */ import_react20.default.createElement(
|
|
62152
|
-
CompleteGeneration,
|
|
62153
|
-
{
|
|
62154
|
-
generationTask,
|
|
62155
|
-
extensionType: "editor react component",
|
|
62156
|
-
successMessage: CompleteGenerationMessage.SuccessMessage({
|
|
62157
|
-
// https://dev.wix.com/docs/go-headless
|
|
62158
|
-
learnMoreUrl: "https://dev.wix.com/docs/go-headless"
|
|
62159
|
-
})
|
|
62160
|
-
}
|
|
62161
|
-
)
|
|
62162
|
-
];
|
|
62163
|
-
};
|
|
62164
|
-
|
|
62165
|
-
// ../cli-astro-commands/src/components/GenerateCommand/site-widget/SiteWidget.tsx
|
|
62166
|
-
var SiteWidgetFrameworks = (0, import_variant4.variant)({
|
|
62167
|
-
CustomElement: {},
|
|
62168
|
-
ReactComponent: {}
|
|
62169
|
-
});
|
|
62170
|
-
var FrameworkSelector = ({ onSubmit, framework, frameworks }) => {
|
|
62171
|
-
const bi = useWixCliAstroBi();
|
|
62172
|
-
const { goToNextStep, isActive } = useWizardStep();
|
|
62173
|
-
const selectFramework = (0, import_react21.useCallback)(
|
|
62174
|
-
(selectedFramework) => {
|
|
62175
|
-
bi.cliFlowStepAnswered({
|
|
62176
|
-
question: "Which framework do you want to use?",
|
|
62177
|
-
questionKey: "generate_command.site_widget.choose_framework",
|
|
62178
|
-
answer: selectedFramework.title
|
|
62179
|
-
});
|
|
62180
|
-
onSubmit(selectedFramework);
|
|
62181
|
-
goToNextStep();
|
|
62182
|
-
},
|
|
62183
|
-
[bi, onSubmit, goToNextStep]
|
|
62184
|
-
);
|
|
62185
|
-
return /* @__PURE__ */ import_react21.default.createElement(
|
|
62186
|
-
SelectInput,
|
|
62187
|
-
{
|
|
62188
|
-
value: !isActive ? InputState.Submitted(framework) : InputState.NotSubmitted(framework),
|
|
62189
|
-
label: "Which framework do you want to use?",
|
|
62190
|
-
options: frameworks,
|
|
62191
|
-
onSubmit: selectFramework
|
|
62192
|
-
}
|
|
62193
|
-
);
|
|
62194
|
-
};
|
|
62195
|
-
var useGenerateSiteWidget = () => {
|
|
62196
|
-
const generateCustomElementSteps = useGenerateCustomElement();
|
|
62197
|
-
const generateReactComponentSteps = useGenerateReactComponent();
|
|
62198
|
-
const frameworks = (0, import_react21.useMemo)(
|
|
62199
|
-
() => [
|
|
62200
|
-
{
|
|
62201
|
-
title: "Editor React Component",
|
|
62202
|
-
key: "react-component",
|
|
62203
|
-
value: SiteWidgetFrameworks.ReactComponent(),
|
|
62204
|
-
description: "a new way to add React components to the Wix editors and site (read more)"
|
|
62205
|
-
},
|
|
62206
|
-
{
|
|
62207
|
-
title: "Custom Element",
|
|
62208
|
-
key: "custom-element",
|
|
62209
|
-
value: SiteWidgetFrameworks.CustomElement()
|
|
62210
|
-
}
|
|
62211
|
-
],
|
|
62212
|
-
[]
|
|
62213
|
-
);
|
|
62214
|
-
const [framework, setFramework] = (0, import_react21.useState)(
|
|
62215
|
-
frameworks[0]
|
|
62216
|
-
);
|
|
62217
|
-
return [
|
|
62218
|
-
/* @__PURE__ */ import_react21.default.createElement(
|
|
62219
|
-
FrameworkSelector,
|
|
62220
|
-
{
|
|
62221
|
-
frameworks,
|
|
62222
|
-
framework,
|
|
62223
|
-
onSubmit: setFramework
|
|
62224
|
-
}
|
|
62225
|
-
),
|
|
62226
|
-
...(0, import_variant4.match)(framework.value, {
|
|
62227
|
-
ReactComponent: () => generateReactComponentSteps,
|
|
62228
|
-
CustomElement: () => generateCustomElementSteps,
|
|
62229
|
-
default: () => []
|
|
62230
|
-
})
|
|
62231
|
-
];
|
|
62232
|
-
};
|
|
62233
|
-
|
|
62234
|
-
// ../cli-astro-commands/src/components/GenerateCommand/data-collections/DataCollection.tsx
|
|
62235
|
-
init_esm_shims();
|
|
62236
|
-
var import_react23 = __toESM(require_react(), 1);
|
|
62237
|
-
|
|
62238
|
-
// ../cli-astro-commands/src/components/GenerateCommand/data-collections/generate.ts
|
|
62239
|
-
init_esm_shims();
|
|
62240
|
-
var import_camelCase8 = __toESM(require_camelCase(), 1);
|
|
62241
|
-
import path9 from "node:path";
|
|
62242
|
-
import { randomUUID as randomUUID7 } from "node:crypto";
|
|
62243
61813
|
|
|
62244
61814
|
// ../cli-astro-commands/src/components/GenerateCommand/data-collections/modify-data-collections-extension.ts
|
|
62245
61815
|
init_esm_shims();
|
|
62246
61816
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
62247
|
-
var
|
|
61817
|
+
var import_camelCase5 = __toESM(require_camelCase(), 1);
|
|
62248
61818
|
var import_jscodeshift2 = __toESM(require_jscodeshift(), 1);
|
|
62249
61819
|
async function modifyDataCollectionsExtension(filePath, collectionName) {
|
|
62250
61820
|
if (!await pathExists(filePath)) {
|
|
@@ -62330,7 +61900,7 @@ function ensureCollectionReference(root, j, collectionImportName) {
|
|
|
62330
61900
|
);
|
|
62331
61901
|
}
|
|
62332
61902
|
function getCollectionImportName(collectionName) {
|
|
62333
|
-
const importName = (0,
|
|
61903
|
+
const importName = (0, import_camelCase5.default)(`${collectionName}-collection`);
|
|
62334
61904
|
return /^[A-Za-z_$]/.test(importName) ? importName : `collection${importName[0]?.toUpperCase() ?? ""}${importName.slice(1)}`;
|
|
62335
61905
|
}
|
|
62336
61906
|
function getUniqueLocalName(root, j, localName) {
|
|
@@ -62347,7 +61917,7 @@ function getUniqueLocalName(root, j, localName) {
|
|
|
62347
61917
|
|
|
62348
61918
|
// ../cli-astro-commands/src/components/GenerateCommand/data-collections/generate.ts
|
|
62349
61919
|
var EXTENSION_NAME = "data-collections";
|
|
62350
|
-
var COLLECTION_TEMPLATE =
|
|
61920
|
+
var COLLECTION_TEMPLATE = path7.resolve(
|
|
62351
61921
|
__dirname,
|
|
62352
61922
|
"../templates/astro/data-collections"
|
|
62353
61923
|
);
|
|
@@ -62359,10 +61929,10 @@ async function generateDataCollection(projectFolder, collectionName) {
|
|
|
62359
61929
|
extensionFileName: EXTENSION_NAME,
|
|
62360
61930
|
codeFileType: "ts"
|
|
62361
61931
|
});
|
|
62362
|
-
const extensionFilePath =
|
|
61932
|
+
const extensionFilePath = path7.join(cwd, `${EXTENSION_NAME}.extension.ts`);
|
|
62363
61933
|
await modifyExtensionsEntry(
|
|
62364
61934
|
projectFolder,
|
|
62365
|
-
(0,
|
|
61935
|
+
(0, import_camelCase6.default)(EXTENSION_NAME),
|
|
62366
61936
|
relativePathToConfigFile
|
|
62367
61937
|
);
|
|
62368
61938
|
const extensionExists = await pathExists(extensionFilePath);
|
|
@@ -62374,7 +61944,7 @@ async function generateDataCollection(projectFolder, collectionName) {
|
|
|
62374
61944
|
extensionFileExists: extensionExists,
|
|
62375
61945
|
collectionName,
|
|
62376
61946
|
config: {
|
|
62377
|
-
id:
|
|
61947
|
+
id: randomUUID5()
|
|
62378
61948
|
}
|
|
62379
61949
|
}
|
|
62380
61950
|
});
|
|
@@ -62384,7 +61954,7 @@ async function generateDataCollection(projectFolder, collectionName) {
|
|
|
62384
61954
|
|
|
62385
61955
|
// ../cli-astro-commands/src/components/GenerateCommand/data-collections/steps.tsx
|
|
62386
61956
|
init_esm_shims();
|
|
62387
|
-
var
|
|
61957
|
+
var import_react17 = __toESM(require_react(), 1);
|
|
62388
61958
|
var ChooseCollectionStep = ({ onSubmit, collectionName }) => {
|
|
62389
61959
|
const { model } = useProjectModel();
|
|
62390
61960
|
const bi = useWixCliAstroBi();
|
|
@@ -62393,7 +61963,7 @@ var ChooseCollectionStep = ({ onSubmit, collectionName }) => {
|
|
|
62393
61963
|
model.projectFolder
|
|
62394
61964
|
);
|
|
62395
61965
|
const validateCollectionName = useDataCollectionNameValidation(collectionsDir);
|
|
62396
|
-
return /* @__PURE__ */
|
|
61966
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
62397
61967
|
TextInput,
|
|
62398
61968
|
{
|
|
62399
61969
|
isActive,
|
|
@@ -62416,21 +61986,21 @@ var ChooseCollectionStep = ({ onSubmit, collectionName }) => {
|
|
|
62416
61986
|
// ../cli-astro-commands/src/components/GenerateCommand/data-collections/DataCollection.tsx
|
|
62417
61987
|
var useGenerateDataCollection = () => {
|
|
62418
61988
|
const { model } = useProjectModel();
|
|
62419
|
-
const [collectionName, setCollectionName] = (0,
|
|
61989
|
+
const [collectionName, setCollectionName] = (0, import_react18.useState)();
|
|
62420
61990
|
const generationTask = useGenerationTask(async () => {
|
|
62421
61991
|
if (collectionName) {
|
|
62422
61992
|
return generateDataCollection(model.projectFolder, collectionName);
|
|
62423
61993
|
}
|
|
62424
61994
|
}, [model.projectFolder, collectionName]);
|
|
62425
61995
|
return [
|
|
62426
|
-
/* @__PURE__ */
|
|
61996
|
+
/* @__PURE__ */ import_react18.default.createElement(
|
|
62427
61997
|
ChooseCollectionStep,
|
|
62428
61998
|
{
|
|
62429
61999
|
onSubmit: setCollectionName,
|
|
62430
62000
|
collectionName
|
|
62431
62001
|
}
|
|
62432
62002
|
),
|
|
62433
|
-
/* @__PURE__ */
|
|
62003
|
+
/* @__PURE__ */ import_react18.default.createElement(
|
|
62434
62004
|
CompleteGeneration,
|
|
62435
62005
|
{
|
|
62436
62006
|
generationTask,
|
|
@@ -62446,8 +62016,8 @@ var useGenerateDataCollection = () => {
|
|
|
62446
62016
|
|
|
62447
62017
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/DashboardPlugin.tsx
|
|
62448
62018
|
init_esm_shims();
|
|
62449
|
-
var
|
|
62450
|
-
var
|
|
62019
|
+
var import_react27 = __toESM(require_react(), 1);
|
|
62020
|
+
var import_variant7 = __toESM(require_lib(), 1);
|
|
62451
62021
|
|
|
62452
62022
|
// ../extensions-data-client/src/index.ts
|
|
62453
62023
|
init_esm_shims();
|
|
@@ -62486,7 +62056,7 @@ var getEcomRequiredApps = async () => {
|
|
|
62486
62056
|
|
|
62487
62057
|
// ../extensions-data-client/src/useExtensionDataClient.tsx
|
|
62488
62058
|
init_esm_shims();
|
|
62489
|
-
var
|
|
62059
|
+
var import_react19 = __toESM(require_react(), 1);
|
|
62490
62060
|
|
|
62491
62061
|
// ../extensions-data-client/src/extension-data-client.ts
|
|
62492
62062
|
init_esm_shims();
|
|
@@ -66332,7 +65902,7 @@ var ExtensionDataClient = class {
|
|
|
66332
65902
|
// ../extensions-data-client/src/useExtensionDataClient.tsx
|
|
66333
65903
|
function useExtensionDataClient() {
|
|
66334
65904
|
const httpClient = useHttpClient({ type: "backoffice" });
|
|
66335
|
-
const client = (0,
|
|
65905
|
+
const client = (0, import_react19.useMemo)(
|
|
66336
65906
|
() => new ExtensionDataClient(httpClient),
|
|
66337
65907
|
[httpClient]
|
|
66338
65908
|
);
|
|
@@ -66341,16 +65911,16 @@ function useExtensionDataClient() {
|
|
|
66341
65911
|
|
|
66342
65912
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboard-plugin/DashboardPluginWizard.tsx
|
|
66343
65913
|
init_esm_shims();
|
|
66344
|
-
var
|
|
66345
|
-
var
|
|
66346
|
-
var
|
|
65914
|
+
var import_react22 = __toESM(require_react(), 1);
|
|
65915
|
+
var import_variant5 = __toESM(require_lib(), 1);
|
|
65916
|
+
var import_kebabCase4 = __toESM(require_kebabCase(), 1);
|
|
66347
65917
|
|
|
66348
65918
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboard-plugin/generate.ts
|
|
66349
65919
|
init_esm_shims();
|
|
66350
|
-
var
|
|
66351
|
-
import
|
|
66352
|
-
import { randomUUID as
|
|
66353
|
-
var DASHBOARD_PLUGIN_TEMPLATE =
|
|
65920
|
+
var import_camelCase7 = __toESM(require_camelCase(), 1);
|
|
65921
|
+
import path8 from "node:path";
|
|
65922
|
+
import { randomUUID as randomUUID6 } from "node:crypto";
|
|
65923
|
+
var DASHBOARD_PLUGIN_TEMPLATE = path8.resolve(
|
|
66354
65924
|
__dirname,
|
|
66355
65925
|
"../templates/astro/dashboard-plugin"
|
|
66356
65926
|
);
|
|
@@ -66363,14 +65933,14 @@ async function generateDashboardPlugin(projectFolder, extended, route, title, im
|
|
|
66363
65933
|
codeFileType: "tsx"
|
|
66364
65934
|
});
|
|
66365
65935
|
const config = {
|
|
66366
|
-
id:
|
|
65936
|
+
id: randomUUID6(),
|
|
66367
65937
|
title,
|
|
66368
65938
|
extends: extended,
|
|
66369
65939
|
component: relativePathToCodeFile
|
|
66370
65940
|
};
|
|
66371
65941
|
await modifyExtensionsEntry(
|
|
66372
65942
|
projectFolder,
|
|
66373
|
-
(0,
|
|
65943
|
+
(0, import_camelCase7.default)(route),
|
|
66374
65944
|
relativePathToConfigFile
|
|
66375
65945
|
);
|
|
66376
65946
|
return await componentGenerator({
|
|
@@ -66388,8 +65958,8 @@ async function generateDashboardPlugin(projectFolder, extended, route, title, im
|
|
|
66388
65958
|
|
|
66389
65959
|
// ../cli-astro-commands/src/components/GenerateCommand/MultipleAppRequirement.tsx
|
|
66390
65960
|
init_esm_shims();
|
|
66391
|
-
var
|
|
66392
|
-
var
|
|
65961
|
+
var import_react20 = __toESM(require_react(), 1);
|
|
65962
|
+
var import_variant4 = __toESM(require_lib(), 1);
|
|
66393
65963
|
var MultipleAppRequirement = ({
|
|
66394
65964
|
requiredApps,
|
|
66395
65965
|
onSubmit
|
|
@@ -66397,23 +65967,23 @@ var MultipleAppRequirement = ({
|
|
|
66397
65967
|
const { status } = useAsync(async () => {
|
|
66398
65968
|
onSubmit([]);
|
|
66399
65969
|
}, []);
|
|
66400
|
-
return /* @__PURE__ */
|
|
65970
|
+
return /* @__PURE__ */ import_react20.default.createElement(import_react20.default.Fragment, null, (0, import_variant4.match)(status, {
|
|
66401
65971
|
Loading: () => null,
|
|
66402
65972
|
Error: () => null,
|
|
66403
65973
|
Success: () => {
|
|
66404
65974
|
if (requiredApps.length === 0) {
|
|
66405
65975
|
return null;
|
|
66406
65976
|
}
|
|
66407
|
-
return /* @__PURE__ */
|
|
65977
|
+
return /* @__PURE__ */ import_react20.default.createElement(Box_default, { marginBottom: 1 }, /* @__PURE__ */ import_react20.default.createElement(Notification, null, /* @__PURE__ */ import_react20.default.createElement(Box_default, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ import_react20.default.createElement(Text, null, "Please verify that the following application is installed to enable use of the selected extension/plugin."), /* @__PURE__ */ import_react20.default.createElement(UnorderedList, { paddingLeft: 2 }, requiredApps.map((app) => /* @__PURE__ */ import_react20.default.createElement(UnorderedList.Item, { key: app.id }, /* @__PURE__ */ import_react20.default.createElement(Text, null, app.name)))))));
|
|
66408
65978
|
}
|
|
66409
65979
|
}));
|
|
66410
65980
|
};
|
|
66411
65981
|
|
|
66412
65982
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboard-plugin/DashboardPluginGeneratedNote.tsx
|
|
66413
65983
|
init_esm_shims();
|
|
66414
|
-
var
|
|
65984
|
+
var import_react21 = __toESM(require_react(), 1);
|
|
66415
65985
|
var DashboardPluginGeneratedNote = ({ generatedFiles }) => {
|
|
66416
|
-
return /* @__PURE__ */
|
|
65986
|
+
return /* @__PURE__ */ import_react21.default.createElement(
|
|
66417
65987
|
GenerationSuccessMessage,
|
|
66418
65988
|
{
|
|
66419
65989
|
extensionType: "dashboard plugin",
|
|
@@ -66434,12 +66004,12 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66434
66004
|
const { addRequiredApp } = useDevCenterClient();
|
|
66435
66005
|
const { reportError } = useErrorReporter();
|
|
66436
66006
|
const { getSdkSlotData: getSdkSlotData2 } = useExtensionDataClient();
|
|
66437
|
-
const [backofficeExtensionWidget, setBackofficeExtensionWidget] = (0,
|
|
66438
|
-
const [folder, setFolder] = (0,
|
|
66439
|
-
const [title, setTitle] = (0,
|
|
66440
|
-
const [requireAppsIds, setRequireAppsIds] = (0,
|
|
66441
|
-
const [finishedInstallation, setFinishedInstallation] = (0,
|
|
66442
|
-
const defaultFolderName = (0,
|
|
66007
|
+
const [backofficeExtensionWidget, setBackofficeExtensionWidget] = (0, import_react22.useState)();
|
|
66008
|
+
const [folder, setFolder] = (0, import_react22.useState)();
|
|
66009
|
+
const [title, setTitle] = (0, import_react22.useState)();
|
|
66010
|
+
const [requireAppsIds, setRequireAppsIds] = (0, import_react22.useState)();
|
|
66011
|
+
const [finishedInstallation, setFinishedInstallation] = (0, import_react22.useState)(false);
|
|
66012
|
+
const defaultFolderName = (0, import_kebabCase4.default)(title);
|
|
66443
66013
|
const validatePluginFolder = useValidation(
|
|
66444
66014
|
createDashboardPluginValidation(
|
|
66445
66015
|
getDashboardPluginExtensionsDir(model.projectFolder)
|
|
@@ -66486,7 +66056,7 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66486
66056
|
if (backofficeExtensionWidget2) {
|
|
66487
66057
|
extensionsByApps[backofficePage.component.componentId]?.items.push({
|
|
66488
66058
|
title: backofficeExtensionWidget2.component.data.backOfficeExtensionContainer.slotData?.displayName ?? backofficeExtensionWidget2.component.name,
|
|
66489
|
-
description: backofficeExtensionWidget2.component.externalId ? /* @__PURE__ */
|
|
66059
|
+
description: backofficeExtensionWidget2.component.externalId ? /* @__PURE__ */ import_react22.default.createElement(Text, null, /* @__PURE__ */ import_react22.default.createElement(
|
|
66490
66060
|
Link,
|
|
66491
66061
|
{
|
|
66492
66062
|
url: docsLink(
|
|
@@ -66511,18 +66081,18 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66511
66081
|
backofficeExtensionWidgets.sort((a, b) => a.title.localeCompare(b.title));
|
|
66512
66082
|
return backofficeExtensionWidgets;
|
|
66513
66083
|
}, []);
|
|
66514
|
-
const task = (0,
|
|
66515
|
-
() => (0,
|
|
66084
|
+
const task = (0, import_react22.useMemo)(
|
|
66085
|
+
() => (0, import_variant5.match)(generationTask, {
|
|
66516
66086
|
Success: ({ hasUpdatedDependencies, newFiles }) => {
|
|
66517
66087
|
if (!hasUpdatedDependencies) {
|
|
66518
66088
|
setFinishedInstallation(true);
|
|
66519
66089
|
}
|
|
66520
|
-
return /* @__PURE__ */
|
|
66090
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, hasUpdatedDependencies && /* @__PURE__ */ import_react22.default.createElement(
|
|
66521
66091
|
InstallDependencies,
|
|
66522
66092
|
{
|
|
66523
66093
|
onFinish: () => setFinishedInstallation(true)
|
|
66524
66094
|
}
|
|
66525
|
-
), finishedInstallation && backofficeExtensionWidget && /* @__PURE__ */
|
|
66095
|
+
), finishedInstallation && backofficeExtensionWidget && /* @__PURE__ */ import_react22.default.createElement(
|
|
66526
66096
|
DashboardPluginGeneratedNote,
|
|
66527
66097
|
{
|
|
66528
66098
|
backofficeExtensionWidget,
|
|
@@ -66530,20 +66100,20 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66530
66100
|
}
|
|
66531
66101
|
));
|
|
66532
66102
|
},
|
|
66533
|
-
Loading: () => /* @__PURE__ */
|
|
66103
|
+
Loading: () => /* @__PURE__ */ import_react22.default.createElement(Spinner, { text: `Generating dashboard plugin...` }),
|
|
66534
66104
|
Error: () => null,
|
|
66535
66105
|
NotRequested: () => null
|
|
66536
66106
|
}),
|
|
66537
66107
|
[generationTask, finishedInstallation, backofficeExtensionWidget]
|
|
66538
66108
|
);
|
|
66539
|
-
return (0,
|
|
66109
|
+
return (0, import_variant5.match)(status, {
|
|
66540
66110
|
Error: () => null,
|
|
66541
|
-
Loading: () => /* @__PURE__ */
|
|
66542
|
-
Success: ({ result: backofficeExtensionWidgets }) => /* @__PURE__ */
|
|
66111
|
+
Loading: () => /* @__PURE__ */ import_react22.default.createElement(Spinner, { text: "Loading..." }),
|
|
66112
|
+
Success: ({ result: backofficeExtensionWidgets }) => /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, /* @__PURE__ */ import_react22.default.createElement(
|
|
66543
66113
|
SelectGroupsInput,
|
|
66544
66114
|
{
|
|
66545
66115
|
label: "What would you like to extend?",
|
|
66546
|
-
info: /* @__PURE__ */
|
|
66116
|
+
info: /* @__PURE__ */ import_react22.default.createElement(Text, null, "Plugins let you extend Wix apps by embedding your UI inside dedicated slots within a dashboard page (", /* @__PURE__ */ import_react22.default.createElement(Link, { url: "https://wix.to/T9OFciS" }, "read more"), ")"),
|
|
66547
66117
|
hideScroll: true,
|
|
66548
66118
|
groups: backofficeExtensionWidgets,
|
|
66549
66119
|
onSubmit: (option) => {
|
|
@@ -66556,7 +66126,7 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66556
66126
|
setBackofficeExtensionWidget(option.value);
|
|
66557
66127
|
}
|
|
66558
66128
|
}
|
|
66559
|
-
), backofficeExtensionWidget && /* @__PURE__ */
|
|
66129
|
+
), backofficeExtensionWidget && /* @__PURE__ */ import_react22.default.createElement(
|
|
66560
66130
|
MultipleAppRequirement,
|
|
66561
66131
|
{
|
|
66562
66132
|
appId: model.config.appId,
|
|
@@ -66566,7 +66136,7 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66566
66136
|
})),
|
|
66567
66137
|
onSubmit: setRequireAppsIds
|
|
66568
66138
|
}
|
|
66569
|
-
), requireAppsIds && /* @__PURE__ */
|
|
66139
|
+
), requireAppsIds && /* @__PURE__ */ import_react22.default.createElement(
|
|
66570
66140
|
TextInput,
|
|
66571
66141
|
{
|
|
66572
66142
|
label: "Plugin title",
|
|
@@ -66581,7 +66151,7 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66581
66151
|
setTitle(value);
|
|
66582
66152
|
}
|
|
66583
66153
|
}
|
|
66584
|
-
), title && /* @__PURE__ */
|
|
66154
|
+
), title && /* @__PURE__ */ import_react22.default.createElement(
|
|
66585
66155
|
TextInput,
|
|
66586
66156
|
{
|
|
66587
66157
|
label: "Plugin folder",
|
|
@@ -66603,16 +66173,16 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66603
66173
|
|
|
66604
66174
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboad-menu-plugin/DashboardMenuPluginWizard.tsx
|
|
66605
66175
|
init_esm_shims();
|
|
66606
|
-
var
|
|
66607
|
-
var
|
|
66608
|
-
var
|
|
66176
|
+
var import_react26 = __toESM(require_react(), 1);
|
|
66177
|
+
var import_variant6 = __toESM(require_lib(), 1);
|
|
66178
|
+
var import_kebabCase5 = __toESM(require_kebabCase(), 1);
|
|
66609
66179
|
|
|
66610
66180
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboad-menu-plugin/generate.ts
|
|
66611
66181
|
init_esm_shims();
|
|
66612
|
-
var
|
|
66613
|
-
import
|
|
66614
|
-
import { randomUUID as
|
|
66615
|
-
var DASHBOARD_MENU_PLUGIN_TEMPLATE =
|
|
66182
|
+
var import_camelCase8 = __toESM(require_camelCase(), 1);
|
|
66183
|
+
import path9 from "node:path";
|
|
66184
|
+
import { randomUUID as randomUUID7 } from "node:crypto";
|
|
66185
|
+
var DASHBOARD_MENU_PLUGIN_TEMPLATE = path9.resolve(
|
|
66616
66186
|
__dirname,
|
|
66617
66187
|
"../templates/astro/dashboard-menu-plugin"
|
|
66618
66188
|
);
|
|
@@ -66626,7 +66196,7 @@ async function generateDashboardMenuPlugin(projectFolder, extended, actionType,
|
|
|
66626
66196
|
// TODO: no code file for menu plugin
|
|
66627
66197
|
});
|
|
66628
66198
|
const config = {
|
|
66629
|
-
id:
|
|
66199
|
+
id: randomUUID7(),
|
|
66630
66200
|
title,
|
|
66631
66201
|
iconKey: "Sparkles",
|
|
66632
66202
|
extends: extended,
|
|
@@ -66634,7 +66204,7 @@ async function generateDashboardMenuPlugin(projectFolder, extended, actionType,
|
|
|
66634
66204
|
};
|
|
66635
66205
|
await modifyExtensionsEntry(
|
|
66636
66206
|
projectFolder,
|
|
66637
|
-
(0,
|
|
66207
|
+
(0, import_camelCase8.default)(route),
|
|
66638
66208
|
relativePathToConfigFile
|
|
66639
66209
|
);
|
|
66640
66210
|
return await componentGenerator({
|
|
@@ -66651,16 +66221,16 @@ async function generateDashboardMenuPlugin(projectFolder, extended, actionType,
|
|
|
66651
66221
|
|
|
66652
66222
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboad-menu-plugin/NavigateToPage.tsx
|
|
66653
66223
|
init_esm_shims();
|
|
66654
|
-
var
|
|
66224
|
+
var import_react23 = __toESM(require_react(), 1);
|
|
66655
66225
|
var NavigateToPage = ({ onActionSelected }) => {
|
|
66656
66226
|
const bi = useWixCliAstroBi();
|
|
66657
|
-
const [pageId, setPageId] = (0,
|
|
66227
|
+
const [pageId, setPageId] = (0, import_react23.useState)();
|
|
66658
66228
|
const validatePageId = useValidation(
|
|
66659
66229
|
composeValidations([
|
|
66660
66230
|
[uuidValidation, "Page id has to be in the format of a uuid"]
|
|
66661
66231
|
])
|
|
66662
66232
|
);
|
|
66663
|
-
(0,
|
|
66233
|
+
(0, import_react23.useEffect)(() => {
|
|
66664
66234
|
if (pageId) {
|
|
66665
66235
|
onActionSelected({
|
|
66666
66236
|
navigateToPage: {
|
|
@@ -66669,7 +66239,7 @@ var NavigateToPage = ({ onActionSelected }) => {
|
|
|
66669
66239
|
});
|
|
66670
66240
|
}
|
|
66671
66241
|
}, [pageId, onActionSelected]);
|
|
66672
|
-
return /* @__PURE__ */
|
|
66242
|
+
return /* @__PURE__ */ import_react23.default.createElement(
|
|
66673
66243
|
TextInput,
|
|
66674
66244
|
{
|
|
66675
66245
|
label: "What is the unique id of the page?",
|
|
@@ -66688,16 +66258,16 @@ var NavigateToPage = ({ onActionSelected }) => {
|
|
|
66688
66258
|
|
|
66689
66259
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboad-menu-plugin/OpenModal.tsx
|
|
66690
66260
|
init_esm_shims();
|
|
66691
|
-
var
|
|
66261
|
+
var import_react24 = __toESM(require_react(), 1);
|
|
66692
66262
|
var OpenModal = ({ onActionSelected }) => {
|
|
66693
66263
|
const bi = useWixCliAstroBi();
|
|
66694
|
-
const [componentId, setComponentId] = (0,
|
|
66264
|
+
const [componentId, setComponentId] = (0, import_react24.useState)();
|
|
66695
66265
|
const validateComponentId = useValidation(
|
|
66696
66266
|
composeValidations([
|
|
66697
66267
|
[uuidValidation, "Modal id has to be in the format of a uuid"]
|
|
66698
66268
|
])
|
|
66699
66269
|
);
|
|
66700
|
-
(0,
|
|
66270
|
+
(0, import_react24.useEffect)(() => {
|
|
66701
66271
|
if (componentId) {
|
|
66702
66272
|
onActionSelected({
|
|
66703
66273
|
openModal: {
|
|
@@ -66706,7 +66276,7 @@ var OpenModal = ({ onActionSelected }) => {
|
|
|
66706
66276
|
});
|
|
66707
66277
|
}
|
|
66708
66278
|
}, [componentId, onActionSelected]);
|
|
66709
|
-
return /* @__PURE__ */
|
|
66279
|
+
return /* @__PURE__ */ import_react24.default.createElement(
|
|
66710
66280
|
TextInput,
|
|
66711
66281
|
{
|
|
66712
66282
|
label: "What is the unique id of the modal?",
|
|
@@ -66725,9 +66295,9 @@ var OpenModal = ({ onActionSelected }) => {
|
|
|
66725
66295
|
|
|
66726
66296
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboad-menu-plugin/DashboardMenuPluginGeneratedNote.tsx
|
|
66727
66297
|
init_esm_shims();
|
|
66728
|
-
var
|
|
66298
|
+
var import_react25 = __toESM(require_react(), 1);
|
|
66729
66299
|
var DashboardMenuPluginGeneratedNote = ({ generatedFiles }) => {
|
|
66730
|
-
return /* @__PURE__ */
|
|
66300
|
+
return /* @__PURE__ */ import_react25.default.createElement(Box_default, { flexDirection: "column" }, /* @__PURE__ */ import_react25.default.createElement(
|
|
66731
66301
|
GenerationSuccessMessage,
|
|
66732
66302
|
{
|
|
66733
66303
|
extensionType: "dashboard menu plugin",
|
|
@@ -66738,7 +66308,7 @@ var DashboardMenuPluginGeneratedNote = ({ generatedFiles }) => {
|
|
|
66738
66308
|
};
|
|
66739
66309
|
|
|
66740
66310
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboad-menu-plugin/DashboardMenuPluginWizard.tsx
|
|
66741
|
-
var DashboardMenuPluginAction = (0,
|
|
66311
|
+
var DashboardMenuPluginAction = (0, import_variant6.variant)({
|
|
66742
66312
|
NavigateToPage: {},
|
|
66743
66313
|
OpenModal: {}
|
|
66744
66314
|
});
|
|
@@ -66750,15 +66320,15 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66750
66320
|
const bi = useWixCliAstroBi();
|
|
66751
66321
|
const { model } = useProjectModel();
|
|
66752
66322
|
const { addRequiredApp } = useDevCenterClient();
|
|
66753
|
-
const [backofficeMenuItem, setBackofficeMenuItem] = (0,
|
|
66754
|
-
const [actionType, setActionType] = (0,
|
|
66755
|
-
const [requireAppsIds, setRequireAppsIds] = (0,
|
|
66756
|
-
const [action, setAction] = (0,
|
|
66757
|
-
const [folder, setFolder] = (0,
|
|
66758
|
-
const [title, setTitle] = (0,
|
|
66759
|
-
const [finishedInstallation, setFinishedInstallation] = (0,
|
|
66760
|
-
const defaultFolderName = (0,
|
|
66761
|
-
const [additionalInfo, setAdditionalInfo] = (0,
|
|
66323
|
+
const [backofficeMenuItem, setBackofficeMenuItem] = (0, import_react26.useState)();
|
|
66324
|
+
const [actionType, setActionType] = (0, import_react26.useState)();
|
|
66325
|
+
const [requireAppsIds, setRequireAppsIds] = (0, import_react26.useState)();
|
|
66326
|
+
const [action, setAction] = (0, import_react26.useState)();
|
|
66327
|
+
const [folder, setFolder] = (0, import_react26.useState)();
|
|
66328
|
+
const [title, setTitle] = (0, import_react26.useState)();
|
|
66329
|
+
const [finishedInstallation, setFinishedInstallation] = (0, import_react26.useState)(false);
|
|
66330
|
+
const defaultFolderName = (0, import_kebabCase5.default)(title);
|
|
66331
|
+
const [additionalInfo, setAdditionalInfo] = (0, import_react26.useState)();
|
|
66762
66332
|
const validateMenuPluginFolder = useValidation(
|
|
66763
66333
|
createDashboardMenuPluginValidation(
|
|
66764
66334
|
getDashboardMenuPluginExtensionsDir(model.projectFolder)
|
|
@@ -66783,7 +66353,7 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66783
66353
|
);
|
|
66784
66354
|
}
|
|
66785
66355
|
}, [backofficeMenuItem, action, folder, title]);
|
|
66786
|
-
const handleActionSelected = (0,
|
|
66356
|
+
const handleActionSelected = (0, import_react26.useCallback)(
|
|
66787
66357
|
(action2) => setAction(action2),
|
|
66788
66358
|
[]
|
|
66789
66359
|
);
|
|
@@ -66800,7 +66370,7 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66800
66370
|
extensionsByPages[backofficePage.component.componentId]?.items.push(
|
|
66801
66371
|
{
|
|
66802
66372
|
title: backofficeMenuItem2.component.data.backOfficeExtensionContainer.slotData?.displayName ?? backofficeMenuItem2.component.name,
|
|
66803
|
-
description: backofficeMenuItem2.component.externalId ? /* @__PURE__ */
|
|
66373
|
+
description: backofficeMenuItem2.component.externalId ? /* @__PURE__ */ import_react26.default.createElement(Text, null, /* @__PURE__ */ import_react26.default.createElement(
|
|
66804
66374
|
Link,
|
|
66805
66375
|
{
|
|
66806
66376
|
url: docsLink2(backofficeMenuItem2.component.externalId)
|
|
@@ -66824,18 +66394,18 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66824
66394
|
backofficeExtensionWidgets.sort((a, b) => a.title.localeCompare(b.title));
|
|
66825
66395
|
return backofficeExtensionWidgets;
|
|
66826
66396
|
}, []);
|
|
66827
|
-
const task = (0,
|
|
66828
|
-
() => (0,
|
|
66397
|
+
const task = (0, import_react26.useMemo)(
|
|
66398
|
+
() => (0, import_variant6.match)(generationTask, {
|
|
66829
66399
|
Success: ({ hasUpdatedDependencies, newFiles }) => {
|
|
66830
66400
|
if (!hasUpdatedDependencies) {
|
|
66831
66401
|
setFinishedInstallation(true);
|
|
66832
66402
|
}
|
|
66833
|
-
return /* @__PURE__ */
|
|
66403
|
+
return /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, hasUpdatedDependencies && /* @__PURE__ */ import_react26.default.createElement(
|
|
66834
66404
|
InstallDependencies,
|
|
66835
66405
|
{
|
|
66836
66406
|
onFinish: () => setFinishedInstallation(true)
|
|
66837
66407
|
}
|
|
66838
|
-
), finishedInstallation && backofficeMenuItem && /* @__PURE__ */
|
|
66408
|
+
), finishedInstallation && backofficeMenuItem && /* @__PURE__ */ import_react26.default.createElement(
|
|
66839
66409
|
DashboardMenuPluginGeneratedNote,
|
|
66840
66410
|
{
|
|
66841
66411
|
backofficeMenuItem,
|
|
@@ -66843,7 +66413,7 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66843
66413
|
}
|
|
66844
66414
|
));
|
|
66845
66415
|
},
|
|
66846
|
-
Loading: () => /* @__PURE__ */
|
|
66416
|
+
Loading: () => /* @__PURE__ */ import_react26.default.createElement(Spinner, { text: `Generating dashboard menu plugin...` }),
|
|
66847
66417
|
Error: () => null,
|
|
66848
66418
|
NotRequested: () => null
|
|
66849
66419
|
}),
|
|
@@ -66854,15 +66424,15 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66854
66424
|
backofficeMenuItem
|
|
66855
66425
|
]
|
|
66856
66426
|
);
|
|
66857
|
-
return (0,
|
|
66427
|
+
return (0, import_variant6.match)(status, {
|
|
66858
66428
|
Error: () => null,
|
|
66859
|
-
Loading: () => /* @__PURE__ */
|
|
66860
|
-
Success: ({ result: menuItemsGroups }) => /* @__PURE__ */
|
|
66429
|
+
Loading: () => /* @__PURE__ */ import_react26.default.createElement(Spinner, { text: "Loading..." }),
|
|
66430
|
+
Success: ({ result: menuItemsGroups }) => /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, /* @__PURE__ */ import_react26.default.createElement(
|
|
66861
66431
|
SelectGroupsInput,
|
|
66862
66432
|
{
|
|
66863
66433
|
label: "What would you like to extend?",
|
|
66864
66434
|
hideScroll: true,
|
|
66865
|
-
info: /* @__PURE__ */
|
|
66435
|
+
info: /* @__PURE__ */ import_react26.default.createElement(Text, null, "Menu Plugins let you extend Wix apps by adding a menu item in a pre-defined slot in a menu on a dashboard page (", /* @__PURE__ */ import_react26.default.createElement(Link, { url: "https://wix.to/UepyZzx" }, "read more"), ")"),
|
|
66866
66436
|
groups: menuItemsGroups,
|
|
66867
66437
|
onSubmit: (item) => {
|
|
66868
66438
|
const additionalInfoOfSelectedItem = {
|
|
@@ -66880,7 +66450,7 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66880
66450
|
setBackofficeMenuItem(item.value);
|
|
66881
66451
|
}
|
|
66882
66452
|
}
|
|
66883
|
-
), backofficeMenuItem && /* @__PURE__ */
|
|
66453
|
+
), backofficeMenuItem && /* @__PURE__ */ import_react26.default.createElement(
|
|
66884
66454
|
MultipleAppRequirement,
|
|
66885
66455
|
{
|
|
66886
66456
|
appId: model.config.appId,
|
|
@@ -66890,7 +66460,7 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66890
66460
|
})),
|
|
66891
66461
|
onSubmit: setRequireAppsIds
|
|
66892
66462
|
}
|
|
66893
|
-
), requireAppsIds && /* @__PURE__ */
|
|
66463
|
+
), requireAppsIds && /* @__PURE__ */ import_react26.default.createElement(
|
|
66894
66464
|
SelectInput,
|
|
66895
66465
|
{
|
|
66896
66466
|
label: "What action will happen after clicking on the menu item?",
|
|
@@ -66916,10 +66486,10 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66916
66486
|
setActionType(action2.value);
|
|
66917
66487
|
}
|
|
66918
66488
|
}
|
|
66919
|
-
), actionType && (0,
|
|
66920
|
-
NavigateToPage: () => /* @__PURE__ */
|
|
66921
|
-
OpenModal: () => /* @__PURE__ */
|
|
66922
|
-
}), action && /* @__PURE__ */
|
|
66489
|
+
), actionType && (0, import_variant6.match)(actionType, {
|
|
66490
|
+
NavigateToPage: () => /* @__PURE__ */ import_react26.default.createElement(NavigateToPage, { onActionSelected: handleActionSelected }),
|
|
66491
|
+
OpenModal: () => /* @__PURE__ */ import_react26.default.createElement(OpenModal, { onActionSelected: handleActionSelected })
|
|
66492
|
+
}), action && /* @__PURE__ */ import_react26.default.createElement(
|
|
66923
66493
|
TextInput,
|
|
66924
66494
|
{
|
|
66925
66495
|
label: "Menu Plugin title",
|
|
@@ -66934,7 +66504,7 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66934
66504
|
setTitle(value);
|
|
66935
66505
|
}
|
|
66936
66506
|
}
|
|
66937
|
-
), title && /* @__PURE__ */
|
|
66507
|
+
), title && /* @__PURE__ */ import_react26.default.createElement(
|
|
66938
66508
|
TextInput,
|
|
66939
66509
|
{
|
|
66940
66510
|
label: "Menu Plugin folder",
|
|
@@ -66962,14 +66532,14 @@ var DashboardPlugin = ({ flow }) => {
|
|
|
66962
66532
|
getBackofficeExtensionWidgets,
|
|
66963
66533
|
getBackofficeMenuItems
|
|
66964
66534
|
} = useExtensionDataClient();
|
|
66965
|
-
const [slotsApp, setSlotsApp] = (0,
|
|
66535
|
+
const [slotsApp, setSlotsApp] = (0, import_react27.useState)();
|
|
66966
66536
|
const { status } = useAsync(async () => {
|
|
66967
66537
|
const [ecomRequiredApps2, backofficePages, backofficeExtensionContainers] = await Promise.all([
|
|
66968
66538
|
getEcomRequiredApps(),
|
|
66969
66539
|
getBackofficePages(),
|
|
66970
|
-
(0,
|
|
66540
|
+
(0, import_variant7.match)(
|
|
66971
66541
|
flow,
|
|
66972
|
-
(0,
|
|
66542
|
+
(0, import_variant7.partial)({
|
|
66973
66543
|
DashboardPlugin: () => getBackofficeExtensionWidgets(),
|
|
66974
66544
|
DashboardMenuPlugin: () => getBackofficeMenuItems(),
|
|
66975
66545
|
default: () => []
|
|
@@ -67013,14 +66583,14 @@ var DashboardPlugin = ({ flow }) => {
|
|
|
67013
66583
|
pluginsMap
|
|
67014
66584
|
};
|
|
67015
66585
|
}, []);
|
|
67016
|
-
return (0,
|
|
66586
|
+
return (0, import_variant7.match)(status, {
|
|
67017
66587
|
Error: () => null,
|
|
67018
|
-
Loading: () => /* @__PURE__ */
|
|
67019
|
-
Success: ({ result: { supportedApps, pluginsMap } }) => /* @__PURE__ */
|
|
66588
|
+
Loading: () => /* @__PURE__ */ import_react27.default.createElement(Spinner, { text: "Loading..." }),
|
|
66589
|
+
Success: ({ result: { supportedApps, pluginsMap } }) => /* @__PURE__ */ import_react27.default.createElement(import_react27.default.Fragment, null, /* @__PURE__ */ import_react27.default.createElement(
|
|
67020
66590
|
SelectInput,
|
|
67021
66591
|
{
|
|
67022
66592
|
label: "Select a Wix app to view its plugin slots",
|
|
67023
|
-
info: /* @__PURE__ */
|
|
66593
|
+
info: /* @__PURE__ */ import_react27.default.createElement(Text, null, "(", /* @__PURE__ */ import_react27.default.createElement(Link, { url: "https://wix.to/T9OFciS" }, "read more"), ")"),
|
|
67024
66594
|
options: supportedApps,
|
|
67025
66595
|
onSubmit: (option) => {
|
|
67026
66596
|
bi.cliFlowStepAnswered({
|
|
@@ -67035,10 +66605,10 @@ var DashboardPlugin = ({ flow }) => {
|
|
|
67035
66605
|
setSlotsApp(option.value);
|
|
67036
66606
|
}
|
|
67037
66607
|
}
|
|
67038
|
-
), slotsApp && (0,
|
|
66608
|
+
), slotsApp && (0, import_variant7.match)(
|
|
67039
66609
|
flow,
|
|
67040
|
-
(0,
|
|
67041
|
-
DashboardPlugin: () => /* @__PURE__ */
|
|
66610
|
+
(0, import_variant7.partial)({
|
|
66611
|
+
DashboardPlugin: () => /* @__PURE__ */ import_react27.default.createElement(
|
|
67042
66612
|
DashboardPluginWizard,
|
|
67043
66613
|
{
|
|
67044
66614
|
slotsApp,
|
|
@@ -67049,7 +66619,7 @@ var DashboardPlugin = ({ flow }) => {
|
|
|
67049
66619
|
)
|
|
67050
66620
|
}
|
|
67051
66621
|
),
|
|
67052
|
-
DashboardMenuPlugin: () => /* @__PURE__ */
|
|
66622
|
+
DashboardMenuPlugin: () => /* @__PURE__ */ import_react27.default.createElement(
|
|
67053
66623
|
DashboardMenuPluginWizard,
|
|
67054
66624
|
{
|
|
67055
66625
|
slotsApp,
|
|
@@ -67066,9 +66636,372 @@ var DashboardPlugin = ({ flow }) => {
|
|
|
67066
66636
|
});
|
|
67067
66637
|
};
|
|
67068
66638
|
|
|
66639
|
+
// ../cli-astro-commands/src/components/GenerateCommand/custom-element/CustomElement.tsx
|
|
66640
|
+
init_esm_shims();
|
|
66641
|
+
var import_react29 = __toESM(require_react(), 1);
|
|
66642
|
+
|
|
66643
|
+
// ../cli-astro-commands/src/components/GenerateCommand/custom-element/generate.ts
|
|
66644
|
+
init_esm_shims();
|
|
66645
|
+
var import_camelCase9 = __toESM(require_camelCase(), 1);
|
|
66646
|
+
import path10 from "node:path";
|
|
66647
|
+
import { randomUUID as randomUUID8 } from "node:crypto";
|
|
66648
|
+
var CUSTOM_ELEMENT_TEMPLATE = path10.resolve(
|
|
66649
|
+
__dirname,
|
|
66650
|
+
"../templates/astro/custom-element"
|
|
66651
|
+
);
|
|
66652
|
+
async function generateCustomElement(projectFolder, route, name, dashboardPageId) {
|
|
66653
|
+
const cwd = getSiteWidgetExtensionPath(projectFolder, route);
|
|
66654
|
+
const {
|
|
66655
|
+
relativePathToCodeFile,
|
|
66656
|
+
relativePathToConfigFile,
|
|
66657
|
+
relativePathToExtensionDir
|
|
66658
|
+
} = getExtensionRelativePaths({
|
|
66659
|
+
cwd,
|
|
66660
|
+
projectFolder,
|
|
66661
|
+
extensionFileName: route,
|
|
66662
|
+
codeFileType: "tsx"
|
|
66663
|
+
});
|
|
66664
|
+
const relativePathToSettingsFile = `./${toPosix(
|
|
66665
|
+
path10.join(relativePathToExtensionDir, `${route}.panel.tsx`)
|
|
66666
|
+
)}`;
|
|
66667
|
+
const config = {
|
|
66668
|
+
id: randomUUID8(),
|
|
66669
|
+
name,
|
|
66670
|
+
dashboardPageId,
|
|
66671
|
+
presetId: randomUUID8(),
|
|
66672
|
+
element: relativePathToCodeFile,
|
|
66673
|
+
settings: relativePathToSettingsFile
|
|
66674
|
+
};
|
|
66675
|
+
await modifyExtensionsEntry(
|
|
66676
|
+
projectFolder,
|
|
66677
|
+
(0, import_camelCase9.default)(route),
|
|
66678
|
+
relativePathToConfigFile
|
|
66679
|
+
);
|
|
66680
|
+
return await componentGenerator({
|
|
66681
|
+
template: CUSTOM_ELEMENT_TEMPLATE,
|
|
66682
|
+
assetsOutputPath: "public",
|
|
66683
|
+
assetsPrefix: route,
|
|
66684
|
+
projectFolder,
|
|
66685
|
+
cwd,
|
|
66686
|
+
data: {
|
|
66687
|
+
route,
|
|
66688
|
+
config
|
|
66689
|
+
}
|
|
66690
|
+
});
|
|
66691
|
+
}
|
|
66692
|
+
|
|
66693
|
+
// ../cli-astro-commands/src/components/GenerateCommand/custom-element/steps.tsx
|
|
66694
|
+
init_esm_shims();
|
|
66695
|
+
var import_react28 = __toESM(require_react(), 1);
|
|
66696
|
+
var import_kebabCase6 = __toESM(require_kebabCase(), 1);
|
|
66697
|
+
var ChooseElementNameStep = ({ onSubmit, elementName }) => {
|
|
66698
|
+
const bi = useWixCliAstroBi();
|
|
66699
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
66700
|
+
const validateName = useCustomElementNameValidation();
|
|
66701
|
+
return /* @__PURE__ */ import_react28.default.createElement(
|
|
66702
|
+
TextInput,
|
|
66703
|
+
{
|
|
66704
|
+
isActive,
|
|
66705
|
+
label: "Element name:",
|
|
66706
|
+
placeholder: elementName ?? "My Element",
|
|
66707
|
+
onSubmit: (value) => {
|
|
66708
|
+
bi.cliFlowStepAnswered({
|
|
66709
|
+
question: "Element name:",
|
|
66710
|
+
questionKey: "generate_command.custom_element.choose_name",
|
|
66711
|
+
answer: value,
|
|
66712
|
+
additionalInfo: { extensionType: "custom element" }
|
|
66713
|
+
});
|
|
66714
|
+
onSubmit(value);
|
|
66715
|
+
goToNextStep();
|
|
66716
|
+
},
|
|
66717
|
+
validate: validateName
|
|
66718
|
+
}
|
|
66719
|
+
);
|
|
66720
|
+
};
|
|
66721
|
+
var ChooseElementFolderStep = ({ onSubmit, elementFolder, elementName }) => {
|
|
66722
|
+
const { model } = useProjectModel();
|
|
66723
|
+
const bi = useWixCliAstroBi();
|
|
66724
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
66725
|
+
const defaultElementFolder = (0, import_kebabCase6.default)(elementName);
|
|
66726
|
+
const validateElementFolder = useValidation(
|
|
66727
|
+
createCustomElementFolderValidation(
|
|
66728
|
+
getSiteWidgetExtensionsDir(model.projectFolder)
|
|
66729
|
+
)
|
|
66730
|
+
);
|
|
66731
|
+
return /* @__PURE__ */ import_react28.default.createElement(
|
|
66732
|
+
TextInput,
|
|
66733
|
+
{
|
|
66734
|
+
isActive,
|
|
66735
|
+
label: "Enter the folder for the new element:",
|
|
66736
|
+
placeholder: elementFolder ?? defaultElementFolder,
|
|
66737
|
+
onSubmit: (value) => {
|
|
66738
|
+
bi.cliFlowStepAnswered({
|
|
66739
|
+
question: "Enter the folder for the new element:",
|
|
66740
|
+
questionKey: "generate_command.custom_element.choose_folder",
|
|
66741
|
+
answer: value,
|
|
66742
|
+
additionalInfo: { extensionType: "custom element" }
|
|
66743
|
+
});
|
|
66744
|
+
onSubmit(value);
|
|
66745
|
+
goToNextStep();
|
|
66746
|
+
},
|
|
66747
|
+
validate: validateElementFolder
|
|
66748
|
+
}
|
|
66749
|
+
);
|
|
66750
|
+
};
|
|
66751
|
+
var LinkDashboardPageStep = ({ onSubmit }) => {
|
|
66752
|
+
const bi = useWixCliAstroBi();
|
|
66753
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
66754
|
+
return /* @__PURE__ */ import_react28.default.createElement(Box_default, { marginBottom: 1 }, /* @__PURE__ */ import_react28.default.createElement(
|
|
66755
|
+
ConfirmInput,
|
|
66756
|
+
{
|
|
66757
|
+
isActive,
|
|
66758
|
+
label: "Link dashboard page to custom element?",
|
|
66759
|
+
onSubmit: (shouldLinkDashboardPage) => {
|
|
66760
|
+
bi.cliFlowStepAnswered({
|
|
66761
|
+
question: "Link dashboard page to custom element?",
|
|
66762
|
+
questionKey: "generate_command.custom_element.link_dashboard_page",
|
|
66763
|
+
answer: String(shouldLinkDashboardPage),
|
|
66764
|
+
additionalInfo: { extensionType: "custom element" }
|
|
66765
|
+
});
|
|
66766
|
+
onSubmit(shouldLinkDashboardPage);
|
|
66767
|
+
goToNextStep();
|
|
66768
|
+
}
|
|
66769
|
+
}
|
|
66770
|
+
));
|
|
66771
|
+
};
|
|
66772
|
+
var ChooseDashboardPageStep = ({ onSubmit }) => {
|
|
66773
|
+
const bi = useWixCliAstroBi();
|
|
66774
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
66775
|
+
const validatePageId = useValidation(
|
|
66776
|
+
composeValidations([
|
|
66777
|
+
[uuidValidation, "Page id has to be in the format of a uuid"]
|
|
66778
|
+
])
|
|
66779
|
+
);
|
|
66780
|
+
return /* @__PURE__ */ import_react28.default.createElement(
|
|
66781
|
+
TextInput,
|
|
66782
|
+
{
|
|
66783
|
+
isActive,
|
|
66784
|
+
label: "Dashboard page id:",
|
|
66785
|
+
onSubmit: (value) => {
|
|
66786
|
+
bi.cliFlowStepAnswered({
|
|
66787
|
+
question: "Dashboard page id:",
|
|
66788
|
+
questionKey: "generate_command.custom_element.choose_dashboard_page_id",
|
|
66789
|
+
answer: value,
|
|
66790
|
+
additionalInfo: { extensionType: "custom element" }
|
|
66791
|
+
});
|
|
66792
|
+
onSubmit(value);
|
|
66793
|
+
goToNextStep();
|
|
66794
|
+
},
|
|
66795
|
+
validate: validatePageId
|
|
66796
|
+
}
|
|
66797
|
+
);
|
|
66798
|
+
};
|
|
66799
|
+
|
|
66800
|
+
// ../cli-astro-commands/src/components/GenerateCommand/custom-element/CustomElement.tsx
|
|
66801
|
+
var useGenerateCustomElement = () => {
|
|
66802
|
+
const { model } = useProjectModel();
|
|
66803
|
+
const [elementName, setElementName] = (0, import_react29.useState)();
|
|
66804
|
+
const [elementFolder, setElementFolder] = (0, import_react29.useState)();
|
|
66805
|
+
const [linkDashboardPage, setLinkDashboardPage] = (0, import_react29.useState)();
|
|
66806
|
+
const [dashboardPageId, setDashboardPageId] = (0, import_react29.useState)();
|
|
66807
|
+
const shouldGenerate = linkDashboardPage === false ? true : dashboardPageId;
|
|
66808
|
+
const generationTask = useGenerationTask(async () => {
|
|
66809
|
+
if (elementName && elementFolder && shouldGenerate) {
|
|
66810
|
+
return generateCustomElement(
|
|
66811
|
+
model.projectFolder,
|
|
66812
|
+
elementFolder,
|
|
66813
|
+
elementName,
|
|
66814
|
+
dashboardPageId
|
|
66815
|
+
);
|
|
66816
|
+
}
|
|
66817
|
+
}, [elementFolder, elementName, shouldGenerate]);
|
|
66818
|
+
return [
|
|
66819
|
+
/* @__PURE__ */ import_react29.default.createElement(
|
|
66820
|
+
ChooseElementNameStep,
|
|
66821
|
+
{
|
|
66822
|
+
onSubmit: setElementName,
|
|
66823
|
+
elementName
|
|
66824
|
+
}
|
|
66825
|
+
),
|
|
66826
|
+
/* @__PURE__ */ import_react29.default.createElement(
|
|
66827
|
+
ChooseElementFolderStep,
|
|
66828
|
+
{
|
|
66829
|
+
onSubmit: setElementFolder,
|
|
66830
|
+
elementFolder,
|
|
66831
|
+
elementName
|
|
66832
|
+
}
|
|
66833
|
+
),
|
|
66834
|
+
/* @__PURE__ */ import_react29.default.createElement(LinkDashboardPageStep, { onSubmit: setLinkDashboardPage }),
|
|
66835
|
+
...linkDashboardPage ? [/* @__PURE__ */ import_react29.default.createElement(ChooseDashboardPageStep, { onSubmit: setDashboardPageId })] : [],
|
|
66836
|
+
/* @__PURE__ */ import_react29.default.createElement(
|
|
66837
|
+
CompleteGeneration,
|
|
66838
|
+
{
|
|
66839
|
+
generationTask,
|
|
66840
|
+
extensionType: "custom element",
|
|
66841
|
+
successMessage: CompleteGenerationMessage.SuccessMessage({
|
|
66842
|
+
// https://dev.wix.com/docs/wix-cli/guides/extensions/site-extensions/site-widgets/add-a-site-widget-extension
|
|
66843
|
+
learnMoreUrl: "https://wix.to/6aKN8aH"
|
|
66844
|
+
})
|
|
66845
|
+
}
|
|
66846
|
+
)
|
|
66847
|
+
];
|
|
66848
|
+
};
|
|
66849
|
+
|
|
66850
|
+
// ../cli-astro-commands/src/components/GenerateCommand/editor-react-component/EditorReactComponent.tsx
|
|
66851
|
+
init_esm_shims();
|
|
66852
|
+
var import_react31 = __toESM(require_react(), 1);
|
|
66853
|
+
|
|
66854
|
+
// ../cli-astro-commands/src/components/GenerateCommand/editor-react-component/generate.ts
|
|
66855
|
+
init_esm_shims();
|
|
66856
|
+
var import_camelCase10 = __toESM(require_camelCase(), 1);
|
|
66857
|
+
var import_capitalize = __toESM(require_capitalize(), 1);
|
|
66858
|
+
import path11 from "node:path";
|
|
66859
|
+
import { randomUUID as randomUUID9 } from "node:crypto";
|
|
66860
|
+
var EDITOR_REACT_COMPONENT_TEMPLATE = path11.resolve(
|
|
66861
|
+
__dirname,
|
|
66862
|
+
"../templates/astro/editor-react-component"
|
|
66863
|
+
);
|
|
66864
|
+
async function generateEditorReactComponent(projectFolder, route, name, codeIdentifier) {
|
|
66865
|
+
const cwd = getSiteWidgetExtensionPath(projectFolder, route);
|
|
66866
|
+
const { relativePathToCodeFile, relativePathToConfigFile } = getExtensionRelativePaths({
|
|
66867
|
+
cwd,
|
|
66868
|
+
projectFolder,
|
|
66869
|
+
extensionFileName: route,
|
|
66870
|
+
codeFileType: "tsx"
|
|
66871
|
+
});
|
|
66872
|
+
const componentType = (0, import_capitalize.default)((0, import_camelCase10.default)(route));
|
|
66873
|
+
const config = {
|
|
66874
|
+
id: randomUUID9(),
|
|
66875
|
+
name,
|
|
66876
|
+
type: codeIdentifier ? `${codeIdentifier}.${componentType}` : componentType,
|
|
66877
|
+
selector: `.${route}`,
|
|
66878
|
+
codeIdentifier,
|
|
66879
|
+
component: relativePathToCodeFile
|
|
66880
|
+
};
|
|
66881
|
+
await modifyExtensionsEntry(
|
|
66882
|
+
projectFolder,
|
|
66883
|
+
(0, import_camelCase10.default)(route),
|
|
66884
|
+
relativePathToConfigFile
|
|
66885
|
+
);
|
|
66886
|
+
return await componentGenerator({
|
|
66887
|
+
template: EDITOR_REACT_COMPONENT_TEMPLATE,
|
|
66888
|
+
projectFolder,
|
|
66889
|
+
cwd,
|
|
66890
|
+
data: {
|
|
66891
|
+
route,
|
|
66892
|
+
config
|
|
66893
|
+
}
|
|
66894
|
+
});
|
|
66895
|
+
}
|
|
66896
|
+
|
|
66897
|
+
// ../cli-astro-commands/src/components/GenerateCommand/editor-react-component/steps.tsx
|
|
66898
|
+
init_esm_shims();
|
|
66899
|
+
var import_react30 = __toESM(require_react(), 1);
|
|
66900
|
+
var import_kebabCase7 = __toESM(require_kebabCase(), 1);
|
|
66901
|
+
var ChooseComponentNameStep = ({ onSubmit, componentName }) => {
|
|
66902
|
+
const bi = useWixCliAstroBi();
|
|
66903
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
66904
|
+
const validateName = useReactComponentNameValidation();
|
|
66905
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
66906
|
+
TextInput,
|
|
66907
|
+
{
|
|
66908
|
+
isActive,
|
|
66909
|
+
label: "Enter a name for your component:",
|
|
66910
|
+
placeholder: componentName ?? "My Component",
|
|
66911
|
+
onSubmit: (value) => {
|
|
66912
|
+
bi.cliFlowStepAnswered({
|
|
66913
|
+
question: "Enter a name for your component:",
|
|
66914
|
+
questionKey: "generate_command.react_component.choose_name",
|
|
66915
|
+
answer: value,
|
|
66916
|
+
additionalInfo: { extensionType: "editor react component" }
|
|
66917
|
+
});
|
|
66918
|
+
onSubmit(value);
|
|
66919
|
+
goToNextStep();
|
|
66920
|
+
},
|
|
66921
|
+
validate: validateName
|
|
66922
|
+
}
|
|
66923
|
+
);
|
|
66924
|
+
};
|
|
66925
|
+
var ChooseComponentFolderStep = ({ onSubmit, componentFolder, componentName }) => {
|
|
66926
|
+
const { model } = useProjectModel();
|
|
66927
|
+
const bi = useWixCliAstroBi();
|
|
66928
|
+
const { isActive, goToNextStep } = useWizardStep();
|
|
66929
|
+
const defaultComponentFolder = (0, import_kebabCase7.default)(componentName);
|
|
66930
|
+
const validateComponentFolder = useReactComponentFolderValidation(
|
|
66931
|
+
getSiteWidgetExtensionsDir(model.projectFolder)
|
|
66932
|
+
);
|
|
66933
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
66934
|
+
TextInput,
|
|
66935
|
+
{
|
|
66936
|
+
isActive,
|
|
66937
|
+
label: "Enter the folder for the new component:",
|
|
66938
|
+
placeholder: componentFolder ?? defaultComponentFolder,
|
|
66939
|
+
onSubmit: (value) => {
|
|
66940
|
+
bi.cliFlowStepAnswered({
|
|
66941
|
+
question: "Enter the folder for the new component:",
|
|
66942
|
+
questionKey: "generate_command.react_component.choose_folder",
|
|
66943
|
+
answer: value,
|
|
66944
|
+
additionalInfo: { extensionType: "editor react component" }
|
|
66945
|
+
});
|
|
66946
|
+
onSubmit(value);
|
|
66947
|
+
goToNextStep();
|
|
66948
|
+
},
|
|
66949
|
+
validate: validateComponentFolder
|
|
66950
|
+
}
|
|
66951
|
+
);
|
|
66952
|
+
};
|
|
66953
|
+
|
|
66954
|
+
// ../cli-astro-commands/src/components/GenerateCommand/editor-react-component/EditorReactComponent.tsx
|
|
66955
|
+
var useGenerateEditorReactComponent = () => {
|
|
66956
|
+
const {
|
|
66957
|
+
model: { projectFolder }
|
|
66958
|
+
} = useProjectModel();
|
|
66959
|
+
const { codeIdentifier } = useAppConfig();
|
|
66960
|
+
const [componentName, setComponentName] = (0, import_react31.useState)();
|
|
66961
|
+
const [componentFolder, setComponentFolder] = (0, import_react31.useState)();
|
|
66962
|
+
const generationTask = useGenerationTask(async () => {
|
|
66963
|
+
if (componentName && componentFolder) {
|
|
66964
|
+
return generateEditorReactComponent(
|
|
66965
|
+
projectFolder,
|
|
66966
|
+
componentFolder,
|
|
66967
|
+
componentName,
|
|
66968
|
+
codeIdentifier
|
|
66969
|
+
);
|
|
66970
|
+
}
|
|
66971
|
+
}, [componentFolder, componentName]);
|
|
66972
|
+
return [
|
|
66973
|
+
/* @__PURE__ */ import_react31.default.createElement(
|
|
66974
|
+
ChooseComponentNameStep,
|
|
66975
|
+
{
|
|
66976
|
+
onSubmit: setComponentName,
|
|
66977
|
+
componentName
|
|
66978
|
+
}
|
|
66979
|
+
),
|
|
66980
|
+
/* @__PURE__ */ import_react31.default.createElement(
|
|
66981
|
+
ChooseComponentFolderStep,
|
|
66982
|
+
{
|
|
66983
|
+
onSubmit: setComponentFolder,
|
|
66984
|
+
componentFolder,
|
|
66985
|
+
componentName
|
|
66986
|
+
}
|
|
66987
|
+
),
|
|
66988
|
+
/* @__PURE__ */ import_react31.default.createElement(
|
|
66989
|
+
CompleteGeneration,
|
|
66990
|
+
{
|
|
66991
|
+
generationTask,
|
|
66992
|
+
extensionType: "editor react component",
|
|
66993
|
+
successMessage: CompleteGenerationMessage.SuccessMessage({
|
|
66994
|
+
// https://dev.wix.com/docs/go-headless
|
|
66995
|
+
learnMoreUrl: "https://dev.wix.com/docs/go-headless"
|
|
66996
|
+
})
|
|
66997
|
+
}
|
|
66998
|
+
)
|
|
66999
|
+
];
|
|
67000
|
+
};
|
|
67001
|
+
|
|
67069
67002
|
// ../cli-astro-commands/src/components/GenerateCommand/event/Event.tsx
|
|
67070
67003
|
init_esm_shims();
|
|
67071
|
-
var
|
|
67004
|
+
var import_react33 = __toESM(require_react(), 1);
|
|
67072
67005
|
|
|
67073
67006
|
// ../cli-astro-commands/src/components/GenerateCommand/event/generate.ts
|
|
67074
67007
|
init_esm_shims();
|
|
@@ -67106,7 +67039,7 @@ async function generateEvent(projectFolder, route) {
|
|
|
67106
67039
|
|
|
67107
67040
|
// ../cli-astro-commands/src/components/GenerateCommand/event/steps.tsx
|
|
67108
67041
|
init_esm_shims();
|
|
67109
|
-
var
|
|
67042
|
+
var import_react32 = __toESM(require_react(), 1);
|
|
67110
67043
|
var ChooseFolderStep2 = ({ onSubmit, eventFolder }) => {
|
|
67111
67044
|
const { model } = useProjectModel();
|
|
67112
67045
|
const bi = useWixCliAstroBi();
|
|
@@ -67125,7 +67058,7 @@ var ChooseFolderStep2 = ({ onSubmit, eventFolder }) => {
|
|
|
67125
67058
|
]
|
|
67126
67059
|
])
|
|
67127
67060
|
);
|
|
67128
|
-
return /* @__PURE__ */
|
|
67061
|
+
return /* @__PURE__ */ import_react32.default.createElement(
|
|
67129
67062
|
TextInput,
|
|
67130
67063
|
{
|
|
67131
67064
|
isActive,
|
|
@@ -67148,15 +67081,15 @@ var ChooseFolderStep2 = ({ onSubmit, eventFolder }) => {
|
|
|
67148
67081
|
// ../cli-astro-commands/src/components/GenerateCommand/event/Event.tsx
|
|
67149
67082
|
var useGenerateEvent = () => {
|
|
67150
67083
|
const { model } = useProjectModel();
|
|
67151
|
-
const [eventFolder, setEventFolder] = (0,
|
|
67084
|
+
const [eventFolder, setEventFolder] = (0, import_react33.useState)();
|
|
67152
67085
|
const generationTask = useGenerationTask(async () => {
|
|
67153
67086
|
if (eventFolder) {
|
|
67154
67087
|
return generateEvent(model.projectFolder, eventFolder);
|
|
67155
67088
|
}
|
|
67156
67089
|
}, [model.projectFolder, eventFolder]);
|
|
67157
67090
|
return [
|
|
67158
|
-
/* @__PURE__ */
|
|
67159
|
-
/* @__PURE__ */
|
|
67091
|
+
/* @__PURE__ */ import_react33.default.createElement(ChooseFolderStep2, { onSubmit: setEventFolder, eventFolder }),
|
|
67092
|
+
/* @__PURE__ */ import_react33.default.createElement(
|
|
67160
67093
|
CompleteGeneration,
|
|
67161
67094
|
{
|
|
67162
67095
|
generationTask,
|
|
@@ -67173,13 +67106,13 @@ var useGenerateEvent = () => {
|
|
|
67173
67106
|
|
|
67174
67107
|
// ../cli-astro-commands/src/components/GenerateCommand/site-plugin/SitePlugin.tsx
|
|
67175
67108
|
init_esm_shims();
|
|
67176
|
-
var
|
|
67177
|
-
var
|
|
67109
|
+
var import_react35 = __toESM(require_react(), 1);
|
|
67110
|
+
var import_variant9 = __toESM(require_lib(), 1);
|
|
67178
67111
|
|
|
67179
67112
|
// ../cli-astro-commands/src/components/GenerateCommand/site-plugin/SitePluginWizard.tsx
|
|
67180
67113
|
init_esm_shims();
|
|
67181
|
-
var
|
|
67182
|
-
var
|
|
67114
|
+
var import_react34 = __toESM(require_react(), 1);
|
|
67115
|
+
var import_variant8 = __toESM(require_lib(), 1);
|
|
67183
67116
|
var import_kebabCase8 = __toESM(require_kebabCase(), 1);
|
|
67184
67117
|
var import_uniqBy = __toESM(require_uniqBy(), 1);
|
|
67185
67118
|
|
|
@@ -67246,26 +67179,26 @@ var SitePluginWizard = ({
|
|
|
67246
67179
|
getSitePluginExtensionsDir(model.projectFolder)
|
|
67247
67180
|
)
|
|
67248
67181
|
);
|
|
67249
|
-
const [slot, setSlot] = (0,
|
|
67250
|
-
const [requireAppsIds, setRequireAppsIds] = (0,
|
|
67251
|
-
const [placementApp, setPlacementApp] = (0,
|
|
67252
|
-
const [pluginFolder, setPluginFolder] = (0,
|
|
67253
|
-
const [pluginName, setPluginName] = (0,
|
|
67254
|
-
const [finishedInstallation, setFinishedInstallation] = (0,
|
|
67255
|
-
const pluginApplications = (0,
|
|
67182
|
+
const [slot, setSlot] = (0, import_react34.useState)();
|
|
67183
|
+
const [requireAppsIds, setRequireAppsIds] = (0, import_react34.useState)();
|
|
67184
|
+
const [placementApp, setPlacementApp] = (0, import_react34.useState)();
|
|
67185
|
+
const [pluginFolder, setPluginFolder] = (0, import_react34.useState)();
|
|
67186
|
+
const [pluginName, setPluginName] = (0, import_react34.useState)();
|
|
67187
|
+
const [finishedInstallation, setFinishedInstallation] = (0, import_react34.useState)(false);
|
|
67188
|
+
const pluginApplications = (0, import_react34.useMemo)(
|
|
67256
67189
|
() => (0, import_uniqBy.default)(widgetPlugins2, "appName").map((pluginPlacement) => ({
|
|
67257
67190
|
value: pluginPlacement.appName,
|
|
67258
67191
|
title: pluginPlacement.appName
|
|
67259
67192
|
})),
|
|
67260
67193
|
[widgetPlugins2]
|
|
67261
67194
|
);
|
|
67262
|
-
const widgetSlots = (0,
|
|
67195
|
+
const widgetSlots = (0, import_react34.useMemo)(
|
|
67263
67196
|
() => placementApp ? widgetPlugins2.filter((widgetPlugin) => widgetPlugin.appName === placementApp).reduce(
|
|
67264
67197
|
(_widgetSlots, widgetPlugin) => {
|
|
67265
67198
|
const widgetDocsUrl = getWidgetDocsUrl(
|
|
67266
67199
|
widgetPlugin.component.componentId
|
|
67267
67200
|
);
|
|
67268
|
-
const description = widgetDocsUrl && /* @__PURE__ */
|
|
67201
|
+
const description = widgetDocsUrl && /* @__PURE__ */ import_react34.default.createElement(Text, { skin: "secondary" }, /* @__PURE__ */ import_react34.default.createElement(Link, { url: widgetDocsUrl }, "read more"));
|
|
67269
67202
|
_widgetSlots[widgetPlugin.component.componentId] ??= {
|
|
67270
67203
|
title: widgetPlugin.component.name,
|
|
67271
67204
|
description,
|
|
@@ -67307,7 +67240,7 @@ var SitePluginWizard = ({
|
|
|
67307
67240
|
}
|
|
67308
67241
|
}
|
|
67309
67242
|
}, [pluginFolder, pluginName, slot, widgetSlots, getWidgetDocsUrl]);
|
|
67310
|
-
const handleSetSlot = (0,
|
|
67243
|
+
const handleSetSlot = (0, import_react34.useCallback)(
|
|
67311
67244
|
(placement) => {
|
|
67312
67245
|
void getEcomRequiredApps().then((ecomRequiredApp) => {
|
|
67313
67246
|
const widgetPlugin = widgetPlugins2.find(
|
|
@@ -67330,11 +67263,11 @@ var SitePluginWizard = ({
|
|
|
67330
67263
|
},
|
|
67331
67264
|
[widgetPlugins2]
|
|
67332
67265
|
);
|
|
67333
|
-
return /* @__PURE__ */
|
|
67266
|
+
return /* @__PURE__ */ import_react34.default.createElement(import_react34.default.Fragment, null, /* @__PURE__ */ import_react34.default.createElement(
|
|
67334
67267
|
SelectInput,
|
|
67335
67268
|
{
|
|
67336
67269
|
label: "Select a Wix app to view its plugin slots",
|
|
67337
|
-
info: /* @__PURE__ */
|
|
67270
|
+
info: /* @__PURE__ */ import_react34.default.createElement(Text, null, /* @__PURE__ */ import_react34.default.createElement(Link, { url: "https://wix.to/Onfe4XJ" }, "read more")),
|
|
67338
67271
|
options: pluginApplications,
|
|
67339
67272
|
onSubmit: (option) => {
|
|
67340
67273
|
bi.cliFlowStepAnswered({
|
|
@@ -67346,7 +67279,7 @@ var SitePluginWizard = ({
|
|
|
67346
67279
|
setPlacementApp(option.value);
|
|
67347
67280
|
}
|
|
67348
67281
|
}
|
|
67349
|
-
), placementApp && /* @__PURE__ */
|
|
67282
|
+
), placementApp && /* @__PURE__ */ import_react34.default.createElement(
|
|
67350
67283
|
SelectGroupsInput,
|
|
67351
67284
|
{
|
|
67352
67285
|
label: "Select the slot in which you\u2019d like to place your plugin",
|
|
@@ -67361,7 +67294,7 @@ var SitePluginWizard = ({
|
|
|
67361
67294
|
handleSetSlot(option.value);
|
|
67362
67295
|
}
|
|
67363
67296
|
}
|
|
67364
|
-
), slot?.requiredApps && /* @__PURE__ */
|
|
67297
|
+
), slot?.requiredApps && /* @__PURE__ */ import_react34.default.createElement(
|
|
67365
67298
|
MultipleAppRequirement,
|
|
67366
67299
|
{
|
|
67367
67300
|
appId: model.config.appId,
|
|
@@ -67371,7 +67304,7 @@ var SitePluginWizard = ({
|
|
|
67371
67304
|
})),
|
|
67372
67305
|
onSubmit: setRequireAppsIds
|
|
67373
67306
|
}
|
|
67374
|
-
), requireAppsIds && /* @__PURE__ */
|
|
67307
|
+
), requireAppsIds && /* @__PURE__ */ import_react34.default.createElement(
|
|
67375
67308
|
TextInput,
|
|
67376
67309
|
{
|
|
67377
67310
|
label: "Enter a name for your site plugin:",
|
|
@@ -67389,7 +67322,7 @@ var SitePluginWizard = ({
|
|
|
67389
67322
|
},
|
|
67390
67323
|
validate: validateName
|
|
67391
67324
|
}
|
|
67392
|
-
), pluginName && /* @__PURE__ */
|
|
67325
|
+
), pluginName && /* @__PURE__ */ import_react34.default.createElement(
|
|
67393
67326
|
TextInput,
|
|
67394
67327
|
{
|
|
67395
67328
|
label: "Enter a folder name for your site plugin:",
|
|
@@ -67408,18 +67341,18 @@ var SitePluginWizard = ({
|
|
|
67408
67341
|
},
|
|
67409
67342
|
validate: validatePluginFolder
|
|
67410
67343
|
}
|
|
67411
|
-
), (0,
|
|
67412
|
-
() => (0,
|
|
67344
|
+
), (0, import_react34.useMemo)(
|
|
67345
|
+
() => (0, import_variant8.match)(generationTask, {
|
|
67413
67346
|
Success: ({ hasUpdatedDependencies, newFiles }) => {
|
|
67414
67347
|
if (!hasUpdatedDependencies) {
|
|
67415
67348
|
setFinishedInstallation(true);
|
|
67416
67349
|
}
|
|
67417
|
-
return /* @__PURE__ */
|
|
67350
|
+
return /* @__PURE__ */ import_react34.default.createElement(import_react34.default.Fragment, null, hasUpdatedDependencies && /* @__PURE__ */ import_react34.default.createElement(
|
|
67418
67351
|
InstallDependencies,
|
|
67419
67352
|
{
|
|
67420
67353
|
onFinish: () => setFinishedInstallation(true)
|
|
67421
67354
|
}
|
|
67422
|
-
), finishedInstallation && /* @__PURE__ */
|
|
67355
|
+
), finishedInstallation && /* @__PURE__ */ import_react34.default.createElement(
|
|
67423
67356
|
GenerationSuccessMessage,
|
|
67424
67357
|
{
|
|
67425
67358
|
extensionType,
|
|
@@ -67428,7 +67361,7 @@ var SitePluginWizard = ({
|
|
|
67428
67361
|
}
|
|
67429
67362
|
));
|
|
67430
67363
|
},
|
|
67431
|
-
Loading: () => /* @__PURE__ */
|
|
67364
|
+
Loading: () => /* @__PURE__ */ import_react34.default.createElement(Spinner, { text: `Generating ${extensionType}...` }),
|
|
67432
67365
|
Error: () => null,
|
|
67433
67366
|
NotRequested: () => null
|
|
67434
67367
|
}),
|
|
@@ -67445,10 +67378,10 @@ var SitePluginWizard = ({
|
|
|
67445
67378
|
var GenerateSitePlugin = () => {
|
|
67446
67379
|
const { getWidgetPlugins } = useExtensionDataClient();
|
|
67447
67380
|
const { status } = useAsync(getWidgetPlugins, []);
|
|
67448
|
-
return (0,
|
|
67381
|
+
return (0, import_variant9.match)(status, {
|
|
67449
67382
|
Error: () => null,
|
|
67450
|
-
Loading: () => /* @__PURE__ */
|
|
67451
|
-
Success: ({ result }) => /* @__PURE__ */
|
|
67383
|
+
Loading: () => /* @__PURE__ */ import_react35.default.createElement(Spinner, { text: "Loading..." }),
|
|
67384
|
+
Success: ({ result }) => /* @__PURE__ */ import_react35.default.createElement(SitePluginWizard, { widgetPlugins: result })
|
|
67452
67385
|
});
|
|
67453
67386
|
};
|
|
67454
67387
|
|
|
@@ -67456,7 +67389,7 @@ var GenerateSitePlugin = () => {
|
|
|
67456
67389
|
var FlowSelector = ({ onSubmit, generateFlow, generateFlows }) => {
|
|
67457
67390
|
const bi = useWixCliAstroBi();
|
|
67458
67391
|
const { goToNextStep, isActive } = useWizardStep();
|
|
67459
|
-
const selectFlow = (0,
|
|
67392
|
+
const selectFlow = (0, import_react36.useCallback)(
|
|
67460
67393
|
(selectedType) => {
|
|
67461
67394
|
bi.cliFlowStepAnswered({
|
|
67462
67395
|
question: "What kind of extension would you like to generate?",
|
|
@@ -67468,10 +67401,10 @@ var FlowSelector = ({ onSubmit, generateFlow, generateFlows }) => {
|
|
|
67468
67401
|
},
|
|
67469
67402
|
[bi, onSubmit, goToNextStep]
|
|
67470
67403
|
);
|
|
67471
|
-
(0,
|
|
67404
|
+
(0, import_react36.useEffect)(() => {
|
|
67472
67405
|
goToNextStep();
|
|
67473
67406
|
}, []);
|
|
67474
|
-
return /* @__PURE__ */
|
|
67407
|
+
return /* @__PURE__ */ import_react36.default.createElement(
|
|
67475
67408
|
SelectGroupsInput,
|
|
67476
67409
|
{
|
|
67477
67410
|
value: !isActive ? InputState.Submitted(generateFlow) : InputState.NotSubmitted(generateFlow),
|
|
@@ -67482,9 +67415,7 @@ var FlowSelector = ({ onSubmit, generateFlow, generateFlows }) => {
|
|
|
67482
67415
|
}
|
|
67483
67416
|
);
|
|
67484
67417
|
};
|
|
67485
|
-
var GenerateCommand = ({
|
|
67486
|
-
docsExtensionType
|
|
67487
|
-
}) => {
|
|
67418
|
+
var GenerateCommand = ({ docsExtensionType, experimental = false }) => {
|
|
67488
67419
|
const bi = useWixCliAstroBi();
|
|
67489
67420
|
const dashboardPageSteps = useGenerateDashboardPage();
|
|
67490
67421
|
const dashboardModalSteps = useGenerateDashboardModal();
|
|
@@ -67493,8 +67424,8 @@ var GenerateCommand = ({
|
|
|
67493
67424
|
const generateServicePluginSteps = useGenerateServicePlugin();
|
|
67494
67425
|
const generateEmbeddedScriptSteps = useGenerateEmbeddedScript();
|
|
67495
67426
|
const generateCustomElementSteps = useGenerateCustomElement();
|
|
67496
|
-
const
|
|
67497
|
-
const biCliFlowStepAnswered = (0,
|
|
67427
|
+
const generateEditorReactComponentSteps = useGenerateEditorReactComponent();
|
|
67428
|
+
const biCliFlowStepAnswered = (0, import_react36.useCallback)(
|
|
67498
67429
|
(selectedType) => {
|
|
67499
67430
|
bi.cliFlowStepAnswered({
|
|
67500
67431
|
question: "What kind of extension would you like to generate?",
|
|
@@ -67504,7 +67435,7 @@ var GenerateCommand = ({
|
|
|
67504
67435
|
},
|
|
67505
67436
|
[bi]
|
|
67506
67437
|
);
|
|
67507
|
-
const [generateFlow, setGenerateFlow] = (0,
|
|
67438
|
+
const [generateFlow, setGenerateFlow] = (0, import_react36.useState)(() => {
|
|
67508
67439
|
if (docsExtensionType) {
|
|
67509
67440
|
const selectedType = getGenerateFlowByDocsExtensionType(docsExtensionType);
|
|
67510
67441
|
biCliFlowStepAnswered(selectedType);
|
|
@@ -67512,16 +67443,16 @@ var GenerateCommand = ({
|
|
|
67512
67443
|
}
|
|
67513
67444
|
return;
|
|
67514
67445
|
});
|
|
67515
|
-
const generateFlows = useGenerateFlows();
|
|
67516
|
-
const selectFlow = (0,
|
|
67446
|
+
const generateFlows = useGenerateFlows({ experimental });
|
|
67447
|
+
const selectFlow = (0, import_react36.useCallback)(
|
|
67517
67448
|
(selectedType) => {
|
|
67518
67449
|
biCliFlowStepAnswered(selectedType);
|
|
67519
67450
|
setGenerateFlow(selectedType);
|
|
67520
67451
|
},
|
|
67521
67452
|
[biCliFlowStepAnswered]
|
|
67522
67453
|
);
|
|
67523
|
-
const shouldEditFlow = (0,
|
|
67524
|
-
return /* @__PURE__ */
|
|
67454
|
+
const shouldEditFlow = (0, import_variant10.isType)(generateFlow?.value, "DashboardPage") || (0, import_variant10.isType)(generateFlow?.value, "DashboardModal") || (0, import_variant10.isType)(generateFlow?.value, "ServicePlugin") || (0, import_variant10.isType)(generateFlow?.value, "Event") || (0, import_variant10.isType)(generateFlow?.value, "EmbeddedScript") || (0, import_variant10.isType)(generateFlow?.value, "CustomElement") || (0, import_variant10.isType)(generateFlow?.value, "DataCollection") || (0, import_variant10.isType)(generateFlow?.value, "EditorReactComponent");
|
|
67455
|
+
return /* @__PURE__ */ import_react36.default.createElement(Box_default, { flexDirection: "column", paddingTop: 1 }, !shouldEditFlow && /* @__PURE__ */ import_react36.default.createElement(
|
|
67525
67456
|
SelectGroupsInput,
|
|
67526
67457
|
{
|
|
67527
67458
|
value: generateFlow ? InputState.Submitted(generateFlow) : InputState.NotSubmitted(generateFlow),
|
|
@@ -67530,15 +67461,15 @@ var GenerateCommand = ({
|
|
|
67530
67461
|
onSubmit: selectFlow,
|
|
67531
67462
|
maxHeight: 15
|
|
67532
67463
|
}
|
|
67533
|
-
), generateFlow && (0,
|
|
67464
|
+
), generateFlow && (0, import_variant10.match)(
|
|
67534
67465
|
generateFlow.value,
|
|
67535
|
-
(0,
|
|
67536
|
-
DashboardPage: () => /* @__PURE__ */
|
|
67466
|
+
(0, import_variant10.partial)({
|
|
67467
|
+
DashboardPage: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
67537
67468
|
Wizard,
|
|
67538
67469
|
{
|
|
67539
67470
|
name: generateFlow.value.type,
|
|
67540
67471
|
steps: [
|
|
67541
|
-
/* @__PURE__ */
|
|
67472
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
67542
67473
|
FlowSelector,
|
|
67543
67474
|
{
|
|
67544
67475
|
generateFlows,
|
|
@@ -67550,12 +67481,12 @@ var GenerateCommand = ({
|
|
|
67550
67481
|
]
|
|
67551
67482
|
}
|
|
67552
67483
|
),
|
|
67553
|
-
DashboardModal: () => /* @__PURE__ */
|
|
67484
|
+
DashboardModal: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
67554
67485
|
Wizard,
|
|
67555
67486
|
{
|
|
67556
67487
|
name: generateFlow.value.type,
|
|
67557
67488
|
steps: [
|
|
67558
|
-
/* @__PURE__ */
|
|
67489
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
67559
67490
|
FlowSelector,
|
|
67560
67491
|
{
|
|
67561
67492
|
generateFlows,
|
|
@@ -67567,12 +67498,12 @@ var GenerateCommand = ({
|
|
|
67567
67498
|
]
|
|
67568
67499
|
}
|
|
67569
67500
|
),
|
|
67570
|
-
ServicePlugin: () => /* @__PURE__ */
|
|
67501
|
+
ServicePlugin: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
67571
67502
|
Wizard,
|
|
67572
67503
|
{
|
|
67573
67504
|
name: generateFlow.value.type,
|
|
67574
67505
|
steps: [
|
|
67575
|
-
/* @__PURE__ */
|
|
67506
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
67576
67507
|
FlowSelector,
|
|
67577
67508
|
{
|
|
67578
67509
|
generateFlows,
|
|
@@ -67584,12 +67515,12 @@ var GenerateCommand = ({
|
|
|
67584
67515
|
]
|
|
67585
67516
|
}
|
|
67586
67517
|
),
|
|
67587
|
-
Event: () => /* @__PURE__ */
|
|
67518
|
+
Event: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
67588
67519
|
Wizard,
|
|
67589
67520
|
{
|
|
67590
67521
|
name: generateFlow.value.type,
|
|
67591
67522
|
steps: [
|
|
67592
|
-
/* @__PURE__ */
|
|
67523
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
67593
67524
|
FlowSelector,
|
|
67594
67525
|
{
|
|
67595
67526
|
generateFlows,
|
|
@@ -67601,12 +67532,12 @@ var GenerateCommand = ({
|
|
|
67601
67532
|
]
|
|
67602
67533
|
}
|
|
67603
67534
|
),
|
|
67604
|
-
DataCollection: () => /* @__PURE__ */
|
|
67535
|
+
DataCollection: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
67605
67536
|
Wizard,
|
|
67606
67537
|
{
|
|
67607
67538
|
name: generateFlow.value.type,
|
|
67608
67539
|
steps: [
|
|
67609
|
-
/* @__PURE__ */
|
|
67540
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
67610
67541
|
FlowSelector,
|
|
67611
67542
|
{
|
|
67612
67543
|
generateFlows,
|
|
@@ -67618,12 +67549,12 @@ var GenerateCommand = ({
|
|
|
67618
67549
|
]
|
|
67619
67550
|
}
|
|
67620
67551
|
),
|
|
67621
|
-
EmbeddedScript: () => /* @__PURE__ */
|
|
67552
|
+
EmbeddedScript: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
67622
67553
|
Wizard,
|
|
67623
67554
|
{
|
|
67624
67555
|
name: generateFlow.value.type,
|
|
67625
67556
|
steps: [
|
|
67626
|
-
/* @__PURE__ */
|
|
67557
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
67627
67558
|
FlowSelector,
|
|
67628
67559
|
{
|
|
67629
67560
|
generateFlows,
|
|
@@ -67635,12 +67566,12 @@ var GenerateCommand = ({
|
|
|
67635
67566
|
]
|
|
67636
67567
|
}
|
|
67637
67568
|
),
|
|
67638
|
-
CustomElement: () => /* @__PURE__ */
|
|
67569
|
+
CustomElement: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
67639
67570
|
Wizard,
|
|
67640
67571
|
{
|
|
67641
67572
|
name: generateFlow.value.type,
|
|
67642
67573
|
steps: [
|
|
67643
|
-
/* @__PURE__ */
|
|
67574
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
67644
67575
|
FlowSelector,
|
|
67645
67576
|
{
|
|
67646
67577
|
generateFlows,
|
|
@@ -67652,13 +67583,12 @@ var GenerateCommand = ({
|
|
|
67652
67583
|
]
|
|
67653
67584
|
}
|
|
67654
67585
|
),
|
|
67655
|
-
|
|
67656
|
-
SiteWidget: () => /* @__PURE__ */ import_react37.default.createElement(
|
|
67586
|
+
EditorReactComponent: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
67657
67587
|
Wizard,
|
|
67658
67588
|
{
|
|
67659
67589
|
name: generateFlow.value.type,
|
|
67660
67590
|
steps: [
|
|
67661
|
-
/* @__PURE__ */
|
|
67591
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
67662
67592
|
FlowSelector,
|
|
67663
67593
|
{
|
|
67664
67594
|
generateFlows,
|
|
@@ -67666,12 +67596,13 @@ var GenerateCommand = ({
|
|
|
67666
67596
|
onSubmit: setGenerateFlow
|
|
67667
67597
|
}
|
|
67668
67598
|
),
|
|
67669
|
-
...
|
|
67599
|
+
...generateEditorReactComponentSteps
|
|
67670
67600
|
]
|
|
67671
67601
|
}
|
|
67672
67602
|
),
|
|
67673
|
-
|
|
67674
|
-
|
|
67603
|
+
SitePlugin: () => /* @__PURE__ */ import_react36.default.createElement(GenerateSitePlugin, null),
|
|
67604
|
+
DashboardPlugin: () => /* @__PURE__ */ import_react36.default.createElement(DashboardPlugin, { flow: generateFlow.value }),
|
|
67605
|
+
DashboardMenuPlugin: () => /* @__PURE__ */ import_react36.default.createElement(DashboardPlugin, { flow: generateFlow.value }),
|
|
67675
67606
|
default: () => null
|
|
67676
67607
|
})
|
|
67677
67608
|
));
|
|
@@ -67690,4 +67621,4 @@ ejs/lib/ejs.js:
|
|
|
67690
67621
|
* @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
|
|
67691
67622
|
*)
|
|
67692
67623
|
*/
|
|
67693
|
-
//# sourceMappingURL=GenerateCommand-
|
|
67624
|
+
//# sourceMappingURL=GenerateCommand-HBDOFKE3.js.map
|