intor 2.4.2 → 2.4.4
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 +1 -0
- package/dist/svelte/export/svelte/index.js +6 -0
- package/dist/svelte/src/client/svelte/provider/intor-provider.svelte +1 -5
- package/dist/svelte/src/client/svelte/translator/use-translator.js +1 -0
- package/dist/svelte-kit/src/adapters/svelte-kit/server/intor.js +1 -1
- package/dist/types/export/svelte/index.d.ts +3 -0
- package/dist/types/src/adapters/svelte-kit/server/intor.d.ts +9 -5
- package/dist/types/src/client/svelte/index.d.ts +1 -1
- package/dist/types/src/client/svelte/provider/index.d.ts +1 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export { createIntorStore } from '../../src/client/svelte/provider/create-intor-store.js';
|
|
2
|
+
import IntorProviderComponent from '../../src/client/svelte/provider/intor-provider.svelte';
|
|
2
3
|
export { useIntorContext } from '../../src/client/svelte/provider/use-intor-context.js';
|
|
3
4
|
export { useTranslator } from '../../src/client/svelte/translator/use-translator.js';
|
|
4
5
|
export { getClientLocale } from '../../src/client/shared/helpers/get-client-locale.js';
|
|
6
|
+
|
|
7
|
+
// intor / svelte
|
|
8
|
+
const IntorProvider = IntorProviderComponent;
|
|
9
|
+
|
|
10
|
+
export { IntorProvider };
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { IntorProviderProps } from "./types";
|
|
3
2
|
import { createIntorStore } from "./create-intor-store";
|
|
4
|
-
const { value, children } = $props
|
|
5
|
-
value: IntorProviderProps["value"];
|
|
6
|
-
children: IntorProviderProps["children"];
|
|
7
|
-
}>();
|
|
3
|
+
const { value, children } = $props();
|
|
8
4
|
// svelte-ignore state_referenced_locally
|
|
9
5
|
createIntorStore(value);
|
|
10
6
|
</script>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { intor as intor$1 } from '../../../server/intor/intor.js';
|
|
1
2
|
import '../../../core/error/intor-error.js';
|
|
2
3
|
import 'logry';
|
|
3
4
|
import 'p-limit';
|
|
4
5
|
import 'intor-translator';
|
|
5
|
-
import { intor as intor$1 } from '../../../server/intor/intor.js';
|
|
6
6
|
import 'node:path';
|
|
7
7
|
import 'node:fs/promises';
|
|
8
8
|
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export { createIntorStore, // @internal
|
|
2
2
|
type IntorProviderProps, useIntorContext, // @internal
|
|
3
3
|
useTranslator, getClientLocale, } from "../../src/client/svelte";
|
|
4
|
+
import type { IntorProviderProps } from "../../src/client/svelte";
|
|
5
|
+
import type { Component } from "svelte";
|
|
6
|
+
export declare const IntorProvider: Component<IntorProviderProps>;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { IntorResolvedConfig } from "../../../config";
|
|
2
2
|
import type { MessagesReaders, RuntimeFetch } from "../../../core";
|
|
3
|
-
import type { Locale } from "intor-translator";
|
|
4
|
-
import { type
|
|
5
|
-
|
|
3
|
+
import type { Locale, LocaleMessages } from "intor-translator";
|
|
4
|
+
import { type IntorValue as IntorValueCore } from "../../../server";
|
|
5
|
+
interface IntorValue extends Pick<IntorValueCore, "config"> {
|
|
6
|
+
locale: Locale;
|
|
7
|
+
messages: Readonly<LocaleMessages>;
|
|
8
|
+
}
|
|
6
9
|
/**
|
|
7
10
|
* Initializes Intor for the current execution context.
|
|
8
11
|
*
|
|
@@ -10,7 +13,8 @@ import { type IntorValue } from "../../../server";
|
|
|
10
13
|
* - Permits cache writes during server execution.
|
|
11
14
|
* @platform SvelteKit
|
|
12
15
|
*/
|
|
13
|
-
export declare function intor
|
|
16
|
+
export declare function intor(config: IntorResolvedConfig, locale: Locale, fetch: RuntimeFetch, options?: {
|
|
14
17
|
readers?: MessagesReaders;
|
|
15
18
|
allowCacheWrite?: boolean;
|
|
16
|
-
}): Promise<IntorValue
|
|
19
|
+
}): Promise<IntorValue>;
|
|
20
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { createIntorStore, type IntorProviderProps, useIntorContext, } from "./provider";
|
|
1
|
+
export { createIntorStore, IntorProvider, type IntorProviderProps, useIntorContext, } from "./provider";
|
|
2
2
|
export { useTranslator } from "./translator";
|
|
3
3
|
export { getClientLocale } from "../shared/helpers";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intor",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.4",
|
|
4
4
|
"description": "The i18n library for modern JavaScript",
|
|
5
5
|
"author": "Yiming Liao",
|
|
6
6
|
"homepage": "https://github.com/yiming-liao/intor#readme",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"types": "./dist/types/export/svelte/index.d.ts"
|
|
63
63
|
},
|
|
64
64
|
"./svelte/provider": {
|
|
65
|
-
"import": "./dist/svelte/src/client/svelte/provider",
|
|
66
|
-
"types": "./dist/types/
|
|
65
|
+
"import": "./dist/svelte/src/client/svelte/provider/intor-provider.svelte",
|
|
66
|
+
"types": "./dist/types/src/client/svelte/provider/intor-provider.d.ts"
|
|
67
67
|
},
|
|
68
68
|
"./next": {
|
|
69
69
|
"import": "./dist/next/export/next/index.js",
|