@dso-toolkit/core 81.0.0 → 81.1.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/bundle/dso-document-component.js +1 -1
- package/dist/bundle/dso-ozon-content.js +1 -1
- package/dist/bundle/dsot-document-component-demo.js +2 -2
- package/dist/bundle/{p-CN3aN7RU.js → p-DwMDdxsX.js} +67 -16
- package/dist/bundle/p-DwMDdxsX.js.map +1 -0
- package/dist/bundle/{p-CFAsG6Ok.js → p-mimda5aG.js} +6 -5
- package/dist/bundle/p-mimda5aG.js.map +1 -0
- package/dist/cjs/dso-alert.dso-badge.dso-image-overlay.dso-ozon-content.dso-ozon-content-toggletip.dso-panel.dso-table.entry.cjs.js.map +1 -1
- package/dist/cjs/dso-alert_7.cjs.entry.js +55 -14
- package/dist/cjs/dso-alert_7.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-annotation-locatie.dso-document-component.entry.cjs.js.map +1 -1
- package/dist/cjs/dso-annotation-locatie_2.cjs.entry.js +4 -3
- package/dist/cjs/dso-annotation-locatie_2.cjs.entry.js.map +1 -1
- package/dist/cjs/parse-wijzigactie-from-node.function-DQ6mi_34.js +42 -0
- package/dist/cjs/parse-wijzigactie-from-node.function-DQ6mi_34.js.map +1 -0
- package/dist/collection/components/document-component/document-component.css +19 -12
- package/dist/collection/components/document-component/document-component.interfaces.js.map +1 -1
- package/dist/collection/components/document-component/document-component.js +4 -2
- package/dist/collection/components/document-component/document-component.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/begrip.node.js +31 -0
- package/dist/collection/components/ozon-content/nodes/begrip.node.js.map +1 -0
- package/dist/collection/components/ozon-content/nodes/begrippenlijst.node.js +16 -0
- package/dist/collection/components/ozon-content/nodes/begrippenlijst.node.js.map +1 -0
- package/dist/collection/components/ozon-content/nodes/kop.node.js +1 -1
- package/dist/collection/components/ozon-content/nodes/kop.node.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/table.node/table-cell.js +4 -2
- package/dist/collection/components/ozon-content/nodes/table.node/table-cell.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/table.node/table-rows.js +2 -1
- package/dist/collection/components/ozon-content/nodes/table.node/table-rows.js.map +1 -1
- package/dist/collection/components/ozon-content/nodes/text.node.js +2 -7
- package/dist/collection/components/ozon-content/nodes/text.node.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content-context.interface.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content-mapper.js +4 -0
- package/dist/collection/components/ozon-content/ozon-content-mapper.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content-node-context.interface.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content.css +224 -0
- package/dist/collection/components/ozon-content/ozon-content.interfaces.js.map +1 -1
- package/dist/collection/components/ozon-content/ozon-content.js +6 -6
- package/dist/collection/components/ozon-content/ozon-content.js.map +1 -1
- package/dist/collection/functional-components/mark-text/mark-text.functional-component.js +11 -0
- package/dist/collection/functional-components/mark-text/mark-text.functional-component.js.map +1 -0
- package/dist/collection/functional-components/mark-text/mark-text.interfaces.js +2 -0
- package/dist/collection/functional-components/mark-text/mark-text.interfaces.js.map +1 -0
- package/dist/components/document-component.js +4 -3
- package/dist/components/document-component.js.map +1 -1
- package/dist/components/ozon-content.js +65 -14
- package/dist/components/ozon-content.js.map +1 -1
- package/dist/dso-toolkit/dso-alert.dso-badge.dso-image-overlay.dso-ozon-content.dso-ozon-content-toggletip.dso-panel.dso-table.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-annotation-locatie.dso-document-component.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/p-9c063e0c.entry.js +2 -0
- package/dist/dso-toolkit/p-9c063e0c.entry.js.map +1 -0
- package/dist/dso-toolkit/p-DrItCTMr.js +2 -0
- package/dist/dso-toolkit/p-DrItCTMr.js.map +1 -0
- package/dist/dso-toolkit/p-c0bb872c.entry.js +2 -0
- package/dist/dso-toolkit/p-c0bb872c.entry.js.map +1 -0
- package/dist/esm/dso-alert.dso-badge.dso-image-overlay.dso-ozon-content.dso-ozon-content-toggletip.dso-panel.dso-table.entry.js.map +1 -1
- package/dist/esm/dso-alert_7.entry.js +55 -14
- package/dist/esm/dso-alert_7.entry.js.map +1 -1
- package/dist/esm/dso-annotation-locatie.dso-document-component.entry.js.map +1 -1
- package/dist/esm/dso-annotation-locatie_2.entry.js +4 -3
- package/dist/esm/dso-annotation-locatie_2.entry.js.map +1 -1
- package/dist/esm/parse-wijzigactie-from-node.function-lzoUYmkU.js +38 -0
- package/dist/esm/parse-wijzigactie-from-node.function-lzoUYmkU.js.map +1 -0
- package/dist/types/components/document-component/document-component.interfaces.d.ts +4 -4
- package/dist/types/components/ozon-content/nodes/begrip.node.d.ts +6 -0
- package/dist/types/components/ozon-content/nodes/begrippenlijst.node.d.ts +6 -0
- package/dist/types/components/ozon-content/nodes/table.node/table-cell.d.ts +2 -0
- package/dist/types/components/ozon-content/ozon-content-context.interface.d.ts +3 -2
- package/dist/types/components/ozon-content/ozon-content-node-context.interface.d.ts +3 -2
- package/dist/types/components/ozon-content/ozon-content.d.ts +3 -2
- package/dist/types/components/ozon-content/ozon-content.interfaces.d.ts +0 -6
- package/dist/types/components.d.ts +6 -4
- package/dist/types/functional-components/mark-text/mark-text.functional-component.d.ts +8 -0
- package/dist/types/functional-components/mark-text/mark-text.interfaces.d.ts +6 -0
- package/package.json +3 -3
- package/dist/bundle/p-CFAsG6Ok.js.map +0 -1
- package/dist/bundle/p-CN3aN7RU.js.map +0 -1
- package/dist/cjs/parse-wijzigactie-from-node.function-DVYsomcI.js +0 -29
- package/dist/cjs/parse-wijzigactie-from-node.function-DVYsomcI.js.map +0 -1
- package/dist/dso-toolkit/p-932b7006.entry.js +0 -2
- package/dist/dso-toolkit/p-932b7006.entry.js.map +0 -1
- package/dist/dso-toolkit/p-DD1v6_X_.js +0 -2
- package/dist/dso-toolkit/p-DD1v6_X_.js.map +0 -1
- package/dist/dso-toolkit/p-ebef2eef.entry.js +0 -2
- package/dist/dso-toolkit/p-ebef2eef.entry.js.map +0 -1
- package/dist/esm/parse-wijzigactie-from-node.function-DD1v6_X_.js +0 -26
- package/dist/esm/parse-wijzigactie-from-node.function-DD1v6_X_.js.map +0 -1
|
@@ -26,7 +26,7 @@ export class OzonContentKopNode {
|
|
|
26
26
|
const wijzigactieLabel = label ? parseWijzigactieFromNode(label) : undefined;
|
|
27
27
|
const wijzigactieNummer = nummer ? parseWijzigactieFromNode(nummer) : undefined;
|
|
28
28
|
const wijzigactieOpschrift = opschrift ? parseWijzigactieFromNode(opschrift) : undefined;
|
|
29
|
-
return (h(WrapWijzigactie, { wijzigactie: parseWijzigactieFromNode(node) }, h("div", { onClick: handleKopClick, part: "_kop" }, label && h(WrapWijzigactie, { wijzigactie: wijzigactieLabel }, mapNodeToJsx(label.childNodes)), nummer && (h(Fragment, null, " ", h(WrapWijzigactie, { wijzigactie: wijzigactieNummer }, mapNodeToJsx(nummer.childNodes)))), opschrift && (h(Fragment, null, " ", h(WrapWijzigactie, { wijzigactie: wijzigactieOpschrift }, mapNodeToJsx(opschrift.childNodes))))), subtitels.length > 0 && (h("div", { class: "subtitels-container", part: "_subtitels" }, subtitels.map((subtitel) => {
|
|
29
|
+
return (h(WrapWijzigactie, { wijzigactie: parseWijzigactieFromNode(node) }, h("div", { onClick: handleKopClick, part: "_kop", class: "kop" }, label && h(WrapWijzigactie, { wijzigactie: wijzigactieLabel }, mapNodeToJsx(label.childNodes)), nummer && (h(Fragment, null, " ", h(WrapWijzigactie, { wijzigactie: wijzigactieNummer }, mapNodeToJsx(nummer.childNodes)))), opschrift && (h(Fragment, null, " ", h(WrapWijzigactie, { wijzigactie: wijzigactieOpschrift }, mapNodeToJsx(opschrift.childNodes))))), subtitels.length > 0 && (h("div", { class: "subtitels-container", part: "_subtitels" }, subtitels.map((subtitel) => {
|
|
30
30
|
const wijzigactieSubtitel = parseWijzigactieFromNode(subtitel);
|
|
31
31
|
return (h("div", { class: "subtitel" }, h(WrapWijzigactie, { wijzigactie: wijzigactieSubtitel }, mapNodeToJsx(subtitel.childNodes))));
|
|
32
32
|
})))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kop.node.js","sourceRoot":"","sources":["../../../../../src/components/ozon-content/nodes/kop.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,gEAAgE,CAAC;AACjG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC;AAI7F,SAAS,OAAO,CAAC,IAAa;IAC5B,OAAO;QACL,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC;QACpC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;QAC1C,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;KACzD,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,kBAAkB;IAA/B;QACE,SAAI,GAAG,KAAK,CAAC;QAEb,YAAO,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;IAoDzD,CAAC;IAlDC,MAAM,CAAC,IAAa,EAAE,EAAE,YAAY,EAAE,SAAS,EAA0B;QACvE,MAAM,cAAc,GAAG,CAAC,KAAiB,EAAE,EAAE;YAC3C,SAAS,CAAC;gBACR,IAAI,EAAE,KAAK;gBACX,IAAI;gBACJ,aAAa,EAAE,KAAK;aACrB,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAE9D,MAAM,gBAAgB,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AAC,qBAAqB,EAAC,IAAI,EAAC,YAAY,IAC/C,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;gBAC1B,MAAM,mBAAmB,GAAG,wBAAwB,CAAC,QAAQ,CAAC,CAAC;gBAE/D,OAAO,CACL,WAAK,KAAK,EAAC,UAAU;oBACnB,EAAC,eAAe,IAAC,WAAW,EAAE,mBAAmB,IAC9C,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,CAClB,CACd,CACP,CAAC;YACJ,CAAC,CAAC,CACE,CACP,CACe,CACnB,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { Fragment, h } from \"@stencil/core\";\r\n\r\nimport { WrapWijzigactie } from \"../functional-components/wrap-wijzigactie.functional-component\";\r\nimport { parseWijzigactieFromNode } from \"../functions/parse-wijzigactie-from-node.function\";\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\n\r\nfunction mapData(node: Element) {\r\n return {\r\n label: node.querySelector(\"Label\"),\r\n nummer: node.querySelector(\"Nummer\"),\r\n opschrift: node.querySelector(\"Opschrift\"),\r\n subtitels: Array.from(node.querySelectorAll(\"Subtitel\")),\r\n };\r\n}\r\n\r\nexport class OzonContentKopNode implements OzonContentNode {\r\n name = \"Kop\";\r\n\r\n handles = [\"Label\", \"Nummer\", \"Opschrift\", \"Subtitel\"];\r\n\r\n render(node: Element, { mapNodeToJsx, emitClick }: OzonContentNodeContext) {\r\n const handleKopClick = (event: MouseEvent) => {\r\n emitClick({\r\n type: \"Kop\",\r\n node,\r\n originalEvent: event,\r\n });\r\n };\r\n\r\n const { label, nummer, opschrift, subtitels } = mapData(node);\r\n\r\n const wijzigactieLabel = label ? parseWijzigactieFromNode(label) : undefined;\r\n const wijzigactieNummer = nummer ? parseWijzigactieFromNode(nummer) : undefined;\r\n const wijzigactieOpschrift = opschrift ? parseWijzigactieFromNode(opschrift) : undefined;\r\n\r\n return (\r\n <WrapWijzigactie wijzigactie={parseWijzigactieFromNode(node)}>\r\n <div onClick={handleKopClick} part=\"_kop\" class=\"kop\">\r\n {label && <WrapWijzigactie wijzigactie={wijzigactieLabel}>{mapNodeToJsx(label.childNodes)}</WrapWijzigactie>}\r\n {nummer && (\r\n <Fragment>\r\n {\" \"}\r\n <WrapWijzigactie wijzigactie={wijzigactieNummer}>{mapNodeToJsx(nummer.childNodes)}</WrapWijzigactie>\r\n </Fragment>\r\n )}\r\n {opschrift && (\r\n <Fragment>\r\n {\" \"}\r\n <WrapWijzigactie wijzigactie={wijzigactieOpschrift}>{mapNodeToJsx(opschrift.childNodes)}</WrapWijzigactie>\r\n </Fragment>\r\n )}\r\n </div>\r\n {subtitels.length > 0 && (\r\n <div class=\"subtitels-container\" part=\"_subtitels\">\r\n {subtitels.map((subtitel) => {\r\n const wijzigactieSubtitel = parseWijzigactieFromNode(subtitel);\r\n\r\n return (\r\n <div class=\"subtitel\">\r\n <WrapWijzigactie wijzigactie={wijzigactieSubtitel}>\r\n {mapNodeToJsx(subtitel.childNodes)}\r\n </WrapWijzigactie>\r\n </div>\r\n );\r\n })}\r\n </div>\r\n )}\r\n </WrapWijzigactie>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { h } from "@stencil/core/internal";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
+
import { WrapWijzigactie } from "../../functional-components/wrap-wijzigactie.functional-component";
|
|
4
|
+
import { wijzigactieToClassName } from "../../functions/wijzigactie-to-class-name.function";
|
|
3
5
|
function getColspecStartColsep({ columns }, nameStart) {
|
|
4
6
|
const colspecStart = columns.find((c) => c.name === nameStart);
|
|
5
7
|
return colspecStart ? colspecStart.colsep : null;
|
|
@@ -40,8 +42,8 @@ function getColspan({ columns }, nameStart, nameEnd) {
|
|
|
40
42
|
const colspan = colspecEnd.number - colspecStart.number + 1;
|
|
41
43
|
return colspan === 1 ? undefined : colspan;
|
|
42
44
|
}
|
|
43
|
-
export const Cell = ({ context: { mapNodeToJsx }, colspecs, cell }) => {
|
|
45
|
+
export const Cell = ({ context: { mapNodeToJsx }, colspecs, cell, wijzigactie }) => {
|
|
44
46
|
const { moreRows, nameStart, nameEnd, colsep, rowsep } = getData(cell, colspecs);
|
|
45
|
-
return (h("td", { class: clsx({ "dso-horizontal-line": rowsep !== "0" }, { "dso-vertical-line": colsep !== "0" }), rowSpan: moreRows ? parseInt(moreRows, 10) + 1 : undefined, colSpan: colspecs && nameStart && nameEnd ? getColspan(colspecs, nameStart, nameEnd) : undefined }, mapNodeToJsx(cell.childNodes)));
|
|
47
|
+
return (h("td", { class: clsx({ "dso-horizontal-line": rowsep !== "0" }, { "dso-vertical-line": colsep !== "0" }, wijzigactieToClassName(wijzigactie)), rowSpan: moreRows ? parseInt(moreRows, 10) + 1 : undefined, colSpan: colspecs && nameStart && nameEnd ? getColspan(colspecs, nameStart, nameEnd) : undefined }, h(WrapWijzigactie, { wijzigactie: wijzigactie }, mapNodeToJsx(cell.childNodes))));
|
|
46
48
|
};
|
|
47
49
|
//# sourceMappingURL=table-cell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-cell.js","sourceRoot":"","sources":["../../../../../../src/components/ozon-content/nodes/table.node/table-cell.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,IAAI,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"table-cell.js","sourceRoot":"","sources":["../../../../../../src/components/ozon-content/nodes/table.node/table-cell.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,mEAAmE,CAAC;AACpG,OAAO,EAAE,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AAM5F,SAAS,qBAAqB,CAAC,EAAE,OAAO,EAA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Q,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAEjF,OAAO,CACL,UACE,KAAK,EAAE,IAAI,CACT,EAAE,qBAAqB,EAAE,MAAM,KAAK,GAAG,EAAE,EACzC,EAAE,mBAAmB,EAAE,MAAM,KAAK,GAAG,EAAE,EACvC,sBAAsB,CAAC,WAAW,CAAC,CACpC,EACD,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,EAC1D,OAAO,EAAE,QAAQ,IAAI,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS;QAEhG,EAAC,eAAe,IAAC,WAAW,EAAE,WAAW,IAAG,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAmB,CACzF,CACN,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FunctionalComponent } from \"@stencil/core\";\r\nimport { h } from \"@stencil/core/internal\";\r\nimport clsx from \"clsx\";\r\n\r\nimport { WrapWijzigactie } from \"../../functional-components/wrap-wijzigactie.functional-component\";\r\nimport { wijzigactieToClassName } from \"../../functions/wijzigactie-to-class-name.function\";\r\nimport { OzonContentNodeContext } from \"../../ozon-content-node-context.interface\";\r\nimport { OzonContentWijzigActie } from \"../../ozon-content.interfaces\";\r\n\r\nimport { Colspecs } from \"./colspec/colspec.interface\";\r\n\r\nfunction getColspecStartColsep({ columns }: Colspecs, nameStart: string): string | null {\r\n const colspecStart = columns.find((c) => c.name === nameStart);\r\n\r\n return colspecStart ? colspecStart.colsep : null;\r\n}\r\n\r\nfunction getColspecStartRowsep({ columns }: Colspecs, nameStart: string): string | null {\r\n const colspecStart = columns.find((c) => c.name === nameStart);\r\n\r\n return colspecStart ? colspecStart.rowsep : null;\r\n}\r\n\r\nfunction getData(cell: Element, colspecs?: Colspecs) {\r\n const nameStart = cell.getAttribute(\"namest\");\r\n const row = cell.parentElement;\r\n const tgroup = row?.parentElement?.parentElement;\r\n const table = tgroup?.parentElement;\r\n const colsep =\r\n cell.getAttribute(\"colsep\") ||\r\n (colspecs && nameStart ? getColspecStartColsep(colspecs, nameStart) : null) ||\r\n (tgroup && tgroup.getAttribute(\"colsep\")) ||\r\n (table && table.getAttribute(\"colsep\"));\r\n const rowsep =\r\n cell.getAttribute(\"rowsep\") ||\r\n (row && row.getAttribute(\"rowsep\")) ||\r\n (colspecs && nameStart ? getColspecStartRowsep(colspecs, nameStart) : null) ||\r\n (tgroup && tgroup.getAttribute(\"rowsep\")) ||\r\n (table && table.getAttribute(\"rowsep\"));\r\n\r\n return {\r\n moreRows: cell.getAttribute(\"morerows\"),\r\n nameStart,\r\n nameEnd: cell.getAttribute(\"nameend\"),\r\n colsep,\r\n rowsep,\r\n };\r\n}\r\n\r\nfunction getColspan({ columns }: Colspecs, nameStart: string, nameEnd: string): number | undefined {\r\n const colspecStart = columns.find((c) => c.name === nameStart);\r\n const colspecEnd = columns.find((c) => c.name === nameEnd);\r\n if (!colspecStart || !colspecEnd) {\r\n return undefined;\r\n }\r\n\r\n const colspan = colspecEnd.number - colspecStart.number + 1;\r\n\r\n return colspan === 1 ? undefined : colspan;\r\n}\r\n\r\nexport const Cell: FunctionalComponent<{\r\n context: OzonContentNodeContext;\r\n colspecs: Colspecs | undefined;\r\n cell: Element;\r\n wijzigactie: OzonContentWijzigActie | undefined;\r\n}> = ({ context: { mapNodeToJsx }, colspecs, cell, wijzigactie }) => {\r\n const { moreRows, nameStart, nameEnd, colsep, rowsep } = getData(cell, colspecs);\r\n\r\n return (\r\n <td\r\n class={clsx(\r\n { \"dso-horizontal-line\": rowsep !== \"0\" },\r\n { \"dso-vertical-line\": colsep !== \"0\" },\r\n wijzigactieToClassName(wijzigactie),\r\n )}\r\n rowSpan={moreRows ? parseInt(moreRows, 10) + 1 : undefined}\r\n colSpan={colspecs && nameStart && nameEnd ? getColspan(colspecs, nameStart, nameEnd) : undefined}\r\n >\r\n <WrapWijzigactie wijzigactie={wijzigactie}>{mapNodeToJsx(cell.childNodes)}</WrapWijzigactie>\r\n </td>\r\n );\r\n};\r\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment, h } from "@stencil/core";
|
|
2
|
+
import { parseWijzigactieFromNode } from "../../functions/parse-wijzigactie-from-node.function";
|
|
2
3
|
import { Cell } from "./table-cell";
|
|
3
4
|
export const Rows = ({ context, colspecs, rows }) => {
|
|
4
|
-
return (h(Fragment, null, rows.map((row) => (h("tr", null, Array.from(row.children).map((cell) => (h(Cell, { cell: cell, colspecs: colspecs, context: context }))))))));
|
|
5
|
+
return (h(Fragment, null, rows.map((row) => (h("tr", null, Array.from(row.children).map((cell) => (h(Cell, { cell: cell, colspecs: colspecs, context: context, wijzigactie: parseWijzigactieFromNode(row) }))))))));
|
|
5
6
|
};
|
|
6
7
|
//# sourceMappingURL=table-rows.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-rows.js","sourceRoot":"","sources":["../../../../../../src/components/ozon-content/nodes/table.node/table-rows.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAuB,CAAC,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"table-rows.js","sourceRoot":"","sources":["../../../../../../src/components/ozon-content/nodes/table.node/table-rows.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAuB,CAAC,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAIhG,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,MAAM,CAAC,MAAM,IAAI,GAIZ,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE;IACnC,OAAO,CACL,EAAC,QAAQ,QACN,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACjB,cACG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACtC,EAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,wBAAwB,CAAC,GAAG,CAAC,GAAI,CACvG,CAAC,CACC,CACN,CAAC,CACO,CACZ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Fragment, FunctionalComponent, h } from \"@stencil/core\";\r\n\r\nimport { parseWijzigactieFromNode } from \"../../functions/parse-wijzigactie-from-node.function\";\r\nimport { OzonContentNodeContext } from \"../../ozon-content-node-context.interface\";\r\n\r\nimport { Colspecs } from \"./colspec/colspec.interface\";\r\nimport { Cell } from \"./table-cell\";\r\n\r\nexport const Rows: FunctionalComponent<{\r\n context: OzonContentNodeContext;\r\n colspecs: Colspecs | undefined;\r\n rows: Element[];\r\n}> = ({ context, colspecs, rows }) => {\r\n return (\r\n <Fragment>\r\n {rows.map((row) => (\r\n <tr>\r\n {Array.from(row.children).map((cell) => (\r\n <Cell cell={cell} colspecs={colspecs} context={context} wijzigactie={parseWijzigactieFromNode(row)} />\r\n ))}\r\n </tr>\r\n ))}\r\n </Fragment>\r\n );\r\n};\r\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Fragment, h } from "@stencil/core";
|
|
2
|
+
import { MarkText } from "../../../functional-components/mark-text/mark-text.functional-component";
|
|
2
3
|
export class OzonContentTextNode {
|
|
3
4
|
constructor() {
|
|
4
5
|
this.name = "#text";
|
|
@@ -7,13 +8,7 @@ export class OzonContentTextNode {
|
|
|
7
8
|
if (!mark || !textContent) {
|
|
8
9
|
return h(Fragment, null, textContent);
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
return !result || result.length === 0 ? (h(Fragment, null, textContent)) : (h(Fragment, null, result.map((value) => {
|
|
12
|
-
if (typeof value === "string") {
|
|
13
|
-
return h(Fragment, null, value);
|
|
14
|
-
}
|
|
15
|
-
return (h("mark", { class: value.highlight ? "dso-highlight" : undefined, ref: (ref) => value.highlight && ref && emitMarkItemHighlight(value.text, ref) }, value.text));
|
|
16
|
-
})));
|
|
11
|
+
return h(MarkText, { mark: mark, text: textContent, emitMarkItemHighlight: emitMarkItemHighlight });
|
|
17
12
|
}
|
|
18
13
|
}
|
|
19
14
|
//# sourceMappingURL=text.node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.node.js","sourceRoot":"","sources":["../../../../../src/components/ozon-content/nodes/text.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"text.node.js","sourceRoot":"","sources":["../../../../../src/components/ozon-content/nodes/text.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,yEAAyE,CAAC;AAInG,MAAM,OAAO,mBAAmB;IAAhC;QACE,SAAI,GAAG,OAAO,CAAC;IASjB,CAAC;IAPC,MAAM,CAAC,EAAE,WAAW,EAAQ,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAA0B;QACnF,IAAI,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YAC1B,OAAO,EAAC,QAAQ,QAAE,WAAW,CAAY,CAAC;QAC5C,CAAC;QAED,OAAO,EAAC,QAAQ,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,qBAAqB,EAAE,qBAAqB,GAAI,CAAC;IACnG,CAAC;CACF","sourcesContent":["import { Fragment, h } from \"@stencil/core\";\r\n\r\nimport { MarkText } from \"../../../functional-components/mark-text/mark-text.functional-component\";\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\n\r\nexport class OzonContentTextNode implements OzonContentNode {\r\n name = \"#text\";\r\n\r\n render({ textContent }: Node, { mark, emitMarkItemHighlight }: OzonContentNodeContext) {\r\n if (!mark || !textContent) {\r\n return <Fragment>{textContent}</Fragment>;\r\n }\r\n\r\n return <MarkText mark={mark} text={textContent} emitMarkItemHighlight={emitMarkItemHighlight} />;\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ozon-content-context.interface.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/ozon-content-context.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { EventEmitter } from \"@stencil/core\";\r\n\r\nimport { OzonContentNodeState } from \"./ozon-content-node-state.interface\";\r\nimport {
|
|
1
|
+
{"version":3,"file":"ozon-content-context.interface.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/ozon-content-context.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { EventEmitter } from \"@stencil/core\";\r\n\r\nimport { MarkTextMarkFunction } from \"../../functional-components/mark-text/mark-text.interfaces\";\r\n\r\nimport { OzonContentNodeState } from \"./ozon-content-node-state.interface\";\r\nimport { OzonContentBegripResolver, OzonContentClickEvent, OzonContentUrlResolver } from \"./ozon-content.interfaces\";\r\n\r\nexport interface OzonContentContext {\r\n state: OzonContentNodeState;\r\n inline: boolean;\r\n mark: MarkTextMarkFunction | undefined;\r\n setState(state: OzonContentNodeState): void;\r\n emitClick: EventEmitter<OzonContentClickEvent>[\"emit\"];\r\n emitMarkItemHighlight(text: string, ref: HTMLElement): void;\r\n urlResolver: OzonContentUrlResolver | undefined;\r\n begripResolver: OzonContentBegripResolver | undefined;\r\n}\r\n"]}
|
|
@@ -3,6 +3,8 @@ import { parseXml } from "../../utils/parse-xml";
|
|
|
3
3
|
import { getNodeName } from "./get-node-name.function";
|
|
4
4
|
import { OzonContentAbbrNode } from "./nodes/abbr.node";
|
|
5
5
|
import { OzonContentAlNode } from "./nodes/al.node";
|
|
6
|
+
import { OzonContentBegripNode } from "./nodes/begrip.node";
|
|
7
|
+
import { OzonContentBegrippenlijstNode } from "./nodes/begrippenlijst.node";
|
|
6
8
|
import { OzonContentBronNode } from "./nodes/bron.node";
|
|
7
9
|
import { OzonContentDocumentNode } from "./nodes/document.node";
|
|
8
10
|
import { OzonContentExtRefNode } from "./nodes/ext-ref.node";
|
|
@@ -24,6 +26,8 @@ export class Mapper {
|
|
|
24
26
|
constructor() {
|
|
25
27
|
this.mappers = [
|
|
26
28
|
new OzonContentAbbrNode(),
|
|
29
|
+
new OzonContentBegrippenlijstNode(),
|
|
30
|
+
new OzonContentBegripNode(),
|
|
27
31
|
new OzonContentTextNode(),
|
|
28
32
|
new OzonContentDocumentNode(),
|
|
29
33
|
new OzonContentInhoudNode(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ozon-content-mapper.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/ozon-content-mapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAO,CAAC,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAA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AE,CAAC;YACX,OAAO,EAAC,QAAQ,OAAG,CAAC;QACtB,CAAC;QAED,MAAM,GAAG,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAEhE,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO,EAAC,QAAQ,OAAG,CAAC;QACtB,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IAC3D,CAAC;CACF","sourcesContent":["import { Fragment, JSX, h } from \"@stencil/core\";\r\n\r\nimport { parseXml } from \"../../utils/parse-xml\";\r\n\r\nimport { getNodeName } from \"./get-node-name.function\";\r\nimport { OzonContentAbbrNode } from \"./nodes/abbr.node\";\r\nimport { OzonContentAlNode } from \"./nodes/al.node\";\r\nimport { OzonContentBronNode } from \"./nodes/bron.node\";\r\nimport { OzonContentDocumentNode } from \"./nodes/document.node\";\r\nimport { OzonContentExtRefNode } from \"./nodes/ext-ref.node\";\r\nimport { OzonContentFallbackNode } from \"./nodes/fallback.node\";\r\nimport { OzonContentFiguurNode } from \"./nodes/figuur.node\";\r\nimport { OzonContentInhoudNode } from \"./nodes/inhoud.node\";\r\nimport { OzonContentInlineTekstAfbeeldingNode } from \"./nodes/inline-tekst-afbeelding.node\";\r\nimport { OzonContentInlineNodes } from \"./nodes/inline.nodes\";\r\nimport { OzonContentIntIoRefNode } from \"./nodes/int-io-ref.node\";\r\nimport { OzonContentIntRefNode } from \"./nodes/int-ref.node\";\r\nimport { OzonContentKopNode } from \"./nodes/kop.node\";\r\nimport { OzonContentLijstNode } from \"./nodes/lijst.node\";\r\nimport { OzonContentNieuweTekstNode } from \"./nodes/nieuwe-tekst.node\";\r\nimport { OzonContentNootNode } from \"./nodes/noot.node\";\r\nimport { OzonContentTableNode } from \"./nodes/table.node\";\r\nimport { OzonContentTextNode } from \"./nodes/text.node\";\r\nimport { OzonContentVerwijderdeTekstNode } from \"./nodes/verwijderde-tekst.node\";\r\nimport { OzonContentContext } from \"./ozon-content-context.interface\";\r\nimport { OzonContentNode } from \"./ozon-content-node.interface\";\r\nimport { OzonContentInputType } from \"./ozon-content.interfaces\";\r\n\r\nexport class Mapper {\r\n private mappers: OzonContentNode[] = [\r\n new OzonContentAbbrNode(),\r\n new OzonContentTextNode(),\r\n new OzonContentDocumentNode(),\r\n new OzonContentInhoudNode(),\r\n new OzonContentKopNode(),\r\n new OzonContentIntRefNode(),\r\n new OzonContentExtRefNode(),\r\n new OzonContentAlNode(),\r\n new OzonContentInlineNodes(),\r\n new OzonContentInlineTekstAfbeeldingNode(),\r\n new OzonContentNootNode(),\r\n new OzonContentTableNode(),\r\n new OzonContentIntIoRefNode(),\r\n new OzonContentFiguurNode(),\r\n new OzonContentLijstNode(),\r\n new OzonContentBronNode(),\r\n new OzonContentNieuweTekstNode(),\r\n new OzonContentVerwijderdeTekstNode(),\r\n ];\r\n\r\n private skip = this.mappers.reduce<string[]>((t, m) => {\r\n if (m.handles) {\r\n t.push(...m.handles);\r\n }\r\n\r\n return t;\r\n }, []);\r\n\r\n private fallbackNode = new OzonContentFallbackNode();\r\n\r\n private findMapper(name: string): OzonContentNode | undefined {\r\n if (this.skip.includes(name)) {\r\n return undefined;\r\n }\r\n\r\n return (\r\n this.mappers.find((m) => {\r\n if (Array.isArray(m.name)) {\r\n return m.name.includes(name);\r\n }\r\n\r\n return m.name === name;\r\n }) ?? this.fallbackNode\r\n );\r\n }\r\n\r\n mapNodeToJsx(node: Node | Node[] | NodeList, context: OzonContentContext, path: Node[]): JSX.Element {\r\n if (node instanceof NodeList) {\r\n return <Fragment>{Array.from(node).map((n) => this.mapNodeToJsx(n, context, path))}</Fragment>;\r\n }\r\n\r\n if (Array.isArray(node)) {\r\n return <Fragment>{node.map((n) => this.mapNodeToJsx(n, context, path))}</Fragment>;\r\n }\r\n\r\n const nodeName = getNodeName(node);\r\n const mapper = this.findMapper(nodeName);\r\n if (!mapper) {\r\n return <Fragment />;\r\n }\r\n\r\n const identity = mapper.identify?.(node);\r\n\r\n const state = identity ? context.state[identity] : undefined;\r\n const setState = identity ? (s: unknown) => context.setState({ ...context.state, [identity]: s }) : undefined;\r\n\r\n return mapper.render(node, {\r\n inline: context.inline,\r\n mark: context.mark,\r\n mapNodeToJsx: (n) => this.mapNodeToJsx(n, context, [...path, node]),\r\n emitClick: context.emitClick,\r\n setState,\r\n emitMarkItemHighlight: context.emitMarkItemHighlight,\r\n state,\r\n path,\r\n urlResolver: context.urlResolver,\r\n begripResolver: context.begripResolver,\r\n });\r\n }\r\n\r\n transform(input: OzonContentInputType | undefined, context: OzonContentContext): JSX.Element {\r\n if (!input) {\r\n return <Fragment />;\r\n }\r\n\r\n const doc = typeof input === \"string\" ? parseXml(input) : input;\r\n\r\n if (!doc) {\r\n return <Fragment />;\r\n }\r\n\r\n return this.mapNodeToJsx(doc.getRootNode(), context, []);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ozon-content-mapper.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/ozon-content-mapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAO,CAAC,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAA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AAqB;YACpD,KAAK;YACL,IAAI;YACJ,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,cAAc,EAAE,OAAO,CAAC,cAAc;SACvC,CAAC,CAAC;IACL,CAAC;IAED,SAAS,CAAC,KAAuC,EAAE,OAA2B;QAC5E,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,EAAC,QAAQ,OAAG,CAAC;QACtB,CAAC;QAED,MAAM,GAAG,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAEhE,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO,EAAC,QAAQ,OAAG,CAAC;QACtB,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IAC3D,CAAC;CACF","sourcesContent":["import { Fragment, JSX, h } from \"@stencil/core\";\r\n\r\nimport { parseXml } from \"../../utils/parse-xml\";\r\n\r\nimport { getNodeName } from \"./get-node-name.function\";\r\nimport { OzonContentAbbrNode } from \"./nodes/abbr.node\";\r\nimport { OzonContentAlNode } from \"./nodes/al.node\";\r\nimport { OzonContentBegripNode } from \"./nodes/begrip.node\";\r\nimport { OzonContentBegrippenlijstNode } from \"./nodes/begrippenlijst.node\";\r\nimport { OzonContentBronNode } from \"./nodes/bron.node\";\r\nimport { OzonContentDocumentNode } from \"./nodes/document.node\";\r\nimport { OzonContentExtRefNode } from \"./nodes/ext-ref.node\";\r\nimport { OzonContentFallbackNode } from \"./nodes/fallback.node\";\r\nimport { OzonContentFiguurNode } from \"./nodes/figuur.node\";\r\nimport { OzonContentInhoudNode } from \"./nodes/inhoud.node\";\r\nimport { OzonContentInlineTekstAfbeeldingNode } from \"./nodes/inline-tekst-afbeelding.node\";\r\nimport { OzonContentInlineNodes } from \"./nodes/inline.nodes\";\r\nimport { OzonContentIntIoRefNode } from \"./nodes/int-io-ref.node\";\r\nimport { OzonContentIntRefNode } from \"./nodes/int-ref.node\";\r\nimport { OzonContentKopNode } from \"./nodes/kop.node\";\r\nimport { OzonContentLijstNode } from \"./nodes/lijst.node\";\r\nimport { OzonContentNieuweTekstNode } from \"./nodes/nieuwe-tekst.node\";\r\nimport { OzonContentNootNode } from \"./nodes/noot.node\";\r\nimport { OzonContentTableNode } from \"./nodes/table.node\";\r\nimport { OzonContentTextNode } from \"./nodes/text.node\";\r\nimport { OzonContentVerwijderdeTekstNode } from \"./nodes/verwijderde-tekst.node\";\r\nimport { OzonContentContext } from \"./ozon-content-context.interface\";\r\nimport { OzonContentNode } from \"./ozon-content-node.interface\";\r\nimport { OzonContentInputType } from \"./ozon-content.interfaces\";\r\n\r\nexport class Mapper {\r\n private mappers: OzonContentNode[] = [\r\n new OzonContentAbbrNode(),\r\n new OzonContentBegrippenlijstNode(),\r\n new OzonContentBegripNode(),\r\n new OzonContentTextNode(),\r\n new OzonContentDocumentNode(),\r\n new OzonContentInhoudNode(),\r\n new OzonContentKopNode(),\r\n new OzonContentIntRefNode(),\r\n new OzonContentExtRefNode(),\r\n new OzonContentAlNode(),\r\n new OzonContentInlineNodes(),\r\n new OzonContentInlineTekstAfbeeldingNode(),\r\n new OzonContentNootNode(),\r\n new OzonContentTableNode(),\r\n new OzonContentIntIoRefNode(),\r\n new OzonContentFiguurNode(),\r\n new OzonContentLijstNode(),\r\n new OzonContentBronNode(),\r\n new OzonContentNieuweTekstNode(),\r\n new OzonContentVerwijderdeTekstNode(),\r\n ];\r\n\r\n private skip = this.mappers.reduce<string[]>((t, m) => {\r\n if (m.handles) {\r\n t.push(...m.handles);\r\n }\r\n\r\n return t;\r\n }, []);\r\n\r\n private fallbackNode = new OzonContentFallbackNode();\r\n\r\n private findMapper(name: string): OzonContentNode | undefined {\r\n if (this.skip.includes(name)) {\r\n return undefined;\r\n }\r\n\r\n return (\r\n this.mappers.find((m) => {\r\n if (Array.isArray(m.name)) {\r\n return m.name.includes(name);\r\n }\r\n\r\n return m.name === name;\r\n }) ?? this.fallbackNode\r\n );\r\n }\r\n\r\n mapNodeToJsx(node: Node | Node[] | NodeList, context: OzonContentContext, path: Node[]): JSX.Element {\r\n if (node instanceof NodeList) {\r\n return <Fragment>{Array.from(node).map((n) => this.mapNodeToJsx(n, context, path))}</Fragment>;\r\n }\r\n\r\n if (Array.isArray(node)) {\r\n return <Fragment>{node.map((n) => this.mapNodeToJsx(n, context, path))}</Fragment>;\r\n }\r\n\r\n const nodeName = getNodeName(node);\r\n const mapper = this.findMapper(nodeName);\r\n if (!mapper) {\r\n return <Fragment />;\r\n }\r\n\r\n const identity = mapper.identify?.(node);\r\n\r\n const state = identity ? context.state[identity] : undefined;\r\n const setState = identity ? (s: unknown) => context.setState({ ...context.state, [identity]: s }) : undefined;\r\n\r\n return mapper.render(node, {\r\n inline: context.inline,\r\n mark: context.mark,\r\n mapNodeToJsx: (n) => this.mapNodeToJsx(n, context, [...path, node]),\r\n emitClick: context.emitClick,\r\n setState,\r\n emitMarkItemHighlight: context.emitMarkItemHighlight,\r\n state,\r\n path,\r\n urlResolver: context.urlResolver,\r\n begripResolver: context.begripResolver,\r\n });\r\n }\r\n\r\n transform(input: OzonContentInputType | undefined, context: OzonContentContext): JSX.Element {\r\n if (!input) {\r\n return <Fragment />;\r\n }\r\n\r\n const doc = typeof input === \"string\" ? parseXml(input) : input;\r\n\r\n if (!doc) {\r\n return <Fragment />;\r\n }\r\n\r\n return this.mapNodeToJsx(doc.getRootNode(), context, []);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ozon-content-node-context.interface.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/ozon-content-node-context.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { JSX } from \"@stencil/core\";\r\n\r\nimport {\
|
|
1
|
+
{"version":3,"file":"ozon-content-node-context.interface.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/ozon-content-node-context.interface.ts"],"names":[],"mappings":"","sourcesContent":["import { JSX } from \"@stencil/core\";\r\n\r\nimport { MarkTextMarkFunction } from \"../../functional-components/mark-text/mark-text.interfaces\";\r\n\r\nimport { OzonContentBegripResolver, OzonContentClickEvent, OzonContentUrlResolver } from \"./ozon-content.interfaces\";\r\n\r\nexport interface OzonContentNodeContext<T = unknown> {\r\n inline: boolean;\r\n path: Node[];\r\n mark: MarkTextMarkFunction | undefined;\r\n mapNodeToJsx(node: Node | Node[] | NodeList): JSX.Element;\r\n emitClick(event: OzonContentClickEvent): void;\r\n state?: T;\r\n setState?(state: T): void;\r\n emitMarkItemHighlight(text: string, elementRef: HTMLElement): void;\r\n urlResolver: OzonContentUrlResolver | undefined;\r\n begripResolver: OzonContentBegripResolver | undefined;\r\n}\r\n"]}
|
|
@@ -2067,4 +2067,228 @@ del.editaction-remove p:last-child {
|
|
|
2067
2067
|
.subtitel ins,
|
|
2068
2068
|
.subtitel del {
|
|
2069
2069
|
color: #173521;
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
td.editaction-remove {
|
|
2073
|
+
--_dso-alert-success-border-color: #39870c;
|
|
2074
|
+
--_dso-alert-error-border-color: #ce3f51;
|
|
2075
|
+
--_dso-alert-info-border-color: #6ca4d9;
|
|
2076
|
+
--_dso-alert-warning-border-color: #dcd400;
|
|
2077
|
+
--link-color: currentColor;
|
|
2078
|
+
--link-hover-color: currentColor;
|
|
2079
|
+
--link-visited-color: currentColor;
|
|
2080
|
+
--_dso-icon-button-tertiary-color: #191919;
|
|
2081
|
+
--_dso-icon-button-tertiary-hover-color: #4c4c4c;
|
|
2082
|
+
--_dso-icon-button-tertiary-active-color: #173521;
|
|
2083
|
+
--_dso-icon-button-tertiary-disabled-color: #999;
|
|
2084
|
+
background-color: #f5d8dc;
|
|
2085
|
+
color: #191919;
|
|
2086
|
+
}
|
|
2087
|
+
td.editaction-remove a:not(.dso-primary, .dso-secondary, .dso-tertiary):is(.download, .download:hover, .download:focus-visible) {
|
|
2088
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#download-zwart"));
|
|
2089
|
+
}
|
|
2090
|
+
td.editaction-remove a:not(.dso-primary, .dso-secondary, .dso-tertiary):is(.extern, .extern:hover, .extern:focus-visible) {
|
|
2091
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#external-link-zwart"));
|
|
2092
|
+
}
|
|
2093
|
+
td.editaction-remove a:not(.dso-primary, .dso-secondary, .dso-tertiary):is([href^="tel:"], [href^="tel:"]:hover, [href^="tel:"]:focus-visible) {
|
|
2094
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#call-zwart"));
|
|
2095
|
+
}
|
|
2096
|
+
td.editaction-remove a:not(.dso-primary, .dso-secondary, .dso-tertiary):is([href^="mailto:"], [href^="mailto:"]:hover, [href^="mailto:"]:focus-visible) {
|
|
2097
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#email-zwart"));
|
|
2098
|
+
}
|
|
2099
|
+
td.editaction-remove {
|
|
2100
|
+
--_dso-ozon-content-toggletip-color: colors.$zwart;
|
|
2101
|
+
text-decoration: line-through;
|
|
2102
|
+
--_dso-ozon-content-toggletip-text-decoration: underline line-through;
|
|
2103
|
+
}
|
|
2104
|
+
@media screen and (min--moz-device-pixel-ratio: 0) {
|
|
2105
|
+
td.editaction-remove {
|
|
2106
|
+
font-family: sans-serif;
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
td.editaction-add {
|
|
2110
|
+
--_dso-alert-success-border-color: #39870c;
|
|
2111
|
+
--_dso-alert-error-border-color: #ce3f51;
|
|
2112
|
+
--_dso-alert-info-border-color: #6ca4d9;
|
|
2113
|
+
--_dso-alert-warning-border-color: #dcd400;
|
|
2114
|
+
--link-color: currentColor;
|
|
2115
|
+
--link-hover-color: currentColor;
|
|
2116
|
+
--link-visited-color: currentColor;
|
|
2117
|
+
--_dso-icon-button-tertiary-color: #191919;
|
|
2118
|
+
--_dso-icon-button-tertiary-hover-color: #4c4c4c;
|
|
2119
|
+
--_dso-icon-button-tertiary-active-color: #173521;
|
|
2120
|
+
--_dso-icon-button-tertiary-disabled-color: #999;
|
|
2121
|
+
background-color: #e4f1d4;
|
|
2122
|
+
color: #191919;
|
|
2123
|
+
}
|
|
2124
|
+
td.editaction-add a:not(.dso-primary, .dso-secondary, .dso-tertiary):is(.download, .download:hover, .download:focus-visible) {
|
|
2125
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#download-zwart"));
|
|
2126
|
+
}
|
|
2127
|
+
td.editaction-add a:not(.dso-primary, .dso-secondary, .dso-tertiary):is(.extern, .extern:hover, .extern:focus-visible) {
|
|
2128
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#external-link-zwart"));
|
|
2129
|
+
}
|
|
2130
|
+
td.editaction-add a:not(.dso-primary, .dso-secondary, .dso-tertiary):is([href^="tel:"], [href^="tel:"]:hover, [href^="tel:"]:focus-visible) {
|
|
2131
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#call-zwart"));
|
|
2132
|
+
}
|
|
2133
|
+
td.editaction-add a:not(.dso-primary, .dso-secondary, .dso-tertiary):is([href^="mailto:"], [href^="mailto:"]:hover, [href^="mailto:"]:focus-visible) {
|
|
2134
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#email-zwart"));
|
|
2135
|
+
}
|
|
2136
|
+
td.editaction-add {
|
|
2137
|
+
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.5);
|
|
2138
|
+
--_dso-ozon-content-toggletip-color: colors.$zwart;
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
.begrippenlijst .editaction-add {
|
|
2142
|
+
--_dso-alert-success-border-color: #39870c;
|
|
2143
|
+
--_dso-alert-error-border-color: #ce3f51;
|
|
2144
|
+
--_dso-alert-info-border-color: #6ca4d9;
|
|
2145
|
+
--_dso-alert-warning-border-color: #dcd400;
|
|
2146
|
+
--link-color: currentColor;
|
|
2147
|
+
--link-hover-color: currentColor;
|
|
2148
|
+
--link-visited-color: currentColor;
|
|
2149
|
+
--_dso-icon-button-tertiary-color: #191919;
|
|
2150
|
+
--_dso-icon-button-tertiary-hover-color: #4c4c4c;
|
|
2151
|
+
--_dso-icon-button-tertiary-active-color: #173521;
|
|
2152
|
+
--_dso-icon-button-tertiary-disabled-color: #999;
|
|
2153
|
+
background-color: #e4f1d4;
|
|
2154
|
+
color: #191919;
|
|
2155
|
+
}
|
|
2156
|
+
.begrippenlijst .editaction-add a:not(.dso-primary, .dso-secondary, .dso-tertiary):is(.download, .download:hover, .download:focus-visible) {
|
|
2157
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#download-zwart"));
|
|
2158
|
+
}
|
|
2159
|
+
.begrippenlijst .editaction-add a:not(.dso-primary, .dso-secondary, .dso-tertiary):is(.extern, .extern:hover, .extern:focus-visible) {
|
|
2160
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#external-link-zwart"));
|
|
2161
|
+
}
|
|
2162
|
+
.begrippenlijst .editaction-add a:not(.dso-primary, .dso-secondary, .dso-tertiary):is([href^="tel:"], [href^="tel:"]:hover, [href^="tel:"]:focus-visible) {
|
|
2163
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#call-zwart"));
|
|
2164
|
+
}
|
|
2165
|
+
.begrippenlijst .editaction-add a:not(.dso-primary, .dso-secondary, .dso-tertiary):is([href^="mailto:"], [href^="mailto:"]:hover, [href^="mailto:"]:focus-visible) {
|
|
2166
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#email-zwart"));
|
|
2167
|
+
}
|
|
2168
|
+
.begrippenlijst .editaction-add {
|
|
2169
|
+
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.5);
|
|
2170
|
+
--_dso-ozon-content-toggletip-color: colors.$zwart;
|
|
2171
|
+
}
|
|
2172
|
+
.begrippenlijst .editaction-remove {
|
|
2173
|
+
--_dso-alert-success-border-color: #39870c;
|
|
2174
|
+
--_dso-alert-error-border-color: #ce3f51;
|
|
2175
|
+
--_dso-alert-info-border-color: #6ca4d9;
|
|
2176
|
+
--_dso-alert-warning-border-color: #dcd400;
|
|
2177
|
+
--link-color: currentColor;
|
|
2178
|
+
--link-hover-color: currentColor;
|
|
2179
|
+
--link-visited-color: currentColor;
|
|
2180
|
+
--_dso-icon-button-tertiary-color: #191919;
|
|
2181
|
+
--_dso-icon-button-tertiary-hover-color: #4c4c4c;
|
|
2182
|
+
--_dso-icon-button-tertiary-active-color: #173521;
|
|
2183
|
+
--_dso-icon-button-tertiary-disabled-color: #999;
|
|
2184
|
+
background-color: #f5d8dc;
|
|
2185
|
+
color: #191919;
|
|
2186
|
+
}
|
|
2187
|
+
.begrippenlijst .editaction-remove a:not(.dso-primary, .dso-secondary, .dso-tertiary):is(.download, .download:hover, .download:focus-visible) {
|
|
2188
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#download-zwart"));
|
|
2189
|
+
}
|
|
2190
|
+
.begrippenlijst .editaction-remove a:not(.dso-primary, .dso-secondary, .dso-tertiary):is(.extern, .extern:hover, .extern:focus-visible) {
|
|
2191
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#external-link-zwart"));
|
|
2192
|
+
}
|
|
2193
|
+
.begrippenlijst .editaction-remove a:not(.dso-primary, .dso-secondary, .dso-tertiary):is([href^="tel:"], [href^="tel:"]:hover, [href^="tel:"]:focus-visible) {
|
|
2194
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#call-zwart"));
|
|
2195
|
+
}
|
|
2196
|
+
.begrippenlijst .editaction-remove a:not(.dso-primary, .dso-secondary, .dso-tertiary):is([href^="mailto:"], [href^="mailto:"]:hover, [href^="mailto:"]:focus-visible) {
|
|
2197
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#email-zwart"));
|
|
2198
|
+
}
|
|
2199
|
+
.begrippenlijst .editaction-remove {
|
|
2200
|
+
--_dso-ozon-content-toggletip-color: colors.$zwart;
|
|
2201
|
+
text-decoration: line-through;
|
|
2202
|
+
--_dso-ozon-content-toggletip-text-decoration: underline line-through;
|
|
2203
|
+
}
|
|
2204
|
+
@media screen and (min--moz-device-pixel-ratio: 0) {
|
|
2205
|
+
.begrippenlijst .editaction-remove {
|
|
2206
|
+
font-family: sans-serif;
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2209
|
+
.begrippenlijst .editaction-remove dt,
|
|
2210
|
+
.begrippenlijst .editaction-remove dd {
|
|
2211
|
+
text-decoration: line-through;
|
|
2212
|
+
--_dso-ozon-content-toggletip-text-decoration: underline line-through;
|
|
2213
|
+
}
|
|
2214
|
+
@media screen and (min--moz-device-pixel-ratio: 0) {
|
|
2215
|
+
.begrippenlijst .editaction-remove dt,
|
|
2216
|
+
.begrippenlijst .editaction-remove dd {
|
|
2217
|
+
font-family: sans-serif;
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
.begrippenlijst dt {
|
|
2221
|
+
display: inline-block;
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
.kop ins {
|
|
2225
|
+
text-decoration: none;
|
|
2226
|
+
}
|
|
2227
|
+
.kop ins {
|
|
2228
|
+
--_dso-alert-success-border-color: #39870c;
|
|
2229
|
+
--_dso-alert-error-border-color: #ce3f51;
|
|
2230
|
+
--_dso-alert-info-border-color: #6ca4d9;
|
|
2231
|
+
--_dso-alert-warning-border-color: #dcd400;
|
|
2232
|
+
--link-color: currentColor;
|
|
2233
|
+
--link-hover-color: currentColor;
|
|
2234
|
+
--link-visited-color: currentColor;
|
|
2235
|
+
--_dso-icon-button-tertiary-color: #191919;
|
|
2236
|
+
--_dso-icon-button-tertiary-hover-color: #4c4c4c;
|
|
2237
|
+
--_dso-icon-button-tertiary-active-color: #173521;
|
|
2238
|
+
--_dso-icon-button-tertiary-disabled-color: #999;
|
|
2239
|
+
background-color: #e4f1d4;
|
|
2240
|
+
color: #191919;
|
|
2241
|
+
}
|
|
2242
|
+
.kop ins a:not(.dso-primary, .dso-secondary, .dso-tertiary):is(.download, .download:hover, .download:focus-visible) {
|
|
2243
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#download-zwart"));
|
|
2244
|
+
}
|
|
2245
|
+
.kop ins a:not(.dso-primary, .dso-secondary, .dso-tertiary):is(.extern, .extern:hover, .extern:focus-visible) {
|
|
2246
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#external-link-zwart"));
|
|
2247
|
+
}
|
|
2248
|
+
.kop ins a:not(.dso-primary, .dso-secondary, .dso-tertiary):is([href^="tel:"], [href^="tel:"]:hover, [href^="tel:"]:focus-visible) {
|
|
2249
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#call-zwart"));
|
|
2250
|
+
}
|
|
2251
|
+
.kop ins a:not(.dso-primary, .dso-secondary, .dso-tertiary):is([href^="mailto:"], [href^="mailto:"]:hover, [href^="mailto:"]:focus-visible) {
|
|
2252
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#email-zwart"));
|
|
2253
|
+
}
|
|
2254
|
+
.kop ins {
|
|
2255
|
+
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.5);
|
|
2256
|
+
--_dso-ozon-content-toggletip-color: colors.$zwart;
|
|
2257
|
+
}
|
|
2258
|
+
.kop del {
|
|
2259
|
+
--_dso-alert-success-border-color: #39870c;
|
|
2260
|
+
--_dso-alert-error-border-color: #ce3f51;
|
|
2261
|
+
--_dso-alert-info-border-color: #6ca4d9;
|
|
2262
|
+
--_dso-alert-warning-border-color: #dcd400;
|
|
2263
|
+
--link-color: currentColor;
|
|
2264
|
+
--link-hover-color: currentColor;
|
|
2265
|
+
--link-visited-color: currentColor;
|
|
2266
|
+
--_dso-icon-button-tertiary-color: #191919;
|
|
2267
|
+
--_dso-icon-button-tertiary-hover-color: #4c4c4c;
|
|
2268
|
+
--_dso-icon-button-tertiary-active-color: #173521;
|
|
2269
|
+
--_dso-icon-button-tertiary-disabled-color: #999;
|
|
2270
|
+
background-color: #f5d8dc;
|
|
2271
|
+
color: #191919;
|
|
2272
|
+
}
|
|
2273
|
+
.kop del a:not(.dso-primary, .dso-secondary, .dso-tertiary):is(.download, .download:hover, .download:focus-visible) {
|
|
2274
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#download-zwart"));
|
|
2275
|
+
}
|
|
2276
|
+
.kop del a:not(.dso-primary, .dso-secondary, .dso-tertiary):is(.extern, .extern:hover, .extern:focus-visible) {
|
|
2277
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#external-link-zwart"));
|
|
2278
|
+
}
|
|
2279
|
+
.kop del a:not(.dso-primary, .dso-secondary, .dso-tertiary):is([href^="tel:"], [href^="tel:"]:hover, [href^="tel:"]:focus-visible) {
|
|
2280
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#call-zwart"));
|
|
2281
|
+
}
|
|
2282
|
+
.kop del a:not(.dso-primary, .dso-secondary, .dso-tertiary):is([href^="mailto:"], [href^="mailto:"]:hover, [href^="mailto:"]:focus-visible) {
|
|
2283
|
+
background-image: var(--_dso-di-background-image, url("./di.svg#email-zwart"));
|
|
2284
|
+
}
|
|
2285
|
+
.kop del {
|
|
2286
|
+
--_dso-ozon-content-toggletip-color: colors.$zwart;
|
|
2287
|
+
text-decoration: line-through;
|
|
2288
|
+
--_dso-ozon-content-toggletip-text-decoration: underline line-through;
|
|
2289
|
+
}
|
|
2290
|
+
@media screen and (min--moz-device-pixel-ratio: 0) {
|
|
2291
|
+
.kop del {
|
|
2292
|
+
font-family: sans-serif;
|
|
2293
|
+
}
|
|
2070
2294
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ozon-content.interfaces.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/ozon-content.interfaces.ts"],"names":[],"mappings":"","sourcesContent":["interface OzonContentClickBaseEvent<T extends string> {\r\n type: T;\r\n node: Element;\r\n originalEvent: MouseEvent;\r\n}\r\n\r\nexport type OzonContentClickKopEvent = OzonContentClickBaseEvent<\"Kop\">;\r\nexport type OzonContentClickIntIoRefEvent = OzonContentClickBaseEvent<\"IntIoRef\">;\r\nexport type OzonContentClickIntRefEvent = OzonContentClickBaseEvent<\"IntRef\"> & { isModifiedEvent: boolean };\r\n\r\nexport type OzonContentClickEvent =\r\n | OzonContentClickKopEvent\r\n | OzonContentClickIntRefEvent\r\n | OzonContentClickIntIoRefEvent;\r\n\r\nexport type OzonContentInputType = XMLDocument | string;\r\n\r\nexport
|
|
1
|
+
{"version":3,"file":"ozon-content.interfaces.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/ozon-content.interfaces.ts"],"names":[],"mappings":"","sourcesContent":["interface OzonContentClickBaseEvent<T extends string> {\r\n type: T;\r\n node: Element;\r\n originalEvent: MouseEvent;\r\n}\r\n\r\nexport type OzonContentClickKopEvent = OzonContentClickBaseEvent<\"Kop\">;\r\nexport type OzonContentClickIntIoRefEvent = OzonContentClickBaseEvent<\"IntIoRef\">;\r\nexport type OzonContentClickIntRefEvent = OzonContentClickBaseEvent<\"IntRef\"> & { isModifiedEvent: boolean };\r\n\r\nexport type OzonContentClickEvent =\r\n | OzonContentClickKopEvent\r\n | OzonContentClickIntRefEvent\r\n | OzonContentClickIntIoRefEvent;\r\n\r\nexport type OzonContentInputType = XMLDocument | string;\r\n\r\nexport interface OzonContentMarkItemHighlightEvent {\r\n text: string;\r\n elementRef: HTMLElement;\r\n}\r\n\r\nexport type OzonContentWijzigActie = \"voegtoe\" | \"verwijder\";\r\n\r\nexport interface OzonContentUrlResolver {\r\n (name: \"Illustratie\" | \"InlineTekstAfbeelding\", attribute: \"naam\", value: string | null, element: Element): string;\r\n (\r\n name: \"ExtIoRef\" | \"ExtRef\" | \"IntIoRef\" | \"IntRef\",\r\n attribute: \"ref\",\r\n value: string | null,\r\n element: Element,\r\n ): string;\r\n}\r\n\r\nexport interface OzonContentBegripResolver {\r\n (ref: string | null, element: Element): XMLDocument | string | undefined;\r\n}\r\n"]}
|
|
@@ -27,7 +27,7 @@ export class OzonContent {
|
|
|
27
27
|
begripResolver: this.begripResolver,
|
|
28
28
|
};
|
|
29
29
|
const transformed = mapper.transform(this.content, context);
|
|
30
|
-
return h(Fragment, { key: '
|
|
30
|
+
return h(Fragment, { key: 'b3bccfe4c31aceff6ac766098f466834ad920220' }, transformed);
|
|
31
31
|
}
|
|
32
32
|
static get is() { return "dso-ozon-content"; }
|
|
33
33
|
static get encapsulation() { return "shadow"; }
|
|
@@ -93,13 +93,13 @@ export class OzonContent {
|
|
|
93
93
|
"attribute": "mark",
|
|
94
94
|
"mutable": false,
|
|
95
95
|
"complexType": {
|
|
96
|
-
"original": "
|
|
97
|
-
"resolved": "((text: string) =>
|
|
96
|
+
"original": "MarkTextMarkFunction",
|
|
97
|
+
"resolved": "((text: string) => MarkTextText[] | undefined) | undefined",
|
|
98
98
|
"references": {
|
|
99
|
-
"
|
|
99
|
+
"MarkTextMarkFunction": {
|
|
100
100
|
"location": "import",
|
|
101
|
-
"path": "
|
|
102
|
-
"id": "src/components/
|
|
101
|
+
"path": "../../functional-components/mark-text/mark-text.interfaces",
|
|
102
|
+
"id": "src/functional-components/mark-text/mark-text.interfaces.ts::MarkTextMarkFunction"
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ozon-content.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/ozon-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,KAAK,EAEL,QAAQ,EAER,IAAI,EACJ,KAAK,EACL,KAAK,EACL,CAAC,GACF,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ozon-content.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/ozon-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,KAAK,EAEL,QAAQ,EAER,IAAI,EACJ,KAAK,EACL,KAAK,EACL,CAAC,GACF,MAAM,eAAe,CAAC;AAKvB,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAU/C,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;AAO5B,MAAM,OAAO,WAAW;IALxB;QA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B,sBAAe;QACf,oBAAa,CACJ,CACZ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\r\n Component,\r\n ComponentInterface,\r\n Event,\r\n EventEmitter,\r\n Fragment,\r\n JSX,\r\n Prop,\r\n State,\r\n Watch,\r\n h,\r\n} from \"@stencil/core\";\r\n\r\nimport { MarkTextMarkFunction } from \"../../functional-components/mark-text/mark-text.interfaces\";\r\n\r\nimport { OzonContentContext } from \"./ozon-content-context.interface\";\r\nimport { Mapper } from \"./ozon-content-mapper\";\r\nimport { OzonContentNodeState } from \"./ozon-content-node-state.interface\";\r\nimport {\r\n OzonContentBegripResolver,\r\n OzonContentClickEvent,\r\n OzonContentInputType,\r\n OzonContentMarkItemHighlightEvent,\r\n OzonContentUrlResolver,\r\n} from \"./ozon-content.interfaces\";\r\n\r\nconst mapper = new Mapper();\r\n\r\n@Component({\r\n tag: \"dso-ozon-content\",\r\n styleUrl: \"ozon-content.scss\",\r\n shadow: true,\r\n})\r\nexport class OzonContent implements ComponentInterface {\r\n /**\r\n * The XML to be rendered.\r\n */\r\n @Prop()\r\n content?: OzonContentInputType;\r\n\r\n /**\r\n * Setting this property creates dso-ozon-content as inline element instead of a block element.\r\n */\r\n @Prop({ reflect: true })\r\n inline = false;\r\n\r\n /**\r\n * To mark text.\r\n */\r\n @Prop()\r\n mark?: MarkTextMarkFunction;\r\n\r\n /**\r\n * A UrlResolver that will be called for all STOP elements that render to HTML5 elements with external references.\r\n */\r\n @Prop()\r\n urlResolver?: OzonContentUrlResolver;\r\n\r\n /**\r\n * A BegripResolver that will be called for STOP element \"IntRef\" with scope=\"Begrip\".\r\n */\r\n @Prop()\r\n begripResolver?: OzonContentBegripResolver;\r\n\r\n /**\r\n * Emitted when an interactive element is clicked.\r\n */\r\n @Event({ bubbles: false })\r\n dsoClick!: EventEmitter<OzonContentClickEvent>;\r\n\r\n /**\r\n * Emitted when a marked item is highlighted.\r\n */\r\n @Event({ bubbles: false })\r\n dsoOzonContentMarkItemHighlight!: EventEmitter<OzonContentMarkItemHighlightEvent>;\r\n\r\n @Watch(\"content\")\r\n contentWatcher() {\r\n this.state = {};\r\n }\r\n\r\n @State()\r\n state: OzonContentNodeState = {};\r\n\r\n private handleMarkItemHighlight = (text: string, elementRef: HTMLElement) => {\r\n this.dsoOzonContentMarkItemHighlight.emit({ text, elementRef });\r\n };\r\n\r\n render(): JSX.Element {\r\n const context: OzonContentContext = {\r\n state: this.state,\r\n inline: this.inline,\r\n mark: this.mark,\r\n setState: (state) => (this.state = state),\r\n emitMarkItemHighlight: this.handleMarkItemHighlight,\r\n emitClick: this.dsoClick.emit,\r\n urlResolver: this.urlResolver,\r\n begripResolver: this.begripResolver,\r\n };\r\n\r\n const transformed = mapper.transform(this.content, context);\r\n\r\n return <Fragment>{transformed}</Fragment>;\r\n }\r\n}\r\n\r\nconst dependencies = () => {\r\n dependencies();\r\n\r\n return (\r\n <Fragment>\r\n <dso-icon />\r\n <dso-image-overlay />\r\n <dso-ozon-content-toggletip />\r\n <dso-tooltip />\r\n <dso-table />\r\n </Fragment>\r\n );\r\n};\r\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Fragment, h } from "@stencil/core";
|
|
2
|
+
export const MarkText = ({ mark, text, emitMarkItemHighlight }) => {
|
|
3
|
+
const result = mark(text);
|
|
4
|
+
return !result || result.length === 0 ? (h(Fragment, null, text)) : (h(Fragment, null, result.map((value) => {
|
|
5
|
+
if (typeof value === "string") {
|
|
6
|
+
return h(Fragment, null, value);
|
|
7
|
+
}
|
|
8
|
+
return (h("mark", { class: value.highlight ? "dso-highlight" : undefined, ref: (ref) => value.highlight && ref && emitMarkItemHighlight(value.text, ref) }, value.text));
|
|
9
|
+
})));
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=mark-text.functional-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mark-text.functional-component.js","sourceRoot":"","sources":["../../../../src/functional-components/mark-text/mark-text.functional-component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAuB,CAAC,EAAE,MAAM,eAAe,CAAC;AAUjE,MAAM,CAAC,MAAM,QAAQ,GAAuC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,qBAAqB,EAAE,EAAE,EAAE;IACpG,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;IAE1B,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CACtC,EAAC,QAAQ,QAAE,IAAI,CAAY,CAC5B,CAAC,CAAC,CAAC,CACF,EAAC,QAAQ,QACN,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACpB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,EAAC,QAAQ,QAAE,KAAK,CAAY,CAAC;QACtC,CAAC;QAED,OAAO,CACL,YACE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,EACpD,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,IAAI,GAAG,IAAI,qBAAqB,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,IAE7E,KAAK,CAAC,IAAI,CACN,CACR,CAAC;IACJ,CAAC,CAAC,CACO,CACZ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { Fragment, FunctionalComponent, h } from \"@stencil/core\";\r\n\r\nimport { MarkTextMarkFunction } from \"./mark-text.interfaces\";\r\n\r\nexport interface MarkTextProps {\r\n mark: MarkTextMarkFunction;\r\n text: string;\r\n emitMarkItemHighlight(text: string, elementRef: HTMLElement): void;\r\n}\r\n\r\nexport const MarkText: FunctionalComponent<MarkTextProps> = ({ mark, text, emitMarkItemHighlight }) => {\r\n const result = mark(text);\r\n\r\n return !result || result.length === 0 ? (\r\n <Fragment>{text}</Fragment>\r\n ) : (\r\n <Fragment>\r\n {result.map((value) => {\r\n if (typeof value === \"string\") {\r\n return <Fragment>{value}</Fragment>;\r\n }\r\n\r\n return (\r\n <mark\r\n class={value.highlight ? \"dso-highlight\" : undefined}\r\n ref={(ref) => value.highlight && ref && emitMarkItemHighlight(value.text, ref)}\r\n >\r\n {value.text}\r\n </mark>\r\n );\r\n })}\r\n </Fragment>\r\n );\r\n};\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mark-text.interfaces.js","sourceRoot":"","sources":["../../../../src/functional-components/mark-text/mark-text.interfaces.ts"],"names":[],"mappings":"","sourcesContent":["export type MarkTextMarkFunction = (text: string) => MarkTextText[] | undefined;\r\n\r\nexport type MarkTextText = MarkTextMarkItem | string;\r\n\r\nexport interface MarkTextMarkItem {\r\n text: string;\r\n highlight?: boolean;\r\n}\r\n"]}
|