web-documentation 1.0.17 → 1.0.18
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/build/deploy.js +4 -4
- package/package.json +4 -4
- package/source/index.ts +22 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web-documentation",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "Declarative multilanguage documentation website generator",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"documentation",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@webcomponents/webcomponentsjs": "^2.8.0",
|
|
69
69
|
"archiver": "^8.0.0",
|
|
70
70
|
"bootstrap-icons": "^1.13.1",
|
|
71
|
-
"clientnode": "^4.0.
|
|
71
|
+
"clientnode": "^4.0.1411",
|
|
72
72
|
"css-loader": "^7.1.4",
|
|
73
73
|
"cssnano": "^8.0.1",
|
|
74
74
|
"default-gateway": "^7.2.2",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"postcss-preset-env": "^11.3.0",
|
|
97
97
|
"postcss-scss": "^4.0.9",
|
|
98
98
|
"postcss-sprites": "^4.2.1",
|
|
99
|
-
"postcss-url": "^10.1.
|
|
99
|
+
"postcss-url": "^10.1.4",
|
|
100
100
|
"prop-types": "^15.8.1",
|
|
101
101
|
"style-loader": "^4.0.0",
|
|
102
102
|
"stylelint": "^17.12.0",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"web-internationalization": "^2.0.30",
|
|
109
109
|
"weboptimizer": "^3.0.24",
|
|
110
110
|
"webpack-dev-server": "^5.2.4",
|
|
111
|
-
"website-utilities": "^1.0.
|
|
111
|
+
"website-utilities": "^1.0.431"
|
|
112
112
|
},
|
|
113
113
|
"engines": {
|
|
114
114
|
"node": ">=24",
|
package/source/index.ts
CHANGED
|
@@ -26,9 +26,11 @@ import {
|
|
|
26
26
|
getAll,
|
|
27
27
|
getText,
|
|
28
28
|
globalContext,
|
|
29
|
+
interruptableScrollTo,
|
|
29
30
|
Logger,
|
|
30
31
|
Mapping,
|
|
31
32
|
NOOP,
|
|
33
|
+
timeout,
|
|
32
34
|
wrap
|
|
33
35
|
} from 'clientnode'
|
|
34
36
|
import {func, object} from 'clientnode/property-types'
|
|
@@ -216,8 +218,6 @@ export class WebDocumentation<
|
|
|
216
218
|
}
|
|
217
219
|
// endregion
|
|
218
220
|
// region protected methods
|
|
219
|
-
/// region event handler
|
|
220
|
-
/// endregion
|
|
221
221
|
/**
|
|
222
222
|
* Extends given options by default options.
|
|
223
223
|
*/
|
|
@@ -280,7 +280,26 @@ export class WebDocumentation<
|
|
|
280
280
|
this.tableOfContentDomNode.append(createDomNodes(listItems))
|
|
281
281
|
|
|
282
282
|
this.tableOfContentLinkDomNodes =
|
|
283
|
-
this.tableOfContentDomNode.querySelectorAll<HTMLAnchorElement>(
|
|
283
|
+
this.tableOfContentDomNode.querySelectorAll<HTMLAnchorElement>(
|
|
284
|
+
this.options.selectors.tableOfContentLinks
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
for (const domNode of this.tableOfContentLinkDomNodes)
|
|
288
|
+
this.addSecureEventListener(
|
|
289
|
+
domNode,
|
|
290
|
+
'click',
|
|
291
|
+
(event) => {
|
|
292
|
+
event.preventDefault()
|
|
293
|
+
|
|
294
|
+
const selector = event.target.getAttribute('href')
|
|
295
|
+
if (selector) {
|
|
296
|
+
const targetDomNode =
|
|
297
|
+
this.hostDomNode.querySelector(selector)
|
|
298
|
+
if (targetDomNode)
|
|
299
|
+
interruptableScrollTo({targetDomNode})
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
)
|
|
284
303
|
|
|
285
304
|
this.tableOfContentDomNode.style.display = 'initial'
|
|
286
305
|
}
|