@epa-wg/custom-element-dist 0.0.32 → 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +18 -0
- package/.github/workflows/deploy.yml +59 -0
- package/.idea/copilot.data.migration.agent.xml +6 -0
- package/.idea/copilot.data.migration.ask.xml +6 -0
- package/.idea/copilot.data.migration.edit.xml +6 -0
- package/.idea/custom-element-dist.iml +2 -0
- package/.storybook/main.ts +20 -21
- package/.storybook/preview.ts +23 -25
- package/README.md +6 -4
- package/coverage/block-navigation.js +1 -1
- package/coverage/coverage-final.json +8 -18
- package/coverage/index.html +45 -30
- package/coverage/sorter.js +21 -7
- package/coverage/src/custom-element/coverage.svg +1 -1
- package/coverage/src/custom-element/custom-element.js/coverage.svg +1 -1
- package/coverage/src/custom-element/custom-element.js.html +687 -480
- package/coverage/src/custom-element/http-request.js/coverage.svg +1 -1
- package/coverage/src/custom-element/http-request.js.html +39 -18
- package/coverage/src/custom-element/index.html +35 -35
- package/coverage/src/custom-element/local-storage.js.html +1 -1
- package/coverage/src/custom-element/location-element.js.html +31 -31
- package/coverage/src/custom-element/module-url.js/coverage.svg +1 -1
- package/coverage/src/custom-element/module-url.js.html +20 -20
- package/coverage/src/index.html +1 -1
- package/coverage/src/{stories/local-storage.test.stories.ts → material/theme/colors.js}/coverage.svg +1 -1
- package/coverage/src/material/theme/colors.js.html +217 -0
- package/coverage/src/{stories/location-element.test.stories.ts → material/theme}/coverage.svg +1 -1
- package/coverage/src/material/theme/index.html +116 -0
- package/coverage/src/mocks/handlers.ts.html +1 -1
- package/coverage/src/mocks/index.html +1 -1
- package/coverage/src/stories/coverage.svg +1 -1
- package/coverage/src/stories/{external-template.test.stories.ts → frame.canvas.ts}/coverage.svg +1 -1
- package/coverage/src/stories/frame.canvas.ts.html +175 -0
- package/coverage/src/stories/http-request.stories.ts.html +1 -1
- package/coverage/src/stories/index.html +14 -179
- package/coverage/src/stories/testStoryBook.ts.html +12 -12
- package/coverage/src/sum.ts.html +1 -1
- package/dist/custom-element-BoYMoUtP.js +619 -0
- package/dist/custom-element-BqtjrCRF.cjs +97 -0
- package/dist/custom-element-bundle.cjs +1 -1
- package/dist/custom-element-bundle.js +3 -3
- package/dist/demo/a.html +10 -3
- package/dist/demo/a.svg +26 -26
- package/dist/demo/attributes.html +153 -0
- package/dist/demo/external-templates-sb-6.html +42 -0
- package/dist/demo/external-templates-sb-7.html +42 -0
- package/dist/demo/html-template.html +5 -4
- package/dist/demo/module-url-sb-2.html +46 -0
- package/dist/demo/module-url-sb-4.html +48 -0
- package/dist/demo/module-url-sb-5.html +53 -0
- package/dist/demo/s.xml +3859 -7
- package/dist/demo/s.xslt +13 -48
- package/dist/demo/s1.xml +3706 -0
- package/dist/demo/ss.html +13 -4
- package/dist/http-request-DSaowcG1.cjs +1 -0
- package/dist/{http-request-BOvP4KTl.js → http-request-DTCzZ1gc.js} +15 -9
- package/dist/mockServiceWorker.js +31 -8
- package/package.json +25 -26
- package/public/demo/a.html +10 -3
- package/public/demo/a.svg +26 -26
- package/public/demo/attributes.html +153 -0
- package/public/demo/external-templates-sb-6.html +42 -0
- package/public/demo/external-templates-sb-7.html +42 -0
- package/public/demo/html-template.html +5 -4
- package/public/demo/module-url-sb-2.html +46 -0
- package/public/demo/module-url-sb-4.html +48 -0
- package/public/demo/module-url-sb-5.html +53 -0
- package/public/demo/s.xml +3859 -7
- package/public/demo/s.xslt +13 -48
- package/public/demo/s1.xml +3706 -0
- package/public/demo/ss.html +13 -4
- package/public/mockServiceWorker.js +31 -8
- package/src/custom-element/custom-element.d.ts +4 -0
- package/src/custom-element/custom-element.js +119 -50
- package/src/custom-element/demo/a.html +10 -3
- package/src/custom-element/demo/a.svg +26 -26
- package/src/custom-element/demo/attributes.html +153 -0
- package/src/custom-element/demo/html-template.html +5 -4
- package/src/custom-element/demo/s.xml +3859 -7
- package/src/custom-element/demo/s.xslt +13 -48
- package/src/custom-element/demo/s1.xml +3706 -0
- package/src/custom-element/demo/ss.html +13 -4
- package/src/custom-element/http-request.js +7 -0
- package/src/custom-element/ide/web-types-dce.json +1 -1
- package/src/custom-element/ide/web-types-xsl.json +1 -1
- package/src/custom-element/index.html +1 -1
- package/src/material/angular.css +987 -987
- package/src/material/components/action.html +262 -0
- package/src/material/components/autocomplete.html +167 -239
- package/src/material/components/badge.html +239 -0
- package/src/material/components/dropdown.html +7 -13
- package/src/material/components/icon-link.html +160 -160
- package/src/material/components/icon.html +252 -0
- package/src/material/components/input.html +569 -362
- package/src/material/components/menu.html +235 -234
- package/src/material/components.html +157 -121
- package/src/material/demo.css +36 -36
- package/src/material/index.html +109 -110
- package/src/material/material.css +356 -356
- package/src/material/theme/Base-Principles.md +339 -0
- package/src/material/theme/README.md +298 -18
- package/src/material/theme/UI Domain Model in web applications.svg +1 -0
- package/src/material/theme/User Semantic Theme tokens.svg +1 -0
- package/src/material/theme/action-pending-poc.html +62 -0
- package/src/material/theme/actions-color.html +141 -0
- package/src/material/theme/colors-light.html +631 -0
- package/src/material/theme/colors-native.html +51 -0
- package/src/material/theme/colors-poc.html +66 -0
- package/src/material/theme/colors.html +297 -0
- package/src/material/theme/colors.js +44 -0
- package/src/material/theme/consumer-theme.css +745 -0
- package/src/material/theme/semantic.css +132 -113
- package/src/material/theme/style-bug.html +123 -0
- package/src/material/theme/theme-data.css +43 -0
- package/src/material/theme/theme-data.xhtml +2926 -0
- package/src/material/theme/todo.md +274 -0
- package/src/material/theme/tokens/action-colors.png +0 -0
- package/src/material/theme/tokens/cem-article-illustration-4x1-letterbox-2000x500.png +0 -0
- package/src/material/theme/tokens/cem-breakpoints.md +519 -0
- package/src/material/theme/tokens/cem-colors.md +715 -0
- package/src/material/theme/tokens/cem-consumerflow-typography-matrix.svg +198 -0
- package/src/material/theme/tokens/cem-coupling.md +372 -0
- package/src/material/theme/tokens/cem-data-vs-reading-numerals.svg +164 -0
- package/src/material/theme/tokens/cem-dimension.md +625 -0
- package/src/material/theme/tokens/cem-layering.md +562 -0
- package/src/material/theme/tokens/cem-m3-parity.md +343 -0
- package/src/material/theme/tokens/cem-responsive.md +238 -0
- package/src/material/theme/tokens/cem-shape.md +691 -0
- package/src/material/theme/tokens/cem-stroke-density-illustration-4to1-v3.svg +102 -0
- package/src/material/theme/tokens/cem-stroke.md +480 -0
- package/src/material/theme/tokens/cem-timing.md +198 -0
- package/src/material/theme/tokens/cem-typography-model-stack.svg +64 -0
- package/src/material/theme/tokens/cem-voice-fonts-typography.md +718 -0
- package/src/material/theme/tokens/cem-voice-ladder.svg +91 -0
- package/src/material/theme/tokens/chips.png +0 -0
- package/src/material/theme/tokens/columns-page.png +0 -0
- package/src/material/theme/tokens/initials.png +0 -0
- package/src/material/theme/tokens/nav-buttons.png +0 -0
- package/src/material/theme/tokens/script.png +0 -0
- package/src/material/theme/tokens/sufler.png +0 -0
- package/src/material/theme/tokens/typography-icons.png +0 -0
- package/src/mocks/versions.mock.ts +1 -1
- package/src/stories/__screenshots__/attributes.test.stories.ts +1 -0
- package/src/stories/__screenshots__/dom-merge.test.stories.ts/dom-merge-dom-merge-OrderPreservingOn2ndTransform-1.png +0 -0
- package/src/stories/__screenshots__/external-template.test.stories.ts +1 -0
- package/src/stories/__screenshots__/module-url.test.stories.ts +1 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Attributes-definition-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Attributes-runtime-change-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Instance-Attributes-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Instance-Attributes-2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-cloneAs-el-newTag--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---3.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mix-to-from--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Attributes-definition-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Attributes-runtime-change-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Instance-Attributes-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Instance-Attributes-2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-cloneAs-el-newTag--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-headers-and-response-status-and-headers-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-with-delayed--5-seconds-response-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-with-error-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---3.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mix-to-from--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-url-and-slice-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-url-change-1.png +0 -0
- package/src/stories/__screenshots__/xslt-conditionals.test.stories.ts/xslt-conditionals-xslt-conditionals-MultipleIfOrderingWorkaround-1.png +0 -0
- package/src/stories/attributes.test.stories.ts +83 -17
- package/src/stories/dom-merge.test.stories.ts +25 -1
- package/src/stories/external-template.test.stories.ts +16 -14
- package/src/stories/frame.canvas.ts +31 -0
- package/src/stories/module-url.test.stories.ts +29 -61
- package/src/stories/xslt-conditionals.test.stories.ts +492 -0
- package/src/stories/xslt-if.test.stories.ts +89 -0
- package/storybook-static/assets/Color-F6OSRLHC-CzTOSlqB.js +1 -0
- package/storybook-static/assets/Configure-7GqRsAoJ.js +165 -0
- package/storybook-static/assets/DocsRenderer-CFRXHY34-Duc5rSIm.js +2 -0
- package/storybook-static/assets/{attributes.test.stories-D1X6EBrd.js → attributes.test.stories-DYuxF8h1.js} +109 -38
- package/storybook-static/assets/{css.test.stories-Cp_g2hE1.js → css.test.stories-LOmvINyb.js} +1 -1
- package/storybook-static/assets/custom-element-Bwx7otrT.js +97 -0
- package/storybook-static/assets/{dom-merge.test.stories-hbpdCka0.js → dom-merge.test.stories-CEKhWjaS.js} +47 -6
- package/storybook-static/assets/entry-preview-BNCt9WBs.js +26 -0
- package/storybook-static/assets/entry-preview-docs-CbF8-81D.js +2 -0
- package/storybook-static/assets/{external-template.test.stories-BK89h6sk.js → external-template.test.stories-jHu0wsJ-.js} +38 -40
- package/storybook-static/assets/{form.test.stories-BfoLe_rw.js → form.test.stories-CUyUnmwP.js} +1 -1
- package/storybook-static/assets/frame.canvas-E5n9h6j1.js +1 -0
- package/storybook-static/assets/{handlers-yVPwH_Nz.js → handlers-F7GUfMqr.js} +17 -14
- package/storybook-static/assets/http-request-BWeEEBkP.js +1 -0
- package/storybook-static/assets/{http-request.stories-CBFJS2Ws.js → http-request.stories-wyX5-QOv.js} +1 -1
- package/storybook-static/assets/iframe-BS_DPWl0.js +199 -0
- package/storybook-static/assets/index-CGuyH0k-.js +240 -0
- package/storybook-static/assets/index-DB7LLObI.js +1 -0
- package/storybook-static/assets/index-DO1nmyvI.js +11 -0
- package/storybook-static/assets/index-V1EGs-wm.js +621 -0
- package/storybook-static/assets/{local-storage.test.stories-C0Yzy6Am.js → local-storage.test.stories-BxOhsf1k.js} +1 -1
- package/storybook-static/assets/{location-element.test.stories-DNFrEu5A.js → location-element.test.stories-DqhvvUoa.js} +1 -1
- package/storybook-static/assets/module-url.test.stories-C1gG9G7Y.js +142 -0
- package/storybook-static/assets/preview-1xJJ3sKE.js +1 -0
- package/storybook-static/assets/preview-Bn8igYMp.js +1 -0
- package/storybook-static/assets/preview-CTOeX_lO.js +1 -0
- package/storybook-static/assets/preview-Cwy1XFu2.js +2 -0
- package/storybook-static/assets/preview-D6sehqkw.js +50 -0
- package/storybook-static/assets/preview-DfTudP20.js +1 -0
- package/storybook-static/assets/{set-url.test.stories-BBfLxv2u.js → set-url.test.stories-BKQNdknJ.js} +1 -1
- package/storybook-static/assets/{slice-events.test.stories-HcXF8XQI.js → slice-events.test.stories-ChqULCeA.js} +1 -1
- package/storybook-static/assets/{slots.test.stories-i6mnIFM2.js → slots.test.stories-BlyLoCRe.js} +1 -1
- package/storybook-static/assets/{version-select.test.stories-BsUFH6Va.js → version-select.test.stories-CPGSh1tR.js} +1 -1
- package/storybook-static/assets/xslt-conditionals.test.stories-YC6QPqWZ.js +633 -0
- package/storybook-static/assets/xslt-if.test.stories-BRSWy2-x.js +71 -0
- package/storybook-static/demo/a.html +10 -3
- package/storybook-static/demo/a.svg +26 -26
- package/storybook-static/demo/attributes.html +153 -0
- package/storybook-static/demo/external-templates-sb-6.html +42 -0
- package/storybook-static/demo/external-templates-sb-7.html +42 -0
- package/storybook-static/demo/html-template.html +5 -4
- package/storybook-static/demo/module-url-sb-2.html +46 -0
- package/storybook-static/demo/module-url-sb-4.html +48 -0
- package/storybook-static/demo/module-url-sb-5.html +53 -0
- package/storybook-static/demo/s.xml +3859 -7
- package/storybook-static/demo/s.xslt +13 -48
- package/storybook-static/demo/s1.xml +3706 -0
- package/storybook-static/demo/ss.html +13 -4
- package/storybook-static/iframe.html +2 -2
- package/storybook-static/index.html +6 -10
- package/storybook-static/index.json +1 -1
- package/storybook-static/mockServiceWorker.js +31 -8
- package/storybook-static/project.json +1 -1
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +8 -8
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +394 -0
- package/storybook-static/sb-addons/essentials-docs-3/manager-bundle.js +233 -0
- package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/interactions-9/manager-bundle.js +58 -58
- package/storybook-static/sb-manager/globals-module-info.js +9 -0
- package/storybook-static/sb-manager/globals-runtime.js +10719 -10473
- package/storybook-static/sb-manager/runtime.js +4944 -6321
- package/coverage/src/stories/attributes.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/attributes.test.stories.ts.html +0 -814
- package/coverage/src/stories/css.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/css.test.stories.ts.html +0 -460
- package/coverage/src/stories/dom-merge.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/dom-merge.test.stories.ts.html +0 -706
- package/coverage/src/stories/external-template.test.stories.ts.html +0 -865
- package/coverage/src/stories/form.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/form.test.stories.ts.html +0 -661
- package/coverage/src/stories/local-storage.test.stories.ts.html +0 -1315
- package/coverage/src/stories/location-element.test.stories.ts.html +0 -523
- package/coverage/src/stories/module-url.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/module-url.test.stories.ts.html +0 -640
- package/coverage/src/stories/set-url.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/set-url.test.stories.ts.html +0 -433
- package/coverage/src/stories/slice-events.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/slice-events.test.stories.ts.html +0 -952
- package/coverage/src/stories/slots.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/slots.test.stories.ts.html +0 -742
- package/coverage/src/stories/version-select.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/version-select.test.stories.ts.html +0 -397
- package/dist/custom-element-D2wf_rqP.js +0 -576
- package/dist/custom-element-Dtzhbjkc.cjs +0 -97
- package/dist/http-request-DPrY7mGh.cjs +0 -1
- package/storybook-static/assets/Color-F6OSRLHC-BU3iy8jH.js +0 -1
- package/storybook-static/assets/Configure-DN6ifayP.js +0 -165
- package/storybook-static/assets/DocsRenderer-CFRXHY34-BaVEufDj.js +0 -2
- package/storybook-static/assets/custom-element-uuAtIYWS.js +0 -97
- package/storybook-static/assets/entry-preview-DHVXbf3x.js +0 -26
- package/storybook-static/assets/entry-preview-docs-BbcIMweR.js +0 -2
- package/storybook-static/assets/http-request-DNq59pnj.js +0 -1
- package/storybook-static/assets/iframe-CJEL_4Nu.js +0 -2
- package/storybook-static/assets/index-BcZLpTeD.js +0 -8
- package/storybook-static/assets/index-CxRwF5Or.js +0 -234
- package/storybook-static/assets/index-D-8MO0q_.js +0 -1
- package/storybook-static/assets/index-D5fBh-7N.js +0 -1
- package/storybook-static/assets/index-DM-KBPdl.js +0 -1
- package/storybook-static/assets/index-RSFf30w1.js +0 -1
- package/storybook-static/assets/index-SnjB5uV8.js +0 -769
- package/storybook-static/assets/module-url.test.stories-CXibF5Ta.js +0 -208
- package/storybook-static/assets/preview-BhhEZcNS.js +0 -1
- package/storybook-static/assets/preview-Bnd0XhaF.js +0 -52
- package/storybook-static/assets/preview-CNKoaWES.js +0 -1
- package/storybook-static/assets/preview-DAeyCMnM.js +0 -1
- package/storybook-static/assets/preview-DHPc-V4N.js +0 -1
- package/storybook-static/assets/preview-DJMlNTk8.js +0 -2
- package/storybook-static/assets/preview-DYzi3Z2p.js +0 -1
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +0 -333
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +0 -40
- package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +0 -391
- package/storybook-static/sb-addons/links-1/manager-bundle.js +0 -3
- package/storybook-static/sb-preview/globals.js +0 -33
- package/storybook-static/sb-preview/runtime.js +0 -7174
- package/test-runner-jest.config.js +0 -15
- /package/storybook-static/sb-addons/{essentials-actions-3 → essentials-actions-2}/manager-bundle.js.LEGAL.txt +0 -0
- /package/storybook-static/sb-addons/{essentials-controls-2 → essentials-controls-1}/manager-bundle.js.LEGAL.txt +0 -0
- /package/storybook-static/sb-addons/{links-1 → essentials-docs-3}/manager-bundle.js.LEGAL.txt +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="860" viewBox="0 0 1200 860" role="img" aria-label="Voice ladder: seven levels with ink thickness and speech prosody mappings">
|
|
3
|
+
<defs>
|
|
4
|
+
<style>
|
|
5
|
+
:root {
|
|
6
|
+
--cem-ink: #111;
|
|
7
|
+
--cem-surface: #fff;
|
|
8
|
+
--cem-outline: #c7c7c7;
|
|
9
|
+
--cem-muted: #666;
|
|
10
|
+
--cem-accent: #005a9c;
|
|
11
|
+
--cem-soft: #f6f7f9;
|
|
12
|
+
}
|
|
13
|
+
.frame { fill: var(--cem-surface); stroke: var(--cem-outline); stroke-width: 2; rx: 18; }
|
|
14
|
+
.step { fill: var(--cem-surface); stroke: var(--cem-outline); stroke-width: 1.8; rx: 18; }
|
|
15
|
+
.step-accent { fill: var(--cem-surface); stroke: var(--cem-accent); stroke-width: 2.4; rx: 18; }
|
|
16
|
+
.title { font: 700 32px system-ui, -apple-system, "Segoe UI", Arial, sans-serif; fill: var(--cem-ink); }
|
|
17
|
+
.muted { font: 400 16px system-ui, -apple-system, "Segoe UI", Arial, sans-serif; fill: var(--cem-muted); }
|
|
18
|
+
.h { font: 650 20px system-ui, -apple-system, "Segoe UI", Arial, sans-serif; fill: var(--cem-ink); }
|
|
19
|
+
.t { font: 400 16px system-ui, -apple-system, "Segoe UI", Arial, sans-serif; fill: var(--cem-ink); }
|
|
20
|
+
.mono { font: 550 15px ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; fill: var(--cem-muted); }
|
|
21
|
+
.pill { fill: var(--cem-soft); stroke: var(--cem-outline); stroke-width: 1.2; rx: 999; }
|
|
22
|
+
.pilltext { font: 650 13px ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; fill: var(--cem-accent); }
|
|
23
|
+
.colh { font: 650 16px system-ui, -apple-system, "Segoe UI", Arial, sans-serif; fill: var(--cem-muted); }
|
|
24
|
+
</style>
|
|
25
|
+
</defs>
|
|
26
|
+
|
|
27
|
+
<rect x="30" y="30" width="1140" height="800" class="frame"/>
|
|
28
|
+
|
|
29
|
+
<text x="70" y="92" class="title">Voice ladder (7 levels) with ink and speech projections</text>
|
|
30
|
+
<text x="70" y="125" class="muted">Use the same voice semantics across modalities. Map voice → ink thickness and voice → read‑aloud prosody.</text>
|
|
31
|
+
|
|
32
|
+
<text x="90" y="170" class="colh">Voice level</text>
|
|
33
|
+
<text x="340" y="170" class="colh">Ink projection</text>
|
|
34
|
+
<text x="690" y="170" class="colh">Speech projection (TTS)</text>
|
|
35
|
+
|
|
36
|
+
<rect x="70" y="195" width="1060" height="78" class="step"/>
|
|
37
|
+
<text x="90" y="225" class="h">whisper</text>
|
|
38
|
+
<rect x="90" y="238" width="150" height="24" class="pill"/><text x="102" y="255" class="pilltext">de-emphasize</text>
|
|
39
|
+
<text x="340" y="225" class="t">ink thickness:</text>
|
|
40
|
+
<text x="455" y="225" class="mono">var(--cem-thickness-x-light)</text>
|
|
41
|
+
<text x="690" y="225" class="t">rate / pitch / volume:</text>
|
|
42
|
+
<text x="865" y="225" class="mono">1.00 / 0.95 / 0.65</text>
|
|
43
|
+
|
|
44
|
+
<rect x="70" y="285" width="1060" height="78" class="step"/>
|
|
45
|
+
<text x="90" y="315" class="h">soft</text>
|
|
46
|
+
<rect x="90" y="328" width="120" height="24" class="pill"/><text x="102" y="345" class="pilltext">secondary</text>
|
|
47
|
+
<text x="340" y="315" class="t">ink thickness:</text>
|
|
48
|
+
<text x="455" y="315" class="mono">var(--cem-thickness-light)</text>
|
|
49
|
+
<text x="690" y="315" class="t">rate / pitch / volume:</text>
|
|
50
|
+
<text x="865" y="315" class="mono">1.00 / 0.98 / 0.75</text>
|
|
51
|
+
|
|
52
|
+
<rect x="70" y="375" width="1060" height="78" class="step"/>
|
|
53
|
+
<text x="90" y="405" class="h">gentle</text>
|
|
54
|
+
<rect x="90" y="418" width="130" height="24" class="pill"/><text x="102" y="435" class="pilltext">navigation</text>
|
|
55
|
+
<text x="340" y="405" class="t">ink thickness:</text>
|
|
56
|
+
<text x="455" y="405" class="mono">var(--cem-thickness-normal)</text>
|
|
57
|
+
<text x="690" y="405" class="t">rate / pitch / volume:</text>
|
|
58
|
+
<text x="865" y="405" class="mono">1.00 / 1.00 / 0.85</text>
|
|
59
|
+
|
|
60
|
+
<rect x="70" y="465" width="1060" height="78" class="step-accent"/>
|
|
61
|
+
<text x="90" y="495" class="h">regular</text>
|
|
62
|
+
<rect x="90" y="508" width="140" height="24" class="pill"/><text x="102" y="525" class="pilltext">default</text>
|
|
63
|
+
<text x="340" y="495" class="t">ink thickness:</text>
|
|
64
|
+
<text x="455" y="495" class="mono">var(--cem-thickness-normal)</text>
|
|
65
|
+
<text x="690" y="495" class="t">rate / pitch / volume:</text>
|
|
66
|
+
<text x="865" y="495" class="mono">1.00 / 1.00 / 1.00</text>
|
|
67
|
+
|
|
68
|
+
<rect x="70" y="555" width="1060" height="78" class="step"/>
|
|
69
|
+
<text x="90" y="585" class="h">firm</text>
|
|
70
|
+
<rect x="90" y="598" width="140" height="24" class="pill"/><text x="102" y="615" class="pilltext">actions</text>
|
|
71
|
+
<text x="340" y="585" class="t">ink thickness:</text>
|
|
72
|
+
<text x="455" y="585" class="mono">var(--cem-thickness-bold)</text>
|
|
73
|
+
<text x="690" y="585" class="t">rate / pitch / volume:</text>
|
|
74
|
+
<text x="865" y="585" class="mono">0.98 / 1.03 / 1.00</text>
|
|
75
|
+
|
|
76
|
+
<rect x="70" y="645" width="1060" height="78" class="step"/>
|
|
77
|
+
<text x="90" y="675" class="h">strong</text>
|
|
78
|
+
<rect x="90" y="688" width="160" height="24" class="pill"/><text x="102" y="705" class="pilltext">section focus</text>
|
|
79
|
+
<text x="340" y="675" class="t">ink thickness:</text>
|
|
80
|
+
<text x="455" y="675" class="mono">var(--cem-thickness-x-bold)</text>
|
|
81
|
+
<text x="690" y="675" class="t">rate / pitch / volume:</text>
|
|
82
|
+
<text x="865" y="675" class="mono">0.96 / 1.06 / 1.00</text>
|
|
83
|
+
|
|
84
|
+
<rect x="70" y="735" width="1060" height="78" class="step"/>
|
|
85
|
+
<text x="90" y="765" class="h">loud</text>
|
|
86
|
+
<rect x="90" y="778" width="180" height="24" class="pill"/><text x="102" y="795" class="pilltext">use sparingly</text>
|
|
87
|
+
<text x="340" y="765" class="t">ink thickness:</text>
|
|
88
|
+
<text x="455" y="765" class="mono">var(--cem-thickness-xx-bold)</text>
|
|
89
|
+
<text x="690" y="765" class="t">rate / pitch / volume:</text>
|
|
90
|
+
<text x="865" y="765" class="mono">0.94 / 1.10 / 1.00</text>
|
|
91
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {}
|
|
Binary file
|
package/src/stories/__screenshots__/stories.test.ts/attributes-Attributes-runtime-change-1.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/stories/__screenshots__/stories.test.ts/http-request-Attributes-runtime-change-1.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-with-error-1.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type { StoryObj } from '@storybook/web-components';
|
|
4
4
|
import {expect, userEvent, within} from '@storybook/test';
|
|
5
5
|
|
|
6
|
-
import {cloneAs, mix} from'../custom-element/custom-element.js';
|
|
6
|
+
import {cloneAs, mix, mergeAttr} from'../custom-element/custom-element.js';
|
|
7
7
|
|
|
8
8
|
type TProps = { title: string; body:string};
|
|
9
9
|
|
|
@@ -29,6 +29,11 @@ const meta =
|
|
|
29
29
|
|
|
30
30
|
export default meta;
|
|
31
31
|
|
|
32
|
+
function html2Element( htmlStr: string)
|
|
33
|
+
{ const n = document.createElement('div');
|
|
34
|
+
n.innerHTML = htmlStr;
|
|
35
|
+
return n.firstElementChild as HTMLElement;
|
|
36
|
+
}
|
|
32
37
|
export const CloneAs:Story =
|
|
33
38
|
{ args : {title: 'cloneAs(el,newTag)', body:`
|
|
34
39
|
<p><code>cloneAs()</code> used for conversion of <code>attribute</code> to <code>xsl:param</code></p>
|
|
@@ -62,6 +67,69 @@ export const Mix:Story =
|
|
|
62
67
|
await expect( mix({},{a:1,b:'2'})).toEqual({a:1,b:'2'});
|
|
63
68
|
},
|
|
64
69
|
};
|
|
70
|
+
export const MergeAttr:Story =
|
|
71
|
+
{ args : {title: 'mergeAttr( from, to )', body:`
|
|
72
|
+
<p><code>mergeAttr( from, to )</code> used for <code>attribute</code> collections</p>
|
|
73
|
+
`}
|
|
74
|
+
, play: async () =>
|
|
75
|
+
{
|
|
76
|
+
const from = html2Element('<br title="a" id="b" readonly />');
|
|
77
|
+
const to = html2Element('<br removed/>');
|
|
78
|
+
|
|
79
|
+
await expect( to).toHaveAttribute('removed');
|
|
80
|
+
|
|
81
|
+
mergeAttr(from!,to);
|
|
82
|
+
|
|
83
|
+
await expect( to).toHaveAttribute('title','a');
|
|
84
|
+
await expect( to).toHaveAttribute('id','b');
|
|
85
|
+
await expect( to).toHaveAttribute('readonly');
|
|
86
|
+
await expect( to.getAttributeNames().length).toEqual(3);
|
|
87
|
+
await expect( to).not.toHaveAttribute('removed');
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
export const dceExportedAttributes:Story =
|
|
91
|
+
{ args : {title: 'mergeAttr( from, to )', body:`
|
|
92
|
+
<p><code>mergeAttr( from, to )</code> used for <code>attribute</code> collections</p>
|
|
93
|
+
<p><code>dceExportedAttributes</code> property on target element defines the set of attributes which
|
|
94
|
+
would not be removed from target element</p>
|
|
95
|
+
`}
|
|
96
|
+
, play: async () =>
|
|
97
|
+
{
|
|
98
|
+
const from = html2Element('<br id="b" readonly />');
|
|
99
|
+
const to = html2Element('<br removed/>') as (HTMLElement & {dceExportedAttributes:Set<string>});
|
|
100
|
+
to.dceExportedAttributes = new Set(['enforced']);
|
|
101
|
+
to.setAttribute('enforced',"defined by inner component");
|
|
102
|
+
await expect( to).toHaveAttribute('enforced');
|
|
103
|
+
|
|
104
|
+
mergeAttr(from,to);
|
|
105
|
+
|
|
106
|
+
await expect( to).toHaveAttribute('id','b');
|
|
107
|
+
await expect( to).toHaveAttribute('readonly');
|
|
108
|
+
await expect( to).not.toHaveAttribute('removed');
|
|
109
|
+
await expect( to).toHaveAttribute('enforced',"defined by inner component");
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
export const dceExportedAttributes_attr:Story =
|
|
113
|
+
{ args : {title: 'mergeAttr( from, to )', body:`
|
|
114
|
+
<p><code>mergeAttr( from, to )</code> used for <code>attribute</code> collections</p>
|
|
115
|
+
<p><code>dce-exported-attributes</code> attribute on target element defines the space separated list of attributes which
|
|
116
|
+
would not be removed from target element</p>
|
|
117
|
+
`}
|
|
118
|
+
, play: async () =>
|
|
119
|
+
{
|
|
120
|
+
const from = html2Element('<br id="b" readonly />');
|
|
121
|
+
const to = html2Element('<br removed dce-exported-attributes="enforced"/>') as (HTMLElement & {dceExportedAttributes:Set<string>});
|
|
122
|
+
to.setAttribute('enforced',"defined by inner component");
|
|
123
|
+
await expect( to).toHaveAttribute('enforced');
|
|
124
|
+
|
|
125
|
+
mergeAttr(from,to);
|
|
126
|
+
|
|
127
|
+
await expect( to).toHaveAttribute('id','b');
|
|
128
|
+
await expect( to).toHaveAttribute('readonly');
|
|
129
|
+
await expect( to).not.toHaveAttribute('removed');
|
|
130
|
+
await expect( to).toHaveAttribute('enforced',"defined by inner component");
|
|
131
|
+
},
|
|
132
|
+
};
|
|
65
133
|
|
|
66
134
|
export const AttributeDefaults:Story =
|
|
67
135
|
{ args : {title: 'Attributes definition', body:`
|
|
@@ -70,7 +138,7 @@ export const AttributeDefaults:Story =
|
|
|
70
138
|
<template>
|
|
71
139
|
<attribute name="p1">default_P1</attribute>
|
|
72
140
|
<attribute name="p2" select="'always_p2'" ></attribute>
|
|
73
|
-
<attribute name="p3" select="//p3 ?? 'def_P3' "></attribute>
|
|
141
|
+
<attribute name="p3" select="//attributes/@p3 ?? 'def_P3' "></attribute>
|
|
74
142
|
p1: <code data-testid="p1">{$p1}</code> <br/>
|
|
75
143
|
p2: <code data-testid="p2">{$p2}</code> <br/>
|
|
76
144
|
p3: <code data-testid="p3">{$p3}</code>
|
|
@@ -80,9 +148,7 @@ export const AttributeDefaults:Story =
|
|
|
80
148
|
`}
|
|
81
149
|
, play: async ({canvasElement}) =>
|
|
82
150
|
{
|
|
83
|
-
const
|
|
84
|
-
const canvas = within(canvasElement)
|
|
85
|
-
, code = async (id) => (await canvas.findByTestId(id)).textContent.trim();
|
|
151
|
+
const canvas = within(canvasElement);
|
|
86
152
|
|
|
87
153
|
expect( await await canvas.findByTestId('p1') ).toHaveTextContent('default_P1' );
|
|
88
154
|
expect( await await canvas.findByTestId('p2') ).toHaveTextContent('always_p2' );
|
|
@@ -97,14 +163,14 @@ export const AttributesRuntimeChange:Story =
|
|
|
97
163
|
<template>
|
|
98
164
|
<attribute name="p1">default_P1 </attribute>
|
|
99
165
|
<attribute name="p2" select="'always_p2'" ></attribute>
|
|
100
|
-
<attribute name="p3" select="//p3 ?? 'def_P3' "></attribute>
|
|
166
|
+
<attribute name="p3" select="//attributes/@p3 ?? 'def_P3' "></attribute>
|
|
101
167
|
p1: <code data-testid="t1">{$p1}</code> <br/>
|
|
102
168
|
p2: <code data-testid="t2">{$p2}</code> <br/>
|
|
103
169
|
p3: <code data-testid="t3">{$p3}</code>
|
|
104
170
|
</template>
|
|
105
171
|
</custom-element>
|
|
106
172
|
<section>
|
|
107
|
-
<dce-link2 id="dce2" p1="123" p2="override ignored as select is defined"></dce-link2> <br
|
|
173
|
+
<dce-link2 id="dce2" p1="123" p2="override ignored as select is defined"></dce-link2> <br/>
|
|
108
174
|
<div><input id="i1" value="P1"> <button onclick="dce2.setAttribute('p1',i1.value)"> set p1</button> </div>
|
|
109
175
|
<div><input id="i2" value="P2"> <button onclick="dce2.setAttribute('p2',i2.value)"> set p2</button> </div>
|
|
110
176
|
<div><input id="i3" value="P3"> <button onclick="dce2.setAttribute('p3',i3.value)"> set p3</button> </div>
|
|
@@ -143,7 +209,7 @@ export const InstanceAttributes:Story =
|
|
|
143
209
|
<template>
|
|
144
210
|
<attribute name="p1">default_P1 </attribute>
|
|
145
211
|
<attribute name="p2" select="'always_p2'" ></attribute>
|
|
146
|
-
<attribute name="p3" select="//p3 ?? 'def_P3' "></attribute>
|
|
212
|
+
<attribute name="p3" select="//attributes/p3 ?? 'def_P3' "></attribute>
|
|
147
213
|
p1: <code data-testid="p1">{$p1}</code> <br/>
|
|
148
214
|
p2: <code data-testid="p2">{$p2}</code> <br/>
|
|
149
215
|
p3: <code data-testid="p3">{$p3}</code>
|
|
@@ -156,7 +222,7 @@ export const InstanceAttributes:Story =
|
|
|
156
222
|
const titleText = AttributeDefaults.args!.title as string;
|
|
157
223
|
const canvas = within(canvasElement)
|
|
158
224
|
, code = async (id) => (await canvas.findByTestId(id)).textContent.trim();
|
|
159
|
-
await sleep(
|
|
225
|
+
await sleep(200)
|
|
160
226
|
expect( await code('p1') ).toEqual('123' );
|
|
161
227
|
expect( await code('p2') ).toEqual('always_p2' );
|
|
162
228
|
expect( await code('p3') ).toEqual('qwe' );
|
|
@@ -173,11 +239,11 @@ export const AttributesPropagationUp:Story =
|
|
|
173
239
|
<attribute name="data-testid"></attribute>
|
|
174
240
|
<attribute name="p1"></attribute>
|
|
175
241
|
<attribute name="p2">DEFAULT VALUE</attribute>
|
|
176
|
-
<attribute name="p3" select=" //from-input
|
|
242
|
+
<attribute name="p3" select=" //from-input "></attribute>
|
|
177
243
|
<input slice="from-input" slice-event="input"/><br/>
|
|
178
244
|
p1:<code data-testid="{$data-testid}-p1" >{ $p1 }</code><br/>
|
|
179
245
|
p2:<code data-testid="{$data-testid}-p2" >{ $p2 }</code><br/>
|
|
180
|
-
|
|
246
|
+
p3:<code data-testid="{$data-testid}-p3" >{ $p3 }</code><br/>
|
|
181
247
|
//from-input: {//from-input} <hr/>
|
|
182
248
|
</template>
|
|
183
249
|
</custom-element>
|
|
@@ -195,32 +261,32 @@ export const AttributesPropagationUp:Story =
|
|
|
195
261
|
|
|
196
262
|
await expect( await code('t1-p1') ).toEqual('' );
|
|
197
263
|
await expect( await code('t1-p2') ).toEqual('DEFAULT VALUE' );
|
|
198
|
-
await expect( await code('t1-p3') ).toEqual('
|
|
264
|
+
await expect( await code('t1-p3') ).toEqual('' );
|
|
199
265
|
|
|
200
266
|
const t1 = await canvas.findByTestId('t1');
|
|
201
267
|
await expect( t1 ).toHaveAttribute('value','123');
|
|
202
268
|
await expect( t1 ).toHaveAttribute('p2','DEFAULT VALUE');
|
|
203
|
-
await expect( t1 ).toHaveAttribute('p3','
|
|
269
|
+
await expect( t1 ).toHaveAttribute('p3','');
|
|
204
270
|
await expect( t1 ).not.toHaveAttribute('p1');
|
|
205
271
|
|
|
206
272
|
await expect( await code('t2-p1') ).toEqual('P1' );
|
|
207
273
|
await expect( await code('t2-p2') ).toEqual('123' );
|
|
208
|
-
await expect( await code('t2-p3') ).toEqual('
|
|
274
|
+
await expect( await code('t2-p3') ).toEqual('' );
|
|
209
275
|
|
|
210
276
|
const t2 = await canvas.findByTestId('t2');
|
|
211
277
|
await expect( t2 ).toHaveAttribute('p1','P1');
|
|
212
278
|
await expect( t2 ).toHaveAttribute('p2','123');
|
|
213
|
-
await expect( t2 ).toHaveAttribute('p3','
|
|
279
|
+
await expect( t2 ).toHaveAttribute('p3','');
|
|
214
280
|
|
|
215
281
|
|
|
216
282
|
await expect( await code('t3-p1') ).toEqual('' );
|
|
217
283
|
await expect( await code('t3-p2') ).toEqual('DEFAULT VALUE' );
|
|
218
|
-
await expect( await code('t3-p3') ).toEqual('
|
|
284
|
+
await expect( await code('t3-p3') ).toEqual('' );
|
|
219
285
|
|
|
220
286
|
const t3 = await canvas.findByTestId('t3');
|
|
221
287
|
await expect( t1 ).not.toHaveAttribute('p1');
|
|
222
288
|
await expect( t3 ).toHaveAttribute('p2','DEFAULT VALUE');
|
|
223
|
-
await expect( t3 ).toHaveAttribute('p3','
|
|
289
|
+
await expect( t3 ).toHaveAttribute('p3','');
|
|
224
290
|
|
|
225
291
|
t3.querySelector('input')?.focus();
|
|
226
292
|
await userEvent.keyboard('DCE');
|
|
@@ -154,7 +154,7 @@ export const OrderPreservingOn2ndTransform:Story =
|
|
|
154
154
|
|
|
155
155
|
await fireEvent.click(canvas.getByTestId('cb2'));
|
|
156
156
|
await expect(await canvas.findByText('#2')).toBeInTheDocument();
|
|
157
|
-
await expect(canvas.getByTestId("beforeC1").nextElementSibling).toEqual(
|
|
157
|
+
await expect(canvas.getByTestId("beforeC1").nextElementSibling.textContent).toEqual('#1')
|
|
158
158
|
},
|
|
159
159
|
};
|
|
160
160
|
export const ReadSystemValidityMessage:Story =
|
|
@@ -194,6 +194,30 @@ export const ReadSystemValidityMessage:Story =
|
|
|
194
194
|
},
|
|
195
195
|
};
|
|
196
196
|
|
|
197
|
+
export const EmbedDCE:Story =
|
|
198
|
+
{ args : {title: 'Render inner components', body:`
|
|
199
|
+
<template id="test-icon">
|
|
200
|
+
<attribute name="img"></attribute>
|
|
201
|
+
<i>{img}</i>
|
|
202
|
+
</template>
|
|
203
|
+
<template id="test-button">
|
|
204
|
+
<attribute name="text"></attribute>
|
|
205
|
+
<button>
|
|
206
|
+
<slot>{text}</slot>
|
|
207
|
+
</button>
|
|
208
|
+
</template>
|
|
209
|
+
|
|
210
|
+
<custom-element src="#test-icon" tag="test-icon"></custom-element>
|
|
211
|
+
<custom-element src="#test-button" tag="test-button"></custom-element>
|
|
212
|
+
<test-button>icon:<test-icon img="👍"></test-icon></test-button>
|
|
213
|
+
`}
|
|
214
|
+
, play: async ({canvasElement}) =>
|
|
215
|
+
{
|
|
216
|
+
const canvas = within(canvasElement);
|
|
217
|
+
await expect(await canvas.findByText('👍')).toBeInTheDocument();
|
|
218
|
+
},
|
|
219
|
+
};
|
|
220
|
+
|
|
197
221
|
//#region unit tests
|
|
198
222
|
/* istanbul ignore else -- @preserve */
|
|
199
223
|
if( 'test' === import.meta.env.MODE &&
|
|
@@ -4,7 +4,7 @@ import type { StoryObj } from '@storybook/web-components';
|
|
|
4
4
|
import {expect, getByTestId, within} from '@storybook/test';
|
|
5
5
|
|
|
6
6
|
import '../custom-element/custom-element.js';
|
|
7
|
-
import {
|
|
7
|
+
import {frameCanvas} from "./frame.canvas";
|
|
8
8
|
|
|
9
9
|
type TProps = { title: string; body:string};
|
|
10
10
|
|
|
@@ -75,7 +75,7 @@ export const ExternalSvg:Story =
|
|
|
75
75
|
<template><i>loading from SVG ...</i></template>
|
|
76
76
|
</custom-element>
|
|
77
77
|
<dce-external></dce-external>
|
|
78
|
-
<custom-element src="confused.svg">
|
|
78
|
+
<custom-element src="/confused.svg">
|
|
79
79
|
<i>inline DCE loading from SVG ...</i>
|
|
80
80
|
</custom-element>
|
|
81
81
|
<custom-element src="no.svg">
|
|
@@ -92,7 +92,7 @@ export const ExternalSvg:Story =
|
|
|
92
92
|
// needs separate test
|
|
93
93
|
// await expect( await canvas.findByText('loading from SVG ...')).toBeInTheDocument();
|
|
94
94
|
|
|
95
|
-
expect(canvasElement.querySelector('[src="confused.svg"]').innerHTML).to.include('loading from SVG ...');
|
|
95
|
+
expect(canvasElement.querySelector('[src="/confused.svg"]').innerHTML).to.include('loading from SVG ...');
|
|
96
96
|
await expect(await canvas.findByText('fallback for missing image')).toBeInTheDocument();
|
|
97
97
|
await expect(await canvas.findByTitle('Confused')).toBeInTheDocument();
|
|
98
98
|
},
|
|
@@ -188,32 +188,34 @@ export const SvgWithinHtmlFile:Story =
|
|
|
188
188
|
};
|
|
189
189
|
|
|
190
190
|
export const MathMLWithinHtmlFile:Story =
|
|
191
|
-
{ args : {title: 'external HTML template - MathML by id', body:`
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
</custom-element>
|
|
191
|
+
{ args : {title: '6. external HTML template - MathML by id', body:`
|
|
192
|
+
<iframe src="/demo/external-templates-sb-6.html" data-testid="fr"></iframe>
|
|
193
|
+
|
|
195
194
|
`}
|
|
196
195
|
, play: async ({canvasElement}) =>
|
|
197
196
|
{
|
|
198
197
|
const canvas = within(canvasElement);
|
|
199
198
|
await canvas.findByText(MathMLWithinHtmlFile.args!.title as string);
|
|
200
|
-
const
|
|
199
|
+
const frCanvas = await frameCanvas('fr',canvas);
|
|
200
|
+
|
|
201
|
+
const ml = await frCanvas.findByTestId('ml-test');
|
|
201
202
|
expect(ml.firstElementChild.localName).toEqual('mrow');
|
|
202
203
|
},
|
|
203
204
|
};
|
|
204
205
|
|
|
205
206
|
export const ByIdWithinXsltFile:Story =
|
|
206
|
-
{ args : {title: 'external XHTML template - xsl by id', body:`
|
|
207
|
-
<
|
|
208
|
-
|
|
209
|
-
</custom-element>
|
|
207
|
+
{ args : {title: '7. external XHTML template - xsl by id', body:`
|
|
208
|
+
<iframe src="/demo/external-templates-sb-7.html" data-testid="fr"></iframe>
|
|
209
|
+
|
|
210
210
|
`}
|
|
211
211
|
, play: async ({canvasElement}) =>
|
|
212
212
|
{
|
|
213
213
|
const canvas = within(canvasElement);
|
|
214
214
|
await canvas.findByText(ByIdWithinXsltFile.args!.title as string);
|
|
215
|
-
const
|
|
216
|
-
|
|
215
|
+
const frCanvas = await frameCanvas('fr',canvas);
|
|
216
|
+
|
|
217
|
+
await expect( await frCanvas.findByText('whole XSLT is embedded into HTML body') ).toBeInTheDocument();
|
|
218
|
+
await expect( await frCanvas.findByText('./html-template.xhtml#embedded-xsl') ).toBeInTheDocument();
|
|
217
219
|
},
|
|
218
220
|
};
|
|
219
221
|
export const MissingIdWithinXsltFile:Story =
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {within} from "@storybook/test";
|
|
2
|
+
/*
|
|
3
|
+
example of use
|
|
4
|
+
|
|
5
|
+
import {frameCanvas} from "./frame.canvas";
|
|
6
|
+
|
|
7
|
+
export const ModuleByName:Story =
|
|
8
|
+
{ args : {title: '4. module path by symbolic name', body:`
|
|
9
|
+
<iframe src="../demo/module-url-sb-4.html" name="sb" data-testid="fr"></iframe>
|
|
10
|
+
|
|
11
|
+
`}
|
|
12
|
+
, play: async ({canvasElement}) =>
|
|
13
|
+
{
|
|
14
|
+
const canvas = within(canvasElement);
|
|
15
|
+
await canvas.findByText(ModuleByName.args!.title as string);
|
|
16
|
+
const frCanvas = await frameCanvas('fr',canvas);
|
|
17
|
+
|
|
18
|
+
await expect(await frCanvas.findByText('👌 from embed-relative-hash invoking')).toBeInTheDocument();
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
*/
|
|
22
|
+
export async function
|
|
23
|
+
frameCanvas(frameTestId: string, canvas: ReturnType<typeof within>)
|
|
24
|
+
: Promise<ReturnType<typeof within>>
|
|
25
|
+
{
|
|
26
|
+
const frEl: HTMLIFrameElement = await canvas.findByTestId(frameTestId);
|
|
27
|
+
return new Promise(resolve => frEl.addEventListener('load', () =>
|
|
28
|
+
{
|
|
29
|
+
resolve(within(frEl.contentWindow?.document.documentElement!));
|
|
30
|
+
}));
|
|
31
|
+
}
|