spb/prisme Public MIT
Navigateur iOS intelligent — chaque page comprise localement avant d'être affichée. SwiftUI · WebKit · Foundation Models, 100% on-device.
Swift 96.7%
JavaScript 3.3%
1//2// PrismeWebView.swift3// Prisme4//5// Author: Simon-Pierre Boucher <contact@spboucher.ai>6//78import UIKit9import WebKit1011/// The engine's web view: adds "Sauver l'extrait" to the system text12/// selection menu. Selecting a passage and keeping *it* — not the page —13/// is the primary save gesture (CLAUDE.md §5, "L'extrait", P0).14final class PrismeWebView: WKWebView {15 /// Set by the coordinator while a tab is attached.16 var onSaveExcerpt: (() -> Void)?1718 override func buildMenu(with builder: UIMenuBuilder) {19 super.buildMenu(with: builder)20 guard onSaveExcerpt != nil else { return }21 let save = UIAction(22 title: "Sauver l'extrait",23 image: UIImage(systemName: "quote.opening")24 ) { [weak self] _ in25 self?.onSaveExcerpt?()26 }27 builder.insertSibling(28 UIMenu(options: .displayInline, children: [save]),29 afterMenu: .standardEdit30 )31 }32}33