@aglyn/plugins-marketplace 1.20.1 → 1.20.3
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/package.json +15 -15
- package/src/lib/components/listing-content.component.d.ts +8 -1
- package/src/lib/components/listing-content.component.js +52 -12
- package/src/lib/components/listing-content.component.js.map +1 -1
- package/src/lib/components/listing-detail-page.component.d.ts +6 -0
- package/src/lib/components/listing-detail-page.component.js +24 -4
- package/src/lib/components/listing-detail-page.component.js.map +1 -1
- package/src/lib/components/marketplace-hub.component.js +2 -0
- package/src/lib/components/marketplace-hub.component.js.map +1 -1
- package/src/lib/components/org-plugin-installs-card.component.js +67 -9
- package/src/lib/components/org-plugin-installs-card.component.js.map +1 -1
- package/src/lib/components/org-seller-panel.component.js +14 -4
- package/src/lib/components/org-seller-panel.component.js.map +1 -1
- package/src/lib/components/plugin-reviews-surface.component.js +17 -6
- package/src/lib/components/plugin-reviews-surface.component.js.map +1 -1
- package/src/lib/components/plugin-site-set-panel.component.d.ts +11 -0
- package/src/lib/components/plugin-site-set-panel.component.js +52 -9
- package/src/lib/components/plugin-site-set-panel.component.js.map +1 -1
- package/src/lib/hooks/use-starter-publish-facts.js +5 -1
- package/src/lib/hooks/use-starter-publish-facts.js.map +1 -1
- package/src/lib/model/editor-connections.js +2 -1
- package/src/lib/model/editor-connections.js.map +1 -1
- package/src/lib/model/marketplace-catalog.d.ts +40 -1
- package/src/lib/model/marketplace-catalog.js +46 -2
- package/src/lib/model/marketplace-catalog.js.map +1 -1
- package/src/lib/model/marketplace.d.ts +1 -1
- package/src/lib/model/marketplace.js +1 -1
- package/src/lib/model/marketplace.js.map +1 -1
- package/src/lib/model/starter-publish.d.ts +12 -5
- package/src/lib/model/starter-publish.js +18 -6
- package/src/lib/model/starter-publish.js.map +1 -1
- package/src/lib/server/connect.js +45 -13
- package/src/lib/server/connect.js.map +1 -1
- package/src/lib/server/starter-publish-facts.js +4 -0
- package/src/lib/server/starter-publish-facts.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/plugins-marketplace",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,20 +25,20 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/aglyn": "1.20.
|
|
29
|
-
"@aglyn/aglyn-markdown-editor": "1.20.
|
|
30
|
-
"@aglyn/shared-data-enums": "1.20.
|
|
31
|
-
"@aglyn/shared-data-mdi": "1.20.
|
|
32
|
-
"@aglyn/shared-ui-jsx": "1.20.
|
|
33
|
-
"@aglyn/shared-ui-next": "1.20.
|
|
34
|
-
"@aglyn/shared-ui-snackstack": "1.20.
|
|
35
|
-
"@aglyn/shared-util-email": "1.20.
|
|
36
|
-
"@aglyn/shared-util-http": "1.20.
|
|
37
|
-
"@aglyn/shared-util-timestamp": "1.20.
|
|
38
|
-
"@aglyn/shared-util-tools": "1.20.
|
|
39
|
-
"@aglyn/tenant-data-admin": "1.20.
|
|
40
|
-
"@aglyn/tenant-feature-instance": "1.20.
|
|
41
|
-
"@aglyn/tenant-runtime": "1.20.
|
|
28
|
+
"@aglyn/aglyn": "1.20.3",
|
|
29
|
+
"@aglyn/aglyn-markdown-editor": "1.20.3",
|
|
30
|
+
"@aglyn/shared-data-enums": "1.20.3",
|
|
31
|
+
"@aglyn/shared-data-mdi": "1.20.3",
|
|
32
|
+
"@aglyn/shared-ui-jsx": "1.20.3",
|
|
33
|
+
"@aglyn/shared-ui-next": "1.20.3",
|
|
34
|
+
"@aglyn/shared-ui-snackstack": "1.20.3",
|
|
35
|
+
"@aglyn/shared-util-email": "1.20.3",
|
|
36
|
+
"@aglyn/shared-util-http": "1.20.3",
|
|
37
|
+
"@aglyn/shared-util-timestamp": "1.20.3",
|
|
38
|
+
"@aglyn/shared-util-tools": "1.20.3",
|
|
39
|
+
"@aglyn/tenant-data-admin": "1.20.3",
|
|
40
|
+
"@aglyn/tenant-feature-instance": "1.20.3",
|
|
41
|
+
"@aglyn/tenant-runtime": "1.20.3",
|
|
42
42
|
"@swc/helpers": "0.5.23"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
@@ -47,6 +47,13 @@ export interface MarketplaceListingContentProps {
|
|
|
47
47
|
* installed-sites panel reads.
|
|
48
48
|
*/
|
|
49
49
|
hosts?: ReadonlyArray<OrgInstallHost>;
|
|
50
|
+
/**
|
|
51
|
+
* The workspace, when the surface knows it (AGL-4047): the org-scope hub
|
|
52
|
+
* does. Without it the org is looked up through `hostId`, a one-shot read
|
|
53
|
+
* that settles to "no org" when it fails, and then the org pin is never
|
|
54
|
+
* read and an org-wide install reads as not installed for good.
|
|
55
|
+
*/
|
|
56
|
+
orgId?: string | null;
|
|
50
57
|
}
|
|
51
58
|
/**
|
|
52
59
|
* Marketplace listing detail (AGL-95/419), relocated from the app route —
|
|
@@ -54,5 +61,5 @@ export interface MarketplaceListingContentProps {
|
|
|
54
61
|
* 'marketplaceListing' widget slot. Full description, preview image,
|
|
55
62
|
* version history, publisher block, and the install/buy CTA.
|
|
56
63
|
*/
|
|
57
|
-
export declare function MarketplaceListingContent({ hostId, listingId, permissions, orgScoped, orgSlug: orgSlugProp, hosts, }: MarketplaceListingContentProps): import("react").JSX.Element;
|
|
64
|
+
export declare function MarketplaceListingContent({ hostId, listingId, permissions, orgScoped, orgSlug: orgSlugProp, hosts, orgId: orgIdProp, }: MarketplaceListingContentProps): import("react").JSX.Element;
|
|
58
65
|
export default MarketplaceListingContent;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/ 'use client';
|
|
17
17
|
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
18
18
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
-
import { LISTING_README_MAX_CHARS, listingArtifactType, installsUnreviewedFallback, listingArtifactLabel, listingInclusions, hasLivePurchaseOf, hasOrgLicenceOf, licensedOrgIdsFor, installTargetsFor, isListingDeleted, isPrivateListing, resolveInstallPlan, resolveOrgInstallSummary, resolvePluginInstallState, resolveUninstallTargets, safePublisherHref, safePublisherImageSrc, allExceptInstallKind } from "../model/marketplace.js";
|
|
19
|
+
import { LISTING_README_MAX_CHARS, listingArtifactType, installsUnreviewedFallback, listingArtifactLabel, listingInclusions, hasLivePurchaseOf, hasOrgLicenceOf, licensedOrgIdsFor, installTargetsFor, isListingDeleted, isPrivateListing, installPictureReadPhase, resolveInstallPlan, resolveOrgInstallSummary, resolvePluginInstallState, resolveUninstallTargets, safePublisherHref, safePublisherImageSrc, allExceptInstallKind } from "../model/marketplace.js";
|
|
20
20
|
import { isPublisherMemberElsewhere, landsInPublisherWorkspace, publisherMemberBuyReason } from "../model/own-listing.js";
|
|
21
21
|
import { BlockedControl } from "@aglyn/shared-ui-jsx/components/blocked-control.component";
|
|
22
22
|
import { PrerequisiteNotice } from "@aglyn/shared-ui-jsx/components/prerequisite-notice.component";
|
|
@@ -29,10 +29,10 @@ import { mdiCheckCircle, mdiCheckCircleOutline, mdiEmailOutline, mdiGithub, mdiI
|
|
|
29
29
|
import { AppLink, CardDisplay, GridItems, MdiIcon } from "@aglyn/shared-ui-jsx";
|
|
30
30
|
import { NextPageTitle } from "@aglyn/shared-ui-next/contexts/next-page-title-provider";
|
|
31
31
|
import { useSnackbar } from "@aglyn/shared-ui-snackstack";
|
|
32
|
-
import { Alert, Avatar, Box, Button, Chip, Dialog, DialogActions, DialogContent, DialogTitle, Divider, IconButton, Link as MuiLink, Rating, Stack, Tooltip, Typography } from "@mui/material";
|
|
32
|
+
import { Alert, Avatar, Box, Button, Chip, CircularProgress, Dialog, DialogActions, DialogContent, DialogTitle, Divider, IconButton, Link as MuiLink, Rating, Stack, Tooltip, Typography } from "@mui/material";
|
|
33
33
|
import { collection, doc, documentId, getDoc, limit, orderBy, query, where } from "firebase/firestore";
|
|
34
34
|
import { useEffect, useMemo, useState } from "react";
|
|
35
|
-
import { useConsoleHostRoute, useFirestore, useFirestoreCollection, useFirestoreDoc,
|
|
35
|
+
import { useConsoleHostRoute, useFirestore, useFirestoreCollection, useFirestoreDoc, useHostOrgIdState, useUser, useScopeTokens } from "@aglyn/tenant-feature-instance";
|
|
36
36
|
/*
|
|
37
37
|
* The MODULE, not the barrel, for the two PURE helpers — the specs that render
|
|
38
38
|
* this page mock `@aglyn/tenant-feature-instance` wholesale to stage their
|
|
@@ -396,7 +396,7 @@ export function ListingReadme({ readme }) {
|
|
|
396
396
|
* the app keeps the Dashboard chrome and renders this through the
|
|
397
397
|
* 'marketplaceListing' widget slot. Full description, preview image,
|
|
398
398
|
* version history, publisher block, and the install/buy CTA.
|
|
399
|
-
*/ export function MarketplaceListingContent({ hostId, listingId, permissions, orgScoped, orgSlug: orgSlugProp, hosts }) {
|
|
399
|
+
*/ export function MarketplaceListingContent({ hostId, listingId, permissions, orgScoped, orgSlug: orgSlugProp, hosts, orgId: orgIdProp }) {
|
|
400
400
|
var _ref, _ref1, _pluginState_scope, _ref2, _ref3, _ref4, _listing_ratingAverage, _listing_ratingAverage1, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20;
|
|
401
401
|
var _componentInstall_marketplace, _profile_displayName;
|
|
402
402
|
// The publisher link was `/{hostDocId}/marketplace/publisher/{id}` — the
|
|
@@ -413,7 +413,8 @@ export function ListingReadme({ readme }) {
|
|
|
413
413
|
// ORGANIZATION, so `buy` has to name the workspace it is buying for rather
|
|
414
414
|
// than let the server infer it from whichever site the surface happens to
|
|
415
415
|
// be acting through.
|
|
416
|
-
const
|
|
416
|
+
const hostOrg = useHostOrgIdState(orgIdProp ? undefined : hostId);
|
|
417
|
+
const orgId = orgIdProp || hostOrg.orgId;
|
|
417
418
|
const { install, installPlan, buy, uninstall, payPanel, buying } = useMarketplaceActions(hostId, orgId, orgSlug ? buildRoute(Route.MANAGE_BILLING, {
|
|
418
419
|
orgSlug
|
|
419
420
|
}) : null);
|
|
@@ -534,17 +535,18 @@ export function ListingReadme({ readme }) {
|
|
|
534
535
|
// `components` above never sees either, so an installed plugin read as
|
|
535
536
|
// "not installed" here; the two pins tell the honest story, host over org.
|
|
536
537
|
// (`orgId` is resolved above, where `buy` needs it.)
|
|
537
|
-
const
|
|
538
|
+
const hostPinRead = useFirestoreDoc(()=>doc(firestore, 'hosts', hostId, 'installs', listingId || '-missing-'), [
|
|
538
539
|
firestore,
|
|
539
540
|
hostId,
|
|
540
541
|
listingId
|
|
541
542
|
], {
|
|
542
543
|
idField: '$id'
|
|
543
544
|
});
|
|
545
|
+
const hostPin = hostPinRead.data;
|
|
544
546
|
// Held at null while `useHostOrgId` is in flight, never `orgs/-pending-`
|
|
545
547
|
// (AGL-1440): installs are member-gated, so the sentinel was a
|
|
546
548
|
// guaranteed-denied listen on every listing view.
|
|
547
|
-
const
|
|
549
|
+
const orgPinRead = useFirestoreDoc(()=>orgId && listingId ? doc(firestore, 'orgs', orgId, 'installs', listingId) : null, [
|
|
548
550
|
firestore,
|
|
549
551
|
orgId,
|
|
550
552
|
listingId
|
|
@@ -559,10 +561,14 @@ export function ListingReadme({ readme }) {
|
|
|
559
561
|
// query would need an index plus a rules audit to read other orgs' pins
|
|
560
562
|
// it must never see. `pinsNonce` re-reads after this page's own writes,
|
|
561
563
|
// which are the only thing that changes these docs while it is open.
|
|
564
|
+
const orgPin = orgPinRead.data;
|
|
562
565
|
const [sitePins, setSitePins] = useState({});
|
|
563
566
|
const [pinsNonce, setPinsNonce] = useState(0);
|
|
564
567
|
const hostIdsKey = (hosts != null ? hosts : []).map((host)=>host.id).join('|');
|
|
568
|
+
/** The site set the pins answer for, or that reading them failed (AGL-4047). */ const [sitePinsFor, setSitePinsFor] = useState(null);
|
|
569
|
+
const [sitePinsFailed, setSitePinsFailed] = useState(false);
|
|
565
570
|
useEffect(()=>{
|
|
571
|
+
setSitePinsFailed(false);
|
|
566
572
|
if (!orgScoped || !listingId || !(hosts == null ? void 0 : hosts.length)) return;
|
|
567
573
|
let active = true;
|
|
568
574
|
void Promise.all(hosts.map(async (host)=>{
|
|
@@ -572,8 +578,12 @@ export function ListingReadme({ readme }) {
|
|
|
572
578
|
snapshot.exists() ? snapshot.data() : null
|
|
573
579
|
];
|
|
574
580
|
})).then((entries)=>{
|
|
575
|
-
if (active)
|
|
576
|
-
|
|
581
|
+
if (!active) return;
|
|
582
|
+
setSitePins(Object.fromEntries(entries));
|
|
583
|
+
setSitePinsFor(`${listingId}:${hostIdsKey}`);
|
|
584
|
+
}).catch(()=>{
|
|
585
|
+
if (active) setSitePinsFailed(true);
|
|
586
|
+
});
|
|
577
587
|
return ()=>{
|
|
578
588
|
active = false;
|
|
579
589
|
};
|
|
@@ -1027,6 +1037,16 @@ export function ListingReadme({ readme }) {
|
|
|
1027
1037
|
orgPin,
|
|
1028
1038
|
listingId
|
|
1029
1039
|
]);
|
|
1040
|
+
/**
|
|
1041
|
+
* Whether the install card may state anything yet (AGL-4047). "Install"
|
|
1042
|
+
* and its targeting picker are a verdict, "not installed anywhere", that
|
|
1043
|
+
* rests on ABSENT pins, so it waits for the org pin's server answer and
|
|
1044
|
+
* every site's pin. Listed: this page offered Install to an org-wide
|
|
1045
|
+
* install while the pins loaded.
|
|
1046
|
+
*/ const pinsPhase = !isPlugin ? 'ready' : installPictureReadPhase({
|
|
1047
|
+
orgPin: !listingId ? null : orgId ? orgPinRead : orgIdProp || !hostOrg.loaded ? 'pending' : null,
|
|
1048
|
+
sitePins: orgTargeting ? sitePinsFailed ? 'failed' : sitePinsFor === `${listingId}:${hostIdsKey}` ? 'answered' : 'loading' : !hostPinRead.data && (hostPinRead.status === 'loading' || hostPinRead.fromCache === true) ? 'loading' : 'answered'
|
|
1049
|
+
});
|
|
1030
1050
|
/** Run a pin write, then re-read every site's pin. */ const runSiteEdit = async (work)=>{
|
|
1031
1051
|
try {
|
|
1032
1052
|
await work();
|
|
@@ -1448,7 +1468,27 @@ export function ListingReadme({ readme }) {
|
|
|
1448
1468
|
variant: "outlined",
|
|
1449
1469
|
children: updateStateLabel(updateStatus)
|
|
1450
1470
|
}) : null,
|
|
1451
|
-
|
|
1471
|
+
pinsPhase === 'loading' ? /*#__PURE__*/ _jsxs(Stack, {
|
|
1472
|
+
direction: "row",
|
|
1473
|
+
spacing: 1,
|
|
1474
|
+
sx: {
|
|
1475
|
+
alignItems: 'center'
|
|
1476
|
+
},
|
|
1477
|
+
children: [
|
|
1478
|
+
/*#__PURE__*/ _jsx(CircularProgress, {
|
|
1479
|
+
size: 16
|
|
1480
|
+
}),
|
|
1481
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
1482
|
+
variant: "body2",
|
|
1483
|
+
color: "text.secondary",
|
|
1484
|
+
children: 'Loading where it is installed…'
|
|
1485
|
+
})
|
|
1486
|
+
]
|
|
1487
|
+
}) : pinsPhase === 'error' ? /*#__PURE__*/ _jsx(Alert, {
|
|
1488
|
+
severity: "warning",
|
|
1489
|
+
children: 'Could not load where this plugin is installed. ' + 'Reload the page to try again.'
|
|
1490
|
+
}) : null,
|
|
1491
|
+
orgPluginScope && pinsPhase === 'ready' ? /*#__PURE__*/ _jsx(PluginSiteSet, {
|
|
1452
1492
|
listing: listing,
|
|
1453
1493
|
hosts: hosts != null ? hosts : [],
|
|
1454
1494
|
orgInstall: orgInstall,
|
|
@@ -1484,7 +1524,7 @@ export function ListingReadme({ readme }) {
|
|
|
1484
1524
|
]
|
|
1485
1525
|
})
|
|
1486
1526
|
}) : null,
|
|
1487
|
-
orgTargeting && !installed && !(orgPluginScope && orgInstall.installedAnywhere) ? /*#__PURE__*/ _jsxs(Stack, {
|
|
1527
|
+
pinsPhase !== 'ready' ? null : orgTargeting && !installed && !(orgPluginScope && orgInstall.installedAnywhere) ? /*#__PURE__*/ _jsxs(Stack, {
|
|
1488
1528
|
spacing: 1,
|
|
1489
1529
|
sx: {
|
|
1490
1530
|
maxWidth: 420
|
|
@@ -1546,7 +1586,7 @@ export function ListingReadme({ readme }) {
|
|
|
1546
1586
|
}) : null,
|
|
1547
1587
|
/*#__PURE__*/ _jsxs(Box, {
|
|
1548
1588
|
sx: {
|
|
1549
|
-
display: orgPluginScope && orgInstall.installedAnywhere ? 'none' : undefined
|
|
1589
|
+
display: pinsPhase !== 'ready' || orgPluginScope && orgInstall.installedAnywhere ? 'none' : undefined
|
|
1550
1590
|
},
|
|
1551
1591
|
children: [
|
|
1552
1592
|
/*#__PURE__*/ _jsx(BlockedControl, {
|