fontdue-js 2.23.0 → 2.23.2

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 CHANGED
@@ -1,3 +1,11 @@
1
+ ## 2.23.2
2
+
3
+ - Fixed a right-edge gap in the *CharacterViewer* glyph grid.
4
+
5
+ ## 2.23.1
6
+
7
+ - Tweaked checkout styling.
8
+
1
9
  ## 2.23.0
2
10
 
3
11
  - Added support for **mutually exclusive licenses**. Tenants can now mark licenses as mutually exclusive in the admin; selecting a conflicting license in the precart, store modal, or cart now auto-deselects the conflicting one. The cart's "+ Add" suggestion list also hides licenses that conflict with what's already selected.
@@ -235,14 +235,31 @@ function CharacterViewerComponent(_ref3) {
235
235
  const handleMouseLeave = () => {
236
236
  if (selectedGlyph) setActiveGlyph(undefined);
237
237
  };
238
- const {
239
- ref: blocksRef,
240
- width: blocksWidth
241
- } = useSize();
242
238
  const {
243
239
  ref: monitorRef,
244
240
  width: monitorWidth
245
241
  } = useSize();
242
+
243
+ // Read the grid's resolved first-track width and expose it as --cell-width
244
+ // on the blocks container. CSS uses --cell-width as min-height on every
245
+ // cell so rows have consistent height regardless of cell composition —
246
+ // without it, rows of all-wide span-N cells would collapse to glyph content
247
+ // height. We read the grid track instead of measuring an individual cell so
248
+ // a wide span-N cell at index 0 wouldn't poison the measurement.
249
+ const blocksRef = (0, _react.useRef)(null);
250
+ const [cellWidth, setCellWidth] = (0, _react.useState)(null);
251
+ const measureCell = (0, _react.useCallback)(() => {
252
+ var _blocksRef$current;
253
+ const list = (_blocksRef$current = blocksRef.current) === null || _blocksRef$current === void 0 ? void 0 : _blocksRef$current.querySelector('.character-viewer__block__character-list');
254
+ if (!list) return;
255
+ const firstTrack = getComputedStyle(list).gridTemplateColumns.split(' ')[0];
256
+ const width = parseFloat(firstTrack);
257
+ if (!Number.isNaN(width)) setCellWidth(width);
258
+ }, []);
259
+ (0, _react.useEffect)(measureCell, [measureCell]);
260
+ (0, _resizeObserver.default)(blocksRef, measureCell, {
261
+ polyfill: typeof window === 'undefined' ? ServerSideResizeObserverPolyfill : null
262
+ });
246
263
  if (!fontStyle) return null;
247
264
  const {
248
265
  ascender,
@@ -365,9 +382,9 @@ function CharacterViewerComponent(_ref3) {
365
382
  })))), /*#__PURE__*/_react.default.createElement("div", {
366
383
  className: "character-viewer_blocks",
367
384
  ref: blocksRef,
368
- style: {
369
- '--width': blocksWidth ?? 600
370
- }
385
+ style: cellWidth ? {
386
+ '--cell-width': `${cellWidth}px`
387
+ } : undefined
371
388
  }, groups === null || groups === void 0 ? void 0 : groups.map((_ref6, i) => {
372
389
  let {
373
390
  name,
@@ -15,7 +15,7 @@ const Checkbox = () => /*#__PURE__*/_react.default.createElement("span", {
15
15
  y: "0",
16
16
  enableBackground: "new 0 0 16 16",
17
17
  version: "1.1",
18
- viewBox: "0 0 16 16",
18
+ viewBox: "2 2 12 12",
19
19
  xmlSpace: "preserve"
20
20
  }, /*#__PURE__*/_react.default.createElement("path", {
21
21
  d: "M2 2v12h12V2H2zm11 11H3V3h10v10z"
@@ -12,7 +12,7 @@ const CheckboxChecked = () => /*#__PURE__*/_react.default.createElement("span",
12
12
  }, /*#__PURE__*/_react.default.createElement("svg", {
13
13
  width: 16,
14
14
  height: 16,
15
- viewBox: "0 0 16 16",
15
+ viewBox: "2 2 12 12",
16
16
  fill: "none",
17
17
  xmlns: "http://www.w3.org/2000/svg"
18
18
  }, /*#__PURE__*/_react.default.createElement("path", {
package/dist/fontdue.css CHANGED
@@ -1083,10 +1083,12 @@ div[data-component=TypeTesters] {
1083
1083
  margin-left: 1px;
1084
1084
  }
1085
1085
 
1086
+ .character-viewer__block__character-list {
1087
+ display: grid;
1088
+ grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
1089
+ }
1086
1090
  .character-viewer__block__character-list > div {
1087
- --size: 1;
1088
- --item-size: calc(var(--size) / (var(--width) / 60) * 100%);
1089
- --height: calc(var(--item-size) / var(--size));
1091
+ min-height: var(--cell-width, 60px);
1090
1092
  display: flex;
1091
1093
  align-items: center;
1092
1094
  justify-content: center;
@@ -1096,25 +1098,20 @@ div[data-component=TypeTesters] {
1096
1098
  text-align: center;
1097
1099
  cursor: default;
1098
1100
  white-space: pre;
1099
- width: var(--item-size);
1100
- height: 0;
1101
- padding-top: calc(var(--height) / 2);
1102
- padding-bottom: calc(var(--height) / 2);
1103
- float: left;
1104
1101
  z-index: 0;
1105
1102
  position: relative;
1106
1103
  }
1107
1104
  .character-viewer__block__character-list > div[data-size="2"] {
1108
- --size: 2;
1105
+ grid-column: span 2;
1109
1106
  }
1110
1107
  .character-viewer__block__character-list > div[data-size="3"] {
1111
- --size: 3;
1108
+ grid-column: span 3;
1112
1109
  }
1113
1110
  .character-viewer__block__character-list > div[data-size="4"] {
1114
- --size: 4;
1111
+ grid-column: span 4;
1115
1112
  }
1116
1113
  .character-viewer__block__character-list > div[data-size="5"] {
1117
- --size: 5;
1114
+ grid-column: span 5;
1118
1115
  }
1119
1116
  @media screen and (min-width: 600px) {
1120
1117
  .character-viewer__block__character-list > div:hover, .character-viewer__block__character-list > div[data-selected=true] {
@@ -1260,7 +1257,7 @@ body[data-fontdue-store-modal=open] {
1260
1257
  @media (min-width: 900px) {
1261
1258
  .store-modal__cart__review {
1262
1259
  display: grid;
1263
- grid-template-columns: 1fr 1fr;
1260
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
1264
1261
  grid-auto-rows: min-content;
1265
1262
  grid-gap: 20px;
1266
1263
  align-items: baseline;
@@ -1328,6 +1325,13 @@ body[data-fontdue-store-modal=open] {
1328
1325
  .store-modal__cart__checkout-section:not(:last-child) {
1329
1326
  margin-bottom: var(--section_spacing);
1330
1327
  }
1328
+ .store-modal__cart__checkout-section[data-editing=false] {
1329
+ display: flex;
1330
+ justify-content: space-between;
1331
+ align-items: baseline;
1332
+ gap: 20px;
1333
+ line-height: 1.4;
1334
+ }
1331
1335
 
1332
1336
  .store-modal__cart__checkout-section-title {
1333
1337
  font-family: var(--font-family__bold, inherit);
@@ -1405,6 +1409,17 @@ body[data-fontdue-store-modal=open] {
1405
1409
  .store-modal__cart__totals {
1406
1410
  grid-column: 2/span 1;
1407
1411
  }
1412
+ @media (max-width: 1199px) {
1413
+ .store-modal__cart__totals {
1414
+ grid-column: 1/span 2;
1415
+ }
1416
+ }
1417
+
1418
+ @media (max-width: 899px) {
1419
+ .store-modal__cart__coupon-code-input + .store-modal__cart__share {
1420
+ margin-top: 20px;
1421
+ }
1422
+ }
1408
1423
 
1409
1424
  .store-modal__container__overlay {
1410
1425
  position: fixed;
@@ -1641,6 +1656,11 @@ body[data-fontdue-store-modal=open] {
1641
1656
  .store-modal__family__group {
1642
1657
  display: flex;
1643
1658
  }
1659
+ @media (max-width: 899px) {
1660
+ .store-modal__family__group {
1661
+ flex-direction: column;
1662
+ }
1663
+ }
1644
1664
 
1645
1665
  .store-modal__family__style-button,
1646
1666
  .store-modal__family__family-button,
@@ -1724,11 +1744,6 @@ body[data-fontdue-store-modal=open] {
1724
1744
  grid-column-gap: 10px;
1725
1745
  grid-row-gap: 10px;
1726
1746
  }
1727
- @media (max-width: 899px) {
1728
- .store-modal__family-button__container {
1729
- grid-template-columns: auto auto;
1730
- }
1731
- }
1732
1747
 
1733
1748
  .store-modal__family-button__price,
1734
1749
  .store-modal__family-button__checked {
@@ -1736,11 +1751,12 @@ body[data-fontdue-store-modal=open] {
1736
1751
  display: inline-block;
1737
1752
  }
1738
1753
 
1739
- @media (max-width: 899px) {
1740
- .store-modal__family-button__label,
1741
- .store-modal__family-button__price {
1742
- grid-row: 2;
1743
- }
1754
+ .store-modal__family-button__label {
1755
+ white-space: nowrap;
1756
+ }
1757
+
1758
+ .store-modal__family-button__price:empty {
1759
+ display: none;
1744
1760
  }
1745
1761
 
1746
1762
  .store-modal__family-button__name {
@@ -1749,7 +1765,7 @@ body[data-fontdue-store-modal=open] {
1749
1765
  }
1750
1766
  @media (max-width: 899px) {
1751
1767
  .store-modal__family-button__name {
1752
- grid-column: 1/span 2;
1768
+ font-size: 24px;
1753
1769
  }
1754
1770
  }
1755
1771
 
@@ -1975,7 +1991,10 @@ body[data-fontdue-store-modal=open] {
1975
1991
 
1976
1992
  .store-modal__license-selection__icon-pair {
1977
1993
  display: flex;
1978
- align-items: center;
1994
+ align-items: baseline;
1995
+ }
1996
+ .store-modal__license-selection__icon-pair .icon {
1997
+ font-size: 1cap;
1979
1998
  }
1980
1999
 
1981
2000
  .store-modal__licensee-is-billing-identity__container[data-disabled=true] {
@@ -2095,6 +2114,7 @@ body[data-fontdue-store-modal=open] {
2095
2114
  }
2096
2115
  .store-modal__order-variable-selection__select-label .icon {
2097
2116
  margin-left: 10px;
2117
+ margin-right: 0;
2098
2118
  }
2099
2119
 
2100
2120
  .store-modal__order-variable-selection__select {
@@ -2110,7 +2130,10 @@ body[data-fontdue-store-modal=open] {
2110
2130
 
2111
2131
  .store-modal__order-variable-selection__icon-pair {
2112
2132
  display: flex;
2113
- align-items: center;
2133
+ align-items: baseline;
2134
+ }
2135
+ .store-modal__order-variable-selection__icon-pair .icon {
2136
+ font-size: 1cap;
2114
2137
  }
2115
2138
 
2116
2139
  .store-modal__order-variable-selection__item[data-ghost=true] .store-modal__order-variable-selection__button {
@@ -2311,6 +2334,7 @@ body[data-fontdue-store-modal=open] {
2311
2334
 
2312
2335
  .cart-additions__form {
2313
2336
  display: flex;
2337
+ width: 100%;
2314
2338
  }
2315
2339
  .cart-additions__button {
2316
2340
  white-space: nowrap;
@@ -2360,6 +2384,8 @@ body[data-fontdue-store-modal=open] {
2360
2384
  }
2361
2385
  .cart-additions__field-wrapper {
2362
2386
  z-index: 1;
2387
+ flex: 1;
2388
+ margin-right: -1px;
2363
2389
  }
2364
2390
  .cart-additions__state-icon {
2365
2391
  position: absolute;
@@ -2411,10 +2437,10 @@ body[data-fontdue-store-modal=open] {
2411
2437
  line-height: normal;
2412
2438
  }
2413
2439
  .cart-additions__field {
2414
- margin-right: -1px;
2415
2440
  padding-right: 35px;
2416
2441
  font-family: inherit;
2417
2442
  min-width: 0;
2443
+ width: 100%;
2418
2444
  }
2419
2445
  .cart-additions[data-status=error] .cart-additions__field {
2420
2446
  color: var(--error_color);
@@ -2456,6 +2482,19 @@ body[data-fontdue-store-modal=open] {
2456
2482
  border-top: 1px solid var(--horizontal_rule_color);
2457
2483
  padding-top: 40px;
2458
2484
  }
2485
+ @media (max-width: 899px) {
2486
+ .cart-item {
2487
+ display: grid;
2488
+ grid-template-columns: 1fr auto;
2489
+ column-gap: 20px;
2490
+ align-items: baseline;
2491
+ }
2492
+ }
2493
+ @media (max-width: 899px) {
2494
+ > div:has(> .cart-item__licenses) {
2495
+ grid-column: 1/-1;
2496
+ }
2497
+ }
2459
2498
  @media (min-width: 900px) {
2460
2499
  .cart-item {
2461
2500
  display: grid;
@@ -2485,6 +2524,12 @@ body[data-fontdue-store-modal=open] {
2485
2524
  .cart-item__label {
2486
2525
  color: var(--styles-count-color, var(--secondary_text_color));
2487
2526
  }
2527
+ @media (max-width: 899px) {
2528
+ .cart-item__product {
2529
+ grid-column: 1;
2530
+ margin-bottom: 20px;
2531
+ }
2532
+ }
2488
2533
  .cart-item__name {
2489
2534
  font-size: 1em;
2490
2535
  margin-top: 30px; /* line up to the baseline of next column */
@@ -2648,11 +2693,12 @@ body[data-fontdue-store-modal=open] {
2648
2693
  .cart-item__license-variable__loading {
2649
2694
  padding: 10px;
2650
2695
  }
2651
- .cart-item__price {
2652
- margin-top: 20px;
2653
- }
2654
- .cart-item:first-child .cart-item__price {
2655
- margin-top: 0;
2696
+ @media (max-width: 899px) {
2697
+ .cart-item__price {
2698
+ grid-column: 2;
2699
+ grid-row: 1;
2700
+ text-align: right;
2701
+ }
2656
2702
  }
2657
2703
  @media (min-width: 900px) {
2658
2704
  .cart-item__price {
@@ -2721,6 +2767,7 @@ body[data-fontdue-store-modal=open] {
2721
2767
  }
2722
2768
  .cart__price-block__placeholder {
2723
2769
  color: var(--secondary_text_color);
2770
+ white-space: nowrap;
2724
2771
  }
2725
2772
  .cart__remove-discount-button {
2726
2773
  background: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fontdue-js",
3
- "version": "2.23.0",
3
+ "version": "2.23.2",
4
4
  "scripts": {
5
5
  "build": "npm run relay && run-p build-js build-css build-ts",
6
6
  "build-js": "babel src --out-dir dist --extensions .ts,.tsx,.js,.jsx",