@llumi/design-system 1.0.1 → 2.1.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/LICENSE +51 -0
- package/NOTICE +66 -0
- package/README.md +15 -205
- package/adopt-global-styles-D9108lqB.js +15 -0
- package/base.css +2 -0
- package/base.md +59 -0
- package/bpmn.md +113 -0
- package/bpmn.mjs +5076 -0
- package/copy-button.md +128 -0
- package/copy-button.mjs +161 -0
- package/custom-elements.json +1135 -18
- package/download-button.md +106 -0
- package/download-button.mjs +177 -0
- package/highlighter.md +45 -0
- package/highlighter.mjs +403 -0
- package/icon-button-BwB11RGC.js +5 -0
- package/icons-BaUbjt-v.js +42 -0
- package/index-BEhA78nX.js +7733 -0
- package/llumi-element-BWRwgzW5.js +22 -0
- package/mermaid.md +58 -0
- package/mermaid.mjs +254 -0
- package/package.json +16 -50
- package/review.md +141 -0
- package/review.mjs +2044 -0
- package/slot-text-mSWBdWBc.js +51 -0
- package/theme.css +2 -0
- package/dist/review.cjs +0 -172
- package/dist/review.css +0 -98
- package/dist/review.js +0 -172
- package/dist/review.mjs +0 -1710
- package/dist/types/components/review/comment-dialog.element.d.ts +0 -29
- package/dist/types/components/review/custom-target.utils.d.ts +0 -16
- package/dist/types/components/review/default-editor.element.d.ts +0 -19
- package/dist/types/components/review/highlight-manager.d.ts +0 -21
- package/dist/types/components/review/index.d.ts +0 -8
- package/dist/types/components/review/overall-comment-dialog.element.d.ts +0 -22
- package/dist/types/components/review/review-bar.element.d.ts +0 -26
- package/dist/types/components/review/review.element.d.ts +0 -60
- package/dist/types/components/review/review.machine.d.ts +0 -234
- package/dist/types/components/review/review.persistence.d.ts +0 -16
- package/dist/types/components/review/review.type.d.ts +0 -37
- package/dist/types/components/review/selection-comment-icons.element.d.ts +0 -17
- package/dist/types/components/review/selection-range.utils.d.ts +0 -6
- package/dist/types/components/review/sort-comments.utils.d.ts +0 -6
- package/dist/types/index.d.ts +0 -1
- package/dist/types/shared/cn.d.ts +0 -2
- package/dist/types/shared/icons.d.ts +0 -7
- package/dist/types/shared/tailwind-element.d.ts +0 -4
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ReferenceElement } from '@floating-ui/dom';
|
|
2
|
-
import { PropertyValues } from 'lit';
|
|
3
|
-
import { TailwindElement } from '../../shared/tailwind-element';
|
|
4
|
-
export declare class LlumiCommentDialog extends TailwindElement {
|
|
5
|
-
targetElement: HTMLElement | null;
|
|
6
|
-
/**
|
|
7
|
-
* Optional positioning reference that overrides `targetElement` — used for
|
|
8
|
-
* text-selection comments, where the dialog must anchor to the selected
|
|
9
|
-
* range's rect rather than the whole (potentially tall) selectable element.
|
|
10
|
-
* A floating-ui virtual element (`{ getBoundingClientRect() }`) is accepted.
|
|
11
|
-
*/
|
|
12
|
-
anchor: ReferenceElement | null;
|
|
13
|
-
value: string;
|
|
14
|
-
private floating;
|
|
15
|
-
private cleanup?;
|
|
16
|
-
render(): import('lit').TemplateResult<1>;
|
|
17
|
-
private onEditorChange;
|
|
18
|
-
private onCancel;
|
|
19
|
-
private onDelete;
|
|
20
|
-
private startPositioning;
|
|
21
|
-
updated(changed: PropertyValues): void;
|
|
22
|
-
private focusEditor;
|
|
23
|
-
disconnectedCallback(): void;
|
|
24
|
-
}
|
|
25
|
-
declare global {
|
|
26
|
-
interface HTMLElementTagNameMap {
|
|
27
|
-
"llumi-comment-dialog": LlumiCommentDialog;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface CustomTarget {
|
|
2
|
-
selector: string;
|
|
3
|
-
toId: (element: HTMLElement) => string | null;
|
|
4
|
-
}
|
|
5
|
-
export declare function resolveTargetId(el: HTMLElement, customTargets?: CustomTarget[]): string | null;
|
|
6
|
-
export declare function findClosestTarget(from: HTMLElement, customTargets?: CustomTarget[]): {
|
|
7
|
-
element: HTMLElement;
|
|
8
|
-
targetId: string;
|
|
9
|
-
} | null;
|
|
10
|
-
export type TargetKind = "element" | "selectable" | "both";
|
|
11
|
-
export type ResolvedTarget = {
|
|
12
|
-
element: HTMLElement;
|
|
13
|
-
targetId: string;
|
|
14
|
-
kind: TargetKind;
|
|
15
|
-
};
|
|
16
|
-
export declare function queryAllTargets(wrapper: HTMLElement, customTargets?: CustomTarget[]): ResolvedTarget[];
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { TailwindElement } from '../../shared/tailwind-element';
|
|
2
|
-
export declare class LlumiDefaultEditor extends TailwindElement {
|
|
3
|
-
value: string;
|
|
4
|
-
autoFocus: boolean;
|
|
5
|
-
placeholder: string;
|
|
6
|
-
private textarea;
|
|
7
|
-
/** Focus the inner textarea (the element itself isn't focusable). */
|
|
8
|
-
focus(): void;
|
|
9
|
-
render(): import('lit').TemplateResult<1>;
|
|
10
|
-
private onInput;
|
|
11
|
-
private autoGrow;
|
|
12
|
-
firstUpdated(): void;
|
|
13
|
-
updated(): void;
|
|
14
|
-
}
|
|
15
|
-
declare global {
|
|
16
|
-
interface HTMLElementTagNameMap {
|
|
17
|
-
"llumi-default-editor": LlumiDefaultEditor;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { CustomTarget } from './custom-target.utils';
|
|
2
|
-
export interface ObserveCallbacks {
|
|
3
|
-
editingTarget?: HTMLElement | null;
|
|
4
|
-
onTargetDisconnected: () => void;
|
|
5
|
-
onSelectableReconnected: () => void;
|
|
6
|
-
commentedIds: Set<string>;
|
|
7
|
-
}
|
|
8
|
-
export declare function createHighlightManager(wrapper: HTMLElement, customTargets?: CustomTarget[]): {
|
|
9
|
-
activate: (commentedIds: Set<string>) => void;
|
|
10
|
-
deactivate: () => void;
|
|
11
|
-
reveal: (flash: boolean) => void;
|
|
12
|
-
unreveal: () => void;
|
|
13
|
-
setEditing: (target: HTMLElement, isSelection: boolean) => void;
|
|
14
|
-
clearEditing: (target: HTMLElement, hasComment: boolean) => void;
|
|
15
|
-
applyHover: (element: HTMLElement, editingTargetId?: string) => void;
|
|
16
|
-
clearHover: (element: HTMLElement, editingTargetId?: string, commentedIds?: Set<string>) => void;
|
|
17
|
-
startObserving: (callbacks: ObserveCallbacks) => void;
|
|
18
|
-
stopObserving: () => void;
|
|
19
|
-
destroy: () => void;
|
|
20
|
-
};
|
|
21
|
-
export type HighlightManager = ReturnType<typeof createHighlightManager>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { LlumiCommentDialog } from './comment-dialog.element';
|
|
2
|
-
export type { CustomTarget } from './custom-target.utils';
|
|
3
|
-
export { LlumiDefaultEditor } from './default-editor.element';
|
|
4
|
-
export { LlumiOverallCommentDialog } from './overall-comment-dialog.element';
|
|
5
|
-
export { LlumiReview } from './review.element';
|
|
6
|
-
export type { ReviewBarPosition, ReviewComment, ReviewEditorContract, ReviewMode, ReviewResult, SelectionRange, } from './review.type';
|
|
7
|
-
export { LlumiReviewBar } from './review-bar.element';
|
|
8
|
-
export { LlumiSelectionCommentIcons } from './selection-comment-icons.element';
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { PropertyValues } from 'lit';
|
|
2
|
-
import { TailwindElement } from '../../shared/tailwind-element';
|
|
3
|
-
export declare class LlumiOverallCommentDialog extends TailwindElement {
|
|
4
|
-
barElement: HTMLElement | null;
|
|
5
|
-
value: string;
|
|
6
|
-
private floating;
|
|
7
|
-
private cleanup?;
|
|
8
|
-
private onDocKeydown;
|
|
9
|
-
private onDocPointerdown;
|
|
10
|
-
render(): import('lit').TemplateResult<1>;
|
|
11
|
-
private onEditorChange;
|
|
12
|
-
private emitClose;
|
|
13
|
-
private startPositioning;
|
|
14
|
-
connectedCallback(): void;
|
|
15
|
-
updated(changed: PropertyValues): void;
|
|
16
|
-
disconnectedCallback(): void;
|
|
17
|
-
}
|
|
18
|
-
declare global {
|
|
19
|
-
interface HTMLElementTagNameMap {
|
|
20
|
-
"llumi-overall-comment-dialog": LlumiOverallCommentDialog;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { TailwindElement } from '../../shared/tailwind-element';
|
|
2
|
-
import { ReviewBarPosition, ReviewMode } from './review.type';
|
|
3
|
-
export declare class LlumiReviewBar extends TailwindElement {
|
|
4
|
-
mode: ReviewMode;
|
|
5
|
-
commentCount: number;
|
|
6
|
-
hasOverallComment: boolean;
|
|
7
|
-
overallCommentOpen: boolean;
|
|
8
|
-
barPosition: ReviewBarPosition;
|
|
9
|
-
private bar;
|
|
10
|
-
private dragOffset;
|
|
11
|
-
private dragStart;
|
|
12
|
-
get barRoot(): HTMLElement | null;
|
|
13
|
-
render(): import('lit').TemplateResult<1>;
|
|
14
|
-
private onToggle;
|
|
15
|
-
private onOverallToggle;
|
|
16
|
-
private onSubmit;
|
|
17
|
-
private onDragStart;
|
|
18
|
-
private onDragMove;
|
|
19
|
-
private onDragEnd;
|
|
20
|
-
disconnectedCallback(): void;
|
|
21
|
-
}
|
|
22
|
-
declare global {
|
|
23
|
-
interface HTMLElementTagNameMap {
|
|
24
|
-
"llumi-review-bar": LlumiReviewBar;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { CustomTarget } from './custom-target.utils';
|
|
2
|
-
import { ReviewResult } from './review.type';
|
|
3
|
-
/**
|
|
4
|
-
* `<llumi-review>` — wraps light-DOM content for element- and text-selection
|
|
5
|
-
* review comments. Both events bubble and are composed.
|
|
6
|
-
*
|
|
7
|
-
* @attr {string} persist - When set to a non-empty value, persists the review draft to
|
|
8
|
-
* localStorage under that key and restores it on load. Read once on connect.
|
|
9
|
-
* @fires llumi-review-change - On every edit (comment added/edited/deleted, or overall comment changed). `detail` is a `ReviewResult`.
|
|
10
|
-
* @fires llumi-review-submit - When the user clicks Submit / Approve. `detail` is `{ result: ReviewResult, clearPersisted: () => void }`; call `clearPersisted()` after a confirmed server save to discard the persisted draft.
|
|
11
|
-
*/
|
|
12
|
-
export declare class LlumiReview extends HTMLElement {
|
|
13
|
-
static observedAttributes: string[];
|
|
14
|
-
initialData?: ReviewResult;
|
|
15
|
-
customTargets?: CustomTarget[];
|
|
16
|
-
private actor;
|
|
17
|
-
private persistence;
|
|
18
|
-
private manager;
|
|
19
|
-
private rangeMap;
|
|
20
|
-
private hoveredComment;
|
|
21
|
-
private selectionJustHandled;
|
|
22
|
-
private selectionComments;
|
|
23
|
-
private bar;
|
|
24
|
-
private commentDialog;
|
|
25
|
-
private commentDialogAnchorId;
|
|
26
|
-
private overallDialog;
|
|
27
|
-
private icons;
|
|
28
|
-
private get shortcut();
|
|
29
|
-
private get barPosition();
|
|
30
|
-
private get defaultMode();
|
|
31
|
-
private get persistKey();
|
|
32
|
-
connectedCallback(): void;
|
|
33
|
-
disconnectedCallback(): void;
|
|
34
|
-
attributeChangedCallback(): void;
|
|
35
|
-
private buildDetailResult;
|
|
36
|
-
private emitChange;
|
|
37
|
-
private emitSubmit;
|
|
38
|
-
/** Clears the persisted draft for this element. No-op when persistence is off. */
|
|
39
|
-
clearPersisted(): void;
|
|
40
|
-
private selectionAnchor;
|
|
41
|
-
private mountChrome;
|
|
42
|
-
private onIconClick;
|
|
43
|
-
private syncFromSnapshot;
|
|
44
|
-
private buildHighlightCallbacks;
|
|
45
|
-
private updateSelectionHighlights;
|
|
46
|
-
private isAnnotating;
|
|
47
|
-
private caretPosition;
|
|
48
|
-
private onPointerUp;
|
|
49
|
-
private onPointerMove;
|
|
50
|
-
private onClickCapture;
|
|
51
|
-
private onWrapperClick;
|
|
52
|
-
private currentEditingTargetId;
|
|
53
|
-
private onMouseOver;
|
|
54
|
-
private onMouseOut;
|
|
55
|
-
}
|
|
56
|
-
declare global {
|
|
57
|
-
interface HTMLElementTagNameMap {
|
|
58
|
-
"llumi-review": LlumiReview;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import { ReviewPersistence } from './review.persistence';
|
|
2
|
-
import { ReviewComment, ReviewResult, SelectionRange } from './review.type';
|
|
3
|
-
export interface HighlightCallbacks {
|
|
4
|
-
activate: (commentedIds: Set<string>) => void;
|
|
5
|
-
deactivate: () => void;
|
|
6
|
-
reveal: (flash: boolean) => void;
|
|
7
|
-
unreveal: () => void;
|
|
8
|
-
setEditing: (target: HTMLElement, isSelection: boolean) => void;
|
|
9
|
-
clearEditing: (target: HTMLElement, hasComment: boolean) => void;
|
|
10
|
-
}
|
|
11
|
-
type ReviewMachineContext = {
|
|
12
|
-
comments: ReviewComment[];
|
|
13
|
-
overallComment: string;
|
|
14
|
-
editingCommentId: string | null;
|
|
15
|
-
targetElement: HTMLElement | null;
|
|
16
|
-
selectionRange: SelectionRange | null;
|
|
17
|
-
shortcut: string;
|
|
18
|
-
defaultMode: "idle" | "annotating";
|
|
19
|
-
highlights: HighlightCallbacks;
|
|
20
|
-
persistence: ReviewPersistence;
|
|
21
|
-
};
|
|
22
|
-
type ReviewMachineEvents = {
|
|
23
|
-
type: "TOGGLE";
|
|
24
|
-
} | {
|
|
25
|
-
type: "HOLD_ANNOTATE";
|
|
26
|
-
} | {
|
|
27
|
-
type: "RELEASE_ANNOTATE";
|
|
28
|
-
} | {
|
|
29
|
-
type: "CLICK";
|
|
30
|
-
targetId?: string;
|
|
31
|
-
element?: HTMLElement;
|
|
32
|
-
selectionCommentId?: string;
|
|
33
|
-
} | {
|
|
34
|
-
type: "SELECT_TEXT";
|
|
35
|
-
targetId: string;
|
|
36
|
-
targetElement: HTMLElement;
|
|
37
|
-
selectionRange: SelectionRange;
|
|
38
|
-
} | {
|
|
39
|
-
type: "COMMENT_CHANGE";
|
|
40
|
-
content: string;
|
|
41
|
-
} | {
|
|
42
|
-
type: "DELETE";
|
|
43
|
-
} | {
|
|
44
|
-
type: "CLOSE";
|
|
45
|
-
} | {
|
|
46
|
-
type: "SUBMIT";
|
|
47
|
-
} | {
|
|
48
|
-
type: "TARGET_DISCONNECTED";
|
|
49
|
-
} | {
|
|
50
|
-
type: "OPEN_OVERALL";
|
|
51
|
-
} | {
|
|
52
|
-
type: "MOUNTED";
|
|
53
|
-
};
|
|
54
|
-
export type ReviewMachineEmitted = {
|
|
55
|
-
type: "REVIEW_CHANGED";
|
|
56
|
-
result: ReviewResult;
|
|
57
|
-
} | {
|
|
58
|
-
type: "REVIEW_SUBMITTED";
|
|
59
|
-
result: ReviewResult;
|
|
60
|
-
};
|
|
61
|
-
type ReviewMachineInput = {
|
|
62
|
-
shortcut: string;
|
|
63
|
-
initialData?: ReviewResult;
|
|
64
|
-
defaultMode: "idle" | "annotating";
|
|
65
|
-
highlights: HighlightCallbacks;
|
|
66
|
-
persistence: ReviewPersistence;
|
|
67
|
-
};
|
|
68
|
-
export declare function buildReviewResult(context: Pick<ReviewMachineContext, "comments" | "overallComment">): ReviewResult;
|
|
69
|
-
export declare function createReviewMachine(): import('xstate').StateMachine<ReviewMachineContext, {
|
|
70
|
-
type: "TOGGLE";
|
|
71
|
-
} | {
|
|
72
|
-
type: "HOLD_ANNOTATE";
|
|
73
|
-
} | {
|
|
74
|
-
type: "RELEASE_ANNOTATE";
|
|
75
|
-
} | {
|
|
76
|
-
type: "CLICK";
|
|
77
|
-
targetId?: string;
|
|
78
|
-
element?: HTMLElement;
|
|
79
|
-
selectionCommentId?: string;
|
|
80
|
-
} | {
|
|
81
|
-
type: "SELECT_TEXT";
|
|
82
|
-
targetId: string;
|
|
83
|
-
targetElement: HTMLElement;
|
|
84
|
-
selectionRange: SelectionRange;
|
|
85
|
-
} | {
|
|
86
|
-
type: "COMMENT_CHANGE";
|
|
87
|
-
content: string;
|
|
88
|
-
} | {
|
|
89
|
-
type: "DELETE";
|
|
90
|
-
} | {
|
|
91
|
-
type: "CLOSE";
|
|
92
|
-
} | {
|
|
93
|
-
type: "SUBMIT";
|
|
94
|
-
} | {
|
|
95
|
-
type: "TARGET_DISCONNECTED";
|
|
96
|
-
} | {
|
|
97
|
-
type: "OPEN_OVERALL";
|
|
98
|
-
} | {
|
|
99
|
-
type: "MOUNTED";
|
|
100
|
-
}, {
|
|
101
|
-
[x: string]: import('xstate').ActorRefFromLogic<import('xstate').CallbackActorLogic<ReviewMachineEvents, {
|
|
102
|
-
targetElement: HTMLElement;
|
|
103
|
-
wrapperElement: HTMLElement;
|
|
104
|
-
}, import('xstate').EventObject>> | undefined;
|
|
105
|
-
keyboard?: import('xstate').ActorRefFromLogic<import('xstate').CallbackActorLogic<ReviewMachineEvents, {
|
|
106
|
-
shortcut: string;
|
|
107
|
-
}, import('xstate').EventObject>> | undefined;
|
|
108
|
-
}, {
|
|
109
|
-
src: "keyboardActor";
|
|
110
|
-
logic: import('xstate').CallbackActorLogic<ReviewMachineEvents, {
|
|
111
|
-
shortcut: string;
|
|
112
|
-
}, import('xstate').EventObject>;
|
|
113
|
-
id: "keyboard";
|
|
114
|
-
} | {
|
|
115
|
-
src: "mutationObserverActor";
|
|
116
|
-
logic: import('xstate').CallbackActorLogic<ReviewMachineEvents, {
|
|
117
|
-
targetElement: HTMLElement;
|
|
118
|
-
wrapperElement: HTMLElement;
|
|
119
|
-
}, import('xstate').EventObject>;
|
|
120
|
-
id: string | undefined;
|
|
121
|
-
}, {
|
|
122
|
-
type: "openElementComment";
|
|
123
|
-
params: import('xstate').NonReducibleUnknown;
|
|
124
|
-
} | {
|
|
125
|
-
type: "openSelectionComment";
|
|
126
|
-
params: import('xstate').NonReducibleUnknown;
|
|
127
|
-
} | {
|
|
128
|
-
type: "createSelectionComment";
|
|
129
|
-
params: import('xstate').NonReducibleUnknown;
|
|
130
|
-
} | {
|
|
131
|
-
type: "updateContent";
|
|
132
|
-
params: import('xstate').NonReducibleUnknown;
|
|
133
|
-
} | {
|
|
134
|
-
type: "deleteComment";
|
|
135
|
-
params: import('xstate').NonReducibleUnknown;
|
|
136
|
-
} | {
|
|
137
|
-
type: "cleanup";
|
|
138
|
-
params: import('xstate').NonReducibleUnknown;
|
|
139
|
-
} | {
|
|
140
|
-
type: "emitChanged";
|
|
141
|
-
params: import('xstate').NonReducibleUnknown;
|
|
142
|
-
} | {
|
|
143
|
-
type: "persistSave";
|
|
144
|
-
params: unknown;
|
|
145
|
-
} | {
|
|
146
|
-
type: "emitSubmitted";
|
|
147
|
-
params: import('xstate').NonReducibleUnknown;
|
|
148
|
-
} | {
|
|
149
|
-
type: "highlightsActivate";
|
|
150
|
-
params: unknown;
|
|
151
|
-
} | {
|
|
152
|
-
type: "highlightsDeactivate";
|
|
153
|
-
params: unknown;
|
|
154
|
-
} | {
|
|
155
|
-
type: "highlightsRevealFlash";
|
|
156
|
-
params: unknown;
|
|
157
|
-
} | {
|
|
158
|
-
type: "highlightsReveal";
|
|
159
|
-
params: unknown;
|
|
160
|
-
} | {
|
|
161
|
-
type: "highlightsUnreveal";
|
|
162
|
-
params: unknown;
|
|
163
|
-
} | {
|
|
164
|
-
type: "editingTargetSet";
|
|
165
|
-
params: unknown;
|
|
166
|
-
} | {
|
|
167
|
-
type: "editingTargetCleared";
|
|
168
|
-
params: unknown;
|
|
169
|
-
}, {
|
|
170
|
-
type: "isCommentingEditing";
|
|
171
|
-
params: import('xstate').NonReducibleUnknown;
|
|
172
|
-
} | {
|
|
173
|
-
type: "hasSelectionCommentId";
|
|
174
|
-
params: unknown;
|
|
175
|
-
} | {
|
|
176
|
-
type: "hasTargetId";
|
|
177
|
-
params: unknown;
|
|
178
|
-
} | {
|
|
179
|
-
type: "hasNoTarget";
|
|
180
|
-
params: unknown;
|
|
181
|
-
} | {
|
|
182
|
-
type: "isSameComment";
|
|
183
|
-
params: unknown;
|
|
184
|
-
}, "flashDuration", {
|
|
185
|
-
commenting: "idle" | {
|
|
186
|
-
editing: "element" | "selection";
|
|
187
|
-
};
|
|
188
|
-
annotating: "waitingForMount" | "inactive" | {
|
|
189
|
-
toggled: "flashing" | "ready" | "revealing";
|
|
190
|
-
} | {
|
|
191
|
-
held: "revealing" | "lingering";
|
|
192
|
-
};
|
|
193
|
-
}, string, ReviewMachineInput, import('xstate').NonReducibleUnknown, {
|
|
194
|
-
type: "REVIEW_CHANGED";
|
|
195
|
-
result: ReviewResult;
|
|
196
|
-
} | {
|
|
197
|
-
type: "REVIEW_SUBMITTED";
|
|
198
|
-
result: ReviewResult;
|
|
199
|
-
}, import('xstate').MetaObject, {
|
|
200
|
-
id: "review";
|
|
201
|
-
states: {
|
|
202
|
-
readonly annotating: {
|
|
203
|
-
states: {
|
|
204
|
-
readonly waitingForMount: {};
|
|
205
|
-
readonly inactive: {};
|
|
206
|
-
readonly toggled: {
|
|
207
|
-
states: {
|
|
208
|
-
readonly flashing: {};
|
|
209
|
-
readonly ready: {};
|
|
210
|
-
readonly revealing: {};
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
readonly held: {
|
|
214
|
-
states: {
|
|
215
|
-
readonly revealing: {};
|
|
216
|
-
readonly lingering: {};
|
|
217
|
-
};
|
|
218
|
-
};
|
|
219
|
-
};
|
|
220
|
-
};
|
|
221
|
-
readonly commenting: {
|
|
222
|
-
states: {
|
|
223
|
-
readonly idle: {};
|
|
224
|
-
readonly editing: {
|
|
225
|
-
states: {
|
|
226
|
-
readonly element: {};
|
|
227
|
-
readonly selection: {};
|
|
228
|
-
};
|
|
229
|
-
};
|
|
230
|
-
};
|
|
231
|
-
};
|
|
232
|
-
};
|
|
233
|
-
}>;
|
|
234
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ReviewResult } from './review.type';
|
|
2
|
-
/**
|
|
3
|
-
* Storage engine for `<llumi-review>` drafts. Injected into the review machine
|
|
4
|
-
* via input (mirrors `HighlightCallbacks`). All access is best-effort: it never
|
|
5
|
-
* throws into the component.
|
|
6
|
-
*/
|
|
7
|
-
export interface ReviewPersistence {
|
|
8
|
-
/** Read + parse + validate. Returns undefined on miss or corruption. */
|
|
9
|
-
load(): ReviewResult | undefined;
|
|
10
|
-
/** Write JSON. An empty/`approved` result removes the key instead. */
|
|
11
|
-
save(result: ReviewResult): void;
|
|
12
|
-
/** Remove the stored draft. */
|
|
13
|
-
clear(): void;
|
|
14
|
-
}
|
|
15
|
-
export declare const noopPersistence: ReviewPersistence;
|
|
16
|
-
export declare function createReviewPersistence(key: string): ReviewPersistence;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export interface SelectionRange {
|
|
2
|
-
startOffset: number;
|
|
3
|
-
endOffset: number;
|
|
4
|
-
selectedText: string;
|
|
5
|
-
matchIndex: number;
|
|
6
|
-
}
|
|
7
|
-
export interface ReviewComment {
|
|
8
|
-
commentId: string;
|
|
9
|
-
targetId: string;
|
|
10
|
-
content: string;
|
|
11
|
-
createdAt: string;
|
|
12
|
-
selection?: SelectionRange;
|
|
13
|
-
}
|
|
14
|
-
export type ReviewResult = {
|
|
15
|
-
status: "approved";
|
|
16
|
-
} | {
|
|
17
|
-
status: "commented";
|
|
18
|
-
comments: ReviewComment[];
|
|
19
|
-
overallComment?: string;
|
|
20
|
-
};
|
|
21
|
-
export interface ReviewSubmitDetail {
|
|
22
|
-
result: ReviewResult;
|
|
23
|
-
/** Clears the persisted draft for this element. No-op when persistence is off. */
|
|
24
|
-
clearPersisted: () => void;
|
|
25
|
-
}
|
|
26
|
-
export type ReviewBarPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
27
|
-
export type ReviewMode = "idle" | "commenting" | "editing";
|
|
28
|
-
/**
|
|
29
|
-
* Contract a slotted custom editor must honor:
|
|
30
|
-
* - receives the current `value` as a property
|
|
31
|
-
* - emits `change` (detail: string), `cancel`, and `delete` CustomEvents (bubbling, composed)
|
|
32
|
-
*/
|
|
33
|
-
export interface ReviewEditorContract extends HTMLElement {
|
|
34
|
-
value: string;
|
|
35
|
-
autoFocus?: boolean;
|
|
36
|
-
placeholder?: string;
|
|
37
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { TailwindElement } from '../../shared/tailwind-element';
|
|
2
|
-
interface IconPosition {
|
|
3
|
-
commentId: string;
|
|
4
|
-
top: number;
|
|
5
|
-
left: number;
|
|
6
|
-
}
|
|
7
|
-
export declare class LlumiSelectionCommentIcons extends TailwindElement {
|
|
8
|
-
positions: IconPosition[];
|
|
9
|
-
render(): import('lit').TemplateResult<1>;
|
|
10
|
-
private onClick;
|
|
11
|
-
}
|
|
12
|
-
declare global {
|
|
13
|
-
interface HTMLElementTagNameMap {
|
|
14
|
-
"llumi-selection-comment-icons": LlumiSelectionCommentIcons;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SelectionRange } from './review.type';
|
|
2
|
-
export declare function computeSelectionRange(target: HTMLElement): SelectionRange | null;
|
|
3
|
-
export declare function restoreRange(target: HTMLElement, selectionRange: SelectionRange): Range | null;
|
|
4
|
-
export declare function isSelectionWithinTarget(selection: Selection, target: HTMLElement): boolean;
|
|
5
|
-
export declare function findSelectableTarget(node: Node): HTMLElement | null;
|
|
6
|
-
export declare function clampSelectionToTarget(selection: Selection, target: HTMLElement): Range | null;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ReviewComment } from './review.type';
|
|
2
|
-
/**
|
|
3
|
-
* Sort comments by their DOM position within the wrapper.
|
|
4
|
-
* Falls back to original order if elements are not found.
|
|
5
|
-
*/
|
|
6
|
-
export declare function sortCommentsByDomPosition(comments: ReviewComment[], wrapper: HTMLElement): ReviewComment[];
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/review/index';
|