@jini-ai/admin 0.7.2 → 0.7.3-next.2
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 +4 -4
- package/dist/agent-plugins/agent-plugins.module.d.ts +1 -1
- package/dist/agent-plugins/agent-plugins.module.js +1 -1
- package/dist/agent-plugins/controllers/agent-plugin-files.controller.d.ts +3 -3
- package/dist/agent-plugins/controllers/agent-plugin-files.controller.js +1 -1
- package/dist/agent-plugins/controllers/agent-plugins.controller.d.ts +3 -3
- package/dist/agent-plugins/controllers/agent-plugins.controller.js +30 -27
- package/dist/agent-plugins/index.d.ts +11 -8
- package/dist/agent-plugins/index.js +7 -8
- package/dist/agent-plugins/models.d.ts +19 -11
- package/dist/agent-plugins/ports.d.ts +1 -1
- package/dist/agent-plugins/ports.js +1 -1
- package/dist/agent-plugins/react/components/AgentPluginFileContent.d.ts +4 -2
- package/dist/agent-plugins/react/components/AgentPluginFileContent.js +3 -3
- package/dist/agent-plugins/react/components/AgentPluginFileTree.d.ts +4 -2
- package/dist/agent-plugins/react/components/AgentPluginFileTree.js +2 -2
- package/dist/agent-plugins/react/components/AgentPluginInspector.d.ts +4 -2
- package/dist/agent-plugins/react/components/AgentPluginInspector.js +3 -3
- package/dist/agent-plugins/react/components/AgentPluginListPanel.d.ts +5 -3
- package/dist/agent-plugins/react/components/AgentPluginListPanel.js +3 -3
- package/dist/agent-plugins/react/components/AgentPluginRow.d.ts +3 -1
- package/dist/agent-plugins/react/components/AgentPluginRow.js +3 -3
- package/dist/agent-plugins/react/hooks/AgentPluginInspector.hooks.js +2 -2
- package/dist/agent-plugins/react/hooks/AgentPluginPanel.hooks.d.ts +6 -5
- package/dist/agent-plugins/react/hooks/AgentPluginRow.hooks.d.ts +5 -4
- package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.d.ts +11 -7
- package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.js +3 -3
- package/dist/agent-plugins/react/hooks/AgentPluginsPorts.hooks.d.ts +5 -0
- package/dist/agent-plugins/react/hooks/AgentPluginsPorts.hooks.js +11 -1
- package/dist/agent-plugins/react/hooks/MarketplaceTab.hooks.d.ts +1 -1
- package/dist/agent-plugins/react/index.d.ts +25 -71
- package/dist/agent-plugins/react/index.js +9 -6
- package/dist/agent-plugins/react/pages/AgentPluginsPage.d.ts +8 -2
- package/dist/agent-plugins/react/pages/AgentPluginsPage.js +3 -3
- package/dist/agent-plugins/react/tabs/DownloadedTab.d.ts +2 -2
- package/dist/agent-plugins/react/tabs/DownloadedTab.js +1 -1
- package/dist/agent-plugins/react/tabs/InstalledTab.d.ts +2 -2
- package/dist/agent-plugins/react/tabs/InstalledTab.js +1 -1
- package/dist/agent-plugins/react/tabs/MarketplaceTab.d.ts +5 -2
- package/dist/agent-plugins/react/tabs/MarketplaceTab.js +3 -3
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.js +2 -0
- package/dist/browser/react-root-errors.d.ts +19 -0
- package/dist/browser/react-root-errors.js +16 -0
- package/dist/comments/adapters/http.js +2 -3
- package/dist/comments/adapters/memory.d.ts +5 -3
- package/dist/comments/adapters/memory.js +5 -6
- package/dist/comments/comments.module.d.ts +3 -3
- package/dist/comments/comments.module.js +1 -1
- package/dist/comments/controllers/comment-queue.controller.d.ts +14 -12
- package/dist/comments/controllers/comment-queue.controller.js +154 -155
- package/dist/comments/controllers/comment-settings.controller.d.ts +4 -4
- package/dist/comments/controllers/comment-settings.controller.js +40 -39
- package/dist/comments/controllers/comments.controller.d.ts +4 -4
- package/dist/comments/controllers/comments.controller.js +1 -2
- package/dist/comments/ports.d.ts +3 -3
- package/dist/comments/ports.js +1 -1
- package/dist/comments/react/components/QueueActionsCell.d.ts +20 -0
- package/dist/comments/react/components/QueueActionsCell.js +15 -0
- package/dist/comments/react/components/QueueSection.d.ts +20 -9
- package/dist/comments/react/components/QueueSection.js +9 -20
- package/dist/comments/react/components/SettingsFields.d.ts +13 -0
- package/dist/comments/react/components/SettingsFields.js +17 -0
- package/dist/comments/react/components/SettingsSection.d.ts +4 -1
- package/dist/comments/react/components/SettingsSection.js +5 -10
- package/dist/comments/react/hooks/CommentsPage.hooks.js +1 -1
- package/dist/comments/react/hooks/CommentsPorts.hooks.d.ts +5 -0
- package/dist/comments/react/hooks/CommentsPorts.hooks.js +11 -1
- package/dist/comments/react/hooks/QueueActionsCell.hooks.d.ts +13 -0
- package/dist/comments/react/hooks/QueueActionsCell.hooks.js +7 -0
- package/dist/comments/react/hooks/QueueSection.hooks.d.ts +3 -11
- package/dist/comments/react/hooks/QueueSection.hooks.js +8 -11
- package/dist/comments/react/hooks/use-comment-queue.hooks.js +4 -4
- package/dist/comments/react/hooks/use-comment-settings.hooks.js +3 -3
- package/dist/comments/react/hooks/use-comments.hooks.js +3 -3
- package/dist/comments/react/index.d.ts +27 -89
- package/dist/comments/react/index.js +5 -6
- package/dist/comments/react/pages/CommentsPage.d.ts +4 -1
- package/dist/comments/react/pages/CommentsPage.js +2 -2
- package/dist/comments/rules.d.ts +1 -1
- package/dist/comments/rules.js +2 -3
- package/dist/contracts/credential-management.d.ts +1 -1
- package/dist/contracts/credential-management.js +1 -1
- package/dist/contracts/media-picker.d.ts +1 -1
- package/dist/contracts/media-picker.js +1 -1
- package/dist/contracts/playground-render-target.d.ts +1 -1
- package/dist/contracts/playground-render-target.js +1 -1
- package/dist/core/entities/rules.d.ts +8 -2
- package/dist/core/entities/rules.js +3 -3
- package/dist/core/index.d.ts +1 -2
- package/dist/core/index.js +1 -3
- package/dist/core/ledger-slice.d.ts +3 -3
- package/dist/core/ledger-slice.js +3 -3
- package/dist/core/manifest/rules.js +1 -1
- package/dist/core/manifest/types.d.ts +11 -0
- package/dist/core/module/create-admin.d.ts +1 -8
- package/dist/core/module/create-admin.js +4 -9
- package/dist/core/module/index.d.ts +1 -5
- package/dist/core/module/index.js +1 -3
- package/dist/core/ports/auth.d.ts +2 -2
- package/dist/core/ports/auth.js +1 -1
- package/dist/core/ports/comment-repo.d.ts +53 -0
- package/dist/core/ports/comment-repo.js +2 -0
- package/dist/core/ports/comments.d.ts +1 -1
- package/dist/core/ports/comments.js +1 -1
- package/dist/core/ports/database.d.ts +1 -1
- package/dist/core/ports/embed-policy.d.ts +19 -0
- package/dist/core/ports/embed-policy.js +2 -0
- package/dist/core/ports/entities.d.ts +14 -0
- package/dist/core/ports/forms-catalog.d.ts +27 -0
- package/dist/core/ports/forms-catalog.js +2 -0
- package/dist/core/ports/forms.d.ts +3 -3
- package/dist/core/ports/identity.d.ts +1 -1
- package/dist/core/ports/identity.js +1 -1
- package/dist/core/ports/index.d.ts +3 -0
- package/dist/core/ports/media.d.ts +1 -1
- package/dist/core/ports/plugins.d.ts +1 -1
- package/dist/core/react/bind-react.d.ts +6 -16
- package/dist/core/react/bind-react.js +1 -1
- package/dist/core/react/index.d.ts +3 -2
- package/dist/core/react/index.js +3 -2
- package/dist/core/react/module-ui.d.ts +10 -0
- package/dist/core/react/module-ui.js +6 -0
- package/dist/core/react/use-controller.d.ts +1 -1
- package/dist/core/react/use-controller.js +2 -1
- package/dist/core/routing/route-template.d.ts +11 -0
- package/dist/core/routing/route-template.js +23 -0
- package/dist/core/transport/http.js +7 -5
- package/dist/core/transport/index.d.ts +0 -1
- package/dist/core/transport/index.js +0 -1
- package/dist/forms/adapters/http.js +2 -2
- package/dist/forms/adapters/memory.d.ts +1 -1
- package/dist/forms/adapters/memory.js +35 -26
- package/dist/forms/controllers/draft-store.d.ts +4 -4
- package/dist/forms/controllers/draft-store.js +1 -1
- package/dist/forms/controllers/field-attributes-dialog.controller.d.ts +7 -8
- package/dist/forms/controllers/field-attributes-dialog.controller.js +8 -6
- package/dist/forms/controllers/form-editor.controller.d.ts +8 -5
- package/dist/forms/controllers/form-editor.controller.js +2 -2
- package/dist/forms/controllers/form-fields-editor.controller.d.ts +4 -4
- package/dist/forms/controllers/form-submission-detail.controller.d.ts +4 -4
- package/dist/forms/controllers/form-submissions.controller.d.ts +4 -4
- package/dist/forms/controllers/forms-list.controller.d.ts +4 -4
- package/dist/forms/field-settings.d.ts +32 -16
- package/dist/forms/field-settings.js +52 -41
- package/dist/forms/forms.module.d.ts +5 -4
- package/dist/forms/forms.module.js +3 -3
- package/dist/forms/html-rules.d.ts +4 -2
- package/dist/forms/html-rules.js +19 -19
- package/dist/forms/index.d.ts +6 -4
- package/dist/forms/index.js +3 -3
- package/dist/forms/messages.en.js +1 -1
- package/dist/forms/models.d.ts +1 -1
- package/dist/forms/ports.d.ts +8 -4
- package/dist/forms/ports.js +3 -1
- package/dist/forms/react/components/FieldAttributesDialog.d.ts +4 -1
- package/dist/forms/react/components/FieldAttributesDialog.js +6 -28
- package/dist/forms/react/components/FieldAttributesStyling.d.ts +26 -0
- package/dist/forms/react/components/FieldAttributesStyling.js +42 -0
- package/dist/forms/react/components/FieldSettingsRows.js +3 -4
- package/dist/forms/react/components/FieldSettingsSection.d.ts +4 -1
- package/dist/forms/react/components/FieldSettingsSection.js +3 -3
- package/dist/forms/react/components/FormEditorFieldsBody.d.ts +5 -2
- package/dist/forms/react/components/FormEditorFieldsBody.js +3 -3
- package/dist/forms/react/components/FormEditorFieldsBodyParts.js +1 -1
- package/dist/forms/react/components/FormEditorFieldsSlot.d.ts +6 -0
- package/dist/forms/react/components/FormEditorFieldsSlot.js +10 -0
- package/dist/forms/react/components/FormEditorHeader.d.ts +9 -0
- package/dist/forms/react/components/FormEditorHeader.js +16 -0
- package/dist/forms/react/components/FormEditorHeaderText.d.ts +1 -1
- package/dist/forms/react/components/FormEditorHeaderText.js +1 -1
- package/dist/forms/react/components/FormEditorMainPanel.d.ts +1 -1
- package/dist/forms/react/components/FormEditorMainPanel.js +4 -4
- package/dist/forms/react/components/FormEditorTabStrip.d.ts +5 -2
- package/dist/forms/react/components/FormEditorTabStrip.js +3 -4
- package/dist/forms/react/components/FormFieldRow.d.ts +10 -0
- package/dist/forms/react/components/FormFieldRow.js +53 -0
- package/dist/forms/react/components/FormFieldsEditor.d.ts +4 -1
- package/dist/forms/react/components/FormFieldsEditor.js +6 -22
- package/dist/forms/react/components/FormFieldsTableParts.d.ts +10 -0
- package/dist/forms/react/components/FormFieldsTableParts.js +11 -0
- package/dist/forms/react/components/FormSubmissionDate.d.ts +1 -1
- package/dist/forms/react/components/FormSubmissionDate.js +1 -1
- package/dist/forms/react/components/FormSubmissionDetail.d.ts +4 -1
- package/dist/forms/react/components/FormSubmissionDetail.js +3 -3
- package/dist/forms/react/components/FormSubmissions.d.ts +6 -1
- package/dist/forms/react/components/FormSubmissions.js +3 -3
- package/dist/forms/react/components/FormSubmissionsTable.js +1 -1
- package/dist/forms/react/components/FormsListParts.d.ts +36 -0
- package/dist/forms/react/components/FormsListParts.js +41 -0
- package/dist/forms/react/hooks/FormsPorts.hooks.d.ts +7 -1
- package/dist/forms/react/hooks/FormsPorts.hooks.js +11 -1
- package/dist/forms/react/hooks/forms-view.hooks.d.ts +17 -11
- package/dist/forms/react/hooks/forms-view.hooks.js +13 -11
- package/dist/forms/react/hooks/use-field-attributes-dialog.hooks.d.ts +4 -1
- package/dist/forms/react/hooks/use-field-attributes-dialog.hooks.js +6 -4
- package/dist/forms/react/hooks/use-form-editor-parts.hooks.d.ts +127 -0
- package/dist/forms/react/hooks/use-form-editor-parts.hooks.js +223 -0
- package/dist/forms/react/hooks/use-form-editor.hooks.d.ts +13 -3
- package/dist/forms/react/hooks/use-form-editor.hooks.js +34 -210
- package/dist/forms/react/hooks/use-form-fields-editor.hooks.js +2 -2
- package/dist/forms/react/hooks/use-form-submission-detail.hooks.d.ts +2 -2
- package/dist/forms/react/hooks/use-form-submission-detail.hooks.js +4 -4
- package/dist/forms/react/hooks/use-form-submissions.hooks.d.ts +2 -2
- package/dist/forms/react/hooks/use-form-submissions.hooks.js +4 -5
- package/dist/forms/react/hooks/use-forms-list.hooks.js +3 -3
- package/dist/forms/react/index.d.ts +35 -26
- package/dist/forms/react/index.js +5 -6
- package/dist/forms/react/pages/FormEditor.d.ts +2 -2
- package/dist/forms/react/pages/FormEditor.js +7 -12
- package/dist/forms/react/pages/FormsList.d.ts +5 -2
- package/dist/forms/react/pages/FormsList.js +4 -30
- package/dist/forms/rules.d.ts +5 -5
- package/dist/forms/rules.js +8 -20
- package/dist/media/adapters/http.d.ts +24 -2
- package/dist/media/adapters/http.js +133 -10
- package/dist/media/adapters/memory.js +41 -46
- package/dist/media/conformance/media-api.conformance.js +60 -42
- package/dist/media/controllers/edit-media.controller.d.ts +5 -5
- package/dist/media/controllers/edit-media.controller.js +20 -17
- package/dist/media/controllers/library.controller.d.ts +14 -14
- package/dist/media/controllers/library.controller.js +180 -167
- package/dist/media/controllers/providers.controller.d.ts +4 -4
- package/dist/media/controllers/providers.controller.js +46 -40
- package/dist/media/html-attributes.d.ts +23 -13
- package/dist/media/html-attributes.js +15 -23
- package/dist/media/index.d.ts +5 -4
- package/dist/media/index.js +3 -3
- package/dist/media/media.module.d.ts +6 -5
- package/dist/media/media.module.js +3 -3
- package/dist/media/ports.d.ts +8 -3
- package/dist/media/ports.js +4 -1
- package/dist/media/react/components/EditMediaPanel.d.ts +4 -1
- package/dist/media/react/components/EditMediaPanel.js +3 -3
- package/dist/media/react/components/MediaCard.d.ts +7 -2
- package/dist/media/react/components/MediaCard.js +6 -6
- package/dist/media/react/components/MediaDialog.d.ts +4 -1
- package/dist/media/react/components/MediaDialog.js +3 -3
- package/dist/media/react/components/MediaGrid.d.ts +4 -1
- package/dist/media/react/components/MediaGrid.js +2 -2
- package/dist/media/react/components/MediaIcons.d.ts +9 -9
- package/dist/media/react/components/MediaIcons.js +9 -9
- package/dist/media/react/components/MediaLightbox.d.ts +4 -1
- package/dist/media/react/components/MediaLightbox.js +3 -3
- package/dist/media/react/components/MediaPicker.d.ts +4 -1
- package/dist/media/react/components/MediaPicker.js +3 -3
- package/dist/media/react/components/MediaPurgeDialog.d.ts +4 -1
- package/dist/media/react/components/MediaPurgeDialog.js +3 -3
- package/dist/media/react/components/UploadButton.d.ts +4 -1
- package/dist/media/react/components/UploadButton.js +3 -3
- package/dist/media/react/hooks/EditMediaPanel.hooks.d.ts +6 -3
- package/dist/media/react/hooks/EditMediaPanel.hooks.js +62 -50
- package/dist/media/react/hooks/LibraryTab.hooks.d.ts +23 -23
- package/dist/media/react/hooks/LibraryTab.hooks.js +52 -36
- package/dist/media/react/hooks/MediaCard.hooks.d.ts +1 -1
- package/dist/media/react/hooks/MediaCard.hooks.js +2 -1
- package/dist/media/react/hooks/MediaDialog.hooks.d.ts +1 -1
- package/dist/media/react/hooks/MediaPage.hooks.d.ts +22 -18
- package/dist/media/react/hooks/MediaPage.hooks.js +3 -3
- package/dist/media/react/hooks/MediaPicker.hooks.d.ts +1 -1
- package/dist/media/react/hooks/MediaPicker.hooks.js +2 -2
- package/dist/media/react/hooks/MediaPorts.hooks.d.ts +7 -0
- package/dist/media/react/hooks/MediaPorts.hooks.js +11 -1
- package/dist/media/react/hooks/MediaQuery.hooks.d.ts +3 -3
- package/dist/media/react/hooks/MediaQuery.hooks.js +1 -1
- package/dist/media/react/hooks/ProvidersTab.hooks.d.ts +7 -1
- package/dist/media/react/hooks/ProvidersTab.hooks.js +49 -46
- package/dist/media/react/index.d.ts +39 -114
- package/dist/media/react/index.js +55 -48
- package/dist/media/react/pages/MediaPage.d.ts +4 -1
- package/dist/media/react/pages/MediaPage.js +2 -2
- package/dist/media/react/tabs/LibraryTab.d.ts +5 -2
- package/dist/media/react/tabs/LibraryTab.js +3 -3
- package/dist/media/react/tabs/ProvidersTab.d.ts +5 -2
- package/dist/media/react/tabs/ProvidersTab.js +2 -2
- package/dist/media/rules.d.ts +0 -7
- package/dist/media/rules.js +0 -12
- package/dist/playground/controllers/playground.controller.d.ts +3 -3
- package/dist/playground/controllers/playground.controller.js +1 -1
- package/dist/playground/playground.module.d.ts +1 -1
- package/dist/playground/playground.module.js +1 -1
- package/dist/playground/react/components/Canvas.d.ts +5 -2
- package/dist/playground/react/components/Canvas.js +3 -3
- package/dist/playground/react/hooks/Canvas.hooks.d.ts +1 -1
- package/dist/playground/react/hooks/PlaygroundPage.hooks.d.ts +7 -3
- package/dist/playground/react/hooks/PlaygroundPorts.hooks.js +1 -1
- package/dist/playground/react/index.d.ts +9 -9
- package/dist/playground/react/pages/PlaygroundPage.d.ts +8 -2
- package/dist/playground/react/pages/PlaygroundPage.js +3 -3
- package/dist/playground/react/tabs/CanvasTab.d.ts +2 -2
- package/dist/playground/react/tabs/CanvasTab.js +1 -1
- package/dist/react/OverlayHost.d.ts +4 -1
- package/dist/react/OverlayHost.js +2 -2
- package/dist/react/components/ConfirmDialog/ConfirmDialog.d.ts +12 -2
- package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.js +1 -2
- package/dist/react/components/ConfirmDialog/ConfirmDialog.js +6 -4
- package/dist/react/components/ConfirmDialog/confirm-dialog-attrs.d.ts +1 -1
- package/dist/react/components/ConfirmDialog/confirm-dialog-attrs.js +1 -1
- package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.d.ts +2 -2
- package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.js +9 -8
- package/dist/react/components/RowMenu/RowMenu.hooks.js +66 -63
- package/dist/react/components/RowMenu/RowMenu.js +1 -1
- package/dist/react/components/Sidebar.d.ts +11 -4
- package/dist/react/components/Sidebar.js +11 -101
- package/dist/react/components/SidebarIcon.d.ts +4 -0
- package/dist/react/components/SidebarIcon.js +91 -0
- package/dist/react/components/ThemePreviewReloadControl.d.ts +7 -0
- package/dist/react/components/ThemePreviewReloadControl.js +5 -0
- package/dist/react/entities/EntityDetail.d.ts +4 -1
- package/dist/react/entities/EntityDetail.hooks.d.ts +14 -0
- package/dist/react/entities/EntityDetail.hooks.js +10 -0
- package/dist/react/entities/EntityDetail.js +3 -6
- package/dist/react/entities/EntityEdit.d.ts +6 -1
- package/dist/react/entities/EntityEdit.js +23 -6
- package/dist/react/entities/EntityField.d.ts +3 -1
- package/dist/react/entities/EntityField.js +9 -6
- package/dist/react/entities/EntityList.d.ts +4 -1
- package/dist/react/entities/EntityList.hooks.d.ts +33 -0
- package/dist/react/entities/EntityList.hooks.js +28 -0
- package/dist/react/entities/EntityList.js +3 -23
- package/dist/react/entities/FailureNotice.d.ts +29 -0
- package/dist/react/entities/FailureNotice.js +33 -0
- package/dist/react/entities/contribution.d.ts +2 -0
- package/dist/react/entities/contribution.js +2 -2
- package/dist/react/entities/rules.d.ts +6 -1
- package/dist/react/entities/rules.js +7 -4
- package/dist/react/entities/types.d.ts +19 -0
- package/dist/react/entities/use-entity-edit.d.ts +11 -2
- package/dist/react/entities/use-entity-edit.js +18 -12
- package/dist/react/entities/use-entity-read.d.ts +7 -2
- package/dist/react/entities/use-entity-read.js +9 -4
- package/dist/react/hooks/use-browser-telemetry-feed.d.ts +13 -0
- package/dist/react/hooks/use-browser-telemetry-feed.js +14 -0
- package/dist/react/hooks/use-overflow-title.d.ts +17 -0
- package/dist/react/hooks/use-overflow-title.js +29 -0
- package/dist/react/hooks/use-process-restart.d.ts +46 -0
- package/dist/react/hooks/use-process-restart.js +59 -0
- package/dist/react/hooks/use-rail-label-titles.d.ts +18 -0
- package/dist/react/hooks/use-rail-label-titles.js +44 -0
- package/dist/react/index.d.ts +6 -0
- package/dist/react/index.js +5 -0
- package/dist/react/kit-media-providers.d.ts +187 -0
- package/dist/react/kit-media-providers.js +2 -0
- package/dist/react/kit.d.ts +478 -0
- package/dist/react/kit.js +75 -0
- package/dist/react/overlays.d.ts +4 -4
- package/dist/react/overlays.js +1 -1
- package/dist/react/shell/AdminShell.d.ts +2 -2
- package/dist/react/shell/AdminShell.js +56 -24
- package/dist/react/shell/index.d.ts +1 -1
- package/dist/react/shell/model.d.ts +9 -1
- package/dist/react/shell/model.js +31 -15
- package/dist/react/shell/shell-hooks.d.ts +34 -0
- package/dist/react/shell/shell-hooks.js +31 -0
- package/dist/react/shell/theme-ports.d.ts +1 -1
- package/dist/react/shell/types.d.ts +97 -3
- package/dist/react/shell/use-admin-theme.d.ts +4 -2
- package/dist/react/shell/use-admin-theme.js +4 -3
- package/dist/react/testing-kit-media-providers.d.ts +3 -0
- package/dist/react/testing-kit-media-providers.js +96 -0
- package/dist/react/testing-kit.d.ts +11 -0
- package/dist/react/testing-kit.js +114 -0
- package/dist/redirects/adapters/memory.js +42 -33
- package/dist/redirects/conformance/redirects-api.conformance.js +1 -1
- package/dist/redirects/controllers/hit-count.controller.d.ts +5 -5
- package/dist/redirects/controllers/hit-count.controller.js +1 -1
- package/dist/redirects/controllers/import-redirects.controller.d.ts +5 -5
- package/dist/redirects/controllers/import-redirects.controller.js +1 -1
- package/dist/redirects/controllers/redirects.controller.d.ts +5 -5
- package/dist/redirects/controllers/redirects.controller.js +1 -1
- package/dist/redirects/index.d.ts +11 -7
- package/dist/redirects/index.js +6 -7
- package/dist/redirects/messages.en.d.ts +1 -0
- package/dist/redirects/messages.en.js +1 -0
- package/dist/redirects/ports.d.ts +2 -2
- package/dist/redirects/ports.js +1 -1
- package/dist/redirects/react/components/CreateRedirectForm.d.ts +17 -0
- package/dist/redirects/react/components/CreateRedirectForm.js +19 -0
- package/dist/redirects/react/components/HitCountCell.js +2 -2
- package/dist/redirects/react/components/ImportRedirectsForm.js +1 -1
- package/dist/redirects/react/hooks/RedirectsPage.hooks.d.ts +1 -1
- package/dist/redirects/react/hooks/RedirectsPorts.hooks.d.ts +5 -0
- package/dist/redirects/react/hooks/RedirectsPorts.hooks.js +11 -1
- package/dist/redirects/react/hooks/use-hit-count-cell.hooks.js +3 -3
- package/dist/redirects/react/hooks/use-import-redirects-form.hooks.js +4 -4
- package/dist/redirects/react/hooks/use-redirects.hooks.d.ts +1 -1
- package/dist/redirects/react/hooks/use-redirects.hooks.js +4 -4
- package/dist/redirects/react/hooks/wired.hooks.d.ts +1 -1
- package/dist/redirects/react/index.d.ts +28 -90
- package/dist/redirects/react/index.js +6 -7
- package/dist/redirects/react/pages/RedirectsPage.d.ts +3 -1
- package/dist/redirects/react/pages/RedirectsPage.js +5 -5
- package/dist/redirects/redirects.module.d.ts +3 -2
- package/dist/redirects/redirects.module.js +1 -1
- package/dist/security/controllers/access-tokens.controller.d.ts +4 -4
- package/dist/security/controllers/access-tokens.controller.js +20 -15
- package/dist/security/controllers/other-credentials.controller.d.ts +4 -4
- package/dist/security/controllers/other-credentials.controller.js +1 -1
- package/dist/security/controllers/root-key.controller.d.ts +4 -4
- package/dist/security/controllers/root-key.controller.js +1 -1
- package/dist/security/ports.d.ts +3 -3
- package/dist/security/ports.js +1 -1
- package/dist/security/react/components/CredentialEditor.d.ts +4 -2
- package/dist/security/react/components/CredentialEditor.js +3 -3
- package/dist/security/react/hooks/AccessTokensTab.hooks.d.ts +5 -5
- package/dist/security/react/hooks/RootKeyTab.hooks.d.ts +1 -1
- package/dist/security/react/hooks/SecurityPage.hooks.d.ts +7 -3
- package/dist/security/react/hooks/SecurityPorts.hooks.js +1 -1
- package/dist/security/react/index.d.ts +22 -22
- package/dist/security/react/pages/SecurityPage.d.ts +8 -2
- package/dist/security/react/pages/SecurityPage.js +3 -3
- package/dist/security/react/tabs/AccessTokensTab.d.ts +5 -2
- package/dist/security/react/tabs/AccessTokensTab.js +3 -3
- package/dist/security/react/tabs/RootKeyTab.d.ts +5 -2
- package/dist/security/react/tabs/RootKeyTab.js +3 -3
- package/dist/security/rules.d.ts +1 -1
- package/dist/security/security.module.d.ts +4 -4
- package/dist/security/security.module.js +1 -1
- package/dist/seo/controllers/entry-picker.controller.d.ts +7 -7
- package/dist/seo/controllers/entry-picker.controller.js +1 -1
- package/dist/seo/controllers/entry-section.controller.d.ts +9 -9
- package/dist/seo/controllers/entry-section.controller.js +1 -1
- package/dist/seo/controllers/media-ref.controller.d.ts +9 -9
- package/dist/seo/controllers/media-ref.controller.js +1 -1
- package/dist/seo/controllers/seo-entry.controller.d.ts +7 -7
- package/dist/seo/controllers/seo-entry.controller.js +1 -1
- package/dist/seo/controllers/seo.controller.d.ts +7 -7
- package/dist/seo/controllers/seo.controller.js +1 -1
- package/dist/seo/controllers/sitemap.controller.d.ts +7 -7
- package/dist/seo/controllers/sitemap.controller.js +2 -2
- package/dist/seo/index.d.ts +4 -2
- package/dist/seo/index.js +2 -2
- package/dist/seo/ports.d.ts +2 -2
- package/dist/seo/ports.js +1 -1
- package/dist/seo/react/components/AnalyzePanel.d.ts +13 -0
- package/dist/seo/react/components/AnalyzePanel.js +21 -0
- package/dist/seo/react/components/EntryPicker.d.ts +19 -0
- package/dist/seo/react/components/EntryPicker.js +25 -0
- package/dist/seo/react/components/MediaPickerBridge.d.ts +4 -1
- package/dist/seo/react/components/MediaPickerBridge.js +2 -2
- package/dist/seo/react/components/MediaRefField.d.ts +5 -2
- package/dist/seo/react/components/MediaRefField.js +5 -5
- package/dist/seo/react/components/SeoEntryFields.d.ts +19 -0
- package/dist/seo/react/components/SeoEntryFields.js +19 -0
- package/dist/seo/react/components/SeoEntryPanel.d.ts +31 -0
- package/dist/seo/react/components/SeoEntryPanel.js +64 -0
- package/dist/seo/react/components/SeoIcons.d.ts +3 -3
- package/dist/seo/react/components/SeoIcons.js +3 -3
- package/dist/seo/react/components/SeoSection.d.ts +27 -0
- package/dist/seo/react/components/SeoSection.js +24 -0
- package/dist/seo/react/components/SitemapModal.d.ts +42 -2
- package/dist/seo/react/components/SitemapModal.js +17 -17
- package/dist/seo/react/hooks/MediaRefField.hooks.js +6 -6
- package/dist/seo/react/hooks/SeoModuleTabs.d.ts +2 -2
- package/dist/seo/react/hooks/SeoModuleTabs.js +3 -1
- package/dist/seo/react/hooks/SeoPage.hooks.d.ts +2 -2
- package/dist/seo/react/hooks/SeoPorts.hooks.d.ts +5 -0
- package/dist/seo/react/hooks/SeoPorts.hooks.js +11 -1
- package/dist/seo/react/hooks/SeoQuery.hooks.d.ts +3 -3
- package/dist/seo/react/hooks/SeoQuery.hooks.js +1 -1
- package/dist/seo/react/hooks/SitemapModal.hooks.js +1 -1
- package/dist/seo/react/hooks/use-entry-picker.hooks.js +1 -1
- package/dist/seo/react/hooks/use-seo-entry-panel.hooks.js +3 -3
- package/dist/seo/react/hooks/use-seo-entry-section.hooks.js +2 -2
- package/dist/seo/react/hooks/use-seo.hooks.js +3 -3
- package/dist/seo/react/hooks/use-share-image-warning.hooks.js +1 -1
- package/dist/seo/react/hooks/use-sitemap-modal.hooks.d.ts +4 -1
- package/dist/seo/react/hooks/use-sitemap-modal.hooks.js +6 -5
- package/dist/seo/react/index.d.ts +28 -21
- package/dist/seo/react/index.js +5 -6
- package/dist/seo/react/pages/SeoPage.d.ts +16 -82
- package/dist/seo/react/pages/SeoPage.js +29 -216
- package/dist/seo/react/tabs/SeoDefaultsSections.d.ts +19 -0
- package/dist/seo/react/tabs/SeoDefaultsSections.js +48 -0
- package/dist/seo/react/tabs/SeoDefaultsTab.d.ts +24 -0
- package/dist/seo/react/tabs/SeoDefaultsTab.js +30 -0
- package/dist/seo/react/tabs/SeoSitemapTab.d.ts +24 -0
- package/dist/seo/react/tabs/SeoSitemapTab.js +38 -0
- package/dist/seo/rules.d.ts +3 -3
- package/dist/seo/rules.js +6 -6
- package/dist/seo/seo.module.d.ts +3 -3
- package/dist/seo/seo.module.js +1 -1
- package/dist/source-control/controllers/source-control.controller.d.ts +3 -3
- package/dist/source-control/controllers/source-control.controller.js +1 -1
- package/dist/source-control/ports.d.ts +1 -1
- package/dist/source-control/ports.js +1 -1
- package/dist/source-control/react/components/SourceControlCredentialFields.d.ts +4 -2
- package/dist/source-control/react/components/SourceControlCredentialFields.js +3 -3
- package/dist/source-control/react/components/SourceControlProviderRow.d.ts +1 -1
- package/dist/source-control/react/components/SourceControlProviderRow.js +2 -2
- package/dist/source-control/react/hooks/ProvidersTab.hooks.d.ts +1 -1
- package/dist/source-control/react/hooks/ProvidersTab.hooks.js +2 -2
- package/dist/source-control/react/hooks/SourceControlPage.hooks.d.ts +7 -3
- package/dist/source-control/react/hooks/SourceControlPorts.hooks.d.ts +5 -0
- package/dist/source-control/react/hooks/SourceControlPorts.hooks.js +11 -1
- package/dist/source-control/react/index.d.ts +25 -50
- package/dist/source-control/react/index.js +9 -6
- package/dist/source-control/react/pages/SourceControlPage.d.ts +8 -2
- package/dist/source-control/react/pages/SourceControlPage.js +3 -3
- package/dist/source-control/react/tabs/ProvidersTab.d.ts +5 -2
- package/dist/source-control/react/tabs/ProvidersTab.js +3 -3
- package/dist/source-control/source-control.module.d.ts +2 -2
- package/dist/source-control/source-control.module.js +1 -1
- package/dist/widgets/adapters/http.js +2 -2
- package/dist/widgets/adapters/memory.js +26 -20
- package/dist/widgets/controllers/instance-editor.controller.d.ts +3 -3
- package/dist/widgets/controllers/instance-editor.controller.js +48 -38
- package/dist/widgets/controllers/library.controller.d.ts +3 -3
- package/dist/widgets/controllers/library.controller.js +1 -2
- package/dist/widgets/controllers/region-editor.controller.d.ts +3 -3
- package/dist/widgets/controllers/region-editor.controller.js +5 -5
- package/dist/widgets/controllers/regions.controller.d.ts +3 -3
- package/dist/widgets/controllers/regions.controller.js +1 -2
- package/dist/widgets/index.d.ts +2 -1
- package/dist/widgets/index.js +1 -1
- package/dist/widgets/messages.en.js +1 -1
- package/dist/widgets/ports.d.ts +3 -3
- package/dist/widgets/ports.js +1 -1
- package/dist/widgets/react/components/RegionPlacementRow.d.ts +14 -0
- package/dist/widgets/react/components/RegionPlacementRow.js +8 -0
- package/dist/widgets/react/components/TrashWidgetDialog.d.ts +11 -0
- package/dist/widgets/react/components/TrashWidgetDialog.js +8 -0
- package/dist/widgets/react/components/WidgetInstanceNotices.js +1 -1
- package/dist/widgets/react/components/WidgetPageHeaders.d.ts +42 -0
- package/dist/widgets/react/components/WidgetPageHeaders.js +54 -0
- package/dist/widgets/react/components/WidgetRegionEditorHeaderActions.js +1 -1
- package/dist/widgets/react/components/WidgetTableColumns.d.ts +12 -0
- package/dist/widgets/react/components/WidgetTableColumns.js +47 -0
- package/dist/widgets/react/hooks/WidgetsPorts.hooks.d.ts +12 -7
- package/dist/widgets/react/hooks/WidgetsPorts.hooks.js +11 -0
- package/dist/widgets/react/hooks/WidgetsQuery.hooks.d.ts +2 -2
- package/dist/widgets/react/hooks/WidgetsQuery.hooks.js +1 -1
- package/dist/widgets/react/hooks/page-views.hooks.d.ts +1 -1
- package/dist/widgets/react/hooks/page-views.hooks.js +1 -1
- package/dist/widgets/react/hooks/use-widget-instance-editor.hooks.d.ts +2 -2
- package/dist/widgets/react/hooks/use-widget-instance-editor.hooks.js +3 -3
- package/dist/widgets/react/hooks/use-widget-region-editor.hooks.d.ts +1 -1
- package/dist/widgets/react/hooks/use-widget-region-editor.hooks.js +2 -2
- package/dist/widgets/react/hooks/use-widget-regions.hooks.d.ts +3 -1
- package/dist/widgets/react/hooks/use-widget-regions.hooks.js +7 -6
- package/dist/widgets/react/hooks/use-widgets-library.hooks.d.ts +4 -2
- package/dist/widgets/react/hooks/use-widgets-library.hooks.js +7 -6
- package/dist/widgets/react/index.d.ts +41 -34
- package/dist/widgets/react/index.js +5 -6
- package/dist/widgets/react/pages/WidgetInstanceEditor.d.ts +5 -1
- package/dist/widgets/react/pages/WidgetInstanceEditor.js +7 -9
- package/dist/widgets/react/pages/WidgetRegionEditor.d.ts +5 -1
- package/dist/widgets/react/pages/WidgetRegionEditor.js +8 -10
- package/dist/widgets/react/pages/WidgetRegions.d.ts +5 -1
- package/dist/widgets/react/pages/WidgetRegions.js +6 -8
- package/dist/widgets/react/pages/WidgetsLibrary.d.ts +5 -1
- package/dist/widgets/react/pages/WidgetsLibrary.js +8 -45
- package/dist/widgets/rules.d.ts +5 -3
- package/dist/widgets/rules.js +4 -9
- package/dist/widgets/widgets.module.d.ts +3 -3
- package/dist/widgets/widgets.module.js +1 -1
- package/package.json +25 -59
- package/dist/consent/react/ConsentFields.d.ts +0 -39
- package/dist/consent/react/ConsentFields.js +0 -87
- package/dist/consent/react/ConsentPreviewFrame.d.ts +0 -14
- package/dist/consent/react/ConsentPreviewFrame.js +0 -14
- package/dist/consent/react/ConsentSettingsPanel.d.ts +0 -54
- package/dist/consent/react/ConsentSettingsPanel.js +0 -13
- package/dist/consent/react/index.d.ts +0 -8
- package/dist/consent/react/index.js +0 -4
- package/dist/consent/react/settings-panel.hooks.d.ts +0 -49
- package/dist/consent/react/settings-panel.hooks.js +0 -57
- package/dist/core/module/controller-store.d.ts +0 -22
- package/dist/core/module/controller-store.js +0 -32
- package/dist/core/module/define-admin-module.d.ts +0 -4
- package/dist/core/module/define-admin-module.js +0 -5
- package/dist/core/module/token.d.ts +0 -19
- package/dist/core/module/token.js +0 -4
- package/dist/core/module/types.d.ts +0 -79
- package/dist/core/module/types.js +0 -2
- package/dist/core/permissions/rules.d.ts +0 -35
- package/dist/core/permissions/rules.js +0 -34
- package/dist/core/transport/errors.d.ts +0 -62
- package/dist/core/transport/errors.js +0 -63
- package/dist/core/transport/query-suffix.d.ts +0 -3
- package/dist/core/transport/query-suffix.js +0 -5
- package/dist/media/styles.d.ts +0 -4
- package/dist/media/styles.js +0 -5
- package/dist/react/bind-react.d.ts +0 -2
- package/dist/react/bind-react.js +0 -3
- package/dist/react/use-controller.d.ts +0 -2
- package/dist/react/use-controller.js +0 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useWidgetsListQuery } from './WidgetsQuery.hooks.js';
|
|
1
2
|
import type { AdminWidget, AdminWidgetType, WidgetsTranslate as Translate } from '../../models.js';
|
|
2
3
|
export interface WidgetsLibraryController {
|
|
3
4
|
/** `null` until the initial load settles — the caller renders a loading state. */
|
|
@@ -21,14 +22,15 @@ export interface WidgetsLibraryController {
|
|
|
21
22
|
cancelTrash: () => void;
|
|
22
23
|
/** Bound translator — `WidgetsLibrary.tsx`'s only source of UI copy; see this file's own header. */
|
|
23
24
|
t: Translate;
|
|
24
|
-
/** The raw resolved locale — exposed only because `widgetTypeLabel` (
|
|
25
|
+
/** The raw resolved locale — exposed only because `widgetTypeLabel` (`packages/admin/src/widgets/rules.ts`) genuinely
|
|
25
26
|
* needs it, not `t`. */
|
|
26
27
|
locale: string;
|
|
27
28
|
}
|
|
28
29
|
import type { AdminWidgetsPort, WidgetsEventsPort } from '../../ports.js';
|
|
29
30
|
export declare function useWidgetsLibrary({ api }: {
|
|
30
31
|
api: AdminWidgetsPort;
|
|
31
|
-
}, { t, locale, events }?: {
|
|
32
|
+
}, { t, locale, events, useQuery }?: {
|
|
33
|
+
useQuery?: typeof useWidgetsListQuery;
|
|
32
34
|
t?: Translate | undefined;
|
|
33
35
|
locale?: string | undefined;
|
|
34
36
|
events?: WidgetsEventsPort | undefined;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { describeApiError } from '@jini-ai/core/admin-runtime';
|
|
2
|
+
import { useInvalidate } from '../../../react/kit.js';
|
|
2
3
|
import { WIDGET_QUERY_KEYS, useWidgetsListQuery } from './WidgetsQuery.hooks.js';
|
|
3
4
|
import { useEffect, useRef } from 'react';
|
|
4
|
-
import {
|
|
5
|
+
import { useWidgetsController } from './WidgetsPorts.hooks.js';
|
|
5
6
|
import { createWidgetsLibraryController } from '../../controllers/library.controller.js';
|
|
6
7
|
import { widgetsEnglish } from '../../messages.en.js';
|
|
7
8
|
import { WIDGETS_LIBRARY_RESOURCE } from '../../rules.js';
|
|
8
9
|
import { useWidgetsPorts, useWidgetsOptions } from './WidgetsPorts.hooks.js';
|
|
9
|
-
export function useWidgetsLibrary({ api }, { t = widgetsEnglish, locale = 'en', events } = {}) {
|
|
10
|
-
const cached =
|
|
10
|
+
export function useWidgetsLibrary({ api }, { t = widgetsEnglish, locale = 'en', events, useQuery = useWidgetsListQuery } = {}) {
|
|
11
|
+
const cached = useQuery({ api });
|
|
11
12
|
const invalidate = useInvalidate();
|
|
12
13
|
const latestT = useRef(t);
|
|
13
14
|
latestT.current = t;
|
|
14
|
-
const { controller, snapshot } =
|
|
15
|
+
const { controller, snapshot } = useWidgetsController({ create: () => createWidgetsLibraryController({ api: cached.api }, { t: key => latestT.current(key) }), dependencies: [cached.api] }, { start: ({ controller }) => { void controller.load(); } });
|
|
15
16
|
useEffect(() => {
|
|
16
17
|
if (!controller)
|
|
17
18
|
return undefined;
|
|
@@ -24,7 +25,7 @@ export function useWidgetsLibrary({ api }, { t = widgetsEnglish, locale = 'en',
|
|
|
24
25
|
const EMPTY_LIBRARY_STATE = { widgets: null, error: null, skippedCount: 0, skippedIds: [], createType: 'text', pendingTrash: null, trashingId: null };
|
|
25
26
|
function mergeLibraryState({ snapshot, data, queryError }, _optional = {}) {
|
|
26
27
|
const state = snapshot ?? EMPTY_LIBRARY_STATE;
|
|
27
|
-
return { ...state, ...cachedListFields({ state, data }), error: state.error ?? queryError
|
|
28
|
+
return { ...state, ...cachedListFields({ state, data }), error: state.error ?? (queryError ? describeApiError({ e: queryError, fallback: 'failed to load widgets' }) : null), trashing: state.pendingTrash !== null && state.trashingId === state.pendingTrash.id };
|
|
28
29
|
}
|
|
29
30
|
function cachedListFields({ state, data }, _optional = {}) {
|
|
30
31
|
return { widgets: data?.widgets ?? state.widgets, skippedCount: data?.skippedCount ?? state.skippedCount, skippedIds: data?.skippedIds ?? state.skippedIds };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
-
import type { AdminInstance } from '
|
|
3
|
-
import type { ModulePageProps } from '
|
|
2
|
+
import type { AdminInstance, AdminModuleUi } from '@jini-ai/core/contracts/admin-module';
|
|
3
|
+
import type { ModulePageProps } from '@jini-ai/core/contracts/admin-module';
|
|
4
4
|
import type { WidgetsReactOptions } from './hooks/WidgetsPorts.hooks.js';
|
|
5
5
|
export type { WidgetsReactOptions, WidgetsSlots } from './hooks/WidgetsPorts.hooks.js';
|
|
6
|
-
export { useWidgetsPorts, useWidgetsOptions } from './hooks/WidgetsPorts.hooks.js';
|
|
6
|
+
export { useWidgetsPorts, useWidgetsOptions, WidgetsControllerContext } from './hooks/WidgetsPorts.hooks.js';
|
|
7
7
|
export type { WidgetsLibraryProps } from './pages/WidgetsLibrary.js';
|
|
8
8
|
export type { WidgetInstanceEditorProps } from './pages/WidgetInstanceEditor.js';
|
|
9
9
|
export type { WidgetRegionsProps } from './pages/WidgetRegions.js';
|
|
@@ -19,15 +19,22 @@ export type WidgetsModulePageProps = ModulePageProps & {
|
|
|
19
19
|
widgetType?: string | null | undefined;
|
|
20
20
|
regionKey?: string | undefined;
|
|
21
21
|
};
|
|
22
|
+
/** The host injects the renderer helpers; this module states the contract and imports no implementation. */
|
|
23
|
+
type ModuleUi<Page, Tab> = AdminModuleUi<Page, Tab, ComponentType<{
|
|
24
|
+
admin: AdminInstance;
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
}>>;
|
|
22
27
|
/** Lazy pages share injected options while bindReact owns the API scope. */
|
|
23
|
-
export declare function widgets({ slots, widgetTypes, defaultConfig }: Pick<WidgetsReactOptions, 'slots' | 'widgetTypes' | 'defaultConfig'
|
|
28
|
+
export declare function widgets<Page, Tab>({ ui, slots, widgetTypes, defaultConfig }: Pick<WidgetsReactOptions, 'slots' | 'widgetTypes' | 'defaultConfig'> & {
|
|
29
|
+
ui: ModuleUi<Page, Tab>;
|
|
30
|
+
}, optional?: Omit<WidgetsReactOptions, 'slots' | 'widgetTypes' | 'defaultConfig'>): {
|
|
24
31
|
id: "widgets";
|
|
25
32
|
requires: {
|
|
26
|
-
readonly widgetsApi: import("
|
|
33
|
+
readonly widgetsApi: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../ports.js").AdminWidgetsPort, "admin.widgets.api">;
|
|
27
34
|
};
|
|
28
35
|
optional: {
|
|
29
|
-
readonly widgetsEvents: import("
|
|
30
|
-
readonly widgetsNavigation: import("
|
|
36
|
+
readonly widgetsEvents: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../ports.js").WidgetsEventsPort, "admin.widgets.events">;
|
|
37
|
+
readonly widgetsNavigation: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../ports.js").WidgetsNavigationPort, "admin.widgets.navigation">;
|
|
31
38
|
};
|
|
32
39
|
messages: {
|
|
33
40
|
readonly Back: "Back";
|
|
@@ -138,20 +145,20 @@ export declare function widgets({ slots, widgetTypes, defaultConfig }: Pick<Widg
|
|
|
138
145
|
admin: AdminInstance;
|
|
139
146
|
children: ReactNode;
|
|
140
147
|
options?: WidgetsReactOptions;
|
|
141
|
-
}, _optional?: Record<string, never>) => import("react").
|
|
148
|
+
}, _optional?: Record<string, never>) => import("react").ReactElement<{
|
|
142
149
|
admin: AdminInstance;
|
|
143
150
|
children: ReactNode;
|
|
144
|
-
}
|
|
151
|
+
}, string | import("react").JSXElementConstructor<any>>;
|
|
145
152
|
module: {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
readonly widgetsApi: import("
|
|
153
|
+
id: "widgets";
|
|
154
|
+
requires: {
|
|
155
|
+
readonly widgetsApi: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../ports.js").AdminWidgetsPort, "admin.widgets.api">;
|
|
149
156
|
};
|
|
150
|
-
|
|
151
|
-
readonly widgetsEvents: import("
|
|
152
|
-
readonly widgetsNavigation: import("
|
|
157
|
+
optional: {
|
|
158
|
+
readonly widgetsEvents: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../ports.js").WidgetsEventsPort, "admin.widgets.events">;
|
|
159
|
+
readonly widgetsNavigation: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../ports.js").WidgetsNavigationPort, "admin.widgets.navigation">;
|
|
153
160
|
};
|
|
154
|
-
|
|
161
|
+
messages: {
|
|
155
162
|
readonly Back: "Back";
|
|
156
163
|
readonly "Widget type to create": "Widget type to create";
|
|
157
164
|
readonly Content: "Content";
|
|
@@ -225,7 +232,7 @@ export declare function widgets({ slots, widgetTypes, defaultConfig }: Pick<Widg
|
|
|
225
232
|
readonly "Loading widgets\u2026": "Loading widgets…";
|
|
226
233
|
readonly "Saved \u00B7 version {version}": "Saved · version {version}";
|
|
227
234
|
};
|
|
228
|
-
|
|
235
|
+
pages: {
|
|
229
236
|
readonly library: {
|
|
230
237
|
readonly path: "/widgets";
|
|
231
238
|
readonly label: "Widgets";
|
|
@@ -257,32 +264,32 @@ export declare function widgets({ slots, widgetTypes, defaultConfig }: Pick<Widg
|
|
|
257
264
|
};
|
|
258
265
|
pages: {
|
|
259
266
|
readonly library: {
|
|
260
|
-
Page:
|
|
261
|
-
tabs: {};
|
|
267
|
+
readonly Page: Page;
|
|
268
|
+
readonly tabs: {};
|
|
262
269
|
};
|
|
263
270
|
readonly editor: {
|
|
264
|
-
Page:
|
|
265
|
-
tabs: {};
|
|
271
|
+
readonly Page: Page;
|
|
272
|
+
readonly tabs: {};
|
|
266
273
|
};
|
|
267
274
|
readonly regions: {
|
|
268
|
-
Page:
|
|
269
|
-
tabs: {};
|
|
275
|
+
readonly Page: Page;
|
|
276
|
+
readonly tabs: {};
|
|
270
277
|
};
|
|
271
278
|
readonly region: {
|
|
272
|
-
Page:
|
|
273
|
-
tabs: {};
|
|
279
|
+
readonly Page: Page;
|
|
280
|
+
readonly tabs: {};
|
|
274
281
|
};
|
|
275
282
|
};
|
|
276
|
-
usePorts
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
readonly widgetsApi: import("
|
|
283
|
+
usePorts(required?: Record<string, never>, optional?: Record<string, never>): import("@jini-ai/core/contracts/admin-module").ScopedPorts<{
|
|
284
|
+
id: "widgets";
|
|
285
|
+
requires: {
|
|
286
|
+
readonly widgetsApi: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../ports.js").AdminWidgetsPort, "admin.widgets.api">;
|
|
280
287
|
};
|
|
281
|
-
|
|
282
|
-
readonly widgetsEvents: import("
|
|
283
|
-
readonly widgetsNavigation: import("
|
|
288
|
+
optional: {
|
|
289
|
+
readonly widgetsEvents: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../ports.js").WidgetsEventsPort, "admin.widgets.events">;
|
|
290
|
+
readonly widgetsNavigation: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../ports.js").WidgetsNavigationPort, "admin.widgets.navigation">;
|
|
284
291
|
};
|
|
285
|
-
|
|
292
|
+
messages: {
|
|
286
293
|
readonly Back: "Back";
|
|
287
294
|
readonly "Widget type to create": "Widget type to create";
|
|
288
295
|
readonly Content: "Content";
|
|
@@ -356,7 +363,7 @@ export declare function widgets({ slots, widgetTypes, defaultConfig }: Pick<Widg
|
|
|
356
363
|
readonly "Loading widgets\u2026": "Loading widgets…";
|
|
357
364
|
readonly "Saved \u00B7 version {version}": "Saved · version {version}";
|
|
358
365
|
};
|
|
359
|
-
|
|
366
|
+
pages: {
|
|
360
367
|
readonly library: {
|
|
361
368
|
readonly path: "/widgets";
|
|
362
369
|
readonly label: "Widgets";
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
|
-
import { bindReact } from '../../core/react/bind-react.js';
|
|
3
2
|
import { widgetsModule } from '../widgets.module.js';
|
|
4
|
-
import { WidgetsPortsContext, WidgetsOptionsContext } from './hooks/WidgetsPorts.hooks.js';
|
|
5
|
-
export { useWidgetsPorts, useWidgetsOptions } from './hooks/WidgetsPorts.hooks.js';
|
|
3
|
+
import { WidgetsPortsContext, WidgetsOptionsContext, WidgetsControllerContext } from './hooks/WidgetsPorts.hooks.js';
|
|
4
|
+
export { useWidgetsPorts, useWidgetsOptions, WidgetsControllerContext } from './hooks/WidgetsPorts.hooks.js';
|
|
6
5
|
/** Lazy pages share injected options while bindReact owns the API scope. */
|
|
7
|
-
export function widgets({ slots, widgetTypes, defaultConfig }, optional = {}) {
|
|
6
|
+
export function widgets({ ui, slots, widgetTypes, defaultConfig }, optional = {}) {
|
|
8
7
|
// Scope membership uses object identity, so bind and return this same per-admin module.
|
|
9
8
|
const module = { ...widgetsModule };
|
|
10
9
|
const defaults = { slots, widgetTypes, defaultConfig, ...optional };
|
|
@@ -14,7 +13,7 @@ export function widgets({ slots, widgetTypes, defaultConfig }, optional = {}) {
|
|
|
14
13
|
return { default: (props) => createElement(loaded.default, params(props)) };
|
|
15
14
|
};
|
|
16
15
|
}
|
|
17
|
-
const react = bindReact({ module, views: {
|
|
16
|
+
const react = ui.bindReact({ module, views: {
|
|
18
17
|
library: { page: page(() => import('./pages/WidgetsLibrary.js'), () => ({})), tabs: {} },
|
|
19
18
|
editor: { page: page(() => import('./pages/WidgetInstanceEditor.js'), props => ({ widgetId: props.params?.widgetId ?? props.widgetId ?? null, widgetType: props.params?.widgetType ?? props.widgetType ?? null })), tabs: {} },
|
|
20
19
|
regions: { page: page(() => import('./pages/WidgetRegions.js'), () => ({})), tabs: {} },
|
|
@@ -24,7 +23,7 @@ export function widgets({ slots, widgetTypes, defaultConfig }, optional = {}) {
|
|
|
24
23
|
* Factory defaults support existing hosts; the port scope remains owned by bindReact.
|
|
25
24
|
*/
|
|
26
25
|
function Provider({ admin, children, options = defaults }, _optional = {}) {
|
|
27
|
-
return createElement(react.Provider, { admin, children: createElement(WidgetsOptionsContext.Provider, { value: options }, children) });
|
|
26
|
+
return createElement(react.Provider, { admin, children: createElement(WidgetsControllerContext.Provider, { value: ui.useController }, createElement(WidgetsOptionsContext.Provider, { value: options }, children)) });
|
|
28
27
|
}
|
|
29
28
|
return Object.assign(module, { react: { ...react, Provider } });
|
|
30
29
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { useWidgetInstanceEditorView } from '../hooks/page-views.hooks.js';
|
|
2
|
+
import { useWidgetsOptions } from '../hooks/WidgetsPorts.hooks.js';
|
|
1
3
|
import { useWiredWidgetInstanceEditor } from "../hooks/use-widget-instance-editor.hooks.js";
|
|
2
4
|
/**
|
|
3
5
|
* @file `WidgetInstanceEditorScreen` (`ui.spec.md` §2.2/§3.3/§4.3) — create/edit one widget
|
|
@@ -17,7 +19,9 @@ export interface WidgetInstanceEditorProps {
|
|
|
17
19
|
* Defaulted to the real hook, so production callers pass nothing and behave exactly as before.
|
|
18
20
|
*/
|
|
19
21
|
useWidgetInstanceEditorHook?: typeof useWiredWidgetInstanceEditor | undefined;
|
|
22
|
+
useWidgetInstanceEditorViewHook?: typeof useWidgetInstanceEditorView | undefined;
|
|
23
|
+
useWidgetsOptionsHook?: typeof useWidgetsOptions | undefined;
|
|
20
24
|
}
|
|
21
|
-
export declare function WidgetInstanceEditor(
|
|
25
|
+
export declare function WidgetInstanceEditor({ widgetId, widgetType: queryWidgetType, useWidgetInstanceEditorHook, useWidgetInstanceEditorViewHook, useWidgetsOptionsHook }: WidgetInstanceEditorProps): import("react").JSX.Element;
|
|
22
26
|
export default WidgetInstanceEditor;
|
|
23
27
|
//# sourceMappingURL=WidgetInstanceEditor.d.ts.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useWidgetInstanceEditorView } from '../hooks/page-views.hooks.js';
|
|
3
|
+
import { WidgetInstanceEditorHeader } from '../components/WidgetPageHeaders.js';
|
|
3
4
|
import { useWidgetsOptions } from '../hooks/WidgetsPorts.hooks.js';
|
|
4
|
-
import { agentHandle } from "@jini-ai/
|
|
5
|
+
import { agentHandle } from "@jini-ai/core/agent-handles";
|
|
5
6
|
import { widgetTypeLabel } from "../../rules.js";
|
|
6
7
|
import { useWiredWidgetInstanceEditor } from "../hooks/use-widget-instance-editor.hooks.js";
|
|
7
8
|
/**
|
|
@@ -15,10 +16,10 @@ import { useWiredWidgetInstanceEditor } from "../hooks/use-widget-instance-edito
|
|
|
15
16
|
*/
|
|
16
17
|
export { widgetInstanceGuard } from '../../rules.js';
|
|
17
18
|
import { WhereUsedBanner, WidgetInstanceGuardNotice } from '../components/WidgetInstanceNotices.js';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const {
|
|
21
|
-
const { isNew, widget, whereUsed, title, setTitle, config, setConfig, message, error, fieldErrors, saving, save, t, gate, onBackClick, } =
|
|
19
|
+
import {} from '@jini-ai/core/text';
|
|
20
|
+
export function WidgetInstanceEditor({ widgetId, widgetType: queryWidgetType, useWidgetInstanceEditorHook = useWiredWidgetInstanceEditor, useWidgetInstanceEditorViewHook = useWidgetInstanceEditorView, useWidgetsOptionsHook = useWidgetsOptions }) {
|
|
21
|
+
const { slots: { ConfigFields: WidgetConfigFields }, widgetTypes } = useWidgetsOptionsHook();
|
|
22
|
+
const { isNew, widget, whereUsed, title, setTitle, config, setConfig, message, error, fieldErrors, saving, save, t, gate, onBackClick, } = useWidgetInstanceEditorViewHook({ widgetId, widgetType: queryWidgetType, useWidgetInstanceEditorHook, widgetTypes });
|
|
22
23
|
if (gate.guard !== null)
|
|
23
24
|
return _jsx(WidgetInstanceGuardNotice, { guard: gate.guard, t: t });
|
|
24
25
|
// `widgetInstanceGuard`'s "no-type" case already covers a null `widgetType` above, but TS can't
|
|
@@ -27,10 +28,7 @@ export function WidgetInstanceEditor(props) {
|
|
|
27
28
|
const { widgetType } = gate;
|
|
28
29
|
// The host slot binds shared-component translations; screen copy uses the module t.
|
|
29
30
|
const sharedT = t;
|
|
30
|
-
return (_jsxs("div", { className: "page", children: [_jsxs("
|
|
31
|
-
role: "region",
|
|
32
|
-
label: "Widget editor header — the back link, the widget's title, and the Save button",
|
|
33
|
-
}), children: [_jsx("div", { className: "page-header-lead", children: _jsxs("a", { className: "btn-secondary", href: "/admin/widgets", onClick: onBackClick, "aria-label": `${t("Back")}: ${t("Widgets")}`, ...agentHandle({ handle: "widget-instance-back" }, { role: "link", label: "Back to Widgets" }), children: ["\u2190 ", t("Back")] }) }), _jsxs("div", { className: "page-header-text", children: [_jsx("p", { className: "page-kicker", children: t("Content") }), _jsx("h1", { className: "page-title", children: t(isNew ? "New widget" : "Edit widget") }), _jsx("p", { className: "page-description", children: t("Configure this widget's title and settings.") })] }), _jsxs("div", { className: "page-header-actions page-actions", children: [message ? _jsx("span", { className: "save-ok", children: message }) : null, error ? (_jsx("span", { className: "save-error", role: "alert", children: error })) : null, _jsx("button", { onClick: save, disabled: saving, ...agentHandle({ handle: "widget-instance-save" }, { role: "button", label: "Save this widget" }), children: saving ? t("Saving…") : t("Save") })] })] }), widget ? _jsx(WhereUsedBanner, { whereUsed: whereUsed, t: t }) : null, _jsxs("label", { className: "a11y-label-wrap", children: [_jsx("span", { className: "visually-hidden", children: t("Widget title") }), _jsx("input", { className: "editor-title", value: title, onChange: (e) => setTitle(e.target.value), placeholder: t("Widget title"), ...agentHandle({ handle: "widget-instance-title" }, { role: "field", label: "This widget's title" }) })] }), _jsxs("p", { className: "muted-cell", children: [t("Type:"), " ", widgetTypeLabel({ widgetType, types: widgetTypes }, { t })] }), _jsxs("div", { className: "widget-config-form", children: [_jsx(WidgetConfigFields, { widgetType: widgetType, config: config, onChange: setConfig, agentHandle: "widget-instance-config", t: sharedT }), fieldErrors.map((fe, i) => (_jsxs("p", { className: "save-error", role: "alert", children: [fe.field, ": ", fe.reason] }, i)))] })] }));
|
|
31
|
+
return (_jsxs("div", { className: "page", children: [_jsx(WidgetInstanceEditorHeader, { t: t, isNew: isNew, message: message, error: error, saving: saving, save: save, onBackClick: onBackClick }), widget ? _jsx(WhereUsedBanner, { whereUsed: whereUsed, t: t }) : null, _jsxs("label", { className: "a11y-label-wrap", children: [_jsx("span", { className: "visually-hidden", children: t("Widget title") }), _jsx("input", { className: "editor-title", value: title, onChange: (e) => setTitle(e.target.value), placeholder: t("Widget title"), ...agentHandle({ handle: "widget-instance-title" }, { role: "field", label: "This widget's title" }) })] }), _jsxs("p", { className: "muted-cell", children: [t("Type:"), " ", widgetTypeLabel({ widgetType, types: widgetTypes }, { t })] }), _jsxs("div", { className: "widget-config-form", children: [_jsx(WidgetConfigFields, { widgetType: widgetType, config: config, onChange: setConfig, agentHandle: "widget-instance-config", t: sharedT }), fieldErrors.map((fe, i) => (_jsxs("p", { className: "save-error", role: "alert", children: [fe.field, ": ", fe.reason] }, i)))] })] }));
|
|
34
32
|
}
|
|
35
33
|
export default WidgetInstanceEditor;
|
|
36
34
|
//# sourceMappingURL=WidgetInstanceEditor.js.map
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { useWidgetRegionEditorView } from '../hooks/page-views.hooks.js';
|
|
2
|
+
import { useWidgetsOptions } from '../hooks/WidgetsPorts.hooks.js';
|
|
1
3
|
import { useWiredWidgetRegionEditor } from "../hooks/use-widget-region-editor.hooks.js";
|
|
2
4
|
/**
|
|
3
5
|
* @file `RegionPlacementEditorScreen` + `RegionPlacementList` (`ui.spec.md` §2.5/§2.6/§3.7/§3.8/
|
|
@@ -15,8 +17,10 @@ export interface WidgetRegionEditorProps {
|
|
|
15
17
|
* Defaulted to the real hook, so production callers pass nothing and behave exactly as before.
|
|
16
18
|
*/
|
|
17
19
|
useWidgetRegionEditorHook?: typeof useWiredWidgetRegionEditor | undefined;
|
|
20
|
+
useWidgetRegionEditorViewHook?: typeof useWidgetRegionEditorView | undefined;
|
|
21
|
+
useWidgetsOptionsHook?: typeof useWidgetsOptions | undefined;
|
|
18
22
|
}
|
|
19
23
|
export { WidgetRegionEditorHeaderActions } from '../components/WidgetRegionEditorHeaderActions.js';
|
|
20
|
-
export declare function WidgetRegionEditor(
|
|
24
|
+
export declare function WidgetRegionEditor({ regionKey, useWidgetRegionEditorHook, useWidgetRegionEditorViewHook, useWidgetsOptionsHook }: WidgetRegionEditorProps): import("react").JSX.Element | null;
|
|
21
25
|
export default WidgetRegionEditor;
|
|
22
26
|
//# sourceMappingURL=WidgetRegionEditor.d.ts.map
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useWidgetRegionEditorView } from '../hooks/page-views.hooks.js';
|
|
3
|
+
import { RegionPlacementRow } from '../components/RegionPlacementRow.js';
|
|
4
|
+
import { WidgetRegionEditorHeader } from '../components/WidgetPageHeaders.js';
|
|
3
5
|
import { useWidgetsOptions } from '../hooks/WidgetsPorts.hooks.js';
|
|
4
|
-
import { agentHandle } from "@jini-ai/
|
|
6
|
+
import { agentHandle } from "@jini-ai/core/agent-handles";
|
|
5
7
|
import { useWiredWidgetRegionEditor } from "../hooks/use-widget-region-editor.hooks.js";
|
|
6
8
|
import { widgetTypeLabel } from "../../rules.js";
|
|
7
9
|
export { WidgetRegionEditorHeaderActions } from '../components/WidgetRegionEditorHeaderActions.js';
|
|
8
10
|
import { WidgetRegionEditorHeaderActions } from '../components/WidgetRegionEditorHeaderActions.js';
|
|
9
|
-
export function WidgetRegionEditor(
|
|
10
|
-
const { slots: { AddControl: WidgetAddControl }, widgetTypes } =
|
|
11
|
-
const {
|
|
12
|
-
const { area, placements, message, error, loading, saving, removeAt, moveAt, toggleEnabled, addPlacement, save, t, placementHandles } = useWidgetRegionEditorView({ regionKey, useWidgetRegionEditorHook });
|
|
11
|
+
export function WidgetRegionEditor({ regionKey, useWidgetRegionEditorHook = useWiredWidgetRegionEditor, useWidgetRegionEditorViewHook = useWidgetRegionEditorView, useWidgetsOptionsHook = useWidgetsOptions }) {
|
|
12
|
+
const { slots: { AddControl: WidgetAddControl }, widgetTypes } = useWidgetsOptionsHook();
|
|
13
|
+
const { area, placements, message, error, loading, saving, removeAt, moveAt, toggleEnabled, addPlacement, save, t, placementHandles } = useWidgetRegionEditorViewHook({ regionKey, useWidgetRegionEditorHook });
|
|
13
14
|
if (error && !area)
|
|
14
15
|
return _jsx("div", { className: "notice error", children: error });
|
|
15
16
|
if (loading)
|
|
16
17
|
return _jsx("div", { className: "notice", children: t("Loading region…") });
|
|
17
18
|
if (!area)
|
|
18
19
|
return null;
|
|
19
|
-
return (_jsxs("div", { className: "page", children: [_jsxs("div", { className: "
|
|
20
|
-
role: "region",
|
|
21
|
-
label: "Widget region editor header — the back link, the region's title, and the Save button",
|
|
22
|
-
}), children: [_jsx("div", { className: "page-header-lead", children: _jsxs("a", { className: "btn-secondary", href: "/admin/widgets/regions", "aria-label": `${t("Back")}: ${t("Regions")}`, ...agentHandle({ handle: "widget-region-editor-back" }, { role: "link", label: "Back to Widget Regions" }), children: ["\u2190 ", t("Back")] }) }), _jsxs("div", { className: "page-header-text", children: [_jsx("p", { className: "page-kicker", children: t("Content") }), _jsxs("h1", { className: "page-title", children: [t("Region:"), " ", regionKey] }), _jsx("p", { className: "page-description", children: t("Manage which widgets appear in this region and their order.") })] }), _jsx(WidgetRegionEditorHeaderActions, { message: message, error: error, saving: saving, onSave: save, t: t })] }), _jsxs("div", { className: "jini-widget-region-placements", children: [placements.length === 0 ? (_jsx("div", { className: "card", children: _jsx("div", { className: "empty-state", children: _jsx("p", { children: t("No widgets placed in this region yet.") }) }) })) : (placements.map((placement, i) => (_jsx("div", { className: "menu-item-row", children: _jsxs("div", { className: "menu-item-fields", children: [placement.broken ? (_jsx("span", { className: "widget-embed-node--broken", children: t("⚠ Broken reference") })) : (_jsxs("span", { children: [_jsx("strong", { children: placement.widgetTitle }), placement.widgetType ? (_jsxs(_Fragment, { children: [" ", _jsxs("span", { className: "muted-cell", children: ["(", widgetTypeLabel({ widgetType: placement.widgetType, types: widgetTypes }, { t }), ")"] })] })) : null] })), _jsxs("label", { children: [_jsx("input", { type: "checkbox", checked: placement.enabled, onChange: () => toggleEnabled(placement.placementId), ...agentHandle({ handle: `${placementHandles[i]}-enabled` }, { role: "field", label: `Whether "${placement.widgetTitle}" is enabled` }) }), t("Enabled")] }), _jsx("button", { className: "tb-btn", onClick: () => moveAt(i, -1), title: t("Move up"), "aria-label": t("Move up"), ...agentHandle({ handle: `${placementHandles[i]}-move-up` }, { role: "button", label: `Move "${placement.widgetTitle}" up` }), children: "\u2191" }), _jsx("button", { className: "tb-btn", onClick: () => moveAt(i, 1), title: t("Move down"), "aria-label": t("Move down"), ...agentHandle({ handle: `${placementHandles[i]}-move-down` }, { role: "button", label: `Move "${placement.widgetTitle}" down` }), children: "\u2193" }), _jsx("button", { className: "tb-btn", onClick: () => removeAt(placement.placementId), title: t("Remove"), "aria-label": t("Remove"), ...agentHandle({ handle: `${placementHandles[i]}-remove` }, { role: "button", label: `Remove "${placement.widgetTitle}" from this region` }), children: "\u2715" })] }) }, placement.placementId)))), _jsx(WidgetAddControl, { triggerLabel: t("+ Add widget"), onResolved: (widgetInstanceId) => addPlacement(widgetInstanceId), agentHandle: "widget-region-add" })] })] }));
|
|
20
|
+
return (_jsxs("div", { className: "page", children: [_jsx(WidgetRegionEditorHeader, { t: t, regionKey: regionKey, message: message, error: error, saving: saving, onSave: save }), _jsxs("div", { className: "jini-widget-region-placements", children: [placements.length === 0 ? (_jsx("div", { className: "card", children: _jsx("div", { className: "empty-state", children: _jsx("p", { children: t("No widgets placed in this region yet.") }) }) })) : (placements.map((placement, i) => (_jsx(RegionPlacementRow, { placement: placement, handle: placementHandles[i], widgetTypes: widgetTypes, t: t, toggleEnabled: toggleEnabled, moveUp: () => moveAt(i, -1), moveDown: () => moveAt(i, 1), remove: removeAt }, placement.placementId)))), _jsx(WidgetAddControl, { triggerLabel: t("+ Add widget"), onResolved: (widgetInstanceId) => addPlacement(widgetInstanceId), agentHandle: "widget-region-add" })] })] }));
|
|
23
21
|
}
|
|
24
22
|
export default WidgetRegionEditor;
|
|
25
23
|
//# sourceMappingURL=WidgetRegionEditor.js.map
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { useWidgetRegionsView } from '../hooks/page-views.hooks.js';
|
|
2
|
+
import { useWidgetsOptions } from '../hooks/WidgetsPorts.hooks.js';
|
|
1
3
|
import { useWiredWidgetRegions } from "../hooks/use-widget-regions.hooks.js";
|
|
2
4
|
/**
|
|
3
5
|
* @file `WidgetRegionsScreen` (`ui.spec.md` §2.4/§3.6/§4.5/§9) — `/admin/widgets/regions` — markup
|
|
@@ -15,7 +17,9 @@ export interface WidgetRegionsProps {
|
|
|
15
17
|
* Defaulted to the real hook, so production callers pass nothing and behave exactly as before.
|
|
16
18
|
*/
|
|
17
19
|
useWidgetRegionsHook?: typeof useWiredWidgetRegions | undefined;
|
|
20
|
+
useWidgetRegionsViewHook?: typeof useWidgetRegionsView | undefined;
|
|
21
|
+
useWidgetsOptionsHook?: typeof useWidgetsOptions | undefined;
|
|
18
22
|
}
|
|
19
|
-
export declare function WidgetRegions({ useWidgetRegionsHook }?: WidgetRegionsProps): import("react").JSX.Element;
|
|
23
|
+
export declare function WidgetRegions({ useWidgetRegionsHook, useWidgetRegionsViewHook, useWidgetsOptionsHook }?: WidgetRegionsProps): import("react").JSX.Element;
|
|
20
24
|
export default WidgetRegions;
|
|
21
25
|
//# sourceMappingURL=WidgetRegions.d.ts.map
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useWidgetRegionsView } from '../hooks/page-views.hooks.js';
|
|
3
|
+
import { WidgetRegionsHeader } from '../components/WidgetPageHeaders.js';
|
|
3
4
|
import { useWidgetsOptions } from '../hooks/WidgetsPorts.hooks.js';
|
|
4
5
|
import { DataTable } from "../../../react/components/DataTable.js";
|
|
5
|
-
import { agentHandle } from "@jini-ai/
|
|
6
|
+
import { agentHandle } from "@jini-ai/core/agent-handles";
|
|
6
7
|
import { useWiredWidgetRegions } from "../hooks/use-widget-regions.hooks.js";
|
|
7
|
-
export function WidgetRegions({ useWidgetRegionsHook = useWiredWidgetRegions } = {}) {
|
|
8
|
-
const { headerActions } =
|
|
9
|
-
const { regions, error, newRegionKey, setNewRegionKey, binding, bind, t, rowHandleByKey } =
|
|
8
|
+
export function WidgetRegions({ useWidgetRegionsHook = useWiredWidgetRegions, useWidgetRegionsViewHook = useWidgetRegionsView, useWidgetsOptionsHook = useWidgetsOptions } = {}) {
|
|
9
|
+
const { headerActions } = useWidgetsOptionsHook();
|
|
10
|
+
const { regions, error, newRegionKey, setNewRegionKey, binding, bind, t, rowHandleByKey } = useWidgetRegionsViewHook({ useWidgetRegionsHook });
|
|
10
11
|
if (error && !regions)
|
|
11
12
|
return _jsx("div", { className: "notice error", children: error });
|
|
12
13
|
if (!regions)
|
|
13
14
|
return _jsx("div", { className: "notice", children: t("Loading regions…") });
|
|
14
|
-
return (_jsxs("div", { className: "page", children: [
|
|
15
|
-
role: "region",
|
|
16
|
-
label: "Widget Regions header — the back link, the screen's title, and the bind-a-region control",
|
|
17
|
-
}), children: [_jsx("div", { className: "page-header-lead", children: _jsxs("a", { className: "btn-secondary", href: "/admin/widgets", "aria-label": `${t("Back")}: ${t("Widgets")}`, ...agentHandle({ handle: "widget-regions-back" }, { role: "link", label: "Back to Widgets" }), children: ["\u2190 ", t("Back")] }) }), _jsxs("div", { className: "page-header-text", children: [_jsx("p", { className: "page-kicker", children: t("Content") }), _jsx("h1", { className: "page-title", children: t("Widget Regions") }), _jsx("p", { className: "page-description", children: t('A region is a theme-declared placement area (e.g. "header", "footer", "sidebar"). Bind a region by its key to start placing widgets in it.') })] }), _jsxs("div", { className: "page-header-actions page-actions", children: [headerActions, _jsxs("div", { className: "widget-regions-bind", children: [_jsx("input", { value: newRegionKey, onChange: (e) => setNewRegionKey(e.target.value), placeholder: "e.g. footer", ...agentHandle({ handle: "widget-regions-new-key" }, { role: "field", label: "New region key to bind, e.g. footer" }) }), _jsx("button", { onClick: bind, disabled: binding || !newRegionKey.trim(), ...agentHandle({ handle: "widget-regions-bind" }, { role: "button", label: "Bind this region key" }), children: binding ? t("Binding…") : t("Bind region") })] })] })] }), error ? _jsx("div", { className: "notice error", children: error }) : null, _jsx(DataTable, { rows: regions, rowKey: (region) => region.regionKey, empty: _jsx("div", { className: "card", children: _jsx("div", { className: "empty-state", children: _jsx("p", { children: t("No regions bound yet.") }) }) }), columns: [
|
|
15
|
+
return (_jsxs("div", { className: "page", children: [_jsx(WidgetRegionsHeader, { t: t, headerActions: headerActions, newRegionKey: newRegionKey, setNewRegionKey: setNewRegionKey, binding: binding, bind: bind }), error ? _jsx("div", { className: "notice error", children: error }) : null, _jsx(DataTable, { rows: regions, rowKey: (region) => region.regionKey, empty: _jsx("div", { className: "card", children: _jsx("div", { className: "empty-state", children: _jsx("p", { children: t("No regions bound yet.") }) }) }), columns: [
|
|
18
16
|
{
|
|
19
17
|
key: "region-key",
|
|
20
18
|
header: t("Region key"),
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { useWidgetsLibraryView } from '../hooks/page-views.hooks.js';
|
|
2
|
+
import { useWidgetsOptions } from '../hooks/WidgetsPorts.hooks.js';
|
|
1
3
|
import { useWiredWidgetsLibrary } from "../hooks/use-widgets-library.hooks.js";
|
|
2
4
|
/**
|
|
3
5
|
* @file `WidgetsLibraryScreen` (`ui.spec.md` §2.1/§3.1/§4.1) — the widget library/list screen,
|
|
@@ -17,8 +19,10 @@ export interface WidgetsLibraryProps {
|
|
|
17
19
|
* Defaulted to the real hook, so production callers pass nothing and behave exactly as before.
|
|
18
20
|
*/
|
|
19
21
|
useWidgetsLibraryHook?: typeof useWiredWidgetsLibrary | undefined;
|
|
22
|
+
useWidgetsLibraryViewHook?: typeof useWidgetsLibraryView | undefined;
|
|
23
|
+
useWidgetsOptionsHook?: typeof useWidgetsOptions | undefined;
|
|
20
24
|
}
|
|
21
25
|
export { WidgetsLibraryNotices } from '../components/WidgetsLibraryNotices.js';
|
|
22
|
-
export declare function WidgetsLibrary({ useWidgetsLibraryHook }?: WidgetsLibraryProps): import("react").JSX.Element;
|
|
26
|
+
export declare function WidgetsLibrary({ useWidgetsLibraryHook, useWidgetsLibraryViewHook, useWidgetsOptionsHook }?: WidgetsLibraryProps): import("react").JSX.Element;
|
|
23
27
|
export default WidgetsLibrary;
|
|
24
28
|
//# sourceMappingURL=WidgetsLibrary.d.ts.map
|
|
@@ -1,61 +1,24 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useWidgetsLibraryView } from '../hooks/page-views.hooks.js';
|
|
3
|
+
import { TrashWidgetDialog } from '../components/TrashWidgetDialog.js';
|
|
4
|
+
import { widgetsLibraryColumns } from '../components/WidgetTableColumns.js';
|
|
5
|
+
import { WidgetsLibraryHeader } from '../components/WidgetPageHeaders.js';
|
|
3
6
|
import { useWidgetsOptions } from '../hooks/WidgetsPorts.hooks.js';
|
|
4
7
|
import {} from "../../models.js";
|
|
5
|
-
import { ConfirmDialog } from "../../../react/components/ConfirmDialog/ConfirmDialog.js";
|
|
6
8
|
import { DataTable } from "../../../react/components/DataTable.js";
|
|
7
|
-
import { agentHandle } from "@jini-ai/
|
|
9
|
+
import { agentHandle } from "@jini-ai/core/agent-handles";
|
|
8
10
|
import { widgetTypeLabel } from "../../rules.js";
|
|
9
11
|
import { useWiredWidgetsLibrary } from "../hooks/use-widgets-library.hooks.js";
|
|
10
12
|
export { WidgetsLibraryNotices } from '../components/WidgetsLibraryNotices.js';
|
|
11
13
|
import { WidgetsLibraryNotices } from '../components/WidgetsLibraryNotices.js';
|
|
12
|
-
export function WidgetsLibrary({ useWidgetsLibraryHook = useWiredWidgetsLibrary } = {}) {
|
|
13
|
-
const { widgetTypes, headerActions, statusLabel } =
|
|
14
|
-
const { widgets, error, skippedCount, skippedIds, createType, setCreateType, pendingTrash, trashing, requestTrash, confirmTrash, cancelTrash, t, rowHandleById, } =
|
|
14
|
+
export function WidgetsLibrary({ useWidgetsLibraryHook = useWiredWidgetsLibrary, useWidgetsLibraryViewHook = useWidgetsLibraryView, useWidgetsOptionsHook = useWidgetsOptions } = {}) {
|
|
15
|
+
const { widgetTypes, headerActions, statusLabel } = useWidgetsOptionsHook();
|
|
16
|
+
const { widgets, error, skippedCount, skippedIds, createType, setCreateType, pendingTrash, trashing, requestTrash, confirmTrash, cancelTrash, t, rowHandleById, } = useWidgetsLibraryViewHook({ useWidgetsLibraryHook });
|
|
15
17
|
if (error && !widgets)
|
|
16
18
|
return _jsx("div", { className: "notice error", children: error });
|
|
17
19
|
if (!widgets)
|
|
18
20
|
return _jsx("div", { className: "notice", children: t("Loading widgets…") });
|
|
19
|
-
return (_jsxs("div", { className: "page", children: [
|
|
20
|
-
{
|
|
21
|
-
key: "title",
|
|
22
|
-
header: t("Title"),
|
|
23
|
-
cell: (widget) => (_jsx("a", {
|
|
24
|
-
// Slug, not id (2026-09-22, URL-uses-slug — mirrors `FormsList.tsx`'s
|
|
25
|
-
// `/admin/forms/${form.slug}` row link): the editor resolves either
|
|
26
|
-
// (`read-service.ts`'s `getWidgetInstance`), but the slug is the readable one.
|
|
27
|
-
href: `/admin/widgets/${widget.slug}`, ...agentHandle({ handle: `${rowHandleById.get(widget.id)}-edit` }, { role: "link", label: `Edit the "${widget.title}" widget` }), children: widget.title })),
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
key: "type",
|
|
31
|
-
header: t("Type"),
|
|
32
|
-
cell: (widget) => widgetTypeLabel({ widgetType: widget.widgetType, types: widgetTypes }, { t }),
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
key: "slug",
|
|
36
|
-
header: t("Slug"),
|
|
37
|
-
// Monospace like Collections' "Key" column (`Collections.tsx`) — a slug is an
|
|
38
|
-
// identifier, not prose.
|
|
39
|
-
cell: (widget) => _jsx("code", { children: widget.slug }),
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
key: "status",
|
|
43
|
-
header: t("Status"),
|
|
44
|
-
cell: (widget) => _jsx("span", { className: `status status-${widget.status}`, children: (statusLabel ?? t)(widget.status) }),
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
key: "actions",
|
|
48
|
-
// Not converted to a `RowMenu` — this is the row's only action (see report: a menu
|
|
49
|
-
// with one item is pure overhead over a direct button). Still labeled for
|
|
50
|
-
// accessibility, matching `Roles.tsx`/`Users.tsx`'s existing pattern for an actions
|
|
51
|
-
// column that isn't a bare `<th></th>`.
|
|
52
|
-
headerLabel: t("Actions"),
|
|
53
|
-
cell: (widget) => (_jsx("button", { onClick: () => requestTrash(widget), ...agentHandle({ handle: `${rowHandleById.get(widget.id)}-trash` }, {
|
|
54
|
-
role: "button",
|
|
55
|
-
label: `Move "${widget.title}" to trash`,
|
|
56
|
-
}), children: t("Trash") })),
|
|
57
|
-
},
|
|
58
|
-
] }), _jsx(ConfirmDialog, { open: pendingTrash !== null, agentHandle: "widgets-trash", title: t("Move to trash?"), body: pendingTrash ? _jsx("p", { children: t('Move "{title}" to trash?').replace("{title}", pendingTrash.title) }) : null, confirmLabel: t("Move to trash"), destructive: true, pending: trashing, onConfirm: confirmTrash, onCancel: cancelTrash })] }));
|
|
21
|
+
return (_jsxs("div", { className: "page", children: [_jsx(WidgetsLibraryHeader, { t: t, headerActions: headerActions, createType: createType, setCreateType: setCreateType, widgetTypes: widgetTypes }), _jsx(WidgetsLibraryNotices, { error: error, skippedCount: skippedCount, skippedIds: skippedIds, t: t }), _jsx(DataTable, { rows: widgets, rowKey: (widget) => widget.id, empty: _jsx("div", { className: "card", children: _jsxs("div", { className: "empty-state", children: [_jsx("p", { children: t("No widgets yet.") }), _jsx("p", { className: "page-description", children: t("Create one above to get started.") })] }) }), columns: widgetsLibraryColumns({ t, widgetTypes, statusLabel, rowHandleById, requestTrash }) }), _jsx(TrashWidgetDialog, { t: t, pendingTrash: pendingTrash, trashing: trashing, confirmTrash: confirmTrash, cancelTrash: cancelTrash })] }));
|
|
59
22
|
}
|
|
60
23
|
export default WidgetsLibrary;
|
|
61
24
|
//# sourceMappingURL=WidgetsLibrary.js.map
|
package/dist/widgets/rules.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdminApiError } from '
|
|
1
|
+
import { AdminApiError } from '@jini-ai/core/admin-runtime';
|
|
2
2
|
import type { AdminWidget, AdminWidgetPlacement, AdminWidgetType, WidgetTypeOption, WidgetsTranslate, WidgetSlugRedirectPath, WidgetEditorParams } from './models.js';
|
|
3
3
|
export declare const WIDGETS_LIBRARY_RESOURCE = "widgets-library";
|
|
4
4
|
export declare const WIDGETS_REGIONS_RESOURCE = "widgets-regions";
|
|
@@ -36,10 +36,12 @@ export declare function movePlacement<T>({ items, index, direction }: {
|
|
|
36
36
|
index: number;
|
|
37
37
|
direction: -1 | 1;
|
|
38
38
|
}, _optional?: Record<string, never>): T[];
|
|
39
|
-
/** Draft identity survives reorder/remove/toggle until the server accepts the ordered placements.
|
|
39
|
+
/** Draft identity survives reorder/remove/toggle until the server accepts the ordered placements.
|
|
40
|
+
* Entropy distinguishes draft keys created in the same millisecond without randomUUID. */
|
|
40
41
|
export declare function buildDraftPlacement({ widgetInstanceId }: {
|
|
41
42
|
widgetInstanceId: string;
|
|
42
|
-
}, { id }?: {
|
|
43
|
+
}, { random, id }?: {
|
|
44
|
+
random?: (() => number) | undefined;
|
|
43
45
|
id?: (() => string) | undefined;
|
|
44
46
|
}): AdminWidgetPlacement;
|
|
45
47
|
export interface WidgetSaveErrorOutcome {
|
package/dist/widgets/rules.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdminApiError, describeApiError } from '
|
|
1
|
+
import { AdminApiError, describeApiError } from '@jini-ai/core/admin-runtime';
|
|
2
2
|
import { widgetsEnglish } from './messages.en.js';
|
|
3
3
|
export const WIDGETS_LIBRARY_RESOURCE = 'widgets-library';
|
|
4
4
|
// Regions are a separate list; placement editors use baseVersion rather than live refresh.
|
|
@@ -41,14 +41,9 @@ export function movePlacement({ items, index, direction }, _optional = {}) {
|
|
|
41
41
|
[next[index], next[target]] = [next[target], next[index]];
|
|
42
42
|
return next;
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
function
|
|
47
|
-
draftPlacementSequence += 1;
|
|
48
|
-
return `p-${Date.now()}-${draftPlacementSequence}`;
|
|
49
|
-
}
|
|
50
|
-
/** Draft identity survives reorder/remove/toggle until the server accepts the ordered placements. */
|
|
51
|
-
export function buildDraftPlacement({ widgetInstanceId }, { id = () => globalThis.crypto?.randomUUID?.() ?? fallbackDraftPlacementId() } = {}) {
|
|
44
|
+
/** Draft identity survives reorder/remove/toggle until the server accepts the ordered placements.
|
|
45
|
+
* Entropy distinguishes draft keys created in the same millisecond without randomUUID. */
|
|
46
|
+
export function buildDraftPlacement({ widgetInstanceId }, { random = Math.random, id = () => globalThis.crypto?.randomUUID?.() ?? `p-${Date.now()}-${Math.floor(random() * Number.MAX_SAFE_INTEGER)}` } = {}) {
|
|
52
47
|
return { placementId: id(), widgetEntryId: widgetInstanceId, enabled: true, widgetTitle: null, widgetType: null, broken: false };
|
|
53
48
|
}
|
|
54
49
|
/** Conflict copy is domain-specific; other failures use the existing admin error describer. */
|
|
@@ -9,11 +9,11 @@ export declare const widgetsEditorPaths: readonly ["/widgets/new", "/widgets/:wi
|
|
|
9
9
|
export declare const widgetsModule: {
|
|
10
10
|
readonly id: "widgets";
|
|
11
11
|
readonly requires: {
|
|
12
|
-
readonly widgetsApi: import("
|
|
12
|
+
readonly widgetsApi: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("./ports.js").AdminWidgetsPort, "admin.widgets.api">;
|
|
13
13
|
};
|
|
14
14
|
readonly optional: {
|
|
15
|
-
readonly widgetsEvents: import("
|
|
16
|
-
readonly widgetsNavigation: import("
|
|
15
|
+
readonly widgetsEvents: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("./ports.js").WidgetsEventsPort, "admin.widgets.events">;
|
|
16
|
+
readonly widgetsNavigation: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("./ports.js").WidgetsNavigationPort, "admin.widgets.navigation">;
|
|
17
17
|
};
|
|
18
18
|
readonly messages: {
|
|
19
19
|
readonly Back: "Back";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineAdminModule } from '
|
|
1
|
+
import { defineAdminModule } from '@jini-ai/core/contracts/admin-module';
|
|
2
2
|
import { widgetsApiToken, widgetsEventsToken, widgetsNavigationToken } from './ports.js';
|
|
3
3
|
import { widgetsMessagesEn } from './messages.en.js';
|
|
4
4
|
// Region pages share the host agent id; route-specific module page ids do not replace it.
|