@aglyn/plugins-marketplace 1.0.0-beta.291 → 1.0.0-beta.293

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.
Files changed (95) hide show
  1. package/package.json +14 -14
  2. package/src/lib/components/listing-detail-editor.component.js +32 -10
  3. package/src/lib/components/listing-detail-editor.component.js.map +1 -1
  4. package/src/lib/components/listing-verification-request.component.js +32 -11
  5. package/src/lib/components/listing-verification-request.component.js.map +1 -1
  6. package/src/lib/components/org-seller-panel.component.js +121 -143
  7. package/src/lib/components/org-seller-panel.component.js.map +1 -1
  8. package/src/lib/components/publish-artifact-dialog.component.js +115 -115
  9. package/src/lib/components/publish-artifact-dialog.component.js.map +1 -1
  10. package/src/lib/components/publish-plugin-form.component.js +32 -36
  11. package/src/lib/components/publish-plugin-form.component.js.map +1 -1
  12. package/src/lib/components/publisher-agreement-checkbox.component.d.ts +56 -0
  13. package/src/lib/components/publisher-agreement-checkbox.component.js +121 -0
  14. package/src/lib/components/publisher-agreement-checkbox.component.js.map +1 -0
  15. package/src/lib/components/publisher-agreement-confirm-dialog.component.d.ts +45 -0
  16. package/src/lib/components/publisher-agreement-confirm-dialog.component.js +109 -0
  17. package/src/lib/components/publisher-agreement-confirm-dialog.component.js.map +1 -0
  18. package/src/lib/components/publisher-agreement-summary.component.d.ts +4 -3
  19. package/src/lib/components/publisher-agreement-summary.component.js +4 -3
  20. package/src/lib/components/publisher-agreement-summary.component.js.map +1 -1
  21. package/src/lib/components/starter-picker-shelf.component.d.ts +29 -0
  22. package/src/lib/components/starter-picker-shelf.component.js +317 -0
  23. package/src/lib/components/starter-picker-shelf.component.js.map +1 -0
  24. package/src/lib/declarations.server.js +2 -1
  25. package/src/lib/declarations.server.js.map +1 -1
  26. package/src/lib/hooks/use-starter-purchase.d.ts +31 -0
  27. package/src/lib/hooks/use-starter-purchase.js +101 -0
  28. package/src/lib/hooks/use-starter-purchase.js.map +1 -0
  29. package/src/lib/hooks/use-starter-search.d.ts +42 -0
  30. package/src/lib/hooks/use-starter-search.js +137 -0
  31. package/src/lib/hooks/use-starter-search.js.map +1 -0
  32. package/src/lib/model/listing-visibility.d.ts +17 -9
  33. package/src/lib/model/listing-visibility.js +18 -32
  34. package/src/lib/model/listing-visibility.js.map +1 -1
  35. package/src/lib/model/publisher-agreement.d.ts +105 -8
  36. package/src/lib/model/publisher-agreement.js +131 -24
  37. package/src/lib/model/publisher-agreement.js.map +1 -1
  38. package/src/lib/model/site-starter-listing.js +4 -1
  39. package/src/lib/model/site-starter-listing.js.map +1 -1
  40. package/src/lib/model/starter-query.d.ts +159 -0
  41. package/src/lib/model/starter-query.js +267 -0
  42. package/src/lib/model/starter-query.js.map +1 -0
  43. package/src/lib/plugin.js +12 -0
  44. package/src/lib/plugin.js.map +1 -1
  45. package/src/lib/server/checkout.js +45 -12
  46. package/src/lib/server/checkout.js.map +1 -1
  47. package/src/lib/server/preview-image.js +38 -8
  48. package/src/lib/server/preview-image.js.map +1 -1
  49. package/src/lib/server/publish-dataset-schema.js +27 -2
  50. package/src/lib/server/publish-dataset-schema.js.map +1 -1
  51. package/src/lib/server/publish-email-starter.js +27 -2
  52. package/src/lib/server/publish-email-starter.js.map +1 -1
  53. package/src/lib/server/publish-email-template.js +27 -2
  54. package/src/lib/server/publish-email-template.js.map +1 -1
  55. package/src/lib/server/publish-layout.js +27 -2
  56. package/src/lib/server/publish-layout.js.map +1 -1
  57. package/src/lib/server/publish-plugin.js +120 -14
  58. package/src/lib/server/publish-plugin.js.map +1 -1
  59. package/src/lib/server/publish-preconditions.d.ts +13 -9
  60. package/src/lib/server/publish-preconditions.js +19 -45
  61. package/src/lib/server/publish-preconditions.js.map +1 -1
  62. package/src/lib/server/publish-starter.js +27 -2
  63. package/src/lib/server/publish-starter.js.map +1 -1
  64. package/src/lib/server/publish-template.js +27 -2
  65. package/src/lib/server/publish-template.js.map +1 -1
  66. package/src/lib/server/publish-theme.js +27 -2
  67. package/src/lib/server/publish-theme.js.map +1 -1
  68. package/src/lib/server/publish.js +27 -2
  69. package/src/lib/server/publish.js.map +1 -1
  70. package/src/lib/server/publisher-agreement-acceptance.d.ts +49 -0
  71. package/src/lib/server/publisher-agreement-acceptance.js +97 -0
  72. package/src/lib/server/publisher-agreement-acceptance.js.map +1 -0
  73. package/src/lib/server/publisher-profile-save.js +46 -97
  74. package/src/lib/server/publisher-profile-save.js.map +1 -1
  75. package/src/lib/server/site-starter-source.js +97 -25
  76. package/src/lib/server/site-starter-source.js.map +1 -1
  77. package/src/lib/server/starters.d.ts +31 -0
  78. package/src/lib/server/starters.js +170 -0
  79. package/src/lib/server/starters.js.map +1 -0
  80. package/src/lib/server/verification-request.js +33 -8
  81. package/src/lib/server/verification-request.js.map +1 -1
  82. package/src/lib/server.js +14 -0
  83. package/src/lib/server.js.map +1 -1
  84. package/src/lib/components/publisher-agreement-client.d.ts +0 -48
  85. package/src/lib/components/publisher-agreement-client.js +0 -93
  86. package/src/lib/components/publisher-agreement-client.js.map +0 -1
  87. package/src/lib/components/publisher-agreement-dialog.component.d.ts +0 -47
  88. package/src/lib/components/publisher-agreement-dialog.component.js +0 -222
  89. package/src/lib/components/publisher-agreement-dialog.component.js.map +0 -1
  90. package/src/lib/components/use-publisher-agreement-gate.d.ts +0 -58
  91. package/src/lib/components/use-publisher-agreement-gate.js +0 -166
  92. package/src/lib/components/use-publisher-agreement-gate.js.map +0 -1
  93. package/src/lib/model/publisher-agreement-refusal.d.ts +0 -46
  94. package/src/lib/model/publisher-agreement-refusal.js +0 -41
  95. package/src/lib/model/publisher-agreement-refusal.js.map +0 -1
@@ -20,7 +20,7 @@ import { mdiDotsVertical } from "@aglyn/shared-data-mdi";
20
20
  import { AppLink, CardDisplay, MdiIcon } from "@aglyn/shared-ui-jsx";
21
21
  import { useSnackbar } from "@aglyn/shared-ui-snackstack";
22
22
  import { Alert, Avatar, Button, Chip, Divider, IconButton, Menu, MenuItem, Stack, TextField, Typography } from "@mui/material";
23
- import { PUBLISHER_AGREEMENT_TITLE, publisherAgreementPresentation, publisherAgreementState } from "../model/publisher-agreement.js";
23
+ import { PUBLISHER_AGREEMENT_TITLE, PUBLISHER_AGREEMENT_VERSION, publisherAgreementPresentation, publisherAgreementState } from "../model/publisher-agreement.js";
24
24
  /*
25
25
  THE LEGAL NAME, not `useBranding().branding.productName` (AGL-2351).
26
26
 
@@ -42,7 +42,8 @@ import { pluginDocsHelp, useMediaPicker } from "@aglyn/aglyn";
42
42
  import { useFirestoreCollection } from "@aglyn/tenant-feature-instance";
43
43
  import { useFirestoreDoc } from "@aglyn/tenant-feature-instance";
44
44
  import EditListingDialog from "./edit-listing-dialog.component.js";
45
- import { acceptPublisherAgreement } from "./publisher-agreement-client.js";
45
+ import { PublisherAgreementCheckbox, usePublisherAgreementConsent } from "./publisher-agreement-checkbox.component.js";
46
+ import PublisherAgreementConfirmDialog from "./publisher-agreement-confirm-dialog.component.js";
46
47
  import PublisherAgreementSummary from "./publisher-agreement-summary.component.js";
47
48
  import { listingPath, publishPluginPath } from "../model/marketplace-paths.js";
48
49
  import { payoutReadiness } from "../model/payout-readiness.js";
@@ -58,7 +59,7 @@ const HANDLE_PATTERN = /^[a-z0-9][a-z0-9-]{2,29}$/;
58
59
  * navigated to is mounted at all, so the others never subscribe.
59
60
  */ export function OrgSellerPanel(props) {
60
61
  var _ref, _ref1, _ref2, _profile_lastPayoutFailureCents, _profile_lastPayoutFailureReason;
61
- var _profile_publisherAgreement, _profile_publisherAgreement1, _rowMenu_listing, _rowMenu_listing1, _rowMenu_listing2, _rowMenu_listing3, _rowMenu_listing4, _rowMenu_listing5, _rowMenu_listing6, _rowMenu_listing7;
62
+ var _profile_publisherAgreement, _rowMenu_listing, _rowMenu_listing1, _rowMenu_listing2, _rowMenu_listing3, _rowMenu_listing4, _rowMenu_listing5, _rowMenu_listing6;
62
63
  const { orgId, section, basePath } = props;
63
64
  const router = useRouter();
64
65
  const firestore = useFirestore();
@@ -263,8 +264,13 @@ const HANDLE_PATTERN = /^[a-z0-9][a-z0-9-]{2,29}$/;
263
264
  profile == null ? void 0 : profile.linkedinUrl
264
265
  ]);
265
266
  const validHandle = HANDLE_PATTERN.test(handle);
267
+ // The publisher agreement, agreed to on this save (AGL-4105).
268
+ const profileAgreement = usePublisherAgreementConsent();
269
+ const [profileBusy, setProfileBusy] = useState(false);
266
270
  const handleSave = useCallback(async ()=>{
267
271
  if (!orgId || !validHandle || !displayName.trim()) return;
272
+ if (!profileAgreement.consent) return;
273
+ setProfileBusy(true);
268
274
  try {
269
275
  // Server-owned (AGL-652): the handle must be claimed transactionally in
270
276
  // publisherHandles, which a client write cannot do — two orgs racing
@@ -288,7 +294,8 @@ const HANDLE_PATTERN = /^[a-z0-9][a-z0-9-]{2,29}$/;
288
294
  supportUrl: supportUrl.trim(),
289
295
  githubUrl: githubUrl.trim(),
290
296
  xUrl: xUrl.trim(),
291
- linkedinUrl: linkedinUrl.trim()
297
+ linkedinUrl: linkedinUrl.trim(),
298
+ agreement: profileAgreement.consent
292
299
  })
293
300
  });
294
301
  const payload = await response.json().catch(()=>null);
@@ -303,12 +310,16 @@ const HANDLE_PATTERN = /^[a-z0-9][a-z0-9-]{2,29}$/;
303
310
  variant: 'success',
304
311
  persist: false
305
312
  });
313
+ // Each save is its own agreement: the next one ticks the box again.
314
+ profileAgreement.reset();
306
315
  } catch (error) {
307
316
  console.error(error);
308
317
  enqueueSnackbar('An error has occurred', {
309
318
  variant: 'error',
310
319
  allowDuplicate: true
311
320
  });
321
+ } finally{
322
+ setProfileBusy(false);
312
323
  }
313
324
  }, [
314
325
  orgId,
@@ -323,6 +334,7 @@ const HANDLE_PATTERN = /^[a-z0-9][a-z0-9-]{2,29}$/;
323
334
  githubUrl,
324
335
  xUrl,
325
336
  linkedinUrl,
337
+ profileAgreement,
326
338
  user,
327
339
  enqueueSnackbar
328
340
  ]);
@@ -342,40 +354,6 @@ const HANDLE_PATTERN = /^[a-z0-9][a-z0-9-]{2,29}$/;
342
354
  const date = at == null ? void 0 : (_at_toDate = at.toDate) == null ? void 0 : _at_toDate.call(at);
343
355
  return date ? date.toLocaleDateString() : '';
344
356
  })();
345
- const [agreementBusy, setAgreementBusy] = useState(false);
346
- const handleAcceptAgreement = useCallback(async ()=>{
347
- if (!orgId) return;
348
- setAgreementBusy(true);
349
- try {
350
- // Server-owned, like the handle: an acceptance the accepting party can
351
- // write itself is not evidence of anything, and the rules block the
352
- // field outright. The same request the agreement dialog a refused
353
- // publish opens makes (AGL-3407), so both record one acceptance.
354
- const refused = await acceptPublisherAgreement(user, orgId);
355
- if (refused) {
356
- return void enqueueSnackbar(refused, {
357
- variant: 'warning',
358
- persist: false
359
- });
360
- }
361
- enqueueSnackbar('Agreement accepted — you can publish now', {
362
- variant: 'success',
363
- persist: false
364
- });
365
- } catch (error) {
366
- console.error(error);
367
- enqueueSnackbar('An error has occurred', {
368
- variant: 'error',
369
- allowDuplicate: true
370
- });
371
- } finally{
372
- setAgreementBusy(false);
373
- }
374
- }, [
375
- orgId,
376
- user,
377
- enqueueSnackbar
378
- ]);
379
357
  // The listing open in the full editor (AGL-862), or null when closed.
380
358
  const [editListing, setEditListing] = useState(null);
381
359
  // Per-row overflow menu (AGL-999): the anchor plus the row it belongs to,
@@ -392,86 +370,81 @@ const HANDLE_PATTERN = /^[a-z0-9][a-z0-9-]{2,29}$/;
392
370
  // write: making a listing public is gated on it actually carrying the docs
393
371
  // a stranger needs, and that check has to live somewhere a client can't
394
372
  // skip. No re-review either way — the bytes are unchanged.
395
- const [visibilityBusy, setVisibilityBusy] = useState('');
396
- const handleVisibility = useCallback((listing)=>async ()=>{
397
- const next = listing.visibility === 'private' ? 'public' : 'private';
398
- setVisibilityBusy(listing.$id);
399
- try {
400
- const response = await authorizedFetch(user, '/api/marketplace/publish-plugin', {
401
- method: 'POST',
402
- headers: {
403
- 'Content-Type': 'application/json'
404
- },
405
- body: JSON.stringify({
406
- action: 'set-visibility',
407
- listingId: listing.$id,
408
- visibility: next
409
- })
410
- });
411
- const payload = await response.json().catch(()=>({}));
412
- if (!response.ok) {
413
- var _ref;
414
- return void enqueueSnackbar((_ref = payload == null ? void 0 : payload.error) != null ? _ref : 'Visibility change failed', {
415
- variant: 'error',
416
- allowDuplicate: true
417
- });
418
- }
419
- enqueueSnackbar(next === 'private' ? 'Now private — only your sites can install it' : 'Published to the marketplace', {
420
- variant: 'success',
421
- persist: false
422
- });
423
- } catch (error) {
424
- console.error(error);
425
- enqueueSnackbar('An error has occurred', {
426
- variant: 'error',
427
- allowDuplicate: true
428
- });
429
- } finally{
430
- setVisibilityBusy('');
431
- }
432
- }, [
433
- user,
434
- enqueueSnackbar
435
- ]);
373
+ //
436
374
  // Unpublish ⇄ republish goes through the API too (AGL-3321). It was a
437
375
  // client write of `deletedAt`, but browse queries each listing's audience,
438
376
  // which only the server re-derives — so the rules now deny the field here.
439
- const handleUnpublish = useCallback((listing)=>async ()=>{
440
- try {
441
- const response = await authorizedFetch(user, '/api/marketplace/publish-plugin', {
442
- method: 'POST',
443
- headers: {
444
- 'Content-Type': 'application/json'
445
- },
446
- body: JSON.stringify({
447
- action: 'set-published',
448
- listingId: listing.$id,
449
- published: Boolean(listing.deletedAt)
450
- })
451
- });
452
- const payload = await response.json().catch(()=>({}));
453
- if (!response.ok) {
454
- var _ref;
455
- return void enqueueSnackbar((_ref = payload == null ? void 0 : payload.error) != null ? _ref : 'Publishing change failed', {
456
- variant: 'error',
457
- allowDuplicate: true
458
- });
459
- }
460
- enqueueSnackbar(listing.deletedAt ? 'Republished' : 'Unpublished', {
461
- variant: 'success',
462
- persist: false
463
- });
464
- } catch (error) {
465
- console.error(error);
466
- enqueueSnackbar('An error has occurred', {
467
- variant: 'error',
468
- allowDuplicate: true
469
- });
377
+ //
378
+ // Both were saves on the click; each now asks first, with the publisher
379
+ // agreement above its button (AGL-4105), and is made from that dialog.
380
+ const [listingChange, setListingChange] = useState(null);
381
+ const changeListing = useCallback(async (change, agreement)=>{
382
+ const { kind, listing } = change;
383
+ const nextVisibility = listing.visibility === 'private' ? 'public' : 'private';
384
+ try {
385
+ const response = await authorizedFetch(user, '/api/marketplace/publish-plugin', {
386
+ method: 'POST',
387
+ headers: {
388
+ 'Content-Type': 'application/json'
389
+ },
390
+ body: JSON.stringify(kind === 'visibility' ? {
391
+ action: 'set-visibility',
392
+ listingId: listing.$id,
393
+ visibility: nextVisibility,
394
+ agreement
395
+ } : {
396
+ action: 'set-published',
397
+ listingId: listing.$id,
398
+ published: Boolean(listing.deletedAt),
399
+ agreement
400
+ })
401
+ });
402
+ const payload = await response.json().catch(()=>({}));
403
+ if (!response.ok) {
404
+ var _ref;
405
+ return String((_ref = payload == null ? void 0 : payload.error) != null ? _ref : kind === 'visibility' ? 'Visibility change failed' : 'Publishing change failed');
470
406
  }
471
- }, [
407
+ enqueueSnackbar(kind === 'visibility' ? nextVisibility === 'private' ? 'Now private — only your sites can install it' : 'Published to the marketplace' : listing.deletedAt ? 'Republished' : 'Unpublished', {
408
+ variant: 'success',
409
+ persist: false
410
+ });
411
+ return null;
412
+ } catch (error) {
413
+ console.error(error);
414
+ return 'An error has occurred';
415
+ }
416
+ }, [
472
417
  user,
473
418
  enqueueSnackbar
474
419
  ]);
420
+ const listingChangeCopy = (()=>{
421
+ const listing = listingChange == null ? void 0 : listingChange.listing;
422
+ const name = (listing == null ? void 0 : listing.displayName) || 'this listing';
423
+ if ((listingChange == null ? void 0 : listingChange.kind) === 'visibility') {
424
+ return (listing == null ? void 0 : listing.visibility) === 'private' ? {
425
+ title: 'Make public?',
426
+ body: `${name} is offered in the marketplace, not only to your organization’s sites.`,
427
+ confirmLabel: 'Make public',
428
+ destructive: false
429
+ } : {
430
+ title: 'Make private?',
431
+ body: `Only your organization’s sites can install ${name}. Private plugins never appear in the marketplace.`,
432
+ confirmLabel: 'Make private',
433
+ destructive: false
434
+ };
435
+ }
436
+ return (listing == null ? void 0 : listing.deletedAt) ? {
437
+ title: 'Republish?',
438
+ body: `${name} goes back on the marketplace.`,
439
+ confirmLabel: 'Republish',
440
+ destructive: false
441
+ } : {
442
+ title: 'Unpublish?',
443
+ body: `${name} comes off the marketplace. You can republish it later.`,
444
+ confirmLabel: 'Unpublish',
445
+ destructive: true
446
+ };
447
+ })();
475
448
  const cards = {
476
449
  profile: /*#__PURE__*/ _jsxs(Stack, {
477
450
  spacing: 2,
@@ -597,12 +570,17 @@ const HANDLE_PATTERN = /^[a-z0-9][a-z0-9-]{2,29}$/;
597
570
  size: "small",
598
571
  helperText: "https://linkedin.com/…"
599
572
  }),
573
+ /*#__PURE__*/ _jsx(PublisherAgreementCheckbox, {
574
+ checked: profileAgreement.agreed,
575
+ onChange: profileAgreement.setAgreed,
576
+ disabled: profileBusy
577
+ }),
600
578
  /*#__PURE__*/ _jsx(Button, {
601
579
  variant: "contained",
602
580
  color: "primary",
603
- disabled: !validHandle || !displayName.trim(),
581
+ disabled: profileBusy || !validHandle || !displayName.trim() || !profileAgreement.agreed,
604
582
  onClick: handleSave,
605
- children: 'Save profile'
583
+ children: profileBusy ? 'Saving…' : 'Save profile'
606
584
  })
607
585
  ]
608
586
  })
@@ -611,42 +589,28 @@ const HANDLE_PATTERN = /^[a-z0-9][a-z0-9-]{2,29}$/;
611
589
  header: PUBLISHER_AGREEMENT_TITLE,
612
590
  help: pluginDocsHelp('publisherHandbook', {
613
591
  anchor: '#the-publisher-agreement',
614
- excerpt: 'The terms your organization publishes under — accepted once, ' + 're-asked when they change.'
592
+ excerpt: 'The terms your organization publishes under — agreed to on ' + 'every save in the marketplace.'
615
593
  }),
616
594
  contentGutterX: true,
617
595
  contentGutterY: true,
618
596
  children: /*#__PURE__*/ _jsxs(Stack, {
619
597
  spacing: 2,
620
598
  children: [
621
- agreementState === 'current' ? /*#__PURE__*/ _jsx(Alert, {
622
- severity: "success",
623
- children: `Accepted — version ${profile == null ? void 0 : (_profile_publisherAgreement = profile.publisherAgreement) == null ? void 0 : _profile_publisherAgreement.version}` + (acceptedOn ? ` on ${acceptedOn}` : '')
624
- }) : null,
625
599
  agreementPresentation.unavailableNotice ? /*#__PURE__*/ _jsx(Alert, {
626
600
  severity: "warning",
627
601
  children: agreementPresentation.unavailableNotice
628
- }) : agreementState === 'current' ? null : /*#__PURE__*/ _jsx(Alert, {
629
- severity: agreementState === 'outdated' ? 'warning' : 'info',
630
- children: agreementState === 'outdated' ? 'These terms have changed since your organization accepted ' + `them (you accepted ${profile == null ? void 0 : (_profile_publisherAgreement1 = profile.publisherAgreement) == null ? void 0 : _profile_publisherAgreement1.version}). ` + 'Publishing is paused until someone who can bind the ' + 'organization accepts the current version.' : 'Your organization has not accepted these terms. You can ' + 'set up a profile without them, but you cannot publish.'
602
+ }) : /*#__PURE__*/ _jsx(Typography, {
603
+ variant: "body2",
604
+ color: "text.secondary",
605
+ children: 'Every save in the marketplace — this profile, a listing, its ' + 'price or visibility, a new version, a component, template ' + `or layout — asks you to tick “I agree to the ${PUBLISHER_AGREEMENT_TITLE}” ` + 'first. We record who agreed, to which version, and when.'
606
+ }),
607
+ agreementState === 'none' ? null : /*#__PURE__*/ _jsx(Typography, {
608
+ variant: "body2",
609
+ children: `Last agreed to: version ${profile == null ? void 0 : (_profile_publisherAgreement = profile.publisherAgreement) == null ? void 0 : _profile_publisherAgreement.version}` + (acceptedOn ? `, on ${acceptedOn}` : '') + (agreementState === 'outdated' ? `. The current version is ${PUBLISHER_AGREEMENT_VERSION}, ` + 'which your next save agrees to.' : '.')
631
610
  }),
632
611
  /*#__PURE__*/ _jsx(PublisherAgreementSummary, {
633
612
  documentUrl: agreementPresentation.documentUrl
634
- }),
635
- agreementPresentation.canAccept ? /*#__PURE__*/ _jsx(Button, {
636
- variant: "contained",
637
- color: "primary",
638
- disabled: agreementBusy,
639
- onClick: ()=>void handleAcceptAgreement(),
640
- sx: {
641
- alignSelf: 'flex-start'
642
- },
643
- children: agreementBusy ? 'Recording…' : agreementState === 'outdated' ? 'Accept the current version' : 'Accept on behalf of this organization'
644
- }) : null,
645
- agreementPresentation.canAccept ? /*#__PURE__*/ _jsx(Typography, {
646
- variant: "caption",
647
- color: "text.secondary",
648
- children: 'Accepting binds the organization, not you personally — only ' + 'an owner or admin can do it, and we record who did and when.'
649
- }) : null
613
+ })
650
614
  ]
651
615
  })
652
616
  })
@@ -776,28 +740,42 @@ const HANDLE_PATTERN = /^[a-z0-9][a-z0-9-]{2,29}$/;
776
740
  children: 'Edit listing'
777
741
  }),
778
742
  ((_ref2 = rowMenu == null ? void 0 : (_rowMenu_listing2 = rowMenu.listing) == null ? void 0 : _rowMenu_listing2.artifactType) != null ? _ref2 : rowMenu == null ? void 0 : (_rowMenu_listing3 = rowMenu.listing) == null ? void 0 : _rowMenu_listing3.type) === 'plugin' ? /*#__PURE__*/ _jsx(MenuItem, {
779
- disabled: visibilityBusy === (rowMenu == null ? void 0 : (_rowMenu_listing4 = rowMenu.listing) == null ? void 0 : _rowMenu_listing4.$id),
780
743
  onClick: ()=>{
781
744
  const listing = rowMenu == null ? void 0 : rowMenu.listing;
782
745
  closeRowMenu();
783
- if (listing) void handleVisibility(listing)();
746
+ if (listing) setListingChange({
747
+ kind: 'visibility',
748
+ listing
749
+ });
784
750
  },
785
- children: (rowMenu == null ? void 0 : (_rowMenu_listing5 = rowMenu.listing) == null ? void 0 : _rowMenu_listing5.visibility) === 'private' ? 'Make public…' : 'Make private'
751
+ children: (rowMenu == null ? void 0 : (_rowMenu_listing4 = rowMenu.listing) == null ? void 0 : _rowMenu_listing4.visibility) === 'private' ? 'Make public…' : 'Make private…'
786
752
  }) : null,
787
753
  /*#__PURE__*/ _jsx(Divider, {}),
788
754
  /*#__PURE__*/ _jsx(MenuItem, {
789
755
  sx: {
790
- color: (rowMenu == null ? void 0 : (_rowMenu_listing6 = rowMenu.listing) == null ? void 0 : _rowMenu_listing6.deletedAt) ? undefined : 'error.main'
756
+ color: (rowMenu == null ? void 0 : (_rowMenu_listing5 = rowMenu.listing) == null ? void 0 : _rowMenu_listing5.deletedAt) ? undefined : 'error.main'
791
757
  },
792
758
  onClick: ()=>{
793
759
  const listing = rowMenu == null ? void 0 : rowMenu.listing;
794
760
  closeRowMenu();
795
- if (listing) void handleUnpublish(listing)();
761
+ if (listing) setListingChange({
762
+ kind: 'published',
763
+ listing
764
+ });
796
765
  },
797
- children: (rowMenu == null ? void 0 : (_rowMenu_listing7 = rowMenu.listing) == null ? void 0 : _rowMenu_listing7.deletedAt) ? 'Republish' : 'Unpublish'
766
+ children: (rowMenu == null ? void 0 : (_rowMenu_listing6 = rowMenu.listing) == null ? void 0 : _rowMenu_listing6.deletedAt) ? 'Republish…' : 'Unpublish…'
798
767
  })
799
768
  ]
800
769
  }),
770
+ /*#__PURE__*/ _jsx(PublisherAgreementConfirmDialog, {
771
+ open: Boolean(listingChange),
772
+ title: listingChangeCopy.title,
773
+ body: listingChangeCopy.body,
774
+ confirmLabel: listingChangeCopy.confirmLabel,
775
+ destructive: listingChangeCopy.destructive,
776
+ onConfirm: (agreement)=>listingChange ? changeListing(listingChange, agreement) : Promise.resolve(null),
777
+ onClose: ()=>setListingChange(null)
778
+ }),
801
779
  /*#__PURE__*/ _jsx(EditListingDialog, {
802
780
  orgId: orgId,
803
781
  listing: editListing,