@aglyn/plugins-ai 1.0.0-beta.229 → 1.0.0-beta.231
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/README.md +3 -3
- package/package.json +17 -17
- package/src/lib/activity/ai-activity-actions.js +7 -1
- package/src/lib/activity/ai-activity-actions.js.map +1 -1
- package/src/lib/components/ai-assist-provider-on-host.component.d.ts +66 -0
- package/src/lib/components/ai-assist-provider-on-host.component.js +78 -0
- package/src/lib/components/ai-assist-provider-on-host.component.js.map +1 -0
- package/src/lib/components/ai-assist-provider.component.js +9 -10
- package/src/lib/components/ai-assist-provider.component.js.map +1 -1
- package/src/lib/components/ai-automation-zones.d.ts +38 -0
- package/src/lib/components/ai-automation-zones.js +5 -1
- package/src/lib/components/ai-automation-zones.js.map +1 -1
- package/src/lib/components/ai-brief-dialog.component.d.ts +20 -2
- package/src/lib/components/ai-brief-dialog.component.js +87 -8
- package/src/lib/components/ai-brief-dialog.component.js.map +1 -1
- package/src/lib/components/ai-campaign-create.component.d.ts +54 -0
- package/src/lib/components/ai-campaign-create.component.js +270 -0
- package/src/lib/components/ai-campaign-create.component.js.map +1 -0
- package/src/lib/components/ai-describe-automation.component.d.ts +8 -3
- package/src/lib/components/ai-describe-automation.component.js +15 -6
- package/src/lib/components/ai-describe-automation.component.js.map +1 -1
- package/src/lib/components/ai-describe-button.component.d.ts +20 -8
- package/src/lib/components/ai-describe-button.component.js +19 -36
- package/src/lib/components/ai-describe-button.component.js.map +1 -1
- package/src/lib/components/ai-describe-email.component.d.ts +31 -0
- package/src/lib/components/ai-describe-email.component.js +22 -0
- package/src/lib/components/ai-describe-email.component.js.map +1 -0
- package/src/lib/components/ai-describe-org-automation.component.d.ts +36 -0
- package/src/lib/components/ai-describe-org-automation.component.js +238 -0
- package/src/lib/components/ai-describe-org-automation.component.js.map +1 -0
- package/src/lib/components/ai-experiment-cards.component.d.ts +9 -1
- package/src/lib/components/ai-experiment-cards.component.js +104 -18
- package/src/lib/components/ai-experiment-cards.component.js.map +1 -1
- package/src/lib/components/ai-explain-automation.component.js +1 -5
- package/src/lib/components/ai-explain-automation.component.js.map +1 -1
- package/src/lib/components/ai-funnel-zones.component.d.ts +61 -0
- package/src/lib/components/ai-funnel-zones.component.js +178 -0
- package/src/lib/components/ai-funnel-zones.component.js.map +1 -0
- package/src/lib/components/ai-insight-card.component.d.ts +42 -0
- package/src/lib/components/ai-insight-card.component.js +137 -0
- package/src/lib/components/ai-insight-card.component.js.map +1 -0
- package/src/lib/components/ai-insight-dialog.component.d.ts +6 -0
- package/src/lib/components/ai-insight-dialog.component.js +9 -3
- package/src/lib/components/ai-insight-dialog.component.js.map +1 -1
- package/src/lib/components/ai-job-plan.component.d.ts +7 -2
- package/src/lib/components/ai-job-plan.component.js +38 -6
- package/src/lib/components/ai-job-plan.component.js.map +1 -1
- package/src/lib/components/ai-job-requests.d.ts +17 -1
- package/src/lib/components/ai-job-requests.js +39 -3
- package/src/lib/components/ai-job-requests.js.map +1 -1
- package/src/lib/components/ai-logic-zones.d.ts +64 -0
- package/src/lib/components/ai-logic-zones.js +18 -0
- package/src/lib/components/ai-logic-zones.js.map +1 -0
- package/src/lib/components/ai-logic.component.d.ts +77 -0
- package/src/lib/components/ai-logic.component.js +553 -0
- package/src/lib/components/ai-logic.component.js.map +1 -0
- package/src/lib/components/ai-marketing-insight.component.d.ts +30 -0
- package/src/lib/components/ai-marketing-insight.component.js +80 -0
- package/src/lib/components/ai-marketing-insight.component.js.map +1 -0
- package/src/lib/components/ai-media-create.component.d.ts +55 -0
- package/src/lib/components/ai-media-create.component.js +433 -0
- package/src/lib/components/ai-media-create.component.js.map +1 -0
- package/src/lib/components/ai-overlay-cards.component.d.ts +83 -0
- package/src/lib/components/ai-overlay-cards.component.js +505 -0
- package/src/lib/components/ai-overlay-cards.component.js.map +1 -0
- package/src/lib/components/ai-permissions-on-host.component.d.ts +3 -46
- package/src/lib/components/ai-permissions-on-host.component.js +5 -53
- package/src/lib/components/ai-permissions-on-host.component.js.map +1 -1
- package/src/lib/components/ai-product-zones.d.ts +5 -0
- package/src/lib/components/ai-product-zones.js +1 -1
- package/src/lib/components/ai-product-zones.js.map +1 -1
- package/src/lib/components/ai-products-create-button.component.d.ts +42 -0
- package/src/lib/components/ai-products-create-button.component.js +67 -0
- package/src/lib/components/ai-products-create-button.component.js.map +1 -0
- package/src/lib/components/ai-products-hub-card.component.js +100 -81
- package/src/lib/components/ai-products-hub-card.component.js.map +1 -1
- package/src/lib/components/ai-revise-automation.component.d.ts +16 -0
- package/src/lib/components/ai-revise-automation.component.js +207 -0
- package/src/lib/components/ai-revise-automation.component.js.map +1 -0
- package/src/lib/components/ai-site-build-page.component.js +160 -24
- package/src/lib/components/ai-site-build-page.component.js.map +1 -1
- package/src/lib/components/ai-upsell-dialog.component.d.ts +53 -0
- package/src/lib/components/ai-upsell-dialog.component.js +177 -0
- package/src/lib/components/ai-upsell-dialog.component.js.map +1 -0
- package/src/lib/components/assist-build-card.component.d.ts +42 -0
- package/src/lib/components/assist-build-card.component.js +183 -0
- package/src/lib/components/assist-build-card.component.js.map +1 -0
- package/src/lib/components/assist-edit-canvas.d.ts +2 -0
- package/src/lib/components/assist-edit-canvas.js +56 -1
- package/src/lib/components/assist-edit-canvas.js.map +1 -1
- package/src/lib/components/assist-jobs-drawer.component.js +48 -3
- package/src/lib/components/assist-jobs-drawer.component.js.map +1 -1
- package/src/lib/components/assist-panel.component.js +51 -2
- package/src/lib/components/assist-panel.component.js.map +1 -1
- package/src/lib/components/use-ai-job-run.d.ts +3 -14
- package/src/lib/components/use-ai-job-run.js +0 -50
- package/src/lib/components/use-ai-job-run.js.map +1 -1
- package/src/lib/jobs/ai-build-capabilities.d.ts +58 -0
- package/src/lib/jobs/ai-build-capabilities.js +256 -0
- package/src/lib/jobs/ai-build-capabilities.js.map +1 -0
- package/src/lib/jobs/ai-build-unit-outcome.d.ts +52 -0
- package/src/lib/jobs/ai-build-unit-outcome.js +140 -0
- package/src/lib/jobs/ai-build-unit-outcome.js.map +1 -0
- package/src/lib/jobs/ai-job-auto-confirm.d.ts +8 -0
- package/src/lib/jobs/ai-job-auto-confirm.js +30 -6
- package/src/lib/jobs/ai-job-auto-confirm.js.map +1 -1
- package/src/lib/jobs/ai-job-build-step.d.ts +144 -0
- package/src/lib/jobs/ai-job-build-step.js +668 -0
- package/src/lib/jobs/ai-job-build-step.js.map +1 -0
- package/src/lib/jobs/ai-job-draft-ids.js +9 -1
- package/src/lib/jobs/ai-job-draft-ids.js.map +1 -1
- package/src/lib/jobs/ai-job-drafts.d.ts +14 -4
- package/src/lib/jobs/ai-job-drafts.js +25 -4
- package/src/lib/jobs/ai-job-drafts.js.map +1 -1
- package/src/lib/jobs/ai-job-generation.d.ts +8 -0
- package/src/lib/jobs/ai-job-generation.js +13 -2
- package/src/lib/jobs/ai-job-generation.js.map +1 -1
- package/src/lib/jobs/ai-job-insight-step.js +8 -1
- package/src/lib/jobs/ai-job-insight-step.js.map +1 -1
- package/src/lib/jobs/ai-job-layout-language.d.ts +73 -0
- package/src/lib/jobs/ai-job-layout-language.js +194 -0
- package/src/lib/jobs/ai-job-layout-language.js.map +1 -0
- package/src/lib/jobs/ai-job-layout-site-pages.d.ts +13 -2
- package/src/lib/jobs/ai-job-layout-site-pages.js +18 -2
- package/src/lib/jobs/ai-job-layout-site-pages.js.map +1 -1
- package/src/lib/jobs/ai-job-layout-step.d.ts +5 -0
- package/src/lib/jobs/ai-job-layout-step.js +105 -5
- package/src/lib/jobs/ai-job-layout-step.js.map +1 -1
- package/src/lib/jobs/ai-job-logic-step.d.ts +107 -0
- package/src/lib/jobs/ai-job-logic-step.js +395 -0
- package/src/lib/jobs/ai-job-logic-step.js.map +1 -0
- package/src/lib/jobs/ai-job-overlay-copy.d.ts +70 -0
- package/src/lib/jobs/ai-job-overlay-copy.js +178 -0
- package/src/lib/jobs/ai-job-overlay-copy.js.map +1 -0
- package/src/lib/jobs/ai-job-page-language.d.ts +149 -0
- package/src/lib/jobs/ai-job-page-language.js +355 -0
- package/src/lib/jobs/ai-job-page-language.js.map +1 -0
- package/src/lib/jobs/ai-job-page-sections.d.ts +37 -1
- package/src/lib/jobs/ai-job-page-sections.js +93 -11
- package/src/lib/jobs/ai-job-page-sections.js.map +1 -1
- package/src/lib/jobs/ai-job-page-step.d.ts +4 -4
- package/src/lib/jobs/ai-job-page-step.js +111 -20
- package/src/lib/jobs/ai-job-page-step.js.map +1 -1
- package/src/lib/jobs/ai-job-plan-step.d.ts +27 -2
- package/src/lib/jobs/ai-job-plan-step.js +87 -13
- package/src/lib/jobs/ai-job-plan-step.js.map +1 -1
- package/src/lib/jobs/ai-job-site-step.d.ts +19 -1
- package/src/lib/jobs/ai-job-site-step.js +220 -61
- package/src/lib/jobs/ai-job-site-step.js.map +1 -1
- package/src/lib/jobs/ai-job-text-step.d.ts +22 -1
- package/src/lib/jobs/ai-job-text-step.js +12 -0
- package/src/lib/jobs/ai-job-text-step.js.map +1 -1
- package/src/lib/jobs/ai-job-workflow-step.d.ts +54 -4
- package/src/lib/jobs/ai-job-workflow-step.js +320 -15
- package/src/lib/jobs/ai-job-workflow-step.js.map +1 -1
- package/src/lib/jobs/ai-jobs.d.ts +80 -2
- package/src/lib/jobs/ai-jobs.js +391 -18
- package/src/lib/jobs/ai-jobs.js.map +1 -1
- package/src/lib/jobs/ai-layout-full-height.d.ts +40 -0
- package/src/lib/jobs/ai-layout-full-height.js +82 -0
- package/src/lib/jobs/ai-layout-full-height.js.map +1 -0
- package/src/lib/jobs/ai-layout-site-facts.d.ts +54 -0
- package/src/lib/jobs/ai-layout-site-facts.js +153 -0
- package/src/lib/jobs/ai-layout-site-facts.js.map +1 -0
- package/src/lib/jobs/ai-logic-records.d.ts +40 -0
- package/src/lib/jobs/ai-logic-records.js +55 -0
- package/src/lib/jobs/ai-logic-records.js.map +1 -0
- package/src/lib/jobs/ai-site-publish.d.ts +7 -0
- package/src/lib/jobs/ai-site-publish.js +9 -0
- package/src/lib/jobs/ai-site-publish.js.map +1 -1
- package/src/lib/jobs/ai-workflow-records.d.ts +4 -0
- package/src/lib/jobs/ai-workflow-records.js +40 -1
- package/src/lib/jobs/ai-workflow-records.js.map +1 -1
- package/src/lib/layout-language/ai-layout-compiler.d.ts +145 -0
- package/src/lib/layout-language/ai-layout-compiler.js +1148 -0
- package/src/lib/layout-language/ai-layout-compiler.js.map +1 -0
- package/src/lib/layout-language/ai-layout-copy.d.ts +73 -0
- package/src/lib/layout-language/ai-layout-copy.js +137 -0
- package/src/lib/layout-language/ai-layout-copy.js.map +1 -0
- package/src/lib/layout-language/ai-layout-frame.d.ts +52 -0
- package/src/lib/layout-language/ai-layout-frame.js +457 -0
- package/src/lib/layout-language/ai-layout-frame.js.map +1 -0
- package/src/lib/layout-language/ai-layout-gaps.d.ts +63 -0
- package/src/lib/layout-language/ai-layout-gaps.js +345 -0
- package/src/lib/layout-language/ai-layout-gaps.js.map +1 -0
- package/src/lib/layout-language/ai-layout-language.d.ts +161 -0
- package/src/lib/layout-language/ai-layout-language.js +446 -0
- package/src/lib/layout-language/ai-layout-language.js.map +1 -0
- package/src/lib/layout-language/ai-layout-links.d.ts +80 -0
- package/src/lib/layout-language/ai-layout-links.js +109 -0
- package/src/lib/layout-language/ai-layout-links.js.map +1 -0
- package/src/lib/layout-language/ai-layout-store.d.ts +39 -0
- package/src/lib/layout-language/ai-layout-store.js +69 -0
- package/src/lib/layout-language/ai-layout-store.js.map +1 -0
- package/src/lib/layout-language/ai-layout-tree.d.ts +59 -0
- package/src/lib/layout-language/ai-layout-tree.js +84 -0
- package/src/lib/layout-language/ai-layout-tree.js.map +1 -0
- package/src/lib/lazy-widget.d.ts +45 -0
- package/src/lib/lazy-widget.js +53 -0
- package/src/lib/lazy-widget.js.map +1 -0
- package/src/lib/model/ai-automation-draft.d.ts +18 -0
- package/src/lib/model/ai-automation-draft.js +86 -0
- package/src/lib/model/ai-automation-draft.js.map +1 -1
- package/src/lib/model/ai-build-job.d.ts +201 -0
- package/src/lib/model/ai-build-job.js +472 -0
- package/src/lib/model/ai-build-job.js.map +1 -0
- package/src/lib/model/ai-build-plan.d.ts +61 -0
- package/src/lib/model/ai-build-plan.js +154 -9
- package/src/lib/model/ai-build-plan.js.map +1 -1
- package/src/lib/model/ai-build-progress.d.ts +73 -0
- package/src/lib/model/ai-build-progress.js +170 -0
- package/src/lib/model/ai-build-progress.js.map +1 -0
- package/src/lib/model/ai-host-publish-context.d.ts +51 -0
- package/src/lib/model/ai-host-publish-context.js +104 -0
- package/src/lib/model/ai-host-publish-context.js.map +1 -0
- package/src/lib/model/ai-insight.d.ts +20 -10
- package/src/lib/model/ai-insight.js +72 -9
- package/src/lib/model/ai-insight.js.map +1 -1
- package/src/lib/model/ai-job-activity.d.ts +22 -0
- package/src/lib/model/ai-job-activity.js +25 -2
- package/src/lib/model/ai-job-activity.js.map +1 -1
- package/src/lib/model/ai-job-failure-copy.d.ts +38 -1
- package/src/lib/model/ai-job-failure-copy.js +56 -1
- package/src/lib/model/ai-job-failure-copy.js.map +1 -1
- package/src/lib/model/ai-job-notice.d.ts +3 -1
- package/src/lib/model/ai-job-notice.js +31 -9
- package/src/lib/model/ai-job-notice.js.map +1 -1
- package/src/lib/model/ai-jobs.types.d.ts +99 -2
- package/src/lib/model/ai-jobs.types.js +3 -1
- package/src/lib/model/ai-jobs.types.js.map +1 -1
- package/src/lib/model/ai-logic-job.d.ts +108 -0
- package/src/lib/model/ai-logic-job.js +327 -0
- package/src/lib/model/ai-logic-job.js.map +1 -0
- package/src/lib/model/ai-media-credits.d.ts +52 -0
- package/src/lib/model/ai-media-credits.js +61 -0
- package/src/lib/model/ai-media-credits.js.map +1 -0
- package/src/lib/model/ai-overlay-copy.d.ts +114 -0
- package/src/lib/model/ai-overlay-copy.js +175 -0
- package/src/lib/model/ai-overlay-copy.js.map +1 -0
- package/src/lib/model/ai-site-build-progress.d.ts +25 -4
- package/src/lib/model/ai-site-build-progress.js +194 -11
- package/src/lib/model/ai-site-build-progress.js.map +1 -1
- package/src/lib/model/ai-site-job.d.ts +8 -0
- package/src/lib/model/ai-site-job.js +9 -0
- package/src/lib/model/ai-site-job.js.map +1 -1
- package/src/lib/model/ai-site-start-seo.d.ts +1 -1
- package/src/lib/model/ai-site-start.d.ts +5 -2
- package/src/lib/model/ai-site-start.js +5 -2
- package/src/lib/model/ai-site-start.js.map +1 -1
- package/src/lib/model/ai-svg.d.ts +69 -0
- package/src/lib/model/ai-svg.js +265 -0
- package/src/lib/model/ai-svg.js.map +1 -0
- package/src/lib/model/ai-usage-by-user.d.ts +3 -2
- package/src/lib/model/ai-usage-by-user.js.map +1 -1
- package/src/lib/model/ai-workflow-job.d.ts +92 -4
- package/src/lib/model/ai-workflow-job.js +124 -7
- package/src/lib/model/ai-workflow-job.js.map +1 -1
- package/src/lib/model/assist-build.d.ts +58 -0
- package/src/lib/model/assist-build.js +52 -0
- package/src/lib/model/assist-build.js.map +1 -0
- package/src/lib/model/assist-edit.d.ts +48 -3
- package/src/lib/model/assist-edit.js +48 -4
- package/src/lib/model/assist-edit.js.map +1 -1
- package/src/lib/plugin-config.js +2 -0
- package/src/lib/plugin-config.js.map +1 -1
- package/src/lib/plugin.js +308 -47
- package/src/lib/plugin.js.map +1 -1
- package/src/lib/providers/catalog.d.ts +82 -5
- package/src/lib/providers/catalog.js +83 -12
- package/src/lib/providers/catalog.js.map +1 -1
- package/src/lib/providers/image-contract.d.ts +116 -0
- package/src/lib/providers/image-contract.js +74 -0
- package/src/lib/providers/image-contract.js.map +1 -0
- package/src/lib/providers/model-choice.js +11 -0
- package/src/lib/providers/model-choice.js.map +1 -1
- package/src/lib/providers/routing.js +18 -0
- package/src/lib/providers/routing.js.map +1 -1
- package/src/lib/providers/vertex-image.d.ts +121 -0
- package/src/lib/providers/vertex-image.js +312 -0
- package/src/lib/providers/vertex-image.js.map +1 -0
- package/src/lib/runtime/ai-doctrine-validators.d.ts +101 -0
- package/src/lib/runtime/ai-doctrine-validators.js +525 -4
- package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
- package/src/lib/runtime/ai-doctrine.js +21 -6
- package/src/lib/runtime/ai-doctrine.js.map +1 -1
- package/src/lib/runtime/ai-eval-live.js +4 -0
- package/src/lib/runtime/ai-eval-live.js.map +1 -1
- package/src/lib/runtime/ai-eval.d.ts +15 -1
- package/src/lib/runtime/ai-eval.js +52 -1
- package/src/lib/runtime/ai-eval.js.map +1 -1
- package/src/lib/runtime/ai-icon-library.d.ts +257 -0
- package/src/lib/runtime/ai-icon-library.js +254 -0
- package/src/lib/runtime/ai-icon-library.js.map +1 -0
- package/src/lib/runtime/ai-node-tree.d.ts +9 -0
- package/src/lib/runtime/ai-node-tree.js +30 -4
- package/src/lib/runtime/ai-node-tree.js.map +1 -1
- package/src/lib/runtime/ai-palette.d.ts +6 -0
- package/src/lib/runtime/ai-palette.generated.js +70 -0
- package/src/lib/runtime/ai-palette.generated.js.map +1 -1
- package/src/lib/runtime/ai-palette.js.map +1 -1
- package/src/lib/runtime/experiment-variant-copy.d.ts +34 -0
- package/src/lib/runtime/experiment-variant-copy.js +102 -0
- package/src/lib/runtime/experiment-variant-copy.js.map +1 -0
- package/src/lib/server/ai-experiment-versions.d.ts +51 -0
- package/src/lib/server/ai-experiment-versions.js +270 -0
- package/src/lib/server/ai-experiment-versions.js.map +1 -0
- package/src/lib/server/ai-jobs-resume.js +74 -4
- package/src/lib/server/ai-jobs-resume.js.map +1 -1
- package/src/lib/server/ai-media-image.d.ts +66 -0
- package/src/lib/server/ai-media-image.js +521 -0
- package/src/lib/server/ai-media-image.js.map +1 -0
- package/src/lib/server/ai-media-svg.d.ts +91 -0
- package/src/lib/server/ai-media-svg.js +186 -0
- package/src/lib/server/ai-media-svg.js.map +1 -0
- package/src/lib/server/assist-build.d.ts +54 -0
- package/src/lib/server/assist-build.js +121 -0
- package/src/lib/server/assist-build.js.map +1 -0
- package/src/lib/server/assist-chat.js +108 -12
- package/src/lib/server/assist-chat.js.map +1 -1
- package/src/lib/server/assist-edit.js +213 -3
- package/src/lib/server/assist-edit.js.map +1 -1
- package/src/lib/server/assist-view-context.js +242 -4
- package/src/lib/server/assist-view-context.js.map +1 -1
- package/src/lib/server.js +26 -0
- package/src/lib/server.js.map +1 -1
- package/src/lib/tools/ai-logic-tool.d.ts +27 -0
- package/src/lib/tools/ai-logic-tool.js +207 -0
- package/src/lib/tools/ai-logic-tool.js.map +1 -0
- package/src/lib/tools/ai-overlay-tool.d.ts +35 -0
- package/src/lib/tools/ai-overlay-tool.js +107 -0
- package/src/lib/tools/ai-overlay-tool.js.map +1 -0
- package/src/lib/tools/ai-workflow-tool.d.ts +17 -2
- package/src/lib/tools/ai-workflow-tool.js +47 -14
- package/src/lib/tools/ai-workflow-tool.js.map +1 -1
- package/src/lib/usage/assist-job-refund.d.ts +28 -1
- package/src/lib/usage/assist-job-refund.js +44 -9
- package/src/lib/usage/assist-job-refund.js.map +1 -1
- package/src/lib/usage/assist-usage.d.ts +5 -0
- package/src/lib/usage/assist-usage.js +2 -0
- package/src/lib/usage/assist-usage.js.map +1 -1
|
@@ -1,50 +1,8 @@
|
|
|
1
1
|
import type { ConsoleDockZoneProps } from '@aglyn/aglyn';
|
|
2
|
-
import {
|
|
3
|
-
import { AiAssistProvider } from './ai-assist-provider.component';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
4
3
|
import { AssistPanelComponent } from './assist-panel.component';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* the reader's verdict for every catalog key a plugin declared, on the site
|
|
8
|
-
* in view, with `loaded` false until every read behind it has answered.
|
|
9
|
-
*/
|
|
10
|
-
export interface ShellPermissionsOnHost {
|
|
11
|
-
loaded: boolean;
|
|
12
|
-
granted: Readonly<Record<string, boolean>>;
|
|
13
|
-
}
|
|
14
|
-
/** The AI half of that answer, in the shape the AI surfaces hold on. */
|
|
15
|
-
export interface AiPermissionsAnswer {
|
|
16
|
-
loaded: boolean;
|
|
17
|
-
use: boolean;
|
|
18
|
-
generate: boolean;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* The shell's answer read for the two AI keys. `undefined` while the shell
|
|
22
|
-
* has handed nothing, which the provider reads as pending; one object per
|
|
23
|
-
* verdict, so the callbacks keyed on it are not rebuilt on every render.
|
|
24
|
-
*/
|
|
25
|
-
export declare function useAiPermissionsOnHost(answer: ShellPermissionsOnHost | undefined): AiPermissionsAnswer | undefined;
|
|
26
|
-
type ProviderProps = Omit<ComponentProps<typeof AiAssistProvider>, 'aiPermissions'> & {
|
|
27
|
-
permissionsOnHost?: ShellPermissionsOnHost;
|
|
28
|
-
/**
|
|
29
|
-
* The plugins that run on the site in view, as the shell resolved them
|
|
30
|
-
* (AGL-3028). Absent where the shell hands none, which reads as no site
|
|
31
|
-
* narrowing at all.
|
|
32
|
-
*/
|
|
33
|
-
enabledPluginIds?: readonly string[];
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* The besigner copy assistant's provider, holding on the shell's permission
|
|
37
|
-
* answer.
|
|
38
|
-
*
|
|
39
|
-
* On a site with AI switched off (AGL-3028) it stays MOUNTED — it wraps every
|
|
40
|
-
* console page, and a provider that came and went per site would remount the
|
|
41
|
-
* whole tree beneath it — and opens nothing: a settled refusal publishes no
|
|
42
|
-
* callback, so no control can reach its dialogs.
|
|
43
|
-
*/
|
|
44
|
-
export declare function AiAssistProviderOnHost(props: ProviderProps): import("react").JSX.Element;
|
|
45
|
-
export declare namespace AiAssistProviderOnHost {
|
|
46
|
-
var displayName: string;
|
|
47
|
-
}
|
|
4
|
+
import { type ShellPermissionsOnHost } from './ai-assist-provider-on-host.component';
|
|
5
|
+
export { AiAssistProviderOnHost, useAiPermissionsOnHost, type AiPermissionsAnswer, type ShellPermissionsOnHost, } from './ai-assist-provider-on-host.component';
|
|
48
6
|
type PanelProps = Omit<ComponentProps<typeof AssistPanelComponent>, 'aiPermissions' | 'assistVisible' | 'assistStaffPreview' | 'generativeVisible'> & {
|
|
49
7
|
permissionsOnHost?: ShellPermissionsOnHost;
|
|
50
8
|
/**
|
|
@@ -62,4 +20,3 @@ export declare function AssistPanelOnHost(props: PanelProps): import("react").JS
|
|
|
62
20
|
export declare namespace AssistPanelOnHost {
|
|
63
21
|
var displayName: string;
|
|
64
22
|
}
|
|
65
|
-
export {};
|
|
@@ -17,65 +17,17 @@
|
|
|
17
17
|
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
18
18
|
import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
|
|
19
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
-
import { useMemo } from "react";
|
|
21
|
-
import { AI_PLUGIN_ID } from "../constants.js";
|
|
22
|
-
import { aiPermissionsOf } from "../model/ai-permissions.js";
|
|
23
|
-
import { AiAssistProvider } from "./ai-assist-provider.component.js";
|
|
24
20
|
import { AssistPanelComponent } from "./assist-panel.component.js";
|
|
21
|
+
import { useAiPermissionsOnHost } from "./ai-assist-provider-on-host.component.js";
|
|
22
|
+
// The provider half lives in its own module (AGL-3649), so the eager
|
|
23
|
+
// provider loads nothing of the dock's; it is re-exported here for the
|
|
24
|
+
// importers that knew it by this name.
|
|
25
|
+
export { AiAssistProviderOnHost, useAiPermissionsOnHost } from "./ai-assist-provider-on-host.component.js";
|
|
25
26
|
const HELD = {
|
|
26
27
|
loaded: false,
|
|
27
28
|
use: false,
|
|
28
29
|
generate: false
|
|
29
30
|
};
|
|
30
|
-
/**
|
|
31
|
-
* The shell's answer read for the two AI keys. `undefined` while the shell
|
|
32
|
-
* has handed nothing, which the provider reads as pending; one object per
|
|
33
|
-
* verdict, so the callbacks keyed on it are not rebuilt on every render.
|
|
34
|
-
*/ export function useAiPermissionsOnHost(answer) {
|
|
35
|
-
const present = answer !== undefined;
|
|
36
|
-
const loaded = (answer == null ? void 0 : answer.loaded) === true;
|
|
37
|
-
const verdict = aiPermissionsOf(loaded ? answer == null ? void 0 : answer.granted : null);
|
|
38
|
-
const use = verdict['ai.use'];
|
|
39
|
-
const generate = verdict['ai.generate'];
|
|
40
|
-
return useMemo(()=>present ? {
|
|
41
|
-
loaded,
|
|
42
|
-
use,
|
|
43
|
-
generate
|
|
44
|
-
} : undefined, [
|
|
45
|
-
present,
|
|
46
|
-
loaded,
|
|
47
|
-
use,
|
|
48
|
-
generate
|
|
49
|
-
]);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Every AI door closed, as a settled answer: what the provider holds on a site
|
|
53
|
-
* that switched AI off. One object, so the callbacks keyed on it are stable.
|
|
54
|
-
*/ const OFF_FOR_SITE = {
|
|
55
|
-
loaded: true,
|
|
56
|
-
use: false,
|
|
57
|
-
generate: false
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* The besigner copy assistant's provider, holding on the shell's permission
|
|
61
|
-
* answer.
|
|
62
|
-
*
|
|
63
|
-
* On a site with AI switched off (AGL-3028) it stays MOUNTED — it wraps every
|
|
64
|
-
* console page, and a provider that came and went per site would remount the
|
|
65
|
-
* whole tree beneath it — and opens nothing: a settled refusal publishes no
|
|
66
|
-
* callback, so no control can reach its dialogs.
|
|
67
|
-
*/ export function AiAssistProviderOnHost(props) {
|
|
68
|
-
const { permissionsOnHost, enabledPluginIds } = props, rest = _object_without_properties_loose(props, [
|
|
69
|
-
"permissionsOnHost",
|
|
70
|
-
"enabledPluginIds"
|
|
71
|
-
]);
|
|
72
|
-
const aiPermissions = useAiPermissionsOnHost(permissionsOnHost);
|
|
73
|
-
const offForSite = Boolean(enabledPluginIds) && !(enabledPluginIds == null ? void 0 : enabledPluginIds.includes(AI_PLUGIN_ID));
|
|
74
|
-
return /*#__PURE__*/ _jsx(AiAssistProvider, _extends({}, rest, {
|
|
75
|
-
aiPermissions: offForSite ? OFF_FOR_SITE : aiPermissions
|
|
76
|
-
}));
|
|
77
|
-
}
|
|
78
|
-
AiAssistProviderOnHost.displayName = 'AiAssistProviderOnHost';
|
|
79
31
|
/**
|
|
80
32
|
* The assistant, drawn in the console dock, holding on the shell's
|
|
81
33
|
* permission answer and asking the shell for its own release flags.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/components/ai-permissions-on-host.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 type { ConsoleDockZoneProps } from '@aglyn/aglyn'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/components/ai-permissions-on-host.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 type { ConsoleDockZoneProps } from '@aglyn/aglyn'\nimport type { ComponentProps } from 'react'\nimport { AssistPanelComponent } from './assist-panel.component'\nimport {\n useAiPermissionsOnHost,\n type AiPermissionsAnswer,\n type ShellPermissionsOnHost,\n} from './ai-assist-provider-on-host.component'\n\n// The provider half lives in its own module (AGL-3649), so the eager\n// provider loads nothing of the dock's; it is re-exported here for the\n// importers that knew it by this name.\nexport {\n AiAssistProviderOnHost,\n useAiPermissionsOnHost,\n type AiPermissionsAnswer,\n type ShellPermissionsOnHost,\n} from './ai-assist-provider-on-host.component'\n\nconst HELD: AiPermissionsAnswer = { loaded: false, use: false, generate: false }\n\ntype PanelProps = Omit<\n ComponentProps<typeof AssistPanelComponent>,\n 'aiPermissions' | 'assistVisible' | 'assistStaffPreview' | 'generativeVisible'\n> & {\n permissionsOnHost?: ShellPermissionsOnHost\n /**\n * The shell's verdict for any release flag (the `consoleDock` zone's\n * `releaseVerdict`): the assistant asks for its own two, so the shell names\n * no AI flag.\n */\n releaseVerdict: ConsoleDockZoneProps['releaseVerdict']\n}\n\n/**\n * The assistant, drawn in the console dock, holding on the shell's\n * permission answer and asking the shell for its own release flags.\n */\nexport function AssistPanelOnHost(props: PanelProps) {\n const { permissionsOnHost, releaseVerdict, ...rest } = props\n const aiPermissions = useAiPermissionsOnHost(permissionsOnHost) ?? HELD\n const assist = releaseVerdict('release_assist')\n const generative = releaseVerdict('release_ai_generative')\n return (\n <AssistPanelComponent\n {...rest}\n assistVisible={assist.visible}\n assistStaffPreview={assist.staffPreview}\n generativeVisible={generative.visible}\n aiPermissions={aiPermissions}\n />\n )\n}\nAssistPanelOnHost.displayName = 'AssistPanelOnHost'\n"],"names":["AssistPanelComponent","useAiPermissionsOnHost","AiAssistProviderOnHost","HELD","loaded","use","generate","AssistPanelOnHost","props","permissionsOnHost","releaseVerdict","rest","aiPermissions","assist","generative","assistVisible","visible","assistStaffPreview","staffPreview","generativeVisible","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;;AAIA,SAASA,oBAAoB,QAAQ,8BAA0B;AAC/D,SACEC,sBAAsB,QAGjB,4CAAwC;AAE/C,qEAAqE;AACrE,uEAAuE;AACvE,uCAAuC;AACvC,SACEC,sBAAsB,EACtBD,sBAAsB,QAGjB,4CAAwC;AAE/C,MAAME,OAA4B;IAAEC,QAAQ;IAAOC,KAAK;IAAOC,UAAU;AAAM;AAe/E;;;CAGC,GACD,OAAO,SAASC,kBAAkBC,KAAiB;QAE3BP;IADtB,MAAM,EAAEQ,iBAAiB,EAAEC,cAAc,EAAW,GAAGF,OAATG,wCAASH;;;;IACvD,MAAMI,iBAAgBX,0BAAAA,uBAAuBQ,8BAAvBR,0BAA6CE;IACnE,MAAMU,SAASH,eAAe;IAC9B,MAAMI,aAAaJ,eAAe;IAClC,qBACE,KAACV,mCACKW;QACJI,eAAeF,OAAOG,OAAO;QAC7BC,oBAAoBJ,OAAOK,YAAY;QACvCC,mBAAmBL,WAAWE,OAAO;QACrCJ,eAAeA;;AAGrB;AACAL,kBAAkBa,WAAW,GAAG"}
|
|
@@ -122,3 +122,8 @@ export interface ConsoleProductImportZoneProps {
|
|
|
122
122
|
options: Readonly<Record<string, boolean>>;
|
|
123
123
|
setOption: (key: string, on: boolean) => void;
|
|
124
124
|
}
|
|
125
|
+
/** What `productsCreate` hands each widget: the site and its org (AGL-3596). */
|
|
126
|
+
export interface ConsoleProductsCreateZoneProps {
|
|
127
|
+
hostId: string;
|
|
128
|
+
orgId: string | undefined;
|
|
129
|
+
}
|
|
@@ -27,6 +27,6 @@
|
|
|
27
27
|
* the injection zones reference.
|
|
28
28
|
*
|
|
29
29
|
* Types only: nothing here reaches a bundle.
|
|
30
|
-
*/ /**
|
|
30
|
+
*/ /** What `productsCreate` hands each widget: the site and its org (AGL-3596). */ export { };
|
|
31
31
|
|
|
32
32
|
//# sourceMappingURL=ai-product-zones.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/components/ai-product-zones.ts"],"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\n/**\n * What the commerce plugin's product zones hand this plugin's widgets.\n *\n * `productEditor`, `productsHub` and `productImport` are zones the commerce\n * plugin hosts and declares (`registerPluginZone`), with their props on its\n * own zone tokens. A plugin never imports another plugin, so the widgets\n * registered there read the props through the shapes restated here — the\n * zone's props as the host documents them, by the same names. A widget is\n * handed whatever the host passes, so this restates what the host SENDS; a\n * field dropped from the host's declaration leaves a widget reading\n * `undefined`, which is why every member below is one the host documents in\n * the injection zones reference.\n *\n * Types only: nothing here reaches a bundle.\n */\n\nexport type ConsoleProductType = 'physical' | 'digital' | 'service'\n\nexport interface ConsoleProductOption {\n name: string\n values: string[]\n}\n\n/** A product as the editor holds it: saved, or staged and unsaved. */\nexport interface ConsoleProductDraft {\n /** `null` for a product nobody has saved yet. */\n id: string | null\n name: string\n type: ConsoleProductType\n description: string\n tags: string[]\n categoryIds: string[]\n options: ConsoleProductOption[]\n /** The product's media, in order; the first is the photo the storefront leads with. */\n mediaUrls: string[]\n seoTitle: string\n seoDescription: string\n}\n\n/**\n * Copy proposed for one product. A field left out is left alone;\n * `optionNames` renames the product's options in order.\n */\nexport interface ConsoleProductCopyValues {\n description?: string\n tags?: string[]\n categoryIds?: string[]\n optionNames?: string[]\n seoTitle?: string\n seoDescription?: string\n}\n\n/** The `productEditor` zone: the product, and a door that stages copy as unsaved edits. */\nexport interface ConsoleProductEditorZoneProps {\n hostId: string\n orgId: string | undefined\n product: ConsoleProductDraft\n categories: ReadonlyArray<{ id: string; name: string }>\n proposeValues: (values: ConsoleProductCopyValues, key: string) => void\n}\n\n/** A catalog row as the products hub holds it. */\nexport interface ConsoleProductSummary {\n id: string\n name: string\n status: 'draft' | 'active' | 'archived'\n priceMissing: boolean\n hasPhoto: boolean\n}\n\n/** A new product proposed to the hub, which creates it as a draft with no price. */\nexport interface ConsoleProposedProduct {\n name: string\n type: ConsoleProductType\n description: string\n tags: string[]\n options: ConsoleProductOption[]\n seoTitle: string\n seoDescription: string\n}\n\n/** A discount proposed to the hub, which creates it switched off. */\nexport interface ConsoleProposedDiscount {\n name: string\n code: string | null\n kind: 'percent' | 'fixed' | 'free_shipping'\n valuePct: number | null\n valueCents: number | null\n minSubtotalCents: number | null\n}\n\n/** The `productsHub` zone: the catalog rows, the latest import, and the hub's writes. */\nexport interface ConsoleProductsHubZoneProps {\n hostId: string\n orgId: string | undefined\n products: readonly ConsoleProductSummary[]\n lastImport: {\n key: string\n productIds: readonly string[]\n options: Readonly<Record<string, boolean>>\n } | null\n applyProductCopy: (productId: string, values: ConsoleProductCopyValues) => Promise<void>\n createProductDrafts: (products: readonly ConsoleProposedProduct[]) => Promise<string[]>\n createCategories: (names: readonly string[]) => Promise<number>\n createDiscountDrafts: (discounts: readonly ConsoleProposedDiscount[]) => Promise<number>\n}\n\n/** The `productImport` zone: the import's size and the options set for it. */\nexport interface ConsoleProductImportZoneProps {\n hostId: string\n orgId: string | undefined\n count: number\n options: Readonly<Record<string, boolean>>\n setOption: (key: string, on: boolean) => void\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;CAcC,
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/components/ai-product-zones.ts"],"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\n/**\n * What the commerce plugin's product zones hand this plugin's widgets.\n *\n * `productEditor`, `productsHub` and `productImport` are zones the commerce\n * plugin hosts and declares (`registerPluginZone`), with their props on its\n * own zone tokens. A plugin never imports another plugin, so the widgets\n * registered there read the props through the shapes restated here — the\n * zone's props as the host documents them, by the same names. A widget is\n * handed whatever the host passes, so this restates what the host SENDS; a\n * field dropped from the host's declaration leaves a widget reading\n * `undefined`, which is why every member below is one the host documents in\n * the injection zones reference.\n *\n * Types only: nothing here reaches a bundle.\n */\n\nexport type ConsoleProductType = 'physical' | 'digital' | 'service'\n\nexport interface ConsoleProductOption {\n name: string\n values: string[]\n}\n\n/** A product as the editor holds it: saved, or staged and unsaved. */\nexport interface ConsoleProductDraft {\n /** `null` for a product nobody has saved yet. */\n id: string | null\n name: string\n type: ConsoleProductType\n description: string\n tags: string[]\n categoryIds: string[]\n options: ConsoleProductOption[]\n /** The product's media, in order; the first is the photo the storefront leads with. */\n mediaUrls: string[]\n seoTitle: string\n seoDescription: string\n}\n\n/**\n * Copy proposed for one product. A field left out is left alone;\n * `optionNames` renames the product's options in order.\n */\nexport interface ConsoleProductCopyValues {\n description?: string\n tags?: string[]\n categoryIds?: string[]\n optionNames?: string[]\n seoTitle?: string\n seoDescription?: string\n}\n\n/** The `productEditor` zone: the product, and a door that stages copy as unsaved edits. */\nexport interface ConsoleProductEditorZoneProps {\n hostId: string\n orgId: string | undefined\n product: ConsoleProductDraft\n categories: ReadonlyArray<{ id: string; name: string }>\n proposeValues: (values: ConsoleProductCopyValues, key: string) => void\n}\n\n/** A catalog row as the products hub holds it. */\nexport interface ConsoleProductSummary {\n id: string\n name: string\n status: 'draft' | 'active' | 'archived'\n priceMissing: boolean\n hasPhoto: boolean\n}\n\n/** A new product proposed to the hub, which creates it as a draft with no price. */\nexport interface ConsoleProposedProduct {\n name: string\n type: ConsoleProductType\n description: string\n tags: string[]\n options: ConsoleProductOption[]\n seoTitle: string\n seoDescription: string\n}\n\n/** A discount proposed to the hub, which creates it switched off. */\nexport interface ConsoleProposedDiscount {\n name: string\n code: string | null\n kind: 'percent' | 'fixed' | 'free_shipping'\n valuePct: number | null\n valueCents: number | null\n minSubtotalCents: number | null\n}\n\n/** The `productsHub` zone: the catalog rows, the latest import, and the hub's writes. */\nexport interface ConsoleProductsHubZoneProps {\n hostId: string\n orgId: string | undefined\n products: readonly ConsoleProductSummary[]\n lastImport: {\n key: string\n productIds: readonly string[]\n options: Readonly<Record<string, boolean>>\n } | null\n applyProductCopy: (productId: string, values: ConsoleProductCopyValues) => Promise<void>\n createProductDrafts: (products: readonly ConsoleProposedProduct[]) => Promise<string[]>\n createCategories: (names: readonly string[]) => Promise<number>\n createDiscountDrafts: (discounts: readonly ConsoleProposedDiscount[]) => Promise<number>\n}\n\n/** The `productImport` zone: the import's size and the options set for it. */\nexport interface ConsoleProductImportZoneProps {\n hostId: string\n orgId: string | undefined\n count: number\n options: Readonly<Record<string, boolean>>\n setOption: (key: string, on: boolean) => void\n}\n\n/** What `productsCreate` hands each widget: the site and its org (AGL-3596). */\nexport interface ConsoleProductsCreateZoneProps {\n hostId: string\n orgId: string | undefined\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;CAcC,GAsGD,8EAA8E,GAC9E,WAGC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import type { ConsoleWidgetEntitlementProps } from '@aglyn/aglyn/plugin-manager/feature-plugins';
|
|
18
|
+
import type { ConsoleProductsCreateZoneProps } from './ai-product-zones';
|
|
19
|
+
/**
|
|
20
|
+
* "Create with AI" for products (AGL-3596), beside Add product and in the
|
|
21
|
+
* empty catalog, through the commerce plugin's `productsCreate` zone.
|
|
22
|
+
*
|
|
23
|
+
* Products from a brief are already the products hub card's ("Propose
|
|
24
|
+
* products", AGL-2916): the card starts the `products` job, and the proposal
|
|
25
|
+
* is reviewed in its table and written through the hub's own writes, which
|
|
26
|
+
* only the `productsHub` zone hands a widget. So this button is a door to
|
|
27
|
+
* that brief, not a second flow: the card registers an opener for its site
|
|
28
|
+
* as it mounts, and the button shows only while one is registered — never
|
|
29
|
+
* where the card could not take the brief, or would not show the proposal.
|
|
30
|
+
* Both are drawn from the shell's gates alone (AGL-3601), so nothing asks a
|
|
31
|
+
* server until the brief is sent; on a plan without the AI add-on the button
|
|
32
|
+
* opens the add-on's dialog instead.
|
|
33
|
+
*/
|
|
34
|
+
type Opener = () => void;
|
|
35
|
+
/** The products hub card offers its "Propose products" brief for a site; returns the release. */
|
|
36
|
+
export declare function registerAiProductsBriefOpener(hostId: string, open: Opener): () => void;
|
|
37
|
+
/** Opens the newest card's brief for the site; `false` when no card offers one. */
|
|
38
|
+
export declare function openAiProductsBrief(hostId: string): boolean;
|
|
39
|
+
/** Whether a hub card on this site takes the brief right now. */
|
|
40
|
+
export declare function useAiProductsBriefAvailable(hostId: string): boolean;
|
|
41
|
+
export declare function AiCreateProductsButton({ hostId, entitled, upgrade, }: ConsoleProductsCreateZoneProps & ConsoleWidgetEntitlementProps): import("react").JSX.Element;
|
|
42
|
+
export default AiCreateProductsButton;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { mdiCreation } from "@aglyn/shared-data-mdi";
|
|
4
|
+
import { MdiIcon } from "@aglyn/shared-ui-jsx";
|
|
5
|
+
import { Button } from "@mui/material";
|
|
6
|
+
import { useCallback, useSyncExternalStore } from "react";
|
|
7
|
+
import { AiUpsellButton } from "./ai-upsell-dialog.component.js";
|
|
8
|
+
/** The open hub cards' brief openers, by site. */ const openers = new Map();
|
|
9
|
+
const subscribers = new Set();
|
|
10
|
+
function notify() {
|
|
11
|
+
for (const subscriber of subscribers)subscriber();
|
|
12
|
+
}
|
|
13
|
+
/** The products hub card offers its "Propose products" brief for a site; returns the release. */ export function registerAiProductsBriefOpener(hostId, open) {
|
|
14
|
+
var _openers_get;
|
|
15
|
+
const set = (_openers_get = openers.get(hostId)) != null ? _openers_get : new Set();
|
|
16
|
+
set.add(open);
|
|
17
|
+
openers.set(hostId, set);
|
|
18
|
+
notify();
|
|
19
|
+
return ()=>{
|
|
20
|
+
set.delete(open);
|
|
21
|
+
if (!set.size) openers.delete(hostId);
|
|
22
|
+
notify();
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/** Opens the newest card's brief for the site; `false` when no card offers one. */ export function openAiProductsBrief(hostId) {
|
|
26
|
+
const set = openers.get(hostId);
|
|
27
|
+
if (!(set == null ? void 0 : set.size)) return false;
|
|
28
|
+
[
|
|
29
|
+
...set
|
|
30
|
+
][set.size - 1]();
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
function subscribe(onChange) {
|
|
34
|
+
subscribers.add(onChange);
|
|
35
|
+
return ()=>{
|
|
36
|
+
subscribers.delete(onChange);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** Whether a hub card on this site takes the brief right now. */ export function useAiProductsBriefAvailable(hostId) {
|
|
40
|
+
const read = useCallback(()=>{
|
|
41
|
+
var _openers_get;
|
|
42
|
+
return Boolean((_openers_get = openers.get(hostId)) == null ? void 0 : _openers_get.size);
|
|
43
|
+
}, [
|
|
44
|
+
hostId
|
|
45
|
+
]);
|
|
46
|
+
return useSyncExternalStore(subscribe, read, ()=>false);
|
|
47
|
+
}
|
|
48
|
+
export function AiCreateProductsButton({ hostId, entitled, upgrade }) {
|
|
49
|
+
const available = useAiProductsBriefAvailable(hostId);
|
|
50
|
+
if (entitled === false) return upgrade ? /*#__PURE__*/ _jsx(AiUpsellButton, {
|
|
51
|
+
kind: "product",
|
|
52
|
+
upgrade: upgrade
|
|
53
|
+
}) : null;
|
|
54
|
+
if (!available) return null;
|
|
55
|
+
return /*#__PURE__*/ _jsx(Button, {
|
|
56
|
+
size: "small",
|
|
57
|
+
variant: "outlined",
|
|
58
|
+
startIcon: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
59
|
+
path: mdiCreation.path
|
|
60
|
+
}),
|
|
61
|
+
onClick: ()=>openAiProductsBrief(hostId),
|
|
62
|
+
children: 'Create with AI'
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
export default AiCreateProductsButton;
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=ai-products-create-button.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/ai/src/lib/components/ai-products-create-button.component.tsx"],"sourcesContent":["'use client'\n\n/**\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\nimport type { ConsoleWidgetEntitlementProps } from '@aglyn/aglyn/plugin-manager/feature-plugins'\nimport { mdiCreation } from '@aglyn/shared-data-mdi'\nimport { MdiIcon } from '@aglyn/shared-ui-jsx'\nimport { Button } from '@mui/material'\nimport { useCallback, useSyncExternalStore } from 'react'\nimport type { ConsoleProductsCreateZoneProps } from './ai-product-zones'\nimport { AiUpsellButton } from './ai-upsell-dialog.component'\n\n/**\n * \"Create with AI\" for products (AGL-3596), beside Add product and in the\n * empty catalog, through the commerce plugin's `productsCreate` zone.\n *\n * Products from a brief are already the products hub card's (\"Propose\n * products\", AGL-2916): the card starts the `products` job, and the proposal\n * is reviewed in its table and written through the hub's own writes, which\n * only the `productsHub` zone hands a widget. So this button is a door to\n * that brief, not a second flow: the card registers an opener for its site\n * as it mounts, and the button shows only while one is registered — never\n * where the card could not take the brief, or would not show the proposal.\n * Both are drawn from the shell's gates alone (AGL-3601), so nothing asks a\n * server until the brief is sent; on a plan without the AI add-on the button\n * opens the add-on's dialog instead.\n */\n\ntype Opener = () => void\n\n/** The open hub cards' brief openers, by site. */\nconst openers = new Map<string, Set<Opener>>()\nconst subscribers = new Set<() => void>()\n\nfunction notify() {\n for (const subscriber of subscribers) subscriber()\n}\n\n/** The products hub card offers its \"Propose products\" brief for a site; returns the release. */\nexport function registerAiProductsBriefOpener(hostId: string, open: Opener): () => void {\n const set = openers.get(hostId) ?? new Set<Opener>()\n set.add(open)\n openers.set(hostId, set)\n notify()\n return () => {\n set.delete(open)\n if (!set.size) openers.delete(hostId)\n notify()\n }\n}\n\n/** Opens the newest card's brief for the site; `false` when no card offers one. */\nexport function openAiProductsBrief(hostId: string): boolean {\n const set = openers.get(hostId)\n if (!set?.size) return false\n ;[...set][set.size - 1]()\n return true\n}\n\nfunction subscribe(onChange: () => void) {\n subscribers.add(onChange)\n return () => {\n subscribers.delete(onChange)\n }\n}\n\n/** Whether a hub card on this site takes the brief right now. */\nexport function useAiProductsBriefAvailable(hostId: string): boolean {\n const read = useCallback(() => Boolean(openers.get(hostId)?.size), [hostId])\n return useSyncExternalStore(subscribe, read, () => false)\n}\n\nexport function AiCreateProductsButton({\n hostId,\n entitled,\n upgrade,\n}: ConsoleProductsCreateZoneProps & ConsoleWidgetEntitlementProps) {\n const available = useAiProductsBriefAvailable(hostId)\n if (entitled === false) return upgrade ? <AiUpsellButton kind=\"product\" upgrade={upgrade} /> : null\n if (!available) return null\n return (\n <Button\n size=\"small\"\n variant=\"outlined\"\n startIcon={<MdiIcon path={mdiCreation.path} />}\n onClick={() => openAiProductsBrief(hostId)}\n >\n {'Create with AI'}\n </Button>\n )\n}\n\nexport default AiCreateProductsButton\n"],"names":["mdiCreation","MdiIcon","Button","useCallback","useSyncExternalStore","AiUpsellButton","openers","Map","subscribers","Set","notify","subscriber","registerAiProductsBriefOpener","hostId","open","set","get","add","delete","size","openAiProductsBrief","subscribe","onChange","useAiProductsBriefAvailable","read","Boolean","AiCreateProductsButton","entitled","upgrade","available","kind","variant","startIcon","path","onClick"],"mappings":"AAAA;;AAoBA,SAASA,WAAW,QAAQ,yBAAwB;AACpD,SAASC,OAAO,QAAQ,uBAAsB;AAC9C,SAASC,MAAM,QAAQ,gBAAe;AACtC,SAASC,WAAW,EAAEC,oBAAoB,QAAQ,QAAO;AAEzD,SAASC,cAAc,QAAQ,kCAA8B;AAoB7D,gDAAgD,GAChD,MAAMC,UAAU,IAAIC;AACpB,MAAMC,cAAc,IAAIC;AAExB,SAASC;IACP,KAAK,MAAMC,cAAcH,YAAaG;AACxC;AAEA,+FAA+F,GAC/F,OAAO,SAASC,8BAA8BC,MAAc,EAAEC,IAAY;QAC5DR;IAAZ,MAAMS,OAAMT,eAAAA,QAAQU,GAAG,CAACH,mBAAZP,eAAuB,IAAIG;IACvCM,IAAIE,GAAG,CAACH;IACRR,QAAQS,GAAG,CAACF,QAAQE;IACpBL;IACA,OAAO;QACLK,IAAIG,MAAM,CAACJ;QACX,IAAI,CAACC,IAAII,IAAI,EAAEb,QAAQY,MAAM,CAACL;QAC9BH;IACF;AACF;AAEA,iFAAiF,GACjF,OAAO,SAASU,oBAAoBP,MAAc;IAChD,MAAME,MAAMT,QAAQU,GAAG,CAACH;IACxB,IAAI,EAACE,uBAAAA,IAAKI,IAAI,GAAE,OAAO;IACtB;WAAIJ;KAAI,CAACA,IAAII,IAAI,GAAG,EAAE;IACvB,OAAO;AACT;AAEA,SAASE,UAAUC,QAAoB;IACrCd,YAAYS,GAAG,CAACK;IAChB,OAAO;QACLd,YAAYU,MAAM,CAACI;IACrB;AACF;AAEA,+DAA+D,GAC/D,OAAO,SAASC,4BAA4BV,MAAc;IACxD,MAAMW,OAAOrB,YAAY;YAAcG;eAARmB,SAAQnB,eAAAA,QAAQU,GAAG,CAACH,4BAAZP,aAAqBa,IAAI;OAAG;QAACN;KAAO;IAC3E,OAAOT,qBAAqBiB,WAAWG,MAAM,IAAM;AACrD;AAEA,OAAO,SAASE,uBAAuB,EACrCb,MAAM,EACNc,QAAQ,EACRC,OAAO,EACwD;IAC/D,MAAMC,YAAYN,4BAA4BV;IAC9C,IAAIc,aAAa,OAAO,OAAOC,wBAAU,KAACvB;QAAeyB,MAAK;QAAUF,SAASA;SAAc;IAC/F,IAAI,CAACC,WAAW,OAAO;IACvB,qBACE,KAAC3B;QACCiB,MAAK;QACLY,SAAQ;QACRC,yBAAW,KAAC/B;YAAQgC,MAAMjC,YAAYiC,IAAI;;QAC1CC,SAAS,IAAMd,oBAAoBP;kBAElC;;AAGP;AAEA,eAAea,uBAAsB"}
|
|
@@ -21,6 +21,7 @@ import { ListTable } from "@aglyn/shared-ui-jsx/components/list-table.component"
|
|
|
21
21
|
import { Alert, Box, Button, Chip, Dialog, DialogActions, DialogContent, DialogTitle, Link, Stack, TextField, Typography } from "@mui/material";
|
|
22
22
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
23
23
|
import { AI_PRODUCTS_BULK_MAX, AI_PRODUCTS_IMPORT_WRITE_COPY, aiProductsBulkBrief, aiProductsBulkCount, aiProductsJobInputs, aiProductsProposalOfKind } from "../model/ai-products.js";
|
|
24
|
+
import { registerAiProductsBriefOpener } from "./ai-products-create-button.component.js";
|
|
24
25
|
import { AiBulkCopyReview, AiCatalogReview, AiCategoriesReview } from "./ai-products-proposals.component.js";
|
|
25
26
|
import { useAiProductsJobs } from "./use-ai-products-jobs.js";
|
|
26
27
|
/**
|
|
@@ -37,6 +38,9 @@ import { useAiProductsJobs } from "./use-ai-products-jobs.js";
|
|
|
37
38
|
* - **Propose categories and discounts** — from a brief, created as the
|
|
38
39
|
* catalog and discounts cards create them, every discount switched off.
|
|
39
40
|
*
|
|
41
|
+
* "Create with AI" beside Add product and in the empty catalog
|
|
42
|
+
* (`productsCreate`, AGL-3596) opens the Propose products brief here.
|
|
43
|
+
*
|
|
40
44
|
* An import whose `productImport` option asked for it starts a copy job for
|
|
41
45
|
* the products the import created, as they land. Every write is the hub's
|
|
42
46
|
* (`ConsoleProductsHubZoneProps`); this card writes nothing itself.
|
|
@@ -109,6 +113,17 @@ export function AiProductsHubCard(props) {
|
|
|
109
113
|
lastImport,
|
|
110
114
|
startBulk
|
|
111
115
|
]);
|
|
116
|
+
// "Create with AI" beside Add product (AGL-3596) opens this card's
|
|
117
|
+
// Propose products brief. Offered from the moment the card is on the page,
|
|
118
|
+
// so the door draws from the shell's gates alone (AGL-3601) rather than
|
|
119
|
+
// after this card's list of recent proposals is read; the start door
|
|
120
|
+
// decides when the brief is sent, and says why in the dialog if it refuses.
|
|
121
|
+
useEffect(()=>registerAiProductsBriefOpener(hostId, ()=>setBrief({
|
|
122
|
+
kind: 'catalog',
|
|
123
|
+
text: ''
|
|
124
|
+
})), [
|
|
125
|
+
hostId
|
|
126
|
+
]);
|
|
112
127
|
const heldNames = useMemo(()=>new Set(products.map((product)=>nameKey(product.name))), [
|
|
113
128
|
products
|
|
114
129
|
]);
|
|
@@ -138,7 +153,6 @@ export function AiProductsHubCard(props) {
|
|
|
138
153
|
width: 110
|
|
139
154
|
}
|
|
140
155
|
], []);
|
|
141
|
-
if (verdict !== 'ready') return null;
|
|
142
156
|
const latest = (target)=>{
|
|
143
157
|
var _jobs_find;
|
|
144
158
|
return (_jobs_find = jobs.find((job)=>targetOf(job, started) === target)) != null ? _jobs_find : null;
|
|
@@ -168,6 +182,90 @@ export function AiProductsHubCard(props) {
|
|
|
168
182
|
setBusy(false);
|
|
169
183
|
}
|
|
170
184
|
};
|
|
185
|
+
const briefDialog = /*#__PURE__*/ _jsxs(Dialog, {
|
|
186
|
+
open: Boolean(brief),
|
|
187
|
+
onClose: busy ? undefined : ()=>setBrief(null),
|
|
188
|
+
fullWidth: true,
|
|
189
|
+
maxWidth: "sm",
|
|
190
|
+
children: [
|
|
191
|
+
/*#__PURE__*/ _jsx(DialogTitle, {
|
|
192
|
+
children: copy == null ? void 0 : copy.title
|
|
193
|
+
}),
|
|
194
|
+
/*#__PURE__*/ _jsx(DialogContent, {
|
|
195
|
+
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
196
|
+
spacing: 2,
|
|
197
|
+
sx: {
|
|
198
|
+
pt: 1
|
|
199
|
+
},
|
|
200
|
+
children: [
|
|
201
|
+
/*#__PURE__*/ _jsx(TextField, {
|
|
202
|
+
label: copy == null ? void 0 : copy.label,
|
|
203
|
+
placeholder: copy == null ? void 0 : copy.placeholder,
|
|
204
|
+
multiline: true,
|
|
205
|
+
minRows: 4,
|
|
206
|
+
value: (_ref = brief == null ? void 0 : brief.text) != null ? _ref : '',
|
|
207
|
+
onChange: (event)=>setBrief((current)=>current ? _extends({}, current, {
|
|
208
|
+
text: event.target.value.slice(0, BRIEF_MAX_CHARS)
|
|
209
|
+
}) : current),
|
|
210
|
+
helperText: `${((_ref1 = brief == null ? void 0 : brief.text.length) != null ? _ref1 : 0).toLocaleString('en-US')} / ${BRIEF_MAX_CHARS.toLocaleString('en-US')}`,
|
|
211
|
+
disabled: busy,
|
|
212
|
+
autoFocus: true
|
|
213
|
+
}),
|
|
214
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
215
|
+
variant: "body2",
|
|
216
|
+
color: "text.secondary",
|
|
217
|
+
children: copy == null ? void 0 : copy.next
|
|
218
|
+
}),
|
|
219
|
+
(brief == null ? void 0 : brief.kind) === 'catalog' ? /*#__PURE__*/ _jsxs(Stack, {
|
|
220
|
+
direction: "row",
|
|
221
|
+
spacing: 1,
|
|
222
|
+
useFlexGap: true,
|
|
223
|
+
sx: {
|
|
224
|
+
flexWrap: 'wrap'
|
|
225
|
+
},
|
|
226
|
+
children: [
|
|
227
|
+
/*#__PURE__*/ _jsx(Chip, {
|
|
228
|
+
size: "small",
|
|
229
|
+
color: "warning",
|
|
230
|
+
variant: "outlined",
|
|
231
|
+
label: "Prices stay empty"
|
|
232
|
+
}),
|
|
233
|
+
/*#__PURE__*/ _jsx(Chip, {
|
|
234
|
+
size: "small",
|
|
235
|
+
color: "warning",
|
|
236
|
+
variant: "outlined",
|
|
237
|
+
label: "Photos are yours to add"
|
|
238
|
+
})
|
|
239
|
+
]
|
|
240
|
+
}) : null,
|
|
241
|
+
notice ? /*#__PURE__*/ _jsx(Alert, {
|
|
242
|
+
severity: "warning",
|
|
243
|
+
children: notice
|
|
244
|
+
}) : null
|
|
245
|
+
]
|
|
246
|
+
})
|
|
247
|
+
}),
|
|
248
|
+
/*#__PURE__*/ _jsxs(DialogActions, {
|
|
249
|
+
children: [
|
|
250
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
251
|
+
onClick: ()=>setBrief(null),
|
|
252
|
+
disabled: busy,
|
|
253
|
+
children: 'Cancel'
|
|
254
|
+
}),
|
|
255
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
256
|
+
variant: "contained",
|
|
257
|
+
disabled: busy || !orgId || !(brief == null ? void 0 : brief.text.trim()),
|
|
258
|
+
onClick: ()=>void submitBrief(),
|
|
259
|
+
children: copy == null ? void 0 : copy.submit
|
|
260
|
+
})
|
|
261
|
+
]
|
|
262
|
+
})
|
|
263
|
+
]
|
|
264
|
+
});
|
|
265
|
+
// Until the card's list of recent proposals is read — or where the jobs
|
|
266
|
+
// route will not list them — it draws nothing but a brief the products door
|
|
267
|
+
// opened, whose start door says any refusal in the dialog.
|
|
268
|
+
if (verdict !== 'ready') return briefDialog;
|
|
171
269
|
const submitPicked = async ()=>{
|
|
172
270
|
setBusy(true);
|
|
173
271
|
try {
|
|
@@ -332,86 +430,7 @@ export function AiProductsHubCard(props) {
|
|
|
332
430
|
})
|
|
333
431
|
]
|
|
334
432
|
}),
|
|
335
|
-
|
|
336
|
-
open: Boolean(brief),
|
|
337
|
-
onClose: busy ? undefined : ()=>setBrief(null),
|
|
338
|
-
fullWidth: true,
|
|
339
|
-
maxWidth: "sm",
|
|
340
|
-
children: [
|
|
341
|
-
/*#__PURE__*/ _jsx(DialogTitle, {
|
|
342
|
-
children: copy == null ? void 0 : copy.title
|
|
343
|
-
}),
|
|
344
|
-
/*#__PURE__*/ _jsx(DialogContent, {
|
|
345
|
-
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
346
|
-
spacing: 2,
|
|
347
|
-
sx: {
|
|
348
|
-
pt: 1
|
|
349
|
-
},
|
|
350
|
-
children: [
|
|
351
|
-
/*#__PURE__*/ _jsx(TextField, {
|
|
352
|
-
label: copy == null ? void 0 : copy.label,
|
|
353
|
-
placeholder: copy == null ? void 0 : copy.placeholder,
|
|
354
|
-
multiline: true,
|
|
355
|
-
minRows: 4,
|
|
356
|
-
value: (_ref = brief == null ? void 0 : brief.text) != null ? _ref : '',
|
|
357
|
-
onChange: (event)=>setBrief((current)=>current ? _extends({}, current, {
|
|
358
|
-
text: event.target.value.slice(0, BRIEF_MAX_CHARS)
|
|
359
|
-
}) : current),
|
|
360
|
-
helperText: `${((_ref1 = brief == null ? void 0 : brief.text.length) != null ? _ref1 : 0).toLocaleString('en-US')} / ${BRIEF_MAX_CHARS.toLocaleString('en-US')}`,
|
|
361
|
-
disabled: busy,
|
|
362
|
-
autoFocus: true
|
|
363
|
-
}),
|
|
364
|
-
/*#__PURE__*/ _jsx(Typography, {
|
|
365
|
-
variant: "body2",
|
|
366
|
-
color: "text.secondary",
|
|
367
|
-
children: copy == null ? void 0 : copy.next
|
|
368
|
-
}),
|
|
369
|
-
(brief == null ? void 0 : brief.kind) === 'catalog' ? /*#__PURE__*/ _jsxs(Stack, {
|
|
370
|
-
direction: "row",
|
|
371
|
-
spacing: 1,
|
|
372
|
-
useFlexGap: true,
|
|
373
|
-
sx: {
|
|
374
|
-
flexWrap: 'wrap'
|
|
375
|
-
},
|
|
376
|
-
children: [
|
|
377
|
-
/*#__PURE__*/ _jsx(Chip, {
|
|
378
|
-
size: "small",
|
|
379
|
-
color: "warning",
|
|
380
|
-
variant: "outlined",
|
|
381
|
-
label: "Prices stay empty"
|
|
382
|
-
}),
|
|
383
|
-
/*#__PURE__*/ _jsx(Chip, {
|
|
384
|
-
size: "small",
|
|
385
|
-
color: "warning",
|
|
386
|
-
variant: "outlined",
|
|
387
|
-
label: "Photos are yours to add"
|
|
388
|
-
})
|
|
389
|
-
]
|
|
390
|
-
}) : null,
|
|
391
|
-
notice ? /*#__PURE__*/ _jsx(Alert, {
|
|
392
|
-
severity: "warning",
|
|
393
|
-
children: notice
|
|
394
|
-
}) : null
|
|
395
|
-
]
|
|
396
|
-
})
|
|
397
|
-
}),
|
|
398
|
-
/*#__PURE__*/ _jsxs(DialogActions, {
|
|
399
|
-
children: [
|
|
400
|
-
/*#__PURE__*/ _jsx(Button, {
|
|
401
|
-
onClick: ()=>setBrief(null),
|
|
402
|
-
disabled: busy,
|
|
403
|
-
children: 'Cancel'
|
|
404
|
-
}),
|
|
405
|
-
/*#__PURE__*/ _jsx(Button, {
|
|
406
|
-
variant: "contained",
|
|
407
|
-
disabled: busy || !orgId || !(brief == null ? void 0 : brief.text.trim()),
|
|
408
|
-
onClick: ()=>void submitBrief(),
|
|
409
|
-
children: copy == null ? void 0 : copy.submit
|
|
410
|
-
})
|
|
411
|
-
]
|
|
412
|
-
})
|
|
413
|
-
]
|
|
414
|
-
})
|
|
433
|
+
briefDialog
|
|
415
434
|
]
|
|
416
435
|
});
|
|
417
436
|
}
|