@yoyaflow/yoya-ui 0.3.3 → 0.4.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/package.json CHANGED
@@ -1,38 +1,41 @@
1
1
  {
2
2
  "name": "@yoyaflow/yoya-ui",
3
- "version": "0.3.3",
3
+ "version": "0.4.0",
4
4
  "description": "A browser-native JS UI library with declarative HTML authoring: component library, router, i18n, theming and layout, works with or without a build tool, SSR-ready.",
5
5
  "type": "module",
6
6
  "private": false,
7
- "main": "./dist/yoya-ui.umd.js",
8
- "module": "./dist/yoya.ui.js",
7
+ "main": "./dist/yoya.ui-router.umd.js",
8
+ "module": "./dist/yoya.ui-router.full.js",
9
9
  "style": "./dist/yoya.ui.css",
10
10
  "types": "./types/index.d.ts",
11
11
  "exports": {
12
12
  ".": {
13
13
  "types": "./types/index.d.ts",
14
- "import": "./dist/yoya.ui.js",
15
- "require": "./dist/yoya-ui.umd.js"
14
+ "import": "./dist/yoya.ui-router.full.js"
16
15
  },
17
16
  "./core": {
18
17
  "types": "./types/yoya.core.d.ts",
19
18
  "import": "./dist/yoya.core.js"
20
19
  },
21
- "./devtools": {
22
- "types": "./types/yoya.devtools.d.ts",
23
- "import": "./dist/yoya.devtools.js"
20
+ "./ui": {
21
+ "types": "./types/yoya.ui.d.ts",
22
+ "import": "./dist/yoya.ui.js"
23
+ },
24
+ "./router": {
25
+ "types": "./types/yoya.router.d.ts",
26
+ "import": "./dist/yoya.router.js"
24
27
  },
25
28
  "./echart": {
26
29
  "types": "./types/yoya.echart.d.ts",
27
30
  "import": "./dist/yoya.echart.js"
28
31
  },
29
- "./ssr": {
30
- "types": "./types/yoya.ssr.d.ts",
31
- "import": "./dist/yoya.ssr.js"
32
+ "./three": {
33
+ "types": "./types/yoya.three.d.ts",
34
+ "import": "./dist/yoya.three.js"
32
35
  },
33
- "./ui": {
34
- "types": "./types/index.d.ts",
35
- "import": "./dist/yoya.ui.js"
36
+ "./devtools": {
37
+ "types": "./types/yoya.devtools.d.ts",
38
+ "import": "./dist/yoya.devtools.js"
36
39
  },
37
40
  "./ui.css": "./dist/yoya.ui.css",
38
41
  "./package.json": "./package.json"
@@ -99,6 +102,7 @@
99
102
  "leaflet": "^1.9.4",
100
103
  "prettier": "^3.9.6",
101
104
  "quill": "^2.0.3",
105
+ "three": "^0.185.1",
102
106
  "typescript": "^7.0.2",
103
107
  "vite": "^8.2.0",
104
108
  "vitest": "^4.1.10"
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Default entry types for the `yoya-ui` package root.
3
3
  */
4
- export * from './yoya.ui.js';
4
+ export * from './yoya.ui-router.js';
@@ -0,0 +1,77 @@
1
+ import type { ElementFactory, ElementOptions, SetupCallback, SetupInput } from './core.js';
2
+ import type { HtmlElementNode } from './html.js';
3
+
4
+ /** Minimal Three.js module shape accepted by threeLib(). */
5
+ export interface ThreeLib {
6
+ PerspectiveCamera: new (...args: any[]) => any;
7
+ Scene: new (...args: any[]) => any;
8
+ WebGLRenderer: new (options?: Record<string, any>) => ThreeRenderer;
9
+ [key: string]: any;
10
+ }
11
+
12
+ /** Renderer surface used by the component. */
13
+ export interface ThreeRenderer {
14
+ domElement: HTMLCanvasElement;
15
+ dispose(): void;
16
+ render(scene: any, camera: any): void;
17
+ setPixelRatio(value: number): void;
18
+ setSize(width: number, height: number): void;
19
+ }
20
+
21
+ /** Handed to onReady / onFrame callbacks after the renderer mounts. */
22
+ export interface ThreeInstanceApi {
23
+ camera: any;
24
+ renderer: ThreeRenderer;
25
+ scene: any;
26
+ threeLib: ThreeLib;
27
+ }
28
+
29
+ /** Reported by onResize callbacks. */
30
+ export interface ThreeResizeSize {
31
+ height: number;
32
+ width: number;
33
+ }
34
+
35
+ /** Three.js scene host (the three library itself is not bundled). */
36
+ export class VThree extends HtmlElementNode {
37
+ threeLib(lib: ThreeLib): VThree;
38
+ getThreeLib(): ThreeLib | null;
39
+ scene(): any;
40
+ scene(value: any): VThree;
41
+ getScene(): any;
42
+ camera(): any;
43
+ camera(value: any): VThree;
44
+ getCamera(): any;
45
+ rendererOptions(): Record<string, any>;
46
+ rendererOptions(value: Record<string, any>): VThree;
47
+ width(): number | string;
48
+ width(value: number | string): VThree;
49
+ height(): number | string;
50
+ height(value: number | string): VThree;
51
+ devicePixelRatio(): number | null;
52
+ devicePixelRatio(value: number | null): VThree;
53
+ autoResize(): boolean;
54
+ autoResize(value: boolean): VThree;
55
+ autoRender(): boolean;
56
+ autoRender(value: boolean): VThree;
57
+ onReady(callback: (api: ThreeInstanceApi) => void): VThree;
58
+ onResize(callback: (size: ThreeResizeSize) => void): VThree;
59
+ onFrame(callback: (api: ThreeInstanceApi) => void): VThree;
60
+ getRenderer(): ThreeRenderer | null;
61
+ start(): VThree;
62
+ stop(): VThree;
63
+ render(): VThree;
64
+ resize(): VThree;
65
+ dispose(): VThree;
66
+ }
67
+
68
+ export const vThree: ElementFactory<VThree> & {
69
+ (first?: SetupInput<VThree> | null, callback?: SetupCallback<VThree>): VThree;
70
+ };
71
+
72
+ /** Parent-shortcut surface merged onto HtmlElementNode. */
73
+ export interface ThreeParentShortcuts {
74
+ vThree(first?: SetupInput<VThree> | null, callback?: SetupCallback<VThree>): VThree;
75
+ }
76
+
77
+ export type { ElementOptions };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Entry types for `yoya-ui/router`: router plus SSR rendering primitives
3
+ * (core / html / layout / theme are provided by `yoya-ui/core` and
4
+ * `yoya-ui/ui` respectively).
5
+ */
6
+ export * from './router.js';
7
+ export * from './ssr.js';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Entry types for `yoya-ui/three`: the Three.js component.
3
+ */
4
+ export { VThree, vThree } from './three.js';
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Entry types for the self-contained `yoya.ui-router.full` bundle:
3
+ * core + ui (components / layout / theme) + router + SSR primitives.
4
+ */
5
+ export * from './core.js';
6
+ export * from './html.js';
7
+ export * from './svg.js';
8
+ export * from './layout.js';
9
+ export * from './actions.js';
10
+ export * from './navigation.js';
11
+ export * from './feedback.js';
12
+ export * from './form.js';
13
+ export * from './data-display.js';
14
+ export * from './async.js';
15
+ export * from './i18n.js';
16
+ export * from './theme.js';
17
+ export * from './router.js';
18
+ export * from './effects.js';
19
+ export * from './ssr.js';
@@ -1,9 +1,7 @@
1
1
  /**
2
- * Entry types for the `yoya-ui` root export (and `yoya-ui/ui`).
2
+ * Entry types for `yoya-ui/ui`: components + layout + theme.
3
+ * Core is provided by `yoya-ui/core`; router/SSR by `yoya-ui/router`.
3
4
  */
4
- export * from './core.js';
5
- export * from './html.js';
6
- export * from './svg.js';
7
5
  export * from './layout.js';
8
6
  export * from './actions.js';
9
7
  export * from './navigation.js';
@@ -13,7 +11,4 @@ export * from './data-display.js';
13
11
  export * from './async.js';
14
12
  export * from './i18n.js';
15
13
  export * from './theme.js';
16
- export * from './router.js';
17
14
  export * from './effects.js';
18
- export { VEchart, vEchart } from './chart.js';
19
- export * from './ssr.js';