@flamingo-stack/openframe-frontend-core 0.0.802 → 0.0.803
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-7MV23NNT.cjs → chunk-2X3N6MSR.cjs} +88 -0
- package/dist/{chunk-HRMLGU6A.cjs → chunk-6JVNUGN3.cjs} +3 -3
- package/dist/{chunk-3W2PBWD5.cjs → chunk-CACULEQS.cjs} +4 -4
- package/dist/{chunk-VMQAJIQC.cjs → chunk-H4T3YHYH.cjs} +633 -630
- package/dist/{chunk-D3IQHAGL.cjs → chunk-HEMZOHNB.cjs} +11 -11
- package/dist/{chunk-M7E7ILE5.cjs → chunk-HVWMPUXK.cjs} +6 -6
- package/dist/{chunk-EJVJDLYC.cjs → chunk-I4BODSPV.cjs} +3 -3
- package/dist/{chunk-CRVXQYUZ.cjs → chunk-IE3CPPHJ.cjs} +24 -24
- package/dist/{chunk-E56LN23H.cjs → chunk-IYWX4GOG.cjs} +35 -13
- package/dist/{chunk-75BFVMNA.cjs → chunk-JTDOBGKE.cjs} +34 -34
- package/dist/{chunk-YD344MMX.cjs → chunk-KVL3QRFX.cjs} +7 -7
- package/dist/{chunk-2BUSXRZ7.cjs → chunk-MBZIARIL.cjs} +12 -12
- package/dist/{chunk-DSIIRR3G.cjs → chunk-MII4RDO4.cjs} +57 -57
- package/dist/{chunk-A7IT7MZO.cjs → chunk-NNQXP2ZM.cjs} +6 -6
- package/dist/{chunk-YMPCACQX.cjs → chunk-QFBRQ22U.cjs} +41 -41
- package/dist/{chunk-DYDS2P5G.cjs → chunk-T7B3FJY6.cjs} +2 -2
- package/dist/{chunk-DTBIIFZG.cjs → chunk-TELXF5WD.cjs} +14 -14
- package/dist/{chunk-7E4BC3AF.cjs → chunk-TVAU56UU.cjs} +46 -39
- package/dist/{chunk-NCQJIYDN.cjs → chunk-VKSO3UYU.cjs} +22 -22
- package/dist/{chunk-A7NRENMU.cjs → chunk-XOFGPSNP.cjs} +21 -21
- package/dist/{chunk-52NI57KM.cjs → chunk-YKQGYAG5.cjs} +51 -51
- package/dist/{cloud-tenants-3SWYRUXB.cjs → cloud-tenants-GKCZSLEV.cjs} +7 -7
- package/dist/components/case-studies/index.cjs +19 -19
- package/dist/components/chat/approval-batch-message.d.ts +3 -1
- package/dist/components/chat/approval-batch-message.d.ts.map +1 -1
- package/dist/components/chat/approval-batch-message.js +88 -0
- package/dist/components/chat/chat-composer.d.ts +3 -1
- package/dist/components/chat/chat-composer.d.ts.map +1 -1
- package/dist/components/chat/chat-composer.js +2 -0
- package/dist/components/chat/chat-context-memory-bar.d.ts +7 -1
- package/dist/components/chat/chat-context-memory-bar.d.ts.map +1 -1
- package/dist/components/chat/chat-context-memory-bar.js +11 -5
- package/dist/components/chat/embeddable-chat.d.ts +3 -0
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.js +1 -0
- package/dist/components/chat/index.cjs +4 -4
- package/dist/components/contact/index.cjs +8 -8
- package/dist/components/docs/index.cjs +11 -11
- package/dist/components/embeds/index.cjs +8 -8
- package/dist/components/faq/index.cjs +9 -9
- package/dist/components/features/board/ticket-card.js +5 -5
- package/dist/components/features/index.cjs +7 -7
- package/dist/components/help-center-pages/index.cjs +69 -69
- package/dist/components/index.cjs +42 -42
- package/dist/components/layout/page-layout.d.ts +1 -1
- package/dist/components/layout/page-layout.d.ts.map +1 -1
- package/dist/components/layout/title-block.d.ts +4 -2
- package/dist/components/layout/title-block.d.ts.map +1 -1
- package/dist/components/layout/title-block.js +21 -2
- package/dist/components/meeting-scheduler/index.cjs +39 -39
- package/dist/components/navigation/index.cjs +10 -10
- package/dist/components/onboarding-guides/index.cjs +9 -9
- package/dist/components/product-demo/index.cjs +18 -18
- package/dist/components/tickets/index.cjs +12 -12
- package/dist/components/ui/data-table/data-table-body.d.ts +6 -1
- package/dist/components/ui/data-table/data-table-body.d.ts.map +1 -1
- package/dist/components/ui/data-table/data-table-body.js +3 -1
- package/dist/components/ui/device-card.d.ts +6 -1
- package/dist/components/ui/device-card.d.ts.map +1 -1
- package/dist/components/ui/device-card.js +2 -1
- package/dist/components/ui/index.cjs +7 -7
- package/dist/components/ui/page-actions.d.ts.map +1 -1
- package/dist/components/ui/page-actions.js +15 -12
- package/dist/{devices-MQILRW53.cjs → devices-XIXLFYRJ.cjs} +8 -8
- package/dist/{embeddable-chat-XZDZOHFY.cjs → embeddable-chat-SVDMLAER.cjs} +63 -62
- package/dist/index.cjs +11 -11
- package/dist/{knowledge-WQ3ABXZC.cjs → knowledge-3DKG5QG2.cjs} +8 -8
- package/dist/{logs-XRSJGB3I.cjs → logs-RIU2TTRZ.cjs} +15 -15
- package/dist/{policies-Q67ZXAGY.cjs → policies-F2ZB2J4L.cjs} +11 -11
- package/dist/{remote-session-4LYKEZSY.cjs → remote-session-GBMM5UPQ.cjs} +4 -4
- package/dist/{scripts-YX324R4S.cjs → scripts-XX5LMCRA.cjs} +14 -14
- package/dist/{software-update-PHMXJVAC.cjs → software-update-VYBM7SC6.cjs} +11 -11
- package/dist/{tickets-board-3FBVYSXR.cjs → tickets-board-5QIIA24E.cjs} +7 -7
- package/package.json +1 -1
- package/src/components/chat/approval-batch-message.tsx +109 -1
- package/src/components/chat/chat-composer.tsx +4 -0
- package/src/components/chat/chat-context-memory-bar.tsx +28 -5
- package/src/components/chat/embeddable-chat.tsx +4 -0
- package/src/components/features/board/ticket-card.tsx +7 -6
- package/src/components/layout/page-layout.tsx +1 -1
- package/src/components/layout/title-block.tsx +22 -3
- package/src/components/ui/data-table/data-table-body.tsx +9 -0
- package/src/components/ui/device-card.tsx +7 -1
- package/src/components/ui/page-actions.tsx +28 -14
|
@@ -26,12 +26,17 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
26
26
|
import { cn } from '../../utils/cn';
|
|
27
27
|
import { Ellipsis01Icon } from '../icons-v2-generated/interface/ellipsis-01-icon';
|
|
28
28
|
import { XmarkCircleIcon } from '../icons-v2-generated/signs-and-symbols/xmark-circle-icon';
|
|
29
|
+
import { TextLineSkeleton } from '../loading/unified-skeleton';
|
|
29
30
|
import { Button } from '../ui/button';
|
|
30
31
|
import { CONTEXT_ICON_CLASS, CONTEXT_LABEL_CLASS, CONTEXT_ROW_CLASS } from './context-items-list';
|
|
31
32
|
import type { ChatContextItem } from './types/context-item.types';
|
|
32
33
|
|
|
33
34
|
const itemKey = (item: { type: string; id: string }) => `${item.type}:${item.id}`;
|
|
34
35
|
|
|
36
|
+
/** The strip's box, loaded and loading. */
|
|
37
|
+
const MEMORY_STRIP_CLASS =
|
|
38
|
+
'relative flex items-center gap-[var(--spacing-system-xs)] border-b border-ods-border bg-ods-bg p-[var(--spacing-system-xs)]';
|
|
39
|
+
|
|
35
40
|
export interface ChatContextMemoryBarProps {
|
|
36
41
|
/** Remembered entities, most-recent-first. Empty → the bar renders nothing. */
|
|
37
42
|
items: ChatContextItem[];
|
|
@@ -43,6 +48,12 @@ export interface ChatContextMemoryBarProps {
|
|
|
43
48
|
resolveIcon?: (item: ChatContextItem) => ReactNode;
|
|
44
49
|
/** External disable (e.g. while a message is streaming). */
|
|
45
50
|
disabled?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* The host is reading a record it will remember (a record page whose record has not answered yet). With nothing
|
|
53
|
+
* remembered so far the strip draws its loading form at its own height, so the composer does not grow when the
|
|
54
|
+
* record lands. Ignored once there are items.
|
|
55
|
+
*/
|
|
56
|
+
pending?: boolean;
|
|
46
57
|
className?: string;
|
|
47
58
|
}
|
|
48
59
|
|
|
@@ -51,6 +62,7 @@ export function ChatContextMemoryBar({
|
|
|
51
62
|
onRemove,
|
|
52
63
|
resolveIcon,
|
|
53
64
|
disabled = false,
|
|
65
|
+
pending = false,
|
|
54
66
|
className,
|
|
55
67
|
}: ChatContextMemoryBarProps) {
|
|
56
68
|
const [open, setOpen] = useState(false);
|
|
@@ -87,17 +99,28 @@ export function ChatContextMemoryBar({
|
|
|
87
99
|
};
|
|
88
100
|
}, [open]);
|
|
89
101
|
|
|
90
|
-
if (items.length === 0) return null;
|
|
102
|
+
if (items.length === 0 && !pending) return null;
|
|
103
|
+
|
|
104
|
+
if (items.length === 0) {
|
|
105
|
+
// The loading form: the strip's own box, its count line a bar and its trigger's place kept.
|
|
106
|
+
return (
|
|
107
|
+
<div aria-hidden className={cn(MEMORY_STRIP_CLASS, className)}>
|
|
108
|
+
<p className="min-w-0 flex-1 truncate text-ods-text-secondary text-h6">
|
|
109
|
+
<TextLineSkeleton type="inherit" as="span" className="w-48 max-w-full" />
|
|
110
|
+
</p>
|
|
111
|
+
<Button variant="bare" size="icon-sm" type="button" tabIndex={-1} className="invisible shrink-0">
|
|
112
|
+
<Ellipsis01Icon size={16} />
|
|
113
|
+
</Button>
|
|
114
|
+
</div>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
91
117
|
|
|
92
118
|
return (
|
|
93
119
|
// `relative` anchors the popover to this strip; `bottom-full` floats it
|
|
94
120
|
// above, matching the context picker's placement over the input.
|
|
95
121
|
<div
|
|
96
122
|
ref={rootRef}
|
|
97
|
-
className={cn(
|
|
98
|
-
'relative flex items-center gap-[var(--spacing-system-xs)] border-b border-ods-border bg-ods-bg p-[var(--spacing-system-xs)]',
|
|
99
|
-
className,
|
|
100
|
-
)}
|
|
123
|
+
className={cn(MEMORY_STRIP_CLASS, className)}
|
|
101
124
|
onKeyDown={e => {
|
|
102
125
|
if (e.key === 'Escape' && open) {
|
|
103
126
|
e.preventDefault();
|
|
@@ -488,6 +488,9 @@ export interface EmbeddableChatProps {
|
|
|
488
488
|
contextMemory?: {
|
|
489
489
|
items: ChatContextItem[];
|
|
490
490
|
onRemove?: (item: ChatContextItem) => void;
|
|
491
|
+
/** A record the host will remember is still being read (a record page loading): the empty strip draws its
|
|
492
|
+
* loading form, so the composer does not grow when the record lands. */
|
|
493
|
+
pending?: boolean;
|
|
491
494
|
};
|
|
492
495
|
/**
|
|
493
496
|
* Host content pinned between the thread and the composer: the thread
|
|
@@ -3181,6 +3184,7 @@ function EmbeddableChatInner({
|
|
|
3181
3184
|
onRemoveContextItem={removeContextItem}
|
|
3182
3185
|
contextMemoryItems={contextMemory?.items}
|
|
3183
3186
|
onRemoveContextMemoryItem={contextMemory?.onRemove}
|
|
3187
|
+
contextMemoryPending={contextMemory?.pending}
|
|
3184
3188
|
contextPickerOpen={contextPickerOpen}
|
|
3185
3189
|
onOpenContextPicker={openContextPicker}
|
|
3186
3190
|
onCloseContextPicker={closeContextPicker}
|
|
@@ -619,8 +619,9 @@ function TicketTagRow({ tags }: { tags: string[] }) {
|
|
|
619
619
|
|
|
620
620
|
/**
|
|
621
621
|
* A board card while it is read: the card's own shell, its title and device lines as bars of their own type steps,
|
|
622
|
-
* the priority and assignee marks,
|
|
623
|
-
*
|
|
622
|
+
* the priority and assignee marks, the number and time line and the activity line ("No activity for 2 days"), in the
|
|
623
|
+
* body's order. A typical card has no tags (none of 70 measured tickets had one) and does have an activity line (every
|
|
624
|
+
* one did). The board card draws it itself (`ticket={null}` or a loading scope).
|
|
624
625
|
*/
|
|
625
626
|
function TicketCardSkeleton({ className, ...props }: { className?: string; [key: `data-${string}`]: unknown }) {
|
|
626
627
|
return (
|
|
@@ -638,11 +639,11 @@ function TicketCardSkeleton({ className, ...props }: { className?: string; [key:
|
|
|
638
639
|
<UnifiedSkeleton className="size-8 rounded-full" />
|
|
639
640
|
</div>
|
|
640
641
|
</div>
|
|
641
|
-
<div className="flex h-8 items-start gap-[var(--spacing-system-xxs)]">
|
|
642
|
-
<Tag loading label="" />
|
|
643
|
-
<Tag loading label="" />
|
|
644
|
-
</div>
|
|
645
642
|
<TextLineSkeleton type="h6" className={cn(TICKET_CARD_META_CLASS, 'w-1/3')} />
|
|
643
|
+
<div className="flex items-center gap-[var(--spacing-system-xxs)] text-h6">
|
|
644
|
+
<UnifiedSkeleton className="size-4 shrink-0 rounded-sm" />
|
|
645
|
+
<TextLineSkeleton type="inherit" className="w-1/2" />
|
|
646
|
+
</div>
|
|
646
647
|
</div>
|
|
647
648
|
);
|
|
648
649
|
}
|
|
@@ -85,7 +85,7 @@ export interface PageLayoutProps {
|
|
|
85
85
|
* ellipsis clamp (forwarded to `TitleBlock`). For content detail pages whose h1 is CMS
|
|
86
86
|
* data of arbitrary length. Additive + default-preserving. */
|
|
87
87
|
titleWrap?: boolean;
|
|
88
|
-
/**
|
|
88
|
+
/** The loading title's lines per breakpoint (forwarded to `TitleBlock`). */
|
|
89
89
|
titleSkeletonLines?: TextLinesByBreakpoint;
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -169,8 +169,10 @@ export interface TitleBlockProps {
|
|
|
169
169
|
* Additive + default-preserving: omit it and every existing caller is byte-identical. */
|
|
170
170
|
titleWrap?: boolean;
|
|
171
171
|
/**
|
|
172
|
-
*
|
|
173
|
-
*
|
|
172
|
+
* The lines a typical title of the page takes per breakpoint, drawn by the loading title (a record's title is read; a
|
|
173
|
+
* long one growing past them is a settle). Absent: one bar. Without `titleWrap` the loaded title wraps where the
|
|
174
|
+
* window is narrow, so the lines follow the viewport step (`phone` below `md`): a caller states `md: 1, lg: 1` and
|
|
175
|
+
* the phone count it measured.
|
|
174
176
|
*/
|
|
175
177
|
titleSkeletonLines?: TextLinesByBreakpoint;
|
|
176
178
|
}
|
|
@@ -247,8 +249,25 @@ export function TitleBlock({
|
|
|
247
249
|
subtitleLoading ? null : subtitle,
|
|
248
250
|
);
|
|
249
251
|
const titleNode =
|
|
250
|
-
titleLoading &&
|
|
252
|
+
titleLoading && titleSkeletonLines && titleWrap ? (
|
|
251
253
|
<TextLinesByBreakpointSkeleton as="span" lines={titleSkeletonLines} />
|
|
254
|
+
) : titleLoading && titleSkeletonLines ? (
|
|
255
|
+
// An unclamped title wraps where the WINDOW is narrow (a phone), not where a docked panel narrows the content:
|
|
256
|
+
// its loading lines follow the viewport step, the phone count below `md` and the `md` count above it.
|
|
257
|
+
<>
|
|
258
|
+
<span className="contents md:hidden">
|
|
259
|
+
<TextLinesByBreakpointSkeleton
|
|
260
|
+
as="span"
|
|
261
|
+
lines={{ phone: titleSkeletonLines.phone, md: titleSkeletonLines.phone, lg: titleSkeletonLines.phone }}
|
|
262
|
+
/>
|
|
263
|
+
</span>
|
|
264
|
+
<span className="hidden md:contents">
|
|
265
|
+
<TextLinesByBreakpointSkeleton
|
|
266
|
+
as="span"
|
|
267
|
+
lines={{ phone: titleSkeletonLines.md, md: titleSkeletonLines.md, lg: titleSkeletonLines.lg }}
|
|
268
|
+
/>
|
|
269
|
+
</span>
|
|
270
|
+
</>
|
|
252
271
|
) : titleLoading ? (
|
|
253
272
|
<UnifiedSkeleton
|
|
254
273
|
as="span"
|
|
@@ -98,6 +98,11 @@ export interface DataTableBodyProps<T = unknown> {
|
|
|
98
98
|
* Interactive content inside must carry `data-no-row-click`.
|
|
99
99
|
*/
|
|
100
100
|
renderSubRow?: (item: T) => ReactNode;
|
|
101
|
+
/**
|
|
102
|
+
* While loading (`loadingCells`), call `renderSubRow` for each placeholder row too, so a host whose typical row has
|
|
103
|
+
* a sub-row draws its loading form below every loading row. Off by default: a host's sub-row may read the row.
|
|
104
|
+
*/
|
|
105
|
+
loadingSubRows?: boolean;
|
|
101
106
|
}
|
|
102
107
|
|
|
103
108
|
/** Server snapshot: no page is loading during a server render. */
|
|
@@ -124,6 +129,7 @@ export function DataTableBody<T = unknown>({
|
|
|
124
129
|
rowHref,
|
|
125
130
|
minRows,
|
|
126
131
|
renderSubRow,
|
|
132
|
+
loadingSubRows = false,
|
|
127
133
|
}: DataTableBodyProps<T>) {
|
|
128
134
|
const table = useDataTableContext<T>();
|
|
129
135
|
const skeletonRows =
|
|
@@ -161,6 +167,9 @@ export function DataTableBody<T = unknown>({
|
|
|
161
167
|
compact={compact}
|
|
162
168
|
rowHeightClassName={rowHeightClassName}
|
|
163
169
|
className={typeof rowClassName === 'function' ? rowClassName(row.original, index) : rowClassName}
|
|
170
|
+
// Opted in (`loadingSubRows`): a loading row carries what its host draws below a typical row (an approval
|
|
171
|
+
// block), in its loading form.
|
|
172
|
+
subRow={loadingSubRows ? renderSubRow?.(row.original) : undefined}
|
|
164
173
|
data-loading-item
|
|
165
174
|
/>
|
|
166
175
|
))}
|
|
@@ -77,6 +77,11 @@ export interface DeviceCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
77
77
|
* scope does the same. The card's `data-*` markers (`data-loading-item`) ride on its root in both forms.
|
|
78
78
|
*/
|
|
79
79
|
loading?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Whether the card lists the device's tags (default true). A card that never lists them (the device a log or a
|
|
82
|
+
* ticket names) passes false, so its loading form draws no tags row either.
|
|
83
|
+
*/
|
|
84
|
+
showTags?: boolean;
|
|
80
85
|
}
|
|
81
86
|
|
|
82
87
|
export function DeviceCard({
|
|
@@ -87,6 +92,7 @@ export function DeviceCard({
|
|
|
87
92
|
statusTag,
|
|
88
93
|
onDeviceClick,
|
|
89
94
|
loading: loadingProp,
|
|
95
|
+
showTags = true,
|
|
90
96
|
className,
|
|
91
97
|
...props
|
|
92
98
|
}: DeviceCardProps) {
|
|
@@ -216,7 +222,7 @@ export function DeviceCard({
|
|
|
216
222
|
|
|
217
223
|
{/* Tags section: the card sits in a grid's first screen, so its row is drawn while loading too (one tag, a
|
|
218
224
|
typical device's), never left to land later. A device with no tags draws no row once loaded. */}
|
|
219
|
-
{loading ? (
|
|
225
|
+
{!showTags ? null : loading ? (
|
|
220
226
|
<div className={DEVICE_CARD_TAGS_ROW_CLASS}>
|
|
221
227
|
<Tag loading label="" variant="outline" data-loading-item />
|
|
222
228
|
</div>
|
|
@@ -279,8 +279,9 @@ const ACTIONS_GAP = 'gap-[var(--spacing-system-xs)]';
|
|
|
279
279
|
* and an inert control promises nothing and cannot act on a wrong assumption before the data lands. The "…" trigger
|
|
280
280
|
* is drawn the same way (`ActionsMenuDropdown loading`).
|
|
281
281
|
*
|
|
282
|
-
* An empty list is the one placeholder
|
|
283
|
-
* be drawn.
|
|
282
|
+
* An empty list is the one placeholder, and only on `loading`: it means the action set is unknown, not known-empty, so
|
|
283
|
+
* nothing real can be drawn. A loading scope alone does not: a page that knows its actions while it loads (a list
|
|
284
|
+
* page's header) draws them as passed, an empty set as nothing, exactly as it settles. Its shape is what an empty header settles into for the variant: `icon-buttons` and `menu-primary` the
|
|
284
285
|
* square "…" trigger (`icon`), `primary-buttons` a labelled button (`label`).
|
|
285
286
|
*/
|
|
286
287
|
function UnknownActionSkeleton({ shape, fullWidth }: { shape: 'icon' | 'label'; fullWidth?: boolean }) {
|
|
@@ -296,7 +297,8 @@ export function PageActions({
|
|
|
296
297
|
className,
|
|
297
298
|
loading: loadingProp,
|
|
298
299
|
}: PageActionsProps) {
|
|
299
|
-
|
|
300
|
+
// Each variant reads the loading scope itself; it gets the caller's own flag, which alone says the action set is
|
|
301
|
+
// not known yet.
|
|
300
302
|
if (variant === 'icon-buttons') {
|
|
301
303
|
return (
|
|
302
304
|
<IconButtonsVariant
|
|
@@ -304,7 +306,7 @@ export function PageActions({
|
|
|
304
306
|
menuActions={menuActions}
|
|
305
307
|
selector={selector}
|
|
306
308
|
className={className}
|
|
307
|
-
loading={
|
|
309
|
+
loading={loadingProp}
|
|
308
310
|
/>
|
|
309
311
|
);
|
|
310
312
|
}
|
|
@@ -316,12 +318,12 @@ export function PageActions({
|
|
|
316
318
|
menuActions={menuActions || []}
|
|
317
319
|
selector={selector}
|
|
318
320
|
className={className}
|
|
319
|
-
loading={
|
|
321
|
+
loading={loadingProp}
|
|
320
322
|
/>
|
|
321
323
|
);
|
|
322
324
|
}
|
|
323
325
|
|
|
324
|
-
return <PrimaryButtonsVariant actions={actions} className={className} loading={
|
|
326
|
+
return <PrimaryButtonsVariant actions={actions} className={className} loading={loadingProp} />;
|
|
325
327
|
}
|
|
326
328
|
|
|
327
329
|
function IconButtonsVariant({
|
|
@@ -338,6 +340,9 @@ function IconButtonsVariant({
|
|
|
338
340
|
loading?: boolean;
|
|
339
341
|
}) {
|
|
340
342
|
const loading = useLoadingScope() || loadingProp;
|
|
343
|
+
// The placeholder for an action set nobody knows yet: only when the caller says so (`loading`), never because a
|
|
344
|
+
// loading scope is on (a page that knows its actions draws them, an empty set included).
|
|
345
|
+
const unknownSet = !!loadingProp;
|
|
341
346
|
const desktopActions = actions.filter(a => !a.showOnlyMobile);
|
|
342
347
|
const hasMenuActions = !!menuActions && menuActions.some(g => g.items.length > 0);
|
|
343
348
|
|
|
@@ -357,7 +362,7 @@ function IconButtonsVariant({
|
|
|
357
362
|
<React.Fragment key={actionKey(action, idx)}>{renderActionButton(action, { inert: loading })}</React.Fragment>
|
|
358
363
|
))}
|
|
359
364
|
{/* An unknown set with no menu: the trigger's square. With a menu, the trigger already is it. */}
|
|
360
|
-
{
|
|
365
|
+
{unknownSet && desktopActions.length === 0 && !hasMenuActions && <UnknownActionSkeleton shape="icon" />}
|
|
361
366
|
{hasMenuActions && <ActionsMenuDropdown groups={menuActions} loading={loading} />}
|
|
362
367
|
</div>
|
|
363
368
|
|
|
@@ -367,7 +372,7 @@ function IconButtonsVariant({
|
|
|
367
372
|
renderActionButton(singleAction, { iconOnly: true, inert: loading })
|
|
368
373
|
) : hasMobileMenuItems ? (
|
|
369
374
|
<ActionsMenuDropdown groups={mobileMenuGroups} loading={loading} />
|
|
370
|
-
) :
|
|
375
|
+
) : unknownSet ? (
|
|
371
376
|
<UnknownActionSkeleton shape="icon" />
|
|
372
377
|
) : null}
|
|
373
378
|
</div>
|
|
@@ -395,6 +400,9 @@ function PrimaryButtonsVariant({
|
|
|
395
400
|
loading?: boolean;
|
|
396
401
|
}) {
|
|
397
402
|
const loading = useLoadingScope() || loadingProp;
|
|
403
|
+
// The placeholder for an action set nobody knows yet: only when the caller says so (`loading`), never because a
|
|
404
|
+
// loading scope is on (a page that knows its actions draws them, an empty set included).
|
|
405
|
+
const unknownSet = !!loadingProp;
|
|
398
406
|
// Sort: outline first, accent last (rightmost on desktop).
|
|
399
407
|
const sortedActions = [...actions].sort((a, b) => {
|
|
400
408
|
if (a.variant === 'accent' && b.variant !== 'accent') return 1;
|
|
@@ -413,15 +421,15 @@ function PrimaryButtonsVariant({
|
|
|
413
421
|
</React.Fragment>
|
|
414
422
|
))}
|
|
415
423
|
{/* No overflow trigger in this variant: an unknown action set settles into a labelled button. */}
|
|
416
|
-
{
|
|
424
|
+
{unknownSet && desktopActions.length === 0 && <UnknownActionSkeleton shape="label" />}
|
|
417
425
|
</div>
|
|
418
426
|
|
|
419
427
|
<div className={cn('hidden items-center md:content-max-md:flex', ACTIONS_GAP, className)}>
|
|
420
428
|
<CompactPrimaryActions actions={desktopActions} loading={loading} />
|
|
421
|
-
{
|
|
429
|
+
{unknownSet && desktopActions.length === 0 && <UnknownActionSkeleton shape="icon" />}
|
|
422
430
|
</div>
|
|
423
431
|
|
|
424
|
-
<MobileBottomActions actions={sortedActions} loading={
|
|
432
|
+
<MobileBottomActions actions={sortedActions} loading={loadingProp} />
|
|
425
433
|
</>
|
|
426
434
|
);
|
|
427
435
|
}
|
|
@@ -444,6 +452,9 @@ function MenuPrimaryVariant({
|
|
|
444
452
|
loading?: boolean;
|
|
445
453
|
}) {
|
|
446
454
|
const loading = useLoadingScope() || loadingProp;
|
|
455
|
+
// The placeholder for an action set nobody knows yet: only when the caller says so (`loading`), never because a
|
|
456
|
+
// loading scope is on (a page that knows its actions draws them, an empty set included).
|
|
457
|
+
const unknownSet = !!loadingProp;
|
|
447
458
|
const desktopActions = actions.filter(a => !a.showOnlyMobile);
|
|
448
459
|
const hasMenuActions = menuActions.some(g => g.items.length > 0);
|
|
449
460
|
|
|
@@ -461,7 +472,7 @@ function MenuPrimaryVariant({
|
|
|
461
472
|
</React.Fragment>
|
|
462
473
|
))}
|
|
463
474
|
{/* An unknown set with no menu: the trigger's square. With a menu, the trigger already is it. */}
|
|
464
|
-
{
|
|
475
|
+
{unknownSet && desktopActions.length === 0 && !hasMenuActions && <UnknownActionSkeleton shape="icon" />}
|
|
465
476
|
</div>
|
|
466
477
|
|
|
467
478
|
<div className={cn('flex content-md:hidden', className)}>
|
|
@@ -470,7 +481,7 @@ function MenuPrimaryVariant({
|
|
|
470
481
|
// title row has no room for it, and hiding it entirely (what
|
|
471
482
|
// `icon-buttons` does) would leave no way to switch views at all.
|
|
472
483
|
<ActionsMenuDropdown groups={mobileMenuGroups} header={selector} loading={loading} />
|
|
473
|
-
) :
|
|
484
|
+
) : unknownSet ? (
|
|
474
485
|
<UnknownActionSkeleton shape="icon" />
|
|
475
486
|
) : null}
|
|
476
487
|
</div>
|
|
@@ -502,6 +513,9 @@ function CompactPrimaryActions({ actions, loading: loadingProp }: { actions: Pag
|
|
|
502
513
|
|
|
503
514
|
function MobileBottomActions({ actions, loading: loadingProp }: { actions: PageActionButton[]; loading?: boolean }) {
|
|
504
515
|
const loading = useLoadingScope() || loadingProp;
|
|
516
|
+
// The placeholder for an action set nobody knows yet: only when the caller says so (`loading`), never because a
|
|
517
|
+
// loading scope is on (a page that knows its actions draws them, an empty set included).
|
|
518
|
+
const unknownSet = !!loadingProp;
|
|
505
519
|
return (
|
|
506
520
|
<div
|
|
507
521
|
className={cn(
|
|
@@ -519,7 +533,7 @@ function MobileBottomActions({ actions, loading: loadingProp }: { actions: PageA
|
|
|
519
533
|
{renderActionButton(action, { fullWidth: !!action.label, inert: loading })}
|
|
520
534
|
</React.Fragment>
|
|
521
535
|
))}
|
|
522
|
-
{
|
|
536
|
+
{unknownSet && actions.length === 0 && <UnknownActionSkeleton shape="label" fullWidth />}
|
|
523
537
|
</div>
|
|
524
538
|
);
|
|
525
539
|
}
|