@hiver/connector-agent 4.27.0 → 4.28.0-pmCommentSync-beta.0
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/app/connector-cards.d.ts.map +1 -1
- package/constants/global-constants.d.ts +1 -0
- package/constants/global-constants.d.ts.map +1 -1
- package/features/connector-cards/components/card-list/Card.d.ts.map +1 -1
- package/features/pm-comments/api/client.d.ts +23 -0
- package/features/pm-comments/api/client.d.ts.map +1 -0
- package/features/pm-comments/api/queries.d.ts +39 -0
- package/features/pm-comments/api/queries.d.ts.map +1 -0
- package/features/pm-comments/components/CommentComposer.d.ts +18 -0
- package/features/pm-comments/components/CommentComposer.d.ts.map +1 -0
- package/features/pm-comments/components/CommentItem.d.ts +30 -0
- package/features/pm-comments/components/CommentItem.d.ts.map +1 -0
- package/features/pm-comments/components/MentionCandidatesPicker.d.ts +13 -0
- package/features/pm-comments/components/MentionCandidatesPicker.d.ts.map +1 -0
- package/features/pm-comments/components/TaskCommentsRow.d.ts +15 -0
- package/features/pm-comments/components/TaskCommentsRow.d.ts.map +1 -0
- package/features/pm-comments/components/TaskHeader.d.ts +20 -0
- package/features/pm-comments/components/TaskHeader.d.ts.map +1 -0
- package/features/pm-comments/components/TaskThreadPanel.d.ts +9 -0
- package/features/pm-comments/components/TaskThreadPanel.d.ts.map +1 -0
- package/features/pm-comments/components/TaskThreadView.d.ts +16 -0
- package/features/pm-comments/components/TaskThreadView.d.ts.map +1 -0
- package/features/pm-comments/components/icons.d.ts +13 -0
- package/features/pm-comments/components/icons.d.ts.map +1 -0
- package/features/pm-comments/components/styles.d.ts +57 -0
- package/features/pm-comments/components/styles.d.ts.map +1 -0
- package/features/pm-comments/constants/api.d.ts +15 -0
- package/features/pm-comments/constants/api.d.ts.map +1 -0
- package/features/pm-comments/constants/tracking.d.ts +12 -0
- package/features/pm-comments/constants/tracking.d.ts.map +1 -0
- package/features/pm-comments/context-value.d.ts +25 -0
- package/features/pm-comments/context-value.d.ts.map +1 -0
- package/features/pm-comments/context.d.ts +20 -0
- package/features/pm-comments/context.d.ts.map +1 -0
- package/features/pm-comments/types/wire.d.ts +145 -0
- package/features/pm-comments/types/wire.d.ts.map +1 -0
- package/features/pm-comments/utils/body.d.ts +5 -0
- package/features/pm-comments/utils/body.d.ts.map +1 -0
- package/features/pm-comments/utils/draft.d.ts +9 -0
- package/features/pm-comments/utils/draft.d.ts.map +1 -0
- package/features/pm-comments/utils/editor.d.ts +18 -0
- package/features/pm-comments/utils/editor.d.ts.map +1 -0
- package/features/pm-comments/utils/format.d.ts +5 -0
- package/features/pm-comments/utils/format.d.ts.map +1 -0
- package/features/pm-comments/utils/pm-connectors.d.ts +7 -0
- package/features/pm-comments/utils/pm-connectors.d.ts.map +1 -0
- package/features/pm-comments/utils/rich-text.d.ts +18 -0
- package/features/pm-comments/utils/rich-text.d.ts.map +1 -0
- package/features/pm-comments/utils/thread-state.d.ts +90 -0
- package/features/pm-comments/utils/thread-state.d.ts.map +1 -0
- package/index.es.js +15918 -14140
- package/index.umd.js +774 -485
- package/main-dev.d.ts.map +1 -1
- package/package.json +1 -1
- package/testing/dev/PmCommentsHarness.d.ts +5 -0
- package/testing/dev/PmCommentsHarness.d.ts.map +1 -0
- package/testing/mocks/handlers/pm-comments.d.ts +36 -0
- package/testing/mocks/handlers/pm-comments.d.ts.map +1 -0
- package/testing/mocks/handlers.d.ts.map +1 -1
- package/utils/action-queue.d.ts +16 -0
- package/utils/action-queue.d.ts.map +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The composer's draft is its sanitised HTML, so a failed post or a reconnect
|
|
3
|
+
* can put it back exactly, mentions and formatting included (R14: drafts survive).
|
|
4
|
+
*/
|
|
5
|
+
export type CommentDraft = {
|
|
6
|
+
html: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const emptyDraft: () => CommentDraft;
|
|
9
|
+
//# sourceMappingURL=draft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../../../../src/features/pm-comments/utils/draft.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5C,eAAO,MAAM,UAAU,QAAO,YAA8B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TextMark } from '../types/wire';
|
|
2
|
+
export declare const selectionIn: (root: HTMLElement) => Range | null;
|
|
3
|
+
export declare const placeCaretAtEnd: (root: HTMLElement) => void;
|
|
4
|
+
/** Inserts HTML at the caret, replacing the selection, and leaves the caret after it. */
|
|
5
|
+
export declare const insertHtmlAtCaret: (root: HTMLElement, html: string) => void;
|
|
6
|
+
/** Replaces `length` characters before the caret in its text node with `html` (mention picking). */
|
|
7
|
+
export declare const replaceBeforeCaret: (root: HTMLElement, length: number, html: string) => void;
|
|
8
|
+
/** Text from the start of the caret's text node to the caret, for the @mention trigger. */
|
|
9
|
+
export declare const textBeforeCaret: (root: HTMLElement) => string | null;
|
|
10
|
+
export declare const isInListItem: (root: HTMLElement) => boolean;
|
|
11
|
+
export declare const toggleMark: (root: HTMLElement, mark: TextMark) => void;
|
|
12
|
+
export declare const toggleList: (ordered: boolean) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* "- ", "* " or "1. " typed at the start of a line becomes a list, as in Slack.
|
|
15
|
+
* Returns true when it converted one.
|
|
16
|
+
*/
|
|
17
|
+
export declare const autoformatList: (root: HTMLElement) => boolean;
|
|
18
|
+
//# sourceMappingURL=editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../../src/features/pm-comments/utils/editor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAWlE,eAAO,MAAM,WAAW,SAAU,WAAW,KAAG,KAAK,GAAG,IAKvD,CAAC;AAQF,eAAO,MAAM,eAAe,SAAU,WAAW,SAKhD,CAAC;AAQF,yFAAyF;AACzF,eAAO,MAAM,iBAAiB,SAAU,WAAW,QAAQ,MAAM,SAmBhE,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,kBAAkB,SAAU,WAAW,UAAU,MAAM,QAAQ,MAAM,SAYjF,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,eAAe,SAAU,WAAW,kBAIhD,CAAC;AAeF,eAAO,MAAM,YAAY,SAAU,WAAW,YAAqE,CAAC;AAmBpH,eAAO,MAAM,UAAU,SAAU,WAAW,QAAQ,QAAQ,SAM3D,CAAC;AAEF,eAAO,MAAM,UAAU,YAAa,OAAO,YAAgE,CAAC;AAI5G;;;GAGG;AACH,eAAO,MAAM,cAAc,SAAU,WAAW,YAgB/C,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Time for today's comments ("10:10 PM"), date and time otherwise ("12 Nov, 10:10 PM"). */
|
|
2
|
+
export declare const formatCommentTime: (iso: string, now?: Date) => string;
|
|
3
|
+
export declare const formatBytes: (bytes: number | null | undefined) => string;
|
|
4
|
+
export declare const initials: (name: string) => string;
|
|
5
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/features/pm-comments/utils/format.ts"],"names":[],"mappings":"AAGA,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,QAAS,MAAM,QAAO,IAAI,WAYvD,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,MAAM,GAAG,IAAI,GAAG,SAAS,WAK3D,CAAC;AAEF,eAAO,MAAM,QAAQ,SAAU,MAAM,WAMxB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The six PM tools Comment Sync covers (PRD scope). */
|
|
2
|
+
export declare const PM_COMMENT_CONNECTOR_TYPES: ReadonlySet<string>;
|
|
3
|
+
export declare const isPmConnectorType: (connectorType?: string | null) => boolean;
|
|
4
|
+
export declare const appLabel: (connectorType?: string | null, fallback?: string) => string;
|
|
5
|
+
/** connectorId → connector type for the workspace's enabled connectors. */
|
|
6
|
+
export declare const useConnectorTypes: (enabled: boolean) => Map<string, string>;
|
|
7
|
+
//# sourceMappingURL=pm-connectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pm-connectors.d.ts","sourceRoot":"","sources":["../../../../src/features/pm-comments/utils/pm-connectors.ts"],"names":[],"mappings":"AAGA,wDAAwD;AACxD,eAAO,MAAM,0BAA0B,EAAE,WAAW,CAAC,MAAM,CAOzD,CAAC;AAEH,eAAO,MAAM,iBAAiB,mBAAoB,MAAM,GAAG,IAAI,YACiB,CAAC;AAWjF,eAAO,MAAM,QAAQ,mBAAoB,MAAM,GAAG,IAAI,8BACkB,CAAC;AAKzE,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,YAAa,OAAO,wBAajD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BodyNode } from '../types/wire';
|
|
2
|
+
/**
|
|
3
|
+
* The composer is a contenteditable (PRD G15: rich text). Its DOM is only ever
|
|
4
|
+
* read through `domToBody`, so whatever the browser or a paste puts in it, the
|
|
5
|
+
* contract gets text, marks, links, mentions, line breaks and lists — nothing
|
|
6
|
+
* else. `bodyToHtml` is the way back, for restoring a draft or inserting a
|
|
7
|
+
* sanitised paste.
|
|
8
|
+
*/
|
|
9
|
+
export declare const MENTION_ATTR = "data-mention-id";
|
|
10
|
+
/** The composer's DOM → the contract's body: trimmed, with blank leading and trailing lines dropped. */
|
|
11
|
+
export declare const domToBody: (root: Node) => BodyNode[];
|
|
12
|
+
export declare const htmlToBody: (html: string) => BodyNode[];
|
|
13
|
+
export declare const mentionHtml: (externalUserId: string, name: string) => string;
|
|
14
|
+
export declare const bodyToHtml: (nodes: BodyNode[]) => string;
|
|
15
|
+
/** Pasted HTML with everything the contract can't carry removed. */
|
|
16
|
+
export declare const sanitizeHtml: (html: string) => string;
|
|
17
|
+
export declare const isBodyEmpty: (nodes: BodyNode[]) => boolean;
|
|
18
|
+
//# sourceMappingURL=rich-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rich-text.d.ts","sourceRoot":"","sources":["../../../../src/features/pm-comments/utils/rich-text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,mCAAmC,CAAC;AAE5E;;;;;;GAMG;AAEH,eAAO,MAAM,YAAY,oBAAoB,CAAC;AA4I9C,wGAAwG;AACxG,eAAO,MAAM,SAAS,SAAU,IAAI,KAAG,QAAQ,EACuB,CAAC;AAEvE,eAAO,MAAM,UAAU,SAAU,MAAM,KAAG,QAAQ,EAIjD,CAAC;AAOF,eAAO,MAAM,WAAW,mBAAoB,MAAM,QAAQ,MAAM,WAC6C,CAAC;AAE9G,eAAO,MAAM,UAAU,UAAW,QAAQ,EAAE,KAAG,MAuBlC,CAAC;AAEd,oEAAoE;AACpE,eAAO,MAAM,YAAY,SAAU,MAAM,WAAiC,CAAC;AAE3E,eAAO,MAAM,WAAW,UAAW,QAAQ,EAAE,YAC4D,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { CommentErrorCode, ReadBlock, TaskAccess } from '../types/wire';
|
|
2
|
+
/**
|
|
3
|
+
* PRD R14: a task's thread is in exactly one read state (what replaces the
|
|
4
|
+
* comment list) and one composer state (what sits below it) at a time. Both
|
|
5
|
+
* come from what the backend reports, never from client-side guesses.
|
|
6
|
+
*/
|
|
7
|
+
export type ThreadReadState = {
|
|
8
|
+
kind: 'loading';
|
|
9
|
+
} | {
|
|
10
|
+
kind: 'fetch_error';
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'hidden';
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'blocked';
|
|
15
|
+
reason: Exclude<ReadBlock, 'comment_sync_off'>;
|
|
16
|
+
} | {
|
|
17
|
+
kind: 'ready';
|
|
18
|
+
};
|
|
19
|
+
export type ComposerState = {
|
|
20
|
+
kind: 'hidden';
|
|
21
|
+
} | {
|
|
22
|
+
kind: 'connect';
|
|
23
|
+
} | {
|
|
24
|
+
kind: 'reconnect';
|
|
25
|
+
} | {
|
|
26
|
+
kind: 'workspace_mismatch';
|
|
27
|
+
} | {
|
|
28
|
+
kind: 'no_access';
|
|
29
|
+
} | {
|
|
30
|
+
kind: 'not_supported';
|
|
31
|
+
} | {
|
|
32
|
+
kind: 'ready';
|
|
33
|
+
};
|
|
34
|
+
type QueryStatus = 'pending' | 'error' | 'success';
|
|
35
|
+
export declare const deriveReadState: (status: QueryStatus, access?: TaskAccess | null) => ThreadReadState;
|
|
36
|
+
export declare const deriveComposerState: (access?: TaskAccess | null) => ComposerState;
|
|
37
|
+
/** A post failure that changes what the rep is allowed to do, rather than one Retry can fix. */
|
|
38
|
+
export declare const accessAfterPostError: (access: TaskAccess, code: CommentErrorCode) => TaskAccess | null;
|
|
39
|
+
/**
|
|
40
|
+
* User-facing copy. Figma wins wherever it has a string (PRD G23/G27, decided
|
|
41
|
+
* 2026-11-18); the rest is the PRD's R4, R5, R11 and R14 copy until Design adds frames.
|
|
42
|
+
*/
|
|
43
|
+
export declare const threadCopy: {
|
|
44
|
+
empty: string;
|
|
45
|
+
addComment: string;
|
|
46
|
+
locked: string;
|
|
47
|
+
signIn: string;
|
|
48
|
+
connectPrompt: string;
|
|
49
|
+
connectApp: (app: string) => string;
|
|
50
|
+
sessionExpired: string;
|
|
51
|
+
signInAgain: string;
|
|
52
|
+
signingIn: string;
|
|
53
|
+
cancel: string;
|
|
54
|
+
switchTitle: (app: string) => string;
|
|
55
|
+
switchBody: (app: string) => string;
|
|
56
|
+
authFailed: (app: string) => string;
|
|
57
|
+
tryAgain: string;
|
|
58
|
+
workspaceMismatch: (workspace?: string | null) => string;
|
|
59
|
+
userNoAccess: (app: string) => string;
|
|
60
|
+
adminNoAccess: string;
|
|
61
|
+
adminDisconnected: (app: string) => string;
|
|
62
|
+
taskNotFound: string;
|
|
63
|
+
unlink: string;
|
|
64
|
+
postingNotSupported: (app: string) => string;
|
|
65
|
+
fetchError: string;
|
|
66
|
+
retry: string;
|
|
67
|
+
failedToSend: string;
|
|
68
|
+
loadOlder: string;
|
|
69
|
+
noMentionMatch: (app: string) => string;
|
|
70
|
+
placeholder: string;
|
|
71
|
+
attachmentUnavailable: string;
|
|
72
|
+
statusLabel: string;
|
|
73
|
+
statusesLoading: string;
|
|
74
|
+
statusesFailed: string;
|
|
75
|
+
statusFailed: string;
|
|
76
|
+
back: string;
|
|
77
|
+
you: string;
|
|
78
|
+
};
|
|
79
|
+
export type BlockedNotice = {
|
|
80
|
+
message: string;
|
|
81
|
+
action?: 'connect' | 'reconnect' | 'unlink';
|
|
82
|
+
actionLabel?: string;
|
|
83
|
+
};
|
|
84
|
+
export declare const blockedNotice: (reason: Exclude<ReadBlock, "comment_sync_off">, app: string, workspaceName?: string | null) => BlockedNotice;
|
|
85
|
+
/** R13 `pm_comments_error_shown.error_type`. */
|
|
86
|
+
export declare const errorTypeForReadBlock: (reason: ReadBlock) => "no_access" | "admin_disconnected" | "task_deleted";
|
|
87
|
+
/** R13 `pm_comment_post_failed.error_type`. */
|
|
88
|
+
export declare const errorTypeForPostError: (code: CommentErrorCode) => "other" | "not_found" | "auth" | "permission" | "rate_limit";
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=thread-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thread-state.d.ts","sourceRoot":"","sources":["../../../../src/features/pm-comments/utils/thread-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAa,SAAS,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE5G;;;;GAIG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACn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