tmux-weblink 3.1.1 → 3.2.0
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/dist/assets/shell-client.js +98 -94
- package/dist/browser/bots-client.js +6 -6
- package/dist/browser/highlight.js +3 -0
- package/dist/browser/markdown.js +4 -2
- package/dist/browser/menu.js +1 -0
- package/dist/browser/shell-client.js +13 -13
- package/dist/lib/bots/manager.js +4 -4
- package/dist/lib/bots/routes.js +1 -1
- package/dist/lib/icons.js +1 -1
- package/dist/lib/pages/shell.js +160 -37
- package/dist/lib/shared-layout.js +44 -11
- package/package.json +1 -1
|
@@ -152,6 +152,16 @@ import{escapeHtml as c}from"./html.js";import{icon as i,iconPath as r}from"./ico
|
|
|
152
152
|
.sidebar-divider { border: none; border-top: 1px solid var(--panel-border); margin: 14px 0; }
|
|
153
153
|
|
|
154
154
|
/* \u2500\u2500 New session modal \u2500\u2500 */
|
|
155
|
+
@media (max-width: 640px) {
|
|
156
|
+
/* Higher specificity than the desktop rules that follow, so the sheet wins. */
|
|
157
|
+
.modal-backdrop.open { align-items: flex-end; padding: 0; }
|
|
158
|
+
.modal-backdrop.open .modal-panel {
|
|
159
|
+
width: 100%; max-width: 100%; max-height: 90vh; overflow-y: auto;
|
|
160
|
+
border-radius: 16px 16px 0 0;
|
|
161
|
+
padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
|
|
162
|
+
border-left: none; border-right: none; border-bottom: none;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
155
165
|
.modal-backdrop {
|
|
156
166
|
display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3);
|
|
157
167
|
z-index: 500; align-items: center; justify-content: center;
|
|
@@ -250,7 +260,7 @@ import{escapeHtml as c}from"./html.js";import{icon as i,iconPath as r}from"./ico
|
|
|
250
260
|
<script>${y()}</script>`}function A(e){const{activePage:o,refreshHref:a}=e;function t(l,f,b,x,g=""){return`<a href="${f}" class="${l!==null&&l===o?"sidebar-btn current":"sidebar-btn"}"${g}>
|
|
251
261
|
<svg viewBox="0 0 24 24" fill="currentColor">${b}</svg>
|
|
252
262
|
${x}
|
|
253
|
-
</a>`}const s=r("sessions"),p=r("notes"),h=r("history"),
|
|
263
|
+
</a>`}const s=r("sessions"),p=r("notes"),h=r("history"),m=r("quick-commands"),u=r("file"),k=r("refresh");return`<aside class="action-sidebar">
|
|
254
264
|
<p class="sidebar-label">Actions</p>
|
|
255
265
|
<button class="sidebar-btn primary" id="new-session-btn">
|
|
256
266
|
${i("add")}
|
|
@@ -259,15 +269,25 @@ import{escapeHtml as c}from"./html.js";import{icon as i,iconPath as r}from"./ico
|
|
|
259
269
|
<hr class="sidebar-divider">
|
|
260
270
|
${t("home","/",s,"Sessions")}
|
|
261
271
|
${t("notes","/notes",p,"All Notes")}
|
|
262
|
-
${t("files","/files",
|
|
272
|
+
${t("files","/files",u,"Files")}
|
|
263
273
|
${t("history","/history",h,"History")}
|
|
264
|
-
${t("quickCommands","/quick-commands",
|
|
274
|
+
${t("quickCommands","/quick-commands",m,"Quick Commands")}
|
|
265
275
|
<hr class="sidebar-divider">
|
|
266
276
|
<a href="${a}" class="sidebar-btn">
|
|
267
277
|
${i("refresh")}
|
|
268
278
|
Refresh
|
|
269
279
|
</a>
|
|
270
|
-
</aside>`}function
|
|
280
|
+
</aside>`}function D(){return` /* \u2500\u2500 New session modal \u2500\u2500 */
|
|
281
|
+
@media (max-width: 640px) {
|
|
282
|
+
/* Higher specificity than the desktop rules that follow, so the sheet wins. */
|
|
283
|
+
.modal-backdrop.open { align-items: flex-end; padding: 0; }
|
|
284
|
+
.modal-backdrop.open .modal-panel {
|
|
285
|
+
width: 100%; max-width: 100%; max-height: 90vh; overflow-y: auto;
|
|
286
|
+
border-radius: 16px 16px 0 0;
|
|
287
|
+
padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
|
|
288
|
+
border-left: none; border-right: none; border-bottom: none;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
271
291
|
.modal-backdrop {
|
|
272
292
|
display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3);
|
|
273
293
|
z-index: 500; align-items: center; justify-content: center;
|
|
@@ -377,7 +397,7 @@ import{escapeHtml as c}from"./html.js";import{icon as i,iconPath as r}from"./ico
|
|
|
377
397
|
<button class="modal-btn confirm" id="ns-submit">Create</button>
|
|
378
398
|
</div>
|
|
379
399
|
</div>
|
|
380
|
-
</div>`}function
|
|
400
|
+
</div>`}function T(e){return`(function() {
|
|
381
401
|
const modal = document.getElementById('new-session-modal');
|
|
382
402
|
const openBtn = document.getElementById('new-session-btn');
|
|
383
403
|
const cancelBtn = document.getElementById('ns-cancel');
|
|
@@ -402,14 +422,26 @@ import{escapeHtml as c}from"./html.js";import{icon as i,iconPath as r}from"./ico
|
|
|
402
422
|
return id ? '/a/' + encodeURIComponent(id) : '';
|
|
403
423
|
}
|
|
404
424
|
|
|
405
|
-
|
|
425
|
+
// presetDir creates the session in a known folder (the + on a sidebar group):
|
|
426
|
+
// the directory is filled in, the tree opens there and the name is suggested from
|
|
427
|
+
// the folder so a tap on Create is enough.
|
|
428
|
+
function openModal(presetDir) {
|
|
406
429
|
modal.classList.add('open');
|
|
407
430
|
nameInput.value = '';
|
|
408
|
-
dirInput.value = '';
|
|
431
|
+
dirInput.value = typeof presetDir === 'string' ? presetDir : '';
|
|
432
|
+
nameInput.value = presetDir ? suggestedName(presetDir) : '';
|
|
409
433
|
errorEl.style.display = 'none';
|
|
410
434
|
errorEl.textContent = '';
|
|
411
435
|
closeDropdown();
|
|
412
|
-
openTreeForSession().then(() => setTimeout(() =>
|
|
436
|
+
openTreeForSession(presetDir).then(() => setTimeout(() => {
|
|
437
|
+
nameInput.focus();
|
|
438
|
+
if (nameInput.value) nameInput.select();
|
|
439
|
+
}, 50));
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
function suggestedName(dir) {
|
|
443
|
+
const base = String(dir).split('/').filter(Boolean).pop();
|
|
444
|
+
return base || '';
|
|
413
445
|
}
|
|
414
446
|
|
|
415
447
|
function closeModal() { modal.classList.remove('open'); closeDropdown(); closeTree(); }
|
|
@@ -664,11 +696,12 @@ import{escapeHtml as c}from"./html.js";import{icon as i,iconPath as r}from"./ico
|
|
|
664
696
|
// On modal open, expand the tree directly to the currently selected
|
|
665
697
|
// session's working directory (window.__tmuxWebCurrentSession is set by
|
|
666
698
|
// the shell client; falls back to the home directory otherwise).
|
|
667
|
-
async function openTreeForSession() {
|
|
699
|
+
async function openTreeForSession(presetDir) {
|
|
668
700
|
treeRoot = '/';
|
|
669
701
|
treePanel.classList.add('open');
|
|
670
702
|
treeOpen = true;
|
|
671
|
-
const
|
|
703
|
+
const preset = typeof presetDir === 'string' && presetDir.startsWith('/') ? presetDir : '';
|
|
704
|
+
const target = preset || await treeOpenTarget();
|
|
672
705
|
await treeExpandTo(target);
|
|
673
706
|
}
|
|
674
707
|
|
|
@@ -745,4 +778,4 @@ import{escapeHtml as c}from"./html.js";import{icon as i,iconPath as r}from"./ico
|
|
|
745
778
|
if (e.key === 'Enter') submit();
|
|
746
779
|
});
|
|
747
780
|
window.__openNewSessionModal = openModal;
|
|
748
|
-
})();`}export{
|
|
781
|
+
})();`}export{D as newSessionModalCSS,B as newSessionModalHTML,T as newSessionModalScript,w as reducedMotion,R as sharedHeader,L as sharedLayoutCSS,A as sharedSidebar,v as themeSwitcherButtonHTML,y as themeSwitcherScript};
|