@servlyadmin/runtime-core 0.1.42 → 0.1.44
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.
- package/dist/{chunk-L5RPU26D.js → chunk-TXHGJYYM.js} +63 -10
- package/dist/index.cjs +189 -10
- package/dist/index.d.cts +50 -1
- package/dist/index.d.ts +50 -1
- package/dist/index.js +117 -2
- package/dist/{tailwind-MU3YZM2C.js → tailwind-GU53TXCZ.js} +1 -1
- package/package.json +1 -1
|
@@ -152,18 +152,45 @@ function injectTailwind(config = {}) {
|
|
|
152
152
|
const existingScript = document.querySelector('script[src*="tailwindcss.com"]');
|
|
153
153
|
console.log("[Servly Tailwind] Existing script check:", { existingScript: !!existingScript, windowTailwind: !!window.tailwind });
|
|
154
154
|
if (existingScript || window.tailwind) {
|
|
155
|
-
console.log("[Servly Tailwind] Tailwind already exists");
|
|
155
|
+
console.log("[Servly Tailwind] Tailwind script already exists, waiting for window.tailwind...");
|
|
156
156
|
tailwindInjected = true;
|
|
157
157
|
markTailwindAsLoaded();
|
|
158
|
-
if (
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
tailwindReadyResolve
|
|
158
|
+
if (window.tailwind) {
|
|
159
|
+
console.log("[Servly Tailwind] window.tailwind already available");
|
|
160
|
+
if (shouldPreventFOUC) {
|
|
161
|
+
removeFOUCPrevention();
|
|
162
|
+
}
|
|
163
|
+
if (tailwindReadyResolve) {
|
|
164
|
+
tailwindReadyResolve();
|
|
165
|
+
tailwindReadyResolve = null;
|
|
166
|
+
}
|
|
167
|
+
config.onReady?.();
|
|
168
|
+
resolve();
|
|
169
|
+
return;
|
|
164
170
|
}
|
|
165
|
-
|
|
166
|
-
|
|
171
|
+
let pollCount2 = 0;
|
|
172
|
+
const maxPolls2 = 100;
|
|
173
|
+
const pollForTailwind2 = () => {
|
|
174
|
+
pollCount2++;
|
|
175
|
+
if (window.tailwind) {
|
|
176
|
+
console.log("[Servly Tailwind] window.tailwind now available after", pollCount2 * 100, "ms");
|
|
177
|
+
if (shouldPreventFOUC) {
|
|
178
|
+
removeFOUCPrevention();
|
|
179
|
+
}
|
|
180
|
+
if (tailwindReadyResolve) {
|
|
181
|
+
tailwindReadyResolve();
|
|
182
|
+
tailwindReadyResolve = null;
|
|
183
|
+
}
|
|
184
|
+
config.onReady?.();
|
|
185
|
+
resolve();
|
|
186
|
+
} else if (pollCount2 < maxPolls2) {
|
|
187
|
+
setTimeout(pollForTailwind2, 100);
|
|
188
|
+
} else {
|
|
189
|
+
console.warn("[Servly Tailwind] window.tailwind never became available");
|
|
190
|
+
resolve();
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
setTimeout(pollForTailwind2, 100);
|
|
167
194
|
return;
|
|
168
195
|
}
|
|
169
196
|
const scriptUrl = usePlayCdn ? `${cdnUrl}?plugins=forms,typography,aspect-ratio` : cdnUrl;
|
|
@@ -171,7 +198,6 @@ function injectTailwind(config = {}) {
|
|
|
171
198
|
const script = document.createElement("script");
|
|
172
199
|
script.src = scriptUrl;
|
|
173
200
|
script.async = true;
|
|
174
|
-
script.crossOrigin = "anonymous";
|
|
175
201
|
script.onload = () => {
|
|
176
202
|
console.log("[Servly Tailwind] Script loaded successfully!");
|
|
177
203
|
tailwindInjected = true;
|
|
@@ -209,6 +235,33 @@ function injectTailwind(config = {}) {
|
|
|
209
235
|
console.log("[Servly Tailwind] Appending script to head");
|
|
210
236
|
document.head.appendChild(script);
|
|
211
237
|
console.log("[Servly Tailwind] Script appended, head now has:", document.head.querySelectorAll("script").length, "scripts");
|
|
238
|
+
let pollCount = 0;
|
|
239
|
+
const maxPolls = 100;
|
|
240
|
+
const pollForTailwind = () => {
|
|
241
|
+
pollCount++;
|
|
242
|
+
if (window.tailwind) {
|
|
243
|
+
console.log("[Servly Tailwind] Tailwind detected via polling after", pollCount * 100, "ms");
|
|
244
|
+
if (!tailwindInjected) {
|
|
245
|
+
tailwindInjected = true;
|
|
246
|
+
tailwindScript = script;
|
|
247
|
+
markTailwindAsLoaded();
|
|
248
|
+
if (shouldPreventFOUC) {
|
|
249
|
+
removeFOUCPrevention();
|
|
250
|
+
}
|
|
251
|
+
if (tailwindReadyResolve) {
|
|
252
|
+
tailwindReadyResolve();
|
|
253
|
+
tailwindReadyResolve = null;
|
|
254
|
+
}
|
|
255
|
+
onReady?.();
|
|
256
|
+
resolve();
|
|
257
|
+
}
|
|
258
|
+
} else if (pollCount < maxPolls) {
|
|
259
|
+
setTimeout(pollForTailwind, 100);
|
|
260
|
+
} else {
|
|
261
|
+
console.warn("[Servly Tailwind] Tailwind not detected after polling, giving up");
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
setTimeout(pollForTailwind, 100);
|
|
212
265
|
});
|
|
213
266
|
}
|
|
214
267
|
function removeTailwind() {
|
package/dist/index.cjs
CHANGED
|
@@ -180,18 +180,45 @@ function injectTailwind(config = {}) {
|
|
|
180
180
|
const existingScript = document.querySelector('script[src*="tailwindcss.com"]');
|
|
181
181
|
console.log("[Servly Tailwind] Existing script check:", { existingScript: !!existingScript, windowTailwind: !!window.tailwind });
|
|
182
182
|
if (existingScript || window.tailwind) {
|
|
183
|
-
console.log("[Servly Tailwind] Tailwind already exists");
|
|
183
|
+
console.log("[Servly Tailwind] Tailwind script already exists, waiting for window.tailwind...");
|
|
184
184
|
tailwindInjected = true;
|
|
185
185
|
markTailwindAsLoaded();
|
|
186
|
-
if (
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
tailwindReadyResolve
|
|
186
|
+
if (window.tailwind) {
|
|
187
|
+
console.log("[Servly Tailwind] window.tailwind already available");
|
|
188
|
+
if (shouldPreventFOUC) {
|
|
189
|
+
removeFOUCPrevention();
|
|
190
|
+
}
|
|
191
|
+
if (tailwindReadyResolve) {
|
|
192
|
+
tailwindReadyResolve();
|
|
193
|
+
tailwindReadyResolve = null;
|
|
194
|
+
}
|
|
195
|
+
config.onReady?.();
|
|
196
|
+
resolve();
|
|
197
|
+
return;
|
|
192
198
|
}
|
|
193
|
-
|
|
194
|
-
|
|
199
|
+
let pollCount2 = 0;
|
|
200
|
+
const maxPolls2 = 100;
|
|
201
|
+
const pollForTailwind2 = () => {
|
|
202
|
+
pollCount2++;
|
|
203
|
+
if (window.tailwind) {
|
|
204
|
+
console.log("[Servly Tailwind] window.tailwind now available after", pollCount2 * 100, "ms");
|
|
205
|
+
if (shouldPreventFOUC) {
|
|
206
|
+
removeFOUCPrevention();
|
|
207
|
+
}
|
|
208
|
+
if (tailwindReadyResolve) {
|
|
209
|
+
tailwindReadyResolve();
|
|
210
|
+
tailwindReadyResolve = null;
|
|
211
|
+
}
|
|
212
|
+
config.onReady?.();
|
|
213
|
+
resolve();
|
|
214
|
+
} else if (pollCount2 < maxPolls2) {
|
|
215
|
+
setTimeout(pollForTailwind2, 100);
|
|
216
|
+
} else {
|
|
217
|
+
console.warn("[Servly Tailwind] window.tailwind never became available");
|
|
218
|
+
resolve();
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
setTimeout(pollForTailwind2, 100);
|
|
195
222
|
return;
|
|
196
223
|
}
|
|
197
224
|
const scriptUrl = usePlayCdn ? `${cdnUrl}?plugins=forms,typography,aspect-ratio` : cdnUrl;
|
|
@@ -199,7 +226,6 @@ function injectTailwind(config = {}) {
|
|
|
199
226
|
const script = document.createElement("script");
|
|
200
227
|
script.src = scriptUrl;
|
|
201
228
|
script.async = true;
|
|
202
|
-
script.crossOrigin = "anonymous";
|
|
203
229
|
script.onload = () => {
|
|
204
230
|
console.log("[Servly Tailwind] Script loaded successfully!");
|
|
205
231
|
tailwindInjected = true;
|
|
@@ -237,6 +263,33 @@ function injectTailwind(config = {}) {
|
|
|
237
263
|
console.log("[Servly Tailwind] Appending script to head");
|
|
238
264
|
document.head.appendChild(script);
|
|
239
265
|
console.log("[Servly Tailwind] Script appended, head now has:", document.head.querySelectorAll("script").length, "scripts");
|
|
266
|
+
let pollCount = 0;
|
|
267
|
+
const maxPolls = 100;
|
|
268
|
+
const pollForTailwind = () => {
|
|
269
|
+
pollCount++;
|
|
270
|
+
if (window.tailwind) {
|
|
271
|
+
console.log("[Servly Tailwind] Tailwind detected via polling after", pollCount * 100, "ms");
|
|
272
|
+
if (!tailwindInjected) {
|
|
273
|
+
tailwindInjected = true;
|
|
274
|
+
tailwindScript = script;
|
|
275
|
+
markTailwindAsLoaded();
|
|
276
|
+
if (shouldPreventFOUC) {
|
|
277
|
+
removeFOUCPrevention();
|
|
278
|
+
}
|
|
279
|
+
if (tailwindReadyResolve) {
|
|
280
|
+
tailwindReadyResolve();
|
|
281
|
+
tailwindReadyResolve = null;
|
|
282
|
+
}
|
|
283
|
+
onReady?.();
|
|
284
|
+
resolve();
|
|
285
|
+
}
|
|
286
|
+
} else if (pollCount < maxPolls) {
|
|
287
|
+
setTimeout(pollForTailwind, 100);
|
|
288
|
+
} else {
|
|
289
|
+
console.warn("[Servly Tailwind] Tailwind not detected after polling, giving up");
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
setTimeout(pollForTailwind, 100);
|
|
240
293
|
});
|
|
241
294
|
}
|
|
242
295
|
function removeTailwind() {
|
|
@@ -631,6 +684,7 @@ __export(index_exports, {
|
|
|
631
684
|
StateManager: () => StateManager,
|
|
632
685
|
addClass: () => addClass,
|
|
633
686
|
addCustomStyles: () => addCustomStyles,
|
|
687
|
+
addFontPreconnect: () => addFontPreconnect,
|
|
634
688
|
analytics: () => analytics,
|
|
635
689
|
applyStyles: () => applyStyles,
|
|
636
690
|
batchFetchComponents: () => batchFetchComponents,
|
|
@@ -656,6 +710,7 @@ __export(index_exports, {
|
|
|
656
710
|
deepMerge: () => deepMerge,
|
|
657
711
|
deleteValueByPath: () => deleteValueByPath,
|
|
658
712
|
detectCircularDependencies: () => detectCircularDependencies,
|
|
713
|
+
ensureFonts: () => ensureFonts,
|
|
659
714
|
extractBindingKeys: () => extractBindingKeys,
|
|
660
715
|
extractDependencies: () => extractDependencies,
|
|
661
716
|
extractDependenciesFromCode: () => extractDependenciesFromCode,
|
|
@@ -669,12 +724,14 @@ __export(index_exports, {
|
|
|
669
724
|
getAnalytics: () => getAnalytics,
|
|
670
725
|
getCacheKey: () => getCacheKey,
|
|
671
726
|
getCleanupOverrides: () => getCleanupOverrides,
|
|
727
|
+
getDefaultFonts: () => getDefaultFonts,
|
|
672
728
|
getDependencyTree: () => getDependencyTree,
|
|
673
729
|
getEventSystem: () => getEventSystem,
|
|
674
730
|
getFromCache: () => getFromCache,
|
|
675
731
|
getIconData: () => getIconData,
|
|
676
732
|
getIconDataSync: () => getIconDataSync,
|
|
677
733
|
getIconifyCollection: () => getIconifyCollection,
|
|
734
|
+
getLoadedFonts: () => getLoadedFonts,
|
|
678
735
|
getLocalStorage: () => getLocalStorage,
|
|
679
736
|
getLongTaskObserver: () => getLongTaskObserver,
|
|
680
737
|
getMemoryCacheSize: () => getMemoryCacheSize,
|
|
@@ -695,17 +752,22 @@ __export(index_exports, {
|
|
|
695
752
|
hasDependencyOverrides: () => hasDependencyOverrides,
|
|
696
753
|
hasOverrides: () => hasOverrides,
|
|
697
754
|
hasTemplateSyntax: () => hasTemplateSyntax,
|
|
755
|
+
initFonts: () => initFonts,
|
|
698
756
|
initServlyTailwind: () => initServlyTailwind,
|
|
699
757
|
injectTailwind: () => injectTailwind,
|
|
700
758
|
injectTailwindStyles: () => injectTailwindStyles,
|
|
701
759
|
invalidateCache: () => invalidateCache,
|
|
702
760
|
isComponentAvailable: () => isComponentAvailable,
|
|
761
|
+
isFontLoaded: () => isFontLoaded,
|
|
703
762
|
isIconCdnEnabled: () => isIconCdnEnabled,
|
|
704
763
|
isIconRegistered: () => isIconRegistered,
|
|
705
764
|
isIconSetSupported: () => isIconSetSupported,
|
|
706
765
|
isTailwindLoaded: () => isTailwindLoaded,
|
|
707
766
|
isTailwindReady: () => isTailwindReady,
|
|
708
767
|
isValidSpecifier: () => isValidSpecifier,
|
|
768
|
+
loadDefaultFonts: () => loadDefaultFonts,
|
|
769
|
+
loadFont: () => loadFont,
|
|
770
|
+
loadFonts: () => loadFonts,
|
|
709
771
|
markElementReady: () => markElementReady,
|
|
710
772
|
navigateTo: () => navigateTo,
|
|
711
773
|
parseVersion: () => parseVersion,
|
|
@@ -3375,6 +3437,113 @@ function getIconifyCollection(set) {
|
|
|
3375
3437
|
|
|
3376
3438
|
// src/renderer.ts
|
|
3377
3439
|
init_tailwind();
|
|
3440
|
+
|
|
3441
|
+
// src/fonts.ts
|
|
3442
|
+
var DEFAULT_FONTS = [
|
|
3443
|
+
"Roboto",
|
|
3444
|
+
"Open Sans",
|
|
3445
|
+
"Lato",
|
|
3446
|
+
"Montserrat",
|
|
3447
|
+
"Poppins",
|
|
3448
|
+
"Inter",
|
|
3449
|
+
"Playfair Display",
|
|
3450
|
+
"Raleway",
|
|
3451
|
+
"Ubuntu",
|
|
3452
|
+
"Nunito",
|
|
3453
|
+
"Merriweather",
|
|
3454
|
+
"Work Sans",
|
|
3455
|
+
"Quicksand",
|
|
3456
|
+
"Mulish",
|
|
3457
|
+
"Manrope",
|
|
3458
|
+
"DM Sans",
|
|
3459
|
+
"Space Grotesk",
|
|
3460
|
+
"Plus Jakarta Sans",
|
|
3461
|
+
"Outfit",
|
|
3462
|
+
"Sora"
|
|
3463
|
+
];
|
|
3464
|
+
var loadedFonts = /* @__PURE__ */ new Set();
|
|
3465
|
+
var fontsInitialized = false;
|
|
3466
|
+
var preconnectAdded = false;
|
|
3467
|
+
function addFontPreconnect() {
|
|
3468
|
+
if (typeof document === "undefined" || preconnectAdded) return;
|
|
3469
|
+
preconnectAdded = true;
|
|
3470
|
+
if (!document.querySelector('link[href="https://fonts.googleapis.com"]')) {
|
|
3471
|
+
const pc1 = document.createElement("link");
|
|
3472
|
+
pc1.rel = "preconnect";
|
|
3473
|
+
pc1.href = "https://fonts.googleapis.com";
|
|
3474
|
+
document.head.appendChild(pc1);
|
|
3475
|
+
}
|
|
3476
|
+
if (!document.querySelector('link[href="https://fonts.gstatic.com"]')) {
|
|
3477
|
+
const pc2 = document.createElement("link");
|
|
3478
|
+
pc2.rel = "preconnect";
|
|
3479
|
+
pc2.href = "https://fonts.gstatic.com";
|
|
3480
|
+
pc2.crossOrigin = "anonymous";
|
|
3481
|
+
document.head.appendChild(pc2);
|
|
3482
|
+
}
|
|
3483
|
+
}
|
|
3484
|
+
function loadFont(family, weights = ["400", "500", "600", "700"]) {
|
|
3485
|
+
if (typeof document === "undefined") return;
|
|
3486
|
+
const linkId = `google-font-${family.replace(/[\s+]/g, "-").toLowerCase()}`;
|
|
3487
|
+
if (document.getElementById(linkId) || loadedFonts.has(family)) {
|
|
3488
|
+
return;
|
|
3489
|
+
}
|
|
3490
|
+
addFontPreconnect();
|
|
3491
|
+
const weightsStr = weights.join(";");
|
|
3492
|
+
const encodedFontName = encodeURIComponent(family).replace(/%20/g, "+");
|
|
3493
|
+
const fontUrl = `https://fonts.googleapis.com/css2?family=${encodedFontName}:wght@${weightsStr}&display=swap`;
|
|
3494
|
+
const link = document.createElement("link");
|
|
3495
|
+
link.id = linkId;
|
|
3496
|
+
link.rel = "stylesheet";
|
|
3497
|
+
link.href = fontUrl;
|
|
3498
|
+
document.head.appendChild(link);
|
|
3499
|
+
loadedFonts.add(family);
|
|
3500
|
+
}
|
|
3501
|
+
function loadFonts(fonts, weights = ["400", "500", "600", "700"]) {
|
|
3502
|
+
for (const font of fonts) {
|
|
3503
|
+
loadFont(font, weights);
|
|
3504
|
+
}
|
|
3505
|
+
}
|
|
3506
|
+
function loadDefaultFonts() {
|
|
3507
|
+
if (fontsInitialized) return;
|
|
3508
|
+
fontsInitialized = true;
|
|
3509
|
+
console.log("[Servly Fonts] Loading default fonts...");
|
|
3510
|
+
loadFonts(DEFAULT_FONTS);
|
|
3511
|
+
console.log("[Servly Fonts] Default fonts loaded");
|
|
3512
|
+
}
|
|
3513
|
+
function isFontLoaded(family) {
|
|
3514
|
+
if (typeof document === "undefined") return false;
|
|
3515
|
+
const linkId = `google-font-${family.replace(/[\s+]/g, "-").toLowerCase()}`;
|
|
3516
|
+
return !!document.getElementById(linkId) || loadedFonts.has(family);
|
|
3517
|
+
}
|
|
3518
|
+
function getDefaultFonts() {
|
|
3519
|
+
return [...DEFAULT_FONTS];
|
|
3520
|
+
}
|
|
3521
|
+
function getLoadedFonts() {
|
|
3522
|
+
return Array.from(loadedFonts);
|
|
3523
|
+
}
|
|
3524
|
+
function initFonts(config = {}) {
|
|
3525
|
+
const {
|
|
3526
|
+
additionalFonts = [],
|
|
3527
|
+
weights = ["400", "500", "600", "700"],
|
|
3528
|
+
loadDefaults = true
|
|
3529
|
+
} = config;
|
|
3530
|
+
addFontPreconnect();
|
|
3531
|
+
if (loadDefaults) {
|
|
3532
|
+
loadDefaultFonts();
|
|
3533
|
+
}
|
|
3534
|
+
if (additionalFonts.length > 0) {
|
|
3535
|
+
loadFonts(additionalFonts, weights);
|
|
3536
|
+
}
|
|
3537
|
+
}
|
|
3538
|
+
var autoInitialized = false;
|
|
3539
|
+
function ensureFonts() {
|
|
3540
|
+
if (autoInitialized || typeof document === "undefined") return;
|
|
3541
|
+
autoInitialized = true;
|
|
3542
|
+
addFontPreconnect();
|
|
3543
|
+
loadDefaultFonts();
|
|
3544
|
+
}
|
|
3545
|
+
|
|
3546
|
+
// src/renderer.ts
|
|
3378
3547
|
var tailwindAutoInjected = false;
|
|
3379
3548
|
function ensureTailwind() {
|
|
3380
3549
|
if (tailwindAutoInjected || typeof document === "undefined") return;
|
|
@@ -3382,6 +3551,7 @@ function ensureTailwind() {
|
|
|
3382
3551
|
injectTailwind({ usePlayCdn: true }).catch((err) => {
|
|
3383
3552
|
console.warn("Failed to auto-inject Tailwind CSS:", err);
|
|
3384
3553
|
});
|
|
3554
|
+
ensureFonts();
|
|
3385
3555
|
}
|
|
3386
3556
|
var COMPONENT_TO_TAG = {
|
|
3387
3557
|
container: "div",
|
|
@@ -5437,6 +5607,7 @@ init_tailwind();
|
|
|
5437
5607
|
StateManager,
|
|
5438
5608
|
addClass,
|
|
5439
5609
|
addCustomStyles,
|
|
5610
|
+
addFontPreconnect,
|
|
5440
5611
|
analytics,
|
|
5441
5612
|
applyStyles,
|
|
5442
5613
|
batchFetchComponents,
|
|
@@ -5462,6 +5633,7 @@ init_tailwind();
|
|
|
5462
5633
|
deepMerge,
|
|
5463
5634
|
deleteValueByPath,
|
|
5464
5635
|
detectCircularDependencies,
|
|
5636
|
+
ensureFonts,
|
|
5465
5637
|
extractBindingKeys,
|
|
5466
5638
|
extractDependencies,
|
|
5467
5639
|
extractDependenciesFromCode,
|
|
@@ -5475,12 +5647,14 @@ init_tailwind();
|
|
|
5475
5647
|
getAnalytics,
|
|
5476
5648
|
getCacheKey,
|
|
5477
5649
|
getCleanupOverrides,
|
|
5650
|
+
getDefaultFonts,
|
|
5478
5651
|
getDependencyTree,
|
|
5479
5652
|
getEventSystem,
|
|
5480
5653
|
getFromCache,
|
|
5481
5654
|
getIconData,
|
|
5482
5655
|
getIconDataSync,
|
|
5483
5656
|
getIconifyCollection,
|
|
5657
|
+
getLoadedFonts,
|
|
5484
5658
|
getLocalStorage,
|
|
5485
5659
|
getLongTaskObserver,
|
|
5486
5660
|
getMemoryCacheSize,
|
|
@@ -5501,17 +5675,22 @@ init_tailwind();
|
|
|
5501
5675
|
hasDependencyOverrides,
|
|
5502
5676
|
hasOverrides,
|
|
5503
5677
|
hasTemplateSyntax,
|
|
5678
|
+
initFonts,
|
|
5504
5679
|
initServlyTailwind,
|
|
5505
5680
|
injectTailwind,
|
|
5506
5681
|
injectTailwindStyles,
|
|
5507
5682
|
invalidateCache,
|
|
5508
5683
|
isComponentAvailable,
|
|
5684
|
+
isFontLoaded,
|
|
5509
5685
|
isIconCdnEnabled,
|
|
5510
5686
|
isIconRegistered,
|
|
5511
5687
|
isIconSetSupported,
|
|
5512
5688
|
isTailwindLoaded,
|
|
5513
5689
|
isTailwindReady,
|
|
5514
5690
|
isValidSpecifier,
|
|
5691
|
+
loadDefaultFonts,
|
|
5692
|
+
loadFont,
|
|
5693
|
+
loadFonts,
|
|
5515
5694
|
markElementReady,
|
|
5516
5695
|
navigateTo,
|
|
5517
5696
|
parseVersion,
|
package/dist/index.d.cts
CHANGED
|
@@ -1822,6 +1822,55 @@ declare const DEFAULT_SERVLY_TAILWIND_CONFIG: {
|
|
|
1822
1822
|
declare function initServlyTailwind(customConfig?: Record<string, any>): Promise<void>;
|
|
1823
1823
|
declare const injectTailwindStyles: typeof initServlyTailwind;
|
|
1824
1824
|
|
|
1825
|
+
/**
|
|
1826
|
+
* Google Fonts Utilities for Runtime Core
|
|
1827
|
+
* Provides automatic font loading for Servly components
|
|
1828
|
+
*/
|
|
1829
|
+
/**
|
|
1830
|
+
* Add preconnect links for Google Fonts (improves load performance)
|
|
1831
|
+
*/
|
|
1832
|
+
declare function addFontPreconnect(): void;
|
|
1833
|
+
/**
|
|
1834
|
+
* Load a specific Google Font
|
|
1835
|
+
*/
|
|
1836
|
+
declare function loadFont(family: string, weights?: string[]): void;
|
|
1837
|
+
/**
|
|
1838
|
+
* Load multiple fonts at once
|
|
1839
|
+
*/
|
|
1840
|
+
declare function loadFonts(fonts: string[], weights?: string[]): void;
|
|
1841
|
+
/**
|
|
1842
|
+
* Load default popular fonts
|
|
1843
|
+
*/
|
|
1844
|
+
declare function loadDefaultFonts(): void;
|
|
1845
|
+
/**
|
|
1846
|
+
* Check if a font is loaded
|
|
1847
|
+
*/
|
|
1848
|
+
declare function isFontLoaded(family: string): boolean;
|
|
1849
|
+
/**
|
|
1850
|
+
* Get list of default fonts
|
|
1851
|
+
*/
|
|
1852
|
+
declare function getDefaultFonts(): string[];
|
|
1853
|
+
/**
|
|
1854
|
+
* Get list of currently loaded fonts
|
|
1855
|
+
*/
|
|
1856
|
+
declare function getLoadedFonts(): string[];
|
|
1857
|
+
interface FontConfig {
|
|
1858
|
+
/** Additional fonts to load beyond defaults */
|
|
1859
|
+
additionalFonts?: string[];
|
|
1860
|
+
/** Font weights to load */
|
|
1861
|
+
weights?: string[];
|
|
1862
|
+
/** Whether to load default fonts */
|
|
1863
|
+
loadDefaults?: boolean;
|
|
1864
|
+
}
|
|
1865
|
+
/**
|
|
1866
|
+
* Initialize fonts with configuration
|
|
1867
|
+
*/
|
|
1868
|
+
declare function initFonts(config?: FontConfig): void;
|
|
1869
|
+
/**
|
|
1870
|
+
* Ensure fonts are loaded (called automatically by renderer)
|
|
1871
|
+
*/
|
|
1872
|
+
declare function ensureFonts(): void;
|
|
1873
|
+
|
|
1825
1874
|
/**
|
|
1826
1875
|
* Overrides System for Runtime Core
|
|
1827
1876
|
* Handles element overrides with dependency tracking
|
|
@@ -2019,4 +2068,4 @@ declare function getSupportedIconSets(): string[];
|
|
|
2019
2068
|
*/
|
|
2020
2069
|
declare function getIconifyCollection(set: string): string | undefined;
|
|
2021
2070
|
|
|
2022
|
-
export { AnalyticsCollector, type AnalyticsConfig, type AnalyticsEvent, type AnalyticsEventType, type Assertion$1 as Assertion, type AssertionResult$1 as AssertionResult, type BatchEventsRequest, type BatchEventsResponse, type BindingContext, type BundleStrategy, type BundledComponent, type CacheConfig, type CacheEntry, type CacheStrategy, type ClientInfo, type ComponentBundle, type ComponentData, type ComponentRegistry, DEFAULT_CACHE_CONFIG, DEFAULT_REGISTRY_URL, DEFAULT_RETRY_CONFIG, DEFAULT_SERVLY_TAILWIND_CONFIG, type DependencyEntry, type DependencyManifest, type DependencyType, EVENT_HANDLERS, type ElementConfig, type ErrorMetadata, type ErrorType, type EventContext, type EventHandlerConfig, EventSystem, type EventSystemConfig, type FetchMetadata, type FetchOptions, type FetchResult, type IconConfig, type IconData, type IconRenderer, type LayoutElement, LongTaskObserver, MemorySampler, type NavigationOptions, type Override, type OverrideState, OverrideSystem, type OverrideSystemConfig, type ParsedVersion, type PluginExecutor, type PropDefinition, type RenderMetadata, type RenderOptions, type RenderResult, type RetryConfig, type ServlyEventHandler, type ServlyPluginAction, type SessionInfo, SessionManager, type StateChangeEvent, StateManager, type StateManagerConfig, type TailwindConfig, type AssertionResult as TestAssertionResult, type TestCase$1 as TestCase, type TestCase as TestCaseInput, type TestCaseResult, type TestResult, type TestSummary as TestRunSummary, type TestSummary$1 as TestSummary, type ViewData, addClass, addCustomStyles, analytics, applyStyles, batchFetchComponents, buildClassName, buildElementStyles, buildRegistryFromBundle, bumpVersion, camelToKebab, clearAllCaches, clearIconCache, clearLocalStorageCache, clearMemoryCache, clearStyles, collectAllDependencies, collectAllViewDependencies, compareVersions, configureAnalytics, createIconSVG, createPlaceholderIcon, createRegistry, createServlyRenderer, createViewsMap, deepMerge, deleteValueByPath, detectCircularDependencies, extractBindingKeys, extractDependencies, extractDependenciesFromCode, extractOverrideDependencies, extractReferencedViewIds, fetchComponent, fetchComponentWithDependencies, formatStyleValue, formatVersion, generateTestCases, getAnalytics, getCacheKey, getCleanupOverrides, getDependencyTree, getEventSystem, getFromCache, getIconData, getIconDataSync, getIconifyCollection, getLocalStorage, getLongTaskObserver, getMemoryCacheSize, getMemorySampler, getMountOverrides, getOverrideSystem, getRegisteredIconKeys, getRegistryUrl, getSessionManager, getSessionStorage, getSupportedIconSets, getTailwind, getUrlInfo, getValueByPath, goBack, goForward, hasClass, hasDependencyOverrides, hasOverrides, hasTemplateSyntax, initServlyTailwind, injectTailwind, injectTailwindStyles, invalidateCache, isComponentAvailable, isIconCdnEnabled, isIconRegistered, isIconSetSupported, isTailwindLoaded, isTailwindReady, isValidSpecifier, markElementReady, navigateTo, parseVersion, prefetchComponents, preloadIcons, preloadTailwind, preventFOUC, processStyles, refreshTailwind, registerIcon, registerIcons, removeClass, removeCustomStyles, removeFOUCPrevention, removeLocalStorage, removeSessionStorage, removeTailwind, render, renderDynamicList, renderIcon, renderInShadow, renderNode, resetAnalytics, resetEventSystem, resetLongTaskObserver, resetMemorySampler, resetOverrideSystem, resetSessionManager, resolveBindingPath, resolveTemplate, resolveTemplateValue, resolveTemplatesDeep, resolveVersion, runAllTests, runTestCase, satisfiesVersion, scheduleRefresh, setIconCdnEnabled, setInCache, setLocalStorage, setRegistryUrl, setSessionStorage, setValueByPath, toDomEventName, toReactEventName, toggleClass, updateStyles, updateTailwindConfig, validateAssertion, validateProps, waitForTailwind };
|
|
2071
|
+
export { AnalyticsCollector, type AnalyticsConfig, type AnalyticsEvent, type AnalyticsEventType, type Assertion$1 as Assertion, type AssertionResult$1 as AssertionResult, type BatchEventsRequest, type BatchEventsResponse, type BindingContext, type BundleStrategy, type BundledComponent, type CacheConfig, type CacheEntry, type CacheStrategy, type ClientInfo, type ComponentBundle, type ComponentData, type ComponentRegistry, DEFAULT_CACHE_CONFIG, DEFAULT_REGISTRY_URL, DEFAULT_RETRY_CONFIG, DEFAULT_SERVLY_TAILWIND_CONFIG, type DependencyEntry, type DependencyManifest, type DependencyType, EVENT_HANDLERS, type ElementConfig, type ErrorMetadata, type ErrorType, type EventContext, type EventHandlerConfig, EventSystem, type EventSystemConfig, type FetchMetadata, type FetchOptions, type FetchResult, type FontConfig, type IconConfig, type IconData, type IconRenderer, type LayoutElement, LongTaskObserver, MemorySampler, type NavigationOptions, type Override, type OverrideState, OverrideSystem, type OverrideSystemConfig, type ParsedVersion, type PluginExecutor, type PropDefinition, type RenderMetadata, type RenderOptions, type RenderResult, type RetryConfig, type ServlyEventHandler, type ServlyPluginAction, type SessionInfo, SessionManager, type StateChangeEvent, StateManager, type StateManagerConfig, type TailwindConfig, type AssertionResult as TestAssertionResult, type TestCase$1 as TestCase, type TestCase as TestCaseInput, type TestCaseResult, type TestResult, type TestSummary as TestRunSummary, type TestSummary$1 as TestSummary, type ViewData, addClass, addCustomStyles, addFontPreconnect, analytics, applyStyles, batchFetchComponents, buildClassName, buildElementStyles, buildRegistryFromBundle, bumpVersion, camelToKebab, clearAllCaches, clearIconCache, clearLocalStorageCache, clearMemoryCache, clearStyles, collectAllDependencies, collectAllViewDependencies, compareVersions, configureAnalytics, createIconSVG, createPlaceholderIcon, createRegistry, createServlyRenderer, createViewsMap, deepMerge, deleteValueByPath, detectCircularDependencies, ensureFonts, extractBindingKeys, extractDependencies, extractDependenciesFromCode, extractOverrideDependencies, extractReferencedViewIds, fetchComponent, fetchComponentWithDependencies, formatStyleValue, formatVersion, generateTestCases, getAnalytics, getCacheKey, getCleanupOverrides, getDefaultFonts, getDependencyTree, getEventSystem, getFromCache, getIconData, getIconDataSync, getIconifyCollection, getLoadedFonts, getLocalStorage, getLongTaskObserver, getMemoryCacheSize, getMemorySampler, getMountOverrides, getOverrideSystem, getRegisteredIconKeys, getRegistryUrl, getSessionManager, getSessionStorage, getSupportedIconSets, getTailwind, getUrlInfo, getValueByPath, goBack, goForward, hasClass, hasDependencyOverrides, hasOverrides, hasTemplateSyntax, initFonts, initServlyTailwind, injectTailwind, injectTailwindStyles, invalidateCache, isComponentAvailable, isFontLoaded, isIconCdnEnabled, isIconRegistered, isIconSetSupported, isTailwindLoaded, isTailwindReady, isValidSpecifier, loadDefaultFonts, loadFont, loadFonts, markElementReady, navigateTo, parseVersion, prefetchComponents, preloadIcons, preloadTailwind, preventFOUC, processStyles, refreshTailwind, registerIcon, registerIcons, removeClass, removeCustomStyles, removeFOUCPrevention, removeLocalStorage, removeSessionStorage, removeTailwind, render, renderDynamicList, renderIcon, renderInShadow, renderNode, resetAnalytics, resetEventSystem, resetLongTaskObserver, resetMemorySampler, resetOverrideSystem, resetSessionManager, resolveBindingPath, resolveTemplate, resolveTemplateValue, resolveTemplatesDeep, resolveVersion, runAllTests, runTestCase, satisfiesVersion, scheduleRefresh, setIconCdnEnabled, setInCache, setLocalStorage, setRegistryUrl, setSessionStorage, setValueByPath, toDomEventName, toReactEventName, toggleClass, updateStyles, updateTailwindConfig, validateAssertion, validateProps, waitForTailwind };
|
package/dist/index.d.ts
CHANGED
|
@@ -1822,6 +1822,55 @@ declare const DEFAULT_SERVLY_TAILWIND_CONFIG: {
|
|
|
1822
1822
|
declare function initServlyTailwind(customConfig?: Record<string, any>): Promise<void>;
|
|
1823
1823
|
declare const injectTailwindStyles: typeof initServlyTailwind;
|
|
1824
1824
|
|
|
1825
|
+
/**
|
|
1826
|
+
* Google Fonts Utilities for Runtime Core
|
|
1827
|
+
* Provides automatic font loading for Servly components
|
|
1828
|
+
*/
|
|
1829
|
+
/**
|
|
1830
|
+
* Add preconnect links for Google Fonts (improves load performance)
|
|
1831
|
+
*/
|
|
1832
|
+
declare function addFontPreconnect(): void;
|
|
1833
|
+
/**
|
|
1834
|
+
* Load a specific Google Font
|
|
1835
|
+
*/
|
|
1836
|
+
declare function loadFont(family: string, weights?: string[]): void;
|
|
1837
|
+
/**
|
|
1838
|
+
* Load multiple fonts at once
|
|
1839
|
+
*/
|
|
1840
|
+
declare function loadFonts(fonts: string[], weights?: string[]): void;
|
|
1841
|
+
/**
|
|
1842
|
+
* Load default popular fonts
|
|
1843
|
+
*/
|
|
1844
|
+
declare function loadDefaultFonts(): void;
|
|
1845
|
+
/**
|
|
1846
|
+
* Check if a font is loaded
|
|
1847
|
+
*/
|
|
1848
|
+
declare function isFontLoaded(family: string): boolean;
|
|
1849
|
+
/**
|
|
1850
|
+
* Get list of default fonts
|
|
1851
|
+
*/
|
|
1852
|
+
declare function getDefaultFonts(): string[];
|
|
1853
|
+
/**
|
|
1854
|
+
* Get list of currently loaded fonts
|
|
1855
|
+
*/
|
|
1856
|
+
declare function getLoadedFonts(): string[];
|
|
1857
|
+
interface FontConfig {
|
|
1858
|
+
/** Additional fonts to load beyond defaults */
|
|
1859
|
+
additionalFonts?: string[];
|
|
1860
|
+
/** Font weights to load */
|
|
1861
|
+
weights?: string[];
|
|
1862
|
+
/** Whether to load default fonts */
|
|
1863
|
+
loadDefaults?: boolean;
|
|
1864
|
+
}
|
|
1865
|
+
/**
|
|
1866
|
+
* Initialize fonts with configuration
|
|
1867
|
+
*/
|
|
1868
|
+
declare function initFonts(config?: FontConfig): void;
|
|
1869
|
+
/**
|
|
1870
|
+
* Ensure fonts are loaded (called automatically by renderer)
|
|
1871
|
+
*/
|
|
1872
|
+
declare function ensureFonts(): void;
|
|
1873
|
+
|
|
1825
1874
|
/**
|
|
1826
1875
|
* Overrides System for Runtime Core
|
|
1827
1876
|
* Handles element overrides with dependency tracking
|
|
@@ -2019,4 +2068,4 @@ declare function getSupportedIconSets(): string[];
|
|
|
2019
2068
|
*/
|
|
2020
2069
|
declare function getIconifyCollection(set: string): string | undefined;
|
|
2021
2070
|
|
|
2022
|
-
export { AnalyticsCollector, type AnalyticsConfig, type AnalyticsEvent, type AnalyticsEventType, type Assertion$1 as Assertion, type AssertionResult$1 as AssertionResult, type BatchEventsRequest, type BatchEventsResponse, type BindingContext, type BundleStrategy, type BundledComponent, type CacheConfig, type CacheEntry, type CacheStrategy, type ClientInfo, type ComponentBundle, type ComponentData, type ComponentRegistry, DEFAULT_CACHE_CONFIG, DEFAULT_REGISTRY_URL, DEFAULT_RETRY_CONFIG, DEFAULT_SERVLY_TAILWIND_CONFIG, type DependencyEntry, type DependencyManifest, type DependencyType, EVENT_HANDLERS, type ElementConfig, type ErrorMetadata, type ErrorType, type EventContext, type EventHandlerConfig, EventSystem, type EventSystemConfig, type FetchMetadata, type FetchOptions, type FetchResult, type IconConfig, type IconData, type IconRenderer, type LayoutElement, LongTaskObserver, MemorySampler, type NavigationOptions, type Override, type OverrideState, OverrideSystem, type OverrideSystemConfig, type ParsedVersion, type PluginExecutor, type PropDefinition, type RenderMetadata, type RenderOptions, type RenderResult, type RetryConfig, type ServlyEventHandler, type ServlyPluginAction, type SessionInfo, SessionManager, type StateChangeEvent, StateManager, type StateManagerConfig, type TailwindConfig, type AssertionResult as TestAssertionResult, type TestCase$1 as TestCase, type TestCase as TestCaseInput, type TestCaseResult, type TestResult, type TestSummary as TestRunSummary, type TestSummary$1 as TestSummary, type ViewData, addClass, addCustomStyles, analytics, applyStyles, batchFetchComponents, buildClassName, buildElementStyles, buildRegistryFromBundle, bumpVersion, camelToKebab, clearAllCaches, clearIconCache, clearLocalStorageCache, clearMemoryCache, clearStyles, collectAllDependencies, collectAllViewDependencies, compareVersions, configureAnalytics, createIconSVG, createPlaceholderIcon, createRegistry, createServlyRenderer, createViewsMap, deepMerge, deleteValueByPath, detectCircularDependencies, extractBindingKeys, extractDependencies, extractDependenciesFromCode, extractOverrideDependencies, extractReferencedViewIds, fetchComponent, fetchComponentWithDependencies, formatStyleValue, formatVersion, generateTestCases, getAnalytics, getCacheKey, getCleanupOverrides, getDependencyTree, getEventSystem, getFromCache, getIconData, getIconDataSync, getIconifyCollection, getLocalStorage, getLongTaskObserver, getMemoryCacheSize, getMemorySampler, getMountOverrides, getOverrideSystem, getRegisteredIconKeys, getRegistryUrl, getSessionManager, getSessionStorage, getSupportedIconSets, getTailwind, getUrlInfo, getValueByPath, goBack, goForward, hasClass, hasDependencyOverrides, hasOverrides, hasTemplateSyntax, initServlyTailwind, injectTailwind, injectTailwindStyles, invalidateCache, isComponentAvailable, isIconCdnEnabled, isIconRegistered, isIconSetSupported, isTailwindLoaded, isTailwindReady, isValidSpecifier, markElementReady, navigateTo, parseVersion, prefetchComponents, preloadIcons, preloadTailwind, preventFOUC, processStyles, refreshTailwind, registerIcon, registerIcons, removeClass, removeCustomStyles, removeFOUCPrevention, removeLocalStorage, removeSessionStorage, removeTailwind, render, renderDynamicList, renderIcon, renderInShadow, renderNode, resetAnalytics, resetEventSystem, resetLongTaskObserver, resetMemorySampler, resetOverrideSystem, resetSessionManager, resolveBindingPath, resolveTemplate, resolveTemplateValue, resolveTemplatesDeep, resolveVersion, runAllTests, runTestCase, satisfiesVersion, scheduleRefresh, setIconCdnEnabled, setInCache, setLocalStorage, setRegistryUrl, setSessionStorage, setValueByPath, toDomEventName, toReactEventName, toggleClass, updateStyles, updateTailwindConfig, validateAssertion, validateProps, waitForTailwind };
|
|
2071
|
+
export { AnalyticsCollector, type AnalyticsConfig, type AnalyticsEvent, type AnalyticsEventType, type Assertion$1 as Assertion, type AssertionResult$1 as AssertionResult, type BatchEventsRequest, type BatchEventsResponse, type BindingContext, type BundleStrategy, type BundledComponent, type CacheConfig, type CacheEntry, type CacheStrategy, type ClientInfo, type ComponentBundle, type ComponentData, type ComponentRegistry, DEFAULT_CACHE_CONFIG, DEFAULT_REGISTRY_URL, DEFAULT_RETRY_CONFIG, DEFAULT_SERVLY_TAILWIND_CONFIG, type DependencyEntry, type DependencyManifest, type DependencyType, EVENT_HANDLERS, type ElementConfig, type ErrorMetadata, type ErrorType, type EventContext, type EventHandlerConfig, EventSystem, type EventSystemConfig, type FetchMetadata, type FetchOptions, type FetchResult, type FontConfig, type IconConfig, type IconData, type IconRenderer, type LayoutElement, LongTaskObserver, MemorySampler, type NavigationOptions, type Override, type OverrideState, OverrideSystem, type OverrideSystemConfig, type ParsedVersion, type PluginExecutor, type PropDefinition, type RenderMetadata, type RenderOptions, type RenderResult, type RetryConfig, type ServlyEventHandler, type ServlyPluginAction, type SessionInfo, SessionManager, type StateChangeEvent, StateManager, type StateManagerConfig, type TailwindConfig, type AssertionResult as TestAssertionResult, type TestCase$1 as TestCase, type TestCase as TestCaseInput, type TestCaseResult, type TestResult, type TestSummary as TestRunSummary, type TestSummary$1 as TestSummary, type ViewData, addClass, addCustomStyles, addFontPreconnect, analytics, applyStyles, batchFetchComponents, buildClassName, buildElementStyles, buildRegistryFromBundle, bumpVersion, camelToKebab, clearAllCaches, clearIconCache, clearLocalStorageCache, clearMemoryCache, clearStyles, collectAllDependencies, collectAllViewDependencies, compareVersions, configureAnalytics, createIconSVG, createPlaceholderIcon, createRegistry, createServlyRenderer, createViewsMap, deepMerge, deleteValueByPath, detectCircularDependencies, ensureFonts, extractBindingKeys, extractDependencies, extractDependenciesFromCode, extractOverrideDependencies, extractReferencedViewIds, fetchComponent, fetchComponentWithDependencies, formatStyleValue, formatVersion, generateTestCases, getAnalytics, getCacheKey, getCleanupOverrides, getDefaultFonts, getDependencyTree, getEventSystem, getFromCache, getIconData, getIconDataSync, getIconifyCollection, getLoadedFonts, getLocalStorage, getLongTaskObserver, getMemoryCacheSize, getMemorySampler, getMountOverrides, getOverrideSystem, getRegisteredIconKeys, getRegistryUrl, getSessionManager, getSessionStorage, getSupportedIconSets, getTailwind, getUrlInfo, getValueByPath, goBack, goForward, hasClass, hasDependencyOverrides, hasOverrides, hasTemplateSyntax, initFonts, initServlyTailwind, injectTailwind, injectTailwindStyles, invalidateCache, isComponentAvailable, isFontLoaded, isIconCdnEnabled, isIconRegistered, isIconSetSupported, isTailwindLoaded, isTailwindReady, isValidSpecifier, loadDefaultFonts, loadFont, loadFonts, markElementReady, navigateTo, parseVersion, prefetchComponents, preloadIcons, preloadTailwind, preventFOUC, processStyles, refreshTailwind, registerIcon, registerIcons, removeClass, removeCustomStyles, removeFOUCPrevention, removeLocalStorage, removeSessionStorage, removeTailwind, render, renderDynamicList, renderIcon, renderInShadow, renderNode, resetAnalytics, resetEventSystem, resetLongTaskObserver, resetMemorySampler, resetOverrideSystem, resetSessionManager, resolveBindingPath, resolveTemplate, resolveTemplateValue, resolveTemplatesDeep, resolveVersion, runAllTests, runTestCase, satisfiesVersion, scheduleRefresh, setIconCdnEnabled, setInCache, setLocalStorage, setRegistryUrl, setSessionStorage, setValueByPath, toDomEventName, toReactEventName, toggleClass, updateStyles, updateTailwindConfig, validateAssertion, validateProps, waitForTailwind };
|
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-TXHGJYYM.js";
|
|
21
21
|
import {
|
|
22
22
|
buildRegistryFromBundle,
|
|
23
23
|
collectAllDependencies,
|
|
@@ -2640,6 +2640,111 @@ function getIconifyCollection(set) {
|
|
|
2640
2640
|
return ICONIFY_COLLECTIONS[set];
|
|
2641
2641
|
}
|
|
2642
2642
|
|
|
2643
|
+
// src/fonts.ts
|
|
2644
|
+
var DEFAULT_FONTS = [
|
|
2645
|
+
"Roboto",
|
|
2646
|
+
"Open Sans",
|
|
2647
|
+
"Lato",
|
|
2648
|
+
"Montserrat",
|
|
2649
|
+
"Poppins",
|
|
2650
|
+
"Inter",
|
|
2651
|
+
"Playfair Display",
|
|
2652
|
+
"Raleway",
|
|
2653
|
+
"Ubuntu",
|
|
2654
|
+
"Nunito",
|
|
2655
|
+
"Merriweather",
|
|
2656
|
+
"Work Sans",
|
|
2657
|
+
"Quicksand",
|
|
2658
|
+
"Mulish",
|
|
2659
|
+
"Manrope",
|
|
2660
|
+
"DM Sans",
|
|
2661
|
+
"Space Grotesk",
|
|
2662
|
+
"Plus Jakarta Sans",
|
|
2663
|
+
"Outfit",
|
|
2664
|
+
"Sora"
|
|
2665
|
+
];
|
|
2666
|
+
var loadedFonts = /* @__PURE__ */ new Set();
|
|
2667
|
+
var fontsInitialized = false;
|
|
2668
|
+
var preconnectAdded = false;
|
|
2669
|
+
function addFontPreconnect() {
|
|
2670
|
+
if (typeof document === "undefined" || preconnectAdded) return;
|
|
2671
|
+
preconnectAdded = true;
|
|
2672
|
+
if (!document.querySelector('link[href="https://fonts.googleapis.com"]')) {
|
|
2673
|
+
const pc1 = document.createElement("link");
|
|
2674
|
+
pc1.rel = "preconnect";
|
|
2675
|
+
pc1.href = "https://fonts.googleapis.com";
|
|
2676
|
+
document.head.appendChild(pc1);
|
|
2677
|
+
}
|
|
2678
|
+
if (!document.querySelector('link[href="https://fonts.gstatic.com"]')) {
|
|
2679
|
+
const pc2 = document.createElement("link");
|
|
2680
|
+
pc2.rel = "preconnect";
|
|
2681
|
+
pc2.href = "https://fonts.gstatic.com";
|
|
2682
|
+
pc2.crossOrigin = "anonymous";
|
|
2683
|
+
document.head.appendChild(pc2);
|
|
2684
|
+
}
|
|
2685
|
+
}
|
|
2686
|
+
function loadFont(family, weights = ["400", "500", "600", "700"]) {
|
|
2687
|
+
if (typeof document === "undefined") return;
|
|
2688
|
+
const linkId = `google-font-${family.replace(/[\s+]/g, "-").toLowerCase()}`;
|
|
2689
|
+
if (document.getElementById(linkId) || loadedFonts.has(family)) {
|
|
2690
|
+
return;
|
|
2691
|
+
}
|
|
2692
|
+
addFontPreconnect();
|
|
2693
|
+
const weightsStr = weights.join(";");
|
|
2694
|
+
const encodedFontName = encodeURIComponent(family).replace(/%20/g, "+");
|
|
2695
|
+
const fontUrl = `https://fonts.googleapis.com/css2?family=${encodedFontName}:wght@${weightsStr}&display=swap`;
|
|
2696
|
+
const link = document.createElement("link");
|
|
2697
|
+
link.id = linkId;
|
|
2698
|
+
link.rel = "stylesheet";
|
|
2699
|
+
link.href = fontUrl;
|
|
2700
|
+
document.head.appendChild(link);
|
|
2701
|
+
loadedFonts.add(family);
|
|
2702
|
+
}
|
|
2703
|
+
function loadFonts(fonts, weights = ["400", "500", "600", "700"]) {
|
|
2704
|
+
for (const font of fonts) {
|
|
2705
|
+
loadFont(font, weights);
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2708
|
+
function loadDefaultFonts() {
|
|
2709
|
+
if (fontsInitialized) return;
|
|
2710
|
+
fontsInitialized = true;
|
|
2711
|
+
console.log("[Servly Fonts] Loading default fonts...");
|
|
2712
|
+
loadFonts(DEFAULT_FONTS);
|
|
2713
|
+
console.log("[Servly Fonts] Default fonts loaded");
|
|
2714
|
+
}
|
|
2715
|
+
function isFontLoaded(family) {
|
|
2716
|
+
if (typeof document === "undefined") return false;
|
|
2717
|
+
const linkId = `google-font-${family.replace(/[\s+]/g, "-").toLowerCase()}`;
|
|
2718
|
+
return !!document.getElementById(linkId) || loadedFonts.has(family);
|
|
2719
|
+
}
|
|
2720
|
+
function getDefaultFonts() {
|
|
2721
|
+
return [...DEFAULT_FONTS];
|
|
2722
|
+
}
|
|
2723
|
+
function getLoadedFonts() {
|
|
2724
|
+
return Array.from(loadedFonts);
|
|
2725
|
+
}
|
|
2726
|
+
function initFonts(config = {}) {
|
|
2727
|
+
const {
|
|
2728
|
+
additionalFonts = [],
|
|
2729
|
+
weights = ["400", "500", "600", "700"],
|
|
2730
|
+
loadDefaults = true
|
|
2731
|
+
} = config;
|
|
2732
|
+
addFontPreconnect();
|
|
2733
|
+
if (loadDefaults) {
|
|
2734
|
+
loadDefaultFonts();
|
|
2735
|
+
}
|
|
2736
|
+
if (additionalFonts.length > 0) {
|
|
2737
|
+
loadFonts(additionalFonts, weights);
|
|
2738
|
+
}
|
|
2739
|
+
}
|
|
2740
|
+
var autoInitialized = false;
|
|
2741
|
+
function ensureFonts() {
|
|
2742
|
+
if (autoInitialized || typeof document === "undefined") return;
|
|
2743
|
+
autoInitialized = true;
|
|
2744
|
+
addFontPreconnect();
|
|
2745
|
+
loadDefaultFonts();
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2643
2748
|
// src/renderer.ts
|
|
2644
2749
|
var tailwindAutoInjected = false;
|
|
2645
2750
|
function ensureTailwind() {
|
|
@@ -2648,6 +2753,7 @@ function ensureTailwind() {
|
|
|
2648
2753
|
injectTailwind({ usePlayCdn: true }).catch((err) => {
|
|
2649
2754
|
console.warn("Failed to auto-inject Tailwind CSS:", err);
|
|
2650
2755
|
});
|
|
2756
|
+
ensureFonts();
|
|
2651
2757
|
}
|
|
2652
2758
|
var COMPONENT_TO_TAG = {
|
|
2653
2759
|
container: "div",
|
|
@@ -3613,7 +3719,7 @@ async function createServlyRenderer(options) {
|
|
|
3613
3719
|
container = containerOption;
|
|
3614
3720
|
}
|
|
3615
3721
|
if (shouldInjectTailwind) {
|
|
3616
|
-
const { initServlyTailwind: initServlyTailwind2 } = await import("./tailwind-
|
|
3722
|
+
const { initServlyTailwind: initServlyTailwind2 } = await import("./tailwind-GU53TXCZ.js");
|
|
3617
3723
|
await initServlyTailwind2(tailwindConfig);
|
|
3618
3724
|
}
|
|
3619
3725
|
const activeRenders = [];
|
|
@@ -4697,6 +4803,7 @@ export {
|
|
|
4697
4803
|
StateManager,
|
|
4698
4804
|
addClass,
|
|
4699
4805
|
addCustomStyles,
|
|
4806
|
+
addFontPreconnect,
|
|
4700
4807
|
analytics,
|
|
4701
4808
|
applyStyles,
|
|
4702
4809
|
batchFetchComponents,
|
|
@@ -4722,6 +4829,7 @@ export {
|
|
|
4722
4829
|
deepMerge,
|
|
4723
4830
|
deleteValueByPath,
|
|
4724
4831
|
detectCircularDependencies,
|
|
4832
|
+
ensureFonts,
|
|
4725
4833
|
extractBindingKeys,
|
|
4726
4834
|
extractDependencies,
|
|
4727
4835
|
extractDependenciesFromCode,
|
|
@@ -4735,12 +4843,14 @@ export {
|
|
|
4735
4843
|
getAnalytics,
|
|
4736
4844
|
getCacheKey,
|
|
4737
4845
|
getCleanupOverrides,
|
|
4846
|
+
getDefaultFonts,
|
|
4738
4847
|
getDependencyTree,
|
|
4739
4848
|
getEventSystem,
|
|
4740
4849
|
getFromCache,
|
|
4741
4850
|
getIconData,
|
|
4742
4851
|
getIconDataSync,
|
|
4743
4852
|
getIconifyCollection,
|
|
4853
|
+
getLoadedFonts,
|
|
4744
4854
|
getLocalStorage,
|
|
4745
4855
|
getLongTaskObserver,
|
|
4746
4856
|
getMemoryCacheSize,
|
|
@@ -4761,17 +4871,22 @@ export {
|
|
|
4761
4871
|
hasDependencyOverrides,
|
|
4762
4872
|
hasOverrides,
|
|
4763
4873
|
hasTemplateSyntax,
|
|
4874
|
+
initFonts,
|
|
4764
4875
|
initServlyTailwind,
|
|
4765
4876
|
injectTailwind,
|
|
4766
4877
|
injectTailwindStyles,
|
|
4767
4878
|
invalidateCache,
|
|
4768
4879
|
isComponentAvailable,
|
|
4880
|
+
isFontLoaded,
|
|
4769
4881
|
isIconCdnEnabled,
|
|
4770
4882
|
isIconRegistered,
|
|
4771
4883
|
isIconSetSupported,
|
|
4772
4884
|
isTailwindLoaded,
|
|
4773
4885
|
isTailwindReady,
|
|
4774
4886
|
isValidSpecifier,
|
|
4887
|
+
loadDefaultFonts,
|
|
4888
|
+
loadFont,
|
|
4889
|
+
loadFonts,
|
|
4775
4890
|
markElementReady,
|
|
4776
4891
|
navigateTo,
|
|
4777
4892
|
parseVersion,
|