@tamagui/use-presence 3.0.7 → 3.0.8
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/PresenceContext.native.cjs +1 -1
- package/dist/cjs/PresenceContext.native.js +1 -1
- package/dist/cjs/PresenceContext.native.js.map +1 -1
- package/dist/cjs/usePresence.native.cjs +1 -1
- package/dist/cjs/usePresence.native.js +1 -1
- package/dist/cjs/usePresence.native.js.map +1 -1
- package/dist/esm/PresenceContext.native.js +1 -1
- package/dist/esm/PresenceContext.native.js.map +1 -1
- package/dist/esm/usePresence.native.js +1 -1
- package/dist/esm/usePresence.native.js.map +1 -1
- package/package.json +4 -4
|
@@ -35,7 +35,7 @@ module.exports = __toCommonJS(PresenceContext_exports);
|
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var React = __toESM(require("react"), 1);
|
|
37
37
|
var PresenceContext = /* @__PURE__ */ React.createContext(null);
|
|
38
|
-
var ResetPresence = function(props) {
|
|
38
|
+
var ResetPresence = function ResetPresence2(props) {
|
|
39
39
|
var parent = React.useContext(PresenceContext);
|
|
40
40
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PresenceContext.Provider, {
|
|
41
41
|
value: props.disable ? parent : null,
|
|
@@ -35,7 +35,7 @@ module.exports = __toCommonJS(PresenceContext_exports);
|
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var React = __toESM(require("react"), 1);
|
|
37
37
|
var PresenceContext = /* @__PURE__ */ React.createContext(null);
|
|
38
|
-
var ResetPresence = function(props) {
|
|
38
|
+
var ResetPresence = function ResetPresence2(props) {
|
|
39
39
|
var parent = React.useContext(PresenceContext);
|
|
40
40
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PresenceContext.Provider, {
|
|
41
41
|
value: props.disable ? parent : null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresenceContext.native.js","names":[],"sources":["cjs/PresenceContext.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar PresenceContext_exports = {};\n__export(PresenceContext_exports, {\n PresenceContext: () => PresenceContext,\n ResetPresence: () => ResetPresence\n});\nmodule.exports = __toCommonJS(PresenceContext_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar React = __toESM(require(\"react\"), 1);\nvar PresenceContext = /* @__PURE__ */ React.createContext(null);\nvar ResetPresence = function(props) {\n var parent = React.useContext(PresenceContext);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PresenceContext.Provider, {\n value: props.disable ? parent : null,\n children: props.children\n });\n};\n//# sourceMappingURL=PresenceContext.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB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\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar PresenceContext_exports = {};\n__export(PresenceContext_exports, {\n PresenceContext: () => PresenceContext,\n ResetPresence: () => ResetPresence\n});\nmodule.exports = __toCommonJS(PresenceContext_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar React = __toESM(require(\"react\"), 1);\nvar PresenceContext = /* @__PURE__ */ React.createContext(null);\nvar ResetPresence = function ResetPresence2(props) {\n var parent = React.useContext(PresenceContext);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PresenceContext.Provider, {\n value: props.disable ? parent : null,\n children: props.children\n });\n};\n//# sourceMappingURL=PresenceContext.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,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AM,UAAU,SAAS;EAChC,UAAU,MAAM;CAClB,CAAC;AACH"}
|
|
@@ -55,7 +55,7 @@ function usePresence(registration) {
|
|
|
55
55
|
context
|
|
56
56
|
];
|
|
57
57
|
var { id, isPresent: isPresent2, onExitComplete } = context;
|
|
58
|
-
var safeToRemove = function() {
|
|
58
|
+
var safeToRemove = function safeToRemove2() {
|
|
59
59
|
return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id);
|
|
60
60
|
};
|
|
61
61
|
return !isPresent2 && onExitComplete ? [
|
|
@@ -55,7 +55,7 @@ function usePresence(registration) {
|
|
|
55
55
|
context
|
|
56
56
|
];
|
|
57
57
|
var { id, isPresent: isPresent2, onExitComplete } = context;
|
|
58
|
-
var safeToRemove = function() {
|
|
58
|
+
var safeToRemove = function safeToRemove2() {
|
|
59
59
|
return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id);
|
|
60
60
|
};
|
|
61
61
|
return !isPresent2 && onExitComplete ? [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePresence.native.js","names":[],"sources":["cjs/usePresence.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar usePresence_exports = {};\n__export(usePresence_exports, {\n isPresent: () => isPresent,\n useIsPresent: () => useIsPresent,\n usePresence: () => usePresence\n});\nmodule.exports = __toCommonJS(usePresence_exports);\nvar React = __toESM(require(\"react\"), 1);\nvar import_PresenceContext = require(\"./PresenceContext\");\nfunction usePresence(registration) {\n var context = React.useContext(import_PresenceContext.PresenceContext);\n var unregister = React.useRef(void 0);\n React.useEffect(function() {\n if (!unregister.current && context && (registration ? registration.shouldRegisterPresence : true)) {\n unregister.current = context.register(context.id);\n }\n });\n React.useEffect(function() {\n return function() {\n if (typeof unregister.current === \"function\") unregister.current();\n unregister.current = void 0;\n };\n }, []);\n if (!context) return [\n true,\n null,\n context\n ];\n var { id, isPresent: isPresent2, onExitComplete } = context;\n var safeToRemove = function() {\n return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id);\n };\n return !isPresent2 && onExitComplete ? [\n false,\n safeToRemove,\n context\n ] : [\n true,\n void 0,\n context\n ];\n}\nfunction useIsPresent() {\n return isPresent(React.useContext(import_PresenceContext.PresenceContext));\n}\nfunction isPresent(context) {\n return context === null ? true : context.isPresent;\n}\n//# sourceMappingURL=usePresence.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK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AAQ;GACjE,WAAW,UAAU,KAAK;EAC5B;CACF,GAAG,CAAC,CAAC;CACL,IAAI,CAAC,SAAS,OAAO;EACnB;EACA;EACA;CACF;CACA,IAAI,EAAE,IAAI,WAAW,YAAY,mBAAmB;CACpD,IAAI,eAAe,
|
|
1
|
+
{"version":3,"file":"usePresence.native.js","names":[],"sources":["cjs/usePresence.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar usePresence_exports = {};\n__export(usePresence_exports, {\n isPresent: () => isPresent,\n useIsPresent: () => useIsPresent,\n usePresence: () => usePresence\n});\nmodule.exports = __toCommonJS(usePresence_exports);\nvar React = __toESM(require(\"react\"), 1);\nvar import_PresenceContext = require(\"./PresenceContext\");\nfunction usePresence(registration) {\n var context = React.useContext(import_PresenceContext.PresenceContext);\n var unregister = React.useRef(void 0);\n React.useEffect(function() {\n if (!unregister.current && context && (registration ? registration.shouldRegisterPresence : true)) {\n unregister.current = context.register(context.id);\n }\n });\n React.useEffect(function() {\n return function() {\n if (typeof unregister.current === \"function\") unregister.current();\n unregister.current = void 0;\n };\n }, []);\n if (!context) return [\n true,\n null,\n context\n ];\n var { id, isPresent: isPresent2, onExitComplete } = context;\n var safeToRemove = function safeToRemove2() {\n return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id);\n };\n return !isPresent2 && onExitComplete ? [\n false,\n safeToRemove,\n context\n ] : [\n true,\n void 0,\n context\n ];\n}\nfunction useIsPresent() {\n return isPresent(React.useContext(import_PresenceContext.PresenceContext));\n}\nfunction isPresent(context) {\n return context === null ? true : context.isPresent;\n}\n//# sourceMappingURL=usePresence.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAA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1B,OAAO,YAAY,OAAO,OAAO,QAAQ;AAC3C"}
|
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
|
|
4
4
|
var PresenceContext = /* @__PURE__ */ React.createContext(null);
|
|
5
|
-
var ResetPresence = function(props) {
|
|
5
|
+
var ResetPresence = function ResetPresence2(props) {
|
|
6
6
|
var parent = React.useContext(PresenceContext);
|
|
7
7
|
return /* @__PURE__ */ jsx(PresenceContext.Provider, {
|
|
8
8
|
value: props.disable ? parent : null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresenceContext.native.js","names":[],"sources":["esm/PresenceContext.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport * as React from \"react\";\nvar PresenceContext = /* @__PURE__ */ React.createContext(null);\nvar ResetPresence = function(props) {\n var parent = React.useContext(PresenceContext);\n return /* @__PURE__ */ _jsx(PresenceContext.Provider, {\n value: props.disable ? parent : null,\n children: props.children\n });\n};\nexport {\n PresenceContext,\n ResetPresence\n};\n//# sourceMappingURL=PresenceContext.js.map\n"],"mappings":";;;;AAEA,IAAI,kBAAkC,sBAAM,cAAc,IAAI;AAC9D,IAAI,gBAAgB,SAAS,OAAO;
|
|
1
|
+
{"version":3,"file":"PresenceContext.native.js","names":[],"sources":["esm/PresenceContext.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport * as React from \"react\";\nvar PresenceContext = /* @__PURE__ */ React.createContext(null);\nvar ResetPresence = function ResetPresence2(props) {\n var parent = React.useContext(PresenceContext);\n return /* @__PURE__ */ _jsx(PresenceContext.Provider, {\n value: props.disable ? parent : null,\n children: props.children\n });\n};\nexport {\n PresenceContext,\n ResetPresence\n};\n//# sourceMappingURL=PresenceContext.js.map\n"],"mappings":";;;;AAEA,IAAI,kBAAkC,sBAAM,cAAc,IAAI;AAC9D,IAAI,gBAAgB,SAAS,eAAe,OAAO;CACjD,IAAI,SAAS,MAAM,WAAW,eAAe;CAC7C,OAAuB,oBAAK,gBAAgB,UAAU;EACpD,OAAO,MAAM,UAAU,SAAS;EAChC,UAAU,MAAM;CAClB,CAAC;AACH"}
|
|
@@ -21,7 +21,7 @@ function usePresence(registration) {
|
|
|
21
21
|
context
|
|
22
22
|
];
|
|
23
23
|
var { id, isPresent: isPresent2, onExitComplete } = context;
|
|
24
|
-
var safeToRemove = function() {
|
|
24
|
+
var safeToRemove = function safeToRemove2() {
|
|
25
25
|
return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id);
|
|
26
26
|
};
|
|
27
27
|
return !isPresent2 && onExitComplete ? [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePresence.native.js","names":[],"sources":["esm/usePresence.native.js"],"sourcesContent":["import * as React from \"react\";\nimport { PresenceContext } from \"./PresenceContext\";\nfunction usePresence(registration) {\n var context = React.useContext(PresenceContext);\n var unregister = React.useRef(void 0);\n React.useEffect(function() {\n if (!unregister.current && context && (registration ? registration.shouldRegisterPresence : true)) {\n unregister.current = context.register(context.id);\n }\n });\n React.useEffect(function() {\n return function() {\n if (typeof unregister.current === \"function\") unregister.current();\n unregister.current = void 0;\n };\n }, []);\n if (!context) return [\n true,\n null,\n context\n ];\n var { id, isPresent: isPresent2, onExitComplete } = context;\n var safeToRemove = function() {\n return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id);\n };\n return !isPresent2 && onExitComplete ? [\n false,\n safeToRemove,\n context\n ] : [\n true,\n void 0,\n context\n ];\n}\nfunction useIsPresent() {\n return isPresent(React.useContext(PresenceContext));\n}\nfunction isPresent(context) {\n return context === null ? true : context.isPresent;\n}\nexport {\n isPresent,\n useIsPresent,\n usePresence\n};\n//# sourceMappingURL=usePresence.js.map\n"],"mappings":";;;;AAEA,SAAS,YAAY,cAAc;CACjC,IAAI,UAAU,MAAM,WAAW,eAAe;CAC9C,IAAI,aAAa,MAAM,OAAO,KAAK,CAAC;CACpC,MAAM,UAAU,WAAW;EACzB,IAAI,CAAC,WAAW,WAAW,YAAY,eAAe,aAAa,yBAAyB,OAAO;GACjG,WAAW,UAAU,QAAQ,SAAS,QAAQ,EAAE;EAClD;CACF,CAAC;CACD,MAAM,UAAU,WAAW;EACzB,OAAO,WAAW;GAChB,IAAI,OAAO,WAAW,YAAY,YAAY,WAAW,QAAQ;GACjE,WAAW,UAAU,KAAK;EAC5B;CACF,GAAG,CAAC,CAAC;CACL,IAAI,CAAC,SAAS,OAAO;EACnB;EACA;EACA;CACF;CACA,IAAI,EAAE,IAAI,WAAW,YAAY,mBAAmB;CACpD,IAAI,eAAe,
|
|
1
|
+
{"version":3,"file":"usePresence.native.js","names":[],"sources":["esm/usePresence.native.js"],"sourcesContent":["import * as React from \"react\";\nimport { PresenceContext } from \"./PresenceContext\";\nfunction usePresence(registration) {\n var context = React.useContext(PresenceContext);\n var unregister = React.useRef(void 0);\n React.useEffect(function() {\n if (!unregister.current && context && (registration ? registration.shouldRegisterPresence : true)) {\n unregister.current = context.register(context.id);\n }\n });\n React.useEffect(function() {\n return function() {\n if (typeof unregister.current === \"function\") unregister.current();\n unregister.current = void 0;\n };\n }, []);\n if (!context) return [\n true,\n null,\n context\n ];\n var { id, isPresent: isPresent2, onExitComplete } = context;\n var safeToRemove = function safeToRemove2() {\n return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id);\n };\n return !isPresent2 && onExitComplete ? [\n false,\n safeToRemove,\n context\n ] : [\n true,\n void 0,\n context\n ];\n}\nfunction useIsPresent() {\n return isPresent(React.useContext(PresenceContext));\n}\nfunction isPresent(context) {\n return context === null ? true : context.isPresent;\n}\nexport {\n isPresent,\n useIsPresent,\n usePresence\n};\n//# sourceMappingURL=usePresence.js.map\n"],"mappings":";;;;AAEA,SAAS,YAAY,cAAc;CACjC,IAAI,UAAU,MAAM,WAAW,eAAe;CAC9C,IAAI,aAAa,MAAM,OAAO,KAAK,CAAC;CACpC,MAAM,UAAU,WAAW;EACzB,IAAI,CAAC,WAAW,WAAW,YAAY,eAAe,aAAa,yBAAyB,OAAO;GACjG,WAAW,UAAU,QAAQ,SAAS,QAAQ,EAAE;EAClD;CACF,CAAC;CACD,MAAM,UAAU,WAAW;EACzB,OAAO,WAAW;GAChB,IAAI,OAAO,WAAW,YAAY,YAAY,WAAW,QAAQ;GACjE,WAAW,UAAU,KAAK;EAC5B;CACF,GAAG,CAAC,CAAC;CACL,IAAI,CAAC,SAAS,OAAO;EACnB;EACA;EACA;CACF;CACA,IAAI,EAAE,IAAI,WAAW,YAAY,mBAAmB;CACpD,IAAI,eAAe,SAAS,gBAAgB;EAC1C,OAAO,mBAAmB,QAAQ,mBAAmB,KAAK,IAAI,KAAK,IAAI,eAAe,EAAE;CAC1F;CACA,OAAO,CAAC,cAAc,iBAAiB;EACrC;EACA;EACA;CACF,IAAI;EACF;EACA,KAAK;EACL;CACF;AACF;AACA,SAAS,eAAe;CACtB,OAAO,UAAU,MAAM,WAAW,eAAe,CAAC;AACpD;AACA,SAAS,UAAU,SAAS;CAC1B,OAAO,YAAY,OAAO,OAAO,QAAQ;AAC3C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-presence",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"clean:build": "tamagui-build clean:build"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@tamagui/web": "3.0.
|
|
37
|
+
"@tamagui/web": "3.0.8"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@tamagui/build": "3.0.
|
|
40
|
+
"@tamagui/build": "3.0.8",
|
|
41
41
|
"react": "19.2.3"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"url": "git+https://github.com/tamagui/tamagui.git",
|
|
49
49
|
"directory": "code/core/use-presence"
|
|
50
50
|
},
|
|
51
|
-
"releaseSourceCommit": "
|
|
51
|
+
"releaseSourceCommit": "b723356193510591d9ad15877b8937e8e6a31910"
|
|
52
52
|
}
|