@krak-stack/registry 0.1.31 → 0.1.33
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/README.md +21 -0
- package/dist/components/ui/code-block.d.ts +8 -6
- package/dist/components/ui/code-block.js +40 -19
- package/dist/components/ui/copy-button.d.ts +9 -6
- package/dist/components/ui/copy-button.js +15 -8
- package/dist/components/ui/data-table.d.ts +9 -5
- package/dist/components/ui/data-table.js +74 -479
- package/dist/components/ui/editing-locale-switcher.d.ts +8 -4
- package/dist/components/ui/editing-locale-switcher.js +20 -448
- package/dist/components/ui/effect-form.d.ts +39 -10
- package/dist/components/ui/effect-form.js +141 -527
- package/dist/components/ui/error-component.d.ts +4 -2
- package/dist/components/ui/error-component.js +24 -450
- package/dist/components/ui/file-picker.d.ts +4 -2
- package/dist/components/ui/file-picker.js +25 -452
- package/dist/components/ui/form.d.ts +123 -71
- package/dist/components/ui/form.js +81 -474
- package/dist/components/ui/google-map.d.ts +2 -1
- package/dist/components/ui/google-map.js +4 -439
- package/dist/components/ui/icon-input.d.ts +50 -1
- package/dist/components/ui/icon-input.js +30 -446
- package/dist/components/ui/loading.d.ts +7 -1
- package/dist/components/ui/loading.js +4 -438
- package/dist/components/ui/locale-switcher.d.ts +8 -4
- package/dist/components/ui/locale-switcher.js +29 -453
- package/dist/components/ui/pagination.d.ts +5 -3
- package/dist/components/ui/pagination.js +5 -439
- package/dist/components/ui/search-menu.d.ts +4 -2
- package/dist/components/ui/search-menu.js +6 -440
- package/dist/components/ui/theme-switcher.d.ts +5 -3
- package/dist/components/ui/theme-switcher.js +6 -440
- package/dist/components/ui/virtualized-combobox.d.ts +4 -2
- package/dist/components/ui/virtualized-combobox.js +11 -443
- package/dist/lib/docs.d.ts +2 -0
- package/dist/lib/docs.js +86 -481
- package/dist/lib/docs.server.js +0 -21
- package/dist/lib/documentation-toolkit.js +0 -21
- package/dist/lib/markdown/content.d.ts +4 -5
- package/dist/services/agent/client/index.js +75 -463
- package/dist/services/agent/client/widget.d.ts +6 -3
- package/dist/services/notification/client/index.js +8 -440
- package/dist/services/notification/client/notification-menu.d.ts +6 -3
- package/dist/services/notification/public.js +8 -440
- package/dist/services/opentelemetry/api.d.ts +5 -0
- package/dist/services/opentelemetry/api.js +44 -0
- package/dist/services/opentelemetry/browser.d.ts +10 -0
- package/dist/services/opentelemetry/browser.js +59 -0
- package/package.json +9 -1
- package/dist/paraglide/runtime.d.ts +0 -978
|
@@ -129,442 +129,6 @@ function InputGroupInput({
|
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
// ../../src/paraglide/runtime.js
|
|
133
|
-
import"@inlang/paraglide-js/urlpattern-polyfill";
|
|
134
|
-
var baseLocale = "en";
|
|
135
|
-
var locales = ["en", "fr"];
|
|
136
|
-
var cookieName = "locale";
|
|
137
|
-
var cookieMaxAge = 34560000;
|
|
138
|
-
var cookieDomain = "";
|
|
139
|
-
var localStorageKey = "PARAGLIDE_LOCALE";
|
|
140
|
-
var strategy = [
|
|
141
|
-
"url",
|
|
142
|
-
"cookie",
|
|
143
|
-
"preferredLanguage",
|
|
144
|
-
"baseLocale"
|
|
145
|
-
];
|
|
146
|
-
var routeStrategies = [
|
|
147
|
-
{
|
|
148
|
-
match: "/api/:path(.*)?",
|
|
149
|
-
exclude: true
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
match: "/sitemap.xml",
|
|
153
|
-
exclude: true
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
match: "/llms.txt",
|
|
157
|
-
exclude: true
|
|
158
|
-
}
|
|
159
|
-
];
|
|
160
|
-
var urlPatterns = [
|
|
161
|
-
{
|
|
162
|
-
pattern: "/:path(.*)?",
|
|
163
|
-
localized: [
|
|
164
|
-
[
|
|
165
|
-
"en",
|
|
166
|
-
"/en/:path(.*)?"
|
|
167
|
-
],
|
|
168
|
-
[
|
|
169
|
-
"fr",
|
|
170
|
-
"/fr/:path(.*)?"
|
|
171
|
-
]
|
|
172
|
-
]
|
|
173
|
-
}
|
|
174
|
-
];
|
|
175
|
-
var cachedRouteStrategyUrl;
|
|
176
|
-
var cachedRouteStrategy;
|
|
177
|
-
function findMatchingRouteStrategy(url) {
|
|
178
|
-
if (routeStrategies.length === 0) {
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
const urlString = typeof url === "string" ? url : url.href;
|
|
182
|
-
if (cachedRouteStrategyUrl === urlString) {
|
|
183
|
-
return cachedRouteStrategy;
|
|
184
|
-
}
|
|
185
|
-
const urlObject = new URL(urlString, "http://dummy.com");
|
|
186
|
-
let match;
|
|
187
|
-
for (const routeStrategy of routeStrategies) {
|
|
188
|
-
const pattern = new URLPattern(routeStrategy.match, urlObject.href);
|
|
189
|
-
if (pattern.exec(urlObject.href)) {
|
|
190
|
-
match = routeStrategy;
|
|
191
|
-
break;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
cachedRouteStrategyUrl = urlString;
|
|
195
|
-
cachedRouteStrategy = match;
|
|
196
|
-
return match;
|
|
197
|
-
}
|
|
198
|
-
function getStrategyForUrl(url) {
|
|
199
|
-
const routeStrategy = findMatchingRouteStrategy(url);
|
|
200
|
-
if (routeStrategy && routeStrategy.exclude !== true && Array.isArray(routeStrategy.strategy)) {
|
|
201
|
-
return routeStrategy.strategy;
|
|
202
|
-
}
|
|
203
|
-
return strategy;
|
|
204
|
-
}
|
|
205
|
-
var serverAsyncLocalStorage = undefined;
|
|
206
|
-
var isServer = import.meta.env?.SSR ?? typeof window === "undefined";
|
|
207
|
-
var experimentalStaticLocale = undefined;
|
|
208
|
-
var TREE_SHAKE_COOKIE_STRATEGY_USED = true;
|
|
209
|
-
var TREE_SHAKE_URL_STRATEGY_USED = true;
|
|
210
|
-
var TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED = false;
|
|
211
|
-
var TREE_SHAKE_PREFERRED_LANGUAGE_STRATEGY_USED = true;
|
|
212
|
-
var TREE_SHAKE_DEFAULT_URL_PATTERN_USED = false;
|
|
213
|
-
var TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED = false;
|
|
214
|
-
globalThis.__paraglide = globalThis.__paraglide ?? {};
|
|
215
|
-
globalThis.__paraglide.ssr = globalThis.__paraglide.ssr ?? {};
|
|
216
|
-
var _locale;
|
|
217
|
-
var localeInitiallySet = false;
|
|
218
|
-
var getLocale = () => {
|
|
219
|
-
if (experimentalStaticLocale !== undefined) {
|
|
220
|
-
return experimentalStaticLocale;
|
|
221
|
-
}
|
|
222
|
-
if (serverAsyncLocalStorage) {
|
|
223
|
-
const locale = serverAsyncLocalStorage?.getStore()?.locale;
|
|
224
|
-
if (locale) {
|
|
225
|
-
return locale;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
let strategyToUse = strategy;
|
|
229
|
-
if (!isServer && typeof window !== "undefined" && window.location?.href) {
|
|
230
|
-
strategyToUse = getStrategyForUrl(window.location.href);
|
|
231
|
-
}
|
|
232
|
-
const resolved = resolveLocaleWithStrategies(strategyToUse, typeof window !== "undefined" ? window.location?.href : undefined);
|
|
233
|
-
if (resolved) {
|
|
234
|
-
if (!localeInitiallySet) {
|
|
235
|
-
_locale = resolved;
|
|
236
|
-
localeInitiallySet = true;
|
|
237
|
-
setLocale(resolved, { reload: false });
|
|
238
|
-
}
|
|
239
|
-
return resolved;
|
|
240
|
-
}
|
|
241
|
-
throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found");
|
|
242
|
-
};
|
|
243
|
-
function resolveLocaleWithStrategies(strategyToUse, urlForUrlStrategy) {
|
|
244
|
-
let locale;
|
|
245
|
-
for (const strat of strategyToUse) {
|
|
246
|
-
if (TREE_SHAKE_COOKIE_STRATEGY_USED && strat === "cookie") {
|
|
247
|
-
locale = extractLocaleFromCookie();
|
|
248
|
-
} else if (strat === "baseLocale") {
|
|
249
|
-
locale = baseLocale;
|
|
250
|
-
} else if (TREE_SHAKE_URL_STRATEGY_USED && strat === "url" && !isServer && typeof urlForUrlStrategy === "string") {
|
|
251
|
-
locale = extractLocaleFromUrl(urlForUrlStrategy);
|
|
252
|
-
} else if (TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED && strat === "globalVariable" && _locale !== undefined) {
|
|
253
|
-
locale = _locale;
|
|
254
|
-
} else if (TREE_SHAKE_PREFERRED_LANGUAGE_STRATEGY_USED && strat === "preferredLanguage" && !isServer) {
|
|
255
|
-
locale = extractLocaleFromNavigator();
|
|
256
|
-
} else if (TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED && strat === "localStorage" && !isServer) {
|
|
257
|
-
locale = localStorage.getItem(localStorageKey) ?? undefined;
|
|
258
|
-
} else if (isCustomStrategy(strat) && customClientStrategies.has(strat)) {
|
|
259
|
-
const handler = customClientStrategies.get(strat);
|
|
260
|
-
if (handler) {
|
|
261
|
-
const result = handler.getLocale();
|
|
262
|
-
if (result instanceof Promise) {
|
|
263
|
-
continue;
|
|
264
|
-
}
|
|
265
|
-
if (result !== undefined) {
|
|
266
|
-
return assertIsLocale(result);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
const matchedLocale = toLocale(locale);
|
|
271
|
-
if (matchedLocale) {
|
|
272
|
-
return matchedLocale;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
var rtlLanguages = new Set([
|
|
278
|
-
"ar",
|
|
279
|
-
"dv",
|
|
280
|
-
"fa",
|
|
281
|
-
"he",
|
|
282
|
-
"ks",
|
|
283
|
-
"ku",
|
|
284
|
-
"ps",
|
|
285
|
-
"sd",
|
|
286
|
-
"ug",
|
|
287
|
-
"ur",
|
|
288
|
-
"yi"
|
|
289
|
-
]);
|
|
290
|
-
var navigateOrReload = (newLocation) => {
|
|
291
|
-
if (newLocation) {
|
|
292
|
-
window.location.href = newLocation;
|
|
293
|
-
} else {
|
|
294
|
-
window.location.reload();
|
|
295
|
-
}
|
|
296
|
-
};
|
|
297
|
-
var setLocale = (newLocale, options) => {
|
|
298
|
-
const optionsWithDefaults = {
|
|
299
|
-
reload: true,
|
|
300
|
-
...options
|
|
301
|
-
};
|
|
302
|
-
let currentLocale;
|
|
303
|
-
try {
|
|
304
|
-
currentLocale = getLocale();
|
|
305
|
-
} catch {}
|
|
306
|
-
const customSetLocalePromises = [];
|
|
307
|
-
let newLocation = undefined;
|
|
308
|
-
let strategyToUse = strategy;
|
|
309
|
-
if (!isServer && typeof window !== "undefined" && window.location?.href) {
|
|
310
|
-
strategyToUse = getStrategyForUrl(window.location.href);
|
|
311
|
-
}
|
|
312
|
-
for (const strat of strategyToUse) {
|
|
313
|
-
if (TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED && strat === "globalVariable") {
|
|
314
|
-
_locale = newLocale;
|
|
315
|
-
} else if (TREE_SHAKE_COOKIE_STRATEGY_USED && strat === "cookie") {
|
|
316
|
-
if (isServer || typeof document === "undefined" || typeof window === "undefined") {
|
|
317
|
-
continue;
|
|
318
|
-
}
|
|
319
|
-
const cookieString = `${cookieName}=${newLocale}; path=/; max-age=${cookieMaxAge}`;
|
|
320
|
-
document.cookie = cookieDomain ? `${cookieString}; domain=${cookieDomain}` : cookieString;
|
|
321
|
-
} else if (strat === "baseLocale") {
|
|
322
|
-
continue;
|
|
323
|
-
} else if (TREE_SHAKE_URL_STRATEGY_USED && strat === "url" && typeof window !== "undefined") {
|
|
324
|
-
newLocation = localizeUrl(window.location.href, {
|
|
325
|
-
locale: newLocale
|
|
326
|
-
}).href;
|
|
327
|
-
} else if (TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED && strat === "localStorage" && typeof window !== "undefined") {
|
|
328
|
-
localStorage.setItem(localStorageKey, newLocale);
|
|
329
|
-
} else if (isCustomStrategy(strat) && customClientStrategies.has(strat)) {
|
|
330
|
-
const handler = customClientStrategies.get(strat);
|
|
331
|
-
if (handler) {
|
|
332
|
-
let result = handler.setLocale(newLocale);
|
|
333
|
-
if (result instanceof Promise) {
|
|
334
|
-
result = result.catch((error) => {
|
|
335
|
-
throw new Error(`Custom strategy "${strat}" setLocale failed.`, {
|
|
336
|
-
cause: error
|
|
337
|
-
});
|
|
338
|
-
});
|
|
339
|
-
customSetLocalePromises.push(result);
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
const runReload = () => {
|
|
345
|
-
if (!isServer && optionsWithDefaults.reload && window.location && newLocale !== currentLocale) {
|
|
346
|
-
navigateOrReload(newLocation);
|
|
347
|
-
}
|
|
348
|
-
};
|
|
349
|
-
if (customSetLocalePromises.length) {
|
|
350
|
-
return Promise.all(customSetLocalePromises).then(() => {
|
|
351
|
-
runReload();
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
runReload();
|
|
355
|
-
return;
|
|
356
|
-
};
|
|
357
|
-
var getUrlOrigin = () => {
|
|
358
|
-
if (serverAsyncLocalStorage) {
|
|
359
|
-
return serverAsyncLocalStorage.getStore()?.origin ?? "http://fallback.com";
|
|
360
|
-
} else if (typeof window !== "undefined") {
|
|
361
|
-
return window.location.origin;
|
|
362
|
-
}
|
|
363
|
-
return "http://fallback.com";
|
|
364
|
-
};
|
|
365
|
-
function toLocale(value) {
|
|
366
|
-
if (typeof value !== "string") {
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
369
|
-
const lowerValue = value.toLowerCase();
|
|
370
|
-
for (const locale of locales) {
|
|
371
|
-
if (locale.toLowerCase() === lowerValue) {
|
|
372
|
-
return locale;
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
|
-
function assertIsLocale(input) {
|
|
378
|
-
const locale = toLocale(input);
|
|
379
|
-
if (locale)
|
|
380
|
-
return locale;
|
|
381
|
-
throw new Error(`Invalid locale: ${input}. Expected one of: ${locales.join(", ")}`);
|
|
382
|
-
}
|
|
383
|
-
function extractLocaleFromCookie() {
|
|
384
|
-
if (typeof document === "undefined" || !document.cookie) {
|
|
385
|
-
return;
|
|
386
|
-
}
|
|
387
|
-
const match = document.cookie.match(new RegExp(`(^| )${cookieName}=([^;]+)`));
|
|
388
|
-
const locale = match?.[2];
|
|
389
|
-
return toLocale(locale);
|
|
390
|
-
}
|
|
391
|
-
function extractLocaleFromNavigator() {
|
|
392
|
-
if (!navigator?.languages?.length) {
|
|
393
|
-
return;
|
|
394
|
-
}
|
|
395
|
-
const languages = navigator.languages.map((lang) => ({
|
|
396
|
-
fullTag: lang,
|
|
397
|
-
baseTag: lang.split("-")[0]
|
|
398
|
-
}));
|
|
399
|
-
for (const lang of languages) {
|
|
400
|
-
const fullLocale = toLocale(lang.fullTag);
|
|
401
|
-
if (fullLocale) {
|
|
402
|
-
return fullLocale;
|
|
403
|
-
}
|
|
404
|
-
const baseLocale2 = toLocale(lang.baseTag);
|
|
405
|
-
if (baseLocale2) {
|
|
406
|
-
return baseLocale2;
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
return;
|
|
410
|
-
}
|
|
411
|
-
var cachedUrl;
|
|
412
|
-
var cachedLocale;
|
|
413
|
-
function extractLocaleFromUrl(url) {
|
|
414
|
-
const urlString = typeof url === "string" ? url : url.href;
|
|
415
|
-
if (cachedUrl === urlString) {
|
|
416
|
-
return cachedLocale;
|
|
417
|
-
}
|
|
418
|
-
let result;
|
|
419
|
-
if (TREE_SHAKE_DEFAULT_URL_PATTERN_USED) {
|
|
420
|
-
result = defaultUrlPatternExtractLocale(url);
|
|
421
|
-
} else {
|
|
422
|
-
const urlObj = typeof url === "string" ? new URL(url) : url;
|
|
423
|
-
for (const element of urlPatterns) {
|
|
424
|
-
for (const [locale, localizedPattern] of element.localized) {
|
|
425
|
-
const match = new URLPattern(localizedPattern, urlObj.href).exec(urlObj.href);
|
|
426
|
-
if (match) {
|
|
427
|
-
result = locale;
|
|
428
|
-
break;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
if (result)
|
|
432
|
-
break;
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
cachedUrl = urlString;
|
|
436
|
-
cachedLocale = result;
|
|
437
|
-
return result;
|
|
438
|
-
}
|
|
439
|
-
function defaultUrlPatternExtractLocale(url) {
|
|
440
|
-
const urlObj = new URL(url, "http://dummy.com");
|
|
441
|
-
const pathSegments = urlObj.pathname.split("/").filter(Boolean);
|
|
442
|
-
return toLocale(pathSegments[0]) || baseLocale;
|
|
443
|
-
}
|
|
444
|
-
function localizeUrl(url, options) {
|
|
445
|
-
const targetLocale = options?.locale ? assertIsLocale(options?.locale) : getLocale();
|
|
446
|
-
if (TREE_SHAKE_DEFAULT_URL_PATTERN_USED) {
|
|
447
|
-
return localizeUrlDefaultPattern(url, targetLocale);
|
|
448
|
-
}
|
|
449
|
-
const urlObj = typeof url === "string" ? new URL(url) : url;
|
|
450
|
-
for (const element of urlPatterns) {
|
|
451
|
-
for (const [, localizedPattern] of element.localized) {
|
|
452
|
-
const match = new URLPattern(localizedPattern, urlObj.href).exec(urlObj.href);
|
|
453
|
-
if (!match) {
|
|
454
|
-
continue;
|
|
455
|
-
}
|
|
456
|
-
const targetPattern = element.localized.find(([locale]) => locale === targetLocale)?.[1];
|
|
457
|
-
if (!targetPattern) {
|
|
458
|
-
continue;
|
|
459
|
-
}
|
|
460
|
-
const localizedUrl = fillPattern(targetPattern, aggregateGroups(match), urlObj.origin);
|
|
461
|
-
return fillMissingUrlParts(localizedUrl, match);
|
|
462
|
-
}
|
|
463
|
-
const unlocalizedMatch = new URLPattern(element.pattern, urlObj.href).exec(urlObj.href);
|
|
464
|
-
if (unlocalizedMatch) {
|
|
465
|
-
const targetPattern = element.localized.find(([locale]) => locale === targetLocale)?.[1];
|
|
466
|
-
if (targetPattern) {
|
|
467
|
-
const localizedUrl = fillPattern(targetPattern, aggregateGroups(unlocalizedMatch), urlObj.origin);
|
|
468
|
-
return fillMissingUrlParts(localizedUrl, unlocalizedMatch);
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
return urlObj;
|
|
473
|
-
}
|
|
474
|
-
function localizeUrlDefaultPattern(url, locale) {
|
|
475
|
-
const urlObj = typeof url === "string" ? new URL(url, getUrlOrigin()) : new URL(url);
|
|
476
|
-
const currentLocale = extractLocaleFromUrl(urlObj);
|
|
477
|
-
if (currentLocale === locale) {
|
|
478
|
-
return urlObj;
|
|
479
|
-
}
|
|
480
|
-
const pathSegments = urlObj.pathname.split("/").filter(Boolean);
|
|
481
|
-
if (pathSegments.length > 0 && toLocale(pathSegments[0])) {
|
|
482
|
-
pathSegments.shift();
|
|
483
|
-
}
|
|
484
|
-
if (locale === baseLocale) {
|
|
485
|
-
urlObj.pathname = "/" + pathSegments.join("/");
|
|
486
|
-
} else {
|
|
487
|
-
urlObj.pathname = "/" + locale + "/" + pathSegments.join("/");
|
|
488
|
-
}
|
|
489
|
-
return urlObj;
|
|
490
|
-
}
|
|
491
|
-
function fillMissingUrlParts(url, match) {
|
|
492
|
-
if (match.protocol.groups["0"]) {
|
|
493
|
-
url.protocol = match.protocol.groups["0"] ?? "";
|
|
494
|
-
}
|
|
495
|
-
if (match.hostname.groups["0"]) {
|
|
496
|
-
url.hostname = match.hostname.groups["0"] ?? "";
|
|
497
|
-
}
|
|
498
|
-
if (match.username.groups["0"]) {
|
|
499
|
-
url.username = match.username.groups["0"] ?? "";
|
|
500
|
-
}
|
|
501
|
-
if (match.password.groups["0"]) {
|
|
502
|
-
url.password = match.password.groups["0"] ?? "";
|
|
503
|
-
}
|
|
504
|
-
if (match.port.groups["0"]) {
|
|
505
|
-
url.port = match.port.groups["0"] ?? "";
|
|
506
|
-
}
|
|
507
|
-
if (match.pathname.groups["0"]) {
|
|
508
|
-
url.pathname = match.pathname.groups["0"] ?? "";
|
|
509
|
-
}
|
|
510
|
-
if (match.search.groups["0"]) {
|
|
511
|
-
url.search = match.search.groups["0"] ?? "";
|
|
512
|
-
}
|
|
513
|
-
if (match.hash.groups["0"]) {
|
|
514
|
-
url.hash = match.hash.groups["0"] ?? "";
|
|
515
|
-
}
|
|
516
|
-
return url;
|
|
517
|
-
}
|
|
518
|
-
function fillPattern(pattern, values, origin) {
|
|
519
|
-
let processedPattern = pattern.replace(/(https?:\/\/[^:/]+):(\d+)(\/|$)/g, (_, protocol, port, slash) => {
|
|
520
|
-
return `${protocol}#PORT-${port}#${slash}`;
|
|
521
|
-
});
|
|
522
|
-
let processedGroupDelimiters = processedPattern.replace(/\{([^{}]*)\}([?+*]?)/g, (_, content, modifier) => {
|
|
523
|
-
if (modifier === "?") {
|
|
524
|
-
return content;
|
|
525
|
-
}
|
|
526
|
-
return content;
|
|
527
|
-
});
|
|
528
|
-
let filled = processedGroupDelimiters.replace(/(\/?):([a-zA-Z0-9_]+)(\([^)]*\))?([?+*]?)/g, (_, slash, name, __, modifier) => {
|
|
529
|
-
const value = values[name];
|
|
530
|
-
if (value === null) {
|
|
531
|
-
return "";
|
|
532
|
-
}
|
|
533
|
-
if (modifier === "?") {
|
|
534
|
-
return value !== undefined ? `${slash}${value}` : "";
|
|
535
|
-
}
|
|
536
|
-
if (modifier === "+" || modifier === "*") {
|
|
537
|
-
if (value === undefined && modifier === "+") {
|
|
538
|
-
throw new Error(`Missing value for "${name}" (one or more required)`);
|
|
539
|
-
}
|
|
540
|
-
return value ? `${slash}${value}` : "";
|
|
541
|
-
}
|
|
542
|
-
if (value === undefined) {
|
|
543
|
-
throw new Error(`Missing value for "${name}"`);
|
|
544
|
-
}
|
|
545
|
-
return `${slash}${value}`;
|
|
546
|
-
});
|
|
547
|
-
filled = filled.replace(/#PORT-(\d+)#/g, ":$1");
|
|
548
|
-
return new URL(filled, origin);
|
|
549
|
-
}
|
|
550
|
-
function aggregateGroups(match) {
|
|
551
|
-
return {
|
|
552
|
-
...match.hash.groups,
|
|
553
|
-
...match.hostname.groups,
|
|
554
|
-
...match.password.groups,
|
|
555
|
-
...match.pathname.groups,
|
|
556
|
-
...match.port.groups,
|
|
557
|
-
...match.protocol.groups,
|
|
558
|
-
...match.search.groups,
|
|
559
|
-
...match.username.groups
|
|
560
|
-
};
|
|
561
|
-
}
|
|
562
|
-
var customServerStrategies = new Map;
|
|
563
|
-
var customClientStrategies = new Map;
|
|
564
|
-
function isCustomStrategy(strategy2) {
|
|
565
|
-
return typeof strategy2 === "string" && /^custom-[A-Za-z0-9_-]+$/.test(strategy2);
|
|
566
|
-
}
|
|
567
|
-
|
|
568
132
|
// ../../src/components/ui/virtualized-combobox.tsx
|
|
569
133
|
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
570
134
|
"use client";
|
|
@@ -582,22 +146,24 @@ var messages = {
|
|
|
582
146
|
selectMore: "Sélectionner davantage"
|
|
583
147
|
}
|
|
584
148
|
};
|
|
585
|
-
var virtualizedComboboxMessages = (
|
|
586
|
-
...
|
|
587
|
-
...
|
|
149
|
+
var virtualizedComboboxMessages = (locale, translations) => ({
|
|
150
|
+
...locale.startsWith("fr") ? messages.fr : messages.en,
|
|
151
|
+
...translations?.[locale.split("-")[0] ?? locale],
|
|
152
|
+
...translations?.[locale]
|
|
588
153
|
});
|
|
589
154
|
var optionEquals = (item, selected) => item.value === selected.value;
|
|
590
155
|
var VirtualizedComboboxList = ({
|
|
591
156
|
emptyLabel,
|
|
592
157
|
groupSelections,
|
|
593
158
|
itemIndexRef,
|
|
159
|
+
locale = "en",
|
|
594
160
|
messages: messageOverrides,
|
|
595
161
|
renderItem,
|
|
596
162
|
selectedValues,
|
|
597
163
|
virtualizerRef
|
|
598
164
|
}) => {
|
|
599
165
|
const filteredItems = ComboboxPrimitive.useFilteredItems();
|
|
600
|
-
const labels = virtualizedComboboxMessages(messageOverrides);
|
|
166
|
+
const labels = virtualizedComboboxMessages(locale, messageOverrides);
|
|
601
167
|
const itemEntries = filteredItems.map((item, index) => ({
|
|
602
168
|
kind: "item",
|
|
603
169
|
item,
|
|
@@ -707,12 +273,13 @@ var VirtualizedComboboxContent = ({
|
|
|
707
273
|
emptyLabel,
|
|
708
274
|
groupSelections,
|
|
709
275
|
itemIndexRef,
|
|
276
|
+
locale = "en",
|
|
710
277
|
messages: messageOverrides,
|
|
711
278
|
renderItem,
|
|
712
279
|
selectedValues,
|
|
713
280
|
virtualizerRef
|
|
714
281
|
}) => {
|
|
715
|
-
const labels = virtualizedComboboxMessages(messageOverrides);
|
|
282
|
+
const labels = virtualizedComboboxMessages(locale, messageOverrides);
|
|
716
283
|
return /* @__PURE__ */ jsx4(ComboboxPrimitive.Portal, {
|
|
717
284
|
children: /* @__PURE__ */ jsx4(ComboboxPrimitive.Positioner, {
|
|
718
285
|
align: "start",
|
|
@@ -736,6 +303,7 @@ var VirtualizedComboboxContent = ({
|
|
|
736
303
|
emptyLabel,
|
|
737
304
|
groupSelections,
|
|
738
305
|
itemIndexRef,
|
|
306
|
+
locale,
|
|
739
307
|
messages: messageOverrides,
|
|
740
308
|
renderItem,
|
|
741
309
|
selectedValues,
|
|
@@ -785,7 +353,7 @@ var useComboboxVirtualizerRef = (providedRef) => {
|
|
|
785
353
|
var VirtualizedComboboxSingle = (props) => {
|
|
786
354
|
const virtualizerRef = useComboboxVirtualizerRef(props.virtualizerRef);
|
|
787
355
|
const itemIndexRef = useRef(new Map);
|
|
788
|
-
const labels = virtualizedComboboxMessages(props.messages);
|
|
356
|
+
const labels = virtualizedComboboxMessages(props.locale ?? "en", props.messages);
|
|
789
357
|
return /* @__PURE__ */ jsxs(ComboboxPrimitive.Root, {
|
|
790
358
|
disabled: props.disabled,
|
|
791
359
|
inputValue: props.searchValue,
|
|
@@ -826,7 +394,7 @@ var VirtualizedComboboxSingle = (props) => {
|
|
|
826
394
|
var VirtualizedComboboxMultiple = (props) => {
|
|
827
395
|
const virtualizerRef = useComboboxVirtualizerRef(props.virtualizerRef);
|
|
828
396
|
const itemIndexRef = useRef(new Map);
|
|
829
|
-
const labels = virtualizedComboboxMessages(props.messages);
|
|
397
|
+
const labels = virtualizedComboboxMessages(props.locale ?? "en", props.messages);
|
|
830
398
|
return /* @__PURE__ */ jsxs(ComboboxPrimitive.Root, {
|
|
831
399
|
disabled: props.disabled,
|
|
832
400
|
inputValue: props.searchValue,
|
|
@@ -896,6 +464,7 @@ var iconSearchAtoms = Atom.family((key) => {
|
|
|
896
464
|
var useIconSearchAtom = (collection, query) => useAtomValue(iconSearchAtoms(`${collection}\x00${query}`));
|
|
897
465
|
var labels = {
|
|
898
466
|
en: {
|
|
467
|
+
...virtualizedComboboxMessages("en"),
|
|
899
468
|
browse: "Browse Iconify",
|
|
900
469
|
empty: "No icons found.",
|
|
901
470
|
searchPlaceholder: "Search icons",
|
|
@@ -903,6 +472,7 @@ var labels = {
|
|
|
903
472
|
select: "Select icon"
|
|
904
473
|
},
|
|
905
474
|
fr: {
|
|
475
|
+
...virtualizedComboboxMessages("fr"),
|
|
906
476
|
browse: "Parcourir Iconify",
|
|
907
477
|
empty: "Aucune icône trouvée.",
|
|
908
478
|
searchPlaceholder: "Rechercher des icônes",
|
|
@@ -910,12 +480,18 @@ var labels = {
|
|
|
910
480
|
select: "Sélectionner une icône"
|
|
911
481
|
}
|
|
912
482
|
};
|
|
913
|
-
var iconInputLabels = () =>
|
|
483
|
+
var iconInputLabels = (locale, messages2) => ({
|
|
484
|
+
...locale.startsWith("fr") ? labels.fr : labels.en,
|
|
485
|
+
...messages2?.[locale.split("-")[0] ?? locale],
|
|
486
|
+
...messages2?.[locale]
|
|
487
|
+
});
|
|
914
488
|
var iconifyCollectionUrl = (collection) => `https://icon-sets.iconify.design/${encodeURIComponent(collection)}/`;
|
|
915
489
|
function IconInput({
|
|
916
490
|
collection = "lucide",
|
|
917
491
|
disabled,
|
|
918
492
|
id,
|
|
493
|
+
locale = "en",
|
|
494
|
+
messages: messages2,
|
|
919
495
|
onValueChange,
|
|
920
496
|
value
|
|
921
497
|
}) {
|
|
@@ -924,7 +500,7 @@ function IconInput({
|
|
|
924
500
|
const deferredQuery = useDeferredValue(query);
|
|
925
501
|
const iconSearchResult = useIconSearchAtom(collection, deferredQuery);
|
|
926
502
|
const icons = AsyncResult.isSuccess(iconSearchResult) ? iconSearchResult.value : [];
|
|
927
|
-
const copy = iconInputLabels();
|
|
503
|
+
const copy = iconInputLabels(locale, messages2);
|
|
928
504
|
const isWaiting = deferredQuery.trim() !== "" && AsyncResult.isWaiting(iconSearchResult);
|
|
929
505
|
const items = icons.map((icon) => ({ label: icon, value: icon }));
|
|
930
506
|
const selectedItem = value ? { label: value, value } : null;
|
|
@@ -959,7 +535,15 @@ function IconInput({
|
|
|
959
535
|
]
|
|
960
536
|
}),
|
|
961
537
|
items,
|
|
962
|
-
|
|
538
|
+
locale,
|
|
539
|
+
messages: {
|
|
540
|
+
[locale]: {
|
|
541
|
+
clear: copy.clear,
|
|
542
|
+
search: copy.searchPlaceholder,
|
|
543
|
+
selected: copy.selected,
|
|
544
|
+
selectMore: copy.selectMore
|
|
545
|
+
}
|
|
546
|
+
},
|
|
963
547
|
onOpenChange: (open) => {
|
|
964
548
|
setIsOpen(open);
|
|
965
549
|
if (open)
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
type LoadingVariant = "centered" | "inline";
|
|
2
|
-
export
|
|
2
|
+
export type LoadingMessages = {
|
|
3
|
+
loading: string;
|
|
4
|
+
};
|
|
5
|
+
export type LoadingMessageTranslations = Partial<Record<string, Partial<LoadingMessages>>>;
|
|
6
|
+
export declare function Loading({ className, label, locale, messages, variant, }: {
|
|
3
7
|
className?: string | undefined;
|
|
4
8
|
label?: string | undefined;
|
|
9
|
+
locale?: string | undefined;
|
|
10
|
+
messages?: LoadingMessageTranslations | undefined;
|
|
5
11
|
variant?: LoadingVariant | undefined;
|
|
6
12
|
}): import("react").JSX.Element;
|
|
7
13
|
export {};
|