@wix/cli-app 1.1.61 → 1.1.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/{CreateVersionCommand-27X5XRUT.js → CreateVersionCommand-HSZ5KOXI.js} +15 -15
- package/build/{DevCommand-6HTMGZ2M.js → DevCommand-U5VNLUWE.js} +442 -299
- package/build/DevCommand-U5VNLUWE.js.map +1 -0
- package/build/{GenerateCommand-7IAUS6BH.js → GenerateCommand-EAOS2X3X.js} +11 -10
- package/build/{GenerateCommand-7IAUS6BH.js.map → GenerateCommand-EAOS2X3X.js.map} +1 -1
- package/build/{LogsCommand-WPUUN3JU.js → LogsCommand-OW2ZNER5.js} +5 -5
- package/build/PreviewCommand-MMMYRI4Z.js +23 -0
- package/build/{ReleaseCommand-KTVVW67B.js → ReleaseCommand-L4WZJXHC.js} +15 -15
- package/build/{ServeCommand-LXJK73IU.js → ServeCommand-RR7E4CTH.js} +14 -14
- package/build/{build-KOJIDD4M.js → build-KQLNYCVG.js} +7 -7
- package/build/{chunk-ELYFHAX6.js → chunk-2DRVDGHR.js} +1 -4
- package/build/chunk-2DRVDGHR.js.map +1 -0
- package/build/{chunk-S7UPYDTK.js → chunk-3I7X6TPV.js} +3 -3
- package/build/{chunk-Z7MEHVBF.js → chunk-7I5LSGDI.js} +4 -4
- package/build/{chunk-SJY44CC7.js → chunk-7XQDPLBO.js} +10335 -1852
- package/build/chunk-7XQDPLBO.js.map +1 -0
- package/build/{chunk-XCKLCHGL.js → chunk-CQUQ6WJV.js} +10 -6
- package/build/chunk-CQUQ6WJV.js.map +1 -0
- package/build/{chunk-KJF6LWGQ.js → chunk-DIA3AFPZ.js} +2 -2
- package/build/{chunk-63EMUDZG.js → chunk-EYB7PRAB.js} +3 -3
- package/build/{chunk-LOLULZLU.js → chunk-FXVMZQC7.js} +3 -3
- package/build/{chunk-EL6CIFIN.js → chunk-HAPDEIJZ.js} +3 -3
- package/build/{chunk-XBBIROHO.js → chunk-IB2EYESP.js} +3 -3
- package/build/{chunk-2GCKBITG.js → chunk-NWRBK74T.js} +8 -8
- package/build/{chunk-OHF42SKC.js → chunk-OHPZ74IV.js} +5 -5
- package/build/{chunk-KJRYBTZB.js → chunk-OV6Y7VX4.js} +5 -5
- package/build/{chunk-KJRYBTZB.js.map → chunk-OV6Y7VX4.js.map} +1 -1
- package/build/{chunk-MEDHLZDL.js → chunk-SFPBI2MM.js} +3 -3
- package/build/{chunk-A3UPTTKJ.js → chunk-SK3ICCEA.js} +3 -3
- package/build/{chunk-MKPZBVQD.js → chunk-SXIV63HN.js} +4675 -2540
- package/build/chunk-SXIV63HN.js.map +1 -0
- package/build/{chunk-IL6O6OIL.js → chunk-VSQ4XHEB.js} +2 -2
- package/build/{chunk-PBUNWOQL.js → chunk-XYNJZDSJ.js} +104 -160
- package/build/chunk-XYNJZDSJ.js.map +1 -0
- package/build/{chunk-QZOQAFHK.js → chunk-ZR3N5INU.js} +8 -8
- package/build/chunk-ZR3N5INU.js.map +1 -0
- package/build/index.js +48 -33
- package/build/index.js.map +1 -1
- package/build/platform-sdk/{chunk-NAPHVUFM.js → chunk-DGX4CFXG.js} +2 -2
- package/build/platform-sdk/chunk-DGX4CFXG.js.map +1 -0
- package/build/platform-sdk/dashboard.js +1 -1
- package/build/platform-sdk/dashboard.js.map +1 -1
- package/build/platform-sdk/editor.js +5 -5
- package/build/platform-sdk/editor.js.map +1 -1
- package/build/platform-sdk/web-methods.js +1 -1
- package/build/platform-sdk/web-methods.js.map +1 -1
- package/build/{preview-YEREVN42.js → preview-4UF7QRIS.js} +13 -13
- package/build/{render-command-H5DHMFOD.js → render-command-5DTSCPVY.js} +6 -6
- package/package.json +4 -4
- package/schemas/site-plugin.json +1 -1
- package/templates/web-method/dependencies.json +5 -0
- package/templates/web-method/files/placeholder.ts.ejs +9 -2
- package/build/DevCommand-6HTMGZ2M.js.map +0 -1
- package/build/PreviewCommand-CU46IAJE.js +0 -23
- package/build/chunk-ELYFHAX6.js.map +0 -1
- package/build/chunk-MKPZBVQD.js.map +0 -1
- package/build/chunk-PBUNWOQL.js.map +0 -1
- package/build/chunk-QZOQAFHK.js.map +0 -1
- package/build/chunk-SJY44CC7.js.map +0 -1
- package/build/chunk-XCKLCHGL.js.map +0 -1
- package/build/platform-sdk/chunk-FWUYJ3UR.js +0 -2
- package/build/platform-sdk/chunk-FWUYJ3UR.js.map +0 -1
- package/build/platform-sdk/chunk-NAPHVUFM.js.map +0 -1
- /package/build/{CreateVersionCommand-27X5XRUT.js.map → CreateVersionCommand-HSZ5KOXI.js.map} +0 -0
- /package/build/{LogsCommand-WPUUN3JU.js.map → LogsCommand-OW2ZNER5.js.map} +0 -0
- /package/build/{PreviewCommand-CU46IAJE.js.map → PreviewCommand-MMMYRI4Z.js.map} +0 -0
- /package/build/{ReleaseCommand-KTVVW67B.js.map → ReleaseCommand-L4WZJXHC.js.map} +0 -0
- /package/build/{ServeCommand-LXJK73IU.js.map → ServeCommand-RR7E4CTH.js.map} +0 -0
- /package/build/{build-KOJIDD4M.js.map → build-KQLNYCVG.js.map} +0 -0
- /package/build/{chunk-S7UPYDTK.js.map → chunk-3I7X6TPV.js.map} +0 -0
- /package/build/{chunk-Z7MEHVBF.js.map → chunk-7I5LSGDI.js.map} +0 -0
- /package/build/{chunk-KJF6LWGQ.js.map → chunk-DIA3AFPZ.js.map} +0 -0
- /package/build/{chunk-63EMUDZG.js.map → chunk-EYB7PRAB.js.map} +0 -0
- /package/build/{chunk-LOLULZLU.js.map → chunk-FXVMZQC7.js.map} +0 -0
- /package/build/{chunk-EL6CIFIN.js.map → chunk-HAPDEIJZ.js.map} +0 -0
- /package/build/{chunk-XBBIROHO.js.map → chunk-IB2EYESP.js.map} +0 -0
- /package/build/{chunk-2GCKBITG.js.map → chunk-NWRBK74T.js.map} +0 -0
- /package/build/{chunk-OHF42SKC.js.map → chunk-OHPZ74IV.js.map} +0 -0
- /package/build/{chunk-MEDHLZDL.js.map → chunk-SFPBI2MM.js.map} +0 -0
- /package/build/{chunk-A3UPTTKJ.js.map → chunk-SK3ICCEA.js.map} +0 -0
- /package/build/{chunk-IL6O6OIL.js.map → chunk-VSQ4XHEB.js.map} +0 -0
- /package/build/{preview-YEREVN42.js.map → preview-4UF7QRIS.js.map} +0 -0
- /package/build/{render-command-H5DHMFOD.js.map → render-command-5DTSCPVY.js.map} +0 -0
|
@@ -2,16 +2,15 @@ import { createRequire as _createRequire } from 'node:module';
|
|
|
2
2
|
const require = _createRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
useWixCliAppBi
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FXVMZQC7.js";
|
|
6
6
|
import {
|
|
7
7
|
SiteProvider,
|
|
8
8
|
SiteSelector,
|
|
9
|
-
useMetasiteManagerClient,
|
|
10
9
|
usePlatform
|
|
11
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-XYNJZDSJ.js";
|
|
12
11
|
import {
|
|
13
12
|
createLogger
|
|
14
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VSQ4XHEB.js";
|
|
15
14
|
import {
|
|
16
15
|
DevEnvironmentProvider,
|
|
17
16
|
redirectWithCSMv2FTs,
|
|
@@ -22,25 +21,27 @@ import {
|
|
|
22
21
|
useResolveDashboardExtensionDevUrl,
|
|
23
22
|
useResolvePlatformDevUrl,
|
|
24
23
|
useSite
|
|
25
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-7XQDPLBO.js";
|
|
26
25
|
import {
|
|
27
26
|
useBackendComponents
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
27
|
+
} from "./chunk-HAPDEIJZ.js";
|
|
28
|
+
import "./chunk-7I5LSGDI.js";
|
|
29
|
+
import "./chunk-ZR3N5INU.js";
|
|
30
|
+
import "./chunk-SK3ICCEA.js";
|
|
32
31
|
import {
|
|
33
32
|
createCustomElementConfig
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import "./chunk-
|
|
33
|
+
} from "./chunk-OV6Y7VX4.js";
|
|
34
|
+
import "./chunk-DIA3AFPZ.js";
|
|
36
35
|
import {
|
|
37
36
|
ComponentType,
|
|
38
37
|
DevCenterComponent,
|
|
39
38
|
ErrorViewer,
|
|
40
39
|
PlatformType,
|
|
40
|
+
SiteAuthProvider,
|
|
41
|
+
TimeoutError,
|
|
41
42
|
USER_CONFIG_FILENAME,
|
|
42
43
|
getDataDirPath,
|
|
43
|
-
|
|
44
|
+
pWaitFor,
|
|
44
45
|
pathExists,
|
|
45
46
|
readJson,
|
|
46
47
|
useBiLogger,
|
|
@@ -51,7 +52,7 @@ import {
|
|
|
51
52
|
useProjectModel,
|
|
52
53
|
userConfigSchema,
|
|
53
54
|
writeJson
|
|
54
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-SXIV63HN.js";
|
|
55
56
|
import {
|
|
56
57
|
Alert,
|
|
57
58
|
Box_default,
|
|
@@ -73,8 +74,9 @@ import {
|
|
|
73
74
|
useAsyncCallback,
|
|
74
75
|
useExit,
|
|
75
76
|
useTranslation,
|
|
76
|
-
use_input_default
|
|
77
|
-
|
|
77
|
+
use_input_default,
|
|
78
|
+
z
|
|
79
|
+
} from "./chunk-CQUQ6WJV.js";
|
|
78
80
|
import {
|
|
79
81
|
__toESM,
|
|
80
82
|
init_esm_shims
|
|
@@ -85,17 +87,17 @@ init_esm_shims();
|
|
|
85
87
|
|
|
86
88
|
// src/components/DevCommand/DevCommand.tsx
|
|
87
89
|
init_esm_shims();
|
|
88
|
-
var
|
|
90
|
+
var import_react19 = __toESM(require_react(), 1);
|
|
89
91
|
|
|
90
92
|
// src/components/DevCommand/DevCommandScreens.tsx
|
|
91
93
|
init_esm_shims();
|
|
92
|
-
var
|
|
93
|
-
var
|
|
94
|
+
var import_react14 = __toESM(require_react(), 1);
|
|
95
|
+
var import_variant12 = __toESM(require_lib(), 1);
|
|
94
96
|
|
|
95
97
|
// src/components/DevCommand/HomeScreen.tsx
|
|
96
98
|
init_esm_shims();
|
|
97
|
-
var
|
|
98
|
-
var
|
|
99
|
+
var import_react9 = __toESM(require_react(), 1);
|
|
100
|
+
var import_variant8 = __toESM(require_lib(), 1);
|
|
99
101
|
|
|
100
102
|
// src/components/DevCommand/screen-state.ts
|
|
101
103
|
init_esm_shims();
|
|
@@ -109,7 +111,253 @@ var ScreenState = (0, import_variant.variant)({
|
|
|
109
111
|
|
|
110
112
|
// src/components/Platform/PlatformSelector.tsx
|
|
111
113
|
init_esm_shims();
|
|
114
|
+
var import_react3 = __toESM(require_react(), 1);
|
|
115
|
+
|
|
116
|
+
// src/components/DevCommand/EditorInstallation.tsx
|
|
117
|
+
init_esm_shims();
|
|
118
|
+
var import_react2 = __toESM(require_react(), 1);
|
|
119
|
+
var import_variant3 = __toESM(require_lib(), 1);
|
|
120
|
+
|
|
121
|
+
// src/components/DevCommand/CustomElementsMigration.tsx
|
|
122
|
+
init_esm_shims();
|
|
112
123
|
var import_react = __toESM(require_react(), 1);
|
|
124
|
+
var import_variant2 = __toESM(require_lib(), 1);
|
|
125
|
+
var CustomElementsMigrationContext = (0, import_react.createContext)(null);
|
|
126
|
+
function useCustomElementsMigration() {
|
|
127
|
+
const context = (0, import_react.useContext)(CustomElementsMigrationContext);
|
|
128
|
+
if (context == null) {
|
|
129
|
+
throw new Error(
|
|
130
|
+
"useCustomElementsMigration() cannot be used without an <CustomElementsMigrationContext.Provider>"
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
return context;
|
|
134
|
+
}
|
|
135
|
+
var DUMMY_CUSTOM_ELEMENT_TAG_NAME = "wix-cli-dummy-custom-element";
|
|
136
|
+
var DUMMY_CUSTOM_ELEMENT_URL = "https://www.unpkg.com/@wix/cli-dummy-custom-element";
|
|
137
|
+
var CustomElementsMigration = ({ children }) => {
|
|
138
|
+
const { getAppByVersion } = useDevCenterClient();
|
|
139
|
+
const { model } = useProjectModel();
|
|
140
|
+
const { t } = useTranslation();
|
|
141
|
+
const { createComponents } = useARMClient();
|
|
142
|
+
const prepareNewElements = (0, import_react.useCallback)(
|
|
143
|
+
async (newCustomElements) => {
|
|
144
|
+
const componentConfigs = newCustomElements.map(
|
|
145
|
+
(customElement) => {
|
|
146
|
+
const config = createCustomElementConfig(
|
|
147
|
+
customElement,
|
|
148
|
+
DUMMY_CUSTOM_ELEMENT_URL
|
|
149
|
+
);
|
|
150
|
+
return {
|
|
151
|
+
...config,
|
|
152
|
+
compData: {
|
|
153
|
+
customElementWidget: {
|
|
154
|
+
...config.compData.customElementWidget,
|
|
155
|
+
widgetData: {
|
|
156
|
+
...config.compData.customElementWidget.widgetData,
|
|
157
|
+
tagName: DUMMY_CUSTOM_ELEMENT_TAG_NAME
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
await createComponents(
|
|
165
|
+
model.config.appId,
|
|
166
|
+
componentConfigs,
|
|
167
|
+
model.config.projectId
|
|
168
|
+
);
|
|
169
|
+
},
|
|
170
|
+
[model.config.appId, model.config.projectId, createComponents]
|
|
171
|
+
);
|
|
172
|
+
const customElementsMigration = useAsync(async () => {
|
|
173
|
+
const localCustomElements = model.components.filter(
|
|
174
|
+
(component) => (0, import_variant2.isType)(component, DevCenterComponent.CustomElement)
|
|
175
|
+
);
|
|
176
|
+
if (!localCustomElements.length) {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
const {
|
|
180
|
+
data: { components }
|
|
181
|
+
} = await getAppByVersion({
|
|
182
|
+
appId: model.config.appId
|
|
183
|
+
});
|
|
184
|
+
const existingCustomElements = components.filter(
|
|
185
|
+
(component) => component.compType === ComponentType.CUSTOM_ELEMENT_WIDGET
|
|
186
|
+
);
|
|
187
|
+
const newCustomElements = localCustomElements.filter(
|
|
188
|
+
(localCustomElement) => !existingCustomElements.some(
|
|
189
|
+
(customElement) => customElement.compId === localCustomElement.id
|
|
190
|
+
)
|
|
191
|
+
);
|
|
192
|
+
if (newCustomElements.length) {
|
|
193
|
+
await prepareNewElements(newCustomElements);
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
return false;
|
|
197
|
+
}, [model.components]);
|
|
198
|
+
return (0, import_variant2.match)(customElementsMigration.status, {
|
|
199
|
+
Error: () => null,
|
|
200
|
+
Loading: () => /* @__PURE__ */ import_react.default.createElement(Spinner, { text: t("dev_command.custom_elements_migration.loading") }),
|
|
201
|
+
Success: ({ result: addedSitePresence }) => /* @__PURE__ */ import_react.default.createElement(
|
|
202
|
+
CustomElementsMigrationContext.Provider,
|
|
203
|
+
{
|
|
204
|
+
value: {
|
|
205
|
+
addedSitePresence
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
children
|
|
209
|
+
)
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// src/components/DevCommand/EditorInstallation.tsx
|
|
214
|
+
function isAbortError(error) {
|
|
215
|
+
return error && typeof error === "object" && "name" in error && error.name === "AbortError";
|
|
216
|
+
}
|
|
217
|
+
var EditorInstallationContext = (0, import_react2.createContext)(
|
|
218
|
+
null
|
|
219
|
+
);
|
|
220
|
+
function useEditorInstallation() {
|
|
221
|
+
const context = (0, import_react2.useContext)(EditorInstallationContext);
|
|
222
|
+
if (context == null) {
|
|
223
|
+
throw new Error(
|
|
224
|
+
"useEditorInstallation() cannot be used without an <EditorInstallationProvider>"
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
return context;
|
|
228
|
+
}
|
|
229
|
+
var EditorInstallationStatus = (0, import_variant3.variant)({
|
|
230
|
+
CheckInstallation: {},
|
|
231
|
+
NotInstalled: (0, import_variant3.fields)(),
|
|
232
|
+
WaitForInstallation: (0, import_variant3.fields)(),
|
|
233
|
+
Installed: {}
|
|
234
|
+
});
|
|
235
|
+
var CheckEditorInstallation = ({ onReady }) => {
|
|
236
|
+
const { model } = useProjectModel();
|
|
237
|
+
const { isAppInstalledInEditor } = useDevCenterClient();
|
|
238
|
+
const { reportError } = useErrorReporter();
|
|
239
|
+
const { site } = useSite();
|
|
240
|
+
const checkAppInstalledState = useAsyncCallback(
|
|
241
|
+
async ({ signal }, shouldWait = false) => {
|
|
242
|
+
const { appId } = model.config;
|
|
243
|
+
const { pollInterval } = getTestOverrides();
|
|
244
|
+
try {
|
|
245
|
+
if (shouldWait) {
|
|
246
|
+
await pWaitFor(() => isAppInstalledInEditor(appId), {
|
|
247
|
+
// Polling interval is set to 6.5 seconds to avoid rate limiting (429)
|
|
248
|
+
interval: pollInterval ?? 6500,
|
|
249
|
+
timeout: {
|
|
250
|
+
milliseconds: 60 * 1e3 * 2,
|
|
251
|
+
signal
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
return await isAppInstalledInEditor(appId);
|
|
257
|
+
} catch (error) {
|
|
258
|
+
if (!isAbortError(error) && !(error instanceof TimeoutError)) {
|
|
259
|
+
reportError(
|
|
260
|
+
new CliError({
|
|
261
|
+
cause: error,
|
|
262
|
+
code: CliErrorCode.WaitForEditorInstallationStateFailure()
|
|
263
|
+
})
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
);
|
|
270
|
+
useAsync(async () => {
|
|
271
|
+
onReady(checkAppInstalledState.execute);
|
|
272
|
+
}, [site.id]);
|
|
273
|
+
return null;
|
|
274
|
+
};
|
|
275
|
+
var EditorInstallation = ({ children }) => {
|
|
276
|
+
const { t } = useTranslation();
|
|
277
|
+
const { model } = useProjectModel();
|
|
278
|
+
const httpClient = useHttpClient({ type: "backoffice" });
|
|
279
|
+
const { isPlatformExists } = usePlatform();
|
|
280
|
+
const { site } = useSite();
|
|
281
|
+
const { armTag } = useArmTag();
|
|
282
|
+
const openPage = useOpenPage();
|
|
283
|
+
const { addedSitePresence } = useCustomElementsMigration();
|
|
284
|
+
const resolvePlatformUrl = useResolvePlatformDevUrl();
|
|
285
|
+
const [editorInstallationStatus, setEditorInstallationStatus] = (0, import_react2.useState)(
|
|
286
|
+
EditorInstallationStatus.CheckInstallation()
|
|
287
|
+
);
|
|
288
|
+
const openEditor = (0, import_react2.useCallback)(async () => {
|
|
289
|
+
const platformType = PlatformType.Editor();
|
|
290
|
+
const installationUrl = (0, import_variant3.match)(
|
|
291
|
+
editorInstallationStatus,
|
|
292
|
+
(0, import_variant3.partial)({
|
|
293
|
+
NotInstalled: ({ installationUrl: installationUrl2 }) => installationUrl2,
|
|
294
|
+
WaitForInstallation: ({ installationUrl: installationUrl2 }) => installationUrl2,
|
|
295
|
+
default: () => resolvePlatformUrl(platformType)
|
|
296
|
+
})
|
|
297
|
+
);
|
|
298
|
+
await openPage({ title: platformType.type, url: installationUrl });
|
|
299
|
+
if ((0, import_variant3.isType)(editorInstallationStatus, "NotInstalled")) {
|
|
300
|
+
setEditorInstallationStatus(
|
|
301
|
+
EditorInstallationStatus.WaitForInstallation({ installationUrl })
|
|
302
|
+
);
|
|
303
|
+
const isInstalled = await editorInstallationStatus.checkInstalledState(true);
|
|
304
|
+
if (isInstalled) {
|
|
305
|
+
setEditorInstallationStatus(EditorInstallationStatus.Installed());
|
|
306
|
+
} else {
|
|
307
|
+
setEditorInstallationStatus(editorInstallationStatus);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}, [openPage, resolvePlatformUrl, editorInstallationStatus]);
|
|
311
|
+
const buildInstallationUrl = (0, import_react2.useCallback)(async () => {
|
|
312
|
+
const { data: signedAppMarketParams } = await httpClient.post("/_serverless/app-market-json-web-token/json-web-token", {
|
|
313
|
+
data: {
|
|
314
|
+
data: JSON.stringify({
|
|
315
|
+
appDefId: model.config.appId,
|
|
316
|
+
version: "latest"
|
|
317
|
+
})
|
|
318
|
+
}
|
|
319
|
+
}).catch((e) => {
|
|
320
|
+
throw new CliError({
|
|
321
|
+
code: CliErrorCode.FailedToGenerateAppMarketQueryParam(),
|
|
322
|
+
cause: e
|
|
323
|
+
});
|
|
324
|
+
});
|
|
325
|
+
const url = new URL(`https://wix.com/editor/${site.id}`);
|
|
326
|
+
url.searchParams.append("openPanel", "appMarket");
|
|
327
|
+
url.searchParams.append("preferAppManager", "true");
|
|
328
|
+
url.searchParams.append("appMarketParams", signedAppMarketParams);
|
|
329
|
+
url.searchParams.append("apps-override", armTag);
|
|
330
|
+
return redirectWithCSMv2FTs(url, PlatformType.Editor()).toString();
|
|
331
|
+
}, [httpClient, model.config.appId, site.id, armTag]);
|
|
332
|
+
const { status, execute } = useAsyncCallback(
|
|
333
|
+
async (_, checkInstalledState) => {
|
|
334
|
+
if (isPlatformExists(PlatformType.Editor())) {
|
|
335
|
+
const isInstalled = addedSitePresence ? false : await checkInstalledState();
|
|
336
|
+
if (!isInstalled) {
|
|
337
|
+
const installationUrl = await buildInstallationUrl();
|
|
338
|
+
return setEditorInstallationStatus(
|
|
339
|
+
EditorInstallationStatus.NotInstalled({
|
|
340
|
+
installationUrl,
|
|
341
|
+
checkInstalledState
|
|
342
|
+
})
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
return setEditorInstallationStatus(EditorInstallationStatus.Installed());
|
|
347
|
+
}
|
|
348
|
+
);
|
|
349
|
+
(0, import_react2.useEffect)(() => {
|
|
350
|
+
setEditorInstallationStatus(EditorInstallationStatus.CheckInstallation());
|
|
351
|
+
}, [site.id]);
|
|
352
|
+
return /* @__PURE__ */ import_react2.default.createElement(EditorInstallationContext.Provider, { value: { openEditor } }, !(0, import_variant3.isType)(editorInstallationStatus, "Installed") && /* @__PURE__ */ import_react2.default.createElement(SiteAuthProvider, { siteId: site.id }, /* @__PURE__ */ import_react2.default.createElement(CheckEditorInstallation, { onReady: execute })), (0, import_variant3.match)(status, {
|
|
353
|
+
NotRequested: () => null,
|
|
354
|
+
Loading: () => /* @__PURE__ */ import_react2.default.createElement(Spinner, { text: t("general.loading") }),
|
|
355
|
+
Error: () => null,
|
|
356
|
+
Success: () => children
|
|
357
|
+
}));
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
// src/components/Platform/PlatformSelector.tsx
|
|
113
361
|
var PlatformOption = ({
|
|
114
362
|
label,
|
|
115
363
|
inputKey,
|
|
@@ -117,7 +365,7 @@ var PlatformOption = ({
|
|
|
117
365
|
disabled
|
|
118
366
|
}) => {
|
|
119
367
|
const getTextSkin = () => disabled ? "secondary" : "standard";
|
|
120
|
-
return /* @__PURE__ */
|
|
368
|
+
return /* @__PURE__ */ import_react3.default.createElement(Box_default, null, /* @__PURE__ */ import_react3.default.createElement(Box_default, { marginRight: 1 }, /* @__PURE__ */ import_react3.default.createElement(Box_default, { marginRight: 1 }, /* @__PURE__ */ import_react3.default.createElement(Text, { skin: getTextSkin() }, /* @__PURE__ */ import_react3.default.createElement(PointerSmallIcon, null), " ", /* @__PURE__ */ import_react3.default.createElement(Key, { value: inputKey }), " -")), /* @__PURE__ */ import_react3.default.createElement(Box_default, { gap: 1 }, /* @__PURE__ */ import_react3.default.createElement(Text, { skin: getTextSkin() }, label))), /* @__PURE__ */ import_react3.default.createElement(Text, { skin: getTextSkin() }, suffix));
|
|
121
369
|
};
|
|
122
370
|
var PlatformSelector = ({
|
|
123
371
|
onMultipleDashboardExtensionSelection
|
|
@@ -125,12 +373,13 @@ var PlatformSelector = ({
|
|
|
125
373
|
const { t } = useTranslation();
|
|
126
374
|
const bi = useWixCliAppBi();
|
|
127
375
|
const { isPlatformExists } = usePlatform();
|
|
376
|
+
const { openEditor } = useEditorInstallation();
|
|
128
377
|
const { dashboardExtensions } = useExtensions();
|
|
129
378
|
const resolvePlatformUrl = useResolvePlatformDevUrl();
|
|
130
379
|
const resolveDashboardExtensionUrl = useResolveDashboardExtensionDevUrl();
|
|
131
380
|
const { site } = useSite();
|
|
132
381
|
const openPage = useOpenPage();
|
|
133
|
-
const openPlatform = (0,
|
|
382
|
+
const openPlatform = (0, import_react3.useCallback)(
|
|
134
383
|
async (platformType) => {
|
|
135
384
|
await openPage({
|
|
136
385
|
title: platformType.type,
|
|
@@ -163,7 +412,7 @@ var PlatformSelector = ({
|
|
|
163
412
|
action: t("general.platform.editor"),
|
|
164
413
|
key: input
|
|
165
414
|
});
|
|
166
|
-
await
|
|
415
|
+
await openEditor();
|
|
167
416
|
}
|
|
168
417
|
if (input === "s" && site.viewUrl && isPlatformExists(PlatformType.Site())) {
|
|
169
418
|
bi.cliAction({
|
|
@@ -175,23 +424,23 @@ var PlatformSelector = ({
|
|
|
175
424
|
await openPlatform(PlatformType.Site());
|
|
176
425
|
}
|
|
177
426
|
});
|
|
178
|
-
const dashboardOptionSuffix = (0,
|
|
427
|
+
const dashboardOptionSuffix = (0, import_react3.useMemo)(() => {
|
|
179
428
|
if (dashboardExtensions.length === 0) {
|
|
180
429
|
return null;
|
|
181
430
|
}
|
|
182
431
|
if (dashboardExtensions.length === 1) {
|
|
183
|
-
return /* @__PURE__ */
|
|
432
|
+
return /* @__PURE__ */ import_react3.default.createElement(Text, { skin: "secondary" }, " - ", dashboardExtensions[0].route);
|
|
184
433
|
}
|
|
185
|
-
return /* @__PURE__ */
|
|
434
|
+
return /* @__PURE__ */ import_react3.default.createElement(Text, null, String.fromCodePoint(9660));
|
|
186
435
|
}, [dashboardExtensions]);
|
|
187
|
-
return /* @__PURE__ */
|
|
436
|
+
return /* @__PURE__ */ import_react3.default.createElement(Box_default, { paddingLeft: 2, flexDirection: "column" }, isPlatformExists(PlatformType.Site()) && /* @__PURE__ */ import_react3.default.createElement(
|
|
188
437
|
PlatformOption,
|
|
189
438
|
{
|
|
190
439
|
inputKey: "S",
|
|
191
440
|
label: site.viewUrl ? t("general.platform.site") : t("general.platform.unpublished_site"),
|
|
192
441
|
disabled: !site.viewUrl
|
|
193
442
|
}
|
|
194
|
-
), isPlatformExists(PlatformType.Editor()) && /* @__PURE__ */
|
|
443
|
+
), isPlatformExists(PlatformType.Editor()) && /* @__PURE__ */ import_react3.default.createElement(PlatformOption, { inputKey: "E", label: t("general.platform.editor") }), isPlatformExists(PlatformType.Dashboard()) && /* @__PURE__ */ import_react3.default.createElement(
|
|
195
444
|
PlatformOption,
|
|
196
445
|
{
|
|
197
446
|
inputKey: "D",
|
|
@@ -203,12 +452,12 @@ var PlatformSelector = ({
|
|
|
203
452
|
|
|
204
453
|
// src/components/DevCommand/DashboardNumericViewer.tsx
|
|
205
454
|
init_esm_shims();
|
|
206
|
-
var
|
|
207
|
-
var
|
|
455
|
+
var import_react8 = __toESM(require_react(), 1);
|
|
456
|
+
var import_variant7 = __toESM(require_lib(), 1);
|
|
208
457
|
|
|
209
458
|
// src/components/CloseScreen/CloseScreen.tsx
|
|
210
459
|
init_esm_shims();
|
|
211
|
-
var
|
|
460
|
+
var import_react4 = __toESM(require_react(), 1);
|
|
212
461
|
var CloseScreen = ({ onClose }) => {
|
|
213
462
|
const { t } = useTranslation();
|
|
214
463
|
const bi = useWixCliAppBi();
|
|
@@ -223,24 +472,24 @@ var CloseScreen = ({ onClose }) => {
|
|
|
223
472
|
onClose();
|
|
224
473
|
}
|
|
225
474
|
});
|
|
226
|
-
return /* @__PURE__ */
|
|
475
|
+
return /* @__PURE__ */ import_react4.default.createElement(Text, { skin: "secondary" }, /* @__PURE__ */ import_react4.default.createElement(
|
|
227
476
|
Trans,
|
|
228
477
|
{
|
|
229
478
|
i18nKey: "general.close_screen",
|
|
230
|
-
components: [/* @__PURE__ */
|
|
479
|
+
components: [/* @__PURE__ */ import_react4.default.createElement(Key, { value: "esc", skin: "secondary" })]
|
|
231
480
|
}
|
|
232
481
|
));
|
|
233
482
|
};
|
|
234
483
|
|
|
235
484
|
// src/components/DevCommand/DashboardScreen.tsx
|
|
236
485
|
init_esm_shims();
|
|
237
|
-
var
|
|
238
|
-
var
|
|
486
|
+
var import_react6 = __toESM(require_react(), 1);
|
|
487
|
+
var import_variant5 = __toESM(require_lib(), 1);
|
|
239
488
|
|
|
240
489
|
// src/components/DevCommand/DashboardArrowViewer.tsx
|
|
241
490
|
init_esm_shims();
|
|
242
|
-
var
|
|
243
|
-
var
|
|
491
|
+
var import_react5 = __toESM(require_react(), 1);
|
|
492
|
+
var import_variant4 = __toESM(require_lib(), 1);
|
|
244
493
|
var DashboardArrowViewer = ({
|
|
245
494
|
dashboardExtension,
|
|
246
495
|
onClose,
|
|
@@ -251,10 +500,10 @@ var DashboardArrowViewer = ({
|
|
|
251
500
|
const bi = useWixCliAppBi();
|
|
252
501
|
const resolveDashboardExtensionUrl = useResolveDashboardExtensionDevUrl();
|
|
253
502
|
const openPage = useOpenPage();
|
|
254
|
-
const getLabelKey = (0,
|
|
255
|
-
() => (0,
|
|
503
|
+
const getLabelKey = (0, import_react5.useCallback)(
|
|
504
|
+
() => (0, import_variant4.match)(
|
|
256
505
|
dashboardExtension,
|
|
257
|
-
(0,
|
|
506
|
+
(0, import_variant4.lookup)({
|
|
258
507
|
DashboardPlugin: "dev_command.dashboard_page_plugin_screen.select_label",
|
|
259
508
|
DashboardMenuPlugin: "dev_command.dashboard_menu_plugin_screen.select_label",
|
|
260
509
|
DashboardPage: "dev_command.dashboard_pages_screen.select_label",
|
|
@@ -263,7 +512,7 @@ var DashboardArrowViewer = ({
|
|
|
263
512
|
),
|
|
264
513
|
[dashboardExtension]
|
|
265
514
|
);
|
|
266
|
-
const handleSubmit = (0,
|
|
515
|
+
const handleSubmit = (0, import_react5.useCallback)(
|
|
267
516
|
async (dashboardExtension2) => {
|
|
268
517
|
const url = resolveDashboardExtensionUrl(dashboardExtension2);
|
|
269
518
|
bi.cliAction({
|
|
@@ -277,7 +526,7 @@ var DashboardArrowViewer = ({
|
|
|
277
526
|
},
|
|
278
527
|
[resolveDashboardExtensionUrl, bi, t, getLabelKey, openPage, onSelect]
|
|
279
528
|
);
|
|
280
|
-
return /* @__PURE__ */
|
|
529
|
+
return /* @__PURE__ */ import_react5.default.createElement(Box_default, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ import_react5.default.createElement(Box_default, { flexDirection: "column" }, /* @__PURE__ */ import_react5.default.createElement(
|
|
281
530
|
SelectInput,
|
|
282
531
|
{
|
|
283
532
|
label: t(getLabelKey()),
|
|
@@ -291,12 +540,12 @@ var DashboardArrowViewer = ({
|
|
|
291
540
|
),
|
|
292
541
|
onSubmit: ({ value: dashboardExtensionInstance }) => handleSubmit(dashboardExtensionInstance)
|
|
293
542
|
}
|
|
294
|
-
)), /* @__PURE__ */
|
|
543
|
+
)), /* @__PURE__ */ import_react5.default.createElement(CloseScreen, { onClose }));
|
|
295
544
|
};
|
|
296
545
|
|
|
297
546
|
// src/components/DevCommand/DashboardScreen.tsx
|
|
298
|
-
var DashboardScreenSelector = (0,
|
|
299
|
-
Arrow: (0,
|
|
547
|
+
var DashboardScreenSelector = (0, import_variant5.variant)({
|
|
548
|
+
Arrow: (0, import_variant5.fields)(),
|
|
300
549
|
Numeric: {}
|
|
301
550
|
});
|
|
302
551
|
var DashboardScreen = ({
|
|
@@ -304,9 +553,9 @@ var DashboardScreen = ({
|
|
|
304
553
|
onSelect,
|
|
305
554
|
initialSelectorType = DashboardScreenSelector.Numeric()
|
|
306
555
|
}) => {
|
|
307
|
-
const [selectorType, setSelectorType] = (0,
|
|
308
|
-
return /* @__PURE__ */
|
|
309
|
-
Arrow: ({ dashboardExtension }) => /* @__PURE__ */
|
|
556
|
+
const [selectorType, setSelectorType] = (0, import_react6.useState)(initialSelectorType);
|
|
557
|
+
return /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, (0, import_variant5.match)(selectorType, {
|
|
558
|
+
Arrow: ({ dashboardExtension }) => /* @__PURE__ */ import_react6.default.createElement(
|
|
310
559
|
DashboardArrowViewer,
|
|
311
560
|
{
|
|
312
561
|
dashboardExtension,
|
|
@@ -314,7 +563,7 @@ var DashboardScreen = ({
|
|
|
314
563
|
onClose
|
|
315
564
|
}
|
|
316
565
|
),
|
|
317
|
-
Numeric: () => /* @__PURE__ */
|
|
566
|
+
Numeric: () => /* @__PURE__ */ import_react6.default.createElement(
|
|
318
567
|
DashboardNumericViewer,
|
|
319
568
|
{
|
|
320
569
|
onViewMore: setSelectorType,
|
|
@@ -330,16 +579,16 @@ init_esm_shims();
|
|
|
330
579
|
|
|
331
580
|
// src/components/NumericViewer/NumericViewer.tsx
|
|
332
581
|
init_esm_shims();
|
|
333
|
-
var
|
|
334
|
-
var
|
|
582
|
+
var import_react7 = __toESM(require_react(), 1);
|
|
583
|
+
var import_variant6 = __toESM(require_lib(), 1);
|
|
335
584
|
var ListItem = ({ itemNumber, children }) => {
|
|
336
585
|
const keyValue = `${itemNumber}`;
|
|
337
|
-
return /* @__PURE__ */
|
|
586
|
+
return /* @__PURE__ */ import_react7.default.createElement(Box_default, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ import_react7.default.createElement(Text, null, /* @__PURE__ */ import_react7.default.createElement(PointerSmallIcon, null), " ", /* @__PURE__ */ import_react7.default.createElement(Key, { value: keyValue }), " -"), children);
|
|
338
587
|
};
|
|
339
|
-
var NumericOption = (0,
|
|
340
|
-
(0,
|
|
341
|
-
Item: (0,
|
|
342
|
-
ViewMore: (0,
|
|
588
|
+
var NumericOption = (0, import_variant6.variant)(
|
|
589
|
+
(0, import_variant6.onTerms)(({ I: _I, V }) => ({
|
|
590
|
+
Item: (0, import_variant6.fields)(),
|
|
591
|
+
ViewMore: (0, import_variant6.payload)(V)
|
|
343
592
|
}))
|
|
344
593
|
);
|
|
345
594
|
function NumericViewer({
|
|
@@ -347,15 +596,15 @@ function NumericViewer({
|
|
|
347
596
|
titleKey,
|
|
348
597
|
items
|
|
349
598
|
}) {
|
|
350
|
-
return /* @__PURE__ */
|
|
599
|
+
return /* @__PURE__ */ import_react7.default.createElement(Box_default, { flexDirection: "column" }, /* @__PURE__ */ import_react7.default.createElement(Trans, { i18nKey: titleKey }), /* @__PURE__ */ import_react7.default.createElement(Box_default, { paddingLeft: 2, flexDirection: "column" }, items.map((item, index) => /* @__PURE__ */ import_react7.default.createElement(
|
|
351
600
|
ListItem,
|
|
352
601
|
{
|
|
353
602
|
key: startIndex + index + 1,
|
|
354
603
|
itemNumber: startIndex + index + 1
|
|
355
604
|
},
|
|
356
|
-
(0,
|
|
357
|
-
Item: ({ title, description }) => /* @__PURE__ */
|
|
358
|
-
ViewMore: () => /* @__PURE__ */
|
|
605
|
+
(0, import_variant6.match)(item, {
|
|
606
|
+
Item: ({ title, description }) => /* @__PURE__ */ import_react7.default.createElement(Box_default, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ import_react7.default.createElement(Text, null, title), description && /* @__PURE__ */ import_react7.default.createElement(Text, { skin: "secondary" }, "(", description, ")")),
|
|
607
|
+
ViewMore: () => /* @__PURE__ */ import_react7.default.createElement(Trans, { i18nKey: "general.numeric_viewer.show_more" })
|
|
359
608
|
})
|
|
360
609
|
))));
|
|
361
610
|
}
|
|
@@ -375,7 +624,7 @@ var DashboardNumericViewer = ({
|
|
|
375
624
|
const bi = useWixCliAppBi();
|
|
376
625
|
const resolveDashboardExtensionUrl = useResolveDashboardExtensionDevUrl();
|
|
377
626
|
const openPage = useOpenPage();
|
|
378
|
-
const dashboardExtensions = (0,
|
|
627
|
+
const dashboardExtensions = (0, import_react8.useMemo)(
|
|
379
628
|
() => ({
|
|
380
629
|
dashboardPages: getExtensions("DashboardPage"),
|
|
381
630
|
dashboardMenuPlugins: getExtensions("DashboardMenuPlugin"),
|
|
@@ -441,9 +690,9 @@ var DashboardNumericViewer = ({
|
|
|
441
690
|
...dashboardPluginsShowMoreIndex ? [NumericOption.ViewMore("DashboardPlugin")] : []
|
|
442
691
|
];
|
|
443
692
|
const getLabelKey = (dashboardExtension) => {
|
|
444
|
-
return (0,
|
|
693
|
+
return (0, import_variant7.match)(
|
|
445
694
|
dashboardExtension,
|
|
446
|
-
(0,
|
|
695
|
+
(0, import_variant7.lookup)({
|
|
447
696
|
DashboardPage: "general.dashboard_pages_viewer.title",
|
|
448
697
|
DashboardMenuPlugin: "general.dashboard_menu_plugins_viewer.title",
|
|
449
698
|
DashboardPlugin: "general.dashboard_plugins_viewer.title",
|
|
@@ -458,7 +707,7 @@ var DashboardNumericViewer = ({
|
|
|
458
707
|
const itemIndex = inputNumber - 1;
|
|
459
708
|
const item = visibleItems.at(itemIndex);
|
|
460
709
|
if (item) {
|
|
461
|
-
await (0,
|
|
710
|
+
await (0, import_variant7.match)(item, {
|
|
462
711
|
Item: async (item2) => {
|
|
463
712
|
bi.cliAction({
|
|
464
713
|
question: t(getLabelKey(item2.value)),
|
|
@@ -485,7 +734,7 @@ var DashboardNumericViewer = ({
|
|
|
485
734
|
}
|
|
486
735
|
}
|
|
487
736
|
});
|
|
488
|
-
const handleSelect = (0,
|
|
737
|
+
const handleSelect = (0, import_react8.useCallback)(
|
|
489
738
|
async (dashboardExtension) => {
|
|
490
739
|
const url = resolveDashboardExtensionUrl(dashboardExtension);
|
|
491
740
|
await openPage({ url, title: dashboardExtension.title });
|
|
@@ -499,28 +748,28 @@ var DashboardNumericViewer = ({
|
|
|
499
748
|
dashboardMenuPluginsCount
|
|
500
749
|
);
|
|
501
750
|
const dashboardPlugins = visibleItems.slice(dashboardMenuPluginsCount);
|
|
502
|
-
return /* @__PURE__ */
|
|
751
|
+
return /* @__PURE__ */ import_react8.default.createElement(Box_default, { flexDirection: "column", gap: 1 }, dashboardPages.length > 0 && /* @__PURE__ */ import_react8.default.createElement(
|
|
503
752
|
NumericViewer,
|
|
504
753
|
{
|
|
505
754
|
startIndex: 0,
|
|
506
755
|
titleKey: "general.dashboard_pages_viewer.title",
|
|
507
756
|
items: dashboardPages
|
|
508
757
|
}
|
|
509
|
-
), dashboardMenuPlugins.length > 0 && /* @__PURE__ */
|
|
758
|
+
), dashboardMenuPlugins.length > 0 && /* @__PURE__ */ import_react8.default.createElement(
|
|
510
759
|
NumericViewer,
|
|
511
760
|
{
|
|
512
761
|
startIndex: dashboardPagesCount,
|
|
513
762
|
titleKey: "general.dashboard_menu_plugins_viewer.title",
|
|
514
763
|
items: dashboardMenuPlugins
|
|
515
764
|
}
|
|
516
|
-
), dashboardPlugins.length > 0 && /* @__PURE__ */
|
|
765
|
+
), dashboardPlugins.length > 0 && /* @__PURE__ */ import_react8.default.createElement(
|
|
517
766
|
NumericViewer,
|
|
518
767
|
{
|
|
519
768
|
startIndex: dashboardMenuPluginsCount,
|
|
520
769
|
titleKey: "general.dashboard_plugins_viewer.title",
|
|
521
770
|
items: dashboardPlugins
|
|
522
771
|
}
|
|
523
|
-
), onClose && /* @__PURE__ */
|
|
772
|
+
), onClose && /* @__PURE__ */ import_react8.default.createElement(CloseScreen, { onClose }));
|
|
524
773
|
};
|
|
525
774
|
|
|
526
775
|
// src/components/DevCommand/HomeScreen.tsx
|
|
@@ -542,28 +791,28 @@ var HomeScreen = ({ onScreenChange }) => {
|
|
|
542
791
|
onScreenChange(ScreenState.SiteSelector());
|
|
543
792
|
}
|
|
544
793
|
});
|
|
545
|
-
return /* @__PURE__ */
|
|
794
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement(Box_default, { gap: 1 }, /* @__PURE__ */ import_react9.default.createElement(
|
|
546
795
|
Trans,
|
|
547
796
|
{
|
|
548
797
|
i18nKey: "dev_command.dev_site.current",
|
|
549
798
|
values: { siteName: site.displayName },
|
|
550
|
-
components: [/* @__PURE__ */
|
|
799
|
+
components: [/* @__PURE__ */ import_react9.default.createElement(Text, { bold: true, skin: "info" })]
|
|
551
800
|
}
|
|
552
|
-
), /* @__PURE__ */
|
|
801
|
+
), /* @__PURE__ */ import_react9.default.createElement(Text, { skin: "secondary" }, /* @__PURE__ */ import_react9.default.createElement(
|
|
553
802
|
Trans,
|
|
554
803
|
{
|
|
555
804
|
i18nKey: "dev_command.dev_site.change",
|
|
556
|
-
components: [/* @__PURE__ */
|
|
805
|
+
components: [/* @__PURE__ */ import_react9.default.createElement(Key, { value: "C", skin: "secondary" })]
|
|
557
806
|
}
|
|
558
|
-
))), /* @__PURE__ */
|
|
807
|
+
))), /* @__PURE__ */ import_react9.default.createElement(Box_default, { paddingTop: 1, paddingBottom: 1, flexDirection: "column" }, !hasExtensions() ? /* @__PURE__ */ import_react9.default.createElement(
|
|
559
808
|
Trans,
|
|
560
809
|
{
|
|
561
810
|
i18nKey: "general.platform.none",
|
|
562
|
-
components: [/* @__PURE__ */
|
|
811
|
+
components: [/* @__PURE__ */ import_react9.default.createElement(Link, { url: "https://wix.to/b7o4Ml0" })]
|
|
563
812
|
}
|
|
564
|
-
) : /* @__PURE__ */
|
|
565
|
-
(dashboardExtension) => !(0,
|
|
566
|
-
) ? /* @__PURE__ */
|
|
813
|
+
) : /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, hasSinglePlatform(PlatformType.Dashboard()) && backendComponents.length === 0 && dashboardExtensions.some(
|
|
814
|
+
(dashboardExtension) => !(0, import_variant8.isType)(dashboardExtension, "DashboardModal")
|
|
815
|
+
) ? /* @__PURE__ */ import_react9.default.createElement(
|
|
567
816
|
DashboardNumericViewer,
|
|
568
817
|
{
|
|
569
818
|
onViewMore: (selectorType) => onScreenChange(
|
|
@@ -572,13 +821,13 @@ var HomeScreen = ({ onScreenChange }) => {
|
|
|
572
821
|
})
|
|
573
822
|
)
|
|
574
823
|
}
|
|
575
|
-
) : /* @__PURE__ */
|
|
824
|
+
) : /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement(
|
|
576
825
|
Trans,
|
|
577
826
|
{
|
|
578
827
|
i18nKey: "general.view_changes",
|
|
579
|
-
components: [/* @__PURE__ */
|
|
828
|
+
components: [/* @__PURE__ */ import_react9.default.createElement(Text, { skin: "secondary" })]
|
|
580
829
|
}
|
|
581
|
-
), /* @__PURE__ */
|
|
830
|
+
), /* @__PURE__ */ import_react9.default.createElement(
|
|
582
831
|
PlatformSelector,
|
|
583
832
|
{
|
|
584
833
|
onMultipleDashboardExtensionSelection: () => onScreenChange(ScreenState.DashboardScreen()),
|
|
@@ -589,7 +838,7 @@ var HomeScreen = ({ onScreenChange }) => {
|
|
|
589
838
|
|
|
590
839
|
// src/components/DevCommand/SiteSelectorScreen.tsx
|
|
591
840
|
init_esm_shims();
|
|
592
|
-
var
|
|
841
|
+
var import_react10 = __toESM(require_react(), 1);
|
|
593
842
|
|
|
594
843
|
// src/components/CloseScreen/index.tsx
|
|
595
844
|
init_esm_shims();
|
|
@@ -601,15 +850,15 @@ var SiteSelectorScreen = ({ onScreenChange }) => {
|
|
|
601
850
|
const biLogger = useBiLogger();
|
|
602
851
|
const { site, setSite } = useSite();
|
|
603
852
|
const { reportError } = useErrorReporter();
|
|
604
|
-
const [error, setError] = (0,
|
|
605
|
-
const handleError = (0,
|
|
853
|
+
const [error, setError] = (0, import_react10.useState)(null);
|
|
854
|
+
const handleError = (0, import_react10.useCallback)(
|
|
606
855
|
(error2) => {
|
|
607
856
|
reportError(error2);
|
|
608
857
|
setError(error2);
|
|
609
858
|
},
|
|
610
859
|
[reportError, setError]
|
|
611
860
|
);
|
|
612
|
-
const handleSubmit = (0,
|
|
861
|
+
const handleSubmit = (0, import_react10.useCallback)(
|
|
613
862
|
async (site2) => {
|
|
614
863
|
try {
|
|
615
864
|
await setSite(site2);
|
|
@@ -620,13 +869,13 @@ var SiteSelectorScreen = ({ onScreenChange }) => {
|
|
|
620
869
|
},
|
|
621
870
|
[setSite, onScreenChange, handleError]
|
|
622
871
|
);
|
|
623
|
-
return /* @__PURE__ */
|
|
872
|
+
return /* @__PURE__ */ import_react10.default.createElement(Box_default, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ import_react10.default.createElement(Box_default, { gap: 1 }, /* @__PURE__ */ import_react10.default.createElement(PointerIcon, null), /* @__PURE__ */ import_react10.default.createElement(
|
|
624
873
|
Trans,
|
|
625
874
|
{
|
|
626
875
|
i18nKey: "general.dev_site.current",
|
|
627
876
|
values: { name: site.displayName }
|
|
628
877
|
}
|
|
629
|
-
)), /* @__PURE__ */
|
|
878
|
+
)), /* @__PURE__ */ import_react10.default.createElement(Box_default, { flexDirection: "column" }, /* @__PURE__ */ import_react10.default.createElement(
|
|
630
879
|
SiteSelector,
|
|
631
880
|
{
|
|
632
881
|
appId: model.config.appId,
|
|
@@ -634,24 +883,24 @@ var SiteSelectorScreen = ({ onScreenChange }) => {
|
|
|
634
883
|
onSubmit: handleSubmit,
|
|
635
884
|
onError: handleError
|
|
636
885
|
}
|
|
637
|
-
), error ? /* @__PURE__ */
|
|
886
|
+
), error ? /* @__PURE__ */ import_react10.default.createElement(
|
|
638
887
|
ErrorViewer,
|
|
639
888
|
{
|
|
640
889
|
error,
|
|
641
|
-
systemErrorOverride: /* @__PURE__ */
|
|
890
|
+
systemErrorOverride: /* @__PURE__ */ import_react10.default.createElement(Alert, { type: "error" }, t("dev_command.site_selector.error"))
|
|
642
891
|
}
|
|
643
|
-
) : null), /* @__PURE__ */
|
|
892
|
+
) : null), /* @__PURE__ */ import_react10.default.createElement(CloseScreen, { onClose: () => onScreenChange(ScreenState.Home()) }));
|
|
644
893
|
};
|
|
645
894
|
|
|
646
895
|
// src/components/DevCommand/BackendScreen.tsx
|
|
647
896
|
init_esm_shims();
|
|
648
|
-
var
|
|
649
|
-
var
|
|
897
|
+
var import_react13 = __toESM(require_react(), 1);
|
|
898
|
+
var import_variant11 = __toESM(require_lib(), 1);
|
|
650
899
|
|
|
651
900
|
// src/components/DevCommand/BackendNumericViewer.tsx
|
|
652
901
|
init_esm_shims();
|
|
653
|
-
var
|
|
654
|
-
var
|
|
902
|
+
var import_react11 = __toESM(require_react(), 1);
|
|
903
|
+
var import_variant9 = __toESM(require_lib(), 1);
|
|
655
904
|
var MAX_BACKEND_COMPONENT = 9;
|
|
656
905
|
var MAX_SERVICE_PLUGINS = 4;
|
|
657
906
|
var MAX_EVENTS = 5;
|
|
@@ -698,9 +947,9 @@ var BackendNumericViewer = ({
|
|
|
698
947
|
...backendEventsShowMoreIndex ? [NumericOption.ViewMore("Event")] : []
|
|
699
948
|
];
|
|
700
949
|
const getLabelKey = (backendComponent) => {
|
|
701
|
-
return (0,
|
|
950
|
+
return (0, import_variant9.match)(
|
|
702
951
|
backendComponent,
|
|
703
|
-
(0,
|
|
952
|
+
(0, import_variant9.lookup)({
|
|
704
953
|
Api: "general.backend_api_viewer.title",
|
|
705
954
|
Event: "general.backend_events_viewer.title",
|
|
706
955
|
ServicePlugin: "general.backend_plugin_viewer.title"
|
|
@@ -712,7 +961,7 @@ var BackendNumericViewer = ({
|
|
|
712
961
|
if (inputNumber > 0 && inputNumber <= visibleItems.length) {
|
|
713
962
|
const item = visibleItems.at(inputNumber - 1);
|
|
714
963
|
if (item) {
|
|
715
|
-
(0,
|
|
964
|
+
(0, import_variant9.match)(item, {
|
|
716
965
|
Item: (item2) => {
|
|
717
966
|
bi.cliAction({
|
|
718
967
|
question: t(getLabelKey(item2.value)),
|
|
@@ -739,7 +988,7 @@ var BackendNumericViewer = ({
|
|
|
739
988
|
}
|
|
740
989
|
}
|
|
741
990
|
});
|
|
742
|
-
const handleSelect = (0,
|
|
991
|
+
const handleSelect = (0, import_react11.useCallback)(
|
|
743
992
|
(backendComponent) => {
|
|
744
993
|
onSelect?.(backendComponent);
|
|
745
994
|
},
|
|
@@ -747,27 +996,27 @@ var BackendNumericViewer = ({
|
|
|
747
996
|
);
|
|
748
997
|
const backendPlugins = visibleItems.slice(0, servicePluginsCount);
|
|
749
998
|
const backendEvents = visibleItems.slice(servicePluginsCount);
|
|
750
|
-
return /* @__PURE__ */
|
|
999
|
+
return /* @__PURE__ */ import_react11.default.createElement(Box_default, { flexDirection: "column", gap: 1 }, backendPlugins.length > 0 && /* @__PURE__ */ import_react11.default.createElement(
|
|
751
1000
|
NumericViewer,
|
|
752
1001
|
{
|
|
753
1002
|
startIndex: 0,
|
|
754
1003
|
titleKey: "general.backend_plugin_viewer.title",
|
|
755
1004
|
items: backendPlugins
|
|
756
1005
|
}
|
|
757
|
-
), backendEvents.length > 0 && /* @__PURE__ */
|
|
1006
|
+
), backendEvents.length > 0 && /* @__PURE__ */ import_react11.default.createElement(
|
|
758
1007
|
NumericViewer,
|
|
759
1008
|
{
|
|
760
1009
|
startIndex: servicePluginsCount,
|
|
761
1010
|
titleKey: "general.backend_events_viewer.title",
|
|
762
1011
|
items: backendEvents
|
|
763
1012
|
}
|
|
764
|
-
), onClose && /* @__PURE__ */
|
|
1013
|
+
), onClose && /* @__PURE__ */ import_react11.default.createElement(CloseScreen, { onClose }));
|
|
765
1014
|
};
|
|
766
1015
|
|
|
767
1016
|
// src/components/DevCommand/BackendArrowViewer.tsx
|
|
768
1017
|
init_esm_shims();
|
|
769
|
-
var
|
|
770
|
-
var
|
|
1018
|
+
var import_react12 = __toESM(require_react(), 1);
|
|
1019
|
+
var import_variant10 = __toESM(require_lib(), 1);
|
|
771
1020
|
var BackendArrowViewer = ({
|
|
772
1021
|
backendComponentName,
|
|
773
1022
|
onClose,
|
|
@@ -776,10 +1025,10 @@ var BackendArrowViewer = ({
|
|
|
776
1025
|
const { t } = useTranslation();
|
|
777
1026
|
const bi = useWixCliAppBi();
|
|
778
1027
|
const { backendComponentsByType } = useBackendComponents();
|
|
779
|
-
const getLabelKey = (0,
|
|
780
|
-
() => (0,
|
|
1028
|
+
const getLabelKey = (0, import_react12.useCallback)(
|
|
1029
|
+
() => (0, import_variant10.match)(
|
|
781
1030
|
backendComponentName,
|
|
782
|
-
(0,
|
|
1031
|
+
(0, import_variant10.lookup)({
|
|
783
1032
|
Api: "dev_command.backend_apis_screen.select_label",
|
|
784
1033
|
Event: "dev_command.backend_events_screen.select_label",
|
|
785
1034
|
ServicePlugin: "dev_command.backend_plugins_screen.select_label"
|
|
@@ -787,8 +1036,8 @@ var BackendArrowViewer = ({
|
|
|
787
1036
|
),
|
|
788
1037
|
[backendComponentName]
|
|
789
1038
|
);
|
|
790
|
-
const getBackendComponentName = (backendComponent) => (0,
|
|
791
|
-
const handleSubmit = (0,
|
|
1039
|
+
const getBackendComponentName = (backendComponent) => (0, import_variant10.isType)(backendComponent, "ServicePlugin") ? backendComponent.servicePlugin.name : backendComponent.title;
|
|
1040
|
+
const handleSubmit = (0, import_react12.useCallback)(
|
|
792
1041
|
(backendComponent) => {
|
|
793
1042
|
bi.cliAction({
|
|
794
1043
|
question: t(getLabelKey()),
|
|
@@ -800,7 +1049,7 @@ var BackendArrowViewer = ({
|
|
|
800
1049
|
},
|
|
801
1050
|
[bi, getLabelKey, onSelect, t]
|
|
802
1051
|
);
|
|
803
|
-
const options = (0,
|
|
1052
|
+
const options = (0, import_react12.useMemo)(() => {
|
|
804
1053
|
return backendComponentsByType[backendComponentName].map(
|
|
805
1054
|
(backendComponent, index) => ({
|
|
806
1055
|
key: index.toString(),
|
|
@@ -809,19 +1058,19 @@ var BackendArrowViewer = ({
|
|
|
809
1058
|
})
|
|
810
1059
|
);
|
|
811
1060
|
}, [backendComponentsByType, backendComponentName]);
|
|
812
|
-
return /* @__PURE__ */
|
|
1061
|
+
return /* @__PURE__ */ import_react12.default.createElement(Box_default, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ import_react12.default.createElement(Box_default, { flexDirection: "column" }, /* @__PURE__ */ import_react12.default.createElement(
|
|
813
1062
|
SelectInput,
|
|
814
1063
|
{
|
|
815
1064
|
label: t(getLabelKey()),
|
|
816
1065
|
options,
|
|
817
1066
|
onSubmit: ({ value: backendComponent }) => handleSubmit(backendComponent)
|
|
818
1067
|
}
|
|
819
|
-
)), /* @__PURE__ */
|
|
1068
|
+
)), /* @__PURE__ */ import_react12.default.createElement(CloseScreen, { onClose }));
|
|
820
1069
|
};
|
|
821
1070
|
|
|
822
1071
|
// src/components/DevCommand/BackendScreen.tsx
|
|
823
|
-
var BackendScreenSelector = (0,
|
|
824
|
-
Arrow: (0,
|
|
1072
|
+
var BackendScreenSelector = (0, import_variant11.variant)({
|
|
1073
|
+
Arrow: (0, import_variant11.fields)(),
|
|
825
1074
|
Numeric: {}
|
|
826
1075
|
});
|
|
827
1076
|
var BackendScreen = ({
|
|
@@ -829,9 +1078,9 @@ var BackendScreen = ({
|
|
|
829
1078
|
onSelect,
|
|
830
1079
|
initialSelectorType = BackendScreenSelector.Numeric()
|
|
831
1080
|
}) => {
|
|
832
|
-
const [selectorType, setSelectorType] = (0,
|
|
833
|
-
return /* @__PURE__ */
|
|
834
|
-
Arrow: ({ backendComponentName }) => /* @__PURE__ */
|
|
1081
|
+
const [selectorType, setSelectorType] = (0, import_react13.useState)(initialSelectorType);
|
|
1082
|
+
return /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, (0, import_variant11.match)(selectorType, {
|
|
1083
|
+
Arrow: ({ backendComponentName }) => /* @__PURE__ */ import_react13.default.createElement(
|
|
835
1084
|
BackendArrowViewer,
|
|
836
1085
|
{
|
|
837
1086
|
backendComponentName,
|
|
@@ -839,7 +1088,7 @@ var BackendScreen = ({
|
|
|
839
1088
|
onClose
|
|
840
1089
|
}
|
|
841
1090
|
),
|
|
842
|
-
Numeric: () => /* @__PURE__ */
|
|
1091
|
+
Numeric: () => /* @__PURE__ */ import_react13.default.createElement(
|
|
843
1092
|
BackendNumericViewer,
|
|
844
1093
|
{
|
|
845
1094
|
onViewMore: setSelectorType,
|
|
@@ -851,11 +1100,11 @@ var BackendScreen = ({
|
|
|
851
1100
|
|
|
852
1101
|
// src/components/DevCommand/DevCommandScreens.tsx
|
|
853
1102
|
var DevCommandScreens = () => {
|
|
854
|
-
const [screen, setScreen] = (0,
|
|
855
|
-
return (0,
|
|
856
|
-
Home: () => /* @__PURE__ */
|
|
857
|
-
SiteSelector: () => /* @__PURE__ */
|
|
858
|
-
DashboardScreen: ({ selectorType }) => /* @__PURE__ */
|
|
1103
|
+
const [screen, setScreen] = (0, import_react14.useState)(ScreenState.Home());
|
|
1104
|
+
return (0, import_variant12.match)(screen, {
|
|
1105
|
+
Home: () => /* @__PURE__ */ import_react14.default.createElement(HomeScreen, { onScreenChange: setScreen }),
|
|
1106
|
+
SiteSelector: () => /* @__PURE__ */ import_react14.default.createElement(SiteSelectorScreen, { onScreenChange: setScreen }),
|
|
1107
|
+
DashboardScreen: ({ selectorType }) => /* @__PURE__ */ import_react14.default.createElement(
|
|
859
1108
|
DashboardScreen,
|
|
860
1109
|
{
|
|
861
1110
|
initialSelectorType: selectorType,
|
|
@@ -863,7 +1112,7 @@ var DevCommandScreens = () => {
|
|
|
863
1112
|
onClose: () => setScreen(ScreenState.Home())
|
|
864
1113
|
}
|
|
865
1114
|
),
|
|
866
|
-
BackendScreen: ({ selectorType }) => /* @__PURE__ */
|
|
1115
|
+
BackendScreen: ({ selectorType }) => /* @__PURE__ */ import_react14.default.createElement(
|
|
867
1116
|
BackendScreen,
|
|
868
1117
|
{
|
|
869
1118
|
initialSelectorType: selectorType,
|
|
@@ -876,7 +1125,7 @@ var DevCommandScreens = () => {
|
|
|
876
1125
|
|
|
877
1126
|
// src/components/DevCommand/TunnelingConsent.tsx
|
|
878
1127
|
init_esm_shims();
|
|
879
|
-
var
|
|
1128
|
+
var import_react15 = __toESM(require_react(), 1);
|
|
880
1129
|
|
|
881
1130
|
// ../cli-user-config/src/user-config.ts
|
|
882
1131
|
init_esm_shims();
|
|
@@ -901,12 +1150,12 @@ async function updateUserConfig(config) {
|
|
|
901
1150
|
}
|
|
902
1151
|
|
|
903
1152
|
// src/components/DevCommand/TunnelingConsent.tsx
|
|
904
|
-
var
|
|
1153
|
+
var import_variant13 = __toESM(require_lib(), 1);
|
|
905
1154
|
var TunnelingConsent = ({ children }) => {
|
|
906
1155
|
const exit = useExit();
|
|
907
1156
|
const { t } = useTranslation();
|
|
908
1157
|
const { backendComponents } = useBackendComponents();
|
|
909
|
-
const [approved, setApproved] = (0,
|
|
1158
|
+
const [approved, setApproved] = (0, import_react15.useState)();
|
|
910
1159
|
const { status } = useAsync(async () => {
|
|
911
1160
|
const config = await readUserConfig();
|
|
912
1161
|
if (config.tunneling) {
|
|
@@ -917,8 +1166,8 @@ var TunnelingConsent = ({ children }) => {
|
|
|
917
1166
|
if (backendComponents.length === 0 || approved) {
|
|
918
1167
|
return children;
|
|
919
1168
|
}
|
|
920
|
-
return /* @__PURE__ */
|
|
921
|
-
Success: () => /* @__PURE__ */
|
|
1169
|
+
return /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, (0, import_variant13.match)(status, {
|
|
1170
|
+
Success: () => /* @__PURE__ */ import_react15.default.createElement(
|
|
922
1171
|
ConfirmInput,
|
|
923
1172
|
{
|
|
924
1173
|
label: t("dev_command.tunneling.confirm"),
|
|
@@ -934,177 +1183,71 @@ var TunnelingConsent = ({ children }) => {
|
|
|
934
1183
|
),
|
|
935
1184
|
Error: () => null,
|
|
936
1185
|
Loading: () => null
|
|
937
|
-
}), approved === false && /* @__PURE__ */
|
|
1186
|
+
}), approved === false && /* @__PURE__ */ import_react15.default.createElement(Text, { skin: "error" }, /* @__PURE__ */ import_react15.default.createElement(Trans, { i18nKey: "dev_command.tunneling.abort_dev" })));
|
|
938
1187
|
};
|
|
939
1188
|
|
|
940
|
-
// src/components/DevCommand/
|
|
1189
|
+
// src/components/DevCommand/RequiredAppsWarning.tsx
|
|
941
1190
|
init_esm_shims();
|
|
942
|
-
var
|
|
943
|
-
var
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
tagName: DUMMY_CUSTOM_ELEMENT_TAG_NAME
|
|
969
|
-
}
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
};
|
|
973
|
-
}
|
|
974
|
-
);
|
|
975
|
-
await createComponents(
|
|
976
|
-
model.config.appId,
|
|
977
|
-
componentConfigs,
|
|
978
|
-
model.config.projectId
|
|
979
|
-
);
|
|
980
|
-
const { customElementsCreationDelay } = getTestOverrides();
|
|
981
|
-
const [{ data: signedAppMarketParams }] = await Promise.all([
|
|
982
|
-
httpClient.post(
|
|
983
|
-
"/_serverless/app-market-json-web-token/json-web-token",
|
|
984
|
-
{
|
|
985
|
-
data: {
|
|
986
|
-
data: JSON.stringify({
|
|
987
|
-
appDefId: model.config.appId,
|
|
988
|
-
version: "latest"
|
|
989
|
-
})
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
).catch((e) => {
|
|
993
|
-
throw new CliError({
|
|
994
|
-
code: CliErrorCode.FailedToGenerateAppMarketQueryParam(),
|
|
995
|
-
cause: e
|
|
996
|
-
});
|
|
997
|
-
}),
|
|
998
|
-
setTimeout(customElementsCreationDelay ?? 5e3)
|
|
999
|
-
]);
|
|
1000
|
-
const url = new URL(`https://wix.com/editor/${site.id}`);
|
|
1001
|
-
url.searchParams.append("openPanel", "appMarket");
|
|
1002
|
-
url.searchParams.append("preferAppManager", "true");
|
|
1003
|
-
url.searchParams.append("appMarketParams", signedAppMarketParams);
|
|
1004
|
-
url.searchParams.append("apps-override", armTag);
|
|
1005
|
-
await openBrowser(
|
|
1006
|
-
redirectWithCSMv2FTs(url, PlatformType.Editor()).toString()
|
|
1007
|
-
);
|
|
1008
|
-
},
|
|
1009
|
-
{
|
|
1010
|
-
onError: (error) => {
|
|
1011
|
-
reportError(error);
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
|
-
);
|
|
1015
|
-
use_input_default(
|
|
1016
|
-
(0, import_react14.useCallback)(
|
|
1017
|
-
(input, key) => {
|
|
1018
|
-
if (key.return) {
|
|
1019
|
-
void prepareNewElements.execute();
|
|
1020
|
-
}
|
|
1021
|
-
},
|
|
1022
|
-
[prepareNewElements]
|
|
1023
|
-
),
|
|
1024
|
-
{
|
|
1025
|
-
isActive: (0, import_variant12.isType)(prepareNewElements.status, "NotRequested")
|
|
1026
|
-
}
|
|
1027
|
-
);
|
|
1028
|
-
use_input_default(
|
|
1029
|
-
(0, import_react14.useCallback)(
|
|
1030
|
-
(input, key) => {
|
|
1031
|
-
if (key.return) {
|
|
1032
|
-
setAppReinstalledFlag(true);
|
|
1033
|
-
}
|
|
1034
|
-
},
|
|
1035
|
-
[setAppReinstalledFlag]
|
|
1036
|
-
),
|
|
1037
|
-
{
|
|
1038
|
-
isActive: !isAppReinstalled && ((0, import_variant12.isType)(prepareNewElements.status, "Success") || (0, import_variant12.isType)(prepareNewElements.status, "Error"))
|
|
1039
|
-
}
|
|
1040
|
-
);
|
|
1041
|
-
if (isAppReinstalled) {
|
|
1042
|
-
return children;
|
|
1191
|
+
var import_react17 = __toESM(require_react(), 1);
|
|
1192
|
+
var import_variant14 = __toESM(require_lib(), 1);
|
|
1193
|
+
|
|
1194
|
+
// ../metasite-manager-client/src/index.ts
|
|
1195
|
+
init_esm_shims();
|
|
1196
|
+
|
|
1197
|
+
// ../metasite-manager-client/src/useMetasiteManagerClient.ts
|
|
1198
|
+
init_esm_shims();
|
|
1199
|
+
var import_react16 = __toESM(require_react(), 1);
|
|
1200
|
+
|
|
1201
|
+
// ../metasite-manager-client/src/metasite-manager-client.ts
|
|
1202
|
+
init_esm_shims();
|
|
1203
|
+
|
|
1204
|
+
// ../metasite-manager-client/src/schemas.ts
|
|
1205
|
+
init_esm_shims();
|
|
1206
|
+
var clientSpecMapSchema = z.record(
|
|
1207
|
+
z.object({
|
|
1208
|
+
appDefinitionId: z.string().optional(),
|
|
1209
|
+
permissions: z.object({ revoked: z.boolean() }).optional()
|
|
1210
|
+
})
|
|
1211
|
+
);
|
|
1212
|
+
|
|
1213
|
+
// ../metasite-manager-client/src/metasite-manager-client.ts
|
|
1214
|
+
var MetasiteManagerClient = class {
|
|
1215
|
+
constructor(httpClient) {
|
|
1216
|
+
this.httpClient = httpClient;
|
|
1043
1217
|
}
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
Error: () => /* @__PURE__ */ import_react14.default.createElement(Alert, { type: "error" }, /* @__PURE__ */ import_react14.default.createElement(Text, null, /* @__PURE__ */ import_react14.default.createElement(
|
|
1056
|
-
Trans,
|
|
1057
|
-
{
|
|
1058
|
-
i18nKey: "dev_command.new_custom_element.reinstall_error",
|
|
1059
|
-
components: [/* @__PURE__ */ import_react14.default.createElement(Key, { value: "enter" })]
|
|
1060
|
-
}
|
|
1061
|
-
))),
|
|
1062
|
-
NotRequested: () => /* @__PURE__ */ import_react14.default.createElement(Alert, { type: "warning" }, /* @__PURE__ */ import_react14.default.createElement(Text, null, /* @__PURE__ */ import_react14.default.createElement(
|
|
1063
|
-
Trans,
|
|
1064
|
-
{
|
|
1065
|
-
i18nKey: "dev_command.new_custom_element.warning",
|
|
1066
|
-
components: [/* @__PURE__ */ import_react14.default.createElement(Key, { value: "enter" }), /* @__PURE__ */ import_react14.default.createElement(Text, { bold: true, skin: "info" })]
|
|
1067
|
-
}
|
|
1068
|
-
)))
|
|
1069
|
-
});
|
|
1070
|
-
};
|
|
1071
|
-
var CustomElementsMigration = ({ children }) => {
|
|
1072
|
-
const { getAppByVersion } = useDevCenterClient();
|
|
1073
|
-
const { model } = useProjectModel();
|
|
1074
|
-
const { t } = useTranslation();
|
|
1075
|
-
const customElementsCheck = useAsync(async () => {
|
|
1076
|
-
const localCustomElements = model.components.filter(
|
|
1077
|
-
(component) => (0, import_variant12.isType)(component, DevCenterComponent.CustomElement)
|
|
1078
|
-
);
|
|
1079
|
-
if (!localCustomElements.length) {
|
|
1080
|
-
return [];
|
|
1218
|
+
getClientSpecMap = async (metaSiteId) => {
|
|
1219
|
+
try {
|
|
1220
|
+
const { data } = await this.httpClient.request({
|
|
1221
|
+
url: `/_api/msm/v1/meta-site/editor-client-spec-map/${metaSiteId}`
|
|
1222
|
+
});
|
|
1223
|
+
return clientSpecMapSchema.parse(data);
|
|
1224
|
+
} catch (e) {
|
|
1225
|
+
throw new CliError({
|
|
1226
|
+
code: CliErrorCode.FailedToGetClientSpecMap(),
|
|
1227
|
+
cause: e
|
|
1228
|
+
});
|
|
1081
1229
|
}
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
);
|
|
1095
|
-
return newCustomElements;
|
|
1096
|
-
}, []);
|
|
1097
|
-
return (0, import_variant12.match)(customElementsCheck.status, {
|
|
1098
|
-
Error: () => null,
|
|
1099
|
-
Loading: () => /* @__PURE__ */ import_react14.default.createElement(Spinner, { text: t("dev_command.custom_elements_migration.loading") }),
|
|
1100
|
-
Success: ({ result: newCustomElements }) => newCustomElements.length ? /* @__PURE__ */ import_react14.default.createElement(AppUpdater, { newCustomElements }, children) : children
|
|
1101
|
-
});
|
|
1230
|
+
};
|
|
1231
|
+
getSiteInstalledApps = async (metaSiteId) => {
|
|
1232
|
+
try {
|
|
1233
|
+
const clientSpecMap = await this.getClientSpecMap(metaSiteId);
|
|
1234
|
+
return Object.values(clientSpecMap).filter((spec) => spec.appDefinitionId && !spec.permissions?.revoked).map((spec) => spec.appDefinitionId);
|
|
1235
|
+
} catch (e) {
|
|
1236
|
+
throw new CliError({
|
|
1237
|
+
code: CliErrorCode.FailedToGetSiteInstalledApps(),
|
|
1238
|
+
cause: e
|
|
1239
|
+
});
|
|
1240
|
+
}
|
|
1241
|
+
};
|
|
1102
1242
|
};
|
|
1103
1243
|
|
|
1244
|
+
// ../metasite-manager-client/src/useMetasiteManagerClient.ts
|
|
1245
|
+
function useMetasiteManagerClient() {
|
|
1246
|
+
const httpClient = useHttpClient({ type: "general" });
|
|
1247
|
+
return (0, import_react16.useMemo)(() => new MetasiteManagerClient(httpClient), [httpClient]);
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1104
1250
|
// src/components/DevCommand/RequiredAppsWarning.tsx
|
|
1105
|
-
init_esm_shims();
|
|
1106
|
-
var import_react15 = __toESM(require_react(), 1);
|
|
1107
|
-
var import_variant13 = __toESM(require_lib(), 1);
|
|
1108
1251
|
var RequiredAppsWarning = ({ children }) => {
|
|
1109
1252
|
const { logger } = useDevEnvironment();
|
|
1110
1253
|
const { site } = useSite();
|
|
@@ -1125,13 +1268,13 @@ var RequiredAppsWarning = ({ children }) => {
|
|
|
1125
1268
|
return;
|
|
1126
1269
|
}
|
|
1127
1270
|
logger.warn(
|
|
1128
|
-
/* @__PURE__ */
|
|
1271
|
+
/* @__PURE__ */ import_react17.default.createElement(Alert, { type: "warning" }, t("dev_command.required_apps.warning", {
|
|
1129
1272
|
requiredAppNames: missingRequiredApps.map((app) => app.name).join(", ")
|
|
1130
1273
|
}))
|
|
1131
1274
|
);
|
|
1132
1275
|
}, []);
|
|
1133
|
-
return (0,
|
|
1134
|
-
Loading: () => /* @__PURE__ */
|
|
1276
|
+
return (0, import_variant14.match)(requiredAppsStatus, {
|
|
1277
|
+
Loading: () => /* @__PURE__ */ import_react17.default.createElement(Spinner, { text: t("dev_command.required_apps.loading") }),
|
|
1135
1278
|
Error: () => null,
|
|
1136
1279
|
Success: () => children
|
|
1137
1280
|
});
|
|
@@ -1139,9 +1282,9 @@ var RequiredAppsWarning = ({ children }) => {
|
|
|
1139
1282
|
|
|
1140
1283
|
// src/components/DevCommand/DevScreenBorder.tsx
|
|
1141
1284
|
init_esm_shims();
|
|
1142
|
-
var
|
|
1285
|
+
var import_react18 = __toESM(require_react(), 1);
|
|
1143
1286
|
var DevScreenBorder = ({ children }) => {
|
|
1144
|
-
return /* @__PURE__ */
|
|
1287
|
+
return /* @__PURE__ */ import_react18.default.createElement(
|
|
1145
1288
|
Box_default,
|
|
1146
1289
|
{
|
|
1147
1290
|
flexDirection: "column",
|
|
@@ -1158,11 +1301,11 @@ var DevScreenBorder = ({ children }) => {
|
|
|
1158
1301
|
|
|
1159
1302
|
// src/components/DevCommand/DevCommand.tsx
|
|
1160
1303
|
var DevCommand = ({ https }) => {
|
|
1161
|
-
const logger = (0,
|
|
1162
|
-
return /* @__PURE__ */
|
|
1304
|
+
const logger = (0, import_react19.useMemo)(() => createLogger({ timestamp: true }), []);
|
|
1305
|
+
return /* @__PURE__ */ import_react19.default.createElement(SiteProvider, null, /* @__PURE__ */ import_react19.default.createElement(TunnelingConsent, null, /* @__PURE__ */ import_react19.default.createElement(DevEnvironmentProvider, { logger, https }, /* @__PURE__ */ import_react19.default.createElement(CustomElementsMigration, null, /* @__PURE__ */ import_react19.default.createElement(EditorInstallation, null, /* @__PURE__ */ import_react19.default.createElement(RequiredAppsWarning, null, /* @__PURE__ */ import_react19.default.createElement(DevScreenBorder, null, /* @__PURE__ */ import_react19.default.createElement(DevCommandScreens, null))))))));
|
|
1163
1306
|
};
|
|
1164
1307
|
export {
|
|
1165
1308
|
DevCommand,
|
|
1166
1309
|
DevEnvironmentProvider
|
|
1167
1310
|
};
|
|
1168
|
-
//# sourceMappingURL=DevCommand-
|
|
1311
|
+
//# sourceMappingURL=DevCommand-U5VNLUWE.js.map
|