@hypen-space/web 0.4.37 → 0.4.38

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/dist/hypen.js DELETED
@@ -1,414 +0,0 @@
1
- /**
2
- * Hypen - High-Level API for Web Applications
3
- *
4
- * Simple API for rendering Hypen applications (like ReactDOM.render)
5
- */
6
- import { Engine } from "@hypen-space/core/engine/browser";
7
- import { HypenModuleInstance } from "@hypen-space/core/app";
8
- import { HypenRouter } from "@hypen-space/core/router";
9
- import { HypenGlobalContext } from "@hypen-space/core/context";
10
- import { componentLoader } from "@hypen-space/core/loader";
11
- import { Router, Route, Link } from "@hypen-space/core/components";
12
- import { frameworkLoggers, setDebugMode } from "@hypen-space/core/logger";
13
- import { DOMRenderer } from "./dom/renderer.js";
14
- const log = frameworkLoggers.hypen;
15
- export class Hypen {
16
- engine = null;
17
- renderer = null;
18
- moduleInstance = null;
19
- container = null;
20
- config;
21
- router;
22
- globalContext;
23
- moduleInstances = new Map();
24
- constructor(config = {}) {
25
- this.config = {
26
- componentsDir: "./src/components",
27
- debug: false,
28
- ...config,
29
- };
30
- // Enable debug mode if configured
31
- if (this.config.debug) {
32
- setDebugMode(true);
33
- }
34
- // Initialize router and global context
35
- this.router = new HypenRouter();
36
- this.globalContext = new HypenGlobalContext();
37
- // Register built-in components
38
- componentLoader.register("Router", Router, "");
39
- componentLoader.register("Route", Route, "");
40
- componentLoader.register("Link", Link, "");
41
- // Store hypen engine instance in global context for built-in component access
42
- this.globalContext.__hypenEngine = this;
43
- }
44
- /**
45
- * Initialize the Hypen runtime
46
- * Must be called before render()
47
- */
48
- async init() {
49
- log.debug("Initializing...");
50
- // Initialize engine
51
- this.engine = new Engine();
52
- await this.engine.init({
53
- wasmUrl: this.config.wasmUrl,
54
- jsUrl: this.config.jsUrl,
55
- });
56
- log.debug("Engine initialized");
57
- }
58
- /**
59
- * Load all components from the components directory
60
- */
61
- async loadComponents(componentsDir) {
62
- const dir = componentsDir || this.config.componentsDir;
63
- log.debug(`Loading components from ${dir}...`);
64
- await componentLoader.loadFromComponentsDir(dir);
65
- log.debug(`Loaded ${componentLoader.getNames().length} components`);
66
- }
67
- /**
68
- * Render a component to a DOM container
69
- *
70
- * @param componentName - Name of the component to render (e.g., "HomePage")
71
- * @param containerSelector - CSS selector or HTMLElement for the mount point
72
- */
73
- async render(componentName, containerSelector) {
74
- if (!this.engine) {
75
- throw new Error("[Hypen] Engine not initialized. Call init() first.");
76
- }
77
- // Get the container element
78
- if (typeof containerSelector === "string") {
79
- const element = document.querySelector(containerSelector);
80
- if (!element) {
81
- throw new Error(`[Hypen] Container not found: ${containerSelector}`);
82
- }
83
- this.container = element;
84
- }
85
- else {
86
- this.container = containerSelector;
87
- }
88
- // Get the component definition
89
- const component = componentLoader.get(componentName);
90
- if (!component) {
91
- throw new Error(`[Hypen] Component "${componentName}" not found. Available: ${componentLoader.getNames().join(", ")}`);
92
- }
93
- log.debug(`Rendering ${componentName} to`, this.container);
94
- // Create renderer with debug config
95
- this.renderer = new DOMRenderer(this.container, this.engine, {
96
- enabled: this.config.debugHeatmap || false,
97
- showHeatmap: this.config.debugHeatmap || false,
98
- heatmapIncrement: this.config.heatmapIncrement || 5,
99
- fadeOutDuration: this.config.heatmapFadeOut || 2000,
100
- maxOpacity: 0.8,
101
- });
102
- // Set render callback
103
- this.engine.setRenderCallback((patches) => {
104
- log.debug(`Applying ${patches.length} patches`);
105
- this.renderer.applyPatches(patches);
106
- });
107
- // Set context on renderer for component composition
108
- this.renderer.setContext(this.router, this.globalContext);
109
- // Extract module ID from component name or .id() applicator
110
- const moduleId = this.extractModuleId(componentName, component.template);
111
- // Create module instance with router and global context
112
- this.moduleInstance = new HypenModuleInstance(this.engine, component.module, this.router, this.globalContext);
113
- // Register module in global context
114
- this.globalContext.registerModule(moduleId, this.moduleInstance);
115
- this.moduleInstances.set(moduleId, this.moduleInstance);
116
- // Connect module state changes to renderer
117
- this.moduleInstance.onStateChange(() => {
118
- const mergedState = this.getMergedState();
119
- log.debug(`State changed, merged state:`, mergedState);
120
- this.renderer.updateState(mergedState);
121
- });
122
- // Set up component resolver for dynamic component composition
123
- this.setupComponentResolver();
124
- // Create module instances for ALL components that have state
125
- this.createNestedModuleInstances();
126
- // Render the UI template
127
- this.engine.renderSource(component.template);
128
- // Update renderer with initial state
129
- this.renderer.updateState(this.getMergedState());
130
- log.debug(`${componentName} rendered successfully`);
131
- }
132
- /**
133
- * Unmount and cleanup
134
- */
135
- async unmount() {
136
- log.debug("Unmounting...");
137
- if (this.moduleInstance) {
138
- await this.moduleInstance.destroy();
139
- this.moduleInstance = null;
140
- }
141
- if (this.container) {
142
- this.container.innerHTML = "";
143
- this.container = null;
144
- }
145
- this.renderer = null;
146
- log.debug("Unmounted");
147
- }
148
- /**
149
- * Get the current module instance
150
- */
151
- getModuleInstance() {
152
- return this.moduleInstance;
153
- }
154
- /**
155
- * Get the current state
156
- */
157
- getState() {
158
- return this.moduleInstance?.getState() ?? null;
159
- }
160
- /**
161
- * Get the router instance
162
- */
163
- getRouter() {
164
- return this.router;
165
- }
166
- /**
167
- * Get the global context
168
- */
169
- getGlobalContext() {
170
- return this.globalContext;
171
- }
172
- /**
173
- * Enable or disable debug heatmap mode
174
- */
175
- setDebugHeatmap(enabled) {
176
- if (this.renderer) {
177
- this.renderer.setDebugConfig({ enabled, showHeatmap: enabled });
178
- log.debug(`Debug heatmap ${enabled ? "enabled" : "disabled"}`);
179
- }
180
- }
181
- /**
182
- * Reset debug tracking for all elements
183
- */
184
- resetDebugTracking() {
185
- if (this.renderer) {
186
- this.renderer.resetDebugTracking();
187
- log.debug("Debug tracking reset");
188
- }
189
- }
190
- /**
191
- * Get debug statistics
192
- */
193
- getDebugStats() {
194
- return this.renderer?.getDebugStats() || null;
195
- }
196
- /**
197
- * Render a lazy route component into a specific route element
198
- * This is called by the Router when a route becomes active
199
- */
200
- async renderLazyRoute(routePath, componentName, routeElement) {
201
- if (!this.engine || !this.renderer) {
202
- throw new Error("Engine not initialized");
203
- }
204
- // Get the component from the loader
205
- const component = componentLoader.get(componentName);
206
- if (!component) {
207
- throw new Error(`Component ${componentName} not found`);
208
- }
209
- // Get the component template
210
- const template = component.template;
211
- if (!template) {
212
- throw new Error(`Component ${componentName} has no template`);
213
- }
214
- // Create module instance for this component if it has state
215
- if (component.module && !this.moduleInstances.has(componentName)) {
216
- const moduleId = this.extractModuleId(componentName, template);
217
- const moduleInstance = new HypenModuleInstance(this.engine, component.module, this.router, this.globalContext);
218
- this.globalContext.registerModule(moduleId, moduleInstance);
219
- this.moduleInstances.set(componentName, moduleInstance);
220
- // Listen to state changes
221
- moduleInstance.onStateChange(() => {
222
- const mergedState = this.getMergedState();
223
- log.debug(`Lazy component ${componentName} state changed:`, mergedState);
224
- this.renderer.updateState(mergedState);
225
- });
226
- }
227
- // Wait a tick for module instance to initialize and fetch data
228
- await new Promise((resolve) => setTimeout(resolve, 50));
229
- // Get the route element's node ID from the renderer
230
- const routeNodeId = routeElement.dataset.hypenId;
231
- if (!routeNodeId) {
232
- throw new Error(`Route element is missing data-hypen-id attribute`);
233
- }
234
- // Get the current merged state
235
- const mergedState = this.getMergedState();
236
- // Render into the Route element
237
- this.engine.renderInto(template, routeNodeId, mergedState);
238
- // Ensure freshly created text nodes are interpolated with current state
239
- this.renderer.updateState(mergedState);
240
- }
241
- /**
242
- * Extract module ID from component name or .id() applicator
243
- */
244
- extractModuleId(componentName, template) {
245
- // Look for .id("CustomName") or .id('CustomName') in the template
246
- const idMatch = template.match(/\.id\(["']([^"']+)["']\)/);
247
- const matchedId = idMatch?.[1];
248
- if (matchedId) {
249
- return matchedId;
250
- }
251
- // Default to component name
252
- return componentName;
253
- }
254
- /**
255
- * Create module instances for all components that have state
256
- */
257
- createNestedModuleInstances() {
258
- // Create built-in Router module instance
259
- if (Router && !this.moduleInstances.has("Router")) {
260
- const routerInstance = new HypenModuleInstance(this.engine, Router, this.router, this.globalContext);
261
- this.globalContext.registerModule("Router", routerInstance);
262
- this.moduleInstances.set("Router", routerInstance);
263
- routerInstance.onStateChange(() => {
264
- const mergedState = this.getMergedState();
265
- log.debug("Router state changed:", mergedState);
266
- this.renderer.updateState(mergedState);
267
- });
268
- }
269
- // Get all registered components
270
- const componentNames = componentLoader.getNames();
271
- for (const name of componentNames) {
272
- // Skip if already created
273
- if (this.moduleInstances.has(name)) {
274
- continue;
275
- }
276
- const comp = componentLoader.get(name);
277
- if (!comp || !comp.module) {
278
- continue;
279
- }
280
- // Create module instance
281
- log.debug(`Creating nested module instance for: ${name}`);
282
- const moduleInstance = new HypenModuleInstance(this.engine, comp.module, this.router, this.globalContext);
283
- this.globalContext.registerModule(name, moduleInstance);
284
- this.moduleInstances.set(name, moduleInstance);
285
- // Connect state changes to renderer
286
- moduleInstance.onStateChange(() => {
287
- const mergedState = this.getMergedState();
288
- log.debug(`Nested component ${name} state changed:`, mergedState);
289
- this.renderer.updateState(mergedState);
290
- });
291
- }
292
- }
293
- /**
294
- * Get merged state from all module instances
295
- */
296
- getMergedState() {
297
- const merged = {};
298
- // Include main module state
299
- if (this.moduleInstance) {
300
- const mainState = this.moduleInstance.getState();
301
- Object.assign(merged, mainState);
302
- }
303
- // Include all nested component states
304
- for (const [name, instance] of this.moduleInstances.entries()) {
305
- const nestedState = instance.getState();
306
- Object.assign(merged, nestedState);
307
- }
308
- return merged;
309
- }
310
- /**
311
- * Set up component resolver for the engine
312
- */
313
- setupComponentResolver() {
314
- if (!this.engine)
315
- return;
316
- // List of built-in DOM elements that should NOT be resolved
317
- const builtInElements = new Set([
318
- "Column",
319
- "Row",
320
- "Text",
321
- "Button",
322
- "Image",
323
- "Input",
324
- "Container",
325
- "Box",
326
- "Center",
327
- "List",
328
- "Canvas",
329
- "Spacer",
330
- "Divider",
331
- "ScrollView",
332
- ]);
333
- this.engine.setComponentResolver((componentName, contextPath) => {
334
- // Don't try to resolve built-in DOM elements
335
- if (builtInElements.has(componentName)) {
336
- return null;
337
- }
338
- log.debug(`Resolving component: ${componentName} (context: ${contextPath})`);
339
- // Check if component is registered
340
- const componentDef = componentLoader.get(componentName);
341
- if (!componentDef) {
342
- log.debug(`Component not found: ${componentName}`);
343
- return null;
344
- }
345
- // Router is passthrough, Route is lazy
346
- const isPassthrough = componentName === "Router";
347
- const isLazy = componentName === "Route";
348
- const resolved = {
349
- source: componentDef.template,
350
- path: componentDef.path || componentName,
351
- passthrough: isPassthrough,
352
- lazy: isLazy,
353
- };
354
- const flags = [];
355
- if (isPassthrough)
356
- flags.push("passthrough");
357
- if (isLazy)
358
- flags.push("lazy");
359
- const flagStr = flags.length > 0 ? ` (${flags.join(", ")})` : "";
360
- log.debug(`Resolved ${componentName} -> ${resolved.path}${flagStr}`);
361
- return resolved;
362
- });
363
- }
364
- }
365
- /**
366
- * Quick render function (like ReactDOM.render)
367
- *
368
- * @example
369
- * ```typescript
370
- * import { render } from "@hypen-space/web/client";
371
- *
372
- * await render("HomePage", "#app");
373
- * ```
374
- */
375
- export async function render(componentName, containerSelector, config) {
376
- const hypen = new Hypen(config);
377
- await hypen.init();
378
- await hypen.loadComponents();
379
- await hypen.render(componentName, containerSelector);
380
- return hypen;
381
- }
382
- /**
383
- * Render with explicit component loading
384
- *
385
- * @example
386
- * ```typescript
387
- * import { renderWithComponents } from "@hypen-space/web/client";
388
- * import HomePage from "./components/HomePage/component";
389
- * import homePageTemplate from "./components/HomePage/component.hypen";
390
- *
391
- * await renderWithComponents(
392
- * { HomePage: { module: HomePage, template: homePageTemplate } },
393
- * "HomePage",
394
- * "#app"
395
- * );
396
- * ```
397
- */
398
- export async function renderWithComponents(components, componentName, containerSelector, config) {
399
- const hypen = new Hypen(config);
400
- await hypen.init();
401
- // Register components manually
402
- for (const [name, { module, template }] of Object.entries(components)) {
403
- let processedTemplate = template;
404
- // If template starts with "module ComponentName {", extract just the children
405
- const moduleMatch = template.match(/^\s*module\s+\w+\s*\{([\s\S]*)\}\s*$/);
406
- if (moduleMatch && moduleMatch[1]) {
407
- processedTemplate = moduleMatch[1].trim();
408
- }
409
- componentLoader.register(name, module, processedTemplate);
410
- }
411
- await hypen.render(componentName, containerSelector);
412
- return hypen;
413
- }
414
- //# sourceMappingURL=hypen.js.map
package/dist/hypen.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"hypen.js","sourceRoot":"","sources":["../src/hypen.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,MAAM,GAAG,GAAG,gBAAgB,CAAC,KAAK,CAAC;AAmBnC,MAAM,OAAO,KAAK;IACR,MAAM,GAAkB,IAAI,CAAC;IAC7B,QAAQ,GAAuB,IAAI,CAAC;IACpC,cAAc,GAAoC,IAAI,CAAC;IACvD,SAAS,GAAuB,IAAI,CAAC;IACrC,MAAM,CAAc;IACpB,MAAM,CAAc;IACpB,aAAa,CAAqB;IAClC,eAAe,GAAG,IAAI,GAAG,EAAoC,CAAC;IAEtE,YAAY,SAAsB,EAAE;QAClC,IAAI,CAAC,MAAM,GAAG;YACZ,aAAa,EAAE,kBAAkB;YACjC,KAAK,EAAE,KAAK;YACZ,GAAG,MAAM;SACV,CAAC;QAEF,kCAAkC;QAClC,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACtB,YAAY,CAAC,IAAI,CAAC,CAAC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ClC,iBAAiB,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC5C,CAAC;QAED,eAAe,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM,KAAK,CAAC,MAAM,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACrD,OAAO,KAAK,CAAC;AACf,CAAC"}
package/src/client.ts DELETED
@@ -1,20 +0,0 @@
1
- /**
2
- * @hypen-space/web/client - Client-side rendering with WASM engine
3
- *
4
- * This entry point includes the Hypen orchestrator which connects the
5
- * BrowserEngine (WASM) with the DOM renderer. Use this when you want
6
- * to run the engine client-side in the browser.
7
- *
8
- * For remote UI (server-side engine, no WASM in browser), use the
9
- * default import from "@hypen-space/web" instead.
10
- *
11
- * @example
12
- * ```typescript
13
- * import { render } from "@hypen-space/web/client";
14
- *
15
- * await render("Counter", "#app");
16
- * ```
17
- */
18
-
19
- export { Hypen, render, renderWithComponents } from "./hypen.js";
20
- export type { HypenConfig } from "./hypen.js";