ueca-react 1.0.7 → 2.0.0
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/LICENSE +1 -1
- package/README.md +109 -119
- package/dist/index.d.ts +266 -4
- package/dist/ueca-react.js +1453 -0
- package/docs/Arrays and Reactivity in UECA-React.md +158 -0
- package/docs/Automatic onChange Events in UECA-React.md +142 -0
- package/docs/Automatic onChanging Events in UECA-React.md +157 -0
- package/docs/Automatic onPropChange and onPropChanging Events in UECA-React.md +112 -0
- package/docs/Component Extension in UECA-React.md +275 -0
- package/docs/Component IDs in UECA-React.md +181 -0
- package/docs/{component-intergation-model.md → Component Integration Model in UECA-React.md } +4 -3
- package/docs/{component-mental-model.md → Component Mental Model in UECA-React.md } +4 -3
- package/docs/Introduction to UECA-React Components.md +190 -0
- package/docs/Introduction to UECA-React.md +24 -0
- package/docs/Lifecycle Hooks in UECA-React.md +237 -0
- package/docs/Message Bus in UECA-React.md +260 -0
- package/docs/Model Caching in UECA-React.md +144 -0
- package/docs/Property Bindings in UECA-React.md +191 -0
- package/docs/State Management in UECA-React.md +128 -0
- package/docs/Technology of UECA-React.md +45 -0
- package/docs/Tracing in UECA-React.md +110 -0
- package/docs/code-template.md +53 -27
- package/docs/index.md +31 -11
- package/package.json +68 -72
- package/dist/componentModel.d.ts +0 -127
- package/dist/componentModel.js +0 -772
- package/dist/dynamicContent.d.ts +0 -22
- package/dist/dynamicContent.js +0 -80
- package/dist/index.js +0 -29
- package/dist/messageBus.d.ts +0 -46
- package/dist/messageBus.js +0 -141
- package/dist/utils.d.ts +0 -8
- package/dist/utils.js +0 -52
- package/docs/base-concepts.md +0 -192
- package/docs/bindings-overview.md +0 -164
- package/docs/general-code-structure.md +0 -177
- package/docs/introduction.md +0 -56
- package/docs/message-bus.md +0 -177
- package/docs/technology.md +0 -45
package/docs/index.md
CHANGED
|
@@ -1,24 +1,44 @@
|
|
|
1
1
|

|
|
2
2
|
|
|
3
|
-
## UECA Programming Documentation
|
|
3
|
+
## UECA-React 2.0 Programming Documentation
|
|
4
4
|
|
|
5
|
-
### [1.
|
|
5
|
+
### [1. Introduction](/docs/Introduction%20to%20UECA-React.md)
|
|
6
6
|
|
|
7
|
-
### [2.
|
|
7
|
+
### [2. Technology](/docs/Technology%20of%20UECA-React.md)
|
|
8
8
|
|
|
9
|
-
### [3.
|
|
9
|
+
### [3. Component Mental Model](/docs/Component%20Mental%20Model%20in%20UECA-React.md)
|
|
10
10
|
|
|
11
|
-
### [4.
|
|
11
|
+
### [4. Component Integration Model](/docs/Component%20Integration%20Model%20in%20UECA-React.md)
|
|
12
12
|
|
|
13
|
-
### [5.
|
|
13
|
+
### [5. Introduction to Components](/docs/Introduction%20to%20UECA-React%20Components.md)
|
|
14
14
|
|
|
15
|
-
### [6.
|
|
15
|
+
### [6. Component IDs](/docs/Component%20IDs%20in%20UECA-React.md)
|
|
16
16
|
|
|
17
|
-
### [7.
|
|
17
|
+
### [7. Lifecycle Hooks](/docs/Lifecycle%20Hooks%20in%20UECA-React.md)
|
|
18
18
|
|
|
19
|
-
### [8.
|
|
19
|
+
### [8. State Management](/docs/State%20Management%20in%20UECA-React.md)
|
|
20
20
|
|
|
21
|
-
### [9.
|
|
21
|
+
### [9. Property Bindings](/docs/Property%20Bindings%20in%20UECA-React.md)
|
|
22
|
+
|
|
23
|
+
### [10. Automatic onChange\<Prop> Events](/docs/Automatic%20onChange%20Events%20in%20UECA-React.md)
|
|
24
|
+
|
|
25
|
+
### [11. Automatic onChanging\<Prop> Events](/docs/Automatic%20onChanging%20Events%20in%20UECA-React.md)
|
|
26
|
+
|
|
27
|
+
### [12. Automatic onPropChange and onPropChanging Events](/docs/Automatic%20onPropChange%20and%20onPropChanging%20Events%20in%20UECA-React.md)
|
|
28
|
+
|
|
29
|
+
### [13. Message Bus](/docs/Message%20Bus%20in%20UECA-React.md)
|
|
30
|
+
|
|
31
|
+
### [14. Arrays and Reactivity in UECA-React](/docs/Arrays%20and%20Reactivity%20in%20UECA-React.md)
|
|
32
|
+
|
|
33
|
+
### [15. Model Caching](/docs/Model%20Caching%20in%20UECA-React.md)
|
|
34
|
+
|
|
35
|
+
### [16. Component Extension in UECA-React](/docs/Component%20Extension%20in%20UECA-React.md)
|
|
36
|
+
|
|
37
|
+
### [17. Tracing](/docs/Logging%20and%20Tracing%20in%20UECA-React.md)
|
|
38
|
+
|
|
39
|
+
### [18. Standard Code Template](/docs/code-template.md)
|
|
40
|
+
|
|
41
|
+
#
|
|
22
42
|
|
|
23
43
|
## Code Examples on CodeSandbox
|
|
24
|
-
#### [UECA Basics: Application (Code Examples Menu)](https://codesandbox.io/p/sandbox/frosty-banach-jsf84c)
|
|
44
|
+
#### [UECA-React Basics: Application (Code Examples Main Menu)](https://codesandbox.io/p/sandbox/frosty-banach-jsf84c)
|
package/package.json
CHANGED
|
@@ -1,76 +1,72 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"repository": {
|
|
21
|
-
"type": "git",
|
|
22
|
-
"url": "https://github.com/nekutuzov/ueca-react-npm.git"
|
|
23
|
-
},
|
|
24
|
-
"files": [
|
|
25
|
-
"dist",
|
|
26
|
-
"docs",
|
|
27
|
-
"README.md",
|
|
28
|
-
"LICENSE"
|
|
29
|
-
],
|
|
30
|
-
"scripts": {
|
|
31
|
-
"build": "tsc",
|
|
32
|
-
"test": "jest"
|
|
33
|
-
},
|
|
34
|
-
"author": "Aleksey Suvorov",
|
|
35
|
-
"license": "ISC",
|
|
36
|
-
"dependencies": {
|
|
37
|
-
"mobx-react": "^9.1.1"
|
|
38
|
-
},
|
|
39
|
-
"peerDependencies": {
|
|
40
|
-
"lodash": "^4.17.21"
|
|
41
|
-
},
|
|
42
|
-
"devDependencies": {
|
|
43
|
-
"@babel/core": "^7.26.10",
|
|
44
|
-
"@babel/preset-env": "^7.26.9",
|
|
45
|
-
"@babel/preset-react": "^7.26.3",
|
|
46
|
-
"@babel/preset-typescript": "^7.27.0",
|
|
47
|
-
"@testing-library/jest-dom": "^6.6.3",
|
|
48
|
-
"@testing-library/react": "^16.3.0",
|
|
49
|
-
"@testing-library/user-event": "^14.6.1",
|
|
50
|
-
"@types/react": "^18.3.2",
|
|
51
|
-
"@types/jest": "^29.5.14",
|
|
52
|
-
"@types/lodash": "^4.17.4",
|
|
53
|
-
"@types/node": "^20.12.12",
|
|
54
|
-
"jest": "^29.7.0",
|
|
55
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
56
|
-
"typescript": "^5.8.3"
|
|
57
|
-
},
|
|
58
|
-
"jest": {
|
|
59
|
-
"testEnvironment": "jsdom",
|
|
60
|
-
"testMatch": [
|
|
61
|
-
"**/?(*.)+(test).[jt]s?(x)"
|
|
2
|
+
"name": "ueca-react",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Unified Encapsulated Component Architecture for React",
|
|
5
|
+
"author": "Aleksey Suvorov <cranesoft@protonmail.com>",
|
|
6
|
+
"license": "ISC",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"ueca",
|
|
9
|
+
"react",
|
|
10
|
+
"typescript",
|
|
11
|
+
"framework",
|
|
12
|
+
"abstraction",
|
|
13
|
+
"unified",
|
|
14
|
+
"encapsulated",
|
|
15
|
+
"component",
|
|
16
|
+
"architecture",
|
|
17
|
+
"message bus",
|
|
18
|
+
"bindings",
|
|
19
|
+
"AI code generation"
|
|
62
20
|
],
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/nekutuzov/ueca-react.git"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/nekutuzov/ueca-react#readme",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/nekutuzov/ueca-react/issues"
|
|
28
|
+
},
|
|
29
|
+
"main": "dist/ueca-react.js",
|
|
30
|
+
"module": "dist/ueca-react.js",
|
|
31
|
+
"types": "dist/index.d.ts",
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"docs",
|
|
35
|
+
"README.md",
|
|
36
|
+
"LICENSE"
|
|
68
37
|
],
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
38
|
+
"type": "module",
|
|
39
|
+
"scripts": {
|
|
40
|
+
"dev": "vite",
|
|
41
|
+
"build": "tsc -b && vite build",
|
|
42
|
+
"lint": "eslint .",
|
|
43
|
+
"preview": "vite preview",
|
|
44
|
+
"test": "vitest run"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"mobx": "^6.9.0",
|
|
48
|
+
"mobx-react": "^9.1.1",
|
|
49
|
+
"react": "^19.0.0",
|
|
50
|
+
"react-dom": "^19.0.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@eslint/js": "^9.29.0",
|
|
54
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
55
|
+
"@testing-library/react": "^16.3.0",
|
|
56
|
+
"@testing-library/user-event": "^14.6.1",
|
|
57
|
+
"@types/node": "^22.15.18",
|
|
58
|
+
"@types/react": "^19.0.0",
|
|
59
|
+
"@types/react-dom": "^19.0.0",
|
|
60
|
+
"@vitejs/plugin-react": "^4.5.2",
|
|
61
|
+
"eslint": "^9.29.0",
|
|
62
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
63
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
64
|
+
"globals": "^16.2.0",
|
|
65
|
+
"jsdom": "^26.1.0",
|
|
66
|
+
"typescript": "~5.8.3",
|
|
67
|
+
"typescript-eslint": "^8.34.1",
|
|
68
|
+
"vite": "^7.0.0",
|
|
69
|
+
"vite-plugin-dts": "^4.5.4",
|
|
70
|
+
"vitest": "^3.1.1"
|
|
74
71
|
}
|
|
75
|
-
|
|
76
|
-
}
|
|
72
|
+
}
|
package/dist/componentModel.d.ts
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { IReactionDisposer } from "mobx";
|
|
3
|
-
import { AnyMessage, AnyName, IMessageBus, Messages } from "./messageBus";
|
|
4
|
-
type ComponentTemplate = {
|
|
5
|
-
props?: {};
|
|
6
|
-
children?: {};
|
|
7
|
-
methods?: {};
|
|
8
|
-
events?: {};
|
|
9
|
-
};
|
|
10
|
-
type ComponentProps<TStruct extends ComponentTemplate> = TStruct["props"];
|
|
11
|
-
type ComponentChildren<TStruct extends ComponentTemplate> = TStruct["children"];
|
|
12
|
-
type ComponentMethods<TStruct extends ComponentTemplate> = TStruct["methods"];
|
|
13
|
-
type ComponentEvents<TStruct extends ComponentTemplate> = TStruct["events"];
|
|
14
|
-
type ComponentMessages<TStruct extends ComponentStructBase<TMsg>, TMsg extends AnyMessage> = TStruct["messages"];
|
|
15
|
-
type ComponentStructEvents<TProps> = {
|
|
16
|
-
onPropChanging?: (prop: keyof TProps, newValue: any, oldValue: any) => any;
|
|
17
|
-
onPropChange?: (prop: keyof TProps, value: any) => void;
|
|
18
|
-
} & {
|
|
19
|
-
[Evt in keyof TProps as `onGet${Capitalize<Evt & string>}`]?: () => TProps[Evt];
|
|
20
|
-
} & {
|
|
21
|
-
[Evt in keyof TProps as `onChanging${Capitalize<Evt & string>}`]?: (newValue: TProps[Evt], oldValue: TProps[Evt]) => TProps[Evt];
|
|
22
|
-
} & {
|
|
23
|
-
[Evt in keyof TProps as `onChange${Capitalize<Evt & string>}`]?: (value: TProps[Evt]) => void;
|
|
24
|
-
};
|
|
25
|
-
type ComponentViewProps = {
|
|
26
|
-
render?: boolean;
|
|
27
|
-
children?: React.ReactNode;
|
|
28
|
-
};
|
|
29
|
-
type ComponentView = (params?: ComponentViewProps) => JSX.Element;
|
|
30
|
-
type Bond<T> = [() => T, (value: T) => void];
|
|
31
|
-
type StructProp<T> = T | (() => T) | Bond<T>;
|
|
32
|
-
type StructProps<TProps> = {
|
|
33
|
-
[Prop in keyof TProps]: StructProp<TProps[Prop]>;
|
|
34
|
-
};
|
|
35
|
-
type ComponentStructBase<TMsg extends AnyMessage> = ComponentTemplate & {
|
|
36
|
-
props?: {
|
|
37
|
-
id?: string;
|
|
38
|
-
};
|
|
39
|
-
messages?: Messages<TMsg>;
|
|
40
|
-
View?: ComponentView;
|
|
41
|
-
BaseView?: ComponentView;
|
|
42
|
-
init?: (model: ComponentModel<ComponentStructBase<TMsg>, TMsg>) => void;
|
|
43
|
-
mount?: (model: ComponentModel<ComponentStructBase<TMsg>, TMsg>) => void;
|
|
44
|
-
unmount?: (model: ComponentModel<ComponentStructBase<TMsg>, TMsg>) => void;
|
|
45
|
-
__struct?: ComponentStructBase<TMsg>;
|
|
46
|
-
};
|
|
47
|
-
type PartialComponentTemplate<TStruct extends ComponentTemplate, TMsg extends AnyMessage> = {
|
|
48
|
-
props?: Partial<StructProps<ComponentProps<TStruct>>>;
|
|
49
|
-
children?: Partial<ComponentChildren<TStruct>>;
|
|
50
|
-
methods?: Partial<ComponentMethods<TStruct>>;
|
|
51
|
-
events?: Partial<ComponentStructEvents<ComponentProps<TStruct>>> & Partial<ComponentEvents<TStruct>>;
|
|
52
|
-
messages?: Partial<ComponentMessages<TStruct, TMsg>>;
|
|
53
|
-
};
|
|
54
|
-
type ComponentStruct<TStruct extends ComponentTemplate, TMsg extends AnyMessage = AnyMessage> = PartialComponentTemplate<ComponentStructBase<TMsg>, TMsg> & Omit<TStruct & ComponentStructBase<TMsg>, "props" | "children" | "methods" | "events" | "messages"> & PartialComponentTemplate<TStruct, TMsg> & {
|
|
55
|
-
__struct?: TStruct;
|
|
56
|
-
};
|
|
57
|
-
type AnyComponentParams = ComponentParams<AnyComponentStruct, AnyMessage>;
|
|
58
|
-
type AnyComponentStruct = ComponentStruct<ComponentStructBase<AnyMessage>, AnyMessage>;
|
|
59
|
-
type AnyComponentModel = ComponentModel<AnyComponentStruct, AnyMessage>;
|
|
60
|
-
type DynamicChildren = Record<string, AnyComponentModel>;
|
|
61
|
-
type ComponentParams<TStruct extends ComponentStruct<ComponentStructBase<TMsg>, TMsg>, TMsg extends AnyMessage = {}> = Partial<ComponentProps<TStruct>> & Partial<ComponentEvents<TStruct>> & {
|
|
62
|
-
init?: (model: ComponentModel<TStruct, TMsg>) => void;
|
|
63
|
-
mount?: (model: ComponentModel<TStruct, TMsg>) => void;
|
|
64
|
-
unmount?: (model: ComponentModel<TStruct, TMsg>) => void;
|
|
65
|
-
} & {
|
|
66
|
-
owner?: DynamicChildren;
|
|
67
|
-
};
|
|
68
|
-
type ComponentPrivateMembers = {
|
|
69
|
-
__owner: AnyComponentModel;
|
|
70
|
-
__deleteMember: (name: string) => boolean;
|
|
71
|
-
__calledFromJSX: boolean;
|
|
72
|
-
__messages: Partial<Messages<AnyMessage>>;
|
|
73
|
-
__propBindings: string[];
|
|
74
|
-
__mounted: boolean;
|
|
75
|
-
__initialize: () => void;
|
|
76
|
-
__unmount: () => void;
|
|
77
|
-
__updateInitializedModelProperties: (params: AnyComponentParams) => void;
|
|
78
|
-
__autoRunDisposers: IReactionDisposer[];
|
|
79
|
-
bus: IMessageBus<AnyMessage, AnyName>;
|
|
80
|
-
View: ComponentView;
|
|
81
|
-
BaseView: ComponentView;
|
|
82
|
-
firstTimeRendering: boolean;
|
|
83
|
-
disableOnChange: () => void;
|
|
84
|
-
enableOnChange: () => void;
|
|
85
|
-
changeNotifyDisabled: () => boolean;
|
|
86
|
-
fullId: () => string;
|
|
87
|
-
htmlId: () => string;
|
|
88
|
-
birthMark: () => string;
|
|
89
|
-
calledFromJSX: () => boolean;
|
|
90
|
-
init: (model: ComponentModel<AnyComponentStruct, AnyMessage>) => void;
|
|
91
|
-
mount: (model: ComponentModel<AnyComponentStruct, AnyMessage>) => void;
|
|
92
|
-
unmount: (model: ComponentModel<AnyComponentStruct, AnyMessage>) => void;
|
|
93
|
-
};
|
|
94
|
-
declare const $: unique symbol;
|
|
95
|
-
type ComponentModel<TStruct extends ComponentStruct<ComponentStructBase<TMsg>, TMsg>, TMsg extends AnyMessage = {}> = ComponentProps<TStruct["__struct"]> & Readonly<ComponentChildren<TStruct["__struct"]>> & Readonly<ComponentMethods<TStruct["__struct"]>> & ComponentStructEvents<ComponentProps<TStruct["__struct"]>> & ComponentEvents<TStruct["__struct"]> & {
|
|
96
|
-
readonly [$]: ComponentPrivateMembers;
|
|
97
|
-
readonly bus: IMessageBus<TMsg, AnyName>;
|
|
98
|
-
readonly View: ComponentView;
|
|
99
|
-
readonly BaseView: ComponentView;
|
|
100
|
-
readonly disableOnChange: () => void;
|
|
101
|
-
readonly enableOnChange: () => void;
|
|
102
|
-
readonly changeNotifyDisabled: () => boolean;
|
|
103
|
-
readonly fullId: () => string;
|
|
104
|
-
readonly htmlId: () => string;
|
|
105
|
-
readonly birthMark: () => string;
|
|
106
|
-
readonly calledFromJSX: () => boolean;
|
|
107
|
-
};
|
|
108
|
-
type ComponentModelTrapRegistry = {
|
|
109
|
-
readonly _hookCallsCount: number;
|
|
110
|
-
readonly _newModels: AnyComponentModel[];
|
|
111
|
-
readonly models: AnyComponentModel[];
|
|
112
|
-
readonly cached: boolean;
|
|
113
|
-
readonly nextCachedModel: () => AnyComponentModel;
|
|
114
|
-
readonly cacheModel: (model: AnyComponentModel) => void;
|
|
115
|
-
readonly updateCache: (owner: AnyComponentModel) => void;
|
|
116
|
-
};
|
|
117
|
-
declare const blankView: () => any;
|
|
118
|
-
declare function useComponent<TStruct extends ComponentStruct<ComponentStructBase<TMsg>, TMsg>, TMsg extends AnyMessage>(struct: TStruct, params?: ComponentParams<TStruct>): ComponentModel<TStruct, TMsg>;
|
|
119
|
-
declare function mergeStruct<TStruct extends ComponentStruct<ComponentStructBase<TMsg>, TMsg>, TExt extends ComponentStruct<ComponentStructBase<TMsg>, TMsg>, TMsg extends AnyMessage>(struct: TStruct, extStruct: TExt, model: () => ComponentModel<TExt, TMsg>): TStruct & TExt;
|
|
120
|
-
declare function bind<T>(get: () => T, set: (value: T) => void): Bond<T>;
|
|
121
|
-
declare function bindProp<T, P extends keyof T>(obj: () => T, prop: P): Bond<T[P]>;
|
|
122
|
-
declare function newComponentModelTrapRegistry(cache?: AnyComponentModel[]): ComponentModelTrapRegistry;
|
|
123
|
-
declare const ComponentModelTrap: React.Context<ComponentModelTrapRegistry>;
|
|
124
|
-
declare function useComponentModelTrap(): ComponentModelTrapRegistry;
|
|
125
|
-
declare function getFC<TStruct extends ComponentStruct<ComponentStructBase<TMsg>, TMsg>, TMsg extends AnyMessage>(modelHook: (params: ComponentParams<TStruct>) => ComponentModel<TStruct, TMsg>): (params: ComponentParams<TStruct>) => JSX.Element;
|
|
126
|
-
declare function componentModelDebug(text: string): void;
|
|
127
|
-
export { ComponentModel, AnyComponentModel, ComponentTemplate, ComponentStruct, ComponentProps, ComponentMethods, ComponentEvents, ComponentMessages, ComponentParams, ComponentView, DynamicChildren, ComponentModelTrap, ComponentModelTrapRegistry, useComponentModelTrap, newComponentModelTrapRegistry, useComponent, mergeStruct, blankView, bind, bindProp, componentModelDebug, getFC, $ };
|