@dtducas/wh-forge-viewer 3.0.0-beta.1 → 3.0.0-beta.11
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/index.d.ts +176 -6
- package/dist/index.esm.js +10566 -5548
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +10568 -5546
- package/dist/index.js.map +1 -1
- package/package.json +11 -3
package/dist/index.d.ts
CHANGED
|
@@ -500,6 +500,26 @@ declare module '@dtducas/wh-forge-viewer' {
|
|
|
500
500
|
*/
|
|
501
501
|
export function ViewerForgePDF(props: IViewerForgePDFProps): JSX.Element;
|
|
502
502
|
|
|
503
|
+
/**
|
|
504
|
+
* MarkupItemRow — renders a single markup list row (thumbnail + per-tool icon +
|
|
505
|
+
* label + author + date + publish status), identical to the rows in the Markups
|
|
506
|
+
* panel. Exported for reuse in external company-grouped filter panels.
|
|
507
|
+
*/
|
|
508
|
+
export function MarkupItemRow(props: {
|
|
509
|
+
item: {
|
|
510
|
+
id: string;
|
|
511
|
+
kind: string;
|
|
512
|
+
title?: string;
|
|
513
|
+
authorName?: string;
|
|
514
|
+
authorCompany?: string;
|
|
515
|
+
createdAt?: number;
|
|
516
|
+
isPublished?: boolean;
|
|
517
|
+
color?: string;
|
|
518
|
+
};
|
|
519
|
+
onClick?: (id: string) => void;
|
|
520
|
+
isSelected?: boolean;
|
|
521
|
+
}): JSX.Element;
|
|
522
|
+
|
|
503
523
|
// ========================================
|
|
504
524
|
// EventBus for page change events
|
|
505
525
|
// ========================================
|
|
@@ -582,8 +602,7 @@ declare module '@dtducas/wh-forge-viewer' {
|
|
|
582
602
|
*/
|
|
583
603
|
export type OnLocalCursorMoveCallback = (payload: {
|
|
584
604
|
position: { x: number; y: number };
|
|
585
|
-
|
|
586
|
-
timestamp: number;
|
|
605
|
+
coordSystem: 'markup' | 'percent';
|
|
587
606
|
}) => void;
|
|
588
607
|
|
|
589
608
|
/**
|
|
@@ -738,6 +757,10 @@ declare module '@dtducas/wh-forge-viewer' {
|
|
|
738
757
|
pan?: boolean;
|
|
739
758
|
docBrowser?: boolean;
|
|
740
759
|
download?: boolean;
|
|
760
|
+
/** "Download My Comments" (export own markup) button */
|
|
761
|
+
export?: boolean;
|
|
762
|
+
/** "Download All Comments" (export all consultants' markup) button */
|
|
763
|
+
exportAll?: boolean;
|
|
741
764
|
markup?: boolean;
|
|
742
765
|
pagination?: boolean;
|
|
743
766
|
}
|
|
@@ -1343,6 +1366,45 @@ declare module '@dtducas/wh-forge-viewer' {
|
|
|
1343
1366
|
propertyDatabase: boolean;
|
|
1344
1367
|
}
|
|
1345
1368
|
|
|
1369
|
+
// ── Comments Panel ──────────────────────────────────────────────────────
|
|
1370
|
+
|
|
1371
|
+
export interface ICommentReply {
|
|
1372
|
+
id: string;
|
|
1373
|
+
text: string;
|
|
1374
|
+
authorName?: string;
|
|
1375
|
+
createdAt: number;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
/** Single comment item displayed in the CommentsPanel */
|
|
1379
|
+
export interface ICommentItem {
|
|
1380
|
+
id: string;
|
|
1381
|
+
text: string;
|
|
1382
|
+
authorName?: string;
|
|
1383
|
+
authorCompany?: string;
|
|
1384
|
+
createdAt: number;
|
|
1385
|
+
status?: 'open' | 'resolved';
|
|
1386
|
+
/** Zero-based page/sheet index this comment is linked to */
|
|
1387
|
+
pageIndex?: number;
|
|
1388
|
+
replies?: ICommentReply[];
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
export interface ICommentsPanelProps {
|
|
1392
|
+
items: ICommentItem[];
|
|
1393
|
+
onClose: () => void;
|
|
1394
|
+
onItemClick?: (id: string) => void;
|
|
1395
|
+
selectedItemId?: string;
|
|
1396
|
+
/** If provided, shows a text input at the bottom for creating new comments */
|
|
1397
|
+
onAddComment?: (text: string) => void;
|
|
1398
|
+
/** If provided, shows a Reply button on each thread */
|
|
1399
|
+
onReplyToComment?: (commentId: string, text: string) => void;
|
|
1400
|
+
/** If provided, shows a Resolve button on open threads */
|
|
1401
|
+
onResolveComment?: (commentId: string) => void;
|
|
1402
|
+
/** If provided, shows a Reopen button on resolved threads */
|
|
1403
|
+
onReopenComment?: (commentId: string) => void;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
export function CommentsPanel(props: ICommentsPanelProps): JSX.Element;
|
|
1407
|
+
|
|
1346
1408
|
// ── Markups Panel ─────────────────────────────────────────────────────────
|
|
1347
1409
|
|
|
1348
1410
|
/** Single markup item displayed in the MarkupsPanel */
|
|
@@ -1433,11 +1495,17 @@ declare module '@dtducas/wh-forge-viewer' {
|
|
|
1433
1495
|
export interface ICollabAdapter {
|
|
1434
1496
|
broadcastPatches(patches: ICanvasPatch[], room: ICollabRoom): Promise<void>;
|
|
1435
1497
|
fetchScene(room: ICollabRoom): Promise<IFetchSceneResult>;
|
|
1436
|
-
onRemotePatches(
|
|
1498
|
+
onRemotePatches(
|
|
1499
|
+
room: ICollabRoom,
|
|
1500
|
+
cb: (patches: ICanvasPatch[]) => void,
|
|
1501
|
+
): () => void;
|
|
1437
1502
|
joinRoom(room: ICollabRoom): void | Promise<void>;
|
|
1438
1503
|
leaveRoom(room: ICollabRoom): void | Promise<void>;
|
|
1439
1504
|
/** Optional: subscribe to server-initiated full-scene replacements (e.g. version restore). */
|
|
1440
|
-
onRemoteSceneReplace?(
|
|
1505
|
+
onRemoteSceneReplace?(
|
|
1506
|
+
room: ICollabRoom,
|
|
1507
|
+
cb: (scene: ICanvasMarkupSceneV2) => void,
|
|
1508
|
+
): () => void;
|
|
1441
1509
|
/**
|
|
1442
1510
|
* Optional: drain the durable outbox for a room.
|
|
1443
1511
|
* Called after bootstrap to replay unACKed patches from a previous session.
|
|
@@ -1447,7 +1515,12 @@ declare module '@dtducas/wh-forge-viewer' {
|
|
|
1447
1515
|
onReconnect?(cb: () => void): () => void;
|
|
1448
1516
|
}
|
|
1449
1517
|
|
|
1450
|
-
export type TCollabStatus =
|
|
1518
|
+
export type TCollabStatus =
|
|
1519
|
+
| 'idle'
|
|
1520
|
+
| 'joining'
|
|
1521
|
+
| 'connected'
|
|
1522
|
+
| 'disconnected'
|
|
1523
|
+
| 'error';
|
|
1451
1524
|
|
|
1452
1525
|
export interface ICollabStatusEvent {
|
|
1453
1526
|
status: TCollabStatus;
|
|
@@ -1506,6 +1579,24 @@ declare module '@dtducas/wh-forge-viewer' {
|
|
|
1506
1579
|
markupItems?: IMarkupPanelItem[];
|
|
1507
1580
|
/** Called when user clicks a markup row in the Markups panel. */
|
|
1508
1581
|
onMarkupItemClick?: (id: string) => void;
|
|
1582
|
+
/**
|
|
1583
|
+
* Comment items to display in the Comments side panel.
|
|
1584
|
+
* Build from your server-side comment thread data.
|
|
1585
|
+
* @default []
|
|
1586
|
+
*/
|
|
1587
|
+
commentItems?: ICommentItem[];
|
|
1588
|
+
/** Called when user clicks a comment row in the Comments panel. */
|
|
1589
|
+
onCommentItemClick?: (id: string) => void;
|
|
1590
|
+
/** ID of the currently selected comment — highlights the row in the panel. */
|
|
1591
|
+
selectedCommentId?: string;
|
|
1592
|
+
/** If provided, shows a text input at the bottom of the Comments panel for creating new comments. */
|
|
1593
|
+
onAddComment?: (text: string) => void;
|
|
1594
|
+
/** If provided, shows a Reply button on each comment thread. */
|
|
1595
|
+
onReplyToComment?: (commentId: string, text: string) => void;
|
|
1596
|
+
/** If provided, shows a Resolve button on open comment threads. */
|
|
1597
|
+
onResolveComment?: (commentId: string) => void;
|
|
1598
|
+
/** If provided, shows a Reopen button on resolved comment threads. */
|
|
1599
|
+
onReopenComment?: (commentId: string) => void;
|
|
1509
1600
|
/**
|
|
1510
1601
|
* Called when a shape is selected or deselected on the canvas.
|
|
1511
1602
|
* Receives the shape `entityId` on selection, or `null` on deselect / toolbar close.
|
|
@@ -1607,7 +1698,10 @@ declare module '@dtducas/wh-forge-viewer' {
|
|
|
1607
1698
|
* }
|
|
1608
1699
|
* ```
|
|
1609
1700
|
*/
|
|
1610
|
-
getExportViewablePages?: () => Array<{
|
|
1701
|
+
getExportViewablePages?: () => Array<{
|
|
1702
|
+
pageIndex: number;
|
|
1703
|
+
viewableGuid: string;
|
|
1704
|
+
}>;
|
|
1611
1705
|
|
|
1612
1706
|
/**
|
|
1613
1707
|
* Async callback to fetch canvas-scene/2 data for ALL pages from the server
|
|
@@ -1633,6 +1727,7 @@ declare module '@dtducas/wh-forge-viewer' {
|
|
|
1633
1727
|
*/
|
|
1634
1728
|
fetchAllScenesForExport?: (
|
|
1635
1729
|
viewableGuids: string[],
|
|
1730
|
+
scope?: 'individual' | 'consolidated',
|
|
1636
1731
|
) => Promise<Record<string, ICanvasMarkupSceneV2 | null>>;
|
|
1637
1732
|
|
|
1638
1733
|
/**
|
|
@@ -1671,6 +1766,81 @@ declare module '@dtducas/wh-forge-viewer' {
|
|
|
1671
1766
|
* ```
|
|
1672
1767
|
*/
|
|
1673
1768
|
exportFontConfig?: IExportFontConfig;
|
|
1769
|
+
|
|
1770
|
+
// ── Submit Reply (consultant-reply mode) ───────────────────────────────
|
|
1771
|
+
/**
|
|
1772
|
+
* When provided, shows the "Submit Reply" button in the sidebar and renders
|
|
1773
|
+
* the SubmitPanel. Pass null/undefined to hide the panel entirely.
|
|
1774
|
+
*/
|
|
1775
|
+
submitConfig?: ISubmitConfig;
|
|
1776
|
+
/** When true, the submit panel is read-only (reply already submitted). */
|
|
1777
|
+
submitLocked?: boolean;
|
|
1778
|
+
/** When true, shows "Replaced PDF" badge in the submit panel. */
|
|
1779
|
+
submitReplaced?: boolean;
|
|
1780
|
+
/** Pre-loaded status value from an existing draft. */
|
|
1781
|
+
submitInitialStatus?: string | null;
|
|
1782
|
+
/** Pre-loaded comment from an existing draft. */
|
|
1783
|
+
submitInitialComment?: string;
|
|
1784
|
+
/** Full audit log entries for the submit panel history section. */
|
|
1785
|
+
submitHistory?: IMarkupReplyHistoryEntry[];
|
|
1786
|
+
/** Whether a save is currently in progress. */
|
|
1787
|
+
submitIsSaving?: boolean;
|
|
1788
|
+
/** Error message from the last save attempt. */
|
|
1789
|
+
submitSaveError?: string | null;
|
|
1790
|
+
/** When true, triggers the "Saved ✓" flash on the save button. */
|
|
1791
|
+
submitSavedFlash?: boolean;
|
|
1792
|
+
/** Called with { status, comment, hasMarkup } when user clicks Save Draft. */
|
|
1793
|
+
onSubmitSave?: (payload: ISubmitSavePayload) => void;
|
|
1794
|
+
/**
|
|
1795
|
+
* Async function to check whether markup shapes exist for the given viewableGUID.
|
|
1796
|
+
* Called on save. If omitted, hasMarkup defaults to false.
|
|
1797
|
+
*/
|
|
1798
|
+
checkSubmitHasMarkup?: (viewableGUID: string) => Promise<boolean>;
|
|
1799
|
+
/**
|
|
1800
|
+
* Which sidebar panel to open on initial render.
|
|
1801
|
+
* Pass 'submit' to open the Submit Reply panel by default.
|
|
1802
|
+
*/
|
|
1803
|
+
defaultActiveSidebarPanel?:
|
|
1804
|
+
| 'sheets'
|
|
1805
|
+
| 'markup'
|
|
1806
|
+
| 'comments'
|
|
1807
|
+
| 'submit'
|
|
1808
|
+
| null;
|
|
1809
|
+
/**
|
|
1810
|
+
* Optional React content rendered at the top of the Markups panel, below the controls bar.
|
|
1811
|
+
* Use to inject per-user/company visibility filter UI into the panel.
|
|
1812
|
+
*/
|
|
1813
|
+
markupsPanelExtraContent?: React.ReactNode;
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
/** One entry in the audit log for a markup reply. */
|
|
1817
|
+
export interface IMarkupReplyHistoryEntry {
|
|
1818
|
+
status: string | null;
|
|
1819
|
+
comment: string;
|
|
1820
|
+
hasMarkup: boolean;
|
|
1821
|
+
savedAt: string;
|
|
1822
|
+
savedBy: string;
|
|
1823
|
+
savedByName?: string;
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
/** Configuration for the consultant reply Submit panel. */
|
|
1827
|
+
export interface ISubmitConfig {
|
|
1828
|
+
drawingItemId: string;
|
|
1829
|
+
rfaRef: string;
|
|
1830
|
+
rev: string;
|
|
1831
|
+
companyId: string;
|
|
1832
|
+
companyShortName: string;
|
|
1833
|
+
s3KeyPdf: string;
|
|
1834
|
+
statusOptions: string[];
|
|
1835
|
+
/** Map of status label → hex color for the custom dropdown. */
|
|
1836
|
+
statusColors?: Record<string, string>;
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
/** Payload passed to onSubmitSave when user saves a draft reply. */
|
|
1840
|
+
export interface ISubmitSavePayload {
|
|
1841
|
+
status: string | null;
|
|
1842
|
+
comment: string;
|
|
1843
|
+
hasMarkup: boolean;
|
|
1674
1844
|
}
|
|
1675
1845
|
|
|
1676
1846
|
/**
|