@viewfly/core 0.0.7 → 0.0.8

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.
@@ -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' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
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;
@@ -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
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "main": "./index.js",
3
3
  "module": "./index.esm.js",
4
- "types": "./index.d.ts"
4
+ "types": "./jsx.d.ts"
5
5
  }
@@ -1,5 +1,5 @@
1
- import type { jsx, jsxs, Fragment, ViewTypes } from '@viewfly/core'
2
- import type { NativeElements } from '@viewfly/platform-browser'
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
- export { jsx, jsxs, Fragment }
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.7",
3
+ "version": "0.0.8",
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": "^23.0.2",
21
- "@rollup/plugin-typescript": "^9.0.2",
21
+ "@rollup/plugin-commonjs": "^25.0.3",
22
+ "@rollup/plugin-typescript": "^11.1.2",
22
23
  "rimraf": "^3.0.2",
23
- "rollup": "^3.2.5",
24
- "tslib": "^2.4.1"
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": "78757f2aad67c1a6969b2ca76ada75c58364bc43"
38
+ "gitHead": "cd3ad7ebfa4206f968844d0e3be6462b182b95b3"
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
+ }
@@ -1,7 +0,0 @@
1
- import { jsx, jsxs, Fragment } from '@viewfly/core'
2
-
3
- export {
4
- jsxs,
5
- jsx,
6
- Fragment
7
- }
@@ -1,17 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === 'object' && typeof module.exports === 'object') {
3
- var v = factory(require, exports)
4
- if (v !== undefined) module.exports = v
5
- }
6
- else if (typeof define === 'function' && define.amd) {
7
- define(['require', 'exports', '@viewfly/core'], factory)
8
- }
9
- })(function (require, exports) {
10
- 'use strict'
11
- Object.defineProperty(exports, '__esModule', { value: true })
12
- exports.Fragment = exports.jsx = exports.jsxs = void 0
13
- const core_1 = require('@viewfly/core')
14
- Object.defineProperty(exports, 'jsx', { enumerable: true, get: function () { return core_1.jsx } })
15
- Object.defineProperty(exports, 'jsxs', { enumerable: true, get: function () { return core_1.jsxs } })
16
- Object.defineProperty(exports, 'Fragment', { enumerable: true, get: function () { return core_1.Fragment } })
17
- })