@servlyadmin/runtime-core 0.1.38 → 0.1.39

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.
@@ -87,9 +87,9 @@ function markElementReady(element) {
87
87
  }
88
88
  function isTailwindReady() {
89
89
  if (typeof window === "undefined") return false;
90
- return tailwindInjected && !!window.tailwind;
90
+ return tailwindInjected || !!window.tailwind;
91
91
  }
92
- function waitForTailwind() {
92
+ function waitForTailwind(timeoutMs = 3e3) {
93
93
  if (isTailwindReady()) {
94
94
  return Promise.resolve();
95
95
  }
@@ -98,6 +98,24 @@ function waitForTailwind() {
98
98
  }
99
99
  tailwindReadyPromise = new Promise((resolve) => {
100
100
  tailwindReadyResolve = resolve;
101
+ const timeout = setTimeout(() => {
102
+ if (tailwindReadyResolve) {
103
+ tailwindReadyResolve();
104
+ tailwindReadyResolve = null;
105
+ }
106
+ }, timeoutMs);
107
+ const checkInterval = setInterval(() => {
108
+ if (window.tailwind) {
109
+ clearTimeout(timeout);
110
+ clearInterval(checkInterval);
111
+ tailwindInjected = true;
112
+ if (tailwindReadyResolve) {
113
+ tailwindReadyResolve();
114
+ tailwindReadyResolve = null;
115
+ }
116
+ }
117
+ }, 50);
118
+ setTimeout(() => clearInterval(checkInterval), timeoutMs);
101
119
  });
102
120
  return tailwindReadyPromise;
103
121
  }
package/dist/index.cjs CHANGED
@@ -113,9 +113,9 @@ function markElementReady(element) {
113
113
  }
114
114
  function isTailwindReady() {
115
115
  if (typeof window === "undefined") return false;
116
- return tailwindInjected && !!window.tailwind;
116
+ return tailwindInjected || !!window.tailwind;
117
117
  }
118
- function waitForTailwind() {
118
+ function waitForTailwind(timeoutMs = 3e3) {
119
119
  if (isTailwindReady()) {
120
120
  return Promise.resolve();
121
121
  }
@@ -124,6 +124,24 @@ function waitForTailwind() {
124
124
  }
125
125
  tailwindReadyPromise = new Promise((resolve) => {
126
126
  tailwindReadyResolve = resolve;
127
+ const timeout = setTimeout(() => {
128
+ if (tailwindReadyResolve) {
129
+ tailwindReadyResolve();
130
+ tailwindReadyResolve = null;
131
+ }
132
+ }, timeoutMs);
133
+ const checkInterval = setInterval(() => {
134
+ if (window.tailwind) {
135
+ clearTimeout(timeout);
136
+ clearInterval(checkInterval);
137
+ tailwindInjected = true;
138
+ if (tailwindReadyResolve) {
139
+ tailwindReadyResolve();
140
+ tailwindReadyResolve = null;
141
+ }
142
+ }
143
+ }, 50);
144
+ setTimeout(() => clearInterval(checkInterval), timeoutMs);
127
145
  });
128
146
  return tailwindReadyPromise;
129
147
  }
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  removeTailwind,
16
16
  updateTailwindConfig,
17
17
  waitForTailwind
18
- } from "./chunk-5O72RMSO.js";
18
+ } from "./chunk-O47EK24F.js";
19
19
  import {
20
20
  buildRegistryFromBundle,
21
21
  collectAllDependencies,
@@ -3610,7 +3610,7 @@ async function createServlyRenderer(options) {
3610
3610
  container = containerOption;
3611
3611
  }
3612
3612
  if (shouldInjectTailwind) {
3613
- const { initServlyTailwind: initServlyTailwind2 } = await import("./tailwind-4IK6HZC6.js");
3613
+ const { initServlyTailwind: initServlyTailwind2 } = await import("./tailwind-ZBEKXMLR.js");
3614
3614
  await initServlyTailwind2(tailwindConfig);
3615
3615
  }
3616
3616
  const activeRenders = [];
@@ -16,7 +16,7 @@ import {
16
16
  tailwind_default,
17
17
  updateTailwindConfig,
18
18
  waitForTailwind
19
- } from "./chunk-5O72RMSO.js";
19
+ } from "./chunk-O47EK24F.js";
20
20
  export {
21
21
  DEFAULT_SERVLY_TAILWIND_CONFIG,
22
22
  addCustomStyles,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servlyadmin/runtime-core",
3
- "version": "0.1.38",
3
+ "version": "0.1.39",
4
4
  "description": "Framework-agnostic core renderer for Servly components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",