@motifx/core 1.0.1

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.
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+
3
+ exports.JSX = void 0;
4
+ (function (JSX) {
5
+ })(exports.JSX || (exports.JSX = {}));
6
+ //# sourceMappingURL=jsx-runtime.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-runtime.cjs","sources":["../src/jsx-runtime.ts"],"sourcesContent":null,"names":["JSX"],"mappings":";;AAyIiBA;AAAjB,CAAA,UAAiB,GAAG,EAAA;AAapB,CAAC,EAbgBA,WAAG,KAAHA,WAAG,GAAA,EAAA,CAAA,CAAA;;"}
@@ -0,0 +1,136 @@
1
+ import { ComponentBase, ElementType, EventArgs } from './index.cjs';
2
+
3
+ type MotifStyle = string | (() => any) | Array<any> | Object | Partial<CSSStyleDeclaration> | CSSStyleDeclaration;
4
+ type MotifClass = string | Record<string, any> | Array<any> | (() => any);
5
+ type MotifValue = string | number | boolean | Record<string, any> | Array<any> | (() => any);
6
+ type MotifBindable<T> = T | string | (() => T | string);
7
+ interface MotifBaseProps {
8
+ children?: any;
9
+ key?: string | number;
10
+ ref?: ComponentBase | ((component: any) => void);
11
+ style?: MotifStyle;
12
+ class?: MotifClass;
13
+ className?: MotifClass;
14
+ }
15
+ type MethodLikeProps = {
16
+ focus?: any;
17
+ blur?: any;
18
+ click?: any;
19
+ select?: any;
20
+ scrollIntoView?: any;
21
+ scrollTo?: any;
22
+ scrollBy?: any;
23
+ requestFullscreen?: any;
24
+ exitFullscreen?: any;
25
+ play?: any;
26
+ pause?: any;
27
+ submit?: any;
28
+ reset?: any;
29
+ requestSubmit?: any;
30
+ checkValidity?: any;
31
+ reportValidity?: any;
32
+ show?: any;
33
+ showModal?: any;
34
+ close?: any;
35
+ showPicker?: any;
36
+ setSelectionRange?: any;
37
+ setRangeText?: any;
38
+ requestPointerLock?: any;
39
+ exitPointerLock?: any;
40
+ setPointerCapture?: any;
41
+ releasePointerCapture?: any;
42
+ requestPictureInPicture?: any;
43
+ exitPictureInPicture?: any;
44
+ load?: any;
45
+ fastSeek?: any;
46
+ showPopover?: any;
47
+ hidePopover?: any;
48
+ togglePopover?: any;
49
+ "onconfig"?: (sender: ComponentBase, e: EventArgs) => void;
50
+ "onbuilding"?: (sender: ComponentBase, e: EventArgs) => void;
51
+ "onbuilt"?: (sender: ComponentBase, e: EventArgs) => void;
52
+ /** Element canlı DOM'a (document) bağlandığında bir kez; focus/ölçüm gibi işler için. */
53
+ "onmounted"?: (sender: ComponentBase, e: EventArgs) => void;
54
+ "onconfigured"?: (sender: ComponentBase, e: EventArgs) => void;
55
+ "oninitializing"?: (sender: ComponentBase, e: EventArgs) => void;
56
+ "oninitialized"?: (sender: ComponentBase, e: EventArgs) => void;
57
+ };
58
+ type MethodLikeKeys = keyof MethodLikeProps;
59
+ type MotifFunctionalComponent<P = Record<string, unknown>> = (props: P & MotifBaseProps & any) => unknown;
60
+ type MotifFunctionalComponentBasic = (props: MotifBaseProps) => unknown;
61
+ type AnyFunctionalComponent<P = any> = (props: P) => unknown;
62
+ type MotifComponentConstructor<TElement extends ElementType = any, P extends Record<string, unknown> = Record<string, unknown>> = new (...args: any[]) => ComponentBase<TElement, P>;
63
+ type MotifComponentType<P = Record<string, unknown>, TElement = unknown> = string | MotifFunctionalComponent<P> | MotifFunctionalComponentBasic | AnyFunctionalComponent<P> | MotifComponentConstructor<TElement extends ElementType ? TElement : any, P extends Record<string, unknown> ? P : any> | {
64
+ el: string;
65
+ ctor?: (this: any, props?: any) => any;
66
+ [newProp: string]: any;
67
+ };
68
+ type motifEventsFor<TElement> = {
69
+ [P in keyof TElement as P extends `on${string}` ? P : never]?: TElement[P] extends ((this: any, ev: infer EV) => any) | null ? ((sender: ComponentBase, ev: EV) => any) | ((ev: EV) => any) : ((sender: ComponentBase, ev: any) => any) | ((ev: any) => any);
70
+ };
71
+ type MotifElementProps<TElement> = {
72
+ [P in keyof Omit<Partial<TElement>, keyof motifEventsFor<TElement> | 'style' | 'class' | 'className' | 'value' | 'for' | MethodLikeKeys>]?: MotifBindable<Partial<TElement>[P]>;
73
+ };
74
+ type IntrinsicHTML = {
75
+ [K in keyof HTMLElementTagNameMap]: MotifElementProps<HTMLElementTagNameMap[K]> & motifEventsFor<HTMLElementTagNameMap[K]> & Partial<MotifBaseProps> & MethodLikeProps & (K extends 'input' | 'textarea' ? {
76
+ value?: MotifValue;
77
+ } : {}) & object & {
78
+ [key: string]: any;
79
+ };
80
+ };
81
+ type IntrinsicSVG = IntrinsicHTML;
82
+ type IntrinsicElementsMap = IntrinsicHTML & IntrinsicSVG;
83
+ type __attr = {
84
+ key?: string | number;
85
+ ref?: ComponentBase | ((component: any) => void);
86
+ initializeComponent?: (sender: ComponentBase) => void;
87
+ "x-wait"?: (sender: ComponentBase, e: EventArgs) => boolean;
88
+ "x-building"?: (sender: ComponentBase, e: EventArgs) => void;
89
+ "x-built"?: (sender: ComponentBase, e: EventArgs) => void;
90
+ "x-config"?: (sender: ComponentBase, e: EventArgs) => void;
91
+ "x-configured"?: (sender: ComponentBase, e: EventArgs) => void;
92
+ "x-initializing"?: (sender: ComponentBase, e: EventArgs) => void;
93
+ "x-initialized"?: (sender: ComponentBase, e: EventArgs) => void;
94
+ "onbuilding"?: (sender: ComponentBase, e: EventArgs) => void;
95
+ "onbuilt"?: (sender: ComponentBase, e: EventArgs) => void;
96
+ /** Element canlı DOM'a (document) bağlandığında bir kez;*/
97
+ "onmounted"?: (sender: ComponentBase, e: EventArgs) => void;
98
+ "onconfig"?: (sender: ComponentBase, e: EventArgs) => void;
99
+ "onconfigured"?: (sender: ComponentBase, e: EventArgs) => void;
100
+ "oninitializing"?: (sender: ComponentBase, e: EventArgs) => void;
101
+ "oninitialized"?: (sender: ComponentBase, e: EventArgs) => void;
102
+ "x-style"?: MotifStyle;
103
+ };
104
+ declare namespace JSX {
105
+ type Element = ComponentBase<any, any>;
106
+ type ElementType = MotifComponentType<any, any>;
107
+ interface ElementClass extends ComponentBase {
108
+ }
109
+ interface ElementAttributesProperty extends __attr {
110
+ props: {};
111
+ }
112
+ interface IntrinsicElements extends IntrinsicElementsMap {
113
+ [elementName: string]: IntrinsicElementsMap[keyof IntrinsicElementsMap];
114
+ }
115
+ interface IntrinsicAttributes extends __attr {
116
+ }
117
+ }
118
+ declare global {
119
+ namespace JSX {
120
+ type Element = ComponentBase<any, any>;
121
+ type ElementType = MotifComponentType<any, any>;
122
+ interface ElementClass extends ComponentBase {
123
+ }
124
+ interface ElementAttributesProperty extends __attr {
125
+ props: {};
126
+ }
127
+ interface IntrinsicElements extends IntrinsicElementsMap {
128
+ [elementName: string]: IntrinsicElementsMap[keyof IntrinsicElementsMap];
129
+ }
130
+ interface IntrinsicAttributes extends __attr {
131
+ }
132
+ }
133
+ }
134
+
135
+ export { JSX };
136
+ export type { AnyFunctionalComponent, MotifBaseProps, MotifBindable, MotifClass, MotifComponentConstructor, MotifComponentType, MotifFunctionalComponent, MotifFunctionalComponentBasic, MotifStyle, MotifValue, __attr };
@@ -0,0 +1,136 @@
1
+ import { ComponentBase, ElementType, EventArgs } from './index.js';
2
+
3
+ type MotifStyle = string | (() => any) | Array<any> | Object | Partial<CSSStyleDeclaration> | CSSStyleDeclaration;
4
+ type MotifClass = string | Record<string, any> | Array<any> | (() => any);
5
+ type MotifValue = string | number | boolean | Record<string, any> | Array<any> | (() => any);
6
+ type MotifBindable<T> = T | string | (() => T | string);
7
+ interface MotifBaseProps {
8
+ children?: any;
9
+ key?: string | number;
10
+ ref?: ComponentBase | ((component: any) => void);
11
+ style?: MotifStyle;
12
+ class?: MotifClass;
13
+ className?: MotifClass;
14
+ }
15
+ type MethodLikeProps = {
16
+ focus?: any;
17
+ blur?: any;
18
+ click?: any;
19
+ select?: any;
20
+ scrollIntoView?: any;
21
+ scrollTo?: any;
22
+ scrollBy?: any;
23
+ requestFullscreen?: any;
24
+ exitFullscreen?: any;
25
+ play?: any;
26
+ pause?: any;
27
+ submit?: any;
28
+ reset?: any;
29
+ requestSubmit?: any;
30
+ checkValidity?: any;
31
+ reportValidity?: any;
32
+ show?: any;
33
+ showModal?: any;
34
+ close?: any;
35
+ showPicker?: any;
36
+ setSelectionRange?: any;
37
+ setRangeText?: any;
38
+ requestPointerLock?: any;
39
+ exitPointerLock?: any;
40
+ setPointerCapture?: any;
41
+ releasePointerCapture?: any;
42
+ requestPictureInPicture?: any;
43
+ exitPictureInPicture?: any;
44
+ load?: any;
45
+ fastSeek?: any;
46
+ showPopover?: any;
47
+ hidePopover?: any;
48
+ togglePopover?: any;
49
+ "onconfig"?: (sender: ComponentBase, e: EventArgs) => void;
50
+ "onbuilding"?: (sender: ComponentBase, e: EventArgs) => void;
51
+ "onbuilt"?: (sender: ComponentBase, e: EventArgs) => void;
52
+ /** Element canlı DOM'a (document) bağlandığında bir kez; focus/ölçüm gibi işler için. */
53
+ "onmounted"?: (sender: ComponentBase, e: EventArgs) => void;
54
+ "onconfigured"?: (sender: ComponentBase, e: EventArgs) => void;
55
+ "oninitializing"?: (sender: ComponentBase, e: EventArgs) => void;
56
+ "oninitialized"?: (sender: ComponentBase, e: EventArgs) => void;
57
+ };
58
+ type MethodLikeKeys = keyof MethodLikeProps;
59
+ type MotifFunctionalComponent<P = Record<string, unknown>> = (props: P & MotifBaseProps & any) => unknown;
60
+ type MotifFunctionalComponentBasic = (props: MotifBaseProps) => unknown;
61
+ type AnyFunctionalComponent<P = any> = (props: P) => unknown;
62
+ type MotifComponentConstructor<TElement extends ElementType = any, P extends Record<string, unknown> = Record<string, unknown>> = new (...args: any[]) => ComponentBase<TElement, P>;
63
+ type MotifComponentType<P = Record<string, unknown>, TElement = unknown> = string | MotifFunctionalComponent<P> | MotifFunctionalComponentBasic | AnyFunctionalComponent<P> | MotifComponentConstructor<TElement extends ElementType ? TElement : any, P extends Record<string, unknown> ? P : any> | {
64
+ el: string;
65
+ ctor?: (this: any, props?: any) => any;
66
+ [newProp: string]: any;
67
+ };
68
+ type motifEventsFor<TElement> = {
69
+ [P in keyof TElement as P extends `on${string}` ? P : never]?: TElement[P] extends ((this: any, ev: infer EV) => any) | null ? ((sender: ComponentBase, ev: EV) => any) | ((ev: EV) => any) : ((sender: ComponentBase, ev: any) => any) | ((ev: any) => any);
70
+ };
71
+ type MotifElementProps<TElement> = {
72
+ [P in keyof Omit<Partial<TElement>, keyof motifEventsFor<TElement> | 'style' | 'class' | 'className' | 'value' | 'for' | MethodLikeKeys>]?: MotifBindable<Partial<TElement>[P]>;
73
+ };
74
+ type IntrinsicHTML = {
75
+ [K in keyof HTMLElementTagNameMap]: MotifElementProps<HTMLElementTagNameMap[K]> & motifEventsFor<HTMLElementTagNameMap[K]> & Partial<MotifBaseProps> & MethodLikeProps & (K extends 'input' | 'textarea' ? {
76
+ value?: MotifValue;
77
+ } : {}) & object & {
78
+ [key: string]: any;
79
+ };
80
+ };
81
+ type IntrinsicSVG = IntrinsicHTML;
82
+ type IntrinsicElementsMap = IntrinsicHTML & IntrinsicSVG;
83
+ type __attr = {
84
+ key?: string | number;
85
+ ref?: ComponentBase | ((component: any) => void);
86
+ initializeComponent?: (sender: ComponentBase) => void;
87
+ "x-wait"?: (sender: ComponentBase, e: EventArgs) => boolean;
88
+ "x-building"?: (sender: ComponentBase, e: EventArgs) => void;
89
+ "x-built"?: (sender: ComponentBase, e: EventArgs) => void;
90
+ "x-config"?: (sender: ComponentBase, e: EventArgs) => void;
91
+ "x-configured"?: (sender: ComponentBase, e: EventArgs) => void;
92
+ "x-initializing"?: (sender: ComponentBase, e: EventArgs) => void;
93
+ "x-initialized"?: (sender: ComponentBase, e: EventArgs) => void;
94
+ "onbuilding"?: (sender: ComponentBase, e: EventArgs) => void;
95
+ "onbuilt"?: (sender: ComponentBase, e: EventArgs) => void;
96
+ /** Element canlı DOM'a (document) bağlandığında bir kez;*/
97
+ "onmounted"?: (sender: ComponentBase, e: EventArgs) => void;
98
+ "onconfig"?: (sender: ComponentBase, e: EventArgs) => void;
99
+ "onconfigured"?: (sender: ComponentBase, e: EventArgs) => void;
100
+ "oninitializing"?: (sender: ComponentBase, e: EventArgs) => void;
101
+ "oninitialized"?: (sender: ComponentBase, e: EventArgs) => void;
102
+ "x-style"?: MotifStyle;
103
+ };
104
+ declare namespace JSX {
105
+ type Element = ComponentBase<any, any>;
106
+ type ElementType = MotifComponentType<any, any>;
107
+ interface ElementClass extends ComponentBase {
108
+ }
109
+ interface ElementAttributesProperty extends __attr {
110
+ props: {};
111
+ }
112
+ interface IntrinsicElements extends IntrinsicElementsMap {
113
+ [elementName: string]: IntrinsicElementsMap[keyof IntrinsicElementsMap];
114
+ }
115
+ interface IntrinsicAttributes extends __attr {
116
+ }
117
+ }
118
+ declare global {
119
+ namespace JSX {
120
+ type Element = ComponentBase<any, any>;
121
+ type ElementType = MotifComponentType<any, any>;
122
+ interface ElementClass extends ComponentBase {
123
+ }
124
+ interface ElementAttributesProperty extends __attr {
125
+ props: {};
126
+ }
127
+ interface IntrinsicElements extends IntrinsicElementsMap {
128
+ [elementName: string]: IntrinsicElementsMap[keyof IntrinsicElementsMap];
129
+ }
130
+ interface IntrinsicAttributes extends __attr {
131
+ }
132
+ }
133
+ }
134
+
135
+ export { JSX };
136
+ export type { AnyFunctionalComponent, MotifBaseProps, MotifBindable, MotifClass, MotifComponentConstructor, MotifComponentType, MotifFunctionalComponent, MotifFunctionalComponentBasic, MotifStyle, MotifValue, __attr };
@@ -0,0 +1,6 @@
1
+ var JSX;
2
+ (function (JSX) {
3
+ })(JSX || (JSX = {}));
4
+
5
+ export { JSX };
6
+ //# sourceMappingURL=jsx-runtime.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-runtime.esm.js","sources":["../src/jsx-runtime.ts"],"sourcesContent":null,"names":[],"mappings":"AAyIM,IAAW;AAAjB,CAAA,UAAiB,GAAG,EAAA;AAapB,CAAC,EAbgB,GAAG,KAAH,GAAG,GAAA,EAAA,CAAA,CAAA;;;;"}
package/package.json ADDED
@@ -0,0 +1,124 @@
1
+ {
2
+ "name": "@motifx/core",
3
+ "version": "1.0.1",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/motifjsdev/motifjs.git",
7
+ "directory": "packages/motifjs"
8
+ },
9
+ "author": "Ekrem Erşahin",
10
+ "private": false,
11
+ "description": "UI framework for JavaScript and TypeScript: components written as classes, functions or options objects, fine-grained reactivity without a virtual DOM, routing and dependency injection.",
12
+ "keywords": [
13
+ "motifx",
14
+ "motifjs",
15
+ "ui",
16
+ "framework",
17
+ "reactive",
18
+ "components",
19
+ "router",
20
+ "typescript",
21
+ "jsx",
22
+ "spa"
23
+ ],
24
+ "homepage": "https://motifjs.com/",
25
+ "bugs": {
26
+ "url": "https://github.com/motifjsdev/motifjs/issues"
27
+ },
28
+ "sideEffects": false,
29
+ "type": "module",
30
+ "main": "./dist/index.cjs",
31
+ "module": "./dist/index.esm.js",
32
+ "unpkg": "./dist/index.umd.min.js",
33
+ "jsdelivr": "./dist/index.umd.min.js",
34
+ "exports": {
35
+ ".": {
36
+ "import": {
37
+ "types": "./dist/index.d.ts",
38
+ "default": "./dist/index.esm.js"
39
+ },
40
+ "require": {
41
+ "types": "./dist/index.d.cts",
42
+ "default": "./dist/index.cjs"
43
+ }
44
+ },
45
+ "./devtools": {
46
+ "import": {
47
+ "types": "./dist/devtools.d.ts",
48
+ "default": "./dist/devtools.esm.js"
49
+ },
50
+ "require": {
51
+ "types": "./dist/devtools.d.cts",
52
+ "default": "./dist/devtools.cjs"
53
+ }
54
+ },
55
+ "./jsx-runtime": {
56
+ "import": {
57
+ "types": "./dist/jsx-runtime.d.ts",
58
+ "default": "./dist/jsx-runtime.esm.js"
59
+ },
60
+ "require": {
61
+ "types": "./dist/jsx-runtime.d.cts",
62
+ "default": "./dist/jsx-runtime.cjs"
63
+ }
64
+ },
65
+ "./jsx-dev-runtime": {
66
+ "import": {
67
+ "types": "./dist/jsx-runtime.d.ts",
68
+ "default": "./dist/jsx-runtime.esm.js"
69
+ },
70
+ "require": {
71
+ "types": "./dist/jsx-runtime.d.cts",
72
+ "default": "./dist/jsx-runtime.cjs"
73
+ }
74
+ },
75
+ "./package.json": "./package.json"
76
+ },
77
+ "files": [
78
+ "dist",
79
+ "!dist/**/*.tsbuildinfo",
80
+ "!dist/internal.*"
81
+ ],
82
+ "scripts": {
83
+ "build": "rollup -c",
84
+ "analyze": "cross-env ANALYZE=1 rollup -c",
85
+ "buildw": "",
86
+ "publishall": "",
87
+ "dev": "rollup -c",
88
+ "prepare": "npm run build",
89
+ "docs": "",
90
+ "check:types": "tsc -p tsconfig.types.json",
91
+ "check:pkg": "node ../../scripts/check-package.mjs",
92
+ "prepublishOnly": "npm run build:clean && npm --prefix ../tests test && npm run check:types && npm run check:pkg",
93
+ "build:clean": "rimraf dist && rollup -c"
94
+ },
95
+ "license": "MIT",
96
+ "devDependencies": {
97
+ "@rollup/plugin-commonjs": "^25.0.0",
98
+ "@rollup/plugin-terser": "^0.4.4",
99
+ "rimraf": "^5.0.0",
100
+ "rollup": "^4.20.0",
101
+ "rollup-plugin-dts": "^6.1.0",
102
+ "rollup-plugin-typescript2": "^0.36.0",
103
+ "typescript": "^5.5.0",
104
+ "rollup-plugin-visualizer": "^5.12.0"
105
+ },
106
+ "types": "./dist/index.d.ts",
107
+ "dependencies": {},
108
+ "typesVersions": {
109
+ "*": {
110
+ "devtools": [
111
+ "./dist/devtools.d.ts"
112
+ ],
113
+ "jsx-runtime": [
114
+ "./dist/jsx-runtime.d.ts"
115
+ ],
116
+ "jsx-dev-runtime": [
117
+ "./dist/jsx-runtime.d.ts"
118
+ ]
119
+ }
120
+ },
121
+ "publishConfig": {
122
+ "access": "public"
123
+ }
124
+ }