@declarion/react 0.142.0 → 0.147.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/{Icons-Dzl-AkD_.d.ts → Icons-BdXCxyw3.d.ts} +0 -4
- package/dist-lib/api/access-expiry.js +1 -2
- package/dist-lib/api/agents.js +1 -2
- package/dist-lib/api/audience.js +1 -2
- package/dist-lib/api/auth-redirect.js +1 -2
- package/dist-lib/api/auth.js +1 -2
- package/dist-lib/api/batch.js +1 -2
- package/dist-lib/api/client.js +27 -28
- package/dist-lib/api/data.js +23 -24
- package/dist-lib/api/entities.js +36 -37
- package/dist-lib/api/events.js +6 -7
- package/dist-lib/api/fileReferences.js +1 -2
- package/dist-lib/api/params.js +1 -2
- package/dist-lib/api/properties.js +1 -2
- package/dist-lib/api/request-bounds.js +1 -2
- package/dist-lib/api/schema.js +5 -6
- package/dist-lib/api/session-renewal.js +6 -7
- package/dist-lib/api/status.js +1 -2
- package/dist-lib/app.js +154 -155
- package/dist-lib/components/actions/ActionButton.js +32 -33
- package/dist-lib/components/actions/ActionDialog.js +85 -86
- package/dist-lib/components/actions/ActionResultDialog.impl.js +48 -49
- package/dist-lib/components/actions/ActionResultDialog.js +1 -2
- package/dist-lib/components/actions/ActionRunner.js +96 -97
- package/dist-lib/components/actions/ObjectActionBar.js +49 -50
- package/dist-lib/components/actions/PropertyGridEditor.js +50 -51
- package/dist-lib/components/actions/ResponsiveActionBar.js +127 -128
- package/dist-lib/components/actions/RowActionsKebab.js +27 -28
- package/dist-lib/components/agents/AgentChatPanel.impl.js +317 -318
- package/dist-lib/components/agents/AgentChatPanel.js +1 -2
- package/dist-lib/components/agents/AgentConversationDrawer.js +6 -7
- package/dist-lib/components/agents/AgentElicitForm.js +13 -14
- package/dist-lib/components/agents/AgentOpenFollower.impl.js +1 -2
- package/dist-lib/components/agents/AgentOpenFollower.js +1 -2
- package/dist-lib/components/agents/AgentPicker.js +1 -2
- package/dist-lib/components/agents/ChatAttachments.js +22 -23
- package/dist-lib/components/agents/transcript-runs.js +1 -2
- package/dist-lib/components/chrome/AssociationTabs.js +44 -45
- package/dist-lib/components/chrome/AuditMetaStrip.js +1 -2
- package/dist-lib/components/chrome/Breadcrumbs.js +1 -2
- package/dist-lib/components/chrome/HighlightsStrip.js +1 -2
- package/dist-lib/components/chrome/PageHeader.js +12 -13
- package/dist-lib/components/chrome/PageShell.js +1 -2
- package/dist-lib/components/chrome/RecordHeader.js +1 -2
- package/dist-lib/components/chrome/headerActionZone.js +0 -1
- package/dist-lib/components/detail-layout/AssociatedBlock.js +463 -464
- package/dist-lib/components/detail-layout/AssociatedToolbar.js +43 -44
- package/dist-lib/components/detail-layout/ChildrenBlock.js +24 -25
- package/dist-lib/components/detail-layout/ChildrenCards.js +29 -30
- package/dist-lib/components/detail-layout/ChildrenList.js +23 -24
- package/dist-lib/components/detail-layout/ChildrenTable.js +50 -51
- package/dist-lib/components/detail-layout/ChildrenTimeline.js +164 -165
- package/dist-lib/components/detail-layout/DetailAuditStrip.js +14 -15
- package/dist-lib/components/detail-layout/DetailHighlights.js +23 -24
- package/dist-lib/components/detail-layout/DraggableChildrenTable.js +76 -77
- package/dist-lib/components/detail-layout/EditableChildrenTable.js +90 -91
- package/dist-lib/components/detail-layout/ErrorSummary.js +7 -8
- package/dist-lib/components/detail-layout/EvidenceBlock.js +15 -16
- package/dist-lib/components/detail-layout/FieldRow.js +11 -12
- package/dist-lib/components/detail-layout/FieldsBlock.js +31 -32
- package/dist-lib/components/detail-layout/LayoutColumn.js +1 -2
- package/dist-lib/components/detail-layout/LayoutRenderer.js +11 -12
- package/dist-lib/components/detail-layout/LayoutRow.js +1 -2
- package/dist-lib/components/detail-layout/LayoutTabs.js +23 -24
- package/dist-lib/components/detail-layout/PropertiesBlock.js +38 -39
- package/dist-lib/components/detail-layout/QuickAddForm.js +28 -29
- package/dist-lib/components/detail-layout/SectionBlock.js +9 -10
- package/dist-lib/components/detail-layout/StatusesBlock.js +1 -2
- package/dist-lib/components/detail-layout/TimelineComposer.js +19 -20
- package/dist-lib/components/detail-layout/blockMeta.js +1 -2
- package/dist-lib/components/detail-layout/useManualColumnResize.js +1 -2
- package/dist-lib/components/detail-layout/useQuickAdd.js +21 -22
- package/dist-lib/components/detail-layout/visibility.js +1 -2
- package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +25 -26
- package/dist-lib/components/detail-layout/widgets/JsonDiffWidget.js +18 -19
- package/dist-lib/components/detail-layout/widgets/MonacoJson.js +1 -2
- package/dist-lib/components/detail-layout/widgets/WidgetHost.js +10 -11
- package/dist-lib/components/detail-layout/widgets/builtins.js +1 -2
- package/dist-lib/components/detail-layout/widgets/canonicalizeJson.js +1 -2
- package/dist-lib/components/detail-layout/widgets/monacoBootstrap.js +1 -2
- package/dist-lib/components/detail-layout/widgets/registry.js +1 -2
- package/dist-lib/components/fields/BoolField.js +1 -2
- package/dist-lib/components/fields/EmailField.js +5 -6
- package/dist-lib/components/fields/EnumField.js +7 -8
- package/dist-lib/components/fields/FileReferenceField.js +18 -19
- package/dist-lib/components/fields/IntArrayField.js +11 -12
- package/dist-lib/components/fields/JsonEditor.js +1 -2
- package/dist-lib/components/fields/JsonField.js +1 -2
- package/dist-lib/components/fields/MultilangArrayField.js +22 -23
- package/dist-lib/components/fields/MultilangField.js +13 -14
- package/dist-lib/components/fields/MultilangTextField.js +13 -14
- package/dist-lib/components/fields/NumberField.js +5 -6
- package/dist-lib/components/fields/PasswordField.js +1 -2
- package/dist-lib/components/fields/PhoneField.js +24 -25
- package/dist-lib/components/fields/RefCombobox.js +42 -43
- package/dist-lib/components/fields/RefField.js +14 -15
- package/dist-lib/components/fields/RichTextField.js +29 -30
- package/dist-lib/components/fields/SecretField.js +1 -2
- package/dist-lib/components/fields/StringArrayField.js +29 -30
- package/dist-lib/components/fields/StringField.js +12 -13
- package/dist-lib/components/fields/StructureField.js +60 -61
- package/dist-lib/components/fields/TextField.js +18 -19
- package/dist-lib/components/fields/TimestampField.js +17 -18
- package/dist-lib/components/fields/UrlField.js +5 -6
- package/dist-lib/components/fields/cells/factories/badge.js +5 -6
- package/dist-lib/components/fields/cells/factories/boolPill.js +1 -2
- package/dist-lib/components/fields/cells/factories/code.js +1 -2
- package/dist-lib/components/fields/cells/factories/date.js +1 -2
- package/dist-lib/components/fields/cells/factories/email.js +1 -2
- package/dist-lib/components/fields/cells/factories/emptyCell.js +0 -1
- package/dist-lib/components/fields/cells/factories/fileReference.js +1 -2
- package/dist-lib/components/fields/cells/factories/host-icons.js +1 -2
- package/dist-lib/components/fields/cells/factories/json.js +1 -2
- package/dist-lib/components/fields/cells/factories/link.js +10 -11
- package/dist-lib/components/fields/cells/factories/markdown.js +14 -15
- package/dist-lib/components/fields/cells/factories/markdownPreview.js +1 -2
- package/dist-lib/components/fields/cells/factories/money.js +1 -2
- package/dist-lib/components/fields/cells/factories/multilangInline.js +1 -2
- package/dist-lib/components/fields/cells/factories/nextRun.js +8 -9
- package/dist-lib/components/fields/cells/factories/number.js +1 -2
- package/dist-lib/components/fields/cells/factories/passwordMask.js +1 -2
- package/dist-lib/components/fields/cells/factories/phone.js +1 -2
- package/dist-lib/components/fields/cells/factories/refLink.js +13 -14
- package/dist-lib/components/fields/cells/factories/richTextPreview.js +16 -17
- package/dist-lib/components/fields/cells/factories/statusPill.js +5 -6
- package/dist-lib/components/fields/cells/factories/tagList.js +6 -7
- package/dist-lib/components/fields/cells/factories/text.js +1 -2
- package/dist-lib/components/fields/cells/factories/timestamp.js +1 -2
- package/dist-lib/components/fields/cells/factories/url-helpers.js +1 -2
- package/dist-lib/components/fields/cells/factories/url.js +13 -14
- package/dist-lib/components/fields/cells/registry.js +1 -2
- package/dist-lib/components/fields/index.js +19 -20
- package/dist-lib/components/fields/langMap.js +1 -2
- package/dist-lib/components/fields/secretValue.js +1 -2
- package/dist-lib/components/file-widgets/CircleImage.js +1 -2
- package/dist-lib/components/file-widgets/DocumentCard.js +101 -102
- package/dist-lib/components/file-widgets/FileList.js +35 -36
- package/dist-lib/components/file-widgets/Grid.js +119 -120
- package/dist-lib/components/file-widgets/GridLazy.js +1 -2
- package/dist-lib/components/file-widgets/ImageWidget.js +189 -190
- package/dist-lib/components/file-widgets/LabeledSlots.js +14 -15
- package/dist-lib/components/file-widgets/SquareImage.js +1 -2
- package/dist-lib/components/file-widgets/UnknownFileWidget.js +1 -2
- package/dist-lib/components/file-widgets/UploadFailureText.js +1 -2
- package/dist-lib/components/file-widgets/WideBanner.js +1 -2
- package/dist-lib/components/file-widgets/builtins.js +1 -2
- package/dist-lib/components/file-widgets/cropper.js +1 -2
- package/dist-lib/components/file-widgets/draft-scope.js +1 -2
- package/dist-lib/components/file-widgets/helpers.js +1 -2
- package/dist-lib/components/file-widgets/host.js +33 -34
- package/dist-lib/components/file-widgets/payload.js +1 -2
- package/dist-lib/components/file-widgets/registry.js +1 -2
- package/dist-lib/components/file-widgets/upload.js +41 -42
- package/dist-lib/components/file-widgets/useEmbedFileSrc.js +12 -13
- package/dist-lib/components/file-widgets/useFileSelection.js +1 -2
- package/dist-lib/components/file-widgets/value.js +1 -2
- package/dist-lib/components/filters/FilterChips.js +15 -16
- package/dist-lib/components/filters/FilterConditionValue.js +15 -16
- package/dist-lib/components/filters/FilterDrawer.js +141 -142
- package/dist-lib/components/filters/FilterOmittedNotice.js +1 -2
- package/dist-lib/components/filters/filter-op-label.js +1 -2
- package/dist-lib/components/layout/CommandPalette.impl.js +24 -25
- package/dist-lib/components/layout/CommandPalette.js +1 -2
- package/dist-lib/components/layout/DirtyTabsCloseDialog.impl.js +15 -16
- package/dist-lib/components/layout/DirtyTabsCloseDialog.js +1 -2
- package/dist-lib/components/layout/ImpersonationBanner.impl.js +6 -7
- package/dist-lib/components/layout/ImpersonationBanner.js +1 -2
- package/dist-lib/components/layout/ImpersonationFrame.js +4 -5
- package/dist-lib/components/layout/ImpersonationStartModal.impl.js +4 -5
- package/dist-lib/components/layout/ImpersonationStartModal.js +1 -2
- package/dist-lib/components/layout/Layout.js +132 -140
- package/dist-lib/components/layout/Rail.js +11 -12
- package/dist-lib/components/layout/Sidebar.js +60 -61
- package/dist-lib/components/layout/TabStrip.js +66 -67
- package/dist-lib/components/layout/TenantChip.js +21 -22
- package/dist-lib/components/layout/TopBar.js +89 -90
- package/dist-lib/components/layout/tab-close.js +1 -2
- package/dist-lib/components/list/ColumnPicker.js +35 -36
- package/dist-lib/components/list/InlineEditCell.js +22 -23
- package/dist-lib/components/list/PeekFieldCell.js +7 -8
- package/dist-lib/components/list/QuickPeek.js +29 -30
- package/dist-lib/components/list/ViewSwitcher.js +44 -45
- package/dist-lib/components/list/peekDraftStore.js +1 -2
- package/dist-lib/components/pages/AdminCatalogPage.impl.js +59 -60
- package/dist-lib/components/pages/AdminCatalogPage.js +1 -2
- package/dist-lib/components/pages/DocumentsMenu.js +53 -54
- package/dist-lib/components/pages/ExportMenu.js +37 -38
- package/dist-lib/components/pages/NoScreensPage.impl.js +5 -6
- package/dist-lib/components/pages/NoScreensPage.js +1 -2
- package/dist-lib/components/pages/NotFoundPage.impl.js +7 -8
- package/dist-lib/components/pages/NotFoundPage.js +1 -2
- package/dist-lib/components/pages/RecordDocumentsPanel.js +40 -41
- package/dist-lib/components/pages/RecordNotesPanel.js +43 -44
- package/dist-lib/components/pages/RecordPanels.js +1 -2
- package/dist-lib/components/pages/SSOCallbackPage.impl.js +6 -7
- package/dist-lib/components/pages/SSOCallbackPage.js +1 -2
- package/dist-lib/components/pages/SmartDetailPage.impl.js +501 -502
- package/dist-lib/components/pages/SmartDetailPage.js +1 -2
- package/dist-lib/components/pages/SmartListPage.impl.js +316 -317
- package/dist-lib/components/pages/SmartListPage.js +1 -2
- package/dist-lib/components/pages/SmartRecordListPage.impl.js +316 -317
- package/dist-lib/components/pages/SmartRecordListPage.js +1 -2
- package/dist-lib/components/pages/auth/AuthShell.js +14 -15
- package/dist-lib/components/pages/auth/CodeInput.js +0 -1
- package/dist-lib/components/pages/auth/Forgot.impl.js +12 -13
- package/dist-lib/components/pages/auth/Forgot.js +1 -2
- package/dist-lib/components/pages/auth/Reset.impl.js +20 -21
- package/dist-lib/components/pages/auth/Reset.js +1 -2
- package/dist-lib/components/pages/auth/SignIn.js +44 -45
- package/dist-lib/components/pages/auth/SignUp.impl.js +35 -36
- package/dist-lib/components/pages/auth/SignUp.js +1 -2
- package/dist-lib/components/pages/auth/SignUpCode.js +17 -18
- package/dist-lib/components/pages/auth/TwoFA.impl.js +9 -10
- package/dist-lib/components/pages/auth/TwoFA.js +1 -2
- package/dist-lib/components/pages/auth/icons.js +1 -2
- package/dist-lib/components/pages/exportRequest.js +1 -2
- package/dist-lib/components/pages/list/DataCell.js +1 -2
- package/dist-lib/components/pages/list/DeleteViewDialog.js +5 -6
- package/dist-lib/components/pages/list/ListCardRow.js +53 -54
- package/dist-lib/components/pages/list/ListCardsBody.js +1 -2
- package/dist-lib/components/pages/list/ListFloatbar.js +25 -26
- package/dist-lib/components/pages/list/ListFooter.js +17 -18
- package/dist-lib/components/pages/list/ListHeader.js +31 -32
- package/dist-lib/components/pages/list/ListNoRows.js +32 -33
- package/dist-lib/components/pages/list/ListTable.js +29 -30
- package/dist-lib/components/pages/list/ListTableRow.js +1 -2
- package/dist-lib/components/pages/list/ListToolbar.js +58 -59
- package/dist-lib/components/pages/list/ListUrlBanner.js +1 -2
- package/dist-lib/components/pages/list/RowActionsCell.js +6 -7
- package/dist-lib/components/pages/list/RowContextMenu.js +1 -2
- package/dist-lib/components/pages/list/SaveViewDialog.js +5 -6
- package/dist-lib/components/pages/list/SortHeaderMenu.js +25 -26
- package/dist-lib/components/pages/list/cardProjection.js +16 -17
- package/dist-lib/components/pages/list/column-sizing.js +1 -2
- package/dist-lib/components/pages/list/columns.js +74 -75
- package/dist-lib/components/pages/list/filter-meta.js +1 -2
- package/dist-lib/components/pages/list/page-size.js +1 -2
- package/dist-lib/components/pages/list/sortable-header.js +1 -2
- package/dist-lib/components/pages/list/table-features.js +1 -2
- package/dist-lib/components/pages/list/use-filter-value-labels.js +15 -16
- package/dist-lib/components/pages/list/useActiveView.js +1 -2
- package/dist-lib/components/pages/list/useHeaderReorder.js +1 -2
- package/dist-lib/components/pages/list/useListColumnLayout.js +6 -7
- package/dist-lib/components/pages/list/useListFilterPresentation.js +1 -2
- package/dist-lib/components/pages/list/useListQuery.js +1 -2
- package/dist-lib/components/pages/list/useListRowInteraction.js +37 -38
- package/dist-lib/components/pages/list/useListSelection.js +16 -17
- package/dist-lib/components/pages/list/useListSort.js +1 -2
- package/dist-lib/components/pages/list/useListViews.js +31 -32
- package/dist-lib/components/pages/list/useRowMenu.js +20 -21
- package/dist-lib/components/pages/list/visible-filters.js +1 -2
- package/dist-lib/components/pages/profile/Preferences.impl.js +44 -45
- package/dist-lib/components/pages/profile/Preferences.js +1 -2
- package/dist-lib/components/pages/profile/Profile.impl.js +223 -224
- package/dist-lib/components/pages/profile/Profile.js +1 -2
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +133 -134
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.js +1 -2
- package/dist-lib/components/params/ParamsBlock.js +30 -31
- package/dist-lib/components/params/param-editors.js +58 -59
- package/dist-lib/components/primitives/Avatar.js +1 -2
- package/dist-lib/components/primitives/BoolToggle.js +1 -2
- package/dist-lib/components/primitives/BrandGlyph.js +1 -2
- package/dist-lib/components/primitives/BrandLogo.js +1 -2
- package/dist-lib/components/primitives/Btn.js +1 -2
- package/dist-lib/components/primitives/Check.js +1 -2
- package/dist-lib/components/primitives/Chip.js +1 -2
- package/dist-lib/components/primitives/ClassifiedFieldLocked.js +1 -2
- package/dist-lib/components/primitives/Dropdown.js +2 -3
- package/dist-lib/components/primitives/Fields.js +128 -129
- package/dist-lib/components/primitives/HoverCard.js +2 -3
- package/dist-lib/components/primitives/IconBtn.js +1 -2
- package/dist-lib/components/primitives/Icons.js +1 -2
- package/dist-lib/components/primitives/Kbd.js +1 -2
- package/dist-lib/components/primitives/MenuItem.js +1 -2
- package/dist-lib/components/primitives/Pill.js +1 -2
- package/dist-lib/components/primitives/RecordIdBadge.js +1 -2
- package/dist-lib/components/primitives/RetryButton.js +5 -6
- package/dist-lib/components/primitives/RowField.js +1 -2
- package/dist-lib/components/primitives/SectionCard.js +1 -2
- package/dist-lib/components/primitives/Spinner.js +1 -2
- package/dist-lib/components/primitives/StatTile.js +1 -2
- package/dist-lib/components/primitives/Tooltip.js +1 -2
- package/dist-lib/components/primitives/dataTableStyles.js +1 -2
- package/dist-lib/components/shared/BlankScreen.js +1 -2
- package/dist-lib/components/shared/ChangePasswordDialog.impl.js +20 -21
- package/dist-lib/components/shared/ChangePasswordDialog.js +1 -2
- package/dist-lib/components/shared/ConfirmDialog.js +7 -8
- package/dist-lib/components/shared/ConnectionNotice.js +1 -2
- package/dist-lib/components/shared/CopyButton.js +1 -2
- package/dist-lib/components/shared/DynamicIcon.js +1 -2
- package/dist-lib/components/shared/EmptyState.js +1 -2
- package/dist-lib/components/shared/ErrorBoundary.js +10 -11
- package/dist-lib/components/shared/LoadingSkeleton.js +1 -2
- package/dist-lib/components/shared/LucideIcon.js +1 -2
- package/dist-lib/components/shared/Markdown.js +1 -2
- package/dist-lib/components/shared/MarkdownRenderer.js +22 -23
- package/dist-lib/components/shared/ModalFrame.js +1 -2
- package/dist-lib/components/shared/RefreshControl.js +6 -7
- package/dist-lib/components/shared/StatusGroupsDisplay.js +16 -17
- package/dist-lib/components/shared/StatusStepper.js +1 -2
- package/dist-lib/components/shared/toast/DeclarionToast.js +1 -2
- package/dist-lib/components/shared/useOwnRefresh.js +1 -2
- package/dist-lib/embed/EmbedAuthBootstrap.js +30 -31
- package/dist-lib/embed/EmbedContext.js +1 -2
- package/dist-lib/embed/EmbedDirtyReporter.js +6 -7
- package/dist-lib/embed/EmbedHistoryTracker.js +1 -2
- package/dist-lib/embed/EmbedLocationReporter.js +11 -12
- package/dist-lib/embed/EmbedResizeReporter.js +9 -10
- package/dist-lib/embed/EmbedUnsavedGuard.js +5 -6
- package/dist-lib/embed/embed-dirty.js +1 -2
- package/dist-lib/embed/embed-history.js +1 -2
- package/dist-lib/embed/embed-nav-guard.js +1 -2
- package/dist-lib/embed/file-src.js +12 -13
- package/dist-lib/embed/handshake.js +1 -2
- package/dist-lib/embed/params.js +1 -2
- package/dist-lib/embed/protocol.js +1 -2
- package/dist-lib/embed/screen-location.js +1 -2
- package/dist-lib/embed/theme.js +1 -2
- package/dist-lib/embed/token.js +1 -2
- package/dist-lib/embed/useEmbedNavigate.js +25 -26
- package/dist-lib/embed/useGlobalLinkInterceptor.js +9 -10
- package/dist-lib/hooks/useActionData.js +1 -2
- package/dist-lib/hooks/useActiveTabFollowsRoute.js +7 -8
- package/dist-lib/hooks/useAgentConversation.js +122 -123
- package/dist-lib/hooks/useAggregate.js +1 -2
- package/dist-lib/hooks/useAllEntityData.js +9 -10
- package/dist-lib/hooks/useAssociatedData.js +1 -2
- package/dist-lib/hooks/useAuth.js +26 -27
- package/dist-lib/hooks/useBranding.js +1 -2
- package/dist-lib/hooks/useBrandingChrome.js +16 -17
- package/dist-lib/hooks/useChildrenData.js +4 -5
- package/dist-lib/hooks/useColumns.js +1 -2
- package/dist-lib/hooks/useConnectionNotice.js +16 -17
- package/dist-lib/hooks/useCurrentLocation.js +1 -2
- package/dist-lib/hooks/useCurrentScreen.js +1 -2
- package/dist-lib/hooks/useCursorEntityData.js +1 -2
- package/dist-lib/hooks/useDebounce.js +1 -2
- package/dist-lib/hooks/useDisplayTimeZone.js +4 -5
- package/dist-lib/hooks/useDocumentTitle.js +5 -6
- package/dist-lib/hooks/useEntity.js +1 -2
- package/dist-lib/hooks/useEntityData.js +1 -2
- package/dist-lib/hooks/useFileReferenceJSON.js +9 -10
- package/dist-lib/hooks/useFilters.js +5 -6
- package/dist-lib/hooks/useFollowAgentOpen.js +40 -41
- package/dist-lib/hooks/useImpersonation.js +15 -16
- package/dist-lib/hooks/useIntentPrefetch.js +6 -7
- package/dist-lib/hooks/useJsonSnapshot.js +1 -2
- package/dist-lib/hooks/useLanguage.js +11 -12
- package/dist-lib/hooks/useLiveObject.js +6 -7
- package/dist-lib/hooks/useLongPress.js +1 -2
- package/dist-lib/hooks/useMutations.js +31 -32
- package/dist-lib/hooks/useObject.js +1 -2
- package/dist-lib/hooks/useObjectStatus.js +4 -5
- package/dist-lib/hooks/usePageState.js +9 -10
- package/dist-lib/hooks/usePageStateRuntime.js +16 -17
- package/dist-lib/hooks/usePageStateTtl.js +1 -2
- package/dist-lib/hooks/useParams.js +58 -59
- package/dist-lib/hooks/useProperties.js +5 -6
- package/dist-lib/hooks/useRealtimeThresholds.js +4 -5
- package/dist-lib/hooks/useRefRecords.js +31 -32
- package/dist-lib/hooks/useRegisterScreenTab.js +12 -13
- package/dist-lib/hooks/useResponsiveMode.js +1 -2
- package/dist-lib/hooks/useRowTenant.js +1 -2
- package/dist-lib/hooks/useSSE.js +100 -101
- package/dist-lib/hooks/useSchema.js +16 -17
- package/dist-lib/hooks/useScreen.js +1 -2
- package/dist-lib/hooks/useScreenBack.js +17 -18
- package/dist-lib/hooks/useScreenTab.js +1 -2
- package/dist-lib/hooks/useTabNavigate.js +25 -26
- package/dist-lib/hooks/useTabSearchMirror.js +6 -7
- package/dist-lib/hooks/useTabTitle.js +10 -11
- package/dist-lib/hooks/useText.js +6 -7
- package/dist-lib/hooks/useTimelineData.js +5 -6
- package/dist-lib/hooks/useUiPreferences.js +31 -32
- package/dist-lib/hooks/useUnsavedInput.js +1 -2
- package/dist-lib/hooks/useVersionWatcher.js +16 -17
- package/dist-lib/hooks/useViews.js +16 -17
- package/dist-lib/hooks/useWindowConversation.js +1 -2
- package/dist-lib/{icon-registry-CUT4eF63.d.ts → icon-registry-BY2tt-GF.d.ts} +0 -2
- package/dist-lib/icons.d.ts +2 -4
- package/dist-lib/icons.js +5 -5
- package/dist-lib/index.d.ts +4 -272
- package/dist-lib/index.js +129 -129
- package/dist-lib/lib/action-dispatch.js +1 -2
- package/dist-lib/lib/actions.js +26 -27
- package/dist-lib/lib/anchor.js +1 -2
- package/dist-lib/lib/brand-tokens.js +1 -2
- package/dist-lib/lib/branding.js +1 -2
- package/dist-lib/lib/canonical-url.js +1 -2
- package/dist-lib/lib/capabilityPrefetch.js +1 -2
- package/dist-lib/lib/child-config.js +1 -2
- package/dist-lib/lib/children-validation.js +2 -3
- package/dist-lib/lib/date-text.js +1 -2
- package/dist-lib/lib/decimal-text.js +1 -2
- package/dist-lib/lib/display-value.js +1 -2
- package/dist-lib/lib/document-templates.js +1 -2
- package/dist-lib/lib/download.js +13 -14
- package/dist-lib/lib/evidence-verdict.js +1 -2
- package/dist-lib/lib/failure.js +4 -5
- package/dist-lib/lib/field-classification.js +1 -2
- package/dist-lib/lib/field-regions.js +1 -2
- package/dist-lib/lib/filter-evaluator.js +1 -2
- package/dist-lib/lib/filters.js +1 -2
- package/dist-lib/lib/format-count.js +1 -2
- package/dist-lib/lib/html-state.js +1 -2
- package/dist-lib/lib/language.js +1 -2
- package/dist-lib/lib/longPressGesture.js +0 -1
- package/dist-lib/lib/mass-edit.js +1 -2
- package/dist-lib/lib/money-text.js +1 -2
- package/dist-lib/lib/number-text.js +1 -2
- package/dist-lib/lib/page-inset.js +1 -2
- package/dist-lib/lib/phone.js +1 -2
- package/dist-lib/lib/profile.js +1 -2
- package/dist-lib/lib/query-retry.js +1 -2
- package/dist-lib/lib/quick-add.js +1 -2
- package/dist-lib/lib/read-display-state.js +1 -2
- package/dist-lib/lib/realtime-query-keys.js +2 -3
- package/dist-lib/lib/realtime-reconcile.js +32 -33
- package/dist-lib/lib/realtime-resync.js +40 -41
- package/dist-lib/lib/record-documents-key.js +1 -2
- package/dist-lib/lib/ref-choices.js +1 -2
- package/dist-lib/lib/refetch-when-idle.js +1 -2
- package/dist-lib/lib/rich-text.js +1 -2
- package/dist-lib/lib/role-label.js +1 -2
- package/dist-lib/lib/rowClickGesture.js +1 -2
- package/dist-lib/lib/safe-url.js +1 -2
- package/dist-lib/lib/schema-routing.js +1 -2
- package/dist-lib/lib/screen-back.js +1 -2
- package/dist-lib/lib/scroll-restoration.js +21 -22
- package/dist-lib/lib/shortcut.js +1 -2
- package/dist-lib/lib/size-value.js +1 -2
- package/dist-lib/lib/sort.js +1 -2
- package/dist-lib/lib/timestamp.js +1 -2
- package/dist-lib/lib/toast.js +1 -2
- package/dist-lib/lib/ui-actions.js +43 -44
- package/dist-lib/lib/utils.js +1 -2
- package/dist-lib/lib/variants.js +1 -2
- package/dist-lib/lib/versionTracker.js +26 -27
- package/dist-lib/lib/viewport-category.js +1 -2
- package/dist-lib/lib/window-election.js +1 -2
- package/dist-lib/stores/auth.js +32 -33
- package/dist-lib/stores/icon-registry.js +1 -2
- package/dist-lib/stores/list-layout.js +0 -1
- package/dist-lib/stores/page-state.js +1 -2
- package/dist-lib/stores/preferences.js +1 -2
- package/dist-lib/stores/realtime.js +1 -2
- package/dist-lib/stores/screen-registry.js +1 -2
- package/dist-lib/stores/tabs.js +1 -2
- package/dist-lib/test/seed-schema.js +4 -5
- package/dist-lib/testing.d.ts +2 -4
- package/dist-lib/testing.js +49 -50
- package/dist-lib/types/api.js +1 -2
- package/dist-lib/types/fieldType.js +1 -2
- package/dist-lib/types/ordmap.js +1 -2
- package/dist-lib/types/schema.js +1 -2
- package/dist-lib/{useResponsiveMode-C4MeAgoS.d.ts → useResponsiveMode-BElw02Gh.d.ts} +1 -19
- package/dist-lib/vite/index.d.ts +0 -2
- package/dist-lib/vite/index.js +1 -2
- package/package.json +11 -11
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import {
|
|
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";
|
|
1
|
+
import { UploadError as e, discardFile as t, uploadCheckFailure as n, uploadFailure as r, uploadFile as i, validateClientSide as ee } from "./upload.js";
|
|
4
2
|
import { UploadFailureText as a } from "./UploadFailureText.js";
|
|
5
|
-
import { getImageCropper as
|
|
6
|
-
import { fileFieldLabel as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
import { getImageCropper as te } from "./cropper.js";
|
|
4
|
+
import { fileFieldLabel as o, focalPointObjectPosition as s, preferredListThumbnail as c, previewFileURL as ne, readFocalPoint as re, resolveFileAltText as ie, withFocalPoint as ae } from "./helpers.js";
|
|
5
|
+
import { useDeploymentLanguage as oe, useLanguage as se } from "../../hooks/useLanguage.js";
|
|
6
|
+
import { useText as l } from "../../hooks/useText.js";
|
|
7
|
+
import { useDraftRegistration as ce } from "./draft-scope.js";
|
|
8
|
+
import { useEmbedFileSrc as le } from "./useEmbedFileSrc.js";
|
|
9
|
+
import { singleFileFromValue as ue } from "./value.js";
|
|
10
|
+
import { useCallback as u, useEffect as de, useMemo as fe, useRef as d, useState as f } from "react";
|
|
11
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
12
|
+
// src/components/file-widgets/ImageWidget.tsx
|
|
13
|
+
function h(e) {
|
|
14
14
|
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
15
15
|
return t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[1][0]).toUpperCase();
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
let { field:
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
function g(h) {
|
|
18
|
+
let { field: g, fieldName: v, value: ve, onChange: y, mode: ye, alt: b, recordTitle: be, disabled: x, visual: S, uploadFieldCode: C, uploadSlotCode: w } = h, T = ue(ve), [E, D] = f("idle"), [O, k] = f(null), [A, j] = f(null), [M, N] = f(null), [P, F] = f(!1), I = d(null), L = d(!1), R = d(null), { register: z, unregister: B, isDraft: V } = ce(), H = l(), U = l("errors");
|
|
19
|
+
de(() => () => {
|
|
20
|
+
I.current && I.current.abort();
|
|
21
21
|
}, []);
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
]),
|
|
31
|
-
let
|
|
32
|
-
if (
|
|
33
|
-
|
|
22
|
+
let W = se(), G = oe(), K = fe(() => ie(T, b, o(H, g, v), W, G), [
|
|
23
|
+
b,
|
|
24
|
+
H,
|
|
25
|
+
g,
|
|
26
|
+
v,
|
|
27
|
+
T,
|
|
28
|
+
W,
|
|
29
|
+
G
|
|
30
|
+
]), q = g.display?.initials ? be?.trim() : void 0, xe = (g.accepts ?? ["image/*"]).join(","), J = u(async (a) => {
|
|
31
|
+
let o = ee(a, g.accepts, g.max_size_bytes);
|
|
32
|
+
if (o) {
|
|
33
|
+
j(n(H, U, o)), D("error");
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
let
|
|
37
|
-
if (
|
|
38
|
-
let { blob:
|
|
39
|
-
file:
|
|
40
|
-
aspectRatio:
|
|
36
|
+
let s = a;
|
|
37
|
+
if (g.display?.crop_on_upload) try {
|
|
38
|
+
let { blob: e, filename: t } = await te()({
|
|
39
|
+
file: a,
|
|
40
|
+
aspectRatio: ge(g.display.aspect_ratio)
|
|
41
41
|
});
|
|
42
|
-
|
|
42
|
+
s = new File([e], t, { type: e.type || a.type });
|
|
43
43
|
} catch {
|
|
44
|
-
|
|
44
|
+
j({
|
|
45
45
|
code: "file.crop_failed",
|
|
46
|
-
message:
|
|
47
|
-
}),
|
|
46
|
+
message: U("file.crop_failed", "The image could not be cropped.")
|
|
47
|
+
}), D("error");
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
j(null), L.current = !1, D("uploading"), k({
|
|
51
51
|
loaded: 0,
|
|
52
|
-
total:
|
|
52
|
+
total: s.size,
|
|
53
53
|
pct: 0
|
|
54
54
|
});
|
|
55
|
-
let
|
|
56
|
-
|
|
55
|
+
let c = new AbortController();
|
|
56
|
+
I.current = c;
|
|
57
57
|
try {
|
|
58
|
-
let e = await
|
|
59
|
-
file:
|
|
60
|
-
entityCode:
|
|
61
|
-
fieldCode:
|
|
62
|
-
slotCode:
|
|
63
|
-
signal:
|
|
64
|
-
onProgress:
|
|
58
|
+
let e = await i({
|
|
59
|
+
file: s,
|
|
60
|
+
entityCode: h.entityCode,
|
|
61
|
+
fieldCode: C ?? v,
|
|
62
|
+
slotCode: w,
|
|
63
|
+
signal: c.signal,
|
|
64
|
+
onProgress: k
|
|
65
65
|
});
|
|
66
|
-
if (
|
|
67
|
-
|
|
66
|
+
if (L.current) {
|
|
67
|
+
t(e.id).catch(() => {}), B(e.id);
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
let
|
|
70
|
+
T && V(T.id) && (t(T.id).catch(() => {}), B(T.id)), z(e.id, () => t(e.id)), N(e.id), D("idle"), k(null);
|
|
71
|
+
let n = {
|
|
72
72
|
id: e.id,
|
|
73
73
|
filename: e.filename,
|
|
74
74
|
content_type: e.content_type,
|
|
@@ -79,237 +79,237 @@ function p(f) {
|
|
|
79
79
|
url: e.url,
|
|
80
80
|
metadata: e.metadata
|
|
81
81
|
};
|
|
82
|
-
|
|
83
|
-
} catch (
|
|
84
|
-
if (
|
|
85
|
-
|
|
82
|
+
y?.(g.mode === "array" ? [n] : n);
|
|
83
|
+
} catch (t) {
|
|
84
|
+
if (t instanceof e && t.code === "ABORTED") return;
|
|
85
|
+
j(r(H, U, t)), D("error"), k(null);
|
|
86
86
|
}
|
|
87
87
|
}, [
|
|
88
|
+
U,
|
|
88
89
|
H,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
p.mode,
|
|
95
|
-
_,
|
|
90
|
+
g.accepts,
|
|
91
|
+
g.max_size_bytes,
|
|
92
|
+
g.display?.crop_on_upload,
|
|
93
|
+
g.display?.aspect_ratio,
|
|
94
|
+
g.mode,
|
|
96
95
|
v,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
B,
|
|
100
|
-
w,
|
|
96
|
+
y,
|
|
97
|
+
h.entityCode,
|
|
101
98
|
z,
|
|
102
|
-
|
|
103
|
-
C
|
|
104
|
-
]), Ce = s(() => {
|
|
105
|
-
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));
|
|
106
|
-
}, [
|
|
99
|
+
V,
|
|
107
100
|
T,
|
|
108
|
-
j,
|
|
109
|
-
z
|
|
110
|
-
]), we = s(() => {
|
|
111
|
-
w && B(w.id) && (i(w.id).catch(() => {}), z(w.id), M(null)), v?.(p.mode === "array" ? [] : null);
|
|
112
|
-
}, [
|
|
113
|
-
w,
|
|
114
|
-
p.mode,
|
|
115
101
|
B,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
]),
|
|
119
|
-
|
|
120
|
-
}, [
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}, [
|
|
127
|
-
|
|
102
|
+
C,
|
|
103
|
+
w
|
|
104
|
+
]), Se = u(() => {
|
|
105
|
+
E === "uploading" && I.current && (L.current = !0, I.current.abort(), I.current = null, D("idle"), k(null)), M && (t(M).catch(() => {}), B(M), N(null));
|
|
106
|
+
}, [
|
|
107
|
+
E,
|
|
108
|
+
M,
|
|
109
|
+
B
|
|
110
|
+
]), Ce = u(() => {
|
|
111
|
+
T && V(T.id) && (t(T.id).catch(() => {}), B(T.id), N(null)), y?.(g.mode === "array" ? [] : null);
|
|
112
|
+
}, [
|
|
113
|
+
T,
|
|
114
|
+
g.mode,
|
|
115
|
+
V,
|
|
116
|
+
y,
|
|
117
|
+
B
|
|
118
|
+
]), we = u(() => {
|
|
119
|
+
j(null), D("idle"), R.current?.click();
|
|
120
|
+
}, []), Y = u(() => {
|
|
121
|
+
x || R.current?.click();
|
|
122
|
+
}, [x]), Te = u((e) => {
|
|
123
|
+
x || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Y());
|
|
124
|
+
}, [x, Y]), Ee = u((e) => {
|
|
125
|
+
x || (e.preventDefault(), e.dataTransfer.dropEffect = "copy");
|
|
126
|
+
}, [x]), De = u((e) => {
|
|
127
|
+
if (x) return;
|
|
128
128
|
e.preventDefault();
|
|
129
129
|
let t = e.dataTransfer.files?.[0];
|
|
130
|
-
t &&
|
|
131
|
-
}, [
|
|
130
|
+
t && J(t);
|
|
131
|
+
}, [x, J]), Oe = u((e) => {
|
|
132
132
|
let t = e.target.files?.[0];
|
|
133
|
-
e.target.value = "", t &&
|
|
134
|
-
}, [
|
|
135
|
-
aspectRatio:
|
|
136
|
-
width:
|
|
137
|
-
}, Z = !!
|
|
138
|
-
e.stopPropagation(),
|
|
139
|
-
}, []), Ne =
|
|
140
|
-
if (!
|
|
141
|
-
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 =
|
|
133
|
+
e.target.value = "", t && J(t);
|
|
134
|
+
}, [J]), ke = S.aspectRatio ?? he(S.shape, g.display?.aspect_ratio), X = re(T), Ae = {
|
|
135
|
+
aspectRatio: ke,
|
|
136
|
+
width: S.width ?? (S.shape === "wide" ? "100%" : "120px")
|
|
137
|
+
}, Z = !!T, Q = c(T, g.display?.listable_thumbnail), $ = le(Q?.id, "preview", Q && ne(Q)), je = ye === "display", Me = u((e) => {
|
|
138
|
+
e.stopPropagation(), F((e) => !e);
|
|
139
|
+
}, []), Ne = u((e) => {
|
|
140
|
+
if (!T || !P) return;
|
|
141
|
+
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 = ae(T, {
|
|
142
142
|
x: Math.max(0, Math.min(1, n)),
|
|
143
143
|
y: Math.max(0, Math.min(1, r))
|
|
144
144
|
});
|
|
145
|
-
|
|
145
|
+
y?.(g.mode === "array" ? [i] : i), F(!1);
|
|
146
146
|
}, [
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
147
|
+
g.mode,
|
|
148
|
+
T,
|
|
149
|
+
P,
|
|
150
|
+
y
|
|
151
151
|
]);
|
|
152
|
-
return je ? /* @__PURE__ */
|
|
153
|
-
className:
|
|
154
|
-
style:
|
|
155
|
-
"aria-label":
|
|
156
|
-
children: Z && $ ? /* @__PURE__ */
|
|
152
|
+
return je ? /* @__PURE__ */ p("div", {
|
|
153
|
+
className: pe(S.shape, !1),
|
|
154
|
+
style: Ae,
|
|
155
|
+
"aria-label": K,
|
|
156
|
+
children: Z && $ ? /* @__PURE__ */ p("img", {
|
|
157
157
|
src: $,
|
|
158
|
-
alt:
|
|
159
|
-
className:
|
|
160
|
-
style: { objectPosition:
|
|
158
|
+
alt: K,
|
|
159
|
+
className: me(S.shape),
|
|
160
|
+
style: { objectPosition: s(X) },
|
|
161
161
|
loading: "lazy"
|
|
162
|
-
}) : /* @__PURE__ */
|
|
163
|
-
shape:
|
|
164
|
-
initialsTitle:
|
|
162
|
+
}) : /* @__PURE__ */ p(_, {
|
|
163
|
+
shape: S.shape,
|
|
164
|
+
initialsTitle: q
|
|
165
165
|
})
|
|
166
|
-
}) : /* @__PURE__ */
|
|
167
|
-
className:
|
|
168
|
-
style:
|
|
169
|
-
tabIndex:
|
|
166
|
+
}) : /* @__PURE__ */ m("div", {
|
|
167
|
+
className: pe(S.shape, !x),
|
|
168
|
+
style: Ae,
|
|
169
|
+
tabIndex: x ? -1 : 0,
|
|
170
170
|
role: "button",
|
|
171
|
-
"aria-label":
|
|
172
|
-
"aria-disabled":
|
|
173
|
-
"aria-busy":
|
|
174
|
-
"aria-invalid":
|
|
175
|
-
onClick:
|
|
176
|
-
onMouseDown:
|
|
177
|
-
onKeyDown:
|
|
178
|
-
onDragOver:
|
|
179
|
-
onDrop:
|
|
180
|
-
"data-testid":
|
|
171
|
+
"aria-label": K,
|
|
172
|
+
"aria-disabled": x || void 0,
|
|
173
|
+
"aria-busy": E === "uploading" || void 0,
|
|
174
|
+
"aria-invalid": E === "error" || void 0,
|
|
175
|
+
onClick: E === "idle" && !Z ? Y : void 0,
|
|
176
|
+
onMouseDown: P ? Ne : void 0,
|
|
177
|
+
onKeyDown: Te,
|
|
178
|
+
onDragOver: Ee,
|
|
179
|
+
onDrop: De,
|
|
180
|
+
"data-testid": P ? "focal-point-target" : `file-widget-${v}`,
|
|
181
181
|
children: [
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
ref:
|
|
182
|
+
/* @__PURE__ */ p("input", {
|
|
183
|
+
ref: R,
|
|
184
184
|
type: "file",
|
|
185
|
-
accept:
|
|
186
|
-
onChange:
|
|
185
|
+
accept: xe,
|
|
186
|
+
onChange: Oe,
|
|
187
187
|
style: { display: "none" },
|
|
188
|
-
"data-testid": `file-input-${
|
|
188
|
+
"data-testid": `file-input-${v}`
|
|
189
189
|
}),
|
|
190
|
-
Z && $ ? /* @__PURE__ */
|
|
190
|
+
Z && $ ? /* @__PURE__ */ p("img", {
|
|
191
191
|
src: $,
|
|
192
|
-
alt:
|
|
193
|
-
className:
|
|
194
|
-
style: { objectPosition:
|
|
192
|
+
alt: K,
|
|
193
|
+
className: me(S.shape),
|
|
194
|
+
style: { objectPosition: s(X) },
|
|
195
195
|
loading: "lazy"
|
|
196
|
-
}) :
|
|
197
|
-
shape:
|
|
198
|
-
initialsTitle:
|
|
196
|
+
}) : E === "uploading" ? null : /* @__PURE__ */ p(_, {
|
|
197
|
+
shape: S.shape,
|
|
198
|
+
initialsTitle: q
|
|
199
199
|
}),
|
|
200
|
-
|
|
201
|
-
pct:
|
|
202
|
-
label:
|
|
200
|
+
E === "uploading" && /* @__PURE__ */ p(_e, {
|
|
201
|
+
pct: O?.pct ?? 0,
|
|
202
|
+
label: H("file.upload.progress", "Uploading {pct}%", { pct: Math.round(O?.pct ?? 0) })
|
|
203
203
|
}),
|
|
204
|
-
|
|
204
|
+
M && /* @__PURE__ */ p("span", {
|
|
205
205
|
className: "absolute right-1 top-1 h-2 w-2 rounded-full bg-warning",
|
|
206
206
|
"aria-hidden": "true",
|
|
207
207
|
"data-testid": "draft-indicator"
|
|
208
208
|
}),
|
|
209
|
-
Z &&
|
|
209
|
+
Z && E === "idle" && !x && /* @__PURE__ */ m("div", {
|
|
210
210
|
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",
|
|
211
211
|
children: [
|
|
212
|
-
|
|
212
|
+
g.display?.focal_point && /* @__PURE__ */ p("button", {
|
|
213
213
|
type: "button",
|
|
214
214
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
215
215
|
onClick: Me,
|
|
216
216
|
"data-testid": "focal-point-toggle",
|
|
217
|
-
children:
|
|
217
|
+
children: P ? H("file.image.focus_cancel", "Cancel focus") : H("file.image.focus_set", "Set focus")
|
|
218
218
|
}),
|
|
219
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ p("button", {
|
|
220
220
|
type: "button",
|
|
221
221
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-surface-2",
|
|
222
222
|
onClick: (e) => {
|
|
223
|
-
e.stopPropagation(),
|
|
223
|
+
e.stopPropagation(), Y();
|
|
224
224
|
},
|
|
225
|
-
children:
|
|
225
|
+
children: H("file.image.change", "Change")
|
|
226
226
|
}),
|
|
227
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ p("button", {
|
|
228
228
|
type: "button",
|
|
229
229
|
className: "rounded-sm border border-border bg-card px-2 py-1 text-xs text-destructive hover:bg-surface-2",
|
|
230
230
|
onClick: (e) => {
|
|
231
|
-
e.stopPropagation(),
|
|
231
|
+
e.stopPropagation(), Ce();
|
|
232
232
|
},
|
|
233
|
-
children:
|
|
233
|
+
children: H("file.remove", "Remove")
|
|
234
234
|
})
|
|
235
235
|
]
|
|
236
236
|
}),
|
|
237
|
-
|
|
237
|
+
X && Z && /* @__PURE__ */ p("span", {
|
|
238
238
|
className: "absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full border border-white bg-black/70",
|
|
239
239
|
style: {
|
|
240
|
-
left: `${
|
|
241
|
-
top: `${
|
|
240
|
+
left: `${X.x * 100}%`,
|
|
241
|
+
top: `${X.y * 100}%`
|
|
242
242
|
},
|
|
243
243
|
"data-testid": "focal-point-marker"
|
|
244
244
|
}),
|
|
245
|
-
|
|
245
|
+
E === "uploading" && /* @__PURE__ */ p("button", {
|
|
246
246
|
type: "button",
|
|
247
247
|
className: "absolute bottom-1 right-1 rounded-sm border border-border bg-card px-2 py-0.5 text-xs",
|
|
248
248
|
onClick: (e) => {
|
|
249
|
-
e.stopPropagation(),
|
|
249
|
+
e.stopPropagation(), Se();
|
|
250
250
|
},
|
|
251
251
|
"data-testid": "cancel-upload",
|
|
252
|
-
children:
|
|
252
|
+
children: H("file.upload.cancel", "Cancel")
|
|
253
253
|
}),
|
|
254
|
-
|
|
254
|
+
E === "error" && A && /* @__PURE__ */ m("div", {
|
|
255
255
|
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",
|
|
256
256
|
role: "alert",
|
|
257
|
-
children: [/* @__PURE__ */
|
|
257
|
+
children: [/* @__PURE__ */ p("span", {
|
|
258
258
|
className: "truncate",
|
|
259
|
-
title:
|
|
260
|
-
children: /* @__PURE__ */
|
|
261
|
-
}), /* @__PURE__ */
|
|
259
|
+
title: A.message,
|
|
260
|
+
children: /* @__PURE__ */ p(a, { failure: A })
|
|
261
|
+
}), /* @__PURE__ */ p("button", {
|
|
262
262
|
type: "button",
|
|
263
263
|
className: "underline",
|
|
264
264
|
onClick: (e) => {
|
|
265
|
-
e.stopPropagation(),
|
|
265
|
+
e.stopPropagation(), we();
|
|
266
266
|
},
|
|
267
267
|
"data-testid": "retry-upload",
|
|
268
|
-
children:
|
|
268
|
+
children: H("file.upload.retry", "Retry")
|
|
269
269
|
})]
|
|
270
270
|
})
|
|
271
271
|
]
|
|
272
272
|
});
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function pe(e, t) {
|
|
275
275
|
return [
|
|
276
276
|
"relative overflow-hidden border border-border bg-surface-2",
|
|
277
277
|
e === "circle" ? "rounded-full" : "rounded-md",
|
|
278
278
|
t ? "cursor-pointer focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent" : ""
|
|
279
279
|
].filter(Boolean).join(" ");
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function me(e) {
|
|
282
282
|
return "h-full w-full object-cover";
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function he(e, t) {
|
|
285
285
|
return t ? t.replace(":", " / ") : e === "wide" ? "16 / 9" : "1 / 1";
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function ge(e) {
|
|
288
288
|
if (!e) return;
|
|
289
289
|
let t = e.replace(/\s/g, "").match(/^(\d+(?:\.\d+)?)[:/](\d+(?:\.\d+)?)$/);
|
|
290
290
|
if (!t) return;
|
|
291
291
|
let n = Number(t[1]), r = Number(t[2]);
|
|
292
292
|
if (n && r) return n / r;
|
|
293
293
|
}
|
|
294
|
-
function
|
|
295
|
-
let
|
|
296
|
-
return t ? /* @__PURE__ */
|
|
294
|
+
function _({ shape: e, initialsTitle: t }) {
|
|
295
|
+
let n = l();
|
|
296
|
+
return t ? /* @__PURE__ */ p("div", {
|
|
297
297
|
className: "flex h-full w-full items-center justify-center bg-surface-3 text-text-3",
|
|
298
|
-
children: /* @__PURE__ */
|
|
298
|
+
children: /* @__PURE__ */ p("span", {
|
|
299
299
|
className: e === "circle" ? "text-lg font-medium" : "text-base font-medium",
|
|
300
|
-
children:
|
|
300
|
+
children: h(t)
|
|
301
301
|
})
|
|
302
|
-
}) : /* @__PURE__ */
|
|
302
|
+
}) : /* @__PURE__ */ p("div", {
|
|
303
303
|
className: "flex h-full w-full items-center justify-center bg-surface-3 text-text-4",
|
|
304
|
-
children: /* @__PURE__ */
|
|
304
|
+
children: /* @__PURE__ */ p("span", {
|
|
305
305
|
className: "text-xs",
|
|
306
|
-
children: e === "wide" ?
|
|
306
|
+
children: e === "wide" ? n("file.image.drop", "Drop image here") : "+"
|
|
307
307
|
})
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function _e({ pct: e, label: t }) {
|
|
311
311
|
let n = 2 * Math.PI * 18, r = n - Math.max(0, Math.min(100, e)) / 100 * n;
|
|
312
|
-
return /* @__PURE__ */
|
|
312
|
+
return /* @__PURE__ */ m("div", {
|
|
313
313
|
className: "absolute inset-0 flex items-center justify-center bg-black/30",
|
|
314
314
|
"data-testid": "upload-progress",
|
|
315
315
|
"aria-label": t,
|
|
@@ -317,11 +317,11 @@ function ve({ pct: e, label: t }) {
|
|
|
317
317
|
"aria-valuenow": Math.round(e),
|
|
318
318
|
"aria-valuemin": 0,
|
|
319
319
|
"aria-valuemax": 100,
|
|
320
|
-
children: [/* @__PURE__ */
|
|
320
|
+
children: [/* @__PURE__ */ m("svg", {
|
|
321
321
|
width: "48",
|
|
322
322
|
height: "48",
|
|
323
323
|
viewBox: "0 0 48 48",
|
|
324
|
-
children: [/* @__PURE__ */
|
|
324
|
+
children: [/* @__PURE__ */ p("circle", {
|
|
325
325
|
cx: "24",
|
|
326
326
|
cy: "24",
|
|
327
327
|
r: 18,
|
|
@@ -330,7 +330,7 @@ function ve({ pct: e, label: t }) {
|
|
|
330
330
|
strokeWidth: "4",
|
|
331
331
|
fill: "none",
|
|
332
332
|
className: "text-foreground"
|
|
333
|
-
}), /* @__PURE__ */
|
|
333
|
+
}), /* @__PURE__ */ p("circle", {
|
|
334
334
|
cx: "24",
|
|
335
335
|
cy: "24",
|
|
336
336
|
r: 18,
|
|
@@ -343,11 +343,10 @@ function ve({ pct: e, label: t }) {
|
|
|
343
343
|
className: "text-accent",
|
|
344
344
|
transform: "rotate(-90 24 24)"
|
|
345
345
|
})]
|
|
346
|
-
}), /* @__PURE__ */
|
|
346
|
+
}), /* @__PURE__ */ m("span", {
|
|
347
347
|
className: "absolute text-xs text-foreground",
|
|
348
348
|
children: [Math.round(e), "%"]
|
|
349
349
|
})]
|
|
350
350
|
});
|
|
351
351
|
}
|
|
352
|
-
|
|
353
|
-
export { p as ImageWidget };
|
|
352
|
+
export { g as ImageWidget };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { getFileWidget as e } from "./registry.js";
|
|
2
|
+
import { UnknownFileWidget as t } from "./UnknownFileWidget.js";
|
|
3
|
+
import { useText as n } from "../../hooks/useText.js";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/components/file-widgets/LabeledSlots.tsx
|
|
6
6
|
function a(e) {
|
|
7
7
|
return !e || Array.isArray(e) || typeof e != "object" ? {} : e;
|
|
8
8
|
}
|
|
@@ -26,14 +26,14 @@ function s(e, t, n, r) {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
function c(o) {
|
|
29
|
-
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 =
|
|
29
|
+
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 = n();
|
|
30
30
|
return g.length === 0 ? /* @__PURE__ */ r("span", {
|
|
31
31
|
className: "text-sm text-muted-foreground",
|
|
32
32
|
children: v("file.slots.empty", "No slots configured")
|
|
33
33
|
}) : /* @__PURE__ */ r("div", {
|
|
34
34
|
className: "grid gap-3",
|
|
35
|
-
children: g.map(([
|
|
36
|
-
let o = _[
|
|
35
|
+
children: g.map(([n, a]) => {
|
|
36
|
+
let o = _[n] ?? null, d = s(c, n, a, o), g = d.display?.widget ?? "document_card", y = e(g);
|
|
37
37
|
return y ? /* @__PURE__ */ i("div", {
|
|
38
38
|
className: "grid gap-1.5",
|
|
39
39
|
children: [/* @__PURE__ */ r("div", {
|
|
@@ -41,30 +41,29 @@ function c(o) {
|
|
|
41
41
|
children: v(a.name)
|
|
42
42
|
}), /* @__PURE__ */ r(y, {
|
|
43
43
|
field: d,
|
|
44
|
-
fieldName:
|
|
44
|
+
fieldName: n,
|
|
45
45
|
entityCode: u,
|
|
46
46
|
value: o,
|
|
47
47
|
recordTitle: f,
|
|
48
48
|
mode: m,
|
|
49
49
|
disabled: h,
|
|
50
50
|
uploadFieldCode: l,
|
|
51
|
-
uploadSlotCode:
|
|
52
|
-
onChange: (
|
|
51
|
+
uploadSlotCode: n,
|
|
52
|
+
onChange: (e) => {
|
|
53
53
|
p && p({
|
|
54
54
|
..._,
|
|
55
|
-
[
|
|
55
|
+
[n]: e ?? null
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
})]
|
|
59
|
-
},
|
|
59
|
+
}, n) : /* @__PURE__ */ i("div", {
|
|
60
60
|
className: "grid gap-1.5",
|
|
61
61
|
children: [/* @__PURE__ */ r("div", {
|
|
62
62
|
className: "text-xs font-semibold text-text-2",
|
|
63
63
|
children: v(a.name)
|
|
64
|
-
}), /* @__PURE__ */ r(
|
|
65
|
-
},
|
|
64
|
+
}), /* @__PURE__ */ r(t, { widgetCode: g })]
|
|
65
|
+
}, n);
|
|
66
66
|
})
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
//#endregion
|
|
70
69
|
export { c as LabeledSlots };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { ImageWidget as e } from "./ImageWidget.js";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/components/file-widgets/SquareImage.tsx
|
|
4
4
|
function n(n) {
|
|
5
5
|
return /* @__PURE__ */ t(e, {
|
|
6
6
|
...n,
|
|
7
7
|
visual: { shape: "square" }
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
10
|
export { n as SquareImage };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useText as e } from "../../hooks/useText.js";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/components/file-widgets/UnknownFileWidget.tsx
|
|
4
4
|
function r({ widgetCode: r }) {
|
|
5
5
|
let i = e(), a = e("errors");
|
|
6
6
|
return r ? /* @__PURE__ */ n("span", {
|
|
@@ -18,5 +18,4 @@ function r({ widgetCode: r }) {
|
|
|
18
18
|
children: a("file.missing_widget", "This file field does not name a widget to show it.")
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
//#endregion
|
|
22
21
|
export { r as UnknownFileWidget };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
|
|
2
|
+
// src/components/file-widgets/UploadFailureText.tsx
|
|
3
3
|
function r({ failure: r }) {
|
|
4
4
|
return /* @__PURE__ */ n(e, { children: [r.message, r.detail && /* @__PURE__ */ n(e, { children: [" ", /* @__PURE__ */ t("span", {
|
|
5
5
|
className: "opacity-80",
|
|
6
6
|
children: r.detail
|
|
7
7
|
})] })] });
|
|
8
8
|
}
|
|
9
|
-
//#endregion
|
|
10
9
|
export { r as UploadFailureText };
|