origam 2.37.5 → 2.37.6

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,17 @@ This project follows [Semantic Versioning](https://semver.org).
18
18
 
19
19
  ## [Unreleased]
20
20
 
21
+ ## [2.37.6] - 2026-10-21
22
+
23
+ ### Fixed — `OrigamDrawer` sans `attach` : contenu absent du rendu serveur et hydratation en erreur (#1223)
24
+
25
+ Sans `attach`, le tiroir téléportait son contenu dès le rendu serveur. Le HTML serveur ne contenait donc pas ce contenu, et l'hydratation tombait en mismatch : erreur 500 sous Nuxt. Un tiroir `permanent` sans `modelValue` était aussi inactif côté serveur et actif côté client, parce que `onBeforeMount` ne tourne pas en SSR.
26
+
27
+ - Le contenu reste rendu en ligne jusqu'à l'hydratation (`useHydration()`, comme `OrigamOverlay`), puis il est téléporté.
28
+ - `onServerPrefetch` initialise l'état actif côté serveur.
29
+ - Vérifié : TU `drawer-ssr-hydration.spec.ts` (`renderToString` puis hydratation), rouge sur le parent, vert après ; TU Drawer 35/35 (PR #1236).
30
+ - Non couvert : la branche avec `attach` explicite (#1238) et un e2e Nuxt réel.
31
+
21
32
  ## [2.37.5] - 2026-10-21
22
33
 
23
34
  ### Fixed — `OrigamTabPanels` ne relaie plus `transition` à `OrigamTabPanel` (#1207)
@@ -61,6 +61,7 @@ import {
61
61
  isRef,
62
62
  nextTick,
63
63
  onBeforeMount,
64
+ onServerPrefetch,
64
65
  Ref,
65
66
  ref,
66
67
  shallowRef,
@@ -84,6 +85,7 @@ import { useStateFlag } from "../../composables/Commons/stateFlag.composable";
84
85
  import { useSticky } from "../../composables/Commons/sticky.composable";
85
86
  import { useStyle } from "../../composables/Commons/style.composable";
86
87
  import { useTeleport } from "../../composables/Commons/teleport.composable";
88
+ import { useHydration } from "../../composables/Commons/hydration.composable";
87
89
  import { useToggleScope } from "../../composables/Commons/toggleScope.composable";
88
90
  import { useTouch } from "../../composables/Commons/touch.composable";
89
91
  import { useVModel } from "../../composables/Commons/vModel.composable";
@@ -225,10 +227,12 @@ useToggleScope(() => !props.disableRouteWatcher && !!router, () => {
225
227
  watch(() => props.permanent, (val) => {
226
228
  if (val) isActive.value = true;
227
229
  });
228
- onBeforeMount(() => {
230
+ const initActive = () => {
229
231
  if (props.modelValue != null || isTemporary.value) return;
230
232
  isActive.value = props.permanent;
231
- });
233
+ };
234
+ onBeforeMount(initActive);
235
+ onServerPrefetch(initActive);
232
236
  const { isDragging, dragProgress, dragStyles } = useTouch({
233
237
  isActive,
234
238
  isTemporary,
@@ -275,13 +279,13 @@ const { layoutItemStyles, layoutItemScrimStyles, layoutId } = useLayoutItem({
275
279
  const resolvedLayoutId = computed(() => isRef(layoutId) ? layoutId.value : layoutId);
276
280
  const isLayoutOrphan = computed(() => resolvedLayoutId.value === "origam-layout-orphan");
277
281
  const teleportDrawer = computed(() => {
278
- if (isLayoutOrphan.value) return void 0;
279
282
  return `#${resolvedLayoutId.value} .origam-layout__wrapper`;
280
283
  });
281
284
  const hasExplicitAttach = computed(() => props.attach !== null);
282
285
  const { teleportTarget: attachTarget } = useTeleport(computed(() => props.attach || false));
286
+ const isHydrated = useHydration();
283
287
  const teleportDisabled = computed(() => {
284
- return hasExplicitAttach.value ? !attachTarget.value : isLayoutOrphan.value;
288
+ return hasExplicitAttach.value ? !attachTarget.value : isLayoutOrphan.value || !isHydrated.value;
285
289
  });
286
290
  const teleportTo = computed(() => {
287
291
  return hasExplicitAttach.value ? attachTarget.value : teleportDrawer.value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "origam",
3
- "version": "2.37.5",
3
+ "version": "2.37.6",
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": [