@aglyn/plugins-marketplace 1.0.0-beta.249 → 1.0.0-beta.252
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/plugins-marketplace",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.252",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/aglyn": "1.0.0-beta.
|
|
29
|
-
"@aglyn/aglyn-markdown-editor": "1.0.0-beta.
|
|
30
|
-
"@aglyn/shared-data-enums": "1.0.0-beta.
|
|
31
|
-
"@aglyn/shared-data-mdi": "1.0.0-beta.
|
|
32
|
-
"@aglyn/shared-ui-jsx": "1.0.0-beta.
|
|
33
|
-
"@aglyn/shared-ui-next": "1.0.0-beta.
|
|
34
|
-
"@aglyn/shared-ui-snackstack": "1.0.0-beta.
|
|
35
|
-
"@aglyn/shared-util-email": "1.0.0-beta.
|
|
36
|
-
"@aglyn/shared-util-http": "1.0.0-beta.
|
|
37
|
-
"@aglyn/shared-util-timestamp": "1.0.0-beta.
|
|
38
|
-
"@aglyn/tenant-data-admin": "1.0.0-beta.
|
|
39
|
-
"@aglyn/tenant-feature-instance": "1.0.0-beta.
|
|
40
|
-
"@aglyn/tenant-runtime": "1.0.0-beta.
|
|
28
|
+
"@aglyn/aglyn": "1.0.0-beta.252",
|
|
29
|
+
"@aglyn/aglyn-markdown-editor": "1.0.0-beta.252",
|
|
30
|
+
"@aglyn/shared-data-enums": "1.0.0-beta.252",
|
|
31
|
+
"@aglyn/shared-data-mdi": "1.0.0-beta.252",
|
|
32
|
+
"@aglyn/shared-ui-jsx": "1.0.0-beta.252",
|
|
33
|
+
"@aglyn/shared-ui-next": "1.0.0-beta.252",
|
|
34
|
+
"@aglyn/shared-ui-snackstack": "1.0.0-beta.252",
|
|
35
|
+
"@aglyn/shared-util-email": "1.0.0-beta.252",
|
|
36
|
+
"@aglyn/shared-util-http": "1.0.0-beta.252",
|
|
37
|
+
"@aglyn/shared-util-timestamp": "1.0.0-beta.252",
|
|
38
|
+
"@aglyn/tenant-data-admin": "1.0.0-beta.252",
|
|
39
|
+
"@aglyn/tenant-feature-instance": "1.0.0-beta.252",
|
|
40
|
+
"@aglyn/tenant-runtime": "1.0.0-beta.252",
|
|
41
41
|
"@swc/helpers": "0.5.23"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
@@ -93,23 +93,28 @@ import PluginSiteSet from "./plugin-site-set.component.js";
|
|
|
93
93
|
orgPin
|
|
94
94
|
]);
|
|
95
95
|
// The listing doc the actions need. The pin carries the denormalised copy
|
|
96
|
-
// the actions actually read (`$id`, `displayName`), so this page
|
|
97
|
-
// pay for a second read of the listing itself.
|
|
96
|
+
// the actions actually read (`$id`, `displayName`, `pluginId`), so this page
|
|
97
|
+
// does not pay for a second read of the listing itself. `pluginId` is what
|
|
98
|
+
// the uninstall dialog scans published pages by; without it the impact is
|
|
99
|
+
// unknown and every uninstall asks for the typed acknowledgement.
|
|
98
100
|
const anyPin = (_ref = orgPin != null ? orgPin : Object.values(sitePins).find(Boolean)) != null ? _ref : null;
|
|
99
101
|
const actionListing = useMemo(()=>{
|
|
100
|
-
var _ref, _ref1, _ref2;
|
|
102
|
+
var _ref, _ref1, _ref2, _ref3;
|
|
101
103
|
return {
|
|
102
104
|
$id: listingId,
|
|
103
105
|
displayName: (_ref = (_ref1 = listing == null ? void 0 : listing.displayName) != null ? _ref1 : anyPin == null ? void 0 : anyPin.displayName) != null ? _ref : listingId,
|
|
104
106
|
artifactType: 'plugin',
|
|
105
|
-
latestVersion: (_ref2 = listing == null ? void 0 : listing.latestVersion) != null ? _ref2 : anyPin == null ? void 0 : anyPin.version
|
|
107
|
+
latestVersion: (_ref2 = listing == null ? void 0 : listing.latestVersion) != null ? _ref2 : anyPin == null ? void 0 : anyPin.version,
|
|
108
|
+
pluginId: (_ref3 = listing == null ? void 0 : listing.pluginId) != null ? _ref3 : anyPin == null ? void 0 : anyPin.pluginId
|
|
106
109
|
};
|
|
107
110
|
}, [
|
|
108
111
|
listingId,
|
|
109
112
|
listing == null ? void 0 : listing.displayName,
|
|
110
113
|
listing == null ? void 0 : listing.latestVersion,
|
|
114
|
+
listing == null ? void 0 : listing.pluginId,
|
|
111
115
|
anyPin == null ? void 0 : anyPin.displayName,
|
|
112
|
-
anyPin == null ? void 0 : anyPin.version
|
|
116
|
+
anyPin == null ? void 0 : anyPin.version,
|
|
117
|
+
anyPin == null ? void 0 : anyPin.pluginId
|
|
113
118
|
]);
|
|
114
119
|
if (!orgInstall.installedAnywhere) {
|
|
115
120
|
return /*#__PURE__*/ _jsx(Typography, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/marketplace/src/lib/components/plugin-site-set-panel.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport { Typography } from '@mui/material'\nimport { doc, getDoc } from 'firebase/firestore'\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useFirestore,\n useFirestoreDoc,\n useHostOrgId,\n} from '@aglyn/tenant-feature-instance'\nimport { offeredPluginVersion } from '@aglyn/aglyn'\nimport { resolveOrgInstallSummary } from '../model/marketplace'\nimport { useMarketplaceActions } from '../hooks/use-marketplace-actions'\nimport PluginSiteSet from './plugin-site-set.component'\n\nexport interface PluginSiteSetPanelProps {\n /** Acting site — org pins still resolve their org through one. */\n hostId: string\n listingId: string\n hosts?: ReadonlyArray<{ id: string; label: string }>\n}\n\n/**\n * The `pluginSiteSet` slot (AGL-1007): the site-set control as something the\n * console can drop onto the installation detail page without importing this\n * plugin.\n *\n * It reads its own pins rather than taking them as props, because the page\n * that hosts it has no other use for them — unlike the listing page, which\n * also gates its pre-install picker and primary button on the same state and\n * therefore keeps ownership of it there.\n */\nexport function PluginSiteSetPanel(props: PluginSiteSetPanelProps) {\n const { hostId, listingId, hosts } = props\n const firestore = useFirestore()\n const orgId = useHostOrgId(hostId)\n const { installPlan, uninstall } = useMarketplaceActions(hostId)\n\n // Held at null while `useHostOrgId` is in flight, never `orgs/-pending-`\n // (AGL-1440): installs are member-gated, so the sentinel was a\n // guaranteed-denied listen on every mount of this panel.\n const { data: orgPin } = useFirestoreDoc<any>(\n () =>\n orgId && listingId\n ? doc(firestore, 'orgs', orgId, 'installs', listingId)\n : null,\n [firestore, orgId, listingId],\n )\n const [sitePins, setSitePins] = useState<Record<string, any>>({})\n const [pinsNonce, setPinsNonce] = useState(0)\n const hostIdsKey = (hosts ?? []).map((host) => host.id).join('|')\n useEffect(() => {\n if (!listingId || !hosts?.length) return\n let active = true\n void Promise.all(\n hosts.map(async (host) => {\n const snapshot = await getDoc(\n doc(firestore, 'hosts', host.id, 'installs', listingId),\n )\n return [host.id, snapshot.exists() ? snapshot.data() : null] as const\n }),\n )\n .then((entries) => {\n if (active) setSitePins(Object.fromEntries(entries))\n })\n .catch(() => undefined)\n return () => {\n active = false\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [firestore, listingId, hostIdsKey, pinsNonce])\n\n // The listing, for the version actually on offer (AGL-1017). This used to\n // pass a PIN's own version as `latestVersion`, which is by definition the\n // version that pin is already at — so no site ever looked stale and the\n // update control never appeared on this page at all.\n const { data: listing } = useFirestoreDoc<any>(\n () => doc(firestore, 'marketplaceListings', listingId || '-missing-'),\n [firestore, listingId],\n )\n\n // The kill switch (AGL-2368). This panel offers an UPDATE, so it is asking\n // \"what installs today\" and had only the review-verdict mirror to ask —\n // which nothing cleared on revoke, so it offered a version the install\n // route refuses. Listing-scoped and public, one read for the panel.\n const { data: revocation } = useFirestoreDoc<any>(\n () =>\n listingId ? doc(firestore, 'revocations', listingId) : null,\n [firestore, listingId],\n )\n\n const orgInstall = useMemo(\n () => resolveOrgInstallSummary(hosts ?? [], sitePins, orgPin ?? null),\n [hosts, sitePins, orgPin],\n )\n // The listing doc the actions need. The pin carries the denormalised copy\n // the actions actually read (`$id`, `displayName`), so this page
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/marketplace/src/lib/components/plugin-site-set-panel.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport { Typography } from '@mui/material'\nimport { doc, getDoc } from 'firebase/firestore'\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useFirestore,\n useFirestoreDoc,\n useHostOrgId,\n} from '@aglyn/tenant-feature-instance'\nimport { offeredPluginVersion } from '@aglyn/aglyn'\nimport { resolveOrgInstallSummary } from '../model/marketplace'\nimport { useMarketplaceActions } from '../hooks/use-marketplace-actions'\nimport PluginSiteSet from './plugin-site-set.component'\n\nexport interface PluginSiteSetPanelProps {\n /** Acting site — org pins still resolve their org through one. */\n hostId: string\n listingId: string\n hosts?: ReadonlyArray<{ id: string; label: string }>\n}\n\n/**\n * The `pluginSiteSet` slot (AGL-1007): the site-set control as something the\n * console can drop onto the installation detail page without importing this\n * plugin.\n *\n * It reads its own pins rather than taking them as props, because the page\n * that hosts it has no other use for them — unlike the listing page, which\n * also gates its pre-install picker and primary button on the same state and\n * therefore keeps ownership of it there.\n */\nexport function PluginSiteSetPanel(props: PluginSiteSetPanelProps) {\n const { hostId, listingId, hosts } = props\n const firestore = useFirestore()\n const orgId = useHostOrgId(hostId)\n const { installPlan, uninstall } = useMarketplaceActions(hostId)\n\n // Held at null while `useHostOrgId` is in flight, never `orgs/-pending-`\n // (AGL-1440): installs are member-gated, so the sentinel was a\n // guaranteed-denied listen on every mount of this panel.\n const { data: orgPin } = useFirestoreDoc<any>(\n () =>\n orgId && listingId\n ? doc(firestore, 'orgs', orgId, 'installs', listingId)\n : null,\n [firestore, orgId, listingId],\n )\n const [sitePins, setSitePins] = useState<Record<string, any>>({})\n const [pinsNonce, setPinsNonce] = useState(0)\n const hostIdsKey = (hosts ?? []).map((host) => host.id).join('|')\n useEffect(() => {\n if (!listingId || !hosts?.length) return\n let active = true\n void Promise.all(\n hosts.map(async (host) => {\n const snapshot = await getDoc(\n doc(firestore, 'hosts', host.id, 'installs', listingId),\n )\n return [host.id, snapshot.exists() ? snapshot.data() : null] as const\n }),\n )\n .then((entries) => {\n if (active) setSitePins(Object.fromEntries(entries))\n })\n .catch(() => undefined)\n return () => {\n active = false\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [firestore, listingId, hostIdsKey, pinsNonce])\n\n // The listing, for the version actually on offer (AGL-1017). This used to\n // pass a PIN's own version as `latestVersion`, which is by definition the\n // version that pin is already at — so no site ever looked stale and the\n // update control never appeared on this page at all.\n const { data: listing } = useFirestoreDoc<any>(\n () => doc(firestore, 'marketplaceListings', listingId || '-missing-'),\n [firestore, listingId],\n )\n\n // The kill switch (AGL-2368). This panel offers an UPDATE, so it is asking\n // \"what installs today\" and had only the review-verdict mirror to ask —\n // which nothing cleared on revoke, so it offered a version the install\n // route refuses. Listing-scoped and public, one read for the panel.\n const { data: revocation } = useFirestoreDoc<any>(\n () =>\n listingId ? doc(firestore, 'revocations', listingId) : null,\n [firestore, listingId],\n )\n\n const orgInstall = useMemo(\n () => resolveOrgInstallSummary(hosts ?? [], sitePins, orgPin ?? null),\n [hosts, sitePins, orgPin],\n )\n // The listing doc the actions need. The pin carries the denormalised copy\n // the actions actually read (`$id`, `displayName`, `pluginId`), so this page\n // does not pay for a second read of the listing itself. `pluginId` is what\n // the uninstall dialog scans published pages by; without it the impact is\n // unknown and every uninstall asks for the typed acknowledgement.\n const anyPin = orgPin ?? Object.values(sitePins).find(Boolean) ?? null\n const actionListing = useMemo(\n () => ({\n $id: listingId,\n displayName: listing?.displayName ?? anyPin?.displayName ?? listingId,\n artifactType: 'plugin',\n latestVersion: listing?.latestVersion ?? anyPin?.version,\n pluginId: listing?.pluginId ?? anyPin?.pluginId,\n }),\n [\n listingId,\n listing?.displayName,\n listing?.latestVersion,\n listing?.pluginId,\n anyPin?.displayName,\n anyPin?.version,\n anyPin?.pluginId,\n ],\n )\n\n if (!orgInstall.installedAnywhere) {\n return (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Not installed on any site in this organization.'}\n </Typography>\n )\n }\n\n return (\n <PluginSiteSet\n listing={actionListing}\n hosts={hosts ?? []}\n orgInstall={orgInstall}\n // The newest INSTALLABLE version (AGL-1016/2368) — never `latestVersion`,\n // and never the review verdict alone, or the page offers an update the\n // install route refuses.\n latestVersion={offeredPluginVersion(listing, revocation) ?? undefined}\n installPlan={installPlan}\n uninstall={uninstall}\n onChanged={() => setPinsNonce((current) => current + 1)}\n />\n )\n}\n\nPluginSiteSetPanel.displayName = 'PluginSiteSetPanel'\n\nexport default PluginSiteSetPanel\n"],"names":["Typography","doc","getDoc","useEffect","useMemo","useState","useFirestore","useFirestoreDoc","useHostOrgId","offeredPluginVersion","resolveOrgInstallSummary","useMarketplaceActions","PluginSiteSet","PluginSiteSetPanel","props","orgPin","hostId","listingId","hosts","firestore","orgId","installPlan","uninstall","data","sitePins","setSitePins","pinsNonce","setPinsNonce","hostIdsKey","map","host","id","join","length","active","Promise","all","snapshot","exists","then","entries","Object","fromEntries","catch","undefined","listing","revocation","orgInstall","anyPin","values","find","Boolean","actionListing","$id","displayName","artifactType","latestVersion","version","pluginId","installedAnywhere","variant","color","onChanged","current"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAEA,SAASA,UAAU,QAAQ,gBAAe;AAC1C,SAASC,GAAG,EAAEC,MAAM,QAAQ,qBAAoB;AAChD,SAASC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAO;AACpD,SACEC,YAAY,EACZC,eAAe,EACfC,YAAY,QACP,iCAAgC;AACvC,SAASC,oBAAoB,QAAQ,eAAc;AACnD,SAASC,wBAAwB,QAAQ,0BAAsB;AAC/D,SAASC,qBAAqB,QAAQ,sCAAkC;AACxE,OAAOC,mBAAmB,iCAA6B;AASvD;;;;;;;;;CASC,GACD,OAAO,SAASC,mBAAmBC,KAA8B;QAoEhDC,MAoCIN;IAvGnB,MAAM,EAAEO,MAAM,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGJ;IACrC,MAAMK,YAAYb;IAClB,MAAMc,QAAQZ,aAAaQ;IAC3B,MAAM,EAAEK,WAAW,EAAEC,SAAS,EAAE,GAAGX,sBAAsBK;IAEzD,yEAAyE;IACzE,+DAA+D;IAC/D,yDAAyD;IACzD,MAAM,EAAEO,MAAMR,MAAM,EAAE,GAAGR,gBACvB,IACEa,SAASH,YACLhB,IAAIkB,WAAW,QAAQC,OAAO,YAAYH,aAC1C,MACN;QAACE;QAAWC;QAAOH;KAAU;IAE/B,MAAM,CAACO,UAAUC,YAAY,GAAGpB,SAA8B,CAAC;IAC/D,MAAM,CAACqB,WAAWC,aAAa,GAAGtB,SAAS;IAC3C,MAAMuB,aAAa,CAACV,gBAAAA,QAAS,EAAE,EAAEW,GAAG,CAAC,CAACC,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