forked from Viima/jquery-comments
/
misc.ts
145 lines (144 loc) · 3.98 KB
/
misc.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
export interface Misc {
/**
* An array of `CSSStyleSheet` to be applied to element's [adoptedStyleSheets]{@link https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/adoptedStyleSheets}.
*
* @default [STYLE_SHEET]
* @example
* ```javascript
* const commentsElement = document.createElement('ax-comments');
* commentsElement.options = {
* // ...
* styles: [STYLE_SHEET, myMaterialStyleSheet],
* // ...
* };
* ```
*/
styles?: CSSStyleSheet[];
/**
* A `css` value for the highlight color that is used for example to highlight active sorting button and comments by admin
*
* @default '#2793e6'
* @example
* ```javascript
* const commentsElement = document.createElement('ax-comments');
* commentsElement.options = {
* // ...
* highlightColor: 'blue',
* // ...
* };
* ```
*/
highlightColor?: string;
/**
* A `css` value for the color of the delete button
*
* @default '#c9302c'
* @example
* ```javascript
* const commentsElement = document.createElement('ax-comments');
* commentsElement.options = {
* // ...
* deleteButtonColor: 'red',
* // ...
* };
* ```
*/
deleteButtonColor?: string;
/**
* An `enum` value determining the default sorting. For possible values see {@see SortKey}.
*
* @default SortKey.NEWEST
* @example
* ```javascript
* const commentsElement = document.createElement('ax-comments');
* commentsElement.options = {
* // ...
* defaultNavigationSortKey: SortKey.POPULARITY,
* // ...
* };
* ```
*/
defaultNavigationSortKey?: SortKey;
/**
* A `boolean` value determining whether to highlight own comments
*
* @default true
* @example
* ```javascript
* const commentsElement = document.createElement('ax-comments');
* commentsElement.options = {
* // ...
* highlightOwnComments: false,
* // ...
* };
* ```
*/
highlightOwnComments?: boolean,
/**
* A `boolean` value determining whether profile pictures are rounded
*
* @default false
* @example
* ```javascript
* const commentsElement = document.createElement('ax-comments');
* commentsElement.options = {
* // ...
* roundProfilePictures: true,
* // ...
* };
* ```
*/
roundProfilePictures?: boolean,
/**
* An `integer` value determining how many rows there are in the commenting fields
*
* @default 2
* @example
* ```javascript
* const commentsElement = document.createElement('ax-comments');
* commentsElement.options = {
* // ...
* textareaRows: 3,
* // ...
* };
* ```
*/
textareaRows?: number,
/**
* An `integer` value determining how many rows there are in the commenting fields on focus
*
* @default 2
* @example
* ```javascript
* const commentsElement = document.createElement('ax-comments');
* commentsElement.options = {
* // ...
* textareaRowsOnFocus: 4,
* // ...
* };
* ```
*/
textareaRowsOnFocus?: number,
/**
* An `integer` or a `boolean` value determining the maximum amount of replies that are visible initially under a comment.
* The hidden replies can be shown by clicking the button with a text set in `viewAllRepliesText` option.
* If set to false all replies will always be visible.
*
* @default 2
* @example
* ```javascript
* const commentsElement = document.createElement('ax-comments');
* commentsElement.options = {
* // ...
* maxRepliesVisible: 3,
* // ...
* };
* ```
*/
maxRepliesVisible?: number | false,
}
export enum SortKey {
POPULARITY = 'popularity',
OLDEST = 'oldest',
NEWEST = 'newest'
}