@celljs/ta-web 4.15.0 → 4.15.2
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/esm/browser/components/access-view.d.ts +6 -0
- package/esm/browser/components/access-view.js +4 -4
- package/esm/browser/components/account-menu.js +8 -1
- package/esm/browser/components/app-view.js +8 -1
- package/esm/browser/components/environment-view.js +9 -2
- package/esm/browser/components/face.js +7 -2
- package/esm/browser/components/gallery.d.ts +9 -0
- package/esm/browser/components/gallery.js +57 -0
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/lightbox.d.ts +8 -1
- package/esm/browser/components/lightbox.js +4 -1
- package/esm/browser/components/markdown.js +6 -1
- package/esm/browser/components/media.d.ts +12 -2
- package/esm/browser/components/media.js +55 -13
- package/esm/browser/components/message-list.js +3 -2
- package/esm/browser/components/notice-center.js +6 -2
- package/esm/browser/components/serve-restart.d.ts +26 -0
- package/esm/browser/components/serve-restart.js +91 -0
- package/esm/browser/components/session-view.js +19 -11
- package/esm/browser/components/settings-parts.js +18 -6
- package/esm/browser/extension/icons.js +3 -1
- package/esm/browser/extension/web-extension-protocol.d.ts +6 -0
- package/esm/browser/extension/web-extensions.d.ts +3 -0
- package/esm/browser/extension/web-extensions.js +7 -0
- package/esm/browser/gateway/console-extension.d.ts +20 -0
- package/esm/browser/gateway/console-extension.js +75 -0
- package/esm/browser/gateway/console-parts.d.ts +62 -0
- package/esm/browser/gateway/console-parts.js +271 -0
- package/esm/browser/gateway/console-tenant.d.ts +22 -0
- package/esm/browser/gateway/console-tenant.js +286 -0
- package/esm/browser/gateway/console-util.d.ts +59 -0
- package/esm/browser/gateway/console-util.js +187 -0
- package/esm/browser/gateway/console-view.d.ts +2 -0
- package/esm/browser/gateway/console-view.js +218 -0
- package/esm/browser/i18n/locales.d.ts +186 -3
- package/esm/browser/i18n/messages-ja.js +183 -0
- package/esm/browser/i18n/messages-zh-tw.js +183 -0
- package/esm/browser/i18n/messages.d.ts +183 -0
- package/esm/browser/i18n/messages.js +366 -0
- package/esm/browser/index.d.ts +3 -0
- package/esm/browser/index.js +3 -0
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +18 -0
- package/esm/browser/style/layout.d.ts +1 -1
- package/esm/browser/style/layout.js +2 -0
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +140 -0
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +2 -0
- package/esm/browser/style/surfaces.d.ts +1 -1
- package/esm/browser/style/surfaces.js +1 -0
- package/esm/browser/util/desktop.d.ts +6 -1
- package/esm/browser/util/desktop.js +10 -0
- package/esm/browser/util/gallery.d.ts +18 -0
- package/esm/browser/util/gallery.js +123 -0
- package/esm/browser/util/link.d.ts +8 -0
- package/esm/browser/util/link.js +14 -0
- package/esm/browser/util/markdown.d.ts +11 -0
- package/esm/browser/util/markdown.js +4 -0
- package/esm/browser/util/thumbnail.d.ts +18 -0
- package/esm/browser/util/thumbnail.js +26 -0
- package/esm/browser/workbench-protocol.d.ts +8 -0
- package/esm/browser/workbench.d.ts +16 -0
- package/esm/browser/workbench.js +67 -0
- package/lib/browser/components/access-view.d.ts +6 -0
- package/lib/browser/components/access-view.js +5 -4
- package/lib/browser/components/account-menu.js +7 -0
- package/lib/browser/components/app-view.js +8 -1
- package/lib/browser/components/environment-view.js +9 -2
- package/lib/browser/components/face.js +7 -2
- package/lib/browser/components/gallery.d.ts +10 -0
- package/lib/browser/components/gallery.js +93 -0
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/lightbox.d.ts +8 -1
- package/lib/browser/components/lightbox.js +4 -1
- package/lib/browser/components/markdown.js +6 -1
- package/lib/browser/components/media.d.ts +12 -2
- package/lib/browser/components/media.js +57 -13
- package/lib/browser/components/message-list.js +3 -2
- package/lib/browser/components/notice-center.js +6 -2
- package/lib/browser/components/serve-restart.d.ts +27 -0
- package/lib/browser/components/serve-restart.js +129 -0
- package/lib/browser/components/session-view.js +21 -13
- package/lib/browser/components/settings-parts.js +17 -5
- package/lib/browser/extension/icons.js +2 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +6 -0
- package/lib/browser/extension/web-extensions.d.ts +3 -0
- package/lib/browser/extension/web-extensions.js +7 -0
- package/lib/browser/gateway/console-extension.d.ts +21 -0
- package/lib/browser/gateway/console-extension.js +111 -0
- package/lib/browser/gateway/console-parts.d.ts +63 -0
- package/lib/browser/gateway/console-parts.js +315 -0
- package/lib/browser/gateway/console-tenant.d.ts +23 -0
- package/lib/browser/gateway/console-tenant.js +327 -0
- package/lib/browser/gateway/console-util.d.ts +60 -0
- package/lib/browser/gateway/console-util.js +190 -0
- package/lib/browser/gateway/console-view.d.ts +3 -0
- package/lib/browser/gateway/console-view.js +254 -0
- package/lib/browser/i18n/locales.d.ts +186 -3
- package/lib/browser/i18n/messages-ja.js +183 -0
- package/lib/browser/i18n/messages-zh-tw.js +183 -0
- package/lib/browser/i18n/messages.d.ts +183 -0
- package/lib/browser/i18n/messages.js +366 -0
- package/lib/browser/index.d.ts +3 -0
- package/lib/browser/index.js +3 -0
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +18 -0
- package/lib/browser/style/layout.d.ts +1 -1
- package/lib/browser/style/layout.js +2 -0
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +140 -0
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +2 -0
- package/lib/browser/style/surfaces.d.ts +1 -1
- package/lib/browser/style/surfaces.js +1 -0
- package/lib/browser/util/desktop.d.ts +6 -1
- package/lib/browser/util/desktop.js +10 -0
- package/lib/browser/util/gallery.d.ts +19 -0
- package/lib/browser/util/gallery.js +126 -0
- package/lib/browser/util/link.d.ts +8 -0
- package/lib/browser/util/link.js +14 -0
- package/lib/browser/util/markdown.d.ts +11 -0
- package/lib/browser/util/markdown.js +4 -0
- package/lib/browser/util/thumbnail.d.ts +19 -0
- package/lib/browser/util/thumbnail.js +29 -0
- package/lib/browser/workbench-protocol.d.ts +8 -0
- package/lib/browser/workbench.d.ts +16 -0
- package/lib/browser/workbench.js +67 -0
- package/package.json +7 -7
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* The launcher and the board (ta-launcher.md, components/board.tsx): their cards and rows, and the flyout
|
|
3
3
|
* the rail opens them in on a computer or a tablet. Where they rest on a phone is in style/phone.ts.
|
|
4
4
|
*/
|
|
5
|
-
export declare const SURFACES_STYLE = "\n.ta-kept-page { display: contents; }\n.ta-kept-page[hidden] { display: none; }\n.ta-launcher { display: flex; flex-direction: column; gap: 24px; }\n/* The launcher with its search: the stack fills it, its base scrolls. */\n.ta-launcher-surface { flex: 1; min-height: 0; display: flex; flex-direction: column; }\n.ta-launcher-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 18px; }\n.ta-launcher-field { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 36px; margin-bottom: 18px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--ta-raised); color: var(--ta-muted); font: inherit; font-size: calc(14px * var(--ta-font-scale)); cursor: text; -webkit-tap-highlight-color: transparent; transition: background 140ms; }\n.ta-launcher-field:active { background: var(--ta-hover); }\n.ta-launcher-search { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--ta-main); }\n.ta-launcher-search-head { flex: none; display: flex; align-items: center; gap: 4px; padding: 10px 12px 8px; }\n.ta-launcher-search-head input::-webkit-search-cancel-button { display: none; }\n.ta-launcher-clear { flex: none; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ta-muted); }\n.ta-launcher-cancel { flex: none; height: 36px; padding: 0 8px; border: 0; background: none; color: var(--ta-text); font: inherit; font-size: calc(15px * var(--ta-font-scale)); cursor: pointer; }\n.ta-launcher-search-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px 16px; }\n.ta-launcher-results { margin: 0; padding: 0; list-style: none; animation: ta-fade 120ms ease-out; }\n.ta-launcher-results-section + .ta-launcher-results-section { margin-top: 14px; }\n.ta-launcher-results-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; padding: 0 8px; color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); line-height: calc(16px * var(--ta-font-scale)); font-weight: 600; }\n.ta-launcher-results-all { border: 0; padding: 4px 0; background: none; color: var(--ta-link); font: inherit; font-weight: 500; cursor: pointer; }\n.ta-launcher-results-wait { padding: 10px 8px; color: var(--ta-muted); font-size: calc(13px * var(--ta-font-scale)); }\n.ta-launcher-more { height: 1px; }\n/* A long list draws the rows in view only; the rest keep their place. */\n.ta-launcher-result-row { position: relative; display: flex; align-items: center; content-visibility: auto; contain-intrinsic-size: auto 56px; }\n.ta-launcher-result-row > .ta-launcher-result { flex: 1; min-width: 0; }\n.ta-launcher-result-letter { font-size: calc(15px * var(--ta-font-scale)); font-weight: 600; }\n.ta-launcher-result-action { flex: none; position: absolute; right: 8px; height: 28px; padding: 0 12px; border: 0; border-radius: 14px; background: var(--ta-chip); color: var(--ta-text); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); font-weight: 600; cursor: pointer; transition: background 140ms, transform 120ms var(--ta-ease); }\n.ta-launcher-result-action:hover { background: var(--ta-hover-strong); }\n.ta-launcher-result-action:active { transform: scale(0.95); }\n.ta-launcher-result-row:has(.ta-launcher-result-action) .ta-launcher-result { padding-right: 84px; }\n/* The dialog that hands an extension on. */\n.ta-share { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px 6px 6px; }\n.ta-share-qr { width: 220px; height: 220px; padding: 12px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px var(--ta-border-muted); }\n.ta-share-qr svg { display: block; width: 100%; height: 100%; animation: ta-fade 160ms ease-out; }\n.ta-share-qr-busy { display: grid; place-items: center; background: var(--ta-raised); }\n.ta-share-qr-wait { color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); }\n.ta-share-hint { max-width: 320px; margin: 0; text-align: center; color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); line-height: calc(18px * var(--ta-font-scale)); text-wrap: balance; }\n.ta-share-actions { display: flex; gap: 8px; }\n.ta-share-stop { border: 0; padding: 2px 4px; background: none; color: var(--ta-red); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); cursor: pointer; }\n.ta-launcher-result { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 8px; border: 0; border-radius: 12px; background: none; color: var(--ta-text); font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }\n.ta-launcher-result:hover, .ta-launcher-result:active { background: var(--ta-hover); }\n.ta-launcher-result-icon { flex: none; position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--ta-tile); color: var(--ta-tile-ink); }\n.ta-launcher-result-icon > .ta-busy-mark { width: 16px; height: 16px; border-color: color-mix(in srgb, var(--ta-tile-ink) 25%, transparent); border-top-color: var(--ta-tile-ink); }\n.ta-launcher-result-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }\n.ta-launcher-result-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(15px * var(--ta-font-scale)); line-height: calc(20px * var(--ta-font-scale)); }\n.ta-launcher-result-title mark { background: none; color: var(--ta-accent); font-weight: 600; }\n.ta-launcher-result-detail { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); line-height: calc(16px * var(--ta-font-scale)); }\n.ta-board { flex: 1; min-height: 0; display: flex; flex-direction: column; }\n.ta-board-head { flex: none; display: flex; align-items: center; gap: 6px; min-height: 64px; padding: 6px 14px 6px 16px; }\n.ta-board-heading { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }\n.ta-board-title { font-size: calc(22px * var(--ta-font-scale)); line-height: calc(28px * var(--ta-font-scale)); font-weight: 700; letter-spacing: -0.01em; color: var(--ta-text); }\n.ta-board-date { color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); line-height: calc(17px * var(--ta-font-scale)); }\n.ta-board-edit-button { flex: none; height: 30px; padding: 0 14px; border: 0; border-radius: 15px; background: var(--ta-chip); color: var(--ta-text); font-size: calc(13px * var(--ta-font-scale)); font-weight: 500; transition: background 160ms, color 160ms, transform 120ms var(--ta-ease); }\n.ta-board-edit-button:hover { background: var(--ta-hover-strong); }\n.ta-board-edit-button:active { transform: scale(0.96); }\n.ta-board-edit-button.ta-active { background: var(--ta-brand); color: var(--ta-brand-text); }\n.ta-board-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; padding: 2px 14px calc(20px + env(safe-area-inset-bottom)); }\n.ta-board-cards { display: flex; flex-direction: column; gap: 12px; }\n.ta-board-card { padding: 12px 14px 14px; border-radius: 20px; background: var(--ta-main); box-shadow: 0 0 0 1px var(--ta-border-muted), 0 2px 6px rgba(15, 23, 42, 0.03), 0 8px 24px rgba(15, 23, 42, 0.04); animation: ta-board-in 260ms var(--ta-ease) both; }\n:root[data-theme='dark'] .ta-board-card { background: var(--ta-card); box-shadow: 0 0 0 1px var(--ta-border-muted); }\n@keyframes ta-board-in { from { opacity: 0; transform: translate3d(0, 6px, 0); } }\n.ta-board-card-head { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); line-height: calc(18px * var(--ta-font-scale)); font-weight: 600; }\n.ta-board-card-icon { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: color-mix(in srgb, var(--ta-accent) 14%, transparent); color: var(--ta-accent); }\n.ta-board-card-body { min-width: 0; color: var(--ta-body); font-size: calc(14px * var(--ta-font-scale)); }\n/* A card with nothing says so in one quiet line, where its content would start. */\n.ta-board-card-body .ta-empty { min-height: 0; align-items: flex-start; padding: 0 0 2px; text-align: left; }\n.ta-board-card-body .ta-empty-title { color: var(--ta-muted); font-weight: 400; }\n.ta-board-edit { display: flex; flex-direction: column; animation: ta-fade 160ms ease-out; }\n.ta-board-rows { display: flex; flex-direction: column; border-radius: 14px; background: var(--ta-main); box-shadow: 0 0 0 1px var(--ta-border-muted); }\n.ta-board-row { position: relative; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 4px 0 10px; border-radius: 14px; background: var(--ta-main); transition: transform 200ms var(--ta-ease), box-shadow 160ms; }\n.ta-board-row + .ta-board-row::before { content: ''; position: absolute; top: 0; left: 76px; right: 0; border-top: 1px solid var(--ta-border-muted); }\n.ta-board-row[data-sorting] { z-index: 2; transition: box-shadow 160ms; box-shadow: var(--ta-shadow-pop); }\n.ta-board-row[data-sorting]::before, .ta-board-row[data-sorting] + .ta-board-row::before { display: none; }\n.ta-board-toggle { flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; background: none; }\n.ta-board-off { color: var(--ta-red); }\n.ta-board-on { color: var(--ta-green); }\n.ta-board-row-icon { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--ta-chip); color: var(--ta-secondary); }\n.ta-board-row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-text); font-size: calc(15px * var(--ta-font-scale)); }\n.ta-board-grip { flex: none; display: grid; place-items: center; width: 44px; height: 48px; padding: 0; border: 0; background: none; color: var(--ta-muted); cursor: grab; touch-action: none; }\n.ta-board-row[data-sorting] .ta-board-grip { cursor: grabbing; }\n.ta-board-label { margin: 20px 6px 8px; color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); line-height: calc(16px * var(--ta-font-scale)); }\n\n/* The rail's buttons for them, above the account; the flyout beside it. */\n.ta-rail-tools { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 4px; }\n.ta-flyout { position: fixed; z-index: 50; left: calc(64px + env(safe-area-inset-left)); bottom: calc(10px + env(safe-area-inset-bottom)); width: 380px; max-width: calc(100vw - 80px); max-height: min(680px, calc(100vh - 20px - var(--ta-titlebar))); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--ta-border); border-radius: 16px; background: var(--ta-side); box-shadow: var(--ta-shadow-pop); transform-origin: 0 100%; animation: ta-flyout-in 180ms var(--ta-ease); }\n.ta-flyout > .ta-launcher-surface { height: min(560px, calc(100vh - 20px - var(--ta-titlebar))); flex: none; }\n@keyframes ta-flyout-in { from { opacity: 0; transform: translate3d(-6px, 6px, 0) scale(0.97); } }\n/* The faces of those who are not Ta (components/face.tsx): they blink, and look about while they work */\n:root:not([data-theme='light']) .ta-face[data-face=\"11\"] .ta-face-body > g > circle { fill: #4a4a52; }\n.ta-face { position: relative; display: inline-flex; flex: none; }\n.ta-face svg { display: block; overflow: visible; }\n.ta-face-eyes { transform-box: fill-box; transform-origin: center; animation: ta-face-blink 5.2s infinite; }\n.ta-face[data-face=\"1\"] .ta-face-eyes, .ta-face[data-face=\"5\"] .ta-face-eyes, .ta-face[data-face=\"9\"] .ta-face-eyes, .ta-face[data-face=\"13\"] .ta-face-eyes { animation-delay: -1.7s; }\n.ta-face[data-face=\"2\"] .ta-face-eyes, .ta-face[data-face=\"6\"] .ta-face-eyes, .ta-face[data-face=\"10\"] .ta-face-eyes, .ta-face[data-face=\"14\"] .ta-face-eyes { animation-delay: -3.1s; }\n.ta-face[data-face=\"3\"] .ta-face-eyes, .ta-face[data-face=\"7\"] .ta-face-eyes, .ta-face[data-face=\"11\"] .ta-face-eyes, .ta-face[data-face=\"15\"] .ta-face-eyes { animation-delay: -4.4s; }\n.ta-face-working .ta-face-look { animation: ta-face-look 2.4s ease-in-out infinite; }\n.ta-face-working .ta-face-body { transform-box: fill-box; transform-origin: 50% 100%; animation: ta-face-bob 1.2s ease-in-out infinite; }\n.ta-face-dot { position: absolute; right: -1px; bottom: -1px; width: 27%; height: 27%; min-width: 7px; min-height: 7px; box-sizing: content-box; border-radius: 50%; border: 2px solid var(--ta-face-ring, var(--ta-main)); background: var(--ta-border-field); }\n.ta-face-dot.ta-face-on { background: var(--ta-green); }\n@keyframes ta-face-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }\n@keyframes ta-face-look { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-1.4px); } 70% { transform: translateX(1.4px); } }\n@keyframes ta-face-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.2px); } }\n@media (prefers-reduced-motion: reduce) { .ta-face * { animation: none !important; } }\n.ta-group-face { position: relative; display: inline-flex; flex: none; }\n.ta-group-face-back { position: absolute; right: 0; top: 0; }\n.ta-group-face-front { position: absolute; left: 0; bottom: 0; z-index: 1; }\n";
|
|
5
|
+
export declare const SURFACES_STYLE = "\n.ta-kept-page { display: contents; }\n.ta-kept-page[hidden] { display: none; }\n.ta-launcher { display: flex; flex-direction: column; gap: 24px; }\n/* The launcher with its search: the stack fills it, its base scrolls. */\n.ta-launcher-surface { flex: 1; min-height: 0; display: flex; flex-direction: column; }\n.ta-launcher-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 18px; }\n.ta-launcher-field { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 36px; margin-bottom: 18px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--ta-raised); color: var(--ta-muted); font: inherit; font-size: calc(14px * var(--ta-font-scale)); cursor: text; -webkit-tap-highlight-color: transparent; transition: background 140ms; }\n.ta-launcher-field:active { background: var(--ta-hover); }\n.ta-launcher-search { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--ta-main); }\n.ta-launcher-search-head { flex: none; display: flex; align-items: center; gap: 4px; padding: 10px 12px 8px; }\n.ta-launcher-search-head input::-webkit-search-cancel-button { display: none; }\n.ta-launcher-clear { flex: none; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ta-muted); }\n.ta-launcher-cancel { flex: none; height: 36px; padding: 0 8px; border: 0; background: none; color: var(--ta-text); font: inherit; font-size: calc(15px * var(--ta-font-scale)); cursor: pointer; }\n.ta-launcher-search-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px 16px; }\n.ta-launcher-results { margin: 0; padding: 0; list-style: none; animation: ta-fade 120ms ease-out; }\n.ta-launcher-results-section + .ta-launcher-results-section { margin-top: 14px; }\n.ta-launcher-results-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; padding: 0 8px; color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); line-height: calc(16px * var(--ta-font-scale)); font-weight: 600; }\n.ta-launcher-results-all { border: 0; padding: 4px 0; background: none; color: var(--ta-link); font: inherit; font-weight: 500; cursor: pointer; }\n.ta-launcher-results-wait { padding: 10px 8px; color: var(--ta-muted); font-size: calc(13px * var(--ta-font-scale)); }\n.ta-launcher-more { height: 1px; }\n/* A long list draws the rows in view only; the rest keep their place. */\n.ta-launcher-result-row { position: relative; display: flex; align-items: center; content-visibility: auto; contain-intrinsic-size: auto 56px; }\n.ta-launcher-result-row > .ta-launcher-result { flex: 1; min-width: 0; }\n.ta-launcher-result-letter { font-size: calc(15px * var(--ta-font-scale)); font-weight: 600; }\n.ta-launcher-result-action { flex: none; position: absolute; right: 8px; height: 28px; padding: 0 12px; border: 0; border-radius: 14px; background: var(--ta-chip); color: var(--ta-text); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); font-weight: 600; cursor: pointer; transition: background 140ms, transform 120ms var(--ta-ease); }\n.ta-launcher-result-action:hover { background: var(--ta-hover-strong); }\n.ta-launcher-result-action:active { transform: scale(0.95); }\n.ta-launcher-result-row:has(.ta-launcher-result-action) .ta-launcher-result { padding-right: 84px; }\n/* The dialog that hands an extension on. */\n.ta-share { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px 6px 6px; }\n.ta-share-qr { width: 220px; height: 220px; padding: 12px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px var(--ta-border-muted); }\n.ta-share-qr svg { display: block; width: 100%; height: 100%; animation: ta-fade 160ms ease-out; }\n.ta-share-qr-busy { display: grid; place-items: center; background: var(--ta-raised); }\n.ta-share-qr-wait { color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); }\n.ta-share-hint { max-width: 320px; margin: 0; text-align: center; color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); line-height: calc(18px * var(--ta-font-scale)); text-wrap: balance; }\n.ta-share-actions { display: flex; gap: 8px; }\n.ta-share-stop { border: 0; padding: 2px 4px; background: none; color: var(--ta-red); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); cursor: pointer; }\n.ta-launcher-result { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 8px; border: 0; border-radius: 12px; background: none; color: var(--ta-text); font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }\n.ta-launcher-result:hover, .ta-launcher-result:active { background: var(--ta-hover); }\n.ta-launcher-result-icon { flex: none; position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--ta-tile); color: var(--ta-tile-ink); }\n.ta-launcher-result-icon > .ta-busy-mark { width: 16px; height: 16px; border-color: color-mix(in srgb, var(--ta-tile-ink) 25%, transparent); border-top-color: var(--ta-tile-ink); }\n.ta-launcher-result-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }\n.ta-launcher-result-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(15px * var(--ta-font-scale)); line-height: calc(20px * var(--ta-font-scale)); }\n.ta-launcher-result-title mark { background: none; color: var(--ta-accent); font-weight: 600; }\n.ta-launcher-result-detail { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); line-height: calc(16px * var(--ta-font-scale)); }\n.ta-board { flex: 1; min-height: 0; display: flex; flex-direction: column; }\n.ta-board-head { flex: none; display: flex; align-items: center; gap: 6px; min-height: 64px; padding: 6px 14px 6px 16px; }\n.ta-board-heading { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }\n.ta-board-title { font-size: calc(22px * var(--ta-font-scale)); line-height: calc(28px * var(--ta-font-scale)); font-weight: 700; letter-spacing: -0.01em; color: var(--ta-text); }\n.ta-board-date { color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); line-height: calc(17px * var(--ta-font-scale)); }\n.ta-board-edit-button { flex: none; height: 30px; padding: 0 14px; border: 0; border-radius: 15px; background: var(--ta-chip); color: var(--ta-text); font-size: calc(13px * var(--ta-font-scale)); font-weight: 500; transition: background 160ms, color 160ms, transform 120ms var(--ta-ease); }\n.ta-board-edit-button:hover { background: var(--ta-hover-strong); }\n.ta-board-edit-button:active { transform: scale(0.96); }\n.ta-board-edit-button.ta-active { background: var(--ta-brand); color: var(--ta-brand-text); }\n.ta-board-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; padding: 2px 14px calc(20px + env(safe-area-inset-bottom)); }\n.ta-board-cards { display: flex; flex-direction: column; gap: 12px; }\n.ta-board-card { padding: 12px 14px 14px; border-radius: 20px; background: var(--ta-main); box-shadow: 0 0 0 1px var(--ta-border-muted), 0 2px 6px rgba(15, 23, 42, 0.03), 0 8px 24px rgba(15, 23, 42, 0.04); animation: ta-board-in 260ms var(--ta-ease) both; }\n:root[data-theme='dark'] .ta-board-card { background: var(--ta-card); box-shadow: 0 0 0 1px var(--ta-border-muted); }\n@keyframes ta-board-in { from { opacity: 0; transform: translate3d(0, 6px, 0); } }\n.ta-board-card-head { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; color: var(--ta-secondary); font-size: calc(12.5px * var(--ta-font-scale)); line-height: calc(18px * var(--ta-font-scale)); font-weight: 600; }\n.ta-board-card-icon { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: color-mix(in srgb, var(--ta-accent) 14%, transparent); color: var(--ta-accent); }\n.ta-board-card-body { min-width: 0; color: var(--ta-body); font-size: calc(14px * var(--ta-font-scale)); }\n/* A card with nothing says so in one quiet line, where its content would start. */\n.ta-board-card-body .ta-empty { min-height: 0; align-items: flex-start; padding: 0 0 2px; text-align: left; }\n.ta-board-card-body .ta-empty-title { color: var(--ta-muted); font-weight: 400; }\n.ta-board-edit { display: flex; flex-direction: column; animation: ta-fade 160ms ease-out; }\n.ta-board-rows { display: flex; flex-direction: column; border-radius: 14px; background: var(--ta-main); box-shadow: 0 0 0 1px var(--ta-border-muted); }\n.ta-board-row { position: relative; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 4px 0 10px; border-radius: 14px; background: var(--ta-main); transition: transform 200ms var(--ta-ease), box-shadow 160ms; }\n.ta-board-row + .ta-board-row::before { content: ''; position: absolute; top: 0; left: 76px; right: 0; border-top: 1px solid var(--ta-border-muted); }\n.ta-board-row[data-sorting] { z-index: 2; transition: box-shadow 160ms; box-shadow: var(--ta-shadow-pop); }\n.ta-board-row[data-sorting]::before, .ta-board-row[data-sorting] + .ta-board-row::before { display: none; }\n.ta-board-toggle { flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; background: none; }\n.ta-board-off { color: var(--ta-red); }\n.ta-board-on { color: var(--ta-green); }\n.ta-board-row-icon { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--ta-chip); color: var(--ta-secondary); }\n.ta-board-row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-text); font-size: calc(15px * var(--ta-font-scale)); }\n.ta-board-grip { flex: none; display: grid; place-items: center; width: 44px; height: 48px; padding: 0; border: 0; background: none; color: var(--ta-muted); cursor: grab; touch-action: none; }\n.ta-board-row[data-sorting] .ta-board-grip { cursor: grabbing; }\n.ta-board-label { margin: 20px 6px 8px; color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); line-height: calc(16px * var(--ta-font-scale)); }\n\n/* The rail's buttons for them, above the account; the flyout beside it. */\n.ta-rail-tools { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 4px; }\n.ta-flyout { position: fixed; z-index: 50; left: calc(64px + env(safe-area-inset-left)); bottom: calc(10px + env(safe-area-inset-bottom)); width: 380px; max-width: calc(100vw - 80px); max-height: min(680px, calc(100vh - 20px - var(--ta-titlebar))); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--ta-border); border-radius: 16px; background: var(--ta-side); box-shadow: var(--ta-shadow-pop); transform-origin: 0 100%; animation: ta-flyout-in 180ms var(--ta-ease); }\n.ta-flyout > .ta-launcher-surface { height: min(560px, calc(100vh - 20px - var(--ta-titlebar))); flex: none; }\n@keyframes ta-flyout-in { from { opacity: 0; transform: translate3d(-6px, 6px, 0) scale(0.97); } }\n/* The faces of those who are not Ta (components/face.tsx): they blink, and look about while they work */\n:root:not([data-theme='light']) .ta-face[data-face=\"11\"] .ta-face-body > g > circle { fill: #4a4a52; }\n.ta-face { position: relative; display: inline-flex; flex: none; }\n.ta-face svg { display: block; overflow: visible; }\n.ta-face-double { align-items: center; justify-content: center; }\n.ta-face-eyes { transform-box: fill-box; transform-origin: center; animation: ta-face-blink 5.2s infinite; }\n.ta-face[data-face=\"1\"] .ta-face-eyes, .ta-face[data-face=\"5\"] .ta-face-eyes, .ta-face[data-face=\"9\"] .ta-face-eyes, .ta-face[data-face=\"13\"] .ta-face-eyes { animation-delay: -1.7s; }\n.ta-face[data-face=\"2\"] .ta-face-eyes, .ta-face[data-face=\"6\"] .ta-face-eyes, .ta-face[data-face=\"10\"] .ta-face-eyes, .ta-face[data-face=\"14\"] .ta-face-eyes { animation-delay: -3.1s; }\n.ta-face[data-face=\"3\"] .ta-face-eyes, .ta-face[data-face=\"7\"] .ta-face-eyes, .ta-face[data-face=\"11\"] .ta-face-eyes, .ta-face[data-face=\"15\"] .ta-face-eyes { animation-delay: -4.4s; }\n.ta-face-working .ta-face-look { animation: ta-face-look 2.4s ease-in-out infinite; }\n.ta-face-working .ta-face-body { transform-box: fill-box; transform-origin: 50% 100%; animation: ta-face-bob 1.2s ease-in-out infinite; }\n.ta-face-dot { position: absolute; right: -1px; bottom: -1px; width: 27%; height: 27%; min-width: 7px; min-height: 7px; box-sizing: content-box; border-radius: 50%; border: 2px solid var(--ta-face-ring, var(--ta-main)); background: var(--ta-border-field); }\n.ta-face-dot.ta-face-on { background: var(--ta-green); }\n@keyframes ta-face-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }\n@keyframes ta-face-look { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-1.4px); } 70% { transform: translateX(1.4px); } }\n@keyframes ta-face-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.2px); } }\n@media (prefers-reduced-motion: reduce) { .ta-face * { animation: none !important; } }\n.ta-group-face { position: relative; display: inline-flex; flex: none; }\n.ta-group-face-back { position: absolute; right: 0; top: 0; }\n.ta-group-face-front { position: absolute; left: 0; bottom: 0; z-index: 1; }\n";
|
|
6
6
|
//# sourceMappingURL=surfaces.d.ts.map
|
|
@@ -95,6 +95,7 @@ exports.SURFACES_STYLE = `
|
|
|
95
95
|
:root:not([data-theme='light']) .ta-face[data-face="11"] .ta-face-body > g > circle { fill: #4a4a52; }
|
|
96
96
|
.ta-face { position: relative; display: inline-flex; flex: none; }
|
|
97
97
|
.ta-face svg { display: block; overflow: visible; }
|
|
98
|
+
.ta-face-double { align-items: center; justify-content: center; }
|
|
98
99
|
.ta-face-eyes { transform-box: fill-box; transform-origin: center; animation: ta-face-blink 5.2s infinite; }
|
|
99
100
|
.ta-face[data-face="1"] .ta-face-eyes, .ta-face[data-face="5"] .ta-face-eyes, .ta-face[data-face="9"] .ta-face-eyes, .ta-face[data-face="13"] .ta-face-eyes { animation-delay: -1.7s; }
|
|
100
101
|
.ta-face[data-face="2"] .ta-face-eyes, .ta-face[data-face="6"] .ta-face-eyes, .ta-face[data-face="10"] .ta-face-eyes, .ta-face[data-face="14"] .ta-face-eyes { animation-delay: -3.1s; }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** What Ta Desktop can do for the page beyond a tab of a browser. */
|
|
2
|
-
export type DesktopFeature = 'webview' | 'debugWebview' | 'showItemInFolder' | 'browserData' | 'recentShots' | 'notices' | 'speech';
|
|
2
|
+
export type DesktopFeature = 'webview' | 'debugWebview' | 'showItemInFolder' | 'browserData' | 'recentShots' | 'notices' | 'speech' | 'restart';
|
|
3
3
|
/** The file manager of the system, from Ta Desktop: {@link WebDesktop} of the extension API. */
|
|
4
4
|
export interface DesktopFileManager {
|
|
5
5
|
/** Node's `process.platform` of the machine: what the file manager is called there. */
|
|
@@ -71,6 +71,11 @@ export declare namespace DesktopUtil {
|
|
|
71
71
|
function has(feature: DesktopFeature, scope?: object): boolean;
|
|
72
72
|
/** The file manager of the system, when the page is in Ta Desktop. */
|
|
73
73
|
function fileManager(scope?: object): DesktopFileManager | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Restarts Ta Desktop with the Ta service it started, to its build installed now: false when the Ta service is not
|
|
76
|
+
* the app's (one started in a terminal), which then restarts by itself (TaServer.restartServer).
|
|
77
|
+
*/
|
|
78
|
+
function restart(scope?: object): (() => Promise<boolean>) | undefined;
|
|
74
79
|
/** The sign-ins of the user's browsers, where Ta Desktop can read them (macOS, Windows). */
|
|
75
80
|
function browserData(scope?: object): DesktopBrowserData | undefined;
|
|
76
81
|
/** `debugWebview` of Ta Desktop; `undefined` elsewhere. */
|
|
@@ -27,6 +27,16 @@ var DesktopUtil;
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
DesktopUtil.fileManager = fileManager;
|
|
30
|
+
/**
|
|
31
|
+
* Restarts Ta Desktop with the Ta service it started, to its build installed now: false when the Ta service is not
|
|
32
|
+
* the app's (one started in a terminal), which then restarts by itself (TaServer.restartServer).
|
|
33
|
+
*/
|
|
34
|
+
function restart(scope = globalThis) {
|
|
35
|
+
var _a;
|
|
36
|
+
const restart = (_a = scope.taDesktop) === null || _a === void 0 ? void 0 : _a.restart;
|
|
37
|
+
return has('restart', scope) && typeof restart === 'function' ? async () => (await restart()) === true : undefined;
|
|
38
|
+
}
|
|
39
|
+
DesktopUtil.restart = restart;
|
|
30
40
|
/** The sign-ins of the user's browsers, where Ta Desktop can read them (macOS, Windows). */
|
|
31
41
|
function browserData(scope = globalThis) {
|
|
32
42
|
var _a;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type MarkdownBlock, type MarkdownPicture } from './markdown';
|
|
2
|
+
/**
|
|
3
|
+
* Pictures of a reply shown together, as chat apps show several sent at once: two side by side, four in two rows of
|
|
4
|
+
* two, three or more three a row, nine at most, the last saying how many more. Paragraphs of pictures alone one after
|
|
5
|
+
* another are one gallery, and so are pictures each under a short line of its own that names it (`**Dark**`,
|
|
6
|
+
* `Before:`), which shows under its tile.
|
|
7
|
+
*/
|
|
8
|
+
export declare namespace GalleryUtil {
|
|
9
|
+
/** The tiles a gallery shows; the last of them says how many more there are. */
|
|
10
|
+
const TILES = 9;
|
|
11
|
+
function columns(count: number): number;
|
|
12
|
+
/** The blocks with each run of two pictures or more as one gallery. */
|
|
13
|
+
function group(blocks: readonly MarkdownBlock[]): MarkdownBlock[];
|
|
14
|
+
/** The pictures of a paragraph of pictures alone (and spaces between them); undefined for any other. */
|
|
15
|
+
function pictures(text: string): MarkdownPicture[] | undefined;
|
|
16
|
+
/** The words of a short line that names the picture under it, its marks and the colon after it left out. */
|
|
17
|
+
function captionOf(text: string): string | undefined;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=gallery.d.ts.map
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GalleryUtil = void 0;
|
|
4
|
+
const markdown_1 = require("./markdown");
|
|
5
|
+
/** A caption is a short line: at most this wide, a CJK character counting twice. */
|
|
6
|
+
const CAPTION_WIDTH = 40;
|
|
7
|
+
/** A line that ends a sentence says something, it does not name a picture. */
|
|
8
|
+
const SENTENCE_END = /[。!?!?;;.]$/;
|
|
9
|
+
/** Alt text that names no picture: a file name, or "image", "screenshot" and the like. */
|
|
10
|
+
const BARE_ALT = /^(?:image|img|picture|pic|photo|screenshot|screen ?shot|图片?|截图|圖片?|截圖|画像|スクリーンショット)?\s*\d*$|\.\w{2,5}$/i;
|
|
11
|
+
/**
|
|
12
|
+
* Pictures of a reply shown together, as chat apps show several sent at once: two side by side, four in two rows of
|
|
13
|
+
* two, three or more three a row, nine at most, the last saying how many more. Paragraphs of pictures alone one after
|
|
14
|
+
* another are one gallery, and so are pictures each under a short line of its own that names it (`**Dark**`,
|
|
15
|
+
* `Before:`), which shows under its tile.
|
|
16
|
+
*/
|
|
17
|
+
var GalleryUtil;
|
|
18
|
+
(function (GalleryUtil) {
|
|
19
|
+
/** The tiles a gallery shows; the last of them says how many more there are. */
|
|
20
|
+
GalleryUtil.TILES = 9;
|
|
21
|
+
function columns(count) {
|
|
22
|
+
return count <= 1 ? 1 : count === 2 || count === 4 ? 2 : 3;
|
|
23
|
+
}
|
|
24
|
+
GalleryUtil.columns = columns;
|
|
25
|
+
/** The blocks with each run of two pictures or more as one gallery. */
|
|
26
|
+
function group(blocks) {
|
|
27
|
+
const out = [];
|
|
28
|
+
for (let i = 0; i < blocks.length;) {
|
|
29
|
+
const run = runFrom(blocks, i);
|
|
30
|
+
const count = run.entries.reduce((sum, entry) => sum + entry.pictures.length, 0);
|
|
31
|
+
if (count < 2) {
|
|
32
|
+
out.push(blocks[i]);
|
|
33
|
+
i++;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
const entries = run.entries.slice();
|
|
37
|
+
// One line before the first picture alone introduces them all ("截图如下"), it names none.
|
|
38
|
+
const named = entries.filter(entry => entry.caption).length;
|
|
39
|
+
if (named === 1 && entries[0].caption) {
|
|
40
|
+
out.push(entries[0].caption);
|
|
41
|
+
entries[0] = { pictures: entries[0].pictures };
|
|
42
|
+
}
|
|
43
|
+
const items = entries.flatMap(entry => {
|
|
44
|
+
var _a;
|
|
45
|
+
const caption = ((_a = entry.caption) === null || _a === void 0 ? void 0 : _a.type) === 'paragraph' ? captionOf(entry.caption.text) : undefined;
|
|
46
|
+
return entry.pictures.map(picture => {
|
|
47
|
+
const words = caption !== null && caption !== void 0 ? caption : altCaption(picture.alt);
|
|
48
|
+
return words ? { ...picture, caption: words } : picture;
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
out.push({ type: 'gallery', items });
|
|
52
|
+
i = run.end;
|
|
53
|
+
}
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
GalleryUtil.group = group;
|
|
57
|
+
/** The pictures of a paragraph of pictures alone (and spaces between them); undefined for any other. */
|
|
58
|
+
function pictures(text) {
|
|
59
|
+
const out = [];
|
|
60
|
+
for (const node of markdown_1.MarkdownUtil.inline(text)) {
|
|
61
|
+
if (node.type === 'media' && markdown_1.MarkdownUtil.media(node.src) === 'image') {
|
|
62
|
+
out.push({ src: node.src, alt: node.alt });
|
|
63
|
+
}
|
|
64
|
+
else if (node.type !== 'text' || node.text.trim()) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return out.length > 0 ? out : undefined;
|
|
69
|
+
}
|
|
70
|
+
GalleryUtil.pictures = pictures;
|
|
71
|
+
/** The words of a short line that names the picture under it, its marks and the colon after it left out. */
|
|
72
|
+
function captionOf(text) {
|
|
73
|
+
if (text.includes('\n')) {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
const colon = /\s*[::]\s*$/;
|
|
77
|
+
let line = text.trim().replace(colon, '');
|
|
78
|
+
const strong = /^(\*\*|__|\*|_)(.+)\1$/.exec(line);
|
|
79
|
+
if (strong && !strong[2].includes(strong[1])) {
|
|
80
|
+
line = strong[2].trim().replace(colon, '');
|
|
81
|
+
}
|
|
82
|
+
if (!line || SENTENCE_END.test(line) || width(line) > CAPTION_WIDTH) {
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
return markdown_1.MarkdownUtil.inline(line).every(node => node.type === 'text' || node.type === 'strong' || node.type === 'em' || node.type === 'code')
|
|
86
|
+
? line
|
|
87
|
+
: undefined;
|
|
88
|
+
}
|
|
89
|
+
GalleryUtil.captionOf = captionOf;
|
|
90
|
+
function altCaption(alt) {
|
|
91
|
+
const words = alt.trim();
|
|
92
|
+
return words && !BARE_ALT.test(words) && width(words) <= CAPTION_WIDTH ? words : undefined;
|
|
93
|
+
}
|
|
94
|
+
function runFrom(blocks, start) {
|
|
95
|
+
const entries = [];
|
|
96
|
+
let i = start;
|
|
97
|
+
while (i < blocks.length) {
|
|
98
|
+
const block = blocks[i];
|
|
99
|
+
if (block.type !== 'paragraph') {
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
const own = pictures(block.text);
|
|
103
|
+
if (own) {
|
|
104
|
+
entries.push({ pictures: own });
|
|
105
|
+
i++;
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
const next = blocks[i + 1];
|
|
109
|
+
const under = (next === null || next === void 0 ? void 0 : next.type) === 'paragraph' && captionOf(block.text) !== undefined ? pictures(next.text) : undefined;
|
|
110
|
+
if ((under === null || under === void 0 ? void 0 : under.length) !== 1) {
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
entries.push({ pictures: under, caption: block });
|
|
114
|
+
i += 2;
|
|
115
|
+
}
|
|
116
|
+
return { entries, end: i };
|
|
117
|
+
}
|
|
118
|
+
function width(text) {
|
|
119
|
+
let width = 0;
|
|
120
|
+
for (const char of text) {
|
|
121
|
+
width += char.charCodeAt(0) >= 0x2e80 ? 2 : 1;
|
|
122
|
+
}
|
|
123
|
+
return width;
|
|
124
|
+
}
|
|
125
|
+
})(GalleryUtil || (exports.GalleryUtil = GalleryUtil = {}));
|
|
126
|
+
//# sourceMappingURL=gallery.js.map
|
|
@@ -36,6 +36,14 @@ export declare namespace LinkUtil {
|
|
|
36
36
|
function codeReference(text: string): LinkTarget | undefined;
|
|
37
37
|
/** A URL at the start of `text` (text runs on after it), without the punctuation that ends a sentence. */
|
|
38
38
|
function bareUrl(text: string): string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* The first web address of a notice, for a button that opens it (a page to sign in on); the text without it
|
|
41
|
+
* when it ends the text, as the button stands for it.
|
|
42
|
+
*/
|
|
43
|
+
function noticeLink(text: string): {
|
|
44
|
+
text: string;
|
|
45
|
+
url?: string;
|
|
46
|
+
};
|
|
39
47
|
/** `path` against the directory `cwd`: the directory to read it in, and the path inside it ('' for the directory itself). */
|
|
40
48
|
function resolve(cwd: string, path: string): {
|
|
41
49
|
cwd: string;
|
package/lib/browser/util/link.js
CHANGED
|
@@ -132,6 +132,20 @@ var LinkUtil;
|
|
|
132
132
|
return /^https?:\/\/[^/?#]/i.test(url) ? url : undefined;
|
|
133
133
|
}
|
|
134
134
|
LinkUtil.bareUrl = bareUrl;
|
|
135
|
+
/**
|
|
136
|
+
* The first web address of a notice, for a button that opens it (a page to sign in on); the text without it
|
|
137
|
+
* when it ends the text, as the button stands for it.
|
|
138
|
+
*/
|
|
139
|
+
function noticeLink(text) {
|
|
140
|
+
const at = text.search(/https?:\/\//i);
|
|
141
|
+
const url = at < 0 ? undefined : bareUrl(text.slice(at));
|
|
142
|
+
if (!url) {
|
|
143
|
+
return { text };
|
|
144
|
+
}
|
|
145
|
+
const after = text.slice(at + url.length).replace(/^[.,;:!?。,;!?]+/, '');
|
|
146
|
+
return { text: after.trim() ? text : text.slice(0, at).replace(/[\s::]+$/, ''), url };
|
|
147
|
+
}
|
|
148
|
+
LinkUtil.noticeLink = noticeLink;
|
|
135
149
|
/** `path` against the directory `cwd`: the directory to read it in, and the path inside it ('' for the directory itself). */
|
|
136
150
|
function resolve(cwd, path) {
|
|
137
151
|
if (cwd.includes('\\') || path.includes('\\')) {
|
|
@@ -35,7 +35,18 @@ export type MarkdownBlock = {
|
|
|
35
35
|
closed: boolean;
|
|
36
36
|
} | {
|
|
37
37
|
type: 'rule';
|
|
38
|
+
}
|
|
39
|
+
/** Pictures one after another, shown together as a grid (GalleryUtil.group). */
|
|
40
|
+
| {
|
|
41
|
+
type: 'gallery';
|
|
42
|
+
items: MarkdownPicture[];
|
|
38
43
|
};
|
|
44
|
+
/** A picture of a gallery: its target, its alt text and the words that name it, if any. */
|
|
45
|
+
export interface MarkdownPicture {
|
|
46
|
+
src: string;
|
|
47
|
+
alt: string;
|
|
48
|
+
caption?: string;
|
|
49
|
+
}
|
|
39
50
|
/** How a column of a table is aligned: `:--`, `:-:`, `--:`, or as the page is (`''`). */
|
|
40
51
|
export type TableAlign = '' | 'left' | 'center' | 'right';
|
|
41
52
|
/** A run of text inside a block. */
|
|
@@ -232,6 +232,10 @@ var MarkdownUtil;
|
|
|
232
232
|
switch (b.type) {
|
|
233
233
|
case 'list':
|
|
234
234
|
return a.type === 'list' && a.ordered === b.ordered && sameStrings(a.items, b.items);
|
|
235
|
+
case 'gallery':
|
|
236
|
+
return (a.type === 'gallery' &&
|
|
237
|
+
a.items.length === b.items.length &&
|
|
238
|
+
a.items.every((item, index) => item.src === b.items[index].src && item.alt === b.items[index].alt && item.caption === b.items[index].caption));
|
|
235
239
|
case 'table':
|
|
236
240
|
return (a.type === 'table' &&
|
|
237
241
|
sameStrings(a.header, b.header) &&
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A picture of the workspace shown smaller than it is (in a reply, a tile of a gallery) is loaded smaller: its URL asks
|
|
3
|
+
* ta serve for a box of the pixels of the device (`?w=&h=`, `fit=cover` for a tile it fills), which makes a smaller PNG
|
|
4
|
+
* of a PNG and sends any other picture as it is. Enlarged, the picture itself loads.
|
|
5
|
+
*/
|
|
6
|
+
export declare namespace ThumbnailUtil {
|
|
7
|
+
/** The box a picture shows in, in pixels of the device; `cover` for a tile it fills. */
|
|
8
|
+
interface Box {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
cover?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** `css` pixels of the page in pixels of the device, three at most to one, rounded up to a step. */
|
|
14
|
+
function side(css: number, ratio?: number): number;
|
|
15
|
+
function url(url: string, width: number, height: number, cover?: boolean): string;
|
|
16
|
+
/** The URL of a file of the workspace asked in `box`, or as it is without one. */
|
|
17
|
+
function boxed(url: string, box?: Box): string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=thumbnail.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThumbnailUtil = void 0;
|
|
4
|
+
/** Sides of a smaller picture go up in steps of this, so that pages of nearly the same width share one. */
|
|
5
|
+
const STEP = 160;
|
|
6
|
+
const MAX = 4096;
|
|
7
|
+
/**
|
|
8
|
+
* A picture of the workspace shown smaller than it is (in a reply, a tile of a gallery) is loaded smaller: its URL asks
|
|
9
|
+
* ta serve for a box of the pixels of the device (`?w=&h=`, `fit=cover` for a tile it fills), which makes a smaller PNG
|
|
10
|
+
* of a PNG and sends any other picture as it is. Enlarged, the picture itself loads.
|
|
11
|
+
*/
|
|
12
|
+
var ThumbnailUtil;
|
|
13
|
+
(function (ThumbnailUtil) {
|
|
14
|
+
/** `css` pixels of the page in pixels of the device, three at most to one, rounded up to a step. */
|
|
15
|
+
function side(css, ratio = globalThis.devicePixelRatio || 1) {
|
|
16
|
+
return Math.min(MAX, Math.ceil((css * Math.min(3, Math.max(1, ratio))) / STEP) * STEP);
|
|
17
|
+
}
|
|
18
|
+
ThumbnailUtil.side = side;
|
|
19
|
+
function url(url, width, height, cover = false) {
|
|
20
|
+
return `${url}${url.includes('?') ? '&' : '?'}w=${width}&h=${height}${cover ? '&fit=cover' : ''}`;
|
|
21
|
+
}
|
|
22
|
+
ThumbnailUtil.url = url;
|
|
23
|
+
/** The URL of a file of the workspace asked in `box`, or as it is without one. */
|
|
24
|
+
function boxed(url, box) {
|
|
25
|
+
return box ? ThumbnailUtil.url(url, box.width, box.height, box.cover) : url;
|
|
26
|
+
}
|
|
27
|
+
ThumbnailUtil.boxed = boxed;
|
|
28
|
+
})(ThumbnailUtil || (exports.ThumbnailUtil = ThumbnailUtil = {}));
|
|
29
|
+
//# sourceMappingURL=thumbnail.js.map
|
|
@@ -49,6 +49,8 @@ export interface WorkbenchState {
|
|
|
49
49
|
*/
|
|
50
50
|
offlineShown?: boolean;
|
|
51
51
|
server?: TaServerInfo;
|
|
52
|
+
/** Ta restarts at the user's word (restartServer), until the page is connected to the one that started again. */
|
|
53
|
+
restarting?: boolean;
|
|
52
54
|
/**
|
|
53
55
|
* The server tells the open sessions as they change (TaServer.watchSessions): the lists are read again
|
|
54
56
|
* only now and then. Not by a Ta service of before, whose lists are read again every few seconds.
|
|
@@ -128,6 +130,12 @@ export interface TaWorkbench {
|
|
|
128
130
|
* what names no directory opens. Open conversations stay in theirs.
|
|
129
131
|
*/
|
|
130
132
|
setWorkingDirectory(cwd: string): Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Restarts Ta: Ta Desktop as a whole when it started the Ta service, else the Ta service (TaServer.restartServer),
|
|
135
|
+
* which then runs the build installed now (TaServerInfo.update). What runs goes on after it. `restarting` until the
|
|
136
|
+
* page is connected again, when it loads again if it was of the build before.
|
|
137
|
+
*/
|
|
138
|
+
restartServer(): Promise<void>;
|
|
131
139
|
/**
|
|
132
140
|
* A store of a session on this connection; the caller attaches and detaches it. It can be made before
|
|
133
141
|
* there is a connection, to show a conversation kept on the device (SessionStoreOptions.initial): it is
|
|
@@ -12,6 +12,12 @@ export declare class TaWorkbenchImpl implements TaWorkbench {
|
|
|
12
12
|
/** On the connection of the time, only while it is open: what it was at goes again once it opens (resend). */
|
|
13
13
|
readonly presence: PresenceReporter;
|
|
14
14
|
protected retryTimer?: ReturnType<typeof setTimeout>;
|
|
15
|
+
/** A restart asked for: whether a build was installed over the one running, and whether its connection closed yet. */
|
|
16
|
+
protected restart?: {
|
|
17
|
+
update: boolean;
|
|
18
|
+
closed: boolean;
|
|
19
|
+
timer: ReturnType<typeof setTimeout>;
|
|
20
|
+
};
|
|
15
21
|
/** While ta serve is not running: the next attempt, which `reconnect` makes at once. */
|
|
16
22
|
protected retry?: () => void;
|
|
17
23
|
protected attempts: number;
|
|
@@ -76,6 +82,14 @@ export declare class TaWorkbenchImpl implements TaWorkbench {
|
|
|
76
82
|
messages?: boolean;
|
|
77
83
|
state?: string[];
|
|
78
84
|
}): () => void;
|
|
85
|
+
restartServer(): Promise<void>;
|
|
86
|
+
/** A restart that failed, or did not come back: no longer waited for. */
|
|
87
|
+
protected restarted(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Once the connection of a restart closed, the server read again is the Ta that started again: the restart is over,
|
|
90
|
+
* and a page of the build before loads again for the new one (the app on a phone has its own).
|
|
91
|
+
*/
|
|
92
|
+
protected followRestart(change: Partial<WorkbenchState>, next: WorkbenchState): void;
|
|
79
93
|
setWorkingDirectory(cwd: string): Promise<void>;
|
|
80
94
|
subscribe(listener: (state: WorkbenchState) => void): () => void;
|
|
81
95
|
start(): Promise<void>;
|
|
@@ -140,6 +154,8 @@ export declare class TaWorkbenchImpl implements TaWorkbench {
|
|
|
140
154
|
* page was not seen gets its grace from now.
|
|
141
155
|
*/
|
|
142
156
|
protected watchWake(): void;
|
|
157
|
+
/** Whether another build of Ta was installed since (TaServerInfo.update), read while the page is seen. */
|
|
158
|
+
protected checkUpdate(): Promise<void>;
|
|
143
159
|
protected update(change: Partial<WorkbenchState>): void;
|
|
144
160
|
protected keepLists(of: string): void;
|
|
145
161
|
}
|
package/lib/browser/workbench.js
CHANGED
|
@@ -16,9 +16,14 @@ const device_values_1 = require("./offline/device-values");
|
|
|
16
16
|
const presence_reporter_1 = require("./presence/presence-reporter");
|
|
17
17
|
const settings_protocol_1 = require("./settings/settings-protocol");
|
|
18
18
|
const state_protocol_1 = require("./state/state-protocol");
|
|
19
|
+
const desktop_1 = require("./util/desktop");
|
|
19
20
|
const workbench_calls_1 = require("./workbench-calls");
|
|
20
21
|
const workbench_protocol_1 = require("./workbench-protocol");
|
|
21
22
|
const workbench_util_1 = require("./workbench-util");
|
|
23
|
+
/** How often a page that is seen reads again which build of Ta is installed (TaServerInfo.update). */
|
|
24
|
+
const UPDATE_CHECK_MS = 60000;
|
|
25
|
+
/** A restart not back in this long is no longer waited for: the row of the connection says what is wrong. */
|
|
26
|
+
const RESTART_WAIT_MS = 120000;
|
|
22
27
|
let TaWorkbenchImpl = class TaWorkbenchImpl {
|
|
23
28
|
constructor() {
|
|
24
29
|
this.list = workbench_util_1.WorkbenchUtil.readHosts((0, workbench_util_1.storage)());
|
|
@@ -139,6 +144,54 @@ let TaWorkbenchImpl = class TaWorkbenchImpl {
|
|
|
139
144
|
}
|
|
140
145
|
};
|
|
141
146
|
}
|
|
147
|
+
async restartServer() {
|
|
148
|
+
var _a;
|
|
149
|
+
if (this.restart) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const timer = setTimeout(() => this.restarted(), RESTART_WAIT_MS);
|
|
153
|
+
this.restart = { update: Boolean((_a = this.current.server) === null || _a === void 0 ? void 0 : _a.update), closed: false, timer };
|
|
154
|
+
this.update({ restarting: true });
|
|
155
|
+
try {
|
|
156
|
+
const desktop = desktop_1.DesktopUtil.restart();
|
|
157
|
+
if (!(desktop && (await desktop()))) {
|
|
158
|
+
await this.server.restartServer();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
this.restarted();
|
|
163
|
+
throw error;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
/** A restart that failed, or did not come back: no longer waited for. */
|
|
167
|
+
restarted() {
|
|
168
|
+
if (this.restart) {
|
|
169
|
+
clearTimeout(this.restart.timer);
|
|
170
|
+
this.restart = undefined;
|
|
171
|
+
this.update({ restarting: false });
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Once the connection of a restart closed, the server read again is the Ta that started again: the restart is over,
|
|
176
|
+
* and a page of the build before loads again for the new one (the app on a phone has its own).
|
|
177
|
+
*/
|
|
178
|
+
followRestart(change, next) {
|
|
179
|
+
const restart = this.restart;
|
|
180
|
+
if (!restart) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
if (next.status !== 'online') {
|
|
184
|
+
restart.closed = true;
|
|
185
|
+
}
|
|
186
|
+
else if (restart.closed && change.server) {
|
|
187
|
+
clearTimeout(restart.timer);
|
|
188
|
+
this.restart = undefined;
|
|
189
|
+
next.restarting = false;
|
|
190
|
+
if (restart.update && !workbench_util_1.WorkbenchUtil.isApp()) {
|
|
191
|
+
this.reload();
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
142
195
|
async setWorkingDirectory(cwd) {
|
|
143
196
|
this.update({ server: await this.server.setWorkingDirectory(cwd) });
|
|
144
197
|
}
|
|
@@ -609,15 +662,29 @@ let TaWorkbenchImpl = class TaWorkbenchImpl {
|
|
|
609
662
|
}
|
|
610
663
|
else {
|
|
611
664
|
(_a = this.connection) === null || _a === void 0 ? void 0 : _a.wake();
|
|
665
|
+
void this.checkUpdate();
|
|
612
666
|
}
|
|
613
667
|
this.update({});
|
|
614
668
|
};
|
|
615
669
|
document.addEventListener('visibilitychange', wake);
|
|
616
670
|
window.addEventListener('online', wake);
|
|
617
671
|
window.addEventListener('pageshow', wake);
|
|
672
|
+
setInterval(() => void this.checkUpdate(), UPDATE_CHECK_MS);
|
|
673
|
+
}
|
|
674
|
+
/** Whether another build of Ta was installed since (TaServerInfo.update), read while the page is seen. */
|
|
675
|
+
async checkUpdate() {
|
|
676
|
+
const connection = this.connection;
|
|
677
|
+
if (!connection || this.current.status !== 'online' || this.restart || document.visibilityState === 'hidden') {
|
|
678
|
+
return;
|
|
679
|
+
}
|
|
680
|
+
const server = await connection.server.getServerInfo().catch(() => undefined);
|
|
681
|
+
if (server && connection === this.connection && !this.restart) {
|
|
682
|
+
this.update({ server: workbench_util_1.WorkbenchUtil.same(this.current.server, server) });
|
|
683
|
+
}
|
|
618
684
|
}
|
|
619
685
|
update(change) {
|
|
620
686
|
const next = { ...this.current, ...change };
|
|
687
|
+
this.followRestart(change, next);
|
|
621
688
|
if (next.status !== 'offline') {
|
|
622
689
|
clearTimeout(this.graceTimer);
|
|
623
690
|
this.graceTimer = undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-web",
|
|
3
|
-
"version": "4.15.
|
|
3
|
+
"version": "4.15.2",
|
|
4
4
|
"description": "The web client of ta serve: sessions, streaming messages, tool runs with diffs, and dialogs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cell-component"
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@celljs/core": "4.15.
|
|
37
|
-
"@celljs/react": "4.15.
|
|
38
|
-
"@celljs/ta-client": "4.15.
|
|
39
|
-
"@celljs/ta-protocol": "4.15.
|
|
40
|
-
"@celljs/ta-relay": "4.15.
|
|
41
|
-
"@celljs/widget": "4.15.
|
|
36
|
+
"@celljs/core": "4.15.2",
|
|
37
|
+
"@celljs/react": "4.15.2",
|
|
38
|
+
"@celljs/ta-client": "4.15.2",
|
|
39
|
+
"@celljs/ta-protocol": "4.15.2",
|
|
40
|
+
"@celljs/ta-relay": "4.15.2",
|
|
41
|
+
"@celljs/widget": "4.15.2",
|
|
42
42
|
"@types/three": "^0.187.0",
|
|
43
43
|
"@xterm/addon-fit": "^0.11.0",
|
|
44
44
|
"@xterm/addon-unicode11": "^0.9.0",
|