@tamagui/alert-dialog 3.0.0-beta.922.1 → 3.0.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/AlertDialog.cjs +34 -31
- package/dist/cjs/AlertDialog.native.cjs +33 -106
- package/dist/cjs/AlertDialog.native.js +33 -106
- package/dist/cjs/AlertDialog.native.js.map +1 -1
- package/dist/cjs/alertDialogPart.cjs +30 -0
- package/dist/cjs/alertDialogPart.native.cjs +32 -0
- package/dist/cjs/alertDialogPart.native.js +34 -0
- package/dist/cjs/alertDialogPart.native.js.map +1 -0
- package/dist/cjs/useNativeAlertDialog.cjs +24 -0
- package/dist/cjs/useNativeAlertDialog.native.cjs +139 -0
- package/dist/cjs/useNativeAlertDialog.native.js +141 -0
- package/dist/cjs/useNativeAlertDialog.native.js.map +1 -0
- package/dist/esm/AlertDialog.mjs +35 -19
- package/dist/esm/AlertDialog.mjs.map +1 -1
- package/dist/esm/AlertDialog.native.js +33 -104
- package/dist/esm/AlertDialog.native.js.map +1 -1
- package/dist/esm/alertDialogPart.mjs +7 -0
- package/dist/esm/alertDialogPart.mjs.map +1 -0
- package/dist/esm/alertDialogPart.native.js +7 -0
- package/dist/esm/alertDialogPart.native.js.map +1 -0
- package/dist/esm/useNativeAlertDialog.mjs +4 -0
- package/dist/esm/useNativeAlertDialog.mjs.map +1 -0
- package/dist/esm/useNativeAlertDialog.native.js +112 -0
- package/dist/esm/useNativeAlertDialog.native.js.map +1 -0
- package/dist/jsx/AlertDialog.mjs +35 -19
- package/dist/jsx/AlertDialog.mjs.map +1 -1
- package/dist/jsx/AlertDialog.native.cjs +33 -106
- package/dist/jsx/AlertDialog.native.js +33 -106
- package/dist/jsx/AlertDialog.native.js.map +1 -1
- package/dist/jsx/alertDialogPart.mjs +7 -0
- package/dist/jsx/alertDialogPart.mjs.map +1 -0
- package/dist/jsx/alertDialogPart.native.cjs +32 -0
- package/dist/jsx/alertDialogPart.native.js +34 -0
- package/dist/jsx/alertDialogPart.native.js.map +1 -0
- package/dist/jsx/useNativeAlertDialog.mjs +4 -0
- package/dist/jsx/useNativeAlertDialog.mjs.map +1 -0
- package/dist/jsx/useNativeAlertDialog.native.cjs +139 -0
- package/dist/jsx/useNativeAlertDialog.native.js +141 -0
- package/dist/jsx/useNativeAlertDialog.native.js.map +1 -0
- package/package.json +21 -19
- package/src/AlertDialog.tsx +19 -141
- package/src/alertDialogPart.ts +26 -0
- package/src/useNativeAlertDialog.native.tsx +129 -0
- package/src/useNativeAlertDialog.ts +11 -0
- package/types/AlertDialog.d.ts +41 -83
- package/types/AlertDialog.d.ts.map +1 -1
- package/types/alertDialogPart.d.ts +15 -0
- package/types/alertDialogPart.d.ts.map +1 -0
- package/types/useNativeAlertDialog.d.ts +11 -0
- package/types/useNativeAlertDialog.d.ts.map +1 -0
- package/types/useNativeAlertDialog.native.d.ts +11 -0
- package/types/useNativeAlertDialog.native.d.ts.map +1 -0
|
@@ -47,19 +47,16 @@ var import_constants = require("@tamagui/constants");
|
|
|
47
47
|
var import_core2 = require("@tamagui/core");
|
|
48
48
|
var import_dialog = require("@tamagui/dialog");
|
|
49
49
|
var import_helpers = require("@tamagui/helpers");
|
|
50
|
-
var import_use_controllable_state = require("@tamagui/use-controllable-state");
|
|
51
50
|
var React = __toESM(require("react"), 1);
|
|
52
|
-
var
|
|
51
|
+
var import_alertDialogPart = require("./alertDialogPart.native.js");
|
|
52
|
+
var import_useNativeAlertDialog = require("./useNativeAlertDialog.native.js");
|
|
53
53
|
var getAlertDialogScope = function(scope) {
|
|
54
54
|
return scope;
|
|
55
55
|
};
|
|
56
56
|
var ROOT_NAME = "AlertDialog";
|
|
57
|
-
var
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
};
|
|
61
|
-
var NativeAlertDialogTriggerFrame = (0, import_core2.styled)(import_core2.View, { displayName: "AlertDialogTrigger" });
|
|
62
|
-
markAlertDialogPart(NativeAlertDialogTriggerFrame, "trigger");
|
|
57
|
+
var TRIGGER_NAME = "AlertDialogTrigger";
|
|
58
|
+
var NativeAlertDialogTriggerFrame = (0, import_core2.styled)(import_core2.View, { displayName: TRIGGER_NAME });
|
|
59
|
+
(0, import_alertDialogPart.markAlertDialogPart)(NativeAlertDialogTriggerFrame, "trigger");
|
|
63
60
|
var AlertDialogTrigger = (0, import_core.createStyledHOC)(NativeAlertDialogTriggerFrame, function AlertDialogTrigger2(props, forwardedRef) {
|
|
64
61
|
if (props["__native"]) {
|
|
65
62
|
var { __native, onPress, __onPress, ...rest } = props;
|
|
@@ -82,7 +79,8 @@ var AlertDialogPortal = function AlertDialogPortal2(props) {
|
|
|
82
79
|
...portalProps
|
|
83
80
|
});
|
|
84
81
|
};
|
|
85
|
-
var
|
|
82
|
+
var OVERLAY_NAME = "AlertDialogOverlay";
|
|
83
|
+
var AlertDialogOverlayFrame = (0, import_core2.styled)(import_dialog.DialogOverlayFrame, { displayName: OVERLAY_NAME });
|
|
86
84
|
var AlertDialogOverlay = (0, import_core.createStyledHOC)(AlertDialogOverlayFrame, function AlertDialogOverlay2(props, forwardedRef) {
|
|
87
85
|
var { scope, ...overlayProps } = props;
|
|
88
86
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogOverlay, {
|
|
@@ -93,7 +91,8 @@ var AlertDialogOverlay = (0, import_core.createStyledHOC)(AlertDialogOverlayFram
|
|
|
93
91
|
});
|
|
94
92
|
var CONTENT_NAME = "AlertDialogContent";
|
|
95
93
|
var { Provider: AlertDialogContextProvider, useStyledContext: useAlertDialogContentContext } = (0, import_core2.createStyledContext)({}, "AlertDialogContext");
|
|
96
|
-
var
|
|
94
|
+
var AlertDialogContentFrame = (0, import_core2.styled)(import_dialog.DialogContentFrame, { displayName: CONTENT_NAME });
|
|
95
|
+
var AlertDialogContent = (0, import_core.createStyledHOC)(AlertDialogContentFrame, function AlertDialogContent2(props, forwardedRef) {
|
|
97
96
|
var { scope, children, ...contentProps } = props;
|
|
98
97
|
var dialogScope = getAlertDialogScope(scope);
|
|
99
98
|
var contentRef = React.useRef(null);
|
|
@@ -118,7 +117,7 @@ var AlertDialogContent = (0, import_core.createRefComponent)(function AlertDialo
|
|
|
118
117
|
event.cancel();
|
|
119
118
|
if (import_constants.isWeb) {
|
|
120
119
|
var _cancelRef_current;
|
|
121
|
-
(_cancelRef_current = cancelRef.current) === null || _cancelRef_current === void 0
|
|
120
|
+
(_cancelRef_current = cancelRef.current) === null || _cancelRef_current === void 0 ? void 0 : _cancelRef_current.focus({ preventScroll: true });
|
|
122
121
|
}
|
|
123
122
|
}),
|
|
124
123
|
onPointerDownOutside: function(event) {
|
|
@@ -134,7 +133,7 @@ var AlertDialogContent = (0, import_core.createRefComponent)(function AlertDialo
|
|
|
134
133
|
});
|
|
135
134
|
var TITLE_NAME = "AlertDialogTitle";
|
|
136
135
|
var AlertDialogTitleFrame = (0, import_core2.styled)(import_core2.View, { displayName: TITLE_NAME });
|
|
137
|
-
markAlertDialogPart(AlertDialogTitleFrame, "title");
|
|
136
|
+
(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogTitleFrame, "title");
|
|
138
137
|
var AlertDialogTitle = (0, import_core.createStyledHOC)(AlertDialogTitleFrame, function AlertDialogTitle2(props, forwardedRef) {
|
|
139
138
|
var { scope, ...titleProps } = props;
|
|
140
139
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTitle, {
|
|
@@ -145,7 +144,7 @@ var AlertDialogTitle = (0, import_core.createStyledHOC)(AlertDialogTitleFrame, f
|
|
|
145
144
|
});
|
|
146
145
|
var DESCRIPTION_NAME = "AlertDialogDescription";
|
|
147
146
|
var AlertDialogDescriptionFrame = (0, import_core2.styled)(import_core2.View, { displayName: DESCRIPTION_NAME });
|
|
148
|
-
markAlertDialogPart(AlertDialogDescriptionFrame, "description");
|
|
147
|
+
(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogDescriptionFrame, "description");
|
|
149
148
|
var AlertDialogDescription = (0, import_core.createStyledHOC)(AlertDialogDescriptionFrame, function AlertDialogDescription2(props, forwardedRef) {
|
|
150
149
|
var { scope, ...descriptionProps } = props;
|
|
151
150
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogDescription, {
|
|
@@ -154,8 +153,9 @@ var AlertDialogDescription = (0, import_core.createStyledHOC)(AlertDialogDescrip
|
|
|
154
153
|
ref: forwardedRef
|
|
155
154
|
});
|
|
156
155
|
});
|
|
157
|
-
var
|
|
158
|
-
|
|
156
|
+
var ACTION_NAME = "AlertDialogAction";
|
|
157
|
+
var AlertDialogActionFrame = (0, import_core2.styled)(import_core2.View, { displayName: ACTION_NAME });
|
|
158
|
+
(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogActionFrame, "action");
|
|
159
159
|
var AlertDialogAction = (0, import_core.createStyledHOC)(AlertDialogActionFrame, function AlertDialogAction2(props, forwardedRef) {
|
|
160
160
|
var { scope, ...actionProps } = props;
|
|
161
161
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {
|
|
@@ -164,8 +164,9 @@ var AlertDialogAction = (0, import_core.createStyledHOC)(AlertDialogActionFrame,
|
|
|
164
164
|
ref: forwardedRef
|
|
165
165
|
});
|
|
166
166
|
});
|
|
167
|
-
var
|
|
168
|
-
|
|
167
|
+
var CANCEL_NAME = "AlertDialogCancel";
|
|
168
|
+
var AlertDialogCancelFrame = (0, import_core2.styled)(import_core2.View, { displayName: CANCEL_NAME });
|
|
169
|
+
(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogCancelFrame, "cancel");
|
|
169
170
|
var AlertDialogCancel = (0, import_core.createStyledHOC)(AlertDialogCancelFrame, function AlertDialogCancel2(props, forwardedRef) {
|
|
170
171
|
var { scope, ...cancelProps } = props;
|
|
171
172
|
var { cancelRef } = useAlertDialogContentContext(scope);
|
|
@@ -176,8 +177,9 @@ var AlertDialogCancel = (0, import_core.createStyledHOC)(AlertDialogCancelFrame,
|
|
|
176
177
|
ref
|
|
177
178
|
});
|
|
178
179
|
});
|
|
179
|
-
var
|
|
180
|
-
|
|
180
|
+
var DESTRUCTIVE_NAME = "AlertDialogDestructive";
|
|
181
|
+
var AlertDialogDestructiveFrame = (0, import_core2.styled)(import_core2.View, { displayName: DESTRUCTIVE_NAME });
|
|
182
|
+
(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogDestructiveFrame, "destructive");
|
|
181
183
|
var AlertDialogDestructive = (0, import_core.createStyledHOC)(AlertDialogDestructiveFrame, function AlertDialogDestructive2(props, forwardedRef) {
|
|
182
184
|
var { scope, ...destructiveProps } = props;
|
|
183
185
|
var { destructiveRef } = useAlertDialogContentContext(scope);
|
|
@@ -190,110 +192,35 @@ var AlertDialogDestructive = (0, import_core.createStyledHOC)(AlertDialogDestruc
|
|
|
190
192
|
});
|
|
191
193
|
var DescriptionWarning = function(param) {
|
|
192
194
|
var { contentRef } = param;
|
|
193
|
-
if (process.env.NODE_ENV === "development")
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
if (process.env.NODE_ENV === "development") {
|
|
196
|
+
React.useEffect(function() {
|
|
197
|
+
var _contentRef_current;
|
|
198
|
+
if (!import_constants.isWeb) return;
|
|
199
|
+
var hasDescription = document.getElementById((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.getAttribute("aria-describedby"));
|
|
200
|
+
if (!hasDescription) {
|
|
201
|
+
console.warn(`\`${CONTENT_NAME}\` requires a description for the component to be accessible for screen reader users.
|
|
197
202
|
|
|
198
203
|
You can add a description to the \`${CONTENT_NAME}\` by passing a \`${DESCRIPTION_NAME}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
199
204
|
|
|
200
205
|
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${CONTENT_NAME}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
201
206
|
|
|
202
207
|
For more information, see https://tamagui.dev/docs/components/alert-dialog`);
|
|
203
|
-
|
|
208
|
+
}
|
|
209
|
+
}, [contentRef]);
|
|
210
|
+
}
|
|
204
211
|
return null;
|
|
205
212
|
};
|
|
206
213
|
var AlertDialogInner = function(props) {
|
|
207
214
|
var { scope, native, ...alertDialogProps } = props;
|
|
208
215
|
var dialogScope = getAlertDialogScope(scope);
|
|
209
|
-
var
|
|
210
|
-
|
|
211
|
-
defaultProp: props.defaultOpen || false,
|
|
212
|
-
onChange: props.onOpenChange,
|
|
213
|
-
transition: true
|
|
214
|
-
});
|
|
215
|
-
var triggerElement = null;
|
|
216
|
-
var title = "";
|
|
217
|
-
var description = "";
|
|
218
|
-
var buttons = [];
|
|
219
|
-
forEachChildDeep(React.Children.toArray(props.children), function(child) {
|
|
220
|
-
if (!/* @__PURE__ */ React.isValidElement(child)) return false;
|
|
221
|
-
var part = (0, import_core2.isTamaguiElement)(child) ? child.type.staticConfig[ALERT_DIALOG_PART] : void 0;
|
|
222
|
-
switch (part) {
|
|
223
|
-
case "trigger":
|
|
224
|
-
triggerElement = /* @__PURE__ */ React.cloneElement(child, { __native: true });
|
|
225
|
-
return false;
|
|
226
|
-
case "title":
|
|
227
|
-
title = getStringChildren(child);
|
|
228
|
-
return false;
|
|
229
|
-
case "description":
|
|
230
|
-
description = getStringChildren(child);
|
|
231
|
-
return false;
|
|
232
|
-
case "action":
|
|
233
|
-
case "destructive":
|
|
234
|
-
case "cancel":
|
|
235
|
-
var style = part === "action" ? "default" : part === "destructive" ? "destructive" : "cancel";
|
|
236
|
-
var text = getStringChildren(child);
|
|
237
|
-
var onPress = function() {
|
|
238
|
-
var _childProps_onPress;
|
|
239
|
-
var childProps = child.props;
|
|
240
|
-
childProps === null || childProps === void 0 || (_childProps_onPress = childProps.onPress) == null || _childProps_onPress.call(childProps, { native: true });
|
|
241
|
-
setOpen(false);
|
|
242
|
-
};
|
|
243
|
-
buttons.push({
|
|
244
|
-
style,
|
|
245
|
-
text,
|
|
246
|
-
onPress
|
|
247
|
-
});
|
|
248
|
-
return false;
|
|
249
|
-
default: return true;
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
(0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
253
|
-
if (!open || !native) return;
|
|
254
|
-
if (title || description) import_react_native.Alert.alert(title, description, buttons);
|
|
255
|
-
}, [native, open]);
|
|
256
|
-
if (native) return /* @__PURE__ */ React.cloneElement(triggerElement, { __onPress: function() {
|
|
257
|
-
setOpen(true);
|
|
258
|
-
} });
|
|
216
|
+
var nativeAlert = (0, import_useNativeAlertDialog.useNativeAlertDialog)(props);
|
|
217
|
+
if (nativeAlert) return nativeAlert;
|
|
259
218
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog, {
|
|
260
219
|
scope: dialogScope,
|
|
261
220
|
...alertDialogProps,
|
|
262
221
|
modal: true
|
|
263
222
|
});
|
|
264
223
|
};
|
|
265
|
-
function forEachChildDeep(children, onChild) {
|
|
266
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
267
|
-
try {
|
|
268
|
-
for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
269
|
-
var child = _step.value;
|
|
270
|
-
if (!/* @__PURE__ */ React.isValidElement(child)) continue;
|
|
271
|
-
if (!onChild(child)) continue;
|
|
272
|
-
var childProps = child.props;
|
|
273
|
-
if (childProps.children) forEachChildDeep(React.Children.toArray(childProps.children), onChild);
|
|
274
|
-
}
|
|
275
|
-
} catch (err) {
|
|
276
|
-
_didIteratorError = true;
|
|
277
|
-
_iteratorError = err;
|
|
278
|
-
} finally {
|
|
279
|
-
try {
|
|
280
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
281
|
-
} finally {
|
|
282
|
-
if (_didIteratorError) throw _iteratorError;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
function getStringChildren(child) {
|
|
287
|
-
var string = "";
|
|
288
|
-
forEachChildDeep(React.Children.toArray(child), function(child2) {
|
|
289
|
-
if (typeof child2.props.children === "string") {
|
|
290
|
-
string = child2.props.children;
|
|
291
|
-
return false;
|
|
292
|
-
}
|
|
293
|
-
return true;
|
|
294
|
-
});
|
|
295
|
-
return string;
|
|
296
|
-
}
|
|
297
224
|
var AlertDialog = (0, import_helpers.withStaticProperties)(AlertDialogInner, {
|
|
298
225
|
Trigger: AlertDialogTrigger,
|
|
299
226
|
Portal: AlertDialogPortal,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDialog.native.js","names":[],"sources":["jsx/AlertDialog.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\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n\t// If the importer is in node compatibility mode or this is not an ESM\n\t// file that has been converted to a CommonJS file using a Babel-\n\t// compatible transform (i.e. \"__esModule\" has not been set), then set\n\t// \"default\" to the CommonJS \"module.exports\" for node compatibility.\n\tisNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target,\n\tmod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar AlertDialog_exports = {};\n__export(AlertDialog_exports, {\n\tAlertDialog: () => AlertDialog,\n\tAlertDialogAction: () => AlertDialogAction,\n\tAlertDialogCancel: () => AlertDialogCancel,\n\tAlertDialogContent: () => AlertDialogContent,\n\tAlertDialogDescription: () => AlertDialogDescription,\n\tAlertDialogDestructive: () => AlertDialogDestructive,\n\tAlertDialogOverlay: () => AlertDialogOverlay,\n\tAlertDialogPortal: () => AlertDialogPortal,\n\tAlertDialogTitle: () => AlertDialogTitle,\n\tAlertDialogTrigger: () => AlertDialogTrigger\n});\nmodule.exports = __toCommonJS(AlertDialog_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_core = require(\"@tamagui/core\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core2 = require(\"@tamagui/core\");\nvar import_dialog = require(\"@tamagui/dialog\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar import_use_controllable_state = require(\"@tamagui/use-controllable-state\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_react_native = require(\"react-native\");\nvar getAlertDialogScope = function(scope) {\n\treturn scope;\n};\nvar ROOT_NAME = \"AlertDialog\";\nvar ALERT_DIALOG_PART = /* @__PURE__ */ Symbol(\"AlertDialogPart\");\nvar markAlertDialogPart = function(component, part) {\n\tObject.assign(component.staticConfig, { [ALERT_DIALOG_PART]: part });\n};\nvar NativeAlertDialogTriggerFrame = (0, import_core2.styled)(import_core2.View, { displayName: \"AlertDialogTrigger\" });\nmarkAlertDialogPart(NativeAlertDialogTriggerFrame, \"trigger\");\nvar AlertDialogTrigger = (0, import_core.createStyledHOC)(NativeAlertDialogTriggerFrame, function AlertDialogTrigger2(props, forwardedRef) {\n\tif (props[\"__native\"]) {\n\t\tvar { __native, onPress, __onPress, ...rest } = props;\n\t\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeAlertDialogTriggerFrame, {\n\t\t\t...rest,\n\t\t\tonPress: (0, import_helpers.composeEventHandlers)(onPress, __onPress)\n\t\t});\n\t}\n\tvar { scope, ...triggerProps } = props;\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTrigger, {\n\t\tscope: getAlertDialogScope(scope),\n\t\t...triggerProps,\n\t\tref: forwardedRef\n\t});\n});\nvar AlertDialogPortal = function AlertDialogPortal2(props) {\n\tvar { scope, ...portalProps } = props;\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogPortal, {\n\t\tscope: getAlertDialogScope(scope),\n\t\t...portalProps\n\t});\n};\nvar AlertDialogOverlayFrame = (0, import_core2.styled)(import_dialog.DialogOverlayFrame, { displayName: \"AlertDialogOverlay\" });\nvar AlertDialogOverlay = (0, import_core.createStyledHOC)(AlertDialogOverlayFrame, function AlertDialogOverlay2(props, forwardedRef) {\n\tvar { scope, ...overlayProps } = props;\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogOverlay, {\n\t\tscope: getAlertDialogScope(scope),\n\t\t...overlayProps,\n\t\tref: forwardedRef\n\t});\n});\nvar CONTENT_NAME = \"AlertDialogContent\";\nvar { Provider: AlertDialogContextProvider, useStyledContext: useAlertDialogContentContext } = (0, import_core2.createStyledContext)({}, \"AlertDialogContext\");\nvar AlertDialogContent = (0, import_core.createRefComponent)(function AlertDialogContent2(props, forwardedRef) {\n\tvar { scope, children, ...contentProps } = props;\n\tvar dialogScope = getAlertDialogScope(scope);\n\tvar contentRef = React.useRef(null);\n\tvar composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef);\n\tvar cancelRef = React.useRef(null);\n\tvar destructiveRef = React.useRef(null);\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogWarningProvider, {\n\t\tcontentName: CONTENT_NAME,\n\t\ttitleName: TITLE_NAME,\n\t\tdocsSlug: \"alert-dialog\",\n\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogContextProvider, {\n\t\t\tscope,\n\t\t\tcancelRef,\n\t\t\tdestructiveRef,\n\t\t\tchildren: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.DialogContent, {\n\t\t\t\trole: \"alertdialog\",\n\t\t\t\t\"aria-modal\": true,\n\t\t\t\tscope: dialogScope,\n\t\t\t\t...contentProps,\n\t\t\t\tref: composedRefs,\n\t\t\t\tonOpenAutoFocus: (0, import_helpers.composeEventHandlers)(contentProps.onOpenAutoFocus, function(event) {\n\t\t\t\t\tevent.cancel();\n\t\t\t\t\tif (import_constants.isWeb) {\n\t\t\t\t\t\tvar _cancelRef_current;\n\t\t\t\t\t\t(_cancelRef_current = cancelRef.current) === null || _cancelRef_current === void 0 || _cancelRef_current.focus({ preventScroll: true });\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tonPointerDownOutside: function(event) {\n\t\t\t\t\treturn event.cancel();\n\t\t\t\t},\n\t\t\t\tonInteractOutside: function(event) {\n\t\t\t\t\treturn event.cancel();\n\t\t\t\t},\n\t\t\t\tchildren: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core2.Slottable, { children }), process.env.NODE_ENV === \"development\" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning, { contentRef })]\n\t\t\t})\n\t\t})\n\t});\n});\nvar TITLE_NAME = \"AlertDialogTitle\";\nvar AlertDialogTitleFrame = (0, import_core2.styled)(import_core2.View, { displayName: TITLE_NAME });\nmarkAlertDialogPart(AlertDialogTitleFrame, \"title\");\nvar AlertDialogTitle = (0, import_core.createStyledHOC)(AlertDialogTitleFrame, function AlertDialogTitle2(props, forwardedRef) {\n\tvar { scope, ...titleProps } = props;\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTitle, {\n\t\tscope: getAlertDialogScope(scope),\n\t\t...titleProps,\n\t\tref: forwardedRef\n\t});\n});\nvar DESCRIPTION_NAME = \"AlertDialogDescription\";\nvar AlertDialogDescriptionFrame = (0, import_core2.styled)(import_core2.View, { displayName: DESCRIPTION_NAME });\nmarkAlertDialogPart(AlertDialogDescriptionFrame, \"description\");\nvar AlertDialogDescription = (0, import_core.createStyledHOC)(AlertDialogDescriptionFrame, function AlertDialogDescription2(props, forwardedRef) {\n\tvar { scope, ...descriptionProps } = props;\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogDescription, {\n\t\tscope: getAlertDialogScope(scope),\n\t\t...descriptionProps,\n\t\tref: forwardedRef\n\t});\n});\nvar AlertDialogActionFrame = (0, import_core2.styled)(import_core2.View, { displayName: \"AlertDialogAction\" });\nmarkAlertDialogPart(AlertDialogActionFrame, \"action\");\nvar AlertDialogAction = (0, import_core.createStyledHOC)(AlertDialogActionFrame, function AlertDialogAction2(props, forwardedRef) {\n\tvar { scope, ...actionProps } = props;\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {\n\t\tscope: getAlertDialogScope(scope),\n\t\t...actionProps,\n\t\tref: forwardedRef\n\t});\n});\nvar AlertDialogCancelFrame = (0, import_core2.styled)(import_core2.View, { displayName: \"AlertDialogCancel\" });\nmarkAlertDialogPart(AlertDialogCancelFrame, \"cancel\");\nvar AlertDialogCancel = (0, import_core.createStyledHOC)(AlertDialogCancelFrame, function AlertDialogCancel2(props, forwardedRef) {\n\tvar { scope, ...cancelProps } = props;\n\tvar { cancelRef } = useAlertDialogContentContext(scope);\n\tvar ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, cancelRef);\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {\n\t\tscope: getAlertDialogScope(scope),\n\t\t...cancelProps,\n\t\tref\n\t});\n});\nvar AlertDialogDestructiveFrame = (0, import_core2.styled)(import_core2.View, { displayName: \"AlertDialogDestructive\" });\nmarkAlertDialogPart(AlertDialogDestructiveFrame, \"destructive\");\nvar AlertDialogDestructive = (0, import_core.createStyledHOC)(AlertDialogDestructiveFrame, function AlertDialogDestructive2(props, forwardedRef) {\n\tvar { scope, ...destructiveProps } = props;\n\tvar { destructiveRef } = useAlertDialogContentContext(scope);\n\tvar ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, destructiveRef);\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {\n\t\tscope: getAlertDialogScope(scope),\n\t\t...destructiveProps,\n\t\tref\n\t});\n});\nvar DescriptionWarning = function(param) {\n\tvar { contentRef } = param;\n\tif (process.env.NODE_ENV === \"development\") React.useEffect(function() {\n\t\tvar _contentRef_current;\n\t\tif (!import_constants.isWeb) return;\n\t\tif (!document.getElementById((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.getAttribute(\"aria-describedby\"))) console.warn(`\\`${CONTENT_NAME}\\` requires a description for the component to be accessible for screen reader users.\n \n You can add a description to the \\`${CONTENT_NAME}\\` by passing a \\`${DESCRIPTION_NAME}\\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n \n Alternatively, you can use your own component as a description by assigning it an \\`id\\` and passing the same value to the \\`aria-describedby\\` prop in \\`${CONTENT_NAME}\\`. If the description is confusing or duplicative for sighted users, you can use the \\`@radix-ui/react-visually-hidden\\` primitive as a wrapper around your description component.\n \n For more information, see https://tamagui.dev/docs/components/alert-dialog`);\n\t}, [contentRef]);\n\treturn null;\n};\nvar AlertDialogInner = function(props) {\n\tvar { scope, native, ...alertDialogProps } = props;\n\tvar dialogScope = getAlertDialogScope(scope);\n\tvar [open, setOpen] = (0, import_use_controllable_state.useControllableState)({\n\t\tprop: props.open,\n\t\tdefaultProp: props.defaultOpen || false,\n\t\tonChange: props.onOpenChange,\n\t\ttransition: true\n\t});\n\tvar triggerElement = null;\n\tvar title = \"\";\n\tvar description = \"\";\n\tvar buttons = [];\n\tforEachChildDeep(React.Children.toArray(props.children), function(child) {\n\t\tif (!/* @__PURE__ */ React.isValidElement(child)) return false;\n\t\tvar part = (0, import_core2.isTamaguiElement)(child) ? child.type.staticConfig[ALERT_DIALOG_PART] : void 0;\n\t\tswitch (part) {\n\t\t\tcase \"trigger\":\n\t\t\t\ttriggerElement = /* @__PURE__ */ React.cloneElement(child, { __native: true });\n\t\t\t\treturn false;\n\t\t\tcase \"title\":\n\t\t\t\ttitle = getStringChildren(child);\n\t\t\t\treturn false;\n\t\t\tcase \"description\":\n\t\t\t\tdescription = getStringChildren(child);\n\t\t\t\treturn false;\n\t\t\tcase \"action\":\n\t\t\tcase \"destructive\":\n\t\t\tcase \"cancel\":\n\t\t\t\tvar style = part === \"action\" ? \"default\" : part === \"destructive\" ? \"destructive\" : \"cancel\";\n\t\t\t\tvar text = getStringChildren(child);\n\t\t\t\tvar onPress = function() {\n\t\t\t\t\tvar _childProps_onPress;\n\t\t\t\t\tvar childProps = child.props;\n\t\t\t\t\tchildProps === null || childProps === void 0 || (_childProps_onPress = childProps.onPress) == null || _childProps_onPress.call(childProps, { native: true });\n\t\t\t\t\tsetOpen(false);\n\t\t\t\t};\n\t\t\t\tbuttons.push({\n\t\t\t\t\tstyle,\n\t\t\t\t\ttext,\n\t\t\t\t\tonPress\n\t\t\t\t});\n\t\t\t\treturn false;\n\t\t\tdefault: return true;\n\t\t}\n\t});\n\t(0, import_constants.useIsomorphicLayoutEffect)(function() {\n\t\tif (!open || !native) return;\n\t\tif (title || description) import_react_native.Alert.alert(title, description, buttons);\n\t}, [native, open]);\n\tif (native) return /* @__PURE__ */ React.cloneElement(triggerElement, { __onPress: function() {\n\t\tsetOpen(true);\n\t} });\n\treturn /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog, {\n\t\tscope: dialogScope,\n\t\t...alertDialogProps,\n\t\tmodal: true\n\t});\n};\nfunction forEachChildDeep(children, onChild) {\n\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\ttry {\n\t\tfor (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar child = _step.value;\n\t\t\tif (!/* @__PURE__ */ React.isValidElement(child)) continue;\n\t\t\tif (!onChild(child)) continue;\n\t\t\tvar childProps = child.props;\n\t\t\tif (childProps.children) forEachChildDeep(React.Children.toArray(childProps.children), onChild);\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t} finally {\n\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t}\n\t}\n}\nfunction getStringChildren(child) {\n\tvar string = \"\";\n\tforEachChildDeep(React.Children.toArray(child), function(child2) {\n\t\tif (typeof child2.props.children === \"string\") {\n\t\t\tstring = child2.props.children;\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t});\n\treturn string;\n}\nvar AlertDialog = (0, import_helpers.withStaticProperties)(AlertDialogInner, {\n\tTrigger: AlertDialogTrigger,\n\tPortal: AlertDialogPortal,\n\tOverlay: AlertDialogOverlay,\n\tContent: AlertDialogContent,\n\tAction: AlertDialogAction,\n\tCancel: AlertDialogCancel,\n\tDestructive: AlertDialogDestructive,\n\tTitle: AlertDialogTitle,\n\tDescription: AlertDialogDescription\n});\nAlertDialog.displayName = ROOT_NAME;\n//# sourceMappingURL=AlertDialog.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;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAA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;EACA,OAAO;CACR,CAAC;CACD,OAAO;AACR;AACA,IAAI,eAAe,GAAG,eAAe,qBAAoB,CAAE,kBAAkB;CAC5E,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,OAAO;CACP,aAAa;AACd,CAAC;AACD,YAAY,cAAc"}
|
|
1
|
+
{"version":3,"file":"AlertDialog.native.js","names":[],"sources":["jsx/AlertDialog.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 AlertDialog_exports = {};\n__export(AlertDialog_exports, {\n AlertDialog: () => AlertDialog,\n AlertDialogAction: () => AlertDialogAction,\n AlertDialogCancel: () => AlertDialogCancel,\n AlertDialogContent: () => AlertDialogContent,\n AlertDialogDescription: () => AlertDialogDescription,\n AlertDialogDestructive: () => AlertDialogDestructive,\n AlertDialogOverlay: () => AlertDialogOverlay,\n AlertDialogPortal: () => AlertDialogPortal,\n AlertDialogTitle: () => AlertDialogTitle,\n AlertDialogTrigger: () => AlertDialogTrigger\n});\nmodule.exports = __toCommonJS(AlertDialog_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_core = require(\"@tamagui/core\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_constants = require(\"@tamagui/constants\");\nvar import_core2 = require(\"@tamagui/core\");\nvar import_dialog = require(\"@tamagui/dialog\");\nvar import_helpers = require(\"@tamagui/helpers\");\nvar React = __toESM(require(\"react\"), 1);\nvar import_alertDialogPart = require(\"./alertDialogPart\");\nvar import_useNativeAlertDialog = require(\"./useNativeAlertDialog\");\nvar getAlertDialogScope = function(scope) {\n return scope;\n};\nvar ROOT_NAME = \"AlertDialog\";\nvar TRIGGER_NAME = \"AlertDialogTrigger\";\nvar NativeAlertDialogTriggerFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: TRIGGER_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(NativeAlertDialogTriggerFrame, \"trigger\");\nvar AlertDialogTrigger = (0, import_core.createStyledHOC)(NativeAlertDialogTriggerFrame, function AlertDialogTrigger2(props, forwardedRef) {\n if (props[\"__native\"]) {\n var { __native, onPress, __onPress, ...rest } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NativeAlertDialogTriggerFrame, {\n ...rest,\n onPress: (0, import_helpers.composeEventHandlers)(onPress, __onPress)\n });\n }\n var { scope, ...triggerProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTrigger, {\n scope: getAlertDialogScope(scope),\n ...triggerProps,\n ref: forwardedRef\n });\n});\nvar AlertDialogPortal = function AlertDialogPortal2(props) {\n var { scope, ...portalProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogPortal, {\n scope: getAlertDialogScope(scope),\n ...portalProps\n });\n};\nvar OVERLAY_NAME = \"AlertDialogOverlay\";\nvar AlertDialogOverlayFrame = (0, import_core2.styled)(import_dialog.DialogOverlayFrame, {\n displayName: OVERLAY_NAME\n});\nvar AlertDialogOverlay = (0, import_core.createStyledHOC)(AlertDialogOverlayFrame, function AlertDialogOverlay2(props, forwardedRef) {\n var { scope, ...overlayProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogOverlay, {\n scope: getAlertDialogScope(scope),\n ...overlayProps,\n ref: forwardedRef\n });\n});\nvar CONTENT_NAME = \"AlertDialogContent\";\nvar { Provider: AlertDialogContextProvider, useStyledContext: useAlertDialogContentContext } = (0, import_core2.createStyledContext)({}, \"AlertDialogContext\");\nvar AlertDialogContentFrame = (0, import_core2.styled)(import_dialog.DialogContentFrame, {\n displayName: CONTENT_NAME\n});\nvar AlertDialogContent = (0, import_core.createStyledHOC)(AlertDialogContentFrame, function AlertDialogContent2(props, forwardedRef) {\n var { scope, children, ...contentProps } = props;\n var dialogScope = getAlertDialogScope(scope);\n var contentRef = React.useRef(null);\n var composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef);\n var cancelRef = React.useRef(null);\n var destructiveRef = React.useRef(null);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogWarningProvider, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"alert-dialog\",\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogContextProvider, {\n scope,\n cancelRef,\n destructiveRef,\n children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_dialog.DialogContent, {\n role: \"alertdialog\",\n \"aria-modal\": true,\n scope: dialogScope,\n ...contentProps,\n ref: composedRefs,\n onOpenAutoFocus: (0, import_helpers.composeEventHandlers)(contentProps.onOpenAutoFocus, function(event) {\n event.cancel();\n if (import_constants.isWeb) {\n var _cancelRef_current;\n (_cancelRef_current = cancelRef.current) === null || _cancelRef_current === void 0 ? void 0 : _cancelRef_current.focus({\n preventScroll: true\n });\n }\n }),\n onPointerDownOutside: function(event) {\n return event.cancel();\n },\n onInteractOutside: function(event) {\n return event.cancel();\n },\n children: [\n /**\n * We have to use `Slottable` here as we cannot wrap the `AlertDialogContentProvider`\n * around everything, otherwise the `DescriptionWarning` would be rendered straight away.\n * This is because we want the accessibility checks to run only once the content is actually\n * open and that behaviour is already encapsulated in `DialogContent`.\n */\n /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core2.Slottable, {\n children\n }),\n process.env.NODE_ENV === \"development\" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionWarning, {\n contentRef\n })\n ]\n })\n })\n });\n});\nvar TITLE_NAME = \"AlertDialogTitle\";\nvar AlertDialogTitleFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: TITLE_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogTitleFrame, \"title\");\nvar AlertDialogTitle = (0, import_core.createStyledHOC)(AlertDialogTitleFrame, function AlertDialogTitle2(props, forwardedRef) {\n var { scope, ...titleProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogTitle, {\n scope: getAlertDialogScope(scope),\n ...titleProps,\n ref: forwardedRef\n });\n});\nvar DESCRIPTION_NAME = \"AlertDialogDescription\";\nvar AlertDialogDescriptionFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: DESCRIPTION_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogDescriptionFrame, \"description\");\nvar AlertDialogDescription = (0, import_core.createStyledHOC)(AlertDialogDescriptionFrame, function AlertDialogDescription2(props, forwardedRef) {\n var { scope, ...descriptionProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogDescription, {\n scope: getAlertDialogScope(scope),\n ...descriptionProps,\n ref: forwardedRef\n });\n});\nvar ACTION_NAME = \"AlertDialogAction\";\nvar AlertDialogActionFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: ACTION_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogActionFrame, \"action\");\nvar AlertDialogAction = (0, import_core.createStyledHOC)(AlertDialogActionFrame, function AlertDialogAction2(props, forwardedRef) {\n var { scope, ...actionProps } = props;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {\n scope: getAlertDialogScope(scope),\n ...actionProps,\n ref: forwardedRef\n });\n});\nvar CANCEL_NAME = \"AlertDialogCancel\";\nvar AlertDialogCancelFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: CANCEL_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogCancelFrame, \"cancel\");\nvar AlertDialogCancel = (0, import_core.createStyledHOC)(AlertDialogCancelFrame, function AlertDialogCancel2(props, forwardedRef) {\n var { scope, ...cancelProps } = props;\n var { cancelRef } = useAlertDialogContentContext(scope);\n var ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, cancelRef);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {\n scope: getAlertDialogScope(scope),\n ...cancelProps,\n ref\n });\n});\nvar DESTRUCTIVE_NAME = \"AlertDialogDestructive\";\nvar AlertDialogDestructiveFrame = (0, import_core2.styled)(import_core2.View, {\n displayName: DESTRUCTIVE_NAME\n});\n(0, import_alertDialogPart.markAlertDialogPart)(AlertDialogDestructiveFrame, \"destructive\");\nvar AlertDialogDestructive = (0, import_core.createStyledHOC)(AlertDialogDestructiveFrame, function AlertDialogDestructive2(props, forwardedRef) {\n var { scope, ...destructiveProps } = props;\n var { destructiveRef } = useAlertDialogContentContext(scope);\n var ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, destructiveRef);\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.DialogClose, {\n scope: getAlertDialogScope(scope),\n ...destructiveProps,\n ref\n });\n});\nvar DescriptionWarning = function(param) {\n var { contentRef } = param;\n if (process.env.NODE_ENV === \"development\") {\n React.useEffect(function() {\n var _contentRef_current;\n if (!import_constants.isWeb) return;\n var hasDescription = document.getElementById((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.getAttribute(\"aria-describedby\"));\n if (!hasDescription) {\n console.warn(`\\`${CONTENT_NAME}\\` requires a description for the component to be accessible for screen reader users.\n \n You can add a description to the \\`${CONTENT_NAME}\\` by passing a \\`${DESCRIPTION_NAME}\\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n \n Alternatively, you can use your own component as a description by assigning it an \\`id\\` and passing the same value to the \\`aria-describedby\\` prop in \\`${CONTENT_NAME}\\`. If the description is confusing or duplicative for sighted users, you can use the \\`@radix-ui/react-visually-hidden\\` primitive as a wrapper around your description component.\n \n For more information, see https://tamagui.dev/docs/components/alert-dialog`);\n }\n }, [\n contentRef\n ]);\n }\n return null;\n};\nvar AlertDialogInner = function(props) {\n var { scope, native, ...alertDialogProps } = props;\n var dialogScope = getAlertDialogScope(scope);\n var nativeAlert = (0, import_useNativeAlertDialog.useNativeAlertDialog)(props);\n if (nativeAlert) return nativeAlert;\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog, {\n scope: dialogScope,\n ...alertDialogProps,\n modal: true\n });\n};\nvar AlertDialog = (0, import_helpers.withStaticProperties)(AlertDialogInner, {\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Overlay: AlertDialogOverlay,\n Content: AlertDialogContent,\n Action: AlertDialogAction,\n Cancel: AlertDialogCancel,\n Destructive: AlertDialogDestructive,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription\n});\nAlertDialog.displayName = ROOT_NAME;\n//# sourceMappingURL=AlertDialog.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,eA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ACD,IAAI,qBAAqB,SAAS,OAAO;CACvC,IAAI,EAAE,eAAe;CACrB,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC1C,MAAM,UAAU,WAAW;GACzB,IAAI;GACJ,IAAI,CAAC,iBAAiB,OAAO;GAC7B,IAAI,iBAAiB,SAAS,gBAAgB,sBAAsB,WAAW,aAAa,QAAQ,wBAAwB,KAAK,IAAI,KAAK,IAAI,oBAAoB,aAAa,kBAAkB,CAAC;GAClM,IAAI,CAAC,gBAAgB;IACnB,QAAQ,KAAK,KAAK,aAAa;;6CAEM,aAAa,oBAAoB,iBAAiB;;oKAEqE,aAAa;;mFAE9F;GAC7E;EACF,GAAG,CACD,UACF,CAAC;CACH;CACA,OAAO;AACT;AACA,IAAI,mBAAmB,SAAS,OAAO;CACrC,IAAI,EAAE,OAAO,QAAQ,GAAG,qBAAqB;CAC7C,IAAI,cAAc,oBAAoB,KAAK;CAC3C,IAAI,eAAe,GAAG,4BAA4B,qBAAoB,CAAE,KAAK;CAC7E,IAAI,aAAa,OAAO;CACxB,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,cAAc,QAAQ;EACvE,OAAO;EACP,GAAG;EACH,OAAO;CACT,CAAC;AACH;AACA,IAAI,eAAe,GAAG,eAAe,qBAAoB,CAAE,kBAAkB;CAC3E,SAAS;CACT,QAAQ;CACR,SAAS;CACT,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,OAAO;CACP,aAAa;AACf,CAAC;AACD,YAAY,cAAc"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const ALERT_DIALOG_PART = /* @__PURE__ */ Symbol("AlertDialogPart");
|
|
2
|
+
const markAlertDialogPart = (component, part) => {
|
|
3
|
+
Object.assign(component.staticConfig, { [ALERT_DIALOG_PART]: part });
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export { ALERT_DIALOG_PART, markAlertDialogPart };
|
|
7
|
+
//# sourceMappingURL=alertDialogPart.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alertDialogPart.js","names":[],"sources":["jsx/alertDialogPart.js"],"sourcesContent":["const ALERT_DIALOG_PART = /* @__PURE__ */ Symbol(\"AlertDialogPart\");\nconst markAlertDialogPart = (component, part) => {\n Object.assign(component.staticConfig, { [ALERT_DIALOG_PART]: part });\n};\nexport {\n ALERT_DIALOG_PART,\n markAlertDialogPart\n};\n//# sourceMappingURL=alertDialogPart.js.map\n"],"mappings":";AAAA,MAAM,oBAAoC,uBAAO,iBAAiB;AAClE,MAAM,uBAAuB,WAAW,SAAS;CAC/C,OAAO,OAAO,UAAU,cAAc,GAAG,oBAAoB,KAAK,CAAC;AACrE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
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, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
+
var alertDialogPart_exports = {};
|
|
24
|
+
__export(alertDialogPart_exports, {
|
|
25
|
+
ALERT_DIALOG_PART: () => ALERT_DIALOG_PART,
|
|
26
|
+
markAlertDialogPart: () => markAlertDialogPart
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(alertDialogPart_exports);
|
|
29
|
+
var ALERT_DIALOG_PART = /* @__PURE__ */ Symbol("AlertDialogPart");
|
|
30
|
+
var markAlertDialogPart = function(component, part) {
|
|
31
|
+
Object.assign(component.staticConfig, { [ALERT_DIALOG_PART]: part });
|
|
32
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
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, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
+
var alertDialogPart_exports = {};
|
|
24
|
+
__export(alertDialogPart_exports, {
|
|
25
|
+
ALERT_DIALOG_PART: () => ALERT_DIALOG_PART,
|
|
26
|
+
markAlertDialogPart: () => markAlertDialogPart
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(alertDialogPart_exports);
|
|
29
|
+
var ALERT_DIALOG_PART = /* @__PURE__ */ Symbol("AlertDialogPart");
|
|
30
|
+
var markAlertDialogPart = function(component, part) {
|
|
31
|
+
Object.assign(component.staticConfig, { [ALERT_DIALOG_PART]: part });
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=alertDialogPart.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alertDialogPart.native.js","names":[],"sources":["jsx/alertDialogPart.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\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 __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar alertDialogPart_exports = {};\n__export(alertDialogPart_exports, {\n ALERT_DIALOG_PART: () => ALERT_DIALOG_PART,\n markAlertDialogPart: () => markAlertDialogPart\n});\nmodule.exports = __toCommonJS(alertDialogPart_exports);\nvar ALERT_DIALOG_PART = /* @__PURE__ */ Symbol(\"AlertDialogPart\");\nvar markAlertDialogPart = function(component, part) {\n Object.assign(component.staticConfig, {\n [ALERT_DIALOG_PART]: part\n });\n};\n//# sourceMappingURL=alertDialogPart.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,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,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,0BAA0B,CAAC;AAC/B,SAAS,yBAAyB;CAChC,yBAAyB;CACzB,2BAA2B;AAC7B,CAAC;AACD,OAAO,UAAU,aAAa,uBAAuB;AACrD,IAAI,oBAAoC,uBAAO,iBAAiB;AAChE,IAAI,sBAAsB,SAAS,WAAW,MAAM;CAClD,OAAO,OAAO,UAAU,cAAc,GACnC,oBAAoB,KACvB,CAAC;AACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNativeAlertDialog.js","names":[],"sources":["jsx/useNativeAlertDialog.js"],"sourcesContent":["const useNativeAlertDialog = (_props) => null;\nexport {\n useNativeAlertDialog\n};\n//# sourceMappingURL=useNativeAlertDialog.js.map\n"],"mappings":";AAAA,MAAM,wBAAwB,WAAW"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
+
get: () => from[key],
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
25
|
+
value: mod,
|
|
26
|
+
enumerable: true
|
|
27
|
+
}) : target, mod));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var useNativeAlertDialog_native_exports = {};
|
|
30
|
+
__export(useNativeAlertDialog_native_exports, { useNativeAlertDialog: () => useNativeAlertDialog });
|
|
31
|
+
module.exports = __toCommonJS(useNativeAlertDialog_native_exports);
|
|
32
|
+
var import_constants = require("@tamagui/constants");
|
|
33
|
+
var import_core = require("@tamagui/core");
|
|
34
|
+
var import_use_controllable_state = require("@tamagui/use-controllable-state");
|
|
35
|
+
var React = __toESM(require("react"), 1);
|
|
36
|
+
var import_react_native = require("react-native");
|
|
37
|
+
var import_alertDialogPart = require("./alertDialogPart.native.js");
|
|
38
|
+
var useNativeAlertDialog = function(props) {
|
|
39
|
+
var { native } = props;
|
|
40
|
+
var [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
41
|
+
prop: props.open,
|
|
42
|
+
defaultProp: props.defaultOpen || false,
|
|
43
|
+
onChange: props.onOpenChange,
|
|
44
|
+
transition: true
|
|
45
|
+
});
|
|
46
|
+
var triggerElement = null;
|
|
47
|
+
var title = "";
|
|
48
|
+
var description = "";
|
|
49
|
+
var buttons = [];
|
|
50
|
+
forEachChildDeep(React.Children.toArray(props.children), function(child) {
|
|
51
|
+
if (!/* @__PURE__ */ React.isValidElement(child)) return false;
|
|
52
|
+
var part = (0, import_core.isTamaguiElement)(child) ? child.type.staticConfig[import_alertDialogPart.ALERT_DIALOG_PART] : void 0;
|
|
53
|
+
switch (part) {
|
|
54
|
+
case "trigger": {
|
|
55
|
+
triggerElement = /* @__PURE__ */ React.cloneElement(child, { __native: true });
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
case "title": {
|
|
59
|
+
title = getStringChildren(child);
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
case "description": {
|
|
63
|
+
description = getStringChildren(child);
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
case "action":
|
|
67
|
+
case "destructive":
|
|
68
|
+
case "cancel": {
|
|
69
|
+
var style = part === "action" ? "default" : part === "destructive" ? "destructive" : "cancel";
|
|
70
|
+
var text = getStringChildren(child);
|
|
71
|
+
var onPress = function() {
|
|
72
|
+
var _childProps_onPress;
|
|
73
|
+
var childProps = child.props;
|
|
74
|
+
childProps === null || childProps === void 0 ? void 0 : (_childProps_onPress = childProps.onPress) === null || _childProps_onPress === void 0 ? void 0 : _childProps_onPress.call(childProps, { native: true });
|
|
75
|
+
setOpen(false);
|
|
76
|
+
};
|
|
77
|
+
buttons.push({
|
|
78
|
+
style,
|
|
79
|
+
text,
|
|
80
|
+
onPress
|
|
81
|
+
});
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
default: {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
(0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
90
|
+
if (!open || !native) return;
|
|
91
|
+
if (title || description) {
|
|
92
|
+
import_react_native.Alert.alert(title, description, buttons);
|
|
93
|
+
}
|
|
94
|
+
}, [native, open]);
|
|
95
|
+
if (native) {
|
|
96
|
+
return /* @__PURE__ */ React.cloneElement(triggerElement, { __onPress: function() {
|
|
97
|
+
setOpen(true);
|
|
98
|
+
} });
|
|
99
|
+
}
|
|
100
|
+
return null;
|
|
101
|
+
};
|
|
102
|
+
function forEachChildDeep(children, onChild) {
|
|
103
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
104
|
+
try {
|
|
105
|
+
for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
106
|
+
var child = _step.value;
|
|
107
|
+
if (!/* @__PURE__ */ React.isValidElement(child)) continue;
|
|
108
|
+
if (!onChild(child)) continue;
|
|
109
|
+
var childProps = child.props;
|
|
110
|
+
if (childProps.children) {
|
|
111
|
+
forEachChildDeep(React.Children.toArray(childProps.children), onChild);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
} catch (err) {
|
|
115
|
+
_didIteratorError = true;
|
|
116
|
+
_iteratorError = err;
|
|
117
|
+
} finally {
|
|
118
|
+
try {
|
|
119
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
120
|
+
_iterator.return();
|
|
121
|
+
}
|
|
122
|
+
} finally {
|
|
123
|
+
if (_didIteratorError) {
|
|
124
|
+
throw _iteratorError;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function getStringChildren(child) {
|
|
130
|
+
var string = "";
|
|
131
|
+
forEachChildDeep(React.Children.toArray(child), function(child2) {
|
|
132
|
+
if (typeof child2.props.children === "string") {
|
|
133
|
+
string = child2.props.children;
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
return true;
|
|
137
|
+
});
|
|
138
|
+
return string;
|
|
139
|
+
}
|