clean-jsdoc-theme 4.1.7 → 4.1.9

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.
Files changed (68) hide show
  1. package/.eslintignore +5 -5
  2. package/.eslintrc.js +3 -3
  3. package/.github/ISSUE_TEMPLATE/bug_report.md +43 -43
  4. package/.github/ISSUE_TEMPLATE/feature_request.md +27 -27
  5. package/.github/dependabot.yml +9 -9
  6. package/.github/pull_request_template.md +16 -16
  7. package/.github/workflows/codeql.yml +72 -72
  8. package/.github/workflows/greetings.yml +16 -16
  9. package/.prettierignore +1 -2
  10. package/.prettierrc +5 -5
  11. package/.stylelintignore +4 -4
  12. package/.stylelintrc +18 -23
  13. package/.travis.yml +30 -30
  14. package/CHANGELOG.md +256 -235
  15. package/CODE_OF_CONDUCT.md +76 -76
  16. package/CODE_OF_CONDUCT_HINDI.md +61 -46
  17. package/CONTRIBUTING.md +36 -24
  18. package/LICENSE +21 -21
  19. package/README.md +497 -456
  20. package/SECURITY.md +21 -21
  21. package/helpers/down-arrow.js +9 -9
  22. package/jsdoc-config.json +62 -61
  23. package/minify.js +60 -56
  24. package/package.json +52 -50
  25. package/publish.js +1138 -1129
  26. package/static/scripts/core.js +662 -656
  27. package/static/scripts/core.min.js +23 -23
  28. package/static/scripts/resize.js +90 -90
  29. package/static/scripts/search.js +262 -262
  30. package/static/scripts/third-party/Apache-License-2.0.txt +202 -202
  31. package/static/scripts/third-party/fuse.js +8 -8
  32. package/static/scripts/third-party/hljs-line-num-original.js +369 -365
  33. package/static/scripts/third-party/hljs-line-num.js +1 -1
  34. package/static/scripts/third-party/hljs-original.js +5171 -5162
  35. package/static/scripts/third-party/hljs.js +1 -1
  36. package/static/scripts/third-party/popper.js +5 -5
  37. package/static/scripts/third-party/tippy.js +1 -1
  38. package/static/scripts/third-party/tocbot.js +672 -1
  39. package/static/scripts/third-party/tocbot.min.js +1 -0
  40. package/static/styles/clean-jsdoc-theme-base.css +968 -968
  41. package/static/styles/clean-jsdoc-theme-dark.css +407 -407
  42. package/static/styles/clean-jsdoc-theme-light.css +388 -388
  43. package/tmpl/augments.tmpl +10 -10
  44. package/tmpl/container.tmpl +190 -190
  45. package/tmpl/details.tmpl +207 -207
  46. package/tmpl/example.tmpl +3 -3
  47. package/tmpl/examples.tmpl +40 -40
  48. package/tmpl/exceptions.tmpl +32 -32
  49. package/tmpl/icons.tmpl +72 -72
  50. package/tmpl/layout.tmpl +157 -157
  51. package/tmpl/mainpage.tmpl +10 -10
  52. package/tmpl/members.tmpl +42 -42
  53. package/tmpl/method.tmpl +156 -139
  54. package/tmpl/mobile-sidebar.tmpl +20 -20
  55. package/tmpl/navbar-actions.tmpl +18 -18
  56. package/tmpl/navbar-menu.tmpl +24 -24
  57. package/tmpl/navbar.tmpl +13 -13
  58. package/tmpl/params.tmpl +124 -124
  59. package/tmpl/properties.tmpl +109 -109
  60. package/tmpl/returns.tmpl +18 -18
  61. package/tmpl/search.tmpl +16 -16
  62. package/tmpl/sidebar-items.tmpl +23 -23
  63. package/tmpl/sidebar-title.tmpl +9 -9
  64. package/tmpl/sidebar.tmpl +8 -8
  65. package/tmpl/source.tmpl +12 -12
  66. package/tmpl/toc.tmpl +3 -3
  67. package/tmpl/tutorial.tmpl +19 -19
  68. package/tmpl/type.tmpl +12 -7
@@ -1,262 +1,262 @@
1
- /* global document */
2
-
3
- const searchId = 'LiBfqbJVcV';
4
- const searchHash = '#' + searchId;
5
- const searchContainer = document.querySelector('#PkfLWpAbet');
6
- const searchWrapper = document.querySelector('#iCxFxjkHbP');
7
- const searchCloseButton = document.querySelector('#VjLlGakifb');
8
- const searchInput = document.querySelector('#vpcKVYIppa');
9
- const resultBox = document.querySelector('#fWwVHRuDuN');
10
-
11
- function showResultText(text) {
12
- resultBox.innerHTML = `<span class="search-result-c-text">${text}</span>`;
13
- }
14
-
15
- function hideSearch() {
16
- // eslint-disable-next-line no-undef
17
- if (window.location.hash === searchHash) {
18
- // eslint-disable-next-line no-undef
19
- history.go(-1);
20
- }
21
-
22
- // eslint-disable-next-line no-undef
23
- window.onhashchange = null;
24
-
25
- if (searchContainer) {
26
- searchContainer.style.display = 'none';
27
- }
28
- }
29
-
30
- function listenCloseKey(event) {
31
- if (event.key === 'Escape') {
32
- hideSearch();
33
- // eslint-disable-next-line no-undef
34
- window.removeEventListener('keyup', listenCloseKey);
35
- }
36
- }
37
-
38
- function showSearch() {
39
- try {
40
- // Closing mobile menu before opening
41
- // search box.
42
- // It is defined in core.js
43
- // eslint-disable-next-line no-undef
44
- hideMobileMenu();
45
- } catch (error) {
46
- console.error(error);
47
- }
48
-
49
- // eslint-disable-next-line no-undef
50
- window.onhashchange = hideSearch;
51
-
52
- // eslint-disable-next-line no-undef
53
- if (window.location.hash !== searchHash) {
54
- // eslint-disable-next-line no-undef
55
- history.pushState(null, null, searchHash);
56
- }
57
-
58
- if (searchContainer) {
59
- searchContainer.style.display = 'flex';
60
- // eslint-disable-next-line no-undef
61
- window.addEventListener('keyup', listenCloseKey);
62
- }
63
-
64
- if (searchInput) {
65
- searchInput.focus();
66
- }
67
- }
68
-
69
- async function fetchAllData() {
70
- // eslint-disable-next-line no-undef
71
- const { hostname, protocol, port } = location;
72
-
73
- // eslint-disable-next-line no-undef
74
- const base = protocol + '//' + hostname + (port !== '' ? ':' + port : '') + baseURL;
75
- // eslint-disable-next-line no-undef
76
- const url = new URL('data/search.json', base);
77
- const result = await fetch(url);
78
- const { list } = await result.json();
79
-
80
- return list;
81
- }
82
-
83
- // eslint-disable-next-line no-unused-vars
84
- function onClickSearchItem(event) {
85
- const target = event.currentTarget;
86
-
87
- if (target) {
88
- const href = target.getAttribute('href') || '';
89
- let elementId = href.split('#')[1] || '';
90
- let element = document.getElementById(elementId);
91
-
92
- if (!element) {
93
- elementId = decodeURI(elementId);
94
- element = document.getElementById(elementId);
95
- }
96
-
97
- if (element) {
98
- setTimeout(function() {
99
- // eslint-disable-next-line no-undef
100
- bringElementIntoView(element); // defined in core.js
101
- }, 100);
102
- }
103
- }
104
- }
105
-
106
- function buildSearchResult(result) {
107
- let output = '';
108
-
109
- for (const res of result) {
110
- const { title, description } = res.item;
111
-
112
- const link = res.item.link.replace('<a href="', '').replace(/">.*/, '');
113
-
114
- output += `
115
- <a onclick="onClickSearchItem(event)" href="${link}" class="search-result-item">
116
- <div class="search-result-item-title">${title}</div>
117
- <div class="search-result-item-p">${description || 'No description available.'}</div>
118
- </a>
119
- `;
120
- }
121
-
122
- return output;
123
- }
124
-
125
- function getSearchResult(list, keys, searchKey) {
126
- const defaultOptions = {
127
- shouldSort: true,
128
- threshold: 0.4,
129
- location: 0,
130
- distance: 100,
131
- maxPatternLength: 32,
132
- minMatchCharLength: 1,
133
- keys: keys
134
- };
135
-
136
- const options = { ...defaultOptions };
137
-
138
- // eslint-disable-next-line no-undef
139
- const searchIndex = Fuse.createIndex(options.keys, list);
140
-
141
- // eslint-disable-next-line no-undef
142
- const fuse = new Fuse(list, options, searchIndex);
143
-
144
- const result = fuse.search(searchKey);
145
-
146
- if (result.length > 20) {
147
- return result.slice(0, 20);
148
- }
149
-
150
- return result;
151
- }
152
-
153
- function debounce(func, wait, immediate) {
154
- let timeout;
155
-
156
- return function() {
157
- const args = arguments;
158
-
159
- clearTimeout(timeout);
160
- timeout = setTimeout(() => {
161
- timeout = null;
162
- if (!immediate) {
163
- // eslint-disable-next-line consistent-this, no-invalid-this
164
- func.apply(this, args);
165
- }
166
- }, wait);
167
-
168
- if (immediate && !timeout) {
169
- // eslint-disable-next-line consistent-this, no-invalid-this
170
- func.apply(this, args);
171
- }
172
- };
173
- }
174
-
175
- let searchData;
176
-
177
- async function search(event) {
178
- const value = event.target.value;
179
- const keys = ['title', 'description'];
180
-
181
- if (!resultBox) {
182
- console.error('Search result container not found');
183
-
184
- return;
185
- }
186
-
187
- if (!value) {
188
- showResultText('Type anything to view search result');
189
-
190
- return;
191
- }
192
-
193
- if (!searchData) {
194
- showResultText('Loading...');
195
-
196
- try {
197
- // eslint-disable-next-line require-atomic-updates
198
- searchData = await fetchAllData();
199
- } catch (e) {
200
- console.log(e);
201
- showResultText('Failed to load result.');
202
-
203
- return;
204
- }
205
- }
206
-
207
- const result = getSearchResult(searchData, keys, value);
208
-
209
- if (!result.length) {
210
- showResultText('No result found! Try some different combination.');
211
-
212
- return;
213
- }
214
-
215
- // eslint-disable-next-line require-atomic-updates
216
- resultBox.innerHTML = buildSearchResult(result);
217
- }
218
-
219
- function onDomContentLoaded() {
220
- const searchButton = document.querySelectorAll('.search-button');
221
- const debouncedSearch = debounce(search, 300);
222
-
223
- if (searchCloseButton) {
224
- searchCloseButton.addEventListener('click', hideSearch);
225
- }
226
-
227
- if (searchButton) {
228
- searchButton.forEach(function(item) {
229
- item.addEventListener('click', showSearch);
230
- });
231
- }
232
-
233
- if (searchContainer) {
234
- searchContainer.addEventListener('click', hideSearch);
235
- }
236
-
237
- if (searchWrapper) {
238
- searchWrapper.addEventListener('click', function(event) {
239
- event.stopPropagation();
240
- });
241
- }
242
-
243
- if (searchInput) {
244
- searchInput.addEventListener('keyup', debouncedSearch);
245
- }
246
-
247
- // eslint-disable-next-line no-undef
248
- if (window.location.hash === searchHash) {
249
- showSearch();
250
- }
251
- }
252
-
253
- // eslint-disable-next-line no-undef
254
- window.addEventListener('DOMContentLoaded', onDomContentLoaded);
255
-
256
- // eslint-disable-next-line no-undef
257
- window.addEventListener('hashchange', function() {
258
- // eslint-disable-next-line no-undef
259
- if (window.location.hash === searchHash) {
260
- showSearch();
261
- }
262
- });
1
+ /* global document */
2
+
3
+ const searchId = 'LiBfqbJVcV';
4
+ const searchHash = '#' + searchId;
5
+ const searchContainer = document.querySelector('#PkfLWpAbet');
6
+ const searchWrapper = document.querySelector('#iCxFxjkHbP');
7
+ const searchCloseButton = document.querySelector('#VjLlGakifb');
8
+ const searchInput = document.querySelector('#vpcKVYIppa');
9
+ const resultBox = document.querySelector('#fWwVHRuDuN');
10
+
11
+ function showResultText(text) {
12
+ resultBox.innerHTML = `<span class="search-result-c-text">${text}</span>`;
13
+ }
14
+
15
+ function hideSearch() {
16
+ // eslint-disable-next-line no-undef
17
+ if (window.location.hash === searchHash) {
18
+ // eslint-disable-next-line no-undef
19
+ history.go(-1);
20
+ }
21
+
22
+ // eslint-disable-next-line no-undef
23
+ window.onhashchange = null;
24
+
25
+ if (searchContainer) {
26
+ searchContainer.style.display = 'none';
27
+ }
28
+ }
29
+
30
+ function listenCloseKey(event) {
31
+ if (event.key === 'Escape') {
32
+ hideSearch();
33
+ // eslint-disable-next-line no-undef
34
+ window.removeEventListener('keyup', listenCloseKey);
35
+ }
36
+ }
37
+
38
+ function showSearch() {
39
+ try {
40
+ // Closing mobile menu before opening
41
+ // search box.
42
+ // It is defined in core.js
43
+ // eslint-disable-next-line no-undef
44
+ hideMobileMenu();
45
+ } catch (error) {
46
+ console.error(error);
47
+ }
48
+
49
+ // eslint-disable-next-line no-undef
50
+ window.onhashchange = hideSearch;
51
+
52
+ // eslint-disable-next-line no-undef
53
+ if (window.location.hash !== searchHash) {
54
+ // eslint-disable-next-line no-undef
55
+ history.pushState(null, null, searchHash);
56
+ }
57
+
58
+ if (searchContainer) {
59
+ searchContainer.style.display = 'flex';
60
+ // eslint-disable-next-line no-undef
61
+ window.addEventListener('keyup', listenCloseKey);
62
+ }
63
+
64
+ if (searchInput) {
65
+ searchInput.focus();
66
+ }
67
+ }
68
+
69
+ async function fetchAllData() {
70
+ // eslint-disable-next-line no-undef
71
+ const { hostname, protocol, port } = location;
72
+
73
+ // eslint-disable-next-line no-undef
74
+ const base = protocol + '//' + hostname + (port !== '' ? ':' + port : '') + baseURL;
75
+ // eslint-disable-next-line no-undef
76
+ const url = new URL('data/search.json', base);
77
+ const result = await fetch(url);
78
+ const { list } = await result.json();
79
+
80
+ return list;
81
+ }
82
+
83
+ // eslint-disable-next-line no-unused-vars
84
+ function onClickSearchItem(event) {
85
+ const target = event.currentTarget;
86
+
87
+ if (target) {
88
+ const href = target.getAttribute('href') || '';
89
+ let elementId = href.split('#')[1] || '';
90
+ let element = document.getElementById(elementId);
91
+
92
+ if (!element) {
93
+ elementId = decodeURI(elementId);
94
+ element = document.getElementById(elementId);
95
+ }
96
+
97
+ if (element) {
98
+ setTimeout(function() {
99
+ // eslint-disable-next-line no-undef
100
+ bringElementIntoView(element); // defined in core.js
101
+ }, 100);
102
+ }
103
+ }
104
+ }
105
+
106
+ function buildSearchResult(result) {
107
+ let output = '';
108
+
109
+ for (const res of result) {
110
+ const { title, description } = res.item;
111
+
112
+ const link = res.item.link.replace('<a href="', '').replace(/">.*/, '');
113
+
114
+ output += `
115
+ <a onclick="onClickSearchItem(event)" href="${link}" class="search-result-item">
116
+ <div class="search-result-item-title">${title}</div>
117
+ <div class="search-result-item-p">${description || 'No description available.'}</div>
118
+ </a>
119
+ `;
120
+ }
121
+
122
+ return output;
123
+ }
124
+
125
+ function getSearchResult(list, keys, searchKey) {
126
+ const defaultOptions = {
127
+ shouldSort: true,
128
+ threshold: 0.4,
129
+ location: 0,
130
+ distance: 100,
131
+ maxPatternLength: 32,
132
+ minMatchCharLength: 1,
133
+ keys: keys
134
+ };
135
+
136
+ const options = { ...defaultOptions };
137
+
138
+ // eslint-disable-next-line no-undef
139
+ const searchIndex = Fuse.createIndex(options.keys, list);
140
+
141
+ // eslint-disable-next-line no-undef
142
+ const fuse = new Fuse(list, options, searchIndex);
143
+
144
+ const result = fuse.search(searchKey);
145
+
146
+ if (result.length > 20) {
147
+ return result.slice(0, 20);
148
+ }
149
+
150
+ return result;
151
+ }
152
+
153
+ function debounce(func, wait, immediate) {
154
+ let timeout;
155
+
156
+ return function() {
157
+ const args = arguments;
158
+
159
+ clearTimeout(timeout);
160
+ timeout = setTimeout(() => {
161
+ timeout = null;
162
+ if (!immediate) {
163
+ // eslint-disable-next-line consistent-this, no-invalid-this
164
+ func.apply(this, args);
165
+ }
166
+ }, wait);
167
+
168
+ if (immediate && !timeout) {
169
+ // eslint-disable-next-line consistent-this, no-invalid-this
170
+ func.apply(this, args);
171
+ }
172
+ };
173
+ }
174
+
175
+ let searchData;
176
+
177
+ async function search(event) {
178
+ const value = event.target.value;
179
+ const keys = ['title', 'description'];
180
+
181
+ if (!resultBox) {
182
+ console.error('Search result container not found');
183
+
184
+ return;
185
+ }
186
+
187
+ if (!value) {
188
+ showResultText('Type anything to view search result');
189
+
190
+ return;
191
+ }
192
+
193
+ if (!searchData) {
194
+ showResultText('Loading...');
195
+
196
+ try {
197
+ // eslint-disable-next-line require-atomic-updates
198
+ searchData = await fetchAllData();
199
+ } catch (e) {
200
+ console.log(e);
201
+ showResultText('Failed to load result.');
202
+
203
+ return;
204
+ }
205
+ }
206
+
207
+ const result = getSearchResult(searchData, keys, value);
208
+
209
+ if (!result.length) {
210
+ showResultText('No result found! Try some different combination.');
211
+
212
+ return;
213
+ }
214
+
215
+ // eslint-disable-next-line require-atomic-updates
216
+ resultBox.innerHTML = buildSearchResult(result);
217
+ }
218
+
219
+ function onDomContentLoaded() {
220
+ const searchButton = document.querySelectorAll('.search-button');
221
+ const debouncedSearch = debounce(search, 300);
222
+
223
+ if (searchCloseButton) {
224
+ searchCloseButton.addEventListener('click', hideSearch);
225
+ }
226
+
227
+ if (searchButton) {
228
+ searchButton.forEach(function(item) {
229
+ item.addEventListener('click', showSearch);
230
+ });
231
+ }
232
+
233
+ if (searchContainer) {
234
+ searchContainer.addEventListener('click', hideSearch);
235
+ }
236
+
237
+ if (searchWrapper) {
238
+ searchWrapper.addEventListener('click', function(event) {
239
+ event.stopPropagation();
240
+ });
241
+ }
242
+
243
+ if (searchInput) {
244
+ searchInput.addEventListener('keyup', debouncedSearch);
245
+ }
246
+
247
+ // eslint-disable-next-line no-undef
248
+ if (window.location.hash === searchHash) {
249
+ showSearch();
250
+ }
251
+ }
252
+
253
+ // eslint-disable-next-line no-undef
254
+ window.addEventListener('DOMContentLoaded', onDomContentLoaded);
255
+
256
+ // eslint-disable-next-line no-undef
257
+ window.addEventListener('hashchange', function() {
258
+ // eslint-disable-next-line no-undef
259
+ if (window.location.hash === searchHash) {
260
+ showSearch();
261
+ }
262
+ });