@assistant-ui/react 0.10.5 → 0.10.7
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/primitives/composer/ComposerAddAttachment.d.ts.map +1 -1
- package/dist/primitives/composer/ComposerAddAttachment.js +8 -0
- package/dist/primitives/composer/ComposerAddAttachment.js.map +1 -1
- package/dist/primitives/message/MessageIf.d.ts +1 -0
- package/dist/primitives/message/MessageIf.d.ts.map +1 -1
- package/dist/primitives/message/MessageIf.js +1 -0
- package/dist/primitives/message/MessageIf.js.map +1 -1
- package/dist/tests/setup.js +8 -8
- package/dist/tests/setup.js.map +1 -1
- package/package.json +13 -13
- package/src/primitives/composer/ComposerAddAttachment.tsx +12 -1
- package/src/primitives/message/MessageIf.tsx +2 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ComposerAddAttachment.d.ts","sourceRoot":"","sources":["../../../src/primitives/composer/ComposerAddAttachment.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EAElB,MAAM,gCAAgC,CAAC;AAIxC,QAAA,MAAM,wBAAwB,GAAI,gBAE/B;IACD,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC3B,
|
1
|
+
{"version":3,"file":"ComposerAddAttachment.d.ts","sourceRoot":"","sources":["../../../src/primitives/composer/ComposerAddAttachment.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EAElB,MAAM,gCAAgC,CAAC;AAIxC,QAAA,MAAM,wBAAwB,GAAI,gBAE/B;IACD,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC3B,wBAsCL,CAAC;AAEF,yBAAiB,8BAA8B,CAAC;IAC9C,KAAY,OAAO,GAAG,mBAAmB,CAAC;IAC1C,KAAY,KAAK,GAAG,iBAAiB,CAAC,OAAO,wBAAwB,CAAC,CAAC;CACxE;AAED,eAAO,MAAM,8BAA8B;;;IA/CzC,qCAAqC;eAC1B,OAAO,GAAG,SAAS;qDAkD/B,CAAC"}
|
@@ -15,16 +15,24 @@ var useComposerAddAttachment = ({
|
|
15
15
|
const input = document.createElement("input");
|
16
16
|
input.type = "file";
|
17
17
|
input.multiple = multiple;
|
18
|
+
input.hidden = true;
|
18
19
|
const attachmentAccept = composerRuntime.getAttachmentAccept();
|
19
20
|
if (attachmentAccept !== "*") {
|
20
21
|
input.accept = attachmentAccept;
|
21
22
|
}
|
23
|
+
document.body.appendChild(input);
|
22
24
|
input.onchange = (e) => {
|
23
25
|
const fileList = e.target.files;
|
24
26
|
if (!fileList) return;
|
25
27
|
for (const file of fileList) {
|
26
28
|
composerRuntime.addAttachment(file);
|
27
29
|
}
|
30
|
+
document.body.removeChild(input);
|
31
|
+
};
|
32
|
+
input.oncancel = () => {
|
33
|
+
if (!input.files || input.files.length === 0) {
|
34
|
+
document.body.removeChild(input);
|
35
|
+
}
|
28
36
|
};
|
29
37
|
input.click();
|
30
38
|
}, [composerRuntime, multiple]);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/composer/ComposerAddAttachment.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useCallback } from \"react\";\nimport { useComposer, useComposerRuntime } from \"../../context\";\n\nconst useComposerAddAttachment = ({\n multiple = true,\n}: {\n /** allow selecting multiple files */\n multiple?: boolean | undefined;\n} = {}) => {\n const disabled = useComposer((c) => !c.isEditing);\n\n const composerRuntime = useComposerRuntime();\n const callback = useCallback(() => {\n const input = document.createElement(\"input\");\n input.type = \"file\";\n input.multiple = multiple;\n\n const attachmentAccept = composerRuntime.getAttachmentAccept();\n if (attachmentAccept !== \"*\") {\n input.accept = attachmentAccept;\n }\n\n input.onchange = (e) => {\n const fileList = (e.target as HTMLInputElement).files;\n if (!fileList) return;\n for (const file of fileList) {\n composerRuntime.addAttachment(file);\n }\n };\n\n input.click();\n }, [composerRuntime, multiple]);\n\n if (disabled) return null;\n return callback;\n};\n\nexport namespace ComposerPrimitiveAddAttachment {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useComposerAddAttachment>;\n}\n\nexport const ComposerPrimitiveAddAttachment = createActionButton(\n \"ComposerPrimitive.AddAttachment\",\n useComposerAddAttachment,\n [\"multiple\"],\n);\n"],"mappings":";;;AAEA;AAAA,EAGE;AAAA,OACK;AACP,SAAS,mBAAmB;AAC5B,SAAS,aAAa,0BAA0B;AAEhD,IAAM,2BAA2B,CAAC;AAAA,EAChC,WAAW;AACb,IAGI,CAAC,MAAM;AACT,QAAM,WAAW,YAAY,CAAC,MAAM,CAAC,EAAE,SAAS;AAEhD,QAAM,kBAAkB,mBAAmB;AAC3C,QAAM,WAAW,YAAY,MAAM;AACjC,UAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,UAAM,OAAO;AACb,UAAM,WAAW;
|
1
|
+
{"version":3,"sources":["../../../src/primitives/composer/ComposerAddAttachment.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n ActionButtonElement,\n ActionButtonProps,\n createActionButton,\n} from \"../../utils/createActionButton\";\nimport { useCallback } from \"react\";\nimport { useComposer, useComposerRuntime } from \"../../context\";\n\nconst useComposerAddAttachment = ({\n multiple = true,\n}: {\n /** allow selecting multiple files */\n multiple?: boolean | undefined;\n} = {}) => {\n const disabled = useComposer((c) => !c.isEditing);\n\n const composerRuntime = useComposerRuntime();\n const callback = useCallback(() => {\n const input = document.createElement(\"input\");\n input.type = \"file\";\n input.multiple = multiple;\n input.hidden = true;\n\n const attachmentAccept = composerRuntime.getAttachmentAccept();\n if (attachmentAccept !== \"*\") {\n input.accept = attachmentAccept;\n }\n \n document.body.appendChild(input);\n \n input.onchange = (e) => {\n const fileList = (e.target as HTMLInputElement).files;\n if (!fileList) return;\n for (const file of fileList) {\n composerRuntime.addAttachment(file);\n }\n\n document.body.removeChild(input);\n };\n\n input.oncancel = () => {\n if (!input.files || input.files.length === 0) {\n document.body.removeChild(input);\n }\n }\n \n input.click();\n }, [composerRuntime, multiple]);\n\n if (disabled) return null;\n return callback;\n};\n\nexport namespace ComposerPrimitiveAddAttachment {\n export type Element = ActionButtonElement;\n export type Props = ActionButtonProps<typeof useComposerAddAttachment>;\n}\n\nexport const ComposerPrimitiveAddAttachment = createActionButton(\n \"ComposerPrimitive.AddAttachment\",\n useComposerAddAttachment,\n [\"multiple\"],\n);\n"],"mappings":";;;AAEA;AAAA,EAGE;AAAA,OACK;AACP,SAAS,mBAAmB;AAC5B,SAAS,aAAa,0BAA0B;AAEhD,IAAM,2BAA2B,CAAC;AAAA,EAChC,WAAW;AACb,IAGI,CAAC,MAAM;AACT,QAAM,WAAW,YAAY,CAAC,MAAM,CAAC,EAAE,SAAS;AAEhD,QAAM,kBAAkB,mBAAmB;AAC3C,QAAM,WAAW,YAAY,MAAM;AACjC,UAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,UAAM,OAAO;AACb,UAAM,WAAW;AACjB,UAAM,SAAS;AAEf,UAAM,mBAAmB,gBAAgB,oBAAoB;AAC7D,QAAI,qBAAqB,KAAK;AAC5B,YAAM,SAAS;AAAA,IACjB;AAEA,aAAS,KAAK,YAAY,KAAK;AAE/B,UAAM,WAAW,CAAC,MAAM;AACtB,YAAM,WAAY,EAAE,OAA4B;AAChD,UAAI,CAAC,SAAU;AACf,iBAAW,QAAQ,UAAU;AAC3B,wBAAgB,cAAc,IAAI;AAAA,MACpC;AAEA,eAAS,KAAK,YAAY,KAAK;AAAA,IACjC;AAEA,UAAM,WAAW,MAAM;AACrB,UAAI,CAAC,MAAM,SAAS,MAAM,MAAM,WAAW,GAAG;AAC5C,iBAAS,KAAK,YAAY,KAAK;AAAA,MACjC;AAAA,IACF;AAEA,UAAM,MAAM;AAAA,EACd,GAAG,CAAC,iBAAiB,QAAQ,CAAC;AAE9B,MAAI,SAAU,QAAO;AACrB,SAAO;AACT;AAOO,IAAM,iCAAiC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA,CAAC,UAAU;AACb;","names":[]}
|
@@ -7,6 +7,7 @@ type MessageIfFilters = {
|
|
7
7
|
hasBranches: boolean | undefined;
|
8
8
|
copied: boolean | undefined;
|
9
9
|
lastOrHover: boolean | undefined;
|
10
|
+
last: boolean | undefined;
|
10
11
|
speaking: boolean | undefined;
|
11
12
|
hasAttachments: boolean | undefined;
|
12
13
|
hasContent: boolean | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MessageIf.d.ts","sourceRoot":"","sources":["../../../src/primitives/message/MessageIf.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAKnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGvE,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,cAAc,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC,UAAU,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,iBAAiB,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;CAC/D,CAAC;AACF,KAAK,iBAAiB,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"MessageIf.d.ts","sourceRoot":"","sources":["../../../src/primitives/message/MessageIf.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAKnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGvE,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,IAAI,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,cAAc,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC,UAAU,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,iBAAiB,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS,CAAC;CAC/D,CAAC;AACF,KAAK,iBAAiB,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;AA6D7D,yBAAiB,kBAAkB,CAAC;IAClC,KAAY,KAAK,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CAC1D;AAED,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAM3D,CAAC"}
|
@@ -25,6 +25,7 @@ var useMessageIf = (props) => {
|
|
25
25
|
if (props.assistant && role !== "assistant") return false;
|
26
26
|
if (props.system && role !== "system") return false;
|
27
27
|
if (props.lastOrHover === true && !isHovering && !isLast) return false;
|
28
|
+
if (props.last === true && !isLast) return false;
|
28
29
|
if (props.copied === true && !isCopied) return false;
|
29
30
|
if (props.copied === false && isCopied) return false;
|
30
31
|
if (props.speaking === true && speech == null) return false;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/primitives/message/MessageIf.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC, PropsWithChildren } from \"react\";\nimport {\n useMessageRuntime,\n useMessageUtilsStore,\n} from \"../../context/react/MessageContext\";\nimport type { RequireAtLeastOne } from \"../../utils/RequireAtLeastOne\";\nimport { useCombinedStore } from \"../../utils/combined/useCombinedStore\";\n\ntype MessageIfFilters = {\n user: boolean | undefined;\n assistant: boolean | undefined;\n system: boolean | undefined;\n hasBranches: boolean | undefined;\n copied: boolean | undefined;\n lastOrHover: boolean | undefined;\n speaking: boolean | undefined;\n hasAttachments: boolean | undefined;\n hasContent: boolean | undefined;\n submittedFeedback: \"positive\" | \"negative\" | null | undefined;\n};\ntype UseMessageIfProps = RequireAtLeastOne<MessageIfFilters>;\n\nconst useMessageIf = (props: UseMessageIfProps) => {\n const messageRuntime = useMessageRuntime();\n const messageUtilsStore = useMessageUtilsStore();\n\n return useCombinedStore(\n [messageRuntime, messageUtilsStore],\n (\n {\n role,\n attachments,\n content,\n branchCount,\n isLast,\n speech,\n submittedFeedback,\n },\n { isCopied, isHovering },\n ) => {\n if (props.hasBranches === true && branchCount < 2) return false;\n\n if (props.user && role !== \"user\") return false;\n if (props.assistant && role !== \"assistant\") return false;\n if (props.system && role !== \"system\") return false;\n\n if (props.lastOrHover === true && !isHovering && !isLast) return false;\n\n if (props.copied === true && !isCopied) return false;\n if (props.copied === false && isCopied) return false;\n\n if (props.speaking === true && speech == null) return false;\n if (props.speaking === false && speech != null) return false;\n\n if (\n props.hasAttachments === true &&\n (role !== \"user\" || !attachments.length)\n )\n return false;\n if (\n props.hasAttachments === false &&\n role === \"user\" &&\n !!attachments.length\n )\n return false;\n\n if (props.hasContent === true && content.length === 0) return false;\n if (props.hasContent === false && content.length > 0) return false;\n\n if (\n props.submittedFeedback !== undefined &&\n (submittedFeedback?.type ?? null) !== props.submittedFeedback\n )\n return false;\n\n return true;\n },\n );\n};\n\nexport namespace MessagePrimitiveIf {\n export type Props = PropsWithChildren<UseMessageIfProps>;\n}\n\nexport const MessagePrimitiveIf: FC<MessagePrimitiveIf.Props> = ({\n children,\n ...query\n}) => {\n const result = useMessageIf(query);\n return result ? children : null;\n};\n\nMessagePrimitiveIf.displayName = \"MessagePrimitive.If\";\n"],"mappings":";;;AAGA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP,SAAS,wBAAwB;
|
1
|
+
{"version":3,"sources":["../../../src/primitives/message/MessageIf.tsx"],"sourcesContent":["\"use client\";\n\nimport type { FC, PropsWithChildren } from \"react\";\nimport {\n useMessageRuntime,\n useMessageUtilsStore,\n} from \"../../context/react/MessageContext\";\nimport type { RequireAtLeastOne } from \"../../utils/RequireAtLeastOne\";\nimport { useCombinedStore } from \"../../utils/combined/useCombinedStore\";\n\ntype MessageIfFilters = {\n user: boolean | undefined;\n assistant: boolean | undefined;\n system: boolean | undefined;\n hasBranches: boolean | undefined;\n copied: boolean | undefined;\n lastOrHover: boolean | undefined;\n last: boolean | undefined;\n speaking: boolean | undefined;\n hasAttachments: boolean | undefined;\n hasContent: boolean | undefined;\n submittedFeedback: \"positive\" | \"negative\" | null | undefined;\n};\ntype UseMessageIfProps = RequireAtLeastOne<MessageIfFilters>;\n\nconst useMessageIf = (props: UseMessageIfProps) => {\n const messageRuntime = useMessageRuntime();\n const messageUtilsStore = useMessageUtilsStore();\n\n return useCombinedStore(\n [messageRuntime, messageUtilsStore],\n (\n {\n role,\n attachments,\n content,\n branchCount,\n isLast,\n speech,\n submittedFeedback,\n },\n { isCopied, isHovering },\n ) => {\n if (props.hasBranches === true && branchCount < 2) return false;\n\n if (props.user && role !== \"user\") return false;\n if (props.assistant && role !== \"assistant\") return false;\n if (props.system && role !== \"system\") return false;\n\n if (props.lastOrHover === true && !isHovering && !isLast) return false;\n if (props.last === true && !isLast) return false;\n\n if (props.copied === true && !isCopied) return false;\n if (props.copied === false && isCopied) return false;\n\n if (props.speaking === true && speech == null) return false;\n if (props.speaking === false && speech != null) return false;\n\n if (\n props.hasAttachments === true &&\n (role !== \"user\" || !attachments.length)\n )\n return false;\n if (\n props.hasAttachments === false &&\n role === \"user\" &&\n !!attachments.length\n )\n return false;\n\n if (props.hasContent === true && content.length === 0) return false;\n if (props.hasContent === false && content.length > 0) return false;\n\n if (\n props.submittedFeedback !== undefined &&\n (submittedFeedback?.type ?? null) !== props.submittedFeedback\n )\n return false;\n\n return true;\n },\n );\n};\n\nexport namespace MessagePrimitiveIf {\n export type Props = PropsWithChildren<UseMessageIfProps>;\n}\n\nexport const MessagePrimitiveIf: FC<MessagePrimitiveIf.Props> = ({\n children,\n ...query\n}) => {\n const result = useMessageIf(query);\n return result ? children : null;\n};\n\nMessagePrimitiveIf.displayName = \"MessagePrimitive.If\";\n"],"mappings":";;;AAGA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP,SAAS,wBAAwB;AAiBjC,IAAM,eAAe,CAAC,UAA6B;AACjD,QAAM,iBAAiB,kBAAkB;AACzC,QAAM,oBAAoB,qBAAqB;AAE/C,SAAO;AAAA,IACL,CAAC,gBAAgB,iBAAiB;AAAA,IAClC,CACE;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,GACA,EAAE,UAAU,WAAW,MACpB;AACH,UAAI,MAAM,gBAAgB,QAAQ,cAAc,EAAG,QAAO;AAE1D,UAAI,MAAM,QAAQ,SAAS,OAAQ,QAAO;AAC1C,UAAI,MAAM,aAAa,SAAS,YAAa,QAAO;AACpD,UAAI,MAAM,UAAU,SAAS,SAAU,QAAO;AAE9C,UAAI,MAAM,gBAAgB,QAAQ,CAAC,cAAc,CAAC,OAAQ,QAAO;AACjE,UAAI,MAAM,SAAS,QAAQ,CAAC,OAAQ,QAAO;AAE3C,UAAI,MAAM,WAAW,QAAQ,CAAC,SAAU,QAAO;AAC/C,UAAI,MAAM,WAAW,SAAS,SAAU,QAAO;AAE/C,UAAI,MAAM,aAAa,QAAQ,UAAU,KAAM,QAAO;AACtD,UAAI,MAAM,aAAa,SAAS,UAAU,KAAM,QAAO;AAEvD,UACE,MAAM,mBAAmB,SACxB,SAAS,UAAU,CAAC,YAAY;AAEjC,eAAO;AACT,UACE,MAAM,mBAAmB,SACzB,SAAS,UACT,CAAC,CAAC,YAAY;AAEd,eAAO;AAET,UAAI,MAAM,eAAe,QAAQ,QAAQ,WAAW,EAAG,QAAO;AAC9D,UAAI,MAAM,eAAe,SAAS,QAAQ,SAAS,EAAG,QAAO;AAE7D,UACE,MAAM,sBAAsB,WAC3B,mBAAmB,QAAQ,UAAU,MAAM;AAE5C,eAAO;AAET,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAMO,IAAM,qBAAmD,CAAC;AAAA,EAC/D;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,SAAS,aAAa,KAAK;AACjC,SAAO,SAAS,WAAW;AAC7B;AAEA,mBAAmB,cAAc;","names":[]}
|
package/dist/tests/setup.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
// ../../node_modules/.pnpm/vitest@3.1.
|
1
|
+
// ../../node_modules/.pnpm/vitest@3.1.3_@types+debug@4.1.12_@types+node@22.15.18_jiti@2.4.2_lightningcss@1.30.1_terser@5.39.0_tsx@4.19.4/node_modules/vitest/dist/chunks/vi.ClIskdbk.js
|
2
2
|
import { equals, iterableEquality, subsetEquality, JestExtend, JestChaiExpect, JestAsymmetricMatchers, GLOBAL_EXPECT, ASYMMETRIC_MATCHERS_OBJECT, getState, setState, addCustomEqualityTesters, customMatchers } from "@vitest/expect.js";
|
3
3
|
import { getCurrentTest } from "@vitest/runner.js";
|
4
4
|
import { getNames, getTestName } from "@vitest/runner/utils.js";
|
5
5
|
import * as chai$1 from "chai.js";
|
6
6
|
|
7
|
-
// ../../node_modules/.pnpm/vitest@3.1.
|
7
|
+
// ../../node_modules/.pnpm/vitest@3.1.3_@types+debug@4.1.12_@types+node@22.15.18_jiti@2.4.2_lightningcss@1.30.1_terser@5.39.0_tsx@4.19.4/node_modules/vitest/dist/chunks/utils.CgTj3MsC.js
|
8
8
|
import { getSafeTimers } from "@vitest/utils.js";
|
9
9
|
var NAME_WORKER_STATE = "__vitest_worker__";
|
10
10
|
function getWorkerState() {
|
@@ -61,22 +61,22 @@ async function waitForImportsToResolve() {
|
|
61
61
|
await waitForImportsToResolve();
|
62
62
|
}
|
63
63
|
|
64
|
-
// ../../node_modules/.pnpm/vitest@3.1.
|
64
|
+
// ../../node_modules/.pnpm/vitest@3.1.3_@types+debug@4.1.12_@types+node@22.15.18_jiti@2.4.2_lightningcss@1.30.1_terser@5.39.0_tsx@4.19.4/node_modules/vitest/dist/chunks/vi.ClIskdbk.js
|
65
65
|
import { getSafeTimers as getSafeTimers2, assertTypes, createSimpleStackTrace } from "@vitest/utils.js";
|
66
66
|
|
67
|
-
// ../../node_modules/.pnpm/vitest@3.1.
|
67
|
+
// ../../node_modules/.pnpm/vitest@3.1.3_@types+debug@4.1.12_@types+node@22.15.18_jiti@2.4.2_lightningcss@1.30.1_terser@5.39.0_tsx@4.19.4/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js
|
68
68
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
69
69
|
function getDefaultExportFromCjs(x) {
|
70
70
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
71
71
|
}
|
72
72
|
|
73
|
-
// ../../node_modules/.pnpm/vitest@3.1.
|
73
|
+
// ../../node_modules/.pnpm/vitest@3.1.3_@types+debug@4.1.12_@types+node@22.15.18_jiti@2.4.2_lightningcss@1.30.1_terser@5.39.0_tsx@4.19.4/node_modules/vitest/dist/chunks/vi.ClIskdbk.js
|
74
74
|
import { stripSnapshotIndentation, addSerializer, SnapshotClient } from "@vitest/snapshot.js";
|
75
75
|
import "@vitest/utils/error.js";
|
76
76
|
import { fn, spyOn, mocks, isMockFunction } from "@vitest/spy.js";
|
77
77
|
import { parseSingleStack } from "@vitest/utils/source-map.js";
|
78
78
|
|
79
|
-
// ../../node_modules/.pnpm/vitest@3.1.
|
79
|
+
// ../../node_modules/.pnpm/vitest@3.1.3_@types+debug@4.1.12_@types+node@22.15.18_jiti@2.4.2_lightningcss@1.30.1_terser@5.39.0_tsx@4.19.4/node_modules/vitest/dist/chunks/date.CDOsz-HY.js
|
80
80
|
var RealDate = Date;
|
81
81
|
var now = null;
|
82
82
|
var MockDate = class _MockDate extends RealDate {
|
@@ -129,7 +129,7 @@ function resetDate() {
|
|
129
129
|
globalThis.Date = RealDate;
|
130
130
|
}
|
131
131
|
|
132
|
-
// ../../node_modules/.pnpm/vitest@3.1.
|
132
|
+
// ../../node_modules/.pnpm/vitest@3.1.3_@types+debug@4.1.12_@types+node@22.15.18_jiti@2.4.2_lightningcss@1.30.1_terser@5.39.0_tsx@4.19.4/node_modules/vitest/dist/chunks/vi.ClIskdbk.js
|
133
133
|
var unsupported = [
|
134
134
|
"matchSnapshot",
|
135
135
|
"toMatchSnapshot",
|
@@ -2953,7 +2953,7 @@ function getImporter(name) {
|
|
2953
2953
|
return stack?.file || "";
|
2954
2954
|
}
|
2955
2955
|
|
2956
|
-
// ../../node_modules/.pnpm/vitest@3.1.
|
2956
|
+
// ../../node_modules/.pnpm/vitest@3.1.3_@types+debug@4.1.12_@types+node@22.15.18_jiti@2.4.2_lightningcss@1.30.1_terser@5.39.0_tsx@4.19.4/node_modules/vitest/dist/index.js
|
2957
2957
|
import { expectTypeOf } from "expect-type.js";
|
2958
2958
|
import { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from "@vitest/runner.js";
|
2959
2959
|
import * as chai2 from "chai.js";
|