@jini-ai/admin 0.4.2 → 0.4.3
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 +11 -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 +137 -0
- package/dist/forms/forms.module.js +17 -0
- package/dist/forms/html-rules.d.ts +20 -0
- package/dist/forms/html-rules.js +24 -0
- package/dist/forms/index.d.ts +14 -0
- package/dist/forms/index.js +12 -0
- package/dist/forms/messages.en.d.ts +100 -0
- package/dist/forms/messages.en.js +104 -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 +13 -0
- package/dist/forms/react/components/FormSubmissionDetail.js +29 -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 +122 -0
- package/dist/forms/react/hooks/forms-view.hooks.js +79 -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 +449 -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 +55 -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/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 +56 -0
- package/dist/redirects/messages.en.js +55 -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 +316 -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 +75 -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 +78 -0
- package/dist/seo/messages.en.js +78 -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 +36 -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 +70 -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 +22 -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 +366 -0
- package/dist/seo/react/index.js +30 -0
- package/dist/seo/react/options.d.ts +19 -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 +136 -0
- package/dist/seo/rules.js +212 -0
- package/dist/seo/seo.module.d.ts +114 -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,55 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { ConfirmDialog } from '../../../react/components/ConfirmDialog/ConfirmDialog.js';
|
|
3
|
+
import { DataTable } from '../../../react/components/DataTable.js';
|
|
4
|
+
import { RowMenu } from '../../../react/components/RowMenu/RowMenu.js';
|
|
5
|
+
import { agentHandle } from '@jini-ai/agentic';
|
|
6
|
+
import { useWiredFormsList } from '../hooks/use-forms-list.hooks.js';
|
|
7
|
+
import { useFormsListView } from '../hooks/forms-view.hooks.js';
|
|
8
|
+
export function FormsList({ useFormsListHook = useWiredFormsList } = {}, _optional = {}) {
|
|
9
|
+
const { forms, formatFormDates, error, rowSavingId, toggleStatus, pendingDelete, setPendingDelete, removeForm, t } = useFormsListHook();
|
|
10
|
+
const { rows, cancelDelete, RecipientLabel, headerActions } = useFormsListView({ forms, t, formatFormDates, toggleStatus, setPendingDelete });
|
|
11
|
+
if (error && !forms)
|
|
12
|
+
return _jsx("div", { className: "notice error", children: error });
|
|
13
|
+
if (!forms)
|
|
14
|
+
return _jsx("div", { className: "notice", children: t("Loading forms…") });
|
|
15
|
+
// Form ids are stable and unique, so they disambiguate one row's edit link from another's —
|
|
16
|
+
// same reasoning as every other list on this workstream. Each row's "Actions" menu (Edit/Disable/
|
|
17
|
+
// Enable via `RowMenu`) shares this same per-row base (`${form.rowHandle}-menu`) now that
|
|
18
|
+
// `RowMenu` (`@jini-ai/admin/react`) accepts an `agentHandle` prop — before this session it
|
|
19
|
+
// published none, so its trigger and dropdown items were invisible to `page.find_elements`
|
|
20
|
+
// regardless of what this file did. The Disable/Enable action also stays reachable another way:
|
|
21
|
+
// `FormEditor.tsx`'s own status toggle (`form-editor-status-toggle`) does the identical
|
|
22
|
+
// `api.updateForm({ status })` call.
|
|
23
|
+
return (_jsxs("div", { className: "page", children: [_jsxs("div", { className: "page-header", ...agentHandle({ handle: "forms-header" }, { role: "region", label: "Forms list header — page title and the New form button" }), children: [_jsxs("div", { className: "page-header-text", children: [_jsx("p", { className: "page-kicker", children: t("Content") }), _jsx("h1", { className: "page-title", children: t("Forms") }), _jsx("p", { className: "page-description", children: t("Manage the forms embedded across the site and their submissions.") })] }), _jsxs("div", { className: "page-actions", children: [headerActions, _jsx("a", { className: "btn-primary", href: "/admin/forms/new", ...agentHandle({ handle: "forms-new" }, { role: "link", label: "Create a new form" }), children: t("New form") })] })] }), error ? _jsx("div", { className: "notice error", children: error }) : null, _jsx(DataTable, { rows: rows, rowKey: (form) => form.id, empty: _jsx("div", { className: "card", children: _jsxs("div", { className: "empty-state", children: [_jsx("p", { children: t("No forms yet.") }), _jsx("p", { className: "page-description", children: t("Create your first form to start collecting submissions.") })] }) }), columns: [
|
|
24
|
+
{
|
|
25
|
+
key: "name",
|
|
26
|
+
header: t("Name"),
|
|
27
|
+
cell: (form, index) => (_jsx("a", { href: `/admin/forms/${form.slug}`, ...agentHandle({ handle: `${form.rowHandle}-edit` }, {
|
|
28
|
+
role: "link",
|
|
29
|
+
label: "Open this form's editor",
|
|
30
|
+
}), children: form.name })),
|
|
31
|
+
},
|
|
32
|
+
{ key: "slug", header: t("Slug"), cell: (form) => form.slug },
|
|
33
|
+
{
|
|
34
|
+
key: "dates",
|
|
35
|
+
header: t("Created / Updated"),
|
|
36
|
+
// One `<time>` per line (created, then updated — or one line when never edited). The
|
|
37
|
+
// visible text is the bare short date; the event word lives in the hover title and the
|
|
38
|
+
// screen-reader text only, since the header already names both events.
|
|
39
|
+
cell: (form) => (_jsx("span", { className: "forms-dates", children: form.dates.map((line) => (_jsxs("time", { className: "forms-dates-line", dateTime: line.dateTime, title: line.label, children: [_jsx("span", { "aria-hidden": "true", children: line.text }), _jsx("span", { className: "visually-hidden", children: line.label })] }, line.kind))) })),
|
|
40
|
+
},
|
|
41
|
+
{ key: "fields", header: t("Fields"), cell: (form) => form.fields.length },
|
|
42
|
+
{
|
|
43
|
+
key: "notify",
|
|
44
|
+
header: t("Notify"),
|
|
45
|
+
cell: (form) => (form.notify.enabled ? _jsxs(_Fragment, { children: [form.notify.recipients.length, " ", _jsx(RecipientLabel, { count: form.notify.recipients.length })] }) : t("off")),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
key: "actions",
|
|
49
|
+
header: t("More"),
|
|
50
|
+
cell: (form, index) => (_jsx(RowMenu, { triggerLabel: form.menuLabel, agentHandle: `${form.rowHandle}-menu`, items: form.menuItems })),
|
|
51
|
+
},
|
|
52
|
+
] }), _jsx(ConfirmDialog, { open: pendingDelete !== null, agentHandle: "forms-delete", title: t("Move to trash?"), body: pendingDelete ? (_jsxs("p", { children: [t("Move"), " \"", pendingDelete.name, "\" ", t("to trash? It will disappear from the site and from this list.")] })) : null, confirmLabel: t("Move to trash"), destructive: true, pending: pendingDelete !== null && rowSavingId === pendingDelete.id, onConfirm: removeForm, onCancel: cancelDelete })] }));
|
|
53
|
+
}
|
|
54
|
+
export default FormsList;
|
|
55
|
+
//# sourceMappingURL=FormsList.js.map
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import type { RowMenuItem } from "../react/components/RowMenu/RowMenu.js";
|
|
2
|
+
import type { AdminFormDefinition, AdminFormField } from "./models.js";
|
|
3
|
+
import type { QueryKey } from "@jini-ai/ui/fetch-query";
|
|
4
|
+
/**
|
|
5
|
+
* @file Pure logic for the `forms` feature (`FormEditor.tsx` — see `FormsList.tsx`'s own
|
|
6
|
+
* `rules.ts`/hook for the list screen's extraction) — everything that computes a value rather than
|
|
7
|
+
* rendering one. Follows the convention `features/posts/rules.ts` establishes: no React, no
|
|
8
|
+
* hooks, importable and directly testable.
|
|
9
|
+
*
|
|
10
|
+
* One deliberate exception to "pure", same as `collections/rules.ts`'s `nextRowId`:
|
|
11
|
+
* {@link nextAttrRowId} is a module-level counter `attrRowsFromField`/`addAttrRow` advance. Only
|
|
12
|
+
* `FieldAttributesDialog` (via `use-field-attributes-dialog.hooks.ts`) consumes it today, so it
|
|
13
|
+
* would be equally correct sitting in that hook file — kept here instead for the same reason
|
|
14
|
+
* `collections/rules.ts` keeps its row-id counter alongside its other draft-list transforms: one
|
|
15
|
+
* place for "how draft rows get local keys" per feature, not split by which hook happens to use it
|
|
16
|
+
* first.
|
|
17
|
+
*
|
|
18
|
+
* `KEYS` (fetch-query migration, 2026-08-12): forms and form-submissions are two independent
|
|
19
|
+
* resources (separate ports, no method overlap — see `core/ports/forms.ts`/`form-submissions-
|
|
20
|
+
* port.hooks.ts`'s own doc comments), so they get two entirely separate top-level key namespaces
|
|
21
|
+
* rather than sharing one grandparent. Within each, `list`/`detail(id)` (and `submissionsList(formId)`/
|
|
22
|
+
* `submissionDetail(formId, id)`) are SIBLINGS, not parent/child — `@jini-ai/ui/fetch-query`'s
|
|
23
|
+
* `QueryKey` doc warns that invalidation matches by prefix, and `collections/rules.ts`'s own `KEYS`
|
|
24
|
+
* doc records the regression that bit the predecessor when a detail key nested under its list: every
|
|
25
|
+
* save silently fired 3 extra background requests because invalidating the list also invalidated the
|
|
26
|
+
* editor's own currently-open read. Fixed second-array-element ("list" vs "detail") rather than
|
|
27
|
+
* nesting keeps `KEYS.list`'s invalidation from ever touching an open `KEYS.form(id)`/
|
|
28
|
+
* `KEYS.submissionDetail(...)` read, regardless of what `id` happens to be.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* This screen's name on `lib/content-refresh-bus.ts` — see `taxonomy/rules.ts`'s `TAXONOMY_RESOURCE`
|
|
32
|
+
* for why this is a plain colocated constant rather than a shared registry. `forms_create_definition`/
|
|
33
|
+
* `forms_update_definition`/`forms_set_definition_status` (`apps/website/src/features/forms/agent-
|
|
34
|
+
* tools.ts`) are agent-callable, so `FormsList.tsx` needs the same "an assistant write shows up
|
|
35
|
+
* without a reload" fix `use-taxonomy.hooks.ts` shipped first.
|
|
36
|
+
*/
|
|
37
|
+
export declare const FORMS_LIST_RESOURCE = "forms";
|
|
38
|
+
/** The list has no sort control: recently edited forms belong first. Copy before sorting so
|
|
39
|
+
* the query cache and injected repository keep their own order; ties retain response order. */
|
|
40
|
+
export declare function newestUpdatedForms({ forms }: {
|
|
41
|
+
forms: readonly AdminFormDefinition[];
|
|
42
|
+
}, _optional?: Record<string, never>): AdminFormDefinition[];
|
|
43
|
+
/** One line of the Forms list's "Created / Updated" cell. */
|
|
44
|
+
export interface FormDateLine {
|
|
45
|
+
/** Which event the line shows; `"both"` when the form was never edited after creation. */
|
|
46
|
+
kind: "created" | "updated" | "both";
|
|
47
|
+
/** Compact locale date + time (`dateStyle`/`timeStyle` "short"), or "—" for an unparseable date. */
|
|
48
|
+
text: string;
|
|
49
|
+
/** ISO instant for `<time dateTime>`; `undefined` when the stored text does not parse. */
|
|
50
|
+
dateTime: string | undefined;
|
|
51
|
+
/** Translated event word(s) plus the full date — the hover title and screen-reader text, since
|
|
52
|
+
* the visible line carries no "Created"/"Updated" word (the column header already says it). */
|
|
53
|
+
label: string;
|
|
54
|
+
}
|
|
55
|
+
/** One form event's compact local date and full tooltip. Shared by definitions and submissions;
|
|
56
|
+
* malformed legacy values stay visible as a dash rather than throwing during table rendering. */
|
|
57
|
+
export declare function formDateDisplay({ iso, locale }: {
|
|
58
|
+
iso: string;
|
|
59
|
+
locale: string;
|
|
60
|
+
}, { timeZone }?: {
|
|
61
|
+
timeZone?: string;
|
|
62
|
+
}): {
|
|
63
|
+
text: string;
|
|
64
|
+
full: string;
|
|
65
|
+
dateTime: string | undefined;
|
|
66
|
+
};
|
|
67
|
+
/** Form-specific date copy. The shared admin timestamp helper intentionally slices ISO text
|
|
68
|
+
* and its relative helper is English-only; these two events need the operator's locale and
|
|
69
|
+
* browser time zone. Absolute dates remain accurate while the list stays open without a timer.
|
|
70
|
+
*
|
|
71
|
+
* Owner 2026-10-05: line 1 created, line 2 updated, each a compact short date + time with no event
|
|
72
|
+
* word; one line when updated shows the same date and minute as created. The comparison is on the
|
|
73
|
+
* displayed short text, so edits within the same minute collapse and the rule follows the locale's
|
|
74
|
+
* own precision. Intl picks the date order — never a hand-built "M/D/YY".
|
|
75
|
+
*
|
|
76
|
+
* @complexity O(1) time and space — two dates, fixed-size formatting.
|
|
77
|
+
*/
|
|
78
|
+
export declare function formDatesLines({ form, locale, t }: {
|
|
79
|
+
form: Pick<AdminFormDefinition, "createdAt" | "updatedAt">;
|
|
80
|
+
locale: string;
|
|
81
|
+
t: (key: string) => string;
|
|
82
|
+
}, options?: {
|
|
83
|
+
timeZone?: string;
|
|
84
|
+
}): FormDateLine[];
|
|
85
|
+
export declare const KEYS: {
|
|
86
|
+
list: QueryKey;
|
|
87
|
+
form: (id: string) => QueryKey;
|
|
88
|
+
submissionsList: (formId: string) => QueryKey;
|
|
89
|
+
submissionDetail: (formId: string, submissionId: string) => QueryKey;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* `useFormEditor`'s error banner, extracted out of that hook (`refactor/fetch-query` complexity
|
|
93
|
+
* pass, 2026-08-12 — same reason `collections/rules.ts`'s `visibleEntryEditorError` was extracted:
|
|
94
|
+
* the hook's own precedence chain over four sources pushed it past the complexity ceiling).
|
|
95
|
+
*
|
|
96
|
+
* Precedence: an active write's own failure (update/create/status, in that order — mirrors
|
|
97
|
+
* `redirects/rules.ts`'s `firstWriteError` array-order precedence, since `update`/`status` can both
|
|
98
|
+
* apply to the SAME loaded form) always wins. The list-load failure only surfaces before the form
|
|
99
|
+
* has ever loaded — once `hasForm` is true, a later BACKGROUND refresh failure must not blank an
|
|
100
|
+
* editor the operator is actively using (same "a later failure must not erase what already
|
|
101
|
+
* rendered" guard `FormEditor.tsx`'s own file header already documents at the render layer; this is
|
|
102
|
+
* its data-layer half).
|
|
103
|
+
*
|
|
104
|
+
* @complexity Time/space: O(1) — four fixed checks, no iteration.
|
|
105
|
+
*/
|
|
106
|
+
export declare function visibleFormEditorError(params: {
|
|
107
|
+
updateError: Error | null;
|
|
108
|
+
createError: Error | null;
|
|
109
|
+
statusError: Error | null;
|
|
110
|
+
listError: Error | null;
|
|
111
|
+
hasForm: boolean;
|
|
112
|
+
saveFallback: string;
|
|
113
|
+
statusUpdateFallback: string;
|
|
114
|
+
loadFormFallback: string;
|
|
115
|
+
}, _optional?: Record<string, never>): string | null;
|
|
116
|
+
/**
|
|
117
|
+
* `useFormsList`'s error banner: the row-toggle write's own failure outranks a background
|
|
118
|
+
* list-refresh failure, same precedence `redirects/rules.ts`'s `visibleRedirectsError` documents.
|
|
119
|
+
* Two sources only (not the three-plus that pushed `visibleFormEditorError`/`visibleTaxonomyError`
|
|
120
|
+
* out to `rules.ts`), kept here anyway rather than inlined so the hook body doesn't grow a nested
|
|
121
|
+
* ternary chain (`@jini-ai/ui/fetch-query`'s `resolveFetchQueryStatus` doc explains why a flat
|
|
122
|
+
* extraction beats a nested ternary of the same branch count for the complexity gate).
|
|
123
|
+
*
|
|
124
|
+
* @complexity Time/space: O(1) — two fixed checks, no iteration.
|
|
125
|
+
*/
|
|
126
|
+
export declare function formsListError(params: {
|
|
127
|
+
toggleError: Error | null;
|
|
128
|
+
deleteError: Error | null;
|
|
129
|
+
listError: Error | null;
|
|
130
|
+
hasForms: boolean;
|
|
131
|
+
deleteFallback: string;
|
|
132
|
+
statusUpdateFallback: string;
|
|
133
|
+
loadFormsFallback: string;
|
|
134
|
+
versionChangedMessage: string;
|
|
135
|
+
}, _optional?: Record<string, never>): string | null;
|
|
136
|
+
/**
|
|
137
|
+
* Classifies a failed `api.trash` call — shared by `useFormsList`'s `removeForm` (forms) and
|
|
138
|
+
* `useFormSubmissionDetail`'s `confirmDelete` (submissions), since both routes now go through the
|
|
139
|
+
* same generic `POST /trash/items` (`routes/trash/items.ts`) and its 404/409 contract:
|
|
140
|
+
*
|
|
141
|
+
* - 404 (`NOT_FOUND`/`FORMS_SUBMISSION_NOT_FOUND`/…): the row is already gone — another tab,
|
|
142
|
+
* another operator, or a prior click that actually succeeded before a flaky response read as a
|
|
143
|
+
* failure. `alreadyGone: true`, `message: null` — the caller's job is a quiet list refresh, not
|
|
144
|
+
* an error banner blaming the operator for something that already happened.
|
|
145
|
+
* - 409 `TRASH_VERSION_CHANGED`: the row changed under the operator since this screen last read
|
|
146
|
+
* it. Specific reload-and-retry copy, not the generic fallback.
|
|
147
|
+
* - Anything else (network failure, an unrelated `ApiError`, …): falls through to
|
|
148
|
+
* `describeApiError`'s generic fallback message.
|
|
149
|
+
*
|
|
150
|
+
* @complexity O(1) — one `instanceof` check plus two fixed comparisons.
|
|
151
|
+
*/
|
|
152
|
+
export declare function describeTrashError({ error: e, fallback, versionChangedMessage }: {
|
|
153
|
+
error: Error | null;
|
|
154
|
+
fallback: string;
|
|
155
|
+
versionChangedMessage: string;
|
|
156
|
+
}, _optional?: Record<string, never>): {
|
|
157
|
+
alreadyGone: boolean;
|
|
158
|
+
message: string | null;
|
|
159
|
+
};
|
|
160
|
+
/** The callbacks a form row menu needs. Passed in rather than imported so this module stays free
|
|
161
|
+
* of state, mirroring `redirects/rules.ts`'s `RedirectRowMenuHandlers`. `onDelete` opens the
|
|
162
|
+
* `ConfirmDialog` in `FormsList.tsx` — see that component's own render for why the actual
|
|
163
|
+
* `formsTrash.trash` call waits for the confirm, not this selection. */
|
|
164
|
+
export interface FormRowMenuHandlers {
|
|
165
|
+
onEdit: (form: AdminFormDefinition) => void;
|
|
166
|
+
onToggleStatus: (form: AdminFormDefinition) => void;
|
|
167
|
+
onDelete: (form: AdminFormDefinition) => void;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* The row-action menu for one form. `RowMenu` has no per-item `disabled` — the in-flight guard lives
|
|
171
|
+
* in `use-forms-list.hooks.ts`'s own `toggleStatus` (a no-op while `rowSavingId` is already set), the
|
|
172
|
+
* same shape `use-redirects.hooks.ts`'s `onToggleStatus` uses for its identical `if (saving) return;`
|
|
173
|
+
* guard. (CORRECTED 2026-09-05: this comment previously said the guard "stays in the caller's
|
|
174
|
+
* `onToggleStatus` closure (`FormsList.tsx`'s own `if (rowSavingId) return;`)" and claimed that was
|
|
175
|
+
* the same shape `Redirects.tsx` uses — false; `Redirects.tsx` never had such a guard inline, only its
|
|
176
|
+
* hook does. Flagged by the 2026-09-05 Gemini admin-tooling audit as a standing no-logic-in-`.tsx`
|
|
177
|
+
* violation; moving the guard into the hook also fixed the comment's own false precedent claim.)
|
|
178
|
+
*
|
|
179
|
+
* @complexity Time/space: O(1) — three fixed entries, no iteration.
|
|
180
|
+
*/
|
|
181
|
+
export declare function formRowMenuItems({ form, handlers, t }: {
|
|
182
|
+
form: AdminFormDefinition;
|
|
183
|
+
handlers: FormRowMenuHandlers;
|
|
184
|
+
t: (key: string) => string;
|
|
185
|
+
}, _optional?: Record<string, never>): RowMenuItem[];
|
|
186
|
+
export declare const FIELD_TYPES: readonly ["text", "email", "textarea", "checkbox"];
|
|
187
|
+
/** The two tab-panel views on an existing form's editor (`formId !== "new"`). */
|
|
188
|
+
export declare const FORM_TABS: readonly [{
|
|
189
|
+
readonly id: "fields";
|
|
190
|
+
readonly label: "Fields";
|
|
191
|
+
}, {
|
|
192
|
+
readonly id: "submissions";
|
|
193
|
+
readonly label: "Submissions";
|
|
194
|
+
}];
|
|
195
|
+
/**
|
|
196
|
+
* Roving-tabindex arrow-key step for the Fields/Submissions tablist — ArrowLeft/ArrowRight cycle
|
|
197
|
+
* between the two tabs, Home/End jump to the first/last.
|
|
198
|
+
*
|
|
199
|
+
* @complexity O(1) — `FORM_TABS` is a fixed 2-item array.
|
|
200
|
+
*/
|
|
201
|
+
export declare function nextTabIndex({ key, currentIndex }: {
|
|
202
|
+
key: string;
|
|
203
|
+
currentIndex: number;
|
|
204
|
+
}, _optional?: Record<string, never>): number | null;
|
|
205
|
+
export declare function blankField(_required?: Record<string, never>, _optional?: Record<string, never>): AdminFormField;
|
|
206
|
+
/** Shared "what do we call this field in a title/label" fallback — a blank draft field has neither
|
|
207
|
+
* a label nor an id yet, so both the kebab's `aria-label` and the modal's own `<h2>` need the same
|
|
208
|
+
* `label -> id -> "Field N"` chain rather than risking the two drifting apart. */
|
|
209
|
+
export declare function fieldDisplayName({ field, index }: {
|
|
210
|
+
field: AdminFormField;
|
|
211
|
+
index: number;
|
|
212
|
+
}, _optional?: Record<string, never>): string;
|
|
213
|
+
/** @complexity O(n) in `fields.length`. */
|
|
214
|
+
export declare function updateFormField({ fields, index, patch }: {
|
|
215
|
+
fields: AdminFormField[];
|
|
216
|
+
index: number;
|
|
217
|
+
patch: Partial<AdminFormField>;
|
|
218
|
+
}, _optional?: Record<string, never>): AdminFormField[];
|
|
219
|
+
/** @complexity O(n) in `fields.length`. */
|
|
220
|
+
export declare function addFormField({ fields }: {
|
|
221
|
+
fields: AdminFormField[];
|
|
222
|
+
}, _optional?: Record<string, never>): AdminFormField[];
|
|
223
|
+
/** @complexity O(n) in `fields.length`. */
|
|
224
|
+
export declare function removeFormField({ fields, index }: {
|
|
225
|
+
fields: AdminFormField[];
|
|
226
|
+
index: number;
|
|
227
|
+
}, _optional?: Record<string, never>): AdminFormField[];
|
|
228
|
+
/** The already-persisted field ids on a form — `FormFieldsEditor` disables the id input and the
|
|
229
|
+
* Remove button for these (a saved field's id cannot be changed or removed once created). `null`
|
|
230
|
+
* (form not loaded yet, or the "new form" case) has no existing ids. */
|
|
231
|
+
export declare function existingFieldIdsOf({ form }: {
|
|
232
|
+
form: AdminFormDefinition | null;
|
|
233
|
+
}, _optional?: Record<string, never>): string[];
|
|
234
|
+
/** Mirrors `forms.ts`'s `ATTRIBUTE_NAME_PATTERN` exactly — see `FormEditor.tsx`'s own header
|
|
235
|
+
* comment for why this is a fast-reject-only duplicate, not the authoritative check. Keep in sync
|
|
236
|
+
* by hand if the server allowlist changes. */
|
|
237
|
+
export declare const ATTRIBUTE_NAME_PATTERN: RegExp;
|
|
238
|
+
/** Same bounds as `forms.ts`'s `MAX_CLASS_NAME_LENGTH`/`MAX_ATTRIBUTES_PER_FIELD` — client-side
|
|
239
|
+
* early-reject only, not enforcement (see `ATTRIBUTE_NAME_PATTERN` above). */
|
|
240
|
+
export declare const MAX_CLASS_NAME_LENGTH = 300;
|
|
241
|
+
export declare const MAX_ATTRIBUTES_PER_FIELD = 12;
|
|
242
|
+
/** A handful of the allowlisted names as real, pickable suggestions (the modal's own "here's what
|
|
243
|
+
* you can do" surface — an operator has no other way to discover the allowlist) rather than every
|
|
244
|
+
* one: `aria-*`/`data-*` are open namespaces, so `aria-label`/`data-testid` stand in for the whole
|
|
245
|
+
* prefix family instead of listing every field-specific `aria-*` name that doesn't exist yet. */
|
|
246
|
+
export declare const ATTRIBUTE_NAME_SUGGESTIONS: string[];
|
|
247
|
+
export interface AttrRow {
|
|
248
|
+
_rowId: number;
|
|
249
|
+
name: string;
|
|
250
|
+
value: string;
|
|
251
|
+
}
|
|
252
|
+
export declare function attrRowsFromField({ field }: {
|
|
253
|
+
field: AdminFormField;
|
|
254
|
+
}, _optional?: Record<string, never>): AttrRow[];
|
|
255
|
+
/** @complexity O(n) in `rows.length`. */
|
|
256
|
+
export declare function updateAttrRow({ rows, rowId, patch }: {
|
|
257
|
+
rows: AttrRow[];
|
|
258
|
+
rowId: number;
|
|
259
|
+
patch: Partial<AttrRow>;
|
|
260
|
+
}, _optional?: Record<string, never>): AttrRow[];
|
|
261
|
+
/** @complexity O(n) in `rows.length`. */
|
|
262
|
+
export declare function removeAttrRow({ rows, rowId }: {
|
|
263
|
+
rows: AttrRow[];
|
|
264
|
+
rowId: number;
|
|
265
|
+
}, _optional?: Record<string, never>): AttrRow[];
|
|
266
|
+
/** @complexity O(n) in `rows.length`. */
|
|
267
|
+
export declare function addAttrRow({ rows }: {
|
|
268
|
+
rows: AttrRow[];
|
|
269
|
+
}, _optional?: Record<string, never>): AttrRow[];
|
|
270
|
+
export type FieldAttributesSubmitResult = {
|
|
271
|
+
ok: true;
|
|
272
|
+
patch: Partial<AdminFormField>;
|
|
273
|
+
} | {
|
|
274
|
+
ok: false;
|
|
275
|
+
error: string;
|
|
276
|
+
};
|
|
277
|
+
/**
|
|
278
|
+
* Validates + shapes `FieldAttributesDialog`'s draft into the `Partial<AdminFormField>` patch
|
|
279
|
+
* `onSave` applies: a class-name length cap, then every named attribute row against the allowlist
|
|
280
|
+
* (blank names are silently skipped — an empty trailing row is not an error), then a total-count
|
|
281
|
+
* cap on the surviving attributes. The security-relevant check is server-side (`forms.ts`'s
|
|
282
|
+
* `validateFieldDescriptors`); this is the fast, pre-save rejection only — see this feature's own
|
|
283
|
+
* `ATTRIBUTE_NAME_PATTERN` doc.
|
|
284
|
+
*
|
|
285
|
+
* @complexity O(n) in `rows.length`, short-circuiting on the first disallowed name.
|
|
286
|
+
*/
|
|
287
|
+
export declare function buildFieldAttributesPatch(draft: {
|
|
288
|
+
className: string;
|
|
289
|
+
rows: AttrRow[];
|
|
290
|
+
}, _optional?: Record<string, never>): FieldAttributesSubmitResult;
|
|
291
|
+
//# sourceMappingURL=rules.d.ts.map
|