@adam-milo/ui 1.0.28 → 1.0.29
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/dist/index.cjs +1 -1
- package/dist/index.js +3 -1
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +1 -1
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +1 -1
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +1 -1
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +1 -1
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +1 -1
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +2 -2
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +1 -1
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +1 -1
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +1 -1
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +43 -12
- package/dist/index2.cjs +1 -1
- package/dist/index2.js +1 -1
- package/dist/index20.cjs +1 -0
- package/dist/index20.js +14 -0
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +20 -299
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +298 -13
- package/dist/index24.cjs +1 -0
- package/dist/index24.js +16 -0
- package/dist/{index26.cjs → index27.cjs} +1 -1
- package/dist/{index26.js → index27.js} +21 -21
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +2 -2
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +18 -3
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +3 -8
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +7 -66
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +66 -35
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +31 -56
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +60 -6
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +6 -208
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +203 -20
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +23 -202
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +204 -10
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +1 -1
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +10 -289
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +288 -13
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +14 -39
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +36 -82
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +84 -9
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +8 -65
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +68 -3
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +3 -11
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +11 -31
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +30 -118
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +2 -2
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +120 -9
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +8 -14
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +14 -22
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +291 -33
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +22 -622
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +35 -35
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +620 -33
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +37 -5
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +36 -8
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +1 -1
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +5 -3
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +8 -33
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +3 -178
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +31 -17
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +165 -706
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +16 -149
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +697 -149
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +150 -43
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +170 -10
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +83 -14
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +1 -1
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +41 -96
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +10 -85
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +15 -7
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +99 -26
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +8 -34
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +27 -14
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +30 -41
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +13 -6
- package/dist/index88.cjs +1 -0
- package/dist/index88.js +48 -0
- package/dist/index89.cjs +1 -0
- package/dist/index89.js +9 -0
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +2 -2
- package/dist/src/components/typography/text/Text.component.d.ts +93 -0
- package/dist/src/components/typography/text/Text.component.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/index21.cjs +0 -1
- package/dist/index21.js +0 -22
- package/dist/index38.cjs +0 -1
- package/dist/index38.js +0 -21
- package/dist/index62.cjs +0 -1
- package/dist/index62.js +0 -297
- /package/dist/{index34.cjs → index35.cjs} +0 -0
- /package/dist/{index34.js → index35.js} +0 -0
package/dist/index68.js
CHANGED
|
@@ -1,7 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var __assign = function() {
|
|
2
|
+
__assign = Object.assign || function __assign2(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
return __assign.apply(this, arguments);
|
|
10
|
+
};
|
|
11
|
+
function __rest(s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
}
|
|
22
|
+
function __spreadArray(to, from, pack) {
|
|
23
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
24
|
+
if (ar || !(i in from)) {
|
|
25
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
26
|
+
ar[i] = from[i];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
30
|
+
}
|
|
31
|
+
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
32
|
+
var e = new Error(message);
|
|
33
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
34
|
+
};
|
|
5
35
|
export {
|
|
6
|
-
|
|
36
|
+
__assign,
|
|
37
|
+
__rest,
|
|
38
|
+
__spreadArray
|
|
7
39
|
};
|
package/dist/index69.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index68.cjs"),r=require("react"),o=require("./index71.cjs"),a=require("./index72.cjs"),l=require("./index73.cjs");function t(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const o in e)if("default"!==o){const a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,a.get?a:{enumerable:!0,get:()=>e[o]})}return r.default=e,Object.freeze(r)}const n=t(r);var s=function(){},i=n.forwardRef(function(r,o){var t=n.useRef(null),i=n.useState({onScrollCapture:s,onWheelCapture:s,onTouchMoveCapture:s}),c=i[0],d=i[1],u=r.forwardProps,f=r.children,m=r.className,g=r.removeScrollBar,h=r.enabled,p=r.shards,v=r.sideCar,b=r.noRelative,_=r.noIsolation,C=r.inert,S=r.allowPinchZoom,R=r.as,j=void 0===R?"div":R,P=r.gapMode,w=e.__rest(r,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=v,x=l.useMergeRefs([t,o]),y=e.__assign(e.__assign({},w),c);return n.createElement(n.Fragment,null,h&&n.createElement(M,{sideCar:a.effectCar,removeScrollBar:g,shards:p,noRelative:b,noIsolation:_,inert:C,setCallbacks:d,allowPinchZoom:!!S,lockRef:t,gapMode:P}),u?n.cloneElement(n.Children.only(f),e.__assign(e.__assign({},y),{ref:x})):n.createElement(j,e.__assign({},y,{className:m,ref:x}),f))});i.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},i.classNames={fullWidth:o.fullWidthClassName,zeroRight:o.zeroRightClassName},exports.RemoveScroll=i;
|
package/dist/index69.js
CHANGED
|
@@ -1,10 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { __rest, __assign } from "./index68.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { zeroRightClassName, fullWidthClassName } from "./index71.js";
|
|
4
|
+
import { effectCar } from "./index72.js";
|
|
5
|
+
import { useMergeRefs } from "./index73.js";
|
|
6
|
+
var nothing = function() {
|
|
7
|
+
return;
|
|
8
|
+
};
|
|
9
|
+
var RemoveScroll = React.forwardRef(function(props, parentRef) {
|
|
10
|
+
var ref = React.useRef(null);
|
|
11
|
+
var _a = React.useState({
|
|
12
|
+
onScrollCapture: nothing,
|
|
13
|
+
onWheelCapture: nothing,
|
|
14
|
+
onTouchMoveCapture: nothing
|
|
15
|
+
}), callbacks = _a[0], setCallbacks = _a[1];
|
|
16
|
+
var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
|
|
17
|
+
var SideCar = sideCar;
|
|
18
|
+
var containerRef = useMergeRefs([ref, parentRef]);
|
|
19
|
+
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
20
|
+
return React.createElement(
|
|
21
|
+
React.Fragment,
|
|
22
|
+
null,
|
|
23
|
+
enabled && React.createElement(SideCar, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
|
|
24
|
+
forwardProps ? React.cloneElement(React.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
RemoveScroll.defaultProps = {
|
|
28
|
+
enabled: true,
|
|
29
|
+
removeScrollBar: true,
|
|
30
|
+
inert: false
|
|
31
|
+
};
|
|
32
|
+
RemoveScroll.classNames = {
|
|
33
|
+
fullWidth: fullWidthClassName,
|
|
34
|
+
zeroRight: zeroRightClassName
|
|
35
|
+
};
|
|
5
36
|
export {
|
|
6
|
-
|
|
7
|
-
noScrollbarsClassName,
|
|
8
|
-
removedBarSizeVariable,
|
|
9
|
-
zeroRightClassName
|
|
37
|
+
RemoveScroll
|
|
10
38
|
};
|
package/dist/index7.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),a=require("./index20.cjs");;/* empty css */const c=r.forwardRef(({label:c,error:t,helperText:d,indeterminate:i=!1,className:s,id:l,required:n,disabled:o,checked:u,"data-cy":b,"data-testid":h,...x},p)=>{const k=r.useId(),m=l||k,y=`${m}-error`,_=`${m}-helper`,$=b||"checkbox",f=h||"checkbox",j=r.useRef(null),N=r.useCallback(e=>{j.current=e,p&&("function"==typeof p?p(e):"current"in p&&(p.current=e))},[p]);r.useEffect(()=>{j.current&&(j.current.indeterminate=i)},[i]);const q=c&&n&&!c.includes("*")?`${c} *`:c;return e.jsxs("div",{className:a.cn("checkbox-wrapper",o&&"checkbox-wrapper--disabled"),"data-cy":`${$}-wrapper`,"data-testid":`${f}-wrapper`,children:[e.jsxs("div",{className:"checkbox__container",children:[e.jsx("input",{ref:N,id:m,type:"checkbox",checked:u,className:a.cn("checkbox__input",t&&"checkbox__input--error",s),"aria-invalid":t?"true":"false","aria-required":n?"true":void 0,"aria-describedby":t?y:d?_:void 0,"data-cy":$,"data-testid":f,"data-indeterminate":i?"true":void 0,disabled:o,required:n,...x}),c&&e.jsx("label",{htmlFor:m,className:"checkbox__label","data-cy":`${$}-label`,"data-testid":`${f}-label`,children:q})]}),t&&e.jsx("span",{id:y,className:"checkbox__error",role:"alert","data-cy":`${$}-error`,"data-testid":`${f}-error`,children:t}),d&&!t&&e.jsx("span",{id:_,className:"checkbox__helper","data-cy":`${$}-helper`,"data-testid":`${f}-helper`,children:d})]})});c.displayName="Checkbox",exports.Checkbox=c;
|
package/dist/index7.js
CHANGED
package/dist/index70.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const e=require("./index74.cjs"),r=require("./index72.cjs"),i=require("./index75.cjs").exportSidecar(r.effectCar,e.RemoveScrollSideCar);module.exports=i;
|
package/dist/index70.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { RemoveScrollSideCar } from "./index74.js";
|
|
2
|
+
import { effectCar } from "./index72.js";
|
|
3
|
+
import { exportSidecar } from "./index75.js";
|
|
4
|
+
const SideCar = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
3
5
|
export {
|
|
4
|
-
|
|
6
|
+
SideCar as default
|
|
5
7
|
};
|
package/dist/index71.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.fullWidthClassName="width-before-scroll-bar",exports.noScrollbarsClassName="with-scroll-bars-hidden",exports.removedBarSizeVariable="--removed-body-scroll-bar-size",exports.zeroRightClassName="right-scroll-bar-position";
|
package/dist/index71.js
CHANGED
|
@@ -1,35 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
6
|
-
function useMergeRefs(refs, defaultValue) {
|
|
7
|
-
var callbackRef = useCallbackRef(null, function(newValue) {
|
|
8
|
-
return refs.forEach(function(ref) {
|
|
9
|
-
return assignRef(ref, newValue);
|
|
10
|
-
});
|
|
11
|
-
});
|
|
12
|
-
useIsomorphicLayoutEffect(function() {
|
|
13
|
-
var oldValue = currentValues.get(callbackRef);
|
|
14
|
-
if (oldValue) {
|
|
15
|
-
var prevRefs_1 = new Set(oldValue);
|
|
16
|
-
var nextRefs_1 = new Set(refs);
|
|
17
|
-
var current_1 = callbackRef.current;
|
|
18
|
-
prevRefs_1.forEach(function(ref) {
|
|
19
|
-
if (!nextRefs_1.has(ref)) {
|
|
20
|
-
assignRef(ref, null);
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
nextRefs_1.forEach(function(ref) {
|
|
24
|
-
if (!prevRefs_1.has(ref)) {
|
|
25
|
-
assignRef(ref, current_1);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
currentValues.set(callbackRef, refs);
|
|
30
|
-
}, [refs]);
|
|
31
|
-
return callbackRef;
|
|
32
|
-
}
|
|
1
|
+
var zeroRightClassName = "right-scroll-bar-position";
|
|
2
|
+
var fullWidthClassName = "width-before-scroll-bar";
|
|
3
|
+
var noScrollbarsClassName = "with-scroll-bars-hidden";
|
|
4
|
+
var removedBarSizeVariable = "--removed-body-scroll-bar-size";
|
|
33
5
|
export {
|
|
34
|
-
|
|
6
|
+
fullWidthClassName,
|
|
7
|
+
noScrollbarsClassName,
|
|
8
|
+
removedBarSizeVariable,
|
|
9
|
+
zeroRightClassName
|
|
35
10
|
};
|
package/dist/index72.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=require("./index79.cjs").createSidecarMedium();exports.effectCar=e;
|
package/dist/index72.js
CHANGED
|
@@ -1,180 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { RemoveScrollBar } from "./index77.js";
|
|
4
|
-
import { styleSingleton } from "./index78.js";
|
|
5
|
-
import { nonPassive } from "./index79.js";
|
|
6
|
-
import { locationCouldBeScrolled, handleScroll } from "./index80.js";
|
|
7
|
-
var getTouchXY = function(event) {
|
|
8
|
-
return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
|
|
9
|
-
};
|
|
10
|
-
var getDeltaXY = function(event) {
|
|
11
|
-
return [event.deltaX, event.deltaY];
|
|
12
|
-
};
|
|
13
|
-
var extractRef = function(ref) {
|
|
14
|
-
return ref && "current" in ref ? ref.current : ref;
|
|
15
|
-
};
|
|
16
|
-
var deltaCompare = function(x, y) {
|
|
17
|
-
return x[0] === y[0] && x[1] === y[1];
|
|
18
|
-
};
|
|
19
|
-
var generateStyle = function(id) {
|
|
20
|
-
return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n");
|
|
21
|
-
};
|
|
22
|
-
var idCounter = 0;
|
|
23
|
-
var lockStack = [];
|
|
24
|
-
function RemoveScrollSideCar(props) {
|
|
25
|
-
var shouldPreventQueue = React.useRef([]);
|
|
26
|
-
var touchStartRef = React.useRef([0, 0]);
|
|
27
|
-
var activeAxis = React.useRef();
|
|
28
|
-
var id = React.useState(idCounter++)[0];
|
|
29
|
-
var Style = React.useState(styleSingleton)[0];
|
|
30
|
-
var lastProps = React.useRef(props);
|
|
31
|
-
React.useEffect(function() {
|
|
32
|
-
lastProps.current = props;
|
|
33
|
-
}, [props]);
|
|
34
|
-
React.useEffect(function() {
|
|
35
|
-
if (props.inert) {
|
|
36
|
-
document.body.classList.add("block-interactivity-".concat(id));
|
|
37
|
-
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
38
|
-
allow_1.forEach(function(el) {
|
|
39
|
-
return el.classList.add("allow-interactivity-".concat(id));
|
|
40
|
-
});
|
|
41
|
-
return function() {
|
|
42
|
-
document.body.classList.remove("block-interactivity-".concat(id));
|
|
43
|
-
allow_1.forEach(function(el) {
|
|
44
|
-
return el.classList.remove("allow-interactivity-".concat(id));
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
return;
|
|
49
|
-
}, [props.inert, props.lockRef.current, props.shards]);
|
|
50
|
-
var shouldCancelEvent = React.useCallback(function(event, parent) {
|
|
51
|
-
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
|
|
52
|
-
return !lastProps.current.allowPinchZoom;
|
|
53
|
-
}
|
|
54
|
-
var touch = getTouchXY(event);
|
|
55
|
-
var touchStart = touchStartRef.current;
|
|
56
|
-
var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0];
|
|
57
|
-
var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1];
|
|
58
|
-
var currentAxis;
|
|
59
|
-
var target = event.target;
|
|
60
|
-
var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v";
|
|
61
|
-
if ("touches" in event && moveDirection === "h" && target.type === "range") {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
var selection = window.getSelection();
|
|
65
|
-
var anchorNode = selection && selection.anchorNode;
|
|
66
|
-
var isTouchingSelection = anchorNode ? anchorNode === target || anchorNode.contains(target) : false;
|
|
67
|
-
if (isTouchingSelection) {
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
71
|
-
if (!canBeScrolledInMainDirection) {
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
if (canBeScrolledInMainDirection) {
|
|
75
|
-
currentAxis = moveDirection;
|
|
76
|
-
} else {
|
|
77
|
-
currentAxis = moveDirection === "v" ? "h" : "v";
|
|
78
|
-
canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
79
|
-
}
|
|
80
|
-
if (!canBeScrolledInMainDirection) {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) {
|
|
84
|
-
activeAxis.current = currentAxis;
|
|
85
|
-
}
|
|
86
|
-
if (!currentAxis) {
|
|
87
|
-
return true;
|
|
88
|
-
}
|
|
89
|
-
var cancelingAxis = activeAxis.current || currentAxis;
|
|
90
|
-
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY);
|
|
91
|
-
}, []);
|
|
92
|
-
var shouldPrevent = React.useCallback(function(_event) {
|
|
93
|
-
var event = _event;
|
|
94
|
-
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event);
|
|
98
|
-
var sourceEvent = shouldPreventQueue.current.filter(function(e) {
|
|
99
|
-
return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta);
|
|
100
|
-
})[0];
|
|
101
|
-
if (sourceEvent && sourceEvent.should) {
|
|
102
|
-
if (event.cancelable) {
|
|
103
|
-
event.preventDefault();
|
|
104
|
-
}
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
if (!sourceEvent) {
|
|
108
|
-
var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node) {
|
|
109
|
-
return node.contains(event.target);
|
|
110
|
-
});
|
|
111
|
-
var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
|
|
112
|
-
if (shouldStop) {
|
|
113
|
-
if (event.cancelable) {
|
|
114
|
-
event.preventDefault();
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}, []);
|
|
119
|
-
var shouldCancel = React.useCallback(function(name, delta, target, should) {
|
|
120
|
-
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
121
|
-
shouldPreventQueue.current.push(event);
|
|
122
|
-
setTimeout(function() {
|
|
123
|
-
shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
|
|
124
|
-
return e !== event;
|
|
125
|
-
});
|
|
126
|
-
}, 1);
|
|
127
|
-
}, []);
|
|
128
|
-
var scrollTouchStart = React.useCallback(function(event) {
|
|
129
|
-
touchStartRef.current = getTouchXY(event);
|
|
130
|
-
activeAxis.current = void 0;
|
|
131
|
-
}, []);
|
|
132
|
-
var scrollWheel = React.useCallback(function(event) {
|
|
133
|
-
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
134
|
-
}, []);
|
|
135
|
-
var scrollTouchMove = React.useCallback(function(event) {
|
|
136
|
-
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
137
|
-
}, []);
|
|
138
|
-
React.useEffect(function() {
|
|
139
|
-
lockStack.push(Style);
|
|
140
|
-
props.setCallbacks({
|
|
141
|
-
onScrollCapture: scrollWheel,
|
|
142
|
-
onWheelCapture: scrollWheel,
|
|
143
|
-
onTouchMoveCapture: scrollTouchMove
|
|
144
|
-
});
|
|
145
|
-
document.addEventListener("wheel", shouldPrevent, nonPassive);
|
|
146
|
-
document.addEventListener("touchmove", shouldPrevent, nonPassive);
|
|
147
|
-
document.addEventListener("touchstart", scrollTouchStart, nonPassive);
|
|
148
|
-
return function() {
|
|
149
|
-
lockStack = lockStack.filter(function(inst) {
|
|
150
|
-
return inst !== Style;
|
|
151
|
-
});
|
|
152
|
-
document.removeEventListener("wheel", shouldPrevent, nonPassive);
|
|
153
|
-
document.removeEventListener("touchmove", shouldPrevent, nonPassive);
|
|
154
|
-
document.removeEventListener("touchstart", scrollTouchStart, nonPassive);
|
|
155
|
-
};
|
|
156
|
-
}, []);
|
|
157
|
-
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
158
|
-
return React.createElement(
|
|
159
|
-
React.Fragment,
|
|
160
|
-
null,
|
|
161
|
-
inert ? React.createElement(Style, { styles: generateStyle(id) }) : null,
|
|
162
|
-
removeScrollBar ? React.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
function getOutermostShadowParent(node) {
|
|
166
|
-
var shadowParent = null;
|
|
167
|
-
while (node !== null) {
|
|
168
|
-
if (node instanceof ShadowRoot) {
|
|
169
|
-
shadowParent = node.host;
|
|
170
|
-
node = node.host;
|
|
171
|
-
}
|
|
172
|
-
node = node.parentNode;
|
|
173
|
-
}
|
|
174
|
-
return shadowParent;
|
|
175
|
-
}
|
|
1
|
+
import { createSidecarMedium } from "./index79.js";
|
|
2
|
+
var effectCar = createSidecarMedium();
|
|
176
3
|
export {
|
|
177
|
-
|
|
178
|
-
getDeltaXY,
|
|
179
|
-
getTouchXY
|
|
4
|
+
effectCar
|
|
180
5
|
};
|
package/dist/index73.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index84.cjs"),n=require("./index85.cjs");function r(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const u=r(e);var o="undefined"!=typeof window?u.useLayoutEffect:u.useEffect,c=new WeakMap;exports.useMergeRefs=function(e,r){var u=n.useCallbackRef(null,function(n){return e.forEach(function(e){return t.assignRef(e,n)})});return o(function(){var n=c.get(u);if(n){var r=new Set(n),o=new Set(e),f=u.current;r.forEach(function(e){o.has(e)||t.assignRef(e,null)}),o.forEach(function(e){r.has(e)||t.assignRef(e,f)})}c.set(u,e)},[e]),u};
|
package/dist/index73.js
CHANGED
|
@@ -1,21 +1,35 @@
|
|
|
1
|
-
import { __rest, __assign } from "./index66.js";
|
|
2
1
|
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
import { assignRef } from "./index84.js";
|
|
3
|
+
import { useCallbackRef } from "./index85.js";
|
|
4
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
5
|
+
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
6
|
+
function useMergeRefs(refs, defaultValue) {
|
|
7
|
+
var callbackRef = useCallbackRef(null, function(newValue) {
|
|
8
|
+
return refs.forEach(function(ref) {
|
|
9
|
+
return assignRef(ref, newValue);
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
useIsomorphicLayoutEffect(function() {
|
|
13
|
+
var oldValue = currentValues.get(callbackRef);
|
|
14
|
+
if (oldValue) {
|
|
15
|
+
var prevRefs_1 = new Set(oldValue);
|
|
16
|
+
var nextRefs_1 = new Set(refs);
|
|
17
|
+
var current_1 = callbackRef.current;
|
|
18
|
+
prevRefs_1.forEach(function(ref) {
|
|
19
|
+
if (!nextRefs_1.has(ref)) {
|
|
20
|
+
assignRef(ref, null);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
nextRefs_1.forEach(function(ref) {
|
|
24
|
+
if (!prevRefs_1.has(ref)) {
|
|
25
|
+
assignRef(ref, current_1);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
currentValues.set(callbackRef, refs);
|
|
30
|
+
}, [refs]);
|
|
31
|
+
return callbackRef;
|
|
18
32
|
}
|
|
19
33
|
export {
|
|
20
|
-
|
|
34
|
+
useMergeRefs
|
|
21
35
|
};
|
package/dist/index74.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index68.cjs"),t=require("react"),n=require("./index80.cjs"),r=require("./index81.cjs"),o=require("./index82.cjs"),c=require("./index83.cjs");function a(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const u=a(t);var i=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},l=function(e){return[e.deltaX,e.deltaY]},s=function(e){return e&&"current"in e?e.current:e},f=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},d=0,v=[];function h(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}exports.RemoveScrollSideCar=function(t){var a=u.useRef([]),g=u.useRef([0,0]),m=u.useRef(),p=u.useState(d++)[0],b=u.useState(r.styleSingleton)[0],y=u.useRef(t);u.useEffect(function(){y.current=t},[t]),u.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(p));var n=e.__spreadArray([t.lockRef.current],(t.shards||[]).map(s),!0).filter(Boolean);return n.forEach(function(e){return e.classList.add("allow-interactivity-".concat(p))}),function(){document.body.classList.remove("block-interactivity-".concat(p)),n.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(p))})}}},[t.inert,t.lockRef.current,t.shards]);var S=u.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!y.current.allowPinchZoom;var n,r=i(e),o=g.current,a="deltaX"in e?e.deltaX:o[0]-r[0],u="deltaY"in e?e.deltaY:o[1]-r[1],l=e.target,s=Math.abs(a)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===s&&"range"===l.type)return!1;var f=window.getSelection(),d=f&&f.anchorNode;if(!!d&&(d===l||d.contains(l)))return!1;var v=c.locationCouldBeScrolled(s,l);if(!v)return!0;if(v?n=s:(n="v"===s?"h":"v",v=c.locationCouldBeScrolled(s,l)),!v)return!1;if(!m.current&&"changedTouches"in e&&(a||u)&&(m.current=n),!n)return!0;var h=m.current||n;return c.handleScroll(h,t,e,"h"===h?a:u)},[]),k=u.useCallback(function(e){var t=e;if(v.length&&v[v.length-1]===b){var n="deltaY"in t?l(t):i(t),r=a.current.filter(function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&(r=e.delta,o=n,r[0]===o[0]&&r[1]===o[1]);var r,o})[0];if(r&&r.should)t.cancelable&&t.preventDefault();else if(!r){var o=(y.current.shards||[]).map(s).filter(Boolean).filter(function(e){return e.contains(t.target)});(o.length>0?S(t,o[0]):!y.current.noIsolation)&&t.cancelable&&t.preventDefault()}}},[]),E=u.useCallback(function(e,t,n,r){var o={name:e,delta:t,target:n,should:r,shadowParent:h(n)};a.current.push(o),setTimeout(function(){a.current=a.current.filter(function(e){return e!==o})},1)},[]),w=u.useCallback(function(e){g.current=i(e),m.current=void 0},[]),C=u.useCallback(function(e){E(e.type,l(e),e.target,S(e,t.lockRef.current))},[]),R=u.useCallback(function(e){E(e.type,i(e),e.target,S(e,t.lockRef.current))},[]);u.useEffect(function(){return v.push(b),t.setCallbacks({onScrollCapture:C,onWheelCapture:C,onTouchMoveCapture:R}),document.addEventListener("wheel",k,o.nonPassive),document.addEventListener("touchmove",k,o.nonPassive),document.addEventListener("touchstart",w,o.nonPassive),function(){v=v.filter(function(e){return e!==b}),document.removeEventListener("wheel",k,o.nonPassive),document.removeEventListener("touchmove",k,o.nonPassive),document.removeEventListener("touchstart",w,o.nonPassive)}},[]);var P=t.removeScrollBar,j=t.inert;return u.createElement(u.Fragment,null,j?u.createElement(b,{styles:f(p)}):null,P?u.createElement(n.RemoveScrollBar,{noRelative:t.noRelative,gapMode:t.gapMode}):null)},exports.getDeltaXY=l,exports.getTouchXY=i;
|