svelte-intlayer 5.7.6 → 5.7.8
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 +3 -0
- package/dist/cjs/client/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/client/index.mjs +11 -13
- package/dist/esm/index.mjs +22 -24
- package/dist/types/client/index.d.ts +0 -1
- package/dist/types/client/index.d.ts.map +1 -1
- package/package.json +10 -10
- package/dist/cjs/client/useIntlayerAsync.cjs +0 -1
- package/dist/esm/client/useIntlayerAsync.mjs +0 -23
- package/dist/types/client/useIntlayerAsync.d.ts +0 -13
- package/dist/types/client/useIntlayerAsync.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -27,6 +27,9 @@
|
|
|
27
27
|
<div>
|
|
28
28
|
<br/>
|
|
29
29
|
<p align="center">
|
|
30
|
+
<a href="https://discord.gg/528mBV4N" target="blank"><img align="center"
|
|
31
|
+
src="https://img.shields.io/badge/discord-5865F2.svg?style=for-the-badge&logo=discord&logoColor=white"
|
|
32
|
+
alt="Intlayer Discord" height="30"/></a>
|
|
30
33
|
<a href="https://www.linkedin.com/company/intlayerorg" target="blank"><img align="center"
|
|
31
34
|
src="https://img.shields.io/badge/linkedin-%231DA1F2.svg?style=for-the-badge&logo=linkedin&logoColor=white"
|
|
32
35
|
alt="Intlayer LinkedIn" height="30"/></a>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./useDictionary.cjs"),n=require("./useDictionaryAsync.cjs"),r=require("./useDictionaryDynamic.cjs"),i=require("./useIntlayer.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./useDictionary.cjs"),n=require("./useDictionaryAsync.cjs"),r=require("./useDictionaryDynamic.cjs"),i=require("./useIntlayer.cjs"),e=require("./intlayerContext.cjs"),c=require("./intlayerStore.cjs"),o=require("./getBrowserLocale.cjs"),s=require("./useLocale.cjs");exports.useDictionary=t.useDictionary;exports.useDictionaryAsync=n.useDictionaryAsync;exports.useDictionaryDynamic=r.useDictionaryDynamic;exports.useIntlayer=i.useIntlayer;exports.getIntlayerContext=e.getIntlayerContext;exports.setIntlayerContext=e.setIntlayerContext;exports.intlayerStore=c.intlayerStore;exports.getBrowserLocale=o.getBrowserLocale;exports.useLocale=s.useLocale;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./client/useDictionary.cjs"),i=require("./client/useDictionaryAsync.cjs"),o=require("./client/useDictionaryDynamic.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./client/useDictionary.cjs"),i=require("./client/useDictionaryAsync.cjs"),o=require("./client/useDictionaryDynamic.cjs"),a=require("./client/useIntlayer.cjs"),t=require("./client/intlayerContext.cjs"),c=require("./client/intlayerStore.cjs"),s=require("./client/getBrowserLocale.cjs"),l=require("./client/useLocale.cjs"),u=require("./getDictionary.cjs"),y=require("./getIntlayer.cjs"),n=require("./markdown/index.cjs"),e=require("./plugins.cjs");exports.useDictionary=r.useDictionary;exports.useDictionaryAsync=i.useDictionaryAsync;exports.useDictionaryDynamic=o.useDictionaryDynamic;exports.useIntlayer=a.useIntlayer;exports.getIntlayerContext=t.getIntlayerContext;exports.setIntlayerContext=t.setIntlayerContext;exports.intlayerStore=c.intlayerStore;exports.getBrowserLocale=s.getBrowserLocale;exports.useLocale=l.useLocale;exports.getDictionary=u.getDictionary;exports.getIntlayer=y.getIntlayer;exports.defaultMarkdownRenderer=n.defaultMarkdownRenderer;exports.processMarkdown=n.processMarkdown;exports.intlayerNodePlugins=e.intlayerNodePlugins;exports.markdownPlugin=e.markdownPlugin;exports.svelteNodePlugins=e.svelteNodePlugins;
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { useDictionary as o } from "./useDictionary.mjs";
|
|
2
2
|
import { useDictionaryAsync as n } from "./useDictionaryAsync.mjs";
|
|
3
3
|
import { useDictionaryDynamic as x } from "./useDictionaryDynamic.mjs";
|
|
4
|
-
import { useIntlayer as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { useLocale as A } from "./useLocale.mjs";
|
|
4
|
+
import { useIntlayer as y } from "./useIntlayer.mjs";
|
|
5
|
+
import { getIntlayerContext as i, setIntlayerContext as p } from "./intlayerContext.mjs";
|
|
6
|
+
import { intlayerStore as c } from "./intlayerStore.mjs";
|
|
7
|
+
import { getBrowserLocale as u } from "./getBrowserLocale.mjs";
|
|
8
|
+
import { useLocale as I } from "./useLocale.mjs";
|
|
10
9
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
u as getBrowserLocale,
|
|
11
|
+
i as getIntlayerContext,
|
|
12
|
+
c as intlayerStore,
|
|
13
|
+
p as setIntlayerContext,
|
|
15
14
|
o as useDictionary,
|
|
16
15
|
n as useDictionaryAsync,
|
|
17
16
|
x as useDictionaryDynamic,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
A as useLocale
|
|
17
|
+
y as useIntlayer,
|
|
18
|
+
I as useLocale
|
|
21
19
|
};
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
import { useDictionary as o } from "./client/useDictionary.mjs";
|
|
2
2
|
import { useDictionaryAsync as n } from "./client/useDictionaryAsync.mjs";
|
|
3
|
-
import { useDictionaryDynamic as
|
|
3
|
+
import { useDictionaryDynamic as i } from "./client/useDictionaryDynamic.mjs";
|
|
4
4
|
import { useIntlayer as x } from "./client/useIntlayer.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { intlayerNodePlugins as v, markdownPlugin as B, svelteNodePlugins as R } from "./plugins.mjs";
|
|
5
|
+
import { getIntlayerContext as l, setIntlayerContext as p } from "./client/intlayerContext.mjs";
|
|
6
|
+
import { intlayerStore as y } from "./client/intlayerStore.mjs";
|
|
7
|
+
import { getBrowserLocale as u } from "./client/getBrowserLocale.mjs";
|
|
8
|
+
import { useLocale as g } from "./client/useLocale.mjs";
|
|
9
|
+
import { getDictionary as w } from "./getDictionary.mjs";
|
|
10
|
+
import { getIntlayer as k } from "./getIntlayer.mjs";
|
|
11
|
+
import { defaultMarkdownRenderer as C, processMarkdown as L } from "./markdown/index.mjs";
|
|
12
|
+
import { intlayerNodePlugins as N, markdownPlugin as v, svelteNodePlugins as A } from "./plugins.mjs";
|
|
14
13
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
C as defaultMarkdownRenderer,
|
|
15
|
+
u as getBrowserLocale,
|
|
16
|
+
w as getDictionary,
|
|
17
|
+
k as getIntlayer,
|
|
18
|
+
l as getIntlayerContext,
|
|
19
|
+
N as intlayerNodePlugins,
|
|
20
|
+
y as intlayerStore,
|
|
21
|
+
v as markdownPlugin,
|
|
22
|
+
L as processMarkdown,
|
|
23
|
+
p as setIntlayerContext,
|
|
24
|
+
A as svelteNodePlugins,
|
|
26
25
|
o as useDictionary,
|
|
27
26
|
n as useDictionaryAsync,
|
|
28
|
-
|
|
27
|
+
i as useDictionaryDynamic,
|
|
29
28
|
x as useIntlayer,
|
|
30
|
-
|
|
31
|
-
I as useLocale
|
|
29
|
+
g as useLocale
|
|
32
30
|
};
|
|
@@ -2,7 +2,6 @@ export { useDictionary } from './useDictionary';
|
|
|
2
2
|
export { useDictionaryAsync } from './useDictionaryAsync';
|
|
3
3
|
export { useDictionaryDynamic } from './useDictionaryDynamic';
|
|
4
4
|
export { useIntlayer } from './useIntlayer';
|
|
5
|
-
export { useIntlayerAsync } from './useIntlayerAsync';
|
|
6
5
|
export { getIntlayerContext, setIntlayerContext } from './intlayerContext';
|
|
7
6
|
export { intlayerStore } from './intlayerStore';
|
|
8
7
|
export { getBrowserLocale } from './getBrowserLocale';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-intlayer",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Svelte applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
],
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"js-cookie": "^3.0.5",
|
|
61
|
-
"@intlayer/
|
|
62
|
-
"@intlayer/editor": "5.7.
|
|
63
|
-
"@intlayer/
|
|
64
|
-
"@intlayer/core": "5.7.
|
|
61
|
+
"@intlayer/config": "5.7.8",
|
|
62
|
+
"@intlayer/editor": "5.7.8",
|
|
63
|
+
"@intlayer/api": "5.7.8",
|
|
64
|
+
"@intlayer/core": "5.7.8"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@sveltejs/vite-plugin-svelte": "^5.1.0",
|
|
@@ -76,17 +76,17 @@
|
|
|
76
76
|
"vite": "^6.3.5",
|
|
77
77
|
"vite-plugin-dts": "^4.5.3",
|
|
78
78
|
"vitest": "^3.2.2",
|
|
79
|
-
"@utils/eslint-config": "1.0.4",
|
|
80
79
|
"@utils/ts-config": "1.0.4",
|
|
80
|
+
"@utils/eslint-config": "1.0.4",
|
|
81
81
|
"@utils/ts-config-types": "1.0.4",
|
|
82
82
|
"@utils/tsup-config": "1.0.4"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"svelte": ">=5.0.0",
|
|
86
|
-
"@intlayer/config": "5.7.
|
|
87
|
-
"@intlayer/
|
|
88
|
-
"@intlayer/api": "5.7.
|
|
89
|
-
"@intlayer/
|
|
86
|
+
"@intlayer/config": "5.7.8",
|
|
87
|
+
"@intlayer/editor": "5.7.8",
|
|
88
|
+
"@intlayer/api": "5.7.8",
|
|
89
|
+
"@intlayer/core": "5.7.8"
|
|
90
90
|
},
|
|
91
91
|
"engines": {
|
|
92
92
|
"node": ">=14.18"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var y=Object.create;var l=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var I=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of d(e))!S.call(t,r)&&r!==n&&l(t,r,{get:()=>e[r],enumerable:!(o=u(e,r))||o.enumerable});return t};var b=(t,e,n)=>(n=t!=null?y(g(t)):{},I(e||!t||!t.__esModule?l(n,"default",{value:t,enumerable:!0}):n,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("svelte/store"),q=require("./intlayerContext.cjs"),w=require("./intlayerStore.cjs"),A=(t,e)=>{const n=q.getIntlayerContext(),o=a.writable(null);return a.derived([w.intlayerStore],([r])=>{const i=e??(n==null?void 0:n.locale)??r.locale;return(async()=>{try{const{getIntlayerAsync:c}=await import("@intlayer/core"),s=await c(t,i);o.set(s)}catch(c){console.error(`Failed to load async dictionary for key: ${String(t)}`,c),o.set(null)}})(),null})};exports.useIntlayerAsync=A;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { writable as i, derived as s } from "svelte/store";
|
|
2
|
-
import { getIntlayerContext as y } from "./intlayerContext.mjs";
|
|
3
|
-
import { intlayerStore as d } from "./intlayerStore.mjs";
|
|
4
|
-
const g = (r, e) => {
|
|
5
|
-
const t = y(), n = i(null);
|
|
6
|
-
return s([d], ([a]) => {
|
|
7
|
-
const c = e ?? (t == null ? void 0 : t.locale) ?? a.locale;
|
|
8
|
-
return (async () => {
|
|
9
|
-
try {
|
|
10
|
-
const { getIntlayerAsync: o } = await import("@intlayer/core"), l = await o(r, c);
|
|
11
|
-
n.set(l);
|
|
12
|
-
} catch (o) {
|
|
13
|
-
console.error(
|
|
14
|
-
`Failed to load async dictionary for key: ${String(r)}`,
|
|
15
|
-
o
|
|
16
|
-
), n.set(null);
|
|
17
|
-
}
|
|
18
|
-
})(), null;
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
g as useIntlayerAsync
|
|
23
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { LocalesValues } from '@intlayer/config/client';
|
|
2
|
-
import { DictionaryKeys } from '@intlayer/core';
|
|
3
|
-
import { Readable } from 'svelte/store';
|
|
4
|
-
import { IntlayerDictionaryTypesConnector } from 'intlayer';
|
|
5
|
-
import { DeepTransformContent } from '../plugins';
|
|
6
|
-
/**
|
|
7
|
-
* Svelte hook for asynchronous dictionary loading by key
|
|
8
|
-
* @param key The dictionary key to retrieve
|
|
9
|
-
* @param locale Target locale (optional)
|
|
10
|
-
* @returns Reactive store with loaded dictionary content
|
|
11
|
-
*/
|
|
12
|
-
export declare const useIntlayerAsync: <T extends DictionaryKeys>(key: T, locale?: LocalesValues) => Readable<DeepTransformContent<IntlayerDictionaryTypesConnector[T]["content"]> | null>;
|
|
13
|
-
//# sourceMappingURL=useIntlayerAsync.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useIntlayerAsync.d.ts","sourceRoot":"","sources":["../../../src/client/useIntlayerAsync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAIlD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,cAAc,EACvD,KAAK,CAAC,EACN,SAAS,aAAa,KACrB,QAAQ,CAAC,oBAAoB,CAC9B,gCAAgC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAC/C,GAAG,IAAI,CAgCP,CAAC"}
|