@flamingo-stack/openframe-frontend-core 0.0.565-1861.5100.1 → 0.0.565
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.map +1 -1
- package/dist/chat-protocol/index.js.map +1 -1
- package/dist/{chunk-TA5P2M7V.cjs → chunk-26LZFWY6.cjs} +732 -812
- package/dist/chunk-26LZFWY6.cjs.map +1 -0
- package/dist/{chunk-KHEOXHF4.cjs → chunk-32QBTN5L.cjs} +5 -5
- package/dist/{chunk-KHEOXHF4.cjs.map → chunk-32QBTN5L.cjs.map} +1 -1
- package/dist/{chunk-GG6CAELN.js → chunk-3FBPPKV2.js} +4 -4
- package/dist/{chunk-MSUSONUK.js → chunk-5JYX2GOP.js} +3233 -3313
- package/dist/chunk-5JYX2GOP.js.map +1 -0
- package/dist/{chunk-EQEMZU45.js → chunk-5K3F5AZX.js} +4 -4
- package/dist/{chunk-YVOMHB73.js → chunk-5MVE77D5.js} +21 -35
- package/dist/chunk-5MVE77D5.js.map +1 -0
- package/dist/{chunk-H4RCJ4IB.js → chunk-6F47STCR.js} +3 -7
- package/dist/{chunk-H4RCJ4IB.js.map → chunk-6F47STCR.js.map} +1 -1
- package/dist/{chunk-XPLZB74T.js → chunk-6RILRC7X.js} +2 -2
- package/dist/{chunk-BKDSNVGH.cjs → chunk-7FH6MZ6M.cjs} +9 -9
- package/dist/{chunk-BKDSNVGH.cjs.map → chunk-7FH6MZ6M.cjs.map} +1 -1
- package/dist/{chunk-ZUVVJ24E.js → chunk-7IR5LKYC.js} +2 -2
- package/dist/{chunk-GG2HJQW3.cjs → chunk-AN7YK35P.cjs} +26 -26
- package/dist/{chunk-GG2HJQW3.cjs.map → chunk-AN7YK35P.cjs.map} +1 -1
- package/dist/{chunk-PZH3CZTJ.cjs → chunk-CCFBL7JU.cjs} +75 -89
- package/dist/chunk-CCFBL7JU.cjs.map +1 -0
- package/dist/{chunk-OEN3GTRL.js → chunk-DEYRHTLD.js} +2 -2
- package/dist/{chunk-MIKGZY7V.js → chunk-GCMASPSW.js} +5 -5
- package/dist/{chunk-ZYC4O76Y.js → chunk-HJ7OVIR7.js} +2 -2
- package/dist/{chunk-BWMVI2KD.cjs → chunk-HVS56KQE.cjs} +7 -7
- package/dist/{chunk-BWMVI2KD.cjs.map → chunk-HVS56KQE.cjs.map} +1 -1
- package/dist/{chunk-GZL5SAUI.cjs → chunk-HWQ5HMJN.cjs} +15 -19
- package/dist/chunk-HWQ5HMJN.cjs.map +1 -0
- package/dist/{chunk-NAYXROCV.cjs → chunk-ISK6LRRY.cjs} +3 -3
- package/dist/{chunk-NAYXROCV.cjs.map → chunk-ISK6LRRY.cjs.map} +1 -1
- package/dist/{chunk-4H7L4OSR.cjs → chunk-LOLVMAT3.cjs} +4 -4
- package/dist/{chunk-4H7L4OSR.cjs.map → chunk-LOLVMAT3.cjs.map} +1 -1
- package/dist/{chunk-XZNKPEWB.js → chunk-MIBKEMZY.js} +2 -2
- package/dist/chunk-MVWSLZG7.js +2 -0
- package/dist/{chunk-QWVON3LG.cjs → chunk-NCJUIT3Q.cjs} +20 -20
- package/dist/{chunk-QWVON3LG.cjs.map → chunk-NCJUIT3Q.cjs.map} +1 -1
- package/dist/{chunk-OTDVQBLI.cjs → chunk-NM5NBMMD.cjs} +31 -31
- package/dist/{chunk-OTDVQBLI.cjs.map → chunk-NM5NBMMD.cjs.map} +1 -1
- package/dist/{chunk-SQ53GVCG.js → chunk-QQFUJ6MS.js} +2 -2
- package/dist/{chunk-PBH2BQYR.cjs → chunk-TFEL2C6I.cjs} +86 -86
- package/dist/{chunk-PBH2BQYR.cjs.map → chunk-TFEL2C6I.cjs.map} +1 -1
- package/dist/{chunk-DLSDYLY3.cjs → chunk-TFRJ7B4X.cjs} +11 -11
- package/dist/{chunk-DLSDYLY3.cjs.map → chunk-TFRJ7B4X.cjs.map} +1 -1
- package/dist/{chunk-Y6IGG6RZ.cjs → chunk-TGT3JHVU.cjs} +39 -39
- package/dist/{chunk-Y6IGG6RZ.cjs.map → chunk-TGT3JHVU.cjs.map} +1 -1
- package/dist/{chunk-XSK7ZQ3C.js → chunk-TXLUKQBI.js} +2 -2
- package/dist/{chunk-LOWWLH2W.js → chunk-UK6SSMUR.js} +2 -2
- package/dist/chunk-ZTM35Q76.cjs +2 -0
- package/dist/{chunk-UGAHDPNU.cjs.map → chunk-ZTM35Q76.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +8 -8
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/employee-entry-card.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +1 -1
- package/dist/components/chat/types/message.types.d.ts +8 -0
- package/dist/components/chat/types/message.types.d.ts.map +1 -1
- package/dist/components/chat/utils/message-segment-accumulator.d.ts +1 -1
- package/dist/components/chat/utils/message-segment-accumulator.d.ts.map +1 -1
- package/dist/components/chat/utils/process-historical-messages.d.ts.map +1 -1
- package/dist/components/comment-card.d.ts +2 -18
- package/dist/components/comment-card.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +5 -5
- package/dist/components/docs/index.js +4 -4
- package/dist/components/embeds/index.cjs +4 -6
- package/dist/components/embeds/index.cjs.map +1 -1
- package/dist/components/embeds/index.d.ts +0 -2
- package/dist/components/embeds/index.d.ts.map +1 -1
- package/dist/components/embeds/index.js +3 -5
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/array-entry-manager.d.ts.map +1 -1
- package/dist/components/features/clickup-tasks-manager.d.ts +1 -6
- package/dist/components/features/clickup-tasks-manager.d.ts.map +1 -1
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/help-center-pages/index.cjs +22 -22
- package/dist/components/help-center-pages/index.js +13 -13
- package/dist/components/index.cjs +204 -281
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +570 -647
- package/dist/components/index.js.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +30 -30
- package/dist/components/meeting-scheduler/index.js +3 -3
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/shared/delivery/delivery-row.d.ts +1 -5
- package/dist/components/shared/delivery/delivery-row.d.ts.map +1 -1
- package/dist/components/shared/roadmap/roadmap-grid.d.ts +1 -10
- package/dist/components/shared/roadmap/roadmap-grid.d.ts.map +1 -1
- package/dist/components/tickets/index.cjs +6 -6
- package/dist/components/tickets/index.js +5 -5
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +2 -4
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.d.ts +1 -1
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +1 -3
- package/dist/components/ui/markdown/rich/embed-overrides.d.ts.map +1 -1
- package/dist/components/ui/markdown/rich/shortcodes.d.ts.map +1 -1
- package/dist/components/ui/table/index.d.ts +1 -1
- package/dist/components/ui/table/index.d.ts.map +1 -1
- package/dist/components/ui/table/table-row.d.ts.map +1 -1
- package/dist/components/ui/table/table-skeleton.d.ts +2 -15
- package/dist/components/ui/table/table-skeleton.d.ts.map +1 -1
- package/dist/components/ui/table/table.d.ts.map +1 -1
- package/dist/components/ui/table/types.d.ts +0 -2
- package/dist/components/ui/table/types.d.ts.map +1 -1
- package/dist/index.cjs +2 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -5
- package/dist/types/employee.d.ts +2 -25
- package/dist/types/employee.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/marketing.d.ts +1 -1
- package/dist/types/marketing.d.ts.map +1 -1
- package/dist/types/profile.d.ts +1 -2
- package/dist/types/profile.d.ts.map +1 -1
- package/dist/types/team.d.ts +1 -15
- package/dist/types/team.d.ts.map +1 -1
- package/dist/types/user.d.ts +1 -3
- package/dist/types/user.d.ts.map +1 -1
- package/dist/utils/embed-url-converters.d.ts +0 -17
- package/dist/utils/embed-url-converters.d.ts.map +1 -1
- package/dist/utils/index.cjs +0 -12
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js +1 -12
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/.comment-card.md +5 -4
- package/src/components/chat/__tests__/ticket-event.test.ts +86 -0
- package/src/components/chat/chat-message-enhanced.tsx +3 -1
- package/src/components/chat/entity-cards/employee-entry-card.tsx +0 -6
- package/src/components/chat/stream/chat-stream-reducer.ts +7 -1
- package/src/components/chat/types/message.types.ts +8 -0
- package/src/components/chat/utils/message-segment-accumulator.ts +10 -3
- package/src/components/chat/utils/process-historical-messages.ts +17 -8
- package/src/components/comment-card.tsx +17 -42
- package/src/components/embeds/index.ts +0 -2
- package/src/components/features/array-entry-manager.tsx +1 -2
- package/src/components/features/clickup-tasks-manager.tsx +1 -8
- package/src/components/index.ts +0 -1
- package/src/components/shared/delivery/delivery-row.tsx +1 -17
- package/src/components/shared/roadmap/roadmap-grid.tsx +1 -21
- package/src/components/ui/card.tsx +1 -4
- package/src/components/ui/index.ts +0 -1
- package/src/components/ui/markdown/rich/__tests__/shortcodes.test.ts +0 -44
- package/src/components/ui/markdown/rich/embed-overrides.tsx +0 -4
- package/src/components/ui/markdown/rich/shortcodes.ts +0 -12
- package/src/components/ui/table/index.ts +1 -1
- package/src/components/ui/table/table-row.tsx +2 -7
- package/src/components/ui/table/table-skeleton.tsx +3 -20
- package/src/components/ui/table/table.tsx +0 -1
- package/src/components/ui/table/types.ts +0 -2
- package/src/types/employee.ts +2 -27
- package/src/types/index.ts +0 -2
- package/src/types/marketing.ts +0 -1
- package/src/types/profile.ts +1 -3
- package/src/types/team.ts +1 -17
- package/src/types/user.ts +1 -4
- package/src/utils/embed-url-converters.ts +0 -32
- package/dist/chunk-5I3BSQ6D.js +0 -2
- package/dist/chunk-GZL5SAUI.cjs.map +0 -1
- package/dist/chunk-MSUSONUK.js.map +0 -1
- package/dist/chunk-PZH3CZTJ.cjs.map +0 -1
- package/dist/chunk-TA5P2M7V.cjs.map +0 -1
- package/dist/chunk-UGAHDPNU.cjs +0 -2
- package/dist/chunk-YVOMHB73.js.map +0 -1
- package/dist/components/comment-composer.d.ts +0 -42
- package/dist/components/comment-composer.d.ts.map +0 -1
- package/dist/components/embeds/claude-embed.d.ts +0 -31
- package/dist/components/embeds/claude-embed.d.ts.map +0 -1
- package/dist/types/department.d.ts +0 -41
- package/dist/types/department.d.ts.map +0 -1
- package/dist/types/design-doc.d.ts +0 -247
- package/dist/types/design-doc.d.ts.map +0 -1
- package/src/components/comment-composer.tsx +0 -117
- package/src/components/embeds/claude-embed.tsx +0 -84
- package/src/types/department.ts +0 -44
- package/src/types/design-doc.ts +0 -295
- package/src/utils/__tests__/claude-embed-url.test.ts +0 -42
- /package/dist/{chunk-GG6CAELN.js.map → chunk-3FBPPKV2.js.map} +0 -0
- /package/dist/{chunk-EQEMZU45.js.map → chunk-5K3F5AZX.js.map} +0 -0
- /package/dist/{chunk-XPLZB74T.js.map → chunk-6RILRC7X.js.map} +0 -0
- /package/dist/{chunk-ZUVVJ24E.js.map → chunk-7IR5LKYC.js.map} +0 -0
- /package/dist/{chunk-OEN3GTRL.js.map → chunk-DEYRHTLD.js.map} +0 -0
- /package/dist/{chunk-MIKGZY7V.js.map → chunk-GCMASPSW.js.map} +0 -0
- /package/dist/{chunk-ZYC4O76Y.js.map → chunk-HJ7OVIR7.js.map} +0 -0
- /package/dist/{chunk-XZNKPEWB.js.map → chunk-MIBKEMZY.js.map} +0 -0
- /package/dist/{chunk-5I3BSQ6D.js.map → chunk-MVWSLZG7.js.map} +0 -0
- /package/dist/{chunk-SQ53GVCG.js.map → chunk-QQFUJ6MS.js.map} +0 -0
- /package/dist/{chunk-XSK7ZQ3C.js.map → chunk-TXLUKQBI.js.map} +0 -0
- /package/dist/{chunk-LOWWLH2W.js.map → chunk-UK6SSMUR.js.map} +0 -0
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import type { EntityAuthor } from './entity-author';
|
|
2
|
-
import type { DeliveryItem } from './delivery';
|
|
3
|
-
import type { RoadmapItem } from '../components/chat/types/entities/roadmap-item';
|
|
4
|
-
import type { DepartmentRef } from './department';
|
|
5
|
-
import type { EmployeeDirectoryRow } from './employee';
|
|
6
|
-
export type DesignDocStatus = 'draft' | 'in_review' | 'approved' | 'building' | 'shipped' | 'abandoned';
|
|
7
|
-
export type DesignDocTier = 'S' | 'M' | 'L';
|
|
8
|
-
export type DesignDocParticipantStatus = 'pending' | 'in_progress' | 'completed' | 'blocked';
|
|
9
|
-
export type DesignDocCommentType = 'blocking' | 'suggestion' | 'question' | 'note';
|
|
10
|
-
export type DesignDocCommentStatus = 'open' | 'resolved' | 'declined';
|
|
11
|
-
export type DesignDocLinkType = 'roadmap_task' | 'figma' | 'claude_artifact' | 'claude_design' | 'brief' | 'other';
|
|
12
|
-
export type DesignDocMediaType = 'image' | 'video' | 'screenshot' | 'demo';
|
|
13
|
-
/**
|
|
14
|
-
* The profile identity the DAL embeds on participants / comment authors — THE
|
|
15
|
-
* shared person projection, not a second declaration of it. `email` rides the
|
|
16
|
-
* detail payload only and is stripped from lists.
|
|
17
|
-
*/
|
|
18
|
-
export type DesignDocPerson = EmployeeDirectoryRow;
|
|
19
|
-
export interface DesignDocClickUpTask {
|
|
20
|
-
id: number;
|
|
21
|
-
doc_id: number;
|
|
22
|
-
participant_id: number | null;
|
|
23
|
-
clickup_task_id: string;
|
|
24
|
-
display_order: number | null;
|
|
25
|
-
created_at: string;
|
|
26
|
-
/** Hydrated from the `clickup_tasks` mirror (never the live API). `undefined` = not in the mirror. */
|
|
27
|
-
task?: DeliveryItem;
|
|
28
|
-
}
|
|
29
|
-
export interface DesignDocLink {
|
|
30
|
-
id: number;
|
|
31
|
-
doc_id: number;
|
|
32
|
-
link_type: DesignDocLinkType;
|
|
33
|
-
url: string | null;
|
|
34
|
-
clickup_task_id: string | null;
|
|
35
|
-
title: string | null;
|
|
36
|
-
display_order: number | null;
|
|
37
|
-
created_at: string;
|
|
38
|
-
/**
|
|
39
|
-
* A `roadmap_task` link, hydrated from the mirror as the ROADMAP item it is —
|
|
40
|
-
* so it renders with the roadmap card, the same as `/roadmap` and the chat.
|
|
41
|
-
* `undefined` = the mirror has not seen that id. (Section tasks are a
|
|
42
|
-
* different entity and carry `DeliveryItem` on `DesignDocClickUpTask`.)
|
|
43
|
-
*/
|
|
44
|
-
roadmap?: RoadmapItem;
|
|
45
|
-
}
|
|
46
|
-
export interface DesignDocMedia {
|
|
47
|
-
id: number;
|
|
48
|
-
doc_id: number;
|
|
49
|
-
participant_id: number | null;
|
|
50
|
-
media_type: DesignDocMediaType;
|
|
51
|
-
media_url: string;
|
|
52
|
-
title: string | null;
|
|
53
|
-
description: string | null;
|
|
54
|
-
display_order: number | null;
|
|
55
|
-
created_at: string;
|
|
56
|
-
created_by: string | null;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* A comment. ROOT comments (`parent_comment_id === null`) carry `comment_type`
|
|
60
|
-
* + `status` and gate approval when `blocking` + `open`; REPLIES carry neither
|
|
61
|
-
* (single-level threads — a reply to a reply is re-parented to the root).
|
|
62
|
-
*/
|
|
63
|
-
export interface DesignDocComment {
|
|
64
|
-
id: number;
|
|
65
|
-
doc_id: number;
|
|
66
|
-
participant_id: number | null;
|
|
67
|
-
parent_comment_id: number | null;
|
|
68
|
-
author_id: string | null;
|
|
69
|
-
comment_type: DesignDocCommentType | null;
|
|
70
|
-
title: string | null;
|
|
71
|
-
body: string;
|
|
72
|
-
status: DesignDocCommentStatus | null;
|
|
73
|
-
resolved_at: string | null;
|
|
74
|
-
created_at: string;
|
|
75
|
-
author?: DesignDocPerson | null;
|
|
76
|
-
/** Threaded by the DAL; always `[]` on replies. */
|
|
77
|
-
replies: DesignDocComment[];
|
|
78
|
-
}
|
|
79
|
-
export interface DesignDocParticipant {
|
|
80
|
-
id: number;
|
|
81
|
-
doc_id: number;
|
|
82
|
-
department_id: string;
|
|
83
|
-
department: DepartmentRef;
|
|
84
|
-
assignee_id: string | null;
|
|
85
|
-
assignee?: DesignDocPerson | null;
|
|
86
|
-
status: DesignDocParticipantStatus;
|
|
87
|
-
content: string | null;
|
|
88
|
-
completed_at: string | null;
|
|
89
|
-
display_order: number | null;
|
|
90
|
-
created_at: string;
|
|
91
|
-
updated_at: string;
|
|
92
|
-
tasks: DesignDocClickUpTask[];
|
|
93
|
-
media: DesignDocMedia[];
|
|
94
|
-
/** Section-scoped root comments (threaded). */
|
|
95
|
-
comments: DesignDocComment[];
|
|
96
|
-
}
|
|
97
|
-
export interface DesignDocCompletion {
|
|
98
|
-
total: number;
|
|
99
|
-
completed: number;
|
|
100
|
-
blocked: number;
|
|
101
|
-
openBlocking: number;
|
|
102
|
-
isComplete: boolean;
|
|
103
|
-
waitingOn: Array<{
|
|
104
|
-
participantId: number;
|
|
105
|
-
department: DepartmentRef;
|
|
106
|
-
assigneeName: string | null;
|
|
107
|
-
status: DesignDocParticipantStatus;
|
|
108
|
-
}>;
|
|
109
|
-
}
|
|
110
|
-
/** R13 — what the signed-in viewer still owes on one doc. */
|
|
111
|
-
export interface DesignDocMyOpenWork {
|
|
112
|
-
/** One person may own several department sections on the same doc. */
|
|
113
|
-
participants: Array<{
|
|
114
|
-
id: number;
|
|
115
|
-
department: DepartmentRef;
|
|
116
|
-
status: DesignDocParticipantStatus;
|
|
117
|
-
}>;
|
|
118
|
-
openTasks: DeliveryItem[];
|
|
119
|
-
}
|
|
120
|
-
export interface DesignDoc {
|
|
121
|
-
id: number;
|
|
122
|
-
title: string;
|
|
123
|
-
slug: string;
|
|
124
|
-
tier: DesignDocTier;
|
|
125
|
-
summary: string | null;
|
|
126
|
-
content: string | null;
|
|
127
|
-
status: DesignDocStatus;
|
|
128
|
-
author_id: string | null;
|
|
129
|
-
/**
|
|
130
|
-
* EVERYONE who has handed the DRI role away on this doc (appended, never
|
|
131
|
-
* overwritten). The third-party break-glass excludes all of them: a DRI who
|
|
132
|
-
* also holds management could otherwise vacate the seat, act as a "third
|
|
133
|
-
* party" on their own doc and approve it alone — and with a single scalar,
|
|
134
|
-
* simply hand the seat on twice to erase the memory of their own vacating.
|
|
135
|
-
*/
|
|
136
|
-
dri_vacated_by: string[];
|
|
137
|
-
approved_at: string | null;
|
|
138
|
-
created_at: string;
|
|
139
|
-
updated_at: string;
|
|
140
|
-
/** DRI, hydrated via the shared author hydrator. */
|
|
141
|
-
author?: EntityAuthor;
|
|
142
|
-
participants: DesignDocParticipant[];
|
|
143
|
-
links: DesignDocLink[];
|
|
144
|
-
/** Doc-level comments only (participant-scoped comments ride on their participant). */
|
|
145
|
-
comments: DesignDocComment[];
|
|
146
|
-
completion: DesignDocCompletion;
|
|
147
|
-
my_open_work?: DesignDocMyOpenWork;
|
|
148
|
-
}
|
|
149
|
-
export interface DesignDocLinkInput {
|
|
150
|
-
link_type: DesignDocLinkType;
|
|
151
|
-
url?: string | null;
|
|
152
|
-
clickup_task_id?: string | null;
|
|
153
|
-
title?: string | null;
|
|
154
|
-
display_order?: number;
|
|
155
|
-
}
|
|
156
|
-
export interface DesignDocClickUpTaskInput {
|
|
157
|
-
clickup_task_id: string;
|
|
158
|
-
display_order?: number;
|
|
159
|
-
}
|
|
160
|
-
export interface DesignDocMediaInput {
|
|
161
|
-
media_type: DesignDocMediaType;
|
|
162
|
-
media_url: string;
|
|
163
|
-
title?: string | null;
|
|
164
|
-
description?: string | null;
|
|
165
|
-
display_order?: number;
|
|
166
|
-
}
|
|
167
|
-
export interface CreateDesignDocParticipantInput {
|
|
168
|
-
/** Defaults to the assignee's profile department when omitted. */
|
|
169
|
-
department_id?: string;
|
|
170
|
-
assignee_id: string;
|
|
171
|
-
}
|
|
172
|
-
/** Wizard payload (POST /api/admin/design-docs). */
|
|
173
|
-
export interface CreateDesignDocData {
|
|
174
|
-
title: string;
|
|
175
|
-
slug: string;
|
|
176
|
-
tier: DesignDocTier;
|
|
177
|
-
summary?: string | null;
|
|
178
|
-
/** Spec markdown (Why / What / How); the create screen carries the same body editor as edit. */
|
|
179
|
-
content?: string | null;
|
|
180
|
-
/** DRI; defaults to the caller. */
|
|
181
|
-
author_id?: string | null;
|
|
182
|
-
participants: CreateDesignDocParticipantInput[];
|
|
183
|
-
links: DesignDocLinkInput[];
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Doc-level allowlist (PUT). `status` and `participants` are NOT here — status
|
|
187
|
-
* only moves through PATCH (the gate), participants only through their routes.
|
|
188
|
-
*/
|
|
189
|
-
export interface UpdateDesignDocData {
|
|
190
|
-
title?: string;
|
|
191
|
-
slug?: string;
|
|
192
|
-
tier?: DesignDocTier;
|
|
193
|
-
summary?: string | null;
|
|
194
|
-
content?: string | null;
|
|
195
|
-
author_id?: string | null;
|
|
196
|
-
links?: DesignDocLinkInput[];
|
|
197
|
-
/** OCC token — the `updated_at` the editor seeded from; mismatch → 409. */
|
|
198
|
-
expected_updated_at?: string;
|
|
199
|
-
}
|
|
200
|
-
export interface UpdateDesignDocParticipantData {
|
|
201
|
-
content?: string | null;
|
|
202
|
-
status?: DesignDocParticipantStatus;
|
|
203
|
-
assignee_id?: string | null;
|
|
204
|
-
department_id?: string;
|
|
205
|
-
clickup_tasks?: DesignDocClickUpTaskInput[];
|
|
206
|
-
media?: DesignDocMediaInput[];
|
|
207
|
-
expected_updated_at?: string;
|
|
208
|
-
}
|
|
209
|
-
export interface AddDesignDocParticipantData {
|
|
210
|
-
/** Defaults to the assignee's profile department when omitted. */
|
|
211
|
-
department_id?: string;
|
|
212
|
-
assignee_id: string;
|
|
213
|
-
}
|
|
214
|
-
export interface AddDesignDocCommentData {
|
|
215
|
-
participant_id?: number | null;
|
|
216
|
-
/** Set for a reply; the DAL re-parents replies-of-replies to the root. */
|
|
217
|
-
parent_comment_id?: number | null;
|
|
218
|
-
/** Required on root comments, ignored on replies. */
|
|
219
|
-
comment_type?: DesignDocCommentType;
|
|
220
|
-
title?: string | null;
|
|
221
|
-
body: string;
|
|
222
|
-
}
|
|
223
|
-
export interface DesignDocFilters {
|
|
224
|
-
status?: string;
|
|
225
|
-
search?: string;
|
|
226
|
-
mine?: 'open';
|
|
227
|
-
limit?: number;
|
|
228
|
-
offset?: number;
|
|
229
|
-
}
|
|
230
|
-
export interface DesignDocListResponse {
|
|
231
|
-
data: DesignDoc[];
|
|
232
|
-
count: number;
|
|
233
|
-
/** Server-computed status facet counts (how-i-work feed convention). */
|
|
234
|
-
facets: {
|
|
235
|
-
status: Record<string, number>;
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
export interface DesignDocStats {
|
|
239
|
-
total: number;
|
|
240
|
-
draft: number;
|
|
241
|
-
in_review: number;
|
|
242
|
-
approved: number;
|
|
243
|
-
building: number;
|
|
244
|
-
waiting_on_me_docs: number;
|
|
245
|
-
waiting_on_me_tasks: number;
|
|
246
|
-
}
|
|
247
|
-
//# sourceMappingURL=design-doc.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"design-doc.d.ts","sourceRoot":"","sources":["../../src/types/design-doc.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAA;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,KAAK,E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W,uBAAuB;IACtC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,0EAA0E;IAC1E,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,qDAAqD;IACrD,YAAY,CAAC,EAAE,oBAAoB,CAAA;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,SAAS,EAAE,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,wEAAwE;IACxE,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAAA;CAC3C;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,mBAAmB,EAAE,MAAM,CAAA;CAC5B"}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { useState, type ReactNode, type RefObject } from 'react'
|
|
4
|
-
import { Button, Input, Label, Textarea } from './ui'
|
|
5
|
-
|
|
6
|
-
export interface CommentComposerDraft {
|
|
7
|
-
title: string
|
|
8
|
-
body: string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface CommentComposerProps {
|
|
12
|
-
/**
|
|
13
|
-
* Show the title field. The vendor section's comments are titled reviews;
|
|
14
|
-
* a design-doc comment is a Slack message, so it passes `false`.
|
|
15
|
-
*/
|
|
16
|
-
withTitle?: boolean
|
|
17
|
-
titleLabel?: string
|
|
18
|
-
titlePlaceholder?: string
|
|
19
|
-
/** For hosts whose empty state focuses the composer ("Be the first!"). */
|
|
20
|
-
titleRef?: RefObject<HTMLInputElement | null>
|
|
21
|
-
bodyLabel?: string
|
|
22
|
-
placeholder?: string
|
|
23
|
-
/** Extra controls under the box — design docs put the comment-type chips here. */
|
|
24
|
-
extras?: ReactNode
|
|
25
|
-
submitLabel?: string
|
|
26
|
-
cancelLabel?: string
|
|
27
|
-
onCancel?: () => void
|
|
28
|
-
pending?: boolean
|
|
29
|
-
/** Accessible name for the body control when there is no visible label. */
|
|
30
|
-
ariaLabel?: string
|
|
31
|
-
/**
|
|
32
|
-
* Return `false` to KEEP the draft — a failed post must never lose what the
|
|
33
|
-
* person typed. Anything else clears it.
|
|
34
|
-
*/
|
|
35
|
-
onSubmit: (draft: CommentComposerDraft) => void | boolean | Promise<void | boolean>
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* THE comment composer: one bordered box with the field(s) inside and Send
|
|
40
|
-
* beside it (stacked on mobile).
|
|
41
|
-
*
|
|
42
|
-
* One component for every comment surface — the vendor page and the design-doc
|
|
43
|
-
* threads — so the two cannot drift in shape, spacing or submit behaviour. It
|
|
44
|
-
* owns its own draft state, which is what lets both hosts stop hand-rolling
|
|
45
|
-
* one (the vendor page kept title and body in a single newline-joined string).
|
|
46
|
-
*/
|
|
47
|
-
export function CommentComposer({
|
|
48
|
-
withTitle = false,
|
|
49
|
-
titleLabel = 'Title',
|
|
50
|
-
titlePlaceholder = 'Your comment title here',
|
|
51
|
-
titleRef,
|
|
52
|
-
bodyLabel = 'Description',
|
|
53
|
-
placeholder = 'Write your comment...',
|
|
54
|
-
extras,
|
|
55
|
-
submitLabel = 'Send',
|
|
56
|
-
cancelLabel = 'Cancel',
|
|
57
|
-
onCancel,
|
|
58
|
-
pending = false,
|
|
59
|
-
ariaLabel,
|
|
60
|
-
onSubmit,
|
|
61
|
-
}: CommentComposerProps) {
|
|
62
|
-
const [title, setTitle] = useState('')
|
|
63
|
-
const [body, setBody] = useState('')
|
|
64
|
-
// A titled composer needs both halves — the host's API rejects a title-only
|
|
65
|
-
// or body-only comment, and disabling Send says so before the round trip.
|
|
66
|
-
const canSubmit = body.trim().length > 0 && (!withTitle || title.trim().length > 0) && !pending
|
|
67
|
-
|
|
68
|
-
const submit = async () => {
|
|
69
|
-
if (!canSubmit) return
|
|
70
|
-
const kept = await onSubmit({ title: title.trim(), body: body.trim() })
|
|
71
|
-
if (kept === false) return
|
|
72
|
-
setTitle('')
|
|
73
|
-
setBody('')
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return (
|
|
77
|
-
<div className="flex flex-col gap-[var(--spacing-system-xsf)]">
|
|
78
|
-
<div className="flex flex-col gap-[var(--spacing-system-sf)] md:flex-row">
|
|
79
|
-
<div className="flex-1 overflow-hidden rounded-lg border border-ods-border bg-ods-bg">
|
|
80
|
-
{withTitle ? (
|
|
81
|
-
<div className="border-b border-ods-border">
|
|
82
|
-
<Label className="text-badge text-ods-text-secondary px-3 pt-2 pb-1">{titleLabel}</Label>
|
|
83
|
-
<Input
|
|
84
|
-
ref={titleRef}
|
|
85
|
-
value={title}
|
|
86
|
-
onChange={(e) => setTitle(e.target.value)}
|
|
87
|
-
placeholder={titlePlaceholder}
|
|
88
|
-
disabled={pending}
|
|
89
|
-
className="rounded-none border-0 bg-transparent focus-visible:ring-0"
|
|
90
|
-
/>
|
|
91
|
-
</div>
|
|
92
|
-
) : null}
|
|
93
|
-
{withTitle ? <Label className="text-badge text-ods-text-secondary px-3 pt-2 pb-1">{bodyLabel}</Label> : null}
|
|
94
|
-
<Textarea
|
|
95
|
-
value={body}
|
|
96
|
-
onChange={(e) => setBody(e.target.value)}
|
|
97
|
-
placeholder={placeholder}
|
|
98
|
-
disabled={pending}
|
|
99
|
-
aria-label={ariaLabel ?? (withTitle ? bodyLabel : submitLabel)}
|
|
100
|
-
className="min-h-[64px] rounded-none border-0 bg-transparent focus-visible:ring-0"
|
|
101
|
-
/>
|
|
102
|
-
</div>
|
|
103
|
-
<div className="flex items-start gap-[var(--spacing-system-xsf)]">
|
|
104
|
-
{onCancel ? (
|
|
105
|
-
<Button type="button" variant="outline" size="small-legacy" onClick={onCancel} disabled={pending}>
|
|
106
|
-
{cancelLabel}
|
|
107
|
-
</Button>
|
|
108
|
-
) : null}
|
|
109
|
-
<Button type="button" variant="accent" size="small-legacy" onClick={submit} disabled={!canSubmit} loading={pending}>
|
|
110
|
-
{submitLabel}
|
|
111
|
-
</Button>
|
|
112
|
-
</div>
|
|
113
|
-
</div>
|
|
114
|
-
{extras ? <div className="flex flex-wrap items-center gap-[var(--spacing-system-xsf)]">{extras}</div> : null}
|
|
115
|
-
</div>
|
|
116
|
-
)
|
|
117
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { ExternalLink, Asterisk } from 'lucide-react'
|
|
4
|
-
import { toClaudeEmbedUrl } from '../../utils/embed-url-converters'
|
|
5
|
-
|
|
6
|
-
export type ClaudeEmbedKind = 'artifact' | 'design'
|
|
7
|
-
|
|
8
|
-
export interface ClaudeEmbedProps {
|
|
9
|
-
/** Any claude.ai / claude.site url. */
|
|
10
|
-
url: string
|
|
11
|
-
/** Which surface the link points at — only the copy differs. */
|
|
12
|
-
kind?: ClaudeEmbedKind
|
|
13
|
-
/** Heading on the action row. Defaults to the kind's name. */
|
|
14
|
-
title?: string
|
|
15
|
-
/** iframe height (CSS value), matching `FigmaEmbed`'s prop. */
|
|
16
|
-
height?: string
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const KIND_LABEL: Record<ClaudeEmbedKind, string> = {
|
|
20
|
-
artifact: 'Claude artifact',
|
|
21
|
-
design: 'Claude Design',
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* A Claude artifact, embedded the way Figma is — a markdown block, reached
|
|
26
|
-
* through the `{{claude-artifact:URL}}` / `{{claude-design:URL}}` shortcodes,
|
|
27
|
-
* so it renders identically wherever markdown renders: a spec body, a comment,
|
|
28
|
-
* a links rail.
|
|
29
|
-
*
|
|
30
|
-
* A PUBLISHED artifact frames through its `/embed` route (see
|
|
31
|
-
* `toClaudeEmbedUrl`). Everything else cannot be framed at all, so the action
|
|
32
|
-
* row underneath is ALWAYS rendered: what the link is, why the frame above may
|
|
33
|
-
* be blank, and one click to open it.
|
|
34
|
-
*
|
|
35
|
-
* Four things defeat the frame:
|
|
36
|
-
* · a Claude CODE url (`claude.ai/code/artifact/…`) — no Embed settings exist
|
|
37
|
-
* for it, and its `/embed` path answers `frame-ancestors 'self'`;
|
|
38
|
-
* · a Claude Design url, which has no embed route at all;
|
|
39
|
-
* · an artifact whose author has not added this host under Allowed domains;
|
|
40
|
-
* · an http host (mixed content) — it will not paint on `http://localhost`.
|
|
41
|
-
*/
|
|
42
|
-
export function ClaudeEmbed({ url, kind = 'artifact', title, height = '480px' }: ClaudeEmbedProps) {
|
|
43
|
-
const label = title ?? KIND_LABEL[kind]
|
|
44
|
-
const embedUrl = toClaudeEmbedUrl(url)
|
|
45
|
-
return (
|
|
46
|
-
<div className="overflow-hidden rounded-lg border border-ods-border bg-ods-card">
|
|
47
|
-
{embedUrl ? (
|
|
48
|
-
<iframe
|
|
49
|
-
src={embedUrl}
|
|
50
|
-
title={label}
|
|
51
|
-
loading="lazy"
|
|
52
|
-
// `allow-same-origin` alongside `allow-scripts` is what Anthropic's own
|
|
53
|
-
// embed snippet uses — an artifact needs both to run.
|
|
54
|
-
sandbox="allow-scripts allow-same-origin allow-popups allow-forms"
|
|
55
|
-
style={{ height }}
|
|
56
|
-
className="block w-full border-0 bg-ods-bg-surface"
|
|
57
|
-
/>
|
|
58
|
-
) : null}
|
|
59
|
-
<a
|
|
60
|
-
href={url}
|
|
61
|
-
target="_blank"
|
|
62
|
-
rel="noopener noreferrer"
|
|
63
|
-
className={`flex items-center gap-[var(--spacing-system-mf)] p-[var(--spacing-system-mf)] no-underline transition-colors hover:bg-ods-bg-surface ${
|
|
64
|
-
embedUrl ? 'border-t border-ods-border' : ''
|
|
65
|
-
}`}
|
|
66
|
-
>
|
|
67
|
-
<div className="flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-ods-bg-surface">
|
|
68
|
-
<Asterisk className="h-6 w-6 text-ods-accent" />
|
|
69
|
-
</div>
|
|
70
|
-
<div className="min-w-0 flex-1">
|
|
71
|
-
<p className="truncate text-h4 text-ods-text-primary">{label}</p>
|
|
72
|
-
<p className="truncate text-h6 text-ods-text-secondary">
|
|
73
|
-
{embedUrl
|
|
74
|
-
? 'claude.ai · blank above? Publish → Embed settings → add this site to Allowed domains'
|
|
75
|
-
: kind === 'artifact'
|
|
76
|
-
? 'claude.ai · only a published chat artifact can be framed · a Claude Code link opens in a new tab'
|
|
77
|
-
: 'claude.ai · opens in a new tab · claude.ai serves this surface with framing disabled'}
|
|
78
|
-
</p>
|
|
79
|
-
</div>
|
|
80
|
-
<ExternalLink className="h-4 w-4 shrink-0 text-ods-text-secondary" />
|
|
81
|
-
</a>
|
|
82
|
-
</div>
|
|
83
|
-
)
|
|
84
|
-
}
|
package/src/types/department.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Departments — THE single source of truth for the org's department
|
|
3
|
-
* vocabulary.
|
|
4
|
-
*
|
|
5
|
-
* The `departments` table is populated from Google Workspace (the org chart)
|
|
6
|
-
* by the hub's Google sync, which auto-creates a row the first time it sees a
|
|
7
|
-
* new department name. `profiles.department_id` is an FK to it; there is no
|
|
8
|
-
* free-text department column and no enum anywhere in code — every consumer
|
|
9
|
-
* reads the row (or the embedded `DepartmentRef`) and every picker lists the
|
|
10
|
-
* ACTIVE rows ordered by `display_order`.
|
|
11
|
-
*
|
|
12
|
-
* Hub owner module: `lib/data/department-utils.ts`.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
export interface Department {
|
|
16
|
-
id: string
|
|
17
|
-
name: string
|
|
18
|
-
slug: string
|
|
19
|
-
description?: string | null
|
|
20
|
-
parent_department_id?: string | null
|
|
21
|
-
display_order: number
|
|
22
|
-
is_active: boolean
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** The embedded shape a reader gets through the `department:departments(…)` PostgREST embed. */
|
|
26
|
-
export type DepartmentRef = Pick<Department, 'id' | 'name' | 'slug'> & {
|
|
27
|
-
display_order?: number
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/** `GET /api/admin/departments?counts=…` row — a department plus how many profiles carry it. */
|
|
31
|
-
export interface DepartmentSummary {
|
|
32
|
-
id: string
|
|
33
|
-
name: string
|
|
34
|
-
slug: string
|
|
35
|
-
count: number
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/** Population a department count is taken over. */
|
|
39
|
-
/**
|
|
40
|
-
* Populations the department count endpoint supports. The hub's runtime
|
|
41
|
-
* allowlist (`DEPARTMENT_COUNT_POPULATIONS` in lib/data/department-constants.ts)
|
|
42
|
-
* is the value form of this union — keep the two in step.
|
|
43
|
-
*/
|
|
44
|
-
export type DepartmentCountPopulation = 'directory' | 'scored'
|