@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
package/dist/media/rules.js
CHANGED
|
@@ -91,18 +91,6 @@ function isRetryableHttpStatus({ status }, _optional = {}) {
|
|
|
91
91
|
export function parseOptionalPixelSize({ value }, _optional = {}) {
|
|
92
92
|
return value.trim() === '' ? null : Number(value);
|
|
93
93
|
}
|
|
94
|
-
/** 1024-based to agree with upload limits. Whole B/KB, one decimal MB/GB distinguishes
|
|
95
|
-
* similarly sized clips; locale controls the decimal separator, never a hardcoded dot. */
|
|
96
|
-
export function formatByteSize({ bytes }, { locale = 'en-US' } = {}) {
|
|
97
|
-
if (bytes < 1024)
|
|
98
|
-
return `${Math.round(bytes)} B`;
|
|
99
|
-
const kb = bytes / 1024;
|
|
100
|
-
if (kb < 1024)
|
|
101
|
-
return `${Math.round(kb)} KB`;
|
|
102
|
-
const decimal = new Intl.NumberFormat(locale, { minimumFractionDigits: 1, maximumFractionDigits: 1 });
|
|
103
|
-
const mb = kb / 1024;
|
|
104
|
-
return mb < 1024 ? `${decimal.format(mb)} MB` : `${decimal.format(mb / 1024)} GB`;
|
|
105
|
-
}
|
|
106
94
|
/** The extension each sniffed media type is stored as; JPEG shows as the common ".jpg". */
|
|
107
95
|
const MEDIA_EXTENSION_BY_CONTENT_TYPE = {
|
|
108
96
|
'image/png': 'png', 'image/jpeg': 'jpg', 'image/gif': 'gif', 'image/webp': 'webp', 'image/avif': 'avif',
|
|
@@ -4,10 +4,10 @@ export declare function createPlaygroundController({ targets, permissions }: {
|
|
|
4
4
|
targets: PlaygroundRenderTargetPort;
|
|
5
5
|
permissions?: readonly string[];
|
|
6
6
|
}, _optional?: {}): {
|
|
7
|
-
getSnapshot: () =>
|
|
8
|
-
subscribe: (
|
|
7
|
+
getSnapshot: (required?: Record<string, never>, optional?: Record<string, never>) => PlaygroundState;
|
|
8
|
+
subscribe: (required: {
|
|
9
9
|
listener: () => void;
|
|
10
|
-
}) => () => void;
|
|
10
|
+
}, optional?: Record<string, never>) => () => void;
|
|
11
11
|
attach({ target }: {
|
|
12
12
|
target: object | null;
|
|
13
13
|
}, _optional?: {}): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createControllerStore } from '
|
|
1
|
+
import { createControllerStore } from '@jini-ai/core/admin-runtime';
|
|
2
2
|
import { canMountPlayground } from '../rules.js';
|
|
3
3
|
export function createPlaygroundController({ targets, permissions = [] }, _optional = {}) {
|
|
4
4
|
const store = createControllerStore({ initial: { attached: false } });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const playgroundModule: {
|
|
2
2
|
readonly id: "playground";
|
|
3
3
|
readonly requires: {
|
|
4
|
-
readonly playgroundTargets: import("
|
|
4
|
+
readonly playgroundTargets: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
|
|
5
5
|
};
|
|
6
6
|
readonly messages: Readonly<{
|
|
7
7
|
title: "Playground";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineAdminModule } from '
|
|
1
|
+
import { defineAdminModule } from '@jini-ai/core/contracts/admin-module';
|
|
2
2
|
import { playgroundRenderTargetToken } from '../contracts/playground-render-target.js';
|
|
3
3
|
import { playgroundMessagesEn } from './messages.en.js';
|
|
4
4
|
export const playgroundModule = defineAdminModule({ id: 'playground', requires: { playgroundTargets: playgroundRenderTargetToken }, messages: playgroundMessagesEn, pages: { playground: { path: '/playground', label: playgroundMessagesEn.title, permissions: ['playground.read'], nav: { group: 'studio', icon: 'canvas' }, tabs: { canvas: { label: playgroundMessagesEn.canvas } } } } });
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import type { TabViewProps } from '
|
|
2
|
-
|
|
1
|
+
import type { TabViewProps } from '@jini-ai/core/contracts/admin-module';
|
|
2
|
+
import { useCanvas } from '../hooks/Canvas.hooks.js';
|
|
3
|
+
export declare function Canvas({ useCanvasHook, ...props }: TabViewProps & {
|
|
4
|
+
useCanvasHook?: typeof useCanvas;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
3
6
|
//# sourceMappingURL=Canvas.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Notice } from '
|
|
2
|
+
import { Notice } from '../../../react/kit.js';
|
|
3
3
|
import { useCanvas } from '../hooks/Canvas.hooks.js';
|
|
4
4
|
import { playgroundMessagesEn as m } from '../../messages.en.js';
|
|
5
|
-
export function Canvas(
|
|
6
|
-
const vm =
|
|
5
|
+
export function Canvas({ useCanvasHook = useCanvas, ...props }) {
|
|
6
|
+
const vm = useCanvasHook(props);
|
|
7
7
|
return vm.denied ? _jsx(Notice, { tone: "danger", children: m.denied }) : _jsxs("section", { children: [_jsx("h2", { children: m.canvas }), _jsx("style", { children: vm.styles }), _jsx("div", { "data-jini-part": "playground.canvas", className: "jini-playground-canvas", ref: vm.registerCanvas }), _jsx("p", { "data-jini-part": "playground.empty", className: "jini-playground-empty", children: m.empty })] });
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=Canvas.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TabViewProps } from '
|
|
1
|
+
import type { TabViewProps } from '@jini-ai/core/contracts/admin-module';
|
|
2
2
|
export declare function useCanvas({ permissions }: TabViewProps, _optional?: {}): {
|
|
3
3
|
denied: boolean;
|
|
4
4
|
registerCanvas: (node: HTMLDivElement | null) => void | undefined;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { ModulePageProps, TabViewProps } from '@jini-ai/core/contracts/admin-module';
|
|
3
|
+
/** The shell passes this page its tabs as renderable components. */
|
|
4
|
+
type TabbedPageProps = ModulePageProps<ComponentType<TabViewProps>>;
|
|
5
|
+
export declare function usePlaygroundPage(props: TabbedPageProps, _optional?: {}): {
|
|
3
6
|
denied: boolean;
|
|
4
|
-
ActiveTab:
|
|
7
|
+
ActiveTab: ComponentType<TabViewProps> | undefined;
|
|
5
8
|
params: Readonly<Record<string, unknown>>;
|
|
6
9
|
permissions: readonly string[];
|
|
7
10
|
};
|
|
11
|
+
export {};
|
|
8
12
|
//# sourceMappingURL=PlaygroundPage.hooks.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext, useContext } from 'react';
|
|
2
|
-
import { AdminConfigError } from '
|
|
2
|
+
import { AdminConfigError } from '@jini-ai/core/admin-runtime';
|
|
3
3
|
export const PlaygroundPortsContext = createContext(null);
|
|
4
4
|
export function usePlaygroundPorts(_required = {}, _optional = {}) {
|
|
5
5
|
const ports = useContext(PlaygroundPortsContext);
|
|
@@ -2,7 +2,7 @@ export { usePlaygroundPorts } from './hooks/PlaygroundPorts.hooks.js';
|
|
|
2
2
|
export declare function playground(_required: Record<string, never>, _optional?: {}): {
|
|
3
3
|
id: "playground";
|
|
4
4
|
requires: {
|
|
5
|
-
readonly playgroundTargets: import("
|
|
5
|
+
readonly playgroundTargets: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
|
|
6
6
|
};
|
|
7
7
|
messages: Readonly<{
|
|
8
8
|
title: "Playground";
|
|
@@ -33,7 +33,7 @@ export declare function playground(_required: Record<string, never>, _optional?:
|
|
|
33
33
|
module: {
|
|
34
34
|
id: "playground";
|
|
35
35
|
requires: {
|
|
36
|
-
readonly playgroundTargets: import("
|
|
36
|
+
readonly playgroundTargets: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
|
|
37
37
|
};
|
|
38
38
|
messages: Readonly<{
|
|
39
39
|
title: "Playground";
|
|
@@ -62,19 +62,19 @@ export declare function playground(_required: Record<string, never>, _optional?:
|
|
|
62
62
|
};
|
|
63
63
|
pages: {
|
|
64
64
|
readonly playground: {
|
|
65
|
-
Page: import("react").LazyExoticComponent<import("react").ComponentType<import("../../react/bind-react.js").
|
|
65
|
+
Page: import("react").LazyExoticComponent<import("react").ComponentType<import("@jini-ai/core/contracts/admin-module").ModulePageProps<import("../../core/react/bind-react.js").LazyTabView>>>;
|
|
66
66
|
tabs: {
|
|
67
|
-
readonly canvas: import("
|
|
67
|
+
readonly canvas: import("../../core/react/bind-react.js").LazyTabView;
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
71
|
Provider: ({ admin, children }: {
|
|
72
|
-
admin: import("
|
|
72
|
+
admin: import("@jini-ai/core/contracts/admin-module").AdminInstance;
|
|
73
73
|
children: import("react").ReactNode;
|
|
74
|
-
}, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<import("
|
|
74
|
+
}, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<import("@jini-ai/core/contracts/admin-module").ScopedPorts<{
|
|
75
75
|
id: "playground";
|
|
76
76
|
requires: {
|
|
77
|
-
readonly playgroundTargets: import("
|
|
77
|
+
readonly playgroundTargets: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
|
|
78
78
|
};
|
|
79
79
|
messages: Readonly<{
|
|
80
80
|
title: "Playground";
|
|
@@ -101,10 +101,10 @@ export declare function playground(_required: Record<string, never>, _optional?:
|
|
|
101
101
|
};
|
|
102
102
|
};
|
|
103
103
|
}> | null>>;
|
|
104
|
-
usePorts: (_required?: Record<string, never>, _optional?: Record<string, never>) => import("
|
|
104
|
+
usePorts: (_required?: Record<string, never>, _optional?: Record<string, never>) => import("@jini-ai/core/contracts/admin-module").ScopedPorts<{
|
|
105
105
|
id: "playground";
|
|
106
106
|
requires: {
|
|
107
|
-
readonly playgroundTargets: import("
|
|
107
|
+
readonly playgroundTargets: import("@jini-ai/core/contracts/admin-module").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
|
|
108
108
|
};
|
|
109
109
|
messages: Readonly<{
|
|
110
110
|
title: "Playground";
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { ModulePageProps, TabViewProps } from '@jini-ai/core/contracts/admin-module';
|
|
3
|
+
import { usePlaygroundPage } from '../hooks/PlaygroundPage.hooks.js';
|
|
4
|
+
/** The shell passes this page its tabs as renderable components. */
|
|
5
|
+
type TabbedPageProps = ModulePageProps<ComponentType<TabViewProps>>;
|
|
6
|
+
export declare function PlaygroundPage({ usePlaygroundPageHook, ...props }: TabbedPageProps & {
|
|
7
|
+
usePlaygroundPageHook?: typeof usePlaygroundPage;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
3
9
|
export default PlaygroundPage;
|
|
4
10
|
//# sourceMappingURL=PlaygroundPage.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Suspense } from 'react';
|
|
3
|
-
import { Notice, Spinner } from '
|
|
3
|
+
import { Notice, Spinner } from '../../../react/kit.js';
|
|
4
4
|
import { usePlaygroundPage } from '../hooks/PlaygroundPage.hooks.js';
|
|
5
5
|
import { playgroundMessagesEn as m } from '../../messages.en.js';
|
|
6
|
-
export function PlaygroundPage(
|
|
7
|
-
const vm =
|
|
6
|
+
export function PlaygroundPage({ usePlaygroundPageHook = usePlaygroundPage, ...props }) {
|
|
7
|
+
const vm = usePlaygroundPageHook(props);
|
|
8
8
|
return _jsxs("section", { "data-jini-part": "playground.page", children: [_jsx("p", { children: m.studio }), _jsx("h1", { children: props.description.label }), vm.denied ? _jsx(Notice, { tone: "danger", children: m.denied }) : _jsxs(_Fragment, { children: [_jsx("p", { children: m.description }), _jsx(Suspense, { fallback: _jsx(Spinner, { label: "Loading canvas\u2026" }), children: vm.ActiveTab && _jsx(vm.ActiveTab, { params: vm.params, permissions: vm.permissions }) })] })] });
|
|
9
9
|
}
|
|
10
10
|
export default PlaygroundPage;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TabViewProps } from '
|
|
2
|
-
export declare function CanvasTab(props: TabViewProps
|
|
1
|
+
import type { TabViewProps } from '@jini-ai/core/contracts/admin-module';
|
|
2
|
+
export declare function CanvasTab(props: TabViewProps): import("react").JSX.Element;
|
|
3
3
|
export default CanvasTab;
|
|
4
4
|
//# sourceMappingURL=CanvasTab.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Canvas } from '../components/Canvas.js';
|
|
3
|
-
export function CanvasTab(props
|
|
3
|
+
export function CanvasTab(props) { return _jsx(Canvas, { ...props }); }
|
|
4
4
|
export default CanvasTab;
|
|
5
5
|
//# sourceMappingURL=CanvasTab.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { useOverlayHost } from './OverlayHost.hooks.js';
|
|
1
2
|
import type { OverlayHostProps } from './OverlayHost.hooks.js';
|
|
2
|
-
export declare function OverlayHost(props: OverlayHostProps
|
|
3
|
+
export declare function OverlayHost({ useOverlayHostHook, ...props }: OverlayHostProps & {
|
|
4
|
+
useOverlayHostHook?: typeof useOverlayHost;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
3
6
|
//# sourceMappingURL=OverlayHost.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useOverlayHost } from './OverlayHost.hooks.js';
|
|
3
|
-
export function OverlayHost(
|
|
4
|
-
const entries =
|
|
3
|
+
export function OverlayHost({ useOverlayHostHook = useOverlayHost, ...props }) {
|
|
4
|
+
const entries = useOverlayHostHook(props);
|
|
5
5
|
return (_jsx("div", { "data-jini-part": "admin.overlays", children: entries.map((entry) => (_jsx("div", { children: entry.content }, entry.id))) }));
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=OverlayHost.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { type ConfirmTone } from '../../types.js';
|
|
3
|
-
import { type UseConfirmDialog } from './ConfirmDialog.hooks.js';
|
|
3
|
+
import { useConfirmDialogCancelLabel, type UseConfirmDialog } from './ConfirmDialog.hooks.js';
|
|
4
4
|
/**
|
|
5
5
|
* @file Shared modal confirmation primitive — the replacement for `window.confirm`, which blocks
|
|
6
6
|
* the whole tab, cannot carry destructive-vs-neutral styling, and reads as a browser artifact
|
|
@@ -90,6 +90,14 @@ export interface ConfirmDialogProps {
|
|
|
90
90
|
* effect without `agentHandle`. @default true */
|
|
91
91
|
agentMayConfirm?: boolean;
|
|
92
92
|
}
|
|
93
|
+
/** Hooks ConfirmDialog calls; defaults to the real ones, a test hands in fakes. */
|
|
94
|
+
export declare const defaultConfirmDialogHooks: {
|
|
95
|
+
useConfirmDialogCancelLabel: typeof useConfirmDialogCancelLabel;
|
|
96
|
+
useConfirmController: (required: import("../../kit.js").KitConfirmDialogProps, optional?: {
|
|
97
|
+
agent?: import("../../kit.js").AgentAttrsPort;
|
|
98
|
+
}) => import("../../kit.js").ConfirmControllerView;
|
|
99
|
+
};
|
|
100
|
+
export type ConfirmDialogHooks = typeof defaultConfirmDialogHooks;
|
|
93
101
|
/**
|
|
94
102
|
* UI-kit's confirmation planner owns the sub-handle segments appended to the caller's base:
|
|
95
103
|
* literals chosen by the mechanism, never host data. Neither needs sanitizing, unlike
|
|
@@ -116,5 +124,7 @@ export interface ConfirmDialogProps {
|
|
|
116
124
|
* is no browser-assigned "default button" for Enter to reach for at all; confirm can only ever fire
|
|
117
125
|
* from an explicit click or explicit Tab-then-Enter onto it.
|
|
118
126
|
*/
|
|
119
|
-
export declare function ConfirmDialog({ useDialog, agentHandle: baseHandle, agentMayConfirm, ...props }: ConfirmDialogProps
|
|
127
|
+
export declare function ConfirmDialog({ useDialog, agentHandle: baseHandle, agentMayConfirm, hooks, ...props }: ConfirmDialogProps & {
|
|
128
|
+
hooks?: ConfirmDialogHooks | undefined;
|
|
129
|
+
}, _optional?: Record<string, never>): import("react").JSX.Element;
|
|
120
130
|
//# sourceMappingURL=ConfirmDialog.d.ts.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useContext, useMemo, useRef, } from 'react';
|
|
3
|
-
import { useNativeDialog } from '
|
|
4
|
-
import { useFocusTrap } from '@jini-ai/ui/panel-kit';
|
|
3
|
+
import { useNativeDialog, useFocusTrap } from '../../kit.js';
|
|
5
4
|
/** Empty object, not `undefined` — {@link useConfirmDialogCancelLabel} can always read `cancelLabel`
|
|
6
5
|
* off it without an extra null check, whether or not a provider is mounted. */
|
|
7
6
|
const ConfirmDialogDefaultsContext = createContext({});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useConfirmController } from '
|
|
2
|
+
import { useConfirmController } from '../../kit.js';
|
|
3
3
|
import { resolveTone, toneClassName } from '../../types.js';
|
|
4
4
|
import { useConfirmDialog, useConfirmDialogCancelLabel } from './ConfirmDialog.hooks.js';
|
|
5
5
|
import { confirmDialogAgentAttrs, withoutAccessibleName } from './confirm-dialog-attrs.js';
|
|
6
|
+
/** Hooks ConfirmDialog calls; defaults to the real ones, a test hands in fakes. */
|
|
7
|
+
export const defaultConfirmDialogHooks = { useConfirmDialogCancelLabel, useConfirmController };
|
|
6
8
|
/**
|
|
7
9
|
* UI-kit's confirmation planner owns the sub-handle segments appended to the caller's base:
|
|
8
10
|
* literals chosen by the mechanism, never host data. Neither needs sanitizing, unlike
|
|
@@ -29,10 +31,10 @@ import { confirmDialogAgentAttrs, withoutAccessibleName } from './confirm-dialog
|
|
|
29
31
|
* is no browser-assigned "default button" for Enter to reach for at all; confirm can only ever fire
|
|
30
32
|
* from an explicit click or explicit Tab-then-Enter onto it.
|
|
31
33
|
*/
|
|
32
|
-
export function ConfirmDialog({ useDialog = useConfirmDialog, agentHandle: baseHandle, agentMayConfirm = true, ...props }, _optional = {}) {
|
|
34
|
+
export function ConfirmDialog({ useDialog = useConfirmDialog, agentHandle: baseHandle, agentMayConfirm = true, hooks = defaultConfirmDialogHooks, ...props }, _optional = {}) {
|
|
33
35
|
const tone = resolveTone({}, props);
|
|
34
|
-
const cancelLabel = useConfirmDialogCancelLabel({}, { explicit: props.cancelLabel });
|
|
35
|
-
const controller = useConfirmController({
|
|
36
|
+
const cancelLabel = hooks.useConfirmDialogCancelLabel({}, { explicit: props.cancelLabel });
|
|
37
|
+
const controller = hooks.useConfirmController({
|
|
36
38
|
open: props.open, title: props.title, body: props.body, confirmLabel: props.confirmLabel,
|
|
37
39
|
cancelLabel, tone, agentMayConfirm,
|
|
38
40
|
...(baseHandle === undefined ? {} : { agentHandle: baseHandle }),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentAttrsPort, KitAttrs } from '
|
|
1
|
+
import type { AgentAttrsPort, KitAttrs } from '../../kit.js';
|
|
2
2
|
/**
|
|
3
3
|
* The agent-attribute port `ConfirmDialog` hands UI-kit's confirm controller. UI-kit names selects
|
|
4
4
|
* separately; agentic publishes them as fields and still owns handle validation. Absent role/label
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { agentHandle } from '@jini-ai/
|
|
1
|
+
import { agentHandle } from '@jini-ai/core/agent-handles';
|
|
2
2
|
import { omitKeys } from '../../../core/omit-keys.js';
|
|
3
3
|
/**
|
|
4
4
|
* The agent-attribute port `ConfirmDialog` hands UI-kit's confirm controller. UI-kit names selects
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CanvasEmbedPlaceholderDescriptor, type
|
|
1
|
+
import { type CanvasEmbedPlaceholderDescriptor, type HtmlEditorProps } from '../../kit.js';
|
|
2
2
|
/** True when `el` carries any embed marker attribute this convention recognizes — exported for
|
|
3
3
|
* direct unit-testability without mounting the editor. Uses `hasAttributeOnAnyNodeShape` because
|
|
4
4
|
* the `isProtectedElement` predicate is invoked from inside GrapesJS's `isComponent` callback,
|
|
@@ -7,7 +7,7 @@ export declare function isProtectedEmbedElement({ el }: {
|
|
|
7
7
|
readonly el: Element;
|
|
8
8
|
}): boolean;
|
|
9
9
|
/**
|
|
10
|
-
* Recognizes a `data-embed-config` marker (the consuming product's own `src/
|
|
10
|
+
* Recognizes a `data-embed-config` marker (the consuming product's own `packages/cms/src/widgets/markers/marker.ts`'s single scanner
|
|
11
11
|
* convention) on a live canvas element and describes it for `@jini-ai/ui/html-editor`'s
|
|
12
12
|
* `applyCanvasEmbedPlaceholders` — see that function's own file header for what it does with the
|
|
13
13
|
* result. Exported for direct unit-testability without mounting the editor, same convention
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { HtmlEditor, } from '../../kit.js';
|
|
3
|
+
import { hasAttributeOnAnyNodeShape } from '@jini-ai/core/primitives';
|
|
3
4
|
/**
|
|
4
5
|
* @file Consuming-product-specific composition of `@jini-ai/ui/html-editor`'s generic
|
|
5
6
|
* `InteractiveHtmlEditor`: a page editor's `body_html`
|
|
@@ -20,10 +21,10 @@ import { InteractiveHtmlEditor as HtmlEditor, hasAttributeOnAnyNodeShape, } from
|
|
|
20
21
|
*/
|
|
21
22
|
/** The attribute either the current (`data-embed-type`) or legacy (`data-widget-embed`,
|
|
22
23
|
* `data-form-embed`) convention uses to mark a Page HTML embed placeholder div — see the
|
|
23
|
-
*
|
|
24
|
+
* legacy embed marker convention this protects.
|
|
24
25
|
*
|
|
25
26
|
* **Does NOT include `data-embed-config`, the CURRENT marker attribute** (the consuming product's own
|
|
26
|
-
* `src/
|
|
27
|
+
* `packages/cms/src/widgets/markers/marker.ts`) — a known, separately-tracked gap: an embed marker written the current way is still
|
|
27
28
|
* editable/draggable/removable in this editor today. Left alone here deliberately (out of scope for
|
|
28
29
|
* the placeholder-card feature this file's `describeEmbedPlaceholder` was added for); widening this
|
|
29
30
|
* list to close that gap is a one-line fix (`'data-embed-config'` added below) but changes real
|
|
@@ -35,11 +36,11 @@ const EMBED_MARKER_ATTRIBUTES = ['data-embed-type', 'data-widget-embed', 'data-f
|
|
|
35
36
|
* the `isProtectedElement` predicate is invoked from inside GrapesJS's `isComponent` callback,
|
|
36
37
|
* which is not always called with a real DOM `Element` — see that helper's own doc. */
|
|
37
38
|
export function isProtectedEmbedElement({ el }) {
|
|
38
|
-
return EMBED_MARKER_ATTRIBUTES.some((attr) => hasAttributeOnAnyNodeShape(el, attr));
|
|
39
|
+
return EMBED_MARKER_ATTRIBUTES.some((attr) => hasAttributeOnAnyNodeShape({ node: el, attribute: attr }));
|
|
39
40
|
}
|
|
40
41
|
/**
|
|
41
42
|
* Friendly card headings for every embed `type` value this codebase names anywhere, split into two
|
|
42
|
-
* groups (traced against the
|
|
43
|
+
* groups (traced against the host app's `src/server/inbound/public-http/http/site/render.ts`'s `renderHtmlPageBody`/`isPageEmbedType`
|
|
43
44
|
* at the owner's own request, 2026-08-25 — authoritative, not re-derived):
|
|
44
45
|
*
|
|
45
46
|
* - **`media`, `widget`, `post`, `content`** — the ONLY four types `isPageEmbedType` (gating
|
|
@@ -61,10 +62,10 @@ export function isProtectedEmbedElement({ el }) {
|
|
|
61
62
|
* or guessing from the id string, which is not a real signal and would be actively misleading if wrong.
|
|
62
63
|
* "Media" stays correct for both until a cheap, real signal exists.
|
|
63
64
|
*
|
|
64
|
-
* Matched lower-cased — see `identityLabel`'s doc and `
|
|
65
|
+
* Matched lower-cased — see `identityLabel`'s doc and `packages/cms/src/widgets/html/html-embeds.ts`'s own `toEmbedRef` for
|
|
65
66
|
* why the server-side scanner lower-cases `type` the same way. An unregistered type is not an error
|
|
66
67
|
* here (unlike a rejected/unparseable marker) — `type` is deliberately a free string end-to-end (see
|
|
67
|
-
* the consuming product's own `src/widgets/html-embeds.ts`'s file header) precisely so a new one (a marketplace theme
|
|
68
|
+
* the consuming product's own `packages/cms/src/widgets/html/html-embeds.ts`'s file header) precisely so a new one (a marketplace theme
|
|
68
69
|
* introducing its own, say) never requires a matching change on this list AND never renders nothing —
|
|
69
70
|
* `titleCase` below covers it with a still-legible generic card instead of a blank/thrown result.
|
|
70
71
|
*/
|
|
@@ -110,7 +111,7 @@ function identityLabel(config) {
|
|
|
110
111
|
return id.length > ID_PREVIEW_LENGTH ? `id ${id.slice(0, ID_PREVIEW_LENGTH)}…` : `id ${id}`;
|
|
111
112
|
}
|
|
112
113
|
/**
|
|
113
|
-
* Recognizes a `data-embed-config` marker (the consuming product's own `src/
|
|
114
|
+
* Recognizes a `data-embed-config` marker (the consuming product's own `packages/cms/src/widgets/markers/marker.ts`'s single scanner
|
|
114
115
|
* convention) on a live canvas element and describes it for `@jini-ai/ui/html-editor`'s
|
|
115
116
|
* `applyCanvasEmbedPlaceholders` — see that function's own file header for what it does with the
|
|
116
117
|
* result. Exported for direct unit-testability without mounting the editor, same convention
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
/** 8px clearance kept between the menu and the viewport edge on every side it's tested against. */
|
|
3
3
|
const VIEWPORT_MARGIN = 8;
|
|
4
4
|
/**
|
|
@@ -61,6 +61,66 @@ function trackOpenMenu({ trigger, menu }, { window, document, onPosition, onDism
|
|
|
61
61
|
document.removeEventListener('keydown', onDocKeyDown);
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
+
/** Index updater for the arrow/Home/End keys, or null for any other key. */
|
|
65
|
+
function navigationUpdater({ key, itemCount }) {
|
|
66
|
+
switch (key) {
|
|
67
|
+
case 'ArrowDown': return (i) => (i + 1) % itemCount;
|
|
68
|
+
case 'ArrowUp': return (i) => (i - 1 + itemCount) % itemCount;
|
|
69
|
+
case 'Home': return () => 0;
|
|
70
|
+
case 'End': return () => itemCount - 1;
|
|
71
|
+
default: return null;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function handleMenuKey({ e, itemCount, setActiveIndex, close }) {
|
|
75
|
+
const next = navigationUpdater({ key: e.key, itemCount });
|
|
76
|
+
if (next) {
|
|
77
|
+
e.preventDefault();
|
|
78
|
+
setActiveIndex(next);
|
|
79
|
+
}
|
|
80
|
+
else if (e.key === 'Escape') {
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
e.stopPropagation();
|
|
83
|
+
close(true);
|
|
84
|
+
}
|
|
85
|
+
else if (e.key === 'Tab') {
|
|
86
|
+
// Leaving via Tab closes the menu but does not steal focus back to the trigger — the
|
|
87
|
+
// browser's own tab order continues from wherever it lands, matching native menu behavior
|
|
88
|
+
// (and unlike Escape, which is an explicit "back out" gesture).
|
|
89
|
+
close(false);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
// Any other key is left to the browser.
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function useMenuRef({ anchor, window, document, setPosition, close }) {
|
|
96
|
+
// Only the open menu renders this ref, so it only exists once there is an anchor. React calls it
|
|
97
|
+
// with the menu element on attach and `null` on detach (React 18 and 19 alike; attach always comes
|
|
98
|
+
// first, so `stop` is set by then). A new anchor or new `window`/`document` ports make a new ref,
|
|
99
|
+
// which React detaches and re-attaches — the same re-subscribe an effect's deps would give.
|
|
100
|
+
return useMemo(() => {
|
|
101
|
+
if (!anchor)
|
|
102
|
+
return null;
|
|
103
|
+
let stop;
|
|
104
|
+
return (menu) => {
|
|
105
|
+
if (menu)
|
|
106
|
+
stop = trackOpenMenu({ trigger: anchor, menu }, { window, document, onPosition: setPosition, onDismiss: () => close(false), onEscape: () => close(true) });
|
|
107
|
+
else
|
|
108
|
+
stop();
|
|
109
|
+
};
|
|
110
|
+
// `close` only touches state setters and `triggerRef`, all stable across renders.
|
|
111
|
+
}, [anchor, window, document, close]);
|
|
112
|
+
}
|
|
113
|
+
function useFocusActiveItem({ visible, activeIndex, itemRefs }) {
|
|
114
|
+
// Keeps real DOM focus on the active item (roving focus via `tabIndex={-1}` on every item except
|
|
115
|
+
// the active one) rather than only tracking `activeIndex` in state — arrow-key navigation needs
|
|
116
|
+
// to move the browser's actual focus for a screen reader to announce it. Waits for the first
|
|
117
|
+
// position: until then the menu is `visibility: hidden`, and a browser ignores focus on that.
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
if (!visible)
|
|
120
|
+
return;
|
|
121
|
+
itemRefs.current[activeIndex]?.focus();
|
|
122
|
+
}, [visible, activeIndex]);
|
|
123
|
+
}
|
|
64
124
|
/**
|
|
65
125
|
* Owns `RowMenu`'s open/close state, positioning, and keyboard/focus behavior.
|
|
66
126
|
*
|
|
@@ -79,43 +139,18 @@ export function useRowMenu({ itemCount, window, document }) {
|
|
|
79
139
|
const triggerRef = useRef(null);
|
|
80
140
|
const itemRefs = useRef([]);
|
|
81
141
|
itemRefs.current = itemRefs.current.slice(0, itemCount);
|
|
82
|
-
|
|
142
|
+
const close = useCallback((returnFocus) => {
|
|
83
143
|
setAnchor(null);
|
|
84
144
|
setPosition(null);
|
|
85
145
|
if (returnFocus)
|
|
86
146
|
triggerRef.current?.focus();
|
|
87
|
-
}
|
|
147
|
+
}, []);
|
|
88
148
|
function openAt(index) {
|
|
89
149
|
setActiveIndex(index);
|
|
90
150
|
setAnchor(triggerRef.current);
|
|
91
151
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
// first, so `stop` is set by then). A new anchor or new `window`/`document` ports make a new ref,
|
|
95
|
-
// which React detaches and re-attaches — the same re-subscribe an effect's deps would give.
|
|
96
|
-
const menuRef = useMemo(() => {
|
|
97
|
-
if (!anchor)
|
|
98
|
-
return null;
|
|
99
|
-
let stop;
|
|
100
|
-
return (menu) => {
|
|
101
|
-
if (menu)
|
|
102
|
-
stop = trackOpenMenu({ trigger: anchor, menu }, { window, document, onPosition: setPosition, onDismiss: () => close(false), onEscape: () => close(true) });
|
|
103
|
-
else
|
|
104
|
-
stop();
|
|
105
|
-
};
|
|
106
|
-
// `close` only touches state setters and `triggerRef`, all stable across renders.
|
|
107
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
108
|
-
}, [anchor, window, document]);
|
|
109
|
-
// Keeps real DOM focus on the active item (roving focus via `tabIndex={-1}` on every item except
|
|
110
|
-
// the active one) rather than only tracking `activeIndex` in state — arrow-key navigation needs
|
|
111
|
-
// to move the browser's actual focus for a screen reader to announce it. Waits for the first
|
|
112
|
-
// position: until then the menu is `visibility: hidden`, and a browser ignores focus on that.
|
|
113
|
-
const visible = open && position !== null;
|
|
114
|
-
useEffect(() => {
|
|
115
|
-
if (!visible)
|
|
116
|
-
return;
|
|
117
|
-
itemRefs.current[activeIndex]?.focus();
|
|
118
|
-
}, [visible, activeIndex]);
|
|
152
|
+
const menuRef = useMenuRef({ anchor, window, document, setPosition, close });
|
|
153
|
+
useFocusActiveItem({ visible: open && position !== null, activeIndex, itemRefs });
|
|
119
154
|
function onTriggerClick() {
|
|
120
155
|
if (open)
|
|
121
156
|
close(false);
|
|
@@ -128,39 +163,7 @@ export function useRowMenu({ itemCount, window, document }) {
|
|
|
128
163
|
e.preventDefault();
|
|
129
164
|
openAt(e.key === 'ArrowDown' ? 0 : itemCount - 1);
|
|
130
165
|
}
|
|
131
|
-
|
|
132
|
-
switch (e.key) {
|
|
133
|
-
case 'ArrowDown':
|
|
134
|
-
e.preventDefault();
|
|
135
|
-
setActiveIndex((i) => (i + 1) % itemCount);
|
|
136
|
-
break;
|
|
137
|
-
case 'ArrowUp':
|
|
138
|
-
e.preventDefault();
|
|
139
|
-
setActiveIndex((i) => (i - 1 + itemCount) % itemCount);
|
|
140
|
-
break;
|
|
141
|
-
case 'Home':
|
|
142
|
-
e.preventDefault();
|
|
143
|
-
setActiveIndex(0);
|
|
144
|
-
break;
|
|
145
|
-
case 'End':
|
|
146
|
-
e.preventDefault();
|
|
147
|
-
setActiveIndex(itemCount - 1);
|
|
148
|
-
break;
|
|
149
|
-
case 'Escape':
|
|
150
|
-
e.preventDefault();
|
|
151
|
-
e.stopPropagation();
|
|
152
|
-
close(true);
|
|
153
|
-
break;
|
|
154
|
-
case 'Tab':
|
|
155
|
-
// Leaving via Tab closes the menu but does not steal focus back to the trigger — the
|
|
156
|
-
// browser's own tab order continues from wherever it lands, matching native menu behavior
|
|
157
|
-
// (and unlike Escape, which is an explicit "back out" gesture).
|
|
158
|
-
close(false);
|
|
159
|
-
break;
|
|
160
|
-
default:
|
|
161
|
-
break;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
166
|
+
const onMenuKeyDown = (e) => handleMenuKey({ e, itemCount, setActiveIndex, close });
|
|
164
167
|
/** Closes (returning focus to the trigger, same as Escape) and then fires the selected item's own
|
|
165
168
|
* callback — takes the callback directly rather than a whole `RowMenuItem` so this hook stays
|
|
166
169
|
* free of any dependency on that component-level type. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
|
-
import { agentHandle, buildAgentListHandles } from '@jini-ai/
|
|
3
|
+
import { agentHandle, buildAgentListHandles } from '@jini-ai/core/agent-handles';
|
|
4
4
|
import { resolveTone, toneClassName } from '../../types.js';
|
|
5
5
|
import { useRowMenu } from './RowMenu.hooks.js';
|
|
6
6
|
/**
|