jmx-runtime 0.0.26 → 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/base.ts +25 -25
- package/dist/base.d.ts +5 -5
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +21 -21
- package/dist/base.js.map +1 -1
- package/dist/config.d.ts +8 -8
- package/dist/config.js +4 -4
- package/dist/h.d.ts +57 -57
- package/dist/h.js +6 -6
- package/dist/h.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/jmx.d.ts +8 -8
- package/dist/jmx.js +134 -134
- package/dist/jmx.js.map +1 -1
- package/dist/jsx.d.ts +647 -647
- package/dist/jsx.js +1 -1
- package/dist/jsx.js.map +1 -1
- package/dist/lib.d.ts +20 -19
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +16 -15
- package/dist/lib.js.map +1 -1
- package/h.ts +88 -88
- package/index.ts +5 -5
- package/jmx.ts +183 -183
- package/jsx.ts +748 -748
- package/lib.ts +28 -28
- package/package.json +14 -14
- package/rollup.config.js +30 -30
- package/tsconfig.json +37 -37
package/lib.ts
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { Props, IClassComponent, H, FComponentT, Children } from 'h'
|
|
2
|
-
import { updateview } from './jmx'
|
|
3
|
-
|
|
4
|
-
export type DeepReadonly<T> = { readonly [K in keyof T]: T[K] extends Record<string, unknown> ? DeepReadonly<T[K]> : T[K]; }
|
|
5
|
-
|
|
6
|
-
export const When = ({ cond }: { cond: boolean }, cn: Children) => cond ? { cn } : void 0;
|
|
7
|
-
|
|
8
|
-
export abstract class JMXComp<P extends Props = {}> implements IClassComponent {
|
|
9
|
-
|
|
10
|
-
// assigned by jmx framework
|
|
11
|
-
element!: HTMLElement
|
|
12
|
-
|
|
13
|
-
// we provide this ctor for jsx which uses ctor arguments as properties of class components.
|
|
14
|
-
// at runtime, we pass the props directly
|
|
15
|
-
constructor(public props: P) { }
|
|
16
|
-
|
|
17
|
-
// overrides
|
|
18
|
-
mounted() { }
|
|
19
|
-
update(uc?: IUpdateContext): boolean | void { }
|
|
20
|
-
abstract view(): H
|
|
21
|
-
|
|
22
|
-
// utility: updates the component's view
|
|
23
|
-
updateview() { updateview(this.element) }
|
|
24
|
-
get ismounted():boolean { return this.element as any }
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function cc(...namesOrObjects: (string | any)[]): string {
|
|
28
|
-
return namesOrObjects.flatMap(n => (n.trim ? n : Object.keys(n).filter(k => n[k]))).join(' ') // n.trim distinguishes strings from objects
|
|
1
|
+
import { Props, IClassComponent, H, FComponentT, Children } from 'h'
|
|
2
|
+
import { updateview } from './jmx'
|
|
3
|
+
|
|
4
|
+
export type DeepReadonly<T> = { readonly [K in keyof T]: T[K] extends Record<string, unknown> ? DeepReadonly<T[K]> : T[K]; }
|
|
5
|
+
|
|
6
|
+
export const When = ({ cond }: { cond: boolean }, cn: Children) => cond ? { cn } : void 0;
|
|
7
|
+
|
|
8
|
+
export abstract class JMXComp<P extends Props = {}> implements IClassComponent {
|
|
9
|
+
|
|
10
|
+
// assigned by jmx framework
|
|
11
|
+
element!: HTMLElement
|
|
12
|
+
|
|
13
|
+
// we provide this ctor for jsx which uses ctor arguments as properties of class components.
|
|
14
|
+
// at runtime, we pass the props directly
|
|
15
|
+
constructor(public props: P) { }
|
|
16
|
+
|
|
17
|
+
// overrides
|
|
18
|
+
mounted() { }
|
|
19
|
+
update(uc?: IUpdateContext): boolean | void { }
|
|
20
|
+
abstract view(): H
|
|
21
|
+
|
|
22
|
+
// utility: updates the component's view
|
|
23
|
+
updateview() { updateview(this.element) }
|
|
24
|
+
get ismounted():boolean { return this.element as any }
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function cc(...namesOrObjects: (string | any)[]): string {
|
|
28
|
+
return namesOrObjects.flatMap(n => (n.trim ? n : Object.keys(n).filter(k => n[k]))).join(' ') // n.trim distinguishes strings from objects
|
|
29
29
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "jmx-runtime",
|
|
3
|
+
"author": "snupo",
|
|
4
|
+
"version": "0.0.27",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc"
|
|
13
|
+
}
|
|
14
|
+
}
|
package/rollup.config.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import typescript from "@rollup/plugin-typescript"
|
|
2
|
-
import clean from "rollup-plugin-cleanup"
|
|
3
|
-
import copy from 'rollup-plugin-copy'
|
|
4
|
-
//import { createPathTransform } from 'rollup-sourcemap-path-transform'
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
input: 'index.ts',
|
|
8
|
-
output: [
|
|
9
|
-
{
|
|
10
|
-
file: 'dist/index.js',
|
|
11
|
-
format: 'es',
|
|
12
|
-
sourcemap: true,
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
// sourcemapPathTransform: createPathTransform({
|
|
16
|
-
// prefixes: {
|
|
17
|
-
// '*src/components/': '/compi/comps/',
|
|
18
|
-
// '/node_modules/': '/compi/deps/',
|
|
19
|
-
// "../../../../../../../jmxa": "hase"
|
|
20
|
-
// }
|
|
21
|
-
// }),
|
|
22
|
-
plugins: [
|
|
23
|
-
typescript(),
|
|
24
|
-
copy({
|
|
25
|
-
targets: [
|
|
26
|
-
{ src: '*.ts', dest: 'dist' }, // Copy all .ts files to dist/src
|
|
27
|
-
],
|
|
28
|
-
}),
|
|
29
|
-
clean()
|
|
30
|
-
]
|
|
1
|
+
import typescript from "@rollup/plugin-typescript"
|
|
2
|
+
import clean from "rollup-plugin-cleanup"
|
|
3
|
+
import copy from 'rollup-plugin-copy'
|
|
4
|
+
//import { createPathTransform } from 'rollup-sourcemap-path-transform'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
input: 'index.ts',
|
|
8
|
+
output: [
|
|
9
|
+
{
|
|
10
|
+
file: 'dist/index.js',
|
|
11
|
+
format: 'es',
|
|
12
|
+
sourcemap: true,
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
// sourcemapPathTransform: createPathTransform({
|
|
16
|
+
// prefixes: {
|
|
17
|
+
// '*src/components/': '/compi/comps/',
|
|
18
|
+
// '/node_modules/': '/compi/deps/',
|
|
19
|
+
// "../../../../../../../jmxa": "hase"
|
|
20
|
+
// }
|
|
21
|
+
// }),
|
|
22
|
+
plugins: [
|
|
23
|
+
typescript(),
|
|
24
|
+
copy({
|
|
25
|
+
targets: [
|
|
26
|
+
{ src: '*.ts', dest: 'dist' }, // Copy all .ts files to dist/src
|
|
27
|
+
],
|
|
28
|
+
}),
|
|
29
|
+
clean()
|
|
30
|
+
]
|
|
31
31
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
2
|
-
{
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
|
|
5
|
-
"target": "ESNEXT", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
|
|
6
|
-
"module": "ESNext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
|
|
7
|
-
|
|
8
|
-
"jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
|
9
|
-
"jsxFactory": "jsx",
|
|
10
|
-
"jsxFragmentFactory": "jsxf",
|
|
11
|
-
|
|
12
|
-
"declaration": true, /* Generates corresponding '.d.ts' file. */
|
|
13
|
-
// "declarationDir": "dist/types",
|
|
14
|
-
"declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
|
15
|
-
|
|
16
|
-
"sourceMap": true, /* Generates corresponding '.map' file. */
|
|
17
|
-
"inlineSources": true,
|
|
18
|
-
|
|
19
|
-
"outDir": "dist", /* Redirect output structure to the directory. */
|
|
20
|
-
"rootDir": ".", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
21
|
-
|
|
22
|
-
"removeComments": true, /* Do not emit comments to output. */
|
|
23
|
-
|
|
24
|
-
"strict": true, /* Enable all strict type-checking options. */
|
|
25
|
-
"strictNullChecks": true, /* Enable strict null checks. */
|
|
26
|
-
"noImplicitAny": true,
|
|
27
|
-
|
|
28
|
-
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
|
29
|
-
"baseUrl": ".", /* Base directory to resolve non-absolute module names. */
|
|
30
|
-
//"typeRoots": ["types"], /* List of folders to include type definitions from. */
|
|
31
|
-
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
|
32
|
-
"sourceRoot": ".", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
|
33
|
-
"experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
|
34
|
-
"skipLibCheck": true, /* Skip type checking of declaration files. */
|
|
35
|
-
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
|
|
36
|
-
},
|
|
37
|
-
"include": ["./index.ts"]
|
|
1
|
+
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
2
|
+
{
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
|
|
5
|
+
"target": "ESNEXT", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
|
|
6
|
+
"module": "ESNext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
|
|
7
|
+
|
|
8
|
+
"jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
|
9
|
+
"jsxFactory": "jsx",
|
|
10
|
+
"jsxFragmentFactory": "jsxf",
|
|
11
|
+
|
|
12
|
+
"declaration": true, /* Generates corresponding '.d.ts' file. */
|
|
13
|
+
// "declarationDir": "dist/types",
|
|
14
|
+
"declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
|
15
|
+
|
|
16
|
+
"sourceMap": true, /* Generates corresponding '.map' file. */
|
|
17
|
+
"inlineSources": true,
|
|
18
|
+
|
|
19
|
+
"outDir": "dist", /* Redirect output structure to the directory. */
|
|
20
|
+
"rootDir": ".", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
21
|
+
|
|
22
|
+
"removeComments": true, /* Do not emit comments to output. */
|
|
23
|
+
|
|
24
|
+
"strict": true, /* Enable all strict type-checking options. */
|
|
25
|
+
"strictNullChecks": true, /* Enable strict null checks. */
|
|
26
|
+
"noImplicitAny": true,
|
|
27
|
+
|
|
28
|
+
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
|
29
|
+
"baseUrl": ".", /* Base directory to resolve non-absolute module names. */
|
|
30
|
+
//"typeRoots": ["types"], /* List of folders to include type definitions from. */
|
|
31
|
+
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
|
32
|
+
"sourceRoot": ".", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
|
33
|
+
"experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
|
34
|
+
"skipLibCheck": true, /* Skip type checking of declaration files. */
|
|
35
|
+
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
|
|
36
|
+
},
|
|
37
|
+
"include": ["./index.ts"]
|
|
38
38
|
}
|