@hazem3500/palette 0.9.146 → 0.9.148
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/cli/design-edit.mjs +17 -1
- package/dist/chunk-BKIUQ7QJ.js +1 -0
- package/dist/chunk-MKWOTTCN.js +1 -0
- package/dist/design-comment-A433M6JL.js +1 -0
- package/dist/design-comment.d.ts +4 -0
- package/dist/design-export-5QM7HHRT.js +1 -0
- package/dist/design-export.d.ts +10 -4
- package/dist/{design-geometry-HX5KUWQ7.js → design-geometry-XO6RM4YB.js} +1 -1
- package/dist/design-mode.js +1 -1
- package/dist/index.js +1 -1
- package/dist/node.mjs +1 -1
- package/dist/react.js +1 -1
- package/dist/review-layout.d.ts +16 -4
- package/dist/server.js +1 -1
- package/dist/setup.js +1 -1
- package/dist/{token-page-XGQREICZ.js → token-page-LLR4EMEC.js} +1 -1
- package/package.json +1 -1
- package/server/setup-client.txt +74 -56
- package/dist/chunk-G2CBCZXB.js +0 -1
- package/dist/chunk-WH4SUF66.js +0 -1
- package/dist/design-comment-NHM4EJ5C.js +0 -1
- package/dist/design-export-T3RAU7KI.js +0 -1
package/cli/design-edit.mjs
CHANGED
|
@@ -271,8 +271,20 @@ export function designEditFromProse(body, selector) {
|
|
|
271
271
|
// Token values from the Tokens view apply page-wide, so they target :root.
|
|
272
272
|
if (header[1] === "token") target ||= ":root";
|
|
273
273
|
let layout = "";
|
|
274
|
+
// A suggestion's fenced diff: `- prop: before;` / `+ prop: after;` lines inside the rule block.
|
|
275
|
+
let fence = false;
|
|
276
|
+
const diff = { before: new Map(), after: new Map() };
|
|
274
277
|
for (const line of lines.slice(1)) {
|
|
275
|
-
if (
|
|
278
|
+
if (fence) {
|
|
279
|
+
if (/^```/.test(line)) fence = false;
|
|
280
|
+
else {
|
|
281
|
+
const declaration = /^([-+])\s+([\w-]+)\s*:\s*(.*?);?\s*$/.exec(line);
|
|
282
|
+
if (declaration) diff[declaration[1] === "-" ? "before" : "after"].set(declaration[2], declaration[3]);
|
|
283
|
+
}
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
if (header[1] === "style" && /^```diff\s*$/.test(line)) fence = true;
|
|
287
|
+
else if (line.startsWith("Target: ")) target ||= line.slice(8).trim();
|
|
276
288
|
else if (header[1] === "geometry") {
|
|
277
289
|
if (line.startsWith("Layout: ")) layout = line.slice(8).trim().slice(0, 200);
|
|
278
290
|
// "- Move Button “Save”: from Toolbar (3rd) → Sidebar (1st)", then "From: …" and "To: …" lines.
|
|
@@ -302,6 +314,10 @@ export function designEditFromProse(body, selector) {
|
|
|
302
314
|
if (item && JSON.stringify(item.from) !== JSON.stringify(item.to)) changes.push(item);
|
|
303
315
|
}
|
|
304
316
|
}
|
|
317
|
+
for (const [property, to] of diff.after) {
|
|
318
|
+
const from = diff.before.get(property);
|
|
319
|
+
if (from !== to) changes.push({ kind: "css", property, from: from ?? "", to });
|
|
320
|
+
}
|
|
305
321
|
}
|
|
306
322
|
// A move line without its From and To lines can't be applied; keep the rest of the edit.
|
|
307
323
|
for (let index = changes.length - 1; index >= 0; index--)
|