@motifx/core 1.1.0 → 1.2.0-rc.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.
@@ -1 +1 @@
1
- {"version":3,"file":"jsx-runtime.cjs","sources":["../src/jsx-runtime.ts"],"sourcesContent":["import type { ComponentBase, ElementType, EventArgs } from \"./\";\n\ntype motifPrimitive = string | number | boolean | Node | Text | Element | null | undefined;\n\ndeclare const DEV: boolean;\n\nexport type MotifStyle = string | (() => any) | Array<any> | Object | Partial<CSSStyleDeclaration> | CSSStyleDeclaration;\nexport type MotifClass = string | Record<string, any> | Array<any> | (() => any);\nexport type MotifValue = string | number | boolean | Record<string, any> | Array<any> | (() => any);\nexport type MotifBindable<T> = T | string | (() => T | string);\n\nexport interface MotifBaseProps {\n children?: any;\n key?: string | number;\n ref?: ComponentBase | ((component: any) => void);\n style?: MotifStyle;\n class?: MotifClass;\n className?: MotifClass;\n}\n\ntype MethodLikeProps = {\n focus?: any;\n blur?: any;\n click?: any;\n select?: any;\n scrollIntoView?: any;\n scrollTo?: any;\n scrollBy?: any;\n requestFullscreen?: any;\n exitFullscreen?: any;\n play?: any;\n pause?: any;\n submit?: any;\n reset?: any;\n requestSubmit?: any;\n checkValidity?: any;\n reportValidity?: any;\n show?: any;\n showModal?: any;\n close?: any;\n showPicker?: any;\n setSelectionRange?: any;\n setRangeText?: any;\n requestPointerLock?: any;\n exitPointerLock?: any;\n setPointerCapture?: any;\n releasePointerCapture?: any;\n requestPictureInPicture?: any;\n exitPictureInPicture?: any;\n load?: any;\n fastSeek?: any;\n showPopover?: any;\n hidePopover?: any;\n togglePopover?: any;\n \"onconfig\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onbuilding\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onbuilt\"?: (sender: ComponentBase, e: EventArgs) => void;\n /** Element canlı DOM'a (document) bağlandığında bir kez; focus/ölçüm gibi işler için. */\n \"onmounted\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onconfigured\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"oninitializing\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"oninitialized\"?: (sender: ComponentBase, e: EventArgs) => void;\n};\ntype MethodLikeKeys = keyof MethodLikeProps;\n\nexport type MotifFunctionalComponent<P = Record<string, unknown>> = (\n props: P & MotifBaseProps & any\n) => unknown;\n\nexport type MotifFunctionalComponentBasic = (\n props: MotifBaseProps\n) => unknown;\n\nexport type AnyFunctionalComponent<P = any> = (props: P) => unknown;\nexport type MotifComponentConstructor<TElement extends ElementType = any, P extends Record<string, unknown> = Record<string, unknown>> =\n new (...args: any[]) => ComponentBase<TElement, P>;\n\nexport type MotifComponentType<P = Record<string, unknown>, TElement = unknown> =\n | string\n | MotifFunctionalComponent<P>\n | MotifFunctionalComponentBasic\n | AnyFunctionalComponent<P>\n | MotifComponentConstructor<TElement extends ElementType ? TElement : any, P extends Record<string, unknown> ? P : any>\n | { el: string; ctor?: (this: any, props?: any) => any;[newProp: string]: any };\n\ntype ExtractEventArg<T> = T extends ((this: any, ev: infer EV) => any) | null ? EV : never;\ntype motifEventsFor<TElement> = {\n [P in keyof TElement as P extends `on${string}` ? P : never]?:\n TElement[P] extends ((this: any, ev: infer EV) => any) | null\n ? ((sender: ComponentBase, ev: EV) => any) | ((ev: EV) => any)\n : ((sender: ComponentBase, ev: any) => any) | ((ev: any) => any);\n};\n\n// Transform DOM attributes so that non-event, non-method, non-style/class/value props accept either the value or a function returning it\ntype MotifElementProps<TElement> = {\n [P in keyof Omit<\n Partial<TElement>,\n keyof motifEventsFor<TElement> | 'style' | 'class' | 'className' | 'value' | 'for' | MethodLikeKeys\n >]?: MotifBindable<Partial<TElement>[P]>;\n};\n\ntype IntrinsicHTML = {\n [K in keyof HTMLElementTagNameMap]:\n MotifElementProps<HTMLElementTagNameMap[K]> &\n motifEventsFor<HTMLElementTagNameMap[K]> &\n Partial<MotifBaseProps> &\n MethodLikeProps &\n (K extends 'input' | 'textarea' ? { value?: MotifValue } : {}) & object & { [key: string]: any };\n};\n\ntype IntrinsicSVG = IntrinsicHTML;\n// type IntrinsicSVG = {\n// keyof motifEventsFor<SVGElementTagNameMap[\"svg\"]> | 'style' | 'class' | 'className' | 'value' | MethodLikeKeys\n\ntype IntrinsicElementsMap = IntrinsicHTML & IntrinsicSVG;\n\nexport type __attr = {\n key?: string | number;\n ref?: ComponentBase | ((component: any) => void);\n initializeComponent?: (sender: ComponentBase) => void;\n \"x-wait\"?: (sender: ComponentBase, e: EventArgs) => boolean;\n \"x-building\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-built\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-config\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-configured\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-initializing\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-initialized\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onbuilding\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onbuilt\"?: (sender: ComponentBase, e: EventArgs) => void;\n /** Element canlı DOM'a (document) bağlandığında bir kez;*/\n \"onmounted\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onconfig\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onconfigured\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"oninitializing\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"oninitialized\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-style\"?: MotifStyle;\n}\nexport namespace JSX {\n export type Element = ComponentBase<any, any>;\n export type ElementType = MotifComponentType<any, any>;\n export interface ElementClass extends ComponentBase { }\n export interface ElementAttributesProperty extends __attr {\n props: {};\n };\n\n export interface IntrinsicElements extends IntrinsicElementsMap {\n [elementName: string]: IntrinsicElementsMap[keyof IntrinsicElementsMap];\n }\n\n export interface IntrinsicAttributes extends __attr { };\n}\n\ndeclare global {\n namespace JSX {\n export type Element = ComponentBase<any, any>;\n export type ElementType = MotifComponentType<any, any>;\n export interface ElementClass extends ComponentBase { }\n export interface ElementAttributesProperty extends __attr {\n props: {};\n }\n\n export interface IntrinsicElements extends IntrinsicElementsMap {\n [elementName: string]: IntrinsicElementsMap[keyof IntrinsicElementsMap];\n }\n\n export interface IntrinsicAttributes extends __attr { }\n }\n}\n"],"names":["JSX"],"mappings":";;AAyIiBA;AAAjB,CAAA,UAAiB,GAAG,EAAA;AAapB,CAAC,EAbgBA,WAAG,KAAHA,WAAG,GAAA,EAAA,CAAA,CAAA;;"}
1
+ {"version":3,"file":"jsx-runtime.cjs","sources":["../src/jsx-runtime.ts"],"sourcesContent":["import type { ComponentBase, ElementType, EventArgs, IBaseProp } from \"./\";\n\ntype motifPrimitive = string | number | boolean | Node | Text | Element | null | undefined;\n\ndeclare const DEV: boolean;\n\nexport type MotifStyle = string | (() => any) | Array<any> | Object | Partial<CSSStyleDeclaration> | CSSStyleDeclaration;\nexport type MotifClass = string | Record<string, any> | Array<any> | (() => any);\nexport type MotifValue = string | number | boolean | Record<string, any> | Array<any> | (() => any);\nexport type MotifBindable<T> = T | string | (() => T | string);\n\nexport interface MotifBaseProps {\n children?: any;\n key?: string | number;\n ref?: ComponentBase | ((component: any) => void);\n style?: MotifStyle;\n class?: MotifClass;\n className?: MotifClass;\n}\n\ntype MethodLikeProps = {\n focus?: any;\n blur?: any;\n click?: any;\n select?: any;\n scrollIntoView?: any;\n scrollTo?: any;\n scrollBy?: any;\n requestFullscreen?: any;\n exitFullscreen?: any;\n play?: any;\n pause?: any;\n submit?: any;\n reset?: any;\n requestSubmit?: any;\n checkValidity?: any;\n reportValidity?: any;\n show?: any;\n showModal?: any;\n close?: any;\n showPicker?: any;\n setSelectionRange?: any;\n setRangeText?: any;\n requestPointerLock?: any;\n exitPointerLock?: any;\n setPointerCapture?: any;\n releasePointerCapture?: any;\n requestPictureInPicture?: any;\n exitPictureInPicture?: any;\n load?: any;\n fastSeek?: any;\n showPopover?: any;\n hidePopover?: any;\n togglePopover?: any;\n \"onconfig\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onbuilding\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onbuilt\"?: (sender: ComponentBase, e: EventArgs) => void;\n /** Element canlı DOM'a (document) bağlandığında bir kez; focus/ölçüm gibi işler için. */\n \"onmounted\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onconfigured\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"oninitializing\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"oninitialized\"?: (sender: ComponentBase, e: EventArgs) => void;\n};\ntype MethodLikeKeys = keyof MethodLikeProps;\n\nexport type MotifFunctionalComponent<P = Record<string, unknown>> = (\n props: P & MotifBaseProps & any\n) => unknown;\n\nexport type MotifFunctionalComponentBasic = (\n props: MotifBaseProps\n) => unknown;\n\nexport type AnyFunctionalComponent<P = any> = (props: P) => unknown;\nexport type MotifComponentConstructor<TElement extends ElementType = any, P extends Record<string, unknown> = Record<string, unknown>> =\n new (...args: any[]) => ComponentBase<TElement, P>;\n\nexport type MotifComponentType<P = Record<string, unknown>, TElement = unknown> =\n | string\n | MotifFunctionalComponent<P>\n | MotifFunctionalComponentBasic\n | AnyFunctionalComponent<P>\n | MotifComponentConstructor<TElement extends ElementType ? TElement : any, P extends Record<string, unknown> ? P : any>\n | { el: string; ctor?: (this: any, props?: any) => any;[newProp: string]: any };\n\ntype ExtractEventArg<T> = T extends ((this: any, ev: infer EV) => any) | null ? EV : never;\nexport type MotifDomEventHandler<EV> = (senderOrEvent: EV & ComponentBase, ev: EV) => unknown;\ntype motifEventsFor<TElement> = {\n [P in keyof TElement as P extends `on${string}` ? P : never]?:\n TElement[P] extends ((this: any, ev: infer EV) => any) | null\n ? MotifDomEventHandler<EV>\n : MotifDomEventHandler<Event>;\n};\nexport type MotifDomEventProps = motifEventsFor<HTMLElement>;\ntype MotifTagProps = MotifDomEventProps & {\n class?: MotifClass;\n className?: MotifClass;\n style?: MotifStyle;\n id?: MotifBindable<string>;\n tabindex?: MotifBindable<number | string>;\n role?: MotifBindable<string>;\n};\ntype WithTagProps<T> = T & Omit<MotifTagProps, keyof T>;\ntype MotifManagedProps<P> = 0 extends (1 & P) ? IBaseProp<{}> : WithTagProps<Exclude<P, string | Node | undefined>>;\n\n// Transform DOM attributes so that non-event, non-method, non-style/class/value props accept either the value or a function returning it\ntype MotifElementProps<TElement> = {\n [P in keyof Omit<\n Partial<TElement>,\n keyof motifEventsFor<TElement> | 'style' | 'class' | 'className' | 'value' | 'for' | MethodLikeKeys\n >]?: MotifBindable<Partial<TElement>[P]>;\n};\n\ntype IntrinsicHTML = {\n [K in keyof HTMLElementTagNameMap]:\n MotifElementProps<HTMLElementTagNameMap[K]> &\n motifEventsFor<HTMLElementTagNameMap[K]> &\n Partial<MotifBaseProps> &\n MethodLikeProps &\n (K extends 'input' | 'textarea' ? { value?: MotifValue } : {}) & object & { [key: string]: any };\n};\n\ntype IntrinsicSVG = IntrinsicHTML;\n// type IntrinsicSVG = {\n// keyof motifEventsFor<SVGElementTagNameMap[\"svg\"]> | 'style' | 'class' | 'className' | 'value' | MethodLikeKeys\n\ntype IntrinsicElementsMap = IntrinsicHTML & IntrinsicSVG;\n\nexport type __attr = {\n key?: string | number;\n ref?: ComponentBase | ((component: any) => void);\n initializeComponent?: (sender: ComponentBase) => void;\n \"x-wait\"?: (sender: ComponentBase, e: EventArgs) => boolean;\n \"x-building\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-built\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-config\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-configured\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-initializing\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-initialized\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onbuilding\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onbuilt\"?: (sender: ComponentBase, e: EventArgs) => void;\n /** Element canlı DOM'a (document) bağlandığında bir kez;*/\n \"onmounted\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onconfig\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onconfigured\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"oninitializing\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"oninitialized\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-style\"?: MotifStyle;\n}\nexport namespace JSX {\n export type Element = ComponentBase<any, any>;\n export type ElementType = MotifComponentType<any, any>;\n export interface ElementClass extends ComponentBase { }\n export interface ElementAttributesProperty extends __attr {\n props: {};\n };\n\n export interface IntrinsicElements extends IntrinsicElementsMap {\n [elementName: string]: IntrinsicElementsMap[keyof IntrinsicElementsMap];\n }\n\n export type LibraryManagedAttributes<C, P> = MotifManagedProps<P>;\n\n export interface IntrinsicAttributes extends __attr { };\n}\n\ndeclare global {\n namespace JSX {\n export type Element = ComponentBase<any, any>;\n export type ElementType = MotifComponentType<any, any>;\n export interface ElementClass extends ComponentBase { }\n export interface ElementAttributesProperty extends __attr {\n props: {};\n }\n\n export interface IntrinsicElements extends IntrinsicElementsMap {\n [elementName: string]: IntrinsicElementsMap[keyof IntrinsicElementsMap];\n }\n\n export type LibraryManagedAttributes<C, P> = MotifManagedProps<P>;\n\n export interface IntrinsicAttributes extends __attr { }\n }\n}\n"],"names":["JSX"],"mappings":";;AAqJiBA;AAAjB,CAAA,UAAiB,GAAG,EAAA;AAepB,CAAC,EAfgBA,WAAG,KAAHA,WAAG,GAAA,EAAA,CAAA,CAAA;;"}
@@ -1,4 +1,4 @@
1
- import { ComponentBase, ElementType, EventArgs } from './index.cjs';
1
+ import { ComponentBase, ElementType, EventArgs, IBaseProp } from './index.cjs';
2
2
 
3
3
  type MotifStyle = string | (() => any) | Array<any> | Object | Partial<CSSStyleDeclaration> | CSSStyleDeclaration;
4
4
  type MotifClass = string | Record<string, any> | Array<any> | (() => any);
@@ -65,9 +65,21 @@ type MotifComponentType<P = Record<string, unknown>, TElement = unknown> = strin
65
65
  ctor?: (this: any, props?: any) => any;
66
66
  [newProp: string]: any;
67
67
  };
68
+ type MotifDomEventHandler<EV> = (senderOrEvent: EV & ComponentBase, ev: EV) => unknown;
68
69
  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
+ [P in keyof TElement as P extends `on${string}` ? P : never]?: TElement[P] extends ((this: any, ev: infer EV) => any) | null ? MotifDomEventHandler<EV> : MotifDomEventHandler<Event>;
70
71
  };
72
+ type MotifDomEventProps = motifEventsFor<HTMLElement>;
73
+ type MotifTagProps = MotifDomEventProps & {
74
+ class?: MotifClass;
75
+ className?: MotifClass;
76
+ style?: MotifStyle;
77
+ id?: MotifBindable<string>;
78
+ tabindex?: MotifBindable<number | string>;
79
+ role?: MotifBindable<string>;
80
+ };
81
+ type WithTagProps<T> = T & Omit<MotifTagProps, keyof T>;
82
+ type MotifManagedProps<P> = 0 extends (1 & P) ? IBaseProp<{}> : WithTagProps<Exclude<P, string | Node | undefined>>;
71
83
  type MotifElementProps<TElement> = {
72
84
  [P in keyof Omit<Partial<TElement>, keyof motifEventsFor<TElement> | 'style' | 'class' | 'className' | 'value' | 'for' | MethodLikeKeys>]?: MotifBindable<Partial<TElement>[P]>;
73
85
  };
@@ -112,6 +124,7 @@ declare namespace JSX {
112
124
  interface IntrinsicElements extends IntrinsicElementsMap {
113
125
  [elementName: string]: IntrinsicElementsMap[keyof IntrinsicElementsMap];
114
126
  }
127
+ type LibraryManagedAttributes<C, P> = MotifManagedProps<P>;
115
128
  interface IntrinsicAttributes extends __attr {
116
129
  }
117
130
  }
@@ -127,10 +140,11 @@ declare global {
127
140
  interface IntrinsicElements extends IntrinsicElementsMap {
128
141
  [elementName: string]: IntrinsicElementsMap[keyof IntrinsicElementsMap];
129
142
  }
143
+ type LibraryManagedAttributes<C, P> = MotifManagedProps<P>;
130
144
  interface IntrinsicAttributes extends __attr {
131
145
  }
132
146
  }
133
147
  }
134
148
 
135
149
  export { JSX };
136
- export type { AnyFunctionalComponent, MotifBaseProps, MotifBindable, MotifClass, MotifComponentConstructor, MotifComponentType, MotifFunctionalComponent, MotifFunctionalComponentBasic, MotifStyle, MotifValue, __attr };
150
+ export type { AnyFunctionalComponent, MotifBaseProps, MotifBindable, MotifClass, MotifComponentConstructor, MotifComponentType, MotifDomEventHandler, MotifDomEventProps, MotifFunctionalComponent, MotifFunctionalComponentBasic, MotifStyle, MotifValue, __attr };
@@ -1,4 +1,4 @@
1
- import { ComponentBase, ElementType, EventArgs } from './index.js';
1
+ import { ComponentBase, ElementType, EventArgs, IBaseProp } from './index.js';
2
2
 
3
3
  type MotifStyle = string | (() => any) | Array<any> | Object | Partial<CSSStyleDeclaration> | CSSStyleDeclaration;
4
4
  type MotifClass = string | Record<string, any> | Array<any> | (() => any);
@@ -65,9 +65,21 @@ type MotifComponentType<P = Record<string, unknown>, TElement = unknown> = strin
65
65
  ctor?: (this: any, props?: any) => any;
66
66
  [newProp: string]: any;
67
67
  };
68
+ type MotifDomEventHandler<EV> = (senderOrEvent: EV & ComponentBase, ev: EV) => unknown;
68
69
  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
+ [P in keyof TElement as P extends `on${string}` ? P : never]?: TElement[P] extends ((this: any, ev: infer EV) => any) | null ? MotifDomEventHandler<EV> : MotifDomEventHandler<Event>;
70
71
  };
72
+ type MotifDomEventProps = motifEventsFor<HTMLElement>;
73
+ type MotifTagProps = MotifDomEventProps & {
74
+ class?: MotifClass;
75
+ className?: MotifClass;
76
+ style?: MotifStyle;
77
+ id?: MotifBindable<string>;
78
+ tabindex?: MotifBindable<number | string>;
79
+ role?: MotifBindable<string>;
80
+ };
81
+ type WithTagProps<T> = T & Omit<MotifTagProps, keyof T>;
82
+ type MotifManagedProps<P> = 0 extends (1 & P) ? IBaseProp<{}> : WithTagProps<Exclude<P, string | Node | undefined>>;
71
83
  type MotifElementProps<TElement> = {
72
84
  [P in keyof Omit<Partial<TElement>, keyof motifEventsFor<TElement> | 'style' | 'class' | 'className' | 'value' | 'for' | MethodLikeKeys>]?: MotifBindable<Partial<TElement>[P]>;
73
85
  };
@@ -112,6 +124,7 @@ declare namespace JSX {
112
124
  interface IntrinsicElements extends IntrinsicElementsMap {
113
125
  [elementName: string]: IntrinsicElementsMap[keyof IntrinsicElementsMap];
114
126
  }
127
+ type LibraryManagedAttributes<C, P> = MotifManagedProps<P>;
115
128
  interface IntrinsicAttributes extends __attr {
116
129
  }
117
130
  }
@@ -127,10 +140,11 @@ declare global {
127
140
  interface IntrinsicElements extends IntrinsicElementsMap {
128
141
  [elementName: string]: IntrinsicElementsMap[keyof IntrinsicElementsMap];
129
142
  }
143
+ type LibraryManagedAttributes<C, P> = MotifManagedProps<P>;
130
144
  interface IntrinsicAttributes extends __attr {
131
145
  }
132
146
  }
133
147
  }
134
148
 
135
149
  export { JSX };
136
- export type { AnyFunctionalComponent, MotifBaseProps, MotifBindable, MotifClass, MotifComponentConstructor, MotifComponentType, MotifFunctionalComponent, MotifFunctionalComponentBasic, MotifStyle, MotifValue, __attr };
150
+ export type { AnyFunctionalComponent, MotifBaseProps, MotifBindable, MotifClass, MotifComponentConstructor, MotifComponentType, MotifDomEventHandler, MotifDomEventProps, MotifFunctionalComponent, MotifFunctionalComponentBasic, MotifStyle, MotifValue, __attr };
@@ -1 +1 @@
1
- {"version":3,"file":"jsx-runtime.esm.js","sources":["../src/jsx-runtime.ts"],"sourcesContent":["import type { ComponentBase, ElementType, EventArgs } from \"./\";\n\ntype motifPrimitive = string | number | boolean | Node | Text | Element | null | undefined;\n\ndeclare const DEV: boolean;\n\nexport type MotifStyle = string | (() => any) | Array<any> | Object | Partial<CSSStyleDeclaration> | CSSStyleDeclaration;\nexport type MotifClass = string | Record<string, any> | Array<any> | (() => any);\nexport type MotifValue = string | number | boolean | Record<string, any> | Array<any> | (() => any);\nexport type MotifBindable<T> = T | string | (() => T | string);\n\nexport interface MotifBaseProps {\n children?: any;\n key?: string | number;\n ref?: ComponentBase | ((component: any) => void);\n style?: MotifStyle;\n class?: MotifClass;\n className?: MotifClass;\n}\n\ntype MethodLikeProps = {\n focus?: any;\n blur?: any;\n click?: any;\n select?: any;\n scrollIntoView?: any;\n scrollTo?: any;\n scrollBy?: any;\n requestFullscreen?: any;\n exitFullscreen?: any;\n play?: any;\n pause?: any;\n submit?: any;\n reset?: any;\n requestSubmit?: any;\n checkValidity?: any;\n reportValidity?: any;\n show?: any;\n showModal?: any;\n close?: any;\n showPicker?: any;\n setSelectionRange?: any;\n setRangeText?: any;\n requestPointerLock?: any;\n exitPointerLock?: any;\n setPointerCapture?: any;\n releasePointerCapture?: any;\n requestPictureInPicture?: any;\n exitPictureInPicture?: any;\n load?: any;\n fastSeek?: any;\n showPopover?: any;\n hidePopover?: any;\n togglePopover?: any;\n \"onconfig\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onbuilding\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onbuilt\"?: (sender: ComponentBase, e: EventArgs) => void;\n /** Element canlı DOM'a (document) bağlandığında bir kez; focus/ölçüm gibi işler için. */\n \"onmounted\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onconfigured\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"oninitializing\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"oninitialized\"?: (sender: ComponentBase, e: EventArgs) => void;\n};\ntype MethodLikeKeys = keyof MethodLikeProps;\n\nexport type MotifFunctionalComponent<P = Record<string, unknown>> = (\n props: P & MotifBaseProps & any\n) => unknown;\n\nexport type MotifFunctionalComponentBasic = (\n props: MotifBaseProps\n) => unknown;\n\nexport type AnyFunctionalComponent<P = any> = (props: P) => unknown;\nexport type MotifComponentConstructor<TElement extends ElementType = any, P extends Record<string, unknown> = Record<string, unknown>> =\n new (...args: any[]) => ComponentBase<TElement, P>;\n\nexport type MotifComponentType<P = Record<string, unknown>, TElement = unknown> =\n | string\n | MotifFunctionalComponent<P>\n | MotifFunctionalComponentBasic\n | AnyFunctionalComponent<P>\n | MotifComponentConstructor<TElement extends ElementType ? TElement : any, P extends Record<string, unknown> ? P : any>\n | { el: string; ctor?: (this: any, props?: any) => any;[newProp: string]: any };\n\ntype ExtractEventArg<T> = T extends ((this: any, ev: infer EV) => any) | null ? EV : never;\ntype motifEventsFor<TElement> = {\n [P in keyof TElement as P extends `on${string}` ? P : never]?:\n TElement[P] extends ((this: any, ev: infer EV) => any) | null\n ? ((sender: ComponentBase, ev: EV) => any) | ((ev: EV) => any)\n : ((sender: ComponentBase, ev: any) => any) | ((ev: any) => any);\n};\n\n// Transform DOM attributes so that non-event, non-method, non-style/class/value props accept either the value or a function returning it\ntype MotifElementProps<TElement> = {\n [P in keyof Omit<\n Partial<TElement>,\n keyof motifEventsFor<TElement> | 'style' | 'class' | 'className' | 'value' | 'for' | MethodLikeKeys\n >]?: MotifBindable<Partial<TElement>[P]>;\n};\n\ntype IntrinsicHTML = {\n [K in keyof HTMLElementTagNameMap]:\n MotifElementProps<HTMLElementTagNameMap[K]> &\n motifEventsFor<HTMLElementTagNameMap[K]> &\n Partial<MotifBaseProps> &\n MethodLikeProps &\n (K extends 'input' | 'textarea' ? { value?: MotifValue } : {}) & object & { [key: string]: any };\n};\n\ntype IntrinsicSVG = IntrinsicHTML;\n// type IntrinsicSVG = {\n// keyof motifEventsFor<SVGElementTagNameMap[\"svg\"]> | 'style' | 'class' | 'className' | 'value' | MethodLikeKeys\n\ntype IntrinsicElementsMap = IntrinsicHTML & IntrinsicSVG;\n\nexport type __attr = {\n key?: string | number;\n ref?: ComponentBase | ((component: any) => void);\n initializeComponent?: (sender: ComponentBase) => void;\n \"x-wait\"?: (sender: ComponentBase, e: EventArgs) => boolean;\n \"x-building\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-built\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-config\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-configured\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-initializing\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-initialized\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onbuilding\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onbuilt\"?: (sender: ComponentBase, e: EventArgs) => void;\n /** Element canlı DOM'a (document) bağlandığında bir kez;*/\n \"onmounted\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onconfig\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onconfigured\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"oninitializing\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"oninitialized\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-style\"?: MotifStyle;\n}\nexport namespace JSX {\n export type Element = ComponentBase<any, any>;\n export type ElementType = MotifComponentType<any, any>;\n export interface ElementClass extends ComponentBase { }\n export interface ElementAttributesProperty extends __attr {\n props: {};\n };\n\n export interface IntrinsicElements extends IntrinsicElementsMap {\n [elementName: string]: IntrinsicElementsMap[keyof IntrinsicElementsMap];\n }\n\n export interface IntrinsicAttributes extends __attr { };\n}\n\ndeclare global {\n namespace JSX {\n export type Element = ComponentBase<any, any>;\n export type ElementType = MotifComponentType<any, any>;\n export interface ElementClass extends ComponentBase { }\n export interface ElementAttributesProperty extends __attr {\n props: {};\n }\n\n export interface IntrinsicElements extends IntrinsicElementsMap {\n [elementName: string]: IntrinsicElementsMap[keyof IntrinsicElementsMap];\n }\n\n export interface IntrinsicAttributes extends __attr { }\n }\n}\n"],"names":[],"mappings":"AAyIM,IAAW;AAAjB,CAAA,UAAiB,GAAG,EAAA;AAapB,CAAC,EAbgB,GAAG,KAAH,GAAG,GAAA,EAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"jsx-runtime.esm.js","sources":["../src/jsx-runtime.ts"],"sourcesContent":["import type { ComponentBase, ElementType, EventArgs, IBaseProp } from \"./\";\n\ntype motifPrimitive = string | number | boolean | Node | Text | Element | null | undefined;\n\ndeclare const DEV: boolean;\n\nexport type MotifStyle = string | (() => any) | Array<any> | Object | Partial<CSSStyleDeclaration> | CSSStyleDeclaration;\nexport type MotifClass = string | Record<string, any> | Array<any> | (() => any);\nexport type MotifValue = string | number | boolean | Record<string, any> | Array<any> | (() => any);\nexport type MotifBindable<T> = T | string | (() => T | string);\n\nexport interface MotifBaseProps {\n children?: any;\n key?: string | number;\n ref?: ComponentBase | ((component: any) => void);\n style?: MotifStyle;\n class?: MotifClass;\n className?: MotifClass;\n}\n\ntype MethodLikeProps = {\n focus?: any;\n blur?: any;\n click?: any;\n select?: any;\n scrollIntoView?: any;\n scrollTo?: any;\n scrollBy?: any;\n requestFullscreen?: any;\n exitFullscreen?: any;\n play?: any;\n pause?: any;\n submit?: any;\n reset?: any;\n requestSubmit?: any;\n checkValidity?: any;\n reportValidity?: any;\n show?: any;\n showModal?: any;\n close?: any;\n showPicker?: any;\n setSelectionRange?: any;\n setRangeText?: any;\n requestPointerLock?: any;\n exitPointerLock?: any;\n setPointerCapture?: any;\n releasePointerCapture?: any;\n requestPictureInPicture?: any;\n exitPictureInPicture?: any;\n load?: any;\n fastSeek?: any;\n showPopover?: any;\n hidePopover?: any;\n togglePopover?: any;\n \"onconfig\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onbuilding\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onbuilt\"?: (sender: ComponentBase, e: EventArgs) => void;\n /** Element canlı DOM'a (document) bağlandığında bir kez; focus/ölçüm gibi işler için. */\n \"onmounted\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onconfigured\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"oninitializing\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"oninitialized\"?: (sender: ComponentBase, e: EventArgs) => void;\n};\ntype MethodLikeKeys = keyof MethodLikeProps;\n\nexport type MotifFunctionalComponent<P = Record<string, unknown>> = (\n props: P & MotifBaseProps & any\n) => unknown;\n\nexport type MotifFunctionalComponentBasic = (\n props: MotifBaseProps\n) => unknown;\n\nexport type AnyFunctionalComponent<P = any> = (props: P) => unknown;\nexport type MotifComponentConstructor<TElement extends ElementType = any, P extends Record<string, unknown> = Record<string, unknown>> =\n new (...args: any[]) => ComponentBase<TElement, P>;\n\nexport type MotifComponentType<P = Record<string, unknown>, TElement = unknown> =\n | string\n | MotifFunctionalComponent<P>\n | MotifFunctionalComponentBasic\n | AnyFunctionalComponent<P>\n | MotifComponentConstructor<TElement extends ElementType ? TElement : any, P extends Record<string, unknown> ? P : any>\n | { el: string; ctor?: (this: any, props?: any) => any;[newProp: string]: any };\n\ntype ExtractEventArg<T> = T extends ((this: any, ev: infer EV) => any) | null ? EV : never;\nexport type MotifDomEventHandler<EV> = (senderOrEvent: EV & ComponentBase, ev: EV) => unknown;\ntype motifEventsFor<TElement> = {\n [P in keyof TElement as P extends `on${string}` ? P : never]?:\n TElement[P] extends ((this: any, ev: infer EV) => any) | null\n ? MotifDomEventHandler<EV>\n : MotifDomEventHandler<Event>;\n};\nexport type MotifDomEventProps = motifEventsFor<HTMLElement>;\ntype MotifTagProps = MotifDomEventProps & {\n class?: MotifClass;\n className?: MotifClass;\n style?: MotifStyle;\n id?: MotifBindable<string>;\n tabindex?: MotifBindable<number | string>;\n role?: MotifBindable<string>;\n};\ntype WithTagProps<T> = T & Omit<MotifTagProps, keyof T>;\ntype MotifManagedProps<P> = 0 extends (1 & P) ? IBaseProp<{}> : WithTagProps<Exclude<P, string | Node | undefined>>;\n\n// Transform DOM attributes so that non-event, non-method, non-style/class/value props accept either the value or a function returning it\ntype MotifElementProps<TElement> = {\n [P in keyof Omit<\n Partial<TElement>,\n keyof motifEventsFor<TElement> | 'style' | 'class' | 'className' | 'value' | 'for' | MethodLikeKeys\n >]?: MotifBindable<Partial<TElement>[P]>;\n};\n\ntype IntrinsicHTML = {\n [K in keyof HTMLElementTagNameMap]:\n MotifElementProps<HTMLElementTagNameMap[K]> &\n motifEventsFor<HTMLElementTagNameMap[K]> &\n Partial<MotifBaseProps> &\n MethodLikeProps &\n (K extends 'input' | 'textarea' ? { value?: MotifValue } : {}) & object & { [key: string]: any };\n};\n\ntype IntrinsicSVG = IntrinsicHTML;\n// type IntrinsicSVG = {\n// keyof motifEventsFor<SVGElementTagNameMap[\"svg\"]> | 'style' | 'class' | 'className' | 'value' | MethodLikeKeys\n\ntype IntrinsicElementsMap = IntrinsicHTML & IntrinsicSVG;\n\nexport type __attr = {\n key?: string | number;\n ref?: ComponentBase | ((component: any) => void);\n initializeComponent?: (sender: ComponentBase) => void;\n \"x-wait\"?: (sender: ComponentBase, e: EventArgs) => boolean;\n \"x-building\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-built\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-config\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-configured\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-initializing\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-initialized\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onbuilding\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onbuilt\"?: (sender: ComponentBase, e: EventArgs) => void;\n /** Element canlı DOM'a (document) bağlandığında bir kez;*/\n \"onmounted\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onconfig\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"onconfigured\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"oninitializing\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"oninitialized\"?: (sender: ComponentBase, e: EventArgs) => void;\n \"x-style\"?: MotifStyle;\n}\nexport namespace JSX {\n export type Element = ComponentBase<any, any>;\n export type ElementType = MotifComponentType<any, any>;\n export interface ElementClass extends ComponentBase { }\n export interface ElementAttributesProperty extends __attr {\n props: {};\n };\n\n export interface IntrinsicElements extends IntrinsicElementsMap {\n [elementName: string]: IntrinsicElementsMap[keyof IntrinsicElementsMap];\n }\n\n export type LibraryManagedAttributes<C, P> = MotifManagedProps<P>;\n\n export interface IntrinsicAttributes extends __attr { };\n}\n\ndeclare global {\n namespace JSX {\n export type Element = ComponentBase<any, any>;\n export type ElementType = MotifComponentType<any, any>;\n export interface ElementClass extends ComponentBase { }\n export interface ElementAttributesProperty extends __attr {\n props: {};\n }\n\n export interface IntrinsicElements extends IntrinsicElementsMap {\n [elementName: string]: IntrinsicElementsMap[keyof IntrinsicElementsMap];\n }\n\n export type LibraryManagedAttributes<C, P> = MotifManagedProps<P>;\n\n export interface IntrinsicAttributes extends __attr { }\n }\n}\n"],"names":[],"mappings":"AAqJM,IAAW;AAAjB,CAAA,UAAiB,GAAG,EAAA;AAepB,CAAC,EAfgB,GAAG,KAAH,GAAG,GAAA,EAAA,CAAA,CAAA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motifx/core",
3
- "version": "1.1.0",
3
+ "version": "1.2.0-rc.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/motifjsdev/motifjs.git",