@viewfly/core 0.0.7 → 0.0.9
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/index.esm.js +7 -2
- package/bundles/index.js +8 -3
- package/bundles/model/component.d.ts +3 -0
- package/jsx-runtime/index.esm.js +10 -6
- package/jsx-runtime/index.js +24 -17
- package/jsx-runtime/jsx.d.ts +21 -0
- package/jsx-runtime/package.json +1 -1
- package/{jsx-runtime/index.d.ts → jsx.ts} +6 -3
- package/package.json +8 -7
- package/rollup-jsx.config.ts +25 -0
- package/tsconfig-jsx.json +31 -0
package/bundles/index.esm.js
CHANGED
|
@@ -29,7 +29,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
29
29
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
30
30
|
PERFORMANCE OF THIS SOFTWARE.
|
|
31
31
|
***************************************************************************** */
|
|
32
|
-
/* global Reflect, Promise */
|
|
32
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
function __decorate(decorators, target, key, desc) {
|
|
@@ -41,7 +41,12 @@ function __decorate(decorators, target, key, desc) {
|
|
|
41
41
|
|
|
42
42
|
function __metadata(metadataKey, metadataValue) {
|
|
43
43
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
44
|
-
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
47
|
+
var e = new Error(message);
|
|
48
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
49
|
+
};
|
|
45
50
|
|
|
46
51
|
const refKey = 'ref';
|
|
47
52
|
function getObjectChanges(newProps, oldProps) {
|
package/bundles/index.js
CHANGED
|
@@ -30,7 +30,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
30
30
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
31
31
|
PERFORMANCE OF THIS SOFTWARE.
|
|
32
32
|
***************************************************************************** */
|
|
33
|
-
/* global Reflect, Promise */
|
|
33
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
function __decorate(decorators, target, key, desc) {
|
|
@@ -42,7 +42,12 @@ function __decorate(decorators, target, key, desc) {
|
|
|
42
42
|
|
|
43
43
|
function __metadata(metadataKey, metadataValue) {
|
|
44
44
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
45
|
-
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
48
|
+
var e = new Error(message);
|
|
49
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
50
|
+
};
|
|
46
51
|
|
|
47
52
|
const refKey = 'ref';
|
|
48
53
|
function getObjectChanges(newProps, oldProps) {
|
|
@@ -1345,7 +1350,7 @@ exports.useRef = useRef;
|
|
|
1345
1350
|
exports.useSignal = useSignal;
|
|
1346
1351
|
exports.withMemo = withMemo;
|
|
1347
1352
|
Object.keys(di).forEach(function (k) {
|
|
1348
|
-
if (k !== 'default' && !
|
|
1353
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
1349
1354
|
enumerable: true,
|
|
1350
1355
|
get: function () { return di[k]; }
|
|
1351
1356
|
});
|
|
@@ -116,6 +116,9 @@ export interface RefListener<T> {
|
|
|
116
116
|
(current: T): void | (() => void);
|
|
117
117
|
}
|
|
118
118
|
export type ExtractInstanceType<T, U = T extends (...args: any) => any ? ReturnType<T> : T> = U extends Renderable ? Omit<U, keyof ComponentInstance<any>> : U extends Function ? never : T;
|
|
119
|
+
export interface AbstractInstanceType<T extends Record<string, any>> {
|
|
120
|
+
(): T & Renderable;
|
|
121
|
+
}
|
|
119
122
|
export declare class Ref<T, U> {
|
|
120
123
|
private callback;
|
|
121
124
|
private unBindMap;
|
package/jsx-runtime/index.esm.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from '@viewfly/core';
|
|
2
|
+
export { Fragment, jsx, jsxs } from '@viewfly/core';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
/**
|
|
5
|
+
* JSX namespace for usage with @jsxImportsSource directive
|
|
6
|
+
* when ts compilerOptions.jsx is 'react-jsx'
|
|
7
|
+
* https://www.typescriptlang.org/tsconfig#jsxImportSource
|
|
8
|
+
*/
|
|
9
|
+
const jsxDEV = jsx;
|
|
10
|
+
|
|
11
|
+
export { jsxDEV };
|
package/jsx-runtime/index.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@viewfly/core');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* JSX namespace for usage with @jsxImportsSource directive
|
|
7
|
+
* when ts compilerOptions.jsx is 'react-jsx'
|
|
8
|
+
* https://www.typescriptlang.org/tsconfig#jsxImportSource
|
|
9
|
+
*/
|
|
10
|
+
const jsxDEV = core.jsx;
|
|
11
|
+
|
|
12
|
+
Object.defineProperty(exports, 'Fragment', {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return core.Fragment; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, 'jsx', {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return core.jsx; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, 'jsxs', {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return core.jsxs; }
|
|
23
|
+
});
|
|
24
|
+
exports.jsxDEV = jsxDEV;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment, ViewTypes } from '@viewfly/core';
|
|
2
|
+
import { NativeElements } from '@viewfly/platform-browser';
|
|
3
|
+
/**
|
|
4
|
+
* JSX namespace for usage with @jsxImportsSource directive
|
|
5
|
+
* when ts compilerOptions.jsx is 'react-jsx'
|
|
6
|
+
* https://www.typescriptlang.org/tsconfig#jsxImportSource
|
|
7
|
+
*/
|
|
8
|
+
declare const jsxDEV: any;
|
|
9
|
+
export { jsx, jsxs, Fragment, jsxDEV };
|
|
10
|
+
export declare namespace JSX {
|
|
11
|
+
interface ElementClass extends ViewTypes.ElementClass {
|
|
12
|
+
}
|
|
13
|
+
interface IntrinsicElements extends NativeElements, ViewTypes.IntrinsicElements {
|
|
14
|
+
}
|
|
15
|
+
interface IntrinsicAttributes extends ViewTypes.IntrinsicAttributes {
|
|
16
|
+
}
|
|
17
|
+
interface ElementChildrenAttribute extends ViewTypes.ElementChildrenAttribute {
|
|
18
|
+
}
|
|
19
|
+
interface IntrinsicClassAttributes<T> extends ViewTypes.IntrinsicClassAttributes<T> {
|
|
20
|
+
}
|
|
21
|
+
}
|
package/jsx-runtime/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { jsx, jsxs, Fragment, ViewTypes } from '@viewfly/core'
|
|
2
|
+
import { NativeElements } from '@viewfly/platform-browser'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* JSX namespace for usage with @jsxImportsSource directive
|
|
@@ -7,7 +7,10 @@ import type { NativeElements } from '@viewfly/platform-browser'
|
|
|
7
7
|
* https://www.typescriptlang.org/tsconfig#jsxImportSource
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const jsxDEV = jsx
|
|
11
|
+
|
|
12
|
+
export { jsx, jsxs, Fragment, jsxDEV }
|
|
13
|
+
|
|
11
14
|
|
|
12
15
|
export namespace JSX {
|
|
13
16
|
export interface ElementClass extends ViewTypes.ElementClass {
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viewfly/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Viewfly is a simple and easy-to-use JavaScript framework with an intuitive development experience.",
|
|
5
5
|
"main": "./bundles/index.js",
|
|
6
6
|
"module": "./bundles/index.esm.js",
|
|
7
7
|
"typings": "./bundles/public-api.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build:lib": "rimraf bundles && rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
|
|
9
|
+
"build:lib": "rimraf bundles && npm run build:jsx && rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
|
|
10
|
+
"build:jsx": "rimraf jsx-runtime/index.* && rollup --config rollup-jsx.config.ts --configPlugin @rollup/plugin-typescript",
|
|
10
11
|
"publish:lib": "npm run build:lib && npm publish --access=public"
|
|
11
12
|
},
|
|
12
13
|
"license": "MIT",
|
|
@@ -17,11 +18,11 @@
|
|
|
17
18
|
"reflect-metadata": "^0.1.13"
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
|
-
"@rollup/plugin-commonjs": "^
|
|
21
|
-
"@rollup/plugin-typescript": "^
|
|
21
|
+
"@rollup/plugin-commonjs": "^25.0.3",
|
|
22
|
+
"@rollup/plugin-typescript": "^11.1.2",
|
|
22
23
|
"rimraf": "^3.0.2",
|
|
23
|
-
"rollup": "^3.
|
|
24
|
-
"tslib": "^2.
|
|
24
|
+
"rollup": "^3.26.3",
|
|
25
|
+
"tslib": "^2.6.0"
|
|
25
26
|
},
|
|
26
27
|
"author": {
|
|
27
28
|
"name": "Tanbo",
|
|
@@ -34,5 +35,5 @@
|
|
|
34
35
|
"bugs": {
|
|
35
36
|
"url": "https://github.com/viewfly/viewfly.git/issues"
|
|
36
37
|
},
|
|
37
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "c2681190a94529ccc82a6e529b51d69c89571844"
|
|
38
39
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import commonjs from '@rollup/plugin-commonjs'
|
|
2
|
+
import typescript from '@rollup/plugin-typescript'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
input: 'jsx.ts',
|
|
6
|
+
output: [
|
|
7
|
+
{
|
|
8
|
+
file: './jsx-runtime/index.js',
|
|
9
|
+
format: 'cjs'
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
file: './jsx-runtime/index.esm.js',
|
|
13
|
+
format: 'esm'
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
plugins: [
|
|
17
|
+
commonjs(),
|
|
18
|
+
typescript({
|
|
19
|
+
tsconfig: './tsconfig-jsx.json',
|
|
20
|
+
compilerOptions: {
|
|
21
|
+
paths: {}
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"declaration": true,
|
|
4
|
+
"declarationDir": "./jsx-runtime",
|
|
5
|
+
"useDefineForClassFields": false,
|
|
6
|
+
"emitDecoratorMetadata": true,
|
|
7
|
+
"experimentalDecorators": true,
|
|
8
|
+
"allowSyntheticDefaultImports": true,
|
|
9
|
+
"lib": [
|
|
10
|
+
"esnext",
|
|
11
|
+
"dom"
|
|
12
|
+
],
|
|
13
|
+
"target": "es6",
|
|
14
|
+
"strict": true,
|
|
15
|
+
"module": "es2020",
|
|
16
|
+
"moduleResolution": "node",
|
|
17
|
+
"inlineSourceMap": true,
|
|
18
|
+
"inlineSources": true,
|
|
19
|
+
"noImplicitAny": false,
|
|
20
|
+
"outDir": "jsx-runtime/",
|
|
21
|
+
"downlevelIteration": true,
|
|
22
|
+
"paths": {
|
|
23
|
+
"@viewfly/core": [
|
|
24
|
+
"./src/public-api.ts"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"include": [
|
|
29
|
+
"jsx.ts"
|
|
30
|
+
]
|
|
31
|
+
}
|