@wildo-ai/saas-frontend-lib 1.1.13 → 1.1.15
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/esm/components/ai-elements/meta/agent-wrappers.d.ts +1 -0
- package/dist/esm/components/ai-elements/meta/agent-wrappers.d.ts.map +1 -1
- package/dist/esm/components/ai-elements/meta/agent-wrappers.js.map +1 -1
- package/dist/esm/components/compliance/EmbeddedSigningFrame.d.ts +38 -0
- package/dist/esm/components/compliance/EmbeddedSigningFrame.d.ts.map +1 -0
- package/dist/esm/components/compliance/EmbeddedSigningFrame.js +106 -0
- package/dist/esm/components/compliance/EmbeddedSigningFrame.js.map +1 -0
- package/dist/esm/components/data-display/DisplayValueDispatcher.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayValueDispatcher.js +17 -1
- package/dist/esm/components/data-display/DisplayValueDispatcher.js.map +1 -1
- package/dist/esm/components/data-display/ResourceAutomaticDisplayer.d.ts.map +1 -1
- package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js +22 -0
- package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js.map +1 -1
- package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.d.ts.map +1 -1
- package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js +5 -2
- package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js.map +1 -1
- package/dist/esm/components/flows-actors/agent-config.labels.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/agent-config.labels.js +2 -0
- package/dist/esm/components/flows-actors/agent-config.labels.js.map +1 -1
- package/dist/esm/components/flows-actors/approval.d.ts +7 -1
- package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/approval.js +22 -5
- package/dist/esm/components/flows-actors/approval.js.map +1 -1
- package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts.map +1 -1
- package/dist/esm/components/form/automated/ResourceAutomatedForm.js +20 -1
- package/dist/esm/components/form/automated/ResourceAutomatedForm.js.map +1 -1
- package/dist/esm/components/form/chromes/FormFieldChrome.js +1 -1
- package/dist/esm/components/form/chromes/FormFieldChrome.js.map +1 -1
- package/dist/esm/components/form/chromes/field-control-aria.d.ts +8 -1
- package/dist/esm/components/form/chromes/field-control-aria.d.ts.map +1 -1
- package/dist/esm/components/form/chromes/field-control-aria.js +19 -2
- package/dist/esm/components/form/chromes/field-control-aria.js.map +1 -1
- package/dist/esm/components/form/validation-errors/validate-field-url.frontend.d.ts +5 -0
- package/dist/esm/components/form/validation-errors/validate-field-url.frontend.d.ts.map +1 -1
- package/dist/esm/components/form/validation-errors/validate-field-url.frontend.js +6 -2
- package/dist/esm/components/form/validation-errors/validate-field-url.frontend.js.map +1 -1
- package/dist/esm/components/resources/ResourceCollectionBody_Table.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceCollectionBody_Table.js +8 -1
- package/dist/esm/components/resources/ResourceCollectionBody_Table.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_DangerZone.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_DangerZone.js +2 -2
- package/dist/esm/components/resources/ResourceLayout_DangerZone.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_RecordSharing.js +2 -2
- package/dist/esm/components/resources/ResourceLayout_RecordSharing.js.map +1 -1
- package/dist/esm/components/resources/ResourceListItemRenderer.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceListItemRenderer.js +6 -1
- package/dist/esm/components/resources/ResourceListItemRenderer.js.map +1 -1
- package/dist/esm/components/resources/skeleton/DisplayLayout.js +2 -2
- package/dist/esm/components/resources/skeleton/DisplayLayout.js.map +1 -1
- package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.d.ts.map +1 -1
- package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js +71 -16
- package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js.map +1 -1
- package/dist/esm/components/sections/surface.d.ts +12 -0
- package/dist/esm/components/sections/surface.d.ts.map +1 -1
- package/dist/esm/components/sections/surface.js +14 -0
- package/dist/esm/components/sections/surface.js.map +1 -1
- package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.d.ts.map +1 -1
- package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.js +3 -2
- package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.js.map +1 -1
- package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts +15 -0
- package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts.map +1 -1
- package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js +29 -0
- package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js.map +1 -1
- package/dist/esm/core/app-shell/shell-motion/use-shell-motion.d.ts.map +1 -1
- package/dist/esm/core/app-shell/shell-motion/use-shell-motion.js +2 -2
- package/dist/esm/core/app-shell/shell-motion/use-shell-motion.js.map +1 -1
- package/dist/esm/core/branding/useBrandPresentation.d.ts.map +1 -1
- package/dist/esm/core/branding/useBrandPresentation.js +17 -6
- package/dist/esm/core/branding/useBrandPresentation.js.map +1 -1
- package/dist/esm/core/events/events.frontend.schemas.d.ts +40 -0
- package/dist/esm/core/events/events.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/events/events.frontend.schemas.js +24 -1
- package/dist/esm/core/events/events.frontend.schemas.js.map +1 -1
- package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.d.ts.map +1 -1
- package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.js +11 -1
- package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.js.map +1 -1
- package/dist/esm/core/i18n/I18nContext.d.ts.map +1 -1
- package/dist/esm/core/i18n/I18nContext.js +8 -2
- package/dist/esm/core/i18n/I18nContext.js.map +1 -1
- package/dist/esm/core/i18n/component-label-resolution.utils.d.ts.map +1 -1
- package/dist/esm/core/i18n/component-label-resolution.utils.js +6 -1
- package/dist/esm/core/i18n/component-label-resolution.utils.js.map +1 -1
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts +0 -15
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts.map +1 -1
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.js +102 -5
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.js.map +1 -1
- package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.d.ts.map +1 -1
- package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js +12 -3
- package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js.map +1 -1
- package/dist/esm/core/navigation/NavigationContext.d.ts.map +1 -1
- package/dist/esm/core/navigation/NavigationContext.js +60 -17
- package/dist/esm/core/navigation/NavigationContext.js.map +1 -1
- package/dist/esm/core/navigation/launcher-resolution.d.ts +29 -0
- package/dist/esm/core/navigation/launcher-resolution.d.ts.map +1 -1
- package/dist/esm/core/navigation/launcher-resolution.js +31 -0
- package/dist/esm/core/navigation/launcher-resolution.js.map +1 -1
- package/dist/esm/core/navigation/navigation-controller-internals.d.ts +48 -0
- package/dist/esm/core/navigation/navigation-controller-internals.d.ts.map +1 -1
- package/dist/esm/core/navigation/navigation-controller-internals.js +56 -3
- package/dist/esm/core/navigation/navigation-controller-internals.js.map +1 -1
- package/dist/esm/core/navigation/useNavigationRouterSync.d.ts.map +1 -1
- package/dist/esm/core/navigation/useNavigationRouterSync.js +30 -2
- package/dist/esm/core/navigation/useNavigationRouterSync.js.map +1 -1
- package/dist/esm/core/resources/resource-read-cache.frontend.service.d.ts +6 -1
- package/dist/esm/core/resources/resource-read-cache.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/resources/resource-read-cache.frontend.service.js +11 -1
- package/dist/esm/core/resources/resource-read-cache.frontend.service.js.map +1 -1
- package/dist/esm/core/resources/route-parent-relocation.frontend.utils.d.ts +44 -0
- package/dist/esm/core/resources/route-parent-relocation.frontend.utils.d.ts.map +1 -0
- package/dist/esm/core/resources/route-parent-relocation.frontend.utils.js +63 -0
- package/dist/esm/core/resources/route-parent-relocation.frontend.utils.js.map +1 -0
- package/dist/esm/core/resources/useOperationDirectExecution.d.ts.map +1 -1
- package/dist/esm/core/resources/useOperationDirectExecution.js +45 -6
- package/dist/esm/core/resources/useOperationDirectExecution.js.map +1 -1
- package/dist/esm/core/runtime/AppRouter.d.ts.map +1 -1
- package/dist/esm/core/runtime/AppRouter.js +18 -1
- package/dist/esm/core/runtime/AppRouter.js.map +1 -1
- package/dist/esm/core/runtime/ApplicationMainContext.d.ts +1 -1
- package/dist/esm/core/runtime/ApplicationMainContext.d.ts.map +1 -1
- package/dist/esm/core/runtime/ApplicationMainContext.js +12 -3
- package/dist/esm/core/runtime/ApplicationMainContext.js.map +1 -1
- package/dist/esm/core/security/UserOrgsContext.d.ts +6 -1
- package/dist/esm/core/security/UserOrgsContext.d.ts.map +1 -1
- package/dist/esm/core/security/UserOrgsContext.js +87 -10
- package/dist/esm/core/security/UserOrgsContext.js.map +1 -1
- package/dist/esm/core/security/consent-gate.frontend.utils.d.ts +17 -5
- package/dist/esm/core/security/consent-gate.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/security/consent-gate.frontend.utils.js +16 -7
- package/dist/esm/core/security/consent-gate.frontend.utils.js.map +1 -1
- package/dist/esm/core/security/useConsentGateBehavior.js +1 -1
- package/dist/esm/core/security/useConsentGateBehavior.js.map +1 -1
- package/dist/esm/core/security/useGrantedConsentPurposes.js +1 -1
- package/dist/esm/core/security/useGrantedConsentPurposes.js.map +1 -1
- package/dist/esm/core/ui/inner-control-activation.utils.d.ts +16 -0
- package/dist/esm/core/ui/inner-control-activation.utils.d.ts.map +1 -0
- package/dist/esm/core/ui/inner-control-activation.utils.js +44 -0
- package/dist/esm/core/ui/inner-control-activation.utils.js.map +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceLayout_DangerZone.js","sourceRoot":"","sources":["../../../../src/components/resources/ResourceLayout_DangerZone.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAClG,OAAO,EAAE,sBAAsB,EAAwB,MAAM,mDAAmD,CAAC;AACjH,OAAO,EAAE,UAAU,EAAE,MAAM,qDAAqD,CAAC;AACjF,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AACrG,OAAO,EAAE,yBAAyB,EAAE,MAAM,qEAAqE,CAAC;AAChH,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAEhE,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAC/F,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gEAAgE,CAAC;AAC7G,OAAO,EAAE,eAAe,EAAE,MAAM,+DAA+D,CAAC;AAGhG,OAAO,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEjG,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,iFAAiF,CAAC;AAE1H,OAAO,EAAE,OAAO,EAAE,MAAM,mDAAmD,CAAC;AAqB5E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC,EACtD,eAAe,EACf,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,kBAAkB,GAC2B,EAA4B,EAA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,GAAG,KAAK,EAAuE;IAC3J,MAAM,SAAS,GAAG,uBAAuB,CAA+C,qBAAqB,CAAC,6BAA6B,EAAE,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;IAClL,OAAO,KAAC,SAAS,OAAK,KAAK,GAAI,CAAC;AAClC,CAAC","sourcesContent":["import React, { useMemo } from 'react';\n\nimport { Button, resolveDrawnActionVariant } from '~wildo-frontend-lib/components/actions/button';\nimport { actionBarItemCannotRun, type ActionBarButton } from '~wildo-frontend-lib/components/actions/action-bar';\nimport { DangerZone } from '~wildo-frontend-lib/components/feedback/danger-zone';\nimport { Text, Strong, TextVariant, TextSize } from '~wildo-frontend-lib/components/typography/text';\nimport { OperationsConfirmCritical } from '~wildo-frontend-lib/components/feedback/operations-confirm-critical';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport type { ResponsiveMaxWidth } from '@wildo-ai/presets-components-models';\nimport { responsiveMaxWidthToCssValue } from '~wildo-frontend-lib/components/sections/surface';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { useResourceOperationActions } from '~wildo-frontend-lib/core/resources/useResourceOperationActions';\nimport { ActionPlacement } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport type { FrontendResourceConfiguration_Operation } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\n\nimport { ResourceOperationDisplayMode, ResourceOperationRiskLevel } from '@wildo-ai/saas-models';\n\nimport { CorePresetNames, FrontendComponentType } from '@wildo-ai/presets-components-models';\nimport { ComponentPresetProps } from '~wildo-frontend-lib/core/components-registry/component-registry.frontend.schemas';\nimport { createComponentResolver } from '~wildo-frontend-lib/core/components-registry/component-resolver.frontend.helper';\nimport { BaseResourcesLayoutProps } from './component-props.resources-layout.frontend.schemas';\nimport { Heading } from '~wildo-frontend-lib/components/typography/heading';\n\n// --- Contract ---\nexport interface ResourceLayoutPreset_DangerZone_DefaultProps extends BaseResourcesLayoutProps {\n /** The loaded record — feeds `enabledCondition` evaluation + each op's target. */\n currentObject?: Record<string, any>;\n /** Called after a destructive op executes (e.g. navigate away after delete). */\n onOperationExecuted?: (operation: FrontendResourceConfiguration_Operation) => void;\n className?: string;\n /**\n * How wide the danger zone may grow, in the framework's shared width vocabulary.\n *\n * Left unset, nothing caps it here and the host decides. The read layout does so through `className`,\n * reading the width the record body derived (`--record-body-max-inline-size`: the reading measure, or\n * no cap when the body holds a list), so the destructive actions sit on the SAME edges as the body above\n * them. They once carried a `max-w-4xl` literal — 224px wider than the stack, for no reason anyone had\n * written down — and then a fixed `'measure'`, which left them narrow under a full-width list.\n */\n responsiveMaxWidth?: ResponsiveMaxWidth;\n}\n\n/**\n * GitHub-style \"Danger Zone\" — a fenced section at the bottom of a resource's\n * read view holding the destructive (`DANGER_ZONE`-placement) operations, each\n * as a row: title · caution description · action button. These ops are excluded\n * from the top action bar (which requests `placementFilter: PRIMARY`); this\n * section is their home.\n *\n * Reuses the single operation pipeline via `placementFilter: DANGER_ZONE`, so\n * `enabledCondition`, role gating, the critical-confirm dialog, and `actionVariant`\n * colour all behave exactly as in the bar — only the presentation differs.\n */\nexport const ResourceLayoutPreset_DangerZone_Default = ({\n resourceContext,\n navigationZone,\n currentObject,\n onOperationExecuted,\n className,\n responsiveMaxWidth,\n}: ResourceLayoutPreset_DangerZone_DefaultProps): React.JSX.Element | null => {\n const { resourceType, operation } = resourceContext;\n const { tComponent, tResourceOperation } = useI18n({\n component: FrontendComponentType.RESOURCES_LAYOUTS_DANGER_ZONE,\n resource: resourceType,\n });\n\n const {\n items,\n isConfirmDialogOpen,\n confirmDialogLabel,\n confirmDialogDescription,\n confirmDialogConfirmLabel,\n confirmRequiresTypedConfirmation,\n confirmConfirmationPhrase,\n onConfirm,\n onCancel,\n } = useResourceOperationActions({\n resourceType,\n displayMode: ResourceOperationDisplayMode.DETAIL,\n currentObject,\n contextResourceIdentifiers: resourceContext.contextResourceIdentifiers,\n parentResourcesRequirements: resourceContext.parentResourcesRequirements,\n additionalContext: resourceContext.additionalContext,\n navigationZone,\n sourceOperation: operation,\n placementFilter: ActionPlacement.DANGER_ZONE,\n onOperationExecuted,\n });\n\n // Flatten multi-variant ops (subgroups) into one row per concrete action.\n const rows = useMemo<ActionBarButton[]>(\n () =>\n items.flatMap((item) => {\n if (item.type === 'subgroup') {\n return item.items.filter(\n (sub): sub is ActionBarButton => sub.type !== 'separator' && sub.type !== 'subgroup',\n );\n }\n if (item.type === 'separator') return [];\n return [item];\n }),\n [items],\n );\n\n if (rows.length === 0) return null;\n\n // Every word here is a declared label (`ResourceLayout_DangerZone.labels.ts`); an ungenerated one\n // renders as its key path, which is what a missing label must look like. The English literals that\n // used to stand behind each key hid the gap in every locale (#1414).\n const label = (key: string): string => tComponent(FrontendComponentType.RESOURCES_LAYOUTS_DANGER_ZONE, key);\n const heading = label('title');\n // Risk-specific caution: CRITICAL emphasizes irreversibility, HIGH a significant\n // disruptive impact, everything else a generic caution.\n const describeRisk = (riskLevel: ResourceOperationRiskLevel | undefined): string => {\n switch (riskLevel) {\n case ResourceOperationRiskLevel.CRITICAL:\n return label('descriptionCritical');\n case ResourceOperationRiskLevel.HIGH:\n return label('descriptionHigh');\n default:\n return label('descriptionDefault');\n }\n };\n // Prefer an authored/generated per-operation description\n // (resources.{res}.operations.{op}.description) — accurate per action (e.g. Delete\n // \"permanent\" vs Suspend \"reversible\"). Falls back to the risk-based copy.\n // An operation DESCRIPTION is optional (few operations author one), so `tResourceOperation`\n // answers '' for a missing one and `||` chains cleanly. A missing TITLE is never empty (#1450).\n const describe = (row: ActionBarButton): string => {\n const perOp = row.operationIdentifier\n ? tResourceOperation(resourceType, row.operationIdentifier, 'description')\n : '';\n return perOp || describeRisk(row.riskLevel);\n };\n\n return (\n // Mirrors the CARD \"settings group\" shape EXACTLY so it reads as a sibling\n // of the cards above it, only tinted destructive:\n // - `flex flex-col gap-field-sm` — the SAME title↔card gap the ContentSection\n // CARD branch puts between its heading and its body (was `space-y-item-xs`,\n // a ~1px hairline that crammed the title onto the card).\n // - `<h3 text-base font-medium>` — the same group-heading type as the CARD title.\n // - `rounded-xl` on the card — matches the CARD surface recipe radius\n // (`SurfaceVariant.CARD` = `rounded-xl`); the DangerZone primitive's own\n // base is `rounded-lg`, one tier tighter, which read as a different corner.\n // - `p-0` card + `px-card` rows — identical inset to the settings rows so the\n // \"Reset to defaults\" copy lines up with the fields above; per-row dividers\n // run full-bleed.\n <section\n data-slot=\"danger-zone-section\"\n data-inline-size-tier={responsiveMaxWidth}\n className={cn('mr-auto w-full flex flex-col gap-field-sm', className)}\n style={{ maxInlineSize: responsiveMaxWidthToCssValue(responsiveMaxWidth) }}\n >\n <Heading level={3}>{heading}</Heading>\n <DangerZone className=\"rounded-xl p-0 overflow-hidden divide-y divide-destructive/20\">\n {rows.map((row, index) => (\n <div\n key={index}\n className=\"flex flex-col gap-field px-card py-card sm:flex-row sm:items-center sm:justify-between\"\n >\n <div className=\"flex flex-col gap-element-xs\">\n <Strong>{row.label}</Strong>\n <Text variant={TextVariant.MUTED} size={TextSize.SM}>{describe(row)}</Text>\n </div>\n {/* Drawn through the bar's rule: an action that cannot run never keeps authored emphasis (see\n `resolveDrawnActionVariant`). Its risk colour (DESTRUCTIVE), which is how most rows here are drawn, stays. */}\n <Button\n variant={resolveDrawnActionVariant(row.variant, actionBarItemCannotRun(row))}\n disabled={row.disabled}\n onClick={row.onClick}\n className=\"shrink-0 self-start sm:self-auto\"\n >\n {row.label}\n </Button>\n </div>\n ))}\n </DangerZone>\n {isConfirmDialogOpen && (\n <OperationsConfirmCritical\n open={isConfirmDialogOpen}\n onOpenChange={(open: boolean) => { if (!open) onCancel(); }}\n cancelCallback={onCancel}\n validationCallback={onConfirm}\n label={confirmDialogLabel}\n description={confirmDialogDescription}\n confirmLabel={confirmDialogConfirmLabel}\n requireTypedConfirmation={confirmRequiresTypedConfirmation}\n confirmationPhrase={confirmConfirmationPhrase}\n />\n )}\n </section>\n );\n};\n\nexport function ResourceLayout_DangerZone({ preset = CorePresetNames.DEFAULT, ...props }: ResourceLayoutPreset_DangerZone_DefaultProps & ComponentPresetProps): React.JSX.Element {\n const Component = createComponentResolver<ResourceLayoutPreset_DangerZone_DefaultProps>(FrontendComponentType.RESOURCES_LAYOUTS_DANGER_ZONE, 'ResourceLayout_DangerZone')(preset);\n return <Component {...props} />;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ResourceLayout_DangerZone.js","sourceRoot":"","sources":["../../../../src/components/resources/ResourceLayout_DangerZone.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAClG,OAAO,EAAE,sBAAsB,EAAwB,MAAM,mDAAmD,CAAC;AACjH,OAAO,EAAE,UAAU,EAAE,MAAM,qDAAqD,CAAC;AACjF,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AACrG,OAAO,EAAE,yBAAyB,EAAE,MAAM,qEAAqE,CAAC;AAChH,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAEhE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAC;AAC7F,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gEAAgE,CAAC;AAC7G,OAAO,EAAE,eAAe,EAAE,MAAM,+DAA+D,CAAC;AAGhG,OAAO,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEjG,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,iFAAiF,CAAC;AAE1H,OAAO,EAAE,OAAO,EAAE,MAAM,mDAAmD,CAAC;AAqB5E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAA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ACX,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,yBAAyB,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,OAAO,EAAE,GAAG,KAAK,EAAuE;IAC3J,MAAM,SAAS,GAAG,uBAAuB,CAA+C,qBAAqB,CAAC,6BAA6B,EAAE,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;IAClL,OAAO,KAAC,SAAS,OAAK,KAAK,GAAI,CAAC;AAClC,CAAC","sourcesContent":["import React, { useMemo } from 'react';\n\nimport { Button, resolveDrawnActionVariant } from '~wildo-frontend-lib/components/actions/button';\nimport { actionBarItemCannotRun, type ActionBarButton } from '~wildo-frontend-lib/components/actions/action-bar';\nimport { DangerZone } from '~wildo-frontend-lib/components/feedback/danger-zone';\nimport { Text, Strong, TextVariant, TextSize } from '~wildo-frontend-lib/components/typography/text';\nimport { OperationsConfirmCritical } from '~wildo-frontend-lib/components/feedback/operations-confirm-critical';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport type { ResponsiveMaxWidth } from '@wildo-ai/presets-components-models';\nimport { optionalMaxInlineSizeStyle } from '~wildo-frontend-lib/components/sections/surface';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { useResourceOperationActions } from '~wildo-frontend-lib/core/resources/useResourceOperationActions';\nimport { ActionPlacement } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport type { FrontendResourceConfiguration_Operation } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\n\nimport { ResourceOperationDisplayMode, ResourceOperationRiskLevel } from '@wildo-ai/saas-models';\n\nimport { CorePresetNames, FrontendComponentType } from '@wildo-ai/presets-components-models';\nimport { ComponentPresetProps } from '~wildo-frontend-lib/core/components-registry/component-registry.frontend.schemas';\nimport { createComponentResolver } from '~wildo-frontend-lib/core/components-registry/component-resolver.frontend.helper';\nimport { BaseResourcesLayoutProps } from './component-props.resources-layout.frontend.schemas';\nimport { Heading } from '~wildo-frontend-lib/components/typography/heading';\n\n// --- Contract ---\nexport interface ResourceLayoutPreset_DangerZone_DefaultProps extends BaseResourcesLayoutProps {\n /** The loaded record — feeds `enabledCondition` evaluation + each op's target. */\n currentObject?: Record<string, any>;\n /** Called after a destructive op executes (e.g. navigate away after delete). */\n onOperationExecuted?: (operation: FrontendResourceConfiguration_Operation) => void;\n className?: string;\n /**\n * How wide the danger zone may grow, in the framework's shared width vocabulary.\n *\n * Left unset, nothing caps it here and the host decides. The read layout does so through `className`,\n * reading the width the record body derived (`--record-body-max-inline-size`: the reading measure, or\n * no cap when the body holds a list), so the destructive actions sit on the SAME edges as the body above\n * them. They once carried a `max-w-4xl` literal — 224px wider than the stack, for no reason anyone had\n * written down — and then a fixed `'measure'`, which left them narrow under a full-width list.\n */\n responsiveMaxWidth?: ResponsiveMaxWidth;\n}\n\n/**\n * GitHub-style \"Danger Zone\" — a fenced section at the bottom of a resource's\n * read view holding the destructive (`DANGER_ZONE`-placement) operations, each\n * as a row: title · caution description · action button. These ops are excluded\n * from the top action bar (which requests `placementFilter: PRIMARY`); this\n * section is their home.\n *\n * Reuses the single operation pipeline via `placementFilter: DANGER_ZONE`, so\n * `enabledCondition`, role gating, the critical-confirm dialog, and `actionVariant`\n * colour all behave exactly as in the bar — only the presentation differs.\n */\nexport const ResourceLayoutPreset_DangerZone_Default = ({\n resourceContext,\n navigationZone,\n currentObject,\n onOperationExecuted,\n className,\n responsiveMaxWidth,\n}: ResourceLayoutPreset_DangerZone_DefaultProps): React.JSX.Element | null => {\n const { resourceType, operation } = resourceContext;\n const { tComponent, tResourceOperation } = useI18n({\n component: FrontendComponentType.RESOURCES_LAYOUTS_DANGER_ZONE,\n resource: resourceType,\n });\n\n const {\n items,\n isConfirmDialogOpen,\n confirmDialogLabel,\n confirmDialogDescription,\n confirmDialogConfirmLabel,\n confirmRequiresTypedConfirmation,\n confirmConfirmationPhrase,\n onConfirm,\n onCancel,\n } = useResourceOperationActions({\n resourceType,\n displayMode: ResourceOperationDisplayMode.DETAIL,\n currentObject,\n contextResourceIdentifiers: resourceContext.contextResourceIdentifiers,\n parentResourcesRequirements: resourceContext.parentResourcesRequirements,\n additionalContext: resourceContext.additionalContext,\n navigationZone,\n sourceOperation: operation,\n placementFilter: ActionPlacement.DANGER_ZONE,\n onOperationExecuted,\n });\n\n // Flatten multi-variant ops (subgroups) into one row per concrete action.\n const rows = useMemo<ActionBarButton[]>(\n () =>\n items.flatMap((item) => {\n if (item.type === 'subgroup') {\n return item.items.filter(\n (sub): sub is ActionBarButton => sub.type !== 'separator' && sub.type !== 'subgroup',\n );\n }\n if (item.type === 'separator') return [];\n return [item];\n }),\n [items],\n );\n\n if (rows.length === 0) return null;\n\n // Every word here is a declared label (`ResourceLayout_DangerZone.labels.ts`); an ungenerated one\n // renders as its key path, which is what a missing label must look like. The English literals that\n // used to stand behind each key hid the gap in every locale (#1414).\n const label = (key: string): string => tComponent(FrontendComponentType.RESOURCES_LAYOUTS_DANGER_ZONE, key);\n const heading = label('title');\n // Risk-specific caution: CRITICAL emphasizes irreversibility, HIGH a significant\n // disruptive impact, everything else a generic caution.\n const describeRisk = (riskLevel: ResourceOperationRiskLevel | undefined): string => {\n switch (riskLevel) {\n case ResourceOperationRiskLevel.CRITICAL:\n return label('descriptionCritical');\n case ResourceOperationRiskLevel.HIGH:\n return label('descriptionHigh');\n default:\n return label('descriptionDefault');\n }\n };\n // Prefer an authored/generated per-operation description\n // (resources.{res}.operations.{op}.description) — accurate per action (e.g. Delete\n // \"permanent\" vs Suspend \"reversible\"). Falls back to the risk-based copy.\n // An operation DESCRIPTION is optional (few operations author one), so `tResourceOperation`\n // answers '' for a missing one and `||` chains cleanly. A missing TITLE is never empty (#1450).\n const describe = (row: ActionBarButton): string => {\n const perOp = row.operationIdentifier\n ? tResourceOperation(resourceType, row.operationIdentifier, 'description')\n : '';\n return perOp || describeRisk(row.riskLevel);\n };\n\n return (\n // Mirrors the CARD \"settings group\" shape EXACTLY so it reads as a sibling\n // of the cards above it, only tinted destructive:\n // - `flex flex-col gap-field-sm` — the SAME title↔card gap the ContentSection\n // CARD branch puts between its heading and its body (was `space-y-item-xs`,\n // a ~1px hairline that crammed the title onto the card).\n // - `<h3 text-base font-medium>` — the same group-heading type as the CARD title.\n // - `rounded-xl` on the card — matches the CARD surface recipe radius\n // (`SurfaceVariant.CARD` = `rounded-xl`); the DangerZone primitive's own\n // base is `rounded-lg`, one tier tighter, which read as a different corner.\n // - `p-0` card + `px-card` rows — identical inset to the settings rows so the\n // \"Reset to defaults\" copy lines up with the fields above; per-row dividers\n // run full-bleed.\n <section\n data-slot=\"danger-zone-section\"\n data-inline-size-tier={responsiveMaxWidth}\n className={cn('mr-auto w-full flex flex-col gap-field-sm', className)}\n style={optionalMaxInlineSizeStyle(responsiveMaxWidth)}\n >\n <Heading level={3}>{heading}</Heading>\n <DangerZone className=\"rounded-xl p-0 overflow-hidden divide-y divide-destructive/20\">\n {rows.map((row, index) => (\n <div\n key={index}\n className=\"flex flex-col gap-field px-card py-card sm:flex-row sm:items-center sm:justify-between\"\n >\n <div className=\"flex flex-col gap-element-xs\">\n <Strong>{row.label}</Strong>\n <Text variant={TextVariant.MUTED} size={TextSize.SM}>{describe(row)}</Text>\n </div>\n {/* Drawn through the bar's rule: an action that cannot run never keeps authored emphasis (see\n `resolveDrawnActionVariant`). Its risk colour (DESTRUCTIVE), which is how most rows here are drawn, stays. */}\n <Button\n variant={resolveDrawnActionVariant(row.variant, actionBarItemCannotRun(row))}\n disabled={row.disabled}\n onClick={row.onClick}\n className=\"shrink-0 self-start sm:self-auto\"\n // The automation hook every other action surface carries (`ActionButton`, the action bar's direct and\n // overflow items): the operation, i18n-independent. A delete moved here by its risk was the one\n // action a scenario could not address without reading translated text.\n data-operation-id={row.operationIdentifier}\n >\n {row.label}\n </Button>\n </div>\n ))}\n </DangerZone>\n {isConfirmDialogOpen && (\n <OperationsConfirmCritical\n open={isConfirmDialogOpen}\n onOpenChange={(open: boolean) => { if (!open) onCancel(); }}\n cancelCallback={onCancel}\n validationCallback={onConfirm}\n label={confirmDialogLabel}\n description={confirmDialogDescription}\n confirmLabel={confirmDialogConfirmLabel}\n requireTypedConfirmation={confirmRequiresTypedConfirmation}\n confirmationPhrase={confirmConfirmationPhrase}\n />\n )}\n </section>\n );\n};\n\nexport function ResourceLayout_DangerZone({ preset = CorePresetNames.DEFAULT, ...props }: ResourceLayoutPreset_DangerZone_DefaultProps & ComponentPresetProps): React.JSX.Element {\n const Component = createComponentResolver<ResourceLayoutPreset_DangerZone_DefaultProps>(FrontendComponentType.RESOURCES_LAYOUTS_DANGER_ZONE, 'ResourceLayout_DangerZone')(preset);\n return <Component {...props} />;\n}\n"]}
|
|
@@ -6,7 +6,7 @@ import { ControlSize, CorePresetNames, FrontendComponentType } from '@wildo-ai/p
|
|
|
6
6
|
import { Button, ButtonVariants_Variant } from '../../components/actions/button.js';
|
|
7
7
|
import { Select } from '../../components/form/controls/enum/select.js';
|
|
8
8
|
import { Card } from '../../components/sections/card.js';
|
|
9
|
-
import {
|
|
9
|
+
import { optionalMaxInlineSizeStyle } from '../../components/sections/surface.js';
|
|
10
10
|
import { Heading } from '../../components/typography/heading.js';
|
|
11
11
|
import { Strong, Text, TextSize, TextVariant } from '../../components/typography/text.js';
|
|
12
12
|
import { OperationsConfirmCritical } from '../../components/feedback/operations-confirm-critical.js';
|
|
@@ -166,7 +166,7 @@ export const ResourceLayoutPreset_RecordSharing_Default = ({ resourceContext, cu
|
|
|
166
166
|
else
|
|
167
167
|
run(() => sharing.share(relationshipId));
|
|
168
168
|
};
|
|
169
|
-
return (_jsxs("section", { "data-slot": "record-sharing-section", "data-inline-size-tier": responsiveMaxWidth, className: cn('mr-auto w-full flex flex-col gap-field-sm', className), style:
|
|
169
|
+
return (_jsxs("section", { "data-slot": "record-sharing-section", "data-inline-size-tier": responsiveMaxWidth, className: cn('mr-auto w-full flex flex-col gap-field-sm', className), style: optionalMaxInlineSizeStyle(responsiveMaxWidth), children: [_jsx(Heading, { level: 3, children: label('title') }), _jsx(Card, { className: "rounded-xl p-0 overflow-hidden divide-y divide-border", children: sharing.readState === RecordSharingReadState.FAILED ? (_jsx("div", { className: "px-card py-card", children: _jsx(Text, { variant: TextVariant.MUTED, size: TextSize.SM, children: label('readFailed') }) })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex flex-col gap-element-xs px-card py-card", children: [_jsx(Text, { size: TextSize.SM, children: sharing.viaRelationshipId === null ? label('ownRecord') : label('createdThrough', { relationship: nameOf(sharing.viaRelationshipId) }) }), sharing.viaRelationshipId !== null && !creatingRelationship?.confersNow && (_jsx(Text, { variant: TextVariant.MUTED, size: TextSize.SM, children: label('relationshipInactive') })), sharing.viaRelationshipId !== null && creatingRelationship?.confersNow && !creatingRelationship.rolesReachRecord && (_jsx(Text, { variant: TextVariant.MUTED, size: TextSize.SM, children: label('creatorCannotRead') })), _jsx(Text, { variant: TextVariant.MUTED, size: TextSize.SM, children: sharing.commonToEveryRelationship ? label('commonToEveryRelationship') : unreadable ? label('notReadableByRelationships') : label('description') }), alreadyReading.length > 0 && !sharing.commonToEveryRelationship && (_jsx(Text, { variant: TextVariant.MUTED, size: TextSize.SM, children: label('alreadyReadBy', { relationships: formatList(alreadyReading.map((relationship) => nameOf(relationship.relationshipId))) }) }))] }), sharing.sharedWithRelationshipIds.length === 0 ? (_jsx("div", { className: "px-card py-card", children: _jsx(Text, { variant: TextVariant.MUTED, size: TextSize.SM, children: label('notShared') }) })) : sharing.sharedWithRelationshipIds.map((relationshipId) => {
|
|
170
170
|
const note = shareNote(relationshipId);
|
|
171
171
|
return (_jsxs("div", { "data-slot": "record-sharing-share", className: "flex flex-col gap-field px-card py-card sm:flex-row sm:items-center sm:justify-between", children: [_jsxs("div", { className: "flex flex-col gap-element-xs", children: [_jsx(Strong, { children: nameOf(relationshipId) }), note !== undefined && _jsx(Text, { variant: TextVariant.MUTED, size: TextSize.SM, children: note })] }), _jsx(Button, { variant: ButtonVariants_Variant.OUTLINE, disabled: disabled, onClick: () => run(() => sharing.unshare(relationshipId)), className: "shrink-0 self-start sm:self-auto", children: label('withdraw') })] }, relationshipId));
|
|
172
172
|
}), shareable.length > 0 && (_jsxs("div", { className: "flex flex-col gap-field px-card py-card sm:flex-row sm:items-center", children: [_jsx(Select, { name: "recordSharingRelationship", schema: z.string(), options: shareable.map((relationship) => ({ value: relationship.relationshipId, label: nameOf(relationship.relationshipId) })), value: chosenRelationshipId, onChange: setChosenRelationshipId, placeholder: label('chooseRelationship'), size: ControlSize.SM, disabled: disabled }), _jsx(Button, { variant: ButtonVariants_Variant.SECONDARY, disabled: disabled || !chosenRelationshipId, onClick: () => { if (chosenRelationshipId)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceLayout_RecordSharing.js","sourceRoot":"","sources":["../../../../src/components/resources/ResourceLayout_RecordSharing.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,gBAAgB,EAChB,oCAAoC,EACpC,+CAA+C,EAC/C,qCAAqC,GACtC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,qBAAqB,EAA2B,MAAM,qCAAqC,CAAC;AAEnI,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAC/F,OAAO,EAAE,MAAM,EAAE,MAAM,0DAA0D,CAAC;AAClF,OAAO,EAAE,IAAI,EAAE,MAAM,8CAA8C,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAC/F,OAAO,EAAE,OAAO,EAAE,MAAM,mDAAmD,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AACrG,OAAO,EAAE,yBAAyB,EAAE,MAAM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AAC,CAAC;AAEF,MAAM,UAAU,4BAA4B,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,OAAO,EAAE,GAAG,KAAK,EAA0E;IACjK,MAAM,SAAS,GAAG,uBAAuB,CAAkD,qBAAqB,CAAC,gCAAgC,EAAE,8BAA8B,CAAC,CAAC,MAAM,CAAC,CAAC;IAC3L,OAAO,KAAC,SAAS,OAAK,KAAK,GAAI,CAAC;AAClC,CAAC","sourcesContent":["import React, { useContext, useMemo, useState } from 'react';\nimport { z } from 'zod';\n\nimport {\n CoreResourceType,\n OrganizationRelationships_Operations,\n RELATIONSHIP_COMMON_RECORDS_FORBIDDEN_RESOURCES,\n resourceCarriesRelationshipProvenance,\n} from '@wildo-ai/saas-models';\nimport { ControlSize, CorePresetNames, FrontendComponentType, type ResponsiveMaxWidth } from '@wildo-ai/presets-components-models';\n\nimport { Button, ButtonVariants_Variant } from '~wildo-frontend-lib/components/actions/button';\nimport { Select } from '~wildo-frontend-lib/components/form/controls/enum/select';\nimport { Card } from '~wildo-frontend-lib/components/sections/card';\nimport { responsiveMaxWidthToCssValue } from '~wildo-frontend-lib/components/sections/surface';\nimport { Heading } from '~wildo-frontend-lib/components/typography/heading';\nimport { Strong, Text, TextSize, TextVariant } from '~wildo-frontend-lib/components/typography/text';\nimport { OperationsConfirmCritical } from '~wildo-frontend-lib/components/feedback/operations-confirm-critical';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { ResourceRegistryContext } from '~wildo-frontend-lib/core/resources/ResourceRegistryContext';\nimport type { FrontendResourceConfiguration_Operation, FrontendResourcesRegistry } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { isRiskyResourceOperation } from '~wildo-frontend-lib/core/resources/operation-semantics.frontend.utils';\nimport { resolveRecordOrganizationId } from '~wildo-frontend-lib/core/resources/resource-addressability.frontend.utils';\nimport {\n RecordSharingReadState,\n findRelationshipOperation,\n useRecordSharing,\n type RecordSharingRelationship,\n} from '~wildo-frontend-lib/core/resources/useRecordSharing';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { useRelationshipSideCapabilities, useViewerEffectiveRolesInOrganization } from '~wildo-frontend-lib/core/navigation/launcher-runtime-availability';\nimport { viewerMayPerformOperation, type LauncherEffectiveRoles } from '~wildo-frontend-lib/core/navigation/launcher-resolution';\nimport { RelationshipSideCapability } from '~wildo-frontend-lib/core/config/relationship-side-capabilities.frontend.utils';\nimport { ComponentPresetProps } from '~wildo-frontend-lib/core/components-registry/component-registry.frontend.schemas';\nimport { createComponentResolver } from '~wildo-frontend-lib/core/components-registry/component-resolver.frontend.helper';\nimport { BaseResourcesLayoutProps } from './component-props.resources-layout.frontend.schemas';\n\n// --- Contract ---\nexport interface ResourceLayoutPreset_RecordSharing_DefaultProps extends BaseResourcesLayoutProps {\n /** The loaded record: its id names the record the sharing is about. */\n currentObject?: Record<string, any>;\n className?: string;\n /** How wide the section may grow, in the framework's shared width vocabulary; unset, the host decides (as the danger zone). */\n responsiveMaxWidth?: ResponsiveMaxWidth;\n}\n\n/** The record's id as the read page loaded it: `_id`, else the resource's own identifier field. */\nfunction recordIdOf(currentObject: Record<string, unknown> | undefined, resourceFieldIdentifier: string | undefined): string | undefined {\n const candidate = currentObject?._id ?? (resourceFieldIdentifier ? currentObject?.[resourceFieldIdentifier] : undefined);\n return (typeof candidate === 'string' || typeof candidate === 'number') && String(candidate).length > 0 ? String(candidate) : undefined;\n}\n\n/**\n * Whether the record page offers its sharing section (#2736). Every condition is one the backend also decides, so the\n * section never offers what the verbs would refuse:\n *\n * - the resource separates its records between relationships (`resourceCarriesRelationshipProvenance`) and is not one\n * that issues or attests authority (`RELATIONSHIP_COMMON_RECORDS_FORBIDDEN_RESOURCES`), exactly the share verbs' rule;\n * - the record belongs to the CURRENT organization and that organization's type grants in some relationship kind: the\n * side capability is derived for the current organization, so a record of another organization (a platform operator\n * reading a tenant from the directory) is not offered;\n * - the sharing read and both share verbs are registered in this frontend;\n * - the viewer may perform the read and the share there, by the registry's own roles (organization administrators,\n * which no relationship confers).\n *\n * A resource the backend still declines (a system of record's rows) is found by the read itself, which answers\n * `RELATIONSHIP_RECORD_NOT_SHAREABLE`: the section then stays hidden.\n */\nexport function isRecordSharingOffered(input: {\n readonly registry: FrontendResourcesRegistry | undefined;\n readonly resourceType: string;\n readonly recordId: string | undefined;\n readonly recordOrganizationId: string | undefined;\n readonly currentOrganizationId: string | undefined;\n readonly grants: boolean;\n readonly viewer: LauncherEffectiveRoles;\n}): boolean {\n const configuration = input.registry?.resourceConfigurations[input.resourceType];\n if (!configuration || !resourceCarriesRelationshipProvenance(input.resourceType, configuration.resourcePrimaryScope)) return false;\n if (RELATIONSHIP_COMMON_RECORDS_FORBIDDEN_RESOURCES.includes(input.resourceType)) return false;\n if (!input.recordId || !input.currentOrganizationId || input.recordOrganizationId !== input.currentOrganizationId) return false;\n if (!input.grants) return false;\n const relationshipsScope = input.registry?.resourceConfigurations[CoreResourceType.ORGANIZATION_RELATIONSHIPS]?.resourcePrimaryScope;\n const may = (operation: FrontendResourceConfiguration_Operation | undefined): boolean => !!operation && viewerMayPerformOperation(\n { ...operation, resourceType: CoreResourceType.ORGANIZATION_RELATIONSHIPS, resourcePrimaryScope: relationshipsScope },\n input.viewer,\n );\n return may(findRelationshipOperation(input.registry, OrganizationRelationships_Operations.READ_RECORD_SHARING))\n && may(findRelationshipOperation(input.registry, OrganizationRelationships_Operations.SHARE_RECORD))\n && !!findRelationshipOperation(input.registry, OrganizationRelationships_Operations.UNSHARE_RECORD);\n}\n\n/**\n * The record page's sharing section (#2736): whose the record is, which of the organization's relationships it is\n * shared with, and the administrator's share / withdraw. Mounted by the default read layout beside the danger zone, and\n * hidden wherever {@link isRecordSharingOffered} is false, while the read is in flight, for a resource the backend does\n * not share, and where there is nothing to say: the organization's own record, with no share to withdraw, none to offer\n * and no relationship reading it. A failed read says so and offers nothing.\n *\n * Every claim is the read's answer, decided by the engine per relationship (`describeRelationshipRecordReach`, #2736\n * review N1, N2): a share is offered only to a relationship whose people it would let read the record (#2617: the\n * organization may share one representing organization's record with another), confirmed first when the share verb is\n * risky (HIGH). A relationship that reads the record without a share (the one it was created through, one whose kind\n * reads the organization's own records, every one for a resource declared common) is named as reading it. A share\n * already made is always listed with its withdraw, marked when it changes nothing: its relationship confers nothing\n * now, reads the record anyway, or cannot read this record at all (its roles, or its units, do not reach it).\n */\nexport const ResourceLayoutPreset_RecordSharing_Default = ({\n resourceContext,\n currentObject,\n className,\n responsiveMaxWidth,\n}: ResourceLayoutPreset_RecordSharing_DefaultProps): React.JSX.Element | null => {\n const { resourceType } = resourceContext;\n const { tComponent, formatList } = useI18n({ component: FrontendComponentType.RESOURCES_LAYOUTS_RECORD_SHARING, resource: resourceType });\n // Every word here is a declared label (`ResourceLayout_RecordSharing.labels.ts`); an ungenerated one renders as its key.\n const label = (key: string, params?: Record<string, string>): string => tComponent(FrontendComponentType.RESOURCES_LAYOUTS_RECORD_SHARING, key, params);\n\n // The context itself rather than the throwing hook: a read layout rendered outside the registry provider offers nothing.\n const registry = useContext(ResourceRegistryContext)?.registry;\n const currentOrganizationId = useAppScopeSafe()?.currentOrganizationId ?? undefined;\n const recordId = recordIdOf(currentObject, registry?.resourceConfigurations[resourceType]?.resourceFieldIdentifier);\n // The row's own organization, else the one the page's context names. Never assumed to be the current organization: a\n // record nothing places is not offered (#2736 review F6, N9).\n const recordOrganizationId = (typeof currentObject?.organizationId === 'string' && currentObject.organizationId.length > 0 ? currentObject.organizationId : undefined)\n ?? resolveRecordOrganizationId(resourceType, recordId, resourceContext.contextResourceIdentifiers);\n const viewer = useViewerEffectiveRolesInOrganization(recordOrganizationId);\n const grants = useRelationshipSideCapabilities()[RelationshipSideCapability.GRANTS];\n const offered = isRecordSharingOffered({ registry, resourceType, recordId, recordOrganizationId, currentOrganizationId, grants, viewer });\n\n const sharing = useRecordSharing({ enabled: offered, organizationId: recordOrganizationId, resourceType, recordId });\n const [chosen, setChosenRelationshipId] = useState<string | undefined>(undefined);\n const [confirming, setConfirmingRelationshipId] = useState<string | undefined>(undefined);\n const [busy, setBusy] = useState(false);\n // A choice, and an open confirmation, belong to the record they were made on (#2736 review N6, I4, re-review F1). They\n // are cleared DURING the render that meets another record, which React redoes before committing, so no frame shows\n // them there, and coming back to the first record does not bring them back.\n const recordKey = `${resourceType}|${recordId ?? ''}`;\n const [choiceRecordKey, setChoiceRecordKey] = useState(recordKey);\n if (choiceRecordKey !== recordKey) {\n setChoiceRecordKey(recordKey);\n setChosenRelationshipId(undefined);\n setConfirmingRelationshipId(undefined);\n }\n\n const byId = useMemo(\n () => new Map<string, RecordSharingRelationship>(sharing.relationships.map((relationship) => [relationship.relationshipId, relationship])),\n [sharing.relationships],\n );\n const nameOf = (relationshipId: string): string => byId.get(relationshipId)?.name ?? label('unnamedRelationship');\n const shareable = sharing.relationships.filter((relationship) => relationship.wouldReadIfShared\n && !sharing.sharedWithRelationshipIds.includes(relationship.relationshipId));\n // A choice counts only while the latest answer still offers it, so Share never acts on a relationship the screen no\n // longer offers. Once an answer has SETTLED (not loading, not mid re-read), a choice or an open confirmation it does not\n // offer is CLEARED, during this render, not merely hidden: hidden, a later answer offering the relationship again\n // would bring the choice back and reopen the HIGH-risk confirmation with nobody asking (#2736 re-review R1).\n const isOffered = (relationshipId: string | undefined): relationshipId is string =>\n relationshipId !== undefined && shareable.some((relationship) => relationship.relationshipId === relationshipId);\n // Settled: not another record's read, and not a re-read. The hook keeps the last answer unchanged while it re-reads, so\n // today a re-read never withdraws an offer; the condition is kept so a future hook that does cannot clear a choice the\n // person is still looking at (#2736 re-review C).\n const answerSettled = sharing.readState !== RecordSharingReadState.LOADING && !sharing.refreshing;\n if (answerSettled && chosen !== undefined && !isOffered(chosen)) setChosenRelationshipId(undefined);\n if (answerSettled && confirming !== undefined && !isOffered(confirming)) setConfirmingRelationshipId(undefined);\n // No separate filter at read: React redoes this render with the cleared state before committing it, and while an\n // answer is not settled the last one stays on screen (a re-read) or nothing is shown (another record's read), so a\n // choice the screen does not offer is never drawn.\n const chosenRelationshipId = chosen;\n const confirmingRelationshipId = confirming;\n // Those reading the record without a share, the one it was created through aside: its own line names it.\n const alreadyReading = sharing.relationships.filter((relationship) => relationship.readsWithoutShare\n && relationship.relationshipId !== sharing.viaRelationshipId);\n const conferring = sharing.relationships.filter((relationship) => relationship.confersNow);\n const unreadable = !sharing.commonToEveryRelationship && conferring.length > 0 && conferring.every((relationship) => !relationship.rolesReachRecord);\n const creatingRelationship = sharing.viaRelationshipId === null ? undefined : byId.get(sharing.viaRelationshipId);\n /** Why a share already made changes nothing, when it does not. */\n const shareNote = (relationshipId: string): string | undefined => {\n const relationship = byId.get(relationshipId);\n if (!relationship?.confersNow) return label('relationshipInactive');\n if (relationship.readsWithoutShare) return label('readsWithoutShare');\n if (!relationship.rolesReachRecord) return label('shareHasNoEffect');\n return undefined;\n };\n\n if (!offered) return null;\n if (sharing.readState !== RecordSharingReadState.READY && sharing.readState !== RecordSharingReadState.FAILED) return null;\n // The organization's own record, shared with nobody, offered to nobody and read by no relationship: nothing to say.\n if (sharing.readState === RecordSharingReadState.READY && sharing.viaRelationshipId === null\n && sharing.sharedWithRelationshipIds.length === 0 && shareable.length === 0 && alreadyReading.length === 0) return null;\n\n const disabled = busy || sharing.refreshing;\n const run = (action: () => Promise<void>): void => {\n setBusy(true);\n action()\n .then(() => setChosenRelationshipId(undefined))\n // A refusal was reported by the request's own error handling; the section re-reads either way.\n .catch(() => undefined)\n .finally(() => setBusy(false));\n };\n const shareOperation = findRelationshipOperation(registry, OrganizationRelationships_Operations.SHARE_RECORD);\n const requestShare = (relationshipId: string): void => {\n if (isRiskyResourceOperation(shareOperation?.riskLevel)) setConfirmingRelationshipId(relationshipId);\n else run(() => sharing.share(relationshipId));\n };\n\n return (\n <section\n data-slot=\"record-sharing-section\"\n data-inline-size-tier={responsiveMaxWidth}\n className={cn('mr-auto w-full flex flex-col gap-field-sm', className)}\n style={{ maxInlineSize: responsiveMaxWidthToCssValue(responsiveMaxWidth) }}\n >\n <Heading level={3}>{label('title')}</Heading>\n <Card className=\"rounded-xl p-0 overflow-hidden divide-y divide-border\">\n {sharing.readState === RecordSharingReadState.FAILED ? (\n <div className=\"px-card py-card\">\n <Text variant={TextVariant.MUTED} size={TextSize.SM}>{label('readFailed')}</Text>\n </div>\n ) : (\n <>\n <div className=\"flex flex-col gap-element-xs px-card py-card\">\n <Text size={TextSize.SM}>\n {sharing.viaRelationshipId === null ? label('ownRecord') : label('createdThrough', { relationship: nameOf(sharing.viaRelationshipId) })}\n </Text>\n {sharing.viaRelationshipId !== null && !creatingRelationship?.confersNow && (\n <Text variant={TextVariant.MUTED} size={TextSize.SM}>{label('relationshipInactive')}</Text>\n )}\n {/* It confers, and its people still cannot read the record (#2736 review I6): created through it is not read by it. */}\n {sharing.viaRelationshipId !== null && creatingRelationship?.confersNow && !creatingRelationship.rolesReachRecord && (\n <Text variant={TextVariant.MUTED} size={TextSize.SM}>{label('creatorCannotRead')}</Text>\n )}\n <Text variant={TextVariant.MUTED} size={TextSize.SM}>\n {sharing.commonToEveryRelationship ? label('commonToEveryRelationship') : unreadable ? label('notReadableByRelationships') : label('description')}\n </Text>\n {alreadyReading.length > 0 && !sharing.commonToEveryRelationship && (\n <Text variant={TextVariant.MUTED} size={TextSize.SM}>\n {label('alreadyReadBy', { relationships: formatList(alreadyReading.map((relationship) => nameOf(relationship.relationshipId))) })}\n </Text>\n )}\n </div>\n {sharing.sharedWithRelationshipIds.length === 0 ? (\n <div className=\"px-card py-card\">\n <Text variant={TextVariant.MUTED} size={TextSize.SM}>{label('notShared')}</Text>\n </div>\n ) : sharing.sharedWithRelationshipIds.map((relationshipId) => {\n const note = shareNote(relationshipId);\n return (\n <div\n key={relationshipId}\n data-slot=\"record-sharing-share\"\n className=\"flex flex-col gap-field px-card py-card sm:flex-row sm:items-center sm:justify-between\"\n >\n <div className=\"flex flex-col gap-element-xs\">\n <Strong>{nameOf(relationshipId)}</Strong>\n {note !== undefined && <Text variant={TextVariant.MUTED} size={TextSize.SM}>{note}</Text>}\n </div>\n <Button\n variant={ButtonVariants_Variant.OUTLINE}\n disabled={disabled}\n onClick={() => run(() => sharing.unshare(relationshipId))}\n className=\"shrink-0 self-start sm:self-auto\"\n >\n {label('withdraw')}\n </Button>\n </div>\n );\n })}\n {shareable.length > 0 && (\n <div className=\"flex flex-col gap-field px-card py-card sm:flex-row sm:items-center\">\n <Select\n name=\"recordSharingRelationship\"\n schema={z.string()}\n options={shareable.map((relationship) => ({ value: relationship.relationshipId, label: nameOf(relationship.relationshipId) }))}\n value={chosenRelationshipId}\n onChange={setChosenRelationshipId}\n placeholder={label('chooseRelationship')}\n size={ControlSize.SM}\n disabled={disabled}\n />\n <Button\n variant={ButtonVariants_Variant.SECONDARY}\n disabled={disabled || !chosenRelationshipId}\n onClick={() => { if (chosenRelationshipId) requestShare(chosenRelationshipId); }}\n className=\"shrink-0 self-start sm:self-auto\"\n >\n {label('share')}\n </Button>\n </div>\n )}\n </>\n )}\n </Card>\n {confirmingRelationshipId !== undefined && (\n <OperationsConfirmCritical\n open\n onOpenChange={(open: boolean) => { if (!open) setConfirmingRelationshipId(undefined); }}\n cancelCallback={() => setConfirmingRelationshipId(undefined)}\n validationCallback={() => {\n const relationshipId = confirmingRelationshipId;\n setConfirmingRelationshipId(undefined);\n run(() => sharing.share(relationshipId));\n }}\n label={label('confirmShareTitle', { relationship: nameOf(confirmingRelationshipId) })}\n description={label('confirmShareDescription')}\n confirmLabel={label('share')}\n />\n )}\n </section>\n );\n};\n\nexport function ResourceLayout_RecordSharing({ preset = CorePresetNames.DEFAULT, ...props }: ResourceLayoutPreset_RecordSharing_DefaultProps & ComponentPresetProps): React.JSX.Element {\n const Component = createComponentResolver<ResourceLayoutPreset_RecordSharing_DefaultProps>(FrontendComponentType.RESOURCES_LAYOUTS_RECORD_SHARING, 'ResourceLayout_RecordSharing')(preset);\n return <Component {...props} />;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ResourceLayout_RecordSharing.js","sourceRoot":"","sources":["../../../../src/components/resources/ResourceLayout_RecordSharing.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,gBAAgB,EAChB,oCAAoC,EACpC,+CAA+C,EAC/C,qCAAqC,GACtC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,qBAAqB,EAA2B,MAAM,qCAAqC,CAAC;AAEnI,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAC/F,OAAO,EAAE,MAAM,EAAE,MAAM,0DAA0D,CAAC;AAClF,OAAO,EAAE,IAAI,EAAE,MAAM,8CAA8C,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,mDAAmD,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AACrG,OAAO,EAAE,yBAAyB,EAAE,MAAM,qEAAqE,CAAC;AAChH,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAChE,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,4DAA4D,CAAC;AAErG,OAAO,EAAE,wBAAwB,EAAE,MAAM,uEAAuE,CAAC;AACjH,OAAO,EAAE,2BAA2B,EAAE,MAAM,2EAA2E,CAAC;AACxH,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,gBAAgB,GAEjB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,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AAC,CAAC,CAAC,EAChF,SAAS,EAAC,kCAAkC,YAE3C,KAAK,CAAC,OAAO,CAAC,GACR,IACL,CACP,IACA,CACJ,GACI,EACN,wBAAwB,KAAK,SAAS,IAAI,CACzC,KAAC,yBAAyB,IACxB,IAAI,QACJ,YAAY,EAAE,CAAC,IAAa,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI;oBAAE,2BAA2B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EACvF,cAAc,EAAE,GAAG,EAAE,CAAC,2BAA2B,CAAC,SAAS,CAAC,EAC5D,kBAAkB,EAAE,GAAG,EAAE;oBACvB,MAAM,cAAc,GAAG,wBAAwB,CAAC;oBAChD,2BAA2B,CAAC,SAAS,CAAC,CAAC;oBACvC,GAAG,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;gBAC3C,CAAC,EACD,KAAK,EAAE,KAAK,CAAC,mBAAmB,EAAE,EAAE,YAAY,EAAE,MAAM,CAAC,wBAAwB,CAAC,EAAE,CAAC,EACrF,WAAW,EAAE,KAAK,CAAC,yBAAyB,CAAC,EAC7C,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,GAC5B,CACH,IACO,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,4BAA4B,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,OAAO,EAAE,GAAG,KAAK,EAA0E;IACjK,MAAM,SAAS,GAAG,uBAAuB,CAAkD,qBAAqB,CAAC,gCAAgC,EAAE,8BAA8B,CAAC,CAAC,MAAM,CAAC,CAAC;IAC3L,OAAO,KAAC,SAAS,OAAK,KAAK,GAAI,CAAC;AAClC,CAAC","sourcesContent":["import React, { useContext, useMemo, useState } from 'react';\nimport { z } from 'zod';\n\nimport {\n CoreResourceType,\n OrganizationRelationships_Operations,\n RELATIONSHIP_COMMON_RECORDS_FORBIDDEN_RESOURCES,\n resourceCarriesRelationshipProvenance,\n} from '@wildo-ai/saas-models';\nimport { ControlSize, CorePresetNames, FrontendComponentType, type ResponsiveMaxWidth } from '@wildo-ai/presets-components-models';\n\nimport { Button, ButtonVariants_Variant } from '~wildo-frontend-lib/components/actions/button';\nimport { Select } from '~wildo-frontend-lib/components/form/controls/enum/select';\nimport { Card } from '~wildo-frontend-lib/components/sections/card';\nimport { optionalMaxInlineSizeStyle } from '~wildo-frontend-lib/components/sections/surface';\nimport { Heading } from '~wildo-frontend-lib/components/typography/heading';\nimport { Strong, Text, TextSize, TextVariant } from '~wildo-frontend-lib/components/typography/text';\nimport { OperationsConfirmCritical } from '~wildo-frontend-lib/components/feedback/operations-confirm-critical';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { ResourceRegistryContext } from '~wildo-frontend-lib/core/resources/ResourceRegistryContext';\nimport type { FrontendResourceConfiguration_Operation, FrontendResourcesRegistry } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { isRiskyResourceOperation } from '~wildo-frontend-lib/core/resources/operation-semantics.frontend.utils';\nimport { resolveRecordOrganizationId } from '~wildo-frontend-lib/core/resources/resource-addressability.frontend.utils';\nimport {\n RecordSharingReadState,\n findRelationshipOperation,\n useRecordSharing,\n type RecordSharingRelationship,\n} from '~wildo-frontend-lib/core/resources/useRecordSharing';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { useRelationshipSideCapabilities, useViewerEffectiveRolesInOrganization } from '~wildo-frontend-lib/core/navigation/launcher-runtime-availability';\nimport { viewerMayPerformOperation, type LauncherEffectiveRoles } from '~wildo-frontend-lib/core/navigation/launcher-resolution';\nimport { RelationshipSideCapability } from '~wildo-frontend-lib/core/config/relationship-side-capabilities.frontend.utils';\nimport { ComponentPresetProps } from '~wildo-frontend-lib/core/components-registry/component-registry.frontend.schemas';\nimport { createComponentResolver } from '~wildo-frontend-lib/core/components-registry/component-resolver.frontend.helper';\nimport { BaseResourcesLayoutProps } from './component-props.resources-layout.frontend.schemas';\n\n// --- Contract ---\nexport interface ResourceLayoutPreset_RecordSharing_DefaultProps extends BaseResourcesLayoutProps {\n /** The loaded record: its id names the record the sharing is about. */\n currentObject?: Record<string, any>;\n className?: string;\n /** How wide the section may grow, in the framework's shared width vocabulary; unset, the host decides (as the danger zone). */\n responsiveMaxWidth?: ResponsiveMaxWidth;\n}\n\n/** The record's id as the read page loaded it: `_id`, else the resource's own identifier field. */\nfunction recordIdOf(currentObject: Record<string, unknown> | undefined, resourceFieldIdentifier: string | undefined): string | undefined {\n const candidate = currentObject?._id ?? (resourceFieldIdentifier ? currentObject?.[resourceFieldIdentifier] : undefined);\n return (typeof candidate === 'string' || typeof candidate === 'number') && String(candidate).length > 0 ? String(candidate) : undefined;\n}\n\n/**\n * Whether the record page offers its sharing section (#2736). Every condition is one the backend also decides, so the\n * section never offers what the verbs would refuse:\n *\n * - the resource separates its records between relationships (`resourceCarriesRelationshipProvenance`) and is not one\n * that issues or attests authority (`RELATIONSHIP_COMMON_RECORDS_FORBIDDEN_RESOURCES`), exactly the share verbs' rule;\n * - the record belongs to the CURRENT organization and that organization's type grants in some relationship kind: the\n * side capability is derived for the current organization, so a record of another organization (a platform operator\n * reading a tenant from the directory) is not offered;\n * - the sharing read and both share verbs are registered in this frontend;\n * - the viewer may perform the read and the share there, by the registry's own roles (organization administrators,\n * which no relationship confers).\n *\n * A resource the backend still declines (a system of record's rows) is found by the read itself, which answers\n * `RELATIONSHIP_RECORD_NOT_SHAREABLE`: the section then stays hidden.\n */\nexport function isRecordSharingOffered(input: {\n readonly registry: FrontendResourcesRegistry | undefined;\n readonly resourceType: string;\n readonly recordId: string | undefined;\n readonly recordOrganizationId: string | undefined;\n readonly currentOrganizationId: string | undefined;\n readonly grants: boolean;\n readonly viewer: LauncherEffectiveRoles;\n}): boolean {\n const configuration = input.registry?.resourceConfigurations[input.resourceType];\n if (!configuration || !resourceCarriesRelationshipProvenance(input.resourceType, configuration.resourcePrimaryScope)) return false;\n if (RELATIONSHIP_COMMON_RECORDS_FORBIDDEN_RESOURCES.includes(input.resourceType)) return false;\n if (!input.recordId || !input.currentOrganizationId || input.recordOrganizationId !== input.currentOrganizationId) return false;\n if (!input.grants) return false;\n const relationshipsScope = input.registry?.resourceConfigurations[CoreResourceType.ORGANIZATION_RELATIONSHIPS]?.resourcePrimaryScope;\n const may = (operation: FrontendResourceConfiguration_Operation | undefined): boolean => !!operation && viewerMayPerformOperation(\n { ...operation, resourceType: CoreResourceType.ORGANIZATION_RELATIONSHIPS, resourcePrimaryScope: relationshipsScope },\n input.viewer,\n );\n return may(findRelationshipOperation(input.registry, OrganizationRelationships_Operations.READ_RECORD_SHARING))\n && may(findRelationshipOperation(input.registry, OrganizationRelationships_Operations.SHARE_RECORD))\n && !!findRelationshipOperation(input.registry, OrganizationRelationships_Operations.UNSHARE_RECORD);\n}\n\n/**\n * The record page's sharing section (#2736): whose the record is, which of the organization's relationships it is\n * shared with, and the administrator's share / withdraw. Mounted by the default read layout beside the danger zone, and\n * hidden wherever {@link isRecordSharingOffered} is false, while the read is in flight, for a resource the backend does\n * not share, and where there is nothing to say: the organization's own record, with no share to withdraw, none to offer\n * and no relationship reading it. A failed read says so and offers nothing.\n *\n * Every claim is the read's answer, decided by the engine per relationship (`describeRelationshipRecordReach`, #2736\n * review N1, N2): a share is offered only to a relationship whose people it would let read the record (#2617: the\n * organization may share one representing organization's record with another), confirmed first when the share verb is\n * risky (HIGH). A relationship that reads the record without a share (the one it was created through, one whose kind\n * reads the organization's own records, every one for a resource declared common) is named as reading it. A share\n * already made is always listed with its withdraw, marked when it changes nothing: its relationship confers nothing\n * now, reads the record anyway, or cannot read this record at all (its roles, or its units, do not reach it).\n */\nexport const ResourceLayoutPreset_RecordSharing_Default = ({\n resourceContext,\n currentObject,\n className,\n responsiveMaxWidth,\n}: ResourceLayoutPreset_RecordSharing_DefaultProps): React.JSX.Element | null => {\n const { resourceType } = resourceContext;\n const { tComponent, formatList } = useI18n({ component: FrontendComponentType.RESOURCES_LAYOUTS_RECORD_SHARING, resource: resourceType });\n // Every word here is a declared label (`ResourceLayout_RecordSharing.labels.ts`); an ungenerated one renders as its key.\n const label = (key: string, params?: Record<string, string>): string => tComponent(FrontendComponentType.RESOURCES_LAYOUTS_RECORD_SHARING, key, params);\n\n // The context itself rather than the throwing hook: a read layout rendered outside the registry provider offers nothing.\n const registry = useContext(ResourceRegistryContext)?.registry;\n const currentOrganizationId = useAppScopeSafe()?.currentOrganizationId ?? undefined;\n const recordId = recordIdOf(currentObject, registry?.resourceConfigurations[resourceType]?.resourceFieldIdentifier);\n // The row's own organization, else the one the page's context names. Never assumed to be the current organization: a\n // record nothing places is not offered (#2736 review F6, N9).\n const recordOrganizationId = (typeof currentObject?.organizationId === 'string' && currentObject.organizationId.length > 0 ? currentObject.organizationId : undefined)\n ?? resolveRecordOrganizationId(resourceType, recordId, resourceContext.contextResourceIdentifiers);\n const viewer = useViewerEffectiveRolesInOrganization(recordOrganizationId);\n const grants = useRelationshipSideCapabilities()[RelationshipSideCapability.GRANTS];\n const offered = isRecordSharingOffered({ registry, resourceType, recordId, recordOrganizationId, currentOrganizationId, grants, viewer });\n\n const sharing = useRecordSharing({ enabled: offered, organizationId: recordOrganizationId, resourceType, recordId });\n const [chosen, setChosenRelationshipId] = useState<string | undefined>(undefined);\n const [confirming, setConfirmingRelationshipId] = useState<string | undefined>(undefined);\n const [busy, setBusy] = useState(false);\n // A choice, and an open confirmation, belong to the record they were made on (#2736 review N6, I4, re-review F1). They\n // are cleared DURING the render that meets another record, which React redoes before committing, so no frame shows\n // them there, and coming back to the first record does not bring them back.\n const recordKey = `${resourceType}|${recordId ?? ''}`;\n const [choiceRecordKey, setChoiceRecordKey] = useState(recordKey);\n if (choiceRecordKey !== recordKey) {\n setChoiceRecordKey(recordKey);\n setChosenRelationshipId(undefined);\n setConfirmingRelationshipId(undefined);\n }\n\n const byId = useMemo(\n () => new Map<string, RecordSharingRelationship>(sharing.relationships.map((relationship) => [relationship.relationshipId, relationship])),\n [sharing.relationships],\n );\n const nameOf = (relationshipId: string): string => byId.get(relationshipId)?.name ?? label('unnamedRelationship');\n const shareable = sharing.relationships.filter((relationship) => relationship.wouldReadIfShared\n && !sharing.sharedWithRelationshipIds.includes(relationship.relationshipId));\n // A choice counts only while the latest answer still offers it, so Share never acts on a relationship the screen no\n // longer offers. Once an answer has SETTLED (not loading, not mid re-read), a choice or an open confirmation it does not\n // offer is CLEARED, during this render, not merely hidden: hidden, a later answer offering the relationship again\n // would bring the choice back and reopen the HIGH-risk confirmation with nobody asking (#2736 re-review R1).\n const isOffered = (relationshipId: string | undefined): relationshipId is string =>\n relationshipId !== undefined && shareable.some((relationship) => relationship.relationshipId === relationshipId);\n // Settled: not another record's read, and not a re-read. The hook keeps the last answer unchanged while it re-reads, so\n // today a re-read never withdraws an offer; the condition is kept so a future hook that does cannot clear a choice the\n // person is still looking at (#2736 re-review C).\n const answerSettled = sharing.readState !== RecordSharingReadState.LOADING && !sharing.refreshing;\n if (answerSettled && chosen !== undefined && !isOffered(chosen)) setChosenRelationshipId(undefined);\n if (answerSettled && confirming !== undefined && !isOffered(confirming)) setConfirmingRelationshipId(undefined);\n // No separate filter at read: React redoes this render with the cleared state before committing it, and while an\n // answer is not settled the last one stays on screen (a re-read) or nothing is shown (another record's read), so a\n // choice the screen does not offer is never drawn.\n const chosenRelationshipId = chosen;\n const confirmingRelationshipId = confirming;\n // Those reading the record without a share, the one it was created through aside: its own line names it.\n const alreadyReading = sharing.relationships.filter((relationship) => relationship.readsWithoutShare\n && relationship.relationshipId !== sharing.viaRelationshipId);\n const conferring = sharing.relationships.filter((relationship) => relationship.confersNow);\n const unreadable = !sharing.commonToEveryRelationship && conferring.length > 0 && conferring.every((relationship) => !relationship.rolesReachRecord);\n const creatingRelationship = sharing.viaRelationshipId === null ? undefined : byId.get(sharing.viaRelationshipId);\n /** Why a share already made changes nothing, when it does not. */\n const shareNote = (relationshipId: string): string | undefined => {\n const relationship = byId.get(relationshipId);\n if (!relationship?.confersNow) return label('relationshipInactive');\n if (relationship.readsWithoutShare) return label('readsWithoutShare');\n if (!relationship.rolesReachRecord) return label('shareHasNoEffect');\n return undefined;\n };\n\n if (!offered) return null;\n if (sharing.readState !== RecordSharingReadState.READY && sharing.readState !== RecordSharingReadState.FAILED) return null;\n // The organization's own record, shared with nobody, offered to nobody and read by no relationship: nothing to say.\n if (sharing.readState === RecordSharingReadState.READY && sharing.viaRelationshipId === null\n && sharing.sharedWithRelationshipIds.length === 0 && shareable.length === 0 && alreadyReading.length === 0) return null;\n\n const disabled = busy || sharing.refreshing;\n const run = (action: () => Promise<void>): void => {\n setBusy(true);\n action()\n .then(() => setChosenRelationshipId(undefined))\n // A refusal was reported by the request's own error handling; the section re-reads either way.\n .catch(() => undefined)\n .finally(() => setBusy(false));\n };\n const shareOperation = findRelationshipOperation(registry, OrganizationRelationships_Operations.SHARE_RECORD);\n const requestShare = (relationshipId: string): void => {\n if (isRiskyResourceOperation(shareOperation?.riskLevel)) setConfirmingRelationshipId(relationshipId);\n else run(() => sharing.share(relationshipId));\n };\n\n return (\n <section\n data-slot=\"record-sharing-section\"\n data-inline-size-tier={responsiveMaxWidth}\n className={cn('mr-auto w-full flex flex-col gap-field-sm', className)}\n style={optionalMaxInlineSizeStyle(responsiveMaxWidth)}\n >\n <Heading level={3}>{label('title')}</Heading>\n <Card className=\"rounded-xl p-0 overflow-hidden divide-y divide-border\">\n {sharing.readState === RecordSharingReadState.FAILED ? (\n <div className=\"px-card py-card\">\n <Text variant={TextVariant.MUTED} size={TextSize.SM}>{label('readFailed')}</Text>\n </div>\n ) : (\n <>\n <div className=\"flex flex-col gap-element-xs px-card py-card\">\n <Text size={TextSize.SM}>\n {sharing.viaRelationshipId === null ? label('ownRecord') : label('createdThrough', { relationship: nameOf(sharing.viaRelationshipId) })}\n </Text>\n {sharing.viaRelationshipId !== null && !creatingRelationship?.confersNow && (\n <Text variant={TextVariant.MUTED} size={TextSize.SM}>{label('relationshipInactive')}</Text>\n )}\n {/* It confers, and its people still cannot read the record (#2736 review I6): created through it is not read by it. */}\n {sharing.viaRelationshipId !== null && creatingRelationship?.confersNow && !creatingRelationship.rolesReachRecord && (\n <Text variant={TextVariant.MUTED} size={TextSize.SM}>{label('creatorCannotRead')}</Text>\n )}\n <Text variant={TextVariant.MUTED} size={TextSize.SM}>\n {sharing.commonToEveryRelationship ? label('commonToEveryRelationship') : unreadable ? label('notReadableByRelationships') : label('description')}\n </Text>\n {alreadyReading.length > 0 && !sharing.commonToEveryRelationship && (\n <Text variant={TextVariant.MUTED} size={TextSize.SM}>\n {label('alreadyReadBy', { relationships: formatList(alreadyReading.map((relationship) => nameOf(relationship.relationshipId))) })}\n </Text>\n )}\n </div>\n {sharing.sharedWithRelationshipIds.length === 0 ? (\n <div className=\"px-card py-card\">\n <Text variant={TextVariant.MUTED} size={TextSize.SM}>{label('notShared')}</Text>\n </div>\n ) : sharing.sharedWithRelationshipIds.map((relationshipId) => {\n const note = shareNote(relationshipId);\n return (\n <div\n key={relationshipId}\n data-slot=\"record-sharing-share\"\n className=\"flex flex-col gap-field px-card py-card sm:flex-row sm:items-center sm:justify-between\"\n >\n <div className=\"flex flex-col gap-element-xs\">\n <Strong>{nameOf(relationshipId)}</Strong>\n {note !== undefined && <Text variant={TextVariant.MUTED} size={TextSize.SM}>{note}</Text>}\n </div>\n <Button\n variant={ButtonVariants_Variant.OUTLINE}\n disabled={disabled}\n onClick={() => run(() => sharing.unshare(relationshipId))}\n className=\"shrink-0 self-start sm:self-auto\"\n >\n {label('withdraw')}\n </Button>\n </div>\n );\n })}\n {shareable.length > 0 && (\n <div className=\"flex flex-col gap-field px-card py-card sm:flex-row sm:items-center\">\n <Select\n name=\"recordSharingRelationship\"\n schema={z.string()}\n options={shareable.map((relationship) => ({ value: relationship.relationshipId, label: nameOf(relationship.relationshipId) }))}\n value={chosenRelationshipId}\n onChange={setChosenRelationshipId}\n placeholder={label('chooseRelationship')}\n size={ControlSize.SM}\n disabled={disabled}\n />\n <Button\n variant={ButtonVariants_Variant.SECONDARY}\n disabled={disabled || !chosenRelationshipId}\n onClick={() => { if (chosenRelationshipId) requestShare(chosenRelationshipId); }}\n className=\"shrink-0 self-start sm:self-auto\"\n >\n {label('share')}\n </Button>\n </div>\n )}\n </>\n )}\n </Card>\n {confirmingRelationshipId !== undefined && (\n <OperationsConfirmCritical\n open\n onOpenChange={(open: boolean) => { if (!open) setConfirmingRelationshipId(undefined); }}\n cancelCallback={() => setConfirmingRelationshipId(undefined)}\n validationCallback={() => {\n const relationshipId = confirmingRelationshipId;\n setConfirmingRelationshipId(undefined);\n run(() => sharing.share(relationshipId));\n }}\n label={label('confirmShareTitle', { relationship: nameOf(confirmingRelationshipId) })}\n description={label('confirmShareDescription')}\n confirmLabel={label('share')}\n />\n )}\n </section>\n );\n};\n\nexport function ResourceLayout_RecordSharing({ preset = CorePresetNames.DEFAULT, ...props }: ResourceLayoutPreset_RecordSharing_DefaultProps & ComponentPresetProps): React.JSX.Element {\n const Component = createComponentResolver<ResourceLayoutPreset_RecordSharing_DefaultProps>(FrontendComponentType.RESOURCES_LAYOUTS_RECORD_SHARING, 'ResourceLayout_RecordSharing')(preset);\n return <Component {...props} />;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceListItemRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components/resources/ResourceListItemRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,KAAK,EAAE,gCAAgC,EAAE,yBAAyB,EAAE,MAAM,+DAA+D,CAAC;AAkBjJ,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,+DAA+D,CAAC;
|
|
1
|
+
{"version":3,"file":"ResourceListItemRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components/resources/ResourceListItemRenderer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AAG,CAAC,OAAO,GAAG,IAAI,CAwDpD;AAMD,wBAAgB,wBAAwB,CAAC,EACvC,IAAI,EACJ,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,oCAAoC,EACpC,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,UAAkB,EAClB,UAAkB,EAClB,cAAc,EACd,eAAuB,EACvB,eAAe,EACf,SAAS,EACT,kBAAkB,GACnB,EAAE,6BAA6B,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAqSnD"}
|
|
@@ -29,6 +29,7 @@ import { useI18n } from '../../core/i18n/useI18n.js';
|
|
|
29
29
|
import { AutomatedLayoutFrontendUtils } from '../../core/automated-layout/automated-layout.frontend.utils.js';
|
|
30
30
|
import { resolveResourceLabelEnumSchema } from '../../core/resources/resource-label-field-paths.frontend.utils.js';
|
|
31
31
|
import { cn } from '../../core/ui/cn.js';
|
|
32
|
+
import { activationStartedOnInnerControl } from '../../core/ui/inner-control-activation.utils.js';
|
|
32
33
|
import { focusIndicatorClasses, FocusIndicatorShape } from '../../core/ui/themes/focus-indicator.js';
|
|
33
34
|
import { CheckboxRoot } from '../../components/form/controls/boolean/checkbox.js';
|
|
34
35
|
import { CARD_ROW_PADDING_CLASS, CARD_SELECTION_RAIL_CLASS, CARD_SELECTION_REVEAL_CLASS, CARD_SELECTION_SLOT_CLASS, } from '../../components/resources/collection-card-layout.utils.js';
|
|
@@ -293,7 +294,11 @@ export function ResourceListItemRenderer({ item, resourceType, resourceConfig, r
|
|
|
293
294
|
// Both only when a click leads somewhere — see `isActivatable`.
|
|
294
295
|
isActivatable && hoverClass, isActivatable && 'cursor-pointer', isSelected && 'bg-primary/5',
|
|
295
296
|
// Prevent the browser text-selection that a long-press would start.
|
|
296
|
-
selectable && 'select-none', className),
|
|
297
|
+
selectable && 'select-none', className),
|
|
298
|
+
// A click on a control inside the card (a reference to another record, a link) is that control's: the card
|
|
299
|
+
// opens only for a click on its own text or space (`activationStartedOnInnerControl`).
|
|
300
|
+
onClick: isActivatable ? (e) => { if (!activationStartedOnInnerControl(e))
|
|
301
|
+
handleActivate(); } : undefined, ...longPress.handlers, children: [isActivatable && (_jsx("button", { type: "button", "aria-label": String(primaryLabel),
|
|
297
302
|
// Selection state is conveyed by the row's checkbox; the bg tint is a purely visual
|
|
298
303
|
// reinforcement, and `aria-pressed` would misdescribe a button that OPENS the record.
|
|
299
304
|
className: cn("absolute inset-0 rounded-[inherit] outline-none", focusIndicatorClasses(FocusIndicatorShape.INSET)), onClick: (e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceListItemRenderer.js","sourceRoot":"","sources":["../../../../src/components/resources/ResourceListItemRenderer.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAe,MAAM,OAAO,CAAC;AAEpD,OAAO,EAGL,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,8BAA8B,EAAE,aAAa,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC/I,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,uDAAuD,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,0DAA0D,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,0EAA0E,CAAC;AACjH,OAAO,EAAE,wBAAwB,EAAE,6BAA6B,EAAE,MAAM,sEAAsE,CAAC;AAC/I,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAoC,MAAM,uEAAuE,CAAC;AAC5K,OAAO,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,+DAA+D,CAAC;AAC5F,OAAO,EAAE,IAAI,EAAE,MAAM,gDAAgD,CAAC;AACtE,OA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EAC1E,uBAAuB,EAAE,uBAAuB,IAT3C,SAAS,CAUd,CACH,CAAC;4CACJ,CAAC,CAAC,GACU,CACf,IACA,CACJ,GACG,EACL,cAAc,IAAI;4BACjB,qEAAqE;4BACrE,sEAAsE;4BACtE,sEAAsE;4BACtE,mCAAmC;4BACnC,cACE,SAAS,EAAE,SAAS,CAAC,YAAY,EACjC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACnC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EACrC,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,YAEvC,cAAc,GACX,CACP,IACG,IACF,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["/**\n * ResourceListItemRenderer\n *\n * Shared item renderer for List and Search presets.\n * Encapsulates schema-aware field rendering (FK, enum, date, array),\n * primary/secondary field split, and per-item operations.\n *\n * Used by List_Default and Search_Default to ensure parity in how\n * resource items are displayed.\n */\n\nimport React, { useMemo, useCallback } from 'react';\nimport { z } from 'zod';\nimport {\n CoreResourceOperation,\n ResourceOperationDisplayMode,\n ErrorCustomMessageReference,\n} from '@wildo-ai/saas-models';\nimport type { AnyFrontendResourceConfiguration, FrontendResourcesRegistry } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { getEnumValues, getFieldUISummaryDisplayConfig, getSchemaType, DisplayChromeMode, ViewportBreakpoint } from '@wildo-ai/zod-decorators';\nimport { UIContext } from '~wildo-frontend-lib/core/ui/UIContext';\nimport { useLongPress } from '~wildo-frontend-lib/components/resources/useLongPress';\nimport { DisplayField } from '~wildo-frontend-lib/components/data-display/DisplayField';\nimport { DisplayChromeProvider } from '~wildo-frontend-lib/components/data-display/chromes/DisplayChromeContext';\nimport { ResourceSummaryDisplayer, buildSummaryRecordIdentifiers } from '~wildo-frontend-lib/components/data-display/ResourceSummaryDisplayer';\nimport { ResourceDisplayContext, useResourceDisplayContext, type ResourceDisplayContextValue } from '~wildo-frontend-lib/components/data-display/automatic-displayer.utils';\nimport { useResourceRegistrySafe } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { SummaryMeta } from '~wildo-frontend-lib/components/resources/skeleton/SummaryMeta';\nimport { Text } from '~wildo-frontend-lib/components/typography/text';\nimport { TextSize, TextVariant } from '@wildo-ai/presets-components-models';\nimport { isPresentSummaryValue, summaryValueNamesShown } from '~wildo-frontend-lib/core/automated-layout/summary-value-naming.utils';\nimport { resolveDeclaredDisplayChromeMode } from '~wildo-frontend-lib/components/data-display/chromes/display-chrome-mode-resolution';\nimport { FrontendResourceUtils, frontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { AutomatedLayoutFrontendUtils } from '~wildo-frontend-lib/core/automated-layout/automated-layout.frontend.utils';\nimport { resolveResourceLabelEnumSchema } from '~wildo-frontend-lib/core/resources/resource-label-field-paths.frontend.utils';\nimport type { FrontendResourceOperationContext } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { focusIndicatorClasses, FocusIndicatorShape } from '~wildo-frontend-lib/core/ui/themes/focus-indicator';\nimport { CheckboxRoot } from '~wildo-frontend-lib/components/form/controls/boolean/checkbox';\nimport {\n CARD_ROW_PADDING_CLASS,\n CARD_SELECTION_RAIL_CLASS,\n CARD_SELECTION_REVEAL_CLASS,\n CARD_SELECTION_SLOT_CLASS,\n} from '~wildo-frontend-lib/components/resources/collection-card-layout.utils';\nimport type { CardActionPlacement } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { resolveCardActionPlacementClasses } from './card-action-placement.utils';\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\nexport interface ResourceListItemRendererProps {\n /** The data item to render */\n item: Record<string, unknown>;\n /** Resource type */\n resourceType: string;\n /** Resource configuration */\n resourceConfig: AnyFrontendResourceConfiguration;\n /** Resource registry */\n registry: FrontendResourcesRegistry;\n /**\n * The collection's resource identifiers (its route scope and parents). An authored summary template reads its\n * fields in them, with the row and its own primary scope added (`buildSummaryRecordIdentifiers`, #2198).\n */\n collectionContextResourceIdentifiers?: FrontendResourceOperationContext['contextResourceIdentifiers'];\n /** Ordered list of summary fields to display */\n summaryFields: string[];\n /** Pre-resolved field labels (from i18n) */\n fieldLabelsMap: Record<string, string>;\n /** Function to resolve enum display values via i18n — `fieldSchema` names the enum the field declares (#966) */\n tResourceFieldEnumValue: (resourceType: string, fieldName: string, enumValue: string, fieldSchema: z.ZodTypeAny | undefined) => string;\n /**\n * What a click on the row does — and, by its ABSENCE, that a click does nothing.\n *\n * Optional since 2026-09-20, and the optionality is the point. The card used to take this\n * REQUIRED and paint itself `cursor-pointer` + `role=\"button\"` + `tabIndex={0}` unconditionally,\n * so every summary row in the product announced itself as a button. Whether the click could act\n * was decided somewhere else entirely — in the host, by whether a READ operation resolves to a\n * view — and the two were never compared. On the audit trail the answer was \"it cannot\", so the\n * row invited a click, took focus, answered Enter and Space, and did nothing at any of them.\n *\n * A host that cannot open a row now omits this, and the affordance disappears with the behaviour\n * because both are read off the same value.\n */\n onItemClick?: (item: Record<string, unknown>) => void;\n /** Optional operations component to render for this item */\n operationsSlot?: React.ReactNode;\n /**\n * Where the per-item operations sit within the card (2-axis anchor +\n * orientation). Resolved by the host from `collectionDisplayConfig.cardActionPlacement`.\n * Omitted → the default (inline-end, vertically centered, horizontal row).\n */\n cardActionPlacement?: CardActionPlacement;\n /**\n * Selection affordance. When `selectable`, a leading checkbox renders and\n * toggles selection via `onToggleSelect` (independent of the row click, which\n * still navigates). `isSelected` drives the checkbox + a selected highlight.\n */\n selectable?: boolean;\n isSelected?: boolean;\n onToggleSelect?: (item: Record<string, unknown>) => void;\n /**\n * Whether the collection is currently in SELECTION MODE (any item selected).\n * Mobile UX: a long-press enters selection mode, and while active a plain TAP\n * toggles selection instead of navigating (the \"long-press to multi-select\"\n * pattern). Gated to touch/mobile — on desktop a click always navigates and\n * the checkbox is the explicit toggle.\n */\n selectionActive?: boolean;\n /** Accessible label for the selection checkbox (host provides the i18n string). */\n selectAriaLabel?: string;\n /** Optional className for the root container */\n className?: string;\n /** Interactive CSS classes from design system (hover state, transition) */\n interactiveClasses?: {\n hover?: string;\n transition?: string;\n };\n}\n\n// =============================================================================\n// FIELD VALUE RENDERER\n// =============================================================================\n\n/** A collection cell is read-only: the row's inline edit belongs to the row's own page, never to a cell. */\nconst refuseCellInlineUpdate = async (): Promise<void> => {\n throw new Error('A collection cell does not edit in place.');\n};\n\n/**\n * The display context a collection CELL reads in: its ROW, in the row's scope (#2347).\n *\n * A reference display fetches and links its target with the display context's identifiers and parameters. A\n * collection mounts no context, so a cell inherited the page's — none on a list page — and every reference to a\n * scope-junction peer (a user, through organization membership) lost the scope that selects its confined door.\n * The identifiers are built exactly as a summary template's are (`buildSummaryRecordIdentifiers`), so a card's\n * template and a table cell of the same row read a reference the same way.\n *\n * Everything that is the PAGE's record rather than the row's is dropped: its inline-edit write path, its mutation\n * manager and its upload endpoints would act on the page's record. What describes the surface (the zone, the parent\n * reference posture, the empty-value strategy) is kept. With no registry in reach (an isolated render) the cell\n * keeps the inherited context, as before.\n */\nfunction useRecordScopedDisplayContext(input: {\n resourceType: string;\n record: Record<string, unknown> | undefined;\n collectionContextResourceIdentifiers: FrontendResourceOperationContext['contextResourceIdentifiers'] | undefined;\n}): ResourceDisplayContextValue {\n const inherited = useResourceDisplayContext();\n const registryContext = useResourceRegistrySafe();\n const registry = registryContext?.registry;\n const { resourceType, record, collectionContextResourceIdentifiers } = input;\n return useMemo(() => {\n if (!registry || !record) return inherited;\n const identifiers = buildSummaryRecordIdentifiers({\n resourceType,\n resourceConfig: registry.resourceConfigurations[resourceType],\n data: record,\n hostIdentifiers: collectionContextResourceIdentifiers ?? inherited.contextResourceIdentifiers,\n });\n return {\n ...inherited,\n resourceType,\n resourceId: frontendResourceUtils.getResourceId(identifiers[resourceType]) || undefined,\n contextResourceIdentifiers: identifiers,\n contextualParameters: FrontendResourceUtils.buildContextualParameters(identifiers, registry),\n canInlineEdit: false,\n doInlineUpdate: refuseCellInlineUpdate,\n defaultInlineEdit: undefined,\n fileUploadContext: undefined,\n rmm: null,\n };\n }, [inherited, registry, record, resourceType, collectionContextResourceIdentifiers]);\n}\n\nexport interface FieldValueRendererProps {\n fieldName: string;\n value: unknown;\n fieldSchema: z.ZodTypeAny | undefined;\n fieldLabel: string | undefined;\n resourceType: string;\n tResourceFieldEnumValue: (resourceType: string, fieldName: string, enumValue: string, fieldSchema: z.ZodTypeAny | undefined) => string;\n /**\n * The whole record this cell belongs to, forwarded to the dispatcher as `parentData`.\n *\n * Optional so a caller rendering a bare value is unaffected — but every collection caller passes\n * it, because a field frequently needs a sibling to render correctly and a cell that does not know\n * its row cannot reach one.\n */\n record?: Record<string, unknown>;\n /**\n * The COLLECTION's resource identifiers (its route scope and parents), when the caller has them.\n *\n * With `record`, they decide where the cell's references are fetched and linked: the cell reads in its ROW's\n * identifiers (`buildSummaryRecordIdentifiers` — the host's, then the row's own primary scope, then the row), the\n * shape a summary template already reads in (#2198). A collection mounts no display context of its own, so a cell\n * used to inherit the PAGE's, which on a list page is none: a reference to a user reached the users READ (a user\n * reads only themselves) instead of the organization's people search, and a table of the representatives' activity\n * (retired with that feed, #2592) named its representative by a raw user id (#2347). Absent, the inherited context's identifiers are the host's.\n */\n collectionContextResourceIdentifiers?: FrontendResourceOperationContext['contextResourceIdentifiers'];\n /**\n * Show `fieldLabel` beside the value: under a declared summary chrome that shows a name, or, when none\n * is declared, for a value that cannot speak for itself on a card (a boolean, a bare number, a second\n * date — `summaryValueNamesShown`). Otherwise the name is for assistive technology only.\n */\n fieldLabelVisible?: boolean;\n}\n\n/**\n * Renders a single summary field VALUE through the shared decorator-driven\n * display pipeline (`DisplayField` → `DisplayValueDispatcher` → presets) — the\n * SAME path the detail/read view uses — so the FULL zod-UI display policy is\n * honored in lists/tables by default: enum → badge (+ per-value colors),\n * boolean → checkmark / yes-no, string → truncate / multiline, FK → reference,\n * date → formatted, money/bigdecimal/duration/etc.\n *\n * Previously this re-implemented a weak subset (enum-as-plain-text, naive array\n * join, `String(value)` fallback) that silently ignored every\n * `{primitive}UI().display` decorator, so listings/tables diverged from the\n * detail view (e.g. a `displayMode: BADGE` enum rendered as plain text). Routing\n * through `DisplayField` removes that divergence and the maintenance burden of a\n * parallel renderer.\n *\n * The card and the table (column header) own the label, so the value is rendered\n * under COMPACT chrome — a bare value with no framework label/description wrapper.\n * The card names a value with a visually hidden name, or a visible one for a value\n * that cannot speak for itself (`fieldLabelVisible`). i18n enum labels are threaded explicitly via\n * `enumLabels` because there is no surrounding `DisplayTemplateContext`\n * (which is what supplies them inside `AutomaticDisplayer`).\n */\nexport function FieldValueRenderer({\n fieldName,\n value,\n fieldSchema,\n fieldLabel,\n resourceType,\n record,\n collectionContextResourceIdentifiers,\n tResourceFieldEnumValue,\n fieldLabelVisible = false,\n}: FieldValueRendererProps): React.JSX.Element | null {\n const recordDisplayContext = useRecordScopedDisplayContext({ resourceType, record, collectionContextResourceIdentifiers });\n // Build the enum value→label map from the same i18n translator the list\n // already uses, so enum badges show translated labels rather than raw enum\n // values. Hook runs unconditionally, before the null-value early return.\n //\n // The vocabulary is read off the ENUM-BEARING schema — the field, or an array's element — through the\n // resolver the detail views and the labelling planner share. Asking only \"is the field itself an enum\"\n // left every array of an enum raw in a list or a table: a member directory printed `ORG_MEMBER` while\n // the same roles read \"Organization member\" on the member's own page.\n const enumLabels = useMemo<Record<string, string> | undefined>(() => {\n const enumSchema = fieldSchema ? resolveResourceLabelEnumSchema(fieldSchema) : undefined;\n if (!enumSchema) return undefined;\n const enumValues = getEnumValues(enumSchema);\n if (enumValues.length === 0) return undefined;\n return Object.fromEntries(\n enumValues.map((enumValue) => [enumValue, tResourceFieldEnumValue(resourceType, fieldName, enumValue, fieldSchema)]),\n );\n }, [fieldSchema, resourceType, fieldName, tResourceFieldEnumValue]);\n\n if (value === null || value === undefined) return null;\n\n return (\n <div className=\"flex min-w-0 items-baseline gap-element-sm\">\n {/* A card shows the VALUE; its name is for assistive technology only. A summary is bare,\n self-describing values (the record's own page names its facts), and a visible \"Label:\" on\n every line made each card a form. The table names its columns in its header instead. */}\n {fieldLabel && (fieldLabelVisible\n ? <Text as=\"span\" variant={TextVariant.MUTED} size={TextSize.XS}>{fieldLabel}:</Text>\n : <span className=\"sr-only\">{fieldLabel}: </span>)}\n {fieldSchema ? (\n // COMPACT chrome → bare value with the full decorator policy applied, read in the ROW's scope.\n <ResourceDisplayContext.Provider value={recordDisplayContext}>\n <DisplayChromeProvider displayChromeMode={DisplayChromeMode.COMPACT}>\n <DisplayField\n name={fieldName}\n schema={fieldSchema}\n value={value}\n enumLabels={enumLabels}\n // The ROW this cell belongs to. Every other display surface hands the dispatcher its\n // record as `parentData`; a collection cell did not, so anything a field needs from its\n // siblings was unreachable from a list or a table — including a foreign key's\n // `labelFallbackField`, which is why a member directory printed raw ObjectIds.\n parentData={record}\n disableInlineEdit\n className=\"min-w-0 truncate text-sm text-muted-foreground\"\n />\n </DisplayChromeProvider>\n </ResourceDisplayContext.Provider>\n ) : (\n // No schema resolved for this field — `DisplayField` requires a schema,\n // so fall back to a plain string (matches the previous default branch).\n <span className=\"min-w-0 truncate text-sm text-muted-foreground\">{String(value)}</span>\n )}\n </div>\n );\n}\n\n// =============================================================================\n// MAIN COMPONENT\n// =============================================================================\n\nexport function ResourceListItemRenderer({\n item,\n resourceType,\n resourceConfig,\n registry,\n collectionContextResourceIdentifiers,\n summaryFields,\n fieldLabelsMap,\n tResourceFieldEnumValue,\n onItemClick,\n operationsSlot,\n cardActionPlacement,\n selectable = false,\n isSelected = false,\n onToggleSelect,\n selectionActive = false,\n selectAriaLabel,\n className,\n interactiveClasses,\n}: ResourceListItemRendererProps): React.JSX.Element {\n if (!resourceConfig?.resourceFieldIdentifier) {\n throw FrontendResourceUtils.buildConfigurationError(\n ErrorCustomMessageReference.FRONTEND_RESOURCE_FIELD_IDENTIFIER_NOT_FOUND,\n { resourceType, component: 'ResourceListItemRenderer' }\n );\n }\n const fieldIdentifier = resourceConfig.resourceFieldIdentifier as string;\n // Resolve the record's own id (`_id`), not the cross-resource field-identifier\n // name (`<resource>Id`) which is absent from a plain record — see\n // FrontendResourceUtils.getResourceObjectId.\n const itemId = FrontendResourceUtils.getResourceObjectId(item, fieldIdentifier);\n\n // Primary display: use computeFrontendResourceLabel for the primary value.\n // For a junction this resolves the server-projected instance label (e.g. a\n // `forwardedLabel` virtual field referenced by `getFrontendResourceLabel`).\n /*\n * The translator goes to the label callback. Without it `computeFrontendResourceLabel` falls back\n * to an IDENTITY `t`, so a label callback that words its row through the label tree rendered the\n * key — then its own fallback, a ref — on every card, while the same row's page header (which\n * passes `t`) read correctly (#1454: governed documents titled `document-definition:…` in lists).\n */\n const { t: tLabel, formatDate, formatDateTime } = useI18n({ resource: resourceType });\n const primaryLabel = useMemo((): string => {\n const label = FrontendResourceUtils.computeFrontendResourceLabel({\n resourceType,\n registry,\n currentObject: item,\n t: tLabel,\n formatDate,\n formatDateTime,\n });\n return String(label || item[summaryFields[0]] || `${resourceType} #${itemId}`);\n }, [item, resourceType, registry, summaryFields, itemId, tLabel, formatDate, formatDateTime]);\n\n // Secondary fields: every summary field EXCEPT the one already shown as the\n // primary label (title). The title comes from `computeFrontendResourceLabel`\n // — an arbitrary label strategy (a `string[]` join or a function), NOT\n // necessarily `summaryFields[0]`. Excluding the title positionally (`slice(1)`)\n // had two bugs: (a) it REPEATED the title when the label field wasn't first\n // (e.g. a list whose label is `name` but whose first summary field is `status`\n // → \"Name: …\" rendered under the identical title), and (b) it silently DROPPED\n // `summaryFields[0]` whenever that field wasn't the label. Excluding the title\n // by VALUE fixes both: the field whose value equals the title is the label\n // field wherever it sits, and every genuine non-label summary field is kept.\n // (The primary-scope FK is dropped upstream by\n // `ResourceLayoutUtils.detectSummaryFields`, so it never reaches here.)\n const secondaryFields = useMemo(\n () => summaryFields.filter((fieldName) => {\n const value = item[fieldName];\n // A value the record does not hold shows nothing, so it takes no place in the row — and a card whose\n // values are all empty draws no row at all (`secondaryFields.length > 0` below).\n if (!isPresentSummaryValue(value)) return false;\n return String(value) !== primaryLabel;\n }),\n [summaryFields, item, primaryLabel],\n );\n\n // Schema shape for field type detection\n // The row's own schema (#2455): for an inheritance resource, the variant its discriminators name. A family's\n // `mainSchema` is its base object since #2414, not a discriminated union.\n const rowSchema = useMemo(() => FrontendResourceUtils.resolveRowSchema(resourceConfig, item), [resourceConfig, item]);\n const schemaShape = useMemo(() => {\n if (!rowSchema) return null;\n return AutomatedLayoutFrontendUtils.getObjectLikeFieldShape(rowSchema, { commonOnly: false }) ?? null;\n }, [rowSchema]);\n\n // Which shown values keep a VISIBLE name on the card: the FIELD's own declared summary chrome, else the\n // layout's, else the values that cannot speak for themselves (a boolean, a bare number, a second date) —\n // the same rule the generated summary applies (`summaryValueNamesShown`). Every declaration is resolved\n // for the current breakpoint by the chrome's own chain (`resolveDeclaredDisplayChromeMode`), so the card\n // and a summary surface read `{ mobile: HIDDEN }` the same way.\n //\n // Optional UIContext read: a rendering leaf shouldn't hard-require the shell's\n // UIProvider just to check the breakpoint — outside a provider (isolated\n // renders/tests) it degrades to desktop behavior (isMobile = false, the DESKTOP\n // entry of a responsive summary chrome).\n const ui = React.useContext(UIContext);\n const currentBreakpoint = ui?.UIConfig?.currentBreakpoint ?? ViewportBreakpoint.DESKTOP;\n const declaredSummaryChrome = resolveDeclaredDisplayChromeMode(\n resourceConfig?.frontendConfiguration?.layout?.defaultChromeMode?.summary,\n currentBreakpoint,\n );\n const secondaryFieldKeepsName = useMemo(\n () => summaryValueNamesShown(declaredSummaryChrome, secondaryFields.map((fieldName) => {\n const fieldSchema = schemaShape?.[fieldName] as z.ZodTypeAny | undefined;\n return {\n schemaType: fieldSchema ? getSchemaType(fieldSchema) : undefined,\n present: true, // `secondaryFields` holds only present values\n declaredChrome: fieldSchema ? resolveDeclaredDisplayChromeMode(getFieldUISummaryDisplayConfig(fieldSchema)?.chromeMode, currentBreakpoint) : undefined,\n };\n })),\n [declaredSummaryChrome, secondaryFields, schemaShape, currentBreakpoint],\n );\n\n // AUTHORED summary template — the `layout.summary` contract promises coverage\n // of \"cards, list items, FK references\". When a resource authors one, the card\n // defers its ENTIRE content region (title + body) to `ResourceSummaryDisplayer`:\n // the title is now a first-class template element (`<SummaryTitle />`, placed by\n // `<SummaryLayout>`), so a status badge can sit inline with the title and the\n // exact same composition renders in the FK popover. We pass the primary label we\n // already computed (correct `t`, junction forwardedLabel) into the displayer's\n // SummaryContext instead of rendering our own title above it.\n //\n // Resources WITHOUT an authored template keep the host-owned title + the bare\n // qualifier row below (values in one `SummaryMeta` row, named by the naming rule):\n // routing them through the GENERATED default template would restyle every list in\n // every app for no authored reason.\n const authoredSummaryTemplate = resourceConfig?.frontendConfiguration?.layout?.summary;\n\n const hoverClass = interactiveClasses?.hover ?? '';\n const transitionClass = interactiveClasses?.transition ?? '';\n // Resolve where the per-item actions sit (2-axis anchor → flex classes). The\n // content + actions share one flex container so actions never overlap text.\n const placement = resolveCardActionPlacementClasses(cardActionPlacement);\n\n // Mobile multi-select: a long-press ENTERS selection mode (selects this item);\n // while selection mode is active (`selectionActive`), a plain TAP toggles\n // selection instead of navigating. Gated to a mobile viewport — on desktop a\n // click always navigates and the checkbox is the explicit toggle. Long-press\n // is touch-only (the hook binds touch handlers).\n const isMobile = ui?.UIConfig?.currentBreakpoint === ViewportBreakpoint.MOBILE;\n const tapTogglesSelection = selectable && selectionActive && isMobile;\n // Long-press ENTERS selection mode — gated to the SAME condition as tap-toggle\n // (selectable + mobile viewport) so the two can't disagree (e.g. enter mode on\n // a tablet where tap-toggle is off, stranding the user mid-multiselect).\n const longPress = useLongPress(\n () => onToggleSelect?.(item),\n { enabled: selectable && !!onToggleSelect && isMobile },\n );\n\n /*\n * A row is INTERACTIVE when something can happen on it: the host gave it a click handler, or the\n * view is in mobile multi-select where a tap toggles selection. Everything the card says about\n * itself — the pointer, the button role, the focusability, the key handling — is read off this one\n * value, so the promise and the behaviour cannot drift apart.\n */\n const isActivatable = Boolean(onItemClick) || tapTogglesSelection;\n\n const handleActivate = () => {\n // Swallow the synthetic click that follows a long-press (it already selected).\n if (longPress.consumeLongPress()) return;\n if (tapTogglesSelection) {\n onToggleSelect?.(item);\n return;\n }\n onItemClick?.(item);\n };\n\n /*\n * ─── The card is NOT a button; its ACTIVATOR is ────────────────────────────────────────────\n *\n * The card root used to be `role=\"button\"` with `tabIndex={0}` and Enter/Space handling, and it\n * CONTAINED the row's selection checkbox and its \"More actions\" button. ARIA does not allow\n * interactive descendants inside a button, and assistive technology may flatten the whole card\n * into one control — a screen-reader user could reach \"open this record\" but not reliably\n * \"select it\" or \"its actions\". axe reported it as `nested-interactive`, serious, on every card\n * of the todos list (#1718).\n *\n * This is the settled card-with-a-primary-action shape: a real `<button>` carries the name and\n * the keyboard activation, and it is a SIBLING of the checkbox and the actions rather than their\n * container. It is laid over the whole card (`absolute inset-0`) so its focus ring outlines the\n * card and a click on empty space lands on it; the rail after it is positioned too, so it stacks\n * above and its controls stay directly clickable. The root keeps its pointer `onClick` and the\n * long-press, so a click on the card's TEXT still opens the record — pointer behaviour is\n * unchanged, and the keyboard path is now a button that needs no hand-written key handling.\n */\n return (\n <div\n // One record in a collection, whichever way it is drawn (the table row carries the same marker).\n // Automation (`wildo frontend look`, the browser lanes) finds \"a row\" by it: the card has no other\n // identity in the DOM, and its overlay button's accessible name is the record's label, not a role.\n data-slot=\"resource-list-item\"\n className={cn(\n // `group/list-item`: the row's checkbox reveals itself on this row's hover and focus.\n 'group/list-item',\n CARD_ROW_PADDING_CLASS, transitionClass,\n isActivatable && 'relative',\n // Both only when a click leads somewhere — see `isActivatable`.\n isActivatable && hoverClass,\n isActivatable && 'cursor-pointer',\n isSelected && 'bg-primary/5',\n // Prevent the browser text-selection that a long-press would start.\n selectable && 'select-none',\n className,\n )}\n onClick={isActivatable ? handleActivate : undefined}\n {...longPress.handlers}\n >\n {isActivatable && (\n <button\n type=\"button\"\n aria-label={String(primaryLabel)}\n // Selection state is conveyed by the row's checkbox; the bg tint is a purely visual\n // reinforcement, and `aria-pressed` would misdescribe a button that OPENS the record.\n className={cn(\"absolute inset-0 rounded-[inherit] outline-none\", focusIndicatorClasses(FocusIndicatorShape.INSET))}\n onClick={(e) => {\n // The root's own onClick would run the same activation again for this click.\n e.stopPropagation();\n handleActivate();\n }}\n />\n )}\n {/* Leading selection rail (only when the view is selectable). The checkbox\n toggles selection and stops propagation so it never triggers the row's\n navigation — mirrors the table select-cell contract. */}\n <div className={cn(CARD_SELECTION_RAIL_CLASS, isActivatable && 'relative')}>\n {/* stopPropagation on click, keydown AND touchstart: the card opens on a\n click and arms a long-press on a touch hold, so without these guards\n toggling the checkbox would also navigate, and a hold over it would arm\n the row's long-press. */}\n {selectable && (\n <div\n // `pt-0.5` optically centres the box on the first line of text beside it; its\n // HORIZONTAL place is the row's start padding, which the toolbar's select-all reads too\n // (`CARDS_SELECT_ALL_INSET_CLASS`), so the two stand in one column.\n className={cn(CARD_SELECTION_SLOT_CLASS, 'pt-0.5', !isSelected && !selectionActive && CARD_SELECTION_REVEAL_CLASS)}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n >\n <CheckboxRoot\n checked={isSelected}\n onCheckedChange={() => onToggleSelect?.(item)}\n aria-label={selectAriaLabel ?? String(primaryLabel)}\n />\n </div>\n )}\n <div className={cn(placement.containerClass, 'min-w-0 flex-1')}>\n <div className={cn('space-y-item-xs', placement.contentClass)}>\n {authoredSummaryTemplate && rowSchema ? (\n // Authored template owns title + body. The title is fed via\n // SummaryContext (primaryLabel) and rendered by `<SummaryTitle />`\n // inside the template, so we do NOT render our own title here. The\n // region stays click-through so the whole card navigates (same as the\n // legacy body); an author who embeds a genuinely interactive control\n // stops propagation within their own template.\n <ResourceSummaryDisplayer\n resourceType={resourceType}\n schema={rowSchema}\n data={item}\n primaryLabel={primaryLabel}\n contextResourceIdentifiers={collectionContextResourceIdentifiers}\n />\n ) : (\n <>\n <Text as=\"p\" className=\"font-medium text-foreground\" truncate>{primaryLabel}</Text>\n {/* The qualifier row a summary template would author: the values in ONE wrapping row\n under the title, not one labelled line each. */}\n {secondaryFields.length > 0 && (\n <SummaryMeta>\n {secondaryFields.map((fieldName, index) => {\n const value = item[fieldName];\n return (\n <FieldValueRenderer\n key={fieldName}\n fieldLabelVisible={secondaryFieldKeepsName[index]}\n fieldName={fieldName}\n value={value}\n fieldSchema={schemaShape?.[fieldName] as z.ZodTypeAny | undefined}\n fieldLabel={fieldLabelsMap[fieldName]}\n resourceType={resourceType}\n record={item as Record<string, unknown>}\n collectionContextResourceIdentifiers={collectionContextResourceIdentifiers}\n tResourceFieldEnumValue={tResourceFieldEnumValue}\n />\n );\n })}\n </SummaryMeta>\n )}\n </>\n )}\n </div>\n {operationsSlot && (\n // stopPropagation on click, keydown AND touchstart: an action tap or\n // keyboard activation must not also navigate the row, and a hold over\n // an action must not arm the row's long-press selection. (Mirrors the\n // checkbox rail — all three axes.)\n <div\n className={placement.actionsClass}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n >\n {operationsSlot}\n </div>\n )}\n </div>\n </div>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ResourceListItemRenderer.js","sourceRoot":"","sources":["../../../../src/components/resources/ResourceListItemRenderer.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAe,MAAM,OAAO,CAAC;AAEpD,OAAO,EAGL,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,8BAA8B,EAAE,aAAa,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,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n * Shared item renderer for List and Search presets.\n * Encapsulates schema-aware field rendering (FK, enum, date, array),\n * primary/secondary field split, and per-item operations.\n *\n * Used by List_Default and Search_Default to ensure parity in how\n * resource items are displayed.\n */\n\nimport React, { useMemo, useCallback } from 'react';\nimport { z } from 'zod';\nimport {\n CoreResourceOperation,\n ResourceOperationDisplayMode,\n ErrorCustomMessageReference,\n} from '@wildo-ai/saas-models';\nimport type { AnyFrontendResourceConfiguration, FrontendResourcesRegistry } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { getEnumValues, getFieldUISummaryDisplayConfig, getSchemaType, DisplayChromeMode, ViewportBreakpoint } from '@wildo-ai/zod-decorators';\nimport { UIContext } from '~wildo-frontend-lib/core/ui/UIContext';\nimport { useLongPress } from '~wildo-frontend-lib/components/resources/useLongPress';\nimport { DisplayField } from '~wildo-frontend-lib/components/data-display/DisplayField';\nimport { DisplayChromeProvider } from '~wildo-frontend-lib/components/data-display/chromes/DisplayChromeContext';\nimport { ResourceSummaryDisplayer, buildSummaryRecordIdentifiers } from '~wildo-frontend-lib/components/data-display/ResourceSummaryDisplayer';\nimport { ResourceDisplayContext, useResourceDisplayContext, type ResourceDisplayContextValue } from '~wildo-frontend-lib/components/data-display/automatic-displayer.utils';\nimport { useResourceRegistrySafe } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { SummaryMeta } from '~wildo-frontend-lib/components/resources/skeleton/SummaryMeta';\nimport { Text } from '~wildo-frontend-lib/components/typography/text';\nimport { TextSize, TextVariant } from '@wildo-ai/presets-components-models';\nimport { isPresentSummaryValue, summaryValueNamesShown } from '~wildo-frontend-lib/core/automated-layout/summary-value-naming.utils';\nimport { resolveDeclaredDisplayChromeMode } from '~wildo-frontend-lib/components/data-display/chromes/display-chrome-mode-resolution';\nimport { FrontendResourceUtils, frontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { AutomatedLayoutFrontendUtils } from '~wildo-frontend-lib/core/automated-layout/automated-layout.frontend.utils';\nimport { resolveResourceLabelEnumSchema } from '~wildo-frontend-lib/core/resources/resource-label-field-paths.frontend.utils';\nimport type { FrontendResourceOperationContext } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { activationStartedOnInnerControl } from '~wildo-frontend-lib/core/ui/inner-control-activation.utils';\nimport { focusIndicatorClasses, FocusIndicatorShape } from '~wildo-frontend-lib/core/ui/themes/focus-indicator';\nimport { CheckboxRoot } from '~wildo-frontend-lib/components/form/controls/boolean/checkbox';\nimport {\n CARD_ROW_PADDING_CLASS,\n CARD_SELECTION_RAIL_CLASS,\n CARD_SELECTION_REVEAL_CLASS,\n CARD_SELECTION_SLOT_CLASS,\n} from '~wildo-frontend-lib/components/resources/collection-card-layout.utils';\nimport type { CardActionPlacement } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { resolveCardActionPlacementClasses } from './card-action-placement.utils';\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\nexport interface ResourceListItemRendererProps {\n /** The data item to render */\n item: Record<string, unknown>;\n /** Resource type */\n resourceType: string;\n /** Resource configuration */\n resourceConfig: AnyFrontendResourceConfiguration;\n /** Resource registry */\n registry: FrontendResourcesRegistry;\n /**\n * The collection's resource identifiers (its route scope and parents). An authored summary template reads its\n * fields in them, with the row and its own primary scope added (`buildSummaryRecordIdentifiers`, #2198).\n */\n collectionContextResourceIdentifiers?: FrontendResourceOperationContext['contextResourceIdentifiers'];\n /** Ordered list of summary fields to display */\n summaryFields: string[];\n /** Pre-resolved field labels (from i18n) */\n fieldLabelsMap: Record<string, string>;\n /** Function to resolve enum display values via i18n — `fieldSchema` names the enum the field declares (#966) */\n tResourceFieldEnumValue: (resourceType: string, fieldName: string, enumValue: string, fieldSchema: z.ZodTypeAny | undefined) => string;\n /**\n * What a click on the row does — and, by its ABSENCE, that a click does nothing.\n *\n * Optional since 2026-09-20, and the optionality is the point. The card used to take this\n * REQUIRED and paint itself `cursor-pointer` + `role=\"button\"` + `tabIndex={0}` unconditionally,\n * so every summary row in the product announced itself as a button. Whether the click could act\n * was decided somewhere else entirely — in the host, by whether a READ operation resolves to a\n * view — and the two were never compared. On the audit trail the answer was \"it cannot\", so the\n * row invited a click, took focus, answered Enter and Space, and did nothing at any of them.\n *\n * A host that cannot open a row now omits this, and the affordance disappears with the behaviour\n * because both are read off the same value.\n */\n onItemClick?: (item: Record<string, unknown>) => void;\n /** Optional operations component to render for this item */\n operationsSlot?: React.ReactNode;\n /**\n * Where the per-item operations sit within the card (2-axis anchor +\n * orientation). Resolved by the host from `collectionDisplayConfig.cardActionPlacement`.\n * Omitted → the default (inline-end, vertically centered, horizontal row).\n */\n cardActionPlacement?: CardActionPlacement;\n /**\n * Selection affordance. When `selectable`, a leading checkbox renders and\n * toggles selection via `onToggleSelect` (independent of the row click, which\n * still navigates). `isSelected` drives the checkbox + a selected highlight.\n */\n selectable?: boolean;\n isSelected?: boolean;\n onToggleSelect?: (item: Record<string, unknown>) => void;\n /**\n * Whether the collection is currently in SELECTION MODE (any item selected).\n * Mobile UX: a long-press enters selection mode, and while active a plain TAP\n * toggles selection instead of navigating (the \"long-press to multi-select\"\n * pattern). Gated to touch/mobile — on desktop a click always navigates and\n * the checkbox is the explicit toggle.\n */\n selectionActive?: boolean;\n /** Accessible label for the selection checkbox (host provides the i18n string). */\n selectAriaLabel?: string;\n /** Optional className for the root container */\n className?: string;\n /** Interactive CSS classes from design system (hover state, transition) */\n interactiveClasses?: {\n hover?: string;\n transition?: string;\n };\n}\n\n// =============================================================================\n// FIELD VALUE RENDERER\n// =============================================================================\n\n/** A collection cell is read-only: the row's inline edit belongs to the row's own page, never to a cell. */\nconst refuseCellInlineUpdate = async (): Promise<void> => {\n throw new Error('A collection cell does not edit in place.');\n};\n\n/**\n * The display context a collection CELL reads in: its ROW, in the row's scope (#2347).\n *\n * A reference display fetches and links its target with the display context's identifiers and parameters. A\n * collection mounts no context, so a cell inherited the page's — none on a list page — and every reference to a\n * scope-junction peer (a user, through organization membership) lost the scope that selects its confined door.\n * The identifiers are built exactly as a summary template's are (`buildSummaryRecordIdentifiers`), so a card's\n * template and a table cell of the same row read a reference the same way.\n *\n * Everything that is the PAGE's record rather than the row's is dropped: its inline-edit write path, its mutation\n * manager and its upload endpoints would act on the page's record. What describes the surface (the zone, the parent\n * reference posture, the empty-value strategy) is kept. With no registry in reach (an isolated render) the cell\n * keeps the inherited context, as before.\n */\nfunction useRecordScopedDisplayContext(input: {\n resourceType: string;\n record: Record<string, unknown> | undefined;\n collectionContextResourceIdentifiers: FrontendResourceOperationContext['contextResourceIdentifiers'] | undefined;\n}): ResourceDisplayContextValue {\n const inherited = useResourceDisplayContext();\n const registryContext = useResourceRegistrySafe();\n const registry = registryContext?.registry;\n const { resourceType, record, collectionContextResourceIdentifiers } = input;\n return useMemo(() => {\n if (!registry || !record) return inherited;\n const identifiers = buildSummaryRecordIdentifiers({\n resourceType,\n resourceConfig: registry.resourceConfigurations[resourceType],\n data: record,\n hostIdentifiers: collectionContextResourceIdentifiers ?? inherited.contextResourceIdentifiers,\n });\n return {\n ...inherited,\n resourceType,\n resourceId: frontendResourceUtils.getResourceId(identifiers[resourceType]) || undefined,\n contextResourceIdentifiers: identifiers,\n contextualParameters: FrontendResourceUtils.buildContextualParameters(identifiers, registry),\n canInlineEdit: false,\n doInlineUpdate: refuseCellInlineUpdate,\n defaultInlineEdit: undefined,\n fileUploadContext: undefined,\n rmm: null,\n };\n }, [inherited, registry, record, resourceType, collectionContextResourceIdentifiers]);\n}\n\nexport interface FieldValueRendererProps {\n fieldName: string;\n value: unknown;\n fieldSchema: z.ZodTypeAny | undefined;\n fieldLabel: string | undefined;\n resourceType: string;\n tResourceFieldEnumValue: (resourceType: string, fieldName: string, enumValue: string, fieldSchema: z.ZodTypeAny | undefined) => string;\n /**\n * The whole record this cell belongs to, forwarded to the dispatcher as `parentData`.\n *\n * Optional so a caller rendering a bare value is unaffected — but every collection caller passes\n * it, because a field frequently needs a sibling to render correctly and a cell that does not know\n * its row cannot reach one.\n */\n record?: Record<string, unknown>;\n /**\n * The COLLECTION's resource identifiers (its route scope and parents), when the caller has them.\n *\n * With `record`, they decide where the cell's references are fetched and linked: the cell reads in its ROW's\n * identifiers (`buildSummaryRecordIdentifiers` — the host's, then the row's own primary scope, then the row), the\n * shape a summary template already reads in (#2198). A collection mounts no display context of its own, so a cell\n * used to inherit the PAGE's, which on a list page is none: a reference to a user reached the users READ (a user\n * reads only themselves) instead of the organization's people search, and a table of the representatives' activity\n * (retired with that feed, #2592) named its representative by a raw user id (#2347). Absent, the inherited context's identifiers are the host's.\n */\n collectionContextResourceIdentifiers?: FrontendResourceOperationContext['contextResourceIdentifiers'];\n /**\n * Show `fieldLabel` beside the value: under a declared summary chrome that shows a name, or, when none\n * is declared, for a value that cannot speak for itself on a card (a boolean, a bare number, a second\n * date — `summaryValueNamesShown`). Otherwise the name is for assistive technology only.\n */\n fieldLabelVisible?: boolean;\n}\n\n/**\n * Renders a single summary field VALUE through the shared decorator-driven\n * display pipeline (`DisplayField` → `DisplayValueDispatcher` → presets) — the\n * SAME path the detail/read view uses — so the FULL zod-UI display policy is\n * honored in lists/tables by default: enum → badge (+ per-value colors),\n * boolean → checkmark / yes-no, string → truncate / multiline, FK → reference,\n * date → formatted, money/bigdecimal/duration/etc.\n *\n * Previously this re-implemented a weak subset (enum-as-plain-text, naive array\n * join, `String(value)` fallback) that silently ignored every\n * `{primitive}UI().display` decorator, so listings/tables diverged from the\n * detail view (e.g. a `displayMode: BADGE` enum rendered as plain text). Routing\n * through `DisplayField` removes that divergence and the maintenance burden of a\n * parallel renderer.\n *\n * The card and the table (column header) own the label, so the value is rendered\n * under COMPACT chrome — a bare value with no framework label/description wrapper.\n * The card names a value with a visually hidden name, or a visible one for a value\n * that cannot speak for itself (`fieldLabelVisible`). i18n enum labels are threaded explicitly via\n * `enumLabels` because there is no surrounding `DisplayTemplateContext`\n * (which is what supplies them inside `AutomaticDisplayer`).\n */\nexport function FieldValueRenderer({\n fieldName,\n value,\n fieldSchema,\n fieldLabel,\n resourceType,\n record,\n collectionContextResourceIdentifiers,\n tResourceFieldEnumValue,\n fieldLabelVisible = false,\n}: FieldValueRendererProps): React.JSX.Element | null {\n const recordDisplayContext = useRecordScopedDisplayContext({ resourceType, record, collectionContextResourceIdentifiers });\n // Build the enum value→label map from the same i18n translator the list\n // already uses, so enum badges show translated labels rather than raw enum\n // values. Hook runs unconditionally, before the null-value early return.\n //\n // The vocabulary is read off the ENUM-BEARING schema — the field, or an array's element — through the\n // resolver the detail views and the labelling planner share. Asking only \"is the field itself an enum\"\n // left every array of an enum raw in a list or a table: a member directory printed `ORG_MEMBER` while\n // the same roles read \"Organization member\" on the member's own page.\n const enumLabels = useMemo<Record<string, string> | undefined>(() => {\n const enumSchema = fieldSchema ? resolveResourceLabelEnumSchema(fieldSchema) : undefined;\n if (!enumSchema) return undefined;\n const enumValues = getEnumValues(enumSchema);\n if (enumValues.length === 0) return undefined;\n return Object.fromEntries(\n enumValues.map((enumValue) => [enumValue, tResourceFieldEnumValue(resourceType, fieldName, enumValue, fieldSchema)]),\n );\n }, [fieldSchema, resourceType, fieldName, tResourceFieldEnumValue]);\n\n if (value === null || value === undefined) return null;\n\n return (\n <div className=\"flex min-w-0 items-baseline gap-element-sm\">\n {/* A card shows the VALUE; its name is for assistive technology only. A summary is bare,\n self-describing values (the record's own page names its facts), and a visible \"Label:\" on\n every line made each card a form. The table names its columns in its header instead. */}\n {fieldLabel && (fieldLabelVisible\n ? <Text as=\"span\" variant={TextVariant.MUTED} size={TextSize.XS}>{fieldLabel}:</Text>\n : <span className=\"sr-only\">{fieldLabel}: </span>)}\n {fieldSchema ? (\n // COMPACT chrome → bare value with the full decorator policy applied, read in the ROW's scope.\n <ResourceDisplayContext.Provider value={recordDisplayContext}>\n <DisplayChromeProvider displayChromeMode={DisplayChromeMode.COMPACT}>\n <DisplayField\n name={fieldName}\n schema={fieldSchema}\n value={value}\n enumLabels={enumLabels}\n // The ROW this cell belongs to. Every other display surface hands the dispatcher its\n // record as `parentData`; a collection cell did not, so anything a field needs from its\n // siblings was unreachable from a list or a table — including a foreign key's\n // `labelFallbackField`, which is why a member directory printed raw ObjectIds.\n parentData={record}\n disableInlineEdit\n className=\"min-w-0 truncate text-sm text-muted-foreground\"\n />\n </DisplayChromeProvider>\n </ResourceDisplayContext.Provider>\n ) : (\n // No schema resolved for this field — `DisplayField` requires a schema,\n // so fall back to a plain string (matches the previous default branch).\n <span className=\"min-w-0 truncate text-sm text-muted-foreground\">{String(value)}</span>\n )}\n </div>\n );\n}\n\n// =============================================================================\n// MAIN COMPONENT\n// =============================================================================\n\nexport function ResourceListItemRenderer({\n item,\n resourceType,\n resourceConfig,\n registry,\n collectionContextResourceIdentifiers,\n summaryFields,\n fieldLabelsMap,\n tResourceFieldEnumValue,\n onItemClick,\n operationsSlot,\n cardActionPlacement,\n selectable = false,\n isSelected = false,\n onToggleSelect,\n selectionActive = false,\n selectAriaLabel,\n className,\n interactiveClasses,\n}: ResourceListItemRendererProps): React.JSX.Element {\n if (!resourceConfig?.resourceFieldIdentifier) {\n throw FrontendResourceUtils.buildConfigurationError(\n ErrorCustomMessageReference.FRONTEND_RESOURCE_FIELD_IDENTIFIER_NOT_FOUND,\n { resourceType, component: 'ResourceListItemRenderer' }\n );\n }\n const fieldIdentifier = resourceConfig.resourceFieldIdentifier as string;\n // Resolve the record's own id (`_id`), not the cross-resource field-identifier\n // name (`<resource>Id`) which is absent from a plain record — see\n // FrontendResourceUtils.getResourceObjectId.\n const itemId = FrontendResourceUtils.getResourceObjectId(item, fieldIdentifier);\n\n // Primary display: use computeFrontendResourceLabel for the primary value.\n // For a junction this resolves the server-projected instance label (e.g. a\n // `forwardedLabel` virtual field referenced by `getFrontendResourceLabel`).\n /*\n * The translator goes to the label callback. Without it `computeFrontendResourceLabel` falls back\n * to an IDENTITY `t`, so a label callback that words its row through the label tree rendered the\n * key — then its own fallback, a ref — on every card, while the same row's page header (which\n * passes `t`) read correctly (#1454: governed documents titled `document-definition:…` in lists).\n */\n const { t: tLabel, formatDate, formatDateTime } = useI18n({ resource: resourceType });\n const primaryLabel = useMemo((): string => {\n const label = FrontendResourceUtils.computeFrontendResourceLabel({\n resourceType,\n registry,\n currentObject: item,\n t: tLabel,\n formatDate,\n formatDateTime,\n });\n return String(label || item[summaryFields[0]] || `${resourceType} #${itemId}`);\n }, [item, resourceType, registry, summaryFields, itemId, tLabel, formatDate, formatDateTime]);\n\n // Secondary fields: every summary field EXCEPT the one already shown as the\n // primary label (title). The title comes from `computeFrontendResourceLabel`\n // — an arbitrary label strategy (a `string[]` join or a function), NOT\n // necessarily `summaryFields[0]`. Excluding the title positionally (`slice(1)`)\n // had two bugs: (a) it REPEATED the title when the label field wasn't first\n // (e.g. a list whose label is `name` but whose first summary field is `status`\n // → \"Name: …\" rendered under the identical title), and (b) it silently DROPPED\n // `summaryFields[0]` whenever that field wasn't the label. Excluding the title\n // by VALUE fixes both: the field whose value equals the title is the label\n // field wherever it sits, and every genuine non-label summary field is kept.\n // (The primary-scope FK is dropped upstream by\n // `ResourceLayoutUtils.detectSummaryFields`, so it never reaches here.)\n const secondaryFields = useMemo(\n () => summaryFields.filter((fieldName) => {\n const value = item[fieldName];\n // A value the record does not hold shows nothing, so it takes no place in the row — and a card whose\n // values are all empty draws no row at all (`secondaryFields.length > 0` below).\n if (!isPresentSummaryValue(value)) return false;\n return String(value) !== primaryLabel;\n }),\n [summaryFields, item, primaryLabel],\n );\n\n // Schema shape for field type detection\n // The row's own schema (#2455): for an inheritance resource, the variant its discriminators name. A family's\n // `mainSchema` is its base object since #2414, not a discriminated union.\n const rowSchema = useMemo(() => FrontendResourceUtils.resolveRowSchema(resourceConfig, item), [resourceConfig, item]);\n const schemaShape = useMemo(() => {\n if (!rowSchema) return null;\n return AutomatedLayoutFrontendUtils.getObjectLikeFieldShape(rowSchema, { commonOnly: false }) ?? null;\n }, [rowSchema]);\n\n // Which shown values keep a VISIBLE name on the card: the FIELD's own declared summary chrome, else the\n // layout's, else the values that cannot speak for themselves (a boolean, a bare number, a second date) —\n // the same rule the generated summary applies (`summaryValueNamesShown`). Every declaration is resolved\n // for the current breakpoint by the chrome's own chain (`resolveDeclaredDisplayChromeMode`), so the card\n // and a summary surface read `{ mobile: HIDDEN }` the same way.\n //\n // Optional UIContext read: a rendering leaf shouldn't hard-require the shell's\n // UIProvider just to check the breakpoint — outside a provider (isolated\n // renders/tests) it degrades to desktop behavior (isMobile = false, the DESKTOP\n // entry of a responsive summary chrome).\n const ui = React.useContext(UIContext);\n const currentBreakpoint = ui?.UIConfig?.currentBreakpoint ?? ViewportBreakpoint.DESKTOP;\n const declaredSummaryChrome = resolveDeclaredDisplayChromeMode(\n resourceConfig?.frontendConfiguration?.layout?.defaultChromeMode?.summary,\n currentBreakpoint,\n );\n const secondaryFieldKeepsName = useMemo(\n () => summaryValueNamesShown(declaredSummaryChrome, secondaryFields.map((fieldName) => {\n const fieldSchema = schemaShape?.[fieldName] as z.ZodTypeAny | undefined;\n return {\n schemaType: fieldSchema ? getSchemaType(fieldSchema) : undefined,\n present: true, // `secondaryFields` holds only present values\n declaredChrome: fieldSchema ? resolveDeclaredDisplayChromeMode(getFieldUISummaryDisplayConfig(fieldSchema)?.chromeMode, currentBreakpoint) : undefined,\n };\n })),\n [declaredSummaryChrome, secondaryFields, schemaShape, currentBreakpoint],\n );\n\n // AUTHORED summary template — the `layout.summary` contract promises coverage\n // of \"cards, list items, FK references\". When a resource authors one, the card\n // defers its ENTIRE content region (title + body) to `ResourceSummaryDisplayer`:\n // the title is now a first-class template element (`<SummaryTitle />`, placed by\n // `<SummaryLayout>`), so a status badge can sit inline with the title and the\n // exact same composition renders in the FK popover. We pass the primary label we\n // already computed (correct `t`, junction forwardedLabel) into the displayer's\n // SummaryContext instead of rendering our own title above it.\n //\n // Resources WITHOUT an authored template keep the host-owned title + the bare\n // qualifier row below (values in one `SummaryMeta` row, named by the naming rule):\n // routing them through the GENERATED default template would restyle every list in\n // every app for no authored reason.\n const authoredSummaryTemplate = resourceConfig?.frontendConfiguration?.layout?.summary;\n\n const hoverClass = interactiveClasses?.hover ?? '';\n const transitionClass = interactiveClasses?.transition ?? '';\n // Resolve where the per-item actions sit (2-axis anchor → flex classes). The\n // content + actions share one flex container so actions never overlap text.\n const placement = resolveCardActionPlacementClasses(cardActionPlacement);\n\n // Mobile multi-select: a long-press ENTERS selection mode (selects this item);\n // while selection mode is active (`selectionActive`), a plain TAP toggles\n // selection instead of navigating. Gated to a mobile viewport — on desktop a\n // click always navigates and the checkbox is the explicit toggle. Long-press\n // is touch-only (the hook binds touch handlers).\n const isMobile = ui?.UIConfig?.currentBreakpoint === ViewportBreakpoint.MOBILE;\n const tapTogglesSelection = selectable && selectionActive && isMobile;\n // Long-press ENTERS selection mode — gated to the SAME condition as tap-toggle\n // (selectable + mobile viewport) so the two can't disagree (e.g. enter mode on\n // a tablet where tap-toggle is off, stranding the user mid-multiselect).\n const longPress = useLongPress(\n () => onToggleSelect?.(item),\n { enabled: selectable && !!onToggleSelect && isMobile },\n );\n\n /*\n * A row is INTERACTIVE when something can happen on it: the host gave it a click handler, or the\n * view is in mobile multi-select where a tap toggles selection. Everything the card says about\n * itself — the pointer, the button role, the focusability, the key handling — is read off this one\n * value, so the promise and the behaviour cannot drift apart.\n */\n const isActivatable = Boolean(onItemClick) || tapTogglesSelection;\n\n const handleActivate = () => {\n // Swallow the synthetic click that follows a long-press (it already selected).\n if (longPress.consumeLongPress()) return;\n if (tapTogglesSelection) {\n onToggleSelect?.(item);\n return;\n }\n onItemClick?.(item);\n };\n\n /*\n * ─── The card is NOT a button; its ACTIVATOR is ────────────────────────────────────────────\n *\n * The card root used to be `role=\"button\"` with `tabIndex={0}` and Enter/Space handling, and it\n * CONTAINED the row's selection checkbox and its \"More actions\" button. ARIA does not allow\n * interactive descendants inside a button, and assistive technology may flatten the whole card\n * into one control — a screen-reader user could reach \"open this record\" but not reliably\n * \"select it\" or \"its actions\". axe reported it as `nested-interactive`, serious, on every card\n * of the todos list (#1718).\n *\n * This is the settled card-with-a-primary-action shape: a real `<button>` carries the name and\n * the keyboard activation, and it is a SIBLING of the checkbox and the actions rather than their\n * container. It is laid over the whole card (`absolute inset-0`) so its focus ring outlines the\n * card and a click on empty space lands on it; the rail after it is positioned too, so it stacks\n * above and its controls stay directly clickable. The root keeps its pointer `onClick` and the\n * long-press, so a click on the card's TEXT still opens the record — pointer behaviour is\n * unchanged, and the keyboard path is now a button that needs no hand-written key handling.\n */\n return (\n <div\n // One record in a collection, whichever way it is drawn (the table row carries the same marker).\n // Automation (`wildo frontend look`, the browser lanes) finds \"a row\" by it: the card has no other\n // identity in the DOM, and its overlay button's accessible name is the record's label, not a role.\n data-slot=\"resource-list-item\"\n className={cn(\n // `group/list-item`: the row's checkbox reveals itself on this row's hover and focus.\n 'group/list-item',\n CARD_ROW_PADDING_CLASS, transitionClass,\n isActivatable && 'relative',\n // Both only when a click leads somewhere — see `isActivatable`.\n isActivatable && hoverClass,\n isActivatable && 'cursor-pointer',\n isSelected && 'bg-primary/5',\n // Prevent the browser text-selection that a long-press would start.\n selectable && 'select-none',\n className,\n )}\n // A click on a control inside the card (a reference to another record, a link) is that control's: the card\n // opens only for a click on its own text or space (`activationStartedOnInnerControl`).\n onClick={isActivatable ? (e) => { if (!activationStartedOnInnerControl(e)) handleActivate(); } : undefined}\n {...longPress.handlers}\n >\n {isActivatable && (\n <button\n type=\"button\"\n aria-label={String(primaryLabel)}\n // Selection state is conveyed by the row's checkbox; the bg tint is a purely visual\n // reinforcement, and `aria-pressed` would misdescribe a button that OPENS the record.\n className={cn(\"absolute inset-0 rounded-[inherit] outline-none\", focusIndicatorClasses(FocusIndicatorShape.INSET))}\n onClick={(e) => {\n // The root's own onClick would run the same activation again for this click.\n e.stopPropagation();\n handleActivate();\n }}\n />\n )}\n {/* Leading selection rail (only when the view is selectable). The checkbox\n toggles selection and stops propagation so it never triggers the row's\n navigation — mirrors the table select-cell contract. */}\n <div className={cn(CARD_SELECTION_RAIL_CLASS, isActivatable && 'relative')}>\n {/* stopPropagation on click, keydown AND touchstart: the card opens on a\n click and arms a long-press on a touch hold, so without these guards\n toggling the checkbox would also navigate, and a hold over it would arm\n the row's long-press. */}\n {selectable && (\n <div\n // `pt-0.5` optically centres the box on the first line of text beside it; its\n // HORIZONTAL place is the row's start padding, which the toolbar's select-all reads too\n // (`CARDS_SELECT_ALL_INSET_CLASS`), so the two stand in one column.\n className={cn(CARD_SELECTION_SLOT_CLASS, 'pt-0.5', !isSelected && !selectionActive && CARD_SELECTION_REVEAL_CLASS)}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n >\n <CheckboxRoot\n checked={isSelected}\n onCheckedChange={() => onToggleSelect?.(item)}\n aria-label={selectAriaLabel ?? String(primaryLabel)}\n />\n </div>\n )}\n <div className={cn(placement.containerClass, 'min-w-0 flex-1')}>\n <div className={cn('space-y-item-xs', placement.contentClass)}>\n {authoredSummaryTemplate && rowSchema ? (\n // Authored template owns title + body. The title is fed via\n // SummaryContext (primaryLabel) and rendered by `<SummaryTitle />`\n // inside the template, so we do NOT render our own title here. The\n // region stays click-through so the whole card navigates (same as the\n // legacy body); an author who embeds a genuinely interactive control\n // stops propagation within their own template.\n <ResourceSummaryDisplayer\n resourceType={resourceType}\n schema={rowSchema}\n data={item}\n primaryLabel={primaryLabel}\n contextResourceIdentifiers={collectionContextResourceIdentifiers}\n />\n ) : (\n <>\n <Text as=\"p\" className=\"font-medium text-foreground\" truncate>{primaryLabel}</Text>\n {/* The qualifier row a summary template would author: the values in ONE wrapping row\n under the title, not one labelled line each. */}\n {secondaryFields.length > 0 && (\n <SummaryMeta>\n {secondaryFields.map((fieldName, index) => {\n const value = item[fieldName];\n return (\n <FieldValueRenderer\n key={fieldName}\n fieldLabelVisible={secondaryFieldKeepsName[index]}\n fieldName={fieldName}\n value={value}\n fieldSchema={schemaShape?.[fieldName] as z.ZodTypeAny | undefined}\n fieldLabel={fieldLabelsMap[fieldName]}\n resourceType={resourceType}\n record={item as Record<string, unknown>}\n collectionContextResourceIdentifiers={collectionContextResourceIdentifiers}\n tResourceFieldEnumValue={tResourceFieldEnumValue}\n />\n );\n })}\n </SummaryMeta>\n )}\n </>\n )}\n </div>\n {operationsSlot && (\n // stopPropagation on click, keydown AND touchstart: an action tap or\n // keyboard activation must not also navigate the row, and a hold over\n // an action must not arm the row's long-press selection. (Mirrors the\n // checkbox rail — all three axes.)\n <div\n className={placement.actionsClass}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n >\n {operationsSlot}\n </div>\n )}\n </div>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -4,7 +4,7 @@ import React, { useMemo } from 'react';
|
|
|
4
4
|
import { TypographyVariant } from '@wildo-ai/presets-components-models';
|
|
5
5
|
import { SectionLegendVoiceHost } from '../../sections/section-legend-voice.js';
|
|
6
6
|
import { cn } from '../../../core/ui/cn.js';
|
|
7
|
-
import {
|
|
7
|
+
import { optionalMaxInlineSizeStyle } from '../../sections/surface.js';
|
|
8
8
|
import { FieldScopeProvider } from './FieldScopeContext.js';
|
|
9
9
|
import { useOptionalDisplayTemplateContext } from '../../data-display/DisplayTemplateContext.js';
|
|
10
10
|
import { ContentSectionContainer } from '../../sections/ContentSectionContainer.js';
|
|
@@ -52,7 +52,7 @@ export function DisplayLayout({ className, children, responsiveMaxWidth }) {
|
|
|
52
52
|
// The selector spells the attribute literally because Tailwind reads class names statically;
|
|
53
53
|
// `display-layout-derived-width.test.tsx` holds it equal to `COLLECTION_SURFACE_ATTRIBUTE`.
|
|
54
54
|
responsiveMaxWidth === undefined
|
|
55
|
-
&& '[max-inline-size:var(--measure-max-width,42rem)] has-[[data-collection-surface]]:[max-inline-size:none]', className), style:
|
|
55
|
+
&& '[max-inline-size:var(--measure-max-width,42rem)] has-[[data-collection-surface]]:[max-inline-size:none]', className), style: optionalMaxInlineSizeStyle(responsiveMaxWidth), "data-inline-size-tier": responsiveMaxWidth ?? 'derived', "data-guidance-display": true, children: renderedChildren }) }) }));
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Introspects children for `<Section>` elements with container-mode `appearance`.
|