@attraccess/plugin-shelly 0.1.0-nightly.991.1 → 0.2.0
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/LICENSE.md +14 -0
- package/dist/index.js +9797 -306
- package/frontend/{__federation_expose_Plugin-Dd1Vs4iR.js → __federation_expose_Plugin-XVfbDNc5.js} +957 -690
- package/frontend/__federation_fn_import-BHGw2mzr.js +1 -0
- package/frontend/{_virtual___federation_fn_import-BXODRNto.js → _virtual___federation_fn_import-D2E5es2p.js} +2 -4
- package/frontend/host-shared-placeholder-BvRk9kiK.js +0 -0
- package/frontend/remoteEntry.js +3 -5
- package/frontend/style.css +4 -83
- package/package.json +16 -11
- package/dist/migrations.js +0 -57
- package/frontend/__federation_fn_import-DAGm_xmC.js +0 -2
- package/frontend/jsx-runtime-B9Qmn8k7.js +0 -42
- package/frontend/preload-helper-DxWiKyOd.js +0 -68
- package/frontend/react-D5kF5LxZ.js +0 -383
- package/frontend/rolldown-runtime-EAsCxrDo.js +0 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { r as importShared, t as importSharedLocal, n as importSharedRuntime } from "./_virtual___federation_fn_import-D2E5es2p.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../../node_modules/.pnpm/@originjs+vite-plugin-federation@1.4.1/node_modules/@originjs/vite-plugin-federation/dist/satisfy.mjs
|
|
2
2
|
var buildIdentifier = "[0-9A-Za-z-]+";
|
|
3
3
|
var build = `(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`;
|
|
4
4
|
var numericIdentifier = "0|[1-9]\\d*";
|
|
@@ -221,8 +221,7 @@ function satisfy(version, range) {
|
|
|
221
221
|
}
|
|
222
222
|
return true;
|
|
223
223
|
}
|
|
224
|
-
|
|
225
|
-
//#region \0virtual:__federation_fn_import
|
|
224
|
+
// \0virtual:__federation_fn_import
|
|
226
225
|
var moduleMap = {};
|
|
227
226
|
var moduleCache = Object.create(null);
|
|
228
227
|
async function importShared(name, shareScope = "default") {
|
|
@@ -257,5 +256,4 @@ function flattenModule(module, name) {
|
|
|
257
256
|
moduleCache[name] = module;
|
|
258
257
|
return module;
|
|
259
258
|
}
|
|
260
|
-
//#endregion
|
|
261
259
|
export { getSharedFromRuntime as n, importShared as r, getSharedFromLocal as t };
|
|
File without changes
|
package/frontend/remoteEntry.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
//#region \0virtual:__remoteEntryHelper__remoteEntry.js
|
|
1
|
+
// \0virtual:__remoteEntryHelper__remoteEntry.js
|
|
3
2
|
var currentImports = {};
|
|
4
3
|
var exportSet = /* @__PURE__ */ new Set([
|
|
5
4
|
"Module",
|
|
@@ -9,7 +8,7 @@ var exportSet = /* @__PURE__ */ new Set([
|
|
|
9
8
|
]);
|
|
10
9
|
var moduleMap = { "./plugin": () => {
|
|
11
10
|
dynamicLoadingCss(["style.css"], false, "./plugin");
|
|
12
|
-
return __federation_import("./__federation_expose_Plugin-
|
|
11
|
+
return __federation_import("./__federation_expose_Plugin-XVfbDNc5.js").then((module) => Object.keys(module).every((item) => exportSet.has(item)) ? () => module.default : () => module);
|
|
13
12
|
} };
|
|
14
13
|
var seen = {};
|
|
15
14
|
var dynamicLoadingCss = (cssFilePaths, dontAppendStylesToHead, exposeItemName) => {
|
|
@@ -52,7 +51,7 @@ var dynamicLoadingCss = (cssFilePaths, dontAppendStylesToHead, exposeItemName) =
|
|
|
52
51
|
});
|
|
53
52
|
};
|
|
54
53
|
async function __federation_import(name) {
|
|
55
|
-
currentImports[name] ??=
|
|
54
|
+
currentImports[name] ??= import(name);
|
|
56
55
|
return currentImports[name];
|
|
57
56
|
}
|
|
58
57
|
var get = (module) => {
|
|
@@ -70,5 +69,4 @@ var init = (shareScope) => {
|
|
|
70
69
|
}
|
|
71
70
|
});
|
|
72
71
|
};
|
|
73
|
-
//#endregion
|
|
74
72
|
export { dynamicLoadingCss, get, init };
|
package/frontend/style.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! tailwindcss v4.3.
|
|
1
|
+
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties {
|
|
3
|
-
@supports (((-webkit-hyphens: none)) and (not (margin-trim:
|
|
3
|
+
@supports (((-webkit-hyphens: none)) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
|
|
4
4
|
*, :before, :after, ::backdrop {
|
|
5
5
|
--tw-border-style: solid;
|
|
6
6
|
--tw-font-weight: initial;
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
|
|
12
12
|
:root, :host {
|
|
13
13
|
--sh-spacing: .25rem;
|
|
14
|
-
--sh-container-2xl: 42rem;
|
|
15
14
|
--sh-container-5xl: 64rem;
|
|
16
15
|
--sh-text-xs: .75rem;
|
|
17
16
|
--sh-text-xs--line-height: calc(1 / .75);
|
|
@@ -19,30 +18,11 @@
|
|
|
19
18
|
--sh-text-sm--line-height: calc(1.25 / .875);
|
|
20
19
|
--sh-text-lg: 1.125rem;
|
|
21
20
|
--sh-text-lg--line-height: calc(1.75 / 1.125);
|
|
22
|
-
--sh-text-2xl: 1.5rem;
|
|
23
|
-
--sh-text-2xl--line-height: calc(2 / 1.5);
|
|
24
21
|
--sh-font-weight-medium: 500;
|
|
25
22
|
--sh-font-weight-semibold: 600;
|
|
26
|
-
--sh-font-weight-bold: 700;
|
|
27
23
|
--sh-tracking-wide: .025em;
|
|
28
24
|
}
|
|
29
25
|
|
|
30
|
-
.sh\:absolute {
|
|
31
|
-
position: absolute;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.sh\:relative {
|
|
35
|
-
position: relative;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.sh\:top-6 {
|
|
39
|
-
top: calc(var(--sh-spacing) * 6);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.sh\:right-1 {
|
|
43
|
-
right: var(--sh-spacing);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
26
|
.sh\:mx-auto {
|
|
47
27
|
margin-inline: auto;
|
|
48
28
|
}
|
|
@@ -51,10 +31,6 @@
|
|
|
51
31
|
margin-top: var(--sh-spacing);
|
|
52
32
|
}
|
|
53
33
|
|
|
54
|
-
.sh\:mr-2 {
|
|
55
|
-
margin-right: calc(var(--sh-spacing) * 2);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
34
|
.sh\:block {
|
|
59
35
|
display: block;
|
|
60
36
|
}
|
|
@@ -71,10 +47,6 @@
|
|
|
71
47
|
display: none;
|
|
72
48
|
}
|
|
73
49
|
|
|
74
|
-
.sh\:inline {
|
|
75
|
-
display: inline;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
50
|
.sh\:h-4 {
|
|
79
51
|
height: calc(var(--sh-spacing) * 4);
|
|
80
52
|
}
|
|
@@ -139,10 +111,6 @@
|
|
|
139
111
|
flex-direction: column;
|
|
140
112
|
}
|
|
141
113
|
|
|
142
|
-
.sh\:flex-row {
|
|
143
|
-
flex-direction: row;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
114
|
.sh\:flex-wrap {
|
|
147
115
|
flex-wrap: wrap;
|
|
148
116
|
}
|
|
@@ -195,10 +163,6 @@
|
|
|
195
163
|
gap: calc(var(--sh-spacing) * 6);
|
|
196
164
|
}
|
|
197
165
|
|
|
198
|
-
.sh\:gap-y-4 {
|
|
199
|
-
row-gap: calc(var(--sh-spacing) * 4);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
166
|
.sh\:truncate {
|
|
203
167
|
text-overflow: ellipsis;
|
|
204
168
|
white-space: nowrap;
|
|
@@ -232,11 +196,6 @@
|
|
|
232
196
|
border-left-width: 4px;
|
|
233
197
|
}
|
|
234
198
|
|
|
235
|
-
.sh\:border-dashed {
|
|
236
|
-
--tw-border-style: dashed;
|
|
237
|
-
border-style: dashed;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
199
|
.sh\:border-l-warning {
|
|
241
200
|
border-left-color: var(--warning);
|
|
242
201
|
}
|
|
@@ -245,10 +204,6 @@
|
|
|
245
204
|
background-color: var(--surface);
|
|
246
205
|
}
|
|
247
206
|
|
|
248
|
-
.sh\:bg-surface-secondary {
|
|
249
|
-
background-color: var(--surface-secondary);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
207
|
.sh\:bg-warning\/5 {
|
|
253
208
|
background-color: var(--warning);
|
|
254
209
|
}
|
|
@@ -263,26 +218,14 @@
|
|
|
263
218
|
padding: calc(var(--sh-spacing) * 4);
|
|
264
219
|
}
|
|
265
220
|
|
|
266
|
-
.sh\:p-6 {
|
|
267
|
-
padding: calc(var(--sh-spacing) * 6);
|
|
268
|
-
}
|
|
269
|
-
|
|
270
221
|
.sh\:px-3 {
|
|
271
222
|
padding-inline: calc(var(--sh-spacing) * 3);
|
|
272
223
|
}
|
|
273
224
|
|
|
274
|
-
.sh\:px-4 {
|
|
275
|
-
padding-inline: calc(var(--sh-spacing) * 4);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
225
|
.sh\:py-2 {
|
|
279
226
|
padding-block: calc(var(--sh-spacing) * 2);
|
|
280
227
|
}
|
|
281
228
|
|
|
282
|
-
.sh\:py-12 {
|
|
283
|
-
padding-block: calc(var(--sh-spacing) * 12);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
229
|
.sh\:pt-2 {
|
|
287
230
|
padding-top: calc(var(--sh-spacing) * 2);
|
|
288
231
|
}
|
|
@@ -291,13 +234,8 @@
|
|
|
291
234
|
padding-bottom: 0;
|
|
292
235
|
}
|
|
293
236
|
|
|
294
|
-
.sh\:
|
|
295
|
-
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
.sh\:text-2xl {
|
|
299
|
-
font-size: var(--sh-text-2xl);
|
|
300
|
-
line-height: var(--tw-leading, var(--sh-text-2xl--line-height));
|
|
237
|
+
.sh\:pb-6 {
|
|
238
|
+
padding-bottom: calc(var(--sh-spacing) * 6);
|
|
301
239
|
}
|
|
302
240
|
|
|
303
241
|
.sh\:text-lg {
|
|
@@ -315,11 +253,6 @@
|
|
|
315
253
|
line-height: var(--tw-leading, var(--sh-text-xs--line-height));
|
|
316
254
|
}
|
|
317
255
|
|
|
318
|
-
.sh\:font-bold {
|
|
319
|
-
--tw-font-weight: var(--sh-font-weight-bold);
|
|
320
|
-
font-weight: var(--sh-font-weight-bold);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
256
|
.sh\:font-medium {
|
|
324
257
|
--tw-font-weight: var(--sh-font-weight-medium);
|
|
325
258
|
font-weight: var(--sh-font-weight-medium);
|
|
@@ -343,10 +276,6 @@
|
|
|
343
276
|
color: var(--accent-soft-foreground);
|
|
344
277
|
}
|
|
345
278
|
|
|
346
|
-
.sh\:text-danger {
|
|
347
|
-
color: var(--danger);
|
|
348
|
-
}
|
|
349
|
-
|
|
350
279
|
.sh\:text-foreground {
|
|
351
280
|
color: var(--foreground);
|
|
352
281
|
}
|
|
@@ -387,10 +316,6 @@
|
|
|
387
316
|
}
|
|
388
317
|
|
|
389
318
|
@media (min-width: 48rem) {
|
|
390
|
-
.sh\:md\:mx-auto {
|
|
391
|
-
margin-inline: auto;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
319
|
.sh\:md\:block {
|
|
395
320
|
display: block;
|
|
396
321
|
}
|
|
@@ -399,10 +324,6 @@
|
|
|
399
324
|
display: none;
|
|
400
325
|
}
|
|
401
326
|
|
|
402
|
-
.sh\:md\:max-w-2xl {
|
|
403
|
-
max-width: var(--sh-container-2xl);
|
|
404
|
-
}
|
|
405
|
-
|
|
406
327
|
.sh\:md\:p-6 {
|
|
407
328
|
padding: calc(var(--sh-spacing) * 6);
|
|
408
329
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@attraccess/plugin-shelly",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Official Attraccess integration for Shelly devices.",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/Attraccess/Attraccess.git",
|
|
@@ -22,23 +22,28 @@
|
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@attraccess/plugins-backend-sdk": "^
|
|
26
|
-
"@attraccess/plugins-frontend-sdk": "^
|
|
25
|
+
"@attraccess/plugins-backend-sdk": "^2.0.0-0",
|
|
26
|
+
"@attraccess/plugins-frontend-sdk": "^2.0.0-0",
|
|
27
|
+
"@attraccess/plugins-frontend-ui": "^2.0.0-0"
|
|
27
28
|
},
|
|
28
29
|
"attraccess": {
|
|
29
30
|
"displayName": "Shelly",
|
|
30
31
|
"description": "Control and monitor Shelly devices from Attraccess.",
|
|
31
|
-
"host": "^
|
|
32
|
+
"host": "^2.0.0-0",
|
|
32
33
|
"backend": "dist/index.js",
|
|
33
34
|
"frontend": "frontend/remoteEntry.js",
|
|
34
|
-
"migrations": "dist/migrations.js",
|
|
35
35
|
"styles": "frontend/style.css",
|
|
36
|
+
"dashboardPaths": [
|
|
37
|
+
"/shelly"
|
|
38
|
+
],
|
|
36
39
|
"permissions": [
|
|
37
|
-
"
|
|
40
|
+
"PLUGIN_STORAGE"
|
|
38
41
|
],
|
|
39
42
|
"sdk": {
|
|
40
|
-
"backend": "^
|
|
41
|
-
"frontend": "^
|
|
42
|
-
}
|
|
43
|
-
|
|
43
|
+
"backend": "^2.0.0-0",
|
|
44
|
+
"frontend": "^2.0.0-0"
|
|
45
|
+
},
|
|
46
|
+
"publishedCommit": "aba5a1a9b7e143c00bc771d59018684546f0f336"
|
|
47
|
+
},
|
|
48
|
+
"gitHead": "aba5a1a9b7e143c00bc771d59018684546f0f336"
|
|
44
49
|
}
|
package/dist/migrations.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
20
|
-
|
|
21
|
-
// backend/migrations.ts
|
|
22
|
-
var migrations_exports = {};
|
|
23
|
-
__export(migrations_exports, {
|
|
24
|
-
CreateShellyDevices1749470400000: () => CreateShellyDevices1749470400000
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(migrations_exports);
|
|
27
|
-
|
|
28
|
-
// backend/migrations/1749470400000-create-shelly-devices.ts
|
|
29
|
-
var CreateShellyDevices1749470400000 = class {
|
|
30
|
-
constructor() {
|
|
31
|
-
__publicField(this, "name", "CreateShellyDevices1749470400000");
|
|
32
|
-
}
|
|
33
|
-
async up(queryRunner) {
|
|
34
|
-
await queryRunner.query(
|
|
35
|
-
`CREATE TABLE IF NOT EXISTS "plugin_shelly_devices" (
|
|
36
|
-
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
37
|
-
"name" varchar NOT NULL,
|
|
38
|
-
"ip_address" varchar NOT NULL,
|
|
39
|
-
"generation" integer,
|
|
40
|
-
"model" varchar,
|
|
41
|
-
"auth_state" varchar NOT NULL DEFAULT ('unknown'),
|
|
42
|
-
"last_probe_at" varchar,
|
|
43
|
-
"last_probe_error" varchar,
|
|
44
|
-
"created_at" varchar NOT NULL,
|
|
45
|
-
"updated_at" varchar NOT NULL,
|
|
46
|
-
CONSTRAINT "UQ_plugin_shelly_devices_ip_address" UNIQUE ("ip_address")
|
|
47
|
-
)`
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
async down(queryRunner) {
|
|
51
|
-
await queryRunner.query(`DROP TABLE "plugin_shelly_devices"`);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
-
0 && (module.exports = {
|
|
56
|
-
CreateShellyDevices1749470400000
|
|
57
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { t as __commonJSMin } from "./rolldown-runtime-EAsCxrDo.js";
|
|
2
|
-
//#region ../../../node_modules/.pnpm/react@19.2.8/node_modules/react/cjs/react-jsx-runtime.production.js
|
|
3
|
-
/**
|
|
4
|
-
* @license React
|
|
5
|
-
* react-jsx-runtime.production.js
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/
|
|
12
|
-
var require_react_jsx_runtime_production = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
13
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element");
|
|
14
|
-
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
15
|
-
function jsxProd(type, config, maybeKey) {
|
|
16
|
-
var key = null;
|
|
17
|
-
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
18
|
-
void 0 !== config.key && (key = "" + config.key);
|
|
19
|
-
if ("key" in config) {
|
|
20
|
-
maybeKey = {};
|
|
21
|
-
for (var propName in config) "key" !== propName && (maybeKey[propName] = config[propName]);
|
|
22
|
-
} else maybeKey = config;
|
|
23
|
-
config = maybeKey.ref;
|
|
24
|
-
return {
|
|
25
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
26
|
-
type,
|
|
27
|
-
key,
|
|
28
|
-
ref: void 0 !== config ? config : null,
|
|
29
|
-
props: maybeKey
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
33
|
-
exports.jsx = jsxProd;
|
|
34
|
-
exports.jsxs = jsxProd;
|
|
35
|
-
}));
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region ../../../node_modules/.pnpm/react@19.2.8/node_modules/react/jsx-runtime.js
|
|
38
|
-
var require_jsx_runtime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
39
|
-
module.exports = require_react_jsx_runtime_production();
|
|
40
|
-
}));
|
|
41
|
-
//#endregion
|
|
42
|
-
export { require_jsx_runtime as t };
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
//#region \0vite/preload-helper.js
|
|
2
|
-
var scriptRel = "modulepreload";
|
|
3
|
-
var assetsURL = function(dep) {
|
|
4
|
-
return "/" + dep;
|
|
5
|
-
};
|
|
6
|
-
var seen = {};
|
|
7
|
-
var __vitePreload = function preload(baseModule, deps, importerUrl) {
|
|
8
|
-
let promise = Promise.resolve();
|
|
9
|
-
if (deps && deps.length > 0) {
|
|
10
|
-
const links = document.getElementsByTagName("link");
|
|
11
|
-
const cspNonceMeta = document.querySelector("meta[property=csp-nonce]");
|
|
12
|
-
const cspNonce = cspNonceMeta?.nonce || cspNonceMeta?.getAttribute("nonce");
|
|
13
|
-
function allSettled(promises) {
|
|
14
|
-
return Promise.all(promises.map((p) => Promise.resolve(p).then((value) => ({
|
|
15
|
-
status: "fulfilled",
|
|
16
|
-
value
|
|
17
|
-
}), (reason) => ({
|
|
18
|
-
status: "rejected",
|
|
19
|
-
reason
|
|
20
|
-
}))));
|
|
21
|
-
}
|
|
22
|
-
function importMetaResolve(specifier) {
|
|
23
|
-
if (import.meta.resolve) return import.meta.resolve(specifier);
|
|
24
|
-
return new URL(
|
|
25
|
-
specifier,
|
|
26
|
-
/** #__KEEP__ */
|
|
27
|
-
import.meta.url
|
|
28
|
-
).href;
|
|
29
|
-
}
|
|
30
|
-
promise = allSettled(deps.map((dep) => {
|
|
31
|
-
dep = assetsURL(dep, importerUrl);
|
|
32
|
-
dep = importMetaResolve(dep);
|
|
33
|
-
if (dep in seen) return;
|
|
34
|
-
seen[dep] = true;
|
|
35
|
-
const isCss = dep.endsWith(".css");
|
|
36
|
-
for (let i = links.length - 1; i >= 0; i--) {
|
|
37
|
-
const link = links[i];
|
|
38
|
-
if (link.href === dep && (!isCss || link.rel === "stylesheet")) return;
|
|
39
|
-
}
|
|
40
|
-
const link = document.createElement("link");
|
|
41
|
-
link.rel = isCss ? "stylesheet" : scriptRel;
|
|
42
|
-
if (!isCss) link.as = "script";
|
|
43
|
-
link.crossOrigin = "";
|
|
44
|
-
link.href = dep;
|
|
45
|
-
if (cspNonce) link.setAttribute("nonce", cspNonce);
|
|
46
|
-
document.head.appendChild(link);
|
|
47
|
-
if (isCss) return new Promise((res, rej) => {
|
|
48
|
-
link.addEventListener("load", res);
|
|
49
|
-
link.addEventListener("error", () => rej(/* @__PURE__ */ new Error(`Unable to preload CSS for ${dep}`)));
|
|
50
|
-
});
|
|
51
|
-
}));
|
|
52
|
-
}
|
|
53
|
-
function handlePreloadError(err) {
|
|
54
|
-
const e = new Event("vite:preloadError", { cancelable: true });
|
|
55
|
-
e.payload = err;
|
|
56
|
-
window.dispatchEvent(e);
|
|
57
|
-
if (!e.defaultPrevented) throw err;
|
|
58
|
-
}
|
|
59
|
-
return promise.then((res) => {
|
|
60
|
-
for (const item of res || []) {
|
|
61
|
-
if (item.status !== "rejected") continue;
|
|
62
|
-
handlePreloadError(item.reason);
|
|
63
|
-
}
|
|
64
|
-
return baseModule().catch(handlePreloadError);
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
//#endregion
|
|
68
|
-
export { __vitePreload as t };
|