@jini-ai/admin 0.3.9 → 0.4.0
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 +58 -0
- package/README.md +71 -37
- package/dist/agent-plugins/adapters/http.d.ts +7 -0
- package/dist/agent-plugins/adapters/http.js +15 -0
- package/dist/agent-plugins/adapters/memory.d.ts +8 -0
- package/dist/agent-plugins/adapters/memory.js +25 -0
- package/dist/agent-plugins/agent-plugins.module.d.ts +51 -0
- package/dist/agent-plugins/agent-plugins.module.js +6 -0
- package/dist/agent-plugins/conformance/agent-plugins-api.conformance.d.ts +12 -0
- package/dist/agent-plugins/conformance/agent-plugins-api.conformance.js +47 -0
- package/dist/agent-plugins/controllers/agent-plugin-files.controller.d.ts +20 -0
- package/dist/agent-plugins/controllers/agent-plugin-files.controller.js +43 -0
- package/dist/agent-plugins/controllers/agent-plugins.controller.d.ts +25 -0
- package/dist/agent-plugins/controllers/agent-plugins.controller.js +91 -0
- package/dist/agent-plugins/index.d.ts +9 -0
- package/dist/agent-plugins/index.js +9 -0
- package/dist/agent-plugins/messages.en.d.ts +23 -0
- package/dist/agent-plugins/messages.en.js +14 -0
- package/dist/agent-plugins/models.d.ts +57 -0
- package/dist/agent-plugins/models.js +2 -0
- package/dist/agent-plugins/package-file-tree.d.ts +111 -0
- package/dist/agent-plugins/package-file-tree.js +188 -0
- package/dist/agent-plugins/ports.d.ts +18 -0
- package/dist/agent-plugins/ports.js +3 -0
- package/dist/agent-plugins/react/components/AgentPluginFileContent.d.ts +5 -0
- package/dist/agent-plugins/react/components/AgentPluginFileContent.js +9 -0
- package/dist/agent-plugins/react/components/AgentPluginFileTree.d.ts +9 -0
- package/dist/agent-plugins/react/components/AgentPluginFileTree.js +7 -0
- package/dist/agent-plugins/react/components/AgentPluginInspector.d.ts +3 -0
- package/dist/agent-plugins/react/components/AgentPluginInspector.js +11 -0
- package/dist/agent-plugins/react/components/AgentPluginListPanel.d.ts +6 -0
- package/dist/agent-plugins/react/components/AgentPluginListPanel.js +10 -0
- package/dist/agent-plugins/react/components/AgentPluginRow.d.ts +5 -0
- package/dist/agent-plugins/react/components/AgentPluginRow.js +8 -0
- package/dist/agent-plugins/react/hooks/AgentPluginInspector.hooks.d.ts +90 -0
- package/dist/agent-plugins/react/hooks/AgentPluginInspector.hooks.js +74 -0
- package/dist/agent-plugins/react/hooks/AgentPluginPanel.hooks.d.ts +67 -0
- package/dist/agent-plugins/react/hooks/AgentPluginPanel.hooks.js +50 -0
- package/dist/agent-plugins/react/hooks/AgentPluginRow.hooks.d.ts +55 -0
- package/dist/agent-plugins/react/hooks/AgentPluginRow.hooks.js +6 -0
- package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.d.ts +64 -0
- package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.js +39 -0
- package/dist/agent-plugins/react/hooks/AgentPluginsPorts.hooks.d.ts +7 -0
- package/dist/agent-plugins/react/hooks/AgentPluginsPorts.hooks.js +10 -0
- package/dist/agent-plugins/react/hooks/MarketplaceTab.hooks.d.ts +6 -0
- package/dist/agent-plugins/react/hooks/MarketplaceTab.hooks.js +3 -0
- package/dist/agent-plugins/react/index.d.ts +245 -0
- package/dist/agent-plugins/react/index.js +13 -0
- package/dist/agent-plugins/react/pages/AgentPluginsPage.d.ts +4 -0
- package/dist/agent-plugins/react/pages/AgentPluginsPage.js +12 -0
- package/dist/agent-plugins/react/tabs/DownloadedTab.d.ts +4 -0
- package/dist/agent-plugins/react/tabs/DownloadedTab.js +5 -0
- package/dist/agent-plugins/react/tabs/InstalledTab.d.ts +4 -0
- package/dist/agent-plugins/react/tabs/InstalledTab.js +5 -0
- package/dist/agent-plugins/react/tabs/MarketplaceTab.d.ts +4 -0
- package/dist/agent-plugins/react/tabs/MarketplaceTab.js +10 -0
- package/dist/agent-plugins/rules.d.ts +33 -0
- package/dist/agent-plugins/rules.js +51 -0
- package/dist/browser/index.d.ts +1 -0
- package/dist/browser/index.js +1 -0
- package/dist/browser/navigation.d.ts +19 -4
- package/dist/browser/navigation.js +8 -8
- package/dist/browser/shell-navigation.d.ts +12 -0
- package/dist/browser/shell-navigation.js +16 -0
- package/dist/contracts/credential-management.d.ts +8 -0
- package/dist/contracts/credential-management.js +3 -0
- package/dist/contracts/media-picker.d.ts +17 -0
- package/dist/contracts/media-picker.js +5 -0
- package/dist/contracts/playground-render-target.d.ts +18 -0
- package/dist/contracts/playground-render-target.js +3 -0
- package/dist/core/entities/rules.d.ts +138 -0
- package/dist/core/entities/rules.js +344 -0
- package/dist/core/gated/types.d.ts +8 -4
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.js +1 -0
- package/dist/core/manifest/rules.d.ts +24 -6
- package/dist/core/manifest/rules.js +12 -11
- package/dist/core/module/controller-store.d.ts +22 -0
- package/dist/core/module/controller-store.js +32 -0
- package/dist/core/module/create-admin.d.ts +41 -0
- package/dist/core/module/create-admin.js +187 -0
- package/dist/core/module/define-admin-module.d.ts +4 -0
- package/dist/core/module/define-admin-module.js +5 -0
- package/dist/core/module/index.d.ts +7 -0
- package/dist/core/module/index.js +4 -0
- package/dist/core/module/token.d.ts +19 -0
- package/dist/core/module/token.js +4 -0
- package/dist/core/module/types.d.ts +79 -0
- package/dist/core/module/types.js +2 -0
- package/dist/core/permissions/rules.d.ts +4 -1
- package/dist/core/permissions/rules.js +1 -1
- package/dist/core/ports/analytics.d.ts +1 -1
- package/dist/core/ports/auth.d.ts +2 -2
- package/dist/core/ports/comments.d.ts +9 -6
- package/dist/core/ports/database.d.ts +13 -10
- package/dist/core/ports/entities.d.ts +302 -0
- package/dist/core/ports/entities.js +47 -0
- package/dist/core/ports/forms.d.ts +19 -7
- package/dist/core/ports/identity.d.ts +42 -17
- package/dist/core/ports/index.d.ts +2 -0
- package/dist/core/ports/integrations.d.ts +9 -4
- package/dist/core/ports/media.d.ts +16 -7
- package/dist/core/ports/members.d.ts +7 -3
- package/dist/core/ports/menus.d.ts +43 -0
- package/dist/core/ports/menus.js +43 -0
- package/dist/core/ports/plugins.d.ts +3 -2
- package/dist/core/ports/recovery.d.ts +10 -6
- package/dist/core/ports/redirects.d.ts +17 -7
- package/dist/core/ports/seo.d.ts +12 -6
- package/dist/core/ports/shell.d.ts +41 -0
- package/dist/core/ports/shell.js +2 -0
- package/dist/core/ports/workspace.d.ts +3 -3
- package/dist/core/routing/rules.d.ts +17 -4
- package/dist/core/routing/rules.js +4 -4
- package/dist/core/transport/errors.d.ts +13 -4
- package/dist/core/transport/errors.js +4 -4
- package/dist/core/transport/http.d.ts +26 -16
- package/dist/core/transport/http.js +59 -21
- package/dist/core/transport/types.d.ts +26 -14
- package/dist/core/transport/types.js +9 -7
- package/dist/media/adapters/http.d.ts +27 -0
- package/dist/media/adapters/http.js +44 -0
- package/dist/media/adapters/memory.d.ts +11 -0
- package/dist/media/adapters/memory.js +139 -0
- package/dist/media/conformance/media-api.conformance.d.ts +7 -0
- package/dist/media/conformance/media-api.conformance.js +69 -0
- package/dist/media/controllers/edit-media.controller.d.ts +24 -0
- package/dist/media/controllers/edit-media.controller.js +69 -0
- package/dist/media/controllers/library.controller.d.ts +47 -0
- package/dist/media/controllers/library.controller.js +173 -0
- package/dist/media/controllers/providers.controller.d.ts +30 -0
- package/dist/media/controllers/providers.controller.js +76 -0
- package/dist/media/html-attributes.d.ts +82 -0
- package/dist/media/html-attributes.js +204 -0
- package/dist/media/index.d.ts +12 -0
- package/dist/media/index.js +9 -0
- package/dist/media/media.module.d.ts +83 -0
- package/dist/media/media.module.js +43 -0
- package/dist/media/messages.en.d.ts +24 -0
- package/dist/media/messages.en.js +24 -0
- package/dist/media/models.d.ts +72 -0
- package/dist/media/models.js +2 -0
- package/dist/media/ports.d.ts +75 -0
- package/dist/media/ports.js +7 -0
- package/dist/media/react/components/EditMediaPanel.d.ts +3 -0
- package/dist/media/react/components/EditMediaPanel.js +10 -0
- package/dist/media/react/components/MediaCard.d.ts +5 -0
- package/dist/media/react/components/MediaCard.js +17 -0
- package/dist/media/react/components/MediaDialog.d.ts +3 -0
- package/dist/media/react/components/MediaDialog.js +8 -0
- package/dist/media/react/components/MediaGrid.d.ts +4 -0
- package/dist/media/react/components/MediaGrid.js +8 -0
- package/dist/media/react/components/MediaIcons.d.ts +14 -0
- package/dist/media/react/components/MediaIcons.js +39 -0
- package/dist/media/react/components/MediaLightbox.d.ts +5 -0
- package/dist/media/react/components/MediaLightbox.js +12 -0
- package/dist/media/react/components/MediaPicker.d.ts +3 -0
- package/dist/media/react/components/MediaPicker.js +10 -0
- package/dist/media/react/components/MediaPurgeDialog.d.ts +4 -0
- package/dist/media/react/components/MediaPurgeDialog.js +9 -0
- package/dist/media/react/components/UploadButton.d.ts +3 -0
- package/dist/media/react/components/UploadButton.js +8 -0
- package/dist/media/react/hooks/EditMediaPanel.hooks.d.ts +84 -0
- package/dist/media/react/hooks/EditMediaPanel.hooks.js +105 -0
- package/dist/media/react/hooks/LibraryTab.hooks.d.ts +103 -0
- package/dist/media/react/hooks/LibraryTab.hooks.js +164 -0
- package/dist/media/react/hooks/MediaCard.hooks.d.ts +79 -0
- package/dist/media/react/hooks/MediaCard.hooks.js +63 -0
- package/dist/media/react/hooks/MediaDialog.hooks.d.ts +10 -0
- package/dist/media/react/hooks/MediaDialog.hooks.js +20 -0
- package/dist/media/react/hooks/MediaGrid.hooks.d.ts +28 -0
- package/dist/media/react/hooks/MediaGrid.hooks.js +6 -0
- package/dist/media/react/hooks/MediaLightbox.hooks.d.ts +27 -0
- package/dist/media/react/hooks/MediaLightbox.hooks.js +64 -0
- package/dist/media/react/hooks/MediaPage.hooks.d.ts +68 -0
- package/dist/media/react/hooks/MediaPage.hooks.js +68 -0
- package/dist/media/react/hooks/MediaPicker.hooks.d.ts +26 -0
- package/dist/media/react/hooks/MediaPicker.hooks.js +25 -0
- package/dist/media/react/hooks/MediaPorts.hooks.d.ts +9 -0
- package/dist/media/react/hooks/MediaPorts.hooks.js +10 -0
- package/dist/media/react/hooks/MediaPurgeDialog.hooks.d.ts +22 -0
- package/dist/media/react/hooks/MediaPurgeDialog.hooks.js +6 -0
- package/dist/media/react/hooks/ProvidersTab.hooks.d.ts +55 -0
- package/dist/media/react/hooks/ProvidersTab.hooks.js +124 -0
- package/dist/media/react/hooks/UploadButton.hooks.d.ts +48 -0
- package/dist/media/react/hooks/UploadButton.hooks.js +118 -0
- package/dist/media/react/index.d.ts +373 -0
- package/dist/media/react/index.js +73 -0
- package/dist/media/react/pages/MediaPage.d.ts +4 -0
- package/dist/media/react/pages/MediaPage.js +9 -0
- package/dist/media/react/tabs/LibraryTab.d.ts +4 -0
- package/dist/media/react/tabs/LibraryTab.js +14 -0
- package/dist/media/react/tabs/ProvidersTab.d.ts +4 -0
- package/dist/media/react/tabs/ProvidersTab.js +10 -0
- package/dist/media/rules.d.ts +80 -0
- package/dist/media/rules.js +127 -0
- package/dist/media/styles.d.ts +4 -0
- package/dist/media/styles.js +5 -0
- package/dist/playground/adapters/http.d.ts +8 -0
- package/dist/playground/adapters/http.js +4 -0
- package/dist/playground/adapters/memory.d.ts +10 -0
- package/dist/playground/adapters/memory.js +30 -0
- package/dist/playground/conformance/playground-api.conformance.d.ts +6 -0
- package/dist/playground/conformance/playground-api.conformance.js +37 -0
- package/dist/playground/controllers/playground.controller.d.ts +16 -0
- package/dist/playground/controllers/playground.controller.js +21 -0
- package/dist/playground/index.d.ts +7 -0
- package/dist/playground/index.js +5 -0
- package/dist/playground/messages.en.d.ts +9 -0
- package/dist/playground/messages.en.js +2 -0
- package/dist/playground/models.d.ts +4 -0
- package/dist/playground/models.js +2 -0
- package/dist/playground/playground.module.d.ts +31 -0
- package/dist/playground/playground.module.js +5 -0
- package/dist/playground/ports.d.ts +5 -0
- package/dist/playground/ports.js +2 -0
- package/dist/playground/react/components/Canvas.d.ts +3 -0
- package/dist/playground/react/components/Canvas.js +9 -0
- package/dist/playground/react/hooks/Canvas.hooks.d.ts +7 -0
- package/dist/playground/react/hooks/Canvas.hooks.js +18 -0
- package/dist/playground/react/hooks/PlaygroundPage.hooks.d.ts +8 -0
- package/dist/playground/react/hooks/PlaygroundPage.hooks.js +2 -0
- package/dist/playground/react/hooks/PlaygroundPorts.hooks.d.ts +4 -0
- package/dist/playground/react/hooks/PlaygroundPorts.hooks.js +6 -0
- package/dist/playground/react/index.d.ts +136 -0
- package/dist/playground/react/index.js +10 -0
- package/dist/playground/react/pages/PlaygroundPage.d.ts +4 -0
- package/dist/playground/react/pages/PlaygroundPage.js +11 -0
- package/dist/playground/react/tabs/CanvasTab.d.ts +4 -0
- package/dist/playground/react/tabs/CanvasTab.js +5 -0
- package/dist/playground/rules.d.ts +4 -0
- package/dist/playground/rules.js +2 -0
- package/dist/react/OverlayHost.d.ts +3 -0
- package/dist/react/OverlayHost.hooks.d.ts +9 -0
- package/dist/react/OverlayHost.hooks.js +9 -0
- package/dist/react/OverlayHost.js +7 -0
- package/dist/react/bind-react.d.ts +46 -0
- package/dist/react/bind-react.js +28 -0
- package/dist/react/components/ConfirmButton/ConfirmButton.hooks.d.ts +7 -1
- package/dist/react/components/ConfirmButton/ConfirmButton.hooks.js +2 -2
- package/dist/react/components/ConfirmButton/ConfirmButton.js +1 -1
- package/dist/react/components/ConfirmDialog/ConfirmDialog.d.ts +15 -3
- package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.d.ts +17 -3
- package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.js +3 -3
- package/dist/react/components/ConfirmDialog/ConfirmDialog.js +6 -6
- package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.d.ts +6 -2
- package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.js +7 -8
- package/dist/react/components/RowMenu/RowMenu.d.ts +5 -1
- package/dist/react/components/RowMenu/RowMenu.hooks.d.ts +8 -2
- package/dist/react/components/RowMenu/RowMenu.hooks.js +4 -4
- package/dist/react/components/RowMenu/RowMenu.js +6 -6
- package/dist/react/components/Sidebar.d.ts +1 -1
- package/dist/react/components/Sidebar.js +103 -7
- package/dist/react/entities/EntityCell.d.ts +10 -0
- package/dist/react/entities/EntityCell.js +18 -0
- package/dist/react/entities/EntityDetail.d.ts +3 -0
- package/dist/react/entities/EntityDetail.js +21 -0
- package/dist/react/entities/EntityEdit.d.ts +13 -0
- package/dist/react/entities/EntityEdit.js +45 -0
- package/dist/react/entities/EntityField.d.ts +20 -0
- package/dist/react/entities/EntityField.js +31 -0
- package/dist/react/entities/EntityIndex.d.ts +3 -0
- package/dist/react/entities/EntityIndex.js +10 -0
- package/dist/react/entities/EntityList.d.ts +7 -0
- package/dist/react/entities/EntityList.js +52 -0
- package/dist/react/entities/contribution.d.ts +26 -0
- package/dist/react/entities/contribution.js +78 -0
- package/dist/react/entities/index.d.ts +10 -0
- package/dist/react/entities/index.js +7 -0
- package/dist/react/entities/rules.d.ts +179 -0
- package/dist/react/entities/rules.js +224 -0
- package/dist/react/entities/types.d.ts +45 -0
- package/dist/react/entities/types.js +5 -0
- package/dist/react/entities/use-entity-edit.d.ts +35 -0
- package/dist/react/entities/use-entity-edit.js +98 -0
- package/dist/react/entities/use-entity-read.d.ts +22 -0
- package/dist/react/entities/use-entity-read.js +27 -0
- package/dist/react/hooks/use-nav-sections.d.ts +12 -3
- package/dist/react/hooks/use-nav-sections.js +14 -14
- package/dist/react/hooks/use-sidebar-rail.d.ts +7 -1
- package/dist/react/hooks/use-sidebar-rail.js +11 -11
- package/dist/react/index.d.ts +3 -1
- package/dist/react/index.js +5 -2
- package/dist/react/kit/Kit.hooks.d.ts +13 -0
- package/dist/react/kit/Kit.hooks.js +10 -0
- package/dist/react/kit/Native.hooks.d.ts +38 -0
- package/dist/react/kit/Native.hooks.js +65 -0
- package/dist/react/kit/index.d.ts +12 -0
- package/dist/react/kit/index.js +21 -0
- package/dist/react/kit/native.d.ts +3 -0
- package/dist/react/kit/native.js +21 -0
- package/dist/react/kit/types.d.ts +40 -0
- package/dist/react/kit/types.js +2 -0
- package/dist/react/overlay.d.ts +36 -0
- package/dist/react/overlay.js +35 -0
- package/dist/react/overlays.d.ts +38 -0
- package/dist/react/overlays.js +46 -0
- package/dist/react/shell/AdminShell.d.ts +9 -0
- package/dist/react/shell/AdminShell.hooks.d.ts +15 -0
- package/dist/react/shell/AdminShell.hooks.js +27 -0
- package/dist/react/shell/AdminShell.js +46 -0
- package/dist/react/shell/index.d.ts +7 -0
- package/dist/react/shell/index.js +5 -0
- package/dist/react/shell/model.d.ts +25 -0
- package/dist/react/shell/model.js +29 -0
- package/dist/react/shell/theme-ports.d.ts +28 -0
- package/dist/react/shell/theme-ports.js +2 -0
- package/dist/react/shell/types.d.ts +99 -0
- package/dist/react/shell/types.js +2 -0
- package/dist/react/shell/use-admin-shell-session.d.ts +13 -0
- package/dist/react/shell/use-admin-shell-session.js +81 -0
- package/dist/react/shell/use-admin-theme.d.ts +16 -0
- package/dist/react/shell/use-admin-theme.js +57 -0
- package/dist/react/types.d.ts +6 -4
- package/dist/react/types.js +2 -2
- package/dist/react/use-controller.d.ts +16 -0
- package/dist/react/use-controller.js +18 -0
- package/dist/security/adapters/http.d.ts +16 -0
- package/dist/security/adapters/http.js +94 -0
- package/dist/security/adapters/memory.d.ts +15 -0
- package/dist/security/adapters/memory.js +60 -0
- package/dist/security/conformance/security-api.conformance.d.ts +10 -0
- package/dist/security/conformance/security-api.conformance.js +48 -0
- package/dist/security/controllers/access-tokens.controller.d.ts +44 -0
- package/dist/security/controllers/access-tokens.controller.js +112 -0
- package/dist/security/controllers/other-credentials.controller.d.ts +30 -0
- package/dist/security/controllers/other-credentials.controller.js +74 -0
- package/dist/security/controllers/root-key.controller.d.ts +35 -0
- package/dist/security/controllers/root-key.controller.js +90 -0
- package/dist/security/index.d.ts +9 -0
- package/dist/security/index.js +9 -0
- package/dist/security/messages.en.d.ts +12 -0
- package/dist/security/messages.en.js +2 -0
- package/dist/security/models.d.ts +112 -0
- package/dist/security/models.js +2 -0
- package/dist/security/ports.d.ts +58 -0
- package/dist/security/ports.js +5 -0
- package/dist/security/react/components/CredentialEditor.d.ts +3 -0
- package/dist/security/react/components/CredentialEditor.js +8 -0
- package/dist/security/react/hooks/AccessTokensTab.hooks.d.ts +94 -0
- package/dist/security/react/hooks/AccessTokensTab.hooks.js +36 -0
- package/dist/security/react/hooks/CredentialEditor.hooks.d.ts +49 -0
- package/dist/security/react/hooks/CredentialEditor.hooks.js +14 -0
- package/dist/security/react/hooks/RootKeyTab.hooks.d.ts +29 -0
- package/dist/security/react/hooks/RootKeyTab.hooks.js +19 -0
- package/dist/security/react/hooks/SecurityPage.hooks.d.ts +17 -0
- package/dist/security/react/hooks/SecurityPage.hooks.js +12 -0
- package/dist/security/react/hooks/SecurityPorts.hooks.d.ts +9 -0
- package/dist/security/react/hooks/SecurityPorts.hooks.js +6 -0
- package/dist/security/react/index.d.ts +215 -0
- package/dist/security/react/index.js +10 -0
- package/dist/security/react/pages/SecurityPage.d.ts +4 -0
- package/dist/security/react/pages/SecurityPage.js +10 -0
- package/dist/security/react/tabs/AccessTokensTab.d.ts +4 -0
- package/dist/security/react/tabs/AccessTokensTab.js +10 -0
- package/dist/security/react/tabs/RootKeyTab.d.ts +4 -0
- package/dist/security/react/tabs/RootKeyTab.js +9 -0
- package/dist/security/rules.d.ts +57 -0
- package/dist/security/rules.js +63 -0
- package/dist/security/security.module.d.ts +45 -0
- package/dist/security/security.module.js +5 -0
- package/dist/source-control/adapters/http.d.ts +6 -0
- package/dist/source-control/adapters/http.js +13 -0
- package/dist/source-control/adapters/memory.d.ts +9 -0
- package/dist/source-control/adapters/memory.js +35 -0
- package/dist/source-control/conformance/source-control-api.conformance.d.ts +10 -0
- package/dist/source-control/conformance/source-control-api.conformance.js +48 -0
- package/dist/source-control/controllers/source-control.controller.d.ts +26 -0
- package/dist/source-control/controllers/source-control.controller.js +70 -0
- package/dist/source-control/index.d.ts +8 -0
- package/dist/source-control/index.js +6 -0
- package/dist/source-control/messages.en.d.ts +11 -0
- package/dist/source-control/messages.en.js +2 -0
- package/dist/source-control/models.d.ts +70 -0
- package/dist/source-control/models.js +2 -0
- package/dist/source-control/ports.d.ts +23 -0
- package/dist/source-control/ports.js +3 -0
- package/dist/source-control/react/components/SourceControlCredentialFields.d.ts +5 -0
- package/dist/source-control/react/components/SourceControlCredentialFields.js +8 -0
- package/dist/source-control/react/components/SourceControlProviderRow.d.ts +5 -0
- package/dist/source-control/react/components/SourceControlProviderRow.js +7 -0
- package/dist/source-control/react/hooks/ProvidersTab.hooks.d.ts +45 -0
- package/dist/source-control/react/hooks/ProvidersTab.hooks.js +20 -0
- package/dist/source-control/react/hooks/SourceControlCredentialFields.hooks.d.ts +43 -0
- package/dist/source-control/react/hooks/SourceControlCredentialFields.hooks.js +9 -0
- package/dist/source-control/react/hooks/SourceControlPage.hooks.d.ts +17 -0
- package/dist/source-control/react/hooks/SourceControlPage.hooks.js +5 -0
- package/dist/source-control/react/hooks/SourceControlPorts.hooks.d.ts +9 -0
- package/dist/source-control/react/hooks/SourceControlPorts.hooks.js +6 -0
- package/dist/source-control/react/index.d.ts +156 -0
- package/dist/source-control/react/index.js +10 -0
- package/dist/source-control/react/pages/SourceControlPage.d.ts +4 -0
- package/dist/source-control/react/pages/SourceControlPage.js +11 -0
- package/dist/source-control/react/tabs/ProvidersTab.d.ts +4 -0
- package/dist/source-control/react/tabs/ProvidersTab.js +10 -0
- package/dist/source-control/rules.d.ts +32 -0
- package/dist/source-control/rules.js +35 -0
- package/dist/source-control/source-control.module.d.ts +36 -0
- package/dist/source-control/source-control.module.js +6 -0
- package/package.json +207 -4
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
export { usePlaygroundPorts } from './hooks/PlaygroundPorts.hooks.js';
|
|
2
|
+
export declare function playground(_required: Record<string, never>, _optional?: {}): {
|
|
3
|
+
id: "playground";
|
|
4
|
+
requires: {
|
|
5
|
+
readonly playgroundTargets: import("../../core/module/token.js").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
|
|
6
|
+
};
|
|
7
|
+
messages: Readonly<{
|
|
8
|
+
title: "Playground";
|
|
9
|
+
studio: "Studio";
|
|
10
|
+
canvas: "Canvas";
|
|
11
|
+
description: "Ask the assistant to build anything — try “Show a pie chart of my data.”";
|
|
12
|
+
empty: "Nothing drawn yet — ask the assistant.";
|
|
13
|
+
denied: "Permission denied";
|
|
14
|
+
}>;
|
|
15
|
+
pages: {
|
|
16
|
+
readonly playground: {
|
|
17
|
+
readonly path: "/playground";
|
|
18
|
+
readonly label: "Playground";
|
|
19
|
+
readonly permissions: readonly ["playground.read"];
|
|
20
|
+
readonly nav: {
|
|
21
|
+
readonly group: "studio";
|
|
22
|
+
readonly icon: "canvas";
|
|
23
|
+
};
|
|
24
|
+
readonly tabs: {
|
|
25
|
+
readonly canvas: {
|
|
26
|
+
readonly label: "Canvas";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
} & {
|
|
32
|
+
react: {
|
|
33
|
+
module: {
|
|
34
|
+
id: "playground";
|
|
35
|
+
requires: {
|
|
36
|
+
readonly playgroundTargets: import("../../core/module/token.js").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
|
|
37
|
+
};
|
|
38
|
+
messages: Readonly<{
|
|
39
|
+
title: "Playground";
|
|
40
|
+
studio: "Studio";
|
|
41
|
+
canvas: "Canvas";
|
|
42
|
+
description: "Ask the assistant to build anything — try “Show a pie chart of my data.”";
|
|
43
|
+
empty: "Nothing drawn yet — ask the assistant.";
|
|
44
|
+
denied: "Permission denied";
|
|
45
|
+
}>;
|
|
46
|
+
pages: {
|
|
47
|
+
readonly playground: {
|
|
48
|
+
readonly path: "/playground";
|
|
49
|
+
readonly label: "Playground";
|
|
50
|
+
readonly permissions: readonly ["playground.read"];
|
|
51
|
+
readonly nav: {
|
|
52
|
+
readonly group: "studio";
|
|
53
|
+
readonly icon: "canvas";
|
|
54
|
+
};
|
|
55
|
+
readonly tabs: {
|
|
56
|
+
readonly canvas: {
|
|
57
|
+
readonly label: "Canvas";
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
pages: {
|
|
64
|
+
readonly playground: {
|
|
65
|
+
Page: import("react").LazyExoticComponent<import("react").ComponentType<import("../../react/bind-react.js").ModulePageProps>>;
|
|
66
|
+
tabs: {
|
|
67
|
+
readonly canvas: import("react").LazyExoticComponent<import("react").ComponentType<import("../../react/bind-react.js").TabViewProps>>;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
Provider: ({ admin, children }: {
|
|
72
|
+
admin: import("../../core/module/types.js").AdminInstance;
|
|
73
|
+
children: import("react").ReactNode;
|
|
74
|
+
}, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<import("../../core/module/types.js").ScopedPorts<{
|
|
75
|
+
id: "playground";
|
|
76
|
+
requires: {
|
|
77
|
+
readonly playgroundTargets: import("../../core/module/token.js").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
|
|
78
|
+
};
|
|
79
|
+
messages: Readonly<{
|
|
80
|
+
title: "Playground";
|
|
81
|
+
studio: "Studio";
|
|
82
|
+
canvas: "Canvas";
|
|
83
|
+
description: "Ask the assistant to build anything — try “Show a pie chart of my data.”";
|
|
84
|
+
empty: "Nothing drawn yet — ask the assistant.";
|
|
85
|
+
denied: "Permission denied";
|
|
86
|
+
}>;
|
|
87
|
+
pages: {
|
|
88
|
+
readonly playground: {
|
|
89
|
+
readonly path: "/playground";
|
|
90
|
+
readonly label: "Playground";
|
|
91
|
+
readonly permissions: readonly ["playground.read"];
|
|
92
|
+
readonly nav: {
|
|
93
|
+
readonly group: "studio";
|
|
94
|
+
readonly icon: "canvas";
|
|
95
|
+
};
|
|
96
|
+
readonly tabs: {
|
|
97
|
+
readonly canvas: {
|
|
98
|
+
readonly label: "Canvas";
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
}> | null>>;
|
|
104
|
+
usePorts: (_required?: Record<string, never>, _optional?: Record<string, never>) => import("../../core/module/types.js").ScopedPorts<{
|
|
105
|
+
id: "playground";
|
|
106
|
+
requires: {
|
|
107
|
+
readonly playgroundTargets: import("../../core/module/token.js").AdminPortToken<import("../../contracts/playground-render-target.js").PlaygroundRenderTargetPort, "admin.playground.render-target">;
|
|
108
|
+
};
|
|
109
|
+
messages: Readonly<{
|
|
110
|
+
title: "Playground";
|
|
111
|
+
studio: "Studio";
|
|
112
|
+
canvas: "Canvas";
|
|
113
|
+
description: "Ask the assistant to build anything — try “Show a pie chart of my data.”";
|
|
114
|
+
empty: "Nothing drawn yet — ask the assistant.";
|
|
115
|
+
denied: "Permission denied";
|
|
116
|
+
}>;
|
|
117
|
+
pages: {
|
|
118
|
+
readonly playground: {
|
|
119
|
+
readonly path: "/playground";
|
|
120
|
+
readonly label: "Playground";
|
|
121
|
+
readonly permissions: readonly ["playground.read"];
|
|
122
|
+
readonly nav: {
|
|
123
|
+
readonly group: "studio";
|
|
124
|
+
readonly icon: "canvas";
|
|
125
|
+
};
|
|
126
|
+
readonly tabs: {
|
|
127
|
+
readonly canvas: {
|
|
128
|
+
readonly label: "Canvas";
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
}>;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { bindReact } from '../../react/bind-react.js';
|
|
2
|
+
import { playgroundModule } from '../playground.module.js';
|
|
3
|
+
import { PlaygroundPortsContext } from './hooks/PlaygroundPorts.hooks.js';
|
|
4
|
+
export { usePlaygroundPorts } from './hooks/PlaygroundPorts.hooks.js';
|
|
5
|
+
export function playground(_required, _optional = {}) {
|
|
6
|
+
const module = { ...playgroundModule };
|
|
7
|
+
const react = bindReact({ module, views: { playground: { page: () => import('./pages/PlaygroundPage.js'), tabs: { canvas: () => import('./tabs/CanvasTab.js') } } } }, { context: PlaygroundPortsContext });
|
|
8
|
+
return Object.assign(module, { react });
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense } from 'react';
|
|
3
|
+
import { Notice, Spinner } from '@jini-ai/ui-kit/react';
|
|
4
|
+
import { usePlaygroundPage } from '../hooks/PlaygroundPage.hooks.js';
|
|
5
|
+
import { playgroundMessagesEn as m } from '../../messages.en.js';
|
|
6
|
+
export function PlaygroundPage(props, _optional = {}) {
|
|
7
|
+
const vm = usePlaygroundPage(props);
|
|
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
|
+
}
|
|
10
|
+
export default PlaygroundPage;
|
|
11
|
+
//# sourceMappingURL=PlaygroundPage.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { createOverlayController } from './overlays.js';
|
|
2
|
+
export interface OverlayHostProps {
|
|
3
|
+
readonly controller: ReturnType<typeof createOverlayController>;
|
|
4
|
+
}
|
|
5
|
+
export declare function useOverlayHost({ controller }: OverlayHostProps, _optional?: Record<string, never>): {
|
|
6
|
+
id: number;
|
|
7
|
+
content: import("react").ReactNode;
|
|
8
|
+
}[];
|
|
9
|
+
//# sourceMappingURL=OverlayHost.hooks.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useSyncExternalStore, useEffect, useCallback } from 'react';
|
|
2
|
+
export function useOverlayHost({ controller }, _optional = {}) {
|
|
3
|
+
const subscribe = useCallback((listener) => controller.subscribe({ listener }), [controller]);
|
|
4
|
+
const snapshot = useSyncExternalStore(subscribe, controller.getSnapshot, controller.getSnapshot);
|
|
5
|
+
// Host unmount cancels a waiting service call but keeps the controller replay-safe.
|
|
6
|
+
useEffect(() => () => controller.cancel(), [controller]);
|
|
7
|
+
return snapshot.entries.map((entry) => ({ id: entry.id, content: entry.render() }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=OverlayHost.hooks.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useOverlayHost } from './OverlayHost.hooks.js';
|
|
3
|
+
export function OverlayHost(props, _optional = {}) {
|
|
4
|
+
const entries = useOverlayHost(props);
|
|
5
|
+
return (_jsx("div", { "data-jini-part": "admin.overlays", children: entries.map((entry) => (_jsx("div", { children: entry.content }, entry.id))) }));
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=OverlayHost.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode, LazyExoticComponent, Context as ReactContext } from 'react';
|
|
2
|
+
import type { AdminInstance, AdminModule, ScopedPorts } from '../core/module/types.js';
|
|
3
|
+
export interface TabViewProps {
|
|
4
|
+
readonly params: Readonly<Record<string, unknown>>;
|
|
5
|
+
readonly permissions?: readonly string[];
|
|
6
|
+
}
|
|
7
|
+
export interface ModulePageProps {
|
|
8
|
+
readonly tabs: Readonly<Record<string, LazyExoticComponent<ComponentType<TabViewProps>>>>;
|
|
9
|
+
readonly description: ReturnType<AdminInstance['describe']>['pages'][number];
|
|
10
|
+
readonly requestedTab?: string;
|
|
11
|
+
readonly onTabChange?: (required: {
|
|
12
|
+
tab: string;
|
|
13
|
+
}, optional?: Record<string, never>) => void;
|
|
14
|
+
}
|
|
15
|
+
type Loader<P> = () => Promise<{
|
|
16
|
+
default: ComponentType<P>;
|
|
17
|
+
}>;
|
|
18
|
+
export type ReactViews<M extends AdminModule> = {
|
|
19
|
+
readonly [P in keyof M['pages']]: {
|
|
20
|
+
readonly page: Loader<ModulePageProps>;
|
|
21
|
+
readonly tabs: {
|
|
22
|
+
readonly [T in keyof M['pages'][P]['tabs']]: Loader<TabViewProps>;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/** Every page and tab is lazy. The only port context is private to this binding;
|
|
27
|
+
* a sibling module can never read another module's dependencies through a global locator. */
|
|
28
|
+
export declare function bindReact<const M extends AdminModule>({ module, views }: {
|
|
29
|
+
module: M;
|
|
30
|
+
views: ReactViews<M>;
|
|
31
|
+
}, { context }?: {
|
|
32
|
+
context?: ReactContext<ScopedPorts<M> | null>;
|
|
33
|
+
}): {
|
|
34
|
+
module: M;
|
|
35
|
+
pages: { [P in keyof M["pages"]]: {
|
|
36
|
+
Page: LazyExoticComponent<ComponentType<ModulePageProps>>;
|
|
37
|
+
tabs: { [T in keyof M["pages"][P]["tabs"]]: LazyExoticComponent<ComponentType<TabViewProps>>; };
|
|
38
|
+
}; };
|
|
39
|
+
Provider: ({ admin, children }: {
|
|
40
|
+
admin: AdminInstance;
|
|
41
|
+
children: ReactNode;
|
|
42
|
+
}, _optional?: Record<string, never>) => import("react").FunctionComponentElement<import("react").ProviderProps<ScopedPorts<M> | null>>;
|
|
43
|
+
usePorts: (_required?: Record<string, never>, _optional?: Record<string, never>) => ScopedPorts<M>;
|
|
44
|
+
};
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=bind-react.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createContext, createElement, lazy, useContext } from 'react';
|
|
2
|
+
import { AdminConfigError } from '../core/module/create-admin.js';
|
|
3
|
+
/** Every page and tab is lazy. The only port context is private to this binding;
|
|
4
|
+
* a sibling module can never read another module's dependencies through a global locator. */
|
|
5
|
+
export function bindReact({ module, views }, { context } = {}) {
|
|
6
|
+
const Context = context ?? createContext(null);
|
|
7
|
+
const pages = Object.fromEntries(Object.entries(views).map(([id, raw]) => {
|
|
8
|
+
const view = raw;
|
|
9
|
+
return [
|
|
10
|
+
id,
|
|
11
|
+
{
|
|
12
|
+
Page: lazy(view.page),
|
|
13
|
+
tabs: Object.fromEntries(Object.entries(view.tabs).map(([tab, load]) => [tab, lazy(load)])),
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
}));
|
|
17
|
+
function usePorts(_required = {}, _optional = {}) {
|
|
18
|
+
const ports = useContext(Context);
|
|
19
|
+
if (!ports)
|
|
20
|
+
throw new AdminConfigError({ issues: [`React scope unavailable: ${module.id}`] });
|
|
21
|
+
return ports;
|
|
22
|
+
}
|
|
23
|
+
function Provider({ admin, children }, _optional = {}) {
|
|
24
|
+
return createElement(Context.Provider, { value: admin.scope({ module }) }, children);
|
|
25
|
+
}
|
|
26
|
+
return { module, pages, Provider, usePorts };
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=bind-react.js.map
|
|
@@ -13,7 +13,13 @@
|
|
|
13
13
|
* @complexity O(1) per render/interaction. The two document-level listeners are attached only while
|
|
14
14
|
* armed, not for the component's whole mounted lifetime.
|
|
15
15
|
*/
|
|
16
|
-
export declare function useConfirmButton(
|
|
16
|
+
export declare function useConfirmButton({ onConfirm, document }: {
|
|
17
|
+
readonly onConfirm: () => void;
|
|
18
|
+
readonly document: Pick<Document, 'addEventListener' | 'removeEventListener'>;
|
|
19
|
+
}, { pending, disabled }?: {
|
|
20
|
+
readonly pending?: boolean | undefined;
|
|
21
|
+
readonly disabled?: boolean | undefined;
|
|
22
|
+
}): {
|
|
17
23
|
confirming: boolean;
|
|
18
24
|
buttonRef: import("react").RefObject<HTMLButtonElement | null>;
|
|
19
25
|
handleClick: () => void;
|
|
@@ -14,7 +14,7 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
14
14
|
* @complexity O(1) per render/interaction. The two document-level listeners are attached only while
|
|
15
15
|
* armed, not for the component's whole mounted lifetime.
|
|
16
16
|
*/
|
|
17
|
-
export function useConfirmButton(pending, disabled
|
|
17
|
+
export function useConfirmButton({ onConfirm, document }, { pending, disabled } = {}) {
|
|
18
18
|
const [confirming, setConfirming] = useState(false);
|
|
19
19
|
const buttonRef = useRef(null);
|
|
20
20
|
// Listeners are scoped to the armed window only — an idle (disarmed) ConfirmButton costs nothing
|
|
@@ -40,7 +40,7 @@ export function useConfirmButton(pending, disabled, onConfirm) {
|
|
|
40
40
|
document.removeEventListener('mousedown', onDocMouseDown);
|
|
41
41
|
document.removeEventListener('keydown', onKeyDown);
|
|
42
42
|
};
|
|
43
|
-
}, [confirming]);
|
|
43
|
+
}, [confirming, document]);
|
|
44
44
|
function handleClick() {
|
|
45
45
|
if (pending || disabled)
|
|
46
46
|
return;
|
|
@@ -28,7 +28,7 @@ const DEFAULT_PENDING_LABEL = '…';
|
|
|
28
28
|
* defaulted to the real implementation, so a test can supply a fake without mocking modules).
|
|
29
29
|
*/
|
|
30
30
|
export function ConfirmButton({ useConfirmButton: useConfirmButtonState = useConfirmButton, ...props }) {
|
|
31
|
-
const { confirming, buttonRef, handleClick, handleBlur } = useConfirmButtonState(props.
|
|
31
|
+
const { confirming, buttonRef, handleClick, handleBlur } = useConfirmButtonState({ onConfirm: props.onConfirm, document }, { pending: props.pending, disabled: props.disabled });
|
|
32
32
|
const label = props.pending
|
|
33
33
|
? (props.pendingLabel ?? DEFAULT_PENDING_LABEL)
|
|
34
34
|
: confirming
|
|
@@ -22,8 +22,15 @@ import { type UseConfirmDialog } from './ConfirmDialog.hooks.js';
|
|
|
22
22
|
*
|
|
23
23
|
* | element | handle | role |
|
|
24
24
|
* |---|---|---|
|
|
25
|
-
* | the confirm action | `delete-role-confirm` | `button` |
|
|
26
25
|
* | the cancel/dismiss action | `delete-role-cancel` | `button` |
|
|
26
|
+
* | the confirm action, unless the caller opts out with `agentMayConfirm={false}` | `delete-role-confirm` | `button` |
|
|
27
|
+
*
|
|
28
|
+
* The confirm action is agent-reachable by default, same as every other published control — the
|
|
29
|
+
* product's standing policy is that the in-page assistant may click buttons, fill forms and confirm
|
|
30
|
+
* dialogs, with permanently destructive actions gated by a separate in-chat confirmation at the tool
|
|
31
|
+
* level rather than by hiding the button. A caller whose dialog must stay human-only regardless
|
|
32
|
+
* (e.g. it guards a secret the assistant must never see or move on its own) opts out explicitly with
|
|
33
|
+
* `agentMayConfirm={false}`.
|
|
27
34
|
*
|
|
28
35
|
* Both segments are literals this component chooses itself, never host data — unlike `RowMenu`'s
|
|
29
36
|
* per-item keys (arbitrary host strings that can collide after slugifying), `confirm`/`cancel`
|
|
@@ -31,7 +38,7 @@ import { type UseConfirmDialog } from './ConfirmDialog.hooks.js';
|
|
|
31
38
|
* choice of name, and a bad one should fail loudly at first render rather than silently answer to a
|
|
32
39
|
* handle the caller never wrote. Omit `agentHandle` and no `data-agent-*` markup is emitted at all.
|
|
33
40
|
*
|
|
34
|
-
*
|
|
41
|
+
* The published handles are present in the DOM as soon as `agentHandle` is supplied, regardless of `open` —
|
|
35
42
|
* this component stays mounted and toggles the native `<dialog>`'s open state rather than being
|
|
36
43
|
* conditionally rendered by its caller (see `useConfirmDialog`'s doc comment), so there is no
|
|
37
44
|
* "closed" render that omits them, the same reasoning `RowMenu`'s always-visible trigger handle
|
|
@@ -77,6 +84,11 @@ export interface ConfirmDialogProps {
|
|
|
77
84
|
/** This dialog's own agent handle — see this file's "Agent handles" doc comment for the full
|
|
78
85
|
* scheme. Omit and no `data-agent-*` markup is emitted at all. */
|
|
79
86
|
agentHandle?: string;
|
|
87
|
+
/** Publishes the confirm action (`<agentHandle>-confirm`) so the assistant can confirm this
|
|
88
|
+
* dialog without a human — on by default, matching every other published control. Pass `false`
|
|
89
|
+
* only for a dialog that must stay human-only regardless (e.g. it guards a secret). Has no
|
|
90
|
+
* effect without `agentHandle`. @default true */
|
|
91
|
+
agentMayConfirm?: boolean;
|
|
80
92
|
}
|
|
81
93
|
/**
|
|
82
94
|
* Controlled modal confirm — renders the `<dialog>` markup and delegates its open/close and focus
|
|
@@ -87,5 +99,5 @@ export interface ConfirmDialogProps {
|
|
|
87
99
|
* is no browser-assigned "default button" for Enter to reach for at all; confirm can only ever fire
|
|
88
100
|
* from an explicit click or explicit Tab-then-Enter onto it.
|
|
89
101
|
*/
|
|
90
|
-
export declare function ConfirmDialog({ useDialog, agentHandle: baseHandle, ...props }: ConfirmDialogProps): import("react").JSX.Element;
|
|
102
|
+
export declare function ConfirmDialog({ useDialog, agentHandle: baseHandle, agentMayConfirm, ...props }: ConfirmDialogProps): import("react").JSX.Element;
|
|
91
103
|
//# sourceMappingURL=ConfirmDialog.d.ts.map
|
|
@@ -32,7 +32,13 @@ export interface ConfirmDialogController {
|
|
|
32
32
|
}
|
|
33
33
|
/** The signature `ConfirmDialogProps.useDialog` accepts. Any hook matching this can drive the
|
|
34
34
|
* component; it does not have to be {@link useConfirmDialog}, or even use React state at all. */
|
|
35
|
-
export type UseConfirmDialog = (
|
|
35
|
+
export type UseConfirmDialog = (requiredArgs: {
|
|
36
|
+
readonly open: boolean;
|
|
37
|
+
readonly onCancel: () => void;
|
|
38
|
+
readonly document: Pick<Document, 'activeElement'>;
|
|
39
|
+
}, optionalArgs?: {
|
|
40
|
+
readonly pending?: boolean | undefined;
|
|
41
|
+
}) => ConfirmDialogController;
|
|
36
42
|
/**
|
|
37
43
|
* Host-wide defaults every `ConfirmDialog` beneath a {@link ConfirmDialogDefaultsProvider} falls
|
|
38
44
|
* back to when the matching prop is not passed explicitly. Today this is only `cancelLabel` — see
|
|
@@ -68,7 +74,9 @@ export declare function ConfirmDialogDefaultsProvider({ children, cancelLabel }:
|
|
|
68
74
|
* @returns The label to render.
|
|
69
75
|
* @complexity O(1).
|
|
70
76
|
*/
|
|
71
|
-
export declare function useConfirmDialogCancelLabel(
|
|
77
|
+
export declare function useConfirmDialogCancelLabel(_requiredArgs: Record<string, never>, { explicit }?: {
|
|
78
|
+
readonly explicit?: string | undefined;
|
|
79
|
+
}): string;
|
|
72
80
|
/**
|
|
73
81
|
* Owns the `<dialog>` element's open/close lifecycle and focus management for `ConfirmDialog`.
|
|
74
82
|
*
|
|
@@ -81,5 +89,11 @@ export declare function useConfirmDialogCancelLabel(explicit: string | undefined
|
|
|
81
89
|
*
|
|
82
90
|
* @complexity O(1) per open/close transition — one `showModal`/`close` call and one focus move.
|
|
83
91
|
*/
|
|
84
|
-
export declare function useConfirmDialog(open
|
|
92
|
+
export declare function useConfirmDialog({ open, onCancel, document }: {
|
|
93
|
+
readonly open: boolean;
|
|
94
|
+
readonly onCancel: () => void;
|
|
95
|
+
readonly document: Pick<Document, 'activeElement'>;
|
|
96
|
+
}, { pending }?: {
|
|
97
|
+
readonly pending?: boolean | undefined;
|
|
98
|
+
}): ConfirmDialogController;
|
|
85
99
|
//# sourceMappingURL=ConfirmDialog.hooks.d.ts.map
|
|
@@ -36,7 +36,7 @@ export function ConfirmDialogDefaultsProvider({ children, cancelLabel }) {
|
|
|
36
36
|
* @returns The label to render.
|
|
37
37
|
* @complexity O(1).
|
|
38
38
|
*/
|
|
39
|
-
export function useConfirmDialogCancelLabel(explicit) {
|
|
39
|
+
export function useConfirmDialogCancelLabel(_requiredArgs, { explicit } = {}) {
|
|
40
40
|
const { cancelLabel } = useContext(ConfirmDialogDefaultsContext);
|
|
41
41
|
return explicit ?? cancelLabel ?? DEFAULT_CANCEL_LABEL;
|
|
42
42
|
}
|
|
@@ -52,7 +52,7 @@ export function useConfirmDialogCancelLabel(explicit) {
|
|
|
52
52
|
*
|
|
53
53
|
* @complexity O(1) per open/close transition — one `showModal`/`close` call and one focus move.
|
|
54
54
|
*/
|
|
55
|
-
export function useConfirmDialog(open,
|
|
55
|
+
export function useConfirmDialog({ open, onCancel, document }, { pending } = {}) {
|
|
56
56
|
// `useId()`, not a string literal — a hardcoded id breaks the moment a screen mounts two
|
|
57
57
|
// `ConfirmDialog`s at once (a delete-role and a delete-policy confirm on one page, both
|
|
58
58
|
// stay-mounted/toggle-`open` per this hook's own doc comment above): two `<h2>`s share one
|
|
@@ -95,7 +95,7 @@ export function useConfirmDialog(open, pending, onCancel) {
|
|
|
95
95
|
if (triggerRef.current instanceof HTMLElement)
|
|
96
96
|
triggerRef.current.focus();
|
|
97
97
|
}
|
|
98
|
-
}, [open]);
|
|
98
|
+
}, [open, document]);
|
|
99
99
|
function handleNativeCancel(e) {
|
|
100
100
|
// Fires on Escape while a real `showModal()`-opened dialog has focus. Always prevented: the
|
|
101
101
|
// effect above is the single source of truth for open/closed (driven by `open`), so
|
|
@@ -65,7 +65,7 @@ function confirmDialogCancelLabel(cancelLabel, title) {
|
|
|
65
65
|
* @complexity O(1).
|
|
66
66
|
*/
|
|
67
67
|
function confirmDialogAgentProps(base, action, options) {
|
|
68
|
-
return base === undefined ? {} : agentHandle(`${base}-${action}
|
|
68
|
+
return base === undefined ? {} : agentHandle({ handle: `${base}-${action}` }, options);
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* Controlled modal confirm — renders the `<dialog>` markup and delegates its open/close and focus
|
|
@@ -76,14 +76,14 @@ function confirmDialogAgentProps(base, action, options) {
|
|
|
76
76
|
* is no browser-assigned "default button" for Enter to reach for at all; confirm can only ever fire
|
|
77
77
|
* from an explicit click or explicit Tab-then-Enter onto it.
|
|
78
78
|
*/
|
|
79
|
-
export function ConfirmDialog({ useDialog = useConfirmDialog, agentHandle: baseHandle, ...props }) {
|
|
80
|
-
const { titleId, dialogRef, cancelRef, handleNativeCancel, handleBackdropClick } = useDialog(props.open, props.
|
|
81
|
-
const tone = resolveTone(props);
|
|
82
|
-
const cancelLabel = useConfirmDialogCancelLabel(props.cancelLabel);
|
|
79
|
+
export function ConfirmDialog({ useDialog = useConfirmDialog, agentHandle: baseHandle, agentMayConfirm = true, ...props }) {
|
|
80
|
+
const { titleId, dialogRef, cancelRef, handleNativeCancel, handleBackdropClick } = useDialog({ open: props.open, onCancel: props.onCancel, document }, { pending: props.pending });
|
|
81
|
+
const tone = resolveTone({}, props);
|
|
82
|
+
const cancelLabel = useConfirmDialogCancelLabel({}, { explicit: props.cancelLabel });
|
|
83
83
|
return (_jsxs("dialog", { ref: dialogRef, className: "confirm-dialog", "aria-labelledby": titleId, onCancel: handleNativeCancel, onClick: handleBackdropClick, children: [_jsx("h2", { id: titleId, children: props.title }), _jsx("div", { className: "confirm-dialog-body", children: props.body }), _jsxs("div", { className: "confirm-dialog-actions", children: [_jsx("button", { ref: cancelRef, type: "button", className: "btn-secondary", disabled: props.pending, onClick: props.onCancel, ...confirmDialogAgentProps(baseHandle, CANCEL_HANDLE_ACTION, {
|
|
84
84
|
role: 'button',
|
|
85
85
|
label: confirmDialogCancelLabel(cancelLabel, props.title),
|
|
86
|
-
}), children: cancelLabel }), _jsx("button", { type: "button", className: toneClassName(tone), disabled: props.pending, onClick: props.onConfirm, ...confirmDialogAgentProps(baseHandle, CONFIRM_HANDLE_ACTION, {
|
|
86
|
+
}), children: cancelLabel }), _jsx("button", { type: "button", className: toneClassName({ tone }), disabled: props.pending, onClick: () => props.onConfirm(), ...confirmDialogAgentProps(agentMayConfirm ? baseHandle : undefined, CONFIRM_HANDLE_ACTION, {
|
|
87
87
|
role: 'button',
|
|
88
88
|
label: confirmDialogConfirmLabel(props.confirmLabel, props.title, tone),
|
|
89
89
|
}), children: props.confirmLabel })] })] }));
|
|
@@ -3,7 +3,9 @@ import { type CanvasEmbedPlaceholderDescriptor, type InteractiveHtmlEditorProps
|
|
|
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,
|
|
5
5
|
* which is not always called with a real DOM `Element` — see that helper's own doc. */
|
|
6
|
-
export declare function isProtectedEmbedElement(el
|
|
6
|
+
export declare function isProtectedEmbedElement({ el }: {
|
|
7
|
+
readonly el: Element;
|
|
8
|
+
}): boolean;
|
|
7
9
|
/**
|
|
8
10
|
* Recognizes a `data-embed-config` marker (the consuming product's own `src/core/embeds/marker.ts`'s single scanner
|
|
9
11
|
* convention) on a live canvas element and describes it for `@jini-ai/ui/html-editor`'s
|
|
@@ -19,7 +21,9 @@ export declare function isProtectedEmbedElement(el: Element): boolean;
|
|
|
19
21
|
*
|
|
20
22
|
* @complexity O(1) — one attribute read, one `JSON.parse` of a small config object, one table lookup.
|
|
21
23
|
*/
|
|
22
|
-
export declare function describeEmbedPlaceholder(el
|
|
24
|
+
export declare function describeEmbedPlaceholder({ el }: {
|
|
25
|
+
readonly el: Element;
|
|
26
|
+
}): CanvasEmbedPlaceholderDescriptor | undefined;
|
|
23
27
|
export type InteractiveHtmlEditorProps = Omit<HtmlEditorProps, 'isProtectedElement' | 'describeEmbedPlaceholder'>;
|
|
24
28
|
export declare function InteractiveHtmlEditor(props: InteractiveHtmlEditorProps): import("react").JSX.Element;
|
|
25
29
|
//# sourceMappingURL=InteractiveHtmlEditor.d.ts.map
|
|
@@ -2,14 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { InteractiveHtmlEditor as HtmlEditor, hasAttributeOnAnyNodeShape, } from '@jini-ai/ui/html-editor';
|
|
3
3
|
/**
|
|
4
4
|
* @file Consuming-product-specific composition of `@jini-ai/ui/html-editor`'s generic
|
|
5
|
-
* `InteractiveHtmlEditor`: a
|
|
6
|
-
* `apps/admin/src/features/pages/PageEditor.tsx`)
|
|
5
|
+
* `InteractiveHtmlEditor`: a page editor's `body_html`
|
|
7
6
|
* can carry `<div data-embed-type="…" data-embed-id="…"></div>` placeholders (and the legacy
|
|
8
7
|
* `data-widget-embed`/`data-form-embed` attributes on migration-era rows) that a separate scanner
|
|
9
|
-
*
|
|
8
|
+
* in the host resolves at render time — that scanner requires the div to
|
|
10
9
|
* stay exactly empty and self-closing, and degrades silently, with no error, the moment anything is
|
|
11
10
|
* written inside one. The CURRENT convention has since moved to a single `data-embed-config`
|
|
12
|
-
* attribute carrying a JSON payload
|
|
11
|
+
* attribute carrying a JSON payload in the host marker schema; `isProtectedEmbedElement`
|
|
13
12
|
* below has not been updated to recognize it (tracked separately — see that function's own doc), but
|
|
14
13
|
* `describeEmbedPlaceholder` below IS built against the current convention, since it only needs to
|
|
15
14
|
* read the marker, not police edits to it.
|
|
@@ -35,7 +34,7 @@ const EMBED_MARKER_ATTRIBUTES = ['data-embed-type', 'data-widget-embed', 'data-f
|
|
|
35
34
|
* direct unit-testability without mounting the editor. Uses `hasAttributeOnAnyNodeShape` because
|
|
36
35
|
* the `isProtectedElement` predicate is invoked from inside GrapesJS's `isComponent` callback,
|
|
37
36
|
* which is not always called with a real DOM `Element` — see that helper's own doc. */
|
|
38
|
-
export function isProtectedEmbedElement(el) {
|
|
37
|
+
export function isProtectedEmbedElement({ el }) {
|
|
39
38
|
return EMBED_MARKER_ATTRIBUTES.some((attr) => hasAttributeOnAnyNodeShape(el, attr));
|
|
40
39
|
}
|
|
41
40
|
/**
|
|
@@ -91,7 +90,7 @@ const ID_PREVIEW_LENGTH = 8;
|
|
|
91
90
|
* otherwise a truncated `id`, otherwise an explicit "nothing was set" note rather than a blank line.
|
|
92
91
|
*
|
|
93
92
|
* **Deliberately does not fetch a human title for a `media` marker.** There is no cheap existing admin
|
|
94
|
-
* route for a single media asset's title by id —
|
|
93
|
+
* route for a single media asset's title by id — the host's media-list API
|
|
95
94
|
* is the only read, and it returns the ENTIRE workspace's media library, active and trashed, with no
|
|
96
95
|
* id filter or pagination, just to answer one id's `title`. Adding a `GET /media/:id` route is out of
|
|
97
96
|
* this feature's scope (an editor-chrome label is not worth a new server endpoint), and reusing
|
|
@@ -124,7 +123,7 @@ function identityLabel(config) {
|
|
|
124
123
|
*
|
|
125
124
|
* @complexity O(1) — one attribute read, one `JSON.parse` of a small config object, one table lookup.
|
|
126
125
|
*/
|
|
127
|
-
export function describeEmbedPlaceholder(el) {
|
|
126
|
+
export function describeEmbedPlaceholder({ el }) {
|
|
128
127
|
const raw = el.getAttribute('data-embed-config');
|
|
129
128
|
if (!raw)
|
|
130
129
|
return undefined;
|
|
@@ -144,6 +143,6 @@ export function describeEmbedPlaceholder(el) {
|
|
|
144
143
|
return { kindLabel: EMBED_KIND_LABELS[type] ?? titleCase(type), identityLabel: identityLabel(config) };
|
|
145
144
|
}
|
|
146
145
|
export function InteractiveHtmlEditor(props) {
|
|
147
|
-
return (_jsx(HtmlEditor, { ...props, isProtectedElement: isProtectedEmbedElement, describeEmbedPlaceholder: describeEmbedPlaceholder }));
|
|
146
|
+
return (_jsx(HtmlEditor, { ...props, isProtectedElement: (el) => isProtectedEmbedElement({ el }), describeEmbedPlaceholder: (el) => describeEmbedPlaceholder({ el }) }));
|
|
148
147
|
}
|
|
149
148
|
//# sourceMappingURL=InteractiveHtmlEditor.js.map
|
|
@@ -5,7 +5,8 @@ import { useRowMenu } from './RowMenu.hooks.js';
|
|
|
5
5
|
* so a row can grow more actions (Edit, Disable, Delete, …) without widening the table or producing
|
|
6
6
|
* the wall of buttons that pattern turns into.
|
|
7
7
|
*
|
|
8
|
-
* Portaled to `document.body`
|
|
8
|
+
* Portaled to `document.body` by default (or the host's `portalContainer`) and positioned with
|
|
9
|
+
* `getBoundingClientRect()` rather than rendered as
|
|
9
10
|
* an in-flow absolutely-positioned child of the trigger — an admin table normally sits inside a
|
|
10
11
|
* horizontal scroller (`overflow-x: auto`), and per the CSS overflow spec, setting either axis to a
|
|
11
12
|
* non-`visible` value forces the *other* axis to compute as `auto` as well, so a menu positioned to
|
|
@@ -72,6 +73,9 @@ export interface RowMenuProps {
|
|
|
72
73
|
/** This row's own agent handle — see this file's "Agent handles" doc comment for the full
|
|
73
74
|
* scheme. Omit and no `data-agent-*` markup is emitted at all. */
|
|
74
75
|
agentHandle?: string;
|
|
76
|
+
/** Host-owned popup container, outside the row's clipping scroller. Use a container within
|
|
77
|
+
* the page driver's root when its agent must reach menu items. Defaults to `document.body`. */
|
|
78
|
+
portalContainer?: Element | DocumentFragment;
|
|
75
79
|
}
|
|
76
80
|
export declare function RowMenu({ useRowMenu: useRowMenuState, agentHandle: baseHandle, ...props }: RowMenuProps): import("react").JSX.Element;
|
|
77
81
|
//# sourceMappingURL=RowMenu.d.ts.map
|
|
@@ -15,7 +15,11 @@ interface Position {
|
|
|
15
15
|
* @param itemCount Length of the caller's item list — the only piece of `RowMenuProps` this state
|
|
16
16
|
* needs, for `ArrowUp`-to-last-item and wraparound navigation.
|
|
17
17
|
*/
|
|
18
|
-
export declare function useRowMenu(itemCount
|
|
18
|
+
export declare function useRowMenu({ itemCount, window, document }: {
|
|
19
|
+
readonly itemCount: number;
|
|
20
|
+
readonly window: Pick<Window, 'innerHeight' | 'innerWidth' | 'addEventListener' | 'removeEventListener'>;
|
|
21
|
+
readonly document: Pick<Document, 'addEventListener' | 'removeEventListener'>;
|
|
22
|
+
}): {
|
|
19
23
|
open: boolean;
|
|
20
24
|
position: Position | null;
|
|
21
25
|
triggerRef: import("react").RefObject<HTMLButtonElement | null>;
|
|
@@ -24,7 +28,9 @@ export declare function useRowMenu(itemCount: number): {
|
|
|
24
28
|
onTriggerClick: () => void;
|
|
25
29
|
onTriggerKeyDown: (e: KeyboardEvent<HTMLButtonElement>) => void;
|
|
26
30
|
onMenuKeyDown: (e: KeyboardEvent<HTMLDivElement>) => void;
|
|
27
|
-
selectItem: (onSelect:
|
|
31
|
+
selectItem: ({ onSelect }: {
|
|
32
|
+
readonly onSelect: () => void;
|
|
33
|
+
}) => void;
|
|
28
34
|
};
|
|
29
35
|
export {};
|
|
30
36
|
//# sourceMappingURL=RowMenu.hooks.d.ts.map
|