@researai/deepscientist 1.5.15 → 1.5.17
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/README.md +385 -104
- package/bin/ds.js +1241 -110
- package/docs/en/00_QUICK_START.md +100 -19
- package/docs/en/01_SETTINGS_REFERENCE.md +34 -1
- package/docs/en/02_START_RESEARCH_GUIDE.md +7 -0
- package/docs/en/05_TUI_GUIDE.md +6 -0
- package/docs/en/06_RUNTIME_AND_CANVAS.md +4 -3
- package/docs/en/09_DOCTOR.md +25 -8
- package/docs/en/14_PROMPT_SKILLS_AND_MCP_GUIDE.md +63 -13
- package/docs/en/15_CODEX_PROVIDER_SETUP.md +37 -11
- package/docs/en/19_EXTERNAL_CONTROLLER_GUIDE.md +226 -0
- package/docs/en/19_LOCAL_BROWSER_AUTH.md +70 -0
- package/docs/en/20_WORKSPACE_MODES_GUIDE.md +250 -0
- package/docs/en/21_LOCAL_MODEL_BACKENDS_GUIDE.md +283 -0
- package/docs/en/91_DEVELOPMENT.md +237 -0
- package/docs/en/README.md +24 -2
- package/docs/zh/00_QUICK_START.md +89 -19
- package/docs/zh/01_SETTINGS_REFERENCE.md +34 -1
- package/docs/zh/02_START_RESEARCH_GUIDE.md +7 -0
- package/docs/zh/05_TUI_GUIDE.md +6 -0
- package/docs/zh/09_DOCTOR.md +26 -9
- package/docs/zh/14_PROMPT_SKILLS_AND_MCP_GUIDE.md +63 -13
- package/docs/zh/15_CODEX_PROVIDER_SETUP.md +37 -11
- package/docs/zh/19_EXTERNAL_CONTROLLER_GUIDE.md +226 -0
- package/docs/zh/19_LOCAL_BROWSER_AUTH.md +68 -0
- package/docs/zh/20_WORKSPACE_MODES_GUIDE.md +251 -0
- package/docs/zh/21_LOCAL_MODEL_BACKENDS_GUIDE.md +281 -0
- package/docs/zh/README.md +24 -2
- package/install.sh +46 -4
- package/package.json +2 -1
- package/pyproject.toml +1 -1
- package/src/deepscientist/__init__.py +1 -1
- package/src/deepscientist/acp/envelope.py +6 -0
- package/src/deepscientist/artifact/service.py +647 -22
- package/src/deepscientist/bash_exec/service.py +234 -9
- package/src/deepscientist/bridges/connectors.py +8 -2
- package/src/deepscientist/cli.py +115 -19
- package/src/deepscientist/codex_cli_compat.py +367 -22
- package/src/deepscientist/config/models.py +2 -1
- package/src/deepscientist/config/service.py +183 -13
- package/src/deepscientist/daemon/api/handlers.py +255 -31
- package/src/deepscientist/daemon/api/router.py +9 -0
- package/src/deepscientist/daemon/app.py +1146 -105
- package/src/deepscientist/diagnostics/__init__.py +6 -0
- package/src/deepscientist/diagnostics/runner_failures.py +130 -0
- package/src/deepscientist/doctor.py +207 -3
- package/src/deepscientist/gitops/__init__.py +10 -1
- package/src/deepscientist/gitops/diff.py +129 -0
- package/src/deepscientist/gitops/service.py +4 -1
- package/src/deepscientist/mcp/server.py +39 -0
- package/src/deepscientist/prompts/builder.py +275 -34
- package/src/deepscientist/quest/layout.py +15 -2
- package/src/deepscientist/quest/service.py +707 -55
- package/src/deepscientist/quest/stage_views.py +6 -1
- package/src/deepscientist/runners/codex.py +143 -43
- package/src/deepscientist/shared.py +19 -0
- package/src/deepscientist/skills/__init__.py +2 -2
- package/src/deepscientist/skills/installer.py +196 -5
- package/src/deepscientist/skills/registry.py +66 -0
- package/src/prompts/connectors/qq.md +18 -8
- package/src/prompts/connectors/weixin.md +16 -6
- package/src/prompts/contracts/shared_interaction.md +14 -2
- package/src/prompts/system.md +23 -5
- package/src/prompts/system_copilot.md +56 -0
- package/src/skills/analysis-campaign/SKILL.md +1 -0
- package/src/skills/baseline/SKILL.md +8 -0
- package/src/skills/decision/SKILL.md +8 -0
- package/src/skills/experiment/SKILL.md +8 -0
- package/src/skills/figure-polish/SKILL.md +1 -0
- package/src/skills/finalize/SKILL.md +1 -0
- package/src/skills/idea/SKILL.md +1 -0
- package/src/skills/intake-audit/SKILL.md +8 -0
- package/src/skills/mentor/SKILL.md +217 -0
- package/src/skills/mentor/references/correction-rules.md +210 -0
- package/src/skills/mentor/references/knowledge-profile.md +91 -0
- package/src/skills/mentor/references/persona-profile.md +138 -0
- package/src/skills/mentor/references/taste-profile.md +128 -0
- package/src/skills/mentor/references/thought-style-profile.md +138 -0
- package/src/skills/mentor/references/work-profile.md +289 -0
- package/src/skills/mentor/references/workflow-profile.md +240 -0
- package/src/skills/optimize/SKILL.md +1 -0
- package/src/skills/rebuttal/SKILL.md +1 -0
- package/src/skills/review/SKILL.md +1 -0
- package/src/skills/scout/SKILL.md +8 -0
- package/src/skills/write/SKILL.md +1 -0
- package/src/tui/dist/app/AppContainer.js +19 -11
- package/src/tui/dist/index.js +4 -1
- package/src/tui/dist/lib/api.js +33 -3
- package/src/tui/package.json +1 -1
- package/src/ui/dist/assets/AiManusChatView-Bv-Z8YpU.js +204 -0
- package/src/ui/dist/assets/AnalysisPlugin-BCKAfjba.js +1 -0
- package/src/ui/dist/assets/CliPlugin-BCKcpc35.js +109 -0
- package/src/ui/dist/assets/CodeEditorPlugin-DbOfSJ8K.js +2 -0
- package/src/ui/dist/assets/CodeViewerPlugin-CbaFRrUU.js +270 -0
- package/src/ui/dist/assets/DocViewerPlugin-DAjLVeQD.js +7 -0
- package/src/ui/dist/assets/GitCommitViewerPlugin-CIUqbUDO.js +1 -0
- package/src/ui/dist/assets/GitDiffViewerPlugin-CQACjoAA.js +6 -0
- package/src/ui/dist/assets/GitSnapshotViewer-0r4nLPke.js +30 -0
- package/src/ui/dist/assets/ImageViewerPlugin-nBOmI2v_.js +26 -0
- package/src/ui/dist/assets/LabCopilotPanel-BHxOxF4z.js +14 -0
- package/src/ui/dist/assets/LabPlugin-BKoZGs95.js +22 -0
- package/src/ui/dist/assets/LatexPlugin-ZwtV8pIp.js +25 -0
- package/src/ui/dist/assets/MarkdownViewerPlugin-DKqVfKyW.js +128 -0
- package/src/ui/dist/assets/MarketplacePlugin-BwxStZ9D.js +13 -0
- package/src/ui/dist/assets/NotebookEditor-BEQhaQbt.js +81 -0
- package/src/ui/dist/assets/{NotebookEditor-CccQYZjX.css → NotebookEditor-BHH8rdGj.css} +1 -1
- package/src/ui/dist/assets/NotebookEditor-BOr3x3Ej.css +1 -0
- package/src/ui/dist/assets/NotebookEditor-DB9N_T9q.js +361 -0
- package/src/ui/dist/assets/PdfLoader-Cy5jtWrr.css +1 -0
- package/src/ui/dist/assets/PdfLoader-eWBONbQP.js +16 -0
- package/src/ui/dist/assets/PdfMarkdownPlugin-D22YOZL3.js +1 -0
- package/src/ui/dist/assets/PdfViewerPlugin-c-RK9DLM.js +17 -0
- package/src/ui/dist/assets/PdfViewerPlugin-nwwE-fjJ.css +1 -0
- package/src/ui/dist/assets/SearchPlugin-CxF9ytAx.js +16 -0
- package/src/ui/dist/assets/SearchPlugin-DA4en4hK.css +1 -0
- package/src/ui/dist/assets/TextViewerPlugin-C5xqeeUH.js +54 -0
- package/src/ui/dist/assets/VNCViewer-BoLGLnHz.js +11 -0
- package/src/ui/dist/assets/bot-DREQOxzP.js +6 -0
- package/src/ui/dist/assets/browser-CTB2jwNe.js +8 -0
- package/src/ui/dist/assets/chevron-up-C9Qpx4DE.js +6 -0
- package/src/ui/dist/assets/code-WlFHE7z_.js +6 -0
- package/src/ui/dist/assets/file-content-BZMz3RYp.js +1 -0
- package/src/ui/dist/assets/file-diff-panel-CQhw0jS2.js +1 -0
- package/src/ui/dist/assets/file-jump-queue-DA-SdG__.js +1 -0
- package/src/ui/dist/assets/file-socket-CfQPKQKj.js +1 -0
- package/src/ui/dist/assets/git-commit-horizontal-DxZ8DCZh.js +6 -0
- package/src/ui/dist/assets/image-Bgl4VIyx.js +6 -0
- package/src/ui/dist/assets/index-BpV6lusQ.css +33 -0
- package/src/ui/dist/assets/index-CBNVuWcP.js +2496 -0
- package/src/ui/dist/assets/index-CwNu1aH4.js +11 -0
- package/src/ui/dist/assets/index-DrUnlf6K.js +1 -0
- package/src/ui/dist/assets/index-NW-h8VzN.js +1 -0
- package/src/ui/dist/assets/monaco-CiHMMNH_.js +1 -0
- package/src/ui/dist/assets/pdf-effect-queue-J8OnM0jE.js +6 -0
- package/src/ui/dist/assets/plugin-monaco-C8UgLomw.js +19 -0
- package/src/ui/dist/assets/plugin-notebook-HbW2K-1c.js +169 -0
- package/src/ui/dist/assets/plugin-pdf-CR8hgQBV.js +357 -0
- package/src/ui/dist/assets/plugin-terminal-MXFIPun8.js +227 -0
- package/src/ui/dist/assets/popover-CLc0pPP8.js +1 -0
- package/src/ui/dist/assets/project-sync-C9IdzdZW.js +1 -0
- package/src/ui/dist/assets/select-Cs2PmzwL.js +11 -0
- package/src/ui/dist/assets/sigma-ClKcHAXm.js +6 -0
- package/src/ui/dist/assets/trash-DwpbFr3w.js +11 -0
- package/src/ui/dist/assets/useCliAccess-NQ8m0Let.js +1 -0
- package/src/ui/dist/assets/useFileDiffOverlay-FuhcnKiw.js +1 -0
- package/src/ui/dist/assets/wrap-text-BC-Hltpd.js +11 -0
- package/src/ui/dist/assets/zoom-out-E_gaeAxL.js +11 -0
- package/src/ui/dist/index.html +5 -2
- package/src/ui/dist/assets/AiManusChatView-DDjbFnbt.js +0 -26597
- package/src/ui/dist/assets/AnalysisPlugin-Yb5IdmaU.js +0 -123
- package/src/ui/dist/assets/CliPlugin-e64sreyu.js +0 -31037
- package/src/ui/dist/assets/CodeEditorPlugin-C4D2TIkU.js +0 -427
- package/src/ui/dist/assets/CodeViewerPlugin-BVoNZIvC.js +0 -905
- package/src/ui/dist/assets/DocViewerPlugin-CLChbllo.js +0 -278
- package/src/ui/dist/assets/GitDiffViewerPlugin-C4xeFyFQ.js +0 -2661
- package/src/ui/dist/assets/ImageViewerPlugin-OiMUAcLi.js +0 -500
- package/src/ui/dist/assets/LabCopilotPanel-BjD2ThQF.js +0 -4104
- package/src/ui/dist/assets/LabPlugin-DQPg-NrB.js +0 -2677
- package/src/ui/dist/assets/LatexPlugin-CI05XAV9.js +0 -1792
- package/src/ui/dist/assets/MarkdownViewerPlugin-DpeBLYZf.js +0 -308
- package/src/ui/dist/assets/MarketplacePlugin-DolE58Q2.js +0 -413
- package/src/ui/dist/assets/NotebookEditor-7Qm2rSWD.js +0 -4214
- package/src/ui/dist/assets/NotebookEditor-C1kWaxKi.js +0 -84873
- package/src/ui/dist/assets/NotebookEditor-C3VQ7ylN.css +0 -1405
- package/src/ui/dist/assets/PdfLoader-BfOHw8Zw.js +0 -25468
- package/src/ui/dist/assets/PdfLoader-C-Y707R3.css +0 -49
- package/src/ui/dist/assets/PdfMarkdownPlugin-BulDREv1.js +0 -409
- package/src/ui/dist/assets/PdfViewerPlugin-C-daaOaL.js +0 -3095
- package/src/ui/dist/assets/PdfViewerPlugin-DQ11QcSf.css +0 -3627
- package/src/ui/dist/assets/SearchPlugin-CjpaiJ3A.js +0 -741
- package/src/ui/dist/assets/SearchPlugin-DDMrGDkh.css +0 -379
- package/src/ui/dist/assets/TextViewerPlugin-BxIyqPQC.js +0 -472
- package/src/ui/dist/assets/VNCViewer-HAg9mF7M.js +0 -18821
- package/src/ui/dist/assets/awareness-C0NPR2Dj.js +0 -292
- package/src/ui/dist/assets/bot-0DYntytV.js +0 -21
- package/src/ui/dist/assets/browser-BAcuE0Xj.js +0 -2895
- package/src/ui/dist/assets/code-B20Slj_w.js +0 -17
- package/src/ui/dist/assets/file-content-DT24KFma.js +0 -377
- package/src/ui/dist/assets/file-diff-panel-DK13YPql.js +0 -92
- package/src/ui/dist/assets/file-jump-queue-r5XKgJEV.js +0 -16
- package/src/ui/dist/assets/file-socket-B4T2o4nR.js +0 -58
- package/src/ui/dist/assets/function-B5QZkkHC.js +0 -1895
- package/src/ui/dist/assets/image-DSeR_sDS.js +0 -18
- package/src/ui/dist/assets/index-BrFje2Uk.js +0 -120
- package/src/ui/dist/assets/index-BwRJaoTl.js +0 -25
- package/src/ui/dist/assets/index-D_E4281X.js +0 -221322
- package/src/ui/dist/assets/index-DnYB3xb1.js +0 -159
- package/src/ui/dist/assets/index-G7AcWcMu.css +0 -12594
- package/src/ui/dist/assets/monaco-LExaAN3Y.js +0 -623
- package/src/ui/dist/assets/pdf-effect-queue-BJk5okWJ.js +0 -47
- package/src/ui/dist/assets/pdf_viewer-e0g1is2C.js +0 -8206
- package/src/ui/dist/assets/popover-D3Gg_FoV.js +0 -476
- package/src/ui/dist/assets/project-sync-C_ygLlVU.js +0 -297
- package/src/ui/dist/assets/select-CpAK6uWm.js +0 -1690
- package/src/ui/dist/assets/sigma-DEccaSgk.js +0 -22
- package/src/ui/dist/assets/square-check-big-uUfyVsbD.js +0 -17
- package/src/ui/dist/assets/trash-CXvwwSe8.js +0 -32
- package/src/ui/dist/assets/useCliAccess-Bnop4mgR.js +0 -957
- package/src/ui/dist/assets/useFileDiffOverlay-B8eUAX0I.js +0 -53
- package/src/ui/dist/assets/wrap-text-9vbOBpkW.js +0 -35
- package/src/ui/dist/assets/yjs-DncrqiZ8.js +0 -11243
- package/src/ui/dist/assets/zoom-out-BgVMmOW4.js +0 -34
|
@@ -1,476 +0,0 @@
|
|
|
1
|
-
import { r as reactExports, j as jsxRuntimeExports, aj as composeRefs, ak as useControllableState, al as Root2$1, am as useId, an as useComposedRefs, ao as composeEventHandlers, ap as Anchor, aq as createPopperScope, ar as Presence, as as Portal$1, at as hideOthers, au as ReactRemoveScroll, av as useFocusGuards, aw as FocusScope, ax as DismissableLayer, ay as Content, az as Arrow, b as cn } from './index-D_E4281X.js';
|
|
2
|
-
|
|
3
|
-
// packages/react/context/src/create-context.tsx
|
|
4
|
-
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
5
|
-
let defaultContexts = [];
|
|
6
|
-
function createContext3(rootComponentName, defaultContext) {
|
|
7
|
-
const BaseContext = reactExports.createContext(defaultContext);
|
|
8
|
-
const index = defaultContexts.length;
|
|
9
|
-
defaultContexts = [...defaultContexts, defaultContext];
|
|
10
|
-
const Provider = (props) => {
|
|
11
|
-
const { scope, children, ...context } = props;
|
|
12
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
13
|
-
const value = reactExports.useMemo(() => context, Object.values(context));
|
|
14
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Context.Provider, { value, children });
|
|
15
|
-
};
|
|
16
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
17
|
-
function useContext2(consumerName, scope) {
|
|
18
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
19
|
-
const context = reactExports.useContext(Context);
|
|
20
|
-
if (context) return context;
|
|
21
|
-
if (defaultContext !== void 0) return defaultContext;
|
|
22
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
23
|
-
}
|
|
24
|
-
return [Provider, useContext2];
|
|
25
|
-
}
|
|
26
|
-
const createScope = () => {
|
|
27
|
-
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
28
|
-
return reactExports.createContext(defaultContext);
|
|
29
|
-
});
|
|
30
|
-
return function useScope(scope) {
|
|
31
|
-
const contexts = scope?.[scopeName] || scopeContexts;
|
|
32
|
-
return reactExports.useMemo(
|
|
33
|
-
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
34
|
-
[scope, contexts]
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
createScope.scopeName = scopeName;
|
|
39
|
-
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
40
|
-
}
|
|
41
|
-
function composeContextScopes(...scopes) {
|
|
42
|
-
const baseScope = scopes[0];
|
|
43
|
-
if (scopes.length === 1) return baseScope;
|
|
44
|
-
const createScope = () => {
|
|
45
|
-
const scopeHooks = scopes.map((createScope2) => ({
|
|
46
|
-
useScope: createScope2(),
|
|
47
|
-
scopeName: createScope2.scopeName
|
|
48
|
-
}));
|
|
49
|
-
return function useComposedScopes(overrideScopes) {
|
|
50
|
-
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
51
|
-
const scopeProps = useScope(overrideScopes);
|
|
52
|
-
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
53
|
-
return { ...nextScopes2, ...currentScope };
|
|
54
|
-
}, {});
|
|
55
|
-
return reactExports.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
createScope.scopeName = baseScope.scopeName;
|
|
59
|
-
return createScope;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// src/slot.tsx
|
|
63
|
-
// @__NO_SIDE_EFFECTS__
|
|
64
|
-
function createSlot(ownerName) {
|
|
65
|
-
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
66
|
-
const Slot2 = reactExports.forwardRef((props, forwardedRef) => {
|
|
67
|
-
const { children, ...slotProps } = props;
|
|
68
|
-
const childrenArray = reactExports.Children.toArray(children);
|
|
69
|
-
const slottable = childrenArray.find(isSlottable);
|
|
70
|
-
if (slottable) {
|
|
71
|
-
const newElement = slottable.props.children;
|
|
72
|
-
const newChildren = childrenArray.map((child) => {
|
|
73
|
-
if (child === slottable) {
|
|
74
|
-
if (reactExports.Children.count(newElement) > 1) return reactExports.Children.only(null);
|
|
75
|
-
return reactExports.isValidElement(newElement) ? newElement.props.children : null;
|
|
76
|
-
} else {
|
|
77
|
-
return child;
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: reactExports.isValidElement(newElement) ? reactExports.cloneElement(newElement, void 0, newChildren) : null });
|
|
81
|
-
}
|
|
82
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
83
|
-
});
|
|
84
|
-
Slot2.displayName = `${ownerName}.Slot`;
|
|
85
|
-
return Slot2;
|
|
86
|
-
}
|
|
87
|
-
// @__NO_SIDE_EFFECTS__
|
|
88
|
-
function createSlotClone(ownerName) {
|
|
89
|
-
const SlotClone = reactExports.forwardRef((props, forwardedRef) => {
|
|
90
|
-
const { children, ...slotProps } = props;
|
|
91
|
-
if (reactExports.isValidElement(children)) {
|
|
92
|
-
const childrenRef = getElementRef(children);
|
|
93
|
-
const props2 = mergeProps(slotProps, children.props);
|
|
94
|
-
if (children.type !== reactExports.Fragment) {
|
|
95
|
-
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
96
|
-
}
|
|
97
|
-
return reactExports.cloneElement(children, props2);
|
|
98
|
-
}
|
|
99
|
-
return reactExports.Children.count(children) > 1 ? reactExports.Children.only(null) : null;
|
|
100
|
-
});
|
|
101
|
-
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
102
|
-
return SlotClone;
|
|
103
|
-
}
|
|
104
|
-
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
105
|
-
function isSlottable(child) {
|
|
106
|
-
return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
107
|
-
}
|
|
108
|
-
function mergeProps(slotProps, childProps) {
|
|
109
|
-
const overrideProps = { ...childProps };
|
|
110
|
-
for (const propName in childProps) {
|
|
111
|
-
const slotPropValue = slotProps[propName];
|
|
112
|
-
const childPropValue = childProps[propName];
|
|
113
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
114
|
-
if (isHandler) {
|
|
115
|
-
if (slotPropValue && childPropValue) {
|
|
116
|
-
overrideProps[propName] = (...args) => {
|
|
117
|
-
const result = childPropValue(...args);
|
|
118
|
-
slotPropValue(...args);
|
|
119
|
-
return result;
|
|
120
|
-
};
|
|
121
|
-
} else if (slotPropValue) {
|
|
122
|
-
overrideProps[propName] = slotPropValue;
|
|
123
|
-
}
|
|
124
|
-
} else if (propName === "style") {
|
|
125
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
126
|
-
} else if (propName === "className") {
|
|
127
|
-
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return { ...slotProps, ...overrideProps };
|
|
131
|
-
}
|
|
132
|
-
function getElementRef(element) {
|
|
133
|
-
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
134
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
135
|
-
if (mayWarn) {
|
|
136
|
-
return element.ref;
|
|
137
|
-
}
|
|
138
|
-
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
139
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
140
|
-
if (mayWarn) {
|
|
141
|
-
return element.props.ref;
|
|
142
|
-
}
|
|
143
|
-
return element.props.ref || element.ref;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// src/primitive.tsx
|
|
147
|
-
var NODES = [
|
|
148
|
-
"a",
|
|
149
|
-
"button",
|
|
150
|
-
"div",
|
|
151
|
-
"form",
|
|
152
|
-
"h2",
|
|
153
|
-
"h3",
|
|
154
|
-
"img",
|
|
155
|
-
"input",
|
|
156
|
-
"label",
|
|
157
|
-
"li",
|
|
158
|
-
"nav",
|
|
159
|
-
"ol",
|
|
160
|
-
"p",
|
|
161
|
-
"select",
|
|
162
|
-
"span",
|
|
163
|
-
"svg",
|
|
164
|
-
"ul"
|
|
165
|
-
];
|
|
166
|
-
var Primitive = NODES.reduce((primitive, node) => {
|
|
167
|
-
const Slot = createSlot(`Primitive.${node}`);
|
|
168
|
-
const Node = reactExports.forwardRef((props, forwardedRef) => {
|
|
169
|
-
const { asChild, ...primitiveProps } = props;
|
|
170
|
-
const Comp = asChild ? Slot : node;
|
|
171
|
-
if (typeof window !== "undefined") {
|
|
172
|
-
window[Symbol.for("radix-ui")] = true;
|
|
173
|
-
}
|
|
174
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
175
|
-
});
|
|
176
|
-
Node.displayName = `Primitive.${node}`;
|
|
177
|
-
return { ...primitive, [node]: Node };
|
|
178
|
-
}, {});
|
|
179
|
-
|
|
180
|
-
var POPOVER_NAME = "Popover";
|
|
181
|
-
var [createPopoverContext] = createContextScope(POPOVER_NAME, [
|
|
182
|
-
createPopperScope
|
|
183
|
-
]);
|
|
184
|
-
var usePopperScope = createPopperScope();
|
|
185
|
-
var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
|
|
186
|
-
var Popover$1 = (props) => {
|
|
187
|
-
const {
|
|
188
|
-
__scopePopover,
|
|
189
|
-
children,
|
|
190
|
-
open: openProp,
|
|
191
|
-
defaultOpen,
|
|
192
|
-
onOpenChange,
|
|
193
|
-
modal = false
|
|
194
|
-
} = props;
|
|
195
|
-
const popperScope = usePopperScope(__scopePopover);
|
|
196
|
-
const triggerRef = reactExports.useRef(null);
|
|
197
|
-
const [hasCustomAnchor, setHasCustomAnchor] = reactExports.useState(false);
|
|
198
|
-
const [open, setOpen] = useControllableState({
|
|
199
|
-
prop: openProp,
|
|
200
|
-
defaultProp: defaultOpen ?? false,
|
|
201
|
-
onChange: onOpenChange,
|
|
202
|
-
caller: POPOVER_NAME
|
|
203
|
-
});
|
|
204
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Root2$1, { ...popperScope, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
205
|
-
PopoverProvider,
|
|
206
|
-
{
|
|
207
|
-
scope: __scopePopover,
|
|
208
|
-
contentId: useId(),
|
|
209
|
-
triggerRef,
|
|
210
|
-
open,
|
|
211
|
-
onOpenChange: setOpen,
|
|
212
|
-
onOpenToggle: reactExports.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
213
|
-
hasCustomAnchor,
|
|
214
|
-
onCustomAnchorAdd: reactExports.useCallback(() => setHasCustomAnchor(true), []),
|
|
215
|
-
onCustomAnchorRemove: reactExports.useCallback(() => setHasCustomAnchor(false), []),
|
|
216
|
-
modal,
|
|
217
|
-
children
|
|
218
|
-
}
|
|
219
|
-
) });
|
|
220
|
-
};
|
|
221
|
-
Popover$1.displayName = POPOVER_NAME;
|
|
222
|
-
var ANCHOR_NAME = "PopoverAnchor";
|
|
223
|
-
var PopoverAnchor = reactExports.forwardRef(
|
|
224
|
-
(props, forwardedRef) => {
|
|
225
|
-
const { __scopePopover, ...anchorProps } = props;
|
|
226
|
-
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
227
|
-
const popperScope = usePopperScope(__scopePopover);
|
|
228
|
-
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
229
|
-
reactExports.useEffect(() => {
|
|
230
|
-
onCustomAnchorAdd();
|
|
231
|
-
return () => onCustomAnchorRemove();
|
|
232
|
-
}, [onCustomAnchorAdd, onCustomAnchorRemove]);
|
|
233
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
|
|
234
|
-
}
|
|
235
|
-
);
|
|
236
|
-
PopoverAnchor.displayName = ANCHOR_NAME;
|
|
237
|
-
var TRIGGER_NAME = "PopoverTrigger";
|
|
238
|
-
var PopoverTrigger$1 = reactExports.forwardRef(
|
|
239
|
-
(props, forwardedRef) => {
|
|
240
|
-
const { __scopePopover, ...triggerProps } = props;
|
|
241
|
-
const context = usePopoverContext(TRIGGER_NAME, __scopePopover);
|
|
242
|
-
const popperScope = usePopperScope(__scopePopover);
|
|
243
|
-
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
244
|
-
const trigger = /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
245
|
-
Primitive.button,
|
|
246
|
-
{
|
|
247
|
-
type: "button",
|
|
248
|
-
"aria-haspopup": "dialog",
|
|
249
|
-
"aria-expanded": context.open,
|
|
250
|
-
"aria-controls": context.contentId,
|
|
251
|
-
"data-state": getState(context.open),
|
|
252
|
-
...triggerProps,
|
|
253
|
-
ref: composedTriggerRef,
|
|
254
|
-
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
255
|
-
}
|
|
256
|
-
);
|
|
257
|
-
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsxRuntimeExports.jsx(Anchor, { asChild: true, ...popperScope, children: trigger });
|
|
258
|
-
}
|
|
259
|
-
);
|
|
260
|
-
PopoverTrigger$1.displayName = TRIGGER_NAME;
|
|
261
|
-
var PORTAL_NAME = "PopoverPortal";
|
|
262
|
-
var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {
|
|
263
|
-
forceMount: void 0
|
|
264
|
-
});
|
|
265
|
-
var PopoverPortal = (props) => {
|
|
266
|
-
const { __scopePopover, forceMount, children, container } = props;
|
|
267
|
-
const context = usePopoverContext(PORTAL_NAME, __scopePopover);
|
|
268
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Portal$1, { asChild: true, container, children }) }) });
|
|
269
|
-
};
|
|
270
|
-
PopoverPortal.displayName = PORTAL_NAME;
|
|
271
|
-
var CONTENT_NAME = "PopoverContent";
|
|
272
|
-
var PopoverContent$1 = reactExports.forwardRef(
|
|
273
|
-
(props, forwardedRef) => {
|
|
274
|
-
const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);
|
|
275
|
-
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
276
|
-
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
277
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsxRuntimeExports.jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsxRuntimeExports.jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
|
278
|
-
}
|
|
279
|
-
);
|
|
280
|
-
PopoverContent$1.displayName = CONTENT_NAME;
|
|
281
|
-
var Slot = createSlot("PopoverContent.RemoveScroll");
|
|
282
|
-
var PopoverContentModal = reactExports.forwardRef(
|
|
283
|
-
(props, forwardedRef) => {
|
|
284
|
-
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
285
|
-
const contentRef = reactExports.useRef(null);
|
|
286
|
-
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
287
|
-
const isRightClickOutsideRef = reactExports.useRef(false);
|
|
288
|
-
reactExports.useEffect(() => {
|
|
289
|
-
const content = contentRef.current;
|
|
290
|
-
if (content) return hideOthers(content);
|
|
291
|
-
}, []);
|
|
292
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
293
|
-
PopoverContentImpl,
|
|
294
|
-
{
|
|
295
|
-
...props,
|
|
296
|
-
ref: composedRefs,
|
|
297
|
-
trapFocus: context.open,
|
|
298
|
-
disableOutsidePointerEvents: true,
|
|
299
|
-
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
300
|
-
event.preventDefault();
|
|
301
|
-
if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();
|
|
302
|
-
}),
|
|
303
|
-
onPointerDownOutside: composeEventHandlers(
|
|
304
|
-
props.onPointerDownOutside,
|
|
305
|
-
(event) => {
|
|
306
|
-
const originalEvent = event.detail.originalEvent;
|
|
307
|
-
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
308
|
-
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
309
|
-
isRightClickOutsideRef.current = isRightClick;
|
|
310
|
-
},
|
|
311
|
-
{ checkForDefaultPrevented: false }
|
|
312
|
-
),
|
|
313
|
-
onFocusOutside: composeEventHandlers(
|
|
314
|
-
props.onFocusOutside,
|
|
315
|
-
(event) => event.preventDefault(),
|
|
316
|
-
{ checkForDefaultPrevented: false }
|
|
317
|
-
)
|
|
318
|
-
}
|
|
319
|
-
) });
|
|
320
|
-
}
|
|
321
|
-
);
|
|
322
|
-
var PopoverContentNonModal = reactExports.forwardRef(
|
|
323
|
-
(props, forwardedRef) => {
|
|
324
|
-
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
325
|
-
const hasInteractedOutsideRef = reactExports.useRef(false);
|
|
326
|
-
const hasPointerDownOutsideRef = reactExports.useRef(false);
|
|
327
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
328
|
-
PopoverContentImpl,
|
|
329
|
-
{
|
|
330
|
-
...props,
|
|
331
|
-
ref: forwardedRef,
|
|
332
|
-
trapFocus: false,
|
|
333
|
-
disableOutsidePointerEvents: false,
|
|
334
|
-
onCloseAutoFocus: (event) => {
|
|
335
|
-
props.onCloseAutoFocus?.(event);
|
|
336
|
-
if (!event.defaultPrevented) {
|
|
337
|
-
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
338
|
-
event.preventDefault();
|
|
339
|
-
}
|
|
340
|
-
hasInteractedOutsideRef.current = false;
|
|
341
|
-
hasPointerDownOutsideRef.current = false;
|
|
342
|
-
},
|
|
343
|
-
onInteractOutside: (event) => {
|
|
344
|
-
props.onInteractOutside?.(event);
|
|
345
|
-
if (!event.defaultPrevented) {
|
|
346
|
-
hasInteractedOutsideRef.current = true;
|
|
347
|
-
if (event.detail.originalEvent.type === "pointerdown") {
|
|
348
|
-
hasPointerDownOutsideRef.current = true;
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
const target = event.target;
|
|
352
|
-
const targetIsTrigger = context.triggerRef.current?.contains(target);
|
|
353
|
-
if (targetIsTrigger) event.preventDefault();
|
|
354
|
-
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
|
|
355
|
-
event.preventDefault();
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
);
|
|
360
|
-
}
|
|
361
|
-
);
|
|
362
|
-
var PopoverContentImpl = reactExports.forwardRef(
|
|
363
|
-
(props, forwardedRef) => {
|
|
364
|
-
const {
|
|
365
|
-
__scopePopover,
|
|
366
|
-
trapFocus,
|
|
367
|
-
onOpenAutoFocus,
|
|
368
|
-
onCloseAutoFocus,
|
|
369
|
-
disableOutsidePointerEvents,
|
|
370
|
-
onEscapeKeyDown,
|
|
371
|
-
onPointerDownOutside,
|
|
372
|
-
onFocusOutside,
|
|
373
|
-
onInteractOutside,
|
|
374
|
-
...contentProps
|
|
375
|
-
} = props;
|
|
376
|
-
const context = usePopoverContext(CONTENT_NAME, __scopePopover);
|
|
377
|
-
const popperScope = usePopperScope(__scopePopover);
|
|
378
|
-
useFocusGuards();
|
|
379
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
380
|
-
FocusScope,
|
|
381
|
-
{
|
|
382
|
-
asChild: true,
|
|
383
|
-
loop: true,
|
|
384
|
-
trapped: trapFocus,
|
|
385
|
-
onMountAutoFocus: onOpenAutoFocus,
|
|
386
|
-
onUnmountAutoFocus: onCloseAutoFocus,
|
|
387
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
388
|
-
DismissableLayer,
|
|
389
|
-
{
|
|
390
|
-
asChild: true,
|
|
391
|
-
disableOutsidePointerEvents,
|
|
392
|
-
onInteractOutside,
|
|
393
|
-
onEscapeKeyDown,
|
|
394
|
-
onPointerDownOutside,
|
|
395
|
-
onFocusOutside,
|
|
396
|
-
onDismiss: () => context.onOpenChange(false),
|
|
397
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
398
|
-
Content,
|
|
399
|
-
{
|
|
400
|
-
"data-state": getState(context.open),
|
|
401
|
-
role: "dialog",
|
|
402
|
-
id: context.contentId,
|
|
403
|
-
...popperScope,
|
|
404
|
-
...contentProps,
|
|
405
|
-
ref: forwardedRef,
|
|
406
|
-
style: {
|
|
407
|
-
...contentProps.style,
|
|
408
|
-
// re-namespace exposed content custom properties
|
|
409
|
-
...{
|
|
410
|
-
"--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
411
|
-
"--radix-popover-content-available-width": "var(--radix-popper-available-width)",
|
|
412
|
-
"--radix-popover-content-available-height": "var(--radix-popper-available-height)",
|
|
413
|
-
"--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
|
|
414
|
-
"--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
)
|
|
419
|
-
}
|
|
420
|
-
)
|
|
421
|
-
}
|
|
422
|
-
);
|
|
423
|
-
}
|
|
424
|
-
);
|
|
425
|
-
var CLOSE_NAME = "PopoverClose";
|
|
426
|
-
var PopoverClose = reactExports.forwardRef(
|
|
427
|
-
(props, forwardedRef) => {
|
|
428
|
-
const { __scopePopover, ...closeProps } = props;
|
|
429
|
-
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
430
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
431
|
-
Primitive.button,
|
|
432
|
-
{
|
|
433
|
-
type: "button",
|
|
434
|
-
...closeProps,
|
|
435
|
-
ref: forwardedRef,
|
|
436
|
-
onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
|
|
437
|
-
}
|
|
438
|
-
);
|
|
439
|
-
}
|
|
440
|
-
);
|
|
441
|
-
PopoverClose.displayName = CLOSE_NAME;
|
|
442
|
-
var ARROW_NAME = "PopoverArrow";
|
|
443
|
-
var PopoverArrow = reactExports.forwardRef(
|
|
444
|
-
(props, forwardedRef) => {
|
|
445
|
-
const { __scopePopover, ...arrowProps } = props;
|
|
446
|
-
const popperScope = usePopperScope(__scopePopover);
|
|
447
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
448
|
-
}
|
|
449
|
-
);
|
|
450
|
-
PopoverArrow.displayName = ARROW_NAME;
|
|
451
|
-
function getState(open) {
|
|
452
|
-
return open ? "open" : "closed";
|
|
453
|
-
}
|
|
454
|
-
var Root2 = Popover$1;
|
|
455
|
-
var Trigger = PopoverTrigger$1;
|
|
456
|
-
var Portal = PopoverPortal;
|
|
457
|
-
var Content2 = PopoverContent$1;
|
|
458
|
-
|
|
459
|
-
const Popover = Root2;
|
|
460
|
-
const PopoverTrigger = Trigger;
|
|
461
|
-
const PopoverContent = reactExports.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx(Portal, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
462
|
-
Content2,
|
|
463
|
-
{
|
|
464
|
-
ref,
|
|
465
|
-
align,
|
|
466
|
-
sideOffset,
|
|
467
|
-
className: cn(
|
|
468
|
-
"z-[10002] w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
469
|
-
className
|
|
470
|
-
),
|
|
471
|
-
...props
|
|
472
|
-
}
|
|
473
|
-
) }));
|
|
474
|
-
PopoverContent.displayName = Content2.displayName;
|
|
475
|
-
|
|
476
|
-
export { Popover as P, PopoverTrigger as a, PopoverContent as b };
|