origam 2.45.0 → 2.46.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/CHANGELOG.md CHANGED
@@ -18,6 +18,21 @@ This project follows [Semantic Versioning](https://semver.org).
18
18
 
19
19
  ## [Unreleased]
20
20
 
21
+ ## [2.46.0] - 2026-11-26
22
+
23
+ ### Fixed — `TShikiHighlighter` accepte un highlighter `shiki/core` (#1136)
24
+
25
+ - Cause : `codeToHtml` y déclarait `themes?` et `defaultColor?: false | string` optionnels. Les paramètres d'une fonction étant contravariants, `{ themes?: … }` n'est pas assignable au `CodeOptionsMultipleThemes` de shiki (où `themes` est requis) : ni `createHighlighterCore` (`shiki/core`) ni même `createHighlighter` ne satisfaisaient le type, malgré la doc.
26
+ - Correctif : `themes` et `defaultColor: false` deviennent requis — `useCode()` les passe toujours. Un highlighter `shiki/core` s'utilise sans cast. Test de type : `packages/ds/src/types/Code/code.type-test.ts` (vérifié par `pnpm -F origam type-check`).
27
+
28
+ ### Fixed — `rounded` par coin : une valeur non reconnue passe verbatim, comme `padding*` (#1022)
29
+
30
+ - Cause : `resolveRoundedCornerValue` filtrait par `CUSTOM_BORDER_RADIUS_REGEX` puis jetait en silence ce qu'elle ne reconnaissait pas (`"0"` sans unité, rayon elliptique `"10px 4px"`), là où `resolveSpacingValue` renvoie la chaîne telle quelle. Désormais tout ce qui n'est pas un échelon, un nom de variante ou un nombre est émis verbatim ; `shaped` / `shaped-invert` restent `null`. Le navigateur écarte lui-même une valeur invalide.
31
+
32
+ ### Fixed — `useUnsupportedProp` voit désormais une prop morte posée par un thème (#1483)
33
+
34
+ - Cause : le prédicat était évalué dans un `watchEffect` créé dans `setup()`, donc avant le `beforeCreate` où le résolveur de thème (ADR-005) écrit `instance.props` ; une prop morte réglée par `theme.components` n'avertissait jamais. L'évaluation démarre maintenant en `onBeforeMount` (toujours réactive, dédoublonnage par (composant, prop) inchangé).
35
+
21
36
  ## [2.45.0] - 2026-11-25
22
37
 
23
38
  ### Changed — `OrigamDataList` ne peint plus de surface ; `text` optionnel sur DataTitle / DataText (#1128) — rupture assumée
@@ -35,15 +35,8 @@ import type { TRounded } from '../../types/Commons/rounded.type';
35
35
  * block-start inline-end — top-RIGHT in LTR. They are NOT the physical
36
36
  * clockwise order, and the two halves are not interchangeable.
37
37
  *
38
- * ⚠️ This example used to read `roundedTopLeft="0"`, and that form does
39
- * NOT work — measured: `{rounded:'lg', roundedTopLeft:'0'}` emits the
40
- * shorthand declaration ALONE. The bare string `"0"` is neither a utility
41
- * rung, nor a named variant, nor a match for `CUSTOM_BORDER_RADIUS_REGEX`
42
- * (which requires a unit), so `resolveRoundedCornerValue` returns `null`
43
- * and the corner is silently skipped. `0` (the NUMBER) and `"0px"` both
44
- * resolve to `0px`. In a template `roundedTopLeft="0"` is a string, which
45
- * is exactly the failing form — bind `:rounded-top-left="0"` or write
46
- * `"0px"`.
38
+ * Per-corner values that are not a rung pass verbatim (#1022), so
39
+ * `roundedTopLeft="0"` and `"10px 4px"` work like on `padding*`.
47
40
  *
48
41
  * ⚠️ The per-corner props are only reachable through the PROPS-OBJECT
49
42
  * overload. The `Ref` overload carries a single scalar — the `rounded`
@@ -63,7 +56,7 @@ import type { TRounded } from '../../types/Commons/rounded.type';
63
56
  * | `'4px 0 4px 0'` | inline 4-corner radii |
64
57
  *
65
58
  * Free-form strings are parsed by `BORDER_RADIUS_REGEX`. Anything that
66
- * doesn't match (and isn't a `var()`/`calc()`) is silently dropped.
59
+ * doesn't match (and isn't a `var()`/`calc()`) is silently dropped (shorthand only).
67
60
  * Accepted per-corner value forms are documented on
68
61
  * `resolveRoundedCornerValue`.
69
62
  ********************************************************/
@@ -7,9 +7,11 @@ exports.useUnsupportedProp = useUnsupportedProp;
7
7
  var _vue = require("vue");
8
8
  var _color = require("../../utils/Commons/color.util.cjs");
9
9
  function useUnsupportedProp(component, prop, reason, isPassed) {
10
- (0, _vue.watchEffect)(() => {
11
- if (isPassed()) {
12
- (0, _color.warnUnsupportedProp)(component, prop, reason);
13
- }
10
+ (0, _vue.onBeforeMount)(() => {
11
+ (0, _vue.watchEffect)(() => {
12
+ if (isPassed()) {
13
+ (0, _color.warnUnsupportedProp)(component, prop, reason);
14
+ }
15
+ });
14
16
  });
15
17
  }
@@ -25,5 +25,10 @@
25
25
  * Effet de bord utile : lire la prop dans le predicat la rend CONSOMMEE au
26
26
  * sens du garde `unconsumed-props`. La surface cesse donc d'etre comptee
27
27
  * morte, ce qui est exact — elle est desormais surveillee, pas ignoree.
28
+ *
29
+ * @description
30
+ * #1483 — l'evaluation attend `onBeforeMount` : setup() s'execute AVANT le
31
+ * `beforeCreate` ou le resolveur de theme (ADR-005) ecrit `instance.props`,
32
+ * donc une valeur posee par `theme.components` n'y serait jamais vue.
28
33
  ********************************************************/
29
34
  export declare function useUnsupportedProp(component: string, prop: string, reason: string, isPassed: () => boolean): void;
@@ -1,9 +1,11 @@
1
- import { watchEffect } from "vue";
1
+ import { onBeforeMount, watchEffect } from "vue";
2
2
  import { warnUnsupportedProp } from "../../utils/Commons/color.util.js";
3
3
  export function useUnsupportedProp(component, prop, reason, isPassed) {
4
- watchEffect(() => {
5
- if (isPassed()) {
6
- warnUnsupportedProp(component, prop, reason);
7
- }
4
+ onBeforeMount(() => {
5
+ watchEffect(() => {
6
+ if (isPassed()) {
7
+ warnUnsupportedProp(component, prop, reason);
8
+ }
9
+ });
8
10
  });
9
11
  }
@@ -22,6 +22,6 @@ export declare function useVelocity(): {
22
22
  getVelocity: (id: number) => {
23
23
  x: number;
24
24
  y: number;
25
- readonly direction: "left" | "right" | "up" | "down";
25
+ readonly direction: "left" | "right" | "down" | "up";
26
26
  };
27
27
  };
@@ -25,15 +25,20 @@ export type TCodeTheme = `${CODE_THEME}`;
25
25
  * requirement for every consumer, including those who never install it.
26
26
  * Declaring the one method we use keeps the dynamic-import fallback
27
27
  * path type-safe with zero dependency on the package being present.
28
+ *
29
+ * `themes` and `defaultColor` are REQUIRED on purpose (#1136): `useCode()`
30
+ * always passes both, and an optional `themes?` is not assignable to shiki's
31
+ * `CodeOptionsMultipleThemes` (parameters are contravariant), which rejected
32
+ * every real highlighter — `createHighlighter` and `createHighlighterCore`.
28
33
  */
29
34
  export type TShikiHighlighter = {
30
35
  codeToHtml: (code: string, opts: {
31
36
  lang: string;
32
- themes?: {
37
+ themes: {
33
38
  light: string;
34
39
  dark: string;
35
40
  };
36
- defaultColor?: false | string;
41
+ defaultColor: false;
37
42
  }) => string;
38
43
  };
39
44
  /*********************************************************
@@ -30,6 +30,5 @@ function resolveRoundedCornerValue(value) {
30
30
  if (_rounded.PREDEFINED_ROUNDED.includes(trimmed)) {
31
31
  return _spacing.NAMED_RADIUS_TOKEN[trimmed] ?? null;
32
32
  }
33
- if (_rounded.CUSTOM_BORDER_RADIUS_REGEX.test(trimmed)) return trimmed;
34
- return null;
33
+ return trimmed;
35
34
  }
@@ -44,7 +44,7 @@ export declare function resolveSpacingValue(value: boolean | number | string | n
44
44
  * | `8` (number) | `"8px"` |
45
45
  * | `"md"` (utility rung) | `"var(--origam-radius---md, 8px)"` |
46
46
  * | `"large"` (named variant) | `"var(--origam-radius---xl, 16px)"` |
47
- * | `"8px"` / `"var(…)"` / `"calc(…)"` | verbatim |
47
+ * | anything else (`"8px"`, `"0"`, `"10px 4px"`, `"var(…)"`, `"calc(…)"`) | verbatim |
48
48
  * | `"shaped"` / `"shaped-invert"` | `null` — corner-asymmetric, owned by component SCSS |
49
49
  * | `true` / `false` / `""` / nullish | `null` |
50
50
  *
@@ -1,4 +1,4 @@
1
- import { CUSTOM_BORDER_RADIUS_REGEX, PREDEFINED_ROUNDED } from "../../consts/Commons/rounded.const.js";
1
+ import { PREDEFINED_ROUNDED } from "../../consts/Commons/rounded.const.js";
2
2
  import { NAMED_RADIUS_TOKEN, SPACING_SCALE_STEPS, UTILITY_RADIUS_FALLBACK } from "../../consts/Commons/spacing.const.js";
3
3
  import { convertToUnit } from "./commons.util.js";
4
4
  const SCALE_STEP_REGEX = /^\d+$/;
@@ -23,6 +23,5 @@ export function resolveRoundedCornerValue(value) {
23
23
  if (PREDEFINED_ROUNDED.includes(trimmed)) {
24
24
  return NAMED_RADIUS_TOKEN[trimmed] ?? null;
25
25
  }
26
- if (CUSTOM_BORDER_RADIUS_REGEX.test(trimmed)) return trimmed;
27
- return null;
26
+ return trimmed;
28
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "origam",
3
- "version": "2.45.0",
3
+ "version": "2.46.0",
4
4
  "type": "module",
5
5
  "description": "origam — a Vue 3 design system with multi-theme design tokens, CSS-first components and TypeScript types.",
6
6
  "keywords": [