@yaks/platform 0.0.0-stage → 0.2.36
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 +202 -0
- package/README.md +261 -2
- package/_client-blobs.js +7 -0
- package/_client-error.js +70 -0
- package/_client-modal.js +3 -0
- package/_client-replica.js +5 -0
- package/_client-review.js +1 -0
- package/_client-schema.js +1 -0
- package/_client-vault.js +31 -0
- package/_edit-query.js +1 -0
- package/_uploads.js +4 -0
- package/account-browser.js +67 -0
- package/account-browser.js.map +1 -0
- package/account-browser.ts +87 -0
- package/account-rows.js +130 -0
- package/account-rows.js.map +1 -0
- package/account-rows.ts +237 -0
- package/admin-visits-view.js +65 -0
- package/admin-visits-view.js.map +1 -0
- package/admin-visits-view.ts +120 -0
- package/admin-visits.js +143 -0
- package/admin-visits.js.map +1 -0
- package/admin-visits.ts +211 -0
- package/admit-graph.js +8 -0
- package/admit-graph.js.map +1 -0
- package/admit-graph.ts +10 -0
- package/agent-guide.js +368 -0
- package/agent-guide.js.map +1 -0
- package/agent-guide.ts +450 -0
- package/agents-browser.js +143 -0
- package/agents-browser.js.map +1 -0
- package/agents-browser.ts +141 -0
- package/agents-view.js +129 -0
- package/agents-view.js.map +1 -0
- package/agents-view.ts +236 -0
- package/agents.js +148 -0
- package/agents.js.map +1 -0
- package/agents.ts +150 -0
- package/app-actions.js +56 -0
- package/app-actions.js.map +1 -0
- package/app-actions.ts +61 -0
- package/app-authority.js +280 -0
- package/app-authority.js.map +1 -0
- package/app-authority.ts +356 -0
- package/app-canvas-browser.js +308 -0
- package/app-canvas-browser.js.map +1 -0
- package/app-canvas-browser.ts +377 -0
- package/app-canvas-view.js +244 -0
- package/app-canvas-view.js.map +1 -0
- package/app-canvas-view.ts +399 -0
- package/app-canvas.js +87 -0
- package/app-canvas.js.map +1 -0
- package/app-canvas.ts +170 -0
- package/app-client.js +521 -0
- package/app-client.js.map +1 -0
- package/app-client.ts +562 -0
- package/app-command.js +108 -0
- package/app-command.js.map +1 -0
- package/app-command.ts +155 -0
- package/app-commands.js +334 -0
- package/app-commands.js.map +1 -0
- package/app-commands.ts +379 -0
- package/app-decision.js +69 -0
- package/app-decision.js.map +1 -0
- package/app-decision.ts +61 -0
- package/app-effects.js +43 -0
- package/app-effects.js.map +1 -0
- package/app-effects.ts +53 -0
- package/app-file.js +252 -0
- package/app-file.js.map +1 -0
- package/app-file.ts +362 -0
- package/app-friends.js +60 -0
- package/app-friends.js.map +1 -0
- package/app-friends.ts +81 -0
- package/app-graph.js +9 -0
- package/app-graph.js.map +1 -0
- package/app-graph.ts +9 -0
- package/app-icon.js +59 -0
- package/app-icon.js.map +1 -0
- package/app-icon.ts +121 -0
- package/app-made.js +164 -0
- package/app-made.js.map +1 -0
- package/app-made.ts +306 -0
- package/app-outbound.js +72 -0
- package/app-outbound.js.map +1 -0
- package/app-outbound.ts +109 -0
- package/app-outbox.js +42 -0
- package/app-outbox.js.map +1 -0
- package/app-outbox.ts +46 -0
- package/app-patch.js +75 -0
- package/app-patch.js.map +1 -0
- package/app-patch.ts +106 -0
- package/app-read.js +101 -0
- package/app-read.js.map +1 -0
- package/app-read.ts +126 -0
- package/app-role-tools.js +232 -0
- package/app-role-tools.js.map +1 -0
- package/app-role-tools.ts +258 -0
- package/app-roles.js +91 -0
- package/app-roles.js.map +1 -0
- package/app-roles.ts +76 -0
- package/app-session-access.js +109 -0
- package/app-session-access.js.map +1 -0
- package/app-session-access.ts +145 -0
- package/app-starter.js +109 -0
- package/app-starter.js.map +1 -0
- package/app-starter.ts +123 -0
- package/app-storage.js +38 -0
- package/app-storage.js.map +1 -0
- package/app-storage.ts +54 -0
- package/app-style-guide.js +138 -0
- package/app-style-guide.js.map +1 -0
- package/app-style-guide.ts +195 -0
- package/app-subs.js +89 -0
- package/app-subs.js.map +1 -0
- package/app-subs.ts +110 -0
- package/app-tests.js +54 -0
- package/app-tests.js.map +1 -0
- package/app-tests.ts +56 -0
- package/app-tile.js +209 -0
- package/app-tile.js.map +1 -0
- package/app-tile.ts +227 -0
- package/app-transfer.js +188 -0
- package/app-transfer.js.map +1 -0
- package/app-transfer.ts +281 -0
- package/app-vocab.js +52 -0
- package/app-vocab.js.map +1 -0
- package/app-vocab.ts +43 -0
- package/app-words.js +55 -0
- package/app-words.js.map +1 -0
- package/app-words.ts +73 -0
- package/app-worker.js +28 -0
- package/app-worker.js.map +1 -0
- package/app-worker.ts +38 -0
- package/app-writes.js +132 -0
- package/app-writes.js.map +1 -0
- package/app-writes.ts +128 -0
- package/asset-bytes.js +57 -0
- package/asset-bytes.js.map +1 -0
- package/asset-bytes.ts +90 -0
- package/asset-response.js +28 -0
- package/asset-response.js.map +1 -0
- package/asset-response.ts +46 -0
- package/asset-url.js +556 -0
- package/asset-url.js.map +1 -0
- package/asset-url.ts +774 -0
- package/attribution-vocab.js +14 -0
- package/attribution-vocab.js.map +1 -0
- package/attribution-vocab.ts +11 -0
- package/authorship-graph.js +8 -0
- package/authorship-graph.js.map +1 -0
- package/authorship-graph.ts +10 -0
- package/badge.js +98 -0
- package/blob-images.js +206 -0
- package/blob-images.js.map +1 -0
- package/blob-images.ts +323 -0
- package/blob-posters.js +125 -0
- package/blob-posters.js.map +1 -0
- package/blob-posters.ts +207 -0
- package/blob-routes.js +14 -0
- package/blob-routes.js.map +1 -0
- package/blob-routes.ts +25 -0
- package/bots.js +77 -0
- package/bots.js.map +1 -0
- package/bots.ts +93 -0
- package/browser-mockup.js +81 -0
- package/browser-mockup.js.map +1 -0
- package/browser-mockup.ts +105 -0
- package/browser-record.js +55 -0
- package/browser-record.js.map +1 -0
- package/browser-record.ts +66 -0
- package/browser-scroll.js +90 -0
- package/browser-scroll.js.map +1 -0
- package/browser-scroll.ts +108 -0
- package/browser-stream.js +79 -0
- package/browser-stream.js.map +1 -0
- package/browser-stream.ts +84 -0
- package/browser-trace.js +252 -0
- package/browser-trace.js.map +1 -0
- package/browser-trace.ts +330 -0
- package/browser-viewer.js +236 -0
- package/browser-viewer.js.map +1 -0
- package/browser-viewer.ts +233 -0
- package/browser-visit.js +1522 -0
- package/browser-visit.js.map +1 -0
- package/browser-visit.ts +2179 -0
- package/browser-wire.js +242 -0
- package/browser-wire.js.map +1 -0
- package/browser-wire.ts +262 -0
- package/budget.js +17 -0
- package/budget.js.map +1 -0
- package/budget.ts +42 -0
- package/cli.js +52 -0
- package/cli.js.map +1 -0
- package/cli.ts +55 -0
- package/client-modules.js +24 -0
- package/client-modules.js.map +1 -0
- package/client-modules.ts +24 -0
- package/client-routes.js +83 -0
- package/client-routes.js.map +1 -0
- package/client-routes.ts +104 -0
- package/client-words.js +62 -0
- package/client-words.js.map +1 -0
- package/client-words.ts +77 -0
- package/client.js +709 -0
- package/comp.js +2 -0
- package/comp.js.map +1 -0
- package/comp.ts +15 -0
- package/config.js +497 -0
- package/config.js.map +1 -0
- package/config.ts +287 -0
- package/connect-parts.js +107 -0
- package/connect-parts.js.map +1 -0
- package/connect-parts.ts +165 -0
- package/connected-activity-browser.js +301 -0
- package/connected-activity-browser.js.map +1 -0
- package/connected-activity-browser.ts +341 -0
- package/connected-activity-view.js +55 -0
- package/connected-activity-view.js.map +1 -0
- package/connected-activity-view.ts +81 -0
- package/connected-activity-wire.js +165 -0
- package/connected-activity-wire.js.map +1 -0
- package/connected-activity-wire.ts +171 -0
- package/connected-activity.css +156 -0
- package/connected-activity.js +185 -0
- package/connected-activity.js.map +1 -0
- package/connected-activity.ts +278 -0
- package/connection-icon-browser.js +50 -0
- package/connection-icon-browser.js.map +1 -0
- package/connection-icon-browser.ts +52 -0
- package/connections-browser.js +393 -0
- package/connections-browser.js.map +1 -0
- package/connections-browser.ts +465 -0
- package/connections-page.js +178 -0
- package/connections-page.js.map +1 -0
- package/connections-page.ts +461 -0
- package/connections-view.js +1215 -0
- package/connections-view.js.map +1 -0
- package/connections-view.ts +2239 -0
- package/connector-upload.js +94 -0
- package/connector-upload.js.map +1 -0
- package/connector-upload.ts +146 -0
- package/consent.js +2 -0
- package/consent.js.map +1 -0
- package/consent.ts +3 -0
- package/cookie.js +53 -0
- package/cookie.js.map +1 -0
- package/cookie.ts +75 -0
- package/copy.js +104 -0
- package/corner.js +226 -0
- package/credential-draft-move.js +154 -0
- package/credential-draft-move.js.map +1 -0
- package/credential-draft-move.ts +197 -0
- package/credential-draft-place.js +2 -0
- package/credential-draft-place.js.map +1 -0
- package/credential-draft-place.ts +4 -0
- package/credential-drafts.js +66 -0
- package/credential-drafts.js.map +1 -0
- package/credential-drafts.ts +93 -0
- package/dashboard-browser.js +149 -0
- package/dashboard-browser.js.map +1 -0
- package/dashboard-browser.ts +184 -0
- package/dashboard-view.js +293 -0
- package/dashboard-view.js.map +1 -0
- package/dashboard-view.ts +423 -0
- package/dashboard.js +268 -0
- package/dashboard.js.map +1 -0
- package/dashboard.ts +436 -0
- package/deno.json +1 -0
- package/describe-graph.js +8 -0
- package/describe-graph.js.map +1 -0
- package/describe-graph.ts +7 -0
- package/directory-derived.js +142 -0
- package/directory-derived.js.map +1 -0
- package/directory-derived.ts +198 -0
- package/directory-index-move.js +77 -0
- package/directory-index-move.js.map +1 -0
- package/directory-index-move.ts +59 -0
- package/directory-index.js +382 -0
- package/directory-index.js.map +1 -0
- package/directory-index.ts +550 -0
- package/directory-pages.js +41 -0
- package/directory-pages.js.map +1 -0
- package/directory-pages.ts +71 -0
- package/directory-route.js +129 -0
- package/directory-route.js.map +1 -0
- package/directory-route.ts +189 -0
- package/directory-vocab.js +58 -0
- package/directory-vocab.js.map +1 -0
- package/directory-vocab.ts +46 -0
- package/document-graph.js +86 -0
- package/document-graph.js.map +1 -0
- package/document-graph.ts +93 -0
- package/document-ocr.js +146 -0
- package/document-ocr.js.map +1 -0
- package/document-ocr.ts +204 -0
- package/documents.js +50 -0
- package/documents.js.map +1 -0
- package/documents.ts +64 -0
- package/domain-pages.js +221 -0
- package/domain-pages.js.map +1 -0
- package/domain-pages.ts +586 -0
- package/domain-settings.js +88 -0
- package/domain-settings.js.map +1 -0
- package/domain-settings.ts +132 -0
- package/domain-transfer.js +138 -0
- package/domain-transfer.js.map +1 -0
- package/domain-transfer.ts +190 -0
- package/donation-loans.js +176 -0
- package/donation-loans.js.map +1 -0
- package/donation-loans.ts +271 -0
- package/draft-choice.js +136 -0
- package/draft-choice.js.map +1 -0
- package/draft-choice.ts +310 -0
- package/drawing.js +27 -0
- package/drawing.js.map +1 -0
- package/drawing.ts +40 -0
- package/early-report.js +18 -0
- package/early-report.js.map +1 -0
- package/early-report.ts +31 -0
- package/edit-client-path.js +2 -0
- package/edit-client-path.js.map +1 -0
- package/edit-client-path.ts +1 -0
- package/edit-mode.js +920 -0
- package/edit-mode.js.map +1 -0
- package/edit-mode.ts +1003 -0
- package/edit-sync.js +61 -0
- package/edit-sync.js.map +1 -0
- package/edit-sync.ts +83 -0
- package/edit.js +265 -0
- package/embed-graph.js +11 -0
- package/embed-graph.js.map +1 -0
- package/embed-graph.ts +8 -0
- package/embedded-payment.js +211 -0
- package/embedded-payment.js.map +1 -0
- package/embedded-payment.ts +290 -0
- package/entry-actions-browser.js +43 -0
- package/entry-actions-browser.js.map +1 -0
- package/entry-actions-browser.ts +64 -0
- package/entry-actions.js +56 -0
- package/entry-actions.js.map +1 -0
- package/entry-actions.ts +59 -0
- package/escape.js +14 -0
- package/escape.js.map +1 -0
- package/escape.ts +24 -0
- package/face-input.js +6 -0
- package/face-input.js.map +1 -0
- package/face-input.ts +14 -0
- package/facebook.js +370 -0
- package/facebook.js.map +1 -0
- package/facebook.ts +474 -0
- package/facets.js +142 -0
- package/facets.js.map +1 -0
- package/facets.ts +89 -0
- package/fee.js +45 -0
- package/fee.js.map +1 -0
- package/fee.ts +51 -0
- package/fence.js +164 -0
- package/fence.js.map +1 -0
- package/fence.ts +223 -0
- package/file-metadata.js +135 -0
- package/file-metadata.js.map +1 -0
- package/file-metadata.ts +177 -0
- package/file-operation.js +51 -0
- package/file-operation.js.map +1 -0
- package/file-operation.ts +32 -0
- package/file-redirects.js +72 -0
- package/file-redirects.js.map +1 -0
- package/file-redirects.ts +74 -0
- package/file-root.js +8 -0
- package/file-root.js.map +1 -0
- package/file-root.ts +24 -0
- package/files-routes.js +203 -0
- package/files-routes.js.map +1 -0
- package/files-routes.ts +282 -0
- package/files.js +369 -0
- package/files.js.map +1 -0
- package/files.ts +522 -0
- package/fingerprint.js +217 -0
- package/fingerprint.js.map +1 -0
- package/fingerprint.ts +314 -0
- package/firsts.js +335 -0
- package/firsts.js.map +1 -0
- package/firsts.ts +368 -0
- package/friends-at.js +78 -0
- package/friends-at.js.map +1 -0
- package/friends-at.ts +115 -0
- package/friends-browser.js +66 -0
- package/friends-browser.js.map +1 -0
- package/friends-browser.ts +77 -0
- package/friends-dock-browser.js +375 -0
- package/friends-dock-browser.js.map +1 -0
- package/friends-dock-browser.ts +408 -0
- package/friends-dock-view.js +363 -0
- package/friends-dock-view.js.map +1 -0
- package/friends-dock-view.ts +592 -0
- package/friends-view.js +33 -0
- package/friends-view.js.map +1 -0
- package/friends-view.ts +69 -0
- package/friends.js +153 -0
- package/friends.js.map +1 -0
- package/friends.ts +200 -0
- package/fundraising-orders.js +197 -0
- package/fundraising-orders.js.map +1 -0
- package/fundraising-orders.ts +283 -0
- package/fundraising.js +165 -0
- package/fundraising.js.map +1 -0
- package/fundraising.ts +215 -0
- package/funnel.js +141 -0
- package/funnel.js.map +1 -0
- package/funnel.ts +284 -0
- package/gift-savings.js +19 -0
- package/gift-savings.js.map +1 -0
- package/gift-savings.ts +29 -0
- package/git-history.js +331 -0
- package/git-history.js.map +1 -0
- package/git-history.ts +481 -0
- package/giving-browser.js +35 -0
- package/giving-browser.js.map +1 -0
- package/giving-browser.ts +40 -0
- package/giving-pages.js +284 -0
- package/giving-pages.js.map +1 -0
- package/giving-pages.ts +418 -0
- package/giving-view.js +244 -0
- package/giving-view.js.map +1 -0
- package/giving-view.ts +509 -0
- package/giving.js +198 -0
- package/giving.js.map +1 -0
- package/giving.ts +280 -0
- package/gmail-mailbox.js +52 -0
- package/gmail-mailbox.js.map +1 -0
- package/gmail-mailbox.ts +74 -0
- package/graves.js +136 -0
- package/graves.js.map +1 -0
- package/graves.ts +180 -0
- package/hashed.js +499 -0
- package/hashed.js.map +1 -0
- package/hashed.ts +676 -0
- package/home/assets.js +15 -0
- package/home/assets.js.map +1 -0
- package/home/assets.ts +16 -0
- package/home/brands/stripe.svg +12 -0
- package/home/brands/zoom.svg +34 -0
- package/home/demos.js +413 -0
- package/home/demos.js.map +1 -0
- package/home/demos.ts +431 -0
- package/home/games.js +112 -0
- package/home/games.js.map +1 -0
- package/home/games.ts +137 -0
- package/home/icons.js +41 -0
- package/home/icons.js.map +1 -0
- package/home/icons.ts +42 -0
- package/home/mascot/calculating.webp +0 -0
- package/home/mascot/flag.webp +0 -0
- package/home/mascot/letter.webp +0 -0
- package/home/mascot/plane.webp +0 -0
- package/home/mascot/plug.webp +0 -0
- package/home/mascot/thinking.webp +0 -0
- package/home/mascot/typing.webp +0 -0
- package/home/mascot/wave.webp +0 -0
- package/home/mod.tsx +517 -0
- package/home/parts.js +149 -0
- package/home/parts.js.map +1 -0
- package/home/parts.ts +45 -0
- package/home/phone.tsx +152 -0
- package/home/scenes.tsx +212 -0
- package/home/sky.js +930 -0
- package/home/sky.tsx +479 -0
- package/home/story.js +392 -0
- package/home/style.css +1304 -0
- package/home/words.js +2 -0
- package/home/words.js.map +1 -0
- package/home/words.ts +8 -0
- package/home/yak.js +146 -0
- package/home/yak_test.tsx +111 -0
- package/home-router.js +30 -0
- package/home-router.js.map +1 -0
- package/home-router.ts +41 -0
- package/host.js +58 -0
- package/host.js.map +1 -0
- package/host.ts +97 -0
- package/hosted-page.js +126 -0
- package/hosted-page.js.map +1 -0
- package/hosted-page.ts +295 -0
- package/install-browser.js +89 -0
- package/install-browser.js.map +1 -0
- package/install-browser.ts +99 -0
- package/install-icons.js +271 -0
- package/install-icons.js.map +1 -0
- package/install-icons.ts +366 -0
- package/installs.js +197 -0
- package/installs.js.map +1 -0
- package/installs.ts +270 -0
- package/instrument.js +50 -0
- package/instrument.js.map +1 -0
- package/instrument.ts +55 -0
- package/integration-icons.js +138 -0
- package/integration-icons.js.map +1 -0
- package/integration-icons.ts +198 -0
- package/interaction-browser.js +95 -0
- package/interaction-browser.js.map +1 -0
- package/interaction-browser.ts +107 -0
- package/interaction-report.js +399 -0
- package/interaction-report.js.map +1 -0
- package/interaction-report.ts +450 -0
- package/interaction.js +273 -0
- package/interaction.js.map +1 -0
- package/interaction.ts +290 -0
- package/invite-browser.js +98 -0
- package/invite-browser.js.map +1 -0
- package/invite-browser.ts +123 -0
- package/invite-view.js +100 -0
- package/invite-view.js.map +1 -0
- package/invite-view.ts +137 -0
- package/kept.js +520 -0
- package/kept.js.map +1 -0
- package/kept.ts +821 -0
- package/kills-graph.js +18 -0
- package/kills-graph.js.map +1 -0
- package/kills-graph.ts +16 -0
- package/ladder.js +418 -0
- package/ladder.js.map +1 -0
- package/ladder.ts +510 -0
- package/lenses-graph.js +24 -0
- package/lenses-graph.js.map +1 -0
- package/lenses-graph.ts +27 -0
- package/lenses.js +197 -0
- package/lenses.js.map +1 -0
- package/lenses.ts +204 -0
- package/lent.js +32 -0
- package/lent.js.map +1 -0
- package/lent.ts +95 -0
- package/letters.js +134 -0
- package/letters.js.map +1 -0
- package/letters.ts +251 -0
- package/lexicon-graph.js +11 -0
- package/lexicon-graph.js.map +1 -0
- package/lexicon-graph.ts +7 -0
- package/link-preview.js +111 -0
- package/link-preview.js.map +1 -0
- package/link-preview.ts +136 -0
- package/listing.js +262 -0
- package/listing.js.map +1 -0
- package/listing.ts +330 -0
- package/local-time.js +32 -0
- package/local-time.js.map +1 -0
- package/local-time.ts +41 -0
- package/located.js +380 -0
- package/located.js.map +1 -0
- package/located.ts +471 -0
- package/log-graph.js +7 -0
- package/log-graph.js.map +1 -0
- package/log-graph.ts +9 -0
- package/lower-graph.js +7 -0
- package/lower-graph.js.map +1 -0
- package/lower-graph.ts +9 -0
- package/mail-request.js +32 -0
- package/mail-request.js.map +1 -0
- package/mail-request.ts +29 -0
- package/mail-senders.js +40 -0
- package/mail-senders.js.map +1 -0
- package/mail-senders.ts +47 -0
- package/managed-browser-pilot.js +151 -0
- package/managed-browser-pilot.js.map +1 -0
- package/managed-browser-pilot.ts +230 -0
- package/managed-browser-sites.js +43 -0
- package/managed-browser-sites.js.map +1 -0
- package/managed-browser-sites.ts +41 -0
- package/managed-browser-wire.js +142 -0
- package/managed-browser-wire.js.map +1 -0
- package/managed-browser-wire.ts +140 -0
- package/managed-browser.js +529 -0
- package/managed-browser.js.map +1 -0
- package/managed-browser.ts +740 -0
- package/manifest.js +425 -0
- package/manifest.js.map +1 -0
- package/manifest.ts +468 -0
- package/metadata-effect.js +61 -0
- package/metadata-effect.js.map +1 -0
- package/metadata-effect.ts +59 -0
- package/meter-graph.js +205 -0
- package/meter-graph.js.map +1 -0
- package/meter-graph.ts +238 -0
- package/meter-vocab.js +8 -0
- package/meter-vocab.js.map +1 -0
- package/meter-vocab.ts +4 -0
- package/meter.js +402 -0
- package/meter.js.map +1 -0
- package/meter.ts +697 -0
- package/mod.js +14 -0
- package/mod.js.map +1 -0
- package/mod.ts +16 -0
- package/models-vocab.js +25 -0
- package/models-vocab.js.map +1 -0
- package/models-vocab.ts +15 -0
- package/monogram.js +32 -0
- package/monogram.js.map +1 -0
- package/monogram.ts +46 -0
- package/mover.js +6 -0
- package/mover.js.map +1 -0
- package/mover.ts +45 -0
- package/named.js +136 -0
- package/named.js.map +1 -0
- package/named.ts +169 -0
- package/names.js +196 -0
- package/names.js.map +1 -0
- package/names.ts +252 -0
- package/notices-vocab.js +20 -0
- package/notices-vocab.js.map +1 -0
- package/notices-vocab.ts +28 -0
- package/numbers.js +85 -0
- package/numbers.js.map +1 -0
- package/numbers.ts +97 -0
- package/object-hosts.js +137 -0
- package/object-hosts.js.map +1 -0
- package/object-hosts.ts +153 -0
- package/open-script.js +235 -0
- package/open-script.js.map +1 -0
- package/open-script.ts +253 -0
- package/opening.js +31 -0
- package/opening.js.map +1 -0
- package/opening.ts +28 -0
- package/operator-activity-view.js +82 -0
- package/operator-activity-view.js.map +1 -0
- package/operator-activity-view.ts +85 -0
- package/operator-activity.js +220 -0
- package/operator-activity.js.map +1 -0
- package/operator-activity.ts +293 -0
- package/operator-brief.js +36 -0
- package/operator-brief.js.map +1 -0
- package/operator-brief.ts +76 -0
- package/operator-copy-browser.js +67 -0
- package/operator-copy-browser.js.map +1 -0
- package/operator-copy-browser.ts +71 -0
- package/operator-corner.js +266 -0
- package/operator-corner.js.map +1 -0
- package/operator-corner.ts +300 -0
- package/operator-decisions.js +19 -0
- package/operator-decisions.js.map +1 -0
- package/operator-decisions.ts +18 -0
- package/operator-docs.js +152 -0
- package/operator-docs.js.map +1 -0
- package/operator-docs.ts +196 -0
- package/operator-door.js +10 -0
- package/operator-door.js.map +1 -0
- package/operator-door.ts +14 -0
- package/operator-drafts-browser.js +28 -0
- package/operator-drafts-browser.js.map +1 -0
- package/operator-drafts-browser.ts +32 -0
- package/operator-drafts.js +60 -0
- package/operator-drafts.js.map +1 -0
- package/operator-drafts.ts +80 -0
- package/operator-early-draft.js +110 -0
- package/operator-early-draft.js.map +1 -0
- package/operator-early-draft.ts +125 -0
- package/operator-go-browser.js +130 -0
- package/operator-go-browser.js.map +1 -0
- package/operator-go-browser.ts +182 -0
- package/operator-go-step.js +86 -0
- package/operator-go-step.js.map +1 -0
- package/operator-go-step.ts +92 -0
- package/operator-go-tool.js +49 -0
- package/operator-go-tool.js.map +1 -0
- package/operator-go-tool.ts +31 -0
- package/operator-go.js +68 -0
- package/operator-go.js.map +1 -0
- package/operator-go.ts +100 -0
- package/operator-graph.js +46 -0
- package/operator-graph.js.map +1 -0
- package/operator-graph.ts +60 -0
- package/operator-handoff.js +91 -0
- package/operator-handoff.js.map +1 -0
- package/operator-handoff.ts +104 -0
- package/operator-machine.js +136 -0
- package/operator-machine.js.map +1 -0
- package/operator-machine.ts +168 -0
- package/operator-matches-browser.js +155 -0
- package/operator-matches-browser.js.map +1 -0
- package/operator-matches-browser.ts +178 -0
- package/operator-matches-view.js +147 -0
- package/operator-matches-view.js.map +1 -0
- package/operator-matches-view.ts +224 -0
- package/operator-matches.js +65 -0
- package/operator-matches.js.map +1 -0
- package/operator-matches.ts +120 -0
- package/operator-memory.js +119 -0
- package/operator-memory.js.map +1 -0
- package/operator-memory.ts +122 -0
- package/operator-mic.ts +40 -0
- package/operator-model.js +144 -0
- package/operator-model.js.map +1 -0
- package/operator-model.ts +154 -0
- package/operator-notes.js +32 -0
- package/operator-notes.js.map +1 -0
- package/operator-notes.ts +40 -0
- package/operator-opening-browser.js +184 -0
- package/operator-opening-browser.js.map +1 -0
- package/operator-opening-browser.ts +195 -0
- package/operator-owner.js +391 -0
- package/operator-owner.js.map +1 -0
- package/operator-owner.ts +392 -0
- package/operator-page-context.js +121 -0
- package/operator-page-context.js.map +1 -0
- package/operator-page-context.ts +143 -0
- package/operator-page-image.js +38 -0
- package/operator-page-image.js.map +1 -0
- package/operator-page-image.ts +42 -0
- package/operator-panel-browser.js +601 -0
- package/operator-panel-browser.js.map +1 -0
- package/operator-panel-browser.ts +669 -0
- package/operator-panel-view.js +69 -0
- package/operator-panel-view.js.map +1 -0
- package/operator-panel-view.ts +100 -0
- package/operator-panel.js +131 -0
- package/operator-panel.js.map +1 -0
- package/operator-panel.ts +155 -0
- package/operator-push.tsx +112 -0
- package/operator-record.js +55 -0
- package/operator-record.js.map +1 -0
- package/operator-record.ts +92 -0
- package/operator-replies.js +240 -0
- package/operator-replies.js.map +1 -0
- package/operator-replies.ts +281 -0
- package/operator-reply-view.js +117 -0
- package/operator-reply-view.js.map +1 -0
- package/operator-reply-view.ts +185 -0
- package/operator-safety.js +30 -0
- package/operator-safety.js.map +1 -0
- package/operator-safety.ts +53 -0
- package/operator-settings-browser.js +257 -0
- package/operator-settings-browser.js.map +1 -0
- package/operator-settings-browser.ts +290 -0
- package/operator-settings-view.js +291 -0
- package/operator-settings-view.js.map +1 -0
- package/operator-settings-view.ts +588 -0
- package/operator-settings.js +79 -0
- package/operator-settings.js.map +1 -0
- package/operator-settings.ts +137 -0
- package/operator-source.js +43 -0
- package/operator-source.js.map +1 -0
- package/operator-source.ts +69 -0
- package/operator-talk-browser.js +94 -0
- package/operator-talk-browser.js.map +1 -0
- package/operator-talk-browser.ts +120 -0
- package/operator-talk.js +83 -0
- package/operator-talk.js.map +1 -0
- package/operator-talk.ts +127 -0
- package/operator-task-text.js +45 -0
- package/operator-task-text.js.map +1 -0
- package/operator-task-text.ts +49 -0
- package/operator-timing-browser.js +51 -0
- package/operator-timing-browser.js.map +1 -0
- package/operator-timing-browser.ts +68 -0
- package/operator-timing-view.js +48 -0
- package/operator-timing-view.js.map +1 -0
- package/operator-timing-view.ts +90 -0
- package/operator-timing.js +132 -0
- package/operator-timing.js.map +1 -0
- package/operator-timing.ts +170 -0
- package/operator-vocab.js +8 -0
- package/operator-vocab.js.map +1 -0
- package/operator-vocab.ts +7 -0
- package/operator-voice-audio.ts +84 -0
- package/operator-voice-browser.ts +237 -0
- package/operator-voice-feedback.js +108 -0
- package/operator-voice-feedback.js.map +1 -0
- package/operator-voice-feedback.ts +133 -0
- package/operator-voice-view.js +33 -0
- package/operator-voice-view.js.map +1 -0
- package/operator-voice-view.ts +43 -0
- package/operator-voice.css +38 -0
- package/operator-voice.js +35 -0
- package/operator-voice.js.map +1 -0
- package/operator-voice.ts +33 -0
- package/operator-wait.js +70 -0
- package/operator-wait.js.map +1 -0
- package/operator-wait.ts +79 -0
- package/operator-watches.js +126 -0
- package/operator-watches.js.map +1 -0
- package/operator-watches.ts +141 -0
- package/operator-words.js +94 -0
- package/operator-words.js.map +1 -0
- package/operator-words.ts +114 -0
- package/outreach-trial.js +103 -0
- package/outreach-trial.js.map +1 -0
- package/outreach-trial.ts +122 -0
- package/outreach-vocab.js +10 -0
- package/outreach-vocab.js.map +1 -0
- package/outreach-vocab.ts +7 -0
- package/outreach.js +162 -0
- package/outreach.js.map +1 -0
- package/outreach.ts +239 -0
- package/package.json +1131 -4
- package/packs.js +103 -0
- package/packs.js.map +1 -0
- package/packs.ts +119 -0
- package/page-copy.js +267 -0
- package/page-copy.js.map +1 -0
- package/page-copy.ts +362 -0
- package/page-graph.js +114 -0
- package/page-graph.js.map +1 -0
- package/page-graph.ts +151 -0
- package/page-links.js +78 -0
- package/page-links.js.map +1 -0
- package/page-links.ts +124 -0
- package/page-parts.js +236 -0
- package/page-parts.js.map +1 -0
- package/page-parts.ts +388 -0
- package/page-query.js +95 -0
- package/page-query.js.map +1 -0
- package/page-query.ts +120 -0
- package/page-script.js +183 -0
- package/page-script.js.map +1 -0
- package/page-script.ts +192 -0
- package/page-wire.js +93 -0
- package/page-wire.js.map +1 -0
- package/page-wire.ts +100 -0
- package/pages-vocab.js +9 -0
- package/pages-vocab.js.map +1 -0
- package/pages-vocab.ts +5 -0
- package/partials.js +21 -0
- package/partials.js.map +1 -0
- package/partials.ts +37 -0
- package/payment-browser.js +250 -0
- package/payment-browser.js.map +1 -0
- package/payment-browser.ts +298 -0
- package/payment-rows.js +117 -0
- package/payment-rows.js.map +1 -0
- package/payment-rows.ts +219 -0
- package/payment-view.js +397 -0
- package/payment-view.js.map +1 -0
- package/payment-view.ts +852 -0
- package/people-browser.js +186 -0
- package/people-browser.js.map +1 -0
- package/people-browser.ts +210 -0
- package/people-rows.js +192 -0
- package/people-rows.js.map +1 -0
- package/people-rows.ts +289 -0
- package/people-view.js +463 -0
- package/people-view.js.map +1 -0
- package/people-view.ts +804 -0
- package/person-lines.js +196 -0
- package/person-lines.js.map +1 -0
- package/person-lines.ts +256 -0
- package/place.js +30 -0
- package/place.js.map +1 -0
- package/place.ts +31 -0
- package/plan-details.js +39 -0
- package/plan-details.js.map +1 -0
- package/plan-details.ts +57 -0
- package/plan-trial-graph.js +63 -0
- package/plan-trial-graph.js.map +1 -0
- package/plan-trial-graph.ts +57 -0
- package/plans.js +223 -0
- package/plans.js.map +1 -0
- package/plans.ts +313 -0
- package/platform-credentials.js +136 -0
- package/platform-credentials.js.map +1 -0
- package/platform-credentials.ts +189 -0
- package/poster-backfill.js +72 -0
- package/poster-backfill.js.map +1 -0
- package/poster-backfill.ts +96 -0
- package/presence.js +57 -0
- package/presence.js.map +1 -0
- package/presence.ts +77 -0
- package/preview-audit.js +65 -0
- package/preview-audit.js.map +1 -0
- package/preview-audit.ts +126 -0
- package/preview-fit.js +62 -0
- package/preview-fit.js.map +1 -0
- package/preview-fit.ts +72 -0
- package/preview-html.js +96 -0
- package/preview-html.js.map +1 -0
- package/preview-html.ts +139 -0
- package/preview.js +317 -0
- package/preview.js.map +1 -0
- package/preview.ts +498 -0
- package/price.js +53 -0
- package/price.js.map +1 -0
- package/price.ts +85 -0
- package/profile-browser.js +117 -0
- package/profile-browser.js.map +1 -0
- package/profile-browser.ts +141 -0
- package/profile-view.js +96 -0
- package/profile-view.js.map +1 -0
- package/profile-view.ts +197 -0
- package/provider-credits.js +159 -0
- package/provider-credits.js.map +1 -0
- package/provider-credits.ts +174 -0
- package/public-site-choice.js +18 -0
- package/public-site-choice.js.map +1 -0
- package/public-site-choice.ts +21 -0
- package/public-site.js +151 -0
- package/public-site.js.map +1 -0
- package/public-site.ts +268 -0
- package/publishing-graph.js +136 -0
- package/publishing-graph.js.map +1 -0
- package/publishing-graph.ts +122 -0
- package/qr.js +32 -0
- package/qr.js.map +1 -0
- package/qr.ts +32 -0
- package/query-page.js +159 -0
- package/query-page.js.map +1 -0
- package/query-page.ts +249 -0
- package/query-refusal.js +174 -0
- package/query-refusal.js.map +1 -0
- package/query-refusal.ts +319 -0
- package/refusal-loop.js +71 -0
- package/refusal-loop.js.map +1 -0
- package/refusal-loop.ts +98 -0
- package/refusals-vocab.js +9 -0
- package/refusals-vocab.js.map +1 -0
- package/refusals-vocab.ts +5 -0
- package/refused-writes.js +119 -0
- package/refused-writes.js.map +1 -0
- package/refused-writes.ts +152 -0
- package/refused.js +67 -0
- package/refused.js.map +1 -0
- package/refused.ts +76 -0
- package/regional-route-storage.js +127 -0
- package/regional-route-storage.js.map +1 -0
- package/regional-route-storage.ts +94 -0
- package/regional-route.js +105 -0
- package/regional-route.js.map +1 -0
- package/regional-route.ts +158 -0
- package/regional-serving-copy.js +153 -0
- package/regional-serving-copy.js.map +1 -0
- package/regional-serving-copy.ts +200 -0
- package/release-asset.js +71 -0
- package/release-asset.js.map +1 -0
- package/release-asset.ts +121 -0
- package/release-browser.js +383 -0
- package/release-code.js +5 -0
- package/release-entry.js +3 -0
- package/release-file.js +169 -0
- package/release-file.js.map +1 -0
- package/release-file.ts +241 -0
- package/release-index.js +140 -0
- package/release-index.js.map +1 -0
- package/release-index.ts +161 -0
- package/release-page.js +227 -0
- package/release-reads.js +27 -0
- package/release-reads.js.map +1 -0
- package/release-reads.ts +56 -0
- package/release-sheets.js +76 -0
- package/release-state.js +181 -0
- package/release-update.js +22 -0
- package/release-update.js.map +1 -0
- package/release-update.ts +29 -0
- package/release.js +50 -0
- package/release.js.map +1 -0
- package/release.ts +72 -0
- package/released.js +263 -0
- package/released.js.map +1 -0
- package/released.ts +310 -0
- package/remake-graph.js +17 -0
- package/remake-graph.js.map +1 -0
- package/remake-graph.ts +15 -0
- package/rouse-graph.js +11 -0
- package/rouse-graph.js.map +1 -0
- package/rouse-graph.ts +8 -0
- package/route-memory.js +101 -0
- package/route-memory.js.map +1 -0
- package/route-memory.ts +132 -0
- package/routes.js +1143 -0
- package/routes.js.map +1 -0
- package/routes.ts +1502 -0
- package/sale-recovery.js +175 -0
- package/sale-recovery.js.map +1 -0
- package/sale-recovery.ts +156 -0
- package/sales.js +113 -0
- package/sales.js.map +1 -0
- package/sales.ts +150 -0
- package/schema.js +28 -0
- package/schema.js.map +1 -0
- package/schema.ts +13 -0
- package/serving-copy.js +161 -0
- package/serving-copy.js.map +1 -0
- package/serving-copy.ts +201 -0
- package/settings-drafts-browser.js +81 -0
- package/settings-drafts-browser.js.map +1 -0
- package/settings-drafts-browser.ts +95 -0
- package/settings-drafts.js +119 -0
- package/settings-drafts.js.map +1 -0
- package/settings-drafts.ts +136 -0
- package/shared-browser.js +61 -0
- package/shared-browser.js.map +1 -0
- package/shared-browser.ts +77 -0
- package/shared-view.js +29 -0
- package/shared-view.js.map +1 -0
- package/shared-view.ts +47 -0
- package/side-browser.js +164 -0
- package/side-browser.js.map +1 -0
- package/side-browser.ts +201 -0
- package/side-parts.js +258 -0
- package/side-parts.js.map +1 -0
- package/side-parts.ts +447 -0
- package/side-rows.js +64 -0
- package/side-rows.js.map +1 -0
- package/side-rows.ts +104 -0
- package/signed-in.js +37 -0
- package/signed-in.js.map +1 -0
- package/signed-in.ts +45 -0
- package/site-assets.js +8 -0
- package/site-assets.js.map +1 -0
- package/site-assets.ts +25 -0
- package/site-header.js +65 -0
- package/site-header.js.map +1 -0
- package/site-header.ts +71 -0
- package/site-nav.js +75 -0
- package/site-nav.js.map +1 -0
- package/site-nav.ts +82 -0
- package/site-validation.js +37 -0
- package/site-validation.js.map +1 -0
- package/site-validation.ts +47 -0
- package/space-apps-browser.js +107 -0
- package/space-apps-browser.js.map +1 -0
- package/space-apps-browser.ts +128 -0
- package/space-apps-view.js +222 -0
- package/space-apps-view.js.map +1 -0
- package/space-apps-view.ts +396 -0
- package/space-apps.js +88 -0
- package/space-apps.js.map +1 -0
- package/space-apps.ts +143 -0
- package/space-logo.js +82 -0
- package/space-logo.js.map +1 -0
- package/space-logo.ts +112 -0
- package/space-pages-browser.js +474 -0
- package/space-pages-browser.js.map +1 -0
- package/space-pages-browser.ts +463 -0
- package/space-pages-view.js +212 -0
- package/space-pages-view.js.map +1 -0
- package/space-pages-view.ts +460 -0
- package/space-pages.js +193 -0
- package/space-pages.js.map +1 -0
- package/space-pages.ts +282 -0
- package/space-switch.js +36 -0
- package/space-switch.js.map +1 -0
- package/space-switch.ts +64 -0
- package/splash.js +510 -0
- package/splash.js.map +1 -0
- package/splash.ts +525 -0
- package/standing.js +409 -0
- package/standing.js.map +1 -0
- package/standing.ts +746 -0
- package/still.js +63 -0
- package/still.js.map +1 -0
- package/still.ts +95 -0
- package/store-listing.js +107 -0
- package/store-listing.js.map +1 -0
- package/store-listing.ts +133 -0
- package/store-wake.js +65 -0
- package/store-wake.js.map +1 -0
- package/store-wake.ts +101 -0
- package/stream-posters.js +177 -0
- package/stream-posters.js.map +1 -0
- package/stream-posters.ts +297 -0
- package/support-contract-service.js +219 -0
- package/support-contract-service.js.map +1 -0
- package/support-contract-service.ts +307 -0
- package/support-contract-view.js +155 -0
- package/support-contract-view.js.map +1 -0
- package/support-contract-view.ts +265 -0
- package/support-contract.js +114 -0
- package/support-contract.js.map +1 -0
- package/support-contract.ts +157 -0
- package/sweep-vocab.js +10 -0
- package/sweep-vocab.js.map +1 -0
- package/sweep-vocab.ts +9 -0
- package/talk-views-browser.js +208 -0
- package/talk-views-browser.js.map +1 -0
- package/talk-views-browser.ts +232 -0
- package/talk-views.js +36 -0
- package/talk-views.js.map +1 -0
- package/talk-views.ts +64 -0
- package/task-rows.js +86 -0
- package/task-rows.js.map +1 -0
- package/task-rows.ts +96 -0
- package/tasks-view.js +111 -0
- package/tasks-view.js.map +1 -0
- package/tasks-view.ts +176 -0
- package/toast.ts +17 -0
- package/trash-graph.js +41 -0
- package/trash-graph.js.map +1 -0
- package/trash-graph.ts +27 -0
- package/trash-vocab.js +8 -0
- package/trash-vocab.js.map +1 -0
- package/trash-vocab.ts +4 -0
- package/trial.js +325 -0
- package/trial.js.map +1 -0
- package/trial.ts +451 -0
- package/update-rows.js +77 -0
- package/update-rows.js.map +1 -0
- package/update-rows.ts +171 -0
- package/update-waiting.js +131 -0
- package/update-waiting.js.map +1 -0
- package/update-waiting.ts +133 -0
- package/updates-browser.js +28 -0
- package/updates-browser.js.map +1 -0
- package/updates-browser.ts +33 -0
- package/updates-day-browser.js +77 -0
- package/updates-day-browser.js.map +1 -0
- package/updates-day-browser.ts +84 -0
- package/updates-day.js +60 -0
- package/updates-day.js.map +1 -0
- package/updates-day.ts +94 -0
- package/updates-list-browser.js +175 -0
- package/updates-list-browser.js.map +1 -0
- package/updates-list-browser.ts +198 -0
- package/updates-view.js +546 -0
- package/updates-view.js.map +1 -0
- package/updates-view.ts +814 -0
- package/upload-client-path.js +5 -0
- package/upload-client-path.js.map +1 -0
- package/upload-client-path.ts +4 -0
- package/uploads.js +290 -0
- package/uploads.js.map +1 -0
- package/uploads.ts +334 -0
- package/upstream.js +40 -0
- package/upstream.js.map +1 -0
- package/upstream.ts +57 -0
- package/version-view.js +57 -0
- package/version-view.js.map +1 -0
- package/version-view.ts +99 -0
- package/versions.js +231 -0
- package/versions.js.map +1 -0
- package/versions.ts +367 -0
- package/visit-counts.js +123 -0
- package/visit-counts.js.map +1 -0
- package/visit-counts.ts +162 -0
- package/visitor-location.js +33 -0
- package/visitor-location.js.map +1 -0
- package/visitor-location.ts +38 -0
- package/visitor.js +152 -0
- package/visitor.js.map +1 -0
- package/visitor.ts +228 -0
- package/visits-browser.js +71 -0
- package/visits-browser.js.map +1 -0
- package/visits-browser.ts +87 -0
- package/visits-view.js +88 -0
- package/visits-view.js.map +1 -0
- package/visits-view.ts +184 -0
- package/visits.js +428 -0
- package/visits.js.map +1 -0
- package/visits.ts +561 -0
- package/vocab/account.vocab.json +349 -0
- package/vocab/agents.vocab.json +64 -0
- package/vocab/app-canvas.vocab.json +137 -0
- package/vocab/app-friends.vocab.json +71 -0
- package/vocab/app-permissions.vocab.json +46 -0
- package/vocab/apps.vocab.json +553 -0
- package/vocab/attribution.vocab.json +32 -0
- package/vocab/builder-install.vocab.json +10 -0
- package/vocab/connections.vocab.json +128 -0
- package/vocab/dashboard.vocab.json +148 -0
- package/vocab/directory.vocab.json +2445 -0
- package/vocab/exception.vocab.json +18 -0
- package/vocab/fundraising.vocab.json +284 -0
- package/vocab/gmail-mailbox.vocab.json +73 -0
- package/vocab/kernel.vocab.json +420 -0
- package/vocab/mcp-retirement.vocab.json +66 -0
- package/vocab/meter.vocab.json +230 -0
- package/vocab/models-install.vocab.json +10 -0
- package/vocab/notices.vocab.json +88 -0
- package/vocab/operator-drafts.vocab.json +19 -0
- package/vocab/operator-matches.vocab.json +85 -0
- package/vocab/operator-settings.vocab.json +127 -0
- package/vocab/operator-talk.vocab.json +92 -0
- package/vocab/operator.vocab.json +1314 -0
- package/vocab/outreach.vocab.json +141 -0
- package/vocab/pages.vocab.json +38 -0
- package/vocab/payment.vocab.json +271 -0
- package/vocab/people.vocab.json +337 -0
- package/vocab/presence.vocab.json +19 -0
- package/vocab/preview.vocab.json +66 -0
- package/vocab/referenced.vocab.json +17 -0
- package/vocab/referral.vocab.json +272 -0
- package/vocab/refusals.vocab.json +16 -0
- package/vocab/registration.vocab.json +17 -0
- package/vocab/serving.vocab.json +103 -0
- package/vocab/side.vocab.json +97 -0
- package/vocab/space-apps.vocab.json +137 -0
- package/vocab/space-pages.vocab.json +416 -0
- package/vocab/sweep-install.vocab.json +10 -0
- package/vocab/sweep.vocab.json +125 -0
- package/vocab/trash.vocab.json +19 -0
- package/vocab/update.vocab.json +53 -0
- package/vocab/upload.vocab.json +69 -0
- package/vocab/use.vocab.json +93 -0
- package/vocab/visits.vocab.json +143 -0
- package/vocab/waiting.vocab.json +29 -0
- package/vocab.js +16 -0
- package/vocab.js.map +1 -0
- package/vocab.json +1703 -0
- package/vocab.ts +17 -0
- package/weigh-graph.js +12 -0
- package/weigh-graph.js.map +1 -0
- package/weigh-graph.ts +9 -0
- package/wire-news.js +30 -0
- package/wire-news.js.map +1 -0
- package/wire-news.ts +30 -0
- package/work-standing.js +64 -0
- package/work-standing.js.map +1 -0
- package/work-standing.ts +44 -0
- package/woven.js +435 -0
- package/woven.js.map +1 -0
- package/woven.ts +649 -0
- package/wrap-graph.js +17 -0
- package/wrap-graph.js.map +1 -0
- package/wrap-graph.ts +15 -0
- package/write-owner.js +11 -0
- package/write-owner.js.map +1 -0
- package/write-owner.ts +24 -0
package/edit-mode.ts
ADDED
|
@@ -0,0 +1,1003 @@
|
|
|
1
|
+
// Edit mode on an app's page: the words a member may type over where they
|
|
2
|
+
// stand. public/edit.js draws the pencil and loads this, served at the app's
|
|
3
|
+
// `./api/_edit.js` (assets.ts), once it is pressed; a stranger, a guest
|
|
4
|
+
// and a sandboxed page are never sent either (apps.ts `editOf`).
|
|
5
|
+
//
|
|
6
|
+
// Each element naming a snippet (`data-copy`, @yaks/copy) is outlined, and a
|
|
7
|
+
// press on one lets the person type over it. What they type is their draft
|
|
8
|
+
// at `copy:<key>` (@yaks/draft): kept as they type, there after a reload and
|
|
9
|
+
// on their other devices, and shown in place of the page's words while edit
|
|
10
|
+
// mode is on. Escape, or Enter in a snippet of one line, leaves it, what was
|
|
11
|
+
// typed kept (@yaks/ux/edit-keys). A slot's child (`data-copy-slot`) is not
|
|
12
|
+
// typed over; it holds its place in the sentence. While editing, nothing on
|
|
13
|
+
// the page acts on a press: links do not go and buttons do not press.
|
|
14
|
+
//
|
|
15
|
+
// A list (`data-copy-list`) is edited item by item, each of its child
|
|
16
|
+
// elements an item of plain text. Enter adds an item after the one typed in,
|
|
17
|
+
// drawn as the list's first item was, taking what followed the caret; Backspace
|
|
18
|
+
// in an empty item removes it, and so does leaving it empty. An item moves by
|
|
19
|
+
// its handle, dragged with a mouse or a finger, or with Alt and an arrow key.
|
|
20
|
+
// The list's draft is all its items, at `copy-list:<key>`, and Save sends them
|
|
21
|
+
// as one list.
|
|
22
|
+
//
|
|
23
|
+
// The panel beside the pencil counts the person's changes to this app and
|
|
24
|
+
// discards them, which empties each draft (the journal keeps what it held).
|
|
25
|
+
// Save sends them to the app's `api/save` (save.ts), which sets them in its
|
|
26
|
+
// copy.json and releases it. The page takes them as its own words the moment
|
|
27
|
+
// Save is pressed, and the panel says so; the drafts are spent only once the
|
|
28
|
+
// save answers, so a save refused or failed puts the page's words back,
|
|
29
|
+
// leaves every draft as it was and says why. A Save pressed while one is on
|
|
30
|
+
// its way goes after it. Done returns the page to browsing while waiting.
|
|
31
|
+
// Once a save answers, the panel says which version
|
|
32
|
+
// it made and offers Undo (`api/save/undo`), which takes that release back
|
|
33
|
+
// and makes the changes drafts again, as they were before Save. How long the
|
|
34
|
+
// answer took is timed as a press is (@yaks/timing), at `report`.
|
|
35
|
+
// A page with nothing marked says so, and offers the Operator's chat with the
|
|
36
|
+
// ask to mark this page already typed.
|
|
37
|
+
import {
|
|
38
|
+
fill,
|
|
39
|
+
join,
|
|
40
|
+
longTranslations,
|
|
41
|
+
names,
|
|
42
|
+
parse,
|
|
43
|
+
valueAt as sourceAt,
|
|
44
|
+
} from '@yaks/copy'
|
|
45
|
+
import { phases } from '@yaks/timing/interaction'
|
|
46
|
+
import { editKey } from '@yaks/ux/edit-keys'
|
|
47
|
+
|
|
48
|
+
/** What edit mode needs of the person's drafts: the desk client.js gives
|
|
49
|
+
* (`drafts()`, @yaks/draft/browser). */
|
|
50
|
+
export type Desk = {
|
|
51
|
+
ready: Promise<void>
|
|
52
|
+
text: (place: string) => string
|
|
53
|
+
type: (place: string, text: string) => void
|
|
54
|
+
spend: (place: string) => Promise<boolean>
|
|
55
|
+
places: () => string[]
|
|
56
|
+
follow: (fn: () => void) => () => void
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Where edit mode draws its panel, and the Operator's chat it offers. */
|
|
60
|
+
export type Opts = {
|
|
61
|
+
panel: HTMLElement
|
|
62
|
+
/** The app's address, whose `api/save` Save sends to (`/cookbook/`). */
|
|
63
|
+
at: string
|
|
64
|
+
/** How Save, and a save's time, reach it; the page's own fetch (and
|
|
65
|
+
* beacon) where left out. */
|
|
66
|
+
fetch?: typeof fetch
|
|
67
|
+
/** The Operator's chat for this app (`/manage/<space>?app=<slug>`). */
|
|
68
|
+
ask: string
|
|
69
|
+
/** Where a save's time is sent, as a press's is (page-report.ts
|
|
70
|
+
* `interactions`); none sends nothing. */
|
|
71
|
+
report?: string
|
|
72
|
+
/** Edit mode is over: the person pressed Done. */
|
|
73
|
+
done: () => void
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** The place a snippet's draft is typed at, or a list's. */
|
|
77
|
+
export let placeOf = (key: string, list = false, lang = '') =>
|
|
78
|
+
`${list ? 'copy-list' : 'copy'}${lang ? '@' + lang : ''}:${key}`
|
|
79
|
+
|
|
80
|
+
// The key and kind a place is the draft of; none for another draft.
|
|
81
|
+
let parsePlace = (place: string, lang = '') => {
|
|
82
|
+
for (let list of [false, true]) {
|
|
83
|
+
let at = placeOf('', list, lang)
|
|
84
|
+
if (place.startsWith(at)) return { key: place.slice(at.length), list }
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** A list's draft, read back: its items' snippets, or none where the text is
|
|
89
|
+
* not a list. */
|
|
90
|
+
export let listOf = (text: string): string[] | null => {
|
|
91
|
+
try {
|
|
92
|
+
let value = JSON.parse(text)
|
|
93
|
+
return Array.isArray(value) && value.every((s) => typeof s == 'string')
|
|
94
|
+
? value
|
|
95
|
+
: null
|
|
96
|
+
} catch {
|
|
97
|
+
return null
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** What a person says the Operator, from a page with nothing marked. */
|
|
102
|
+
export let asking = (page: string) =>
|
|
103
|
+
`Move the words on ${page} into copy.json, marking each element with ` +
|
|
104
|
+
'data-copy, so I can change them on the page.'
|
|
105
|
+
|
|
106
|
+
/** How many changes a count is, as the panel says it. */
|
|
107
|
+
export let counted = (n: number) => n == 1 ? '1 change' : `${n} changes`
|
|
108
|
+
|
|
109
|
+
/** The word for a press where the person is: Tap on a touch screen, Click
|
|
110
|
+
* with a mouse. */
|
|
111
|
+
export let pressWord = (win: Pick<Window, 'matchMedia'>) =>
|
|
112
|
+
win.matchMedia?.('(pointer: coarse)').matches ? 'Tap' : 'Click'
|
|
113
|
+
|
|
114
|
+
/** What the panel says before any change. */
|
|
115
|
+
export let hint = (win: Pick<Window, 'matchMedia'>) =>
|
|
116
|
+
`${pressWord(win)} any outlined words to change them.`
|
|
117
|
+
|
|
118
|
+
/** What the panel says once Save is pressed, before it has answered. */
|
|
119
|
+
export let SAVED = 'Saved'
|
|
120
|
+
|
|
121
|
+
/** What the panel says once Save has answered. */
|
|
122
|
+
export let savedAs = (version: number) => `Saved as version ${version}`
|
|
123
|
+
|
|
124
|
+
/** The point a save's answer is counted as: from the press until it
|
|
125
|
+
* answered, `server` of it the request's own round trip and the rest its
|
|
126
|
+
* wait behind a save before it. */
|
|
127
|
+
export let savePoint = (ms: number, server: number) => ({
|
|
128
|
+
page: 'app',
|
|
129
|
+
target: 'saved',
|
|
130
|
+
ms,
|
|
131
|
+
...phases(ms, 0, server, 0),
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
let EDITING = 'data-yak-editing'
|
|
135
|
+
let CHANGED = 'data-yak-changed'
|
|
136
|
+
let HANDLE = 'data-yak-handle'
|
|
137
|
+
let MOVING = 'data-yak-moving'
|
|
138
|
+
let LIST = `[${names.list}]`
|
|
139
|
+
let ITEM = `${LIST} > *`
|
|
140
|
+
let CSS = `
|
|
141
|
+
[${EDITING}] [${names.text}], [${EDITING}] ${ITEM} {
|
|
142
|
+
outline: 1.5px dashed rgb(76 119 62 / 0.75) !important;
|
|
143
|
+
outline-offset: 2px !important;
|
|
144
|
+
cursor: text !important;
|
|
145
|
+
}
|
|
146
|
+
[${EDITING}] [${names.text}][${CHANGED}],
|
|
147
|
+
[${EDITING}] ${LIST}[${CHANGED}] > * {
|
|
148
|
+
outline-color: rgb(201 122 26 / 0.9) !important;
|
|
149
|
+
}
|
|
150
|
+
@media (hover: hover) and (pointer: fine) {
|
|
151
|
+
[${EDITING}] [${names.text}]:hover, [${EDITING}] ${ITEM}:hover {
|
|
152
|
+
outline-style: solid !important;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
[${EDITING}] [${names.text}][contenteditable=plaintext-only],
|
|
156
|
+
[${EDITING}] [${names.text}][contenteditable=true],
|
|
157
|
+
[${EDITING}] ${ITEM}[contenteditable=plaintext-only] {
|
|
158
|
+
outline-style: solid !important;
|
|
159
|
+
}
|
|
160
|
+
[${EDITING}] [${names.text}] [${names.slot}] {
|
|
161
|
+
cursor: default !important;
|
|
162
|
+
}
|
|
163
|
+
[${EDITING}] ${ITEM}[${MOVING}] {
|
|
164
|
+
outline-style: solid !important;
|
|
165
|
+
opacity: 0.7 !important;
|
|
166
|
+
}
|
|
167
|
+
[${HANDLE}] {
|
|
168
|
+
position: absolute !important;
|
|
169
|
+
z-index: 2147483646 !important;
|
|
170
|
+
box-sizing: border-box !important;
|
|
171
|
+
width: 22px !important;
|
|
172
|
+
height: 28px !important;
|
|
173
|
+
margin: 0 !important;
|
|
174
|
+
padding: 4px !important;
|
|
175
|
+
border: 1px solid rgb(76 119 62 / 0.5) !important;
|
|
176
|
+
border-radius: 6px !important;
|
|
177
|
+
background: #fffdf8 radial-gradient(circle, rgb(76 119 62) 1.5px,
|
|
178
|
+
transparent 1.75px) 0 0 / 6px 6px content-box !important;
|
|
179
|
+
box-shadow: 0 1px 3px rgb(82 56 40 / 0.22) !important;
|
|
180
|
+
cursor: grab !important;
|
|
181
|
+
touch-action: none !important;
|
|
182
|
+
user-select: none !important;
|
|
183
|
+
-webkit-user-select: none !important;
|
|
184
|
+
}
|
|
185
|
+
[${HANDLE}][hidden] { display: none !important }
|
|
186
|
+
[${HANDLE}][${MOVING}] { cursor: grabbing !important }
|
|
187
|
+
@media (pointer: coarse) {
|
|
188
|
+
[${HANDLE}] {
|
|
189
|
+
width: 30px !important;
|
|
190
|
+
height: 36px !important;
|
|
191
|
+
padding: 8px !important;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
`
|
|
195
|
+
// What a page's own code hears of a press or a keystroke while editing:
|
|
196
|
+
// nothing. The words still take the keyboard; only the app's handlers and
|
|
197
|
+
// the browser's going and pressing are stopped.
|
|
198
|
+
let PRESSES = [
|
|
199
|
+
'pointerdown',
|
|
200
|
+
'mousedown',
|
|
201
|
+
'touchstart',
|
|
202
|
+
'click',
|
|
203
|
+
'dblclick',
|
|
204
|
+
'auxclick',
|
|
205
|
+
'submit',
|
|
206
|
+
]
|
|
207
|
+
// The presses whose own act is going or pressing, which never happens.
|
|
208
|
+
let STOPS = ['click', 'dblclick', 'auxclick', 'submit']
|
|
209
|
+
let KEYS = ['keydown', 'keypress', 'keyup', 'beforeinput', 'input']
|
|
210
|
+
|
|
211
|
+
// An element's own words: the nodes it came with, or once Save has set its
|
|
212
|
+
// snippet, none, and it is drawn showing the value.
|
|
213
|
+
type Held = { was: Node[] | null; value: string }
|
|
214
|
+
|
|
215
|
+
/** The snippet an element shows, read from its nodes. */
|
|
216
|
+
export let valueOf = (el: Element) =>
|
|
217
|
+
join([...el.childNodes].map((node) => {
|
|
218
|
+
if (node.nodeType == 3) return node.textContent ?? ''
|
|
219
|
+
if (node.nodeType != 1) return ''
|
|
220
|
+
let child = node as Element
|
|
221
|
+
let slot = child.getAttribute(names.slot)
|
|
222
|
+
if (slot != null) return { slot }
|
|
223
|
+
return child.tagName == 'BR' ? '\n' : child.textContent ?? ''
|
|
224
|
+
}))
|
|
225
|
+
|
|
226
|
+
// A list item's snippet: its words, a line.
|
|
227
|
+
let itemValue = (item: Element) => valueOf(item).replace(/\s*\n\s*/g, ' ')
|
|
228
|
+
|
|
229
|
+
/** A list's items' snippets, as its draft holds them. */
|
|
230
|
+
export let listValue = (list: Element) =>
|
|
231
|
+
JSON.stringify([...list.children].map(itemValue))
|
|
232
|
+
|
|
233
|
+
// A list drawn showing `value`, the items it has kept and each new one drawn
|
|
234
|
+
// as `like`.
|
|
235
|
+
let drawList = (list: Element, value: string, like: Element) => {
|
|
236
|
+
let want = listOf(value) ?? []
|
|
237
|
+
let have = [...list.children]
|
|
238
|
+
want.forEach((text, i) => {
|
|
239
|
+
let item = have[i] ?? list.appendChild(like.cloneNode(false) as Element)
|
|
240
|
+
if (valueOf(item) != text) draw(item, text)
|
|
241
|
+
})
|
|
242
|
+
for (let item of have.slice(want.length)) item.remove()
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** An element drawn showing `value`, its slots' own children kept. */
|
|
246
|
+
export let draw = (el: Element, value: string) => {
|
|
247
|
+
let slotted: Record<string, Element> = {}
|
|
248
|
+
for (let child of el.children) {
|
|
249
|
+
let slot = child.getAttribute(names.slot)
|
|
250
|
+
if (slot != null) slotted[slot] = child
|
|
251
|
+
}
|
|
252
|
+
let doc = el.ownerDocument
|
|
253
|
+
el.replaceChildren(
|
|
254
|
+
...fill(value, slotted).map((part) =>
|
|
255
|
+
typeof part == 'string' ? doc.createTextNode(part) : part
|
|
256
|
+
),
|
|
257
|
+
)
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/** Edit mode on `doc`, until `stop()`. */
|
|
261
|
+
export let editMode = (doc: Document, drafts: Desk, opts: Opts) => {
|
|
262
|
+
let win = doc.defaultView!
|
|
263
|
+
let page = doc.documentElement
|
|
264
|
+
let base = page.getAttribute('data-yak-copy-source')
|
|
265
|
+
let lang = base && page.lang != base ? page.lang : ''
|
|
266
|
+
let version = Number(page.getAttribute('data-yak-copy-version'))
|
|
267
|
+
let parsed = (p: string) => parsePlace(p, lang)
|
|
268
|
+
// What can be typed over: each element showing a snippet, and each list,
|
|
269
|
+
// whose items are its children. A snippet inside a list is the list's.
|
|
270
|
+
let lists = [...doc.querySelectorAll(LIST)].filter((el) =>
|
|
271
|
+
el.firstElementChild && !el.parentElement?.closest(LIST)
|
|
272
|
+
)
|
|
273
|
+
let like = new Map(
|
|
274
|
+
lists.map((el) => [el, el.firstElementChild!.cloneNode(false) as Element]),
|
|
275
|
+
)
|
|
276
|
+
let marked = [
|
|
277
|
+
...[...doc.querySelectorAll(`[${names.text}]`)].filter((el) =>
|
|
278
|
+
!el.closest(LIST)
|
|
279
|
+
),
|
|
280
|
+
...lists,
|
|
281
|
+
]
|
|
282
|
+
let isList = (el: Element) => like.has(el)
|
|
283
|
+
let valueAt = (el: Element) => isList(el) ? listValue(el) : valueOf(el)
|
|
284
|
+
let drawAt = (el: Element, value: string) =>
|
|
285
|
+
isList(el) ? drawList(el, value, like.get(el)!) : draw(el, value)
|
|
286
|
+
let placeAt = (el: Element) =>
|
|
287
|
+
isList(el)
|
|
288
|
+
? placeOf(el.getAttribute(names.list)!, true, lang)
|
|
289
|
+
: placeOf(el.getAttribute(names.text)!, false, lang)
|
|
290
|
+
// The element typed in, or the list whose item it is.
|
|
291
|
+
let unitOf = (el: Element) =>
|
|
292
|
+
el.parentElement && isList(el.parentElement) ? el.parentElement : el
|
|
293
|
+
let held = new Map<Element, Held>()
|
|
294
|
+
for (let el of marked) {
|
|
295
|
+
held.set(el, {
|
|
296
|
+
// A list's items are typed in and moved where they stand, so its own
|
|
297
|
+
// are kept apart.
|
|
298
|
+
was: [...el.childNodes].map((n) => isList(el) ? n.cloneNode(true) : n),
|
|
299
|
+
value: '',
|
|
300
|
+
})
|
|
301
|
+
}
|
|
302
|
+
for (let [el, h] of held) h.value = valueAt(el)
|
|
303
|
+
// Everything below goes by place: a snippet's `copy:<key>`, a list's
|
|
304
|
+
// `copy-list:<key>`.
|
|
305
|
+
let confirmed = (place: string) =>
|
|
306
|
+
held.get(marked.find((el) => placeAt(el) == place)!)?.value ?? ''
|
|
307
|
+
// A place can have several submitted values, in request order.
|
|
308
|
+
let pending = new Map<string, string[]>()
|
|
309
|
+
let own = (place: string) => pending.get(place)?.at(-1) ?? confirmed(place)
|
|
310
|
+
let becomes = (place: string, value: string) => {
|
|
311
|
+
for (let [el, h] of held) {
|
|
312
|
+
if (placeAt(el) == place) Object.assign(h, { was: null, value })
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
// A person's draft at a place; a list's that is no list is none.
|
|
316
|
+
let draftAt = (place: string) => {
|
|
317
|
+
let text = drafts.text(place)
|
|
318
|
+
return text && parsed(place)?.list && !listOf(text) ? '' : text
|
|
319
|
+
}
|
|
320
|
+
let shows = (place: string) => draftAt(place) || own(place)
|
|
321
|
+
// A draft is a change while it differs from the page's own words.
|
|
322
|
+
let changed = (place: string) => {
|
|
323
|
+
let text = draftAt(place)
|
|
324
|
+
return !!text && text != own(place)
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
let sheet = style(doc)
|
|
328
|
+
doc.documentElement.setAttribute(EDITING, '')
|
|
329
|
+
let active: Element | null = null
|
|
330
|
+
let picked: Element | null = null
|
|
331
|
+
let locked: Element[] = []
|
|
332
|
+
let ready = false
|
|
333
|
+
let closed = false
|
|
334
|
+
|
|
335
|
+
// An item's handle: beside the item pressed into or pointed at, and
|
|
336
|
+
// dragged to move it among its list's items.
|
|
337
|
+
let handle = doc.createElement('div')
|
|
338
|
+
handle.setAttribute(HANDLE, '')
|
|
339
|
+
handle.setAttribute('role', 'button')
|
|
340
|
+
handle.setAttribute('aria-label', 'Drag to move this item')
|
|
341
|
+
handle.hidden = true
|
|
342
|
+
doc.documentElement.append(handle)
|
|
343
|
+
let handled: Element | null = null
|
|
344
|
+
let grip = (item: Element | null) => {
|
|
345
|
+
handled = item
|
|
346
|
+
handle.hidden = !item
|
|
347
|
+
let box = item?.getBoundingClientRect?.()
|
|
348
|
+
if (!item || !box) return
|
|
349
|
+
let size = handle.offsetWidth || 24
|
|
350
|
+
let x = Math.max(2, box.left - size - 6) + win.scrollX
|
|
351
|
+
let y = box.top + box.height / 2 - (handle.offsetHeight || 28) / 2 +
|
|
352
|
+
win.scrollY
|
|
353
|
+
handle.style.left = `${x}px`
|
|
354
|
+
handle.style.top = `${y}px`
|
|
355
|
+
}
|
|
356
|
+
let itemAt = (target: EventTarget | null) => {
|
|
357
|
+
let el = target instanceof win.Element ? target : null
|
|
358
|
+
for (; el; el = el.parentElement) {
|
|
359
|
+
if (el.parentElement && isList(el.parentElement)) return el
|
|
360
|
+
}
|
|
361
|
+
return null
|
|
362
|
+
}
|
|
363
|
+
// A list's draft, typed from what it shows now; back to its own items, it
|
|
364
|
+
// is no change.
|
|
365
|
+
let typeList = (list: Element) => {
|
|
366
|
+
let place = placeAt(list), value = listValue(list)
|
|
367
|
+
if (value != own(place) || pending.has(place)) drafts.type(place, value)
|
|
368
|
+
else if (drafts.text(place)) drafts.spend(place)
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// The caret at the start or end of `el`, where the browser has one.
|
|
372
|
+
let caret = (el: Element, end: boolean) => {
|
|
373
|
+
let sel = win.getSelection?.()
|
|
374
|
+
if (!sel || !doc.createRange) return
|
|
375
|
+
let range = doc.createRange()
|
|
376
|
+
range.selectNodeContents(el)
|
|
377
|
+
range.collapse(!end)
|
|
378
|
+
sel.removeAllRanges()
|
|
379
|
+
sel.addRange(range)
|
|
380
|
+
}
|
|
381
|
+
// Where the caret stands in an item's words, and where the selection ends:
|
|
382
|
+
// at its end where the browser says nothing.
|
|
383
|
+
let split = (item: Element) => {
|
|
384
|
+
let text = item.textContent ?? ''
|
|
385
|
+
let sel = win.getSelection?.()
|
|
386
|
+
if (!sel?.rangeCount || !doc.createRange) return [text, '']
|
|
387
|
+
let range = sel.getRangeAt(0)
|
|
388
|
+
if (!item.contains(range.startContainer)) return [text, '']
|
|
389
|
+
let upTo = (node: Node, offset: number) => {
|
|
390
|
+
let r = doc.createRange()
|
|
391
|
+
r.selectNodeContents(item)
|
|
392
|
+
r.setEnd(node, offset)
|
|
393
|
+
return r.toString().length
|
|
394
|
+
}
|
|
395
|
+
return [
|
|
396
|
+
text.slice(0, upTo(range.startContainer, range.startOffset)),
|
|
397
|
+
text.slice(upTo(range.endContainer, range.endOffset)),
|
|
398
|
+
]
|
|
399
|
+
}
|
|
400
|
+
// A new item after `item`, holding what followed the caret.
|
|
401
|
+
let addAfter = (item: Element) => {
|
|
402
|
+
let list = item.parentElement!
|
|
403
|
+
let [before, after] = split(item)
|
|
404
|
+
let next = like.get(list)!.cloneNode(false) as Element
|
|
405
|
+
item.textContent = before
|
|
406
|
+
next.textContent = after
|
|
407
|
+
item.after(next)
|
|
408
|
+
typeList(list)
|
|
409
|
+
edit(next)
|
|
410
|
+
caret(next, false)
|
|
411
|
+
}
|
|
412
|
+
// `item` gone, the caret at the end of the one before it.
|
|
413
|
+
let removeItem = (item: Element) => {
|
|
414
|
+
let list = item.parentElement!
|
|
415
|
+
if (list.children.length < 2) return false
|
|
416
|
+
let to = item.previousElementSibling ?? item.nextElementSibling!
|
|
417
|
+
if (active == item) {
|
|
418
|
+
active = null
|
|
419
|
+
item.removeAttribute('contenteditable')
|
|
420
|
+
}
|
|
421
|
+
item.remove()
|
|
422
|
+
typeList(list)
|
|
423
|
+
edit(to)
|
|
424
|
+
caret(to, true)
|
|
425
|
+
return true
|
|
426
|
+
}
|
|
427
|
+
let move = (item: Element, by: -1 | 1) => {
|
|
428
|
+
let to = by < 0 ? item.previousElementSibling : item.nextElementSibling
|
|
429
|
+
if (!to) return
|
|
430
|
+
if (by < 0) to.before(item)
|
|
431
|
+
else to.after(item)
|
|
432
|
+
typeList(item.parentElement!)
|
|
433
|
+
;(item as HTMLElement).focus?.()
|
|
434
|
+
caret(item, true)
|
|
435
|
+
grip(item)
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
let finish = () => {
|
|
439
|
+
let el = active
|
|
440
|
+
if (!el) return
|
|
441
|
+
active = null
|
|
442
|
+
el.removeAttribute('contenteditable')
|
|
443
|
+
for (let child of locked) child.removeAttribute('contenteditable')
|
|
444
|
+
locked = []
|
|
445
|
+
let unit = unitOf(el)
|
|
446
|
+
// An item left empty is no item.
|
|
447
|
+
if (unit != el && !itemValue(el) && unit.children.length > 1) {
|
|
448
|
+
if (handled == el) grip(null)
|
|
449
|
+
el.remove()
|
|
450
|
+
typeList(unit)
|
|
451
|
+
}
|
|
452
|
+
let place = placeAt(unit)
|
|
453
|
+
// Typed back to the page's own words, it is no change, unless a save on
|
|
454
|
+
// its way made them those words.
|
|
455
|
+
if (
|
|
456
|
+
drafts.text(place) && valueAt(unit) == own(place) && !pending.has(place)
|
|
457
|
+
) {
|
|
458
|
+
drafts.spend(place)
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
let edit = (el: Element) => {
|
|
462
|
+
if (el == active || !ready) return
|
|
463
|
+
finish()
|
|
464
|
+
active = picked = el
|
|
465
|
+
showSource(unitOf(el))
|
|
466
|
+
for (let child of el.children) {
|
|
467
|
+
if (child.hasAttribute(names.slot)) {
|
|
468
|
+
child.setAttribute('contenteditable', 'false')
|
|
469
|
+
locked.push(child)
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
el.setAttribute('contenteditable', 'plaintext-only')
|
|
473
|
+
;(el as HTMLElement).focus?.()
|
|
474
|
+
if (unitOf(el) != el) grip(el)
|
|
475
|
+
}
|
|
476
|
+
let ours = (e: Event) =>
|
|
477
|
+
!(e.target instanceof win.Node) ||
|
|
478
|
+
!doc.body?.contains(e.target as Node) &&
|
|
479
|
+
!doc.head?.contains(e.target as Node)
|
|
480
|
+
// The element a press lands in: an item, or the nearest snippet.
|
|
481
|
+
let pressedIn = (target: Element) =>
|
|
482
|
+
itemAt(target) ??
|
|
483
|
+
(target.closest?.(`[${names.text}]`) as Element | null)
|
|
484
|
+
let pressed = (e: Event) => {
|
|
485
|
+
if (ours(e)) return
|
|
486
|
+
e.stopImmediatePropagation()
|
|
487
|
+
let el = pressedIn(e.target as Element)
|
|
488
|
+
let ok = !!el && held.has(unitOf(el))
|
|
489
|
+
// The caret goes where the press landed, and a touch still scrolls:
|
|
490
|
+
// only going and pressing stop.
|
|
491
|
+
if (!STOPS.includes(e.type)) {
|
|
492
|
+
if (e.type == 'touchstart') return
|
|
493
|
+
if (ok) edit(el!)
|
|
494
|
+
else finish()
|
|
495
|
+
return
|
|
496
|
+
}
|
|
497
|
+
if (ok) edit(el!)
|
|
498
|
+
e.preventDefault()
|
|
499
|
+
}
|
|
500
|
+
let typed = (e: Event) => {
|
|
501
|
+
if (ours(e) || !active) return
|
|
502
|
+
if (!active.contains(e.target as Node)) return
|
|
503
|
+
e.stopImmediatePropagation()
|
|
504
|
+
let key = e as KeyboardEvent
|
|
505
|
+
if (e.type == 'keydown' && editKey(key) == 'cancel') return finish()
|
|
506
|
+
let unit = unitOf(active)
|
|
507
|
+
if (unit != active) {
|
|
508
|
+
let item = active
|
|
509
|
+
let kind = (e as InputEvent).inputType
|
|
510
|
+
let down = e.type == 'keydown' && !key.isComposing
|
|
511
|
+
// Enter adds an item, on a keyboard that says so or one that only
|
|
512
|
+
// says what it would insert.
|
|
513
|
+
if (
|
|
514
|
+
down && key.key == 'Enter' && !key.shiftKey ||
|
|
515
|
+
e.type == 'beforeinput' &&
|
|
516
|
+
(kind == 'insertParagraph' || kind == 'insertLineBreak')
|
|
517
|
+
) {
|
|
518
|
+
e.preventDefault()
|
|
519
|
+
return addAfter(item)
|
|
520
|
+
}
|
|
521
|
+
if (
|
|
522
|
+
(down && key.key == 'Backspace' ||
|
|
523
|
+
e.type == 'beforeinput' && kind == 'deleteContentBackward') &&
|
|
524
|
+
!item.textContent
|
|
525
|
+
) {
|
|
526
|
+
if (removeItem(item)) e.preventDefault()
|
|
527
|
+
return
|
|
528
|
+
}
|
|
529
|
+
if (down && key.altKey && /^Arrow(Up|Down)$/.test(key.key)) {
|
|
530
|
+
e.preventDefault()
|
|
531
|
+
return move(item, key.key == 'ArrowUp' ? -1 : 1)
|
|
532
|
+
}
|
|
533
|
+
if (e.type == 'input') {
|
|
534
|
+
typeList(unit)
|
|
535
|
+
grip(item)
|
|
536
|
+
}
|
|
537
|
+
return
|
|
538
|
+
}
|
|
539
|
+
// A snippet is a line unless it already holds more than one.
|
|
540
|
+
let multi = own(placeAt(active)).includes('\n')
|
|
541
|
+
if (e.type == 'keydown' && editKey(key, multi) == 'keep') {
|
|
542
|
+
e.preventDefault()
|
|
543
|
+
return finish()
|
|
544
|
+
}
|
|
545
|
+
if (e.type == 'input') {
|
|
546
|
+
drafts.type(placeAt(active), valueOf(active))
|
|
547
|
+
showSource(active)
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
let left = (e: Event) => {
|
|
551
|
+
if (active && e.target == active) finish()
|
|
552
|
+
}
|
|
553
|
+
// Pointed at with a mouse, an item shows its handle.
|
|
554
|
+
let over = (e: Event) => {
|
|
555
|
+
if (ours(e) || moving) return
|
|
556
|
+
let item = itemAt(e.target)
|
|
557
|
+
if (item && item != handled) grip(item)
|
|
558
|
+
}
|
|
559
|
+
// An item dragged by its handle goes where it is dragged to: before or
|
|
560
|
+
// after the item whose middle is nearest, as it came from above or below.
|
|
561
|
+
let moving: Element | null = null
|
|
562
|
+
let lift = (e: Event) => {
|
|
563
|
+
let item = handled
|
|
564
|
+
if (!item || !ready) return
|
|
565
|
+
e.preventDefault()
|
|
566
|
+
if (active && active != item) finish()
|
|
567
|
+
moving = item
|
|
568
|
+
item.setAttribute(MOVING, '')
|
|
569
|
+
handle.setAttribute(MOVING, '')
|
|
570
|
+
let id = (e as PointerEvent).pointerId
|
|
571
|
+
if (id != null) handle.setPointerCapture?.(id)
|
|
572
|
+
}
|
|
573
|
+
let drag = (e: Event) => {
|
|
574
|
+
let item = moving
|
|
575
|
+
if (!item) return
|
|
576
|
+
e.preventDefault()
|
|
577
|
+
let { clientX: x, clientY: y } = e as PointerEvent
|
|
578
|
+
let near = (el: Element) => {
|
|
579
|
+
let b = el.getBoundingClientRect()
|
|
580
|
+
return Math.hypot(b.left + b.width / 2 - x, b.top + b.height / 2 - y)
|
|
581
|
+
}
|
|
582
|
+
let others = [...item.parentElement!.children]
|
|
583
|
+
let to = others.reduce((a, b) => near(b) < near(a) ? b : a)
|
|
584
|
+
if (to == item) return
|
|
585
|
+
let after = others.indexOf(to) > others.indexOf(item)
|
|
586
|
+
if (after) to.after(item)
|
|
587
|
+
else to.before(item)
|
|
588
|
+
grip(item)
|
|
589
|
+
}
|
|
590
|
+
let drop = () => {
|
|
591
|
+
let item = moving
|
|
592
|
+
if (!item) return
|
|
593
|
+
moving = null
|
|
594
|
+
item.removeAttribute(MOVING)
|
|
595
|
+
handle.removeAttribute(MOVING)
|
|
596
|
+
if (item.parentElement) typeList(item.parentElement)
|
|
597
|
+
grip(item)
|
|
598
|
+
}
|
|
599
|
+
for (let type of PRESSES) win.addEventListener(type, pressed, true)
|
|
600
|
+
for (let type of KEYS) win.addEventListener(type, typed, true)
|
|
601
|
+
doc.addEventListener('focusout', left, true)
|
|
602
|
+
win.addEventListener('pointerover', over, true)
|
|
603
|
+
handle.addEventListener('pointerdown', lift)
|
|
604
|
+
handle.addEventListener('pointermove', drag)
|
|
605
|
+
handle.addEventListener('pointerup', drop)
|
|
606
|
+
handle.addEventListener('pointercancel', drop)
|
|
607
|
+
handle.addEventListener('lostpointercapture', drop)
|
|
608
|
+
let regrip = () => handled && grip(handled.isConnected ? handled : null)
|
|
609
|
+
win.addEventListener('resize', regrip)
|
|
610
|
+
|
|
611
|
+
let panel = opts.panel
|
|
612
|
+
let message = doc.createElement('textarea')
|
|
613
|
+
message.rows = 2
|
|
614
|
+
message.placeholder = 'What changed and why?'
|
|
615
|
+
message.setAttribute('aria-label', 'Release message')
|
|
616
|
+
message.dataset.releaseMessage = ''
|
|
617
|
+
let button = (says: string, press: () => void) => {
|
|
618
|
+
let b = doc.createElement('button')
|
|
619
|
+
b.type = 'button'
|
|
620
|
+
b.textContent = says
|
|
621
|
+
b.addEventListener('click', press)
|
|
622
|
+
return b
|
|
623
|
+
}
|
|
624
|
+
let done = button('Done', () => opts.done())
|
|
625
|
+
let mine = () => drafts.places().filter(parsed)
|
|
626
|
+
let discard = button('Discard', () => {
|
|
627
|
+
for (let place of mine()) {
|
|
628
|
+
if (!pending.has(place)) drafts.spend(place)
|
|
629
|
+
}
|
|
630
|
+
})
|
|
631
|
+
discard.dataset.discard = ''
|
|
632
|
+
let count = doc.createElement('span')
|
|
633
|
+
count.setAttribute('aria-live', 'polite')
|
|
634
|
+
let said = doc.createElement('span')
|
|
635
|
+
said.setAttribute('aria-live', 'polite')
|
|
636
|
+
let send = opts.fetch ?? win.fetch.bind(win)
|
|
637
|
+
let door = (path: string) =>
|
|
638
|
+
new URL(`api/${path}`, new URL(opts.at, win.location.href))
|
|
639
|
+
let post = async (path: string, body: unknown) => {
|
|
640
|
+
let to = door(path)
|
|
641
|
+
let sent = JSON.stringify(body)
|
|
642
|
+
let res = await send(to, {
|
|
643
|
+
method: 'POST',
|
|
644
|
+
credentials: 'same-origin',
|
|
645
|
+
headers: { 'content-type': 'application/json' },
|
|
646
|
+
body: sent,
|
|
647
|
+
// A save already shown goes on if the page is closed under it; the
|
|
648
|
+
// browser carries no more than 64 KB that way.
|
|
649
|
+
keepalive: sent.length < 60_000,
|
|
650
|
+
})
|
|
651
|
+
let out = await res.json().catch(() => null)
|
|
652
|
+
if (!res.ok) {
|
|
653
|
+
throw new Error(out?.error?.message ?? `it answered ${res.status}`)
|
|
654
|
+
}
|
|
655
|
+
return out
|
|
656
|
+
}
|
|
657
|
+
let languages = doc.createElement('details')
|
|
658
|
+
let addLabel = doc.createElement('summary')
|
|
659
|
+
addLabel.textContent = 'Add a language'
|
|
660
|
+
let newLanguage = doc.createElement('input')
|
|
661
|
+
newLanguage.setAttribute('aria-label', 'Language tag')
|
|
662
|
+
newLanguage.placeholder = 'Language tag (e.g. sv)'
|
|
663
|
+
newLanguage.maxLength = 90
|
|
664
|
+
let releasedLanguage = doc.createElement('a')
|
|
665
|
+
releasedLanguage.hidden = true
|
|
666
|
+
let addLanguage = button('Translate and publish', async () => {
|
|
667
|
+
if (!newLanguage.value.trim()) return
|
|
668
|
+
addLanguage.disabled = true
|
|
669
|
+
said.textContent = 'Translating…'
|
|
670
|
+
try {
|
|
671
|
+
let out = await post('copy/language', {
|
|
672
|
+
locale: newLanguage.value.trim(),
|
|
673
|
+
source: base || page.lang || 'en',
|
|
674
|
+
})
|
|
675
|
+
version = out.version
|
|
676
|
+
let to = new URL(win.location.href)
|
|
677
|
+
to.searchParams.set('lang', out.lang)
|
|
678
|
+
releasedLanguage.href = to.href
|
|
679
|
+
releasedLanguage.textContent = `Open ${out.lang} translation`
|
|
680
|
+
releasedLanguage.hidden = false
|
|
681
|
+
said.textContent = 'Language published.'
|
|
682
|
+
newLanguage.value = ''
|
|
683
|
+
} catch (e) {
|
|
684
|
+
said.textContent = (e as Error).message
|
|
685
|
+
} finally {
|
|
686
|
+
addLanguage.disabled = false
|
|
687
|
+
}
|
|
688
|
+
})
|
|
689
|
+
languages.append(addLabel, newLanguage, addLanguage, releasedLanguage)
|
|
690
|
+
let review = doc.createElement('section')
|
|
691
|
+
review.hidden = true
|
|
692
|
+
let sourceText = doc.createElement('div')
|
|
693
|
+
sourceText.setAttribute('aria-live', 'polite')
|
|
694
|
+
let length = doc.createElement('div')
|
|
695
|
+
length.setAttribute('role', 'status')
|
|
696
|
+
let noteField = doc.createElement('textarea')
|
|
697
|
+
noteField.setAttribute('aria-label', 'Translation note')
|
|
698
|
+
noteField.placeholder = 'Translation note'
|
|
699
|
+
noteField.maxLength = 1000
|
|
700
|
+
let selected: Element | undefined
|
|
701
|
+
let source = lang
|
|
702
|
+
? send(door(`copy?lang=${encodeURIComponent(base!)}`)).then(async (res) => {
|
|
703
|
+
if (!res.ok || version != Number(res.headers.get('x-yak-copy-version'))) {
|
|
704
|
+
throw new Error('Reload to see the source text for this version.')
|
|
705
|
+
}
|
|
706
|
+
return parse(await res.text())
|
|
707
|
+
}).catch((e: Error) => e)
|
|
708
|
+
: Promise.resolve({})
|
|
709
|
+
let sourceValue = async (key: string) => {
|
|
710
|
+
let values = await source
|
|
711
|
+
if (values instanceof Error) throw values
|
|
712
|
+
return sourceAt(values, key)
|
|
713
|
+
}
|
|
714
|
+
let showSource = async (el: Element) => {
|
|
715
|
+
if (!lang) return
|
|
716
|
+
selected = el
|
|
717
|
+
let { key, list } = parsed(placeAt(el))!
|
|
718
|
+
review.hidden = false
|
|
719
|
+
try {
|
|
720
|
+
let value = await sourceValue(key)
|
|
721
|
+
if (selected != el) return
|
|
722
|
+
sourceText.textContent = value === undefined
|
|
723
|
+
? 'This snippet has no source text.'
|
|
724
|
+
: `Source (${base}): ${
|
|
725
|
+
Array.isArray(value) ? value.join(' • ') : value
|
|
726
|
+
}`
|
|
727
|
+
let copy = list ? listOf(valueAt(el)) : valueAt(el)
|
|
728
|
+
let wide = value !== undefined && copy !== null &&
|
|
729
|
+
longTranslations({ [key]: value }, { [key]: copy }).length > 0
|
|
730
|
+
let phone = win.innerWidth <= 480 && el.clientWidth > 0 &&
|
|
731
|
+
(el.scrollWidth > el.clientWidth || el.scrollHeight > el.clientHeight)
|
|
732
|
+
length.textContent = phone
|
|
733
|
+
? 'This translation overflows at this width.'
|
|
734
|
+
: wide
|
|
735
|
+
? 'Check this longer translation at phone width.'
|
|
736
|
+
: ''
|
|
737
|
+
} catch (e) {
|
|
738
|
+
if (selected == el) sourceText.textContent = (e as Error).message
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
let sendNote = button('Send translation note', async () => {
|
|
742
|
+
if (!selected || !noteField.value.trim()) return
|
|
743
|
+
let { key } = parsed(placeAt(selected))!
|
|
744
|
+
sendNote.disabled = true
|
|
745
|
+
let note = noteField.value
|
|
746
|
+
try {
|
|
747
|
+
// This app may have released the editor’s last correction in this tab.
|
|
748
|
+
let result = await post('copy/suggest', {
|
|
749
|
+
locale: lang,
|
|
750
|
+
key,
|
|
751
|
+
note,
|
|
752
|
+
version,
|
|
753
|
+
})
|
|
754
|
+
version = result.version
|
|
755
|
+
if (noteField.value == note) noteField.value = ''
|
|
756
|
+
said.textContent = 'Translation note sent.'
|
|
757
|
+
} catch (e) {
|
|
758
|
+
said.textContent = (e as Error).message
|
|
759
|
+
} finally {
|
|
760
|
+
sendNote.disabled = false
|
|
761
|
+
}
|
|
762
|
+
})
|
|
763
|
+
review.append(sourceText, length, noteField, sendNote)
|
|
764
|
+
// The last save, for Undo: its version, what it sent, and the words each
|
|
765
|
+
// place had before it.
|
|
766
|
+
let last: {
|
|
767
|
+
version: number
|
|
768
|
+
sent: Record<string, string>
|
|
769
|
+
before: Record<string, string>
|
|
770
|
+
} | null = null
|
|
771
|
+
let perf = win.performance
|
|
772
|
+
let timed = (ms: number, server: number) => {
|
|
773
|
+
if (!opts.report) return
|
|
774
|
+
let body = JSON.stringify({
|
|
775
|
+
id: win.crypto.randomUUID(),
|
|
776
|
+
at: Math.floor(perf.timeOrigin + perf.now()),
|
|
777
|
+
points: [savePoint(ms, server)],
|
|
778
|
+
})
|
|
779
|
+
if (!opts.fetch && win.navigator.sendBeacon?.(opts.report, body)) return
|
|
780
|
+
void send(opts.report, { method: 'POST', body, keepalive: true })
|
|
781
|
+
.catch(() => {/* a time can be lost with the page */})
|
|
782
|
+
}
|
|
783
|
+
// Saves and Undo go one after another, each after the one before answered.
|
|
784
|
+
let turn = Promise.resolve()
|
|
785
|
+
let saves = 0
|
|
786
|
+
let save = button('Save', () => {
|
|
787
|
+
let began = perf.now()
|
|
788
|
+
finish()
|
|
789
|
+
let sent: Record<string, string> = {}
|
|
790
|
+
for (let place of mine()) {
|
|
791
|
+
if (changed(place)) sent[place] = draftAt(place)
|
|
792
|
+
}
|
|
793
|
+
let places = Object.keys(sent)
|
|
794
|
+
if (!places.length) return
|
|
795
|
+
let note = message.value
|
|
796
|
+
if (!note.trim()) {
|
|
797
|
+
said.textContent = 'Write what changed and why for the next agent.'
|
|
798
|
+
message.focus()
|
|
799
|
+
return
|
|
800
|
+
}
|
|
801
|
+
for (let place of places) {
|
|
802
|
+
let values = pending.get(place)
|
|
803
|
+
if (!values) pending.set(place, values = [])
|
|
804
|
+
values.push(sent[place])
|
|
805
|
+
}
|
|
806
|
+
// What the app's door is sent: each key's text, or a list's items.
|
|
807
|
+
let copy = Object.fromEntries(places.map((place) => {
|
|
808
|
+
let { key, list } = parsed(place)!
|
|
809
|
+
return [key, list ? listOf(sent[place]) : sent[place]]
|
|
810
|
+
}))
|
|
811
|
+
let n = ++saves
|
|
812
|
+
said.textContent = SAVED
|
|
813
|
+
undo.hidden = true
|
|
814
|
+
redraw()
|
|
815
|
+
turn = turn.then(async () => {
|
|
816
|
+
let before = Object.fromEntries(
|
|
817
|
+
places.map((place) => [place, confirmed(place)]),
|
|
818
|
+
)
|
|
819
|
+
let asked = perf.now()
|
|
820
|
+
try {
|
|
821
|
+
let seen = lang
|
|
822
|
+
? Object.fromEntries(
|
|
823
|
+
await Promise.all(
|
|
824
|
+
Object.keys(copy).map(
|
|
825
|
+
async (key) => [key, await sourceValue(key)] as const,
|
|
826
|
+
),
|
|
827
|
+
),
|
|
828
|
+
)
|
|
829
|
+
: undefined
|
|
830
|
+
let { version: released, keys: made } = await post('save', {
|
|
831
|
+
copy,
|
|
832
|
+
message: note,
|
|
833
|
+
...lang ? { locale: lang, source: seen } : {},
|
|
834
|
+
})
|
|
835
|
+
version = released
|
|
836
|
+
if (message.value == note) message.value = ''
|
|
837
|
+
for (let place of places) {
|
|
838
|
+
becomes(place, sent[place])
|
|
839
|
+
// Spend only the last submission for this place and only its text.
|
|
840
|
+
if (
|
|
841
|
+
pending.get(place)?.length == 1 &&
|
|
842
|
+
drafts.text(place) == sent[place]
|
|
843
|
+
) drafts.spend(place)
|
|
844
|
+
}
|
|
845
|
+
if (n != saves) return
|
|
846
|
+
let saved = places.filter((place) => made.includes(parsed(place)!.key))
|
|
847
|
+
last = saved.length
|
|
848
|
+
? {
|
|
849
|
+
version,
|
|
850
|
+
sent: Object.fromEntries(
|
|
851
|
+
saved.map((place) => [place, sent[place]]),
|
|
852
|
+
),
|
|
853
|
+
before,
|
|
854
|
+
}
|
|
855
|
+
: null
|
|
856
|
+
said.textContent = savedAs(version)
|
|
857
|
+
undo.hidden = !last
|
|
858
|
+
} catch (e) {
|
|
859
|
+
if (n == saves) last = null
|
|
860
|
+
said.textContent = `Not saved: ${(e as Error).message}. ` +
|
|
861
|
+
'Your changes are kept.'
|
|
862
|
+
if (closed && !panel.childNodes.length) panel.append(said)
|
|
863
|
+
} finally {
|
|
864
|
+
for (let place of places) {
|
|
865
|
+
let values = pending.get(place)!
|
|
866
|
+
values.shift()
|
|
867
|
+
if (!values.length) pending.delete(place)
|
|
868
|
+
}
|
|
869
|
+
if (closed) restorePage()
|
|
870
|
+
else redraw()
|
|
871
|
+
let now = perf.now()
|
|
872
|
+
timed(now - began, now - asked)
|
|
873
|
+
}
|
|
874
|
+
})
|
|
875
|
+
})
|
|
876
|
+
save.dataset.save = ''
|
|
877
|
+
let undo = button('Undo', () => {
|
|
878
|
+
let was = last
|
|
879
|
+
if (!was) return
|
|
880
|
+
last = null
|
|
881
|
+
undo.disabled = true
|
|
882
|
+
turn = turn.then(async () => {
|
|
883
|
+
try {
|
|
884
|
+
let back = await post('save/undo', { version: was.version })
|
|
885
|
+
version = back.version
|
|
886
|
+
for (let [place, text] of Object.entries(was.sent)) {
|
|
887
|
+
becomes(place, was.before[place])
|
|
888
|
+
if (!drafts.text(place)) drafts.type(place, text)
|
|
889
|
+
}
|
|
890
|
+
undo.hidden = true
|
|
891
|
+
said.textContent = `Version ${was.version} is taken back. ` +
|
|
892
|
+
'Your changes are drafts again.'
|
|
893
|
+
} catch (e) {
|
|
894
|
+
last = was
|
|
895
|
+
said.textContent = `Not taken back: ${(e as Error).message}`
|
|
896
|
+
if (closed && !panel.childNodes.length) panel.append(said)
|
|
897
|
+
} finally {
|
|
898
|
+
undo.disabled = false
|
|
899
|
+
if (closed) restorePage()
|
|
900
|
+
else redraw()
|
|
901
|
+
}
|
|
902
|
+
})
|
|
903
|
+
})
|
|
904
|
+
undo.dataset.undo = ''
|
|
905
|
+
undo.hidden = true
|
|
906
|
+
if (!marked.length) {
|
|
907
|
+
let says = doc.createElement('p')
|
|
908
|
+
says.textContent = 'Nothing on this page is editable yet.'
|
|
909
|
+
let link = doc.createElement('a')
|
|
910
|
+
let to = new URL(opts.ask)
|
|
911
|
+
to.searchParams.set('say', asking(win.location.href))
|
|
912
|
+
link.href = to.href
|
|
913
|
+
link.target = '_blank'
|
|
914
|
+
link.rel = 'noopener'
|
|
915
|
+
link.textContent = 'Ask the Operator to make it editable'
|
|
916
|
+
panel.replaceChildren(says, link, done)
|
|
917
|
+
} else {
|
|
918
|
+
count.textContent = 'Loading your changes…'
|
|
919
|
+
panel.replaceChildren(
|
|
920
|
+
count,
|
|
921
|
+
message,
|
|
922
|
+
save,
|
|
923
|
+
discard,
|
|
924
|
+
said,
|
|
925
|
+
undo,
|
|
926
|
+
done,
|
|
927
|
+
...base || page.lang ? [languages] : [],
|
|
928
|
+
...lang ? [review] : [],
|
|
929
|
+
)
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
// Every element shows its key's draft, or the page's words where it has
|
|
933
|
+
// none, drawn again as a draft changes here or on another device. The one
|
|
934
|
+
// being typed in is left alone while it already shows its draft.
|
|
935
|
+
let redraw = () => {
|
|
936
|
+
if (!ready || closed) return
|
|
937
|
+
let changes = mine().filter(changed).length
|
|
938
|
+
count.textContent = changes ? counted(changes) : hint(win)
|
|
939
|
+
message.hidden = save.hidden = discard.hidden = !changes
|
|
940
|
+
for (let el of marked) {
|
|
941
|
+
let place = placeAt(el), value = shows(place)
|
|
942
|
+
el.toggleAttribute(CHANGED, changed(place))
|
|
943
|
+
if (valueAt(el) != value) drawAt(el, value)
|
|
944
|
+
}
|
|
945
|
+
regrip()
|
|
946
|
+
}
|
|
947
|
+
let restorePage = () => {
|
|
948
|
+
if (doc.documentElement.hasAttribute(EDITING)) return
|
|
949
|
+
for (let [el, h] of held) {
|
|
950
|
+
el.removeAttribute(CHANGED)
|
|
951
|
+
let place = placeAt(el), value = own(place)
|
|
952
|
+
if (h.was && !pending.has(place)) el.replaceChildren(...h.was)
|
|
953
|
+
else if (valueAt(el) != value) drawAt(el, value)
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
let stop = () => {}
|
|
957
|
+
drafts.ready.then(() => {
|
|
958
|
+
if (closed) return
|
|
959
|
+
ready = true
|
|
960
|
+
stop = drafts.follow(redraw)
|
|
961
|
+
}, () => {
|
|
962
|
+
count.textContent = 'Your changes could not be read. Try again.'
|
|
963
|
+
})
|
|
964
|
+
|
|
965
|
+
return {
|
|
966
|
+
picked: () => picked?.isConnected ? picked : null,
|
|
967
|
+
stop: () => {
|
|
968
|
+
closed = true
|
|
969
|
+
finish()
|
|
970
|
+
stop()
|
|
971
|
+
for (let type of PRESSES) win.removeEventListener(type, pressed, true)
|
|
972
|
+
for (let type of KEYS) win.removeEventListener(type, typed, true)
|
|
973
|
+
doc.removeEventListener('focusout', left, true)
|
|
974
|
+
win.removeEventListener('pointerover', over, true)
|
|
975
|
+
win.removeEventListener('resize', regrip)
|
|
976
|
+
handle.remove()
|
|
977
|
+
doc.documentElement.removeAttribute(EDITING)
|
|
978
|
+
restorePage()
|
|
979
|
+
sheet()
|
|
980
|
+
panel.replaceChildren()
|
|
981
|
+
return turn
|
|
982
|
+
},
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
// The outlines, as a sheet of the page's own: a constructed one where the
|
|
987
|
+
// browser has them, which a page's style-src does not govern. Answers the
|
|
988
|
+
// function that takes it off again.
|
|
989
|
+
let style = (doc: Document) => {
|
|
990
|
+
let win = doc.defaultView as (Window & typeof globalThis) | null
|
|
991
|
+
if (win?.CSSStyleSheet && 'adoptedStyleSheets' in doc) {
|
|
992
|
+
let sheet = new win.CSSStyleSheet()
|
|
993
|
+
sheet.replaceSync(CSS)
|
|
994
|
+
doc.adoptedStyleSheets = [...doc.adoptedStyleSheets, sheet]
|
|
995
|
+
return () => {
|
|
996
|
+
doc.adoptedStyleSheets = doc.adoptedStyleSheets.filter((s) => s != sheet)
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
let el = doc.createElement('style')
|
|
1000
|
+
el.textContent = CSS
|
|
1001
|
+
doc.head.append(el)
|
|
1002
|
+
return () => el.remove()
|
|
1003
|
+
}
|