origam 2.40.1 → 2.41.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.
Files changed (66) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/src/components/Breadcrumb/OrigamBreadcrumb.vue +2 -1
  3. package/dist/src/components/Chart/OrigamChartCartesian.vue +1 -2
  4. package/dist/src/components/Code/OrigamCode.vue +5 -16
  5. package/dist/src/components/DataTable/OrigamDataTable.vue +4 -5
  6. package/dist/src/components/Dialog/OrigamDialog.vue +3 -10
  7. package/dist/src/components/Drawer/OrigamDrawer.vue +4 -2
  8. package/dist/src/components/Grids/OrigamRow.vue +8 -11
  9. package/dist/src/components/Media/OrigamMediaController.vue +3 -2
  10. package/dist/src/components/Overlay/OrigamOverlay.vue +3 -4
  11. package/dist/src/components/Transition/OrigamTranslateScale.vue +4 -1
  12. package/dist/src/components/Window/OrigamWindow.vue +2 -3
  13. package/dist/src/composables/Commons/accessibleCommand.composable.cjs +2 -1
  14. package/dist/src/composables/Commons/accessibleCommand.composable.js +2 -1
  15. package/dist/src/composables/Commons/backButton.composable.cjs +14 -18
  16. package/dist/src/composables/Commons/backButton.composable.d.ts +4 -2
  17. package/dist/src/composables/Commons/backButton.composable.js +14 -18
  18. package/dist/src/composables/Commons/backgroundColor.composable.cjs +7 -3
  19. package/dist/src/composables/Commons/backgroundColor.composable.js +6 -3
  20. package/dist/src/composables/Commons/bothColor.composable.cjs +6 -2
  21. package/dist/src/composables/Commons/bothColor.composable.js +7 -4
  22. package/dist/src/composables/Commons/colorEffect.composable.cjs +2 -1
  23. package/dist/src/composables/Commons/colorEffect.composable.js +3 -1
  24. package/dist/src/composables/Commons/createLayout.composable.cjs +3 -2
  25. package/dist/src/composables/Commons/createLayout.composable.js +3 -2
  26. package/dist/src/composables/Commons/cssSupportClient.composable.d.ts +2 -1
  27. package/dist/src/composables/Commons/dragResizer.composable.cjs +7 -10
  28. package/dist/src/composables/Commons/dragResizer.composable.d.ts +2 -2
  29. package/dist/src/composables/Commons/dragResizer.composable.js +7 -10
  30. package/dist/src/composables/Commons/elevation.composable.cjs +2 -1
  31. package/dist/src/composables/Commons/elevation.composable.js +2 -1
  32. package/dist/src/composables/Commons/locationStrategies.composable.d.ts +1 -1
  33. package/dist/src/composables/Commons/passedProps.composable.cjs +1 -1
  34. package/dist/src/composables/Commons/passedProps.composable.js +1 -1
  35. package/dist/src/composables/Commons/textColor.composable.cjs +7 -3
  36. package/dist/src/composables/Commons/textColor.composable.js +6 -3
  37. package/dist/src/composables/Commons/touch.composable.cjs +17 -1
  38. package/dist/src/composables/Commons/touch.composable.js +17 -1
  39. package/dist/src/composables/Parallax/parallax.composable.cjs +2 -10
  40. package/dist/src/composables/Parallax/parallax.composable.js +2 -10
  41. package/dist/src/consts/Commons/border.const.cjs +5 -1
  42. package/dist/src/consts/Commons/border.const.js +5 -1
  43. package/dist/src/consts/TextField/text-field.const.d.ts +1 -2
  44. package/dist/src/consts/TextField/text-field.const.js +1 -2
  45. package/dist/src/directives/Contrast/contrast.directive.cjs +1 -1
  46. package/dist/src/directives/Contrast/contrast.directive.js +1 -1
  47. package/dist/src/enums/BottomNav/bottom-nav.enum.cjs +4 -5
  48. package/dist/src/enums/BottomNav/bottom-nav.enum.js +4 -5
  49. package/dist/src/interfaces/Blockquote/blockquote.interface.d.ts +1 -1
  50. package/dist/src/interfaces/Chart/chart-map.interface.d.ts +5 -4
  51. package/dist/src/interfaces/Commons/activator.interface.d.ts +1 -1
  52. package/dist/src/interfaces/Parallax/parallax.interface.d.ts +3 -2
  53. package/dist/src/origam-core.cjs +1 -1
  54. package/dist/src/origam-core.js +1 -1
  55. package/dist/src/types/Grids/row.type.d.ts +2 -1
  56. package/dist/src/types/Parallax/parallax.type.d.ts +1 -2
  57. package/dist/src/types/TextField/text-field.type.d.ts +2 -1
  58. package/dist/src/utils/Commons/animation.util.cjs +7 -4
  59. package/dist/src/utils/Commons/animation.util.js +4 -1
  60. package/dist/src/utils/Commons/nested.util.cjs +3 -1
  61. package/dist/src/utils/Commons/nested.util.js +4 -1
  62. package/dist/src/utils/Commons/spacing.util.cjs +1 -1
  63. package/dist/src/utils/Commons/spacing.util.js +1 -1
  64. package/dist/src/utils/Commons/token-name.util.cjs +9 -6
  65. package/dist/src/utils/Commons/token-name.util.js +9 -6
  66. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -18,6 +18,26 @@ This project follows [Semantic Versioning](https://semver.org).
18
18
 
19
19
  ## [Unreleased]
20
20
 
21
+ ## [2.41.0] - 2026-11-21
22
+
23
+ ### Fixed — Quality Gate Sonar vert sur le nouveau code (#1390)
24
+
25
+ - `new_violations` : **279 → 0** (mesure SonarQube après #1402, Quality Gate `OK`). 180 imports dupliqués fusionnés (S3863, #1399), ~45 défauts TypeScript (ternaires imbriqués, assertions inutiles, `TAnyString`, API dépréciées, #1401, #1402), 11 défauts de template (`<output>` natif, code commenté, CSS dupliqué, #1400, #1402). Aucun changement de rendu ni de prop hors la rupture `useBackButton` décrite plus bas.
26
+ - 25 alertes vérifiées comme faux positifs et 10 interfaces d'emits (convention du dépôt) sont marquées dans Sonar, chacune avec sa justification.
27
+ - Garde : règle ESLint `no-duplicate-imports` sur `packages/ds/src` (un `import type` séparé d'un import valeur reste autorisé).
28
+
29
+
30
+ ### Added — plafond CSS d'`OrigamBlockquote` (#1395)
31
+
32
+ - Mesure : `OrigamBlockquote` seul pèse **7,9 Kio de CSS (~1 Kio gzip)**, sans duplication ni règle d'un autre composant. Les ~50 Ko d'`OrigamBlockquote.css` vus dans Elysera sont le CSS de tout ce qui est importé avec lui (Btn 18 Kio, Progress, Avatar, Img…), regroupé par Vite/Nuxt dans un fichier qui garde le nom du premier composant. Rien à réduire dans Blockquote.
33
+ - Garde `TU/origam/blockquote-css-1395.spec.ts` (fixture `TU/fixtures/blockquote-only`) : <= 9 Kio bruts, <= 2 Kio gzip, aucun sélecteur d'un autre composant.
34
+
35
+ ### Changed — rupture : `useBackButton` suit la convention des gardes vue-router, `useParallaxRuntime` n'utilise plus `addListener` (#1390)
36
+
37
+ - **Rupture de signature** : `useBackButton(router, cb)` attend désormais `cb: () => boolean | void` au lieu de `cb: (next: NavigationGuardNext) => void`. `cb` renvoie `false` pour annuler la navigation, toute autre valeur la laisse passer ; `next` (déprécié dans vue-router 5) n'est plus passé. Migration : `(next) => { …; next(false) }` devient `() => { …; return false }`, et `next()` devient « ne rien renvoyer ». Seul appelant interne : `OrigamOverlay` (`closeOnBack`). Aucun consommateur externe connu.
38
+ - Le repli `MediaQueryList.addListener` / `removeListener` est retiré de la détection de `prefers-reduced-motion` : seul `addEventListener('change', …)` reste (Safari 14+, 2020). Un navigateur antérieur ne suit plus le changement de préférence à chaud.
39
+ - Tests : `TU/composables/Commons/router.composable.spec.ts`, `TU/composables/Parallax/parallax.composable.spec.ts`.
40
+
21
41
  ## [2.40.1] - 2026-11-21
22
42
 
23
43
  ### Fixed — `origam-img` ne plante plus quand son élément n'est pas monté (#1394)
@@ -657,7 +657,8 @@ const { colorClasses, colorStyles, borderClasses, borderStyles, roundedClasses,
657
657
  const resolveActive = (item, index) => {
658
658
  if (!isLastItem(index)) return false;
659
659
  const ownConfig = typeof item === "string" ? undefined : item.active;
660
- const config = ownConfig !== undefined ? ownConfig : wasPropPassed("active") ? props.active : undefined;
660
+ const inheritedConfig = wasPropPassed("active") ? props.active : undefined;
661
+ const config = ownConfig !== undefined ? ownConfig : inheritedConfig;
661
662
  return config && typeof config === "object" ? {
662
663
  ...config,
663
664
  enabled: true
@@ -496,7 +496,7 @@ import { useChartAnimationStyle } from "../../composables/Chart/chart-animation.
496
496
  import { useChartRoving } from "../../composables/Chart/chart-roving.composable";
497
497
  import { useChartSize } from "../../composables/Chart/chart-size.composable";
498
498
  import { useBackgroundColor } from "../../composables/Commons/backgroundColor.composable";
499
- import { useChart } from "../../composables/Chart/chart.composable";
499
+ import { useChart, computeAnnotationGeometry, computePlotBandGeometry, computePlotLineGeometry } from "../../composables/Chart/chart.composable";
500
500
  import { useChartZoom } from "../../composables/Chart/chart-zoom.composable";
501
501
  import { useDimension } from "../../composables/Commons/dimension.composable";
502
502
  import { useElevation } from "../../composables/Commons/elevation.composable";
@@ -504,7 +504,6 @@ import { useLocale } from "../../composables/Commons/locale.composable";
504
504
  import { useMargin } from "../../composables/Commons/margin.composable";
505
505
  import { usePadding } from "../../composables/Commons/padding.composable";
506
506
  import { useRounded } from "../../composables/Commons/rounded.composable";
507
- import { computeAnnotationGeometry, computePlotBandGeometry, computePlotLineGeometry } from "../../composables/Chart/chart.composable";
508
507
  import { CHART_RANGE_SELECTOR_DEFAULT_BUTTONS, CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
509
508
  import { CHART_ZOOM_RESET_GAP, CHART_ZOOM_RESET_MIN_WIDTH, CHART_ZOOM_RESET_PADDING_X } from "../../consts/Chart/chart-cartesian.const";
510
509
  import { OrigamBtn } from "../Btn";
@@ -45,22 +45,11 @@
45
45
  <span v-if="compact && prompt" class="origam-code__prompt" aria-hidden="true" data-cy="origam-code-prompt">{{ prompt }}</span>
46
46
 
47
47
  <!--
48
- ⛔ #781 — `<section>`, not `<div role="region">`.
49
-
50
- `<section>` maps to the `region` role natively AS SOON AS it
51
- carries an accessible name (HTML-AAM), and `scrollerLabel` is
52
- never empty (`code-scroller-aria-label.spec.ts` pins its two
53
- forms). The explicit role was therefore restating what the tag
54
- already says — "ARIA is a complement, never a replacement", the
55
- DS's own rule.
56
-
57
- `tabindex="0"` STAYS. It is not decoration on a non-interactive
58
- element: this box scrolls (`overflow-x: auto`), and a scroll
59
- container that no keyboard can reach fails WCAG 2.1.1 — the
60
- `scrollable-region-focusable` rule axe-core enforces, already
61
- documented in `a11y/marketing-a11y.spec.ts`. Removing it to
62
- satisfy a "no tabindex on non-interactive elements" lint would
63
- trade a naming nit for a level-A keyboard failure.
48
+ #781: a section element, not a div with an explicit region role.
49
+ It maps to the region role natively once named, and the scroller
50
+ label is never empty. Tabindex 0 stays on purpose: the box scrolls,
51
+ and a scroll container no keyboard can reach fails WCAG 2.1.1
52
+ (axe-core scrollable-region-focusable).
64
53
  -->
65
54
  <section
66
55
  class="origam-code__scroller"
@@ -12,11 +12,10 @@
12
12
  v-if="slots.top || isSkeletonLoading"
13
13
  #top
14
14
  >
15
- <span
15
+ <output
16
16
  v-if="isSkeletonLoading"
17
17
  class="origam-data-table__announcement"
18
- role="status"
19
- >{{ skeletonAnnouncement }}</span>
18
+ >{{ skeletonAnnouncement }}</output>
20
19
  <slot name="top"/>
21
20
  </template>
22
21
 
@@ -1056,9 +1055,9 @@ const dataTableHeadersProps = computed(() => {
1056
1055
  * Skeleton announcement
1057
1056
  *
1058
1057
  * @description
1059
- * While the rows are placeholders the table makes ONE announcement: a single visually hidden `role="status"` in the `top` slot of `<OrigamTable>`.
1058
+ * While the rows are placeholders the table makes ONE announcement: a single visually hidden `<output>` (implicit `role="status"`) in the `top` slot of `<OrigamTable>`.
1060
1059
  * @description
1061
- * That slot sits NEXT TO the `<table>`, where a `<span>` is valid HTML: inside the `<table>` only `<caption>` / `<tbody>`… are allowed and a `<tr>` cannot hold a live region.
1060
+ * That slot sits NEXT TO the `<table>`, where an `<output>` is valid HTML: inside the `<table>` only `<caption>` / `<tbody>`… are allowed and a `<tr>` cannot hold a live region.
1062
1061
  * @description
1063
1062
  * `<caption>` belongs to the consumer (`caption` prop), so it is not borrowed.
1064
1063
  * @description
@@ -44,16 +44,9 @@
44
44
  </template>
45
45
 
46
46
  <!--
47
- #412 — the target names below (`#header.append`, …) address
48
- `<OrigamCard>`'s OWN slots, which it reads as `slots['header.append']`
49
- (point notation, `OrigamCard.vue:70`). Dialog's PUBLIC slot names
50
- exposed to ITS OWN consumers stay dash-named (`<slot name="header-append">`
51
- right below) — the two are independent identifiers: a named
52
- template's target must match the CHILD's slot name, not whatever
53
- name this component re-exposes upward. Pre-fix these were both
54
- written as `#header-append` (dash) — a literal string that never
55
- matched Card's `header.append`, so the five header zones (including
56
- the default close button) were silently discarded. See #412.
47
+ #412: the target names below address the Card's OWN slots, read as
48
+ point-notation keys. Dialog's public slots stay dash-named; the two
49
+ identifiers are independent and the target must match the child's slot name.
57
50
  -->
58
51
  <template #header.append>
59
52
  <slot name="header-append">
@@ -758,7 +758,8 @@ const isHovering = shallowRef(false);
758
758
  * number and a CSS-length string (`parseInt(value, 10)`).
759
759
  ********************************************************/
760
760
  const width = computed(() => {
761
- return props.rail && props.expandOnHover && isHovering.value ? int(props.width) : int(props.rail ? props.railWidth : props.width);
761
+ const isExpanded = props.rail && props.expandOnHover && isHovering.value;
762
+ return int(props.rail && !isExpanded ? props.railWidth : props.width);
762
763
  });
763
764
  const location = computed(() => {
764
765
  return props.location;
@@ -818,7 +819,8 @@ const layoutSize = computed(() => {
818
819
  // reserve 0 space so adjacent toolbar / main / footer stay full
819
820
  // width regardless of whether the drawer is currently visible.
820
821
  if (!isPushing.value) return 0;
821
- const size = isTemporary.value ? 0 : props.rail && props.expandOnHover ? int(props.railWidth) : width.value;
822
+ const restingSize = props.rail && props.expandOnHover ? int(props.railWidth) : width.value;
823
+ const size = isTemporary.value ? 0 : restingSize;
822
824
  return isDragging.value ? size * dragProgress.value : size;
823
825
  });
824
826
  // ── Push / clipped resolution ─────────────────────────────────
@@ -640,6 +640,13 @@ defineExpose({
640
640
  padding-block-end: var(--origam-row---padding-block-end);
641
641
  padding-inline-start: var(--origam-row---padding-inline-start);
642
642
  padding-inline-end: var(--origam-row---padding-inline-end);
643
+ // #950 — gutter margin, same zero-specificity reasoning: the
644
+ // custom properties below stay at (0,2,0), only these consuming
645
+ // declarations drop so `.origam--m-6` can win.
646
+ margin-block-start: calc(var(--origam-row---margin-block-start) + var(--origam-row---density));
647
+ margin-block-end: calc(var(--origam-row---margin-block-end) + var(--origam-row---density));
648
+ margin-inline-start: calc(var(--origam-row---margin-inline-start) + var(--origam-row---density));
649
+ margin-inline-end: calc(var(--origam-row---margin-inline-end) + var(--origam-row---density));
643
650
  }
644
651
 
645
652
  --origam-col---padding-block-start: calc(var(--origam-row---gutter) / 2);
@@ -652,22 +659,12 @@ defineExpose({
652
659
  --origam-row---margin-inline-start: calc(var(--origam-row---gutter) / -2);
653
660
  --origam-row---margin-inline-end: calc(var(--origam-row---gutter) / -2);
654
661
 
655
- // ⛔ #950 — same reasoning for the gutter margin. The custom
656
- // properties above stay at (0,2,0); only the declarations that
657
- // CONSUME them drop to (0,0,0), so `.origam--m-6` can win.
658
- // ⚠️ Deliberately PARTIAL: the `+ .origam-row` rule below is
662
+ // ⚠️ #950 gutter margin: deliberately PARTIAL: the `+ .origam-row` rule below is
659
663
  // (0,3,0) and still overrides `margin-block-start` on every Row
660
664
  // that follows another Row — that gutter collapse is the intended
661
665
  // behaviour and #950 does not touch it. The utility therefore wins
662
666
  // on all four sides of the FIRST Row, and on three sides of the
663
667
  // next ones. (This is what the census read as `repos = -12px`.)
664
- :where(&) {
665
- margin-block-start: calc(var(--origam-row---margin-block-start) + var(--origam-row---density));
666
- margin-block-end: calc(var(--origam-row---margin-block-end) + var(--origam-row---density));
667
- margin-inline-start: calc(var(--origam-row---margin-inline-start) + var(--origam-row---density));
668
- margin-inline-end: calc(var(--origam-row---margin-inline-end) + var(--origam-row---density));
669
- }
670
-
671
668
  + .origam-row {
672
669
  margin-block-start: calc((var(--origam-row---margin-block-start) + var(--origam-row---density)) * -1);
673
670
  }
@@ -444,7 +444,9 @@ function emitNext() {
444
444
  const loopModeModel = useVModel(props, "loopMode", () => "none");
445
445
  const resolvedLoopMode = computed(() => loopModeModel.value);
446
446
  function cycleLoopMode() {
447
- const next = loopModeModel.value === "none" ? "all" : loopModeModel.value === "all" ? "one" : "none";
447
+ let next = "none";
448
+ if (loopModeModel.value === "none") next = "all";
449
+ else if (loopModeModel.value === "all") next = "one";
448
450
  loopModeModel.value = next;
449
451
  }
450
452
  const loopIcon = computed(() => {
@@ -600,7 +602,6 @@ function onConfigSelect(item) {
600
602
  if (item.key.startsWith("quality-") && typeof item.value === "string") {
601
603
  emit("quality-change", item.value);
602
604
  configMenuOpen.value = false;
603
- return;
604
605
  }
605
606
  }
606
607
  /*********************************************************
@@ -474,14 +474,13 @@ onBeforeUnmount(() => {
474
474
  ********************************************************/
475
475
  const router = useRouter();
476
476
  useToggleScope(() => props.closeOnBack, () => {
477
- useBackButton(router, (next) => {
477
+ useBackButton(router, () => {
478
478
  if (globalTop.value && isActive.value) {
479
- next(false);
480
479
  if (!props.persistent) isActive.value = false;
481
480
  else animateClick();
482
- } else {
483
- next();
481
+ return false;
484
482
  }
483
+ return undefined;
485
484
  });
486
485
  });
487
486
  const top = ref();
@@ -142,7 +142,10 @@ const handleBeforeEnter = (el) => {
142
142
  const handleEnter = async (el, done) => {
143
143
  await nextFrame();
144
144
  await nextFrame();
145
- if (disposed) return;
145
+ if (disposed) {
146
+ return;
147
+ }
148
+ ;
146
149
  el.style.visibility = "";
147
150
  const { x, y, sx, sy, speed } = getDimensions(props.target, el);
148
151
  const animation = animate(el, [{
@@ -8,14 +8,13 @@
8
8
  :style="windowStyles"
9
9
  v-bind="landmarkAttrs"
10
10
  >
11
- <p
11
+ <output
12
12
  class="origam-window__live-region"
13
- role="status"
14
13
  aria-atomic="true"
15
14
  aria-live="polite"
16
15
  >
17
16
  {{ slideAnnouncement }}
18
- </p>
17
+ </output>
19
18
 
20
19
  <div
21
20
  :style="windowContainerStyles"
@@ -12,7 +12,8 @@ function useAccessibleCommand(options) {
12
12
  return (0, _vue.computed)(() => {
13
13
  if (!options.active.value) return {};
14
14
  const raw = options.label();
15
- const name = raw ? locale ? locale.t(raw) : raw : "";
15
+ const translated = raw && locale ? locale.t(raw) : raw;
16
+ const name = translated ?? "";
16
17
  if (!name) {
17
18
  (0, _a11y.warnMissingAccessibleName)(options.component, options.zone, options.prop);
18
19
  return {};
@@ -6,7 +6,8 @@ export function useAccessibleCommand(options) {
6
6
  return computed(() => {
7
7
  if (!options.active.value) return {};
8
8
  const raw = options.label();
9
- const name = raw ? locale ? locale.t(raw) : raw : "";
9
+ const translated = raw && locale ? locale.t(raw) : raw;
10
+ const name = translated ?? "";
10
11
  if (!name) {
11
12
  warnMissingAccessibleName(options.component, options.zone, options.prop);
12
13
  return {};
@@ -12,28 +12,24 @@ function useBackButton(router, cb) {
12
12
  let removeBefore;
13
13
  let removeAfter;
14
14
  let poppedReset;
15
+ const decide = () => popped ? cb() : void 0;
16
+ const guard = () => {
17
+ let result;
18
+ if (!inTransition) {
19
+ result = new Promise(resolve => {
20
+ setTimeout(() => resolve(decide()));
21
+ });
22
+ } else {
23
+ result = decide();
24
+ }
25
+ inTransition = true;
26
+ return result;
27
+ };
15
28
  if (_commons.IN_BROWSER) {
16
29
  (0, _vue.nextTick)(() => {
17
30
  window.addEventListener("popstate", onPopstate);
18
31
  if (router) {
19
- removeBefore = router.beforeEach((_to, _from, next) => {
20
- if (!inTransition) {
21
- setTimeout(() => {
22
- if (popped) {
23
- cb(next);
24
- } else {
25
- next();
26
- }
27
- });
28
- } else {
29
- if (popped) {
30
- cb(next);
31
- } else {
32
- next();
33
- }
34
- }
35
- inTransition = true;
36
- });
32
+ removeBefore = router.beforeEach(guard);
37
33
  removeAfter = router.afterEach(() => {
38
34
  inTransition = false;
39
35
  });
@@ -1,4 +1,4 @@
1
- import type { NavigationGuardNext, Router } from 'vue-router';
1
+ import type { Router } from 'vue-router';
2
2
  /*********************************************************
3
3
  * useBackButton
4
4
  *
@@ -7,7 +7,9 @@ import type { NavigationGuardNext, Router } from 'vue-router';
7
7
  * (e.g. a Dialog / Sheet / Bottom-sheet) can intercept the native
8
8
  * back-button gesture and run its own close callback instead of
9
9
  * letting the browser navigate away.
10
+ * `cb` suit la convention des gardes vue-router : elle renvoie `false` pour
11
+ * ANNULER la navigation, toute autre valeur la laisse passer (plus de `next`).
10
12
  * Independent from `useRoute` / `useRouter` / `useLink` — does not
11
13
  * delegate to any of them.
12
14
  ********************************************************/
13
- export declare function useBackButton(router: Router | undefined, cb: (next: NavigationGuardNext) => void): void;
15
+ export declare function useBackButton(router: Router | undefined, cb: () => boolean | void): void;
@@ -6,28 +6,24 @@ export function useBackButton(router, cb) {
6
6
  let removeBefore;
7
7
  let removeAfter;
8
8
  let poppedReset;
9
+ const decide = () => popped ? cb() : void 0;
10
+ const guard = () => {
11
+ let result;
12
+ if (!inTransition) {
13
+ result = new Promise((resolve) => {
14
+ setTimeout(() => resolve(decide()));
15
+ });
16
+ } else {
17
+ result = decide();
18
+ }
19
+ inTransition = true;
20
+ return result;
21
+ };
9
22
  if (IN_BROWSER) {
10
23
  nextTick(() => {
11
24
  window.addEventListener("popstate", onPopstate);
12
25
  if (router) {
13
- removeBefore = router.beforeEach((_to, _from, next) => {
14
- if (!inTransition) {
15
- setTimeout(() => {
16
- if (popped) {
17
- cb(next);
18
- } else {
19
- next();
20
- }
21
- });
22
- } else {
23
- if (popped) {
24
- cb(next);
25
- } else {
26
- next();
27
- }
28
- }
29
- inTransition = true;
30
- });
26
+ removeBefore = router.beforeEach(guard);
31
27
  removeAfter = router.afterEach(() => {
32
28
  inTransition = false;
33
29
  });
@@ -7,9 +7,13 @@ exports.useBackgroundColor = useBackgroundColor;
7
7
  var _vue = require("vue");
8
8
  var _color = require("./color.composable.cjs");
9
9
  function useBackgroundColor(props, name) {
10
- const colors = (0, _vue.computed)(() => ({
11
- background: (0, _vue.isRef)(props) ? props.value : name ? props[name] : null
12
- }));
10
+ const colors = (0, _vue.computed)(() => {
11
+ let background = null;
12
+ if ((0, _vue.isRef)(props)) background = props.value;else if (name) background = props[name];
13
+ return {
14
+ background
15
+ };
16
+ });
13
17
  const {
14
18
  colorClasses: backgroundColorClasses,
15
19
  colorStyles: backgroundColorStyles
@@ -1,9 +1,12 @@
1
1
  import { computed, isRef } from "vue";
2
2
  import { useColor } from "./color.composable.js";
3
3
  export function useBackgroundColor(props, name) {
4
- const colors = computed(() => ({
5
- background: isRef(props) ? props.value : name ? props[name] : null
6
- }));
4
+ const colors = computed(() => {
5
+ let background = null;
6
+ if (isRef(props)) background = props.value;
7
+ else if (name) background = props[name];
8
+ return { background };
9
+ });
7
10
  const { colorClasses: backgroundColorClasses, colorStyles: backgroundColorStyles } = useColor(colors);
8
11
  return { backgroundColorClasses, backgroundColorStyles };
9
12
  }
@@ -8,9 +8,13 @@ var _vue = require("vue");
8
8
  var _color = require("./color.composable.cjs");
9
9
  function useBothColor(bgColorProps, colorProps, name) {
10
10
  const bothColors = (0, _vue.computed)(() => {
11
+ let text = null;
12
+ if ((0, _vue.isRef)(colorProps)) text = colorProps.value;else if (name) text = colorProps[name];
13
+ let background = null;
14
+ if ((0, _vue.isRef)(bgColorProps)) background = bgColorProps.value;else if (name) background = bgColorProps[name];
11
15
  return {
12
- text: (0, _vue.isRef)(colorProps) ? colorProps.value : name ? colorProps[name] : null,
13
- background: (0, _vue.isRef)(bgColorProps) ? bgColorProps.value : name ? bgColorProps[name] : null
16
+ text,
17
+ background
14
18
  };
15
19
  });
16
20
  return (0, _color.useColor)(bothColors);
@@ -2,10 +2,13 @@ import { computed, isRef } from "vue";
2
2
  import { useColor } from "./color.composable.js";
3
3
  export function useBothColor(bgColorProps, colorProps, name) {
4
4
  const bothColors = computed(() => {
5
- return {
6
- text: isRef(colorProps) ? colorProps.value : name ? colorProps[name] : null,
7
- background: isRef(bgColorProps) ? bgColorProps.value : name ? bgColorProps[name] : null
8
- };
5
+ let text = null;
6
+ if (isRef(colorProps)) text = colorProps.value;
7
+ else if (name) text = colorProps[name];
8
+ let background = null;
9
+ if (isRef(bgColorProps)) background = bgColorProps.value;
10
+ else if (name) background = bgColorProps[name];
11
+ return { text, background };
9
12
  });
10
13
  return useColor(bothColors);
11
14
  }
@@ -79,7 +79,8 @@ function useColorEffect(props, isHover = (0, _vue.ref)(false), isActive = (0, _v
79
79
  });
80
80
  const colorStyles = (0, _vue.computed)(() => {
81
81
  trackReactiveDependency(isDisabled.value);
82
- const bgRole = isHover.value ? "hover" : isActive.value ? "active" : "default";
82
+ let bgRole = "default";
83
+ if (isHover.value) bgRole = "hover";else if (isActive.value) bgRole = "active";
83
84
  const [bgDeclBase, bgIntentFg, bgIsGradient] = resolveBackground(bgColor.value, bgRole);
84
85
  const [fgDecl, bgDeclOverride, clipText] = resolveForeground(color.value, bgColor.value, bgIntentFg, bgIsGradient);
85
86
  const bgDecl = bgDeclOverride ?? bgDeclBase;
@@ -92,7 +92,9 @@ export function useColorEffect(props, isHover = ref(false), isActive = ref(false
92
92
  });
93
93
  const colorStyles = computed(() => {
94
94
  trackReactiveDependency(isDisabled.value);
95
- const bgRole = isHover.value ? "hover" : isActive.value ? "active" : "default";
95
+ let bgRole = "default";
96
+ if (isHover.value) bgRole = "hover";
97
+ else if (isActive.value) bgRole = "active";
96
98
  const [bgDeclBase, bgIntentFg, bgIsGradient] = resolveBackground(bgColor.value, bgRole);
97
99
  const [fgDecl, bgDeclOverride, clipText] = resolveForeground(
98
100
  color.value,
@@ -142,6 +142,7 @@ function useCreateLayout(props) {
142
142
  const index = (0, _vue.computed)(() => items.value.findIndex(i => i.id === id));
143
143
  const zIndex = (0, _vue.computed)(() => rootZIndex.value + layers.value.length * _layout.LAYOUT_ITEM_ZINDEX_STEP - index.value * _layout.LAYOUT_ITEM_ZINDEX_STEP);
144
144
  const isHorizontalPosition = () => position.value === "left" || position.value === "right";
145
+ const fixedSize = () => elementSize.value ? `${(0, _commons.convertToUnit)(elementSize.value)}` : void 0;
145
146
  const baseItemStyles = () => {
146
147
  const isOpposite = position.value === "right" || position.value === "bottom";
147
148
  return {
@@ -158,12 +159,12 @@ function useCreateLayout(props) {
158
159
  const isHorizontal = isHorizontalPosition();
159
160
  const isOppositeHorizontal = position.value === "right";
160
161
  return {
161
- "height": isHorizontal ? `calc(100% - ${(0, _commons.convertToUnit)(item.top)} - ${(0, _commons.convertToUnit)(item.bottom)})` : elementSize.value ? `${(0, _commons.convertToUnit)(elementSize.value)}` : void 0,
162
+ "height": isHorizontal ? `calc(100% - ${(0, _commons.convertToUnit)(item.top)} - ${(0, _commons.convertToUnit)(item.bottom)})` : fixedSize(),
162
163
  left: isOppositeHorizontal ? void 0 : (0, _commons.convertToUnit)(item.left),
163
164
  right: isOppositeHorizontal ? (0, _commons.convertToUnit)(item.right) : void 0,
164
165
  top: position.value !== "bottom" ? (0, _commons.convertToUnit)(item.top) : void 0,
165
166
  bottom: position.value !== "top" ? (0, _commons.convertToUnit)(item.bottom) : void 0,
166
- "width": !isHorizontal ? `calc(100% - ${(0, _commons.convertToUnit)(item.left)} - ${(0, _commons.convertToUnit)(item.right)})` : elementSize.value ? `${(0, _commons.convertToUnit)(elementSize.value)}` : void 0
167
+ "width": !isHorizontal ? `calc(100% - ${(0, _commons.convertToUnit)(item.left)} - ${(0, _commons.convertToUnit)(item.right)})` : fixedSize()
167
168
  };
168
169
  };
169
170
  const layoutItemStyles = (0, _vue.computed)(() => {
@@ -137,6 +137,7 @@ export function useCreateLayout(props) {
137
137
  const index = computed(() => items.value.findIndex((i) => i.id === id));
138
138
  const zIndex = computed(() => rootZIndex.value + layers.value.length * LAYOUT_ITEM_ZINDEX_STEP - index.value * LAYOUT_ITEM_ZINDEX_STEP);
139
139
  const isHorizontalPosition = () => position.value === "left" || position.value === "right";
140
+ const fixedSize = () => elementSize.value ? `${convertToUnit(elementSize.value)}` : void 0;
140
141
  const baseItemStyles = () => {
141
142
  const isOpposite = position.value === "right" || position.value === "bottom";
142
143
  return {
@@ -151,12 +152,12 @@ export function useCreateLayout(props) {
151
152
  const isHorizontal = isHorizontalPosition();
152
153
  const isOppositeHorizontal = position.value === "right";
153
154
  return {
154
- "height": isHorizontal ? `calc(100% - ${convertToUnit(item.top)} - ${convertToUnit(item.bottom)})` : elementSize.value ? `${convertToUnit(elementSize.value)}` : void 0,
155
+ "height": isHorizontal ? `calc(100% - ${convertToUnit(item.top)} - ${convertToUnit(item.bottom)})` : fixedSize(),
155
156
  left: isOppositeHorizontal ? void 0 : convertToUnit(item.left),
156
157
  right: isOppositeHorizontal ? convertToUnit(item.right) : void 0,
157
158
  top: position.value !== "bottom" ? convertToUnit(item.top) : void 0,
158
159
  bottom: position.value !== "top" ? convertToUnit(item.bottom) : void 0,
159
- "width": !isHorizontal ? `calc(100% - ${convertToUnit(item.left)} - ${convertToUnit(item.right)})` : elementSize.value ? `${convertToUnit(elementSize.value)}` : void 0
160
+ "width": !isHorizontal ? `calc(100% - ${convertToUnit(item.left)} - ${convertToUnit(item.right)})` : fixedSize()
160
161
  };
161
162
  };
162
163
  const layoutItemStyles = computed(() => {
@@ -1,6 +1,7 @@
1
1
  import type { Ref } from 'vue';
2
2
  import type { IUseCssSupportClientOptions } from '../../interfaces/Commons/css-support.interface';
3
3
  import type { TCssFeatureName } from '../../types/Commons/css-support.type';
4
+ import type { TAnyString } from '../../types/Commons/commons.type';
4
5
  /*********************************************************
5
6
  * useCssSupportClient
6
7
  *
@@ -16,4 +17,4 @@ import type { TCssFeatureName } from '../../types/Commons/css-support.type';
16
17
  * // <div v-if="supportsContainer">…CSS path…</div>
17
18
  * // <div v-else>…JS fallback path…</div>
18
19
  ********************************************************/
19
- export declare function useCssSupportClient(feature: TCssFeatureName | string, options?: IUseCssSupportClientOptions): Ref<boolean>;
20
+ export declare function useCssSupportClient(feature: TCssFeatureName | TAnyString, options?: IUseCssSupportClientOptions): Ref<boolean>;
@@ -22,17 +22,18 @@ function useDragResizer(el, value, min, max, axis) {
22
22
  removeListeners.forEach(fn => fn());
23
23
  resizing.value = false;
24
24
  };
25
+ const moveHandler = (start, initialStart) => e => {
26
+ const clickOffset = (0, _commons.getPosition)(e, isHorizontal.value ? _enums.CLIENT_POSITION.X : _enums.CLIENT_POSITION.Y);
27
+ const delta = clickOffset - start;
28
+ value.value = (0, _commons.clamp)(initialStart + delta, (0, _vue.toValue)(min), (0, _vue.toValue)(max));
29
+ };
25
30
  const onMouseDown = e => {
26
31
  e.preventDefault();
27
32
  e.stopPropagation();
28
33
  const start = (0, _commons.getPosition)(e, isHorizontal.value ? _enums.CLIENT_POSITION.X : _enums.CLIENT_POSITION.Y);
29
34
  const initialStart = value.value;
30
35
  resizing.value = true;
31
- const onMouseMove = e2 => {
32
- const clickOffset = (0, _commons.getPosition)(e2, isHorizontal.value ? _enums.CLIENT_POSITION.X : _enums.CLIENT_POSITION.Y);
33
- const delta = clickOffset - start;
34
- value.value = (0, _commons.clamp)(initialStart + delta, (0, _vue.toValue)(min), (0, _vue.toValue)(max));
35
- };
36
+ const onMouseMove = moveHandler(start, initialStart);
36
37
  const onMouseUp = onDragEnd;
37
38
  removeListeners.push(...[(0, _commons.addWindowListener)("mousemove", onMouseMove, onUnmountedCleanupFns), (0, _commons.addWindowListener)("mouseup", onMouseUp, onUnmountedCleanupFns)]);
38
39
  };
@@ -42,11 +43,7 @@ function useDragResizer(el, value, min, max, axis) {
42
43
  const start = (0, _commons.getPosition)(e, isHorizontal.value ? _enums.CLIENT_POSITION.X : _enums.CLIENT_POSITION.Y);
43
44
  const initialStart = value.value;
44
45
  resizing.value = true;
45
- const onTouchMove = e2 => {
46
- const clickOffset = (0, _commons.getPosition)(e2, isHorizontal.value ? _enums.CLIENT_POSITION.X : _enums.CLIENT_POSITION.Y);
47
- const delta = clickOffset - start;
48
- value.value = (0, _commons.clamp)(initialStart + delta, (0, _vue.toValue)(min), (0, _vue.toValue)(max));
49
- };
46
+ const onTouchMove = moveHandler(start, initialStart);
50
47
  const onTouchEnd = onDragEnd;
51
48
  removeListeners.push(...[(0, _commons.addWindowListener)("touchmove", onTouchMove, onUnmountedCleanupFns), (0, _commons.addWindowListener)("touchend", onTouchEnd, onUnmountedCleanupFns), (0, _commons.addWindowListener)("touchcancel", onTouchEnd, onUnmountedCleanupFns)]);
52
49
  };
@@ -12,8 +12,8 @@ import type { TAxis } from '../../types/Commons/axis.type';
12
12
  *
13
13
  * @description
14
14
  * ⛔ Seul l'axe `X` (`AXIS.X`) est reellement gere : `isVertical` est
15
- * commente en mort dans le code et un `// TODO - Rework for both axis`
16
- * l'annonce explicitement. Passer `AXIS.Y` fait juste tomber dans la
15
+ * commente en mort dans le code et un commentaire de rework (« Rework for
16
+ * both axis ») l'annonce explicitement. Passer `AXIS.Y` fait juste tomber dans la
17
17
  * branche verticale de `getPosition` sans etre teste par ce composable.
18
18
  *
19
19
  * @description