lit-intlayer 8.4.10 → 8.5.0
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/client/IntlayerBinding.cjs +1 -0
- package/dist/cjs/client/index.cjs +1 -1
- package/dist/cjs/client/installIntlayer.cjs +1 -1
- package/dist/cjs/client/useDictionary.cjs +1 -1
- package/dist/cjs/client/useDictionaryDynamic.cjs +1 -0
- package/dist/cjs/client/useIntlayer.cjs +1 -1
- package/dist/cjs/client/useLocale.cjs +1 -1
- package/dist/cjs/client/useRewriteURL.cjs +1 -1
- package/dist/cjs/editor/useEditor.cjs +1 -1
- package/dist/cjs/format/useIntl.cjs +1 -1
- package/dist/cjs/html/HTMLRenderer.cjs +1 -1
- package/dist/cjs/html/index.cjs +1 -1
- package/dist/cjs/html/installIntlayerHTML.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/markdown/MarkdownRenderer.cjs +1 -1
- package/dist/cjs/markdown/index.cjs +1 -1
- package/dist/cjs/markdown/installIntlayerMarkdown.cjs +1 -1
- package/dist/cjs/markdown/runtime.cjs +1 -1
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/cjs/renderIntlayerNode.cjs +1 -1
- package/dist/esm/client/IntlayerBinding.mjs +21 -0
- package/dist/esm/client/index.mjs +9 -7
- package/dist/esm/client/installIntlayer.mjs +2 -25
- package/dist/esm/client/useDictionary.mjs +15 -39
- package/dist/esm/client/useDictionaryDynamic.mjs +47 -0
- package/dist/esm/client/useIntlayer.mjs +13 -40
- package/dist/esm/client/useLocale.mjs +1 -1
- package/dist/esm/client/useRewriteURL.mjs +1 -1
- package/dist/esm/editor/useEditor.mjs +2 -33
- package/dist/esm/format/useIntl.mjs +1 -1
- package/dist/esm/html/HTMLRenderer.mjs +4 -4
- package/dist/esm/html/index.mjs +3 -3
- package/dist/esm/html/installIntlayerHTML.mjs +2 -2
- package/dist/esm/index.mjs +10 -17
- package/dist/esm/markdown/MarkdownRenderer.mjs +5 -5
- package/dist/esm/markdown/index.mjs +4 -5
- package/dist/esm/markdown/installIntlayerMarkdown.mjs +2 -2
- package/dist/esm/markdown/runtime.mjs +1 -1
- package/dist/esm/plugins.mjs +66 -57
- package/dist/esm/renderIntlayerNode.mjs +1 -0
- package/dist/installIntlayer-3Fpy-rFd.mjs +71 -0
- package/dist/installIntlayer-CkFmSJJA.js +1 -0
- package/dist/types/client/IntlayerBinding.d.ts +40 -0
- package/dist/types/{src/client → client}/index.d.ts +2 -0
- package/dist/types/{src/client → client}/installIntlayer.d.ts +17 -1
- package/dist/types/client/useDictionary.d.ts +31 -0
- package/dist/types/client/useDictionaryDynamic.d.ts +36 -0
- package/dist/types/client/useIntlayer.d.ts +22 -0
- package/dist/types/editor/useEditor.d.ts +34 -0
- package/dist/types/html/index.d.ts +3 -0
- package/dist/types/{src/html → html}/installIntlayerHTML.d.ts +25 -0
- package/dist/types/{src/index.d.ts → index.d.ts} +0 -2
- package/dist/types/markdown/index.d.ts +3 -0
- package/dist/types/{src/markdown → markdown}/installIntlayerMarkdown.d.ts +25 -1
- package/dist/types/{src/plugins.d.ts → plugins.d.ts} +7 -5
- package/package.json +22 -14
- package/dist/types/src/client/useDictionary.d.ts +0 -30
- package/dist/types/src/client/useIntlayer.d.ts +0 -29
- package/dist/types/src/editor/useEditor.d.ts +0 -22
- package/dist/types/src/html/index.d.ts +0 -3
- package/dist/types/src/markdown/index.d.ts +0 -4
- /package/dist/types/{src/client → client}/useLocale.d.ts +0 -0
- /package/dist/types/{src/client → client}/useLocaleStorage.d.ts +0 -0
- /package/dist/types/{src/client → client}/useRewriteURL.d.ts +0 -0
- /package/dist/types/{src/format → format}/index.d.ts +0 -0
- /package/dist/types/{src/format → format}/useIntl.d.ts +0 -0
- /package/dist/types/{src/getDictionary.d.ts → getDictionary.d.ts} +0 -0
- /package/dist/types/{src/getIntlayer.d.ts → getIntlayer.d.ts} +0 -0
- /package/dist/types/{src/html → html}/HTMLRenderer.d.ts +0 -0
- /package/dist/types/{src/html → html}/types.d.ts +0 -0
- /package/dist/types/{src/markdown → markdown}/MarkdownRenderer.d.ts +0 -0
- /package/dist/types/{src/markdown → markdown}/compiler.d.ts +0 -0
- /package/dist/types/{src/markdown → markdown}/runtime.d.ts +0 -0
- /package/dist/types/{src/renderIntlayerNode.d.ts → renderIntlayerNode.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lit-intlayer",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Lit applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -38,17 +38,22 @@
|
|
|
38
38
|
"sideEffects": false,
|
|
39
39
|
"exports": {
|
|
40
40
|
".": {
|
|
41
|
-
"types": "./dist/types/
|
|
41
|
+
"types": "./dist/types/index.d.ts",
|
|
42
42
|
"require": "./dist/cjs/index.cjs",
|
|
43
43
|
"import": "./dist/esm/index.mjs"
|
|
44
44
|
},
|
|
45
|
+
"./html": {
|
|
46
|
+
"types": "./dist/types/html/index.d.ts",
|
|
47
|
+
"require": "./dist/cjs/html/index.cjs",
|
|
48
|
+
"import": "./dist/esm/html/index.mjs"
|
|
49
|
+
},
|
|
45
50
|
"./markdown": {
|
|
46
|
-
"types": "./dist/types/
|
|
51
|
+
"types": "./dist/types/markdown/index.d.ts",
|
|
47
52
|
"require": "./dist/cjs/markdown/index.cjs",
|
|
48
53
|
"import": "./dist/esm/markdown/index.mjs"
|
|
49
54
|
},
|
|
50
55
|
"./format": {
|
|
51
|
-
"types": "./dist/types/
|
|
56
|
+
"types": "./dist/types/format/index.d.ts",
|
|
52
57
|
"require": "./dist/cjs/format/index.cjs",
|
|
53
58
|
"import": "./dist/esm/format/index.mjs"
|
|
54
59
|
},
|
|
@@ -56,17 +61,20 @@
|
|
|
56
61
|
},
|
|
57
62
|
"main": "dist/cjs/index.cjs",
|
|
58
63
|
"module": "dist/esm/index.mjs",
|
|
59
|
-
"types": "dist/types/
|
|
64
|
+
"types": "dist/types/index.d.ts",
|
|
60
65
|
"typesVersions": {
|
|
61
66
|
"*": {
|
|
62
67
|
".": [
|
|
63
|
-
"./dist/types/
|
|
68
|
+
"./dist/types/index.d.ts"
|
|
69
|
+
],
|
|
70
|
+
"html": [
|
|
71
|
+
"./dist/types/html/index.d.ts"
|
|
64
72
|
],
|
|
65
73
|
"markdown": [
|
|
66
|
-
"./dist/types/
|
|
74
|
+
"./dist/types/markdown/index.d.ts"
|
|
67
75
|
],
|
|
68
76
|
"format": [
|
|
69
|
-
"./dist/types/
|
|
77
|
+
"./dist/types/format/index.d.ts"
|
|
70
78
|
],
|
|
71
79
|
"package.json": [
|
|
72
80
|
"./package.json"
|
|
@@ -95,11 +103,11 @@
|
|
|
95
103
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
96
104
|
},
|
|
97
105
|
"dependencies": {
|
|
98
|
-
"@intlayer/api": "8.
|
|
99
|
-
"@intlayer/config": "8.
|
|
100
|
-
"@intlayer/core": "8.
|
|
101
|
-
"@intlayer/editor": "8.
|
|
102
|
-
"@intlayer/types": "8.
|
|
106
|
+
"@intlayer/api": "8.5.0",
|
|
107
|
+
"@intlayer/config": "8.5.0",
|
|
108
|
+
"@intlayer/core": "8.5.0",
|
|
109
|
+
"@intlayer/editor": "8.5.0",
|
|
110
|
+
"@intlayer/types": "8.5.0"
|
|
103
111
|
},
|
|
104
112
|
"devDependencies": {
|
|
105
113
|
"@types/node": "25.5.0",
|
|
@@ -115,7 +123,7 @@
|
|
|
115
123
|
"vitest": "4.1.1"
|
|
116
124
|
},
|
|
117
125
|
"peerDependencies": {
|
|
118
|
-
"intlayer": "8.
|
|
126
|
+
"intlayer": "8.5.0",
|
|
119
127
|
"lit": ">=3.0.0"
|
|
120
128
|
},
|
|
121
129
|
"peerDependenciesMeta": {
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Dictionary } from '@intlayer/types/dictionary';
|
|
2
|
-
import { DeclaredLocales, LocalesValues } from '@intlayer/types/module_augmentation';
|
|
3
|
-
import { ReactiveControllerHost } from 'lit';
|
|
4
|
-
import { DeepTransformContent } from '../plugins';
|
|
5
|
-
/**
|
|
6
|
-
* Reactive hook that returns the translated content for a raw dictionary object.
|
|
7
|
-
*
|
|
8
|
-
* Unlike `useIntlayer` (which takes a registered key), this hook accepts a
|
|
9
|
-
* dictionary object directly — useful for dictionaries loaded asynchronously
|
|
10
|
-
* or defined inline.
|
|
11
|
-
*
|
|
12
|
-
* @param host - The LitElement (or any ReactiveControllerHost).
|
|
13
|
-
* @param dictionary - The raw dictionary object.
|
|
14
|
-
* @param locale - Optional locale override.
|
|
15
|
-
* @returns A reactive proxy to the dictionary content.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```ts
|
|
19
|
-
* import myDict from './myDictionary.content';
|
|
20
|
-
*
|
|
21
|
-
* class MyElement extends LitElement {
|
|
22
|
-
* private content = useDictionary(this, myDict);
|
|
23
|
-
*
|
|
24
|
-
* render() {
|
|
25
|
-
* return html`<p>${this.content.greeting.value}</p>`;
|
|
26
|
-
* }
|
|
27
|
-
* }
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
export declare const useDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(host: ReactiveControllerHost, dictionary: T, locale?: L) => DeepTransformContent<T["content"], L>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { DictionaryKeys, DictionaryRegistryContent, LocalesValues } from '@intlayer/types/module_augmentation';
|
|
2
|
-
import { ReactiveControllerHost } from 'lit';
|
|
3
|
-
import { DeepTransformContent } from '../plugins';
|
|
4
|
-
/**
|
|
5
|
-
* Reactive hook that returns the translated dictionary for the given key.
|
|
6
|
-
*
|
|
7
|
-
* Works as a Lit ReactiveController: the host element automatically
|
|
8
|
-
* re-renders whenever the locale changes.
|
|
9
|
-
*
|
|
10
|
-
* The returned value is a transparent proxy of the dictionary content.
|
|
11
|
-
* Access fields directly without an extra `.value` wrapper.
|
|
12
|
-
*
|
|
13
|
-
* @param host - The LitElement (or any ReactiveControllerHost) that owns this hook.
|
|
14
|
-
* @param key - The dictionary key registered in your intlayer content files.
|
|
15
|
-
* @param locale - Optional locale override (defaults to the current app locale).
|
|
16
|
-
* @returns A reactive proxy to the dictionary content.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```ts
|
|
20
|
-
* class MyElement extends LitElement {
|
|
21
|
-
* private content = useIntlayer(this, 'my-component');
|
|
22
|
-
*
|
|
23
|
-
* render() {
|
|
24
|
-
* return html`<h1>${this.content.title.value}</h1>`;
|
|
25
|
-
* }
|
|
26
|
-
* }
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export declare const useIntlayer: <T extends DictionaryKeys>(host: ReactiveControllerHost, key: T, locale?: LocalesValues) => DeepTransformContent<DictionaryRegistryContent<T>>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ReactiveControllerHost } from 'lit';
|
|
2
|
-
/**
|
|
3
|
-
* Initialises the Intlayer visual editor client on the given host element.
|
|
4
|
-
*
|
|
5
|
-
* Does nothing when `INTLAYER_EDITOR_ENABLED` is `"false"` or the editor
|
|
6
|
-
* package reports that it is disabled.
|
|
7
|
-
*
|
|
8
|
-
* Call this once, typically from your root/shell element.
|
|
9
|
-
*
|
|
10
|
-
* @param host - The LitElement (or any ReactiveControllerHost).
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* class AppShell extends LitElement {
|
|
15
|
-
* constructor() {
|
|
16
|
-
* super();
|
|
17
|
-
* useEditor(this);
|
|
18
|
-
* }
|
|
19
|
-
* }
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export declare const useEditor: (host: ReactiveControllerHost) => void;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|