@declarion/react 0.65.1 → 0.66.1
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/dist-lib/api/access-expiry.js +32 -0
- package/dist-lib/api/agents.js +105 -0
- package/dist-lib/api/auth-redirect.js +30 -0
- package/dist-lib/api/auth.js +67 -0
- package/dist-lib/api/batch.js +34 -0
- package/dist-lib/api/client.js +241 -0
- package/dist-lib/api/data.js +122 -0
- package/dist-lib/api/entities.js +160 -0
- package/dist-lib/api/events.js +120 -0
- package/dist-lib/api/fileReferences.js +8 -0
- package/dist-lib/api/params.js +20 -0
- package/dist-lib/api/properties.js +25 -0
- package/dist-lib/api/request-bounds.js +28 -0
- package/dist-lib/api/schema.js +71 -0
- package/dist-lib/api/session-renewal.js +36 -0
- package/dist-lib/api/status.js +17 -0
- package/dist-lib/app.js +262 -0
- package/dist-lib/components/actions/ActionButton.js +116 -0
- package/dist-lib/{ActionDialog-C6EG-AmC.js → components/actions/ActionDialog.js} +63 -53
- package/dist-lib/{ActionResultDialog.impl-BATutW8J.js → components/actions/ActionResultDialog.impl.js} +53 -48
- package/dist-lib/components/actions/ActionResultDialog.js +12 -0
- package/dist-lib/components/actions/ActionRunner.js +274 -0
- package/dist-lib/components/actions/ObjectActionBar.js +127 -0
- package/dist-lib/components/actions/PropertyGridEditor.js +202 -0
- package/dist-lib/components/actions/ResponsiveActionBar.js +773 -0
- package/dist-lib/components/actions/RowActionsKebab.js +90 -0
- package/dist-lib/{AgentChatPanel.impl-D5y_qEex.js → components/agents/AgentChatPanel.impl.js} +314 -362
- package/dist-lib/components/agents/AgentChatPanel.js +12 -0
- package/dist-lib/components/agents/AgentConversationDrawer.js +59 -0
- package/dist-lib/components/agents/AgentElicitForm.js +152 -0
- package/dist-lib/components/agents/AgentOpenFollower.impl.js +7 -0
- package/dist-lib/components/agents/AgentOpenFollower.js +12 -0
- package/dist-lib/components/agents/AgentPicker.js +58 -0
- package/dist-lib/components/agents/transcript-runs.js +52 -0
- package/dist-lib/components/chrome/AssociationTabs.js +176 -0
- package/dist-lib/components/chrome/AuditMetaStrip.js +64 -0
- package/dist-lib/components/chrome/Breadcrumbs.js +67 -0
- package/dist-lib/components/chrome/HighlightsStrip.js +39 -0
- package/dist-lib/{PageHeader-DiwLe7CO.js → components/chrome/PageHeader.js} +19 -15
- package/dist-lib/{PageShell-BJz1MiTH.js → components/chrome/PageShell.js} +3 -3
- package/dist-lib/components/chrome/RecordHeader.js +119 -0
- package/dist-lib/{headerActionZone-bef-tZZ7.js → components/chrome/headerActionZone.js} +1 -1
- package/dist-lib/components/detail-layout/AssociatedBlock.js +1244 -0
- package/dist-lib/components/detail-layout/AssociatedToolbar.js +87 -0
- package/dist-lib/components/detail-layout/ChildrenBlock.js +80 -0
- package/dist-lib/components/detail-layout/ChildrenCards.js +156 -0
- package/dist-lib/components/detail-layout/ChildrenList.js +135 -0
- package/dist-lib/components/detail-layout/ChildrenTable.js +189 -0
- package/dist-lib/components/detail-layout/ChildrenTimeline.js +609 -0
- package/dist-lib/components/detail-layout/DetailAuditStrip.js +40 -0
- package/dist-lib/components/detail-layout/DetailHighlights.js +54 -0
- package/dist-lib/{DraggableChildrenTable-Dd5SeuF6.js → components/detail-layout/DraggableChildrenTable.js} +56 -53
- package/dist-lib/components/detail-layout/EditableChildrenTable.js +341 -0
- package/dist-lib/components/detail-layout/ErrorSummary.js +89 -0
- package/dist-lib/components/detail-layout/EvidenceBlock.js +66 -0
- package/dist-lib/{FieldRow-DedGIY9R.js → components/detail-layout/FieldRow.js} +8 -7
- package/dist-lib/components/detail-layout/FieldsBlock.js +74 -0
- package/dist-lib/components/detail-layout/LayoutColumn.js +16 -0
- package/dist-lib/components/detail-layout/LayoutRenderer.js +54 -0
- package/dist-lib/components/detail-layout/LayoutRow.js +83 -0
- package/dist-lib/components/detail-layout/LayoutTabs.js +195 -0
- package/dist-lib/components/detail-layout/PropertiesBlock.js +74 -0
- package/dist-lib/components/detail-layout/QuickAddForm.js +81 -0
- package/dist-lib/components/detail-layout/SectionBlock.js +48 -0
- package/dist-lib/components/detail-layout/StatusesBlock.js +18 -0
- package/dist-lib/components/detail-layout/TimelineComposer.js +205 -0
- package/dist-lib/components/detail-layout/blockMeta.js +27 -0
- package/dist-lib/components/detail-layout/useManualColumnResize.js +94 -0
- package/dist-lib/components/detail-layout/useQuickAdd.js +85 -0
- package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +295 -0
- package/dist-lib/components/detail-layout/widgets/JsonDiffWidget.js +107 -0
- package/dist-lib/components/detail-layout/widgets/MonacoJson.js +47 -0
- package/dist-lib/components/detail-layout/widgets/WidgetHost.js +36 -0
- package/dist-lib/components/detail-layout/widgets/builtins.js +10 -0
- package/dist-lib/components/detail-layout/widgets/canonicalizeJson.js +32 -0
- package/dist-lib/components/detail-layout/widgets/monacoBootstrap.js +16 -0
- package/dist-lib/components/detail-layout/widgets/registry.js +13 -0
- package/dist-lib/components/fields/BoolField.js +13 -0
- package/dist-lib/components/fields/EmailField.js +16 -0
- package/dist-lib/components/fields/EnumField.js +38 -0
- package/dist-lib/components/fields/FileReferenceField.js +60 -0
- package/dist-lib/components/fields/IntArrayField.js +83 -0
- package/dist-lib/components/fields/JsonField.js +51 -0
- package/dist-lib/components/fields/MultilangArrayField.js +56 -0
- package/dist-lib/components/fields/MultilangField.js +65 -0
- package/dist-lib/components/fields/MultilangTextField.js +65 -0
- package/dist-lib/components/fields/NumberField.js +64 -0
- package/dist-lib/components/fields/PasswordField.js +34 -0
- package/dist-lib/components/fields/PhoneField.js +84 -0
- package/dist-lib/components/fields/RefCombobox.js +112 -0
- package/dist-lib/components/fields/RefField.js +45 -0
- package/dist-lib/components/fields/RichTextField.js +225 -0
- package/dist-lib/components/fields/SecretField.js +34 -0
- package/dist-lib/components/fields/StringArrayField.js +165 -0
- package/dist-lib/components/fields/StringField.js +39 -0
- package/dist-lib/components/fields/StructureField.js +221 -0
- package/dist-lib/components/fields/TextField.js +76 -0
- package/dist-lib/components/fields/TimestampField.js +110 -0
- package/dist-lib/components/fields/UrlField.js +18 -0
- package/dist-lib/components/fields/cells/factories/badge.js +42 -0
- package/dist-lib/components/fields/cells/factories/boolPill.js +17 -0
- package/dist-lib/components/fields/cells/factories/code.js +11 -0
- package/dist-lib/components/fields/cells/factories/date.js +30 -0
- package/dist-lib/components/fields/cells/factories/email.js +26 -0
- package/dist-lib/components/fields/cells/factories/emptyCell.js +10 -0
- package/dist-lib/components/fields/cells/factories/fileReference.js +17 -0
- package/dist-lib/components/fields/cells/factories/host-icons.js +146 -0
- package/dist-lib/components/fields/cells/factories/json.js +61 -0
- package/dist-lib/components/fields/cells/factories/link.js +32 -0
- package/dist-lib/components/fields/cells/factories/markdown.js +31 -0
- package/dist-lib/components/fields/cells/factories/markdownPreview.js +81 -0
- package/dist-lib/components/fields/cells/factories/money.js +37 -0
- package/dist-lib/components/fields/cells/factories/multilangInline.js +35 -0
- package/dist-lib/components/fields/cells/factories/nextRun.js +46 -0
- package/dist-lib/components/fields/cells/factories/number.js +42 -0
- package/dist-lib/components/fields/cells/factories/passwordMask.js +23 -0
- package/dist-lib/components/fields/cells/factories/phone.js +35 -0
- package/dist-lib/components/fields/cells/factories/refLink.js +57 -0
- package/dist-lib/components/fields/cells/factories/richTextPreview.js +34 -0
- package/dist-lib/components/fields/cells/factories/statusPill.js +35 -0
- package/dist-lib/components/fields/cells/factories/tagList.js +44 -0
- package/dist-lib/components/fields/cells/factories/text.js +5 -0
- package/dist-lib/components/fields/cells/factories/timestamp.js +18 -0
- package/dist-lib/components/fields/cells/factories/url-helpers.js +49 -0
- package/dist-lib/components/fields/cells/factories/url.js +45 -0
- package/dist-lib/components/fields/cells/registry.js +58 -0
- package/dist-lib/components/fields/index.js +80 -0
- package/dist-lib/components/fields/langMap.js +6 -0
- package/dist-lib/components/fields/secretValue.js +7 -0
- package/dist-lib/components/file-widgets/CircleImage.js +11 -0
- package/dist-lib/components/file-widgets/DocumentCard.js +277 -0
- package/dist-lib/components/file-widgets/FileList.js +213 -0
- package/dist-lib/{Grid-XUHm5SDe.js → components/file-widgets/Grid.js} +45 -40
- package/dist-lib/components/file-widgets/GridLazy.js +15 -0
- package/dist-lib/components/file-widgets/ImageWidget.js +354 -0
- package/dist-lib/components/file-widgets/LabeledSlots.js +69 -0
- package/dist-lib/components/file-widgets/SquareImage.js +11 -0
- package/dist-lib/components/file-widgets/UnknownFileWidget.js +22 -0
- package/dist-lib/components/file-widgets/UploadFailureText.js +10 -0
- package/dist-lib/components/file-widgets/WideBanner.js +11 -0
- package/dist-lib/components/file-widgets/builtins.js +15 -0
- package/dist-lib/components/file-widgets/cropper.js +13 -0
- package/dist-lib/components/file-widgets/draft-scope.js +59 -0
- package/dist-lib/components/file-widgets/helpers.js +75 -0
- package/dist-lib/components/file-widgets/host.js +75 -0
- package/dist-lib/{payload-DioMoxMX.js → components/file-widgets/payload.js} +14 -14
- package/dist-lib/components/file-widgets/registry.js +13 -0
- package/dist-lib/components/file-widgets/upload.js +180 -0
- package/dist-lib/components/file-widgets/useEmbedFileSrc.js +45 -0
- package/dist-lib/components/file-widgets/value.js +12 -0
- package/dist-lib/components/filters/FilterChips.js +123 -0
- package/dist-lib/components/filters/FilterConditionValue.js +40 -0
- package/dist-lib/components/filters/FilterDrawer.js +670 -0
- package/dist-lib/components/filters/FilterOmittedNotice.js +14 -0
- package/dist-lib/components/filters/filter-op-label.js +8 -0
- package/dist-lib/{CommandPalette.impl-DRI5kxVY.js → components/layout/CommandPalette.impl.js} +62 -61
- package/dist-lib/components/layout/CommandPalette.js +12 -0
- package/dist-lib/{DirtyTabsCloseDialog.impl-FhAiOmEb.js → components/layout/DirtyTabsCloseDialog.impl.js} +16 -14
- package/dist-lib/components/layout/DirtyTabsCloseDialog.js +12 -0
- package/dist-lib/{ImpersonationBanner.impl--g0iYwcV.js → components/layout/ImpersonationBanner.impl.js} +4 -3
- package/dist-lib/components/layout/ImpersonationBanner.js +12 -0
- package/dist-lib/components/layout/ImpersonationFrame.js +29 -0
- package/dist-lib/{ImpersonationStartModal.impl-BFBN0YJe.js → components/layout/ImpersonationStartModal.impl.js} +9 -9
- package/dist-lib/components/layout/ImpersonationStartModal.js +12 -0
- package/dist-lib/components/layout/Layout.js +755 -0
- package/dist-lib/components/layout/Rail.js +149 -0
- package/dist-lib/components/layout/Sidebar.js +362 -0
- package/dist-lib/components/layout/TabStrip.js +321 -0
- package/dist-lib/components/layout/TenantChip.js +355 -0
- package/dist-lib/components/layout/TopBar.js +305 -0
- package/dist-lib/components/layout/tab-close.js +24 -0
- package/dist-lib/components/list/ColumnPicker.js +112 -0
- package/dist-lib/components/list/InlineEditCell.js +107 -0
- package/dist-lib/components/list/PeekFieldCell.js +143 -0
- package/dist-lib/components/list/QuickPeek.js +263 -0
- package/dist-lib/components/list/ViewSwitcher.js +156 -0
- package/dist-lib/components/list/peekDraftStore.js +14 -0
- package/dist-lib/{AdminCatalogPage.impl-B-7MLqa1.js → components/pages/AdminCatalogPage.impl.js} +53 -49
- package/dist-lib/components/pages/AdminCatalogPage.js +12 -0
- package/dist-lib/components/pages/DocumentsMenu.js +150 -0
- package/dist-lib/components/pages/ExportMenu.js +123 -0
- package/dist-lib/{NotFoundPage.impl-BoX11u-P.js → components/pages/NotFoundPage.impl.js} +6 -4
- package/dist-lib/components/pages/NotFoundPage.js +12 -0
- package/dist-lib/components/pages/RecordDocumentsPanel.js +230 -0
- package/dist-lib/components/pages/RecordNotesPanel.js +200 -0
- package/dist-lib/components/pages/RecordPanels.js +18 -0
- package/dist-lib/components/pages/SSOCallbackPage.impl.js +28 -0
- package/dist-lib/components/pages/SSOCallbackPage.js +12 -0
- package/dist-lib/components/pages/SmartDetailPage.impl.js +986 -0
- package/dist-lib/components/pages/SmartDetailPage.js +12 -0
- package/dist-lib/components/pages/SmartListPage.impl.js +708 -0
- package/dist-lib/components/pages/SmartListPage.js +12 -0
- package/dist-lib/components/pages/SmartRecordListPage.impl.js +818 -0
- package/dist-lib/components/pages/SmartRecordListPage.js +12 -0
- package/dist-lib/components/pages/auth/AuthShell.js +350 -0
- package/dist-lib/{Forgot.impl-6tL6SBlS.js → components/pages/auth/Forgot.impl.js} +13 -12
- package/dist-lib/components/pages/auth/Forgot.js +12 -0
- package/dist-lib/{Reset.impl-D0pjhS6d.js → components/pages/auth/Reset.impl.js} +17 -15
- package/dist-lib/components/pages/auth/Reset.js +12 -0
- package/dist-lib/components/pages/auth/SignIn.js +252 -0
- package/dist-lib/{SignUp.impl-CfEXrUeg.js → components/pages/auth/SignUp.impl.js} +31 -27
- package/dist-lib/components/pages/auth/SignUp.js +12 -0
- package/dist-lib/{TwoFA.impl-B2HtPduH.js → components/pages/auth/TwoFA.impl.js} +9 -8
- package/dist-lib/components/pages/auth/TwoFA.js +12 -0
- package/dist-lib/components/pages/auth/icons.js +56 -0
- package/dist-lib/components/pages/exportRequest.js +17 -0
- package/dist-lib/components/pages/list/DataCell.js +27 -0
- package/dist-lib/components/pages/list/DeleteViewDialog.js +22 -0
- package/dist-lib/{ListCardsBody-BEoYjSZ2.js → components/pages/list/ListCardRow.js} +47 -72
- package/dist-lib/components/pages/list/ListCardsBody.js +31 -0
- package/dist-lib/components/pages/list/ListFloatbar.js +130 -0
- package/dist-lib/components/pages/list/ListFooter.js +138 -0
- package/dist-lib/components/pages/list/ListHeader.js +120 -0
- package/dist-lib/components/pages/list/ListNoRows.js +72 -0
- package/dist-lib/components/pages/list/ListTable.js +191 -0
- package/dist-lib/components/pages/list/ListTableRow.js +37 -0
- package/dist-lib/components/pages/list/ListToolbar.js +261 -0
- package/dist-lib/components/pages/list/ListUrlBanner.js +45 -0
- package/dist-lib/components/pages/list/RowActionsCell.js +49 -0
- package/dist-lib/components/pages/list/RowContextMenu.js +55 -0
- package/dist-lib/components/pages/list/SaveViewDialog.js +111 -0
- package/dist-lib/{SortHeaderMenu-Co5PvhTA.js → components/pages/list/SortHeaderMenu.js} +18 -17
- package/dist-lib/{cardProjection-Cxlogzh8.js → components/pages/list/cardProjection.js} +3 -3
- package/dist-lib/components/pages/list/column-sizing.js +17 -0
- package/dist-lib/components/pages/list/columns.js +168 -0
- package/dist-lib/components/pages/list/filter-meta.js +84 -0
- package/dist-lib/components/pages/list/page-size.js +11 -0
- package/dist-lib/components/pages/list/sortable-header.js +18 -0
- package/dist-lib/components/pages/list/table-features.js +11 -0
- package/dist-lib/components/pages/list/use-filter-value-labels.js +115 -0
- package/dist-lib/components/pages/list/useActiveView.js +98 -0
- package/dist-lib/components/pages/list/useHeaderReorder.js +93 -0
- package/dist-lib/components/pages/list/useListColumnLayout.js +56 -0
- package/dist-lib/components/pages/list/useListFilterPresentation.js +34 -0
- package/dist-lib/components/pages/list/useListQuery.js +101 -0
- package/dist-lib/components/pages/list/useListRowInteraction.js +120 -0
- package/dist-lib/components/pages/list/useListSelection.js +53 -0
- package/dist-lib/components/pages/list/useListSort.js +44 -0
- package/dist-lib/components/pages/list/useListViews.js +148 -0
- package/dist-lib/components/pages/list/useRowMenu.js +106 -0
- package/dist-lib/components/pages/list/visible-filters.js +19 -0
- package/dist-lib/{Preferences.impl-Ct5xwZtT.js → components/pages/profile/Preferences.impl.js} +34 -31
- package/dist-lib/components/pages/profile/Preferences.js +12 -0
- package/dist-lib/components/pages/profile/Profile.impl.js +437 -0
- package/dist-lib/components/pages/profile/Profile.js +12 -0
- package/dist-lib/{TenantParamsPage.impl-BGpdmEZg.js → components/pages/tenant-params/TenantParamsPage.impl.js} +45 -40
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.js +12 -0
- package/dist-lib/components/params/ParamsBlock.js +119 -0
- package/dist-lib/{param-editors-TYYU7HKK.js → components/params/param-editors.js} +32 -28
- package/dist-lib/components/primitives/Avatar.js +33 -0
- package/dist-lib/components/primitives/BoolToggle.js +35 -0
- package/dist-lib/components/primitives/BrandGlyph.js +38 -0
- package/dist-lib/components/primitives/BrandLogo.js +20 -0
- package/dist-lib/components/primitives/Btn.js +67 -0
- package/dist-lib/{Check-DAfMbQIw.js → components/primitives/Check.js} +2 -2
- package/dist-lib/components/primitives/Chip.js +44 -0
- package/dist-lib/components/primitives/ClassifiedFieldLocked.js +15 -0
- package/dist-lib/components/primitives/Dropdown.js +85 -0
- package/dist-lib/components/primitives/Fields.js +751 -0
- package/dist-lib/components/primitives/HoverCard.js +115 -0
- package/dist-lib/components/primitives/IconBtn.js +37 -0
- package/dist-lib/{Icons-lt-7lhYR.js → components/primitives/Icons.js} +1 -1
- package/dist-lib/{Kbd-CNttVu0z.js → components/primitives/Kbd.js} +2 -2
- package/dist-lib/components/primitives/MenuItem.js +57 -0
- package/dist-lib/{Pill-D-wsfRhx.js → components/primitives/Pill.js} +1 -1
- package/dist-lib/{RecordIdBadge-wbigZaFc.js → components/primitives/RecordIdBadge.js} +5 -5
- package/dist-lib/components/primitives/RowField.js +47 -0
- package/dist-lib/{SectionCard-BYHoHWJc.js → components/primitives/SectionCard.js} +10 -10
- package/dist-lib/components/primitives/Spinner.js +31 -0
- package/dist-lib/components/primitives/StatTile.js +108 -0
- package/dist-lib/components/primitives/Tooltip.js +115 -0
- package/dist-lib/{dataTableStyles-vwD1mVOP.js → components/primitives/dataTableStyles.js} +1 -1
- package/dist-lib/components/shared/BlankScreen.js +13 -0
- package/dist-lib/{ChangePasswordDialog.impl-5hDc0wpE.js → components/shared/ChangePasswordDialog.impl.js} +27 -22
- package/dist-lib/{ChangePasswordDialog-C_T_3pjl.js → components/shared/ChangePasswordDialog.js} +2 -2
- package/dist-lib/components/shared/ConfirmDialog.js +129 -0
- package/dist-lib/components/shared/ConnectionNotice.js +12 -0
- package/dist-lib/components/shared/CopyButton.js +25 -0
- package/dist-lib/components/shared/DynamicIcon.js +73 -0
- package/dist-lib/components/shared/EmptyState.js +56 -0
- package/dist-lib/components/shared/ErrorBoundary.js +96 -0
- package/dist-lib/components/shared/LoadingSkeleton.js +117 -0
- package/dist-lib/components/shared/LucideIcon.js +43 -0
- package/dist-lib/components/shared/Markdown.js +15 -0
- package/dist-lib/{MarkdownRenderer-sK2TRZS-.js → components/shared/MarkdownRenderer.js} +10 -9
- package/dist-lib/components/shared/RefreshControl.js +42 -0
- package/dist-lib/components/shared/StatusGroupsDisplay.js +123 -0
- package/dist-lib/components/shared/StatusStepper.js +70 -0
- package/dist-lib/components/shared/toast/DeclarionToast.js +308 -0
- package/dist-lib/components/shared/useOwnRefresh.js +19 -0
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/embed/EmbedAuthBootstrap.js +71 -0
- package/dist-lib/embed/EmbedContext.js +38 -0
- package/dist-lib/embed/EmbedDirtyReporter.js +17 -0
- package/dist-lib/embed/EmbedHistoryTracker.js +17 -0
- package/dist-lib/embed/EmbedLocationReporter.js +26 -0
- package/dist-lib/embed/EmbedResizeReporter.js +25 -0
- package/dist-lib/embed/EmbedUnsavedGuard.js +23 -0
- package/dist-lib/embed/embed-dirty.js +21 -0
- package/dist-lib/embed/embed-history.js +17 -0
- package/dist-lib/embed/embed-nav-guard.js +13 -0
- package/dist-lib/embed/file-src.js +60 -0
- package/dist-lib/embed/handshake.js +37 -0
- package/dist-lib/embed/params.js +45 -0
- package/dist-lib/embed/protocol.js +26 -0
- package/dist-lib/embed/screen-location.js +44 -0
- package/dist-lib/embed/theme.js +11 -0
- package/dist-lib/embed/token.js +54 -0
- package/dist-lib/embed/useEmbedNavigate.js +65 -0
- package/dist-lib/embed/useGlobalLinkInterceptor.js +63 -0
- package/dist-lib/hooks/useActionData.js +58 -0
- package/dist-lib/hooks/useAgentConversation.js +311 -0
- package/dist-lib/hooks/useAggregate.js +18 -0
- package/dist-lib/hooks/useAllEntityData.js +53 -0
- package/dist-lib/hooks/useAssociatedData.js +37 -0
- package/dist-lib/hooks/useAuth.js +56 -0
- package/dist-lib/hooks/useBranding.js +18 -0
- package/dist-lib/hooks/useBrandingChrome.js +58 -0
- package/dist-lib/hooks/useChildrenData.js +33 -0
- package/dist-lib/hooks/useColumns.js +44 -0
- package/dist-lib/hooks/useConnectionNotice.js +35 -0
- package/dist-lib/{useCurrentLocation-Bq1T72AW.js → hooks/useCurrentLocation.js} +2 -2
- package/dist-lib/hooks/useCurrentScreen.js +20 -0
- package/dist-lib/hooks/useCursorEntityData.js +77 -0
- package/dist-lib/hooks/useDebounce.js +11 -0
- package/dist-lib/hooks/useEntity.js +8 -0
- package/dist-lib/hooks/useEntityData.js +64 -0
- package/dist-lib/hooks/useFileReferenceJSON.js +29 -0
- package/dist-lib/hooks/useFilters.js +28 -0
- package/dist-lib/hooks/useFollowAgentOpen.js +84 -0
- package/dist-lib/hooks/useImpersonation.js +40 -0
- package/dist-lib/hooks/useIntentPrefetch.js +43 -0
- package/dist-lib/hooks/useJsonSnapshot.js +8 -0
- package/dist-lib/hooks/useLanguage.js +21 -0
- package/dist-lib/hooks/useLiveObject.js +17 -0
- package/dist-lib/hooks/useLongPress.js +49 -0
- package/dist-lib/hooks/useMutations.js +70 -0
- package/dist-lib/{useObject-B45F96rC.js → hooks/useObject.js} +2 -2
- package/dist-lib/hooks/useObjectStatus.js +20 -0
- package/dist-lib/hooks/usePageState.js +18 -0
- package/dist-lib/hooks/usePageStateRuntime.js +46 -0
- package/dist-lib/hooks/usePageStateTtl.js +10 -0
- package/dist-lib/hooks/useParams.js +123 -0
- package/dist-lib/hooks/useProperties.js +32 -0
- package/dist-lib/hooks/useRealtimeThresholds.js +31 -0
- package/dist-lib/hooks/useRegisterScreenTab.js +28 -0
- package/dist-lib/hooks/useResponsiveMode.js +84 -0
- package/dist-lib/hooks/useSSE.js +307 -0
- package/dist-lib/hooks/useSchema.js +73 -0
- package/dist-lib/hooks/useScreen.js +8 -0
- package/dist-lib/hooks/useScreenBack.js +60 -0
- package/dist-lib/hooks/useScreenTab.js +11 -0
- package/dist-lib/hooks/useTabNavigate.js +82 -0
- package/dist-lib/hooks/useTabSearchMirror.js +19 -0
- package/dist-lib/{useTabTitle-KrzEo118.js → hooks/useTabTitle.js} +9 -7
- package/dist-lib/hooks/useText.js +15 -0
- package/dist-lib/hooks/useTimelineData.js +44 -0
- package/dist-lib/hooks/useUnsavedInput.js +18 -0
- package/dist-lib/hooks/useVersionWatcher.js +62 -0
- package/dist-lib/hooks/useViews.js +88 -0
- package/dist-lib/hooks/useWindowConversation.js +11 -0
- package/dist-lib/icons.js +5 -3
- package/dist-lib/index.d.ts +42 -20
- package/dist-lib/index.js +131 -3926
- package/dist-lib/lib/action-dispatch.js +7 -0
- package/dist-lib/lib/actions.js +279 -0
- package/dist-lib/lib/anchor.js +41 -0
- package/dist-lib/lib/brand-tokens.js +95 -0
- package/dist-lib/lib/branding.js +25 -0
- package/dist-lib/lib/canonical-url.js +17 -0
- package/dist-lib/lib/capabilityPrefetch.js +57 -0
- package/dist-lib/lib/child-config.js +111 -0
- package/dist-lib/lib/children-validation.js +52 -0
- package/dist-lib/lib/decimal-text.js +15 -0
- package/dist-lib/lib/display-value.js +19 -0
- package/dist-lib/lib/document-templates.js +6 -0
- package/dist-lib/lib/download.js +41 -0
- package/dist-lib/lib/evidence-verdict.js +23 -0
- package/dist-lib/lib/failure.js +9 -0
- package/dist-lib/lib/field-classification.js +58 -0
- package/dist-lib/lib/field-regions.js +13 -0
- package/dist-lib/lib/filter-evaluator.js +98 -0
- package/dist-lib/lib/filters.js +118 -0
- package/dist-lib/lib/format-count.js +24 -0
- package/dist-lib/lib/html-state.js +9 -0
- package/dist-lib/lib/language.js +52 -0
- package/dist-lib/lib/longPressGesture.js +34 -0
- package/dist-lib/lib/mass-edit.js +65 -0
- package/dist-lib/{page-inset-D_kkVwwN.js → lib/page-inset.js} +1 -1
- package/dist-lib/lib/phone.js +28 -0
- package/dist-lib/lib/query-retry.js +7 -0
- package/dist-lib/lib/quick-add.js +23 -0
- package/dist-lib/lib/realtime-query-keys.js +23 -0
- package/dist-lib/lib/realtime-reconcile.js +148 -0
- package/dist-lib/lib/realtime-resync.js +192 -0
- package/dist-lib/lib/record-documents-key.js +4 -0
- package/dist-lib/lib/ref-choices.js +6 -0
- package/dist-lib/lib/refetch-when-idle.js +25 -0
- package/dist-lib/lib/rich-text.js +46 -0
- package/dist-lib/lib/rowClickGesture.js +10 -0
- package/dist-lib/lib/safe-url.js +34 -0
- package/dist-lib/lib/schema-routing.js +51 -0
- package/dist-lib/{screen-back-BtbEp5sO.js → lib/screen-back.js} +2 -2
- package/dist-lib/lib/scroll-restoration.js +156 -0
- package/dist-lib/lib/size-value.js +22 -0
- package/dist-lib/lib/sort.js +59 -0
- package/dist-lib/lib/timestamp.js +97 -0
- package/dist-lib/lib/toast.js +78 -0
- package/dist-lib/lib/ui-actions.js +81 -0
- package/dist-lib/{utils-D_QDpB8_.js → lib/utils.js} +1 -1
- package/dist-lib/lib/variants.js +63 -0
- package/dist-lib/lib/versionTracker.js +102 -0
- package/dist-lib/lib/viewport-category.js +12 -0
- package/dist-lib/{window-election-CHIvIZwx.js → lib/window-election.js} +1 -1
- package/dist-lib/stores/auth.js +84 -0
- package/dist-lib/stores/icon-registry.js +24 -0
- package/dist-lib/stores/list-layout.js +178 -0
- package/dist-lib/{page-state-eA6J_KIR.js → stores/page-state.js} +1 -1
- package/dist-lib/stores/preferences.js +126 -0
- package/dist-lib/stores/realtime.js +115 -0
- package/dist-lib/stores/screen-registry.js +10 -0
- package/dist-lib/stores/tabs.js +220 -0
- package/dist-lib/test/seed-schema.js +8 -0
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/testing.js +80 -76
- package/dist-lib/types/api.js +48 -0
- package/dist-lib/types/fieldType.js +4 -0
- package/dist-lib/types/ordmap.js +50 -0
- package/dist-lib/types/schema.js +173 -0
- package/dist-lib/{useResponsiveMode-DIR1bZfo.d.ts → useResponsiveMode-DmrpMbZX.d.ts} +44 -16
- package/package.json +13 -12
- package/dist-lib/ActionRunner-DdBFhqGe.js +0 -1440
- package/dist-lib/AgentOpenFollower.impl-BAs_wGEZ.js +0 -81
- package/dist-lib/AssociatedBlock-BOoPLOjw.js +0 -1515
- package/dist-lib/AuthShell-C8aVwHS7.js +0 -361
- package/dist-lib/BlankScreen-DVc7fh8C.js +0 -61
- package/dist-lib/CopyButton-DRIT_f0k.js +0 -119
- package/dist-lib/DynamicIcon-DuBSz6TZ.js +0 -133
- package/dist-lib/FilterChips-Cv1tlXyo.js +0 -1031
- package/dist-lib/LayoutRenderer-d-tXYPze.js +0 -3239
- package/dist-lib/MenuItem-CfkVXPvC.js +0 -140
- package/dist-lib/MonacoJson-BG3S3GHX.js +0 -60
- package/dist-lib/Profile.impl-Cypk27ah.js +0 -527
- package/dist-lib/PropertyGridEditor-XrP6TZ5s.js +0 -4378
- package/dist-lib/RecordHeader-BfQ0_4wq.js +0 -217
- package/dist-lib/RefreshControl-CRdWPoF5.js +0 -195
- package/dist-lib/SSOCallbackPage.impl-Cfi2pQ59.js +0 -31
- package/dist-lib/SmartDetailPage.impl-BiIX0n7K.js +0 -1609
- package/dist-lib/SmartListPage.impl-Cu83Gv_G.js +0 -2818
- package/dist-lib/SmartRecordListPage.impl-DR6lq7HA.js +0 -795
- package/dist-lib/format-count-lyB4CPen.js +0 -943
- package/dist-lib/peekDraftStore-CaimrOhW.js +0 -200
- package/dist-lib/registry-CGe5kCXN.js +0 -119
- package/dist-lib/use-filter-value-labels-D3YDgUzg.js +0 -413
- package/dist-lib/useAgentConversation-rru-7hnF.js +0 -612
- package/dist-lib/useBranding-zcxEic2k.js +0 -41
- package/dist-lib/useBrandingChrome-bxaR3G1R.js +0 -170
- package/dist-lib/useCurrentScreen-BZOHBGQZ.js +0 -2522
- package/dist-lib/useImpersonation-DBIRRR70.js +0 -35
- package/dist-lib/useOwnRefresh-DJjaje52.js +0 -435
- package/dist-lib/useParams-BFLJi4n3.js +0 -133
- package/dist-lib/useProperties-B7opZ-iy.js +0 -81
- package/dist-lib/useScreenBack-DENlz844.js +0 -71
- package/dist-lib/useTabNavigate-CUqOmcMj.js +0 -78
- package/dist-lib/value-BuQVYx52.js +0 -194
- package/dist-lib/variants-vUtfBbE6.js +0 -1961
- /package/dist-lib/{JsonEditor-Dz1PQHC8.js → components/fields/JsonEditor.js} +0 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { ApiError as e } from "../types/api.js";
|
|
2
|
+
import { coerceDisplayString as t } from "../lib/display-value.js";
|
|
3
|
+
import { useAuthStore as n } from "../stores/auth.js";
|
|
4
|
+
import { AGENT_FRAME_EVENT as r, AGENT_MESSAGE_CHANGED_EVENT as i, agentBus as a } from "../api/events.js";
|
|
5
|
+
import { approveInvocation as o, cancelConversation as s, cancelInvocation as c, createConversation as l, listAvailableAgents as ee, listConversations as u, loadConversationInvocations as d, loadConversationTurns as f, loadHistory as p, rejectInvocation as te, sendElicitResponse as ne, sendMessage as m } from "../api/agents.js";
|
|
6
|
+
import { useCallback as h, useEffect as g, useRef as _, useState as v } from "react";
|
|
7
|
+
//#region src/hooks/useAgentConversation.ts
|
|
8
|
+
var y = { streaming: !1 }, b = "declarion.agents.conversation_id";
|
|
9
|
+
function x(e) {
|
|
10
|
+
if (e) return `${b}:${e}`;
|
|
11
|
+
}
|
|
12
|
+
function S(e) {
|
|
13
|
+
if (typeof window > "u") return;
|
|
14
|
+
let t = x(e);
|
|
15
|
+
if (t) try {
|
|
16
|
+
return window.localStorage.getItem(t) || void 0;
|
|
17
|
+
} catch {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function C(e, t) {
|
|
22
|
+
if (typeof window > "u") return;
|
|
23
|
+
let n = x(e);
|
|
24
|
+
if (n) try {
|
|
25
|
+
t ? window.localStorage.setItem(n, t) : window.localStorage.removeItem(n);
|
|
26
|
+
} catch {}
|
|
27
|
+
}
|
|
28
|
+
function w(t) {
|
|
29
|
+
return !(t instanceof e) || t.code !== "entity.foreign_key_violation" ? !1 : t.ext("constraint") === "agent_messages_tenant_conv_fk";
|
|
30
|
+
}
|
|
31
|
+
function T(e, t) {
|
|
32
|
+
return {
|
|
33
|
+
id: e,
|
|
34
|
+
conversation_id: t,
|
|
35
|
+
seq: 0,
|
|
36
|
+
role: "assistant",
|
|
37
|
+
content: [],
|
|
38
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
39
|
+
streaming: !0
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function E(e, t) {
|
|
43
|
+
let n = !1, r = e.map((e) => e.role !== "assistant" || !e.streaming || e.id === t ? e : (n = !0, {
|
|
44
|
+
...e,
|
|
45
|
+
streaming: !1
|
|
46
|
+
}));
|
|
47
|
+
return n ? r : e;
|
|
48
|
+
}
|
|
49
|
+
function D(e, t) {
|
|
50
|
+
let n = !1, r = [];
|
|
51
|
+
for (let i of e) i.id !== t || i.role !== "assistant" ? r.push(i) : (n = !0, i.content.length !== 0 && (i.streaming ? r.push({
|
|
52
|
+
...i,
|
|
53
|
+
streaming: !1
|
|
54
|
+
}) : r.push(i)));
|
|
55
|
+
return n ? r : e;
|
|
56
|
+
}
|
|
57
|
+
function O(e) {
|
|
58
|
+
let t = e;
|
|
59
|
+
for (let n of e) n.role === "assistant" && n.streaming && (t = D(t, n.id));
|
|
60
|
+
return t;
|
|
61
|
+
}
|
|
62
|
+
function k(e, t, n, r) {
|
|
63
|
+
let i = !1, a = e.map((e) => e.id === n ? (i = !0, r(e)) : e);
|
|
64
|
+
return i ? a : [...e, r(T(n, t))];
|
|
65
|
+
}
|
|
66
|
+
function A(e, t, n, r) {
|
|
67
|
+
if (!r) return e;
|
|
68
|
+
let i = e.find((e) => e.id === n);
|
|
69
|
+
return i && !i.streaming ? e : k(E(e, n), t, n, (e) => {
|
|
70
|
+
let t = [...e.content], n = t[t.length - 1];
|
|
71
|
+
return n?.type === "text" ? t[t.length - 1] = {
|
|
72
|
+
...n,
|
|
73
|
+
text: n.text + r
|
|
74
|
+
} : t.push({
|
|
75
|
+
type: "text",
|
|
76
|
+
text: r
|
|
77
|
+
}), {
|
|
78
|
+
...e,
|
|
79
|
+
streaming: !0,
|
|
80
|
+
content: t
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function j(e, t, n, r, i, a) {
|
|
85
|
+
let o = e.find((e) => e.id === n);
|
|
86
|
+
return o && !o.streaming ? e : k(E(e, n), t, n, (e) => r && e.content.some((e) => e.type === "tool_use" && e.id === r) ? e.streaming ? e : {
|
|
87
|
+
...e,
|
|
88
|
+
streaming: !0
|
|
89
|
+
} : {
|
|
90
|
+
...e,
|
|
91
|
+
streaming: !0,
|
|
92
|
+
content: [...e.content, {
|
|
93
|
+
type: "tool_use",
|
|
94
|
+
id: r || `pending-${n}-${e.content.length}`,
|
|
95
|
+
name: i,
|
|
96
|
+
input: a
|
|
97
|
+
}]
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
function re(e, t) {
|
|
101
|
+
let n = e.map((e) => e.streaming ? {
|
|
102
|
+
...e,
|
|
103
|
+
streaming: !1
|
|
104
|
+
} : e), r = new Set(n.map((e) => e.id)), i = /* @__PURE__ */ new Set();
|
|
105
|
+
for (let e of n) if (e.role === "tool") for (let t of e.content) t.type === "tool_result" && t.id && i.add(t.id);
|
|
106
|
+
for (let e of t) if (e.role === "assistant") {
|
|
107
|
+
if (!e.streaming || r.has(e.id)) continue;
|
|
108
|
+
n.push(e);
|
|
109
|
+
} else if (e.role === "tool") {
|
|
110
|
+
if (r.has(e.id)) continue;
|
|
111
|
+
let t = e.content.find((e) => e.type === "tool_result");
|
|
112
|
+
if (t && i.has(t.id)) continue;
|
|
113
|
+
n.push(e);
|
|
114
|
+
}
|
|
115
|
+
return n;
|
|
116
|
+
}
|
|
117
|
+
function M(e) {
|
|
118
|
+
let t = e.payload?.message_id;
|
|
119
|
+
return typeof t == "string" && t ? t : void 0;
|
|
120
|
+
}
|
|
121
|
+
function N(e) {
|
|
122
|
+
let b = n.getState().activeTenant?.id, [x, T] = v(e ?? S(b)), N = h((e) => {
|
|
123
|
+
C(b, e), T(e);
|
|
124
|
+
}, [b]), [P, F] = v([]), [I, L] = v(y), [R, z] = v([]), [B, V] = v([]), [H, U] = v([]), [W, G] = v([]), [K, q] = v(), J = _(/* @__PURE__ */ new Set()), Y = _(0);
|
|
125
|
+
g(() => {
|
|
126
|
+
if (!x) {
|
|
127
|
+
F([]), L(y), z([]), V([]);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (J.current.has(x)) {
|
|
131
|
+
J.current.delete(x);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
let e = !1;
|
|
135
|
+
return Promise.all([
|
|
136
|
+
p(x),
|
|
137
|
+
f(x),
|
|
138
|
+
d(x)
|
|
139
|
+
]).then(([t, n, r]) => {
|
|
140
|
+
if (e) return;
|
|
141
|
+
let i = t.map((e) => e.streaming ? {
|
|
142
|
+
...e,
|
|
143
|
+
streaming: !1
|
|
144
|
+
} : e);
|
|
145
|
+
F(i), z(n), V(r);
|
|
146
|
+
}, (t) => {
|
|
147
|
+
e || t?.status === 404 && (N(void 0), F([]));
|
|
148
|
+
}), () => {
|
|
149
|
+
e = !0;
|
|
150
|
+
};
|
|
151
|
+
}, [x, N]);
|
|
152
|
+
let X = _(x);
|
|
153
|
+
g(() => {
|
|
154
|
+
X.current = x;
|
|
155
|
+
}, [x]);
|
|
156
|
+
let Z = _(!1), Q = _(null), $ = h((e) => {
|
|
157
|
+
if (Z.current) {
|
|
158
|
+
Q.current = e;
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
Z.current = !0;
|
|
162
|
+
let t = ++Y.current;
|
|
163
|
+
Promise.all([
|
|
164
|
+
p(e),
|
|
165
|
+
f(e),
|
|
166
|
+
d(e)
|
|
167
|
+
]).then(([n, r, i]) => {
|
|
168
|
+
e === X.current && t === Y.current && (F((e) => re(n, e)), z(r), V(i));
|
|
169
|
+
}, () => {}).finally(() => {
|
|
170
|
+
Z.current = !1;
|
|
171
|
+
let e = Q.current;
|
|
172
|
+
Q.current = null, e && $(e);
|
|
173
|
+
});
|
|
174
|
+
}, []);
|
|
175
|
+
g(() => {
|
|
176
|
+
let e = (e) => {
|
|
177
|
+
let { convId: t, kind: r, turnId: i, payload: a } = e.detail;
|
|
178
|
+
t === X.current && n(t, {
|
|
179
|
+
kind: r,
|
|
180
|
+
turnId: i,
|
|
181
|
+
payload: a
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
a.addEventListener(r, e);
|
|
185
|
+
let n = (e, n) => {
|
|
186
|
+
switch (n.kind) {
|
|
187
|
+
case "turn.started":
|
|
188
|
+
L((e) => ({
|
|
189
|
+
...e,
|
|
190
|
+
streaming: !0
|
|
191
|
+
})), F((e) => E(e));
|
|
192
|
+
break;
|
|
193
|
+
case "assistant.message.created": {
|
|
194
|
+
let t = typeof n.payload?.message_id == "string" ? n.payload.message_id : "";
|
|
195
|
+
if (!t) break;
|
|
196
|
+
F((n) => k(E(n, t), e, t, (e) => ({
|
|
197
|
+
...e,
|
|
198
|
+
streaming: !0
|
|
199
|
+
})));
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
case "text.delta": {
|
|
203
|
+
let r = t(n.payload?.text), i = M(n);
|
|
204
|
+
if (!i || !r) break;
|
|
205
|
+
F((t) => A(t, e, i, r));
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
case "elicit.pending":
|
|
209
|
+
$(e);
|
|
210
|
+
break;
|
|
211
|
+
case "tool.pending":
|
|
212
|
+
$(e);
|
|
213
|
+
break;
|
|
214
|
+
case "tool.proposed": {
|
|
215
|
+
let t = M(n), r = typeof n.payload?.tool == "string" ? n.payload.tool : "", i = n.payload?.params ?? {}, a = typeof n.payload?.tool_use_id == "string" ? n.payload.tool_use_id : "";
|
|
216
|
+
if (!t || !r) break;
|
|
217
|
+
F((n) => j(n, e, t, a, r, i));
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
case "tool.result":
|
|
221
|
+
case "tool.failed":
|
|
222
|
+
case "tool.canceled":
|
|
223
|
+
$(e);
|
|
224
|
+
break;
|
|
225
|
+
case "turn.finished": {
|
|
226
|
+
L(y);
|
|
227
|
+
let e = M(n);
|
|
228
|
+
e && F((t) => D(t, e));
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
case "error": F((e) => O(e)), L((e) => ({
|
|
232
|
+
...e,
|
|
233
|
+
streaming: !1
|
|
234
|
+
}));
|
|
235
|
+
}
|
|
236
|
+
}, o = () => {
|
|
237
|
+
let e = X.current;
|
|
238
|
+
e && $(e);
|
|
239
|
+
};
|
|
240
|
+
return a.addEventListener(i, o), () => {
|
|
241
|
+
a.removeEventListener(r, e), a.removeEventListener(i, o);
|
|
242
|
+
};
|
|
243
|
+
}, [$]);
|
|
244
|
+
let ie = h(async (e, t) => {
|
|
245
|
+
let n = x;
|
|
246
|
+
n || (n = (await l({ agent_id: K })).id, J.current.add(n), X.current = n, N(n));
|
|
247
|
+
let r;
|
|
248
|
+
try {
|
|
249
|
+
r = await m(e, n, t);
|
|
250
|
+
} catch (i) {
|
|
251
|
+
if (!w(i)) throw i;
|
|
252
|
+
n = (await l({ agent_id: K })).id, J.current.add(n), X.current = n, N(n), r = await m(e, n, t);
|
|
253
|
+
}
|
|
254
|
+
F((t) => t.some((e) => e.id === r.id) ? t : [...t, {
|
|
255
|
+
...r,
|
|
256
|
+
content: [{
|
|
257
|
+
type: "text",
|
|
258
|
+
text: e
|
|
259
|
+
}]
|
|
260
|
+
}]);
|
|
261
|
+
}, [
|
|
262
|
+
x,
|
|
263
|
+
N,
|
|
264
|
+
K
|
|
265
|
+
]), ae = h(async (e, t) => {
|
|
266
|
+
await o(e, t), x && $(x);
|
|
267
|
+
}, [x, $]), oe = h(async (e, t) => {
|
|
268
|
+
await te(e, t), x && $(x);
|
|
269
|
+
}, [x, $]), se = h(async (e, t) => {
|
|
270
|
+
x && (await ne(x, e, t), $(x));
|
|
271
|
+
}, [x, $]), ce = h(async (e) => {
|
|
272
|
+
x && (await c(e), $(x));
|
|
273
|
+
}, [x, $]), le = h(async () => {
|
|
274
|
+
x && await s(x);
|
|
275
|
+
}, [x]), ue = h(async () => {
|
|
276
|
+
U(await u());
|
|
277
|
+
}, []), de = h(() => {
|
|
278
|
+
N(void 0), F([]), L(y);
|
|
279
|
+
}, [N]);
|
|
280
|
+
return g(() => {
|
|
281
|
+
let e = !0;
|
|
282
|
+
return ee().then((t) => {
|
|
283
|
+
e && (G(t), q((e) => e ?? t.find((e) => e.is_default)?.id));
|
|
284
|
+
}).catch((e) => {
|
|
285
|
+
console.warn("agents.list_available failed; the agent picker is unavailable", e);
|
|
286
|
+
}), () => {
|
|
287
|
+
e = !1;
|
|
288
|
+
};
|
|
289
|
+
}, []), {
|
|
290
|
+
conversationId: x,
|
|
291
|
+
messages: P,
|
|
292
|
+
turn: I,
|
|
293
|
+
turns: R,
|
|
294
|
+
invocations: B,
|
|
295
|
+
conversations: H,
|
|
296
|
+
send: ie,
|
|
297
|
+
approve: ae,
|
|
298
|
+
reject: oe,
|
|
299
|
+
submitInput: se,
|
|
300
|
+
cancelInput: ce,
|
|
301
|
+
cancel: le,
|
|
302
|
+
refreshConversations: ue,
|
|
303
|
+
startNew: de,
|
|
304
|
+
agents: W,
|
|
305
|
+
selectedAgentId: K,
|
|
306
|
+
selectAgent: q,
|
|
307
|
+
setConversationId: N
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
//#endregion
|
|
311
|
+
export { N as useAgentConversation };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { aggregateEntities as e } from "../api/data.js";
|
|
2
|
+
import { ENTITY_AGGREGATE_KEY as t } from "../lib/realtime-query-keys.js";
|
|
3
|
+
import { useQuery as n } from "@tanstack/react-query";
|
|
4
|
+
//#region src/hooks/useAggregate.ts
|
|
5
|
+
function r(r, i, a = !0) {
|
|
6
|
+
return n({
|
|
7
|
+
queryKey: [
|
|
8
|
+
t,
|
|
9
|
+
r,
|
|
10
|
+
i
|
|
11
|
+
],
|
|
12
|
+
queryFn: ({ signal: t }) => e(r, i, { signal: t }),
|
|
13
|
+
enabled: !!r && a && i.aggregate.length > 0,
|
|
14
|
+
staleTime: 3e4
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { r as useAggregate };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ApiError as e } from "../types/api.js";
|
|
2
|
+
import { listEntities as t } from "../api/data.js";
|
|
3
|
+
import { RefCache as n } from "../api/entities.js";
|
|
4
|
+
import { useQuery as r } from "@tanstack/react-query";
|
|
5
|
+
//#region src/hooks/useAllEntityData.ts
|
|
6
|
+
var i = 1e3, a = 20;
|
|
7
|
+
function o(o, s = {}) {
|
|
8
|
+
return r({
|
|
9
|
+
queryKey: [
|
|
10
|
+
"entity-data-all",
|
|
11
|
+
o,
|
|
12
|
+
s
|
|
13
|
+
],
|
|
14
|
+
enabled: !!o,
|
|
15
|
+
queryFn: async ({ signal: r }) => {
|
|
16
|
+
let c = {
|
|
17
|
+
...s,
|
|
18
|
+
per_page: i,
|
|
19
|
+
count: "with"
|
|
20
|
+
}, l;
|
|
21
|
+
try {
|
|
22
|
+
l = await t(o, {
|
|
23
|
+
...c,
|
|
24
|
+
page: 1
|
|
25
|
+
}, { signal: r });
|
|
26
|
+
} catch (t) {
|
|
27
|
+
throw t instanceof e && t.code === "cursor.cross_tier_offset_unsupported" ? Error(`useAllEntityData: entity "${o}" is cursor-paginated (cross-store archive); it cannot be eagerly fetched into memory. Use a paginated cursor list (useCursorEntityData) instead.`) : t;
|
|
28
|
+
}
|
|
29
|
+
let u = l.meta.total_pages ?? 1;
|
|
30
|
+
if (u <= 1) return l;
|
|
31
|
+
if (u > a) throw Error(`useAllEntityData: entity "${o}" spans ${u} pages (limit ${a}); it is not a bounded entity. Use useEntityData with server-side pagination instead.`);
|
|
32
|
+
let d = await Promise.all(Array.from({ length: u - 1 }, (e, n) => t(o, {
|
|
33
|
+
...c,
|
|
34
|
+
page: n + 2
|
|
35
|
+
}, { signal: r }))), f = new n();
|
|
36
|
+
f.merge(l.$refs);
|
|
37
|
+
let p = [...l.data];
|
|
38
|
+
for (let e of d) p.push(...e.data), f.merge(e.$refs);
|
|
39
|
+
return {
|
|
40
|
+
data: p,
|
|
41
|
+
meta: {
|
|
42
|
+
...l.meta,
|
|
43
|
+
page: 1,
|
|
44
|
+
per_page: p.length,
|
|
45
|
+
total_pages: 1
|
|
46
|
+
},
|
|
47
|
+
$refs: f.all()
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { o as useAllEntityData };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { apiFetch as e } from "../api/client.js";
|
|
2
|
+
import { ENTITY_CHILDREN_KEY as t } from "./useChildrenData.js";
|
|
3
|
+
import { useInfiniteQuery as n } from "@tanstack/react-query";
|
|
4
|
+
//#region src/hooks/useAssociatedData.ts
|
|
5
|
+
function r(r, i, a, o, s, c, l, u) {
|
|
6
|
+
let d = u ? JSON.stringify(Object.entries(u).sort()) : void 0;
|
|
7
|
+
return n({
|
|
8
|
+
queryKey: [
|
|
9
|
+
t,
|
|
10
|
+
r,
|
|
11
|
+
i,
|
|
12
|
+
a,
|
|
13
|
+
s,
|
|
14
|
+
c,
|
|
15
|
+
l,
|
|
16
|
+
d
|
|
17
|
+
],
|
|
18
|
+
queryFn: ({ pageParam: t }) => {
|
|
19
|
+
let n = new URLSearchParams(), r = [{
|
|
20
|
+
field: o,
|
|
21
|
+
op: "eq",
|
|
22
|
+
value: i
|
|
23
|
+
}];
|
|
24
|
+
if (u) for (let [e, t] of Object.entries(u)) t && t !== "__all__" && r.push({
|
|
25
|
+
field: e,
|
|
26
|
+
op: "eq",
|
|
27
|
+
value: t
|
|
28
|
+
});
|
|
29
|
+
return n.set("filters", JSON.stringify(r)), s && n.set("sort", s), c && n.set("limit", String(c)), l && n.set("search", l), t && n.set("after", t), e(`/api/data/${a}?${n.toString()}`);
|
|
30
|
+
},
|
|
31
|
+
getNextPageParam: (e) => e.meta?.has_more ? e.meta.cursor : void 0,
|
|
32
|
+
initialPageParam: void 0,
|
|
33
|
+
enabled: !!r && !!i && !!a && !!o
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { r as useAssociatedData };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { login as e, signup as t, switchTenant as n } from "../api/auth.js";
|
|
2
|
+
import { useAuthStore as r } from "../stores/auth.js";
|
|
3
|
+
import { SCHEMA_QUERY_KEY as i } from "./useSchema.js";
|
|
4
|
+
import { useText as a } from "./useText.js";
|
|
5
|
+
import { failureTitle as o } from "../lib/failure.js";
|
|
6
|
+
import { PUBLIC_PARAMS_QUERY_KEY as s } from "./useParams.js";
|
|
7
|
+
import { peekTenantLandingPath as c } from "../stores/tabs.js";
|
|
8
|
+
import { toast as l } from "../lib/toast.js";
|
|
9
|
+
import { usePageStateStore as u } from "../stores/page-state.js";
|
|
10
|
+
import { useMutation as d, useQueryClient as f } from "@tanstack/react-query";
|
|
11
|
+
import { useNavigate as p } from "react-router";
|
|
12
|
+
//#region src/hooks/useAuth.ts
|
|
13
|
+
var m = /* @__PURE__ */ new Set([i[0], s[0]]);
|
|
14
|
+
function h() {
|
|
15
|
+
let { user: i, isAuthenticated: s, isLoading: h, activeTenant: g, tenants: _, setUser: v, loadTenants: y, logout: b } = r(), x = p(), S = f(), C = a("errors"), w = d({
|
|
16
|
+
mutationFn: ({ email: t, password: n, remember: r }) => e(t, n, r ?? !0),
|
|
17
|
+
onSuccess: (e) => {
|
|
18
|
+
v(e.user, e.tenant), y();
|
|
19
|
+
}
|
|
20
|
+
}), T = d({
|
|
21
|
+
mutationFn: ({ email: e, password: n, displayName: r }) => t(e, n, r),
|
|
22
|
+
onSuccess: (e) => {
|
|
23
|
+
v(e.user, e.tenant), y();
|
|
24
|
+
},
|
|
25
|
+
onError: (e) => {
|
|
26
|
+
l.error(o(C, e));
|
|
27
|
+
}
|
|
28
|
+
}), E = d({
|
|
29
|
+
mutationFn: (e) => n(e),
|
|
30
|
+
onSuccess: (e) => {
|
|
31
|
+
let t = e.tenant?.id, n = e.user?.id, r = t && n && c(t, n) || "/";
|
|
32
|
+
window.location.assign(r);
|
|
33
|
+
},
|
|
34
|
+
onError: (e) => {
|
|
35
|
+
l.error(o(C, e));
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
user: i,
|
|
40
|
+
isAuthenticated: s,
|
|
41
|
+
isLoading: h,
|
|
42
|
+
activeTenant: g,
|
|
43
|
+
tenants: _,
|
|
44
|
+
login: w.mutate,
|
|
45
|
+
signup: T.mutate,
|
|
46
|
+
switchTenant: E.mutate,
|
|
47
|
+
logout: async () => {
|
|
48
|
+
await b(), S.removeQueries({ predicate: (e) => !m.has(e.queryKey[0]) }), S.getMutationCache().clear(), u.getState().clear(), x("/login");
|
|
49
|
+
},
|
|
50
|
+
isLoginPending: w.isPending,
|
|
51
|
+
isSignupPending: T.isPending,
|
|
52
|
+
isSwitchingTenant: E.isPending
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { h as useAuth };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BRANDING_PARAM_CODE as e, brandingFromValue as t } from "../lib/branding.js";
|
|
2
|
+
import { useEffectiveParam as n } from "./useParams.js";
|
|
3
|
+
//#region src/hooks/useBranding.ts
|
|
4
|
+
function r() {
|
|
5
|
+
let r = n(e);
|
|
6
|
+
return {
|
|
7
|
+
branding: t(r.value),
|
|
8
|
+
isLoading: r.loading
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function i() {
|
|
12
|
+
return r().branding?.identity;
|
|
13
|
+
}
|
|
14
|
+
function a() {
|
|
15
|
+
return r().branding?.chrome;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { r as useBranding, a as useBrandingChromeValue, i as useBrandingIdentity };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { useEmbed as e } from "../embed/EmbedContext.js";
|
|
2
|
+
import { DEFAULT_RESPONSIVE_BREAKPOINTS as t } from "../lib/viewport-category.js";
|
|
3
|
+
import { useBrandingChromeValue as n } from "./useBranding.js";
|
|
4
|
+
import { useMemo as r } from "react";
|
|
5
|
+
//#region src/hooks/useBrandingChrome.ts
|
|
6
|
+
function i() {
|
|
7
|
+
let t = e(), r = n();
|
|
8
|
+
return (t.enabled ? r?.embed?.viewport : r?.full?.viewport) ?? "auto";
|
|
9
|
+
}
|
|
10
|
+
function a(e, t) {
|
|
11
|
+
return typeof e == "number" && Number.isFinite(e) && e > 0 ? e : t;
|
|
12
|
+
}
|
|
13
|
+
function o() {
|
|
14
|
+
let t = e(), i = n(), a = t.enabled ? i?.embed?.breakpoints : i?.full?.breakpoints, o = a?.phone_max, c = a?.tablet_max, l = a?.landscape_phone_max_height;
|
|
15
|
+
return r(() => s({
|
|
16
|
+
phone_max: o,
|
|
17
|
+
tablet_max: c,
|
|
18
|
+
landscape_phone_max_height: l
|
|
19
|
+
}), [
|
|
20
|
+
o,
|
|
21
|
+
c,
|
|
22
|
+
l
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
25
|
+
function s(e) {
|
|
26
|
+
let n = a(e?.phone_max, t.phoneMax), r = a(e?.tablet_max, t.tabletMax), i = n < r;
|
|
27
|
+
return i || console.error(`branding.chrome breakpoints: phone_max (${n}) must be below tablet_max (${r}), or no viewport can ever resolve to the tablet class. Both bounds fall back to the SDK defaults.`), {
|
|
28
|
+
phoneMax: i ? n : t.phoneMax,
|
|
29
|
+
tabletMax: i ? r : t.tabletMax,
|
|
30
|
+
landscapePhoneMaxHeight: a(e?.landscape_phone_max_height, t.landscapePhoneMaxHeight)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function c(t) {
|
|
34
|
+
let i = e(), a = n();
|
|
35
|
+
return r(() => {
|
|
36
|
+
let e = { ...i.enabled ? a?.embed?.surfaces?.[t] : a?.full?.surfaces?.[t] };
|
|
37
|
+
return {
|
|
38
|
+
...e,
|
|
39
|
+
isVisible: (t) => e[t] !== !1
|
|
40
|
+
};
|
|
41
|
+
}, [
|
|
42
|
+
a,
|
|
43
|
+
i.enabled,
|
|
44
|
+
t
|
|
45
|
+
]);
|
|
46
|
+
}
|
|
47
|
+
function l() {
|
|
48
|
+
let e = n();
|
|
49
|
+
return r(() => {
|
|
50
|
+
let t = { ...e?.full?.shell };
|
|
51
|
+
return {
|
|
52
|
+
...t,
|
|
53
|
+
isVisible: (e) => t[e] !== !1
|
|
54
|
+
};
|
|
55
|
+
}, [e]);
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { s as resolveBreakpoints, o as useBrandingBreakpoints, c as useBrandingChrome, l as useBrandingShell, i as useBrandingViewport };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { apiFetch as e } from "../api/client.js";
|
|
2
|
+
import { pkValuesFromId as t } from "../types/schema.js";
|
|
3
|
+
import { useEntity as n } from "./useEntity.js";
|
|
4
|
+
import { readableSort as r } from "../lib/field-classification.js";
|
|
5
|
+
import { useQuery as i } from "@tanstack/react-query";
|
|
6
|
+
//#region src/hooks/useChildrenData.ts
|
|
7
|
+
var a = "entity-children";
|
|
8
|
+
function o(o, s, c, l, u, d) {
|
|
9
|
+
let f = n(c), p = r(f, u), m = Array.isArray(l) ? l : [l], h = Array.isArray(l) ? t(s, m.length) : [s];
|
|
10
|
+
return i({
|
|
11
|
+
queryKey: [
|
|
12
|
+
a,
|
|
13
|
+
o,
|
|
14
|
+
s,
|
|
15
|
+
c,
|
|
16
|
+
p,
|
|
17
|
+
d
|
|
18
|
+
],
|
|
19
|
+
queryFn: () => {
|
|
20
|
+
let t = new URLSearchParams();
|
|
21
|
+
if (!h) throw Error("invalid composite parent id");
|
|
22
|
+
let n = m.map((e, t) => ({
|
|
23
|
+
field: e,
|
|
24
|
+
op: "eq",
|
|
25
|
+
value: h[t]
|
|
26
|
+
}));
|
|
27
|
+
return t.set("filters", JSON.stringify(n)), p && t.set("sort", p), d && t.set("limit", String(d)), e(`/api/data/${c}?${t.toString()}`);
|
|
28
|
+
},
|
|
29
|
+
enabled: !!o && !!s && !!c && !!l && h !== null
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { a as ENTITY_CHILDREN_KEY, o as useChildrenData };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useCallback as e, useMemo as t } from "react";
|
|
2
|
+
import { useSearchParams as n } from "react-router";
|
|
3
|
+
//#region src/hooks/useColumns.ts
|
|
4
|
+
function r(r, a) {
|
|
5
|
+
let [o, s] = n(), c = t(() => {
|
|
6
|
+
let e = o.get("columns");
|
|
7
|
+
return e ? e.split(",").filter(Boolean).filter((e) => r.includes(e)) : a.length > 0 ? a : r;
|
|
8
|
+
}, [
|
|
9
|
+
o,
|
|
10
|
+
r,
|
|
11
|
+
a
|
|
12
|
+
]), l = e((e) => {
|
|
13
|
+
let t = new URLSearchParams(o);
|
|
14
|
+
e.length === 0 || i(e, a) ? t.delete("columns") : t.set("columns", e.join(",")), s(t);
|
|
15
|
+
}, [
|
|
16
|
+
o,
|
|
17
|
+
s,
|
|
18
|
+
a
|
|
19
|
+
]);
|
|
20
|
+
return {
|
|
21
|
+
visibleColumns: c,
|
|
22
|
+
availableColumns: r,
|
|
23
|
+
setColumns: l,
|
|
24
|
+
resetToDefaults: e(() => {
|
|
25
|
+
let e = new URLSearchParams(o);
|
|
26
|
+
e.delete("columns"), s(e);
|
|
27
|
+
}, [o, s]),
|
|
28
|
+
showAll: e(() => {
|
|
29
|
+
l(r);
|
|
30
|
+
}, [r, l]),
|
|
31
|
+
isColumnVisible: e((e) => c.includes(e), [c]),
|
|
32
|
+
toggleColumn: e((e) => {
|
|
33
|
+
if (c.includes(e)) {
|
|
34
|
+
if (c.length <= 1) return;
|
|
35
|
+
l(c.filter((t) => t !== e));
|
|
36
|
+
} else l([...c, e]);
|
|
37
|
+
}, [c, l])
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function i(e, t) {
|
|
41
|
+
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { r as useColumns };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { NetworkError as e } from "../types/api.js";
|
|
2
|
+
import { useText as t } from "./useText.js";
|
|
3
|
+
import { toast as n } from "../lib/toast.js";
|
|
4
|
+
import { useEffect as r, useRef as i } from "react";
|
|
5
|
+
import { useQueryClient as a } from "@tanstack/react-query";
|
|
6
|
+
//#region src/hooks/useConnectionNotice.ts
|
|
7
|
+
var o = "declarion-connection-lost";
|
|
8
|
+
function s(t) {
|
|
9
|
+
let { fetchStatus: n, fetchFailureReason: r } = t.state;
|
|
10
|
+
return n === "paused" || n === "fetching" && r instanceof e;
|
|
11
|
+
}
|
|
12
|
+
function c() {
|
|
13
|
+
let e = a(), c = t(), l = i(c);
|
|
14
|
+
r(() => {
|
|
15
|
+
l.current = c;
|
|
16
|
+
}, [c]), r(() => {
|
|
17
|
+
let t = e.getQueryCache(), r = !1, i = () => {
|
|
18
|
+
let e = t.getAll().some(s);
|
|
19
|
+
if (e !== r) {
|
|
20
|
+
if (r = e, e) {
|
|
21
|
+
let e = l.current;
|
|
22
|
+
n.loading(e("shell.connection.lost", "No connection to the server"), e("shell.connection.retrying", "Retrying…"), { id: o });
|
|
23
|
+
} else n.dismiss(o);
|
|
24
|
+
}
|
|
25
|
+
}, a = t.subscribe(i);
|
|
26
|
+
return i(), () => {
|
|
27
|
+
a(), r && n.dismiss(o);
|
|
28
|
+
};
|
|
29
|
+
}, [e]);
|
|
30
|
+
}
|
|
31
|
+
function l() {
|
|
32
|
+
return c(), null;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { o as CONNECTION_TOAST_ID, l as ConnectionNotice, s as isWaitingOnConnection, c as useConnectionNotice };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useSchema as e } from "./useSchema.js";
|
|
2
2
|
import { useMemo as t } from "react";
|
|
3
3
|
import { matchRoutes as n, useLocation as r } from "react-router";
|
|
4
4
|
//#region src/hooks/useCurrentLocation.ts
|
|
@@ -19,4 +19,4 @@ function a() {
|
|
|
19
19
|
return t(() => i(n, a?.screens), [n, a?.screens]);
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
|
22
|
-
export {
|
|
22
|
+
export { i as locationFor, a as useCurrentLocation };
|