@nivaro/react 0.3.31 → 0.3.33
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +10 -3
- package/dist/index.js +99 -98
- package/dist/shared/components/ForceReloadBanner.js +56 -46
- package/dist/shared/components/ItemEditForm.js +1985 -1982
- package/dist/shared/components/item-edit/CatalogPickerField.js +1061 -968
- package/dist/shared/components/item-edit/catalog-columns.js +175 -0
- package/dist/shared/lib/unsaved-work.js +86 -38
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ import { noteReplayEvent as _e, createReplayCheckoutState as De } from "../share
|
|
|
9
9
|
import { emitReplayTap as Te, setReplayRecorderMode as N, registerReplayCapture as qe, clipEndOffset as Le, withClipKind as Pe } from "../shared/lib/replay-capture.js";
|
|
10
10
|
import { instrumentConsole as Ne, instrumentRequests as Fe, redactSecrets as Me } from "../shared/lib/replay-context.js";
|
|
11
11
|
import { instrumentSocket as Oe } from "../shared/lib/replay-socket.js";
|
|
12
|
-
const Ue = "nivaro-react@0.3.
|
|
12
|
+
const Ue = "nivaro-react@0.3.33", j = 1e4, We = 150, He = 3e3, Ke = 600, $e = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
|
|
13
13
|
function Be(n) {
|
|
14
14
|
return typeof n.url != "string" || typeof fetch != "function" ? null : (f, a) => {
|
|
15
15
|
const u = typeof n.getToken == "function" ? n.getToken() : void 0, d = { "Content-Type": "application/json" };
|
package/dist/index.d.ts
CHANGED
|
@@ -5003,6 +5003,8 @@ export declare function isCodeError(err: unknown): boolean;
|
|
|
5003
5003
|
*/
|
|
5004
5004
|
export declare function isListTimeout(err: unknown): boolean;
|
|
5005
5005
|
|
|
5006
|
+
export declare function isReloadingForUpdate(): boolean;
|
|
5007
|
+
|
|
5006
5008
|
/** True once a 401 said this tab is signed out, until a sign-in is heard. */
|
|
5007
5009
|
export declare function isSignedOut(): boolean;
|
|
5008
5010
|
|
|
@@ -8490,7 +8492,7 @@ export declare function registerReplayCapture(fn: Capture, snap?: Snapshot): ()
|
|
|
8490
8492
|
export declare function registerRoomOpener(fn: RoomOpener): () => void;
|
|
8491
8493
|
|
|
8492
8494
|
/** Report a source of unsaved work; the returned function removes it. */
|
|
8493
|
-
export declare function registerUnsavedWork(label: string, dirty: () => boolean): () => void;
|
|
8495
|
+
export declare function registerUnsavedWork(label: string, dirty: () => boolean, opts?: UnsavedWorkOptions): () => void;
|
|
8494
8496
|
|
|
8495
8497
|
/** Register the host's opener. Returns an unregister function. */
|
|
8496
8498
|
export declare function registerViewAsOpener(fn: ViewAsOpener): () => void;
|
|
@@ -10182,6 +10184,10 @@ declare interface UnsavedSummary {
|
|
|
10182
10184
|
/** What would be lost, by label (empty = nothing). */
|
|
10183
10185
|
export declare function unsavedWorkLabels(): string[];
|
|
10184
10186
|
|
|
10187
|
+
declare interface UnsavedWorkOptions {
|
|
10188
|
+
saveForReload?: () => boolean | Promise<boolean>;
|
|
10189
|
+
}
|
|
10190
|
+
|
|
10185
10191
|
/** The ids an update covers: one, a coalesced list, or null = "too many — refresh it all". */
|
|
10186
10192
|
export declare function updateItemIds(ev: CollectionUpdateEvent): Array<string | number> | null;
|
|
10187
10193
|
|
|
@@ -11079,8 +11085,9 @@ export declare function useTypingIndicator(room: string | null): {
|
|
|
11079
11085
|
|
|
11080
11086
|
export declare function useUnreadChirp(totalUnread: number, rooms?: RoomInfo[]): void;
|
|
11081
11087
|
|
|
11082
|
-
/** A form reports its dirty state while mounted
|
|
11083
|
-
|
|
11088
|
+
/** A form reports its dirty state while mounted (and, optionally, how to keep it through a
|
|
11089
|
+
* pushed reload — the latest function is always the one called). */
|
|
11090
|
+
export declare function useUnsavedWork(dirty: boolean, label?: string, saveForReload?: () => boolean | Promise<boolean>): void;
|
|
11084
11091
|
|
|
11085
11092
|
/** Directory of users to add to a private channel. */
|
|
11086
11093
|
export declare function useUserSearch(search: string, enabled: boolean): {
|
package/dist/index.js
CHANGED
|
@@ -228,35 +228,35 @@ import { formatReplayTail as ru, getReplayTail as tu, installReplayTail as iu }
|
|
|
228
228
|
import { getApiUpdate as su, startApiVersionWatch as nu, useApiUpdate as pu } from "./shared/lib/api-version.js";
|
|
229
229
|
import { getFieldInterface as mu, listFieldInterfaces as fu, onFieldInterfacesChange as uu, registerFieldInterface as xu } from "./shared/lib/field-interfaces.js";
|
|
230
230
|
import { guardIdentityCall as cu, isSignedOut as Cu, isSignedOutError as Ru, noteCredentialChanged as Su, noteSignedIn as gu, noteUnauthorized as hu, onSignedIn as Pu } from "./shared/lib/signed-out.js";
|
|
231
|
-
import { hasUnsavedWork as Tu,
|
|
232
|
-
import { helpVideoApi as
|
|
233
|
-
import { holdNotification as
|
|
234
|
-
import { installStaleChunkRecovery as
|
|
235
|
-
import { isListTimeout as
|
|
236
|
-
import { measureClockOffset as
|
|
237
|
-
import { normalizeFieldType as
|
|
238
|
-
import { obligationQueryParams as
|
|
239
|
-
import { pageAtPayload as
|
|
240
|
-
import { playNotificationSound as
|
|
241
|
-
import { rankTeamForFilters as
|
|
242
|
-
import { resolveNotificationTarget as
|
|
243
|
-
import { restoreMetadata as
|
|
244
|
-
import { rowPresenceKey as
|
|
245
|
-
import { rumRouteChange as
|
|
246
|
-
import { seedQuickPickerSteps as
|
|
247
|
-
import { signalSentence as
|
|
248
|
-
import { stuckText as
|
|
249
|
-
import { tapReplaySocket as
|
|
250
|
-
import { useAfterIdle as
|
|
251
|
-
import { useBackgroundRun as
|
|
252
|
-
import { useClientChaos as
|
|
253
|
-
import { useDebounced as
|
|
254
|
-
import { useElapsedLoading as
|
|
255
|
-
import { useEventPath as
|
|
256
|
-
import { useFeatureFlag as
|
|
257
|
-
import { useFileHealth as
|
|
258
|
-
import { useOnlineUsers as
|
|
259
|
-
import { usePersonProfile as
|
|
231
|
+
import { hasUnsavedWork as Tu, isReloadingForUpdate as wu, registerUnsavedWork as Au, subscribeUnsavedWork as Iu, unsavedWorkLabels as Eu, useUnsavedWork as Du } from "./shared/lib/unsaved-work.js";
|
|
232
|
+
import { helpVideoApi as Fu, helpVideoKeys as Ou, useHelpVideo as Vu, useHelpVideoWalk as vu, useHelpVideosFor as bu, useRequiredVideos as Lu } from "./shared/components/help-videos/api.js";
|
|
233
|
+
import { holdNotification as Bu, huddleHolds as Hu, releaseHeld as Mu } from "./shared/components/chat/huddle/huddle-hold.js";
|
|
234
|
+
import { installStaleChunkRecovery as Wu, isStaleChunkError as Gu } from "./shared/lib/stale-chunk.js";
|
|
235
|
+
import { isListTimeout as Qu, listLoadErrorText as Ku, loadErrorText as zu } from "./shared/lib/load-error.js";
|
|
236
|
+
import { measureClockOffset as Yu, serverNow as Ju, setServerClockOffset as ju } from "./shared/lib/server-clock.js";
|
|
237
|
+
import { normalizeFieldType as Zu } from "./hooks/schemaBuilder.js";
|
|
238
|
+
import { obligationQueryParams as ex, toneForOutcome as ox } from "./shared/lib/obligation-filters.js";
|
|
239
|
+
import { pageAtPayload as tx, usePageAt as ix } from "./shared/lib/use-page-at.js";
|
|
240
|
+
import { playNotificationSound as sx } from "./shared/lib/notification-sound.js";
|
|
241
|
+
import { rankTeamForFilters as px, useScopeDimensions as lx } from "./shared/components/pipeline/teamScopes.js";
|
|
242
|
+
import { resolveNotificationTarget as fx, resolveNotificationTargetFor as ux, runNotificationTarget as xx } from "./shared/lib/notification-target.js";
|
|
243
|
+
import { restoreMetadata as cx, startMetadataPersistence as Cx, wipeMetadataCache as Rx } from "./shared/lib/metadata-persist.js";
|
|
244
|
+
import { rowPresenceKey as gx, useFieldFocus as hx, usePresence as Px, useRowPresence as yx, useTyping as Tx } from "./shared/lib/presence-hooks.js";
|
|
245
|
+
import { rumRouteChange as Ax, rumWidget as Ix, startRum as Ex } from "./shared/lib/rum.js";
|
|
246
|
+
import { seedQuickPickerSteps as kx } from "./shared/components/item-edit/helpers.js";
|
|
247
|
+
import { signalSentence as Ox, useRecordSignalPeers as Vx, useRecordSignalWhile as vx, useTopicPresence as bx } from "./shared/lib/presence-signals.js";
|
|
248
|
+
import { stuckText as Nx } from "./shared/lib/presence-state.js";
|
|
249
|
+
import { tapReplaySocket as Hx } from "./shared/lib/replay-socket.js";
|
|
250
|
+
import { useAfterIdle as _x } from "./shared/lib/defer.js";
|
|
251
|
+
import { useBackgroundRun as Gx } from "./shared/lib/background-runs.js";
|
|
252
|
+
import { useClientChaos as Qx, useClientChaosGate as Kx } from "./shared/components/client-chaos-gate.js";
|
|
253
|
+
import { useDebounced as qx } from "./shared/hooks/useDebounced.js";
|
|
254
|
+
import { useElapsedLoading as Jx } from "./shared/hooks/useElapsedLoading.js";
|
|
255
|
+
import { useEventPath as Xx, usePartner as Zx, usePartners as $x, useRecordIntegrationActivity as ed, useRefreshSignals as od, useSignalAction as rd, useSignals as td, useSnooze as id } from "./shared/components/integrations/console/api.js";
|
|
256
|
+
import { useFeatureFlag as sd, useFeatureFlags as nd } from "./shared/lib/feature-flags.js";
|
|
257
|
+
import { useFileHealth as ld } from "./shared/hooks/useFileHealth.js";
|
|
258
|
+
import { useOnlineUsers as fd } from "./shared/lib/use-online-users.js";
|
|
259
|
+
import { usePersonProfile as xd } from "./shared/components/profile/types.js";
|
|
260
260
|
export {
|
|
261
261
|
X as ACTIVE_GAMEDAYS_KEY,
|
|
262
262
|
oe as ACTIVE_USER_OPTION_FILTER,
|
|
@@ -587,41 +587,42 @@ export {
|
|
|
587
587
|
tu as getReplayTail,
|
|
588
588
|
cu as guardIdentityCall,
|
|
589
589
|
Tu as hasUnsavedWork,
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
590
|
+
Fu as helpVideoApi,
|
|
591
|
+
Ou as helpVideoKeys,
|
|
592
|
+
Bu as holdNotification,
|
|
593
593
|
Vi as huddleCallLayerMounted,
|
|
594
|
-
|
|
594
|
+
Hu as huddleHolds,
|
|
595
595
|
Li as idleState,
|
|
596
596
|
No as installClientChaosFetch,
|
|
597
597
|
Ps as installIntentPrefetch,
|
|
598
598
|
iu as installReplayTail,
|
|
599
|
-
|
|
599
|
+
Wu as installStaleChunkRecovery,
|
|
600
600
|
ur as isChatPanelPinned,
|
|
601
601
|
Io as isCleanRecording,
|
|
602
602
|
fl as isCodeError,
|
|
603
|
-
|
|
603
|
+
Qu as isListTimeout,
|
|
604
|
+
wu as isReloadingForUpdate,
|
|
604
605
|
Cu as isSignedOut,
|
|
605
606
|
Ru as isSignedOutError,
|
|
606
|
-
|
|
607
|
+
Gu as isStaleChunkError,
|
|
607
608
|
Zs as layoutPretendDownOptions,
|
|
608
609
|
fu as listFieldInterfaces,
|
|
609
|
-
|
|
610
|
+
Ku as listLoadErrorText,
|
|
610
611
|
M as liveListKey,
|
|
611
612
|
Da as liveQueryMeta,
|
|
612
613
|
_ as liveRecordKey,
|
|
613
614
|
ka as liveRefetchInterval,
|
|
614
|
-
|
|
615
|
+
zu as loadErrorText,
|
|
615
616
|
Nm as maskInputsIn,
|
|
616
617
|
yf as matchScopeDimension,
|
|
617
|
-
|
|
618
|
+
Yu as measureClockOffset,
|
|
618
619
|
Nf as networkdaysBetween,
|
|
619
|
-
|
|
620
|
+
Zu as normalizeFieldType,
|
|
620
621
|
Su as noteCredentialChanged,
|
|
621
622
|
gu as noteSignedIn,
|
|
622
623
|
hu as noteUnauthorized,
|
|
623
624
|
$f as numericIntlOptions,
|
|
624
|
-
|
|
625
|
+
ex as obligationQueryParams,
|
|
625
626
|
uu as onFieldInterfacesChange,
|
|
626
627
|
Ni as onIdleChange,
|
|
627
628
|
Pu as onSignedIn,
|
|
@@ -630,14 +631,14 @@ export {
|
|
|
630
631
|
Hn as openChatRoom,
|
|
631
632
|
Ko as openClientChaosToolbar,
|
|
632
633
|
Mn as openDmWith,
|
|
633
|
-
|
|
634
|
+
tx as pageAtPayload,
|
|
634
635
|
Bf as parseExpression,
|
|
635
|
-
|
|
636
|
+
sx as playNotificationSound,
|
|
636
637
|
eu as precisionOf,
|
|
637
638
|
ys as prefetchRecord,
|
|
638
639
|
_m as prepareReplayClip,
|
|
639
640
|
ii as rankSignals,
|
|
640
|
-
|
|
641
|
+
px as rankTeamForFilters,
|
|
641
642
|
Ts as recordQueryKeys,
|
|
642
643
|
km as registerCatalogItemOpener,
|
|
643
644
|
_n as registerDmOpener,
|
|
@@ -646,57 +647,57 @@ export {
|
|
|
646
647
|
Uf as registerLayoutSlot,
|
|
647
648
|
Wm as registerReplayCapture,
|
|
648
649
|
Wn as registerRoomOpener,
|
|
649
|
-
|
|
650
|
+
Au as registerUnsavedWork,
|
|
650
651
|
Vm as registerViewAsOpener,
|
|
651
652
|
ef as releaseGatedReads,
|
|
652
653
|
of as releaseGatedReadsOnSharedFetch,
|
|
653
|
-
|
|
654
|
+
Mu as releaseHeld,
|
|
654
655
|
Gm as replayHref,
|
|
655
656
|
ym as reportClientCrash,
|
|
656
657
|
ul as reportCodeError,
|
|
657
658
|
le as resolveCollectionIcon,
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
659
|
+
fx as resolveNotificationTarget,
|
|
660
|
+
ux as resolveNotificationTargetFor,
|
|
661
|
+
cx as restoreMetadata,
|
|
661
662
|
Cp as rowHighlightClass,
|
|
662
663
|
Rp as rowHighlightTextClass,
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
664
|
+
gx as rowPresenceKey,
|
|
665
|
+
Ax as rumRouteChange,
|
|
666
|
+
Ix as rumWidget,
|
|
667
|
+
xx as runNotificationTarget,
|
|
668
|
+
kx as seedQuickPickerSteps,
|
|
669
|
+
Ju as serverNow,
|
|
669
670
|
me as setDisplayTimezone,
|
|
670
671
|
Jf as setFiscalStartMonth,
|
|
671
672
|
Hf as setFormulaConstants,
|
|
672
673
|
fe as setNumberFormat,
|
|
673
674
|
Eo as setRecordingSelf,
|
|
674
|
-
|
|
675
|
+
ju as setServerClockOffset,
|
|
675
676
|
ue as setTimeDisplay,
|
|
676
677
|
mf as sharedWorkerSupported,
|
|
677
678
|
ff as shouldUseWorkerSocket,
|
|
678
|
-
|
|
679
|
+
Ox as signalSentence,
|
|
679
680
|
Gn as splitMessageTokens,
|
|
680
681
|
nu as startApiVersionWatch,
|
|
681
682
|
Cf as startAutofillRun,
|
|
682
683
|
Bo as startClientChaos,
|
|
683
684
|
Df as startHelpVideoWalk,
|
|
684
|
-
|
|
685
|
-
|
|
685
|
+
Cx as startMetadataPersistence,
|
|
686
|
+
Ex as startRum,
|
|
686
687
|
Ho as stopClientChaos,
|
|
687
|
-
|
|
688
|
+
Nx as stuckText,
|
|
688
689
|
Mo as subscribeClientChaos,
|
|
689
|
-
|
|
690
|
-
|
|
690
|
+
Iu as subscribeUnsavedWork,
|
|
691
|
+
Hx as tapReplaySocket,
|
|
691
692
|
xe as titleCase,
|
|
692
|
-
|
|
693
|
+
ox as toneForOutcome,
|
|
693
694
|
Bi as trackActivity,
|
|
694
695
|
Tf as translateScopeValues,
|
|
695
|
-
|
|
696
|
+
Eu as unsavedWorkLabels,
|
|
696
697
|
hp as updateItemIds,
|
|
697
698
|
Pp as updateTouches,
|
|
698
699
|
$ as useActiveGamedays,
|
|
699
|
-
|
|
700
|
+
_x as useAfterIdle,
|
|
700
701
|
Dt as useApiFetchConfig,
|
|
701
702
|
pu as useApiUpdate,
|
|
702
703
|
xt as useArmedFaults,
|
|
@@ -704,7 +705,7 @@ export {
|
|
|
704
705
|
w as useAutoRecord,
|
|
705
706
|
Rf as useAutofillRuns,
|
|
706
707
|
So as useAvailableBulkActions,
|
|
707
|
-
|
|
708
|
+
Gx as useBackgroundRun,
|
|
708
709
|
Un as useChannelAdmin,
|
|
709
710
|
Qn as useChannelDirectory,
|
|
710
711
|
Kn as useChannelMembers,
|
|
@@ -714,12 +715,12 @@ export {
|
|
|
714
715
|
Jn as useChatRooms,
|
|
715
716
|
jn as useChatSearch,
|
|
716
717
|
Do as useCleanRecording,
|
|
717
|
-
|
|
718
|
-
|
|
718
|
+
Qx as useClientChaos,
|
|
719
|
+
Kx as useClientChaosGate,
|
|
719
720
|
Xn as useCreateChannel,
|
|
720
721
|
Zn as useCreateGroupDm,
|
|
721
722
|
kf as useCurrentHelpVideoPage,
|
|
722
|
-
|
|
723
|
+
qx as useDebounced,
|
|
723
724
|
$n as useDeleteMessage,
|
|
724
725
|
cm as useDisplayPreferences,
|
|
725
726
|
pt as useDndActive,
|
|
@@ -727,23 +728,23 @@ export {
|
|
|
727
728
|
kt as useDrilldown,
|
|
728
729
|
Ft as useDrilldownViews,
|
|
729
730
|
ep as useEditMessage,
|
|
730
|
-
|
|
731
|
+
Jx as useElapsedLoading,
|
|
731
732
|
op as useEntityRoomLink,
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
733
|
+
Xx as useEventPath,
|
|
734
|
+
sd as useFeatureFlag,
|
|
735
|
+
nd as useFeatureFlags,
|
|
735
736
|
F as useFieldArray,
|
|
736
|
-
|
|
737
|
+
hx as useFieldFocus,
|
|
737
738
|
O as useFieldState,
|
|
738
|
-
|
|
739
|
+
ld as useFileHealth,
|
|
739
740
|
V as useFormDirty,
|
|
740
741
|
D as useFormSchema,
|
|
741
742
|
v as useFormStatus,
|
|
742
743
|
Ot as useGridFlush,
|
|
743
|
-
|
|
744
|
+
Vu as useHelpVideo,
|
|
744
745
|
Ti as useHelpVideoRecording,
|
|
745
|
-
|
|
746
|
-
|
|
746
|
+
vu as useHelpVideoWalk,
|
|
747
|
+
bu as useHelpVideosFor,
|
|
747
748
|
ws as useIdleNextPage,
|
|
748
749
|
qi as useImportHealth,
|
|
749
750
|
As as useIntentPrefetch,
|
|
@@ -763,49 +764,49 @@ export {
|
|
|
763
764
|
Lt as useNivaroClient,
|
|
764
765
|
Q as useNivaroForm,
|
|
765
766
|
tp as useNotificationSoundPreference,
|
|
766
|
-
|
|
767
|
+
fd as useOnlineUsers,
|
|
767
768
|
ip as useOpenRoomRegistration,
|
|
768
769
|
Nt as useOptionalNivaroClient,
|
|
769
770
|
yp as useOptionalRealtime,
|
|
770
771
|
b as useOrderedLayout,
|
|
771
772
|
Bt as useOverlayState,
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
773
|
+
ix as usePageAt,
|
|
774
|
+
Zx as usePartner,
|
|
775
|
+
$x as usePartners,
|
|
775
776
|
ap as usePeerReadAt,
|
|
776
|
-
|
|
777
|
+
xd as usePersonProfile,
|
|
777
778
|
Ks as usePlanGridHost,
|
|
778
|
-
|
|
779
|
+
Px as usePresence,
|
|
779
780
|
$s as usePretendDownScope,
|
|
780
781
|
Ze as usePublishAskContext,
|
|
781
782
|
En as useQuickPickerSteps,
|
|
782
783
|
Tp as useRealtimeStatus,
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
784
|
+
ed as useRecordIntegrationActivity,
|
|
785
|
+
Vx as useRecordSignalPeers,
|
|
786
|
+
vx as useRecordSignalWhile,
|
|
787
|
+
od as useRefreshSignals,
|
|
787
788
|
z as useRelationOptions,
|
|
788
|
-
|
|
789
|
+
Lu as useRequiredVideos,
|
|
789
790
|
sp as useRoomMembership,
|
|
790
791
|
np as useRoomPins,
|
|
791
|
-
|
|
792
|
-
|
|
792
|
+
yx as useRowPresence,
|
|
793
|
+
lx as useScopeDimensions,
|
|
793
794
|
L as useSectionState,
|
|
794
795
|
pp as useSendChatMessage,
|
|
795
796
|
J as useSessionRecorder,
|
|
796
797
|
Yi as useSetImportCadence,
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
798
|
+
rd as useSignalAction,
|
|
799
|
+
td as useSignals,
|
|
800
|
+
id as useSnooze,
|
|
800
801
|
kl as useSubscriptionMutations,
|
|
801
802
|
N as useTabState,
|
|
802
803
|
lp as useTogglePin,
|
|
803
804
|
mp as useToggleReaction,
|
|
804
|
-
|
|
805
|
-
|
|
805
|
+
bx as useTopicPresence,
|
|
806
|
+
Tx as useTyping,
|
|
806
807
|
fp as useTypingIndicator,
|
|
807
808
|
up as useUnreadChirp,
|
|
808
|
-
|
|
809
|
+
Du as useUnsavedWork,
|
|
809
810
|
xp as useUserSearch,
|
|
810
811
|
jm as useUserSync,
|
|
811
812
|
B as useWatchFields,
|
|
@@ -813,7 +814,7 @@ export {
|
|
|
813
814
|
de as userOptionFilter,
|
|
814
815
|
Mf as validateExpression,
|
|
815
816
|
vm as viewAs,
|
|
816
|
-
|
|
817
|
+
Rx as wipeMetadataCache,
|
|
817
818
|
_o as withClientChaos,
|
|
818
819
|
Um as withClipKind,
|
|
819
820
|
rf as withGetCoalescing,
|
|
@@ -1,41 +1,51 @@
|
|
|
1
|
-
import { jsxs as c, jsx as
|
|
2
|
-
import { PauseCircle as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { markReloadFor as
|
|
5
|
-
import { shouldObeyForceReload as
|
|
6
|
-
import { subscribeUnsavedWork as
|
|
7
|
-
const
|
|
8
|
-
function
|
|
9
|
-
const [
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
1
|
+
import { jsxs as c, jsx as d, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { PauseCircle as T, RotateCw as C } from "lucide-react";
|
|
3
|
+
import { useState as p, useRef as b, useEffect as E } from "react";
|
|
4
|
+
import { markReloadFor as R } from "../lib/client-version.js";
|
|
5
|
+
import { shouldObeyForceReload as D, thisTabForReload as M } from "../lib/force-reload.js";
|
|
6
|
+
import { subscribeUnsavedWork as O, prepareForReload as y, beginReloadForUpdate as L, unsavedWorkLabels as S } from "../lib/unsaved-work.js";
|
|
7
|
+
const F = "nvr:force-refresh";
|
|
8
|
+
function B() {
|
|
9
|
+
const [r, N] = p(null), [j, g] = p(() => Date.now()), [w, l] = p([]), n = b(!1), m = b(!1), v = b(/* @__PURE__ */ new Set());
|
|
10
|
+
E(() => {
|
|
11
|
+
const o = (s) => {
|
|
12
|
+
const e = s.detail ?? {}, t = typeof e.id == "string" && e.id ? e.id : null;
|
|
13
|
+
if (t && v.current.has(t) || !D(e, M())) return;
|
|
14
|
+
t && v.current.add(t), m.current = !1, l([]);
|
|
15
|
+
const h = Math.max(5, Number(e.seconds) || 30), i = Date.now();
|
|
16
|
+
N({ deadline: i + h * 1e3, message: String(e.message ?? ""), id: t }), g(i);
|
|
17
17
|
};
|
|
18
|
-
return window.addEventListener(
|
|
19
|
-
}, []),
|
|
20
|
-
if (!
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
return window.addEventListener(F, o), () => window.removeEventListener(F, o);
|
|
19
|
+
}, []), E(() => {
|
|
20
|
+
if (!r) return;
|
|
21
|
+
const o = () => {
|
|
22
|
+
n.current || (n.current = !0, r.id && R(r.id), window.location.reload(), setTimeout(() => {
|
|
23
|
+
n.current = !1, m.current = !0, l(["unsaved changes on this page"]);
|
|
24
24
|
}, 1500));
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
};
|
|
26
|
+
let s = !1;
|
|
27
|
+
const e = () => {
|
|
28
|
+
const i = Date.now();
|
|
29
|
+
if (g(i), !(i < r.deadline || n.current || m.current || s)) {
|
|
30
|
+
if (S().length === 0) {
|
|
31
|
+
l((a) => a.length ? [] : a), o();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
s = !0, y().then((a) => {
|
|
35
|
+
l((x) => x.join("|") === a.join("|") ? x : a), a.length === 0 && (L(), o());
|
|
36
|
+
}).finally(() => {
|
|
37
|
+
s = !1;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}, t = setInterval(e, 1e3);
|
|
41
|
+
document.addEventListener("visibilitychange", e), window.addEventListener("focus", e), window.addEventListener("pageshow", e);
|
|
42
|
+
const h = O(() => setTimeout(e, 0));
|
|
33
43
|
return () => {
|
|
34
|
-
clearInterval(t), document.removeEventListener("visibilitychange",
|
|
44
|
+
clearInterval(t), document.removeEventListener("visibilitychange", e), window.removeEventListener("focus", e), window.removeEventListener("pageshow", e), h();
|
|
35
45
|
};
|
|
36
|
-
}, [
|
|
37
|
-
const u =
|
|
38
|
-
return
|
|
46
|
+
}, [r]);
|
|
47
|
+
const u = r ? Math.max(0, Math.ceil((r.deadline - j) / 1e3)) : 0, f = u === 0 && w.length > 0;
|
|
48
|
+
return r ? /* @__PURE__ */ c(
|
|
39
49
|
"div",
|
|
40
50
|
{
|
|
41
51
|
role: "alert",
|
|
@@ -44,27 +54,27 @@ function W() {
|
|
|
44
54
|
"data-nvr-recording-hide": !0,
|
|
45
55
|
className: "fixed inset-x-0 top-0 z-[150] flex items-center justify-center gap-3 border-b border-amber-300 bg-amber-50 px-4 py-2.5 text-[13px] text-amber-900 dark:border-amber-500/40 dark:bg-[#3a2e10] dark:text-amber-200",
|
|
46
56
|
children: [
|
|
47
|
-
f ? /* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
57
|
+
f ? /* @__PURE__ */ d(T, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ d(C, { className: "h-4 w-4 shrink-0 animate-spin" }),
|
|
58
|
+
/* @__PURE__ */ d("span", { children: f ? /* @__PURE__ */ c(k, { children: [
|
|
59
|
+
/* @__PURE__ */ d("span", { className: "font-semibold", children: "A reload is waiting" }),
|
|
50
60
|
" — save or discard your changes (",
|
|
51
|
-
|
|
61
|
+
w.join(", ").toLowerCase(),
|
|
52
62
|
") and the page reloads."
|
|
53
|
-
] }) : /* @__PURE__ */ c(
|
|
63
|
+
] }) : /* @__PURE__ */ c(k, { children: [
|
|
54
64
|
/* @__PURE__ */ c("span", { className: "font-semibold", children: [
|
|
55
65
|
"This page will reload in ",
|
|
56
66
|
u,
|
|
57
67
|
"s"
|
|
58
68
|
] }),
|
|
59
|
-
|
|
69
|
+
r.message ? ` — ${r.message}` : " — an administrator pushed an update."
|
|
60
70
|
] }) }),
|
|
61
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ d(
|
|
62
72
|
"button",
|
|
63
73
|
{
|
|
64
74
|
type: "button",
|
|
65
|
-
onClick: () => {
|
|
66
|
-
|
|
67
|
-
|
|
75
|
+
onClick: async () => {
|
|
76
|
+
n.current = !0, r.id && R(r.id), (await y()).length === 0 && L(), window.location.reload(), setTimeout(() => {
|
|
77
|
+
n.current = !1;
|
|
68
78
|
}, 1500);
|
|
69
79
|
},
|
|
70
80
|
className: "shrink-0 rounded-md border border-amber-400 bg-white px-2.5 py-1 text-[12px] font-medium text-amber-800 hover:bg-amber-100 dark:bg-transparent dark:text-amber-200",
|
|
@@ -76,6 +86,6 @@ function W() {
|
|
|
76
86
|
) : null;
|
|
77
87
|
}
|
|
78
88
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
89
|
+
F as FORCE_RELOAD_EVENT,
|
|
90
|
+
B as ForceReloadBanner
|
|
81
91
|
};
|