@epa-wg/custom-element-dist 0.0.26 → 0.0.28

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 (216) hide show
  1. package/.storybook/main.ts +2 -2
  2. package/.storybook/preview.ts +1 -1
  3. package/README.md +4 -4
  4. package/bin/vitest/vitest-browser-importmaps.mjs +20 -20
  5. package/coverage/coverage-final.json +22 -22
  6. package/coverage/index.html +26 -26
  7. package/coverage/src/custom-element/coverage.svg +1 -1
  8. package/coverage/src/custom-element/custom-element.js/coverage.svg +1 -1
  9. package/coverage/src/custom-element/custom-element.js.html +662 -380
  10. package/coverage/src/custom-element/demo/index.html +1 -1
  11. package/coverage/src/custom-element/demo/z.js.html +1 -1
  12. package/coverage/src/custom-element/http-request.js.html +12 -12
  13. package/coverage/src/custom-element/index.html +21 -21
  14. package/coverage/src/custom-element/local-storage.js.html +78 -63
  15. package/coverage/src/custom-element/location-element.js.html +4 -4
  16. package/coverage/src/custom-element/module-url.js/coverage.svg +1 -1
  17. package/coverage/src/custom-element/module-url.js.html +16 -10
  18. package/coverage/src/index.html +1 -1
  19. package/coverage/src/mocks/handlers.ts.html +1 -1
  20. package/coverage/src/mocks/index.html +1 -1
  21. package/coverage/src/stories/attributes.test.stories.ts.html +17 -11
  22. package/coverage/src/stories/coverage.svg +1 -1
  23. package/coverage/src/stories/css.test.stories.ts.html +8 -2
  24. package/coverage/src/stories/dom-merge.test.stories.ts.html +17 -11
  25. package/coverage/src/stories/external-template.test.stories.ts.html +13 -10
  26. package/coverage/src/stories/form.test.stories.ts.html +8 -2
  27. package/coverage/src/stories/http-request.stories.ts.html +1 -1
  28. package/coverage/src/stories/index.html +26 -26
  29. package/coverage/src/stories/local-storage.test.stories.ts/coverage.svg +1 -1
  30. package/coverage/src/stories/local-storage.test.stories.ts.html +106 -76
  31. package/coverage/src/stories/location-element.test.stories.ts.html +8 -2
  32. package/coverage/src/stories/module-url.test.stories.ts.html +8 -2
  33. package/coverage/src/stories/set-url.test.stories.ts.html +8 -2
  34. package/coverage/src/stories/slice-events.test.stories.ts.html +8 -2
  35. package/coverage/src/stories/slots.test.stories.ts.html +8 -2
  36. package/coverage/src/stories/testStoryBook.ts.html +12 -12
  37. package/coverage/src/stories/version-select.test.stories.ts.html +8 -2
  38. package/coverage/src/sum.ts.html +1 -1
  39. package/dist/custom-element-BOIPgtxz.js +565 -0
  40. package/dist/custom-element-CUsSENWc.cjs +97 -0
  41. package/dist/custom-element-bundle.cjs +1 -1
  42. package/dist/custom-element-bundle.js +25 -21
  43. package/dist/demo/a.svg +27 -0
  44. package/dist/demo/demo.css +6 -7
  45. package/dist/demo/external-template.html +3 -3
  46. package/dist/demo/npm-versions-demo.html +21 -8
  47. package/dist/demo/npm-versions.html +54 -25
  48. package/dist/demo/s.xml +11 -21
  49. package/dist/demo/s.xslt +16 -74
  50. package/dist/demo/s1.xslt +59 -59
  51. package/dist/demo/ss.html +24 -57
  52. package/dist/demo/z.html +33 -62
  53. package/dist/demo/z.xml +59 -59
  54. package/dist/demo/z1.html +34 -0
  55. package/dist/local-storage-78EivJ_B.cjs +1 -0
  56. package/dist/local-storage-DzmNKzgN.js +66 -0
  57. package/dist/mockServiceWorker.js +1 -1
  58. package/package.json +27 -25
  59. package/public/demo/a.svg +27 -0
  60. package/public/demo/demo.css +6 -7
  61. package/public/demo/external-template.html +3 -3
  62. package/public/demo/npm-versions-demo.html +21 -8
  63. package/public/demo/npm-versions.html +54 -25
  64. package/public/demo/s.xml +11 -21
  65. package/public/demo/s.xslt +16 -74
  66. package/public/demo/s1.xslt +59 -59
  67. package/public/demo/ss.html +24 -57
  68. package/public/demo/z.html +33 -62
  69. package/public/demo/z.xml +59 -59
  70. package/public/demo/z1.html +34 -0
  71. package/public/mockServiceWorker.js +1 -1
  72. package/src/custom-element/custom-element.js +123 -29
  73. package/src/custom-element/demo/a.svg +27 -0
  74. package/src/custom-element/demo/demo.css +6 -7
  75. package/src/custom-element/demo/external-template.html +3 -3
  76. package/src/custom-element/demo/npm-versions-demo.html +21 -8
  77. package/src/custom-element/demo/npm-versions.html +54 -25
  78. package/src/custom-element/demo/s.xml +11 -21
  79. package/src/custom-element/demo/s.xslt +16 -74
  80. package/src/custom-element/demo/s1.xslt +59 -59
  81. package/src/custom-element/demo/ss.html +24 -57
  82. package/src/custom-element/demo/z.html +33 -62
  83. package/src/custom-element/demo/z.xml +59 -59
  84. package/src/custom-element/demo/z1.html +34 -0
  85. package/src/custom-element/ide/web-types-dce.json +1 -1
  86. package/src/custom-element/ide/web-types-xsl.json +1 -1
  87. package/src/custom-element/index.html +19 -2
  88. package/src/custom-element/local-storage.js +19 -14
  89. package/src/custom-element/module-url.js +3 -2
  90. package/src/dce-social-preview.png +0 -0
  91. package/src/material/angular.css +987 -0
  92. package/src/material/components/autocomplete.html +241 -0
  93. package/src/material/components/dropdown.html +115 -0
  94. package/src/material/components/menu.html +235 -0
  95. package/src/material/components.html +109 -0
  96. package/src/material/demo.css +31 -0
  97. package/src/material/index.html +169 -0
  98. package/src/material/material.css +357 -0
  99. package/src/material/theme/README.md +18 -0
  100. package/src/material/theme/semantic.css +112 -0
  101. package/src/mocks/versions.mock.ts +8 -8
  102. package/src/stories/__screenshots__/http-request.test.ts/http-request-url-change-1.png +0 -0
  103. package/src/stories/attributes.test.stories.ts +6 -4
  104. package/src/stories/css.test.stories.ts +2 -0
  105. package/src/stories/dom-merge.test.stories.ts +11 -9
  106. package/src/stories/external-template.test.stories.ts +4 -3
  107. package/src/stories/form.test.stories.ts +2 -0
  108. package/src/stories/local-storage.test.stories.ts +63 -53
  109. package/src/stories/location-element.test.stories.ts +2 -0
  110. package/src/stories/module-url.test.stories.ts +2 -0
  111. package/src/stories/set-url.test.stories.ts +2 -0
  112. package/src/stories/slice-events.test.stories.ts +2 -0
  113. package/src/stories/slots.test.stories.ts +2 -0
  114. package/src/stories/version-select.test.stories.ts +2 -0
  115. package/src/sum.test.ts +5 -5
  116. package/src/sum.ts +3 -3
  117. package/storybook-static/assets/Color-ERTF36HU-ChyYtq0t.js +1 -0
  118. package/storybook-static/assets/Configure-CJVwFVjC.js +165 -0
  119. package/storybook-static/assets/DocsRenderer-CFRXHY34-Bz6q-OqD.js +2 -0
  120. package/storybook-static/assets/{attributes.test.stories-DIQXccHc.js → attributes.test.stories-BJBuuXgZ.js} +13 -14
  121. package/storybook-static/assets/{css.test.stories-BV2hi4CY.js → css.test.stories-pgbBc17d.js} +1 -1
  122. package/storybook-static/assets/custom-element-BDGsYgbP.js +97 -0
  123. package/storybook-static/assets/{dom-merge.test.stories-Dws0C2-g.js → dom-merge.test.stories-CXcYP_-J.js} +26 -24
  124. package/storybook-static/assets/entry-preview-C313OLrj.js +26 -0
  125. package/storybook-static/assets/{entry-preview-docs-BMKNVQXA.js → entry-preview-docs-B7ORr9w5.js} +2 -2
  126. package/storybook-static/assets/{external-template.test.stories-BHO48b0j.js → external-template.test.stories-CpJ68Ghy.js} +19 -20
  127. package/storybook-static/assets/{form.test.stories-dv9mwp24.js → form.test.stories-D35lyqd8.js} +2 -2
  128. package/storybook-static/assets/{handlers-CaCq2ZPF.js → handlers-B-OZtf2K.js} +13 -13
  129. package/storybook-static/assets/{http-request.stories-B2ke7LtS.js → http-request.stories-DccXgHyF.js} +6 -6
  130. package/storybook-static/assets/iframe-Ddc_axoC.js +2 -0
  131. package/storybook-static/assets/index-BSz1w4Gl.js +234 -0
  132. package/storybook-static/assets/index-BdcJ-iJ7.js +8 -0
  133. package/storybook-static/assets/index-CiCdFubk.js +634 -0
  134. package/storybook-static/assets/{index-Dz4OaB2k.js → index-f2MAjm2i.js} +1 -1
  135. package/storybook-static/assets/index-lY6s0fkU.js +1 -0
  136. package/storybook-static/assets/index-tfEkrhWr.js +1 -0
  137. package/storybook-static/assets/local-storage.test.stories-BY-PWhuk.js +420 -0
  138. package/storybook-static/assets/{location-element.test.stories-BiFvBop7.js → location-element.test.stories-3auBYEaU.js} +3 -3
  139. package/storybook-static/assets/{module-url.test.stories-BXoM34tX.js → module-url.test.stories-B7L9cL60.js} +6 -6
  140. package/storybook-static/assets/{preview-0Jj89qip.js → preview-BRPR-UXC.js} +1 -1
  141. package/storybook-static/assets/preview-BUQm51_C.js +52 -0
  142. package/storybook-static/assets/{preview-DB9FwMii.js → preview-BWzBA1C2.js} +1 -1
  143. package/storybook-static/assets/preview-BhhEZcNS.js +1 -0
  144. package/storybook-static/assets/preview-CcS4DQh8.js +1 -0
  145. package/storybook-static/assets/{preview-Cg7hXPRq.js → preview-CfH4_OzN.js} +2 -2
  146. package/storybook-static/assets/{preview-FpHGYA1q.js → preview-DHPc-V4N.js} +1 -1
  147. package/storybook-static/assets/preview-DYzi3Z2p.js +1 -0
  148. package/storybook-static/assets/{preview-4Up_z4Em.js → preview-caVMbCIR.js} +2 -2
  149. package/storybook-static/assets/preview-ncvtW_hb.js +34 -0
  150. package/storybook-static/assets/{set-url.test.stories-Cg5Z0r7x.js → set-url.test.stories-CuSuDLIx.js} +3 -3
  151. package/storybook-static/assets/{slice-events.test.stories-D_ttGp3g.js → slice-events.test.stories-BkRKsKem.js} +4 -4
  152. package/storybook-static/assets/{slots.test.stories-DBNXOm0T.js → slots.test.stories-BJCUWFkE.js} +8 -8
  153. package/storybook-static/assets/{version-select.test.stories-CgV3UCim.js → version-select.test.stories-B3ybJn_Z.js} +2 -2
  154. package/storybook-static/demo/a.svg +27 -0
  155. package/storybook-static/demo/demo.css +6 -7
  156. package/storybook-static/demo/external-template.html +3 -3
  157. package/storybook-static/demo/npm-versions-demo.html +21 -8
  158. package/storybook-static/demo/npm-versions.html +54 -25
  159. package/storybook-static/demo/s.xml +11 -21
  160. package/storybook-static/demo/s.xslt +16 -74
  161. package/storybook-static/demo/s1.xslt +59 -59
  162. package/storybook-static/demo/ss.html +24 -57
  163. package/storybook-static/demo/z.html +33 -62
  164. package/storybook-static/demo/z.xml +59 -59
  165. package/storybook-static/demo/z1.html +34 -0
  166. package/storybook-static/iframe.html +1 -1
  167. package/storybook-static/index.html +3 -7
  168. package/storybook-static/mockServiceWorker.js +1 -1
  169. package/storybook-static/project.json +1 -1
  170. package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +1 -1
  171. package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +9 -9
  172. package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +76 -94
  173. package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +1 -1
  174. package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +1 -1
  175. package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +1 -1
  176. package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +1 -1
  177. package/storybook-static/sb-addons/interactions-9/manager-bundle.js +211 -0
  178. package/storybook-static/sb-addons/interactions-9/manager-bundle.js.LEGAL.txt +0 -0
  179. package/storybook-static/sb-manager/globals-module-info.js +11 -0
  180. package/storybook-static/sb-manager/globals-runtime.js +27803 -26928
  181. package/storybook-static/sb-manager/runtime.js +10341 -10136
  182. package/storybook-static/sb-preview/runtime.js +3841 -3828
  183. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  184. package/.idea/compiler.xml +0 -6
  185. package/.idea/custom-element-dist.iml +0 -13
  186. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  187. package/.idea/misc.xml +0 -6
  188. package/.idea/modules.xml +0 -8
  189. package/.idea/vcs.xml +0 -6
  190. package/.vscode/settings.json +0 -24
  191. package/dist/custom-element-CckoVsvO.cjs +0 -53
  192. package/dist/custom-element-b7c_7Kz4.js +0 -485
  193. package/dist/local-storage-Boafngui.cjs +0 -1
  194. package/dist/local-storage-BqDEu2kF.js +0 -59
  195. package/storybook-static/assets/Color-KGDBMAHA-CH-YyWYq.js +0 -1
  196. package/storybook-static/assets/Configure-DFL_bm2M.js +0 -173
  197. package/storybook-static/assets/DocsRenderer-PKQXORMH-Bz-_1hmS.js +0 -2
  198. package/storybook-static/assets/custom-element-wn23PUwN.js +0 -231
  199. package/storybook-static/assets/entry-preview-BKQ8UCxI.js +0 -8
  200. package/storybook-static/assets/iframe-D4Sos1HO.js +0 -2
  201. package/storybook-static/assets/index-BnXBQqj9.js +0 -605
  202. package/storybook-static/assets/index-C8k3Z-3Y.js +0 -28
  203. package/storybook-static/assets/index-Cpxqn5iQ.js +0 -1
  204. package/storybook-static/assets/index-DGdNYaqV.js +0 -8
  205. package/storybook-static/assets/index-sm7QlJZE.js +0 -1
  206. package/storybook-static/assets/lit-element-DzhCn-8W.js +0 -19
  207. package/storybook-static/assets/local-storage.test.stories-BpogLNq-.js +0 -419
  208. package/storybook-static/assets/preview-BJPLiuSt.js +0 -1
  209. package/storybook-static/assets/preview-BMWqy4Bi.js +0 -1
  210. package/storybook-static/assets/preview-BnWGZYux.js +0 -1
  211. package/storybook-static/assets/preview-Djh1_Tal.js +0 -20
  212. package/storybook-static/assets/preview-oHxXRSIu.js +0 -48
  213. package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js +0 -333
  214. package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js.LEGAL.txt +0 -40
  215. package/storybook-static/sb-addons/interactions-10/manager-bundle.js +0 -234
  216. /package/{storybook-static/sb-addons/interactions-10/manager-bundle.js.LEGAL.txt → src/material/guide/getting-started/index.html} +0 -0
@@ -1,62 +1,33 @@
1
- <dce-root xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml"
2
- xmlns:dce="urn:schemas-epa-wg:dce" data-dce-id="1">
3
- <location-element xmlns="" slice="window-url" live="" data-dce-id="2"></location-element>
4
- <table xmlns="" data-dce-id="3">
5
- <tbody data-dce-id="0-1">
6
- <tr data-dce-id="4">
7
- <th data-dce-id="5"><h3 data-dce-id="6"> URL properties </h3></th>
8
- <td data-dce-id="7">9</td>
9
- </tr>
10
- <tr data-dce-id="10">
11
- <th data-dce-id="11">href</th>
12
- <td data-dce-id="12">http://localhost:63342/custom-element/demo/a.html?_ijt=dmv0p4go000q47lg48i5im92f7&amp;_ij_reload=RELOAD_ON_SAVE</td>
13
- </tr>
14
- <tr data-dce-id="10-1">
15
- <th data-dce-id="11">origin</th>
16
- <td data-dce-id="12">http://localhost:63342</td>
17
- </tr>
18
- <tr data-dce-id="10-2">
19
- <th data-dce-id="11">protocol</th>
20
- <td data-dce-id="12">http:</td>
21
- </tr>
22
- <tr data-dce-id="10-3">
23
- <th data-dce-id="11">host</th>
24
- <td data-dce-id="12">localhost:63342</td>
25
- </tr>
26
- <tr data-dce-id="10-4">
27
- <th data-dce-id="11">hostname</th>
28
- <td data-dce-id="12">localhost</td>
29
- </tr>
30
- <tr data-dce-id="10-5">
31
- <th data-dce-id="11">port</th>
32
- <td data-dce-id="12">63342</td>
33
- </tr>
34
- <tr data-dce-id="10-6">
35
- <th data-dce-id="11">pathname</th>
36
- <td data-dce-id="12">/custom-element/demo/a.html</td>
37
- </tr>
38
- <tr data-dce-id="10-7">
39
- <th data-dce-id="11">search</th>
40
- <td data-dce-id="12">?_ijt=dmv0p4go000q47lg48i5im92f7&amp;_ij_reload=RELOAD_ON_SAVE</td>
41
- </tr>
42
- <tr data-dce-id="10-8">
43
- <th data-dce-id="11">hash</th>
44
- <td data-dce-id="12"></td>
45
- </tr>
46
- </tbody>
47
- </table>
48
- <h3 data-dce-id="9"> URL parameters </h3>
49
- <table xmlns="" data-dce-id="8">
50
-
51
- <tbody data-dce-id="0-1">
52
- <tr data-dce-id="10">
53
- <th data-dce-id="11">_ijt</th>
54
- <td data-dce-id="12">dmv0p4go000q47lg48i5im92f7</td>
55
- </tr>
56
- <tr data-dce-id="10-1">
57
- <th data-dce-id="11">_ij_reload</th>
58
- <td data-dce-id="12">RELOAD_ON_SAVE</td>
59
- </tr>
60
- </tbody>
61
- </table>
62
- </dce-root>
1
+ <!DOCTYPE html>
2
+ <html lang="en" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5
+ <title>DOM merge - Declarative Custom Element implementation demo</title>
6
+ <link rel="icon" href="./wc-square.svg"/>
7
+ <script type="importmap">
8
+ {
9
+ "imports": {
10
+ "@epa-wg/custom-element/": "../",
11
+ "@epa-wg/custom-element-dist/": "../"
12
+ }
13
+ }
14
+ </script>
15
+ <script type="module" src="../http-request.js"></script>
16
+ <script type="module" src="../location-element.js"></script>
17
+ <script type="module" src="../custom-element.js"></script>
18
+ <style>
19
+ @import "./demo.css";
20
+ dt{ font-weight: bold}
21
+ dd{ padding: 0;}
22
+ h1,h3{ margin: 0;}
23
+ nav{ gap:0; }
24
+ </style>
25
+ </head>
26
+ <body>
27
+
28
+ <custom-element src="./html-template.html#dwc-logo">
29
+ <template><i>loading SVG from templates file ...</i></template>
30
+ </custom-element>
31
+
32
+ </body>
33
+ </html>
@@ -1,60 +1,60 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <dce-root data-dce-id="1" xmlns:dce="urn:schemas-epa-wg:dce" xmlns:xhtml="http://www.w3.org/1999/xhtml">
3
- <location-element slice="window-url" data-dce-id="2"/>
4
- <table data-dce-id="3">
5
- <tr data-dce-id="4">
6
- <th data-dce-id="5">
7
- <u data-dce-id="6">URL properties</u>
8
- </th>
9
- </tr>
10
- <tr data-dce-id="7">
11
- <th data-dce-id="8">href</th>
12
- <td data-dce-id="9">http://localhost:63342/custom-element/demo/a.html?_ijt=qca6trk5kne6eo4s4tomq4egmm&amp;_ij_reload=RELOAD_ON_SAVE</td>
13
- </tr>
14
- <tr data-dce-id="7">
15
- <th data-dce-id="8">origin</th>
16
- <td data-dce-id="9">http://localhost:63342</td>
17
- </tr>
18
- <tr data-dce-id="7">
19
- <th data-dce-id="8">protocol</th>
20
- <td data-dce-id="9">http:</td>
21
- </tr>
22
- <tr data-dce-id="7">
23
- <th data-dce-id="8">host</th>
24
- <td data-dce-id="9">localhost:63342</td>
25
- </tr>
26
- <tr data-dce-id="7">
27
- <th data-dce-id="8">hostname</th>
28
- <td data-dce-id="9">localhost</td>
29
- </tr>
30
- <tr data-dce-id="7">
31
- <th data-dce-id="8">port</th>
32
- <td data-dce-id="9">63342</td>
33
- </tr>
34
- <tr data-dce-id="7">
35
- <th data-dce-id="8">pathname</th>
36
- <td data-dce-id="9">/custom-element/demo/a.html</td>
37
- </tr>
38
- <tr data-dce-id="7">
39
- <th data-dce-id="8">search</th>
40
- <td data-dce-id="9">?_ijt=qca6trk5kne6eo4s4tomq4egmm&amp;_ij_reload=RELOAD_ON_SAVE</td>
41
- </tr>
42
- <tr data-dce-id="7">
43
- <th data-dce-id="8">hash</th>
44
- <td data-dce-id="9"/>
45
- </tr>
46
- <tr data-dce-id="10">
47
- <th data-dce-id="11">
48
- <u data-dce-id="12">URL parameters</u>
49
- </th>
50
- </tr>
51
- <tr data-dce-id="13">
52
- <th data-dce-id="14">_ijt</th>
53
- <td data-dce-id="15">qca6trk5kne6eo4s4tomq4egmm</td>
54
- </tr>
55
- <tr data-dce-id="13">
56
- <th data-dce-id="14">_ij_reload</th>
57
- <td data-dce-id="15">RELOAD_ON_SAVE</td>
58
- </tr>
59
- </table>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <dce-root data-dce-id="1" xmlns:dce="urn:schemas-epa-wg:dce" xmlns:xhtml="http://www.w3.org/1999/xhtml">
3
+ <location-element slice="window-url" data-dce-id="2"/>
4
+ <table data-dce-id="3">
5
+ <tr data-dce-id="4">
6
+ <th data-dce-id="5">
7
+ <u data-dce-id="6">URL properties</u>
8
+ </th>
9
+ </tr>
10
+ <tr data-dce-id="7">
11
+ <th data-dce-id="8">href</th>
12
+ <td data-dce-id="9">http://localhost:63342/custom-element/demo/a.html?_ijt=qca6trk5kne6eo4s4tomq4egmm&amp;_ij_reload=RELOAD_ON_SAVE</td>
13
+ </tr>
14
+ <tr data-dce-id="7">
15
+ <th data-dce-id="8">origin</th>
16
+ <td data-dce-id="9">http://localhost:63342</td>
17
+ </tr>
18
+ <tr data-dce-id="7">
19
+ <th data-dce-id="8">protocol</th>
20
+ <td data-dce-id="9">http:</td>
21
+ </tr>
22
+ <tr data-dce-id="7">
23
+ <th data-dce-id="8">host</th>
24
+ <td data-dce-id="9">localhost:63342</td>
25
+ </tr>
26
+ <tr data-dce-id="7">
27
+ <th data-dce-id="8">hostname</th>
28
+ <td data-dce-id="9">localhost</td>
29
+ </tr>
30
+ <tr data-dce-id="7">
31
+ <th data-dce-id="8">port</th>
32
+ <td data-dce-id="9">63342</td>
33
+ </tr>
34
+ <tr data-dce-id="7">
35
+ <th data-dce-id="8">pathname</th>
36
+ <td data-dce-id="9">/custom-element/demo/a.html</td>
37
+ </tr>
38
+ <tr data-dce-id="7">
39
+ <th data-dce-id="8">search</th>
40
+ <td data-dce-id="9">?_ijt=qca6trk5kne6eo4s4tomq4egmm&amp;_ij_reload=RELOAD_ON_SAVE</td>
41
+ </tr>
42
+ <tr data-dce-id="7">
43
+ <th data-dce-id="8">hash</th>
44
+ <td data-dce-id="9"/>
45
+ </tr>
46
+ <tr data-dce-id="10">
47
+ <th data-dce-id="11">
48
+ <u data-dce-id="12">URL parameters</u>
49
+ </th>
50
+ </tr>
51
+ <tr data-dce-id="13">
52
+ <th data-dce-id="14">_ijt</th>
53
+ <td data-dce-id="15">qca6trk5kne6eo4s4tomq4egmm</td>
54
+ </tr>
55
+ <tr data-dce-id="13">
56
+ <th data-dce-id="14">_ij_reload</th>
57
+ <td data-dce-id="15">RELOAD_ON_SAVE</td>
58
+ </tr>
59
+ </table>
60
60
  </dce-root>
@@ -0,0 +1,34 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5
+ <title>DOM merge - Declarative Custom Element implementation demo</title>
6
+ <link rel="icon" href="./wc-square.svg"/>
7
+ <script type="importmap">
8
+ {
9
+ "imports": {
10
+ "@epa-wg/custom-element/": "../",
11
+ "@epa-wg/custom-element-dist/": "../"
12
+ }
13
+ }
14
+ </script>
15
+ <script type="module" src="../http-request.js"></script>
16
+ <script type="module" src="../location-element.js"></script>
17
+ <script type="module" src="../custom-element.js"></script>
18
+ <style>
19
+ @import "./demo.css";
20
+ dt{ font-weight: bold}
21
+ dd{ padding: 0;}
22
+ h1,h3{ margin: 0;}
23
+ nav{ gap:0; }
24
+ </style>
25
+ </head>
26
+ <body>
27
+ <button onclick="window.location.hash = `#@epa-wg/custom-element-dist@0.0.27/storybook-static/index.html`">set in page URL</button>
28
+
29
+ <custom-element src="@epa-wg/custom-element-dist/demo/npm-versions.html#npm-version"
30
+ package-name="@epa-wg/custom-element-dist"
31
+ ></custom-element>
32
+
33
+ </body>
34
+ </html>
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json.schemastore.org/web-types",
3
3
  "name": "@epa-wg/custom-element",
4
- "version": "0.0.26",
4
+ "version": "0.0.28",
5
5
  "js-types-syntax": "typescript",
6
6
  "description-markup": "markdown",
7
7
  "contributions": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "http://json.schemastore.org/web-types",
3
3
  "name": "@epa-wg/custom-element",
4
- "version": "0.0.26",
4
+ "version": "0.0.28",
5
5
  "js-types-syntax": "typescript",
6
6
  "description-markup": "markdown",
7
7
  "contributions": {
@@ -4,7 +4,17 @@
4
4
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5
5
  <title>custom-element Declarative Custom Element implementation demo</title>
6
6
  <link rel="icon" href="demo/wc-square.svg" />
7
- <script type="module" src="custom-element.js"></script>
7
+ <script type="importmap">
8
+ {
9
+ "imports": {
10
+ "@epa-wg/custom-element/": "./",
11
+ "@epa-wg/custom-element-dist/": "./"
12
+ }
13
+ }
14
+ </script>
15
+ <script type="module" src="./http-request.js"></script>
16
+ <script type="module" src="./location-element.js"></script>
17
+ <script type="module" src="./custom-element.js"></script>
8
18
  <style>
9
19
  @import "demo/demo.css";
10
20
  </style>
@@ -18,6 +28,12 @@
18
28
  | <a href="https://stackblitz.com/github/EPA-WG/custom-element?file=index.html">Sandbox</a>
19
29
  | <a href="https://chrome.google.com/webstore/detail/epa-wgcustom-element/hiofgpmmkdembdogjpagmbbbmefefhbl"
20
30
  >Chrome devtools plugin</a>
31
+ | <custom-element src="@epa-wg/custom-element/demo/npm-versions.html#npm-version-to-url"
32
+ slice="selected" package-name="@epa-wg/custom-element">
33
+ <i slot="label">version:</i>
34
+ </custom-element>
35
+
36
+
21
37
  </div>
22
38
  <p>
23
39
  This <em>Declarative Custom Element</em> allows to define<br/>
@@ -38,7 +54,8 @@
38
54
  <a href="./demo/parameters.html" >attributes </a> |
39
55
  <a href="./demo/data-slices.html" >data slices/events </a> |
40
56
  <a href="./demo/form.html" >Form validation </a> |
41
- <a href="./demo/dom-merge.html" >DOM merge on dynamic update </a>
57
+ <a href="./demo/dom-merge.html" >DOM merge on dynamic update </a><br/>
58
+ <a href="./demo/npm-versions-demo.html">npm version </a>
42
59
  </section>
43
60
  </nav>
44
61
  <html-demo-element legend="1. simple payload"
@@ -21,29 +21,34 @@ const string2value = (type, v) =>
21
21
 
22
22
  let originalSetItem,originalRemoveItem,originalClear;
23
23
 
24
+ export function localStorage_setItem( key, value )
25
+ { originalSetItem.call(localStorage, key, value);
26
+ window.dispatchEvent( new CustomEvent('local-storage',{detail:{key,value}}) );
27
+ }
28
+ export function localStorage_removeItem( key )
29
+ { originalRemoveItem.call(localStorage, key);
30
+ window.dispatchEvent( new CustomEvent('local-storage',{detail:{key}}) );
31
+ }
32
+
33
+ export function localStorage_clear()
34
+ { originalClear.call(localStorage);
35
+ window.dispatchEvent( new CustomEvent('local-storage',{detail:{}}) );
36
+ }
37
+
24
38
  function ensureTrackLocalStorage()
25
39
  { if( originalSetItem )
26
40
  return;
27
41
  originalSetItem = localStorage.setItem;
28
- localStorage.setItem = function( key, value, ...rest )
29
- { originalSetItem.apply(this, [ key, value, ...rest ]);
30
- window.dispatchEvent( new CustomEvent('local-storage',{detail:{key,value}}) );
31
- };
42
+ localStorage.setItem = localStorage_setItem;
32
43
  originalRemoveItem = localStorage.removeItem;
33
- localStorage.removeItem = function( key, ...rest )
34
- { originalRemoveItem.apply(this, [ key, ...rest ]);
35
- window.dispatchEvent( new CustomEvent('local-storage',{detail:{key}}) );
36
- };
44
+ localStorage.removeItem = localStorage_removeItem;
37
45
  originalClear = localStorage.clear;
38
- localStorage.clear = function( ...rest )
39
- { originalClear.apply(this, [ ...rest ]);
40
- window.dispatchEvent( new CustomEvent('local-storage',{detail:{}}) );
41
- };
46
+ localStorage.clear = localStorage_clear;
42
47
  }
48
+ ensureTrackLocalStorage();
43
49
 
44
50
  export function localStorageSetItem(key, value)
45
- { localStorage.setItem(key, value);
46
- window.dispatchEvent( new CustomEvent('local-storage',{detail:{key,value}}) );
51
+ { localStorage_setItem(key, value);
47
52
  }
48
53
  export class LocalStorageElement extends HTMLElement
49
54
  {
@@ -10,9 +10,10 @@ export class ModuleUrl extends HTMLElement
10
10
 
11
11
  sliceInit()
12
12
  { let path = attr(this,'src');
13
+
13
14
  try
14
15
  { const url = '.' === path.charAt(0)
15
- ? new URL(path, this.closest('[base]')?.getAttribute('base') ).href
16
+ ? new URL(path, this.closest('[base]')?.getAttribute('base') || location.href).href
16
17
  : import.meta.resolve(path);
17
18
  this.setAttribute('value',this.value = url );
18
19
  }catch( er )
@@ -30,4 +31,4 @@ export class ModuleUrl extends HTMLElement
30
31
  }
31
32
 
32
33
  window.customElements.define( 'module-url', ModuleUrl );
33
- export default ModuleUrl;
34
+ export default ModuleUrl;
Binary file