@intlayer/react-intl 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/esm/FormattedComponents.mjs +1 -2
- package/dist/esm/FormattedMessage.mjs +1 -2
- package/dist/esm/IntlProvider.mjs +2 -3
- package/dist/esm/context.mjs +1 -2
- package/dist/esm/createIntl.mjs +1 -2
- package/dist/esm/createIntlObject.mjs +1 -2
- package/dist/esm/defineMessages.mjs +1 -2
- package/dist/esm/errors.mjs +1 -2
- package/dist/esm/index.mjs +5 -5
- package/dist/esm/plugin/index.mjs +1 -2
- package/dist/esm/useDictionary.mjs +2 -3
- package/dist/esm/useDictionaryDynamic.mjs +1 -2
- package/dist/esm/useIntl.mjs +1 -2
- package/dist/types/FormattedComponents.d.ts +0 -2
- package/dist/types/FormattedComponents.d.ts.map +1 -1
- package/dist/types/FormattedMessage.d.ts +0 -2
- package/dist/types/FormattedMessage.d.ts.map +1 -1
- package/dist/types/IntlProvider.d.ts +0 -2
- package/dist/types/IntlProvider.d.ts.map +1 -1
- package/dist/types/context.d.ts +0 -2
- package/dist/types/context.d.ts.map +1 -1
- package/dist/types/createIntl.d.ts +0 -2
- package/dist/types/createIntl.d.ts.map +1 -1
- package/dist/types/createIntlObject.d.ts +0 -2
- package/dist/types/createIntlObject.d.ts.map +1 -1
- package/dist/types/defineMessages.d.ts +0 -2
- package/dist/types/defineMessages.d.ts.map +1 -1
- package/dist/types/dictionaryIntlShape.d.ts +1 -2
- package/dist/types/dictionaryIntlShape.d.ts.map +1 -1
- package/dist/types/errors.d.ts +0 -2
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/plugin/index.d.ts +0 -2
- package/dist/types/plugin/index.d.ts.map +1 -1
- package/dist/types/typedMessageIds.d.ts +0 -2
- package/dist/types/typedMessageIds.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/useDictionaryDynamic.d.ts +0 -2
- package/dist/types/useDictionaryDynamic.d.ts.map +1 -1
- package/dist/types/useIntl.d.ts +0 -2
- package/dist/types/useIntl.d.ts.map +1 -1
- package/package.json +12 -12
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { useIntl } from "./useIntl.mjs";
|
|
4
4
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/FormattedComponents.tsx
|
|
7
7
|
/**
|
|
8
8
|
* Drop-in for react-intl's `<FormattedDate>`.
|
|
9
9
|
* Renders a locale-aware date string using `Intl.DateTimeFormat`.
|
|
@@ -120,6 +120,5 @@ const FormattedListParts = ({ value, children, ...options }) => {
|
|
|
120
120
|
return /* @__PURE__ */ jsx(Fragment, { children: children(parts) });
|
|
121
121
|
};
|
|
122
122
|
|
|
123
|
-
//#endregion
|
|
124
123
|
export { FormattedDate, FormattedDateParts, FormattedDateTimeRange, FormattedDisplayName, FormattedList, FormattedListParts, FormattedNumber, FormattedNumberParts, FormattedPlural, FormattedRelativeTime, FormattedTime, FormattedTimeParts };
|
|
125
124
|
//# sourceMappingURL=FormattedComponents.mjs.map
|
|
@@ -4,7 +4,7 @@ import { useIntl } from "./useIntl.mjs";
|
|
|
4
4
|
import { Fragment } from "react";
|
|
5
5
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/FormattedMessage.tsx
|
|
8
8
|
/**
|
|
9
9
|
* Drop-in for react-intl's `<FormattedMessage>`.
|
|
10
10
|
*
|
|
@@ -39,6 +39,5 @@ const FormattedMessage = (({ id = "", description: _description, defaultMessage,
|
|
|
39
39
|
return /* @__PURE__ */ jsx(Fragment$1, { children: nodes });
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
//#endregion
|
|
43
42
|
export { FormattedMessage };
|
|
44
43
|
//# sourceMappingURL=FormattedMessage.mjs.map
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { IntlContext } from "./context.mjs";
|
|
4
4
|
import { createIntlObject } from "./createIntlObject.mjs";
|
|
5
5
|
import { useMemo } from "react";
|
|
6
|
-
import { IntlayerProvider } from "react-intlayer";
|
|
7
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { IntlayerProvider } from "react-intlayer";
|
|
8
8
|
import { log } from "@intlayer/config/built";
|
|
9
9
|
import { CYAN } from "@intlayer/config/colors";
|
|
10
10
|
import { colorize, getAppLogger } from "@intlayer/config/logger";
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
// src/IntlProvider.tsx
|
|
13
13
|
/**
|
|
14
14
|
* Drop-in for react-intl's `IntlProvider`.
|
|
15
15
|
*
|
|
@@ -32,6 +32,5 @@ const IntlProvider = ({ locale, children, messages: _messages, formats: _formats
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
-
//#endregion
|
|
36
35
|
export { IntlProvider };
|
|
37
36
|
//# sourceMappingURL=IntlProvider.mjs.map
|
package/dist/esm/context.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext } from "react";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/context.tsx
|
|
4
4
|
/**
|
|
5
5
|
* React context holding the active intlayer-backed `IntlShape` instance.
|
|
6
6
|
* Populated by {@link IntlProvider}; consumed by {@link useIntl}.
|
|
@@ -9,6 +9,5 @@ const IntlContext = createContext(null);
|
|
|
9
9
|
/** The raw `React.Provider<IntlShape>` — same as `IntlContext.Provider`. */
|
|
10
10
|
const RawIntlProvider = IntlContext.Provider;
|
|
11
11
|
|
|
12
|
-
//#endregion
|
|
13
12
|
export { IntlContext, RawIntlProvider };
|
|
14
13
|
//# sourceMappingURL=context.mjs.map
|
package/dist/esm/createIntl.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createIntlObject } from "./createIntlObject.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/createIntl.ts
|
|
4
4
|
/**
|
|
5
5
|
* Drop-in for react-intl's `createIntlCache`.
|
|
6
6
|
*
|
|
@@ -39,6 +39,5 @@ const createIntlCache = () => ({
|
|
|
39
39
|
*/
|
|
40
40
|
const createIntl = ({ locale }, _cache) => createIntlObject(locale);
|
|
41
41
|
|
|
42
|
-
//#endregion
|
|
43
42
|
export { createIntl, createIntlCache };
|
|
44
43
|
//# sourceMappingURL=createIntl.mjs.map
|
|
@@ -3,7 +3,7 @@ import { getIntlayer } from "@intlayer/core/interpreter";
|
|
|
3
3
|
import { createMessageResolver, icuToIntlayerFormatter, navigatePath, parseTaggedMessage } from "@intlayer/core/messageFormat";
|
|
4
4
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/createIntlObject.tsx
|
|
7
7
|
/**
|
|
8
8
|
* ICU-bound `resolveMessage`.
|
|
9
9
|
*
|
|
@@ -130,6 +130,5 @@ const createIntlObject = (locale, lookupOverride) => {
|
|
|
130
130
|
};
|
|
131
131
|
};
|
|
132
132
|
|
|
133
|
-
//#endregion
|
|
134
133
|
export { createIntlObject };
|
|
135
134
|
//# sourceMappingURL=createIntlObject.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/defineMessages.ts
|
|
2
2
|
/**
|
|
3
3
|
* Drop-in for react-intl's `defineMessages`.
|
|
4
4
|
* Identity function — returns the map unchanged.
|
|
@@ -12,6 +12,5 @@ const defineMessages = (messages) => messages;
|
|
|
12
12
|
*/
|
|
13
13
|
const defineMessage = (message) => message;
|
|
14
14
|
|
|
15
|
-
//#endregion
|
|
16
15
|
export { defineMessage, defineMessages };
|
|
17
16
|
//# sourceMappingURL=defineMessages.mjs.map
|
package/dist/esm/errors.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/errors.ts
|
|
2
2
|
/**
|
|
3
3
|
* Error code enum matching react-intl's `ReactIntlErrorCode`.
|
|
4
4
|
*
|
|
@@ -72,6 +72,5 @@ var UnsupportedFormatterError = class extends ReactIntlError {
|
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
//#endregion
|
|
76
75
|
export { InvalidConfigError, MessageFormatError, MissingDataError, MissingTranslationError, ReactIntlError, ReactIntlErrorCode, UnsupportedFormatterError };
|
|
77
76
|
//# sourceMappingURL=errors.mjs.map
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { IntlContext, RawIntlProvider } from "./context.mjs";
|
|
4
|
-
import { useIntl } from "./useIntl.mjs";
|
|
5
|
-
import { FormattedMessage } from "./FormattedMessage.mjs";
|
|
6
|
-
import { defineMessage, defineMessages } from "./defineMessages.mjs";
|
|
7
|
-
import { useDictionary } from "./useDictionary.mjs";
|
|
8
|
-
import { useDictionaryDynamic } from "./useDictionaryDynamic.mjs";
|
|
9
4
|
import { createIntl, createIntlCache } from "./createIntl.mjs";
|
|
5
|
+
import { defineMessage, defineMessages } from "./defineMessages.mjs";
|
|
10
6
|
import { InvalidConfigError, MessageFormatError, MissingDataError, MissingTranslationError, ReactIntlError, ReactIntlErrorCode, UnsupportedFormatterError } from "./errors.mjs";
|
|
11
7
|
import { FormattedDate, FormattedDateParts, FormattedDateTimeRange, FormattedDisplayName, FormattedList, FormattedListParts, FormattedNumber, FormattedNumberParts, FormattedPlural, FormattedRelativeTime, FormattedTime, FormattedTimeParts } from "./FormattedComponents.mjs";
|
|
8
|
+
import { FormattedMessage } from "./FormattedMessage.mjs";
|
|
12
9
|
import { IntlProvider } from "./IntlProvider.mjs";
|
|
10
|
+
import { useDictionary } from "./useDictionary.mjs";
|
|
11
|
+
import { useDictionaryDynamic } from "./useDictionaryDynamic.mjs";
|
|
12
|
+
import { useIntl } from "./useIntl.mjs";
|
|
13
13
|
|
|
14
14
|
export { FormattedDate, FormattedDateParts, FormattedDateTimeRange, FormattedDisplayName, FormattedList, FormattedListParts, FormattedMessage, FormattedNumber, FormattedNumberParts, FormattedPlural, FormattedRelativeTime, FormattedTime, FormattedTimeParts, IntlContext, IntlProvider, InvalidConfigError, MessageFormatError, MissingDataError, MissingTranslationError, RawIntlProvider, ReactIntlError, ReactIntlErrorCode, UnsupportedFormatterError, createIntl, createIntlCache, defineMessage, defineMessages, useDictionary, useDictionaryDynamic, useIntl };
|
|
@@ -6,7 +6,7 @@ import { getConfiguration } from "@intlayer/config/node";
|
|
|
6
6
|
import { runOnce } from "@intlayer/engine/utils";
|
|
7
7
|
import { intlayer } from "vite-intlayer";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/plugin/index.ts
|
|
10
10
|
/**
|
|
11
11
|
* A Vite plugin for react-intl compat that wraps vite-intlayer
|
|
12
12
|
* and injects a resolve alias mapping `react-intl` to
|
|
@@ -39,6 +39,5 @@ const reactIntlVitePlugin = (options) => {
|
|
|
39
39
|
return [...Array.isArray(basePlugins) ? basePlugins : [basePlugins], compatPlugin];
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
//#endregion
|
|
43
42
|
export { reactIntlVitePlugin as default, reactIntlVitePlugin };
|
|
44
43
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import { createIntlObject } from "./createIntlObject.mjs";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
|
-
import { useDictionary as useDictionary$1, useLocale } from "react-intlayer";
|
|
6
5
|
import { navigatePath } from "@intlayer/core/messageFormat";
|
|
6
|
+
import { useDictionary as useDictionary$1, useLocale } from "react-intlayer";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/useDictionary.ts
|
|
9
9
|
/**
|
|
10
10
|
* Builds the id lookup of a dictionary-bound intl object.
|
|
11
11
|
*
|
|
@@ -41,6 +41,5 @@ const useDictionary = (dictionary) => {
|
|
|
41
41
|
]);
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
//#endregion
|
|
45
44
|
export { createDictionaryLookup, useDictionary };
|
|
46
45
|
//# sourceMappingURL=useDictionary.mjs.map
|
|
@@ -5,7 +5,7 @@ import { createDictionaryLookup } from "./useDictionary.mjs";
|
|
|
5
5
|
import { useMemo } from "react";
|
|
6
6
|
import { useDictionaryDynamic as useDictionaryDynamic$1, useLocale } from "react-intlayer";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/useDictionaryDynamic.ts
|
|
9
9
|
/**
|
|
10
10
|
* Dynamic dictionary-accepting variant of `useIntl`.
|
|
11
11
|
*
|
|
@@ -22,6 +22,5 @@ const useDictionaryDynamic = (dictionaryPromise, key) => {
|
|
|
22
22
|
]);
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
//#endregion
|
|
26
25
|
export { useDictionaryDynamic };
|
|
27
26
|
//# sourceMappingURL=useDictionaryDynamic.mjs.map
|
package/dist/esm/useIntl.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { createIntlObject } from "./createIntlObject.mjs";
|
|
|
5
5
|
import { useContext, useMemo } from "react";
|
|
6
6
|
import { useLocale } from "react-intlayer";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/useIntl.ts
|
|
9
9
|
/**
|
|
10
10
|
* Drop-in for react-intl's `useIntl`.
|
|
11
11
|
*
|
|
@@ -27,6 +27,5 @@ const useIntl = () => {
|
|
|
27
27
|
return contextIntl ?? derivedIntl;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
//#endregion
|
|
31
30
|
export { useIntl };
|
|
32
31
|
//# sourceMappingURL=useIntl.mjs.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FormattedDate as FormattedDate$1, FormattedDateParts as FormattedDateParts$1, FormattedDateTimeRange as FormattedDateTimeRange$1, FormattedDisplayName as FormattedDisplayName$1, FormattedList as FormattedList$1, FormattedListParts as FormattedListParts$1, FormattedNumber as FormattedNumber$1, FormattedNumberParts as FormattedNumberParts$1, FormattedPlural as FormattedPlural$1, FormattedRelativeTime as FormattedRelativeTime$1, FormattedTime as FormattedTime$1, FormattedTimeParts as FormattedTimeParts$1 } from "react-intl";
|
|
2
|
-
//#region src/FormattedComponents.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Drop-in for react-intl's `<FormattedDate>`.
|
|
5
4
|
* Renders a locale-aware date string using `Intl.DateTimeFormat`.
|
|
@@ -61,5 +60,4 @@ export declare const FormattedNumberParts: typeof FormattedNumberParts$1;
|
|
|
61
60
|
* Renders list format parts via a `children` render-prop.
|
|
62
61
|
*/
|
|
63
62
|
export declare const FormattedListParts: typeof FormattedListParts$1;
|
|
64
|
-
//#endregion
|
|
65
63
|
//# sourceMappingURL=FormattedComponents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormattedComponents.d.ts","names":[],"sources":["../../src/FormattedComponents.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FormattedComponents.d.ts","names":["_FormattedDate","_FormattedTime","_FormattedNumber","_FormattedList","_FormattedDisplayName","_FormattedRelativeTime","_FormattedPlural","_FormattedDateTimeRange","_FormattedDateParts","_FormattedTimeParts","_FormattedNumberParts","_FormattedListParts"],"sources":["../../src/FormattedComponents.tsx"],"mappings":";;;;;qBA8Ba,sBAAsBA;;;;;qBAkBtB,sBAAsBC;;;;;qBAkBtB,wBAAwBC;;;;;qBAkBxB,sBAAsBC;;;;;qBAatB,6BAA6BC;;;;;;qBAiB7B,8BAA8BC;;;;;qBAmB9B,wBAAwBC;;;;;qBAmCxB,+BAA+BC;;;;;qBAkB/B,2BAA2BC;;;;;qBAkB3B,2BAA2BC;;;;;qBAkB3B,6BAA6BC;;;;;qBAe7B,2BAA2BC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FormattedMessage as FormattedMessage$1 } from "react-intl";
|
|
2
|
-
//#region src/FormattedMessage.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Drop-in for react-intl's `<FormattedMessage>`.
|
|
5
4
|
*
|
|
@@ -22,5 +21,4 @@ import { FormattedMessage as FormattedMessage$1 } from "react-intl";
|
|
|
22
21
|
* ```
|
|
23
22
|
*/
|
|
24
23
|
export declare const FormattedMessage: typeof FormattedMessage$1;
|
|
25
|
-
//#endregion
|
|
26
24
|
//# sourceMappingURL=FormattedMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormattedMessage.d.ts","names":[],"sources":["../../src/FormattedMessage.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FormattedMessage.d.ts","names":["_FormattedMessage"],"sources":["../../src/FormattedMessage.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;qBAgCa,yBAAyBA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IntlProvider as IntlProvider$1 } from "react-intl";
|
|
2
|
-
//#region src/IntlProvider.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Drop-in for react-intl's `IntlProvider`.
|
|
5
4
|
*
|
|
@@ -10,5 +9,4 @@ import { IntlProvider as IntlProvider$1 } from "react-intl";
|
|
|
10
9
|
* The `locale` prop is forwarded to `IntlayerClientProvider`.
|
|
11
10
|
*/
|
|
12
11
|
export declare const IntlProvider: typeof IntlProvider$1;
|
|
13
|
-
//#endregion
|
|
14
12
|
//# sourceMappingURL=IntlProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntlProvider.d.ts","names":[],"sources":["../../src/IntlProvider.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"IntlProvider.d.ts","names":["_IntlProvider"],"sources":["../../src/IntlProvider.tsx"],"mappings":";;;;;;;;;;qBAqBa,qBAAqBA"}
|
package/dist/types/context.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IntlShape } from "react-intl";
|
|
2
|
-
//#region src/context.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* React context holding the active intlayer-backed `IntlShape` instance.
|
|
5
4
|
* Populated by {@link IntlProvider}; consumed by {@link useIntl}.
|
|
@@ -7,5 +6,4 @@ import { IntlShape } from "react-intl";
|
|
|
7
6
|
export declare const IntlContext: import("react").Context<IntlShape>;
|
|
8
7
|
/** The raw `React.Provider<IntlShape>` — same as `IntlContext.Provider`. */
|
|
9
8
|
export declare const RawIntlProvider: import("react").Provider<IntlShape>;
|
|
10
|
-
//#endregion
|
|
11
9
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","names":[],"sources":["../../src/context.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.ts","names":[],"sources":["../../src/context.tsx"],"mappings":";;;;;qBAOa,6BAAW,QAAA;;qBAKX,iCAAe,SAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createIntl as createIntl$1, createIntlCache as createIntlCache$1 } from "react-intl";
|
|
2
|
-
//#region src/createIntl.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Drop-in for react-intl's `createIntlCache`.
|
|
5
4
|
*
|
|
@@ -29,5 +28,4 @@ export declare const createIntlCache: typeof createIntlCache$1;
|
|
|
29
28
|
* ```
|
|
30
29
|
*/
|
|
31
30
|
export declare const createIntl: typeof createIntl$1;
|
|
32
|
-
//#endregion
|
|
33
31
|
//# sourceMappingURL=createIntl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createIntl.d.ts","names":[],"sources":["../../src/createIntl.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createIntl.d.ts","names":["_createIntlCache","_createIntl"],"sources":["../../src/createIntl.ts"],"mappings":";;;;;;;;;;;qBAoBa,wBAAwBA;;;;;;;;;;;;;;;;;;qBA4BxB,mBAAmBC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IntlShape } from "react-intl";
|
|
2
2
|
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
3
|
-
//#region src/createIntlObject.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Builds an intlayer-backed `IntlShape` object for the given locale.
|
|
6
5
|
*
|
|
@@ -13,5 +12,4 @@ import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
|
13
12
|
* id resolution; used by the dictionary-bound `useDictionary` variant.
|
|
14
13
|
*/
|
|
15
14
|
export declare const createIntlObject: (locale: LocalesValues, lookupOverride?: (id: string) => unknown) => IntlShape;
|
|
16
|
-
//#endregion
|
|
17
15
|
//# sourceMappingURL=createIntlObject.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createIntlObject.d.ts","names":[],"sources":["../../src/createIntlObject.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createIntlObject.d.ts","names":[],"sources":["../../src/createIntlObject.tsx"],"mappings":";;;;;;;;;;;;;qBA+Fa,mBAAgB,QACnB,eAAa,kBACH,2BACjB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { defineMessage as defineMessage$1, defineMessages as defineMessages$1 } from "react-intl";
|
|
2
|
-
//#region src/defineMessages.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Drop-in for react-intl's `defineMessages`.
|
|
5
4
|
* Identity function — returns the map unchanged.
|
|
@@ -12,5 +11,4 @@ export declare const defineMessages: typeof defineMessages$1;
|
|
|
12
11
|
* Identity function — returns the descriptor unchanged.
|
|
13
12
|
*/
|
|
14
13
|
export declare const defineMessage: typeof defineMessage$1;
|
|
15
|
-
//#endregion
|
|
16
14
|
//# sourceMappingURL=defineMessages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineMessages.d.ts","names":[],"sources":["../../src/defineMessages.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"defineMessages.d.ts","names":["_defineMessages","_defineMessage"],"sources":["../../src/defineMessages.ts"],"mappings":";;;;;;;qBAWa,uBAAuBA;;;;;qBAMvB,sBAAsBC"}
|
|
@@ -3,7 +3,6 @@ import { DictionaryKeys } from "@intlayer/types/module_augmentation";
|
|
|
3
3
|
import { GetNestingResult } from "@intlayer/core/interpreter";
|
|
4
4
|
import { ValidDotPathsFor } from "@intlayer/core/transpiler";
|
|
5
5
|
import { ReactNode } from "react";
|
|
6
|
-
//#region src/dictionaryIntlShape.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* The interpreter-resolved content type at dot-path `P` of dictionary `N` —
|
|
9
8
|
* the same type strength as the base `useIntlayer` hook.
|
|
@@ -48,5 +47,5 @@ export type DictionaryIntlShape<N extends DictionaryKeys> = Omit<IntlShape, 'for
|
|
|
48
47
|
formatMessage: TypedFormatMessage<N>;
|
|
49
48
|
$t: TypedFormatMessage<N>;
|
|
50
49
|
};
|
|
51
|
-
|
|
50
|
+
export {};
|
|
52
51
|
//# sourceMappingURL=dictionaryIntlShape.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionaryIntlShape.d.ts","names":[],"sources":["../../src/dictionaryIntlShape.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dictionaryIntlShape.d.ts","names":[],"sources":["../../src/dictionaryIntlShape.ts"],"mappings":";;;;;;;;;KAUK,cAAc,UAAU,gBAAgB,KAAK,iBAAiB,GAAG;;;;;;KAOjE,gBAAgB,UAAU,gBAAgB,KAC7C,cAAc,GAAG,oBAAoB,cAAc,GAAG;;;;;YAM5C,qBAAqB,UAAU,kBACvC,iBAAiB,QACd,cAAc,iBAAiB;;;;;YAM1B,kBACV,UAAU,gBACV,qBACE,cAAc,oBAAoB,iBAClC,gBAAgB,GAAG,gBACnB,gBAAgB,GAAG;;;;;;;YAQX,mBAAmB,UAAU;GACtC,WAAW,qBAAqB,aAC/B,YAAY,KAAK;IAA6B,IAAI;KAClD,SAAS,eAAe,iBACvB,kBAAkB,GAAG;GACvB,WAAW,qBAAqB,aAC/B,YAAY,KAAK;IAA6B,IAAI;KAClD,SAAS,eAEP,YAAY,kBAAkB,QAAQ,cAAc,uBAE5C;;;;;;;YAQF,oBAAoB,UAAU,kBAAkB,KAC1D;EAGA,eAAe,mBAAmB;EAClC,IAAI,mBAAmB"}
|
package/dist/types/errors.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/errors.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Error code enum matching react-intl's `ReactIntlErrorCode`.
|
|
4
3
|
*
|
|
@@ -51,5 +50,4 @@ export declare class MissingTranslationError extends ReactIntlError {
|
|
|
51
50
|
export declare class UnsupportedFormatterError extends ReactIntlError {
|
|
52
51
|
constructor(message: string);
|
|
53
52
|
}
|
|
54
|
-
//#endregion
|
|
55
53
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","names":[],"sources":["../../src/errors.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","names":[],"sources":["../../src/errors.ts"],"mappings":";;;;;;oBAMY;EACV;EACA;EACA;EACA;EACA;;;;;;;qBAQW,uBAAuB;WAClB,MAAM;EAEtB,YAAY,MAAM,oBAAoB;;;;;qBAU3B,2BAA2B;EACtC,YAAY;;;;;qBASD,2BAA2B;EACtC,YAAY;;;;;qBASD,yBAAyB;EACpC,YAAY;;;;;qBASD,gCAAgC;EAC3C,YAAY;;;;;qBASD,kCAAkC;EAC7C,YAAY"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { FormattedDate, FormattedDateParts, FormattedDateTimeRange, FormattedDisplayName, FormattedList, FormattedListParts, FormattedNumber, FormattedNumberParts, FormattedPlural, FormattedRelativeTime, FormattedTime, FormattedTimeParts } from "./FormattedComponents.js";
|
|
2
|
-
import { FormattedMessage } from "./FormattedMessage.js";
|
|
3
|
-
import { IntlProvider } from "./IntlProvider.js";
|
|
4
1
|
import { IntlContext, RawIntlProvider } from "./context.js";
|
|
5
2
|
import { createIntl, createIntlCache } from "./createIntl.js";
|
|
6
3
|
import { defineMessage, defineMessages } from "./defineMessages.js";
|
|
7
4
|
import { DictionaryIntlShape, DictionaryMessageIds, MessageValueForId, TypedFormatMessage } from "./dictionaryIntlShape.js";
|
|
8
5
|
import { InvalidConfigError, MessageFormatError, MissingDataError, MissingTranslationError, ReactIntlError, ReactIntlErrorCode, UnsupportedFormatterError } from "./errors.js";
|
|
6
|
+
import { FormattedDate, FormattedDateParts, FormattedDateTimeRange, FormattedDisplayName, FormattedList, FormattedListParts, FormattedNumber, FormattedNumberParts, FormattedPlural, FormattedRelativeTime, FormattedTime, FormattedTimeParts } from "./FormattedComponents.js";
|
|
7
|
+
import { FormattedMessage } from "./FormattedMessage.js";
|
|
8
|
+
import { IntlProvider } from "./IntlProvider.js";
|
|
9
9
|
import { RootMessageIds } from "./typedMessageIds.js";
|
|
10
10
|
import { useDictionary } from "./useDictionary.js";
|
|
11
11
|
import { useDictionaryDynamic } from "./useDictionaryDynamic.js";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PluginOption } from "vite";
|
|
2
2
|
import { intlayer } from "vite-intlayer";
|
|
3
|
-
//#region src/plugin/index.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* A Vite plugin for react-intl compat that wraps vite-intlayer
|
|
6
5
|
* and injects a resolve alias mapping `react-intl` to
|
|
@@ -17,6 +16,5 @@ import { intlayer } from "vite-intlayer";
|
|
|
17
16
|
* ```
|
|
18
17
|
*/
|
|
19
18
|
export declare const reactIntlVitePlugin: (options?: Parameters<typeof intlayer>[0]) => PluginOption[];
|
|
20
|
-
//#endregion
|
|
21
19
|
export { reactIntlVitePlugin as default };
|
|
22
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/plugin/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/plugin/index.ts"],"mappings":";;;;;;;;;;;;;;;;;qBAwBa,sBAAmB,UACpB,kBAAkB,iBAC3B"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DictionaryKeys } from "@intlayer/types/module_augmentation";
|
|
2
2
|
import { ValidDotPathsFor } from "@intlayer/core/transpiler";
|
|
3
|
-
//#region src/typedMessageIds.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Every valid react-intl message id: `<dictionaryKey>.<dotPath>`, where the
|
|
6
5
|
* first segment designates the intlayer dictionary. Falls back to `string`
|
|
@@ -20,5 +19,4 @@ declare global {
|
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
21
|
}
|
|
23
|
-
//#endregion
|
|
24
22
|
//# sourceMappingURL=typedMessageIds.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedMessageIds.d.ts","names":[],"sources":["../../src/typedMessageIds.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"typedMessageIds.d.ts","names":[],"sources":["../../src/typedMessageIds.ts"],"mappings":";;;;;;;YAQY,gCAAgC,6BAGrC,KAAK,oBAAoB,cAAc,iBAAiB,iBACzD;QAEE;YACI;cACE;;;;;;;MAOR,KAAK"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DictionaryIntlShape } from "./dictionaryIntlShape.js";
|
|
2
2
|
import { DictionaryKeys } from "@intlayer/types/module_augmentation";
|
|
3
3
|
import { Dictionary } from "@intlayer/types/dictionary";
|
|
4
|
-
//#region src/useDictionary.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Builds the id lookup of a dictionary-bound intl object.
|
|
7
6
|
*
|
|
@@ -25,5 +24,4 @@ export declare const createDictionaryLookup: (dictionaryKey: string, content: un
|
|
|
25
24
|
* intl.formatMessage({ id: 'home.title' }); // or { id: 'title' } — both typed
|
|
26
25
|
*/
|
|
27
26
|
export declare const useDictionary: <T extends Dictionary>(dictionary: T) => DictionaryIntlShape<T['key'] & DictionaryKeys>;
|
|
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":";;;;;;;;;;;qBAqBa,yBAAsB,uBACX,sBAAkB;;;;;;;;;;;;;;qBAuB7B,gBAAiB,UAAU,YAAU,YACpC,MACX,oBAAoB,WAAW"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DictionaryIntlShape } from "./dictionaryIntlShape.js";
|
|
2
2
|
import { DictionaryKeys, StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
3
3
|
import { Dictionary } from "@intlayer/types/dictionary";
|
|
4
|
-
//#region src/useDictionaryDynamic.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Dynamic dictionary-accepting variant of `useIntl`.
|
|
7
6
|
*
|
|
@@ -9,5 +8,4 @@ import { Dictionary } from "@intlayer/types/dictionary";
|
|
|
9
8
|
* locale. Used internally by the build-time optimization.
|
|
10
9
|
*/
|
|
11
10
|
export declare const useDictionaryDynamic: <const T extends Dictionary, const K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K) => DictionaryIntlShape<K>;
|
|
12
|
-
//#endregion
|
|
13
11
|
//# sourceMappingURL=useDictionaryDynamic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionaryDynamic.d.ts","names":[],"sources":["../../src/useDictionaryDynamic.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDictionaryDynamic.d.ts","names":[],"sources":["../../src/useDictionaryDynamic.ts"],"mappings":";;;;;;;;;qBAuBa,6BACL,UAAU,kBACV,UAAU,gBAAc,mBAEX,0BAA0B,QAAQ,KAAG,KACnD,MACJ,oBAAoB"}
|
package/dist/types/useIntl.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useIntl as useIntl$1 } from "react-intl";
|
|
2
|
-
//#region src/useIntl.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Drop-in for react-intl's `useIntl`.
|
|
5
4
|
*
|
|
@@ -15,5 +14,4 @@ import { useIntl as useIntl$1 } from "react-intl";
|
|
|
15
14
|
* ```
|
|
16
15
|
*/
|
|
17
16
|
export declare const useIntl: typeof useIntl$1;
|
|
18
|
-
//#endregion
|
|
19
17
|
//# sourceMappingURL=useIntl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIntl.d.ts","names":[],"sources":["../../src/useIntl.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useIntl.d.ts","names":["_useIntl"],"sources":["../../src/useIntl.ts"],"mappings":";;;;;;;;;;;;;;;qBAuBa,gBAAgBA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/react-intl",
|
|
3
|
-
"version": "9.7.
|
|
3
|
+
"version": "9.7.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "react-intl API adapter for intlayer — drop-in compatibility layer",
|
|
6
6
|
"keywords": [
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@intlayer/config": "9.
|
|
79
|
-
"@intlayer/core": "9.7.
|
|
80
|
-
"@intlayer/dictionaries-entry": "9.
|
|
81
|
-
"@intlayer/engine": "9.7.
|
|
82
|
-
"@intlayer/types": "9.7.
|
|
83
|
-
"react-intlayer": "9.7.
|
|
84
|
-
"vite-intlayer": "9.
|
|
78
|
+
"@intlayer/config": "9.7.1",
|
|
79
|
+
"@intlayer/core": "9.7.1",
|
|
80
|
+
"@intlayer/dictionaries-entry": "9.7.1",
|
|
81
|
+
"@intlayer/engine": "9.7.1",
|
|
82
|
+
"@intlayer/types": "9.7.1",
|
|
83
|
+
"react-intlayer": "9.7.1",
|
|
84
|
+
"vite-intlayer": "9.7.1"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@types/node": "^26",
|
|
@@ -89,12 +89,12 @@
|
|
|
89
89
|
"@utils/ts-config": "1.0.4",
|
|
90
90
|
"@utils/ts-config-types": "1.0.4",
|
|
91
91
|
"@utils/tsdown-config": "1.0.4",
|
|
92
|
-
"react-intl": "^12.1.
|
|
92
|
+
"react-intl": "^12.1.6",
|
|
93
93
|
"rimraf": "6.1.3",
|
|
94
|
-
"tsdown": "0.23.
|
|
94
|
+
"tsdown": "0.23.4",
|
|
95
95
|
"typescript": "7.0.2",
|
|
96
|
-
"vite": "8.3.
|
|
97
|
-
"vitest": "5.0
|
|
96
|
+
"vite": "8.3.5",
|
|
97
|
+
"vitest": "5.1.0"
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
100
100
|
"react": ">=16.0.0",
|