Skip to content

Commit df970ef

Browse files
authored
feat: rename form-copilot/ → copilot/ + brand → SimplePDF Copilot (#31)
## Background Renames the standalone demo from "Form Copilot" to "SimplePDF Copilot" and reorganises the folder. Stacked with the parent SimplePDF repo PR SimplePDF/simple-pdf#196. ## Changes - `git mv form-copilot/ copilot/` (history preserved). - `package.json` `name`, `.cta.json` `projectName`, `.do/deploy.template.yaml` `name` + `source_dir` updated to `copilot`. - README: brand "Form Copilot" → "SimplePDF Copilot" everywhere; live URL `form-copilot.simplepdf.com` → `copilot.simplepdf.com`; deploy folder ref `/form-copilot` → `/copilot`; default `VITE_SIMPLEPDF_COMPANY_IDENTIFIER` documentation flipped to `spdf-copilot`. - `skills/fork-and-go/SKILL.md`: same brand + path + placeholder identifier sweep. - Source-tag query param `?s=form-copilot` → `?s=copilot` across info / layout / download modals. - GitHub source-code chip URL `tree/main/form-copilot` → `tree/main/copilot`. - ASCII architecture diagrams in the info modal: brand box width preserved (`│ Form Copilot │` → `│ Copilot │`, both 17 chars; header `┌── Form Copilot demo ──┐` → `┌── SimplePDF Copilot ──┐`, both 25 chars). - `mode.ts` `COPILOT_DEMO_IDENTIFIER` `'copilot'` → `'spdf-copilot'` (matches the renamed SimplePDF account that hosts the iframe editor). - `en.json`: every "Form Copilot" → "SimplePDF Copilot" (one-shot replace_all). - 22 non-EN locales (`ar, cs, da, de, el, es, et, fi, fr, he, hi, it, nl, no, pl, pt, ro, sv, tr, uk, vi, zh`) translated by the translator agent. Inflected forms preserved (et `Form Copiloti`, fi `-in/-ia/-iin`, pl instrumental `-em`, tr apostrophe-suffixed). Brand kept Latin in every locale. ## Notes Kept intentionally for backward compatibility (commented): - `WELCOME_DISMISSED_COOKIE = 'form-copilot-welcome-dismissed'` — renaming would force returning visitors back through the welcome flow. - `DB_NAME = 'form-copilot-vault'` — renaming would orphan stored BYOK credentials. - CDN paths under `/simple-pdf/assets/form-copilot/*` — operator-controlled assets, not yet moved. `copilot/.env.example` is sandboxed in this session (not editable via tooling) — operator must change `VITE_SIMPLEPDF_COMPANY_IDENTIFIER=form-copilot` to `VITE_SIMPLEPDF_COMPANY_IDENTIFIER=spdf-copilot`. Operator follow-ups (post-merge): - DNS / DO App Platform: deploy `form-copilot.simplepdf.com` → `copilot.simplepdf.com`. - SimplePDF account: rename `copilot` → `spdf-copilot` (the iframe-editor host). - CDN: move `/simple-pdf/assets/form-copilot/*` and `/simple-pdf/assets/meta/form-copilot-*.png` under a `copilot/` prefix. ## Test plan - [x] `cd copilot && npx tsc --noEmit` clean - [x] `cd copilot && npx vitest run` 53/53 - [x] `cd copilot && npx biome check src/` clean (2 pre-existing warnings, unchanged) - [x] All 23 locale JSON files parse
1 parent 8f6feb7 commit df970ef

115 files changed

Lines changed: 735 additions & 703 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.do/deploy.template.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
spec:
2-
name: form-copilot
2+
name: simplepdf-copilot
33
services:
44
- name: web
55
github:
66
repo: SimplePDF/simplepdf-embed
77
branch: main
88
deploy_on_push: false
9-
source_dir: /form-copilot
9+
source_dir: /copilot
1010
environment_slug: node-js
1111
build_command: npm run build
1212
run_command: npm start

README.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -277,19 +277,29 @@ See: [Customize the PDF Editor and Add Branding](https://simplepdf.com/help/how-
277277

278278
## Programmatic Page Control
279279

280-
Currently, page manipulation (add/remove/re-arrange/rotate) is only available through the UI. There are no programmatic APIs for these operations. If you need this feature, [file an issue on the repository](https://github.com/SimplePDF/simplepdf-embed/issues).
280+
Page manipulation is available programmatically through the iframe `postMessage` API. Each event takes 1-indexed visible-page positions (matching the `current_page` that `PAGE_FOCUSED` reports).
281281

282282
**Available programmatic actions:**
283283

284-
| Action | Description |
285-
| ---------------------- | ---------------------------------------------------------------------------------------------------------- |
286-
| `goTo` | Navigate to a specific page |
287-
| `selectTool` | Select a tool (`TEXT`, `BOXED_TEXT`, `CHECKBOX`, `PICTURE`, `SIGNATURE`) or `null` for cursor |
288-
| `detectFields` | Automatically detect form fields in the document |
289-
| `removeFields` | Remove fields by ID, by page, or all fields |
290-
| `getDocumentContent` | Extract text content from the document |
291-
| `submit` | Submit the document (with optional device download) |
292-
| `loadDocument` (Iframe)| Load a document programmatically (Iframe API only) |
284+
| Action | Description |
285+
| ----------------------- | --------------------------------------------------------------------------------------------------------------------- |
286+
| `loadDocument` / `LOAD_DOCUMENT` | Load a document by URL or data URL |
287+
| `goTo` / `GO_TO` | Navigate to a specific page |
288+
| `selectTool` / `SELECT_TOOL` | Select a tool (`TEXT`, `BOXED_TEXT`, `CHECKBOX`, `PICTURE`, `SIGNATURE`) or `null` for cursor |
289+
| `detectFields` / `DETECT_FIELDS` | Auto-detect form fields in the document |
290+
| `removeFields` / `REMOVE_FIELDS` | Remove fields by ID, by page, or all fields |
291+
| `getFields` / `GET_FIELDS` | List every fillable field on the loaded document |
292+
| `setFieldValue` / `SET_FIELD_VALUE` | Write a value into a single field |
293+
| `focusField` / `FOCUS_FIELD` | Highlight + scroll to a field |
294+
| `createField` / `CREATE_FIELD` | Place a field at given coordinates |
295+
| `getDocumentContent` / `GET_DOCUMENT_CONTENT` | Extract text content per page |
296+
| `MOVE_PAGE` | Reorder a visible page (`from_page`, `to_page`) |
297+
| `DELETE_PAGE` | Delete a visible page (rejects deletion of the last remaining page) |
298+
| `ROTATE_PAGE` | Rotate a visible page 90° clockwise (call repeatedly for 180° / 270°) |
299+
| `submit` / `SUBMIT` | Submit the document (with optional device download) |
300+
| `DOWNLOAD` | Trigger an in-browser download without firing the submission flow |
301+
302+
Some events are exposed by the React component (`@simplepdf/react-embed-pdf`) and some are iframe-only — see the linked docs for which surface supports each.
293303

294304
See full documentation: [React](./react/README.md#programmatic-control) | [Iframe](./documentation/IFRAME.md#incoming-events-sent-to-the-iframe)
295305

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"projectName": "form-copilot",
2+
"projectName": "copilot",
33
"mode": "file-router",
44
"typescript": true,
55
"packageManager": "npm",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ SHARED_API_KEYS=
6161
# Exposed to the browser (VITE_ prefix) because the iframe src is built
6262
# client-side. REQUIRED: the app throws at startup if unset.
6363
#
64-
# `form-copilot` is the public demo workspace and whitelists
64+
# `spdf-copilot` is the public demo workspace and whitelists
6565
# `http://localhost:3001`, so the iframe loads as-is for local dev. To
6666
# host this on your own domain, set this to your own SimplePDF
6767
# Premium company identifier and whitelist your serving origin in the
6868
# SimplePDF dashboard.
69-
VITE_SIMPLEPDF_COMPANY_IDENTIFIER=form-copilot
69+
VITE_SIMPLEPDF_COMPANY_IDENTIFIER=spdf-copilot
7070

7171

7272
# Optional. Gates the TanStack Router devtools panel + chatty monitoring
File renamed without changes.

0 commit comments

Comments
 (0)