@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,354 @@
|
|
|
1
|
+
import { useDeploymentLanguage as e, useLanguage as t } from "../../hooks/useLanguage.js";
|
|
2
|
+
import { useText as n } from "../../hooks/useText.js";
|
|
3
|
+
import { UploadError as r, discardFile as i, uploadCheckFailure as ee, uploadFailure as te, uploadFile as ne, validateClientSide as re } from "./upload.js";
|
|
4
|
+
import { UploadFailureText as a } from "./UploadFailureText.js";
|
|
5
|
+
import { getImageCropper as ie } from "./cropper.js";
|
|
6
|
+
import { focalPointObjectPosition as o, preferredListThumbnailURL as s, preferredThumbnailVariant as ae, readFocalPoint as oe, resolveFileAltText as se, withFocalPoint as ce } from "./helpers.js";
|
|
7
|
+
import { useDraftRegistration as le } from "./draft-scope.js";
|
|
8
|
+
import { useEmbedFileSrc as ue } from "./useEmbedFileSrc.js";
|
|
9
|
+
import { singleFileFromValue as de } from "./value.js";
|
|
10
|
+
import { useCallback as c, useEffect as fe, useMemo as pe, useRef as l, useState as u } from "react";
|
|
11
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
12
|
+
//#region src/components/file-widgets/ImageWidget.tsx
|
|
13
|
+
function me(e, t) {
|
|
14
|
+
return s(e, t);
|
|
15
|
+
}
|
|
16
|
+
function p(e) {
|
|
17
|
+
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
18
|
+
return t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[1][0]).toUpperCase();
|
|
19
|
+
}
|
|
20
|
+
function m(s) {
|
|
21
|
+
let { field: p, fieldName: m, value: ve, onChange: v, mode: ye, alt: y, recordTitle: be, disabled: b, visual: x, uploadFieldCode: S, uploadSlotCode: C } = s, w = de(ve), [T, E] = u("idle"), [D, O] = u(null), [k, A] = u(null), [j, M] = u(null), [N, P] = u(!1), F = l(null), I = l(!1), L = l(null), { register: R, unregister: z, isDraft: B } = le(), V = n(), H = n("errors");
|
|
22
|
+
fe(() => () => {
|
|
23
|
+
F.current && F.current.abort();
|
|
24
|
+
}, []);
|
|
25
|
+
let U = t(), W = e(), G = pe(() => se(w, y, m, U, W), [
|
|
26
|
+
y,
|
|
27
|
+
m,
|
|
28
|
+
w,
|
|
29
|
+
U,
|
|
30
|
+
W
|
|
31
|
+
]), K = p.display?.initials ? be?.trim() : void 0, xe = (p.accepts ?? ["image/*"]).join(","), q = c(async (e) => {
|
|
32
|
+
let t = re(e, p.accepts, p.max_size_bytes);
|
|
33
|
+
if (t) {
|
|
34
|
+
A(ee(V, H, t)), E("error");
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
let n = e;
|
|
38
|
+
if (p.display?.crop_on_upload) try {
|
|
39
|
+
let { blob: t, filename: r } = await ie()({
|
|
40
|
+
file: e,
|
|
41
|
+
aspectRatio: ge(p.display.aspect_ratio)
|
|
42
|
+
});
|
|
43
|
+
n = new File([t], r, { type: t.type || e.type });
|
|
44
|
+
} catch {
|
|
45
|
+
A({
|
|
46
|
+
code: "file.crop_failed",
|
|
47
|
+
message: H("file.crop_failed", "The image could not be cropped.")
|
|
48
|
+
}), E("error");
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
A(null), I.current = !1, E("uploading"), O({
|
|
52
|
+
loaded: 0,
|
|
53
|
+
total: n.size,
|
|
54
|
+
pct: 0
|
|
55
|
+
});
|
|
56
|
+
let a = new AbortController();
|
|
57
|
+
F.current = a;
|
|
58
|
+
try {
|
|
59
|
+
let e = await ne({
|
|
60
|
+
file: n,
|
|
61
|
+
entityCode: s.entityCode,
|
|
62
|
+
fieldCode: S ?? m,
|
|
63
|
+
slotCode: C,
|
|
64
|
+
signal: a.signal,
|
|
65
|
+
onProgress: O
|
|
66
|
+
});
|
|
67
|
+
if (I.current) {
|
|
68
|
+
i(e.id).catch(() => {}), z(e.id);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
w && B(w.id) && (i(w.id).catch(() => {}), z(w.id)), R(e.id, () => i(e.id)), M(e.id), E("idle"), O(null);
|
|
72
|
+
let t = {
|
|
73
|
+
id: e.id,
|
|
74
|
+
filename: e.filename,
|
|
75
|
+
content_type: e.content_type,
|
|
76
|
+
size_bytes: e.size_bytes,
|
|
77
|
+
sha256: e.sha256,
|
|
78
|
+
width: e.width,
|
|
79
|
+
height: e.height,
|
|
80
|
+
url: e.url,
|
|
81
|
+
metadata: e.metadata
|
|
82
|
+
};
|
|
83
|
+
v?.(p.mode === "array" ? [t] : t);
|
|
84
|
+
} catch (e) {
|
|
85
|
+
if (e instanceof r && e.code === "ABORTED") return;
|
|
86
|
+
A(te(V, H, e)), E("error"), O(null);
|
|
87
|
+
}
|
|
88
|
+
}, [
|
|
89
|
+
H,
|
|
90
|
+
V,
|
|
91
|
+
p.accepts,
|
|
92
|
+
p.max_size_bytes,
|
|
93
|
+
p.display?.crop_on_upload,
|
|
94
|
+
p.display?.aspect_ratio,
|
|
95
|
+
p.mode,
|
|
96
|
+
m,
|
|
97
|
+
v,
|
|
98
|
+
s.entityCode,
|
|
99
|
+
R,
|
|
100
|
+
B,
|
|
101
|
+
w,
|
|
102
|
+
z,
|
|
103
|
+
S,
|
|
104
|
+
C
|
|
105
|
+
]), Se = c(() => {
|
|
106
|
+
T === "uploading" && F.current && (I.current = !0, F.current.abort(), F.current = null, E("idle"), O(null)), j && (i(j).catch(() => {}), z(j), M(null));
|
|
107
|
+
}, [
|
|
108
|
+
T,
|
|
109
|
+
j,
|
|
110
|
+
z
|
|
111
|
+
]), Ce = c(() => {
|
|
112
|
+
w && B(w.id) && (i(w.id).catch(() => {}), z(w.id), M(null)), v?.(p.mode === "array" ? [] : null);
|
|
113
|
+
}, [
|
|
114
|
+
w,
|
|
115
|
+
p.mode,
|
|
116
|
+
B,
|
|
117
|
+
v,
|
|
118
|
+
z
|
|
119
|
+
]), we = c(() => {
|
|
120
|
+
A(null), E("idle"), L.current?.click();
|
|
121
|
+
}, []), J = c(() => {
|
|
122
|
+
b || L.current?.click();
|
|
123
|
+
}, [b]), Te = c((e) => {
|
|
124
|
+
b || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), J());
|
|
125
|
+
}, [b, J]), Ee = c((e) => {
|
|
126
|
+
b || (e.preventDefault(), e.dataTransfer.dropEffect = "copy");
|
|
127
|
+
}, [b]), Y = c((e) => {
|
|
128
|
+
if (b) return;
|
|
129
|
+
e.preventDefault();
|
|
130
|
+
let t = e.dataTransfer.files?.[0];
|
|
131
|
+
t && q(t);
|
|
132
|
+
}, [b, q]), De = c((e) => {
|
|
133
|
+
let t = e.target.files?.[0];
|
|
134
|
+
e.target.value = "", t && q(t);
|
|
135
|
+
}, [q]), Oe = x.aspectRatio ?? he(x.shape, p.display?.aspect_ratio), X = oe(w), Z = {
|
|
136
|
+
aspectRatio: Oe,
|
|
137
|
+
width: x.width ?? (x.shape === "wide" ? "100%" : "120px")
|
|
138
|
+
}, Q = !!w, ke = me(w, p.display?.listable_thumbnail), Ae = ae(w, p.display?.listable_thumbnail), $ = ue(w?.id, Ae, ke), je = ye === "display", Me = c((e) => {
|
|
139
|
+
e.stopPropagation(), P((e) => !e);
|
|
140
|
+
}, []), Ne = c((e) => {
|
|
141
|
+
if (!w || !N) return;
|
|
142
|
+
let t = e.currentTarget.getBoundingClientRect(), n = t.width > 0 ? (e.clientX - t.left) / t.width : .5, r = t.height > 0 ? (e.clientY - t.top) / t.height : .5, i = ce(w, {
|
|
143
|
+
x: Math.max(0, Math.min(1, n)),
|
|
144
|
+
y: Math.max(0, Math.min(1, r))
|
|
145
|
+
});
|
|
146
|
+
v?.(p.mode === "array" ? [i] : i), P(!1);
|
|
147
|
+
}, [
|
|
148
|
+
p.mode,
|
|
149
|
+
w,
|
|
150
|
+
N,
|
|
151
|
+
v
|
|
152
|
+
]);
|
|
153
|
+
return je ? /* @__PURE__ */ d("div", {
|
|
154
|
+
className: h(x.shape, !1),
|
|
155
|
+
style: Z,
|
|
156
|
+
"aria-label": G,
|
|
157
|
+
children: Q && $ ? /* @__PURE__ */ d("img", {
|
|
158
|
+
src: $,
|
|
159
|
+
alt: G,
|
|
160
|
+
className: g(x.shape),
|
|
161
|
+
style: { objectPosition: o(X) },
|
|
162
|
+
loading: "lazy"
|
|
163
|
+
}) : /* @__PURE__ */ d(_, {
|
|
164
|
+
shape: x.shape,
|
|
165
|
+
initialsTitle: K
|
|
166
|
+
})
|
|
167
|
+
}) : /* @__PURE__ */ f("div", {
|
|
168
|
+
className: h(x.shape, !b),
|
|
169
|
+
style: Z,
|
|
170
|
+
tabIndex: b ? -1 : 0,
|
|
171
|
+
role: "button",
|
|
172
|
+
"aria-label": G,
|
|
173
|
+
"aria-disabled": b || void 0,
|
|
174
|
+
"aria-busy": T === "uploading" || void 0,
|
|
175
|
+
"aria-invalid": T === "error" || void 0,
|
|
176
|
+
onClick: T === "idle" && !Q ? J : void 0,
|
|
177
|
+
onMouseDown: N ? Ne : void 0,
|
|
178
|
+
onKeyDown: Te,
|
|
179
|
+
onDragOver: Ee,
|
|
180
|
+
onDrop: Y,
|
|
181
|
+
"data-testid": N ? "focal-point-target" : `file-widget-${m}`,
|
|
182
|
+
children: [
|
|
183
|
+
/* @__PURE__ */ d("input", {
|
|
184
|
+
ref: L,
|
|
185
|
+
type: "file",
|
|
186
|
+
accept: xe,
|
|
187
|
+
onChange: De,
|
|
188
|
+
style: { display: "none" },
|
|
189
|
+
"data-testid": `file-input-${m}`
|
|
190
|
+
}),
|
|
191
|
+
Q && $ ? /* @__PURE__ */ d("img", {
|
|
192
|
+
src: $,
|
|
193
|
+
alt: G,
|
|
194
|
+
className: g(x.shape),
|
|
195
|
+
style: { objectPosition: o(X) },
|
|
196
|
+
loading: "lazy"
|
|
197
|
+
}) : T === "uploading" ? null : /* @__PURE__ */ d(_, {
|
|
198
|
+
shape: x.shape,
|
|
199
|
+
initialsTitle: K
|
|
200
|
+
}),
|
|
201
|
+
T === "uploading" && /* @__PURE__ */ d(_e, {
|
|
202
|
+
pct: D?.pct ?? 0,
|
|
203
|
+
label: V("file.upload.progress", "Uploading {pct}%", { pct: Math.round(D?.pct ?? 0) })
|
|
204
|
+
}),
|
|
205
|
+
j && /* @__PURE__ */ d("span", {
|
|
206
|
+
className: "absolute right-1 top-1 h-2 w-2 rounded-full bg-warning",
|
|
207
|
+
"aria-hidden": "true",
|
|
208
|
+
"data-testid": "draft-indicator"
|
|
209
|
+
}),
|
|
210
|
+
Q && T === "idle" && !b && /* @__PURE__ */ f("div", {
|
|
211
|
+
className: "absolute inset-0 flex items-center justify-center gap-2 bg-black/40 opacity-0 transition-opacity hover:opacity-100 focus-within:opacity-100",
|
|
212
|
+
children: [
|
|
213
|
+
p.display?.focal_point && /* @__PURE__ */ d("button", {
|
|
214
|
+
type: "button",
|
|
215
|
+
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
216
|
+
onClick: Me,
|
|
217
|
+
"data-testid": "focal-point-toggle",
|
|
218
|
+
children: N ? V("file.image.focus_cancel", "Cancel focus") : V("file.image.focus_set", "Set focus")
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ d("button", {
|
|
221
|
+
type: "button",
|
|
222
|
+
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
223
|
+
onClick: (e) => {
|
|
224
|
+
e.stopPropagation(), J();
|
|
225
|
+
},
|
|
226
|
+
children: V("file.image.change", "Change")
|
|
227
|
+
}),
|
|
228
|
+
/* @__PURE__ */ d("button", {
|
|
229
|
+
type: "button",
|
|
230
|
+
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-destructive hover:bg-surface-2",
|
|
231
|
+
onClick: (e) => {
|
|
232
|
+
e.stopPropagation(), Ce();
|
|
233
|
+
},
|
|
234
|
+
children: V("file.remove", "Remove")
|
|
235
|
+
})
|
|
236
|
+
]
|
|
237
|
+
}),
|
|
238
|
+
X && Q && /* @__PURE__ */ d("span", {
|
|
239
|
+
className: "absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full border border-white bg-black/70",
|
|
240
|
+
style: {
|
|
241
|
+
left: `${X.x * 100}%`,
|
|
242
|
+
top: `${X.y * 100}%`
|
|
243
|
+
},
|
|
244
|
+
"data-testid": "focal-point-marker"
|
|
245
|
+
}),
|
|
246
|
+
T === "uploading" && /* @__PURE__ */ d("button", {
|
|
247
|
+
type: "button",
|
|
248
|
+
className: "absolute bottom-1 right-1 rounded-sm border border-border bg-card px-2 py-0.5 text-xs",
|
|
249
|
+
onClick: (e) => {
|
|
250
|
+
e.stopPropagation(), Se();
|
|
251
|
+
},
|
|
252
|
+
"data-testid": "cancel-upload",
|
|
253
|
+
children: V("file.upload.cancel", "Cancel")
|
|
254
|
+
}),
|
|
255
|
+
T === "error" && k && /* @__PURE__ */ f("div", {
|
|
256
|
+
className: "absolute inset-x-0 bottom-0 flex items-center justify-between gap-2 bg-destructive-soft px-2 py-1 text-xs text-destructive",
|
|
257
|
+
role: "alert",
|
|
258
|
+
children: [/* @__PURE__ */ d("span", {
|
|
259
|
+
className: "truncate",
|
|
260
|
+
title: k.message,
|
|
261
|
+
children: /* @__PURE__ */ d(a, { failure: k })
|
|
262
|
+
}), /* @__PURE__ */ d("button", {
|
|
263
|
+
type: "button",
|
|
264
|
+
className: "underline",
|
|
265
|
+
onClick: (e) => {
|
|
266
|
+
e.stopPropagation(), we();
|
|
267
|
+
},
|
|
268
|
+
"data-testid": "retry-upload",
|
|
269
|
+
children: V("file.upload.retry", "Retry")
|
|
270
|
+
})]
|
|
271
|
+
})
|
|
272
|
+
]
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
function h(e, t) {
|
|
276
|
+
return [
|
|
277
|
+
"relative overflow-hidden border border-border bg-surface-2",
|
|
278
|
+
e === "circle" ? "rounded-full" : "rounded-md",
|
|
279
|
+
t ? "cursor-pointer focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent" : ""
|
|
280
|
+
].filter(Boolean).join(" ");
|
|
281
|
+
}
|
|
282
|
+
function g(e) {
|
|
283
|
+
return "h-full w-full object-cover";
|
|
284
|
+
}
|
|
285
|
+
function he(e, t) {
|
|
286
|
+
return t ? t.replace(":", " / ") : e === "wide" ? "16 / 9" : "1 / 1";
|
|
287
|
+
}
|
|
288
|
+
function ge(e) {
|
|
289
|
+
if (!e) return;
|
|
290
|
+
let t = e.replace(/\s/g, "").match(/^(\d+(?:\.\d+)?)[:/](\d+(?:\.\d+)?)$/);
|
|
291
|
+
if (!t) return;
|
|
292
|
+
let n = Number(t[1]), r = Number(t[2]);
|
|
293
|
+
if (n && r) return n / r;
|
|
294
|
+
}
|
|
295
|
+
function _({ shape: e, initialsTitle: t }) {
|
|
296
|
+
let r = n();
|
|
297
|
+
return t ? /* @__PURE__ */ d("div", {
|
|
298
|
+
className: "flex h-full w-full items-center justify-center bg-surface-3 text-text-3",
|
|
299
|
+
children: /* @__PURE__ */ d("span", {
|
|
300
|
+
className: e === "circle" ? "text-lg font-medium" : "text-base font-medium",
|
|
301
|
+
children: p(t)
|
|
302
|
+
})
|
|
303
|
+
}) : /* @__PURE__ */ d("div", {
|
|
304
|
+
className: "flex h-full w-full items-center justify-center bg-surface-3 text-text-4",
|
|
305
|
+
children: /* @__PURE__ */ d("span", {
|
|
306
|
+
className: "text-xs",
|
|
307
|
+
children: e === "wide" ? r("file.image.drop", "Drop image here") : "+"
|
|
308
|
+
})
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
function _e({ pct: e, label: t }) {
|
|
312
|
+
let n = 2 * Math.PI * 18, r = n - Math.max(0, Math.min(100, e)) / 100 * n;
|
|
313
|
+
return /* @__PURE__ */ f("div", {
|
|
314
|
+
className: "absolute inset-0 flex items-center justify-center bg-black/30",
|
|
315
|
+
"data-testid": "upload-progress",
|
|
316
|
+
"aria-label": t,
|
|
317
|
+
role: "progressbar",
|
|
318
|
+
"aria-valuenow": Math.round(e),
|
|
319
|
+
"aria-valuemin": 0,
|
|
320
|
+
"aria-valuemax": 100,
|
|
321
|
+
children: [/* @__PURE__ */ f("svg", {
|
|
322
|
+
width: "48",
|
|
323
|
+
height: "48",
|
|
324
|
+
viewBox: "0 0 48 48",
|
|
325
|
+
children: [/* @__PURE__ */ d("circle", {
|
|
326
|
+
cx: "24",
|
|
327
|
+
cy: "24",
|
|
328
|
+
r: 18,
|
|
329
|
+
stroke: "currentColor",
|
|
330
|
+
strokeOpacity: "0.25",
|
|
331
|
+
strokeWidth: "4",
|
|
332
|
+
fill: "none",
|
|
333
|
+
className: "text-foreground"
|
|
334
|
+
}), /* @__PURE__ */ d("circle", {
|
|
335
|
+
cx: "24",
|
|
336
|
+
cy: "24",
|
|
337
|
+
r: 18,
|
|
338
|
+
stroke: "currentColor",
|
|
339
|
+
strokeWidth: "4",
|
|
340
|
+
fill: "none",
|
|
341
|
+
strokeDasharray: n,
|
|
342
|
+
strokeDashoffset: r,
|
|
343
|
+
strokeLinecap: "round",
|
|
344
|
+
className: "text-accent",
|
|
345
|
+
transform: "rotate(-90 24 24)"
|
|
346
|
+
})]
|
|
347
|
+
}), /* @__PURE__ */ f("span", {
|
|
348
|
+
className: "absolute text-xs text-foreground",
|
|
349
|
+
children: [Math.round(e), "%"]
|
|
350
|
+
})]
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
//#endregion
|
|
354
|
+
export { m as ImageWidget };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { useText as e } from "../../hooks/useText.js";
|
|
2
|
+
import { getFileWidget as t } from "./registry.js";
|
|
3
|
+
import { UnknownFileWidget as n } from "./UnknownFileWidget.js";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/file-widgets/LabeledSlots.tsx
|
|
6
|
+
function a(e) {
|
|
7
|
+
return !e || Array.isArray(e) || typeof e != "object" ? {} : e;
|
|
8
|
+
}
|
|
9
|
+
function o(e, t) {
|
|
10
|
+
return t?.content_type?.startsWith("image/") ? !0 : (e.accepts ?? []).some((e) => e === "image/*" || e.startsWith("image/"));
|
|
11
|
+
}
|
|
12
|
+
function s(e, t, n, r) {
|
|
13
|
+
return {
|
|
14
|
+
...e,
|
|
15
|
+
name: `${e.name}.${t}`,
|
|
16
|
+
mode: "single",
|
|
17
|
+
accepts: n.accepts ?? e.accepts,
|
|
18
|
+
max_size_bytes: n.max_size_bytes ?? e.max_size_bytes,
|
|
19
|
+
slots: void 0,
|
|
20
|
+
display: {
|
|
21
|
+
...e.display ?? { widget: "document_card" },
|
|
22
|
+
widget: o(n, r) ? "square_image" : "document_card",
|
|
23
|
+
aspect_ratio: n.aspect_ratio ?? e.display?.aspect_ratio
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function c(o) {
|
|
28
|
+
let { field: c, fieldName: l, entityCode: u, value: d, recordTitle: f, onChange: p, mode: m, disabled: h } = o, g = Object.entries(c.slots ?? {}), _ = a(d), v = e();
|
|
29
|
+
return g.length === 0 ? /* @__PURE__ */ r("span", {
|
|
30
|
+
className: "text-sm text-muted-foreground",
|
|
31
|
+
children: v("file.slots.empty", "No slots configured")
|
|
32
|
+
}) : /* @__PURE__ */ r("div", {
|
|
33
|
+
className: "grid gap-3",
|
|
34
|
+
children: g.map(([e, a]) => {
|
|
35
|
+
let o = _[e] ?? null, d = s(c, e, a, o), g = d.display?.widget ?? "document_card", y = t(g);
|
|
36
|
+
return y ? /* @__PURE__ */ i("div", {
|
|
37
|
+
className: "grid gap-1.5",
|
|
38
|
+
children: [/* @__PURE__ */ r("div", {
|
|
39
|
+
className: "text-xs font-semibold text-text-2",
|
|
40
|
+
children: v(a.name)
|
|
41
|
+
}), /* @__PURE__ */ r(y, {
|
|
42
|
+
field: d,
|
|
43
|
+
fieldName: e,
|
|
44
|
+
entityCode: u,
|
|
45
|
+
value: o,
|
|
46
|
+
recordTitle: f,
|
|
47
|
+
mode: m,
|
|
48
|
+
disabled: h,
|
|
49
|
+
uploadFieldCode: l,
|
|
50
|
+
uploadSlotCode: e,
|
|
51
|
+
onChange: (t) => {
|
|
52
|
+
p && p({
|
|
53
|
+
..._,
|
|
54
|
+
[e]: t ?? null
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
})]
|
|
58
|
+
}, e) : /* @__PURE__ */ i("div", {
|
|
59
|
+
className: "grid gap-1.5",
|
|
60
|
+
children: [/* @__PURE__ */ r("div", {
|
|
61
|
+
className: "text-xs font-semibold text-text-2",
|
|
62
|
+
children: v(a.name)
|
|
63
|
+
}), /* @__PURE__ */ r(n, { widgetCode: g })]
|
|
64
|
+
}, e);
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
export { c as LabeledSlots };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ImageWidget as e } from "./ImageWidget.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/file-widgets/SquareImage.tsx
|
|
4
|
+
function n(n) {
|
|
5
|
+
return /* @__PURE__ */ t(e, {
|
|
6
|
+
...n,
|
|
7
|
+
visual: { shape: "square" }
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { n as SquareImage };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useText as e } from "../../hooks/useText.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/file-widgets/UnknownFileWidget.tsx
|
|
4
|
+
function r({ widgetCode: r }) {
|
|
5
|
+
let i = e(), a = e("errors");
|
|
6
|
+
return r ? /* @__PURE__ */ n("span", {
|
|
7
|
+
className: "text-sm text-muted-foreground",
|
|
8
|
+
children: [
|
|
9
|
+
a("file.unknown_widget", "This file field names a widget this deployment does not have."),
|
|
10
|
+
" ",
|
|
11
|
+
/* @__PURE__ */ t("span", {
|
|
12
|
+
className: "opacity-80",
|
|
13
|
+
children: i("file.widget_code", "Widget: {widget}", { widget: r })
|
|
14
|
+
})
|
|
15
|
+
]
|
|
16
|
+
}) : /* @__PURE__ */ t("span", {
|
|
17
|
+
className: "text-sm text-muted-foreground",
|
|
18
|
+
children: a("file.missing_widget", "This file field does not name a widget to show it.")
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { r as UnknownFileWidget };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/file-widgets/UploadFailureText.tsx
|
|
3
|
+
function r({ failure: r }) {
|
|
4
|
+
return /* @__PURE__ */ n(e, { children: [r.message, r.detail && /* @__PURE__ */ n(e, { children: [" ", /* @__PURE__ */ t("span", {
|
|
5
|
+
className: "opacity-80",
|
|
6
|
+
children: r.detail
|
|
7
|
+
})] })] });
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { r as UploadFailureText };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ImageWidget as e } from "./ImageWidget.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/file-widgets/WideBanner.tsx
|
|
4
|
+
function n(n) {
|
|
5
|
+
return /* @__PURE__ */ t(e, {
|
|
6
|
+
...n,
|
|
7
|
+
visual: { shape: "wide" }
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { n as WideBanner };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { registerFileWidget as e } from "./registry.js";
|
|
2
|
+
import { SquareImage as t } from "./SquareImage.js";
|
|
3
|
+
import { CircleImage as n } from "./CircleImage.js";
|
|
4
|
+
import { WideBanner as r } from "./WideBanner.js";
|
|
5
|
+
import { GridLazy as i } from "./GridLazy.js";
|
|
6
|
+
import { DocumentCard as a } from "./DocumentCard.js";
|
|
7
|
+
import { FileList as o } from "./FileList.js";
|
|
8
|
+
import { LabeledSlots as s } from "./LabeledSlots.js";
|
|
9
|
+
//#region src/components/file-widgets/builtins.ts
|
|
10
|
+
var c = !1;
|
|
11
|
+
function l() {
|
|
12
|
+
c ||= (e("square_image", t), e("circle_image", n), e("wide_banner", r), e("grid", i), e("document_card", a), e("file_list", o), e("labeled_slots", s), !0);
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { l as registerBuiltinFileWidgets };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/components/file-widgets/cropper.ts
|
|
2
|
+
var e = ({ file: e }) => Promise.resolve({
|
|
3
|
+
blob: e,
|
|
4
|
+
filename: e.name
|
|
5
|
+
}), t = e;
|
|
6
|
+
function n(n) {
|
|
7
|
+
t = n ?? e;
|
|
8
|
+
}
|
|
9
|
+
function r() {
|
|
10
|
+
return t;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as getImageCropper, n as setImageCropper };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { createContext as e, useCallback as t, useContext as n, useMemo as r, useRef as i } from "react";
|
|
2
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/file-widgets/draft-scope.tsx
|
|
4
|
+
var o = e({
|
|
5
|
+
registerDraft() {},
|
|
6
|
+
unregisterDraft() {},
|
|
7
|
+
hasDraft() {
|
|
8
|
+
return !1;
|
|
9
|
+
},
|
|
10
|
+
flushAllDrafts: async () => {},
|
|
11
|
+
markCommitted() {}
|
|
12
|
+
});
|
|
13
|
+
function s({ children: e }) {
|
|
14
|
+
let t = i(/* @__PURE__ */ new Map()), n = r(() => ({
|
|
15
|
+
registerDraft(e) {
|
|
16
|
+
t.current.set(e.fileId, e);
|
|
17
|
+
},
|
|
18
|
+
unregisterDraft(e) {
|
|
19
|
+
t.current.delete(e);
|
|
20
|
+
},
|
|
21
|
+
hasDraft(e) {
|
|
22
|
+
return t.current.has(e);
|
|
23
|
+
},
|
|
24
|
+
markCommitted(e) {
|
|
25
|
+
t.current.delete(e);
|
|
26
|
+
},
|
|
27
|
+
async flushAllDrafts() {
|
|
28
|
+
let e = Array.from(t.current.values());
|
|
29
|
+
t.current.clear(), await Promise.allSettled(e.map((e) => Promise.resolve(e.discard())));
|
|
30
|
+
}
|
|
31
|
+
}), []);
|
|
32
|
+
return /* @__PURE__ */ a(o.Provider, {
|
|
33
|
+
value: n,
|
|
34
|
+
children: e
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function c() {
|
|
38
|
+
return n(o);
|
|
39
|
+
}
|
|
40
|
+
function l() {
|
|
41
|
+
let e = c();
|
|
42
|
+
return {
|
|
43
|
+
register: t((t, n) => {
|
|
44
|
+
e.registerDraft({
|
|
45
|
+
fileId: t,
|
|
46
|
+
discard: n
|
|
47
|
+
});
|
|
48
|
+
}, [e]),
|
|
49
|
+
unregister: t((t) => {
|
|
50
|
+
e.unregisterDraft(t);
|
|
51
|
+
}, [e]),
|
|
52
|
+
markCommitted: t((t) => {
|
|
53
|
+
e.markCommitted(t);
|
|
54
|
+
}, [e]),
|
|
55
|
+
isDraft: t((t) => e.hasDraft(t), [e])
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { s as FileDraftScope, l as useDraftRegistration, c as useFileDraftScope };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { pickLocalized as e } from "../../lib/language.js";
|
|
2
|
+
//#region src/components/file-widgets/helpers.ts
|
|
3
|
+
var t = ["thumb_200", "thumb_300"];
|
|
4
|
+
function n(t, n, r, i, a) {
|
|
5
|
+
if (n) return n;
|
|
6
|
+
let o = t?.metadata?.alt_text;
|
|
7
|
+
if (typeof o == "string" && o.length > 0) return o;
|
|
8
|
+
if (o && typeof o == "object" && !Array.isArray(o)) {
|
|
9
|
+
let t = Object.fromEntries(Object.entries(o).filter((e) => e[0].length > 0 && typeof e[1] == "string")), n = e(t, i, a);
|
|
10
|
+
if (n) return n;
|
|
11
|
+
}
|
|
12
|
+
return r;
|
|
13
|
+
}
|
|
14
|
+
var r = /* @__PURE__ */ new Set([
|
|
15
|
+
"image/png",
|
|
16
|
+
"image/jpeg",
|
|
17
|
+
"image/webp",
|
|
18
|
+
"image/gif",
|
|
19
|
+
"image/avif",
|
|
20
|
+
"application/pdf"
|
|
21
|
+
]);
|
|
22
|
+
function i(e) {
|
|
23
|
+
let t = e.content_type?.toLowerCase().split(";")[0]?.trim() ?? "";
|
|
24
|
+
return r.has(t);
|
|
25
|
+
}
|
|
26
|
+
function a(e) {
|
|
27
|
+
return e.url ?? e.presigned_url;
|
|
28
|
+
}
|
|
29
|
+
function o(e) {
|
|
30
|
+
return e.url ? l(e.url, "attachment") : e.presigned_url;
|
|
31
|
+
}
|
|
32
|
+
function s(e, n) {
|
|
33
|
+
if (!e) return;
|
|
34
|
+
let r = e.derivations ?? {};
|
|
35
|
+
if (n && r[n]) return r[n];
|
|
36
|
+
for (let e of t) if (r[e]) return r[e];
|
|
37
|
+
return e.url ?? e.presigned_url;
|
|
38
|
+
}
|
|
39
|
+
function c(e, n) {
|
|
40
|
+
let r = e?.derivations ?? {};
|
|
41
|
+
if (n && r[n]) return { derivation: n };
|
|
42
|
+
for (let e of t) if (r[e]) return { derivation: e };
|
|
43
|
+
return "preview";
|
|
44
|
+
}
|
|
45
|
+
function l(e, t) {
|
|
46
|
+
try {
|
|
47
|
+
let n = new URL(e, typeof window < "u" ? window.location.origin : "http://localhost");
|
|
48
|
+
return n.searchParams.set("disposition", t), /^https?:\/\//i.test(e) ? n.toString() : `${n.pathname}${n.search}${n.hash}`;
|
|
49
|
+
} catch {
|
|
50
|
+
return `${e}${e.includes("?") ? "&" : "?"}disposition=${t}`;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function u(e) {
|
|
54
|
+
let t = e?.metadata?.focal_point;
|
|
55
|
+
if (!t || typeof t != "object" || Array.isArray(t)) return null;
|
|
56
|
+
let n = t, r = typeof n.x == "number" ? n.x : NaN, i = typeof n.y == "number" ? n.y : NaN;
|
|
57
|
+
return !Number.isFinite(r) || !Number.isFinite(i) || r < 0 || r > 1 || i < 0 || i > 1 ? null : {
|
|
58
|
+
x: r,
|
|
59
|
+
y: i
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function d(e) {
|
|
63
|
+
if (e) return `${e.x * 100}% ${e.y * 100}%`;
|
|
64
|
+
}
|
|
65
|
+
function f(e, t) {
|
|
66
|
+
return {
|
|
67
|
+
...e,
|
|
68
|
+
metadata: {
|
|
69
|
+
...e.metadata ?? {},
|
|
70
|
+
focal_point: t
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { i as canPreviewFile, o as downloadFileURL, d as focalPointObjectPosition, s as preferredListThumbnailURL, c as preferredThumbnailVariant, a as previewFileURL, u as readFocalPoint, n as resolveFileAltText, f as withFocalPoint };
|