@shivaedev/react 0.42.0 → 0.44.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +3 -4
- package/dist/{internal/NoticeContext.d.ts → NoticeContext.d.ts} +1 -1
- package/dist/NoticeContext.d.ts.map +1 -0
- package/dist/NoticeContext.js.map +1 -0
- package/dist/PermissionContext.d.ts.map +1 -0
- package/dist/PermissionContext.js.map +1 -0
- package/dist/RecheckContext.d.ts.map +1 -0
- package/dist/RecheckContext.js.map +1 -0
- package/dist/SignOutRegistryContext.d.ts.map +1 -0
- package/dist/SignOutRegistryContext.js.map +1 -0
- package/dist/adapters/loadQuery.js +1 -1
- package/dist/adapters/loadQuery.js.map +1 -1
- package/dist/adapters/permissionBoundary.js +1 -1
- package/dist/adapters/permissionBoundary.js.map +1 -1
- package/dist/adapters/useLatestCallback.d.ts.map +1 -0
- package/dist/adapters/useLatestCallback.js.map +1 -0
- package/dist/adapters/useNoticePublisher.d.ts.map +1 -0
- package/dist/{internal/adapters → adapters}/useNoticePublisher.js +2 -2
- package/dist/adapters/useNoticePublisher.js.map +1 -0
- package/dist/adapters/usePermissionFailure.d.ts.map +1 -0
- package/dist/{internal/adapters → adapters}/usePermissionFailure.js +1 -1
- package/dist/adapters/usePermissionFailure.js.map +1 -0
- package/dist/adapters/useQueryNotice.d.ts.map +1 -0
- package/dist/{internal/adapters → adapters}/useQueryNotice.js +2 -2
- package/dist/adapters/useQueryNotice.js.map +1 -0
- package/dist/adapters/useSubmissionCallbacks.d.ts.map +1 -0
- package/dist/adapters/useSubmissionCallbacks.js.map +1 -0
- package/dist/client/actionCompletion.js +2 -2
- package/dist/client/actionCompletion.js.map +1 -1
- package/dist/client/adapters/SessionGeneration.js +3 -3
- package/dist/client/adapters/SessionGeneration.js.map +1 -1
- package/dist/client/adapters/crypto.d.ts +3 -2
- package/dist/client/adapters/crypto.d.ts.map +1 -1
- package/dist/client/adapters/crypto.js +3 -8
- package/dist/client/adapters/crypto.js.map +1 -1
- package/dist/client/adapters/handlerRuntime.d.ts +1 -1
- package/dist/client/adapters/handlerRuntime.d.ts.map +1 -1
- package/dist/client/adapters/useLiveWindow.js +1 -1
- package/dist/client/adapters/useLiveWindow.js.map +1 -1
- package/dist/client/adapters/useNewId.d.ts +3 -2
- package/dist/client/adapters/useNewId.d.ts.map +1 -1
- package/dist/client/adapters/useNewId.js +4 -3
- package/dist/client/adapters/useNewId.js.map +1 -1
- package/dist/client/adapters/useSessionRetry.d.ts +1 -1
- package/dist/client/adapters/useSessionRetry.d.ts.map +1 -1
- package/dist/client/adapters/useSessionRetry.js +16 -21
- package/dist/client/adapters/useSessionRetry.js.map +1 -1
- package/dist/client/adapters/useSignOut.js +1 -1
- package/dist/client/adapters/useSignOut.js.map +1 -1
- package/dist/client/create.js +1 -1
- package/dist/client/create.js.map +1 -1
- package/dist/client/editor.js +2 -2
- package/dist/client/editor.js.map +1 -1
- package/dist/client/mountLive.js +2 -2
- package/dist/client/mountLive.js.map +1 -1
- package/dist/client/resultState.js +2 -2
- package/dist/client/resultState.js.map +1 -1
- package/dist/client/sessionBoundary.d.ts +2 -1
- package/dist/client/sessionBoundary.d.ts.map +1 -1
- package/dist/client/sessionBoundary.js +4 -4
- package/dist/client/sessionBoundary.js.map +1 -1
- package/dist/client/useLoaderQuery.js +1 -1
- package/dist/client/useLoaderQuery.js.map +1 -1
- package/dist/loadedQuery.d.ts.map +1 -0
- package/dist/loadedQuery.js.map +1 -0
- package/dist/noticeEntry.d.ts.map +1 -0
- package/dist/noticeEntry.js.map +1 -0
- package/dist/noticeStore.d.ts.map +1 -0
- package/dist/noticeStore.js.map +1 -0
- package/dist/notices.d.ts +1 -1
- package/dist/notices.d.ts.map +1 -1
- package/dist/notices.js +2 -2
- package/dist/notices.js.map +1 -1
- package/dist/registerLiveWindow.d.ts.map +1 -0
- package/dist/registerLiveWindow.js.map +1 -0
- package/dist/sessionRecheck.d.ts.map +1 -0
- package/dist/sessionRecheck.js.map +1 -0
- package/package.json +22 -22
- package/src/adapters/loadQuery.ts +1 -1
- package/src/adapters/permissionBoundary.ts +1 -1
- package/src/{internal/adapters → adapters}/useNoticePublisher.ts +2 -2
- package/src/{internal/adapters → adapters}/usePermissionFailure.ts +1 -1
- package/src/{internal/adapters → adapters}/useQueryNotice.ts +2 -2
- package/src/client/actionCompletion.ts +2 -2
- package/src/client/adapters/SessionGeneration.ts +3 -3
- package/src/client/adapters/crypto.ts +3 -13
- package/src/client/adapters/useLiveWindow.ts +1 -1
- package/src/client/adapters/useNewId.ts +7 -4
- package/src/client/adapters/useSessionRetry.ts +26 -26
- package/src/client/adapters/useSignOut.ts +1 -1
- package/src/client/create.ts +1 -1
- package/src/client/editor.ts +2 -2
- package/src/client/mountLive.ts +2 -2
- package/src/client/resultState.ts +2 -2
- package/src/client/sessionBoundary.ts +5 -3
- package/src/client/useLoaderQuery.ts +1 -1
- package/src/notices.ts +3 -3
- package/dist/internal/NoticeContext.d.ts.map +0 -1
- package/dist/internal/NoticeContext.js.map +0 -1
- package/dist/internal/PermissionContext.d.ts.map +0 -1
- package/dist/internal/PermissionContext.js.map +0 -1
- package/dist/internal/RecheckContext.d.ts.map +0 -1
- package/dist/internal/RecheckContext.js.map +0 -1
- package/dist/internal/SignOutRegistryContext.d.ts.map +0 -1
- package/dist/internal/SignOutRegistryContext.js.map +0 -1
- package/dist/internal/adapters/useLatestCallback.d.ts.map +0 -1
- package/dist/internal/adapters/useLatestCallback.js.map +0 -1
- package/dist/internal/adapters/useNoticePublisher.d.ts.map +0 -1
- package/dist/internal/adapters/useNoticePublisher.js.map +0 -1
- package/dist/internal/adapters/usePermissionFailure.d.ts.map +0 -1
- package/dist/internal/adapters/usePermissionFailure.js.map +0 -1
- package/dist/internal/adapters/useQueryNotice.d.ts.map +0 -1
- package/dist/internal/adapters/useQueryNotice.js.map +0 -1
- package/dist/internal/adapters/useSubmissionCallbacks.d.ts.map +0 -1
- package/dist/internal/adapters/useSubmissionCallbacks.js.map +0 -1
- package/dist/internal/loadedQuery.d.ts.map +0 -1
- package/dist/internal/loadedQuery.js.map +0 -1
- package/dist/internal/noticeEntry.d.ts.map +0 -1
- package/dist/internal/noticeEntry.js.map +0 -1
- package/dist/internal/noticeStore.d.ts.map +0 -1
- package/dist/internal/noticeStore.js.map +0 -1
- package/dist/internal/registerLiveWindow.d.ts.map +0 -1
- package/dist/internal/registerLiveWindow.js.map +0 -1
- package/dist/internal/sessionRecheck.d.ts.map +0 -1
- package/dist/internal/sessionRecheck.js.map +0 -1
- /package/dist/{internal/NoticeContext.js → NoticeContext.js} +0 -0
- /package/dist/{internal/PermissionContext.d.ts → PermissionContext.d.ts} +0 -0
- /package/dist/{internal/PermissionContext.js → PermissionContext.js} +0 -0
- /package/dist/{internal/RecheckContext.d.ts → RecheckContext.d.ts} +0 -0
- /package/dist/{internal/RecheckContext.js → RecheckContext.js} +0 -0
- /package/dist/{internal/SignOutRegistryContext.d.ts → SignOutRegistryContext.d.ts} +0 -0
- /package/dist/{internal/SignOutRegistryContext.js → SignOutRegistryContext.js} +0 -0
- /package/dist/{internal/adapters → adapters}/useLatestCallback.d.ts +0 -0
- /package/dist/{internal/adapters → adapters}/useLatestCallback.js +0 -0
- /package/dist/{internal/adapters → adapters}/useNoticePublisher.d.ts +0 -0
- /package/dist/{internal/adapters → adapters}/usePermissionFailure.d.ts +0 -0
- /package/dist/{internal/adapters → adapters}/useQueryNotice.d.ts +0 -0
- /package/dist/{internal/adapters → adapters}/useSubmissionCallbacks.d.ts +0 -0
- /package/dist/{internal/adapters → adapters}/useSubmissionCallbacks.js +0 -0
- /package/dist/{internal/loadedQuery.d.ts → loadedQuery.d.ts} +0 -0
- /package/dist/{internal/loadedQuery.js → loadedQuery.js} +0 -0
- /package/dist/{internal/noticeEntry.d.ts → noticeEntry.d.ts} +0 -0
- /package/dist/{internal/noticeEntry.js → noticeEntry.js} +0 -0
- /package/dist/{internal/noticeStore.d.ts → noticeStore.d.ts} +0 -0
- /package/dist/{internal/noticeStore.js → noticeStore.js} +0 -0
- /package/dist/{internal/registerLiveWindow.d.ts → registerLiveWindow.d.ts} +0 -0
- /package/dist/{internal/registerLiveWindow.js → registerLiveWindow.js} +0 -0
- /package/dist/{internal/sessionRecheck.d.ts → sessionRecheck.d.ts} +0 -0
- /package/dist/{internal/sessionRecheck.js → sessionRecheck.js} +0 -0
- /package/src/{internal/NoticeContext.ts → NoticeContext.ts} +0 -0
- /package/src/{internal/PermissionContext.ts → PermissionContext.ts} +0 -0
- /package/src/{internal/RecheckContext.ts → RecheckContext.ts} +0 -0
- /package/src/{internal/SignOutRegistryContext.ts → SignOutRegistryContext.ts} +0 -0
- /package/src/{internal/adapters → adapters}/useLatestCallback.ts +0 -0
- /package/src/{internal/adapters → adapters}/useSubmissionCallbacks.ts +0 -0
- /package/src/{internal/loadedQuery.ts → loadedQuery.ts} +0 -0
- /package/src/{internal/noticeEntry.ts → noticeEntry.ts} +0 -0
- /package/src/{internal/noticeStore.ts → noticeStore.ts} +0 -0
- /package/src/{internal/registerLiveWindow.ts → registerLiveWindow.ts} +0 -0
- /package/src/{internal/sessionRecheck.ts → sessionRecheck.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.44.1 - 2026-11-05
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Update `@shivaedev/contract` from 0.39.0 to 0.40.0.
|
|
8
|
+
- Update `@shivaedev/identity` from 0.27.0 to 0.28.0.
|
|
9
|
+
|
|
10
|
+
## 0.44.0 - 2026-11-05
|
|
11
|
+
|
|
12
|
+
### Breaking
|
|
13
|
+
|
|
14
|
+
- Require Effect 4.1.0 and its matching companion packages. Move `effect`, `@effect/platform-node`, `@effect/platform-node-shared`, `@effect/sql-pg`, `@effect/sql-sqlite-node`, `@effect/atom-react` and `@effect/vitest` to exactly 4.1.0 together. `clientCrypto` provides `SecureRandom` and `Digest` from `effect/crypto` instead of `Crypto`, and `useNewId` needs an atom runtime with `SecureRandom`. Replace `Crypto.Crypto` in handler and runtime types with those services.
|
|
15
|
+
|
|
16
|
+
## 0.43.0 - 2026-11-05
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- `SessionBoundary` accepts a native atom `runtime` for its session-recheck retry loop. Supply a runtime carrying the story Clock to drive recovery backoff without real waits.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Story examples use the controlled clock.
|
|
25
|
+
|
|
26
|
+
### Breaking
|
|
27
|
+
|
|
28
|
+
- Remove `internal/` from module imports, including imports of its adapters.
|
|
29
|
+
|
|
3
30
|
## 0.42.0 - 2026-11-05
|
|
4
31
|
|
|
5
32
|
### Added
|
package/README.md
CHANGED
|
@@ -84,7 +84,7 @@ export function App({ session, recheck }: { readonly session: Session | undefine
|
|
|
84
84
|
|
|
85
85
|
Pass the signed-out router as `signedOut` and the requested continuation address as `redirectTo` (for example, the sign-in route's `returnTo` search value). On successful sign-in, the auth owner supplies the new `session`; the boundary unmounts the signed-out tree before replacing the URL, then mounts the signed-in tree at that address. The sign-in screen requests a session recheck after success; it leaves navigation to the boundary. Off-site, non-HTTP and malformed targets fall back to `/`. A same-origin destination keeps its path, query and fragment. The default replacement uses browser history. Supply `navigate={(href) => history.replace(href)}` for a router history such as TanStack's memory history; the callback receives only the checked local path. Navigation happens once when entering a generation, so a same-user session rotation does not navigate again.
|
|
86
86
|
|
|
87
|
-
A query that fails with an `Unauthorized` from `@shivaedev/errors/taxonomy.ts` asks `recheck` to run and keeps its retained data. An action does the same once per failed result, retaining its last successful `data` and the typed failure in `cause`; rerendering that result does not repeat the recheck. A live reconnect requests a check only for a typed `Unauthorized` authentication refusal; dropped sockets and unreachable servers leave the session alone. Pass the auth owner’s session-refresh Effect as `recheck` (for example, `recheck={auth.session.refresh}`). The boundary shares an in-flight check, retries failures after 1, 2, 4 seconds and so on up to 30 seconds, and retries immediately on visible `online` or `visibilitychange` events while a check is pending, restarting an in-flight check too. Session replacement and unmount cancel retries. Existing void callbacks remain supported; they keep their own check and retry policy. Keep retained session data on screen when a refresh exposes a failure, and pass `session={undefined}` only after a definite signed-out answer. The auth owner decides whether the session ends. The boundary also handles React StrictMode's effect replay and preserves component state across hiding and revealing an `<Activity>` subtree, supplying a live registry when revealed.
|
|
87
|
+
A query that fails with an `Unauthorized` from `@shivaedev/errors/taxonomy.ts` asks `recheck` to run and keeps its retained data. An action does the same once per failed result, retaining its last successful `data` and the typed failure in `cause`; rerendering that result does not repeat the recheck. A live reconnect requests a check only for a typed `Unauthorized` authentication refusal; dropped sockets and unreachable servers leave the session alone. Pass the auth owner’s session-refresh Effect as `recheck` (for example, `recheck={auth.session.refresh}`). The boundary shares an in-flight check, retries failures after 1, 2, 4 seconds and so on up to 30 seconds, and retries immediately on visible `online` or `visibilitychange` events while a check is pending, restarting an in-flight check too. Session replacement and unmount cancel retries. Supply `runtime` on `SessionBoundary` to run these retries on a native atom runtime, including one carrying a story’s controlled Clock. Existing void callbacks remain supported; they keep their own check and retry policy. Keep retained session data on screen when a refresh exposes a failure, and pass `session={undefined}` only after a definite signed-out answer. The auth owner decides whether the session ends. The boundary also handles React StrictMode's effect replay and preserves component state across hiding and revealing an `<Activity>` subtree, supplying a live registry when revealed.
|
|
88
88
|
|
|
89
89
|
#### Session-scoped bindings
|
|
90
90
|
|
|
@@ -1055,7 +1055,7 @@ const [createdAt] = useState(now);
|
|
|
1055
1055
|
const stamp = () => ({ id: newId(), at: now() });
|
|
1056
1056
|
```
|
|
1057
1057
|
|
|
1058
|
-
These lines belong inside a component; `client` is the application's atom client. Stories pass a runtime containing their test Clock and seeded
|
|
1058
|
+
These lines belong inside a component; `client` is the application's atom client. Stories pass a runtime containing their test Clock and seeded `SecureRandom`. The hooks use native atom suspense while the runtime builds. `useNewId` reads `SecureRandom` from `effect/crypto`, whose UUID generation must be synchronous. Without a runtime, they use a shared native runtime with Effect's default Clock and `clientCrypto` from `@shivaedev/react/client/adapters/crypto.ts`, which merges Effect's Web Crypto `SecureRandom` and `Digest` Layers. Provide that Layer to an application's runtime when it needs browser crypto.
|
|
1059
1059
|
|
|
1060
1060
|
`usePromiseAction(() => promise, options?)` from `@shivaedev/react/client/adapters/usePromiseAction.ts` returns the same state as `useAction`, with `dispatch()` taking no input. It runs the callback on dispatch, keeps its atom across rerenders and calls the latest committed callback. A promise rejection or synchronous throw becomes `Cause.UnknownError` by default. Supply `catch` to map the unknown cause into an application's typed failure:
|
|
1061
1061
|
|
|
@@ -1106,7 +1106,6 @@ const Add = command("add", { invalidates: () => [notes.list], payload: { title:
|
|
|
1106
1106
|
const Notes = contract("notes", { commands: [Add], queries: [List] });
|
|
1107
1107
|
|
|
1108
1108
|
export const notesScreen = storyKit({
|
|
1109
|
-
clock: "live",
|
|
1110
1109
|
*create() {
|
|
1111
1110
|
const handlers = Notes.toLayer(
|
|
1112
1111
|
Effect.gen(function* () {
|
|
@@ -1189,7 +1188,7 @@ notesScreen.it("a command refetches the rendered notes through native RPC", [],
|
|
|
1189
1188
|
|
|
1190
1189
|
`render(node, options?)` returns the attached `container`, its fresh native `registry`, `render(nextNode)` to update the same root and registry, and `unmount()` to release the root, registry and container. The options are React's own `RootOptions`, passed to `createRoot`, including `onCaughtError`, `onUncaughtError` and `onRecoverableError`. Acquire the view with `Effect.acquireRelease` so its scope releases it on success, failure or interruption. The screen driver's `act` adapter keeps component interactions and settling inside React's `act`. `expectNoReactWarnings()` registers a Vitest hook that fails a test if it logged to `console.error`.
|
|
1191
1190
|
|
|
1192
|
-
The RPC layer stays application-owned: replace these in-memory handlers with the service Layer your component needs.
|
|
1191
|
+
The RPC layer stays application-owned: replace these in-memory handlers with the service Layer your component needs. Services declare their dependencies once in `requires` and yield them in their operations, including `Identity` for the caller. Register caller-dependent Layers in the host’s `requestServices` slot and shared repository Layers in `services`; handlers yield the service during each call and pass only the operation’s payload. Test-support services follow the same model, with `Effect.void` initialization when they own no lifetime state and captured-context bridges in `adapters/`.
|
|
1193
1192
|
|
|
1194
1193
|
For a boundary fallback test, keep the warnings guard and declare the caught error inside the test. `expectCaughtError(predicate)` returns an `onCaughtError` handler that accepts matching errors without logging them. The guard fails if the handler receives any other error or the expected error never arrives. Other console errors and React warnings still fail the guard.
|
|
1195
1194
|
|
|
@@ -2,6 +2,6 @@ export declare const NoticeContext: import("react").Context<{
|
|
|
2
2
|
active: boolean;
|
|
3
3
|
close: () => void;
|
|
4
4
|
entries: import("effect/reactivity/Atom").Writable<readonly import("./noticeEntry.ts").NoticeEntry[], readonly import("./noticeEntry.ts").NoticeEntry[]>;
|
|
5
|
-
publish: (descriptor: Pick<import("
|
|
5
|
+
publish: (descriptor: Pick<import("./notices.ts").NoticeDescriptor, "message" | "expiresIn">, action?: import("./noticeEntry.ts").NoticeAction) => void;
|
|
6
6
|
} | undefined>;
|
|
7
7
|
//# sourceMappingURL=NoticeContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoticeContext.d.ts","sourceRoot":"","sources":["../src/NoticeContext.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa;;;;;cAAuE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoticeContext.js","sourceRoot":"","sources":["../src/NoticeContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAA6C,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissionContext.d.ts","sourceRoot":"","sources":["../src/PermissionContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAElF,eAAO,MAAM,iBAAiB;uBAAsC,SAAS;sBAAoB,iBAAiB,GAAG,IAAI,GAAG,SAAS;cAEpI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissionContext.js","sourceRoot":"","sources":["../src/PermissionContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,OAAO,CAAC;AAGtD,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAC7C,SAAS,CACT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecheckContext.d.ts","sourceRoot":"","sources":["../src/RecheckContext.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,gCAAuB,IAAI,CAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecheckContext.js","sourceRoot":"","sources":["../src/RecheckContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAa,GAAS,EAAE,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignOutRegistryContext.d.ts","sourceRoot":"","sources":["../src/SignOutRegistryContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,YAAY,MAAM,gCAAgC,CAAC;AAGpE,eAAO,MAAM,sBAAsB,gEAAkE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignOutRegistryContext.js","sourceRoot":"","sources":["../src/SignOutRegistryContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAwC,SAAS,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import * as AtomRegistry from "effect/reactivity/AtomRegistry";
|
|
3
|
-
import { recheckUnauthorized } from "#
|
|
3
|
+
import { recheckUnauthorized } from "#sessionRecheck.ts";
|
|
4
4
|
import { keepLoaderQuery } from "./queryHandoff.js";
|
|
5
5
|
export async function loadQuery(registry, atom, { abortController }) {
|
|
6
6
|
const { signal } = abortController;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadQuery.js","sourceRoot":"","sources":["../../src/adapters/loadQuery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,KAAK,YAAY,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"loadQuery.js","sourceRoot":"","sources":["../../src/adapters/loadQuery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,KAAK,YAAY,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,CAAC,KAAK,UAAU,SAAS,CAC9B,QAAmC,EACnC,IAA8C,EAC9C,EAAE,eAAe,EAA4C;IAE7D,MAAM,EAAE,MAAM,EAAE,GAAG,eAAe,CAAC;IACnC,MAAM,OAAO,GAAG,eAAe,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACxD,IAAI,CAAC;QACJ,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QACtI,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC/B,MAAM,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;YACpD,MAAM,MAAM,CAAC,OAAO,CAAC;QACtB,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,QAAQ,GAAG,IAAI,KAAK,CAAC,wBAAwB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;YACvE,QAAQ,CAAC,IAAI,GAAG,YAAY,CAAC;YAC7B,MAAM,QAAQ,CAAC;QAChB,CAAC;QACD,MAAM,KAAK,CAAC;IACb,CAAC;YAAS,CAAC;QACV,OAAO,CAAC,QAAQ,EAAE,CAAC;IACpB,CAAC;AACF,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { CatchBoundary } from "@tanstack/react-router";
|
|
|
2
2
|
import { createElement, useContext } from "react";
|
|
3
3
|
import { isForbidden } from "@shivaedev/errors/taxonomy.ts";
|
|
4
4
|
import { can } from "#can.ts";
|
|
5
|
-
import { PermissionContext } from "#
|
|
5
|
+
import { PermissionContext } from "#PermissionContext.ts";
|
|
6
6
|
export function useCan() {
|
|
7
7
|
const context = useContext(PermissionContext);
|
|
8
8
|
return (permission) => can(context?.session, permission);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissionBoundary.js","sourceRoot":"","sources":["../../src/adapters/permissionBoundary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAkB,UAAU,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"permissionBoundary.js","sourceRoot":"","sources":["../../src/adapters/permissionBoundary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAkB,UAAU,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAQ1D,MAAM,UAAU,MAAM;IACrB,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC9C,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,EAAE,KAAK,EAA+B;IAC7E,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC9C,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,KAAK,CAAC;IACb,CAAC;IACD,OAAO,OAAO,EAAE,QAAQ,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAA2B;IAC1F,OAAO,aAAa,CACnB,iBAAiB,CAAC,QAAQ,EAC1B,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAChC,aAAa,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,uBAAuB,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC,CACpH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLatestCallback.d.ts","sourceRoot":"","sources":["../../src/adapters/useLatestCallback.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,CAM/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLatestCallback.js","sourceRoot":"","sources":["../../src/adapters/useLatestCallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE7D,MAAM,UAAU,iBAAiB,CAAI,QAAiB;IACrD,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IACnC,eAAe,CAAC,GAAG,EAAE;QACpB,SAAS,CAAC,OAAO,GAAG,QAAQ,CAAC;IAC9B,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACf,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNoticePublisher.d.ts","sourceRoot":"","sources":["../../src/adapters/useNoticePublisher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAIpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAAS,KAAK,IAAI,CAG/H"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext, useMemo } from "react";
|
|
2
|
-
import { NoticeContext } from "#
|
|
3
|
-
import { publishNotice } from "#
|
|
2
|
+
import { NoticeContext } from "#NoticeContext.ts";
|
|
3
|
+
import { publishNotice } from "#noticeStore.ts";
|
|
4
4
|
export function useNoticePublisher(runtime) {
|
|
5
5
|
const store = useContext(NoticeContext);
|
|
6
6
|
return useMemo(() => (descriptor) => publishNotice(store, runtime, descriptor), [store, runtime]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNoticePublisher.js","sourceRoot":"","sources":["../../src/adapters/useNoticePublisher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,MAAM,UAAU,kBAAkB,CAAO,OAA+B;IACvE,MAAM,KAAK,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IACxC,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,UAA2C,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AACpI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePermissionFailure.d.ts","sourceRoot":"","sources":["../../src/adapters/usePermissionFailure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKvC,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAQlF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Cause, Option } from "effect";
|
|
2
2
|
import { useContext } from "react";
|
|
3
3
|
import { isForbidden } from "@shivaedev/errors/taxonomy.ts";
|
|
4
|
-
import { PermissionContext } from "#
|
|
4
|
+
import { PermissionContext } from "#PermissionContext.ts";
|
|
5
5
|
export function usePermissionFailure(cause) {
|
|
6
6
|
const context = useContext(PermissionContext);
|
|
7
7
|
if (context !== undefined) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePermissionFailure.js","sourceRoot":"","sources":["../../src/adapters/usePermissionFailure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,UAAU,oBAAoB,CAAI,KAAoC;IAC3E,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC9C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;QAC7D,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1D,MAAM,OAAO,CAAC,KAAK,CAAC;QACrB,CAAC;IACF,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useQueryNotice.d.ts","sourceRoot":"","sources":["../../src/adapters/useQueryNotice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAS,MAAM,QAAQ,CAAC;AAC3C,OAAO,KAAK,WAAW,MAAM,+BAA+B,CAAC;AAK7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIpD,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,EAClC,MAAM,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,EACrC,UAAU,EAAE,OAAO,EACnB,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;CAAE,KAAK,gBAAgB,GAAG,SAAS,CAAC,GAAG,SAAS,QAkBjI"}
|
|
@@ -2,8 +2,8 @@ import { Layer } from "effect";
|
|
|
2
2
|
import * as AsyncResult from "effect/reactivity/AsyncResult";
|
|
3
3
|
import * as Atom from "effect/reactivity/Atom";
|
|
4
4
|
import { useContext, useEffect, useInsertionEffect, useRef } from "react";
|
|
5
|
-
import { NoticeContext } from "#
|
|
6
|
-
import { publishNotice } from "#
|
|
5
|
+
import { NoticeContext } from "#NoticeContext.ts";
|
|
6
|
+
import { publishNotice } from "#noticeStore.ts";
|
|
7
7
|
const runtime = Atom.runtime(Layer.empty);
|
|
8
8
|
export function useQueryNotice(result, refreshing, notice) {
|
|
9
9
|
const store = useContext(NoticeContext);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useQueryNotice.js","sourceRoot":"","sources":["../../src/adapters/useQueryNotice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,KAAK,WAAW,MAAM,+BAA+B,CAAC;AAC7D,OAAO,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAE1C,MAAM,UAAU,cAAc,CAC7B,MAAqC,EACrC,UAAmB,EACnB,MAAiI;IAEjI,MAAM,KAAK,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IACxC,MAA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I,EAAE,CAAC,MAAwB,EAAwC,EAAE,CACxE,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CACxD,MAAM,CAAC,WAAW,CAAC;gBAClB,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;gBAC7C,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC;aAC9C,CAAC,CACF;SACF,CAAC;IACH,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACtB,kBAAkB,CAAC,GAAG,EAAE;QACvB,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC;QACxB,OAAO,GAAG,EAAE;YACX,SAAS,CAAC,MAAM,GAAG,KAAK,CAAC;QAC1B,CAAC,CAAC;IACH,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAChB,OAAO,SAAS,CAAC;AAClB,CAAC"}
|
|
@@ -2,8 +2,8 @@ import { RegistryContext } from "@effect/atom-react";
|
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
import { useContext, useInsertionEffect, useMemo, useRef } from "react";
|
|
4
4
|
import { isUnauthorized } from "@shivaedev/errors/taxonomy.ts";
|
|
5
|
-
import { NoticeContext } from "#
|
|
6
|
-
import { publishNotice } from "#
|
|
5
|
+
import { NoticeContext } from "#NoticeContext.ts";
|
|
6
|
+
import { publishNotice } from "#noticeStore.ts";
|
|
7
7
|
import { useSessionRecheck } from "./sessionBoundary.js";
|
|
8
8
|
export function useActionSource(source, run, options) {
|
|
9
9
|
const registry = useContext(RegistryContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actionCompletion.js","sourceRoot":"","sources":["../../src/client/actionCompletion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,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C;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACZ,OAAO,KAAK,CAAC,IAAI,CAAC;AACnB,CAAC"}
|
|
@@ -4,10 +4,10 @@ import * as AtomRegistry from "effect/reactivity/AtomRegistry";
|
|
|
4
4
|
import { createElement, useEffect, useState } from "react";
|
|
5
5
|
import { LiveConnection } from "@shivaedev/contract/automaticLive.ts";
|
|
6
6
|
import { liveBindings } from "@shivaedev/contract/composeBindings.ts";
|
|
7
|
+
import { useLatestCallback } from "#adapters/useLatestCallback.ts";
|
|
7
8
|
import { mountLive } from "#client/mountLive.ts";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { registerSessionRecheck } from "#internal/sessionRecheck.ts";
|
|
9
|
+
import { RecheckContext } from "#RecheckContext.ts";
|
|
10
|
+
import { registerSessionRecheck } from "#sessionRecheck.ts";
|
|
11
11
|
function owning(connect, identity) {
|
|
12
12
|
const registry = AtomRegistry.make({ "defaultIdleTTL": 400 });
|
|
13
13
|
let client;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionGeneration.js","sourceRoot":"","sources":["../../../src/client/adapters/SessionGeneration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAiB,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,KAAK,YAAY,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAkB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SessionGeneration.js","sourceRoot":"","sources":["../../../src/client/adapters/SessionGeneration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CA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,EAAE,kBAAkB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAClH,CAAC;QACF,OAAO,GAAG,EAAE;YACX,QAAQ,EAAE,CAAC;YACX,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;YACnB,cAAc,CAAC,GAAG,EAAE;gBACnB,IAAI,KAAK,CAAC,OAAO,GAAG,CAAC,EAAE,CAAC;oBACvB,OAAO;gBACR,CAAC;gBACD,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;gBACzB,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YAC1E,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,CAAC,CAAC,CAAC;IAChD,OAAO,aAAa,CACnB,cAAc,CAAC,QAAQ,EACvB,EAAE,KAAK,EAAE,aAAa,EAAE,EACxB,aAAa,CAAC,eAAe,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAC1F,CAAC;AACH,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Layer } from "effect";
|
|
2
|
+
import { Digest, SecureRandom } from "effect/crypto";
|
|
3
|
+
export declare const clientCrypto: Layer.Layer<Digest.Digest | SecureRandom.SecureRandom, never, never>;
|
|
3
4
|
//# sourceMappingURL=crypto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../../src/client/adapters/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../../src/client/adapters/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAErD,eAAO,MAAM,YAAY,sEAAkE,CAAC"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
catch: (cause) => PlatformError.systemError({ _tag: "Unknown", cause, description: "Could not compute digest", method: "digest", module: "Crypto" }),
|
|
5
|
-
try: () => globalThis.crypto.subtle.digest(algorithm, new Uint8Array(data)).then((buffer) => new Uint8Array(buffer)),
|
|
6
|
-
}),
|
|
7
|
-
randomBytes: (size) => globalThis.crypto.getRandomValues(new Uint8Array(size)),
|
|
8
|
-
}));
|
|
1
|
+
import { Layer } from "effect";
|
|
2
|
+
import { Digest, SecureRandom } from "effect/crypto";
|
|
3
|
+
export const clientCrypto = Layer.merge(SecureRandom.layerWebCrypto, Digest.layerWebCrypto);
|
|
9
4
|
//# sourceMappingURL=crypto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../../src/client/adapters/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../../src/client/adapters/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as Atom from "effect/reactivity/Atom";
|
|
2
|
-
export declare const handlerRuntime: Atom.AtomRuntime<import("effect/
|
|
2
|
+
export declare const handlerRuntime: Atom.AtomRuntime<import("effect/crypto/Digest").Digest | import("effect/crypto/SecureRandom").SecureRandom, never>;
|
|
3
3
|
//# sourceMappingURL=handlerRuntime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlerRuntime.d.ts","sourceRoot":"","sources":["../../../src/client/adapters/handlerRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAG/C,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"handlerRuntime.d.ts","sourceRoot":"","sources":["../../../src/client/adapters/handlerRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAG/C,eAAO,MAAM,cAAc,oHAA6B,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { Effect } from "effect";
|
|
|
3
3
|
import * as AtomRegistry from "effect/reactivity/AtomRegistry";
|
|
4
4
|
import { useContext, useEffect } from "react";
|
|
5
5
|
import { queryCoalesceWindow } from "@shivaedev/contract/queryCoalesceWindow.ts";
|
|
6
|
-
import { registerLiveWindow } from "#
|
|
6
|
+
import { registerLiveWindow } from "#registerLiveWindow.ts";
|
|
7
7
|
export function useLiveWindow(atom, window) {
|
|
8
8
|
const registry = useContext(RegistryContext);
|
|
9
9
|
useEffect(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLiveWindow.js","sourceRoot":"","sources":["../../../src/client/adapters/useLiveWindow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAiB,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE/C,OAAO,KAAK,YAAY,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useLiveWindow.js","sourceRoot":"","sources":["../../../src/client/adapters/useLiveWindow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAiB,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE/C,OAAO,KAAK,YAAY,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,UAAU,aAAa,CAAC,IAAwB,EAAE,MAAkC;IACzF,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAC7C,SAAS,CAAC,GAAG,EAAE;QACd,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO;QACR,CAAC;QACD,OAAO,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,YAAY,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC/I,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Context
|
|
1
|
+
import { Context } from "effect";
|
|
2
|
+
import { SecureRandom } from "effect/crypto";
|
|
2
3
|
import type * as AsyncResult from "effect/reactivity/AsyncResult";
|
|
3
4
|
import type * as Atom from "effect/reactivity/Atom";
|
|
4
|
-
export declare function useNewId(runtime?: Atom.Atom<AsyncResult.AsyncResult<Context.Context<
|
|
5
|
+
export declare function useNewId(runtime?: Atom.Atom<AsyncResult.AsyncResult<Context.Context<SecureRandom.SecureRandom>, unknown>>): () => string;
|
|
5
6
|
//# sourceMappingURL=useNewId.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNewId.d.ts","sourceRoot":"","sources":["../../../src/client/adapters/useNewId.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"useNewId.d.ts","sourceRoot":"","sources":["../../../src/client/adapters/useNewId.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAU,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,KAAK,WAAW,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAIpD,wBAAgB,QAAQ,CACvB,OAAO,GAAE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC,CAAkB,GAC/G,MAAM,MAAM,CAGd"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { useAtomSuspense } from "@effect/atom-react";
|
|
2
|
-
import { Context,
|
|
2
|
+
import { Context, Effect } from "effect";
|
|
3
|
+
import { SecureRandom } from "effect/crypto";
|
|
3
4
|
import { useCallback } from "react";
|
|
4
5
|
import { handlerRuntime } from "#client/adapters/handlerRuntime.ts";
|
|
5
6
|
export function useNewId(runtime = handlerRuntime) {
|
|
6
|
-
const
|
|
7
|
-
return useCallback(() => Effect.runSync(
|
|
7
|
+
const random = Context.get(useAtomSuspense(runtime).value, SecureRandom.SecureRandom);
|
|
8
|
+
return useCallback(() => Effect.runSync(random.uuidV4()), [random]);
|
|
8
9
|
}
|
|
9
10
|
//# sourceMappingURL=useNewId.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNewId.js","sourceRoot":"","sources":["../../../src/client/adapters/useNewId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useNewId.js","sourceRoot":"","sources":["../../../src/client/adapters/useNewId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,MAAM,UAAU,QAAQ,CACvB,OAAO,GAA4F,cAAc;IAEjH,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;IACtF,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { SessionBoundaryProps } from "#client/sessionBoundary.ts";
|
|
2
|
-
export declare function useSessionRetry(recheck: SessionBoundaryProps<unknown, unknown>["recheck"], identity: string | undefined): () => void;
|
|
2
|
+
export declare function useSessionRetry(recheck: SessionBoundaryProps<unknown, unknown>["recheck"], identity: string | undefined, runtime?: NonNullable<SessionBoundaryProps<unknown, unknown>["runtime"]>): () => void;
|
|
3
3
|
//# sourceMappingURL=useSessionRetry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSessionRetry.d.ts","sourceRoot":"","sources":["../../../src/client/adapters/useSessionRetry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSessionRetry.d.ts","sourceRoot":"","sources":["../../../src/client/adapters/useSessionRetry.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAIvE,wBAAgB,eAAe,CAC9B,OAAO,EAAE,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,EAC1D,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,GAAE,WAAW,CAAC,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS,CAAC,CAAkB,GACtF,MAAM,IAAI,CAuCZ"}
|
|
@@ -1,39 +1,34 @@
|
|
|
1
|
-
import { RegistryContext } from "@effect/atom-react";
|
|
2
|
-
import { Effect,
|
|
1
|
+
import { RegistryContext, useAtomValue } from "@effect/atom-react";
|
|
2
|
+
import { Effect, Layer, Schedule } from "effect";
|
|
3
|
+
import * as Atom from "effect/reactivity/Atom";
|
|
3
4
|
import * as AtomRegistry from "effect/reactivity/AtomRegistry";
|
|
4
5
|
import { useContext, useEffect, useMemo } from "react";
|
|
5
|
-
import { useLatestCallback } from "#
|
|
6
|
-
|
|
6
|
+
import { useLatestCallback } from "#adapters/useLatestCallback.ts";
|
|
7
|
+
const defaultRuntime = Atom.runtime(Layer.empty);
|
|
8
|
+
export function useSessionRetry(recheck, identity, runtime = defaultRuntime) {
|
|
7
9
|
const registry = useContext(RegistryContext);
|
|
8
10
|
const latest = useLatestCallback(() => (Effect.isEffect(recheck) ? recheck : Effect.sync(recheck)));
|
|
9
11
|
const retry = useMemo(() => {
|
|
10
|
-
|
|
12
|
+
const task = runtime
|
|
13
|
+
.fn(() => Effect.suspend(latest).pipe(Effect.retry(Schedule.min([Schedule.exponential("1 second"), Schedule.spaced("30 seconds")])), Effect.provideService(AtomRegistry.AtomRegistry, registry)))
|
|
14
|
+
.pipe(Atom.setIdleTTL(0));
|
|
11
15
|
function stop() {
|
|
12
|
-
|
|
13
|
-
Effect.runFork(Fiber.interrupt(running));
|
|
14
|
-
running = undefined;
|
|
15
|
-
}
|
|
16
|
+
registry.set(task, Atom.Interrupt);
|
|
16
17
|
}
|
|
17
18
|
function start() {
|
|
18
|
-
if (
|
|
19
|
-
|
|
19
|
+
if (!registry.get(task).waiting && identity !== undefined) {
|
|
20
|
+
registry.set(task, undefined);
|
|
20
21
|
}
|
|
21
|
-
const fiber = Effect.runFork(Effect.suspend(latest).pipe(Effect.retry(Schedule.min([Schedule.exponential("1 second"), Schedule.spaced("30 seconds")])), Effect.provideService(AtomRegistry.AtomRegistry, registry)));
|
|
22
|
-
running = fiber;
|
|
23
|
-
fiber.addObserver(() => {
|
|
24
|
-
if (running === fiber) {
|
|
25
|
-
running = undefined;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
22
|
}
|
|
29
23
|
function resume() {
|
|
30
|
-
if (
|
|
24
|
+
if (registry.get(task).waiting && window.document.visibilityState === "visible") {
|
|
31
25
|
stop();
|
|
32
26
|
start();
|
|
33
27
|
}
|
|
34
28
|
}
|
|
35
|
-
return { resume, start, stop };
|
|
36
|
-
}, [latest, registry, identity]);
|
|
29
|
+
return { resume, start, stop, task };
|
|
30
|
+
}, [latest, registry, identity, runtime]);
|
|
31
|
+
useAtomValue(retry.task);
|
|
37
32
|
useEffect(() => {
|
|
38
33
|
window.addEventListener("online", retry.resume);
|
|
39
34
|
window.addEventListener("visibilitychange", retry.resume);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSessionRetry.js","sourceRoot":"","sources":["../../../src/client/adapters/useSessionRetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"useSessionRetry.js","sourceRoot":"","sources":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C;IACZ,OAAO,KAAK,CAAC,KAAK,CAAC;AACpB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import * as Atom from "effect/reactivity/Atom";
|
|
|
5
5
|
import * as AtomRegistry from "effect/reactivity/AtomRegistry";
|
|
6
6
|
import { useContext, useEffect, useMemo } from "react";
|
|
7
7
|
import { useAction } from "#client/resultState.ts";
|
|
8
|
-
import { SignOutRegistryContext } from "#
|
|
8
|
+
import { SignOutRegistryContext } from "#SignOutRegistryContext.ts";
|
|
9
9
|
export function useSignOut(action, options) {
|
|
10
10
|
const router = useRouter({ warn: false });
|
|
11
11
|
const local = useContext(RegistryContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignOut.js","sourceRoot":"","sources":["../../../src/client/adapters/useSignOut.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAC/C,OAAO,KAAK,YAAY,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useSignOut.js","sourceRoot":"","sources":["../../../src/client/adapters/useSignOut.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,wBAAwB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O,CAAC,QAAQ,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAAC,CAAC;QACtH,CAAC;IACF,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACzC,OAAO;QACN,GAAG,KAAK;QACR,QAAQ,EAAE,GAAG,EAAE;YACd,IAAI,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC;gBACjE,OAAO;YACR,CAAC;YACD,IAAI,MAAM,EAAE,CAAC;gBACZ,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;YACrH,CAAC;YACD,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAC1B,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAChC,CAAC;KACD,CAAC;AACH,CAAC"}
|
package/dist/client/create.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Equal, Option } from "effect";
|
|
2
2
|
import { useCallback, useState } from "react";
|
|
3
3
|
import { usePersistedDraft } from "@shivaedev/form/adapters/react.ts";
|
|
4
|
-
import { useSubmissionCallbacks } from "#
|
|
4
|
+
import { useSubmissionCallbacks } from "#adapters/useSubmissionCallbacks.ts";
|
|
5
5
|
import { submission } from "#submission.ts";
|
|
6
6
|
import { useSaveState } from "./saveState.js";
|
|
7
7
|
function resetValues(baseline, current, submitted = current) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/client/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KA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;IACpD,MAAM,OAAO,GAAG,WAAW,CAC1B,CAAC,KAAe,EAAE,EAAE;QACnB,MAAM,IAAI,GAAG,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QAC5F,IAAI,CAAC,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAChE,CAAC,EACD,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CACjC,CAAC;IACF,OAAO,EAAE,GAAG,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;AAChF,CAAC"}
|
package/dist/client/editor.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Option } from "effect";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { usePersistedDraft } from "@shivaedev/form/adapters/react.ts";
|
|
4
|
-
import { useSubmissionCallbacks } from "#
|
|
5
|
-
import { loadedQuery } from "#
|
|
4
|
+
import { useSubmissionCallbacks } from "#adapters/useSubmissionCallbacks.ts";
|
|
5
|
+
import { loadedQuery } from "#loadedQuery.ts";
|
|
6
6
|
import { submission } from "#submission.ts";
|
|
7
7
|
import { useQuery } from "./resultState.js";
|
|
8
8
|
import { useSaveState } from "./saveState.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../src/client/editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAe,MAAM,QAAQ,CAAC;AAG1D,OAAO,EAAE,SAAS,EAAE,QAAQ,EA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