@tamagui/z-index-stack 2.0.0-rc.4 → 2.0.0-rc.40
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/cjs/StackZIndex.cjs +22 -17
- package/dist/cjs/StackZIndex.native.js +31 -26
- package/dist/cjs/StackZIndex.native.js.map +1 -1
- package/dist/cjs/context.cjs +14 -12
- package/dist/cjs/context.native.js +15 -13
- package/dist/cjs/context.native.js.map +1 -1
- package/dist/cjs/index.cjs +7 -5
- package/dist/cjs/index.native.js +7 -5
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/types.cjs +7 -5
- package/dist/cjs/types.native.js +7 -5
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/useStackedZIndex.cjs +75 -61
- package/dist/cjs/useStackedZIndex.native.js +80 -67
- package/dist/cjs/useStackedZIndex.native.js.map +1 -1
- package/dist/esm/StackZIndex.mjs +7 -4
- package/dist/esm/StackZIndex.mjs.map +1 -1
- package/dist/esm/StackZIndex.native.js +14 -11
- package/dist/esm/StackZIndex.native.js.map +1 -1
- package/dist/esm/context.mjs +2 -2
- package/dist/esm/context.mjs.map +1 -1
- package/dist/esm/context.native.js +2 -2
- package/dist/esm/context.native.js.map +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -6
- package/dist/esm/useStackedZIndex.mjs +61 -49
- package/dist/esm/useStackedZIndex.mjs.map +1 -1
- package/dist/esm/useStackedZIndex.native.js +66 -55
- package/dist/esm/useStackedZIndex.native.js.map +1 -1
- package/package.json +5 -8
- package/dist/cjs/StackZIndex.js +0 -29
- package/dist/cjs/StackZIndex.js.map +0 -6
- package/dist/cjs/context.js +0 -23
- package/dist/cjs/context.js.map +0 -6
- package/dist/cjs/index.js +0 -17
- package/dist/cjs/index.js.map +0 -6
- package/dist/cjs/types.js +0 -14
- package/dist/cjs/types.js.map +0 -6
- package/dist/cjs/useStackedZIndex.js +0 -61
- package/dist/cjs/useStackedZIndex.js.map +0 -6
- package/dist/esm/StackZIndex.js +0 -15
- package/dist/esm/StackZIndex.js.map +0 -6
- package/dist/esm/context.js +0 -7
- package/dist/esm/context.js.map +0 -6
- package/dist/esm/types.js +0 -1
- package/dist/esm/types.js.map +0 -6
- package/dist/esm/useStackedZIndex.js +0 -46
- package/dist/esm/useStackedZIndex.js.map +0 -6
package/dist/cjs/StackZIndex.cjs
CHANGED
|
@@ -3,29 +3,31 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
14
|
get: () => from[key],
|
|
14
15
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
16
|
});
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
21
|
+
value: true
|
|
20
22
|
}), mod);
|
|
21
23
|
var StackZIndex_exports = {};
|
|
22
24
|
__export(StackZIndex_exports, {
|
|
23
25
|
StackZIndexContext: () => StackZIndexContext
|
|
24
26
|
});
|
|
25
27
|
module.exports = __toCommonJS(StackZIndex_exports);
|
|
26
|
-
var import_react = require("react")
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
var import_react = require("react");
|
|
29
|
+
var import_context = require("./context.cjs");
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
31
|
const StackZIndexContext = ({
|
|
30
32
|
children,
|
|
31
33
|
zIndex
|
|
@@ -35,8 +37,11 @@ const StackZIndexContext = ({
|
|
|
35
37
|
value: existing + 1,
|
|
36
38
|
children
|
|
37
39
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
if (typeof zIndex !== "undefined") {
|
|
41
|
+
content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_context.ZIndexHardcodedContext.Provider, {
|
|
42
|
+
value: zIndex,
|
|
43
|
+
children: content
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return content;
|
|
42
47
|
};
|
|
@@ -5,42 +5,47 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value:
|
|
23
|
+
value: true
|
|
22
24
|
}), mod);
|
|
23
25
|
var StackZIndex_exports = {};
|
|
24
26
|
__export(StackZIndex_exports, {
|
|
25
27
|
StackZIndexContext: () => StackZIndexContext
|
|
26
28
|
});
|
|
27
29
|
module.exports = __toCommonJS(StackZIndex_exports);
|
|
28
|
-
var import_jsx_runtime = require("react/jsx-runtime")
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
|
+
var import_react = require("react");
|
|
32
|
+
var import_context = require("./context.native.js");
|
|
33
|
+
var StackZIndexContext = function (param) {
|
|
34
|
+
var {
|
|
35
|
+
children,
|
|
36
|
+
zIndex
|
|
37
|
+
} = param;
|
|
38
|
+
var existing = (0, import_react.useContext)(import_context.ZIndexStackContext);
|
|
39
|
+
var content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_context.ZIndexStackContext.Provider, {
|
|
40
|
+
value: existing + 1,
|
|
41
|
+
children
|
|
42
|
+
});
|
|
43
|
+
if (typeof zIndex !== "undefined") {
|
|
44
|
+
content = /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_context.ZIndexHardcodedContext.Provider, {
|
|
42
45
|
value: zIndex,
|
|
43
46
|
children: content
|
|
44
|
-
})
|
|
45
|
-
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return content;
|
|
50
|
+
};
|
|
46
51
|
//# sourceMappingURL=StackZIndex.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","StackZIndex_exports","__export","StackZIndexContext","module","exports","import_jsx_runtime","require","import_react","import_context","param","children","zIndex","existing","useContext","ZIndexStackContext","content","jsx","Provider","ZIndexHardcodedContext"],"sources":["../../src/StackZIndex.tsx"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","StackZIndex_exports","__export","StackZIndexContext","module","exports","import_jsx_runtime","require","import_react","import_context","param","children","zIndex","existing","useContext","ZIndexStackContext","content","jsx","Provider","ZIndexHardcodedContext"],"sources":["../../src/StackZIndex.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,mBAAA;AAAAC,QAAA,CAAAD,mBAAA;EAAAE,kBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAA2B,CAAAK,mBAAA;AAC3B,IAAAK,kBAA2D,GAAAC,OAAA;AAYvD,IAAAC,YAAA,GAAAD,OAAA;AAVG,IAAAE,cAAM,GAAAF,OAAsB;AAAA,IACjCJ,kBAAA,YAAAA,CAAAO,KAAA;EACA;IAAAC,QAAA;IAAAC;EAAA,IAAAF,KAAA;EACF,IAGMG,QAAA,OAAAL,YAAA,CAAAM,UAAA,EAAAL,cAAA,CAAAM,kBAAA;EACJ,IAAAC,OAAM,kBAAW,IAAAV,kBAAW,CAAAW,GAAA,EAAAR,cAAA,CAAAM,kBAAkB,CAAAG,QAAA;IAE9ClB,KAAI,EAAAa,QACF;IAKFF;EACE;EAKF,WAAAC,MAAA;IAEAI,OAAO,sBAAAV,kBAAA,CAAAW,GAAA,EAAAR,cAAA,CAAAU,sBAAA,CAAAD,QAAA;MACTlB,KAAA,EAAAY,MAAA","ignoreList":[]}
|
package/dist/cjs/context.cjs
CHANGED
|
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
14
|
get: () => from[key],
|
|
14
15
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
16
|
});
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
21
|
+
value: true
|
|
20
22
|
}), mod);
|
|
21
23
|
var context_exports = {};
|
|
22
24
|
__export(context_exports, {
|
|
@@ -25,5 +27,5 @@ __export(context_exports, {
|
|
|
25
27
|
});
|
|
26
28
|
module.exports = __toCommonJS(context_exports);
|
|
27
29
|
var import_react = require("react");
|
|
28
|
-
const ZIndexStackContext = (0, import_react.createContext)(1)
|
|
29
|
-
|
|
30
|
+
const ZIndexStackContext = (0, import_react.createContext)(1);
|
|
31
|
+
const ZIndexHardcodedContext = (0, import_react.createContext)(void 0);
|
|
@@ -5,20 +5,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value:
|
|
23
|
+
value: true
|
|
22
24
|
}), mod);
|
|
23
25
|
var context_exports = {};
|
|
24
26
|
__export(context_exports, {
|
|
@@ -26,7 +28,7 @@ __export(context_exports, {
|
|
|
26
28
|
ZIndexStackContext: () => ZIndexStackContext
|
|
27
29
|
});
|
|
28
30
|
module.exports = __toCommonJS(context_exports);
|
|
29
|
-
var import_react = require("react")
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
var import_react = require("react");
|
|
32
|
+
var ZIndexStackContext = (0, import_react.createContext)(1);
|
|
33
|
+
var ZIndexHardcodedContext = (0, import_react.createContext)(void 0);
|
|
32
34
|
//# sourceMappingURL=context.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","context_exports","__export","ZIndexHardcodedContext","ZIndexStackContext","module","exports","import_react","require","createContext"],"sources":["../../src/context.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","context_exports","__export","ZIndexHardcodedContext","ZIndexStackContext","module","exports","import_react","require","createContext"],"sources":["../../src/context.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,eAAA;AAAAC,QAAA,CAAAD,eAAA;EAAAE,sBAAA,EAAAA,CAAA,KAAAA,sBAAA;EAAAC,kBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAV,YAA8B,CAAAK,eAAA;AAGvB,IAAAM,YAAM,GAAAC,OAAA,QAAqB;AAG3B,IAAAJ,kBAAM,OAAAG,YAAyB,CAAAE,aAAA","ignoreList":[]}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -3,15 +3,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
7
8
|
get: () => from[key],
|
|
8
9
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
9
10
|
});
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
13
15
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
14
|
-
value:
|
|
16
|
+
value: true
|
|
15
17
|
}), mod);
|
|
16
18
|
var index_exports = {};
|
|
17
19
|
module.exports = __toCommonJS(index_exports);
|
package/dist/cjs/index.native.js
CHANGED
|
@@ -5,15 +5,17 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __copyProps = (to, from, except, desc) => {
|
|
8
|
-
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
9
10
|
get: () => from[key],
|
|
10
11
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
11
12
|
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
17
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
16
|
-
value:
|
|
18
|
+
value: true
|
|
17
19
|
}), mod);
|
|
18
20
|
var index_exports = {};
|
|
19
21
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports","__reExport","require"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports","__reExport","require"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA;AACdG,UAAA,CAAAH,aAAA,EAAcI,OAAA,+BADd,GAAAH,MAAA,CAAAC,OAAA;AAEAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,0BAFd,GAAAH,MAAA,CAAAC,OAAA","ignoreList":[]}
|
package/dist/cjs/types.cjs
CHANGED
|
@@ -3,14 +3,16 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
8
|
+
get: () => from[key],
|
|
9
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
10
|
+
});
|
|
11
|
+
}
|
|
10
12
|
return to;
|
|
11
13
|
};
|
|
12
14
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
13
|
-
value:
|
|
15
|
+
value: true
|
|
14
16
|
}), mod);
|
|
15
17
|
var types_exports = {};
|
|
16
18
|
module.exports = __toCommonJS(types_exports);
|
package/dist/cjs/types.native.js
CHANGED
|
@@ -5,14 +5,16 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __copyProps = (to, from, except, desc) => {
|
|
8
|
-
if (from && typeof from
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
10
|
+
get: () => from[key],
|
|
11
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
12
|
+
});
|
|
13
|
+
}
|
|
12
14
|
return to;
|
|
13
15
|
};
|
|
14
16
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
15
|
-
value:
|
|
17
|
+
value: true
|
|
16
18
|
}), mod);
|
|
17
19
|
var types_exports = {};
|
|
18
20
|
module.exports = __toCommonJS(types_exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","types_exports"],"sources":["../../src/types.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","types_exports"],"sources":["../../src/types.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA","ignoreList":[]}
|
|
@@ -3,78 +3,92 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
14
|
get: () => from[key],
|
|
14
15
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
16
|
});
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
21
|
+
value: true
|
|
20
22
|
}), mod);
|
|
21
23
|
var useStackedZIndex_exports = {};
|
|
22
24
|
__export(useStackedZIndex_exports, {
|
|
23
25
|
useStackedZIndex: () => useStackedZIndex
|
|
24
26
|
});
|
|
25
27
|
module.exports = __toCommonJS(useStackedZIndex_exports);
|
|
26
|
-
var import_react = require("react")
|
|
27
|
-
|
|
28
|
-
const ZIndicesByContext = {}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
28
|
+
var import_react = require("react");
|
|
29
|
+
var import_context = require("./context.cjs");
|
|
30
|
+
const ZIndicesByContext = {};
|
|
31
|
+
const CurrentPortalZIndices = {};
|
|
32
|
+
const useStackedZIndex = props => {
|
|
33
|
+
if (process.env.TAMAGUI_STACK_Z_INDEX_GLOBAL) {
|
|
34
|
+
const {
|
|
35
|
+
stackZIndex,
|
|
36
|
+
zIndex: zIndexProp
|
|
37
|
+
} = props;
|
|
38
|
+
const id = (0, import_react.useId)();
|
|
39
|
+
const zIndex = (0, import_react.useMemo)(() => {
|
|
40
|
+
if (stackZIndex && stackZIndex !== "global" && zIndexProp === void 0) {
|
|
41
|
+
const highest = Object.values(CurrentPortalZIndices).reduce((acc, cur) => Math.max(acc, cur), 0);
|
|
42
|
+
return Math.max(stackZIndex === true ? 1 : stackZIndex, highest + 1);
|
|
43
|
+
}
|
|
44
|
+
return zIndexProp ?? 1e3;
|
|
45
|
+
}, [stackZIndex]);
|
|
46
|
+
(0, import_react.useEffect)(() => {
|
|
47
|
+
if (typeof stackZIndex === "number") {
|
|
48
|
+
CurrentPortalZIndices[id] = stackZIndex;
|
|
49
|
+
return () => {
|
|
46
50
|
delete CurrentPortalZIndices[id];
|
|
47
51
|
};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
52
|
+
}
|
|
53
|
+
}, [stackZIndex]);
|
|
54
|
+
return zIndex;
|
|
55
|
+
} else {
|
|
56
|
+
const {
|
|
57
|
+
stackZIndex,
|
|
58
|
+
zIndex: zIndexProp
|
|
59
|
+
} = props;
|
|
60
|
+
const id = (0, import_react.useId)();
|
|
61
|
+
const stackingContextLevel = (0, import_react.useContext)(import_context.ZIndexStackContext);
|
|
62
|
+
const stackLayer = stackZIndex === "global" ? 0 : stackingContextLevel;
|
|
63
|
+
const hardcoded = (0, import_react.useContext)(import_context.ZIndexHardcodedContext);
|
|
64
|
+
ZIndicesByContext[stackLayer] ||= {};
|
|
65
|
+
const stackContext = ZIndicesByContext[stackLayer];
|
|
66
|
+
const zIndex = (0, import_react.useMemo)(() => {
|
|
67
|
+
if (typeof zIndexProp === "number") {
|
|
68
|
+
return zIndexProp;
|
|
69
|
+
}
|
|
70
|
+
if (stackZIndex) {
|
|
71
|
+
if (hardcoded) {
|
|
72
|
+
return hardcoded + 1;
|
|
73
|
+
}
|
|
74
|
+
const entries = Object.values(stackContext);
|
|
75
|
+
const baseForLayer = stackLayer * 5e3;
|
|
76
|
+
const nextLayerBase = (stackLayer + 1) * 5e3;
|
|
77
|
+
const validEntries = entries.filter(z => z < nextLayerBase);
|
|
78
|
+
const highest = validEntries.length > 0 ? Math.max(...validEntries) : baseForLayer;
|
|
79
|
+
const nextZIndex = highest === baseForLayer ? baseForLayer + 1 : highest + 1;
|
|
80
|
+
return typeof stackZIndex === "number" ? stackZIndex + nextZIndex : nextZIndex;
|
|
81
|
+
}
|
|
82
|
+
return 1;
|
|
83
|
+
}, [stackLayer, zIndexProp, stackZIndex]);
|
|
84
|
+
(0, import_react.useEffect)(() => {
|
|
85
|
+
if (stackZIndex) {
|
|
86
|
+
stackContext[id] = zIndex;
|
|
87
|
+
return () => {
|
|
76
88
|
delete stackContext[id];
|
|
77
89
|
};
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
90
|
+
}
|
|
91
|
+
}, [zIndex]);
|
|
92
|
+
return zIndex;
|
|
93
|
+
}
|
|
94
|
+
};
|