@lynx-js/web-core-wasm 0.0.2 → 0.0.4

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 (60) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/binary/client/client.d.ts +6 -8
  3. package/binary/client/client.js +21 -28
  4. package/binary/client/client_bg.wasm +0 -0
  5. package/binary/client/client_bg.wasm.d.ts +3 -4
  6. package/binary/client/client_debug.d.ts +32 -34
  7. package/binary/client/client_debug.js +21 -28
  8. package/binary/client/client_debug_bg.wasm +0 -0
  9. package/binary/client/client_debug_bg.wasm.d.ts +29 -30
  10. package/binary/encode/encode_bg.wasm +0 -0
  11. package/binary/encode/encode_debug_bg.wasm +0 -0
  12. package/binary/encode/encode_debug_bg.wasm.d.ts +1 -1
  13. package/binary/server/package.json +4 -0
  14. package/binary/server/server.d.ts +134 -0
  15. package/binary/server/server.js +839 -0
  16. package/binary/server/server_bg.wasm +0 -0
  17. package/binary/server/server_bg.wasm.d.ts +51 -0
  18. package/binary/server/server_debug.d.ts +134 -0
  19. package/binary/server/server_debug.js +839 -0
  20. package/binary/server/server_debug_bg.wasm +0 -0
  21. package/binary/server/server_debug_bg.wasm.d.ts +51 -0
  22. package/dist/client/decodeWorker/decode.worker.js +24 -45
  23. package/dist/client/mainthread/Background.js +1 -2
  24. package/dist/client/mainthread/LynxViewInstance.d.ts +2 -4
  25. package/dist/client/mainthread/LynxViewInstance.js +12 -34
  26. package/dist/client/mainthread/TemplateManager.d.ts +1 -0
  27. package/dist/client/mainthread/TemplateManager.js +14 -3
  28. package/dist/client/mainthread/elementAPIs/createElementAPI.js +2 -1
  29. package/dist/client/mainthread/utils/requestIdleCallback.d.ts +1 -0
  30. package/dist/client/mainthread/utils/requestIdleCallback.js +5 -0
  31. package/dist/client/wasm.d.ts +0 -1
  32. package/dist/client/wasm.js +0 -3
  33. package/dist/client_prod/static/js/async/web-core-main-chunk.js +1 -1
  34. package/dist/client_prod/static/js/async/web-core-template-loader-thread.js +4 -6
  35. package/dist/client_prod/static/js/async/web-elements.js +10 -10
  36. package/dist/client_prod/static/js/client.js +2 -2
  37. package/dist/client_prod/static/wasm/af9fb056.module.wasm +0 -0
  38. package/dist/common/decodeUtils.d.ts +1 -0
  39. package/dist/common/decodeUtils.js +41 -0
  40. package/dist/constants.d.ts +3 -2
  41. package/dist/constants.js +3 -2
  42. package/dist/encode/webEncoder.js +5 -3
  43. package/dist/server/createServerLynx.d.ts +3 -0
  44. package/dist/server/createServerLynx.js +40 -0
  45. package/dist/server/decode.d.ts +7 -0
  46. package/dist/server/decode.js +83 -0
  47. package/dist/server/deploy.d.ts +2 -0
  48. package/dist/server/deploy.js +61 -0
  49. package/dist/server/elementAPIs/createElementAPI.d.ts +13 -0
  50. package/dist/server/elementAPIs/createElementAPI.js +235 -0
  51. package/dist/server/elementAPIs/pureElementAPIs.d.ts +38 -0
  52. package/dist/server/elementAPIs/pureElementAPIs.js +112 -0
  53. package/dist/server/index.d.ts +4 -0
  54. package/dist/server/index.js +10 -0
  55. package/dist/server/wasm.d.ts +1 -0
  56. package/dist/server/wasm.js +7 -0
  57. package/dist/types/DecodedTemplate.d.ts +2 -0
  58. package/package.json +17 -12
  59. package/dist/client_prod/static/css/async/web-elements.css +0 -1
  60. package/dist/client_prod/static/wasm/a156b496.module.wasm +0 -0
@@ -0,0 +1,235 @@
1
+ /*
2
+ * Copyright 2025 The Lynx Authors. All rights reserved.
3
+ * Licensed under the Apache License Version 2.0 that can be found in the
4
+ * LICENSE file in the root directory of this source tree.
5
+ */
6
+ import { MainThreadServerContext, StyleSheetResource } from '../wasm.js';
7
+ import { LYNX_TAG_TO_HTML_TAG_MAP, uniqueIdSymbol, lynxDefaultDisplayLinearAttribute, lynxEntryNameAttribute, } from '../../constants.js';
8
+ import { __AddConfig, __AddDataset, __AddEvent, __ElementIsEqual, __FirstElement, __GetChildren, __GetComponentID, __GetConfig, __GetDataByKey, __GetDataset, __GetElementConfig, __GetElementUniqueID, __GetEvent, __GetEvents, __GetPageElement, __GetParent, __GetTemplateParts, __InsertElementBefore, __LastElement, __MarkPartElement, __MarkTemplateElement, __NextElement, __RemoveElement, __ReplaceElement, __ReplaceElements, __SetConfig, __SetDataset, __SetEvents, __SwapElement, __UpdateComponentID, __UpdateComponentInfo, __UpdateListCallbacks, getUniqueId, } from './pureElementAPIs.js';
9
+ export function createElementAPI(mtsBinding, styleInfo, viewAttributes, config) {
10
+ const wasmContext = new MainThreadServerContext(viewAttributes, config.enableCSSSelector);
11
+ if (styleInfo) {
12
+ const resource = new StyleSheetResource(styleInfo, undefined);
13
+ wasmContext.push_style_sheet(resource);
14
+ }
15
+ let pageElementId;
16
+ function getAttribute(element, key) {
17
+ return wasmContext.get_attribute(element[uniqueIdSymbol], key) || undefined;
18
+ }
19
+ const __SetCSSId = (elements, cssId, entryName) => {
20
+ const uniqueIds = elements.map((element) => element[uniqueIdSymbol]);
21
+ wasmContext.set_css_id(new Uint32Array(uniqueIds), cssId ?? 0, entryName);
22
+ };
23
+ const __SetClasses = (element, classname) => {
24
+ const el = element;
25
+ if (classname) {
26
+ wasmContext.set_attribute(el[uniqueIdSymbol], 'class', classname);
27
+ }
28
+ else {
29
+ wasmContext.remove_attribute(el[uniqueIdSymbol], 'class');
30
+ }
31
+ };
32
+ const __AddClass = (element, className) => {
33
+ const el = element;
34
+ wasmContext.add_class(el[uniqueIdSymbol], className);
35
+ };
36
+ return {
37
+ globalThisAPIs: {
38
+ // Pure/Throwing Methods
39
+ __GetID: ((element) => {
40
+ return getAttribute(element, 'id') ?? null;
41
+ }),
42
+ __GetTag: ((element) => {
43
+ const el = element;
44
+ const tag = wasmContext.get_tag(el[uniqueIdSymbol]) ?? '';
45
+ // Reverse-map HTML tag to Lynx tag (consistent with CSR `__GetTag` behavior)
46
+ for (const [lynxTag, htmlTag] of Object.entries(LYNX_TAG_TO_HTML_TAG_MAP)) {
47
+ if (tag === htmlTag) {
48
+ return lynxTag;
49
+ }
50
+ }
51
+ return tag;
52
+ }),
53
+ __GetAttributes: ((element) => {
54
+ const el = element;
55
+ return wasmContext.get_attributes(el[uniqueIdSymbol]);
56
+ }),
57
+ __GetAttributeByName: (element, name) => {
58
+ return getAttribute(element, name) ?? null;
59
+ },
60
+ __GetClasses: ((element) => {
61
+ const cls = getAttribute(element, 'class');
62
+ if (!cls)
63
+ return [];
64
+ return cls.split(/\s+/).filter((c) => c.length > 0);
65
+ }),
66
+ __GetParent,
67
+ __GetChildren,
68
+ __AddEvent,
69
+ __GetEvent,
70
+ __GetEvents,
71
+ __SetEvents,
72
+ __UpdateListCallbacks,
73
+ __GetConfig,
74
+ __SetConfig,
75
+ __GetElementConfig,
76
+ __GetComponentID,
77
+ __GetDataset,
78
+ __SetDataset,
79
+ __AddDataset,
80
+ __GetDataByKey,
81
+ __ElementIsEqual,
82
+ __GetElementUniqueID,
83
+ __FirstElement,
84
+ __LastElement,
85
+ __NextElement,
86
+ __RemoveElement,
87
+ __ReplaceElement,
88
+ __SwapElement,
89
+ __SetCSSId,
90
+ __SetClasses: config.enableCSSSelector
91
+ ? __SetClasses
92
+ : ((element, classname) => {
93
+ __SetClasses(element, classname);
94
+ const el = element;
95
+ wasmContext.update_css_og_style(el[uniqueIdSymbol], getAttribute(el, lynxEntryNameAttribute));
96
+ }),
97
+ __AddClass,
98
+ __AddConfig,
99
+ __UpdateComponentInfo,
100
+ __UpdateComponentID,
101
+ __MarkTemplateElement,
102
+ __MarkPartElement,
103
+ __GetTemplateParts,
104
+ __GetPageElement,
105
+ __InsertElementBefore,
106
+ __ReplaceElements,
107
+ // Context-Dependent Methods
108
+ __CreateView: ((parentComponentUniqueId) => {
109
+ const id = wasmContext.create_element('x-view', parentComponentUniqueId);
110
+ return { [uniqueIdSymbol]: id };
111
+ }),
112
+ __CreateText: ((parentComponentUniqueId) => {
113
+ const id = wasmContext.create_element('x-text', parentComponentUniqueId);
114
+ return { [uniqueIdSymbol]: id };
115
+ }),
116
+ __CreateImage: ((parentComponentUniqueId) => {
117
+ const id = wasmContext.create_element('x-image', parentComponentUniqueId);
118
+ return { [uniqueIdSymbol]: id };
119
+ }),
120
+ __CreateRawText: ((text) => {
121
+ const id = wasmContext.create_element('raw-text');
122
+ wasmContext.set_attribute(id, 'text', text);
123
+ return { [uniqueIdSymbol]: id };
124
+ }),
125
+ __CreateScrollView: ((parentComponentUniqueId) => {
126
+ const id = wasmContext.create_element('scroll-view', parentComponentUniqueId);
127
+ return { [uniqueIdSymbol]: id };
128
+ }),
129
+ __CreateElement: ((tagName, parentComponentUniqueId) => {
130
+ const htmlTag = LYNX_TAG_TO_HTML_TAG_MAP[tagName] ?? tagName;
131
+ const id = wasmContext.create_element(htmlTag, parentComponentUniqueId);
132
+ const el = { [uniqueIdSymbol]: id };
133
+ if (!config.enableCSSSelector) {
134
+ wasmContext.set_attribute(id, 'l-uid', id.toString());
135
+ }
136
+ return el;
137
+ }),
138
+ __CreateComponent: ((parentComponentUniqueId, _componentID, _cssID, entryName, name) => {
139
+ const id = wasmContext.create_element('x-view', parentComponentUniqueId, _cssID, _componentID); // Component host
140
+ const el = { [uniqueIdSymbol]: id };
141
+ if (!config.enableCSSSelector) {
142
+ wasmContext.set_attribute(id, 'l-uid', id.toString());
143
+ }
144
+ if (entryName) {
145
+ wasmContext.set_attribute(id, 'lynx-entry-name', entryName);
146
+ }
147
+ if (name) {
148
+ wasmContext.set_attribute(id, 'name', name);
149
+ }
150
+ return el;
151
+ }),
152
+ __CreateWrapperElement: ((parentComponentUniqueId) => {
153
+ const id = wasmContext.create_element('lynx-wrapper', parentComponentUniqueId);
154
+ return { [uniqueIdSymbol]: id };
155
+ }),
156
+ __CreateList: ((parentComponentUniqueId) => {
157
+ const id = wasmContext.create_element('x-list', parentComponentUniqueId);
158
+ return { [uniqueIdSymbol]: id };
159
+ }),
160
+ __CreatePage: ((_componentID, _cssID) => {
161
+ const id = wasmContext.create_element('div', 0, _cssID, _componentID);
162
+ pageElementId = id;
163
+ const el = { [uniqueIdSymbol]: id };
164
+ if (!config.enableCSSSelector) {
165
+ wasmContext.set_attribute(id, 'l-uid', id.toString());
166
+ }
167
+ wasmContext.set_attribute(id, 'part', 'page');
168
+ if (config.defaultDisplayLinear === false) {
169
+ wasmContext.set_attribute(id, lynxDefaultDisplayLinearAttribute, 'false');
170
+ }
171
+ if (config.defaultOverflowVisible === true) {
172
+ wasmContext.set_attribute(id, 'lynx-default-overflow-visible', 'true');
173
+ }
174
+ return el;
175
+ }),
176
+ __AppendElement: ((parent, child) => {
177
+ const parentId = getUniqueId(parent);
178
+ const childId = getUniqueId(child);
179
+ wasmContext.append_child(parentId, childId);
180
+ }),
181
+ __SetAttribute: ((element, name, value) => {
182
+ const el = element;
183
+ let valStr = '';
184
+ if (value == null) {
185
+ valStr = '';
186
+ }
187
+ else {
188
+ valStr = value.toString();
189
+ }
190
+ wasmContext.set_attribute(el[uniqueIdSymbol], name, valStr);
191
+ }),
192
+ __SetInlineStyles: ((element, value) => {
193
+ const uniqueId = element[uniqueIdSymbol];
194
+ if (!value) {
195
+ wasmContext.remove_attribute(uniqueId, 'style');
196
+ }
197
+ else {
198
+ if (typeof value === 'string') {
199
+ if (!wasmContext.set_inline_styles_in_str(uniqueId, value)) {
200
+ wasmContext.set_attribute(uniqueId, 'style', value);
201
+ }
202
+ }
203
+ else if (!value) {
204
+ wasmContext.remove_attribute(uniqueId, 'style');
205
+ }
206
+ else {
207
+ wasmContext.get_inline_styles_in_key_value_vec(uniqueId, Object.entries(value).flat().map((item) => item.toString()));
208
+ }
209
+ }
210
+ }),
211
+ __AddInlineStyle: ((element, key, value) => {
212
+ const uniqueId = element[uniqueIdSymbol];
213
+ if (typeof value != 'string') {
214
+ value = value.toString();
215
+ }
216
+ if (typeof key === 'number') {
217
+ return wasmContext.set_inline_styles_number_key(uniqueId, key, value);
218
+ }
219
+ else {
220
+ return wasmContext.add_inline_style_raw_string_key(uniqueId, key.toString(), value);
221
+ }
222
+ }),
223
+ __FlushElementTree: (() => {
224
+ if (pageElementId !== undefined) {
225
+ mtsBinding.ssrResult = wasmContext.generate_html(pageElementId);
226
+ }
227
+ }),
228
+ __SetID: ((element, id) => {
229
+ wasmContext.set_attribute(element[uniqueIdSymbol], 'id', id ?? '');
230
+ }),
231
+ },
232
+ wasmContext,
233
+ };
234
+ }
235
+ //# sourceMappingURL=createElementAPI.js.map
@@ -0,0 +1,38 @@
1
+ import { uniqueIdSymbol } from '../../constants.js';
2
+ import type { AddConfigPAPI, AddDatasetPAPI, AddEventPAPI, ElementIsEqualPAPI, FirstElementPAPI, GetChildrenPAPI, GetComponentIdPAPI, GetDataByKeyPAPI, GetDatasetPAPI, GetElementConfigPAPI, GetElementUniqueIDPAPI, GetEventPAPI, GetEventsPAPI, GetPageElementPAPI, GetParentPAPI, GetTemplatePartsPAPI, InsertElementBeforePAPI, LastElementPAPI, MarkPartElementPAPI, MarkTemplateElementPAPI, NextElementPAPI, RemoveElementPAPI, ReplaceElementPAPI, ReplaceElementsPAPI, SetConfigPAPI, SetDatasetPAPI, SetEventsPAPI, SwapElementPAPI, UpdateComponentIDPAPI, UpdateComponentInfoPAPI, UpdateListCallbacksPAPI } from '../../types/index.js';
3
+ export interface ServerElement extends HTMLElement {
4
+ [uniqueIdSymbol]: number;
5
+ }
6
+ export declare function getUniqueId(element: unknown): number;
7
+ export declare const __ElementIsEqual: ElementIsEqualPAPI;
8
+ export declare const __GetElementUniqueID: GetElementUniqueIDPAPI;
9
+ export declare const __GetParent: GetParentPAPI;
10
+ export declare const __GetChildren: GetChildrenPAPI;
11
+ export declare const __AddEvent: AddEventPAPI;
12
+ export declare const __GetEvent: GetEventPAPI;
13
+ export declare const __GetEvents: GetEventsPAPI;
14
+ export declare const __SetEvents: SetEventsPAPI;
15
+ export declare const __UpdateListCallbacks: UpdateListCallbacksPAPI;
16
+ export declare const __GetConfig: GetElementConfigPAPI;
17
+ export declare const __SetConfig: SetConfigPAPI;
18
+ export declare const __GetElementConfig: GetElementConfigPAPI;
19
+ export declare const __GetComponentID: GetComponentIdPAPI;
20
+ export declare const __GetDataset: GetDatasetPAPI;
21
+ export declare const __SetDataset: SetDatasetPAPI;
22
+ export declare const __AddDataset: AddDatasetPAPI;
23
+ export declare const __GetDataByKey: GetDataByKeyPAPI;
24
+ export declare const __FirstElement: FirstElementPAPI;
25
+ export declare const __LastElement: LastElementPAPI;
26
+ export declare const __NextElement: NextElementPAPI;
27
+ export declare const __RemoveElement: RemoveElementPAPI;
28
+ export declare const __ReplaceElement: ReplaceElementPAPI;
29
+ export declare const __SwapElement: SwapElementPAPI;
30
+ export declare const __AddConfig: AddConfigPAPI;
31
+ export declare const __UpdateComponentInfo: UpdateComponentInfoPAPI;
32
+ export declare const __UpdateComponentID: UpdateComponentIDPAPI;
33
+ export declare const __MarkTemplateElement: MarkTemplateElementPAPI;
34
+ export declare const __MarkPartElement: MarkPartElementPAPI;
35
+ export declare const __GetTemplateParts: GetTemplatePartsPAPI;
36
+ export declare const __GetPageElement: GetPageElementPAPI;
37
+ export declare const __InsertElementBefore: InsertElementBeforePAPI;
38
+ export declare const __ReplaceElements: ReplaceElementsPAPI;
@@ -0,0 +1,112 @@
1
+ /*
2
+ * Copyright 2025 The Lynx Authors. All rights reserved.
3
+ * Licensed under the Apache License Version 2.0 that can be found in the
4
+ * LICENSE file in the root directory of this source tree.
5
+ */
6
+ import { uniqueIdSymbol } from '../../constants.js';
7
+ export function getUniqueId(element) {
8
+ return element[uniqueIdSymbol];
9
+ }
10
+ export const __ElementIsEqual = (left, right) => {
11
+ if (left === right)
12
+ return true;
13
+ if (!left || !right)
14
+ return false;
15
+ return getUniqueId(left) === getUniqueId(right);
16
+ };
17
+ export const __GetElementUniqueID = (element) => {
18
+ return getUniqueId(element);
19
+ };
20
+ // Throwing/Stub Implementations
21
+ export const __GetParent = (_element) => {
22
+ throw new Error('__GetParent is not implemented in SSR');
23
+ };
24
+ export const __GetChildren = (_element) => {
25
+ throw new Error('__GetChildren is not implemented in SSR');
26
+ };
27
+ export const __AddEvent = () => {
28
+ // Silent return for SSR compatibility
29
+ };
30
+ export const __GetEvent = () => {
31
+ throw new Error('__GetEvent is not implemented in SSR');
32
+ };
33
+ export const __GetEvents = () => {
34
+ throw new Error('__GetEvents is not implemented in SSR');
35
+ };
36
+ export const __SetEvents = () => {
37
+ throw new Error('__SetEvents is not implemented in SSR');
38
+ };
39
+ export const __UpdateListCallbacks = () => {
40
+ // No-op in SSR
41
+ };
42
+ // __GetConfig uses GetElementConfigPAPI
43
+ export const __GetConfig = () => {
44
+ throw new Error('__GetConfig is not implemented in SSR');
45
+ };
46
+ export const __SetConfig = () => {
47
+ throw new Error('__SetConfig is not implemented in SSR');
48
+ };
49
+ export const __GetElementConfig = () => {
50
+ throw new Error('__GetElementConfig is not implemented in SSR');
51
+ };
52
+ export const __GetComponentID = () => {
53
+ throw new Error('__GetComponentID is not implemented in SSR');
54
+ };
55
+ export const __GetDataset = (_element) => {
56
+ throw new Error('__GetDataset is not implemented in SSR');
57
+ };
58
+ export const __SetDataset = (_element, _dataset) => {
59
+ throw new Error('__SetDataset is not implemented in SSR');
60
+ };
61
+ export const __AddDataset = (_element, _key, _value) => {
62
+ // No-op in SSR
63
+ };
64
+ export const __GetDataByKey = (_element, _key) => {
65
+ throw new Error('__GetDataByKey is not implemented in SSR');
66
+ };
67
+ export const __FirstElement = (_element) => {
68
+ throw new Error('__FirstElement is not implemented in SSR');
69
+ };
70
+ export const __LastElement = (_element) => {
71
+ throw new Error('__LastElement is not implemented in SSR');
72
+ };
73
+ export const __NextElement = (_element) => {
74
+ throw new Error('__NextElement is not implemented in SSR');
75
+ };
76
+ export const __RemoveElement = (_parent, _child) => {
77
+ throw new Error('__RemoveElement is not implemented in SSR');
78
+ };
79
+ export const __ReplaceElement = (_newEl, _oldEl) => {
80
+ throw new Error('__ReplaceElement is not implemented in SSR');
81
+ };
82
+ export const __SwapElement = (_a, _b) => {
83
+ throw new Error('__SwapElement is not implemented in SSR');
84
+ };
85
+ export const __AddConfig = () => {
86
+ throw new Error('__AddConfig is not implemented in SSR');
87
+ };
88
+ export const __UpdateComponentInfo = () => {
89
+ throw new Error('__UpdateComponentInfo is not implemented in SSR');
90
+ };
91
+ export const __UpdateComponentID = () => {
92
+ throw new Error('__UpdateComponentID is not implemented in SSR');
93
+ };
94
+ export const __MarkTemplateElement = () => {
95
+ throw new Error('__MarkTemplateElement is not implemented in SSR');
96
+ };
97
+ export const __MarkPartElement = () => {
98
+ throw new Error('__MarkPartElement is not implemented in SSR');
99
+ };
100
+ export const __GetTemplateParts = () => {
101
+ throw new Error('__GetTemplateParts is not implemented in SSR');
102
+ };
103
+ export const __GetPageElement = () => {
104
+ throw new Error('__GetPageElement is not implemented in SSR');
105
+ };
106
+ export const __InsertElementBefore = (_parent, _child, _ref) => {
107
+ throw new Error('__InsertElementBefore is not implemented in SSR');
108
+ };
109
+ export const __ReplaceElements = (_parent, _newChildren, _oldChildren) => {
110
+ throw new Error('__ReplaceElements is not implemented in SSR');
111
+ };
112
+ //# sourceMappingURL=pureElementAPIs.js.map
@@ -0,0 +1,4 @@
1
+ export * from './wasm.js';
2
+ export * from './elementAPIs/createElementAPI.js';
3
+ export * from './deploy.js';
4
+ export * from './decode.js';
@@ -0,0 +1,10 @@
1
+ /*
2
+ * Copyright 2025 The Lynx Authors. All rights reserved.
3
+ * Licensed under the Apache License Version 2.0 that can be found in the
4
+ * LICENSE file in the root directory of this source tree.
5
+ */
6
+ export * from './wasm.js';
7
+ export * from './elementAPIs/createElementAPI.js';
8
+ export * from './deploy.js';
9
+ export * from './decode.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ export * from '../../binary/server/server.js';
@@ -0,0 +1,7 @@
1
+ /*
2
+ * Copyright 2025 The Lynx Authors. All rights reserved.
3
+ * Licensed under the Apache License Version 2.0 that can be found in the
4
+ * LICENSE file in the root directory of this source tree.
5
+ */
6
+ export * from '../../binary/server/server.js';
7
+ //# sourceMappingURL=wasm.js.map
@@ -1,7 +1,9 @@
1
1
  import type { PageConfig } from './PageConfig.js';
2
+ import type { StyleSheetResource } from '../../binary/client/client.js';
2
3
  export interface DecodedTemplate {
3
4
  config?: PageConfig;
4
5
  lepusCode?: Record<string, string>;
5
6
  customSections?: Record<string, any>;
6
7
  backgroundCode?: Record<string, string>;
8
+ styleSheet?: StyleSheetResource;
7
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/web-core-wasm",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "This is an internal experimental package, do not use",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,11 +21,16 @@
21
21
  "import": "./dist/client/index.js",
22
22
  "default": "./dist/client/index.js"
23
23
  },
24
+ "./server": {
25
+ "types": "./dist/server/index.d.ts",
26
+ "import": "./dist/server/index.js",
27
+ "default": "./dist/server/index.js"
28
+ },
24
29
  "./client.prod.js": {
25
- "default": "./dist/client_prod/client.js"
30
+ "default": "./dist/client_prod/static/js/client.js"
26
31
  },
27
- "./index.css": {
28
- "default": "./css/index.css"
32
+ "./client.prod.css": {
33
+ "default": "./dist/client_prod/static/css/client.css"
29
34
  }
30
35
  },
31
36
  "main": "./dist/client/index.js",
@@ -51,26 +56,26 @@
51
56
  ]
52
57
  },
53
58
  "dependencies": {
54
- "@lynx-js/web-elements": "0.11.1",
55
- "@lynx-js/web-worker-rpc": "0.19.7"
59
+ "@lynx-js/web-elements": "0.11.3",
60
+ "@lynx-js/web-worker-rpc": "0.19.8"
56
61
  },
57
62
  "devDependencies": {
58
63
  "@lynx-js/lynx-core": "0.1.3",
59
- "@rsbuild/core": "1.7.2",
60
- "@rsbuild/plugin-eslint": "^1.2.0",
61
- "@rsbuild/plugin-source-build": "1.0.3",
64
+ "@rsbuild/core": "1.7.3",
65
+ "@rsbuild/plugin-eslint": "1.2.1",
66
+ "@rsbuild/plugin-source-build": "1.0.4",
62
67
  "binaryen": "^125.0.0",
63
- "eslint-plugin-compat": "^6.0.2",
68
+ "eslint-plugin-compat": "^6.2.0",
64
69
  "fb-dotslash": "^0.5.8",
65
70
  "jsdom": "^27.4.0",
66
71
  "tslib": "^2.8.1",
67
72
  "wasm-feature-detect": "^1.8.0",
68
- "@lynx-js/css-serializer": "0.1.3"
73
+ "@lynx-js/css-serializer": "0.1.4"
69
74
  },
70
75
  "peerDependencies": {
71
76
  "@lynx-js/lynx-core": "0.1.3",
72
77
  "tslib": "^2.5.0",
73
- "@lynx-js/css-serializer": "0.1.3"
78
+ "@lynx-js/css-serializer": "0.1.4"
74
79
  },
75
80
  "peerDependenciesMeta": {
76
81
  "@lynx-js/css-serializer": {
@@ -1 +0,0 @@
1
- @supports not ((content-visibility:auto) and (transition-behavior:allow-discrete) and (width:1rex)){*{--lynx-display:linear;--lynx-linear-weight-sum:1;--lynx-linear-weight:0;--justify-content-column:flex-start;--justify-content-column-reverse:flex-start;--justify-content-row:flex-start;--justify-content-row-reverse:flex-start;--align-self-row:auto;--align-self-column:auto;--lynx-linear-weight-basis:auto;--lynx-linear-orientation:vertical;--flex-direction:row;--flex-grow:0;--flex-shrink:1;--flex-basis:auto;--justify-content:flex-start;--flex-wrap:nowrap;--align-self:auto}[lynx-computed-display=linear]{flex-direction:column;justify-content:flex-start;flex-wrap:nowrap!important}[lynx-computed-display=flex]{flex-direction:var(--flex-direction);justify-content:var(--justify-content);flex-wrap:var(--flex-wrap)}[lynx-computed-display=flex]>*,[lynx-computed-display=flex]>lynx-wrapper>*{flex:var(--flex,var(--flex-grow)var(--flex-shrink)var(--flex-basis))}[lynx-computed-display=linear]>*,[lynx-computed-display=linear]>lynx-wrapper>*{flex-shrink:0!important;flex-grow:calc(var(--lynx-linear-weight)/calc(var(--lynx-linear-weight-sum) + ( 1 - clamp(0,var(--lynx-linear-weight-sum)*999999,1))))!important;flex-basis:var(--lynx-linear-weight-basis)!important}[lynx-computed-display=linear][lynx-linear-orientation=vertical]{justify-content:var(--justify-content-column);flex-direction:column!important}[lynx-computed-display=linear][lynx-linear-orientation=horizontal]{justify-content:var(--justify-content-row);flex-direction:row!important}[lynx-computed-display=linear][lynx-linear-orientation=vertical-reverse]{justify-content:var(--justify-content-column-reverse);flex-direction:column-reverse!important}[lynx-computed-display=linear][lynx-linear-orientation=horizontal-reverse]{justify-content:var(--justify-content-row-reverse);flex-direction:row-reverse!important}[lynx-computed-display=linear][lynx-linear-orientation=vertical]>*,[lynx-computed-display=linear][lynx-linear-orientation=vertical-reverse],[lynx-computed-display=linear][lynx-linear-orientation=vertical]>lynx-wrapper>*,[lynx-computed-display=linear][lynx-linear-orientation=vertical-reverse]>lynx-wrapper>*{align-self:var(--align-self-column)}[lynx-computed-display=linear][lynx-linear-orientation=horizontal]>*,[lynx-computed-display=linear][lynx-linear-orientation=horizontal-reverse],[lynx-computed-display=linear][lynx-linear-orientation=horizontal]>lynx-wrapper>*,[lynx-computed-display=linear][lynx-linear-orientation=horizontal-reverse]>lynx-wrapper>*{align-self:var(--align-self-row)}}