@flamingo-stack/openframe-frontend-core 0.0.598-2039.5713.1 → 0.0.598
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/chat-protocol/index.cjs +1 -8
- package/dist/chat-protocol/index.cjs.map +1 -1
- package/dist/chat-protocol/index.d.ts +0 -1
- package/dist/chat-protocol/index.d.ts.map +1 -1
- package/dist/chat-protocol/index.js +2 -7
- package/dist/chat-protocol/index.js.map +1 -1
- package/dist/chat-protocol/nats-decoder.d.ts.map +1 -1
- package/dist/{chunk-TSCIVH7T.js → chunk-2JNCZDJR.js} +2 -2
- package/dist/{chunk-6NSGAH5H.cjs → chunk-2SYX2Z7R.cjs} +34 -34
- package/dist/{chunk-6NSGAH5H.cjs.map → chunk-2SYX2Z7R.cjs.map} +1 -1
- package/dist/{chunk-6ZHH37RS.cjs → chunk-3WSS7C2V.cjs} +15 -15
- package/dist/{chunk-6ZHH37RS.cjs.map → chunk-3WSS7C2V.cjs.map} +1 -1
- package/dist/{chunk-5L4ERWSW.js → chunk-75YW6ET4.js} +4 -4
- package/dist/{chunk-VKCETV3C.js → chunk-BK6CCQG6.js} +12 -12
- package/dist/{chunk-HM25MFZX.cjs → chunk-BPVHDDNY.cjs} +8 -8
- package/dist/{chunk-HM25MFZX.cjs.map → chunk-BPVHDDNY.cjs.map} +1 -1
- package/dist/{chunk-VIBREYUK.cjs → chunk-BZEWPW5A.cjs} +3 -3
- package/dist/{chunk-VIBREYUK.cjs.map → chunk-BZEWPW5A.cjs.map} +1 -1
- package/dist/{chunk-KYWU6F3O.cjs → chunk-DAPOBLAK.cjs} +39 -39
- package/dist/{chunk-KYWU6F3O.cjs.map → chunk-DAPOBLAK.cjs.map} +1 -1
- package/dist/{chunk-DHCA5BZP.cjs → chunk-DI3SVVY5.cjs} +85 -85
- package/dist/{chunk-DHCA5BZP.cjs.map → chunk-DI3SVVY5.cjs.map} +1 -1
- package/dist/{chunk-BLUL2TE3.js → chunk-EVMHJB6X.js} +4 -4
- package/dist/{chunk-S6WBBSII.js → chunk-EZM5DNII.js} +3 -3
- package/dist/{chunk-BVQEU5JB.js → chunk-GGQZBSFN.js} +2 -2
- package/dist/{chunk-KTX5B2FW.js → chunk-GHYFVT52.js} +439 -414
- package/dist/chunk-GHYFVT52.js.map +1 -0
- package/dist/{chunk-CCWI3622.cjs → chunk-H64ZHSYR.cjs} +4 -4
- package/dist/{chunk-CCWI3622.cjs.map → chunk-H64ZHSYR.cjs.map} +1 -1
- package/dist/{chunk-4T42D6YG.js → chunk-HLPAVYK7.js} +4 -4
- package/dist/{chunk-HFHBA3VV.cjs → chunk-HWAYIK4U.cjs} +22 -22
- package/dist/{chunk-HFHBA3VV.cjs.map → chunk-HWAYIK4U.cjs.map} +1 -1
- package/dist/{chunk-CF4QJPTN.cjs → chunk-JVZVVZOZ.cjs} +9 -9
- package/dist/{chunk-CF4QJPTN.cjs.map → chunk-JVZVVZOZ.cjs.map} +1 -1
- package/dist/{chunk-XV7RFACE.js → chunk-KHOZ52NR.js} +6 -6
- package/dist/{chunk-IW746HJ7.js → chunk-LRQCKSZC.js} +2 -2
- package/dist/{chunk-JJUV7Z4L.cjs → chunk-M4YQUHOR.cjs} +15 -15
- package/dist/{chunk-JJUV7Z4L.cjs.map → chunk-M4YQUHOR.cjs.map} +1 -1
- package/dist/{chunk-FKBM6U43.js → chunk-MYBXCWEI.js} +2 -2
- package/dist/{chunk-QTPHBCPI.js → chunk-NIAMPMKV.js} +4 -4
- package/dist/{chunk-UXOOVP77.cjs → chunk-O4VZOA2Q.cjs} +3 -3
- package/dist/{chunk-UXOOVP77.cjs.map → chunk-O4VZOA2Q.cjs.map} +1 -1
- package/dist/{chunk-ABNBTPI2.cjs → chunk-P24VPJTT.cjs} +15 -15
- package/dist/{chunk-ABNBTPI2.cjs.map → chunk-P24VPJTT.cjs.map} +1 -1
- package/dist/{chunk-4XPPQDEM.js → chunk-PTK3CINU.js} +5 -5
- package/dist/{chunk-7FUIRGMU.js → chunk-PX4IPM7Q.js} +3 -3
- package/dist/{chunk-NLT5R43J.cjs → chunk-QD64Q4I2.cjs} +9 -9
- package/dist/{chunk-NLT5R43J.cjs.map → chunk-QD64Q4I2.cjs.map} +1 -1
- package/dist/{chunk-TEVP4KNG.cjs → chunk-QIKBISZM.cjs} +522 -497
- package/dist/chunk-QIKBISZM.cjs.map +1 -0
- package/dist/{chunk-FGNUI4CC.js → chunk-R4UV366K.js} +6 -6
- package/dist/{chunk-UPKZU6QU.cjs → chunk-RDTOMWDN.cjs} +1 -1
- package/dist/chunk-RDTOMWDN.cjs.map +1 -0
- package/dist/{chunk-YB6FI2G3.js → chunk-RYXIRVDC.js} +1 -1
- package/dist/chunk-RYXIRVDC.js.map +1 -0
- package/dist/{chunk-QPAPUIF3.cjs → chunk-SAEJGTCI.cjs} +35 -35
- package/dist/{chunk-QPAPUIF3.cjs.map → chunk-SAEJGTCI.cjs.map} +1 -1
- package/dist/{chunk-66HTVTZZ.js → chunk-SE3PVN64.js} +2 -2
- package/dist/{chunk-3IXDZI3R.cjs → chunk-STYNZ4QM.cjs} +3 -3
- package/dist/{chunk-3IXDZI3R.cjs.map → chunk-STYNZ4QM.cjs.map} +1 -1
- package/dist/{chunk-CQRYXSHL.js → chunk-TZPVRWPU.js} +5 -5
- package/dist/{chunk-RU3IKVY2.js → chunk-UAAXUFK6.js} +3 -3
- package/dist/{chunk-F5NEZLTG.cjs → chunk-UE7OFLLS.cjs} +14 -14
- package/dist/{chunk-F5NEZLTG.cjs.map → chunk-UE7OFLLS.cjs.map} +1 -1
- package/dist/{chunk-VUR24QYH.cjs → chunk-UG7JNQZY.cjs} +37 -37
- package/dist/{chunk-VUR24QYH.cjs.map → chunk-UG7JNQZY.cjs.map} +1 -1
- package/dist/{chunk-UQSOFWXP.cjs → chunk-V2QK5W3O.cjs} +3 -3
- package/dist/{chunk-UQSOFWXP.cjs.map → chunk-V2QK5W3O.cjs.map} +1 -1
- package/dist/{chunk-ZABAXD4U.js → chunk-VIRTMRS4.js} +7 -7
- package/dist/{chunk-D565OOXC.cjs → chunk-VLJTJAHJ.cjs} +25 -25
- package/dist/{chunk-D565OOXC.cjs.map → chunk-VLJTJAHJ.cjs.map} +1 -1
- package/dist/{chunk-K5QV7ZAY.js → chunk-VNSRNVPD.js} +437 -756
- package/dist/chunk-VNSRNVPD.js.map +1 -0
- package/dist/{chunk-UQEOAPAI.cjs → chunk-WCBRZCU4.cjs} +9 -9
- package/dist/{chunk-UQEOAPAI.cjs.map → chunk-WCBRZCU4.cjs.map} +1 -1
- package/dist/{chunk-3XFDRL32.js → chunk-WDWCQD75.js} +9 -9
- package/dist/{chunk-QT35C6CW.js → chunk-WPN545FW.js} +12 -12
- package/dist/{chunk-F2KBCLUG.js → chunk-WZJOILPU.js} +2 -2
- package/dist/{chunk-KAADFO74.js → chunk-XNPAVMPB.js} +5 -5
- package/dist/{chunk-5PPYXXUO.cjs → chunk-YBPFIXV4.cjs} +522 -841
- package/dist/chunk-YBPFIXV4.cjs.map +1 -0
- package/dist/{chunk-EHAYNUOL.cjs → chunk-YH6IQTPI.cjs} +3 -3
- package/dist/{chunk-EHAYNUOL.cjs.map → chunk-YH6IQTPI.cjs.map} +1 -1
- package/dist/{chunk-AVAENPVE.cjs → chunk-YWBAIFI2.cjs} +105 -105
- package/dist/{chunk-AVAENPVE.cjs.map → chunk-YWBAIFI2.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +14 -14
- package/dist/components/case-studies/index.js +8 -8
- package/dist/components/chat/embeddable-chat.d.ts +19 -10
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/hooks/index.d.ts +0 -1
- package/dist/components/chat/hooks/index.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-chat-dialog-manager.d.ts +2 -2
- package/dist/components/chat/hooks/use-chat-dialog-manager.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-chat-history-hydration.d.ts +3 -13
- package/dist/components/chat/hooks/use-chat-history-hydration.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts +16 -2
- package/dist/components/chat/hooks/use-nats-chat-adapter.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-unified-chat.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +5 -9
- package/dist/components/chat/index.cjs.map +1 -1
- package/dist/components/chat/index.js +4 -8
- package/dist/components/chat/types/unified-chat-state.types.d.ts +6 -67
- package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -1
- package/dist/components/chat/utils/index.d.ts +0 -1
- package/dist/components/chat/utils/index.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +9 -9
- package/dist/components/contact/index.js +8 -8
- package/dist/components/docs/index.cjs +12 -12
- package/dist/components/docs/index.js +11 -11
- package/dist/components/embeds/index.cjs +9 -9
- package/dist/components/embeds/index.js +8 -8
- package/dist/components/faq/index.cjs +10 -10
- package/dist/components/faq/index.js +9 -9
- package/dist/components/features/index.cjs +8 -8
- package/dist/components/features/index.js +7 -7
- package/dist/components/help-center-pages/index.cjs +31 -31
- package/dist/components/help-center-pages/index.js +22 -22
- package/dist/components/index.cjs +66 -70
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +22 -26
- package/dist/components/index.js.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +49 -49
- package/dist/components/meeting-scheduler/index.js +9 -9
- package/dist/components/navigation/index.cjs +11 -11
- package/dist/components/navigation/index.js +10 -10
- package/dist/components/onboarding-guides/index.cjs +12 -12
- package/dist/components/onboarding-guides/index.js +11 -11
- package/dist/components/related-content/index.cjs +7 -7
- package/dist/components/related-content/index.js +6 -6
- package/dist/components/tickets/index.cjs +13 -13
- package/dist/components/tickets/index.js +12 -12
- package/dist/components/ui/data-table/data-table-body.d.ts.map +1 -1
- package/dist/components/ui/data-table/data-table-skeleton.d.ts +31 -0
- package/dist/components/ui/data-table/data-table-skeleton.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +8 -12
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.js +7 -11
- package/dist/components/ui/table/table-empty-state.d.ts +1 -1
- package/dist/components/ui/table/table-empty-state.d.ts.map +1 -1
- package/dist/components/ui/table/table-skeleton.d.ts +1 -14
- package/dist/components/ui/table/table-skeleton.d.ts.map +1 -1
- package/dist/components/ui/table/table.d.ts +1 -1
- package/dist/components/ui/table/table.d.ts.map +1 -1
- package/dist/components/ui/table/types.d.ts +33 -6
- package/dist/components/ui/table/types.d.ts.map +1 -1
- package/dist/contexts/chat-runtime-context.d.ts +0 -12
- package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
- package/dist/contexts/index.cjs +2 -2
- package/dist/contexts/index.js +1 -1
- package/dist/hooks/index.cjs +5 -5
- package/dist/hooks/index.js +4 -4
- package/dist/index.cjs +12 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/chat-protocol/index.ts +0 -1
- package/src/chat-protocol/nats-decoder.ts +5 -1
- package/src/components/chat/.embeddable-chat.md +2 -4
- package/src/components/chat/embeddable-chat.tsx +84 -131
- package/src/components/chat/hooks/.use-chat-dialog-manager.md +1 -3
- package/src/components/chat/hooks/.use-nats-chat-adapter.md +1 -3
- package/src/components/chat/hooks/.use-sse-chat-adapter.md +1 -8
- package/src/components/chat/hooks/.use-unified-chat.md +2 -2
- package/src/components/chat/hooks/index.ts +0 -2
- package/src/components/chat/hooks/use-chat-dialog-manager.ts +65 -38
- package/src/components/chat/hooks/use-chat-history-hydration.ts +24 -67
- package/src/components/chat/hooks/use-nats-chat-adapter.ts +150 -65
- package/src/components/chat/hooks/use-sse-chat-adapter.ts +59 -233
- package/src/components/chat/hooks/use-unified-chat.ts +0 -5
- package/src/components/chat/types/.unified-chat-state.types.md +1 -13
- package/src/components/chat/types/unified-chat-state.types.ts +6 -74
- package/src/components/chat/utils/index.ts +0 -7
- package/src/components/ui/data-table/data-table-body.tsx +8 -49
- package/src/components/ui/data-table/data-table-skeleton.tsx +100 -0
- package/src/components/ui/table/table-empty-state.tsx +5 -1
- package/src/components/ui/table/table-skeleton.tsx +14 -40
- package/src/components/ui/table/table.tsx +34 -15
- package/src/components/ui/table/types.ts +33 -6
- package/src/contexts/.chat-runtime-context.md +1 -3
- package/src/contexts/chat-runtime-context.tsx +0 -12
- package/dist/chat-protocol/wire-narrow.d.ts +0 -17
- package/dist/chat-protocol/wire-narrow.d.ts.map +0 -1
- package/dist/chunk-5PPYXXUO.cjs.map +0 -1
- package/dist/chunk-K5QV7ZAY.js.map +0 -1
- package/dist/chunk-KTX5B2FW.js.map +0 -1
- package/dist/chunk-TEVP4KNG.cjs.map +0 -1
- package/dist/chunk-UPKZU6QU.cjs.map +0 -1
- package/dist/chunk-YB6FI2G3.js.map +0 -1
- package/dist/components/chat/hooks/use-managed-dialog-list.d.ts +0 -68
- package/dist/components/chat/hooks/use-managed-dialog-list.d.ts.map +0 -1
- package/dist/components/chat/utils/chat-conversations-api.d.ts +0 -29
- package/dist/components/chat/utils/chat-conversations-api.d.ts.map +0 -1
- package/src/chat-protocol/wire-narrow.ts +0 -22
- package/src/components/chat/hooks/.use-managed-dialog-list.md +0 -31
- package/src/components/chat/hooks/__tests__/managed-dialog-list.test.ts +0 -280
- package/src/components/chat/hooks/__tests__/nats-adapter-managed-dialogs.test.ts +0 -172
- package/src/components/chat/hooks/__tests__/sse-managed-dialogs.test.ts +0 -310
- package/src/components/chat/hooks/use-managed-dialog-list.ts +0 -371
- package/src/components/chat/utils/.chat-conversations-api.md +0 -16
- package/src/components/chat/utils/__tests__/chat-conversations-api-golden.test.ts +0 -105
- package/src/components/chat/utils/chat-conversations-api.ts +0 -83
- /package/dist/{chunk-TSCIVH7T.js.map → chunk-2JNCZDJR.js.map} +0 -0
- /package/dist/{chunk-5L4ERWSW.js.map → chunk-75YW6ET4.js.map} +0 -0
- /package/dist/{chunk-VKCETV3C.js.map → chunk-BK6CCQG6.js.map} +0 -0
- /package/dist/{chunk-BLUL2TE3.js.map → chunk-EVMHJB6X.js.map} +0 -0
- /package/dist/{chunk-S6WBBSII.js.map → chunk-EZM5DNII.js.map} +0 -0
- /package/dist/{chunk-BVQEU5JB.js.map → chunk-GGQZBSFN.js.map} +0 -0
- /package/dist/{chunk-4T42D6YG.js.map → chunk-HLPAVYK7.js.map} +0 -0
- /package/dist/{chunk-XV7RFACE.js.map → chunk-KHOZ52NR.js.map} +0 -0
- /package/dist/{chunk-IW746HJ7.js.map → chunk-LRQCKSZC.js.map} +0 -0
- /package/dist/{chunk-FKBM6U43.js.map → chunk-MYBXCWEI.js.map} +0 -0
- /package/dist/{chunk-QTPHBCPI.js.map → chunk-NIAMPMKV.js.map} +0 -0
- /package/dist/{chunk-4XPPQDEM.js.map → chunk-PTK3CINU.js.map} +0 -0
- /package/dist/{chunk-7FUIRGMU.js.map → chunk-PX4IPM7Q.js.map} +0 -0
- /package/dist/{chunk-FGNUI4CC.js.map → chunk-R4UV366K.js.map} +0 -0
- /package/dist/{chunk-66HTVTZZ.js.map → chunk-SE3PVN64.js.map} +0 -0
- /package/dist/{chunk-CQRYXSHL.js.map → chunk-TZPVRWPU.js.map} +0 -0
- /package/dist/{chunk-RU3IKVY2.js.map → chunk-UAAXUFK6.js.map} +0 -0
- /package/dist/{chunk-ZABAXD4U.js.map → chunk-VIRTMRS4.js.map} +0 -0
- /package/dist/{chunk-3XFDRL32.js.map → chunk-WDWCQD75.js.map} +0 -0
- /package/dist/{chunk-QT35C6CW.js.map → chunk-WPN545FW.js.map} +0 -0
- /package/dist/{chunk-F2KBCLUG.js.map → chunk-WZJOILPU.js.map} +0 -0
- /package/dist/{chunk-KAADFO74.js.map → chunk-XNPAVMPB.js.map} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
3
4
|
import { cn } from '../../../utils/cn';
|
|
4
5
|
import { useDataTableContext } from './data-table';
|
|
5
6
|
import { getHideClasses } from './utils';
|
|
@@ -106,3 +107,102 @@ export function DataTableSkeleton({ rows = 10, className, rowClassName, rowHeigh
|
|
|
106
107
|
</>
|
|
107
108
|
);
|
|
108
109
|
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The empty state, floating centred over a full page's worth of reserved row
|
|
113
|
+
* slots. Both table bodies render this — an empty table is exactly when a
|
|
114
|
+
* collapsing one is most visible (the pagination and everything under it jump
|
|
115
|
+
* the moment a filter matches nothing), and two hand-matched copies of the
|
|
116
|
+
* wrapper would drift the way the two placeholder components already had.
|
|
117
|
+
*/
|
|
118
|
+
export function ReservedEmptyState({
|
|
119
|
+
count,
|
|
120
|
+
gapClassName,
|
|
121
|
+
rowHeightClassName,
|
|
122
|
+
innerHeightClassName,
|
|
123
|
+
children,
|
|
124
|
+
}: {
|
|
125
|
+
count: number;
|
|
126
|
+
gapClassName: string;
|
|
127
|
+
rowHeightClassName?: string;
|
|
128
|
+
innerHeightClassName?: string;
|
|
129
|
+
children: ReactNode;
|
|
130
|
+
}) {
|
|
131
|
+
return (
|
|
132
|
+
<div className={cn('relative flex w-full flex-col', gapClassName)}>
|
|
133
|
+
<PlaceholderRows
|
|
134
|
+
count={count}
|
|
135
|
+
rowHeightClassName={rowHeightClassName}
|
|
136
|
+
innerHeightClassName={innerHeightClassName}
|
|
137
|
+
/>
|
|
138
|
+
{/* `sticky left-0` + `w-screen max-w-full`: hosts wrap tables in a
|
|
139
|
+
horizontal scroller with a forced min-width, and an overlay centred on
|
|
140
|
+
that CANVAS puts the message off-screen on a phone. This centres it on
|
|
141
|
+
the visible area instead, and collapses to plain centring when the
|
|
142
|
+
table is not wider than its container. */}
|
|
143
|
+
<div className="absolute inset-0 flex items-center">
|
|
144
|
+
<div className="sticky left-0 flex w-screen max-w-full justify-center">{children}</div>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Invisible rows that occupy exactly one row slot each.
|
|
152
|
+
*
|
|
153
|
+
* THE height reservation for a table whose page is short or empty — every call
|
|
154
|
+
* site uses it (data-table's pad + empty branches AND the legacy `Table`'s), so
|
|
155
|
+
* a padded page and an empty one are the same height by construction rather
|
|
156
|
+
* than by matching guesses in each component.
|
|
157
|
+
*/
|
|
158
|
+
export function PlaceholderRows({
|
|
159
|
+
count,
|
|
160
|
+
rowHeightClassName,
|
|
161
|
+
innerHeightClassName,
|
|
162
|
+
}: {
|
|
163
|
+
count: number;
|
|
164
|
+
/** Height on the CARD, as `DataTableRow` carries it. */
|
|
165
|
+
rowHeightClassName?: string;
|
|
166
|
+
/** Height on the INNER row instead — the legacy `Table` puts it there and
|
|
167
|
+
* lets the card's border add the remaining 2px, so its pad rows must too. */
|
|
168
|
+
innerHeightClassName?: string;
|
|
169
|
+
}) {
|
|
170
|
+
return (
|
|
171
|
+
<>
|
|
172
|
+
{Array.from({ length: count }).map((_, i) => (
|
|
173
|
+
<div
|
|
174
|
+
key={`placeholder-${i}`}
|
|
175
|
+
// `border-transparent`, not no border: a real row card draws a 1px
|
|
176
|
+
// border on each side, so its outer block is the inner height PLUS 2.
|
|
177
|
+
// A pad row without one is 2px shorter than the row it stands in for
|
|
178
|
+
// — invisible per row, 54px over a 27-row remainder, which is the
|
|
179
|
+
// same shift `minRows` exists to prevent.
|
|
180
|
+
className={cn(
|
|
181
|
+
'pointer-events-none relative overflow-hidden rounded-md border border-transparent',
|
|
182
|
+
// The stated slot height belongs on the CARD, exactly as a real
|
|
183
|
+
// row carries it — a real row with a sub-row is taller than its
|
|
184
|
+
// cells, so reserving the cells' height here left every pad row
|
|
185
|
+
// short by the sub-row.
|
|
186
|
+
rowHeightClassName,
|
|
187
|
+
)}
|
|
188
|
+
aria-hidden="true"
|
|
189
|
+
>
|
|
190
|
+
<div
|
|
191
|
+
className={cn(
|
|
192
|
+
'hidden py-0 md:flex',
|
|
193
|
+
ROW_SHELL_CLASSES,
|
|
194
|
+
innerHeightClassName ?? (rowHeightClassName ? 'h-full' : ROW_HEIGHT_DESKTOP),
|
|
195
|
+
)}
|
|
196
|
+
/>
|
|
197
|
+
<div
|
|
198
|
+
className={cn(
|
|
199
|
+
'flex justify-start py-0 md:hidden',
|
|
200
|
+
ROW_SHELL_CLASSES,
|
|
201
|
+
innerHeightClassName ?? (rowHeightClassName ? 'h-full' : ROW_HEIGHT_MOBILE),
|
|
202
|
+
)}
|
|
203
|
+
/>
|
|
204
|
+
</div>
|
|
205
|
+
))}
|
|
206
|
+
</>
|
|
207
|
+
);
|
|
208
|
+
}
|
|
@@ -6,7 +6,10 @@ import { NoData } from '../no-data';
|
|
|
6
6
|
import type { TableEmptyStateProps } from './types';
|
|
7
7
|
|
|
8
8
|
/** @deprecated Use `DataTableEmpty` from `data-table` instead. */
|
|
9
|
-
export function TableEmptyState({ message, description, icon, action, className }: TableEmptyStateProps) {
|
|
9
|
+
export function TableEmptyState({ message, description, emptyState, icon, action, className }: TableEmptyStateProps) {
|
|
10
|
+
// Two vocabularies, one component. `description` is the shipped single-line
|
|
11
|
+
// prop; `emptyState` is the full NoData bag (icon, title, description,
|
|
12
|
+
// actions) and, spread last, wins over both — exactly as in `DataTableBody`.
|
|
10
13
|
return (
|
|
11
14
|
<NoData
|
|
12
15
|
icon={icon ?? <SearchIcon />}
|
|
@@ -15,6 +18,7 @@ export function TableEmptyState({ message, description, icon, action, className
|
|
|
15
18
|
buttonLabel={action?.label}
|
|
16
19
|
onButtonClick={action?.onClick}
|
|
17
20
|
className={cn('py-[var(--spacing-system-xxl)]', className)}
|
|
21
|
+
{...emptyState}
|
|
18
22
|
/>
|
|
19
23
|
);
|
|
20
24
|
}
|
|
@@ -10,50 +10,13 @@ const ROW_HEIGHT_DESKTOP = 'h-[66px] md:h-[78px]';
|
|
|
10
10
|
* A `compact` row's floor. Compact rows are content-sized (`py-2`), but every
|
|
11
11
|
* row in one table renders the same cell shapes, so pinning a minimum makes the
|
|
12
12
|
* body's height a function of the ROW COUNT alone. Hosts do NOT reserve
|
|
13
|
-
* `rows × 56` themselves any more: `skeletonRows` + `
|
|
13
|
+
* `rows × 56` themselves any more: `skeletonRows` + `minRows` hold
|
|
14
14
|
* a full page's height in every state (placeholders below), and a cell taller
|
|
15
15
|
* than this floor (avatar + two lines) wants a non-compact, fixed-height row.
|
|
16
16
|
*/
|
|
17
17
|
const COMPACT_ROW_MIN_HEIGHT = 'min-h-[56px]';
|
|
18
18
|
const ROW_HEIGHT_MOBILE = 'h-[66px]';
|
|
19
19
|
|
|
20
|
-
/**
|
|
21
|
-
* Invisible rows that hold a row's exact box (outer border included, so a
|
|
22
|
-
* placeholder is 68px / 80px like the row it stands in for — not 66 / 78; and
|
|
23
|
-
* the compact floor for compact tables, not the fixed height). The Table pads
|
|
24
|
-
* a short page with these up to `skeletonRows`, and, with
|
|
25
|
-
* `keepHeightWhenEmpty`, stacks them under the empty state too — so a full
|
|
26
|
-
* page, a short last page, the skeleton and "no results" are all the same
|
|
27
|
-
* height and the layout never jumps between them.
|
|
28
|
-
*/
|
|
29
|
-
export function TablePlaceholderRows({ rows, compact }: { rows: number; compact?: boolean }) {
|
|
30
|
-
if (rows <= 0) return null;
|
|
31
|
-
return (
|
|
32
|
-
<>
|
|
33
|
-
{Array.from({ length: rows }).map((_, index) => (
|
|
34
|
-
<div
|
|
35
|
-
key={`placeholder-${index}`}
|
|
36
|
-
className="pointer-events-none relative overflow-hidden rounded-[6px] border border-transparent"
|
|
37
|
-
aria-hidden="true"
|
|
38
|
-
>
|
|
39
|
-
<div
|
|
40
|
-
className={cn(
|
|
41
|
-
'hidden items-center gap-4 px-4 md:flex',
|
|
42
|
-
compact ? cn('py-2', COMPACT_ROW_MIN_HEIGHT) : cn('py-0', ROW_HEIGHT_DESKTOP),
|
|
43
|
-
)}
|
|
44
|
-
/>
|
|
45
|
-
<div
|
|
46
|
-
className={cn(
|
|
47
|
-
'flex items-center justify-start gap-3 px-3 md:hidden',
|
|
48
|
-
compact ? cn('py-2', COMPACT_ROW_MIN_HEIGHT) : cn('py-0', ROW_HEIGHT_MOBILE),
|
|
49
|
-
)}
|
|
50
|
-
/>
|
|
51
|
-
</div>
|
|
52
|
-
))}
|
|
53
|
-
</>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
20
|
/** @deprecated Use `DataTableSkeleton` from `data-table` instead. */
|
|
58
21
|
export function TableCardSkeleton({
|
|
59
22
|
columns,
|
|
@@ -117,9 +80,20 @@ export function TableCardSkeleton({
|
|
|
117
80
|
|
|
118
81
|
{/* Mobile Skeleton */}
|
|
119
82
|
<div
|
|
120
|
-
className={cn(
|
|
83
|
+
className={cn(
|
|
84
|
+
'flex items-center justify-start gap-3 px-3 md:hidden',
|
|
85
|
+
// Mirror the real row on mobile too: a compact row is
|
|
86
|
+
// content-sized with a floor, a normal row a fixed height.
|
|
87
|
+
// Hard-wiring ROW_HEIGHT_MOBILE made every COMPACT table jump
|
|
88
|
+
// 68px -> 58px per row when the data replaced the skeleton.
|
|
89
|
+
compact ? cn('py-2', COMPACT_ROW_MIN_HEIGHT) : cn('py-0', ROW_HEIGHT_MOBILE),
|
|
90
|
+
rowClassName,
|
|
91
|
+
)}
|
|
121
92
|
>
|
|
122
|
-
|
|
93
|
+
{/* The inner padding is the NON-compact row's; a compact row is
|
|
94
|
+
sized by its own `py-2` + floor, so adding `py-3` here made the
|
|
95
|
+
compact mobile skeleton 78px against a real row's 58. */}
|
|
96
|
+
<div className={cn('flex min-w-0 flex-1 flex-col justify-center', compact ? 'py-0' : 'py-3')}>
|
|
123
97
|
<div className="mb-2 h-4 w-3/4 rounded bg-ods-bg-surface" />
|
|
124
98
|
<div className="h-3 w-1/2 rounded bg-ods-bg-surface opacity-60" />
|
|
125
99
|
</div>
|
|
@@ -6,10 +6,11 @@ import { Chevron02RightIcon } from '../../icons-v2-generated';
|
|
|
6
6
|
import { Pagination } from '../../pagination';
|
|
7
7
|
import { Button } from '../button';
|
|
8
8
|
import { CursorPagination } from '../cursor-pagination';
|
|
9
|
+
import { PlaceholderRows, ReservedEmptyState } from '../data-table/data-table-skeleton';
|
|
9
10
|
import { TableEmptyState } from './table-empty-state';
|
|
10
11
|
import { TableHeader } from './table-header';
|
|
11
12
|
import { TableRow } from './table-row';
|
|
12
|
-
import {
|
|
13
|
+
import { COMPACT_ROW_MIN_HEIGHT, TableCardSkeleton } from './table-skeleton';
|
|
13
14
|
import type { RowAction, TableColumn, TableProps, TableRowData } from './types';
|
|
14
15
|
import { useTableMotion } from './use-table-motion';
|
|
15
16
|
|
|
@@ -102,7 +103,9 @@ export function Table<T = TableRowData>({
|
|
|
102
103
|
loading = false,
|
|
103
104
|
emptyMessage,
|
|
104
105
|
skeletonRows = 10,
|
|
105
|
-
|
|
106
|
+
minRows,
|
|
107
|
+
emptyState,
|
|
108
|
+
keepHeightWhenEmpty,
|
|
106
109
|
emptyDescription,
|
|
107
110
|
className,
|
|
108
111
|
containerClassName,
|
|
@@ -136,6 +139,14 @@ export function Table<T = TableRowData>({
|
|
|
136
139
|
// ONLY when `animateRowReorder` is set, so the default table stays motion-free.
|
|
137
140
|
const tableMotion = useTableMotion(Boolean(animateRowReorder));
|
|
138
141
|
const columnsWithActions = injectSyntheticColumns(columns, rowActions, renderRowActions, rowHref, actionsColumnWidth);
|
|
142
|
+
|
|
143
|
+
// ONE resolution of the two vocabularies, so the render below never asks
|
|
144
|
+
// which spelling the caller used. `minRows` is the current one; the two
|
|
145
|
+
// deprecated props shipped a release earlier and hosts pin exact versions,
|
|
146
|
+
// so they keep working rather than silently doing nothing.
|
|
147
|
+
const reservedRows = minRows ?? (keepHeightWhenEmpty ? skeletonRows : undefined);
|
|
148
|
+
const resolvedEmptyState =
|
|
149
|
+
emptyState ?? (emptyDescription ? { title: emptyMessage, description: emptyDescription } : undefined);
|
|
139
150
|
const getRowHref = (item: T): string | undefined => {
|
|
140
151
|
if (onRowClick || !rowHref) return undefined;
|
|
141
152
|
return rowHref(item) ?? undefined;
|
|
@@ -271,18 +282,21 @@ export function Table<T = TableRowData>({
|
|
|
271
282
|
hasChevron={Boolean(rowHref)}
|
|
272
283
|
/>
|
|
273
284
|
) : data.length === 0 ? (
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
285
|
+
/* `minRows` promises a STABLE height, and an empty table is exactly
|
|
286
|
+
when a collapsing one is most visible — the pagination and
|
|
287
|
+
everything under it jump the moment a filter matches nothing. So
|
|
288
|
+
reserve the same slots and centre the empty state over them,
|
|
289
|
+
identically to `DataTableBody`. */
|
|
290
|
+
reservedRows ? (
|
|
291
|
+
<ReservedEmptyState
|
|
292
|
+
count={reservedRows}
|
|
293
|
+
gapClassName="gap-2"
|
|
294
|
+
innerHeightClassName={compact ? COMPACT_ROW_MIN_HEIGHT : undefined}
|
|
295
|
+
>
|
|
296
|
+
<TableEmptyState message={emptyMessage} emptyState={resolvedEmptyState} />
|
|
297
|
+
</ReservedEmptyState>
|
|
284
298
|
) : (
|
|
285
|
-
<TableEmptyState message={emptyMessage}
|
|
299
|
+
<TableEmptyState message={emptyMessage} emptyState={resolvedEmptyState} />
|
|
286
300
|
)
|
|
287
301
|
) : (
|
|
288
302
|
<>
|
|
@@ -326,9 +340,14 @@ export function Table<T = TableRowData>({
|
|
|
326
340
|
)}
|
|
327
341
|
{/* Infinite scroll: sentinel element */}
|
|
328
342
|
{infiniteScroll?.hasNextPage && <div ref={sentinelRef} className="h-1" aria-hidden="true" />}
|
|
329
|
-
{/* Invisible placeholder rows to maintain consistent table height
|
|
343
|
+
{/* Invisible placeholder rows to maintain consistent table height
|
|
344
|
+
(disabled for infinite scroll). `minRows` when the host opted
|
|
345
|
+
in, else the legacy pad-to-`skeletonRows`. */}
|
|
330
346
|
{!infiniteScroll && (
|
|
331
|
-
<
|
|
347
|
+
<PlaceholderRows
|
|
348
|
+
count={Math.max(0, (reservedRows ?? skeletonRows) - data.length)}
|
|
349
|
+
innerHeightClassName={compact ? COMPACT_ROW_MIN_HEIGHT : undefined}
|
|
350
|
+
/>
|
|
332
351
|
)}
|
|
333
352
|
</>
|
|
334
353
|
)}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ElementType, ReactNode } from 'react';
|
|
2
|
+
import type { NoDataProps } from '../no-data';
|
|
2
3
|
|
|
3
4
|
/** @deprecated Use types from `data-table` instead. */
|
|
4
5
|
export type TailwindBreakpoint = 'md' | 'lg' | 'xl' | '2xl';
|
|
@@ -103,14 +104,37 @@ export interface TableProps<T = TableRowData> {
|
|
|
103
104
|
// Skeleton configuration
|
|
104
105
|
skeletonRows?: number; // Number of skeleton rows to show when loading (default: 10)
|
|
105
106
|
/**
|
|
106
|
-
* Keep the
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
107
|
+
* Keep the table height stable by padding with invisible rows when the page
|
|
108
|
+
* is short, AND by reserving the same slots (empty state centred over them)
|
|
109
|
+
* when it is empty. Typically the page size. Same name and semantics as
|
|
110
|
+
* `DataTableBodyProps.minRows` — ONE vocabulary across both tables.
|
|
111
|
+
*
|
|
112
|
+
* Unset keeps the legacy behaviour: pad to `skeletonRows`, collapse when empty.
|
|
113
|
+
*/
|
|
114
|
+
minRows?: number;
|
|
115
|
+
/** Props for the empty state (`NoData`). Overrides `emptyMessage`. Same shape
|
|
116
|
+
* as `DataTableBodyProps.emptyState`.
|
|
117
|
+
*
|
|
118
|
+
* ONE rule, so tables do not each invent their own: pass `emptyMessage` when
|
|
119
|
+
* a title is all you need, `emptyState` when you also want a description,
|
|
120
|
+
* icon or action — never both. */
|
|
121
|
+
emptyState?: NoDataProps;
|
|
122
|
+
/**
|
|
123
|
+
* @deprecated Pass `minRows` (the page size) instead — one vocabulary with
|
|
124
|
+
* `DataTable`.
|
|
125
|
+
*
|
|
126
|
+
* Kept working, not removed: it shipped in 0.0.597 and hosts pin an exact
|
|
127
|
+
* version, so deleting it would make every consumer on that release silently
|
|
128
|
+
* lose its reserved height with nothing failing loudly. Treated as
|
|
129
|
+
* `minRows = skeletonRows`, which is what every call site meant by it.
|
|
111
130
|
*/
|
|
112
131
|
keepHeightWhenEmpty?: boolean;
|
|
113
|
-
/**
|
|
132
|
+
/**
|
|
133
|
+
* @deprecated Pass `emptyState={{ title, description }}` instead.
|
|
134
|
+
*
|
|
135
|
+
* Kept working for the same reason as `keepHeightWhenEmpty`. Merged UNDER an
|
|
136
|
+
* explicit `emptyState`, so a caller passing both gets the newer one.
|
|
137
|
+
*/
|
|
114
138
|
emptyDescription?: string;
|
|
115
139
|
|
|
116
140
|
// Styling
|
|
@@ -283,6 +307,9 @@ export interface TableEmptyStateProps {
|
|
|
283
307
|
/** Second line under the title. Defaults to the generic search/filter hint
|
|
284
308
|
* only when `message` is also absent. */
|
|
285
309
|
description?: string;
|
|
310
|
+
/** Full `NoData` props — overrides `message` AND `description`. Same shape as
|
|
311
|
+
* `DataTableEmpty`. */
|
|
312
|
+
emptyState?: NoDataProps;
|
|
286
313
|
icon?: ReactNode;
|
|
287
314
|
action?: {
|
|
288
315
|
label: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- source-hash:
|
|
1
|
+
<!-- source-hash: 8291e5c1b6ca756b6bd0c1207bec4218 -->
|
|
2
2
|
Provides the React context for configuring the chat panel's API endpoints, navigation behavior, and identity settings across host and embedded deployments.
|
|
3
3
|
|
|
4
4
|
## Key Components
|
|
@@ -14,8 +14,6 @@ The core configuration shape with three top-level concerns:
|
|
|
14
14
|
- `buildListUrl` — Entity-card list URL builder
|
|
15
15
|
- `attachmentUploadUrl` / `attachmentViewUrlPrefix` — File attachment support
|
|
16
16
|
- `identityUrl` — Session capability resolution
|
|
17
|
-
- `chatHistoryUrl` (optional) — GET one conversation's server transcript; defaults to `<chatStreamUrl>/history`
|
|
18
|
-
- `chatConversationsUrl` (optional, NEVER derived) — the conversation LIST surface (`GET ?status=&cursor=&limit=&search=` → `{ dialogs, nextCursor }`, `PATCH /<id>` `{ title } | { archived }`); setting it turns on the "Current Chats" rail / archive / rename UI in Guide mode
|
|
19
17
|
- Optional: `findTicketUrl`, `ticketActionUrl`, `listEngagementsUrl`, `docsSearchUrl`, `docsResolveLinkUrl`, `emptyStateUrl`, `aiAgentConfigUrl`, `imageProxyUrlPrefix`, `ogPlaceholderUrl`, `supabaseStorageOrigin`
|
|
20
18
|
|
|
21
19
|
- **`navigation`** — Click-routing behavior:
|
|
@@ -75,18 +75,6 @@ export interface ChatRuntime {
|
|
|
75
75
|
* prefix covers it). Set explicitly only when the history route lives
|
|
76
76
|
* elsewhere. */
|
|
77
77
|
chatHistoryUrl?: string;
|
|
78
|
-
/**
|
|
79
|
-
* Conversation-list surface for the SSE/Guide chat — the server-side
|
|
80
|
-
* transcript store exposed as a dialog list:
|
|
81
|
-
* GET `<url>?status=active|archived&cursor=&limit=&search=` → `{ dialogs, nextCursor }`
|
|
82
|
-
* PATCH `<url>/<id>` with `{ title }` (rename) or `{ archived }` (archive / restore)
|
|
83
|
-
* Hub: '/api/docs/chat/conversations'. OPTIONAL and NEVER derived: unset =
|
|
84
|
-
* the Guide adapter has no dialog list and the panel keeps its single-thread
|
|
85
|
-
* UI. Set it to enable the "Current Chats" rail / archive / rename in Guide
|
|
86
|
-
* mode (the same UX openframe gets in Mingo mode). Selecting a row hydrates
|
|
87
|
-
* through `chatHistoryUrl`.
|
|
88
|
-
*/
|
|
89
|
-
chatConversationsUrl?: string;
|
|
90
78
|
/** GET RAG-search endpoint behind `<DocSearchBar>` (the in-source search
|
|
91
79
|
* bar mounted by `<DocViewer>` / `<DocsHubPage>` when `showAIChat` is on).
|
|
92
80
|
* Hub: '/api/docs/search'. OPTIONAL — falls back to the hub path so
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Narrowing primitives for untrusted hub JSON — ONE owner, shared by every
|
|
3
|
-
* client that talks to a hub route (`use-chat-history-hydration`, the
|
|
4
|
-
* conversation-list client, the NATS decoder).
|
|
5
|
-
*
|
|
6
|
-
* `unwrapEnvelope` encodes the response contract in one place. The hub's
|
|
7
|
-
* route-base `successResponse` is `NextResponse.json(data)` — a RAW body, which
|
|
8
|
-
* is the shape these clients normally see. The `{ data }` branch is defensive,
|
|
9
|
-
* for an embedder or gateway that proxies our routes inside an envelope of its
|
|
10
|
-
* own; it is not the hub's shape. (A payload whose own top-level key is `data`
|
|
11
|
-
* would be unwrapped by mistake — none of ours has one.)
|
|
12
|
-
*/
|
|
13
|
-
/** `typeof null === 'object'`, so the null check is the whole point. */
|
|
14
|
-
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
15
|
-
/** route-base `{ data }` envelope, with a raw-body fallback. */
|
|
16
|
-
export declare function unwrapEnvelope(payload: unknown): unknown;
|
|
17
|
-
//# sourceMappingURL=wire-narrow.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wire-narrow.d.ts","sourceRoot":"","sources":["../../src/chat-protocol/wire-narrow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,wEAAwE;AACxE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED,gEAAgE;AAChE,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAExD"}
|