@alloy-js/core 0.3.0 → 0.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/CHANGELOG.md +20 -0
- package/dist/src/binder.d.ts +43 -18
- package/dist/src/binder.d.ts.map +1 -1
- package/dist/src/binder.js +120 -16
- package/dist/src/binder.js.map +1 -1
- package/dist/src/components/Declaration.d.ts +2 -2
- package/dist/src/components/Declaration.d.ts.map +1 -1
- package/dist/src/components/Declaration.js.map +1 -1
- package/dist/src/components/Indent.d.ts +2 -2
- package/dist/src/components/Indent.d.ts.map +1 -1
- package/dist/src/components/Indent.js.map +1 -1
- package/dist/src/components/MemberDeclaration.d.ts +2 -2
- package/dist/src/components/MemberDeclaration.d.ts.map +1 -1
- package/dist/src/components/MemberDeclaration.js.map +1 -1
- package/dist/src/components/MemberName.d.ts +1 -1
- package/dist/src/components/MemberName.d.ts.map +1 -1
- package/dist/src/components/MemberScope.d.ts +2 -2
- package/dist/src/components/MemberScope.d.ts.map +1 -1
- package/dist/src/components/Name.d.ts +1 -1
- package/dist/src/components/Name.d.ts.map +1 -1
- package/dist/src/components/Output.d.ts +2 -2
- package/dist/src/components/Output.d.ts.map +1 -1
- package/dist/src/components/Output.js +6 -2
- package/dist/src/components/Output.js.map +1 -1
- package/dist/src/components/Scope.d.ts +2 -2
- package/dist/src/components/Scope.d.ts.map +1 -1
- package/dist/src/components/Scope.js.map +1 -1
- package/dist/src/components/SourceDirectory.d.ts +3 -3
- package/dist/src/components/SourceDirectory.d.ts.map +1 -1
- package/dist/src/components/SourceDirectory.js +1 -1
- package/dist/src/components/SourceDirectory.js.map +1 -1
- package/dist/src/components/SourceFile.d.ts +3 -3
- package/dist/src/components/SourceFile.d.ts.map +1 -1
- package/dist/src/components/SourceFile.js +1 -1
- package/dist/src/components/SourceFile.js.map +1 -1
- package/dist/src/components/stc/index.d.ts +18 -18
- package/dist/src/context/assignment.d.ts.map +1 -1
- package/dist/src/context/assignment.js +2 -2
- package/dist/src/context/assignment.js.map +1 -1
- package/dist/src/context/binder.d.ts.map +1 -1
- package/dist/src/context/binder.js +2 -2
- package/dist/src/context/binder.js.map +1 -1
- package/dist/src/context/declaration.d.ts.map +1 -1
- package/dist/src/context/declaration.js +2 -2
- package/dist/src/context/declaration.js.map +1 -1
- package/dist/src/context/indent.d.ts.map +1 -1
- package/dist/src/context/indent.js +2 -2
- package/dist/src/context/indent.js.map +1 -1
- package/dist/src/context/member-declaration.d.ts +1 -0
- package/dist/src/context/member-declaration.d.ts.map +1 -1
- package/dist/src/context/member-declaration.js +5 -2
- package/dist/src/context/member-declaration.js.map +1 -1
- package/dist/src/context/member-scope.d.ts.map +1 -1
- package/dist/src/context/member-scope.js +2 -2
- package/dist/src/context/member-scope.js.map +1 -1
- package/dist/src/context/name-policy.d.ts.map +1 -1
- package/dist/src/context/name-policy.js +2 -2
- package/dist/src/context/name-policy.js.map +1 -1
- package/dist/src/context/scope.d.ts.map +1 -1
- package/dist/src/context/scope.js +2 -2
- package/dist/src/context/scope.js.map +1 -1
- package/dist/src/context/source-directory.d.ts.map +1 -1
- package/dist/src/context/source-directory.js +2 -2
- package/dist/src/context/source-directory.js.map +1 -1
- package/dist/src/context/source-file.d.ts.map +1 -1
- package/dist/src/context/source-file.js +2 -2
- package/dist/src/context/source-file.js.map +1 -1
- package/dist/src/context.d.ts +5 -2
- package/dist/src/context.d.ts.map +1 -1
- package/dist/src/context.js +11 -4
- package/dist/src/context.js.map +1 -1
- package/dist/src/debug.d.ts +14 -0
- package/dist/src/debug.d.ts.map +1 -0
- package/dist/src/debug.js +163 -0
- package/dist/src/debug.js.map +1 -0
- package/dist/src/index.d.ts +3 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/jsx-runtime.d.ts +27 -4
- package/dist/src/jsx-runtime.d.ts.map +1 -1
- package/dist/src/jsx-runtime.js +20 -7
- package/dist/src/jsx-runtime.js.map +1 -1
- package/dist/src/render.d.ts +1 -1
- package/dist/src/render.d.ts.map +1 -1
- package/dist/src/render.js +15 -13
- package/dist/src/render.js.map +1 -1
- package/dist/src/slot.d.ts +15 -0
- package/dist/src/slot.d.ts.map +1 -0
- package/dist/src/slot.js +51 -0
- package/dist/src/slot.js.map +1 -0
- package/dist/src/tap.d.ts +19 -0
- package/dist/src/tap.d.ts.map +1 -0
- package/dist/src/tap.js +39 -0
- package/dist/src/tap.js.map +1 -0
- package/dist/src/utils.d.ts +1 -6
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +1 -34
- package/dist/src/utils.js.map +1 -1
- package/dist/src/write-output.browser.d.ts +2 -0
- package/dist/src/write-output.browser.d.ts.map +1 -0
- package/dist/src/write-output.browser.js +4 -0
- package/dist/src/write-output.browser.js.map +1 -0
- package/dist/src/write-output.d.ts +7 -0
- package/dist/src/write-output.d.ts.map +1 -0
- package/dist/src/write-output.js +34 -0
- package/dist/src/write-output.js.map +1 -0
- package/dist/test/components/slot.test.d.ts +2 -0
- package/dist/test/components/slot.test.d.ts.map +1 -0
- package/dist/testing/render.d.ts +1 -1
- package/dist/testing/render.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -6
- package/src/binder.ts +214 -50
- package/src/components/Declaration.tsx +1 -1
- package/src/components/Indent.tsx +1 -1
- package/src/components/MemberDeclaration.tsx +1 -1
- package/src/components/MemberScope.tsx +1 -1
- package/src/components/Output.tsx +4 -2
- package/src/components/Scope.tsx +1 -1
- package/src/components/SourceDirectory.tsx +2 -2
- package/src/components/SourceFile.tsx +2 -6
- package/src/context/assignment.ts +6 -2
- package/src/context/binder.ts +7 -2
- package/src/context/declaration.ts +2 -2
- package/src/context/indent.ts +13 -6
- package/src/context/member-declaration.ts +10 -2
- package/src/context/member-scope.ts +6 -2
- package/src/context/name-policy.ts +6 -2
- package/src/context/scope.ts +7 -2
- package/src/context/source-directory.ts +2 -2
- package/src/context/source-file.ts +2 -2
- package/src/context.ts +15 -4
- package/src/debug.ts +209 -0
- package/src/index.ts +3 -1
- package/src/jsx-runtime.ts +46 -11
- package/src/render.ts +21 -19
- package/src/slot.ts +90 -0
- package/src/tap.ts +69 -0
- package/src/utils.ts +2 -34
- package/src/write-output.browser.ts +3 -0
- package/src/write-output.ts +33 -0
- package/temp/api.json +1848 -203
- package/test/components/slot.test.tsx +172 -0
- package/test/rendering/basic.test.tsx +1 -1
- package/test/symbols.test.ts +161 -3
- package/testing/render.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Children } from "
|
|
1
|
+
import { Children } from "../jsx-runtime.js";
|
|
2
2
|
export interface SourceDirectoryProps {
|
|
3
3
|
path: string;
|
|
4
|
-
children?: Children
|
|
4
|
+
children?: Children;
|
|
5
5
|
}
|
|
6
|
-
export declare function SourceDirectory(props: SourceDirectoryProps):
|
|
6
|
+
export declare function SourceDirectory(props: SourceDirectoryProps): Children;
|
|
7
7
|
//# sourceMappingURL=SourceDirectory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceDirectory.d.ts","sourceRoot":"","sources":["../../../src/components/SourceDirectory.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SourceDirectory.d.ts","sourceRoot":"","sources":["../../../src/components/SourceDirectory.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAc,MAAM,mBAAmB,CAAC;AAEzD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,YAY1D"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { getContext } from "@alloy-js/core/jsx-runtime";
|
|
3
2
|
import { shallowReactive } from "@vue/reactivity";
|
|
4
3
|
import { join } from "pathe";
|
|
5
4
|
import { useContext } from "../context.js";
|
|
6
5
|
import { SourceDirectoryContext } from "../context/source-directory.js";
|
|
6
|
+
import { getContext } from "../jsx-runtime.js";
|
|
7
7
|
export function SourceDirectory(props) {
|
|
8
8
|
const parentDir = useContext(SourceDirectoryContext);
|
|
9
9
|
// todo: this can probably just use context.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceDirectory.js","names":["
|
|
1
|
+
{"version":3,"file":"SourceDirectory.js","names":["shallowReactive","join","useContext","SourceDirectoryContext","getContext","SourceDirectory","props","parentDir","sdPath","path","nodeContext","context","createSourceDirectoryContext","meta","directory","_$createComponent","Provider","value","children","contents","addContent","content","push"],"sources":["../../../src/components/SourceDirectory.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,eAAe,QAAQ,iBAAiB;AACjD,SAASC,IAAI,QAAQ,OAAO;AAC5B,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,sBAAsB,QAAQ,gCAAgC;AACvE,SAAmBC,UAAU,QAAQ,mBAAmB;AAOxD,OAAO,SAASC,eAAeA,CAACC,KAA2B,EAAE;EAC3D,MAAMC,SAAS,GAAGL,UAAU,CAACC,sBAAsB,CAAC;EACpD;EACA,MAAMK,MAAM,GAAGD,SAAS,GAAGN,IAAI,CAACM,SAAS,CAACE,IAAI,EAAEH,KAAK,CAACG,IAAI,CAAC,GAAGH,KAAK,CAACG,IAAI;EACxE,MAAMC,WAAW,GAAGN,UAAU,CAAC,CAAE;EACjC,MAAMO,OAAO,GAAGC,4BAA4B,CAACN,KAAK,CAACG,IAAI,EAAEF,SAAS,CAAC;EAEnEG,WAAW,CAACG,IAAI,KAAK,CAAC,CAAC;EACvBH,WAAW,CAACG,IAAI,CAACC,SAAS,GAAG;IAC3BL,IAAI,EAAED;EACR,CAAC;EACD,OAAAO,iBAAA,CAAQZ,sBAAsB,CAACa,QAAQ;IAACC,KAAK,EAAEN,OAAO;IAAA,IAAAO,SAAA;MAAA,OAAGZ,KAAK,CAACY,QAAQ;IAAA;EAAA;AACzE;AAEA,SAASN,4BAA4BA,CACnCH,IAAY,GAAG,IAAI,EACnBF,SAAkC,EACV;EACxB,MAAMY,QAAQ,GAAGnB,eAAe,CAAC,EAAS,CAAC;EAC3C,MAAMW,OAA+B,GAAG;IACtCF,IAAI,EAAEF,SAAS,GAAGN,IAAI,CAACM,SAAS,CAACE,IAAI,EAAEA,IAAI,CAAC,GAAGA,IAAI;IACnDU,QAAQ;IACRC,UAAUA,CAACC,OAAO,EAAE;MAClBF,QAAQ,CAACG,IAAI,CAACD,OAAO,CAAC;IACxB;EACF,CAAC;EACD,IAAId,SAAS,EAAE;IACbA,SAAS,CAACa,UAAU,CAACT,OAAO,CAAC;EAC/B;EAEA,OAAOA,OAAO;AAChB","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Children, ComponentDefinition } from "
|
|
1
|
+
import { Children, ComponentDefinition } from "../jsx-runtime.js";
|
|
2
2
|
import { Refkey } from "../refkey.js";
|
|
3
3
|
export interface SourceFileProps {
|
|
4
4
|
/**
|
|
@@ -9,7 +9,7 @@ export interface SourceFileProps {
|
|
|
9
9
|
* The type of contents in this file.
|
|
10
10
|
*/
|
|
11
11
|
filetype: string;
|
|
12
|
-
children?: Children
|
|
12
|
+
children?: Children;
|
|
13
13
|
/**
|
|
14
14
|
* The component to use to render refkeys references within the file's
|
|
15
15
|
* contents.
|
|
@@ -23,5 +23,5 @@ export interface SourceFileProps {
|
|
|
23
23
|
*/
|
|
24
24
|
indent?: string;
|
|
25
25
|
}
|
|
26
|
-
export declare function SourceFile(props: SourceFileProps):
|
|
26
|
+
export declare function SourceFile(props: SourceFileProps): Children;
|
|
27
27
|
//# sourceMappingURL=SourceFile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceFile.d.ts","sourceRoot":"","sources":["../../../src/components/SourceFile.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SourceFile.d.ts","sourceRoot":"","sources":["../../../src/components/SourceFile.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAc,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;;OAGG;IACH,SAAS,CAAC,EAAE,mBAAmB,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEpD;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,YAoBhD"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
2
|
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
3
|
-
import { getContext } from "@alloy-js/core/jsx-runtime";
|
|
4
3
|
import { join } from "pathe";
|
|
5
4
|
import { useContext } from "../context.js";
|
|
6
5
|
import { IndentContext } from "../context/indent.js";
|
|
7
6
|
import { SourceDirectoryContext } from "../context/source-directory.js";
|
|
8
7
|
import { SourceFileContext } from "../context/source-file.js";
|
|
8
|
+
import { getContext } from "../jsx-runtime.js";
|
|
9
9
|
export function SourceFile(props) {
|
|
10
10
|
const parentDirectory = useContext(SourceDirectoryContext);
|
|
11
11
|
const context = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceFile.js","names":["
|
|
1
|
+
{"version":3,"file":"SourceFile.js","names":["join","useContext","IndentContext","SourceDirectoryContext","SourceFileContext","getContext","SourceFile","props","parentDirectory","context","path","filetype","reference","addContent","nodeContext","meta","sourceFile","_$createComponent","Provider","value","children","_$memo","indent","level","indentString"],"sources":["../../../src/components/SourceFile.tsx"],"sourcesContent":[null],"mappings":";;AAAA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,sBAAsB,QAAQ,gCAAgC;AACvE,SAASC,iBAAiB,QAAQ,2BAA2B;AAC7D,SAAwCC,UAAU,QAAQ,mBAAmB;AA6B7E,OAAO,SAASC,UAAUA,CAACC,KAAsB,EAAE;EACjD,MAAMC,eAAe,GAAGP,UAAU,CAACE,sBAAsB,CAAE;EAC3D,MAAMM,OAA0B,GAAG;IACjCC,IAAI,EAAEV,IAAI,CAACQ,eAAe,GAAGA,eAAe,CAACE,IAAI,GAAG,EAAE,EAAEH,KAAK,CAACG,IAAI,CAAC;IACnEC,QAAQ,EAAEJ,KAAK,CAACI,QAAQ;IACxBC,SAAS,EAAEL,KAAK,CAACK;EACnB,CAAC;EACDJ,eAAe,EAAEK,UAAU,CAACJ,OAAO,CAAC;EACpC,MAAMK,WAAW,GAAGT,UAAU,CAAC,CAAE;EACjCS,WAAW,CAACC,IAAI,KAAK,CAAC,CAAC;EACvBD,WAAW,CAACC,IAAI,CAACC,UAAU,GAAGP,OAAO;EAErC,OAAAQ,iBAAA,CAAQb,iBAAiB,CAACc,QAAQ;IAACC,KAAK,EAAEV,OAAO;IAAA,IAAAW,SAAA;MAAA,OAC7CC,MAAA,SAAAd,KAAK,CAACe,MAAM,MAAAL,iBAAA,CACTf,aAAa,CAACgB,QAAQ;QAAA,IAACC,KAAKA,CAAA;UAAA,OAAE;YAAEI,KAAK,EAAE,CAAC;YAAED,MAAM,EAAEf,KAAK,CAACe,MAAM;YAAEE,YAAY,EAAE;UAAG,CAAC;QAAA;QAAA,IAAAJ,SAAA;UAAA,OAChFb,KAAK,CAACa,QAAQ;QAAA;MAAA,KAEjBb,KAAK,CAACa,QAAQ;IAAA;EAAA;AAGtB","ignoreList":[]}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import * as base from "../index.js";
|
|
2
|
-
export declare const Declaration: (props?: base.DeclarationProps | undefined) => import("
|
|
3
|
-
code(template: TemplateStringsArray, ...substitutions: import("
|
|
4
|
-
children(...children: import("
|
|
2
|
+
export declare const Declaration: (props?: base.DeclarationProps | undefined) => import("@alloy-js/core/jsx-runtime").ComponentCreator<base.DeclarationProps> & {
|
|
3
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core/jsx-runtime").Children[]): import("@alloy-js/core/jsx-runtime").ComponentCreator<base.DeclarationProps>;
|
|
4
|
+
children(...children: import("@alloy-js/core/jsx-runtime").Children[]): import("@alloy-js/core/jsx-runtime").ComponentCreator<base.DeclarationProps>;
|
|
5
5
|
};
|
|
6
|
-
export declare const Indent: (props?: base.IndentProps | undefined) => import("
|
|
7
|
-
code(template: TemplateStringsArray, ...substitutions: import("
|
|
8
|
-
children(...children: import("
|
|
6
|
+
export declare const Indent: (props?: base.IndentProps | undefined) => import("@alloy-js/core/jsx-runtime").ComponentCreator<base.IndentProps> & {
|
|
7
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core/jsx-runtime").Children[]): import("@alloy-js/core/jsx-runtime").ComponentCreator<base.IndentProps>;
|
|
8
|
+
children(...children: import("@alloy-js/core/jsx-runtime").Children[]): import("@alloy-js/core/jsx-runtime").ComponentCreator<base.IndentProps>;
|
|
9
9
|
};
|
|
10
|
-
export declare const Output: (props?: base.OutputProps | undefined) => import("
|
|
11
|
-
code(template: TemplateStringsArray, ...substitutions: import("
|
|
12
|
-
children(...children: import("
|
|
10
|
+
export declare const Output: (props?: base.OutputProps | undefined) => import("@alloy-js/core/jsx-runtime").ComponentCreator<base.OutputProps> & {
|
|
11
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core/jsx-runtime").Children[]): import("@alloy-js/core/jsx-runtime").ComponentCreator<base.OutputProps>;
|
|
12
|
+
children(...children: import("@alloy-js/core/jsx-runtime").Children[]): import("@alloy-js/core/jsx-runtime").ComponentCreator<base.OutputProps>;
|
|
13
13
|
};
|
|
14
|
-
export declare const Scope: (props?: base.ScopeProps | undefined) => import("
|
|
15
|
-
code(template: TemplateStringsArray, ...substitutions: import("
|
|
16
|
-
children(...children: import("
|
|
14
|
+
export declare const Scope: (props?: base.ScopeProps | undefined) => import("@alloy-js/core/jsx-runtime").ComponentCreator<base.ScopeProps> & {
|
|
15
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core/jsx-runtime").Children[]): import("@alloy-js/core/jsx-runtime").ComponentCreator<base.ScopeProps>;
|
|
16
|
+
children(...children: import("@alloy-js/core/jsx-runtime").Children[]): import("@alloy-js/core/jsx-runtime").ComponentCreator<base.ScopeProps>;
|
|
17
17
|
};
|
|
18
|
-
export declare const SourceDirectory: (props: base.SourceDirectoryProps) => import("
|
|
19
|
-
code(template: TemplateStringsArray, ...substitutions: import("
|
|
20
|
-
children(...children: import("
|
|
18
|
+
export declare const SourceDirectory: (props: base.SourceDirectoryProps) => import("@alloy-js/core/jsx-runtime").ComponentCreator<base.SourceDirectoryProps> & {
|
|
19
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core/jsx-runtime").Children[]): import("@alloy-js/core/jsx-runtime").ComponentCreator<base.SourceDirectoryProps>;
|
|
20
|
+
children(...children: import("@alloy-js/core/jsx-runtime").Children[]): import("@alloy-js/core/jsx-runtime").ComponentCreator<base.SourceDirectoryProps>;
|
|
21
21
|
};
|
|
22
|
-
export declare const SourceFile: (props: base.SourceFileProps) => import("
|
|
23
|
-
code(template: TemplateStringsArray, ...substitutions: import("
|
|
24
|
-
children(...children: import("
|
|
22
|
+
export declare const SourceFile: (props: base.SourceFileProps) => import("@alloy-js/core/jsx-runtime").ComponentCreator<base.SourceFileProps> & {
|
|
23
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core/jsx-runtime").Children[]): import("@alloy-js/core/jsx-runtime").ComponentCreator<base.SourceFileProps>;
|
|
24
|
+
children(...children: import("@alloy-js/core/jsx-runtime").Children[]): import("@alloy-js/core/jsx-runtime").ComponentCreator<base.SourceFileProps>;
|
|
25
25
|
};
|
|
26
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assignment.d.ts","sourceRoot":"","sources":["../../../src/context/assignment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"assignment.d.ts","sourceRoot":"","sources":["../../../src/context/assignment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,EAAE,YAAY,CAAC;IAErB;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB,EAAE,gBAAgB,CAAC,iBAAiB,CAChC,CAAC;AAEnC;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,YAAY,GACnB,iBAAiB,CAKnB;AAED,wBAAgB,mBAAmB,6BAMlC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createNamedContext, useContext } from "../context.js";
|
|
2
2
|
/**
|
|
3
3
|
* AssignmentContext provides the symbol that is the target of the current
|
|
4
4
|
* assignment.
|
|
@@ -15,7 +15,7 @@ import { createContext, useContext } from "../context.js";
|
|
|
15
15
|
* object value expression should use assignment context to provide the member
|
|
16
16
|
* symbols for the object value's properties.
|
|
17
17
|
*/
|
|
18
|
-
export const AssignmentContext =
|
|
18
|
+
export const AssignmentContext = createNamedContext("Assignment");
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Creates a new {@link (AssignmentContext:interface)}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assignment.js","names":["
|
|
1
|
+
{"version":3,"file":"assignment.js","names":["createNamedContext","useContext","AssignmentContext","createAssignmentContext","target","isAssigned","getAssignmentSymbol","assignmentContext","undefined"],"sources":["../../../src/context/assignment.ts"],"sourcesContent":[null],"mappings":"AACA,SAEEA,kBAAkB,EAClBC,UAAU,QACL,eAAe;AAetB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAsD,GACjEF,kBAAkB,CAAC,YAAY,CAAC;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,uBAAuBA,CACrCC,MAAoB,EACD;EACnB,OAAO;IACLC,UAAU,EAAE,KAAK;IACjBD;EACF,CAAC;AACH;AAEA,OAAO,SAASE,mBAAmBA,CAAA,EAAG;EACpC,MAAMC,iBAAiB,GAAGN,UAAU,CAACC,iBAAiB,CAAC;EACvD,IAAIK,iBAAiB,EAAE;IACrB,OAAOA,iBAAiB,CAACH,MAAM;EACjC;EACA,OAAOI,SAAS;AAClB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binder.d.ts","sourceRoot":"","sources":["../../../src/context/binder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"binder.d.ts","sourceRoot":"","sources":["../../../src/context/binder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EACL,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AAIvB;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,gBAAgB,CAAC,MAAM,CACrB,CAAC;AAE/B,wBAAgB,SAAS,WAExB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createNamedContext, useContext } from "../context.js";
|
|
2
2
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The binder context provides the binder instance to all components. This
|
|
6
6
|
* context is provided by the {@link Output | output component}.
|
|
7
7
|
*/
|
|
8
|
-
export const BinderContext =
|
|
8
|
+
export const BinderContext = createNamedContext("Binder");
|
|
9
9
|
export function useBinder() {
|
|
10
10
|
return useContext(BinderContext);
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binder.js","names":["
|
|
1
|
+
{"version":3,"file":"binder.js","names":["createNamedContext","useContext","BinderContext","useBinder"],"sources":["../../../src/context/binder.ts"],"sourcesContent":[null],"mappings":"AACA,SAEEA,kBAAkB,EAClBC,UAAU,QACL,eAAe;AACtB;;AAGA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAuC,GAClDF,kBAAkB,CAAC,QAAQ,CAAC;AAE9B,OAAO,SAASG,SAASA,CAAA,EAAG;EAC1B,OAAOF,UAAU,CAACC,aAAa,CAAC;AAClC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declaration.d.ts","sourceRoot":"","sources":["../../../src/context/declaration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"declaration.d.ts","sourceRoot":"","sources":["../../../src/context/declaration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAsB,MAAM,eAAe,CAAC;AAErE,eAAO,MAAM,kBAAkB,EAAE,gBAAgB,CAAC,YAAY,CAC3B,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const DeclarationContext =
|
|
1
|
+
import { createNamedContext } from "../context.js";
|
|
2
|
+
export const DeclarationContext = createNamedContext("Declaration");
|
|
3
3
|
//# sourceMappingURL=declaration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declaration.js","names":["
|
|
1
|
+
{"version":3,"file":"declaration.js","names":["createNamedContext","DeclarationContext"],"sources":["../../../src/context/declaration.ts"],"sourcesContent":[null],"mappings":"AACA,SAA2BA,kBAAkB,QAAQ,eAAe;AAEpE,OAAO,MAAMC,kBAAkD,GAC7DD,kBAAkB,CAAC,aAAa,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indent.d.ts","sourceRoot":"","sources":["../../../src/context/indent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,
|
|
1
|
+
{"version":3,"file":"indent.d.ts","sourceRoot":"","sources":["../../../src/context/indent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACL,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,aAAa,EAAE,gBAAgB,CAAC,WAAW,CAOvD,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,gBAAgB,CAAC,MAAM,CAAyB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createContext } from "../context.js";
|
|
2
|
-
export const IndentContext =
|
|
1
|
+
import { createContext, createNamedContext } from "../context.js";
|
|
2
|
+
export const IndentContext = createNamedContext("Indent", {
|
|
3
3
|
level: 0,
|
|
4
4
|
indent: " ",
|
|
5
5
|
indentString: ""
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indent.js","names":["createContext","IndentContext","level","indent","indentString","TestContext"],"sources":["../../../src/context/indent.ts"],"sourcesContent":[null],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"indent.js","names":["createContext","createNamedContext","IndentContext","level","indent","indentString","TestContext"],"sources":["../../../src/context/indent.ts"],"sourcesContent":[null],"mappings":"AACA,SAEEA,aAAa,EACbC,kBAAkB,QACb,eAAe;AAEtB,OAAO,MAAMC,aAA4C,GAAGD,kBAAkB,CAC5E,QAAQ,EACR;EACEE,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,IAAI;EACZC,YAAY,EAAE;AAChB,CACF,CAAC;AAED,OAAO,MAAMC,WAAqC,GAAGN,aAAa,CAAC,MAAM,CAAC","ignoreList":[]}
|
|
@@ -6,4 +6,5 @@ import { ComponentContext } from "../context.js";
|
|
|
6
6
|
* @see {@link DeclarationContext} for getting the symbol for the current non-member declaration.
|
|
7
7
|
*/
|
|
8
8
|
export declare const MemberDeclarationContext: ComponentContext<OutputSymbol>;
|
|
9
|
+
export declare function useMemberDeclaration(): OutputSymbol | undefined;
|
|
9
10
|
//# sourceMappingURL=member-declaration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member-declaration.d.ts","sourceRoot":"","sources":["../../../src/context/member-declaration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"member-declaration.d.ts","sourceRoot":"","sources":["../../../src/context/member-declaration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AAEvB;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,CAAC,YAAY,CAC3B,CAAC;AAE1C,wBAAgB,oBAAoB,6BAEnC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createNamedContext, useContext } from "../context.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Provides the symbol for the member currently being declared.
|
|
5
5
|
*
|
|
6
6
|
* @see {@link DeclarationContext} for getting the symbol for the current non-member declaration.
|
|
7
7
|
*/
|
|
8
|
-
export const MemberDeclarationContext =
|
|
8
|
+
export const MemberDeclarationContext = createNamedContext("MemberDeclaration");
|
|
9
|
+
export function useMemberDeclaration() {
|
|
10
|
+
return useContext(MemberDeclarationContext);
|
|
11
|
+
}
|
|
9
12
|
//# sourceMappingURL=member-declaration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member-declaration.js","names":["
|
|
1
|
+
{"version":3,"file":"member-declaration.js","names":["createNamedContext","useContext","MemberDeclarationContext","useMemberDeclaration"],"sources":["../../../src/context/member-declaration.ts"],"sourcesContent":[null],"mappings":"AACA,SAEEA,kBAAkB,EAClBC,UAAU,QACL,eAAe;;AAEtB;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwD,GACnEF,kBAAkB,CAAC,mBAAmB,CAAC;AAEzC,OAAO,SAASG,oBAAoBA,CAAA,EAAG;EACrC,OAAOF,UAAU,CAACC,wBAAwB,CAAC;AAC7C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member-scope.d.ts","sourceRoot":"","sources":["../../../src/context/member-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"member-scope.d.ts","sourceRoot":"","sources":["../../../src/context/member-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EACL,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AAEvB;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,eAAe,CAAC,EAAE,WAAW,CAAC;CAC/B;AACD,eAAO,MAAM,kBAAkB,EAAE,gBAAgB,CAAC,kBAAkB,CACjC,CAAC;AAEpC,wBAAgB,cAAc,uBAE7B"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createNamedContext, useContext } from "../context.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The member scope context provides the instance and static member scopes that
|
|
5
5
|
* are used for member declarations and instance member resolution.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
export const MemberScopeContext =
|
|
8
|
+
export const MemberScopeContext = createNamedContext("MemberScope");
|
|
9
9
|
export function useMemberScope() {
|
|
10
10
|
return useContext(MemberScopeContext);
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member-scope.js","names":["
|
|
1
|
+
{"version":3,"file":"member-scope.js","names":["createNamedContext","useContext","MemberScopeContext","useMemberScope"],"sources":["../../../src/context/member-scope.ts"],"sourcesContent":[null],"mappings":"AACA,SAEEA,kBAAkB,EAClBC,UAAU,QACL,eAAe;;AAEtB;AACA;AACA;AACA;;AAKA,OAAO,MAAMC,kBAAwD,GACnEF,kBAAkB,CAAC,aAAa,CAAC;AAEnC,OAAO,SAASG,cAAcA,CAAA,EAAG;EAC/B,OAAOF,UAAU,CAACC,kBAAkB,CAAC;AACvC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"name-policy.d.ts","sourceRoot":"","sources":["../../../src/context/name-policy.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"name-policy.d.ts","sourceRoot":"","sources":["../../../src/context/name-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,eAAO,MAAM,iBAAiB,EAAE,gBAAgB,CAAC,UAAU,CAAC,MAAM,CAAC,CAK/D,CAAC;AAEL,wBAAgB,aAAa,uBAE5B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const NamePolicyContext =
|
|
1
|
+
import { createNamedContext, useContext } from "../context.js";
|
|
2
|
+
export const NamePolicyContext = createNamedContext("NamePolicy", {
|
|
3
3
|
getName(name) {
|
|
4
4
|
return name;
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"name-policy.js","names":["
|
|
1
|
+
{"version":3,"file":"name-policy.js","names":["createNamedContext","useContext","NamePolicyContext","getName","name","useNamePolicy"],"sources":["../../../src/context/name-policy.ts"],"sourcesContent":[null],"mappings":"AAAA,SAEEA,kBAAkB,EAClBC,UAAU,QACL,eAAe;AAGtB,OAAO,MAAMC,iBAAuD,GAClEF,kBAAkB,CAAqB,YAAY,EAAE;EACnDG,OAAOA,CAACC,IAAI,EAAE;IACZ,OAAOA,IAAI;EACb;AACF,CAAC,CAAC;AAEJ,OAAO,SAASC,aAAaA,CAAA,EAAG;EAC9B,OAAOJ,UAAU,CAACC,iBAAiB,CAAC;AACtC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../src/context/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../src/context/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EACL,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,YAAY,EAAE,gBAAgB,CAAC,WAAW,CAC1B,CAAC;AAE9B,wBAAgB,QAAQ,gBAEvB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const ScopeContext =
|
|
1
|
+
import { createNamedContext, useContext } from "../context.js";
|
|
2
|
+
export const ScopeContext = createNamedContext("Scope");
|
|
3
3
|
export function useScope() {
|
|
4
4
|
return useContext(ScopeContext);
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.js","names":["
|
|
1
|
+
{"version":3,"file":"scope.js","names":["createNamedContext","useContext","ScopeContext","useScope"],"sources":["../../../src/context/scope.ts"],"sourcesContent":[null],"mappings":"AACA,SAEEA,kBAAkB,EAClBC,UAAU,QACL,eAAe;AAEtB,OAAO,MAAMC,YAA2C,GACtDF,kBAAkB,CAAC,OAAO,CAAC;AAE7B,OAAO,SAASG,QAAQA,CAAA,EAAG;EACzB,OAAOF,UAAU,CAACC,YAAY,CAAC;AACjC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-directory.d.ts","sourceRoot":"","sources":["../../../src/context/source-directory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"source-directory.d.ts","sourceRoot":"","sources":["../../../src/context/source-directory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAsB,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,CAAC,sBAAsB,GAAG,iBAAiB,CAAC,EAAE,CAAC;IACzD,UAAU,CAAC,OAAO,EAAE,sBAAsB,GAAG,iBAAiB,GAAG,IAAI,CAAC;IACtE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,sBAAsB,EAAE,gBAAgB,CAAC,sBAAsB,CACrC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const SourceDirectoryContext =
|
|
1
|
+
import { createNamedContext } from "../context.js";
|
|
2
|
+
export const SourceDirectoryContext = createNamedContext("SourceDirectory");
|
|
3
3
|
//# sourceMappingURL=source-directory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-directory.js","names":["
|
|
1
|
+
{"version":3,"file":"source-directory.js","names":["createNamedContext","SourceDirectoryContext"],"sources":["../../../src/context/source-directory.ts"],"sourcesContent":[null],"mappings":"AAAA,SAA2BA,kBAAkB,QAAQ,eAAe;AASpE,OAAO,MAAMC,sBAAgE,GAC3ED,kBAAkB,CAAC,iBAAiB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-file.d.ts","sourceRoot":"","sources":["../../../src/context/source-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"source-file.d.ts","sourceRoot":"","sources":["../../../src/context/source-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAsB,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,mBAAmB,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrD;AAED,eAAO,MAAM,iBAAiB,EAAE,gBAAgB,CAAC,iBAAiB,CAChC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const SourceFileContext =
|
|
1
|
+
import { createNamedContext } from "../context.js";
|
|
2
|
+
export const SourceFileContext = createNamedContext("SourceFile");
|
|
3
3
|
//# sourceMappingURL=source-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-file.js","names":["
|
|
1
|
+
{"version":3,"file":"source-file.js","names":["createNamedContext","SourceFileContext"],"sources":["../../../src/context/source-file.ts"],"sourcesContent":[null],"mappings":"AAAA,SAA2BA,kBAAkB,QAAQ,eAAe;AAUpE,OAAO,MAAMC,iBAAsD,GACjED,kBAAkB,CAAC,YAAY,CAAC","ignoreList":[]}
|
package/dist/src/context.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { Children, ComponentDefinition } from "
|
|
1
|
+
import { Children, ComponentDefinition } from "./jsx-runtime.js";
|
|
2
2
|
export interface ComponentContext<T> {
|
|
3
3
|
id: symbol;
|
|
4
4
|
default: T | undefined;
|
|
5
5
|
Provider: ComponentDefinition<ContextProviderProps<T>>;
|
|
6
|
+
name?: string;
|
|
6
7
|
}
|
|
7
8
|
export interface ContextProviderProps<T = unknown> {
|
|
8
9
|
value?: T;
|
|
9
10
|
children?: Children;
|
|
10
11
|
}
|
|
11
12
|
export declare function useContext<T>(context: ComponentContext<T>): T | undefined;
|
|
12
|
-
export declare
|
|
13
|
+
export declare const contextsByKey: Map<symbol, ComponentContext<any>>;
|
|
14
|
+
export declare function createContext<T = unknown>(defaultValue?: T, name?: string): ComponentContext<T>;
|
|
15
|
+
export declare function createNamedContext<T>(name: string, defaultValue?: T): ComponentContext<T>;
|
|
13
16
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,mBAAmB,EAIpB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;IACvB,QAAQ,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,OAAO;IAC/C,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS,CAWzE;AAED,eAAO,MAAM,aAAa,oCAA2C,CAAC;AAEtE,wBAAgB,aAAa,CAAC,CAAC,GAAG,OAAO,EACvC,YAAY,CAAC,EAAE,CAAC,EAChB,IAAI,CAAC,EAAE,MAAM,GACZ,gBAAgB,CAAC,CAAC,CAAC,CAoBrB;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,uBAEnE"}
|
package/dist/src/context.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { effect, getContext, untrack } from "@alloy-js/core/jsx-runtime";
|
|
2
1
|
import { shallowRef } from "@vue/reactivity";
|
|
2
|
+
import { effect, getContext, untrack } from "./jsx-runtime.js";
|
|
3
3
|
export function useContext(context) {
|
|
4
4
|
// context must come from a parent
|
|
5
5
|
let current = getContext();
|
|
@@ -11,11 +11,13 @@ export function useContext(context) {
|
|
|
11
11
|
}
|
|
12
12
|
return context.default;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
export const contextsByKey = new Map();
|
|
15
|
+
export function createContext(defaultValue, name) {
|
|
16
|
+
const id = Symbol(name ?? "context");
|
|
17
|
+
const ctx = {
|
|
17
18
|
id,
|
|
18
19
|
default: defaultValue,
|
|
20
|
+
name,
|
|
19
21
|
Provider(props) {
|
|
20
22
|
const context = getContext();
|
|
21
23
|
const rendered = shallowRef();
|
|
@@ -26,5 +28,10 @@ export function createContext(defaultValue) {
|
|
|
26
28
|
return rendered.value;
|
|
27
29
|
}
|
|
28
30
|
};
|
|
31
|
+
contextsByKey.set(id, ctx);
|
|
32
|
+
return ctx;
|
|
33
|
+
}
|
|
34
|
+
export function createNamedContext(name, defaultValue) {
|
|
35
|
+
return createContext(defaultValue, name);
|
|
29
36
|
}
|
|
30
37
|
//# sourceMappingURL=context.js.map
|
package/dist/src/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","names":["effect","getContext","untrack","
|
|
1
|
+
{"version":3,"file":"context.js","names":["shallowRef","effect","getContext","untrack","useContext","context","current","Object","hasOwn","id","owner","default","contextsByKey","Map","createContext","defaultValue","name","Symbol","ctx","Provider","props","rendered","value","children","set","createNamedContext"],"sources":["../../src/context.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,UAAU,QAAQ,iBAAiB;AAC5C,SAGEC,MAAM,EACNC,UAAU,EACVC,OAAO,QACF,kBAAkB;AAczB,OAAO,SAASC,UAAUA,CAAIC,OAA4B,EAAiB;EACzE;EACA,IAAIC,OAAO,GAAGJ,UAAU,CAAC,CAAC;EAC1B,OAAOI,OAAO,EAAE;IACd,IAAIC,MAAM,CAACC,MAAM,CAACF,OAAO,CAACD,OAAO,EAAGA,OAAO,CAACI,EAAE,CAAC,EAAE;MAC/C,OAAOH,OAAO,CAACD,OAAO,CAAEA,OAAO,CAACI,EAAE,CAAC;IACrC;IACAH,OAAO,GAAGA,OAAO,CAACI,KAAK;EACzB;EAEA,OAAOL,OAAO,CAACM,OAAO;AACxB;AAEA,OAAO,MAAMC,aAAa,GAAG,IAAIC,GAAG,CAAgC,CAAC;AAErE,OAAO,SAASC,aAAaA,CAC3BC,YAAgB,EAChBC,IAAa,EACQ;EACrB,MAAMP,EAAE,GAAGQ,MAAM,CAACD,IAAI,IAAI,SAAS,CAAC;EACpC,MAAME,GAAG,GAAG;IACVT,EAAE;IACFE,OAAO,EAAEI,YAAY;IACrBC,IAAI;IACJG,QAAQA,CAACC,KAA8B,EAAE;MACvC,MAAMf,OAAO,GAAGH,UAAU,CAAC,CAAC;MAE5B,MAAMmB,QAAQ,GAAGrB,UAAU,CAAC,CAAC;MAC7BC,MAAM,CAAC,MAAM;QACXI,OAAO,CAAEA,OAAO,CAAEI,EAAE,CAAC,GAAGW,KAAK,CAACE,KAAK;QACnCD,QAAQ,CAACC,KAAK,GAAGnB,OAAO,CAAC,MAAMiB,KAAK,CAACG,QAAQ,CAAC;MAChD,CAAC,CAAC;MAEF,OAAOF,QAAQ,CAACC,KAAK;IACvB;EACF,CAAC;EACDV,aAAa,CAACY,GAAG,CAACf,EAAE,EAAES,GAAG,CAAC;EAC1B,OAAOA,GAAG;AACZ;AAEA,OAAO,SAASO,kBAAkBA,CAAIT,IAAY,EAAED,YAAgB,EAAE;EACpE,OAAOD,aAAa,CAAIC,YAAY,EAAEC,IAAI,CAAC;AAC7C","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/debug.ts"],"names":[],"mappings":"AAMA,UAAU,cAAc;IACtB,SAAS,EAAE;QACT,KAAK,IAAI,IAAI,CAAC;QACd,IAAI,IAAI,IAAI,CAAC;QACb,KAAK,IAAI,IAAI,CAAC;QACd,MAAM,IAAI,IAAI,CAAC;QACf,OAAO,IAAI,IAAI,CAAC;KACjB,CAAC;CACH;AAoGD,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,KAAK,EAAE,cAAc,CAAC;CAC3B"}
|