frameboard 0.6.0 → 0.7.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.
package/README.md CHANGED
@@ -104,11 +104,10 @@ Pin a note on a frame or one element with the Note tool, and Send hands it to a
104
104
  In the board you move and resize frames, add, rename, reorder, delete, and search pages, and add a frame at a phone, tablet, or desktop size with the Frame tool.
105
105
 
106
106
  - On the home view, New project adds a project, and a card's right-click menu opens, renames, duplicates, or deletes one
107
- - The inspector edits a selected element's name, opacity, radius, type size, weight, alignment, fill, stroke color, shadow, and text
108
- - It offers the project's tokens first and flags a color no token names
107
+ - The inspector edits a selected element's name, opacity, radius, type size, weight, alignment, fill, stroke color, shadow, and text, offering the project's tokens first and flagging untokened colors
109
108
  - The layers panel selects, renames, restacks, hides, and locks frames, and Cmd+D, Cmd+C, Cmd+X, and Cmd+V duplicate, copy, cut, and paste them across pages and projects
110
109
  - Cmd+F finds a frame, an element, or a line of copy on any page of the project and jumps to it
111
- - Right-click a frame, an element, empty canvas, a page, or a layers row for the actions that apply there, such as Copy as PNG, Paste here, or Flip to light, which shows that frame alone in the other theme until you reload
110
+ - Right-click a frame, element, empty canvas, page, or layers row for its actions, such as Copy as PNG, Paste here, or Flip to light, which shows that frame alone in the other theme until reload
112
111
 
113
112
  Undo any of it with Cmd+Z. An undo of something an agent has changed since is refused and named on the board, so it never reverts the agent's work. Releases before 1.0 ship the board in stages, and the rest of editing by hand arrives in later 0.x releases.
114
113
 
package/dist/cli.js CHANGED
@@ -9360,7 +9360,7 @@ async function isDirectory(path) {
9360
9360
  }
9361
9361
  //#endregion
9362
9362
  //#region package.json
9363
- var version$1 = "0.6.0";
9363
+ var version$1 = "0.7.0";
9364
9364
  var dependencies = { "playwright-core": "1.64.1" };
9365
9365
  //#endregion
9366
9366
  //#region src/shared/version.ts
@@ -27576,7 +27576,54 @@ function definesTheme(node) {
27576
27576
  * count, and neither does a `url()` whose file name reads as a color.
27577
27577
  */
27578
27578
  function setsLiteralColor(property, value) {
27579
- return COLOR_PROPERTIES$1.test(property) && isLiteralColor(value);
27579
+ if (!COLOR_PROPERTIES$1.test(property)) return false;
27580
+ if (SHADOW_PROPERTIES.test(property) && isFaintShadow(value)) return false;
27581
+ return isLiteralColor(value);
27582
+ }
27583
+ const SHADOW_PROPERTIES = /^(box|text)-shadow$/i;
27584
+ const RGB_COLOR = /\brgba?\(([^)]*)\)/gi;
27585
+ const HEX_TOKEN = /#([0-9a-f]{4}|[0-9a-f]{8})\b/gi;
27586
+ /**
27587
+ * Whether every color a shadow names is black or white at or under 0.2
27588
+ * alpha, which reads the same on either theme, so a frame writing one for a
27589
+ * single theme is no finding.
27590
+ */
27591
+ function isFaintShadow(value) {
27592
+ const own = stripFunctions(value, ["var", "url"]);
27593
+ const colors = [];
27594
+ const rest = own.replace(RGB_COLOR, (_match, args) => {
27595
+ colors.push(isFaintRgb(args));
27596
+ return " ";
27597
+ }).replace(HEX_TOKEN, (_match, digits) => {
27598
+ colors.push(isFaintHex(digits));
27599
+ return " ";
27600
+ });
27601
+ return colors.length > 0 && colors.every(Boolean) && !isLiteralColor(rest);
27602
+ }
27603
+ function isFaintRgb(args) {
27604
+ const parts = args.split(/[\s,/]+/).map((part) => part.trim()).filter(Boolean);
27605
+ const [r, g, b, a] = parts;
27606
+ if (parts.length !== 4 || a === void 0) return false;
27607
+ const alpha = a.endsWith("%") ? Number.parseFloat(a) / 100 : Number.parseFloat(a);
27608
+ return isBlackOrWhite(readChannel(r), readChannel(g), readChannel(b)) && alpha <= .200000001;
27609
+ }
27610
+ function readChannel(part) {
27611
+ if (part === void 0) return void 0;
27612
+ if (part.endsWith("%")) return Number.parseFloat(part) / 100 * 255;
27613
+ return Number.parseFloat(part);
27614
+ }
27615
+ function isFaintHex(digits) {
27616
+ const full = digits.length === 4 ? [...digits].map((digit) => digit + digit).join("") : digits;
27617
+ const [r, g, b, a] = [
27618
+ 0,
27619
+ 2,
27620
+ 4,
27621
+ 6
27622
+ ].map((at) => Number.parseInt(full.slice(at, at + 2), 16));
27623
+ return isBlackOrWhite(r, g, b) && (a ?? 255) / 255 <= .200000001;
27624
+ }
27625
+ function isBlackOrWhite(r, g, b) {
27626
+ return r === 0 && g === 0 && b === 0 || r === 255 && g === 255 && b === 255;
27580
27627
  }
27581
27628
  /** Whether a value holds a color of its own, outside any `var()` or `url()`. */
27582
27629
  function isLiteralColor(value) {