@peers-app/peers-ui 0.33.13 → 0.33.14
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/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/mentions/mention-chip.d.ts +1 -1
- package/dist/mentions/mention-chip.js +2 -1
- package/dist/theme.css +32 -0
- package/dist/ui-contracts/host-ui-contract.d.ts +28 -0
- package/dist/ui-contracts/host-ui-contract.js +45 -0
- package/dist/ui-contracts/implement-piece.d.ts +24 -0
- package/dist/ui-contracts/implement-piece.js +44 -0
- package/dist/ui-contracts/index.d.ts +6 -0
- package/dist/ui-contracts/index.js +17 -0
- package/dist/ui-contracts/mock-piece.d.ts +36 -0
- package/dist/ui-contracts/mock-piece.js +56 -0
- package/dist/ui-contracts/piece-host.d.ts +99 -0
- package/dist/ui-contracts/piece-host.js +266 -0
- package/dist/ui-contracts/piece-resolution.d.ts +55 -0
- package/dist/ui-contracts/piece-resolution.js +186 -0
- package/dist/ui-contracts/piece.d.ts +77 -0
- package/dist/ui-contracts/piece.js +358 -0
- package/dist/ui-contracts/popover-surface.d.ts +21 -0
- package/dist/ui-contracts/popover-surface.js +169 -0
- package/dist/ui-contracts/types.d.ts +113 -0
- package/dist/ui-contracts/types.js +2 -0
- package/dist/ui-router/ui-loader.js +9 -3
- package/package.json +3 -3
|
@@ -45,6 +45,7 @@ const hooks_1 = require("../hooks");
|
|
|
45
45
|
const package_waiting_1 = require("../screens/packages/package-waiting");
|
|
46
46
|
const packages_ipc_1 = require("../screens/packages/packages-ipc");
|
|
47
47
|
require("../ui-defaults");
|
|
48
|
+
const piece_host_1 = require("../ui-contracts/piece-host");
|
|
48
49
|
const bundle_files_1 = require("./bundle-files");
|
|
49
50
|
const find_route_1 = require("./find-route");
|
|
50
51
|
const routes_loader_1 = require("./routes-loader");
|
|
@@ -157,7 +158,9 @@ async function readUIBundle(pkg, servingPackageVersionId) {
|
|
|
157
158
|
if (bundleCode && selected.dataContext.groupId) {
|
|
158
159
|
(0, peers_sdk_1.assertPackageBundleIntegrity)(selected.pv, "ui", bundleCode);
|
|
159
160
|
}
|
|
160
|
-
return bundleCode
|
|
161
|
+
return bundleCode
|
|
162
|
+
? { code: bundleCode, packageVersionId: selected.pv.packageVersionId, uiBundleFileId }
|
|
163
|
+
: undefined;
|
|
161
164
|
}
|
|
162
165
|
/**
|
|
163
166
|
* Run a package's UI bundle once per version, registering its UIs. A load for another version, or
|
|
@@ -179,16 +182,19 @@ function loadUIBundle(pkg, opts) {
|
|
|
179
182
|
const load = { serving, promise: Promise.resolve(), done: false };
|
|
180
183
|
load.promise = (async () => {
|
|
181
184
|
try {
|
|
182
|
-
const
|
|
185
|
+
const read = await (opts.read ?? readUIBundle(pkg, opts.servingPackageVersionId));
|
|
186
|
+
const bundleCode = read?.code;
|
|
183
187
|
// A newer load (another version, or a reload) took this one's place: settle with it.
|
|
184
188
|
const latest = uiLoads[pkg.packageId];
|
|
185
189
|
if (latest !== load)
|
|
186
190
|
return latest.promise;
|
|
187
|
-
if (bundleCode) {
|
|
191
|
+
if (read && bundleCode) {
|
|
188
192
|
const exportUIs = (peerUIs) => {
|
|
189
193
|
peerUIs?.uis?.forEach((ui) => {
|
|
190
194
|
peersUIs[ui.peersUIId] = ui;
|
|
191
195
|
});
|
|
196
|
+
// Its UI contracts' pieces too, so a piece of this version doesn't run it again.
|
|
197
|
+
(0, piece_host_1.recordLoadedPieces)(read.packageVersionId, read.uiBundleFileId, peerUIs);
|
|
192
198
|
};
|
|
193
199
|
const bundleFunction = new Function("exportUIs", bundleCode);
|
|
194
200
|
await bundleFunction(exportUIs);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peers-app/peers-ui",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.14",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/peers-app/peers-ui.git"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"lint:fix": "biome check --write ."
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@peers-app/peers-sdk": "^0.33.
|
|
39
|
+
"@peers-app/peers-sdk": "^0.33.14",
|
|
40
40
|
"bootstrap": "^5.3.3",
|
|
41
41
|
"react": "^18.0.0",
|
|
42
42
|
"react-dom": "^18.0.0"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@babel/preset-react": "^7.24.1",
|
|
48
48
|
"@babel/preset-typescript": "^7.27.1",
|
|
49
49
|
"@biomejs/biome": "2.3.11",
|
|
50
|
-
"@peers-app/peers-sdk": "0.33.
|
|
50
|
+
"@peers-app/peers-sdk": "0.33.14",
|
|
51
51
|
"@testing-library/dom": "^10.4.0",
|
|
52
52
|
"@testing-library/jest-dom": "^6.6.3",
|
|
53
53
|
"@testing-library/react": "^16.3.0",
|