@epa-wg/custom-element-dist 0.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 (284) hide show
  1. package/.editorconfig +11 -0
  2. package/.gitignore +26 -0
  3. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  4. package/.idea/compiler.xml +6 -0
  5. package/.idea/custom-element-dist.iml +13 -0
  6. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  7. package/.idea/misc.xml +6 -0
  8. package/.idea/modules.xml +8 -0
  9. package/.idea/vcs.xml +6 -0
  10. package/.storybook/main.ts +21 -0
  11. package/.storybook/preview.ts +17 -0
  12. package/.vscode/settings.json +24 -0
  13. package/LICENSE +201 -0
  14. package/README.md +32 -0
  15. package/bin/build.sh +8 -0
  16. package/bin/clean.sh +5 -0
  17. package/bin/postinstall.sh +17 -0
  18. package/bin/start.sh +2 -0
  19. package/coverage/base.css +224 -0
  20. package/coverage/block-navigation.js +87 -0
  21. package/coverage/coverage-final.json +16 -0
  22. package/coverage/favicon.png +0 -0
  23. package/coverage/index.html +161 -0
  24. package/coverage/prettify.css +1 -0
  25. package/coverage/prettify.js +2 -0
  26. package/coverage/sort-arrow-sprite.png +0 -0
  27. package/coverage/sorter.js +196 -0
  28. package/coverage/src/coverage.svg +10 -0
  29. package/coverage/src/custom-element/coverage.svg +10 -0
  30. package/coverage/src/custom-element/custom-element.js/coverage.svg +10 -0
  31. package/coverage/src/custom-element/custom-element.js.html +2149 -0
  32. package/coverage/src/custom-element/http-request.js/coverage.svg +10 -0
  33. package/coverage/src/custom-element/http-request.js.html +352 -0
  34. package/coverage/src/custom-element/index.html +161 -0
  35. package/coverage/src/custom-element/local-storage.js/coverage.svg +10 -0
  36. package/coverage/src/custom-element/local-storage.js.html +346 -0
  37. package/coverage/src/custom-element/location-element.js/coverage.svg +10 -0
  38. package/coverage/src/custom-element/location-element.js.html +343 -0
  39. package/coverage/src/index.html +116 -0
  40. package/coverage/src/mocks/coverage.svg +10 -0
  41. package/coverage/src/mocks/handlers.ts/coverage.svg +10 -0
  42. package/coverage/src/mocks/handlers.ts.html +172 -0
  43. package/coverage/src/mocks/index.html +116 -0
  44. package/coverage/src/stories/attributes.stories.ts/coverage.svg +10 -0
  45. package/coverage/src/stories/attributes.stories.ts.html +481 -0
  46. package/coverage/src/stories/coverage.svg +10 -0
  47. package/coverage/src/stories/css.stories.ts/coverage.svg +10 -0
  48. package/coverage/src/stories/css.stories.ts.html +397 -0
  49. package/coverage/src/stories/dom-merge.stories.ts/coverage.svg +10 -0
  50. package/coverage/src/stories/dom-merge.stories.ts.html +424 -0
  51. package/coverage/src/stories/external-template.stories.ts/coverage.svg +10 -0
  52. package/coverage/src/stories/external-template.stories.ts.html +820 -0
  53. package/coverage/src/stories/http-request.stories.ts/coverage.svg +10 -0
  54. package/coverage/src/stories/http-request.stories.ts.html +817 -0
  55. package/coverage/src/stories/index.html +236 -0
  56. package/coverage/src/stories/local-storage.stories.ts/coverage.svg +10 -0
  57. package/coverage/src/stories/local-storage.stories.ts.html +1249 -0
  58. package/coverage/src/stories/location-element.stories.ts/coverage.svg +10 -0
  59. package/coverage/src/stories/location-element.stories.ts.html +484 -0
  60. package/coverage/src/stories/renderPlay.ts/coverage.svg +10 -0
  61. package/coverage/src/stories/renderPlay.ts.html +151 -0
  62. package/coverage/src/stories/slice-events.stories.ts/coverage.svg +10 -0
  63. package/coverage/src/stories/slice-events.stories.ts.html +436 -0
  64. package/coverage/src/sum.ts/coverage.svg +10 -0
  65. package/coverage/src/sum.ts.html +94 -0
  66. package/dist/confused.svg +37 -0
  67. package/dist/custom-element-B4v-KaIh.cjs +53 -0
  68. package/dist/custom-element-_g0GTup2.js +436 -0
  69. package/dist/custom-element-bundle.cjs +1 -0
  70. package/dist/custom-element-bundle.js +31 -0
  71. package/dist/embed-1.html +3 -0
  72. package/dist/html-template.html +126 -0
  73. package/dist/html-template.xhtml +45 -0
  74. package/dist/html-template.xml +45 -0
  75. package/dist/http-request-BOvP4KTl.js +56 -0
  76. package/dist/http-request-DPrY7mGh.cjs +1 -0
  77. package/dist/local-storage-Boafngui.cjs +1 -0
  78. package/dist/local-storage-BqDEu2kF.js +59 -0
  79. package/dist/location-element-2m0gWq_d.cjs +1 -0
  80. package/dist/location-element-nA_wsqBt.js +49 -0
  81. package/dist/mockServiceWorker.js +284 -0
  82. package/dist/tree.xsl +33 -0
  83. package/dist/vite.svg +1 -0
  84. package/index.html +17 -0
  85. package/package.json +97 -0
  86. package/public/confused.svg +37 -0
  87. package/public/embed-1.html +3 -0
  88. package/public/html-template.html +126 -0
  89. package/public/html-template.xhtml +45 -0
  90. package/public/html-template.xml +45 -0
  91. package/public/mockServiceWorker.js +284 -0
  92. package/public/tree.xsl +33 -0
  93. package/public/vite.svg +1 -0
  94. package/src/assets/lit.svg +1 -0
  95. package/src/custom-element/custom-element.d.ts +36 -0
  96. package/src/custom-element/custom-element.js +688 -0
  97. package/src/custom-element/demo/a.html +63 -0
  98. package/src/custom-element/demo/confused.svg +37 -0
  99. package/src/custom-element/demo/data-slices.html +184 -0
  100. package/src/custom-element/demo/dce-social-preview.png +0 -0
  101. package/src/custom-element/demo/demo.css +22 -0
  102. package/src/custom-element/demo/dom-merge.html +123 -0
  103. package/src/custom-element/demo/embed-1.html +3 -0
  104. package/src/custom-element/demo/external-template.html +179 -0
  105. package/src/custom-element/demo/hex-grid-dce.html +183 -0
  106. package/src/custom-element/demo/hex-grid-transform.png +0 -0
  107. package/src/custom-element/demo/hex-grid.html +66 -0
  108. package/src/custom-element/demo/html-template.html +126 -0
  109. package/src/custom-element/demo/html-template.xhtml +45 -0
  110. package/src/custom-element/demo/html-template.xml +45 -0
  111. package/src/custom-element/demo/http-request.html +143 -0
  112. package/src/custom-element/demo/local-storage.html +218 -0
  113. package/src/custom-element/demo/location-element.html +155 -0
  114. package/src/custom-element/demo/logo.png +0 -0
  115. package/src/custom-element/demo/parameters.html +70 -0
  116. package/src/custom-element/demo/s.xml +14 -0
  117. package/src/custom-element/demo/s.xslt +76 -0
  118. package/src/custom-element/demo/scoped-css.html +169 -0
  119. package/src/custom-element/demo/ss.html +57 -0
  120. package/src/custom-element/demo/table.xml +25 -0
  121. package/src/custom-element/demo/table.xsl +293 -0
  122. package/src/custom-element/demo/template.xsl +46 -0
  123. package/src/custom-element/demo/tree.xml +25 -0
  124. package/src/custom-element/demo/tree.xsl +33 -0
  125. package/src/custom-element/demo/wc-square.svg +1 -0
  126. package/src/custom-element/demo/xhtml-template.xhtml +45 -0
  127. package/src/custom-element/demo/z.html +62 -0
  128. package/src/custom-element/demo/z.xml +60 -0
  129. package/src/custom-element/http-request.js +89 -0
  130. package/src/custom-element/ide/IDE.md +31 -0
  131. package/src/custom-element/ide/customData-dce.json +112 -0
  132. package/src/custom-element/ide/customData-xsl.json +1018 -0
  133. package/src/custom-element/ide/web-types-dce.json +111 -0
  134. package/src/custom-element/ide/web-types-xsl.json +867 -0
  135. package/src/custom-element/index.html +168 -0
  136. package/src/custom-element/index.js +7 -0
  137. package/src/custom-element/local-storage.js +87 -0
  138. package/src/custom-element/location-element.js +87 -0
  139. package/src/custom-element.test.ts +10 -0
  140. package/src/index.css +38 -0
  141. package/src/mocks/handlers.ts +29 -0
  142. package/src/mocks/pokemons.mock.ts +13 -0
  143. package/src/stories/Configure.mdx +364 -0
  144. package/src/stories/assets/accessibility.png +0 -0
  145. package/src/stories/assets/accessibility.svg +5 -0
  146. package/src/stories/assets/addon-library.png +0 -0
  147. package/src/stories/assets/assets.png +0 -0
  148. package/src/stories/assets/avif-test-image.avif +0 -0
  149. package/src/stories/assets/context.png +0 -0
  150. package/src/stories/assets/discord.svg +15 -0
  151. package/src/stories/assets/docs.png +0 -0
  152. package/src/stories/assets/figma-plugin.png +0 -0
  153. package/src/stories/assets/github.svg +3 -0
  154. package/src/stories/assets/share.png +0 -0
  155. package/src/stories/assets/styling.png +0 -0
  156. package/src/stories/assets/testing.png +0 -0
  157. package/src/stories/assets/theming.png +0 -0
  158. package/src/stories/assets/tutorials.svg +12 -0
  159. package/src/stories/assets/youtube.svg +4 -0
  160. package/src/stories/attributes.stories.ts +132 -0
  161. package/src/stories/attributes.test.ts +14 -0
  162. package/src/stories/css.stories.ts +104 -0
  163. package/src/stories/css.test.ts +12 -0
  164. package/src/stories/dom-merge.stories.ts +113 -0
  165. package/src/stories/dom-merge.test.ts +12 -0
  166. package/src/stories/external-template.stories.ts +245 -0
  167. package/src/stories/external-template.test.ts +12 -0
  168. package/src/stories/http-request.stories.ts +244 -0
  169. package/src/stories/http-request.test.ts +29 -0
  170. package/src/stories/local-storage.stories.ts +388 -0
  171. package/src/stories/local-storage.test.ts +12 -0
  172. package/src/stories/location-element.stories.ts +133 -0
  173. package/src/stories/location-element.test.ts +14 -0
  174. package/src/stories/renderPlay.ts +22 -0
  175. package/src/stories/slice-events.stories.ts +117 -0
  176. package/src/stories/slice-events.test.ts +12 -0
  177. package/src/sum.test.ts +6 -0
  178. package/src/sum.ts +4 -0
  179. package/src/vite-env.d.ts +1 -0
  180. package/storybook-static/assets/Color-RQJUDNI5-C4yZhNbM.js +1 -0
  181. package/storybook-static/assets/Configure-C7d36rng.js +173 -0
  182. package/storybook-static/assets/DocsRenderer-K4EAMTCU-BLMupvSb.js +2 -0
  183. package/storybook-static/assets/WithTooltip-Y7J54OF7-BAQSPSFk.js +1 -0
  184. package/storybook-static/assets/accessibility-W_h2acOZ.png +0 -0
  185. package/storybook-static/assets/addon-library-BWUCAmyN.png +0 -0
  186. package/storybook-static/assets/attributes.stories-ZB0RTY1d.js +151 -0
  187. package/storybook-static/assets/context-C0qIqeS4.png +0 -0
  188. package/storybook-static/assets/css.stories-CLSX-Xxd.js +86 -0
  189. package/storybook-static/assets/custom-element-BLZZ00dz.js +53 -0
  190. package/storybook-static/assets/docs---vsFbMi.png +0 -0
  191. package/storybook-static/assets/dom-merge.stories-CgHZUABU.js +138 -0
  192. package/storybook-static/assets/entry-preview-CQqNFx4W.js +8 -0
  193. package/storybook-static/assets/entry-preview-docs-CWgqLfd3.js +2 -0
  194. package/storybook-static/assets/external-template.stories-DtSLMxvg.js +316 -0
  195. package/storybook-static/assets/figma-plugin-CH2hELiO.png +0 -0
  196. package/storybook-static/assets/formatter-B5HCVTEV-tKeEfJA9.js +58 -0
  197. package/storybook-static/assets/http-request.stories-CUzlXO89.js +300 -0
  198. package/storybook-static/assets/iframe-gCvlWuoC.js +2 -0
  199. package/storybook-static/assets/index-CBQwM6ST.js +508 -0
  200. package/storybook-static/assets/index-CDavW7r9.js +193 -0
  201. package/storybook-static/assets/index-CQA5dlr6.js +13 -0
  202. package/storybook-static/assets/index-Cc7K62zD.js +3 -0
  203. package/storybook-static/assets/index-DgaNIR0t.js +1 -0
  204. package/storybook-static/assets/index-Dkj0J1ds.js +1 -0
  205. package/storybook-static/assets/index-DnEJ_bKa.js +1 -0
  206. package/storybook-static/assets/index-DrFu-skq.js +6 -0
  207. package/storybook-static/assets/lit-element-B4_0akdT.js +19 -0
  208. package/storybook-static/assets/local-storage.stories-BkO6djDz.js +415 -0
  209. package/storybook-static/assets/location-element.stories-DCIOUd0D.js +108 -0
  210. package/storybook-static/assets/preview-B4GcaC1c.js +1 -0
  211. package/storybook-static/assets/preview-B63p-W8V.js +20 -0
  212. package/storybook-static/assets/preview-BAz7FMXc.js +396 -0
  213. package/storybook-static/assets/preview-BDY5ThwJ.js +1 -0
  214. package/storybook-static/assets/preview-C6t8KBFr.js +1 -0
  215. package/storybook-static/assets/preview-CYD85dwb.js +7 -0
  216. package/storybook-static/assets/preview-CkgAD_DE.js +2 -0
  217. package/storybook-static/assets/preview-D8LadFCz.js +48 -0
  218. package/storybook-static/assets/preview-DNpCpRPf.js +1 -0
  219. package/storybook-static/assets/preview-PxUn-cIn.js +1 -0
  220. package/storybook-static/assets/share-DGA-UcQf.png +0 -0
  221. package/storybook-static/assets/slice-events.stories-DXKjXI37.js +115 -0
  222. package/storybook-static/assets/styling-Bk6zjRzU.png +0 -0
  223. package/storybook-static/assets/syntaxhighlighter-JOJW2KGS-C04pIVD3.js +1 -0
  224. package/storybook-static/assets/testing-cbzR9l9r.png +0 -0
  225. package/storybook-static/assets/theming-D6WJLNoW.png +0 -0
  226. package/storybook-static/assets/tiny-invariant-BxWVcicq.js +1 -0
  227. package/storybook-static/confused.svg +37 -0
  228. package/storybook-static/embed-1.html +3 -0
  229. package/storybook-static/favicon.svg +7 -0
  230. package/storybook-static/html-template.html +126 -0
  231. package/storybook-static/html-template.xhtml +45 -0
  232. package/storybook-static/html-template.xml +45 -0
  233. package/storybook-static/iframe.html +492 -0
  234. package/storybook-static/index.html +163 -0
  235. package/storybook-static/index.json +1 -0
  236. package/storybook-static/mockServiceWorker.js +284 -0
  237. package/storybook-static/project.json +1 -0
  238. package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js +327 -0
  239. package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js.LEGAL.txt +40 -0
  240. package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +3 -0
  241. package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js.LEGAL.txt +0 -0
  242. package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +12 -0
  243. package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js.LEGAL.txt +0 -0
  244. package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +60 -0
  245. package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js.LEGAL.txt +18 -0
  246. package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +3 -0
  247. package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js.LEGAL.txt +0 -0
  248. package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +3 -0
  249. package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js.LEGAL.txt +0 -0
  250. package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +3 -0
  251. package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js.LEGAL.txt +0 -0
  252. package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +3 -0
  253. package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js.LEGAL.txt +0 -0
  254. package/storybook-static/sb-addons/interactions-10/manager-bundle.js +33 -0
  255. package/storybook-static/sb-addons/interactions-10/manager-bundle.js.LEGAL.txt +0 -0
  256. package/storybook-static/sb-addons/links-1/manager-bundle.js +3 -0
  257. package/storybook-static/sb-addons/links-1/manager-bundle.js.LEGAL.txt +0 -0
  258. package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +3 -0
  259. package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
  260. package/storybook-static/sb-common-assets/fonts.css +31 -0
  261. package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  262. package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  263. package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  264. package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  265. package/storybook-static/sb-manager/WithTooltip-Y7J54OF7-CEHQ77YF.js +1 -0
  266. package/storybook-static/sb-manager/chunk-E3WK6ZOZ.js +234 -0
  267. package/storybook-static/sb-manager/chunk-E6ABNH5R.js +183 -0
  268. package/storybook-static/sb-manager/chunk-FEE35O7J.js +9 -0
  269. package/storybook-static/sb-manager/chunk-S4VOIVUE.js +347 -0
  270. package/storybook-static/sb-manager/chunk-XCO5HRLK.js +6 -0
  271. package/storybook-static/sb-manager/chunk-XP3HGWTR.js +1 -0
  272. package/storybook-static/sb-manager/formatter-B5HCVTEV-7DCBOGO6.js +58 -0
  273. package/storybook-static/sb-manager/globals-module-info.js +1 -0
  274. package/storybook-static/sb-manager/globals-runtime.js +1 -0
  275. package/storybook-static/sb-manager/globals.js +1 -0
  276. package/storybook-static/sb-manager/index.js +1 -0
  277. package/storybook-static/sb-manager/runtime.js +1 -0
  278. package/storybook-static/sb-manager/syntaxhighlighter-JOJW2KGS-VF6EEVPI.js +1 -0
  279. package/storybook-static/sb-preview/globals.js +1 -0
  280. package/storybook-static/sb-preview/runtime.js +139 -0
  281. package/storybook-static/tree.xsl +33 -0
  282. package/storybook-static/vite.svg +1 -0
  283. package/tsconfig.json +25 -0
  284. package/vite.config.js +55 -0
@@ -0,0 +1,316 @@
1
+ import{w as l,e as n}from"./index-CDavW7r9.js";import"./custom-element-BLZZ00dz.js";function T(t){return new Promise(e=>setTimeout(e,t))}function v(t){const{title:e,body:a}=t;return`
2
+ <fieldset>
3
+ <legend>${e}</legend>
4
+ ${a}
5
+ </fieldset>
6
+ `}const D={title:"external-templates",render:v},s={args:{title:"Template in page DOM",body:`
7
+ <template id="template1">
8
+ <slot>Hello</slot> World!
9
+ </template>
10
+
11
+ <custom-element tag="dce-internal" src="#template1"></custom-element>
12
+ <!-- no need for loading fallback as the template exists -->
13
+
14
+ <dce-internal data-testid="slot-override">👋</dce-internal>
15
+ <dce-internal data-testid="slot-default"></dce-internal>
16
+ `},play:async({canvasElement:t})=>{const e=l(t);await e.findByText(s.args.title);const a=f=>e.getByTestId(f).textContent.trim();n(a("slot-override")).toEqual("👋 World!"),n(a("slot-default")).toEqual("Hello World!")}},i={args:{title:"no tag, template in same DOM",body:`
17
+ <template id="template2">
18
+ 🏗️ construction
19
+ </template>
20
+
21
+ <custom-element src="#template2"></custom-element>
22
+ <custom-element src="#template2"></custom-element>`},play:async({canvasElement:t})=>{await l(t).findByText(i.args.title),n(t.querySelectorAll("custom-element")[0].textContent.trim()).toEqual("🏗️ construction"),n(t.querySelectorAll("custom-element")[1].textContent.trim()).toEqual("🏗️ construction")}},m={args:{title:"External SVG as template",body:`
23
+ <custom-element tag="dce-external" src="/confused.svg">
24
+ <template><i>loading from SVG ...</i></template>
25
+ </custom-element>
26
+ <dce-external></dce-external>
27
+ <custom-element src="confused.svg">
28
+ <i>inline DCE loading from SVG ...</i>
29
+ </custom-element>
30
+ <custom-element src="no.svg">
31
+ <i>fallback for missing image</i>
32
+ </custom-element>
33
+ `},play:async({canvasElement:t})=>{await l(t).findByText(m.args.title),n(t.querySelector('[src="confused.svg"]').innerHTML).to.include("loading from SVG ..."),await T(100),n(t.querySelector("dce-external").innerHTML).to.include("<svg"),n(t.querySelector('[src="no.svg"]').innerHTML).to.include("Vitest Browser Tester")}},o={args:{title:"External XSLT file",body:`
34
+ <custom-element tag="dce-external-4" src="/tree.xsl">
35
+ <template><i>loading from XSLT ...</i></template>
36
+ </custom-element>
37
+ <dce-external-4 title="DCE with external XSLT template" data-fruit="🍌">Hi</dce-external-4>
38
+ <hr/>
39
+ <custom-element src="/tree.xsl" data-smile="👼" data-basket="🍒">
40
+ <i>inline DCE loading from XSLT ...</i>
41
+ </custom-element>
42
+ `},play:async({canvasElement:t})=>{const e=l(t);await e.findByText(o.args.title),n(t.querySelector("dce-external-4").innerHTML).to.include("Hi"),n(t.querySelector('[data-smile="👼"]').innerHTML).to.include("loading from XSLT ..."),await T(100),n(e.getByTestId("data-fruit").innerHTML).to.include("🍌"),n(e.getByTestId("data-smile").innerHTML).to.include("👼")}},c={args:{title:"external HTML template",body:`
43
+ <custom-element tag="dce-external-5" src="/html-template.html">
44
+ <template><i>loading from HTML file ...</i></template>
45
+ </custom-element>
46
+ <dce-external-5 title="DCE with external XSLT template" data-fruit="🍌">Hi</dce-external-5>
47
+ `},play:async({canvasElement:t})=>{const e=l(t);await e.findByText(c.args.title),await e.findByText("👋");const a=t.querySelector("dce-external-5").innerHTML;n(a).to.include("👋"),n(a).to.include("👌"),n(a).to.include("<svg"),n(a).to.include("<math")}},r={args:{title:"external HTML template",body:`
48
+ <custom-element src="/html-template.html" data-smile="👼" data-basket="🍒">
49
+ <i>inline DCE loading from HTML file ...</i>
50
+ </custom-element>
51
+ `},play:async({canvasElement:t})=>{const e=l(t);await e.findByText(r.args.title),await e.findByText("👋");const a=t.innerHTML;n(a).to.include("👋"),n(a).to.include("👌"),n(a).to.include("<svg"),n(a).to.include("<math")}},d={args:{title:"external HTML template - html by id",body:`
52
+ <custom-element src="/html-template.html#wave">
53
+ <template><i>loading HTML from templates file ...</i></template>
54
+ </custom-element>
55
+ `},play:async({canvasElement:t})=>{const e=l(t);await e.findByText(d.args.title),n(await e.findByText("👋")).toBeInTheDocument()}},u={args:{title:"external HTML template - SVG by id",body:`
56
+ <custom-element src="/html-template.html#dwc-logo">
57
+ <template><i>loading SVG from templates file ...</i></template>
58
+ </custom-element>
59
+ `},play:async({canvasElement:t})=>{const e=l(t);await e.findByText(u.args.title),n(await e.findByTestId("svg-test")).toBeInTheDocument()}},p={args:{title:"external HTML template - MathML by id",body:`
60
+ <custom-element src="/html-template.html#sophomores-dream">
61
+ <template><i>loading MathML from HTML file ...</i></template>
62
+ </custom-element>
63
+ `},play:async({canvasElement:t})=>{const e=l(t);await e.findByText(p.args.title);const a=await e.findByTestId("ml-test");debugger;n(a.firstElementChild.localName).toEqual("mrow")}},g={args:{title:"external XHTML template - xsl by id",body:`
64
+ <custom-element src="/html-template.xhtml#embedded-xsl">
65
+ <template>whole XSLT is embedded into HTML body</template>
66
+ </custom-element>
67
+ `},play:async({canvasElement:t})=>{const e=l(t);await e.findByText(g.args.title);const a=await e.findByTestId("src");n(a.textContent).to.include("/html-template.xhtml#embedded-xsl")}},y={args:{title:"external HTML template - missing id",body:`
68
+ <custom-element src="/html-template.html#none">
69
+ <template><i data-testid="no-id">element with id=none is missing in template</i></template>
70
+ </custom-element>
71
+ `},play:async({canvasElement:t})=>{const e=l(t);await e.findByText(y.args.title),await T(100);const a=await e.findByTestId("no-id");n(a.textContent).to.include("element with id=none is missing in template")}},x={args:{title:"external file with embedding of another external DCE",body:`
72
+ <custom-element src="/embed-1.html">
73
+ loading from embed-1.html ...
74
+ </custom-element>
75
+ `},play:async({canvasElement:t})=>{const e=l(t);await e.findByText(x.args.title),await T(100),n(await e.findByTestId("wave")).toBeInTheDocument(),n(e.getByTestId("wave").innerHTML).toEqual("🖖")}};s.parameters={...s.parameters,docs:{...s.parameters?.docs,source:{originalSource:`{
76
+ args: {
77
+ title: 'Template in page DOM',
78
+ body: \`
79
+ <template id="template1">
80
+ <slot>Hello</slot> World!
81
+ </template>
82
+
83
+ <custom-element tag="dce-internal" src="#template1"></custom-element>
84
+ <!-- no need for loading fallback as the template exists -->
85
+
86
+ <dce-internal data-testid="slot-override">👋</dce-internal>
87
+ <dce-internal data-testid="slot-default"></dce-internal>
88
+ \`
89
+ },
90
+ play: async ({
91
+ canvasElement
92
+ }) => {
93
+ const canvas = within(canvasElement);
94
+ await canvas.findByText((TemplateInPage.args!.title as string));
95
+ const val = prop => canvas.getByTestId(prop).textContent.trim();
96
+ expect(val('slot-override')).toEqual('👋 World!');
97
+ expect(val('slot-default')).toEqual('Hello World!');
98
+ }
99
+ }`,...s.parameters?.docs?.source}}};i.parameters={...i.parameters,docs:{...i.parameters?.docs,source:{originalSource:`{
100
+ args: {
101
+ title: 'no tag, template in same DOM',
102
+ body: \`
103
+ <template id="template2">
104
+ 🏗️ construction
105
+ </template>
106
+
107
+ <custom-element src="#template2"></custom-element>
108
+ <custom-element src="#template2"></custom-element>\`
109
+ },
110
+ play: async ({
111
+ canvasElement
112
+ }) => {
113
+ const canvas = within(canvasElement);
114
+ await canvas.findByText((NoTag.args!.title as string));
115
+ expect(canvasElement.querySelectorAll('custom-element')[0].textContent.trim()).toEqual('🏗️ construction');
116
+ expect(canvasElement.querySelectorAll('custom-element')[1].textContent.trim()).toEqual('🏗️ construction');
117
+ }
118
+ }`,...i.parameters?.docs?.source}}};m.parameters={...m.parameters,docs:{...m.parameters?.docs,source:{originalSource:`{
119
+ args: {
120
+ title: 'External SVG as template',
121
+ body: \`
122
+ <custom-element tag="dce-external" src="/confused.svg">
123
+ <template><i>loading from SVG ...</i></template>
124
+ </custom-element>
125
+ <dce-external></dce-external>
126
+ <custom-element src="confused.svg">
127
+ <i>inline DCE loading from SVG ...</i>
128
+ </custom-element>
129
+ <custom-element src="no.svg">
130
+ <i>fallback for missing image</i>
131
+ </custom-element>
132
+ \`
133
+ },
134
+ play: async ({
135
+ canvasElement
136
+ }) => {
137
+ const canvas = within(canvasElement);
138
+ await canvas.findByText((ExternalSvg.args!.title as string));
139
+ expect(canvasElement.querySelector('[src="confused.svg"]').innerHTML).to.include('loading from SVG ...');
140
+ await sleep(100);
141
+ expect(canvasElement.querySelector('dce-external').innerHTML).to.include('<svg');
142
+ expect(canvasElement.querySelector('[src="no.svg"]').innerHTML).to.include('Vitest Browser Tester');
143
+ // "fallback for missing image" is not shown in test as test does not return 404, see test on 404 instead
144
+ }
145
+ }`,...m.parameters?.docs?.source}}};o.parameters={...o.parameters,docs:{...o.parameters?.docs,source:{originalSource:`{
146
+ args: {
147
+ title: 'External XSLT file',
148
+ body: \`
149
+ <custom-element tag="dce-external-4" src="/tree.xsl">
150
+ <template><i>loading from XSLT ...</i></template>
151
+ </custom-element>
152
+ <dce-external-4 title="DCE with external XSLT template" data-fruit="🍌">Hi</dce-external-4>
153
+ <hr/>
154
+ <custom-element src="/tree.xsl" data-smile="👼" data-basket="🍒">
155
+ <i>inline DCE loading from XSLT ...</i>
156
+ </custom-element>
157
+ \`
158
+ },
159
+ play: async ({
160
+ canvasElement
161
+ }) => {
162
+ const canvas = within(canvasElement);
163
+ await canvas.findByText((ExternalXsltFile.args!.title as string));
164
+ expect(canvasElement.querySelector('dce-external-4').innerHTML).to.include('Hi');
165
+ expect(canvasElement.querySelector('[data-smile="👼"]').innerHTML).to.include('loading from XSLT ...');
166
+ await sleep(100);
167
+ expect(canvas.getByTestId('data-fruit').innerHTML).to.include('🍌');
168
+ expect(canvas.getByTestId('data-smile').innerHTML).to.include('👼');
169
+ }
170
+ }`,...o.parameters?.docs?.source}}};c.parameters={...c.parameters,docs:{...c.parameters?.docs,source:{originalSource:`{
171
+ args: {
172
+ title: 'external HTML template',
173
+ body: \`
174
+ <custom-element tag="dce-external-5" src="/html-template.html">
175
+ <template><i>loading from HTML file ...</i></template>
176
+ </custom-element>
177
+ <dce-external-5 title="DCE with external XSLT template" data-fruit="🍌">Hi</dce-external-5>
178
+ \`
179
+ },
180
+ play: async ({
181
+ canvasElement
182
+ }) => {
183
+ const canvas = within(canvasElement);
184
+ await canvas.findByText((ExternalHtmlFile.args!.title as string));
185
+ await canvas.findByText('👋');
186
+ const t5 = canvasElement.querySelector('dce-external-5').innerHTML;
187
+ expect(t5).to.include('👋');
188
+ expect(t5).to.include('👌');
189
+ expect(t5).to.include('<svg');
190
+ expect(t5).to.include('<math');
191
+ }
192
+ }`,...c.parameters?.docs?.source}}};r.parameters={...r.parameters,docs:{...r.parameters?.docs,source:{originalSource:`{
193
+ args: {
194
+ title: 'external HTML template',
195
+ body: \`
196
+ <custom-element src="/html-template.html" data-smile="👼" data-basket="🍒">
197
+ <i>inline DCE loading from HTML file ...</i>
198
+ </custom-element>
199
+ \`
200
+ },
201
+ play: async ({
202
+ canvasElement
203
+ }) => {
204
+ const canvas = within(canvasElement);
205
+ await canvas.findByText((ExternalHtmlFileInline.args!.title as string));
206
+ await canvas.findByText('👋');
207
+ const t5 = canvasElement.innerHTML;
208
+ expect(t5).to.include('👋');
209
+ expect(t5).to.include('👌');
210
+ expect(t5).to.include('<svg');
211
+ expect(t5).to.include('<math');
212
+ }
213
+ }`,...r.parameters?.docs?.source}}};d.parameters={...d.parameters,docs:{...d.parameters?.docs,source:{originalSource:`{
214
+ args: {
215
+ title: 'external HTML template - html by id',
216
+ body: \`
217
+ <custom-element src="/html-template.html#wave">
218
+ <template><i>loading HTML from templates file ...</i></template>
219
+ </custom-element>
220
+ \`
221
+ },
222
+ play: async ({
223
+ canvasElement
224
+ }) => {
225
+ const canvas = within(canvasElement);
226
+ await canvas.findByText((HtmlWithinHtmlFile.args!.title as string));
227
+ expect(await canvas.findByText('👋')).toBeInTheDocument();
228
+ }
229
+ }`,...d.parameters?.docs?.source}}};u.parameters={...u.parameters,docs:{...u.parameters?.docs,source:{originalSource:`{
230
+ args: {
231
+ title: 'external HTML template - SVG by id',
232
+ body: \`
233
+ <custom-element src="/html-template.html#dwc-logo">
234
+ <template><i>loading SVG from templates file ...</i></template>
235
+ </custom-element>
236
+ \`
237
+ },
238
+ play: async ({
239
+ canvasElement
240
+ }) => {
241
+ const canvas = within(canvasElement);
242
+ await canvas.findByText((SvgWithinHtmlFile.args!.title as string));
243
+ expect(await canvas.findByTestId('svg-test')).toBeInTheDocument();
244
+ }
245
+ }`,...u.parameters?.docs?.source}}};p.parameters={...p.parameters,docs:{...p.parameters?.docs,source:{originalSource:`{
246
+ args: {
247
+ title: 'external HTML template - MathML by id',
248
+ body: \`
249
+ <custom-element src="/html-template.html#sophomores-dream">
250
+ <template><i>loading MathML from HTML file ...</i></template>
251
+ </custom-element>
252
+ \`
253
+ },
254
+ play: async ({
255
+ canvasElement
256
+ }) => {
257
+ const canvas = within(canvasElement);
258
+ await canvas.findByText((MathMLWithinHtmlFile.args!.title as string));
259
+ const ml = await canvas.findByTestId('ml-test');
260
+ debugger;
261
+ expect(ml.firstElementChild.localName).toEqual('mrow');
262
+ }
263
+ }`,...p.parameters?.docs?.source}}};g.parameters={...g.parameters,docs:{...g.parameters?.docs,source:{originalSource:`{
264
+ args: {
265
+ title: 'external XHTML template - xsl by id',
266
+ body: \`
267
+ <custom-element src="/html-template.xhtml#embedded-xsl">
268
+ <template>whole XSLT is embedded into HTML body</template>
269
+ </custom-element>
270
+ \`
271
+ },
272
+ play: async ({
273
+ canvasElement
274
+ }) => {
275
+ const canvas = within(canvasElement);
276
+ await canvas.findByText((ByIdWithinXsltFile.args!.title as string));
277
+ const ml = await canvas.findByTestId('src');
278
+ expect(ml.textContent).to.include('/html-template.xhtml#embedded-xsl');
279
+ }
280
+ }`,...g.parameters?.docs?.source}}};y.parameters={...y.parameters,docs:{...y.parameters?.docs,source:{originalSource:`{
281
+ args: {
282
+ title: 'external HTML template - missing id',
283
+ body: \`
284
+ <custom-element src="/html-template.html#none">
285
+ <template><i data-testid="no-id">element with id=none is missing in template</i></template>
286
+ </custom-element>
287
+ \`
288
+ },
289
+ play: async ({
290
+ canvasElement
291
+ }) => {
292
+ const canvas = within(canvasElement);
293
+ await canvas.findByText((MissingIdWithinXsltFile.args!.title as string));
294
+ await sleep(100);
295
+ const ml = await canvas.findByTestId('no-id');
296
+ expect(ml.textContent).to.include('element with id=none is missing in template');
297
+ }
298
+ }`,...y.parameters?.docs?.source}}};x.parameters={...x.parameters,docs:{...x.parameters?.docs,source:{originalSource:`{
299
+ args: {
300
+ title: 'external file with embedding of another external DCE',
301
+ body: \`
302
+ <custom-element src="/embed-1.html">
303
+ loading from embed-1.html ...
304
+ </custom-element>
305
+ \`
306
+ },
307
+ play: async ({
308
+ canvasElement
309
+ }) => {
310
+ const canvas = within(canvasElement);
311
+ await canvas.findByText((EmbeddingInAnotherFile.args!.title as string));
312
+ await sleep(100);
313
+ expect(await canvas.findByTestId('wave')).toBeInTheDocument();
314
+ expect(canvas.getByTestId('wave').innerHTML).toEqual('🖖');
315
+ }
316
+ }`,...x.parameters?.docs?.source}}};const E=["TemplateInPage","NoTag","ExternalSvg","ExternalXsltFile","ExternalHtmlFile","ExternalHtmlFileInline","HtmlWithinHtmlFile","SvgWithinHtmlFile","MathMLWithinHtmlFile","ByIdWithinXsltFile","MissingIdWithinXsltFile","EmbeddingInAnotherFile"];export{g as ByIdWithinXsltFile,x as EmbeddingInAnotherFile,c as ExternalHtmlFile,r as ExternalHtmlFileInline,m as ExternalSvg,o as ExternalXsltFile,d as HtmlWithinHtmlFile,p as MathMLWithinHtmlFile,y as MissingIdWithinXsltFile,i as NoTag,u as SvgWithinHtmlFile,s as TemplateInPage,E as __namedExportsOrder,D as default};