@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.
- package/CapgoCapacitorPrettyToast.podspec +17 -0
- package/LICENSE +373 -0
- package/Package.swift +28 -0
- package/README.md +341 -0
- package/android/build.gradle +71 -0
- package/android/src/main/AndroidManifest.xml +6 -0
- package/android/src/main/java/com/toast/PrettyToastPlugin.kt +197 -0
- package/android/src/main/java/com/toast/ToastOverlay.kt +495 -0
- package/android/src/main/java/com/toast/anim/CutoutMorphAnimator.kt +235 -0
- package/android/src/main/java/com/toast/anim/SlideAnimator.kt +64 -0
- package/android/src/main/java/com/toast/anim/ToastAnimator.kt +23 -0
- package/android/src/main/java/com/toast/backdrop/BackdropSampler.kt +142 -0
- package/android/src/main/java/com/toast/backdrop/OutlineController.kt +100 -0
- package/android/src/main/java/com/toast/cutout/CutoutDetector.kt +88 -0
- package/android/src/main/java/com/toast/cutout/CutoutInfo.kt +28 -0
- package/android/src/main/java/com/toast/gesture/ToastGestureHandler.kt +68 -0
- package/android/src/main/java/com/toast/ui/IconMapper.kt +26 -0
- package/android/src/main/java/com/toast/ui/PassThroughFrameLayout.kt +53 -0
- package/android/src/main/java/com/toast/ui/ToastViewFactory.kt +224 -0
- package/android/src/main/java/com/toast/util/Density.kt +17 -0
- package/android/src/main/java/com/toast/util/StatusBarController.kt +24 -0
- package/android/src/main/java/com/toast/util/ToastConstants.kt +36 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/android/src/main/res/drawable/ic_arrow_downward.xml +9 -0
- package/android/src/main/res/drawable/ic_arrow_upward.xml +9 -0
- package/android/src/main/res/drawable/ic_cancel.xml +9 -0
- package/android/src/main/res/drawable/ic_check_circle.xml +9 -0
- package/android/src/main/res/drawable/ic_favorite.xml +9 -0
- package/android/src/main/res/drawable/ic_info.xml +9 -0
- package/android/src/main/res/drawable/ic_mail.xml +9 -0
- package/android/src/main/res/drawable/ic_notifications.xml +9 -0
- package/android/src/main/res/drawable/ic_touch_app.xml +9 -0
- package/android/src/main/res/drawable/ic_warning.xml +9 -0
- package/android/src/main/res/drawable/ic_wifi.xml +9 -0
- package/android/src/main/res/values/colors.xml +3 -0
- package/android/src/main/res/values/strings.xml +3 -0
- package/android/src/main/res/values/styles.xml +3 -0
- package/android/src/test/java/com/toast/PrettyToastPluginTest.kt +26 -0
- package/dist/docs.json +459 -0
- package/dist/esm/controller.d.ts +30 -0
- package/dist/esm/controller.js +271 -0
- package/dist/esm/controller.js.map +1 -0
- package/dist/esm/definitions.d.ts +144 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/driver.d.ts +19 -0
- package/dist/esm/driver.js +24 -0
- package/dist/esm/driver.js.map +1 -0
- package/dist/esm/icons.d.ts +14 -0
- package/dist/esm/icons.js +138 -0
- package/dist/esm/icons.js.map +1 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal-plugin.d.ts +2 -0
- package/dist/esm/internal-plugin.js +5 -0
- package/dist/esm/internal-plugin.js.map +1 -0
- package/dist/esm/internal-types.d.ts +31 -0
- package/dist/esm/internal-types.js +2 -0
- package/dist/esm/internal-types.js.map +1 -0
- package/dist/esm/toast.d.ts +1 -0
- package/dist/esm/toast.js +5 -0
- package/dist/esm/toast.js.map +1 -0
- package/dist/esm/web-renderer.d.ts +36 -0
- package/dist/esm/web-renderer.js +296 -0
- package/dist/esm/web-renderer.js.map +1 -0
- package/dist/esm/web.d.ts +10 -0
- package/dist/esm/web.js +28 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +770 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +773 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/PrettyToastPlugin/CustomHostingView.swift +13 -0
- package/ios/Sources/PrettyToastPlugin/PassThroughWindow.swift +143 -0
- package/ios/Sources/PrettyToastPlugin/PrettyToastColorParser.swift +94 -0
- package/ios/Sources/PrettyToastPlugin/PrettyToastPlugin.swift +138 -0
- package/ios/Sources/PrettyToastPlugin/PrettyToastView.swift +267 -0
- package/ios/Sources/PrettyToastPlugin/Toast.swift +29 -0
- package/ios/Sources/PrettyToastPlugin/ToastManager.swift +392 -0
- package/ios/Tests/PrettyToastPluginTests/PrettyToastPluginTests.swift +21 -0
- package/package.json +98 -0
- package/scripts/check-capacitor-plugin-wiring.mjs +254 -0
- package/scripts/deploy-example-capgo.mjs +86 -0
- package/scripts/test-ios.sh +14 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/icons.js","esm/controller.js","esm/internal-plugin.js","esm/driver.js","esm/toast.js","esm/web-renderer.js","esm/web.js"],"sourcesContent":["const ICON_MAP = [\n ['checkmark', { glyph: '✓', color: '#30D158' }],\n ['xmark', { glyph: '✕', color: '#FF453A' }],\n ['info', { glyph: 'ℹ', color: '#0A84FF' }],\n ['exclamation', { glyph: '!', color: '#FF9F0A' }],\n ['heart', { glyph: '♥', color: '#FF375F' }],\n ['arrow.up', { glyph: '↑', color: '#0A84FF' }],\n ['arrow.down', { glyph: '↓', color: '#0A84FF' }],\n ['arrow', { glyph: '↑', color: '#0A84FF' }],\n ['envelope', { glyph: '✉', color: '#FFFFFF' }],\n ['mail', { glyph: '✉', color: '#FFFFFF' }],\n ['wifi', { glyph: '◉', color: '#FFFFFF' }],\n];\nexport const DEFAULT_ICON_SYMBOL = 'bell.badge.fill';\nconst svgRasterCache = new Map();\nexport function isSvgIcon(value) {\n return typeof value === 'string' && value.trimStart().startsWith('<svg');\n}\nexport function normalizeIconSource(source) {\n if (!source)\n return undefined;\n if (typeof source === 'string') {\n return source.trim() || undefined;\n }\n if (typeof source.uri === 'string') {\n return source.uri.trim() || undefined;\n }\n return undefined;\n}\nexport function getSymbolIcon(symbol) {\n const normalized = symbol !== null && symbol !== void 0 ? symbol : '';\n for (const [key, info] of ICON_MAP) {\n if (normalized.includes(key))\n return info;\n }\n return { glyph: null, color: '#FFFFFF' };\n}\nexport function getAccessibilityAnnouncement(config) {\n if (config.accessibilityAnnouncement !== undefined) {\n return config.accessibilityAnnouncement;\n }\n return [config.title, config.message].filter(Boolean).join('. ');\n}\nexport function isNativeSafeIconUri(uri) {\n if (!uri)\n return false;\n return (uri.startsWith('https://') ||\n uri.startsWith('http://') ||\n uri.startsWith('file://') ||\n uri.startsWith('data:') ||\n uri.startsWith('/'));\n}\nexport async function rasterizeSvgToPngDataUrl(svg) {\n let pending = svgRasterCache.get(svg);\n if (!pending) {\n pending = rasterizeSvgToPngDataUrlInternal(svg);\n svgRasterCache.set(svg, pending);\n }\n return pending;\n}\nexport async function blobUrlToDataUrl(uri) {\n if (typeof window === 'undefined' || typeof fetch === 'undefined' || typeof FileReader === 'undefined') {\n return null;\n }\n try {\n const response = await fetch(uri);\n const blob = await response.blob();\n return await new Promise((resolve) => {\n const reader = new FileReader();\n reader.onload = () => {\n resolve(typeof reader.result === 'string' ? reader.result : null);\n };\n reader.onerror = () => resolve(null);\n reader.readAsDataURL(blob);\n });\n }\n catch (_a) {\n return null;\n }\n}\nfunction rasterizeSvgToPngDataUrlInternal(svg) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n return Promise.resolve(null);\n }\n const encodedSvg = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;\n return new Promise((resolve) => {\n const image = new Image();\n image.onload = () => {\n try {\n const sourceWidth = image.naturalWidth || 96;\n const sourceHeight = image.naturalHeight || 96;\n const maxSide = Math.max(sourceWidth, sourceHeight, 1);\n const scale = 128 / maxSide;\n const width = Math.max(1, Math.round(sourceWidth * scale));\n const height = Math.max(1, Math.round(sourceHeight * scale));\n const canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n const context = canvas.getContext('2d');\n if (!context) {\n resolve(null);\n return;\n }\n context.clearRect(0, 0, width, height);\n context.drawImage(image, 0, 0, width, height);\n resolve(canvas.toDataURL('image/png'));\n }\n catch (_a) {\n resolve(null);\n }\n };\n image.onerror = () => resolve(null);\n image.src = encodedSvg;\n });\n}\nexport function parseSvgElement(svgMarkup) {\n if (typeof DOMParser === 'undefined')\n return null;\n try {\n const documentNode = new DOMParser().parseFromString(svgMarkup, 'image/svg+xml');\n if (documentNode.querySelector('parsererror') || documentNode.querySelector('script')) {\n return null;\n }\n const root = documentNode.documentElement;\n if (!root || root.tagName.toLowerCase() !== 'svg')\n return null;\n const svg = root.cloneNode(true);\n svg.setAttribute('width', '40');\n svg.setAttribute('height', '40');\n svg.setAttribute('aria-hidden', 'true');\n svg.style.display = 'block';\n return svg;\n }\n catch (_a) {\n return null;\n }\n}\n//# sourceMappingURL=icons.js.map","import { blobUrlToDataUrl, getAccessibilityAnnouncement, isNativeSafeIconUri, isSvgIcon, normalizeIconSource, rasterizeSvgToPngDataUrl, DEFAULT_ICON_SYMBOL, } from './icons';\nconst VARIANT_ICONS = {\n success: 'checkmark.circle.fill',\n error: 'xmark.circle.fill',\n info: 'info.circle.fill',\n warning: 'exclamationmark.triangle.fill',\n loading: 'arrow.triangle.2.circlepath',\n};\nexport class ToastController {\n constructor(driver) {\n this.driver = driver;\n this.queue = [];\n this.current = null;\n this.isShowing = false;\n this.idCounter = 0;\n this.autoDismissTimer = null;\n this.autoDismissed = false;\n this.driver.subscribe({\n onDismiss: (event) => this.handleDismiss(event.id),\n onPress: (event) => this.handlePress(event.id),\n onActionPress: (event) => this.handleActionPress(event.id),\n });\n this.ref = {\n show: (config, options) => this.show(config, options),\n success: (title, config, options) => this.showVariant('success', title, config, options),\n error: (title, config, options) => this.showVariant('error', title, config, options),\n info: (title, config, options) => this.showVariant('info', title, config, options),\n warning: (title, config, options) => this.showVariant('warning', title, config, options),\n loading: (title, config, options) => this.showVariant('loading', title, config, options),\n update: (id, partial) => this.update(id, partial),\n promise: (promise, messages) => this.promise(promise, messages),\n dismiss: (id) => this.dismiss(id),\n dismissAll: () => this.dismissAll(),\n };\n }\n show(config, options) {\n var _a, _b;\n const id = (_a = config.id) !== null && _a !== void 0 ? _a : this.generateId();\n const entry = this.hydrateEntry(Object.assign(Object.assign({}, config), { id }));\n if ((options === null || options === void 0 ? void 0 : options.force) && this.isShowing) {\n this.queue.unshift(entry);\n this.clearAutoDismissTimer();\n this.autoDismissed = false;\n void this.driver.dismiss((_b = this.current) === null || _b === void 0 ? void 0 : _b.id);\n return id;\n }\n if (!this.isShowing) {\n this.presentToast(entry);\n return id;\n }\n this.queue.push(entry);\n this.prepareSvgIcon(entry);\n return id;\n }\n update(id, partial) {\n var _a;\n if (((_a = this.current) === null || _a === void 0 ? void 0 : _a.id) === id) {\n this.current = this.hydrateEntry(Object.assign(Object.assign(Object.assign({}, this.current), partial), { id }), this.current);\n this.armAutoDismissTimer(this.current);\n void this.driver.update(this.buildPayload(this.current));\n this.prepareSvgIcon(this.current);\n return;\n }\n const index = this.queue.findIndex((entry) => entry.id === id);\n if (index === -1)\n return;\n const existing = this.queue[index];\n const updated = this.hydrateEntry(Object.assign(Object.assign(Object.assign({}, existing), partial), { id }), existing);\n this.queue[index] = updated;\n this.prepareSvgIcon(updated);\n }\n dismiss(id) {\n var _a;\n if (id && ((_a = this.current) === null || _a === void 0 ? void 0 : _a.id) !== id) {\n this.queue = this.queue.filter((entry) => entry.id !== id);\n return;\n }\n if (!this.current)\n return;\n this.clearAutoDismissTimer();\n this.autoDismissed = false;\n void this.driver.dismiss(this.current.id);\n }\n dismissAll() {\n this.queue = [];\n if (!this.current)\n return;\n this.clearAutoDismissTimer();\n this.autoDismissed = false;\n void this.driver.dismiss(this.current.id);\n }\n promise(promise, messages) {\n const loadingConfig = typeof messages.loading === 'string'\n ? { title: messages.loading }\n : Object.assign({}, messages.loading);\n if (loadingConfig.autoDismiss === undefined) {\n loadingConfig.autoDismiss = false;\n }\n if (!loadingConfig.icon) {\n loadingConfig.icon = VARIANT_ICONS.loading;\n }\n const id = this.show(loadingConfig);\n promise.then((value) => {\n const next = typeof messages.success === 'function' ? messages.success(value) : messages.success;\n const config = typeof next === 'string' ? { title: next } : Object.assign({}, next);\n if (!config.icon)\n config.icon = VARIANT_ICONS.success;\n if (config.autoDismiss === undefined)\n config.autoDismiss = true;\n if (config.duration === undefined)\n config.duration = 3000;\n this.update(id, config);\n }, (error) => {\n const next = typeof messages.error === 'function' ? messages.error(error) : messages.error;\n const config = typeof next === 'string' ? { title: next } : Object.assign({}, next);\n if (!config.icon)\n config.icon = VARIANT_ICONS.error;\n if (config.autoDismiss === undefined)\n config.autoDismiss = true;\n if (config.duration === undefined)\n config.duration = 3000;\n this.update(id, config);\n });\n return promise;\n }\n showVariant(variant, title, config, options) {\n var _a;\n const toastConfig = Object.assign(Object.assign({}, config), { title, icon: (_a = config === null || config === void 0 ? void 0 : config.icon) !== null && _a !== void 0 ? _a : VARIANT_ICONS[variant], _fallbackIcon: VARIANT_ICONS[variant] });\n if (variant === 'loading' && toastConfig.autoDismiss === undefined) {\n toastConfig.autoDismiss = false;\n }\n return this.show(toastConfig, options);\n }\n presentToast(entry) {\n var _a;\n this.isShowing = true;\n this.current = entry;\n this.armAutoDismissTimer(entry);\n (_a = entry.onShow) === null || _a === void 0 ? void 0 : _a.call(entry);\n void this.driver.show(this.buildPayload(entry));\n this.prepareSvgIcon(entry);\n }\n showNext() {\n const next = this.queue.shift();\n if (!next) {\n this.isShowing = false;\n this.current = null;\n return;\n }\n this.presentToast(next);\n }\n handleDismiss(id) {\n var _a, _b;\n if (!this.current || this.current.id !== id)\n return;\n const entry = this.current;\n this.clearAutoDismissTimer();\n if (this.autoDismissed) {\n (_a = entry.onAutoDismiss) === null || _a === void 0 ? void 0 : _a.call(entry);\n }\n (_b = entry.onHide) === null || _b === void 0 ? void 0 : _b.call(entry);\n this.autoDismissed = false;\n this.showNext();\n }\n handlePress(id) {\n if (!this.current || this.current.id !== id || !this.current.onPress)\n return;\n this.current.onPress();\n this.clearAutoDismissTimer();\n this.autoDismissed = false;\n void this.driver.dismiss(id);\n }\n handleActionPress(id) {\n if (!this.current || this.current.id !== id || !this.current.action)\n return;\n this.current.action.onPress();\n this.clearAutoDismissTimer();\n this.autoDismissed = false;\n void this.driver.dismiss(id);\n }\n armAutoDismissTimer(entry) {\n var _a, _b;\n this.clearAutoDismissTimer();\n this.autoDismissed = false;\n const autoDismiss = (_a = entry.autoDismiss) !== null && _a !== void 0 ? _a : true;\n const duration = (_b = entry.duration) !== null && _b !== void 0 ? _b : 3000;\n if (!autoDismiss || duration <= 0)\n return;\n this.autoDismissTimer = setTimeout(() => {\n this.autoDismissTimer = null;\n this.autoDismissed = true;\n }, duration);\n }\n clearAutoDismissTimer() {\n if (!this.autoDismissTimer)\n return;\n clearTimeout(this.autoDismissTimer);\n this.autoDismissTimer = null;\n }\n hydrateEntry(config, previous) {\n var _a, _b, _c;\n const iconSourceUri = normalizeIconSource(config.iconSource);\n const rawIcon = typeof config.icon === 'string' ? config.icon : '';\n const rawSvg = !iconSourceUri && isSvgIcon(rawIcon) ? rawIcon.trim() : undefined;\n const fallbackIcon = (_b = (_a = config._fallbackIcon) !== null && _a !== void 0 ? _a : previous === null || previous === void 0 ? void 0 : previous._fallbackIcon) !== null && _b !== void 0 ? _b : DEFAULT_ICON_SYMBOL;\n const iconSymbol = rawSvg ? fallbackIcon : rawIcon || fallbackIcon;\n const resolvedIconUri = iconSourceUri && isNativeSafeIconUri(iconSourceUri)\n ? iconSourceUri\n : rawSvg && (previous === null || previous === void 0 ? void 0 : previous.rawSvg) === rawSvg\n ? previous.resolvedIconUri\n : iconSourceUri && (previous === null || previous === void 0 ? void 0 : previous.iconSourceUri) === iconSourceUri\n ? previous.resolvedIconUri\n : undefined;\n return Object.assign(Object.assign({}, config), { id: config.id, iconSymbol,\n iconSourceUri,\n rawSvg,\n resolvedIconUri, isPreparingSvg: rawSvg ? ((_c = previous === null || previous === void 0 ? void 0 : previous.isPreparingSvg) !== null && _c !== void 0 ? _c : false) : false });\n }\n buildPayload(entry) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;\n const iconUri = (_b = (_a = entry.iconSourceUri) !== null && _a !== void 0 ? _a : entry.resolvedIconUri) !== null && _b !== void 0 ? _b : '';\n return {\n id: entry.id,\n icon: entry.iconSymbol,\n iconUri,\n webIconUri: (_c = entry.iconSourceUri) !== null && _c !== void 0 ? _c : iconUri,\n iconSvg: entry.iconSourceUri ? '' : ((_d = entry.rawSvg) !== null && _d !== void 0 ? _d : ''),\n title: (_e = entry.title) !== null && _e !== void 0 ? _e : '',\n message: (_f = entry.message) !== null && _f !== void 0 ? _f : '',\n duration: (_g = entry.duration) !== null && _g !== void 0 ? _g : 3000,\n autoDismiss: (_h = entry.autoDismiss) !== null && _h !== void 0 ? _h : true,\n enableSwipeDismiss: (_j = entry.enableSwipeDismiss) !== null && _j !== void 0 ? _j : true,\n useDynamicIsland: true,\n accentColor: entry.accentColor,\n strokeColor: entry.strokeColor,\n disableBackdropSampling: (_k = entry.disableBackdropSampling) !== null && _k !== void 0 ? _k : false,\n actionLabel: (_m = (_l = entry.action) === null || _l === void 0 ? void 0 : _l.label) !== null && _m !== void 0 ? _m : '',\n accessibilityAnnouncement: getAccessibilityAnnouncement(entry),\n };\n }\n prepareSvgIcon(entry) {\n var _a, _b;\n if (entry.isPreparingSvg || entry.resolvedIconUri) {\n return;\n }\n const needsSvgRaster = Boolean(entry.rawSvg);\n const needsBlobConversion = Boolean((_a = entry.iconSourceUri) === null || _a === void 0 ? void 0 : _a.startsWith('blob:'));\n if (!needsSvgRaster && !needsBlobConversion) {\n return;\n }\n entry.isPreparingSvg = true;\n const resolveAsset = needsSvgRaster && entry.rawSvg\n ? rasterizeSvgToPngDataUrl(entry.rawSvg)\n : blobUrlToDataUrl((_b = entry.iconSourceUri) !== null && _b !== void 0 ? _b : '');\n void resolveAsset.then((dataUrl) => {\n var _a;\n entry.isPreparingSvg = false;\n if (!dataUrl)\n return;\n entry.resolvedIconUri = dataUrl;\n if (((_a = this.current) === null || _a === void 0 ? void 0 : _a.id) === entry.id) {\n void this.driver.update(this.buildPayload(entry));\n }\n });\n }\n generateId() {\n this.idCounter += 1;\n return `toast-${this.idCounter}-${Date.now()}`;\n }\n}\n//# sourceMappingURL=controller.js.map","import { registerPlugin } from '@capacitor/core';\nexport const PrettyToastBridge = registerPlugin('PrettyToast', {\n web: () => import('./web').then((module) => new module.PrettyToastWeb()),\n});\n//# sourceMappingURL=internal-plugin.js.map","import { PrettyToastBridge } from './internal-plugin';\nexport class CapacitorToastDriver {\n constructor() {\n this.subscribed = false;\n }\n subscribe(events) {\n if (this.subscribed)\n return;\n this.subscribed = true;\n void PrettyToastBridge.addListener('toastDismiss', events.onDismiss);\n void PrettyToastBridge.addListener('toastPress', events.onPress);\n void PrettyToastBridge.addListener('toastActionPress', events.onActionPress);\n }\n show(payload) {\n return PrettyToastBridge.showCurrentToast(payload);\n }\n update(payload) {\n return PrettyToastBridge.updateCurrentToast(payload);\n }\n dismiss(id) {\n return PrettyToastBridge.dismissCurrentToast(id ? { id } : {});\n }\n}\n//# sourceMappingURL=driver.js.map","import { ToastController } from './controller';\nimport { CapacitorToastDriver } from './driver';\nconst controller = new ToastController(new CapacitorToastDriver());\nexport const toast = controller.ref;\n//# sourceMappingURL=toast.js.map","import { DEFAULT_ICON_SYMBOL, getSymbolIcon, parseSvgElement } from './icons';\nconst ENTER_MS = 450;\nconst EXIT_MS = 350;\nconst ENTER_EASING = 'cubic-bezier(0.22, 1.2, 0.36, 1)';\nconst EXIT_EASING = 'cubic-bezier(0.4, 0, 0.2, 1)';\nconst SWIPE_THRESHOLD = -40;\nexport class WebToastRenderer {\n constructor(events) {\n this.events = events;\n this.current = null;\n this.root = null;\n this.iconSlot = null;\n this.titleNode = null;\n this.messageNode = null;\n this.actionButton = null;\n this.autoDismissTimer = null;\n this.exitTimer = null;\n this.prefersDark = false;\n this.dragStartY = null;\n this.dragY = 0;\n this.isDragging = false;\n if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') {\n this.prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;\n }\n }\n show(payload) {\n this.current = payload;\n this.clearExitTimer();\n this.clearAutoDismissTimer();\n this.dragStartY = null;\n this.dragY = 0;\n this.isDragging = false;\n this.ensureElements();\n this.render(payload);\n this.applyEnteringState();\n requestAnimationFrame(() => {\n var _a;\n if (!this.root || ((_a = this.current) === null || _a === void 0 ? void 0 : _a.id) !== payload.id)\n return;\n this.root.style.transform = 'translate(-50%, 0) scale(1)';\n this.root.style.opacity = '1';\n });\n this.armAutoDismiss(payload);\n }\n update(payload) {\n if (!this.root || !this.current || this.current.id !== payload.id)\n return;\n this.current = payload;\n this.render(payload);\n this.armAutoDismiss(payload);\n }\n dismiss(id) {\n if (!this.current || (id && this.current.id !== id) || !this.root)\n return;\n this.clearAutoDismissTimer();\n this.startExit();\n }\n ensureElements() {\n if (typeof document === 'undefined')\n return;\n if (this.root) {\n if (!this.root.isConnected) {\n document.body.appendChild(this.root);\n }\n return;\n }\n const root = document.createElement('div');\n root.setAttribute('role', 'status');\n root.setAttribute('aria-live', 'polite');\n root.style.position = 'fixed';\n root.style.top = 'calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 10px)';\n root.style.left = '50%';\n root.style.zIndex = '2147483647';\n root.style.width = 'min(360px, calc(100vw - 20px))';\n root.style.boxSizing = 'border-box';\n root.style.background = '#000';\n root.style.borderRadius = '30px';\n root.style.padding = '14px 20px';\n root.style.display = 'flex';\n root.style.alignItems = 'center';\n root.style.gap = '10px';\n root.style.fontFamily = '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif';\n root.style.userSelect = 'none';\n root.style.touchAction = 'none';\n root.style.boxShadow = '0 10px 30px rgba(0, 0, 0, 0.35)';\n root.style.transform = 'translate(-50%, -40px) scale(0.8)';\n root.style.opacity = '0';\n root.style.transition = `transform ${ENTER_MS}ms ${ENTER_EASING}, opacity ${ENTER_MS}ms ${ENTER_EASING}`;\n root.addEventListener('pointerdown', (event) => this.handlePointerDown(event));\n root.addEventListener('pointermove', (event) => this.handlePointerMove(event));\n root.addEventListener('pointerup', (event) => this.handlePointerUp(event));\n root.addEventListener('pointercancel', (event) => this.handlePointerUp(event));\n root.addEventListener('click', () => {\n if (!this.current || this.dragY < -4)\n return;\n this.events.onPress(this.current.id);\n });\n const iconSlot = document.createElement('div');\n iconSlot.style.width = '50px';\n iconSlot.style.flexShrink = '0';\n iconSlot.style.display = 'flex';\n iconSlot.style.alignItems = 'center';\n iconSlot.style.justifyContent = 'center';\n iconSlot.style.fontSize = '35px';\n iconSlot.style.lineHeight = '1';\n const textWrap = document.createElement('div');\n textWrap.style.flex = '1';\n textWrap.style.minWidth = '0';\n const titleNode = document.createElement('div');\n titleNode.style.color = '#fff';\n titleNode.style.fontWeight = '600';\n titleNode.style.fontSize = '15px';\n titleNode.style.lineHeight = '20px';\n titleNode.style.wordBreak = 'break-word';\n const messageNode = document.createElement('div');\n messageNode.style.color = 'rgba(255, 255, 255, 0.6)';\n messageNode.style.fontSize = '12px';\n messageNode.style.lineHeight = '16px';\n messageNode.style.wordBreak = 'break-word';\n textWrap.appendChild(titleNode);\n textWrap.appendChild(messageNode);\n const actionButton = document.createElement('button');\n actionButton.type = 'button';\n actionButton.style.flexShrink = '0';\n actionButton.style.marginLeft = '4px';\n actionButton.style.padding = '6px 12px';\n actionButton.style.background = 'rgba(255,255,255,0.12)';\n actionButton.style.border = 'none';\n actionButton.style.borderRadius = '999px';\n actionButton.style.fontSize = '13px';\n actionButton.style.fontWeight = '600';\n actionButton.style.cursor = 'pointer';\n actionButton.style.display = 'none';\n actionButton.addEventListener('click', (event) => {\n event.stopPropagation();\n if (!this.current)\n return;\n this.events.onActionPress(this.current.id);\n });\n actionButton.addEventListener('pointerdown', (event) => event.stopPropagation());\n root.appendChild(iconSlot);\n root.appendChild(textWrap);\n root.appendChild(actionButton);\n document.body.appendChild(root);\n this.root = root;\n this.iconSlot = iconSlot;\n this.titleNode = titleNode;\n this.messageNode = messageNode;\n this.actionButton = actionButton;\n }\n render(payload) {\n var _a, _b, _c;\n if (!this.root || !this.iconSlot || !this.titleNode || !this.messageNode || !this.actionButton) {\n return;\n }\n const symbolInfo = getSymbolIcon(payload.icon);\n const accentColor = (_a = payload.accentColor) !== null && _a !== void 0 ? _a : symbolInfo.color;\n const outline = payload.strokeColor\n ? payload.strokeColor\n : payload.disableBackdropSampling\n ? 'rgba(255,255,255,0.06)'\n : this.prefersDark\n ? `color-mix(in srgb, ${accentColor} 20%, transparent)`\n : '';\n this.root.style.border = outline ? `2px solid ${outline}` : 'none';\n this.root.style.cursor = payload.actionLabel || payload.icon ? 'pointer' : 'default';\n this.root.setAttribute('aria-label', payload.accessibilityAnnouncement || '');\n this.iconSlot.style.color = accentColor;\n this.iconSlot.replaceChildren();\n const renderableUri = payload.webIconUri || payload.iconUri;\n if (renderableUri) {\n const image = document.createElement('img');\n image.src = renderableUri;\n image.alt = '';\n image.style.width = '40px';\n image.style.height = '40px';\n image.style.objectFit = 'contain';\n this.iconSlot.appendChild(image);\n }\n else if (payload.iconSvg) {\n const svg = parseSvgElement(payload.iconSvg);\n if (svg) {\n this.iconSlot.appendChild(svg);\n }\n else {\n this.iconSlot.textContent = (_b = getSymbolIcon(payload.icon || DEFAULT_ICON_SYMBOL).glyph) !== null && _b !== void 0 ? _b : '';\n }\n }\n else {\n const glyph = (_c = symbolInfo.glyph) !== null && _c !== void 0 ? _c : getSymbolIcon(DEFAULT_ICON_SYMBOL).glyph;\n if (glyph) {\n this.iconSlot.textContent = glyph;\n }\n else {\n this.iconSlot.innerHTML =\n '<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>';\n }\n }\n this.titleNode.textContent = payload.title;\n this.titleNode.style.display = payload.title ? 'block' : 'none';\n this.messageNode.textContent = payload.message;\n this.messageNode.style.display = payload.message ? 'block' : 'none';\n this.messageNode.style.marginTop = payload.title && payload.message ? '4px' : '0';\n this.actionButton.textContent = payload.actionLabel;\n this.actionButton.style.color = accentColor;\n this.actionButton.style.display = payload.actionLabel ? 'inline-flex' : 'none';\n }\n armAutoDismiss(payload) {\n this.clearAutoDismissTimer();\n if (!payload.autoDismiss || payload.duration <= 0)\n return;\n this.autoDismissTimer = setTimeout(() => {\n this.startExit();\n }, payload.duration);\n }\n startExit() {\n if (!this.root || !this.current || this.exitTimer)\n return;\n const currentId = this.current.id;\n this.root.style.transition = `transform ${EXIT_MS}ms ${EXIT_EASING}, opacity ${EXIT_MS}ms ${EXIT_EASING}`;\n this.root.style.transform = `translate(-50%, ${this.dragY - 40}px) scale(1)`;\n this.root.style.opacity = '0';\n this.exitTimer = setTimeout(() => {\n var _a;\n this.exitTimer = null;\n this.clearAutoDismissTimer();\n this.dragY = 0;\n this.isDragging = false;\n this.dragStartY = null;\n if ((_a = this.root) === null || _a === void 0 ? void 0 : _a.isConnected) {\n this.root.remove();\n }\n this.root = null;\n this.iconSlot = null;\n this.titleNode = null;\n this.messageNode = null;\n this.actionButton = null;\n this.current = null;\n this.events.onDismiss(currentId);\n }, EXIT_MS);\n }\n applyEnteringState() {\n if (!this.root)\n return;\n this.root.style.transition = `transform ${ENTER_MS}ms ${ENTER_EASING}, opacity ${ENTER_MS}ms ${ENTER_EASING}`;\n this.root.style.transform = 'translate(-50%, -40px) scale(0.8)';\n this.root.style.opacity = '0';\n }\n handlePointerDown(event) {\n var _a, _b;\n if (event.button !== 0)\n return;\n this.dragStartY = event.clientY;\n this.dragY = 0;\n (_b = (_a = this.root) === null || _a === void 0 ? void 0 : _a.setPointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);\n }\n handlePointerMove(event) {\n if (!this.root || this.dragStartY === null)\n return;\n const nextDragY = Math.min(0, event.clientY - this.dragStartY);\n this.dragY = nextDragY;\n this.isDragging = nextDragY < -2;\n if (!this.isDragging)\n return;\n this.root.style.transition = 'none';\n this.root.style.transform = `translate(-50%, ${nextDragY}px) scale(1)`;\n }\n handlePointerUp(event) {\n var _a, _b;\n if (!this.root || this.dragStartY === null)\n return;\n this.dragStartY = null;\n (_b = (_a = this.root).releasePointerCapture) === null || _b === void 0 ? void 0 : _b.call(_a, event.pointerId);\n if (this.dragY < SWIPE_THRESHOLD) {\n this.startExit();\n return;\n }\n this.isDragging = false;\n this.dragY = 0;\n this.root.style.transition = `transform ${EXIT_MS}ms ${EXIT_EASING}, opacity ${EXIT_MS}ms ${EXIT_EASING}`;\n this.root.style.transform = 'translate(-50%, 0) scale(1)';\n }\n clearAutoDismissTimer() {\n if (!this.autoDismissTimer)\n return;\n clearTimeout(this.autoDismissTimer);\n this.autoDismissTimer = null;\n }\n clearExitTimer() {\n if (!this.exitTimer)\n return;\n clearTimeout(this.exitTimer);\n this.exitTimer = null;\n }\n}\n//# sourceMappingURL=web-renderer.js.map","import { WebPlugin } from '@capacitor/core';\nimport { WebToastRenderer } from './web-renderer';\nexport class PrettyToastWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.renderer = new WebToastRenderer({\n onDismiss: (id) => {\n this.notifyListeners('toastDismiss', { id });\n },\n onPress: (id) => {\n this.notifyListeners('toastPress', { id });\n },\n onActionPress: (id) => {\n this.notifyListeners('toastActionPress', { id });\n },\n });\n }\n async showCurrentToast(options) {\n this.renderer.show(options);\n }\n async updateCurrentToast(options) {\n this.renderer.update(options);\n }\n async dismissCurrentToast(options) {\n this.renderer.dismiss(options === null || options === void 0 ? void 0 : options.id);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;IAAA,MAAM,QAAQ,GAAG;IACjB,IAAI,CAAC,WAAW,EAAE,EAAE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StatusBarHidden: Bool = false {
|
|
5
|
+
didSet {
|
|
6
|
+
setNeedsStatusBarAppearanceUpdate()
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
override var prefersStatusBarHidden: Bool {
|
|
11
|
+
return isStatusBarHidden
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
import Combine
|
|
3
|
+
|
|
4
|
+
enum BackdropTint {
|
|
5
|
+
case colored
|
|
6
|
+
case gray
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
class PassThroughWindow: UIWindow, ObservableObject {
|
|
10
|
+
@Published var toast: Toast?
|
|
11
|
+
@Published var isPresented: Bool = false
|
|
12
|
+
@Published var useDynamicIsland: Bool = true
|
|
13
|
+
@Published var wasTapped: Bool = false
|
|
14
|
+
@Published var actionTapped: Bool = false
|
|
15
|
+
|
|
16
|
+
@Published var backdropTint: BackdropTint = .gray
|
|
17
|
+
|
|
18
|
+
private var backdropTimer: Timer?
|
|
19
|
+
// Debounce so the stroke doesn't flicker when the sampled luma
|
|
20
|
+
// briefly crosses the flip point during scroll/transition.
|
|
21
|
+
private var pendingTint: BackdropTint?
|
|
22
|
+
private var pendingTintSince: CFAbsoluteTime = 0
|
|
23
|
+
|
|
24
|
+
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
|
25
|
+
guard let hitView = super.hitTest(point, with: event),
|
|
26
|
+
let rootView = rootViewController?.view else {
|
|
27
|
+
return nil
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if hitView == rootView {
|
|
31
|
+
for subview in rootView.subviews.reversed() {
|
|
32
|
+
let pointInSubView = subview.convert(point, from: rootView)
|
|
33
|
+
if let nestedHit = subview.hitTest(pointInSubView, with: event) {
|
|
34
|
+
return nestedHit
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return nil
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return hitView
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// MARK: - Backdrop sampling
|
|
44
|
+
|
|
45
|
+
func startBackdropSampling() {
|
|
46
|
+
stopBackdropSampling()
|
|
47
|
+
sampleBackdrop()
|
|
48
|
+
// `.common` mode keeps the timer firing during scroll tracking;
|
|
49
|
+
// the default mode would pause while a ScrollView is being dragged.
|
|
50
|
+
let timer = Timer(timeInterval: 0.25, repeats: true) { [weak self] _ in
|
|
51
|
+
self?.sampleBackdrop()
|
|
52
|
+
}
|
|
53
|
+
RunLoop.main.add(timer, forMode: .common)
|
|
54
|
+
backdropTimer = timer
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
func stopBackdropSampling() {
|
|
58
|
+
backdropTimer?.invalidate()
|
|
59
|
+
backdropTimer = nil
|
|
60
|
+
pendingTint = nil
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
deinit {
|
|
64
|
+
stopBackdropSampling()
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
private func sampleBackdrop() {
|
|
68
|
+
guard let scene = windowScene else { return }
|
|
69
|
+
// Pick the backmost window so we sample the app, not transient
|
|
70
|
+
// overlays (dev menu, keyboard, alerts). `windows` isn't ordered.
|
|
71
|
+
let candidates = scene.windows.filter { $0 !== self && !$0.isHidden }
|
|
72
|
+
guard let contentWindow = candidates.min(by: { $0.windowLevel < $1.windowLevel }) else { return }
|
|
73
|
+
|
|
74
|
+
let bitmapWidth = 32
|
|
75
|
+
let bitmapHeight = 8
|
|
76
|
+
var pixels = [UInt8](repeating: 0, count: bitmapWidth * bitmapHeight * 4)
|
|
77
|
+
|
|
78
|
+
guard let context = CGContext(
|
|
79
|
+
data: &pixels,
|
|
80
|
+
width: bitmapWidth,
|
|
81
|
+
height: bitmapHeight,
|
|
82
|
+
bitsPerComponent: 8,
|
|
83
|
+
bytesPerRow: bitmapWidth * 4,
|
|
84
|
+
space: CGColorSpaceCreateDeviceRGB(),
|
|
85
|
+
bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue
|
|
86
|
+
) else { return }
|
|
87
|
+
|
|
88
|
+
// Top strip under the pill. `layer.render` cost scales with area.
|
|
89
|
+
let sampleRect = CGRect(
|
|
90
|
+
x: 0, y: 0,
|
|
91
|
+
width: contentWindow.bounds.width,
|
|
92
|
+
height: 80
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
// Flip + scale CG coords to UIKit (top-left origin) for layer.render.
|
|
96
|
+
context.saveGState()
|
|
97
|
+
context.translateBy(x: 0, y: CGFloat(bitmapHeight))
|
|
98
|
+
context.scaleBy(x: 1, y: -1)
|
|
99
|
+
let scaleX = CGFloat(bitmapWidth) / sampleRect.width
|
|
100
|
+
let scaleY = CGFloat(bitmapHeight) / sampleRect.height
|
|
101
|
+
context.scaleBy(x: scaleX, y: scaleY)
|
|
102
|
+
context.translateBy(x: -sampleRect.origin.x, y: -sampleRect.origin.y)
|
|
103
|
+
contentWindow.layer.render(in: context)
|
|
104
|
+
context.restoreGState()
|
|
105
|
+
|
|
106
|
+
var totalLuma: Double = 0
|
|
107
|
+
let pixelCount = bitmapWidth * bitmapHeight
|
|
108
|
+
for pixelIndex in 0..<pixelCount {
|
|
109
|
+
let red = Double(pixels[pixelIndex * 4 + 0]) / 255.0
|
|
110
|
+
let green = Double(pixels[pixelIndex * 4 + 1]) / 255.0
|
|
111
|
+
let blue = Double(pixels[pixelIndex * 4 + 2]) / 255.0
|
|
112
|
+
totalLuma += 0.299 * red + 0.587 * green + 0.114 * blue
|
|
113
|
+
}
|
|
114
|
+
let avgLuma = totalLuma / Double(pixelCount)
|
|
115
|
+
|
|
116
|
+
// Flip around ~#0E luma with ±0.005 hysteresis: below → accent
|
|
117
|
+
// stroke, above → neutral. Matches Apple's DI behavior.
|
|
118
|
+
let tint: BackdropTint
|
|
119
|
+
switch backdropTint {
|
|
120
|
+
case .colored:
|
|
121
|
+
tint = avgLuma > 0.060 ? .gray : .colored
|
|
122
|
+
default:
|
|
123
|
+
tint = avgLuma < 0.050 ? .colored : .gray
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if tint == backdropTint {
|
|
127
|
+
pendingTint = nil
|
|
128
|
+
return
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
let now = CFAbsoluteTimeGetCurrent()
|
|
132
|
+
if pendingTint != tint {
|
|
133
|
+
pendingTint = tint
|
|
134
|
+
pendingTintSince = now
|
|
135
|
+
return
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if now - pendingTintSince >= 0.25 {
|
|
139
|
+
backdropTint = tint
|
|
140
|
+
pendingTint = nil
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import UIKit
|
|
2
|
+
|
|
3
|
+
enum PrettyToastColorParser {
|
|
4
|
+
static func parse(_ value: String?) -> UIColor? {
|
|
5
|
+
guard let rawValue = value?.trimmingCharacters(in: .whitespacesAndNewlines),
|
|
6
|
+
!rawValue.isEmpty else {
|
|
7
|
+
return nil
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
if rawValue.hasPrefix("#") {
|
|
11
|
+
return parseHex(rawValue)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if rawValue.lowercased().hasPrefix("rgb") {
|
|
15
|
+
return parseRGB(rawValue)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
switch rawValue.lowercased() {
|
|
19
|
+
case "white": return .white
|
|
20
|
+
case "black": return .black
|
|
21
|
+
case "red": return .red
|
|
22
|
+
case "green": return .green
|
|
23
|
+
case "blue": return .blue
|
|
24
|
+
case "orange": return .orange
|
|
25
|
+
case "yellow": return .yellow
|
|
26
|
+
case "gray", "grey": return .gray
|
|
27
|
+
case "pink": return .systemPink
|
|
28
|
+
case "purple": return .purple
|
|
29
|
+
case "clear": return .clear
|
|
30
|
+
default:
|
|
31
|
+
return nil
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private static func parseHex(_ rawValue: String) -> UIColor? {
|
|
36
|
+
let hex = rawValue.dropFirst()
|
|
37
|
+
let normalized: String
|
|
38
|
+
|
|
39
|
+
switch hex.count {
|
|
40
|
+
case 3:
|
|
41
|
+
normalized = hex.map { "\($0)\($0)" }.joined() + "FF"
|
|
42
|
+
case 4:
|
|
43
|
+
normalized = hex.map { "\($0)\($0)" }.joined()
|
|
44
|
+
case 6:
|
|
45
|
+
normalized = String(hex) + "FF"
|
|
46
|
+
case 8:
|
|
47
|
+
normalized = String(hex)
|
|
48
|
+
default:
|
|
49
|
+
return nil
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
var value: UInt64 = 0
|
|
53
|
+
guard Scanner(string: normalized).scanHexInt64(&value) else {
|
|
54
|
+
return nil
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
let red = CGFloat((value & 0xFF000000) >> 24) / 255
|
|
58
|
+
let green = CGFloat((value & 0x00FF0000) >> 16) / 255
|
|
59
|
+
let blue = CGFloat((value & 0x0000FF00) >> 8) / 255
|
|
60
|
+
let alpha = CGFloat(value & 0x000000FF) / 255
|
|
61
|
+
return UIColor(red: red, green: green, blue: blue, alpha: alpha)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private static func parseRGB(_ rawValue: String) -> UIColor? {
|
|
65
|
+
guard let openParen = rawValue.firstIndex(of: "("),
|
|
66
|
+
let closeParen = rawValue.lastIndex(of: ")"),
|
|
67
|
+
openParen < closeParen else {
|
|
68
|
+
return nil
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
let content = rawValue[rawValue.index(after: openParen)..<closeParen]
|
|
72
|
+
let components = content
|
|
73
|
+
.split(separator: ",")
|
|
74
|
+
.map { $0.trimmingCharacters(in: .whitespacesAndNewlines) }
|
|
75
|
+
|
|
76
|
+
guard components.count == 3 || components.count == 4 else {
|
|
77
|
+
return nil
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
guard let red = Double(components[0]),
|
|
81
|
+
let green = Double(components[1]),
|
|
82
|
+
let blue = Double(components[2]) else {
|
|
83
|
+
return nil
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
let alpha = components.count == 4 ? Double(components[3]) ?? 1 : 1
|
|
87
|
+
return UIColor(
|
|
88
|
+
red: red / 255,
|
|
89
|
+
green: green / 255,
|
|
90
|
+
blue: blue / 255,
|
|
91
|
+
alpha: alpha
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import Capacitor
|
|
2
|
+
import Foundation
|
|
3
|
+
import UIKit
|
|
4
|
+
|
|
5
|
+
@objc(PrettyToastPlugin)
|
|
6
|
+
public class PrettyToastPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
7
|
+
public let identifier = "PrettyToastPlugin"
|
|
8
|
+
public let jsName = "PrettyToast"
|
|
9
|
+
public let pluginMethods: [CAPPluginMethod] = [
|
|
10
|
+
CAPPluginMethod(name: "showCurrentToast", returnType: CAPPluginReturnPromise),
|
|
11
|
+
CAPPluginMethod(name: "updateCurrentToast", returnType: CAPPluginReturnPromise),
|
|
12
|
+
CAPPluginMethod(name: "dismissCurrentToast", returnType: CAPPluginReturnPromise)
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
private let manager = ToastManager()
|
|
16
|
+
private var currentToastId: String?
|
|
17
|
+
|
|
18
|
+
override public func load() {
|
|
19
|
+
manager.onDismiss = { [weak self] in
|
|
20
|
+
guard let self, let toastId = self.currentToastId else { return }
|
|
21
|
+
self.notifyListeners("toastDismiss", data: ["id": toastId])
|
|
22
|
+
self.currentToastId = nil
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
manager.onPress = { [weak self] in
|
|
26
|
+
guard let self, let toastId = self.currentToastId else { return }
|
|
27
|
+
self.notifyListeners("toastPress", data: ["id": toastId])
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
manager.onActionPress = { [weak self] in
|
|
31
|
+
guard let self, let toastId = self.currentToastId else { return }
|
|
32
|
+
self.notifyListeners("toastActionPress", data: ["id": toastId])
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@objc func showCurrentToast(_ call: CAPPluginCall) {
|
|
37
|
+
guard let payload = parsePayload(call) else { return }
|
|
38
|
+
|
|
39
|
+
currentToastId = payload.id
|
|
40
|
+
|
|
41
|
+
DispatchQueue.main.async { [weak self] in
|
|
42
|
+
self?.manager.show(
|
|
43
|
+
icon: payload.icon,
|
|
44
|
+
iconUri: payload.iconUri,
|
|
45
|
+
title: payload.title,
|
|
46
|
+
message: payload.message,
|
|
47
|
+
duration: payload.duration,
|
|
48
|
+
autoDismiss: payload.autoDismiss,
|
|
49
|
+
enableSwipeDismiss: payload.enableSwipeDismiss,
|
|
50
|
+
useDynamicIsland: payload.useDynamicIsland,
|
|
51
|
+
accentColor: payload.accentColor,
|
|
52
|
+
strokeColor: payload.strokeColor,
|
|
53
|
+
disableBackdropSampling: payload.disableBackdropSampling,
|
|
54
|
+
actionLabel: payload.actionLabel,
|
|
55
|
+
accessibilityAnnouncement: payload.accessibilityAnnouncement
|
|
56
|
+
)
|
|
57
|
+
call.resolve()
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@objc func updateCurrentToast(_ call: CAPPluginCall) {
|
|
62
|
+
guard let payload = parsePayload(call) else { return }
|
|
63
|
+
if let currentToastId, currentToastId != payload.id {
|
|
64
|
+
call.resolve()
|
|
65
|
+
return
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
DispatchQueue.main.async { [weak self] in
|
|
69
|
+
self?.manager.update(
|
|
70
|
+
icon: payload.icon,
|
|
71
|
+
iconUri: payload.iconUri,
|
|
72
|
+
title: payload.title,
|
|
73
|
+
message: payload.message,
|
|
74
|
+
duration: payload.duration,
|
|
75
|
+
autoDismiss: payload.autoDismiss,
|
|
76
|
+
accentColor: payload.accentColor,
|
|
77
|
+
strokeColor: payload.strokeColor,
|
|
78
|
+
disableBackdropSampling: payload.disableBackdropSampling,
|
|
79
|
+
actionLabel: payload.actionLabel
|
|
80
|
+
)
|
|
81
|
+
call.resolve()
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@objc func dismissCurrentToast(_ call: CAPPluginCall) {
|
|
86
|
+
let requestedId = call.getString("id")
|
|
87
|
+
if let requestedId, let currentToastId, requestedId != currentToastId {
|
|
88
|
+
call.resolve()
|
|
89
|
+
return
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
DispatchQueue.main.async { [weak self] in
|
|
93
|
+
self?.manager.dismiss()
|
|
94
|
+
call.resolve()
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private func parsePayload(_ call: CAPPluginCall) -> ToastPayload? {
|
|
99
|
+
guard let id = call.getString("id") else {
|
|
100
|
+
call.reject("Missing required parameter: id")
|
|
101
|
+
return nil
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return ToastPayload(
|
|
105
|
+
id: id,
|
|
106
|
+
icon: call.getString("icon") ?? "",
|
|
107
|
+
iconUri: call.getString("iconUri") ?? "",
|
|
108
|
+
title: call.getString("title") ?? "",
|
|
109
|
+
message: call.getString("message") ?? "",
|
|
110
|
+
duration: call.getInt("duration") ?? 3000,
|
|
111
|
+
autoDismiss: call.getBool("autoDismiss") ?? true,
|
|
112
|
+
enableSwipeDismiss: call.getBool("enableSwipeDismiss") ?? true,
|
|
113
|
+
useDynamicIsland: call.getBool("useDynamicIsland") ?? true,
|
|
114
|
+
accentColor: PrettyToastColorParser.parse(call.getString("accentColor")),
|
|
115
|
+
strokeColor: PrettyToastColorParser.parse(call.getString("strokeColor")),
|
|
116
|
+
disableBackdropSampling: call.getBool("disableBackdropSampling") ?? false,
|
|
117
|
+
actionLabel: call.getString("actionLabel") ?? "",
|
|
118
|
+
accessibilityAnnouncement: call.getString("accessibilityAnnouncement") ?? ""
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
private struct ToastPayload {
|
|
124
|
+
let id: String
|
|
125
|
+
let icon: String
|
|
126
|
+
let iconUri: String
|
|
127
|
+
let title: String
|
|
128
|
+
let message: String
|
|
129
|
+
let duration: Int
|
|
130
|
+
let autoDismiss: Bool
|
|
131
|
+
let enableSwipeDismiss: Bool
|
|
132
|
+
let useDynamicIsland: Bool
|
|
133
|
+
let accentColor: UIColor?
|
|
134
|
+
let strokeColor: UIColor?
|
|
135
|
+
let disableBackdropSampling: Bool
|
|
136
|
+
let actionLabel: String
|
|
137
|
+
let accessibilityAnnouncement: String
|
|
138
|
+
}
|