@agencecinq/utils 4.0.0 → 4.0.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.
@@ -1,13 +1,13 @@
1
1
 
2
2
  
3
- > @agencecinq/utils@4.0.0 build /Users/19h47/Sites/agencecinq-shopify/packages/utils
3
+ > @agencecinq/utils@4.0.1 build /Users/19h47/Sites/agencecinq-ui/packages/utils
4
4
  > vite build
5
5
 
6
6
  vite v7.3.1 building client environment for production...
7
- transforming (1) src/index.ts✓ 7 modules transformed.
7
+ transforming (1) src/index.tstransforming (5) src/scroll.ts✓ 7 modules transformed.
8
8
  rendering chunks (1)...
9
9
  [vite:dts] Start generate declaration files...
10
- computing gzip size (0)...computing gzip size (1)...dist/index.js 3.37 kB │ gzip: 1.55 kB
11
- [vite:dts] Declaration files built in 1450ms.
10
+ computing gzip size (0)...computing gzip size (1)...dist/index.js 3.41 kB │ gzip: 1.57 kB
11
+ [vite:dts] Declaration files built in 1952ms.
12
12
  
13
- ✓ built in 1.62s
13
+ ✓ built in 2.35s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @agencecinq/utils
2
2
 
3
+ ## 4.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Add `CART_BEFORE_UPDATE` event constant to coordinate cart pre-update flows. Listeners can call `event.preventDefault()` on the dispatched `CustomEvent` to take ownership of subsequent section rendering (e.g. a free-samples controller batching its own sync into a single render).
8
+
3
9
  ## 4.0.0
4
10
 
5
11
  ### Major Changes
package/dist/events.d.ts CHANGED
@@ -5,6 +5,7 @@ export declare const EVENTS: {
5
5
  MODAL_CLOSE: string;
6
6
  MODAL_OPEN: string;
7
7
  MODAL_TOGGLE: string;
8
+ CART_BEFORE_UPDATE: string;
8
9
  CART_UPDATE: string;
9
10
  VARIANT_CHANGE: string;
10
11
  };
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;CASlB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,OAAO,MAAM,CAAC,MAAM,OAAO,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;CAUlB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,OAAO,MAAM,CAAC,MAAM,OAAO,MAAM,CAAC,CAAC"}
package/dist/index.js CHANGED
@@ -1,10 +1,11 @@
1
- const _ = {
1
+ const D = {
2
2
  DRAWER_CLOSE: "drawer-close",
3
3
  DRAWER_OPEN: "drawer-open",
4
4
  DRAWER_TOGGLE: "drawer-toggle",
5
5
  MODAL_CLOSE: "modal-close",
6
6
  MODAL_OPEN: "modal-open",
7
7
  MODAL_TOGGLE: "modal-toggle",
8
+ CART_BEFORE_UPDATE: "cart-before-update",
8
9
  CART_UPDATE: "cart-update",
9
10
  VARIANT_CHANGE: "variant-change"
10
11
  }, f = (e, t) => {
@@ -15,7 +16,7 @@ const _ = {
15
16
  return (...c) => {
16
17
  r = c, o || (o = setTimeout(s, t));
17
18
  };
18
- }, l = document.documentElement, { body: i } = document, W = l.hasAttribute("data-debug"), n = {
19
+ }, l = document.documentElement, { body: i } = document, C = l.hasAttribute("data-debug"), n = {
19
20
  y: 0,
20
21
  x: 0
21
22
  }, a = {
@@ -29,12 +30,12 @@ window.addEventListener(
29
30
  }, 100),
30
31
  { passive: !0 }
31
32
  );
32
- const k = {
33
+ const W = {
33
34
  lg: window.matchMedia("(width >= 64rem)"),
34
35
  xl: window.matchMedia("(min-width: 1280px)"),
35
36
  "2xl": window.matchMedia("(min-width: 1440px)"),
36
37
  "3xl": window.matchMedia("(min-width: 1920px)")
37
- }, C = !0, u = (e, t) => {
38
+ }, k = !0, u = (e, t) => {
38
39
  typeof e < "u" && (n.x = e), typeof t < "u" && (n.y = t), window.scrollTo(n.x, n.y);
39
40
  };
40
41
  function M() {
@@ -76,36 +77,36 @@ function G(e, t = e) {
76
77
  function E(e = null) {
77
78
  d.keydown && document.removeEventListener("keydown", d.keydown), e && e.focus();
78
79
  }
79
- const p = 8, w = 9, h = 13, A = 16, b = 27, g = 32, x = 33, R = 34, v = 35, L = 36, P = 37, O = 38, S = 39, T = 40, D = 46, H = {
80
+ const p = 8, w = 9, A = 13, h = 16, b = 27, g = 32, R = 33, x = 34, P = 35, T = 36, v = 37, L = 38, O = 39, S = 40, _ = 46, H = {
80
81
  BACKSPACE: p,
81
82
  TAB: w,
82
- ENTER: h,
83
- SHIFT: A,
83
+ ENTER: A,
84
+ SHIFT: h,
84
85
  ESCAPE: b,
85
86
  SPACE: g,
86
- PAGE_UP: x,
87
- PAGE_DOWN: R,
88
- END: v,
89
- HOME: L,
90
- ARROW_LEFT: P,
91
- ARROW_UP: O,
92
- ARROW_RIGHT: S,
93
- ARROW_DOWN: T,
94
- DELETE: D
87
+ PAGE_UP: R,
88
+ PAGE_DOWN: x,
89
+ END: P,
90
+ HOME: T,
91
+ ARROW_LEFT: v,
92
+ ARROW_UP: L,
93
+ ARROW_RIGHT: O,
94
+ ARROW_DOWN: S,
95
+ DELETE: _
95
96
  };
96
97
  export {
97
- _ as EVENTS,
98
+ D as EVENTS,
98
99
  G as addTrapFocus,
99
100
  i as body,
100
- k as breakpoints,
101
+ W as breakpoints,
101
102
  M as disableScroll,
102
103
  N as enableScroll,
103
104
  y as getFocusableElements,
104
105
  l as html,
105
- W as isDebug,
106
+ C as isDebug,
106
107
  H as keycode,
107
108
  a as mouse,
108
- C as production,
109
+ k as production,
109
110
  E as removeTrapFocus,
110
111
  n as scroll,
111
112
  f as throttle
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agencecinq/utils",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
package/src/events.ts CHANGED
@@ -5,6 +5,7 @@ export const EVENTS = {
5
5
  MODAL_CLOSE: 'modal-close',
6
6
  MODAL_OPEN: 'modal-open',
7
7
  MODAL_TOGGLE: 'modal-toggle',
8
+ CART_BEFORE_UPDATE: 'cart-before-update',
8
9
  CART_UPDATE: 'cart-update',
9
10
  VARIANT_CHANGE: 'variant-change',
10
11
  };