@astrale-os/shell-react 0.2.0 → 0.2.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/dist/application/apps/app-host.d.ts +2 -2
- package/dist/application/apps/app-host.d.ts.map +1 -1
- package/dist/application/apps/app-host.js +3 -3
- package/dist/application/apps/apps.hook.d.ts +1 -1
- package/dist/application/apps/apps.hook.d.ts.map +1 -1
- package/dist/application/apps/apps.hook.js +4 -4
- package/dist/application/apps/open-app.hook.d.ts +1 -1
- package/dist/application/apps/open-app.hook.d.ts.map +1 -1
- package/dist/application/apps/open-app.hook.js +3 -3
- package/dist/application/index.d.ts +16 -16
- package/dist/application/index.d.ts.map +1 -1
- package/dist/application/index.js +9 -9
- package/dist/application/roles.hook.d.ts +1 -1
- package/dist/application/roles.hook.d.ts.map +1 -1
- package/dist/application/roles.hook.js +3 -3
- package/dist/application/spaces/current-space.hook.d.ts +1 -1
- package/dist/application/spaces/current-space.hook.d.ts.map +1 -1
- package/dist/application/spaces/current-space.hook.js +3 -3
- package/dist/application/spaces/space.hook.d.ts +1 -1
- package/dist/application/spaces/space.hook.d.ts.map +1 -1
- package/dist/application/spaces/space.hook.js +4 -4
- package/dist/application/spaces/spaces.hook.d.ts +2 -2
- package/dist/application/spaces/spaces.hook.d.ts.map +1 -1
- package/dist/application/spaces/spaces.hook.js +5 -5
- package/dist/application/user/user.hook.js +2 -2
- package/dist/auth/act-as.context.d.ts +1 -1
- package/dist/auth/act-as.context.d.ts.map +1 -1
- package/dist/auth/act-as.context.js +1 -1
- package/dist/auth/auth.hook.js +2 -2
- package/dist/auth/can.hook.d.ts +1 -1
- package/dist/auth/can.hook.d.ts.map +1 -1
- package/dist/auth/can.hook.js +2 -2
- package/dist/auth/index.d.ts +5 -5
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +4 -4
- package/dist/auth/self.hook.d.ts +1 -1
- package/dist/auth/self.hook.d.ts.map +1 -1
- package/dist/auth/self.hook.js +1 -1
- package/dist/auth/session-kernel.d.ts +1 -1
- package/dist/auth/session-kernel.d.ts.map +1 -1
- package/dist/auth/session-kernel.js +2 -2
- package/dist/graph/async.d.ts +1 -1
- package/dist/graph/async.d.ts.map +1 -1
- package/dist/graph/call/call.hook.d.ts +1 -1
- package/dist/graph/call/call.hook.d.ts.map +1 -1
- package/dist/graph/call/call.hook.js +2 -2
- package/dist/graph/call/stream.hook.js +1 -1
- package/dist/graph/index.d.ts +18 -18
- package/dist/graph/index.d.ts.map +1 -1
- package/dist/graph/index.js +8 -8
- package/dist/graph/memory/read/idle.d.ts +1 -1
- package/dist/graph/memory/read/idle.d.ts.map +1 -1
- package/dist/graph/memory/read/read.d.ts +1 -1
- package/dist/graph/memory/read/read.d.ts.map +1 -1
- package/dist/graph/memory/read/read.js +3 -3
- package/dist/graph/memory/scope.js +3 -3
- package/dist/graph/mutate/move.hook.d.ts +2 -2
- package/dist/graph/mutate/move.hook.d.ts.map +1 -1
- package/dist/graph/mutate/move.hook.js +3 -3
- package/dist/graph/mutate/mutate.hook.d.ts +1 -1
- package/dist/graph/mutate/mutate.hook.d.ts.map +1 -1
- package/dist/graph/mutate/mutate.hook.js +2 -2
- package/dist/graph/query/children.hook.d.ts +2 -2
- package/dist/graph/query/children.hook.d.ts.map +1 -1
- package/dist/graph/query/children.hook.js +2 -2
- package/dist/graph/query/graph.hook.js +1 -1
- package/dist/graph/query/neighbors.hook.d.ts +2 -2
- package/dist/graph/query/neighbors.hook.d.ts.map +1 -1
- package/dist/graph/query/neighbors.hook.js +2 -2
- package/dist/graph/query/node.hook.d.ts +2 -2
- package/dist/graph/query/node.hook.d.ts.map +1 -1
- package/dist/graph/query/node.hook.js +2 -2
- package/dist/graph/query/query.hook.d.ts +1 -1
- package/dist/graph/query/query.hook.d.ts.map +1 -1
- package/dist/graph/query/query.hook.js +1 -1
- package/dist/index.d.ts +25 -25
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -11
- package/dist/intents/index.d.ts +5 -5
- package/dist/intents/index.d.ts.map +1 -1
- package/dist/intents/index.js +2 -2
- package/dist/intents/listen-intent.hook.d.ts +1 -1
- package/dist/intents/listen-intent.hook.d.ts.map +1 -1
- package/dist/intents/listen-intent.hook.js +3 -3
- package/dist/intents/reply.js +1 -1
- package/dist/intents/send-intent.hook.d.ts +1 -1
- package/dist/intents/send-intent.hook.d.ts.map +1 -1
- package/dist/intents/send-intent.hook.js +2 -2
- package/dist/navigation/adapters/adapter.d.ts +1 -1
- package/dist/navigation/adapters/adapter.d.ts.map +1 -1
- package/dist/navigation/adapters/memory.adapter.d.ts +2 -2
- package/dist/navigation/adapters/memory.adapter.d.ts.map +1 -1
- package/dist/navigation/adapters/url.adapter.d.ts +1 -1
- package/dist/navigation/adapters/url.adapter.d.ts.map +1 -1
- package/dist/navigation/hooks/ancestors.hook.d.ts +2 -2
- package/dist/navigation/hooks/ancestors.hook.d.ts.map +1 -1
- package/dist/navigation/hooks/ancestors.hook.js +5 -5
- package/dist/navigation/hooks/location.hook.d.ts +1 -1
- package/dist/navigation/hooks/location.hook.d.ts.map +1 -1
- package/dist/navigation/hooks/location.hook.js +2 -2
- package/dist/navigation/hooks/navigate.hook.d.ts +1 -1
- package/dist/navigation/hooks/navigate.hook.d.ts.map +1 -1
- package/dist/navigation/hooks/navigate.hook.js +1 -1
- package/dist/navigation/hooks/scope.hook.d.ts +3 -3
- package/dist/navigation/hooks/scope.hook.d.ts.map +1 -1
- package/dist/navigation/hooks/scope.hook.js +3 -3
- package/dist/navigation/index.d.ts +15 -15
- package/dist/navigation/index.d.ts.map +1 -1
- package/dist/navigation/index.js +8 -8
- package/dist/navigation/link.d.ts +1 -1
- package/dist/navigation/link.d.ts.map +1 -1
- package/dist/navigation/link.js +2 -2
- package/dist/navigation/location.d.ts +1 -1
- package/dist/navigation/location.d.ts.map +1 -1
- package/dist/navigation/scope.context.d.ts +5 -5
- package/dist/navigation/scope.context.d.ts.map +1 -1
- package/dist/navigation/scope.context.js +5 -5
- package/dist/navigation/snapshot.d.ts +3 -3
- package/dist/navigation/snapshot.d.ts.map +1 -1
- package/dist/schema/bind-read.d.ts +2 -2
- package/dist/schema/bind-read.d.ts.map +1 -1
- package/dist/schema/bind-read.js +5 -5
- package/dist/schema/binding.d.ts +1 -1
- package/dist/schema/binding.d.ts.map +1 -1
- package/dist/schema/binding.js +2 -2
- package/dist/schema/domain.hook.js +3 -3
- package/dist/schema/function.hook.d.ts +2 -2
- package/dist/schema/function.hook.d.ts.map +1 -1
- package/dist/schema/function.hook.js +2 -2
- package/dist/schema/index.d.ts +9 -9
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +6 -6
- package/dist/schema/kernel.hook.js +3 -3
- package/dist/schema/method.hook.d.ts +1 -1
- package/dist/schema/method.hook.d.ts.map +1 -1
- package/dist/schema/method.hook.js +2 -2
- package/dist/schema/types.d.ts +2 -2
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/schema/write.d.ts +1 -1
- package/dist/schema/write.d.ts.map +1 -1
- package/dist/selection/index.d.ts +3 -3
- package/dist/selection/index.d.ts.map +1 -1
- package/dist/selection/index.js +2 -2
- package/dist/selection/live.js +1 -1
- package/dist/selection/scope.context.d.ts +1 -1
- package/dist/selection/scope.context.d.ts.map +1 -1
- package/dist/selection/scope.context.js +1 -1
- package/dist/selection/selection.hook.d.ts +1 -1
- package/dist/selection/selection.hook.d.ts.map +1 -1
- package/dist/selection/selection.hook.js +1 -1
- package/dist/session/boot/boot.d.ts +1 -1
- package/dist/session/boot/boot.d.ts.map +1 -1
- package/dist/session/boot/status.d.ts +1 -1
- package/dist/session/boot/status.d.ts.map +1 -1
- package/dist/session/connection/connection.hook.d.ts +1 -1
- package/dist/session/connection/connection.hook.d.ts.map +1 -1
- package/dist/session/connection/connection.hook.js +2 -2
- package/dist/session/index.d.ts +7 -7
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +5 -5
- package/dist/session/kernel-client.hook.js +1 -1
- package/dist/session/kernel-instance.hook.js +1 -1
- package/dist/session/provider.js +8 -8
- package/dist/session/shell.hook.js +1 -1
- package/dist/window/adopt.d.ts +2 -2
- package/dist/window/adopt.d.ts.map +1 -1
- package/dist/window/hooks/close-guard.hook.js +1 -1
- package/dist/window/hooks/target-node.hook.d.ts +2 -2
- package/dist/window/hooks/target-node.hook.d.ts.map +1 -1
- package/dist/window/hooks/target-node.hook.js +2 -2
- package/dist/window/hooks/views-for.hook.d.ts +2 -2
- package/dist/window/hooks/views-for.hook.d.ts.map +1 -1
- package/dist/window/hooks/views-for.hook.js +2 -2
- package/dist/window/hooks/window.hook.d.ts +1 -1
- package/dist/window/hooks/window.hook.d.ts.map +1 -1
- package/dist/window/hooks/window.hook.js +2 -2
- package/dist/window/hooks/windows.hook.js +2 -2
- package/dist/window/host.d.ts +2 -2
- package/dist/window/host.d.ts.map +1 -1
- package/dist/window/host.js +4 -4
- package/dist/window/hub.d.ts +3 -3
- package/dist/window/hub.d.ts.map +1 -1
- package/dist/window/hub.js +1 -1
- package/dist/window/index.d.ts +14 -14
- package/dist/window/index.d.ts.map +1 -1
- package/dist/window/index.js +7 -7
- package/dist/window/stage.js +3 -3
- package/package.json +3 -3
- package/src/application/apps/app-host.tsx +6 -6
- package/src/application/apps/apps.hook.ts +6 -6
- package/src/application/apps/open-app.hook.ts +4 -4
- package/src/application/index.ts +16 -16
- package/src/application/roles.hook.ts +4 -4
- package/src/application/spaces/current-space.hook.ts +4 -4
- package/src/application/spaces/space.hook.ts +5 -5
- package/src/application/spaces/spaces.hook.ts +7 -7
- package/src/application/user/user.hook.ts +2 -2
- package/src/auth/act-as.context.tsx +2 -2
- package/src/auth/auth.hook.ts +3 -3
- package/src/auth/can.hook.ts +3 -3
- package/src/auth/index.ts +5 -5
- package/src/auth/self.hook.ts +2 -2
- package/src/auth/session-kernel.ts +3 -3
- package/src/graph/async.ts +1 -1
- package/src/graph/call/call.hook.ts +3 -3
- package/src/graph/call/stream.hook.ts +1 -1
- package/src/graph/index.ts +18 -18
- package/src/graph/memory/read/idle.ts +1 -1
- package/src/graph/memory/read/read.ts +4 -4
- package/src/graph/memory/scope.ts +3 -3
- package/src/graph/mutate/move.hook.ts +5 -5
- package/src/graph/mutate/mutate.hook.ts +3 -3
- package/src/graph/query/children.hook.ts +4 -4
- package/src/graph/query/graph.hook.ts +1 -1
- package/src/graph/query/neighbors.hook.ts +4 -4
- package/src/graph/query/node.hook.ts +4 -4
- package/src/graph/query/query.hook.ts +2 -2
- package/src/index.ts +25 -25
- package/src/intents/index.ts +5 -5
- package/src/intents/listen-intent.hook.ts +4 -4
- package/src/intents/reply.ts +1 -1
- package/src/intents/send-intent.hook.ts +3 -3
- package/src/navigation/adapters/adapter.ts +1 -1
- package/src/navigation/adapters/memory.adapter.ts +2 -2
- package/src/navigation/adapters/url.adapter.ts +2 -2
- package/src/navigation/hooks/ancestors.hook.ts +7 -7
- package/src/navigation/hooks/location.hook.ts +3 -3
- package/src/navigation/hooks/navigate.hook.ts +2 -2
- package/src/navigation/hooks/scope.hook.ts +6 -6
- package/src/navigation/index.ts +15 -15
- package/src/navigation/link.tsx +3 -3
- package/src/navigation/location.ts +1 -1
- package/src/navigation/scope.context.tsx +9 -9
- package/src/navigation/snapshot.ts +3 -3
- package/src/schema/bind-read.ts +7 -7
- package/src/schema/binding.ts +3 -3
- package/src/schema/domain.hook.ts +3 -3
- package/src/schema/function.hook.ts +4 -4
- package/src/schema/index.ts +15 -9
- package/src/schema/kernel.hook.ts +3 -3
- package/src/schema/method.hook.ts +4 -4
- package/src/schema/types.ts +2 -2
- package/src/schema/write.ts +1 -1
- package/src/selection/index.ts +3 -3
- package/src/selection/live.ts +1 -1
- package/src/selection/scope.context.tsx +2 -2
- package/src/selection/selection.hook.ts +2 -2
- package/src/session/boot/boot.ts +1 -1
- package/src/session/boot/status.ts +1 -1
- package/src/session/connection/connection.hook.ts +3 -3
- package/src/session/index.ts +7 -7
- package/src/session/kernel-client.hook.ts +1 -1
- package/src/session/kernel-instance.hook.ts +1 -1
- package/src/session/provider.tsx +12 -12
- package/src/session/shell.hook.ts +1 -1
- package/src/window/adopt.ts +2 -2
- package/src/window/hooks/close-guard.hook.ts +1 -1
- package/src/window/hooks/target-node.hook.ts +4 -4
- package/src/window/hooks/views-for.hook.ts +4 -4
- package/src/window/hooks/window.hook.ts +3 -3
- package/src/window/hooks/windows.hook.ts +2 -2
- package/src/window/host.tsx +8 -8
- package/src/window/hub.ts +4 -4
- package/src/window/index.ts +14 -14
- package/src/window/stage.tsx +3 -3
package/src/auth/auth.hook.ts
CHANGED
|
@@ -11,10 +11,10 @@ import type { AuthApi } from '@astrale-os/kernel-client/auth'
|
|
|
11
11
|
*/
|
|
12
12
|
import { useMemo } from 'react'
|
|
13
13
|
|
|
14
|
-
import type { SessionView } from './act-as.context'
|
|
14
|
+
import type { SessionView } from './act-as.context.js'
|
|
15
15
|
|
|
16
|
-
import { useIdentityBinding } from './act-as.context'
|
|
17
|
-
import { ledgerFor } from './can.hook'
|
|
16
|
+
import { useIdentityBinding } from './act-as.context.js'
|
|
17
|
+
import { ledgerFor } from './can.hook.js'
|
|
18
18
|
|
|
19
19
|
export function useAuth(): AuthApi {
|
|
20
20
|
const { kernel } = useIdentityBinding()
|
package/src/auth/can.hook.ts
CHANGED
|
@@ -12,10 +12,10 @@ import { rawOf } from '@astrale-os/kernel-client/graph'
|
|
|
12
12
|
*/
|
|
13
13
|
import { useCallback, useMemo, useSyncExternalStore } from 'react'
|
|
14
14
|
|
|
15
|
-
import type { NodeValue, SessionView } from './act-as.context'
|
|
15
|
+
import type { NodeValue, SessionView } from './act-as.context.js'
|
|
16
16
|
|
|
17
|
-
import { isIdleInput } from '../graph/memory/read/idle'
|
|
18
|
-
import { useIdentityBinding } from './act-as.context'
|
|
17
|
+
import { isIdleInput } from '../graph/memory/read/idle.js'
|
|
18
|
+
import { useIdentityBinding } from './act-as.context.js'
|
|
19
19
|
|
|
20
20
|
const NOOP_UNSUB = (): void => undefined
|
|
21
21
|
|
package/src/auth/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// auth — API §4 (useSelf, useCan, useAuth, ActAs). See SHELL_REACT_API.md.
|
|
2
|
-
export { ActAs } from './act-as.context'
|
|
3
|
-
export type { ActAsProps } from './act-as.context'
|
|
4
|
-
export { useAuth } from './auth.hook'
|
|
5
|
-
export { useCan } from './can.hook'
|
|
6
|
-
export { useSelf } from './self.hook'
|
|
2
|
+
export { ActAs } from './act-as.context.js'
|
|
3
|
+
export type { ActAsProps } from './act-as.context.js'
|
|
4
|
+
export { useAuth } from './auth.hook.js'
|
|
5
|
+
export { useCan } from './can.hook.js'
|
|
6
|
+
export { useSelf } from './self.hook.js'
|
package/src/auth/self.hook.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NodeValue } from './act-as.context'
|
|
1
|
+
import type { NodeValue } from './act-as.context.js'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* useSelf (API §4) — the caller's identity node, resolved at boot and read
|
|
@@ -7,7 +7,7 @@ import type { NodeValue } from './act-as.context'
|
|
|
7
7
|
* live memory shape once the graph plane subscribes the self node — no signature
|
|
8
8
|
* change.
|
|
9
9
|
*/
|
|
10
|
-
import { useIdentityBinding } from './act-as.context'
|
|
10
|
+
import { useIdentityBinding } from './act-as.context.js'
|
|
11
11
|
|
|
12
12
|
export function useSelf(): NodeValue {
|
|
13
13
|
return useIdentityBinding().self
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { useContext } from 'react'
|
|
9
9
|
|
|
10
|
-
import type { SessionView } from './act-as.context'
|
|
10
|
+
import type { SessionView } from './act-as.context.js'
|
|
11
11
|
|
|
12
|
-
import { ShellContext } from '../session/session.context'
|
|
13
|
-
import { IdentityContext } from './act-as.context'
|
|
12
|
+
import { ShellContext } from '../session/session.context.js'
|
|
13
|
+
import { IdentityContext } from './act-as.context.js'
|
|
14
14
|
|
|
15
15
|
/** The EFFECTIVE dispatch kernel for this subtree. Throws outside a provider. */
|
|
16
16
|
export function useSessionKernel(): SessionView {
|
package/src/graph/async.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
8
8
|
|
|
9
|
-
import type { ReadState } from './memory/read/envelope'
|
|
9
|
+
import type { ReadState } from './memory/read/envelope.js'
|
|
10
10
|
|
|
11
11
|
export interface AsyncResource<T> extends ReadState {
|
|
12
12
|
readonly data: T
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { CallFns, FnMap } from '@astrale-os/kernel-client'
|
|
8
8
|
|
|
9
|
-
import type { Action } from '../action'
|
|
9
|
+
import type { Action } from '../action.js'
|
|
10
10
|
|
|
11
|
-
import { useSessionKernel } from '../../auth/session-kernel'
|
|
12
|
-
import { useAction } from '../action'
|
|
11
|
+
import { useSessionKernel } from '../../auth/session-kernel.js'
|
|
12
|
+
import { useAction } from '../action.js'
|
|
13
13
|
|
|
14
14
|
export interface CallOptions {
|
|
15
15
|
/** Per-call timeout (ms), forwarded to the kernel dispatch. */
|
|
@@ -8,7 +8,7 @@ import type { FnMap, StreamFns } from '@astrale-os/kernel-client'
|
|
|
8
8
|
*/
|
|
9
9
|
import { useCallback, useEffect, useReducer, useRef } from 'react'
|
|
10
10
|
|
|
11
|
-
import { useSessionKernel } from '../../auth/session-kernel'
|
|
11
|
+
import { useSessionKernel } from '../../auth/session-kernel.js'
|
|
12
12
|
|
|
13
13
|
export interface StreamOptions<T> {
|
|
14
14
|
/** Notified per chunk as it arrives (in addition to `chunks` accumulation). */
|
package/src/graph/index.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
// graph — the graph plane (API §5 + §7). Merged read hooks, writes, dispatch.
|
|
2
|
-
export { useNode } from './query/node.hook'
|
|
3
|
-
export type { NodeResult } from './query/node.hook'
|
|
4
|
-
export { useChildren } from './query/children.hook'
|
|
5
|
-
export type { ChildrenOptions, ChildrenResult } from './query/children.hook'
|
|
6
|
-
export { useQuery } from './query/query.hook'
|
|
7
|
-
export type { QueryResult } from './query/query.hook'
|
|
8
|
-
export { useGraph } from './query/graph.hook'
|
|
9
|
-
export { useMutate } from './mutate/mutate.hook'
|
|
10
|
-
export type { UseMutateOptions } from './mutate/mutate.hook'
|
|
11
|
-
export { useMove } from './mutate/move.hook'
|
|
12
|
-
export type { MoveAction } from './mutate/move.hook'
|
|
13
|
-
export { useCall } from './call/call.hook'
|
|
14
|
-
export type { CallOptions } from './call/call.hook'
|
|
15
|
-
export { useStream } from './call/stream.hook'
|
|
16
|
-
export type { StreamHandle, StreamOptions } from './call/stream.hook'
|
|
17
|
-
export type { Action } from './action'
|
|
18
|
-
export type { ReadState, ReadOptions, Windowed, Node } from './memory/read/envelope'
|
|
19
|
-
export type { GraphMemory } from './graph.context'
|
|
2
|
+
export { useNode } from './query/node.hook.js'
|
|
3
|
+
export type { NodeResult } from './query/node.hook.js'
|
|
4
|
+
export { useChildren } from './query/children.hook.js'
|
|
5
|
+
export type { ChildrenOptions, ChildrenResult } from './query/children.hook.js'
|
|
6
|
+
export { useQuery } from './query/query.hook.js'
|
|
7
|
+
export type { QueryResult } from './query/query.hook.js'
|
|
8
|
+
export { useGraph } from './query/graph.hook.js'
|
|
9
|
+
export { useMutate } from './mutate/mutate.hook.js'
|
|
10
|
+
export type { UseMutateOptions } from './mutate/mutate.hook.js'
|
|
11
|
+
export { useMove } from './mutate/move.hook.js'
|
|
12
|
+
export type { MoveAction } from './mutate/move.hook.js'
|
|
13
|
+
export { useCall } from './call/call.hook.js'
|
|
14
|
+
export type { CallOptions } from './call/call.hook.js'
|
|
15
|
+
export { useStream } from './call/stream.hook.js'
|
|
16
|
+
export type { StreamHandle, StreamOptions } from './call/stream.hook.js'
|
|
17
|
+
export type { Action } from './action.js'
|
|
18
|
+
export type { ReadState, ReadOptions, Windowed, Node } from './memory/read/envelope.js'
|
|
19
|
+
export type { GraphMemory } from './graph.context.js'
|
|
20
20
|
export type { ShapeInput } from '@astrale-os/kernel-client/store'
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* inert: `isIdleInput` is the one gate every read branches on, and
|
|
4
4
|
* `idleReadState` is the settled, not-live, seq-0 envelope it returns.
|
|
5
5
|
*/
|
|
6
|
-
import type { ReadState } from './envelope'
|
|
6
|
+
import type { ReadState } from './envelope.js'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The chaining rule: every read hook accepts `null | undefined` for its subject
|
|
@@ -14,11 +14,11 @@ import { canonicalizeAST, shapeInputToAST, stableStringify } from '@astrale-os/k
|
|
|
14
14
|
*/
|
|
15
15
|
import { useCallback, useRef, useSyncExternalStore } from 'react'
|
|
16
16
|
|
|
17
|
-
import type { CoreReadOptions, RawRead } from './envelope'
|
|
17
|
+
import type { CoreReadOptions, RawRead } from './envelope.js'
|
|
18
18
|
|
|
19
|
-
import { useMemory } from '../scope'
|
|
20
|
-
import { EMPTY_PENDING, IDLE_READ, withPending } from './envelope'
|
|
21
|
-
import { isIdleInput } from './idle'
|
|
19
|
+
import { useMemory } from '../scope.js'
|
|
20
|
+
import { EMPTY_PENDING, IDLE_READ, withPending } from './envelope.js'
|
|
21
|
+
import { isIdleInput } from './idle.js'
|
|
22
22
|
|
|
23
23
|
const NOOP_UNSUB = (): void => {}
|
|
24
24
|
const IDLE_TOKEN = ' idle'
|
|
@@ -9,9 +9,9 @@ import type { GraphMemory } from '@astrale-os/kernel-client/store'
|
|
|
9
9
|
*/
|
|
10
10
|
import { useContext, useMemo } from 'react'
|
|
11
11
|
|
|
12
|
-
import { IdentityContext } from '../../auth/act-as.context'
|
|
13
|
-
import { ShellContext } from '../../session/session.context'
|
|
14
|
-
import { baseMemoryFor } from './base'
|
|
12
|
+
import { IdentityContext } from '../../auth/act-as.context.js'
|
|
13
|
+
import { ShellContext } from '../../session/session.context.js'
|
|
14
|
+
import { baseMemoryFor } from './base.js'
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* The memory for this subtree. Throws outside a `<ShellProvider>`. Above any
|
|
@@ -11,12 +11,12 @@ import { rawOf } from '@astrale-os/kernel-client/graph'
|
|
|
11
11
|
*/
|
|
12
12
|
import { useCallback } from 'react'
|
|
13
13
|
|
|
14
|
-
import type { Action } from '../action'
|
|
15
|
-
import type { Node } from '../memory/read/envelope'
|
|
14
|
+
import type { Action } from '../action.js'
|
|
15
|
+
import type { Node } from '../memory/read/envelope.js'
|
|
16
16
|
|
|
17
|
-
import { useSessionKernel } from '../../auth/session-kernel'
|
|
18
|
-
import { useAction } from '../action'
|
|
19
|
-
import { useMemory } from '../memory/scope'
|
|
17
|
+
import { useSessionKernel } from '../../auth/session-kernel.js'
|
|
18
|
+
import { useAction } from '../action.js'
|
|
19
|
+
import { useMemory } from '../memory/scope.js'
|
|
20
20
|
|
|
21
21
|
export type MoveAction = Action<[node: Node | NodeRefInput, to: PathLike], void>
|
|
22
22
|
|
|
@@ -9,10 +9,10 @@ import type { GraphMemory } from '@astrale-os/kernel-client/store'
|
|
|
9
9
|
*/
|
|
10
10
|
import { useCallback, useRef } from 'react'
|
|
11
11
|
|
|
12
|
-
import type { Action } from '../action'
|
|
12
|
+
import type { Action } from '../action.js'
|
|
13
13
|
|
|
14
|
-
import { useAction } from '../action'
|
|
15
|
-
import { useMemory } from '../memory/scope'
|
|
14
|
+
import { useAction } from '../action.js'
|
|
15
|
+
import { useMemory } from '../memory/scope.js'
|
|
16
16
|
|
|
17
17
|
export interface UseMutateOptions<A extends unknown[], R> {
|
|
18
18
|
/**
|
|
@@ -17,11 +17,11 @@ import { rawOf } from '@astrale-os/kernel-client/graph'
|
|
|
17
17
|
*/
|
|
18
18
|
import { useMemo } from 'react'
|
|
19
19
|
|
|
20
|
-
import type { TypedChildrenResult } from '../../schema/types'
|
|
21
|
-
import type { ReadState, Node, ReadOptions, Windowed } from '../memory/read/envelope'
|
|
20
|
+
import type { TypedChildrenResult } from '../../schema/types.js'
|
|
21
|
+
import type { ReadState, Node, ReadOptions, Windowed } from '../memory/read/envelope.js'
|
|
22
22
|
|
|
23
|
-
import { useChildren as useChildrenTyped } from '../../schema/bind-read'
|
|
24
|
-
import { useRead } from '../memory/read/read'
|
|
23
|
+
import { useChildren as useChildrenTyped } from '../../schema/bind-read.js'
|
|
24
|
+
import { useRead } from '../memory/read/read.js'
|
|
25
25
|
|
|
26
26
|
export interface ChildrenOptions extends ReadOptions {
|
|
27
27
|
/** Restrict to these classes (dual-path descent filter). */
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { GraphMemory } from '@astrale-os/kernel-client/store'
|
|
7
7
|
|
|
8
|
-
import { useMemory } from '../memory/scope'
|
|
8
|
+
import { useMemory } from '../memory/scope.js'
|
|
9
9
|
|
|
10
10
|
/** The memory for this subtree — the raw floor plus optimistic-auto shorthands (§5). */
|
|
11
11
|
export function useGraph(): GraphMemory {
|
|
@@ -8,11 +8,11 @@ import type { Schema } from '@astrale-os/kernel-dsl'
|
|
|
8
8
|
*/
|
|
9
9
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
10
10
|
|
|
11
|
-
import type { EndpointResult } from '../../schema/types'
|
|
12
|
-
import type { ReadState, ReadOptions } from '../memory/read/envelope'
|
|
11
|
+
import type { EndpointResult } from '../../schema/types.js'
|
|
12
|
+
import type { ReadState, ReadOptions } from '../memory/read/envelope.js'
|
|
13
13
|
|
|
14
|
-
import { schemaOf, tagSchema } from '../../schema/tag'
|
|
15
|
-
import { isIdleInput } from '../memory/read/idle'
|
|
14
|
+
import { schemaOf, tagSchema } from '../../schema/tag.js'
|
|
15
|
+
import { isIdleInput } from '../memory/read/idle.js'
|
|
16
16
|
|
|
17
17
|
export function useOut<S extends Schema, E extends EdgeNames<S>>(
|
|
18
18
|
node: AnyBoundNode<S> | null | undefined,
|
|
@@ -11,11 +11,11 @@ import type { Schema } from '@astrale-os/kernel-dsl'
|
|
|
11
11
|
*/
|
|
12
12
|
import { useMemo } from 'react'
|
|
13
13
|
|
|
14
|
-
import type { TypedNodeResult } from '../../schema/types'
|
|
15
|
-
import type { ReadState, Node, ReadOptions } from '../memory/read/envelope'
|
|
14
|
+
import type { TypedNodeResult } from '../../schema/types.js'
|
|
15
|
+
import type { ReadState, Node, ReadOptions } from '../memory/read/envelope.js'
|
|
16
16
|
|
|
17
|
-
import { useNode as useNodeTyped } from '../../schema/bind-read'
|
|
18
|
-
import { useRead } from '../memory/read/read'
|
|
17
|
+
import { useNode as useNodeTyped } from '../../schema/bind-read.js'
|
|
18
|
+
import { useRead } from '../memory/read/read.js'
|
|
19
19
|
|
|
20
20
|
export interface NodeResult extends ReadState {
|
|
21
21
|
/** The node, or `null` when missing ≡ masked (never throws NOT_FOUND). */
|
|
@@ -7,9 +7,9 @@ import type { GatherBuilder, QueryASTInput, QuerySource } from '@astrale-os/kern
|
|
|
7
7
|
*/
|
|
8
8
|
import { useMemo } from 'react'
|
|
9
9
|
|
|
10
|
-
import type { ReadState, Node, ReadOptions, Windowed } from '../memory/read/envelope'
|
|
10
|
+
import type { ReadState, Node, ReadOptions, Windowed } from '../memory/read/envelope.js'
|
|
11
11
|
|
|
12
|
-
import { useRead } from '../memory/read/read'
|
|
12
|
+
import { useRead } from '../memory/read/read.js'
|
|
13
13
|
|
|
14
14
|
export interface QueryResult extends ReadState, Windowed {
|
|
15
15
|
readonly nodes: readonly Node[]
|
package/src/index.ts
CHANGED
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
// ─── session (§2 provider + §3) ──────────────────────────────────────────────
|
|
12
|
-
export { ShellProvider } from './session'
|
|
13
|
-
export type { ShellError, ShellProviderProps } from './session'
|
|
14
|
-
export { useConnection, useKernelClient, useKernelInstance, useShell } from './session'
|
|
15
|
-
export type { KernelInstance } from './session'
|
|
12
|
+
export { ShellProvider } from './session/index.js'
|
|
13
|
+
export type { ShellError, ShellProviderProps } from './session/index.js'
|
|
14
|
+
export { useConnection, useKernelClient, useKernelInstance, useShell } from './session/index.js'
|
|
15
|
+
export type { KernelInstance } from './session/index.js'
|
|
16
16
|
|
|
17
17
|
// ─── auth (§4) ───────────────────────────────────────────────────────────────
|
|
18
|
-
export { ActAs, useAuth, useCan, useSelf } from './auth'
|
|
19
|
-
export type { ActAsProps } from './auth'
|
|
18
|
+
export { ActAs, useAuth, useCan, useSelf } from './auth/index.js'
|
|
19
|
+
export type { ActAsProps } from './auth/index.js'
|
|
20
20
|
|
|
21
21
|
// ─── graph — the untyped floor + writes + dispatch (§5, §7) ──────────────────
|
|
22
22
|
// `useNode`/`useChildren` are single symbols merging the untyped floor + typed
|
|
@@ -30,7 +30,7 @@ export {
|
|
|
30
30
|
useNode,
|
|
31
31
|
useQuery,
|
|
32
32
|
useStream,
|
|
33
|
-
} from './graph'
|
|
33
|
+
} from './graph/index.js'
|
|
34
34
|
export type {
|
|
35
35
|
ChildrenOptions,
|
|
36
36
|
ChildrenResult,
|
|
@@ -41,13 +41,13 @@ export type {
|
|
|
41
41
|
QueryResult,
|
|
42
42
|
ShapeInput,
|
|
43
43
|
UseMutateOptions,
|
|
44
|
-
} from './graph'
|
|
45
|
-
export type { CallOptions, StreamHandle, StreamOptions } from './graph'
|
|
44
|
+
} from './graph/index.js'
|
|
45
|
+
export type { CallOptions, StreamHandle, StreamOptions } from './graph/index.js'
|
|
46
46
|
|
|
47
47
|
// ─── schema — the typed substrate (§6) ───────────────────────────────────────
|
|
48
|
-
export { useDomain, useFunction, useIn, useKernel, useMethod, useOut } from './schema'
|
|
49
|
-
export type { FunctionOptions } from './schema'
|
|
50
|
-
export type { MethodOptions } from './schema'
|
|
48
|
+
export { useDomain, useFunction, useIn, useKernel, useMethod, useOut } from './schema/index.js'
|
|
49
|
+
export type { FunctionOptions } from './schema/index.js'
|
|
50
|
+
export type { MethodOptions } from './schema/index.js'
|
|
51
51
|
export type {
|
|
52
52
|
AutoMethodAction,
|
|
53
53
|
BoundMethodAction,
|
|
@@ -62,7 +62,7 @@ export type {
|
|
|
62
62
|
TargetedMethodAction,
|
|
63
63
|
TypedChildrenResult,
|
|
64
64
|
TypedNodeResult,
|
|
65
|
-
} from './schema'
|
|
65
|
+
} from './schema/index.js'
|
|
66
66
|
|
|
67
67
|
// ─── navigation (§8) ─────────────────────────────────────────────────────────
|
|
68
68
|
export {
|
|
@@ -74,7 +74,7 @@ export {
|
|
|
74
74
|
useLocation,
|
|
75
75
|
useNavScope,
|
|
76
76
|
useNavigate,
|
|
77
|
-
} from './navigation'
|
|
77
|
+
} from './navigation/index.js'
|
|
78
78
|
export type {
|
|
79
79
|
LinkProps,
|
|
80
80
|
MissingPolicy,
|
|
@@ -86,11 +86,11 @@ export type {
|
|
|
86
86
|
NavTarget,
|
|
87
87
|
Navigate,
|
|
88
88
|
SerializedLocation,
|
|
89
|
-
} from './navigation'
|
|
89
|
+
} from './navigation/index.js'
|
|
90
90
|
|
|
91
91
|
// ─── selection (§9) ──────────────────────────────────────────────────────────
|
|
92
|
-
export { SelectionScope, useSelection } from './selection'
|
|
93
|
-
export type { Selection, SelectionScopeProps } from './selection'
|
|
92
|
+
export { SelectionScope, useSelection } from './selection/index.js'
|
|
93
|
+
export type { Selection, SelectionScopeProps } from './selection/index.js'
|
|
94
94
|
|
|
95
95
|
// ─── window (§10) ────────────────────────────────────────────────────────────
|
|
96
96
|
export {
|
|
@@ -102,7 +102,7 @@ export {
|
|
|
102
102
|
useWindows,
|
|
103
103
|
ViewHost,
|
|
104
104
|
ViewStage,
|
|
105
|
-
} from './window'
|
|
105
|
+
} from './window/index.js'
|
|
106
106
|
export type {
|
|
107
107
|
CloseGuard,
|
|
108
108
|
CloseVerdict,
|
|
@@ -114,11 +114,11 @@ export type {
|
|
|
114
114
|
WindowListEntry,
|
|
115
115
|
WindowState,
|
|
116
116
|
WindowView,
|
|
117
|
-
} from './window'
|
|
117
|
+
} from './window/index.js'
|
|
118
118
|
|
|
119
119
|
// ─── intents (§11) ───────────────────────────────────────────────────────────
|
|
120
|
-
export { useIntent, useSendIntent } from './intents'
|
|
121
|
-
export type { IntentCtx, IntentPayload, IntentReply, SendIntent } from './intents'
|
|
120
|
+
export { useIntent, useSendIntent } from './intents/index.js'
|
|
121
|
+
export type { IntentCtx, IntentPayload, IntentReply, SendIntent } from './intents/index.js'
|
|
122
122
|
|
|
123
123
|
// ─── application — the OS plane (§12) ────────────────────────────────────────
|
|
124
124
|
export {
|
|
@@ -131,7 +131,7 @@ export {
|
|
|
131
131
|
useSpace,
|
|
132
132
|
useSpaces,
|
|
133
133
|
useUser,
|
|
134
|
-
} from './application'
|
|
134
|
+
} from './application/index.js'
|
|
135
135
|
export type {
|
|
136
136
|
AppHostFallbackState,
|
|
137
137
|
AppHostProps,
|
|
@@ -141,15 +141,15 @@ export type {
|
|
|
141
141
|
RolesResult,
|
|
142
142
|
SpaceResult,
|
|
143
143
|
SpacesResult,
|
|
144
|
-
} from './application'
|
|
144
|
+
} from './application/index.js'
|
|
145
145
|
// OS node/session types (from the shell package, single import surface).
|
|
146
146
|
export type { ApplicationNode, AppSession, RoleNode, SpaceNode, UserNode } from '@astrale-os/shell'
|
|
147
147
|
|
|
148
148
|
// ─── shared envelopes (§1) ───────────────────────────────────────────────────
|
|
149
|
-
export type { Action, ReadState, ReadOptions, Windowed } from './graph'
|
|
149
|
+
export type { Action, ReadState, ReadOptions, Windowed } from './graph/index.js'
|
|
150
150
|
|
|
151
151
|
// ─── error taxonomy (§1.4) — guards + classes, re-exported from kernel-client ─
|
|
152
|
-
export * from './graph/guards.error'
|
|
152
|
+
export * from './graph/guards.error.js'
|
|
153
153
|
|
|
154
154
|
// ─── re-exported kernel-client types (one import surface, §0 preamble) ───────
|
|
155
155
|
export {
|
package/src/intents/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// intents — API §11 (useIntent, useSendIntent). See SHELL_REACT_API.md.
|
|
2
|
-
export { useIntent } from './listen-intent.hook'
|
|
3
|
-
export type { IntentCtx } from './listen-intent.hook'
|
|
4
|
-
export { useSendIntent } from './send-intent.hook'
|
|
5
|
-
export type { SendIntent } from './send-intent.hook'
|
|
6
|
-
export type { IntentPayload, IntentReply } from './envelope'
|
|
2
|
+
export { useIntent } from './listen-intent.hook.js'
|
|
3
|
+
export type { IntentCtx } from './listen-intent.hook.js'
|
|
4
|
+
export { useSendIntent } from './send-intent.hook.js'
|
|
5
|
+
export type { SendIntent } from './send-intent.hook.js'
|
|
6
|
+
export type { IntentPayload, IntentReply } from './envelope.js'
|
|
@@ -10,11 +10,11 @@ import type { IntentMessage, IntentRegistry } from '@astrale-os/shell'
|
|
|
10
10
|
*/
|
|
11
11
|
import { useEffect, useRef } from 'react'
|
|
12
12
|
|
|
13
|
-
import type { IntentPayload, IntentReply } from './envelope'
|
|
13
|
+
import type { IntentPayload, IntentReply } from './envelope.js'
|
|
14
14
|
|
|
15
|
-
import { useShell } from '../session/shell.hook'
|
|
16
|
-
import { NOOP } from './envelope'
|
|
17
|
-
import { sendReply } from './reply'
|
|
15
|
+
import { useShell } from '../session/shell.hook.js'
|
|
16
|
+
import { NOOP } from './envelope.js'
|
|
17
|
+
import { sendReply } from './reply.js'
|
|
18
18
|
|
|
19
19
|
/** Delivery context passed alongside an inbound intent's payload. */
|
|
20
20
|
export interface IntentCtx<K extends keyof IntentRegistry> {
|
package/src/intents/reply.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { Shell } from '@astrale-os/shell'
|
|
7
7
|
|
|
8
|
-
import { INTENT_REPLY, PARENT_SENDER, intentMessage } from './envelope'
|
|
8
|
+
import { INTENT_REPLY, PARENT_SENDER, intentMessage } from './envelope.js'
|
|
9
9
|
|
|
10
10
|
/** Deliver a reply to whichever channel the request arrived on. Best-effort. */
|
|
11
11
|
export function sendReply(
|
|
@@ -9,10 +9,10 @@ import type { IntentMessage, IntentRegistry, Shell } from '@astrale-os/shell'
|
|
|
9
9
|
*/
|
|
10
10
|
import { useCallback, useEffect, useRef } from 'react'
|
|
11
11
|
|
|
12
|
-
import type { IntentPayload, IntentReply } from './envelope'
|
|
12
|
+
import type { IntentPayload, IntentReply } from './envelope.js'
|
|
13
13
|
|
|
14
|
-
import { useShell } from '../session/shell.hook'
|
|
15
|
-
import { INTENT_REPLY, NOOP, intentMessage } from './envelope'
|
|
14
|
+
import { useShell } from '../session/shell.hook.js'
|
|
15
|
+
import { INTENT_REPLY, NOOP, intentMessage } from './envelope.js'
|
|
16
16
|
|
|
17
17
|
/** The typed sender returned by {@link useSendIntent}. */
|
|
18
18
|
export interface SendIntent {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* location through. `href` is the URL-form probe `<Link>` needs: present → an
|
|
4
4
|
* `<a href>` (cmd/ctrl-click falls through); absent → `role="link"`.
|
|
5
5
|
*/
|
|
6
|
-
import type { SerializedLocation } from '../history'
|
|
6
|
+
import type { SerializedLocation } from '../history.js'
|
|
7
7
|
|
|
8
8
|
export interface NavAdapter {
|
|
9
9
|
read(): SerializedLocation | null
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* memoryAdapter (API §8.1) — the default scope backing: holds one location in a
|
|
3
3
|
* closure (per-pane state, no URL form → Link renders `role="link"`).
|
|
4
4
|
*/
|
|
5
|
-
import type { SerializedLocation } from '../history'
|
|
6
|
-
import type { NavAdapter } from './adapter'
|
|
5
|
+
import type { SerializedLocation } from '../history.js'
|
|
6
|
+
import type { NavAdapter } from './adapter.js'
|
|
7
7
|
|
|
8
8
|
/** In-memory adapter — the default scope backing (per-pane state, no URL). */
|
|
9
9
|
export function memoryAdapter(initial?: SerializedLocation): NavAdapter {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* query string (URL form → `<a href>`), owning the nav query keys (`param`,
|
|
4
4
|
* `view`, the location's `params`).
|
|
5
5
|
*/
|
|
6
|
-
import type { SerializedLocation } from '../history'
|
|
7
|
-
import type { NavAdapter } from './adapter'
|
|
6
|
+
import type { SerializedLocation } from '../history.js'
|
|
7
|
+
import type { NavAdapter } from './adapter.js'
|
|
8
8
|
|
|
9
9
|
const VIEW_KEY = 'view'
|
|
10
10
|
|
|
@@ -8,14 +8,14 @@ import type { LiveResult, ShapeInput } from '@astrale-os/kernel-client/store'
|
|
|
8
8
|
*/
|
|
9
9
|
import { useMemo } from 'react'
|
|
10
10
|
|
|
11
|
-
import type { ReadState } from '../../graph/memory/read/envelope'
|
|
12
|
-
import type { Node } from '../location'
|
|
11
|
+
import type { ReadState } from '../../graph/memory/read/envelope.js'
|
|
12
|
+
import type { Node } from '../location.js'
|
|
13
13
|
|
|
14
|
-
import { idleReadState } from '../../graph/memory/read/idle'
|
|
15
|
-
import { useMemory } from '../../graph/memory/scope'
|
|
16
|
-
import { chainPaths, pathHint, pathOf } from '../location'
|
|
17
|
-
import { useHistoryVersion, useOptionalNavCtx, useMemoryShape } from '../scope.context'
|
|
18
|
-
import { serializeTarget } from '../snapshot'
|
|
14
|
+
import { idleReadState } from '../../graph/memory/read/idle.js'
|
|
15
|
+
import { useMemory } from '../../graph/memory/scope.js'
|
|
16
|
+
import { chainPaths, pathHint, pathOf } from '../location.js'
|
|
17
|
+
import { useHistoryVersion, useOptionalNavCtx, useMemoryShape } from '../scope.context.js'
|
|
18
|
+
import { serializeTarget } from '../snapshot.js'
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* The root-first ancestor chain (inclusive of the node itself), live: a move
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { useMemo } from 'react'
|
|
6
6
|
|
|
7
|
-
import type { NavLocation } from '../location'
|
|
7
|
+
import type { NavLocation } from '../location.js'
|
|
8
8
|
|
|
9
|
-
import { buildLocation, useSettled } from '../location'
|
|
10
|
-
import { useHistoryVersion, useNavCtx, useMemoryShape } from '../scope.context'
|
|
9
|
+
import { buildLocation, useSettled } from '../location.js'
|
|
10
|
+
import { useHistoryVersion, useNavCtx, useMemoryShape } from '../scope.context.js'
|
|
11
11
|
|
|
12
12
|
/** The nearest scope's live location. Throws outside any {@link NavScope}. */
|
|
13
13
|
export function useLocation(): NavLocation {
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { useMemo } from 'react'
|
|
7
7
|
|
|
8
|
-
import type { MutableNavigate, NavCtx, Navigate } from '../scope.context'
|
|
8
|
+
import type { MutableNavigate, NavCtx, Navigate } from '../scope.context.js'
|
|
9
9
|
|
|
10
|
-
import { useHistoryVersion, useNavCtx } from '../scope.context'
|
|
10
|
+
import { useHistoryVersion, useNavCtx } from '../scope.context.js'
|
|
11
11
|
|
|
12
12
|
/** The nearest scope's imperative navigation surface. Throws outside a scope. */
|
|
13
13
|
export function useNavigate(): Navigate {
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { useCallback, useMemo } from 'react'
|
|
7
7
|
|
|
8
|
-
import type { NavSnapshot } from '../history'
|
|
9
|
-
import type { NavLocation } from '../location'
|
|
10
|
-
import type { Navigate } from '../scope.context'
|
|
8
|
+
import type { NavSnapshot } from '../history.js'
|
|
9
|
+
import type { NavLocation } from '../location.js'
|
|
10
|
+
import type { Navigate } from '../scope.context.js'
|
|
11
11
|
|
|
12
|
-
import { buildLocation, useSettled } from '../location'
|
|
13
|
-
import { useNavCtx, useMemoryShape } from '../scope.context'
|
|
14
|
-
import { useNavigateHandle } from './navigate.hook'
|
|
12
|
+
import { buildLocation, useSettled } from '../location.js'
|
|
13
|
+
import { useNavCtx, useMemoryShape } from '../scope.context.js'
|
|
14
|
+
import { useNavigateHandle } from './navigate.hook.js'
|
|
15
15
|
|
|
16
16
|
/** The nearest scope, for chrome/persistence (API §8.2). */
|
|
17
17
|
export interface NavScopeHandle {
|
package/src/navigation/index.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// navigation — API §8 (NavScope, useLocation, useNavigate, Link, useAncestors,
|
|
2
2
|
// useNavScope, adapters). See SHELL_REACT_API.md.
|
|
3
|
-
export { NavScope } from './scope.context'
|
|
4
|
-
export type { MissingPolicy, NavScopeProps, Navigate } from './scope.context'
|
|
5
|
-
export { useLocation } from './hooks/location.hook'
|
|
6
|
-
export { useNavigate } from './hooks/navigate.hook'
|
|
7
|
-
export { useAncestors } from './hooks/ancestors.hook'
|
|
8
|
-
export { useNavScope } from './hooks/scope.hook'
|
|
9
|
-
export type { NavScopeHandle } from './hooks/scope.hook'
|
|
10
|
-
export { Link } from './link'
|
|
11
|
-
export type { LinkProps } from './link'
|
|
12
|
-
export { memoryAdapter } from './adapters/memory.adapter'
|
|
13
|
-
export { urlAdapter } from './adapters/url.adapter'
|
|
14
|
-
export type { NavAdapter } from './adapters/adapter'
|
|
15
|
-
export type { NavLocation } from './location'
|
|
16
|
-
export type { NavSnapshot, SerializedLocation } from './history'
|
|
17
|
-
export type { NavTarget } from './snapshot'
|
|
3
|
+
export { NavScope } from './scope.context.js'
|
|
4
|
+
export type { MissingPolicy, NavScopeProps, Navigate } from './scope.context.js'
|
|
5
|
+
export { useLocation } from './hooks/location.hook.js'
|
|
6
|
+
export { useNavigate } from './hooks/navigate.hook.js'
|
|
7
|
+
export { useAncestors } from './hooks/ancestors.hook.js'
|
|
8
|
+
export { useNavScope } from './hooks/scope.hook.js'
|
|
9
|
+
export type { NavScopeHandle } from './hooks/scope.hook.js'
|
|
10
|
+
export { Link } from './link.js'
|
|
11
|
+
export type { LinkProps } from './link.js'
|
|
12
|
+
export { memoryAdapter } from './adapters/memory.adapter.js'
|
|
13
|
+
export { urlAdapter } from './adapters/url.adapter.js'
|
|
14
|
+
export type { NavAdapter } from './adapters/adapter.js'
|
|
15
|
+
export type { NavLocation } from './location.js'
|
|
16
|
+
export type { NavSnapshot, SerializedLocation } from './history.js'
|
|
17
|
+
export type { NavTarget } from './snapshot.js'
|