@forsakringskassan/docs-generator 2.10.0 → 2.11.1
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/index.d.ts +11 -2
- package/dist/index.js +29 -6
- package/dist/processors/motd.js +39 -0
- package/dist/processors/selectable-version.js +35 -4
- package/dist/runtime.d.ts +31 -0
- package/dist/runtime.js +20 -0
- package/dist/style/index.css +61 -7
- package/dist/style/site.css +61 -7
- package/package.json +1 -1
- package/templates/macro/motd.njk.html +21 -0
- package/templates/partials/footer.html +4 -3
- package/templates/partials/motd-container.njk.html +14 -0
- package/templates/partials/version-banner.html +0 -14
package/dist/index.d.ts
CHANGED
|
@@ -329,7 +329,7 @@ export declare interface MOTDOptions {
|
|
|
329
329
|
/** Name of the container to render content in. */
|
|
330
330
|
container?: string;
|
|
331
331
|
/** Message to display */
|
|
332
|
-
message
|
|
332
|
+
message?: string;
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
/**
|
|
@@ -523,7 +523,16 @@ export declare function searchProcessor(): Processor;
|
|
|
523
523
|
*
|
|
524
524
|
* @public
|
|
525
525
|
*/
|
|
526
|
-
export declare function selectableVersionProcessor(pkg: PackageJson, container: string, options?:
|
|
526
|
+
export declare function selectableVersionProcessor(pkg: PackageJson, container: string, options?: SelectableVersionProcessorOptions): Processor;
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Options for {@link selectableVersionProcessor#}.
|
|
530
|
+
*
|
|
531
|
+
* @public
|
|
532
|
+
*/
|
|
533
|
+
export declare interface SelectableVersionProcessorOptions extends ProcessorOptions {
|
|
534
|
+
readonly message?: string;
|
|
535
|
+
}
|
|
527
536
|
|
|
528
537
|
/**
|
|
529
538
|
* Options passed from the example compiler to the `setup` function.
|
package/dist/index.js
CHANGED
|
@@ -358,7 +358,8 @@ function manifestProcessor(options = {}) {
|
|
|
358
358
|
function normalizeOptions(options) {
|
|
359
359
|
const defaults = {
|
|
360
360
|
enabled: true,
|
|
361
|
-
container: "body:begin"
|
|
361
|
+
container: "body:begin",
|
|
362
|
+
message: void 0
|
|
362
363
|
};
|
|
363
364
|
return { ...defaults, ...options };
|
|
364
365
|
}
|
|
@@ -367,14 +368,30 @@ function motdProcessor(options) {
|
|
|
367
368
|
return {
|
|
368
369
|
name: "motd-processor",
|
|
369
370
|
after: "generate-docs",
|
|
371
|
+
runtime: [{ src: "src/runtime/motd/index.ts" }],
|
|
370
372
|
handler(context) {
|
|
371
373
|
if (!enabled) {
|
|
372
374
|
return;
|
|
373
375
|
}
|
|
374
|
-
context.
|
|
375
|
-
|
|
376
|
-
|
|
376
|
+
const useLegacyTemplate = context.hasTemplate(
|
|
377
|
+
"partials/version-banner.html"
|
|
378
|
+
);
|
|
379
|
+
const data = {
|
|
380
|
+
message
|
|
381
|
+
};
|
|
382
|
+
context.addTemplateBlock(container, "motd-container", {
|
|
383
|
+
filename: "partials/motd-container.njk.html",
|
|
384
|
+
data: useLegacyTemplate ? void 0 : data
|
|
377
385
|
});
|
|
386
|
+
if (useLegacyTemplate) {
|
|
387
|
+
console.warn(
|
|
388
|
+
`[deprecated] using the "partial/version-banner.html" template for motdProcessor is deprecated`
|
|
389
|
+
);
|
|
390
|
+
context.addTemplateBlock(container, "version-banner", {
|
|
391
|
+
filename: "partials/version-banner.html",
|
|
392
|
+
data
|
|
393
|
+
});
|
|
394
|
+
}
|
|
378
395
|
}
|
|
379
396
|
};
|
|
380
397
|
}
|
|
@@ -413,13 +430,19 @@ function themeSelectProcessor() {
|
|
|
413
430
|
}
|
|
414
431
|
|
|
415
432
|
function selectableVersionProcessor(pkg, container, options) {
|
|
416
|
-
const { enabled = true } = options ?? {};
|
|
433
|
+
const { enabled = true, message = "Det finns en nyare version" } = options ?? {};
|
|
417
434
|
return {
|
|
418
435
|
name: "selectable-version-processor",
|
|
419
436
|
after: "generate-docs",
|
|
420
437
|
runtime: [
|
|
421
438
|
{
|
|
422
|
-
src: "src/runtime/select-version.ts"
|
|
439
|
+
src: "src/runtime/select-version.ts",
|
|
440
|
+
buildOptions: {
|
|
441
|
+
define: {
|
|
442
|
+
__PKG_VERSION__: JSON.stringify(pkg.version),
|
|
443
|
+
__MESSAGE__: JSON.stringify(message)
|
|
444
|
+
}
|
|
445
|
+
}
|
|
423
446
|
}
|
|
424
447
|
],
|
|
425
448
|
handler(context) {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// src/runtime/motd/motd.ts
|
|
4
|
+
var container = document.querySelector("#motd-container");
|
|
5
|
+
function showMessage(root, container2, message) {
|
|
6
|
+
const { template: id = "motd-message" } = message;
|
|
7
|
+
const selector = `template#${id}`;
|
|
8
|
+
const template = root.querySelector(selector);
|
|
9
|
+
if (!template) {
|
|
10
|
+
throw new Error(`MOTD template element with id "${id}" not found!`);
|
|
11
|
+
}
|
|
12
|
+
const wrapper = template.content.cloneNode(true);
|
|
13
|
+
const bindings = {
|
|
14
|
+
message: message.message,
|
|
15
|
+
...message.bindings
|
|
16
|
+
};
|
|
17
|
+
for (const element of wrapper.querySelectorAll(
|
|
18
|
+
"[data-bind]"
|
|
19
|
+
)) {
|
|
20
|
+
const key = element.dataset.bind;
|
|
21
|
+
const value = bindings[key] ?? "";
|
|
22
|
+
element.innerHTML = value;
|
|
23
|
+
element.removeAttribute("data-bind");
|
|
24
|
+
}
|
|
25
|
+
if (message.preprocess) {
|
|
26
|
+
message.preprocess(wrapper);
|
|
27
|
+
}
|
|
28
|
+
container2.append(wrapper);
|
|
29
|
+
}
|
|
30
|
+
var motd = {
|
|
31
|
+
enabled: true,
|
|
32
|
+
showMessage: showMessage.bind(null, document, container)
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// src/runtime/motd/motd-symbol.ts
|
|
36
|
+
var motdSymbol = Symbol.for("motd");
|
|
37
|
+
|
|
38
|
+
// src/runtime/motd/index.ts
|
|
39
|
+
window[motdSymbol] = motd;
|
|
@@ -1902,7 +1902,28 @@ function memoize(callback) {
|
|
|
1902
1902
|
};
|
|
1903
1903
|
}
|
|
1904
1904
|
|
|
1905
|
+
// src/runtime/motd/motd-symbol.ts
|
|
1906
|
+
var motdSymbol = Symbol.for("motd");
|
|
1907
|
+
|
|
1908
|
+
// src/runtime/motd/motd-proxy.ts
|
|
1909
|
+
var motdProxy = {
|
|
1910
|
+
get enabled() {
|
|
1911
|
+
return Boolean(window[motdSymbol]);
|
|
1912
|
+
},
|
|
1913
|
+
showMessage(...args) {
|
|
1914
|
+
if (window[motdSymbol]) {
|
|
1915
|
+
window[motdSymbol].showMessage(...args);
|
|
1916
|
+
} else {
|
|
1917
|
+
throw new Error(
|
|
1918
|
+
"motdProcessor(..) not enabled, cannot call showMessage(..)!"
|
|
1919
|
+
);
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
};
|
|
1923
|
+
|
|
1905
1924
|
// src/runtime/select-version.ts
|
|
1925
|
+
var current = __PKG_VERSION__;
|
|
1926
|
+
var message = __MESSAGE__;
|
|
1906
1927
|
var dialog = document.querySelector("#version-dialog");
|
|
1907
1928
|
var dialogCloseButton = dialog?.querySelector("button");
|
|
1908
1929
|
var form = document.querySelector("#version");
|
|
@@ -1929,11 +1950,21 @@ function clickOutside(event) {
|
|
|
1929
1950
|
async function fetchVersions() {
|
|
1930
1951
|
const url = getUrl(document, "../versions.json");
|
|
1931
1952
|
const response = await fetch(url);
|
|
1932
|
-
|
|
1933
|
-
|
|
1953
|
+
if (!response.ok) {
|
|
1954
|
+
console.error("An error occured when loading versions.json.");
|
|
1955
|
+
return {
|
|
1956
|
+
latest: current,
|
|
1957
|
+
versions: [current]
|
|
1958
|
+
};
|
|
1959
|
+
}
|
|
1960
|
+
return await response.json();
|
|
1934
1961
|
}
|
|
1935
1962
|
var getVersions = memoize(fetchVersions);
|
|
1936
|
-
function initVersionProcessor() {
|
|
1963
|
+
async function initVersionProcessor() {
|
|
1964
|
+
const { latest } = await getVersions();
|
|
1965
|
+
if (motdProxy.enabled && latest !== current) {
|
|
1966
|
+
motdProxy.showMessage({ message });
|
|
1967
|
+
}
|
|
1937
1968
|
if (!dialog || !dialogCloseButton || !form) {
|
|
1938
1969
|
return;
|
|
1939
1970
|
}
|
|
@@ -1946,7 +1977,7 @@ function initVersionProcessor() {
|
|
|
1946
1977
|
form.addEventListener("submit", async (event) => {
|
|
1947
1978
|
event.preventDefault();
|
|
1948
1979
|
try {
|
|
1949
|
-
const versions = await getVersions();
|
|
1980
|
+
const { versions } = await getVersions();
|
|
1950
1981
|
updateVersionList(versions);
|
|
1951
1982
|
} catch {
|
|
1952
1983
|
setErrorMessage();
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A runtime proxy for the motd api. When the `motdProcessor(..)` is installed
|
|
3
|
+
* the calls are routed to the actual API implementation or when not installed
|
|
4
|
+
* it gives useful error messages.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare const motd: MOTDApi;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export declare interface MOTDApi {
|
|
14
|
+
readonly enabled: boolean;
|
|
15
|
+
showMessage(message: MOTDMessage): void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export declare interface MOTDMessage {
|
|
22
|
+
/** Text message (may include HTML) */
|
|
23
|
+
message: string;
|
|
24
|
+
/** ID of message template to use */
|
|
25
|
+
template?: string;
|
|
26
|
+
/** Optional extra bindings */
|
|
27
|
+
bindings?: Record<string, string>;
|
|
28
|
+
/** Called with the new DOM element before the element is shown */
|
|
29
|
+
preprocess?(element: DocumentFragment): void;
|
|
30
|
+
}
|
|
31
|
+
|
|
1
32
|
/**
|
|
2
33
|
* Executes callback when DOM is ready. If DOM is already ready the callback is
|
|
3
34
|
* executed during the next cycle.
|
package/dist/runtime.js
CHANGED
|
@@ -139029,6 +139029,7 @@ var init_architectureDiagram_IFBEXTG3 = __esm({
|
|
|
139029
139029
|
// src/runtime/index.ts
|
|
139030
139030
|
var runtime_exports = {};
|
|
139031
139031
|
__export(runtime_exports, {
|
|
139032
|
+
motd: () => motdProxy,
|
|
139032
139033
|
onContentReady: () => onContentReady
|
|
139033
139034
|
});
|
|
139034
139035
|
module.exports = __toCommonJS(runtime_exports);
|
|
@@ -141930,6 +141931,25 @@ onContentReady(() => {
|
|
|
141930
141931
|
calculateVisibility(refs);
|
|
141931
141932
|
});
|
|
141932
141933
|
|
|
141934
|
+
// src/runtime/motd/motd-symbol.ts
|
|
141935
|
+
var motdSymbol = Symbol.for("motd");
|
|
141936
|
+
|
|
141937
|
+
// src/runtime/motd/motd-proxy.ts
|
|
141938
|
+
var motdProxy = {
|
|
141939
|
+
get enabled() {
|
|
141940
|
+
return Boolean(window[motdSymbol]);
|
|
141941
|
+
},
|
|
141942
|
+
showMessage(...args) {
|
|
141943
|
+
if (window[motdSymbol]) {
|
|
141944
|
+
window[motdSymbol].showMessage(...args);
|
|
141945
|
+
} else {
|
|
141946
|
+
throw new Error(
|
|
141947
|
+
"motdProcessor(..) not enabled, cannot call showMessage(..)!"
|
|
141948
|
+
);
|
|
141949
|
+
}
|
|
141950
|
+
}
|
|
141951
|
+
};
|
|
141952
|
+
|
|
141933
141953
|
// src/runtime/index.ts
|
|
141934
141954
|
window.toggleMarkup = toggleMarkup;
|
|
141935
141955
|
/*! Bundled license information:
|
package/dist/style/index.css
CHANGED
|
@@ -1193,13 +1193,6 @@ kbd {
|
|
|
1193
1193
|
background-color: #f4f4f4;
|
|
1194
1194
|
}
|
|
1195
1195
|
|
|
1196
|
-
.cookie-warning {
|
|
1197
|
-
background: var(--docs-cookie-background-color);
|
|
1198
|
-
border-bottom: 2px solid var(--docs-cookie-border-color);
|
|
1199
|
-
display: none;
|
|
1200
|
-
padding: 1rem 1.5rem 0;
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
1196
|
:root {
|
|
1204
1197
|
--docs-font-family: arial, "Helvetica Neue", sans-serif;
|
|
1205
1198
|
--docs-font-weight: normal;
|
|
@@ -1233,6 +1226,11 @@ kbd {
|
|
|
1233
1226
|
--docs-messagebox-warning-background: var(--docs-warning-background);
|
|
1234
1227
|
--docs-messagebox-danger-border: var(--docs-error-color);
|
|
1235
1228
|
--docs-messagebox-danger-background: var(--docs-error-background);
|
|
1229
|
+
--docs-motd-text-color: var(--docs-text-color-discrete);
|
|
1230
|
+
--docs-motd-info-accent-color: #4a52b6;
|
|
1231
|
+
--docs-motd-info-background-color: #f5f6fa;
|
|
1232
|
+
--docs-motd-link-color: var(--docs-text-color-discrete);
|
|
1233
|
+
--docs-motd-hover-color: var(--docs-text-color-default);
|
|
1236
1234
|
--docs-tags-optional-background-color: transparent;
|
|
1237
1235
|
--docs-tags-optional-border-color: #5f6165;
|
|
1238
1236
|
--docs-tags-optional-text-color: var(--docs-text-color-discrete);
|
|
@@ -1309,6 +1307,51 @@ textarea {
|
|
|
1309
1307
|
margin: 0;
|
|
1310
1308
|
}
|
|
1311
1309
|
|
|
1310
|
+
.cookie-warning {
|
|
1311
|
+
background: var(--docs-cookie-background-color);
|
|
1312
|
+
border-bottom: 2px solid var(--docs-cookie-border-color);
|
|
1313
|
+
display: none;
|
|
1314
|
+
padding: 1rem 1.5rem 0;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
.docs-motd {
|
|
1318
|
+
padding: 1.5rem;
|
|
1319
|
+
margin: 0.5rem;
|
|
1320
|
+
color: var(--docs-motd-text-color);
|
|
1321
|
+
}
|
|
1322
|
+
.docs-motd a {
|
|
1323
|
+
color: var(--docs-motd-link-color);
|
|
1324
|
+
}
|
|
1325
|
+
.docs-motd a:hover, .docs-motd a:focus {
|
|
1326
|
+
color: var(--docs-motd-hover-color);
|
|
1327
|
+
}
|
|
1328
|
+
.docs-motd p:last-child {
|
|
1329
|
+
margin-bottom: 0;
|
|
1330
|
+
}
|
|
1331
|
+
.docs-motd--info {
|
|
1332
|
+
border: 2px solid var(--docs-motd-info-accent-color);
|
|
1333
|
+
border-top: 1rem solid var(--docs-motd-info-accent-color);
|
|
1334
|
+
background-color: var(--docs-motd-info-background-color);
|
|
1335
|
+
border-radius: 2px;
|
|
1336
|
+
}
|
|
1337
|
+
.docs-motd--info .icon--circle {
|
|
1338
|
+
color: #fff;
|
|
1339
|
+
}
|
|
1340
|
+
.docs-motd--info .icon--i {
|
|
1341
|
+
color: var(--docs-motd-text-color);
|
|
1342
|
+
}
|
|
1343
|
+
.docs-motd__icon {
|
|
1344
|
+
float: left;
|
|
1345
|
+
height: 1.5rem;
|
|
1346
|
+
margin: 0 0.4rem 0 0;
|
|
1347
|
+
width: 1.5rem;
|
|
1348
|
+
}
|
|
1349
|
+
.docs-motd__icon .icon,
|
|
1350
|
+
.docs-motd__icon .icon-stack {
|
|
1351
|
+
height: 1.5rem;
|
|
1352
|
+
width: 1.5rem;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1312
1355
|
.version {
|
|
1313
1356
|
color: var(--docs-text-color-discrete);
|
|
1314
1357
|
text-wrap: nowrap;
|
|
@@ -1350,4 +1393,15 @@ body {
|
|
|
1350
1393
|
.page-header {
|
|
1351
1394
|
--docs-text-color-default: var(--docs-header-text-color-default);
|
|
1352
1395
|
--docs-text-color-discrete: var(--docs-header-text-color-discrete);
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
.sr-only {
|
|
1399
|
+
position: absolute;
|
|
1400
|
+
width: 1px;
|
|
1401
|
+
height: 1px;
|
|
1402
|
+
margin: -1px;
|
|
1403
|
+
padding: 0;
|
|
1404
|
+
overflow: hidden;
|
|
1405
|
+
clip: rect(0, 0, 0, 0);
|
|
1406
|
+
border: 0;
|
|
1353
1407
|
}
|
package/dist/style/site.css
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
.cookie-warning {
|
|
2
|
-
background: var(--docs-cookie-background-color);
|
|
3
|
-
border-bottom: 2px solid var(--docs-cookie-border-color);
|
|
4
|
-
display: none;
|
|
5
|
-
padding: 1rem 1.5rem 0;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
1
|
:root {
|
|
9
2
|
--docs-font-family: arial, "Helvetica Neue", sans-serif;
|
|
10
3
|
--docs-font-weight: normal;
|
|
@@ -38,6 +31,11 @@
|
|
|
38
31
|
--docs-messagebox-warning-background: var(--docs-warning-background);
|
|
39
32
|
--docs-messagebox-danger-border: var(--docs-error-color);
|
|
40
33
|
--docs-messagebox-danger-background: var(--docs-error-background);
|
|
34
|
+
--docs-motd-text-color: var(--docs-text-color-discrete);
|
|
35
|
+
--docs-motd-info-accent-color: #4a52b6;
|
|
36
|
+
--docs-motd-info-background-color: #f5f6fa;
|
|
37
|
+
--docs-motd-link-color: var(--docs-text-color-discrete);
|
|
38
|
+
--docs-motd-hover-color: var(--docs-text-color-default);
|
|
41
39
|
--docs-tags-optional-background-color: transparent;
|
|
42
40
|
--docs-tags-optional-border-color: #5f6165;
|
|
43
41
|
--docs-tags-optional-text-color: var(--docs-text-color-discrete);
|
|
@@ -114,6 +112,51 @@ textarea {
|
|
|
114
112
|
margin: 0;
|
|
115
113
|
}
|
|
116
114
|
|
|
115
|
+
.cookie-warning {
|
|
116
|
+
background: var(--docs-cookie-background-color);
|
|
117
|
+
border-bottom: 2px solid var(--docs-cookie-border-color);
|
|
118
|
+
display: none;
|
|
119
|
+
padding: 1rem 1.5rem 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.docs-motd {
|
|
123
|
+
padding: 1.5rem;
|
|
124
|
+
margin: 0.5rem;
|
|
125
|
+
color: var(--docs-motd-text-color);
|
|
126
|
+
}
|
|
127
|
+
.docs-motd a {
|
|
128
|
+
color: var(--docs-motd-link-color);
|
|
129
|
+
}
|
|
130
|
+
.docs-motd a:hover, .docs-motd a:focus {
|
|
131
|
+
color: var(--docs-motd-hover-color);
|
|
132
|
+
}
|
|
133
|
+
.docs-motd p:last-child {
|
|
134
|
+
margin-bottom: 0;
|
|
135
|
+
}
|
|
136
|
+
.docs-motd--info {
|
|
137
|
+
border: 2px solid var(--docs-motd-info-accent-color);
|
|
138
|
+
border-top: 1rem solid var(--docs-motd-info-accent-color);
|
|
139
|
+
background-color: var(--docs-motd-info-background-color);
|
|
140
|
+
border-radius: 2px;
|
|
141
|
+
}
|
|
142
|
+
.docs-motd--info .icon--circle {
|
|
143
|
+
color: #fff;
|
|
144
|
+
}
|
|
145
|
+
.docs-motd--info .icon--i {
|
|
146
|
+
color: var(--docs-motd-text-color);
|
|
147
|
+
}
|
|
148
|
+
.docs-motd__icon {
|
|
149
|
+
float: left;
|
|
150
|
+
height: 1.5rem;
|
|
151
|
+
margin: 0 0.4rem 0 0;
|
|
152
|
+
width: 1.5rem;
|
|
153
|
+
}
|
|
154
|
+
.docs-motd__icon .icon,
|
|
155
|
+
.docs-motd__icon .icon-stack {
|
|
156
|
+
height: 1.5rem;
|
|
157
|
+
width: 1.5rem;
|
|
158
|
+
}
|
|
159
|
+
|
|
117
160
|
:root {
|
|
118
161
|
--docs-breakpoint-sm: 640px;
|
|
119
162
|
--docs-breakpoint-md: 1024px;
|
|
@@ -161,4 +204,15 @@ body {
|
|
|
161
204
|
.page-header {
|
|
162
205
|
--docs-text-color-default: var(--docs-header-text-color-default);
|
|
163
206
|
--docs-text-color-discrete: var(--docs-header-text-color-discrete);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.sr-only {
|
|
210
|
+
position: absolute;
|
|
211
|
+
width: 1px;
|
|
212
|
+
height: 1px;
|
|
213
|
+
margin: -1px;
|
|
214
|
+
padding: 0;
|
|
215
|
+
overflow: hidden;
|
|
216
|
+
clip: rect(0, 0, 0, 0);
|
|
217
|
+
border: 0;
|
|
164
218
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{%- macro motd(message) %}
|
|
2
|
+
<div class="docs-motd docs-motd--info">
|
|
3
|
+
<span class="docs-motd__icon">
|
|
4
|
+
<span class="icon-stack icon-stack--info">
|
|
5
|
+
<svg class="icon icon--circle" focusable="false" aria-hidden="true">
|
|
6
|
+
<use xlink:href="#docs-icon-circle"></use>
|
|
7
|
+
</svg>
|
|
8
|
+
<svg class="icon icon--i" focusable="false" aria-hidden="true">
|
|
9
|
+
<use xlink:href="#docs-icon-i"></use>
|
|
10
|
+
</svg>
|
|
11
|
+
</span>
|
|
12
|
+
</span>
|
|
13
|
+
{%- if message -%}
|
|
14
|
+
<span class="sr-only">Informationsmeddelande</span>
|
|
15
|
+
<p>{{ message }}</p>
|
|
16
|
+
{%- else -%}
|
|
17
|
+
<span data-bind="screenreader" class="sr-only"></span>
|
|
18
|
+
<p data-bind="message"></p>
|
|
19
|
+
{%- endif -%}
|
|
20
|
+
</div>
|
|
21
|
+
{% endmacro -%}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
{
|
|
1
|
+
<div class="footer">
|
|
2
|
+
<!-- prettier-ignore -->
|
|
3
|
+
{% container "footer" %}
|
|
4
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{% from "macro/motd.njk.html" import motd -%}
|
|
2
|
+
|
|
3
|
+
{# template used for dynamic messages #}
|
|
4
|
+
<template id="motd-message">
|
|
5
|
+
{{- motd() -}}
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
{# container hold all messages #}
|
|
9
|
+
<div id="motd-container">
|
|
10
|
+
{# render all static messages #}
|
|
11
|
+
{%- if message -%}
|
|
12
|
+
{{- motd(message) -}}
|
|
13
|
+
{%- endif -%}
|
|
14
|
+
</div>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<div id="version-banner" class="message-box message-box--info" style="display: none">
|
|
2
|
-
<span class="message-box__icon">
|
|
3
|
-
<span class="icon-stack icon-stack--info">
|
|
4
|
-
<svg class="icon__info icon" focusable="false" aria-hidden="true">
|
|
5
|
-
<use xlink:href="#docs-icon-circle"></use>
|
|
6
|
-
</svg>
|
|
7
|
-
<svg class="icon" focusable="false" aria-hidden="true">
|
|
8
|
-
<use xlink:href="#docs-icon-i"></use>
|
|
9
|
-
</svg>
|
|
10
|
-
</span>
|
|
11
|
-
</span>
|
|
12
|
-
<span class="sr-only">Informationsmeddelande</span>
|
|
13
|
-
<p>{{ message }}</p>
|
|
14
|
-
</div>
|