@yoyaflow/yoya-ui 0.2.0 → 0.2.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.
- package/README.md +22 -0
- package/README.zh-CN.md +22 -0
- package/dist/yoya.ssr.js +2414 -126
- package/package.json +1 -1
- package/types/ssr.d.ts +43 -0
- package/types/yoya.ssr.d.ts +6 -1
package/README.md
CHANGED
|
@@ -6,6 +6,28 @@
|
|
|
6
6
|
|
|
7
7
|
yoya-ui is a web foundation library — a new form of business UI construction. Views are built directly on the real DOM: declarative HTML authoring, router, i18n, theming, state and server-side rendering (SSR) out of the box, with pure client rendering switchable from the same code. Bundled UI components exist for out-of-the-box convenience; they are not the boundary of the library — native elements and third-party components compose the same way.
|
|
8
8
|
|
|
9
|
+
## Hello World — declarative UI and reactive i18n
|
|
10
|
+
|
|
11
|
+
No framework runtime, no virtual DOM, no JSX build step: views are real DOM nodes described in plain JS, and i18n is a string shortcut.
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
// HelloWorldExample — declarative UI
|
|
15
|
+
function HelloWorldExample() {
|
|
16
|
+
return div((root) => {
|
|
17
|
+
root.p('Hello,World!');
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
// HelloWorldExampleI18n — reactive i18n text with params
|
|
24
|
+
function HelloWorldExampleI18n() {
|
|
25
|
+
return div((root) => {
|
|
26
|
+
root.p('Hello, {name}!'.s('greeting.hello', { name: 'yoya-ui' }));
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
9
31
|
## Features
|
|
10
32
|
|
|
11
33
|
- **Low-barrier declarative authoring**: build UI with declarative structured JS elements — view and logic live in the same language, eliminating the friction between HTML markup and complex manipulation logic; only HTML and plain JS are required, with no framework-specific concepts
|
package/README.zh-CN.md
CHANGED
|
@@ -7,6 +7,28 @@
|
|
|
7
7
|
|
|
8
8
|
yoya-ui 是一套新的业务界面构建形式,也是一个 Web 基础库:直接在真实 DOM 上构建视图,声明式 HTML 写法、路由、i18n、主题与状态系统开箱即用,支持服务端渲染(SSR)与纯客户端渲染同代码切换。自带 UI 组件只是为了开箱即用,组件清单并不代表库的能力边界——原生元素与第三方组件以同样方式自由组合。
|
|
9
9
|
|
|
10
|
+
## Hello World——声明式构建与响应式 i18n
|
|
11
|
+
|
|
12
|
+
没有框架运行时、没有虚拟 DOM、没有 JSX 构建链:视图就是由原生 JS 描述的真实 DOM,i18n 只是字符串快捷方式。
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
// HelloWorldExample —— 声明式构建
|
|
16
|
+
function HelloWorldExample() {
|
|
17
|
+
return div((root) => {
|
|
18
|
+
root.p('Hello,World!');
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
// HelloWorldExampleI18n —— 响应式 i18n 文本(带参数)
|
|
25
|
+
function HelloWorldExampleI18n() {
|
|
26
|
+
return div((root) => {
|
|
27
|
+
root.p('Hello, {name}!'.s('greeting.hello', { name: 'yoya-ui' }));
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
10
32
|
## 特性
|
|
11
33
|
|
|
12
34
|
- **低门槛声明式构建**:采用声明式结构化 JS 元素构建方案,视图与操作逻辑同源,消除 HTML 标签化语言与复杂操作逻辑不兼容的问题;只学 HTML 与原生 JS 即可使用,无框架专属概念
|