@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,28 @@
|
|
|
1
|
+
import { createContext, createElement, lazy, useContext } from 'react';
|
|
2
|
+
import { AdminConfigError } from '../module/create-admin.js';
|
|
3
|
+
/** Every page and tab is lazy. The only port context is private to this binding;
|
|
4
|
+
* a sibling module can never read another module's dependencies through a global locator. */
|
|
5
|
+
export function bindReact({ module, views }, { context } = {}) {
|
|
6
|
+
const Context = context ?? createContext(null);
|
|
7
|
+
const pages = Object.fromEntries(Object.entries(views).map(([id, raw]) => {
|
|
8
|
+
const view = raw;
|
|
9
|
+
return [
|
|
10
|
+
id,
|
|
11
|
+
{
|
|
12
|
+
Page: lazy(view.page),
|
|
13
|
+
tabs: Object.fromEntries(Object.entries(view.tabs).map(([tab, load]) => [tab, lazy(load)])),
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
}));
|
|
17
|
+
function usePorts(_required = {}, _optional = {}) {
|
|
18
|
+
const ports = useContext(Context);
|
|
19
|
+
if (!ports)
|
|
20
|
+
throw new AdminConfigError({ issues: [`React scope unavailable: ${module.id}`] });
|
|
21
|
+
return ports;
|
|
22
|
+
}
|
|
23
|
+
function Provider({ admin, children }, _optional = {}) {
|
|
24
|
+
return createElement(Context.Provider, { value: admin.scope({ module }) }, children);
|
|
25
|
+
}
|
|
26
|
+
return { module, pages, Provider, usePorts };
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=bind-react.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DependencyList } from 'react';
|
|
2
|
+
import type { ControllerStore } from '../module/controller-store.js';
|
|
3
|
+
/** Factory runs after commit, never during render. Each effect attachment owns a fresh
|
|
4
|
+
* controller, so StrictMode's cleanup/replay cannot revive a disposed controller. */
|
|
5
|
+
export declare function useController<C extends ControllerStore<unknown>>({ create, dependencies }: {
|
|
6
|
+
create: () => C;
|
|
7
|
+
dependencies: DependencyList;
|
|
8
|
+
}, { start, }?: {
|
|
9
|
+
start?: (required: {
|
|
10
|
+
controller: C;
|
|
11
|
+
}, optional?: Record<string, never>) => void;
|
|
12
|
+
}): {
|
|
13
|
+
controller: C | null;
|
|
14
|
+
snapshot: ReturnType<C["getSnapshot"]> | null;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=use-controller.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useEffect, useState, useSyncExternalStore, useCallback } from 'react';
|
|
2
|
+
/** Factory runs after commit, never during render. Each effect attachment owns a fresh
|
|
3
|
+
* controller, so StrictMode's cleanup/replay cannot revive a disposed controller. */
|
|
4
|
+
export function useController({ create, dependencies }, { start, } = {}) {
|
|
5
|
+
const [controller, setController] = useState(null);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
const current = create();
|
|
8
|
+
setController(current);
|
|
9
|
+
start?.({ controller: current });
|
|
10
|
+
return () => current.dispose();
|
|
11
|
+
// Dependencies are explicitly supplied by the owning hook, like useMemo's contract.
|
|
12
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13
|
+
}, dependencies);
|
|
14
|
+
const subscribe = useCallback((listener) => controller?.subscribe({ listener }) ?? (() => { }), [controller]);
|
|
15
|
+
const snapshot = useSyncExternalStore(subscribe, () => (controller?.getSnapshot() ?? null), () => null);
|
|
16
|
+
return { controller, snapshot };
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=use-controller.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AdminFormsPort } from '../../core/ports/forms.js';
|
|
2
|
+
import type { FormsTrashPort } from '../ports.js';
|
|
3
|
+
/** The host owns auth, workspace addressing, retries, error decoding and telemetry. */
|
|
4
|
+
export interface FormsTransportPort {
|
|
5
|
+
request<T>(required: {
|
|
6
|
+
path: string;
|
|
7
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
8
|
+
body?: unknown;
|
|
9
|
+
}, optional?: {
|
|
10
|
+
signal?: AbortSignal;
|
|
11
|
+
}): Promise<T>;
|
|
12
|
+
url(required: {
|
|
13
|
+
path: string;
|
|
14
|
+
}, optional?: Record<string, never>): string;
|
|
15
|
+
}
|
|
16
|
+
/** Preserve the existing forms wire, including its data envelopes and explicit authoring route. */
|
|
17
|
+
export declare function createHttpFormsApi({ transport, basePath }: {
|
|
18
|
+
transport: FormsTransportPort;
|
|
19
|
+
basePath: string;
|
|
20
|
+
}, _optional?: Record<string, never>): AdminFormsPort;
|
|
21
|
+
/** The same generic POST used by both host screens; no form lifecycle is reimplemented here. */
|
|
22
|
+
export declare function createHttpFormsTrash({ transport, basePath }: {
|
|
23
|
+
transport: FormsTransportPort;
|
|
24
|
+
basePath: string;
|
|
25
|
+
}, _optional?: Record<string, never>): FormsTrashPort;
|
|
26
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** Preserve the existing forms wire, including its data envelopes and explicit authoring route. */
|
|
2
|
+
export function createHttpFormsApi({ transport, basePath }, _optional = {}) {
|
|
3
|
+
const base = basePath.replace(/\/$/, '');
|
|
4
|
+
const formPath = (id) => `${base}/${encodeURIComponent(id)}`;
|
|
5
|
+
const submissionPath = (formId, submissionId) => `${formPath(formId)}/submissions${submissionId === undefined ? '' : `/${encodeURIComponent(submissionId)}`}`;
|
|
6
|
+
return {
|
|
7
|
+
async listFormDefinitions(_required, _optional = {}) {
|
|
8
|
+
return (await transport.request({ path: base, method: 'GET' })).data;
|
|
9
|
+
},
|
|
10
|
+
async getFormDefinition({ id }, _optional = {}) {
|
|
11
|
+
return (await transport.request({ path: formPath(id), method: 'GET' })).data;
|
|
12
|
+
},
|
|
13
|
+
async createFormDefinition(input, optional = {}) {
|
|
14
|
+
return (await transport.request({ path: base, method: 'POST', body: { ...input, ...optional } })).data;
|
|
15
|
+
},
|
|
16
|
+
async updateFormDefinition({ id }, patch = {}) {
|
|
17
|
+
const authoring = patch.mode !== undefined || patch.html !== undefined;
|
|
18
|
+
return (await transport.request({ path: `${formPath(id)}${authoring ? '/authoring' : ''}`, method: 'PUT', body: patch })).data;
|
|
19
|
+
},
|
|
20
|
+
async listFormSubmissions({ formId }, options = {}) {
|
|
21
|
+
const params = new URLSearchParams();
|
|
22
|
+
if (options.cursor)
|
|
23
|
+
params.set('cursor', options.cursor);
|
|
24
|
+
if (options.limit)
|
|
25
|
+
params.set('limit', String(options.limit));
|
|
26
|
+
const qs = params.toString();
|
|
27
|
+
const response = await transport.request({ path: `${submissionPath(formId)}${qs ? `?${qs}` : ''}`, method: 'GET' });
|
|
28
|
+
return { items: response.data, nextCursor: response.nextCursor };
|
|
29
|
+
},
|
|
30
|
+
async getFormSubmission({ formId, submissionId }, _optional = {}) {
|
|
31
|
+
return (await transport.request({ path: submissionPath(formId, submissionId), method: 'GET' })).data;
|
|
32
|
+
},
|
|
33
|
+
async deleteFormSubmission({ formId, submissionId }, _optional = {}) {
|
|
34
|
+
// The server delegates DELETE to Trash; permanent deletion belongs to the Trash screen.
|
|
35
|
+
await transport.request({ path: submissionPath(formId, submissionId), method: 'DELETE' });
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** The same generic POST used by both host screens; no form lifecycle is reimplemented here. */
|
|
40
|
+
export function createHttpFormsTrash({ transport, basePath }, _optional = {}) {
|
|
41
|
+
return { trash: (body, _options = {}) => transport.request({ path: basePath, method: 'POST', body }) };
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=http.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AdminFormsPort, AdminFormDefinition, AdminFormSubmission } from '../../core/ports/forms.js';
|
|
2
|
+
import type { FormsTrashPort } from '../ports.js';
|
|
3
|
+
/** A scoped, deterministic in-memory API with the core contract's add/edit-only invariant. */
|
|
4
|
+
export declare function createMemoryFormsApi(_required?: Record<string, never>, { forms, submissions, now, nextId }?: {
|
|
5
|
+
forms?: readonly AdminFormDefinition[];
|
|
6
|
+
submissions?: readonly AdminFormSubmission[];
|
|
7
|
+
now?: () => string;
|
|
8
|
+
nextId?: () => string;
|
|
9
|
+
}): AdminFormsPort & {
|
|
10
|
+
readonly forms: AdminFormDefinition[];
|
|
11
|
+
readonly submissions: AdminFormSubmission[];
|
|
12
|
+
readonly trash: FormsTrashPort;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { AdminApiError } from '../../core/transport/errors.js';
|
|
2
|
+
/** A scoped, deterministic in-memory API with the core contract's add/edit-only invariant. */
|
|
3
|
+
export function createMemoryFormsApi(_required = {}, { forms = [], submissions = [], now = () => new Date(0).toISOString(), nextId } = {}) {
|
|
4
|
+
const definitions = structuredClone([...forms]);
|
|
5
|
+
const answers = structuredClone([...submissions]);
|
|
6
|
+
let sequence = definitions.length;
|
|
7
|
+
const missing = (id) => { throw new AdminApiError({ message: `form definition '${id}' was not found`, status: 404 }); };
|
|
8
|
+
const find = (id) => definitions.find(form => form.slug === id) ?? definitions.find(form => form.id === id) ?? missing(id);
|
|
9
|
+
const definitionId = (id) => definitions.find(form => form.slug === id)?.id ?? id;
|
|
10
|
+
const findSubmission = (formId, id) => {
|
|
11
|
+
const resolvedId = definitionId(formId);
|
|
12
|
+
return answers.find(item => item.id === id && item.formDefinitionId === resolvedId && item.status !== 'trash') ?? missing(id);
|
|
13
|
+
};
|
|
14
|
+
const remove = (type, id) => {
|
|
15
|
+
const rows = type === 'form' ? definitions : answers;
|
|
16
|
+
const index = rows.findIndex(row => row.id === id);
|
|
17
|
+
if (index < 0)
|
|
18
|
+
missing(id);
|
|
19
|
+
// The fixture retains submission payloads just as the generic Trash owner does. Definitions
|
|
20
|
+
// keep their existing separate fixture projection; the core has no definition-delete method.
|
|
21
|
+
if (type === 'form_submission')
|
|
22
|
+
answers[index] = { ...answers[index], status: 'trash' };
|
|
23
|
+
else
|
|
24
|
+
rows.splice(index, 1);
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
forms: definitions, submissions: answers,
|
|
28
|
+
async listFormDefinitions(_required, _optional = {}) { return structuredClone(definitions); },
|
|
29
|
+
async getFormDefinition({ id }, _optional = {}) { return structuredClone(find(id)); },
|
|
30
|
+
async createFormDefinition(input, options = {}) {
|
|
31
|
+
if (definitions.some(form => form.slug === input.slug))
|
|
32
|
+
throw new AdminApiError({ message: 'form slug already exists', status: 409 });
|
|
33
|
+
let id = nextId?.() ?? `fake-${++sequence}`;
|
|
34
|
+
if (!nextId)
|
|
35
|
+
while (definitions.some(form => form.id === id))
|
|
36
|
+
id = `fake-${++sequence}`;
|
|
37
|
+
if (definitions.some(form => form.id === id))
|
|
38
|
+
throw new AdminApiError({ message: 'form id already exists', status: 409 });
|
|
39
|
+
const created = { ...structuredClone(input), id, notify: structuredClone(options.notify ?? { enabled: false, recipients: [] }), status: 'active', createdAt: now(), updatedAt: now() };
|
|
40
|
+
definitions.push(created);
|
|
41
|
+
return structuredClone(created);
|
|
42
|
+
},
|
|
43
|
+
async updateFormDefinition({ id }, patch = {}) {
|
|
44
|
+
const current = definitions.find(form => form.id === id) ?? missing(id);
|
|
45
|
+
const incomingIds = patch.fields ? new Set(patch.fields.map(field => field.id)) : null;
|
|
46
|
+
if (incomingIds && current.fields.some(field => !incomingIds.has(field.id))) {
|
|
47
|
+
throw new AdminApiError({ message: 'existing form fields cannot be removed', status: 400 }, { code: 'FORMS_FIELD_VALIDATION_ERROR' });
|
|
48
|
+
}
|
|
49
|
+
// The contract excludes slug; runtime callers cannot smuggle it through a cast either.
|
|
50
|
+
const { name, fields, notify, status, mode, html } = patch;
|
|
51
|
+
const applied = { ...(name !== undefined ? { name } : {}), ...(fields !== undefined ? { fields } : {}), ...(notify !== undefined ? { notify } : {}), ...(status !== undefined ? { status } : {}), ...(mode !== undefined ? { mode } : {}), ...(html !== undefined ? { html } : {}) };
|
|
52
|
+
const updated = { ...current, ...structuredClone(applied), updatedAt: now() };
|
|
53
|
+
definitions[definitions.indexOf(current)] = updated;
|
|
54
|
+
return structuredClone(updated);
|
|
55
|
+
},
|
|
56
|
+
// O(n log n) time/O(n) space over the fixture submissions; one filtered cursor page,
|
|
57
|
+
// no per-row I/O. This adapter is a disposable contract fixture, not a production store.
|
|
58
|
+
async listFormSubmissions({ formId }, { cursor, limit = 50 } = {}) {
|
|
59
|
+
const resolvedId = definitionId(formId);
|
|
60
|
+
const sorted = answers.filter(item => item.formDefinitionId === resolvedId && item.status !== 'trash').sort((a, b) => b.submittedAt.localeCompare(a.submittedAt) || b.id.localeCompare(a.id));
|
|
61
|
+
const start = cursor ? sorted.findIndex(item => item.id === cursor) + 1 : 0;
|
|
62
|
+
if (cursor && start === 0)
|
|
63
|
+
throw new AdminApiError({ message: 'invalid submissions cursor', status: 400 });
|
|
64
|
+
if (!Number.isInteger(limit) || limit < 1)
|
|
65
|
+
throw new AdminApiError({ message: 'invalid submissions limit', status: 400 });
|
|
66
|
+
const items = sorted.slice(start, start + limit);
|
|
67
|
+
return { items: structuredClone(items), nextCursor: start + limit < sorted.length ? items.at(-1).id : null };
|
|
68
|
+
},
|
|
69
|
+
async getFormSubmission({ formId, submissionId }, _optional = {}) { return structuredClone(findSubmission(formId, submissionId)); },
|
|
70
|
+
async deleteFormSubmission({ formId, submissionId }, _optional = {}) {
|
|
71
|
+
const found = findSubmission(formId, submissionId);
|
|
72
|
+
remove('form_submission', found.id);
|
|
73
|
+
},
|
|
74
|
+
trash: { async trash({ type, id }, _optional = {}) { remove(type, id); return { ok: true, version: null }; } },
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=memory.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AdminFormsPort } from '../../core/ports/forms.js';
|
|
2
|
+
export interface FormsConformanceResult {
|
|
3
|
+
readonly passed: number;
|
|
4
|
+
readonly failures: readonly string[];
|
|
5
|
+
}
|
|
6
|
+
/** Run on an isolated API: creates definitions and trashes seeded submissions.
|
|
7
|
+
* The host provides a disposable seed so conformance never touches an operator's live data. */
|
|
8
|
+
export declare function runFormsApiConformance({ api }: {
|
|
9
|
+
api: AdminFormsPort;
|
|
10
|
+
}, { slug, submission }?: {
|
|
11
|
+
slug?: string;
|
|
12
|
+
submission?: {
|
|
13
|
+
formId: string;
|
|
14
|
+
submissionId: string;
|
|
15
|
+
};
|
|
16
|
+
}): Promise<FormsConformanceResult>;
|
|
17
|
+
//# sourceMappingURL=forms-api.conformance.d.ts.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/** Run on an isolated API: creates definitions and trashes seeded submissions.
|
|
2
|
+
* The host provides a disposable seed so conformance never touches an operator's live data. */
|
|
3
|
+
export async function runFormsApiConformance({ api }, { slug = 'forms-conformance', submission } = {}) {
|
|
4
|
+
const failures = [];
|
|
5
|
+
let passed = 0;
|
|
6
|
+
const check = (name, accepted) => { if (accepted)
|
|
7
|
+
passed++;
|
|
8
|
+
else
|
|
9
|
+
failures.push(name); };
|
|
10
|
+
const field = { id: 'email', label: 'Email', type: 'email', required: true, className: 'wide', attributes: { 'aria-label': 'Email' } };
|
|
11
|
+
const created = await api.createFormDefinition({ name: 'Contact', slug, fields: [field] }, { notify: { enabled: true, recipients: ['owner@example.com'] } });
|
|
12
|
+
check('create returns requested definition', created.name === 'Contact' && created.slug === slug && created.status === 'active');
|
|
13
|
+
check('field attributes survive create', created.fields[0]?.className === 'wide' && created.fields[0]?.attributes?.['aria-label'] === 'Email');
|
|
14
|
+
check('list includes created definition', (await api.listFormDefinitions({})).some(form => form.id === created.id));
|
|
15
|
+
check('get returns created id', (await api.getFormDefinition({ id: created.id })).id === created.id);
|
|
16
|
+
const snapshot = await api.getFormDefinition({ id: created.id });
|
|
17
|
+
Object.assign(snapshot.fields[0], { label: 'Changed only in the read snapshot' });
|
|
18
|
+
check('read snapshots cannot mutate stored fields', (await api.getFormDefinition({ id: created.id })).fields[0]?.label === 'Email');
|
|
19
|
+
const updated = await api.updateFormDefinition({ id: created.id }, { name: 'Renamed', fields: [...created.fields, { id: 'message', label: 'Message', type: 'textarea', required: false }] });
|
|
20
|
+
check('name patch and added field persist', updated.name === 'Renamed' && updated.fields.length === 2);
|
|
21
|
+
check('untouched notify survives update', updated.notify.enabled && updated.notify.recipients[0] === 'owner@example.com');
|
|
22
|
+
let refused = false;
|
|
23
|
+
try {
|
|
24
|
+
await api.updateFormDefinition({ id: created.id }, { fields: [] });
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
refused = true;
|
|
28
|
+
}
|
|
29
|
+
check('existing fields cannot be removed', refused);
|
|
30
|
+
check('rejected removal leaves fields intact', (await api.getFormDefinition({ id: created.id })).fields.length === 2);
|
|
31
|
+
const disabled = await api.updateFormDefinition({ id: created.id }, { status: 'disabled' });
|
|
32
|
+
check('definition disable is reversible', disabled.status === 'disabled' && (await api.updateFormDefinition({ id: created.id }, { status: 'active' })).status === 'active');
|
|
33
|
+
const html = await api.updateFormDefinition({ id: created.id }, { mode: 'html', html: '<input name="email">' });
|
|
34
|
+
check('HTML authoring survives update', html.mode === 'html' && html.html === '<input name="email">');
|
|
35
|
+
check('builder switch is explicit', (await api.updateFormDefinition({ id: created.id }, { mode: 'builder' })).mode === 'builder');
|
|
36
|
+
check('empty submission page has null cursor', (await api.listFormSubmissions({ formId: created.id })).nextCursor === null);
|
|
37
|
+
check('definition has no delete operation', !('deleteFormDefinition' in api));
|
|
38
|
+
if (submission) {
|
|
39
|
+
const page = await api.listFormSubmissions({ formId: submission.formId }, { limit: 1 });
|
|
40
|
+
check('submission page is form scoped', page.items.every(item => item.formDefinitionId === submission.formId));
|
|
41
|
+
check('submission detail is scoped', (await api.getFormSubmission(submission)).formDefinitionId === submission.formId);
|
|
42
|
+
let wrongFormRejected = false;
|
|
43
|
+
try {
|
|
44
|
+
await api.getFormSubmission({ formId: created.id, submissionId: submission.submissionId });
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
wrongFormRejected = true;
|
|
48
|
+
}
|
|
49
|
+
check('a submission of another form is unavailable', wrongFormRejected);
|
|
50
|
+
let wrongFormDeleteRejected = false;
|
|
51
|
+
try {
|
|
52
|
+
await api.deleteFormSubmission({ formId: created.id, submissionId: submission.submissionId });
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
wrongFormDeleteRejected = true;
|
|
56
|
+
}
|
|
57
|
+
check('cross-form trash is rejected without removing the submission', wrongFormDeleteRejected && (await api.getFormSubmission(submission)).id === submission.submissionId);
|
|
58
|
+
await api.deleteFormSubmission(submission);
|
|
59
|
+
let missing = false;
|
|
60
|
+
try {
|
|
61
|
+
await api.getFormSubmission(submission);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
missing = true;
|
|
65
|
+
}
|
|
66
|
+
check('trashed submission detail is unavailable', missing);
|
|
67
|
+
check('trashed submission is absent from active pages', !(await api.listFormSubmissions({ formId: submission.formId })).items.some(item => item.id === submission.submissionId));
|
|
68
|
+
}
|
|
69
|
+
return { passed, failures };
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=forms-api.conformance.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Section controllers share only the typed draft-update mechanism, not domain decisions. */
|
|
2
|
+
export declare function createFormsDraftStore<S extends object>({ initial }: {
|
|
3
|
+
initial: S;
|
|
4
|
+
}, _optional?: {}): {
|
|
5
|
+
getSnapshot: () => Readonly<S>;
|
|
6
|
+
subscribe: ({ listener }: {
|
|
7
|
+
listener: () => void;
|
|
8
|
+
}) => () => void;
|
|
9
|
+
dispose: () => void;
|
|
10
|
+
update<K extends keyof S>({ key, value }: {
|
|
11
|
+
key: K;
|
|
12
|
+
value: S[K] | ((current: S[K]) => S[K]);
|
|
13
|
+
}, _options?: {}): void;
|
|
14
|
+
patch({ patch }: {
|
|
15
|
+
patch: Partial<S>;
|
|
16
|
+
}, _options?: {}): void;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=draft-store.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createControllerStore } from '../../core/module/controller-store.js';
|
|
2
|
+
/** Section controllers share only the typed draft-update mechanism, not domain decisions. */
|
|
3
|
+
export function createFormsDraftStore({ initial }, _optional = {}) {
|
|
4
|
+
const store = createControllerStore({ initial });
|
|
5
|
+
return {
|
|
6
|
+
getSnapshot: store.getSnapshot, subscribe: store.subscribe, dispose: store.dispose,
|
|
7
|
+
update({ key, value }, _options = {}) {
|
|
8
|
+
const current = store.getSnapshot()[key];
|
|
9
|
+
const next = typeof value === 'function' ? value(current) : value;
|
|
10
|
+
const patch = {};
|
|
11
|
+
patch[key] = next;
|
|
12
|
+
store.set({ patch });
|
|
13
|
+
},
|
|
14
|
+
patch({ patch }, _options = {}) { store.set({ patch }); },
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=draft-store.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { AdminFormField } from "../models.js";
|
|
2
|
+
import { type AttrRow } from "../rules.js";
|
|
3
|
+
export interface FieldAttributesDialogState {
|
|
4
|
+
className: string;
|
|
5
|
+
rows: AttrRow[];
|
|
6
|
+
error: string | null;
|
|
7
|
+
}
|
|
8
|
+
export declare function initialFieldAttributesDialogState({ field }: {
|
|
9
|
+
field: AdminFormField;
|
|
10
|
+
}, _optional?: {}): FieldAttributesDialogState;
|
|
11
|
+
/** A headless section store. React owns subscriptions/effects, never this state. */
|
|
12
|
+
export declare function createFieldAttributesDialogController({ field }: {
|
|
13
|
+
field: AdminFormField;
|
|
14
|
+
}, _optional?: {}): {
|
|
15
|
+
updateRow({ rowId, patch }: {
|
|
16
|
+
rowId: number;
|
|
17
|
+
patch: Partial<AttrRow>;
|
|
18
|
+
}, _options?: {}): void;
|
|
19
|
+
removeRow({ rowId }: {
|
|
20
|
+
rowId: number;
|
|
21
|
+
}, _options?: {}): void;
|
|
22
|
+
addRow(_required: Record<string, never>, _options?: {}): void;
|
|
23
|
+
submit(_required: Record<string, never>, _options?: {}): import("../rules.js").FieldAttributesSubmitResult;
|
|
24
|
+
getSnapshot: () => Readonly<FieldAttributesDialogState>;
|
|
25
|
+
subscribe: ({ listener }: {
|
|
26
|
+
listener: () => void;
|
|
27
|
+
}) => () => void;
|
|
28
|
+
dispose: () => void;
|
|
29
|
+
update<K extends keyof FieldAttributesDialogState>({ key, value }: {
|
|
30
|
+
key: K;
|
|
31
|
+
value: FieldAttributesDialogState[K] | ((current: FieldAttributesDialogState[K]) => FieldAttributesDialogState[K]);
|
|
32
|
+
}, _options?: {}): void;
|
|
33
|
+
patch({ patch }: {
|
|
34
|
+
patch: Partial<FieldAttributesDialogState>;
|
|
35
|
+
}, _options?: {}): void;
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=field-attributes-dialog.controller.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createFormsDraftStore } from "./draft-store.js";
|
|
2
|
+
import { attrRowsFromField, updateAttrRow, removeAttrRow, addAttrRow, buildFieldAttributesPatch } from "../rules.js";
|
|
3
|
+
export function initialFieldAttributesDialogState({ field }, _optional = {}) {
|
|
4
|
+
return { className: field.className ?? "", rows: attrRowsFromField({ field }), error: null };
|
|
5
|
+
}
|
|
6
|
+
/** A headless section store. React owns subscriptions/effects, never this state. */
|
|
7
|
+
export function createFieldAttributesDialogController({ field }, _optional = {}) {
|
|
8
|
+
const store = createFormsDraftStore({ initial: initialFieldAttributesDialogState({ field }) });
|
|
9
|
+
return {
|
|
10
|
+
...store,
|
|
11
|
+
updateRow({ rowId, patch }, _options = {}) {
|
|
12
|
+
store.update({ key: 'rows', value: rows => updateAttrRow({ rows, rowId, patch }) });
|
|
13
|
+
},
|
|
14
|
+
removeRow({ rowId }, _options = {}) {
|
|
15
|
+
store.update({ key: 'rows', value: rows => removeAttrRow({ rows, rowId }) });
|
|
16
|
+
},
|
|
17
|
+
addRow(_required, _options = {}) {
|
|
18
|
+
store.update({ key: 'rows', value: rows => addAttrRow({ rows }) });
|
|
19
|
+
},
|
|
20
|
+
submit(_required, _options = {}) {
|
|
21
|
+
const result = buildFieldAttributesPatch(store.getSnapshot());
|
|
22
|
+
store.update({ key: 'error', value: result.ok ? null : result.error });
|
|
23
|
+
return result;
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=field-attributes-dialog.controller.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { AdminFormDefinition, AdminFormField, AdminFormNotify } from "../models.js";
|
|
2
|
+
export interface FormEditorState {
|
|
3
|
+
form: AdminFormDefinition | null;
|
|
4
|
+
mode: "builder" | "html";
|
|
5
|
+
html: string;
|
|
6
|
+
copyFeedback: string | null;
|
|
7
|
+
name: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
fields: AdminFormField[];
|
|
10
|
+
notify: AdminFormNotify;
|
|
11
|
+
}
|
|
12
|
+
export declare function initialFormEditorState(_required: Record<string, never>, _optional?: {}): FormEditorState;
|
|
13
|
+
/** A headless section store. React owns subscriptions/effects, never this state. */
|
|
14
|
+
export declare function createFormEditorController(_required: Record<string, never>, _optional?: {}): {
|
|
15
|
+
seed({ form }: {
|
|
16
|
+
form: AdminFormDefinition;
|
|
17
|
+
}, _options?: {}): void;
|
|
18
|
+
changeMode({ mode }: {
|
|
19
|
+
mode: "builder" | "html";
|
|
20
|
+
}, { submitLabel }?: {
|
|
21
|
+
submitLabel?: string;
|
|
22
|
+
}): void;
|
|
23
|
+
getSnapshot: () => Readonly<FormEditorState>;
|
|
24
|
+
subscribe: ({ listener }: {
|
|
25
|
+
listener: () => void;
|
|
26
|
+
}) => () => void;
|
|
27
|
+
dispose: () => void;
|
|
28
|
+
update<K extends keyof FormEditorState>({ key, value }: {
|
|
29
|
+
key: K;
|
|
30
|
+
value: FormEditorState[K] | ((current: FormEditorState[K]) => FormEditorState[K]);
|
|
31
|
+
}, _options?: {}): void;
|
|
32
|
+
patch({ patch }: {
|
|
33
|
+
patch: Partial<FormEditorState>;
|
|
34
|
+
}, _options?: {}): void;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=form-editor.controller.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createFormsDraftStore } from "./draft-store.js";
|
|
2
|
+
import { blankField } from "../rules.js";
|
|
3
|
+
import { formHtmlStarter } from "../html-rules.js";
|
|
4
|
+
export function initialFormEditorState(_required, _optional = {}) {
|
|
5
|
+
return { form: null, mode: "builder", html: "", copyFeedback: null, name: "", slug: "", fields: [blankField()], notify: { enabled: false, recipients: [] } };
|
|
6
|
+
}
|
|
7
|
+
/** A headless section store. React owns subscriptions/effects, never this state. */
|
|
8
|
+
export function createFormEditorController(_required, _optional = {}) {
|
|
9
|
+
const store = createFormsDraftStore({ initial: initialFormEditorState({}) });
|
|
10
|
+
return {
|
|
11
|
+
...store,
|
|
12
|
+
seed({ form }, _options = {}) {
|
|
13
|
+
store.patch({ patch: { form, name: form.name, slug: form.slug, fields: form.fields, mode: form.mode ?? 'builder', html: form.html ?? '', notify: form.notify } });
|
|
14
|
+
},
|
|
15
|
+
changeMode({ mode }, { submitLabel = 'Send' } = {}) {
|
|
16
|
+
const state = store.getSnapshot();
|
|
17
|
+
const html = mode === 'html' && !state.html ? formHtmlStarter({ fields: state.fields }, { submitLabel }) : state.html;
|
|
18
|
+
store.patch({ patch: { mode, html } });
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=form-editor.controller.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface FormFieldsEditorState {
|
|
2
|
+
editingAttrsIndex: number | null;
|
|
3
|
+
}
|
|
4
|
+
export declare function initialFormFieldsEditorState(_required: Record<string, never>, _optional?: {}): FormFieldsEditorState;
|
|
5
|
+
/** A headless section store. React owns subscriptions/effects, never this state. */
|
|
6
|
+
export declare function createFormFieldsEditorController(_required: Record<string, never>, _optional?: {}): {
|
|
7
|
+
getSnapshot: () => Readonly<FormFieldsEditorState>;
|
|
8
|
+
subscribe: ({ listener }: {
|
|
9
|
+
listener: () => void;
|
|
10
|
+
}) => () => void;
|
|
11
|
+
dispose: () => void;
|
|
12
|
+
update<K extends "editingAttrsIndex">({ key, value }: {
|
|
13
|
+
key: K;
|
|
14
|
+
value: FormFieldsEditorState[K] | ((current: FormFieldsEditorState[K]) => FormFieldsEditorState[K]);
|
|
15
|
+
}, _options?: {}): void;
|
|
16
|
+
patch({ patch }: {
|
|
17
|
+
patch: Partial<FormFieldsEditorState>;
|
|
18
|
+
}, _options?: {}): void;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=form-fields-editor.controller.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createFormsDraftStore } from "./draft-store.js";
|
|
2
|
+
export function initialFormFieldsEditorState(_required, _optional = {}) {
|
|
3
|
+
return { editingAttrsIndex: null };
|
|
4
|
+
}
|
|
5
|
+
/** A headless section store. React owns subscriptions/effects, never this state. */
|
|
6
|
+
export function createFormFieldsEditorController(_required, _optional = {}) {
|
|
7
|
+
const store = createFormsDraftStore({ initial: initialFormFieldsEditorState({}) });
|
|
8
|
+
return store;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=form-fields-editor.controller.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface FormSubmissionDetailState {
|
|
2
|
+
confirmOpen: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function initialFormSubmissionDetailState(_required: Record<string, never>, _optional?: {}): FormSubmissionDetailState;
|
|
5
|
+
/** A headless section store. React owns subscriptions/effects, never this state. */
|
|
6
|
+
export declare function createFormSubmissionDetailController(_required: Record<string, never>, _optional?: {}): {
|
|
7
|
+
getSnapshot: () => Readonly<FormSubmissionDetailState>;
|
|
8
|
+
subscribe: ({ listener }: {
|
|
9
|
+
listener: () => void;
|
|
10
|
+
}) => () => void;
|
|
11
|
+
dispose: () => void;
|
|
12
|
+
update<K extends "confirmOpen">({ key, value }: {
|
|
13
|
+
key: K;
|
|
14
|
+
value: FormSubmissionDetailState[K] | ((current: FormSubmissionDetailState[K]) => FormSubmissionDetailState[K]);
|
|
15
|
+
}, _options?: {}): void;
|
|
16
|
+
patch({ patch }: {
|
|
17
|
+
patch: Partial<FormSubmissionDetailState>;
|
|
18
|
+
}, _options?: {}): void;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=form-submission-detail.controller.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createFormsDraftStore } from "./draft-store.js";
|
|
2
|
+
export function initialFormSubmissionDetailState(_required, _optional = {}) {
|
|
3
|
+
return { confirmOpen: false };
|
|
4
|
+
}
|
|
5
|
+
/** A headless section store. React owns subscriptions/effects, never this state. */
|
|
6
|
+
export function createFormSubmissionDetailController(_required, _optional = {}) {
|
|
7
|
+
const store = createFormsDraftStore({ initial: initialFormSubmissionDetailState({}) });
|
|
8
|
+
return store;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=form-submission-detail.controller.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AdminFormSubmission } from "../models.js";
|
|
2
|
+
export interface FormSubmissionsState {
|
|
3
|
+
morePages: AdminFormSubmission[];
|
|
4
|
+
moreCursor: string | null;
|
|
5
|
+
moreError: string | null;
|
|
6
|
+
selectedId: string | null;
|
|
7
|
+
loadingMore: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function initialFormSubmissionsState(_required: Record<string, never>, _optional?: {}): FormSubmissionsState;
|
|
10
|
+
/** A headless section store. React owns subscriptions/effects, never this state. */
|
|
11
|
+
export declare function createFormSubmissionsController(_required: Record<string, never>, _optional?: {}): {
|
|
12
|
+
getSnapshot: () => Readonly<FormSubmissionsState>;
|
|
13
|
+
subscribe: ({ listener }: {
|
|
14
|
+
listener: () => void;
|
|
15
|
+
}) => () => void;
|
|
16
|
+
dispose: () => void;
|
|
17
|
+
update<K extends keyof FormSubmissionsState>({ key, value }: {
|
|
18
|
+
key: K;
|
|
19
|
+
value: FormSubmissionsState[K] | ((current: FormSubmissionsState[K]) => FormSubmissionsState[K]);
|
|
20
|
+
}, _options?: {}): void;
|
|
21
|
+
patch({ patch }: {
|
|
22
|
+
patch: Partial<FormSubmissionsState>;
|
|
23
|
+
}, _options?: {}): void;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=form-submissions.controller.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createFormsDraftStore } from "./draft-store.js";
|
|
2
|
+
export function initialFormSubmissionsState(_required, _optional = {}) {
|
|
3
|
+
return { morePages: [], moreCursor: null, moreError: null, selectedId: null, loadingMore: false };
|
|
4
|
+
}
|
|
5
|
+
/** A headless section store. React owns subscriptions/effects, never this state. */
|
|
6
|
+
export function createFormSubmissionsController(_required, _optional = {}) {
|
|
7
|
+
const store = createFormsDraftStore({ initial: initialFormSubmissionsState({}) });
|
|
8
|
+
return store;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=form-submissions.controller.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AdminFormDefinition } from "../models.js";
|
|
2
|
+
export interface FormsListState {
|
|
3
|
+
rowSavingId: string | null;
|
|
4
|
+
pendingDelete: AdminFormDefinition | null;
|
|
5
|
+
}
|
|
6
|
+
export declare function initialFormsListState(_required: Record<string, never>, _optional?: {}): FormsListState;
|
|
7
|
+
/** A headless section store. React owns subscriptions/effects, never this state. */
|
|
8
|
+
export declare function createFormsListController(_required: Record<string, never>, _optional?: {}): {
|
|
9
|
+
getSnapshot: () => Readonly<FormsListState>;
|
|
10
|
+
subscribe: ({ listener }: {
|
|
11
|
+
listener: () => void;
|
|
12
|
+
}) => () => void;
|
|
13
|
+
dispose: () => void;
|
|
14
|
+
update<K extends keyof FormsListState>({ key, value }: {
|
|
15
|
+
key: K;
|
|
16
|
+
value: FormsListState[K] | ((current: FormsListState[K]) => FormsListState[K]);
|
|
17
|
+
}, _options?: {}): void;
|
|
18
|
+
patch({ patch }: {
|
|
19
|
+
patch: Partial<FormsListState>;
|
|
20
|
+
}, _options?: {}): void;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=forms-list.controller.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createFormsDraftStore } from "./draft-store.js";
|
|
2
|
+
export function initialFormsListState(_required, _optional = {}) {
|
|
3
|
+
return { rowSavingId: null, pendingDelete: null };
|
|
4
|
+
}
|
|
5
|
+
/** A headless section store. React owns subscriptions/effects, never this state. */
|
|
6
|
+
export function createFormsListController(_required, _optional = {}) {
|
|
7
|
+
const store = createFormsDraftStore({ initial: initialFormsListState({}) });
|
|
8
|
+
return store;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=forms-list.controller.js.map
|