@unofficialbox/box-open-elements 0.11.0 → 0.13.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/dist/components/feedback/alert.d.ts +2 -0
- package/dist/components/feedback/alert.js +41 -8
- package/dist/components/feedback/indicator.d.ts +34 -0
- package/dist/components/feedback/indicator.js +167 -0
- package/dist/components/feedback/nudge.js +0 -1
- package/dist/components/feedback/toast.d.ts +4 -5
- package/dist/components/feedback/toast.js +19 -46
- package/dist/components/feedback/tone.d.ts +18 -0
- package/dist/components/feedback/tone.js +23 -0
- package/dist/components/forms/calendar.d.ts +25 -0
- package/dist/components/forms/calendar.js +94 -2
- package/dist/components/forms/tile-group.d.ts +58 -0
- package/dist/components/forms/tile-group.js +280 -0
- package/dist/components/output/code-block.d.ts +49 -0
- package/dist/components/output/code-block.js +236 -0
- package/dist/components/output/formatted-date.d.ts +38 -0
- package/dist/components/output/formatted-date.js +90 -0
- package/dist/components/output/formatted-file-size.d.ts +31 -0
- package/dist/components/output/formatted-file-size.js +61 -0
- package/dist/components/output/formatted-number.d.ts +37 -0
- package/dist/components/output/formatted-number.js +106 -0
- package/dist/components/output/formatted-value.d.ts +44 -0
- package/dist/components/output/formatted-value.js +100 -0
- package/dist/components/output/index.d.ts +6 -0
- package/dist/components/output/index.js +9 -0
- package/dist/components/output/relative-time.d.ts +41 -0
- package/dist/components/output/relative-time.js +82 -0
- package/dist/element-maps.d.ts +17 -1
- package/dist/entries/code-block.d.ts +1 -0
- package/dist/entries/code-block.js +1 -0
- package/dist/entries/comment-thread.d.ts +1 -0
- package/dist/entries/comment-thread.js +1 -0
- package/dist/entries/formatted-date.d.ts +1 -0
- package/dist/entries/formatted-date.js +1 -0
- package/dist/entries/formatted-file-size.d.ts +1 -0
- package/dist/entries/formatted-file-size.js +1 -0
- package/dist/entries/formatted-number.d.ts +1 -0
- package/dist/entries/formatted-number.js +1 -0
- package/dist/entries/indicator.d.ts +1 -0
- package/dist/entries/indicator.js +1 -0
- package/dist/entries/relative-time.d.ts +1 -0
- package/dist/entries/relative-time.js +1 -0
- package/dist/entries/tile-group.d.ts +1 -0
- package/dist/entries/tile-group.js +1 -0
- package/dist/foundations/format/format.d.ts +82 -0
- package/dist/foundations/format/format.js +122 -0
- package/dist/foundations/format/index.d.ts +1 -0
- package/dist/foundations/format/index.js +3 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +12 -0
- package/dist/patterns/comments/comment-thread.d.ts +79 -0
- package/dist/patterns/comments/comment-thread.js +561 -0
- package/dist/patterns/comments/index.d.ts +2 -0
- package/dist/patterns/comments/index.js +5 -0
- package/dist/patterns/comments/types.d.ts +39 -0
- package/dist/patterns/comments/types.js +8 -0
- package/dist/patterns/preview/annotation-thread.d.ts +67 -48
- package/dist/patterns/preview/annotation-thread.js +96 -440
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The comment model.
|
|
3
|
+
*
|
|
4
|
+
* Kept separate from the component so the data contract does not depend on the
|
|
5
|
+
* class: a host that only transports comments — a controller, an adapter, a
|
|
6
|
+
* server route — imports these without pulling a custom element in with them.
|
|
7
|
+
*/
|
|
8
|
+
/** A button offered beneath the thread, e.g. "Resolve" or "Delete". */
|
|
9
|
+
export type CommentAction = {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
tone?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* One comment.
|
|
16
|
+
*
|
|
17
|
+
* `badge` is the generic pill beside the author — whatever short qualifier the
|
|
18
|
+
* surface wants to show. `box-annotation-thread` maps its own `toolLabel` onto
|
|
19
|
+
* it, which is why the base model does not name it after annotation tools.
|
|
20
|
+
*/
|
|
21
|
+
export type CommentEntry = {
|
|
22
|
+
author: string;
|
|
23
|
+
badge?: string;
|
|
24
|
+
body: string;
|
|
25
|
+
createdAt?: string;
|
|
26
|
+
id: string;
|
|
27
|
+
initials?: string;
|
|
28
|
+
status?: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* A composed comment, before it has an id.
|
|
32
|
+
*
|
|
33
|
+
* `inReplyToId` carries the selected entry, so the same event serves both a new
|
|
34
|
+
* top-level comment and a reply — the host decides which by reading it.
|
|
35
|
+
*/
|
|
36
|
+
export type CommentSubmittedDetail = {
|
|
37
|
+
body: string;
|
|
38
|
+
inReplyToId: string | null;
|
|
39
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The comment model.
|
|
3
|
+
*
|
|
4
|
+
* Kept separate from the component so the data contract does not depend on the
|
|
5
|
+
* class: a host that only transports comments — a controller, an adapter, a
|
|
6
|
+
* server route — imports these without pulling a custom element in with them.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
@@ -1,57 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { CommentThread } from "../comments/index.js";
|
|
2
|
+
import type { CommentAction, CommentEntry, CommentSubmittedDetail } from "../comments/index.js";
|
|
3
|
+
/** @deprecated Prefer `CommentAction`; kept so existing hosts keep compiling. */
|
|
4
|
+
export type AnnotationThreadAction = CommentAction;
|
|
5
|
+
/** @deprecated Prefer `CommentSubmittedDetail`. */
|
|
6
|
+
export type AnnotationThreadEntrySubmittedDetail = CommentSubmittedDetail;
|
|
7
|
+
/**
|
|
8
|
+
* An annotation comment.
|
|
9
|
+
*
|
|
10
|
+
* A comment plus `toolLabel` — which annotation tool produced it (highlight,
|
|
11
|
+
* draw, stamp). That field is the only thing an annotation entry adds, which is
|
|
12
|
+
* why the rest of the model lives in `patterns/comments`.
|
|
13
|
+
*/
|
|
14
|
+
export type AnnotationThreadEntry = CommentEntry & {
|
|
14
15
|
toolLabel?: string;
|
|
15
16
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Where in the document a thread is attached.
|
|
19
|
+
*
|
|
20
|
+
* Every field is optional because anchors arrive in different shapes: a page
|
|
21
|
+
* number alone for a page-level note, a region for a drawn box, a quote for
|
|
22
|
+
* selected text. A thread with no anchor at all is a comment, and belongs on
|
|
23
|
+
* `box-comment-thread` instead.
|
|
24
|
+
*/
|
|
25
|
+
export type AnnotationAnchor = {
|
|
26
|
+
page?: number;
|
|
27
|
+
quote?: string;
|
|
28
|
+
region?: {
|
|
29
|
+
height: number;
|
|
30
|
+
width: number;
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
};
|
|
19
34
|
};
|
|
20
|
-
|
|
35
|
+
/**
|
|
36
|
+
* A comment thread anchored to a place in a document.
|
|
37
|
+
*
|
|
38
|
+
* This is `box-comment-thread` plus the anchor. The distinction is the whole
|
|
39
|
+
* point: comments stand on their own — on a file, a task, a contract clause —
|
|
40
|
+
* and only become annotations when something ties them to a page, a region, or
|
|
41
|
+
* a run of selected text. Hosts that want the former should reach for
|
|
42
|
+
* `box-comment-thread` directly rather than for an annotation with no anchor.
|
|
43
|
+
*
|
|
44
|
+
* Every attribute, part and event of the underlying thread is inherited
|
|
45
|
+
* unchanged, so this remains a drop-in for the previous implementation.
|
|
46
|
+
*/
|
|
47
|
+
export declare class AnnotationThread extends CommentThread {
|
|
21
48
|
static readonly tagName: string;
|
|
22
49
|
static get observedAttributes(): string[];
|
|
23
|
-
private
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
50
|
+
private anchorEl;
|
|
51
|
+
protected threadStyles(): string;
|
|
52
|
+
protected headerExtras(): string;
|
|
53
|
+
protected defaultHeading(): string;
|
|
54
|
+
protected emptyText(): string;
|
|
55
|
+
protected defaultComposerLabel(): string;
|
|
56
|
+
protected defaultPlaceholder(): string;
|
|
57
|
+
/**
|
|
58
|
+
* Annotations name their pill `toolLabel`. Mapping it here keeps that
|
|
59
|
+
* vocabulary for existing hosts while the base model stays generic.
|
|
60
|
+
*/
|
|
61
|
+
protected entryBadge(entry: AnnotationThreadEntry): string | undefined;
|
|
62
|
+
/** Where in the document this thread sits. Null when unanchored. */
|
|
63
|
+
get anchor(): AnnotationAnchor | null;
|
|
64
|
+
set anchor(value: AnnotationAnchor | null);
|
|
36
65
|
get entries(): AnnotationThreadEntry[];
|
|
37
66
|
set entries(value: AnnotationThreadEntry[]);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
private
|
|
46
|
-
private emitEntrySelected;
|
|
47
|
-
private submitComposer;
|
|
48
|
-
private entriesKey;
|
|
49
|
-
private actionsKey;
|
|
50
|
-
private rebuildEntries;
|
|
51
|
-
private patchEntrySelection;
|
|
52
|
-
private rebuildActions;
|
|
53
|
-
private patchActionLabels;
|
|
54
|
-
protected renderTemplate(): void;
|
|
55
|
-
protected setupListeners(): void;
|
|
67
|
+
/**
|
|
68
|
+
* The anchor in words.
|
|
69
|
+
*
|
|
70
|
+
* A region is described by its page rather than by its coordinates: the
|
|
71
|
+
* numbers locate the highlight for the renderer, but they tell a reader
|
|
72
|
+
* nothing, and a screen reader least of all.
|
|
73
|
+
*/
|
|
74
|
+
private anchorLocation;
|
|
56
75
|
protected update(): void;
|
|
57
76
|
}
|