vite-plugin-blocklet 0.6.6 → 0.6.7
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/dist/index.cjs +38 -8
- package/index.js +6 -1
- package/libs/loading.js +31 -7
- package/package.json +6 -5
package/dist/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vitePluginNodePolyfills = require('vite-plugin-node-polyfills');
|
|
6
|
+
var VitePluginEntryInject = require('vite-plugin-entry-inject');
|
|
6
7
|
var vite = require('vite');
|
|
7
8
|
var semver = require('semver');
|
|
8
9
|
var Mcrypto = require('@ocap/mcrypto');
|
|
@@ -16,6 +17,7 @@ var mri = require('mri');
|
|
|
16
17
|
|
|
17
18
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
19
|
|
|
20
|
+
var VitePluginEntryInject__default = /*#__PURE__*/_interopDefaultLegacy(VitePluginEntryInject);
|
|
19
21
|
var semver__default = /*#__PURE__*/_interopDefaultLegacy(semver);
|
|
20
22
|
var Mcrypto__default = /*#__PURE__*/_interopDefaultLegacy(Mcrypto);
|
|
21
23
|
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
@@ -193,6 +195,21 @@ function generateHtml({ color, image }) {
|
|
|
193
195
|
padding: 0;
|
|
194
196
|
}
|
|
195
197
|
|
|
198
|
+
.spinner-wrapper {
|
|
199
|
+
width: 70px;
|
|
200
|
+
opacity: 0;
|
|
201
|
+
animation-name: fadeIn;
|
|
202
|
+
animation-duration: 500ms;
|
|
203
|
+
animation-timing-function: ease;
|
|
204
|
+
animation-iteration-count: 1;
|
|
205
|
+
animation-delay: 500ms;
|
|
206
|
+
animation-fill-mode: forwards;
|
|
207
|
+
display: flex;
|
|
208
|
+
flex-direction: column;
|
|
209
|
+
justify-content: center;
|
|
210
|
+
align-items: center;
|
|
211
|
+
}
|
|
212
|
+
|
|
196
213
|
.spinner {
|
|
197
214
|
width: 70px;
|
|
198
215
|
text-align: center;
|
|
@@ -219,6 +236,15 @@ function generateHtml({ color, image }) {
|
|
|
219
236
|
animation-delay: -0.16s;
|
|
220
237
|
}
|
|
221
238
|
|
|
239
|
+
@-webkit-keyframes fadeIn {
|
|
240
|
+
0% { opacity: 0; }
|
|
241
|
+
100% { opacity: 1; }
|
|
242
|
+
}
|
|
243
|
+
@keyframes fadeIn {
|
|
244
|
+
0% { opacity: 0; }
|
|
245
|
+
100% { opacity: 1; }
|
|
246
|
+
}
|
|
247
|
+
|
|
222
248
|
@-webkit-keyframes sk-bouncedelay {
|
|
223
249
|
0%,
|
|
224
250
|
80%,
|
|
@@ -243,13 +269,13 @@ function generateHtml({ color, image }) {
|
|
|
243
269
|
}
|
|
244
270
|
}
|
|
245
271
|
</style>
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
272
|
+
<div class="spinner-wrapper">
|
|
273
|
+
<img src="${image}" width="90" height="90" style="margin-bottom: 16px" />
|
|
274
|
+
<div class="spinner">
|
|
275
|
+
<div class="bounce1"></div>
|
|
276
|
+
<div class="bounce2"></div>
|
|
277
|
+
<div class="bounce3"></div>
|
|
278
|
+
</div>
|
|
253
279
|
</div>`;
|
|
254
280
|
}
|
|
255
281
|
|
|
@@ -338,7 +364,11 @@ function createBlockletPlugin(options = {}) {
|
|
|
338
364
|
disableLoading = false,
|
|
339
365
|
...restOptions
|
|
340
366
|
} = options;
|
|
341
|
-
const plugins = [
|
|
367
|
+
const plugins = [
|
|
368
|
+
VitePluginEntryInject__default["default"]({
|
|
369
|
+
injectTo: 'body',
|
|
370
|
+
}),
|
|
371
|
+
];
|
|
342
372
|
if (!disableMeta) {
|
|
343
373
|
plugins.push(createMetaPlugin());
|
|
344
374
|
}
|
package/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
|
2
|
+
import VitePluginEntryInject from 'vite-plugin-entry-inject';
|
|
2
3
|
import createHmrPlugin from './libs/hmr.js';
|
|
3
4
|
import createConfigPlugin from './libs/config.js';
|
|
4
5
|
import createMetaPlugin from './libs/meta.js';
|
|
@@ -35,7 +36,11 @@ export function createBlockletPlugin(options = {}) {
|
|
|
35
36
|
disableLoading = false,
|
|
36
37
|
...restOptions
|
|
37
38
|
} = options;
|
|
38
|
-
const plugins = [
|
|
39
|
+
const plugins = [
|
|
40
|
+
VitePluginEntryInject({
|
|
41
|
+
injectTo: 'body',
|
|
42
|
+
}),
|
|
43
|
+
];
|
|
39
44
|
if (!disableMeta) {
|
|
40
45
|
plugins.push(createMetaPlugin(restOptions));
|
|
41
46
|
}
|
package/libs/loading.js
CHANGED
|
@@ -32,6 +32,21 @@ function generateHtml({ color, image }) {
|
|
|
32
32
|
padding: 0;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
.spinner-wrapper {
|
|
36
|
+
width: 70px;
|
|
37
|
+
opacity: 0;
|
|
38
|
+
animation-name: fadeIn;
|
|
39
|
+
animation-duration: 500ms;
|
|
40
|
+
animation-timing-function: ease;
|
|
41
|
+
animation-iteration-count: 1;
|
|
42
|
+
animation-delay: 500ms;
|
|
43
|
+
animation-fill-mode: forwards;
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
align-items: center;
|
|
48
|
+
}
|
|
49
|
+
|
|
35
50
|
.spinner {
|
|
36
51
|
width: 70px;
|
|
37
52
|
text-align: center;
|
|
@@ -58,6 +73,15 @@ function generateHtml({ color, image }) {
|
|
|
58
73
|
animation-delay: -0.16s;
|
|
59
74
|
}
|
|
60
75
|
|
|
76
|
+
@-webkit-keyframes fadeIn {
|
|
77
|
+
0% { opacity: 0; }
|
|
78
|
+
100% { opacity: 1; }
|
|
79
|
+
}
|
|
80
|
+
@keyframes fadeIn {
|
|
81
|
+
0% { opacity: 0; }
|
|
82
|
+
100% { opacity: 1; }
|
|
83
|
+
}
|
|
84
|
+
|
|
61
85
|
@-webkit-keyframes sk-bouncedelay {
|
|
62
86
|
0%,
|
|
63
87
|
80%,
|
|
@@ -82,13 +106,13 @@ function generateHtml({ color, image }) {
|
|
|
82
106
|
}
|
|
83
107
|
}
|
|
84
108
|
</style>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
109
|
+
<div class="spinner-wrapper">
|
|
110
|
+
<img src="${image}" width="90" height="90" style="margin-bottom: 16px" />
|
|
111
|
+
<div class="spinner">
|
|
112
|
+
<div class="bounce1"></div>
|
|
113
|
+
<div class="bounce2"></div>
|
|
114
|
+
<div class="bounce3"></div>
|
|
115
|
+
</div>
|
|
92
116
|
</div>`;
|
|
93
117
|
}
|
|
94
118
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-blocklet",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.7",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"files": [
|
|
@@ -27,12 +27,13 @@
|
|
|
27
27
|
"rollup": "^2.79.1"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@arcblock/did": "^1.18.
|
|
31
|
-
"@ocap/mcrypto": "^1.18.
|
|
32
|
-
"@ocap/util": "^1.18.
|
|
30
|
+
"@arcblock/did": "^1.18.87",
|
|
31
|
+
"@ocap/mcrypto": "^1.18.87",
|
|
32
|
+
"@ocap/util": "^1.18.87",
|
|
33
33
|
"get-port": "^5.1.1",
|
|
34
34
|
"mri": "^1.2.0",
|
|
35
|
-
"semver": "^7.5.
|
|
35
|
+
"semver": "^7.5.4",
|
|
36
|
+
"vite-plugin-entry-inject": "^1.0.2",
|
|
36
37
|
"vite-plugin-node-polyfills": "^0.7.0",
|
|
37
38
|
"yaml": "^2.3.1"
|
|
38
39
|
},
|