@xnetjs/react 2.1.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-H44ZSIH4.js → chunk-5ILJMPKO.js} +29 -6
- package/dist/{chunk-ANCTAEML.js → chunk-CZUUWSJ7.js} +254 -116
- package/dist/{chunk-SZQNGRTO.js → chunk-KK6VADMZ.js} +1 -1
- package/dist/{chunk-HTFAHJQK.js → chunk-QSJJNEFY.js} +1 -1
- package/dist/{chunk-ZGP56IIJ.js → chunk-RW3DSDKO.js} +1 -1
- package/dist/{chunk-VZMZQTR7.js → chunk-UVJJN33U.js} +2 -2
- package/dist/core.js +3 -3
- package/dist/database.js +2 -2
- package/dist/{experimental-DyPoZcJT.d.ts → experimental-Dv0MIlsc.d.ts} +65 -3
- package/dist/experimental.d.ts +1 -1
- package/dist/experimental.js +3 -3
- package/dist/index.d.ts +61 -5
- package/dist/index.js +59 -12
- package/dist/internal.js +2 -2
- package/package.json +10 -10
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
flattenNode,
|
|
3
3
|
useQuery,
|
|
4
4
|
useSyncManager
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RW3DSDKO.js";
|
|
6
6
|
import {
|
|
7
7
|
useInstrumentation
|
|
8
8
|
} from "./chunk-JCOFKBOB.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
useNodeStore,
|
|
12
12
|
useXNet,
|
|
13
13
|
useXNetInternal
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-5ILJMPKO.js";
|
|
15
15
|
|
|
16
16
|
// src/hooks/useInfiniteQuery.ts
|
|
17
17
|
import { createQueryDescriptor, serializeQueryDescriptor } from "@xnetjs/data-bridge";
|
package/dist/core.js
CHANGED
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
useInfiniteQuery,
|
|
6
6
|
useIsOffline,
|
|
7
7
|
useNode
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UVJJN33U.js";
|
|
9
9
|
import {
|
|
10
10
|
useMutate,
|
|
11
11
|
useQuery
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-RW3DSDKO.js";
|
|
13
13
|
import "./chunk-JCOFKBOB.js";
|
|
14
14
|
import {
|
|
15
15
|
XNetProvider,
|
|
16
16
|
useXNet
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-5ILJMPKO.js";
|
|
18
18
|
export {
|
|
19
19
|
ErrorBoundary,
|
|
20
20
|
OfflineIndicator,
|
package/dist/database.js
CHANGED
|
@@ -1100,7 +1100,7 @@ declare function useSyncManager(): SyncManager | null;
|
|
|
1100
1100
|
* welcome → import-identity → qr-scan/recovery-phrase → connecting-hub
|
|
1101
1101
|
*/
|
|
1102
1102
|
|
|
1103
|
-
type OnboardingState = 'welcome' | 'authenticating' | 'auth-error' | 'unsupported-browser' | 'import-identity' | 'qr-scan' | 'recovery-phrase' | 'guardian-recovery' | 'creating-recoverable' | 'show-recovery-phrase' | 'connecting-hub' | 'ready' | 'complete';
|
|
1103
|
+
type OnboardingState = 'welcome' | 'authenticating' | 'auth-error' | 'unsupported-browser' | 'import-identity' | 'qr-scan' | 'recovery-phrase' | 'guardian-recovery' | 'atproto-ceremony' | 'creating-recoverable' | 'show-recovery-phrase' | 'connecting-hub' | 'ready' | 'complete';
|
|
1104
1104
|
type OnboardingEvent = {
|
|
1105
1105
|
type: 'AUTHENTICATE';
|
|
1106
1106
|
} | {
|
|
@@ -1157,6 +1157,16 @@ type OnboardingEvent = {
|
|
|
1157
1157
|
phrase: string;
|
|
1158
1158
|
} | {
|
|
1159
1159
|
type: 'PHRASE_SAVED';
|
|
1160
|
+
} | {
|
|
1161
|
+
type: 'CONTINUE_WITH_ATPROTO';
|
|
1162
|
+
} | {
|
|
1163
|
+
type: 'ATPROTO_LINKED';
|
|
1164
|
+
atprotoDid: string;
|
|
1165
|
+
atprotoHandle: string;
|
|
1166
|
+
displayName?: string;
|
|
1167
|
+
} | {
|
|
1168
|
+
type: 'ATPROTO_CEREMONY_FAILED';
|
|
1169
|
+
error: Error;
|
|
1160
1170
|
};
|
|
1161
1171
|
type OnboardingMachineContext = {
|
|
1162
1172
|
identity: Identity | null;
|
|
@@ -1166,6 +1176,11 @@ type OnboardingMachineContext = {
|
|
|
1166
1176
|
isDemo: boolean;
|
|
1167
1177
|
/** The recovery phrase to show once, after creating a recoverable identity (0243). */
|
|
1168
1178
|
recoveryPhrase: string | null;
|
|
1179
|
+
/** Linked ATProto identity from the login-door ceremony (0322/0338), if any. */
|
|
1180
|
+
atprotoDid: string | null;
|
|
1181
|
+
atprotoHandle: string | null;
|
|
1182
|
+
/** Display name pulled from the ATProto profile, to pre-fill the xNet profile. */
|
|
1183
|
+
atprotoDisplayName: string | null;
|
|
1169
1184
|
};
|
|
1170
1185
|
type OnboardingReducerState = {
|
|
1171
1186
|
state: OnboardingState;
|
|
@@ -1174,6 +1189,39 @@ type OnboardingReducerState = {
|
|
|
1174
1189
|
declare function onboardingReducer(current: OnboardingReducerState, event: OnboardingEvent): OnboardingReducerState;
|
|
1175
1190
|
declare function createInitialState(hubUrl?: string): OnboardingReducerState;
|
|
1176
1191
|
|
|
1192
|
+
/**
|
|
1193
|
+
* @xnetjs/react/onboarding - ATProto login-door ceremony contract (0322/0338).
|
|
1194
|
+
*
|
|
1195
|
+
* The actual OAuth 2.1 / PKCE / DPoP dance lives in `@atproto/oauth-client-*`,
|
|
1196
|
+
* which is heavy and browser/redirect-bound. To keep `@xnetjs/react`
|
|
1197
|
+
* dependency-light and unit-testable, the ceremony is *injected*: the host app
|
|
1198
|
+
* (apps/web, apps/electron) provides a `runAtprotoCeremony` that resolves to
|
|
1199
|
+
* the linked identity, and — after the xNet passkey identity is created — a
|
|
1200
|
+
* `writeBinding` that puts the signed `net.x.identity.binding` record into the
|
|
1201
|
+
* user's repo. The onboarding machine wires the two around the existing
|
|
1202
|
+
* passkey-create step.
|
|
1203
|
+
*/
|
|
1204
|
+
interface AtprotoCeremonyResult {
|
|
1205
|
+
/** The proven ATProto DID (`did:plc:…` / `did:web:…`). */
|
|
1206
|
+
atprotoDid: string;
|
|
1207
|
+
/** The handle the user authenticated with (e.g. `alice.bsky.social`). */
|
|
1208
|
+
atprotoHandle: string;
|
|
1209
|
+
/** Optional display name pulled from the ATProto profile, to pre-fill xNet. */
|
|
1210
|
+
displayName?: string;
|
|
1211
|
+
/**
|
|
1212
|
+
* Finish the binding once the xNet identity exists: sign
|
|
1213
|
+
* `net.x.identity.binding` with the new xNet key and `putRecord` it. Called
|
|
1214
|
+
* with the freshly created xNet DID + signing key. Optional — a login-only
|
|
1215
|
+
* flow may skip writing the binding record.
|
|
1216
|
+
*/
|
|
1217
|
+
writeBinding?: (xnetDid: string, signingKey: Uint8Array) => Promise<void>;
|
|
1218
|
+
}
|
|
1219
|
+
/** Start the ATProto OAuth ceremony for a handle/PDS the user typed. */
|
|
1220
|
+
type RunAtprotoCeremony = (input: {
|
|
1221
|
+
/** Handle or PDS host the user entered, e.g. `alice.bsky.social`. */
|
|
1222
|
+
handleOrPds: string;
|
|
1223
|
+
}) => Promise<AtprotoCeremonyResult>;
|
|
1224
|
+
|
|
1177
1225
|
/**
|
|
1178
1226
|
* @xnetjs/react/onboarding - React context provider for the onboarding flow
|
|
1179
1227
|
*/
|
|
@@ -1182,6 +1230,14 @@ type OnboardingContextValue = {
|
|
|
1182
1230
|
state: OnboardingState;
|
|
1183
1231
|
context: OnboardingMachineContext;
|
|
1184
1232
|
send: (event: OnboardingEvent) => void;
|
|
1233
|
+
/** Whether the ATProto login door is available (host supplied a ceremony). */
|
|
1234
|
+
atprotoEnabled: boolean;
|
|
1235
|
+
/**
|
|
1236
|
+
* Run the ATProto login door for a typed handle/PDS (0322/0338): OAuth
|
|
1237
|
+
* ceremony → existing passkey-create → write the binding record. No-op when
|
|
1238
|
+
* the ceremony was not provided.
|
|
1239
|
+
*/
|
|
1240
|
+
startAtprotoCeremony: (handleOrPds: string) => void;
|
|
1185
1241
|
};
|
|
1186
1242
|
type OnboardingProviderProps = {
|
|
1187
1243
|
children: ReactNode;
|
|
@@ -1189,8 +1245,14 @@ type OnboardingProviderProps = {
|
|
|
1189
1245
|
defaultHubUrl?: string;
|
|
1190
1246
|
/** Called when onboarding completes */
|
|
1191
1247
|
onComplete?: (identity: Identity, keyBundle: KeyBundle) => void;
|
|
1248
|
+
/**
|
|
1249
|
+
* ATProto login-door ceremony (0322/0338). When provided, the "Continue with
|
|
1250
|
+
* Bluesky (or any PDS)" door is offered; the host app supplies the OAuth
|
|
1251
|
+
* implementation. When omitted, the door is hidden.
|
|
1252
|
+
*/
|
|
1253
|
+
runAtprotoCeremony?: RunAtprotoCeremony;
|
|
1192
1254
|
};
|
|
1193
|
-
declare function OnboardingProvider({ children, defaultHubUrl, onComplete }: OnboardingProviderProps): JSX.Element;
|
|
1255
|
+
declare function OnboardingProvider({ children, defaultHubUrl, onComplete, runAtprotoCeremony }: OnboardingProviderProps): JSX.Element;
|
|
1194
1256
|
/**
|
|
1195
1257
|
* Access the onboarding state machine from within an OnboardingProvider.
|
|
1196
1258
|
*/
|
|
@@ -1619,4 +1681,4 @@ declare function useView(type: string): ViewContribution | undefined;
|
|
|
1619
1681
|
*/
|
|
1620
1682
|
declare function useCommand(id: string): CommandContribution | undefined;
|
|
1621
1683
|
|
|
1622
|
-
export { summarizeReactionNode as $, type AddCommentOptions as A, selectPublicInteractionMode as B, type CommentThread as C, summarizeModerationLabel as D, summarizePublicInteractionPolicy as E, type CommentVisibility as F, type FirstContactMode as G, type ModeratedCommentThread as H, type InteractionPermission as I, type ModerationFilterOptions as J, type ModerationLabelSummary as K, type PublicInteractionMode as L, type ModeratedCommentNode as M, type PublicInteractionPolicySnapshot as N, type PublicInteractionSurface as O, type PageTaskInput as P, type PublicModerationMode as Q, type ReplyContext as R, type UseModeratedThreadOptions as S, type TaskProjectionInput as T, type UseTaskProjectionSyncResult as U, type UseVisibleCommentsOptions as V, type UseVisibleCommentsResult as W, usePolicyFilteredReactionCounters as X, createReactionCounterSnapshot as Y, dedupeReactions as Z, isReactionVisible as _, type TaskTreeItem as a, type RemoteSchemaDefinition as a$, type AddReactionOptions as a0, type ReactionCounterSnapshot as a1, type ReactionNode as a2, type ReactionType as a3, type UsePolicyFilteredReactionCountersOptions as a4, type UsePolicyFilteredReactionCountersResult as a5, useMessageRequests as a6, createConversationKey as a7, createMessageRequestProperties as a8, evaluateFirstContactDecision as a9, type UseBlameResult as aA, useVerification as aB, type UseVerificationResult as aC, useHubStatus as aD, useCan as aE, type UseCanResult as aF, useCanEdit as aG, type UseCanEditResult as aH, describeGrantConsent as aI, useGrants as aJ, type GrantConsentSummary as aK, type GrantInput as aL, type UseGrantsResult as aM, summarizeAuthTrace as aN, useAuthTrace as aO, type AuthTraceSummary as aP, type UseAuthTraceResult as aQ, useBackup as aR, type UseBackupReturn as aS, useFileUpload as aT, type FileRef as aU, type UseFileUploadReturn as aV, useHubSearch as aW, type HubSearchOptions as aX, type HubSearchResult as aY, type HubSearchState as aZ, useRemoteSchema as a_, findLatestMessageRequest as aa, hasAcceptedContact as ab, summarizeMessageRequest as ac, type CreateMessageRequestOptions as ad, type FirstContactAdmission as ae, type FirstContactDecision as af, type FirstContactDecisionInput as ag, type FirstContactVisibility as ah, type MessageRequestNode as ai, type MessageRequestProperties as aj, type MessageRequestStatus as ak, type UseMessageRequestsOptions as al, type UseMessageRequestsResult as am, useCommentCount as an, useCommentCounts as ao, useHistory as ap, type UseHistoryResult as aq, useUndo as ar, type UseUndoResult as as, type UseUndoOptions as at, useAudit as au, type UseAuditResult as av, type UseAuditOptions as aw, useDiff as ax, type UseDiffResult as ay, useBlame as az, type UseFindOptions as b,
|
|
1684
|
+
export { summarizeReactionNode as $, type AddCommentOptions as A, selectPublicInteractionMode as B, type CommentThread as C, summarizeModerationLabel as D, summarizePublicInteractionPolicy as E, type CommentVisibility as F, type FirstContactMode as G, type ModeratedCommentThread as H, type InteractionPermission as I, type ModerationFilterOptions as J, type ModerationLabelSummary as K, type PublicInteractionMode as L, type ModeratedCommentNode as M, type PublicInteractionPolicySnapshot as N, type PublicInteractionSurface as O, type PageTaskInput as P, type PublicModerationMode as Q, type ReplyContext as R, type UseModeratedThreadOptions as S, type TaskProjectionInput as T, type UseTaskProjectionSyncResult as U, type UseVisibleCommentsOptions as V, type UseVisibleCommentsResult as W, usePolicyFilteredReactionCounters as X, createReactionCounterSnapshot as Y, dedupeReactions as Z, isReactionVisible as _, type TaskTreeItem as a, type RemoteSchemaDefinition as a$, type AddReactionOptions as a0, type ReactionCounterSnapshot as a1, type ReactionNode as a2, type ReactionType as a3, type UsePolicyFilteredReactionCountersOptions as a4, type UsePolicyFilteredReactionCountersResult as a5, useMessageRequests as a6, createConversationKey as a7, createMessageRequestProperties as a8, evaluateFirstContactDecision as a9, type UseBlameResult as aA, useVerification as aB, type UseVerificationResult as aC, useHubStatus as aD, useCan as aE, type UseCanResult as aF, useCanEdit as aG, type UseCanEditResult as aH, describeGrantConsent as aI, useGrants as aJ, type GrantConsentSummary as aK, type GrantInput as aL, type UseGrantsResult as aM, summarizeAuthTrace as aN, useAuthTrace as aO, type AuthTraceSummary as aP, type UseAuthTraceResult as aQ, useBackup as aR, type UseBackupReturn as aS, useFileUpload as aT, type FileRef as aU, type UseFileUploadReturn as aV, useHubSearch as aW, type HubSearchOptions as aX, type HubSearchResult as aY, type HubSearchState as aZ, useRemoteSchema as a_, findLatestMessageRequest as aa, hasAcceptedContact as ab, summarizeMessageRequest as ac, type CreateMessageRequestOptions as ad, type FirstContactAdmission as ae, type FirstContactDecision as af, type FirstContactDecisionInput as ag, type FirstContactVisibility as ah, type MessageRequestNode as ai, type MessageRequestProperties as aj, type MessageRequestStatus as ak, type UseMessageRequestsOptions as al, type UseMessageRequestsResult as am, useCommentCount as an, useCommentCounts as ao, useHistory as ap, type UseHistoryResult as aq, useUndo as ar, type UseUndoResult as as, type UseUndoOptions as at, useAudit as au, type UseAuditResult as av, type UseAuditOptions as aw, useDiff as ax, type UseDiffResult as ay, useBlame as az, type UseFindOptions as b, usePlugins as b$, type RemoteSchemaState as b0, usePeerDiscovery as b1, type DiscoveredPeer as b2, HubStatusIndicator as b3, Skeleton as b4, injectSkeletonStyles as b5, type SkeletonProps as b6, DemoBanner as b7, type DemoBannerProps as b8, DemoQuotaIndicator as b9, type OnboardingContextValue as bA, type OnboardingFlowProps as bB, type OnboardingState as bC, type OnboardingEvent as bD, type OnboardingMachineContext as bE, type OnboardingReducerState as bF, type QuickStartTemplate as bG, type SyncProgressOverlayProps as bH, type RunAtprotoCeremony as bI, type AtprotoCeremonyResult as bJ, PageTasksPanel as bK, type PageTasksPanelProps as bL, TaskCollectionEmbed as bM, type TaskCollectionEmbedProps as bN, SecurityProvider as bO, useSecurityContext as bP, useSecurityContextOptional as bQ, type SecurityContextState as bR, type SecurityContextActions as bS, type SecurityContextValue as bT, type SecurityProviderProps as bU, useSecurity as bV, type UseSecurityOptions as bW, type UseSecurityResult as bX, PluginRegistryContext as bY, usePluginRegistry as bZ, usePluginRegistryOptional as b_, type DemoQuotaIndicatorProps as ba, DemoDataExpiredScreen as bb, useDemoMode as bc, type DemoModeState as bd, type DemoLimits as be, type DemoUsage as bf, useSyncManager as bg, OnboardingProvider as bh, useOnboarding as bi, OnboardingFlow as bj, WelcomeScreen as bk, AuthenticatingScreen as bl, AuthErrorScreen as bm, UnsupportedBrowserScreen as bn, ImportIdentityScreen as bo, HubConnectScreen as bp, ReadyScreen as bq, SmartWelcome as br, SyncProgressOverlay as bs, onboardingReducer as bt, createInitialState as bu, QUICK_START_TEMPLATES as bv, getPlatformAuthName as bw, truncateDid as bx, copyToClipboard as by, type OnboardingProviderProps as bz, type UseFindResult as c, useContributions as c0, useViews as c1, useCommands as c2, useSlashCommands as c3, useSidebarItems as c4, useImporters as c5, useEditorExtensions as c6, useEditorExtensionsSafe as c7, useMergedEditorContributions as c8, mergeEditorContributions as c9, type MergedEditorContributions as ca, useView as cb, useCommand as cc, usePageTaskSync as d, type PageTaskReferenceInput as e, type UsePageTaskSyncOptions as f, type UsePageTaskSyncResult as g, useTaskProjectionSync as h, type TaskProjectionReferenceInput as i, type TaskProjectionHost as j, type UseTaskProjectionSyncOptions as k, useTasks as l, type UseTasksOptions as m, type UseTasksResult as n, useComments as o, type UseCommentsOptions as p, type UseCommentsResult as q, type CommentNode as r, useVisibleComments as s, useModeratedThread as t, useFind as u, createModerationLabelIndex as v, evaluateCommentModeration as w, evaluateInteractionPermission as x, moderateThread as y, selectActiveInteractionPolicy as z };
|
package/dist/experimental.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AddCommentOptions, a0 as AddReactionOptions, bm as AuthErrorScreen, aP as AuthTraceSummary, bl as AuthenticatingScreen, r as CommentNode, C as CommentThread, F as CommentVisibility, ad as CreateMessageRequestOptions, b7 as DemoBanner, b8 as DemoBannerProps, bb as DemoDataExpiredScreen, be as DemoLimits, bd as DemoModeState, b9 as DemoQuotaIndicator, ba as DemoQuotaIndicatorProps, bf as DemoUsage, b2 as DiscoveredPeer, aU as FileRef, ae as FirstContactAdmission, af as FirstContactDecision, ag as FirstContactDecisionInput, G as FirstContactMode, ah as FirstContactVisibility, aK as GrantConsentSummary, aL as GrantInput, bp as HubConnectScreen, aX as HubSearchOptions, aY as HubSearchResult, aZ as HubSearchState, b3 as HubStatusIndicator, bo as ImportIdentityScreen, I as InteractionPermission,
|
|
1
|
+
export { A as AddCommentOptions, a0 as AddReactionOptions, bm as AuthErrorScreen, aP as AuthTraceSummary, bl as AuthenticatingScreen, r as CommentNode, C as CommentThread, F as CommentVisibility, ad as CreateMessageRequestOptions, b7 as DemoBanner, b8 as DemoBannerProps, bb as DemoDataExpiredScreen, be as DemoLimits, bd as DemoModeState, b9 as DemoQuotaIndicator, ba as DemoQuotaIndicatorProps, bf as DemoUsage, b2 as DiscoveredPeer, aU as FileRef, ae as FirstContactAdmission, af as FirstContactDecision, ag as FirstContactDecisionInput, G as FirstContactMode, ah as FirstContactVisibility, aK as GrantConsentSummary, aL as GrantInput, bp as HubConnectScreen, aX as HubSearchOptions, aY as HubSearchResult, aZ as HubSearchState, b3 as HubStatusIndicator, bo as ImportIdentityScreen, I as InteractionPermission, ca as MergedEditorContributions, ai as MessageRequestNode, aj as MessageRequestProperties, ak as MessageRequestStatus, M as ModeratedCommentNode, H as ModeratedCommentThread, J as ModerationFilterOptions, K as ModerationLabelSummary, bA as OnboardingContextValue, bD as OnboardingEvent, bj as OnboardingFlow, bB as OnboardingFlowProps, bE as OnboardingMachineContext, bh as OnboardingProvider, bz as OnboardingProviderProps, bF as OnboardingReducerState, bC as OnboardingState, P as PageTaskInput, e as PageTaskReferenceInput, bK as PageTasksPanel, bL as PageTasksPanelProps, bY as PluginRegistryContext, L as PublicInteractionMode, N as PublicInteractionPolicySnapshot, O as PublicInteractionSurface, Q as PublicModerationMode, bv as QUICK_START_TEMPLATES, bG as QuickStartTemplate, a1 as ReactionCounterSnapshot, a2 as ReactionNode, a3 as ReactionType, bq as ReadyScreen, a$ as RemoteSchemaDefinition, b0 as RemoteSchemaState, R as ReplyContext, bS as SecurityContextActions, bR as SecurityContextState, bT as SecurityContextValue, bO as SecurityProvider, bU as SecurityProviderProps, b4 as Skeleton, b6 as SkeletonProps, br as SmartWelcome, bs as SyncProgressOverlay, bH as SyncProgressOverlayProps, bM as TaskCollectionEmbed, bN as TaskCollectionEmbedProps, a as TaskTreeItem, bn as UnsupportedBrowserScreen, aw as UseAuditOptions, av as UseAuditResult, aQ as UseAuthTraceResult, aS as UseBackupReturn, aA as UseBlameResult, aH as UseCanEditResult, aF as UseCanResult, p as UseCommentsOptions, q as UseCommentsResult, ay as UseDiffResult, aV as UseFileUploadReturn, b as UseFindOptions, c as UseFindResult, aM as UseGrantsResult, aq as UseHistoryResult, al as UseMessageRequestsOptions, am as UseMessageRequestsResult, S as UseModeratedThreadOptions, f as UsePageTaskSyncOptions, g as UsePageTaskSyncResult, a4 as UsePolicyFilteredReactionCountersOptions, a5 as UsePolicyFilteredReactionCountersResult, bW as UseSecurityOptions, bX as UseSecurityResult, m as UseTasksOptions, n as UseTasksResult, at as UseUndoOptions, as as UseUndoResult, aC as UseVerificationResult, V as UseVisibleCommentsOptions, W as UseVisibleCommentsResult, bk as WelcomeScreen, by as copyToClipboard, a7 as createConversationKey, bu as createInitialState, a8 as createMessageRequestProperties, v as createModerationLabelIndex, Y as createReactionCounterSnapshot, Z as dedupeReactions, aI as describeGrantConsent, w as evaluateCommentModeration, a9 as evaluateFirstContactDecision, x as evaluateInteractionPermission, aa as findLatestMessageRequest, bw as getPlatformAuthName, ab as hasAcceptedContact, b5 as injectSkeletonStyles, _ as isReactionVisible, c9 as mergeEditorContributions, y as moderateThread, bt as onboardingReducer, z as selectActiveInteractionPolicy, B as selectPublicInteractionMode, aN as summarizeAuthTrace, ac as summarizeMessageRequest, D as summarizeModerationLabel, E as summarizePublicInteractionPolicy, $ as summarizeReactionNode, bx as truncateDid, au as useAudit, aO as useAuthTrace, aR as useBackup, az as useBlame, aE as useCan, aG as useCanEdit, cc as useCommand, c2 as useCommands, an as useCommentCount, ao as useCommentCounts, o as useComments, c0 as useContributions, bc as useDemoMode, ax as useDiff, c6 as useEditorExtensions, c7 as useEditorExtensionsSafe, aT as useFileUpload, u as useFind, aJ as useGrants, ap as useHistory, aW as useHubSearch, aD as useHubStatus, c8 as useMergedEditorContributions, a6 as useMessageRequests, t as useModeratedThread, bi as useOnboarding, d as usePageTaskSync, b1 as usePeerDiscovery, bZ as usePluginRegistry, b_ as usePluginRegistryOptional, b$ as usePlugins, X as usePolicyFilteredReactionCounters, a_ as useRemoteSchema, bV as useSecurity, bP as useSecurityContext, bQ as useSecurityContextOptional, c4 as useSidebarItems, c3 as useSlashCommands, bg as useSyncManager, l as useTasks, ar as useUndo, aB as useVerification, cb as useView, c1 as useViews, s as useVisibleComments } from './experimental-Dv0MIlsc.js';
|
|
2
2
|
export { i as FlattenNodeOptions, f as flattenNode, e as flattenNodes, h as flattenNodesWithSchemaCheck, g as flattenUnknownSchemaNode } from './useQuery-D7ajycrc.js';
|
|
3
3
|
export { BlobStoreForSync, ConnectionManager, ConnectionManagerConfig, ConnectionStatus, InitialSyncManager, InitialSyncMessage, METABRIDGE_ORIGIN, METABRIDGE_SEED_ORIGIN, MetaBridge, NodePool, NodePoolConfig, NodeStoreSyncProvider, NodeSyncResponse, OfflineQueue, OfflineQueueConfig, PoolEntryState, ProgressListener, QueueEntry, Registry, RegistryConfig, RegistryStorage, SerializedNodeChange, SyncLifecyclePhase, SyncLifecycleState, SyncManager, SyncManagerConfig, SyncStatus as SyncManagerStatus, SyncPhase, SyncProgress, TrackedNode, WebSocketSyncProvider, WebSocketSyncProviderOptions, createConnectionManager, createInitialSyncManager, createMetaBridge, createNodePool, createOfflineQueue, createRegistry, createSyncManager } from '@xnetjs/runtime';
|
|
4
4
|
export { I as InstrumentationContext, a as InstrumentationContextValue, Q as QueryTrackerLike, Y as YDocRegistryLike, u as useInstrumentation } from './instrumentation-CpIuG2y5.js';
|
package/dist/experimental.js
CHANGED
|
@@ -73,14 +73,14 @@ import {
|
|
|
73
73
|
useUndo,
|
|
74
74
|
useVerification,
|
|
75
75
|
useVisibleComments
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-CZUUWSJ7.js";
|
|
77
77
|
import {
|
|
78
78
|
flattenNode,
|
|
79
79
|
flattenNodes,
|
|
80
80
|
flattenNodesWithSchemaCheck,
|
|
81
81
|
flattenUnknownSchemaNode,
|
|
82
82
|
useSyncManager
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-RW3DSDKO.js";
|
|
84
84
|
import {
|
|
85
85
|
InstrumentationContext,
|
|
86
86
|
useInstrumentation
|
|
@@ -106,7 +106,7 @@ import {
|
|
|
106
106
|
useTelemetryReporter,
|
|
107
107
|
useView,
|
|
108
108
|
useViews
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-5ILJMPKO.js";
|
|
110
110
|
|
|
111
111
|
// src/experimental.ts
|
|
112
112
|
import { WebSocketSyncProvider } from "@xnetjs/runtime";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Q as QueryFilter, a as QueryStatus, F as FlatNode, b as QueryPlanSummary } from './useQuery-D7ajycrc.js';
|
|
2
2
|
export { i as FlattenNodeOptions, M as MigrationWarning, c as QueryListResult, d as QuerySingleResult, S as SortDirection, f as flattenNode, e as flattenNodes, h as flattenNodesWithSchemaCheck, g as flattenUnknownSchemaNode, u as useQuery } from './useQuery-D7ajycrc.js';
|
|
3
3
|
export { ErrorBoundary, ErrorBoundaryProps, InfiniteQueryFilter, InfiniteQueryPage, InfiniteQueryResult, MutateCreate, MutateDelete, MutateOp, MutateRestore, MutateUpdate, OfflineIndicator, OfflineIndicatorProps, PresenceUser, SyncStatus, UseIdentityResult, UseMutateResult, UseNodeOptions, UseNodeResult, useIdentity, useInfiniteQuery, useIsOffline, useMutate, useNode } from './core.js';
|
|
4
|
-
import { U as UseTaskProjectionSyncResult, T as TaskProjectionInput, a as TaskTreeItem } from './experimental-
|
|
5
|
-
export { A as AddCommentOptions, a0 as AddReactionOptions, bm as AuthErrorScreen, aP as AuthTraceSummary, bl as AuthenticatingScreen, r as CommentNode, C as CommentThread, F as CommentVisibility, ad as CreateMessageRequestOptions, b7 as DemoBanner, b8 as DemoBannerProps, bb as DemoDataExpiredScreen, be as DemoLimits, bd as DemoModeState, b9 as DemoQuotaIndicator, ba as DemoQuotaIndicatorProps, bf as DemoUsage, b2 as DiscoveredPeer, aU as FileRef, ae as FirstContactAdmission, af as FirstContactDecision, ag as FirstContactDecisionInput, G as FirstContactMode, ah as FirstContactVisibility, aK as GrantConsentSummary, aL as GrantInput, bp as HubConnectScreen, aX as HubSearchOptions, aY as HubSearchResult, aZ as HubSearchState, b3 as HubStatusIndicator, bo as ImportIdentityScreen, I as InteractionPermission,
|
|
6
|
-
import { SchemaIRI, Schema, SavedViewDescriptor, DefinedSchema, PropertyBuilder, QueryASTOrderBy, QueryASTPage, QueryASTValidationResult, QueryASTPlannerGate, QueryASTAggregateExecution, ExternalReferenceProvider, SavedViewFeedLayout, SavedViewFeedDensity, FieldType, FieldConfig, ViewType, FilterGroup, SortConfig, RowHeight, SummaryFunction, FormViewConfig, FormFieldRule, CellValue, FormSubmissionMeta, NodeId, NodeState } from '@xnetjs/data';
|
|
4
|
+
import { U as UseTaskProjectionSyncResult, T as TaskProjectionInput, a as TaskTreeItem } from './experimental-Dv0MIlsc.js';
|
|
5
|
+
export { A as AddCommentOptions, a0 as AddReactionOptions, bJ as AtprotoCeremonyResult, bm as AuthErrorScreen, aP as AuthTraceSummary, bl as AuthenticatingScreen, r as CommentNode, C as CommentThread, F as CommentVisibility, ad as CreateMessageRequestOptions, b7 as DemoBanner, b8 as DemoBannerProps, bb as DemoDataExpiredScreen, be as DemoLimits, bd as DemoModeState, b9 as DemoQuotaIndicator, ba as DemoQuotaIndicatorProps, bf as DemoUsage, b2 as DiscoveredPeer, aU as FileRef, ae as FirstContactAdmission, af as FirstContactDecision, ag as FirstContactDecisionInput, G as FirstContactMode, ah as FirstContactVisibility, aK as GrantConsentSummary, aL as GrantInput, bp as HubConnectScreen, aX as HubSearchOptions, aY as HubSearchResult, aZ as HubSearchState, b3 as HubStatusIndicator, bo as ImportIdentityScreen, I as InteractionPermission, ca as MergedEditorContributions, ai as MessageRequestNode, aj as MessageRequestProperties, ak as MessageRequestStatus, M as ModeratedCommentNode, H as ModeratedCommentThread, J as ModerationFilterOptions, K as ModerationLabelSummary, bA as OnboardingContextValue, bD as OnboardingEvent, bj as OnboardingFlow, bB as OnboardingFlowProps, bE as OnboardingMachineContext, bh as OnboardingProvider, bz as OnboardingProviderProps, bF as OnboardingReducerState, bC as OnboardingState, P as PageTaskInput, e as PageTaskReferenceInput, bK as PageTasksPanel, bL as PageTasksPanelProps, bY as PluginRegistryContext, L as PublicInteractionMode, N as PublicInteractionPolicySnapshot, O as PublicInteractionSurface, Q as PublicModerationMode, bv as QUICK_START_TEMPLATES, bG as QuickStartTemplate, a1 as ReactionCounterSnapshot, a2 as ReactionNode, a3 as ReactionType, bq as ReadyScreen, a$ as RemoteSchemaDefinition, b0 as RemoteSchemaState, R as ReplyContext, bI as RunAtprotoCeremony, bS as SecurityContextActions, bR as SecurityContextState, bT as SecurityContextValue, bO as SecurityProvider, bU as SecurityProviderProps, b4 as Skeleton, b6 as SkeletonProps, br as SmartWelcome, bs as SyncProgressOverlay, bH as SyncProgressOverlayProps, bM as TaskCollectionEmbed, bN as TaskCollectionEmbedProps, j as TaskProjectionHost, i as TaskProjectionReferenceInput, bn as UnsupportedBrowserScreen, aw as UseAuditOptions, av as UseAuditResult, aQ as UseAuthTraceResult, aS as UseBackupReturn, aA as UseBlameResult, aH as UseCanEditResult, aF as UseCanResult, p as UseCommentsOptions, q as UseCommentsResult, ay as UseDiffResult, aV as UseFileUploadReturn, b as UseFindOptions, c as UseFindResult, aM as UseGrantsResult, aq as UseHistoryResult, al as UseMessageRequestsOptions, am as UseMessageRequestsResult, S as UseModeratedThreadOptions, f as UsePageTaskSyncOptions, g as UsePageTaskSyncResult, a4 as UsePolicyFilteredReactionCountersOptions, a5 as UsePolicyFilteredReactionCountersResult, bW as UseSecurityOptions, bX as UseSecurityResult, k as UseTaskProjectionSyncOptions, m as UseTasksOptions, n as UseTasksResult, at as UseUndoOptions, as as UseUndoResult, aC as UseVerificationResult, V as UseVisibleCommentsOptions, W as UseVisibleCommentsResult, bk as WelcomeScreen, by as copyToClipboard, a7 as createConversationKey, bu as createInitialState, a8 as createMessageRequestProperties, v as createModerationLabelIndex, Y as createReactionCounterSnapshot, Z as dedupeReactions, aI as describeGrantConsent, w as evaluateCommentModeration, a9 as evaluateFirstContactDecision, x as evaluateInteractionPermission, aa as findLatestMessageRequest, bw as getPlatformAuthName, ab as hasAcceptedContact, b5 as injectSkeletonStyles, _ as isReactionVisible, c9 as mergeEditorContributions, y as moderateThread, bt as onboardingReducer, z as selectActiveInteractionPolicy, B as selectPublicInteractionMode, aN as summarizeAuthTrace, ac as summarizeMessageRequest, D as summarizeModerationLabel, E as summarizePublicInteractionPolicy, $ as summarizeReactionNode, bx as truncateDid, au as useAudit, aO as useAuthTrace, aR as useBackup, az as useBlame, aE as useCan, aG as useCanEdit, cc as useCommand, c2 as useCommands, an as useCommentCount, ao as useCommentCounts, o as useComments, c0 as useContributions, bc as useDemoMode, ax as useDiff, c6 as useEditorExtensions, c7 as useEditorExtensionsSafe, aT as useFileUpload, u as useFind, aJ as useGrants, ap as useHistory, aW as useHubSearch, aD as useHubStatus, c5 as useImporters, c8 as useMergedEditorContributions, a6 as useMessageRequests, t as useModeratedThread, bi as useOnboarding, d as usePageTaskSync, b1 as usePeerDiscovery, bZ as usePluginRegistry, b_ as usePluginRegistryOptional, b$ as usePlugins, X as usePolicyFilteredReactionCounters, a_ as useRemoteSchema, bV as useSecurity, bP as useSecurityContext, bQ as useSecurityContextOptional, c4 as useSidebarItems, c3 as useSlashCommands, bg as useSyncManager, h as useTaskProjectionSync, l as useTasks, ar as useUndo, aB as useVerification, cb as useView, c1 as useViews, s as useVisibleComments } from './experimental-Dv0MIlsc.js';
|
|
6
|
+
import { SchemaIRI, Schema, SavedViewDescriptor, DefinedSchema, PropertyBuilder, QueryASTOrderBy, QueryASTPage, QueryASTValidationResult, QueryASTPlannerGate, QueryASTAggregateExecution, ExternalReferenceProvider, SavedViewFeedLayout, SavedViewFeedDensity, FieldType, FieldConfig, ViewType, FilterGroup, SortConfig, RowHeight, SummaryFunction, FormViewConfig, FormFieldRule, ViewGroupMeta, MapViewport, CellValue, FormSubmissionMeta, NodeId, NodeState } from '@xnetjs/data';
|
|
7
7
|
export { ColumnConfig, ColumnDefinition, ColumnType, SavedViewFeedDensity, SavedViewFeedLayout, ViewConfig, ViewType } from '@xnetjs/data';
|
|
8
|
-
import { QueryExecutionMode, QuerySourcePreference, QuerySearchFilter, QueryPageInfo, QueryMetadata } from '@xnetjs/data-bridge';
|
|
8
|
+
import { QueryExecutionMode, QuerySourcePreference, QuerySearchFilter, QueryPageInfo, QueryMetadata, QuerySpatialFilter } from '@xnetjs/data-bridge';
|
|
9
9
|
import { LucideIcon } from 'lucide-react';
|
|
10
10
|
import { ReactNode, JSX } from 'react';
|
|
11
11
|
export { DatabaseRow, DatabaseRowData, ReverseRelation, UseCellOptions, UseCellResult, UseDatabaseDocResult, UseDatabaseOptions, UseDatabaseResult, UseDatabaseRowResult, UseDatabaseSchemaResult, UseRelatedRowsResult, UseReverseRelationsResult, useCell, useDatabase, useDatabaseDoc, useDatabaseRow, useDatabaseSchema, useRelatedRows, useReverseRelations } from './database.js';
|
|
@@ -563,6 +563,35 @@ interface GridViewModel {
|
|
|
563
563
|
formConfig: FormViewConfig | null;
|
|
564
564
|
formRules: Record<string, FormFieldRule>;
|
|
565
565
|
formAccepting: boolean;
|
|
566
|
+
coverField: string | null;
|
|
567
|
+
cardSize: string | null;
|
|
568
|
+
coverFit: string | null;
|
|
569
|
+
colorBy: string | null;
|
|
570
|
+
groupMeta: Record<string, ViewGroupMeta>;
|
|
571
|
+
dateField: string | null;
|
|
572
|
+
endDateField: string | null;
|
|
573
|
+
latField: string | null;
|
|
574
|
+
lngField: string | null;
|
|
575
|
+
mapViewport: MapViewport | null;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* The per-view presentation config a view component may patch through
|
|
579
|
+
* `setViewConfig` (exploration 0339). One node write per patch — each
|
|
580
|
+
* property merges independently (LWW) with other clients' edits.
|
|
581
|
+
*/
|
|
582
|
+
interface GridViewConfigPatch {
|
|
583
|
+
groupBy?: string | null;
|
|
584
|
+
collapsedGroups?: string[];
|
|
585
|
+
coverField?: string | null;
|
|
586
|
+
cardSize?: string | null;
|
|
587
|
+
coverFit?: string | null;
|
|
588
|
+
colorBy?: string | null;
|
|
589
|
+
groupMeta?: Record<string, ViewGroupMeta>;
|
|
590
|
+
dateField?: string | null;
|
|
591
|
+
endDateField?: string | null;
|
|
592
|
+
latField?: string | null;
|
|
593
|
+
lngField?: string | null;
|
|
594
|
+
mapViewport?: MapViewport | null;
|
|
566
595
|
}
|
|
567
596
|
interface GridRowModel {
|
|
568
597
|
id: string;
|
|
@@ -590,6 +619,12 @@ interface UseGridDatabaseOptions {
|
|
|
590
619
|
* bounded (exploration 0340).
|
|
591
620
|
*/
|
|
592
621
|
maxLoaded?: number;
|
|
622
|
+
/**
|
|
623
|
+
* Spatial window over two cell properties (map views, exploration
|
|
624
|
+
* 0339): only rows inside the rect are fetched. Bypasses the
|
|
625
|
+
* materialized-view cache (the rect varies per pan).
|
|
626
|
+
*/
|
|
627
|
+
spatial?: QuerySpatialFilter;
|
|
593
628
|
}
|
|
594
629
|
interface UseGridDatabaseResult {
|
|
595
630
|
/** Database node (flattened) */
|
|
@@ -607,6 +642,15 @@ interface UseGridDatabaseResult {
|
|
|
607
642
|
activeView: GridViewModel | null;
|
|
608
643
|
/** Rows: view filters + sorts applied to the fetched window */
|
|
609
644
|
rows: GridRowModel[];
|
|
645
|
+
/**
|
|
646
|
+
* The fetch window (exploration 0339): `size` is the row cap, `total`
|
|
647
|
+
* the full match count when the bridge reports one. Views use this to
|
|
648
|
+
* label truncation honestly instead of silently clipping.
|
|
649
|
+
*/
|
|
650
|
+
rowWindow: {
|
|
651
|
+
size: number;
|
|
652
|
+
total: number | null;
|
|
653
|
+
};
|
|
610
654
|
loading: boolean;
|
|
611
655
|
/** Exact matching row count for the whole database (null while unknown). */
|
|
612
656
|
totalRowCount: number | null;
|
|
@@ -617,6 +661,14 @@ interface UseGridDatabaseResult {
|
|
|
617
661
|
/** Grow the row window by `pageSize` (bounded by `maxLoaded`). */
|
|
618
662
|
fetchMoreRows: () => Promise<void>;
|
|
619
663
|
updateCell: (rowId: string, fieldId: string, value: CellValue) => Promise<void>;
|
|
664
|
+
/**
|
|
665
|
+
* Write several cells (and optionally the row's sortKey) as ONE node
|
|
666
|
+
* update — a kanban card move is exactly one write carrying the group
|
|
667
|
+
* cell + the fractional position (exploration 0339).
|
|
668
|
+
*/
|
|
669
|
+
updateRowCells: (rowId: string, cells: Record<string, CellValue>, opts?: {
|
|
670
|
+
sortKey?: string;
|
|
671
|
+
}) => Promise<void>;
|
|
620
672
|
clearCells: (cells: Array<{
|
|
621
673
|
rowId: string;
|
|
622
674
|
fieldId: string;
|
|
@@ -639,6 +691,10 @@ interface UseGridDatabaseResult {
|
|
|
639
691
|
toggleSort: (fieldId: string) => Promise<void>;
|
|
640
692
|
setFilters: (filters: FilterGroup | null) => Promise<void>;
|
|
641
693
|
setGroupBy: (fieldId: string | null) => Promise<void>;
|
|
694
|
+
/** Patch the active view's presentation config (exploration 0339) */
|
|
695
|
+
setViewConfig: (patch: GridViewConfigPatch) => Promise<void>;
|
|
696
|
+
/** Persist a group's collapsed state on the active view */
|
|
697
|
+
setGroupCollapsed: (groupKey: string, collapsed: boolean) => Promise<void>;
|
|
642
698
|
setRowHeight: (rowHeight: RowHeight) => Promise<void>;
|
|
643
699
|
setColumnSummary: (fieldId: string, fn: SummaryFunction) => Promise<void>;
|
|
644
700
|
setFormConfig: (config: FormViewConfig) => Promise<void>;
|
|
@@ -933,4 +989,4 @@ declare function flattenTaskTree(items: TaskTreeItem[], depth?: number): Rendera
|
|
|
933
989
|
declare function formatTaskDueDate(timestamp: number | undefined): string | null;
|
|
934
990
|
declare function isTaskOverdue(timestamp: number | undefined, completed: boolean): boolean;
|
|
935
991
|
|
|
936
|
-
export { type AddRowOptions, type CanvasTaskInput, type CheckoutOptions, type DraftReview, type DraftReviewCard, type DraftReviewMember, FlatNode, type GridFieldModel, type GridOptionModel, type GridRowModel, type GridViewModel, type PresenceAwareness, type PresencePeer, QueryFilter, type RenderableTaskRow, type SavedViewCanvasProjectionNode, type SavedViewDateBrushSelection, type SavedViewDateBucketFieldSummary, type SavedViewDateBucketInterval, type SavedViewDateBucketSummary, type SavedViewFacetSelection, type SavedViewFacetSummary, type SavedViewFacetValueSummary, type SavedViewFeedEnrichmentAdapter, type SavedViewFeedEnrichmentEntry, type SavedViewInspectorItem, type SavedViewInspectorItemKind, type SavedViewLensDraft, type SavedViewPresentationMode, type SavedViewPrivacyChip, type SavedViewPrivacyChipTone, type SavedViewPrivacySummary, type SavedViewQueryOverride, type SavedViewQueryResult, SavedViewResultTable, type SavedViewResultTableProps, type SavedViewRowInspectorModel, SavedViewRunner, type SavedViewRunnerProps, type SavedViewSchemaRegistry, type SavedViewSortDirection, type SavedViewVisualCanvasProjectionRequest, SavedViewVisualFeed, type SavedViewVisualLayoutId, type SavedViewVisualLayoutOption, type SavedViewVisualPreviewCreator, type SavedViewVisualPreviewKind, type SavedViewVisualPreviewModel, type SavedViewVisualPreviewPrivacy, type SavedViewVisualPreviewRelationship, type SavedViewVisualTimelineBucket, type SavedViewVisualWorkspaceLayout, TaskProjectionInput, TaskTreeItem, type UseBillingResult, type UseCanCreateResult, type UseCanvasTaskSyncOptions, type UseCanvasTaskSyncResult, type UseDraftResult, type UseEffectiveSchemaResult, type UseGlobalUndoResult, type UseGridDatabaseOptions, type UseGridDatabaseResult, type UsePresenceOptions, type UsePresenceResult, type UseSavedViewOptions, type UseSavedViewResult, UseTaskProjectionSyncResult, type UseTimeMachineOptions, type UseTimeMachineResult, createSavedViewCanvasProjectionNodes, createSavedViewLensDraft, createSavedViewVisualCanvasProjectionRequest, createSavedViewVisualPreviewFingerprint, deriveCachedSavedViewVisualPreviews, deriveSavedViewColumns, deriveSavedViewDateBucketSummaries, deriveSavedViewFacetSummaries, deriveSavedViewPrivacyChips, deriveSavedViewRowInspector, deriveSavedViewTimelineBuckets, deriveSavedViewVisualPreview, deriveSavedViewVisualPreviews, filterSavedViewRowsByDateBrush, filterSavedViewRowsByFacets, flattenTaskTree, formatSavedViewCellValue, formatTaskDueDate, getSavedViewSensitiveResultWarning, hasSavedViewVisualPreviewSensitiveData, isSavedViewVisualPreviewEmbeddable, isTaskOverdue, mergeSavedViewFeedEnrichment, savedViewVisualPreviewIsSelfActor, useBilling, useCanCreate, useCanvasTaskSync, useDraft, useEffectiveSchema, useGlobalUndo, useGridDatabase, usePresence, useSavedView, useTimeMachine };
|
|
992
|
+
export { type AddRowOptions, type CanvasTaskInput, type CheckoutOptions, type DraftReview, type DraftReviewCard, type DraftReviewMember, FlatNode, type GridFieldModel, type GridOptionModel, type GridRowModel, type GridViewConfigPatch, type GridViewModel, type PresenceAwareness, type PresencePeer, QueryFilter, type RenderableTaskRow, type SavedViewCanvasProjectionNode, type SavedViewDateBrushSelection, type SavedViewDateBucketFieldSummary, type SavedViewDateBucketInterval, type SavedViewDateBucketSummary, type SavedViewFacetSelection, type SavedViewFacetSummary, type SavedViewFacetValueSummary, type SavedViewFeedEnrichmentAdapter, type SavedViewFeedEnrichmentEntry, type SavedViewInspectorItem, type SavedViewInspectorItemKind, type SavedViewLensDraft, type SavedViewPresentationMode, type SavedViewPrivacyChip, type SavedViewPrivacyChipTone, type SavedViewPrivacySummary, type SavedViewQueryOverride, type SavedViewQueryResult, SavedViewResultTable, type SavedViewResultTableProps, type SavedViewRowInspectorModel, SavedViewRunner, type SavedViewRunnerProps, type SavedViewSchemaRegistry, type SavedViewSortDirection, type SavedViewVisualCanvasProjectionRequest, SavedViewVisualFeed, type SavedViewVisualLayoutId, type SavedViewVisualLayoutOption, type SavedViewVisualPreviewCreator, type SavedViewVisualPreviewKind, type SavedViewVisualPreviewModel, type SavedViewVisualPreviewPrivacy, type SavedViewVisualPreviewRelationship, type SavedViewVisualTimelineBucket, type SavedViewVisualWorkspaceLayout, TaskProjectionInput, TaskTreeItem, type UseBillingResult, type UseCanCreateResult, type UseCanvasTaskSyncOptions, type UseCanvasTaskSyncResult, type UseDraftResult, type UseEffectiveSchemaResult, type UseGlobalUndoResult, type UseGridDatabaseOptions, type UseGridDatabaseResult, type UsePresenceOptions, type UsePresenceResult, type UseSavedViewOptions, type UseSavedViewResult, UseTaskProjectionSyncResult, type UseTimeMachineOptions, type UseTimeMachineResult, createSavedViewCanvasProjectionNodes, createSavedViewLensDraft, createSavedViewVisualCanvasProjectionRequest, createSavedViewVisualPreviewFingerprint, deriveCachedSavedViewVisualPreviews, deriveSavedViewColumns, deriveSavedViewDateBucketSummaries, deriveSavedViewFacetSummaries, deriveSavedViewPrivacyChips, deriveSavedViewRowInspector, deriveSavedViewTimelineBuckets, deriveSavedViewVisualPreview, deriveSavedViewVisualPreviews, filterSavedViewRowsByDateBrush, filterSavedViewRowsByFacets, flattenTaskTree, formatSavedViewCellValue, formatTaskDueDate, getSavedViewSensitiveResultWarning, hasSavedViewVisualPreviewSensitiveData, isSavedViewVisualPreviewEmbeddable, isTaskOverdue, mergeSavedViewFeedEnrichment, savedViewVisualPreviewIsSelfActor, useBilling, useCanCreate, useCanvasTaskSync, useDraft, useEffectiveSchema, useGlobalUndo, useGridDatabase, usePresence, useSavedView, useTimeMachine };
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
useInfiniteQuery,
|
|
6
6
|
useIsOffline,
|
|
7
7
|
useNode
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UVJJN33U.js";
|
|
9
9
|
import {
|
|
10
10
|
useCell,
|
|
11
11
|
useDatabase,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
useDatabaseSchema,
|
|
15
15
|
useRelatedRows,
|
|
16
16
|
useReverseRelations
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QSJJNEFY.js";
|
|
18
18
|
import {
|
|
19
19
|
AuthErrorScreen,
|
|
20
20
|
AuthenticatingScreen,
|
|
@@ -94,7 +94,7 @@ import {
|
|
|
94
94
|
useUndo,
|
|
95
95
|
useVerification,
|
|
96
96
|
useVisibleComments
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-CZUUWSJ7.js";
|
|
98
98
|
import {
|
|
99
99
|
EMPTY_PAGE_INFO,
|
|
100
100
|
computeFallbackPageInfo,
|
|
@@ -106,10 +106,10 @@ import {
|
|
|
106
106
|
useMutate,
|
|
107
107
|
useQuery,
|
|
108
108
|
useSyncManager
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-RW3DSDKO.js";
|
|
110
110
|
import {
|
|
111
111
|
useUndoScope
|
|
112
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-KK6VADMZ.js";
|
|
113
113
|
import {
|
|
114
114
|
InstrumentationContext,
|
|
115
115
|
useInstrumentation
|
|
@@ -144,7 +144,7 @@ import {
|
|
|
144
144
|
useView,
|
|
145
145
|
useViews,
|
|
146
146
|
useXNet
|
|
147
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-5ILJMPKO.js";
|
|
148
148
|
|
|
149
149
|
// src/hooks/useEffectiveSchema.ts
|
|
150
150
|
import {
|
|
@@ -4355,7 +4355,17 @@ function toViewModel(node) {
|
|
|
4355
4355
|
sortKey: node.sortKey ?? "",
|
|
4356
4356
|
formConfig: node.formConfig ?? null,
|
|
4357
4357
|
formRules: node.formRules ?? {},
|
|
4358
|
-
formAccepting: node.formAccepting ?? true
|
|
4358
|
+
formAccepting: node.formAccepting ?? true,
|
|
4359
|
+
coverField: node.coverField ?? null,
|
|
4360
|
+
cardSize: node.cardSize ?? null,
|
|
4361
|
+
coverFit: node.coverFit ?? null,
|
|
4362
|
+
colorBy: node.colorBy ?? null,
|
|
4363
|
+
groupMeta: node.groupMeta ?? {},
|
|
4364
|
+
dateField: node.dateField ?? null,
|
|
4365
|
+
endDateField: node.endDateField ?? null,
|
|
4366
|
+
latField: node.latField ?? null,
|
|
4367
|
+
lngField: node.lngField ?? null,
|
|
4368
|
+
mapViewport: node.mapViewport ?? null
|
|
4359
4369
|
};
|
|
4360
4370
|
}
|
|
4361
4371
|
function fieldsToColumnDefinitions(fields) {
|
|
@@ -4377,21 +4387,21 @@ function dropSortKey(ordered, movedId, targetIndex) {
|
|
|
4377
4387
|
}
|
|
4378
4388
|
var formulaService = new FormulaService();
|
|
4379
4389
|
function useGridDatabase(databaseId, options = {}) {
|
|
4380
|
-
const { viewId, search, pageSize = 500, maxLoaded = 2e3 } = options;
|
|
4390
|
+
const { viewId, search, pageSize = 500, maxLoaded = 2e3, spatial } = options;
|
|
4381
4391
|
const mutate = useMutate();
|
|
4382
4392
|
const { did } = useIdentity();
|
|
4383
4393
|
const { data: database, status: dbStatus } = useQuery(DatabaseSchema, databaseId);
|
|
4384
4394
|
const { data: fieldNodes, status: fieldStatus } = useQuery(DatabaseFieldSchema, {
|
|
4385
4395
|
where: { database: databaseId },
|
|
4386
|
-
orderBy: {
|
|
4396
|
+
orderBy: { createdAt: "asc" }
|
|
4387
4397
|
});
|
|
4388
4398
|
const { data: viewNodes, status: viewStatus } = useQuery(DatabaseViewSchema, {
|
|
4389
4399
|
where: { database: databaseId },
|
|
4390
|
-
orderBy: {
|
|
4400
|
+
orderBy: { createdAt: "asc" }
|
|
4391
4401
|
});
|
|
4392
4402
|
const { data: optionNodes } = useQuery(DatabaseSelectOptionSchema, {
|
|
4393
4403
|
where: { database: databaseId },
|
|
4394
|
-
orderBy: {
|
|
4404
|
+
orderBy: { createdAt: "asc" }
|
|
4395
4405
|
});
|
|
4396
4406
|
const {
|
|
4397
4407
|
data: rowNodes,
|
|
@@ -4409,7 +4419,7 @@ function useGridDatabase(databaseId, options = {}) {
|
|
|
4409
4419
|
pageSize,
|
|
4410
4420
|
maxLoaded,
|
|
4411
4421
|
page: { count: "exact" },
|
|
4412
|
-
materializedView: `db:${databaseId}${viewId ? `:view:${viewId}` : ""}
|
|
4422
|
+
...spatial ? { spatial } : { materializedView: `db:${databaseId}${viewId ? `:view:${viewId}` : ""}` },
|
|
4413
4423
|
...search ? { search } : {}
|
|
4414
4424
|
});
|
|
4415
4425
|
const optionsByField = useMemo5(() => {
|
|
@@ -4630,6 +4640,17 @@ function useGridDatabase(databaseId, options = {}) {
|
|
|
4630
4640
|
},
|
|
4631
4641
|
[updateRowProps]
|
|
4632
4642
|
);
|
|
4643
|
+
const updateRowCells = useCallback3(
|
|
4644
|
+
async (rowId, cells, opts) => {
|
|
4645
|
+
const props = {};
|
|
4646
|
+
for (const [fieldId, value] of Object.entries(cells)) {
|
|
4647
|
+
props[cellKey(fieldId)] = value;
|
|
4648
|
+
}
|
|
4649
|
+
if (opts?.sortKey !== void 0) props.sortKey = opts.sortKey;
|
|
4650
|
+
await updateRowProps(rowId, props);
|
|
4651
|
+
},
|
|
4652
|
+
[updateRowProps]
|
|
4653
|
+
);
|
|
4633
4654
|
const clearCells = useCallback3(
|
|
4634
4655
|
async (cells) => {
|
|
4635
4656
|
const byRow = /* @__PURE__ */ new Map();
|
|
@@ -4848,6 +4869,28 @@ function useGridDatabase(databaseId, options = {}) {
|
|
|
4848
4869
|
},
|
|
4849
4870
|
[mutate, activeView]
|
|
4850
4871
|
);
|
|
4872
|
+
const setViewConfig = useCallback3(
|
|
4873
|
+
async (patch) => {
|
|
4874
|
+
if (!activeView) return;
|
|
4875
|
+
const props = {};
|
|
4876
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
4877
|
+
if (value !== void 0) props[key] = value;
|
|
4878
|
+
}
|
|
4879
|
+
if (Object.keys(props).length === 0) return;
|
|
4880
|
+
await mutate.update(DatabaseViewSchema, activeView.id, props);
|
|
4881
|
+
},
|
|
4882
|
+
[mutate, activeView]
|
|
4883
|
+
);
|
|
4884
|
+
const setGroupCollapsed = useCallback3(
|
|
4885
|
+
async (groupKey, collapsed) => {
|
|
4886
|
+
if (!activeView) return;
|
|
4887
|
+
const set = new Set(activeView.collapsedGroups);
|
|
4888
|
+
if (collapsed) set.add(groupKey);
|
|
4889
|
+
else set.delete(groupKey);
|
|
4890
|
+
await mutate.update(DatabaseViewSchema, activeView.id, { collapsedGroups: [...set] });
|
|
4891
|
+
},
|
|
4892
|
+
[mutate, activeView]
|
|
4893
|
+
);
|
|
4851
4894
|
const setRowHeight = useCallback3(
|
|
4852
4895
|
async (rowHeight) => {
|
|
4853
4896
|
if (!activeView) return;
|
|
@@ -4917,12 +4960,14 @@ function useGridDatabase(databaseId, options = {}) {
|
|
|
4917
4960
|
views,
|
|
4918
4961
|
activeView,
|
|
4919
4962
|
rows,
|
|
4963
|
+
rowWindow: { size: (rowNodes ?? []).length, total: totalRowCount ?? null },
|
|
4920
4964
|
loading,
|
|
4921
4965
|
totalRowCount,
|
|
4922
4966
|
hasMoreRows,
|
|
4923
4967
|
isFetchingMoreRows,
|
|
4924
4968
|
fetchMoreRows,
|
|
4925
4969
|
updateCell,
|
|
4970
|
+
updateRowCells,
|
|
4926
4971
|
clearCells,
|
|
4927
4972
|
addRow,
|
|
4928
4973
|
deleteRows,
|
|
@@ -4939,6 +4984,8 @@ function useGridDatabase(databaseId, options = {}) {
|
|
|
4939
4984
|
toggleSort,
|
|
4940
4985
|
setFilters,
|
|
4941
4986
|
setGroupBy,
|
|
4987
|
+
setViewConfig,
|
|
4988
|
+
setGroupCollapsed,
|
|
4942
4989
|
setRowHeight,
|
|
4943
4990
|
setColumnSummary,
|
|
4944
4991
|
setFormConfig,
|
package/dist/internal.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useUndoScope
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KK6VADMZ.js";
|
|
4
4
|
import {
|
|
5
5
|
InstrumentationContext,
|
|
6
6
|
useInstrumentation
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
useNodeStore,
|
|
11
11
|
useXNet,
|
|
12
12
|
useXNetInternal
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5ILJMPKO.js";
|
|
14
14
|
export {
|
|
15
15
|
InstrumentationContext,
|
|
16
16
|
useDataBridge,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xnetjs/react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
"y-protocols": "^1.0.6",
|
|
47
47
|
"yjs": "^13.6.24",
|
|
48
48
|
"@xnetjs/billing": "0.0.2",
|
|
49
|
-
"@xnetjs/core": "2.
|
|
50
|
-
"@xnetjs/crypto": "2.
|
|
51
|
-
"@xnetjs/data": "2.
|
|
52
|
-
"@xnetjs/data-bridge": "2.
|
|
53
|
-
"@xnetjs/history": "2.
|
|
54
|
-
"@xnetjs/identity": "2.
|
|
55
|
-
"@xnetjs/plugins": "2.
|
|
56
|
-
"@xnetjs/runtime": "0.5.
|
|
57
|
-
"@xnetjs/sync": "2.
|
|
49
|
+
"@xnetjs/core": "2.3.0",
|
|
50
|
+
"@xnetjs/crypto": "2.3.0",
|
|
51
|
+
"@xnetjs/data": "2.3.0",
|
|
52
|
+
"@xnetjs/data-bridge": "2.3.0",
|
|
53
|
+
"@xnetjs/history": "2.3.0",
|
|
54
|
+
"@xnetjs/identity": "2.3.0",
|
|
55
|
+
"@xnetjs/plugins": "2.3.0",
|
|
56
|
+
"@xnetjs/runtime": "0.5.3",
|
|
57
|
+
"@xnetjs/sync": "2.3.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"react": "^18.0.0 || ^19.0.0"
|