web-documentation 1.0.3-1 → 1.0.4
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 +7 -7
- package/package.json +7 -7
- package/source/index.html.ejs +31 -31
- package/source/index.ts +18 -12
- package/source/test.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web-documentation",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Declarative multilanguage documentation website generator",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"documentation",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"watch": "weboptimizer build --watch"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@aws-sdk/client-s3": "^3.
|
|
53
|
+
"@aws-sdk/client-s3": "^3.1036.0",
|
|
54
54
|
"@babel/eslint-parser": "^7.28.6",
|
|
55
55
|
"@babel/runtime": "^7.29.2",
|
|
56
56
|
"@eslint/js": "^10.0.1",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@typescript-eslint/parser": "^8.59.0",
|
|
68
68
|
"@webcomponents/webcomponentsjs": "^2.8.0",
|
|
69
69
|
"archiver": "^7.0.1",
|
|
70
|
-
"clientnode": "^4.0.
|
|
70
|
+
"clientnode": "^4.0.1389",
|
|
71
71
|
"css-loader": "^7.1.4",
|
|
72
72
|
"cssnano": "^7.1.7",
|
|
73
73
|
"default-gateway": "^7.2.2",
|
|
@@ -98,16 +98,16 @@
|
|
|
98
98
|
"postcss-url": "^10.1.3",
|
|
99
99
|
"prop-types": "^15.8.1",
|
|
100
100
|
"style-loader": "^4.0.0",
|
|
101
|
-
"stylelint": "^17.
|
|
101
|
+
"stylelint": "^17.9.0",
|
|
102
102
|
"stylelint-config-standard": "^40.0.0",
|
|
103
103
|
"typescript-eslint": "^8.59.0",
|
|
104
104
|
"ua-parser-js": "^2.0.9",
|
|
105
105
|
"unzipper": "^0.12.3",
|
|
106
|
-
"web-component-wrapper": "^0.0.
|
|
107
|
-
"web-internationalization": "^2.0.
|
|
106
|
+
"web-component-wrapper": "^0.0.566",
|
|
107
|
+
"web-internationalization": "^2.0.10",
|
|
108
108
|
"weboptimizer": "^3.0.22",
|
|
109
109
|
"webpack-dev-server": "^5.2.3",
|
|
110
|
-
"website-utilities": "^1.0.
|
|
110
|
+
"website-utilities": "^1.0.389"
|
|
111
111
|
},
|
|
112
112
|
"engines": {
|
|
113
113
|
"node": ">=24",
|
package/source/index.html.ejs
CHANGED
|
@@ -51,39 +51,39 @@ _%>
|
|
|
51
51
|
window.document.body.classList.add('wu-javascript')
|
|
52
52
|
</script>
|
|
53
53
|
|
|
54
|
-
<
|
|
55
|
-
<div class="
|
|
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
|
-
</div>
|
|
54
|
+
<div class="wu-window-loading-cover">
|
|
55
|
+
<div class="loading-text">
|
|
56
|
+
<lang-replace>
|
|
57
|
+
<span>L</span>
|
|
58
|
+
<span>O</span>
|
|
59
|
+
<span>A</span>
|
|
60
|
+
<span>D</span>
|
|
61
|
+
<span>I</span>
|
|
62
|
+
<span>N</span>
|
|
63
|
+
<span>G</span>
|
|
64
|
+
</lang-replace>
|
|
65
|
+
<!--deDE:
|
|
66
|
+
<span>L</span>
|
|
67
|
+
<span>A</span>
|
|
68
|
+
<span>D</span>
|
|
69
|
+
<span>E</span>
|
|
70
|
+
-->
|
|
71
|
+
<!--frFR:
|
|
72
|
+
<span>C</span>
|
|
73
|
+
<span>H</span>
|
|
74
|
+
<span>A</span>
|
|
75
|
+
<span>r</span>
|
|
76
|
+
<span>g</span>
|
|
77
|
+
<span>e</span>
|
|
78
|
+
<span>m</span>
|
|
79
|
+
<span>e</span>
|
|
80
|
+
<span>n</span>
|
|
81
|
+
<span>t</span>
|
|
82
|
+
-->
|
|
85
83
|
</div>
|
|
84
|
+
</div>
|
|
86
85
|
|
|
86
|
+
<web-documentation>
|
|
87
87
|
<!--region header-->
|
|
88
88
|
<header class="header">
|
|
89
89
|
<div class="header__inner">
|
package/source/index.ts
CHANGED
|
@@ -68,7 +68,9 @@ export class WebDocumentation<
|
|
|
68
68
|
<website-utilities
|
|
69
69
|
options="{sectionNames: ['home', 'about-this-website']}"
|
|
70
70
|
>
|
|
71
|
-
<web-internationalization
|
|
71
|
+
<web-internationalization
|
|
72
|
+
options="{selectors: {knownTranslation: '.doc-toc'}}"
|
|
73
|
+
>
|
|
72
74
|
<slot>Please provide a template to transclude.</slot>
|
|
73
75
|
</web-internationalization>
|
|
74
76
|
</website-utilities>
|
|
@@ -85,9 +87,9 @@ export class WebDocumentation<
|
|
|
85
87
|
code: 'code',
|
|
86
88
|
|
|
87
89
|
headlines:
|
|
88
|
-
'.
|
|
89
|
-
'.
|
|
90
|
-
'.
|
|
90
|
+
'.section__home h1, .section__home h2, ' +
|
|
91
|
+
'.section__home h3, .section__home h4, ' +
|
|
92
|
+
'.section__home h5, .section__home h6',
|
|
91
93
|
tableOfContent: '.doc-toc',
|
|
92
94
|
tableOfContentLinks: '.doc-toc ul li a[href^="#"]'
|
|
93
95
|
},
|
|
@@ -151,12 +153,7 @@ export class WebDocumentation<
|
|
|
151
153
|
super.onUpdateAttribute(name, newValue)
|
|
152
154
|
|
|
153
155
|
if (name === 'options')
|
|
154
|
-
this.
|
|
155
|
-
true,
|
|
156
|
-
{},
|
|
157
|
-
this.self._defaultOptions,
|
|
158
|
-
this.options
|
|
159
|
-
)
|
|
156
|
+
this._extendOptions()
|
|
160
157
|
}
|
|
161
158
|
/**
|
|
162
159
|
* Updates controlled dom elements.
|
|
@@ -166,7 +163,7 @@ export class WebDocumentation<
|
|
|
166
163
|
await super.render(reason)
|
|
167
164
|
|
|
168
165
|
if (Object.keys(this.options).length === 0)
|
|
169
|
-
this.
|
|
166
|
+
this._extendOptions()
|
|
170
167
|
|
|
171
168
|
this.grabDomNodes()
|
|
172
169
|
|
|
@@ -204,6 +201,14 @@ export class WebDocumentation<
|
|
|
204
201
|
// region protected methods
|
|
205
202
|
/// region event handler
|
|
206
203
|
/// endregion
|
|
204
|
+
/**
|
|
205
|
+
* Extends given options by default options.
|
|
206
|
+
*/
|
|
207
|
+
_extendOptions() {
|
|
208
|
+
this.options = extend<Options>(
|
|
209
|
+
true, {}, this.self._defaultOptions, this.options
|
|
210
|
+
)
|
|
211
|
+
}
|
|
207
212
|
/**
|
|
208
213
|
* Generates a table of contents via creating links referring to headlines.
|
|
209
214
|
*/
|
|
@@ -215,6 +220,7 @@ export class WebDocumentation<
|
|
|
215
220
|
let level = 0
|
|
216
221
|
let firstLevel = 0
|
|
217
222
|
let first = true
|
|
223
|
+
|
|
218
224
|
for (const domNode of this.headlineDomNodes ?? []) {
|
|
219
225
|
if (getParents(domNode).some((domNode: Node) =>
|
|
220
226
|
(domNode as Partial<Element>).classList?.contains(
|
|
@@ -253,7 +259,7 @@ export class WebDocumentation<
|
|
|
253
259
|
|
|
254
260
|
listItems += '</ul>'
|
|
255
261
|
|
|
256
|
-
this.tableOfContentDomNode.append(listItems)
|
|
262
|
+
this.tableOfContentDomNode.append(createDomNodes(listItems))
|
|
257
263
|
|
|
258
264
|
this.tableOfContentLinkDomNodes =
|
|
259
265
|
this.tableOfContentDomNode.querySelectorAll<HTMLAnchorElement>('a')
|
package/source/test.ts
CHANGED
|
@@ -22,10 +22,12 @@ import WebDocumentation, {api} from './index'
|
|
|
22
22
|
describe('WebDocumentation', () => {
|
|
23
23
|
let root: WebDocumentation
|
|
24
24
|
|
|
25
|
-
beforeAll(() => {
|
|
25
|
+
beforeAll(async () => {
|
|
26
26
|
api.register()
|
|
27
27
|
root = document.createElement('web-documentation') as WebDocumentation
|
|
28
28
|
document.body.appendChild(root)
|
|
29
|
+
|
|
30
|
+
await root.renderState.promise
|
|
29
31
|
})
|
|
30
32
|
// region tests
|
|
31
33
|
test('should be defined', () => {
|