@flamingo-stack/openframe-frontend-core 0.0.809 → 0.0.810
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-ZAXGW4KT.cjs → chunk-2C63MX75.cjs} +13 -13
- package/dist/{chunk-KS5V55HN.cjs → chunk-3FBXQSSC.cjs} +7 -7
- package/dist/{chunk-OAJ3AL4V.cjs → chunk-B6DIM5JG.cjs} +4 -4
- package/dist/{chunk-KITOT3DS.cjs → chunk-CLMUD56S.cjs} +10 -10
- package/dist/{chunk-DDFT6VQ3.cjs → chunk-CZWQCYKV.cjs} +3 -3
- package/dist/{chunk-AZJYMTBS.cjs → chunk-EKDLVUEA.cjs} +2 -2
- package/dist/{chunk-KCB72H7A.cjs → chunk-ETI7OMPU.cjs} +39 -39
- package/dist/{chunk-Q3C6UJJ7.cjs → chunk-F26COFTW.cjs} +57 -57
- package/dist/{chunk-RZNRKWG5.cjs → chunk-FCFYZIOY.cjs} +9 -9
- package/dist/{chunk-3B76QFXV.cjs → chunk-GG36TCKP.cjs} +4 -4
- package/dist/{chunk-BT53NHR7.cjs → chunk-J4QORJMC.cjs} +25 -25
- package/dist/{chunk-WDL3GFH2.cjs → chunk-MAQFG62O.cjs} +19 -19
- package/dist/{chunk-UVLTUSH3.cjs → chunk-MSAXZRXZ.cjs} +131 -131
- package/dist/{chunk-KHKPLOU4.cjs → chunk-QDB2JO55.cjs} +144 -36
- package/dist/{chunk-OFGYPMTE.cjs → chunk-R2ABQG2T.cjs} +39 -39
- package/dist/{chunk-VKAFZCFV.cjs → chunk-RKNCNL6K.cjs} +13 -13
- package/dist/{chunk-5UTJARDM.cjs → chunk-RPBOWCME.cjs} +2 -2
- package/dist/{chunk-WV44WJKR.cjs → chunk-TOTR2WMH.cjs} +3 -3
- package/dist/{chunk-VUKN6KEE.cjs → chunk-X2JSCOOR.cjs} +52 -52
- package/dist/{chunk-LUICXMHC.cjs → chunk-ZXBRPQND.cjs} +6 -6
- package/dist/{cloud-tenants-DJAA23GR.cjs → cloud-tenants-QTASS5KP.cjs} +6 -6
- package/dist/components/case-studies/index.cjs +18 -18
- package/dist/components/chat/hooks/use-jetstream-dialog-subscription.js +1 -1
- package/dist/components/chat/hooks/use-nats-dialog-subscription.js +1 -1
- package/dist/components/chat/index.cjs +4 -4
- package/dist/components/chat/types/api.types.d.ts +8 -4
- package/dist/components/chat/types/api.types.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +7 -7
- package/dist/components/docs/index.cjs +10 -10
- package/dist/components/embeds/index.cjs +7 -7
- package/dist/components/faq/index.cjs +8 -8
- package/dist/components/features/index.cjs +6 -6
- package/dist/components/help-center-pages/index.cjs +74 -74
- package/dist/components/index.cjs +41 -41
- package/dist/components/meeting-scheduler/index.cjs +36 -36
- package/dist/components/navigation/index.cjs +9 -9
- package/dist/components/onboarding-guides/index.cjs +8 -8
- package/dist/components/product-demo/index.cjs +15 -15
- package/dist/components/tickets/index.cjs +11 -11
- package/dist/components/ui/index.cjs +6 -6
- package/dist/{devices-AIDQW4HB.cjs → devices-KPMQI57Y.cjs} +7 -7
- package/dist/{embeddable-chat-XT6GMSBX.cjs → embeddable-chat-LB7NDFVQ.cjs} +60 -60
- package/dist/hooks/index.cjs +3 -3
- package/dist/index.cjs +10 -10
- package/dist/{knowledge-JWCFM3GO.cjs → knowledge-JWGBY3ZJ.cjs} +7 -7
- package/dist/{logs-ZNIXPJXA.cjs → logs-QENTXKWY.cjs} +14 -14
- package/dist/nats/index.cjs +2 -2
- package/dist/nats/nats-provider.d.ts +9 -3
- package/dist/nats/nats-provider.d.ts.map +1 -1
- package/dist/nats/nats-provider.js +7 -3
- package/dist/nats/shared-connection.d.ts +44 -1
- package/dist/nats/shared-connection.d.ts.map +1 -1
- package/dist/nats/shared-connection.js +126 -22
- package/dist/{policies-Z4NGPLA2.cjs → policies-2HXFZ2EL.cjs} +10 -10
- package/dist/{scripts-G4Y5SPOW.cjs → scripts-TMXULK6L.cjs} +11 -11
- package/dist/{software-update-VAOKDA76.cjs → software-update-H2LAEWDN.cjs} +9 -9
- package/package.json +1 -1
- package/src/components/chat/hooks/use-jetstream-dialog-subscription.ts +1 -1
- package/src/components/chat/hooks/use-nats-dialog-subscription.ts +1 -1
- package/src/components/chat/types/api.types.ts +8 -4
- package/src/nats/nats-provider.tsx +15 -4
- package/src/nats/shared-connection.ts +199 -25
|
@@ -422,7 +422,13 @@ var NATS_DEFAULTS = {
|
|
|
422
422
|
MAX_PING_OUT: 3,
|
|
423
423
|
RETRY_INITIAL_DELAY_MS: 1e3,
|
|
424
424
|
RETRY_MAX_DELAY_MS: 3e4,
|
|
425
|
-
RETRY_MULTIPLIER: 2
|
|
425
|
+
RETRY_MULTIPLIER: 2,
|
|
426
|
+
/** Failed dials in a row after which the lifecycle stops dialling for a while. */
|
|
427
|
+
PAUSE_AFTER_FAILURES: 5,
|
|
428
|
+
/** Length of a pause, plus up to 20% jitter so clients paused by one outage do not wake together. */
|
|
429
|
+
PAUSE_MS: 3e5,
|
|
430
|
+
/** A pause ignores visibility/online resume triggers for this long, so toggling tabs is not a retry button. */
|
|
431
|
+
PAUSE_MIN_RESUME_MS: 3e4
|
|
426
432
|
};
|
|
427
433
|
var connections = /* @__PURE__ */ new Map();
|
|
428
434
|
function getSharedConnection() {
|
|
@@ -457,9 +463,19 @@ function acquireClient(url, opts) {
|
|
|
457
463
|
closeTimer: null,
|
|
458
464
|
retryTimer: null,
|
|
459
465
|
retryOwner: null,
|
|
460
|
-
retrySchedulers: /* @__PURE__ */ new Set()
|
|
466
|
+
retrySchedulers: /* @__PURE__ */ new Set(),
|
|
467
|
+
failedDials: 0,
|
|
468
|
+
lastDialError: void 0,
|
|
469
|
+
terminal: false,
|
|
470
|
+
pause: null,
|
|
471
|
+
terminalListeners: /* @__PURE__ */ new Set()
|
|
461
472
|
};
|
|
462
473
|
connections.set(url, conn);
|
|
474
|
+
} else if (conn.refCount === 0) {
|
|
475
|
+
conn.failedDials = 0;
|
|
476
|
+
conn.terminal = false;
|
|
477
|
+
_optionalChain([conn, 'access', _21 => _21.pause, 'optionalAccess', _22 => _22.dispose, 'call', _23 => _23()]);
|
|
478
|
+
conn.pause = null;
|
|
463
479
|
}
|
|
464
480
|
conn.refCount += 1;
|
|
465
481
|
if (conn.closeTimer) {
|
|
@@ -473,7 +489,7 @@ function releaseClient(url, opts) {
|
|
|
473
489
|
if (!conn) return;
|
|
474
490
|
conn.refCount = Math.max(0, conn.refCount - 1);
|
|
475
491
|
if (conn.refCount > 0) return;
|
|
476
|
-
const delay = _nullishCoalesce(_optionalChain([opts, 'optionalAccess',
|
|
492
|
+
const delay = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _24 => _24.delayMs]), () => ( NATS_DEFAULTS.SHARED_CLOSE_DELAY_MS));
|
|
477
493
|
conn.closeTimer = setTimeout(() => {
|
|
478
494
|
conn.closeTimer = null;
|
|
479
495
|
if (conn.refCount > 0) return;
|
|
@@ -484,6 +500,8 @@ function releaseClient(url, opts) {
|
|
|
484
500
|
clearTimeout(conn.retryTimer);
|
|
485
501
|
conn.retryTimer = null;
|
|
486
502
|
}
|
|
503
|
+
_optionalChain([conn, 'access', _25 => _25.pause, 'optionalAccess', _26 => _26.dispose, 'call', _27 => _27()]);
|
|
504
|
+
conn.pause = null;
|
|
487
505
|
void conn.client.close().catch(() => {
|
|
488
506
|
});
|
|
489
507
|
}, delay);
|
|
@@ -502,18 +520,78 @@ function handOffRetry(conn) {
|
|
|
502
520
|
function startConnectionLifecycle(options) {
|
|
503
521
|
const { conn, wsUrl } = options;
|
|
504
522
|
let closed = false;
|
|
505
|
-
|
|
523
|
+
function endPause() {
|
|
524
|
+
_optionalChain([conn, 'access', _28 => _28.pause, 'optionalAccess', _29 => _29.dispose, 'call', _30 => _30()]);
|
|
525
|
+
conn.pause = null;
|
|
526
|
+
}
|
|
527
|
+
function startPause() {
|
|
528
|
+
if (conn.pause) return;
|
|
529
|
+
const now = Date.now();
|
|
530
|
+
const until = now + NATS_DEFAULTS.PAUSE_MS * (1 + Math.random() * 0.2);
|
|
531
|
+
const resume = () => {
|
|
532
|
+
if (!conn.pause) return;
|
|
533
|
+
if (Date.now() - conn.pause.startedAt < NATS_DEFAULTS.PAUSE_MIN_RESUME_MS) return;
|
|
534
|
+
endPause();
|
|
535
|
+
if (conn.terminal || conn.client.isConnected()) return;
|
|
536
|
+
if (conn.retryTimer) {
|
|
537
|
+
clearTimeout(conn.retryTimer);
|
|
538
|
+
conn.retryTimer = null;
|
|
539
|
+
}
|
|
540
|
+
if (conn.retryOwner) conn.retryOwner();
|
|
541
|
+
else handOffRetry(conn);
|
|
542
|
+
};
|
|
543
|
+
const onVisibility = () => {
|
|
544
|
+
if (document.visibilityState === "visible") resume();
|
|
545
|
+
};
|
|
546
|
+
const hasDom = typeof document !== "undefined" && typeof window !== "undefined";
|
|
547
|
+
if (hasDom) {
|
|
548
|
+
document.addEventListener("visibilitychange", onVisibility);
|
|
549
|
+
window.addEventListener("online", resume);
|
|
550
|
+
}
|
|
551
|
+
conn.failedDials = Math.min(conn.failedDials, NATS_DEFAULTS.PAUSE_AFTER_FAILURES - 1);
|
|
552
|
+
conn.pause = {
|
|
553
|
+
until,
|
|
554
|
+
startedAt: now,
|
|
555
|
+
dispose: () => {
|
|
556
|
+
if (!hasDom) return;
|
|
557
|
+
document.removeEventListener("visibilitychange", onVisibility);
|
|
558
|
+
window.removeEventListener("online", resume);
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
function markHealthy() {
|
|
563
|
+
endPause();
|
|
564
|
+
conn.failedDials = 0;
|
|
565
|
+
}
|
|
566
|
+
function countFailedDial(err) {
|
|
567
|
+
if (err === conn.lastDialError) return;
|
|
568
|
+
conn.lastDialError = err;
|
|
569
|
+
conn.failedDials++;
|
|
570
|
+
}
|
|
571
|
+
function markTerminal() {
|
|
572
|
+
endPause();
|
|
573
|
+
if (conn.retryTimer) clearTimeout(conn.retryTimer);
|
|
574
|
+
conn.terminal = true;
|
|
575
|
+
conn.retryOwner = null;
|
|
576
|
+
conn.retryTimer = null;
|
|
577
|
+
for (const listener of conn.terminalListeners) listener();
|
|
578
|
+
}
|
|
506
579
|
function emitSynthetic(status) {
|
|
507
580
|
if (closed) return;
|
|
508
|
-
_optionalChain([options, 'access',
|
|
581
|
+
_optionalChain([options, 'access', _31 => _31.onStatusChange, 'optionalCall', _32 => _32(status, { status })]);
|
|
509
582
|
if (status === "connected") {
|
|
510
|
-
|
|
583
|
+
markHealthy();
|
|
511
584
|
}
|
|
512
585
|
}
|
|
586
|
+
const notifyTerminal = () => {
|
|
587
|
+
if (!closed) _optionalChain([options, 'access', _33 => _33.onTerminal, 'optionalCall', _34 => _34()]);
|
|
588
|
+
};
|
|
589
|
+
conn.terminalListeners.add(notifyTerminal);
|
|
513
590
|
conn.retrySchedulers.add(scheduleRetry);
|
|
514
591
|
if (!conn.retryOwner) conn.retryOwner = scheduleRetry;
|
|
515
592
|
function scheduleRetry() {
|
|
516
593
|
if (closed) return;
|
|
594
|
+
if (conn.terminal) return;
|
|
517
595
|
if (getSharedConnectionFor(wsUrl) !== conn) return;
|
|
518
596
|
if (options.getFreshUrl() !== wsUrl) return;
|
|
519
597
|
if (!conn.retryOwner) conn.retryOwner = scheduleRetry;
|
|
@@ -525,23 +603,34 @@ function startConnectionLifecycle(options) {
|
|
|
525
603
|
const baseDelay = _nullishCoalesce(cfg.initialDelayMs, () => ( NATS_DEFAULTS.RETRY_INITIAL_DELAY_MS));
|
|
526
604
|
const maxDelay = _nullishCoalesce(cfg.maxDelayMs, () => ( NATS_DEFAULTS.RETRY_MAX_DELAY_MS));
|
|
527
605
|
const multiplier = _nullishCoalesce(cfg.multiplier, () => ( NATS_DEFAULTS.RETRY_MULTIPLIER));
|
|
528
|
-
const
|
|
529
|
-
const
|
|
530
|
-
|
|
606
|
+
const attempt = conn.failedDials;
|
|
607
|
+
const delay = attempt < fastRetries ? fastDelay : Math.min(baseDelay * multiplier ** (attempt - fastRetries), maxDelay);
|
|
608
|
+
const wait = Math.max(delay * (0.5 + Math.random() * 0.5), conn.pause ? conn.pause.until - Date.now() : 0);
|
|
531
609
|
const runRetry = async () => {
|
|
532
610
|
conn.retryTimer = null;
|
|
533
611
|
if (closed) return;
|
|
612
|
+
if (conn.terminal) return;
|
|
534
613
|
if (getSharedConnectionFor(wsUrl) !== conn) return;
|
|
535
614
|
if (conn.client.isConnected()) {
|
|
536
|
-
|
|
615
|
+
markHealthy();
|
|
537
616
|
return;
|
|
538
617
|
}
|
|
618
|
+
if (conn.pause && conn.pause.until <= Date.now()) endPause();
|
|
619
|
+
let verdict = void 0;
|
|
539
620
|
try {
|
|
540
|
-
await _optionalChain([options, 'access',
|
|
621
|
+
verdict = await _optionalChain([options, 'access', _35 => _35.onBeforeReconnect, 'optionalCall', _36 => _36({ consecutiveFailures: conn.failedDials })]);
|
|
541
622
|
} catch (e11) {
|
|
542
623
|
}
|
|
543
624
|
if (closed) return;
|
|
544
625
|
if (getSharedConnectionFor(wsUrl) !== conn) return;
|
|
626
|
+
if (conn.terminal) return;
|
|
627
|
+
if (verdict === "terminal") {
|
|
628
|
+
markTerminal();
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
if (verdict === "pause" || conn.failedDials >= NATS_DEFAULTS.PAUSE_AFTER_FAILURES) {
|
|
632
|
+
startPause();
|
|
633
|
+
}
|
|
545
634
|
const freshUrl = options.getFreshUrl();
|
|
546
635
|
if (freshUrl !== wsUrl) {
|
|
547
636
|
if (conn.retryOwner === scheduleRetry) {
|
|
@@ -554,13 +643,18 @@ function startConnectionLifecycle(options) {
|
|
|
554
643
|
}
|
|
555
644
|
return;
|
|
556
645
|
}
|
|
646
|
+
if (conn.pause) {
|
|
647
|
+
scheduleRetry();
|
|
648
|
+
return;
|
|
649
|
+
}
|
|
557
650
|
try {
|
|
558
651
|
await conn.client.connect();
|
|
559
652
|
if (!closed && getSharedConnectionFor(wsUrl) === conn) {
|
|
560
|
-
|
|
653
|
+
markHealthy();
|
|
561
654
|
}
|
|
562
|
-
} catch (
|
|
655
|
+
} catch (err) {
|
|
563
656
|
if (!closed && getSharedConnectionFor(wsUrl) === conn) {
|
|
657
|
+
countFailedDial(err);
|
|
564
658
|
scheduleRetry();
|
|
565
659
|
}
|
|
566
660
|
}
|
|
@@ -569,14 +663,14 @@ function startConnectionLifecycle(options) {
|
|
|
569
663
|
runRetry().catch((err) => {
|
|
570
664
|
console.warn("[nats] retry attempt threw:", err);
|
|
571
665
|
});
|
|
572
|
-
},
|
|
666
|
+
}, wait);
|
|
573
667
|
}
|
|
574
668
|
const shouldRetryOn = _nullishCoalesce(options.shouldRetryOn, () => ( defaultShouldRetryOn));
|
|
575
669
|
const unsubStatus = conn.client.onStatus((evt) => {
|
|
576
670
|
if (closed) return;
|
|
577
|
-
_optionalChain([options, 'access',
|
|
671
|
+
_optionalChain([options, 'access', _37 => _37.onStatusChange, 'optionalCall', _38 => _38(evt.status, evt)]);
|
|
578
672
|
if (evt.status === "connected") {
|
|
579
|
-
|
|
673
|
+
markHealthy();
|
|
580
674
|
}
|
|
581
675
|
if (shouldRetryOn(evt.status)) {
|
|
582
676
|
scheduleRetry();
|
|
@@ -585,20 +679,30 @@ function startConnectionLifecycle(options) {
|
|
|
585
679
|
if (conn.client.isConnected()) {
|
|
586
680
|
emitSynthetic("connected");
|
|
587
681
|
}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
682
|
+
if (conn.terminal) {
|
|
683
|
+
emitSynthetic("disconnected");
|
|
684
|
+
_optionalChain([options, 'access', _39 => _39.onTerminal, 'optionalCall', _40 => _40()]);
|
|
685
|
+
} else if (!conn.client.isConnected() && (conn.failedDials > 0 || conn.pause || conn.retryTimer)) {
|
|
686
|
+
emitSynthetic("disconnected");
|
|
687
|
+
scheduleRetry();
|
|
688
|
+
} else {
|
|
689
|
+
void (async () => {
|
|
690
|
+
try {
|
|
691
|
+
await conn.client.connect();
|
|
692
|
+
} catch (err) {
|
|
693
|
+
if (closed) return;
|
|
694
|
+
countFailedDial(err);
|
|
695
|
+
emitSynthetic("disconnected");
|
|
696
|
+
scheduleRetry();
|
|
697
|
+
}
|
|
698
|
+
})();
|
|
699
|
+
}
|
|
597
700
|
return {
|
|
598
701
|
stop() {
|
|
599
702
|
closed = true;
|
|
600
703
|
unsubStatus();
|
|
601
704
|
conn.retrySchedulers.delete(scheduleRetry);
|
|
705
|
+
conn.terminalListeners.delete(notifyTerminal);
|
|
602
706
|
if (conn.retryOwner !== scheduleRetry) {
|
|
603
707
|
return;
|
|
604
708
|
}
|
|
@@ -629,6 +733,7 @@ function NatsProvider({
|
|
|
629
733
|
const [client, setClient] = _react.useState.call(void 0, null);
|
|
630
734
|
const [status, setStatus] = _react.useState.call(void 0, "closed");
|
|
631
735
|
const [reconnectionCount, setReconnectionCount] = _react.useState.call(void 0, 0);
|
|
736
|
+
const [terminal, setTerminal] = _react.useState.call(void 0, false);
|
|
632
737
|
const getWsUrlRef = _react.useRef.call(void 0, getWsUrl);
|
|
633
738
|
_react.useEffect.call(void 0, () => {
|
|
634
739
|
getWsUrlRef.current = getWsUrl;
|
|
@@ -669,9 +774,10 @@ function NatsProvider({
|
|
|
669
774
|
const lifecycle = startConnectionLifecycle({
|
|
670
775
|
conn,
|
|
671
776
|
wsUrl,
|
|
672
|
-
onBeforeReconnect: () => _optionalChain([onBeforeReconnectRef, 'access',
|
|
777
|
+
onBeforeReconnect: (ctx) => _optionalChain([onBeforeReconnectRef, 'access', _41 => _41.current, 'optionalCall', _42 => _42(ctx)]),
|
|
673
778
|
backoff: reconnectionBackoffRef.current,
|
|
674
779
|
getFreshUrl: () => getWsUrlRef.current(),
|
|
780
|
+
onTerminal: () => setTerminal(true),
|
|
675
781
|
onStatusChange: (newStatus) => {
|
|
676
782
|
if (newStatus === "error") return;
|
|
677
783
|
setStatus(newStatus);
|
|
@@ -691,6 +797,7 @@ function NatsProvider({
|
|
|
691
797
|
}
|
|
692
798
|
setClient(null);
|
|
693
799
|
setStatus("closed");
|
|
800
|
+
setTerminal(false);
|
|
694
801
|
};
|
|
695
802
|
}, [urlRevision]);
|
|
696
803
|
const value = _react.useMemo.call(void 0,
|
|
@@ -698,9 +805,10 @@ function NatsProvider({
|
|
|
698
805
|
client,
|
|
699
806
|
status,
|
|
700
807
|
isReady: status === "connected" && client !== null,
|
|
701
|
-
reconnectionCount
|
|
808
|
+
reconnectionCount,
|
|
809
|
+
terminal
|
|
702
810
|
}),
|
|
703
|
-
[client, status, reconnectionCount]
|
|
811
|
+
[client, status, reconnectionCount, terminal]
|
|
704
812
|
);
|
|
705
813
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NatsContext.Provider, { value, children });
|
|
706
814
|
}
|
|
@@ -721,12 +829,12 @@ function useNatsSubscription(subject, onMessage, options) {
|
|
|
721
829
|
_react.useEffect.call(void 0, () => {
|
|
722
830
|
handlerRef.current = onMessage;
|
|
723
831
|
}, [onMessage]);
|
|
724
|
-
const enabled = _optionalChain([options, 'optionalAccess',
|
|
725
|
-
const queue = _optionalChain([options, 'optionalAccess',
|
|
726
|
-
const max = _optionalChain([options, 'optionalAccess',
|
|
727
|
-
const reconnectionCount = _nullishCoalesce(_optionalChain([nats, 'optionalAccess',
|
|
728
|
-
const isReady = !!_optionalChain([nats, 'optionalAccess',
|
|
729
|
-
const client = _nullishCoalesce(_optionalChain([nats, 'optionalAccess',
|
|
832
|
+
const enabled = _optionalChain([options, 'optionalAccess', _43 => _43.enabled]) !== false;
|
|
833
|
+
const queue = _optionalChain([options, 'optionalAccess', _44 => _44.queue]);
|
|
834
|
+
const max = _optionalChain([options, 'optionalAccess', _45 => _45.max]);
|
|
835
|
+
const reconnectionCount = _nullishCoalesce(_optionalChain([nats, 'optionalAccess', _46 => _46.reconnectionCount]), () => ( 0));
|
|
836
|
+
const isReady = !!_optionalChain([nats, 'optionalAccess', _47 => _47.isReady]);
|
|
837
|
+
const client = _nullishCoalesce(_optionalChain([nats, 'optionalAccess', _48 => _48.client]), () => ( null));
|
|
730
838
|
const isSubscribed = Boolean(client) && isReady && Boolean(subject) && enabled;
|
|
731
839
|
_react.useEffect.call(void 0, () => {
|
|
732
840
|
if (!client || !isReady || !subject || !enabled) return void 0;
|
|
@@ -734,7 +842,7 @@ function useNatsSubscription(subject, onMessage, options) {
|
|
|
734
842
|
return () => {
|
|
735
843
|
try {
|
|
736
844
|
sub.unsubscribe();
|
|
737
|
-
} catch (
|
|
845
|
+
} catch (e12) {
|
|
738
846
|
}
|
|
739
847
|
};
|
|
740
848
|
}, [client, isReady, subject, enabled, queue, max, reconnectionCount]);
|
|
@@ -752,7 +860,7 @@ function useNatsJsonSubscription(subject, onPayload, options) {
|
|
|
752
860
|
try {
|
|
753
861
|
const parsed = JSON.parse(decoder.decode(msg.data));
|
|
754
862
|
await handlerRef.current(parsed, msg);
|
|
755
|
-
} catch (
|
|
863
|
+
} catch (e13) {
|
|
756
864
|
}
|
|
757
865
|
},
|
|
758
866
|
[decoder]
|
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkTOTR2WMHcjs = require('./chunk-TOTR2WMH.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkRPBOWCMEcjs = require('./chunk-RPBOWCME.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkZXBRPQNDcjs = require('./chunk-ZXBRPQND.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkMSAXZRXZcjs = require('./chunk-MSAXZRXZ.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
var _chunkFRS2VO22cjs = require('./chunk-FRS2VO22.cjs');
|
|
@@ -29,13 +29,13 @@ var _chunkFRS2VO22cjs = require('./chunk-FRS2VO22.cjs');
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkJ4QORJMCcjs = require('./chunk-J4QORJMC.cjs');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _chunk3FBXQSSCcjs = require('./chunk-3FBXQSSC.cjs');
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
@@ -354,13 +354,13 @@ function toDocContent(value, requestedPath) {
|
|
|
354
354
|
function toDataSync(value) {
|
|
355
355
|
if (!isRecord(value)) return void 0;
|
|
356
356
|
const source = readString(value, "source");
|
|
357
|
-
if (!
|
|
357
|
+
if (!_chunkMSAXZRXZcjs.isDataSyncSource.call(void 0, source)) return void 0;
|
|
358
358
|
return { source, syncedAt: _nullishCoalesce(readString(value, "syncedAt"), () => ( null)) };
|
|
359
359
|
}
|
|
360
360
|
function useDocumentTree(config, initialPath) {
|
|
361
361
|
const { structureEndpoint, contentEndpoint, baseRoute } = config;
|
|
362
|
-
const folderIndexFile = _nullishCoalesce(config.folderIndexFile, () => (
|
|
363
|
-
const cleanInitialPath =
|
|
362
|
+
const folderIndexFile = _nullishCoalesce(config.folderIndexFile, () => ( _chunkJ4QORJMCcjs.DEFAULT_FOLDER_INDEX_FILE));
|
|
363
|
+
const cleanInitialPath = _chunkJ4QORJMCcjs.stripFolderIndexFromPath.call(void 0, _optionalChain([initialPath, 'optionalAccess', _4 => _4.replace, 'call', _5 => _5(/\/$/, "")]) || "", folderIndexFile);
|
|
364
364
|
const [structure, setStructure] = _react.useState.call(void 0, []);
|
|
365
365
|
const [selectedPath, setSelectedPath] = _react.useState.call(void 0, cleanInitialPath);
|
|
366
366
|
const [content, setContent] = _react.useState.call(void 0, null);
|
|
@@ -386,12 +386,12 @@ function useDocumentTree(config, initialPath) {
|
|
|
386
386
|
} else if (pathname.startsWith(`${normalizedBaseRoute}/`)) {
|
|
387
387
|
pathFromUrl = pathname.substring(`${normalizedBaseRoute}/`.length);
|
|
388
388
|
}
|
|
389
|
-
pathFromUrl =
|
|
389
|
+
pathFromUrl = _chunkJ4QORJMCcjs.stripFolderIndexFromPath.call(void 0, pathFromUrl, folderIndexFile);
|
|
390
390
|
if (pathFromUrl !== selectedPathRef.current) {
|
|
391
391
|
setSelectedPath(pathFromUrl);
|
|
392
392
|
if (pathFromUrl) {
|
|
393
393
|
const parentPath = pathFromUrl.includes("/") ? pathFromUrl.substring(0, pathFromUrl.lastIndexOf("/")) : pathFromUrl;
|
|
394
|
-
setExpandedNodes(new Set(
|
|
394
|
+
setExpandedNodes(new Set(_chunkJ4QORJMCcjs.getDocAncestorNodeIds.call(void 0, parentPath)));
|
|
395
395
|
}
|
|
396
396
|
setTimeout(() => {
|
|
397
397
|
scrollToContent();
|
|
@@ -409,7 +409,7 @@ function useDocumentTree(config, initialPath) {
|
|
|
409
409
|
setSelectedPath(cleanInitialPath);
|
|
410
410
|
if (cleanInitialPath) {
|
|
411
411
|
const parentPath = cleanInitialPath.includes("/") ? cleanInitialPath.substring(0, cleanInitialPath.lastIndexOf("/")) : cleanInitialPath;
|
|
412
|
-
setExpandedNodes(new Set(
|
|
412
|
+
setExpandedNodes(new Set(_chunkJ4QORJMCcjs.getDocAncestorNodeIds.call(void 0, parentPath)));
|
|
413
413
|
}
|
|
414
414
|
setExternalNavCount((n) => n + 1);
|
|
415
415
|
}
|
|
@@ -434,7 +434,7 @@ function useDocumentTree(config, initialPath) {
|
|
|
434
434
|
if (cleanInitialPath) {
|
|
435
435
|
const pathForExpansion = cleanInitialPath.includes(".") ? cleanInitialPath.substring(0, cleanInitialPath.lastIndexOf("/")) : cleanInitialPath;
|
|
436
436
|
if (pathForExpansion) {
|
|
437
|
-
setExpandedNodes(new Set(
|
|
437
|
+
setExpandedNodes(new Set(_chunkJ4QORJMCcjs.getDocAncestorNodeIds.call(void 0, pathForExpansion)));
|
|
438
438
|
}
|
|
439
439
|
} else if (nodes.length > 0) {
|
|
440
440
|
const hasRootReadme = nodes.some((node) => node.type === "file" && node.path === folderIndexFile);
|
|
@@ -474,7 +474,7 @@ function useDocumentTree(config, initialPath) {
|
|
|
474
474
|
setContent(null);
|
|
475
475
|
return;
|
|
476
476
|
}
|
|
477
|
-
const probe =
|
|
477
|
+
const probe = _chunkJ4QORJMCcjs.findDocNodeByPath.call(void 0, _chunkJ4QORJMCcjs.stripFolderIndexFromPath.call(void 0, path, folderIndexFile), structure);
|
|
478
478
|
const probeIsNoReadmeFolder = !!probe && probe.type === "folder" && !probe.hasReadme;
|
|
479
479
|
const preStructureFolderLike = structure.length === 0 && !path.endsWith(".md");
|
|
480
480
|
if (probeIsNoReadmeFolder || preStructureFolderLike) {
|
|
@@ -533,7 +533,7 @@ function useDocumentTree(config, initialPath) {
|
|
|
533
533
|
if (selectedPath === "") {
|
|
534
534
|
pathToFetch = folderIndexFile;
|
|
535
535
|
} else {
|
|
536
|
-
const node =
|
|
536
|
+
const node = _chunkJ4QORJMCcjs.findDocNodeByPath.call(void 0, selectedPath, structure);
|
|
537
537
|
if (node && node.type === "folder" && !node.hasReadme) {
|
|
538
538
|
const firstDocPath = findFirstDocPath(node);
|
|
539
539
|
if (!firstDocPath) {
|
|
@@ -574,16 +574,16 @@ function useDocumentTree(config, initialPath) {
|
|
|
574
574
|
if (node.type === "folder") {
|
|
575
575
|
setExpandedNodes((prev) => {
|
|
576
576
|
if (prev.has(node.id)) {
|
|
577
|
-
const ancestorIds =
|
|
577
|
+
const ancestorIds = _chunkJ4QORJMCcjs.getDocAncestorNodeIds.call(void 0, node.path);
|
|
578
578
|
ancestorIds.pop();
|
|
579
579
|
return new Set(ancestorIds);
|
|
580
580
|
}
|
|
581
|
-
return new Set(
|
|
581
|
+
return new Set(_chunkJ4QORJMCcjs.getDocAncestorNodeIds.call(void 0, node.path));
|
|
582
582
|
});
|
|
583
583
|
} else {
|
|
584
584
|
const lastSlash = node.path.lastIndexOf("/");
|
|
585
585
|
if (lastSlash > 0) {
|
|
586
|
-
setExpandedNodes(new Set(
|
|
586
|
+
setExpandedNodes(new Set(_chunkJ4QORJMCcjs.getDocAncestorNodeIds.call(void 0, node.path.substring(0, lastSlash))));
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
589
|
lastFetchedPath.current = null;
|
|
@@ -598,7 +598,7 @@ function useDocumentTree(config, initialPath) {
|
|
|
598
598
|
const hashIndex = path.indexOf("#");
|
|
599
599
|
const anchor = hashIndex !== -1 ? path.substring(hashIndex) : "";
|
|
600
600
|
const cleanPath = path.replace(/\/$/, "").split("#")[0];
|
|
601
|
-
const pathForSelection = anchor && _optionalChain([options, 'optionalAccess', _6 => _6.fromInternalLink]) && cleanPath === "" ? selectedPathRef.current :
|
|
601
|
+
const pathForSelection = anchor && _optionalChain([options, 'optionalAccess', _6 => _6.fromInternalLink]) && cleanPath === "" ? selectedPathRef.current : _chunkJ4QORJMCcjs.stripFolderIndexFromPath.call(void 0, cleanPath, folderIndexFile);
|
|
602
602
|
if (anchor && _optionalChain([options, 'optionalAccess', _7 => _7.fromInternalLink]) && pathForSelection === selectedPathRef.current) {
|
|
603
603
|
_chunkOJZBZH56cjs.navigateSamePageHash.call(void 0, anchor, { headerOffset: _chunkOJZBZH56cjs.HUB_HEADER_OFFSET_PX });
|
|
604
604
|
return;
|
|
@@ -662,15 +662,15 @@ function useDocumentTree(config, initialPath) {
|
|
|
662
662
|
return docNavigation.register({
|
|
663
663
|
baseRoute: normalizedBaseRoute,
|
|
664
664
|
findNodeByPath: (path) => {
|
|
665
|
-
const clean =
|
|
666
|
-
return _nullishCoalesce(
|
|
665
|
+
const clean = _chunkJ4QORJMCcjs.stripFolderIndexFromPath.call(void 0, path.replace(/\/$/, "").split("#")[0], folderIndexFile);
|
|
666
|
+
return _nullishCoalesce(_chunkJ4QORJMCcjs.findDocNodeByPath.call(void 0, clean, structure), () => ( null));
|
|
667
667
|
},
|
|
668
668
|
selectNode
|
|
669
669
|
});
|
|
670
670
|
}, [docNavigation, normalizedBaseRoute, structure, selectNode, folderIndexFile]);
|
|
671
671
|
const isEmptyFolder = _react.useMemo.call(void 0, () => {
|
|
672
672
|
if (!selectedPath || structure.length === 0) return false;
|
|
673
|
-
const node =
|
|
673
|
+
const node = _chunkJ4QORJMCcjs.findDocNodeByPath.call(void 0, selectedPath, structure);
|
|
674
674
|
return !!node && node.type === "folder" && !node.hasReadme && !findFirstDocPath(node);
|
|
675
675
|
}, [selectedPath, structure]);
|
|
676
676
|
return {
|
|
@@ -753,14 +753,14 @@ function DocViewerContent({
|
|
|
753
753
|
},
|
|
754
754
|
docPath
|
|
755
755
|
);
|
|
756
|
-
const { activeSection, handleSectionClick } =
|
|
756
|
+
const { activeSection, handleSectionClick } = _chunkRPBOWCMEcjs.useScrollSpy.call(void 0, _optionalChain([content, 'optionalAccess', _11 => _11.sections]));
|
|
757
757
|
const docNav = useDocNavigation();
|
|
758
758
|
const router = _chunk7DNL734Scjs.useRouter.call(void 0, );
|
|
759
759
|
const backCfg = backButton === false ? null : {
|
|
760
760
|
label: _nullishCoalesce(_optionalChain([backButton, 'optionalAccess', _12 => _12.label]), () => ( "Back to home")),
|
|
761
761
|
onClick: () => router.push(_nullishCoalesce(_optionalChain([backButton, 'optionalAccess', _13 => _13.href]), () => ( "/")))
|
|
762
762
|
};
|
|
763
|
-
const docSearch =
|
|
763
|
+
const docSearch = _chunkZXBRPQNDcjs.useDocSearch.call(void 0, {
|
|
764
764
|
source: chatSource,
|
|
765
765
|
baseRoute,
|
|
766
766
|
searchEndpoint,
|
|
@@ -784,7 +784,7 @@ function DocViewerContent({
|
|
|
784
784
|
onResolveLink: resolveLink
|
|
785
785
|
});
|
|
786
786
|
}, [content, renderContent, navigateToDoc, sourceId, resolveLink]);
|
|
787
|
-
const selectedNodeDocType = selectedPath && structure.length > 0 ? _optionalChain([
|
|
787
|
+
const selectedNodeDocType = selectedPath && structure.length > 0 ? _optionalChain([_chunkJ4QORJMCcjs.findDocNodeByPath.call(void 0, selectedPath, structure), 'optionalAccess', _14 => _14.documentType]) : void 0;
|
|
788
788
|
const activeDocType = _nullishCoalesce(_optionalChain([content, 'optionalAccess', _15 => _15.documentType]), () => ( selectedNodeDocType));
|
|
789
789
|
const isMarkdownContent = !activeDocType || activeDocType === "markdown";
|
|
790
790
|
const showStickyNav = isMarkdownContent;
|
|
@@ -796,9 +796,9 @@ function DocViewerContent({
|
|
|
796
796
|
const defaultEmptyText = structure.length > 0 ? "Select a document from the sidebar to view" : "No documents yet. Add content from the admin panel.";
|
|
797
797
|
const resolvedEmptyText = emptyStateText || defaultEmptyText;
|
|
798
798
|
const inner = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { ...bgStyle, ...containerBgStyle }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFRS2VO22cjs.PageLayout, { title, subtitle, titleSize: "h1", titleWrap: true, backButton: _nullishCoalesce(backCfg, () => ( void 0)), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-full flex-col gap-10", children: [
|
|
799
|
-
synced && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
799
|
+
synced && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMSAXZRXZcjs.DataSyncLine, { sync: _optionalChain([content, 'optionalAccess', _19 => _19.sync]), loading: !content && (isLoadingContent || isLoadingStructure) }),
|
|
800
800
|
showAIChat && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
801
|
-
|
|
801
|
+
_chunkZXBRPQNDcjs.DocSearchBar,
|
|
802
802
|
{
|
|
803
803
|
placeholder: `Search ${_optionalChain([sidebarLabel, 'optionalAccess', _20 => _20.toLowerCase, 'call', _21 => _21()]) || "documents"}...`,
|
|
804
804
|
query: docSearch.query,
|
|
@@ -819,7 +819,7 @@ function DocViewerContent({
|
|
|
819
819
|
!error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-1 flex-col items-start gap-6 content-lg:flex-row content-lg:gap-10", children: [
|
|
820
820
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-full content-lg:w-[320px] content-lg:shrink-0", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "content-lg:sticky content-lg:top-20", children: [
|
|
821
821
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PersistentMobileDropdown, { isLoading: false, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
822
|
-
|
|
822
|
+
_chunkRPBOWCMEcjs.MobileNavigationDropdown,
|
|
823
823
|
{
|
|
824
824
|
nodes: structure,
|
|
825
825
|
selectedPath,
|
|
@@ -833,7 +833,7 @@ function DocViewerContent({
|
|
|
833
833
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, PersistentSidebar, { isLoading: false, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "hidden content-lg:block", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-4", children: [
|
|
834
834
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "font-semibold text-ods-text-secondary text-h5", children: sidebarLabel }),
|
|
835
835
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
836
|
-
|
|
836
|
+
_chunkRPBOWCMEcjs.MultiLevelNavigation,
|
|
837
837
|
{
|
|
838
838
|
nodes: structure,
|
|
839
839
|
selectedPath,
|
|
@@ -872,7 +872,7 @@ function DocViewerContent({
|
|
|
872
872
|
showStickyNav && content && stickyNavSections.length > 0 && !isLoadingContent && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "hidden content-lg:block", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "sticky top-24", children: [
|
|
873
873
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: ON_THIS_PAGE_HEADING_CLASS, children: ON_THIS_PAGE_LABEL }),
|
|
874
874
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
875
|
-
|
|
875
|
+
_chunkRPBOWCMEcjs.StickySectionNav,
|
|
876
876
|
{
|
|
877
877
|
sections: stickyNavSections,
|
|
878
878
|
activeSection,
|
|
@@ -887,7 +887,7 @@ function DocViewerContent({
|
|
|
887
887
|
) })
|
|
888
888
|
] })
|
|
889
889
|
] }) }) });
|
|
890
|
-
return shell ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
890
|
+
return shell ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMSAXZRXZcjs.PageShell, { contentClassName: `${bgClass} ${className}`, children: inner }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `page-shell-content ${bgClass} ${className}`.trim(), children: inner });
|
|
891
891
|
}
|
|
892
892
|
|
|
893
893
|
// src/components/docs/skeletons.tsx
|
|
@@ -903,14 +903,14 @@ var MARKDOWN_SKELETON_BLOCKS = [
|
|
|
903
903
|
{ kind: "p", lines: 3 },
|
|
904
904
|
{ kind: "p", lines: 4 }
|
|
905
905
|
];
|
|
906
|
-
var MARKDOWN_SKELETON_H2_CLASS = _chunk7JWFMAQBcjs.cn.call(void 0,
|
|
907
|
-
var MARKDOWN_SKELETON_P_CLASS = _chunk7JWFMAQBcjs.cn.call(void 0,
|
|
906
|
+
var MARKDOWN_SKELETON_H2_CLASS = _chunk7JWFMAQBcjs.cn.call(void 0, _chunk3FBXQSSCcjs.MARKDOWN_H2_CLASS, _chunk3FBXQSSCcjs.TEXT_SIZE_PRESETS.default.h2);
|
|
907
|
+
var MARKDOWN_SKELETON_P_CLASS = _chunk7JWFMAQBcjs.cn.call(void 0, _chunk3FBXQSSCcjs.MARKDOWN_PARAGRAPH_CLASS, _chunk3FBXQSSCcjs.TEXT_SIZE_PRESETS.default.p);
|
|
908
908
|
function MarkdownSkeleton({
|
|
909
909
|
region = true
|
|
910
910
|
} = {}) {
|
|
911
911
|
return (
|
|
912
912
|
// The renderer's root class, and its box (no margin of its own, like the rendered body): the document's first fold.
|
|
913
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLKQ33CMYcjs.LoadingRegion, { label: "Loading the document", announce: region, className:
|
|
913
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLKQ33CMYcjs.LoadingRegion, { label: "Loading the document", announce: region, className: _chunk3FBXQSSCcjs.MARKDOWN_RENDERER_CLASS, children: MARKDOWN_SKELETON_BLOCKS.map(
|
|
914
914
|
(block, i) => block.kind === "h2" ? (
|
|
915
915
|
// biome-ignore lint/suspicious/noArrayIndexKey: skeleton blocks never reorder
|
|
916
916
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: MARKDOWN_SKELETON_H2_CLASS, "aria-hidden": true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4WIJI4AKcjs.TextLineSkeleton, { type: "inherit", as: "span", className: "w-1/3" }) }, i)
|
|
@@ -959,7 +959,7 @@ function EmbedSkeleton({ documentType, region = true } = {}) {
|
|
|
959
959
|
] }),
|
|
960
960
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex w-full items-center gap-2 content-sm:w-auto", children: Array.from({ length: buttonCount }).map((_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4WIJI4AKcjs.UnifiedSkeleton, { className: "h-10 w-full flex-1 rounded content-sm:w-32 content-sm:flex-initial" }, i)) })
|
|
961
961
|
] }),
|
|
962
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
962
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMSAXZRXZcjs.EmbedLoadingSkeleton, { region: false })
|
|
963
963
|
] });
|
|
964
964
|
}
|
|
965
965
|
|
|
@@ -967,11 +967,11 @@ function EmbedSkeleton({ documentType, region = true } = {}) {
|
|
|
967
967
|
|
|
968
968
|
var DEFAULT_TITLE = "Documents";
|
|
969
969
|
var defaultFallbackRenderer = () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "py-16 text-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-ods-text-secondary", children: "Unsupported document type" }) });
|
|
970
|
-
var defaultPdfRenderer = (content, handlers) => content.fileUrl ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
971
|
-
var defaultGoogleSheetRenderer = (content, handlers) => content.externalUrl ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
972
|
-
var defaultFigmaRenderer = (content, handlers) => content.externalUrl ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
970
|
+
var defaultPdfRenderer = (content, handlers) => content.fileUrl ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTOTR2WMHcjs.PdfViewer, { src: content.fileUrl, fileName: content.fileName }) : defaultFallbackRenderer(content, handlers);
|
|
971
|
+
var defaultGoogleSheetRenderer = (content, handlers) => content.externalUrl ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTOTR2WMHcjs.GoogleSheetsViewer, { externalUrl: content.externalUrl, fileName: content.fileName }) : defaultFallbackRenderer(content, handlers);
|
|
972
|
+
var defaultFigmaRenderer = (content, handlers) => content.externalUrl ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMSAXZRXZcjs.FigmaEmbed, { url: content.externalUrl, title: content.fileName, loading: "eager" }) : defaultFallbackRenderer(content, handlers);
|
|
973
973
|
var defaultFileRenderer = (content) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
974
|
-
|
|
974
|
+
_chunkTOTR2WMHcjs.FileDownloadCard,
|
|
975
975
|
{
|
|
976
976
|
fileName: content.fileName,
|
|
977
977
|
mimeType: content.mimeType,
|