@rdlabo/capacitor-native-ui 0.0.0-stage → 1.2.1
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/LICENSE +21 -0
- package/Package.swift +23 -0
- package/README.md +53 -2
- package/RdlaboCapacitorNativeUi.podspec +17 -0
- package/android/build.gradle +69 -0
- package/android/proguard-rules.pro +0 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/dev/rdlabo/capacitor/nativeui/NativeUI.kt +51 -0
- package/android/src/main/java/dev/rdlabo/capacitor/nativeui/NativeUIPlugin.kt +192 -0
- package/android/src/main/java/dev/rdlabo/capacitor/nativeui/NativeUISnapshot.kt +57 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/core.d.ts +4 -0
- package/dist/core.js +3 -0
- package/dist/native/activation.d.ts +14 -0
- package/dist/native/activation.d.ts.map +1 -0
- package/dist/native/activation.js +305 -0
- package/dist/native/activation.js.map +1 -0
- package/dist/native/components/index.d.ts +19 -0
- package/dist/native/components/index.d.ts.map +1 -0
- package/dist/native/components/index.js +38 -0
- package/dist/native/components/index.js.map +1 -0
- package/dist/native/components/ion-back-button.d.ts +10 -0
- package/dist/native/components/ion-back-button.d.ts.map +1 -0
- package/dist/native/components/ion-back-button.js +21 -0
- package/dist/native/components/ion-back-button.js.map +1 -0
- package/dist/native/components/ion-button.d.ts +10 -0
- package/dist/native/components/ion-button.d.ts.map +1 -0
- package/dist/native/components/ion-button.js +25 -0
- package/dist/native/components/ion-button.js.map +1 -0
- package/dist/native/components/ion-buttons.d.ts +11 -0
- package/dist/native/components/ion-buttons.d.ts.map +1 -0
- package/dist/native/components/ion-buttons.js +30 -0
- package/dist/native/components/ion-buttons.js.map +1 -0
- package/dist/native/components/ion-fab.d.ts +10 -0
- package/dist/native/components/ion-fab.d.ts.map +1 -0
- package/dist/native/components/ion-fab.js +132 -0
- package/dist/native/components/ion-fab.js.map +1 -0
- package/dist/native/components/ion-menu-button.d.ts +13 -0
- package/dist/native/components/ion-menu-button.d.ts.map +1 -0
- package/dist/native/components/ion-menu-button.js +44 -0
- package/dist/native/components/ion-menu-button.js.map +1 -0
- package/dist/native/components/ion-segment.d.ts +11 -0
- package/dist/native/components/ion-segment.d.ts.map +1 -0
- package/dist/native/components/ion-segment.js +30 -0
- package/dist/native/components/ion-segment.js.map +1 -0
- package/dist/native/components/ion-tab-bar.d.ts +11 -0
- package/dist/native/components/ion-tab-bar.d.ts.map +1 -0
- package/dist/native/components/ion-tab-bar.js +50 -0
- package/dist/native/components/ion-tab-bar.js.map +1 -0
- package/dist/native/components/searchable-tabs.d.ts +20 -0
- package/dist/native/components/searchable-tabs.d.ts.map +1 -0
- package/dist/native/components/searchable-tabs.js +413 -0
- package/dist/native/components/searchable-tabs.js.map +1 -0
- package/dist/native/definitions.d.ts +255 -0
- package/dist/native/definitions.d.ts.map +1 -0
- package/dist/native/definitions.js +0 -0
- package/dist/native/extensions.d.ts +31 -0
- package/dist/native/extensions.d.ts.map +1 -0
- package/dist/native/extensions.js +122 -0
- package/dist/native/extensions.js.map +1 -0
- package/dist/native/foldable/fold-state.d.ts +5 -0
- package/dist/native/foldable/fold-state.d.ts.map +1 -0
- package/dist/native/foldable/fold-state.js +15 -0
- package/dist/native/foldable/fold-state.js.map +1 -0
- package/dist/native/foldable/types.d.ts +12 -0
- package/dist/native/foldable/types.d.ts.map +1 -0
- package/dist/native/foldable/types.js +0 -0
- package/dist/native/html.d.ts +9 -0
- package/dist/native/html.d.ts.map +1 -0
- package/dist/native/html.js +188 -0
- package/dist/native/html.js.map +1 -0
- package/dist/native/index.d.ts +10 -0
- package/dist/native/index.d.ts.map +1 -0
- package/dist/native/index.js +28 -0
- package/dist/native/index.js.map +1 -0
- package/dist/native/legacy-layout.d.ts +5 -0
- package/dist/native/legacy-layout.d.ts.map +1 -0
- package/dist/native/legacy-layout.js +27 -0
- package/dist/native/legacy-layout.js.map +1 -0
- package/dist/native/overlays/content.d.ts +4 -0
- package/dist/native/overlays/content.d.ts.map +1 -0
- package/dist/native/overlays/content.js +51 -0
- package/dist/native/overlays/content.js.map +1 -0
- package/dist/native/overlays/controller.d.ts +8 -0
- package/dist/native/overlays/controller.d.ts.map +1 -0
- package/dist/native/overlays/controller.js +285 -0
- package/dist/native/overlays/controller.js.map +1 -0
- package/dist/native/overlays/dialog-animation.d.ts +9 -0
- package/dist/native/overlays/dialog-animation.d.ts.map +1 -0
- package/dist/native/overlays/dialog-animation.js +53 -0
- package/dist/native/overlays/dialog-animation.js.map +1 -0
- package/dist/native/overlays/dismiss-animation.d.ts +4 -0
- package/dist/native/overlays/dismiss-animation.d.ts.map +1 -0
- package/dist/native/overlays/dismiss-animation.js +18 -0
- package/dist/native/overlays/dismiss-animation.js.map +1 -0
- package/dist/native/overlays/focus.d.ts +5 -0
- package/dist/native/overlays/focus.d.ts.map +1 -0
- package/dist/native/overlays/focus.js +59 -0
- package/dist/native/overlays/focus.js.map +1 -0
- package/dist/native/overlays/popover.d.ts +12 -0
- package/dist/native/overlays/popover.d.ts.map +1 -0
- package/dist/native/overlays/popover.js +110 -0
- package/dist/native/overlays/popover.js.map +1 -0
- package/dist/native/overlays/styles.d.ts +11 -0
- package/dist/native/overlays/styles.d.ts.map +1 -0
- package/dist/native/overlays/styles.js +167 -0
- package/dist/native/overlays/styles.js.map +1 -0
- package/dist/native/prehide.d.ts +8 -0
- package/dist/native/prehide.d.ts.map +1 -0
- package/dist/native/prehide.js +238 -0
- package/dist/native/prehide.js.map +1 -0
- package/dist/native/runtime.d.ts +7 -0
- package/dist/native/runtime.d.ts.map +1 -0
- package/dist/native/runtime.js +788 -0
- package/dist/native/runtime.js.map +1 -0
- package/dist/native/shared/bridge.d.ts +6 -0
- package/dist/native/shared/bridge.d.ts.map +1 -0
- package/dist/native/shared/bridge.js +18 -0
- package/dist/native/shared/bridge.js.map +1 -0
- package/dist/native/shared/candidate.d.ts +25 -0
- package/dist/native/shared/candidate.d.ts.map +1 -0
- package/dist/native/shared/candidate.js +106 -0
- package/dist/native/shared/candidate.js.map +1 -0
- package/dist/native/shared/clipping.d.ts +5 -0
- package/dist/native/shared/clipping.d.ts.map +1 -0
- package/dist/native/shared/clipping.js +26 -0
- package/dist/native/shared/clipping.js.map +1 -0
- package/dist/native/shared/crossfade.d.ts +12 -0
- package/dist/native/shared/crossfade.d.ts.map +1 -0
- package/dist/native/shared/crossfade.js +67 -0
- package/dist/native/shared/crossfade.js.map +1 -0
- package/dist/native/shared/diagnostics.d.ts +4 -0
- package/dist/native/shared/diagnostics.d.ts.map +1 -0
- package/dist/native/shared/diagnostics.js +18 -0
- package/dist/native/shared/diagnostics.js.map +1 -0
- package/dist/native/shared/dom.d.ts +46 -0
- package/dist/native/shared/dom.d.ts.map +1 -0
- package/dist/native/shared/dom.js +180 -0
- package/dist/native/shared/dom.js.map +1 -0
- package/dist/native/shared/events.d.ts +15 -0
- package/dist/native/shared/events.d.ts.map +1 -0
- package/dist/native/shared/events.js +17 -0
- package/dist/native/shared/events.js.map +1 -0
- package/dist/native/shared/icons.d.ts +8 -0
- package/dist/native/shared/icons.d.ts.map +1 -0
- package/dist/native/shared/icons.js +61 -0
- package/dist/native/shared/icons.js.map +1 -0
- package/dist/native/shared/modal.d.ts +10 -0
- package/dist/native/shared/modal.d.ts.map +1 -0
- package/dist/native/shared/modal.js +160 -0
- package/dist/native/shared/modal.js.map +1 -0
- package/dist/native/shared/projection-id.d.ts +4 -0
- package/dist/native/shared/projection-id.d.ts.map +1 -0
- package/dist/native/shared/projection-id.js +7 -0
- package/dist/native/shared/projection-id.js.map +1 -0
- package/dist/native/shared/toolbar-options.d.ts +9 -0
- package/dist/native/shared/toolbar-options.d.ts.map +1 -0
- package/dist/native/shared/toolbar-options.js +36 -0
- package/dist/native/shared/toolbar-options.js.map +1 -0
- package/dist/native/shared/vertical-bars-geometry.d.ts +10 -0
- package/dist/native/shared/vertical-bars-geometry.d.ts.map +1 -0
- package/dist/native/shared/vertical-bars-geometry.js +85 -0
- package/dist/native/shared/vertical-bars-geometry.js.map +1 -0
- package/dist/native/startup.d.ts +8 -0
- package/dist/native/startup.d.ts.map +1 -0
- package/dist/native/startup.js +86 -0
- package/dist/native/startup.js.map +1 -0
- package/dist/native/vertical-bars-web-search.d.ts +10 -0
- package/dist/native/vertical-bars-web-search.d.ts.map +1 -0
- package/dist/native/vertical-bars-web-search.js +90 -0
- package/dist/native/vertical-bars-web-search.js.map +1 -0
- package/dist/native/vertical-bars-web.d.ts +5 -0
- package/dist/native/vertical-bars-web.d.ts.map +1 -0
- package/dist/native/vertical-bars-web.js +421 -0
- package/dist/native/vertical-bars-web.js.map +1 -0
- package/dist/native-integration/index.d.ts +25 -0
- package/dist/native-integration/index.d.ts.map +1 -0
- package/dist/native-integration/index.js +33 -0
- package/dist/native-integration/index.js.map +1 -0
- package/dist/vertical-bars.d.ts +6 -0
- package/dist/vertical-bars.js +5 -0
- package/docs/configuration.md +187 -0
- package/docs/framework-independent.md +82 -0
- package/docs/migration.md +206 -0
- package/docs/native-mini-player.md +47 -0
- package/docs/native-ui-extensions.md +365 -0
- package/docs/native-ui.md +409 -0
- package/docs/setup.md +205 -0
- package/docs/vertical-bars.md +379 -0
- package/ios/Sources/NativeUIPlugin/Components/NativeUIButton.swift +71 -0
- package/ios/Sources/NativeUIPlugin/Components/NativeUIButtons.swift +24 -0
- package/ios/Sources/NativeUIPlugin/Components/NativeUIComponents.swift +19 -0
- package/ios/Sources/NativeUIPlugin/Components/NativeUIFab.swift +80 -0
- package/ios/Sources/NativeUIPlugin/Components/NativeUISearchController.swift +439 -0
- package/ios/Sources/NativeUIPlugin/Components/NativeUISegment.swift +91 -0
- package/ios/Sources/NativeUIPlugin/Components/NativeUITabBar.swift +218 -0
- package/ios/Sources/NativeUIPlugin/Components/NativeUIVerticalBars.swift +590 -0
- package/ios/Sources/NativeUIPlugin/Components/NativeUIVerticalSearch.swift +118 -0
- package/ios/Sources/NativeUIPlugin/Extensions/NativeUI.swift +178 -0
- package/ios/Sources/NativeUIPlugin/Extensions/NativeUIRendering.swift +38 -0
- package/ios/Sources/NativeUIPlugin/NativeUIPlugin.swift +615 -0
- package/ios/Sources/NativeUIPlugin/Overlays/NativeUIOverlayController.swift +119 -0
- package/ios/Sources/NativeUIPlugin/Overlays/NativeUIOverlayHost.swift +75 -0
- package/ios/Sources/NativeUIPlugin/Shared/NativeUIControlRendering.swift +21 -0
- package/ios/Sources/NativeUIPlugin/Shared/NativeUICrossfade.swift +35 -0
- package/ios/Sources/NativeUIPlugin/Shared/NativeUIHost.swift +8 -0
- package/ios/Sources/NativeUIPlugin/Shared/NativeUISnapshot.swift +161 -0
- package/ios/Sources/NativeUIPlugin/Shared/NativeUIVerticalBarsGeometry.swift +52 -0
- package/ios/Tests/NativeUIPluginTests/NativeUIExtensionTests.swift +165 -0
- package/ios/Tests/NativeUIPluginTests/NativeUISnapshotTests.swift +805 -0
- package/package.json +89 -4
- package/src/core.ts +15 -0
- package/src/native/activation.ts +394 -0
- package/src/native/components/index.ts +45 -0
- package/src/native/components/ion-back-button.ts +22 -0
- package/src/native/components/ion-button.ts +25 -0
- package/src/native/components/ion-buttons.ts +37 -0
- package/src/native/components/ion-fab.ts +151 -0
- package/src/native/components/ion-menu-button.ts +37 -0
- package/src/native/components/ion-segment.ts +27 -0
- package/src/native/components/ion-tab-bar.ts +50 -0
- package/src/native/components/searchable-tabs.ts +499 -0
- package/src/native/definitions.ts +324 -0
- package/src/native/extensions.ts +176 -0
- package/src/native/foldable/fold-state.ts +10 -0
- package/src/native/foldable/types.ts +4 -0
- package/src/native/html.ts +193 -0
- package/src/native/index.ts +41 -0
- package/src/native/legacy-layout.ts +21 -0
- package/src/native/overlays/content.ts +51 -0
- package/src/native/overlays/controller.ts +349 -0
- package/src/native/overlays/dialog-animation.ts +53 -0
- package/src/native/overlays/dismiss-animation.ts +15 -0
- package/src/native/overlays/focus.ts +64 -0
- package/src/native/overlays/popover.ts +120 -0
- package/src/native/overlays/styles.ts +181 -0
- package/src/native/prehide.ts +285 -0
- package/src/native/runtime.ts +988 -0
- package/src/native/shared/bridge.ts +18 -0
- package/src/native/shared/candidate.ts +162 -0
- package/src/native/shared/clipping.ts +24 -0
- package/src/native/shared/crossfade.ts +67 -0
- package/src/native/shared/diagnostics.ts +13 -0
- package/src/native/shared/dom.ts +304 -0
- package/src/native/shared/events.ts +14 -0
- package/src/native/shared/icons.ts +57 -0
- package/src/native/shared/modal.ts +157 -0
- package/src/native/shared/projection-id.ts +2 -0
- package/src/native/shared/toolbar-options.ts +53 -0
- package/src/native/shared/vertical-bars-geometry.ts +80 -0
- package/src/native/startup.ts +84 -0
- package/src/native/vertical-bars-web-search.ts +86 -0
- package/src/native/vertical-bars-web.ts +498 -0
- package/src/native-integration/index.ts +49 -0
- package/src/vertical-bars.ts +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","names":["extensionAncestors"],"sources":["../../src/native/runtime.ts"],"sourcesContent":["import { createDiagnostics } from './shared/diagnostics';\nimport { htmlSelector, readHTMLControl } from './html';\nimport { extensionAncestors, readExtension } from './extensions';\nimport { bounded, boundedListener } from './shared/bridge';\nimport { popoverTrigger } from './overlays/popover';\nimport {\n alignVerticalTabBar,\n forgetVerticalBarFrame,\n rememberVerticalBarFrame,\n validVerticalBarFrame,\n} from './shared/vertical-bars-geometry';\nimport { projectionIds } from './shared/projection-id';\nimport { inVerticalBarsSurface, topModal, modalUsesVerticalBars, modalVerticalBarFrame } from './shared/modal';\nimport type { PluginListenerHandle } from '@capacitor/core';\nimport { LIFECYCLE_WILL_ENTER, LIFECYCLE_WILL_LEAVE, LIFECYCLE_DID_ENTER, LIFECYCLE_DID_LEAVE } from './shared/events';\nimport { VERTICAL_BARS_TRANSITION_CANCELED, getNativeSearchBindings, setNativeUIIntegration } from '../native-integration';\nimport { createSearchSupport } from './components/searchable-tabs';\nimport type {\n NativeUIActivation,\n NativeUISnapshot,\n NativeUIRuntimeHandle,\n NativeUIRuntimeOptions,\n NativeUIPlugin,\n NativeUIStatus,\n} from './definitions';\nimport { readCandidate, selector, shadowSelector, motionSelector, isVerticalBarsCandidate } from './components';\nimport {\n activateProjectedElement,\n createVerticalBarsPageState,\n isVerticalBarsSource,\n preferredVerticalBarsBack,\n marker,\n syncToolbarText,\n toolbarTextMarker,\n prehideOnlyMutation,\n rejectedClass,\n unprojected,\n} from './shared/dom';\nimport { createIconRenderer } from './shared/icons';\nimport type { Candidate } from './shared/candidate';\nimport { CSS_MOTION_EVENTS } from './shared/events';\nimport { createCrossfade, fadeMarker } from './shared/crossfade';\n\nconst overlays = 'ion-modal, ion-popover, ion-alert, ion-action-sheet, ion-loading, ion-picker, ion-toast, ion-menu';\n// Only these Web overlays leave the rail's display and interaction intact.\nconst railPreservingOverlays = 'ion-toast, ion-popover, ion-picker';\nconst overlayNames = ['Modal', 'Popover', 'Alert', 'ActionSheet', 'Loading', 'Picker', 'Toast'];\nconst verticalBarsMarker = 'data-native-ui-vertical-bars';\nconst verticalBarsMemberMarker = 'data-native-ui-vertical-bars-member';\n\nexport const createRuntime = async (\n doc: Document,\n plugin: NativeUIPlugin,\n options: NativeUIRuntimeOptions = {},\n nativeVerticalBars: () => boolean = () => true,\n verticalBarsOnly = false,\n onStop?: (cause: 'failure' | 'pagehide') => void,\n): Promise<NativeUIRuntimeHandle & { retain: (deferActivation?: (id: string) => boolean) => () => void }> => {\n const win = doc.defaultView!;\n const extensions = options.extensions ?? [];\n const diagnose = createDiagnostics(options.debug);\n const scope = options.root ?? doc;\n const discovery = [\n options.source === 'extensions'\n ? ':not(*)'\n : options.source === 'html'\n ? htmlSelector\n : options.source === 'auto'\n ? `${selector}, ${htmlSelector}`\n : selector,\n ...extensions.map((extension) => extension.selector),\n ].join(', ');\n const icons = createIconRenderer();\n const crossfade = createCrossfade(win);\n const ids = new WeakMap<Element, string>();\n let rejected = new WeakMap<HTMLElement, string>();\n const sources = new Map<HTMLElement, string | null>();\n const verticalBarsOwners = new Set<HTMLElement>();\n const verticalBarsMembers = new Set<HTMLElement>();\n const suspended = new Set<HTMLElement[]>();\n const pages = new Set<HTMLElement>();\n const verticalBarsPages = createVerticalBarsPageState();\n const presented = new Set<HTMLElement>();\n const railPopovers = new WeakSet<HTMLElement>();\n const manualSuspensions = new Set<symbol>();\n const moving = new Map<HTMLElement, Set<string>>();\n const observed = new Set<Element | ShadowRoot>();\n const listeners = new AbortController();\n let actions = new Map<string, HTMLElement>();\n let nextId = 0;\n let revision = 0;\n const tabGeometry = new Map<HTMLElement, () => void>();\n let acceptedRevision = 0;\n let updatingRevision: number | undefined;\n let pendingActivations: NativeUIActivation[] = [];\n let lastSequence = 0;\n let lastSnapshot = '';\n let viewport = `${win.innerWidth}:${win.innerHeight}`;\n let forceRefresh = false;\n let dirty = false;\n let pending = false;\n let stopped = false;\n let destruction: Promise<void> | undefined;\n const retentions = new Set<{ accepts?: (id: string) => boolean; activation?: NativeUIActivation }>();\n /** True while a tab-switch handoff should skip crossfade. */\n let tabSwitchHandoff = false;\n /** Keep instant updates until this time — DidLeave often precedes the retire sync. */\n let handoffUntil = 0;\n /** Tab switch armed while a sync was already in flight; extend instant past that sync. */\n let handoffAcrossPending = false;\n /** Captured at the start of each sync so an in-flight update keeps a stable duration. */\n let handoffInstant = false;\n /** Retire native controls immediately as a modal starts covering the page. */\n let modalPresentHandoff = false;\n let frame = 0;\n let updates = 0;\n let reason: string | undefined;\n let listener: PluginListenerHandle | undefined;\n let searchListener: PluginListenerHandle | undefined;\n let waiters: (() => void)[] = [];\n const control = (kind: Candidate['control']['kind']): keyof NonNullable<NativeUIRuntimeOptions['controls']> => {\n if (kind === 'tab-bar') return 'tabs';\n if (kind === 'segment') return 'segment';\n if (kind === 'floating-action-button') return 'fab';\n return 'toolbar';\n };\n const controlEnabled = (candidate: Candidate) => {\n if (candidate.control.kind === 'extension') return true;\n const controls = options.controls;\n return controls === undefined || controls[control(candidate.control.kind)] === true;\n };\n const id = (element: Element) => {\n let value = ids.get(element);\n if (!value) {\n value = `native-ui-${++nextId}`;\n ids.set(element, value);\n projectionIds.set(element, value);\n }\n return value;\n };\n const style = doc.createElement('style');\n const hidden = `[${marker}]:not([${fadeMarker}])`;\n style.textContent = `${hidden}, ${hidden} *, ${hidden}::before, ${hidden}::after, ${hidden}::part(native) { visibility: hidden !important; }\n [${marker}], [${marker}] * { pointer-events: none !important; }\n /* Ionic disables the covered page while a menu is open. VerticalBars rail\n controls remain outside that page; zero specificity preserves any\n pointer-events rule supplied by the application itself. */\n :where(.menu-content-open) :where([${verticalBarsMarker}]) {\n pointer-events: auto;\n }\n :where(.menu-content-open) :where([${verticalBarsMarker}]) > :where(:not([${verticalBarsMemberMarker}])) {\n pointer-events: none;\n }`;\n\n const restore = (element: HTMLElement) => {\n lastSnapshot = '';\n search.release(element);\n element.removeAttribute(marker);\n if (!stopped) crossfade.play(element, false, handoffInstant || (isVerticalBarsSource(element) && !element.matches('ion-tab-bar')));\n if (element.getAttribute('aria-hidden') === 'true') {\n const previous = sources.get(element);\n if (previous == null) element.removeAttribute('aria-hidden');\n else element.setAttribute('aria-hidden', previous);\n }\n sources.delete(element);\n element.dispatchEvent(new CustomEvent('nativeUIChange'));\n };\n const restoreAll = () => {\n Array.from(sources.keys()).forEach(restore);\n verticalBarsOwners.forEach((element) => element.removeAttribute(verticalBarsMarker));\n verticalBarsOwners.clear();\n verticalBarsMembers.forEach((element) => element.removeAttribute(verticalBarsMemberMarker));\n verticalBarsMembers.clear();\n };\n const finishWaiters = () => {\n const current = waiters;\n waiters = [];\n current.forEach((resolve) => resolve());\n };\n const schedule = () => {\n if (stopped) return;\n dirty = true;\n if (!pending && !frame) frame = win.requestAnimationFrame(() => void sync());\n };\n const search = createSearchSupport(doc, id, schedule);\n const candidateSources = (candidate: Candidate) => candidate.sources ?? [candidate.element];\n const setRejected = (element: HTMLElement, value: boolean) => {\n element.classList.toggle(rejectedClass, value);\n };\n const measuringPointerPages = new WeakSet<HTMLElement>();\n const readEnabledCandidate = (element: HTMLElement): Candidate | undefined => {\n if (options.root && !options.root.contains(element)) return;\n if (element.matches('ion-back-button') && element.closest('ion-app.ios-theme-vertical-bars') && !isVerticalBarsCandidate(element))\n return;\n if (extensions.some((extension) => element.matches(extension.selector))) {\n const extension = extensions.find((definition) => element.matches(definition.selector))!;\n const unavailable = options.unavailableExtensions?.get(extension.name);\n if (unavailable) {\n diagnose(`${extension.name}: ${unavailable}`, element);\n return;\n }\n const candidate = readExtension(element, extensions, id, (reason) => diagnose(`${extension.name}: ${reason}`, element));\n if (verticalBarsOnly && (!candidate?.control.extension?.tabBarId || !nativeVerticalBars())) {\n if (candidate) diagnose('rail-only: element extensions stay on the Web when verticalBars.only is true.', element);\n return;\n }\n return candidate;\n }\n if (options.source === 'extensions') return;\n if (options.source === 'html' || element.matches(htmlSelector)) {\n const candidate = readHTMLControl(element, id, options);\n if (!candidate) {\n diagnose(\n 'unsupported-control: check the source visibility, accessible name, disabled ancestors, and supported HTML markup.',\n element,\n );\n return;\n }\n const rail = candidate.control.placement === 'vertical-bars';\n if (verticalBarsOnly && !rail) return;\n if (rail && !nativeVerticalBars()) return;\n return candidate;\n }\n if (element.querySelector(htmlSelector)) return; // A shared automatic surface must not cover explicitly selected descendants.\n if (verticalBarsOnly && (!isVerticalBarsCandidate(element) || element.closest('[data-native-ui-placement=\"element\"]'))) return;\n if (options.verticalBars?.enabled === false && isVerticalBarsCandidate(element)) return;\n const pointerPage = isVerticalBarsCandidate(element) ? element.closest<HTMLElement>('.ion-page') : undefined;\n let candidate: Candidate | undefined;\n if (pointerPage && getComputedStyle(pointerPage).pointerEvents === 'none') {\n const previous = pointerPage.style.getPropertyValue('pointer-events');\n const priority = pointerPage.style.getPropertyPriority('pointer-events');\n const hadStyle = pointerPage.hasAttribute('style');\n measuringPointerPages.add(pointerPage);\n pointerPage.style.setProperty('pointer-events', 'auto', 'important');\n try {\n candidate = readCandidate(element, id, options);\n } finally {\n if (previous) pointerPage.style.setProperty('pointer-events', previous, priority);\n else pointerPage.style.removeProperty('pointer-events');\n if (!hadStyle && !pointerPage.style.length) pointerPage.removeAttribute('style');\n win.setTimeout(() => measuringPointerPages.delete(pointerPage), 0);\n }\n } else candidate = readCandidate(element, id, options);\n if (candidate && isVerticalBarsCandidate(element) && !element.closest('[data-native-ui-placement=\"element\"]')) {\n if (!nativeVerticalBars()) return undefined;\n candidate.control.placement = 'vertical-bars';\n if (['button', 'button-group', 'menu-button'].includes(candidate.control.kind)) {\n const slot = (element.matches('ion-buttons') ? element : (element.closest('ion-buttons') ?? element)).getAttribute('slot');\n if (slot === 'start' || slot === 'end') candidate.control.toolbarSlot = slot;\n }\n }\n if (!candidate) diagnose('unsupported-control: check the supported Ionic markup, fixed placement, and styling requirements.', element);\n return candidate && controlEnabled(candidate) ? candidate : undefined;\n };\n const flush = async () => {\n if (stopped) return;\n schedule();\n try {\n await bounded(new Promise<void>((resolve) => waiters.push(resolve)));\n } catch (error) {\n await fail(error);\n }\n };\n const blocked = (element: HTMLElement) =>\n verticalBarsPages.isDeparted(element) ||\n (!isVerticalBarsSource(element) &&\n (Array.from(suspended).some((scopes) => scopes.some((scope) => scope.contains(element))) ||\n Array.from(pages).some((scope) => scope.contains(element)) ||\n Array.from(moving.keys()).some((surface) => surface.contains(element))));\n const painted = () => new Promise<void>((resolve) => win.requestAnimationFrame(() => win.requestAnimationFrame(() => resolve())));\n const overlayOpen = (includeMenu = true, allowModal = false, ignoredSelector?: string) => {\n const modal = topModal(doc);\n const ignored = (element: Element) =>\n (!!ignoredSelector && element.matches(ignoredSelector) && !railPopovers.has(element as HTMLElement)) ||\n (allowModal && !!modal && modalUsesVerticalBars(modal) && element.matches('ion-modal'));\n for (const element of presented) if (!element.isConnected) presented.delete(element);\n const presentedOverlayOpen = Array.from(presented).some(\n (element) => !ignored(element) && (includeMenu || !element.matches('ion-menu')),\n );\n return (\n manualSuspensions.size > 0 ||\n presentedOverlayOpen ||\n Array.from(doc.querySelectorAll(overlays)).some(\n (element) =>\n !ignored(element) &&\n (includeMenu || !element.matches('ion-menu')) &&\n ((element as Element & { presented?: boolean }).presented || element.classList.contains('show-menu')),\n )\n );\n };\n // Compare source data before PNG rendering mutates each item's payload.\n const signature = (candidate: Candidate) =>\n JSON.stringify({ control: candidate.control, icons: candidate.icons.map(({ source }) => source), assets: candidate.assets?.signature });\n const read = (): Candidate[] => {\n search.keepSearchTabsVisible();\n for (const page of pages) if (!page.isConnected) pages.delete(page);\n for (const surface of moving.keys()) if (!surface.isConnected) moving.delete(surface);\n if (doc.hidden || overlayOpen(false, true, railPreservingOverlays)) return [];\n if (win.visualViewport && (win.visualViewport.scale !== 1 || win.visualViewport.offsetTop !== 0) && !search.hasActive()) return [];\n const overlayVisible = overlayOpen();\n // Web rail projections also hide their originals. Measure those sources\n // without releasing the visible clones before native acknowledges ownership.\n const measurableSources = new Set([\n ...sources.keys(),\n ...Array.from(scope.querySelectorAll<HTMLElement>(`[${marker}], [data-native-ui-web-source]`)).filter(isVerticalBarsSource),\n ]);\n const candidates = unprojected(measurableSources, () =>\n search\n .decorate(\n Array.from(scope.querySelectorAll<HTMLElement>(discovery))\n .filter(\n (element) =>\n inVerticalBarsSurface(element) &&\n !verticalBarsPages.isDeparted(element) &&\n (!blocked(element) || (overlayVisible && isVerticalBarsSource(element))),\n )\n .map(readEnabledCandidate)\n .filter((candidate): candidate is Candidate => !!candidate),\n blocked,\n )\n .filter((candidate) => !rejected.has(candidate.element) || rejected.get(candidate.element) !== signature(candidate)),\n );\n // An extension owns its entire source subtree. Never project a nested built-in twice.\n const extensionSources = candidates.filter((candidate) => candidate.control.kind === 'extension');\n const exclusive = candidates.filter((candidate) => {\n if (extensionSources.some((owner) => owner !== candidate && owner.element.contains(candidate.element))) return false;\n const tabBarId = candidate.control.extension?.tabBarId;\n if (!tabBarId) return true;\n // Wait for the owning native tab host; do not cache an early rejection while its icons load.\n return (\n candidates.some(\n (owner) => owner.control.id === tabBarId && owner.control.kind === 'tab-bar' && owner.control.placement === 'vertical-bars',\n ) && extensionSources.filter((source) => source.control.extension?.tabBarId === tabBarId).length === 1\n );\n });\n const back = preferredVerticalBarsBack(\n candidates\n .filter((candidate) => candidate.control.kind === 'back-button' && isVerticalBarsCandidate(candidate.element))\n .map((candidate) => candidate.element),\n doc,\n );\n const selected = exclusive.filter(\n (candidate) => candidate.control.kind !== 'back-button' || !isVerticalBarsCandidate(candidate.element) || candidate.element === back,\n );\n return overlayVisible ? selected.filter((candidate) => isVerticalBarsCandidate(candidate.element)) : selected;\n };\n const observe = () => {\n const wanted = new Set<Element | ShadowRoot>();\n for (const element of Array.from(scope.querySelectorAll<HTMLElement>(discovery))) {\n wanted.add(element);\n if (element.parentElement) wanted.add(element.parentElement);\n if (extensions.some((extension) => element.matches(extension.selector))) {\n for (const ancestor of extensionAncestors(element)) {\n wanted.add(ancestor);\n const root = ancestor.getRootNode();\n if (root instanceof ShadowRoot) wanted.add(root);\n }\n }\n const inspectShadow = (node: Element) => {\n if (node.shadowRoot) {\n wanted.add(node.shadowRoot);\n node.shadowRoot.querySelectorAll('ion-icon').forEach(inspectShadow);\n }\n };\n inspectShadow(element);\n element.querySelectorAll(shadowSelector).forEach(inspectShadow);\n }\n // Reconnect only when the set changes; no per-frame observer allocation.\n if (wanted.size === observed.size && Array.from(wanted).every((element) => observed.has(element))) return;\n observer.disconnect();\n resize.disconnect();\n for (const element of observed) if (element instanceof ShadowRoot) element.removeEventListener('scroll', schedule, true);\n observed.clear();\n observer.observe(doc.documentElement, observation);\n for (const element of wanted) {\n observed.add(element);\n if (element instanceof ShadowRoot) {\n observer.observe(element, observation);\n on(element, 'scroll');\n } else resize.observe(element);\n }\n };\n const fail = async (error: unknown) => {\n reason = error instanceof Error ? error.message : String(error);\n console.warn('[Native UI] Returning to Web:', reason);\n const destruction = handle.destroy();\n onStop?.('failure');\n await destruction;\n // The Web fallback re-evaluates eligibility once native projection is stopped.\n win.dispatchEvent(new Event('nativeUIRefresh'));\n };\n const sync = async () => {\n frame = 0;\n dirty = false;\n pending = true;\n if (options.source !== 'extensions') syncToolbarText(doc);\n handoffInstant = tabSwitchHandoff || handoffAcrossPending || modalPresentHandoff || win.performance.now() < handoffUntil;\n try {\n // A retained sync performs no update; keep the modal handoff armed so the\n // deferred retirement still runs instantly after the overlay releases.\n if (retentions.size && !manualSuspensions.size) return;\n modalPresentHandoff = false;\n const size = `${win.innerWidth}:${win.innerHeight}`;\n // WebKit can resize before Ionic's fixed DOM positions catch up.\n // Measure on the next frame instead of retiring a valid native search.\n if (viewport !== size) {\n viewport = size;\n dirty = true;\n return;\n }\n observe();\n let candidates = read();\n const signatures = new Map(candidates.map((candidate) => [candidate.element, signature(candidate)]));\n const failedAssets = new Set<Candidate>();\n for (const candidate of candidates) {\n try {\n await candidate.assets?.render(icons);\n } catch {\n failedAssets.add(candidate);\n diagnose('invalid-assets: image conversion or serialized extension props failed.', candidate.element);\n }\n for (const icon of candidate.icons) {\n const field = icon.field ?? 'icon';\n icon.item[field] = await icons.render(\n icon.source,\n field === 'icon' ? icon.item.iconWidth! : icon.item.closeIconWidth!,\n field === 'icon' ? icon.item.iconHeight! : icon.item.closeIconHeight!,\n );\n }\n }\n candidates = candidates.filter((candidate) => !failedAssets.has(candidate));\n if (stopped || dirty || (retentions.size && !manualSuspensions.size)) return;\n const retained = new Set(candidates.flatMap(candidateSources));\n const removed = Array.from(sources.keys()).filter((element) => !retained.has(element));\n if (removed.some(isVerticalBarsSource)) {\n actions.forEach(forgetVerticalBarFrame);\n try {\n const geometry = await bounded(\n plugin.getVerticalBarsGeometry({ viewportWidth: win.innerWidth, ids: [...actions.keys(), 'BackButton', '__tabBar'] }),\n );\n if (stopped || dirty || (retentions.size && !manualSuspensions.size)) return;\n if (geometry.revision === acceptedRevision && size === `${win.innerWidth}:${win.innerHeight}`) {\n for (const tabBar of removed.filter((element) => element.matches('ion-tab-bar'))) {\n tabGeometry.get(tabBar)?.();\n tabGeometry.delete(tabBar);\n const items = new Map(\n [...actions]\n .filter(\n ([id, element]) => element.parentElement === tabBar && geometry.items[id] && validVerticalBarFrame(geometry.items[id]),\n )\n .map(([id, element]) => [element, geometry.items[id]]),\n );\n if (\n geometry.items['__tabBar'] &&\n validVerticalBarFrame(geometry.items['__tabBar']) &&\n items.size === tabBar.querySelectorAll('ion-tab-button').length\n )\n tabGeometry.set(tabBar, alignVerticalTabBar(tabBar, geometry.items['__tabBar'], items));\n }\n for (const [id, element] of actions) {\n const frame = geometry.items[element.matches('ion-back-button') ? 'BackButton' : id];\n if (frame) rememberVerticalBarFrame(element, frame);\n }\n }\n } catch {\n /* Older native binaries can still use the CSS fallback. */\n }\n }\n if (removed.length) {\n // Restore the source and let WebKit paint before removing its native cover.\n removed.forEach(restore);\n if (removed.some(isVerticalBarsSource))\n win.dispatchEvent(new CustomEvent('nativeUIVerticalBarsRelease', { detail: { instant: handoffInstant } }));\n // The outgoing tab is no longer visible, so waiting two frames only leaves its\n // native snapshot over the destination. Stack transitions still need the paint.\n if (!handoffInstant) {\n await painted();\n if (stopped || dirty) return;\n }\n }\n const root = doc.querySelector('ion-app.ios-theme-vertical-bars');\n const verticalBarEdge: 'left' | 'right' | undefined = options.nativeState?.edge\n ? options.nativeState.edge\n : options.rail\n ? options.rail.edge\n : root\n ? root.classList.contains('ios-theme-vertical-bars-left')\n ? 'left'\n : 'right'\n : undefined;\n const modal = topModal(doc);\n const verticalBarFrame = modal && modalUsesVerticalBars(modal) ? modalVerticalBarFrame(modal) : undefined;\n const data = {\n verticalBarFrame,\n viewportWidth: win.innerWidth,\n verticalBarEdge,\n controls: candidates.map((candidate) => candidate.control),\n };\n const serialized = JSON.stringify(data);\n if (serialized === lastSnapshot && !forceRefresh) return;\n const snapshot: NativeUISnapshot = { ...data, revision: ++revision, transitionDuration: crossfade.duration(handoffInstant) };\n // A native visibility notification during this update must survive its ack.\n forceRefresh = false;\n updates++;\n updatingRevision = snapshot.revision;\n const result = await bounded(plugin.update(snapshot));\n if (stopped || (retentions.size && !manualSuspensions.size)) return;\n if (result.revision !== snapshot.revision) throw new Error('Native UI revision mismatch');\n if (`${win.innerWidth}:${win.innerHeight}` !== size) {\n lastSnapshot = '';\n dirty = true;\n return;\n }\n if (result.rejectedSearches?.length) {\n search.reject(result.rejectedSearches);\n lastSnapshot = '';\n dirty = true;\n }\n for (const candidate of candidates) {\n if (result.rejectedControls?.includes(candidate.control.id)) {\n diagnose(\n 'native-rejected: the native renderer rejected this source; check decoded props, placement, and device support.',\n candidate.element,\n );\n rejected.set(candidate.element, signatures.get(candidate.element)!);\n setRejected(candidate.element, true);\n dirty = true;\n }\n }\n // A page mutation must not tear down unchanged shared controls such as tabs.\n const currentCandidates = dirty ? read() : candidates;\n const current = dirty ? new Map(currentCandidates.map((candidate) => [candidate.element, signature(candidate)])) : signatures;\n const currentSources = new Set(currentCandidates.flatMap(candidateSources));\n const accepted = candidates.filter((candidate) => current.get(candidate.element) === signatures.get(candidate.element));\n accepted.forEach((candidate) => setRejected(candidate.element, false));\n const acceptedVerticalBarsOwners = new Set(\n accepted.filter((candidate) => candidate.control.placement === 'vertical-bars').map((candidate) => candidate.element),\n );\n const acceptedVerticalBarsMembers = new Set(\n accepted\n .filter((candidate) => candidate.control.placement === 'vertical-bars')\n .flatMap((candidate) => Array.from(candidate.actions.values())),\n );\n const invalidated = candidates.length !== accepted.length;\n acceptedRevision = result.revision;\n lastSnapshot = invalidated ? '' : serialized;\n actions = new Map(\n candidates.filter((candidate) => current.has(candidate.element)).flatMap((candidate) => Array.from(candidate.actions)),\n );\n // Keep an existing cover while its content catches up. Only an ineligible\n // source needs to return to Web; new sources still require an exact ack.\n for (const element of sources.keys()) if (!currentSources.has(element)) restore(element);\n for (const element of verticalBarsOwners) {\n if (acceptedVerticalBarsOwners.has(element)) continue;\n element.removeAttribute(verticalBarsMarker);\n verticalBarsOwners.delete(element);\n }\n if (acceptedVerticalBarsOwners.size)\n win.dispatchEvent(new CustomEvent('nativeUIVerticalBarsAcquire', { detail: { instant: handoffInstant } }));\n for (const element of acceptedVerticalBarsOwners) {\n element.setAttribute(verticalBarsMarker, '');\n verticalBarsOwners.add(element);\n }\n for (const element of verticalBarsMembers) {\n if (acceptedVerticalBarsMembers.has(element)) continue;\n element.removeAttribute(verticalBarsMemberMarker);\n verticalBarsMembers.delete(element);\n }\n for (const element of acceptedVerticalBarsMembers) {\n element.setAttribute(verticalBarsMemberMarker, '');\n verticalBarsMembers.add(element);\n }\n for (const element of accepted.flatMap(candidateSources)) {\n const newlyProjected = !sources.has(element) || !element.hasAttribute(marker);\n if (!sources.has(element)) {\n sources.set(element, element.getAttribute('aria-hidden'));\n crossfade.play(element, true, handoffInstant || (isVerticalBarsSource(element) && !element.matches('ion-tab-bar')));\n }\n element.setAttribute(marker, '');\n element.setAttribute('aria-hidden', 'true');\n if (newlyProjected) element.dispatchEvent(new CustomEvent('nativeUIChange'));\n }\n const received = pendingActivations;\n pendingActivations = [];\n received.forEach(activate);\n await crossfade.settled();\n // Geometry belongs to the outgoing tab visual, not to other rail owners.\n // Keep it until that visual has completely faded back to native.\n for (const [tabBar, restore] of tabGeometry) {\n if (!tabBar.isConnected || acceptedVerticalBarsOwners.has(tabBar)) {\n restore();\n tabGeometry.delete(tabBar);\n }\n }\n if (invalidated) {\n dirty = true;\n // Sources that became ineligible must paint before their cover is removed.\n await painted();\n }\n } catch (error) {\n await fail(error);\n } finally {\n updatingRevision = undefined;\n pendingActivations = [];\n // A refresh received before the ack must also invalidate that ack's rejects.\n if (forceRefresh) rejected = new WeakMap();\n // A tab switch mid-update (or a dirty follow-up) must keep instant through the retire sync.\n if (!stopped && (handoffAcrossPending || (handoffInstant && dirty))) {\n handoffUntil = Math.max(handoffUntil, win.performance.now() + 400);\n }\n handoffAcrossPending = false;\n pending = false;\n if (dirty && !stopped) schedule();\n else finishWaiters();\n }\n };\n const observation: MutationObserverInit = {\n subtree: true,\n childList: true,\n characterData: true,\n attributes: true,\n attributeOldValue: true,\n };\n const observer = new MutationObserver((records) => {\n if (\n records.some(\n (record) =>\n record.attributeName !== marker &&\n record.attributeName !== 'data-native-ui-web-source' &&\n record.attributeName !== toolbarTextMarker &&\n record.attributeName !== fadeMarker &&\n !prehideOnlyMutation(record) &&\n !(record.attributeName === 'style' && measuringPointerPages.has(record.target as HTMLElement)) &&\n !(\n record.attributeName === 'aria-hidden' &&\n sources.has(record.target as HTMLElement) &&\n (record.target as Element).getAttribute('aria-hidden') === 'true'\n ),\n )\n )\n schedule();\n });\n const resize = new ResizeObserver(schedule);\n const on = (target: EventTarget, name: string, callback: EventListener = schedule) =>\n target.addEventListener(name, callback, { capture: true, signal: listeners.signal });\n const pageWill: EventListener = (event) => {\n const page = event.target as HTMLElement;\n verticalBarsPages.lifecycle(event);\n getNativeSearchBindings(doc)\n .filter((binding) => page.contains(binding.footer))\n .forEach((binding) => search.retire(binding));\n // Angular updates the URL before willLeave, but keeps ion-tab-bar.selectedTab on the\n // leaving tab until DidChange. A mismatch means this leave is a tab switch, not a stack push.\n if (event.type === LIFECYCLE_WILL_LEAVE) beginTabSwitchHandoffIfNeeded(page);\n pages.add(page);\n schedule();\n };\n const pageDid: EventListener = (event) => {\n const page = event.target as HTMLElement;\n verticalBarsPages.lifecycle(event);\n pages.delete(page);\n schedule();\n if (tabSwitchHandoff && pages.size === 0) endTabSwitchHandoff();\n };\n const tabOfPath = (tabs: Element, pathname: string) => {\n let best: { tab: string; length: number } | undefined;\n for (const button of Array.from(tabs.querySelectorAll('ion-tab-button'))) {\n const tab = button.getAttribute('tab');\n const href = button.getAttribute('href')?.split(/[?#]/)[0];\n if (!tab || !href) continue;\n if (pathname === href || pathname.startsWith(`${href}/`)) {\n if (!best || href.length > best.length) best = { tab, length: href.length };\n }\n }\n return best?.tab;\n };\n const armTabSwitchHandoff = () => {\n tabSwitchHandoff = true;\n // Retiring outgoing controls often lands in a later async sync than WillLeave/DidChange.\n handoffUntil = Math.max(handoffUntil, win.performance.now() + 400);\n // The in-flight sync already captured handoffInstant=false; hold instant for the next one.\n if (pending) handoffAcrossPending = true;\n };\n const beginTabSwitchHandoffIfNeeded = (page: HTMLElement) => {\n const tabs = page.closest('ion-tabs');\n if (!tabs) return;\n const bar = tabs.querySelector('ion-tab-bar');\n const selected =\n (bar && 'selectedTab' in bar ? String((bar as HTMLElement & { selectedTab?: string }).selectedTab ?? '') : '') ||\n tabs.querySelector('ion-tab-button.tab-selected')?.getAttribute('tab') ||\n undefined;\n const destination = tabOfPath(tabs, win.location.pathname);\n if (selected && destination && selected !== destination) armTabSwitchHandoff();\n };\n // DidChange / pageDid can land in the same turn as WillLeave. Clear the sticky flag on the\n // next frame; handoffUntil / handoffAcrossPending still cover the async retire sync.\n const endTabSwitchHandoff = () => {\n win.requestAnimationFrame(() => {\n if (stopped || !tabSwitchHandoff) return;\n tabSwitchHandoff = false;\n schedule();\n });\n };\n const motion: EventListener = (event) => {\n const target = event.target as HTMLElement;\n if (!target.matches?.(`${motionSelector}, ${discovery}`) && !(options.source !== 'ionic' && target.querySelector?.(discovery))) return;\n const key = (event as TransitionEvent).propertyName ?? (event as AnimationEvent).animationName;\n if (event.type === CSS_MOTION_EVENTS.transitionRun || event.type === CSS_MOTION_EVENTS.animationStart) {\n const keys = moving.get(target) ?? new Set<string>();\n keys.add(key);\n moving.set(target, keys);\n } else {\n moving.get(target)?.delete(key);\n if (!moving.get(target)?.size) moving.delete(target);\n }\n schedule();\n };\n for (const name of Object.values(CSS_MOTION_EVENTS)) on(doc, name, motion);\n for (const name of [LIFECYCLE_WILL_ENTER, LIFECYCLE_WILL_LEAVE]) on(doc, name, pageWill);\n for (const name of [LIFECYCLE_DID_ENTER, LIFECYCLE_DID_LEAVE]) on(doc, name, pageDid);\n on(doc, VERTICAL_BARS_TRANSITION_CANCELED, (event) => {\n const leaving = event.target as HTMLElement;\n const entering = (event as CustomEvent<{ entering?: HTMLElement }>).detail?.entering;\n verticalBarsPages.cancel(entering, leaving);\n pages.delete(leaving);\n if (entering) pages.delete(entering);\n schedule();\n });\n on(doc, 'ionTabsWillChange', () => {\n // Vanilla ion-tabs dispatches DOM events; @ionic/angular uses EventEmitters instead.\n armTabSwitchHandoff();\n schedule();\n });\n on(doc, 'ionTabsDidChange', endTabSwitchHandoff);\n const overlayPresenting = (element: HTMLElement) => {\n presented.add(element);\n if (element.matches('ion-popover')) {\n const trigger = popoverTrigger(element as HTMLIonPopoverElement);\n // Remember the source before native ownership changes. A successful native\n // popover retains projection; a Web fallback must retire the rail instead.\n if (trigger?.matches('ion-button') && isVerticalBarsSource(trigger as HTMLElement)) railPopovers.add(element);\n else railPopovers.delete(element);\n }\n if (element.matches('ion-modal')) {\n modalPresentHandoff = true;\n // A pending bridge update must retire the old controls immediately too.\n if (pending) handoffInstant = true;\n }\n schedule();\n };\n // Adoption changes the document, but not the in-flight Ionic event path.\n // Do not replay WillPresent: application handlers must run exactly once.\n on(doc, 'nativeUIOverlayAdopted', (event) => overlayPresenting((event as CustomEvent<HTMLElement>).detail));\n for (const name of overlayNames) {\n on(doc, `ion${name}WillPresent`, (event) => overlayPresenting(event.target as HTMLElement));\n on(doc, `ion${name}DidDismiss`, (event) => {\n presented.delete(event.target as HTMLElement);\n railPopovers.delete(event.target as HTMLElement);\n schedule();\n });\n }\n const eventMenu = (event: Event) =>\n event.composedPath().find((target): target is HTMLElement => target instanceof HTMLElement && target.matches('ion-menu'));\n on(doc, 'ionWillOpen', (event) => {\n const menu = eventMenu(event);\n if (menu) presented.add(menu);\n schedule();\n });\n on(doc, 'ionDidClose', (event) => {\n const menu = eventMenu(event);\n if (menu) presented.delete(menu);\n schedule();\n });\n for (const name of [\n 'ionChange',\n 'ionSelect',\n 'ionImgDidLoad',\n CSS_MOTION_EVENTS.transitionEnd,\n CSS_MOTION_EVENTS.animationEnd,\n 'focusin',\n 'focusout',\n ])\n on(doc, name);\n const refreshLayout = () => {\n rejected = new WeakMap();\n forceRefresh = true;\n schedule();\n };\n on(doc, 'visibilitychange', () => {\n if (doc.hidden) {\n getNativeSearchBindings(doc).forEach((binding) => search.retire(binding));\n schedule();\n } else refreshLayout();\n });\n on(win, 'resize', refreshLayout);\n on(win, 'keyboardWillShow', () => search.keyboard(true));\n on(win, 'keyboardWillHide', () => search.keyboard(false));\n on(win, 'scroll');\n on(win.matchMedia('(prefers-color-scheme: dark)'), 'change');\n on(win, 'nativeUIRefresh', (event) => {\n if ((event as Event & { retireSearch?: boolean }).retireSearch)\n getNativeSearchBindings(doc).forEach((binding) => search.retire(binding));\n refreshLayout();\n });\n if (win.visualViewport) {\n on(win.visualViewport, 'resize', refreshLayout);\n on(win.visualViewport, 'scroll');\n }\n const handle: NativeUIRuntimeHandle & { retain: (deferActivation?: (id: string) => boolean) => () => void } = {\n // A native overlay covers this surface; keep its controls and Web ownership intact.\n retain(deferActivation) {\n const retention: { accepts?: (id: string) => boolean; activation?: NativeUIActivation } = { accepts: deferActivation };\n retentions.add(retention);\n return () => {\n if (!retentions.delete(retention)) return;\n // UIKit may already expose the anchor while Ionic is still dismissing.\n // Replay at most one validated input after the live content is restored.\n const activation = retention.activation;\n if (activation && retention.accepts?.(activation.id)) win.queueMicrotask(() => activate(activation));\n schedule();\n };\n },\n markForCheck: schedule,\n getStatus: (): NativeUIStatus => ({\n state: stopped ? 'stopped' : sources.size ? 'native' : 'web',\n projected: sources.size,\n updates,\n reason,\n }),\n async suspend() {\n const token = Symbol();\n let resumed = false;\n if (!stopped) {\n manualSuspensions.add(token);\n getNativeSearchBindings(doc).forEach((binding) => search.retire(binding));\n await flush();\n }\n return {\n async resume() {\n if (resumed) return;\n resumed = true;\n if (stopped || !manualSuspensions.delete(token)) return;\n await flush();\n },\n };\n },\n destroy() {\n if (destruction) return destruction;\n stopped = true;\n destruction = Promise.resolve().then(async () => {\n tabGeometry.forEach((restore) => restore());\n tabGeometry.clear();\n setNativeUIIntegration(doc);\n win.cancelAnimationFrame(frame);\n listeners.abort();\n observer.disconnect();\n resize.disconnect();\n observed.clear();\n actions.clear();\n pendingActivations = [];\n search.destroy();\n crossfade.destroy();\n restoreAll();\n if (!doc.hidden) await painted();\n try {\n await bounded(plugin.clear({ revision: ++revision }));\n } catch {\n /* Always restore the Web, even after bridge loss. */\n }\n style.remove();\n doc.querySelectorAll<HTMLElement>(`.${rejectedClass}`).forEach((element) => setRejected(element, false));\n icons.clear();\n pages.clear();\n presented.clear();\n manualSuspensions.clear();\n moving.clear();\n suspended.clear();\n if (listener) await bounded(listener.remove()).catch(() => {});\n if (searchListener) await bounded(searchListener.remove()).catch(() => {});\n finishWaiters();\n });\n return destruction;\n },\n };\n const activate = (event: NativeUIActivation) => {\n const accepted = dispatchActivation(event);\n if (event.requestId && accepted !== undefined) {\n void bounded(plugin.completeExtensionAction({ requestId: event.requestId, accepted })).catch(() => {});\n }\n };\n const dispatchActivation = (event: NativeUIActivation): boolean | undefined => {\n if (stopped || doc.hidden || event.revision < acceptedRevision || event.revision > revision || event.sequence <= lastSequence)\n return false;\n const element = actions.get(event.id);\n const owner = element && Array.from(sources.keys()).find((source) => source === element || source.contains(element));\n const ignored = owner && isVerticalBarsSource(owner) ? (retentions.size ? 'ion-toast, ion-picker' : railPreservingOverlays) : undefined;\n if (overlayOpen(false, true, ignored)) {\n if (!manualSuspensions.size) {\n for (const retention of retentions) {\n if (retention.accepts?.(event.id) && (!retention.activation || event.sequence > retention.activation.sequence))\n retention.activation = event;\n }\n }\n return false;\n }\n // Native may send input before update() resolves on the JS bridge.\n // Revalidate it after ownership is accepted, using the same action path.\n if (event.revision > acceptedRevision && event.revision === updatingRevision) {\n pendingActivations.push(event);\n return;\n }\n lastSequence = event.sequence;\n if (!element) return false;\n if (!owner || !inVerticalBarsSurface(owner)) return false;\n const direct = !blocked(owner) && unprojected(sources.keys(), () => readEnabledCandidate(owner));\n const candidate = direct || read().find((candidate) => candidate.actions.has(event.id));\n const item = candidate?.control.items.find((item) => item.id === event.id);\n const searchAction =\n candidate?.control.search && [candidate.control.search.trigger.id, candidate.control.search.closeId].includes(event.id);\n const extensionAction = candidate?.control.kind === 'extension' && candidate.actions.get(event.id) === element;\n if (!extensionAction && !searchAction && (!item || item.disabled || item.visible === false)) return false;\n // The original Ionic host owns form submission, routerLink and selection events.\n activateProjectedElement(element);\n lastSnapshot = ''; // Reconcile even if Ionic rejects the proposed native selection.\n schedule();\n return true;\n };\n try {\n listener = await boundedListener(plugin.addListener('activate', activate));\n searchListener = await boundedListener(\n plugin.addListener('search', (event) => {\n if (\n stopped ||\n doc.hidden ||\n event.revision < acceptedRevision ||\n event.revision > revision ||\n overlayOpen(true, false, nativeVerticalBars() ? (retentions.size ? 'ion-toast, ion-picker' : railPreservingOverlays) : undefined)\n )\n return;\n search.event(event);\n }),\n );\n doc.head.append(style);\n observer.observe(doc.documentElement, observation);\n setNativeUIIntegration(doc, {\n async search(binding, active, focus) {\n if (!getNativeSearchBindings(doc).includes(binding) || !search.projected(binding)) return false;\n if (!active) {\n search.setStatus(binding, false);\n } else {\n const entering = !binding.active;\n if (entering) search.begin(binding, revision + 1);\n const nextFocused = focus === true ? true : focus === false ? false : entering ? false : binding.focused;\n search.setStatus(binding, true, nextFocused);\n }\n await flush();\n return !stopped && search.projected(binding);\n },\n async suspend(scopes) {\n getNativeSearchBindings(doc)\n .filter((binding) => scopes.some((scope) => scope.contains(binding.footer) || scope.contains(binding.tabBar)))\n .forEach((binding) => search.retire(binding));\n suspended.add(scopes);\n await flush();\n // Source DOM has been restored before Ionic starts moving it.\n await new Promise<void>((resolve) => win.requestAnimationFrame(() => resolve()));\n return (canceled = false) => {\n suspended.delete(scopes);\n if (canceled || !scopes.some((scope) => scope.closest('ion-app.ios-theme-vertical-bars'))) {\n scopes.forEach((scope) => pages.delete(scope)); // Preserve ordinary iPhone handoff; cancellation has no DidLeave.\n if (canceled) {\n verticalBarsPages.cancel(scopes[0], scopes[1]); // The entering page is abandoned; the leaving page stays active.\n }\n }\n schedule();\n };\n },\n });\n on(win, 'pagehide', () => {\n void handle.destroy();\n onStop?.('pagehide');\n });\n schedule();\n } catch (error) {\n await fail(error);\n }\n return handle;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA2CA,MAAM,W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AA4B,QAAQ,CAAC,CAAC;IAC/E,QAAQ,WAAW,UAAU;KAC3B,UAAU,OAAO,MAAM;KACvB,IAAI,YAAY,CAAC,OAAO,MAAM,UAAU,MAAM,QAAQ,iCAAiC,CAAC,GAAG;MACzF,OAAO,SAAS,UAAU,MAAM,OAAO,KAAK,CAAC;MAC7C,IAAI,UACF,kBAAkB,OAAO,OAAO,IAAI,OAAO,EAAE;KAEjD;KACA,SAAS;IACX;GACF;EACF,CAAC;EACD,GAAG,KAAK,kBAAkB;GACxB,OAAY,QAAQ;GACpB,SAAS,UAAU;EACrB,CAAC;EACD,SAAS;CACX,SAAS,OAAO;EACd,MAAM,KAAK,KAAK;CAClB;CACA,OAAO;AACT"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PluginListenerHandle } from "@capacitor/core";
|
|
2
|
+
//#region src/native/shared/bridge.d.ts
|
|
3
|
+
export declare const bounded: <T>(promise: Promise<T>) => Promise<T>;
|
|
4
|
+
export declare const boundedListener: (registration: Promise<PluginListenerHandle>) => Promise<PluginListenerHandle>;
|
|
5
|
+
//#endregion
|
|
6
|
+
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","names":[],"sources":["../../../src/native/shared/bridge.ts"],"mappings":";;qBAGa,UAAW,GAAG,SAAS,QAAQ,OAAK,QAAQ;qBAO5C,kBAAyB,cAAc,QAAQ,0BAAwB,QAAQ"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/native/shared/bridge.ts
|
|
2
|
+
const bounded = (promise) => new Promise((resolve, reject) => {
|
|
3
|
+
const timer = setTimeout(() => reject(/* @__PURE__ */ new Error("Native UI bridge timed out")), 5e3);
|
|
4
|
+
promise.then(resolve, reject).finally(() => clearTimeout(timer));
|
|
5
|
+
});
|
|
6
|
+
/** A timed-out registration still owns a native resource if it eventually succeeds. */
|
|
7
|
+
const boundedListener = async (registration) => {
|
|
8
|
+
try {
|
|
9
|
+
return await bounded(registration);
|
|
10
|
+
} catch (error) {
|
|
11
|
+
registration.then((listener) => listener.remove()).catch(() => {});
|
|
12
|
+
throw error;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { bounded, boundedListener };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.js","names":[],"sources":["../../../src/native/shared/bridge.ts"],"sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\n// A failed bridge must not leave the source inaccessible indefinitely.\nexport const bounded = <T>(promise: Promise<T>): Promise<T> =>\n new Promise((resolve, reject) => {\n const timer = setTimeout(() => reject(new Error('Native UI bridge timed out')), 5000);\n promise.then(resolve, reject).finally(() => clearTimeout(timer));\n });\n\n/** A timed-out registration still owns a native resource if it eventually succeeds. */\nexport const boundedListener = async (registration: Promise<PluginListenerHandle>): Promise<PluginListenerHandle> => {\n try {\n return await bounded(registration);\n } catch (error) {\n void registration.then((listener) => listener.remove()).catch(() => {});\n throw error;\n }\n};\n"],"mappings":";AAGA,MAAa,WAAc,YACzB,IAAI,SAAS,SAAS,WAAW;CAC/B,MAAM,QAAQ,iBAAiB,uBAAO,IAAI,MAAM,4BAA4B,CAAC,GAAG,GAAI;CACpF,QAAQ,KAAK,SAAS,MAAM,CAAC,CAAC,cAAc,aAAa,KAAK,CAAC;AACjE,CAAC;;AAGH,MAAa,kBAAkB,OAAO,iBAA+E;CACnH,IAAI;EACF,OAAO,MAAM,QAAQ,YAAY;CACnC,SAAS,OAAO;EACd,aAAkB,MAAM,aAAa,SAAS,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;EACtE,MAAM;CACR;AACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createIconRenderer } from "./icons.js";
|
|
2
|
+
import { NativeUIComponent, NativeUIControl, NativeUIControlKind, NativeUIItem, VerticalControlAreaOptions } from "../definitions.js";
|
|
3
|
+
//#region src/native/shared/candidate.d.ts
|
|
4
|
+
export interface Candidate {
|
|
5
|
+
assets?: {
|
|
6
|
+
signature: string;
|
|
7
|
+
render(renderer: ReturnType<typeof createIconRenderer>): Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
buttonProjection?: VerticalControlAreaOptions['buttonProjection'];
|
|
10
|
+
buttonDefaultFill?: VerticalControlAreaOptions['buttonDefaultFill'];
|
|
11
|
+
element: HTMLElement;
|
|
12
|
+
sources?: HTMLElement[];
|
|
13
|
+
control: NativeUIControl;
|
|
14
|
+
actions: Map<string, HTMLElement>;
|
|
15
|
+
icons: {
|
|
16
|
+
item: NativeUIItem;
|
|
17
|
+
source: string;
|
|
18
|
+
field?: 'closeIcon';
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
21
|
+
export type Identify = (element: HTMLElement) => string;
|
|
22
|
+
export declare const createCandidate: (element: HTMLElement, kind: NativeUIComponent | NativeUIControlKind, id: Identify, options?: VerticalControlAreaOptions) => Candidate;
|
|
23
|
+
export declare const appendItem: (candidate: Candidate, child: HTMLElement, id: Identify, content?: ParentNode, label?: string) => NativeUIItem | undefined;
|
|
24
|
+
//#endregion
|
|
25
|
+
//# sourceMappingURL=candidate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"candidate.d.ts","names":[],"sources":["../../../src/native/shared/candidate.ts"],"mappings":";;;iBAIiB;EACf;IAAW;IAAmB,OAAO,UAAU,kBAAkB,sBAAsB;;EACvF,mBAAmB;EACnB,oBAAoB;EACpB,SAAS;EACT,UAAU;EACV,SAAS;EACT,SAAS,YAAY;EACrB;IAAS,MAAM;IAAc;IAAgB;;;YAGnC,YAAY,SAAS;qBAGpB,kBACX,SAAS,aACT,MAAM,oBAAoB,qBAC1B,IAAI,UACJ,UAAS,+BACR;qBAgCU,aACX,WAAW,WACX,OAAO,aACP,IAAI,UACJ,UAAS,YACT,mBACC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { frame, isDark, isVerticalBarsSource, text, visible } from "./dom.js";
|
|
2
|
+
import { iconSource } from "./icons.js";
|
|
3
|
+
//#region src/native/shared/candidate.ts
|
|
4
|
+
const createCandidate = (element, kind, id, options = {}) => {
|
|
5
|
+
const rect = element.getBoundingClientRect();
|
|
6
|
+
const style = getComputedStyle(element);
|
|
7
|
+
return {
|
|
8
|
+
element,
|
|
9
|
+
buttonProjection: options.buttonProjection,
|
|
10
|
+
buttonDefaultFill: options.buttonDefaultFill,
|
|
11
|
+
control: {
|
|
12
|
+
id: id(element),
|
|
13
|
+
kind: {
|
|
14
|
+
"ion-button": "button",
|
|
15
|
+
"ion-buttons": "button-group",
|
|
16
|
+
"ion-back-button": "back-button",
|
|
17
|
+
"ion-menu-button": "menu-button",
|
|
18
|
+
"ion-tab-bar": "tab-bar",
|
|
19
|
+
"ion-segment": "segment",
|
|
20
|
+
"ion-fab": "floating-action-button"
|
|
21
|
+
}[kind] ?? kind,
|
|
22
|
+
...frame(rect),
|
|
23
|
+
items: [],
|
|
24
|
+
dark: isDark(style),
|
|
25
|
+
rtl: style.direction === "rtl"
|
|
26
|
+
},
|
|
27
|
+
actions: /* @__PURE__ */ new Map(),
|
|
28
|
+
icons: []
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
const appendItem = (candidate, child, id, content = child, label = text(child)) => {
|
|
32
|
+
if (!visible(child, isVerticalBarsSource(candidate.element)) || child.querySelector("input, button, a, img, canvas, video, ion-spinner, ion-avatar")) return;
|
|
33
|
+
const icons = Array.from(content.querySelectorAll("ion-icon"));
|
|
34
|
+
const directSVGs = Array.from(content.querySelectorAll("svg"));
|
|
35
|
+
if (icons.length + directSVGs.length > 1) return void 0;
|
|
36
|
+
const svg = directSVGs[0] ?? icons[0]?.shadowRoot?.querySelector("svg");
|
|
37
|
+
if (icons.length && !svg) return void 0;
|
|
38
|
+
const labelElement = content.querySelector("[part=\"text\"], ion-label") ?? child;
|
|
39
|
+
const native = child.shadowRoot?.querySelector("[part=\"native\"]");
|
|
40
|
+
const labelStyle = getComputedStyle(labelElement);
|
|
41
|
+
const badge = child.querySelector("ion-badge");
|
|
42
|
+
const badgeStyle = badge && visible(badge) ? getComputedStyle(badge) : void 0;
|
|
43
|
+
const sourceFill = child.fill;
|
|
44
|
+
const projectionOwner = [child, child.closest("ion-buttons")].find((element) => element?.matches("[data-projection=\"source\"], [data-projection=\"system\"], .ios-theme-projection-source, .ios-theme-projection-system"));
|
|
45
|
+
const attributeProjection = projectionOwner?.getAttribute("data-projection");
|
|
46
|
+
const systemButton = (attributeProjection === "source" || attributeProjection === "system" ? attributeProjection : projectionOwner ? projectionOwner.classList.contains("ios-theme-projection-system") ? "system" : "source" : candidate.buttonProjection) !== "source" && isVerticalBarsSource(child) && child.matches("ion-button, ion-menu-button");
|
|
47
|
+
const defaultFill = child.closest("ion-buttons") ? "clear" : candidate.buttonDefaultFill;
|
|
48
|
+
const fill = !sourceFill || sourceFill === "default" ? defaultFill : sourceFill;
|
|
49
|
+
const buttonFill = !systemButton && isVerticalBarsSource(child) && child.matches("ion-button") && (fill === "clear" || fill === "solid" || fill === "outline") ? fill : void 0;
|
|
50
|
+
const outline = buttonFill === "outline" ? getComputedStyle(native ?? child) : void 0;
|
|
51
|
+
const item = {
|
|
52
|
+
id: id(child),
|
|
53
|
+
...frame(child.getBoundingClientRect(), candidate.element.getBoundingClientRect()),
|
|
54
|
+
label,
|
|
55
|
+
accessibilityLabel: child.getAttribute("aria-label") ?? native?.getAttribute("aria-label") ?? (icons[0]?.getAttribute("aria-hidden") === "true" ? null : icons[0]?.getAttribute("aria-label")) ?? label,
|
|
56
|
+
disabled: !!child.disabled || !!candidate.element.disabled || getComputedStyle(child).pointerEvents === "none",
|
|
57
|
+
selected: !!child.selected,
|
|
58
|
+
fontSize: parseFloat(labelStyle.fontSize),
|
|
59
|
+
fontWeight: parseInt(labelStyle.fontWeight, 10) || 400,
|
|
60
|
+
color: systemButton ? "currentColor" : getComputedStyle(native ?? child).color,
|
|
61
|
+
iconTemplate: systemButton ? true : void 0,
|
|
62
|
+
buttonFill,
|
|
63
|
+
backgroundColor: buttonFill === "solid" ? getComputedStyle(native ?? child).backgroundColor : void 0,
|
|
64
|
+
borderColor: outline?.borderTopColor,
|
|
65
|
+
borderWidth: outline ? parseFloat(outline.borderTopWidth) : void 0,
|
|
66
|
+
badge: badgeStyle ? {
|
|
67
|
+
value: badge.textContent?.trim() ?? "",
|
|
68
|
+
color: badgeStyle.backgroundColor,
|
|
69
|
+
textColor: badgeStyle.color
|
|
70
|
+
} : void 0
|
|
71
|
+
};
|
|
72
|
+
if (svg) {
|
|
73
|
+
const source = iconSource(svg);
|
|
74
|
+
if (!source) return void 0;
|
|
75
|
+
const size = (icons[0] ?? svg).getBoundingClientRect();
|
|
76
|
+
item.iconWidth = size.width;
|
|
77
|
+
item.iconHeight = size.height;
|
|
78
|
+
if (!size.width || !size.height) return void 0;
|
|
79
|
+
item.iconPosition = (icons[0] ?? svg).getAttribute("slot") === "end" ? "trailing" : "leading";
|
|
80
|
+
candidate.icons.push({
|
|
81
|
+
item,
|
|
82
|
+
source
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if (native && child.matches("ion-button, ion-back-button")) {
|
|
86
|
+
const style = getComputedStyle(native);
|
|
87
|
+
const icon = icons[0] ?? svg;
|
|
88
|
+
const iconStyle = icon && getComputedStyle(icon);
|
|
89
|
+
const leadingMargin = parseFloat(iconStyle?.marginInlineStart ?? "") || 0;
|
|
90
|
+
const trailingMargin = parseFloat(iconStyle?.marginInlineEnd ?? "") || 0;
|
|
91
|
+
const trailing = item.iconPosition === "trailing";
|
|
92
|
+
const inner = native.querySelector(".button-inner");
|
|
93
|
+
const gap = inner ? parseFloat(getComputedStyle(inner).columnGap) || 0 : 0;
|
|
94
|
+
item.contentInsetLeading = (parseFloat(style.paddingInlineStart) || 0) + (parseFloat(style.borderInlineStartWidth) || 0) + (!trailing || !label ? leadingMargin : 0);
|
|
95
|
+
item.contentInsetTrailing = (parseFloat(style.paddingInlineEnd) || 0) + (parseFloat(style.borderInlineEndWidth) || 0) + (trailing || !label ? trailingMargin : 0);
|
|
96
|
+
item.imagePadding = label && icon ? gap + (trailing ? leadingMargin : trailingMargin) : 0;
|
|
97
|
+
}
|
|
98
|
+
if (!label && !svg) return void 0;
|
|
99
|
+
candidate.control.items.push(item);
|
|
100
|
+
candidate.actions.set(item.id, child);
|
|
101
|
+
return item;
|
|
102
|
+
};
|
|
103
|
+
//#endregion
|
|
104
|
+
export { appendItem, createCandidate };
|
|
105
|
+
|
|
106
|
+
//# sourceMappingURL=candidate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"candidate.js","names":[],"sources":["../../../src/native/shared/candidate.ts"],"sourcesContent":["import type { NativeUIControl, NativeUIItem, NativeUIControlKind, NativeUIComponent, VerticalControlAreaOptions } from '../definitions';\nimport { frame, isDark, isVerticalBarsSource, text, visible } from './dom';\nimport { iconSource, type createIconRenderer } from './icons';\n\nexport interface Candidate {\n assets?: { signature: string; render(renderer: ReturnType<typeof createIconRenderer>): Promise<void> };\n buttonProjection?: VerticalControlAreaOptions['buttonProjection'];\n buttonDefaultFill?: VerticalControlAreaOptions['buttonDefaultFill'];\n element: HTMLElement;\n sources?: HTMLElement[];\n control: NativeUIControl;\n actions: Map<string, HTMLElement>;\n icons: { item: NativeUIItem; source: string; field?: 'closeIcon' }[];\n}\n\nexport type Identify = (element: HTMLElement) => string;\ntype ItemElement = HTMLElement & { disabled?: boolean; selected?: boolean };\n\nexport const createCandidate = (\n element: HTMLElement,\n kind: NativeUIComponent | NativeUIControlKind,\n id: Identify,\n options: VerticalControlAreaOptions = {},\n): Candidate => {\n const rect = element.getBoundingClientRect();\n const style = getComputedStyle(element);\n return {\n element,\n buttonProjection: options.buttonProjection,\n buttonDefaultFill: options.buttonDefaultFill,\n control: {\n id: id(element),\n kind:\n (\n {\n 'ion-button': 'button',\n 'ion-buttons': 'button-group',\n 'ion-back-button': 'back-button',\n 'ion-menu-button': 'menu-button',\n 'ion-tab-bar': 'tab-bar',\n 'ion-segment': 'segment',\n 'ion-fab': 'floating-action-button',\n } as Partial<Record<string, NativeUIControlKind>>\n )[kind] ?? (kind as NativeUIControlKind),\n ...frame(rect),\n items: [],\n dark: isDark(style),\n rtl: style.direction === 'rtl',\n },\n actions: new Map(),\n icons: [],\n };\n};\n\n// Shared text, artwork, geometry and action data; component rules stay with their readers.\nexport const appendItem = (\n candidate: Candidate,\n child: HTMLElement,\n id: Identify,\n content: ParentNode = child,\n label = text(child),\n): NativeUIItem | undefined => {\n if (\n !visible(child, isVerticalBarsSource(candidate.element)) ||\n child.querySelector('input, button, a, img, canvas, video, ion-spinner, ion-avatar')\n )\n return;\n const icons = Array.from(content.querySelectorAll<HTMLElement>('ion-icon'));\n const directSVGs = Array.from(content.querySelectorAll<SVGElement>('svg'));\n if (icons.length + directSVGs.length > 1) return undefined;\n const svg = directSVGs[0] ?? icons[0]?.shadowRoot?.querySelector<SVGElement>('svg');\n if (icons.length && !svg) return undefined; // ion-icon has not finished loading.\n const labelElement = content.querySelector('[part=\"text\"], ion-label') ?? child;\n const native = child.shadowRoot?.querySelector('[part=\"native\"]');\n const labelStyle = getComputedStyle(labelElement);\n const badge = child.querySelector<HTMLElement>('ion-badge');\n const badgeStyle = badge && visible(badge) ? getComputedStyle(badge) : undefined;\n const sourceFill = (child as HTMLIonButtonElement).fill;\n const projectionOwner = [child, child.closest('ion-buttons')].find((element) =>\n element?.matches('[data-projection=\"source\"], [data-projection=\"system\"], .ios-theme-projection-source, .ios-theme-projection-system'),\n );\n const attributeProjection = projectionOwner?.getAttribute('data-projection');\n const projection =\n attributeProjection === 'source' || attributeProjection === 'system'\n ? attributeProjection\n : projectionOwner\n ? projectionOwner.classList.contains('ios-theme-projection-system')\n ? 'system'\n : 'source'\n : candidate.buttonProjection;\n const systemButton = projection !== 'source' && isVerticalBarsSource(child) && child.matches('ion-button, ion-menu-button');\n // Ionic defaults buttons inside ion-buttons to clear, even when the app defaults to solid.\n const defaultFill = child.closest('ion-buttons') ? 'clear' : candidate.buttonDefaultFill;\n const fill = !sourceFill || sourceFill === 'default' ? defaultFill : sourceFill;\n const buttonFill =\n !systemButton &&\n isVerticalBarsSource(child) &&\n child.matches('ion-button') &&\n (fill === 'clear' || fill === 'solid' || fill === 'outline')\n ? fill\n : undefined;\n const outline = buttonFill === 'outline' ? getComputedStyle(native ?? child) : undefined;\n const item: NativeUIItem = {\n id: id(child),\n ...frame(child.getBoundingClientRect(), candidate.element.getBoundingClientRect()),\n label,\n accessibilityLabel:\n child.getAttribute('aria-label') ??\n native?.getAttribute('aria-label') ??\n (icons[0]?.getAttribute('aria-hidden') === 'true' ? null : icons[0]?.getAttribute('aria-label')) ??\n label,\n disabled:\n !!(child as ItemElement).disabled ||\n !!(candidate.element as ItemElement).disabled ||\n getComputedStyle(child).pointerEvents === 'none',\n selected: !!(child as ItemElement).selected,\n fontSize: parseFloat(labelStyle.fontSize),\n fontWeight: parseInt(labelStyle.fontWeight, 10) || 400,\n color: systemButton ? 'currentColor' : getComputedStyle(native ?? child).color,\n iconTemplate: systemButton ? true : undefined,\n buttonFill,\n backgroundColor: buttonFill === 'solid' ? getComputedStyle(native ?? child).backgroundColor : undefined,\n borderColor: outline?.borderTopColor,\n borderWidth: outline ? parseFloat(outline.borderTopWidth) : undefined,\n badge: badgeStyle\n ? { value: badge!.textContent?.trim() ?? '', color: badgeStyle.backgroundColor, textColor: badgeStyle.color }\n : undefined,\n };\n if (svg) {\n const source = iconSource(svg);\n if (!source) return undefined;\n const size = (icons[0] ?? svg).getBoundingClientRect();\n item.iconWidth = size.width;\n item.iconHeight = size.height;\n if (!size.width || !size.height) return undefined;\n item.iconPosition = (icons[0] ?? svg).getAttribute('slot') === 'end' ? 'trailing' : 'leading';\n candidate.icons.push({ item, source });\n }\n if (native && child.matches('ion-button, ion-back-button')) {\n const style = getComputedStyle(native);\n const icon = icons[0] ?? svg;\n const iconStyle = icon && getComputedStyle(icon);\n const leadingMargin = parseFloat(iconStyle?.marginInlineStart ?? '') || 0;\n const trailingMargin = parseFloat(iconStyle?.marginInlineEnd ?? '') || 0;\n const trailing = item.iconPosition === 'trailing';\n const inner = native.querySelector('.button-inner');\n const gap = inner ? parseFloat(getComputedStyle(inner).columnGap) || 0 : 0;\n // UIKit centers the title/image pair using its insets. Include Ionic's\n // border and negative outer icon margin instead of applying a fixed offset.\n item.contentInsetLeading =\n (parseFloat(style.paddingInlineStart) || 0) +\n (parseFloat(style.borderInlineStartWidth) || 0) +\n (!trailing || !label ? leadingMargin : 0);\n item.contentInsetTrailing =\n (parseFloat(style.paddingInlineEnd) || 0) + (parseFloat(style.borderInlineEndWidth) || 0) + (trailing || !label ? trailingMargin : 0);\n item.imagePadding = label && icon ? gap + (trailing ? leadingMargin : trailingMargin) : 0;\n }\n if (!label && !svg) return undefined;\n candidate.control.items.push(item);\n candidate.actions.set(item.id, child);\n return item;\n};\n"],"mappings":";;;AAkBA,MAAa,mBACX,SACA,MACA,IACA,UAAsC,CAAC,MACzB;CACd,MAAM,OAAO,QAAQ,sBAAsB;CAC3C,MAAM,QAAQ,iBAAiB,OAAO;CACtC,OAAO;EACL;EACA,kBAAkB,QAAQ;EAC1B,mBAAmB,QAAQ;EAC3B,SAAS;GACP,IAAI,GAAG,OAAO;GACd,MAEI;IACE,cAAc;IACd,eAAe;IACf,mBAAmB;IACnB,mBAAmB;IACnB,eAAe;IACf,eAAe;IACf,WAAW;GACb,EACA,SAAU;GACd,GAAG,MAAM,IAAI;GACb,OAAO,CAAC;GACR,MAAM,OAAO,KAAK;GAClB,KAAK,MAAM,cAAc;EAC3B;EACA,yBAAS,IAAI,IAAI;EACjB,OAAO,CAAC;CACV;AACF;AAGA,MAAa,cACX,WACA,OACA,IACA,UAAsB,OACtB,QAAQ,KAAK,KAAK,MACW;CAC7B,IACE,CAAC,QAAQ,OAAO,qBAAqB,UAAU,OAAO,CAAC,KACvD,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rC,MAAM,OAAO,MAAM,MAAM;EACzB,MAAM,YAAY,QAAQ,iBAAiB,IAAI;EAC/C,MAAM,gBAAgB,WAAW,WAAW,qBAAqB,EAAE,KAAK;EACxE,MAAM,iBAAiB,WAAW,WAAW,mBAAmB,EAAE,KAAK;EACvE,MAAM,WAAW,KAAK,iBAAiB;EACvC,MAAM,QAAQ,OAAO,cAAc,eAAe;EAClD,MAAM,MAAM,QAAQ,WAAW,iBAAiB,KAAK,CAAC,CAAC,SAAS,KAAK,IAAI;EAGzE,KAAK,uBACF,WAAW,MAAM,kBAAkB,KAAK,MACxC,WAAW,MAAM,sBAAsB,KAAK,MAC5C,CAAC,YAAY,CAAC,QAAQ,gBAAgB;EACzC,KAAK,wBACF,WAAW,MAAM,gBAAgB,KAAK,MAAM,WAAW,MAAM,oBAAoB,KAAK,MAAM,YAAY,CAAC,QAAQ,iBAAiB;EACrI,KAAK,eAAe,SAAS,OAAO,OAAO,WAAW,gBAAgB,kBAAkB;CAC1F;CACA,IAAI,CAAC,SAAS,CAAC,KAAK,OAAO,KAAA;CAC3B,UAAU,QAAQ,MAAM,KAAK,IAAI;CACjC,UAAU,QAAQ,IAAI,KAAK,IAAI,KAAK;CACpC,OAAO;AACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clipping.d.ts","names":[],"sources":["../../../src/native/shared/clipping.ts"],"mappings":";wBAAiB,oBAAoB,SAAS,cAAc,UAAU;qBASzD,WAAY,SAAS"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/native/shared/clipping.ts
|
|
2
|
+
function* projectionAncestors(element) {
|
|
3
|
+
let current = element;
|
|
4
|
+
while (current) {
|
|
5
|
+
const root = current.getRootNode();
|
|
6
|
+
current = current.assignedSlot ?? current.parentElement ?? (root instanceof ShadowRoot ? root.host : null);
|
|
7
|
+
if (current) yield current;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
const fitsClip = (element) => {
|
|
11
|
+
const rect = element.getBoundingClientRect();
|
|
12
|
+
for (const ancestor of projectionAncestors(element)) {
|
|
13
|
+
const style = getComputedStyle(ancestor);
|
|
14
|
+
if (style.transform !== "none" && !new DOMMatrixReadOnly(style.transform).isIdentity) return false;
|
|
15
|
+
const bounds = ancestor.getBoundingClientRect();
|
|
16
|
+
const left = bounds.left + ancestor.clientLeft;
|
|
17
|
+
const top = bounds.top + ancestor.clientTop;
|
|
18
|
+
if (/^(hidden|clip|scroll|auto)$/.test(style.overflowX) && (rect.left < left - 1 || rect.right > left + ancestor.clientWidth + 1)) return false;
|
|
19
|
+
if (/^(hidden|clip|scroll|auto)$/.test(style.overflowY) && (rect.top < top - 1 || rect.bottom > top + ancestor.clientHeight + 1)) return false;
|
|
20
|
+
}
|
|
21
|
+
return true;
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { fitsClip, projectionAncestors };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=clipping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clipping.js","names":[],"sources":["../../../src/native/shared/clipping.ts"],"sourcesContent":["export function* projectionAncestors(element: HTMLElement): Generator<HTMLElement> {\n let current: HTMLElement | null = element;\n while (current) {\n const root = current.getRootNode();\n current = current.assignedSlot ?? current.parentElement ?? (root instanceof ShadowRoot ? (root.host as HTMLElement) : null);\n if (current) yield current;\n }\n}\n\nexport const fitsClip = (element: HTMLElement): boolean => {\n const rect = element.getBoundingClientRect();\n for (const ancestor of projectionAncestors(element)) {\n const style = getComputedStyle(ancestor);\n if (style.transform !== 'none' && !new DOMMatrixReadOnly(style.transform).isIdentity) return false;\n const bounds = ancestor.getBoundingClientRect();\n const left = bounds.left + ancestor.clientLeft;\n const top = bounds.top + ancestor.clientTop;\n if (/^(hidden|clip|scroll|auto)$/.test(style.overflowX) && (rect.left < left - 1 || rect.right > left + ancestor.clientWidth + 1))\n return false;\n if (/^(hidden|clip|scroll|auto)$/.test(style.overflowY) && (rect.top < top - 1 || rect.bottom > top + ancestor.clientHeight + 1))\n return false;\n }\n return true;\n};\n"],"mappings":";AAAA,UAAiB,oBAAoB,SAA8C;CACjF,IAAI,UAA8B;CAClC,OAAO,SAAS;EACd,MAAM,OAAO,QAAQ,YAAY;EACjC,UAAU,QAAQ,gBAAgB,QAAQ,kBAAkB,gBAAgB,aAAc,KAAK,OAAuB;EACtH,IAAI,SAAS,MAAM;CACrB;AACF;AAEA,MAAa,YAAY,YAAkC;CACzD,MAAM,OAAO,QAAQ,sBAAsB;CAC3C,KAAK,MAAM,YAAY,oBAAoB,OAAO,GAAG;EACnD,MAAM,QAAQ,iBAAiB,QAAQ;EACvC,IAAI,MAAM,cAAc,UAAU,CAAC,IAAI,kBAAkB,MAAM,SAAS,CAAC,CAAC,YAAY,OAAO;EAC7F,MAAM,SAAS,SAAS,sBAAsB;EAC9C,MAAM,OAAO,OAAO,OAAO,SAAS;EACpC,MAAM,MAAM,OAAO,MAAM,SAAS;EAClC,IAAI,8BAA8B,KAAK,MAAM,SAAS,MAAM,KAAK,OAAO,OAAO,KAAK,KAAK,QAAQ,OAAO,SAAS,cAAc,IAC7H,OAAO;EACT,IAAI,8BAA8B,KAAK,MAAM,SAAS,MAAM,KAAK,MAAM,MAAM,KAAK,KAAK,SAAS,MAAM,SAAS,eAAe,IAC5H,OAAO;CACX;CACA,OAAO;AACT"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/native/shared/crossfade.d.ts
|
|
2
|
+
export declare const handoffDuration = 180;
|
|
3
|
+
export declare const fadeMarker = "data-native-ui-fading";
|
|
4
|
+
export declare const createCrossfade: (win: Window) => {
|
|
5
|
+
duration: (instant?: boolean) => 0 | 180;
|
|
6
|
+
play(element: HTMLElement, toNative: boolean, instant?: boolean): void;
|
|
7
|
+
retire(element: HTMLElement, instant?: boolean): void;
|
|
8
|
+
settled(): Promise<void>;
|
|
9
|
+
destroy(): void;
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
//# sourceMappingURL=crossfade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crossfade.d.ts","names":[],"sources":["../../../src/native/shared/crossfade.ts"],"mappings":";qBAAa;qBACA;qBAGA,kBAAmB,KAAK;;EAiBnB,KAAA,SAAA,aAAW,mBAAmB;EAuB5B,OAAA,SAAA,aAAW"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
//#region src/native/shared/crossfade.ts
|
|
2
|
+
const handoffDuration = 180;
|
|
3
|
+
const fadeMarker = "data-native-ui-fading";
|
|
4
|
+
/** Only visual opacity animates; the runtime transfers input/accessibility ownership once. */
|
|
5
|
+
const createCrossfade = (win) => {
|
|
6
|
+
const active = /* @__PURE__ */ new Map();
|
|
7
|
+
const retired = /* @__PURE__ */ new Set();
|
|
8
|
+
const reduced = win.matchMedia("(prefers-reduced-motion: reduce)");
|
|
9
|
+
const finish = (element, animation) => {
|
|
10
|
+
if (active.get(element) !== animation) return;
|
|
11
|
+
active.delete(element);
|
|
12
|
+
element.removeAttribute(fadeMarker);
|
|
13
|
+
animation.cancel();
|
|
14
|
+
if (retired.delete(element)) element.remove();
|
|
15
|
+
};
|
|
16
|
+
const cancelAll = () => {
|
|
17
|
+
for (const [element, animation] of active) finish(element, animation);
|
|
18
|
+
};
|
|
19
|
+
reduced.addEventListener("change", cancelAll);
|
|
20
|
+
const api = {
|
|
21
|
+
duration: (instant = false) => reduced.matches || instant ? 0 : 180,
|
|
22
|
+
play(element, toNative, instant = false) {
|
|
23
|
+
const previous = active.get(element);
|
|
24
|
+
const current = Number(win.getComputedStyle(element).opacity);
|
|
25
|
+
previous?.cancel();
|
|
26
|
+
active.delete(element);
|
|
27
|
+
const opacity = Number(win.getComputedStyle(element).opacity);
|
|
28
|
+
if (reduced.matches || instant || !element.isConnected) {
|
|
29
|
+
element.removeAttribute(fadeMarker);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
element.setAttribute(fadeMarker, "");
|
|
33
|
+
const animation = element.animate([{ opacity: previous ? current : toNative ? opacity : 0 }, { opacity: toNative ? 0 : opacity }], {
|
|
34
|
+
duration: 180,
|
|
35
|
+
easing: "ease-in-out",
|
|
36
|
+
fill: "both"
|
|
37
|
+
});
|
|
38
|
+
active.set(element, animation);
|
|
39
|
+
animation.finished.then(() => finish(element, animation), () => finish(element, animation));
|
|
40
|
+
},
|
|
41
|
+
retire(element, instant = false) {
|
|
42
|
+
element.inert = true;
|
|
43
|
+
element.setAttribute("aria-hidden", "true");
|
|
44
|
+
element.style.setProperty("pointer-events", "none", "important");
|
|
45
|
+
if (!api.duration(instant) || !element.isConnected) {
|
|
46
|
+
const previous = active.get(element);
|
|
47
|
+
if (previous) finish(element, previous);
|
|
48
|
+
element.remove();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
retired.add(element);
|
|
52
|
+
api.play(element, true);
|
|
53
|
+
},
|
|
54
|
+
async settled() {
|
|
55
|
+
await Promise.all(Array.from(active.values(), (animation) => animation.finished.catch(() => {})));
|
|
56
|
+
},
|
|
57
|
+
destroy() {
|
|
58
|
+
reduced.removeEventListener("change", cancelAll);
|
|
59
|
+
cancelAll();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
return api;
|
|
63
|
+
};
|
|
64
|
+
//#endregion
|
|
65
|
+
export { createCrossfade, fadeMarker, handoffDuration };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=crossfade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crossfade.js","names":[],"sources":["../../../src/native/shared/crossfade.ts"],"sourcesContent":["export const handoffDuration = 180;\nexport const fadeMarker = 'data-native-ui-fading';\n\n/** Only visual opacity animates; the runtime transfers input/accessibility ownership once. */\nexport const createCrossfade = (win: Window) => {\n const active = new Map<HTMLElement, Animation>();\n const retired = new Set<HTMLElement>();\n const reduced = win.matchMedia('(prefers-reduced-motion: reduce)');\n const finish = (element: HTMLElement, animation: Animation) => {\n if (active.get(element) !== animation) return;\n active.delete(element);\n element.removeAttribute(fadeMarker);\n animation.cancel();\n if (retired.delete(element)) element.remove();\n };\n const cancelAll = () => {\n for (const [element, animation] of active) finish(element, animation);\n };\n reduced.addEventListener('change', cancelAll);\n const api = {\n duration: (instant = false) => (reduced.matches || instant ? 0 : handoffDuration),\n play(element: HTMLElement, toNative: boolean, instant = false) {\n const previous = active.get(element);\n const current = Number(win.getComputedStyle(element).opacity);\n previous?.cancel();\n active.delete(element);\n const opacity = Number(win.getComputedStyle(element).opacity);\n // Tab switches skip the opacity handoff so a retiring native snapshot cannot linger.\n if (reduced.matches || instant || !element.isConnected) {\n element.removeAttribute(fadeMarker);\n return;\n }\n element.setAttribute(fadeMarker, '');\n const animation = element.animate([{ opacity: previous ? current : toNative ? opacity : 0 }, { opacity: toNative ? 0 : opacity }], {\n duration: handoffDuration,\n easing: 'ease-in-out',\n fill: 'both',\n });\n active.set(element, animation);\n void animation.finished.then(\n () => finish(element, animation),\n () => finish(element, animation),\n );\n },\n retire(element: HTMLElement, instant = false) {\n element.inert = true;\n element.setAttribute('aria-hidden', 'true');\n element.style.setProperty('pointer-events', 'none', 'important');\n if (!api.duration(instant) || !element.isConnected) {\n const previous = active.get(element);\n if (previous) finish(element, previous);\n element.remove();\n return;\n }\n retired.add(element);\n api.play(element, true);\n },\n async settled() {\n await Promise.all(Array.from(active.values(), (animation) => animation.finished.catch(() => {})));\n },\n destroy() {\n reduced.removeEventListener('change', cancelAll);\n cancelAll();\n },\n };\n return api;\n};\n"],"mappings":";AAAA,MAAa,kBAAkB;AAC/B,MAAa,aAAa;;AAG1B,MAAa,mBAAmB,QAAgB;CAC9C,MAAM,yBAAS,IAAI,IAA4B;CAC/C,MAAM,0BAAU,IAAI,IAAiB;CACrC,MAAM,UAAU,IAAI,WAAW,kCAAkC;CACjE,MAAM,UAAU,SAAsB,cAAyB;EAC7D,IAAI,OAAO,IAAI,OAAO,MAAM,WAAW;EACvC,OAAO,OAAO,OAAO;EAC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GACA,QAAQ,IAAI,OAAO;GACnB,IAAI,KAAK,SAAS,IAAI;EACxB;EACA,MAAM,UAAU;GACd,MAAM,QAAQ,IAAI,MAAM,KAAK,OAAO,OAAO,IAAI,cAAc,UAAU,SAAS,YAAY,CAAC,CAAC,CAAC,CAAC;EAClG;EACA,UAAU;GACR,QAAQ,oBAAoB,UAAU,SAAS;GAC/C,UAAU;EACZ;CACF;CACA,OAAO;AACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","names":[],"sources":["../../../src/native/shared/diagnostics.ts"],"mappings":";qBACa,oBAAqB,uBAGxB,gBAAgB,UAAU"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/native/shared/diagnostics.ts
|
|
2
|
+
/** Opt-in diagnostics. Never log props, action data, or application exception messages. */
|
|
3
|
+
const createDiagnostics = (enabled = false) => {
|
|
4
|
+
const elements = /* @__PURE__ */ new WeakMap();
|
|
5
|
+
const global = /* @__PURE__ */ new Set();
|
|
6
|
+
return (reason, element) => {
|
|
7
|
+
if (!enabled) return;
|
|
8
|
+
const seen = element ? elements.get(element) ?? /* @__PURE__ */ new Set() : global;
|
|
9
|
+
if (seen.has(reason)) return;
|
|
10
|
+
seen.add(reason);
|
|
11
|
+
if (element) elements.set(element, seen);
|
|
12
|
+
console.info(`[Native UI] ${reason}`, ...element ? [element] : []);
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { createDiagnostics };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.js","names":[],"sources":["../../../src/native/shared/diagnostics.ts"],"sourcesContent":["/** Opt-in diagnostics. Never log props, action data, or application exception messages. */\nexport const createDiagnostics = (enabled = false) => {\n const elements = new WeakMap<HTMLElement, Set<string>>();\n const global = new Set<string>();\n return (reason: string, element?: HTMLElement): void => {\n if (!enabled) return;\n const seen = element ? (elements.get(element) ?? new Set<string>()) : global;\n if (seen.has(reason)) return;\n seen.add(reason);\n if (element) elements.set(element, seen);\n console.info(`[Native UI] ${reason}`, ...(element ? [element] : []));\n };\n};\n"],"mappings":";;AACA,MAAa,qBAAqB,UAAU,UAAU;CACpD,MAAM,2BAAW,IAAI,QAAkC;CACvD,MAAM,yBAAS,IAAI,IAAY;CAC/B,QAAQ,QAAgB,YAAgC;EACtD,IAAI,CAAC,SAAS;EACd,MAAM,OAAO,UAAW,SAAS,IAAI,OAAO,qBAAK,IAAI,IAAY,IAAK;EACtE,IAAI,KAAK,IAAI,MAAM,GAAG;EACtB,KAAK,IAAI,MAAM;EACf,IAAI,SAAS,SAAS,IAAI,SAAS,IAAI;EACvC,QAAQ,KAAK,eAAe,UAAU,GAAI,UAAU,CAAC,OAAO,IAAI,CAAC,CAAE;CACrE;AACF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Frame } from "../definitions.js";
|
|
2
|
+
//#region src/native/shared/dom.d.ts
|
|
3
|
+
export declare const marker = "data-native-ui-projected";
|
|
4
|
+
export declare const childNodesOf: (element: Element) => Node[];
|
|
5
|
+
export declare const childElements: (element: Element) => HTMLElement[];
|
|
6
|
+
export declare const prehiddenClass = "native-ui-prehidden";
|
|
7
|
+
export declare const prehideRootClass = "native-ui-prehide";
|
|
8
|
+
export declare const rejectedClass = "native-ui-rejected";
|
|
9
|
+
export declare const verticalBarsBackWebClass = "ios-theme-vertical-bars-back-web-owned";
|
|
10
|
+
export declare const prehideOnlyMutation: (record: MutationRecord) => boolean;
|
|
11
|
+
export declare const withoutPrehide: <T>(element: HTMLElement, read: () => T) => T;
|
|
12
|
+
export declare const isDark: (style: CSSStyleDeclaration) => boolean;
|
|
13
|
+
export declare const excluded = ".ios-theme-disabled, .ios26-disabled, .ion-cloned-element, [hidden], [inert], .ion-page-hidden, .ion-page-invisible";
|
|
14
|
+
export declare const setVerticalBarsEnteringPage: (page: HTMLElement, entering: boolean) => void;
|
|
15
|
+
export declare const verticalBarsEnteringPage: (element: HTMLElement) => HTMLElement | undefined;
|
|
16
|
+
export declare const createVerticalBarsPageState: () => {
|
|
17
|
+
isDeparted(element: HTMLElement): boolean;
|
|
18
|
+
lifecycle(event: Event): void;
|
|
19
|
+
cancel(entering?: HTMLElement, leaving?: HTMLElement): void;
|
|
20
|
+
};
|
|
21
|
+
export declare const isDisabledButtonGroupChild: (element: HTMLElement) => boolean;
|
|
22
|
+
export declare const isVerticalBarsSource: (element: HTMLElement) => boolean;
|
|
23
|
+
export declare const isVerticalBarsBackPosition: (element: HTMLElement) => boolean;
|
|
24
|
+
export declare const preferredVerticalBarsBack: <T extends HTMLElement>(elements: T[], doc: Document) => T | undefined;
|
|
25
|
+
export declare const isPermanentlyExcluded: (element: HTMLElement) => boolean;
|
|
26
|
+
export declare const isExcluded: (element: HTMLElement, enteringPage?: HTMLElement) => boolean;
|
|
27
|
+
export declare const isNativeUIDisabled: (element: Element) => boolean;
|
|
28
|
+
export declare const isVerticalBarsToolbarActionShape: (element: HTMLElement) => boolean;
|
|
29
|
+
export declare const setVerticalBarsPlacement: (element: HTMLElement, rail: boolean) => void;
|
|
30
|
+
export declare const clearVerticalBarsPlacement: (element: HTMLElement) => void;
|
|
31
|
+
export declare const verticalBarsOwned: (element: HTMLElement) => boolean;
|
|
32
|
+
export declare const isVerticalBarsToolbarAction: (element: HTMLElement) => boolean;
|
|
33
|
+
export declare const verticalBarsActionCandidate: (element: HTMLElement) => boolean;
|
|
34
|
+
export declare const verticalBarsBackCandidate: (element: HTMLElement) => boolean;
|
|
35
|
+
export declare const verticalBarsToolbarActions: (element: HTMLElement) => HTMLElement[];
|
|
36
|
+
export declare const isVerticalBarsToolbarGroup: (element: HTMLElement) => boolean;
|
|
37
|
+
export declare const toolbarTextMarker = "data-native-ui-toolbar-text";
|
|
38
|
+
export declare const syncToolbarText: (doc: Document) => void;
|
|
39
|
+
export declare const activateProjectedElement: (element: HTMLElement) => void;
|
|
40
|
+
export declare const unprojected: <T>(elements: Iterable<HTMLElement>, read: () => T) => T;
|
|
41
|
+
export declare const visible: (element: HTMLElement, allowOutsideViewport?: boolean) => boolean;
|
|
42
|
+
export declare const frame: (rect: DOMRect, origin?: DOMRect) => Frame;
|
|
43
|
+
export declare const text: (element: Element) => string;
|
|
44
|
+
export declare const inFixedToolbar: (element: Element) => boolean;
|
|
45
|
+
//#endregion
|
|
46
|
+
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.d.ts","names":[],"sources":["../../../src/native/shared/dom.ts"],"mappings":";;qBAKa;qBAKA,eAAgB,SAAS,YAAU;qBAEnC,gBAAiB,SAAS,YAAU;qBAEpC;qBACA;qBACA;qBACA;qBAEA,sBAAuB,QAAQ;qBAU/B,iBAAkB,GAAG,SAAS,aAAa,YAAY,MAAI;qBAmB3D,SAAU,OAAO;qBAWjB;qBAEA,8BAA+B,MAAM,aAAa;qBAIlD,2BAA4B,SAAS,gBAAc;qBAInD;EAGW,WAAA,SAAA;EAIH,UAAA,OAAA;EASC,OAAA,WAAA,aAAW,UAAY;;qBAYhC,6BAA8B,SAAS;qBAKvC,uBAAwB,SAAS;qBAWjC,6BAA8B,SAAS;qBAoBvC,4BAA6B,UAAU,aAAa,UAAU,KAAK,KAAK,aAAW;qBAWnF,wBAAyB,SAAS;qBAClC,aAAc,SAAS,aAAa,eAAe;qBAInD,qBAAsB,SAAS;qBAG/B,mCAAoC,SAAS;qBAO7C,2BAA4B,SAAS,aAAa;qBAGlD,6BAA8B,SAAS;qBAIvC,oBAAqB,SAAS;qBAI9B,8BAA+B,SAAS;qBAMxC,8BAA+B,SAAS;qBAWxC,4BAA6B,SAAS;qBAStC,6BAA8B,SAAS,gBAAc;qBAIrD,6BAA8B,SAAS;qBASvC;qBAEA,kBAAmB,KAAK;qBAYxB,2BAA4B,SAAS;qBAOrC,cAAe,GAAG,UAAU,SAAS,cAAc,YAAY,MAAI;qBA6CnE,UAAW,SAAS,aAAa;qBAGjC,QAAS,MAAM,SAAS,SAAS,YAAU;qBAO3C,OAAQ,SAAS;qBASjB,iBAAkB,SAAS"}
|