@kerkhoff-ict/solora 2.3.1 → 2.4.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 (2) hide show
  1. package/dist/index.js +21 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2269,14 +2269,29 @@ function initThemeToggle(elementSelector = ".sol-theme-toggle") {
2269
2269
  }
2270
2270
 
2271
2271
  // src/index.js
2272
+ function safeInitAll() {
2273
+ try {
2274
+ initCodeblocks();
2275
+ initDropdowns();
2276
+ initContextMenu();
2277
+ initThemeToggle();
2278
+ } catch (err) {
2279
+ console.warn("[Solora] initAll error:", err);
2280
+ }
2281
+ }
2272
2282
  function initAll() {
2273
- initCodeblocks();
2274
- initDropdowns();
2275
- initContextMenu();
2276
- initThemeToggle();
2283
+ safeInitAll();
2284
+ if (typeof window !== "undefined" && typeof Livewire !== "undefined" && !window.hasRegisteredSoloraLivewire) {
2285
+ document.addEventListener("livewire:navigated", () => {
2286
+ safeInitAll();
2287
+ });
2288
+ window.hasRegisteredSoloraLivewire = true;
2289
+ }
2277
2290
  }
2278
- if (typeof window !== "undefined") {
2279
- document.addEventListener("DOMContentLoaded", initAll);
2291
+ if (typeof window !== "undefined" && document.readyState === "complete") {
2292
+ safeInitAll();
2293
+ } else if (typeof window !== "undefined") {
2294
+ document.addEventListener("DOMContentLoaded", safeInitAll);
2280
2295
  }
2281
2296
  export {
2282
2297
  initAll
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kerkhoff-ict/solora",
3
- "version": "2.3.1",
3
+ "version": "2.4.0",
4
4
  "description": "Simple CSS component library",
5
5
  "main": "dist/index.js",
6
6
  "style": "dist/index.css",