@jini-ai/admin 0.4.2 → 0.4.4
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/CHANGELOG.md +15 -0
- package/README.md +7 -0
- package/dist/agent-plugins/react/components/AgentPluginListPanel.d.ts +1 -1
- package/dist/agent-plugins/react/hooks/AgentPluginInspector.hooks.js +1 -1
- package/dist/agent-plugins/react/hooks/AgentPluginPanel.hooks.d.ts +1 -1
- package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.d.ts +1 -1
- package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.js +1 -1
- package/dist/agent-plugins/react/hooks/MarketplaceTab.hooks.d.ts +1 -1
- package/dist/agent-plugins/react/index.js +1 -1
- package/dist/agent-plugins/react/pages/AgentPluginsPage.d.ts +1 -1
- package/dist/agent-plugins/react/tabs/DownloadedTab.d.ts +1 -1
- package/dist/agent-plugins/react/tabs/InstalledTab.d.ts +1 -1
- package/dist/agent-plugins/react/tabs/MarketplaceTab.d.ts +1 -1
- package/dist/comments/adapters/http.d.ts +29 -0
- package/dist/comments/adapters/http.js +50 -0
- package/dist/comments/adapters/memory.d.ts +17 -0
- package/dist/comments/adapters/memory.js +61 -0
- package/dist/comments/comments.module.d.ts +73 -0
- package/dist/comments/comments.module.js +16 -0
- package/dist/comments/conformance/comments-api.conformance.d.ts +9 -0
- package/dist/comments/conformance/comments-api.conformance.js +63 -0
- package/dist/comments/controllers/comment-queue.controller.d.ts +48 -0
- package/dist/comments/controllers/comment-queue.controller.js +164 -0
- package/dist/comments/controllers/comment-settings.controller.d.ts +32 -0
- package/dist/comments/controllers/comment-settings.controller.js +77 -0
- package/dist/comments/controllers/comments.controller.d.ts +16 -0
- package/dist/comments/controllers/comments.controller.js +16 -0
- package/dist/comments/index.d.ts +13 -0
- package/dist/comments/index.js +8 -0
- package/dist/comments/messages.en.d.ts +54 -0
- package/dist/comments/messages.en.js +56 -0
- package/dist/comments/models.d.ts +22 -0
- package/dist/comments/models.js +2 -0
- package/dist/comments/ports.d.ts +14 -0
- package/dist/comments/ports.js +5 -0
- package/dist/comments/react/components/QueueSection.d.ts +30 -0
- package/dist/comments/react/components/QueueSection.js +57 -0
- package/dist/comments/react/components/SettingsSection.d.ts +14 -0
- package/dist/comments/react/components/SettingsSection.js +23 -0
- package/dist/comments/react/hooks/CommentsPage.hooks.d.ts +9 -0
- package/dist/comments/react/hooks/CommentsPage.hooks.js +10 -0
- package/dist/comments/react/hooks/CommentsPorts.hooks.d.ts +13 -0
- package/dist/comments/react/hooks/CommentsPorts.hooks.js +15 -0
- package/dist/comments/react/hooks/QueueSection.hooks.d.ts +62 -0
- package/dist/comments/react/hooks/QueueSection.hooks.js +57 -0
- package/dist/comments/react/hooks/SettingsSection.hooks.d.ts +12 -0
- package/dist/comments/react/hooks/SettingsSection.hooks.js +21 -0
- package/dist/comments/react/hooks/use-comment-queue.hooks.d.ts +34 -0
- package/dist/comments/react/hooks/use-comment-queue.hooks.js +47 -0
- package/dist/comments/react/hooks/use-comment-settings.hooks.d.ts +22 -0
- package/dist/comments/react/hooks/use-comment-settings.hooks.js +30 -0
- package/dist/comments/react/hooks/use-comments.hooks.d.ts +15 -0
- package/dist/comments/react/hooks/use-comments.hooks.js +20 -0
- package/dist/comments/react/index.d.ts +316 -0
- package/dist/comments/react/index.js +35 -0
- package/dist/comments/react/pages/CommentsPage.d.ts +12 -0
- package/dist/comments/react/pages/CommentsPage.js +15 -0
- package/dist/comments/rules.d.ts +140 -0
- package/dist/comments/rules.js +199 -0
- package/dist/core/index.d.ts +3 -1
- package/dist/core/index.js +1 -0
- package/dist/core/ledger-slice.d.ts +90 -0
- package/dist/core/ledger-slice.js +81 -0
- package/dist/core/ports/comments.d.ts +2 -0
- package/dist/core/ports/forms.d.ts +19 -7
- package/dist/core/ports/forms.js +4 -4
- package/dist/core/ports/index.d.ts +1 -1
- package/dist/core/ports/seo.d.ts +33 -6
- package/dist/core/react/bind-react.d.ts +46 -0
- package/dist/core/react/bind-react.js +28 -0
- package/dist/core/react/index.d.ts +3 -0
- package/dist/core/react/index.js +3 -0
- package/dist/core/react/use-controller.d.ts +16 -0
- package/dist/core/react/use-controller.js +18 -0
- package/dist/forms/adapters/http.d.ts +26 -0
- package/dist/forms/adapters/http.js +43 -0
- package/dist/forms/adapters/memory.d.ts +14 -0
- package/dist/forms/adapters/memory.js +77 -0
- package/dist/forms/conformance/forms-api.conformance.d.ts +17 -0
- package/dist/forms/conformance/forms-api.conformance.js +71 -0
- package/dist/forms/controllers/draft-store.d.ts +18 -0
- package/dist/forms/controllers/draft-store.js +17 -0
- package/dist/forms/controllers/field-attributes-dialog.controller.d.ts +37 -0
- package/dist/forms/controllers/field-attributes-dialog.controller.js +27 -0
- package/dist/forms/controllers/form-editor.controller.d.ts +36 -0
- package/dist/forms/controllers/form-editor.controller.js +22 -0
- package/dist/forms/controllers/form-fields-editor.controller.d.ts +20 -0
- package/dist/forms/controllers/form-fields-editor.controller.js +10 -0
- package/dist/forms/controllers/form-submission-detail.controller.d.ts +20 -0
- package/dist/forms/controllers/form-submission-detail.controller.js +10 -0
- package/dist/forms/controllers/form-submissions.controller.d.ts +25 -0
- package/dist/forms/controllers/form-submissions.controller.js +10 -0
- package/dist/forms/controllers/forms-list.controller.d.ts +22 -0
- package/dist/forms/controllers/forms-list.controller.js +10 -0
- package/dist/forms/forms.module.d.ts +138 -0
- package/dist/forms/forms.module.js +17 -0
- package/dist/forms/html-rules.d.ts +34 -0
- package/dist/forms/html-rules.js +34 -0
- package/dist/forms/index.d.ts +14 -0
- package/dist/forms/index.js +12 -0
- package/dist/forms/messages.en.d.ts +101 -0
- package/dist/forms/messages.en.js +105 -0
- package/dist/forms/models.d.ts +29 -0
- package/dist/forms/models.js +8 -0
- package/dist/forms/ports.d.ts +26 -0
- package/dist/forms/ports.js +6 -0
- package/dist/forms/react/components/FieldAttributesDialog.d.ts +14 -0
- package/dist/forms/react/components/FieldAttributesDialog.js +47 -0
- package/dist/forms/react/components/FormEditorFieldsBody.d.ts +28 -0
- package/dist/forms/react/components/FormEditorFieldsBody.js +24 -0
- package/dist/forms/react/components/FormEditorHeaderText.d.ts +7 -0
- package/dist/forms/react/components/FormEditorHeaderText.js +8 -0
- package/dist/forms/react/components/FormEditorMainPanel.d.ts +12 -0
- package/dist/forms/react/components/FormEditorMainPanel.js +13 -0
- package/dist/forms/react/components/FormEditorTabStrip.d.ts +13 -0
- package/dist/forms/react/components/FormEditorTabStrip.js +14 -0
- package/dist/forms/react/components/FormFieldsEditor.d.ts +13 -0
- package/dist/forms/react/components/FormFieldsEditor.js +39 -0
- package/dist/forms/react/components/FormSubmissionDate.d.ts +8 -0
- package/dist/forms/react/components/FormSubmissionDate.js +5 -0
- package/dist/forms/react/components/FormSubmissionDetail.d.ts +15 -0
- package/dist/forms/react/components/FormSubmissionDetail.js +30 -0
- package/dist/forms/react/components/FormSubmissions.d.ts +12 -0
- package/dist/forms/react/components/FormSubmissions.js +46 -0
- package/dist/forms/react/hooks/FormsPorts.hooks.d.ts +41 -0
- package/dist/forms/react/hooks/FormsPorts.hooks.js +16 -0
- package/dist/forms/react/hooks/forms-view.hooks.d.ts +117 -0
- package/dist/forms/react/hooks/forms-view.hooks.js +78 -0
- package/dist/forms/react/hooks/use-field-attributes-dialog.hooks.d.ts +31 -0
- package/dist/forms/react/hooks/use-field-attributes-dialog.hooks.js +22 -0
- package/dist/forms/react/hooks/use-form-editor.hooks.d.ts +118 -0
- package/dist/forms/react/hooks/use-form-editor.hooks.js +208 -0
- package/dist/forms/react/hooks/use-form-fields-editor.hooks.d.ts +34 -0
- package/dist/forms/react/hooks/use-form-fields-editor.hooks.js +36 -0
- package/dist/forms/react/hooks/use-form-submission-date.hooks.d.ts +12 -0
- package/dist/forms/react/hooks/use-form-submission-date.hooks.js +9 -0
- package/dist/forms/react/hooks/use-form-submission-detail.hooks.d.ts +68 -0
- package/dist/forms/react/hooks/use-form-submission-detail.hooks.js +81 -0
- package/dist/forms/react/hooks/use-form-submissions.hooks.d.ts +67 -0
- package/dist/forms/react/hooks/use-form-submissions.hooks.js +110 -0
- package/dist/forms/react/hooks/use-forms-list.hooks.d.ts +78 -0
- package/dist/forms/react/hooks/use-forms-list.hooks.js +103 -0
- package/dist/forms/react/index.d.ts +452 -0
- package/dist/forms/react/index.js +35 -0
- package/dist/forms/react/pages/FormEditor.d.ts +19 -0
- package/dist/forms/react/pages/FormEditor.js +40 -0
- package/dist/forms/react/pages/FormsList.d.ts +39 -0
- package/dist/forms/react/pages/FormsList.js +50 -0
- package/dist/forms/rules.d.ts +291 -0
- package/dist/forms/rules.js +338 -0
- package/dist/media/react/hooks/EditMediaPanel.hooks.js +1 -1
- package/dist/media/react/hooks/LibraryTab.hooks.d.ts +1 -1
- package/dist/media/react/hooks/LibraryTab.hooks.js +1 -1
- package/dist/media/react/hooks/MediaCard.hooks.js +6 -20
- package/dist/media/react/hooks/MediaGrid.hooks.d.ts +2 -2
- package/dist/media/react/hooks/MediaPage.hooks.d.ts +1 -1
- package/dist/media/react/hooks/MediaPage.hooks.js +1 -1
- package/dist/media/react/hooks/MediaPicker.hooks.js +1 -1
- package/dist/media/react/index.js +1 -1
- package/dist/media/react/tabs/LibraryTab.d.ts +1 -1
- package/dist/media/react/tabs/ProvidersTab.d.ts +1 -1
- package/dist/playground/react/components/Canvas.d.ts +1 -1
- package/dist/playground/react/hooks/Canvas.hooks.d.ts +1 -1
- package/dist/playground/react/hooks/Canvas.hooks.js +1 -1
- package/dist/playground/react/hooks/PlaygroundPage.hooks.d.ts +1 -1
- package/dist/playground/react/index.js +1 -1
- package/dist/playground/react/pages/PlaygroundPage.d.ts +1 -1
- package/dist/playground/react/tabs/CanvasTab.d.ts +1 -1
- package/dist/react/bind-react.d.ts +1 -45
- package/dist/react/bind-react.js +2 -27
- package/dist/react/components/ConfirmDialog/ConfirmDialog.d.ts +22 -5
- package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.d.ts +2 -2
- package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.js +17 -55
- package/dist/react/components/ConfirmDialog/ConfirmDialog.js +33 -70
- package/dist/react/components/RowMenu/RowMenu.hooks.js +14 -3
- package/dist/react/use-controller.d.ts +1 -15
- package/dist/react/use-controller.js +2 -17
- package/dist/redirects/adapters/http.d.ts +20 -0
- package/dist/redirects/adapters/http.js +31 -0
- package/dist/redirects/adapters/memory.d.ts +13 -0
- package/dist/redirects/adapters/memory.js +83 -0
- package/dist/redirects/conformance/redirects-api.conformance.d.ts +12 -0
- package/dist/redirects/conformance/redirects-api.conformance.js +66 -0
- package/dist/redirects/controllers/hit-count.controller.d.ts +14 -0
- package/dist/redirects/controllers/hit-count.controller.js +10 -0
- package/dist/redirects/controllers/import-redirects.controller.d.ts +28 -0
- package/dist/redirects/controllers/import-redirects.controller.js +29 -0
- package/dist/redirects/controllers/redirects.controller.d.ts +37 -0
- package/dist/redirects/controllers/redirects.controller.js +38 -0
- package/dist/redirects/index.d.ts +11 -0
- package/dist/redirects/index.js +10 -0
- package/dist/redirects/messages.en.d.ts +58 -0
- package/dist/redirects/messages.en.js +60 -0
- package/dist/redirects/models.d.ts +14 -0
- package/dist/redirects/models.js +2 -0
- package/dist/redirects/ports.d.ts +9 -0
- package/dist/redirects/ports.js +4 -0
- package/dist/redirects/react/components/HitCountCell.d.ts +19 -0
- package/dist/redirects/react/components/HitCountCell.js +19 -0
- package/dist/redirects/react/components/ImportRedirectsForm.d.ts +17 -0
- package/dist/redirects/react/components/ImportRedirectsForm.js +12 -0
- package/dist/redirects/react/hooks/RedirectsOptions.hooks.d.ts +27 -0
- package/dist/redirects/react/hooks/RedirectsOptions.hooks.js +15 -0
- package/dist/redirects/react/hooks/RedirectsPage.hooks.d.ts +50 -0
- package/dist/redirects/react/hooks/RedirectsPage.hooks.js +30 -0
- package/dist/redirects/react/hooks/RedirectsPorts.hooks.d.ts +10 -0
- package/dist/redirects/react/hooks/RedirectsPorts.hooks.js +11 -0
- package/dist/redirects/react/hooks/use-hit-count-cell.hooks.d.ts +19 -0
- package/dist/redirects/react/hooks/use-hit-count-cell.hooks.js +15 -0
- package/dist/redirects/react/hooks/use-import-redirects-form.hooks.d.ts +21 -0
- package/dist/redirects/react/hooks/use-import-redirects-form.hooks.js +25 -0
- package/dist/redirects/react/hooks/use-redirects.hooks.d.ts +34 -0
- package/dist/redirects/react/hooks/use-redirects.hooks.js +63 -0
- package/dist/redirects/react/hooks/wired.hooks.d.ts +55 -0
- package/dist/redirects/react/hooks/wired.hooks.js +31 -0
- package/dist/redirects/react/index.d.ts +324 -0
- package/dist/redirects/react/index.js +28 -0
- package/dist/redirects/react/pages/RedirectsPage.d.ts +15 -0
- package/dist/redirects/react/pages/RedirectsPage.js +20 -0
- package/dist/redirects/redirects.module.d.ts +77 -0
- package/dist/redirects/redirects.module.js +13 -0
- package/dist/redirects/rules.d.ts +131 -0
- package/dist/redirects/rules.js +134 -0
- package/dist/security/react/hooks/AccessTokensTab.hooks.d.ts +1 -1
- package/dist/security/react/hooks/AccessTokensTab.hooks.js +1 -1
- package/dist/security/react/hooks/RootKeyTab.hooks.d.ts +1 -1
- package/dist/security/react/hooks/RootKeyTab.hooks.js +1 -1
- package/dist/security/react/hooks/SecurityPage.hooks.d.ts +1 -1
- package/dist/security/react/index.js +1 -1
- package/dist/security/react/pages/SecurityPage.d.ts +1 -1
- package/dist/security/react/tabs/AccessTokensTab.d.ts +1 -1
- package/dist/security/react/tabs/RootKeyTab.d.ts +1 -1
- package/dist/seo/adapters/http.d.ts +31 -0
- package/dist/seo/adapters/http.js +37 -0
- package/dist/seo/adapters/memory.d.ts +28 -0
- package/dist/seo/adapters/memory.js +129 -0
- package/dist/seo/conformance/seo-api.conformance.d.ts +8 -0
- package/dist/seo/conformance/seo-api.conformance.js +44 -0
- package/dist/seo/controllers/entry-picker.controller.d.ts +21 -0
- package/dist/seo/controllers/entry-picker.controller.js +17 -0
- package/dist/seo/controllers/entry-section.controller.d.ts +20 -0
- package/dist/seo/controllers/entry-section.controller.js +7 -0
- package/dist/seo/controllers/media-ref.controller.d.ts +26 -0
- package/dist/seo/controllers/media-ref.controller.js +14 -0
- package/dist/seo/controllers/seo-entry.controller.d.ts +31 -0
- package/dist/seo/controllers/seo-entry.controller.js +52 -0
- package/dist/seo/controllers/seo.controller.d.ts +29 -0
- package/dist/seo/controllers/seo.controller.js +50 -0
- package/dist/seo/controllers/sitemap.controller.d.ts +25 -0
- package/dist/seo/controllers/sitemap.controller.js +27 -0
- package/dist/seo/index.d.ts +14 -0
- package/dist/seo/index.js +12 -0
- package/dist/seo/messages.en.d.ts +79 -0
- package/dist/seo/messages.en.js +79 -0
- package/dist/seo/models.d.ts +179 -0
- package/dist/seo/models.js +8 -0
- package/dist/seo/ports.d.ts +11 -0
- package/dist/seo/ports.js +4 -0
- package/dist/seo/react/components/MediaPickerBridge.d.ts +4 -0
- package/dist/seo/react/components/MediaPickerBridge.js +8 -0
- package/dist/seo/react/components/MediaRefField.d.ts +40 -0
- package/dist/seo/react/components/MediaRefField.js +12 -0
- package/dist/seo/react/components/SeoIcons.d.ts +13 -0
- package/dist/seo/react/components/SeoIcons.js +32 -0
- package/dist/seo/react/components/SitemapModal.d.ts +48 -0
- package/dist/seo/react/components/SitemapModal.js +72 -0
- package/dist/seo/react/hooks/MediaPickerBridge.hooks.d.ts +6 -0
- package/dist/seo/react/hooks/MediaPickerBridge.hooks.js +27 -0
- package/dist/seo/react/hooks/MediaRefField.hooks.d.ts +25 -0
- package/dist/seo/react/hooks/MediaRefField.hooks.js +30 -0
- package/dist/seo/react/hooks/SeoModuleTabs.d.ts +14 -0
- package/dist/seo/react/hooks/SeoModuleTabs.js +18 -0
- package/dist/seo/react/hooks/SeoPage.hooks.d.ts +69 -0
- package/dist/seo/react/hooks/SeoPage.hooks.js +37 -0
- package/dist/seo/react/hooks/SeoPorts.hooks.d.ts +19 -0
- package/dist/seo/react/hooks/SeoPorts.hooks.js +22 -0
- package/dist/seo/react/hooks/SitemapModal.hooks.d.ts +26 -0
- package/dist/seo/react/hooks/SitemapModal.hooks.js +20 -0
- package/dist/seo/react/hooks/use-entry-picker.hooks.d.ts +11 -0
- package/dist/seo/react/hooks/use-entry-picker.hooks.js +20 -0
- package/dist/seo/react/hooks/use-seo-entry-panel.hooks.d.ts +14 -0
- package/dist/seo/react/hooks/use-seo-entry-panel.hooks.js +26 -0
- package/dist/seo/react/hooks/use-seo-entry-section.hooks.d.ts +4 -0
- package/dist/seo/react/hooks/use-seo-entry-section.hooks.js +7 -0
- package/dist/seo/react/hooks/use-seo.hooks.d.ts +11 -0
- package/dist/seo/react/hooks/use-seo.hooks.js +29 -0
- package/dist/seo/react/hooks/use-sitemap-modal.hooks.d.ts +10 -0
- package/dist/seo/react/hooks/use-sitemap-modal.hooks.js +18 -0
- package/dist/seo/react/index.d.ts +369 -0
- package/dist/seo/react/index.js +30 -0
- package/dist/seo/react/options.d.ts +26 -0
- package/dist/seo/react/options.js +2 -0
- package/dist/seo/react/pages/SeoPage.d.ts +161 -0
- package/dist/seo/react/pages/SeoPage.js +215 -0
- package/dist/seo/rules.d.ts +142 -0
- package/dist/seo/rules.js +220 -0
- package/dist/seo/seo.module.d.ts +115 -0
- package/dist/seo/seo.module.js +14 -0
- package/dist/source-control/react/hooks/ProvidersTab.hooks.d.ts +1 -1
- package/dist/source-control/react/hooks/ProvidersTab.hooks.js +1 -1
- package/dist/source-control/react/hooks/SourceControlPage.hooks.d.ts +1 -1
- package/dist/source-control/react/index.js +1 -1
- package/dist/source-control/react/pages/SourceControlPage.d.ts +1 -1
- package/dist/source-control/react/tabs/ProvidersTab.d.ts +1 -1
- package/dist/widgets/adapters/http.d.ts +19 -0
- package/dist/widgets/adapters/http.js +33 -0
- package/dist/widgets/adapters/memory.d.ts +22 -0
- package/dist/widgets/adapters/memory.js +93 -0
- package/dist/widgets/conformance/widgets-api.conformance.d.ts +6 -0
- package/dist/widgets/conformance/widgets-api.conformance.js +55 -0
- package/dist/widgets/controllers/instance-editor.controller.d.ts +49 -0
- package/dist/widgets/controllers/instance-editor.controller.js +87 -0
- package/dist/widgets/controllers/library.controller.d.ts +33 -0
- package/dist/widgets/controllers/library.controller.js +53 -0
- package/dist/widgets/controllers/region-editor.controller.d.ts +42 -0
- package/dist/widgets/controllers/region-editor.controller.js +69 -0
- package/dist/widgets/controllers/regions.controller.d.ts +27 -0
- package/dist/widgets/controllers/regions.controller.js +44 -0
- package/dist/widgets/index.d.ts +11 -0
- package/dist/widgets/index.js +9 -0
- package/dist/widgets/messages.en.d.ts +78 -0
- package/dist/widgets/messages.en.js +83 -0
- package/dist/widgets/models.d.ts +62 -0
- package/dist/widgets/models.js +2 -0
- package/dist/widgets/ports.d.ts +79 -0
- package/dist/widgets/ports.js +5 -0
- package/dist/widgets/react/components/WidgetInstanceNotices.d.ts +14 -0
- package/dist/widgets/react/components/WidgetInstanceNotices.js +25 -0
- package/dist/widgets/react/components/WidgetRegionEditorHeaderActions.d.ts +22 -0
- package/dist/widgets/react/components/WidgetRegionEditorHeaderActions.js +18 -0
- package/dist/widgets/react/components/WidgetsLibraryNotices.d.ts +13 -0
- package/dist/widgets/react/components/WidgetsLibraryNotices.js +10 -0
- package/dist/widgets/react/hooks/WidgetsPorts.hooks.d.ts +270 -0
- package/dist/widgets/react/hooks/WidgetsPorts.hooks.js +17 -0
- package/dist/widgets/react/hooks/navigation.hooks.d.ts +9 -0
- package/dist/widgets/react/hooks/navigation.hooks.js +6 -0
- package/dist/widgets/react/hooks/page-views.hooks.d.ts +87 -0
- package/dist/widgets/react/hooks/page-views.hooks.js +30 -0
- package/dist/widgets/react/hooks/use-widget-instance-editor.hooks.d.ts +56 -0
- package/dist/widgets/react/hooks/use-widget-instance-editor.hooks.js +38 -0
- package/dist/widgets/react/hooks/use-widget-region-editor.hooks.d.ts +32 -0
- package/dist/widgets/react/hooks/use-widget-region-editor.hooks.js +22 -0
- package/dist/widgets/react/hooks/use-widget-regions.hooks.d.ts +23 -0
- package/dist/widgets/react/hooks/use-widget-regions.hooks.js +22 -0
- package/dist/widgets/react/hooks/use-widgets-library.hooks.d.ts +37 -0
- package/dist/widgets/react/hooks/use-widgets-library.hooks.js +23 -0
- package/dist/widgets/react/index.d.ts +391 -0
- package/dist/widgets/react/index.js +31 -0
- package/dist/widgets/react/pages/WidgetInstanceEditor.d.ts +23 -0
- package/dist/widgets/react/pages/WidgetInstanceEditor.js +37 -0
- package/dist/widgets/react/pages/WidgetRegionEditor.d.ts +22 -0
- package/dist/widgets/react/pages/WidgetRegionEditor.js +25 -0
- package/dist/widgets/react/pages/WidgetRegions.d.ts +21 -0
- package/dist/widgets/react/pages/WidgetRegions.js +31 -0
- package/dist/widgets/react/pages/WidgetsLibrary.d.ts +24 -0
- package/dist/widgets/react/pages/WidgetsLibrary.js +61 -0
- package/dist/widgets/rules.d.ts +94 -0
- package/dist/widgets/rules.js +83 -0
- package/dist/widgets/widgets.module.d.ts +122 -0
- package/dist/widgets/widgets.module.js +21 -0
- package/package.json +206 -9
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import type { ScopedPorts } from '../../../core/module/types.js';
|
|
3
|
+
import type { AdminWidgetType, WidgetTypeOption, WidgetSlugRedirectPath, WidgetsTranslate } from '../../models.js';
|
|
4
|
+
export interface WidgetsSlots {
|
|
5
|
+
ConfigFields: ComponentType<{
|
|
6
|
+
widgetType: AdminWidgetType;
|
|
7
|
+
config: Record<string, unknown>;
|
|
8
|
+
onChange: (value: Record<string, unknown>) => void;
|
|
9
|
+
agentHandle?: string | undefined;
|
|
10
|
+
t?: WidgetsTranslate | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
AddControl: ComponentType<{
|
|
13
|
+
triggerLabel: string;
|
|
14
|
+
onResolved: (id: string) => void;
|
|
15
|
+
agentHandle?: string | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
/** Shared config UI/catalog/defaults and slug policy stay host-owned. Locale is presentation metadata. */
|
|
19
|
+
export interface WidgetsReactOptions {
|
|
20
|
+
slots: WidgetsSlots;
|
|
21
|
+
widgetTypes: readonly WidgetTypeOption[];
|
|
22
|
+
defaultConfig: (type: AdminWidgetType) => Record<string, unknown>;
|
|
23
|
+
t?: WidgetsTranslate | undefined;
|
|
24
|
+
locale?: string | undefined;
|
|
25
|
+
slugRedirectPath?: WidgetSlugRedirectPath | undefined;
|
|
26
|
+
headerActions?: ReactNode | undefined;
|
|
27
|
+
/** Bind the host serverLabel owner when protocol values have a separate dictionary. */
|
|
28
|
+
statusLabel?: WidgetsTranslate | undefined;
|
|
29
|
+
navigationBase?: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
export declare const WidgetsPortsContext: import("react").Context<ScopedPorts<{
|
|
32
|
+
readonly id: "widgets";
|
|
33
|
+
readonly requires: {
|
|
34
|
+
readonly widgetsApi: import("../../../core/module/token.js").AdminPortToken<import("../../ports.js").AdminWidgetsPort, "admin.widgets.api">;
|
|
35
|
+
};
|
|
36
|
+
readonly optional: {
|
|
37
|
+
readonly widgetsEvents: import("../../../core/module/token.js").AdminPortToken<import("../../ports.js").WidgetsEventsPort, "admin.widgets.events">;
|
|
38
|
+
readonly widgetsNavigation: import("../../../core/module/token.js").AdminPortToken<import("../../ports.js").WidgetsNavigationPort, "admin.widgets.navigation">;
|
|
39
|
+
};
|
|
40
|
+
readonly messages: {
|
|
41
|
+
readonly Back: "Back";
|
|
42
|
+
readonly "Widget type to create": "Widget type to create";
|
|
43
|
+
readonly Content: "Content";
|
|
44
|
+
readonly Text: "Text";
|
|
45
|
+
readonly "Social Links": "Social Links";
|
|
46
|
+
readonly "Collection list": "Collection list";
|
|
47
|
+
readonly Menu: "Menu";
|
|
48
|
+
readonly "Contact Form": "Contact Form";
|
|
49
|
+
readonly Widgets: "Widgets";
|
|
50
|
+
readonly "Widget Regions": "Widget Regions";
|
|
51
|
+
readonly "A region is a theme-declared placement area (e.g. \"header\", \"footer\", \"sidebar\"). Bind a region by its key to start placing widgets in it.": "A region is a theme-declared placement area (e.g. \"header\", \"footer\", \"sidebar\"). Bind a region by its key to start placing widgets in it.";
|
|
52
|
+
readonly "Binding\u2026": "Binding…";
|
|
53
|
+
readonly "Bind region": "Bind region";
|
|
54
|
+
readonly "No regions bound yet.": "No regions bound yet.";
|
|
55
|
+
readonly "Region key": "Region key";
|
|
56
|
+
readonly Placements: "Placements";
|
|
57
|
+
readonly Manage: "Manage";
|
|
58
|
+
readonly "Create reusable content blocks and place them into your theme's widget regions.": "Create reusable content blocks and place them into your theme's widget regions.";
|
|
59
|
+
readonly "Regions \u2192": "Regions →";
|
|
60
|
+
readonly "Add New": "Add New";
|
|
61
|
+
readonly "1 widget record in this workspace could not be read.": "1 widget record in this workspace could not be read.";
|
|
62
|
+
readonly "{n} widget records in this workspace could not be read.": "{n} widget records in this workspace could not be read.";
|
|
63
|
+
readonly "Show ids": "Show ids";
|
|
64
|
+
readonly "No widgets yet.": "No widgets yet.";
|
|
65
|
+
readonly "Create one above to get started.": "Create one above to get started.";
|
|
66
|
+
readonly Title: "Title";
|
|
67
|
+
readonly Type: "Type";
|
|
68
|
+
readonly Slug: "Slug";
|
|
69
|
+
readonly Status: "Status";
|
|
70
|
+
readonly Actions: "Actions";
|
|
71
|
+
readonly Trash: "Trash";
|
|
72
|
+
readonly "Move to trash?": "Move to trash?";
|
|
73
|
+
readonly "Move to trash": "Move to trash";
|
|
74
|
+
readonly "Move \"{title}\" to trash?": "Move \"{title}\" to trash?";
|
|
75
|
+
readonly Regions: "Regions";
|
|
76
|
+
readonly "Saving\u2026": "Saving…";
|
|
77
|
+
readonly Save: "Save";
|
|
78
|
+
readonly "Region:": "Region:";
|
|
79
|
+
readonly "Manage which widgets appear in this region and their order.": "Manage which widgets appear in this region and their order.";
|
|
80
|
+
readonly "No widgets placed in this region yet.": "No widgets placed in this region yet.";
|
|
81
|
+
readonly Enabled: "Enabled";
|
|
82
|
+
readonly "\u26A0 Broken reference": "⚠ Broken reference";
|
|
83
|
+
readonly "+ Add widget": "+ Add widget";
|
|
84
|
+
readonly "New widget": "New widget";
|
|
85
|
+
readonly "Edit widget": "Edit widget";
|
|
86
|
+
readonly "Configure this widget's title and settings.": "Configure this widget's title and settings.";
|
|
87
|
+
readonly "Widget title": "Widget title";
|
|
88
|
+
readonly "Type:": "Type:";
|
|
89
|
+
readonly "Region area": "Region area";
|
|
90
|
+
readonly "Inline embed": "Inline embed";
|
|
91
|
+
readonly "Used in 1 place:": "Used in 1 place:";
|
|
92
|
+
readonly "Used in {count} places:": "Used in {count} places:";
|
|
93
|
+
readonly "failed to load widget": "failed to load widget";
|
|
94
|
+
readonly "save failed": "save failed";
|
|
95
|
+
readonly "This widget changed since you loaded it, refresh and try again.": "This widget changed since you loaded it, refresh and try again.";
|
|
96
|
+
readonly "This region changed since you loaded it, refresh and try again.": "This region changed since you loaded it, refresh and try again.";
|
|
97
|
+
readonly "failed to load region": "failed to load region";
|
|
98
|
+
readonly "failed to load widgets": "failed to load widgets";
|
|
99
|
+
readonly "delete failed": "delete failed";
|
|
100
|
+
readonly "This item changed since you loaded it. Reload and try again.": "This item changed since you loaded it. Reload and try again.";
|
|
101
|
+
readonly "failed to load regions": "failed to load regions";
|
|
102
|
+
readonly "bind failed": "bind failed";
|
|
103
|
+
readonly "Loading widget\u2026": "Loading widget…";
|
|
104
|
+
readonly "No widget type specified.": "No widget type specified.";
|
|
105
|
+
readonly "Unknown widget type \"": "Unknown widget type \"";
|
|
106
|
+
readonly "Loading region\u2026": "Loading region…";
|
|
107
|
+
readonly "Move up": "Move up";
|
|
108
|
+
readonly "Move down": "Move down";
|
|
109
|
+
readonly Remove: "Remove";
|
|
110
|
+
readonly "Loading regions\u2026": "Loading regions…";
|
|
111
|
+
readonly "Loading widgets\u2026": "Loading widgets…";
|
|
112
|
+
readonly "Saved \u00B7 version {version}": "Saved · version {version}";
|
|
113
|
+
};
|
|
114
|
+
readonly pages: {
|
|
115
|
+
readonly library: {
|
|
116
|
+
readonly path: "/widgets";
|
|
117
|
+
readonly label: "Widgets";
|
|
118
|
+
readonly agentReachable: true;
|
|
119
|
+
readonly nav: {
|
|
120
|
+
readonly group: "Content";
|
|
121
|
+
};
|
|
122
|
+
readonly tabs: {};
|
|
123
|
+
};
|
|
124
|
+
readonly editor: {
|
|
125
|
+
readonly path: "/widgets/:widgetId";
|
|
126
|
+
readonly label: "Edit widget";
|
|
127
|
+
readonly agentReachable: true;
|
|
128
|
+
readonly tabs: {};
|
|
129
|
+
};
|
|
130
|
+
readonly regions: {
|
|
131
|
+
readonly path: "/widgets/regions";
|
|
132
|
+
readonly label: "Widget Regions";
|
|
133
|
+
readonly agentReachable: true;
|
|
134
|
+
readonly tabs: {};
|
|
135
|
+
};
|
|
136
|
+
readonly region: {
|
|
137
|
+
readonly path: "/widgets/regions/:regionKey";
|
|
138
|
+
readonly label: "Region:";
|
|
139
|
+
readonly agentReachable: true;
|
|
140
|
+
readonly tabs: {};
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
}> | null>;
|
|
144
|
+
export declare const WidgetsOptionsContext: import("react").Context<WidgetsReactOptions | null>;
|
|
145
|
+
export declare function useWidgetsPorts(_required?: Record<string, never>, _optional?: Record<string, never>): ScopedPorts<{
|
|
146
|
+
readonly id: "widgets";
|
|
147
|
+
readonly requires: {
|
|
148
|
+
readonly widgetsApi: import("../../../core/module/token.js").AdminPortToken<import("../../ports.js").AdminWidgetsPort, "admin.widgets.api">;
|
|
149
|
+
};
|
|
150
|
+
readonly optional: {
|
|
151
|
+
readonly widgetsEvents: import("../../../core/module/token.js").AdminPortToken<import("../../ports.js").WidgetsEventsPort, "admin.widgets.events">;
|
|
152
|
+
readonly widgetsNavigation: import("../../../core/module/token.js").AdminPortToken<import("../../ports.js").WidgetsNavigationPort, "admin.widgets.navigation">;
|
|
153
|
+
};
|
|
154
|
+
readonly messages: {
|
|
155
|
+
readonly Back: "Back";
|
|
156
|
+
readonly "Widget type to create": "Widget type to create";
|
|
157
|
+
readonly Content: "Content";
|
|
158
|
+
readonly Text: "Text";
|
|
159
|
+
readonly "Social Links": "Social Links";
|
|
160
|
+
readonly "Collection list": "Collection list";
|
|
161
|
+
readonly Menu: "Menu";
|
|
162
|
+
readonly "Contact Form": "Contact Form";
|
|
163
|
+
readonly Widgets: "Widgets";
|
|
164
|
+
readonly "Widget Regions": "Widget Regions";
|
|
165
|
+
readonly "A region is a theme-declared placement area (e.g. \"header\", \"footer\", \"sidebar\"). Bind a region by its key to start placing widgets in it.": "A region is a theme-declared placement area (e.g. \"header\", \"footer\", \"sidebar\"). Bind a region by its key to start placing widgets in it.";
|
|
166
|
+
readonly "Binding\u2026": "Binding…";
|
|
167
|
+
readonly "Bind region": "Bind region";
|
|
168
|
+
readonly "No regions bound yet.": "No regions bound yet.";
|
|
169
|
+
readonly "Region key": "Region key";
|
|
170
|
+
readonly Placements: "Placements";
|
|
171
|
+
readonly Manage: "Manage";
|
|
172
|
+
readonly "Create reusable content blocks and place them into your theme's widget regions.": "Create reusable content blocks and place them into your theme's widget regions.";
|
|
173
|
+
readonly "Regions \u2192": "Regions →";
|
|
174
|
+
readonly "Add New": "Add New";
|
|
175
|
+
readonly "1 widget record in this workspace could not be read.": "1 widget record in this workspace could not be read.";
|
|
176
|
+
readonly "{n} widget records in this workspace could not be read.": "{n} widget records in this workspace could not be read.";
|
|
177
|
+
readonly "Show ids": "Show ids";
|
|
178
|
+
readonly "No widgets yet.": "No widgets yet.";
|
|
179
|
+
readonly "Create one above to get started.": "Create one above to get started.";
|
|
180
|
+
readonly Title: "Title";
|
|
181
|
+
readonly Type: "Type";
|
|
182
|
+
readonly Slug: "Slug";
|
|
183
|
+
readonly Status: "Status";
|
|
184
|
+
readonly Actions: "Actions";
|
|
185
|
+
readonly Trash: "Trash";
|
|
186
|
+
readonly "Move to trash?": "Move to trash?";
|
|
187
|
+
readonly "Move to trash": "Move to trash";
|
|
188
|
+
readonly "Move \"{title}\" to trash?": "Move \"{title}\" to trash?";
|
|
189
|
+
readonly Regions: "Regions";
|
|
190
|
+
readonly "Saving\u2026": "Saving…";
|
|
191
|
+
readonly Save: "Save";
|
|
192
|
+
readonly "Region:": "Region:";
|
|
193
|
+
readonly "Manage which widgets appear in this region and their order.": "Manage which widgets appear in this region and their order.";
|
|
194
|
+
readonly "No widgets placed in this region yet.": "No widgets placed in this region yet.";
|
|
195
|
+
readonly Enabled: "Enabled";
|
|
196
|
+
readonly "\u26A0 Broken reference": "⚠ Broken reference";
|
|
197
|
+
readonly "+ Add widget": "+ Add widget";
|
|
198
|
+
readonly "New widget": "New widget";
|
|
199
|
+
readonly "Edit widget": "Edit widget";
|
|
200
|
+
readonly "Configure this widget's title and settings.": "Configure this widget's title and settings.";
|
|
201
|
+
readonly "Widget title": "Widget title";
|
|
202
|
+
readonly "Type:": "Type:";
|
|
203
|
+
readonly "Region area": "Region area";
|
|
204
|
+
readonly "Inline embed": "Inline embed";
|
|
205
|
+
readonly "Used in 1 place:": "Used in 1 place:";
|
|
206
|
+
readonly "Used in {count} places:": "Used in {count} places:";
|
|
207
|
+
readonly "failed to load widget": "failed to load widget";
|
|
208
|
+
readonly "save failed": "save failed";
|
|
209
|
+
readonly "This widget changed since you loaded it, refresh and try again.": "This widget changed since you loaded it, refresh and try again.";
|
|
210
|
+
readonly "This region changed since you loaded it, refresh and try again.": "This region changed since you loaded it, refresh and try again.";
|
|
211
|
+
readonly "failed to load region": "failed to load region";
|
|
212
|
+
readonly "failed to load widgets": "failed to load widgets";
|
|
213
|
+
readonly "delete failed": "delete failed";
|
|
214
|
+
readonly "This item changed since you loaded it. Reload and try again.": "This item changed since you loaded it. Reload and try again.";
|
|
215
|
+
readonly "failed to load regions": "failed to load regions";
|
|
216
|
+
readonly "bind failed": "bind failed";
|
|
217
|
+
readonly "Loading widget\u2026": "Loading widget…";
|
|
218
|
+
readonly "No widget type specified.": "No widget type specified.";
|
|
219
|
+
readonly "Unknown widget type \"": "Unknown widget type \"";
|
|
220
|
+
readonly "Loading region\u2026": "Loading region…";
|
|
221
|
+
readonly "Move up": "Move up";
|
|
222
|
+
readonly "Move down": "Move down";
|
|
223
|
+
readonly Remove: "Remove";
|
|
224
|
+
readonly "Loading regions\u2026": "Loading regions…";
|
|
225
|
+
readonly "Loading widgets\u2026": "Loading widgets…";
|
|
226
|
+
readonly "Saved \u00B7 version {version}": "Saved · version {version}";
|
|
227
|
+
};
|
|
228
|
+
readonly pages: {
|
|
229
|
+
readonly library: {
|
|
230
|
+
readonly path: "/widgets";
|
|
231
|
+
readonly label: "Widgets";
|
|
232
|
+
readonly agentReachable: true;
|
|
233
|
+
readonly nav: {
|
|
234
|
+
readonly group: "Content";
|
|
235
|
+
};
|
|
236
|
+
readonly tabs: {};
|
|
237
|
+
};
|
|
238
|
+
readonly editor: {
|
|
239
|
+
readonly path: "/widgets/:widgetId";
|
|
240
|
+
readonly label: "Edit widget";
|
|
241
|
+
readonly agentReachable: true;
|
|
242
|
+
readonly tabs: {};
|
|
243
|
+
};
|
|
244
|
+
readonly regions: {
|
|
245
|
+
readonly path: "/widgets/regions";
|
|
246
|
+
readonly label: "Widget Regions";
|
|
247
|
+
readonly agentReachable: true;
|
|
248
|
+
readonly tabs: {};
|
|
249
|
+
};
|
|
250
|
+
readonly region: {
|
|
251
|
+
readonly path: "/widgets/regions/:regionKey";
|
|
252
|
+
readonly label: "Region:";
|
|
253
|
+
readonly agentReachable: true;
|
|
254
|
+
readonly tabs: {};
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
}>;
|
|
258
|
+
export declare function useWidgetsOptions(_required?: Record<string, never>, _optional?: Record<string, never>): {
|
|
259
|
+
t: WidgetsTranslate;
|
|
260
|
+
locale: string;
|
|
261
|
+
slots: WidgetsSlots;
|
|
262
|
+
widgetTypes: readonly WidgetTypeOption[];
|
|
263
|
+
defaultConfig: (type: AdminWidgetType) => Record<string, unknown>;
|
|
264
|
+
slugRedirectPath?: WidgetSlugRedirectPath | undefined;
|
|
265
|
+
headerActions?: ReactNode | undefined;
|
|
266
|
+
/** Bind the host serverLabel owner when protocol values have a separate dictionary. */
|
|
267
|
+
statusLabel?: WidgetsTranslate | undefined;
|
|
268
|
+
navigationBase?: string | undefined;
|
|
269
|
+
};
|
|
270
|
+
//# sourceMappingURL=WidgetsPorts.hooks.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
import { widgetsEnglish } from '../../messages.en.js';
|
|
3
|
+
export const WidgetsPortsContext = createContext(null);
|
|
4
|
+
export const WidgetsOptionsContext = createContext(null);
|
|
5
|
+
export function useWidgetsPorts(_required = {}, _optional = {}) {
|
|
6
|
+
const ports = useContext(WidgetsPortsContext);
|
|
7
|
+
if (!ports)
|
|
8
|
+
throw new Error('React scope unavailable: widgets');
|
|
9
|
+
return ports;
|
|
10
|
+
}
|
|
11
|
+
export function useWidgetsOptions(_required = {}, _optional = {}) {
|
|
12
|
+
const options = useContext(WidgetsOptionsContext);
|
|
13
|
+
if (!options)
|
|
14
|
+
throw new Error('React options unavailable: widgets');
|
|
15
|
+
return { ...options, t: options.t ?? widgetsEnglish, locale: options.locale ?? 'en' };
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=WidgetsPorts.hooks.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WidgetsNavigationPort } from '../../ports.js';
|
|
2
|
+
/** Adapt the existing shell port; absent navigation leaves normal anchors available. */
|
|
3
|
+
export declare function useWidgetsNavigate({ navigation, navigationBase }: {
|
|
4
|
+
navigation?: WidgetsNavigationPort | undefined;
|
|
5
|
+
navigationBase: string;
|
|
6
|
+
}, _optional?: Record<string, never>): (path: string, options?: {
|
|
7
|
+
replace?: boolean;
|
|
8
|
+
}) => void;
|
|
9
|
+
//# sourceMappingURL=navigation.hooks.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
/** Adapt the existing shell port; absent navigation leaves normal anchors available. */
|
|
3
|
+
export function useWidgetsNavigate({ navigation, navigationBase }, _optional = {}) {
|
|
4
|
+
return useCallback((path, options) => { navigation?.navigate({ base: navigationBase, routePath: path }, options); }, [navigation, navigationBase]);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=navigation.hooks.js.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { useWiredWidgetsLibrary } from './use-widgets-library.hooks.js';
|
|
2
|
+
import { useWiredWidgetRegions } from './use-widget-regions.hooks.js';
|
|
3
|
+
import { useWiredWidgetRegionEditor } from './use-widget-region-editor.hooks.js';
|
|
4
|
+
/** Stable ids supply per-row handles because DataTable cells receive a row, not its index. */
|
|
5
|
+
export declare function useWidgetsLibraryView({ useWidgetsLibraryHook }: {
|
|
6
|
+
useWidgetsLibraryHook?: typeof useWiredWidgetsLibrary | undefined;
|
|
7
|
+
}, _optional?: Record<string, never>): {
|
|
8
|
+
rowHandleById: Map<string, string>;
|
|
9
|
+
widgets: import("../../models.js").AdminWidget[] | null;
|
|
10
|
+
error: string | null;
|
|
11
|
+
skippedCount: number;
|
|
12
|
+
skippedIds: string[];
|
|
13
|
+
createType: import("../../models.js").AdminWidgetType;
|
|
14
|
+
setCreateType: (type: import("../../models.js").AdminWidgetType) => void;
|
|
15
|
+
pendingTrash: import("../../models.js").AdminWidget | null;
|
|
16
|
+
trashing: boolean;
|
|
17
|
+
requestTrash: (widget: import("../../models.js").AdminWidget) => void;
|
|
18
|
+
confirmTrash: () => Promise<void>;
|
|
19
|
+
cancelTrash: () => void;
|
|
20
|
+
t: import("../../models.js").WidgetsTranslate;
|
|
21
|
+
locale: string;
|
|
22
|
+
};
|
|
23
|
+
export declare function useWidgetRegionsView({ useWidgetRegionsHook }: {
|
|
24
|
+
useWidgetRegionsHook?: typeof useWiredWidgetRegions | undefined;
|
|
25
|
+
}, _optional?: Record<string, never>): {
|
|
26
|
+
rowHandleByKey: Map<string, string>;
|
|
27
|
+
regions: import("../../models.js").AdminWidgetRegionBinding[] | null;
|
|
28
|
+
error: string | null;
|
|
29
|
+
newRegionKey: string;
|
|
30
|
+
setNewRegionKey: (value: string) => void;
|
|
31
|
+
binding: boolean;
|
|
32
|
+
bind: () => Promise<void>;
|
|
33
|
+
t: import("../../models.js").WidgetsTranslate;
|
|
34
|
+
};
|
|
35
|
+
export declare function useWidgetRegionEditorView({ regionKey, useWidgetRegionEditorHook }: {
|
|
36
|
+
regionKey: string;
|
|
37
|
+
useWidgetRegionEditorHook?: typeof useWiredWidgetRegionEditor | undefined;
|
|
38
|
+
}, _optional?: Record<string, never>): {
|
|
39
|
+
placementHandles: string[];
|
|
40
|
+
area: import("../../models.js").AdminWidgetArea | null;
|
|
41
|
+
placements: import("../../models.js").AdminWidgetPlacement[];
|
|
42
|
+
message: string | null;
|
|
43
|
+
error: string | null;
|
|
44
|
+
loading: boolean;
|
|
45
|
+
saving: boolean;
|
|
46
|
+
removeAt: (placementId: string) => void;
|
|
47
|
+
moveAt: (index: number, direction: -1 | 1) => void;
|
|
48
|
+
toggleEnabled: (placementId: string) => void;
|
|
49
|
+
addPlacement: (widgetInstanceId: string) => void;
|
|
50
|
+
save: () => Promise<void>;
|
|
51
|
+
t: import("../../models.js").WidgetsTranslate;
|
|
52
|
+
locale: string;
|
|
53
|
+
};
|
|
54
|
+
import type { MouseEvent } from 'react';
|
|
55
|
+
import type { WidgetTypeOption } from '../../models.js';
|
|
56
|
+
import { useWiredWidgetInstanceEditor } from './use-widget-instance-editor.hooks.js';
|
|
57
|
+
/** The back-link cancellation also stops the host's document-level internal-link interceptor. */
|
|
58
|
+
export declare function useWidgetInstanceEditorView({ widgetId, widgetType, widgetTypes, useWidgetInstanceEditorHook }: {
|
|
59
|
+
widgetId: string | null;
|
|
60
|
+
widgetType: string | null;
|
|
61
|
+
widgetTypes: readonly WidgetTypeOption[];
|
|
62
|
+
useWidgetInstanceEditorHook?: typeof useWiredWidgetInstanceEditor | undefined;
|
|
63
|
+
}, _optional?: Record<string, never>): {
|
|
64
|
+
guard: import("../../rules.js").WidgetInstanceGuard | null;
|
|
65
|
+
onBackClick: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
66
|
+
isNew: boolean;
|
|
67
|
+
widget: import("../../models.js").AdminWidget | null;
|
|
68
|
+
whereUsed: import("../../models.js").AdminWidgetWhereUsed;
|
|
69
|
+
title: string;
|
|
70
|
+
setTitle: (title: string) => void;
|
|
71
|
+
config: Record<string, unknown>;
|
|
72
|
+
setConfig: (config: Record<string, unknown>) => void;
|
|
73
|
+
message: string | null;
|
|
74
|
+
error: string | null;
|
|
75
|
+
fieldErrors: Array<{
|
|
76
|
+
field: string;
|
|
77
|
+
reason: string;
|
|
78
|
+
}>;
|
|
79
|
+
loading: boolean;
|
|
80
|
+
saving: boolean;
|
|
81
|
+
widgetType: import("../../models.js").AdminWidgetType | null;
|
|
82
|
+
save: () => Promise<void>;
|
|
83
|
+
confirmLeave: import("@jini-ai/ui").DirtyGuard["confirmLeave"];
|
|
84
|
+
t: import("../../models.js").WidgetsTranslate;
|
|
85
|
+
locale: string;
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=page-views.hooks.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { buildAgentListHandles } from '@jini-ai/agentic';
|
|
2
|
+
import { useWiredWidgetsLibrary } from './use-widgets-library.hooks.js';
|
|
3
|
+
import { useWiredWidgetRegions } from './use-widget-regions.hooks.js';
|
|
4
|
+
import { useWiredWidgetRegionEditor } from './use-widget-region-editor.hooks.js';
|
|
5
|
+
/** Stable ids supply per-row handles because DataTable cells receive a row, not its index. */
|
|
6
|
+
export function useWidgetsLibraryView({ useWidgetsLibraryHook = useWiredWidgetsLibrary }, _optional = {}) {
|
|
7
|
+
const state = useWidgetsLibraryHook();
|
|
8
|
+
const widgets = state.widgets ?? [];
|
|
9
|
+
const handles = buildAgentListHandles({ prefix: 'widgets-row', ids: widgets.map(w => w.id) });
|
|
10
|
+
return { ...state, rowHandleById: new Map(widgets.map((w, i) => [w.id, handles[i]])) };
|
|
11
|
+
}
|
|
12
|
+
export function useWidgetRegionsView({ useWidgetRegionsHook = useWiredWidgetRegions }, _optional = {}) {
|
|
13
|
+
const state = useWidgetRegionsHook();
|
|
14
|
+
const regions = state.regions ?? [];
|
|
15
|
+
const handles = buildAgentListHandles({ prefix: 'widget-regions-row', ids: regions.map(r => r.regionKey) });
|
|
16
|
+
return { ...state, rowHandleByKey: new Map(regions.map((r, i) => [r.regionKey, handles[i]])) };
|
|
17
|
+
}
|
|
18
|
+
export function useWidgetRegionEditorView({ regionKey, useWidgetRegionEditorHook = useWiredWidgetRegionEditor }, _optional = {}) {
|
|
19
|
+
const state = useWidgetRegionEditorHook(regionKey);
|
|
20
|
+
return { ...state, placementHandles: buildAgentListHandles({ prefix: 'widget-region-placement', ids: state.placements.map(p => p.placementId) }) };
|
|
21
|
+
}
|
|
22
|
+
import { widgetInstanceGuard } from '../../rules.js';
|
|
23
|
+
import { useWiredWidgetInstanceEditor } from './use-widget-instance-editor.hooks.js';
|
|
24
|
+
/** The back-link cancellation also stops the host's document-level internal-link interceptor. */
|
|
25
|
+
export function useWidgetInstanceEditorView({ widgetId, widgetType, widgetTypes, useWidgetInstanceEditorHook = useWiredWidgetInstanceEditor }, _optional = {}) {
|
|
26
|
+
const state = useWidgetInstanceEditorHook({ widgetId, widgetType });
|
|
27
|
+
return { ...state, guard: widgetInstanceGuard({ ...state, types: widgetTypes }), onBackClick: (event) => { if (!state.confirmLeave())
|
|
28
|
+
event.preventDefault(); } };
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=page-views.hooks.js.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { AdminWidget, AdminWidgetType, AdminWidgetWhereUsed, WidgetsTranslate as Translate } from '../../models.js';
|
|
2
|
+
import type { DirtyGuard } from '@jini-ai/ui/panel-kit';
|
|
3
|
+
export interface WidgetInstanceEditorController {
|
|
4
|
+
isNew: boolean;
|
|
5
|
+
widget: AdminWidget | null;
|
|
6
|
+
whereUsed: AdminWidgetWhereUsed;
|
|
7
|
+
title: string;
|
|
8
|
+
setTitle: (title: string) => void;
|
|
9
|
+
config: Record<string, unknown>;
|
|
10
|
+
setConfig: (config: Record<string, unknown>) => void;
|
|
11
|
+
message: string | null;
|
|
12
|
+
error: string | null;
|
|
13
|
+
fieldErrors: Array<{
|
|
14
|
+
field: string;
|
|
15
|
+
reason: string;
|
|
16
|
+
}>;
|
|
17
|
+
loading: boolean;
|
|
18
|
+
saving: boolean;
|
|
19
|
+
/** The type this editor is configuring — the `?type=` query param while creating, the loaded
|
|
20
|
+
* widget's own type once one exists. `null` when neither is available. */
|
|
21
|
+
widgetType: AdminWidgetType | null;
|
|
22
|
+
save: () => Promise<void>;
|
|
23
|
+
/** `useDirtyGuard`'s `confirmLeave` for the title/config pair — `WidgetInstanceEditor.tsx`'s back
|
|
24
|
+
* link calls it before leaving (Opus themes+widgets review, OPEN item 2: this editor previously
|
|
25
|
+
* had no unsaved-changes guard at all, unlike Posts/Pages). Always `true` with no prompt while
|
|
26
|
+
* `widget` is `null` (a brand-new, not-yet-saved widget) — same "nothing loaded to compare
|
|
27
|
+
* against yet" contract `useDirtyGuard`'s own doc describes; matches every other editor's
|
|
28
|
+
* identical carve-out. */
|
|
29
|
+
confirmLeave: DirtyGuard["confirmLeave"];
|
|
30
|
+
/** Bound translator — `WidgetInstanceEditor.tsx`'s only source of UI copy; see this file's own
|
|
31
|
+
* header. */
|
|
32
|
+
t: Translate;
|
|
33
|
+
/** The raw resolved locale — exposed only because `widgetTypeLabel` (`../rules.ts`) genuinely
|
|
34
|
+
* needs it, not `t`. */
|
|
35
|
+
locale: string;
|
|
36
|
+
}
|
|
37
|
+
import type { AdminWidgetsPort } from '../../ports.js';
|
|
38
|
+
import type { WidgetEditorParams, WidgetSlugRedirectPath } from '../../models.js';
|
|
39
|
+
export type WidgetInstanceEditorHookProps = WidgetEditorParams;
|
|
40
|
+
export declare function staleVersionMessage({ t }?: {
|
|
41
|
+
t?: Translate | undefined;
|
|
42
|
+
}, _optional?: Record<string, never>): string;
|
|
43
|
+
export declare function useWidgetInstanceEditor({ params, api, defaultConfig }: {
|
|
44
|
+
params: WidgetEditorParams;
|
|
45
|
+
api: AdminWidgetsPort;
|
|
46
|
+
defaultConfig: (type: AdminWidgetType) => Record<string, unknown>;
|
|
47
|
+
}, { t, locale, navigate, slugRedirectPath }?: {
|
|
48
|
+
t?: Translate | undefined;
|
|
49
|
+
locale?: string | undefined;
|
|
50
|
+
navigate?: ((path: string, options?: {
|
|
51
|
+
replace?: boolean;
|
|
52
|
+
}) => void) | undefined;
|
|
53
|
+
slugRedirectPath?: WidgetSlugRedirectPath | undefined;
|
|
54
|
+
}): WidgetInstanceEditorController;
|
|
55
|
+
export declare function useWiredWidgetInstanceEditor(params: WidgetEditorParams): WidgetInstanceEditorController;
|
|
56
|
+
//# sourceMappingURL=use-widget-instance-editor.hooks.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useEffect, useRef, useCallback } from 'react';
|
|
2
|
+
import { useDirtyGuard } from '@jini-ai/ui/panel-kit';
|
|
3
|
+
import { useController } from '../../../core/react/use-controller.js';
|
|
4
|
+
import { createWidgetInstanceEditorController } from '../../controllers/instance-editor.controller.js';
|
|
5
|
+
import { widgetsEnglish } from '../../messages.en.js';
|
|
6
|
+
import { widgetEntityKey } from '../../rules.js';
|
|
7
|
+
import { useWidgetsPorts, useWidgetsOptions } from './WidgetsPorts.hooks.js';
|
|
8
|
+
import { useWidgetsNavigate } from './navigation.hooks.js';
|
|
9
|
+
export function staleVersionMessage({ t = widgetsEnglish } = {}, _optional = {}) { return t('This widget changed since you loaded it, refresh and try again.'); }
|
|
10
|
+
export function useWidgetInstanceEditor({ params, api, defaultConfig }, { t = widgetsEnglish, locale = 'en', navigate, slugRedirectPath } = {}) {
|
|
11
|
+
const paramsRef = useRef(params);
|
|
12
|
+
// Saves compare with the latest rendered identity, before a route effect can run.
|
|
13
|
+
const renderedKey = useRef(widgetEntityKey({ params }));
|
|
14
|
+
renderedKey.current = widgetEntityKey({ params });
|
|
15
|
+
const latest = useRef({ t, navigate, slugRedirectPath });
|
|
16
|
+
latest.current = { t, navigate, slugRedirectPath };
|
|
17
|
+
const { controller, snapshot } = useController({ create: () => createWidgetInstanceEditorController({ api, params: paramsRef.current, defaultConfig }, {
|
|
18
|
+
getEntityKey: () => renderedKey.current, t: key => latest.current.t(key), navigate: (path, options) => latest.current.navigate?.(path, options),
|
|
19
|
+
slugRedirectPath: (base, id, item) => latest.current.slugRedirectPath?.(base, id, item) ?? null,
|
|
20
|
+
}), dependencies: [api, defaultConfig] }, { start: ({ controller }) => { void controller.load(); } });
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (paramsRef.current.widgetId === params.widgetId && paramsRef.current.widgetType === params.widgetType)
|
|
23
|
+
return;
|
|
24
|
+
paramsRef.current = params;
|
|
25
|
+
controller?.setParams({ params });
|
|
26
|
+
}, [controller, params.widgetId, params.widgetType]);
|
|
27
|
+
const state = snapshot ?? { isNew: params.widgetId === null, widget: null, whereUsed: { count: 0, references: [] }, title: '', config: params.widgetId === null ? defaultConfig(params.widgetType ?? 'text') : {}, message: null, error: null, fieldErrors: [], loading: params.widgetId !== null, saving: false, widgetType: params.widgetId === null ? params.widgetType : undefined };
|
|
28
|
+
// New unsaved widgets have no original to compare with and leave without a prompt.
|
|
29
|
+
const { confirmLeave } = useDirtyGuard({ current: { title: state.title, config: state.config }, original: state.widget ? { title: state.widget.title, config: state.widget.config } : null }, { host: window, translate: key => key });
|
|
30
|
+
return { ...state, widgetType: state.widgetType, setTitle: title => controller?.setTitle({ title }), setConfig: config => controller?.setConfig({ config }), save: async () => { await controller?.save(); }, confirmLeave, t, locale };
|
|
31
|
+
}
|
|
32
|
+
export function useWiredWidgetInstanceEditor(params) {
|
|
33
|
+
const { widgetsApi: api, widgetsNavigation } = useWidgetsPorts();
|
|
34
|
+
const { t, locale, defaultConfig, slugRedirectPath, navigationBase = '/admin' } = useWidgetsOptions();
|
|
35
|
+
const navigate = useWidgetsNavigate({ navigation: widgetsNavigation, navigationBase });
|
|
36
|
+
return useWidgetInstanceEditor({ params, api, defaultConfig }, { t, locale, navigate, slugRedirectPath });
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=use-widget-instance-editor.hooks.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { AdminWidgetArea, AdminWidgetPlacement, WidgetsTranslate as Translate } from '../../models.js';
|
|
2
|
+
export interface WidgetRegionEditorController {
|
|
3
|
+
area: AdminWidgetArea | null;
|
|
4
|
+
placements: AdminWidgetPlacement[];
|
|
5
|
+
message: string | null;
|
|
6
|
+
error: string | null;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
saving: boolean;
|
|
9
|
+
removeAt: (placementId: string) => void;
|
|
10
|
+
moveAt: (index: number, direction: -1 | 1) => void;
|
|
11
|
+
toggleEnabled: (placementId: string) => void;
|
|
12
|
+
addPlacement: (widgetInstanceId: string) => void;
|
|
13
|
+
save: () => Promise<void>;
|
|
14
|
+
/** Bound translator — `WidgetRegionEditor.tsx`'s only source of UI copy; see this file's own
|
|
15
|
+
* header. */
|
|
16
|
+
t: Translate;
|
|
17
|
+
/** The raw resolved locale — exposed only because `widgetTypeLabel` (`../rules.ts`) needs it. */
|
|
18
|
+
locale: string;
|
|
19
|
+
}
|
|
20
|
+
import type { AdminWidgetsPort } from '../../ports.js';
|
|
21
|
+
export declare function staleVersionMessage({ t }?: {
|
|
22
|
+
t?: Translate | undefined;
|
|
23
|
+
}, _optional?: Record<string, never>): string;
|
|
24
|
+
export declare function useWidgetRegionEditor({ regionKey, api }: {
|
|
25
|
+
regionKey: string;
|
|
26
|
+
api: AdminWidgetsPort;
|
|
27
|
+
}, { t, locale }?: {
|
|
28
|
+
t?: Translate | undefined;
|
|
29
|
+
locale?: string | undefined;
|
|
30
|
+
}): WidgetRegionEditorController;
|
|
31
|
+
export declare function useWiredWidgetRegionEditor(regionKey: string): WidgetRegionEditorController;
|
|
32
|
+
//# sourceMappingURL=use-widget-region-editor.hooks.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { useController } from '../../../core/react/use-controller.js';
|
|
3
|
+
import { createWidgetRegionEditorController } from '../../controllers/region-editor.controller.js';
|
|
4
|
+
import { widgetsEnglish } from '../../messages.en.js';
|
|
5
|
+
import { useWidgetsPorts, useWidgetsOptions } from './WidgetsPorts.hooks.js';
|
|
6
|
+
export function staleVersionMessage({ t = widgetsEnglish } = {}, _optional = {}) { return t('This region changed since you loaded it, refresh and try again.'); }
|
|
7
|
+
export function useWidgetRegionEditor({ regionKey, api }, { t = widgetsEnglish, locale = 'en' } = {}) {
|
|
8
|
+
const keyRef = useRef(regionKey), latestT = useRef(t);
|
|
9
|
+
latestT.current = t;
|
|
10
|
+
const { controller, snapshot } = useController({ create: () => createWidgetRegionEditorController({ api, regionKey: keyRef.current }, { t: key => latestT.current(key) }), dependencies: [api] }, { start: ({ controller }) => { void controller.load(); } });
|
|
11
|
+
useEffect(() => { if (keyRef.current !== regionKey) {
|
|
12
|
+
keyRef.current = regionKey;
|
|
13
|
+
controller?.setRegionKey({ regionKey });
|
|
14
|
+
} }, [controller, regionKey]);
|
|
15
|
+
return { ...(snapshot ?? { area: null, placements: [], message: null, error: null, loading: true, saving: false }), removeAt: placementId => controller?.removeAt({ placementId }), moveAt: (index, direction) => controller?.moveAt({ index, direction }), toggleEnabled: placementId => controller?.toggleEnabled({ placementId }), addPlacement: widgetInstanceId => controller?.addPlacement({ widgetInstanceId }), save: async () => { await controller?.save(); }, t, locale };
|
|
16
|
+
}
|
|
17
|
+
export function useWiredWidgetRegionEditor(regionKey) {
|
|
18
|
+
const { widgetsApi: api } = useWidgetsPorts();
|
|
19
|
+
const { t, locale } = useWidgetsOptions();
|
|
20
|
+
return useWidgetRegionEditor({ regionKey, api }, { t, locale });
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=use-widget-region-editor.hooks.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AdminWidgetRegionBinding, WidgetsTranslate as Translate } from '../../models.js';
|
|
2
|
+
export interface WidgetRegionsController {
|
|
3
|
+
/** `null` until the initial load settles — the caller renders a loading state. */
|
|
4
|
+
regions: AdminWidgetRegionBinding[] | null;
|
|
5
|
+
error: string | null;
|
|
6
|
+
newRegionKey: string;
|
|
7
|
+
setNewRegionKey: (value: string) => void;
|
|
8
|
+
binding: boolean;
|
|
9
|
+
bind: () => Promise<void>;
|
|
10
|
+
/** Bound translator — `WidgetRegions.tsx`'s only source of UI copy; see this file's own header. */
|
|
11
|
+
t: Translate;
|
|
12
|
+
}
|
|
13
|
+
import type { AdminWidgetsPort, WidgetsEventsPort } from '../../ports.js';
|
|
14
|
+
export declare function useWidgetRegions({ api }: {
|
|
15
|
+
api: AdminWidgetsPort;
|
|
16
|
+
}, { t, locale, events, navigate }?: {
|
|
17
|
+
t?: Translate | undefined;
|
|
18
|
+
locale?: string | undefined;
|
|
19
|
+
events?: WidgetsEventsPort | undefined;
|
|
20
|
+
navigate?: ((path: string) => void) | undefined;
|
|
21
|
+
}): WidgetRegionsController;
|
|
22
|
+
export declare function useWiredWidgetRegions(): WidgetRegionsController;
|
|
23
|
+
//# sourceMappingURL=use-widget-regions.hooks.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { useController } from '../../../core/react/use-controller.js';
|
|
3
|
+
import { createWidgetRegionsController } from '../../controllers/regions.controller.js';
|
|
4
|
+
import { widgetsEnglish } from '../../messages.en.js';
|
|
5
|
+
import { WIDGETS_REGIONS_RESOURCE } from '../../rules.js';
|
|
6
|
+
import { useWidgetsPorts, useWidgetsOptions } from './WidgetsPorts.hooks.js';
|
|
7
|
+
export function useWidgetRegions({ api }, { t = widgetsEnglish, locale = 'en', events, navigate } = {}) {
|
|
8
|
+
const latest = useRef({ t, navigate });
|
|
9
|
+
latest.current = { t, navigate };
|
|
10
|
+
const { controller, snapshot } = useController({ create: () => createWidgetRegionsController({ api }, { t: key => latest.current.t(key), navigate: path => latest.current.navigate?.(path) }), dependencies: [api] }, { start: ({ controller }) => { void controller.load(); } });
|
|
11
|
+
useEffect(() => { if (!controller)
|
|
12
|
+
return; return events?.subscribe({ resource: WIDGETS_REGIONS_RESOURCE, onRefresh: () => { void controller.load(); } }); }, [controller, events]);
|
|
13
|
+
return { ...(snapshot ?? { regions: null, error: null, newRegionKey: '', binding: false }), setNewRegionKey: value => controller?.setNewRegionKey({ value }), bind: async () => { await controller?.bind(); }, t };
|
|
14
|
+
}
|
|
15
|
+
export function useWiredWidgetRegions() {
|
|
16
|
+
const { widgetsApi: api, widgetsEvents: events, widgetsNavigation } = useWidgetsPorts();
|
|
17
|
+
const { t, locale, navigationBase = '/admin' } = useWidgetsOptions();
|
|
18
|
+
const navigate = useWidgetsNavigate({ navigation: widgetsNavigation, navigationBase });
|
|
19
|
+
return useWidgetRegions({ api }, { t, locale, events, navigate });
|
|
20
|
+
}
|
|
21
|
+
import { useWidgetsNavigate } from './navigation.hooks.js';
|
|
22
|
+
//# sourceMappingURL=use-widget-regions.hooks.js.map
|