@servlyadmin/runtime-core 0.1.41 → 0.1.42
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.
|
@@ -120,12 +120,15 @@ function waitForTailwind(timeoutMs = 3e3) {
|
|
|
120
120
|
return tailwindReadyPromise;
|
|
121
121
|
}
|
|
122
122
|
function injectTailwind(config = {}) {
|
|
123
|
+
console.log("[Servly Tailwind] injectTailwind called");
|
|
123
124
|
return new Promise((resolve, reject) => {
|
|
124
125
|
if (tailwindInjected && tailwindScript) {
|
|
126
|
+
console.log("[Servly Tailwind] Already injected, skipping");
|
|
125
127
|
resolve();
|
|
126
128
|
return;
|
|
127
129
|
}
|
|
128
130
|
if (typeof document === "undefined") {
|
|
131
|
+
console.log("[Servly Tailwind] Not in browser, skipping");
|
|
129
132
|
resolve();
|
|
130
133
|
return;
|
|
131
134
|
}
|
|
@@ -139,6 +142,7 @@ function injectTailwind(config = {}) {
|
|
|
139
142
|
preventFOUC: shouldPreventFOUC = true,
|
|
140
143
|
enablePreload = true
|
|
141
144
|
} = config;
|
|
145
|
+
console.log("[Servly Tailwind] Config:", { cdnUrl, usePlayCdn, shouldPreventFOUC });
|
|
142
146
|
if (shouldPreventFOUC) {
|
|
143
147
|
preventFOUC();
|
|
144
148
|
}
|
|
@@ -146,7 +150,9 @@ function injectTailwind(config = {}) {
|
|
|
146
150
|
preloadTailwind(cdnUrl, usePlayCdn);
|
|
147
151
|
}
|
|
148
152
|
const existingScript = document.querySelector('script[src*="tailwindcss.com"]');
|
|
153
|
+
console.log("[Servly Tailwind] Existing script check:", { existingScript: !!existingScript, windowTailwind: !!window.tailwind });
|
|
149
154
|
if (existingScript || window.tailwind) {
|
|
155
|
+
console.log("[Servly Tailwind] Tailwind already exists");
|
|
150
156
|
tailwindInjected = true;
|
|
151
157
|
markTailwindAsLoaded();
|
|
152
158
|
if (shouldPreventFOUC) {
|
|
@@ -160,11 +166,14 @@ function injectTailwind(config = {}) {
|
|
|
160
166
|
resolve();
|
|
161
167
|
return;
|
|
162
168
|
}
|
|
169
|
+
const scriptUrl = usePlayCdn ? `${cdnUrl}?plugins=forms,typography,aspect-ratio` : cdnUrl;
|
|
170
|
+
console.log("[Servly Tailwind] Creating script with URL:", scriptUrl);
|
|
163
171
|
const script = document.createElement("script");
|
|
164
|
-
script.src =
|
|
172
|
+
script.src = scriptUrl;
|
|
165
173
|
script.async = true;
|
|
166
174
|
script.crossOrigin = "anonymous";
|
|
167
175
|
script.onload = () => {
|
|
176
|
+
console.log("[Servly Tailwind] Script loaded successfully!");
|
|
168
177
|
tailwindInjected = true;
|
|
169
178
|
tailwindScript = script;
|
|
170
179
|
markTailwindAsLoaded();
|
|
@@ -185,6 +194,7 @@ function injectTailwind(config = {}) {
|
|
|
185
194
|
}, delay);
|
|
186
195
|
};
|
|
187
196
|
script.onerror = (event) => {
|
|
197
|
+
console.error("[Servly Tailwind] Script failed to load:", event);
|
|
188
198
|
const error = new Error(`Failed to load Tailwind CSS from ${cdnUrl}`);
|
|
189
199
|
if (shouldPreventFOUC) {
|
|
190
200
|
removeFOUCPrevention();
|
|
@@ -196,7 +206,9 @@ function injectTailwind(config = {}) {
|
|
|
196
206
|
onError?.(error);
|
|
197
207
|
reject(error);
|
|
198
208
|
};
|
|
209
|
+
console.log("[Servly Tailwind] Appending script to head");
|
|
199
210
|
document.head.appendChild(script);
|
|
211
|
+
console.log("[Servly Tailwind] Script appended, head now has:", document.head.querySelectorAll("script").length, "scripts");
|
|
200
212
|
});
|
|
201
213
|
}
|
|
202
214
|
function removeTailwind() {
|
package/dist/index.cjs
CHANGED
|
@@ -148,12 +148,15 @@ function waitForTailwind(timeoutMs = 3e3) {
|
|
|
148
148
|
return tailwindReadyPromise;
|
|
149
149
|
}
|
|
150
150
|
function injectTailwind(config = {}) {
|
|
151
|
+
console.log("[Servly Tailwind] injectTailwind called");
|
|
151
152
|
return new Promise((resolve, reject) => {
|
|
152
153
|
if (tailwindInjected && tailwindScript) {
|
|
154
|
+
console.log("[Servly Tailwind] Already injected, skipping");
|
|
153
155
|
resolve();
|
|
154
156
|
return;
|
|
155
157
|
}
|
|
156
158
|
if (typeof document === "undefined") {
|
|
159
|
+
console.log("[Servly Tailwind] Not in browser, skipping");
|
|
157
160
|
resolve();
|
|
158
161
|
return;
|
|
159
162
|
}
|
|
@@ -167,6 +170,7 @@ function injectTailwind(config = {}) {
|
|
|
167
170
|
preventFOUC: shouldPreventFOUC = true,
|
|
168
171
|
enablePreload = true
|
|
169
172
|
} = config;
|
|
173
|
+
console.log("[Servly Tailwind] Config:", { cdnUrl, usePlayCdn, shouldPreventFOUC });
|
|
170
174
|
if (shouldPreventFOUC) {
|
|
171
175
|
preventFOUC();
|
|
172
176
|
}
|
|
@@ -174,7 +178,9 @@ function injectTailwind(config = {}) {
|
|
|
174
178
|
preloadTailwind(cdnUrl, usePlayCdn);
|
|
175
179
|
}
|
|
176
180
|
const existingScript = document.querySelector('script[src*="tailwindcss.com"]');
|
|
181
|
+
console.log("[Servly Tailwind] Existing script check:", { existingScript: !!existingScript, windowTailwind: !!window.tailwind });
|
|
177
182
|
if (existingScript || window.tailwind) {
|
|
183
|
+
console.log("[Servly Tailwind] Tailwind already exists");
|
|
178
184
|
tailwindInjected = true;
|
|
179
185
|
markTailwindAsLoaded();
|
|
180
186
|
if (shouldPreventFOUC) {
|
|
@@ -188,11 +194,14 @@ function injectTailwind(config = {}) {
|
|
|
188
194
|
resolve();
|
|
189
195
|
return;
|
|
190
196
|
}
|
|
197
|
+
const scriptUrl = usePlayCdn ? `${cdnUrl}?plugins=forms,typography,aspect-ratio` : cdnUrl;
|
|
198
|
+
console.log("[Servly Tailwind] Creating script with URL:", scriptUrl);
|
|
191
199
|
const script = document.createElement("script");
|
|
192
|
-
script.src =
|
|
200
|
+
script.src = scriptUrl;
|
|
193
201
|
script.async = true;
|
|
194
202
|
script.crossOrigin = "anonymous";
|
|
195
203
|
script.onload = () => {
|
|
204
|
+
console.log("[Servly Tailwind] Script loaded successfully!");
|
|
196
205
|
tailwindInjected = true;
|
|
197
206
|
tailwindScript = script;
|
|
198
207
|
markTailwindAsLoaded();
|
|
@@ -213,6 +222,7 @@ function injectTailwind(config = {}) {
|
|
|
213
222
|
}, delay);
|
|
214
223
|
};
|
|
215
224
|
script.onerror = (event) => {
|
|
225
|
+
console.error("[Servly Tailwind] Script failed to load:", event);
|
|
216
226
|
const error = new Error(`Failed to load Tailwind CSS from ${cdnUrl}`);
|
|
217
227
|
if (shouldPreventFOUC) {
|
|
218
228
|
removeFOUCPrevention();
|
|
@@ -224,7 +234,9 @@ function injectTailwind(config = {}) {
|
|
|
224
234
|
onError?.(error);
|
|
225
235
|
reject(error);
|
|
226
236
|
};
|
|
237
|
+
console.log("[Servly Tailwind] Appending script to head");
|
|
227
238
|
document.head.appendChild(script);
|
|
239
|
+
console.log("[Servly Tailwind] Script appended, head now has:", document.head.querySelectorAll("script").length, "scripts");
|
|
228
240
|
});
|
|
229
241
|
}
|
|
230
242
|
function removeTailwind() {
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
scheduleRefresh,
|
|
18
18
|
updateTailwindConfig,
|
|
19
19
|
waitForTailwind
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-L5RPU26D.js";
|
|
21
21
|
import {
|
|
22
22
|
buildRegistryFromBundle,
|
|
23
23
|
collectAllDependencies,
|
|
@@ -3613,7 +3613,7 @@ async function createServlyRenderer(options) {
|
|
|
3613
3613
|
container = containerOption;
|
|
3614
3614
|
}
|
|
3615
3615
|
if (shouldInjectTailwind) {
|
|
3616
|
-
const { initServlyTailwind: initServlyTailwind2 } = await import("./tailwind-
|
|
3616
|
+
const { initServlyTailwind: initServlyTailwind2 } = await import("./tailwind-MU3YZM2C.js");
|
|
3617
3617
|
await initServlyTailwind2(tailwindConfig);
|
|
3618
3618
|
}
|
|
3619
3619
|
const activeRenders = [];
|