@jasonshimmy/custom-elements-runtime 2.5.2 → 2.5.6

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 (94) hide show
  1. package/README.md +115 -40
  2. package/dist/css/colors.d.ts +14 -0
  3. package/dist/custom-elements-runtime.cjs.js +6 -1
  4. package/dist/custom-elements-runtime.cjs.js.map +1 -1
  5. package/dist/custom-elements-runtime.colors.cjs.js +2 -0
  6. package/dist/custom-elements-runtime.colors.cjs.js.map +1 -0
  7. package/dist/custom-elements-runtime.colors.es.js +279 -0
  8. package/dist/custom-elements-runtime.colors.es.js.map +1 -0
  9. package/dist/custom-elements-runtime.directive-enhancements.es.js +1 -1
  10. package/dist/custom-elements-runtime.es.js +258 -166
  11. package/dist/custom-elements-runtime.es.js.map +1 -1
  12. package/dist/custom-elements-runtime.event-bus.cjs.js +1 -1
  13. package/dist/custom-elements-runtime.event-bus.cjs.js.map +1 -1
  14. package/dist/custom-elements-runtime.event-bus.es.js +28 -25
  15. package/dist/custom-elements-runtime.event-bus.es.js.map +1 -1
  16. package/dist/custom-elements-runtime.router.cjs.js +20 -20
  17. package/dist/custom-elements-runtime.router.cjs.js.map +1 -1
  18. package/dist/custom-elements-runtime.router.es.js +549 -531
  19. package/dist/custom-elements-runtime.router.es.js.map +1 -1
  20. package/dist/custom-elements-runtime.ssr.cjs.js +1 -1
  21. package/dist/custom-elements-runtime.ssr.es.js +12 -8
  22. package/dist/custom-elements-runtime.ssr.es.js.map +1 -1
  23. package/dist/custom-elements-runtime.store.cjs.js +1 -1
  24. package/dist/custom-elements-runtime.store.cjs.js.map +1 -1
  25. package/dist/custom-elements-runtime.store.es.js +5 -5
  26. package/dist/custom-elements-runtime.store.es.js.map +1 -1
  27. package/dist/custom-elements-runtime.transitions.cjs.js +1 -1
  28. package/dist/custom-elements-runtime.transitions.es.js +1 -1
  29. package/dist/event-bus.d.ts +17 -4
  30. package/dist/index.d.ts +13 -5
  31. package/dist/keep-alive.d.ts +50 -0
  32. package/dist/{logger-BuUYv7C_.js → logger-BvkEbVM4.js} +15 -11
  33. package/dist/logger-BvkEbVM4.js.map +1 -0
  34. package/dist/logger-CSALKaYm.cjs +2 -0
  35. package/dist/logger-CSALKaYm.cjs.map +1 -0
  36. package/dist/namespace-helpers-4qeKVqQw.cjs +5 -0
  37. package/dist/namespace-helpers-4qeKVqQw.cjs.map +1 -0
  38. package/dist/namespace-helpers-DcD_6_K1.js +989 -0
  39. package/dist/namespace-helpers-DcD_6_K1.js.map +1 -0
  40. package/dist/router/active-proxy.d.ts +5 -0
  41. package/dist/router/component-loader.d.ts +11 -0
  42. package/dist/router/instance.d.ts +11 -0
  43. package/dist/router/matcher.d.ts +14 -0
  44. package/dist/router/path-utils.d.ts +48 -0
  45. package/dist/router/types.d.ts +134 -0
  46. package/dist/router.d.ts +6 -208
  47. package/dist/runtime/builtin-components.d.ts +78 -0
  48. package/dist/runtime/component/element-class.d.ts +4 -0
  49. package/dist/runtime/component/factory.d.ts +39 -0
  50. package/dist/runtime/component/registry.d.ts +16 -0
  51. package/dist/runtime/component.d.ts +3 -50
  52. package/dist/runtime/discovery-state.d.ts +30 -0
  53. package/dist/runtime/hooks.d.ts +115 -0
  54. package/dist/runtime/logger.d.ts +19 -1
  55. package/dist/runtime/monitoring/health-monitor.d.ts +22 -65
  56. package/dist/runtime/reactive.d.ts +39 -7
  57. package/dist/runtime/render.d.ts +20 -4
  58. package/dist/runtime/scheduler.d.ts +69 -2
  59. package/dist/runtime/template-compiler/impl.d.ts +14 -0
  60. package/dist/runtime/template-compiler/lru-cache.d.ts +20 -0
  61. package/dist/runtime/template-compiler/props-parser.d.ts +15 -0
  62. package/dist/runtime/template-compiler/vnode-utils.d.ts +5 -0
  63. package/dist/runtime/template-compiler.d.ts +5 -28
  64. package/dist/runtime/types.d.ts +10 -0
  65. package/dist/runtime/vdom-directives.d.ts +71 -0
  66. package/dist/runtime/vdom-helpers.d.ts +126 -0
  67. package/dist/runtime/vdom-patch.d.ts +67 -0
  68. package/dist/runtime/vdom.d.ts +16 -140
  69. package/dist/ssr.d.ts +2 -1
  70. package/dist/teleport.d.ts +68 -0
  71. package/dist/template-compiler-BO8UEEDA.js +3984 -0
  72. package/dist/template-compiler-BO8UEEDA.js.map +1 -0
  73. package/dist/template-compiler-C4L8vT-6.cjs +23 -0
  74. package/dist/template-compiler-C4L8vT-6.cjs.map +1 -0
  75. package/dist/transitions-DPZiuXb9.cjs +330 -0
  76. package/dist/transitions-DPZiuXb9.cjs.map +1 -0
  77. package/dist/{transitions-Bx0Nc9zR.js → transitions-Di5wW9yc.js} +1072 -632
  78. package/dist/transitions-Di5wW9yc.js.map +1 -0
  79. package/dist/transitions.d.ts +1 -1
  80. package/package.json +18 -11
  81. package/dist/logger-BuUYv7C_.js.map +0 -1
  82. package/dist/logger-DiXdWaF-.cjs +0 -2
  83. package/dist/logger-DiXdWaF-.cjs.map +0 -1
  84. package/dist/namespace-helpers-BCVTzhAO.cjs +0 -5
  85. package/dist/namespace-helpers-BCVTzhAO.cjs.map +0 -1
  86. package/dist/namespace-helpers-CF28TyaG.js +0 -786
  87. package/dist/namespace-helpers-CF28TyaG.js.map +0 -1
  88. package/dist/template-compiler-CXHEnaBh.cjs +0 -17
  89. package/dist/template-compiler-CXHEnaBh.cjs.map +0 -1
  90. package/dist/template-compiler-DD_VZrte.js +0 -3729
  91. package/dist/template-compiler-DD_VZrte.js.map +0 -1
  92. package/dist/transitions-Bx0Nc9zR.js.map +0 -1
  93. package/dist/transitions-DfcqL-X4.cjs +0 -302
  94. package/dist/transitions-DfcqL-X4.cjs.map +0 -1
package/README.md CHANGED
@@ -80,23 +80,46 @@ Below is the **complete list of public symbols** exported by the runtime and its
80
80
 
81
81
  **Package:** `@jasonshimmy/custom-elements-runtime`
82
82
 
83
- | Export | Description |
84
- | ----------------------- | ---------------------------------------------------------------------- |
85
- | `component` | Define a custom element with the functional component API. |
86
- | `html` | Template tag function producing runtime VNodes from template literals. |
87
- | `css` | Define component-scoped/JIT styles or register stylesheets. |
88
- | `ref` | Create a reactive reference object with a `.value` property. |
89
- | `computed` | Create a derived, read-only reactive value from other reactives. |
90
- | `watch` | Register watchers reacting to changes in reactive values. |
91
- | `useProps` | Hook to declare/consume typed component props with defaults. |
92
- | `useEmit` | Hook returning an emit function for dispatching custom events. |
93
- | `useOnConnected` | Hook that runs a callback when the component connects. |
94
- | `useOnDisconnected` | Hook that runs a callback when the component disconnects. |
95
- | `useOnAttributeChanged` | Hook observing host attribute changes. |
96
- | `useOnError` | Hook to register a component-level error handler. |
97
- | `useStyle` | Hook to register or compute component styles at runtime. |
98
- | `unsafeHTML` | Insert raw HTML into a template (**unsafe; use carefully**). |
99
- | `decodeEntities` | Utility to decode HTML entities in strings. |
83
+ | Export | Description |
84
+ | ---------------------------- | ----------------------------------------------------------------------------------------------------- |
85
+ | `component` | Define a custom element with the functional component API. |
86
+ | `html` | Template tag function producing runtime VNodes from template literals. |
87
+ | `css` | Define component-scoped/JIT styles or register stylesheets. |
88
+ | `ref` | Create a reactive reference object with a `.value` property. |
89
+ | `computed` | Create a memoized, derived read-only value from other reactive sources. |
90
+ | `watch` | Register watchers reacting to changes in reactive values. |
91
+ | `watchEffect` | Auto-track reactive reads and re-run a side-effect whenever dependencies change. |
92
+ | `nextTick` | Returns a Promise resolving after all pending DOM updates are flushed. |
93
+ | `flushDOMUpdates` | Synchronously flush all pending DOM update tasks (useful in tests). |
94
+ | `scheduleWithPriority` | Schedule a callback at a given `UpdatePriority` level. |
95
+ | `provide` | Store a value on the current component for descendant injection. |
96
+ | `inject` | Retrieve a value provided by an ancestor component. |
97
+ | `createComposable` | Package reusable stateful logic (hooks, reactive state) into a composable. |
98
+ | `getCurrentComponentContext` | Access the active component context from within a composable or render function. |
99
+ | `useProps` | Hook to declare/consume typed component props with defaults. |
100
+ | `useEmit` | Hook returning an emit function for dispatching custom events. |
101
+ | `useOnConnected` | Hook that runs a callback when the component connects. |
102
+ | `useOnDisconnected` | Hook that runs a callback when the component disconnects. |
103
+ | `useOnAttributeChanged` | Hook observing host attribute changes. |
104
+ | `useOnError` | Hook to register a component-level error handler. |
105
+ | `useStyle` | Hook to register or compute component styles at runtime. |
106
+ | `useExpose` | Publish methods and properties onto the host element as an imperative public API. |
107
+ | `useSlots` | Inspect which named slots have been filled by the component consumer. |
108
+ | `useTeleport` | Render virtual DOM content into any DOM node outside the shadow root. |
109
+ | `registerKeepAlive` | Register `<cer-keep-alive>` to preserve component state across DOM removals. |
110
+ | `registerSuspense` | Register the `<cer-suspense>` built-in component. |
111
+ | `registerErrorBoundary` | Register the `<cer-error-boundary>` built-in component. |
112
+ | `registerBuiltinComponents` | Register both `<cer-suspense>` and `<cer-error-boundary>` in one call. |
113
+ | `unsafeHTML` | Insert raw HTML into a template (**unsafe; use carefully**). |
114
+ | `decodeEntities` | Utility to decode HTML entities in strings. |
115
+ | `setDevMode` | Toggle dev-mode logging on or off at runtime. |
116
+ | `devLog` | Log a message to the console in dev mode only (no-op in production). |
117
+ | `isReactiveState` | Type-guard returning `true` when a value is a `ReactiveState` instance. |
118
+ | `createHealthMonitor` | Create a new health monitor instance (factory; each call returns an independent instance). |
119
+ | `getHealthMonitor` | Return the global singleton health monitor instance (lazily created). |
120
+ | `updateHealthMetric` | Update a named metric on the global singleton health monitor. |
121
+ | `getHealthStatus` | Return the current `HealthReport` from the global singleton health monitor. |
122
+ | **Types** | `HealthMonitorInstance`, `HealthReport`, `UpdatePriority`, `TeleportHandle`, `ReactiveState`, `VNode` |
100
123
 
101
124
  ---
102
125
 
@@ -156,16 +179,16 @@ Below is the **complete list of public symbols** exported by the runtime and its
156
179
 
157
180
  **Package:** `@jasonshimmy/custom-elements-runtime/event-bus`
158
181
 
159
- | Export | Description |
160
- | ---------------- | ------------------------------------------------------------------------------ |
161
- | `EventHandler` | Type: callback signature used by the event bus. |
162
- | `GlobalEventBus` | Class: singleton implementing a global pub/sub event bus. |
163
- | `eventBus` | Proxy: lazy proxy to the singleton `GlobalEventBus` instance. |
164
- | `emit` | Emit a global event with an optional payload. |
165
- | `on` | Register a handler for a global event (returns unsubscribe function). |
166
- | `off` | Remove a handler for a global event. |
167
- | `once` | Register a one-time handler; returns a Promise resolving with the payload. |
168
- | `listen` | Listen for native `CustomEvent` on the global event bus (returns unsubscribe). |
182
+ | Export | Description |
183
+ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------ |
184
+ | `EventHandler` | Type: callback signature used by the event bus. |
185
+ | `GlobalEventBus` | Class: singleton implementing a global pub/sub event bus. |
186
+ | `eventBus` | Proxy: lazy proxy to the singleton `GlobalEventBus` instance. |
187
+ | `emit` | Emit a global event with an optional payload. |
188
+ | `on` | Register a handler for a global event (returns unsubscribe function). |
189
+ | `off` | Remove a handler for a global event. |
190
+ | `once` | One-time listener. **Callback form** `once(name, handler)` `void`. **Promise form** `once(name)` `Promise<T>`. Do not mix. |
191
+ | `listen` | Listen for native `CustomEvent` on the global event bus (returns unsubscribe). |
169
192
 
170
193
  ---
171
194
 
@@ -184,15 +207,25 @@ Below is the **complete list of public symbols** exported by the runtime and its
184
207
 
185
208
  **Package:** `@jasonshimmy/custom-elements-runtime/router`
186
209
 
187
- | Export | Description |
188
- | ----------------------- | --------------------------------------------------------------------------------------------------------------- |
189
- | `useRouter` | Create and use a router instance configured with routes (client & SSR). |
190
- | `initRouter` | Initialize the router and register `router-view` / `router-link`. |
191
- | `matchRoute` | Match a path against configured routes and extract params. |
192
- | `matchRouteSSR` | SSR-friendly wrapper for route matching. |
193
- | `parseQuery` | Parse a query string into a key/value map. |
194
- | `resolveRouteComponent` | Resolve/load a route's component (supports async loaders + caching). |
195
- | **Types** | `Route`, `RouteState`, `RouteComponent`, `GuardResult`, `RouterLinkProps`, `RouterLinkComputed`, `RouterConfig` |
210
+ | Export | Description |
211
+ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------- |
212
+ | `useRouter` | Create and use a router instance configured with routes (client & SSR). |
213
+ | `initRouter` | Initialize the router and register `router-view` / `router-link`. |
214
+ | `matchRoute` | Match a path against configured routes and extract params. |
215
+ | `matchRouteSSR` | SSR-friendly wrapper for route matching. |
216
+ | `findMatchedRoute` | Find the first matching route entry from an array of routes (lower-level helper). |
217
+ | `parseQuery` | Parse a query string into a key/value map. |
218
+ | `serializeQuery` | Serialize a key/value map into a query string (e.g. `?a=b`). |
219
+ | `normalizePathForRoute` | Normalize a path string for consistent route matching (strips trailing slashes, etc.). |
220
+ | `DEFAULT_SCROLL_CONFIG` | Default scroll-to-fragment configuration object used by the router. |
221
+ | `isDangerousScheme` | Returns `true` for dangerous URL schemes (e.g. `javascript:`). |
222
+ | `isAbsoluteUrl` | Returns `true` when a URL string is absolute (has a protocol). |
223
+ | `safeDecode` | Decode a URI component, returning the original string on error. |
224
+ | `canonicalizeBase` | Normalize a router base path string (strips trailing slashes, ensures leading slash). |
225
+ | `resolveRouteComponent` | Resolve/load a route's component (supports async loaders + caching). |
226
+ | `clearComponentCache` | Clear the resolved route component cache (useful for testing and HMR). |
227
+ | `activeRouterProxy` | Stable proxy to the currently active router; forwards subscriptions and method calls (advanced/testing use). |
228
+ | **Types** | `Route`, `RouteState`, `RouteComponent`, `GuardResult`, `RouterLinkProps`, `RouterLinkComputed`, `RouterConfig`, `Router` |
196
229
 
197
230
  ---
198
231
 
@@ -200,10 +233,14 @@ Below is the **complete list of public symbols** exported by the runtime and its
200
233
 
201
234
  **Package:** `@jasonshimmy/custom-elements-runtime/ssr`
202
235
 
203
- | Export | Description |
204
- | ---------------- | ------------------------------------------------------ |
205
- | `renderToString` | Render a VNode tree to HTML for server-side rendering. |
206
- | `VNode` (type) | The runtime VNode shape used by renderers and SSR. |
236
+ | Export | Description |
237
+ | -------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
238
+ | `renderToString` | Render a VNode tree to HTML for server-side rendering. |
239
+ | `registerEntityMap` | Register a custom named-entity map for SSR `decodeEntities`. |
240
+ | `loadEntityMap` | Async loader that dynamically imports the full HTML5 named-entity map; returns the map to pass to `registerEntityMap`. |
241
+ | `clearRegisteredEntityMap` | Reset the registered entity map back to the built-in minimal set. |
242
+ | `VNode` (type) | The runtime VNode shape used by renderers and SSR. |
243
+ | `RenderOptions` (type) | Options for `renderToString` (`injectSvgNamespace`, `injectKnownNamespaces`). |
207
244
 
208
245
  ### Global Styles (CSS)
209
246
 
@@ -229,6 +266,36 @@ Below is the **complete list of public symbols** exported by the runtime and its
229
266
  | ----------- | ------------------------------------------------- |
230
267
  | `reset.css` | CSS export that contains a base reset for styles. |
231
268
 
269
+ ### Extended Color Palette (TypeScript)
270
+
271
+ **Package:** `@jasonshimmy/custom-elements-runtime/css/colors`
272
+
273
+ Opt-in extended color palette with full Tailwind-compatible color names (`slate`, `gray`, `zinc`, `stone`, `red`, `orange`, `amber`, `yellow`, `lime`, `green`, `emerald`, `teal`, `cyan`, `sky`, `blue`, `indigo`, `violet`, `purple`, `fuchsia`, `pink`, `rose`) with shades 50–950.
274
+
275
+ ```ts
276
+ import { extendedColors } from '@jasonshimmy/custom-elements-runtime/css/colors';
277
+
278
+ // Use individual color scales
279
+ const blueShades = extendedColors.blue; // { '50': '#eff6ff', '100': '...', ... }
280
+
281
+ // Use in a component
282
+ component('branded-card', () => {
283
+ useStyle(
284
+ () => css`
285
+ :host {
286
+ --card-accent: ${extendedColors.violet['500']};
287
+ }
288
+ `,
289
+ );
290
+ return html`<slot></slot>`;
291
+ });
292
+ ```
293
+
294
+ | Export | Description |
295
+ | ---------------- | -------------------------------------------------------------------------------------- |
296
+ | `extendedColors` | Full extended palette — `Record<string, Record<string, string>>` (name → shade → hex). |
297
+ | `ColorScale` | Type: single color scale with shade keys `50`–`950`. |
298
+
232
299
  ## 📖 Documentation Index
233
300
 
234
301
  Explore the complete documentation for every runtime feature:
@@ -258,7 +325,9 @@ Explore the complete documentation for every runtime feature:
258
325
  ### 🎨 **Styling**
259
326
 
260
327
  - [🎨 JIT CSS](./docs/jit-css.md) - On-demand utility-first styling system
328
+ - [📏 Space Utilities](./docs/space-utilities.md) - Tailwind-style `space-x-*` and `space-y-*` spacing utilities
261
329
  - [📝 Prose Typography](./docs/prose.md) - Beautiful typography for long-form content
330
+ - [🎨 Colors](./docs/colors.md) - Extended Tailwind-compatible color palette (`/css/colors` subpath)
262
331
 
263
332
  ### 🔗 **Communication & State**
264
333
 
@@ -269,6 +338,12 @@ Explore the complete documentation for every runtime feature:
269
338
 
270
339
  ### ⚡ **Advanced Features**
271
340
 
341
+ - [⚡ Reactive API](./docs/reactive-api.md) - `watch()` targeted watchers, `computed()` memoization, `watchEffect()` auto-tracking, and `nextTick()`
342
+ - [🏝️ Provide / Inject](./docs/provide-inject.md) - Ancestor-to-descendant dependency injection without prop-drilling
343
+ - [🧩 Composables](./docs/composable.md) - Reusable stateful logic with `createComposable()`
344
+ - [🚀 Teleport](./docs/teleport.md) - Render content outside the shadow root with `useTeleport()`
345
+ - [♻️ Keep-Alive](./docs/keep-alive.md) - Preserve component state across DOM removals with `<cer-keep-alive>`
346
+ - [🩺 Health Monitor](./docs/health-monitor.md) - Track runtime metrics and receive periodic health reports with `createHealthMonitor()`
272
347
  - [🔮 Virtual DOM](./docs/virtual-dom.md) - VDOM implementation and performance details
273
348
  - [🌐 SSR](./docs/ssr.md) - Server-side rendering support
274
349
  - [♻️ HMR](./docs/hmr.md) - Hot module replacement
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Extended Tailwind-compatible color palette — opt-in module.
3
+ *
4
+ * Import individual color objects or the full palette as needed.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * import { extendedColors } from '@jasonshimmy/custom-elements-runtime/css/colors';
9
+ * ```
10
+ */
11
+ /** A single color scale with shade keys 50–950. */
12
+ export type ColorScale = Record<string, string>;
13
+ /** Full extended color palette with Tailwind-compatible color names. */
14
+ export declare const extendedColors: Record<string, ColorScale>;
@@ -1,2 +1,7 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./template-compiler-CXHEnaBh.cjs"),n=require("./namespace-helpers-BCVTzhAO.cjs"),d=require("./transitions-DfcqL-X4.cjs"),o=require("./logger-DiXdWaF-.cjs");class m{metrics=new Map;maxHistorySize=100;checkInterval=3e4;intervalId=null;listeners=new Set;constructor(){this.initializeMetrics(),this.startMonitoring()}initializeMetrics(){this.addMetric("activeComponents",0,1e3,[]),this.addMetric("componentCreateRate",0,50,[]),this.addMetric("componentErrorRate",0,.1,[]),this.addMetric("memoryUsage",0,50*1024*1024,[]),this.addMetric("memoryGrowthRate",0,1024*1024,[]),this.addMetric("averageRenderTime",0,16,[]),this.addMetric("slowRenderCount",0,10,[]),this.addMetric("jitCacheHitRate",100,80,[]),this.addMetric("activeReactiveStates",0,5e3,[]),this.addMetric("dependencyUpdates",0,100,[]),this.addMetric("memoryLeakIndicator",0,.1,[])}addMetric(e,t,r,a){this.metrics.set(e,{name:e,value:t,threshold:r,status:"healthy",lastUpdated:Date.now(),history:[...a]})}updateMetric(e,t){const r=this.metrics.get(e);r&&(r.value=t,r.lastUpdated=Date.now(),r.history.push(t),r.history.length>this.maxHistorySize&&r.history.shift(),r.status=this.calculateStatus(t,r.threshold,e))}calculateStatus(e,t,r){return r==="jitCacheHitRate"?e<t*.5?"critical":e<t?"warning":"healthy":e>t*2?"critical":e>t?"warning":"healthy"}getHealthReport(){const e={};let t="healthy";for(const[a,s]of this.metrics)e[a]={...s},s.status==="critical"?t="critical":s.status==="warning"&&t==="healthy"&&(t="warning");const r=this.generateRecommendations(e);return{overall:t,metrics:e,timestamp:Date.now(),recommendations:r}}generateRecommendations(e){const t=[];return e.memoryUsage?.status!=="healthy"&&t.push("Consider reducing component complexity or implementing better memory cleanup"),e.averageRenderTime?.status!=="healthy"&&t.push("Optimize component render functions - consider lazy loading or virtualization"),e.jitCacheHitRate?.status!=="healthy"&&t.push("JIT CSS cache performance is poor - review CSS patterns for optimization"),e.componentErrorRate?.status!=="healthy"&&t.push("High component error rate detected - review error handling and component logic"),e.activeReactiveStates?.status!=="healthy"&&t.push("High number of reactive states - consider state consolidation or cleanup"),e.memoryLeakIndicator?.status!=="healthy"&&t.push("Potential memory leak detected - review component cleanup and event listener management"),t}startMonitoring(){typeof window>"u"||(this.intervalId=window.setInterval(()=>{this.performHealthCheck()},this.checkInterval))}performHealthCheck(){this.updateMemoryMetrics();const e=this.getHealthReport();this.notifyListeners(e),e.overall==="critical"?o.devError("🚨 Runtime Health: Critical issues detected",e.recommendations):e.overall==="warning"&&o.devWarn("⚠️ Runtime Health: Performance warnings",e.recommendations)}updateMemoryMetrics(){if("memory"in performance&&performance.memory){const e=performance.memory;this.updateMetric("memoryUsage",e.usedJSHeapSize);const t=this.metrics.get("memoryUsage");if(t&&t.history.length>1){const r=t.history[t.history.length-2],s=t.history[t.history.length-1]-r;this.updateMetric("memoryGrowthRate",Math.max(0,s))}}}addListener(e){this.listeners.add(e)}removeListener(e){this.listeners.delete(e)}notifyListeners(e){for(const t of this.listeners)try{t(e)}catch(r){o.devError("Error in health monitor listener:",r)}}stop(){this.intervalId!==null&&(clearInterval(this.intervalId),this.intervalId=null)}getMetricHistory(e){const t=this.metrics.get(e);return t?[...t.history]:[]}clearHistory(){for(const e of this.metrics.values())e.history=[]}}let c=null;function h(){return c||(c=new m),c}function u(l,e){h().updateMetric(l,e)}function p(){return h().getHealthReport()}exports.component=i.component;exports.html=i.html;exports.useEmit=i.useEmit;exports.useOnAttributeChanged=i.useOnAttributeChanged;exports.useOnConnected=i.useOnConnected;exports.useOnDisconnected=i.useOnDisconnected;exports.useOnError=i.useOnError;exports.useProps=i.useProps;exports.useStyle=i.useStyle;exports.computed=n.computed;exports.decodeEntities=n.decodeEntities;exports.flushDOMUpdates=n.flushDOMUpdates;exports.ref=n.ref;exports.unsafeHTML=n.unsafeHTML;exports.watch=n.watch;exports.css=d.css;exports.setDevMode=o.setDevMode;exports.getHealthMonitor=h;exports.getHealthStatus=p;exports.updateHealthMetric=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./template-compiler-C4L8vT-6.cjs"),c=require("./namespace-helpers-4qeKVqQw.cjs"),O=require("./transitions-DPZiuXb9.cjs"),d=require("./logger-CSALKaYm.cjs"),x=100,k=3e4;function A(e,t,o){return o==="jitCacheHitRate"?e<t*.5?"critical":e<t?"warning":"healthy":e>t*2?"critical":e>t?"warning":"healthy"}function D(e){const t=[];return e.memoryUsage?.status!=="healthy"&&t.push("Consider reducing component complexity or implementing better memory cleanup"),e.averageRenderTime?.status!=="healthy"&&t.push("Optimize component render functions - consider lazy loading or virtualization"),e.jitCacheHitRate?.status!=="healthy"&&t.push("JIT CSS cache performance is poor - review CSS patterns for optimization"),e.componentErrorRate?.status!=="healthy"&&t.push("High component error rate detected - review error handling and component logic"),e.activeReactiveStates?.status!=="healthy"&&t.push("High number of reactive states - consider state consolidation or cleanup"),e.memoryLeakIndicator?.status!=="healthy"&&t.push("Potential memory leak detected - review component cleanup and event listener management"),t}function v(){const e=new Map,t=new Set;let o=null;function n(s,i,a){e.set(s,{name:s,value:i,threshold:a,status:"healthy",lastUpdated:Date.now(),history:[]})}function l(){n("activeComponents",0,1e3),n("componentCreateRate",0,50),n("componentErrorRate",0,.1),n("memoryUsage",0,50*1024*1024),n("memoryGrowthRate",0,1024*1024),n("averageRenderTime",0,16),n("slowRenderCount",0,10),n("jitCacheHitRate",100,80),n("activeReactiveStates",0,5e3),n("dependencyUpdates",0,100),n("memoryLeakIndicator",0,.1)}function m(s,i){const a=e.get(s);a&&(a.value=i,a.lastUpdated=Date.now(),a.history.push(i),a.history.length>x&&a.history.shift(),a.status=A(i,a.threshold,s))}function u(){const s={};let i="healthy";for(const[a,h]of e)s[a]={...h},h.status==="critical"?i="critical":h.status==="warning"&&i==="healthy"&&(i="warning");return{overall:i,metrics:s,timestamp:Date.now(),recommendations:D(s)}}function p(){if("memory"in performance&&performance.memory){const s=performance.memory;m("memoryUsage",s.usedJSHeapSize);const i=e.get("memoryUsage");if(i&&i.history.length>1){const a=i.history[i.history.length-2],h=i.history[i.history.length-1];m("memoryGrowthRate",Math.max(0,h-a))}}}function w(s){for(const i of t)try{i(s)}catch(a){d.devError("Error in health monitor listener:",a)}}function _(){p();const s=u();w(s),s.overall==="critical"?d.devError("🚨 Runtime Health: Critical issues detected",s.recommendations):s.overall==="warning"&&d.devWarn("⚠️ Runtime Health: Performance warnings",s.recommendations)}function R(){typeof window>"u"||(o=setInterval(_,k))}function H(){o!==null&&(clearInterval(o),o=null)}function M(s){t.add(s)}function L(s){t.delete(s)}function b(s){const i=e.get(s);return i?[...i.history]:[]}function T(){for(const s of e.values())s.history=[]}return l(),R(),{updateMetric:m,getHealthReport:u,addListener:M,removeListener:L,stop:H,getMetricHistory:b,clearHistory:T}}let f=null;function g(){return f||(f=v()),f}function I(e,t){g().updateMetric(e,t)}function U(){return g().getHealthReport()}function C(){typeof window>"u"||typeof customElements>"u"||customElements.get("cer-keep-alive")||customElements.define("cer-keep-alive",K())}function K(){return class extends HTMLElement{_cache=new Map;_slot=null;_slotListener=null;connectedCallback(){this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot.querySelector("slot")||(this.shadowRoot.innerHTML="<slot></slot>"),this._slot=this.shadowRoot.querySelector("slot"),this._slot&&(this._slotListener=()=>this._handleSlotChange(),this._slot.addEventListener("slotchange",this._slotListener),this._handleSlotChange())}disconnectedCallback(){this._slot&&this._slotListener&&this._slot.removeEventListener("slotchange",this._slotListener),this._slotListener=null}clearCache(t){t?this._cache.delete(t):this._cache.clear()}_handleSlotChange(){if(!this._slot)return;const t=this._slot.assignedElements({flatten:!0});for(const o of t){const n=this._buildCacheKey(o);if(!this._cache.has(n))this._cache.set(n,o);else{const l=this._cache.get(n);if(l!==o)try{o.parentNode?.replaceChild(l,o)}catch{this._cache.set(n,o)}}}}_buildCacheKey(t){const o=t.tagName.toLowerCase(),n=t.getAttribute("id");return n?`${o}:${n}`:o}}}function S(){customElements.get("cer-suspense")||r.component("cer-suspense",()=>{const{pending:e}=r.useProps({pending:!1});return e?r.html`<slot name="fallback"><span>Loading…</span></slot>`:r.html`<slot></slot>`})}function E(){customElements.get("cer-error-boundary")||r.component("cer-error-boundary",()=>{const e=c.ref(!1),t=c.ref("");return r.useOnError(o=>{e.value=!0,t.value=o.message}),r.useExpose({_cerHandleChildError:o=>{e.peek()||(e.value=!0,t.value=o instanceof Error?o.message:String(o))},reset:()=>{e.value=!1,t.value=""}}),e.value?r.html`<slot name="fallback"
2
+ ><div role="alert">
3
+ <strong>Something went wrong.</strong>
4
+ ${t.value?r.html`<p>${t.value}</p>`:r.html``}
5
+ </div></slot
6
+ >`:r.html`<slot></slot>`})}function P(){S(),E(),C()}function q(e){if(typeof document>"u")return{portal:()=>{},destroy:()=>{}};if(r.isDiscoveryRender())return{portal:()=>{},destroy:()=>{}};if(r.getCurrentComponentContext()){const o=c.reactiveSystem.getOrCreateState(null),n=o.peek();if(n!==null)return n;const l=y(e,()=>o.initSilent(null));return o.initSilent(l),l}return y(e)}function y(e,t){const o=typeof e=="string"?document.querySelector(e):e;if(!o)return console.warn(`[useTeleport] Target "${String(e)}" not found in the document. Teleported content will not be rendered.`),{portal:()=>{},destroy:()=>{}};const n=document.createElement("cer-teleport");n.dataset.cerTeleport="",o.appendChild(n);const l={};return{portal(u){const p=u==null?[]:Array.isArray(u)?u:[u];r.vdomRenderer(n,p,void 0,l)},destroy(){try{r.vdomRenderer(n,[],void 0,l)}catch{}n.parentNode&&n.parentNode.removeChild(n),t?.()}}}exports.component=r.component;exports.createComposable=r.createComposable;exports.getCurrentComponentContext=r.getCurrentComponentContext;exports.html=r.html;exports.inject=r.inject;exports.provide=r.provide;exports.useEmit=r.useEmit;exports.useExpose=r.useExpose;exports.useOnAttributeChanged=r.useOnAttributeChanged;exports.useOnConnected=r.useOnConnected;exports.useOnDisconnected=r.useOnDisconnected;exports.useOnError=r.useOnError;exports.useProps=r.useProps;exports.useSlots=r.useSlots;exports.useStyle=r.useStyle;exports.ReactiveState=c.ReactiveState;exports.computed=c.computed;exports.decodeEntities=c.decodeEntities;exports.flushDOMUpdates=c.flushDOMUpdates;exports.isReactiveState=c.isReactiveState;exports.nextTick=c.nextTick;exports.ref=c.ref;exports.scheduleWithPriority=c.scheduleWithPriority;exports.unsafeHTML=c.unsafeHTML;exports.watch=c.watch;exports.watchEffect=c.watchEffect;exports.css=O.css;exports.devLog=d.devLog;exports.setDevMode=d.setDevMode;exports.createHealthMonitor=v;exports.getHealthMonitor=g;exports.getHealthStatus=U;exports.registerBuiltinComponents=P;exports.registerErrorBoundary=E;exports.registerKeepAlive=C;exports.registerSuspense=S;exports.updateHealthMetric=I;exports.useTeleport=q;
2
7
  //# sourceMappingURL=custom-elements-runtime.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"custom-elements-runtime.cjs.js","sources":["../src/lib/runtime/monitoring/health-monitor.ts"],"sourcesContent":["/**\n * Runtime Health Monitoring System\n * Tracks framework health metrics and provides early warning for potential issues\n */\n\nimport { devWarn, devError } from '../logger';\n\ninterface HealthMetric {\n name: string;\n value: number;\n threshold: number;\n status: 'healthy' | 'warning' | 'critical';\n lastUpdated: number;\n history: number[];\n}\n\ninterface HealthReport {\n overall: 'healthy' | 'warning' | 'critical';\n metrics: Record<string, HealthMetric>;\n timestamp: number;\n recommendations: string[];\n}\n\nexport class HealthMonitor {\n private metrics = new Map<string, HealthMetric>();\n private readonly maxHistorySize = 100;\n private readonly checkInterval = 30000; // 30 seconds\n private intervalId: number | null = null;\n private listeners = new Set<(report: HealthReport) => void>();\n\n constructor() {\n this.initializeMetrics();\n this.startMonitoring();\n }\n\n /**\n * Initialize default health metrics\n */\n private initializeMetrics(): void {\n // Component metrics\n this.addMetric('activeComponents', 0, 1000, []);\n this.addMetric('componentCreateRate', 0, 50, []); // Components per second\n this.addMetric('componentErrorRate', 0, 0.1, []); // Error rate percentage\n\n // Memory metrics\n this.addMetric('memoryUsage', 0, 50 * 1024 * 1024, []); // 50MB threshold\n this.addMetric('memoryGrowthRate', 0, 1024 * 1024, []); // 1MB/check threshold\n\n // Performance metrics\n this.addMetric('averageRenderTime', 0, 16, []); // 16ms for 60fps\n this.addMetric('slowRenderCount', 0, 10, []); // Renders >16ms per check\n this.addMetric('jitCacheHitRate', 100, 80, []); // Cache hit rate percentage\n\n // Reactive system metrics\n this.addMetric('activeReactiveStates', 0, 5000, []);\n this.addMetric('dependencyUpdates', 0, 100, []); // Updates per check\n this.addMetric('memoryLeakIndicator', 0, 0.1, []); // Growth without cleanup\n }\n\n /**\n * Add a new health metric\n */\n private addMetric(\n name: string,\n value: number,\n threshold: number,\n history: number[],\n ): void {\n this.metrics.set(name, {\n name,\n value,\n threshold,\n status: 'healthy',\n lastUpdated: Date.now(),\n history: [...history],\n });\n }\n\n /**\n * Update a specific health metric\n */\n updateMetric(name: string, value: number): void {\n const metric = this.metrics.get(name);\n if (!metric) return;\n\n metric.value = value;\n metric.lastUpdated = Date.now();\n\n // Update history\n metric.history.push(value);\n if (metric.history.length > this.maxHistorySize) {\n metric.history.shift();\n }\n\n // Update status based on threshold\n metric.status = this.calculateStatus(value, metric.threshold, name);\n }\n\n /**\n * Calculate health status based on value and threshold\n */\n private calculateStatus(\n value: number,\n threshold: number,\n metricName: string,\n ): 'healthy' | 'warning' | 'critical' {\n // Special handling for different metric types\n if (metricName === 'jitCacheHitRate') {\n // Lower is worse for cache hit rate\n if (value < threshold * 0.5) return 'critical';\n if (value < threshold) return 'warning';\n return 'healthy';\n }\n\n // Default: higher is worse\n if (value > threshold * 2) return 'critical';\n if (value > threshold) return 'warning';\n return 'healthy';\n }\n\n /**\n * Get current health report\n */\n getHealthReport(): HealthReport {\n const metrics: Record<string, HealthMetric> = {};\n let overallStatus: 'healthy' | 'warning' | 'critical' = 'healthy';\n\n // Collect all metrics\n for (const [name, metric] of this.metrics) {\n metrics[name] = { ...metric };\n\n // Determine overall status (worst metric wins)\n if (metric.status === 'critical') {\n overallStatus = 'critical';\n } else if (metric.status === 'warning' && overallStatus === 'healthy') {\n overallStatus = 'warning';\n }\n }\n\n const recommendations = this.generateRecommendations(metrics);\n\n return {\n overall: overallStatus,\n metrics,\n timestamp: Date.now(),\n recommendations,\n };\n }\n\n /**\n * Generate actionable recommendations based on metrics\n */\n private generateRecommendations(\n metrics: Record<string, HealthMetric>,\n ): string[] {\n const recommendations: string[] = [];\n\n if (metrics.memoryUsage?.status !== 'healthy') {\n recommendations.push(\n 'Consider reducing component complexity or implementing better memory cleanup',\n );\n }\n\n if (metrics.averageRenderTime?.status !== 'healthy') {\n recommendations.push(\n 'Optimize component render functions - consider lazy loading or virtualization',\n );\n }\n\n if (metrics.jitCacheHitRate?.status !== 'healthy') {\n recommendations.push(\n 'JIT CSS cache performance is poor - review CSS patterns for optimization',\n );\n }\n\n if (metrics.componentErrorRate?.status !== 'healthy') {\n recommendations.push(\n 'High component error rate detected - review error handling and component logic',\n );\n }\n\n if (metrics.activeReactiveStates?.status !== 'healthy') {\n recommendations.push(\n 'High number of reactive states - consider state consolidation or cleanup',\n );\n }\n\n if (metrics.memoryLeakIndicator?.status !== 'healthy') {\n recommendations.push(\n 'Potential memory leak detected - review component cleanup and event listener management',\n );\n }\n\n return recommendations;\n }\n\n /**\n * Start periodic health monitoring\n */\n private startMonitoring(): void {\n if (typeof window === 'undefined') return; // Skip in SSR\n\n this.intervalId = window.setInterval(() => {\n this.performHealthCheck();\n }, this.checkInterval);\n }\n\n /**\n * Perform comprehensive health check\n */\n private performHealthCheck(): void {\n // Update memory metrics\n this.updateMemoryMetrics();\n\n // Generate and emit health report\n const report = this.getHealthReport();\n this.notifyListeners(report);\n\n // Log critical issues\n if (report.overall === 'critical') {\n devError(\n '🚨 Runtime Health: Critical issues detected',\n report.recommendations,\n );\n } else if (report.overall === 'warning') {\n devWarn(\n '⚠️ Runtime Health: Performance warnings',\n report.recommendations,\n );\n }\n }\n\n /**\n * Update memory-related metrics\n */\n private updateMemoryMetrics(): void {\n if (\n 'memory' in performance &&\n (performance as Record<string, unknown>).memory\n ) {\n const memory = (performance as Record<string, unknown>).memory as {\n usedJSHeapSize: number;\n totalJSHeapSize: number;\n jsHeapSizeLimit: number;\n };\n this.updateMetric('memoryUsage', memory.usedJSHeapSize);\n\n // Calculate memory growth rate\n const memoryMetric = this.metrics.get('memoryUsage');\n if (memoryMetric && memoryMetric.history.length > 1) {\n const previous = memoryMetric.history[memoryMetric.history.length - 2];\n const current = memoryMetric.history[memoryMetric.history.length - 1];\n const growthRate = current - previous;\n this.updateMetric('memoryGrowthRate', Math.max(0, growthRate));\n }\n }\n }\n\n /**\n * Add health report listener\n */\n addListener(listener: (report: HealthReport) => void): void {\n this.listeners.add(listener);\n }\n\n /**\n * Remove health report listener\n */\n removeListener(listener: (report: HealthReport) => void): void {\n this.listeners.delete(listener);\n }\n\n /**\n * Notify all listeners of health report\n */\n private notifyListeners(report: HealthReport): void {\n for (const listener of this.listeners) {\n try {\n listener(report);\n } catch (error) {\n devError('Error in health monitor listener:', error);\n }\n }\n }\n\n /**\n * Stop health monitoring\n */\n stop(): void {\n if (this.intervalId !== null) {\n clearInterval(this.intervalId);\n this.intervalId = null;\n }\n }\n\n /**\n * Get specific metric history for analysis\n */\n getMetricHistory(name: string): number[] {\n const metric = this.metrics.get(name);\n return metric ? [...metric.history] : [];\n }\n\n /**\n * Clear all metrics history\n */\n clearHistory(): void {\n for (const metric of this.metrics.values()) {\n metric.history = [];\n }\n }\n}\n\n// Global health monitor instance\nlet healthMonitor: HealthMonitor | null = null;\n\n/**\n * Get the global health monitor instance\n */\nexport function getHealthMonitor(): HealthMonitor {\n if (!healthMonitor) {\n healthMonitor = new HealthMonitor();\n }\n return healthMonitor;\n}\n\n/**\n * Update a health metric from anywhere in the framework\n */\nexport function updateHealthMetric(name: string, value: number): void {\n getHealthMonitor().updateMetric(name, value);\n}\n\n/**\n * Get current health status\n */\nexport function getHealthStatus(): HealthReport {\n return getHealthMonitor().getHealthReport();\n}\n"],"names":["HealthMonitor","name","value","threshold","history","metric","metricName","metrics","overallStatus","recommendations","report","devError","devWarn","memory","memoryMetric","previous","growthRate","listener","error","healthM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C9C,OAAOF,EAAA,EAAmB,gBAAA,CAC5B"}
1
+ {"version":3,"file":"custom-elements-runtime.cjs.js","sources":["../src/lib/runtime/monitoring/health-monitor.ts","../src/lib/keep-alive.ts","../src/lib/runtime/builtin-components.ts","../src/lib/teleport.ts"],"sourcesContent":["/**\n * Runtime Health Monitoring System\n * Tracks framework health metrics and provides early warning for potential issues\n */\n\nimport { devWarn, devError } from '../logger';\n\ninterface HealthMetric {\n name: string;\n value: number;\n threshold: number;\n status: 'healthy' | 'warning' | 'critical';\n lastUpdated: number;\n history: number[];\n}\n\ninterface HealthReport {\n overall: 'healthy' | 'warning' | 'critical';\n metrics: Record<string, HealthMetric>;\n timestamp: number;\n recommendations: string[];\n}\nexport type { HealthReport };\n\n/**\n * Public interface for a health monitor instance.\n * All state is managed internally via closures — no class syntax.\n */\nexport interface HealthMonitorInstance {\n /** Update a specific health metric value */\n updateMetric(name: string, value: number): void;\n /** Get the current health report */\n getHealthReport(): HealthReport;\n /** Add a listener to be notified when a health check runs */\n addListener(listener: (report: HealthReport) => void): void;\n /** Remove a previously registered listener */\n removeListener(listener: (report: HealthReport) => void): void;\n /** Stop the periodic health monitoring timer */\n stop(): void;\n /** Get historical values for a specific metric */\n getMetricHistory(name: string): number[];\n /** Clear all metric history */\n clearHistory(): void;\n}\n\nconst MAX_HISTORY_SIZE = 100;\nconst CHECK_INTERVAL = 30_000; // 30 seconds\n\nfunction calcStatus(\n value: number,\n threshold: number,\n metricName: string,\n): 'healthy' | 'warning' | 'critical' {\n if (metricName === 'jitCacheHitRate') {\n if (value < threshold * 0.5) return 'critical';\n if (value < threshold) return 'warning';\n return 'healthy';\n }\n if (value > threshold * 2) return 'critical';\n if (value > threshold) return 'warning';\n return 'healthy';\n}\n\nfunction buildRecommendations(metrics: Record<string, HealthMetric>): string[] {\n const out: string[] = [];\n if (metrics.memoryUsage?.status !== 'healthy')\n out.push(\n 'Consider reducing component complexity or implementing better memory cleanup',\n );\n if (metrics.averageRenderTime?.status !== 'healthy')\n out.push(\n 'Optimize component render functions - consider lazy loading or virtualization',\n );\n if (metrics.jitCacheHitRate?.status !== 'healthy')\n out.push(\n 'JIT CSS cache performance is poor - review CSS patterns for optimization',\n );\n if (metrics.componentErrorRate?.status !== 'healthy')\n out.push(\n 'High component error rate detected - review error handling and component logic',\n );\n if (metrics.activeReactiveStates?.status !== 'healthy')\n out.push(\n 'High number of reactive states - consider state consolidation or cleanup',\n );\n if (metrics.memoryLeakIndicator?.status !== 'healthy')\n out.push(\n 'Potential memory leak detected - review component cleanup and event listener management',\n );\n return out;\n}\n\n/**\n * Create a new health monitor instance.\n * All mutable state lives in closures — no `class` or `this`.\n */\nexport function createHealthMonitor(): HealthMonitorInstance {\n const metricsMap = new Map<string, HealthMetric>();\n const listeners = new Set<(report: HealthReport) => void>();\n let intervalId: ReturnType<typeof setInterval> | null = null;\n\n function addMetric(name: string, value: number, threshold: number): void {\n metricsMap.set(name, {\n name,\n value,\n threshold,\n status: 'healthy',\n lastUpdated: Date.now(),\n history: [],\n });\n }\n\n function initializeMetrics(): void {\n addMetric('activeComponents', 0, 1000);\n addMetric('componentCreateRate', 0, 50);\n addMetric('componentErrorRate', 0, 0.1);\n addMetric('memoryUsage', 0, 50 * 1024 * 1024);\n addMetric('memoryGrowthRate', 0, 1024 * 1024);\n addMetric('averageRenderTime', 0, 16);\n addMetric('slowRenderCount', 0, 10);\n addMetric('jitCacheHitRate', 100, 80);\n addMetric('activeReactiveStates', 0, 5000);\n addMetric('dependencyUpdates', 0, 100);\n addMetric('memoryLeakIndicator', 0, 0.1);\n }\n\n function updateMetric(name: string, value: number): void {\n const metric = metricsMap.get(name);\n if (!metric) return;\n metric.value = value;\n metric.lastUpdated = Date.now();\n metric.history.push(value);\n if (metric.history.length > MAX_HISTORY_SIZE) metric.history.shift();\n metric.status = calcStatus(value, metric.threshold, name);\n }\n\n function getHealthReport(): HealthReport {\n const snapshot: Record<string, HealthMetric> = {};\n let overall: 'healthy' | 'warning' | 'critical' = 'healthy';\n for (const [name, metric] of metricsMap) {\n snapshot[name] = { ...metric };\n if (metric.status === 'critical') overall = 'critical';\n else if (metric.status === 'warning' && overall === 'healthy')\n overall = 'warning';\n }\n return {\n overall,\n metrics: snapshot,\n timestamp: Date.now(),\n recommendations: buildRecommendations(snapshot),\n };\n }\n\n function updateMemoryMetrics(): void {\n if (\n 'memory' in performance &&\n (performance as Record<string, unknown>).memory\n ) {\n const mem = (performance as Record<string, unknown>).memory as {\n usedJSHeapSize: number;\n };\n updateMetric('memoryUsage', mem.usedJSHeapSize);\n const m = metricsMap.get('memoryUsage');\n if (m && m.history.length > 1) {\n const prev = m.history[m.history.length - 2];\n const curr = m.history[m.history.length - 1];\n updateMetric('memoryGrowthRate', Math.max(0, curr - prev));\n }\n }\n }\n\n function notifyListeners(report: HealthReport): void {\n for (const listener of listeners) {\n try {\n listener(report);\n } catch (e) {\n devError('Error in health monitor listener:', e);\n }\n }\n }\n\n function performHealthCheck(): void {\n updateMemoryMetrics();\n const report = getHealthReport();\n notifyListeners(report);\n if (report.overall === 'critical')\n devError(\n '🚨 Runtime Health: Critical issues detected',\n report.recommendations,\n );\n else if (report.overall === 'warning')\n devWarn(\n '⚠️ Runtime Health: Performance warnings',\n report.recommendations,\n );\n }\n\n function startMonitoring(): void {\n if (typeof window === 'undefined') return;\n intervalId = setInterval(performHealthCheck, CHECK_INTERVAL);\n }\n\n function stop(): void {\n if (intervalId !== null) {\n clearInterval(intervalId);\n intervalId = null;\n }\n }\n\n function addListener(listener: (report: HealthReport) => void): void {\n listeners.add(listener);\n }\n function removeListener(listener: (report: HealthReport) => void): void {\n listeners.delete(listener);\n }\n function getMetricHistory(name: string): number[] {\n const m = metricsMap.get(name);\n return m ? [...m.history] : [];\n }\n function clearHistory(): void {\n for (const m of metricsMap.values()) m.history = [];\n }\n\n initializeMetrics();\n startMonitoring();\n\n return {\n updateMetric,\n getHealthReport,\n addListener,\n removeListener,\n stop,\n getMetricHistory,\n clearHistory,\n };\n}\n\n// Global singleton\nlet _monitor: HealthMonitorInstance | null = null;\n\n/**\n * Get the global health monitor singleton instance.\n */\nexport function getHealthMonitor(): HealthMonitorInstance {\n if (!_monitor) _monitor = createHealthMonitor();\n return _monitor;\n}\n\n/**\n * Update a health metric from anywhere in the framework.\n */\nexport function updateHealthMetric(name: string, value: number): void {\n getHealthMonitor().updateMetric(name, value);\n}\n\n/**\n * Get the current health status report.\n */\nexport function getHealthStatus(): HealthReport {\n return getHealthMonitor().getHealthReport();\n}\n","/**\n * keep-alive.ts\n *\n * Preserves component state when a component is removed from and later\n * re-inserted into the DOM. By default, custom elements lose all JavaScript\n * state when `disconnectedCallback` fires. `cer-keep-alive` intercepts\n * that lifecycle and keeps the child element alive in memory, re-attaching\n * it when a matching component is re-inserted.\n *\n * ## Usage\n *\n * Wrap any custom element with `<cer-keep-alive>`:\n * ```html\n * <cer-keep-alive>\n * <my-counter></my-counter>\n * </cer-keep-alive>\n * ```\n *\n * Or register it programmatically:\n * ```ts\n * import { registerKeepAlive } from '@jasonshimmy/custom-elements-runtime';\n * registerKeepAlive(); // registers <cer-keep-alive> globally\n * ```\n *\n * ## How it works\n *\n * `cer-keep-alive` uses a slotted layout. When a slotted child component is\n * about to leave the DOM (via a re-render of a parent), KeepAlive intercepts\n * `slotchange` events and preserves the detached child element in an internal\n * cache keyed by tag name. When the same tag re-appears in the slot, the\n * cached element is re-inserted, restoring all JavaScript state.\n *\n * ## Limitations\n *\n * - The first slot child per tag name is cached. Multiple children with the\n * same tag use separate cache entries keyed by their `id` attribute.\n * - Only components registered with the same tag name are matched.\n * - Cache entries can be manually evicted with `clearCache()`.\n */\n\n/** Cache key = tagName[:id] */\ntype CacheKey = string;\n\n/**\n * Register the `<cer-keep-alive>` custom element.\n * Safe to call multiple times — subsequent calls are no-ops.\n *\n * @example\n * ```ts\n * import { registerKeepAlive } from '@jasonshimmy/custom-elements-runtime';\n * registerKeepAlive();\n * ```\n */\nexport function registerKeepAlive(): void {\n if (\n typeof window === 'undefined' ||\n typeof customElements === 'undefined' ||\n customElements.get('cer-keep-alive')\n ) {\n return;\n }\n\n customElements.define('cer-keep-alive', createKeepAliveClass());\n}\n\nfunction createKeepAliveClass(): CustomElementConstructor {\n return class CerKeepAlive extends HTMLElement {\n /** Preserved component instances keyed by tag[:id]. */\n private _cache = new Map<CacheKey, Element>();\n private _slot: HTMLSlotElement | null = null;\n private _slotListener: (() => void) | null = null;\n\n connectedCallback(): void {\n if (!this.shadowRoot) {\n this.attachShadow({ mode: 'open' });\n }\n\n if (!this.shadowRoot!.querySelector('slot')) {\n this.shadowRoot!.innerHTML = '<slot></slot>';\n }\n\n this._slot = this.shadowRoot!.querySelector('slot');\n if (this._slot) {\n this._slotListener = () => this._handleSlotChange();\n this._slot.addEventListener('slotchange', this._slotListener);\n // Process current slotted content\n this._handleSlotChange();\n }\n }\n\n disconnectedCallback(): void {\n if (this._slot && this._slotListener) {\n this._slot.removeEventListener('slotchange', this._slotListener);\n }\n this._slotListener = null;\n }\n\n /**\n * Evict a cached element by its cache key (`tagName` or `tagName:id`).\n * The evicted element is disconnected and removed from the cache.\n */\n clearCache(key?: CacheKey): void {\n if (key) {\n this._cache.delete(key);\n } else {\n this._cache.clear();\n }\n }\n\n private _handleSlotChange(): void {\n if (!this._slot) return;\n\n const slottedElements = this._slot.assignedElements({ flatten: true });\n\n for (const child of slottedElements) {\n const cacheKey = this._buildCacheKey(child);\n\n if (!this._cache.has(cacheKey)) {\n // New element — cache it so we can restore it later\n this._cache.set(cacheKey, child);\n } else {\n const cached = this._cache.get(cacheKey)!;\n if (cached !== child) {\n // A different instance appeared for the same slot.\n // Replace it with the cached instance to restore state.\n try {\n child.parentNode?.replaceChild(cached, child);\n } catch {\n // If replacement fails, update the cache with the new element\n this._cache.set(cacheKey, child);\n }\n }\n }\n }\n }\n\n private _buildCacheKey(el: Element): CacheKey {\n const tag = el.tagName.toLowerCase();\n const id = el.getAttribute('id');\n return id ? `${tag}:${id}` : tag;\n }\n };\n}\n","/**\n * Built-in utility components provided by the custom-elements runtime.\n *\n * These components are registered automatically when this module is imported.\n * They are designed to be minimal, tree-shakeable, and zero-dependency.\n *\n * Included components:\n * - `<cer-suspense>` — Shows a fallback while async work is pending\n * - `<cer-error-boundary>` — Catches render errors and shows a fallback UI\n * - `<cer-keep-alive>` — Preserves component state across DOM removal/re-insertion\n */\n\nimport { component } from './component';\nimport { html } from './template-compiler';\nimport { ref } from './reactive';\nimport { useProps, useOnError, useExpose } from './hooks';\nimport { registerKeepAlive } from '../keep-alive';\n\n// ── cer-suspense ──────────────────────────────────────────────────────────────\n\n/**\n * A built-in component that conditionally renders either the default slot\n * content or the `fallback` slot content, controlled by the `pending` prop.\n *\n * Use the `pending` attribute/property to signal that async work is in\n * progress; the component will swap to the `fallback` slot until `pending`\n * becomes falsy.\n *\n * @example\n * ```html\n * <cer-suspense pending>\n * <!-- shown when pending=false -->\n * <my-async-content></my-async-content>\n *\n * <!-- shown while pending=true -->\n * <div slot=\"fallback\">Loading…</div>\n * </cer-suspense>\n * ```\n *\n * @example Programmatic usage\n * ```ts\n * component('my-data-loader', () => {\n * const pending = ref(true);\n * useOnConnected(async () => {\n * await fetchData();\n * pending.value = false;\n * });\n * return html`\n * <cer-suspense pending=\"${pending.value}\">\n * <my-data-view></my-data-view>\n * <div slot=\"fallback\">Loading data…</div>\n * </cer-suspense>\n * `;\n * });\n * ```\n */\nexport function registerSuspense(): void {\n if (customElements.get('cer-suspense')) return;\n\n component('cer-suspense', () => {\n const { pending } = useProps({ pending: false });\n\n return pending\n ? html`<slot name=\"fallback\"><span>Loading…</span></slot>`\n : html`<slot></slot>`;\n });\n}\n\n// ── cer-error-boundary ────────────────────────────────────────────────────────\n\n/**\n * A built-in component that catches errors thrown during child component\n * rendering and displays a fallback UI instead of crashing the page.\n *\n * Errors are caught via the `useOnError` lifecycle hook. Once an error is\n * caught the component switches to showing the `fallback` named slot (or a\n * default \"Something went wrong\" message if no fallback slot is provided).\n *\n * Call the custom `reset()` method on the element to clear the error and\n * attempt re-rendering the default slot.\n *\n * @example\n * ```html\n * <cer-error-boundary>\n * <my-risky-component></my-risky-component>\n *\n * <div slot=\"fallback\">\n * <p>Something went wrong. <button onclick=\"this.closest('cer-error-boundary').reset()\">Retry</button></p>\n * </div>\n * </cer-error-boundary>\n * ```\n */\nexport function registerErrorBoundary(): void {\n if (customElements.get('cer-error-boundary')) return;\n\n component('cer-error-boundary', () => {\n const hasError = ref(false);\n const errorMessage = ref('');\n\n useOnError((err: Error) => {\n hasError.value = true;\n errorMessage.value = err.message;\n });\n\n // Expose a reset() method so parent templates can call\n // `errorBoundaryRef.value.reset()` to clear the error and retry.\n // Also expose an internal `_cerHandleChildError` receiver so that the\n // component runtime can propagate uncaught errors from slotted child\n // components up to the nearest ancestor <cer-error-boundary>.\n useExpose({\n _cerHandleChildError: (err: unknown) => {\n // Use peek() to read the current value without registering a reactive\n // dependency — the child component's render context may be active when\n // this handler runs, and we must not accidentally subscribe the child\n // to this boundary's internal state.\n if (!hasError.peek()) {\n hasError.value = true;\n errorMessage.value = err instanceof Error ? err.message : String(err);\n }\n },\n reset: () => {\n hasError.value = false;\n errorMessage.value = '';\n },\n });\n\n return hasError.value\n ? html`<slot name=\"fallback\"\n ><div role=\"alert\">\n <strong>Something went wrong.</strong>\n ${errorMessage.value ? html`<p>${errorMessage.value}</p>` : html``}\n </div></slot\n >`\n : html`<slot></slot>`;\n });\n}\n\n// ── Auto-register all components ─────────────────────────────────────────────\n\n/**\n * Register all built-in components (`cer-suspense`, `cer-error-boundary`,\n * `cer-keep-alive`).\n * Safe to call multiple times — each registration is guarded by a\n * `customElements.get()` check.\n */\nexport function registerBuiltinComponents(): void {\n registerSuspense();\n registerErrorBoundary();\n registerKeepAlive();\n}\n","/**\n * teleport.ts\n *\n * Renders virtual DOM content into an arbitrary DOM target located outside\n * the current component's Shadow Root. Useful for modals, tooltips, popovers,\n * and any UI that must visually escape the component boundary.\n *\n * @example\n * ```ts\n * import { component, html, ref, useOnDisconnected, useTeleport } from '@jasonshimmy/custom-elements-runtime';\n *\n * component('modal-trigger', () => {\n * const isOpen = ref(false);\n *\n * // Render modal content into <body> outside the shadow root\n * const { portal, destroy } = useTeleport('#modal-root');\n * useOnDisconnected(destroy);\n *\n * // Call portal() to update the teleported content on each render\n * if (isOpen.value) {\n * portal(html`<div class=\"modal\">\n * <h2>Hello</h2>\n * <button @click=\"${() => (isOpen.value = false)}\">Close</button>\n * </div>`);\n * } else {\n * portal(null);\n * }\n *\n * return html`\n * <button @click=\"${() => (isOpen.value = true)}\">Open modal</button>\n * `;\n * });\n * ```\n */\n\nimport type { VNode, VDomRefs } from './runtime/types';\nimport { vdomRenderer } from './runtime/vdom';\nimport { reactiveSystem } from './runtime/reactive';\nimport { getCurrentComponentContext, isDiscoveryRender } from './runtime/hooks';\n\n/** Handle returned by {@link useTeleport} for managing a portal. */\nexport interface TeleportHandle {\n /**\n * Render (or clear) content at the teleport target.\n * Pass `null` or `undefined` to remove previously rendered content.\n */\n portal(content: VNode | VNode[] | null | undefined): void;\n\n /**\n * Destroy the teleport container and clean up all rendered content.\n * Call this in `useOnDisconnected` to prevent memory leaks.\n */\n destroy(): void;\n}\n\n/**\n * Create a teleport portal that renders content outside the current Shadow Root.\n *\n * @param target - A CSS selector string or an `Element` reference to render into.\n * @returns A {@link TeleportHandle} with `portal()` (update content) and `destroy()` (cleanup).\n *\n * @example\n * ```ts\n * import { component, html, useOnDisconnected, useTeleport } from '@jasonshimmy/custom-elements-runtime';\n *\n * component('my-tooltip', () => {\n * const { portal, destroy } = useTeleport('body');\n * useOnDisconnected(destroy);\n *\n * portal(html`<div class=\"tooltip\">Tooltip content</div>`);\n * return html`<span>Hover me</span>`;\n * });\n * ```\n */\nexport function useTeleport(target: string | Element): TeleportHandle {\n // SSR guard\n if (typeof document === 'undefined') {\n return { portal: () => {}, destroy: () => {} };\n }\n\n // During discovery render the component is not yet mounted — return a no-op\n // handle so the library can detect props/hooks without side-effects.\n if (isDiscoveryRender()) {\n return { portal: () => {}, destroy: () => {} };\n }\n\n // If called inside a component render, use the reactive state-index slot\n // mechanism to ensure the same handle is returned on every re-render of the\n // same component instance. Without this, each re-render would create a new\n // <cer-teleport> container in the target, leaking all but the last one.\n const ctx = getCurrentComponentContext();\n if (ctx) {\n // getOrCreateState uses an incrementing stateIndex that is reset to 0 at\n // the start of each render, so the same call site always gets the same slot.\n const slot = reactiveSystem.getOrCreateState<TeleportHandle | null>(null);\n const existing = slot.peek();\n if (existing !== null) {\n return existing;\n }\n // First render: create the handle and store it without triggering a\n // reactive update (initSilent bypasses triggerUpdate).\n // Pass a slot-invalidation callback so that destroy() clears the slot,\n // allowing a reconnected component to create a fresh container.\n const handle = _createTeleportHandle(target, () => slot.initSilent(null));\n slot.initSilent(handle);\n return handle;\n }\n\n // Outside a component context (e.g. called directly in tests or scripts):\n // fall through to a non-cached, non-stable handle.\n return _createTeleportHandle(target);\n}\n\n/** Internal: create a fresh teleport handle pointing at `target`.\n * @param onDestroy - Optional callback invoked after cleanup in destroy(), used\n * to invalidate a cached slot so the next render creates a fresh handle.\n */\nfunction _createTeleportHandle(\n target: string | Element,\n onDestroy?: () => void,\n): TeleportHandle {\n const targetEl =\n typeof target === 'string'\n ? (document.querySelector(target) as Element | null)\n : target;\n\n if (!targetEl) {\n console.warn(\n `[useTeleport] Target \"${String(target)}\" not found in the document. ` +\n 'Teleported content will not be rendered.',\n );\n return { portal: () => {}, destroy: () => {} };\n }\n\n // Create a dedicated container so we never clobber sibling content.\n const container = document.createElement('cer-teleport');\n container.dataset.cerTeleport = '';\n targetEl.appendChild(container);\n\n // Shared refs bag — passed consistently so ref directives work across updates.\n const refs: VDomRefs = {};\n\n const handle: TeleportHandle = {\n portal(content: VNode | VNode[] | null | undefined): void {\n const nodes: VNode[] =\n content == null ? [] : Array.isArray(content) ? content : [content];\n // vdomRenderer stores _prevVNode/_prevDom on the root object for diffing.\n // Casting to ShadowRoot is safe: we only access properties that exist on\n // HTMLElement (firstChild, appendChild, replaceChild, childNodes).\n vdomRenderer(container as unknown as ShadowRoot, nodes, undefined, refs);\n },\n\n destroy(): void {\n // Render empty nodes to clean up event listeners and refs.\n try {\n vdomRenderer(container as unknown as ShadowRoot, [], undefined, refs);\n } catch {\n /* best-effort cleanup */\n }\n if (container.parentNode) {\n container.parentNode.removeChild(container);\n }\n // Invalidate the cached slot so that if the component reconnects and\n // re-renders, useTeleport() creates a fresh container rather than\n // reusing this destroyed one.\n onDestroy?.();\n },\n };\n\n return handle;\n}\n"],"names":["MAX_HISTORY_SIZE","CHECK_INTERVAL","calcStatus","value","threshold","metricName","buildRecommendations","metrics","out","createHealthMonitor","metricsMap","listeners","intervalId","addMetric","name","initializeMetrics","updateMetric","metric","getHealthReport","snapshot","overall","updateMemoryMetrics","mem","m","prev","curr","notifyListeners","report","listener","e","devError","performHealthCheck","devWarn","startMonitoring","stop","addListener","removeListener","getMetricHistory","clearHistory","_monitor","getHealthMonitor","updateHealthMetric","getHealthStatus","registerKeepAlive","createKeepAliveClass","key","slottedElements","child","cacheKey","cached","el","tag","id","registerSuspense","component","pending","useProps","html","registerErrorBoundary","hasError","ref","errorMessage","useOnError","err","useExpose","registerBuiltinComponents","useTeleport","target","isDiscoveryRender","getCurrentComponentContext","slot","reactiveSystem","existing","handle","_createTeleportHandle","onDestroy","targetEl","container","refs","content","nodes","vdomRenderer"],"mappings":"6PA6CMA,EAAmB,IACnBC,EAAiB,IAEvB,SAASC,EACPC,EACAC,EACAC,EACoC,CACpC,OAAIA,IAAe,kBACbF,EAAQC,EAAY,GAAY,WAChCD,EAAQC,EAAkB,UACvB,UAELD,EAAQC,EAAY,EAAU,WAC9BD,EAAQC,EAAkB,UACvB,SACT,CAEA,SAASE,EAAqBC,EAAiD,CAC7E,MAAMC,EAAgB,CAAA,EACtB,OAAID,EAAQ,aAAa,SAAW,WAClCC,EAAI,KACF,8EAAA,EAEAD,EAAQ,mBAAmB,SAAW,WACxCC,EAAI,KACF,+EAAA,EAEAD,EAAQ,iBAAiB,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AAmD,CACxD,MAAMC,EACJD,GAAW,KAAO,GAAK,MAAM,QAAQA,CAAO,EAAIA,EAAU,CAACA,CAAO,EAIpEE,EAAAA,aAAaJ,EAAoCG,EAAO,OAAWF,CAAI,CACzE,EAEA,SAAgB,CAEd,GAAI,CACFG,EAAAA,aAAaJ,EAAoC,CAAA,EAAI,OAAWC,CAAI,CACtE,MAAQ,CAER,CACID,EAAU,YACZA,EAAU,WAAW,YAAYA,CAAS,EAK5CF,IAAA,CACF,CAAA,CAIJ"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f={slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"}};exports.extendedColors=f;
2
+ //# sourceMappingURL=custom-elements-runtime.colors.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-elements-runtime.colors.cjs.js","sources":["../src/lib/css/colors.ts"],"sourcesContent":["/**\n * Extended Tailwind-compatible color palette — opt-in module.\n *\n * Import individual color objects or the full palette as needed.\n *\n * @example\n * ```ts\n * import { extendedColors } from '@jasonshimmy/custom-elements-runtime/css/colors';\n * ```\n */\n\n/** A single color scale with shade keys 50–950. */\nexport type ColorScale = Record<string, string>;\n\n/** Full extended color palette with Tailwind-compatible color names. */\nexport const extendedColors: Record<string, ColorScale> = {\n slate: {\n '50': '#f8fafc',\n '100': '#f1f5f9',\n '200': '#e2e8f0',\n '300': '#cbd5e1',\n '400': '#94a3b8',\n '500': '#64748b',\n '600': '#475569',\n '700': '#334155',\n '800': '#1e293b',\n '900': '#0f172a',\n '950': '#020617',\n },\n gray: {\n '50': '#f9fafb',\n '100': '#f3f4f6',\n '200': '#e5e7eb',\n '300': '#d1d5db',\n '400': '#9ca3af',\n '500': '#6b7280',\n '600': '#4b5563',\n '700': '#374151',\n '800': '#1f2937',\n '900': '#111827',\n '950': '#030712',\n },\n zinc: {\n '50': '#fafafa',\n '100': '#f4f4f5',\n '200': '#e4e4e7',\n '300': '#d4d4d8',\n '400': '#a1a1aa',\n '500': '#71717a',\n '600': '#52525b',\n '700': '#3f3f46',\n '800': '#27272a',\n '900': '#18181b',\n '950': '#09090b',\n },\n stone: {\n '50': '#fafaf9',\n '100': '#f5f5f4',\n '200': '#e7e5e4',\n '300': '#d6d3d1',\n '400': '#a8a29e',\n '500': '#78716c',\n '600': '#57534e',\n '700': '#44403c',\n '800': '#292524',\n '900': '#1c1917',\n '950': '#0c0a09',\n },\n red: {\n '50': '#fef2f2',\n '100': '#fee2e2',\n '200': '#fecaca',\n '300': '#fca5a5',\n '400': '#f87171',\n '500': '#ef4444',\n '600': '#dc2626',\n '700': '#b91c1c',\n '800': '#991b1b',\n '900': '#7f1d1d',\n '950': '#450a0a',\n },\n orange: {\n '50': '#fff7ed',\n '100': '#ffedd5',\n '200': '#fed7aa',\n '300': '#fdba74',\n '400': '#fb923c',\n '500': '#f97316',\n '600': '#ea580c',\n '700': '#c2410c',\n '800': '#9a3412',\n '900': '#7c2d12',\n '950': '#431407',\n },\n amber: {\n '50': '#fffbeb',\n '100': '#fef3c7',\n '200': '#fde68a',\n '300': '#fcd34d',\n '400': '#fbbf24',\n '500': '#f59e0b',\n '600': '#d97706',\n '700': '#b45309',\n '800': '#92400e',\n '900': '#78350f',\n '950': '#451a03',\n },\n yellow: {\n '50': '#fefce8',\n '100': '#fef9c3',\n '200': '#fef08a',\n '300': '#fde047',\n '400': '#facc15',\n '500': '#eab308',\n '600': '#ca8a04',\n '700': '#a16207',\n '800': '#854d0e',\n '900': '#713f12',\n '950': '#422006',\n },\n lime: {\n '50': '#f7fee7',\n '100': '#ecfccb',\n '200': '#d9f99d',\n '300': '#bef264',\n '400': '#a3e635',\n '500': '#84cc16',\n '600': '#65a30d',\n '700': '#4d7c0f',\n '800': '#3f6212',\n '900': '#365314',\n '950': '#1a2e05',\n },\n green: {\n '50': '#f0fdf4',\n '100': '#dcfce7',\n '200': '#bbf7d0',\n '300': '#86efac',\n '400': '#4ade80',\n '500': '#22c55e',\n '600': '#16a34a',\n '700': '#15803d',\n '800': '#166534',\n '900': '#14532d',\n '950': '#052e16',\n },\n emerald: {\n '50': '#ecfdf5',\n '100': '#d1fae5',\n '200': '#a7f3d0',\n '300': '#6ee7b7',\n '400': '#34d399',\n '500': '#10b981',\n '600': '#059669',\n '700': '#047857',\n '800': '#065f46',\n '900': '#064e3b',\n '950': '#022c22',\n },\n teal: {\n '50': '#f0fdfa',\n '100': '#ccfbf1',\n '200': '#99f6e4',\n '300': '#5eead4',\n '400': '#2dd4bf',\n '500': '#14b8a6',\n '600': '#0d9488',\n '700': '#0f766e',\n '800': '#115e59',\n '900': '#134e4a',\n '950': '#042f2e',\n },\n cyan: {\n '50': '#ecfeff',\n '100': '#cffafe',\n '200': '#a5f3fc',\n '300': '#67e8f9',\n '400': '#22d3ee',\n '500': '#06b6d4',\n '600': '#0891b2',\n '700': '#0e7490',\n '800': '#155e75',\n '900': '#164e63',\n '950': '#083344',\n },\n sky: {\n '50': '#f0f9ff',\n '100': '#e0f2fe',\n '200': '#bae6fd',\n '300': '#7dd3fc',\n '400': '#38bdf8',\n '500': '#0ea5e9',\n '600': '#0284c7',\n '700': '#0369a1',\n '800': '#075985',\n '900': '#0c4a6e',\n '950': '#082f49',\n },\n blue: {\n '50': '#eff6ff',\n '100': '#dbeafe',\n '200': '#bfdbfe',\n '300': '#93c5fd',\n '400': '#60a5fa',\n '500': '#3b82f6',\n '600': '#2563eb',\n '700': '#1d4ed8',\n '800': '#1e40af',\n '900': '#1e3a8a',\n '950': '#172554',\n },\n indigo: {\n '50': '#eef2ff',\n '100': '#e0e7ff',\n '200': '#c7d2fe',\n '300': '#a5b4fc',\n '400': '#818cf8',\n '500': '#6366f1',\n '600': '#4f46e5',\n '700': '#4338ca',\n '800': '#3730a3',\n '900': '#312e81',\n '950': '#1e1b4b',\n },\n violet: {\n '50': '#f5f3ff',\n '100': '#ede9fe',\n '200': '#ddd6fe',\n '300': '#c4b5fd',\n '400': '#a78bfa',\n '500': '#8b5cf6',\n '600': '#7c3aed',\n '700': '#6d28d9',\n '800': '#5b21b6',\n '900': '#4c1d95',\n '950': '#2e1065',\n },\n purple: {\n '50': '#faf5ff',\n '100': '#f3e8ff',\n '200': '#e9d5ff',\n '300': '#d8b4fe',\n '400': '#c084fc',\n '500': '#a855f7',\n '600': '#9333ea',\n '700': '#7e22ce',\n '800': '#6b21a8',\n '900': '#581c87',\n '950': '#3b0764',\n },\n fuchsia: {\n '50': '#fdf4ff',\n '100': '#fae8ff',\n '200': '#f5d0fe',\n '300': '#f0abfc',\n '400': '#e879f9',\n '500': '#d946ef',\n '600': '#c026d3',\n '700': '#a21caf',\n '800': '#86198f',\n '900': '#701a75',\n '950': '#4a044e',\n },\n pink: {\n '50': '#fdf2f8',\n '100': '#fce7f3',\n '200': '#fbcfe8',\n '300': '#f9a8d4',\n '400': '#f472b6',\n '500': '#ec4899',\n '600': '#db2777',\n '700': '#be185d',\n '800': '#9d174d',\n '900': '#831843',\n '950': '#500724',\n },\n rose: {\n '50': '#fff1f2',\n '100': '#ffe4e6',\n '200': '#fecdd3',\n '300': '#fda4af',\n '400': '#fb7185',\n '500': '#f43f5e',\n '600': '#e11d48',\n '700': '#be123c',\n '800': '#9f1239',\n '900': '#881337',\n '950': '#4c0519',\n },\n};\n"],"names":["extendedColors"],"mappings":"gFAeO,MAAMA,EAA6C,CACxD,MAAO,CACL,GAAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SAAA,EAET,KAAM,CACJ,GAAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SAAA,EAET,KAAM,CACJ,GAAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SAAA,EAET,MAAO,CACL,GAAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SAAA,EAET,IAAK,CACH,GAAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SAAA,EAET,OAAQ,CACN,GAAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SAAA,EAET,MAAO,CACL,GAAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SAAA,EAET,OAAQ,CACN,GAAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SAAA,EAET,KAAM,CACJ,GAAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SAAA,EAET,MAAO,CACL,GAAM,UACN,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,UACP,IAAO,SAAA,EAET,QAAS,CACP,GAAM,UACN,IAAO,UAC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