@dso-toolkit/core 34.2.0 → 36.0.0
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/cjs/dso-alert.cjs.entry.js +1 -1
- package/dist/cjs/dso-attachments-counter.cjs.entry.js +1 -1
- package/dist/cjs/dso-autosuggest.cjs.entry.js +7 -3
- package/dist/cjs/dso-badge.cjs.entry.js +1 -1
- package/dist/cjs/dso-banner.cjs.entry.js +1 -1
- package/dist/cjs/dso-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/dso-dropdown-menu.cjs.entry.js +2 -2
- package/dist/cjs/dso-header.cjs.entry.js +16 -7
- package/dist/cjs/dso-helpcenter-panel.cjs.entry.js +1 -1
- package/dist/cjs/dso-highlight-box.cjs.entry.js +1 -1
- package/dist/cjs/dso-icon.cjs.entry.js +1 -1
- package/dist/cjs/dso-image-overlay.cjs.entry.js +62 -0
- package/dist/cjs/dso-info-button.cjs.entry.js +1 -1
- package/dist/cjs/dso-info_2.cjs.entry.js +2 -2
- package/dist/cjs/dso-label.cjs.entry.js +1 -1
- package/dist/cjs/dso-map-base-layers.cjs.entry.js +1 -1
- package/dist/cjs/dso-map-controls.cjs.entry.js +22 -19
- package/dist/cjs/dso-map-overlays.cjs.entry.js +1 -1
- package/dist/cjs/dso-ozon-content.cjs.entry.js +289 -419
- package/dist/cjs/dso-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/dso-progress-indicator.cjs.entry.js +1 -1
- package/dist/cjs/dso-toggletip.cjs.entry.js +1 -1
- package/dist/cjs/dso-toolkit.cjs.js +3 -3
- package/dist/cjs/dso-tooltip.cjs.entry.js +8 -4
- package/dist/cjs/dso-tree-view.cjs.entry.js +9 -9
- package/dist/cjs/dso-viewer-grid.cjs.entry.js +6 -712
- package/dist/cjs/focus-trap.esm-a85643b0.js +746 -0
- package/dist/cjs/{index-5ea63531.js → index-dfb4ea62.js} +73 -64
- package/dist/cjs/index.esm-3520a2a6.js +427 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/alert/alert.template.js +1 -1
- package/dist/collection/components/anchor/anchor.template.js +1 -1
- package/dist/collection/components/autosuggest/autosuggest.css +1 -1
- package/dist/collection/components/autosuggest/autosuggest.js +6 -2
- package/dist/collection/components/badge/badge.template.js +1 -1
- package/dist/collection/components/button/button.template.js +1 -1
- package/dist/collection/components/date-picker/date-picker.css +6 -6
- package/dist/collection/components/date-picker/date-picker.template.js +1 -1
- package/dist/collection/components/definition-list/definition-list.template.js +2 -2
- package/dist/collection/components/dropdown-menu/dropdown-menu.template.js +1 -1
- package/dist/collection/components/header/header.css +1 -1
- package/dist/collection/components/header/header.js +38 -9
- package/dist/collection/components/header/header.template.js +4 -2
- package/dist/collection/components/helpcenter-panel/helpcenter-panel.template.js +2 -2
- package/dist/collection/components/highlight-box/highlight-box.template.js +5 -2
- package/dist/collection/components/icon/icon.template.js +1 -1
- package/dist/collection/components/image-overlay/image-overlay.css +263 -0
- package/dist/collection/components/image-overlay/image-overlay.js +72 -0
- package/dist/collection/components/image-overlay/image-overlay.template.js +7 -0
- package/dist/collection/components/label/label.template.js +2 -2
- package/dist/collection/components/list/list.template.js +1 -1
- package/dist/collection/components/map-controls/map-controls.js +17 -19
- package/dist/collection/components/ozon-content/get-node-name.function.js +9 -0
- package/dist/collection/components/ozon-content/nodes/al.node.js +14 -0
- package/dist/collection/components/ozon-content/nodes/document.node.js +9 -0
- package/dist/collection/components/ozon-content/nodes/ext-ref.node.js +15 -0
- package/dist/collection/components/ozon-content/nodes/fallback.node.js +11 -0
- package/dist/collection/components/ozon-content/nodes/illustratie.node.js +13 -0
- package/dist/collection/components/ozon-content/nodes/inhoud.node.js +14 -0
- package/dist/collection/components/ozon-content/nodes/inline.nodes.js +21 -0
- package/dist/collection/components/ozon-content/nodes/int-ref.node.js +26 -0
- package/dist/collection/components/ozon-content/nodes/noot.node.js +27 -0
- package/dist/collection/components/ozon-content/nodes/table.node/colspec/colspec-mapper.js +39 -0
- package/dist/collection/components/ozon-content/nodes/table.node/colspec/colspec.interface.js +2 -0
- package/dist/collection/components/ozon-content/nodes/table.node/index.js +1 -0
- package/dist/collection/components/ozon-content/nodes/table.node/table-cell.js +25 -0
- package/dist/collection/components/ozon-content/nodes/table.node/table-colgroup.js +4 -0
- package/dist/collection/components/ozon-content/nodes/table.node/table-rows.js +5 -0
- package/dist/collection/components/ozon-content/nodes/table.node/table.node.js +32 -0
- package/dist/collection/components/ozon-content/nodes/text.node.js +9 -0
- package/dist/collection/components/ozon-content/ozon-content-context.interface.js +1 -0
- package/dist/collection/components/ozon-content/ozon-content-mapper.js +80 -0
- package/dist/collection/components/ozon-content/ozon-content-node-context.interface.js +1 -0
- package/dist/collection/components/ozon-content/ozon-content-node-state.interface.js +1 -0
- package/dist/collection/components/ozon-content/ozon-content-node.interface.js +1 -0
- package/dist/collection/components/ozon-content/ozon-content.css +84 -23
- package/dist/collection/components/ozon-content/ozon-content.js +21 -33
- package/dist/collection/components/progress-bar/progress-bar.template.js +1 -1
- package/dist/collection/components/progress-indicator/progress-indicator.template.js +1 -1
- package/dist/collection/components/selectable/selectable.css +7 -1
- package/dist/collection/components/selectable/selectable.template.js +1 -1
- package/dist/collection/components/toggletip/toggletip.template.js +2 -2
- package/dist/collection/components/tooltip/tooltip.css +1 -1
- package/dist/collection/components/tooltip/tooltip.template.js +1 -1
- package/dist/collection/components/tree-view/tree-item.js +7 -7
- package/dist/collection/components/tree-view/tree-view.css +86 -15
- package/dist/collection/components/viewer-grid/viewer-grid.css +32 -4
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +1541 -1400
- package/dist/dso-toolkit/dso-toolkit.css +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/p-016ed5a8.entry.js +1 -0
- package/dist/dso-toolkit/p-0216f283.entry.js +1 -0
- package/dist/dso-toolkit/{p-348414bf.entry.js → p-09bcacd0.entry.js} +1 -1
- package/dist/dso-toolkit/{p-2b6a3dfa.entry.js → p-117a31fe.entry.js} +1 -1
- package/dist/dso-toolkit/p-131d54e3.js +5 -0
- package/dist/dso-toolkit/{p-50b63cf4.entry.js → p-1eeadd3e.entry.js} +1 -1
- package/dist/dso-toolkit/{p-ad540748.entry.js → p-2279329b.entry.js} +1 -1
- package/dist/dso-toolkit/p-258e8371.entry.js +1 -0
- package/dist/dso-toolkit/{p-bc14cafd.entry.js → p-3ced438e.entry.js} +1 -1
- package/dist/dso-toolkit/{p-c54ecae1.entry.js → p-406b179d.entry.js} +1 -1
- package/dist/dso-toolkit/p-4b5f6b4c.entry.js +1 -0
- package/dist/dso-toolkit/{p-3b493a2c.entry.js → p-527a85b6.entry.js} +1 -1
- package/dist/dso-toolkit/{p-94dffa65.entry.js → p-52f159e7.entry.js} +1 -1
- package/dist/dso-toolkit/{p-dc86d830.entry.js → p-58f5e092.entry.js} +1 -1
- package/dist/dso-toolkit/p-5e5fbd41.js +5 -0
- package/dist/dso-toolkit/{p-f0b67246.entry.js → p-639228f6.entry.js} +1 -1
- package/dist/dso-toolkit/{p-951f5872.entry.js → p-6a8452bd.entry.js} +1 -1
- package/dist/dso-toolkit/{p-4e573fc5.entry.js → p-98ef5f8c.entry.js} +1 -1
- package/dist/dso-toolkit/{p-94b79e43.entry.js → p-a1c9bb35.entry.js} +1 -1
- package/dist/dso-toolkit/{p-3c4dbd89.entry.js → p-a5008a4e.entry.js} +1 -1
- package/dist/dso-toolkit/{p-c95108fe.entry.js → p-a59dcbb0.entry.js} +1 -1
- package/dist/dso-toolkit/p-b06c275a.entry.js +1 -0
- package/dist/dso-toolkit/p-b4222d6e.entry.js +1 -0
- package/dist/dso-toolkit/{p-dad72605.js → p-b9eb3491.js} +1 -1
- package/dist/dso-toolkit/p-bec38cf5.entry.js +1 -0
- package/dist/dso-toolkit/{p-ad2210ad.entry.js → p-d0d3ca99.entry.js} +1 -1
- package/dist/dso-toolkit/{p-5037944e.entry.js → p-d72edd80.entry.js} +1 -1
- package/dist/dso-toolkit/{p-1fefbf8c.entry.js → p-e1934ab6.entry.js} +1 -1
- package/dist/esm/dso-alert.entry.js +1 -1
- package/dist/esm/dso-attachments-counter.entry.js +1 -1
- package/dist/esm/dso-autosuggest.entry.js +7 -3
- package/dist/esm/dso-badge.entry.js +1 -1
- package/dist/esm/dso-banner.entry.js +1 -1
- package/dist/esm/dso-date-picker.entry.js +2 -2
- package/dist/esm/dso-dropdown-menu.entry.js +2 -2
- package/dist/esm/dso-header.entry.js +16 -7
- package/dist/esm/dso-helpcenter-panel.entry.js +1 -1
- package/dist/esm/dso-highlight-box.entry.js +1 -1
- package/dist/esm/dso-icon.entry.js +1 -1
- package/dist/esm/dso-image-overlay.entry.js +58 -0
- package/dist/esm/dso-info-button.entry.js +1 -1
- package/dist/esm/dso-info_2.entry.js +2 -2
- package/dist/esm/dso-label.entry.js +1 -1
- package/dist/esm/dso-map-base-layers.entry.js +1 -1
- package/dist/esm/dso-map-controls.entry.js +22 -19
- package/dist/esm/dso-map-overlays.entry.js +1 -1
- package/dist/esm/dso-ozon-content.entry.js +289 -419
- package/dist/esm/dso-progress-bar.entry.js +1 -1
- package/dist/esm/dso-progress-indicator.entry.js +1 -1
- package/dist/esm/dso-toggletip.entry.js +1 -1
- package/dist/esm/dso-toolkit.js +3 -3
- package/dist/esm/dso-tooltip.entry.js +8 -4
- package/dist/esm/dso-tree-view.entry.js +9 -9
- package/dist/esm/dso-viewer-grid.entry.js +4 -710
- package/dist/esm/focus-trap.esm-a01ad6c9.js +744 -0
- package/dist/esm/{index-d54cae76.js → index-9ec8c07f.js} +73 -64
- package/dist/esm/index.esm-45465af7.js +422 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/autosuggest/autosuggest.d.ts +15 -1
- package/dist/types/components/header/header.d.ts +7 -1
- package/dist/types/components/header/header.template.d.ts +1 -1
- package/dist/types/components/image-overlay/image-overlay.d.ts +15 -0
- package/dist/types/components/image-overlay/image-overlay.template.d.ts +2 -0
- package/dist/types/components/ozon-content/get-node-name.function.d.ts +1 -0
- package/dist/types/components/ozon-content/nodes/al.node.d.ts +6 -0
- package/dist/types/components/ozon-content/nodes/document.node.d.ts +6 -0
- package/dist/types/components/ozon-content/nodes/ext-ref.node.d.ts +6 -0
- package/dist/types/components/ozon-content/nodes/fallback.node.d.ts +6 -0
- package/dist/types/components/ozon-content/nodes/illustratie.node.d.ts +5 -0
- package/dist/types/components/ozon-content/nodes/inhoud.node.d.ts +6 -0
- package/dist/types/components/ozon-content/nodes/inline.nodes.d.ts +6 -0
- package/dist/types/components/ozon-content/nodes/int-ref.node.d.ts +6 -0
- package/dist/types/components/ozon-content/nodes/noot.node.d.ts +8 -0
- package/dist/types/components/ozon-content/nodes/table.node/colspec/colspec-mapper.d.ts +2 -0
- package/dist/types/components/ozon-content/nodes/table.node/colspec/colspec.interface.d.ts +10 -0
- package/dist/types/components/ozon-content/nodes/table.node/index.d.ts +1 -0
- package/dist/types/components/ozon-content/nodes/table.node/table-cell.d.ts +8 -0
- package/dist/types/components/ozon-content/nodes/table.node/table-colgroup.d.ts +5 -0
- package/dist/types/components/ozon-content/nodes/table.node/table-rows.d.ts +8 -0
- package/dist/types/components/ozon-content/nodes/table.node/table.node.d.ts +7 -0
- package/dist/types/components/ozon-content/nodes/text.node.d.ts +5 -0
- package/dist/types/components/ozon-content/ozon-content-context.interface.d.ts +8 -0
- package/dist/types/components/ozon-content/ozon-content-mapper.d.ts +11 -0
- package/dist/types/components/ozon-content/ozon-content-node-context.interface.d.ts +7 -0
- package/dist/types/components/ozon-content/ozon-content-node-state.interface.d.ts +3 -0
- package/dist/types/components/ozon-content/ozon-content-node.interface.d.ts +7 -0
- package/dist/types/components/ozon-content/ozon-content.d.ts +7 -10
- package/dist/types/components/ozon-content/ozon-content.interfaces.d.ts +2 -2
- package/dist/types/components.d.ts +22 -8
- package/dist/types/icon/dso-icon-sass-function.d.ts +1 -1
- package/package.json +29 -27
- package/dist/cjs/index.esm-2ac7081c.js +0 -267
- package/dist/collection/components/ozon-content/ozon-content.transformer.js +0 -105
- package/dist/dso-toolkit/p-20856f91.entry.js +0 -1
- package/dist/dso-toolkit/p-88bc5873.entry.js +0 -1
- package/dist/dso-toolkit/p-8b6e3abc.entry.js +0 -1
- package/dist/dso-toolkit/p-8bf3a60e.js +0 -5
- package/dist/dso-toolkit/p-a7306b7b.entry.js +0 -1
- package/dist/dso-toolkit/p-daa1e29d.entry.js +0 -1
- package/dist/dso-toolkit/p-de3ab027.entry.js +0 -5
- package/dist/esm/index.esm-a1362957.js +0 -262
- package/dist/types/components/ozon-content/ozon-content.transformer.d.ts +0 -15
|
@@ -2,491 +2,361 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-dfb4ea62.js');
|
|
6
6
|
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var isString = typeof input === 'string' || input instanceof String;
|
|
11
|
-
|
|
12
|
-
if (!isString) {
|
|
13
|
-
var invalidType = _typeof(input);
|
|
14
|
-
|
|
15
|
-
if (input === null) invalidType = 'null';else if (invalidType === 'object') invalidType = input.constructor.name;
|
|
16
|
-
throw new TypeError("Expected a string but received a ".concat(invalidType));
|
|
7
|
+
function getNodeName(node) {
|
|
8
|
+
if (node instanceof Element) {
|
|
9
|
+
return node.localName;
|
|
17
10
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function merge() {
|
|
21
|
-
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
22
|
-
var defaults = arguments.length > 1 ? arguments[1] : undefined;
|
|
23
|
-
|
|
24
|
-
for (var key in defaults) {
|
|
25
|
-
if (typeof obj[key] === 'undefined') {
|
|
26
|
-
obj[key] = defaults[key];
|
|
27
|
-
}
|
|
11
|
+
if (node.nodeName.includes(':')) {
|
|
12
|
+
return node.nodeName.substring(node.nodeName.indexOf(':') + 1);
|
|
28
13
|
}
|
|
29
|
-
|
|
30
|
-
return obj;
|
|
14
|
+
return node.nodeName;
|
|
31
15
|
}
|
|
32
16
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
allow_trailing_dot: false,
|
|
37
|
-
allow_numeric_tld: false,
|
|
38
|
-
allow_wildcard: false
|
|
39
|
-
};
|
|
40
|
-
function isFQDN(str, options) {
|
|
41
|
-
assertString(str);
|
|
42
|
-
options = merge(options, default_fqdn_options);
|
|
43
|
-
/* Remove the optional trailing dot before checking validity */
|
|
44
|
-
|
|
45
|
-
if (options.allow_trailing_dot && str[str.length - 1] === '.') {
|
|
46
|
-
str = str.substring(0, str.length - 1);
|
|
17
|
+
class OzonContentAlNode {
|
|
18
|
+
constructor() {
|
|
19
|
+
this.name = 'Al';
|
|
47
20
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
21
|
+
render(node, { mapNodeToJsx, path }) {
|
|
22
|
+
const nestedAl = path.some(node => getNodeName(node) === 'Al');
|
|
23
|
+
const content = mapNodeToJsx(node.childNodes);
|
|
24
|
+
return nestedAl
|
|
25
|
+
? index.h("span", { role: "paragraph" }, content)
|
|
26
|
+
: index.h("p", null, content);
|
|
53
27
|
}
|
|
28
|
+
}
|
|
54
29
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) {
|
|
65
|
-
return false;
|
|
66
|
-
} // disallow spaces
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (/\s/.test(tld)) {
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
} // reject numeric TLDs
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (!options.allow_numeric_tld && /^\d+$/.test(tld)) {
|
|
76
|
-
return false;
|
|
30
|
+
class OzonContentDocumentNode {
|
|
31
|
+
constructor() {
|
|
32
|
+
this.name = '#document';
|
|
33
|
+
}
|
|
34
|
+
render(node, { mapNodeToJsx }) {
|
|
35
|
+
return index.h(index.Fragment, null, mapNodeToJsx(node.childNodes));
|
|
77
36
|
}
|
|
78
|
-
|
|
79
|
-
return parts.every(function (part) {
|
|
80
|
-
if (part.length > 63) {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(part)) {
|
|
85
|
-
return false;
|
|
86
|
-
} // disallow full-width chars
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if (/[\uff01-\uff5e]/.test(part)) {
|
|
90
|
-
return false;
|
|
91
|
-
} // disallow parts starting or ending with hyphen
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (/^-|-$/.test(part)) {
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (!options.allow_underscores && /_/.test(part)) {
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return true;
|
|
103
|
-
});
|
|
104
37
|
}
|
|
105
38
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
ff02::5678 (on the 5th link of the node)
|
|
113
|
-
ff08::9abc (on the 10th organization of the node)
|
|
114
|
-
|
|
115
|
-
would be represented as follows:
|
|
116
|
-
|
|
117
|
-
fe80::1234%1
|
|
118
|
-
ff02::5678%5
|
|
119
|
-
ff08::9abc%10
|
|
120
|
-
|
|
121
|
-
(Here we assume a natural translation from a zone index to the
|
|
122
|
-
<zone_id> part, where the Nth zone of any scope is translated into
|
|
123
|
-
"N".)
|
|
124
|
-
|
|
125
|
-
If we use interface names as <zone_id>, those addresses could also be
|
|
126
|
-
represented as follows:
|
|
127
|
-
|
|
128
|
-
fe80::1234%ne0
|
|
129
|
-
ff02::5678%pvc1.3
|
|
130
|
-
ff08::9abc%interface10
|
|
131
|
-
|
|
132
|
-
where the interface "ne0" belongs to the 1st link, "pvc1.3" belongs
|
|
133
|
-
to the 5th link, and "interface10" belongs to the 10th organization.
|
|
134
|
-
* * */
|
|
135
|
-
|
|
136
|
-
var IPv4SegmentFormat = '(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';
|
|
137
|
-
var IPv4AddressFormat = "(".concat(IPv4SegmentFormat, "[.]){3}").concat(IPv4SegmentFormat);
|
|
138
|
-
var IPv4AddressRegExp = new RegExp("^".concat(IPv4AddressFormat, "$"));
|
|
139
|
-
var IPv6SegmentFormat = '(?:[0-9a-fA-F]{1,4})';
|
|
140
|
-
var IPv6AddressRegExp = new RegExp('^(' + "(?:".concat(IPv6SegmentFormat, ":){7}(?:").concat(IPv6SegmentFormat, "|:)|") + "(?:".concat(IPv6SegmentFormat, ":){6}(?:").concat(IPv4AddressFormat, "|:").concat(IPv6SegmentFormat, "|:)|") + "(?:".concat(IPv6SegmentFormat, ":){5}(?::").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,2}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){4}(?:(:").concat(IPv6SegmentFormat, "){0,1}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,3}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){3}(?:(:").concat(IPv6SegmentFormat, "){0,2}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,4}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){2}(?:(:").concat(IPv6SegmentFormat, "){0,3}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,5}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){1}(?:(:").concat(IPv6SegmentFormat, "){0,4}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,6}|:)|") + "(?::((?::".concat(IPv6SegmentFormat, "){0,5}:").concat(IPv4AddressFormat, "|(?::").concat(IPv6SegmentFormat, "){1,7}|:))") + ')(%[0-9a-zA-Z-.:]{1,})?$');
|
|
141
|
-
function isIP(str) {
|
|
142
|
-
var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
143
|
-
assertString(str);
|
|
144
|
-
version = String(version);
|
|
145
|
-
|
|
146
|
-
if (!version) {
|
|
147
|
-
return isIP(str, 4) || isIP(str, 6);
|
|
39
|
+
class OzonContentExtRefNode {
|
|
40
|
+
constructor() {
|
|
41
|
+
this.name = [
|
|
42
|
+
'ExtRef',
|
|
43
|
+
'ExtIoRef'
|
|
44
|
+
];
|
|
148
45
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
var parts = str.split('.').sort(function (a, b) {
|
|
156
|
-
return a - b;
|
|
157
|
-
});
|
|
158
|
-
return parts[3] <= 255;
|
|
46
|
+
render(node, { mapNodeToJsx }) {
|
|
47
|
+
var _a;
|
|
48
|
+
return (index.h("a", { target: "_blank", rel: "noopener noreferrer", href: (_a = node.getAttribute('ref')) !== null && _a !== void 0 ? _a : undefined },
|
|
49
|
+
index.h("span", { class: "sr-only" }, "opent in nieuw venster"),
|
|
50
|
+
mapNodeToJsx(node.childNodes)));
|
|
159
51
|
}
|
|
52
|
+
}
|
|
160
53
|
|
|
161
|
-
|
|
162
|
-
|
|
54
|
+
class OzonContentIllustratieNode {
|
|
55
|
+
constructor() {
|
|
56
|
+
this.name = [
|
|
57
|
+
'Illustratie',
|
|
58
|
+
'InlineTekstAfbeelding'
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
render(node) {
|
|
62
|
+
var _a, _b, _c, _d;
|
|
63
|
+
return (index.h("img", { src: (_a = node.getAttribute('naam')) !== null && _a !== void 0 ? _a : undefined, alt: (_b = node.getAttribute('naam')) !== null && _b !== void 0 ? _b : undefined, height: (_c = node.getAttribute('hoogte')) !== null && _c !== void 0 ? _c : undefined, width: (_d = node.getAttribute('breedte')) !== null && _d !== void 0 ? _d : undefined }));
|
|
163
64
|
}
|
|
164
|
-
|
|
165
|
-
return false;
|
|
166
65
|
}
|
|
167
66
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
options for isURL method
|
|
181
|
-
|
|
182
|
-
require_protocol - if set as true isURL will return false if protocol is not present in the URL
|
|
183
|
-
require_valid_protocol - isURL will check if the URL's protocol is present in the protocols option
|
|
184
|
-
protocols - valid protocols can be modified with this option
|
|
185
|
-
require_host - if set as false isURL will not check if host is present in the URL
|
|
186
|
-
require_port - if set as true isURL will check if port is present in the URL
|
|
187
|
-
allow_protocol_relative_urls - if set as true protocol relative URLs will be allowed
|
|
188
|
-
validate_length - if set as false isURL will skip string length validation (IE maximum is 2083)
|
|
189
|
-
|
|
190
|
-
*/
|
|
191
|
-
|
|
192
|
-
var default_url_options = {
|
|
193
|
-
protocols: ['http', 'https', 'ftp'],
|
|
194
|
-
require_tld: true,
|
|
195
|
-
require_protocol: false,
|
|
196
|
-
require_host: true,
|
|
197
|
-
require_port: false,
|
|
198
|
-
require_valid_protocol: true,
|
|
199
|
-
allow_underscores: false,
|
|
200
|
-
allow_trailing_dot: false,
|
|
201
|
-
allow_protocol_relative_urls: false,
|
|
202
|
-
allow_fragments: true,
|
|
203
|
-
allow_query_components: true,
|
|
204
|
-
validate_length: true
|
|
205
|
-
};
|
|
206
|
-
var wrapped_ipv6 = /^\[([^\]]+)\](?::([0-9]+))?$/;
|
|
207
|
-
|
|
208
|
-
function isRegExp(obj) {
|
|
209
|
-
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
|
67
|
+
class OzonContentInhoudNode {
|
|
68
|
+
constructor() {
|
|
69
|
+
this.name = [
|
|
70
|
+
'Inhoud',
|
|
71
|
+
'Opschrift',
|
|
72
|
+
'ContainerBlocksType',
|
|
73
|
+
'BlockMixedcontentMetMaximaleInlinesMarkersPopupsType'
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
render(node, { mapNodeToJsx }) {
|
|
77
|
+
return index.h("div", { class: "dso-rich-content" }, mapNodeToJsx(node.childNodes));
|
|
78
|
+
}
|
|
210
79
|
}
|
|
211
80
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
81
|
+
class OzonContentInlineNodes {
|
|
82
|
+
constructor() {
|
|
83
|
+
this.name = [
|
|
84
|
+
'sub',
|
|
85
|
+
'sup',
|
|
86
|
+
'strong',
|
|
87
|
+
'b',
|
|
88
|
+
'u',
|
|
89
|
+
'i',
|
|
90
|
+
'br'
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
render(node, { mapNodeToJsx }) {
|
|
94
|
+
if (node.localName === 'br') {
|
|
95
|
+
return index.h("br", null);
|
|
218
96
|
}
|
|
97
|
+
const Tag = node.localName;
|
|
98
|
+
return index.h(Tag, null, mapNodeToJsx(node.childNodes));
|
|
219
99
|
}
|
|
220
|
-
|
|
221
|
-
return false;
|
|
222
100
|
}
|
|
223
101
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
if (!url || /[\s<>]/.test(url)) {
|
|
228
|
-
return false;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
if (url.indexOf('mailto:') === 0) {
|
|
232
|
-
return false;
|
|
102
|
+
class OzonContentIntRefNode {
|
|
103
|
+
constructor() {
|
|
104
|
+
this.name = 'IntRef';
|
|
233
105
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
106
|
+
render(node, { mapNodeToJsx, emitAnchorClick }) {
|
|
107
|
+
const ref = node.getAttribute('ref');
|
|
108
|
+
if (!ref) {
|
|
109
|
+
return mapNodeToJsx(node.childNodes);
|
|
110
|
+
}
|
|
111
|
+
const intRefOnClick = (event) => {
|
|
112
|
+
event.preventDefault();
|
|
113
|
+
const target = event.currentTarget;
|
|
114
|
+
if (!(target instanceof HTMLAnchorElement)) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const { href } = target;
|
|
118
|
+
emitAnchorClick({
|
|
119
|
+
href,
|
|
120
|
+
documentComponent: ref,
|
|
121
|
+
originalEvent: event
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
return (index.h("a", { href: `#${ref}`, onClick: intRefOnClick }, mapNodeToJsx(node.childNodes)));
|
|
239
125
|
}
|
|
126
|
+
}
|
|
240
127
|
|
|
241
|
-
|
|
242
|
-
|
|
128
|
+
class OzonContentNootNode {
|
|
129
|
+
constructor() {
|
|
130
|
+
this.name = 'Noot';
|
|
131
|
+
this.handles = ['NootNummer'];
|
|
243
132
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
return false;
|
|
133
|
+
identify() {
|
|
134
|
+
return 'Noot';
|
|
247
135
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
split = url.split('://');
|
|
255
|
-
|
|
256
|
-
if (split.length > 1) {
|
|
257
|
-
protocol = split.shift().toLowerCase();
|
|
258
|
-
|
|
259
|
-
if (options.require_valid_protocol && options.protocols.indexOf(protocol) === -1) {
|
|
260
|
-
return false;
|
|
261
|
-
}
|
|
262
|
-
} else if (options.require_protocol) {
|
|
263
|
-
return false;
|
|
264
|
-
} else if (url.substr(0, 2) === '//') {
|
|
265
|
-
if (!options.allow_protocol_relative_urls) {
|
|
266
|
-
return false;
|
|
136
|
+
render(node, { mapNodeToJsx, state: openNoteId, setState }) {
|
|
137
|
+
var _a, _b;
|
|
138
|
+
const noteId = node.getAttribute('id');
|
|
139
|
+
if (!noteId) {
|
|
140
|
+
console.error('Noot node without id', node);
|
|
141
|
+
return index.h(index.Fragment, null);
|
|
267
142
|
}
|
|
268
|
-
|
|
269
|
-
|
|
143
|
+
const noteControlsId = `dso-ozon-note-${noteId}`;
|
|
144
|
+
const childNodes = Array.from(node.childNodes);
|
|
145
|
+
const nootNummer = (_b = (_a = childNodes.find(n => getNodeName(n) === 'NootNummer')) === null || _a === void 0 ? void 0 : _a.textContent) !== null && _b !== void 0 ? _b : noteId;
|
|
146
|
+
return (index.h(index.Fragment, null,
|
|
147
|
+
index.h("sup", null,
|
|
148
|
+
index.h("button", { type: "button", class: "toggle-note", id: noteControlsId, onClick: () => setState === null || setState === void 0 ? void 0 : setState(openNoteId === noteId ? undefined : noteId), onBlur: () => setState === null || setState === void 0 ? void 0 : setState(undefined), "aria-expanded": openNoteId === noteId ? 'true' : 'false' }, nootNummer)),
|
|
149
|
+
index.h("dso-tooltip", { active: openNoteId === noteId, for: noteControlsId, stateless: true },
|
|
150
|
+
index.h("span", { role: "section" }, mapNodeToJsx(Array.from(node.querySelectorAll(':scope > Al')))))));
|
|
270
151
|
}
|
|
152
|
+
}
|
|
271
153
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
154
|
+
function mapColspecs(count, nodeList) {
|
|
155
|
+
const elements = Array.from(nodeList);
|
|
156
|
+
const totalWidth = getTotalWidth(elements);
|
|
157
|
+
return {
|
|
158
|
+
totalWidth,
|
|
159
|
+
count,
|
|
160
|
+
columns: elements.map((element, index) => {
|
|
161
|
+
var _a;
|
|
162
|
+
const colNumber = element.getAttribute('colnum');
|
|
163
|
+
return {
|
|
164
|
+
name: (_a = element.getAttribute('colname')) !== null && _a !== void 0 ? _a : '',
|
|
165
|
+
number: colNumber ? parseInt(colNumber, 10) : index + 1,
|
|
166
|
+
width: getWidth(totalWidth, element)
|
|
167
|
+
};
|
|
168
|
+
})
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function getTotalWidth(elements) {
|
|
172
|
+
return elements.reduce((totalWidth, element) => {
|
|
173
|
+
var _a, _b;
|
|
174
|
+
const width = (_b = (_a = element.getAttribute('colwidth')) === null || _a === void 0 ? void 0 : _a.replace(/[^0-9]/, '')) !== null && _b !== void 0 ? _b : '';
|
|
175
|
+
const colWidth = parseInt(width, 10);
|
|
176
|
+
return totalWidth + (isNaN(colWidth) ? 0 : colWidth);
|
|
177
|
+
}, 0);
|
|
178
|
+
}
|
|
179
|
+
function getWidth(totalWidth, element) {
|
|
180
|
+
const width = element.getAttribute('colwidth');
|
|
181
|
+
if (!width) {
|
|
182
|
+
return undefined;
|
|
276
183
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
url = split.shift();
|
|
280
|
-
|
|
281
|
-
if (url === '' && !options.require_host) {
|
|
282
|
-
return true;
|
|
184
|
+
if (width === '*') {
|
|
185
|
+
return '100%';
|
|
283
186
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
if (split.length > 1) {
|
|
288
|
-
if (options.disallow_auth) {
|
|
289
|
-
return false;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
if (split[0] === '') {
|
|
293
|
-
return false;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
auth = split.shift();
|
|
297
|
-
|
|
298
|
-
if (auth.indexOf(':') >= 0 && auth.split(':').length > 2) {
|
|
299
|
-
return false;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
var _auth$split = auth.split(':'),
|
|
303
|
-
_auth$split2 = _slicedToArray(_auth$split, 2),
|
|
304
|
-
user = _auth$split2[0],
|
|
305
|
-
password = _auth$split2[1];
|
|
306
|
-
|
|
307
|
-
if (user === '' && password === '') {
|
|
308
|
-
return false;
|
|
309
|
-
}
|
|
187
|
+
if (width.includes('*') || width.match(/^[\d+]$/)) {
|
|
188
|
+
const colWidth = parseInt(width.replace(/[^0-9]/, ''), 10);
|
|
189
|
+
return `${Math.round(colWidth / totalWidth * 100)}%`;
|
|
310
190
|
}
|
|
191
|
+
return width;
|
|
192
|
+
}
|
|
311
193
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
var ipv6_match = hostname.match(wrapped_ipv6);
|
|
316
|
-
|
|
317
|
-
if (ipv6_match) {
|
|
318
|
-
host = '';
|
|
319
|
-
ipv6 = ipv6_match[1];
|
|
320
|
-
port_str = ipv6_match[2] || null;
|
|
321
|
-
} else {
|
|
322
|
-
split = hostname.split(':');
|
|
323
|
-
host = split.shift();
|
|
194
|
+
const Colgroup = ({ colspecs }) => (colspecs.columns.length > 0
|
|
195
|
+
? (index.h("colgroup", null, colspecs.columns.map(colspec => (index.h("col", { style: { width: colspec.width } })))))
|
|
196
|
+
: index.h(index.Fragment, null));
|
|
324
197
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
198
|
+
function getData(cell) {
|
|
199
|
+
return {
|
|
200
|
+
moreRows: cell.getAttribute('morerows'),
|
|
201
|
+
nameStart: cell.getAttribute('namest'),
|
|
202
|
+
nameEnd: cell.getAttribute('nameend')
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
function getColspan({ columns }, nameStart, nameEnd) {
|
|
206
|
+
const colspecStart = columns.find(c => c.name === nameStart);
|
|
207
|
+
const colspecEnd = columns.find(c => c.name === nameEnd);
|
|
208
|
+
if (!colspecStart || !colspecEnd) {
|
|
209
|
+
return undefined;
|
|
210
|
+
}
|
|
211
|
+
const colspan = colspecEnd.number - colspecStart.number + 1;
|
|
212
|
+
return colspan === 1 ? undefined : colspan;
|
|
213
|
+
}
|
|
214
|
+
const Cell = ({ context: { mapNodeToJsx }, colspecs, cell }) => {
|
|
215
|
+
const { moreRows, nameStart, nameEnd } = getData(cell);
|
|
216
|
+
const td = {
|
|
217
|
+
rowSpan: moreRows ? parseInt(moreRows, 10) + 1 : undefined,
|
|
218
|
+
colSpan: colspecs && nameStart && nameEnd ? getColspan(colspecs, nameStart, nameEnd) : undefined
|
|
219
|
+
};
|
|
220
|
+
return (index.h("td", Object.assign({}, td), mapNodeToJsx(cell.childNodes)));
|
|
221
|
+
};
|
|
329
222
|
|
|
330
|
-
|
|
331
|
-
|
|
223
|
+
const Rows = ({ context, colspecs, rows }) => {
|
|
224
|
+
return (index.h(index.Fragment, null, rows.map(row => (index.h("tr", null, Array.from(row.children).map(cell => (index.h(Cell, { cell: cell, colspecs: colspecs, context: context }))))))));
|
|
225
|
+
};
|
|
332
226
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
227
|
+
function mapData(node) {
|
|
228
|
+
var _a, _b, _c;
|
|
229
|
+
const tgroup = node.querySelector(':scope > tgroup');
|
|
230
|
+
const colAttribute = (_a = tgroup === null || tgroup === void 0 ? void 0 : tgroup.getAttribute('cols')) !== null && _a !== void 0 ? _a : undefined;
|
|
231
|
+
const columnCount = colAttribute ? parseInt(colAttribute, 10) : undefined;
|
|
232
|
+
return {
|
|
233
|
+
caption: (_c = (_b = node.querySelector(':scope > title')) === null || _b === void 0 ? void 0 : _b.textContent) !== null && _c !== void 0 ? _c : undefined,
|
|
234
|
+
colspecs: tgroup && columnCount ? mapColspecs(columnCount, tgroup.querySelectorAll(':scope > colspec')) : undefined,
|
|
235
|
+
headRows: Array.from(node.querySelectorAll(':scope > tgroup > thead > row')),
|
|
236
|
+
bodyRows: Array.from(node.querySelectorAll(':scope > tgroup > tbody > row'))
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
class OzonContentTableNode {
|
|
240
|
+
constructor() {
|
|
241
|
+
this.name = 'table';
|
|
242
|
+
this.handles = ['title', 'tgroup', 'colspec', 'thead', 'tbody', 'row', 'cell'];
|
|
243
|
+
}
|
|
244
|
+
render(node, context) {
|
|
245
|
+
const { caption, colspecs, headRows, bodyRows } = mapData(node);
|
|
246
|
+
return (index.h("table", { class: "table" },
|
|
247
|
+
caption && (index.h("caption", null, caption)),
|
|
248
|
+
colspecs && (index.h(Colgroup, { colspecs: colspecs })),
|
|
249
|
+
headRows.length > 0 && (index.h("thead", null,
|
|
250
|
+
index.h(Rows, { rows: headRows, colspecs: colspecs, context: context }))),
|
|
251
|
+
bodyRows.length > 0 && (index.h("tbody", null,
|
|
252
|
+
index.h(Rows, { rows: bodyRows, colspecs: colspecs, context: context })))));
|
|
338
253
|
}
|
|
254
|
+
}
|
|
339
255
|
|
|
340
|
-
|
|
341
|
-
|
|
256
|
+
class OzonContentTextNode {
|
|
257
|
+
constructor() {
|
|
258
|
+
this.name = '#text';
|
|
342
259
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
return false;
|
|
260
|
+
render(node) {
|
|
261
|
+
return index.h(index.Fragment, null, node.textContent);
|
|
346
262
|
}
|
|
263
|
+
}
|
|
347
264
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
265
|
+
class OzonContentFallbackNode {
|
|
266
|
+
constructor() {
|
|
267
|
+
// This name does not match any elements
|
|
268
|
+
this.name = ['<fallback>'];
|
|
269
|
+
}
|
|
270
|
+
render(node, { mapNodeToJsx }) {
|
|
271
|
+
return (index.h("span", { class: `fallback od-${getNodeName(node)}` }, mapNodeToJsx(node.childNodes)));
|
|
352
272
|
}
|
|
353
|
-
|
|
354
|
-
return true;
|
|
355
273
|
}
|
|
356
274
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
nootAnchorElement.replaceChildren(supElement);
|
|
379
|
-
const id = (index + 1).toString(10);
|
|
380
|
-
const [termId, contentId] = [`dso-ozon-term-${id}`, `dso-ozon-content-${id}`];
|
|
381
|
-
nootAnchorElement.setAttribute('href', `#${termId}`);
|
|
382
|
-
nootAnchorElement.setAttribute('id', termId);
|
|
383
|
-
nootAnchorElement.setAttribute('aria-controls', contentId);
|
|
384
|
-
nootAnchorElement.setAttribute('aria-expanded', 'false');
|
|
385
|
-
contentAlElement === null || contentAlElement === void 0 ? void 0 : contentAlElement.setAttribute('id', contentId);
|
|
386
|
-
});
|
|
387
|
-
return body;
|
|
388
|
-
}
|
|
389
|
-
function transformDocumentComponent(body) {
|
|
390
|
-
body.querySelectorAll('span[data-verwijst-naar-documentcomponent]').forEach(e => {
|
|
391
|
-
const a = document.createElement('a');
|
|
392
|
-
a.href = `#${e.getAttribute('data-verwijst-naar-documentcomponent')}`;
|
|
393
|
-
a.replaceChildren(...Array.from(e.childNodes));
|
|
394
|
-
e.replaceWith(a);
|
|
395
|
-
});
|
|
396
|
-
return body;
|
|
397
|
-
}
|
|
398
|
-
const transformers = [transformDescriptionNote, transformDocumentComponent];
|
|
399
|
-
class OzonContentTransformer {
|
|
400
|
-
constructor(anchorClick) {
|
|
401
|
-
this.anchorClick = anchorClick;
|
|
275
|
+
class Mapper {
|
|
276
|
+
constructor() {
|
|
277
|
+
this.mappers = [
|
|
278
|
+
new OzonContentTextNode(),
|
|
279
|
+
new OzonContentDocumentNode(),
|
|
280
|
+
new OzonContentInhoudNode(),
|
|
281
|
+
new OzonContentIntRefNode(),
|
|
282
|
+
new OzonContentExtRefNode(),
|
|
283
|
+
new OzonContentAlNode(),
|
|
284
|
+
new OzonContentInlineNodes(),
|
|
285
|
+
new OzonContentIllustratieNode(),
|
|
286
|
+
new OzonContentNootNode(),
|
|
287
|
+
new OzonContentTableNode()
|
|
288
|
+
];
|
|
289
|
+
this.skip = this.mappers.reduce((t, m) => {
|
|
290
|
+
if (m.handles) {
|
|
291
|
+
t.push(...m.handles);
|
|
292
|
+
}
|
|
293
|
+
return t;
|
|
294
|
+
}, []);
|
|
295
|
+
this.fallbackNode = new OzonContentFallbackNode();
|
|
402
296
|
this.domParser = new DOMParser();
|
|
403
|
-
this.eventHandlers = [this.handleValidUrls, this.handleDescriptionNoteClick, this.handleContentAnchor];
|
|
404
|
-
}
|
|
405
|
-
setContent(content) {
|
|
406
|
-
this.content = transformers.reduce((c, t) => t(c), this.domParser.parseFromString(content, 'text/html').body).children;
|
|
407
297
|
}
|
|
408
|
-
|
|
409
|
-
this.eventHandlers.some(h => h.bind(this)(event.composedPath(), event));
|
|
410
|
-
}
|
|
411
|
-
handleDescriptionNoteClick(composedPath, event) {
|
|
298
|
+
findMapper(name) {
|
|
412
299
|
var _a;
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
return false;
|
|
300
|
+
if (this.skip.includes(name)) {
|
|
301
|
+
return undefined;
|
|
416
302
|
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
303
|
+
return (_a = this.mappers.find(m => {
|
|
304
|
+
if (Array.isArray(m.name)) {
|
|
305
|
+
return m.name.includes(name);
|
|
306
|
+
}
|
|
307
|
+
return m.name === name;
|
|
308
|
+
})) !== null && _a !== void 0 ? _a : this.fallbackNode;
|
|
309
|
+
}
|
|
310
|
+
mapNodeToJsx(node, context, path) {
|
|
311
|
+
var _a;
|
|
312
|
+
if (node instanceof NodeList) {
|
|
313
|
+
return index.h(index.Fragment, null, Array.from(node).map(n => this.mapNodeToJsx(n, context, path)));
|
|
421
314
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
if (open) {
|
|
425
|
-
anchorElement.classList.remove('dso-open');
|
|
426
|
-
anchorElement.setAttribute('aria-expanded', 'false');
|
|
315
|
+
if (Array.isArray(node)) {
|
|
316
|
+
return index.h(index.Fragment, null, node.map(n => this.mapNodeToJsx(n, context, path)));
|
|
427
317
|
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
318
|
+
const nodeName = getNodeName(node);
|
|
319
|
+
const mapper = this.findMapper(nodeName);
|
|
320
|
+
if (!mapper) {
|
|
321
|
+
return index.h(index.Fragment, null);
|
|
431
322
|
}
|
|
432
|
-
|
|
323
|
+
const identity = (_a = mapper.identify) === null || _a === void 0 ? void 0 : _a.call(mapper, node);
|
|
324
|
+
const state = identity ? context.state[identity] : undefined;
|
|
325
|
+
const setState = identity ? (state) => context.setState(Object.assign(Object.assign({}, context.state), { [identity]: state })) : undefined;
|
|
326
|
+
return mapper.render(node, {
|
|
327
|
+
mapNodeToJsx: n => this.mapNodeToJsx(n, context, [...path, node]),
|
|
328
|
+
emitAnchorClick: context.emitAnchorClick,
|
|
329
|
+
setState,
|
|
330
|
+
state,
|
|
331
|
+
path
|
|
332
|
+
});
|
|
433
333
|
}
|
|
434
|
-
|
|
435
|
-
if (
|
|
436
|
-
|
|
437
|
-
const anchor = composedPath.find((e) => e instanceof HTMLAnchorElement);
|
|
438
|
-
const href = anchor.href;
|
|
439
|
-
this.anchorClick.emit({
|
|
440
|
-
href,
|
|
441
|
-
documentComponent: href.substr(href.indexOf('#') + 1),
|
|
442
|
-
originalEvent: event
|
|
443
|
-
});
|
|
444
|
-
return true;
|
|
334
|
+
transform(xml, context) {
|
|
335
|
+
if (!this.cache || this.cache.xml !== xml) {
|
|
336
|
+
this.cache = { xml, document: this.domParser.parseFromString(xml, 'text/xml') };
|
|
445
337
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
handleValidUrls(composedPath) {
|
|
449
|
-
var _a;
|
|
450
|
-
const containerIndex = composedPath.findIndex(this.isHostElement);
|
|
451
|
-
if (containerIndex === -1) {
|
|
452
|
-
return false;
|
|
453
|
-
}
|
|
454
|
-
// require_tld: false is needed to allow http://localhost
|
|
455
|
-
return (_a = composedPath.slice(0, containerIndex)) === null || _a === void 0 ? void 0 : _a.some(e => { var _a; return e instanceof HTMLAnchorElement && isURL((_a = e.getAttribute('href')) !== null && _a !== void 0 ? _a : '', { require_tld: false, require_protocol: true }); });
|
|
456
|
-
}
|
|
457
|
-
isHostElement(value) {
|
|
458
|
-
return value instanceof HTMLElement && value.tagName === 'DSO-OZON-CONTENT';
|
|
338
|
+
const xmlDocument = this.cache.document;
|
|
339
|
+
return this.mapNodeToJsx(xmlDocument.getRootNode(), context, []);
|
|
459
340
|
}
|
|
460
341
|
}
|
|
461
342
|
|
|
462
|
-
const ozonContentCss = "dso-ozon-content{display:block}.
|
|
343
|
+
const ozonContentCss = ".sc-dso-ozon-content-h{display:block}button.toggle-note.sc-dso-ozon-content{display:inline-block;font-size:1em;font-weight:500;margin-bottom:0;text-decoration:none;touch-action:manipulation;text-align:left;user-select:none;vertical-align:middle;border:0;color:#39870c;line-height:1;padding:0;background-color:transparent}button.toggle-note.sc-dso-ozon-content:focus,button.toggle-note.sc-dso-ozon-content:focus-visible{outline-offset:2px}button.toggle-note.sc-dso-ozon-content:active{outline:0}button.toggle-note.extern.sc-dso-ozon-content::after,button.toggle-note.download.sc-dso-ozon-content::after{content:\"\";display:inline-block;height:1.5em;margin-left:8px;vertical-align:top;width:1.5em}button.toggle-note[disabled].sc-dso-ozon-content{color:#afcf9d}button.toggle-note.sc-dso-ozon-content:not([disabled]):hover{color:#676cb0;text-decoration:underline}button.toggle-note.sc-dso-ozon-content:not([disabled]):active{color:#676cb0}button.toggle-note.btn-align.sc-dso-ozon-content{line-height:calc(1.5em - 1px);padding:11px 0;position:relative}button.toggle-note.extern.sc-dso-ozon-content::after,button.toggle-note.download.sc-dso-ozon-content::after{position:relative;top:-2px}button.toggle-note.download.sc-dso-ozon-content::after{background:var(--dso-icon, var(--di-download)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}button.toggle-note.download[disabled].sc-dso-ozon-content::after{--dso-icon:var(--di-download-grasgroen-40)}button.toggle-note.download.sc-dso-ozon-content:not([disabled]):hover::after,button.toggle-note.download.sc-dso-ozon-content:not([disabled]):active::after{--dso-icon:var(--di-download-scampi)}button.toggle-note.extern.sc-dso-ozon-content::after{background:var(--dso-icon, var(--di-external-link)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em}button.toggle-note.extern[disabled].sc-dso-ozon-content::after{--dso-icon:var(--di-external-link-grasgroen-40)}button.toggle-note.extern.sc-dso-ozon-content:not([disabled]):hover::after,button.toggle-note.extern.sc-dso-ozon-content:not([disabled]):active::after{--dso-icon:var(--di-external-link-scampi)}button.toggle-note.sc-dso-ozon-content dso-icon.sc-dso-ozon-content+span.sc-dso-ozon-content:not(.sr-only),button.toggle-note.sc-dso-ozon-content svg.di.sc-dso-ozon-content+span.sc-dso-ozon-content:not(.sr-only),button.toggle-note.sc-dso-ozon-content span.sc-dso-ozon-content:not(.sr-only)+dso-icon.sc-dso-ozon-content,button.toggle-note.sc-dso-ozon-content span.sc-dso-ozon-content:not(.sr-only)+svg.di.sc-dso-ozon-content{margin-left:8px}button.toggle-note.sc-dso-ozon-content dso-icon.sc-dso-ozon-content,button.toggle-note.sc-dso-ozon-content svg.di.sc-dso-ozon-content,button.toggle-note.sc-dso-ozon-content span.sc-dso-ozon-content{vertical-align:middle}span[role=section].sc-dso-ozon-content,span[role=paragraph].sc-dso-ozon-content{display:block}.fallback.sc-dso-ozon-content{display:block}.od-Term.sc-dso-ozon-content{font-weight:700}.od-Definitie.sc-dso-ozon-content,.od-Tussenkop.sc-dso-ozon-content{font-style:italic}.od-Inhoud.sc-dso-ozon-content,.od-Inhoud.sc-dso-ozon-content>.od-Lijst.sc-dso-ozon-content,.od-IntIoRef.sc-dso-ozon-content,.od-Lidnr.sc-dso-ozon-content,.od-LiNr.sc-dso-ozon-content,.od-Opschrift.sc-dso-ozon-content,.od-Tussenkop.sc-dso-ozon-content{display:inline}.od-Al.sc-dso-ozon-content,.od-Lijstaanhef.sc-dso-ozon-content{margin-bottom:0.75em}.od-IntIoRef.sc-dso-ozon-content{border-bottom:1px dotted}.od-LiNummer.sc-dso-ozon-content{float:left;min-width:0.7em;padding-right:0.3em;text-align:right}.od-Figuur.sc-dso-ozon-content img.sc-dso-ozon-content{margin-left:25px;max-width:100%;height:auto}.od-Figuur.sc-dso-ozon-content .od-Bijschrift.sc-dso-ozon-content{font-size:0.75rem;margin-left:25px;padding-bottom:2.5rem}.od-Tabel.sc-dso-ozon-content thead.sc-dso-ozon-content{font-weight:600}.od-Kadertekst.sc-dso-ozon-content{border:1px solid #e5e5e5;margin-bottom:1rem;padding:1rem}";
|
|
463
344
|
|
|
464
345
|
let OzonContent = class {
|
|
465
346
|
constructor(hostRef) {
|
|
466
347
|
index.registerInstance(this, hostRef);
|
|
467
348
|
this.anchorClick = index.createEvent(this, "anchorClick", 7);
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
this.transformer.handleClickEvent(event);
|
|
471
|
-
}
|
|
472
|
-
componentWillLoad() {
|
|
473
|
-
this.transformer = new OzonContentTransformer(this.anchorClick);
|
|
474
|
-
}
|
|
475
|
-
componentWillRender() {
|
|
476
|
-
this.transformer.setContent(this.content);
|
|
349
|
+
this.state = {};
|
|
350
|
+
this.mapper = new Mapper();
|
|
477
351
|
}
|
|
478
352
|
render() {
|
|
479
|
-
return index.h("div", { class: "dso-rich-content", ref: el => this.container = el });
|
|
480
|
-
}
|
|
481
|
-
componentDidRender() {
|
|
482
353
|
var _a;
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
this.
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
}
|
|
354
|
+
const context = {
|
|
355
|
+
state: this.state,
|
|
356
|
+
setState: state => this.state = state,
|
|
357
|
+
emitAnchorClick: this.anchorClick.emit
|
|
358
|
+
};
|
|
359
|
+
return this.mapper.transform((_a = this.content) !== null && _a !== void 0 ? _a : '', context);
|
|
490
360
|
}
|
|
491
361
|
};
|
|
492
362
|
OzonContent.style = ozonContentCss;
|