ux4g-components-web 1.1.1 → 1.2.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.
@@ -1,17 +1,33 @@
1
1
  /**
2
2
  * UX4G Runtime Module
3
3
  *
4
- * Framework-agnostic runtime that encapsulates ALL interactive behaviors
5
- * from the vendor CDN scripts (ux4g.js + ux4g-custom.js).
4
+ * Injects the vendor JS (ux4g.js + ux4g-custom.js) into the page as inline scripts.
5
+ * These files handle all interactive behaviors: dropdowns, modals, tooltips,
6
+ * accordions, carousels, drawers, tabs, popovers, toasts, scrollspy, etc.
7
+ *
8
+ * The vendor JS is inlined at build time by the Rollup virtual plugin.
9
+ * At runtime, initRuntime() creates <script> elements with the inlined code.
6
10
  *
7
11
  * Uses a singleton guard (window.__UX4G_RUNTIME_INITIALIZED__) to ensure
8
- * initialization happens exactly once.
12
+ * the scripts are injected exactly once.
9
13
  */
10
14
  declare global {
11
15
  interface Window {
12
16
  __UX4G_RUNTIME_INITIALIZED__?: boolean;
13
- __ux4gInitRaf?: number;
17
+ ux4g?: Record<string, unknown>;
14
18
  }
15
19
  }
20
+ /**
21
+ * Initialize the UX4G runtime by injecting the vendor JS scripts into the page.
22
+ *
23
+ * - Safe for SSR — no-ops when window/document are unavailable.
24
+ * - Singleton guard prevents double-injection.
25
+ * - The vendor JS handles its own DOMContentLoaded timing internally.
26
+ * - MutationObserver in the vendor JS auto-initializes dynamically added elements.
27
+ */
16
28
  export declare function initRuntime(): void;
29
+ /**
30
+ * Destroy the UX4G runtime.
31
+ * Removes injected scripts and resets the singleton guard.
32
+ */
17
33
  export declare function destroyRuntime(): void;