@peers-app/peers-ui 0.33.8 → 0.33.11
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/apps-home/app-menu.d.ts +55 -0
- package/dist/apps-home/app-menu.js +126 -0
- package/dist/apps-home/app-status.d.ts +34 -0
- package/dist/apps-home/app-status.js +85 -0
- package/dist/apps-home/app-tile.d.ts +33 -0
- package/dist/apps-home/app-tile.js +106 -0
- package/dist/apps-home/apps-home.d.ts +29 -0
- package/dist/apps-home/apps-home.js +311 -0
- package/dist/apps-home/get-apps-sheet.d.ts +52 -0
- package/dist/apps-home/get-apps-sheet.js +130 -0
- package/dist/apps-home/pinned-apps.d.ts +73 -0
- package/dist/apps-home/pinned-apps.js +213 -0
- package/dist/apps-home/remove-app-dialog.d.ts +20 -0
- package/dist/apps-home/remove-app-dialog.js +62 -0
- package/dist/command-palette/command-palette-ui.js +2 -33
- package/dist/root-layout/root-layout-host.js +0 -1
- package/dist/screens/search/global-search.js +2 -33
- package/dist/tabs-layout/tabs-layout.js +2 -127
- package/dist/tabs-layout/tabs-state.d.ts +7 -10
- package/dist/tabs-layout/tabs-state.js +8 -63
- package/dist/theme.css +797 -0
- package/dist/ui-router/app-catalog.d.ts +55 -0
- package/dist/ui-router/app-catalog.js +74 -0
- package/package.json +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.switchToPreviousTab = exports.switchToNextTab = exports.closeCurrentTab = exports.openNewTab = exports.setSingleTabMode = exports.updateActiveTabTitle = exports.handleMainPathChanged = exports.initializedTabs = exports.
|
|
3
|
+
exports.switchToPreviousTab = exports.switchToNextTab = exports.closeCurrentTab = exports.openNewTab = exports.setSingleTabMode = exports.updateActiveTabTitle = exports.handleMainPathChanged = exports.initializedTabs = exports.activeTabId = exports.activeTabs = exports.launcherApp = void 0;
|
|
4
4
|
exports.navigateTo = navigateTo;
|
|
5
5
|
exports.goToTabPath = goToTabPath;
|
|
6
|
+
exports.isRemovedAppRoute = isRemovedAppRoute;
|
|
6
7
|
exports.restoreNavigationState = restoreNavigationState;
|
|
7
|
-
exports.migrateRecentPath = migrateRecentPath;
|
|
8
8
|
exports.determineAppFromPath = determineAppFromPath;
|
|
9
9
|
const peers_sdk_1 = require("@peers-app/peers-sdk");
|
|
10
10
|
const globals_1 = require("../globals");
|
|
@@ -26,9 +26,6 @@ const _persistentActiveTabs = (0, peers_sdk_1.groupDeviceVar)("activeTabs", {
|
|
|
26
26
|
const _persistentActiveTabId = (0, peers_sdk_1.groupDeviceVar)("activeTabId", {
|
|
27
27
|
defaultValue: "launcher",
|
|
28
28
|
});
|
|
29
|
-
const _persistentRecentlyUsedApps = (0, peers_sdk_1.groupUserVar)("recentlyUsedApps", {
|
|
30
|
-
defaultValue: [],
|
|
31
|
-
});
|
|
32
29
|
let finishNavigationRestore = () => { };
|
|
33
30
|
const navigationReady = new Promise((resolve) => {
|
|
34
31
|
finishNavigationRestore = resolve;
|
|
@@ -52,26 +49,15 @@ exports.activeTabId = (() => {
|
|
|
52
49
|
});
|
|
53
50
|
return Object.assign(obs, { loadingPromise: navigationReady });
|
|
54
51
|
})();
|
|
55
|
-
/** App roots recently opened from the launcher, newest first. */
|
|
56
|
-
exports.recentlyUsedApps = (() => {
|
|
57
|
-
const obs = (0, peers_sdk_1.observable)([]);
|
|
58
|
-
// Write-through to persistent var on change
|
|
59
|
-
obs.subscribe((value) => {
|
|
60
|
-
_persistentRecentlyUsedApps(value);
|
|
61
|
-
});
|
|
62
|
-
return Object.assign(obs, { loadingPromise: navigationReady });
|
|
63
|
-
})();
|
|
64
52
|
void Promise.all([
|
|
65
53
|
_persistentActiveTabs.loadingPromise,
|
|
66
54
|
_persistentActiveTabId.loadingPromise,
|
|
67
|
-
_persistentRecentlyUsedApps.loadingPromise,
|
|
68
55
|
]).then(() => {
|
|
69
56
|
const restored = restoreNavigationState(_persistentActiveTabs(), _persistentActiveTabId());
|
|
70
57
|
(0, exports.activeTabs)(restored.tabs);
|
|
71
58
|
if ((0, exports.activeTabId)() !== restored.activeId) {
|
|
72
59
|
(0, exports.activeTabId)(restored.activeId);
|
|
73
60
|
}
|
|
74
|
-
(0, exports.recentlyUsedApps)(migrateRecentPaths(_persistentRecentlyUsedApps()));
|
|
75
61
|
finishNavigationRestore();
|
|
76
62
|
});
|
|
77
63
|
/** Tab ids whose bodies have been mounted at least once. */
|
|
@@ -103,7 +89,6 @@ function navigateTo(rawPath, options) {
|
|
|
103
89
|
if ((0, exports.activeTabId)() !== existing.tabId) {
|
|
104
90
|
(0, exports.activeTabId)(existing.tabId);
|
|
105
91
|
}
|
|
106
|
-
rememberRecentApp(existing.path);
|
|
107
92
|
return;
|
|
108
93
|
}
|
|
109
94
|
}
|
|
@@ -152,6 +137,12 @@ const handleMainPathChanged = (_oldPath, newPath, _setNewMainPath) => {
|
|
|
152
137
|
exports.handleMainPathChanged = handleMainPathChanged;
|
|
153
138
|
/** Routes of the built-in Threads, Assistants, and Workflows apps, which Peers no longer has. */
|
|
154
139
|
const REMOVED_APP_ROUTE = /^(threads|channel|assistants|workflows)(\/|$)/;
|
|
140
|
+
/**
|
|
141
|
+
* Whether a route belonged to a built-in app Peers no longer has (Threads, Assistants,
|
|
142
|
+
* Workflows).
|
|
143
|
+
*
|
|
144
|
+
* @param path - A route, with or without a query string.
|
|
145
|
+
*/
|
|
155
146
|
function isRemovedAppRoute(path) {
|
|
156
147
|
return REMOVED_APP_ROUTE.test((0, identity_routes_1.parseRoute)(path).pathname.toLowerCase());
|
|
157
148
|
}
|
|
@@ -175,18 +166,6 @@ function restoreNavigationState(tabs, activeId) {
|
|
|
175
166
|
activeId: activeExists ? merged.activeId : merged.tabs[0].tabId,
|
|
176
167
|
};
|
|
177
168
|
}
|
|
178
|
-
/**
|
|
179
|
-
* Map a stored recent-app path onto the current app root.
|
|
180
|
-
*
|
|
181
|
-
* @param path - Persisted recent path, possibly a legacy alias.
|
|
182
|
-
*/
|
|
183
|
-
function migrateRecentPath(path) {
|
|
184
|
-
const canonical = (0, identity_routes_1.canonicalizeRoute)(path);
|
|
185
|
-
if ((0, identity_routes_1.isIdentityPath)(canonical)) {
|
|
186
|
-
return identity_routes_1.IDENTITY_APP_PATH;
|
|
187
|
-
}
|
|
188
|
-
return canonical;
|
|
189
|
-
}
|
|
190
169
|
/**
|
|
191
170
|
* Resolve the app that owns a route.
|
|
192
171
|
*
|
|
@@ -298,7 +277,6 @@ function showTab(tabId, path) {
|
|
|
298
277
|
else if ((0, globals_1._mainContentPath)() !== path) {
|
|
299
278
|
(0, globals_1._mainContentPath)(path);
|
|
300
279
|
}
|
|
301
|
-
rememberRecentApp(path);
|
|
302
280
|
}
|
|
303
281
|
function openUnresolved(path) {
|
|
304
282
|
const current = (0, exports.activeTabs)().find((tab) => tab.tabId === (0, exports.activeTabId)());
|
|
@@ -313,23 +291,6 @@ function openUnresolved(path) {
|
|
|
313
291
|
iconClassName: "bi-question-circle",
|
|
314
292
|
});
|
|
315
293
|
}
|
|
316
|
-
function rememberRecentApp(path) {
|
|
317
|
-
const app = determineAppFromPath((0, identity_routes_1.canonicalizeRoute)(path));
|
|
318
|
-
if (!app || app.package.packageId === "launcher") {
|
|
319
|
-
return;
|
|
320
|
-
}
|
|
321
|
-
const recentPath = app.package.packageId === system_apps_1.systemPackage.packageId ? app.navItem.navigationPath || path : path;
|
|
322
|
-
if (!recentPath) {
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
|
-
const recent = (0, exports.recentlyUsedApps)();
|
|
326
|
-
const filtered = recent.filter((entry) => entry !== recentPath);
|
|
327
|
-
const next = [recentPath, ...filtered].slice(0, 8);
|
|
328
|
-
if (next.length === recent.length && next.every((entry, index) => entry === recent[index])) {
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
(0, exports.recentlyUsedApps)(next);
|
|
332
|
-
}
|
|
333
294
|
function migrateStoredTab(tab) {
|
|
334
295
|
const path = (0, identity_routes_1.canonicalizeRoute)(tab.path);
|
|
335
296
|
if (path === tab.path) {
|
|
@@ -357,19 +318,6 @@ function mergeIdentityTabs(tabs, activeId) {
|
|
|
357
318
|
activeId: remove.has(activeId) ? keeper.tabId : activeId,
|
|
358
319
|
};
|
|
359
320
|
}
|
|
360
|
-
function migrateRecentPaths(paths) {
|
|
361
|
-
const seen = new Set();
|
|
362
|
-
const next = [];
|
|
363
|
-
for (const path of paths) {
|
|
364
|
-
const migrated = migrateRecentPath(path);
|
|
365
|
-
if (!migrated || seen.has(migrated) || isRemovedAppRoute(migrated)) {
|
|
366
|
-
continue;
|
|
367
|
-
}
|
|
368
|
-
seen.add(migrated);
|
|
369
|
-
next.push(migrated);
|
|
370
|
-
}
|
|
371
|
-
return next.slice(0, 8);
|
|
372
|
-
}
|
|
373
321
|
/**
|
|
374
322
|
* Set the active tab's title.
|
|
375
323
|
*
|
|
@@ -442,9 +390,6 @@ const openNewTab = (tab, forceNew = false) => {
|
|
|
442
390
|
(0, exports.activeTabs)([...currentTabs, newTab]);
|
|
443
391
|
(0, exports.activeTabId)(newTab.tabId);
|
|
444
392
|
}
|
|
445
|
-
if (tab.path && tab.packageId !== "launcher") {
|
|
446
|
-
rememberRecentApp(tab.path);
|
|
447
|
-
}
|
|
448
393
|
};
|
|
449
394
|
exports.openNewTab = openNewTab;
|
|
450
395
|
/** Close the active tab. The launcher tab stays open. */
|