@dso-toolkit/core 58.3.1 → 59.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/dist/cjs/_commonjsHelpers-68cdf74f.js +7 -0
  2. package/dist/cjs/_commonjsHelpers-68cdf74f.js.map +1 -0
  3. package/dist/cjs/dso-alert_5.cjs.entry.js +497 -46
  4. package/dist/cjs/dso-alert_5.cjs.entry.js.map +1 -1
  5. package/dist/cjs/dso-annotation-output_3.cjs.entry.js +6 -2
  6. package/dist/cjs/dso-annotation-output_3.cjs.entry.js.map +1 -1
  7. package/dist/cjs/dso-dropdown-menu.cjs.entry.js +4 -2
  8. package/dist/cjs/dso-dropdown-menu.cjs.entry.js.map +1 -1
  9. package/dist/cjs/dso-header.cjs.entry.js +1 -1
  10. package/dist/cjs/dso-header.cjs.entry.js.map +1 -1
  11. package/dist/cjs/dso-modal.cjs.entry.js +1 -1
  12. package/dist/cjs/dso-modal.cjs.entry.js.map +1 -1
  13. package/dist/cjs/dso-table.cjs.entry.js +1 -1
  14. package/dist/cjs/dso-table.cjs.entry.js.map +1 -1
  15. package/dist/cjs/dso-toolkit.cjs.js +1 -1
  16. package/dist/cjs/dso-tooltip.cjs.entry.js +1 -1
  17. package/dist/cjs/dso-tooltip.cjs.entry.js.map +1 -1
  18. package/dist/cjs/dsot-document-component-demo.cjs.entry.js +1688 -41
  19. package/dist/cjs/dsot-document-component-demo.cjs.entry.js.map +1 -1
  20. package/dist/cjs/loader.cjs.js +1 -1
  21. package/dist/collection/collection-manifest.json +1 -1
  22. package/dist/collection/components/document-component/document-component.css +687 -13
  23. package/dist/collection/components/document-component/document-component.js +31 -7
  24. package/dist/collection/components/document-component/document-component.js.map +1 -1
  25. package/dist/collection/components/document-component/document-component.models.js +2 -0
  26. package/dist/collection/components/document-component/document-component.models.js.map +1 -0
  27. package/dist/collection/components/document-component-demo/document-component.demo.css +11 -0
  28. package/dist/collection/components/document-component-demo/document-component.demo.js +235 -0
  29. package/dist/collection/components/document-component-demo/document-component.demo.js.map +1 -0
  30. package/dist/collection/components/dropdown-menu/dropdown-menu.js +29 -2
  31. package/dist/collection/components/dropdown-menu/dropdown-menu.js.map +1 -1
  32. package/dist/collection/components/header/header.js +1 -1
  33. package/dist/collection/components/header/header.js.map +1 -1
  34. package/dist/collection/components/modal/modal.css +3 -3
  35. package/dist/collection/components/ozon-content/nodes/al.node.js +24 -7
  36. package/dist/collection/components/ozon-content/nodes/al.node.js.map +1 -1
  37. package/dist/collection/components/ozon-content/nodes/ext-ref.node.js +3 -1
  38. package/dist/collection/components/ozon-content/nodes/ext-ref.node.js.map +1 -1
  39. package/dist/collection/components/ozon-content/nodes/nieuwe-tekst.node.js +1 -1
  40. package/dist/collection/components/ozon-content/nodes/nieuwe-tekst.node.js.map +1 -1
  41. package/dist/collection/components/ozon-content/nodes/opschrift.node.js +9 -1
  42. package/dist/collection/components/ozon-content/nodes/opschrift.node.js.map +1 -1
  43. package/dist/collection/components/ozon-content/nodes/table.node/table.node.js +1 -2
  44. package/dist/collection/components/ozon-content/nodes/table.node/table.node.js.map +1 -1
  45. package/dist/collection/components/ozon-content/nodes/verwijderde-tekst.node.js +1 -1
  46. package/dist/collection/components/ozon-content/nodes/verwijderde-tekst.node.js.map +1 -1
  47. package/dist/collection/components/ozon-content/ozon-content-context.interface.js.map +1 -1
  48. package/dist/collection/components/ozon-content/ozon-content-mapper.js +11 -9
  49. package/dist/collection/components/ozon-content/ozon-content-mapper.js.map +1 -1
  50. package/dist/collection/components/ozon-content/ozon-content-node-context.interface.js.map +1 -1
  51. package/dist/collection/components/ozon-content/ozon-content.css +1100 -35
  52. package/dist/collection/components/ozon-content/ozon-content.interfaces.js.map +1 -1
  53. package/dist/collection/components/ozon-content/ozon-content.js +17 -83
  54. package/dist/collection/components/ozon-content/ozon-content.js.map +1 -1
  55. package/dist/collection/components/table/table.css +669 -97
  56. package/dist/collection/components/tooltip/tooltip.css +0 -8
  57. package/dist/components/document-component.js +6 -2
  58. package/dist/components/document-component.js.map +1 -1
  59. package/dist/components/dropdown-menu.js +5 -2
  60. package/dist/components/dropdown-menu.js.map +1 -1
  61. package/dist/components/dso-header.js +1 -1
  62. package/dist/components/dso-header.js.map +1 -1
  63. package/dist/components/dso-modal.js +1 -1
  64. package/dist/components/dso-modal.js.map +1 -1
  65. package/dist/components/dso-table.js +1 -1
  66. package/dist/components/dso-table.js.map +1 -1
  67. package/dist/components/dsot-document-component-demo.js +1694 -45
  68. package/dist/components/dsot-document-component-demo.js.map +1 -1
  69. package/dist/components/index.d.ts +1 -1
  70. package/dist/components/ozon-content.js +500 -50
  71. package/dist/components/ozon-content.js.map +1 -1
  72. package/dist/components/tooltip.js +1 -1
  73. package/dist/components/tooltip.js.map +1 -1
  74. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  75. package/dist/dso-toolkit/dso-toolkit.esm.js.map +1 -1
  76. package/dist/dso-toolkit/p-2401e7f9.entry.js +2 -0
  77. package/dist/dso-toolkit/p-2401e7f9.entry.js.map +1 -0
  78. package/dist/dso-toolkit/p-2ab99812.entry.js +2 -0
  79. package/dist/dso-toolkit/{p-a63c82a4.entry.js.map → p-2ab99812.entry.js.map} +1 -1
  80. package/dist/dso-toolkit/p-432df09a.entry.js +2 -0
  81. package/dist/dso-toolkit/p-432df09a.entry.js.map +1 -0
  82. package/dist/dso-toolkit/p-4573c419.js +2 -0
  83. package/dist/dso-toolkit/p-4573c419.js.map +1 -0
  84. package/dist/dso-toolkit/p-47e77e24.entry.js +2 -0
  85. package/dist/dso-toolkit/p-47e77e24.entry.js.map +1 -0
  86. package/dist/dso-toolkit/p-4e2407bf.entry.js +2 -0
  87. package/dist/dso-toolkit/p-4e2407bf.entry.js.map +1 -0
  88. package/dist/dso-toolkit/{p-dc6e37dd.entry.js → p-51cfeed4.entry.js} +2 -2
  89. package/dist/dso-toolkit/p-51cfeed4.entry.js.map +1 -0
  90. package/dist/dso-toolkit/p-ab1f0511.entry.js +2 -0
  91. package/dist/dso-toolkit/p-ab1f0511.entry.js.map +1 -0
  92. package/dist/dso-toolkit/p-ad44136d.entry.js +2 -0
  93. package/dist/dso-toolkit/p-ad44136d.entry.js.map +1 -0
  94. package/dist/esm/_commonjsHelpers-1c8beb5f.js +5 -0
  95. package/dist/esm/_commonjsHelpers-1c8beb5f.js.map +1 -0
  96. package/dist/esm/dso-alert_5.entry.js +498 -47
  97. package/dist/esm/dso-alert_5.entry.js.map +1 -1
  98. package/dist/esm/dso-annotation-output_3.entry.js +6 -2
  99. package/dist/esm/dso-annotation-output_3.entry.js.map +1 -1
  100. package/dist/esm/dso-dropdown-menu.entry.js +4 -2
  101. package/dist/esm/dso-dropdown-menu.entry.js.map +1 -1
  102. package/dist/esm/dso-header.entry.js +1 -1
  103. package/dist/esm/dso-header.entry.js.map +1 -1
  104. package/dist/esm/dso-modal.entry.js +1 -1
  105. package/dist/esm/dso-modal.entry.js.map +1 -1
  106. package/dist/esm/dso-table.entry.js +1 -1
  107. package/dist/esm/dso-table.entry.js.map +1 -1
  108. package/dist/esm/dso-toolkit.js +1 -1
  109. package/dist/esm/dso-tooltip.entry.js +1 -1
  110. package/dist/esm/dso-tooltip.entry.js.map +1 -1
  111. package/dist/esm/dsot-document-component-demo.entry.js +1689 -42
  112. package/dist/esm/dsot-document-component-demo.entry.js.map +1 -1
  113. package/dist/esm/loader.js +1 -1
  114. package/dist/types/components/document-component/document-component.d.ts +6 -1
  115. package/dist/types/components/document-component/document-component.models.d.ts +14 -0
  116. package/dist/types/components/document-component-demo/document-component.demo.d.ts +64 -0
  117. package/dist/types/components/dropdown-menu/dropdown-menu.d.ts +7 -0
  118. package/dist/types/components/ozon-content/nodes/al.node.d.ts +1 -1
  119. package/dist/types/components/ozon-content/ozon-content-context.interface.d.ts +3 -2
  120. package/dist/types/components/ozon-content/ozon-content-mapper.d.ts +0 -1
  121. package/dist/types/components/ozon-content/ozon-content-node-context.interface.d.ts +3 -2
  122. package/dist/types/components/ozon-content/ozon-content.d.ts +4 -25
  123. package/dist/types/components/ozon-content/ozon-content.interfaces.d.ts +1 -4
  124. package/dist/types/components.d.ts +51 -25
  125. package/package.json +8 -2
  126. package/dist/collection/components/document-component/document-component.demo.js +0 -112
  127. package/dist/collection/components/document-component/document-component.demo.js.map +0 -1
  128. package/dist/collection/components/document-component/document-component.types.js +0 -2
  129. package/dist/collection/components/document-component/document-component.types.js.map +0 -1
  130. package/dist/dso-toolkit/p-41066f6f.entry.js +0 -2
  131. package/dist/dso-toolkit/p-41066f6f.entry.js.map +0 -1
  132. package/dist/dso-toolkit/p-42ba2c81.entry.js +0 -2
  133. package/dist/dso-toolkit/p-42ba2c81.entry.js.map +0 -1
  134. package/dist/dso-toolkit/p-48d76094.entry.js +0 -2
  135. package/dist/dso-toolkit/p-48d76094.entry.js.map +0 -1
  136. package/dist/dso-toolkit/p-5c5e43d3.entry.js +0 -2
  137. package/dist/dso-toolkit/p-5c5e43d3.entry.js.map +0 -1
  138. package/dist/dso-toolkit/p-8af61320.entry.js +0 -2
  139. package/dist/dso-toolkit/p-8af61320.entry.js.map +0 -1
  140. package/dist/dso-toolkit/p-9a3f154b.entry.js +0 -2
  141. package/dist/dso-toolkit/p-9a3f154b.entry.js.map +0 -1
  142. package/dist/dso-toolkit/p-a63c82a4.entry.js +0 -2
  143. package/dist/dso-toolkit/p-dc6e37dd.entry.js.map +0 -1
  144. package/dist/types/components/document-component/document-component.demo.d.ts +0 -40
  145. package/dist/types/components/document-component/document-component.types.d.ts +0 -8
@@ -1 +1 @@
1
- {"version":3,"file":"header.js","sourceRoot":"","sources":["../../../src/components/header/header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEzG,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,QAAQ,MAAM,UAAU,C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,UAAI,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC;gBACtE,SACE,IAAI,EAAE,IAAI,CAAC,WAAW,kBACR,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACtD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC;kBAE3E,gBAAU,IAAI,EAAC,WAAW,GAAY;wCAEpC,CACD,CACN,CACE,CACD,CACP,CACA,CACJ,CACG,CACL,CACJ,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, Fragment, h, Prop, State, Watch } from \"@stencil/core\";\r\n\r\nimport clsx from \"clsx\";\r\nimport debounce from \"debounce\";\r\nimport { isModifiedEvent } from \"../../utils/is-modified-event\";\r\n\r\nimport { HeaderMenuItem, HeaderNavigationType, HeaderEvent } from \"./header.interfaces\";\r\n\r\nconst minDesktopViewportWidth = 992;\r\n\r\n@Component({\r\n tag: \"dso-header\",\r\n styleUrl: \"header.scss\",\r\n scoped: true,\r\n})\r\nexport class Header {\r\n private clickHandler(\r\n e: MouseEvent,\r\n type: HeaderNavigationType,\r\n options?: { menuItem?: HeaderMenuItem; url?: string }\r\n ) {\r\n this.dsoHeaderClick.emit({\r\n originalEvent: e,\r\n isModifiedEvent: isModifiedEvent(e),\r\n type,\r\n menuItem: options?.menuItem,\r\n url: options?.url ?? options?.menuItem?.url,\r\n });\r\n }\r\n\r\n private dropdownElement?: HTMLElement;\r\n\r\n @Element()\r\n host!: HTMLDsoHeaderElement;\r\n\r\n /**\r\n * The main menu items.\r\n */\r\n @Prop()\r\n mainMenu?: HeaderMenuItem[] = [];\r\n\r\n /**\r\n * Either have the dropdown menu appear automatically or always.\r\n */\r\n @Prop()\r\n useDropDownMenu: \"always\" | \"auto\" = \"auto\";\r\n\r\n /**\r\n * Used to show the login/logout option. 'none' renders nothing.\r\n */\r\n @Prop()\r\n authStatus: \"none\" | \"loggedIn\" | \"loggedOut\" = \"none\";\r\n\r\n /**\r\n * When the `authStatus` is `loggedOut` a loginUrl can be provided, the login button will render as an anchor.\r\n */\r\n @Prop()\r\n loginUrl?: string;\r\n\r\n /**\r\n * The URL to open when the user activates \"logout\".\r\n */\r\n @Prop()\r\n logoutUrl?: string;\r\n\r\n /**\r\n * The name to show when the user is logged in.\r\n */\r\n @Prop()\r\n userProfileName?: string;\r\n\r\n /**\r\n * The URL to open when the user activates the profile url.\r\n */\r\n @Prop()\r\n userProfileUrl?: string;\r\n\r\n /**\r\n * The URL to open when the user activates \"Mijn Omgevingsloket\".\r\n */\r\n @Prop()\r\n userHomeUrl?: string;\r\n\r\n /**\r\n * Set this to true when the user is at \"Mijn Omgevingsloket\".\r\n */\r\n @Prop()\r\n userHomeActive?: boolean;\r\n\r\n @State()\r\n showDropDown?: boolean;\r\n\r\n @State()\r\n hasSubLogo = false;\r\n\r\n @State()\r\n overflowMenuItems = 0;\r\n\r\n @State()\r\n dropdownOptionsOffset = 0;\r\n\r\n /**\r\n * Emitted when something in the header is selected.\r\n *\r\n * `event.detail.type` indicates the functionality the user pressed. eg. `'login'` or `'menuItem'`\r\n */\r\n @Event()\r\n dsoHeaderClick!: EventEmitter<HeaderEvent>;\r\n\r\n @Watch(\"useDropDownMenu\")\r\n setShowDropDown(value: \"always\" | \"auto\") {\r\n if (value === \"auto\") {\r\n this.setDropDownMenu();\r\n\r\n return;\r\n }\r\n\r\n this.showDropDown = value === \"always\";\r\n }\r\n\r\n private wrapper: HTMLDivElement | undefined;\r\n\r\n private nav: HTMLUListElement | undefined;\r\n\r\n componentWillLoad() {\r\n this.hasSubLogo = this.host.querySelector(\"*[slot = 'sub-logo']\") !== null;\r\n }\r\n\r\n private shrinkMenuToFit() {\r\n if (!this.wrapper || !this.nav) {\r\n return;\r\n }\r\n\r\n if (this.wrapper.clientWidth >= this.nav.clientWidth) {\r\n return;\r\n }\r\n\r\n if (this.mainMenu && this.overflowMenuItems >= this.mainMenu.length) {\r\n return;\r\n }\r\n\r\n this.overflowMenuItems++;\r\n }\r\n\r\n componentDidRender() {\r\n if (this.showDropDown) {\r\n this.dropdownOptionsOffset = this.calculateDropdownOptionsOffset();\r\n\r\n return;\r\n }\r\n\r\n window.setTimeout(() => this.shrinkMenuToFit(), 0);\r\n }\r\n\r\n componentDidLoad() {\r\n this.setShowDropDown(this.useDropDownMenu);\r\n\r\n if (this.showDropDown) {\r\n this.dropdownOptionsOffset = this.calculateDropdownOptionsOffset();\r\n }\r\n }\r\n\r\n private setOverflowMenu() {\r\n if (this.showDropDown) {\r\n return;\r\n }\r\n\r\n if (this.overflowMenuItems !== 0) {\r\n this.overflowMenuItems = 0;\r\n return;\r\n }\r\n\r\n this.shrinkMenuToFit();\r\n }\r\n\r\n private setDropDownMenu() {\r\n if (this.useDropDownMenu !== \"auto\") {\r\n return;\r\n }\r\n\r\n this.showDropDown = window.innerWidth < minDesktopViewportWidth;\r\n }\r\n\r\n private calculateDropdownOptionsOffset() {\r\n if (!this.dropdownElement) {\r\n return 0;\r\n }\r\n\r\n return (\r\n this.host.clientHeight -\r\n (this.dropdownElement?.getBoundingClientRect().bottom - this.host.getBoundingClientRect().top)\r\n );\r\n }\r\n\r\n private onWindowResize = debounce(() => {\r\n this.dropdownElement?.removeAttribute(\"open\");\r\n this.dropdownElement?.removeAttribute(\"tabindex\");\r\n\r\n this.setDropDownMenu();\r\n this.setOverflowMenu();\r\n\r\n if (this.showDropDown) {\r\n this.dropdownOptionsOffset = this.calculateDropdownOptionsOffset();\r\n }\r\n }, 100);\r\n\r\n connectedCallback() {\r\n window.addEventListener(\"resize\", this.onWindowResize);\r\n }\r\n\r\n disconnectedCallback() {\r\n window.removeEventListener(\"resize\", this.onWindowResize);\r\n }\r\n\r\n private MenuItem = (item: HeaderMenuItem) => {\r\n return (\r\n <li class={item.active ? \"dso-active\" : undefined}>\r\n <a\r\n href={item.url}\r\n aria-current={item.active ? \"page\" : undefined}\r\n onClick={(e) => this.clickHandler(e, \"menuItem\", { menuItem: item })}\r\n >\r\n {item.label}\r\n </a>\r\n </li>\r\n );\r\n };\r\n\r\n render() {\r\n // Prevent 'flickering' when useDropDownMenu = 'always'\r\n if (this.showDropDown === undefined) {\r\n return;\r\n }\r\n\r\n return (\r\n <>\r\n <div\r\n class={clsx(\"dso-header\", {\r\n [\"use-drop-down\"]: this.showDropDown,\r\n [\"has-sub-logo\"]: this.hasSubLogo,\r\n })}\r\n ref={(element) => (this.wrapper = element)}\r\n >\r\n <div class=\"logo-container\">\r\n <div class=\"logo\">\r\n <slot name=\"logo\" />\r\n </div>\r\n <div class=\"sub-logo\">\r\n <slot name=\"sub-logo\" />\r\n </div>\r\n </div>\r\n {this.showDropDown &&\r\n this.mainMenu &&\r\n (this.mainMenu.length > 0 || this.userHomeUrl || this.authStatus !== \"none\") && (\r\n <div class=\"dropdown\">\r\n <dso-dropdown-menu\r\n dropdown-align=\"right\"\r\n strategy=\"absolute\"\r\n dropdownOptionsOffset={this.dropdownOptionsOffset}\r\n ref={(element) => (this.dropdownElement = element)}\r\n >\r\n <button type=\"button\" slot=\"toggle\">\r\n <span>Menu</span>\r\n </button>\r\n <div class=\"dso-dropdown-options\">\r\n <ul>\r\n {this.mainMenu.map(this.MenuItem)}\r\n {this.userHomeUrl && (\r\n <li>\r\n <a\r\n href={this.userHomeUrl}\r\n onClick={(e) => this.clickHandler(e, \"userHome\", { url: this.userHomeUrl })}\r\n >\r\n Mijn Omgevingsloket\r\n </a>\r\n </li>\r\n )}\r\n {this.userProfileUrl && this.userProfileName && this.authStatus === \"loggedIn\" && (\r\n <li>\r\n <a\r\n href={this.userProfileUrl}\r\n onClick={(e) => this.clickHandler(e, \"profile\", { url: this.userProfileUrl })}\r\n >\r\n {this.userProfileName}\r\n <span class=\"profile-label\"> - Mijn profiel</span>\r\n </a>\r\n </li>\r\n )}\r\n {this.authStatus === \"loggedOut\" && (\r\n <li>\r\n {this.loginUrl ? (\r\n <a\r\n href={this.loginUrl}\r\n onClick={(e) => this.clickHandler(e, \"login\", { url: this.loginUrl })}\r\n >\r\n Inloggen\r\n </a>\r\n ) : (\r\n <button type=\"button\" onClick={(e) => this.clickHandler(e, \"login\")}>\r\n Inloggen\r\n </button>\r\n )}\r\n </li>\r\n )}\r\n {this.authStatus === \"loggedIn\" && (\r\n <li>\r\n {this.logoutUrl ? (\r\n <a\r\n href={this.logoutUrl}\r\n onClick={(e) => this.clickHandler(e, \"logout\", { url: this.logoutUrl })}\r\n >\r\n Uitloggen\r\n </a>\r\n ) : (\r\n <button type=\"button\" onClick={(e) => this.clickHandler(e, \"logout\")}>\r\n Uitloggen\r\n </button>\r\n )}\r\n </li>\r\n )}\r\n </ul>\r\n </div>\r\n </dso-dropdown-menu>\r\n </div>\r\n )}\r\n {!this.showDropDown && (\r\n <>\r\n <div class=\"dso-header-session\">\r\n {this.userProfileUrl && this.userProfileName && this.authStatus === \"loggedIn\" && (\r\n <div class=\"profile\">\r\n <span class=\"profile-label\">Welkom:</span>\r\n <a\r\n href={this.userProfileUrl}\r\n onClick={(e) => this.clickHandler(e, \"profile\", { url: this.userProfileUrl })}\r\n >\r\n {this.userProfileName}\r\n </a>\r\n </div>\r\n )}\r\n {this.authStatus === \"loggedOut\" && (\r\n <div class=\"login\">\r\n {this.loginUrl ? (\r\n <a href={this.loginUrl} onClick={(e) => this.clickHandler(e, \"login\", { url: this.loginUrl })}>\r\n Inloggen\r\n </a>\r\n ) : (\r\n <button class=\"dso-tertiary\" type=\"button\" onClick={(e) => this.clickHandler(e, \"login\")}>\r\n Inloggen\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {this.authStatus === \"loggedIn\" && (\r\n <div class=\"logout\">\r\n {this.logoutUrl ? (\r\n <a href={this.logoutUrl} onClick={(e) => this.clickHandler(e, \"logout\", { url: this.logoutUrl })}>\r\n Uitloggen\r\n </a>\r\n ) : (\r\n <button class=\"dso-tertiary\" type=\"button\" onClick={(e) => this.clickHandler(e, \"logout\")}>\r\n Uitloggen\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n {((this.mainMenu && this.mainMenu.length > 0) || this.userHomeUrl) && (\r\n <nav class=\"dso-navbar\">\r\n <ul class=\"dso-nav dso-nav-main\" ref={(element) => (this.nav = element)}>\r\n {this.mainMenu &&\r\n this.mainMenu\r\n .filter((_, index) => this.mainMenu && index < this.mainMenu.length - this.overflowMenuItems)\r\n .map(this.MenuItem)}\r\n {this.overflowMenuItems > 0 && (\r\n <li>\r\n <dso-dropdown-menu dropdown-align=\"left\">\r\n <button type=\"button\" slot=\"toggle\">\r\n <span>Meer</span>\r\n </button>\r\n <div class=\"dso-dropdown-options\">\r\n <ul>\r\n {this.mainMenu &&\r\n this.mainMenu\r\n .filter(\r\n (_, index) =>\r\n this.mainMenu && index >= this.mainMenu.length - this.overflowMenuItems\r\n )\r\n .map(this.MenuItem)}\r\n </ul>\r\n </div>\r\n </dso-dropdown-menu>\r\n </li>\r\n )}\r\n {this.userHomeUrl && (\r\n <li class={clsx(\"menu-user-home\", { \"dso-active\": this.userHomeActive })}>\r\n <a\r\n href={this.userHomeUrl}\r\n aria-current={this.userHomeActive ? \"page\" : undefined}\r\n onClick={(e) => this.clickHandler(e, \"userHome\", { url: this.userHomeUrl })}\r\n >\r\n <dso-icon icon=\"user-line\"></dso-icon>\r\n Mijn Omgevingsloket\r\n </a>\r\n </li>\r\n )}\r\n </ul>\r\n </nav>\r\n )}\r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KAAK,EAAC,sBAAsB;oBAC/B,cACG,IAAI,CAAC,QAAQ;sBACZ,IAAI,CAAC,QAAQ;yBACV,MAAM,CACL,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CACX,IAAI,CAAC,QAAQ,IAAI,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAC1E;yBACA,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CACpB,CACD,CACY,CACjB,CACN;cACA,IAAI,CAAC,WAAW,IAAI,CACnB,UAAI,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC;gBACtE,SACE,IAAI,EAAE,IAAI,CAAC,WAAW,kBACR,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACtD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC;kBAE3E,gBAAU,IAAI,EAAC,WAAW,GAAY;wCAEpC,CACD,CACN,CACE,CACD,CACP,CACA,CACJ,CACG,CACL,CACJ,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, Fragment, h, Prop, State, Watch } from \"@stencil/core\";\r\n\r\nimport clsx from \"clsx\";\r\nimport debounce from \"debounce\";\r\nimport { isModifiedEvent } from \"../../utils/is-modified-event\";\r\n\r\nimport { HeaderMenuItem, HeaderNavigationType, HeaderEvent } from \"./header.interfaces\";\r\n\r\nconst minDesktopViewportWidth = 992;\r\n\r\n@Component({\r\n tag: \"dso-header\",\r\n styleUrl: \"header.scss\",\r\n scoped: true,\r\n})\r\nexport class Header {\r\n private clickHandler(\r\n e: MouseEvent,\r\n type: HeaderNavigationType,\r\n options?: { menuItem?: HeaderMenuItem; url?: string }\r\n ) {\r\n this.dsoHeaderClick.emit({\r\n originalEvent: e,\r\n isModifiedEvent: isModifiedEvent(e),\r\n type,\r\n menuItem: options?.menuItem,\r\n url: options?.url ?? options?.menuItem?.url,\r\n });\r\n }\r\n\r\n private dropdownElement?: HTMLElement;\r\n\r\n @Element()\r\n host!: HTMLDsoHeaderElement;\r\n\r\n /**\r\n * The main menu items.\r\n */\r\n @Prop()\r\n mainMenu?: HeaderMenuItem[] = [];\r\n\r\n /**\r\n * Either have the dropdown menu appear automatically or always.\r\n */\r\n @Prop()\r\n useDropDownMenu: \"always\" | \"auto\" = \"auto\";\r\n\r\n /**\r\n * Used to show the login/logout option. 'none' renders nothing.\r\n */\r\n @Prop()\r\n authStatus: \"none\" | \"loggedIn\" | \"loggedOut\" = \"none\";\r\n\r\n /**\r\n * When the `authStatus` is `loggedOut` a loginUrl can be provided, the login button will render as an anchor.\r\n */\r\n @Prop()\r\n loginUrl?: string;\r\n\r\n /**\r\n * The URL to open when the user activates \"logout\".\r\n */\r\n @Prop()\r\n logoutUrl?: string;\r\n\r\n /**\r\n * The name to show when the user is logged in.\r\n */\r\n @Prop()\r\n userProfileName?: string;\r\n\r\n /**\r\n * The URL to open when the user activates the profile url.\r\n */\r\n @Prop()\r\n userProfileUrl?: string;\r\n\r\n /**\r\n * The URL to open when the user activates \"Mijn Omgevingsloket\".\r\n */\r\n @Prop()\r\n userHomeUrl?: string;\r\n\r\n /**\r\n * Set this to true when the user is at \"Mijn Omgevingsloket\".\r\n */\r\n @Prop()\r\n userHomeActive?: boolean;\r\n\r\n @State()\r\n showDropDown?: boolean;\r\n\r\n @State()\r\n hasSubLogo = false;\r\n\r\n @State()\r\n overflowMenuItems = 0;\r\n\r\n @State()\r\n dropdownOptionsOffset = 0;\r\n\r\n /**\r\n * Emitted when something in the header is selected.\r\n *\r\n * `event.detail.type` indicates the functionality the user pressed. eg. `'login'` or `'menuItem'`\r\n */\r\n @Event()\r\n dsoHeaderClick!: EventEmitter<HeaderEvent>;\r\n\r\n @Watch(\"useDropDownMenu\")\r\n setShowDropDown(value: \"always\" | \"auto\") {\r\n if (value === \"auto\") {\r\n this.setDropDownMenu();\r\n\r\n return;\r\n }\r\n\r\n this.showDropDown = value === \"always\";\r\n }\r\n\r\n private wrapper: HTMLDivElement | undefined;\r\n\r\n private nav: HTMLUListElement | undefined;\r\n\r\n componentWillLoad() {\r\n this.hasSubLogo = this.host.querySelector(\"*[slot = 'sub-logo']\") !== null;\r\n }\r\n\r\n private shrinkMenuToFit() {\r\n if (!this.wrapper || !this.nav) {\r\n return;\r\n }\r\n\r\n if (this.wrapper.clientWidth >= this.nav.clientWidth) {\r\n return;\r\n }\r\n\r\n if (this.mainMenu && this.overflowMenuItems >= this.mainMenu.length) {\r\n return;\r\n }\r\n\r\n this.overflowMenuItems++;\r\n }\r\n\r\n componentDidRender() {\r\n if (this.showDropDown) {\r\n this.dropdownOptionsOffset = this.calculateDropdownOptionsOffset();\r\n\r\n return;\r\n }\r\n\r\n window.setTimeout(() => this.shrinkMenuToFit(), 0);\r\n }\r\n\r\n componentDidLoad() {\r\n this.setShowDropDown(this.useDropDownMenu);\r\n\r\n if (this.showDropDown) {\r\n this.dropdownOptionsOffset = this.calculateDropdownOptionsOffset();\r\n }\r\n }\r\n\r\n private setOverflowMenu() {\r\n if (this.showDropDown) {\r\n return;\r\n }\r\n\r\n if (this.overflowMenuItems !== 0) {\r\n this.overflowMenuItems = 0;\r\n return;\r\n }\r\n\r\n this.shrinkMenuToFit();\r\n }\r\n\r\n private setDropDownMenu() {\r\n if (this.useDropDownMenu !== \"auto\") {\r\n return;\r\n }\r\n\r\n this.showDropDown = window.innerWidth < minDesktopViewportWidth;\r\n }\r\n\r\n private calculateDropdownOptionsOffset() {\r\n if (!this.dropdownElement) {\r\n return 0;\r\n }\r\n\r\n return (\r\n this.host.clientHeight -\r\n (this.dropdownElement?.getBoundingClientRect().bottom - this.host.getBoundingClientRect().top)\r\n );\r\n }\r\n\r\n private onWindowResize = debounce(() => {\r\n this.dropdownElement?.removeAttribute(\"open\");\r\n this.dropdownElement?.removeAttribute(\"tabindex\");\r\n\r\n this.setDropDownMenu();\r\n this.setOverflowMenu();\r\n\r\n if (this.showDropDown) {\r\n this.dropdownOptionsOffset = this.calculateDropdownOptionsOffset();\r\n }\r\n }, 100);\r\n\r\n connectedCallback() {\r\n window.addEventListener(\"resize\", this.onWindowResize);\r\n }\r\n\r\n disconnectedCallback() {\r\n window.removeEventListener(\"resize\", this.onWindowResize);\r\n }\r\n\r\n private MenuItem = (item: HeaderMenuItem) => {\r\n return (\r\n <li class={item.active ? \"dso-active\" : undefined}>\r\n <a\r\n href={item.url}\r\n aria-current={item.active ? \"page\" : undefined}\r\n onClick={(e) => this.clickHandler(e, \"menuItem\", { menuItem: item })}\r\n >\r\n {item.label}\r\n </a>\r\n </li>\r\n );\r\n };\r\n\r\n render() {\r\n // Prevent 'flickering' when useDropDownMenu = 'always'\r\n if (this.showDropDown === undefined) {\r\n return;\r\n }\r\n\r\n return (\r\n <>\r\n <div\r\n class={clsx(\"dso-header\", {\r\n [\"use-drop-down\"]: this.showDropDown,\r\n [\"has-sub-logo\"]: this.hasSubLogo,\r\n })}\r\n ref={(element) => (this.wrapper = element)}\r\n >\r\n <div class=\"logo-container\">\r\n <div class=\"logo\">\r\n <slot name=\"logo\" />\r\n </div>\r\n <div class=\"sub-logo\">\r\n <slot name=\"sub-logo\" />\r\n </div>\r\n </div>\r\n {this.showDropDown &&\r\n this.mainMenu &&\r\n (this.mainMenu.length > 0 || this.userHomeUrl || this.authStatus !== \"none\") && (\r\n <div class=\"dropdown\">\r\n <dso-dropdown-menu\r\n dropdown-align=\"right\"\r\n strategy=\"absolute\"\r\n dropdownOptionsOffset={this.dropdownOptionsOffset}\r\n ref={(element) => (this.dropdownElement = element)}\r\n >\r\n <button type=\"button\" slot=\"toggle\">\r\n <span>Menu</span>\r\n </button>\r\n <div class=\"dso-dropdown-options\">\r\n <ul>\r\n {this.mainMenu.map(this.MenuItem)}\r\n {this.userHomeUrl && (\r\n <li>\r\n <a\r\n href={this.userHomeUrl}\r\n onClick={(e) => this.clickHandler(e, \"userHome\", { url: this.userHomeUrl })}\r\n >\r\n Mijn Omgevingsloket\r\n </a>\r\n </li>\r\n )}\r\n {this.userProfileUrl && this.userProfileName && this.authStatus === \"loggedIn\" && (\r\n <li>\r\n <a\r\n href={this.userProfileUrl}\r\n onClick={(e) => this.clickHandler(e, \"profile\", { url: this.userProfileUrl })}\r\n >\r\n {this.userProfileName}\r\n <span class=\"profile-label\"> - Mijn profiel</span>\r\n </a>\r\n </li>\r\n )}\r\n {this.authStatus === \"loggedOut\" && (\r\n <li>\r\n {this.loginUrl ? (\r\n <a\r\n href={this.loginUrl}\r\n onClick={(e) => this.clickHandler(e, \"login\", { url: this.loginUrl })}\r\n >\r\n Inloggen\r\n </a>\r\n ) : (\r\n <button type=\"button\" onClick={(e) => this.clickHandler(e, \"login\")}>\r\n Inloggen\r\n </button>\r\n )}\r\n </li>\r\n )}\r\n {this.authStatus === \"loggedIn\" && (\r\n <li>\r\n {this.logoutUrl ? (\r\n <a\r\n href={this.logoutUrl}\r\n onClick={(e) => this.clickHandler(e, \"logout\", { url: this.logoutUrl })}\r\n >\r\n Uitloggen\r\n </a>\r\n ) : (\r\n <button type=\"button\" onClick={(e) => this.clickHandler(e, \"logout\")}>\r\n Uitloggen\r\n </button>\r\n )}\r\n </li>\r\n )}\r\n </ul>\r\n </div>\r\n </dso-dropdown-menu>\r\n </div>\r\n )}\r\n {!this.showDropDown && (\r\n <>\r\n <div class=\"dso-header-session\">\r\n {this.userProfileUrl && this.userProfileName && this.authStatus === \"loggedIn\" && (\r\n <div class=\"profile\">\r\n <span class=\"profile-label\">Welkom:</span>\r\n <a\r\n href={this.userProfileUrl}\r\n onClick={(e) => this.clickHandler(e, \"profile\", { url: this.userProfileUrl })}\r\n >\r\n {this.userProfileName}\r\n </a>\r\n </div>\r\n )}\r\n {this.authStatus === \"loggedOut\" && (\r\n <div class=\"login\">\r\n {this.loginUrl ? (\r\n <a href={this.loginUrl} onClick={(e) => this.clickHandler(e, \"login\", { url: this.loginUrl })}>\r\n Inloggen\r\n </a>\r\n ) : (\r\n <button class=\"dso-tertiary\" type=\"button\" onClick={(e) => this.clickHandler(e, \"login\")}>\r\n Inloggen\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {this.authStatus === \"loggedIn\" && (\r\n <div class=\"logout\">\r\n {this.logoutUrl ? (\r\n <a href={this.logoutUrl} onClick={(e) => this.clickHandler(e, \"logout\", { url: this.logoutUrl })}>\r\n Uitloggen\r\n </a>\r\n ) : (\r\n <button class=\"dso-tertiary\" type=\"button\" onClick={(e) => this.clickHandler(e, \"logout\")}>\r\n Uitloggen\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n {((this.mainMenu && this.mainMenu.length > 0) || this.userHomeUrl) && (\r\n <nav class=\"dso-navbar\">\r\n <ul class=\"dso-nav dso-nav-main\" ref={(element) => (this.nav = element)}>\r\n {this.mainMenu &&\r\n this.mainMenu\r\n .filter((_, index) => this.mainMenu && index < this.mainMenu.length - this.overflowMenuItems)\r\n .map(this.MenuItem)}\r\n {this.overflowMenuItems > 0 && (\r\n <li>\r\n <dso-dropdown-menu placement=\"bottom\">\r\n <button type=\"button\" slot=\"toggle\">\r\n <span>Meer</span>\r\n </button>\r\n <div class=\"dso-dropdown-options\">\r\n <ul>\r\n {this.mainMenu &&\r\n this.mainMenu\r\n .filter(\r\n (_, index) =>\r\n this.mainMenu && index >= this.mainMenu.length - this.overflowMenuItems\r\n )\r\n .map(this.MenuItem)}\r\n </ul>\r\n </div>\r\n </dso-dropdown-menu>\r\n </li>\r\n )}\r\n {this.userHomeUrl && (\r\n <li class={clsx(\"menu-user-home\", { \"dso-active\": this.userHomeActive })}>\r\n <a\r\n href={this.userHomeUrl}\r\n aria-current={this.userHomeActive ? \"page\" : undefined}\r\n onClick={(e) => this.clickHandler(e, \"userHome\", { url: this.userHomeUrl })}\r\n >\r\n <dso-icon icon=\"user-line\"></dso-icon>\r\n Mijn Omgevingsloket\r\n </a>\r\n </li>\r\n )}\r\n </ul>\r\n </nav>\r\n )}\r\n </>\r\n )}\r\n </div>\r\n </>\r\n );\r\n }\r\n}\r\n"]}
@@ -23,7 +23,7 @@
23
23
  :host([fullscreen]) dialog .dso-dialog {
24
24
  display: flex;
25
25
  flex-direction: column;
26
- max-inline-size: 100%;
26
+ inline-size: 100%;
27
27
  block-size: 100%;
28
28
  }
29
29
  :host([fullscreen]) dialog .dso-dialog > dso-scrollable {
@@ -42,7 +42,7 @@
42
42
  :host dialog .dso-dialog {
43
43
  display: flex;
44
44
  flex-direction: column;
45
- max-inline-size: 100%;
45
+ inline-size: 100%;
46
46
  block-size: 100%;
47
47
  }
48
48
  :host dialog .dso-dialog > dso-scrollable {
@@ -93,7 +93,7 @@ button::-moz-focus-inner {
93
93
  background-color: rgba(255, 255, 255, 0.8);
94
94
  }
95
95
  .dso-modal .dso-dialog {
96
- max-inline-size: 640px;
96
+ inline-size: 640px;
97
97
  background-color: #fff;
98
98
  opacity: 1;
99
99
  box-shadow: 0 8px 24px 0 rgba(25, 25, 25, 0.4);
@@ -1,16 +1,33 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { getNodeName } from "../get-node-name.function";
3
+ import clsx from "clsx";
4
+ function isNestedAl(path) {
5
+ return path.some((n) => {
6
+ const nodeName = getNodeName(n);
7
+ return nodeName === "Al" || nodeName === "Opschrift";
8
+ });
9
+ }
3
10
  export class OzonContentAlNode {
4
11
  constructor() {
5
12
  this.name = "Al";
6
13
  }
7
- render(node, { mapNodeToJsx, path }) {
8
- const nestedAl = path.some((n) => {
9
- const nodeName = getNodeName(n);
10
- return nodeName === "Al" || nodeName === "Opschrift";
11
- });
12
- const content = mapNodeToJsx(node.childNodes);
13
- return nestedAl ? h("span", { role: "paragraph" }, content) : h("p", null, content);
14
+ render(node, { mapNodeToJsx, path, inline }) {
15
+ let content = mapNodeToJsx(node.childNodes);
16
+ const wijzigactie = node.getAttribute("wijzigactie");
17
+ const className = clsx({ [`wijzigactie-${wijzigactie}`]: !!wijzigactie }) || undefined;
18
+ if (inline || isNestedAl(path)) {
19
+ content = (h("span", { role: "paragraph", class: className }, content));
20
+ }
21
+ else {
22
+ content = h("p", { class: className }, content);
23
+ }
24
+ if (wijzigactie === "voegtoe") {
25
+ content = h("ins", null, content);
26
+ }
27
+ else if (wijzigactie === "verwijder") {
28
+ content = h("del", null, content);
29
+ }
30
+ return content;
14
31
  }
15
32
  }
16
33
  //# sourceMappingURL=al.node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"al.node.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/nodes/al.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAIxD,MAAM,OAAO,iBAAiB;EAA9B;IACE,SAAI,GAAG,IAAI,CAAC;EAad,CAAC;EAXC,MAAM,CAAC,IAAa,EAAE,EAAE,YAAY,EAAE,IAAI,EAA0B;IAClE,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;MAC/B,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;MAEhC,OAAO,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,WAAW,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAE9C,OAAO,QAAQ,CAAC,CAAC,CAAC,YAAM,IAAI,EAAC,WAAW,IAAE,OAAO,CAAQ,CAAC,CAAC,CAAC,aAAI,OAAO,CAAK,CAAC;EAC/E,CAAC;CACF","sourcesContent":["import { h } from \"@stencil/core\";\r\n\r\nimport { getNodeName } from \"../get-node-name.function\";\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\n\r\nexport class OzonContentAlNode implements OzonContentNode {\r\n name = \"Al\";\r\n\r\n render(node: Element, { mapNodeToJsx, path }: OzonContentNodeContext) {\r\n const nestedAl = path.some((n) => {\r\n const nodeName = getNodeName(n);\r\n\r\n return nodeName === \"Al\" || nodeName === \"Opschrift\";\r\n });\r\n\r\n const content = mapNodeToJsx(node.childNodes);\r\n\r\n return nestedAl ? <span role=\"paragraph\">{content}</span> : <p>{content}</p>;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"al.node.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/nodes/al.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,SAAS,UAAU,CAAC,IAAY;EAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;IACrB,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IAEhC,OAAO,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,WAAW,CAAC;EACvD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,OAAO,iBAAiB;EAA9B;IACE,SAAI,GAAG,IAAI,CAAC;EA0Bd,CAAC;EAxBC,MAAM,CAAC,IAAa,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAA0B;IAC1E,IAAI,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IAErD,MAAM,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC,eAAe,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,IAAI,SAAS,CAAC;IAEvF,IAAI,MAAM,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE;MAC9B,OAAO,GAAG,CACR,YAAM,IAAI,EAAC,WAAW,EAAC,KAAK,EAAE,SAAS,IACpC,OAAO,CACH,CACR,CAAC;KACH;SAAM;MACL,OAAO,GAAG,SAAG,KAAK,EAAE,SAAS,IAAG,OAAO,CAAK,CAAC;KAC9C;IAED,IAAI,WAAW,KAAK,SAAS,EAAE;MAC7B,OAAO,GAAG,eAAM,OAAO,CAAO,CAAC;KAChC;SAAM,IAAI,WAAW,KAAK,WAAW,EAAE;MACtC,OAAO,GAAG,eAAM,OAAO,CAAO,CAAC;KAChC;IAED,OAAO,OAAO,CAAC;EACjB,CAAC;CACF","sourcesContent":["import { h } from \"@stencil/core\";\r\n\r\nimport { getNodeName } from \"../get-node-name.function\";\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\nimport clsx from \"clsx\";\r\n\r\nfunction isNestedAl(path: Node[]) {\r\n return path.some((n) => {\r\n const nodeName = getNodeName(n);\r\n\r\n return nodeName === \"Al\" || nodeName === \"Opschrift\";\r\n });\r\n}\r\n\r\nexport class OzonContentAlNode implements OzonContentNode {\r\n name = \"Al\";\r\n\r\n render(node: Element, { mapNodeToJsx, path, inline }: OzonContentNodeContext) {\r\n let content = mapNodeToJsx(node.childNodes);\r\n const wijzigactie = node.getAttribute(\"wijzigactie\");\r\n\r\n const className = clsx({ [`wijzigactie-${wijzigactie}`]: !!wijzigactie }) || undefined;\r\n\r\n if (inline || isNestedAl(path)) {\r\n content = (\r\n <span role=\"paragraph\" class={className}>\r\n {content}\r\n </span>\r\n );\r\n } else {\r\n content = <p class={className}>{content}</p>;\r\n }\r\n\r\n if (wijzigactie === \"voegtoe\") {\r\n content = <ins>{content}</ins>;\r\n } else if (wijzigactie === \"verwijder\") {\r\n content = <del>{content}</del>;\r\n }\r\n\r\n return content;\r\n }\r\n}\r\n"]}
@@ -1,11 +1,13 @@
1
1
  import { h } from "@stencil/core";
2
+ import kebabCase from "lodash.kebabcase";
2
3
  export class OzonContentExtRefNode {
3
4
  constructor() {
4
5
  this.name = ["ExtRef", "ExtIoRef"];
5
6
  }
6
7
  render(node, { mapNodeToJsx }) {
7
8
  const href = node.tagName === "ExtIoRef" ? node.getAttribute("href") : node.getAttribute("ref");
8
- return (h("a", { target: "_blank", rel: "noopener noreferrer", href: href !== null && href !== void 0 ? href : undefined }, h("span", { class: "sr-only" }, "opent in nieuw venster "), mapNodeToJsx(node.childNodes)));
9
+ const className = kebabCase(node.tagName);
10
+ return (h("a", { target: "_blank", rel: "noopener noreferrer", href: href !== null && href !== void 0 ? href : undefined, class: className }, h("span", { class: "sr-only" }, "opent in nieuw venster "), mapNodeToJsx(node.childNodes), h("dso-icon", { icon: "external-link" })));
9
11
  }
10
12
  }
11
13
  //# sourceMappingURL=ext-ref.node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ext-ref.node.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/nodes/ext-ref.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKlC,MAAM,OAAO,qBAAqB;EAAlC;IACE,SAAI,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;EAYhC,CAAC;EAVC,MAAM,CAAC,IAAa,EAAE,EAAE,YAAY,EAA0B;IAC5D,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAEhG,OAAO,CACL,SAAG,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,EAAC,IAAI,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,SAAS;MAClE,YAAM,KAAK,EAAC,SAAS,8BAA+B;MACnD,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAC5B,CACL,CAAC;EACJ,CAAC;CACF","sourcesContent":["import { h } from \"@stencil/core\";\r\n\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\n\r\nexport class OzonContentExtRefNode implements OzonContentNode {\r\n name = [\"ExtRef\", \"ExtIoRef\"];\r\n\r\n render(node: Element, { mapNodeToJsx }: OzonContentNodeContext) {\r\n const href = node.tagName === \"ExtIoRef\" ? node.getAttribute(\"href\") : node.getAttribute(\"ref\");\r\n\r\n return (\r\n <a target=\"_blank\" rel=\"noopener noreferrer\" href={href ?? undefined}>\r\n <span class=\"sr-only\">opent in nieuw venster </span>\r\n {mapNodeToJsx(node.childNodes)}\r\n </a>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ext-ref.node.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/nodes/ext-ref.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAKzC,MAAM,OAAO,qBAAqB;EAAlC;IACE,SAAI,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;EAchC,CAAC;EAZC,MAAM,CAAC,IAAa,EAAE,EAAE,YAAY,EAA0B;IAC5D,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAChG,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAE1C,OAAO,CACL,SAAG,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,qBAAqB,EAAC,IAAI,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,SAAS,EAAE,KAAK,EAAE,SAAS;MACpF,YAAM,KAAK,EAAC,SAAS,8BAA+B;MACnD,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;MAC9B,gBAAU,IAAI,EAAC,eAAe,GAAY,CACxC,CACL,CAAC;EACJ,CAAC;CACF","sourcesContent":["import { h } from \"@stencil/core\";\r\nimport kebabCase from \"lodash.kebabcase\";\r\n\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\n\r\nexport class OzonContentExtRefNode implements OzonContentNode {\r\n name = [\"ExtRef\", \"ExtIoRef\"];\r\n\r\n render(node: Element, { mapNodeToJsx }: OzonContentNodeContext) {\r\n const href = node.tagName === \"ExtIoRef\" ? node.getAttribute(\"href\") : node.getAttribute(\"ref\");\r\n const className = kebabCase(node.tagName);\r\n\r\n return (\r\n <a target=\"_blank\" rel=\"noopener noreferrer\" href={href ?? undefined} class={className}>\r\n <span class=\"sr-only\">opent in nieuw venster </span>\r\n {mapNodeToJsx(node.childNodes)}\r\n <dso-icon icon=\"external-link\"></dso-icon>\r\n </a>\r\n );\r\n }\r\n}\r\n"]}
@@ -4,7 +4,7 @@ export class OzonContentNieuweTekstNode {
4
4
  this.name = "NieuweTekst";
5
5
  }
6
6
  render(node, { mapNodeToJsx }) {
7
- return h("ins", null, mapNodeToJsx(node.childNodes));
7
+ return h("ins", { class: "nieuwe-tekst" }, mapNodeToJsx(node.childNodes));
8
8
  }
9
9
  }
10
10
  //# sourceMappingURL=nieuwe-tekst.node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nieuwe-tekst.node.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/nodes/nieuwe-tekst.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKlC,MAAM,OAAO,0BAA0B;EAAvC;IACE,SAAI,GAAG,aAAa,CAAC;EAKvB,CAAC;EAHC,MAAM,CAAC,IAAa,EAAE,EAAE,YAAY,EAA0B;IAC5D,OAAO,eAAM,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAO,CAAC;EACpD,CAAC;CACF","sourcesContent":["import { h } from \"@stencil/core\";\r\n\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\n\r\nexport class OzonContentNieuweTekstNode implements OzonContentNode {\r\n name = \"NieuweTekst\";\r\n\r\n render(node: Element, { mapNodeToJsx }: OzonContentNodeContext) {\r\n return <ins>{mapNodeToJsx(node.childNodes)}</ins>;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"nieuwe-tekst.node.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/nodes/nieuwe-tekst.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKlC,MAAM,OAAO,0BAA0B;EAAvC;IACE,SAAI,GAAG,aAAa,CAAC;EAKvB,CAAC;EAHC,MAAM,CAAC,IAAa,EAAE,EAAE,YAAY,EAA0B;IAC5D,OAAO,WAAK,KAAK,EAAC,cAAc,IAAE,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAO,CAAC;EACzE,CAAC;CACF","sourcesContent":["import { h } from \"@stencil/core\";\r\n\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\n\r\nexport class OzonContentNieuweTekstNode implements OzonContentNode {\r\n name = \"NieuweTekst\";\r\n\r\n render(node: Element, { mapNodeToJsx }: OzonContentNodeContext) {\r\n return <ins class=\"nieuwe-tekst\">{mapNodeToJsx(node.childNodes)}</ins>;\r\n }\r\n}\r\n"]}
@@ -4,7 +4,15 @@ export class OzonContentOpschriftNode {
4
4
  this.name = "Opschrift";
5
5
  }
6
6
  render(node, { mapNodeToJsx }) {
7
- return h(Fragment, null, mapNodeToJsx(node.childNodes));
7
+ let content = mapNodeToJsx(node.childNodes);
8
+ const wijzigactie = node.getAttribute("wijzigactie");
9
+ if (wijzigactie === "voegtoe") {
10
+ content = h("ins", { class: "nieuwe-tekst" }, content);
11
+ }
12
+ else if (wijzigactie === "verwijder") {
13
+ content = h("del", { class: "verwijderde-tekst" }, content);
14
+ }
15
+ return h(Fragment, null, content);
8
16
  }
9
17
  }
10
18
  //# sourceMappingURL=opschrift.node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"opschrift.node.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/nodes/opschrift.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAK5C,MAAM,OAAO,wBAAwB;EAArC;IACE,SAAI,GAAG,WAAW,CAAC;EAKrB,CAAC;EAHC,MAAM,CAAC,IAAa,EAAE,EAAE,YAAY,EAA0B;IAC5D,OAAO,EAAC,QAAQ,QAAE,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAY,CAAC;EAC9D,CAAC;CACF","sourcesContent":["import { h, Fragment } from \"@stencil/core\";\r\n\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\n\r\nexport class OzonContentOpschriftNode implements OzonContentNode {\r\n name = \"Opschrift\";\r\n\r\n render(node: Element, { mapNodeToJsx }: OzonContentNodeContext) {\r\n return <Fragment>{mapNodeToJsx(node.childNodes)}</Fragment>;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"opschrift.node.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/nodes/opschrift.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAK5C,MAAM,OAAO,wBAAwB;EAArC;IACE,SAAI,GAAG,WAAW,CAAC;EAcrB,CAAC;EAZC,MAAM,CAAC,IAAa,EAAE,EAAE,YAAY,EAA0B;IAC5D,IAAI,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IAErD,IAAI,WAAW,KAAK,SAAS,EAAE;MAC7B,OAAO,GAAG,WAAK,KAAK,EAAC,cAAc,IAAE,OAAO,CAAO,CAAC;KACrD;SAAM,IAAI,WAAW,KAAK,WAAW,EAAE;MACtC,OAAO,GAAG,WAAK,KAAK,EAAC,mBAAmB,IAAE,OAAO,CAAO,CAAC;KAC1D;IAED,OAAO,kBAAG,OAAO,CAAI,CAAC;EACxB,CAAC;CACF","sourcesContent":["import { h, Fragment } from \"@stencil/core\";\r\n\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\n\r\nexport class OzonContentOpschriftNode implements OzonContentNode {\r\n name = \"Opschrift\";\r\n\r\n render(node: Element, { mapNodeToJsx }: OzonContentNodeContext) {\r\n let content = mapNodeToJsx(node.childNodes);\r\n const wijzigactie = node.getAttribute(\"wijzigactie\");\r\n\r\n if (wijzigactie === \"voegtoe\") {\r\n content = <ins class=\"nieuwe-tekst\">{content}</ins>;\r\n } else if (wijzigactie === \"verwijder\") {\r\n content = <del class=\"verwijderde-tekst\">{content}</del>;\r\n }\r\n\r\n return <>{content}</>;\r\n }\r\n}\r\n"]}
@@ -28,8 +28,7 @@ export class OzonContentTableNode {
28
28
  const { caption, colspecs, headRows, bodyRows, editAction } = mapData(node);
29
29
  const bron = Array.from(node.childNodes).find((n) => getNodeName(n) === "Bron");
30
30
  return (h("dso-table", null, h("table", Object.assign({ class: clsx("table dso-table-vertical-lines", {
31
- "dso-del": editAction === "verwijder",
32
- "dso-ins": editAction === "voegtoe",
31
+ [`wijzigactie-${editAction}`]: editAction,
33
32
  }) }, (bron ? { "aria-describedby": this.id } : {})), caption && h("caption", null, caption), colspecs && h(Colgroup, { colspecs: colspecs }), headRows.length > 0 && (h("thead", null, h(Rows, { rows: headRows, colspecs: colspecs, context: context }))), bodyRows.length > 0 && (h("tbody", null, h(Rows, { rows: bodyRows, colspecs: colspecs, context: context })))), bron && h("div", { id: this.id }, context.mapNodeToJsx(bron))));
34
33
  }
35
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"table.node.js","sourceRoot":"","sources":["../../../../../src/components/ozon-content/nodes/table.node/table.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAI3D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,SAAS,OAAO,CAAC,IAAa;;EAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;EACrD,MAAM,YAAY,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,CAAC,MAAM,CAAC,mCAAI,SAAS,CAAC;EAC/D,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;EAE1E,OAAO;IACL,OAAO,EAAE,MAAA,MAAA,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,0CAAE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AAC,EAAE,CAAC;QAEhD,OAAO,IAAI,mBAAU,OAAO,CAAW;QACvC,QAAQ,IAAI,EAAC,QAAQ,IAAC,QAAQ,EAAE,QAAQ,GAAI;QAC5C,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CACtB;UACE,EAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAS,CAC7D,CACT;QACA,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CACtB;UACE,EAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAS,CAC7D,CACT,CACK;MACP,IAAI,IAAI,WAAK,EAAE,EAAE,IAAI,CAAC,EAAE,IAAG,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAO,CACnD,CACb,CAAC;EACJ,CAAC;CACF","sourcesContent":["import { h } from \"@stencil/core\";\r\nimport clsx from \"clsx\";\r\nimport { v4 as uuidv4 } from \"uuid\";\r\n\r\nimport { getNodeName } from \"../../get-node-name.function\";\r\nimport { OzonContentNodeContext } from \"../../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../../ozon-content-node.interface\";\r\n\r\nimport { mapColspecs } from \"./colspec/colspec-mapper\";\r\nimport { Colgroup } from \"./table-colgroup\";\r\nimport { Rows } from \"./table-rows\";\r\n\r\nfunction mapData(node: Element) {\r\n const tgroup = node.querySelector(\":scope > tgroup\");\r\n const colAttribute = tgroup?.getAttribute(\"cols\") ?? undefined;\r\n const columnCount = colAttribute ? parseInt(colAttribute, 10) : undefined;\r\n\r\n return {\r\n caption: node.querySelector(\":scope > title\")?.textContent ?? undefined,\r\n colspecs: tgroup && columnCount ? mapColspecs(columnCount, tgroup.querySelectorAll(\":scope > colspec\")) : undefined,\r\n headRows: Array.from(node.querySelectorAll(\":scope > tgroup > thead > row\")),\r\n bodyRows: Array.from(node.querySelectorAll(\":scope > tgroup > tbody > row\")),\r\n editAction: node.getAttribute(\"wijzigactie\"),\r\n };\r\n}\r\n\r\nexport class OzonContentTableNode implements OzonContentNode {\r\n name = \"table\";\r\n\r\n handles = [\"title\", \"tgroup\", \"colspec\", \"thead\", \"tbody\", \"row\", \"cell\"];\r\n\r\n id = uuidv4();\r\n\r\n render(node: Element, context: OzonContentNodeContext) {\r\n const { caption, colspecs, headRows, bodyRows, editAction } = mapData(node);\r\n\r\n const bron = Array.from(node.childNodes).find((n) => getNodeName(n) === \"Bron\");\r\n\r\n return (\r\n <dso-table>\r\n <table\r\n class={clsx(\"table dso-table-vertical-lines\", {\r\n \"dso-del\": editAction === \"verwijder\",\r\n \"dso-ins\": editAction === \"voegtoe\",\r\n })}\r\n {...(bron ? { \"aria-describedby\": this.id } : {})}\r\n >\r\n {caption && <caption>{caption}</caption>}\r\n {colspecs && <Colgroup colspecs={colspecs} />}\r\n {headRows.length > 0 && (\r\n <thead>\r\n <Rows rows={headRows} colspecs={colspecs} context={context}></Rows>\r\n </thead>\r\n )}\r\n {bodyRows.length > 0 && (\r\n <tbody>\r\n <Rows rows={bodyRows} colspecs={colspecs} context={context}></Rows>\r\n </tbody>\r\n )}\r\n </table>\r\n {bron && <div id={this.id}>{context.mapNodeToJsx(bron)}</div>}\r\n </dso-table>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"table.node.js","sourceRoot":"","sources":["../../../../../src/components/ozon-content/nodes/table.node/table.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAI3D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5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AU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5E,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC;IAEhF,OAAO,CACL;MACE,2BACE,KAAK,EAAE,IAAI,CAAC,gCAAgC,EAAE;UAC5C,CAAC,eAAe,UAAU,EAAE,CAAC,EAAE,UAAU;SAC1C,CAAC,IACE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAEhD,OAAO,IAAI,mBAAU,OAAO,CAAW;QACvC,QAAQ,IAAI,EAAC,QAAQ,IAAC,QAAQ,EAAE,QAAQ,GAAI;QAC5C,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CACtB;UACE,EAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAS,CAC7D,CACT;QACA,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CACtB;UACE,EAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAS,CAC7D,CACT,CACK;MACP,IAAI,IAAI,WAAK,EAAE,EAAE,IAAI,CAAC,EAAE,IAAG,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAO,CACnD,CACb,CAAC;EACJ,CAAC;CACF","sourcesContent":["import { h } from \"@stencil/core\";\r\nimport clsx from \"clsx\";\r\nimport { v4 as uuidv4 } from \"uuid\";\r\n\r\nimport { getNodeName } from \"../../get-node-name.function\";\r\nimport { OzonContentNodeContext } from \"../../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../../ozon-content-node.interface\";\r\n\r\nimport { mapColspecs } from \"./colspec/colspec-mapper\";\r\nimport { Colgroup } from \"./table-colgroup\";\r\nimport { Rows } from \"./table-rows\";\r\n\r\nfunction mapData(node: Element) {\r\n const tgroup = node.querySelector(\":scope > tgroup\");\r\n const colAttribute = tgroup?.getAttribute(\"cols\") ?? undefined;\r\n const columnCount = colAttribute ? parseInt(colAttribute, 10) : undefined;\r\n\r\n return {\r\n caption: node.querySelector(\":scope > title\")?.textContent ?? undefined,\r\n colspecs: tgroup && columnCount ? mapColspecs(columnCount, tgroup.querySelectorAll(\":scope > colspec\")) : undefined,\r\n headRows: Array.from(node.querySelectorAll(\":scope > tgroup > thead > row\")),\r\n bodyRows: Array.from(node.querySelectorAll(\":scope > tgroup > tbody > row\")),\r\n editAction: node.getAttribute(\"wijzigactie\"),\r\n };\r\n}\r\n\r\nexport class OzonContentTableNode implements OzonContentNode {\r\n name = \"table\";\r\n\r\n handles = [\"title\", \"tgroup\", \"colspec\", \"thead\", \"tbody\", \"row\", \"cell\"];\r\n\r\n id = uuidv4();\r\n\r\n render(node: Element, context: OzonContentNodeContext) {\r\n const { caption, colspecs, headRows, bodyRows, editAction } = mapData(node);\r\n\r\n const bron = Array.from(node.childNodes).find((n) => getNodeName(n) === \"Bron\");\r\n\r\n return (\r\n <dso-table>\r\n <table\r\n class={clsx(\"table dso-table-vertical-lines\", {\r\n [`wijzigactie-${editAction}`]: editAction,\r\n })}\r\n {...(bron ? { \"aria-describedby\": this.id } : {})}\r\n >\r\n {caption && <caption>{caption}</caption>}\r\n {colspecs && <Colgroup colspecs={colspecs} />}\r\n {headRows.length > 0 && (\r\n <thead>\r\n <Rows rows={headRows} colspecs={colspecs} context={context}></Rows>\r\n </thead>\r\n )}\r\n {bodyRows.length > 0 && (\r\n <tbody>\r\n <Rows rows={bodyRows} colspecs={colspecs} context={context}></Rows>\r\n </tbody>\r\n )}\r\n </table>\r\n {bron && <div id={this.id}>{context.mapNodeToJsx(bron)}</div>}\r\n </dso-table>\r\n );\r\n }\r\n}\r\n"]}
@@ -4,7 +4,7 @@ export class OzonContentVerwijderdeTekstNode {
4
4
  this.name = "VerwijderdeTekst";
5
5
  }
6
6
  render(node, { mapNodeToJsx }) {
7
- return h("del", null, mapNodeToJsx(node.childNodes));
7
+ return h("del", { class: "verwijderde-tekst" }, mapNodeToJsx(node.childNodes));
8
8
  }
9
9
  }
10
10
  //# sourceMappingURL=verwijderde-tekst.node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"verwijderde-tekst.node.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/nodes/verwijderde-tekst.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKlC,MAAM,OAAO,+BAA+B;EAA5C;IACE,SAAI,GAAG,kBAAkB,CAAC;EAK5B,CAAC;EAHC,MAAM,CAAC,IAAa,EAAE,EAAE,YAAY,EAA0B;IAC5D,OAAO,eAAM,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAO,CAAC;EACpD,CAAC;CACF","sourcesContent":["import { h } from \"@stencil/core\";\r\n\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\n\r\nexport class OzonContentVerwijderdeTekstNode implements OzonContentNode {\r\n name = \"VerwijderdeTekst\";\r\n\r\n render(node: Element, { mapNodeToJsx }: OzonContentNodeContext) {\r\n return <del>{mapNodeToJsx(node.childNodes)}</del>;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"verwijderde-tekst.node.js","sourceRoot":"","sources":["../../../../src/components/ozon-content/nodes/verwijderde-tekst.node.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAKlC,MAAM,OAAO,+BAA+B;EAA5C;IACE,SAAI,GAAG,kBAAkB,CAAC;EAK5B,CAAC;EAHC,MAAM,CAAC,IAAa,EAAE,EAAE,YAAY,EAA0B;IAC5D,OAAO,WAAK,KAAK,EAAC,mBAAmB,IAAE,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAO,CAAC;EAC9E,CAAC;CACF","sourcesContent":["import { h } from \"@stencil/core\";\r\n\r\nimport { OzonContentNodeContext } from \"../ozon-content-node-context.interface\";\r\nimport { OzonContentNode } from \"../ozon-content-node.interface\";\r\n\r\nexport class OzonContentVerwijderdeTekstNode implements OzonContentNode {\r\n name = \"VerwijderdeTekst\";\r\n\r\n render(node: Element, { mapNodeToJsx }: OzonContentNodeContext) {\r\n return <del class=\"verwijderde-tekst\">{mapNodeToJsx(node.childNodes)}</del>;\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\nimport { OzonContentNodeState } from \"./ozon-content-node-state.interface\";\r\n\r\nimport { OzonContentAnchorClick } from \"./ozon-content.interfaces\";\r\n\r\nexport interface OzonContentContext {\r\n state: OzonContentNodeState;\r\n setState(state: OzonContentNodeState): void;\r\n emitAnchorClick: EventEmitter<OzonContentAnchorClick>[\"emit\"];\r\n}\r\n"]}
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\nimport { OzonContentNodeState } from \"./ozon-content-node-state.interface\";\r\n\r\nimport { OzonContentAnchorClickEvent } from \"./ozon-content.interfaces\";\r\n\r\nexport interface OzonContentContext {\r\n state: OzonContentNodeState;\r\n inline: boolean;\r\n setState(state: OzonContentNodeState): void;\r\n emitAnchorClick: EventEmitter<OzonContentAnchorClickEvent>[\"emit\"];\r\n}\r\n"]}
@@ -77,6 +77,7 @@ export class Mapper {
77
77
  const state = identity ? context.state[identity] : undefined;
78
78
  const setState = identity ? (s) => context.setState(Object.assign(Object.assign({}, context.state), { [identity]: s })) : undefined;
79
79
  return mapper.render(node, {
80
+ inline: context.inline,
80
81
  mapNodeToJsx: (n) => this.mapNodeToJsx(n, context, [...path, node]),
81
82
  emitAnchorClick: context.emitAnchorClick,
82
83
  setState,
@@ -88,16 +89,17 @@ export class Mapper {
88
89
  if (!xml) {
89
90
  return h(Fragment, null);
90
91
  }
91
- if (!this.cache || this.cache.xml !== xml) {
92
- const document = this.domParser.parseFromString(xml, "text/xml");
93
- if (document.querySelector("html > body > parsererror")) {
94
- console.error(document);
95
- return h(Fragment, null);
96
- }
97
- this.cache = { xml, document };
92
+ const document = this.domParser.parseFromString(xml, "text/xml");
93
+ if (document.querySelector("parsererror")) {
94
+ console.error({
95
+ message: "[DSO Toolkit: Ozon Content Mapper] Unable to parse XML",
96
+ context,
97
+ xml,
98
+ document,
99
+ });
100
+ return h(Fragment, null);
98
101
  }
99
- const xmlDocument = this.cache.document;
100
- return this.mapNodeToJsx(xmlDocument.getRootNode(), context, []);
102
+ return this.mapNodeToJsx(document.getRootNode(), context, []);
101
103
  }
102
104
  }
103
105
  //# sourceMappingURL=ozon-content-mapper.js.map
@@ -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,EAAE,CAAC,EAAO,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,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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C,aAAa,CAAC,2BAA2B,CAAC,EAAE;QACvD,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAExB,OAAO,EAAC,QAAQ,OAAG,CAAC;OACrB;MAED,IAAI,CAAC,KAAK,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;KAChC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAExC,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;EACnE,CAAC;CACF","sourcesContent":["import { Fragment, h, JSX } from \"@stencil/core\";\r\n\r\nimport { getNodeName } from \"./get-node-name.function\";\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 { OzonContentLijstNode } from \"./nodes/lijst.node\";\r\nimport { OzonContentNieuweTekstNode } from \"./nodes/nieuwe-tekst.node\";\r\nimport { OzonContentNootNode } from \"./nodes/noot.node\";\r\nimport { OzonContentOpschriftNode } from \"./nodes/opschrift.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\n\r\nexport class Mapper {\r\n private cache: { xml: string; document: Document } | undefined;\r\n\r\n private mappers: OzonContentNode[] = [\r\n new OzonContentTextNode(),\r\n new OzonContentDocumentNode(),\r\n new OzonContentInhoudNode(),\r\n new OzonContentOpschriftNode(),\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 domParser = new DOMParser();\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 mapNodeToJsx: (n) => this.mapNodeToJsx(n, context, [...path, node]),\r\n emitAnchorClick: context.emitAnchorClick,\r\n setState,\r\n state,\r\n path,\r\n });\r\n }\r\n\r\n transform(xml: string, context: OzonContentContext): JSX.Element {\r\n if (!xml) {\r\n return <Fragment />;\r\n }\r\n\r\n if (!this.cache || this.cache.xml !== xml) {\r\n const document = this.domParser.parseFromString(xml, \"text/xml\");\r\n if (document.querySelector(\"html > body > parsererror\")) {\r\n console.error(document);\r\n\r\n return <Fragment />;\r\n }\r\n\r\n this.cache = { xml, document };\r\n }\r\n\r\n const xmlDocument = this.cache.document;\r\n\r\n return this.mapNodeToJsx(xmlDocument.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,EAAE,CAAC,EAAO,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,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,qBAAqB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,oCAAoC,EAAE,MAAM,sCAAsC,CAAC;AAC5F,OAAO,EAAE,sBAAsB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,CAAC,YAAY,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;EAChE,CAAC;CACF","sourcesContent":["import { Fragment, h, JSX } from \"@stencil/core\";\r\n\r\nimport { getNodeName } from \"./get-node-name.function\";\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 { OzonContentLijstNode } from \"./nodes/lijst.node\";\r\nimport { OzonContentNieuweTekstNode } from \"./nodes/nieuwe-tekst.node\";\r\nimport { OzonContentNootNode } from \"./nodes/noot.node\";\r\nimport { OzonContentOpschriftNode } from \"./nodes/opschrift.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\n\r\nexport class Mapper {\r\n private mappers: OzonContentNode[] = [\r\n new OzonContentTextNode(),\r\n new OzonContentDocumentNode(),\r\n new OzonContentInhoudNode(),\r\n new OzonContentOpschriftNode(),\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 domParser = new DOMParser();\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 mapNodeToJsx: (n) => this.mapNodeToJsx(n, context, [...path, node]),\r\n emitAnchorClick: context.emitAnchorClick,\r\n setState,\r\n state,\r\n path,\r\n });\r\n }\r\n\r\n transform(xml: string, context: OzonContentContext): JSX.Element {\r\n if (!xml) {\r\n return <Fragment />;\r\n }\r\n\r\n const document = this.domParser.parseFromString(xml, \"text/xml\");\r\n if (document.querySelector(\"parsererror\")) {\r\n console.error({\r\n message: \"[DSO Toolkit: Ozon Content Mapper] Unable to parse XML\",\r\n context,\r\n xml,\r\n document,\r\n });\r\n\r\n return <Fragment />;\r\n }\r\n\r\n return this.mapNodeToJsx(document.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 { OzonContentAnchorClick } from \"./ozon-content.interfaces\";\r\n\r\nexport interface OzonContentNodeContext<T = unknown> {\r\n path: Node[];\r\n mapNodeToJsx(node: Node | Node[] | NodeList): JSX.Element;\r\n emitAnchorClick(event: OzonContentAnchorClick): void;\r\n state?: T;\r\n setState?(state: T): void;\r\n}\r\n"]}
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 { OzonContentAnchorClickEvent } from \"./ozon-content.interfaces\";\r\n\r\nexport interface OzonContentNodeContext<T = unknown> {\r\n inline: boolean;\r\n path: Node[];\r\n mapNodeToJsx(node: Node | Node[] | NodeList): JSX.Element;\r\n emitAnchorClick(event: OzonContentAnchorClickEvent): void;\r\n state?: T;\r\n setState?(state: T): void;\r\n}\r\n"]}