@lynx-js/genui 0.0.1 → 0.0.3

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.
Files changed (236) hide show
  1. package/README.md +5 -9
  2. package/a2ui/AGENTS.md +167 -0
  3. package/a2ui/README.md +76 -780
  4. package/a2ui/README_zh.md +103 -0
  5. package/a2ui/dist/catalog/Button/{index.js → index.jsx} +12 -8
  6. package/a2ui/dist/catalog/Button/index.jsx.map +1 -0
  7. package/a2ui/dist/catalog/Card/{index.js → index.jsx} +5 -4
  8. package/a2ui/dist/catalog/Card/index.jsx.map +1 -0
  9. package/a2ui/dist/catalog/CheckBox/{index.js → index.jsx} +11 -6
  10. package/a2ui/dist/catalog/CheckBox/index.jsx.map +1 -0
  11. package/a2ui/dist/catalog/ChoicePicker/index.jsx +98 -0
  12. package/a2ui/dist/catalog/ChoicePicker/index.jsx.map +1 -0
  13. package/a2ui/dist/catalog/Column/{index.js → index.jsx} +10 -7
  14. package/a2ui/dist/catalog/Column/{index.js.map → index.jsx.map} +1 -1
  15. package/a2ui/dist/catalog/DateTimeInput/index.jsx +249 -0
  16. package/a2ui/dist/catalog/DateTimeInput/index.jsx.map +1 -0
  17. package/a2ui/dist/catalog/DateTimeInput/utils.d.ts +0 -1
  18. package/a2ui/dist/catalog/DateTimeInput/utils.js +0 -3
  19. package/a2ui/dist/catalog/DateTimeInput/utils.js.map +1 -1
  20. package/a2ui/dist/catalog/Divider/index.jsx +7 -0
  21. package/a2ui/dist/catalog/Divider/index.jsx.map +1 -0
  22. package/a2ui/dist/catalog/Icon/{index.js → index.jsx} +4 -3
  23. package/a2ui/dist/catalog/Icon/{index.js.map → index.jsx.map} +1 -1
  24. package/a2ui/dist/catalog/Image/{index.js → index.jsx} +2 -3
  25. package/a2ui/dist/catalog/Image/{index.js.map → index.jsx.map} +1 -1
  26. package/a2ui/dist/catalog/LineChart/{index.js → index.jsx} +50 -13
  27. package/a2ui/dist/catalog/LineChart/{index.js.map → index.jsx.map} +1 -1
  28. package/a2ui/dist/catalog/List/{index.js → index.jsx} +9 -6
  29. package/a2ui/dist/catalog/List/{index.js.map → index.jsx.map} +1 -1
  30. package/a2ui/dist/catalog/Loading/catalog.json +15 -0
  31. package/a2ui/dist/catalog/Loading/index.d.ts +10 -0
  32. package/a2ui/dist/catalog/Loading/index.jsx +11 -0
  33. package/a2ui/dist/catalog/Loading/index.jsx.map +1 -0
  34. package/a2ui/dist/catalog/Modal/{index.js → index.jsx} +18 -9
  35. package/a2ui/dist/catalog/Modal/index.jsx.map +1 -0
  36. package/a2ui/dist/catalog/PieChart/{index.js → index.jsx} +41 -15
  37. package/a2ui/dist/catalog/PieChart/{index.js.map → index.jsx.map} +1 -1
  38. package/a2ui/dist/catalog/RadioGroup/{index.js → index.jsx} +18 -5
  39. package/a2ui/dist/catalog/RadioGroup/index.jsx.map +1 -0
  40. package/a2ui/dist/catalog/Row/{index.js → index.jsx} +10 -7
  41. package/a2ui/dist/catalog/Row/index.jsx.map +1 -0
  42. package/a2ui/dist/catalog/Slider/{index.js → index.jsx} +22 -7
  43. package/a2ui/dist/catalog/Slider/{index.js.map → index.jsx.map} +1 -1
  44. package/a2ui/dist/catalog/Tabs/index.jsx +40 -0
  45. package/a2ui/dist/catalog/Tabs/index.jsx.map +1 -0
  46. package/a2ui/dist/catalog/Text/catalog.json +6 -2
  47. package/a2ui/dist/catalog/Text/index.d.ts +1 -1
  48. package/a2ui/dist/catalog/Text/index.jsx +16 -0
  49. package/a2ui/dist/catalog/Text/index.jsx.map +1 -0
  50. package/a2ui/dist/catalog/TextField/{index.js → index.jsx} +8 -5
  51. package/a2ui/dist/catalog/TextField/{index.js.map → index.jsx.map} +1 -1
  52. package/a2ui/dist/catalog/defineCatalog.d.ts +0 -4
  53. package/a2ui/dist/catalog/defineCatalog.js.map +1 -1
  54. package/a2ui/dist/catalog/index.d.ts +20 -19
  55. package/a2ui/dist/catalog/index.js +41 -21
  56. package/a2ui/dist/catalog/index.js.map +1 -1
  57. package/a2ui/dist/catalog.json +2548 -0
  58. package/a2ui/dist/index.d.ts +1 -1
  59. package/a2ui/dist/index.js +2 -2
  60. package/a2ui/dist/index.js.map +1 -1
  61. package/a2ui/dist/react/A2UI.d.ts +1 -1
  62. package/a2ui/dist/react/{A2UI.js → A2UI.jsx} +6 -5
  63. package/a2ui/dist/react/{A2UI.js.map → A2UI.jsx.map} +1 -1
  64. package/a2ui/dist/react/{A2UIProvider.js → A2UIProvider.jsx} +2 -3
  65. package/a2ui/dist/react/{A2UIProvider.js.map → A2UIProvider.jsx.map} +1 -1
  66. package/a2ui/dist/react/{A2UIRenderer.js → A2UIRenderer.jsx} +32 -32
  67. package/a2ui/dist/react/A2UIRenderer.jsx.map +1 -0
  68. package/a2ui/dist/react/index.d.ts +3 -3
  69. package/a2ui/dist/react/index.js +2 -2
  70. package/a2ui/dist/react/index.js.map +1 -1
  71. package/a2ui/dist/react/useA2UIContext.d.ts +1 -1
  72. package/a2ui/dist/react/useA2UIContext.js +1 -1
  73. package/a2ui/dist/react/useA2UIContext.js.map +1 -1
  74. package/a2ui/dist/tsconfig.build.tsbuildinfo +1 -1
  75. package/a2ui/docs/catalog-guide.md +401 -0
  76. package/a2ui/docs/catalog-guide_zh.md +373 -0
  77. package/a2ui/docs/overview.md +312 -0
  78. package/a2ui/docs/overview_zh.md +289 -0
  79. package/a2ui/docs/system-prompts.md +187 -0
  80. package/a2ui/docs/system-prompts_zh.md +187 -0
  81. package/a2ui/src/catalog/README.md +12 -0
  82. package/a2ui/src/catalog/index.ts +51 -0
  83. package/a2ui/src/catalog/readme_zh.md +11 -0
  84. package/a2ui/src/index.ts +115 -0
  85. package/a2ui/styles/catalog/Button.css +5 -5
  86. package/a2ui/styles/catalog/DateTimeInput.css +22 -30
  87. package/a2ui/styles/catalog/Loading.css +61 -0
  88. package/a2ui/styles/catalog/Modal.css +1 -0
  89. package/a2ui/styles/catalog/Text.css +2 -6
  90. package/a2ui-catalog-extractor/README.md +14 -7
  91. package/a2ui-catalog-extractor/dist/cli.d.ts +1 -0
  92. package/a2ui-catalog-extractor/dist/cli.js +15 -6
  93. package/a2ui-catalog-extractor/dist/cli.js.map +1 -1
  94. package/a2ui-catalog-extractor/dist/index.d.ts +9 -2
  95. package/a2ui-catalog-extractor/dist/index.js +52 -6
  96. package/a2ui-catalog-extractor/dist/index.js.map +1 -1
  97. package/a2ui-catalog-extractor/dist/tsconfig.build.tsbuildinfo +1 -1
  98. package/a2ui-catalog-extractor/skills/a2ui-catalog-extractor/SKILL.md +1 -1
  99. package/a2ui-prompt/README.md +3 -2
  100. package/a2ui-prompt/dist/index.d.ts +2 -0
  101. package/a2ui-prompt/dist/index.js +259 -184
  102. package/cli/README.md +26 -0
  103. package/cli/bin/cli.js +7 -265
  104. package/cli/dist/a2ui/create.d.ts +5 -0
  105. package/cli/dist/a2ui/create.js +178 -0
  106. package/cli/dist/a2ui/create.js.map +1 -0
  107. package/cli/dist/a2ui/index.d.ts +5 -0
  108. package/cli/dist/a2ui/index.js +170 -0
  109. package/cli/dist/a2ui/index.js.map +1 -0
  110. package/cli/dist/cli.d.ts +4 -0
  111. package/cli/dist/cli.js +40 -0
  112. package/cli/dist/cli.js.map +1 -0
  113. package/cli/dist/openui.d.ts +1 -0
  114. package/cli/dist/openui.js +21 -0
  115. package/cli/dist/openui.js.map +1 -0
  116. package/cli/dist/tsconfig.build.tsbuildinfo +1 -0
  117. package/cli/dist/utils.d.ts +2 -0
  118. package/cli/dist/utils.js +17 -0
  119. package/cli/dist/utils.js.map +1 -0
  120. package/cli/templates/default/lynx.config.ts +13 -0
  121. package/cli/templates/default/package.json +27 -0
  122. package/cli/templates/default/src/App.css +88 -0
  123. package/cli/templates/default/src/App.tsx +100 -0
  124. package/cli/templates/default/src/index.tsx +10 -0
  125. package/cli/templates/default/src/messages.ts +158 -0
  126. package/cli/templates/default/src/rspeedy-env.d.ts +14 -0
  127. package/cli/templates/default/src/tsconfig.json +17 -0
  128. package/cli/templates/default/tsconfig.json +15 -0
  129. package/cli/templates/default/tsconfig.node.json +16 -0
  130. package/dist/tsconfig.build.tsbuildinfo +1 -1
  131. package/openui/README.md +50 -46
  132. package/openui/dist/catalog/Action/{index.js → index.jsx} +1 -1
  133. package/openui/dist/catalog/Action/index.jsx.map +1 -0
  134. package/openui/dist/catalog/Button/index.d.ts +8 -8
  135. package/openui/dist/catalog/Button/{index.js → index.jsx} +28 -14
  136. package/openui/dist/catalog/Button/index.jsx.map +1 -0
  137. package/openui/dist/catalog/Card/index.d.ts +1 -1
  138. package/openui/dist/catalog/Card/{index.js → index.jsx} +5 -4
  139. package/openui/dist/catalog/Card/{index.js.map → index.jsx.map} +1 -1
  140. package/openui/dist/catalog/CardHeader/index.d.ts +1 -1
  141. package/openui/dist/catalog/CardHeader/index.jsx +20 -0
  142. package/openui/dist/catalog/CardHeader/index.jsx.map +1 -0
  143. package/openui/dist/catalog/CheckBox/index.d.ts +16 -0
  144. package/openui/dist/catalog/CheckBox/index.jsx +82 -0
  145. package/openui/dist/catalog/CheckBox/index.jsx.map +1 -0
  146. package/openui/dist/catalog/Icon/index.d.ts +44 -0
  147. package/openui/dist/catalog/Icon/index.jsx +66 -0
  148. package/openui/dist/catalog/Icon/index.jsx.map +1 -0
  149. package/openui/dist/catalog/Image/index.d.ts +19 -0
  150. package/openui/dist/catalog/Image/index.jsx +40 -0
  151. package/openui/dist/catalog/Image/index.jsx.map +1 -0
  152. package/openui/dist/catalog/Loading/index.d.ts +7 -0
  153. package/openui/dist/catalog/Loading/index.jsx +25 -0
  154. package/openui/dist/catalog/Loading/index.jsx.map +1 -0
  155. package/openui/dist/catalog/RadioGroup/index.d.ts +21 -0
  156. package/openui/dist/catalog/RadioGroup/index.jsx +99 -0
  157. package/openui/dist/catalog/RadioGroup/index.jsx.map +1 -0
  158. package/openui/dist/catalog/Separator/index.d.ts +1 -1
  159. package/openui/dist/catalog/Separator/{index.js → index.jsx} +3 -4
  160. package/openui/dist/catalog/Separator/index.jsx.map +1 -0
  161. package/openui/dist/catalog/Slider/index.d.ts +19 -0
  162. package/openui/dist/catalog/Slider/index.jsx +139 -0
  163. package/openui/dist/catalog/Slider/index.jsx.map +1 -0
  164. package/openui/dist/catalog/Stack/index.d.ts +1 -1
  165. package/openui/dist/catalog/Stack/{index.js → index.jsx} +3 -4
  166. package/openui/dist/catalog/Stack/{index.js.map → index.jsx.map} +1 -1
  167. package/openui/dist/catalog/Tag/index.d.ts +1 -1
  168. package/openui/dist/catalog/Tag/{index.js → index.jsx} +5 -4
  169. package/openui/dist/catalog/Tag/index.jsx.map +1 -0
  170. package/openui/dist/catalog/TextContent/index.d.ts +1 -1
  171. package/openui/dist/catalog/TextContent/{index.js → index.jsx} +5 -4
  172. package/openui/dist/catalog/TextContent/{index.js.map → index.jsx.map} +1 -1
  173. package/openui/dist/catalog/TextField/index.d.ts +23 -0
  174. package/openui/dist/catalog/TextField/index.jsx +132 -0
  175. package/openui/dist/catalog/TextField/index.jsx.map +1 -0
  176. package/openui/dist/catalog/index.d.ts +14 -7
  177. package/openui/dist/catalog/index.js +14 -7
  178. package/openui/dist/catalog/index.js.map +1 -1
  179. package/openui/dist/core/context.d.ts +17 -7
  180. package/openui/dist/core/{context.js → context.jsx} +8 -2
  181. package/openui/dist/core/context.jsx.map +1 -0
  182. package/openui/dist/core/createLibrary.d.ts +1 -1
  183. package/openui/dist/core/{createLibrary.js → createLibrary.jsx} +14 -3
  184. package/openui/dist/core/createLibrary.jsx.map +1 -0
  185. package/openui/dist/core/hooks/index.d.ts +1 -0
  186. package/openui/dist/core/hooks/index.js +1 -0
  187. package/openui/dist/core/hooks/index.js.map +1 -1
  188. package/openui/dist/core/hooks/useOpenUIState.d.ts +2 -2
  189. package/openui/dist/core/hooks/useOpenUIState.js +3 -1
  190. package/openui/dist/core/hooks/useOpenUIState.js.map +1 -1
  191. package/openui/dist/core/hooks/useStateField.js +1 -1
  192. package/openui/dist/core/hooks/useStateField.js.map +1 -1
  193. package/openui/dist/core/index.d.ts +13 -7
  194. package/openui/dist/core/index.js +7 -4
  195. package/openui/dist/core/index.js.map +1 -1
  196. package/openui/dist/core/{library.js → library.jsx} +1 -1
  197. package/openui/dist/core/library.jsx.map +1 -0
  198. package/openui/dist/core/renderer.css +527 -0
  199. package/openui/dist/core/renderer.d.ts +31 -4
  200. package/openui/dist/core/renderer.jsx +281 -0
  201. package/openui/dist/core/renderer.jsx.map +1 -0
  202. package/openui/dist/core/runtime/index.d.ts +1 -0
  203. package/openui/dist/core/runtime/index.js +5 -0
  204. package/openui/dist/core/runtime/index.js.map +1 -0
  205. package/openui/dist/core/runtime/reactive.d.ts +7 -0
  206. package/openui/dist/core/runtime/reactive.js +10 -0
  207. package/openui/dist/core/runtime/reactive.js.map +1 -0
  208. package/package.json +18 -8
  209. package/a2ui/dist/catalog/Button/index.js.map +0 -1
  210. package/a2ui/dist/catalog/Card/index.js.map +0 -1
  211. package/a2ui/dist/catalog/CheckBox/index.js.map +0 -1
  212. package/a2ui/dist/catalog/ChoicePicker/index.js +0 -66
  213. package/a2ui/dist/catalog/ChoicePicker/index.js.map +0 -1
  214. package/a2ui/dist/catalog/DateTimeInput/index.js +0 -147
  215. package/a2ui/dist/catalog/DateTimeInput/index.js.map +0 -1
  216. package/a2ui/dist/catalog/Divider/index.js +0 -8
  217. package/a2ui/dist/catalog/Divider/index.js.map +0 -1
  218. package/a2ui/dist/catalog/Modal/index.js.map +0 -1
  219. package/a2ui/dist/catalog/RadioGroup/index.js.map +0 -1
  220. package/a2ui/dist/catalog/Row/index.js.map +0 -1
  221. package/a2ui/dist/catalog/Tabs/index.js +0 -32
  222. package/a2ui/dist/catalog/Tabs/index.js.map +0 -1
  223. package/a2ui/dist/catalog/Text/index.js +0 -27
  224. package/a2ui/dist/catalog/Text/index.js.map +0 -1
  225. package/a2ui/dist/react/A2UIRenderer.js.map +0 -1
  226. package/openui/dist/catalog/Action/index.js.map +0 -1
  227. package/openui/dist/catalog/Button/index.js.map +0 -1
  228. package/openui/dist/catalog/CardHeader/index.js +0 -18
  229. package/openui/dist/catalog/CardHeader/index.js.map +0 -1
  230. package/openui/dist/catalog/Separator/index.js.map +0 -1
  231. package/openui/dist/catalog/Tag/index.js.map +0 -1
  232. package/openui/dist/core/context.js.map +0 -1
  233. package/openui/dist/core/createLibrary.js.map +0 -1
  234. package/openui/dist/core/library.js.map +0 -1
  235. package/openui/dist/core/renderer.js +0 -139
  236. package/openui/dist/core/renderer.js.map +0 -1
@@ -0,0 +1,88 @@
1
+ .page {
2
+ width: 100%;
3
+ min-height: 100vh;
4
+ padding: 10px 12px 16px;
5
+ display: flex;
6
+ flex-direction: column;
7
+ background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
8
+ box-sizing: border-box;
9
+ }
10
+
11
+ .Background {
12
+ position: fixed;
13
+ top: -50%;
14
+ left: -50%;
15
+ width: 200%;
16
+ height: 200%;
17
+ background:
18
+ radial-gradient(
19
+ circle at 30% 20%,
20
+ rgba(120, 80, 200, 0.3) 0%,
21
+ transparent 50%
22
+ ),
23
+ radial-gradient(
24
+ circle at 70% 80%,
25
+ rgba(80, 120, 200, 0.3) 0%,
26
+ transparent 50%
27
+ ),
28
+ radial-gradient(
29
+ circle at 50% 50%,
30
+ rgba(200, 80, 120, 0.2) 0%,
31
+ transparent 70%
32
+ );
33
+ pointer-events: none;
34
+ }
35
+
36
+ .A2UIApp {
37
+ min-height: 100vh;
38
+ display: flex;
39
+ flex-direction: column;
40
+ position: relative;
41
+ z-index: 10;
42
+ }
43
+
44
+ .AppContent {
45
+ flex: 1;
46
+ display: flex;
47
+ flex-direction: column;
48
+ align-items: center;
49
+ justify-content: center;
50
+ padding: 40px 20px;
51
+ }
52
+
53
+ .WelcomeScreen {
54
+ display: flex;
55
+ flex-direction: column;
56
+ align-items: center;
57
+ justify-content: center;
58
+ gap: 20px;
59
+ }
60
+
61
+ .Title {
62
+ font-size: 42px;
63
+ font-weight: 800;
64
+ color: #a5b4fc;
65
+ margin-bottom: 8px;
66
+ }
67
+
68
+ .Subtitle {
69
+ font-size: 16px;
70
+ font-weight: 400;
71
+ color: rgba(255, 255, 255, 0.6);
72
+ letter-spacing: 2px;
73
+ }
74
+
75
+ .StartButton {
76
+ margin-top: 40px;
77
+ padding: 18px 56px;
78
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
79
+ border-radius: 50px;
80
+ box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
81
+ }
82
+
83
+ .ButtonText {
84
+ color: #fff;
85
+ font-size: 18px;
86
+ font-weight: 600;
87
+ letter-spacing: 1px;
88
+ }
@@ -0,0 +1,100 @@
1
+ import { useState, useCallback } from '@lynx-js/react';
2
+ import { A2UI, createMessageStore, defineCatalog } from '@lynx-js/genui/a2ui';
3
+ import {
4
+ catalogManifests,
5
+ Text,
6
+ Button,
7
+ Card,
8
+ Column,
9
+ Row,
10
+ Image,
11
+ type CatalogComponent,
12
+ } from '@lynx-js/genui/a2ui/catalog';
13
+ import type {
14
+ ServerToClientMessage,
15
+ UserActionPayload,
16
+ } from '@lynx-js/genui/a2ui';
17
+ import {
18
+ initialMessages,
19
+ secondStageMessages,
20
+ thirdStageMessages,
21
+ finalStageMessages,
22
+ buttonClickMessages,
23
+ } from './messages';
24
+
25
+ import './App.css';
26
+
27
+ const store = createMessageStore();
28
+
29
+ const ALL_BUILTINS = defineCatalog([
30
+ [Text as CatalogComponent, catalogManifests.Text],
31
+ [Button as CatalogComponent, catalogManifests.Button],
32
+ [Card as CatalogComponent, catalogManifests.Card],
33
+ [Column as CatalogComponent, catalogManifests.Column],
34
+ [Row as CatalogComponent, catalogManifests.Row],
35
+ [Image as CatalogComponent, catalogManifests.Image],
36
+ ]).components;
37
+
38
+ const sleep = (ms: number) => {
39
+ return new Promise<void>((resolve) => {
40
+ setTimeout(resolve, ms);
41
+ });
42
+ };
43
+
44
+ export function App() {
45
+ const [showResponse, setShowResponse] = useState(false);
46
+
47
+ const streamMessages = useCallback(
48
+ async (messages: ServerToClientMessage[]) => {
49
+ for (const message of messages) {
50
+ store.push(message);
51
+ await sleep(1000);
52
+ }
53
+ },
54
+ [],
55
+ );
56
+
57
+ const startDemo = useCallback(async () => {
58
+ setShowResponse(true);
59
+ await streamMessages(initialMessages);
60
+ await streamMessages(secondStageMessages);
61
+ await streamMessages(thirdStageMessages);
62
+ await streamMessages(finalStageMessages);
63
+ }, [streamMessages]);
64
+
65
+ const handleAction = useCallback((action: UserActionPayload) => {
66
+ if (action?.name === 'button_click') {
67
+ buttonClickMessages.forEach(msg => {
68
+ store.push(msg);
69
+ });
70
+ }
71
+ }, []);
72
+
73
+ return (
74
+ <view className='A2UIApp'>
75
+ <view className='Background' />
76
+ <view className='AppContent'>
77
+ {!showResponse
78
+ ? (
79
+ <view className='WelcomeScreen'>
80
+ <text className='Title'>A2UI Demo</text>
81
+ <text className='Subtitle'>ReactLynx GenUI</text>
82
+ <view className='StartButton' bindtap={startDemo}>
83
+ <text className='ButtonText'>Start Demo</text>
84
+ </view>
85
+ </view>
86
+ )
87
+ : (
88
+ <A2UI
89
+ messageStore={store}
90
+ catalogs={ALL_BUILTINS}
91
+ wrapSurface={(children) => (
92
+ <view className='A2UISurface'>{children}</view>
93
+ )}
94
+ onAction={handleAction}
95
+ />
96
+ )}
97
+ </view>
98
+ </view>
99
+ );
100
+ }
@@ -0,0 +1,10 @@
1
+ import '@lynx-js/react/debug';
2
+ import { root } from '@lynx-js/react';
3
+
4
+ import { App } from './App.js';
5
+
6
+ root.render(<App />);
7
+
8
+ if (import.meta.webpackHot) {
9
+ import.meta.webpackHot.accept();
10
+ }
@@ -0,0 +1,158 @@
1
+ import type { ServerToClientMessage } from '@lynx-js/genui/a2ui';
2
+
3
+ export const initialMessages: ServerToClientMessage[] = [
4
+ {
5
+ version: 'v0.9',
6
+ createSurface: {
7
+ surfaceId: 'main',
8
+ catalogId: 'https://a2ui.org/specification/v0_9/basic_catalog.json',
9
+ },
10
+ },
11
+ {
12
+ version: 'v0.9',
13
+ updateComponents: {
14
+ surfaceId: 'main',
15
+ components: [
16
+ {
17
+ id: 'root-card',
18
+ component: 'Card',
19
+ variant: 'elevated',
20
+ child: 'content-column',
21
+ },
22
+ {
23
+ id: 'content-column',
24
+ component: 'Column',
25
+ children: [
26
+ 'loading-text',
27
+ ],
28
+ align: 'center',
29
+ },
30
+ {
31
+ id: 'loading-text',
32
+ component: 'Text',
33
+ text: 'Loading...',
34
+ variant: 'body',
35
+ },
36
+ ],
37
+ },
38
+ },
39
+ ];
40
+
41
+ export const secondStageMessages: ServerToClientMessage[] = [
42
+ {
43
+ version: 'v0.9',
44
+ updateComponents: {
45
+ surfaceId: 'main',
46
+ components: [
47
+ {
48
+ id: 'content-column',
49
+ component: 'Column',
50
+ children: [
51
+ 'title-text',
52
+ 'loading-text',
53
+ ],
54
+ align: 'center',
55
+ },
56
+ {
57
+ id: 'title-text',
58
+ component: 'Text',
59
+ text: 'Welcome to A2UI Demo',
60
+ variant: 'h1',
61
+ },
62
+ {
63
+ id: 'loading-text',
64
+ component: 'Text',
65
+ text: 'Loading more content...',
66
+ variant: 'body',
67
+ },
68
+ ],
69
+ },
70
+ },
71
+ ];
72
+
73
+ export const thirdStageMessages: ServerToClientMessage[] = [
74
+ {
75
+ version: 'v0.9',
76
+ updateComponents: {
77
+ surfaceId: 'main',
78
+ components: [
79
+ {
80
+ id: 'content-column',
81
+ component: 'Column',
82
+ children: [
83
+ 'title-text',
84
+ 'description-text',
85
+ 'loading-text',
86
+ ],
87
+ align: 'center',
88
+ },
89
+ {
90
+ id: 'description-text',
91
+ component: 'Text',
92
+ text: 'This is a ReactLynx A2UI demonstration',
93
+ variant: 'body',
94
+ },
95
+ {
96
+ id: 'loading-text',
97
+ component: 'Text',
98
+ text: 'Almost done...',
99
+ variant: 'body',
100
+ },
101
+ ],
102
+ },
103
+ },
104
+ ];
105
+
106
+ export const finalStageMessages: ServerToClientMessage[] = [
107
+ {
108
+ version: 'v0.9',
109
+ updateComponents: {
110
+ surfaceId: 'main',
111
+ components: [
112
+ {
113
+ id: 'content-column',
114
+ component: 'Column',
115
+ children: [
116
+ 'title-text',
117
+ 'description-text',
118
+ 'action-button',
119
+ ],
120
+ align: 'center',
121
+ },
122
+ {
123
+ id: 'action-button',
124
+ component: 'Button',
125
+ variant: 'primary',
126
+ child: 'button-text',
127
+ action: {
128
+ event: {
129
+ name: 'button_click',
130
+ context: { message: 'Hello from A2UI!' },
131
+ },
132
+ },
133
+ },
134
+ {
135
+ id: 'button-text',
136
+ component: 'Text',
137
+ text: 'Click Me',
138
+ },
139
+ ],
140
+ },
141
+ },
142
+ ];
143
+
144
+ export const buttonClickMessages: ServerToClientMessage[] = [
145
+ {
146
+ version: 'v0.9',
147
+ updateComponents: {
148
+ surfaceId: 'main',
149
+ components: [
150
+ {
151
+ id: 'button-text',
152
+ component: 'Text',
153
+ text: 'Clicked!',
154
+ },
155
+ ],
156
+ },
157
+ },
158
+ ];
@@ -0,0 +1,14 @@
1
+ /// <reference types="@lynx-js/rspeedy/client" />
2
+
3
+ declare module '@lynx-js/types' {
4
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
5
+ interface GlobalProps {
6
+ /**
7
+ * Define your global properties in this interface.
8
+ * These types will be accessible through `lynx.__globalProps`.
9
+ */
10
+ }
11
+ }
12
+
13
+ // This export makes the file a module
14
+ export {};
@@ -0,0 +1,17 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "composite": true,
5
+
6
+ "jsx": "react-jsx",
7
+ "jsxImportSource": "@lynx-js/react",
8
+
9
+ "module": "ESNext",
10
+ "moduleResolution": "Bundler",
11
+
12
+ "lib": ["es2015"],
13
+
14
+ "noEmit": true,
15
+ },
16
+ "include": ["./**/*.ts", "./**/*.tsx"],
17
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "strict": true,
4
+ "isolatedModules": true,
5
+ "verbatimModuleSyntax": true,
6
+
7
+ "esModuleInterop": true,
8
+ "skipLibCheck": true,
9
+ },
10
+ "references": [
11
+ { "path": "./tsconfig.node.json" },
12
+ { "path": "./src" },
13
+ ],
14
+ "files": [],
15
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "composite": true,
5
+
6
+ "module": "node16",
7
+ "moduleResolution": "node16",
8
+ "erasableSyntaxOnly": true,
9
+
10
+ "lib": ["es2023"],
11
+ "target": "es2022",
12
+
13
+ "noEmit": true,
14
+ },
15
+ "include": ["./lynx.config.ts"],
16
+ }