angular-intlayer 9.5.9 → 9.5.11
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/intlayerToken.cjs +3 -1
- package/dist/cjs/client/intlayerToken.cjs.map +1 -1
- package/dist/cjs/client/useLocale.cjs +1 -1
- package/dist/cjs/client/useLocaleStorage.cjs +10 -2
- package/dist/cjs/client/useLocaleStorage.cjs.map +1 -1
- package/dist/cjs/esbuild/plugin.cjs +3 -3
- package/dist/cjs/plugins.cjs +63 -69
- package/dist/cjs/plugins.cjs.map +1 -1
- package/dist/cjs/renderIntlayerNode.cjs +17 -36
- package/dist/cjs/renderIntlayerNode.cjs.map +1 -1
- package/dist/cjs/webpack/mergeConfig.cjs +1 -1
- package/dist/esm/client/intlayerToken.mjs +3 -1
- package/dist/esm/client/intlayerToken.mjs.map +1 -1
- package/dist/esm/client/useLocale.mjs +1 -1
- package/dist/esm/client/useLocaleStorage.mjs +11 -4
- package/dist/esm/client/useLocaleStorage.mjs.map +1 -1
- package/dist/esm/plugins.mjs +63 -69
- package/dist/esm/plugins.mjs.map +1 -1
- package/dist/esm/renderIntlayerNode.mjs +17 -36
- package/dist/esm/renderIntlayerNode.mjs.map +1 -1
- package/dist/types/client/intlayerToken.d.ts.map +1 -1
- package/dist/types/client/useLocaleStorage.d.ts +12 -6
- package/dist/types/client/useLocaleStorage.d.ts.map +1 -1
- package/dist/types/format/useCompact.d.ts +1 -2
- package/dist/types/format/useCompact.d.ts.map +1 -1
- package/dist/types/format/useCurrency.d.ts +1 -2
- package/dist/types/format/useCurrency.d.ts.map +1 -1
- package/dist/types/format/useDate.d.ts +1 -2
- package/dist/types/format/useDate.d.ts.map +1 -1
- package/dist/types/format/useList.d.ts +1 -2
- package/dist/types/format/useList.d.ts.map +1 -1
- package/dist/types/format/useNumber.d.ts +1 -2
- package/dist/types/format/useNumber.d.ts.map +1 -1
- package/dist/types/format/usePercentage.d.ts +1 -2
- package/dist/types/format/usePercentage.d.ts.map +1 -1
- package/dist/types/format/useRelativeTime.d.ts +1 -2
- package/dist/types/format/useRelativeTime.d.ts.map +1 -1
- package/dist/types/format/useUnit.d.ts +1 -2
- package/dist/types/format/useUnit.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/plugins.d.ts +2 -5
- package/dist/types/plugins.d.ts.map +1 -1
- package/dist/types/renderIntlayerNode.d.ts +22 -2
- package/dist/types/renderIntlayerNode.d.ts.map +1 -1
- package/package.json +10 -10
- package/dist/types/intlayer/dist/types/index.d.ts +0 -14
package/dist/types/plugins.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IntlayerNode } from "./renderIntlayerNode.js";
|
|
1
2
|
import { DeclaredLocales, LocalesValues } from "@intlayer/types/module_augmentation";
|
|
2
3
|
import { DeepTransformContent as DeepTransformContent$1, IInterpreterPluginState as IInterpreterPluginState$1, Plugins } from "@intlayer/core/interpreter";
|
|
3
4
|
import * as NodeTypes from "@intlayer/types/nodeType";
|
|
@@ -7,11 +8,6 @@ import { NodeType } from "@intlayer/types/nodeType";
|
|
|
7
8
|
* INTLAYER NODE PLUGIN
|
|
8
9
|
* --------------------------------------------- */
|
|
9
10
|
export type IntlayerNodeCond<T> = T extends number | string ? IntlayerNode<T> : never;
|
|
10
|
-
export interface IntlayerNode<T, P = {}> {
|
|
11
|
-
value: T;
|
|
12
|
-
children?: any;
|
|
13
|
-
additionalProps?: P;
|
|
14
|
-
}
|
|
15
11
|
/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */
|
|
16
12
|
export declare const intlayerNodePlugins: Plugins;
|
|
17
13
|
/**
|
|
@@ -85,4 +81,5 @@ export type DeepTransformContent<T, L extends LocalesValues = DeclaredLocales> =
|
|
|
85
81
|
*/
|
|
86
82
|
export declare const getPlugins: (locale?: LocalesValues, fallback?: boolean) => Plugins[];
|
|
87
83
|
//#endregion
|
|
84
|
+
export type { IntlayerNode };
|
|
88
85
|
//# sourceMappingURL=plugins.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","names":[],"sources":["../../src/plugins.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","names":[],"sources":["../../src/plugins.ts"],"mappings":";;;;;;;;;YAkHY,iBAAiB,KAAK,4BAC9B,aAAa;;qBAMJ,qBAAqB;;;;YAsCtB,mBAAmB,KAAK,mBAChC;EAAuB,UAAU;;;qBAIxB,sBAAsB;YA0EvB,aAAa,GAAG,IAAI,WAAW,iBAAiB;EAC1D,UAAU;GACT,UAAU,iBAAiB;EAC5B,aAAa;EACb,iBAAiB;IAEf,aACE;EAEE,MAAM,aAAa,aAAa;EAChC,UAAU,qBAAqB;;qBAK1B,gBAAgB;;;;;;;;;;YAoCjB,eAAe,GAAG,IAAI,MAAM;EACtC,UAAU;GACT,UAAU,aAAa;EACxB,aAAa;IAEX,aACE;EAEE,MAAM,aAAa,aAAa;;;qBAM3B,YAAY;;;;;;;YAwDb,oBAAoB,GAAG,GAAG,UAAU,iBAAiB;EAC/D,UAAU;GACT,UAAU,kBAAkB;KAGzB,MAAM,oCACH,kCAED,uBAAyB,SAAS,GAAG;qBAGhC,iBAAiB;iBAgGb,0BAA0B,GAAG,GAAG,UAAU;EACzD,qBAAqB,iBAAiB;EACtC,iBAAiB,aAAa,GAAG,GAAG;EACpC,aAAa,eAAe,GAAG,GAAG;EAClC,kBAAkB,oBAAoB,GAAG,GAAG;;;;;;;YAQlC,0BAA0B,KACpC;EAGA;EACA;EACA;EACA;;YAGU,qBACV,GACA,UAAU,gBAAgB,mBACxB,uBAAyB,GAAG,yBAAyB;;;;;qBAQ5C,aAAU,SACZ,eAAa,uBAErB"}
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { ResolvedEditor } from "@intlayer/types/module_augmentation";
|
|
2
2
|
//#region src/renderIntlayerNode.d.ts
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Content node returned by `useIntlayer`.
|
|
5
|
+
*
|
|
6
|
+
* Without the editor it is typed as its value (`"Hello" & { value: "Hello" }`)
|
|
7
|
+
* so it can be bound straight to string inputs and attributes. With the
|
|
8
|
+
* editor, it must be rendered through `<intlayer-node>`, so string bindings
|
|
9
|
+
* must use `.value`.
|
|
10
|
+
*/
|
|
11
|
+
export type IntlayerNode<T = string, AdditionalProps = unknown> = ResolvedEditor<T & {
|
|
4
12
|
value: T;
|
|
5
|
-
} & AdditionalProps &
|
|
13
|
+
} & AdditionalProps, IntlayerNodeRenderer & {
|
|
14
|
+
value: T;
|
|
15
|
+
} & AdditionalProps>;
|
|
16
|
+
/** Renderer the node is built on, consumed by `<intlayer-node>`. */
|
|
17
|
+
type IntlayerNodeRenderer = () => unknown;
|
|
6
18
|
type RenderIntlayerNodeProps<T> = {
|
|
7
19
|
value: T;
|
|
8
20
|
children: any;
|
|
@@ -10,6 +22,14 @@ type RenderIntlayerNodeProps<T> = {
|
|
|
10
22
|
[key: string]: any;
|
|
11
23
|
};
|
|
12
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Builds a node that renders its content and also behaves like its value
|
|
27
|
+
* (`node.value`, `${node}`, `node.toUpperCase()`), through a shared prototype
|
|
28
|
+
* rather than a Proxy.
|
|
29
|
+
*
|
|
30
|
+
* @param props - The value, the rendered content and extra node members.
|
|
31
|
+
* @returns The node.
|
|
32
|
+
*/
|
|
13
33
|
export declare const renderIntlayerNode: <T>({ children, value, additionalProps }: RenderIntlayerNodeProps<T>) => IntlayerNode<T>;
|
|
14
34
|
//#endregion
|
|
15
35
|
//# sourceMappingURL=renderIntlayerNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderIntlayerNode.d.ts","names":[],"sources":["../../src/renderIntlayerNode.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"renderIntlayerNode.d.ts","names":[],"sources":["../../src/renderIntlayerNode.ts"],"mappings":";;;;;;;;;;YAWY,aACV,YACA,6BACE,eACF;EAAM,OAAO;IAAM,iBACnB;EAAyB,OAAO;IAAM;;KAInC;KAEA,wBAAwB;EAC3B,OAAO;EACP;EACA;KAAqB;;;;;;;;;;;qBAWV,qBACX,KAAC,UAAA,OAAA,mBAKA,wBAAwB,OAAK,aAAa"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-intlayer",
|
|
3
|
-
"version": "9.5.
|
|
3
|
+
"version": "9.5.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Angular applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -120,13 +120,13 @@
|
|
|
120
120
|
"@babel/core": "^8.0.1",
|
|
121
121
|
"@babel/plugin-syntax-import-attributes": "7.29.7",
|
|
122
122
|
"@babel/preset-env": "8.0.2",
|
|
123
|
-
"@intlayer/config": "9.5.
|
|
124
|
-
"@intlayer/core": "9.5.
|
|
125
|
-
"@intlayer/dictionaries-entry": "9.5.
|
|
126
|
-
"@intlayer/editor": "9.5.
|
|
127
|
-
"@intlayer/engine": "9.5.
|
|
128
|
-
"@intlayer/types": "9.5.
|
|
129
|
-
"@intlayer/webpack": "9.5.
|
|
123
|
+
"@intlayer/config": "9.5.11",
|
|
124
|
+
"@intlayer/core": "9.5.11",
|
|
125
|
+
"@intlayer/dictionaries-entry": "9.5.11",
|
|
126
|
+
"@intlayer/editor": "9.5.11",
|
|
127
|
+
"@intlayer/engine": "9.5.11",
|
|
128
|
+
"@intlayer/types": "9.5.11",
|
|
129
|
+
"@intlayer/webpack": "9.5.11",
|
|
130
130
|
"babel-loader": "10.1.1",
|
|
131
131
|
"defu": "6.1.7"
|
|
132
132
|
},
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"rimraf": "6.1.3",
|
|
143
143
|
"tsdown": "0.23.0",
|
|
144
144
|
"typescript": "7.0.2",
|
|
145
|
-
"vitest": "5.0.
|
|
145
|
+
"vitest": "5.0.2"
|
|
146
146
|
},
|
|
147
147
|
"peerDependencies": {
|
|
148
148
|
"@angular/common": ">=15",
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
}
|
|
157
157
|
},
|
|
158
158
|
"optionalDependencies": {
|
|
159
|
-
"@intlayer/analytics": "9.5.
|
|
159
|
+
"@intlayer/analytics": "9.5.11"
|
|
160
160
|
},
|
|
161
161
|
"engines": {
|
|
162
162
|
"node": ">=14.18"
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { DeclaredLocales, LocalesValues as LocalesValues$1 } from "@intlayer/types/module_augmentation";
|
|
2
|
-
import { Dictionary } from "@intlayer/types/dictionary";
|
|
3
|
-
import "@intlayer/core/interpreter";
|
|
4
|
-
import "@intlayer/types/config";
|
|
5
|
-
import { Locale } from "@intlayer/types/allLocales";
|
|
6
|
-
import "@intlayer/types/locales";
|
|
7
|
-
import "@intlayer/config/built";
|
|
8
|
-
import "@intlayer/core/file";
|
|
9
|
-
import "@intlayer/core/formatters";
|
|
10
|
-
import "@intlayer/core/localization";
|
|
11
|
-
import "@intlayer/core/markdown";
|
|
12
|
-
import "@intlayer/core/transpiler";
|
|
13
|
-
import "@intlayer/core/utils";
|
|
14
|
-
export type { Locale, LocalesValues$1 as LocalesValues };
|