frameboard 0.15.0 → 0.16.0

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.
Files changed (89) hide show
  1. package/dist/cli.js +113 -50
  2. package/dist/client/assets/index-Dg25rx_8.js +110 -0
  3. package/dist/client/assets/index-EciSUFrP.css +2 -0
  4. package/dist/client/index.html +2 -2
  5. package/dist/faces/inter/LICENSE +93 -0
  6. package/dist/faces/inter/files/inter-cyrillic-ext-opsz-italic.woff2 +0 -0
  7. package/dist/faces/inter/files/inter-cyrillic-ext-opsz-normal.woff2 +0 -0
  8. package/dist/faces/inter/files/inter-cyrillic-ext-standard-italic.woff2 +0 -0
  9. package/dist/faces/inter/files/inter-cyrillic-ext-standard-normal.woff2 +0 -0
  10. package/dist/faces/inter/files/inter-cyrillic-ext-wght-italic.woff2 +0 -0
  11. package/dist/faces/inter/files/inter-cyrillic-ext-wght-normal.woff2 +0 -0
  12. package/dist/faces/inter/files/inter-cyrillic-opsz-italic.woff2 +0 -0
  13. package/dist/faces/inter/files/inter-cyrillic-opsz-normal.woff2 +0 -0
  14. package/dist/faces/inter/files/inter-cyrillic-standard-italic.woff2 +0 -0
  15. package/dist/faces/inter/files/inter-cyrillic-standard-normal.woff2 +0 -0
  16. package/dist/faces/inter/files/inter-cyrillic-wght-italic.woff2 +0 -0
  17. package/dist/faces/inter/files/inter-cyrillic-wght-normal.woff2 +0 -0
  18. package/dist/faces/inter/files/inter-greek-ext-opsz-italic.woff2 +0 -0
  19. package/dist/faces/inter/files/inter-greek-ext-opsz-normal.woff2 +0 -0
  20. package/dist/faces/inter/files/inter-greek-ext-standard-italic.woff2 +0 -0
  21. package/dist/faces/inter/files/inter-greek-ext-standard-normal.woff2 +0 -0
  22. package/dist/faces/inter/files/inter-greek-ext-wght-italic.woff2 +0 -0
  23. package/dist/faces/inter/files/inter-greek-ext-wght-normal.woff2 +0 -0
  24. package/dist/faces/inter/files/inter-greek-opsz-italic.woff2 +0 -0
  25. package/dist/faces/inter/files/inter-greek-opsz-normal.woff2 +0 -0
  26. package/dist/faces/inter/files/inter-greek-standard-italic.woff2 +0 -0
  27. package/dist/faces/inter/files/inter-greek-standard-normal.woff2 +0 -0
  28. package/dist/faces/inter/files/inter-greek-wght-italic.woff2 +0 -0
  29. package/dist/faces/inter/files/inter-greek-wght-normal.woff2 +0 -0
  30. package/dist/faces/inter/files/inter-latin-ext-opsz-italic.woff2 +0 -0
  31. package/dist/faces/inter/files/inter-latin-ext-opsz-normal.woff2 +0 -0
  32. package/dist/faces/inter/files/inter-latin-ext-standard-italic.woff2 +0 -0
  33. package/dist/faces/inter/files/inter-latin-ext-standard-normal.woff2 +0 -0
  34. package/dist/faces/inter/files/inter-latin-ext-wght-italic.woff2 +0 -0
  35. package/dist/faces/inter/files/inter-latin-ext-wght-normal.woff2 +0 -0
  36. package/dist/faces/inter/files/inter-latin-opsz-italic.woff2 +0 -0
  37. package/dist/faces/inter/files/inter-latin-opsz-normal.woff2 +0 -0
  38. package/dist/faces/inter/files/inter-latin-standard-italic.woff2 +0 -0
  39. package/dist/faces/inter/files/inter-latin-standard-normal.woff2 +0 -0
  40. package/dist/faces/inter/files/inter-latin-wght-italic.woff2 +0 -0
  41. package/dist/faces/inter/files/inter-latin-wght-normal.woff2 +0 -0
  42. package/dist/faces/inter/files/inter-vietnamese-opsz-italic.woff2 +0 -0
  43. package/dist/faces/inter/files/inter-vietnamese-opsz-normal.woff2 +0 -0
  44. package/dist/faces/inter/files/inter-vietnamese-standard-italic.woff2 +0 -0
  45. package/dist/faces/inter/files/inter-vietnamese-standard-normal.woff2 +0 -0
  46. package/dist/faces/inter/files/inter-vietnamese-wght-italic.woff2 +0 -0
  47. package/dist/faces/inter/files/inter-vietnamese-wght-normal.woff2 +0 -0
  48. package/dist/faces/inter/index.css +69 -0
  49. package/dist/faces/source-serif-4/LICENSE +93 -0
  50. package/dist/faces/source-serif-4/files/source-serif-4-cyrillic-ext-opsz-italic.woff2 +0 -0
  51. package/dist/faces/source-serif-4/files/source-serif-4-cyrillic-ext-opsz-normal.woff2 +0 -0
  52. package/dist/faces/source-serif-4/files/source-serif-4-cyrillic-ext-standard-italic.woff2 +0 -0
  53. package/dist/faces/source-serif-4/files/source-serif-4-cyrillic-ext-standard-normal.woff2 +0 -0
  54. package/dist/faces/source-serif-4/files/source-serif-4-cyrillic-ext-wght-italic.woff2 +0 -0
  55. package/dist/faces/source-serif-4/files/source-serif-4-cyrillic-ext-wght-normal.woff2 +0 -0
  56. package/dist/faces/source-serif-4/files/source-serif-4-cyrillic-opsz-italic.woff2 +0 -0
  57. package/dist/faces/source-serif-4/files/source-serif-4-cyrillic-opsz-normal.woff2 +0 -0
  58. package/dist/faces/source-serif-4/files/source-serif-4-cyrillic-standard-italic.woff2 +0 -0
  59. package/dist/faces/source-serif-4/files/source-serif-4-cyrillic-standard-normal.woff2 +0 -0
  60. package/dist/faces/source-serif-4/files/source-serif-4-cyrillic-wght-italic.woff2 +0 -0
  61. package/dist/faces/source-serif-4/files/source-serif-4-cyrillic-wght-normal.woff2 +0 -0
  62. package/dist/faces/source-serif-4/files/source-serif-4-greek-opsz-italic.woff2 +0 -0
  63. package/dist/faces/source-serif-4/files/source-serif-4-greek-opsz-normal.woff2 +0 -0
  64. package/dist/faces/source-serif-4/files/source-serif-4-greek-standard-italic.woff2 +0 -0
  65. package/dist/faces/source-serif-4/files/source-serif-4-greek-standard-normal.woff2 +0 -0
  66. package/dist/faces/source-serif-4/files/source-serif-4-greek-wght-italic.woff2 +0 -0
  67. package/dist/faces/source-serif-4/files/source-serif-4-greek-wght-normal.woff2 +0 -0
  68. package/dist/faces/source-serif-4/files/source-serif-4-latin-ext-opsz-italic.woff2 +0 -0
  69. package/dist/faces/source-serif-4/files/source-serif-4-latin-ext-opsz-normal.woff2 +0 -0
  70. package/dist/faces/source-serif-4/files/source-serif-4-latin-ext-standard-italic.woff2 +0 -0
  71. package/dist/faces/source-serif-4/files/source-serif-4-latin-ext-standard-normal.woff2 +0 -0
  72. package/dist/faces/source-serif-4/files/source-serif-4-latin-ext-wght-italic.woff2 +0 -0
  73. package/dist/faces/source-serif-4/files/source-serif-4-latin-ext-wght-normal.woff2 +0 -0
  74. package/dist/faces/source-serif-4/files/source-serif-4-latin-opsz-italic.woff2 +0 -0
  75. package/dist/faces/source-serif-4/files/source-serif-4-latin-opsz-normal.woff2 +0 -0
  76. package/dist/faces/source-serif-4/files/source-serif-4-latin-standard-italic.woff2 +0 -0
  77. package/dist/faces/source-serif-4/files/source-serif-4-latin-standard-normal.woff2 +0 -0
  78. package/dist/faces/source-serif-4/files/source-serif-4-latin-wght-italic.woff2 +0 -0
  79. package/dist/faces/source-serif-4/files/source-serif-4-latin-wght-normal.woff2 +0 -0
  80. package/dist/faces/source-serif-4/files/source-serif-4-vietnamese-opsz-italic.woff2 +0 -0
  81. package/dist/faces/source-serif-4/files/source-serif-4-vietnamese-opsz-normal.woff2 +0 -0
  82. package/dist/faces/source-serif-4/files/source-serif-4-vietnamese-standard-italic.woff2 +0 -0
  83. package/dist/faces/source-serif-4/files/source-serif-4-vietnamese-standard-normal.woff2 +0 -0
  84. package/dist/faces/source-serif-4/files/source-serif-4-vietnamese-wght-italic.woff2 +0 -0
  85. package/dist/faces/source-serif-4/files/source-serif-4-vietnamese-wght-normal.woff2 +0 -0
  86. package/dist/faces/source-serif-4/index.css +59 -0
  87. package/package.json +3 -1
  88. package/dist/client/assets/index-Dw9kkXht.css +0 -2
  89. package/dist/client/assets/index-l0GcY95w.js +0 -110
package/dist/cli.js CHANGED
@@ -9415,7 +9415,7 @@ async function isDirectory(path) {
9415
9415
  }
9416
9416
  }
9417
9417
  // package.json
9418
- var version$1 = "0.15.0";
9418
+ var version$1 = "0.16.0";
9419
9419
  var dependencies = { "playwright-core": "1.64.1" };
9420
9420
  // src/shared/version.ts
9421
9421
  const version = version$1;
@@ -29032,6 +29032,79 @@ function applyEdit(source, address, change) {
29032
29032
  span
29033
29033
  };
29034
29034
  }
29035
+ // src/shared/faces.ts
29036
+ const FACES = [
29037
+ {
29038
+ family: "Geist",
29039
+ package: "@fontsource-variable/geist",
29040
+ packageFamily: "Geist Variable",
29041
+ folder: "geist",
29042
+ weights: {
29043
+ min: 100,
29044
+ max: 900
29045
+ },
29046
+ fallback: "sans-serif",
29047
+ startsLook: true
29048
+ },
29049
+ {
29050
+ family: "Geist Mono",
29051
+ package: "@fontsource-variable/geist-mono",
29052
+ packageFamily: "Geist Mono Variable",
29053
+ folder: "geist-mono",
29054
+ weights: {
29055
+ min: 100,
29056
+ max: 900
29057
+ },
29058
+ fallback: "monospace",
29059
+ startsLook: true
29060
+ },
29061
+ {
29062
+ family: "Inter",
29063
+ package: "@fontsource-variable/inter",
29064
+ packageFamily: "Inter Variable",
29065
+ folder: "inter",
29066
+ weights: {
29067
+ min: 100,
29068
+ max: 900
29069
+ },
29070
+ fallback: "sans-serif",
29071
+ startsLook: true
29072
+ },
29073
+ {
29074
+ family: "Source Serif 4",
29075
+ package: "@fontsource-variable/source-serif-4",
29076
+ packageFamily: "Source Serif 4 Variable",
29077
+ folder: "source-serif-4",
29078
+ weights: {
29079
+ min: 200,
29080
+ max: 900
29081
+ },
29082
+ fallback: "serif",
29083
+ startsLook: true
29084
+ },
29085
+ {
29086
+ family: "Caveat",
29087
+ package: "@fontsource-variable/caveat",
29088
+ packageFamily: "Caveat Variable",
29089
+ folder: "caveat",
29090
+ weights: {
29091
+ min: 400,
29092
+ max: 700
29093
+ },
29094
+ fallback: "cursive",
29095
+ startsLook: false
29096
+ }
29097
+ ];
29098
+ /** Where the server serves the faces folder. */
29099
+ const FACES_URL = "/frameboard/faces";
29100
+ /** The sheet a frame imports to get one face. */
29101
+ function faceSheetUrl(face) {
29102
+ return `${FACES_URL}/${face.folder}/index.css`;
29103
+ }
29104
+ /** The stack naming a face then its fallback, as `'Geist Mono', monospace`. */
29105
+ function faceStack(face) {
29106
+ return `${/\s/.test(face.family) ? `'${face.family}'` : face.family}, ${face.fallback}`;
29107
+ }
29035
29108
  // src/shared/starter-tokens.ts
29036
29109
  /**
29037
29110
  * The looks a new project can start from, each accent paired by hand with a
@@ -29061,16 +29134,10 @@ const STARTER_ACCENTS = {
29061
29134
  }
29062
29135
  };
29063
29136
  /** The served faces a starter sheet may name, keyed by their face folder. */
29064
- const STARTER_FONTS = {
29065
- geist: {
29066
- family: "Geist",
29067
- stack: "Geist, sans-serif"
29068
- },
29069
- "geist-mono": {
29070
- family: "Geist Mono",
29071
- stack: "'Geist Mono', monospace"
29072
- }
29073
- };
29137
+ const STARTER_FONTS = Object.fromEntries(FACES.filter((face) => face.startsLook).map((face) => [face.folder, {
29138
+ family: face.family,
29139
+ stack: faceStack(face)
29140
+ }]));
29074
29141
  const DEFAULT_LOOK = {
29075
29142
  accent: "blue",
29076
29143
  font: "geist"
@@ -35118,7 +35185,9 @@ const PROPERTIES = /* @__PURE__ */ new Set([
35118
35185
  "border-color",
35119
35186
  "border-width",
35120
35187
  "border",
35121
- "box-shadow"
35188
+ "box-shadow",
35189
+ "font-family",
35190
+ "font"
35122
35191
  ]);
35123
35192
  /** The colors Selection colors lists, each a property every element may set. */
35124
35193
  const COLOR_PROPERTIES = [
@@ -35187,12 +35256,18 @@ function frameStyles(source, tokens, index) {
35187
35256
  const part = found.shorthand ? shorthandPart(found.value, property) : found.value;
35188
35257
  return part === null ? null : styleValue(part);
35189
35258
  };
35259
+ const family = (element) => {
35260
+ const found = cascade.specified(element, "font-family");
35261
+ if (!found || found.userAgent || found.shorthand) return null;
35262
+ return styleValue(found.value);
35263
+ };
35190
35264
  const element = target ? {
35191
35265
  color: read(target, "color"),
35192
35266
  backgroundColor: read(target, "background-color"),
35193
35267
  borderColor: read(target, "border-color"),
35194
35268
  borderWidth: read(target, "border-width"),
35195
- boxShadow: read(target, "box-shadow")
35269
+ boxShadow: read(target, "box-shadow"),
35270
+ fontFamily: family(target)
35196
35271
  } : null;
35197
35272
  const root = target ?? source.elements.find((candidate) => candidate.name === "body");
35198
35273
  const subtree = root ? source.elements.filter((candidate) => within(candidate, root)) : source.elements;
@@ -35557,33 +35632,6 @@ function historyRoutes(access, history) {
35557
35632
  app.onError(answerRefusal);
35558
35633
  return app;
35559
35634
  }
35560
- // src/shared/faces.ts
35561
- const FACES = [
35562
- {
35563
- family: "Geist",
35564
- package: "@fontsource-variable/geist",
35565
- packageFamily: "Geist Variable",
35566
- folder: "geist"
35567
- },
35568
- {
35569
- family: "Geist Mono",
35570
- package: "@fontsource-variable/geist-mono",
35571
- packageFamily: "Geist Mono Variable",
35572
- folder: "geist-mono"
35573
- },
35574
- {
35575
- family: "Caveat",
35576
- package: "@fontsource-variable/caveat",
35577
- packageFamily: "Caveat Variable",
35578
- folder: "caveat"
35579
- }
35580
- ];
35581
- /** Where the server serves the faces folder. */
35582
- const FACES_URL = "/frameboard/faces";
35583
- /** The sheet a frame imports to get one face. */
35584
- function faceSheetUrl(face) {
35585
- return `${FACES_URL}/${face.folder}/index.css`;
35586
- }
35587
35635
  // src/shared/board-urls.ts
35588
35636
  /** Where the server serves a frame's file, with each name encoded as its own segment. */
35589
35637
  function frameUrl(ref) {
@@ -39619,13 +39667,15 @@ const styleValueSchema = object$1({
39619
39667
  /** The percent a `color-mix()` over the token or a raw hex's alpha keeps, 100 otherwise. */
39620
39668
  percent: number().min(0).max(100)
39621
39669
  });
39622
- /** The selected element's colors, border, and shadow, each null when no author rule sets it. */
39670
+ /** The selected element's colors, border, shadow, and font family, each null when no author rule sets it. */
39623
39671
  const elementStylesSchema = object$1({
39624
39672
  color: styleValueSchema.nullable(),
39625
39673
  backgroundColor: styleValueSchema.nullable(),
39626
39674
  borderColor: styleValueSchema.nullable(),
39627
39675
  borderWidth: styleValueSchema.nullable(),
39628
- boxShadow: styleValueSchema.nullable()
39676
+ boxShadow: styleValueSchema.nullable(),
39677
+ /** The family as written, inherited from an ancestor when the element states none, null for one a `font` shorthand sets. */
39678
+ fontFamily: styleValueSchema.nullable()
39629
39679
  });
39630
39680
  object$1({
39631
39681
  ref: string$1(),
@@ -48411,12 +48461,13 @@ function frameNameOf(name) {
48411
48461
  * agent wrote and then placed. Placing writes `layout.json` alone, which
48412
48462
  * reloads nothing, so these are measured without a reload. A frame that only
48413
48463
  * moved was placed in both, and one a folder rename carried has a new ref
48414
- * but a batch naming the folder alone, so both are left out.
48464
+ * but a batch naming the folder alone, so both are left out. Given no
48465
+ * `paths`, as for two scans of one batch, every page is read.
48415
48466
  */
48416
48467
  function placedRefs(previous, next, paths) {
48417
- const written = new Set(paths);
48468
+ const written = paths && new Set(paths);
48418
48469
  const before = new Set(previous.projects.flatMap((project) => project.pages.flatMap((page) => page.frames.filter((frame) => frame.placed).map((frame) => frame.ref))));
48419
- return next.projects.flatMap((project) => project.pages.filter((page) => written.has(join(page.path, LAYOUT_FILE))).flatMap((page) => page.frames.filter((frame) => frame.placed && (frame.hugWidth || frame.hugHeight) && !before.has(frame.ref)).map((frame) => frame.ref)));
48470
+ return next.projects.flatMap((project) => project.pages.filter((page) => !written || written.has(join(page.path, "layout.json"))).flatMap((page) => page.frames.filter((frame) => frame.placed && (frame.hugWidth || frame.hugHeight) && !before.has(frame.ref)).map((frame) => frame.ref)));
48420
48471
  }
48421
48472
  // src/server/live/findings.ts
48422
48473
  /**
@@ -48669,14 +48720,17 @@ function createHug({ root, measure }) {
48669
48720
  if (size.empty) continue;
48670
48721
  stale ||= frame.hugWidth && size.width !== frame.box.width || frame.hugHeight && size.height !== frame.box.height;
48671
48722
  const page = `${frame.project}/${frame.page}`;
48672
- pages.set(page, {
48673
- ...pages.get(page),
48674
- [frame.name]: size
48675
- });
48723
+ pages.set(page, [...pages.get(page) ?? [], {
48724
+ frame,
48725
+ size
48726
+ }]);
48676
48727
  }
48677
48728
  let written = false;
48678
- for (const [page, sizes] of pages) {
48729
+ for (const [page, measured] of pages) {
48679
48730
  if (closed) break;
48731
+ const unchanged = await Promise.all(measured.map(({ frame }) => unchangedSince(frame)));
48732
+ const sizes = Object.fromEntries(measured.filter((_, index) => unchanged[index]).map(({ frame, size }) => [frame.name, size]));
48733
+ if (Object.keys(sizes).length === 0) continue;
48680
48734
  try {
48681
48735
  const names = await setMeasured(root, page, sizes, { cwd: root });
48682
48736
  written ||= names.length > 0;
@@ -48715,6 +48769,9 @@ async function writtenSinceLayout(board) {
48715
48769
  return hugging.filter((frame) => Date.parse(frame.modifiedAt) > layout).map((frame) => frame.ref);
48716
48770
  }))).flat();
48717
48771
  }
48772
+ async function unchangedSince(frame) {
48773
+ return new Date(await mtimeOf(frame.path)).toISOString() === frame.modifiedAt;
48774
+ }
48718
48775
  async function mtimeOf(path) {
48719
48776
  try {
48720
48777
  return (await stat(path)).mtimeMs;
@@ -49294,8 +49351,14 @@ async function pushBatch(root, tokens, paths, { hub, findings, rendered, deliver
49294
49351
  own = ownFileRefs(board, paths);
49295
49352
  placed = previous ? placedRefs(previous, board, paths).filter((ref) => !own.includes(ref)) : [];
49296
49353
  if (await hug.now(board, [...own, ...placed]).catch(() => false)) {
49354
+ const measured = board;
49297
49355
  board = await scanBoard(root);
49298
49356
  scanned.board = board;
49357
+ const late = placedRefs(measured, board);
49358
+ if (late.length > 0) {
49359
+ placed = [...placed, ...late];
49360
+ if (await hug.now(board, late).catch(() => false)) board = await scanBoard(root);
49361
+ }
49299
49362
  }
49300
49363
  } catch {
49301
49364
  return;