@telperion/elements 5.4.2 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/.build-manifest.json +12 -1
  2. package/README.md +37 -0
  3. package/custom-elements.json +5272 -0
  4. package/fesm/elements.mjs +477 -2
  5. package/fesm/elements.mjs.map +1 -1
  6. package/iife/elements.js +24 -24
  7. package/iife/elements.js.map +1 -1
  8. package/iife/portal/index.js +2 -0
  9. package/iife/portal/index.js.map +1 -0
  10. package/iife/router/index.js +16 -16
  11. package/iife/router/index.js.map +1 -1
  12. package/iife/select/index.js.map +1 -1
  13. package/index.cjs +4 -0
  14. package/index.cjs.map +1 -1
  15. package/index.d.cts +1 -0
  16. package/index.d.ts +1 -0
  17. package/index.js +2 -0
  18. package/index.js.map +1 -1
  19. package/package.json +42 -17
  20. package/portal/dom-ops.cjs +81 -0
  21. package/portal/dom-ops.cjs.map +1 -0
  22. package/portal/dom-ops.js +72 -0
  23. package/portal/dom-ops.js.map +1 -0
  24. package/portal/index.cjs +10 -0
  25. package/portal/index.cjs.map +1 -0
  26. package/portal/index.d.cts +125 -0
  27. package/portal/index.d.ts +125 -0
  28. package/portal/index.js +3 -0
  29. package/portal/index.js.map +1 -0
  30. package/portal/internal-props.cjs +13 -0
  31. package/portal/internal-props.cjs.map +1 -0
  32. package/portal/internal-props.js +9 -0
  33. package/portal/internal-props.js.map +1 -0
  34. package/portal/portal-element.cjs +196 -0
  35. package/portal/portal-element.cjs.map +1 -0
  36. package/portal/portal-element.js +194 -0
  37. package/portal/portal-element.js.map +1 -0
  38. package/portal/portal-outlet-element.cjs +64 -0
  39. package/portal/portal-outlet-element.cjs.map +1 -0
  40. package/portal/portal-outlet-element.js +62 -0
  41. package/portal/portal-outlet-element.js.map +1 -0
  42. package/portal/portal-registry.cjs +61 -0
  43. package/portal/portal-registry.cjs.map +1 -0
  44. package/portal/portal-registry.js +59 -0
  45. package/portal/portal-registry.js.map +1 -0
  46. package/portal/projection.cjs +81 -0
  47. package/portal/projection.cjs.map +1 -0
  48. package/portal/projection.js +79 -0
  49. package/portal/projection.js.map +1 -0
  50. package/portal/styles.cjs +28 -0
  51. package/portal/styles.cjs.map +1 -0
  52. package/portal/styles.js +26 -0
  53. package/portal/styles.js.map +1 -0
  54. package/router/history-managed.cjs +3 -1
  55. package/router/history-managed.cjs.map +1 -1
  56. package/router/history-managed.js +3 -1
  57. package/router/history-managed.js.map +1 -1
@@ -99,7 +99,18 @@
99
99
  "dts": "button/index.d.ts",
100
100
  "dcts": "button/index.d.cts"
101
101
  }
102
+ },
103
+ {
104
+ "name": "portal/index",
105
+ "sourcePath": "src/portal/index.ts",
106
+ "outputs": {
107
+ "esm": "portal/index.js",
108
+ "cjs": "portal/index.cjs",
109
+ "iife": "iife/portal/index.js",
110
+ "dts": "portal/index.d.ts",
111
+ "dcts": "portal/index.d.cts"
112
+ }
102
113
  }
103
114
  ],
104
- "generatedAt": "2026-05-11T14:50:29.223Z"
115
+ "generatedAt": "2026-11-11T10:58:55.622Z"
105
116
  }
package/README.md CHANGED
@@ -69,6 +69,9 @@ Use the **explicit `/iife/...` path** so the CDN serves the standalone bundle (s
69
69
 
70
70
  <!-- Or just the button module (TelperionElements.Button) -->
71
71
  <script src="https://unpkg.com/@telperion/elements/iife/button/index.js"></script>
72
+
73
+ <!-- Or just the portal module (TelperionElements.Portal) -->
74
+ <script src="https://unpkg.com/@telperion/elements/iife/portal/index.js"></script>
72
75
  ```
73
76
 
74
77
  Each per-module bundle is fully self-contained: side-effect imports register the custom elements as soon as the script is evaluated. jsDelivr (`https://cdn.jsdelivr.net/npm/@telperion/elements/iife/...`) and other npm CDNs work the same way.
@@ -296,6 +299,40 @@ import "@telperion/elements/button";
296
299
 
297
300
  ---
298
301
 
302
+ ### Portal
303
+
304
+ Render content somewhere else in the document. Children of `<tp-portal>` are **moved** (not cloned) into the `<tp-portal-outlet>` with the same `name`, so listeners, element state and framework bindings keep working.
305
+
306
+ **Includes:**
307
+ - `<tp-portal>` &mdash; declares the content and the outlet `name` to render into
308
+ - `<tp-portal-outlet>` &mdash; the render target
309
+
310
+ **Features:**
311
+ - Same nodes, moved: state and bindings survive; uses the state-preserving `moveBefore()` where supported
312
+ - Framework-safe: `appendChild` / `insertBefore` / `removeChild` / `replaceChild` / `textContent` / `innerHTML` on the portal are forwarded to the outlet, so React, Angular, Vue and Lit keep reconciling without errors
313
+ - Connection order doesn't matter; content returns to the portal when the outlet leaves
314
+ - Several portals per outlet (in connection order); the most recent outlet of a name wins, the previous one takes over when it leaves
315
+ - Reflected `projected` (portal) and `active` (outlet) attributes for styling
316
+
317
+ #### JS/TS
318
+ ```ts
319
+ import "@telperion/elements/portal";
320
+ ```
321
+
322
+ #### HTML
323
+ ```html
324
+ <tp-portal name="foo">
325
+ Foo Text
326
+ <section>Foo inner content</section>
327
+ </tp-portal>
328
+
329
+ <tp-portal-outlet name="foo"></tp-portal-outlet>
330
+ ```
331
+
332
+ [Portal Documentation →](./src/portal/README.md)
333
+
334
+ ---
335
+
299
336
  This library is actively being developed. More components will be added over time.
300
337
 
301
338
  ## 🤝 Contributing