@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,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useWidgetRegionsView } from '../hooks/page-views.hooks.js';
|
|
3
|
+
import { useWidgetsOptions } from '../hooks/WidgetsPorts.hooks.js';
|
|
4
|
+
import { DataTable } from "../../../react/components/DataTable.js";
|
|
5
|
+
import { agentHandle } from "@jini-ai/agentic";
|
|
6
|
+
import { useWiredWidgetRegions } from "../hooks/use-widget-regions.hooks.js";
|
|
7
|
+
export function WidgetRegions({ useWidgetRegionsHook = useWiredWidgetRegions } = {}) {
|
|
8
|
+
const { headerActions } = useWidgetsOptions();
|
|
9
|
+
const { regions, error, newRegionKey, setNewRegionKey, binding, bind, t, rowHandleByKey } = useWidgetRegionsView({ useWidgetRegionsHook });
|
|
10
|
+
if (error && !regions)
|
|
11
|
+
return _jsx("div", { className: "notice error", children: error });
|
|
12
|
+
if (!regions)
|
|
13
|
+
return _jsx("div", { className: "notice", children: t("Loading regions…") });
|
|
14
|
+
return (_jsxs("div", { className: "page", children: [_jsxs("div", { className: "page-header page-header-split", ...agentHandle({ handle: "widget-regions-header" }, {
|
|
15
|
+
role: "region",
|
|
16
|
+
label: "Widget Regions header — the back link, the screen's title, and the bind-a-region control",
|
|
17
|
+
}), children: [_jsx("div", { className: "page-header-lead", children: _jsxs("a", { className: "btn-secondary", href: "/admin/widgets", "aria-label": `${t("Back")}: ${t("Widgets")}`, ...agentHandle({ handle: "widget-regions-back" }, { role: "link", label: "Back to Widgets" }), children: ["\u2190 ", t("Back")] }) }), _jsxs("div", { className: "page-header-text", children: [_jsx("p", { className: "page-kicker", children: t("Content") }), _jsx("h1", { className: "page-title", children: t("Widget Regions") }), _jsx("p", { className: "page-description", children: t('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.') })] }), _jsxs("div", { className: "page-header-actions page-actions", children: [headerActions, _jsxs("div", { className: "widget-regions-bind", children: [_jsx("input", { value: newRegionKey, onChange: (e) => setNewRegionKey(e.target.value), placeholder: "e.g. footer", ...agentHandle({ handle: "widget-regions-new-key" }, { role: "field", label: "New region key to bind, e.g. footer" }) }), _jsx("button", { onClick: bind, disabled: binding || !newRegionKey.trim(), ...agentHandle({ handle: "widget-regions-bind" }, { role: "button", label: "Bind this region key" }), children: binding ? t("Binding…") : t("Bind region") })] })] })] }), error ? _jsx("div", { className: "notice error", children: error }) : null, _jsx(DataTable, { rows: regions, rowKey: (region) => region.regionKey, empty: _jsx("div", { className: "card", children: _jsx("div", { className: "empty-state", children: _jsx("p", { children: t("No regions bound yet.") }) }) }), columns: [
|
|
18
|
+
{
|
|
19
|
+
key: "region-key",
|
|
20
|
+
header: t("Region key"),
|
|
21
|
+
cell: (region) => (_jsx("a", { href: `/admin/widgets/regions/${region.regionKey}`, ...agentHandle({ handle: `${rowHandleByKey.get(region.regionKey)}-key` }, { role: "link", label: `Manage the "${region.regionKey}" region` }), children: region.regionKey })),
|
|
22
|
+
},
|
|
23
|
+
{ key: "placements", header: t("Placements"), cell: (region) => region.placementCount },
|
|
24
|
+
{
|
|
25
|
+
key: "manage",
|
|
26
|
+
cell: (region) => (_jsx("a", { className: "btn-primary", href: `/admin/widgets/regions/${region.regionKey}`, ...agentHandle({ handle: `${rowHandleByKey.get(region.regionKey)}-manage` }, { role: "link", label: `Manage the "${region.regionKey}" region` }), children: t("Manage") })),
|
|
27
|
+
},
|
|
28
|
+
] })] }));
|
|
29
|
+
}
|
|
30
|
+
export default WidgetRegions;
|
|
31
|
+
//# sourceMappingURL=WidgetRegions.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useWiredWidgetsLibrary } from "../hooks/use-widgets-library.hooks.js";
|
|
2
|
+
/**
|
|
3
|
+
* @file `WidgetsLibraryScreen` (`ui.spec.md` §2.1/§3.1/§4.1) — the widget library/list screen,
|
|
4
|
+
* `/admin/widgets` — markup only. Mirrors `Menus.tsx`'s list-table/status-badge/header-action
|
|
5
|
+
* shape exactly.
|
|
6
|
+
*
|
|
7
|
+
* State and the fetch live in `../hooks/use-widgets-library.hooks.ts`; the shared type-label
|
|
8
|
+
* derivation lives in `../../rules.ts`. Delete always confirms first (`pendingTrash`/`ConfirmDialog`
|
|
9
|
+
* below) and moves the widget to the Trash — there is no purge/force-purge escalation here any
|
|
10
|
+
* more (2026-09-21, `trash-delete-architecture.md`): the server's widget purge route was removed,
|
|
11
|
+
* a trashed widget is hidden from this list by the server, and the Trash screen owns
|
|
12
|
+
* restore/purge from here.
|
|
13
|
+
*/
|
|
14
|
+
export interface WidgetsLibraryProps {
|
|
15
|
+
/**
|
|
16
|
+
* Dependency injection seam for tests — the same convention `Posts.tsx`'s `usePostsHook` uses.
|
|
17
|
+
* Defaulted to the real hook, so production callers pass nothing and behave exactly as before.
|
|
18
|
+
*/
|
|
19
|
+
useWidgetsLibraryHook?: typeof useWiredWidgetsLibrary | undefined;
|
|
20
|
+
}
|
|
21
|
+
export { WidgetsLibraryNotices } from '../components/WidgetsLibraryNotices.js';
|
|
22
|
+
export declare function WidgetsLibrary({ useWidgetsLibraryHook }?: WidgetsLibraryProps): import("react").JSX.Element;
|
|
23
|
+
export default WidgetsLibrary;
|
|
24
|
+
//# sourceMappingURL=WidgetsLibrary.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useWidgetsLibraryView } from '../hooks/page-views.hooks.js';
|
|
3
|
+
import { useWidgetsOptions } from '../hooks/WidgetsPorts.hooks.js';
|
|
4
|
+
import {} from "../../models.js";
|
|
5
|
+
import { ConfirmDialog } from "../../../react/components/ConfirmDialog/ConfirmDialog.js";
|
|
6
|
+
import { DataTable } from "../../../react/components/DataTable.js";
|
|
7
|
+
import { agentHandle } from "@jini-ai/agentic";
|
|
8
|
+
import { widgetTypeLabel } from "../../rules.js";
|
|
9
|
+
import { useWiredWidgetsLibrary } from "../hooks/use-widgets-library.hooks.js";
|
|
10
|
+
export { WidgetsLibraryNotices } from '../components/WidgetsLibraryNotices.js';
|
|
11
|
+
import { WidgetsLibraryNotices } from '../components/WidgetsLibraryNotices.js';
|
|
12
|
+
export function WidgetsLibrary({ useWidgetsLibraryHook = useWiredWidgetsLibrary } = {}) {
|
|
13
|
+
const { widgetTypes, headerActions, statusLabel } = useWidgetsOptions();
|
|
14
|
+
const { widgets, error, skippedCount, skippedIds, createType, setCreateType, pendingTrash, trashing, requestTrash, confirmTrash, cancelTrash, t, locale, rowHandleById, } = useWidgetsLibraryView({ useWidgetsLibraryHook });
|
|
15
|
+
if (error && !widgets)
|
|
16
|
+
return _jsx("div", { className: "notice error", children: error });
|
|
17
|
+
if (!widgets)
|
|
18
|
+
return _jsx("div", { className: "notice", children: t("Loading widgets…") });
|
|
19
|
+
return (_jsxs("div", { className: "page", children: [_jsxs("div", { className: "page-header", children: [_jsxs("div", { className: "page-header-text", children: [_jsx("p", { className: "page-kicker", children: t("Content") }), _jsx("h1", { className: "page-title", children: t("Widgets") }), _jsx("p", { className: "page-description", children: t("Create reusable content blocks and place them into your theme's widget regions.") })] }), _jsxs("div", { className: "page-actions", children: [headerActions, _jsx("a", { href: "/admin/widgets/regions", ...agentHandle({ handle: "widgets-regions-link" }, { role: "link", label: "Go to Widget Regions" }), children: t("Regions →") }), _jsx("select", { value: createType, onChange: (e) => setCreateType(e.target.value), "aria-label": t("Widget type to create"), ...agentHandle({ handle: "widgets-create-type" }, { role: "field", label: "Widget type to create" }), children: widgetTypes.map((o) => (_jsx("option", { value: o.value, children: widgetTypeLabel({ widgetType: o.value, types: widgetTypes }, { t }) }, o.value))) }), _jsx("a", { className: "btn-primary", href: `/admin/widgets/new?type=${createType}`, ...agentHandle({ handle: "widgets-add-new" }, { role: "link", label: "Create a new widget of the selected type" }), children: t("Add New") })] })] }), _jsx(WidgetsLibraryNotices, { error: error, skippedCount: skippedCount, skippedIds: skippedIds, t: t }), _jsx(DataTable, { rows: widgets, rowKey: (widget) => widget.id, empty: _jsx("div", { className: "card", children: _jsxs("div", { className: "empty-state", children: [_jsx("p", { children: t("No widgets yet.") }), _jsx("p", { className: "page-description", children: t("Create one above to get started.") })] }) }), columns: [
|
|
20
|
+
{
|
|
21
|
+
key: "title",
|
|
22
|
+
header: t("Title"),
|
|
23
|
+
cell: (widget) => (_jsx("a", {
|
|
24
|
+
// Slug, not id (2026-09-22, URL-uses-slug — mirrors `FormsList.tsx`'s
|
|
25
|
+
// `/admin/forms/${form.slug}` row link): the editor resolves either
|
|
26
|
+
// (`read-service.ts`'s `getWidgetInstance`), but the slug is the readable one.
|
|
27
|
+
href: `/admin/widgets/${widget.slug}`, ...agentHandle({ handle: `${rowHandleById.get(widget.id)}-edit` }, { role: "link", label: `Edit the "${widget.title}" widget` }), children: widget.title })),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
key: "type",
|
|
31
|
+
header: t("Type"),
|
|
32
|
+
cell: (widget) => widgetTypeLabel({ widgetType: widget.widgetType, types: widgetTypes }, { t }),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: "slug",
|
|
36
|
+
header: t("Slug"),
|
|
37
|
+
// Monospace like Collections' "Key" column (`Collections.tsx`) — a slug is an
|
|
38
|
+
// identifier, not prose.
|
|
39
|
+
cell: (widget) => _jsx("code", { children: widget.slug }),
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
key: "status",
|
|
43
|
+
header: t("Status"),
|
|
44
|
+
cell: (widget) => _jsx("span", { className: `status status-${widget.status}`, children: (statusLabel ?? t)(widget.status) }),
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
key: "actions",
|
|
48
|
+
// Not converted to a `RowMenu` — this is the row's only action (see report: a menu
|
|
49
|
+
// with one item is pure overhead over a direct button). Still labeled for
|
|
50
|
+
// accessibility, matching `Roles.tsx`/`Users.tsx`'s existing pattern for an actions
|
|
51
|
+
// column that isn't a bare `<th></th>`.
|
|
52
|
+
headerLabel: t("Actions"),
|
|
53
|
+
cell: (widget) => (_jsx("button", { onClick: () => requestTrash(widget), ...agentHandle({ handle: `${rowHandleById.get(widget.id)}-trash` }, {
|
|
54
|
+
role: "button",
|
|
55
|
+
label: `Move "${widget.title}" to trash`,
|
|
56
|
+
}), children: t("Trash") })),
|
|
57
|
+
},
|
|
58
|
+
] }), _jsx(ConfirmDialog, { open: pendingTrash !== null, agentHandle: "widgets-trash", title: t("Move to trash?"), body: pendingTrash ? _jsx("p", { children: t('Move "{title}" to trash?').replace("{title}", pendingTrash.title) }) : null, confirmLabel: t("Move to trash"), destructive: true, pending: trashing, onConfirm: confirmTrash, onCancel: cancelTrash })] }));
|
|
59
|
+
}
|
|
60
|
+
export default WidgetsLibrary;
|
|
61
|
+
//# sourceMappingURL=WidgetsLibrary.js.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { AdminApiError } from '../core/transport/errors.js';
|
|
2
|
+
import type { AdminWidget, AdminWidgetPlacement, AdminWidgetType, WidgetTypeOption, WidgetsTranslate, WidgetSlugRedirectPath, WidgetEditorParams } from './models.js';
|
|
3
|
+
export declare const WIDGETS_LIBRARY_RESOURCE = "widgets-library";
|
|
4
|
+
export declare const WIDGETS_REGIONS_RESOURCE = "widgets-regions";
|
|
5
|
+
/** Normalize only the documented host API error shape; preserve the existing shared error owner. */
|
|
6
|
+
export declare function widgetApiError({ error }: {
|
|
7
|
+
error: unknown;
|
|
8
|
+
}, _optional?: Record<string, never>): AdminApiError | null;
|
|
9
|
+
/** Resolve the host catalog's label, then translate; unknown stored types retain their raw value. */
|
|
10
|
+
export declare function widgetTypeLabel({ widgetType, types }: {
|
|
11
|
+
widgetType: string;
|
|
12
|
+
types: readonly WidgetTypeOption[];
|
|
13
|
+
}, { t }?: {
|
|
14
|
+
t?: WidgetsTranslate | undefined;
|
|
15
|
+
}): string;
|
|
16
|
+
/** Creation accepts only the host catalog; stored types remain an open vocabulary. */
|
|
17
|
+
export declare function isKnownWidgetType({ widgetType, types }: {
|
|
18
|
+
widgetType: string;
|
|
19
|
+
types: readonly WidgetTypeOption[];
|
|
20
|
+
}, _optional?: Record<string, never>): boolean;
|
|
21
|
+
export declare function widgetConfigFieldErrors({ error }: {
|
|
22
|
+
error: unknown;
|
|
23
|
+
}, _optional?: Record<string, never>): Array<{
|
|
24
|
+
field: string;
|
|
25
|
+
reason: string;
|
|
26
|
+
}>;
|
|
27
|
+
/** Missing loaded data deliberately resolves to undefined, matching the original editor. */
|
|
28
|
+
export declare function resolveEditorWidgetType({ isNew, queryWidgetType, widget }: {
|
|
29
|
+
isNew: boolean;
|
|
30
|
+
queryWidgetType: string | null;
|
|
31
|
+
widget: AdminWidget | null;
|
|
32
|
+
}, _optional?: Record<string, never>): AdminWidgetType | null | undefined;
|
|
33
|
+
/** Copy before swapping; an out-of-bounds move retains the original reference. O(n) per move. */
|
|
34
|
+
export declare function movePlacement<T>({ items, index, direction }: {
|
|
35
|
+
items: T[];
|
|
36
|
+
index: number;
|
|
37
|
+
direction: -1 | 1;
|
|
38
|
+
}, _optional?: Record<string, never>): T[];
|
|
39
|
+
/** Draft identity survives reorder/remove/toggle until the server accepts the ordered placements. */
|
|
40
|
+
export declare function buildDraftPlacement({ widgetInstanceId }: {
|
|
41
|
+
widgetInstanceId: string;
|
|
42
|
+
}, { id }?: {
|
|
43
|
+
id?: (() => string) | undefined;
|
|
44
|
+
}): AdminWidgetPlacement;
|
|
45
|
+
export interface WidgetSaveErrorOutcome {
|
|
46
|
+
error: string;
|
|
47
|
+
fieldErrors: Array<{
|
|
48
|
+
field: string;
|
|
49
|
+
reason: string;
|
|
50
|
+
}>;
|
|
51
|
+
}
|
|
52
|
+
/** Conflict copy is domain-specific; other failures use the existing admin error describer. */
|
|
53
|
+
export declare function resolveWidgetSaveError({ error }: {
|
|
54
|
+
error: unknown;
|
|
55
|
+
}, { t }?: {
|
|
56
|
+
t?: WidgetsTranslate | undefined;
|
|
57
|
+
}): WidgetSaveErrorOutcome;
|
|
58
|
+
export declare function resolveWidgetRegionSaveError({ error }: {
|
|
59
|
+
error: unknown;
|
|
60
|
+
}, { t }?: {
|
|
61
|
+
t?: WidgetsTranslate | undefined;
|
|
62
|
+
}): string;
|
|
63
|
+
/** The general slug rule remains host-owned and optional; no parallel slug policy is introduced. */
|
|
64
|
+
export declare function widgetSlugRedirectPath({ requestedId, widget }: {
|
|
65
|
+
requestedId: string;
|
|
66
|
+
widget: Pick<AdminWidget, 'id' | 'slug'>;
|
|
67
|
+
}, { slugRedirectPath }?: {
|
|
68
|
+
slugRedirectPath?: WidgetSlugRedirectPath | undefined;
|
|
69
|
+
}): string | null;
|
|
70
|
+
export type WidgetInstanceGuard = {
|
|
71
|
+
kind: 'fetch-error';
|
|
72
|
+
message: string;
|
|
73
|
+
} | {
|
|
74
|
+
kind: 'loading';
|
|
75
|
+
} | {
|
|
76
|
+
kind: 'no-type';
|
|
77
|
+
} | {
|
|
78
|
+
kind: 'unknown-type';
|
|
79
|
+
widgetType: string;
|
|
80
|
+
};
|
|
81
|
+
/** Catch a garbage ?type= before a live create editor can save it; existing types are server-validated. */
|
|
82
|
+
export declare function widgetInstanceGuard({ error, isNew, widget, loading, widgetType, types }: {
|
|
83
|
+
error: string | null;
|
|
84
|
+
isNew: boolean;
|
|
85
|
+
widget: AdminWidget | null;
|
|
86
|
+
loading: boolean;
|
|
87
|
+
widgetType: string | null | undefined;
|
|
88
|
+
types: readonly WidgetTypeOption[];
|
|
89
|
+
}, _optional?: Record<string, never>): WidgetInstanceGuard | null;
|
|
90
|
+
/** Match the original save identity, including the query type on /new. */
|
|
91
|
+
export declare function widgetEntityKey({ params }: {
|
|
92
|
+
params: WidgetEditorParams;
|
|
93
|
+
}, _optional?: Record<string, never>): string;
|
|
94
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { AdminApiError, describeApiError } from '../core/transport/errors.js';
|
|
2
|
+
import { widgetsEnglish } from './messages.en.js';
|
|
3
|
+
export const WIDGETS_LIBRARY_RESOURCE = 'widgets-library';
|
|
4
|
+
// Regions are a separate list; placement editors use baseVersion rather than live refresh.
|
|
5
|
+
export const WIDGETS_REGIONS_RESOURCE = 'widgets-regions';
|
|
6
|
+
/** Normalize only the documented host API error shape; preserve the existing shared error owner. */
|
|
7
|
+
export function widgetApiError({ error }, _optional = {}) {
|
|
8
|
+
if (error instanceof AdminApiError)
|
|
9
|
+
return error;
|
|
10
|
+
if (error instanceof Error && 'status' in error && typeof error.status === 'number') {
|
|
11
|
+
const host = error;
|
|
12
|
+
return new AdminApiError({ message: host.message, status: host.status }, { code: host.code, body: host.body });
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
/** Resolve the host catalog's label, then translate; unknown stored types retain their raw value. */
|
|
17
|
+
export function widgetTypeLabel({ widgetType, types }, { t = widgetsEnglish } = {}) {
|
|
18
|
+
return t(types.find(o => o.value === widgetType)?.label ?? widgetType);
|
|
19
|
+
}
|
|
20
|
+
/** Creation accepts only the host catalog; stored types remain an open vocabulary. */
|
|
21
|
+
export function isKnownWidgetType({ widgetType, types }, _optional = {}) {
|
|
22
|
+
return types.some(o => o.value === widgetType);
|
|
23
|
+
}
|
|
24
|
+
export function widgetConfigFieldErrors({ error }, _optional = {}) {
|
|
25
|
+
const e = widgetApiError({ error });
|
|
26
|
+
if (e?.code !== 'WIDGETS_CONFIG_VALIDATION_ERROR')
|
|
27
|
+
return [];
|
|
28
|
+
const details = e.body?.details;
|
|
29
|
+
return details?.fieldErrors ?? [];
|
|
30
|
+
}
|
|
31
|
+
/** Missing loaded data deliberately resolves to undefined, matching the original editor. */
|
|
32
|
+
export function resolveEditorWidgetType({ isNew, queryWidgetType, widget }, _optional = {}) {
|
|
33
|
+
return isNew ? queryWidgetType : widget?.widgetType;
|
|
34
|
+
}
|
|
35
|
+
/** Copy before swapping; an out-of-bounds move retains the original reference. O(n) per move. */
|
|
36
|
+
export function movePlacement({ items, index, direction }, _optional = {}) {
|
|
37
|
+
const target = index + direction;
|
|
38
|
+
if (target < 0 || target >= items.length)
|
|
39
|
+
return items;
|
|
40
|
+
const next = [...items];
|
|
41
|
+
[next[index], next[target]] = [next[target], next[index]];
|
|
42
|
+
return next;
|
|
43
|
+
}
|
|
44
|
+
// Distinguishes draft keys created in the same millisecond without randomUUID.
|
|
45
|
+
let draftPlacementSequence = 0;
|
|
46
|
+
/** Draft identity survives reorder/remove/toggle until the server accepts the ordered placements. */
|
|
47
|
+
export function buildDraftPlacement({ widgetInstanceId }, { id = () => globalThis.crypto?.randomUUID?.() ?? `p-${Date.now()}-${++draftPlacementSequence}` } = {}) {
|
|
48
|
+
return { placementId: id(), widgetEntryId: widgetInstanceId, enabled: true, widgetTitle: null, widgetType: null, broken: false };
|
|
49
|
+
}
|
|
50
|
+
/** Conflict copy is domain-specific; other failures use the existing admin error describer. */
|
|
51
|
+
export function resolveWidgetSaveError({ error }, { t = widgetsEnglish } = {}) {
|
|
52
|
+
const e = widgetApiError({ error });
|
|
53
|
+
if (e?.code === 'WIDGETS_VERSION_CONFLICT')
|
|
54
|
+
return { error: t('This widget changed since you loaded it, refresh and try again.'), fieldErrors: [] };
|
|
55
|
+
return { error: describeApiError({ e: e ?? error, fallback: t('save failed') }), fieldErrors: widgetConfigFieldErrors({ error }) };
|
|
56
|
+
}
|
|
57
|
+
export function resolveWidgetRegionSaveError({ error }, { t = widgetsEnglish } = {}) {
|
|
58
|
+
const e = widgetApiError({ error });
|
|
59
|
+
if (e?.code === 'WIDGETS_AREA_CONFLICT')
|
|
60
|
+
return t('This region changed since you loaded it, refresh and try again.');
|
|
61
|
+
return describeApiError({ e: e ?? error, fallback: t('save failed') });
|
|
62
|
+
}
|
|
63
|
+
/** The general slug rule remains host-owned and optional; no parallel slug policy is introduced. */
|
|
64
|
+
export function widgetSlugRedirectPath({ requestedId, widget }, { slugRedirectPath } = {}) {
|
|
65
|
+
return slugRedirectPath?.('/widgets', requestedId, widget) ?? null;
|
|
66
|
+
}
|
|
67
|
+
/** Catch a garbage ?type= before a live create editor can save it; existing types are server-validated. */
|
|
68
|
+
export function widgetInstanceGuard({ error, isNew, widget, loading, widgetType, types }, _optional = {}) {
|
|
69
|
+
if (error && !isNew && !widget)
|
|
70
|
+
return { kind: 'fetch-error', message: error };
|
|
71
|
+
if (loading)
|
|
72
|
+
return { kind: 'loading' };
|
|
73
|
+
if (!widgetType)
|
|
74
|
+
return { kind: 'no-type' };
|
|
75
|
+
if (isNew && !isKnownWidgetType({ widgetType, types }))
|
|
76
|
+
return { kind: 'unknown-type', widgetType };
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
/** Match the original save identity, including the query type on /new. */
|
|
80
|
+
export function widgetEntityKey({ params }, _optional = {}) {
|
|
81
|
+
return `${params.widgetId ?? ''}::${params.widgetType ?? ''}::${params.widgetId === null}`;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=rules.js.map
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export declare const widgetsAgentPageIds: {
|
|
2
|
+
readonly library: "widgets";
|
|
3
|
+
readonly editor: "widgets";
|
|
4
|
+
readonly regions: "widget-regions";
|
|
5
|
+
readonly region: "widget-regions";
|
|
6
|
+
};
|
|
7
|
+
export declare const widgetsEditorPaths: readonly ["/widgets/new", "/widgets/:widgetId"];
|
|
8
|
+
/** No client permissions are declared, matching the host panels; servers authorize widgets.*. */
|
|
9
|
+
export declare const widgetsModule: {
|
|
10
|
+
readonly id: "widgets";
|
|
11
|
+
readonly requires: {
|
|
12
|
+
readonly widgetsApi: import("../core/module/token.js").AdminPortToken<import("./ports.js").AdminWidgetsPort, "admin.widgets.api">;
|
|
13
|
+
};
|
|
14
|
+
readonly optional: {
|
|
15
|
+
readonly widgetsEvents: import("../core/module/token.js").AdminPortToken<import("./ports.js").WidgetsEventsPort, "admin.widgets.events">;
|
|
16
|
+
readonly widgetsNavigation: import("../core/module/token.js").AdminPortToken<import("./ports.js").WidgetsNavigationPort, "admin.widgets.navigation">;
|
|
17
|
+
};
|
|
18
|
+
readonly messages: {
|
|
19
|
+
readonly Back: "Back";
|
|
20
|
+
readonly "Widget type to create": "Widget type to create";
|
|
21
|
+
readonly Content: "Content";
|
|
22
|
+
readonly Text: "Text";
|
|
23
|
+
readonly "Social Links": "Social Links";
|
|
24
|
+
readonly "Collection list": "Collection list";
|
|
25
|
+
readonly Menu: "Menu";
|
|
26
|
+
readonly "Contact Form": "Contact Form";
|
|
27
|
+
readonly Widgets: "Widgets";
|
|
28
|
+
readonly "Widget Regions": "Widget Regions";
|
|
29
|
+
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.";
|
|
30
|
+
readonly "Binding\u2026": "Binding…";
|
|
31
|
+
readonly "Bind region": "Bind region";
|
|
32
|
+
readonly "No regions bound yet.": "No regions bound yet.";
|
|
33
|
+
readonly "Region key": "Region key";
|
|
34
|
+
readonly Placements: "Placements";
|
|
35
|
+
readonly Manage: "Manage";
|
|
36
|
+
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.";
|
|
37
|
+
readonly "Regions \u2192": "Regions →";
|
|
38
|
+
readonly "Add New": "Add New";
|
|
39
|
+
readonly "1 widget record in this workspace could not be read.": "1 widget record in this workspace could not be read.";
|
|
40
|
+
readonly "{n} widget records in this workspace could not be read.": "{n} widget records in this workspace could not be read.";
|
|
41
|
+
readonly "Show ids": "Show ids";
|
|
42
|
+
readonly "No widgets yet.": "No widgets yet.";
|
|
43
|
+
readonly "Create one above to get started.": "Create one above to get started.";
|
|
44
|
+
readonly Title: "Title";
|
|
45
|
+
readonly Type: "Type";
|
|
46
|
+
readonly Slug: "Slug";
|
|
47
|
+
readonly Status: "Status";
|
|
48
|
+
readonly Actions: "Actions";
|
|
49
|
+
readonly Trash: "Trash";
|
|
50
|
+
readonly "Move to trash?": "Move to trash?";
|
|
51
|
+
readonly "Move to trash": "Move to trash";
|
|
52
|
+
readonly "Move \"{title}\" to trash?": "Move \"{title}\" to trash?";
|
|
53
|
+
readonly Regions: "Regions";
|
|
54
|
+
readonly "Saving\u2026": "Saving…";
|
|
55
|
+
readonly Save: "Save";
|
|
56
|
+
readonly "Region:": "Region:";
|
|
57
|
+
readonly "Manage which widgets appear in this region and their order.": "Manage which widgets appear in this region and their order.";
|
|
58
|
+
readonly "No widgets placed in this region yet.": "No widgets placed in this region yet.";
|
|
59
|
+
readonly Enabled: "Enabled";
|
|
60
|
+
readonly "\u26A0 Broken reference": "⚠ Broken reference";
|
|
61
|
+
readonly "+ Add widget": "+ Add widget";
|
|
62
|
+
readonly "New widget": "New widget";
|
|
63
|
+
readonly "Edit widget": "Edit widget";
|
|
64
|
+
readonly "Configure this widget's title and settings.": "Configure this widget's title and settings.";
|
|
65
|
+
readonly "Widget title": "Widget title";
|
|
66
|
+
readonly "Type:": "Type:";
|
|
67
|
+
readonly "Region area": "Region area";
|
|
68
|
+
readonly "Inline embed": "Inline embed";
|
|
69
|
+
readonly "Used in 1 place:": "Used in 1 place:";
|
|
70
|
+
readonly "Used in {count} places:": "Used in {count} places:";
|
|
71
|
+
readonly "failed to load widget": "failed to load widget";
|
|
72
|
+
readonly "save failed": "save failed";
|
|
73
|
+
readonly "This widget changed since you loaded it, refresh and try again.": "This widget changed since you loaded it, refresh and try again.";
|
|
74
|
+
readonly "This region changed since you loaded it, refresh and try again.": "This region changed since you loaded it, refresh and try again.";
|
|
75
|
+
readonly "failed to load region": "failed to load region";
|
|
76
|
+
readonly "failed to load widgets": "failed to load widgets";
|
|
77
|
+
readonly "delete failed": "delete failed";
|
|
78
|
+
readonly "This item changed since you loaded it. Reload and try again.": "This item changed since you loaded it. Reload and try again.";
|
|
79
|
+
readonly "failed to load regions": "failed to load regions";
|
|
80
|
+
readonly "bind failed": "bind failed";
|
|
81
|
+
readonly "Loading widget\u2026": "Loading widget…";
|
|
82
|
+
readonly "No widget type specified.": "No widget type specified.";
|
|
83
|
+
readonly "Unknown widget type \"": "Unknown widget type \"";
|
|
84
|
+
readonly "Loading region\u2026": "Loading region…";
|
|
85
|
+
readonly "Move up": "Move up";
|
|
86
|
+
readonly "Move down": "Move down";
|
|
87
|
+
readonly Remove: "Remove";
|
|
88
|
+
readonly "Loading regions\u2026": "Loading regions…";
|
|
89
|
+
readonly "Loading widgets\u2026": "Loading widgets…";
|
|
90
|
+
readonly "Saved \u00B7 version {version}": "Saved · version {version}";
|
|
91
|
+
};
|
|
92
|
+
readonly pages: {
|
|
93
|
+
readonly library: {
|
|
94
|
+
readonly path: "/widgets";
|
|
95
|
+
readonly label: "Widgets";
|
|
96
|
+
readonly agentReachable: true;
|
|
97
|
+
readonly nav: {
|
|
98
|
+
readonly group: "Content";
|
|
99
|
+
};
|
|
100
|
+
readonly tabs: {};
|
|
101
|
+
};
|
|
102
|
+
readonly editor: {
|
|
103
|
+
readonly path: "/widgets/:widgetId";
|
|
104
|
+
readonly label: "Edit widget";
|
|
105
|
+
readonly agentReachable: true;
|
|
106
|
+
readonly tabs: {};
|
|
107
|
+
};
|
|
108
|
+
readonly regions: {
|
|
109
|
+
readonly path: "/widgets/regions";
|
|
110
|
+
readonly label: "Widget Regions";
|
|
111
|
+
readonly agentReachable: true;
|
|
112
|
+
readonly tabs: {};
|
|
113
|
+
};
|
|
114
|
+
readonly region: {
|
|
115
|
+
readonly path: "/widgets/regions/:regionKey";
|
|
116
|
+
readonly label: "Region:";
|
|
117
|
+
readonly agentReachable: true;
|
|
118
|
+
readonly tabs: {};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=widgets.module.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineAdminModule } from '../core/module/index.js';
|
|
2
|
+
import { widgetsApiToken, widgetsEventsToken, widgetsNavigationToken } from './ports.js';
|
|
3
|
+
import { widgetsMessagesEn } from './messages.en.js';
|
|
4
|
+
// Region pages share the host agent id; route-specific module page ids do not replace it.
|
|
5
|
+
export const widgetsAgentPageIds = { library: 'widgets', editor: 'widgets', regions: 'widget-regions', region: 'widget-regions' };
|
|
6
|
+
export const widgetsEditorPaths = ['/widgets/new', '/widgets/:widgetId'];
|
|
7
|
+
/** No client permissions are declared, matching the host panels; servers authorize widgets.*. */
|
|
8
|
+
export const widgetsModule = defineAdminModule({
|
|
9
|
+
id: 'widgets',
|
|
10
|
+
requires: { widgetsApi: widgetsApiToken },
|
|
11
|
+
optional: { widgetsEvents: widgetsEventsToken, widgetsNavigation: widgetsNavigationToken },
|
|
12
|
+
messages: widgetsMessagesEn,
|
|
13
|
+
pages: {
|
|
14
|
+
library: { path: '/widgets', label: 'Widgets', agentReachable: true, nav: { group: 'Content' }, tabs: {} },
|
|
15
|
+
// core currently supports one path per page; /new is dispatched to this same editor by the host.
|
|
16
|
+
editor: { path: '/widgets/:widgetId', label: 'Edit widget', agentReachable: true, tabs: {} },
|
|
17
|
+
regions: { path: '/widgets/regions', label: 'Widget Regions', agentReachable: true, tabs: {} },
|
|
18
|
+
region: { path: '/widgets/regions/:regionKey', label: 'Region:', agentReachable: true, tabs: {} },
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=widgets.module.js.map
|