@gemboss/gem-framework 0.12.0 → 0.12.1

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
@@ -93,6 +93,12 @@ Từ 0.8.2 mỗi module có `.d.ts` cạnh nó (`mount(root?: ParentNode | null,
93
93
 
94
94
  ## Nhật ký thay đổi
95
95
 
96
+ - **0.12.1** (10/10/2026): hai ca biên của token nút, review gemsite #839 bắt khi gemsite chép phép đọc này để phát token
97
+ cho store. (1) Bo trỏ một bậc bo khác (`radius.button: var(--gem-radius-pill)`) không bị nhân núm `--gem-style-radius`
98
+ lần hai: bậc được trỏ tới đã nhân rồi (pill 1,4 thành 1,96×). Áp chung cho mọi thang qua `toScaledCssVars`; giá trị số
99
+ và biến ngoài thang (`var(--brand-radius)`) vẫn nhân như cũ. (2) Khai trùng khoá (`buttonTransform` + `button_transform`)
100
+ giữ giá trị HỢP LỆ cuối cùng; bản cũ xoá mất biến trong khi luật in hoa vẫn trỏ tới nó. Không plan, preset hay giá trị mặc
101
+ định nào đang dùng hai dạng này, nên không cần edition mới.
96
102
  - **0.12.0** (10/10/2026): **edition** (Chris chốt 10/10/2026). Mỗi store ghim một edition; CSS làm đổi hình store
97
103
  không yêu cầu nó thì phát dưới edition kế tiếp thay vì đổi mọi store cùng lúc. Plan mang `framework_edition` (số nguyên,
98
104
  thiếu = 1); storefront đặt nó lên `<html>` thành `data-gem-edition`. Luật của edition N viết dưới
package/dist/SOURCE.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "package": "@gemboss/gem-framework",
3
- "version": "0.12.0",
4
- "gemtheme_sha": "19bae499182a6b3479f331ae4c4647458d3625c5",
3
+ "version": "0.12.1",
4
+ "gemtheme_sha": "4ceacbe0c2ace7da410851fc5fe15589c1d87b77",
5
5
  "gemtheme_dirty": false,
6
- "framework_version": "0.12.0"
6
+ "framework_version": "0.12.1"
7
7
  }
package/dist/index.js CHANGED
@@ -261,7 +261,7 @@ function aaLabelColor(preferred, fill, fallbacks = []) {
261
261
  }
262
262
 
263
263
  // ../../packages/gem-framework/src/tokens.ts
264
- var gemFrameworkVersion = "0.12.0";
264
+ var gemFrameworkVersion = "0.12.1";
265
265
  var GEM_FOCUS_RING_CSS_VAR = "--gem-focus-ring: 2px solid var(--gem-color-accent);";
266
266
  var GEM_TAP_MIN_CSS_VAR = "--gem-tap-min: 44px;";
267
267
  var GEM_FOCUS_OFFSET_CSS_VAR = "--gem-focus-offset: 3px;";
@@ -326,7 +326,7 @@ function readButtonTokens(tokens) {
326
326
  const key = byNorm.get(buttonKeyNorm(rawKey));
327
327
  if (!key) continue;
328
328
  copy ??= { ...values };
329
- delete copy[rawKey];
329
+ if (rawKey !== key) delete copy[rawKey];
330
330
  const v = buttonTokenValue(group, key, raw);
331
331
  if (v === null) out.invalid.push({ path: `${group}.${rawKey}`, value: raw });
332
332
  else {
@@ -334,6 +334,9 @@ function readButtonTokens(tokens) {
334
334
  out.values[key] = v;
335
335
  }
336
336
  }
337
+ if (copy) {
338
+ for (const key of keys) if (!(key in out.values)) delete copy[key];
339
+ }
337
340
  if (copy) out.groups[group] = copy;
338
341
  }
339
342
  return out;
@@ -739,7 +742,11 @@ function toScaledCssVars(namespace, values, knob) {
739
742
  // bọc nó vào GIỮA giá trị — `calc(16px !important * var(...))` — nên custom property lưu
740
743
  // nguyên xi, rồi mọi `padding: var(--gem-space-md)` thành invalid ở computed-value và SẬP VỀ 0
741
744
  // trên toàn bộ .gem-* section.
742
- ([key, value]) => `--gem-${namespace}-${slugify(key)}: calc(${stripImportant(value)} * var(${knob}, 1));`
745
+ ([key, value]) => {
746
+ const clean = stripImportant(value);
747
+ if (new RegExp(`^var\\(--gem-${namespace}-[a-z0-9-]+\\)$`, "i").test(clean.trim())) return `--gem-${namespace}-${slugify(key)}: ${clean.trim()};`;
748
+ return `--gem-${namespace}-${slugify(key)}: calc(${clean} * var(${knob}, 1));`;
749
+ }
743
750
  );
744
751
  }
745
752
  function toBorderCssVars(namespace, values, knob) {
@@ -205,7 +205,7 @@ function readButtonTokens(tokens) {
205
205
  const key = byNorm.get(buttonKeyNorm(rawKey));
206
206
  if (!key) continue;
207
207
  copy ??= { ...values };
208
- delete copy[rawKey];
208
+ if (rawKey !== key) delete copy[rawKey];
209
209
  const v = buttonTokenValue(group, key, raw);
210
210
  if (v === null) out.invalid.push({ path: `${group}.${rawKey}`, value: raw });
211
211
  else {
@@ -213,6 +213,9 @@ function readButtonTokens(tokens) {
213
213
  out.values[key] = v;
214
214
  }
215
215
  }
216
+ if (copy) {
217
+ for (const key of keys) if (!(key in out.values)) delete copy[key];
218
+ }
216
219
  if (copy) out.groups[group] = copy;
217
220
  }
218
221
  return out;
@@ -575,7 +578,11 @@ function toScaledCssVars(namespace, values, knob) {
575
578
  // bọc nó vào GIỮA giá trị — `calc(16px !important * var(...))` — nên custom property lưu
576
579
  // nguyên xi, rồi mọi `padding: var(--gem-space-md)` thành invalid ở computed-value và SẬP VỀ 0
577
580
  // trên toàn bộ .gem-* section.
578
- ([key, value]) => `--gem-${namespace}-${slugify(key)}: calc(${stripImportant(value)} * var(${knob}, 1));`
581
+ ([key, value]) => {
582
+ const clean = stripImportant(value);
583
+ if (new RegExp(`^var\\(--gem-${namespace}-[a-z0-9-]+\\)$`, "i").test(clean.trim())) return `--gem-${namespace}-${slugify(key)}: ${clean.trim()};`;
584
+ return `--gem-${namespace}-${slugify(key)}: calc(${clean} * var(${knob}, 1));`;
585
+ }
579
586
  );
580
587
  }
581
588
  function toBorderCssVars(namespace, values, knob) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gemboss/gem-framework",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "gem-framework của GemTheme (CSS, runtime, token, bộ kiểm) cộng đúng bộ kiểm section gemtheme dùng khi duyệt. Build từ gemtheme, không sửa ở đây.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",