@wix/cli-app 1.1.104 → 1.1.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/{AddPermissionCommand-BEOK7PZ4.js → AddPermissionCommand-QEKDCRQW.js} +2 -2
- package/build/{DevCommand-Z3GQGRQO.js → DevCommand-736A5TG3.js} +28 -10
- package/build/{DevCommand-Z3GQGRQO.js.map → DevCommand-736A5TG3.js.map} +1 -1
- package/build/{GenerateCommand-7DARNLA7.js → GenerateCommand-F6WNIVZH.js} +201 -238
- package/build/GenerateCommand-F6WNIVZH.js.map +1 -0
- package/build/{LogsCommand-3XYEAMY7.js → LogsCommand-POFQ7L7U.js} +3 -3
- package/build/PreviewCommand-DGVLJIC5.js +19 -0
- package/build/ReleaseCommand-BK665XSD.js +23 -0
- package/build/{ServeCommand-D7WDZIOW.js → ServeCommand-LLCIQQ4X.js} +3 -3
- package/build/{build-XYLS7AOS.js → build-HZ5SXQHP.js} +6 -6
- package/build/{chunk-XA4RPO4T.js → chunk-2X5STX6V.js} +2 -2
- package/build/{chunk-V23BCBX3.js → chunk-4IYY6ZGZ.js} +19 -10
- package/build/{chunk-V23BCBX3.js.map → chunk-4IYY6ZGZ.js.map} +1 -1
- package/build/{chunk-7EMCPTOG.js → chunk-4TQGXVYE.js} +3 -3
- package/build/{chunk-GKSCRLAY.js → chunk-5Y7LGHZ6.js} +2 -2
- package/build/{chunk-UKJ775WP.js → chunk-7JLHWVDX.js} +2 -2
- package/build/{chunk-E5RCLVUI.js → chunk-7QAX4LBK.js} +45 -49
- package/build/chunk-7QAX4LBK.js.map +1 -0
- package/build/{chunk-2A7BQL62.js → chunk-BFLRYBN2.js} +4 -4
- package/build/{chunk-UNKB5G5S.js → chunk-BINOF7AQ.js} +7 -7
- package/build/chunk-BINOF7AQ.js.map +1 -0
- package/build/{chunk-B4PE24NJ.js → chunk-E6VEU7TV.js} +609 -45
- package/build/{chunk-B4PE24NJ.js.map → chunk-E6VEU7TV.js.map} +1 -1
- package/build/{chunk-7LMKRM53.js → chunk-FWWBKP43.js} +2 -2
- package/build/{chunk-TIONGKXR.js → chunk-G32WRBNI.js} +2 -2
- package/build/{chunk-SVYXNRMH.js → chunk-NWQVBGCX.js} +2 -2
- package/build/{chunk-QR3SSJAV.js → chunk-PEMPZ5MM.js} +2 -2
- package/build/{chunk-4X457QCO.js → chunk-VDPMGGS6.js} +12 -15
- package/build/{chunk-4X457QCO.js.map → chunk-VDPMGGS6.js.map} +1 -1
- package/build/{chunk-5U6N7S66.js → chunk-VMKXYUIA.js} +4 -4
- package/build/{chunk-VNLE7QSE.js → chunk-XPAQVBEL.js} +2 -2
- package/build/{chunk-XJWKNKHT.js → chunk-XW5CZ6RF.js} +678 -14
- package/build/chunk-XW5CZ6RF.js.map +1 -0
- package/build/index.js +23 -23
- package/build/platform-sdk/editor.js +3 -3
- package/build/platform-sdk/editor.js.map +1 -1
- package/build/{preview-TDYUVTUM.js → preview-R6YTZ7DV.js} +14 -14
- package/build/preview-R6YTZ7DV.js.map +1 -0
- package/build/{release-CWTR5WKZ.js → release-IJJ3EB2C.js} +14 -14
- package/build/{render-command-7J2YMXLZ.js → render-command-FJOPHPRO.js} +5 -5
- package/package.json +4 -5
- package/templates/site-plugin/files/plugin.tsx.ejs +2 -0
- package/build/GenerateCommand-7DARNLA7.js.map +0 -1
- package/build/PreviewCommand-U2UKT324.js +0 -19
- package/build/ReleaseCommand-77PZBKAL.js +0 -23
- package/build/chunk-E5RCLVUI.js.map +0 -1
- package/build/chunk-UNKB5G5S.js.map +0 -1
- package/build/chunk-XJWKNKHT.js.map +0 -1
- package/build/preview-TDYUVTUM.js.map +0 -1
- /package/build/{AddPermissionCommand-BEOK7PZ4.js.map → AddPermissionCommand-QEKDCRQW.js.map} +0 -0
- /package/build/{LogsCommand-3XYEAMY7.js.map → LogsCommand-POFQ7L7U.js.map} +0 -0
- /package/build/{PreviewCommand-U2UKT324.js.map → PreviewCommand-DGVLJIC5.js.map} +0 -0
- /package/build/{ReleaseCommand-77PZBKAL.js.map → ReleaseCommand-BK665XSD.js.map} +0 -0
- /package/build/{ServeCommand-D7WDZIOW.js.map → ServeCommand-LLCIQQ4X.js.map} +0 -0
- /package/build/{build-XYLS7AOS.js.map → build-HZ5SXQHP.js.map} +0 -0
- /package/build/{chunk-XA4RPO4T.js.map → chunk-2X5STX6V.js.map} +0 -0
- /package/build/{chunk-7EMCPTOG.js.map → chunk-4TQGXVYE.js.map} +0 -0
- /package/build/{chunk-GKSCRLAY.js.map → chunk-5Y7LGHZ6.js.map} +0 -0
- /package/build/{chunk-UKJ775WP.js.map → chunk-7JLHWVDX.js.map} +0 -0
- /package/build/{chunk-2A7BQL62.js.map → chunk-BFLRYBN2.js.map} +0 -0
- /package/build/{chunk-7LMKRM53.js.map → chunk-FWWBKP43.js.map} +0 -0
- /package/build/{chunk-TIONGKXR.js.map → chunk-G32WRBNI.js.map} +0 -0
- /package/build/{chunk-SVYXNRMH.js.map → chunk-NWQVBGCX.js.map} +0 -0
- /package/build/{chunk-QR3SSJAV.js.map → chunk-PEMPZ5MM.js.map} +0 -0
- /package/build/{chunk-5U6N7S66.js.map → chunk-VMKXYUIA.js.map} +0 -0
- /package/build/{chunk-VNLE7QSE.js.map → chunk-XPAQVBEL.js.map} +0 -0
- /package/build/{release-CWTR5WKZ.js.map → release-IJJ3EB2C.js.map} +0 -0
- /package/build/{render-command-7J2YMXLZ.js.map → render-command-FJOPHPRO.js.map} +0 -0
|
@@ -3,22 +3,22 @@ const require = _createRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
createPackageManager,
|
|
5
5
|
getRepoType
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-G32WRBNI.js";
|
|
7
7
|
import {
|
|
8
8
|
createI18nT,
|
|
9
9
|
getGenerateFlowByDocsExtensionType,
|
|
10
10
|
useGenerateFlows
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-XPAQVBEL.js";
|
|
12
12
|
import "./chunk-T5HHDBBR.js";
|
|
13
13
|
import {
|
|
14
14
|
useWixCliAppBi
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-7JLHWVDX.js";
|
|
16
16
|
import {
|
|
17
17
|
componentGenerator,
|
|
18
18
|
dependenciesUpdater,
|
|
19
19
|
require_lodash,
|
|
20
20
|
useBackendComponents
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-PEMPZ5MM.js";
|
|
22
22
|
import "./chunk-GWE3BRHX.js";
|
|
23
23
|
import {
|
|
24
24
|
getEcomRequiredApps,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
require_setToArray,
|
|
36
36
|
require_toSource,
|
|
37
37
|
useExtensionDataClient
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-XW5CZ6RF.js";
|
|
39
39
|
import {
|
|
40
40
|
AsyncCallbackStatus,
|
|
41
41
|
BACKEND_DIR,
|
|
@@ -84,9 +84,7 @@ import {
|
|
|
84
84
|
getSitePluginsDir,
|
|
85
85
|
getSiteWidgetsDir,
|
|
86
86
|
getTSConfigFilePath,
|
|
87
|
-
getTestOverrides,
|
|
88
87
|
normalizeGlobbyPattern,
|
|
89
|
-
pRetry,
|
|
90
88
|
pathValidation,
|
|
91
89
|
relativeFolderName,
|
|
92
90
|
require_Symbol,
|
|
@@ -108,15 +106,13 @@ import {
|
|
|
108
106
|
useDevCenterClient,
|
|
109
107
|
useErrorReporter,
|
|
110
108
|
useExtensions,
|
|
111
|
-
useHttpClient,
|
|
112
109
|
useProjectModel,
|
|
113
110
|
useTranslation,
|
|
114
111
|
useValidation,
|
|
115
112
|
use_input_default,
|
|
116
113
|
uuidValidation,
|
|
117
|
-
writeJson
|
|
118
|
-
|
|
119
|
-
} from "./chunk-B4PE24NJ.js";
|
|
114
|
+
writeJson
|
|
115
|
+
} from "./chunk-E6VEU7TV.js";
|
|
120
116
|
import {
|
|
121
117
|
__commonJS,
|
|
122
118
|
__dirname,
|
|
@@ -1576,7 +1572,7 @@ init_esm_shims();
|
|
|
1576
1572
|
|
|
1577
1573
|
// src/components/GenerateCommand/GenerateCommand.tsx
|
|
1578
1574
|
init_esm_shims();
|
|
1579
|
-
var
|
|
1575
|
+
var import_react35 = __toESM(require_react(), 1);
|
|
1580
1576
|
var import_variant14 = __toESM(require_lib(), 1);
|
|
1581
1577
|
|
|
1582
1578
|
// src/components/GenerateCommand/dashboad-page/DashboardPage.tsx
|
|
@@ -3990,84 +3986,12 @@ var DashboardPlugin = ({ flow }) => {
|
|
|
3990
3986
|
|
|
3991
3987
|
// src/components/GenerateCommand/site-plugin/SitePlugin.tsx
|
|
3992
3988
|
init_esm_shims();
|
|
3993
|
-
var
|
|
3989
|
+
var import_react25 = __toESM(require_react(), 1);
|
|
3994
3990
|
var import_variant13 = __toESM(require_lib(), 1);
|
|
3995
3991
|
|
|
3996
|
-
// ../site-plugin-client/src/index.ts
|
|
3997
|
-
init_esm_shims();
|
|
3998
|
-
|
|
3999
|
-
// ../site-plugin-client/src/site-plugin-client.ts
|
|
4000
|
-
init_esm_shims();
|
|
4001
|
-
|
|
4002
|
-
// ../site-plugin-client/src/schemas.ts
|
|
4003
|
-
init_esm_shims();
|
|
4004
|
-
var placementSchema = z.object({
|
|
4005
|
-
appDefinitionId: z.string(),
|
|
4006
|
-
widgetId: z.string(),
|
|
4007
|
-
slotId: z.string(),
|
|
4008
|
-
appName: z.string(),
|
|
4009
|
-
widgetName: z.string(),
|
|
4010
|
-
dependencyAppDefinitionId: z.string()
|
|
4011
|
-
}).passthrough();
|
|
4012
|
-
var placementsSchema = z.object({
|
|
4013
|
-
placements: z.array(placementSchema)
|
|
4014
|
-
}).passthrough();
|
|
4015
|
-
|
|
4016
|
-
// ../site-plugin-client/src/data/widget-docs.json
|
|
4017
|
-
var widget_docs_default = {
|
|
4018
|
-
"13afb094-84f9-739f-44fd-78d036adb028": "https://wix.to/jPWO9GZ",
|
|
4019
|
-
"bda15dc1-816d-4ff3-8dcb-1172d5343cce": "https://wix.to/sfoURR8",
|
|
4020
|
-
"14fd5970-8072-c276-1246-058b79e70c1a": "https://wix.to/FPbvzSu",
|
|
4021
|
-
"6a25b678-53ec-4b37-a190-65fcd1ca1a63": "https://wix.to/VBf3XkQ",
|
|
4022
|
-
"13a94f09-2766-3c40-4a32-8edb5acdd8bc": "https://wix.to/awqi86g",
|
|
4023
|
-
"a91a0543-d4bd-4e6b-b315-9410aa27bcde": "https://wix.to/BaNrGoT",
|
|
4024
|
-
"14d2abc2-5350-6322-487d-8c16ff833c8a": "https://wix.to/GHJRTYr"
|
|
4025
|
-
};
|
|
4026
|
-
|
|
4027
|
-
// ../site-plugin-client/src/site-plugin-client.ts
|
|
4028
|
-
var SitePluginClient = class {
|
|
4029
|
-
constructor(httpClient) {
|
|
4030
|
-
this.httpClient = httpClient;
|
|
4031
|
-
const { minRetryTimeout } = getTestOverrides();
|
|
4032
|
-
this.retryOptions = {
|
|
4033
|
-
retries: 3,
|
|
4034
|
-
minTimeout: minRetryTimeout,
|
|
4035
|
-
maxTimeout: 3 * 1e3
|
|
4036
|
-
};
|
|
4037
|
-
}
|
|
4038
|
-
retryOptions;
|
|
4039
|
-
getPlacements = async () => {
|
|
4040
|
-
try {
|
|
4041
|
-
const { data } = await pRetry(
|
|
4042
|
-
() => this.httpClient.get(
|
|
4043
|
-
"/_serverless/editor-platform-widget-plugins/placements"
|
|
4044
|
-
),
|
|
4045
|
-
this.retryOptions
|
|
4046
|
-
);
|
|
4047
|
-
return placementsSchema.parse(data);
|
|
4048
|
-
} catch (e) {
|
|
4049
|
-
throw new CliError({
|
|
4050
|
-
code: CliErrorCode.FailedToGetPlacements(),
|
|
4051
|
-
cause: e
|
|
4052
|
-
});
|
|
4053
|
-
}
|
|
4054
|
-
};
|
|
4055
|
-
getWidgetDocsUrl = (widgetId) => {
|
|
4056
|
-
return widget_docs_default[widgetId];
|
|
4057
|
-
};
|
|
4058
|
-
};
|
|
4059
|
-
|
|
4060
|
-
// ../site-plugin-client/src/useSitePluginClient.ts
|
|
4061
|
-
init_esm_shims();
|
|
4062
|
-
var import_react24 = __toESM(require_react(), 1);
|
|
4063
|
-
function useSitePluginClient() {
|
|
4064
|
-
const httpClient = useHttpClient({ type: "general" });
|
|
4065
|
-
return (0, import_react24.useMemo)(() => new SitePluginClient(httpClient), [httpClient]);
|
|
4066
|
-
}
|
|
4067
|
-
|
|
4068
3992
|
// src/components/GenerateCommand/site-plugin/SitePluginWizard.tsx
|
|
4069
3993
|
init_esm_shims();
|
|
4070
|
-
var
|
|
3994
|
+
var import_react24 = __toESM(require_react(), 1);
|
|
4071
3995
|
var import_variant12 = __toESM(require_lib(), 1);
|
|
4072
3996
|
var import_lodash6 = __toESM(require_lodash(), 1);
|
|
4073
3997
|
var import_uniqBy = __toESM(require_uniqBy(), 1);
|
|
@@ -4121,87 +4045,117 @@ async function generateSitePlugin(projectFolder, placements, folder, name, widge
|
|
|
4121
4045
|
}
|
|
4122
4046
|
|
|
4123
4047
|
// src/components/GenerateCommand/site-plugin/SitePluginWizard.tsx
|
|
4124
|
-
var SitePluginWizard = ({
|
|
4048
|
+
var SitePluginWizard = ({
|
|
4049
|
+
widgetPlugins
|
|
4050
|
+
}) => {
|
|
4125
4051
|
const bi = useWixCliAppBi();
|
|
4126
4052
|
const { t: t2 } = useTranslation();
|
|
4127
4053
|
const { model } = useProjectModel();
|
|
4128
4054
|
const { addRequiredApp } = useDevCenterClient();
|
|
4129
|
-
const { getWidgetDocsUrl } =
|
|
4130
|
-
const pluginApplications = (0,
|
|
4131
|
-
() => (0, import_uniqBy.default)(
|
|
4055
|
+
const { getWidgetDocsUrl } = useExtensionDataClient();
|
|
4056
|
+
const pluginApplications = (0, import_react24.useMemo)(
|
|
4057
|
+
() => (0, import_uniqBy.default)(widgetPlugins, "appName").map((pluginPlacement) => ({
|
|
4132
4058
|
value: pluginPlacement.appName,
|
|
4133
4059
|
title: pluginPlacement.appName
|
|
4134
4060
|
})),
|
|
4135
|
-
[
|
|
4061
|
+
[widgetPlugins]
|
|
4136
4062
|
);
|
|
4137
4063
|
const extensionType = t2("generate_command.flow.site_plugin").toLowerCase();
|
|
4138
4064
|
const validateFolderName = useCustomElementDirectoryValidation("Site plugin");
|
|
4139
4065
|
const validateName = useCustomElementNameValidation();
|
|
4140
|
-
const [
|
|
4141
|
-
const [
|
|
4142
|
-
const [placementApp, setPlacementApp] = (0,
|
|
4143
|
-
const [pluginFolder, setPluginFolder] = (0,
|
|
4144
|
-
const [pluginName, setPluginName] = (0,
|
|
4145
|
-
const [finishedInstallation, setFinishedInstallation] = (0,
|
|
4066
|
+
const [slot, setSlot] = (0, import_react24.useState)();
|
|
4067
|
+
const [requireAppsIds, setRequireAppsIds] = (0, import_react24.useState)();
|
|
4068
|
+
const [placementApp, setPlacementApp] = (0, import_react24.useState)();
|
|
4069
|
+
const [pluginFolder, setPluginFolder] = (0, import_react24.useState)();
|
|
4070
|
+
const [pluginName, setPluginName] = (0, import_react24.useState)();
|
|
4071
|
+
const [finishedInstallation, setFinishedInstallation] = (0, import_react24.useState)(false);
|
|
4146
4072
|
const defaultPluginFolder = (0, import_lodash6.kebabCase)(pluginName);
|
|
4147
|
-
const widgetSlots = (0,
|
|
4148
|
-
() => placementApp ?
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
}
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4073
|
+
const widgetSlots = (0, import_react24.useMemo)(
|
|
4074
|
+
() => placementApp ? widgetPlugins.filter((widgetPlugin) => widgetPlugin.appName === placementApp).reduce(
|
|
4075
|
+
(_widgetSlots, widgetPlugin) => {
|
|
4076
|
+
const widgetDocsUrl = getWidgetDocsUrl(
|
|
4077
|
+
widgetPlugin.component.componentId
|
|
4078
|
+
);
|
|
4079
|
+
const description = widgetDocsUrl && /* @__PURE__ */ import_react24.default.createElement(Text, { skin: "secondary" }, /* @__PURE__ */ import_react24.default.createElement(
|
|
4080
|
+
Trans,
|
|
4081
|
+
{
|
|
4082
|
+
i18nKey: "generate_command.site_plugin.widget_docs",
|
|
4083
|
+
components: [/* @__PURE__ */ import_react24.default.createElement(Link, { url: widgetDocsUrl })]
|
|
4084
|
+
}
|
|
4085
|
+
));
|
|
4086
|
+
_widgetSlots[widgetPlugin.component.componentId] ??= {
|
|
4087
|
+
title: widgetPlugin.component.name,
|
|
4088
|
+
description,
|
|
4089
|
+
items: []
|
|
4090
|
+
};
|
|
4091
|
+
for (const placement of widgetPlugin.component.data.widgetPlugin.placements) {
|
|
4092
|
+
_widgetSlots[widgetPlugin.component.componentId]?.items.push({
|
|
4093
|
+
key: placement.slotId,
|
|
4094
|
+
title: placement.slotId,
|
|
4095
|
+
value: placement
|
|
4168
4096
|
});
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
) :
|
|
4174
|
-
[
|
|
4097
|
+
}
|
|
4098
|
+
return _widgetSlots;
|
|
4099
|
+
},
|
|
4100
|
+
{}
|
|
4101
|
+
) : {},
|
|
4102
|
+
[widgetPlugins, placementApp, getWidgetDocsUrl]
|
|
4175
4103
|
);
|
|
4176
4104
|
const generationTask = useGenerationTask(async () => {
|
|
4177
|
-
if (
|
|
4178
|
-
const
|
|
4179
|
-
if (
|
|
4105
|
+
if (pluginName && slot && requireAppsIds) {
|
|
4106
|
+
const requireAppId = requireAppsIds.at(0);
|
|
4107
|
+
if (requireAppId) {
|
|
4180
4108
|
await addRequiredApp({
|
|
4181
4109
|
appId: model.config.appId,
|
|
4182
|
-
appIdToRequire:
|
|
4110
|
+
appIdToRequire: requireAppId
|
|
4183
4111
|
});
|
|
4184
4112
|
}
|
|
4185
|
-
const { appDefinitionId, widgetId, slotId } = placement;
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4113
|
+
const { appDefinitionId, widgetId, slotId } = slot.placement;
|
|
4114
|
+
const widgetPlugin = widgetSlots[widgetId];
|
|
4115
|
+
if (widgetPlugin) {
|
|
4116
|
+
return generateSitePlugin(
|
|
4117
|
+
model.projectFolder,
|
|
4118
|
+
[{ appDefinitionId, widgetId, slotId }],
|
|
4119
|
+
pluginFolder ?? defaultPluginFolder,
|
|
4120
|
+
pluginName,
|
|
4121
|
+
widgetPlugin.title,
|
|
4122
|
+
getWidgetDocsUrl(widgetId)
|
|
4123
|
+
);
|
|
4124
|
+
}
|
|
4194
4125
|
}
|
|
4195
|
-
}, [pluginFolder, pluginName,
|
|
4196
|
-
|
|
4126
|
+
}, [pluginFolder, pluginName, slot, widgetSlots, getWidgetDocsUrl]);
|
|
4127
|
+
const handleSetSlot = (0, import_react24.useCallback)(
|
|
4128
|
+
(placement) => {
|
|
4129
|
+
void getEcomRequiredApps().then((ecomRequiredApp) => {
|
|
4130
|
+
const widgetPlugin = widgetPlugins.find(
|
|
4131
|
+
(widgetPlugin2) => widgetPlugin2.component.componentId === placement.widgetId
|
|
4132
|
+
);
|
|
4133
|
+
if (ecomRequiredApp.appId === widgetPlugin?.appId) {
|
|
4134
|
+
setSlot({ requiredApps: ecomRequiredApp.requiredApps, placement });
|
|
4135
|
+
} else {
|
|
4136
|
+
setSlot({
|
|
4137
|
+
requiredApps: [
|
|
4138
|
+
{
|
|
4139
|
+
appId: widgetPlugin.appId,
|
|
4140
|
+
appName: widgetPlugin.appName
|
|
4141
|
+
}
|
|
4142
|
+
],
|
|
4143
|
+
placement
|
|
4144
|
+
});
|
|
4145
|
+
}
|
|
4146
|
+
});
|
|
4147
|
+
},
|
|
4148
|
+
[widgetPlugins]
|
|
4149
|
+
);
|
|
4150
|
+
return /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, null, /* @__PURE__ */ import_react24.default.createElement(
|
|
4197
4151
|
SelectInput,
|
|
4198
4152
|
{
|
|
4199
4153
|
label: t2("generate_command.site_plugin.plugin_app"),
|
|
4200
|
-
info: /* @__PURE__ */
|
|
4154
|
+
info: /* @__PURE__ */ import_react24.default.createElement(
|
|
4201
4155
|
Trans,
|
|
4202
4156
|
{
|
|
4203
4157
|
i18nKey: "generate_command.site_plugin.plugin_app.description",
|
|
4204
|
-
components: [/* @__PURE__ */
|
|
4158
|
+
components: [/* @__PURE__ */ import_react24.default.createElement(Link, { url: "https://wix.to/Onfe4XJ" })]
|
|
4205
4159
|
}
|
|
4206
4160
|
),
|
|
4207
4161
|
options: pluginApplications,
|
|
@@ -4215,11 +4169,11 @@ var SitePluginWizard = ({ placements }) => {
|
|
|
4215
4169
|
setPlacementApp(option.value);
|
|
4216
4170
|
}
|
|
4217
4171
|
}
|
|
4218
|
-
), placementApp && /* @__PURE__ */
|
|
4172
|
+
), placementApp && /* @__PURE__ */ import_react24.default.createElement(
|
|
4219
4173
|
SelectGroupsInput,
|
|
4220
4174
|
{
|
|
4221
4175
|
label: t2("generate_command.site_plugin.choose_placement"),
|
|
4222
|
-
groups: widgetSlots,
|
|
4176
|
+
groups: Object.values(widgetSlots),
|
|
4223
4177
|
onSubmit: (option) => {
|
|
4224
4178
|
bi.cliFlowStepAnswered({
|
|
4225
4179
|
question: t2("generate_command.site_plugin.choose_placement"),
|
|
@@ -4227,22 +4181,30 @@ var SitePluginWizard = ({ placements }) => {
|
|
|
4227
4181
|
answer: option.title,
|
|
4228
4182
|
additionalInfo: option.value
|
|
4229
4183
|
});
|
|
4230
|
-
|
|
4184
|
+
handleSetSlot(option.value);
|
|
4231
4185
|
}
|
|
4232
4186
|
}
|
|
4233
|
-
),
|
|
4187
|
+
), slot?.requiredApps && (slot.requiredApps.length === 1 ? /* @__PURE__ */ import_react24.default.createElement(
|
|
4234
4188
|
AppRequirement,
|
|
4235
4189
|
{
|
|
4236
4190
|
appId: model.config.appId,
|
|
4237
|
-
requiredApps:
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
],
|
|
4243
|
-
onSubmit: setAppsToRequire
|
|
4191
|
+
requiredApps: slot.requiredApps.map((requiredApp) => ({
|
|
4192
|
+
id: requiredApp.appId,
|
|
4193
|
+
name: requiredApp.appName
|
|
4194
|
+
})),
|
|
4195
|
+
onSubmit: setRequireAppsIds
|
|
4244
4196
|
}
|
|
4245
|
-
)
|
|
4197
|
+
) : /* @__PURE__ */ import_react24.default.createElement(
|
|
4198
|
+
MultipleAppRequirement,
|
|
4199
|
+
{
|
|
4200
|
+
appId: model.config.appId,
|
|
4201
|
+
requiredApps: slot.requiredApps.map((requiredApp) => ({
|
|
4202
|
+
id: requiredApp.appId,
|
|
4203
|
+
name: requiredApp.appName
|
|
4204
|
+
})),
|
|
4205
|
+
onSubmit: setRequireAppsIds
|
|
4206
|
+
}
|
|
4207
|
+
)), requireAppsIds && /* @__PURE__ */ import_react24.default.createElement(
|
|
4246
4208
|
TextInput,
|
|
4247
4209
|
{
|
|
4248
4210
|
label: t2("generate_command.site_plugin.choose_name"),
|
|
@@ -4260,36 +4222,37 @@ var SitePluginWizard = ({ placements }) => {
|
|
|
4260
4222
|
},
|
|
4261
4223
|
validate: validateName
|
|
4262
4224
|
}
|
|
4263
|
-
), pluginName && /* @__PURE__ */
|
|
4225
|
+
), pluginName && /* @__PURE__ */ import_react24.default.createElement(
|
|
4264
4226
|
TextInput,
|
|
4265
4227
|
{
|
|
4266
4228
|
label: t2("generate_command.site_plugin.choose_folder"),
|
|
4267
4229
|
placeholder: defaultPluginFolder,
|
|
4268
4230
|
onSubmit: (value) => {
|
|
4231
|
+
const finalValue = value || defaultPluginFolder;
|
|
4269
4232
|
bi.cliFlowStepAnswered({
|
|
4270
4233
|
question: t2("generate_command.site_plugin.choose_folder"),
|
|
4271
4234
|
questionKey: "generate_command.site_plugin.choose_folder",
|
|
4272
|
-
answer:
|
|
4235
|
+
answer: finalValue,
|
|
4273
4236
|
additionalInfo: {
|
|
4274
4237
|
extensionType
|
|
4275
4238
|
}
|
|
4276
4239
|
});
|
|
4277
|
-
setPluginFolder(
|
|
4240
|
+
setPluginFolder(finalValue);
|
|
4278
4241
|
},
|
|
4279
4242
|
validate: validateFolderName
|
|
4280
4243
|
}
|
|
4281
|
-
), (0,
|
|
4244
|
+
), (0, import_react24.useMemo)(
|
|
4282
4245
|
() => (0, import_variant12.match)(generationTask, {
|
|
4283
4246
|
Success: ({ hasUpdatedDependencies, newFiles }) => {
|
|
4284
4247
|
if (!hasUpdatedDependencies) {
|
|
4285
4248
|
setFinishedInstallation(true);
|
|
4286
4249
|
}
|
|
4287
|
-
return /* @__PURE__ */
|
|
4250
|
+
return /* @__PURE__ */ import_react24.default.createElement(import_react24.default.Fragment, null, hasUpdatedDependencies && /* @__PURE__ */ import_react24.default.createElement(
|
|
4288
4251
|
InstallDependencies,
|
|
4289
4252
|
{
|
|
4290
4253
|
onFinish: () => setFinishedInstallation(true)
|
|
4291
4254
|
}
|
|
4292
|
-
), finishedInstallation && /* @__PURE__ */
|
|
4255
|
+
), finishedInstallation && /* @__PURE__ */ import_react24.default.createElement(
|
|
4293
4256
|
GenerationSuccessMessage,
|
|
4294
4257
|
{
|
|
4295
4258
|
extensionType,
|
|
@@ -4298,7 +4261,7 @@ var SitePluginWizard = ({ placements }) => {
|
|
|
4298
4261
|
}
|
|
4299
4262
|
));
|
|
4300
4263
|
},
|
|
4301
|
-
Loading: () => /* @__PURE__ */
|
|
4264
|
+
Loading: () => /* @__PURE__ */ import_react24.default.createElement(
|
|
4302
4265
|
Spinner,
|
|
4303
4266
|
{
|
|
4304
4267
|
text: t2("generate_command.generation.loading", {
|
|
@@ -4322,18 +4285,18 @@ var SitePluginWizard = ({ placements }) => {
|
|
|
4322
4285
|
// src/components/GenerateCommand/site-plugin/SitePlugin.tsx
|
|
4323
4286
|
var GenerateSitePlugin = () => {
|
|
4324
4287
|
const { t: t2 } = useTranslation();
|
|
4325
|
-
const {
|
|
4326
|
-
const { status } = useAsync(
|
|
4288
|
+
const { getWidgetPlugins } = useExtensionDataClient();
|
|
4289
|
+
const { status } = useAsync(getWidgetPlugins, []);
|
|
4327
4290
|
return (0, import_variant13.match)(status, {
|
|
4328
4291
|
Error: () => null,
|
|
4329
|
-
Loading: () => /* @__PURE__ */
|
|
4330
|
-
Success: ({ result }) => /* @__PURE__ */
|
|
4292
|
+
Loading: () => /* @__PURE__ */ import_react25.default.createElement(Spinner, { text: t2("general.loading") }),
|
|
4293
|
+
Success: ({ result }) => /* @__PURE__ */ import_react25.default.createElement(SitePluginWizard, { widgetPlugins: result })
|
|
4331
4294
|
});
|
|
4332
4295
|
};
|
|
4333
4296
|
|
|
4334
4297
|
// src/components/GenerateCommand/api/Api.tsx
|
|
4335
4298
|
init_esm_shims();
|
|
4336
|
-
var
|
|
4299
|
+
var import_react27 = __toESM(require_react(), 1);
|
|
4337
4300
|
|
|
4338
4301
|
// src/components/GenerateCommand/api/generate.ts
|
|
4339
4302
|
init_esm_shims();
|
|
@@ -4366,13 +4329,13 @@ async function generateWebMethod(projectFolder, folderPath) {
|
|
|
4366
4329
|
|
|
4367
4330
|
// src/components/GenerateCommand/api/steps.tsx
|
|
4368
4331
|
init_esm_shims();
|
|
4369
|
-
var
|
|
4332
|
+
var import_react26 = __toESM(require_react(), 1);
|
|
4370
4333
|
import { join as join2 } from "node:path";
|
|
4371
4334
|
var SelectApiTypeStep = ({ onSubmit, docsExtensionType }) => {
|
|
4372
4335
|
const { t: t2 } = useTranslation();
|
|
4373
4336
|
const bi = useWixCliAppBi();
|
|
4374
4337
|
const { isActive, goToNextStep } = useWizardStep();
|
|
4375
|
-
const webMethodOption = (0,
|
|
4338
|
+
const webMethodOption = (0, import_react26.useMemo)(
|
|
4376
4339
|
() => ({
|
|
4377
4340
|
title: t2("generate_command.api.web_method"),
|
|
4378
4341
|
description: t2("generate_command.api.web_method.description"),
|
|
@@ -4380,7 +4343,7 @@ var SelectApiTypeStep = ({ onSubmit, docsExtensionType }) => {
|
|
|
4380
4343
|
}),
|
|
4381
4344
|
[t2]
|
|
4382
4345
|
);
|
|
4383
|
-
const httpFunctionOption = (0,
|
|
4346
|
+
const httpFunctionOption = (0, import_react26.useMemo)(
|
|
4384
4347
|
() => ({
|
|
4385
4348
|
title: t2("generate_command.api.http_function"),
|
|
4386
4349
|
description: t2("generate_command.api.http_function.description"),
|
|
@@ -4388,7 +4351,7 @@ var SelectApiTypeStep = ({ onSubmit, docsExtensionType }) => {
|
|
|
4388
4351
|
}),
|
|
4389
4352
|
[t2]
|
|
4390
4353
|
);
|
|
4391
|
-
const apiOption = (0,
|
|
4354
|
+
const apiOption = (0, import_react26.useMemo)(() => {
|
|
4392
4355
|
if (docsExtensionType === "HTTP_FUNCTION") {
|
|
4393
4356
|
return InputState.Submitted(httpFunctionOption);
|
|
4394
4357
|
}
|
|
@@ -4406,21 +4369,21 @@ var SelectApiTypeStep = ({ onSubmit, docsExtensionType }) => {
|
|
|
4406
4369
|
onSubmit(option.value);
|
|
4407
4370
|
goToNextStep();
|
|
4408
4371
|
};
|
|
4409
|
-
(0,
|
|
4372
|
+
(0, import_react26.useEffect)(() => {
|
|
4410
4373
|
if (apiOption) {
|
|
4411
4374
|
handleSubmit(apiOption.value);
|
|
4412
4375
|
}
|
|
4413
4376
|
}, []);
|
|
4414
|
-
return /* @__PURE__ */
|
|
4377
|
+
return /* @__PURE__ */ import_react26.default.createElement(
|
|
4415
4378
|
SelectInput,
|
|
4416
4379
|
{
|
|
4417
4380
|
isActive,
|
|
4418
4381
|
value: apiOption,
|
|
4419
|
-
info: /* @__PURE__ */
|
|
4382
|
+
info: /* @__PURE__ */ import_react26.default.createElement(
|
|
4420
4383
|
Trans,
|
|
4421
4384
|
{
|
|
4422
4385
|
i18nKey: "generate_command.api.choose_type.info",
|
|
4423
|
-
components: [/* @__PURE__ */
|
|
4386
|
+
components: [/* @__PURE__ */ import_react26.default.createElement(Link, { url: "https://wix.to/pX4xyEn" })]
|
|
4424
4387
|
}
|
|
4425
4388
|
),
|
|
4426
4389
|
label: t2("generate_command.api.choose_type"),
|
|
@@ -4443,7 +4406,7 @@ var ApiFolderStep = ({ onSubmit }) => {
|
|
|
4443
4406
|
]
|
|
4444
4407
|
])
|
|
4445
4408
|
);
|
|
4446
|
-
return /* @__PURE__ */
|
|
4409
|
+
return /* @__PURE__ */ import_react26.default.createElement(
|
|
4447
4410
|
TextInput,
|
|
4448
4411
|
{
|
|
4449
4412
|
isActive,
|
|
@@ -4481,7 +4444,7 @@ var WebMethodFolderStep = ({ onSubmit }) => {
|
|
|
4481
4444
|
]
|
|
4482
4445
|
])
|
|
4483
4446
|
);
|
|
4484
|
-
return /* @__PURE__ */
|
|
4447
|
+
return /* @__PURE__ */ import_react26.default.createElement(
|
|
4485
4448
|
TextInput,
|
|
4486
4449
|
{
|
|
4487
4450
|
isActive,
|
|
@@ -4505,9 +4468,9 @@ var WebMethodFolderStep = ({ onSubmit }) => {
|
|
|
4505
4468
|
var useGenerateApi = (docsExtensionType) => {
|
|
4506
4469
|
const { t: t2 } = useTranslation();
|
|
4507
4470
|
const { model } = useProjectModel();
|
|
4508
|
-
const [selectedDocsExtensionType, setSelectedDocsExtensionType] = (0,
|
|
4509
|
-
const [apiType, setApiType] = (0,
|
|
4510
|
-
const [apiFolder, setApiFolder] = (0,
|
|
4471
|
+
const [selectedDocsExtensionType, setSelectedDocsExtensionType] = (0, import_react27.useState)(() => docsExtensionType);
|
|
4472
|
+
const [apiType, setApiType] = (0, import_react27.useState)();
|
|
4473
|
+
const [apiFolder, setApiFolder] = (0, import_react27.useState)();
|
|
4511
4474
|
const extensionType = apiType === "HttpFunction" ? t2("generate_command.flow.api.title").toLowerCase() : t2("generate_command.api.web_method.title").toLowerCase();
|
|
4512
4475
|
const generationTask = useGenerationTask(async () => {
|
|
4513
4476
|
if (apiFolder) {
|
|
@@ -4520,7 +4483,7 @@ var useGenerateApi = (docsExtensionType) => {
|
|
|
4520
4483
|
}
|
|
4521
4484
|
}, [model.projectFolder, apiFolder]);
|
|
4522
4485
|
return [
|
|
4523
|
-
/* @__PURE__ */
|
|
4486
|
+
/* @__PURE__ */ import_react27.default.createElement(
|
|
4524
4487
|
SelectApiTypeStep,
|
|
4525
4488
|
{
|
|
4526
4489
|
docsExtensionType: selectedDocsExtensionType,
|
|
@@ -4530,8 +4493,8 @@ var useGenerateApi = (docsExtensionType) => {
|
|
|
4530
4493
|
}
|
|
4531
4494
|
}
|
|
4532
4495
|
),
|
|
4533
|
-
apiType === "HttpFunction" ? /* @__PURE__ */
|
|
4534
|
-
/* @__PURE__ */
|
|
4496
|
+
apiType === "HttpFunction" ? /* @__PURE__ */ import_react27.default.createElement(ApiFolderStep, { onSubmit: setApiFolder }) : /* @__PURE__ */ import_react27.default.createElement(WebMethodFolderStep, { onSubmit: setApiFolder }),
|
|
4497
|
+
/* @__PURE__ */ import_react27.default.createElement(
|
|
4535
4498
|
CompleteGeneration,
|
|
4536
4499
|
{
|
|
4537
4500
|
generationTask,
|
|
@@ -4553,7 +4516,7 @@ var useGenerateApi = (docsExtensionType) => {
|
|
|
4553
4516
|
|
|
4554
4517
|
// src/components/GenerateCommand/event/Event.tsx
|
|
4555
4518
|
init_esm_shims();
|
|
4556
|
-
var
|
|
4519
|
+
var import_react29 = __toESM(require_react(), 1);
|
|
4557
4520
|
|
|
4558
4521
|
// src/components/GenerateCommand/event/generate.ts
|
|
4559
4522
|
init_esm_shims();
|
|
@@ -4570,7 +4533,7 @@ async function generateEvent(projectFolder, folderName) {
|
|
|
4570
4533
|
|
|
4571
4534
|
// src/components/GenerateCommand/event/steps.tsx
|
|
4572
4535
|
init_esm_shims();
|
|
4573
|
-
var
|
|
4536
|
+
var import_react28 = __toESM(require_react(), 1);
|
|
4574
4537
|
var ChooseFolderStep2 = ({ onSubmit, eventFolder }) => {
|
|
4575
4538
|
const bi = useWixCliAppBi();
|
|
4576
4539
|
const { t: t2 } = useTranslation();
|
|
@@ -4585,7 +4548,7 @@ var ChooseFolderStep2 = ({ onSubmit, eventFolder }) => {
|
|
|
4585
4548
|
]
|
|
4586
4549
|
])
|
|
4587
4550
|
);
|
|
4588
|
-
return /* @__PURE__ */
|
|
4551
|
+
return /* @__PURE__ */ import_react28.default.createElement(
|
|
4589
4552
|
TextInput,
|
|
4590
4553
|
{
|
|
4591
4554
|
isActive,
|
|
@@ -4609,7 +4572,7 @@ var ChooseFolderStep2 = ({ onSubmit, eventFolder }) => {
|
|
|
4609
4572
|
var useGenerateEvent = () => {
|
|
4610
4573
|
const { t: t2 } = useTranslation();
|
|
4611
4574
|
const { model } = useProjectModel();
|
|
4612
|
-
const [eventFolder, setEventFolder] = (0,
|
|
4575
|
+
const [eventFolder, setEventFolder] = (0, import_react29.useState)();
|
|
4613
4576
|
const extensionType = t2("generate_command.flow.event").toLowerCase();
|
|
4614
4577
|
const generationTask = useGenerationTask(async () => {
|
|
4615
4578
|
if (eventFolder) {
|
|
@@ -4617,8 +4580,8 @@ var useGenerateEvent = () => {
|
|
|
4617
4580
|
}
|
|
4618
4581
|
}, [model.projectFolder, eventFolder]);
|
|
4619
4582
|
return [
|
|
4620
|
-
/* @__PURE__ */
|
|
4621
|
-
/* @__PURE__ */
|
|
4583
|
+
/* @__PURE__ */ import_react29.default.createElement(ChooseFolderStep2, { onSubmit: setEventFolder, eventFolder }),
|
|
4584
|
+
/* @__PURE__ */ import_react29.default.createElement(
|
|
4622
4585
|
CompleteGeneration,
|
|
4623
4586
|
{
|
|
4624
4587
|
generationTask,
|
|
@@ -4638,11 +4601,11 @@ init_esm_shims();
|
|
|
4638
4601
|
|
|
4639
4602
|
// src/components/GenerateCommand/site-widget/SiteWidgetWizard.tsx
|
|
4640
4603
|
init_esm_shims();
|
|
4641
|
-
var
|
|
4604
|
+
var import_react34 = __toESM(require_react(), 1);
|
|
4642
4605
|
|
|
4643
4606
|
// src/components/GenerateCommand/site-widget/custom-element/CustomElement.tsx
|
|
4644
4607
|
init_esm_shims();
|
|
4645
|
-
var
|
|
4608
|
+
var import_react31 = __toESM(require_react(), 1);
|
|
4646
4609
|
|
|
4647
4610
|
// src/components/GenerateCommand/site-widget/custom-element/generate.ts
|
|
4648
4611
|
init_esm_shims();
|
|
@@ -4708,7 +4671,7 @@ async function generateCustomElement(projectFolder, folder, name, dashboardPageI
|
|
|
4708
4671
|
|
|
4709
4672
|
// src/components/GenerateCommand/site-widget/custom-element/steps.tsx
|
|
4710
4673
|
init_esm_shims();
|
|
4711
|
-
var
|
|
4674
|
+
var import_react30 = __toESM(require_react(), 1);
|
|
4712
4675
|
var import_lodash7 = __toESM(require_lodash(), 1);
|
|
4713
4676
|
var ChooseNameStep2 = ({ onSubmit, elementName }) => {
|
|
4714
4677
|
const bi = useWixCliAppBi();
|
|
@@ -4716,7 +4679,7 @@ var ChooseNameStep2 = ({ onSubmit, elementName }) => {
|
|
|
4716
4679
|
const { isActive, goToNextStep } = useWizardStep();
|
|
4717
4680
|
const extensionType = t2("generate_command.flow.custom_element").toLowerCase();
|
|
4718
4681
|
const validateName = useCustomElementNameValidation();
|
|
4719
|
-
return /* @__PURE__ */
|
|
4682
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
4720
4683
|
TextInput,
|
|
4721
4684
|
{
|
|
4722
4685
|
isActive,
|
|
@@ -4745,7 +4708,7 @@ var ChooseFolderStep3 = ({ onSubmit, elementFolder, elementName }) => {
|
|
|
4745
4708
|
const defaultElementFolder = (0, import_lodash7.kebabCase)(elementName);
|
|
4746
4709
|
const extensionType = t2("generate_command.flow.custom_element").toLowerCase();
|
|
4747
4710
|
const validateFolderName = useCustomElementDirectoryValidation("Site widget");
|
|
4748
|
-
return /* @__PURE__ */
|
|
4711
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
4749
4712
|
TextInput,
|
|
4750
4713
|
{
|
|
4751
4714
|
isActive,
|
|
@@ -4772,7 +4735,7 @@ var LinkDashboardPageStep = ({ onSubmit }) => {
|
|
|
4772
4735
|
const { t: t2 } = useTranslation();
|
|
4773
4736
|
const { isActive, goToNextStep } = useWizardStep();
|
|
4774
4737
|
const extensionType = t2("generate_command.flow.custom_element").toLowerCase();
|
|
4775
|
-
return /* @__PURE__ */
|
|
4738
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
4776
4739
|
ConfirmInput,
|
|
4777
4740
|
{
|
|
4778
4741
|
isActive,
|
|
@@ -4803,7 +4766,7 @@ var ChooseDashboardPageStep = ({ onSubmit }) => {
|
|
|
4803
4766
|
title
|
|
4804
4767
|
})
|
|
4805
4768
|
);
|
|
4806
|
-
return /* @__PURE__ */
|
|
4769
|
+
return /* @__PURE__ */ import_react30.default.createElement(
|
|
4807
4770
|
SelectInput,
|
|
4808
4771
|
{
|
|
4809
4772
|
isActive,
|
|
@@ -4828,10 +4791,10 @@ var useGenerateCustomElement = () => {
|
|
|
4828
4791
|
const { t: t2 } = useTranslation();
|
|
4829
4792
|
const { model } = useProjectModel();
|
|
4830
4793
|
const { getExtensions } = useExtensions();
|
|
4831
|
-
const [elementName, setElementName] = (0,
|
|
4832
|
-
const [elementFolder, setElementFolder] = (0,
|
|
4833
|
-
const [linkDashboardPage, setLinkDashboardPage] = (0,
|
|
4834
|
-
const [dashboardPageId, setDashboardPageId] = (0,
|
|
4794
|
+
const [elementName, setElementName] = (0, import_react31.useState)();
|
|
4795
|
+
const [elementFolder, setElementFolder] = (0, import_react31.useState)();
|
|
4796
|
+
const [linkDashboardPage, setLinkDashboardPage] = (0, import_react31.useState)();
|
|
4797
|
+
const [dashboardPageId, setDashboardPageId] = (0, import_react31.useState)();
|
|
4835
4798
|
const dashboardPages = getExtensions("DashboardPage");
|
|
4836
4799
|
const dashboardPagesExist = Boolean(dashboardPages.length);
|
|
4837
4800
|
const extensionType = t2("generate_command.flow.custom_element").toLowerCase();
|
|
@@ -4847,8 +4810,8 @@ var useGenerateCustomElement = () => {
|
|
|
4847
4810
|
}
|
|
4848
4811
|
}, [elementFolder, elementName, shouldGenerate]);
|
|
4849
4812
|
return [
|
|
4850
|
-
/* @__PURE__ */
|
|
4851
|
-
/* @__PURE__ */
|
|
4813
|
+
/* @__PURE__ */ import_react31.default.createElement(ChooseNameStep2, { onSubmit: setElementName, elementName }),
|
|
4814
|
+
/* @__PURE__ */ import_react31.default.createElement(
|
|
4852
4815
|
ChooseFolderStep3,
|
|
4853
4816
|
{
|
|
4854
4817
|
onSubmit: setElementFolder,
|
|
@@ -4856,9 +4819,9 @@ var useGenerateCustomElement = () => {
|
|
|
4856
4819
|
elementName
|
|
4857
4820
|
}
|
|
4858
4821
|
),
|
|
4859
|
-
...dashboardPagesExist ? [/* @__PURE__ */
|
|
4860
|
-
...dashboardPagesExist && linkDashboardPage ? [/* @__PURE__ */
|
|
4861
|
-
/* @__PURE__ */
|
|
4822
|
+
...dashboardPagesExist ? [/* @__PURE__ */ import_react31.default.createElement(LinkDashboardPageStep, { onSubmit: setLinkDashboardPage })] : [],
|
|
4823
|
+
...dashboardPagesExist && linkDashboardPage ? [/* @__PURE__ */ import_react31.default.createElement(ChooseDashboardPageStep, { onSubmit: setDashboardPageId })] : [],
|
|
4824
|
+
/* @__PURE__ */ import_react31.default.createElement(
|
|
4862
4825
|
CompleteGeneration,
|
|
4863
4826
|
{
|
|
4864
4827
|
generationTask,
|
|
@@ -4874,7 +4837,7 @@ var useGenerateCustomElement = () => {
|
|
|
4874
4837
|
|
|
4875
4838
|
// src/components/GenerateCommand/site-widget/blocks/Blocks.tsx
|
|
4876
4839
|
init_esm_shims();
|
|
4877
|
-
var
|
|
4840
|
+
var import_react33 = __toESM(require_react(), 1);
|
|
4878
4841
|
|
|
4879
4842
|
// src/components/GenerateCommand/site-widget/blocks/generate.ts
|
|
4880
4843
|
init_esm_shims();
|
|
@@ -4955,10 +4918,10 @@ async function enableBlocksInProject(projectFolder, config) {
|
|
|
4955
4918
|
|
|
4956
4919
|
// src/components/GenerateCommand/site-widget/blocks/BlocksGenerationSuccessMessage.tsx
|
|
4957
4920
|
init_esm_shims();
|
|
4958
|
-
var
|
|
4921
|
+
var import_react32 = __toESM(require_react(), 1);
|
|
4959
4922
|
var BlockGenerationSuccessMessage = () => {
|
|
4960
4923
|
const { t: t2 } = useTranslation();
|
|
4961
|
-
return /* @__PURE__ */
|
|
4924
|
+
return /* @__PURE__ */ import_react32.default.createElement(
|
|
4962
4925
|
Box_default,
|
|
4963
4926
|
{
|
|
4964
4927
|
borderColor: "blue",
|
|
@@ -4969,21 +4932,21 @@ var BlockGenerationSuccessMessage = () => {
|
|
|
4969
4932
|
gap: 1,
|
|
4970
4933
|
marginTop: 1
|
|
4971
4934
|
},
|
|
4972
|
-
/* @__PURE__ */
|
|
4973
|
-
/* @__PURE__ */
|
|
4935
|
+
/* @__PURE__ */ import_react32.default.createElement(Box_default, { marginTop: -2, marginLeft: 0 }, /* @__PURE__ */ import_react32.default.createElement(Text, { skin: "question", bold: true }, t2("generate_command.blocks.success.title"))),
|
|
4936
|
+
/* @__PURE__ */ import_react32.default.createElement(
|
|
4974
4937
|
Trans,
|
|
4975
4938
|
{
|
|
4976
4939
|
i18nKey: "generate_command.blocks.success.info.title",
|
|
4977
|
-
components: [/* @__PURE__ */
|
|
4940
|
+
components: [/* @__PURE__ */ import_react32.default.createElement(Rocket, null)]
|
|
4978
4941
|
}
|
|
4979
4942
|
),
|
|
4980
|
-
/* @__PURE__ */
|
|
4981
|
-
/* @__PURE__ */
|
|
4943
|
+
/* @__PURE__ */ import_react32.default.createElement(Box_default, { paddingLeft: 3 }, /* @__PURE__ */ import_react32.default.createElement(Trans, { i18nKey: "generate_command.blocks.success.info.steps" })),
|
|
4944
|
+
/* @__PURE__ */ import_react32.default.createElement(
|
|
4982
4945
|
Trans,
|
|
4983
4946
|
{
|
|
4984
4947
|
i18nKey: "generate_command.generation.learn_more",
|
|
4985
4948
|
values: { extensionType: "blocks widgets" },
|
|
4986
|
-
components: [/* @__PURE__ */
|
|
4949
|
+
components: [/* @__PURE__ */ import_react32.default.createElement(Learn, null), /* @__PURE__ */ import_react32.default.createElement(Link, { url: "https://wix.to/HuMifhw" })]
|
|
4987
4950
|
}
|
|
4988
4951
|
)
|
|
4989
4952
|
);
|
|
@@ -5007,13 +4970,13 @@ var useAddBlocksSupportToProject = ({
|
|
|
5007
4970
|
}
|
|
5008
4971
|
}, [siteWidgetType]);
|
|
5009
4972
|
return [
|
|
5010
|
-
/* @__PURE__ */
|
|
4973
|
+
/* @__PURE__ */ import_react33.default.createElement(
|
|
5011
4974
|
CompleteGeneration,
|
|
5012
4975
|
{
|
|
5013
4976
|
generationTask: supportBlocksTask,
|
|
5014
4977
|
extensionType,
|
|
5015
4978
|
successMessage: CompleteGenerationMessage.CustomSuccessMessage({
|
|
5016
|
-
comp: /* @__PURE__ */
|
|
4979
|
+
comp: /* @__PURE__ */ import_react33.default.createElement(BlockGenerationSuccessMessage, null)
|
|
5017
4980
|
})
|
|
5018
4981
|
}
|
|
5019
4982
|
)
|
|
@@ -5025,7 +4988,7 @@ var SelectSiteWidgetTypeStep = ({ onSubmit }) => {
|
|
|
5025
4988
|
const bi = useWixCliAppBi();
|
|
5026
4989
|
const { t: t2 } = useTranslation();
|
|
5027
4990
|
const { isActive, goToNextStep } = useWizardStep();
|
|
5028
|
-
return /* @__PURE__ */
|
|
4991
|
+
return /* @__PURE__ */ import_react34.default.createElement(
|
|
5029
4992
|
SelectInput,
|
|
5030
4993
|
{
|
|
5031
4994
|
isActive,
|
|
@@ -5036,12 +4999,12 @@ var SelectSiteWidgetTypeStep = ({ onSubmit }) => {
|
|
|
5036
4999
|
title: t2(
|
|
5037
5000
|
"generate_command.site_widget_wizard.custom_element_option.title"
|
|
5038
5001
|
),
|
|
5039
|
-
description: /* @__PURE__ */
|
|
5002
|
+
description: /* @__PURE__ */ import_react34.default.createElement(
|
|
5040
5003
|
Trans,
|
|
5041
5004
|
{
|
|
5042
5005
|
i18nKey: "generate_command.site_widget_wizard.custom_element_option.description",
|
|
5043
5006
|
components: [
|
|
5044
|
-
/* @__PURE__ */
|
|
5007
|
+
/* @__PURE__ */ import_react34.default.createElement(Link, { url: "https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/site-extensions/site-widgets/add-a-site-widget-extension-in-the-cli" })
|
|
5045
5008
|
]
|
|
5046
5009
|
}
|
|
5047
5010
|
),
|
|
@@ -5049,12 +5012,12 @@ var SelectSiteWidgetTypeStep = ({ onSubmit }) => {
|
|
|
5049
5012
|
},
|
|
5050
5013
|
{
|
|
5051
5014
|
title: t2("generate_command.site_widget_wizard.blocks.title"),
|
|
5052
|
-
description: /* @__PURE__ */
|
|
5015
|
+
description: /* @__PURE__ */ import_react34.default.createElement(
|
|
5053
5016
|
Trans,
|
|
5054
5017
|
{
|
|
5055
5018
|
i18nKey: "generate_command.site_widget_wizard.blocks.description",
|
|
5056
5019
|
components: [
|
|
5057
|
-
/* @__PURE__ */
|
|
5020
|
+
/* @__PURE__ */ import_react34.default.createElement(Link, { url: "https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/site-extensions/blocks-site-widgets/add-a-blocks-site-widget-extension-in-the-cli" })
|
|
5058
5021
|
]
|
|
5059
5022
|
}
|
|
5060
5023
|
),
|
|
@@ -5076,16 +5039,16 @@ var SelectSiteWidgetTypeStep = ({ onSubmit }) => {
|
|
|
5076
5039
|
);
|
|
5077
5040
|
};
|
|
5078
5041
|
var useGenerateSiteWidget = () => {
|
|
5079
|
-
const [siteWidgetType, setSiteWidgetType] = (0,
|
|
5042
|
+
const [siteWidgetType, setSiteWidgetType] = (0, import_react34.useState)();
|
|
5080
5043
|
const generateCustomElementSteps = useGenerateCustomElement();
|
|
5081
5044
|
const addBlocksSupportToProjectSteps = useAddBlocksSupportToProject({
|
|
5082
5045
|
siteWidgetType
|
|
5083
5046
|
});
|
|
5084
5047
|
return [
|
|
5085
|
-
/* @__PURE__ */
|
|
5048
|
+
/* @__PURE__ */ import_react34.default.createElement(SelectSiteWidgetTypeStep, { onSubmit: setSiteWidgetType }),
|
|
5086
5049
|
...siteWidgetType === "customElement" ? generateCustomElementSteps : [],
|
|
5087
5050
|
...siteWidgetType === "blocks" ? addBlocksSupportToProjectSteps : [],
|
|
5088
|
-
...siteWidgetType === void 0 ? [/* @__PURE__ */
|
|
5051
|
+
...siteWidgetType === void 0 ? [/* @__PURE__ */ import_react34.default.createElement(import_react34.default.Fragment, null)] : []
|
|
5089
5052
|
];
|
|
5090
5053
|
};
|
|
5091
5054
|
|
|
@@ -5103,7 +5066,7 @@ var GenerateCommand = ({
|
|
|
5103
5066
|
const generateEmbeddedScriptSteps = useGenerateEmbeddedScript();
|
|
5104
5067
|
const generateSidebarCategorySteps = useGenerateSidebarCategory();
|
|
5105
5068
|
const generateSiteWidgetSteps = useGenerateSiteWidget();
|
|
5106
|
-
const biCliFlowStepAnswered = (0,
|
|
5069
|
+
const biCliFlowStepAnswered = (0, import_react35.useCallback)(
|
|
5107
5070
|
(selectedType) => {
|
|
5108
5071
|
bi.cliFlowStepAnswered({
|
|
5109
5072
|
question: t2("generate_command.flow.choose_flow"),
|
|
@@ -5113,7 +5076,7 @@ var GenerateCommand = ({
|
|
|
5113
5076
|
},
|
|
5114
5077
|
[bi, t2]
|
|
5115
5078
|
);
|
|
5116
|
-
const [generateFlow, setGenerateFlow] = (0,
|
|
5079
|
+
const [generateFlow, setGenerateFlow] = (0, import_react35.useState)(() => {
|
|
5117
5080
|
if (docsExtensionType) {
|
|
5118
5081
|
const selectedType = getGenerateFlowByDocsExtensionType(
|
|
5119
5082
|
docsExtensionType,
|
|
@@ -5125,7 +5088,7 @@ var GenerateCommand = ({
|
|
|
5125
5088
|
return;
|
|
5126
5089
|
});
|
|
5127
5090
|
const generateFlows = useGenerateFlows();
|
|
5128
|
-
const selectFlow = (0,
|
|
5091
|
+
const selectFlow = (0, import_react35.useCallback)(
|
|
5129
5092
|
(selectedType) => {
|
|
5130
5093
|
biCliFlowStepAnswered(selectedType);
|
|
5131
5094
|
setGenerateFlow(selectedType);
|
|
@@ -5135,7 +5098,7 @@ var GenerateCommand = ({
|
|
|
5135
5098
|
const onExitWizard = () => {
|
|
5136
5099
|
setGenerateFlow(void 0);
|
|
5137
5100
|
};
|
|
5138
|
-
return /* @__PURE__ */
|
|
5101
|
+
return /* @__PURE__ */ import_react35.default.createElement(Box_default, { flexDirection: "column", paddingTop: 1 }, /* @__PURE__ */ import_react35.default.createElement(
|
|
5139
5102
|
SelectGroupsInput,
|
|
5140
5103
|
{
|
|
5141
5104
|
value: generateFlow ? InputState.Submitted(generateFlow) : InputState.NotSubmitted(generateFlow),
|
|
@@ -5147,7 +5110,7 @@ var GenerateCommand = ({
|
|
|
5147
5110
|
), generateFlow && (0, import_variant14.match)(
|
|
5148
5111
|
generateFlow.value,
|
|
5149
5112
|
(0, import_variant14.partial)({
|
|
5150
|
-
DashboardPage: () => /* @__PURE__ */
|
|
5113
|
+
DashboardPage: () => /* @__PURE__ */ import_react35.default.createElement(
|
|
5151
5114
|
Wizard,
|
|
5152
5115
|
{
|
|
5153
5116
|
name: generateFlow.value.type,
|
|
@@ -5155,7 +5118,7 @@ var GenerateCommand = ({
|
|
|
5155
5118
|
steps: dashboardPageSteps
|
|
5156
5119
|
}
|
|
5157
5120
|
),
|
|
5158
|
-
DashboardModal: () => /* @__PURE__ */
|
|
5121
|
+
DashboardModal: () => /* @__PURE__ */ import_react35.default.createElement(
|
|
5159
5122
|
Wizard,
|
|
5160
5123
|
{
|
|
5161
5124
|
name: generateFlow.value.type,
|
|
@@ -5163,7 +5126,7 @@ var GenerateCommand = ({
|
|
|
5163
5126
|
steps: dashboardModalSteps
|
|
5164
5127
|
}
|
|
5165
5128
|
),
|
|
5166
|
-
Api: () => /* @__PURE__ */
|
|
5129
|
+
Api: () => /* @__PURE__ */ import_react35.default.createElement(
|
|
5167
5130
|
Wizard,
|
|
5168
5131
|
{
|
|
5169
5132
|
name: generateFlow.value.type,
|
|
@@ -5171,7 +5134,7 @@ var GenerateCommand = ({
|
|
|
5171
5134
|
steps: apiSteps
|
|
5172
5135
|
}
|
|
5173
5136
|
),
|
|
5174
|
-
DashboardSidebarCategory: () => /* @__PURE__ */
|
|
5137
|
+
DashboardSidebarCategory: () => /* @__PURE__ */ import_react35.default.createElement(
|
|
5175
5138
|
Wizard,
|
|
5176
5139
|
{
|
|
5177
5140
|
name: generateFlow.value.type,
|
|
@@ -5179,7 +5142,7 @@ var GenerateCommand = ({
|
|
|
5179
5142
|
steps: generateSidebarCategorySteps
|
|
5180
5143
|
}
|
|
5181
5144
|
),
|
|
5182
|
-
EmbeddedScript: () => /* @__PURE__ */
|
|
5145
|
+
EmbeddedScript: () => /* @__PURE__ */ import_react35.default.createElement(
|
|
5183
5146
|
Wizard,
|
|
5184
5147
|
{
|
|
5185
5148
|
name: generateFlow.value.type,
|
|
@@ -5187,7 +5150,7 @@ var GenerateCommand = ({
|
|
|
5187
5150
|
steps: generateEmbeddedScriptSteps
|
|
5188
5151
|
}
|
|
5189
5152
|
),
|
|
5190
|
-
CustomElement: () => /* @__PURE__ */
|
|
5153
|
+
CustomElement: () => /* @__PURE__ */ import_react35.default.createElement(
|
|
5191
5154
|
Wizard,
|
|
5192
5155
|
{
|
|
5193
5156
|
name: generateFlow.value.type,
|
|
@@ -5195,7 +5158,7 @@ var GenerateCommand = ({
|
|
|
5195
5158
|
steps: generateSiteWidgetSteps
|
|
5196
5159
|
}
|
|
5197
5160
|
),
|
|
5198
|
-
ServicePlugin: () => /* @__PURE__ */
|
|
5161
|
+
ServicePlugin: () => /* @__PURE__ */ import_react35.default.createElement(
|
|
5199
5162
|
Wizard,
|
|
5200
5163
|
{
|
|
5201
5164
|
name: generateFlow.value.type,
|
|
@@ -5203,7 +5166,7 @@ var GenerateCommand = ({
|
|
|
5203
5166
|
steps: generateServicePluginSteps
|
|
5204
5167
|
}
|
|
5205
5168
|
),
|
|
5206
|
-
Event: () => /* @__PURE__ */
|
|
5169
|
+
Event: () => /* @__PURE__ */ import_react35.default.createElement(
|
|
5207
5170
|
Wizard,
|
|
5208
5171
|
{
|
|
5209
5172
|
name: generateFlow.value.type,
|
|
@@ -5211,9 +5174,9 @@ var GenerateCommand = ({
|
|
|
5211
5174
|
steps: generateEventsSteps
|
|
5212
5175
|
}
|
|
5213
5176
|
),
|
|
5214
|
-
SitePlugin: () => /* @__PURE__ */
|
|
5215
|
-
DashboardPlugin: () => /* @__PURE__ */
|
|
5216
|
-
DashboardMenuPlugin: () => /* @__PURE__ */
|
|
5177
|
+
SitePlugin: () => /* @__PURE__ */ import_react35.default.createElement(GenerateSitePlugin, null),
|
|
5178
|
+
DashboardPlugin: () => /* @__PURE__ */ import_react35.default.createElement(DashboardPlugin, { flow: generateFlow.value }),
|
|
5179
|
+
DashboardMenuPlugin: () => /* @__PURE__ */ import_react35.default.createElement(DashboardPlugin, { flow: generateFlow.value }),
|
|
5217
5180
|
default: () => null
|
|
5218
5181
|
})
|
|
5219
5182
|
));
|
|
@@ -5221,4 +5184,4 @@ var GenerateCommand = ({
|
|
|
5221
5184
|
export {
|
|
5222
5185
|
GenerateCommand
|
|
5223
5186
|
};
|
|
5224
|
-
//# sourceMappingURL=GenerateCommand-
|
|
5187
|
+
//# sourceMappingURL=GenerateCommand-F6WNIVZH.js.map
|