@kurot/ui-runtime 0.1.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 +21 -0
- package/README.md +49 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/kurot/runtime/KurotUIRuntimeError.d.ts +21 -0
- package/dist/kurot/runtime/KurotUIRuntimeError.d.ts.map +1 -0
- package/dist/kurot/runtime/KurotUIRuntimeError.js +27 -0
- package/dist/kurot/runtime/KurotUIRuntimeError.js.map +1 -0
- package/dist/kurot/runtime/applyComponentProperties.d.ts +7 -0
- package/dist/kurot/runtime/applyComponentProperties.d.ts.map +1 -0
- package/dist/kurot/runtime/applyComponentProperties.js +205 -0
- package/dist/kurot/runtime/applyComponentProperties.js.map +1 -0
- package/dist/kurot/runtime/applyDisplayProperties.d.ts +7 -0
- package/dist/kurot/runtime/applyDisplayProperties.d.ts.map +1 -0
- package/dist/kurot/runtime/applyDisplayProperties.js +154 -0
- package/dist/kurot/runtime/applyDisplayProperties.js.map +1 -0
- package/dist/kurot/runtime/componentFactories.d.ts +6 -0
- package/dist/kurot/runtime/componentFactories.d.ts.map +1 -0
- package/dist/kurot/runtime/componentFactories.js +15 -0
- package/dist/kurot/runtime/componentFactories.js.map +1 -0
- package/dist/kurot/runtime/createKurotUI.d.ts +7 -0
- package/dist/kurot/runtime/createKurotUI.d.ts.map +1 -0
- package/dist/kurot/runtime/createKurotUI.js +72 -0
- package/dist/kurot/runtime/createKurotUI.js.map +1 -0
- package/dist/kurot/runtime/createLayout.d.ts +7 -0
- package/dist/kurot/runtime/createLayout.d.ts.map +1 -0
- package/dist/kurot/runtime/createLayout.js +177 -0
- package/dist/kurot/runtime/createLayout.js.map +1 -0
- package/dist/kurot/runtime/createRectangle.d.ts +7 -0
- package/dist/kurot/runtime/createRectangle.d.ts.map +1 -0
- package/dist/kurot/runtime/createRectangle.js +35 -0
- package/dist/kurot/runtime/createRectangle.js.map +1 -0
- package/dist/kurot/runtime/index.d.ts +4 -0
- package/dist/kurot/runtime/index.d.ts.map +1 -0
- package/dist/kurot/runtime/index.js +3 -0
- package/dist/kurot/runtime/index.js.map +1 -0
- package/dist/kurot/runtime/types.d.ts +58 -0
- package/dist/kurot/runtime/types.d.ts.map +1 -0
- package/dist/kurot/runtime/types.js +2 -0
- package/dist/kurot/runtime/types.js.map +1 -0
- package/package.json +62 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kelvin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# @kurot/ui-runtime
|
|
2
|
+
|
|
3
|
+
Runtime materialization layer for validated Kurot UI documents. It converts
|
|
4
|
+
canonical `kui.*` nodes into real `@kurot/ui` components without moving
|
|
5
|
+
document semantics into the component library.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { createKurotUI } from '@kurot/ui-runtime';
|
|
9
|
+
|
|
10
|
+
const result = createKurotUI(document);
|
|
11
|
+
stage.addChild(result.root);
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The initial runtime supports `kui.Group`, `kui.Label`, `kui.Image`, `kui.Rect`,
|
|
15
|
+
and `kui.Button`, including their audited inherited properties, children,
|
|
16
|
+
layout descriptors, and nine-slice rectangles.
|
|
17
|
+
|
|
18
|
+
The result also provides a stable node lookup for editor selection and event
|
|
19
|
+
wiring:
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
const startButton = result.instances.get('startButton');
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Project component types are added by extending a foundation
|
|
26
|
+
`UIComponentRegistry` and supplying a matching runtime adapter. Invalid
|
|
27
|
+
documents, unsupported values, and missing adapters throw
|
|
28
|
+
`KurotUIRuntimeError` with a stable code and exact document path.
|
|
29
|
+
|
|
30
|
+
## Boundary
|
|
31
|
+
|
|
32
|
+
- `@kurot/ui-document` describes and validates UI.
|
|
33
|
+
- `@kurot/ui-runtime` creates and connects runtime objects.
|
|
34
|
+
- `@kurot/ui` implements component behavior and layout.
|
|
35
|
+
- `@kurot/core` renders the resulting display tree.
|
|
36
|
+
|
|
37
|
+
This package does not own Canvas or Stage lifecycle and does not define a
|
|
38
|
+
second document model.
|
|
39
|
+
|
|
40
|
+
## Development
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pnpm install
|
|
44
|
+
pnpm build
|
|
45
|
+
pnpm test
|
|
46
|
+
pnpm preview
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The preview is available at `http://localhost:5173/preview/` by default.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { UIDiagnostic } from '@kurot/ui-document';
|
|
2
|
+
import type { KurotUIRuntimeErrorCode } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Structured failure raised while validating or materializing a UI document.
|
|
5
|
+
*/
|
|
6
|
+
export declare class KurotUIRuntimeError extends Error {
|
|
7
|
+
/**
|
|
8
|
+
* Stable category suitable for programmatic error handling.
|
|
9
|
+
*/
|
|
10
|
+
readonly code: KurotUIRuntimeErrorCode;
|
|
11
|
+
/**
|
|
12
|
+
* Exact semantic document path at which materialization failed.
|
|
13
|
+
*/
|
|
14
|
+
readonly path: string;
|
|
15
|
+
/**
|
|
16
|
+
* Structural or component diagnostics produced before materialization.
|
|
17
|
+
*/
|
|
18
|
+
readonly diagnostics: readonly UIDiagnostic[];
|
|
19
|
+
constructor(code: KurotUIRuntimeErrorCode, message: string, path?: string, diagnostics?: readonly UIDiagnostic[]);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=KurotUIRuntimeError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KurotUIRuntimeError.d.ts","sourceRoot":"","sources":["../../../src/kurot/runtime/KurotUIRuntimeError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAG7C;;OAEG;IACH,SAAgB,IAAI,EAAE,uBAAuB,CAAC;IAE9C;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,SAAgB,WAAW,EAAE,SAAS,YAAY,EAAE,CAAC;gBAKpD,IAAI,EAAE,uBAAuB,EAC7B,OAAO,EAAE,MAAM,EACf,IAAI,SAAM,EACV,WAAW,GAAE,SAAS,YAAY,EAAO;CAQ1C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured failure raised while validating or materializing a UI document.
|
|
3
|
+
*/
|
|
4
|
+
export class KurotUIRuntimeError extends Error {
|
|
5
|
+
// ── Instance fields ───────────────────────────────────────────────────
|
|
6
|
+
/**
|
|
7
|
+
* Stable category suitable for programmatic error handling.
|
|
8
|
+
*/
|
|
9
|
+
code;
|
|
10
|
+
/**
|
|
11
|
+
* Exact semantic document path at which materialization failed.
|
|
12
|
+
*/
|
|
13
|
+
path;
|
|
14
|
+
/**
|
|
15
|
+
* Structural or component diagnostics produced before materialization.
|
|
16
|
+
*/
|
|
17
|
+
diagnostics;
|
|
18
|
+
// ── Constructor ───────────────────────────────────────────────────────
|
|
19
|
+
constructor(code, message, path = '$', diagnostics = []) {
|
|
20
|
+
super(message);
|
|
21
|
+
this.name = 'KurotUIRuntimeError';
|
|
22
|
+
this.code = code;
|
|
23
|
+
this.path = path;
|
|
24
|
+
this.diagnostics = diagnostics;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=KurotUIRuntimeError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KurotUIRuntimeError.js","sourceRoot":"","sources":["../../../src/kurot/runtime/KurotUIRuntimeError.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC7C,yEAAyE;IAEzE;;OAEG;IACa,IAAI,CAA0B;IAE9C;;OAEG;IACa,IAAI,CAAS;IAE7B;;OAEG;IACa,WAAW,CAA0B;IAErD,yEAAyE;IAEzE,YACC,IAA6B,EAC7B,OAAe,EACf,IAAI,GAAG,GAAG,EACV,cAAuC,EAAE;QAEzC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IAChC,CAAC;CACD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DisplayObject } from '@kurot/core';
|
|
2
|
+
import type { UIPropertyValue } from '@kurot/ui-document';
|
|
3
|
+
/**
|
|
4
|
+
* Applies one property declared directly by a built-in Kurot UI component.
|
|
5
|
+
*/
|
|
6
|
+
export declare function applyComponentProperty(target: DisplayObject, name: string, value: UIPropertyValue, path: string): boolean;
|
|
7
|
+
//# sourceMappingURL=applyComponentProperties.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applyComponentProperties.d.ts","sourceRoot":"","sources":["../../../src/kurot/runtime/applyComponentProperties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAM1D;;GAEG;AACH,wBAAgB,sBAAsB,CACrC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,MAAM,GACV,OAAO,CAiBT"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { Button, Component, Group, Image, Label, Rect } from '@kurot/ui';
|
|
2
|
+
import { KurotUIRuntimeError } from './KurotUIRuntimeError.js';
|
|
3
|
+
import { createLayout } from './createLayout.js';
|
|
4
|
+
import { createRectangle } from './createRectangle.js';
|
|
5
|
+
/**
|
|
6
|
+
* Applies one property declared directly by a built-in Kurot UI component.
|
|
7
|
+
*/
|
|
8
|
+
export function applyComponentProperty(target, name, value, path) {
|
|
9
|
+
if (target instanceof Component && applySkinnableProperty(target, name, value, path)) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
if (target instanceof Group && applyGroupProperty(target, name, value, path)) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
if (target instanceof Label && applyLabelProperty(target, name, value, path)) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
if (target instanceof Image && applyImageProperty(target, name, value, path)) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
if (target instanceof Rect && applyRectProperty(target, name, value, path)) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
return target instanceof Button && applyButtonProperty(target, name, value, path);
|
|
25
|
+
}
|
|
26
|
+
function applySkinnableProperty(target, name, value, path) {
|
|
27
|
+
switch (name) {
|
|
28
|
+
case 'currentState':
|
|
29
|
+
target.currentState = requireString(value, path);
|
|
30
|
+
return true;
|
|
31
|
+
case 'enabled':
|
|
32
|
+
target.enabled = requireBoolean(value, path);
|
|
33
|
+
return true;
|
|
34
|
+
case 'hostComponentKey':
|
|
35
|
+
target.hostComponentKey = requireString(value, path);
|
|
36
|
+
return true;
|
|
37
|
+
case 'skinName':
|
|
38
|
+
target.skinName = requireString(value, path);
|
|
39
|
+
return true;
|
|
40
|
+
default:
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function applyGroupProperty(target, name, value, path) {
|
|
45
|
+
switch (name) {
|
|
46
|
+
case 'currentState':
|
|
47
|
+
target.currentState = requireString(value, path);
|
|
48
|
+
return true;
|
|
49
|
+
case 'layout':
|
|
50
|
+
target.layout = createLayout(value, path);
|
|
51
|
+
return true;
|
|
52
|
+
case 'scrollEnabled':
|
|
53
|
+
target.scrollEnabled = requireBoolean(value, path);
|
|
54
|
+
return true;
|
|
55
|
+
case 'scrollH':
|
|
56
|
+
target.scrollH = requireNumber(value, path);
|
|
57
|
+
return true;
|
|
58
|
+
case 'scrollV':
|
|
59
|
+
target.scrollV = requireNumber(value, path);
|
|
60
|
+
return true;
|
|
61
|
+
case 'touchThrough':
|
|
62
|
+
target.touchThrough = requireBoolean(value, path);
|
|
63
|
+
return true;
|
|
64
|
+
default:
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function applyLabelProperty(target, name, value, path) {
|
|
69
|
+
switch (name) {
|
|
70
|
+
case 'bold':
|
|
71
|
+
target.bold = requireBoolean(value, path);
|
|
72
|
+
return true;
|
|
73
|
+
case 'displayAsPassword':
|
|
74
|
+
target.displayAsPassword = requireBoolean(value, path);
|
|
75
|
+
return true;
|
|
76
|
+
case 'fontFamily':
|
|
77
|
+
target.fontFamily = requireString(value, path);
|
|
78
|
+
return true;
|
|
79
|
+
case 'italic':
|
|
80
|
+
target.italic = requireBoolean(value, path);
|
|
81
|
+
return true;
|
|
82
|
+
case 'lineSpacing':
|
|
83
|
+
target.lineSpacing = requireNumber(value, path);
|
|
84
|
+
return true;
|
|
85
|
+
case 'maxChars':
|
|
86
|
+
target.maxChars = requireNumber(value, path);
|
|
87
|
+
return true;
|
|
88
|
+
case 'multiline':
|
|
89
|
+
target.multiline = requireBoolean(value, path);
|
|
90
|
+
return true;
|
|
91
|
+
case 'size':
|
|
92
|
+
target.size = requireNumber(value, path);
|
|
93
|
+
return true;
|
|
94
|
+
case 'stroke':
|
|
95
|
+
target.stroke = requireNumber(value, path);
|
|
96
|
+
return true;
|
|
97
|
+
case 'strokeColor':
|
|
98
|
+
target.strokeColor = requireNumber(value, path);
|
|
99
|
+
return true;
|
|
100
|
+
case 'text':
|
|
101
|
+
target.text = requireString(value, path);
|
|
102
|
+
return true;
|
|
103
|
+
case 'textAlign':
|
|
104
|
+
target.textAlign = requireString(value, path);
|
|
105
|
+
return true;
|
|
106
|
+
case 'textColor':
|
|
107
|
+
target.textColor = requireNumber(value, path);
|
|
108
|
+
return true;
|
|
109
|
+
case 'verticalAlign':
|
|
110
|
+
target.verticalAlign = requireString(value, path);
|
|
111
|
+
return true;
|
|
112
|
+
case 'wordWrap':
|
|
113
|
+
target.wordWrap = requireBoolean(value, path);
|
|
114
|
+
return true;
|
|
115
|
+
default:
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function applyImageProperty(target, name, value, path) {
|
|
120
|
+
switch (name) {
|
|
121
|
+
case 'fillMode':
|
|
122
|
+
target.fillMode = requireFillMode(value, path);
|
|
123
|
+
return true;
|
|
124
|
+
case 'scale9Grid':
|
|
125
|
+
target.scale9Grid = createRectangle(value, path);
|
|
126
|
+
return true;
|
|
127
|
+
case 'smoothing':
|
|
128
|
+
target.smoothing = requireBoolean(value, path);
|
|
129
|
+
return true;
|
|
130
|
+
case 'source':
|
|
131
|
+
target.source = requireString(value, path);
|
|
132
|
+
return true;
|
|
133
|
+
default:
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function applyRectProperty(target, name, value, path) {
|
|
138
|
+
switch (name) {
|
|
139
|
+
case 'ellipseHeight':
|
|
140
|
+
target.ellipseHeight = requireNumber(value, path);
|
|
141
|
+
return true;
|
|
142
|
+
case 'ellipseWidth':
|
|
143
|
+
target.ellipseWidth = requireNumber(value, path);
|
|
144
|
+
return true;
|
|
145
|
+
case 'fillAlpha':
|
|
146
|
+
target.fillAlpha = requireNumber(value, path);
|
|
147
|
+
return true;
|
|
148
|
+
case 'fillColor':
|
|
149
|
+
target.fillColor = requireNumber(value, path);
|
|
150
|
+
return true;
|
|
151
|
+
case 'strokeAlpha':
|
|
152
|
+
target.strokeAlpha = requireNumber(value, path);
|
|
153
|
+
return true;
|
|
154
|
+
case 'strokeColor':
|
|
155
|
+
target.strokeColor = requireNumber(value, path);
|
|
156
|
+
return true;
|
|
157
|
+
case 'strokeWeight':
|
|
158
|
+
target.strokeWeight = requireNumber(value, path);
|
|
159
|
+
return true;
|
|
160
|
+
default:
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
function applyButtonProperty(target, name, value, path) {
|
|
165
|
+
switch (name) {
|
|
166
|
+
case 'icon':
|
|
167
|
+
target.icon = requireString(value, path);
|
|
168
|
+
return true;
|
|
169
|
+
case 'label':
|
|
170
|
+
target.label = requireString(value, path);
|
|
171
|
+
return true;
|
|
172
|
+
case 'selected':
|
|
173
|
+
target.selected = requireBoolean(value, path);
|
|
174
|
+
return true;
|
|
175
|
+
case 'toggle':
|
|
176
|
+
target.toggle = requireBoolean(value, path);
|
|
177
|
+
return true;
|
|
178
|
+
default:
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function requireBoolean(value, path) {
|
|
183
|
+
if (typeof value === 'boolean')
|
|
184
|
+
return value;
|
|
185
|
+
throw invalidValue('boolean', path);
|
|
186
|
+
}
|
|
187
|
+
function requireNumber(value, path) {
|
|
188
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
189
|
+
return value;
|
|
190
|
+
throw invalidValue('number', path);
|
|
191
|
+
}
|
|
192
|
+
function requireString(value, path) {
|
|
193
|
+
if (typeof value === 'string')
|
|
194
|
+
return value;
|
|
195
|
+
throw invalidValue('string', path);
|
|
196
|
+
}
|
|
197
|
+
function requireFillMode(value, path) {
|
|
198
|
+
if (value === 'clip' || value === 'repeat' || value === 'scale')
|
|
199
|
+
return value;
|
|
200
|
+
throw invalidValue('clip, repeat, or scale', path);
|
|
201
|
+
}
|
|
202
|
+
function invalidValue(type, path) {
|
|
203
|
+
return new KurotUIRuntimeError('invalid-property', `Runtime property must be ${type}.`, path);
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=applyComponentProperties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applyComponentProperties.js","sourceRoot":"","sources":["../../../src/kurot/run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AC9E,MAAM,YAAY,CAAC,wBAAwB,EAAE,IAAI,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,YAAY,CAAC,IAAY,EAAE,IAAY;IAC/C,OAAO,IAAI,mBAAmB,CAC7B,kBAAkB,EAClB,4BAA4B,IAAI,GAAG,EACnC,IAAI,CACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DisplayObject } from '@kurot/core';
|
|
2
|
+
import type { UIPropertyValue } from '@kurot/ui-document';
|
|
3
|
+
/**
|
|
4
|
+
* Applies one inherited display or UI-layout property when recognized.
|
|
5
|
+
*/
|
|
6
|
+
export declare function applyDisplayProperty(target: DisplayObject, name: string, value: UIPropertyValue, path: string): boolean;
|
|
7
|
+
//# sourceMappingURL=applyDisplayProperties.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applyDisplayProperties.d.ts","sourceRoot":"","sources":["../../../src/kurot/runtime/applyDisplayProperties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA0B,MAAM,aAAa,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI1D;;GAEG;AACH,wBAAgB,oBAAoB,CACnC,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,MAAM,GACV,OAAO,CAiET"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { DisplayObjectContainer } from '@kurot/core';
|
|
2
|
+
import { isUIComponent } from '@kurot/ui';
|
|
3
|
+
import { KurotUIRuntimeError } from './KurotUIRuntimeError.js';
|
|
4
|
+
/**
|
|
5
|
+
* Applies one inherited display or UI-layout property when recognized.
|
|
6
|
+
*/
|
|
7
|
+
export function applyDisplayProperty(target, name, value, path) {
|
|
8
|
+
switch (name) {
|
|
9
|
+
case 'alpha':
|
|
10
|
+
target.alpha = requireNumber(value, path);
|
|
11
|
+
return true;
|
|
12
|
+
case 'anchorOffsetX':
|
|
13
|
+
target.anchorOffsetX = requireNumber(value, path);
|
|
14
|
+
return true;
|
|
15
|
+
case 'anchorOffsetY':
|
|
16
|
+
target.anchorOffsetY = requireNumber(value, path);
|
|
17
|
+
return true;
|
|
18
|
+
case 'blendMode':
|
|
19
|
+
target.blendMode = requireString(value, path);
|
|
20
|
+
return true;
|
|
21
|
+
case 'cacheAsBitmap':
|
|
22
|
+
target.cacheAsBitmap = requireBoolean(value, path);
|
|
23
|
+
return true;
|
|
24
|
+
case 'height':
|
|
25
|
+
target.height = requireNumber(value, path);
|
|
26
|
+
return true;
|
|
27
|
+
case 'name':
|
|
28
|
+
target.name = requireString(value, path);
|
|
29
|
+
return true;
|
|
30
|
+
case 'rotation':
|
|
31
|
+
target.rotation = requireNumber(value, path);
|
|
32
|
+
return true;
|
|
33
|
+
case 'scaleX':
|
|
34
|
+
target.scaleX = requireNumber(value, path);
|
|
35
|
+
return true;
|
|
36
|
+
case 'scaleY':
|
|
37
|
+
target.scaleY = requireNumber(value, path);
|
|
38
|
+
return true;
|
|
39
|
+
case 'skewX':
|
|
40
|
+
target.skewX = requireNumber(value, path);
|
|
41
|
+
return true;
|
|
42
|
+
case 'skewY':
|
|
43
|
+
target.skewY = requireNumber(value, path);
|
|
44
|
+
return true;
|
|
45
|
+
case 'sortableChildren':
|
|
46
|
+
target.sortableChildren = requireBoolean(value, path);
|
|
47
|
+
return true;
|
|
48
|
+
case 'tint':
|
|
49
|
+
target.tint = requireNumber(value, path);
|
|
50
|
+
return true;
|
|
51
|
+
case 'touchEnabled':
|
|
52
|
+
target.touchEnabled = requireBoolean(value, path);
|
|
53
|
+
return true;
|
|
54
|
+
case 'visible':
|
|
55
|
+
target.visible = requireBoolean(value, path);
|
|
56
|
+
return true;
|
|
57
|
+
case 'width':
|
|
58
|
+
target.width = requireNumber(value, path);
|
|
59
|
+
return true;
|
|
60
|
+
case 'x':
|
|
61
|
+
target.x = requireNumber(value, path);
|
|
62
|
+
return true;
|
|
63
|
+
case 'y':
|
|
64
|
+
target.y = requireNumber(value, path);
|
|
65
|
+
return true;
|
|
66
|
+
case 'zIndex':
|
|
67
|
+
target.zIndex = requireNumber(value, path);
|
|
68
|
+
return true;
|
|
69
|
+
default:
|
|
70
|
+
return applyUIProperty(target, name, value, path);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function applyUIProperty(target, name, value, path) {
|
|
74
|
+
if (!isUIComponent(target))
|
|
75
|
+
return false;
|
|
76
|
+
switch (name) {
|
|
77
|
+
case 'bottom':
|
|
78
|
+
target.bottom = requireConstraint(value, path);
|
|
79
|
+
return true;
|
|
80
|
+
case 'horizontalCenter':
|
|
81
|
+
target.horizontalCenter = requireConstraint(value, path);
|
|
82
|
+
return true;
|
|
83
|
+
case 'includeInLayout':
|
|
84
|
+
target.includeInLayout = requireBoolean(value, path);
|
|
85
|
+
return true;
|
|
86
|
+
case 'isRenderGroup':
|
|
87
|
+
requireContainer(target, path).isRenderGroup = requireBoolean(value, path);
|
|
88
|
+
return true;
|
|
89
|
+
case 'left':
|
|
90
|
+
target.left = requireConstraint(value, path);
|
|
91
|
+
return true;
|
|
92
|
+
case 'maxHeight':
|
|
93
|
+
target.maxHeight = requireNumber(value, path);
|
|
94
|
+
return true;
|
|
95
|
+
case 'maxWidth':
|
|
96
|
+
target.maxWidth = requireNumber(value, path);
|
|
97
|
+
return true;
|
|
98
|
+
case 'minHeight':
|
|
99
|
+
target.minHeight = requireNumber(value, path);
|
|
100
|
+
return true;
|
|
101
|
+
case 'minWidth':
|
|
102
|
+
target.minWidth = requireNumber(value, path);
|
|
103
|
+
return true;
|
|
104
|
+
case 'percentHeight':
|
|
105
|
+
target.percentHeight = requireNumber(value, path);
|
|
106
|
+
return true;
|
|
107
|
+
case 'percentWidth':
|
|
108
|
+
target.percentWidth = requireNumber(value, path);
|
|
109
|
+
return true;
|
|
110
|
+
case 'right':
|
|
111
|
+
target.right = requireConstraint(value, path);
|
|
112
|
+
return true;
|
|
113
|
+
case 'top':
|
|
114
|
+
target.top = requireConstraint(value, path);
|
|
115
|
+
return true;
|
|
116
|
+
case 'touchChildren':
|
|
117
|
+
requireContainer(target, path).touchChildren = requireBoolean(value, path);
|
|
118
|
+
return true;
|
|
119
|
+
case 'verticalCenter':
|
|
120
|
+
target.verticalCenter = requireConstraint(value, path);
|
|
121
|
+
return true;
|
|
122
|
+
default:
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function requireContainer(target, path) {
|
|
127
|
+
if (target instanceof DisplayObjectContainer)
|
|
128
|
+
return target;
|
|
129
|
+
throw new KurotUIRuntimeError('invalid-property', 'Property requires a display-object container.', path);
|
|
130
|
+
}
|
|
131
|
+
function requireBoolean(value, path) {
|
|
132
|
+
if (typeof value === 'boolean')
|
|
133
|
+
return value;
|
|
134
|
+
throw invalidValue('boolean', path);
|
|
135
|
+
}
|
|
136
|
+
function requireConstraint(value, path) {
|
|
137
|
+
if (typeof value === 'number' || typeof value === 'string')
|
|
138
|
+
return value;
|
|
139
|
+
throw invalidValue('number or string', path);
|
|
140
|
+
}
|
|
141
|
+
function requireNumber(value, path) {
|
|
142
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
143
|
+
return value;
|
|
144
|
+
throw invalidValue('number', path);
|
|
145
|
+
}
|
|
146
|
+
function requireString(value, path) {
|
|
147
|
+
if (typeof value === 'string')
|
|
148
|
+
return value;
|
|
149
|
+
throw invalidValue('string', path);
|
|
150
|
+
}
|
|
151
|
+
function invalidValue(type, path) {
|
|
152
|
+
return new KurotUIRuntimeError('invalid-property', `Runtime property must be ${type}.`, path);
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=applyDisplayProperties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applyDisplayProperties.js","sourceRoot":"","sources":["../../../src/kurot/runtime/applyDisplayProperties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,sB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,KAAK,CAAC;IAC7C,MAAM,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAsB,EAAE,IAAY;IAC9D,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACzE,MAAM,YAAY,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,aAAa,CAAC,KAAsB,EAAE,IAAY;IAC1D,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACtE,MAAM,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,aAAa,CAAC,KAAsB,EAAE,IAAY;IAC1D,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,MAAM,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,YAAY,CAAC,IAAY,EAAE,IAAY;IAC/C,OAAO,IAAI,mBAAmB,CAC7B,kBAAkB,EAClB,4BAA4B,IAAI,GAAG,EACnC,IAAI,CACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DisplayObject } from '@kurot/core';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the built-in factory for one canonical Kurot UI type.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getBuiltInFactory(type: string): (() => DisplayObject) | undefined;
|
|
6
|
+
//# sourceMappingURL=componentFactories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentFactories.d.ts","sourceRoot":"","sources":["../../../src/kurot/runtime/componentFactories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAWjD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,MAAM,aAAa,CAAC,GAAG,SAAS,CAEjF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Button, Group, Image, Label, Rect } from '@kurot/ui';
|
|
2
|
+
const BUILT_IN_FACTORIES = {
|
|
3
|
+
'kui.Button': () => new Button(),
|
|
4
|
+
'kui.Group': () => new Group(),
|
|
5
|
+
'kui.Image': () => new Image(),
|
|
6
|
+
'kui.Label': () => new Label(),
|
|
7
|
+
'kui.Rect': () => new Rect(),
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Returns the built-in factory for one canonical Kurot UI type.
|
|
11
|
+
*/
|
|
12
|
+
export function getBuiltInFactory(type) {
|
|
13
|
+
return BUILT_IN_FACTORIES[type];
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=componentFactories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentFactories.js","sourceRoot":"","sources":["../../../src/kurot/runtime/componentFactories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE9D,MAAM,kBAAkB,GAAkD;IACzE,YAAY,EAAE,GAAG,EAAE,CAAC,IAAI,MAAM,EAAE;IAChC,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,KAAK,EAAE;IAC9B,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,KAAK,EAAE;IAC9B,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,KAAK,EAAE;IAC9B,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC7C,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UIDocument } from '@kurot/ui-document';
|
|
2
|
+
import type { CreateKurotUIOptions, KurotUICreationResult } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Validates and materializes a semantic UI document into Kurot display objects.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createKurotUI(document: UIDocument, options?: CreateKurotUIOptions): KurotUICreationResult;
|
|
7
|
+
//# sourceMappingURL=createKurotUI.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createKurotUI.d.ts","sourceRoot":"","sources":["../../../src/kurot/runtime/createKurotUI.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAU,MAAM,oBAAoB,CAAC;AAK7D,OAAO,KAAK,EACX,oBAAoB,EAGpB,qBAAqB,EACrB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAgB,aAAa,CAC5B,QAAQ,EAAE,UAAU,EACpB,OAAO,GAAE,oBAAyB,GAChC,qBAAqB,CA4BvB"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Group } from '@kurot/ui';
|
|
2
|
+
import { createKurotUIFoundationRegistry, validateUIDocument, validateUIDocumentComponents, } from '@kurot/ui-document';
|
|
3
|
+
import { applyComponentProperty } from './applyComponentProperties.js';
|
|
4
|
+
import { applyDisplayProperty } from './applyDisplayProperties.js';
|
|
5
|
+
import { getBuiltInFactory } from './componentFactories.js';
|
|
6
|
+
import { KurotUIRuntimeError } from './KurotUIRuntimeError.js';
|
|
7
|
+
/**
|
|
8
|
+
* Validates and materializes a semantic UI document into Kurot display objects.
|
|
9
|
+
*/
|
|
10
|
+
export function createKurotUI(document, options = {}) {
|
|
11
|
+
const documentDiagnostics = validateUIDocument(document);
|
|
12
|
+
if (documentDiagnostics.length > 0) {
|
|
13
|
+
throw new KurotUIRuntimeError('invalid-document', 'UIDocument failed structural validation.', '$', documentDiagnostics);
|
|
14
|
+
}
|
|
15
|
+
const registry = options.registry ?? createKurotUIFoundationRegistry();
|
|
16
|
+
const componentDiagnostics = validateUIDocumentComponents(document, registry);
|
|
17
|
+
if (componentDiagnostics.length > 0) {
|
|
18
|
+
throw new KurotUIRuntimeError('invalid-document', 'UIDocument failed component validation.', '$', componentDiagnostics);
|
|
19
|
+
}
|
|
20
|
+
const context = {
|
|
21
|
+
adapters: options.adapters ?? {},
|
|
22
|
+
instances: new Map(),
|
|
23
|
+
};
|
|
24
|
+
const root = createNode(document.root, '$.root', context);
|
|
25
|
+
return Object.freeze({ root, instances: context.instances });
|
|
26
|
+
}
|
|
27
|
+
function createNode(node, path, context) {
|
|
28
|
+
const adapter = context.adapters[node.type];
|
|
29
|
+
const instance = createInstance(node, path, adapter);
|
|
30
|
+
context.instances.set(node.id, instance);
|
|
31
|
+
for (const name of Object.keys(node.properties).sort()) {
|
|
32
|
+
const value = node.properties[name];
|
|
33
|
+
const propertyPath = `${path}.properties.${name}`;
|
|
34
|
+
const handled = applyDisplayProperty(instance, name, value, propertyPath) ||
|
|
35
|
+
applyComponentProperty(instance, name, value, propertyPath) ||
|
|
36
|
+
adapter?.applyProperty?.(instance, name, value, propertyPath) === true;
|
|
37
|
+
if (!handled) {
|
|
38
|
+
throw new KurotUIRuntimeError('invalid-property', `Runtime property "${name}" is not supported by ${node.type}.`, propertyPath);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
for (let index = 0; index < node.children.length; index++) {
|
|
42
|
+
const childPath = `${path}.children[${index}]`;
|
|
43
|
+
const child = createNode(node.children[index], childPath, context);
|
|
44
|
+
appendChild(instance, child, node.type, childPath, adapter);
|
|
45
|
+
}
|
|
46
|
+
return instance;
|
|
47
|
+
}
|
|
48
|
+
function createInstance(node, path, adapter) {
|
|
49
|
+
const factory = adapter?.create ?? getBuiltInFactory(node.type);
|
|
50
|
+
if (!factory) {
|
|
51
|
+
throw new KurotUIRuntimeError('unsupported-component', `No runtime adapter is registered for component type "${node.type}".`, `${path}.type`);
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
return factory();
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
const detail = error instanceof Error ? ` ${error.message}` : '';
|
|
58
|
+
throw new KurotUIRuntimeError('component-construction-failed', `Failed to construct component type "${node.type}".${detail}`, `${path}.type`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function appendChild(parent, child, parentType, path, adapter) {
|
|
62
|
+
if (adapter?.appendChild) {
|
|
63
|
+
adapter.appendChild(parent, child, path);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (parent instanceof Group) {
|
|
67
|
+
parent.addChild(child);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
throw new KurotUIRuntimeError('unsupported-children', `Runtime component "${parentType}" cannot attach document children.`, path);
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=createKurotUI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createKurotUI.js","sourceRoot":"","sources":["../../../src/kurot/runtime/createKurotUI.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EACN,+BAA+B,EAC/B,kBAAkB,EAClB,4BAA4B,GAC5B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAQ/D;;GAEG;AACH,MAAM,UAAU,aAAa,CAC5B,QAAoB,EACpB,UAAgC,EAAE;IAElC,MAAM,mBAAmB,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACzD,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,mBAAmB,CAC5B,kBA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CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,MAAM,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,MAAM,IAAI,mBAAmB,CAC5B,+BAA+B,EAC/B,uCAAuC,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,EAC7D,GAAG,IAAI,OAAO,CACd,CAAC;IACH,CAAC;AACF,CAAC;AAED,SAAS,WAAW,CACnB,MAAqB,EACrB,KAAoB,EACpB,UAAkB,EAClB,IAAY,EACZ,OAAiC;IAEjC,IAAI,OAAO,EAAE,WAAW,EAAE,CAAC;QAC1B,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QACzC,OAAO;IACR,CAAC;IACD,IAAI,MAAM,YAAY,KAAK,EAAE,CAAC;QAC7B,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACvB,OAAO;IACR,CAAC;IACD,MAAM,IAAI,mBAAmB,CAC5B,sBAAsB,EACtB,sBAAsB,UAAU,oCAAoC,EACpE,IAAI,CACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UIPropertyValue } from '@kurot/ui-document';
|
|
2
|
+
import { LayoutBase } from '@kurot/ui';
|
|
3
|
+
/**
|
|
4
|
+
* Creates and configures a Kurot layout from a canonical layout descriptor.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createLayout(value: UIPropertyValue, path: string): LayoutBase;
|
|
7
|
+
//# sourceMappingURL=createLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createLayout.d.ts","sourceRoot":"","sources":["../../../src/kurot/runtime/createLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAGN,UAAU,EAIV,MAAM,WAAW,CAAC;AAGnB;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAmC7E"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { BasicLayout, HorizontalLayout, LinearLayoutBase, TileLayout, VerticalLayout, } from '@kurot/ui';
|
|
2
|
+
import { KurotUIRuntimeError } from './KurotUIRuntimeError.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates and configures a Kurot layout from a canonical layout descriptor.
|
|
5
|
+
*/
|
|
6
|
+
export function createLayout(value, path) {
|
|
7
|
+
const descriptor = requireObject(value, path);
|
|
8
|
+
assertExactKeys(descriptor, ['properties', 'type'], path);
|
|
9
|
+
const type = requireString(descriptor.type, `${path}.type`);
|
|
10
|
+
const properties = descriptor.properties === undefined
|
|
11
|
+
? {}
|
|
12
|
+
: requireObject(descriptor.properties, `${path}.properties`);
|
|
13
|
+
let layout;
|
|
14
|
+
switch (type) {
|
|
15
|
+
case 'kui.BasicLayout':
|
|
16
|
+
layout = new BasicLayout();
|
|
17
|
+
break;
|
|
18
|
+
case 'kui.HorizontalLayout':
|
|
19
|
+
layout = new HorizontalLayout();
|
|
20
|
+
break;
|
|
21
|
+
case 'kui.TileLayout':
|
|
22
|
+
layout = new TileLayout();
|
|
23
|
+
break;
|
|
24
|
+
case 'kui.VerticalLayout':
|
|
25
|
+
layout = new VerticalLayout();
|
|
26
|
+
break;
|
|
27
|
+
default:
|
|
28
|
+
throw new KurotUIRuntimeError('invalid-layout', `Layout type "${type}" is not supported.`, `${path}.type`);
|
|
29
|
+
}
|
|
30
|
+
for (const name of Object.keys(properties).sort()) {
|
|
31
|
+
applyLayoutProperty(layout, name, properties[name], `${path}.properties.${name}`);
|
|
32
|
+
}
|
|
33
|
+
return layout;
|
|
34
|
+
}
|
|
35
|
+
function applyLayoutProperty(layout, name, value, path) {
|
|
36
|
+
if (name === 'useVirtualLayout') {
|
|
37
|
+
const enabled = requireBoolean(value, path);
|
|
38
|
+
if (layout instanceof BasicLayout && enabled) {
|
|
39
|
+
throw new KurotUIRuntimeError('invalid-layout', 'BasicLayout does not support virtual layout.', path);
|
|
40
|
+
}
|
|
41
|
+
layout.useVirtualLayout = enabled;
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (layout instanceof LinearLayoutBase && applyLinearProperty(layout, name, value, path)) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (layout instanceof TileLayout && applyTileProperty(layout, name, value, path)) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
throw new KurotUIRuntimeError('invalid-layout', `Layout property "${name}" is not supported by ${layout.constructor.name}.`, path);
|
|
51
|
+
}
|
|
52
|
+
function applyLinearProperty(layout, name, value, path) {
|
|
53
|
+
switch (name) {
|
|
54
|
+
case 'gap':
|
|
55
|
+
layout.gap = requireNumber(value, path);
|
|
56
|
+
return true;
|
|
57
|
+
case 'horizontalAlign':
|
|
58
|
+
layout.horizontalAlign = requireEnum(value, ['left', 'center', 'right', 'justify', 'contentJustify'], path);
|
|
59
|
+
return true;
|
|
60
|
+
case 'paddingBottom':
|
|
61
|
+
layout.paddingBottom = requireNumber(value, path);
|
|
62
|
+
return true;
|
|
63
|
+
case 'paddingLeft':
|
|
64
|
+
layout.paddingLeft = requireNumber(value, path);
|
|
65
|
+
return true;
|
|
66
|
+
case 'paddingRight':
|
|
67
|
+
layout.paddingRight = requireNumber(value, path);
|
|
68
|
+
return true;
|
|
69
|
+
case 'paddingTop':
|
|
70
|
+
layout.paddingTop = requireNumber(value, path);
|
|
71
|
+
return true;
|
|
72
|
+
case 'verticalAlign':
|
|
73
|
+
layout.verticalAlign = requireEnum(value, ['top', 'middle', 'bottom', 'justify', 'contentJustify'], path);
|
|
74
|
+
return true;
|
|
75
|
+
default:
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function applyTileProperty(layout, name, value, path) {
|
|
80
|
+
switch (name) {
|
|
81
|
+
case 'columnAlign':
|
|
82
|
+
layout.columnAlign = requireEnum(value, ['left', 'justifyUsingGap', 'justifyUsingWidth'], path);
|
|
83
|
+
return true;
|
|
84
|
+
case 'columnWidth':
|
|
85
|
+
layout.columnWidth = requireNonNegativeNumber(value, path);
|
|
86
|
+
return true;
|
|
87
|
+
case 'horizontalAlign':
|
|
88
|
+
layout.horizontalAlign = requireEnum(value, ['left', 'center', 'right', 'justify', 'contentJustify'], path);
|
|
89
|
+
return true;
|
|
90
|
+
case 'horizontalGap':
|
|
91
|
+
layout.horizontalGap = requireNumber(value, path);
|
|
92
|
+
return true;
|
|
93
|
+
case 'orientation':
|
|
94
|
+
layout.orientation = requireEnum(value, ['rows', 'columns'], path);
|
|
95
|
+
return true;
|
|
96
|
+
case 'paddingBottom':
|
|
97
|
+
layout.paddingBottom = requireNumber(value, path);
|
|
98
|
+
return true;
|
|
99
|
+
case 'paddingLeft':
|
|
100
|
+
layout.paddingLeft = requireNumber(value, path);
|
|
101
|
+
return true;
|
|
102
|
+
case 'paddingRight':
|
|
103
|
+
layout.paddingRight = requireNumber(value, path);
|
|
104
|
+
return true;
|
|
105
|
+
case 'paddingTop':
|
|
106
|
+
layout.paddingTop = requireNumber(value, path);
|
|
107
|
+
return true;
|
|
108
|
+
case 'requestedColumnCount':
|
|
109
|
+
layout.requestedColumnCount = requireNonNegativeInteger(value, path);
|
|
110
|
+
return true;
|
|
111
|
+
case 'requestedRowCount':
|
|
112
|
+
layout.requestedRowCount = requireNonNegativeInteger(value, path);
|
|
113
|
+
return true;
|
|
114
|
+
case 'rowAlign':
|
|
115
|
+
layout.rowAlign = requireEnum(value, ['top', 'justifyUsingGap', 'justifyUsingHeight'], path);
|
|
116
|
+
return true;
|
|
117
|
+
case 'rowHeight':
|
|
118
|
+
layout.rowHeight = requireNonNegativeNumber(value, path);
|
|
119
|
+
return true;
|
|
120
|
+
case 'verticalAlign':
|
|
121
|
+
layout.verticalAlign = requireEnum(value, ['top', 'middle', 'bottom', 'justify', 'contentJustify'], path);
|
|
122
|
+
return true;
|
|
123
|
+
case 'verticalGap':
|
|
124
|
+
layout.verticalGap = requireNumber(value, path);
|
|
125
|
+
return true;
|
|
126
|
+
default:
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function assertExactKeys(value, keys, path) {
|
|
131
|
+
for (const key of Object.keys(value)) {
|
|
132
|
+
if (!keys.includes(key)) {
|
|
133
|
+
throw new KurotUIRuntimeError('invalid-layout', `Layout descriptor property "${key}" is not supported.`, `${path}.${key}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function requireObject(value, path) {
|
|
138
|
+
if (isPropertyObject(value))
|
|
139
|
+
return value;
|
|
140
|
+
throw new KurotUIRuntimeError('invalid-layout', 'Layout descriptor must be an object.', path);
|
|
141
|
+
}
|
|
142
|
+
function isPropertyObject(value) {
|
|
143
|
+
return typeof value === 'object' && !Array.isArray(value);
|
|
144
|
+
}
|
|
145
|
+
function requireBoolean(value, path) {
|
|
146
|
+
if (typeof value === 'boolean')
|
|
147
|
+
return value;
|
|
148
|
+
throw new KurotUIRuntimeError('invalid-layout', 'Layout property must be a boolean.', path);
|
|
149
|
+
}
|
|
150
|
+
function requireNumber(value, path) {
|
|
151
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
152
|
+
return value;
|
|
153
|
+
throw new KurotUIRuntimeError('invalid-layout', 'Layout property must be a number.', path);
|
|
154
|
+
}
|
|
155
|
+
function requireNonNegativeNumber(value, path) {
|
|
156
|
+
const number = requireNumber(value, path);
|
|
157
|
+
if (number >= 0)
|
|
158
|
+
return number;
|
|
159
|
+
throw new KurotUIRuntimeError('invalid-layout', 'Layout property must not be negative.', path);
|
|
160
|
+
}
|
|
161
|
+
function requireNonNegativeInteger(value, path) {
|
|
162
|
+
const number = requireNonNegativeNumber(value, path);
|
|
163
|
+
if (Number.isInteger(number))
|
|
164
|
+
return number;
|
|
165
|
+
throw new KurotUIRuntimeError('invalid-layout', 'Layout property must be an integer.', path);
|
|
166
|
+
}
|
|
167
|
+
function requireString(value, path) {
|
|
168
|
+
if (typeof value === 'string' && value.length > 0)
|
|
169
|
+
return value;
|
|
170
|
+
throw new KurotUIRuntimeError('invalid-layout', 'Layout type must be a non-empty string.', path);
|
|
171
|
+
}
|
|
172
|
+
function requireEnum(value, values, path) {
|
|
173
|
+
if (typeof value === 'string' && values.includes(value))
|
|
174
|
+
return value;
|
|
175
|
+
throw new KurotUIRuntimeError('invalid-layout', `Layout property must be one of: ${values.join(', ')}.`, path);
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=createLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createLayout.js","sourceRoot":"","sources":["../../../src/kurot/runtime/createLayout.ts"],"names":[],"mappings":"AACA,OAAO,EACN,WAAW,EACX,gBAAgB,EAEhB,gBAAgB,EAChB,UAAU,EACV,cAAc,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAAsB,EAAE,IAAY;IAChE,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC9C,eAAe,CAAC,UAAU,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;IAC1D,MAAM,IAAI,GAAG,aAAa,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,IAAI,OAAO,CAAC,CAAC;IAC5D,MAAM,UAAU,GACf,UAAU,CAAC,UAAU,KAAK,SAAS;QAClC,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,aAAa,CAAC,UAAU,CAAC,UAAU,EAAE,GAAG,IAAI,aAAa,CAAC,CAAC;IAE/D,IAAI,MAAkB,CAAC;IACvB,QAAQ,IAAI,EAAE,CAAC;QACd,KAAK,iB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;IACtE,MAAM,MAAM,GAAG,wBAAwB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACrD,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IAC5C,MAAM,IAAI,mBAAmB,CAAC,gBAAgB,EAAE,qCAAqC,EAAE,IAAI,CAAC,CAAC;AAC9F,CAAC;AAED,SAAS,aAAa,CAAC,KAAkC,EAAE,IAAY;IACtE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAChE,MAAM,IAAI,mBAAmB,CAAC,gBAAgB,EAAE,yCAAyC,EAAE,IAAI,CAAC,CAAC;AAClG,CAAC;AAED,SAAS,WAAW,CACnB,KAAsB,EACtB,MAAyB,EACzB,IAAY;IAEZ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACtE,MAAM,IAAI,mBAAmB,CAC5B,gBAAgB,EAChB,mCAAmC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EACvD,IAAI,CACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Rectangle } from '@kurot/core';
|
|
2
|
+
import type { UIPropertyValue } from '@kurot/ui-document';
|
|
3
|
+
/**
|
|
4
|
+
* Converts a canonical rectangle object into a Kurot Rectangle instance.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createRectangle(value: UIPropertyValue, path: string): Rectangle;
|
|
7
|
+
//# sourceMappingURL=createRectangle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createRectangle.d.ts","sourceRoot":"","sources":["../../../src/kurot/runtime/createRectangle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG5E;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAkB/E"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Rectangle } from '@kurot/core';
|
|
2
|
+
import { KurotUIRuntimeError } from './KurotUIRuntimeError.js';
|
|
3
|
+
/**
|
|
4
|
+
* Converts a canonical rectangle object into a Kurot Rectangle instance.
|
|
5
|
+
*/
|
|
6
|
+
export function createRectangle(value, path) {
|
|
7
|
+
const descriptor = requireObject(value, path);
|
|
8
|
+
const allowed = new Set(['height', 'width', 'x', 'y']);
|
|
9
|
+
for (const key of Object.keys(descriptor)) {
|
|
10
|
+
if (!allowed.has(key)) {
|
|
11
|
+
throw new KurotUIRuntimeError('invalid-rectangle', `Rectangle property "${key}" is not supported.`, `${path}.${key}`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return new Rectangle(requireNumber(descriptor.x, `${path}.x`), requireNumber(descriptor.y, `${path}.y`), requireNonNegativeNumber(descriptor.width, `${path}.width`), requireNonNegativeNumber(descriptor.height, `${path}.height`));
|
|
15
|
+
}
|
|
16
|
+
function requireObject(value, path) {
|
|
17
|
+
if (isPropertyObject(value))
|
|
18
|
+
return value;
|
|
19
|
+
throw new KurotUIRuntimeError('invalid-rectangle', 'Rectangle must be an object.', path);
|
|
20
|
+
}
|
|
21
|
+
function isPropertyObject(value) {
|
|
22
|
+
return typeof value === 'object' && !Array.isArray(value);
|
|
23
|
+
}
|
|
24
|
+
function requireNumber(value, path) {
|
|
25
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
26
|
+
return value;
|
|
27
|
+
throw new KurotUIRuntimeError('invalid-rectangle', 'Rectangle field must be a number.', path);
|
|
28
|
+
}
|
|
29
|
+
function requireNonNegativeNumber(value, path) {
|
|
30
|
+
const number = requireNumber(value, path);
|
|
31
|
+
if (number >= 0)
|
|
32
|
+
return number;
|
|
33
|
+
throw new KurotUIRuntimeError('invalid-rectangle', 'Rectangle size must not be negative.', path);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=createRectangle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createRectangle.js","sourceRoot":"","sources":["../../../src/kurot/runtime/createRectangle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAAsB,EAAE,IAAY;IACnE,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACvD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,mBAAmB,CAC5B,mBAAmB,EACnB,uBAAuB,GAAG,qBAAqB,EAC/C,GAAG,IAAI,IAAI,GAAG,EAAE,CAChB,CAAC;QACH,CAAC;IACF,CAAC;IACD,OAAO,IAAI,SAAS,CACnB,aAAa,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,IAAI,IAAI,CAAC,EACxC,aAAa,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,IAAI,IAAI,CAAC,EACxC,wBAAwB,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,IAAI,QAAQ,CAAC,EAC3D,wBAAwB,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,IAAI,SAAS,CAAC,CAC7D,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,KAAsB,EAAE,IAAY;IAC1D,IAAI,gBAAgB,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1C,MAAM,IAAI,mBAAmB,CAAC,mBAAmB,EAAE,8BAA8B,EAAE,IAAI,CAAC,CAAC;AAC1F,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAsB;IAC/C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,aAAa,CAAC,KAAkC,EAAE,IAAY;IACtE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACtE,MAAM,IAAI,mBAAmB,CAAC,mBAAmB,EAAE,mCAAmC,EAAE,IAAI,CAAC,CAAC;AAC/F,CAAC;AAED,SAAS,wBAAwB,CAChC,KAAkC,EAClC,IAAY;IAEZ,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC1C,IAAI,MAAM,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC;IAC/B,MAAM,IAAI,mBAAmB,CAC5B,mBAAmB,EACnB,sCAAsC,EACtC,IAAI,CACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { createKurotUI } from './createKurotUI.js';
|
|
2
|
+
export { KurotUIRuntimeError } from './KurotUIRuntimeError.js';
|
|
3
|
+
export type { CreateKurotUIOptions, KurotUIComponentAdapter, KurotUICreationResult, KurotUIRuntimeErrorCode, } from './types.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/kurot/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EACX,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/kurot/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { DisplayObject } from '@kurot/core';
|
|
2
|
+
import type { UIComponentRegistry, UIPropertyValue } from '@kurot/ui-document';
|
|
3
|
+
/**
|
|
4
|
+
* Stable runtime materialization failure categories.
|
|
5
|
+
*/
|
|
6
|
+
export type KurotUIRuntimeErrorCode = 'component-construction-failed' | 'invalid-document' | 'invalid-layout' | 'invalid-property' | 'invalid-rectangle' | 'unsupported-children' | 'unsupported-component';
|
|
7
|
+
/**
|
|
8
|
+
* Runtime hooks for one project-defined component type.
|
|
9
|
+
*/
|
|
10
|
+
export interface KurotUIComponentAdapter {
|
|
11
|
+
/**
|
|
12
|
+
* Creates a fresh display object for the matching document node.
|
|
13
|
+
*/
|
|
14
|
+
readonly create: () => DisplayObject;
|
|
15
|
+
/**
|
|
16
|
+
* Applies a project-defined property not handled by the built-in runtime.
|
|
17
|
+
* Return true when the property was consumed.
|
|
18
|
+
*/
|
|
19
|
+
readonly applyProperty?: (instance: DisplayObject, name: string, value: UIPropertyValue, path: string) => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Attaches one materialized child to a project-defined container.
|
|
22
|
+
*/
|
|
23
|
+
readonly appendChild?: (parent: DisplayObject, child: DisplayObject, path: string) => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Runtime customization supplied for one materialization operation.
|
|
27
|
+
*/
|
|
28
|
+
export interface CreateKurotUIOptions {
|
|
29
|
+
/**
|
|
30
|
+
* Complete semantic registry used to validate the document.
|
|
31
|
+
*/
|
|
32
|
+
readonly registry?: UIComponentRegistry;
|
|
33
|
+
/**
|
|
34
|
+
* Project-defined runtime adapters keyed by canonical component type.
|
|
35
|
+
*/
|
|
36
|
+
readonly adapters?: Readonly<Record<string, KurotUIComponentAdapter>>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Materialized display tree and stable node-to-instance lookup.
|
|
40
|
+
*/
|
|
41
|
+
export interface KurotUICreationResult {
|
|
42
|
+
/**
|
|
43
|
+
* Root display object ready to add to a Stage or another container.
|
|
44
|
+
*/
|
|
45
|
+
readonly root: DisplayObject;
|
|
46
|
+
/**
|
|
47
|
+
* Runtime instances keyed by UIDocument node ID.
|
|
48
|
+
*/
|
|
49
|
+
readonly instances: ReadonlyMap<string, DisplayObject>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Internal state shared while recursively materializing one document.
|
|
53
|
+
*/
|
|
54
|
+
export interface KurotUICreationContext {
|
|
55
|
+
readonly adapters: Readonly<Record<string, KurotUIComponentAdapter>>;
|
|
56
|
+
readonly instances: Map<string, DisplayObject>;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/kurot/runtime/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EACX,mBAAmB,EACnB,eAAe,EACf,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAChC,+BAA+B,GAC/B,kBAAkB,GAClB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,sBAAsB,GACtB,uBAAuB,CAAC;AAE3B;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,aAAa,CAAC;IAErC;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CACxB,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,eAAe,EACtB,IAAI,EAAE,MAAM,KACR,OAAO,CAAC;IAEb;;OAEG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,CACtB,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,aAAa,EACpB,IAAI,EAAE,MAAM,KACR,IAAI,CAAC;CACV;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAExC;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAC;CACtE;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CACvD;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAC;IACrE,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CAC/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/kurot/runtime/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kurot/ui-runtime",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Runtime materialization layer for validated Kurot UI documents",
|
|
5
|
+
"author": "Kelvin <kyia.x52@gmail.com>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"module": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist/**/*",
|
|
19
|
+
"LICENSE"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc --build",
|
|
23
|
+
"dev": "tsc --watch",
|
|
24
|
+
"clean": "rm -rf dist",
|
|
25
|
+
"test": "vitest run --config vitest.config.ts",
|
|
26
|
+
"test:watch": "vitest --config vitest.config.ts",
|
|
27
|
+
"preview": "vite --config vite.config.ts",
|
|
28
|
+
"build:preview": "vite --config vite.config.ts build",
|
|
29
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"@kurot/core": "^1.0.15",
|
|
33
|
+
"@kurot/ui": "^1.1.7",
|
|
34
|
+
"@kurot/ui-document": "^0.1.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@kurot/core": "^1.0.15",
|
|
38
|
+
"@kurot/ui": "^1.1.7",
|
|
39
|
+
"@kurot/ui-document": "^0.1.0",
|
|
40
|
+
"@types/node": "^22.0.0",
|
|
41
|
+
"happy-dom": "^20.8.9",
|
|
42
|
+
"typescript": "^5.6.0",
|
|
43
|
+
"vite": "^8.0.8",
|
|
44
|
+
"vitest": "^4.1.4"
|
|
45
|
+
},
|
|
46
|
+
"keywords": [
|
|
47
|
+
"kurot",
|
|
48
|
+
"ui",
|
|
49
|
+
"runtime",
|
|
50
|
+
"document-model",
|
|
51
|
+
"game-editor"
|
|
52
|
+
],
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "git+https://github.com/kurot-engine/kurot.git",
|
|
56
|
+
"directory": "packages/ui-runtime"
|
|
57
|
+
},
|
|
58
|
+
"packageManager": "pnpm@10.33.0",
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public"
|
|
61
|
+
}
|
|
62
|
+
}
|