@decidables/discountable-elements 0.6.3 → 0.6.4
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/CHANGELOG.md +10 -0
- package/lib/discountableElements.esm.js +31 -54
- package/lib/discountableElements.esm.js.map +1 -1
- package/lib/discountableElements.esm.min.js +63 -46
- package/lib/discountableElements.esm.min.js.map +1 -1
- package/lib/discountableElements.umd.js +31 -54
- package/lib/discountableElements.umd.js.map +1 -1
- package/lib/discountableElements.umd.min.js +63 -46
- package/lib/discountableElements.umd.min.js.map +1 -1
- package/package.json +3 -3
- package/src/components/discountable-control.js +1 -1
- package/src/components/discountable-response.js +1 -1
- package/src/components/htd-calculation.js +1 -1
- package/src/components/htd-curves.js +30 -6
- package/src/components/htd-fit.js +1 -1
- package/src/components/htd-parameters.js +1 -1
- package/src/components/itc-choice.js +1 -1
- package/src/components/itc-option.js +1 -1
- package/src/components/itc-task.js +1 -1
- package/src/examples/htd-example.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.6.4](https://github.com/decidables/decidables/compare/@decidables/discountable-elements@0.6.3...@decidables/discountable-elements@0.6.4) (2026-01-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **discountable-elements:** update starting location of bar in `htd-curves` ([983159c](https://github.com/decidables/decidables/commit/983159c3ddb76cfdff856ee7108d1840247001a6)), closes [#10](https://github.com/decidables/decidables/issues/10)
|
|
12
|
+
* **libraries:** add hacks to get Safari to render shadows properly ([120b73c](https://github.com/decidables/decidables/commit/120b73c2e771d59cf43de8dbe8a064a4902b6bd4)), closes [#11](https://github.com/decidables/decidables/issues/11)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
6
16
|
## [0.6.3](https://github.com/decidables/decidables/compare/@decidables/discountable-elements@0.6.2...@decidables/discountable-elements@0.6.3) (2025-11-30)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @decidables/discountable-elements
|
|
@@ -10350,54 +10350,12 @@ class DecidablesElement extends i$2 {
|
|
|
10350
10350
|
const ambientS = rotate ? `${-ambientM.y}px ${ambientM.y / 2}px ${ambientM.b}px ${ambientM.s}px` : `${ambientM.y / 2}px ${ambientM.y}px ${ambientM.b}px ${ambientM.s}px`;
|
|
10351
10351
|
return `${umbraS} ${umbraC}, ${penumbraS} ${penumbraC}, ${ambientS} ${ambientC}`;
|
|
10352
10352
|
}
|
|
10353
|
-
static get svgDefs() {
|
|
10354
|
-
const shadows = DecidablesElement.shadows; /* eslint-disable-line prefer-destructuring */
|
|
10355
|
-
|
|
10356
|
-
const filters = shadows.elevations.map(z => {
|
|
10357
|
-
return `
|
|
10358
|
-
<filter id=${`shadow-${z}`} filterUnits="userSpaceOnUse" x="-100%" y="-100%" width="200%" height="200%">
|
|
10359
|
-
<feComponentTransfer in="SourceAlpha" result="solid">
|
|
10360
|
-
<feFuncA type="table" tableValues="0 1 1"/>
|
|
10361
|
-
</feComponentTransfer>
|
|
10362
|
-
<feOffset in="solid" result="offU" dx=${shadows.mapUmbra[z].y / 2} dy=${shadows.mapUmbra[z].y} />
|
|
10363
|
-
<feOffset in="solid" result="offP" dx=${shadows.mapPenumbra[z].y / 2} dy=${shadows.mapPenumbra[z].y} />
|
|
10364
|
-
<feOffset in="solid" result="offA" dx=${shadows.mapAmbient[z].y / 2} dy=${shadows.mapAmbient[z].y} />
|
|
10365
|
-
${shadows.mapUmbra[z].s === 0 ? '' : `<feMorphology in="offU" result="spreadU" operator=${shadows.mapUmbra[z].s > 0 ? 'dilate' : 'erode'} radius=${Math.abs(shadows.mapUmbra[z].s)} />`}
|
|
10366
|
-
${shadows.mapPenumbra[z].s === 0 ? '' : `<feMorphology in="offP" result="spreadP" operator=${shadows.mapPenumbra[z].s > 0 ? 'dilate' : 'erode'} radius=${Math.abs(shadows.mapPenumbra[z].s)} />`}
|
|
10367
|
-
${shadows.mapAmbient[z].s === 0 ? '' : `<feMorphology in="offA" result="spreadA" operator=${shadows.mapAmbient[z].s > 0 ? 'dilate' : 'erode'} radius=${Math.abs(shadows.mapAmbient[z].s)} />`}
|
|
10368
|
-
<feGaussianBlur in=${shadows.mapUmbra[z].s === 0 ? 'offU' : 'spreadU'} result="blurU" stdDeviation=${shadows.mapUmbra[z].b / 2} />
|
|
10369
|
-
<feGaussianBlur in=${shadows.mapPenumbra[z].s === 0 ? 'offP' : 'spreadP'} result="blurP" stdDeviation=${shadows.mapPenumbra[z].b / 2} />
|
|
10370
|
-
<feGaussianBlur in=${shadows.mapAmbient[z].s === 0 ? 'offA' : 'spreadA'} result="blurA" stdDeviation=${shadows.mapAmbient[z].b / 2} />
|
|
10371
|
-
<feFlood in="SourceGraphic" result="opU" flood-color=${shadows.baselineColor} flood-opacity=${shadows.opacityUmbra + shadows.opacityBoost} />
|
|
10372
|
-
<feFlood in="SourceGraphic" result="opP" flood-color=${shadows.baselineColor} flood-opacity=${shadows.opacityPenumbra + shadows.opacityBoost} />
|
|
10373
|
-
<feFlood in="SourceGraphic" result="opA" flood-color=${shadows.baselineColor} flood-opacity=${shadows.opacityAmbient + shadows.opacityBoost} />
|
|
10374
|
-
<feComposite in="opU" in2="blurU" result="shU" operator="in" />
|
|
10375
|
-
<feComposite in="opP" in2="blurP" result="shP" operator="in" />
|
|
10376
|
-
<feComposite in="opA" in2="blurA" result="shA" operator="in" />
|
|
10377
|
-
<feMorphology in="solid" result="smaller" operator="erode" radius="1" />
|
|
10378
|
-
<feComposite in="shU" in2="smaller" result="finalU" operator="out" />
|
|
10379
|
-
<feComposite in="shP" in2="smaller" result="finalP" operator="out" />
|
|
10380
|
-
<feComposite in="shA" in2="smaller" result="finalA" operator="out" />
|
|
10381
|
-
<feMerge>
|
|
10382
|
-
<feMergeNode in="finalU" />
|
|
10383
|
-
<feMergeNode in="finalP" />
|
|
10384
|
-
<feMergeNode in="finalA" />
|
|
10385
|
-
<feMergeNode in="SourceGraphic" />
|
|
10386
|
-
</feMerge>
|
|
10387
|
-
</filter>`;
|
|
10388
|
-
});
|
|
10389
|
-
return `
|
|
10390
|
-
<defs>
|
|
10391
|
-
${filters}
|
|
10392
|
-
</defs>
|
|
10393
|
-
`;
|
|
10394
|
-
}
|
|
10395
10353
|
static get svgFilters() {
|
|
10396
10354
|
const shadows = DecidablesElement.shadows; /* eslint-disable-line prefer-destructuring */
|
|
10397
10355
|
|
|
10398
10356
|
const filters = shadows.elevations.map(z => {
|
|
10399
10357
|
return b$1`
|
|
10400
|
-
<filter id=${`shadow-${z}`} x="-
|
|
10358
|
+
<filter id=${`shadow-${z}`} filterUnits="userSpaceOnUse" x="-100%" y="-100%" width="200%" height="200%">
|
|
10401
10359
|
<feComponentTransfer in="SourceAlpha" result="solid">
|
|
10402
10360
|
<feFuncA type="table" tableValues="0 1 1"/>
|
|
10403
10361
|
</feComponentTransfer>
|
|
@@ -10429,11 +10387,9 @@ class DecidablesElement extends i$2 {
|
|
|
10429
10387
|
</filter>`;
|
|
10430
10388
|
});
|
|
10431
10389
|
return b$1`
|
|
10432
|
-
<
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
</defs>
|
|
10436
|
-
</svg>
|
|
10390
|
+
<defs class="filtersUser">
|
|
10391
|
+
${filters}
|
|
10392
|
+
</defs>
|
|
10437
10393
|
`;
|
|
10438
10394
|
}
|
|
10439
10395
|
static get styles() {
|
|
@@ -13066,26 +13022,45 @@ class HTDCurves extends DecidablesMixinResizeable(DiscountableElement) {
|
|
|
13066
13022
|
|
|
13067
13023
|
.option .interactive:hover {
|
|
13068
13024
|
filter: url("#shadow-4");
|
|
13025
|
+
|
|
13026
|
+
/* HACK: This gets Safari to correctly apply the filter! */
|
|
13027
|
+
/* https://github.com/emilbjorklund/svg-weirdness/issues/27 */
|
|
13028
|
+
transform: translateX(0);
|
|
13069
13029
|
}
|
|
13070
13030
|
|
|
13071
13031
|
.option .interactive:active {
|
|
13072
13032
|
filter: url("#shadow-8");
|
|
13033
|
+
|
|
13034
|
+
/* HACK: This gets Safari to correctly apply the filter! */
|
|
13035
|
+
transform: translateY(0);
|
|
13073
13036
|
}
|
|
13074
13037
|
|
|
13075
13038
|
:host(.keyboard) .option .interactive:focus-within {
|
|
13076
13039
|
filter: url("#shadow-8");
|
|
13040
|
+
|
|
13041
|
+
/* HACK: This gets Safari to correctly apply the filter! */
|
|
13042
|
+
transform: translateZ(0);
|
|
13077
13043
|
}
|
|
13078
13044
|
|
|
13079
13045
|
.option .body.interactive:has(~ .point:hover) {
|
|
13080
13046
|
filter: url("#shadow-4");
|
|
13047
|
+
|
|
13048
|
+
/* HACK: This gets Safari to correctly apply the filter! */
|
|
13049
|
+
transform: translateX(0);
|
|
13081
13050
|
}
|
|
13082
13051
|
|
|
13083
13052
|
.option .body.interactive:has(~ .point:active) {
|
|
13084
13053
|
filter: url("#shadow-8");
|
|
13054
|
+
|
|
13055
|
+
/* HACK: This gets Safari to correctly apply the filter! */
|
|
13056
|
+
transform: translateY(0);
|
|
13085
13057
|
}
|
|
13086
13058
|
|
|
13087
13059
|
:host(.keyboard) .option .body.interactive:has(~ .point:focus-within) {
|
|
13088
13060
|
filter: url("#shadow-8");
|
|
13061
|
+
|
|
13062
|
+
/* HACK: This gets Safari to correctly apply the filter! */
|
|
13063
|
+
transform: translateZ(0);
|
|
13089
13064
|
}
|
|
13090
13065
|
|
|
13091
13066
|
.gradient.sooner stop {
|
|
@@ -13251,16 +13226,18 @@ class HTDCurves extends DecidablesMixinResizeable(DiscountableElement) {
|
|
|
13251
13226
|
rem: this.rem
|
|
13252
13227
|
}]);
|
|
13253
13228
|
// ENTER
|
|
13254
|
-
const svgEnter = svgUpdate.enter().append('svg').classed('main', true)
|
|
13255
|
-
|
|
13229
|
+
const svgEnter = svgUpdate.enter().append('svg').classed('main', true).each((datum, index, nodes) => {
|
|
13230
|
+
// Filters for shadows
|
|
13231
|
+
B$1(DiscountableElement.svgFilters, nodes[index]);
|
|
13232
|
+
});
|
|
13256
13233
|
// Gradients for fill animations
|
|
13257
|
-
const
|
|
13258
|
-
const soonerGradient =
|
|
13234
|
+
const svgGradients = svgEnter.append('defs').classed('gradients', true);
|
|
13235
|
+
const soonerGradient = svgGradients.append('linearGradient').classed('gradient sooner', true).attr('id', 'sooner-gradient');
|
|
13259
13236
|
soonerGradient.append('stop').classed('stop-0', true).attr('offset', '0');
|
|
13260
13237
|
soonerGradient.append('stop').classed('stop-before animation', true).attr('offset', '1');
|
|
13261
13238
|
soonerGradient.append('stop').classed('stop-after animation', true).attr('offset', '1');
|
|
13262
13239
|
soonerGradient.append('stop').classed('stop-100', true).attr('offset', '1');
|
|
13263
|
-
const laterGradient =
|
|
13240
|
+
const laterGradient = svgGradients.append('linearGradient').classed('gradient later', true).attr('id', 'later-gradient');
|
|
13264
13241
|
laterGradient.append('stop').classed('stop-0', true).attr('offset', '0');
|
|
13265
13242
|
laterGradient.append('stop').classed('stop-before animation', true).attr('offset', '1');
|
|
13266
13243
|
laterGradient.append('stop').classed('stop-after animation', true).attr('offset', '1');
|
|
@@ -13808,7 +13785,7 @@ class HTDCurves extends DecidablesMixinResizeable(DiscountableElement) {
|
|
|
13808
13785
|
element.d = interpolateD(time);
|
|
13809
13786
|
return `${xScale(element.d)}`;
|
|
13810
13787
|
};
|
|
13811
|
-
}).attrTween('y2', (datum, index, elements) => {
|
|
13788
|
+
}).attr('y1', yScale(0)).attrTween('y2', (datum, index, elements) => {
|
|
13812
13789
|
const element = elements[index];
|
|
13813
13790
|
const interpolateA = interpolate$1(element.a !== undefined ? element.a : datum.a, datum.a);
|
|
13814
13791
|
return time => {
|