astro-intlayer 9.7.0 → 9.7.1
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/cjs/_virtual/_rolldown/runtime.cjs +1 -2
- package/dist/cjs/client/format/index.cjs +9 -9
- package/dist/cjs/client/index.cjs +13 -13
- package/dist/cjs/client/localeRedirect.cjs +1 -2
- package/dist/cjs/emitRewrittenPages.cjs +1 -2
- package/dist/cjs/format/index.cjs +9 -9
- package/dist/cjs/format/useCompact.cjs +2 -3
- package/dist/cjs/format/useCurrency.cjs +2 -3
- package/dist/cjs/format/useDate.cjs +2 -3
- package/dist/cjs/format/useIntl.cjs +2 -3
- package/dist/cjs/format/useList.cjs +2 -3
- package/dist/cjs/format/useNumber.cjs +2 -3
- package/dist/cjs/format/usePercentage.cjs +2 -3
- package/dist/cjs/format/useRelativeTime.cjs +2 -3
- package/dist/cjs/format/useUnit.cjs +2 -3
- package/dist/cjs/html/index.cjs +5 -5
- package/dist/cjs/index.cjs +5 -6
- package/dist/cjs/integration.cjs +2 -3
- package/dist/cjs/markdown/index.cjs +7 -7
- package/dist/cjs/middleware.cjs +3 -4
- package/dist/cjs/requestStorage.cjs +1 -2
- package/dist/cjs/useDictionary.cjs +3 -4
- package/dist/cjs/useIntlayer.cjs +3 -4
- package/dist/cjs/useLocale.cjs +2 -3
- package/dist/cjs/withInertOnChange.cjs +1 -2
- package/dist/esm/client/localeRedirect.mjs +1 -2
- package/dist/esm/emitRewrittenPages.mjs +1 -2
- package/dist/esm/format/useCompact.mjs +1 -2
- package/dist/esm/format/useCurrency.mjs +1 -2
- package/dist/esm/format/useDate.mjs +1 -2
- package/dist/esm/format/useIntl.mjs +1 -2
- package/dist/esm/format/useList.mjs +1 -2
- package/dist/esm/format/useNumber.mjs +1 -2
- package/dist/esm/format/usePercentage.mjs +1 -2
- package/dist/esm/format/useRelativeTime.mjs +1 -2
- package/dist/esm/format/useUnit.mjs +1 -2
- package/dist/esm/index.mjs +1 -2
- package/dist/esm/integration.mjs +1 -2
- package/dist/esm/middleware.mjs +1 -2
- package/dist/esm/requestStorage.mjs +1 -2
- package/dist/esm/useDictionary.mjs +1 -2
- package/dist/esm/useIntlayer.mjs +1 -2
- package/dist/esm/useLocale.mjs +1 -2
- package/dist/esm/withInertOnChange.mjs +1 -2
- package/dist/types/client/localeRedirect.d.ts +0 -2
- package/dist/types/client/localeRedirect.d.ts.map +1 -1
- package/dist/types/emitRewrittenPages.d.ts +0 -2
- package/dist/types/emitRewrittenPages.d.ts.map +1 -1
- package/dist/types/format/useCompact.d.ts +0 -2
- package/dist/types/format/useCompact.d.ts.map +1 -1
- package/dist/types/format/useCurrency.d.ts +0 -2
- package/dist/types/format/useCurrency.d.ts.map +1 -1
- package/dist/types/format/useDate.d.ts +0 -2
- package/dist/types/format/useDate.d.ts.map +1 -1
- package/dist/types/format/useIntl.d.ts +0 -2
- package/dist/types/format/useIntl.d.ts.map +1 -1
- package/dist/types/format/useList.d.ts +0 -2
- package/dist/types/format/useList.d.ts.map +1 -1
- package/dist/types/format/useNumber.d.ts +0 -2
- package/dist/types/format/useNumber.d.ts.map +1 -1
- package/dist/types/format/usePercentage.d.ts +0 -2
- package/dist/types/format/usePercentage.d.ts.map +1 -1
- package/dist/types/format/useRelativeTime.d.ts +0 -2
- package/dist/types/format/useRelativeTime.d.ts.map +1 -1
- package/dist/types/format/useUnit.d.ts +0 -2
- package/dist/types/format/useUnit.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/integration.d.ts +1 -2
- package/dist/types/integration.d.ts.map +1 -1
- package/dist/types/middleware.d.ts +0 -2
- package/dist/types/middleware.d.ts.map +1 -1
- package/dist/types/requestStorage.d.ts +0 -2
- package/dist/types/requestStorage.d.ts.map +1 -1
- package/dist/types/useDictionary.d.ts +0 -2
- package/dist/types/useDictionary.d.ts.map +1 -1
- package/dist/types/useIntlayer.d.ts +0 -2
- package/dist/types/useIntlayer.d.ts.map +1 -1
- package/dist/types/useLocale.d.ts +0 -2
- package/dist/types/useLocale.d.ts.map +1 -1
- package/dist/types/withInertOnChange.d.ts +0 -2
- package/dist/types/withInertOnChange.d.ts.map +1 -1
- package/package.json +10 -10
|
@@ -2,7 +2,7 @@ import { getLocalizedUrl, isProxyStorageLocaleEnabled, resolveProxyMode } from "
|
|
|
2
2
|
import { internationalization, routing } from "@intlayer/config/built";
|
|
3
3
|
import { getLocaleFromStorageClient } from "@intlayer/core/utils";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/client/localeRedirect.ts
|
|
6
6
|
/**
|
|
7
7
|
* Locale explicitly carried by a URL — path prefix, or `?locale=` in
|
|
8
8
|
* `search-params` mode. `undefined` when the URL is unlocalized, which in
|
|
@@ -57,6 +57,5 @@ const redirectToStoredLocale = () => {
|
|
|
57
57
|
if (target) window.location.replace(target);
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
//#endregion
|
|
61
60
|
export { getStoredLocaleRedirect, redirectToStoredLocale };
|
|
62
61
|
//# sourceMappingURL=localeRedirect.mjs.map
|
|
@@ -3,7 +3,7 @@ import { dirname, join, relative, sep } from "node:path";
|
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { getCanonicalPath, getRewriteRules, resolveLocalizedPath } from "@intlayer/core/localization";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/emitRewrittenPages.ts
|
|
7
7
|
/**
|
|
8
8
|
* Recursively lists every `.html` file contained in a directory.
|
|
9
9
|
*/
|
|
@@ -96,6 +96,5 @@ const emitRewrittenPages = async (configuration, outputDirectoryUrl) => {
|
|
|
96
96
|
return emittedPages;
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
-
//#endregion
|
|
100
99
|
export { emitRewrittenPages };
|
|
101
100
|
//# sourceMappingURL=emitRewrittenPages.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getRequestLocale } from "../requestStorage.mjs";
|
|
2
2
|
import { compact } from "@intlayer/core/formatters";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/format/useCompact.ts
|
|
5
5
|
const useCompact = () => {
|
|
6
6
|
const locale = getRequestLocale();
|
|
7
7
|
return (...args) => compact(args[0], {
|
|
@@ -10,6 +10,5 @@ const useCompact = () => {
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
//#endregion
|
|
14
13
|
export { useCompact };
|
|
15
14
|
//# sourceMappingURL=useCompact.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getRequestLocale } from "../requestStorage.mjs";
|
|
2
2
|
import { currency } from "@intlayer/core/formatters";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/format/useCurrency.ts
|
|
5
5
|
const useCurrency = () => {
|
|
6
6
|
const locale = getRequestLocale();
|
|
7
7
|
return (...args) => currency(args[0], {
|
|
@@ -10,6 +10,5 @@ const useCurrency = () => {
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
//#endregion
|
|
14
13
|
export { useCurrency };
|
|
15
14
|
//# sourceMappingURL=useCurrency.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getRequestLocale } from "../requestStorage.mjs";
|
|
2
2
|
import { date, presets } from "@intlayer/core/formatters";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/format/useDate.ts
|
|
5
5
|
/**
|
|
6
6
|
* Astro hook that provides a localized date/time formatter bound to the request locale.
|
|
7
7
|
*/
|
|
@@ -19,6 +19,5 @@ const useDate = () => {
|
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
//#endregion
|
|
23
22
|
export { useDate };
|
|
24
23
|
//# sourceMappingURL=useDate.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getRequestLocale } from "../requestStorage.mjs";
|
|
2
2
|
import { bindIntl } from "@intlayer/core/utils";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/format/useIntl.ts
|
|
5
5
|
/**
|
|
6
6
|
* Astro hook that provides a locale-bound `Intl` object.
|
|
7
7
|
*
|
|
@@ -16,6 +16,5 @@ const useIntl = (locale) => {
|
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
//#endregion
|
|
20
19
|
export { useIntl };
|
|
21
20
|
//# sourceMappingURL=useIntl.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getRequestLocale } from "../requestStorage.mjs";
|
|
2
2
|
import { list } from "@intlayer/core/formatters";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/format/useList.ts
|
|
5
5
|
const useList = () => {
|
|
6
6
|
const locale = getRequestLocale();
|
|
7
7
|
return (...args) => list(args[0], {
|
|
@@ -10,6 +10,5 @@ const useList = () => {
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
//#endregion
|
|
14
13
|
export { useList };
|
|
15
14
|
//# sourceMappingURL=useList.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getRequestLocale } from "../requestStorage.mjs";
|
|
2
2
|
import { number } from "@intlayer/core/formatters";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/format/useNumber.ts
|
|
5
5
|
/**
|
|
6
6
|
* Astro hook that provides a localized number formatter bound to the request locale.
|
|
7
7
|
*/
|
|
@@ -13,6 +13,5 @@ const useNumber = () => {
|
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
//#endregion
|
|
17
16
|
export { useNumber };
|
|
18
17
|
//# sourceMappingURL=useNumber.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getRequestLocale } from "../requestStorage.mjs";
|
|
2
2
|
import { percentage } from "@intlayer/core/formatters";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/format/usePercentage.ts
|
|
5
5
|
const usePercentage = () => {
|
|
6
6
|
const locale = getRequestLocale();
|
|
7
7
|
return (...args) => percentage(args[0], {
|
|
@@ -10,6 +10,5 @@ const usePercentage = () => {
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
//#endregion
|
|
14
13
|
export { usePercentage };
|
|
15
14
|
//# sourceMappingURL=usePercentage.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getRequestLocale } from "../requestStorage.mjs";
|
|
2
2
|
import { relativeTime } from "@intlayer/core/formatters";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/format/useRelativeTime.ts
|
|
5
5
|
const useRelativeTime = () => {
|
|
6
6
|
const locale = getRequestLocale();
|
|
7
7
|
return (...args) => relativeTime(args[0], args[1], {
|
|
@@ -10,6 +10,5 @@ const useRelativeTime = () => {
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
//#endregion
|
|
14
13
|
export { useRelativeTime };
|
|
15
14
|
//# sourceMappingURL=useRelativeTime.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getRequestLocale } from "../requestStorage.mjs";
|
|
2
2
|
import { units } from "@intlayer/core/formatters";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/format/useUnit.ts
|
|
5
5
|
const useUnit = () => {
|
|
6
6
|
const locale = getRequestLocale();
|
|
7
7
|
return (...args) => units(args[0], {
|
|
@@ -10,6 +10,5 @@ const useUnit = () => {
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
//#endregion
|
|
14
13
|
export { useUnit };
|
|
15
14
|
//# sourceMappingURL=useUnit.mjs.map
|
package/dist/esm/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { useDictionary } from "./useDictionary.mjs";
|
|
|
3
3
|
import { useIntlayer } from "./useIntlayer.mjs";
|
|
4
4
|
import { useLocale } from "./useLocale.mjs";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/index.ts
|
|
7
7
|
/**
|
|
8
8
|
* Package self-reference to the Node-only half of the integration.
|
|
9
9
|
*
|
|
@@ -62,6 +62,5 @@ const intlayer = () => ({
|
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
|
|
65
|
-
//#endregion
|
|
66
65
|
export { intlayer as default, intlayer, getIntlayerLocals, useDictionary, useIntlayer, useLocale };
|
|
67
66
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/integration.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { getAlias } from "@intlayer/config/utils";
|
|
|
7
7
|
import { prepareIntlayer } from "@intlayer/engine/build";
|
|
8
8
|
import { INTLAYER_NO_EXTERNAL_PATTERN, intlayer } from "vite-intlayer";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/integration.ts
|
|
11
11
|
/**
|
|
12
12
|
* Keeps the intlayer packages out of Node's native module loader in *every*
|
|
13
13
|
* Vite environment Astro renders from.
|
|
@@ -70,6 +70,5 @@ const buildDone = async ({ dir, logger }) => {
|
|
|
70
70
|
if (emittedPages.length > 0) logger.info(`Emitted ${emittedPages.length} rewritten page(s): ${emittedPages.map(([from, to]) => `${from} \u2192 ${to}`).join(", ")}`);
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
//#endregion
|
|
74
73
|
export { buildDone, configSetup };
|
|
75
74
|
//# sourceMappingURL=integration.mjs.map
|
package/dist/esm/middleware.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { getLocaleFromRequest, resolveProxyMode } from "@intlayer/core/localizat
|
|
|
3
3
|
import * as builtConfiguration from "@intlayer/config/built";
|
|
4
4
|
import { createIntlayerWebProxyHandler } from "vite-intlayer/web-proxy-handler";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/middleware.ts
|
|
7
7
|
/**
|
|
8
8
|
* Whether `astro dev` is serving the app. Vite inlines `import.meta.env.DEV`
|
|
9
9
|
* into the server bundle; the optional chain keeps the module loadable where
|
|
@@ -95,6 +95,5 @@ const onRequest = async (context, next) => {
|
|
|
95
95
|
return proxyOutcome ? withProxyHeaders(response, proxyOutcome.headers) : response;
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
//#endregion
|
|
99
98
|
export { onRequest };
|
|
100
99
|
//# sourceMappingURL=middleware.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
2
|
import { registerAmbientLocaleResolver } from "@intlayer/core/interpreter";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/requestStorage.ts
|
|
5
5
|
/**
|
|
6
6
|
* `Astro.locals` of the request being rendered, made available to every
|
|
7
7
|
* function running inside the middleware scope — page and component
|
|
@@ -18,6 +18,5 @@ const getIntlayerLocals = () => requestStorage.getStore()?.intlayer;
|
|
|
18
18
|
const getRequestLocale = () => getIntlayerLocals()?.locale;
|
|
19
19
|
registerAmbientLocaleResolver(getRequestLocale);
|
|
20
20
|
|
|
21
|
-
//#endregion
|
|
22
21
|
export { getIntlayerLocals, getRequestLocale, requestStorage };
|
|
23
22
|
//# sourceMappingURL=requestStorage.mjs.map
|
|
@@ -3,7 +3,7 @@ import { withInertOnChange } from "./withInertOnChange.mjs";
|
|
|
3
3
|
import { resolveDictionaryArgument } from "@intlayer/core/dictionaryManipulator";
|
|
4
4
|
import { getDictionary } from "vanilla-intlayer";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/useDictionary.ts
|
|
7
7
|
/**
|
|
8
8
|
* Transforms an imported dictionary (or qualified dictionary group) and returns
|
|
9
9
|
* its content for the locale of the request being rendered, read from
|
|
@@ -32,6 +32,5 @@ const useDictionary = (dictionary, localeOrSelector) => withInertOnChange(getDic
|
|
|
32
32
|
dictionaryKey: dictionary.key
|
|
33
33
|
}) : localeOrSelector ?? getRequestLocale()));
|
|
34
34
|
|
|
35
|
-
//#endregion
|
|
36
35
|
export { useDictionary };
|
|
37
36
|
//# sourceMappingURL=useDictionary.mjs.map
|
package/dist/esm/useIntlayer.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { withInertOnChange } from "./withInertOnChange.mjs";
|
|
|
3
3
|
import { resolveDictionaryArgument } from "@intlayer/core/dictionaryManipulator";
|
|
4
4
|
import { getIntlayer } from "vanilla-intlayer";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/useIntlayer.ts
|
|
7
7
|
/**
|
|
8
8
|
* Picks one dictionary by its key and returns its content for the locale of
|
|
9
9
|
* the request being rendered, read from `Astro.locals.intlayer`.
|
|
@@ -32,6 +32,5 @@ const useIntlayer = (key, localeOrSelector) => withInertOnChange(getIntlayer(key
|
|
|
32
32
|
dictionaryKey: key
|
|
33
33
|
}) : localeOrSelector ?? getRequestLocale()));
|
|
34
34
|
|
|
35
|
-
//#endregion
|
|
36
35
|
export { useIntlayer };
|
|
37
36
|
//# sourceMappingURL=useIntlayer.mjs.map
|
package/dist/esm/useLocale.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getRequestLocale } from "./requestStorage.mjs";
|
|
2
2
|
import { internationalization } from "@intlayer/config/built";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/useLocale.ts
|
|
5
5
|
const { defaultLocale, locales: availableLocales } = internationalization;
|
|
6
6
|
/**
|
|
7
7
|
* Returns the locale of the request being rendered, read from
|
|
@@ -35,6 +35,5 @@ const useLocale = (_props = {}) => ({
|
|
|
35
35
|
subscribe: () => () => {}
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
//#endregion
|
|
39
38
|
export { useLocale };
|
|
40
39
|
//# sourceMappingURL=useLocale.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/withInertOnChange.ts
|
|
2
2
|
/**
|
|
3
3
|
* Gives server-rendered content the `.onChange()` of its client counterpart.
|
|
4
4
|
*
|
|
@@ -11,6 +11,5 @@ const withInertOnChange = (content) => {
|
|
|
11
11
|
return content;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
//#endregion
|
|
15
14
|
export { withInertOnChange };
|
|
16
15
|
//# sourceMappingURL=withInertOnChange.mjs.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/client/localeRedirect.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Computes where a prerendered page should send the visitor so it matches the
|
|
4
3
|
* locale they stored (cookie, localStorage or sessionStorage, per
|
|
@@ -22,5 +21,4 @@ export declare const getStoredLocaleRedirect: (url: URL, isDevServer: boolean) =
|
|
|
22
21
|
* already names a locale, so a redirected page does not redirect again.
|
|
23
22
|
*/
|
|
24
23
|
export declare const redirectToStoredLocale: () => void;
|
|
25
|
-
//#endregion
|
|
26
24
|
//# sourceMappingURL=localeRedirect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localeRedirect.d.ts","names":[],"sources":["../../../src/client/localeRedirect.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"localeRedirect.d.ts","names":[],"sources":["../../../src/client/localeRedirect.ts"],"mappings":";;;;;;;;;;;;;;;qBAwCa,0BAAuB,KAC7B,KAAG;;;;;;;qBAoCG"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IntlayerConfig } from "@intlayer/types/config";
|
|
2
|
-
//#region src/emitRewrittenPages.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Emits a copy of every prerendered page at its rewritten ("pretty") URL.
|
|
5
4
|
*
|
|
@@ -18,5 +17,4 @@ import { IntlayerConfig } from "@intlayer/types/config";
|
|
|
18
17
|
* @returns The list of `[from, to]` URL paths that were emitted.
|
|
19
18
|
*/
|
|
20
19
|
export declare const emitRewrittenPages: (configuration: IntlayerConfig, outputDirectoryUrl: URL) => Promise<[from: string, to: string][]>;
|
|
21
|
-
//#endregion
|
|
22
20
|
//# sourceMappingURL=emitRewrittenPages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitRewrittenPages.d.ts","names":[],"sources":["../../src/emitRewrittenPages.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"emitRewrittenPages.d.ts","names":[],"sources":["../../src/emitRewrittenPages.ts"],"mappings":";;;;;;;;;;;;;;;;;;qBAuHa,qBAAkB,eACd,gBAAc,oBACT,QACnB,SAAS,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCompact.d.ts","names":[],"sources":["../../../src/format/useCompact.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCompact.d.ts","names":[],"sources":["../../../src/format/useCompact.ts"],"mappings":";qBAGa,sBAAU,MAGJ,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrency.d.ts","names":[],"sources":["../../../src/format/useCurrency.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCurrency.d.ts","names":[],"sources":["../../../src/format/useCurrency.ts"],"mappings":";qBAGa,uBAAW,MAGL,kBAAkB"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { date } from "@intlayer/core/formatters";
|
|
2
|
-
//#region src/format/useDate.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Astro hook that provides a localized date/time formatter bound to the request locale.
|
|
5
4
|
*/
|
|
6
5
|
export declare const useDate: () => (...args: Parameters<typeof date>) => string;
|
|
7
|
-
//#endregion
|
|
8
6
|
//# sourceMappingURL=useDate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDate.d.ts","names":[],"sources":["../../../src/format/useDate.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDate.d.ts","names":[],"sources":["../../../src/format/useDate.ts"],"mappings":";;;;qBAMa,mBAAO,MAGD,kBAAkB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { WrappedIntl } from "@intlayer/core/utils";
|
|
2
2
|
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
3
|
-
//#region src/format/useIntl.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Astro hook that provides a locale-bound `Intl` object.
|
|
6
5
|
*
|
|
@@ -11,5 +10,4 @@ export declare const useIntl: (locale?: LocalesValues) => {
|
|
|
11
10
|
intl: WrappedIntl;
|
|
12
11
|
subscribe: (callback: (intl: WrappedIntl) => void) => () => void;
|
|
13
12
|
};
|
|
14
|
-
//#endregion
|
|
15
13
|
//# sourceMappingURL=useIntl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntl.d.ts","names":[],"sources":["../../../src/format/useIntl.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useIntl.d.ts","names":[],"sources":["../../../src/format/useIntl.ts"],"mappings":";;;;;;;;qBAUa,UAAO,SACT;EAET,MAAM;EACN,YAAY,WAAW,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useList.d.ts","names":[],"sources":["../../../src/format/useList.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useList.d.ts","names":[],"sources":["../../../src/format/useList.ts"],"mappings":";qBAGa,mBAAO,MAGD,kBAAkB"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { number } from "@intlayer/core/formatters";
|
|
2
|
-
//#region src/format/useNumber.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Astro hook that provides a localized number formatter bound to the request locale.
|
|
5
4
|
*/
|
|
6
5
|
export declare const useNumber: () => (...args: Parameters<typeof number>) => string;
|
|
7
|
-
//#endregion
|
|
8
6
|
//# sourceMappingURL=useNumber.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNumber.d.ts","names":[],"sources":["../../../src/format/useNumber.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useNumber.d.ts","names":[],"sources":["../../../src/format/useNumber.ts"],"mappings":";;;;qBAMa,qBAAS,MAGH,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePercentage.d.ts","names":[],"sources":["../../../src/format/usePercentage.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePercentage.d.ts","names":[],"sources":["../../../src/format/usePercentage.ts"],"mappings":";qBAGa,yBAAa,MAGP,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRelativeTime.d.ts","names":[],"sources":["../../../src/format/useRelativeTime.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useRelativeTime.d.ts","names":[],"sources":["../../../src/format/useRelativeTime.ts"],"mappings":";qBAGa,2BAAe,MAGT,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUnit.d.ts","names":[],"sources":["../../../src/format/useUnit.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useUnit.d.ts","names":[],"sources":["../../../src/format/useUnit.ts"],"mappings":";qBAGa,mBAAO,MAGD,kBAAkB"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { useDictionary } from "./useDictionary.js";
|
|
|
4
4
|
import { useIntlayer } from "./useIntlayer.js";
|
|
5
5
|
import { UseLocaleProps, UseLocaleResult, useLocale } from "./useLocale.js";
|
|
6
6
|
import { AstroIntegration } from "astro";
|
|
7
|
-
//#region src/index.d.ts
|
|
8
7
|
/**
|
|
9
8
|
* Astro integration for Intlayer.
|
|
10
9
|
*
|
|
@@ -35,6 +34,5 @@ import { AstroIntegration } from "astro";
|
|
|
35
34
|
* ```
|
|
36
35
|
*/
|
|
37
36
|
export declare const intlayer: () => AstroIntegration;
|
|
38
|
-
//#endregion
|
|
39
37
|
export { type IntlayerLocals, type UseLocaleProps, type UseLocaleResult, intlayer as default, getIntlayerLocals, useDictionary, useIntlayer, useLocale };
|
|
40
38
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAqDa,gBAAe"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AstroIntegration } from "astro";
|
|
2
|
-
//#region src/integration.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Node-only half of the integration, loaded lazily by the `astro-intlayer`
|
|
5
4
|
* entry when a hook runs.
|
|
@@ -37,5 +36,5 @@ export declare const configSetup: ({ command, updateConfig, addMiddleware, injec
|
|
|
37
36
|
* `getLocalizedUrl` (links, hreflang, sitemap) 404 once deployed.
|
|
38
37
|
*/
|
|
39
38
|
export declare const buildDone: ({ dir, logger }: BuildDoneOptions) => Promise<void>;
|
|
40
|
-
|
|
39
|
+
export {};
|
|
41
40
|
//# sourceMappingURL=integration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.d.ts","names":[],"sources":["../../src/integration.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"integration.d.ts","names":[],"sources":["../../src/integration.ts"],"mappings":";;;;;;;;;;KA0CK,qBAAqB,WACxB,YAAY;KAGT,mBAAmB,WACtB,YAAY;;;;;;;;;;;;;;;;;;;qBAqBD,gBAAW,SAAA,cAAA,eAAA,gBAKrB,uBAAqB;;;;;;;qBAsEX,cAAS,KAAA,UAGnB,qBAAmB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DeclaredLocales } from "@intlayer/types/module_augmentation";
|
|
2
2
|
import { MiddlewareHandler } from "astro";
|
|
3
|
-
//#region src/middleware.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Intlayer state stored in `Astro.locals.intlayer` by the {@link onRequest} middleware.
|
|
6
5
|
*/
|
|
@@ -50,5 +49,4 @@ declare global {
|
|
|
50
49
|
* ```
|
|
51
50
|
*/
|
|
52
51
|
export declare const onRequest: MiddlewareHandler;
|
|
53
|
-
//#endregion
|
|
54
52
|
//# sourceMappingURL=middleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","names":[],"sources":["../../src/middleware.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","names":[],"sources":["../../src/middleware.ts"],"mappings":";;;;;YAuEY;;EAEV,QAAQ;;EAER,eAAe;;EAEf,kBAAkB;;QAGZ;YACI;cACE;MACR,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAmCH,WAAW"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IntlayerLocals } from "./middleware.js";
|
|
2
2
|
import { DeclaredLocales } from "@intlayer/types/module_augmentation";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
|
-
//#region src/requestStorage.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* `Astro.locals` of the request being rendered, made available to every
|
|
7
6
|
* function running inside the middleware scope — page and component
|
|
@@ -18,5 +17,4 @@ export declare const getIntlayerLocals: () => IntlayerLocals | undefined;
|
|
|
18
17
|
* Returns the locale of the request being rendered, if any.
|
|
19
18
|
*/
|
|
20
19
|
export declare const getRequestLocale: () => DeclaredLocales | undefined;
|
|
21
|
-
//#endregion
|
|
22
20
|
//# sourceMappingURL=requestStorage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestStorage.d.ts","names":[],"sources":["../../src/requestStorage.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"requestStorage.d.ts","names":[],"sources":["../../src/requestStorage.ts"],"mappings":";;;;;;;;qBAUa,gBAAc;EACd,WAAA;;;;;qBAMA,yBAAwB;;;;qBAMxB,wBAAuB"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DeepTransformContent, WithOnChange } from "vanilla-intlayer";
|
|
2
2
|
import { DeclaredLocales, ExtractSelectorLocale, LocalesValues } from "@intlayer/types/module_augmentation";
|
|
3
3
|
import { Dictionary, DictionarySelectorForGroup, QualifiedDictionaryGroup, ResolveQualifiedDictionaryContent } from "@intlayer/types/dictionary";
|
|
4
|
-
//#region src/useDictionary.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Transforms an imported dictionary (or qualified dictionary group) and returns
|
|
7
6
|
* its content for the locale of the request being rendered, read from
|
|
@@ -25,5 +24,4 @@ import { Dictionary, DictionarySelectorForGroup, QualifiedDictionaryGroup, Resol
|
|
|
25
24
|
* ```
|
|
26
25
|
*/
|
|
27
26
|
export declare const useDictionary: <const T extends Dictionary | QualifiedDictionaryGroup, const A extends LocalesValues | DictionarySelectorForGroup<T> = DeclaredLocales>(dictionary: T, localeOrSelector?: A) => WithOnChange<DeepTransformContent<ResolveQualifiedDictionaryContent<T, A>, ExtractSelectorLocale<A>>>;
|
|
28
|
-
//#endregion
|
|
29
27
|
//# sourceMappingURL=useDictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionary.d.ts","names":[],"sources":["../../src/useDictionary.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDictionary.d.ts","names":[],"sources":["../../src/useDictionary.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;qBA0Ca,sBACL,UAAU,aAAa,gCACvB,UACF,gBACA,2BAA2B,KAAK,iBAAe,YAEvC,GAAC,mBACM,MAClB,aACD,qBACE,kCAAkC,GAAG,IACrC,sBAAsB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DeepTransformContent, WithOnChange } from "vanilla-intlayer";
|
|
2
2
|
import { DeclaredLocales, DictionaryKeys, DictionaryRegistryResult, DictionarySelectorForKey, ExtractSelectorLocale, LocalesValues } from "@intlayer/types/module_augmentation";
|
|
3
|
-
//#region src/useIntlayer.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Picks one dictionary by its key and returns its content for the locale of
|
|
6
5
|
* the request being rendered, read from `Astro.locals.intlayer`.
|
|
@@ -24,5 +23,4 @@ import { DeclaredLocales, DictionaryKeys, DictionaryRegistryResult, DictionarySe
|
|
|
24
23
|
* ```
|
|
25
24
|
*/
|
|
26
25
|
export declare const useIntlayer: <const T extends DictionaryKeys, const A extends LocalesValues | DictionarySelectorForKey<T> = DeclaredLocales>(key: T, localeOrSelector?: A) => WithOnChange<DeepTransformContent<DictionaryRegistryResult<T, A>, ExtractSelectorLocale<A>>>;
|
|
27
|
-
//#endregion
|
|
28
26
|
//# sourceMappingURL=useIntlayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntlayer.d.ts","names":[],"sources":["../../src/useIntlayer.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useIntlayer.d.ts","names":[],"sources":["../../src/useIntlayer.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;qBAuCa,oBACL,UAAU,sBACV,UAAU,gBAAgB,yBAAyB,KAAK,iBAAe,KAExE,GAAC,mBACa,MAClB,aACD,qBAAqB,yBAAyB,GAAG,IAAI,sBAAsB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { UseLocaleProps, UseLocaleProps as UseLocaleProps$1, UseLocaleResult as UseLocaleResult$1 } from "vanilla-intlayer";
|
|
2
|
-
//#region src/useLocale.d.ts
|
|
3
2
|
export type UseLocaleResult = UseLocaleResult$1;
|
|
4
3
|
/**
|
|
5
4
|
* Returns the locale of the request being rendered, read from
|
|
@@ -24,6 +23,5 @@ export type UseLocaleResult = UseLocaleResult$1;
|
|
|
24
23
|
* ```
|
|
25
24
|
*/
|
|
26
25
|
export declare const useLocale: (_props?: UseLocaleProps$1) => UseLocaleResult;
|
|
27
|
-
//#endregion
|
|
28
26
|
export type { UseLocaleProps };
|
|
29
27
|
//# sourceMappingURL=useLocale.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocale.d.ts","names":[],"sources":["../../src/useLocale.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLocale.d.ts","names":["VanillaUseLocaleResult","UseLocaleProps"],"sources":["../../src/useLocale.ts"],"mappings":";YAUY,kBAAkBA;;;;;;;;;;;;;;;;;;;;;;;qBA0BjB,YAAS,SAAYC,qBAAsB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { WithOnChange } from "vanilla-intlayer";
|
|
2
|
-
//#region src/withInertOnChange.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Gives server-rendered content the `.onChange()` of its client counterpart.
|
|
5
4
|
*
|
|
@@ -8,5 +7,4 @@ import { WithOnChange } from "vanilla-intlayer";
|
|
|
8
7
|
* `astro-intlayer` entry.
|
|
9
8
|
*/
|
|
10
9
|
export declare const withInertOnChange: <T>(content: T) => WithOnChange<T>;
|
|
11
|
-
//#endregion
|
|
12
10
|
//# sourceMappingURL=withInertOnChange.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withInertOnChange.d.ts","names":[],"sources":["../../src/withInertOnChange.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"withInertOnChange.d.ts","names":[],"sources":["../../src/withInertOnChange.ts"],"mappings":";;;;;;;;qBASa,oBAAqB,GAAC,SAAW,MAAI,aAAa"}
|