@tamagui/toast 1.110.4 → 1.111.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/Toast.native.js +20 -121
- package/dist/cjs/Toast.native.js.map +2 -2
- package/dist/cjs/ToastAnnounce.native.js +10 -107
- package/dist/cjs/ToastAnnounce.native.js.map +2 -2
- package/dist/cjs/ToastImperative.native.js +10 -87
- package/dist/cjs/ToastImperative.native.js.map +2 -2
- package/dist/cjs/ToastImpl.native.js +31 -150
- package/dist/cjs/ToastImpl.native.js.map +2 -2
- package/dist/cjs/ToastPortal.native.js +1 -1
- package/dist/cjs/ToastPortal.native.js.map +1 -1
- package/dist/cjs/ToastProvider.native.js +13 -85
- package/dist/cjs/ToastProvider.native.js.map +2 -2
- package/dist/cjs/ToastViewport.native.js +20 -107
- package/dist/cjs/ToastViewport.native.js.map +1 -1
- package/dist/cjs/createNativeToast.native.js +5 -23
- package/dist/cjs/createNativeToast.native.js.map +1 -1
- package/dist/esm/Toast.native.js +19 -119
- package/dist/esm/Toast.native.js.map +2 -2
- package/dist/esm/Toast.native.mjs +130 -0
- package/dist/esm/Toast.native.mjs.map +1 -0
- package/dist/esm/ToastAnnounce.native.js +9 -105
- package/dist/esm/ToastAnnounce.native.js.map +2 -2
- package/dist/esm/ToastAnnounce.native.mjs +68 -0
- package/dist/esm/ToastAnnounce.native.mjs.map +1 -0
- package/dist/esm/ToastImperative.native.js +12 -88
- package/dist/esm/ToastImperative.native.js.map +2 -2
- package/dist/esm/ToastImperative.native.mjs +71 -0
- package/dist/esm/ToastImperative.native.mjs.map +1 -0
- package/dist/esm/ToastImpl.native.js +38 -156
- package/dist/esm/ToastImpl.native.js.map +2 -2
- package/dist/esm/ToastImpl.native.mjs +285 -0
- package/dist/esm/ToastImpl.native.mjs.map +1 -0
- package/dist/esm/ToastPortal.native.js +1 -1
- package/dist/esm/ToastPortal.native.js.map +1 -1
- package/dist/esm/ToastPortal.native.mjs +20 -0
- package/dist/esm/ToastPortal.native.mjs.map +1 -0
- package/dist/esm/ToastProvider.native.js +13 -84
- package/dist/esm/ToastProvider.native.js.map +2 -2
- package/dist/esm/ToastProvider.native.mjs +116 -0
- package/dist/esm/ToastProvider.native.mjs.map +1 -0
- package/dist/esm/ToastViewport.native.js +20 -106
- package/dist/esm/ToastViewport.native.js.map +1 -1
- package/dist/esm/ToastViewport.native.mjs +275 -0
- package/dist/esm/ToastViewport.native.mjs.map +1 -0
- package/dist/esm/constants.native.mjs +4 -0
- package/dist/esm/constants.native.mjs.map +1 -0
- package/dist/esm/createNativeToast.native.js +5 -23
- package/dist/esm/createNativeToast.native.js.map +1 -1
- package/dist/esm/createNativeToast.native.mjs +20 -0
- package/dist/esm/createNativeToast.native.mjs.map +1 -0
- package/dist/esm/index.native.mjs +2 -0
- package/dist/esm/index.native.mjs.map +1 -0
- package/dist/esm/types.native.mjs +2 -0
- package/dist/esm/types.native.mjs.map +1 -0
- package/dist/jsx/Toast.native.js +19 -119
- package/dist/jsx/Toast.native.js.map +2 -2
- package/dist/jsx/ToastAnnounce.native.js +9 -105
- package/dist/jsx/ToastAnnounce.native.js.map +2 -2
- package/dist/jsx/ToastImperative.native.js +9 -85
- package/dist/jsx/ToastImperative.native.js.map +2 -2
- package/dist/jsx/ToastImpl.native.js +30 -148
- package/dist/jsx/ToastImpl.native.js.map +2 -2
- package/dist/jsx/ToastPortal.native.js +1 -1
- package/dist/jsx/ToastPortal.native.js.map +1 -1
- package/dist/jsx/ToastProvider.native.js +13 -84
- package/dist/jsx/ToastProvider.native.js.map +2 -2
- package/dist/jsx/ToastViewport.native.js +19 -105
- package/dist/jsx/ToastViewport.native.js.map +1 -1
- package/dist/jsx/createNativeToast.native.js +5 -23
- package/dist/jsx/createNativeToast.native.js.map +1 -1
- package/package.json +16 -16
package/dist/cjs/Toast.native.js
CHANGED
|
@@ -31,100 +31,7 @@ __export(Toast_exports, {
|
|
|
31
31
|
useToastState: () => import_ToastImperative.useToastState
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(Toast_exports);
|
|
34
|
-
var import_jsx_runtime = require("react/jsx-runtime"), import_core = require("@tamagui/core"), import_helpers = require("@tamagui/helpers"), import_stacks = require("@tamagui/stacks"), import_text = require("@tamagui/text"), import_use_controllable_state = require("@tamagui/use-controllable-state"), React = __toESM(require("react")), import_constants = require("./constants"), import_ToastAnnounce = require("./ToastAnnounce"), import_ToastImperative = require("./ToastImperative"), import_ToastImpl = require("./ToastImpl"), import_ToastProvider = require("./ToastProvider"), import_ToastViewport = require("./ToastViewport")
|
|
35
|
-
function _array_like_to_array(arr, len) {
|
|
36
|
-
(len == null || len > arr.length) && (len = arr.length);
|
|
37
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
38
|
-
return arr2;
|
|
39
|
-
}
|
|
40
|
-
function _array_with_holes(arr) {
|
|
41
|
-
if (Array.isArray(arr)) return arr;
|
|
42
|
-
}
|
|
43
|
-
function _define_property(obj, key, value) {
|
|
44
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
45
|
-
value,
|
|
46
|
-
enumerable: !0,
|
|
47
|
-
configurable: !0,
|
|
48
|
-
writable: !0
|
|
49
|
-
}) : obj[key] = value, obj;
|
|
50
|
-
}
|
|
51
|
-
function _iterable_to_array_limit(arr, i) {
|
|
52
|
-
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
53
|
-
if (_i != null) {
|
|
54
|
-
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
55
|
-
try {
|
|
56
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
57
|
-
;
|
|
58
|
-
} catch (err) {
|
|
59
|
-
_d = !0, _e = err;
|
|
60
|
-
} finally {
|
|
61
|
-
try {
|
|
62
|
-
!_n && _i.return != null && _i.return();
|
|
63
|
-
} finally {
|
|
64
|
-
if (_d) throw _e;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return _arr;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function _non_iterable_rest() {
|
|
71
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
72
|
-
}
|
|
73
|
-
function _object_spread(target) {
|
|
74
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
75
|
-
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
76
|
-
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
77
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
78
|
-
}))), ownKeys2.forEach(function(key) {
|
|
79
|
-
_define_property(target, key, source[key]);
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
return target;
|
|
83
|
-
}
|
|
84
|
-
function ownKeys(object, enumerableOnly) {
|
|
85
|
-
var keys = Object.keys(object);
|
|
86
|
-
if (Object.getOwnPropertySymbols) {
|
|
87
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
88
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
89
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
90
|
-
})), keys.push.apply(keys, symbols);
|
|
91
|
-
}
|
|
92
|
-
return keys;
|
|
93
|
-
}
|
|
94
|
-
function _object_spread_props(target, source) {
|
|
95
|
-
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
96
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
97
|
-
}), target;
|
|
98
|
-
}
|
|
99
|
-
function _object_without_properties(source, excluded) {
|
|
100
|
-
if (source == null) return {};
|
|
101
|
-
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
102
|
-
if (Object.getOwnPropertySymbols) {
|
|
103
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
104
|
-
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
105
|
-
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
106
|
-
}
|
|
107
|
-
return target;
|
|
108
|
-
}
|
|
109
|
-
function _object_without_properties_loose(source, excluded) {
|
|
110
|
-
if (source == null) return {};
|
|
111
|
-
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
112
|
-
for (i = 0; i < sourceKeys.length; i++)
|
|
113
|
-
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
114
|
-
return target;
|
|
115
|
-
}
|
|
116
|
-
function _sliced_to_array(arr, i) {
|
|
117
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
118
|
-
}
|
|
119
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
120
|
-
if (o) {
|
|
121
|
-
if (typeof o == "string") return _array_like_to_array(o, minLen);
|
|
122
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
123
|
-
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set") return Array.from(n);
|
|
124
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
var TITLE_NAME = "ToastTitle", ToastTitle = (0, import_core.styled)(import_text.SizableText, {
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_core = require("@tamagui/core"), import_helpers = require("@tamagui/helpers"), import_stacks = require("@tamagui/stacks"), import_text = require("@tamagui/text"), import_use_controllable_state = require("@tamagui/use-controllable-state"), React = __toESM(require("react")), import_constants = require("./constants"), import_ToastAnnounce = require("./ToastAnnounce"), import_ToastImperative = require("./ToastImperative"), import_ToastImpl = require("./ToastImpl"), import_ToastProvider = require("./ToastProvider"), import_ToastViewport = require("./ToastViewport"), TITLE_NAME = "ToastTitle", ToastTitle = (0, import_core.styled)(import_text.SizableText, {
|
|
128
35
|
name: TITLE_NAME,
|
|
129
36
|
variants: {
|
|
130
37
|
unstyled: {
|
|
@@ -155,20 +62,19 @@ var DESCRIPTION_NAME = "ToastDescription", ToastDescription = (0, import_core.st
|
|
|
155
62
|
});
|
|
156
63
|
ToastDescription.displayName = DESCRIPTION_NAME;
|
|
157
64
|
var ACTION_NAME = "ToastAction", ToastAction = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {
|
|
158
|
-
var
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
return altText2 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ToastAnnounce.ToastAnnounceExclude, {
|
|
162
|
-
altText: altText2,
|
|
65
|
+
var { altText, ...actionProps } = props;
|
|
66
|
+
return altText ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ToastAnnounce.ToastAnnounceExclude, {
|
|
67
|
+
altText,
|
|
163
68
|
asChild: !0,
|
|
164
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToastClose,
|
|
69
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToastClose, {
|
|
70
|
+
...actionProps,
|
|
165
71
|
ref: forwardedRef
|
|
166
|
-
})
|
|
72
|
+
})
|
|
167
73
|
}) : null;
|
|
168
74
|
});
|
|
169
75
|
ToastAction.propTypes = {
|
|
170
|
-
altText
|
|
171
|
-
return props.altText ? null : new Error(
|
|
76
|
+
altText(props) {
|
|
77
|
+
return props.altText ? null : new Error(`Missing prop \`altText\` expected on \`${ACTION_NAME}\``);
|
|
172
78
|
}
|
|
173
79
|
};
|
|
174
80
|
ToastAction.displayName = ACTION_NAME;
|
|
@@ -176,36 +82,29 @@ var CLOSE_NAME = "ToastClose", ToastCloseFrame = (0, import_core.styled)(import_
|
|
|
176
82
|
name: CLOSE_NAME,
|
|
177
83
|
tag: "button"
|
|
178
84
|
}), ToastClose = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {
|
|
179
|
-
var __scopeToast = props
|
|
180
|
-
"__scopeToast"
|
|
181
|
-
]), interactiveContext = (0, import_ToastImpl.useToastInteractiveContext)(__scopeToast);
|
|
85
|
+
var { __scopeToast, ...closeProps } = props, interactiveContext = (0, import_ToastImpl.useToastInteractiveContext)(__scopeToast);
|
|
182
86
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ToastAnnounce.ToastAnnounceExclude, {
|
|
183
87
|
asChild: !0,
|
|
184
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToastCloseFrame,
|
|
185
|
-
accessibilityLabel: "Dialog Close"
|
|
186
|
-
|
|
88
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToastCloseFrame, {
|
|
89
|
+
accessibilityLabel: "Dialog Close",
|
|
90
|
+
...closeProps,
|
|
187
91
|
ref: forwardedRef,
|
|
188
92
|
onPress: (0, import_helpers.composeEventHandlers)(props.onPress, interactiveContext.onClose)
|
|
189
|
-
})
|
|
93
|
+
})
|
|
190
94
|
});
|
|
191
95
|
});
|
|
192
96
|
ToastClose.displayName = CLOSE_NAME;
|
|
193
97
|
var ToastComponent = import_ToastImpl.ToastImplFrame.styleable(function(props, forwardedRef) {
|
|
194
|
-
var
|
|
195
|
-
"forceMount",
|
|
196
|
-
"open",
|
|
197
|
-
"defaultOpen",
|
|
198
|
-
"onOpenChange"
|
|
199
|
-
]), _useControllableState = _sliced_to_array((0, import_use_controllable_state.useControllableState)({
|
|
98
|
+
var { forceMount, open: openProp, defaultOpen, onOpenChange, ...toastProps } = props, [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
200
99
|
prop: openProp,
|
|
201
100
|
defaultProp: defaultOpen ?? !0,
|
|
202
101
|
onChange: onOpenChange,
|
|
203
102
|
strategy: "most-recent-wins"
|
|
204
|
-
}),
|
|
205
|
-
return shouldShow ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ToastImpl.ToastImpl,
|
|
103
|
+
}), id = React.useId(), onPause = (0, import_core.useEvent)(props.onPause), onResume = (0, import_core.useEvent)(props.onResume), shouldShow = forceMount || open;
|
|
104
|
+
return shouldShow ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ToastImpl.ToastImpl, {
|
|
206
105
|
id,
|
|
207
|
-
open
|
|
208
|
-
|
|
106
|
+
open,
|
|
107
|
+
...toastProps,
|
|
209
108
|
ref: forwardedRef,
|
|
210
109
|
onClose: function() {
|
|
211
110
|
return setOpen(!1);
|
|
@@ -215,7 +114,7 @@ var ToastComponent = import_ToastImpl.ToastImplFrame.styleable(function(props, f
|
|
|
215
114
|
onSwipeEnd: (0, import_helpers.composeEventHandlers)(props.onSwipeEnd, function(event) {
|
|
216
115
|
setOpen(!1);
|
|
217
116
|
})
|
|
218
|
-
})
|
|
117
|
+
}) : null;
|
|
219
118
|
});
|
|
220
119
|
ToastComponent.displayName = import_constants.TOAST_NAME;
|
|
221
120
|
var Toast = (0, import_helpers.withStaticProperties)(ToastComponent, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/ui/toast/src/Toast.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDACA,cAAiC,0BACjC,iBAA2D,6BAC3D,gBAA+B,4BAC/B,cAA4B,0BAC5B,gCAAqC,4CACrC,QAAuB,2BAEvB,mBAA2B,wBAC3B,uBAAqC,4BAErC,yBAA4D,8BAE5D,mBAAsE,wBAEtE,uBAA8B,4BAE9B,uBAA8B
|
|
5
|
-
"names": ["TITLE_NAME", "ToastTitle", "styled", "SizableText", "name", "variants", "unstyled", "false", "color", "size", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "displayName", "DESCRIPTION_NAME", "ToastDescription", "ACTION_NAME", "ToastAction", "React", "forwardRef", "props", "forwardedRef", "altText", "actionProps", "_jsx", "ToastAnnounceExclude", "asChild", "ToastClose", "ref", "propTypes", "Error", "CLOSE_NAME", "ToastCloseFrame", "ThemeableStack", "tag", "__scopeToast", "closeProps", "interactiveContext", "useToastInteractiveContext", "accessibilityLabel", "onPress", "composeEventHandlers", "onClose", "ToastComponent", "ToastImplFrame", "styleable", "forceMount", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDACA,cAAiC,0BACjC,iBAA2D,6BAC3D,gBAA+B,4BAC/B,cAA4B,0BAC5B,gCAAqC,4CACrC,QAAuB,2BAEvB,mBAA2B,wBAC3B,uBAAqC,4BAErC,yBAA4D,8BAE5D,mBAAsE,wBAEtE,uBAA8B,4BAE9B,uBAA8B,4BAMxBA,aAAa,cAEbC,iBAAaC,oBAAOC,yBAAa;EACrCC,MAAMJ;EAENK,UAAU;IACRC,UAAU;MACRC,OAAO;QACLC,OAAO;QACPC,MAAM;MACR;IACF;EACF;EAEAC,iBAAiB;IACfJ,UAAUK,QAAQC,IAAIC,qBAAqB;EAC7C;AACF,CAAA;AAIAZ,WAAWa,cAAcd;AAMzB,IAAMe,mBAAmB,oBAEnBC,uBAAmBd,oBAAOC,yBAAa;EAC3CC,MAAMW;EAENV,UAAU;IACRC,UAAU;MACRC,OAAO;QACLC,OAAO;QACPC,MAAM;MACR;IACF;EACF;EAEAC,iBAAiB;IACfJ,UAAUK,QAAQC,IAAIC,qBAAqB;EAC7C;AACF,CAAA;AAIAG,iBAAiBF,cAAcC;AAM/B,IAAME,cAAc,eAYdC,cAAcC,sBAAMC,WACxB,SAACC,OAAsCC,cAAAA;AACrC,MAAM,EAAEC,SAAS,GAAGC,YAAAA,IAAgBH;AACpC,SAAKE,UAEH,uCAAAE,KAACC,2CAAAA;IAAqBH;IAAkBI,SAAO;cAC7C,uCAAAF,KAACG,YAAAA;MAAY,GAAGJ;MAAaK,KAAKP;;OAHjB;AAMvB,CAAA;AAGFJ,YAAYY,YAAY;EACtBP,QAAQF,OAAK;AACX,WAAKA,MAAME,UAGJ,OAFE,IAAIQ,MAAM,0CAA0Cd,WAAAA,IAAe;EAG9E;AACF;AAEAC,YAAYJ,cAAcG;AAM1B,IAAMe,aAAa,cAEbC,sBAAkB/B,oBAAOgC,8BAAgB;EAC7C9B,MAAM4B;EACNG,KAAK;AACP,CAAA,GAKMP,aAAaT,sBAAMC,WACvB,SAACC,OAAqCC,cAAAA;AACpC,MAAM,EAAEc,cAAc,GAAGC,WAAAA,IAAehB,OAClCiB,yBAAqBC,6CAA2BH,YAAAA;AAEtD,SACE,uCAAAX,KAACC,2CAAAA;IAAqBC,SAAO;cAC3B,uCAAAF,KAACQ,iBAAAA;MACCO,oBAAmB;MAClB,GAAGH;MACJR,KAAKP;MACLmB,aAASC,qCAAqBrB,MAAMoB,SAAgBH,mBAAmBK,OAAO;;;AAItF,CAAA;AAGFf,WAAWd,cAAckB;AAMzB,IAAMY,iBAAiBC,gCAAeC,UACpC,SAACzB,OAAOC,cAAAA;AACN,MAAM,EAAEyB,YAAYC,MAAMC,UAAUC,aAAaC,cAAc,GAAGC,WAAAA,IAAe/B,OAC3E,CAAC2B,MAAMK,OAAAA,QAAWC,oDAAqB;IAC3CC,MAAMN;IACNO,aAAaN,eAAe;IAC5BO,UAAUN;IACVO,UAAU;EACZ,CAAA,GAEMC,KAAKxC,MAAMyC,MAAK,GAChBC,cAAUC,sBAASzC,MAAMwC,OAAO,GAChCE,eAAWD,sBAASzC,MAAM0C,QAAQ,GAClCC,aAAajB,cAAcC;AAEjC,SAAKgB,aAGH,uCAAAvC,KAACwC,4BAAAA;IACCN;IACAX;IACC,GAAGI;IACJvB,KAAKP;IACLqB,SAAS,WAAA;aAAMU,QAAQ,EAAA;;IACvBQ;IACAE;IACAG,gBAAYxB,qCAAqBrB,MAAM6C,YAAY,SAACC,OAAAA;AAClDd,cAAQ,EAAA;IACV,CAAA;OAboB;AAgB1B,CAAA;AAGFT,eAAe9B,cAAcsD;AAE7B,IAAMC,YAAQC,qCAAqB1B,gBAAgB;EACjD2B,OAAOtE;EACPuE,aAAaxD;EACbyD,QAAQvD;EACRwD,OAAO9C;AACT,CAAA;",
|
|
5
|
+
"names": ["TITLE_NAME", "ToastTitle", "styled", "SizableText", "name", "variants", "unstyled", "false", "color", "size", "defaultVariants", "process", "env", "TAMAGUI_HEADLESS", "displayName", "DESCRIPTION_NAME", "ToastDescription", "ACTION_NAME", "ToastAction", "React", "forwardRef", "props", "forwardedRef", "altText", "actionProps", "_jsx", "ToastAnnounceExclude", "asChild", "ToastClose", "ref", "propTypes", "Error", "CLOSE_NAME", "ToastCloseFrame", "ThemeableStack", "tag", "__scopeToast", "closeProps", "interactiveContext", "useToastInteractiveContext", "accessibilityLabel", "onPress", "composeEventHandlers", "onClose", "ToastComponent", "ToastImplFrame", "styleable", "forceMount", "open", "openProp", "defaultOpen", "onOpenChange", "toastProps", "setOpen", "useControllableState", "prop", "defaultProp", "onChange", "strategy", "id", "useId", "onPause", "useEvent", "onResume", "shouldShow", "ToastImpl", "onSwipeEnd", "event", "TOAST_NAME", "Toast", "withStaticProperties", "Title", "Description", "Action", "Close"]
|
|
6
6
|
}
|
|
@@ -27,116 +27,18 @@ __export(ToastAnnounce_exports, {
|
|
|
27
27
|
ToastAnnounceExclude: () => ToastAnnounceExclude
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(ToastAnnounce_exports);
|
|
30
|
-
var import_jsx_runtime = require("react/jsx-runtime"), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_start_transition = require("@tamagui/start-transition"), import_portal = require("@tamagui/portal"), import_visually_hidden = require("@tamagui/visually-hidden"), React = __toESM(require("react")), import_ToastProvider = require("./ToastProvider")
|
|
31
|
-
function _array_like_to_array(arr, len) {
|
|
32
|
-
(len == null || len > arr.length) && (len = arr.length);
|
|
33
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
34
|
-
return arr2;
|
|
35
|
-
}
|
|
36
|
-
function _array_with_holes(arr) {
|
|
37
|
-
if (Array.isArray(arr)) return arr;
|
|
38
|
-
}
|
|
39
|
-
function _define_property(obj, key, value) {
|
|
40
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
41
|
-
value,
|
|
42
|
-
enumerable: !0,
|
|
43
|
-
configurable: !0,
|
|
44
|
-
writable: !0
|
|
45
|
-
}) : obj[key] = value, obj;
|
|
46
|
-
}
|
|
47
|
-
function _iterable_to_array_limit(arr, i) {
|
|
48
|
-
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
49
|
-
if (_i != null) {
|
|
50
|
-
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
51
|
-
try {
|
|
52
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
53
|
-
;
|
|
54
|
-
} catch (err) {
|
|
55
|
-
_d = !0, _e = err;
|
|
56
|
-
} finally {
|
|
57
|
-
try {
|
|
58
|
-
!_n && _i.return != null && _i.return();
|
|
59
|
-
} finally {
|
|
60
|
-
if (_d) throw _e;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return _arr;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function _non_iterable_rest() {
|
|
67
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
68
|
-
}
|
|
69
|
-
function _object_spread(target) {
|
|
70
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
71
|
-
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
72
|
-
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
73
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
74
|
-
}))), ownKeys2.forEach(function(key) {
|
|
75
|
-
_define_property(target, key, source[key]);
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
return target;
|
|
79
|
-
}
|
|
80
|
-
function ownKeys(object, enumerableOnly) {
|
|
81
|
-
var keys = Object.keys(object);
|
|
82
|
-
if (Object.getOwnPropertySymbols) {
|
|
83
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
84
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
85
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
86
|
-
})), keys.push.apply(keys, symbols);
|
|
87
|
-
}
|
|
88
|
-
return keys;
|
|
89
|
-
}
|
|
90
|
-
function _object_spread_props(target, source) {
|
|
91
|
-
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
92
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
93
|
-
}), target;
|
|
94
|
-
}
|
|
95
|
-
function _object_without_properties(source, excluded) {
|
|
96
|
-
if (source == null) return {};
|
|
97
|
-
var target = _object_without_properties_loose(source, excluded), key, i;
|
|
98
|
-
if (Object.getOwnPropertySymbols) {
|
|
99
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
100
|
-
for (i = 0; i < sourceSymbolKeys.length; i++)
|
|
101
|
-
key = sourceSymbolKeys[i], !(excluded.indexOf(key) >= 0) && Object.prototype.propertyIsEnumerable.call(source, key) && (target[key] = source[key]);
|
|
102
|
-
}
|
|
103
|
-
return target;
|
|
104
|
-
}
|
|
105
|
-
function _object_without_properties_loose(source, excluded) {
|
|
106
|
-
if (source == null) return {};
|
|
107
|
-
var target = {}, sourceKeys = Object.keys(source), key, i;
|
|
108
|
-
for (i = 0; i < sourceKeys.length; i++)
|
|
109
|
-
key = sourceKeys[i], !(excluded.indexOf(key) >= 0) && (target[key] = source[key]);
|
|
110
|
-
return target;
|
|
111
|
-
}
|
|
112
|
-
function _sliced_to_array(arr, i) {
|
|
113
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
114
|
-
}
|
|
115
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
116
|
-
if (o) {
|
|
117
|
-
if (typeof o == "string") return _array_like_to_array(o, minLen);
|
|
118
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
119
|
-
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set") return Array.from(n);
|
|
120
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
var ToastAnnounceExcludeFrame = (0, import_core.styled)(import_core.Stack, {
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_start_transition = require("@tamagui/start-transition"), import_portal = require("@tamagui/portal"), import_visually_hidden = require("@tamagui/visually-hidden"), React = __toESM(require("react")), import_ToastProvider = require("./ToastProvider"), ToastAnnounceExcludeFrame = (0, import_core.styled)(import_core.Stack, {
|
|
124
31
|
name: "ToastAnnounceExclude"
|
|
125
32
|
}), ToastAnnounceExclude = /* @__PURE__ */ React.forwardRef(function(props, forwardedRef) {
|
|
126
|
-
var
|
|
127
|
-
|
|
128
|
-
]);
|
|
129
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToastAnnounceExcludeFrame, _object_spread_props(_object_spread({
|
|
33
|
+
var { altText, ...announceExcludeProps } = props;
|
|
34
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToastAnnounceExcludeFrame, {
|
|
130
35
|
"data-toast-announce-exclude": "",
|
|
131
|
-
"data-toast-announce-alt": altText || void 0
|
|
132
|
-
|
|
36
|
+
"data-toast-announce-alt": altText || void 0,
|
|
37
|
+
...announceExcludeProps,
|
|
133
38
|
ref: forwardedRef
|
|
134
|
-
})
|
|
39
|
+
});
|
|
135
40
|
}), ToastAnnounce = function(props) {
|
|
136
|
-
var __scopeToast = props
|
|
137
|
-
"__scopeToast",
|
|
138
|
-
"children"
|
|
139
|
-
]), context = (0, import_ToastProvider.useToastProviderContext)(__scopeToast), _React_useState = _sliced_to_array(React.useState(!1), 2), renderAnnounceText = _React_useState[0], setRenderAnnounceText = _React_useState[1], _React_useState1 = _sliced_to_array(React.useState(!1), 2), isAnnounced = _React_useState1[0], setIsAnnounced = _React_useState1[1];
|
|
41
|
+
var { __scopeToast, children, ...announceProps } = props, context = (0, import_ToastProvider.useToastProviderContext)(__scopeToast), [renderAnnounceText, setRenderAnnounceText] = React.useState(!1), [isAnnounced, setIsAnnounced] = React.useState(!1);
|
|
140
42
|
return useNextFrame(function() {
|
|
141
43
|
(0, import_start_transition.startTransition)(function() {
|
|
142
44
|
setRenderAnnounceText(!0);
|
|
@@ -150,7 +52,8 @@ var ToastAnnounceExcludeFrame = (0, import_core.styled)(import_core.Stack, {
|
|
|
150
52
|
};
|
|
151
53
|
}, []), isAnnounced ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.Portal, {
|
|
152
54
|
asChild: !0,
|
|
153
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_visually_hidden.VisuallyHidden,
|
|
55
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_visually_hidden.VisuallyHidden, {
|
|
56
|
+
...announceProps,
|
|
154
57
|
children: renderAnnounceText && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.Text, {
|
|
155
58
|
children: [
|
|
156
59
|
context.label,
|
|
@@ -158,7 +61,7 @@ var ToastAnnounceExcludeFrame = (0, import_core.styled)(import_core.Stack, {
|
|
|
158
61
|
children
|
|
159
62
|
]
|
|
160
63
|
})
|
|
161
|
-
})
|
|
64
|
+
})
|
|
162
65
|
});
|
|
163
66
|
};
|
|
164
67
|
function useNextFrame() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/ui/toast/src/ToastAnnounce.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,mBAA0C,+BAE1C,cAA8C,0BAC9C,0BAAgC,sCAChC,gBAAuB,4BACvB,yBAA+B,qCAC/B,QAAuB,2BAGvB,uBAAwC
|
|
5
|
-
"names": ["ToastAnnounceExcludeFrame", "styled", "Stack", "name", "ToastAnnounceExclude", "React", "forwardRef", "props", "forwardedRef", "altText", "announceExcludeProps", "_jsx", "data-toast-announce-exclude", "data-toast-announce-alt", "undefined", "ref", "ToastAnnounce", "__scopeToast", "children", "announceProps", "context", "useToastProviderContext", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,mBAA0C,+BAE1C,cAA8C,0BAC9C,0BAAgC,sCAChC,gBAAuB,4BACvB,yBAA+B,qCAC/B,QAAuB,2BAGvB,uBAAwC,4BAElCA,gCAA4BC,oBAAOC,mBAAO;EAC9CC,MAAM;AACR,CAAA,GAMMC,uBAAuBC,sBAAMC,WAGjC,SAACC,OAA+CC,cAAAA;AAChD,MAAM,EAAEC,SAAS,GAAGC,qBAAAA,IAAyBH;AAE7C,SACE,uCAAAI,KAACX,2BAAAA;IACCY,+BAA4B;IAC5BC,2BAAyBJ,WAAWK;IACnC,GAAGJ;IACJK,KAAKP;;AAGX,CAAA,GAQMQ,gBAA2D,SAC/DT,OAAAA;AAEA,MAAM,EAAEU,cAAcC,UAAU,GAAGC,cAAAA,IAAkBZ,OAC/Ca,cAAUC,8CAAwBJ,YAAAA,GAClC,CAACK,oBAAoBC,qBAAAA,IAAyBlB,MAAMmB,SAAS,EAAA,GAC7D,CAACC,aAAaC,cAAAA,IAAkBrB,MAAMmB,SAAS,EAAA;AAGrDG,sBAAa,WAAA;AACXC,iDAAgB,WAAA;AACdL,4BAAsB,EAAA;IACxB,CAAA;EACF,CAAA,GAGAlB,MAAMwB,UAAU,WAAA;AACd,QAAMC,QAAQC,WAAW,WAAA;aAAML,eAAe,EAAA;OAAO,GAAA;AACrD,WAAO,WAAA;aAAMM,aAAaF,KAAAA;;EAC5B,GAAG,CAAA,CAAE,GAEEL,cAAc,OACnB,uCAAAd,KAACsB,sBAAAA;IAAOC,SAAO;cACb,uCAAAvB,KAACwB,uCAAAA;MAAgB,GAAGhB;gBACjBG,sBACC,uCAAAc,MAACC,kBAAAA;;UACEjB,QAAQkB;UAAM;UAAEpB;;;;;AAM7B;AAIA,SAASS,eAAAA;MAAaY,WAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAW,WAAA;EAAO,GAChCC,SAAKC,sBAASF,QAAAA;AACpBG,kDAA0B,WAAA;AACxB,QAAIC,OAAO,GACPC,OAAO;AACXD,kBAAOE,sBAAsB,WAAA;AAC3BD,aAAOC,sBAAsBL,EAAAA;IAC/B,CAAA,GACO,WAAA;AACLM,2BAAqBH,IAAAA,GACrBG,qBAAqBF,IAAAA;IACvB;EACF,GAAG;IAACJ;GAAG;AACT;",
|
|
5
|
+
"names": ["ToastAnnounceExcludeFrame", "styled", "Stack", "name", "ToastAnnounceExclude", "React", "forwardRef", "props", "forwardedRef", "altText", "announceExcludeProps", "_jsx", "data-toast-announce-exclude", "data-toast-announce-alt", "undefined", "ref", "ToastAnnounce", "__scopeToast", "children", "announceProps", "context", "useToastProviderContext", "renderAnnounceText", "setRenderAnnounceText", "useState", "isAnnounced", "setIsAnnounced", "useNextFrame", "startTransition", "useEffect", "timer", "setTimeout", "clearTimeout", "Portal", "asChild", "VisuallyHidden", "_jsxs", "Text", "label", "callback", "fn", "useEvent", "useIsomorphicLayoutEffect", "raf1", "raf2", "requestAnimationFrame", "cancelAnimationFrame"]
|
|
6
6
|
}
|
|
@@ -29,109 +29,32 @@ __export(ToastImperative_exports, {
|
|
|
29
29
|
useToastState: () => useToastState
|
|
30
30
|
});
|
|
31
31
|
module.exports = __toCommonJS(ToastImperative_exports);
|
|
32
|
-
var import_jsx_runtime = require("react/jsx-runtime"), import_react = __toESM(require("react")), import_core = require("@tamagui/core"), import_react_native = require("react-native"), import_createNativeToast = require("./createNativeToast")
|
|
33
|
-
function _array_like_to_array(arr, len) {
|
|
34
|
-
(len == null || len > arr.length) && (len = arr.length);
|
|
35
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
36
|
-
return arr2;
|
|
37
|
-
}
|
|
38
|
-
function _array_with_holes(arr) {
|
|
39
|
-
if (Array.isArray(arr)) return arr;
|
|
40
|
-
}
|
|
41
|
-
function _define_property(obj, key, value) {
|
|
42
|
-
return key in obj ? Object.defineProperty(obj, key, {
|
|
43
|
-
value,
|
|
44
|
-
enumerable: !0,
|
|
45
|
-
configurable: !0,
|
|
46
|
-
writable: !0
|
|
47
|
-
}) : obj[key] = value, obj;
|
|
48
|
-
}
|
|
49
|
-
function _iterable_to_array_limit(arr, i) {
|
|
50
|
-
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
51
|
-
if (_i != null) {
|
|
52
|
-
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
53
|
-
try {
|
|
54
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
55
|
-
;
|
|
56
|
-
} catch (err) {
|
|
57
|
-
_d = !0, _e = err;
|
|
58
|
-
} finally {
|
|
59
|
-
try {
|
|
60
|
-
!_n && _i.return != null && _i.return();
|
|
61
|
-
} finally {
|
|
62
|
-
if (_d) throw _e;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return _arr;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function _non_iterable_rest() {
|
|
69
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
70
|
-
}
|
|
71
|
-
function _object_spread(target) {
|
|
72
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
73
|
-
var source = arguments[i] != null ? arguments[i] : {}, ownKeys2 = Object.keys(source);
|
|
74
|
-
typeof Object.getOwnPropertySymbols == "function" && (ownKeys2 = ownKeys2.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
75
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
76
|
-
}))), ownKeys2.forEach(function(key) {
|
|
77
|
-
_define_property(target, key, source[key]);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
return target;
|
|
81
|
-
}
|
|
82
|
-
function ownKeys(object, enumerableOnly) {
|
|
83
|
-
var keys = Object.keys(object);
|
|
84
|
-
if (Object.getOwnPropertySymbols) {
|
|
85
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
86
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
87
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
88
|
-
})), keys.push.apply(keys, symbols);
|
|
89
|
-
}
|
|
90
|
-
return keys;
|
|
91
|
-
}
|
|
92
|
-
function _object_spread_props(target, source) {
|
|
93
|
-
return source = source ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
94
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
95
|
-
}), target;
|
|
96
|
-
}
|
|
97
|
-
function _sliced_to_array(arr, i) {
|
|
98
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
99
|
-
}
|
|
100
|
-
function _type_of(obj) {
|
|
101
|
-
"@swc/helpers - typeof";
|
|
102
|
-
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
103
|
-
}
|
|
104
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
105
|
-
if (o) {
|
|
106
|
-
if (typeof o == "string") return _array_like_to_array(o, minLen);
|
|
107
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
108
|
-
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set") return Array.from(n);
|
|
109
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
var ToastContext = /* @__PURE__ */ import_react.default.createContext({}), ToastCurrentContext = /* @__PURE__ */ import_react.default.createContext(null), useToastController = function() {
|
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_react = __toESM(require("react")), import_core = require("@tamagui/core"), import_react_native = require("react-native"), import_createNativeToast = require("./createNativeToast"), ToastContext = /* @__PURE__ */ import_react.default.createContext({}), ToastCurrentContext = /* @__PURE__ */ import_react.default.createContext(null), useToastController = function() {
|
|
113
33
|
return import_react.default.useContext(ToastContext);
|
|
114
34
|
}, useToastState = function() {
|
|
115
35
|
return import_react.default.useContext(ToastCurrentContext);
|
|
116
36
|
}, useToast = function() {
|
|
117
|
-
return
|
|
37
|
+
return {
|
|
38
|
+
...useToastController(),
|
|
118
39
|
currentToast: useToastState()
|
|
119
|
-
}
|
|
40
|
+
};
|
|
120
41
|
}, ToastImperativeProvider = function(param) {
|
|
121
|
-
var
|
|
42
|
+
var { children, options } = param, counterRef = import_react.default.useRef(0), [toast, setToast] = import_react.default.useState(null), [lastNativeToastRef, setLastNativeToastRef] = import_react.default.useState(null), show = import_react.default.useCallback(function(title, showOptions) {
|
|
122
43
|
var _showOptions_native, native = (_showOptions_native = showOptions == null ? void 0 : showOptions.native) !== null && _showOptions_native !== void 0 ? _showOptions_native : options.native, isWebNative = Array.isArray(native) ? native.includes("web") : native === "web", isMobileNative = Array.isArray(native) ? native.includes("mobile") : native === "mobile", isAndroidNative = isMobileNative || (Array.isArray(native) ? native.includes("android") : native === "android"), isIosNative = isMobileNative || (Array.isArray(native) ? native.includes("ios") : native === "ios"), isHandledNatively = native === !0 || import_core.isWeb && isWebNative || !import_core.isWeb && isMobileNative || import_react_native.Platform.OS === "android" && isAndroidNative || import_react_native.Platform.OS === "ios" && isIosNative;
|
|
123
44
|
if (isHandledNatively) {
|
|
124
45
|
var nativeToastResult = (0, import_createNativeToast.createNativeToast)(title, showOptions ?? {});
|
|
125
|
-
|
|
46
|
+
typeof nativeToastResult == "object" && nativeToastResult.nativeToastRef && setLastNativeToastRef(nativeToastResult.nativeToastRef);
|
|
126
47
|
}
|
|
127
48
|
counterRef.current++;
|
|
128
49
|
var _showOptions_viewportName;
|
|
129
|
-
return setToast(
|
|
50
|
+
return setToast({
|
|
51
|
+
...showOptions == null ? void 0 : showOptions.customData,
|
|
52
|
+
...showOptions,
|
|
130
53
|
viewportName: (_showOptions_viewportName = showOptions == null ? void 0 : showOptions.viewportName) !== null && _showOptions_viewportName !== void 0 ? _showOptions_viewportName : "default",
|
|
131
54
|
title,
|
|
132
55
|
id: counterRef.current.toString(),
|
|
133
56
|
isHandledNatively
|
|
134
|
-
})
|
|
57
|
+
}), !0;
|
|
135
58
|
}, [
|
|
136
59
|
setToast,
|
|
137
60
|
options.native
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Users/n8/tamagui/code/ui/toast/src/ToastImperative.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,eAAkB,2BAElB,cAAsB,0BAEtB,sBAAyB,yBAEzB,2BAAkC
|
|
5
|
-
"names": ["ToastContext", "React", "createContext", "ToastCurrentContext", "useToastController", "useContext", "useToastState", "useToast", "currentToast", "ToastImperativeProvider", "children", "options", "counterRef", "useRef", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAAA,eAAkB,2BAElB,cAAsB,0BAEtB,sBAAyB,yBAEzB,2BAAkC,gCA6E5BA,eAAeC,6BAAAA,QAAMC,cAA6B,CAAC,CAAA,GACnDC,sBAAsBF,6BAAAA,QAAMC,cAAgC,IAAA,GAErDE,qBAAqB,WAAA;AAChC,SAAOH,aAAAA,QAAMI,WAAWL,YAAAA;AAC1B,GAEaM,gBAAgB,WAAA;AAC3B,SAAOL,aAAAA,QAAMI,WAAWF,mBAAAA;AAC1B,GAGaI,WAAW,WAAA;AACtB,SAAO;IACL,GAAGH,mBAAAA;IACHI,cAAcF,cAAAA;EAChB;AACF,GAUaG,0BAA0B,SAAA,OAAA;MAAC,EACtCC,UACAC,QAAO,IACsB,OACvBC,aAAaX,aAAAA,QAAMY,OAAO,CAAA,GAE1B,CAACC,OAAOC,QAAAA,IAAYd,aAAAA,QAAMe,SAA2B,IAAA,GAErD,CAACC,oBAAoBC,qBAAAA,IACzBjB,aAAAA,QAAMe,SAAuC,IAAA,GAEzCG,OAAOlB,aAAAA,QAAMmB,YACjB,SAACC,OAAOC,aAAAA;QACSA,qBAATC,UAASD,sBAAAA,eAAAA,OAAAA,SAAAA,YAAaC,YAAM,QAAnBD,wBAAAA,SAAAA,sBAAuBX,QAAQY,QACxCC,cAAcC,MAAMC,QAAQH,MAAAA,IAC9BA,OAAOI,SAAS,KAAA,IAChBJ,WAAW,OACTK,iBAAiBH,MAAMC,QAAQH,MAAAA,IACjCA,OAAOI,SAAS,QAAA,IAChBJ,WAAW,UACTM,kBACJD,mBACCH,MAAMC,QAAQH,MAAAA,IAAUA,OAAOI,SAAS,SAAA,IAAaJ,WAAW,YAC7DO,cACJF,mBACCH,MAAMC,QAAQH,MAAAA,IAAUA,OAAOI,SAAS,KAAA,IAASJ,WAAW,QAEzDQ,oBACJR,WAAW,MACVS,qBAASR,eACT,CAACQ,qBAASJ,kBACVK,6BAASC,OAAO,aAAaL,mBAC7BI,6BAASC,OAAO,SAASJ;AAE5B,QAAIC,mBAAmB;AACrB,UAAMI,wBAAoBC,4CAAkBf,OAAOC,eAAe,CAAC,CAAA;AACnE,MAAI,OAAOa,qBAAsB,YAAYA,kBAAkBE,kBAC7DnB,sBAAsBiB,kBAAkBE,cAAc;IAE1D;AACAzB,eAAW0B;QAIKhB;AAHhBP,oBAAS;SACJO,eAAAA,OAAAA,SAAAA,YAAaiB;MAChB,GAAGjB;MACHkB,eAAclB,4BAAAA,eAAAA,OAAAA,SAAAA,YAAakB,kBAAY,QAAzBlB,8BAAAA,SAAAA,4BAA6B;MAC3CD;MACAoB,IAAI7B,WAAW0B,QAAQI,SAAQ;MAC/BX;IACF,CAAA,GACO;EACT,GACA;IAAChB;IAAUJ,QAAQY;GAAO,GAEtBoB,OAAO1C,aAAAA,QAAMmB,YAAY,WAAA;AAC7BH,0BAAAA,QAAAA,mBAAoB2B,MAAK,GACzB7B,SAAS,IAAA;EACX,GAAG;IAACA;IAAUE;GAAmB,GAE3B4B,eAAe5C,aAAAA,QAAM6C,QAAQ,WAAA;AACjC,WAAO;MACL3B;MACAwB;MACAI,aAAa9B;MACbN;IACF;EACF,GAAG;IAACQ;IAAMwB;IAAM1B;IAAoB+B,KAAKC,UAAUtC,WAAW,IAAA;GAAM;AAEpE,SACE,uCAAAuC,KAAClD,aAAamD,UAAQ;IAACC,OAAOP;cAC5B,uCAAAK,KAAC/C,oBAAoBgD,UAAQ;MAACC,OAAOtC;;;;AAK3C;",
|
|
5
|
+
"names": ["ToastContext", "React", "createContext", "ToastCurrentContext", "useToastController", "useContext", "useToastState", "useToast", "currentToast", "ToastImperativeProvider", "children", "options", "counterRef", "useRef", "toast", "setToast", "useState", "lastNativeToastRef", "setLastNativeToastRef", "show", "useCallback", "title", "showOptions", "native", "isWebNative", "Array", "isArray", "includes", "isMobileNative", "isAndroidNative", "isIosNative", "isHandledNatively", "isWeb", "Platform", "OS", "nativeToastResult", "createNativeToast", "nativeToastRef", "current", "customData", "viewportName", "id", "toString", "hide", "close", "contextValue", "useMemo", "nativeToast", "JSON", "stringify", "_jsx", "Provider", "value"]
|
|
6
6
|
}
|