@copio/sdk 0.0.0-stage → 0.1.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/README.md +204 -2
- package/css/container.css +177 -0
- package/css/cropper.css +306 -0
- package/css/main.css +139 -0
- package/css/reset.css +204 -0
- package/css/shoelace.css +485 -0
- package/css/utils.css +689 -0
- package/dist/adapters/image/canvas2d-adapter.js +2 -0
- package/dist/adapters/image/canvas2d-adapter.js.map +7 -0
- package/dist/adapters/image/index.js +2 -0
- package/dist/adapters/image/index.js.map +7 -0
- package/dist/adapters/image/null-image-processor-adapter.js +2 -0
- package/dist/adapters/image/null-image-processor-adapter.js.map +7 -0
- package/dist/adapters/index.js +2 -0
- package/dist/adapters/index.js.map +7 -0
- package/dist/adapters/indexeddb-adapter.js +2 -0
- package/dist/adapters/indexeddb-adapter.js.map +7 -0
- package/dist/adapters/memory-adapter.js +2 -0
- package/dist/adapters/memory-adapter.js.map +7 -0
- package/dist/adapters/ocr/index.js +2 -0
- package/dist/adapters/ocr/index.js.map +7 -0
- package/dist/adapters/ocr/null-ocr-adapter.js +2 -0
- package/dist/adapters/ocr/null-ocr-adapter.js.map +7 -0
- package/dist/adapters/ocr/tesseract-wasm-adapter.js +2 -0
- package/dist/adapters/ocr/tesseract-wasm-adapter.js.map +7 -0
- package/dist/adapters/pdf/index.js +2 -0
- package/dist/adapters/pdf/index.js.map +7 -0
- package/dist/adapters/pdf/null-pdf-adapter.js +2 -0
- package/dist/adapters/pdf/null-pdf-adapter.js.map +7 -0
- package/dist/adapters/pdf/pdfkit-adapter.js +2 -0
- package/dist/adapters/pdf/pdfkit-adapter.js.map +7 -0
- package/dist/adapters/storage/index.js +2 -0
- package/dist/adapters/storage/index.js.map +7 -0
- package/dist/adapters/storage/indexeddb-adapter.js +2 -0
- package/dist/adapters/storage/indexeddb-adapter.js.map +7 -0
- package/dist/adapters/storage/memory-adapter.js +2 -0
- package/dist/adapters/storage/memory-adapter.js.map +7 -0
- package/dist/adapters/sync/index.js +2 -0
- package/dist/adapters/sync/index.js.map +7 -0
- package/dist/adapters/sync/null-sync-adapter.js +2 -0
- package/dist/adapters/sync/null-sync-adapter.js.map +7 -0
- package/dist/adapters/sync/peerjs-adapter.js +2 -0
- package/dist/adapters/sync/peerjs-adapter.js.map +7 -0
- package/dist/canvas-FAXPLPXN.js +2 -0
- package/dist/cdn.js +2770 -0
- package/dist/chunk-36F637QU.js +2 -0
- package/dist/chunk-4C666HHU.js +2 -0
- package/dist/chunk-4GEMGDRU.js +1 -0
- package/dist/chunk-4JPEWIT4.js +2 -0
- package/dist/chunk-A5G52Q2W.js +2 -0
- package/dist/chunk-B2EK6INF.js +2 -0
- package/dist/chunk-B5BEYYR2.js +8 -0
- package/dist/chunk-B7HT2X67.js +2 -0
- package/dist/chunk-BKZEOOH4.js +2 -0
- package/dist/chunk-CWCS22CQ.js +1 -0
- package/dist/chunk-DGGK5KEX.js +2 -0
- package/dist/chunk-E7JYVRJA.js +2 -0
- package/dist/chunk-G65H4ZTJ.js +2 -0
- package/dist/chunk-HN3336JN.js +2 -0
- package/dist/chunk-IUBYFIV6.js +12 -0
- package/dist/chunk-K6YP7EET.js +8 -0
- package/dist/chunk-K7RTGT3Q.js +2601 -0
- package/dist/chunk-KIMVF5UG.js +2 -0
- package/dist/chunk-LI54F6PA.js +2 -0
- package/dist/chunk-N4R55VRR.js +2 -0
- package/dist/chunk-N7Q34F2P.js +4 -0
- package/dist/chunk-OI4WCW7E.js +2 -0
- package/dist/chunk-PUJYN435.js +1 -0
- package/dist/chunk-PVNRK4OH.js +2 -0
- package/dist/chunk-QPUCXOOR.js +2 -0
- package/dist/chunk-SH4P4XSZ.js +2 -0
- package/dist/chunk-UCV3MQ6I.js +33 -0
- package/dist/chunk-V2FP4EEH.js +2 -0
- package/dist/chunk-V6E2SSSW.js +1 -0
- package/dist/chunk-XEN5VKAV.js +19 -0
- package/dist/chunk-YHLOPPXM.js +2 -0
- package/dist/core.js +2 -0
- package/dist/custom-elements.json +4779 -0
- package/dist/export.js +2 -0
- package/dist/fs-HJ6WWW73.js +2 -0
- package/dist/http-FKJJMT2N.js +2 -0
- package/dist/https-MUBFLDZM.js +2 -0
- package/dist/index.js +99 -0
- package/dist/ocr.js +2 -0
- package/dist/path2d-QWN6DFCC.js +2 -0
- package/dist/scanner.js +2631 -0
- package/dist/sync.js +2 -0
- package/dist/types/js/adapters/image/canvas2d-adapter.d.ts +42 -0
- package/dist/types/js/adapters/image/image-processor-port.d.ts +41 -0
- package/dist/types/js/adapters/image/index.d.ts +3 -0
- package/dist/types/js/adapters/image/null-image-processor-adapter.d.ts +13 -0
- package/dist/types/js/adapters/ocr/index.d.ts +3 -0
- package/dist/types/js/adapters/ocr/null-ocr-adapter.d.ts +39 -0
- package/dist/types/js/adapters/ocr/ocr-port.d.ts +139 -0
- package/dist/types/js/adapters/ocr/tesseract-wasm-adapter.d.ts +40 -0
- package/dist/types/js/adapters/pdf/index.d.ts +3 -0
- package/dist/types/js/adapters/pdf/null-pdf-adapter.d.ts +23 -0
- package/dist/types/js/adapters/pdf/pdf-port.d.ts +21 -0
- package/dist/types/js/adapters/pdf/pdfkit-adapter.d.ts +16 -0
- package/dist/types/js/adapters/storage/index.d.ts +22 -0
- package/dist/types/js/adapters/storage/indexeddb-adapter.d.ts +109 -0
- package/dist/types/js/adapters/storage/memory-adapter.d.ts +101 -0
- package/dist/types/js/adapters/storage/storage-port.d.ts +113 -0
- package/dist/types/js/adapters/sync/index.d.ts +3 -0
- package/dist/types/js/adapters/sync/null-sync-adapter.d.ts +14 -0
- package/dist/types/js/adapters/sync/peerjs-adapter.d.ts +16 -0
- package/dist/types/js/adapters/sync/sync-port.d.ts +18 -0
- package/dist/types/js/components/copio-header.d.ts +19 -0
- package/dist/types/js/components/copio-loader.d.ts +6 -0
- package/dist/types/js/core/store.d.ts +2 -0
- package/dist/types/js/routes/add-edit/copio-add-edit-dialog.d.ts +9 -0
- package/dist/types/js/routes/doc/copio-carousel.d.ts +43 -0
- package/dist/types/js/routes/doc/copio-images.d.ts +37 -0
- package/dist/types/js/routes/home/copio-row.d.ts +49 -0
- package/dist/types/js/routes/ocr/copio-doc-ocr-dialog.d.ts +97 -0
- package/dist/types/js/routes/sync/copio-sync-dialog.d.ts +13 -0
- package/dist/types/js/services/doc-repository.d.ts +233 -0
- package/dist/types/js/services/export-utils.d.ts +42 -0
- package/dist/types/js/services/ice-servers.d.ts +1 -0
- package/dist/types/js/services/notify.d.ts +82 -0
- package/dist/types/js/services/ocr-service.d.ts +64 -0
- package/dist/types/js/services/sync-service.d.ts +11 -0
- package/dist/types/js/styles/cropper-styles.d.ts +5 -0
- package/dist/types/js/utils/module-loader.d.ts +76 -0
- package/dist/types/js/utils/pdf-utils.d.ts +7 -0
- package/dist/types/js/utils/utils.d.ts +54 -0
- package/dist/types/sdk/cdn.d.ts +7 -0
- package/dist/types/sdk/core.d.ts +310 -0
- package/dist/types/sdk/elements.d.ts +25 -0
- package/dist/types/sdk/events.d.ts +227 -0
- package/dist/types/sdk/index.d.ts +37 -0
- package/dist/types/sdk/license.d.ts +12 -0
- package/dist/types/sdk/models.d.ts +174 -0
- package/dist/types/sdk/scanner.d.ts +68 -0
- package/dist/types/sdk/styles.d.ts +21 -0
- package/dist/types/sdk/sync.d.ts +7 -0
- package/dist/types/sdk/version.d.ts +2 -0
- package/dist/url-ABJ6S2Y6.js +2 -0
- package/package.json +73 -4
- package/sdk/cdn.js +13 -0
- package/sdk/core.js +961 -0
- package/sdk/events.js +99 -0
- package/sdk/index.js +137 -0
- package/sdk/license.js +28 -0
- package/sdk/models.js +177 -0
- package/sdk/scanner.js +1597 -0
- package/sdk/styles.js +1236 -0
- package/sdk/sync.js +12 -0
- package/sdk/version.js +7 -0
package/README.md
CHANGED
|
@@ -1,3 +1,205 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Copio
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img style="margin: 0 auto; max-width: 512px; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.3);" src="https://substackcdn.com/image/fetch/w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4eb7cf55-5d05-497a-8745-9002f292c32a_512x512.png" alt="Copio Logo" />
|
|
5
|
+
|
|
6
|
+
<h3>The Private, Offline-First Document Scanner & Manager</h3>
|
|
7
|
+
|
|
8
|
+
<p><i>Capture, enhance, organise, and export multi-page documents — 100% in your browser with zero cloud dependencies.</i></p>
|
|
9
|
+
|
|
10
|
+
<div>
|
|
11
|
+
<img src="https://img.shields.io/badge/Privacy-100%25%20Local-brightgreen?style=for-the-badge&logo=shield" alt="100% Local Privacy" />
|
|
12
|
+
<img src="https://img.shields.io/badge/Offline-First-blue?style=for-the-badge&logo=pwa" alt="Offline First" />
|
|
13
|
+
<img src="https://img.shields.io/badge/Sync-Peer--to--Peer%20WebRTC-purple?style=for-the-badge&logo=webrtc" alt="P2P Sync" />
|
|
14
|
+
<img src="https://img.shields.io/badge/Platform-PWA%20%7C%20Android%20TWA-3ddc84?style=for-the-badge&logo=android" alt="PWA and Android TWA" />
|
|
15
|
+
<img src="https://img.shields.io/badge/Built%20with-Lit%20%2B%20TinyBase-orange?style=for-the-badge&logo=lit" alt="Built with Lit & TinyBase" />
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<br/>
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 🌟 Overview
|
|
24
|
+
|
|
25
|
+
**Copio** is a modern, lightweight, privacy-focused document scanning and document management application that runs entirely on your device.
|
|
26
|
+
|
|
27
|
+
Whether you're digitising paper receipts, creating multi-page document archives, importing existing PDFs, or taking Markdown notes alongside your scans — Copio gives you the full power of a desktop document management suite with **zero cloud servers, zero user accounts, and zero data tracking**.
|
|
28
|
+
|
|
29
|
+
> 📖 **Read the Story:** Learn about the vision and evolution of Copio in [Ed Williams' Substack post](https://edwilliams.substack.com/p/copio). Originally built in React in 2019, Copio was completely rebuilt in 2026 using Web Components (Lit) and TinyBase for ultimate performance and zero framework overhead.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 🔥 Key Highlights
|
|
34
|
+
|
|
35
|
+
- 🔒 **100% Private & Serverless**: Your documents never leave your browser. Data is saved locally in IndexedDB using reactive storage.
|
|
36
|
+
- ⚡ **Works Everywhere Offline**: Service Worker pre-caches all assets. Load it once and use it forever without an internet connection.
|
|
37
|
+
- 🔤 **Client-Side OCR (Text Recognition)**: Extract text from scanned documents and images using WebAssembly (Tesseract.js WASM) with zero server uploads and multi-language support.
|
|
38
|
+
- 🔄 **Serverless Peer-to-Peer Sync**: Transfer documents directly between your phone, tablet, and laptop via WebRTC and instant QR code pairing — no cloud middleman.
|
|
39
|
+
- 📷 **Smart Camera & Ingestion**: Capture directly from your mobile or desktop camera with automatic EXIF orientation detection. Import existing images, multi-page PDFs, or Markdown files.
|
|
40
|
+
- 🎨 **Pro-Grade Page Enhancements**: Interactive precision cropping, 360° rotation, and a high-contrast **Black & White Threshold filter** for turning shadow-heavy photos into crisp scanned paper.
|
|
41
|
+
- 📑 **Hybrid Document Engine**: Combine camera scans, imported images, multi-page PDF pages, and Markdown notes seamlessly within a single document container.
|
|
42
|
+
- 📤 **Client-Side PDF & ZIP Export**: Convert your multi-page documents into clean A4 PDFs or download all pages as a ZIP bundle directly in the browser using WebAssembly and client-side PDFKit.
|
|
43
|
+
- 📱 **Native App Experience**: Install as a PWA on iOS, Desktop, and Android, or sideload the native-feeling Android Trusted Web Activity (TWA) APK.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 🛠️ Features Breakdown
|
|
48
|
+
|
|
49
|
+
### 📷 1. Ingestion & Capture
|
|
50
|
+
- **Live Camera Capture**: Snap photos of documents directly within the web app.
|
|
51
|
+
- **EXIF Auto-Correction**: Automatic rotation detection based on image EXIF metadata.
|
|
52
|
+
- **Multi-Format Ingestion**: Upload images (`.jpg`, `.png`), multi-page PDF documents (`.pdf`), or Markdown files (`.md`, `.markdown`, `.txt`).
|
|
53
|
+
- **PDF Page Extraction**: Automatically renders uploaded PDF pages as editable document pages.
|
|
54
|
+
|
|
55
|
+
### 🔤 2. Client-Side OCR & Text Extraction
|
|
56
|
+
- **On-Device Text Recognition**: Powered by Tesseract.js WebAssembly running inside background Web Workers for smooth UI performance.
|
|
57
|
+
- **Per-Page & Full-Document OCR**: Extract text from single pages or batch-process entire multi-page documents with live progress indicators.
|
|
58
|
+
- **Convert to Markdown Note**: Turn any scanned page into an editable Markdown note with a single tap.
|
|
59
|
+
- **Multi-Language Support**: English pre-cached offline, with on-demand support for Spanish, French, German, Italian, Portuguese, Chinese, Japanese, and more.
|
|
60
|
+
- **One-Click Copy & Export**: Copy recognized text with confidence metrics or download as `.txt` / `.md`.
|
|
61
|
+
|
|
62
|
+
### ✂️ 3. Editing & Page Enhancement
|
|
63
|
+
- **Interactive Cropping**: Adjust boundaries easily using Cropper.js.
|
|
64
|
+
- **Rotation**: Rotate individual pages to correct orientation.
|
|
65
|
+
- **Black & White Filter**: Convert shaded photos into high-contrast document scans.
|
|
66
|
+
- **Drag-to-Reorder**: Reorder pages effortlessly using drag-and-drop.
|
|
67
|
+
- **Metadata Inspector**: View EXIF data and file properties on demand.
|
|
68
|
+
|
|
69
|
+
### 📝 4. Hybrid Markdown & Note Taking
|
|
70
|
+
- **Embedded Markdown Notes**: Mix text notes and document scans in the same document.
|
|
71
|
+
- **Live Markdown Previewer**: View rich rendered Markdown notes in a full-screen carousel viewer.
|
|
72
|
+
- **Markdown Text Editor**: Create and edit Markdown pages directly inside your document.
|
|
73
|
+
|
|
74
|
+
### 🔄 5. Serverless Peer-to-Peer Sync
|
|
75
|
+
- **WebRTC Data Channels**: Pair devices directly using PeerJS.
|
|
76
|
+
- **Instant QR Pairing**: Scan a QR code on your host device with your phone to link instantly.
|
|
77
|
+
- **Zero Cloud Storage**: Direct browser-to-browser transmission keeping your documents strictly private.
|
|
78
|
+
|
|
79
|
+
### 📤 6. Flexible Exporting
|
|
80
|
+
- **Client-Side PDF Generation**: Generate formatted multi-page A4 PDFs with proper margins and image scaling.
|
|
81
|
+
- **Bulk Image Download**: Download individual pages or package entire documents into a compressed ZIP file.
|
|
82
|
+
- **Markdown File Export**: Download Markdown components as `.md` files.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 🏗️ Tech Stack & Architecture
|
|
87
|
+
|
|
88
|
+
Copio is designed with a lightweight, zero-framework-overhead philosophy for maximum speed, longevity, and offline reliability.
|
|
89
|
+
|
|
90
|
+
| Library / Tech | Purpose |
|
|
91
|
+
|---|---|
|
|
92
|
+
| 🧱 **[Lit](https://lit.dev)** | Ultra-fast Web Components base class & templating engine |
|
|
93
|
+
| 🗃️ **[TinyBase](https://tinybase.org)** | Reactive browser store with auto-persisted IndexedDB storage |
|
|
94
|
+
| 🔤 **[Tesseract.js](https://tesseract.projectnaptha.com/)** | Client-side WebAssembly Optical Character Recognition (OCR) |
|
|
95
|
+
| 🎨 **[Shoelace](https://shoelace.style)** | Accessible UI component library (dialogs, icons, buttons) |
|
|
96
|
+
| ✂️ **[Cropper.js](https://fengyuanchen.github.io/cropperjs/)** | Touch-friendly interactive image crop and rotation tool |
|
|
97
|
+
| 📄 **[PDFKit](https://pdfkit.org)** | In-browser client-side PDF document compiler |
|
|
98
|
+
| 📡 **[PeerJS](https://peerjs.com)** | WebRTC peer-to-peer data transport layer |
|
|
99
|
+
| 📷 **[Exifr](https://mutiny.cz/exifr/)** | High-performance EXIF image metadata parser |
|
|
100
|
+
| 🔀 **[Sortable.js](https://sortablejs.github.io/Sortable/)** | Touch & mouse drag-and-drop reordering |
|
|
101
|
+
| 📱 **[Service Worker](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API)** | Full offline asset caching & progressive web app shell |
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 🚀 Quick Start
|
|
107
|
+
|
|
108
|
+
### 📖 User Guide
|
|
109
|
+
1. **Create a Document**: Click the **+** button and enter a title for your document.
|
|
110
|
+
2. **Add Content**: Tap the upload button to capture photos, upload image files, import PDFs, or create Markdown notes.
|
|
111
|
+
3. **Enhance & Reorder**: Tap any page thumbnail to crop, rotate, apply black & white threshold filters, or edit text. Drag thumbnails to reorder pages.
|
|
112
|
+
4. **Export & Share**: Tap the document dropdown menu to download as a multi-page PDF, a ZIP image bundle, or a Markdown file.
|
|
113
|
+
5. **Sync Across Devices**: Click **Link Device** in the header to generate a QR code for instant peer-to-peer sync with another browser or phone.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### 💻 Developer Setup
|
|
118
|
+
|
|
119
|
+
#### Prerequisites
|
|
120
|
+
- **Node.js** (v18+ recommended — required for bundler scripts only; the web app has zero runtime server dependencies).
|
|
121
|
+
- A static HTTP/HTTPS server or `localhost` (HTTPS is required for Service Worker activation on non-localhost domains).
|
|
122
|
+
|
|
123
|
+
#### Installation
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# Clone the repository
|
|
127
|
+
git clone https://github.com/edwilliams/copio.git
|
|
128
|
+
cd copio
|
|
129
|
+
|
|
130
|
+
# Install build dependencies
|
|
131
|
+
npm install
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### Build Bundles
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Bundle client libraries into js/
|
|
138
|
+
npm run build
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
#### Run Locally
|
|
142
|
+
|
|
143
|
+
Serve the project root using any static web server:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# Using npx serve
|
|
147
|
+
npx serve .
|
|
148
|
+
|
|
149
|
+
# Or using Python
|
|
150
|
+
python3 -m http.server 3000
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Open `http://localhost:3000` in your web browser.
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## 📱 Mobile Installation & Android APK (TWA)
|
|
158
|
+
|
|
159
|
+
### 📲 Progressive Web App (PWA)
|
|
160
|
+
Open Copio in your mobile browser (Safari on iOS, Chrome on Android/Desktop) and select **Add to Home Screen** or **Install App**. Copio installs as a standalone application that works 100% offline.
|
|
161
|
+
|
|
162
|
+
### 🤖 Android Trusted Web Activity (TWA)
|
|
163
|
+
Copio can be compiled into a lightweight native Android APK shell using [Bubblewrap](https://developer.chrome.com/docs/android/trusted-web-activity/).
|
|
164
|
+
|
|
165
|
+
#### Install Pre-Built APK
|
|
166
|
+
Download `app-release-signed.apk` from the [`copio-twa/`](../copio-twa/) directory, transfer it to your device, and tap to install (enable "Install from unknown sources" if prompted).
|
|
167
|
+
|
|
168
|
+
#### Build Custom APK
|
|
169
|
+
```bash
|
|
170
|
+
# Install Bubblewrap CLI globally
|
|
171
|
+
npm install -g @bubblewrap/cli
|
|
172
|
+
|
|
173
|
+
# Navigate to TWA directory
|
|
174
|
+
mkdir copio-twa && cd copio-twa
|
|
175
|
+
|
|
176
|
+
# Generate Android project from PWA manifest
|
|
177
|
+
bubblewrap update --skipVersionUpgrade
|
|
178
|
+
|
|
179
|
+
# Build signed APK and App Bundle
|
|
180
|
+
BUBBLEWRAP_KEYSTORE_PASSWORD=<your-password> \
|
|
181
|
+
BUBBLEWRAP_KEY_PASSWORD=<your-password> \
|
|
182
|
+
bubblewrap build
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
The output file `app-release-signed.apk` is ready for direct Android installation.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## 🔒 Privacy & Security Guarantee
|
|
190
|
+
|
|
191
|
+
- **Zero Remote Storage**: All documents, images, and notes are stored strictly inside your browser's local `IndexedDB`.
|
|
192
|
+
- **No Analytics / Telemetry**: No third-party trackers or external analytics scripts.
|
|
193
|
+
- **Direct P2P Connections**: WebRTC sync connects your devices directly end-to-end without uploading data to server storage.
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## 🤝 Contributing
|
|
198
|
+
|
|
199
|
+
Contributions, feature suggestions, and bug reports are warmly welcomed! Feel free to open an issue or submit a pull request on GitHub.
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## 📄 License
|
|
204
|
+
|
|
205
|
+
Copio is open-source software released under the [MIT License](LICENSE).
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Constrained-Container Layout Pass (CPO-024)
|
|
3
|
+
Layout architecture per docs/redesign-workflow.md & prototype-v1.html
|
|
4
|
+
Container name: copio-scanner
|
|
5
|
+
Container type: size
|
|
6
|
+
========================================================================== */
|
|
7
|
+
|
|
8
|
+
/* 1. Host Container and Component Roots */
|
|
9
|
+
.copio-scanner-host,
|
|
10
|
+
copio-scanner,
|
|
11
|
+
copio-app {
|
|
12
|
+
container-type: size;
|
|
13
|
+
container-name: copio-scanner;
|
|
14
|
+
position: relative;
|
|
15
|
+
display: block;
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
contain: layout;
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* 2. Container Sizing Test Frames */
|
|
24
|
+
.host-container-frame {
|
|
25
|
+
position: relative;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
background: #0b0f17;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.host-container-frame[data-size="360x640"] {
|
|
32
|
+
width: 360px;
|
|
33
|
+
height: 640px;
|
|
34
|
+
max-width: 100%;
|
|
35
|
+
max-height: 100%;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.host-container-frame[data-size="480x800"] {
|
|
39
|
+
width: 480px;
|
|
40
|
+
height: 800px;
|
|
41
|
+
max-width: 100%;
|
|
42
|
+
max-height: 100%;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.host-container-frame[data-size="400x800"] {
|
|
46
|
+
width: 400px;
|
|
47
|
+
height: 800px;
|
|
48
|
+
max-width: 100%;
|
|
49
|
+
max-height: 100%;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.host-container-frame[data-size="800x500"] {
|
|
53
|
+
width: 800px;
|
|
54
|
+
height: 500px;
|
|
55
|
+
max-width: 100%;
|
|
56
|
+
max-height: 100%;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.host-container-frame[data-size="full"] {
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: 100%;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* 3. Container-Scoped Toast Stack */
|
|
65
|
+
.copio-scanner-host .sl-toast-stack,
|
|
66
|
+
copio-scanner .sl-toast-stack,
|
|
67
|
+
copio-app .sl-toast-stack,
|
|
68
|
+
.copio-toast-stack-scoped {
|
|
69
|
+
position: absolute !important;
|
|
70
|
+
top: auto !important;
|
|
71
|
+
bottom: 16px !important;
|
|
72
|
+
left: 12px !important;
|
|
73
|
+
right: 12px !important;
|
|
74
|
+
inset-inline-start: 12px !important;
|
|
75
|
+
inset-inline-end: 12px !important;
|
|
76
|
+
width: auto !important;
|
|
77
|
+
max-width: calc(100% - 24px) !important;
|
|
78
|
+
z-index: 900 !important;
|
|
79
|
+
pointer-events: none;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.copio-scanner-host .sl-toast-stack sl-alert,
|
|
83
|
+
copio-scanner .sl-toast-stack sl-alert,
|
|
84
|
+
copio-app .sl-toast-stack sl-alert {
|
|
85
|
+
pointer-events: auto;
|
|
86
|
+
max-width: 100%;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* 4. Strictly Container-Scoped Dialogs */
|
|
90
|
+
.copio-scanner-host sl-dialog::part(base),
|
|
91
|
+
copio-scanner sl-dialog::part(base),
|
|
92
|
+
copio-app sl-dialog::part(base) {
|
|
93
|
+
position: absolute;
|
|
94
|
+
top: 0;
|
|
95
|
+
right: 0;
|
|
96
|
+
bottom: 0;
|
|
97
|
+
left: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.copio-scanner-host sl-dialog::part(overlay),
|
|
101
|
+
copio-scanner sl-dialog::part(overlay),
|
|
102
|
+
copio-app sl-dialog::part(overlay) {
|
|
103
|
+
position: absolute;
|
|
104
|
+
top: 0;
|
|
105
|
+
right: 0;
|
|
106
|
+
bottom: 0;
|
|
107
|
+
left: 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.copio-scanner-host sl-dialog::part(panel),
|
|
111
|
+
copio-scanner sl-dialog::part(panel),
|
|
112
|
+
copio-app sl-dialog::part(panel) {
|
|
113
|
+
max-width: calc(100% - 20px);
|
|
114
|
+
max-height: calc(100% - 20px);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* 5. Scoped Floating Action Button */
|
|
118
|
+
.copio-fab-wrap {
|
|
119
|
+
position: absolute;
|
|
120
|
+
bottom: 16px;
|
|
121
|
+
right: 16px;
|
|
122
|
+
z-index: 10;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* 6. Touch Target Minimums Invariant */
|
|
126
|
+
.copio-btn,
|
|
127
|
+
.copio-stage-tab,
|
|
128
|
+
.copio-tool-btn,
|
|
129
|
+
.dialog-add-edit-btn,
|
|
130
|
+
button,
|
|
131
|
+
sl-button,
|
|
132
|
+
sl-icon-button,
|
|
133
|
+
sl-icon-button::part(base),
|
|
134
|
+
sl-button::part(base) {
|
|
135
|
+
min-width: var(--copio-touch-target-min, 44px);
|
|
136
|
+
min-height: var(--copio-touch-target-min, 44px);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* 7. Container Query Breakpoints */
|
|
140
|
+
|
|
141
|
+
/* --- Breakpoint 1: Compact Modal (<= 400px, e.g. 360x640, 400x800) --- */
|
|
142
|
+
@container copio-scanner (max-width: 400px) {
|
|
143
|
+
.copio-hide-compact {
|
|
144
|
+
display: none !important;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.copio-header {
|
|
148
|
+
padding: 6px 10px;
|
|
149
|
+
min-height: 48px;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.dialog-add-edit sl-dialog::part(panel),
|
|
153
|
+
.text-dialog sl-dialog::part(panel),
|
|
154
|
+
.crop-dialog sl-dialog::part(panel),
|
|
155
|
+
sl-dialog::part(panel) {
|
|
156
|
+
max-width: calc(100% - 12px);
|
|
157
|
+
max-height: calc(100% - 12px);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.grid-2 {
|
|
161
|
+
grid-template-columns: 1fr;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* --- Breakpoint 2: Sidebar Drawer (401px - 767px, e.g. 480x800) --- */
|
|
166
|
+
@container copio-scanner (min-width: 401px) and (max-width: 767px) {
|
|
167
|
+
.grid-2 {
|
|
168
|
+
grid-template-columns: repeat(2, 1fr);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* --- Breakpoint 3: Standalone Full View (>= 768px, e.g. 100%, 800x500) --- */
|
|
173
|
+
@container copio-scanner (min-width: 768px) {
|
|
174
|
+
.grid-2 {
|
|
175
|
+
grid-template-columns: repeat(2, 1fr);
|
|
176
|
+
}
|
|
177
|
+
}
|
package/css/cropper.css
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Cropper.js v1.3.2
|
|
3
|
+
* https://github.com/fengyuanchen/cropperjs
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2015-2018 Chen Fengyuan
|
|
6
|
+
* Released under the MIT license
|
|
7
|
+
*
|
|
8
|
+
* Date: 2018-03-03T03:42:40.122Z
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
.cropper-container {
|
|
12
|
+
direction: ltr;
|
|
13
|
+
font-size: 0;
|
|
14
|
+
line-height: 0;
|
|
15
|
+
position: relative;
|
|
16
|
+
-ms-touch-action: none;
|
|
17
|
+
touch-action: none;
|
|
18
|
+
-webkit-user-select: none;
|
|
19
|
+
-moz-user-select: none;
|
|
20
|
+
-ms-user-select: none;
|
|
21
|
+
user-select: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.cropper-container img {
|
|
25
|
+
/*Avoid margin top issue (Occur only when margin-top <= -height)
|
|
26
|
+
*/
|
|
27
|
+
display: block;
|
|
28
|
+
height: 100%;
|
|
29
|
+
image-orientation: 0deg;
|
|
30
|
+
max-height: none !important;
|
|
31
|
+
max-width: none !important;
|
|
32
|
+
min-height: 0 !important;
|
|
33
|
+
min-width: 0 !important;
|
|
34
|
+
width: 100%;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.cropper-wrap-box,
|
|
38
|
+
.cropper-canvas,
|
|
39
|
+
.cropper-drag-box,
|
|
40
|
+
.cropper-crop-box,
|
|
41
|
+
.cropper-modal {
|
|
42
|
+
bottom: 0;
|
|
43
|
+
left: 0;
|
|
44
|
+
position: absolute;
|
|
45
|
+
right: 0;
|
|
46
|
+
top: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.cropper-wrap-box,
|
|
50
|
+
.cropper-canvas {
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.cropper-drag-box {
|
|
55
|
+
background-color: #fff;
|
|
56
|
+
opacity: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.cropper-modal {
|
|
60
|
+
background-color: #000;
|
|
61
|
+
opacity: 0.5;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.cropper-view-box {
|
|
65
|
+
display: block;
|
|
66
|
+
height: 100%;
|
|
67
|
+
outline-color: rgba(51, 153, 255, 0.75);
|
|
68
|
+
outline: 1px solid #39f;
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
width: 100%;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.cropper-dashed {
|
|
74
|
+
border: 0 dashed #eee;
|
|
75
|
+
display: block;
|
|
76
|
+
opacity: 0.5;
|
|
77
|
+
position: absolute;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.cropper-dashed.dashed-h {
|
|
81
|
+
border-bottom-width: 1px;
|
|
82
|
+
border-top-width: 1px;
|
|
83
|
+
height: 33.33333%;
|
|
84
|
+
left: 0;
|
|
85
|
+
top: 33.33333%;
|
|
86
|
+
width: 100%;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.cropper-dashed.dashed-v {
|
|
90
|
+
border-left-width: 1px;
|
|
91
|
+
border-right-width: 1px;
|
|
92
|
+
height: 100%;
|
|
93
|
+
left: 33.33333%;
|
|
94
|
+
top: 0;
|
|
95
|
+
width: 33.33333%;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.cropper-center {
|
|
99
|
+
display: block;
|
|
100
|
+
height: 0;
|
|
101
|
+
left: 50%;
|
|
102
|
+
opacity: 0.75;
|
|
103
|
+
position: absolute;
|
|
104
|
+
top: 50%;
|
|
105
|
+
width: 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.cropper-center:before,
|
|
109
|
+
.cropper-center:after {
|
|
110
|
+
background-color: #eee;
|
|
111
|
+
content: ' ';
|
|
112
|
+
display: block;
|
|
113
|
+
position: absolute;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.cropper-center:before {
|
|
117
|
+
height: 1px;
|
|
118
|
+
left: -3px;
|
|
119
|
+
top: 0;
|
|
120
|
+
width: 7px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.cropper-center:after {
|
|
124
|
+
height: 7px;
|
|
125
|
+
left: 0;
|
|
126
|
+
top: -3px;
|
|
127
|
+
width: 1px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.cropper-face,
|
|
131
|
+
.cropper-line,
|
|
132
|
+
.cropper-point {
|
|
133
|
+
display: block;
|
|
134
|
+
height: 100%;
|
|
135
|
+
opacity: 0.1;
|
|
136
|
+
position: absolute;
|
|
137
|
+
width: 100%;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.cropper-face {
|
|
141
|
+
background-color: #fff;
|
|
142
|
+
left: 0;
|
|
143
|
+
top: 0;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.cropper-line {
|
|
147
|
+
background-color: #39f;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.cropper-line.line-e {
|
|
151
|
+
cursor: ew-resize;
|
|
152
|
+
right: -3px;
|
|
153
|
+
top: 0;
|
|
154
|
+
width: 5px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.cropper-line.line-n {
|
|
158
|
+
cursor: ns-resize;
|
|
159
|
+
height: 5px;
|
|
160
|
+
left: 0;
|
|
161
|
+
top: -3px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.cropper-line.line-w {
|
|
165
|
+
cursor: ew-resize;
|
|
166
|
+
left: -3px;
|
|
167
|
+
top: 0;
|
|
168
|
+
width: 5px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.cropper-line.line-s {
|
|
172
|
+
bottom: -3px;
|
|
173
|
+
cursor: ns-resize;
|
|
174
|
+
height: 5px;
|
|
175
|
+
left: 0;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.cropper-point {
|
|
179
|
+
background-color: #39f;
|
|
180
|
+
height: 5px;
|
|
181
|
+
opacity: 0.75;
|
|
182
|
+
width: 5px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.cropper-point.point-e {
|
|
186
|
+
cursor: ew-resize;
|
|
187
|
+
margin-top: -3px;
|
|
188
|
+
right: -3px;
|
|
189
|
+
top: 50%;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.cropper-point.point-n {
|
|
193
|
+
cursor: ns-resize;
|
|
194
|
+
left: 50%;
|
|
195
|
+
margin-left: -3px;
|
|
196
|
+
top: -3px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.cropper-point.point-w {
|
|
200
|
+
cursor: ew-resize;
|
|
201
|
+
left: -3px;
|
|
202
|
+
margin-top: -3px;
|
|
203
|
+
top: 50%;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.cropper-point.point-s {
|
|
207
|
+
bottom: -3px;
|
|
208
|
+
cursor: s-resize;
|
|
209
|
+
left: 50%;
|
|
210
|
+
margin-left: -3px;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.cropper-point.point-ne {
|
|
214
|
+
cursor: nesw-resize;
|
|
215
|
+
right: -3px;
|
|
216
|
+
top: -3px;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.cropper-point.point-nw {
|
|
220
|
+
cursor: nwse-resize;
|
|
221
|
+
left: -3px;
|
|
222
|
+
top: -3px;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.cropper-point.point-sw {
|
|
226
|
+
bottom: -3px;
|
|
227
|
+
cursor: nesw-resize;
|
|
228
|
+
left: -3px;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.cropper-point.point-se {
|
|
232
|
+
bottom: -3px;
|
|
233
|
+
cursor: nwse-resize;
|
|
234
|
+
height: 20px;
|
|
235
|
+
opacity: 1;
|
|
236
|
+
right: -3px;
|
|
237
|
+
width: 20px;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
@media (min-width: 768px) {
|
|
241
|
+
.cropper-point.point-se {
|
|
242
|
+
height: 15px;
|
|
243
|
+
width: 15px;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
@media (min-width: 992px) {
|
|
248
|
+
.cropper-point.point-se {
|
|
249
|
+
height: 10px;
|
|
250
|
+
width: 10px;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
@media (min-width: 1200px) {
|
|
255
|
+
.cropper-point.point-se {
|
|
256
|
+
height: 5px;
|
|
257
|
+
opacity: 0.75;
|
|
258
|
+
width: 5px;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.cropper-point.point-se:before {
|
|
263
|
+
background-color: #39f;
|
|
264
|
+
bottom: -50%;
|
|
265
|
+
content: ' ';
|
|
266
|
+
display: block;
|
|
267
|
+
height: 200%;
|
|
268
|
+
opacity: 0;
|
|
269
|
+
position: absolute;
|
|
270
|
+
right: -50%;
|
|
271
|
+
width: 200%;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.cropper-invisible {
|
|
275
|
+
opacity: 0;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.cropper-bg {
|
|
279
|
+
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.cropper-hide {
|
|
283
|
+
display: block;
|
|
284
|
+
height: 0;
|
|
285
|
+
position: absolute;
|
|
286
|
+
width: 0;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.cropper-hidden {
|
|
290
|
+
display: none !important;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.cropper-move {
|
|
294
|
+
cursor: move;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.cropper-crop {
|
|
298
|
+
cursor: crosshair;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.cropper-disabled .cropper-drag-box,
|
|
302
|
+
.cropper-disabled .cropper-face,
|
|
303
|
+
.cropper-disabled .cropper-line,
|
|
304
|
+
.cropper-disabled .cropper-point {
|
|
305
|
+
cursor: not-allowed;
|
|
306
|
+
}
|