@viewfly/platform-browser 0.0.25 → 0.0.27
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/bundles/create-app.d.ts +2 -2
- package/bundles/fork.d.ts +2 -2
- package/bundles/index.esm.js +8 -47
- package/bundles/index.js +8 -46
- package/package.json +3 -3
package/bundles/create-app.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JSXNode } from '@viewfly/core';
|
|
2
2
|
/**
|
|
3
3
|
* 创建一个 Viewfly 实例
|
|
4
4
|
* @param root 应用根节点
|
|
@@ -14,4 +14,4 @@ import { Viewfly, JSXNode } from '@viewfly/core';
|
|
|
14
14
|
* renderer.refresh() // 手动更新视图
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
-
export declare function createApp(root: JSXNode, autoUpdate?: boolean):
|
|
17
|
+
export declare function createApp(root: JSXNode, autoUpdate?: boolean): import("@viewfly/core").Application<HTMLElement>;
|
package/bundles/fork.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { JSXInternal
|
|
2
|
-
export declare function fork(root: JSXInternal.Element, autoUpdate?: boolean):
|
|
1
|
+
import { JSXInternal } from '@viewfly/core';
|
|
2
|
+
export declare function fork(root: JSXInternal.Element, autoUpdate?: boolean): import("@viewfly/core").Application<import("@viewfly/core").NativeNode>;
|
package/bundles/index.esm.js
CHANGED
|
@@ -1,35 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NativeRenderer, viewfly, makeError, inject, Injector, THROW_IF_NOT_FOUND, InjectFlags, onDestroy } from '@viewfly/core';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Copyright (c) Microsoft Corporation.
|
|
5
|
-
|
|
6
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
7
|
-
purpose with or without fee is hereby granted.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
-
***************************************************************************** */
|
|
17
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function __decorate(decorators, target, key, desc) {
|
|
21
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
22
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
23
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
24
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
28
|
-
var e = new Error(message);
|
|
29
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
let DomRenderer = class DomRenderer extends NativeRenderer {
|
|
3
|
+
class DomRenderer extends NativeRenderer {
|
|
33
4
|
constructor() {
|
|
34
5
|
super(...arguments);
|
|
35
6
|
this.isSVG = new RegExp(`^(${[
|
|
@@ -224,10 +195,7 @@ let DomRenderer = class DomRenderer extends NativeRenderer {
|
|
|
224
195
|
insertBefore(newNode, ref) {
|
|
225
196
|
ref.parentNode.insertBefore(newNode, ref);
|
|
226
197
|
}
|
|
227
|
-
}
|
|
228
|
-
DomRenderer = __decorate([
|
|
229
|
-
Injectable()
|
|
230
|
-
], DomRenderer);
|
|
198
|
+
}
|
|
231
199
|
|
|
232
200
|
/**
|
|
233
201
|
* 创建一个 Viewfly 实例
|
|
@@ -245,15 +213,11 @@ DomRenderer = __decorate([
|
|
|
245
213
|
* ```
|
|
246
214
|
*/
|
|
247
215
|
function createApp(root, autoUpdate = true) {
|
|
248
|
-
|
|
216
|
+
return viewfly({
|
|
249
217
|
root,
|
|
250
218
|
autoUpdate,
|
|
219
|
+
nativeRenderer: new DomRenderer()
|
|
251
220
|
});
|
|
252
|
-
app.provide({
|
|
253
|
-
provide: NativeRenderer,
|
|
254
|
-
useClass: DomRenderer
|
|
255
|
-
});
|
|
256
|
-
return app;
|
|
257
221
|
}
|
|
258
222
|
|
|
259
223
|
const forkErrorFn = makeError('fork');
|
|
@@ -265,15 +229,12 @@ function fork(root, autoUpdate = true) {
|
|
|
265
229
|
catch (_a) {
|
|
266
230
|
throw forkErrorFn('The fork function can only be called synchronously within a component.');
|
|
267
231
|
}
|
|
268
|
-
const app =
|
|
232
|
+
const app = viewfly({
|
|
269
233
|
root,
|
|
270
234
|
context: injector,
|
|
271
|
-
autoUpdate
|
|
235
|
+
autoUpdate,
|
|
236
|
+
nativeRenderer: new DomRenderer()
|
|
272
237
|
});
|
|
273
|
-
app.provide([{
|
|
274
|
-
provide: NativeRenderer,
|
|
275
|
-
useClass: DomRenderer
|
|
276
|
-
}]);
|
|
277
238
|
onDestroy(() => {
|
|
278
239
|
app.destroy();
|
|
279
240
|
});
|
package/bundles/index.js
CHANGED
|
@@ -2,36 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var core = require('@viewfly/core');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
Copyright (c) Microsoft Corporation.
|
|
7
|
-
|
|
8
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
9
|
-
purpose with or without fee is hereby granted.
|
|
10
|
-
|
|
11
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
12
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
13
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
14
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
15
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
16
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
17
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
-
***************************************************************************** */
|
|
19
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function __decorate(decorators, target, key, desc) {
|
|
23
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
25
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
26
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
30
|
-
var e = new Error(message);
|
|
31
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
exports.DomRenderer = class DomRenderer extends core.NativeRenderer {
|
|
5
|
+
class DomRenderer extends core.NativeRenderer {
|
|
35
6
|
constructor() {
|
|
36
7
|
super(...arguments);
|
|
37
8
|
this.isSVG = new RegExp(`^(${[
|
|
@@ -226,10 +197,7 @@ exports.DomRenderer = class DomRenderer extends core.NativeRenderer {
|
|
|
226
197
|
insertBefore(newNode, ref) {
|
|
227
198
|
ref.parentNode.insertBefore(newNode, ref);
|
|
228
199
|
}
|
|
229
|
-
}
|
|
230
|
-
exports.DomRenderer = __decorate([
|
|
231
|
-
core.Injectable()
|
|
232
|
-
], exports.DomRenderer);
|
|
200
|
+
}
|
|
233
201
|
|
|
234
202
|
/**
|
|
235
203
|
* 创建一个 Viewfly 实例
|
|
@@ -247,15 +215,11 @@ exports.DomRenderer = __decorate([
|
|
|
247
215
|
* ```
|
|
248
216
|
*/
|
|
249
217
|
function createApp(root, autoUpdate = true) {
|
|
250
|
-
|
|
218
|
+
return core.viewfly({
|
|
251
219
|
root,
|
|
252
220
|
autoUpdate,
|
|
221
|
+
nativeRenderer: new DomRenderer()
|
|
253
222
|
});
|
|
254
|
-
app.provide({
|
|
255
|
-
provide: core.NativeRenderer,
|
|
256
|
-
useClass: exports.DomRenderer
|
|
257
|
-
});
|
|
258
|
-
return app;
|
|
259
223
|
}
|
|
260
224
|
|
|
261
225
|
const forkErrorFn = core.makeError('fork');
|
|
@@ -267,20 +231,18 @@ function fork(root, autoUpdate = true) {
|
|
|
267
231
|
catch (_a) {
|
|
268
232
|
throw forkErrorFn('The fork function can only be called synchronously within a component.');
|
|
269
233
|
}
|
|
270
|
-
const app =
|
|
234
|
+
const app = core.viewfly({
|
|
271
235
|
root,
|
|
272
236
|
context: injector,
|
|
273
|
-
autoUpdate
|
|
237
|
+
autoUpdate,
|
|
238
|
+
nativeRenderer: new DomRenderer()
|
|
274
239
|
});
|
|
275
|
-
app.provide([{
|
|
276
|
-
provide: core.NativeRenderer,
|
|
277
|
-
useClass: exports.DomRenderer
|
|
278
|
-
}]);
|
|
279
240
|
core.onDestroy(() => {
|
|
280
241
|
app.destroy();
|
|
281
242
|
});
|
|
282
243
|
return app;
|
|
283
244
|
}
|
|
284
245
|
|
|
246
|
+
exports.DomRenderer = DomRenderer;
|
|
285
247
|
exports.createApp = createApp;
|
|
286
248
|
exports.fork = fork;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viewfly/platform-browser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.27",
|
|
4
4
|
"description": "This project is used to enable the Viewfly framework to run in a browser.",
|
|
5
5
|
"main": "./bundles/index.js",
|
|
6
6
|
"module": "./bundles/index.esm.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"keywords": [],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@viewfly/core": "^0.0.
|
|
15
|
+
"@viewfly/core": "^0.0.27",
|
|
16
16
|
"csstype": "^3.1.2"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"bugs": {
|
|
34
34
|
"url": "https://github.com/viewfly/viewfly.git/issues"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "b66ca589f7662cd518fc2e5955b3e3ff9de83f94"
|
|
37
37
|
}
|