@declarion/react 0.141.0 → 0.146.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,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { UploadError as e, discardFile as t, formatBytes as n, uploadCheckFailure as r, uploadFailure as i, uploadFile as a, validateClientSide as o } from "./upload.js";
|
|
2
|
+
import { UploadFailureText as s } from "./UploadFailureText.js";
|
|
3
|
+
import { useText as c } from "../../hooks/useText.js";
|
|
4
|
+
import { useDraftRegistration as l } from "./draft-scope.js";
|
|
5
|
+
import { downloadFileURL as u } from "./helpers.js";
|
|
6
6
|
import { useEmbedFileOpener as d } from "./useEmbedFileSrc.js";
|
|
7
7
|
import { fileArrayFromValue as f } from "./value.js";
|
|
8
8
|
import { useCallback as p, useEffect as m, useRef as h, useState as g } from "react";
|
|
9
9
|
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
10
|
-
|
|
10
|
+
// src/components/file-widgets/FileList.tsx
|
|
11
11
|
function b(e) {
|
|
12
12
|
return e ? (e.split("/")[1] ?? e).toUpperCase().slice(0, 6) : "";
|
|
13
13
|
}
|
|
14
14
|
function x(x) {
|
|
15
|
-
let { field: S, fieldName: C, value: w, onChange: T, mode: E, disabled: D } = x, O = f(w), [k, A] = g([]), { register: j, unregister: M, isDraft: N } =
|
|
15
|
+
let { field: S, fieldName: C, value: w, onChange: T, mode: E, disabled: D } = x, O = f(w), [k, A] = g([]), { register: j, unregister: M, isDraft: N } = l(), P = c(), F = c("errors"), I = h(O);
|
|
16
16
|
I.current = O;
|
|
17
17
|
let L = h(null), R = h(/* @__PURE__ */ new Set()), z = h([]);
|
|
18
18
|
z.current = k;
|
|
@@ -20,30 +20,30 @@ function x(x) {
|
|
|
20
20
|
m(() => () => {
|
|
21
21
|
z.current.forEach((e) => e.abort());
|
|
22
22
|
}, []);
|
|
23
|
-
let V = (S.accepts ?? []).join(","), H = E === "display", U = p(async (
|
|
24
|
-
let
|
|
25
|
-
if (
|
|
23
|
+
let V = (S.accepts ?? []).join(","), H = E === "display", U = p(async (n) => {
|
|
24
|
+
let s = o(n, S.accepts, S.max_size_bytes), c = `row-${Math.random().toString(36).slice(2)}-${Date.now()}`, l = new AbortController();
|
|
25
|
+
if (s) A((e) => [...e, {
|
|
26
26
|
localId: c,
|
|
27
|
-
filename:
|
|
27
|
+
filename: n.name,
|
|
28
28
|
progress: null,
|
|
29
|
-
error:
|
|
29
|
+
error: r(P, F, s),
|
|
30
30
|
abort: () => {}
|
|
31
31
|
}]);
|
|
32
32
|
else {
|
|
33
|
-
A((
|
|
33
|
+
A((e) => [...e, {
|
|
34
34
|
localId: c,
|
|
35
|
-
filename:
|
|
35
|
+
filename: n.name,
|
|
36
36
|
progress: {
|
|
37
37
|
loaded: 0,
|
|
38
|
-
total:
|
|
38
|
+
total: n.size,
|
|
39
39
|
pct: 0
|
|
40
40
|
},
|
|
41
41
|
error: null,
|
|
42
42
|
abort: () => l.abort()
|
|
43
43
|
}]);
|
|
44
44
|
try {
|
|
45
|
-
let
|
|
46
|
-
file:
|
|
45
|
+
let e = await a({
|
|
46
|
+
file: n,
|
|
47
47
|
entityCode: x.entityCode,
|
|
48
48
|
fieldCode: C,
|
|
49
49
|
signal: l.signal,
|
|
@@ -53,28 +53,28 @@ function x(x) {
|
|
|
53
53
|
} : t))
|
|
54
54
|
});
|
|
55
55
|
if (R.current.delete(c)) {
|
|
56
|
-
|
|
56
|
+
t(e.id).catch(() => {}), M(e.id);
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
j(
|
|
59
|
+
j(e.id, () => t(e.id));
|
|
60
60
|
let r = {
|
|
61
|
-
id:
|
|
62
|
-
filename:
|
|
63
|
-
content_type:
|
|
64
|
-
size_bytes:
|
|
65
|
-
sha256:
|
|
66
|
-
width:
|
|
67
|
-
height:
|
|
68
|
-
url:
|
|
69
|
-
metadata:
|
|
61
|
+
id: e.id,
|
|
62
|
+
filename: e.filename,
|
|
63
|
+
content_type: e.content_type,
|
|
64
|
+
size_bytes: e.size_bytes,
|
|
65
|
+
sha256: e.sha256,
|
|
66
|
+
width: e.width,
|
|
67
|
+
height: e.height,
|
|
68
|
+
url: e.url,
|
|
69
|
+
metadata: e.metadata
|
|
70
70
|
}, i = [...I.current, r];
|
|
71
71
|
I.current = i, T?.(i), A((e) => e.filter((e) => e.localId !== c));
|
|
72
|
-
} catch (
|
|
73
|
-
if (
|
|
72
|
+
} catch (t) {
|
|
73
|
+
if (t instanceof e && t.code === "ABORTED") {
|
|
74
74
|
A((e) => e.filter((e) => e.localId !== c));
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
let n =
|
|
77
|
+
let n = i(P, F, t);
|
|
78
78
|
A((e) => e.map((e) => e.localId === c ? {
|
|
79
79
|
...e,
|
|
80
80
|
error: n,
|
|
@@ -101,14 +101,14 @@ function x(x) {
|
|
|
101
101
|
let t = e.target.files;
|
|
102
102
|
e.target.value = "", t && t.length > 0 && W(t);
|
|
103
103
|
}, [W]), q = p((e) => {
|
|
104
|
-
N(e) && (
|
|
104
|
+
N(e) && (t(e).catch(() => {}), M(e)), T?.(O.filter((t) => t.id !== e));
|
|
105
105
|
}, [
|
|
106
106
|
N,
|
|
107
107
|
O,
|
|
108
108
|
T,
|
|
109
109
|
M
|
|
110
110
|
]), J = p((e) => {
|
|
111
|
-
B(e.id, "download",
|
|
111
|
+
B(e.id, "download", u(e));
|
|
112
112
|
}, [B]);
|
|
113
113
|
return /* @__PURE__ */ y("div", {
|
|
114
114
|
"data-testid": `file-widget-${C}`,
|
|
@@ -137,7 +137,7 @@ function x(x) {
|
|
|
137
137
|
}),
|
|
138
138
|
/* @__PURE__ */ v("span", {
|
|
139
139
|
className: "flex-none text-xs text-muted-foreground",
|
|
140
|
-
children:
|
|
140
|
+
children: n(e.size_bytes, P.language)
|
|
141
141
|
}),
|
|
142
142
|
/* @__PURE__ */ v("button", {
|
|
143
143
|
type: "button",
|
|
@@ -171,7 +171,7 @@ function x(x) {
|
|
|
171
171
|
e.error ? /* @__PURE__ */ v("span", {
|
|
172
172
|
role: "alert",
|
|
173
173
|
className: "text-xs text-destructive",
|
|
174
|
-
children: /* @__PURE__ */ v(
|
|
174
|
+
children: /* @__PURE__ */ v(s, { failure: e.error })
|
|
175
175
|
}) : /* @__PURE__ */ y("span", {
|
|
176
176
|
className: "text-xs text-muted-foreground",
|
|
177
177
|
role: "progressbar",
|
|
@@ -209,5 +209,4 @@ function x(x) {
|
|
|
209
209
|
})] })]
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
|
-
//#endregion
|
|
213
212
|
export { x as FileList };
|
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { UploadError as e, discardFile as t, formatBytes as n, uploadCheckFailure as r, uploadFailure as i, uploadFile as a, validateClientSide as o } from "./upload.js";
|
|
2
|
+
import { UploadFailureText as s } from "./UploadFailureText.js";
|
|
3
|
+
import { useText as c } from "../../hooks/useText.js";
|
|
4
|
+
import { pluralText as l } from "../../lib/language.js";
|
|
5
|
+
import { useDraftRegistration as u } from "./draft-scope.js";
|
|
6
|
+
import { fileFieldLabel as d, preferredListThumbnail as f, previewFileURL as p } from "./helpers.js";
|
|
7
7
|
import { useEmbedFileSrc as m } from "./useEmbedFileSrc.js";
|
|
8
8
|
import { fileArrayFromValue as h } from "./value.js";
|
|
9
9
|
import { useCallback as g, useEffect as _, useMemo as v, useRef as y, useState as b } from "react";
|
|
10
10
|
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
11
|
-
import { DndContext as w, PointerSensor as
|
|
12
|
-
import { SortableContext as
|
|
13
|
-
import { CSS as
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
let { field:
|
|
17
|
-
U.current =
|
|
18
|
-
let W = y(
|
|
19
|
-
W.current =
|
|
11
|
+
import { DndContext as w, PointerSensor as T, closestCenter as ee, useSensor as te, useSensors as ne } from "@dnd-kit/core";
|
|
12
|
+
import { SortableContext as re, arrayMove as ie, rectSortingStrategy as E, useSortable as D } from "@dnd-kit/sortable";
|
|
13
|
+
import { CSS as O } from "@dnd-kit/utilities";
|
|
14
|
+
// src/components/file-widgets/Grid.tsx
|
|
15
|
+
function k(n) {
|
|
16
|
+
let { field: s, fieldName: f, value: p, onChange: m, mode: x, disabled: D } = n, O = h(p), [k, M] = b([]), [N, P] = b(/* @__PURE__ */ new Set()), [F, I] = b(null), { register: L, unregister: R, isDraft: z } = u(), B = c(), V = c("errors"), H = y(/* @__PURE__ */ new Set()), U = y([]);
|
|
17
|
+
U.current = k;
|
|
18
|
+
let W = y(O);
|
|
19
|
+
W.current = O, _(() => () => {
|
|
20
20
|
U.current.forEach((e) => e.abort());
|
|
21
21
|
}, []);
|
|
22
|
-
let oe =
|
|
23
|
-
let
|
|
24
|
-
if (
|
|
22
|
+
let oe = ne(te(T, { activationConstraint: { distance: 5 } })), se = (s.accepts ?? ["image/*"]).join(","), ce = s.display?.reorderable !== !1, le = s.display?.listable_thumbnail, G = g(async (c) => {
|
|
23
|
+
let l = o(c, s.accepts, s.max_size_bytes), u = `tile-${Math.random().toString(36).slice(2)}-${Date.now()}`, d = new AbortController();
|
|
24
|
+
if (l) M((e) => [...e, {
|
|
25
25
|
localId: u,
|
|
26
|
-
filename:
|
|
26
|
+
filename: c.name,
|
|
27
27
|
progress: null,
|
|
28
|
-
error:
|
|
28
|
+
error: r(B, V, l),
|
|
29
29
|
abort: () => {}
|
|
30
30
|
}]);
|
|
31
31
|
else {
|
|
32
|
-
M((
|
|
32
|
+
M((e) => [...e, {
|
|
33
33
|
localId: u,
|
|
34
|
-
filename:
|
|
34
|
+
filename: c.name,
|
|
35
35
|
progress: {
|
|
36
36
|
loaded: 0,
|
|
37
|
-
total:
|
|
37
|
+
total: c.size,
|
|
38
38
|
pct: 0
|
|
39
39
|
},
|
|
40
40
|
error: null,
|
|
41
|
-
abort: () =>
|
|
41
|
+
abort: () => d.abort()
|
|
42
42
|
}]);
|
|
43
43
|
try {
|
|
44
|
-
let
|
|
45
|
-
file:
|
|
46
|
-
entityCode:
|
|
47
|
-
fieldCode:
|
|
48
|
-
signal:
|
|
44
|
+
let e = await a({
|
|
45
|
+
file: c,
|
|
46
|
+
entityCode: n.entityCode,
|
|
47
|
+
fieldCode: f,
|
|
48
|
+
signal: d.signal,
|
|
49
49
|
onProgress: (e) => M((t) => t.map((t) => t.localId === u ? {
|
|
50
50
|
...t,
|
|
51
51
|
progress: e
|
|
52
52
|
} : t))
|
|
53
53
|
});
|
|
54
54
|
if (H.current.delete(u)) {
|
|
55
|
-
|
|
55
|
+
t(e.id).catch(() => {}), R(e.id);
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
|
-
L(
|
|
59
|
-
let
|
|
60
|
-
id:
|
|
61
|
-
filename:
|
|
62
|
-
content_type:
|
|
63
|
-
size_bytes:
|
|
64
|
-
sha256:
|
|
65
|
-
width:
|
|
66
|
-
height:
|
|
67
|
-
url:
|
|
68
|
-
metadata:
|
|
69
|
-
},
|
|
70
|
-
W.current =
|
|
71
|
-
} catch (
|
|
72
|
-
if (
|
|
58
|
+
L(e.id, () => t(e.id));
|
|
59
|
+
let r = {
|
|
60
|
+
id: e.id,
|
|
61
|
+
filename: e.filename,
|
|
62
|
+
content_type: e.content_type,
|
|
63
|
+
size_bytes: e.size_bytes,
|
|
64
|
+
sha256: e.sha256,
|
|
65
|
+
width: e.width,
|
|
66
|
+
height: e.height,
|
|
67
|
+
url: e.url,
|
|
68
|
+
metadata: e.metadata
|
|
69
|
+
}, i = [...W.current, r];
|
|
70
|
+
W.current = i, m?.(i), M((e) => e.filter((e) => e.localId !== u));
|
|
71
|
+
} catch (t) {
|
|
72
|
+
if (t instanceof e && t.code === "ABORTED") {
|
|
73
73
|
M((e) => e.filter((e) => e.localId !== u));
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
-
let
|
|
76
|
+
let n = i(B, V, t);
|
|
77
77
|
M((e) => e.map((e) => e.localId === u ? {
|
|
78
78
|
...e,
|
|
79
|
-
error:
|
|
79
|
+
error: n,
|
|
80
80
|
progress: null,
|
|
81
81
|
abort: () => {}
|
|
82
82
|
} : e));
|
|
@@ -85,62 +85,62 @@ function A(i) {
|
|
|
85
85
|
}, [
|
|
86
86
|
V,
|
|
87
87
|
B,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
s.accepts,
|
|
89
|
+
s.max_size_bytes,
|
|
90
|
+
f,
|
|
91
91
|
m,
|
|
92
|
-
|
|
92
|
+
n.entityCode,
|
|
93
93
|
L,
|
|
94
94
|
R
|
|
95
95
|
]), K = g((e) => {
|
|
96
96
|
Array.from(e).forEach((e) => void G(e));
|
|
97
97
|
}, [G]), q = y(null), J = g(() => {
|
|
98
|
-
|
|
99
|
-
}, [
|
|
100
|
-
|
|
101
|
-
}, [
|
|
102
|
-
if (
|
|
98
|
+
D || q.current?.click();
|
|
99
|
+
}, [D]), ue = g((e) => {
|
|
100
|
+
D || (e.preventDefault(), e.dataTransfer.dropEffect = "copy");
|
|
101
|
+
}, [D]), de = g((e) => {
|
|
102
|
+
if (D) return;
|
|
103
103
|
e.preventDefault();
|
|
104
104
|
let t = e.dataTransfer.files;
|
|
105
105
|
t && t.length > 0 && K(t);
|
|
106
|
-
}, [
|
|
106
|
+
}, [D, K]), fe = g((e) => {
|
|
107
107
|
let t = e.target.files;
|
|
108
108
|
e.target.value = "", t && t.length > 0 && K(t);
|
|
109
109
|
}, [K]), pe = g((e) => {
|
|
110
|
-
z(e) && (
|
|
111
|
-
let
|
|
112
|
-
m?.(
|
|
110
|
+
z(e) && (t(e).catch(() => {}), R(e));
|
|
111
|
+
let n = O.filter((t) => t.id !== e);
|
|
112
|
+
m?.(n), P((t) => {
|
|
113
113
|
let n = new Set(t);
|
|
114
114
|
return n.delete(e), n;
|
|
115
115
|
});
|
|
116
116
|
}, [
|
|
117
117
|
z,
|
|
118
|
-
|
|
118
|
+
O,
|
|
119
119
|
m,
|
|
120
120
|
R
|
|
121
121
|
]), me = g(() => {
|
|
122
122
|
N.size !== 0 && (Array.from(N).forEach((e) => {
|
|
123
|
-
z(e) && (
|
|
124
|
-
}), m?.(
|
|
123
|
+
z(e) && (t(e).catch(() => {}), R(e));
|
|
124
|
+
}), m?.(O.filter((e) => !N.has(e.id))), P(/* @__PURE__ */ new Set()));
|
|
125
125
|
}, [
|
|
126
126
|
z,
|
|
127
|
-
|
|
127
|
+
O,
|
|
128
128
|
N,
|
|
129
129
|
m,
|
|
130
130
|
R
|
|
131
131
|
]), he = g((e) => {
|
|
132
132
|
let { active: t, over: n } = e;
|
|
133
133
|
if (!n || t.id === n.id) return;
|
|
134
|
-
let r =
|
|
135
|
-
r < 0 || i < 0 || m?.(
|
|
136
|
-
}, [
|
|
134
|
+
let r = O.findIndex((e) => e.id === t.id), i = O.findIndex((e) => e.id === n.id);
|
|
135
|
+
r < 0 || i < 0 || m?.(ie(O, r, i));
|
|
136
|
+
}, [O, m]), ge = g((e) => {
|
|
137
137
|
P((t) => {
|
|
138
138
|
let n = new Set(t);
|
|
139
139
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
140
140
|
});
|
|
141
|
-
}, []), Y = F == null ? null :
|
|
142
|
-
I((e) => e == null ? e : Math.min(
|
|
143
|
-
}, [
|
|
141
|
+
}, []), Y = F == null ? null : O[F], X = g(() => {
|
|
142
|
+
I((e) => e == null ? e : Math.min(O.length - 1, e + 1));
|
|
143
|
+
}, [O.length]), Z = g(() => {
|
|
144
144
|
I((e) => e == null ? e : Math.max(0, e - 1));
|
|
145
145
|
}, []), Q = g(() => I(null), []);
|
|
146
146
|
_(() => {
|
|
@@ -156,10 +156,10 @@ function A(i) {
|
|
|
156
156
|
Z
|
|
157
157
|
]);
|
|
158
158
|
let _e = g((e) => {
|
|
159
|
-
|
|
160
|
-
}, [
|
|
159
|
+
D || (e.key === "Enter" || e.key === " ") && e.target === e.currentTarget && (e.preventDefault(), J());
|
|
160
|
+
}, [D, J]), $ = x === "display", ve = v(() => O.map((e) => e.id), [O]);
|
|
161
161
|
return /* @__PURE__ */ C("div", {
|
|
162
|
-
"data-testid": `file-widget-${
|
|
162
|
+
"data-testid": `file-widget-${f}`,
|
|
163
163
|
className: "flex flex-col gap-2",
|
|
164
164
|
children: [
|
|
165
165
|
!$ && N.size > 0 && /* @__PURE__ */ C("div", {
|
|
@@ -169,7 +169,7 @@ function A(i) {
|
|
|
169
169
|
children: [
|
|
170
170
|
/* @__PURE__ */ S("span", {
|
|
171
171
|
className: "text-foreground",
|
|
172
|
-
children:
|
|
172
|
+
children: l(B, "file.grid.selected", N.size, {
|
|
173
173
|
one: "{count} selected",
|
|
174
174
|
other: "{count} selected"
|
|
175
175
|
})
|
|
@@ -191,47 +191,47 @@ function A(i) {
|
|
|
191
191
|
}),
|
|
192
192
|
/* @__PURE__ */ S(w, {
|
|
193
193
|
sensors: oe,
|
|
194
|
-
collisionDetection:
|
|
194
|
+
collisionDetection: ee,
|
|
195
195
|
onDragEnd: he,
|
|
196
|
-
children: /* @__PURE__ */ S(
|
|
196
|
+
children: /* @__PURE__ */ S(re, {
|
|
197
197
|
items: ve,
|
|
198
|
-
strategy:
|
|
198
|
+
strategy: E,
|
|
199
199
|
children: /* @__PURE__ */ C("div", {
|
|
200
200
|
className: $ ? "grid grid-cols-[repeat(auto-fill,minmax(140px,1fr))] gap-3" : "grid grid-cols-[repeat(auto-fill,minmax(140px,1fr))] gap-3 rounded-md border border-dashed border-border bg-surface p-3 outline-none focus-visible:outline-2 focus-visible:outline-accent",
|
|
201
201
|
role: "grid",
|
|
202
|
-
"aria-label":
|
|
203
|
-
tabIndex: $ ||
|
|
202
|
+
"aria-label": d(B, s, f),
|
|
203
|
+
tabIndex: $ || D ? -1 : 0,
|
|
204
204
|
onDragOver: ue,
|
|
205
205
|
onDrop: de,
|
|
206
206
|
onKeyDown: _e,
|
|
207
207
|
"data-testid": "grid-container",
|
|
208
208
|
children: [
|
|
209
|
-
|
|
209
|
+
O.map((e, t) => /* @__PURE__ */ S(A, {
|
|
210
210
|
file: e,
|
|
211
211
|
selected: N.has(e.id),
|
|
212
|
-
disabled:
|
|
212
|
+
disabled: D || $,
|
|
213
213
|
reorderable: ce && !$,
|
|
214
214
|
preferredThumbnail: le,
|
|
215
215
|
onSelect: () => ge(e.id),
|
|
216
216
|
onRemove: () => pe(e.id),
|
|
217
217
|
onPreview: () => I(t)
|
|
218
218
|
}, e.id)),
|
|
219
|
-
|
|
219
|
+
k.map((e) => /* @__PURE__ */ S(j, {
|
|
220
220
|
tile: e,
|
|
221
221
|
onCancel: () => {
|
|
222
222
|
e.abort(), H.current.add(e.localId), M((t) => t.filter((t) => t.localId !== e.localId));
|
|
223
223
|
},
|
|
224
224
|
onDismiss: () => M((t) => t.filter((t) => t.localId !== e.localId))
|
|
225
225
|
}, e.localId)),
|
|
226
|
-
|
|
226
|
+
O.length === 0 && k.length === 0 && ($ ? /* @__PURE__ */ S("div", {
|
|
227
227
|
className: "col-span-full text-sm text-muted-foreground",
|
|
228
228
|
"data-testid": "grid-empty",
|
|
229
|
-
children: B(
|
|
229
|
+
children: B(s.display?.placeholder) || B("file.list.empty", "No files")
|
|
230
230
|
}) : /* @__PURE__ */ S("div", {
|
|
231
231
|
className: "col-span-full flex h-24 cursor-pointer items-center justify-center text-sm text-muted-foreground",
|
|
232
232
|
onClick: J,
|
|
233
233
|
"data-testid": "grid-empty",
|
|
234
|
-
children: B(
|
|
234
|
+
children: B(s.display?.placeholder) || B("file.grid.empty", "Drop files here or click to browse")
|
|
235
235
|
}))
|
|
236
236
|
]
|
|
237
237
|
})
|
|
@@ -244,12 +244,12 @@ function A(i) {
|
|
|
244
244
|
multiple: !0,
|
|
245
245
|
onChange: fe,
|
|
246
246
|
style: { display: "none" },
|
|
247
|
-
"data-testid": `file-input-${
|
|
247
|
+
"data-testid": `file-input-${f}`
|
|
248
248
|
}),
|
|
249
249
|
Y && /* @__PURE__ */ S(ae, {
|
|
250
250
|
file: Y,
|
|
251
251
|
hasPrev: F > 0,
|
|
252
|
-
hasNext: F <
|
|
252
|
+
hasNext: F < O.length - 1,
|
|
253
253
|
onPrev: Z,
|
|
254
254
|
onNext: X,
|
|
255
255
|
onClose: Q
|
|
@@ -257,42 +257,42 @@ function A(i) {
|
|
|
257
257
|
]
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
|
-
function
|
|
261
|
-
let { attributes: l, listeners: u, setNodeRef:
|
|
260
|
+
function A({ file: e, selected: t, disabled: n, reorderable: r, preferredThumbnail: i, onSelect: a, onRemove: o, onPreview: s }) {
|
|
261
|
+
let { attributes: l, listeners: u, setNodeRef: d, transform: h, transition: g, isDragging: _ } = D({
|
|
262
262
|
id: e.id,
|
|
263
|
-
disabled: !
|
|
264
|
-
}), v =
|
|
265
|
-
transform:
|
|
263
|
+
disabled: !r
|
|
264
|
+
}), v = c(), y = {
|
|
265
|
+
transform: O.Transform.toString(h),
|
|
266
266
|
transition: g,
|
|
267
267
|
opacity: _ ? .5 : 1
|
|
268
|
-
}, b =
|
|
268
|
+
}, b = f(e, i), w = m(b?.id, "preview", b && p(b));
|
|
269
269
|
return /* @__PURE__ */ C("div", {
|
|
270
|
-
ref:
|
|
270
|
+
ref: d,
|
|
271
271
|
style: y,
|
|
272
|
-
className: `group relative aspect-square overflow-hidden rounded-md border ${
|
|
272
|
+
className: `group relative aspect-square overflow-hidden rounded-md border ${t ? "border-accent" : "border-border"} bg-surface-2`,
|
|
273
273
|
"data-testid": `grid-tile-${e.id}`,
|
|
274
|
-
"data-selected":
|
|
274
|
+
"data-selected": t || void 0,
|
|
275
275
|
children: [w ? /* @__PURE__ */ S("img", {
|
|
276
276
|
src: w,
|
|
277
277
|
alt: e.filename,
|
|
278
278
|
className: "h-full w-full cursor-pointer object-cover",
|
|
279
279
|
loading: "lazy",
|
|
280
|
-
onClick:
|
|
280
|
+
onClick: s
|
|
281
281
|
}) : /* @__PURE__ */ S("div", {
|
|
282
282
|
className: "flex h-full w-full cursor-pointer items-center justify-center bg-surface-3 text-xs text-muted-foreground",
|
|
283
|
-
onClick:
|
|
283
|
+
onClick: s,
|
|
284
284
|
children: e.filename
|
|
285
|
-
}), !
|
|
285
|
+
}), !n && /* @__PURE__ */ C(x, { children: [
|
|
286
286
|
/* @__PURE__ */ S("input", {
|
|
287
287
|
type: "checkbox",
|
|
288
288
|
className: "absolute left-1 top-1 h-4 w-4 cursor-pointer",
|
|
289
|
-
checked:
|
|
290
|
-
onChange:
|
|
289
|
+
checked: t,
|
|
290
|
+
onChange: a,
|
|
291
291
|
"aria-label": v("file.grid.select", "Select {filename}", { filename: e.filename }),
|
|
292
292
|
"data-testid": `select-${e.id}`,
|
|
293
293
|
onClick: (e) => e.stopPropagation()
|
|
294
294
|
}),
|
|
295
|
-
|
|
295
|
+
r && /* @__PURE__ */ S("button", {
|
|
296
296
|
type: "button",
|
|
297
297
|
className: "absolute right-1 top-1 cursor-grab rounded-sm border border-border bg-card px-1 text-xs",
|
|
298
298
|
"aria-label": v("file.grid.reorder", "Drag to reorder {filename}", { filename: e.filename }),
|
|
@@ -306,12 +306,12 @@ function j({ file: e, selected: n, disabled: r, reorderable: i, preferredThumbna
|
|
|
306
306
|
children: [/* @__PURE__ */ S("button", {
|
|
307
307
|
type: "button",
|
|
308
308
|
className: "rounded-sm border border-border bg-card px-2 py-0.5 text-xs",
|
|
309
|
-
onClick:
|
|
309
|
+
onClick: s,
|
|
310
310
|
children: v("file.view", "View")
|
|
311
311
|
}), /* @__PURE__ */ S("button", {
|
|
312
312
|
type: "button",
|
|
313
313
|
className: "rounded-sm border border-border bg-card px-2 py-0.5 text-xs text-destructive",
|
|
314
|
-
onClick:
|
|
314
|
+
onClick: o,
|
|
315
315
|
"data-testid": `remove-${e.id}`,
|
|
316
316
|
children: v("file.delete", "Delete")
|
|
317
317
|
})]
|
|
@@ -319,8 +319,8 @@ function j({ file: e, selected: n, disabled: r, reorderable: i, preferredThumbna
|
|
|
319
319
|
] })]
|
|
320
320
|
});
|
|
321
321
|
}
|
|
322
|
-
function
|
|
323
|
-
let
|
|
322
|
+
function j({ tile: e, onCancel: t, onDismiss: n }) {
|
|
323
|
+
let r = c();
|
|
324
324
|
return /* @__PURE__ */ C("div", {
|
|
325
325
|
className: `relative flex aspect-square flex-col items-center justify-center rounded-md border ${e.error ? "border-destructive" : "border-border"} bg-surface-2 p-2 text-center text-xs`,
|
|
326
326
|
"data-testid": `pending-tile-${e.localId}`,
|
|
@@ -341,41 +341,41 @@ function ie({ tile: e, onCancel: n, onDismiss: r }) {
|
|
|
341
341
|
e.error && /* @__PURE__ */ S("div", {
|
|
342
342
|
role: "alert",
|
|
343
343
|
className: "mt-1 text-destructive",
|
|
344
|
-
children: /* @__PURE__ */ S(
|
|
344
|
+
children: /* @__PURE__ */ S(s, { failure: e.error })
|
|
345
345
|
}),
|
|
346
346
|
/* @__PURE__ */ S("button", {
|
|
347
347
|
type: "button",
|
|
348
348
|
className: "mt-1 rounded-sm border border-border bg-card px-2 py-0.5",
|
|
349
|
-
onClick: e.error ?
|
|
350
|
-
children: e.error ?
|
|
349
|
+
onClick: e.error ? n : t,
|
|
350
|
+
children: e.error ? r("file.upload.dismiss", "Dismiss") : r("file.upload.cancel", "Cancel")
|
|
351
351
|
})
|
|
352
352
|
]
|
|
353
353
|
});
|
|
354
354
|
}
|
|
355
|
-
function ae({ file: e, hasPrev:
|
|
356
|
-
let
|
|
355
|
+
function ae({ file: e, hasPrev: t, hasNext: r, onPrev: i, onNext: a, onClose: o }) {
|
|
356
|
+
let s = c(), l = m(e.id, "preview", p(e));
|
|
357
357
|
return /* @__PURE__ */ C("div", {
|
|
358
358
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80",
|
|
359
359
|
role: "dialog",
|
|
360
360
|
"aria-modal": "true",
|
|
361
361
|
"aria-label": e.filename,
|
|
362
362
|
"data-testid": "lightbox",
|
|
363
|
-
onClick:
|
|
363
|
+
onClick: o,
|
|
364
364
|
children: [
|
|
365
365
|
/* @__PURE__ */ S("button", {
|
|
366
366
|
type: "button",
|
|
367
367
|
className: "absolute right-4 top-4 rounded-sm border border-border bg-card px-3 py-1 text-foreground",
|
|
368
368
|
onClick: (e) => {
|
|
369
|
-
e.stopPropagation(),
|
|
369
|
+
e.stopPropagation(), o();
|
|
370
370
|
},
|
|
371
371
|
"data-testid": "lightbox-close",
|
|
372
|
-
children:
|
|
372
|
+
children: s("file.lightbox.close", "Close")
|
|
373
373
|
}),
|
|
374
|
-
|
|
374
|
+
t && /* @__PURE__ */ S("button", {
|
|
375
375
|
type: "button",
|
|
376
376
|
className: "absolute left-4 rounded-sm border border-border bg-card px-3 py-2 text-foreground",
|
|
377
377
|
onClick: (e) => {
|
|
378
|
-
e.stopPropagation(),
|
|
378
|
+
e.stopPropagation(), i();
|
|
379
379
|
},
|
|
380
380
|
"data-testid": "lightbox-prev",
|
|
381
381
|
children: "‹"
|
|
@@ -384,7 +384,7 @@ function ae({ file: e, hasPrev: n, hasNext: r, onPrev: a, onNext: o, onClose: s
|
|
|
384
384
|
type: "button",
|
|
385
385
|
className: "absolute right-4 bottom-4 rounded-sm border border-border bg-card px-3 py-2 text-foreground",
|
|
386
386
|
onClick: (e) => {
|
|
387
|
-
e.stopPropagation(),
|
|
387
|
+
e.stopPropagation(), a();
|
|
388
388
|
},
|
|
389
389
|
"data-testid": "lightbox-next",
|
|
390
390
|
children: "›"
|
|
@@ -399,12 +399,11 @@ function ae({ file: e, hasPrev: n, hasNext: r, onPrev: a, onNext: o, onClose: s
|
|
|
399
399
|
children: [
|
|
400
400
|
e.filename,
|
|
401
401
|
" (",
|
|
402
|
-
|
|
402
|
+
n(e.size_bytes, s.language),
|
|
403
403
|
")"
|
|
404
404
|
]
|
|
405
405
|
})
|
|
406
406
|
]
|
|
407
407
|
});
|
|
408
408
|
}
|
|
409
|
-
|
|
410
|
-
export { A as Grid };
|
|
409
|
+
export { k as Grid };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Suspense as e, lazy as t } from "react";
|
|
2
2
|
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/components/file-widgets/GridLazy.tsx
|
|
4
4
|
var r = t(() => import("./Grid.js").then((e) => ({ default: e.Grid })));
|
|
5
5
|
function i() {
|
|
6
6
|
return /* @__PURE__ */ n("div", { className: "h-24 w-full rounded-md bg-muted animate-pulse" });
|
|
@@ -11,5 +11,4 @@ function a(t) {
|
|
|
11
11
|
children: /* @__PURE__ */ n(r, { ...t })
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
//#endregion
|
|
15
14
|
export { a as GridLazy };
|