@shopify/shop-minis-react 0.0.19 → 0.0.20
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/components/MinisContainer.js +13 -11
- package/dist/components/MinisContainer.js.map +1 -1
- package/dist/components/atoms/list.js +52 -0
- package/dist/components/atoms/list.js.map +1 -0
- package/dist/components/atoms/pagination.js +10 -0
- package/dist/components/atoms/pagination.js.map +1 -0
- package/dist/components/atoms/tracking-pixel.js +32 -0
- package/dist/components/atoms/tracking-pixel.js.map +1 -0
- package/dist/index.js +187 -185
- package/dist/index.js.map +1 -1
- package/dist/internal/useShopActions.js.map +1 -1
- package/dist/internal/useShopActionsDataFetching.js +26 -26
- package/dist/internal/useShopActionsDataFetching.js.map +1 -1
- package/dist/internal/useShopActionsPaginatedDataFetching.js.map +1 -1
- package/dist/mocks.js +267 -0
- package/dist/mocks.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +8 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/extends.js +13 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +8 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +9 -0
- package/dist/shop-minis-react/node_modules/.pnpm/@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/memoize-one@5.2.1/node_modules/memoize-one/dist/memoize-one.esm.js +28 -0
- package/dist/shop-minis-react/node_modules/.pnpm/memoize-one@5.2.1/node_modules/memoize-one/dist/memoize-one.esm.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/react-intersection-observer@9.16.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-intersection-observer/dist/index.js +135 -0
- package/dist/shop-minis-react/node_modules/.pnpm/react-intersection-observer@9.16.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-intersection-observer/dist/index.js.map +1 -0
- package/dist/shop-minis-react/node_modules/.pnpm/react-window@1.8.11_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-window/dist/index.esm.js +375 -0
- package/dist/shop-minis-react/node_modules/.pnpm/react-window@1.8.11_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-window/dist/index.esm.js.map +1 -0
- package/dist/shop-minis-react.css +1 -0
- package/package.json +9 -4
- package/src/components/MinisContainer.tsx +4 -1
- package/src/components/atoms/list.tsx +101 -0
- package/src/components/atoms/pagination.tsx +19 -0
- package/src/components/atoms/tracking-pixel.tsx +40 -0
- package/src/components/index.ts +1 -0
- package/src/index.css +1 -0
- package/src/internal/useShopActions.ts +1 -1
- package/src/internal/useShopActionsDataFetching.ts +6 -7
- package/src/internal/useShopActionsPaginatedDataFetching.ts +3 -6
- package/src/mocks.ts +20 -8
- package/src/stories/List.stories.tsx +68 -0
- package/src/styles/utilities.css +22 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import * as b from "react";
|
|
2
|
+
var V = Object.defineProperty, w = (e, t, i) => t in e ? V(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, u = (e, t, i) => w(e, typeof t != "symbol" ? t + "" : t, i), p = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new WeakMap(), f = 0, _ = void 0;
|
|
3
|
+
function I(e) {
|
|
4
|
+
return e ? (l.has(e) || (f += 1, l.set(e, f.toString())), l.get(e)) : "0";
|
|
5
|
+
}
|
|
6
|
+
function y(e) {
|
|
7
|
+
return Object.keys(e).sort().filter(
|
|
8
|
+
(t) => e[t] !== void 0
|
|
9
|
+
).map((t) => `${t}_${t === "root" ? I(e.root) : e[t]}`).toString();
|
|
10
|
+
}
|
|
11
|
+
function m(e) {
|
|
12
|
+
const t = y(e);
|
|
13
|
+
let i = p.get(t);
|
|
14
|
+
if (!i) {
|
|
15
|
+
const r = /* @__PURE__ */ new Map();
|
|
16
|
+
let d;
|
|
17
|
+
const n = new IntersectionObserver((o) => {
|
|
18
|
+
o.forEach((s) => {
|
|
19
|
+
var h;
|
|
20
|
+
const c = s.isIntersecting && d.some((a) => s.intersectionRatio >= a);
|
|
21
|
+
e.trackVisibility && typeof s.isVisible > "u" && (s.isVisible = c), (h = r.get(s.target)) == null || h.forEach((a) => {
|
|
22
|
+
a(c, s);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}, e);
|
|
26
|
+
d = n.thresholds || (Array.isArray(e.threshold) ? e.threshold : [e.threshold || 0]), i = {
|
|
27
|
+
id: t,
|
|
28
|
+
observer: n,
|
|
29
|
+
elements: r
|
|
30
|
+
}, p.set(t, i);
|
|
31
|
+
}
|
|
32
|
+
return i;
|
|
33
|
+
}
|
|
34
|
+
function M(e, t, i = {}, r = _) {
|
|
35
|
+
if (typeof window.IntersectionObserver > "u" && r !== void 0) {
|
|
36
|
+
const h = e.getBoundingClientRect();
|
|
37
|
+
return t(r, {
|
|
38
|
+
isIntersecting: r,
|
|
39
|
+
target: e,
|
|
40
|
+
intersectionRatio: typeof i.threshold == "number" ? i.threshold : 0,
|
|
41
|
+
time: 0,
|
|
42
|
+
boundingClientRect: h,
|
|
43
|
+
intersectionRect: h,
|
|
44
|
+
rootBounds: h
|
|
45
|
+
}), () => {
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const { id: d, observer: n, elements: o } = m(i), s = o.get(e) || [];
|
|
49
|
+
return o.has(e) || o.set(e, s), s.push(t), n.observe(e), function() {
|
|
50
|
+
s.splice(s.indexOf(t), 1), s.length === 0 && (o.delete(e), n.unobserve(e)), o.size === 0 && (n.disconnect(), p.delete(d));
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function O(e) {
|
|
54
|
+
return typeof e.children != "function";
|
|
55
|
+
}
|
|
56
|
+
var R = class extends b.Component {
|
|
57
|
+
constructor(e) {
|
|
58
|
+
super(e), u(this, "node", null), u(this, "_unobserveCb", null), u(this, "handleNode", (t) => {
|
|
59
|
+
this.node && (this.unobserve(), !t && !this.props.triggerOnce && !this.props.skip && this.setState({ inView: !!this.props.initialInView, entry: void 0 })), this.node = t || null, this.observeNode();
|
|
60
|
+
}), u(this, "handleChange", (t, i) => {
|
|
61
|
+
t && this.props.triggerOnce && this.unobserve(), O(this.props) || this.setState({ inView: t, entry: i }), this.props.onChange && this.props.onChange(t, i);
|
|
62
|
+
}), this.state = {
|
|
63
|
+
inView: !!e.initialInView,
|
|
64
|
+
entry: void 0
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
componentDidMount() {
|
|
68
|
+
this.unobserve(), this.observeNode();
|
|
69
|
+
}
|
|
70
|
+
componentDidUpdate(e) {
|
|
71
|
+
(e.rootMargin !== this.props.rootMargin || e.root !== this.props.root || e.threshold !== this.props.threshold || e.skip !== this.props.skip || e.trackVisibility !== this.props.trackVisibility || e.delay !== this.props.delay) && (this.unobserve(), this.observeNode());
|
|
72
|
+
}
|
|
73
|
+
componentWillUnmount() {
|
|
74
|
+
this.unobserve();
|
|
75
|
+
}
|
|
76
|
+
observeNode() {
|
|
77
|
+
if (!this.node || this.props.skip) return;
|
|
78
|
+
const {
|
|
79
|
+
threshold: e,
|
|
80
|
+
root: t,
|
|
81
|
+
rootMargin: i,
|
|
82
|
+
trackVisibility: r,
|
|
83
|
+
delay: d,
|
|
84
|
+
fallbackInView: n
|
|
85
|
+
} = this.props;
|
|
86
|
+
this._unobserveCb = M(
|
|
87
|
+
this.node,
|
|
88
|
+
this.handleChange,
|
|
89
|
+
{
|
|
90
|
+
threshold: e,
|
|
91
|
+
root: t,
|
|
92
|
+
rootMargin: i,
|
|
93
|
+
// @ts-ignore
|
|
94
|
+
trackVisibility: r,
|
|
95
|
+
// @ts-ignore
|
|
96
|
+
delay: d
|
|
97
|
+
},
|
|
98
|
+
n
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
unobserve() {
|
|
102
|
+
this._unobserveCb && (this._unobserveCb(), this._unobserveCb = null);
|
|
103
|
+
}
|
|
104
|
+
render() {
|
|
105
|
+
const { children: e } = this.props;
|
|
106
|
+
if (typeof e == "function") {
|
|
107
|
+
const { inView: g, entry: C } = this.state;
|
|
108
|
+
return e({ inView: g, entry: C, ref: this.handleNode });
|
|
109
|
+
}
|
|
110
|
+
const {
|
|
111
|
+
as: t,
|
|
112
|
+
triggerOnce: i,
|
|
113
|
+
threshold: r,
|
|
114
|
+
root: d,
|
|
115
|
+
rootMargin: n,
|
|
116
|
+
onChange: o,
|
|
117
|
+
skip: s,
|
|
118
|
+
trackVisibility: h,
|
|
119
|
+
delay: c,
|
|
120
|
+
initialInView: a,
|
|
121
|
+
fallbackInView: N,
|
|
122
|
+
...v
|
|
123
|
+
} = this.props;
|
|
124
|
+
return b.createElement(
|
|
125
|
+
t || "div",
|
|
126
|
+
{ ref: this.handleNode, ...v },
|
|
127
|
+
e
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
export {
|
|
132
|
+
R as InView,
|
|
133
|
+
M as observe
|
|
134
|
+
};
|
|
135
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/.pnpm/react-intersection-observer@9.16.0_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-intersection-observer/dist/index.mjs"],"sourcesContent":["\"use client\";\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n\n// src/InView.tsx\nimport * as React from \"react\";\n\n// src/observe.ts\nvar observerMap = /* @__PURE__ */ new Map();\nvar RootIds = /* @__PURE__ */ new WeakMap();\nvar rootId = 0;\nvar unsupportedValue = void 0;\nfunction defaultFallbackInView(inView) {\n unsupportedValue = inView;\n}\nfunction getRootId(root) {\n if (!root) return \"0\";\n if (RootIds.has(root)) return RootIds.get(root);\n rootId += 1;\n RootIds.set(root, rootId.toString());\n return RootIds.get(root);\n}\nfunction optionsToId(options) {\n return Object.keys(options).sort().filter(\n (key) => options[key] !== void 0\n ).map((key) => {\n return `${key}_${key === \"root\" ? getRootId(options.root) : options[key]}`;\n }).toString();\n}\nfunction createObserver(options) {\n const id = optionsToId(options);\n let instance = observerMap.get(id);\n if (!instance) {\n const elements = /* @__PURE__ */ new Map();\n let thresholds;\n const observer = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n var _a;\n const inView = entry.isIntersecting && thresholds.some((threshold) => entry.intersectionRatio >= threshold);\n if (options.trackVisibility && typeof entry.isVisible === \"undefined\") {\n entry.isVisible = inView;\n }\n (_a = elements.get(entry.target)) == null ? void 0 : _a.forEach((callback) => {\n callback(inView, entry);\n });\n });\n }, options);\n thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]);\n instance = {\n id,\n observer,\n elements\n };\n observerMap.set(id, instance);\n }\n return instance;\n}\nfunction observe(element, callback, options = {}, fallbackInView = unsupportedValue) {\n if (typeof window.IntersectionObserver === \"undefined\" && fallbackInView !== void 0) {\n const bounds = element.getBoundingClientRect();\n callback(fallbackInView, {\n isIntersecting: fallbackInView,\n target: element,\n intersectionRatio: typeof options.threshold === \"number\" ? options.threshold : 0,\n time: 0,\n boundingClientRect: bounds,\n intersectionRect: bounds,\n rootBounds: bounds\n });\n return () => {\n };\n }\n const { id, observer, elements } = createObserver(options);\n const callbacks = elements.get(element) || [];\n if (!elements.has(element)) {\n elements.set(element, callbacks);\n }\n callbacks.push(callback);\n observer.observe(element);\n return function unobserve() {\n callbacks.splice(callbacks.indexOf(callback), 1);\n if (callbacks.length === 0) {\n elements.delete(element);\n observer.unobserve(element);\n }\n if (elements.size === 0) {\n observer.disconnect();\n observerMap.delete(id);\n }\n };\n}\n\n// src/InView.tsx\nfunction isPlainChildren(props) {\n return typeof props.children !== \"function\";\n}\nvar InView = class extends React.Component {\n constructor(props) {\n super(props);\n __publicField(this, \"node\", null);\n __publicField(this, \"_unobserveCb\", null);\n __publicField(this, \"handleNode\", (node) => {\n if (this.node) {\n this.unobserve();\n if (!node && !this.props.triggerOnce && !this.props.skip) {\n this.setState({ inView: !!this.props.initialInView, entry: void 0 });\n }\n }\n this.node = node ? node : null;\n this.observeNode();\n });\n __publicField(this, \"handleChange\", (inView, entry) => {\n if (inView && this.props.triggerOnce) {\n this.unobserve();\n }\n if (!isPlainChildren(this.props)) {\n this.setState({ inView, entry });\n }\n if (this.props.onChange) {\n this.props.onChange(inView, entry);\n }\n });\n this.state = {\n inView: !!props.initialInView,\n entry: void 0\n };\n }\n componentDidMount() {\n this.unobserve();\n this.observeNode();\n }\n componentDidUpdate(prevProps) {\n if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) {\n this.unobserve();\n this.observeNode();\n }\n }\n componentWillUnmount() {\n this.unobserve();\n }\n observeNode() {\n if (!this.node || this.props.skip) return;\n const {\n threshold,\n root,\n rootMargin,\n trackVisibility,\n delay,\n fallbackInView\n } = this.props;\n this._unobserveCb = observe(\n this.node,\n this.handleChange,\n {\n threshold,\n root,\n rootMargin,\n // @ts-ignore\n trackVisibility,\n // @ts-ignore\n delay\n },\n fallbackInView\n );\n }\n unobserve() {\n if (this._unobserveCb) {\n this._unobserveCb();\n this._unobserveCb = null;\n }\n }\n render() {\n const { children } = this.props;\n if (typeof children === \"function\") {\n const { inView, entry } = this.state;\n return children({ inView, entry, ref: this.handleNode });\n }\n const {\n as,\n triggerOnce,\n threshold,\n root,\n rootMargin,\n onChange,\n skip,\n trackVisibility,\n delay,\n initialInView,\n fallbackInView,\n ...props\n } = this.props;\n return React.createElement(\n as || \"div\",\n { ref: this.handleNode, ...props },\n children\n );\n }\n};\n\n// src/useInView.tsx\nimport * as React2 from \"react\";\nfunction useInView({\n threshold,\n delay,\n trackVisibility,\n rootMargin,\n root,\n triggerOnce,\n skip,\n initialInView,\n fallbackInView,\n onChange\n} = {}) {\n var _a;\n const [ref, setRef] = React2.useState(null);\n const callback = React2.useRef(onChange);\n const [state, setState] = React2.useState({\n inView: !!initialInView,\n entry: void 0\n });\n callback.current = onChange;\n React2.useEffect(\n () => {\n if (skip || !ref) return;\n let unobserve;\n unobserve = observe(\n ref,\n (inView, entry) => {\n setState({\n inView,\n entry\n });\n if (callback.current) callback.current(inView, entry);\n if (entry.isIntersecting && triggerOnce && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n },\n {\n root,\n rootMargin,\n threshold,\n // @ts-ignore\n trackVisibility,\n // @ts-ignore\n delay\n },\n fallbackInView\n );\n return () => {\n if (unobserve) {\n unobserve();\n }\n };\n },\n // We break the rule here, because we aren't including the actual `threshold` variable\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n // If the threshold is an array, convert it to a string, so it won't change between renders.\n Array.isArray(threshold) ? threshold.toString() : threshold,\n ref,\n root,\n rootMargin,\n triggerOnce,\n skip,\n trackVisibility,\n fallbackInView,\n delay\n ]\n );\n const entryTarget = (_a = state.entry) == null ? void 0 : _a.target;\n const previousEntryTarget = React2.useRef(void 0);\n if (!ref && entryTarget && !triggerOnce && !skip && previousEntryTarget.current !== entryTarget) {\n previousEntryTarget.current = entryTarget;\n setState({\n inView: !!initialInView,\n entry: void 0\n });\n }\n const result = [setRef, state.inView, state.entry];\n result.ref = result[0];\n result.inView = result[1];\n result.entry = result[2];\n return result;\n}\nexport {\n InView,\n defaultFallbackInView,\n observe,\n useInView\n};\n//# sourceMappingURL=index.mjs.map"],"names":["__defProp","__defNormalProp","obj","key","value","__publicField","observerMap","RootIds","rootId","unsupportedValue","getRootId","root","optionsToId","options","createObserver","id","instance","elements","thresholds","observer","entries","entry","_a","inView","threshold","callback","observe","element","fallbackInView","bounds","callbacks","isPlainChildren","props","InView","React","node","prevProps","rootMargin","trackVisibility","delay","children","as","triggerOnce","onChange","skip","initialInView"],"mappings":";AACA,IAAIA,IAAY,OAAO,gBACnBC,IAAkB,CAACC,GAAKC,GAAKC,MAAUD,KAAOD,IAAMF,EAAUE,GAAKC,GAAK,EAAE,YAAY,IAAM,cAAc,IAAM,UAAU,IAAM,OAAAC,EAAK,CAAE,IAAIF,EAAIC,CAAG,IAAIC,GACtJC,IAAgB,CAACH,GAAKC,GAAKC,MAAUH,EAAgBC,GAAK,OAAOC,KAAQ,WAAWA,IAAM,KAAKA,GAAKC,CAAK,GAMzGE,IAA8B,oBAAI,IAAK,GACvCC,IAA0B,oBAAI,QAAS,GACvCC,IAAS,GACTC,IAAmB;AAIvB,SAASC,EAAUC,GAAM;AACvB,SAAKA,KACDJ,EAAQ,IAAII,CAAI,MACpBH,KAAU,GACVD,EAAQ,IAAII,GAAMH,EAAO,SAAQ,CAAE,IAC5BD,EAAQ,IAAII,CAAI,KAJL;AAKpB;AACA,SAASC,EAAYC,GAAS;AAC5B,SAAO,OAAO,KAAKA,CAAO,EAAE,KAAM,EAAC;AAAA,IACjC,CAACV,MAAQU,EAAQV,CAAG,MAAM;AAAA,EAC9B,EAAI,IAAI,CAACA,MACE,GAAGA,CAAG,IAAIA,MAAQ,SAASO,EAAUG,EAA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OmB,EAAS,EAAE,QAAAjB,GAAQ,OAAAF,GAAO,KAAK,KAAK,YAAY;AAAA,IAC7D;AACI,UAAM;AAAA,MACJ,IAAAoB;AAAA,MACA,aAAAC;AAAA,MACA,WAAAlB;AAAA,MACA,MAAAb;AAAA,MACA,YAAA0B;AAAA,MACA,UAAAM;AAAA,MACA,MAAAC;AAAA,MACA,iBAAAN;AAAA,MACA,OAAAC;AAAA,MACA,eAAAM;AAAA,MACA,gBAAAjB;AAAA,MACA,GAAGI;AAAA,IACJ,IAAG,KAAK;AACT,WAAOE,EAAM;AAAA,MACXO,KAAM;AAAA,MACN,EAAE,KAAK,KAAK,YAAY,GAAGT,EAAO;AAAA,MAClCQ;AAAA,IACD;AAAA,EACL;AACA;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import re from "../../../../@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/extends.js";
|
|
2
|
+
import U from "../../../../@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js";
|
|
3
|
+
import ie from "../../../../@babel_runtime@7.27.6/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js";
|
|
4
|
+
import D from "../../../../memoize-one@5.2.1/node_modules/memoize-one/dist/memoize-one.esm.js";
|
|
5
|
+
import { createElement as k, PureComponent as ae } from "react";
|
|
6
|
+
var ne = typeof performance == "object" && typeof performance.now == "function", V = ne ? function() {
|
|
7
|
+
return performance.now();
|
|
8
|
+
} : function() {
|
|
9
|
+
return Date.now();
|
|
10
|
+
};
|
|
11
|
+
function q(l) {
|
|
12
|
+
cancelAnimationFrame(l.id);
|
|
13
|
+
}
|
|
14
|
+
function oe(l, t) {
|
|
15
|
+
var r = V();
|
|
16
|
+
function a() {
|
|
17
|
+
V() - r >= t ? l.call(null) : n.id = requestAnimationFrame(a);
|
|
18
|
+
}
|
|
19
|
+
var n = {
|
|
20
|
+
id: requestAnimationFrame(a)
|
|
21
|
+
};
|
|
22
|
+
return n;
|
|
23
|
+
}
|
|
24
|
+
var A = -1;
|
|
25
|
+
function H(l) {
|
|
26
|
+
if (l === void 0 && (l = !1), A === -1 || l) {
|
|
27
|
+
var t = document.createElement("div"), r = t.style;
|
|
28
|
+
r.width = "50px", r.height = "50px", r.overflow = "scroll", document.body.appendChild(t), A = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
|
|
29
|
+
}
|
|
30
|
+
return A;
|
|
31
|
+
}
|
|
32
|
+
var b = null;
|
|
33
|
+
function K(l) {
|
|
34
|
+
if (l === void 0 && (l = !1), b === null || l) {
|
|
35
|
+
var t = document.createElement("div"), r = t.style;
|
|
36
|
+
r.width = "50px", r.height = "50px", r.overflow = "scroll", r.direction = "rtl";
|
|
37
|
+
var a = document.createElement("div"), n = a.style;
|
|
38
|
+
return n.width = "100px", n.height = "100px", t.appendChild(a), document.body.appendChild(t), t.scrollLeft > 0 ? b = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? b = "negative" : b = "positive-ascending"), document.body.removeChild(t), b;
|
|
39
|
+
}
|
|
40
|
+
return b;
|
|
41
|
+
}
|
|
42
|
+
process.env.NODE_ENV;
|
|
43
|
+
var le = 150, se = function(t, r) {
|
|
44
|
+
return t;
|
|
45
|
+
}, N = null, R = null;
|
|
46
|
+
process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (N = /* @__PURE__ */ new WeakSet(), R = /* @__PURE__ */ new WeakSet());
|
|
47
|
+
function ce(l) {
|
|
48
|
+
var t, r = l.getItemOffset, a = l.getEstimatedTotalSize, n = l.getItemSize, c = l.getOffsetForIndexAndAlignment, s = l.getStartIndexForOffset, h = l.getStopIndexForStartIndex, y = l.initInstanceProps, I = l.shouldResetStyleCacheOnItemSizeChange, g = l.validateProps;
|
|
49
|
+
return t = /* @__PURE__ */ function(w) {
|
|
50
|
+
ie(z, w);
|
|
51
|
+
function z(S) {
|
|
52
|
+
var e;
|
|
53
|
+
return e = w.call(this, S) || this, e._instanceProps = y(e.props, U(e)), e._outerRef = void 0, e._resetIsScrollingTimeoutId = null, e.state = {
|
|
54
|
+
instance: U(e),
|
|
55
|
+
isScrolling: !1,
|
|
56
|
+
scrollDirection: "forward",
|
|
57
|
+
scrollOffset: typeof e.props.initialScrollOffset == "number" ? e.props.initialScrollOffset : 0,
|
|
58
|
+
scrollUpdateWasRequested: !1
|
|
59
|
+
}, e._callOnItemsRendered = void 0, e._callOnItemsRendered = D(function(i, o, f, u) {
|
|
60
|
+
return e.props.onItemsRendered({
|
|
61
|
+
overscanStartIndex: i,
|
|
62
|
+
overscanStopIndex: o,
|
|
63
|
+
visibleStartIndex: f,
|
|
64
|
+
visibleStopIndex: u
|
|
65
|
+
});
|
|
66
|
+
}), e._callOnScroll = void 0, e._callOnScroll = D(function(i, o, f) {
|
|
67
|
+
return e.props.onScroll({
|
|
68
|
+
scrollDirection: i,
|
|
69
|
+
scrollOffset: o,
|
|
70
|
+
scrollUpdateWasRequested: f
|
|
71
|
+
});
|
|
72
|
+
}), e._getItemStyle = void 0, e._getItemStyle = function(i) {
|
|
73
|
+
var o = e.props, f = o.direction, u = o.itemSize, p = o.layout, d = e._getItemStyleCache(I && u, I && p, I && f), m;
|
|
74
|
+
if (d.hasOwnProperty(i))
|
|
75
|
+
m = d[i];
|
|
76
|
+
else {
|
|
77
|
+
var v = r(e.props, i, e._instanceProps), T = n(e.props, i, e._instanceProps), M = f === "horizontal" || p === "horizontal", C = f === "rtl", E = M ? v : 0;
|
|
78
|
+
d[i] = m = {
|
|
79
|
+
position: "absolute",
|
|
80
|
+
left: C ? void 0 : E,
|
|
81
|
+
right: C ? E : void 0,
|
|
82
|
+
top: M ? 0 : v,
|
|
83
|
+
height: M ? "100%" : T,
|
|
84
|
+
width: M ? T : "100%"
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
return m;
|
|
88
|
+
}, e._getItemStyleCache = void 0, e._getItemStyleCache = D(function(i, o, f) {
|
|
89
|
+
return {};
|
|
90
|
+
}), e._onScrollHorizontal = function(i) {
|
|
91
|
+
var o = i.currentTarget, f = o.clientWidth, u = o.scrollLeft, p = o.scrollWidth;
|
|
92
|
+
e.setState(function(d) {
|
|
93
|
+
if (d.scrollOffset === u)
|
|
94
|
+
return null;
|
|
95
|
+
var m = e.props.direction, v = u;
|
|
96
|
+
if (m === "rtl")
|
|
97
|
+
switch (K()) {
|
|
98
|
+
case "negative":
|
|
99
|
+
v = -u;
|
|
100
|
+
break;
|
|
101
|
+
case "positive-descending":
|
|
102
|
+
v = p - f - u;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
return v = Math.max(0, Math.min(v, p - f)), {
|
|
106
|
+
isScrolling: !0,
|
|
107
|
+
scrollDirection: d.scrollOffset < v ? "forward" : "backward",
|
|
108
|
+
scrollOffset: v,
|
|
109
|
+
scrollUpdateWasRequested: !1
|
|
110
|
+
};
|
|
111
|
+
}, e._resetIsScrollingDebounced);
|
|
112
|
+
}, e._onScrollVertical = function(i) {
|
|
113
|
+
var o = i.currentTarget, f = o.clientHeight, u = o.scrollHeight, p = o.scrollTop;
|
|
114
|
+
e.setState(function(d) {
|
|
115
|
+
if (d.scrollOffset === p)
|
|
116
|
+
return null;
|
|
117
|
+
var m = Math.max(0, Math.min(p, u - f));
|
|
118
|
+
return {
|
|
119
|
+
isScrolling: !0,
|
|
120
|
+
scrollDirection: d.scrollOffset < m ? "forward" : "backward",
|
|
121
|
+
scrollOffset: m,
|
|
122
|
+
scrollUpdateWasRequested: !1
|
|
123
|
+
};
|
|
124
|
+
}, e._resetIsScrollingDebounced);
|
|
125
|
+
}, e._outerRefSetter = function(i) {
|
|
126
|
+
var o = e.props.outerRef;
|
|
127
|
+
e._outerRef = i, typeof o == "function" ? o(i) : o != null && typeof o == "object" && o.hasOwnProperty("current") && (o.current = i);
|
|
128
|
+
}, e._resetIsScrollingDebounced = function() {
|
|
129
|
+
e._resetIsScrollingTimeoutId !== null && q(e._resetIsScrollingTimeoutId), e._resetIsScrollingTimeoutId = oe(e._resetIsScrolling, le);
|
|
130
|
+
}, e._resetIsScrolling = function() {
|
|
131
|
+
e._resetIsScrollingTimeoutId = null, e.setState({
|
|
132
|
+
isScrolling: !1
|
|
133
|
+
}, function() {
|
|
134
|
+
e._getItemStyleCache(-1, null);
|
|
135
|
+
});
|
|
136
|
+
}, e;
|
|
137
|
+
}
|
|
138
|
+
z.getDerivedStateFromProps = function(e, i) {
|
|
139
|
+
return de(e, i), g(e), null;
|
|
140
|
+
};
|
|
141
|
+
var _ = z.prototype;
|
|
142
|
+
return _.scrollTo = function(e) {
|
|
143
|
+
e = Math.max(0, e), this.setState(function(i) {
|
|
144
|
+
return i.scrollOffset === e ? null : {
|
|
145
|
+
scrollDirection: i.scrollOffset < e ? "forward" : "backward",
|
|
146
|
+
scrollOffset: e,
|
|
147
|
+
scrollUpdateWasRequested: !0
|
|
148
|
+
};
|
|
149
|
+
}, this._resetIsScrollingDebounced);
|
|
150
|
+
}, _.scrollToItem = function(e, i) {
|
|
151
|
+
i === void 0 && (i = "auto");
|
|
152
|
+
var o = this.props, f = o.itemCount, u = o.layout, p = this.state.scrollOffset;
|
|
153
|
+
e = Math.max(0, Math.min(e, f - 1));
|
|
154
|
+
var d = 0;
|
|
155
|
+
if (this._outerRef) {
|
|
156
|
+
var m = this._outerRef;
|
|
157
|
+
u === "vertical" ? d = m.scrollWidth > m.clientWidth ? H() : 0 : d = m.scrollHeight > m.clientHeight ? H() : 0;
|
|
158
|
+
}
|
|
159
|
+
this.scrollTo(c(this.props, e, i, p, this._instanceProps, d));
|
|
160
|
+
}, _.componentDidMount = function() {
|
|
161
|
+
var e = this.props, i = e.direction, o = e.initialScrollOffset, f = e.layout;
|
|
162
|
+
if (typeof o == "number" && this._outerRef != null) {
|
|
163
|
+
var u = this._outerRef;
|
|
164
|
+
i === "horizontal" || f === "horizontal" ? u.scrollLeft = o : u.scrollTop = o;
|
|
165
|
+
}
|
|
166
|
+
this._callPropsCallbacks();
|
|
167
|
+
}, _.componentDidUpdate = function() {
|
|
168
|
+
var e = this.props, i = e.direction, o = e.layout, f = this.state, u = f.scrollOffset, p = f.scrollUpdateWasRequested;
|
|
169
|
+
if (p && this._outerRef != null) {
|
|
170
|
+
var d = this._outerRef;
|
|
171
|
+
if (i === "horizontal" || o === "horizontal")
|
|
172
|
+
if (i === "rtl")
|
|
173
|
+
switch (K()) {
|
|
174
|
+
case "negative":
|
|
175
|
+
d.scrollLeft = -u;
|
|
176
|
+
break;
|
|
177
|
+
case "positive-ascending":
|
|
178
|
+
d.scrollLeft = u;
|
|
179
|
+
break;
|
|
180
|
+
default:
|
|
181
|
+
var m = d.clientWidth, v = d.scrollWidth;
|
|
182
|
+
d.scrollLeft = v - m - u;
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
else
|
|
186
|
+
d.scrollLeft = u;
|
|
187
|
+
else
|
|
188
|
+
d.scrollTop = u;
|
|
189
|
+
}
|
|
190
|
+
this._callPropsCallbacks();
|
|
191
|
+
}, _.componentWillUnmount = function() {
|
|
192
|
+
this._resetIsScrollingTimeoutId !== null && q(this._resetIsScrollingTimeoutId);
|
|
193
|
+
}, _.render = function() {
|
|
194
|
+
var e = this.props, i = e.children, o = e.className, f = e.direction, u = e.height, p = e.innerRef, d = e.innerElementType, m = e.innerTagName, v = e.itemCount, T = e.itemData, M = e.itemKey, C = M === void 0 ? se : M, E = e.layout, G = e.outerElementType, Z = e.outerTagName, J = e.style, Q = e.useIsScrolling, X = e.width, P = this.state.isScrolling, W = f === "horizontal" || E === "horizontal", Y = W ? this._onScrollHorizontal : this._onScrollVertical, L = this._getRangeToRender(), ee = L[0], te = L[1], F = [];
|
|
195
|
+
if (v > 0)
|
|
196
|
+
for (var x = ee; x <= te; x++)
|
|
197
|
+
F.push(k(i, {
|
|
198
|
+
data: T,
|
|
199
|
+
key: C(x, T),
|
|
200
|
+
index: x,
|
|
201
|
+
isScrolling: Q ? P : void 0,
|
|
202
|
+
style: this._getItemStyle(x)
|
|
203
|
+
}));
|
|
204
|
+
var $ = a(this.props, this._instanceProps);
|
|
205
|
+
return k(G || Z || "div", {
|
|
206
|
+
className: o,
|
|
207
|
+
onScroll: Y,
|
|
208
|
+
ref: this._outerRefSetter,
|
|
209
|
+
style: re({
|
|
210
|
+
position: "relative",
|
|
211
|
+
height: u,
|
|
212
|
+
width: X,
|
|
213
|
+
overflow: "auto",
|
|
214
|
+
WebkitOverflowScrolling: "touch",
|
|
215
|
+
willChange: "transform",
|
|
216
|
+
direction: f
|
|
217
|
+
}, J)
|
|
218
|
+
}, k(d || m || "div", {
|
|
219
|
+
children: F,
|
|
220
|
+
ref: p,
|
|
221
|
+
style: {
|
|
222
|
+
height: W ? "100%" : $,
|
|
223
|
+
pointerEvents: P ? "none" : void 0,
|
|
224
|
+
width: W ? $ : "100%"
|
|
225
|
+
}
|
|
226
|
+
}));
|
|
227
|
+
}, _._callPropsCallbacks = function() {
|
|
228
|
+
if (typeof this.props.onItemsRendered == "function") {
|
|
229
|
+
var e = this.props.itemCount;
|
|
230
|
+
if (e > 0) {
|
|
231
|
+
var i = this._getRangeToRender(), o = i[0], f = i[1], u = i[2], p = i[3];
|
|
232
|
+
this._callOnItemsRendered(o, f, u, p);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if (typeof this.props.onScroll == "function") {
|
|
236
|
+
var d = this.state, m = d.scrollDirection, v = d.scrollOffset, T = d.scrollUpdateWasRequested;
|
|
237
|
+
this._callOnScroll(m, v, T);
|
|
238
|
+
}
|
|
239
|
+
}, _._getRangeToRender = function() {
|
|
240
|
+
var e = this.props, i = e.itemCount, o = e.overscanCount, f = this.state, u = f.isScrolling, p = f.scrollDirection, d = f.scrollOffset;
|
|
241
|
+
if (i === 0)
|
|
242
|
+
return [0, 0, 0, 0];
|
|
243
|
+
var m = s(this.props, d, this._instanceProps), v = h(this.props, m, d, this._instanceProps), T = !u || p === "backward" ? Math.max(1, o) : 1, M = !u || p === "forward" ? Math.max(1, o) : 1;
|
|
244
|
+
return [Math.max(0, m - T), Math.max(0, Math.min(i - 1, v + M)), m, v];
|
|
245
|
+
}, z;
|
|
246
|
+
}(ae), t.defaultProps = {
|
|
247
|
+
direction: "ltr",
|
|
248
|
+
itemData: void 0,
|
|
249
|
+
layout: "vertical",
|
|
250
|
+
overscanCount: 2,
|
|
251
|
+
useIsScrolling: !1
|
|
252
|
+
}, t;
|
|
253
|
+
}
|
|
254
|
+
var de = function(t, r) {
|
|
255
|
+
var a = t.children, n = t.direction, c = t.height, s = t.layout, h = t.innerTagName, y = t.outerTagName, I = t.width, g = r.instance;
|
|
256
|
+
if (process.env.NODE_ENV !== "production") {
|
|
257
|
+
(h != null || y != null) && R && !R.has(g) && (R.add(g), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));
|
|
258
|
+
var w = n === "horizontal" || s === "horizontal";
|
|
259
|
+
switch (n) {
|
|
260
|
+
case "horizontal":
|
|
261
|
+
case "vertical":
|
|
262
|
+
N && !N.has(g) && (N.add(g), console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));
|
|
263
|
+
break;
|
|
264
|
+
case "ltr":
|
|
265
|
+
case "rtl":
|
|
266
|
+
break;
|
|
267
|
+
default:
|
|
268
|
+
throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". ' + ('"' + n + '" was specified.'));
|
|
269
|
+
}
|
|
270
|
+
switch (s) {
|
|
271
|
+
case "horizontal":
|
|
272
|
+
case "vertical":
|
|
273
|
+
break;
|
|
274
|
+
default:
|
|
275
|
+
throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". ' + ('"' + s + '" was specified.'));
|
|
276
|
+
}
|
|
277
|
+
if (a == null)
|
|
278
|
+
throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (a === null ? "null" : typeof a) + '" was specified.'));
|
|
279
|
+
if (w && typeof I != "number")
|
|
280
|
+
throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. ' + ('"' + (I === null ? "null" : typeof I) + '" was specified.'));
|
|
281
|
+
if (!w && typeof c != "number")
|
|
282
|
+
throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. ' + ('"' + (c === null ? "null" : typeof c) + '" was specified.'));
|
|
283
|
+
}
|
|
284
|
+
}, fe = 50, O = function(t, r, a) {
|
|
285
|
+
var n = t, c = n.itemSize, s = a.itemMetadataMap, h = a.lastMeasuredIndex;
|
|
286
|
+
if (r > h) {
|
|
287
|
+
var y = 0;
|
|
288
|
+
if (h >= 0) {
|
|
289
|
+
var I = s[h];
|
|
290
|
+
y = I.offset + I.size;
|
|
291
|
+
}
|
|
292
|
+
for (var g = h + 1; g <= r; g++) {
|
|
293
|
+
var w = c(g);
|
|
294
|
+
s[g] = {
|
|
295
|
+
offset: y,
|
|
296
|
+
size: w
|
|
297
|
+
}, y += w;
|
|
298
|
+
}
|
|
299
|
+
a.lastMeasuredIndex = r;
|
|
300
|
+
}
|
|
301
|
+
return s[r];
|
|
302
|
+
}, ue = function(t, r, a) {
|
|
303
|
+
var n = r.itemMetadataMap, c = r.lastMeasuredIndex, s = c > 0 ? n[c].offset : 0;
|
|
304
|
+
return s >= a ? j(t, r, c, 0, a) : he(t, r, Math.max(0, c), a);
|
|
305
|
+
}, j = function(t, r, a, n, c) {
|
|
306
|
+
for (; n <= a; ) {
|
|
307
|
+
var s = n + Math.floor((a - n) / 2), h = O(t, s, r).offset;
|
|
308
|
+
if (h === c)
|
|
309
|
+
return s;
|
|
310
|
+
h < c ? n = s + 1 : h > c && (a = s - 1);
|
|
311
|
+
}
|
|
312
|
+
return n > 0 ? n - 1 : 0;
|
|
313
|
+
}, he = function(t, r, a, n) {
|
|
314
|
+
for (var c = t.itemCount, s = 1; a < c && O(t, a, r).offset < n; )
|
|
315
|
+
a += s, s *= 2;
|
|
316
|
+
return j(t, r, Math.min(a, c - 1), Math.floor(a / 2), n);
|
|
317
|
+
}, B = function(t, r) {
|
|
318
|
+
var a = t.itemCount, n = r.itemMetadataMap, c = r.estimatedItemSize, s = r.lastMeasuredIndex, h = 0;
|
|
319
|
+
if (s >= a && (s = a - 1), s >= 0) {
|
|
320
|
+
var y = n[s];
|
|
321
|
+
h = y.offset + y.size;
|
|
322
|
+
}
|
|
323
|
+
var I = a - s - 1, g = I * c;
|
|
324
|
+
return h + g;
|
|
325
|
+
}, Se = /* @__PURE__ */ ce({
|
|
326
|
+
getItemOffset: function(t, r, a) {
|
|
327
|
+
return O(t, r, a).offset;
|
|
328
|
+
},
|
|
329
|
+
getItemSize: function(t, r, a) {
|
|
330
|
+
return a.itemMetadataMap[r].size;
|
|
331
|
+
},
|
|
332
|
+
getEstimatedTotalSize: B,
|
|
333
|
+
getOffsetForIndexAndAlignment: function(t, r, a, n, c, s) {
|
|
334
|
+
var h = t.direction, y = t.height, I = t.layout, g = t.width, w = h === "horizontal" || I === "horizontal", z = w ? g : y, _ = O(t, r, c), S = B(t, c), e = Math.max(0, Math.min(S - z, _.offset)), i = Math.max(0, _.offset - z + _.size + s);
|
|
335
|
+
switch (a === "smart" && (n >= i - z && n <= e + z ? a = "auto" : a = "center"), a) {
|
|
336
|
+
case "start":
|
|
337
|
+
return e;
|
|
338
|
+
case "end":
|
|
339
|
+
return i;
|
|
340
|
+
case "center":
|
|
341
|
+
return Math.round(i + (e - i) / 2);
|
|
342
|
+
case "auto":
|
|
343
|
+
default:
|
|
344
|
+
return n >= i && n <= e ? n : n < i ? i : e;
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
getStartIndexForOffset: function(t, r, a) {
|
|
348
|
+
return ue(t, a, r);
|
|
349
|
+
},
|
|
350
|
+
getStopIndexForStartIndex: function(t, r, a, n) {
|
|
351
|
+
for (var c = t.direction, s = t.height, h = t.itemCount, y = t.layout, I = t.width, g = c === "horizontal" || y === "horizontal", w = g ? I : s, z = O(t, r, n), _ = a + w, S = z.offset + z.size, e = r; e < h - 1 && S < _; )
|
|
352
|
+
e++, S += O(t, e, n).size;
|
|
353
|
+
return e;
|
|
354
|
+
},
|
|
355
|
+
initInstanceProps: function(t, r) {
|
|
356
|
+
var a = t, n = a.estimatedItemSize, c = {
|
|
357
|
+
itemMetadataMap: {},
|
|
358
|
+
estimatedItemSize: n || fe,
|
|
359
|
+
lastMeasuredIndex: -1
|
|
360
|
+
};
|
|
361
|
+
return r.resetAfterIndex = function(s, h) {
|
|
362
|
+
h === void 0 && (h = !0), c.lastMeasuredIndex = Math.min(c.lastMeasuredIndex, s - 1), r._getItemStyleCache(-1), h && r.forceUpdate();
|
|
363
|
+
}, c;
|
|
364
|
+
},
|
|
365
|
+
shouldResetStyleCacheOnItemSizeChange: !1,
|
|
366
|
+
validateProps: function(t) {
|
|
367
|
+
var r = t.itemSize;
|
|
368
|
+
if (process.env.NODE_ENV !== "production" && typeof r != "function")
|
|
369
|
+
throw Error('An invalid "itemSize" prop has been specified. Value should be a function. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
export {
|
|
373
|
+
Se as VariableSizeList
|
|
374
|
+
};
|
|
375
|
+
//# sourceMappingURL=index.esm.js.map
|