@capgo/capacitor-pretty-toast 8.1.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.
Files changed (85) hide show
  1. package/CapgoCapacitorPrettyToast.podspec +17 -0
  2. package/LICENSE +373 -0
  3. package/Package.swift +28 -0
  4. package/README.md +341 -0
  5. package/android/build.gradle +71 -0
  6. package/android/src/main/AndroidManifest.xml +6 -0
  7. package/android/src/main/java/com/toast/PrettyToastPlugin.kt +197 -0
  8. package/android/src/main/java/com/toast/ToastOverlay.kt +495 -0
  9. package/android/src/main/java/com/toast/anim/CutoutMorphAnimator.kt +235 -0
  10. package/android/src/main/java/com/toast/anim/SlideAnimator.kt +64 -0
  11. package/android/src/main/java/com/toast/anim/ToastAnimator.kt +23 -0
  12. package/android/src/main/java/com/toast/backdrop/BackdropSampler.kt +142 -0
  13. package/android/src/main/java/com/toast/backdrop/OutlineController.kt +100 -0
  14. package/android/src/main/java/com/toast/cutout/CutoutDetector.kt +88 -0
  15. package/android/src/main/java/com/toast/cutout/CutoutInfo.kt +28 -0
  16. package/android/src/main/java/com/toast/gesture/ToastGestureHandler.kt +68 -0
  17. package/android/src/main/java/com/toast/ui/IconMapper.kt +26 -0
  18. package/android/src/main/java/com/toast/ui/PassThroughFrameLayout.kt +53 -0
  19. package/android/src/main/java/com/toast/ui/ToastViewFactory.kt +224 -0
  20. package/android/src/main/java/com/toast/util/Density.kt +17 -0
  21. package/android/src/main/java/com/toast/util/StatusBarController.kt +24 -0
  22. package/android/src/main/java/com/toast/util/ToastConstants.kt +36 -0
  23. package/android/src/main/res/.gitkeep +0 -0
  24. package/android/src/main/res/drawable/ic_arrow_downward.xml +9 -0
  25. package/android/src/main/res/drawable/ic_arrow_upward.xml +9 -0
  26. package/android/src/main/res/drawable/ic_cancel.xml +9 -0
  27. package/android/src/main/res/drawable/ic_check_circle.xml +9 -0
  28. package/android/src/main/res/drawable/ic_favorite.xml +9 -0
  29. package/android/src/main/res/drawable/ic_info.xml +9 -0
  30. package/android/src/main/res/drawable/ic_mail.xml +9 -0
  31. package/android/src/main/res/drawable/ic_notifications.xml +9 -0
  32. package/android/src/main/res/drawable/ic_touch_app.xml +9 -0
  33. package/android/src/main/res/drawable/ic_warning.xml +9 -0
  34. package/android/src/main/res/drawable/ic_wifi.xml +9 -0
  35. package/android/src/main/res/values/colors.xml +3 -0
  36. package/android/src/main/res/values/strings.xml +3 -0
  37. package/android/src/main/res/values/styles.xml +3 -0
  38. package/android/src/test/java/com/toast/PrettyToastPluginTest.kt +26 -0
  39. package/dist/docs.json +459 -0
  40. package/dist/esm/controller.d.ts +30 -0
  41. package/dist/esm/controller.js +271 -0
  42. package/dist/esm/controller.js.map +1 -0
  43. package/dist/esm/definitions.d.ts +144 -0
  44. package/dist/esm/definitions.js +2 -0
  45. package/dist/esm/definitions.js.map +1 -0
  46. package/dist/esm/driver.d.ts +19 -0
  47. package/dist/esm/driver.js +24 -0
  48. package/dist/esm/driver.js.map +1 -0
  49. package/dist/esm/icons.d.ts +14 -0
  50. package/dist/esm/icons.js +138 -0
  51. package/dist/esm/icons.js.map +1 -0
  52. package/dist/esm/index.d.ts +2 -0
  53. package/dist/esm/index.js +2 -0
  54. package/dist/esm/index.js.map +1 -0
  55. package/dist/esm/internal-plugin.d.ts +2 -0
  56. package/dist/esm/internal-plugin.js +5 -0
  57. package/dist/esm/internal-plugin.js.map +1 -0
  58. package/dist/esm/internal-types.d.ts +31 -0
  59. package/dist/esm/internal-types.js +2 -0
  60. package/dist/esm/internal-types.js.map +1 -0
  61. package/dist/esm/toast.d.ts +1 -0
  62. package/dist/esm/toast.js +5 -0
  63. package/dist/esm/toast.js.map +1 -0
  64. package/dist/esm/web-renderer.d.ts +36 -0
  65. package/dist/esm/web-renderer.js +296 -0
  66. package/dist/esm/web-renderer.js.map +1 -0
  67. package/dist/esm/web.d.ts +10 -0
  68. package/dist/esm/web.js +28 -0
  69. package/dist/esm/web.js.map +1 -0
  70. package/dist/plugin.cjs.js +770 -0
  71. package/dist/plugin.cjs.js.map +1 -0
  72. package/dist/plugin.js +773 -0
  73. package/dist/plugin.js.map +1 -0
  74. package/ios/Sources/PrettyToastPlugin/CustomHostingView.swift +13 -0
  75. package/ios/Sources/PrettyToastPlugin/PassThroughWindow.swift +143 -0
  76. package/ios/Sources/PrettyToastPlugin/PrettyToastColorParser.swift +94 -0
  77. package/ios/Sources/PrettyToastPlugin/PrettyToastPlugin.swift +138 -0
  78. package/ios/Sources/PrettyToastPlugin/PrettyToastView.swift +267 -0
  79. package/ios/Sources/PrettyToastPlugin/Toast.swift +29 -0
  80. package/ios/Sources/PrettyToastPlugin/ToastManager.swift +392 -0
  81. package/ios/Tests/PrettyToastPluginTests/PrettyToastPluginTests.swift +21 -0
  82. package/package.json +98 -0
  83. package/scripts/check-capacitor-plugin-wiring.mjs +254 -0
  84. package/scripts/deploy-example-capgo.mjs +86 -0
  85. package/scripts/test-ios.sh +14 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { InternalPrettyToastPlugin } from './internal-types';
2
+ export declare const PrettyToastBridge: InternalPrettyToastPlugin;
@@ -0,0 +1,5 @@
1
+ import { registerPlugin } from '@capacitor/core';
2
+ export const PrettyToastBridge = registerPlugin('PrettyToast', {
3
+ web: () => import('./web').then((module) => new module.PrettyToastWeb()),
4
+ });
5
+ //# sourceMappingURL=internal-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-plugin.js","sourceRoot":"","sources":["../../src/internal-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAA4B,aAAa,EAAE;IACxF,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;CACzE,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { PluginListenerHandle } from '@capacitor/core';
2
+ export interface InternalToastPayload {
3
+ id: string;
4
+ icon: string;
5
+ iconUri: string;
6
+ webIconUri: string;
7
+ iconSvg: string;
8
+ title: string;
9
+ message: string;
10
+ duration: number;
11
+ autoDismiss: boolean;
12
+ enableSwipeDismiss: boolean;
13
+ useDynamicIsland: boolean;
14
+ accentColor?: string;
15
+ strokeColor?: string;
16
+ disableBackdropSampling: boolean;
17
+ actionLabel: string;
18
+ accessibilityAnnouncement: string;
19
+ }
20
+ export interface ToastBridgeEvent {
21
+ id: string;
22
+ }
23
+ export interface InternalPrettyToastPlugin {
24
+ showCurrentToast(options: InternalToastPayload): Promise<void>;
25
+ updateCurrentToast(options: InternalToastPayload): Promise<void>;
26
+ dismissCurrentToast(options?: {
27
+ id?: string;
28
+ }): Promise<void>;
29
+ addListener(eventName: 'toastDismiss' | 'toastPress' | 'toastActionPress', listenerFunc: (event: ToastBridgeEvent) => void): Promise<PluginListenerHandle>;
30
+ removeAllListeners(): Promise<void>;
31
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=internal-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-types.js","sourceRoot":"","sources":["../../src/internal-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export declare const toast: import("./definitions").PrettyToastPlugin;
@@ -0,0 +1,5 @@
1
+ import { ToastController } from './controller';
2
+ import { CapacitorToastDriver } from './driver';
3
+ const controller = new ToastController(new CapacitorToastDriver());
4
+ export const toast = controller.ref;
5
+ //# sourceMappingURL=toast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast.js","sourceRoot":"","sources":["../../src/toast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,UAAU,GAAG,IAAI,eAAe,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { InternalToastPayload } from './internal-types';
2
+ interface WebToastRendererEvents {
3
+ onDismiss: (id: string) => void;
4
+ onPress: (id: string) => void;
5
+ onActionPress: (id: string) => void;
6
+ }
7
+ export declare class WebToastRenderer {
8
+ private readonly events;
9
+ private current;
10
+ private root;
11
+ private iconSlot;
12
+ private titleNode;
13
+ private messageNode;
14
+ private actionButton;
15
+ private autoDismissTimer;
16
+ private exitTimer;
17
+ private prefersDark;
18
+ private dragStartY;
19
+ private dragY;
20
+ private isDragging;
21
+ constructor(events: WebToastRendererEvents);
22
+ show(payload: InternalToastPayload): void;
23
+ update(payload: InternalToastPayload): void;
24
+ dismiss(id?: string): void;
25
+ private ensureElements;
26
+ private render;
27
+ private armAutoDismiss;
28
+ private startExit;
29
+ private applyEnteringState;
30
+ private handlePointerDown;
31
+ private handlePointerMove;
32
+ private handlePointerUp;
33
+ private clearAutoDismissTimer;
34
+ private clearExitTimer;
35
+ }
36
+ export {};
@@ -0,0 +1,296 @@
1
+ import { DEFAULT_ICON_SYMBOL, getSymbolIcon, parseSvgElement } from './icons';
2
+ const ENTER_MS = 450;
3
+ const EXIT_MS = 350;
4
+ const ENTER_EASING = 'cubic-bezier(0.22, 1.2, 0.36, 1)';
5
+ const EXIT_EASING = 'cubic-bezier(0.4, 0, 0.2, 1)';
6
+ const SWIPE_THRESHOLD = -40;
7
+ export class WebToastRenderer {
8
+ constructor(events) {
9
+ this.events = events;
10
+ this.current = null;
11
+ this.root = null;
12
+ this.iconSlot = null;
13
+ this.titleNode = null;
14
+ this.messageNode = null;
15
+ this.actionButton = null;
16
+ this.autoDismissTimer = null;
17
+ this.exitTimer = null;
18
+ this.prefersDark = false;
19
+ this.dragStartY = null;
20
+ this.dragY = 0;
21
+ this.isDragging = false;
22
+ if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') {
23
+ this.prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
24
+ }
25
+ }
26
+ show(payload) {
27
+ this.current = payload;
28
+ this.clearExitTimer();
29
+ this.clearAutoDismissTimer();
30
+ this.dragStartY = null;
31
+ this.dragY = 0;
32
+ this.isDragging = false;
33
+ this.ensureElements();
34
+ this.render(payload);
35
+ this.applyEnteringState();
36
+ requestAnimationFrame(() => {
37
+ var _a;
38
+ if (!this.root || ((_a = this.current) === null || _a === void 0 ? void 0 : _a.id) !== payload.id)
39
+ return;
40
+ this.root.style.transform = 'translate(-50%, 0) scale(1)';
41
+ this.root.style.opacity = '1';
42
+ });
43
+ this.armAutoDismiss(payload);
44
+ }
45
+ update(payload) {
46
+ if (!this.root || !this.current || this.current.id !== payload.id)
47
+ return;
48
+ this.current = payload;
49
+ this.render(payload);
50
+ this.armAutoDismiss(payload);
51
+ }
52
+ dismiss(id) {
53
+ if (!this.current || (id && this.current.id !== id) || !this.root)
54
+ return;
55
+ this.clearAutoDismissTimer();
56
+ this.startExit();
57
+ }
58
+ ensureElements() {
59
+ if (typeof document === 'undefined')
60
+ return;
61
+ if (this.root) {
62
+ if (!this.root.isConnected) {
63
+ document.body.appendChild(this.root);
64
+ }
65
+ return;
66
+ }
67
+ const root = document.createElement('div');
68
+ root.setAttribute('role', 'status');
69
+ root.setAttribute('aria-live', 'polite');
70
+ root.style.position = 'fixed';
71
+ root.style.top = 'calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 10px)';
72
+ root.style.left = '50%';
73
+ root.style.zIndex = '2147483647';
74
+ root.style.width = 'min(360px, calc(100vw - 20px))';
75
+ root.style.boxSizing = 'border-box';
76
+ root.style.background = '#000';
77
+ root.style.borderRadius = '30px';
78
+ root.style.padding = '14px 20px';
79
+ root.style.display = 'flex';
80
+ root.style.alignItems = 'center';
81
+ root.style.gap = '10px';
82
+ root.style.fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';
83
+ root.style.userSelect = 'none';
84
+ root.style.touchAction = 'none';
85
+ root.style.boxShadow = '0 10px 30px rgba(0, 0, 0, 0.35)';
86
+ root.style.transform = 'translate(-50%, -40px) scale(0.8)';
87
+ root.style.opacity = '0';
88
+ root.style.transition = `transform ${ENTER_MS}ms ${ENTER_EASING}, opacity ${ENTER_MS}ms ${ENTER_EASING}`;
89
+ root.addEventListener('pointerdown', (event) => this.handlePointerDown(event));
90
+ root.addEventListener('pointermove', (event) => this.handlePointerMove(event));
91
+ root.addEventListener('pointerup', (event) => this.handlePointerUp(event));
92
+ root.addEventListener('pointercancel', (event) => this.handlePointerUp(event));
93
+ root.addEventListener('click', () => {
94
+ if (!this.current || this.dragY < -4)
95
+ return;
96
+ this.events.onPress(this.current.id);
97
+ });
98
+ const iconSlot = document.createElement('div');
99
+ iconSlot.style.width = '50px';
100
+ iconSlot.style.flexShrink = '0';
101
+ iconSlot.style.display = 'flex';
102
+ iconSlot.style.alignItems = 'center';
103
+ iconSlot.style.justifyContent = 'center';
104
+ iconSlot.style.fontSize = '35px';
105
+ iconSlot.style.lineHeight = '1';
106
+ const textWrap = document.createElement('div');
107
+ textWrap.style.flex = '1';
108
+ textWrap.style.minWidth = '0';
109
+ const titleNode = document.createElement('div');
110
+ titleNode.style.color = '#fff';
111
+ titleNode.style.fontWeight = '600';
112
+ titleNode.style.fontSize = '15px';
113
+ titleNode.style.lineHeight = '20px';
114
+ titleNode.style.wordBreak = 'break-word';
115
+ const messageNode = document.createElement('div');
116
+ messageNode.style.color = 'rgba(255, 255, 255, 0.6)';
117
+ messageNode.style.fontSize = '12px';
118
+ messageNode.style.lineHeight = '16px';
119
+ messageNode.style.wordBreak = 'break-word';
120
+ textWrap.appendChild(titleNode);
121
+ textWrap.appendChild(messageNode);
122
+ const actionButton = document.createElement('button');
123
+ actionButton.type = 'button';
124
+ actionButton.style.flexShrink = '0';
125
+ actionButton.style.marginLeft = '4px';
126
+ actionButton.style.padding = '6px 12px';
127
+ actionButton.style.background = 'rgba(255,255,255,0.12)';
128
+ actionButton.style.border = 'none';
129
+ actionButton.style.borderRadius = '999px';
130
+ actionButton.style.fontSize = '13px';
131
+ actionButton.style.fontWeight = '600';
132
+ actionButton.style.cursor = 'pointer';
133
+ actionButton.style.display = 'none';
134
+ actionButton.addEventListener('click', (event) => {
135
+ event.stopPropagation();
136
+ if (!this.current)
137
+ return;
138
+ this.events.onActionPress(this.current.id);
139
+ });
140
+ actionButton.addEventListener('pointerdown', (event) => event.stopPropagation());
141
+ root.appendChild(iconSlot);
142
+ root.appendChild(textWrap);
143
+ root.appendChild(actionButton);
144
+ document.body.appendChild(root);
145
+ this.root = root;
146
+ this.iconSlot = iconSlot;
147
+ this.titleNode = titleNode;
148
+ this.messageNode = messageNode;
149
+ this.actionButton = actionButton;
150
+ }
151
+ render(payload) {
152
+ var _a, _b, _c;
153
+ if (!this.root || !this.iconSlot || !this.titleNode || !this.messageNode || !this.actionButton) {
154
+ return;
155
+ }
156
+ const symbolInfo = getSymbolIcon(payload.icon);
157
+ const accentColor = (_a = payload.accentColor) !== null && _a !== void 0 ? _a : symbolInfo.color;
158
+ const outline = payload.strokeColor
159
+ ? payload.strokeColor
160
+ : payload.disableBackdropSampling
161
+ ? 'rgba(255,255,255,0.06)'
162
+ : this.prefersDark
163
+ ? `color-mix(in srgb, ${accentColor} 20%, transparent)`
164
+ : '';
165
+ this.root.style.border = outline ? `2px solid ${outline}` : 'none';
166
+ this.root.style.cursor = payload.actionLabel || payload.icon ? 'pointer' : 'default';
167
+ this.root.setAttribute('aria-label', payload.accessibilityAnnouncement || '');
168
+ this.iconSlot.style.color = accentColor;
169
+ this.iconSlot.replaceChildren();
170
+ const renderableUri = payload.webIconUri || payload.iconUri;
171
+ if (renderableUri) {
172
+ const image = document.createElement('img');
173
+ image.src = renderableUri;
174
+ image.alt = '';
175
+ image.style.width = '40px';
176
+ image.style.height = '40px';
177
+ image.style.objectFit = 'contain';
178
+ this.iconSlot.appendChild(image);
179
+ }
180
+ else if (payload.iconSvg) {
181
+ const svg = parseSvgElement(payload.iconSvg);
182
+ if (svg) {
183
+ this.iconSlot.appendChild(svg);
184
+ }
185
+ else {
186
+ this.iconSlot.textContent = (_b = getSymbolIcon(payload.icon || DEFAULT_ICON_SYMBOL).glyph) !== null && _b !== void 0 ? _b : '';
187
+ }
188
+ }
189
+ else {
190
+ const glyph = (_c = symbolInfo.glyph) !== null && _c !== void 0 ? _c : getSymbolIcon(DEFAULT_ICON_SYMBOL).glyph;
191
+ if (glyph) {
192
+ this.iconSlot.textContent = glyph;
193
+ }
194
+ else {
195
+ this.iconSlot.innerHTML =
196
+ '<svg width="28" height="28" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.25a1 1 0 0 1 1 1v.6a7 7 0 0 1 6 6.93v3.36l1.38 2.07A1.25 1.25 0 0 1 19.34 18H4.66a1.25 1.25 0 0 1-1.04-1.94L5 14v-3.22a7 7 0 0 1 6-6.93v-.6a1 1 0 0 1 1-1Zm-2.5 17.25a2.5 2.5 0 0 0 5 0h-5Z" /></svg>';
197
+ }
198
+ }
199
+ this.titleNode.textContent = payload.title;
200
+ this.titleNode.style.display = payload.title ? 'block' : 'none';
201
+ this.messageNode.textContent = payload.message;
202
+ this.messageNode.style.display = payload.message ? 'block' : 'none';
203
+ this.messageNode.style.marginTop = payload.title && payload.message ? '4px' : '0';
204
+ this.actionButton.textContent = payload.actionLabel;
205
+ this.actionButton.style.color = accentColor;
206
+ this.actionButton.style.display = payload.actionLabel ? 'inline-flex' : 'none';
207
+ }
208
+ armAutoDismiss(payload) {
209
+ this.clearAutoDismissTimer();
210
+ if (!payload.autoDismiss || payload.duration <= 0)
211
+ return;
212
+ this.autoDismissTimer = setTimeout(() => {
213
+ this.startExit();
214
+ }, payload.duration);
215
+ }
216
+ startExit() {
217
+ if (!this.root || !this.current || this.exitTimer)
218
+ return;
219
+ const currentId = this.current.id;
220
+ this.root.style.transition = `transform ${EXIT_MS}ms ${EXIT_EASING}, opacity ${EXIT_MS}ms ${EXIT_EASING}`;
221
+ this.root.style.transform = `translate(-50%, ${this.dragY - 40}px) scale(1)`;
222
+ this.root.style.opacity = '0';
223
+ this.exitTimer = setTimeout(() => {
224
+ var _a;
225
+ this.exitTimer = null;
226
+ this.clearAutoDismissTimer();
227
+ this.dragY = 0;
228
+ this.isDragging = false;
229
+ this.dragStartY = null;
230
+ if ((_a = this.root) === null || _a === void 0 ? void 0 : _a.isConnected) {
231
+ this.root.remove();
232
+ }
233
+ this.root = null;
234
+ this.iconSlot = null;
235
+ this.titleNode = null;
236
+ this.messageNode = null;
237
+ this.actionButton = null;
238
+ this.current = null;
239
+ this.events.onDismiss(currentId);
240
+ }, EXIT_MS);
241
+ }
242
+ applyEnteringState() {
243
+ if (!this.root)
244
+ return;
245
+ this.root.style.transition = `transform ${ENTER_MS}ms ${ENTER_EASING}, opacity ${ENTER_MS}ms ${ENTER_EASING}`;
246
+ this.root.style.transform = 'translate(-50%, -40px) scale(0.8)';
247
+ this.root.style.opacity = '0';
248
+ }
249
+ handlePointerDown(event) {
250
+ var _a, _b;
251
+ if (event.button !== 0)
252
+ return;
253
+ this.dragStartY = event.clientY;
254
+ this.dragY = 0;
255
+ (_b = (_a = this.root) === null || _a === void 0 ? void 0 : _a.setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
256
+ }
257
+ handlePointerMove(event) {
258
+ if (!this.root || this.dragStartY === null)
259
+ return;
260
+ const nextDragY = Math.min(0, event.clientY - this.dragStartY);
261
+ this.dragY = nextDragY;
262
+ this.isDragging = nextDragY < -2;
263
+ if (!this.isDragging)
264
+ return;
265
+ this.root.style.transition = 'none';
266
+ this.root.style.transform = `translate(-50%, ${nextDragY}px) scale(1)`;
267
+ }
268
+ handlePointerUp(event) {
269
+ var _a, _b;
270
+ if (!this.root || this.dragStartY === null)
271
+ return;
272
+ this.dragStartY = null;
273
+ (_b = (_a = this.root).releasePointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);
274
+ if (this.dragY < SWIPE_THRESHOLD) {
275
+ this.startExit();
276
+ return;
277
+ }
278
+ this.isDragging = false;
279
+ this.dragY = 0;
280
+ this.root.style.transition = `transform ${EXIT_MS}ms ${EXIT_EASING}, opacity ${EXIT_MS}ms ${EXIT_EASING}`;
281
+ this.root.style.transform = 'translate(-50%, 0) scale(1)';
282
+ }
283
+ clearAutoDismissTimer() {
284
+ if (!this.autoDismissTimer)
285
+ return;
286
+ clearTimeout(this.autoDismissTimer);
287
+ this.autoDismissTimer = null;
288
+ }
289
+ clearExitTimer() {
290
+ if (!this.exitTimer)
291
+ return;
292
+ clearTimeout(this.exitTimer);
293
+ this.exitTimer = null;
294
+ }
295
+ }
296
+ //# sourceMappingURL=web-renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-renderer.js","sourceRoot":"","sources":["../../src/web-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG9E,MAAM,QAAQ,GAAG,GAAG,CAAC;AACrB,MAAM,OAAO,GAAG,GAAG,CAAC;AACpB,MAAM,YAAY,GAAG,kCAAkC,CAAC;AACxD,MAAM,WAAW,GAAG,8BAA8B,CAAC;AACnD,MAAM,eAAe,GAAG,CAAC,EAAE,CAAC;AAQ5B,MAAM,OAAO,gBAAgB;IAc3B,YAA6B,MAA8B;QAA9B,WAAM,GAAN,MAAM,CAAwB;QAbnD,YAAO,GAAgC,IAAI,CAAC;QAC5C,SAAI,GAA0B,IAAI,CAAC;QACnC,aAAQ,GAA0B,IAAI,CAAC;QACvC,cAAS,GAA0B,IAAI,CAAC;QACxC,gBAAW,GAA0B,IAAI,CAAC;QAC1C,iBAAY,GAA6B,IAAI,CAA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E,OAAO;QAC5B,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;CACF"}
@@ -0,0 +1,10 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ import type { InternalPrettyToastPlugin, InternalToastPayload } from './internal-types';
3
+ export declare class PrettyToastWeb extends WebPlugin implements InternalPrettyToastPlugin {
4
+ private readonly renderer;
5
+ showCurrentToast(options: InternalToastPayload): Promise<void>;
6
+ updateCurrentToast(options: InternalToastPayload): Promise<void>;
7
+ dismissCurrentToast(options?: {
8
+ id?: string;
9
+ }): Promise<void>;
10
+ }
@@ -0,0 +1,28 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ import { WebToastRenderer } from './web-renderer';
3
+ export class PrettyToastWeb extends WebPlugin {
4
+ constructor() {
5
+ super(...arguments);
6
+ this.renderer = new WebToastRenderer({
7
+ onDismiss: (id) => {
8
+ this.notifyListeners('toastDismiss', { id });
9
+ },
10
+ onPress: (id) => {
11
+ this.notifyListeners('toastPress', { id });
12
+ },
13
+ onActionPress: (id) => {
14
+ this.notifyListeners('toastActionPress', { id });
15
+ },
16
+ });
17
+ }
18
+ async showCurrentToast(options) {
19
+ this.renderer.show(options);
20
+ }
21
+ async updateCurrentToast(options) {
22
+ this.renderer.update(options);
23
+ }
24
+ async dismissCurrentToast(options) {
25
+ this.renderer.dismiss(options === null || options === void 0 ? void 0 : options.id);
26
+ }
27
+ }
28
+ //# sourceMappingURL=web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,OAAO,cAAe,SAAQ,SAAS;IAA7C;;QACmB,aAAQ,GAAG,IAAI,gBAAgB,CAAC;YAC/C,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE;gBAChB,IAAI,CAAC,eAAe,CAAC,cAAc,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;YAC/C,CAAC;YACD,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE;gBACd,IAAI,CAAC,eAAe,CAAC,YAAY,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;YAC7C,CAAC;YACD,aAAa,EAAE,CAAC,EAAE,EAAE,EAAE;gBACpB,IAAI,CAAC,eAAe,CAAC,kBAAkB,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;YACnD,CAAC;SACF,CAAC,CAAC;IAaL,CAAC;IAXC,KAAK,CAAC,gBAAgB,CAAC,OAA6B;QAClD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,OAA6B;QACpD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,OAAyB;QACjD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,EAAE,CAAC,CAAC;IACrC,CAAC;CACF"}