@effect-app/vue-components 4.0.0-beta.100 → 4.0.0-beta.101
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type makeIntl } from "@effect-app/vue";
|
|
2
|
-
import { S } from "effect-app";
|
|
2
|
+
import type { S } from "effect-app";
|
|
3
3
|
import { type InjectionKey } from "vue";
|
|
4
4
|
export declare const useIntlKey: InjectionKey<ReturnType<typeof makeIntl>["useIntl"]>;
|
|
5
5
|
export declare const useIntl: () => {
|
|
@@ -10,10 +10,10 @@ export declare const useIntl: () => {
|
|
|
10
10
|
};
|
|
11
11
|
export declare const provideIntl: (intl: ReturnType<typeof makeIntl>["useIntl"]) => void;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
13
|
+
* Walks the encoding chain of the given AST node to its source (encoded)
|
|
14
|
+
* side. Shallow — does not recurse into children, so inner prop-level
|
|
15
|
+
* transformations (e.g. `FiniteFromString`) keep their decoded shape
|
|
16
|
+
* while struct-level `decodeTo` transformations are unwrapped to their
|
|
17
|
+
* input side (e.g. `NonNegativeInt` rather than the decoded `PositiveInt`).
|
|
18
18
|
*/
|
|
19
19
|
export declare function getTransformationFrom(ast: S.AST.AST): S.AST.AST;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { inject as e, provide as t } from "vue";
|
|
2
|
-
import { S as n } from "effect-app";
|
|
3
2
|
//#region src/utils/index.ts
|
|
4
|
-
var
|
|
5
|
-
let t = e(
|
|
3
|
+
var n = Symbol(), r = () => {
|
|
4
|
+
let t = e(n);
|
|
6
5
|
if (!t) throw Error("useIntl must be used within a IntlProvider");
|
|
7
6
|
return t();
|
|
8
|
-
},
|
|
9
|
-
function
|
|
10
|
-
|
|
7
|
+
}, i = (e) => t(n, e);
|
|
8
|
+
function a(e) {
|
|
9
|
+
for (; e.encoding;) e = e.encoding[0].to;
|
|
10
|
+
return e;
|
|
11
11
|
}
|
|
12
12
|
//#endregion
|
|
13
|
-
export {
|
|
13
|
+
export { a as getTransformationFrom, i as provideIntl, r as useIntl, n as useIntlKey };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-app/vue-components",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.101",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@mdi/js": "^7.4.47",
|
|
6
6
|
"effect": "^4.0.0-beta.47",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"highlight.js": "^11.11.1",
|
|
59
59
|
"mitt": "^3.0.1",
|
|
60
60
|
"vue3-highlightjs": "^1.0.5",
|
|
61
|
-
"@effect-app/vue": "4.0.0-beta.
|
|
62
|
-
"effect-app": "4.0.0-beta.
|
|
61
|
+
"@effect-app/vue": "4.0.0-beta.101",
|
|
62
|
+
"effect-app": "4.0.0-beta.101"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"check": "vue-tsc",
|
package/src/utils/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type makeIntl } from "@effect-app/vue"
|
|
2
|
-
import { S } from "effect-app"
|
|
2
|
+
import type { S } from "effect-app"
|
|
3
3
|
import { inject, type InjectionKey, provide } from "vue"
|
|
4
4
|
|
|
5
5
|
export const useIntlKey = Symbol() as InjectionKey<
|
|
@@ -17,12 +17,15 @@ export const provideIntl = (
|
|
|
17
17
|
) => provide(useIntlKey, intl)
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
20
|
+
* Walks the encoding chain of the given AST node to its source (encoded)
|
|
21
|
+
* side. Shallow — does not recurse into children, so inner prop-level
|
|
22
|
+
* transformations (e.g. `FiniteFromString`) keep their decoded shape
|
|
23
|
+
* while struct-level `decodeTo` transformations are unwrapped to their
|
|
24
|
+
* input side (e.g. `NonNegativeInt` rather than the decoded `PositiveInt`).
|
|
25
25
|
*/
|
|
26
26
|
export function getTransformationFrom(ast: S.AST.AST) {
|
|
27
|
-
|
|
27
|
+
while (ast.encoding) {
|
|
28
|
+
ast = ast.encoding[0].to
|
|
29
|
+
}
|
|
30
|
+
return ast
|
|
28
31
|
}
|