@uniqbit/mate-core 1.0.0-canary.9 → 1.0.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/claude-capability-plugins/companion-mentions/.claude-plugin/plugin.json +1 -1
- package/package.json +5 -4
- package/src/cli/commands/artifact/delivery/link.ts +1 -1
- package/src/cli/commands/artifact/delivery/output.ts +10 -1
- package/src/cli/commands/artifact/delivery/resolve.ts +3 -2
- package/src/cli/commands/artifact/delivery/submit.ts +9 -4
- package/src/cli/commands/artifact/delivery/take.ts +12 -9
- package/src/cli/commands/artifact/finish/command.ts +16 -14
- package/src/cli/commands/artifact/finish/engine.ts +8 -8
- package/src/cli/commands/artifact/project/command.ts +2 -3
- package/src/cli/commands/companion/hub.ts +11 -6
- package/src/cli/commands/companion/link.ts +173 -46
- package/src/cli/commands/report/contract.ts +0 -17
- package/src/cli/commands/studio/access.ts +4 -0
- package/src/cli/commands/studio/actions.ts +35 -2
- package/src/cli/commands/studio/mcp-manager.ts +162 -0
- package/src/cli/commands/studio/routes.ts +12 -0
- package/src/cli/commands/studio/selection.ts +44 -11
- package/src/cli/commands/studio/server.ts +246 -2
- package/src/cli/commands/studio/services.ts +26 -0
- package/src/cli/commands/studio/terminal-launch.ts +21 -4
- package/src/cli/commands/studio/terminal.ts +3 -14
- package/src/cli/commands/studio/work-requests.ts +9 -0
- package/src/cli/commands/studio/work.ts +473 -0
- package/src/cli/commands/vscode/release-vsix.json +2 -2
- package/src/cli/commands/working/cleanup.ts +1 -18
- package/src/cli/companion-link-wizard.tsx +158 -91
- package/src/cli/usage.ts +1 -1
- package/src/lib/agent-credential.ts +131 -0
- package/src/lib/credential-kinds.ts +7 -0
- package/src/lib/delivery/merge-git.ts +16 -0
- package/src/lib/delivery/record-delivery.ts +12 -6
- package/src/lib/delivery/record.ts +5 -0
- package/src/lib/delivery/refresh.ts +34 -6
- package/src/lib/delivery/staging/refs.ts +9 -4
- package/src/lib/delivery/staging/submit.ts +81 -22
- package/src/lib/mcp-manager/resolve.ts +27 -9
- package/src/lib/mcp-manager/store.ts +35 -11
- package/src/lib/mcp-manager/types.ts +14 -0
- package/src/lib/mcp-manager/validate.ts +6 -10
- package/src/lib/opencode-server.ts +2 -17
- package/src/lib/orchestrator/repo-local-store.ts +14 -0
- package/src/lib/orchestrator/repository-link.ts +80 -52
- package/src/lib/orchestrator/root-context.ts +17 -1
- package/src/lib/studio-chat/agent.ts +139 -0
- package/src/lib/studio-chat/companion-context.ts +136 -0
- package/src/lib/studio-chat/credential.ts +79 -0
- package/src/lib/studio-chat/harness-chat-agent.ts +334 -0
- package/src/lib/studio-chat/host-sandbox.ts +578 -0
- package/src/lib/studio-chat/prepare-bridges.ts +95 -0
- package/src/lib/studio-chat/session.ts +15 -0
- package/src/lib/studio-chat/turns.ts +112 -0
- package/src/lib/workset/claims.ts +85 -0
- package/src/lib/workset/execution.ts +71 -0
- package/src/lib/workset/git-transaction.ts +74 -0
- package/src/lib/workset/groups.ts +176 -0
- package/src/lib/workset/inventory.ts +196 -0
- package/src/lib/workset/projection.ts +237 -0
- package/src/lib/workset/record.ts +101 -36
- package/src/lib/workset/repositories.ts +24 -0
- package/src/lib/workset/sharing.ts +951 -0
- package/src/lib/workset/stages.ts +50 -14
- package/src/lib/workset/transactions.ts +158 -0
- package/src/runtime/companion-git-state.ts +1 -0
- package/src/runtime/companion-guidance.ts +2 -2
- package/src/runtime/forge-remote.ts +6 -0
- package/src/runtime/host-process.ts +28 -0
- package/src/runtime/secret-guard.ts +18 -1
- package/src/runtime/secret-patterns.ts +4 -3
- package/src/runtime/submitted-arrivals.ts +28 -2
- package/src/runtime/write-atomic.ts +2 -2
- package/src/studio.ts +52 -8
- package/src/templates/capabilities/openspec-cap/mate-full/schema.yaml +1 -1
- package/src/templates/capabilities/openspec-cap/mate-full/templates/proposal.md +1 -1
- package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +3 -2
- package/src/templates/mate-skills/agents/mate-submit-change/SKILL.md +5 -3
- package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +3 -2
- package/src/templates/mate-skills/claude/mate-submit-change/SKILL.md +5 -3
- package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +12 -12
- package/src/tools/setup/capabilities/mcp-manager.ts +1 -2
- package/src/tools/setup/dynamic-plugins/declarations.ts +0 -26
- package/src/tools/setup/plugins/gitignore.ts +1 -0
- package/src/tools/setup/providers/claude-format.ts +1 -5
- package/src/tools/setup/providers/claude.ts +28 -3
- package/src/tools/setup/providers/opencode.ts +7 -18
- package/src/tools/setup/providers/relative-path-warnings.ts +26 -0
- package/studio-dist/THIRD-PARTY-NOTICES.md +297 -0
- package/studio-dist/client/THIRD-PARTY-LICENSES.md +4294 -0
- package/studio-dist/client/assets/DialogTitle-DOhjDa7H.js +1 -0
- package/studio-dist/client/assets/app-CG3vCgyA.css +2 -0
- package/studio-dist/client/assets/bundle-mjs-CdK3cBzO.js +1 -0
- package/studio-dist/client/assets/button-upSzkd-q.js +1 -0
- package/studio-dist/client/assets/chat-DbaMXb8H.js +157 -0
- package/studio-dist/client/assets/cn-BCnYnarL.js +1 -0
- package/studio-dist/client/assets/combobox-cP9OsRf2.js +1 -0
- package/studio-dist/client/assets/{companion-view-C1F0_jbt.js → companion-view-B54_Lj0S.js} +1 -1
- package/studio-dist/client/assets/fields-DNZ4a89M.js +1 -0
- package/studio-dist/client/assets/friction-DgEimeDB.js +1 -0
- package/studio-dist/client/assets/getting-started-BTfYCt5s.js +1 -0
- package/studio-dist/client/assets/{getting-started-BN4aTpsz.js → getting-started-CAszmdDJ.js} +1 -1
- package/studio-dist/client/assets/getting-started._topic-CHJMf0pa.js +1 -0
- package/studio-dist/client/assets/getting-started.index-MR6HftWs.js +1 -0
- package/studio-dist/client/assets/{graph-canvas-Be5qgdDt.js → graph-canvas-BdNk2F9O.js} +1 -1
- package/studio-dist/client/assets/graph-hRijsC89.js +2 -0
- package/studio-dist/client/assets/guides-CwFnh08E.js +1 -0
- package/studio-dist/client/assets/highlighted-body-JLMTFACH-BcroQey-.js +1 -0
- package/studio-dist/client/assets/index-D5oGyvG8.js +41 -0
- package/studio-dist/client/assets/{markdown-view-dku7MGPn.js → markdown-view-CJ8JsLb7.js} +1 -1
- package/studio-dist/client/assets/marked.esm-vFuq1cCd.js +65 -0
- package/studio-dist/client/assets/mcp-BE9M-bkO.js +4 -0
- package/studio-dist/client/assets/mermaid-WFAXDIZX-BjSsakrn.js +1 -0
- package/studio-dist/client/assets/panel-CDQ6Lryw.js +1 -0
- package/studio-dist/client/assets/plugins._service._view-DRVPUAWN.js +1 -0
- package/studio-dist/client/assets/{prepaint-BkoDSw5X.js → prepaint-sD_LlrDN.js} +1 -1
- package/studio-dist/client/assets/{queries-CMvC2OkU.js → queries-COL925ML.js} +1 -1
- package/studio-dist/client/assets/react-dom-K3Hp2Cdj.js +1 -0
- package/studio-dist/client/assets/{react-BYUSgtBs.js → react-h2xQ_NSp.js} +1 -1
- package/studio-dist/client/assets/reports-BClsojkb.js +1 -0
- package/studio-dist/client/assets/routes-CJQ2MAej.js +1 -0
- package/studio-dist/client/assets/search-DhWdEiKT.js +1 -0
- package/studio-dist/client/assets/select-B2FsN9FY.js +1 -0
- package/studio-dist/client/assets/skills-SoUHk77W.js +1 -0
- package/studio-dist/client/assets/{specs-Bqd1ajyD.js → specs-C_tZnAvF.js} +1 -1
- package/studio-dist/client/assets/specs-view-C6t3Y5IT.js +1 -0
- package/studio-dist/client/assets/steps-CF3-Zpmh.js +1 -0
- package/studio-dist/client/assets/{store-BYnEU33C.js → store-pY9gU4uS.js} +1 -1
- package/studio-dist/client/assets/studio-X7bnFrRe.js +36 -0
- package/studio-dist/client/assets/studio-queries-CKtAnIKP.js +2 -0
- package/studio-dist/client/assets/usage-BaaqUpTG.js +55 -0
- package/studio-dist/client/assets/useAnchoredPopupScrollLock-BspHR7Wt.js +1 -0
- package/studio-dist/client/assets/useBlocker-BQOfcu_f.js +1 -0
- package/studio-dist/client/assets/useMutation-DKeEoP5S.js +1 -0
- package/studio-dist/client/assets/useOpenInteractionType-CtaZCaFT.js +1 -0
- package/studio-dist/client/assets/usePopupHandleStore-Bc7Q4bnF.js +1 -0
- package/studio-dist/client/assets/vault-sAPFUnPN.js +1 -0
- package/studio-dist/client/assets/{warnings-Cnw99ugO.js → warnings-D7YY1HSG.js} +1 -1
- package/studio-dist/client/assets/work-BZek_LGB.js +5 -0
- package/studio-dist/client/assets/workflow-N5boHXFz.js +1 -0
- package/studio-dist/server/THIRD-PARTY-LICENSES.md +4371 -0
- package/studio-dist/server/assets/DialogTitle-DnKSl2V0.js +421 -0
- package/studio-dist/server/assets/{__23tanstack-start-server-fn-resolver-CS3QRY4Q.js → __23tanstack-start-server-fn-resolver-Bli9bpSB.js} +38 -18
- package/studio-dist/server/assets/_tanstack-start-manifest_v.js +91 -59
- package/studio-dist/server/assets/{actions-D8erOphH.js → actions-CHEFA1i9.js} +33 -1
- package/studio-dist/server/assets/{cn-DWFJaP_9.js → bundle-mjs-Ot6dQ8Pq.js} +1 -2056
- package/studio-dist/server/assets/{button-Ct_WeYLc.js → button-BqA1urbl.js} +14 -7
- package/studio-dist/server/assets/chat-zl332Tvu.js +49486 -0
- package/studio-dist/server/assets/cn-B0fl6NWK.js +2057 -0
- package/studio-dist/server/assets/{combobox-17vO5Uz8.js → combobox-iTjvPCtS.js} +7 -6
- package/studio-dist/server/assets/{companion-view-JkxnGLlp.js → companion-view-DIQ6AFIY.js} +2 -2
- package/studio-dist/server/assets/{companions-YNLsbnch.js → companions-aVwjRL8j.js} +1 -1
- package/studio-dist/server/assets/{fields-VytPpqBq.js → fields-BMap2_Ju.js} +10 -3
- package/studio-dist/server/assets/{friction-BW86PCPM.js → friction-BER50hoD.js} +2 -2
- package/studio-dist/server/assets/{friction-B6osqFSm.js → friction-BPs9KWdq.js} +8 -8
- package/studio-dist/server/assets/{getting-started-CFHSeX5h.js → getting-started-DGfRVmZ_.js} +2 -2
- package/studio-dist/server/assets/{getting-started._topic-BK2eU6AS.js → getting-started._topic-BgrBA4Vj.js} +2 -2
- package/studio-dist/server/assets/{getting-started.index-DZLuXnNO.js → getting-started.index-BaFfQ9Mn.js} +2 -2
- package/studio-dist/server/assets/{graph-BJVZBevL.js → graph-Cgzlrv3P.js} +8 -8
- package/studio-dist/server/assets/{graph-DGZHV-Ek.js → graph-DODpuOy_.js} +1 -1
- package/studio-dist/server/assets/{graph-canvas-lrNT6jbl.js → graph-canvas-DW_zU1nA.js} +2 -2
- package/studio-dist/server/assets/{guides-_G8Vucsk.js → guides-CA_EMG7E.js} +1 -1
- package/studio-dist/server/assets/{guides-CEwLOZb9.js → guides-D0SpoD32.js} +1 -1
- package/studio-dist/server/assets/{guides.server-ZWFKX2XJ.js → guides.server-DJjQuy03.js} +1 -1
- package/studio-dist/server/assets/highlighted-body-JLMTFACH-BeHllu-r.js +41 -0
- package/studio-dist/server/assets/{markdown-view-Bmjghg_Z.js → markdown-view-CvVBGMZV.js} +1 -1
- package/studio-dist/server/assets/mcp-BU0fLYyJ.js +1103 -0
- package/studio-dist/server/assets/mcp-manager-D9YctTQe.js +50 -0
- package/studio-dist/server/assets/mermaid-WFAXDIZX-B1yDN6vG.js +1 -0
- package/studio-dist/server/assets/{panel-DvRjyil3.js → panel-D1K6Bsux.js} +4 -32
- package/studio-dist/server/assets/{plugins._service._view-B32LzraG.js → plugins._service._view-DdO1nELF.js} +4 -4
- package/studio-dist/server/assets/{prepaint-BEHwKl51.js → prepaint-BB3dwSmz.js} +1 -1
- package/studio-dist/server/assets/{queries-D6Vq0AuZ.js → queries-BwiDxQy5.js} +1 -1
- package/studio-dist/server/assets/{react-CiBZPDs8.js → react-B2cLiz-i.js} +1 -1
- package/studio-dist/server/assets/{reports-Dn92pLap.js → reports-9Pr7Bz6o.js} +7 -7
- package/studio-dist/server/assets/{reports-DDaH5k0H.js → reports-Cc9M3phM.js} +1 -1
- package/studio-dist/server/assets/{router-Bjf4S9tO.js → router-DcWe0J7Y.js} +827 -548
- package/studio-dist/server/assets/{routes-B4sNiE0X.js → routes-BEXxl0py.js} +8 -8
- package/studio-dist/server/assets/{search-DKeJRvg8.js → search-bltT7gwy.js} +39 -7
- package/studio-dist/server/assets/{select-CVHYL7oR.js → select-CZvHgGCi.js} +7 -6
- package/studio-dist/server/assets/{shell-BxbYYaAk.js → shell-BQ0vMKXN.js} +13 -4
- package/studio-dist/server/assets/{skills-Bj8eOgzR.js → skills-Be_52h0i.js} +1 -1
- package/studio-dist/server/assets/{skills-B4-0qpqN.js → skills-BpGGUl6L.js} +8 -8
- package/studio-dist/server/assets/{specs-rfMug6qW.js → specs-CCGgXE-V.js} +5 -5
- package/studio-dist/server/assets/{specs-view-qi1SE1Sl.js → specs-view-DtL5JxYM.js} +12 -11
- package/studio-dist/server/assets/{steps-rger6HJc.js → steps-BWFSO6dM.js} +1 -1
- package/studio-dist/server/assets/{store-Dg9T7oWs.js → store-X7yLPp7v.js} +1 -1
- package/studio-dist/server/assets/{studio-queries-CeFfmIuM.js → studio-queries-ur1ygXi3.js} +117 -13
- package/studio-dist/server/assets/{studio-D79JzDLc.js → studio-qzH-UETC.js} +209 -180
- package/studio-dist/server/assets/{usage-Dw_UQFX-.js → usage-C1o0DLzS.js} +1 -1
- package/studio-dist/server/assets/{usage-BJgYWRCX.js → usage-DWbSPrPD.js} +10 -9
- package/studio-dist/server/assets/{useAnchoredPopupScrollLock-ciS_sEq3.js → useAnchoredPopupScrollLock-DLDmv6kM.js} +4 -135
- package/studio-dist/server/assets/useBlocker-CQtANHK8.js +111 -0
- package/studio-dist/server/assets/{useMutation-DnWK0PhO.js → useMutation-NjlA8oFY.js} +2 -2
- package/studio-dist/server/assets/useOpenInteractionType-CZYscfOb.js +136 -0
- package/studio-dist/server/assets/usePopupHandleStore-DEEXJYv0.js +26 -0
- package/studio-dist/server/assets/{vault-BzarssiL.js → vault-B_kfi1h-.js} +1 -1
- package/studio-dist/server/assets/{vault-CvlrLd2H.js → vault-dL79JlKH.js} +8 -115
- package/studio-dist/server/assets/{views-CAxwKHMK.js → views-BSGH56lb.js} +3 -3
- package/studio-dist/server/assets/{warnings-BpVCugHm.js → warnings-DtUVPV-k.js} +2 -2
- package/studio-dist/server/assets/work-D789VXGH.js +110 -0
- package/studio-dist/server/assets/work-DsCEfhmK.js +3817 -0
- package/studio-dist/server/assets/work-requests-BLhOmQFO.js +11 -0
- package/studio-dist/server/assets/{workflow-BdrzcCt8.js → workflow-BOZ2sRYg.js} +9 -9
- package/studio-dist/server/server.js +3 -3
- package/wrappers/bin/openspec +87 -2
- package/studio-dist/client/assets/app-ggXJ_QVh.css +0 -2
- package/studio-dist/client/assets/button-C9SQW3kI.js +0 -1
- package/studio-dist/client/assets/cn-DC80MJV0.js +0 -1
- package/studio-dist/client/assets/combobox-D7mKYCBb.js +0 -1
- package/studio-dist/client/assets/fields-CEep8IFT.js +0 -1
- package/studio-dist/client/assets/friction-D9dBU7WN.js +0 -1
- package/studio-dist/client/assets/getting-started-BDyGvHhc.js +0 -1
- package/studio-dist/client/assets/getting-started._topic-B9ajbF4o.js +0 -1
- package/studio-dist/client/assets/getting-started.index-CYiBPtb7.js +0 -1
- package/studio-dist/client/assets/graph-ah7ZXfTa.js +0 -2
- package/studio-dist/client/assets/guides-CsL0660B.js +0 -1
- package/studio-dist/client/assets/index-zmRH87D4.js +0 -40
- package/studio-dist/client/assets/panel-COgk0vP5.js +0 -1
- package/studio-dist/client/assets/plugins._service._view-Cn3WBHab.js +0 -1
- package/studio-dist/client/assets/reports-C_AqLBYH.js +0 -1
- package/studio-dist/client/assets/routes-BokQmHtC.js +0 -1
- package/studio-dist/client/assets/search-DxidNK2M.js +0 -1
- package/studio-dist/client/assets/select-CYFCbHUd.js +0 -1
- package/studio-dist/client/assets/skills-R3vttWHM.js +0 -1
- package/studio-dist/client/assets/specs-view-znqFPx9p.js +0 -1
- package/studio-dist/client/assets/steps-tVDWn7j6.js +0 -1
- package/studio-dist/client/assets/studio-ndtFcS2Y.js +0 -100
- package/studio-dist/client/assets/studio-queries-CkUSByy7.js +0 -2
- package/studio-dist/client/assets/usage-Kuhr8dSl.js +0 -55
- package/studio-dist/client/assets/useAnchoredPopupScrollLock-dc_kP4Go.js +0 -1
- package/studio-dist/client/assets/useMutation-CqtM9COw.js +0 -1
- package/studio-dist/client/assets/vault-CSP8kwRg.js +0 -1
- package/studio-dist/client/assets/workflow-BPJAmmZi.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as createServerRpc } from "./createServerRpc-bFKFpGFG.js";
|
|
2
2
|
import { n as createServerFn } from "../server.js";
|
|
3
|
-
import {
|
|
3
|
+
import { T as COMPANION_DIGEST_PATTERN } from "./studio-qzH-UETC.js";
|
|
4
4
|
// src/server/usage.ts?tss-serverfn-split
|
|
5
5
|
function validateUsageInput(input) {
|
|
6
6
|
if (!input || typeof input.companion !== "string" || !COMPANION_DIGEST_PATTERN.test(input.companion)) throw new Error("No registered companion was selected");
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { t as useMutation } from "./useMutation-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { t as useMutation } from "./useMutation-NjlA8oFY.js";
|
|
2
|
+
import { N as useBrowser, Rt as useQuery, V as useMediaQuery, c as Route } from "./router-DcWe0J7Y.js";
|
|
3
|
+
import { p as useQueryClient, t as cn } from "./cn-B0fl6NWK.js";
|
|
4
|
+
import { F as queryOptions, S as createSsrRpc, dt as useNavigate } from "./studio-queries-ur1ygXi3.js";
|
|
5
5
|
import { i as __exportAll, n as require_react, o as __toESM, r as __commonJSMin, t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import { a as
|
|
9
|
-
import {
|
|
6
|
+
import { dt as ToggleGroup, ft as ToggleGroupItem, o as require_with_selector$1, r as Icon, t as Button, ut as ViewLoading } from "./button-BqA1urbl.js";
|
|
7
|
+
import { t as Input } from "./fields-BMap2_Ju.js";
|
|
8
|
+
import { a as ComboboxItem, i as ComboboxInput, n as ComboboxContent, o as ComboboxList, r as ComboboxEmpty, t as Combobox } from "./combobox-iTjvPCtS.js";
|
|
9
|
+
import { a as Select, c as SelectTrigger, l as SelectValue, o as SelectContent, s as SelectItem } from "./select-CZvHgGCi.js";
|
|
10
10
|
import { i as require_react_dom, n as createServerFn } from "../server.js";
|
|
11
|
-
import {
|
|
11
|
+
import { T as COMPANION_DIGEST_PATTERN } from "./studio-qzH-UETC.js";
|
|
12
|
+
import { n as clsx } from "./bundle-mjs-Ot6dQ8Pq.js";
|
|
12
13
|
// src/server/usage.ts
|
|
13
14
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
14
15
|
function validateUsageInput(input) {
|
|
@@ -1,84 +1,6 @@
|
|
|
1
1
|
import { n as require_react, o as __toESM, t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
|
|
2
|
-
import { A as useFloatingParentNodeId, Cn as
|
|
3
|
-
import {
|
|
4
|
-
// ../../node_modules/.bun/@base-ui+react@1.9.0+9e489665888c9e4a/node_modules/@base-ui/react/floating-ui-react/hooks/useClick.mjs
|
|
5
|
-
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
6
|
-
/**
|
|
7
|
-
* Opens or closes the floating element when clicking the reference element.
|
|
8
|
-
* @see https://floating-ui.com/docs/useClick
|
|
9
|
-
*/
|
|
10
|
-
function useClick(store, props = {}) {
|
|
11
|
-
const { enabled = true, event: eventOption = "click", toggle = true, ignoreMouse = false, stickIfOpen = true, touchOpenDelay = 0, reason = triggerPress } = props;
|
|
12
|
-
const dataRef = store.context.dataRef;
|
|
13
|
-
const pointerTypeRef = import_react.useRef(void 0);
|
|
14
|
-
const frame = useAnimationFrame();
|
|
15
|
-
const touchOpenTimeout = useTimeout();
|
|
16
|
-
const reference = import_react.useMemo(() => {
|
|
17
|
-
function setOpenWithTouchDelay(nextOpen, nativeEvent, target, pointerType) {
|
|
18
|
-
const details = createChangeEventDetails(reason, nativeEvent, target);
|
|
19
|
-
if (nextOpen && pointerType === "touch" && touchOpenDelay > 0) touchOpenTimeout.start(touchOpenDelay, () => {
|
|
20
|
-
store.setOpen(true, details);
|
|
21
|
-
});
|
|
22
|
-
else store.setOpen(nextOpen, details);
|
|
23
|
-
}
|
|
24
|
-
function getNextOpen(open, currentTarget, isClickLikeOpenEvent) {
|
|
25
|
-
const openEvent = dataRef.current.openEvent;
|
|
26
|
-
const hasClickedOnInactiveTrigger = store.select("domReferenceElement") !== currentTarget;
|
|
27
|
-
if (open && hasClickedOnInactiveTrigger) return true;
|
|
28
|
-
if (!open) return true;
|
|
29
|
-
if (!toggle) return true;
|
|
30
|
-
if (openEvent && (typeof stickIfOpen === "function" ? stickIfOpen() : stickIfOpen)) return !isClickLikeOpenEvent(openEvent.type);
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
return {
|
|
34
|
-
onPointerDown(event) {
|
|
35
|
-
pointerTypeRef.current = isMouseLikePointerType(event.pointerType, true) && isVirtualPointerEvent(event.nativeEvent) ? "virtual" : event.pointerType;
|
|
36
|
-
},
|
|
37
|
-
onMouseDown(event) {
|
|
38
|
-
const pointerType = pointerTypeRef.current;
|
|
39
|
-
const nativeEvent = event.nativeEvent;
|
|
40
|
-
const open = store.select("open");
|
|
41
|
-
if (event.button !== 0 || eventOption === "click" || isMouseLikePointerType(pointerType, true) && ignoreMouse) return;
|
|
42
|
-
const nextOpen = getNextOpen(open, event.currentTarget, (openEventType) => openEventType === "click" || openEventType === "mousedown");
|
|
43
|
-
const target = getTarget(nativeEvent);
|
|
44
|
-
const isTypeable = isTypeableElement(target);
|
|
45
|
-
if (isTypeable || pointerType === "virtual") {
|
|
46
|
-
setOpenWithTouchDelay(nextOpen, nativeEvent, isTypeable ? target : event.currentTarget, pointerType);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
const eventCurrentTarget = event.currentTarget;
|
|
50
|
-
frame.request(() => {
|
|
51
|
-
setOpenWithTouchDelay(nextOpen, nativeEvent, eventCurrentTarget, pointerType);
|
|
52
|
-
});
|
|
53
|
-
},
|
|
54
|
-
onClick(event) {
|
|
55
|
-
if (eventOption === "mousedown-only") return;
|
|
56
|
-
const pointerType = pointerTypeRef.current;
|
|
57
|
-
if (eventOption === "mousedown" && pointerType) {
|
|
58
|
-
pointerTypeRef.current = void 0;
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
if (isMouseLikePointerType(pointerType, true) && ignoreMouse) return;
|
|
62
|
-
setOpenWithTouchDelay(getNextOpen(store.select("open"), event.currentTarget, (openEventType) => openEventType === "click" || openEventType === "mousedown" || openEventType === "keydown" || openEventType === "keyup"), event.nativeEvent, event.currentTarget, pointerType);
|
|
63
|
-
},
|
|
64
|
-
onKeyDown() {
|
|
65
|
-
pointerTypeRef.current = void 0;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
}, [
|
|
69
|
-
dataRef,
|
|
70
|
-
eventOption,
|
|
71
|
-
ignoreMouse,
|
|
72
|
-
reason,
|
|
73
|
-
store,
|
|
74
|
-
stickIfOpen,
|
|
75
|
-
toggle,
|
|
76
|
-
frame,
|
|
77
|
-
touchOpenTimeout,
|
|
78
|
-
touchOpenDelay
|
|
79
|
-
]);
|
|
80
|
-
return import_react.useMemo(() => enabled ? { reference } : EMPTY_OBJECT, [enabled, reference]);
|
|
81
|
-
}
|
|
2
|
+
import { A as useFloatingParentNodeId, Cn as ARROW_RIGHT, Dn as contains, Et as getNextListIndex, G as useValueAsRef, Ir as useRefWithInit, Jn as listNavigation, On as getTarget, Ot as isIndexOutOfListBounds, Qt as stopEvent, Rr as useId, Sn as ARROW_LEFT, Tn as activeElement, Tt as getMinListIndex, Vn as focusOut, W as useAnimationFrame, Xt as isVirtualClick, Zt as isVirtualPointerEvent, an as isTypeableElement, br as isElement, c as PopupTriggerMap, cr as useIsoLayoutEffect, i as FloatingRootStore, in as isTypeableCombobox, j as useFloatingTree, jn as webkit, lr as useStableCallback, nr as createChangeEventDetails, or as ownerDocument, tn as getFloatingFocusElement, wn as ARROW_UP, wt as getMaxListIndex, xn as ARROW_DOWN, xr as isHTMLElement } from "./button-BqA1urbl.js";
|
|
3
|
+
import { a as useScrollLock, b as enqueueFocus } from "./fields-BMap2_Ju.js";
|
|
82
4
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+9e489665888c9e4a/node_modules/@base-ui/react/floating-ui-react/hooks/useFloatingRootContext.mjs
|
|
83
5
|
function useFloatingRootContext(options) {
|
|
84
6
|
const { open = false, onOpenChange, elements = {} } = options;
|
|
@@ -118,6 +40,7 @@ function useFloatingRootContext(options) {
|
|
|
118
40
|
return store;
|
|
119
41
|
}
|
|
120
42
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+9e489665888c9e4a/node_modules/@base-ui/react/floating-ui-react/hooks/useListNavigation.mjs
|
|
43
|
+
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
121
44
|
function isStationaryWebKitPointer(event) {
|
|
122
45
|
return webkit && event.movementX === 0 && event.movementY === 0;
|
|
123
46
|
}
|
|
@@ -675,60 +598,6 @@ function resolveMultipleLabels(values, items, itemToStringLabel) {
|
|
|
675
598
|
return acc;
|
|
676
599
|
}, []);
|
|
677
600
|
}
|
|
678
|
-
// ../../node_modules/.bun/@base-ui+utils@0.5.0+9e489665888c9e4a/node_modules/@base-ui/utils/useEnhancedClickHandler.mjs
|
|
679
|
-
/**
|
|
680
|
-
* Provides a cross-browser way to determine the type of the pointer used to click.
|
|
681
|
-
* Safari and Firefox do not provide the PointerEvent to the click handler (they use MouseEvent) yet.
|
|
682
|
-
* Additionally, this implementation detects if the click was triggered by the keyboard.
|
|
683
|
-
*
|
|
684
|
-
* @param handler The function to be called when the button is clicked. The first parameter is the original event and the second parameter is the pointer type.
|
|
685
|
-
*/
|
|
686
|
-
function useEnhancedClickHandler(handler) {
|
|
687
|
-
const lastClickInteractionTypeRef = import_react.useRef("");
|
|
688
|
-
const handlePointerDown = import_react.useCallback((event) => {
|
|
689
|
-
if (event.defaultPrevented) return;
|
|
690
|
-
lastClickInteractionTypeRef.current = event.pointerType;
|
|
691
|
-
handler(event, event.pointerType);
|
|
692
|
-
}, [handler]);
|
|
693
|
-
return {
|
|
694
|
-
onClick: import_react.useCallback((event) => {
|
|
695
|
-
if (event.detail === 0) {
|
|
696
|
-
handler(event, "keyboard");
|
|
697
|
-
return;
|
|
698
|
-
}
|
|
699
|
-
if ("pointerType" in event) handler(event, event.pointerType);
|
|
700
|
-
else handler(event, lastClickInteractionTypeRef.current);
|
|
701
|
-
lastClickInteractionTypeRef.current = "";
|
|
702
|
-
}, [handler]),
|
|
703
|
-
onPointerDown: handlePointerDown
|
|
704
|
-
};
|
|
705
|
-
}
|
|
706
|
-
// ../../node_modules/.bun/@base-ui+react@1.9.0+9e489665888c9e4a/node_modules/@base-ui/react/utils/useOpenInteractionType.mjs
|
|
707
|
-
function useOpenMethodTriggerProps(open, setOpenMethod) {
|
|
708
|
-
const { onClick, onPointerDown } = useEnhancedClickHandler(useStableCallback((_, interactionType) => {
|
|
709
|
-
if (!(typeof open === "function" ? open() : open)) setOpenMethod(interactionType || (ios ? "touch" : ""));
|
|
710
|
-
}));
|
|
711
|
-
return import_react.useMemo(() => ({
|
|
712
|
-
onClick,
|
|
713
|
-
onPointerDown
|
|
714
|
-
}), [onClick, onPointerDown]);
|
|
715
|
-
}
|
|
716
|
-
/**
|
|
717
|
-
* Determines the interaction type (keyboard, mouse, touch, etc.) that opened the component.
|
|
718
|
-
*
|
|
719
|
-
* @param open The open state of the component.
|
|
720
|
-
*/
|
|
721
|
-
function useOpenInteractionType(open) {
|
|
722
|
-
const [openMethod, setOpenMethod] = import_react.useState(null);
|
|
723
|
-
const triggerProps = useOpenMethodTriggerProps(open, setOpenMethod);
|
|
724
|
-
useValueChanged(open, (previousOpen) => {
|
|
725
|
-
if (previousOpen && !open) setOpenMethod(null);
|
|
726
|
-
});
|
|
727
|
-
return import_react.useMemo(() => ({
|
|
728
|
-
openMethod,
|
|
729
|
-
triggerProps
|
|
730
|
-
}), [openMethod, triggerProps]);
|
|
731
|
-
}
|
|
732
601
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+9e489665888c9e4a/node_modules/@base-ui/react/utils/useAnchoredPopupScrollLock.mjs
|
|
733
602
|
var VIEWPORT_WIDTH_TOLERANCE_PX = 20;
|
|
734
603
|
/**
|
|
@@ -753,4 +622,4 @@ function useAnchoredPopupScrollLock(enabled, touchOpen, positionerElement, refer
|
|
|
753
622
|
]);
|
|
754
623
|
useScrollLock(enabled && (!touchOpen || touchOpenShouldLockScroll), referenceElement);
|
|
755
624
|
}
|
|
756
|
-
export {
|
|
625
|
+
export { useOnFirstRender as _, resolveMultipleLabels as a, stringifyAsValue as c, findItemIndex as d, findSelectionIndex as f, selectedValueIncludes as g, resolveSelectedIndex as h, isGroupedItems as i, compareItemEquality as l, removeItem as m, flattenLeafItems as n, resolveSelectedLabel as o, isSelectedValueDirty as p, hasNullItemLabel as r, stringifyAsLabel as s, useAnchoredPopupScrollLock as t, defaultItemEquality as u, useListNavigation as v, useFloatingRootContext as y };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { a as useRouter } from "./useSelector-DUmCUXAs.js";
|
|
2
|
+
import { n as require_react, o as __toESM } from "./jsx-runtime-Bt0s0YKS.js";
|
|
3
|
+
// ../../node_modules/.bun/@tanstack+react-router@1.170.46+7492c01c6988791b/node_modules/@tanstack/react-router/dist/esm/useBlocker.js
|
|
4
|
+
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
5
|
+
function _resolveBlockerOpts(opts, condition) {
|
|
6
|
+
if (opts === void 0) return {
|
|
7
|
+
shouldBlockFn: () => true,
|
|
8
|
+
withResolver: false
|
|
9
|
+
};
|
|
10
|
+
if ("shouldBlockFn" in opts) return opts;
|
|
11
|
+
if (typeof opts === "function") {
|
|
12
|
+
const shouldBlock = Boolean(condition ?? true);
|
|
13
|
+
const _customBlockerFn = async () => {
|
|
14
|
+
if (shouldBlock) return await opts();
|
|
15
|
+
return false;
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
shouldBlockFn: _customBlockerFn,
|
|
19
|
+
enableBeforeUnload: shouldBlock,
|
|
20
|
+
withResolver: false
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const shouldBlock = Boolean(opts.condition ?? true);
|
|
24
|
+
const fn = opts.blockerFn;
|
|
25
|
+
const _customBlockerFn = async () => {
|
|
26
|
+
if (shouldBlock && fn !== void 0) return await fn();
|
|
27
|
+
return shouldBlock;
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
shouldBlockFn: _customBlockerFn,
|
|
31
|
+
enableBeforeUnload: shouldBlock,
|
|
32
|
+
withResolver: fn === void 0
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function useBlocker(opts, condition) {
|
|
36
|
+
const { shouldBlockFn, enableBeforeUnload = true, disabled = false, withResolver = false } = _resolveBlockerOpts(opts, condition);
|
|
37
|
+
const router = useRouter();
|
|
38
|
+
const { history } = router;
|
|
39
|
+
const [resolver, setResolver] = import_react.useState({
|
|
40
|
+
status: "idle",
|
|
41
|
+
current: void 0,
|
|
42
|
+
next: void 0,
|
|
43
|
+
action: void 0,
|
|
44
|
+
proceed: void 0,
|
|
45
|
+
reset: void 0
|
|
46
|
+
});
|
|
47
|
+
import_react.useEffect(() => {
|
|
48
|
+
const blockerFnComposed = async (blockerFnArgs) => {
|
|
49
|
+
function getLocation(location) {
|
|
50
|
+
const parsedLocation = router.parseLocation(location);
|
|
51
|
+
const [, rawParams, foundRoute] = router.getMatchedRoutes(parsedLocation.pathname);
|
|
52
|
+
if (foundRoute === void 0) return {
|
|
53
|
+
routeId: "__notFound__",
|
|
54
|
+
fullPath: parsedLocation.pathname,
|
|
55
|
+
pathname: parsedLocation.pathname,
|
|
56
|
+
params: rawParams,
|
|
57
|
+
search: router.options.parseSearch(location.search)
|
|
58
|
+
};
|
|
59
|
+
return {
|
|
60
|
+
routeId: foundRoute.id,
|
|
61
|
+
fullPath: foundRoute.fullPath,
|
|
62
|
+
pathname: parsedLocation.pathname,
|
|
63
|
+
params: rawParams,
|
|
64
|
+
search: router.options.parseSearch(location.search)
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const current = getLocation(blockerFnArgs.currentLocation);
|
|
68
|
+
const next = getLocation(blockerFnArgs.nextLocation);
|
|
69
|
+
if (current.routeId === "__notFound__" && next.routeId !== "__notFound__") return false;
|
|
70
|
+
const shouldBlock = await shouldBlockFn({
|
|
71
|
+
action: blockerFnArgs.action,
|
|
72
|
+
current,
|
|
73
|
+
next
|
|
74
|
+
});
|
|
75
|
+
if (!withResolver) return shouldBlock;
|
|
76
|
+
if (!shouldBlock) return false;
|
|
77
|
+
const canNavigateAsync = await new Promise((resolve) => {
|
|
78
|
+
setResolver({
|
|
79
|
+
status: "blocked",
|
|
80
|
+
current,
|
|
81
|
+
next,
|
|
82
|
+
action: blockerFnArgs.action,
|
|
83
|
+
proceed: () => resolve(false),
|
|
84
|
+
reset: () => resolve(true)
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
setResolver({
|
|
88
|
+
status: "idle",
|
|
89
|
+
current: void 0,
|
|
90
|
+
next: void 0,
|
|
91
|
+
action: void 0,
|
|
92
|
+
proceed: void 0,
|
|
93
|
+
reset: void 0
|
|
94
|
+
});
|
|
95
|
+
return canNavigateAsync;
|
|
96
|
+
};
|
|
97
|
+
return disabled ? void 0 : history.block({
|
|
98
|
+
blockerFn: blockerFnComposed,
|
|
99
|
+
enableBeforeUnload
|
|
100
|
+
});
|
|
101
|
+
}, [
|
|
102
|
+
shouldBlockFn,
|
|
103
|
+
enableBeforeUnload,
|
|
104
|
+
disabled,
|
|
105
|
+
withResolver,
|
|
106
|
+
history,
|
|
107
|
+
router
|
|
108
|
+
]);
|
|
109
|
+
return resolver;
|
|
110
|
+
}
|
|
111
|
+
export { useBlocker as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as Subscribable, l as notifyManager, o as Removable, p as useQueryClient, s as createRetryer } from "./cn-B0fl6NWK.js";
|
|
2
2
|
import { n as require_react, o as __toESM } from "./jsx-runtime-Bt0s0YKS.js";
|
|
3
|
-
import {
|
|
3
|
+
import { H as hashKey, Y as noop, et as shallowEqualObjects, tt as shouldThrowError } from "./studio-queries-ur1ygXi3.js";
|
|
4
4
|
// ../../node_modules/.bun/@tanstack+query-core@5.105.3/node_modules/@tanstack/query-core/build/modern/mutation.js
|
|
5
5
|
/**
|
|
6
6
|
* Represents a single mutation attempt. A `Mutation` holds the mutation's
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { n as require_react, o as __toESM } from "./jsx-runtime-Bt0s0YKS.js";
|
|
2
|
+
import { Mr as EMPTY_OBJECT, Nn as ios, On as getTarget, W as useAnimationFrame, Y as useTimeout, Yt as isMouseLikePointerType, Zt as isVirtualPointerEvent, an as isTypeableElement, er as triggerPress, lr as useStableCallback, nr as createChangeEventDetails } from "./button-BqA1urbl.js";
|
|
3
|
+
import { c as useValueChanged } from "./fields-BMap2_Ju.js";
|
|
4
|
+
// ../../node_modules/.bun/@base-ui+react@1.9.0+9e489665888c9e4a/node_modules/@base-ui/react/floating-ui-react/hooks/useClick.mjs
|
|
5
|
+
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
6
|
+
/**
|
|
7
|
+
* Opens or closes the floating element when clicking the reference element.
|
|
8
|
+
* @see https://floating-ui.com/docs/useClick
|
|
9
|
+
*/
|
|
10
|
+
function useClick(store, props = {}) {
|
|
11
|
+
const { enabled = true, event: eventOption = "click", toggle = true, ignoreMouse = false, stickIfOpen = true, touchOpenDelay = 0, reason = triggerPress } = props;
|
|
12
|
+
const dataRef = store.context.dataRef;
|
|
13
|
+
const pointerTypeRef = import_react.useRef(void 0);
|
|
14
|
+
const frame = useAnimationFrame();
|
|
15
|
+
const touchOpenTimeout = useTimeout();
|
|
16
|
+
const reference = import_react.useMemo(() => {
|
|
17
|
+
function setOpenWithTouchDelay(nextOpen, nativeEvent, target, pointerType) {
|
|
18
|
+
const details = createChangeEventDetails(reason, nativeEvent, target);
|
|
19
|
+
if (nextOpen && pointerType === "touch" && touchOpenDelay > 0) touchOpenTimeout.start(touchOpenDelay, () => {
|
|
20
|
+
store.setOpen(true, details);
|
|
21
|
+
});
|
|
22
|
+
else store.setOpen(nextOpen, details);
|
|
23
|
+
}
|
|
24
|
+
function getNextOpen(open, currentTarget, isClickLikeOpenEvent) {
|
|
25
|
+
const openEvent = dataRef.current.openEvent;
|
|
26
|
+
const hasClickedOnInactiveTrigger = store.select("domReferenceElement") !== currentTarget;
|
|
27
|
+
if (open && hasClickedOnInactiveTrigger) return true;
|
|
28
|
+
if (!open) return true;
|
|
29
|
+
if (!toggle) return true;
|
|
30
|
+
if (openEvent && (typeof stickIfOpen === "function" ? stickIfOpen() : stickIfOpen)) return !isClickLikeOpenEvent(openEvent.type);
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
onPointerDown(event) {
|
|
35
|
+
pointerTypeRef.current = isMouseLikePointerType(event.pointerType, true) && isVirtualPointerEvent(event.nativeEvent) ? "virtual" : event.pointerType;
|
|
36
|
+
},
|
|
37
|
+
onMouseDown(event) {
|
|
38
|
+
const pointerType = pointerTypeRef.current;
|
|
39
|
+
const nativeEvent = event.nativeEvent;
|
|
40
|
+
const open = store.select("open");
|
|
41
|
+
if (event.button !== 0 || eventOption === "click" || isMouseLikePointerType(pointerType, true) && ignoreMouse) return;
|
|
42
|
+
const nextOpen = getNextOpen(open, event.currentTarget, (openEventType) => openEventType === "click" || openEventType === "mousedown");
|
|
43
|
+
const target = getTarget(nativeEvent);
|
|
44
|
+
const isTypeable = isTypeableElement(target);
|
|
45
|
+
if (isTypeable || pointerType === "virtual") {
|
|
46
|
+
setOpenWithTouchDelay(nextOpen, nativeEvent, isTypeable ? target : event.currentTarget, pointerType);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const eventCurrentTarget = event.currentTarget;
|
|
50
|
+
frame.request(() => {
|
|
51
|
+
setOpenWithTouchDelay(nextOpen, nativeEvent, eventCurrentTarget, pointerType);
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
onClick(event) {
|
|
55
|
+
if (eventOption === "mousedown-only") return;
|
|
56
|
+
const pointerType = pointerTypeRef.current;
|
|
57
|
+
if (eventOption === "mousedown" && pointerType) {
|
|
58
|
+
pointerTypeRef.current = void 0;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (isMouseLikePointerType(pointerType, true) && ignoreMouse) return;
|
|
62
|
+
setOpenWithTouchDelay(getNextOpen(store.select("open"), event.currentTarget, (openEventType) => openEventType === "click" || openEventType === "mousedown" || openEventType === "keydown" || openEventType === "keyup"), event.nativeEvent, event.currentTarget, pointerType);
|
|
63
|
+
},
|
|
64
|
+
onKeyDown() {
|
|
65
|
+
pointerTypeRef.current = void 0;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}, [
|
|
69
|
+
dataRef,
|
|
70
|
+
eventOption,
|
|
71
|
+
ignoreMouse,
|
|
72
|
+
reason,
|
|
73
|
+
store,
|
|
74
|
+
stickIfOpen,
|
|
75
|
+
toggle,
|
|
76
|
+
frame,
|
|
77
|
+
touchOpenTimeout,
|
|
78
|
+
touchOpenDelay
|
|
79
|
+
]);
|
|
80
|
+
return import_react.useMemo(() => enabled ? { reference } : EMPTY_OBJECT, [enabled, reference]);
|
|
81
|
+
}
|
|
82
|
+
// ../../node_modules/.bun/@base-ui+utils@0.5.0+9e489665888c9e4a/node_modules/@base-ui/utils/useEnhancedClickHandler.mjs
|
|
83
|
+
/**
|
|
84
|
+
* Provides a cross-browser way to determine the type of the pointer used to click.
|
|
85
|
+
* Safari and Firefox do not provide the PointerEvent to the click handler (they use MouseEvent) yet.
|
|
86
|
+
* Additionally, this implementation detects if the click was triggered by the keyboard.
|
|
87
|
+
*
|
|
88
|
+
* @param handler The function to be called when the button is clicked. The first parameter is the original event and the second parameter is the pointer type.
|
|
89
|
+
*/
|
|
90
|
+
function useEnhancedClickHandler(handler) {
|
|
91
|
+
const lastClickInteractionTypeRef = import_react.useRef("");
|
|
92
|
+
const handlePointerDown = import_react.useCallback((event) => {
|
|
93
|
+
if (event.defaultPrevented) return;
|
|
94
|
+
lastClickInteractionTypeRef.current = event.pointerType;
|
|
95
|
+
handler(event, event.pointerType);
|
|
96
|
+
}, [handler]);
|
|
97
|
+
return {
|
|
98
|
+
onClick: import_react.useCallback((event) => {
|
|
99
|
+
if (event.detail === 0) {
|
|
100
|
+
handler(event, "keyboard");
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if ("pointerType" in event) handler(event, event.pointerType);
|
|
104
|
+
else handler(event, lastClickInteractionTypeRef.current);
|
|
105
|
+
lastClickInteractionTypeRef.current = "";
|
|
106
|
+
}, [handler]),
|
|
107
|
+
onPointerDown: handlePointerDown
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
// ../../node_modules/.bun/@base-ui+react@1.9.0+9e489665888c9e4a/node_modules/@base-ui/react/utils/useOpenInteractionType.mjs
|
|
111
|
+
function useOpenMethodTriggerProps(open, setOpenMethod) {
|
|
112
|
+
const { onClick, onPointerDown } = useEnhancedClickHandler(useStableCallback((_, interactionType) => {
|
|
113
|
+
if (!(typeof open === "function" ? open() : open)) setOpenMethod(interactionType || (ios ? "touch" : ""));
|
|
114
|
+
}));
|
|
115
|
+
return import_react.useMemo(() => ({
|
|
116
|
+
onClick,
|
|
117
|
+
onPointerDown
|
|
118
|
+
}), [onClick, onPointerDown]);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Determines the interaction type (keyboard, mouse, touch, etc.) that opened the component.
|
|
122
|
+
*
|
|
123
|
+
* @param open The open state of the component.
|
|
124
|
+
*/
|
|
125
|
+
function useOpenInteractionType(open) {
|
|
126
|
+
const [openMethod, setOpenMethod] = import_react.useState(null);
|
|
127
|
+
const triggerProps = useOpenMethodTriggerProps(open, setOpenMethod);
|
|
128
|
+
useValueChanged(open, (previousOpen) => {
|
|
129
|
+
if (previousOpen && !open) setOpenMethod(null);
|
|
130
|
+
});
|
|
131
|
+
return import_react.useMemo(() => ({
|
|
132
|
+
openMethod,
|
|
133
|
+
triggerProps
|
|
134
|
+
}), [openMethod, triggerProps]);
|
|
135
|
+
}
|
|
136
|
+
export { useOpenMethodTriggerProps as n, useClick as r, useOpenInteractionType as t };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { n as require_react, o as __toESM } from "./jsx-runtime-Bt0s0YKS.js";
|
|
2
|
+
import { Nr as NOOP, s as require_shim } from "./button-BqA1urbl.js";
|
|
3
|
+
// ../../node_modules/.bun/@base-ui+react@1.9.0+9e489665888c9e4a/node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs
|
|
4
|
+
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
5
|
+
var import_shim = require_shim();
|
|
6
|
+
/**
|
|
7
|
+
* Reads the store currently exposed by a popup handle and subscribes to store-pointer changes.
|
|
8
|
+
* Detached triggers use this to follow a handle as a root attaches or detaches: while no root is
|
|
9
|
+
* attached, the handle exposes its fallback store; once a root attaches, subscribers re-render and
|
|
10
|
+
* read from the live root store.
|
|
11
|
+
*
|
|
12
|
+
* Returns `undefined` when no handle is provided so callers can fall back to their root context.
|
|
13
|
+
*
|
|
14
|
+
* @param handle The popup handle to read from, or `undefined` when the trigger is not handle-bound.
|
|
15
|
+
*/
|
|
16
|
+
function usePopupHandleStore(handle) {
|
|
17
|
+
const subscribe = import_react.useCallback((listener) => {
|
|
18
|
+
if (handle === void 0) return NOOP;
|
|
19
|
+
return handle.subscribeStore(listener);
|
|
20
|
+
}, [handle]);
|
|
21
|
+
const getSnapshot = import_react.useCallback(() => {
|
|
22
|
+
return handle === void 0 ? void 0 : handle.store;
|
|
23
|
+
}, [handle]);
|
|
24
|
+
return (0, import_shim.useSyncExternalStore)(subscribe, getSnapshot, () => handle?.serverStore);
|
|
25
|
+
}
|
|
26
|
+
export { usePopupHandleStore as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as createServerRpc } from "./createServerRpc-bFKFpGFG.js";
|
|
2
2
|
import { n as createServerFn } from "../server.js";
|
|
3
|
-
import {
|
|
3
|
+
import { T as COMPANION_DIGEST_PATTERN } from "./studio-qzH-UETC.js";
|
|
4
4
|
// src/server/vault.ts?tss-serverfn-split
|
|
5
5
|
var MAX_CONTENT = 5242880;
|
|
6
6
|
function companionOf(input) {
|
|
@@ -1,120 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as useMutation } from "./useMutation-
|
|
4
|
-
import {
|
|
5
|
-
import { m as useQueryClient, t as cn } from "./cn-DWFJaP_9.js";
|
|
1
|
+
import { Ct as Tooltip, Lt as useSuspenseQuery, M as ViewPlaceholder, Rt as useQuery, V as useMediaQuery, s as Route, yt as useVaultUi } from "./router-DcWe0J7Y.js";
|
|
2
|
+
import { b as saveVaultFile, d as shellQuery, dt as useNavigate, h as vaultQuery, i as afterVaultRefresh, m as vaultMatchesQuery, p as vaultChildrenQuery, r as afterVaultFileChange, ut as Link, v as getVault, y as previewVaultFile } from "./studio-queries-ur1ygXi3.js";
|
|
3
|
+
import { t as useMutation } from "./useMutation-NjlA8oFY.js";
|
|
4
|
+
import { p as useQueryClient, t as cn } from "./cn-B0fl6NWK.js";
|
|
6
5
|
import { n as require_react, o as __toESM, t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
|
|
7
|
-
import {
|
|
8
|
-
import { t as
|
|
9
|
-
|
|
10
|
-
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
11
|
-
function _resolveBlockerOpts(opts, condition) {
|
|
12
|
-
if (opts === void 0) return {
|
|
13
|
-
shouldBlockFn: () => true,
|
|
14
|
-
withResolver: false
|
|
15
|
-
};
|
|
16
|
-
if ("shouldBlockFn" in opts) return opts;
|
|
17
|
-
if (typeof opts === "function") {
|
|
18
|
-
const shouldBlock = Boolean(condition ?? true);
|
|
19
|
-
const _customBlockerFn = async () => {
|
|
20
|
-
if (shouldBlock) return await opts();
|
|
21
|
-
return false;
|
|
22
|
-
};
|
|
23
|
-
return {
|
|
24
|
-
shouldBlockFn: _customBlockerFn,
|
|
25
|
-
enableBeforeUnload: shouldBlock,
|
|
26
|
-
withResolver: false
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
const shouldBlock = Boolean(opts.condition ?? true);
|
|
30
|
-
const fn = opts.blockerFn;
|
|
31
|
-
const _customBlockerFn = async () => {
|
|
32
|
-
if (shouldBlock && fn !== void 0) return await fn();
|
|
33
|
-
return shouldBlock;
|
|
34
|
-
};
|
|
35
|
-
return {
|
|
36
|
-
shouldBlockFn: _customBlockerFn,
|
|
37
|
-
enableBeforeUnload: shouldBlock,
|
|
38
|
-
withResolver: fn === void 0
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
function useBlocker(opts, condition) {
|
|
42
|
-
const { shouldBlockFn, enableBeforeUnload = true, disabled = false, withResolver = false } = _resolveBlockerOpts(opts, condition);
|
|
43
|
-
const router = useRouter();
|
|
44
|
-
const { history } = router;
|
|
45
|
-
const [resolver, setResolver] = import_react.useState({
|
|
46
|
-
status: "idle",
|
|
47
|
-
current: void 0,
|
|
48
|
-
next: void 0,
|
|
49
|
-
action: void 0,
|
|
50
|
-
proceed: void 0,
|
|
51
|
-
reset: void 0
|
|
52
|
-
});
|
|
53
|
-
import_react.useEffect(() => {
|
|
54
|
-
const blockerFnComposed = async (blockerFnArgs) => {
|
|
55
|
-
function getLocation(location) {
|
|
56
|
-
const parsedLocation = router.parseLocation(location);
|
|
57
|
-
const [, rawParams, foundRoute] = router.getMatchedRoutes(parsedLocation.pathname);
|
|
58
|
-
if (foundRoute === void 0) return {
|
|
59
|
-
routeId: "__notFound__",
|
|
60
|
-
fullPath: parsedLocation.pathname,
|
|
61
|
-
pathname: parsedLocation.pathname,
|
|
62
|
-
params: rawParams,
|
|
63
|
-
search: router.options.parseSearch(location.search)
|
|
64
|
-
};
|
|
65
|
-
return {
|
|
66
|
-
routeId: foundRoute.id,
|
|
67
|
-
fullPath: foundRoute.fullPath,
|
|
68
|
-
pathname: parsedLocation.pathname,
|
|
69
|
-
params: rawParams,
|
|
70
|
-
search: router.options.parseSearch(location.search)
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
const current = getLocation(blockerFnArgs.currentLocation);
|
|
74
|
-
const next = getLocation(blockerFnArgs.nextLocation);
|
|
75
|
-
if (current.routeId === "__notFound__" && next.routeId !== "__notFound__") return false;
|
|
76
|
-
const shouldBlock = await shouldBlockFn({
|
|
77
|
-
action: blockerFnArgs.action,
|
|
78
|
-
current,
|
|
79
|
-
next
|
|
80
|
-
});
|
|
81
|
-
if (!withResolver) return shouldBlock;
|
|
82
|
-
if (!shouldBlock) return false;
|
|
83
|
-
const canNavigateAsync = await new Promise((resolve) => {
|
|
84
|
-
setResolver({
|
|
85
|
-
status: "blocked",
|
|
86
|
-
current,
|
|
87
|
-
next,
|
|
88
|
-
action: blockerFnArgs.action,
|
|
89
|
-
proceed: () => resolve(false),
|
|
90
|
-
reset: () => resolve(true)
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
setResolver({
|
|
94
|
-
status: "idle",
|
|
95
|
-
current: void 0,
|
|
96
|
-
next: void 0,
|
|
97
|
-
action: void 0,
|
|
98
|
-
proceed: void 0,
|
|
99
|
-
reset: void 0
|
|
100
|
-
});
|
|
101
|
-
return canNavigateAsync;
|
|
102
|
-
};
|
|
103
|
-
return disabled ? void 0 : history.block({
|
|
104
|
-
blockerFn: blockerFnComposed,
|
|
105
|
-
enableBeforeUnload
|
|
106
|
-
});
|
|
107
|
-
}, [
|
|
108
|
-
shouldBlockFn,
|
|
109
|
-
enableBeforeUnload,
|
|
110
|
-
disabled,
|
|
111
|
-
withResolver,
|
|
112
|
-
history,
|
|
113
|
-
router
|
|
114
|
-
]);
|
|
115
|
-
return resolver;
|
|
116
|
-
}
|
|
6
|
+
import { ct as ROW, n as buttonVariants, r as Icon, rt as ListCard, t as Button } from "./button-BqA1urbl.js";
|
|
7
|
+
import { t as useBlocker } from "./useBlocker-CQtANHK8.js";
|
|
8
|
+
import { t as MarkdownView } from "./markdown-view-CvVBGMZV.js";
|
|
117
9
|
// src/views/vault/vault-file.tsx
|
|
10
|
+
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
118
11
|
var import_jsx_runtime = require_jsx_runtime();
|
|
119
12
|
var eventsUrl = (companion, path) => `/api/vault/events?${new URLSearchParams({
|
|
120
13
|
companion,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as createServerRpc } from "./createServerRpc-bFKFpGFG.js";
|
|
2
2
|
import { n as createServerFn } from "../server.js";
|
|
3
|
-
import {
|
|
4
|
-
import { r as specActionOffers } from "./actions-
|
|
5
|
-
import {
|
|
3
|
+
import { E as COMPANION_PARAM, M as VIEW_PARAM, N as companionDigest, T as COMPANION_DIGEST_PATTERN, j as STUDIO_MODE_PARAM } from "./studio-qzH-UETC.js";
|
|
4
|
+
import { r as specActionOffers } from "./actions-CHEFA1i9.js";
|
|
5
|
+
import { o as validateStudioSearch } from "./search-bltT7gwy.js";
|
|
6
6
|
// src/server/views.ts?tss-serverfn-split
|
|
7
7
|
var VIEWS = /* @__PURE__ */ new Set([
|
|
8
8
|
"dashboard",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as cn } from "./cn-
|
|
2
|
-
import { it as PAGE_PAD } from "./button-
|
|
1
|
+
import { t as cn } from "./cn-B0fl6NWK.js";
|
|
2
|
+
import { it as PAGE_PAD } from "./button-BqA1urbl.js";
|
|
3
3
|
import { t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
|
|
4
4
|
// src/views/warnings.tsx
|
|
5
5
|
var import_jsx_runtime = require_jsx_runtime();
|