@tamagui/use-did-finish-ssr 1.61.2 → 1.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +9 -18
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +36 -0
- package/dist/cjs/index.native.js.map +6 -0
- package/dist/esm/index.js +4 -9
- package/dist/esm/index.js.map +1 -1
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable:
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
10
|
for (let key of __getOwnPropNames(from))
|
|
13
|
-
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
12
|
return to;
|
|
17
13
|
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value:
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
19
15
|
var src_exports = {};
|
|
20
16
|
__export(src_exports, {
|
|
21
17
|
useClientValue: () => useClientValue,
|
|
@@ -24,21 +20,16 @@ __export(src_exports, {
|
|
|
24
20
|
module.exports = __toCommonJS(src_exports);
|
|
25
21
|
var import_react = require("react");
|
|
26
22
|
const emptyFn = () => {
|
|
27
|
-
};
|
|
28
|
-
const emptyFnFn = () => emptyFn;
|
|
23
|
+
}, emptyFnFn = () => emptyFn;
|
|
29
24
|
function useDidFinishSSR(value) {
|
|
30
|
-
if (process.env.TAMAGUI_TARGET === "native") {
|
|
31
|
-
return value ?? true;
|
|
32
|
-
}
|
|
33
25
|
return (0, import_react.useSyncExternalStore)(
|
|
34
26
|
emptyFnFn,
|
|
35
|
-
() => value
|
|
36
|
-
() =>
|
|
27
|
+
() => value ?? !0,
|
|
28
|
+
() => !1
|
|
37
29
|
);
|
|
38
30
|
}
|
|
39
31
|
function useClientValue(value) {
|
|
40
|
-
|
|
41
|
-
return !done ? void 0 : typeof value === "function" ? value() : value;
|
|
32
|
+
return useDidFinishSSR() ? typeof value == "function" ? value() : value : void 0;
|
|
42
33
|
}
|
|
43
34
|
// Annotate the CommonJS export names for ESM import in node:
|
|
44
35
|
0 && (module.exports = {
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAqC;AAErC,MAAM,UAAU,MAAM;AAAC,GACjB,YAAY,MAAM;AAEjB,SAAS,gBAA6B,OAAsB;AAMjE,aAAO;AAAA,IACL;AAAA,IACA,MAAO,SAAqB;AAAA,IAC5B,MAAM;AAAA,EACR;AACF;AAIO,SAAS,eAAsB,OAAmD;AAEvF,SADa,gBAAgB,IACF,OAAO,SAAU,aAAa,MAAM,IAAI,QAApD;AACjB;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
+
var src_exports = {};
|
|
17
|
+
__export(src_exports, {
|
|
18
|
+
useClientValue: () => useClientValue,
|
|
19
|
+
useDidFinishSSR: () => useDidFinishSSR
|
|
20
|
+
});
|
|
21
|
+
module.exports = __toCommonJS(src_exports);
|
|
22
|
+
var import_react = require("react");
|
|
23
|
+
const emptyFn = () => {
|
|
24
|
+
}, emptyFnFn = () => emptyFn;
|
|
25
|
+
function useDidFinishSSR(value) {
|
|
26
|
+
return value ?? !0;
|
|
27
|
+
}
|
|
28
|
+
function useClientValue(value) {
|
|
29
|
+
return useDidFinishSSR() ? typeof value == "function" ? value() : value : void 0;
|
|
30
|
+
}
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
useClientValue,
|
|
34
|
+
useDidFinishSSR
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAqC;AAErC,MAAM,UAAU,MAAM;AAAC,GACjB,YAAY,MAAM;AAEjB,SAAS,gBAA6B,OAAsB;AAG/D,SAAO,SAAS;AAQpB;AAIO,SAAS,eAAsB,OAAmD;AAEvF,SADa,gBAAgB,IACF,OAAO,SAAU,aAAa,MAAM,IAAI,QAApD;AACjB;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { useSyncExternalStore } from "react";
|
|
2
2
|
const emptyFn = () => {
|
|
3
|
-
};
|
|
4
|
-
const emptyFnFn = () => emptyFn;
|
|
3
|
+
}, emptyFnFn = () => emptyFn;
|
|
5
4
|
function useDidFinishSSR(value) {
|
|
6
|
-
if (process.env.TAMAGUI_TARGET === "native") {
|
|
7
|
-
return value ?? true;
|
|
8
|
-
}
|
|
9
5
|
return useSyncExternalStore(
|
|
10
6
|
emptyFnFn,
|
|
11
|
-
() => value
|
|
12
|
-
() =>
|
|
7
|
+
() => value ?? !0,
|
|
8
|
+
() => !1
|
|
13
9
|
);
|
|
14
10
|
}
|
|
15
11
|
function useClientValue(value) {
|
|
16
|
-
|
|
17
|
-
return !done ? void 0 : typeof value === "function" ? value() : value;
|
|
12
|
+
return useDidFinishSSR() ? typeof value == "function" ? value() : value : void 0;
|
|
18
13
|
}
|
|
19
14
|
export {
|
|
20
15
|
useClientValue,
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": "AAAA,SAAS,4BAA4B;AAErC,MAAM,UAAU,MAAM;AAAC
|
|
4
|
+
"mappings": "AAAA,SAAS,4BAA4B;AAErC,MAAM,UAAU,MAAM;AAAC,GACjB,YAAY,MAAM;AAEjB,SAAS,gBAA6B,OAAsB;AAMjE,SAAO;AAAA,IACL;AAAA,IACA,MAAO,SAAqB;AAAA,IAC5B,MAAM;AAAA,EACR;AACF;AAIO,SAAS,eAAsB,OAAmD;AAEvF,SADa,gBAAgB,IACF,OAAO,SAAU,aAAa,MAAM,IAAI,QAApD;AACjB;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-did-finish-ssr",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.62.0",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@tamagui/constants": "1.
|
|
29
|
+
"@tamagui/constants": "1.62.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@tamagui/build": "1.
|
|
32
|
+
"@tamagui/build": "1.62.0",
|
|
33
33
|
"react": "^18.2.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|