@wix/cli 1.1.180 → 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/{GenerateCommand-7GNP63UH.js → GenerateCommand-HBDOFKE3.js} +590 -666
- package/build/GenerateCommand-HBDOFKE3.js.map +1 -0
- package/build/{LoginCommand-YP7I2SNP.js → LoginCommand-SANEWDRO.js} +2 -2
- package/build/{chunk-AQ3JNRRK.js → chunk-EGTKQWHU.js} +2 -2
- package/build/{chunk-AQ3JNRRK.js.map → chunk-EGTKQWHU.js.map} +1 -1
- package/build/{chunk-G4TDZ7KU.js → chunk-EKGT7TUO.js} +2 -2
- package/build/{chunk-L5MY6I2S.js → chunk-S526I3JY.js} +21 -10
- package/build/chunk-S526I3JY.js.map +1 -0
- package/build/index.js +7 -7
- package/build/{render-command-2XQJZBJS.js → render-command-S6YTS5JS.js} +3 -3
- package/build/{src-4VQLBTIZ.js → src-7WIVSBG4.js} +10 -5
- package/build/src-7WIVSBG4.js.map +1 -0
- 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/GenerateCommand-7GNP63UH.js.map +0 -1
- package/build/chunk-L5MY6I2S.js.map +0 -1
- package/build/src-4VQLBTIZ.js.map +0 -1
- package/templates/astro/react-component/files/component.tsx.ejs +0 -19
- /package/build/{LoginCommand-YP7I2SNP.js.map → LoginCommand-SANEWDRO.js.map} +0 -0
- /package/build/{chunk-G4TDZ7KU.js.map → chunk-EKGT7TUO.js.map} +0 -0
- /package/build/{render-command-2XQJZBJS.js.map → render-command-S6YTS5JS.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";
|
|
@@ -408,8 +408,8 @@ function encode_char(c) {
|
|
|
408
408
|
}
|
|
409
409
|
};
|
|
410
410
|
exports.hyphenToCamel = function(str) {
|
|
411
|
-
return str.replace(/-[a-z]/g, function(
|
|
412
|
-
return
|
|
411
|
+
return str.replace(/-[a-z]/g, function(match11) {
|
|
412
|
+
return match11[1].toUpperCase();
|
|
413
413
|
});
|
|
414
414
|
};
|
|
415
415
|
exports.createNullProtoObjWherePossible = function() {
|
|
@@ -547,8 +547,8 @@ var require_ejs = __commonJS({
|
|
|
547
547
|
var includePath;
|
|
548
548
|
var filePath;
|
|
549
549
|
var views = options.views;
|
|
550
|
-
var
|
|
551
|
-
if (
|
|
550
|
+
var match11 = /^[A-Za-z]+:\\|^\//.exec(path15);
|
|
551
|
+
if (match11 && match11.length) {
|
|
552
552
|
path15 = path15.replace(/^\/*/, "");
|
|
553
553
|
if (Array.isArray(options.root)) {
|
|
554
554
|
includePath = resolvePaths(path15, options.root);
|
|
@@ -1746,31 +1746,31 @@ var require_timestamp = __commonJS({
|
|
|
1746
1746
|
return false;
|
|
1747
1747
|
}
|
|
1748
1748
|
function constructYamlTimestamp(data) {
|
|
1749
|
-
var
|
|
1750
|
-
|
|
1751
|
-
if (
|
|
1752
|
-
if (
|
|
1753
|
-
year = +
|
|
1754
|
-
month = +
|
|
1755
|
-
day = +
|
|
1756
|
-
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]) {
|
|
1757
1757
|
return new Date(Date.UTC(year, month, day));
|
|
1758
1758
|
}
|
|
1759
|
-
hour = +
|
|
1760
|
-
minute = +
|
|
1761
|
-
second = +
|
|
1762
|
-
if (
|
|
1763
|
-
fraction =
|
|
1759
|
+
hour = +match11[4];
|
|
1760
|
+
minute = +match11[5];
|
|
1761
|
+
second = +match11[6];
|
|
1762
|
+
if (match11[7]) {
|
|
1763
|
+
fraction = match11[7].slice(0, 3);
|
|
1764
1764
|
while (fraction.length < 3) {
|
|
1765
1765
|
fraction += "0";
|
|
1766
1766
|
}
|
|
1767
1767
|
fraction = +fraction;
|
|
1768
1768
|
}
|
|
1769
|
-
if (
|
|
1770
|
-
tz_hour = +
|
|
1771
|
-
tz_minute = +(
|
|
1769
|
+
if (match11[9]) {
|
|
1770
|
+
tz_hour = +match11[10];
|
|
1771
|
+
tz_minute = +(match11[11] || 0);
|
|
1772
1772
|
delta = (tz_hour * 60 + tz_minute) * 6e4;
|
|
1773
|
-
if (
|
|
1773
|
+
if (match11[9] === "-") delta = -delta;
|
|
1774
1774
|
}
|
|
1775
1775
|
date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
|
1776
1776
|
if (delta) date.setTime(date.getTime() - delta);
|
|
@@ -2295,19 +2295,19 @@ var require_loader = __commonJS({
|
|
|
2295
2295
|
}
|
|
2296
2296
|
var directiveHandlers = {
|
|
2297
2297
|
YAML: function handleYamlDirective(state, name, args) {
|
|
2298
|
-
var
|
|
2298
|
+
var match11, major, minor;
|
|
2299
2299
|
if (state.version !== null) {
|
|
2300
2300
|
throwError(state, "duplication of %YAML directive");
|
|
2301
2301
|
}
|
|
2302
2302
|
if (args.length !== 1) {
|
|
2303
2303
|
throwError(state, "YAML directive accepts exactly one argument");
|
|
2304
2304
|
}
|
|
2305
|
-
|
|
2306
|
-
if (
|
|
2305
|
+
match11 = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
|
2306
|
+
if (match11 === null) {
|
|
2307
2307
|
throwError(state, "ill-formed argument of the YAML directive");
|
|
2308
2308
|
}
|
|
2309
|
-
major = parseInt(
|
|
2310
|
-
minor = parseInt(
|
|
2309
|
+
major = parseInt(match11[1], 10);
|
|
2310
|
+
minor = parseInt(match11[2], 10);
|
|
2311
2311
|
if (major !== 1) {
|
|
2312
2312
|
throwError(state, "unacceptable YAML version of the document");
|
|
2313
2313
|
}
|
|
@@ -3554,9 +3554,9 @@ var require_dumper = __commonJS({
|
|
|
3554
3554
|
}();
|
|
3555
3555
|
var prevMoreIndented = string[0] === "\n" || string[0] === " ";
|
|
3556
3556
|
var moreIndented;
|
|
3557
|
-
var
|
|
3558
|
-
while (
|
|
3559
|
-
var prefix =
|
|
3557
|
+
var match11;
|
|
3558
|
+
while (match11 = lineRe.exec(string)) {
|
|
3559
|
+
var prefix = match11[1], line = match11[2];
|
|
3560
3560
|
moreIndented = line[0] === " ";
|
|
3561
3561
|
result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
|
|
3562
3562
|
prevMoreIndented = moreIndented;
|
|
@@ -3566,11 +3566,11 @@ var require_dumper = __commonJS({
|
|
|
3566
3566
|
function foldLine(line, width) {
|
|
3567
3567
|
if (line === "" || line[0] === " ") return line;
|
|
3568
3568
|
var breakRe = / [^ ]/g;
|
|
3569
|
-
var
|
|
3569
|
+
var match11;
|
|
3570
3570
|
var start = 0, end, curr = 0, next = 0;
|
|
3571
3571
|
var result = "";
|
|
3572
|
-
while (
|
|
3573
|
-
next =
|
|
3572
|
+
while (match11 = breakRe.exec(line)) {
|
|
3573
|
+
next = match11.index;
|
|
3574
3574
|
if (next - start > width) {
|
|
3575
3575
|
end = curr > start ? curr : next;
|
|
3576
3576
|
result += "\n" + line.slice(start, end);
|
|
@@ -3907,10 +3907,10 @@ var require_front_matter = __commonJS({
|
|
|
3907
3907
|
};
|
|
3908
3908
|
}
|
|
3909
3909
|
}
|
|
3910
|
-
function computeLocation(
|
|
3910
|
+
function computeLocation(match11, body) {
|
|
3911
3911
|
var line = 1;
|
|
3912
3912
|
var pos = body.indexOf("\n");
|
|
3913
|
-
var offset =
|
|
3913
|
+
var offset = match11.index + match11[0].length;
|
|
3914
3914
|
while (pos !== -1) {
|
|
3915
3915
|
if (pos >= offset) {
|
|
3916
3916
|
return line;
|
|
@@ -3921,8 +3921,8 @@ var require_front_matter = __commonJS({
|
|
|
3921
3921
|
return line;
|
|
3922
3922
|
}
|
|
3923
3923
|
function parse(string, allowUnsafe) {
|
|
3924
|
-
var
|
|
3925
|
-
if (!
|
|
3924
|
+
var match11 = regex.exec(string);
|
|
3925
|
+
if (!match11) {
|
|
3926
3926
|
return {
|
|
3927
3927
|
attributes: {},
|
|
3928
3928
|
body: string,
|
|
@@ -3930,10 +3930,10 @@ var require_front_matter = __commonJS({
|
|
|
3930
3930
|
};
|
|
3931
3931
|
}
|
|
3932
3932
|
var loader = allowUnsafe ? parser.load : parser.safeLoad;
|
|
3933
|
-
var yaml =
|
|
3933
|
+
var yaml = match11[match11.length - 1].replace(/^\s+|\s+$/g, "");
|
|
3934
3934
|
var attributes = loader(yaml) || {};
|
|
3935
|
-
var body = string.replace(
|
|
3936
|
-
var line = computeLocation(
|
|
3935
|
+
var body = string.replace(match11[0], "");
|
|
3936
|
+
var line = computeLocation(match11, string);
|
|
3937
3937
|
return {
|
|
3938
3938
|
attributes,
|
|
3939
3939
|
body,
|
|
@@ -9464,8 +9464,8 @@ var require_lib2 = __commonJS({
|
|
|
9464
9464
|
default:
|
|
9465
9465
|
if (ch >= 48 && ch <= 55) {
|
|
9466
9466
|
const startPos = pos - 1;
|
|
9467
|
-
const
|
|
9468
|
-
let octalStr =
|
|
9467
|
+
const match11 = /^[0-7]+/.exec(input.slice(startPos, pos + 2));
|
|
9468
|
+
let octalStr = match11[0];
|
|
9469
9469
|
let octal = parseInt(octalStr, 8);
|
|
9470
9470
|
if (octal > 255) {
|
|
9471
9471
|
octalStr = octalStr.slice(0, -1);
|
|
@@ -57978,7 +57978,7 @@ var require_core4 = __commonJS({
|
|
|
57978
57978
|
}
|
|
57979
57979
|
return fromAST(recast.parse(source, options));
|
|
57980
57980
|
}
|
|
57981
|
-
function
|
|
57981
|
+
function match11(path14, filter) {
|
|
57982
57982
|
if (!(path14 instanceof NodePath)) {
|
|
57983
57983
|
if (typeof path14.get === "function") {
|
|
57984
57984
|
path14 = path14.get();
|
|
@@ -58014,7 +58014,7 @@ var require_core4 = __commonJS({
|
|
|
58014
58014
|
Object.assign(core2, recast.types.builders);
|
|
58015
58015
|
core2.registerMethods = Collection.registerMethods;
|
|
58016
58016
|
core2.types = recast.types;
|
|
58017
|
-
core2.match =
|
|
58017
|
+
core2.match = match11;
|
|
58018
58018
|
core2.template = template(parser);
|
|
58019
58019
|
core2.filters = {};
|
|
58020
58020
|
core2.mappings = {};
|
|
@@ -59786,8 +59786,8 @@ var require_stringToPath = __commonJS({
|
|
|
59786
59786
|
if (string.charCodeAt(0) === 46) {
|
|
59787
59787
|
result.push("");
|
|
59788
59788
|
}
|
|
59789
|
-
string.replace(rePropName, function(
|
|
59790
|
-
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);
|
|
59791
59791
|
});
|
|
59792
59792
|
return result;
|
|
59793
59793
|
});
|
|
@@ -60229,8 +60229,8 @@ init_esm_shims();
|
|
|
60229
60229
|
|
|
60230
60230
|
// ../cli-astro-commands/src/components/GenerateCommand/GenerateCommand.tsx
|
|
60231
60231
|
init_esm_shims();
|
|
60232
|
-
var
|
|
60233
|
-
var
|
|
60232
|
+
var import_react36 = __toESM(require_react(), 1);
|
|
60233
|
+
var import_variant10 = __toESM(require_lib(), 1);
|
|
60234
60234
|
|
|
60235
60235
|
// ../cli-astro-commands/src/components/GenerateCommand/dashboard-page/DashboardPage.tsx
|
|
60236
60236
|
init_esm_shims();
|
|
@@ -60333,7 +60333,7 @@ function getFiles(cwd) {
|
|
|
60333
60333
|
// ../gena/src/generator.ts
|
|
60334
60334
|
var fm = import_front_matter.default;
|
|
60335
60335
|
function shouldSkipParsing(file) {
|
|
60336
|
-
return [".png", ".jpg", ".gif", ".astro", ".zip"].includes(
|
|
60336
|
+
return [".png", ".jpg", ".gif", ".astro", ".zip", ".css"].includes(
|
|
60337
60337
|
extname(file).toLowerCase()
|
|
60338
60338
|
);
|
|
60339
60339
|
}
|
|
@@ -61801,457 +61801,20 @@ var useGenerateEmbeddedScript = () => {
|
|
|
61801
61801
|
];
|
|
61802
61802
|
};
|
|
61803
61803
|
|
|
61804
|
-
// ../cli-astro-commands/src/components/GenerateCommand/
|
|
61804
|
+
// ../cli-astro-commands/src/components/GenerateCommand/data-collections/DataCollection.tsx
|
|
61805
61805
|
init_esm_shims();
|
|
61806
61806
|
var import_react18 = __toESM(require_react(), 1);
|
|
61807
61807
|
|
|
61808
|
-
// ../cli-astro-commands/src/components/GenerateCommand/
|
|
61808
|
+
// ../cli-astro-commands/src/components/GenerateCommand/data-collections/generate.ts
|
|
61809
61809
|
init_esm_shims();
|
|
61810
|
-
var
|
|
61810
|
+
var import_camelCase6 = __toESM(require_camelCase(), 1);
|
|
61811
61811
|
import path7 from "node:path";
|
|
61812
61812
|
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
61813
|
-
var CUSTOM_ELEMENT_TEMPLATE = path7.resolve(
|
|
61814
|
-
__dirname,
|
|
61815
|
-
"../templates/astro/custom-element"
|
|
61816
|
-
);
|
|
61817
|
-
async function generateCustomElement(projectFolder, route, name, dashboardPageId) {
|
|
61818
|
-
const cwd = getSiteWidgetExtensionPath(projectFolder, route);
|
|
61819
|
-
const {
|
|
61820
|
-
relativePathToCodeFile,
|
|
61821
|
-
relativePathToConfigFile,
|
|
61822
|
-
relativePathToExtensionDir
|
|
61823
|
-
} = getExtensionRelativePaths({
|
|
61824
|
-
cwd,
|
|
61825
|
-
projectFolder,
|
|
61826
|
-
extensionFileName: route,
|
|
61827
|
-
codeFileType: "tsx"
|
|
61828
|
-
});
|
|
61829
|
-
const relativePathToSettingsFile = `./${toPosix(
|
|
61830
|
-
path7.join(relativePathToExtensionDir, `${route}.panel.tsx`)
|
|
61831
|
-
)}`;
|
|
61832
|
-
const config = {
|
|
61833
|
-
id: randomUUID5(),
|
|
61834
|
-
name,
|
|
61835
|
-
dashboardPageId,
|
|
61836
|
-
presetId: randomUUID5(),
|
|
61837
|
-
element: relativePathToCodeFile,
|
|
61838
|
-
settings: relativePathToSettingsFile
|
|
61839
|
-
};
|
|
61840
|
-
await modifyExtensionsEntry(
|
|
61841
|
-
projectFolder,
|
|
61842
|
-
(0, import_camelCase5.default)(route),
|
|
61843
|
-
relativePathToConfigFile
|
|
61844
|
-
);
|
|
61845
|
-
return await componentGenerator({
|
|
61846
|
-
template: CUSTOM_ELEMENT_TEMPLATE,
|
|
61847
|
-
assetsOutputPath: "public",
|
|
61848
|
-
assetsPrefix: route,
|
|
61849
|
-
projectFolder,
|
|
61850
|
-
cwd,
|
|
61851
|
-
data: {
|
|
61852
|
-
route,
|
|
61853
|
-
config
|
|
61854
|
-
}
|
|
61855
|
-
});
|
|
61856
|
-
}
|
|
61857
|
-
|
|
61858
|
-
// ../cli-astro-commands/src/components/GenerateCommand/custom-element/steps.tsx
|
|
61859
|
-
init_esm_shims();
|
|
61860
|
-
var import_react17 = __toESM(require_react(), 1);
|
|
61861
|
-
var import_kebabCase4 = __toESM(require_kebabCase(), 1);
|
|
61862
|
-
var ChooseElementNameStep = ({ onSubmit, elementName }) => {
|
|
61863
|
-
const bi = useWixCliAstroBi();
|
|
61864
|
-
const { isActive, goToNextStep } = useWizardStep();
|
|
61865
|
-
const validateName = useCustomElementNameValidation();
|
|
61866
|
-
return /* @__PURE__ */ import_react17.default.createElement(
|
|
61867
|
-
TextInput,
|
|
61868
|
-
{
|
|
61869
|
-
isActive,
|
|
61870
|
-
label: "Element name:",
|
|
61871
|
-
placeholder: elementName ?? "My Element",
|
|
61872
|
-
onSubmit: (value) => {
|
|
61873
|
-
bi.cliFlowStepAnswered({
|
|
61874
|
-
question: "Element name:",
|
|
61875
|
-
questionKey: "generate_command.custom_element.choose_name",
|
|
61876
|
-
answer: value,
|
|
61877
|
-
additionalInfo: { extensionType: "custom element" }
|
|
61878
|
-
});
|
|
61879
|
-
onSubmit(value);
|
|
61880
|
-
goToNextStep();
|
|
61881
|
-
},
|
|
61882
|
-
validate: validateName
|
|
61883
|
-
}
|
|
61884
|
-
);
|
|
61885
|
-
};
|
|
61886
|
-
var ChooseElementFolderStep = ({ onSubmit, elementFolder, elementName }) => {
|
|
61887
|
-
const { model } = useProjectModel();
|
|
61888
|
-
const bi = useWixCliAstroBi();
|
|
61889
|
-
const { isActive, goToNextStep } = useWizardStep();
|
|
61890
|
-
const defaultElementFolder = (0, import_kebabCase4.default)(elementName);
|
|
61891
|
-
const validateElementFolder = useValidation(
|
|
61892
|
-
createCustomElementFolderValidation(
|
|
61893
|
-
getSiteWidgetExtensionsDir(model.projectFolder)
|
|
61894
|
-
)
|
|
61895
|
-
);
|
|
61896
|
-
return /* @__PURE__ */ import_react17.default.createElement(
|
|
61897
|
-
TextInput,
|
|
61898
|
-
{
|
|
61899
|
-
isActive,
|
|
61900
|
-
label: "Enter the folder for the new element:",
|
|
61901
|
-
placeholder: elementFolder ?? defaultElementFolder,
|
|
61902
|
-
onSubmit: (value) => {
|
|
61903
|
-
bi.cliFlowStepAnswered({
|
|
61904
|
-
question: "Enter the folder for the new element:",
|
|
61905
|
-
questionKey: "generate_command.custom_element.choose_folder",
|
|
61906
|
-
answer: value,
|
|
61907
|
-
additionalInfo: { extensionType: "custom element" }
|
|
61908
|
-
});
|
|
61909
|
-
onSubmit(value);
|
|
61910
|
-
goToNextStep();
|
|
61911
|
-
},
|
|
61912
|
-
validate: validateElementFolder
|
|
61913
|
-
}
|
|
61914
|
-
);
|
|
61915
|
-
};
|
|
61916
|
-
var LinkDashboardPageStep = ({ onSubmit }) => {
|
|
61917
|
-
const bi = useWixCliAstroBi();
|
|
61918
|
-
const { isActive, goToNextStep } = useWizardStep();
|
|
61919
|
-
return /* @__PURE__ */ import_react17.default.createElement(Box_default, { marginBottom: 1 }, /* @__PURE__ */ import_react17.default.createElement(
|
|
61920
|
-
ConfirmInput,
|
|
61921
|
-
{
|
|
61922
|
-
isActive,
|
|
61923
|
-
label: "Link dashboard page to custom element?",
|
|
61924
|
-
onSubmit: (shouldLinkDashboardPage) => {
|
|
61925
|
-
bi.cliFlowStepAnswered({
|
|
61926
|
-
question: "Link dashboard page to custom element?",
|
|
61927
|
-
questionKey: "generate_command.custom_element.link_dashboard_page",
|
|
61928
|
-
answer: String(shouldLinkDashboardPage),
|
|
61929
|
-
additionalInfo: { extensionType: "custom element" }
|
|
61930
|
-
});
|
|
61931
|
-
onSubmit(shouldLinkDashboardPage);
|
|
61932
|
-
goToNextStep();
|
|
61933
|
-
}
|
|
61934
|
-
}
|
|
61935
|
-
));
|
|
61936
|
-
};
|
|
61937
|
-
var ChooseDashboardPageStep = ({ onSubmit }) => {
|
|
61938
|
-
const bi = useWixCliAstroBi();
|
|
61939
|
-
const { isActive, goToNextStep } = useWizardStep();
|
|
61940
|
-
const validatePageId = useValidation(
|
|
61941
|
-
composeValidations([
|
|
61942
|
-
[uuidValidation, "Page id has to be in the format of a uuid"]
|
|
61943
|
-
])
|
|
61944
|
-
);
|
|
61945
|
-
return /* @__PURE__ */ import_react17.default.createElement(
|
|
61946
|
-
TextInput,
|
|
61947
|
-
{
|
|
61948
|
-
isActive,
|
|
61949
|
-
label: "Dashboard page id:",
|
|
61950
|
-
onSubmit: (value) => {
|
|
61951
|
-
bi.cliFlowStepAnswered({
|
|
61952
|
-
question: "Dashboard page id:",
|
|
61953
|
-
questionKey: "generate_command.custom_element.choose_dashboard_page_id",
|
|
61954
|
-
answer: value,
|
|
61955
|
-
additionalInfo: { extensionType: "custom element" }
|
|
61956
|
-
});
|
|
61957
|
-
onSubmit(value);
|
|
61958
|
-
goToNextStep();
|
|
61959
|
-
},
|
|
61960
|
-
validate: validatePageId
|
|
61961
|
-
}
|
|
61962
|
-
);
|
|
61963
|
-
};
|
|
61964
|
-
|
|
61965
|
-
// ../cli-astro-commands/src/components/GenerateCommand/custom-element/CustomElement.tsx
|
|
61966
|
-
var useGenerateCustomElement = () => {
|
|
61967
|
-
const { model } = useProjectModel();
|
|
61968
|
-
const [elementName, setElementName] = (0, import_react18.useState)();
|
|
61969
|
-
const [elementFolder, setElementFolder] = (0, import_react18.useState)();
|
|
61970
|
-
const [linkDashboardPage, setLinkDashboardPage] = (0, import_react18.useState)();
|
|
61971
|
-
const [dashboardPageId, setDashboardPageId] = (0, import_react18.useState)();
|
|
61972
|
-
const shouldGenerate = linkDashboardPage === false ? true : dashboardPageId;
|
|
61973
|
-
const generationTask = useGenerationTask(async () => {
|
|
61974
|
-
if (elementName && elementFolder && shouldGenerate) {
|
|
61975
|
-
return generateCustomElement(
|
|
61976
|
-
model.projectFolder,
|
|
61977
|
-
elementFolder,
|
|
61978
|
-
elementName,
|
|
61979
|
-
dashboardPageId
|
|
61980
|
-
);
|
|
61981
|
-
}
|
|
61982
|
-
}, [elementFolder, elementName, shouldGenerate]);
|
|
61983
|
-
return [
|
|
61984
|
-
/* @__PURE__ */ import_react18.default.createElement(
|
|
61985
|
-
ChooseElementNameStep,
|
|
61986
|
-
{
|
|
61987
|
-
onSubmit: setElementName,
|
|
61988
|
-
elementName
|
|
61989
|
-
}
|
|
61990
|
-
),
|
|
61991
|
-
/* @__PURE__ */ import_react18.default.createElement(
|
|
61992
|
-
ChooseElementFolderStep,
|
|
61993
|
-
{
|
|
61994
|
-
onSubmit: setElementFolder,
|
|
61995
|
-
elementFolder,
|
|
61996
|
-
elementName
|
|
61997
|
-
}
|
|
61998
|
-
),
|
|
61999
|
-
/* @__PURE__ */ import_react18.default.createElement(LinkDashboardPageStep, { onSubmit: setLinkDashboardPage }),
|
|
62000
|
-
...linkDashboardPage ? [/* @__PURE__ */ import_react18.default.createElement(ChooseDashboardPageStep, { onSubmit: setDashboardPageId })] : [],
|
|
62001
|
-
/* @__PURE__ */ import_react18.default.createElement(
|
|
62002
|
-
CompleteGeneration,
|
|
62003
|
-
{
|
|
62004
|
-
generationTask,
|
|
62005
|
-
extensionType: "custom element",
|
|
62006
|
-
successMessage: CompleteGenerationMessage.SuccessMessage({
|
|
62007
|
-
// https://dev.wix.com/docs/wix-cli/guides/extensions/site-extensions/site-widgets/add-a-site-widget-extension
|
|
62008
|
-
learnMoreUrl: "https://wix.to/6aKN8aH"
|
|
62009
|
-
})
|
|
62010
|
-
}
|
|
62011
|
-
)
|
|
62012
|
-
];
|
|
62013
|
-
};
|
|
62014
|
-
|
|
62015
|
-
// ../cli-astro-commands/src/components/GenerateCommand/site-widget/SiteWidget.tsx
|
|
62016
|
-
init_esm_shims();
|
|
62017
|
-
var import_react21 = __toESM(require_react(), 1);
|
|
62018
|
-
var import_variant4 = __toESM(require_lib(), 1);
|
|
62019
|
-
|
|
62020
|
-
// ../cli-astro-commands/src/components/GenerateCommand/react-component/ReactComponent.tsx
|
|
62021
|
-
init_esm_shims();
|
|
62022
|
-
var import_react20 = __toESM(require_react(), 1);
|
|
62023
|
-
|
|
62024
|
-
// ../cli-astro-commands/src/components/GenerateCommand/react-component/generate.ts
|
|
62025
|
-
init_esm_shims();
|
|
62026
|
-
var import_camelCase6 = __toESM(require_camelCase(), 1);
|
|
62027
|
-
var import_capitalize = __toESM(require_capitalize(), 1);
|
|
62028
|
-
import path8 from "node:path";
|
|
62029
|
-
import { randomUUID as randomUUID6 } from "node:crypto";
|
|
62030
|
-
var REACT_COMPONENT_TEMPLATE = path8.resolve(
|
|
62031
|
-
__dirname,
|
|
62032
|
-
"../templates/astro/react-component"
|
|
62033
|
-
);
|
|
62034
|
-
async function generateReactComponent(projectFolder, route, name, codeIdentifier) {
|
|
62035
|
-
const cwd = getSiteWidgetExtensionPath(projectFolder, route);
|
|
62036
|
-
const { relativePathToCodeFile, relativePathToConfigFile } = getExtensionRelativePaths({
|
|
62037
|
-
cwd,
|
|
62038
|
-
projectFolder,
|
|
62039
|
-
extensionFileName: route,
|
|
62040
|
-
codeFileType: "tsx"
|
|
62041
|
-
});
|
|
62042
|
-
const componentType = (0, import_capitalize.default)((0, import_camelCase6.default)(route));
|
|
62043
|
-
const config = {
|
|
62044
|
-
id: randomUUID6(),
|
|
62045
|
-
name,
|
|
62046
|
-
type: codeIdentifier ? `${codeIdentifier}.${componentType}` : componentType,
|
|
62047
|
-
selector: `.${route}`,
|
|
62048
|
-
codeIdentifier,
|
|
62049
|
-
component: relativePathToCodeFile
|
|
62050
|
-
};
|
|
62051
|
-
await modifyExtensionsEntry(
|
|
62052
|
-
projectFolder,
|
|
62053
|
-
(0, import_camelCase6.default)(route),
|
|
62054
|
-
relativePathToConfigFile
|
|
62055
|
-
);
|
|
62056
|
-
return await componentGenerator({
|
|
62057
|
-
template: REACT_COMPONENT_TEMPLATE,
|
|
62058
|
-
projectFolder,
|
|
62059
|
-
cwd,
|
|
62060
|
-
data: {
|
|
62061
|
-
route,
|
|
62062
|
-
config
|
|
62063
|
-
}
|
|
62064
|
-
});
|
|
62065
|
-
}
|
|
62066
|
-
|
|
62067
|
-
// ../cli-astro-commands/src/components/GenerateCommand/react-component/steps.tsx
|
|
62068
|
-
init_esm_shims();
|
|
62069
|
-
var import_react19 = __toESM(require_react(), 1);
|
|
62070
|
-
var import_kebabCase5 = __toESM(require_kebabCase(), 1);
|
|
62071
|
-
var ChooseComponentNameStep = ({ onSubmit, componentName }) => {
|
|
62072
|
-
const bi = useWixCliAstroBi();
|
|
62073
|
-
const { isActive, goToNextStep } = useWizardStep();
|
|
62074
|
-
const validateName = useReactComponentNameValidation();
|
|
62075
|
-
return /* @__PURE__ */ import_react19.default.createElement(
|
|
62076
|
-
TextInput,
|
|
62077
|
-
{
|
|
62078
|
-
isActive,
|
|
62079
|
-
label: "Enter a name for your component:",
|
|
62080
|
-
placeholder: componentName ?? "My Component",
|
|
62081
|
-
onSubmit: (value) => {
|
|
62082
|
-
bi.cliFlowStepAnswered({
|
|
62083
|
-
question: "Enter a name for your component:",
|
|
62084
|
-
questionKey: "generate_command.react_component.choose_name",
|
|
62085
|
-
answer: value,
|
|
62086
|
-
additionalInfo: { extensionType: "editor react component" }
|
|
62087
|
-
});
|
|
62088
|
-
onSubmit(value);
|
|
62089
|
-
goToNextStep();
|
|
62090
|
-
},
|
|
62091
|
-
validate: validateName
|
|
62092
|
-
}
|
|
62093
|
-
);
|
|
62094
|
-
};
|
|
62095
|
-
var ChooseComponentFolderStep = ({ onSubmit, componentFolder, componentName }) => {
|
|
62096
|
-
const { model } = useProjectModel();
|
|
62097
|
-
const bi = useWixCliAstroBi();
|
|
62098
|
-
const { isActive, goToNextStep } = useWizardStep();
|
|
62099
|
-
const defaultComponentFolder = (0, import_kebabCase5.default)(componentName);
|
|
62100
|
-
const validateComponentFolder = useReactComponentFolderValidation(
|
|
62101
|
-
getSiteWidgetExtensionsDir(model.projectFolder)
|
|
62102
|
-
);
|
|
62103
|
-
return /* @__PURE__ */ import_react19.default.createElement(
|
|
62104
|
-
TextInput,
|
|
62105
|
-
{
|
|
62106
|
-
isActive,
|
|
62107
|
-
label: "Enter the folder for the new component:",
|
|
62108
|
-
placeholder: componentFolder ?? defaultComponentFolder,
|
|
62109
|
-
onSubmit: (value) => {
|
|
62110
|
-
bi.cliFlowStepAnswered({
|
|
62111
|
-
question: "Enter the folder for the new component:",
|
|
62112
|
-
questionKey: "generate_command.react_component.choose_folder",
|
|
62113
|
-
answer: value,
|
|
62114
|
-
additionalInfo: { extensionType: "editor react component" }
|
|
62115
|
-
});
|
|
62116
|
-
onSubmit(value);
|
|
62117
|
-
goToNextStep();
|
|
62118
|
-
},
|
|
62119
|
-
validate: validateComponentFolder
|
|
62120
|
-
}
|
|
62121
|
-
);
|
|
62122
|
-
};
|
|
62123
|
-
|
|
62124
|
-
// ../cli-astro-commands/src/components/GenerateCommand/react-component/ReactComponent.tsx
|
|
62125
|
-
var useGenerateReactComponent = () => {
|
|
62126
|
-
const {
|
|
62127
|
-
model: { projectFolder }
|
|
62128
|
-
} = useProjectModel();
|
|
62129
|
-
const { codeIdentifier } = useAppConfig();
|
|
62130
|
-
const [componentName, setComponentName] = (0, import_react20.useState)();
|
|
62131
|
-
const [componentFolder, setComponentFolder] = (0, import_react20.useState)();
|
|
62132
|
-
const generationTask = useGenerationTask(async () => {
|
|
62133
|
-
if (componentName && componentFolder) {
|
|
62134
|
-
return generateReactComponent(
|
|
62135
|
-
projectFolder,
|
|
62136
|
-
componentFolder,
|
|
62137
|
-
componentName,
|
|
62138
|
-
codeIdentifier
|
|
62139
|
-
);
|
|
62140
|
-
}
|
|
62141
|
-
}, [componentFolder, componentName]);
|
|
62142
|
-
return [
|
|
62143
|
-
/* @__PURE__ */ import_react20.default.createElement(
|
|
62144
|
-
ChooseComponentNameStep,
|
|
62145
|
-
{
|
|
62146
|
-
onSubmit: setComponentName,
|
|
62147
|
-
componentName
|
|
62148
|
-
}
|
|
62149
|
-
),
|
|
62150
|
-
/* @__PURE__ */ import_react20.default.createElement(
|
|
62151
|
-
ChooseComponentFolderStep,
|
|
62152
|
-
{
|
|
62153
|
-
onSubmit: setComponentFolder,
|
|
62154
|
-
componentFolder,
|
|
62155
|
-
componentName
|
|
62156
|
-
}
|
|
62157
|
-
),
|
|
62158
|
-
/* @__PURE__ */ import_react20.default.createElement(
|
|
62159
|
-
CompleteGeneration,
|
|
62160
|
-
{
|
|
62161
|
-
generationTask,
|
|
62162
|
-
extensionType: "editor react component",
|
|
62163
|
-
successMessage: CompleteGenerationMessage.SuccessMessage({
|
|
62164
|
-
// https://dev.wix.com/docs/go-headless
|
|
62165
|
-
learnMoreUrl: "https://dev.wix.com/docs/go-headless"
|
|
62166
|
-
})
|
|
62167
|
-
}
|
|
62168
|
-
)
|
|
62169
|
-
];
|
|
62170
|
-
};
|
|
62171
|
-
|
|
62172
|
-
// ../cli-astro-commands/src/components/GenerateCommand/site-widget/SiteWidget.tsx
|
|
62173
|
-
var SiteWidgetFrameworks = (0, import_variant4.variant)({
|
|
62174
|
-
CustomElement: {},
|
|
62175
|
-
ReactComponent: {}
|
|
62176
|
-
});
|
|
62177
|
-
var FrameworkSelector = ({ onSubmit, framework, frameworks }) => {
|
|
62178
|
-
const bi = useWixCliAstroBi();
|
|
62179
|
-
const { goToNextStep, isActive } = useWizardStep();
|
|
62180
|
-
const selectFramework = (0, import_react21.useCallback)(
|
|
62181
|
-
(selectedFramework) => {
|
|
62182
|
-
bi.cliFlowStepAnswered({
|
|
62183
|
-
question: "Which framework do you want to use?",
|
|
62184
|
-
questionKey: "generate_command.site_widget.choose_framework",
|
|
62185
|
-
answer: selectedFramework.title
|
|
62186
|
-
});
|
|
62187
|
-
onSubmit(selectedFramework);
|
|
62188
|
-
goToNextStep();
|
|
62189
|
-
},
|
|
62190
|
-
[bi, onSubmit, goToNextStep]
|
|
62191
|
-
);
|
|
62192
|
-
return /* @__PURE__ */ import_react21.default.createElement(
|
|
62193
|
-
SelectInput,
|
|
62194
|
-
{
|
|
62195
|
-
value: !isActive ? InputState.Submitted(framework) : InputState.NotSubmitted(framework),
|
|
62196
|
-
label: "Which framework do you want to use?",
|
|
62197
|
-
options: frameworks,
|
|
62198
|
-
onSubmit: selectFramework
|
|
62199
|
-
}
|
|
62200
|
-
);
|
|
62201
|
-
};
|
|
62202
|
-
var useGenerateSiteWidget = () => {
|
|
62203
|
-
const generateCustomElementSteps = useGenerateCustomElement();
|
|
62204
|
-
const generateReactComponentSteps = useGenerateReactComponent();
|
|
62205
|
-
const frameworks = (0, import_react21.useMemo)(
|
|
62206
|
-
() => [
|
|
62207
|
-
{
|
|
62208
|
-
title: "Editor React Component",
|
|
62209
|
-
key: "react-component",
|
|
62210
|
-
value: SiteWidgetFrameworks.ReactComponent(),
|
|
62211
|
-
description: "a new way to add React components to the Wix editors and site (read more)"
|
|
62212
|
-
},
|
|
62213
|
-
{
|
|
62214
|
-
title: "Custom Element",
|
|
62215
|
-
key: "custom-element",
|
|
62216
|
-
value: SiteWidgetFrameworks.CustomElement()
|
|
62217
|
-
}
|
|
62218
|
-
],
|
|
62219
|
-
[]
|
|
62220
|
-
);
|
|
62221
|
-
const [framework, setFramework] = (0, import_react21.useState)(
|
|
62222
|
-
frameworks[0]
|
|
62223
|
-
);
|
|
62224
|
-
return [
|
|
62225
|
-
/* @__PURE__ */ import_react21.default.createElement(
|
|
62226
|
-
FrameworkSelector,
|
|
62227
|
-
{
|
|
62228
|
-
frameworks,
|
|
62229
|
-
framework,
|
|
62230
|
-
onSubmit: setFramework
|
|
62231
|
-
}
|
|
62232
|
-
),
|
|
62233
|
-
...(0, import_variant4.match)(framework.value, {
|
|
62234
|
-
ReactComponent: () => generateReactComponentSteps,
|
|
62235
|
-
CustomElement: () => generateCustomElementSteps,
|
|
62236
|
-
default: () => []
|
|
62237
|
-
})
|
|
62238
|
-
];
|
|
62239
|
-
};
|
|
62240
|
-
|
|
62241
|
-
// ../cli-astro-commands/src/components/GenerateCommand/data-collections/DataCollection.tsx
|
|
62242
|
-
init_esm_shims();
|
|
62243
|
-
var import_react23 = __toESM(require_react(), 1);
|
|
62244
|
-
|
|
62245
|
-
// ../cli-astro-commands/src/components/GenerateCommand/data-collections/generate.ts
|
|
62246
|
-
init_esm_shims();
|
|
62247
|
-
var import_camelCase8 = __toESM(require_camelCase(), 1);
|
|
62248
|
-
import path9 from "node:path";
|
|
62249
|
-
import { randomUUID as randomUUID7 } from "node:crypto";
|
|
62250
61813
|
|
|
62251
61814
|
// ../cli-astro-commands/src/components/GenerateCommand/data-collections/modify-data-collections-extension.ts
|
|
62252
61815
|
init_esm_shims();
|
|
62253
61816
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
62254
|
-
var
|
|
61817
|
+
var import_camelCase5 = __toESM(require_camelCase(), 1);
|
|
62255
61818
|
var import_jscodeshift2 = __toESM(require_jscodeshift(), 1);
|
|
62256
61819
|
async function modifyDataCollectionsExtension(filePath, collectionName) {
|
|
62257
61820
|
if (!await pathExists(filePath)) {
|
|
@@ -62337,7 +61900,7 @@ function ensureCollectionReference(root, j, collectionImportName) {
|
|
|
62337
61900
|
);
|
|
62338
61901
|
}
|
|
62339
61902
|
function getCollectionImportName(collectionName) {
|
|
62340
|
-
const importName = (0,
|
|
61903
|
+
const importName = (0, import_camelCase5.default)(`${collectionName}-collection`);
|
|
62341
61904
|
return /^[A-Za-z_$]/.test(importName) ? importName : `collection${importName[0]?.toUpperCase() ?? ""}${importName.slice(1)}`;
|
|
62342
61905
|
}
|
|
62343
61906
|
function getUniqueLocalName(root, j, localName) {
|
|
@@ -62354,7 +61917,7 @@ function getUniqueLocalName(root, j, localName) {
|
|
|
62354
61917
|
|
|
62355
61918
|
// ../cli-astro-commands/src/components/GenerateCommand/data-collections/generate.ts
|
|
62356
61919
|
var EXTENSION_NAME = "data-collections";
|
|
62357
|
-
var COLLECTION_TEMPLATE =
|
|
61920
|
+
var COLLECTION_TEMPLATE = path7.resolve(
|
|
62358
61921
|
__dirname,
|
|
62359
61922
|
"../templates/astro/data-collections"
|
|
62360
61923
|
);
|
|
@@ -62366,10 +61929,10 @@ async function generateDataCollection(projectFolder, collectionName) {
|
|
|
62366
61929
|
extensionFileName: EXTENSION_NAME,
|
|
62367
61930
|
codeFileType: "ts"
|
|
62368
61931
|
});
|
|
62369
|
-
const extensionFilePath =
|
|
61932
|
+
const extensionFilePath = path7.join(cwd, `${EXTENSION_NAME}.extension.ts`);
|
|
62370
61933
|
await modifyExtensionsEntry(
|
|
62371
61934
|
projectFolder,
|
|
62372
|
-
(0,
|
|
61935
|
+
(0, import_camelCase6.default)(EXTENSION_NAME),
|
|
62373
61936
|
relativePathToConfigFile
|
|
62374
61937
|
);
|
|
62375
61938
|
const extensionExists = await pathExists(extensionFilePath);
|
|
@@ -62381,7 +61944,7 @@ async function generateDataCollection(projectFolder, collectionName) {
|
|
|
62381
61944
|
extensionFileExists: extensionExists,
|
|
62382
61945
|
collectionName,
|
|
62383
61946
|
config: {
|
|
62384
|
-
id:
|
|
61947
|
+
id: randomUUID5()
|
|
62385
61948
|
}
|
|
62386
61949
|
}
|
|
62387
61950
|
});
|
|
@@ -62391,7 +61954,7 @@ async function generateDataCollection(projectFolder, collectionName) {
|
|
|
62391
61954
|
|
|
62392
61955
|
// ../cli-astro-commands/src/components/GenerateCommand/data-collections/steps.tsx
|
|
62393
61956
|
init_esm_shims();
|
|
62394
|
-
var
|
|
61957
|
+
var import_react17 = __toESM(require_react(), 1);
|
|
62395
61958
|
var ChooseCollectionStep = ({ onSubmit, collectionName }) => {
|
|
62396
61959
|
const { model } = useProjectModel();
|
|
62397
61960
|
const bi = useWixCliAstroBi();
|
|
@@ -62400,7 +61963,7 @@ var ChooseCollectionStep = ({ onSubmit, collectionName }) => {
|
|
|
62400
61963
|
model.projectFolder
|
|
62401
61964
|
);
|
|
62402
61965
|
const validateCollectionName = useDataCollectionNameValidation(collectionsDir);
|
|
62403
|
-
return /* @__PURE__ */
|
|
61966
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
62404
61967
|
TextInput,
|
|
62405
61968
|
{
|
|
62406
61969
|
isActive,
|
|
@@ -62423,21 +61986,21 @@ var ChooseCollectionStep = ({ onSubmit, collectionName }) => {
|
|
|
62423
61986
|
// ../cli-astro-commands/src/components/GenerateCommand/data-collections/DataCollection.tsx
|
|
62424
61987
|
var useGenerateDataCollection = () => {
|
|
62425
61988
|
const { model } = useProjectModel();
|
|
62426
|
-
const [collectionName, setCollectionName] = (0,
|
|
61989
|
+
const [collectionName, setCollectionName] = (0, import_react18.useState)();
|
|
62427
61990
|
const generationTask = useGenerationTask(async () => {
|
|
62428
61991
|
if (collectionName) {
|
|
62429
61992
|
return generateDataCollection(model.projectFolder, collectionName);
|
|
62430
61993
|
}
|
|
62431
61994
|
}, [model.projectFolder, collectionName]);
|
|
62432
61995
|
return [
|
|
62433
|
-
/* @__PURE__ */
|
|
61996
|
+
/* @__PURE__ */ import_react18.default.createElement(
|
|
62434
61997
|
ChooseCollectionStep,
|
|
62435
61998
|
{
|
|
62436
61999
|
onSubmit: setCollectionName,
|
|
62437
62000
|
collectionName
|
|
62438
62001
|
}
|
|
62439
62002
|
),
|
|
62440
|
-
/* @__PURE__ */
|
|
62003
|
+
/* @__PURE__ */ import_react18.default.createElement(
|
|
62441
62004
|
CompleteGeneration,
|
|
62442
62005
|
{
|
|
62443
62006
|
generationTask,
|
|
@@ -62453,8 +62016,8 @@ var useGenerateDataCollection = () => {
|
|
|
62453
62016
|
|
|
62454
62017
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/DashboardPlugin.tsx
|
|
62455
62018
|
init_esm_shims();
|
|
62456
|
-
var
|
|
62457
|
-
var
|
|
62019
|
+
var import_react27 = __toESM(require_react(), 1);
|
|
62020
|
+
var import_variant7 = __toESM(require_lib(), 1);
|
|
62458
62021
|
|
|
62459
62022
|
// ../extensions-data-client/src/index.ts
|
|
62460
62023
|
init_esm_shims();
|
|
@@ -62493,7 +62056,7 @@ var getEcomRequiredApps = async () => {
|
|
|
62493
62056
|
|
|
62494
62057
|
// ../extensions-data-client/src/useExtensionDataClient.tsx
|
|
62495
62058
|
init_esm_shims();
|
|
62496
|
-
var
|
|
62059
|
+
var import_react19 = __toESM(require_react(), 1);
|
|
62497
62060
|
|
|
62498
62061
|
// ../extensions-data-client/src/extension-data-client.ts
|
|
62499
62062
|
init_esm_shims();
|
|
@@ -66339,7 +65902,7 @@ var ExtensionDataClient = class {
|
|
|
66339
65902
|
// ../extensions-data-client/src/useExtensionDataClient.tsx
|
|
66340
65903
|
function useExtensionDataClient() {
|
|
66341
65904
|
const httpClient = useHttpClient({ type: "backoffice" });
|
|
66342
|
-
const client = (0,
|
|
65905
|
+
const client = (0, import_react19.useMemo)(
|
|
66343
65906
|
() => new ExtensionDataClient(httpClient),
|
|
66344
65907
|
[httpClient]
|
|
66345
65908
|
);
|
|
@@ -66348,16 +65911,16 @@ function useExtensionDataClient() {
|
|
|
66348
65911
|
|
|
66349
65912
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboard-plugin/DashboardPluginWizard.tsx
|
|
66350
65913
|
init_esm_shims();
|
|
66351
|
-
var
|
|
66352
|
-
var
|
|
66353
|
-
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);
|
|
66354
65917
|
|
|
66355
65918
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboard-plugin/generate.ts
|
|
66356
65919
|
init_esm_shims();
|
|
66357
|
-
var
|
|
66358
|
-
import
|
|
66359
|
-
import { randomUUID as
|
|
66360
|
-
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(
|
|
66361
65924
|
__dirname,
|
|
66362
65925
|
"../templates/astro/dashboard-plugin"
|
|
66363
65926
|
);
|
|
@@ -66370,14 +65933,14 @@ async function generateDashboardPlugin(projectFolder, extended, route, title, im
|
|
|
66370
65933
|
codeFileType: "tsx"
|
|
66371
65934
|
});
|
|
66372
65935
|
const config = {
|
|
66373
|
-
id:
|
|
65936
|
+
id: randomUUID6(),
|
|
66374
65937
|
title,
|
|
66375
65938
|
extends: extended,
|
|
66376
65939
|
component: relativePathToCodeFile
|
|
66377
65940
|
};
|
|
66378
65941
|
await modifyExtensionsEntry(
|
|
66379
65942
|
projectFolder,
|
|
66380
|
-
(0,
|
|
65943
|
+
(0, import_camelCase7.default)(route),
|
|
66381
65944
|
relativePathToConfigFile
|
|
66382
65945
|
);
|
|
66383
65946
|
return await componentGenerator({
|
|
@@ -66395,8 +65958,8 @@ async function generateDashboardPlugin(projectFolder, extended, route, title, im
|
|
|
66395
65958
|
|
|
66396
65959
|
// ../cli-astro-commands/src/components/GenerateCommand/MultipleAppRequirement.tsx
|
|
66397
65960
|
init_esm_shims();
|
|
66398
|
-
var
|
|
66399
|
-
var
|
|
65961
|
+
var import_react20 = __toESM(require_react(), 1);
|
|
65962
|
+
var import_variant4 = __toESM(require_lib(), 1);
|
|
66400
65963
|
var MultipleAppRequirement = ({
|
|
66401
65964
|
requiredApps,
|
|
66402
65965
|
onSubmit
|
|
@@ -66404,23 +65967,23 @@ var MultipleAppRequirement = ({
|
|
|
66404
65967
|
const { status } = useAsync(async () => {
|
|
66405
65968
|
onSubmit([]);
|
|
66406
65969
|
}, []);
|
|
66407
|
-
return /* @__PURE__ */
|
|
65970
|
+
return /* @__PURE__ */ import_react20.default.createElement(import_react20.default.Fragment, null, (0, import_variant4.match)(status, {
|
|
66408
65971
|
Loading: () => null,
|
|
66409
65972
|
Error: () => null,
|
|
66410
65973
|
Success: () => {
|
|
66411
65974
|
if (requiredApps.length === 0) {
|
|
66412
65975
|
return null;
|
|
66413
65976
|
}
|
|
66414
|
-
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)))))));
|
|
66415
65978
|
}
|
|
66416
65979
|
}));
|
|
66417
65980
|
};
|
|
66418
65981
|
|
|
66419
65982
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboard-plugin/DashboardPluginGeneratedNote.tsx
|
|
66420
65983
|
init_esm_shims();
|
|
66421
|
-
var
|
|
65984
|
+
var import_react21 = __toESM(require_react(), 1);
|
|
66422
65985
|
var DashboardPluginGeneratedNote = ({ generatedFiles }) => {
|
|
66423
|
-
return /* @__PURE__ */
|
|
65986
|
+
return /* @__PURE__ */ import_react21.default.createElement(
|
|
66424
65987
|
GenerationSuccessMessage,
|
|
66425
65988
|
{
|
|
66426
65989
|
extensionType: "dashboard plugin",
|
|
@@ -66441,12 +66004,12 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66441
66004
|
const { addRequiredApp } = useDevCenterClient();
|
|
66442
66005
|
const { reportError } = useErrorReporter();
|
|
66443
66006
|
const { getSdkSlotData: getSdkSlotData2 } = useExtensionDataClient();
|
|
66444
|
-
const [backofficeExtensionWidget, setBackofficeExtensionWidget] = (0,
|
|
66445
|
-
const [folder, setFolder] = (0,
|
|
66446
|
-
const [title, setTitle] = (0,
|
|
66447
|
-
const [requireAppsIds, setRequireAppsIds] = (0,
|
|
66448
|
-
const [finishedInstallation, setFinishedInstallation] = (0,
|
|
66449
|
-
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);
|
|
66450
66013
|
const validatePluginFolder = useValidation(
|
|
66451
66014
|
createDashboardPluginValidation(
|
|
66452
66015
|
getDashboardPluginExtensionsDir(model.projectFolder)
|
|
@@ -66493,7 +66056,7 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66493
66056
|
if (backofficeExtensionWidget2) {
|
|
66494
66057
|
extensionsByApps[backofficePage.component.componentId]?.items.push({
|
|
66495
66058
|
title: backofficeExtensionWidget2.component.data.backOfficeExtensionContainer.slotData?.displayName ?? backofficeExtensionWidget2.component.name,
|
|
66496
|
-
description: backofficeExtensionWidget2.component.externalId ? /* @__PURE__ */
|
|
66059
|
+
description: backofficeExtensionWidget2.component.externalId ? /* @__PURE__ */ import_react22.default.createElement(Text, null, /* @__PURE__ */ import_react22.default.createElement(
|
|
66497
66060
|
Link,
|
|
66498
66061
|
{
|
|
66499
66062
|
url: docsLink(
|
|
@@ -66518,18 +66081,18 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66518
66081
|
backofficeExtensionWidgets.sort((a, b) => a.title.localeCompare(b.title));
|
|
66519
66082
|
return backofficeExtensionWidgets;
|
|
66520
66083
|
}, []);
|
|
66521
|
-
const task = (0,
|
|
66522
|
-
() => (0,
|
|
66084
|
+
const task = (0, import_react22.useMemo)(
|
|
66085
|
+
() => (0, import_variant5.match)(generationTask, {
|
|
66523
66086
|
Success: ({ hasUpdatedDependencies, newFiles }) => {
|
|
66524
66087
|
if (!hasUpdatedDependencies) {
|
|
66525
66088
|
setFinishedInstallation(true);
|
|
66526
66089
|
}
|
|
66527
|
-
return /* @__PURE__ */
|
|
66090
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_react22.default.Fragment, null, hasUpdatedDependencies && /* @__PURE__ */ import_react22.default.createElement(
|
|
66528
66091
|
InstallDependencies,
|
|
66529
66092
|
{
|
|
66530
66093
|
onFinish: () => setFinishedInstallation(true)
|
|
66531
66094
|
}
|
|
66532
|
-
), finishedInstallation && backofficeExtensionWidget && /* @__PURE__ */
|
|
66095
|
+
), finishedInstallation && backofficeExtensionWidget && /* @__PURE__ */ import_react22.default.createElement(
|
|
66533
66096
|
DashboardPluginGeneratedNote,
|
|
66534
66097
|
{
|
|
66535
66098
|
backofficeExtensionWidget,
|
|
@@ -66537,20 +66100,20 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66537
66100
|
}
|
|
66538
66101
|
));
|
|
66539
66102
|
},
|
|
66540
|
-
Loading: () => /* @__PURE__ */
|
|
66103
|
+
Loading: () => /* @__PURE__ */ import_react22.default.createElement(Spinner, { text: `Generating dashboard plugin...` }),
|
|
66541
66104
|
Error: () => null,
|
|
66542
66105
|
NotRequested: () => null
|
|
66543
66106
|
}),
|
|
66544
66107
|
[generationTask, finishedInstallation, backofficeExtensionWidget]
|
|
66545
66108
|
);
|
|
66546
|
-
return (0,
|
|
66109
|
+
return (0, import_variant5.match)(status, {
|
|
66547
66110
|
Error: () => null,
|
|
66548
|
-
Loading: () => /* @__PURE__ */
|
|
66549
|
-
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(
|
|
66550
66113
|
SelectGroupsInput,
|
|
66551
66114
|
{
|
|
66552
66115
|
label: "What would you like to extend?",
|
|
66553
|
-
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"), ")"),
|
|
66554
66117
|
hideScroll: true,
|
|
66555
66118
|
groups: backofficeExtensionWidgets,
|
|
66556
66119
|
onSubmit: (option) => {
|
|
@@ -66563,7 +66126,7 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66563
66126
|
setBackofficeExtensionWidget(option.value);
|
|
66564
66127
|
}
|
|
66565
66128
|
}
|
|
66566
|
-
), backofficeExtensionWidget && /* @__PURE__ */
|
|
66129
|
+
), backofficeExtensionWidget && /* @__PURE__ */ import_react22.default.createElement(
|
|
66567
66130
|
MultipleAppRequirement,
|
|
66568
66131
|
{
|
|
66569
66132
|
appId: model.config.appId,
|
|
@@ -66573,7 +66136,7 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66573
66136
|
})),
|
|
66574
66137
|
onSubmit: setRequireAppsIds
|
|
66575
66138
|
}
|
|
66576
|
-
), requireAppsIds && /* @__PURE__ */
|
|
66139
|
+
), requireAppsIds && /* @__PURE__ */ import_react22.default.createElement(
|
|
66577
66140
|
TextInput,
|
|
66578
66141
|
{
|
|
66579
66142
|
label: "Plugin title",
|
|
@@ -66588,7 +66151,7 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66588
66151
|
setTitle(value);
|
|
66589
66152
|
}
|
|
66590
66153
|
}
|
|
66591
|
-
), title && /* @__PURE__ */
|
|
66154
|
+
), title && /* @__PURE__ */ import_react22.default.createElement(
|
|
66592
66155
|
TextInput,
|
|
66593
66156
|
{
|
|
66594
66157
|
label: "Plugin folder",
|
|
@@ -66610,16 +66173,16 @@ var DashboardPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66610
66173
|
|
|
66611
66174
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboad-menu-plugin/DashboardMenuPluginWizard.tsx
|
|
66612
66175
|
init_esm_shims();
|
|
66613
|
-
var
|
|
66614
|
-
var
|
|
66615
|
-
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);
|
|
66616
66179
|
|
|
66617
66180
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboad-menu-plugin/generate.ts
|
|
66618
66181
|
init_esm_shims();
|
|
66619
|
-
var
|
|
66620
|
-
import
|
|
66621
|
-
import { randomUUID as
|
|
66622
|
-
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(
|
|
66623
66186
|
__dirname,
|
|
66624
66187
|
"../templates/astro/dashboard-menu-plugin"
|
|
66625
66188
|
);
|
|
@@ -66633,7 +66196,7 @@ async function generateDashboardMenuPlugin(projectFolder, extended, actionType,
|
|
|
66633
66196
|
// TODO: no code file for menu plugin
|
|
66634
66197
|
});
|
|
66635
66198
|
const config = {
|
|
66636
|
-
id:
|
|
66199
|
+
id: randomUUID7(),
|
|
66637
66200
|
title,
|
|
66638
66201
|
iconKey: "Sparkles",
|
|
66639
66202
|
extends: extended,
|
|
@@ -66641,7 +66204,7 @@ async function generateDashboardMenuPlugin(projectFolder, extended, actionType,
|
|
|
66641
66204
|
};
|
|
66642
66205
|
await modifyExtensionsEntry(
|
|
66643
66206
|
projectFolder,
|
|
66644
|
-
(0,
|
|
66207
|
+
(0, import_camelCase8.default)(route),
|
|
66645
66208
|
relativePathToConfigFile
|
|
66646
66209
|
);
|
|
66647
66210
|
return await componentGenerator({
|
|
@@ -66658,16 +66221,16 @@ async function generateDashboardMenuPlugin(projectFolder, extended, actionType,
|
|
|
66658
66221
|
|
|
66659
66222
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboad-menu-plugin/NavigateToPage.tsx
|
|
66660
66223
|
init_esm_shims();
|
|
66661
|
-
var
|
|
66224
|
+
var import_react23 = __toESM(require_react(), 1);
|
|
66662
66225
|
var NavigateToPage = ({ onActionSelected }) => {
|
|
66663
66226
|
const bi = useWixCliAstroBi();
|
|
66664
|
-
const [pageId, setPageId] = (0,
|
|
66227
|
+
const [pageId, setPageId] = (0, import_react23.useState)();
|
|
66665
66228
|
const validatePageId = useValidation(
|
|
66666
66229
|
composeValidations([
|
|
66667
66230
|
[uuidValidation, "Page id has to be in the format of a uuid"]
|
|
66668
66231
|
])
|
|
66669
66232
|
);
|
|
66670
|
-
(0,
|
|
66233
|
+
(0, import_react23.useEffect)(() => {
|
|
66671
66234
|
if (pageId) {
|
|
66672
66235
|
onActionSelected({
|
|
66673
66236
|
navigateToPage: {
|
|
@@ -66676,7 +66239,7 @@ var NavigateToPage = ({ onActionSelected }) => {
|
|
|
66676
66239
|
});
|
|
66677
66240
|
}
|
|
66678
66241
|
}, [pageId, onActionSelected]);
|
|
66679
|
-
return /* @__PURE__ */
|
|
66242
|
+
return /* @__PURE__ */ import_react23.default.createElement(
|
|
66680
66243
|
TextInput,
|
|
66681
66244
|
{
|
|
66682
66245
|
label: "What is the unique id of the page?",
|
|
@@ -66695,16 +66258,16 @@ var NavigateToPage = ({ onActionSelected }) => {
|
|
|
66695
66258
|
|
|
66696
66259
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboad-menu-plugin/OpenModal.tsx
|
|
66697
66260
|
init_esm_shims();
|
|
66698
|
-
var
|
|
66261
|
+
var import_react24 = __toESM(require_react(), 1);
|
|
66699
66262
|
var OpenModal = ({ onActionSelected }) => {
|
|
66700
66263
|
const bi = useWixCliAstroBi();
|
|
66701
|
-
const [componentId, setComponentId] = (0,
|
|
66264
|
+
const [componentId, setComponentId] = (0, import_react24.useState)();
|
|
66702
66265
|
const validateComponentId = useValidation(
|
|
66703
66266
|
composeValidations([
|
|
66704
66267
|
[uuidValidation, "Modal id has to be in the format of a uuid"]
|
|
66705
66268
|
])
|
|
66706
66269
|
);
|
|
66707
|
-
(0,
|
|
66270
|
+
(0, import_react24.useEffect)(() => {
|
|
66708
66271
|
if (componentId) {
|
|
66709
66272
|
onActionSelected({
|
|
66710
66273
|
openModal: {
|
|
@@ -66713,7 +66276,7 @@ var OpenModal = ({ onActionSelected }) => {
|
|
|
66713
66276
|
});
|
|
66714
66277
|
}
|
|
66715
66278
|
}, [componentId, onActionSelected]);
|
|
66716
|
-
return /* @__PURE__ */
|
|
66279
|
+
return /* @__PURE__ */ import_react24.default.createElement(
|
|
66717
66280
|
TextInput,
|
|
66718
66281
|
{
|
|
66719
66282
|
label: "What is the unique id of the modal?",
|
|
@@ -66732,9 +66295,9 @@ var OpenModal = ({ onActionSelected }) => {
|
|
|
66732
66295
|
|
|
66733
66296
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboad-menu-plugin/DashboardMenuPluginGeneratedNote.tsx
|
|
66734
66297
|
init_esm_shims();
|
|
66735
|
-
var
|
|
66298
|
+
var import_react25 = __toESM(require_react(), 1);
|
|
66736
66299
|
var DashboardMenuPluginGeneratedNote = ({ generatedFiles }) => {
|
|
66737
|
-
return /* @__PURE__ */
|
|
66300
|
+
return /* @__PURE__ */ import_react25.default.createElement(Box_default, { flexDirection: "column" }, /* @__PURE__ */ import_react25.default.createElement(
|
|
66738
66301
|
GenerationSuccessMessage,
|
|
66739
66302
|
{
|
|
66740
66303
|
extensionType: "dashboard menu plugin",
|
|
@@ -66745,7 +66308,7 @@ var DashboardMenuPluginGeneratedNote = ({ generatedFiles }) => {
|
|
|
66745
66308
|
};
|
|
66746
66309
|
|
|
66747
66310
|
// ../cli-astro-commands/src/components/GenerateCommand/plugins/dashboad-menu-plugin/DashboardMenuPluginWizard.tsx
|
|
66748
|
-
var DashboardMenuPluginAction = (0,
|
|
66311
|
+
var DashboardMenuPluginAction = (0, import_variant6.variant)({
|
|
66749
66312
|
NavigateToPage: {},
|
|
66750
66313
|
OpenModal: {}
|
|
66751
66314
|
});
|
|
@@ -66757,15 +66320,15 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66757
66320
|
const bi = useWixCliAstroBi();
|
|
66758
66321
|
const { model } = useProjectModel();
|
|
66759
66322
|
const { addRequiredApp } = useDevCenterClient();
|
|
66760
|
-
const [backofficeMenuItem, setBackofficeMenuItem] = (0,
|
|
66761
|
-
const [actionType, setActionType] = (0,
|
|
66762
|
-
const [requireAppsIds, setRequireAppsIds] = (0,
|
|
66763
|
-
const [action, setAction] = (0,
|
|
66764
|
-
const [folder, setFolder] = (0,
|
|
66765
|
-
const [title, setTitle] = (0,
|
|
66766
|
-
const [finishedInstallation, setFinishedInstallation] = (0,
|
|
66767
|
-
const defaultFolderName = (0,
|
|
66768
|
-
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)();
|
|
66769
66332
|
const validateMenuPluginFolder = useValidation(
|
|
66770
66333
|
createDashboardMenuPluginValidation(
|
|
66771
66334
|
getDashboardMenuPluginExtensionsDir(model.projectFolder)
|
|
@@ -66790,7 +66353,7 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66790
66353
|
);
|
|
66791
66354
|
}
|
|
66792
66355
|
}, [backofficeMenuItem, action, folder, title]);
|
|
66793
|
-
const handleActionSelected = (0,
|
|
66356
|
+
const handleActionSelected = (0, import_react26.useCallback)(
|
|
66794
66357
|
(action2) => setAction(action2),
|
|
66795
66358
|
[]
|
|
66796
66359
|
);
|
|
@@ -66807,7 +66370,7 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66807
66370
|
extensionsByPages[backofficePage.component.componentId]?.items.push(
|
|
66808
66371
|
{
|
|
66809
66372
|
title: backofficeMenuItem2.component.data.backOfficeExtensionContainer.slotData?.displayName ?? backofficeMenuItem2.component.name,
|
|
66810
|
-
description: backofficeMenuItem2.component.externalId ? /* @__PURE__ */
|
|
66373
|
+
description: backofficeMenuItem2.component.externalId ? /* @__PURE__ */ import_react26.default.createElement(Text, null, /* @__PURE__ */ import_react26.default.createElement(
|
|
66811
66374
|
Link,
|
|
66812
66375
|
{
|
|
66813
66376
|
url: docsLink2(backofficeMenuItem2.component.externalId)
|
|
@@ -66831,18 +66394,18 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66831
66394
|
backofficeExtensionWidgets.sort((a, b) => a.title.localeCompare(b.title));
|
|
66832
66395
|
return backofficeExtensionWidgets;
|
|
66833
66396
|
}, []);
|
|
66834
|
-
const task = (0,
|
|
66835
|
-
() => (0,
|
|
66397
|
+
const task = (0, import_react26.useMemo)(
|
|
66398
|
+
() => (0, import_variant6.match)(generationTask, {
|
|
66836
66399
|
Success: ({ hasUpdatedDependencies, newFiles }) => {
|
|
66837
66400
|
if (!hasUpdatedDependencies) {
|
|
66838
66401
|
setFinishedInstallation(true);
|
|
66839
66402
|
}
|
|
66840
|
-
return /* @__PURE__ */
|
|
66403
|
+
return /* @__PURE__ */ import_react26.default.createElement(import_react26.default.Fragment, null, hasUpdatedDependencies && /* @__PURE__ */ import_react26.default.createElement(
|
|
66841
66404
|
InstallDependencies,
|
|
66842
66405
|
{
|
|
66843
66406
|
onFinish: () => setFinishedInstallation(true)
|
|
66844
66407
|
}
|
|
66845
|
-
), finishedInstallation && backofficeMenuItem && /* @__PURE__ */
|
|
66408
|
+
), finishedInstallation && backofficeMenuItem && /* @__PURE__ */ import_react26.default.createElement(
|
|
66846
66409
|
DashboardMenuPluginGeneratedNote,
|
|
66847
66410
|
{
|
|
66848
66411
|
backofficeMenuItem,
|
|
@@ -66850,7 +66413,7 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66850
66413
|
}
|
|
66851
66414
|
));
|
|
66852
66415
|
},
|
|
66853
|
-
Loading: () => /* @__PURE__ */
|
|
66416
|
+
Loading: () => /* @__PURE__ */ import_react26.default.createElement(Spinner, { text: `Generating dashboard menu plugin...` }),
|
|
66854
66417
|
Error: () => null,
|
|
66855
66418
|
NotRequested: () => null
|
|
66856
66419
|
}),
|
|
@@ -66861,15 +66424,15 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66861
66424
|
backofficeMenuItem
|
|
66862
66425
|
]
|
|
66863
66426
|
);
|
|
66864
|
-
return (0,
|
|
66427
|
+
return (0, import_variant6.match)(status, {
|
|
66865
66428
|
Error: () => null,
|
|
66866
|
-
Loading: () => /* @__PURE__ */
|
|
66867
|
-
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(
|
|
66868
66431
|
SelectGroupsInput,
|
|
66869
66432
|
{
|
|
66870
66433
|
label: "What would you like to extend?",
|
|
66871
66434
|
hideScroll: true,
|
|
66872
|
-
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"), ")"),
|
|
66873
66436
|
groups: menuItemsGroups,
|
|
66874
66437
|
onSubmit: (item) => {
|
|
66875
66438
|
const additionalInfoOfSelectedItem = {
|
|
@@ -66887,7 +66450,7 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66887
66450
|
setBackofficeMenuItem(item.value);
|
|
66888
66451
|
}
|
|
66889
66452
|
}
|
|
66890
|
-
), backofficeMenuItem && /* @__PURE__ */
|
|
66453
|
+
), backofficeMenuItem && /* @__PURE__ */ import_react26.default.createElement(
|
|
66891
66454
|
MultipleAppRequirement,
|
|
66892
66455
|
{
|
|
66893
66456
|
appId: model.config.appId,
|
|
@@ -66897,7 +66460,7 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66897
66460
|
})),
|
|
66898
66461
|
onSubmit: setRequireAppsIds
|
|
66899
66462
|
}
|
|
66900
|
-
), requireAppsIds && /* @__PURE__ */
|
|
66463
|
+
), requireAppsIds && /* @__PURE__ */ import_react26.default.createElement(
|
|
66901
66464
|
SelectInput,
|
|
66902
66465
|
{
|
|
66903
66466
|
label: "What action will happen after clicking on the menu item?",
|
|
@@ -66923,10 +66486,10 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66923
66486
|
setActionType(action2.value);
|
|
66924
66487
|
}
|
|
66925
66488
|
}
|
|
66926
|
-
), actionType && (0,
|
|
66927
|
-
NavigateToPage: () => /* @__PURE__ */
|
|
66928
|
-
OpenModal: () => /* @__PURE__ */
|
|
66929
|
-
}), 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(
|
|
66930
66493
|
TextInput,
|
|
66931
66494
|
{
|
|
66932
66495
|
label: "Menu Plugin title",
|
|
@@ -66941,7 +66504,7 @@ var DashboardMenuPluginWizard = ({ slotsApp, pluginsMap }) => {
|
|
|
66941
66504
|
setTitle(value);
|
|
66942
66505
|
}
|
|
66943
66506
|
}
|
|
66944
|
-
), title && /* @__PURE__ */
|
|
66507
|
+
), title && /* @__PURE__ */ import_react26.default.createElement(
|
|
66945
66508
|
TextInput,
|
|
66946
66509
|
{
|
|
66947
66510
|
label: "Menu Plugin folder",
|
|
@@ -66969,14 +66532,14 @@ var DashboardPlugin = ({ flow }) => {
|
|
|
66969
66532
|
getBackofficeExtensionWidgets,
|
|
66970
66533
|
getBackofficeMenuItems
|
|
66971
66534
|
} = useExtensionDataClient();
|
|
66972
|
-
const [slotsApp, setSlotsApp] = (0,
|
|
66535
|
+
const [slotsApp, setSlotsApp] = (0, import_react27.useState)();
|
|
66973
66536
|
const { status } = useAsync(async () => {
|
|
66974
66537
|
const [ecomRequiredApps2, backofficePages, backofficeExtensionContainers] = await Promise.all([
|
|
66975
66538
|
getEcomRequiredApps(),
|
|
66976
66539
|
getBackofficePages(),
|
|
66977
|
-
(0,
|
|
66540
|
+
(0, import_variant7.match)(
|
|
66978
66541
|
flow,
|
|
66979
|
-
(0,
|
|
66542
|
+
(0, import_variant7.partial)({
|
|
66980
66543
|
DashboardPlugin: () => getBackofficeExtensionWidgets(),
|
|
66981
66544
|
DashboardMenuPlugin: () => getBackofficeMenuItems(),
|
|
66982
66545
|
default: () => []
|
|
@@ -67020,14 +66583,14 @@ var DashboardPlugin = ({ flow }) => {
|
|
|
67020
66583
|
pluginsMap
|
|
67021
66584
|
};
|
|
67022
66585
|
}, []);
|
|
67023
|
-
return (0,
|
|
66586
|
+
return (0, import_variant7.match)(status, {
|
|
67024
66587
|
Error: () => null,
|
|
67025
|
-
Loading: () => /* @__PURE__ */
|
|
67026
|
-
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(
|
|
67027
66590
|
SelectInput,
|
|
67028
66591
|
{
|
|
67029
66592
|
label: "Select a Wix app to view its plugin slots",
|
|
67030
|
-
info: /* @__PURE__ */
|
|
66593
|
+
info: /* @__PURE__ */ import_react27.default.createElement(Text, null, "(", /* @__PURE__ */ import_react27.default.createElement(Link, { url: "https://wix.to/T9OFciS" }, "read more"), ")"),
|
|
67031
66594
|
options: supportedApps,
|
|
67032
66595
|
onSubmit: (option) => {
|
|
67033
66596
|
bi.cliFlowStepAnswered({
|
|
@@ -67042,10 +66605,10 @@ var DashboardPlugin = ({ flow }) => {
|
|
|
67042
66605
|
setSlotsApp(option.value);
|
|
67043
66606
|
}
|
|
67044
66607
|
}
|
|
67045
|
-
), slotsApp && (0,
|
|
66608
|
+
), slotsApp && (0, import_variant7.match)(
|
|
67046
66609
|
flow,
|
|
67047
|
-
(0,
|
|
67048
|
-
DashboardPlugin: () => /* @__PURE__ */
|
|
66610
|
+
(0, import_variant7.partial)({
|
|
66611
|
+
DashboardPlugin: () => /* @__PURE__ */ import_react27.default.createElement(
|
|
67049
66612
|
DashboardPluginWizard,
|
|
67050
66613
|
{
|
|
67051
66614
|
slotsApp,
|
|
@@ -67056,7 +66619,7 @@ var DashboardPlugin = ({ flow }) => {
|
|
|
67056
66619
|
)
|
|
67057
66620
|
}
|
|
67058
66621
|
),
|
|
67059
|
-
DashboardMenuPlugin: () => /* @__PURE__ */
|
|
66622
|
+
DashboardMenuPlugin: () => /* @__PURE__ */ import_react27.default.createElement(
|
|
67060
66623
|
DashboardMenuPluginWizard,
|
|
67061
66624
|
{
|
|
67062
66625
|
slotsApp,
|
|
@@ -67073,9 +66636,372 @@ var DashboardPlugin = ({ flow }) => {
|
|
|
67073
66636
|
});
|
|
67074
66637
|
};
|
|
67075
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
|
+
|
|
67076
67002
|
// ../cli-astro-commands/src/components/GenerateCommand/event/Event.tsx
|
|
67077
67003
|
init_esm_shims();
|
|
67078
|
-
var
|
|
67004
|
+
var import_react33 = __toESM(require_react(), 1);
|
|
67079
67005
|
|
|
67080
67006
|
// ../cli-astro-commands/src/components/GenerateCommand/event/generate.ts
|
|
67081
67007
|
init_esm_shims();
|
|
@@ -67113,7 +67039,7 @@ async function generateEvent(projectFolder, route) {
|
|
|
67113
67039
|
|
|
67114
67040
|
// ../cli-astro-commands/src/components/GenerateCommand/event/steps.tsx
|
|
67115
67041
|
init_esm_shims();
|
|
67116
|
-
var
|
|
67042
|
+
var import_react32 = __toESM(require_react(), 1);
|
|
67117
67043
|
var ChooseFolderStep2 = ({ onSubmit, eventFolder }) => {
|
|
67118
67044
|
const { model } = useProjectModel();
|
|
67119
67045
|
const bi = useWixCliAstroBi();
|
|
@@ -67132,7 +67058,7 @@ var ChooseFolderStep2 = ({ onSubmit, eventFolder }) => {
|
|
|
67132
67058
|
]
|
|
67133
67059
|
])
|
|
67134
67060
|
);
|
|
67135
|
-
return /* @__PURE__ */
|
|
67061
|
+
return /* @__PURE__ */ import_react32.default.createElement(
|
|
67136
67062
|
TextInput,
|
|
67137
67063
|
{
|
|
67138
67064
|
isActive,
|
|
@@ -67155,15 +67081,15 @@ var ChooseFolderStep2 = ({ onSubmit, eventFolder }) => {
|
|
|
67155
67081
|
// ../cli-astro-commands/src/components/GenerateCommand/event/Event.tsx
|
|
67156
67082
|
var useGenerateEvent = () => {
|
|
67157
67083
|
const { model } = useProjectModel();
|
|
67158
|
-
const [eventFolder, setEventFolder] = (0,
|
|
67084
|
+
const [eventFolder, setEventFolder] = (0, import_react33.useState)();
|
|
67159
67085
|
const generationTask = useGenerationTask(async () => {
|
|
67160
67086
|
if (eventFolder) {
|
|
67161
67087
|
return generateEvent(model.projectFolder, eventFolder);
|
|
67162
67088
|
}
|
|
67163
67089
|
}, [model.projectFolder, eventFolder]);
|
|
67164
67090
|
return [
|
|
67165
|
-
/* @__PURE__ */
|
|
67166
|
-
/* @__PURE__ */
|
|
67091
|
+
/* @__PURE__ */ import_react33.default.createElement(ChooseFolderStep2, { onSubmit: setEventFolder, eventFolder }),
|
|
67092
|
+
/* @__PURE__ */ import_react33.default.createElement(
|
|
67167
67093
|
CompleteGeneration,
|
|
67168
67094
|
{
|
|
67169
67095
|
generationTask,
|
|
@@ -67180,13 +67106,13 @@ var useGenerateEvent = () => {
|
|
|
67180
67106
|
|
|
67181
67107
|
// ../cli-astro-commands/src/components/GenerateCommand/site-plugin/SitePlugin.tsx
|
|
67182
67108
|
init_esm_shims();
|
|
67183
|
-
var
|
|
67184
|
-
var
|
|
67109
|
+
var import_react35 = __toESM(require_react(), 1);
|
|
67110
|
+
var import_variant9 = __toESM(require_lib(), 1);
|
|
67185
67111
|
|
|
67186
67112
|
// ../cli-astro-commands/src/components/GenerateCommand/site-plugin/SitePluginWizard.tsx
|
|
67187
67113
|
init_esm_shims();
|
|
67188
|
-
var
|
|
67189
|
-
var
|
|
67114
|
+
var import_react34 = __toESM(require_react(), 1);
|
|
67115
|
+
var import_variant8 = __toESM(require_lib(), 1);
|
|
67190
67116
|
var import_kebabCase8 = __toESM(require_kebabCase(), 1);
|
|
67191
67117
|
var import_uniqBy = __toESM(require_uniqBy(), 1);
|
|
67192
67118
|
|
|
@@ -67253,26 +67179,26 @@ var SitePluginWizard = ({
|
|
|
67253
67179
|
getSitePluginExtensionsDir(model.projectFolder)
|
|
67254
67180
|
)
|
|
67255
67181
|
);
|
|
67256
|
-
const [slot, setSlot] = (0,
|
|
67257
|
-
const [requireAppsIds, setRequireAppsIds] = (0,
|
|
67258
|
-
const [placementApp, setPlacementApp] = (0,
|
|
67259
|
-
const [pluginFolder, setPluginFolder] = (0,
|
|
67260
|
-
const [pluginName, setPluginName] = (0,
|
|
67261
|
-
const [finishedInstallation, setFinishedInstallation] = (0,
|
|
67262
|
-
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)(
|
|
67263
67189
|
() => (0, import_uniqBy.default)(widgetPlugins2, "appName").map((pluginPlacement) => ({
|
|
67264
67190
|
value: pluginPlacement.appName,
|
|
67265
67191
|
title: pluginPlacement.appName
|
|
67266
67192
|
})),
|
|
67267
67193
|
[widgetPlugins2]
|
|
67268
67194
|
);
|
|
67269
|
-
const widgetSlots = (0,
|
|
67195
|
+
const widgetSlots = (0, import_react34.useMemo)(
|
|
67270
67196
|
() => placementApp ? widgetPlugins2.filter((widgetPlugin) => widgetPlugin.appName === placementApp).reduce(
|
|
67271
67197
|
(_widgetSlots, widgetPlugin) => {
|
|
67272
67198
|
const widgetDocsUrl = getWidgetDocsUrl(
|
|
67273
67199
|
widgetPlugin.component.componentId
|
|
67274
67200
|
);
|
|
67275
|
-
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"));
|
|
67276
67202
|
_widgetSlots[widgetPlugin.component.componentId] ??= {
|
|
67277
67203
|
title: widgetPlugin.component.name,
|
|
67278
67204
|
description,
|
|
@@ -67314,7 +67240,7 @@ var SitePluginWizard = ({
|
|
|
67314
67240
|
}
|
|
67315
67241
|
}
|
|
67316
67242
|
}, [pluginFolder, pluginName, slot, widgetSlots, getWidgetDocsUrl]);
|
|
67317
|
-
const handleSetSlot = (0,
|
|
67243
|
+
const handleSetSlot = (0, import_react34.useCallback)(
|
|
67318
67244
|
(placement) => {
|
|
67319
67245
|
void getEcomRequiredApps().then((ecomRequiredApp) => {
|
|
67320
67246
|
const widgetPlugin = widgetPlugins2.find(
|
|
@@ -67337,11 +67263,11 @@ var SitePluginWizard = ({
|
|
|
67337
67263
|
},
|
|
67338
67264
|
[widgetPlugins2]
|
|
67339
67265
|
);
|
|
67340
|
-
return /* @__PURE__ */
|
|
67266
|
+
return /* @__PURE__ */ import_react34.default.createElement(import_react34.default.Fragment, null, /* @__PURE__ */ import_react34.default.createElement(
|
|
67341
67267
|
SelectInput,
|
|
67342
67268
|
{
|
|
67343
67269
|
label: "Select a Wix app to view its plugin slots",
|
|
67344
|
-
info: /* @__PURE__ */
|
|
67270
|
+
info: /* @__PURE__ */ import_react34.default.createElement(Text, null, /* @__PURE__ */ import_react34.default.createElement(Link, { url: "https://wix.to/Onfe4XJ" }, "read more")),
|
|
67345
67271
|
options: pluginApplications,
|
|
67346
67272
|
onSubmit: (option) => {
|
|
67347
67273
|
bi.cliFlowStepAnswered({
|
|
@@ -67353,7 +67279,7 @@ var SitePluginWizard = ({
|
|
|
67353
67279
|
setPlacementApp(option.value);
|
|
67354
67280
|
}
|
|
67355
67281
|
}
|
|
67356
|
-
), placementApp && /* @__PURE__ */
|
|
67282
|
+
), placementApp && /* @__PURE__ */ import_react34.default.createElement(
|
|
67357
67283
|
SelectGroupsInput,
|
|
67358
67284
|
{
|
|
67359
67285
|
label: "Select the slot in which you\u2019d like to place your plugin",
|
|
@@ -67368,7 +67294,7 @@ var SitePluginWizard = ({
|
|
|
67368
67294
|
handleSetSlot(option.value);
|
|
67369
67295
|
}
|
|
67370
67296
|
}
|
|
67371
|
-
), slot?.requiredApps && /* @__PURE__ */
|
|
67297
|
+
), slot?.requiredApps && /* @__PURE__ */ import_react34.default.createElement(
|
|
67372
67298
|
MultipleAppRequirement,
|
|
67373
67299
|
{
|
|
67374
67300
|
appId: model.config.appId,
|
|
@@ -67378,7 +67304,7 @@ var SitePluginWizard = ({
|
|
|
67378
67304
|
})),
|
|
67379
67305
|
onSubmit: setRequireAppsIds
|
|
67380
67306
|
}
|
|
67381
|
-
), requireAppsIds && /* @__PURE__ */
|
|
67307
|
+
), requireAppsIds && /* @__PURE__ */ import_react34.default.createElement(
|
|
67382
67308
|
TextInput,
|
|
67383
67309
|
{
|
|
67384
67310
|
label: "Enter a name for your site plugin:",
|
|
@@ -67396,7 +67322,7 @@ var SitePluginWizard = ({
|
|
|
67396
67322
|
},
|
|
67397
67323
|
validate: validateName
|
|
67398
67324
|
}
|
|
67399
|
-
), pluginName && /* @__PURE__ */
|
|
67325
|
+
), pluginName && /* @__PURE__ */ import_react34.default.createElement(
|
|
67400
67326
|
TextInput,
|
|
67401
67327
|
{
|
|
67402
67328
|
label: "Enter a folder name for your site plugin:",
|
|
@@ -67415,18 +67341,18 @@ var SitePluginWizard = ({
|
|
|
67415
67341
|
},
|
|
67416
67342
|
validate: validatePluginFolder
|
|
67417
67343
|
}
|
|
67418
|
-
), (0,
|
|
67419
|
-
() => (0,
|
|
67344
|
+
), (0, import_react34.useMemo)(
|
|
67345
|
+
() => (0, import_variant8.match)(generationTask, {
|
|
67420
67346
|
Success: ({ hasUpdatedDependencies, newFiles }) => {
|
|
67421
67347
|
if (!hasUpdatedDependencies) {
|
|
67422
67348
|
setFinishedInstallation(true);
|
|
67423
67349
|
}
|
|
67424
|
-
return /* @__PURE__ */
|
|
67350
|
+
return /* @__PURE__ */ import_react34.default.createElement(import_react34.default.Fragment, null, hasUpdatedDependencies && /* @__PURE__ */ import_react34.default.createElement(
|
|
67425
67351
|
InstallDependencies,
|
|
67426
67352
|
{
|
|
67427
67353
|
onFinish: () => setFinishedInstallation(true)
|
|
67428
67354
|
}
|
|
67429
|
-
), finishedInstallation && /* @__PURE__ */
|
|
67355
|
+
), finishedInstallation && /* @__PURE__ */ import_react34.default.createElement(
|
|
67430
67356
|
GenerationSuccessMessage,
|
|
67431
67357
|
{
|
|
67432
67358
|
extensionType,
|
|
@@ -67435,7 +67361,7 @@ var SitePluginWizard = ({
|
|
|
67435
67361
|
}
|
|
67436
67362
|
));
|
|
67437
67363
|
},
|
|
67438
|
-
Loading: () => /* @__PURE__ */
|
|
67364
|
+
Loading: () => /* @__PURE__ */ import_react34.default.createElement(Spinner, { text: `Generating ${extensionType}...` }),
|
|
67439
67365
|
Error: () => null,
|
|
67440
67366
|
NotRequested: () => null
|
|
67441
67367
|
}),
|
|
@@ -67452,10 +67378,10 @@ var SitePluginWizard = ({
|
|
|
67452
67378
|
var GenerateSitePlugin = () => {
|
|
67453
67379
|
const { getWidgetPlugins } = useExtensionDataClient();
|
|
67454
67380
|
const { status } = useAsync(getWidgetPlugins, []);
|
|
67455
|
-
return (0,
|
|
67381
|
+
return (0, import_variant9.match)(status, {
|
|
67456
67382
|
Error: () => null,
|
|
67457
|
-
Loading: () => /* @__PURE__ */
|
|
67458
|
-
Success: ({ result }) => /* @__PURE__ */
|
|
67383
|
+
Loading: () => /* @__PURE__ */ import_react35.default.createElement(Spinner, { text: "Loading..." }),
|
|
67384
|
+
Success: ({ result }) => /* @__PURE__ */ import_react35.default.createElement(SitePluginWizard, { widgetPlugins: result })
|
|
67459
67385
|
});
|
|
67460
67386
|
};
|
|
67461
67387
|
|
|
@@ -67463,7 +67389,7 @@ var GenerateSitePlugin = () => {
|
|
|
67463
67389
|
var FlowSelector = ({ onSubmit, generateFlow, generateFlows }) => {
|
|
67464
67390
|
const bi = useWixCliAstroBi();
|
|
67465
67391
|
const { goToNextStep, isActive } = useWizardStep();
|
|
67466
|
-
const selectFlow = (0,
|
|
67392
|
+
const selectFlow = (0, import_react36.useCallback)(
|
|
67467
67393
|
(selectedType) => {
|
|
67468
67394
|
bi.cliFlowStepAnswered({
|
|
67469
67395
|
question: "What kind of extension would you like to generate?",
|
|
@@ -67475,10 +67401,10 @@ var FlowSelector = ({ onSubmit, generateFlow, generateFlows }) => {
|
|
|
67475
67401
|
},
|
|
67476
67402
|
[bi, onSubmit, goToNextStep]
|
|
67477
67403
|
);
|
|
67478
|
-
(0,
|
|
67404
|
+
(0, import_react36.useEffect)(() => {
|
|
67479
67405
|
goToNextStep();
|
|
67480
67406
|
}, []);
|
|
67481
|
-
return /* @__PURE__ */
|
|
67407
|
+
return /* @__PURE__ */ import_react36.default.createElement(
|
|
67482
67408
|
SelectGroupsInput,
|
|
67483
67409
|
{
|
|
67484
67410
|
value: !isActive ? InputState.Submitted(generateFlow) : InputState.NotSubmitted(generateFlow),
|
|
@@ -67489,9 +67415,7 @@ var FlowSelector = ({ onSubmit, generateFlow, generateFlows }) => {
|
|
|
67489
67415
|
}
|
|
67490
67416
|
);
|
|
67491
67417
|
};
|
|
67492
|
-
var GenerateCommand = ({
|
|
67493
|
-
docsExtensionType
|
|
67494
|
-
}) => {
|
|
67418
|
+
var GenerateCommand = ({ docsExtensionType, experimental = false }) => {
|
|
67495
67419
|
const bi = useWixCliAstroBi();
|
|
67496
67420
|
const dashboardPageSteps = useGenerateDashboardPage();
|
|
67497
67421
|
const dashboardModalSteps = useGenerateDashboardModal();
|
|
@@ -67500,8 +67424,8 @@ var GenerateCommand = ({
|
|
|
67500
67424
|
const generateServicePluginSteps = useGenerateServicePlugin();
|
|
67501
67425
|
const generateEmbeddedScriptSteps = useGenerateEmbeddedScript();
|
|
67502
67426
|
const generateCustomElementSteps = useGenerateCustomElement();
|
|
67503
|
-
const
|
|
67504
|
-
const biCliFlowStepAnswered = (0,
|
|
67427
|
+
const generateEditorReactComponentSteps = useGenerateEditorReactComponent();
|
|
67428
|
+
const biCliFlowStepAnswered = (0, import_react36.useCallback)(
|
|
67505
67429
|
(selectedType) => {
|
|
67506
67430
|
bi.cliFlowStepAnswered({
|
|
67507
67431
|
question: "What kind of extension would you like to generate?",
|
|
@@ -67511,7 +67435,7 @@ var GenerateCommand = ({
|
|
|
67511
67435
|
},
|
|
67512
67436
|
[bi]
|
|
67513
67437
|
);
|
|
67514
|
-
const [generateFlow, setGenerateFlow] = (0,
|
|
67438
|
+
const [generateFlow, setGenerateFlow] = (0, import_react36.useState)(() => {
|
|
67515
67439
|
if (docsExtensionType) {
|
|
67516
67440
|
const selectedType = getGenerateFlowByDocsExtensionType(docsExtensionType);
|
|
67517
67441
|
biCliFlowStepAnswered(selectedType);
|
|
@@ -67519,16 +67443,16 @@ var GenerateCommand = ({
|
|
|
67519
67443
|
}
|
|
67520
67444
|
return;
|
|
67521
67445
|
});
|
|
67522
|
-
const generateFlows = useGenerateFlows();
|
|
67523
|
-
const selectFlow = (0,
|
|
67446
|
+
const generateFlows = useGenerateFlows({ experimental });
|
|
67447
|
+
const selectFlow = (0, import_react36.useCallback)(
|
|
67524
67448
|
(selectedType) => {
|
|
67525
67449
|
biCliFlowStepAnswered(selectedType);
|
|
67526
67450
|
setGenerateFlow(selectedType);
|
|
67527
67451
|
},
|
|
67528
67452
|
[biCliFlowStepAnswered]
|
|
67529
67453
|
);
|
|
67530
|
-
const shouldEditFlow = (0,
|
|
67531
|
-
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(
|
|
67532
67456
|
SelectGroupsInput,
|
|
67533
67457
|
{
|
|
67534
67458
|
value: generateFlow ? InputState.Submitted(generateFlow) : InputState.NotSubmitted(generateFlow),
|
|
@@ -67537,15 +67461,15 @@ var GenerateCommand = ({
|
|
|
67537
67461
|
onSubmit: selectFlow,
|
|
67538
67462
|
maxHeight: 15
|
|
67539
67463
|
}
|
|
67540
|
-
), generateFlow && (0,
|
|
67464
|
+
), generateFlow && (0, import_variant10.match)(
|
|
67541
67465
|
generateFlow.value,
|
|
67542
|
-
(0,
|
|
67543
|
-
DashboardPage: () => /* @__PURE__ */
|
|
67466
|
+
(0, import_variant10.partial)({
|
|
67467
|
+
DashboardPage: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
67544
67468
|
Wizard,
|
|
67545
67469
|
{
|
|
67546
67470
|
name: generateFlow.value.type,
|
|
67547
67471
|
steps: [
|
|
67548
|
-
/* @__PURE__ */
|
|
67472
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
67549
67473
|
FlowSelector,
|
|
67550
67474
|
{
|
|
67551
67475
|
generateFlows,
|
|
@@ -67557,12 +67481,12 @@ var GenerateCommand = ({
|
|
|
67557
67481
|
]
|
|
67558
67482
|
}
|
|
67559
67483
|
),
|
|
67560
|
-
DashboardModal: () => /* @__PURE__ */
|
|
67484
|
+
DashboardModal: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
67561
67485
|
Wizard,
|
|
67562
67486
|
{
|
|
67563
67487
|
name: generateFlow.value.type,
|
|
67564
67488
|
steps: [
|
|
67565
|
-
/* @__PURE__ */
|
|
67489
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
67566
67490
|
FlowSelector,
|
|
67567
67491
|
{
|
|
67568
67492
|
generateFlows,
|
|
@@ -67574,12 +67498,12 @@ var GenerateCommand = ({
|
|
|
67574
67498
|
]
|
|
67575
67499
|
}
|
|
67576
67500
|
),
|
|
67577
|
-
ServicePlugin: () => /* @__PURE__ */
|
|
67501
|
+
ServicePlugin: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
67578
67502
|
Wizard,
|
|
67579
67503
|
{
|
|
67580
67504
|
name: generateFlow.value.type,
|
|
67581
67505
|
steps: [
|
|
67582
|
-
/* @__PURE__ */
|
|
67506
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
67583
67507
|
FlowSelector,
|
|
67584
67508
|
{
|
|
67585
67509
|
generateFlows,
|
|
@@ -67591,12 +67515,12 @@ var GenerateCommand = ({
|
|
|
67591
67515
|
]
|
|
67592
67516
|
}
|
|
67593
67517
|
),
|
|
67594
|
-
Event: () => /* @__PURE__ */
|
|
67518
|
+
Event: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
67595
67519
|
Wizard,
|
|
67596
67520
|
{
|
|
67597
67521
|
name: generateFlow.value.type,
|
|
67598
67522
|
steps: [
|
|
67599
|
-
/* @__PURE__ */
|
|
67523
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
67600
67524
|
FlowSelector,
|
|
67601
67525
|
{
|
|
67602
67526
|
generateFlows,
|
|
@@ -67608,12 +67532,12 @@ var GenerateCommand = ({
|
|
|
67608
67532
|
]
|
|
67609
67533
|
}
|
|
67610
67534
|
),
|
|
67611
|
-
DataCollection: () => /* @__PURE__ */
|
|
67535
|
+
DataCollection: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
67612
67536
|
Wizard,
|
|
67613
67537
|
{
|
|
67614
67538
|
name: generateFlow.value.type,
|
|
67615
67539
|
steps: [
|
|
67616
|
-
/* @__PURE__ */
|
|
67540
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
67617
67541
|
FlowSelector,
|
|
67618
67542
|
{
|
|
67619
67543
|
generateFlows,
|
|
@@ -67625,12 +67549,12 @@ var GenerateCommand = ({
|
|
|
67625
67549
|
]
|
|
67626
67550
|
}
|
|
67627
67551
|
),
|
|
67628
|
-
EmbeddedScript: () => /* @__PURE__ */
|
|
67552
|
+
EmbeddedScript: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
67629
67553
|
Wizard,
|
|
67630
67554
|
{
|
|
67631
67555
|
name: generateFlow.value.type,
|
|
67632
67556
|
steps: [
|
|
67633
|
-
/* @__PURE__ */
|
|
67557
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
67634
67558
|
FlowSelector,
|
|
67635
67559
|
{
|
|
67636
67560
|
generateFlows,
|
|
@@ -67642,12 +67566,12 @@ var GenerateCommand = ({
|
|
|
67642
67566
|
]
|
|
67643
67567
|
}
|
|
67644
67568
|
),
|
|
67645
|
-
CustomElement: () => /* @__PURE__ */
|
|
67569
|
+
CustomElement: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
67646
67570
|
Wizard,
|
|
67647
67571
|
{
|
|
67648
67572
|
name: generateFlow.value.type,
|
|
67649
67573
|
steps: [
|
|
67650
|
-
/* @__PURE__ */
|
|
67574
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
67651
67575
|
FlowSelector,
|
|
67652
67576
|
{
|
|
67653
67577
|
generateFlows,
|
|
@@ -67659,13 +67583,12 @@ var GenerateCommand = ({
|
|
|
67659
67583
|
]
|
|
67660
67584
|
}
|
|
67661
67585
|
),
|
|
67662
|
-
|
|
67663
|
-
SiteWidget: () => /* @__PURE__ */ import_react37.default.createElement(
|
|
67586
|
+
EditorReactComponent: () => /* @__PURE__ */ import_react36.default.createElement(
|
|
67664
67587
|
Wizard,
|
|
67665
67588
|
{
|
|
67666
67589
|
name: generateFlow.value.type,
|
|
67667
67590
|
steps: [
|
|
67668
|
-
/* @__PURE__ */
|
|
67591
|
+
/* @__PURE__ */ import_react36.default.createElement(
|
|
67669
67592
|
FlowSelector,
|
|
67670
67593
|
{
|
|
67671
67594
|
generateFlows,
|
|
@@ -67673,12 +67596,13 @@ var GenerateCommand = ({
|
|
|
67673
67596
|
onSubmit: setGenerateFlow
|
|
67674
67597
|
}
|
|
67675
67598
|
),
|
|
67676
|
-
...
|
|
67599
|
+
...generateEditorReactComponentSteps
|
|
67677
67600
|
]
|
|
67678
67601
|
}
|
|
67679
67602
|
),
|
|
67680
|
-
|
|
67681
|
-
|
|
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 }),
|
|
67682
67606
|
default: () => null
|
|
67683
67607
|
})
|
|
67684
67608
|
));
|
|
@@ -67697,4 +67621,4 @@ ejs/lib/ejs.js:
|
|
|
67697
67621
|
* @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
|
|
67698
67622
|
*)
|
|
67699
67623
|
*/
|
|
67700
|
-
//# sourceMappingURL=GenerateCommand-
|
|
67624
|
+
//# sourceMappingURL=GenerateCommand-HBDOFKE3.js.map
|