@epa-wg/custom-element-dist 0.0.34 → 0.0.35
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/.gitattributes +4 -0
- package/.idea/copilot.data.migration.ask2agent.xml +6 -0
- package/.yarn/install-state.gz +0 -0
- package/.yarnrc.yml +1 -0
- package/README.md +5 -5
- package/coverage/coverage-final.json +3 -3
- package/coverage/index.html +5 -5
- 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 +341 -341
- package/coverage/src/custom-element/http-request.js.html +10 -10
- package/coverage/src/custom-element/index.html +5 -5
- package/coverage/src/custom-element/local-storage.js.html +1 -1
- package/coverage/src/custom-element/location-element.js.html +1 -1
- package/coverage/src/custom-element/module-url.js.html +1 -1
- package/coverage/src/index.html +1 -1
- package/coverage/src/material/theme/colors.js.html +1 -1
- package/coverage/src/material/theme/index.html +1 -1
- package/coverage/src/mocks/handlers.ts.html +1 -1
- package/coverage/src/mocks/index.html +1 -1
- package/coverage/src/stories/frame.canvas.ts.html +1 -1
- package/coverage/src/stories/http-request.stories.ts.html +1 -1
- package/coverage/src/stories/index.html +1 -1
- package/coverage/src/stories/testStoryBook.ts.html +12 -12
- package/coverage/src/sum.ts.html +1 -1
- package/dist/{custom-element-BqtjrCRF.cjs → custom-element-Bssk9jRy.cjs} +1 -1
- package/dist/{custom-element-BoYMoUtP.js → custom-element-BzDjIYMe.js} +1 -1
- package/dist/custom-element-bundle.cjs +1 -1
- package/dist/custom-element-bundle.js +2 -2
- package/dist/demo/s.xml +1 -3864
- package/dist/demo/s.xslt +351 -13
- package/dist/mockServiceWorker.js +105 -63
- package/package.json +5 -4
- package/public/demo/s.xml +1 -3864
- package/public/demo/s.xslt +351 -13
- package/public/mockServiceWorker.js +105 -63
- package/src/custom-element/custom-element.js +1 -1
- package/src/custom-element/demo/s.xml +1 -3864
- package/src/custom-element/demo/s.xslt +351 -13
- package/src/custom-element/ide/customData-dce.json +123 -0
- package/src/custom-element/ide/web-types-dce.json +128 -1
- package/src/custom-element/ide/web-types-xsl.json +1 -1
- package/src/mocks/versions.mock.ts +1 -1
- package/src/stories/xslt-conditionals.test.stories.ts +1 -1
- package/src/stories/xslt-for-each.test.stories.ts +336 -0
- package/src/stories/xslt-if.test.stories.ts +1 -1
- package/storybook-static/assets/{Color-F6OSRLHC-CzTOSlqB.js → Color-F6OSRLHC-DeDlDLjU.js} +1 -1
- package/storybook-static/assets/{Configure-7GqRsAoJ.js → Configure-CH_tIP5N.js} +1 -1
- package/storybook-static/assets/{DocsRenderer-CFRXHY34-Duc5rSIm.js → DocsRenderer-CFRXHY34-Bc9EPsUI.js} +2 -2
- package/storybook-static/assets/{attributes.test.stories-DYuxF8h1.js → attributes.test.stories-BtamFQkF.js} +1 -1
- package/storybook-static/assets/{css.test.stories-LOmvINyb.js → css.test.stories-BfNxLgwr.js} +1 -1
- package/storybook-static/assets/{custom-element-Bwx7otrT.js → custom-element-CnmjNo0g.js} +1 -1
- package/storybook-static/assets/{dom-merge.test.stories-CEKhWjaS.js → dom-merge.test.stories-DxnitrLK.js} +1 -1
- package/storybook-static/assets/{external-template.test.stories-jHu0wsJ-.js → external-template.test.stories-BTsww7B0.js} +1 -1
- package/storybook-static/assets/{form.test.stories-CUyUnmwP.js → form.test.stories-DNJFtPJb.js} +1 -1
- package/storybook-static/assets/{handlers-F7GUfMqr.js → handlers-Dvg8CAeR.js} +1 -1
- package/storybook-static/assets/{http-request.stories-wyX5-QOv.js → http-request.stories-DgrBNle8.js} +1 -1
- package/storybook-static/assets/{iframe-BS_DPWl0.js → iframe-DiVWehoI.js} +2 -2
- package/storybook-static/assets/{index-DB7LLObI.js → index-CdEbhcV9.js} +1 -1
- package/storybook-static/assets/{index-V1EGs-wm.js → index-w6iX3YlR.js} +3 -3
- package/storybook-static/assets/{local-storage.test.stories-BxOhsf1k.js → local-storage.test.stories-Hwq80yUr.js} +1 -1
- package/storybook-static/assets/{location-element.test.stories-DqhvvUoa.js → location-element.test.stories-mEhZzm7x.js} +1 -1
- package/storybook-static/assets/{module-url.test.stories-C1gG9G7Y.js → module-url.test.stories-Bj46iT0V.js} +1 -1
- package/storybook-static/assets/{preview-Cwy1XFu2.js → preview-BjbXcJci.js} +2 -2
- package/storybook-static/assets/{preview-D6sehqkw.js → preview-CfuT8gak.js} +1 -1
- package/storybook-static/assets/{set-url.test.stories-BKQNdknJ.js → set-url.test.stories-hzxLcqmm.js} +1 -1
- package/storybook-static/assets/{slice-events.test.stories-ChqULCeA.js → slice-events.test.stories-DVyXFRU1.js} +1 -1
- package/storybook-static/assets/{slots.test.stories-BlyLoCRe.js → slots.test.stories-CS544nS4.js} +1 -1
- package/storybook-static/assets/{version-select.test.stories-CPGSh1tR.js → version-select.test.stories-D36nfYBq.js} +1 -1
- package/storybook-static/assets/{xslt-conditionals.test.stories-YC6QPqWZ.js → xslt-conditionals.test.stories-BS1PTIHe.js} +2 -2
- package/storybook-static/assets/xslt-for-each.test.stories-CtPS20RK.js +329 -0
- package/storybook-static/assets/{xslt-if.test.stories-BRSWy2-x.js → xslt-if.test.stories-DcHrAMSY.js} +2 -2
- package/storybook-static/demo/s.xml +1 -3864
- package/storybook-static/demo/s.xslt +351 -13
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.json +1 -1
- package/storybook-static/mockServiceWorker.js +105 -63
- package/storybook-static/project.json +1 -1
package/dist/demo/s.xslt
CHANGED
|
@@ -14,19 +14,357 @@
|
|
|
14
14
|
</xsl:template>
|
|
15
15
|
<xsl:template mode="payload" match="attributes">
|
|
16
16
|
<dce-root xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml" data-dce-id="1">
|
|
17
|
-
<
|
|
18
|
-
<xsl:variable xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
<div xmlns="" data-testid="whole-text" data-dce-id="2">
|
|
18
|
+
<xsl:variable xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="test-data">
|
|
19
|
+
<h6 id="cem-color-hue-variant" tabindex="-1" data-dce-id="3">cem-color-hue-variant</h6>
|
|
20
|
+
<table data-dce-id="4">
|
|
21
|
+
<thead data-dce-id="5">
|
|
22
|
+
<tr data-dce-id="6">
|
|
23
|
+
<th data-dce-id="7">Token</th>
|
|
24
|
+
<th data-dce-id="8">Hue</th>
|
|
25
|
+
<th data-dce-id="9">Variant</th>
|
|
26
|
+
<th data-dce-id="10">Hex</th>
|
|
27
|
+
<th data-dce-id="11">Label</th>
|
|
28
|
+
<th data-dce-id="12">Intended use</th>
|
|
29
|
+
</tr>
|
|
30
|
+
</thead>
|
|
31
|
+
<tbody data-dce-id="13">
|
|
32
|
+
<tr data-dce-id="14">
|
|
33
|
+
<td data-dce-id="15">
|
|
34
|
+
<code data-dce-id="16">--cem-color-blue-xl</code>
|
|
35
|
+
</td>
|
|
36
|
+
<td data-dce-id="17">blue</td>
|
|
37
|
+
<td data-dce-id="18">xl</td>
|
|
38
|
+
<td data-dce-id="19">
|
|
39
|
+
<code data-dce-id="20">#faf9fd</code>
|
|
40
|
+
</td>
|
|
41
|
+
<td data-dce-id="21">Lightest blue</td>
|
|
42
|
+
<td data-dce-id="22">Comfort/trust emotion (light scene)</td>
|
|
43
|
+
</tr>
|
|
44
|
+
<tr data-dce-id="23">
|
|
45
|
+
<td data-dce-id="24">
|
|
46
|
+
<code data-dce-id="25">--cem-color-blue-l</code>
|
|
47
|
+
</td>
|
|
48
|
+
<td data-dce-id="26">blue</td>
|
|
49
|
+
<td data-dce-id="27">l</td>
|
|
50
|
+
<td data-dce-id="28">
|
|
51
|
+
<code data-dce-id="29">#d7e3ff</code>
|
|
52
|
+
</td>
|
|
53
|
+
<td data-dce-id="30">Light blue</td>
|
|
54
|
+
<td data-dce-id="31">Trust palette, attention semantic</td>
|
|
55
|
+
</tr>
|
|
56
|
+
<tr data-dce-id="32">
|
|
57
|
+
<td data-dce-id="33">
|
|
58
|
+
<code data-dce-id="34">--cem-color-blue-d</code>
|
|
59
|
+
</td>
|
|
60
|
+
<td data-dce-id="35">blue</td>
|
|
61
|
+
<td data-dce-id="36">d</td>
|
|
62
|
+
<td data-dce-id="37">
|
|
63
|
+
<code data-dce-id="38">#002f65</code>
|
|
64
|
+
</td>
|
|
65
|
+
<td data-dce-id="39">Dark blue</td>
|
|
66
|
+
<td data-dce-id="40">Trust palette (dark theme)</td>
|
|
67
|
+
</tr>
|
|
68
|
+
<tr data-dce-id="41">
|
|
69
|
+
<td data-dce-id="42">
|
|
70
|
+
<code data-dce-id="43">--cem-color-blue-xd</code>
|
|
71
|
+
</td>
|
|
72
|
+
<td data-dce-id="44">blue</td>
|
|
73
|
+
<td data-dce-id="45">xd</td>
|
|
74
|
+
<td data-dce-id="46">
|
|
75
|
+
<code data-dce-id="47">#1a1b1f</code>
|
|
76
|
+
</td>
|
|
77
|
+
<td data-dce-id="48">Darkest blue</td>
|
|
78
|
+
<td data-dce-id="49">Comfort/trust emotion (dark scene)</td>
|
|
79
|
+
</tr>
|
|
80
|
+
<tr data-dce-id="50">
|
|
81
|
+
<td data-dce-id="51">
|
|
82
|
+
<code data-dce-id="52">--cem-color-brown-xl</code>
|
|
83
|
+
</td>
|
|
84
|
+
<td data-dce-id="53">brown</td>
|
|
85
|
+
<td data-dce-id="54">xl</td>
|
|
86
|
+
<td data-dce-id="55">
|
|
87
|
+
<code data-dce-id="56">#d7ccc8</code>
|
|
88
|
+
</td>
|
|
89
|
+
<td data-dce-id="57">Extra light brown</td>
|
|
90
|
+
<td data-dce-id="58">Conservative palette (light theme)</td>
|
|
91
|
+
</tr>
|
|
92
|
+
<tr data-dce-id="59">
|
|
93
|
+
<td data-dce-id="60">
|
|
94
|
+
<code data-dce-id="61">--cem-color-brown-l</code>
|
|
95
|
+
</td>
|
|
96
|
+
<td data-dce-id="62">brown</td>
|
|
97
|
+
<td data-dce-id="63">l</td>
|
|
98
|
+
<td data-dce-id="64">
|
|
99
|
+
<code data-dce-id="65">#a1887f</code>
|
|
100
|
+
</td>
|
|
101
|
+
<td data-dce-id="66">Light brown</td>
|
|
102
|
+
<td data-dce-id="67">Conservative emotion, brand-3</td>
|
|
103
|
+
</tr>
|
|
104
|
+
<tr data-dce-id="68">
|
|
105
|
+
<td data-dce-id="69">
|
|
106
|
+
<code data-dce-id="70">--cem-color-brown-d</code>
|
|
107
|
+
</td>
|
|
108
|
+
<td data-dce-id="71">brown</td>
|
|
109
|
+
<td data-dce-id="72">d</td>
|
|
110
|
+
<td data-dce-id="73">
|
|
111
|
+
<code data-dce-id="74">#4e342e</code>
|
|
112
|
+
</td>
|
|
113
|
+
<td data-dce-id="75">Dark brown</td>
|
|
114
|
+
<td data-dce-id="76">Conservative palette (dark theme)</td>
|
|
115
|
+
</tr>
|
|
116
|
+
<tr data-dce-id="77">
|
|
117
|
+
<td data-dce-id="78">
|
|
118
|
+
<code data-dce-id="79">--cem-color-brown-xd</code>
|
|
119
|
+
</td>
|
|
120
|
+
<td data-dce-id="80">brown</td>
|
|
121
|
+
<td data-dce-id="81">xd</td>
|
|
122
|
+
<td data-dce-id="82">
|
|
123
|
+
<code data-dce-id="83">#3e2723</code>
|
|
124
|
+
</td>
|
|
125
|
+
<td data-dce-id="84">Extra dark brown</td>
|
|
126
|
+
<td data-dce-id="85">Conservative palette (dark theme, extreme)</td>
|
|
127
|
+
</tr>
|
|
128
|
+
<tr data-dce-id="86">
|
|
129
|
+
<td data-dce-id="87">
|
|
130
|
+
<code data-dce-id="88">--cem-color-cyan-xl</code>
|
|
131
|
+
</td>
|
|
132
|
+
<td data-dce-id="89">cyan</td>
|
|
133
|
+
<td data-dce-id="90">xl</td>
|
|
134
|
+
<td data-dce-id="91">
|
|
135
|
+
<code data-dce-id="92">#f1fefe</code>
|
|
136
|
+
</td>
|
|
137
|
+
<td data-dce-id="93">Extra light cyan</td>
|
|
138
|
+
<td data-dce-id="94">Used for comfort palette (light scenes)</td>
|
|
139
|
+
</tr>
|
|
140
|
+
<tr data-dce-id="95">
|
|
141
|
+
<td data-dce-id="96">
|
|
142
|
+
<code data-dce-id="97">--cem-color-cyan-l</code>
|
|
143
|
+
</td>
|
|
144
|
+
<td data-dce-id="98">cyan</td>
|
|
145
|
+
<td data-dce-id="99">l</td>
|
|
146
|
+
<td data-dce-id="100">
|
|
147
|
+
<code data-dce-id="101">#00fbfb</code>
|
|
148
|
+
</td>
|
|
149
|
+
<td data-dce-id="102">Light cyan</td>
|
|
150
|
+
<td data-dce-id="103">Calm palette, creativity accent</td>
|
|
151
|
+
</tr>
|
|
152
|
+
<tr data-dce-id="104">
|
|
153
|
+
<td data-dce-id="105">
|
|
154
|
+
<code data-dce-id="106">--cem-color-cyan-d</code>
|
|
155
|
+
</td>
|
|
156
|
+
<td data-dce-id="107">cyan</td>
|
|
157
|
+
<td data-dce-id="108">d</td>
|
|
158
|
+
<td data-dce-id="109">
|
|
159
|
+
<code data-dce-id="110">#006a6a</code>
|
|
160
|
+
</td>
|
|
161
|
+
<td data-dce-id="111">Dark cyan</td>
|
|
162
|
+
<td data-dce-id="112">Calm palette (dark theme)</td>
|
|
163
|
+
</tr>
|
|
164
|
+
<tr data-dce-id="113">
|
|
165
|
+
<td data-dce-id="114">
|
|
166
|
+
<code data-dce-id="115">--cem-color-cyan-xd</code>
|
|
167
|
+
</td>
|
|
168
|
+
<td data-dce-id="116">cyan</td>
|
|
169
|
+
<td data-dce-id="117">xd</td>
|
|
170
|
+
<td data-dce-id="118">
|
|
171
|
+
<code data-dce-id="119">#001010</code>
|
|
172
|
+
</td>
|
|
173
|
+
<td data-dce-id="120">Extra dark cyan</td>
|
|
174
|
+
<td data-dce-id="121">Used for comfort palette (dark scenes)</td>
|
|
175
|
+
</tr>
|
|
176
|
+
<tr data-dce-id="122">
|
|
177
|
+
<td data-dce-id="123">
|
|
178
|
+
<code data-dce-id="124">--cem-color-grey-l</code>
|
|
179
|
+
</td>
|
|
180
|
+
<td data-dce-id="125">grey</td>
|
|
181
|
+
<td data-dce-id="126">l</td>
|
|
182
|
+
<td data-dce-id="127">
|
|
183
|
+
<code data-dce-id="128">#f1f1eb</code>
|
|
184
|
+
</td>
|
|
185
|
+
<td data-dce-id="129">Light grey</td>
|
|
186
|
+
<td data-dce-id="130">Conservative palette, neutral backgrounds</td>
|
|
187
|
+
</tr>
|
|
188
|
+
<tr data-dce-id="131">
|
|
189
|
+
<td data-dce-id="132">
|
|
190
|
+
<code data-dce-id="133">--cem-color-grey-d</code>
|
|
191
|
+
</td>
|
|
192
|
+
<td data-dce-id="134">grey</td>
|
|
193
|
+
<td data-dce-id="135">d</td>
|
|
194
|
+
<td data-dce-id="136">
|
|
195
|
+
<code data-dce-id="137">#1a1c18</code>
|
|
196
|
+
</td>
|
|
197
|
+
<td data-dce-id="138">Dark grey</td>
|
|
198
|
+
<td data-dce-id="139">Conservative palette (dark theme)</td>
|
|
199
|
+
</tr>
|
|
200
|
+
<tr data-dce-id="140">
|
|
201
|
+
<td data-dce-id="141">
|
|
202
|
+
<code data-dce-id="142">--cem-color-orange-xl</code>
|
|
203
|
+
</td>
|
|
204
|
+
<td data-dce-id="143">orange</td>
|
|
205
|
+
<td data-dce-id="144">xl</td>
|
|
206
|
+
<td data-dce-id="145">
|
|
207
|
+
<code data-dce-id="146">#f0f070</code>
|
|
208
|
+
</td>
|
|
209
|
+
<td data-dce-id="147">Extra light yellow</td>
|
|
210
|
+
<td data-dce-id="148">Enthusiasm palette (light theme)</td>
|
|
211
|
+
</tr>
|
|
212
|
+
<tr data-dce-id="149">
|
|
213
|
+
<td data-dce-id="150">
|
|
214
|
+
<code data-dce-id="151">--cem-color-orange-l</code>
|
|
215
|
+
</td>
|
|
216
|
+
<td data-dce-id="152">orange</td>
|
|
217
|
+
<td data-dce-id="153">l</td>
|
|
218
|
+
<td data-dce-id="154">
|
|
219
|
+
<code data-dce-id="155">#ffe082</code>
|
|
220
|
+
</td>
|
|
221
|
+
<td data-dce-id="156">Light orange</td>
|
|
222
|
+
<td data-dce-id="157">Enthusiasm emotion, brand-2</td>
|
|
223
|
+
</tr>
|
|
224
|
+
<tr data-dce-id="158">
|
|
225
|
+
<td data-dce-id="159">
|
|
226
|
+
<code data-dce-id="160">--cem-color-orange-d</code>
|
|
227
|
+
</td>
|
|
228
|
+
<td data-dce-id="161">orange</td>
|
|
229
|
+
<td data-dce-id="162">d</td>
|
|
230
|
+
<td data-dce-id="163">
|
|
231
|
+
<code data-dce-id="164">#723600</code>
|
|
232
|
+
</td>
|
|
233
|
+
<td data-dce-id="165">Dark orange</td>
|
|
234
|
+
<td data-dce-id="166">Enthusiasm hype (dark theme)</td>
|
|
235
|
+
</tr>
|
|
236
|
+
<tr data-dce-id="167">
|
|
237
|
+
<td data-dce-id="168">
|
|
238
|
+
<code data-dce-id="169">--cem-color-orange-xd</code>
|
|
239
|
+
</td>
|
|
240
|
+
<td data-dce-id="170">orange</td>
|
|
241
|
+
<td data-dce-id="171">xd</td>
|
|
242
|
+
<td data-dce-id="172">
|
|
243
|
+
<code data-dce-id="173">#502400</code>
|
|
244
|
+
</td>
|
|
245
|
+
<td data-dce-id="174">Extra dark orange</td>
|
|
246
|
+
<td data-dce-id="175">Enthusiasm palette (dark theme, extreme)</td>
|
|
247
|
+
</tr>
|
|
248
|
+
<tr data-dce-id="176">
|
|
249
|
+
<td data-dce-id="177">
|
|
250
|
+
<code data-dce-id="178">--cem-color-purple-xl</code>
|
|
251
|
+
</td>
|
|
252
|
+
<td data-dce-id="179">purple</td>
|
|
253
|
+
<td data-dce-id="180">xl</td>
|
|
254
|
+
<td data-dce-id="181">
|
|
255
|
+
<code data-dce-id="182">#f3e5f5</code>
|
|
256
|
+
</td>
|
|
257
|
+
<td data-dce-id="183">Extra light purple</td>
|
|
258
|
+
<td data-dce-id="184">Creativity palette (light theme)</td>
|
|
259
|
+
</tr>
|
|
260
|
+
<tr data-dce-id="185">
|
|
261
|
+
<td data-dce-id="186">
|
|
262
|
+
<code data-dce-id="187">--cem-color-purple-l</code>
|
|
263
|
+
</td>
|
|
264
|
+
<td data-dce-id="188">purple</td>
|
|
265
|
+
<td data-dce-id="189">l</td>
|
|
266
|
+
<td data-dce-id="190">
|
|
267
|
+
<code data-dce-id="191">#e1bee7</code>
|
|
268
|
+
</td>
|
|
269
|
+
<td data-dce-id="192">Light purple</td>
|
|
270
|
+
<td data-dce-id="193">Creativity emotion, brand-1</td>
|
|
271
|
+
</tr>
|
|
272
|
+
<tr data-dce-id="194">
|
|
273
|
+
<td data-dce-id="195">
|
|
274
|
+
<code data-dce-id="196">--cem-color-purple-d</code>
|
|
275
|
+
</td>
|
|
276
|
+
<td data-dce-id="197">purple</td>
|
|
277
|
+
<td data-dce-id="198">d</td>
|
|
278
|
+
<td data-dce-id="199">
|
|
279
|
+
<code data-dce-id="200">#6a1b9a</code>
|
|
280
|
+
</td>
|
|
281
|
+
<td data-dce-id="201">Dark purple</td>
|
|
282
|
+
<td data-dce-id="202">Creativity palette (dark theme)</td>
|
|
283
|
+
</tr>
|
|
284
|
+
<tr data-dce-id="203">
|
|
285
|
+
<td data-dce-id="204">
|
|
286
|
+
<code data-dce-id="205">--cem-color-purple-xd</code>
|
|
287
|
+
</td>
|
|
288
|
+
<td data-dce-id="206">purple</td>
|
|
289
|
+
<td data-dce-id="207">xd</td>
|
|
290
|
+
<td data-dce-id="208">
|
|
291
|
+
<code data-dce-id="209">#4a148c</code>
|
|
292
|
+
</td>
|
|
293
|
+
<td data-dce-id="210">Extra dark purple</td>
|
|
294
|
+
<td data-dce-id="211">Creativity palette (dark theme, extreme)</td>
|
|
295
|
+
</tr>
|
|
296
|
+
<tr data-dce-id="212">
|
|
297
|
+
<td data-dce-id="213">
|
|
298
|
+
<code data-dce-id="214">--cem-color-red-xl</code>
|
|
299
|
+
</td>
|
|
300
|
+
<td data-dce-id="215">red</td>
|
|
301
|
+
<td data-dce-id="216">xl</td>
|
|
302
|
+
<td data-dce-id="217">
|
|
303
|
+
<code data-dce-id="218">#ffb4ab</code>
|
|
304
|
+
</td>
|
|
305
|
+
<td data-dce-id="219">Extra light red</td>
|
|
306
|
+
<td data-dce-id="220">Danger palette (light theme)</td>
|
|
307
|
+
</tr>
|
|
308
|
+
<tr data-dce-id="221">
|
|
309
|
+
<td data-dce-id="222">
|
|
310
|
+
<code data-dce-id="223">--cem-color-red-l</code>
|
|
311
|
+
</td>
|
|
312
|
+
<td data-dce-id="224">red</td>
|
|
313
|
+
<td data-dce-id="225">l</td>
|
|
314
|
+
<td data-dce-id="226">
|
|
315
|
+
<code data-dce-id="227">#ba1a1a</code>
|
|
316
|
+
</td>
|
|
317
|
+
<td data-dce-id="228">Light red</td>
|
|
318
|
+
<td data-dce-id="229">Danger emotion, alert semantic</td>
|
|
319
|
+
</tr>
|
|
320
|
+
<tr data-dce-id="230">
|
|
321
|
+
<td data-dce-id="231">
|
|
322
|
+
<code data-dce-id="232">--cem-color-red-d</code>
|
|
323
|
+
</td>
|
|
324
|
+
<td data-dce-id="233">red</td>
|
|
325
|
+
<td data-dce-id="234">d</td>
|
|
326
|
+
<td data-dce-id="235">
|
|
327
|
+
<code data-dce-id="236">#690005</code>
|
|
328
|
+
</td>
|
|
329
|
+
<td data-dce-id="237">Dark red</td>
|
|
330
|
+
<td data-dce-id="238">Danger palette (dark theme)</td>
|
|
331
|
+
</tr>
|
|
332
|
+
<tr data-dce-id="239">
|
|
333
|
+
<td data-dce-id="240">
|
|
334
|
+
<code data-dce-id="241">--cem-color-red-xd</code>
|
|
335
|
+
</td>
|
|
336
|
+
<td data-dce-id="242">red</td>
|
|
337
|
+
<td data-dce-id="243">xd</td>
|
|
338
|
+
<td data-dce-id="244">
|
|
339
|
+
<code data-dce-id="245">#410002</code>
|
|
340
|
+
</td>
|
|
341
|
+
<td data-dce-id="246">Extra dark red</td>
|
|
342
|
+
<td data-dce-id="247">Danger palette (dark theme, extreme)</td>
|
|
343
|
+
</tr>
|
|
344
|
+
</tbody>
|
|
345
|
+
</table>
|
|
346
|
+
</xsl:variable>
|
|
347
|
+
<label data-dce-id="248">
|
|
348
|
+
<input type="checkbox" data-testid="toggle-all" slice="show-all" value="ALL" data-dce-id="249"/>
|
|
349
|
+
<dce-text data-dce-id="250">ALL</dce-text>
|
|
350
|
+
</label>
|
|
351
|
+
<xsl:variable xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="cem-color-hue-variant"
|
|
352
|
+
select="exsl:node-set($test-data)//*[@id='cem-color-hue-variant']/following-sibling::table[1]/tbody"/>
|
|
353
|
+
<xsl:variable xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="all-or-nothing"
|
|
354
|
+
select="$cem-color-hue-variant[ //show-all = 'ALL' ]">
|
|
355
|
+
<dce-text data-dce-id="251">
|
|
356
|
+
0
|
|
357
|
+
</dce-text>
|
|
358
|
+
<xsl:for-each select="$all-or-nothing/*">
|
|
359
|
+
<div data-testid="color-{position()}" data-dce-id="252">
|
|
360
|
+
<xsl:value-of select="./*[1]"/>
|
|
361
|
+
</div>
|
|
362
|
+
</xsl:for-each>
|
|
363
|
+
<dce-text data-dce-id="253">
|
|
364
|
+
N
|
|
365
|
+
</dce-text>
|
|
366
|
+
</xsl:variable>
|
|
367
|
+
</div>
|
|
30
368
|
</dce-root>
|
|
31
369
|
</xsl:template>
|
|
32
370
|
<xsl:template match="/">
|
|
@@ -5,24 +5,23 @@
|
|
|
5
5
|
* Mock Service Worker.
|
|
6
6
|
* @see https://github.com/mswjs/msw
|
|
7
7
|
* - Please do NOT modify this file.
|
|
8
|
-
* - Please do NOT serve this file on production.
|
|
9
8
|
*/
|
|
10
9
|
|
|
11
|
-
const PACKAGE_VERSION = '2.7
|
|
12
|
-
const INTEGRITY_CHECKSUM = '
|
|
10
|
+
const PACKAGE_VERSION = '2.12.7'
|
|
11
|
+
const INTEGRITY_CHECKSUM = '4db4a41e972cec1b64cc569c66952d82'
|
|
13
12
|
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
|
|
14
13
|
const activeClientIds = new Set()
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
addEventListener('install', function () {
|
|
17
16
|
self.skipWaiting()
|
|
18
17
|
})
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
addEventListener('activate', function (event) {
|
|
21
20
|
event.waitUntil(self.clients.claim())
|
|
22
21
|
})
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
const clientId = event.source
|
|
23
|
+
addEventListener('message', async function (event) {
|
|
24
|
+
const clientId = Reflect.get(event.source || {}, 'id')
|
|
26
25
|
|
|
27
26
|
if (!clientId || !self.clients) {
|
|
28
27
|
return
|
|
@@ -72,11 +71,6 @@ self.addEventListener('message', async function (event) {
|
|
|
72
71
|
break
|
|
73
72
|
}
|
|
74
73
|
|
|
75
|
-
case 'MOCK_DEACTIVATE': {
|
|
76
|
-
activeClientIds.delete(clientId)
|
|
77
|
-
break
|
|
78
|
-
}
|
|
79
|
-
|
|
80
74
|
case 'CLIENT_CLOSED': {
|
|
81
75
|
activeClientIds.delete(clientId)
|
|
82
76
|
|
|
@@ -94,69 +88,92 @@ self.addEventListener('message', async function (event) {
|
|
|
94
88
|
}
|
|
95
89
|
})
|
|
96
90
|
|
|
97
|
-
|
|
98
|
-
const
|
|
91
|
+
addEventListener('fetch', function (event) {
|
|
92
|
+
const requestInterceptedAt = Date.now()
|
|
99
93
|
|
|
100
94
|
// Bypass navigation requests.
|
|
101
|
-
if (request.mode === 'navigate') {
|
|
95
|
+
if (event.request.mode === 'navigate') {
|
|
102
96
|
return
|
|
103
97
|
}
|
|
104
98
|
|
|
105
99
|
// Opening the DevTools triggers the "only-if-cached" request
|
|
106
100
|
// that cannot be handled by the worker. Bypass such requests.
|
|
107
|
-
if (
|
|
101
|
+
if (
|
|
102
|
+
event.request.cache === 'only-if-cached' &&
|
|
103
|
+
event.request.mode !== 'same-origin'
|
|
104
|
+
) {
|
|
108
105
|
return
|
|
109
106
|
}
|
|
110
107
|
|
|
111
108
|
// Bypass all requests when there are no active clients.
|
|
112
109
|
// Prevents the self-unregistered worked from handling requests
|
|
113
|
-
// after it's been
|
|
110
|
+
// after it's been terminated (still remains active until the next reload).
|
|
114
111
|
if (activeClientIds.size === 0) {
|
|
115
112
|
return
|
|
116
113
|
}
|
|
117
114
|
|
|
118
|
-
// Generate unique request ID.
|
|
119
115
|
const requestId = crypto.randomUUID()
|
|
120
|
-
event.respondWith(handleRequest(event, requestId))
|
|
116
|
+
event.respondWith(handleRequest(event, requestId, requestInterceptedAt))
|
|
121
117
|
})
|
|
122
118
|
|
|
123
|
-
|
|
119
|
+
/**
|
|
120
|
+
* @param {FetchEvent} event
|
|
121
|
+
* @param {string} requestId
|
|
122
|
+
* @param {number} requestInterceptedAt
|
|
123
|
+
*/
|
|
124
|
+
async function handleRequest(event, requestId, requestInterceptedAt) {
|
|
124
125
|
const client = await resolveMainClient(event)
|
|
125
|
-
const
|
|
126
|
+
const requestCloneForEvents = event.request.clone()
|
|
127
|
+
const response = await getResponse(
|
|
128
|
+
event,
|
|
129
|
+
client,
|
|
130
|
+
requestId,
|
|
131
|
+
requestInterceptedAt,
|
|
132
|
+
)
|
|
126
133
|
|
|
127
134
|
// Send back the response clone for the "response:*" life-cycle events.
|
|
128
135
|
// Ensure MSW is active and ready to handle the message, otherwise
|
|
129
136
|
// this message will pend indefinitely.
|
|
130
137
|
if (client && activeClientIds.has(client.id)) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
const serializedRequest = await serializeRequest(requestCloneForEvents)
|
|
139
|
+
|
|
140
|
+
// Clone the response so both the client and the library could consume it.
|
|
141
|
+
const responseClone = response.clone()
|
|
142
|
+
|
|
143
|
+
sendToClient(
|
|
144
|
+
client,
|
|
145
|
+
{
|
|
146
|
+
type: 'RESPONSE',
|
|
147
|
+
payload: {
|
|
148
|
+
isMockedResponse: IS_MOCKED_RESPONSE in response,
|
|
149
|
+
request: {
|
|
150
|
+
id: requestId,
|
|
151
|
+
...serializedRequest,
|
|
152
|
+
},
|
|
153
|
+
response: {
|
|
141
154
|
type: responseClone.type,
|
|
142
155
|
status: responseClone.status,
|
|
143
156
|
statusText: responseClone.statusText,
|
|
144
|
-
body: responseClone.body,
|
|
145
157
|
headers: Object.fromEntries(responseClone.headers.entries()),
|
|
158
|
+
body: responseClone.body,
|
|
146
159
|
},
|
|
147
160
|
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
161
|
+
},
|
|
162
|
+
responseClone.body ? [serializedRequest.body, responseClone.body] : [],
|
|
163
|
+
)
|
|
151
164
|
}
|
|
152
165
|
|
|
153
166
|
return response
|
|
154
167
|
}
|
|
155
168
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
169
|
+
/**
|
|
170
|
+
* Resolve the main client for the given event.
|
|
171
|
+
* Client that issues a request doesn't necessarily equal the client
|
|
172
|
+
* that registered the worker. It's with the latter the worker should
|
|
173
|
+
* communicate with during the response resolving phase.
|
|
174
|
+
* @param {FetchEvent} event
|
|
175
|
+
* @returns {Promise<Client | undefined>}
|
|
176
|
+
*/
|
|
160
177
|
async function resolveMainClient(event) {
|
|
161
178
|
const client = await self.clients.get(event.clientId)
|
|
162
179
|
|
|
@@ -184,12 +201,17 @@ async function resolveMainClient(event) {
|
|
|
184
201
|
})
|
|
185
202
|
}
|
|
186
203
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
204
|
+
/**
|
|
205
|
+
* @param {FetchEvent} event
|
|
206
|
+
* @param {Client | undefined} client
|
|
207
|
+
* @param {string} requestId
|
|
208
|
+
* @param {number} requestInterceptedAt
|
|
209
|
+
* @returns {Promise<Response>}
|
|
210
|
+
*/
|
|
211
|
+
async function getResponse(event, client, requestId, requestInterceptedAt) {
|
|
190
212
|
// Clone the request because it might've been already used
|
|
191
213
|
// (i.e. its body has been read and sent to the client).
|
|
192
|
-
const requestClone = request.clone()
|
|
214
|
+
const requestClone = event.request.clone()
|
|
193
215
|
|
|
194
216
|
function passthrough() {
|
|
195
217
|
// Cast the request headers to a new Headers instance
|
|
@@ -230,29 +252,18 @@ async function getResponse(event, client, requestId) {
|
|
|
230
252
|
}
|
|
231
253
|
|
|
232
254
|
// Notify the client that a request has been intercepted.
|
|
233
|
-
const
|
|
255
|
+
const serializedRequest = await serializeRequest(event.request)
|
|
234
256
|
const clientMessage = await sendToClient(
|
|
235
257
|
client,
|
|
236
258
|
{
|
|
237
259
|
type: 'REQUEST',
|
|
238
260
|
payload: {
|
|
239
261
|
id: requestId,
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
method: request.method,
|
|
243
|
-
headers: Object.fromEntries(request.headers.entries()),
|
|
244
|
-
cache: request.cache,
|
|
245
|
-
credentials: request.credentials,
|
|
246
|
-
destination: request.destination,
|
|
247
|
-
integrity: request.integrity,
|
|
248
|
-
redirect: request.redirect,
|
|
249
|
-
referrer: request.referrer,
|
|
250
|
-
referrerPolicy: request.referrerPolicy,
|
|
251
|
-
body: requestBuffer,
|
|
252
|
-
keepalive: request.keepalive,
|
|
262
|
+
interceptedAt: requestInterceptedAt,
|
|
263
|
+
...serializedRequest,
|
|
253
264
|
},
|
|
254
265
|
},
|
|
255
|
-
[
|
|
266
|
+
[serializedRequest.body],
|
|
256
267
|
)
|
|
257
268
|
|
|
258
269
|
switch (clientMessage.type) {
|
|
@@ -268,6 +279,12 @@ async function getResponse(event, client, requestId) {
|
|
|
268
279
|
return passthrough()
|
|
269
280
|
}
|
|
270
281
|
|
|
282
|
+
/**
|
|
283
|
+
* @param {Client} client
|
|
284
|
+
* @param {any} message
|
|
285
|
+
* @param {Array<Transferable>} transferrables
|
|
286
|
+
* @returns {Promise<any>}
|
|
287
|
+
*/
|
|
271
288
|
function sendToClient(client, message, transferrables = []) {
|
|
272
289
|
return new Promise((resolve, reject) => {
|
|
273
290
|
const channel = new MessageChannel()
|
|
@@ -280,14 +297,18 @@ function sendToClient(client, message, transferrables = []) {
|
|
|
280
297
|
resolve(event.data)
|
|
281
298
|
}
|
|
282
299
|
|
|
283
|
-
client.postMessage(
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
)
|
|
300
|
+
client.postMessage(message, [
|
|
301
|
+
channel.port2,
|
|
302
|
+
...transferrables.filter(Boolean),
|
|
303
|
+
])
|
|
287
304
|
})
|
|
288
305
|
}
|
|
289
306
|
|
|
290
|
-
|
|
307
|
+
/**
|
|
308
|
+
* @param {Response} response
|
|
309
|
+
* @returns {Response}
|
|
310
|
+
*/
|
|
311
|
+
function respondWithMock(response) {
|
|
291
312
|
// Setting response status code to 0 is a no-op.
|
|
292
313
|
// However, when responding with a "Response.error()", the produced Response
|
|
293
314
|
// instance will have status code set to 0. Since it's not possible to create
|
|
@@ -305,3 +326,24 @@ async function respondWithMock(response) {
|
|
|
305
326
|
|
|
306
327
|
return mockedResponse
|
|
307
328
|
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* @param {Request} request
|
|
332
|
+
*/
|
|
333
|
+
async function serializeRequest(request) {
|
|
334
|
+
return {
|
|
335
|
+
url: request.url,
|
|
336
|
+
mode: request.mode,
|
|
337
|
+
method: request.method,
|
|
338
|
+
headers: Object.fromEntries(request.headers.entries()),
|
|
339
|
+
cache: request.cache,
|
|
340
|
+
credentials: request.credentials,
|
|
341
|
+
destination: request.destination,
|
|
342
|
+
integrity: request.integrity,
|
|
343
|
+
redirect: request.redirect,
|
|
344
|
+
referrer: request.referrer,
|
|
345
|
+
referrerPolicy: request.referrerPolicy,
|
|
346
|
+
body: await request.arrayBuffer(),
|
|
347
|
+
keepalive: request.keepalive,
|
|
348
|
+
}
|
|
349
|
+
}
|