fontdue-js 3.0.3 → 3.0.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 CHANGED
@@ -1,3 +1,7 @@
1
+ ## 3.0.4
2
+
3
+ - Fixed the `CharacterViewer` breaking its grid layout when a character set contains glyphs that need an OpenType feature. Each character set is wrapped in its own element so it can carry its own `font-feature-settings`; those wrappers are now `display: contents` so their cells flow through the block's single grid, rather than each wrapper being its own grid and forcing a row break at every feature boundary — an inserted `ss01`/`salt` alternate no longer lands alone on the next row.
4
+
1
5
  ## 3.0.3
2
6
 
3
7
  - Fixed misaligned style names in `StoreModal`. The feature-glyphs preview is no longer rendered when a style has nothing to show — a variable font with no named instances, or a non-variable style with no representative glyph for its languages — so its empty wrapper no longer indents the style name and rows in a family now line up.
@@ -207,9 +207,11 @@ function CharacterViewerComponent(_ref2) {
207
207
  const [cellWidth, setCellWidth] = useState(null);
208
208
  const measureCell = useCallback(() => {
209
209
  var _blocksRef$current;
210
- const list = (_blocksRef$current = blocksRef.current) === null || _blocksRef$current === void 0 ? void 0 : _blocksRef$current.querySelector('.character-viewer__block__character-list');
211
- if (!list) return;
212
- const firstTrack = getComputedStyle(list).gridTemplateColumns.split(' ')[0];
210
+ // The grid container is the per-block characters element; the
211
+ // character-list wrappers inside it are display: contents (FD-810).
212
+ const grid = (_blocksRef$current = blocksRef.current) === null || _blocksRef$current === void 0 ? void 0 : _blocksRef$current.querySelector('.character-viewer__block__characters');
213
+ if (!grid) return;
214
+ const firstTrack = getComputedStyle(grid).gridTemplateColumns.split(' ')[0];
213
215
  const width = parseFloat(firstTrack);
214
216
  if (!Number.isNaN(width)) setCellWidth(width);
215
217
  }, []);
package/dist/fontdue.css CHANGED
@@ -1075,11 +1075,12 @@ fontdue-type-tester {
1075
1075
  .character-viewer__block__characters {
1076
1076
  font-size: 30px;
1077
1077
  margin-left: 1px;
1078
+ display: grid;
1079
+ grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
1078
1080
  }
1079
1081
 
1080
1082
  .character-viewer__block__character-list {
1081
- display: grid;
1082
- grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
1083
+ display: contents;
1083
1084
  }
1084
1085
  .character-viewer__block__character-list > div {
1085
1086
  min-height: var(--cell-width, 60px);
@@ -7,7 +7,7 @@ import { PREVIEW_HEADER, hasPreviewMarkerCookie } from '../preview/constants.js'
7
7
  // (defineVersionPlugin in .babelrc.cjs) with the literal package.json#version.
8
8
  // Exported so UI (the admin toolbar) can surface it without re-reading the
9
9
  // build-time global in a 'use client' module.
10
- export const version = "3.0.3";
10
+ export const version = "3.0.4";
11
11
  const IS_SERVER = typeof window === typeof undefined;
12
12
 
13
13
  // Opt server fetches into Next's data cache only in production; dev stays
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fontdue-js",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "npm run relay && run-p build-js build-css build-ts",