@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,14 @@
|
|
|
1
|
+
/** Button-controlled query gate: many mounted rows never cause a burst of hit requests.
|
|
2
|
+
* @example createHitCountController({}, {});
|
|
3
|
+
*/
|
|
4
|
+
export declare function createHitCountController(_required: Record<string, never>, _optional?: {}): {
|
|
5
|
+
getSnapshot: () => Readonly<{
|
|
6
|
+
requested: boolean;
|
|
7
|
+
}>;
|
|
8
|
+
subscribe: ({ listener }: {
|
|
9
|
+
listener: () => void;
|
|
10
|
+
}) => () => void;
|
|
11
|
+
dispose: () => void;
|
|
12
|
+
request(_input?: Record<string, never>, _options?: {}): void;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=hit-count.controller.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createControllerStore } from '../../core/module/controller-store.js';
|
|
2
|
+
/** Button-controlled query gate: many mounted rows never cause a burst of hit requests.
|
|
3
|
+
* @example createHitCountController({}, {});
|
|
4
|
+
*/
|
|
5
|
+
export function createHitCountController(_required, _optional = {}) {
|
|
6
|
+
const store = createControllerStore({ initial: { requested: false } });
|
|
7
|
+
return { getSnapshot: store.getSnapshot, subscribe: store.subscribe, dispose: store.dispose,
|
|
8
|
+
request(_input = {}, _options = {}) { store.set({ patch: { requested: true } }); } };
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=hit-count.controller.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AdminRedirectCreateInput, AdminRedirectImportResult } from '../../core/ports/redirects.js';
|
|
2
|
+
import type { RedirectsTranslate } from '../models.js';
|
|
3
|
+
export interface ImportRedirectsActions {
|
|
4
|
+
reset(): void;
|
|
5
|
+
run(rules: readonly AdminRedirectCreateInput[]): Promise<AdminRedirectImportResult>;
|
|
6
|
+
}
|
|
7
|
+
/** Parse errors are local; the existing query mutation owns request errors and pending state.
|
|
8
|
+
* @example createImportRedirectsController({ actions: () => currentMutation, t }, {});
|
|
9
|
+
*/
|
|
10
|
+
export declare function createImportRedirectsController({ actions, t }: {
|
|
11
|
+
actions: () => ImportRedirectsActions;
|
|
12
|
+
t: () => RedirectsTranslate;
|
|
13
|
+
}, _optional?: {}): {
|
|
14
|
+
getSnapshot: () => Readonly<{
|
|
15
|
+
raw: string;
|
|
16
|
+
parseError: string | null;
|
|
17
|
+
result: AdminRedirectImportResult | null;
|
|
18
|
+
}>;
|
|
19
|
+
subscribe: ({ listener }: {
|
|
20
|
+
listener: () => void;
|
|
21
|
+
}) => () => void;
|
|
22
|
+
dispose: () => void;
|
|
23
|
+
setRaw({ raw }: {
|
|
24
|
+
raw: string;
|
|
25
|
+
}, _options?: {}): void;
|
|
26
|
+
submit(_required?: Record<string, never>, _options?: {}): Promise<void>;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=import-redirects.controller.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createControllerStore } from '../../core/module/controller-store.js';
|
|
2
|
+
import { parseImportPayload } from '../rules.js';
|
|
3
|
+
/** Parse errors are local; the existing query mutation owns request errors and pending state.
|
|
4
|
+
* @example createImportRedirectsController({ actions: () => currentMutation, t }, {});
|
|
5
|
+
*/
|
|
6
|
+
export function createImportRedirectsController({ actions, t }, _optional = {}) {
|
|
7
|
+
const store = createControllerStore({
|
|
8
|
+
initial: { raw: '', parseError: null, result: null },
|
|
9
|
+
});
|
|
10
|
+
return {
|
|
11
|
+
getSnapshot: store.getSnapshot, subscribe: store.subscribe, dispose: store.dispose,
|
|
12
|
+
setRaw({ raw }, _options = {}) { store.set({ patch: { raw } }); },
|
|
13
|
+
async submit(_required = {}, _options = {}) {
|
|
14
|
+
store.set({ patch: { parseError: null, result: null } });
|
|
15
|
+
actions().reset();
|
|
16
|
+
// Check JSON + array only: the server remains the validator and returns each item's 207 outcome.
|
|
17
|
+
const parsed = parseImportPayload({ raw: store.getSnapshot().raw, translate: t() });
|
|
18
|
+
if (!parsed.ok) {
|
|
19
|
+
store.set({ patch: { parseError: parsed.error } });
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
store.set({ patch: { result: await actions().run(parsed.rules) } });
|
|
24
|
+
}
|
|
25
|
+
catch { /* already surfaced by the mutation's request-error channel */ }
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=import-redirects.controller.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { AdminRedirect } from '../../core/ports/redirects.js';
|
|
2
|
+
/** Fetch-query owns request/cache states; this controller owns confirmation and write sequencing. */
|
|
3
|
+
export interface RedirectsActions {
|
|
4
|
+
saving: boolean;
|
|
5
|
+
create(form: FormData): Promise<unknown>;
|
|
6
|
+
toggle(rule: AdminRedirect): Promise<unknown>;
|
|
7
|
+
remove(rule: AdminRedirect): Promise<unknown>;
|
|
8
|
+
resetOthers(active: 'create' | 'toggle' | 'remove'): void;
|
|
9
|
+
}
|
|
10
|
+
/** The action getter reads the current query mutations, preserving independent errors and guards.
|
|
11
|
+
* @example createRedirectsController({ actions: () => currentActions }, {});
|
|
12
|
+
*/
|
|
13
|
+
export declare function createRedirectsController({ actions }: {
|
|
14
|
+
actions: () => RedirectsActions;
|
|
15
|
+
}, _optional?: {}): {
|
|
16
|
+
getSnapshot: () => Readonly<{
|
|
17
|
+
pendingDelete: AdminRedirect | null;
|
|
18
|
+
}>;
|
|
19
|
+
subscribe: ({ listener }: {
|
|
20
|
+
listener: () => void;
|
|
21
|
+
}) => () => void;
|
|
22
|
+
dispose: () => void;
|
|
23
|
+
setPendingDelete({ rule }: {
|
|
24
|
+
rule: AdminRedirect | null;
|
|
25
|
+
}, _options?: {}): void;
|
|
26
|
+
createRedirect({ form }: {
|
|
27
|
+
form: FormData;
|
|
28
|
+
}, _options?: {}): Promise<boolean>;
|
|
29
|
+
onToggleStatus({ rule }: {
|
|
30
|
+
rule: AdminRedirect;
|
|
31
|
+
}, _options?: {}): void;
|
|
32
|
+
onRequestDelete({ rule }: {
|
|
33
|
+
rule: AdminRedirect;
|
|
34
|
+
}, _options?: {}): void;
|
|
35
|
+
confirmDelete(_required?: Record<string, never>, _options?: {}): void;
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=redirects.controller.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createControllerStore } from '../../core/module/controller-store.js';
|
|
2
|
+
/** The action getter reads the current query mutations, preserving independent errors and guards.
|
|
3
|
+
* @example createRedirectsController({ actions: () => currentActions }, {});
|
|
4
|
+
*/
|
|
5
|
+
export function createRedirectsController({ actions }, _optional = {}) {
|
|
6
|
+
const store = createControllerStore({ initial: { pendingDelete: null } });
|
|
7
|
+
return {
|
|
8
|
+
getSnapshot: store.getSnapshot, subscribe: store.subscribe, dispose: store.dispose,
|
|
9
|
+
setPendingDelete({ rule }, _options = {}) { store.set({ patch: { pendingDelete: rule } }); },
|
|
10
|
+
createRedirect({ form }, _options = {}) {
|
|
11
|
+
actions().resetOthers('create');
|
|
12
|
+
// Never rejects: a failed create preserves the operator's form so it can be fixed/resubmitted.
|
|
13
|
+
return actions().create(form).then(() => true, () => false);
|
|
14
|
+
},
|
|
15
|
+
onToggleStatus({ rule }, _options = {}) {
|
|
16
|
+
if (actions().saving || store.signal.aborted)
|
|
17
|
+
return;
|
|
18
|
+
actions().resetOthers('toggle');
|
|
19
|
+
// The mutation owns the visible error; handle this derived promise too.
|
|
20
|
+
void actions().toggle(rule).catch(() => { });
|
|
21
|
+
},
|
|
22
|
+
onRequestDelete({ rule }, _options = {}) {
|
|
23
|
+
if (actions().saving || store.signal.aborted)
|
|
24
|
+
return;
|
|
25
|
+
store.set({ patch: { pendingDelete: rule } });
|
|
26
|
+
},
|
|
27
|
+
confirmDelete(_required = {}, _options = {}) {
|
|
28
|
+
const rule = store.getSnapshot().pendingDelete;
|
|
29
|
+
if (!rule || store.signal.aborted)
|
|
30
|
+
return;
|
|
31
|
+
actions().resetOthers('remove');
|
|
32
|
+
// Catch BEFORE finally: finally creates a new rejection even if mutate handled its own.
|
|
33
|
+
// Failure is already surfaced by the mutation; always close confirmation once it settles.
|
|
34
|
+
void actions().remove(rule).catch(() => { }).finally(() => store.set({ patch: { pendingDelete: null } }));
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=redirects.controller.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Universal redirects admin contracts, metadata, rules and headless controllers. */
|
|
2
|
+
export { redirectsModule } from './redirects.module.js';
|
|
3
|
+
export * from './ports.js';
|
|
4
|
+
export * from './models.js';
|
|
5
|
+
export * from './rules.js';
|
|
6
|
+
export * from './messages.en.js';
|
|
7
|
+
export * from './controllers/redirects.controller.js';
|
|
8
|
+
export * from './controllers/import-redirects.controller.js';
|
|
9
|
+
export * from './controllers/hit-count.controller.js';
|
|
10
|
+
export type { AdminRedirect, AdminRedirectCreateInput, AdminRedirectUpdatePatch, AdminRedirectListFilter, AdminRedirectHitStats, AdminRedirectImportResult, AdminRedirectImportFailure, RedirectMatchType, RedirectStatusCode, RedirectSource, RedirectStatus } from '../core/ports/redirects.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Universal redirects admin contracts, metadata, rules and headless controllers. */
|
|
2
|
+
export { redirectsModule } from './redirects.module.js';
|
|
3
|
+
export * from './ports.js';
|
|
4
|
+
export * from './models.js';
|
|
5
|
+
export * from './rules.js';
|
|
6
|
+
export * from './messages.en.js';
|
|
7
|
+
export * from './controllers/redirects.controller.js';
|
|
8
|
+
export * from './controllers/import-redirects.controller.js';
|
|
9
|
+
export * from './controllers/hit-count.controller.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { RedirectsTranslate } from './models.js';
|
|
2
|
+
/** English source keys are preserved verbatim; the host supplies localized values. */
|
|
3
|
+
export declare const redirectsMessagesEn: {
|
|
4
|
+
readonly "Loading\u2026": "Loading…";
|
|
5
|
+
readonly "Load hits": "Load hits";
|
|
6
|
+
readonly "Bulk import": "Bulk import";
|
|
7
|
+
readonly "rule objects (1-500 items)": "rule objects (1-500 items)";
|
|
8
|
+
readonly "Importing\u2026": "Importing…";
|
|
9
|
+
readonly Import: "Import";
|
|
10
|
+
readonly Marketing: "Marketing";
|
|
11
|
+
readonly Redirects: "Redirects";
|
|
12
|
+
readonly "Manage URL redirects, including those created automatically when a page's address changes.": "Manage URL redirects, including those created automatically when a page's address changes.";
|
|
13
|
+
readonly "Match type": "Match type";
|
|
14
|
+
readonly "From path": "From path";
|
|
15
|
+
readonly "To target": "To target";
|
|
16
|
+
readonly "Status code": "Status code";
|
|
17
|
+
readonly "301 (permanent)": "301 (permanent)";
|
|
18
|
+
readonly "302 (temporary)": "302 (temporary)";
|
|
19
|
+
readonly "307 (temporary, method-preserving)": "307 (temporary, method-preserving)";
|
|
20
|
+
readonly "308 (permanent, method-preserving)": "308 (permanent, method-preserving)";
|
|
21
|
+
readonly "Add redirect": "Add redirect";
|
|
22
|
+
readonly "No redirect rules yet.": "No redirect rules yet.";
|
|
23
|
+
readonly From: "From";
|
|
24
|
+
readonly To: "To";
|
|
25
|
+
readonly Type: "Type";
|
|
26
|
+
readonly Code: "Code";
|
|
27
|
+
readonly Source: "Source";
|
|
28
|
+
readonly Hits: "Hits";
|
|
29
|
+
readonly "Delete redirect rule?": "Delete redirect rule?";
|
|
30
|
+
readonly "Loading redirects\u2026": "Loading redirects…";
|
|
31
|
+
readonly "Not valid JSON.": "Not valid JSON.";
|
|
32
|
+
readonly "Must be a JSON array of rule objects.": "Must be a JSON array of rule objects.";
|
|
33
|
+
readonly exact: "Exact match";
|
|
34
|
+
readonly prefix: "Starts with";
|
|
35
|
+
readonly wildcard: "Wildcard";
|
|
36
|
+
readonly Status: "Status";
|
|
37
|
+
readonly More: "More";
|
|
38
|
+
readonly Delete: "Delete";
|
|
39
|
+
readonly Disable: "Disable";
|
|
40
|
+
readonly Enable: "Enable";
|
|
41
|
+
readonly "Saving\u2026": "Saving…";
|
|
42
|
+
readonly Created: "Created";
|
|
43
|
+
readonly active: "Active";
|
|
44
|
+
readonly disabled: "Disabled";
|
|
45
|
+
readonly "{created} created, {failed} failed.": "{created} created, {failed} failed.";
|
|
46
|
+
readonly "Item {index} ({code})": "Item {index} ({code})";
|
|
47
|
+
readonly "Actions for redirect rule from \"{fromPattern}\"": "Actions for redirect rule from \"{fromPattern}\"";
|
|
48
|
+
readonly "Paste a JSON array of ": "Paste a JSON array of ";
|
|
49
|
+
readonly " rule objects (1-500 items)": " rule objects (1-500 items)";
|
|
50
|
+
readonly "Delete the redirect rule from \"": "Delete the redirect rule from \"";
|
|
51
|
+
readonly "\"?": "\"?";
|
|
52
|
+
readonly manual: "Manual";
|
|
53
|
+
readonly auto_slug_change: "URL change";
|
|
54
|
+
readonly import: "Imported";
|
|
55
|
+
};
|
|
56
|
+
/** English fallback with the same named-placeholder interpolation as the host dictionary. */
|
|
57
|
+
export declare const translateRedirectsEn: RedirectsTranslate;
|
|
58
|
+
//# sourceMappingURL=messages.en.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** English source keys are preserved verbatim; the host supplies localized values. */
|
|
2
|
+
export const redirectsMessagesEn = {
|
|
3
|
+
"Loading…": "Loading…",
|
|
4
|
+
"Load hits": "Load hits",
|
|
5
|
+
"Bulk import": "Bulk import",
|
|
6
|
+
"rule objects (1-500 items)": "rule objects (1-500 items)",
|
|
7
|
+
"Importing…": "Importing…",
|
|
8
|
+
"Import": "Import",
|
|
9
|
+
"Marketing": "Marketing",
|
|
10
|
+
"Redirects": "Redirects",
|
|
11
|
+
"Manage URL redirects, including those created automatically when a page's address changes.": "Manage URL redirects, including those created automatically when a page's address changes.",
|
|
12
|
+
"Match type": "Match type",
|
|
13
|
+
"From path": "From path",
|
|
14
|
+
"To target": "To target",
|
|
15
|
+
"Status code": "Status code",
|
|
16
|
+
"301 (permanent)": "301 (permanent)",
|
|
17
|
+
"302 (temporary)": "302 (temporary)",
|
|
18
|
+
"307 (temporary, method-preserving)": "307 (temporary, method-preserving)",
|
|
19
|
+
"308 (permanent, method-preserving)": "308 (permanent, method-preserving)",
|
|
20
|
+
"Add redirect": "Add redirect",
|
|
21
|
+
"No redirect rules yet.": "No redirect rules yet.",
|
|
22
|
+
"From": "From",
|
|
23
|
+
"To": "To",
|
|
24
|
+
"Type": "Type",
|
|
25
|
+
"Code": "Code",
|
|
26
|
+
"Source": "Source",
|
|
27
|
+
"Hits": "Hits",
|
|
28
|
+
"Delete redirect rule?": "Delete redirect rule?",
|
|
29
|
+
"Loading redirects…": "Loading redirects…",
|
|
30
|
+
"Not valid JSON.": "Not valid JSON.",
|
|
31
|
+
"Must be a JSON array of rule objects.": "Must be a JSON array of rule objects.",
|
|
32
|
+
"exact": "Exact match",
|
|
33
|
+
"prefix": "Starts with",
|
|
34
|
+
"wildcard": "Wildcard",
|
|
35
|
+
"Status": "Status",
|
|
36
|
+
"More": "More",
|
|
37
|
+
"Delete": "Delete",
|
|
38
|
+
"Disable": "Disable",
|
|
39
|
+
"Enable": "Enable",
|
|
40
|
+
"Saving…": "Saving…",
|
|
41
|
+
"Created": "Created",
|
|
42
|
+
"active": "Active",
|
|
43
|
+
"disabled": "Disabled",
|
|
44
|
+
"{created} created, {failed} failed.": "{created} created, {failed} failed.",
|
|
45
|
+
"Item {index} ({code})": "Item {index} ({code})",
|
|
46
|
+
"Actions for redirect rule from \"{fromPattern}\"": "Actions for redirect rule from \"{fromPattern}\"",
|
|
47
|
+
"Paste a JSON array of ": "Paste a JSON array of ",
|
|
48
|
+
" rule objects (1-500 items)": " rule objects (1-500 items)",
|
|
49
|
+
"Delete the redirect rule from \"": "Delete the redirect rule from \"",
|
|
50
|
+
"\"?": "\"?",
|
|
51
|
+
"manual": "Manual",
|
|
52
|
+
"auto_slug_change": "URL change",
|
|
53
|
+
"import": "Imported",
|
|
54
|
+
};
|
|
55
|
+
/** English fallback with the same named-placeholder interpolation as the host dictionary. */
|
|
56
|
+
export const translateRedirectsEn = (key, vars = {}) => {
|
|
57
|
+
const template = Object.hasOwn(redirectsMessagesEn, key) ? redirectsMessagesEn[key] : key;
|
|
58
|
+
return template.replace(/\{(\w+)\}/g, (match, name) => String(vars[name] ?? match));
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=messages.en.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** View configuration; redirect records and write contracts belong to core/ports/redirects. */
|
|
2
|
+
export type RedirectsTranslate = (key: string, vars?: Record<string, string | number>) => string;
|
|
3
|
+
export type RedirectsMessageKey = 'importRulesLabel' | 'deleteRedirectBody';
|
|
4
|
+
export interface RedirectsRowAction {
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
destructive?: boolean;
|
|
8
|
+
onSelect: () => void;
|
|
9
|
+
}
|
|
10
|
+
export interface RedirectsWriteState {
|
|
11
|
+
status: 'idle' | 'pending' | 'success' | 'error';
|
|
12
|
+
error: Error | null;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AdminRedirectsPort } from '../core/ports/redirects.js';
|
|
2
|
+
export type { AdminRedirectsPort } from '../core/ports/redirects.js';
|
|
3
|
+
/** Refresh notifications contain no rows; the authorized API remains the data owner. */
|
|
4
|
+
export interface RedirectsEventsPort {
|
|
5
|
+
subscribe(listener: () => void): () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const redirectsApiToken: import("../core/module/token.js").AdminPortToken<AdminRedirectsPort, "admin.redirects.api">;
|
|
8
|
+
export declare const redirectsEventsToken: import("../core/module/token.js").AdminPortToken<RedirectsEventsPort, "admin.redirects.events">;
|
|
9
|
+
//# sourceMappingURL=ports.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { RedirectsTranslate as Translate } from '../../models.js';
|
|
2
|
+
import { useWiredHitCountCell } from '../hooks/wired.hooks.js';
|
|
3
|
+
export interface HitCountCellProps {
|
|
4
|
+
redirectId: string;
|
|
5
|
+
/** Bound translator, threaded down from `Redirects`'s own hook rather than resolved here — see
|
|
6
|
+
* this file's header. */
|
|
7
|
+
t: Translate;
|
|
8
|
+
/** This row's own distinct handle base — same reasoning as `Users.tsx`'s `UserRowProps.agentBase`.
|
|
9
|
+
* Optional (identity-omitted default) since this component is exported and unit-tested directly
|
|
10
|
+
* without one. */
|
|
11
|
+
agentHandleBase?: string;
|
|
12
|
+
/** Dependency injection seam for tests — see `PostsProps.usePostsHook` for the convention. */
|
|
13
|
+
useHitCountCellHook?: typeof useWiredHitCountCell;
|
|
14
|
+
}
|
|
15
|
+
/** Lazy hit-count cell (REQ-03) — fetches on first click rather than on mount, so a list of many
|
|
16
|
+
* rows never fires a synchronous burst of `/hits` requests. A rule with zero recorded hits still
|
|
17
|
+
* renders `0` (not blank), matching `hits.ts`'s own "still 200s with hitCount: 0" contract. */
|
|
18
|
+
export declare function HitCountCell({ redirectId, t, agentHandleBase, useHitCountCellHook }: HitCountCellProps): import("react").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=HitCountCell.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { agentHandle } from '@jini-ai/agentic';
|
|
3
|
+
import { describeApiError } from '../../../core/transport/errors.js';
|
|
4
|
+
import { useWiredHitCountCell } from '../hooks/wired.hooks.js';
|
|
5
|
+
/** Lazy hit-count cell (REQ-03) — fetches on first click rather than on mount, so a list of many
|
|
6
|
+
* rows never fires a synchronous burst of `/hits` requests. A rule with zero recorded hits still
|
|
7
|
+
* renders `0` (not blank), matching `hits.ts`'s own "still 200s with hitCount: 0" contract. */
|
|
8
|
+
export function HitCountCell({ redirectId, t, agentHandleBase, useHitCountCellHook = useWiredHitCountCell }) {
|
|
9
|
+
const { error, data, isFetching, request } = useHitCountCellHook({ redirectId, t });
|
|
10
|
+
if (error)
|
|
11
|
+
return _jsx("span", { className: "save-error", children: describeApiError({ e: error, fallback: "failed" }) });
|
|
12
|
+
// A rule with zero recorded hits still renders `0` (not blank), matching
|
|
13
|
+
// `hits.ts`'s own "still 200s with hitCount: 0" contract — so this branches
|
|
14
|
+
// on the request having completed, never on the count's truthiness.
|
|
15
|
+
if (data)
|
|
16
|
+
return _jsx("span", { children: data.data.hitCount });
|
|
17
|
+
return (_jsx("button", { type: "button", onClick: request, disabled: isFetching, ...(agentHandleBase ? agentHandle({ handle: `${agentHandleBase}-load-hits` }, { role: "button", label: "Load this rule's hit count" }) : {}), children: isFetching ? t("Loading…") : t("Load hits") }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=HitCountCell.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { RedirectsTranslate as Translate } from '../../models.js';
|
|
2
|
+
import { useWiredImportRedirectsForm } from '../hooks/wired.hooks.js';
|
|
3
|
+
export interface ImportRedirectsFormProps {
|
|
4
|
+
/** Bound translator, threaded down from `Redirects`'s own hook rather than resolved here — see
|
|
5
|
+
* this file's header. */
|
|
6
|
+
t: Translate;
|
|
7
|
+
/** Raw resolved locale — needed alongside `t` because the host may resolve locale-specific message fragments. See this file's header. */
|
|
8
|
+
locale: string;
|
|
9
|
+
/** Dependency injection seam for tests — see `PostsProps.usePostsHook` for the convention. */
|
|
10
|
+
useImportRedirectsFormHook?: typeof useWiredImportRedirectsForm;
|
|
11
|
+
}
|
|
12
|
+
/** Bulk-import affordance (REQ-04) — paste a JSON array of rule objects, submit through
|
|
13
|
+
* `api.importRedirects`, and surface the `207` per-item created/failed breakdown directly
|
|
14
|
+
* (never collapsed into a single pass/fail toast — a partial-batch failure is the route's own
|
|
15
|
+
* designed behavior, not an edge case). */
|
|
16
|
+
export declare function ImportRedirectsForm({ t, locale, useImportRedirectsFormHook }: ImportRedirectsFormProps): import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=ImportRedirectsForm.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { agentHandle } from '@jini-ai/agentic';
|
|
3
|
+
import { useWiredImportRedirectsForm } from '../hooks/wired.hooks.js';
|
|
4
|
+
/** Bulk-import affordance (REQ-04) — paste a JSON array of rule objects, submit through
|
|
5
|
+
* `api.importRedirects`, and surface the `207` per-item created/failed breakdown directly
|
|
6
|
+
* (never collapsed into a single pass/fail toast — a partial-batch failure is the route's own
|
|
7
|
+
* designed behavior, not an edge case). */
|
|
8
|
+
export function ImportRedirectsForm({ t, locale, useImportRedirectsFormHook = useWiredImportRedirectsForm }) {
|
|
9
|
+
const { raw, error, result, importing, submit, changeRaw, rulesLabel, resultSummary, createdText, failedLabel } = useImportRedirectsFormHook({ t, locale });
|
|
10
|
+
return (_jsxs("details", { className: "notice redirects-import form-measure", children: [_jsx("summary", { children: t("Bulk import") }), _jsxs("form", { onSubmit: submit, children: [_jsx("label", { htmlFor: "redirects-import-json", children: rulesLabel }), _jsx("textarea", { id: "redirects-import-json", rows: 6, value: raw, onChange: changeRaw, placeholder: '[{"matchType":"exact","fromPattern":"/old","toTarget":"/new","statusCode":301}]', ...agentHandle({ handle: "redirects-import-json" }, { role: "field", label: "JSON array of redirect rules to bulk-import" }) }), _jsx("button", { type: "submit", className: "btn-secondary", disabled: importing, ...agentHandle({ handle: "redirects-import-submit" }, { role: "button", label: "Import the pasted redirect rules" }), children: importing ? t("Importing…") : t("Import") })] }), error ? (_jsx("div", { className: "notice error", role: "alert", children: error })) : null, result ? (_jsxs("div", { className: "redirects-import-result", children: [_jsx("p", { children: resultSummary }), result.created.length > 0 ? (_jsx("ul", { children: result.created.map((r) => (_jsxs("li", { children: [_jsx("span", { className: "save-ok", children: createdText }), " ", r.fromPattern, " \u2192 ", r.toTarget] }, r.id))) })) : null, result.failed.length > 0 ? (_jsx("ul", { children: result.failed.map((f) => (_jsxs("li", { children: [_jsx("span", { className: "save-error", children: failedLabel(f) }), ": ", f.message] }, f.index))) })) : null] })) : null] }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ImportRedirectsForm.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { RedirectsTranslate, RedirectsMessageKey } from '../../models.js';
|
|
3
|
+
/** Node messages retain the host's locale-specific fragment ordering and DOM wrappers. */
|
|
4
|
+
export interface RedirectsRenderMessageInput {
|
|
5
|
+
key: RedirectsMessageKey;
|
|
6
|
+
vars?: Record<string, string | number>;
|
|
7
|
+
shapeCode?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface RedirectsReactOptions {
|
|
10
|
+
t?: RedirectsTranslate;
|
|
11
|
+
locale?: string;
|
|
12
|
+
headerActions?: ReactNode;
|
|
13
|
+
slots?: {
|
|
14
|
+
renderMessage?: (required: RedirectsRenderMessageInput, optional?: Record<string, never>) => ReactNode;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare const RedirectsOptionsContext: import("react").Context<RedirectsReactOptions>;
|
|
18
|
+
export declare function useRedirectsOptions(_required?: Record<string, never>, _optional?: {}): {
|
|
19
|
+
t: RedirectsTranslate;
|
|
20
|
+
locale: string;
|
|
21
|
+
renderMessage: (required: RedirectsRenderMessageInput, optional?: Record<string, never>) => ReactNode;
|
|
22
|
+
headerActions?: ReactNode;
|
|
23
|
+
slots?: {
|
|
24
|
+
renderMessage?: (required: RedirectsRenderMessageInput, optional?: Record<string, never>) => ReactNode;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=RedirectsOptions.hooks.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createContext, createElement, useContext } from 'react';
|
|
2
|
+
import { translateRedirectsEn } from '../../messages.en.js';
|
|
3
|
+
export const RedirectsOptionsContext = createContext({});
|
|
4
|
+
/** English fallback preserves original fragments and the delete body's paragraph wrapper. */
|
|
5
|
+
function renderEnglishMessage({ key, vars = {}, shapeCode }) {
|
|
6
|
+
if (key === 'importRulesLabel')
|
|
7
|
+
return ['Paste a JSON array of ', shapeCode, ' rule objects (1-500 items)'];
|
|
8
|
+
return createElement('p', null, 'Delete the redirect rule from "', vars.fromPattern, '"?');
|
|
9
|
+
}
|
|
10
|
+
export function useRedirectsOptions(_required = {}, _optional = {}) {
|
|
11
|
+
const options = useContext(RedirectsOptionsContext);
|
|
12
|
+
return { ...options, t: options.t ?? translateRedirectsEn, locale: options.locale ?? 'en',
|
|
13
|
+
renderMessage: options.slots?.renderMessage ?? renderEnglishMessage };
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=RedirectsOptions.hooks.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { AdminRedirect } from '../../../core/ports/redirects.js';
|
|
2
|
+
import { useWiredRedirects } from './wired.hooks.js';
|
|
3
|
+
/** Table projections stay outside TSX; DOM/class/handle identities remain the original ones. */
|
|
4
|
+
export declare function useRedirectsPage({ useRedirectsHook }: {
|
|
5
|
+
useRedirectsHook?: typeof useWiredRedirects;
|
|
6
|
+
}, _optional?: {}): {
|
|
7
|
+
columns: ({
|
|
8
|
+
key: string;
|
|
9
|
+
header: string;
|
|
10
|
+
cell: (rule: AdminRedirect) => string;
|
|
11
|
+
} | {
|
|
12
|
+
key: string;
|
|
13
|
+
header: string;
|
|
14
|
+
cell: (rule: AdminRedirect) => import("../../index.js").RedirectStatusCode;
|
|
15
|
+
} | {
|
|
16
|
+
key: string;
|
|
17
|
+
header: string;
|
|
18
|
+
cell: (rule: AdminRedirect) => import("react").DetailedReactHTMLElement<{
|
|
19
|
+
className: string;
|
|
20
|
+
}, HTMLElement>;
|
|
21
|
+
} | {
|
|
22
|
+
key: string;
|
|
23
|
+
header: string;
|
|
24
|
+
cell: (rule: AdminRedirect, index: number) => import("react").FunctionComponentElement<import("../components/HitCountCell.js").HitCountCellProps>;
|
|
25
|
+
} | {
|
|
26
|
+
key: string;
|
|
27
|
+
header: string;
|
|
28
|
+
cell: (rule: AdminRedirect, index: number) => import("react").FunctionComponentElement<import("../../../react/index.js").RowMenuProps>;
|
|
29
|
+
})[];
|
|
30
|
+
headerActions: import("react").ReactNode;
|
|
31
|
+
cancelDelete: () => void | undefined;
|
|
32
|
+
deleteBody: import("react").ReactNode;
|
|
33
|
+
redirects: readonly AdminRedirect[] | undefined;
|
|
34
|
+
listStatus: import("@jini-ai/ui").QueryStatus;
|
|
35
|
+
listError: Error | null;
|
|
36
|
+
error: Error | null;
|
|
37
|
+
saving: boolean;
|
|
38
|
+
pendingDelete: AdminRedirect | null;
|
|
39
|
+
setPendingDelete: (rule: AdminRedirect | null) => void | undefined;
|
|
40
|
+
confirmDelete: () => void | undefined;
|
|
41
|
+
deletePending: boolean;
|
|
42
|
+
createRedirect: (form: FormData) => Promise<boolean>;
|
|
43
|
+
submitCreate: (e: import("react").FormEvent<HTMLFormElement>) => void;
|
|
44
|
+
onToggleStatus: (rule: AdminRedirect) => void | undefined;
|
|
45
|
+
onRequestDelete: (rule: AdminRedirect) => void | undefined;
|
|
46
|
+
t: import("../../models.js").RedirectsTranslate;
|
|
47
|
+
locale: string;
|
|
48
|
+
rowMenuHandles: string[];
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=RedirectsPage.hooks.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
import { RowMenu } from '../../../react/index.js';
|
|
3
|
+
import { redirectRowMenuItems } from '../../rules.js';
|
|
4
|
+
import { HitCountCell } from '../components/HitCountCell.js';
|
|
5
|
+
import { useRedirectsOptions } from './RedirectsOptions.hooks.js';
|
|
6
|
+
import { useWiredRedirects } from './wired.hooks.js';
|
|
7
|
+
/** Table projections stay outside TSX; DOM/class/handle identities remain the original ones. */
|
|
8
|
+
export function useRedirectsPage({ useRedirectsHook = useWiredRedirects }, _optional = {}) {
|
|
9
|
+
const state = useRedirectsHook();
|
|
10
|
+
const { renderMessage, headerActions } = useRedirectsOptions();
|
|
11
|
+
const { t, onToggleStatus, onRequestDelete, rowMenuHandles, pendingDelete } = state;
|
|
12
|
+
const columns = [
|
|
13
|
+
{ key: 'from', header: t('From'), cell: (rule) => rule.fromPattern },
|
|
14
|
+
{ key: 'to', header: t('To'), cell: (rule) => rule.toTarget },
|
|
15
|
+
{ key: 'type', header: t('Type'), cell: (rule) => t(rule.matchType, { serverLabel: rule.matchType }) },
|
|
16
|
+
{ key: 'code', header: t('Code'), cell: (rule) => rule.statusCode },
|
|
17
|
+
{ key: 'source', header: t('Source'), cell: (rule) => t(rule.source, { serverLabel: rule.source }) },
|
|
18
|
+
// The host's shared serverLabel owns enum localization, including unknown-value passthrough.
|
|
19
|
+
{ key: 'status', header: t('Status'), cell: (rule) => createElement('span', { className: `status status-${rule.status}` }, t(rule.status, { serverLabel: rule.status })) },
|
|
20
|
+
{ key: 'hits', header: t('Hits'), cell: (rule, index) => createElement(HitCountCell, { t, redirectId: rule.id, ...(rowMenuHandles[index] ? { agentHandleBase: rowMenuHandles[index] } : {}) }) },
|
|
21
|
+
{ key: 'actions', header: t('More'), cell: (rule, index) => createElement(RowMenu, {
|
|
22
|
+
triggerLabel: t('Actions for redirect rule from "{fromPattern}"', { fromPattern: rule.fromPattern }),
|
|
23
|
+
agentHandle: `${rowMenuHandles[index]}-menu`,
|
|
24
|
+
items: redirectRowMenuItems({ rule, handlers: { onToggleStatus, onRequestDelete } }, { t }),
|
|
25
|
+
}) },
|
|
26
|
+
];
|
|
27
|
+
return { ...state, columns, headerActions, cancelDelete: () => state.setPendingDelete(null),
|
|
28
|
+
deleteBody: pendingDelete ? renderMessage({ key: 'deleteRedirectBody', vars: { fromPattern: pendingDelete.fromPattern } }) : null };
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=RedirectsPage.hooks.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AdminRedirectsPort } from '../../../core/ports/redirects.js';
|
|
2
|
+
import type { RedirectsEventsPort } from '../../ports.js';
|
|
3
|
+
export interface RedirectsPorts {
|
|
4
|
+
readonly redirectsApi: AdminRedirectsPort;
|
|
5
|
+
readonly redirectsEvents?: RedirectsEventsPort;
|
|
6
|
+
}
|
|
7
|
+
export declare const RedirectsPortsContext: import("react").Context<RedirectsPorts | null>;
|
|
8
|
+
/** The module binding supplies scoped ports, never a process-global API client. */
|
|
9
|
+
export declare function useRedirectsPorts(_required?: Record<string, never>, _optional?: {}): RedirectsPorts;
|
|
10
|
+
//# sourceMappingURL=RedirectsPorts.hooks.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
import { AdminConfigError } from '../../../core/module/index.js';
|
|
3
|
+
export const RedirectsPortsContext = createContext(null);
|
|
4
|
+
/** The module binding supplies scoped ports, never a process-global API client. */
|
|
5
|
+
export function useRedirectsPorts(_required = {}, _optional = {}) {
|
|
6
|
+
const ports = useContext(RedirectsPortsContext);
|
|
7
|
+
if (!ports)
|
|
8
|
+
throw new AdminConfigError({ issues: ['React scope unavailable: redirects'] });
|
|
9
|
+
return ports;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=RedirectsPorts.hooks.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AdminRedirectsPort } from '../../../core/ports/redirects.js';
|
|
2
|
+
import type { RedirectsTranslate } from '../../models.js';
|
|
3
|
+
/** Localization is passed from the list once; a row never independently fetches locale settings. */
|
|
4
|
+
export declare function useHitCountCell({ redirectId, api }: {
|
|
5
|
+
redirectId: string;
|
|
6
|
+
api: AdminRedirectsPort;
|
|
7
|
+
}, { t }?: {
|
|
8
|
+
t?: RedirectsTranslate;
|
|
9
|
+
}): {
|
|
10
|
+
error: Error | null;
|
|
11
|
+
data: {
|
|
12
|
+
data: import("../../index.js").AdminRedirectHitStats;
|
|
13
|
+
} | undefined;
|
|
14
|
+
isFetching: boolean;
|
|
15
|
+
request: () => void | undefined;
|
|
16
|
+
t: RedirectsTranslate;
|
|
17
|
+
};
|
|
18
|
+
export type HitCountCellController = ReturnType<typeof useHitCountCell>;
|
|
19
|
+
//# sourceMappingURL=use-hit-count-cell.hooks.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useFetchQuery } from '@jini-ai/ui/fetch-query';
|
|
2
|
+
import { useController } from '../../../core/react/use-controller.js';
|
|
3
|
+
import { createHitCountController } from '../../controllers/hit-count.controller.js';
|
|
4
|
+
import { KEYS } from '../../rules.js';
|
|
5
|
+
import { translateRedirectsEn } from '../../messages.en.js';
|
|
6
|
+
/** Localization is passed from the list once; a row never independently fetches locale settings. */
|
|
7
|
+
export function useHitCountCell({ redirectId, api }, { t = translateRedirectsEn } = {}) {
|
|
8
|
+
// Preserve the original mount-local requested flag across redirect-id/port prop changes.
|
|
9
|
+
const { controller, snapshot } = useController({ create: () => createHitCountController({}), dependencies: [] });
|
|
10
|
+
// Enabled only after a gesture: no N+1 request burst when rendering a large table.
|
|
11
|
+
const hits = useFetchQuery({ key: KEYS.hits({ redirectId }), fetch: () => api.getRedirectHitStats({ id: redirectId }) }, { enabled: snapshot?.requested ?? false });
|
|
12
|
+
return { error: hits.error, data: hits.data === undefined ? undefined : { data: hits.data },
|
|
13
|
+
isFetching: hits.isFetching, request: () => controller?.request(), t };
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=use-hit-count-cell.hooks.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FormEvent } from 'react';
|
|
2
|
+
import type { AdminRedirectsPort } from '../../../core/ports/redirects.js';
|
|
3
|
+
import type { RedirectsTranslate } from '../../models.js';
|
|
4
|
+
/** A resolved 207 is a result, including failed items; only transport failures enter error state. */
|
|
5
|
+
export declare function useImportRedirectsForm({ api }: {
|
|
6
|
+
api: AdminRedirectsPort;
|
|
7
|
+
}, { t, locale }?: {
|
|
8
|
+
t?: RedirectsTranslate;
|
|
9
|
+
locale?: string;
|
|
10
|
+
}): {
|
|
11
|
+
raw: string;
|
|
12
|
+
setRaw: (raw: string) => void | undefined;
|
|
13
|
+
error: string | null;
|
|
14
|
+
result: import("../../index.js").AdminRedirectImportResult | null;
|
|
15
|
+
importing: boolean;
|
|
16
|
+
submit: (e: FormEvent) => Promise<void>;
|
|
17
|
+
t: RedirectsTranslate;
|
|
18
|
+
locale: string;
|
|
19
|
+
};
|
|
20
|
+
export type ImportRedirectsFormController = ReturnType<typeof useImportRedirectsForm>;
|
|
21
|
+
//# sourceMappingURL=use-import-redirects-form.hooks.d.ts.map
|