pinokiod 7.2.7 → 7.2.8

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.
@@ -0,0 +1,61 @@
1
+ <%
2
+ const shellCount = workspace.counts && Number.isFinite(workspace.counts.shells) ? workspace.counts.shells : 0;
3
+ const scriptCount = workspace.counts && Number.isFinite(workspace.counts.scripts) ? workspace.counts.scripts : 0;
4
+ const draftCount = workspace.counts && Number.isFinite(workspace.counts.drafts) ? workspace.counts.drafts : 0;
5
+ const shellTitles = Array.isArray(workspace.shells) ? workspace.shells.map((shell) => shell.title || shell.id || "").join(" ") : "";
6
+ const scriptTitles = Array.isArray(workspace.scripts) ? workspace.scripts.map((script) => script.title || script.id || "").join(" ") : "";
7
+ const draft = workspace.draft || null;
8
+ const draftId = draft && draft.id ? draft.id : `draft-${index}`;
9
+ const searchText = [workspace.name, workspace.cwd, shellTitles, scriptTitles, draft && draft.title].filter(Boolean).join(" ");
10
+ const modifiedLabel = dateLabel(workspace.modifiedAt);
11
+ const details = [];
12
+ if (shellCount > 0) details.push(plural(shellCount, "terminal"));
13
+ if (scriptCount > 0) details.push(plural(scriptCount, "script"));
14
+ if (draftCount > 0) details.push(draftCount === 1 ? "Draft ready" : plural(draftCount, "draft"));
15
+ if (modifiedLabel) details.push(modifiedLabel);
16
+ %>
17
+ <div
18
+ class="workspace-card workspace-line line align-top"
19
+ data-cwd="<%= workspace.cwd %>"
20
+ data-name="<%= workspace.name %>"
21
+ data-index="<%= index %>"
22
+ data-launch-count-total="<%= workspace.usageCount || 0 %>"
23
+ data-last-launch-at="<%= workspace.lastOpenedAt || workspace.modifiedAt || "" %>"
24
+ data-search="<%= searchText %>"
25
+ >
26
+ <h3>
27
+ <div class="workspace-icon item-icon">
28
+ <i class="fa-solid <%= workspace.running ? "fa-folder-open" : "fa-folder" %>" aria-hidden="true"></i>
29
+ </div>
30
+ <div class="col">
31
+ <div class="title">
32
+ <i class="fa-solid fa-circle" aria-hidden="true"></i>
33
+ <span><%= workspace.name || "Workspace" %></span>
34
+ </div>
35
+ <div class="uri"><%= workspace.cwd %></div>
36
+ <% if (details.length) { %>
37
+ <div class="description"><%= details.join(" / ") %></div>
38
+ <% } %>
39
+ <div class="menu-btns">
40
+ <% if (workspace.primaryUrl && shellCount === 1) { %>
41
+ <a class="btn" href="<%= workspace.primaryUrl %>" title="Open terminal"><i class="fa-solid fa-terminal" aria-hidden="true"></i> Terminal</a>
42
+ <% } else if (shellCount > 1) { %>
43
+ <button class="btn" type="button" data-open-workspace="<%= workspace.cwd %>" data-workspace-modal-mode="terminals" title="Open terminals"><i class="fa-solid fa-terminal" aria-hidden="true"></i> Terminals</button>
44
+ <% } %>
45
+ <% if (workspace.launchUrl) { %>
46
+ <button class="btn" type="button" data-open-workspace="<%= workspace.cwd %>" data-workspace-modal-mode="session" title="Start session"><i class="fa-solid fa-play" aria-hidden="true"></i> Start</button>
47
+ <% } %>
48
+ <button class="btn" type="button" data-open-path="<%= workspace.cwd %>" title="Open folder"><i class="fa-solid fa-folder-open" aria-hidden="true"></i> Folder</button>
49
+ <% if (draft && draft.postPath) { %>
50
+ <button class="btn" type="button" data-open-path="<%= draft.postPath %>" title="Open draft"><i class="fa-solid fa-file-lines" aria-hidden="true"></i> Draft</button>
51
+ <% if (draft.excerpt) { %>
52
+ <button class="btn" type="button" data-preview-toggle="<%= draftId %>"><i class="fa-solid fa-eye" aria-hidden="true"></i> Preview</button>
53
+ <% } %>
54
+ <% } %>
55
+ </div>
56
+ <% if (draft && draft.excerpt) { %>
57
+ <div class="workspace-draft-preview" data-preview-panel="<%= draftId %>" hidden><%= draft.excerpt %></div>
58
+ <% } %>
59
+ </div>
60
+ </h3>
61
+ </div>
@@ -3086,5 +3086,11 @@ const reloadMemory = async () => {
3086
3086
  </a>
3087
3087
  </div>
3088
3088
  </div>
3089
+ <script>
3090
+ window.PinokioDraftContext = {
3091
+ cwd: <%- JSON.stringify((typeof cwd !== 'undefined' && cwd) ? cwd : '').replace(/</g, '\\u003c') %>
3092
+ };
3093
+ </script>
3094
+ <script src="/drafts.js"></script>
3089
3095
  </body>
3090
3096
  </html>
@@ -10030,5 +10030,6 @@ body.dark .swal2-popup.pinokio-diff-modal .pinokio-modal-footer--commit .pinokio
10030
10030
  requestAnimationFrame(setViewport)
10031
10031
  })()
10032
10032
  </script>
10033
+ <script src="/drafts.js"></script>
10033
10034
  </body>
10034
10035
  </html>