@wildo-ai/saas-frontend-lib 1.1.13 → 1.1.14

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.
Files changed (101) hide show
  1. package/dist/esm/components/data-display/DisplayValueDispatcher.d.ts.map +1 -1
  2. package/dist/esm/components/data-display/DisplayValueDispatcher.js +17 -1
  3. package/dist/esm/components/data-display/DisplayValueDispatcher.js.map +1 -1
  4. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.d.ts.map +1 -1
  5. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js +5 -2
  6. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js.map +1 -1
  7. package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts.map +1 -1
  8. package/dist/esm/components/form/automated/ResourceAutomatedForm.js +20 -1
  9. package/dist/esm/components/form/automated/ResourceAutomatedForm.js.map +1 -1
  10. package/dist/esm/components/form/chromes/FormFieldChrome.js +1 -1
  11. package/dist/esm/components/form/chromes/FormFieldChrome.js.map +1 -1
  12. package/dist/esm/components/form/chromes/field-control-aria.d.ts +8 -1
  13. package/dist/esm/components/form/chromes/field-control-aria.d.ts.map +1 -1
  14. package/dist/esm/components/form/chromes/field-control-aria.js +19 -2
  15. package/dist/esm/components/form/chromes/field-control-aria.js.map +1 -1
  16. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.d.ts +5 -0
  17. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.d.ts.map +1 -1
  18. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.js +6 -2
  19. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.js.map +1 -1
  20. package/dist/esm/components/resources/ResourceCollectionBody_Table.d.ts.map +1 -1
  21. package/dist/esm/components/resources/ResourceCollectionBody_Table.js +8 -1
  22. package/dist/esm/components/resources/ResourceCollectionBody_Table.js.map +1 -1
  23. package/dist/esm/components/resources/ResourceLayout_DangerZone.d.ts.map +1 -1
  24. package/dist/esm/components/resources/ResourceLayout_DangerZone.js +2 -2
  25. package/dist/esm/components/resources/ResourceLayout_DangerZone.js.map +1 -1
  26. package/dist/esm/components/resources/ResourceLayout_RecordSharing.js +2 -2
  27. package/dist/esm/components/resources/ResourceLayout_RecordSharing.js.map +1 -1
  28. package/dist/esm/components/resources/ResourceListItemRenderer.d.ts.map +1 -1
  29. package/dist/esm/components/resources/ResourceListItemRenderer.js +6 -1
  30. package/dist/esm/components/resources/ResourceListItemRenderer.js.map +1 -1
  31. package/dist/esm/components/resources/skeleton/DisplayLayout.js +2 -2
  32. package/dist/esm/components/resources/skeleton/DisplayLayout.js.map +1 -1
  33. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.d.ts.map +1 -1
  34. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js +71 -16
  35. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js.map +1 -1
  36. package/dist/esm/components/sections/surface.d.ts +12 -0
  37. package/dist/esm/components/sections/surface.d.ts.map +1 -1
  38. package/dist/esm/components/sections/surface.js +14 -0
  39. package/dist/esm/components/sections/surface.js.map +1 -1
  40. package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.d.ts.map +1 -1
  41. package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.js +3 -2
  42. package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.js.map +1 -1
  43. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts +15 -0
  44. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts.map +1 -1
  45. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js +29 -0
  46. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js.map +1 -1
  47. package/dist/esm/core/app-shell/shell-motion/use-shell-motion.d.ts.map +1 -1
  48. package/dist/esm/core/app-shell/shell-motion/use-shell-motion.js +2 -2
  49. package/dist/esm/core/app-shell/shell-motion/use-shell-motion.js.map +1 -1
  50. package/dist/esm/core/branding/useBrandPresentation.d.ts.map +1 -1
  51. package/dist/esm/core/branding/useBrandPresentation.js +17 -6
  52. package/dist/esm/core/branding/useBrandPresentation.js.map +1 -1
  53. package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.d.ts.map +1 -1
  54. package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.js +11 -1
  55. package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.js.map +1 -1
  56. package/dist/esm/core/i18n/I18nContext.d.ts.map +1 -1
  57. package/dist/esm/core/i18n/I18nContext.js +8 -2
  58. package/dist/esm/core/i18n/I18nContext.js.map +1 -1
  59. package/dist/esm/core/i18n/component-label-resolution.utils.d.ts.map +1 -1
  60. package/dist/esm/core/i18n/component-label-resolution.utils.js +6 -1
  61. package/dist/esm/core/i18n/component-label-resolution.utils.js.map +1 -1
  62. package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts +0 -15
  63. package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts.map +1 -1
  64. package/dist/esm/core/monitoring/analytics/AnalyticsContext.js +71 -6
  65. package/dist/esm/core/monitoring/analytics/AnalyticsContext.js.map +1 -1
  66. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.d.ts.map +1 -1
  67. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js +12 -3
  68. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js.map +1 -1
  69. package/dist/esm/core/navigation/NavigationContext.d.ts.map +1 -1
  70. package/dist/esm/core/navigation/NavigationContext.js +60 -17
  71. package/dist/esm/core/navigation/NavigationContext.js.map +1 -1
  72. package/dist/esm/core/navigation/launcher-resolution.d.ts +29 -0
  73. package/dist/esm/core/navigation/launcher-resolution.d.ts.map +1 -1
  74. package/dist/esm/core/navigation/launcher-resolution.js +31 -0
  75. package/dist/esm/core/navigation/launcher-resolution.js.map +1 -1
  76. package/dist/esm/core/navigation/navigation-controller-internals.d.ts +48 -0
  77. package/dist/esm/core/navigation/navigation-controller-internals.d.ts.map +1 -1
  78. package/dist/esm/core/navigation/navigation-controller-internals.js +56 -3
  79. package/dist/esm/core/navigation/navigation-controller-internals.js.map +1 -1
  80. package/dist/esm/core/navigation/useNavigationRouterSync.d.ts.map +1 -1
  81. package/dist/esm/core/navigation/useNavigationRouterSync.js +30 -2
  82. package/dist/esm/core/navigation/useNavigationRouterSync.js.map +1 -1
  83. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.d.ts +44 -0
  84. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.d.ts.map +1 -0
  85. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.js +63 -0
  86. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.js.map +1 -0
  87. package/dist/esm/core/resources/useOperationDirectExecution.d.ts.map +1 -1
  88. package/dist/esm/core/resources/useOperationDirectExecution.js +45 -6
  89. package/dist/esm/core/resources/useOperationDirectExecution.js.map +1 -1
  90. package/dist/esm/core/runtime/AppRouter.d.ts.map +1 -1
  91. package/dist/esm/core/runtime/AppRouter.js +18 -1
  92. package/dist/esm/core/runtime/AppRouter.js.map +1 -1
  93. package/dist/esm/core/security/UserOrgsContext.d.ts.map +1 -1
  94. package/dist/esm/core/security/UserOrgsContext.js +61 -8
  95. package/dist/esm/core/security/UserOrgsContext.js.map +1 -1
  96. package/dist/esm/core/ui/inner-control-activation.utils.d.ts +16 -0
  97. package/dist/esm/core/ui/inner-control-activation.utils.d.ts.map +1 -0
  98. package/dist/esm/core/ui/inner-control-activation.utils.js +44 -0
  99. package/dist/esm/core/ui/inner-control-activation.utils.js.map +1 -0
  100. package/dist/tsconfig.build.tsbuildinfo +1 -1
  101. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"ResourceFieldDisplayPreset_ResourceReference_Default.js","sourceRoot":"","sources":["../../../../../../src/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayP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AC,EAAE,CAAC,CAChB,aAAa,SAAS,EAAC,mBAAmB,YAAE,EAAE,IAArC,EAAE,CAAyC,CACrD,CAAC,GACC,CACN,GACG,CACP,CAAC;IACJ,CAAC;IAED,eAAe;IACf,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,cAAK,SAAS,EAAE,SAAS,YAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAO,CAAC;IACnE,CAAC;IAED,mCAAmC;IACrC;;;;;;;;;;;;;;;;;;;OAmBG;IACD,OAAO,CACL,aAAI,SAAS,EAAE,EAAE,CAAC,gCAAgC,EAAE,SAAS,CAAC,YAC3D,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAChB,uBAAc,WAAW,CAAC,EAAE,CAAC,IAApB,EAAE,CAAwB,CACpC,CAAC,GACC,CACN,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n * ResourceFieldDisplayPreset_ResourceReference_Default\n *\n * Displays relationship selectors by resolving target ids to human-readable labels.\n *\n * Callers may come from plain FK fields or from relationship-object display\n * bridges (`user`, `products`, ...). When the resource type is not passed\n * explicitly, the preset resolves it from relationship/FK metadata in the\n * frontend registry rather than from local naming guesses alone.\n */\n\nimport React, { useEffect, useState, useCallback, useMemo, useRef } from 'react';\nimport { z } from 'zod';\nimport { Link } from 'react-router';\nimport { Skeleton } from '~wildo-frontend-lib/components/feedback/skeleton';\nimport { Badge } from '~wildo-frontend-lib/components/data-display/badge';\nimport { Text } from '~wildo-frontend-lib/components/typography/text';\nimport { useEventBus } from '~wildo-frontend-lib/core/events/useEventBus';\nimport { FrontendEvents } from '~wildo-frontend-lib/core/events/events.frontend.schemas';\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { DEFAULT_FOREIGN_KEY_DISPLAY_MODE, ForeignKeyDisplayMode } from '@wildo-ai/zod-decorators';\nimport { FrontendComponentType, TextVariant } from '@wildo-ai/presets-components-models';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { FocusIndicatorShape, focusIndicatorClasses } from '~wildo-frontend-lib/core/ui/themes/focus-indicator';\nimport { FrontendResourceUtils, frontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport { pickPreferredOperationForCoreSemanticAddressability } from '~wildo-frontend-lib/core/resources/resource-addressability.frontend.utils';\nimport { scopeReferencedRecord } from '~wildo-frontend-lib/core/resources/referenced-record-scope.frontend.utils';\nimport { useResourceDisplayContext, withoutHiddenParentReference } from '~wildo-frontend-lib/components/data-display/automatic-displayer.utils';\nimport { resolveForeignKeyReferencedResourceType } from '~wildo-frontend-lib/components/data-display/reference-display-target';\nimport { useOptionalFormSchemaContext } from '~wildo-frontend-lib/components/form/useFormSchemaContext';\nimport { CoreResourceOperation, ParentDisplay, ResourcesConfigOperationsUrlsBuilderUtils } from '@wildo-ai/saas-models';\nimport { NavigationContentType, NavigationZone } from '~wildo-frontend-lib/core/navigation/navigation.schemas';\nimport { NavigationUtils } from '~wildo-frontend-lib/core/navigation/navigation.utils';\nimport { ResourceSummaryDisplayer } from '~wildo-frontend-lib/components/data-display/ResourceSummaryDisplayer';\nimport { useUserFacingErrorMessage } from '~wildo-frontend-lib/core/errors/useUserFacingErrorMessage';\nimport type { ResourceFieldDisplayPreset_ResourceReference_DefaultProps } from '~wildo-frontend-lib/components/resources-fields/resource-reference/ResourceFieldDisplay_ResourceReference';\nimport {\n fetchResourceReferenceRecordAndLabel,\n normalizeResourceReferenceSelectionValue,\n} from '~wildo-frontend-lib/components/resources-fields/resource-reference/resource-reference.shared.utils';\nimport type { AnyFrontendResourceConfiguration, FrontendResourceConfiguration_Operation } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { ResourceOperationFrontendSurface } from '@wildo-ai/saas-models';\n\n// =============================================================================\n// TYPES (internal)\n// =============================================================================\n\ninterface ResolvedForeignKey {\n id: string;\n label: string | null;\n /** Full fetched data for SUMMARY display mode rendering. */\n data?: Record<string, unknown>;\n error: string | null;\n isLoading: boolean;\n}\n\nfunction resolvePrePopulatedRecordIdentifier(params: {\n record: Record<string, unknown>;\n resourceType: string;\n registry: ReturnType<typeof useResourceRegistry>['registry'];\n}): string | undefined {\n const configuredFieldIdentifier = params.registry.resourceConfigurations?.[params.resourceType]?.resourceFieldIdentifier\n ?? params.registry.allResourceFieldIdentifiers?.[params.resourceType];\n const rawId = (configuredFieldIdentifier ? params.record[configuredFieldIdentifier] : undefined)\n ?? params.record._id\n ?? params.record.id;\n\n return typeof rawId === 'string' && rawId !== '' ? rawId : undefined;\n}\n\n// =============================================================================\n// COMPONENT IMPLEMENTATION\n// =============================================================================\n\n/**\n * A reference's resolved LABEL, set in the body text recipe.\n *\n * It was a bare `<span>`, which takes its size from whatever encloses the value: every other display\n * value is a `Text` (the string formatter's own output), so a reference printed at the page's root\n * size while the facts around it printed at the body size — measured on the workbench's Build plan\n * and Roadmap pages, where each linked requirement read a size larger than the text it sat among.\n * `as=\"span\"` because the label sits inside a link or a button, where a block `<p>` is not allowed.\n *\n * `TextVariant.INHERIT` because the COLOUR is the wrapper's: the link or button around the label\n * carries `text-primary`, and the default variant would paint the label in the foreground colour —\n * every linkable reference in every application would stop looking like a link.\n */\n/**\n * A SUMMARY reference's link: a block in the text colour around its card, with the focus contract's offset ring and a\n * quiet hover, never the inline link's colour and underline.\n */\nconst SUMMARY_LINK_CLASSES = cn('block rounded-md text-inherit no-underline transition-colors hover:bg-muted/40', focusIndicatorClasses(FocusIndicatorShape.OFFSET));\n\nfunction ReferenceLabel({ label }: { readonly label: string }): React.JSX.Element {\n return <Text as=\"span\" variant={TextVariant.INHERIT}>{label}</Text>;\n}\n\nexport const ResourceFieldDisplayPreset_ResourceReference_Default = ({\n fieldName,\n value,\n resourceType: resourceTypeProp,\n data: prePopulatedData,\n displayParams,\n labelFallback,\n schema,\n className,\n}: ResourceFieldDisplayPreset_ResourceReference_DefaultProps): React.JSX.Element => {\n const { registry, doOperation } = useResourceRegistry();\n const { emit } = useEventBus();\n const displayContext = useResourceDisplayContext();\n const formSchemaContext = useOptionalFormSchemaContext();\n\n /*\n * Target resolution precedence: an explicit prop (the dispatcher's per-record polymorphic\n * resolution) → the decorator's declared `referencedResourceType` (an FK named in its own\n * vocabulary — see the param's JSDoc) → the field-name map (`resolveForeignKeyReferencedResourceType`, the\n * resolver `DisplayField` reads too) — and on a miss the field-name lookup THROWS, because an unresolvable FK\n * is a configuration error.\n */\n const resourceType = resolveForeignKeyReferencedResourceType({ explicitResourceType: resourceTypeProp, schema, fieldName, registry })\n || FrontendResourceUtils.resolveResourceTypeForForeignKey(fieldName, schema, registry);\n\n const { t, tComponent, formatDate, formatDateTime, isReady } = useI18n({ component: FrontendComponentType.RESOURCES_FIELDS_RESOURCE_REFERENCE, resource: resourceType });\n const toUserFacingErrorMessage = useUserFacingErrorMessage();\n\n // Resolve contextual parameters for scoped FK READ calls.\n // Display path: AutomaticDisplayer already built contextualParameters from contextResourceIdentifiers.\n // Form path: FormSchemaContext provides contextResourceIdentifiers, build params from them.\n const scopedContextualParameters = useMemo(() => {\n // Display path — pre-built contextualParameters available\n if (displayContext?.contextualParameters && Object.keys(displayContext.contextualParameters).length > 0) {\n return displayContext.contextualParameters;\n }\n // Form path — build from FormSchemaContext's contextResourceIdentifiers\n if (formSchemaContext?.contextResourceIdentifiers) {\n return FrontendResourceUtils.buildContextualParameters(\n formSchemaContext.contextResourceIdentifiers, registry\n );\n }\n return {};\n }, [displayContext?.contextualParameters, formSchemaContext?.contextResourceIdentifiers, registry]);\n\n // State for resolved labels (drives rendering)\n const [resolvedFKs, setResolvedFKs] = useState<Map<string, ResolvedForeignKey>>(new Map());\n // Ref for non-reactive reads in callbacks/effects — avoids stale closure & dependency cycle.\n // Mutated in place for synchronous accuracy across concurrent calls within the same loop.\n const resolvedFKsRef = useRef(new Map<string, ResolvedForeignKey>());\n\n /** Update both ref (immediate, for concurrent call detection) and state (for rendering). */\n const trackResolvedFK = useCallback((id: string, entry: ResolvedForeignKey) => {\n resolvedFKsRef.current.set(id, entry);\n setResolvedFKs(new Map(resolvedFKsRef.current));\n }, []);\n\n // The fallback for a caller that supplies no display params at all — today the\n // relationship-object branch of `DisplayValueDispatcher`, which renders a related\n // record rather than a decorated FK field. It derives from the SAME named source the\n // FK metadata reader (`getForeignKeyUIDisplay`) falls back to, so an unconfigured\n // reference reads identically whichever branch reached this preset. Restating a\n // `ForeignKeyDisplayMode` member here is what previously made the two disagree: this\n // site said SUMMARY while the metadata reader said LABEL, and which one an app author\n // saw depended on the branch.\n const displayMode = displayParams?.mode ?? DEFAULT_FOREIGN_KEY_DISPLAY_MODE;\n\n // ── C1 (P5-02): Parent reference display mode reconciliation ──────────\n const parentRefConfig = displayContext?.parentReferenceConfig;\n\n /*\n * The referenced ids, with a parent reference declared hidden (`ParentDisplay.NONE`) taken out — by the rule\n * `DisplayField` reads too (`withoutHiddenParentReference`), against the type resolved above, so the field box and\n * its value cannot disagree (#2195). A reference to ANOTHER record of the parent's type still renders; an array\n * holding the parent and others renders the others.\n */\n const { hidesWholeReference, visibleIds: values } = React.useMemo(\n () => withoutHiddenParentReference({\n parentReferenceConfig: parentRefConfig,\n referencedResourceType: resourceType,\n referencedIds: normalizeResourceReferenceSelectionValue(value),\n }),\n [parentRefConfig, resourceType, value],\n );\n\n /*\n * Under NONE nothing that remains is the parent — the parent's id was taken out above — so the remaining ids\n * render as the ordinary reference they are, not in a parent mode.\n */\n const isParentReference = Boolean(\n parentRefConfig\n && resourceType\n && parentRefConfig.parentResourceType === resourceType\n && parentRefConfig.displayMode !== ParentDisplay.NONE\n );\n\n /**\n * Effective display mode after reconciliation with ParentDisplay enum:\n * - CONTEXT / BREADCRUMB → forces linkable, keeps current FK mode\n * - BADGE → renders as Badge component\n * - SUMMARY → renders as inline summary text\n * - NONE → never reaches here: the hidden parent's id was taken out of `values`, and what remains is not the parent\n * - Not a parent reference → uses the decorator-based displayMode as-is\n */\n const effectiveDisplayMode = useMemo<ForeignKeyDisplayMode | ParentDisplay>(() => {\n if (!isParentReference || !parentRefConfig) return displayMode;\n\n switch (parentRefConfig.displayMode) {\n case ParentDisplay.CONTEXT:\n case ParentDisplay.BREADCRUMB:\n return displayMode;\n case ParentDisplay.BADGE:\n case ParentDisplay.SUMMARY:\n return parentRefConfig.displayMode;\n default: return displayMode;\n }\n }, [isParentReference, parentRefConfig, displayMode]);\n\n const isLinkable = useMemo(() => {\n if (isParentReference) {\n if (parentRefConfig?.showParentLink === false) {\n return false;\n }\n if (\n parentRefConfig?.displayMode === ParentDisplay.CONTEXT ||\n parentRefConfig?.displayMode === ParentDisplay.BREADCRUMB\n ) {\n return true;\n }\n }\n return displayParams?.linkable ?? true;\n }, [isParentReference, parentRefConfig, displayParams?.linkable]);\n const navigationZone = displayContext?.navigationZone ?? formSchemaContext?.navigationZone;\n\n // Check if pre-populated data is usable through the configured resource id field.\n const prePopulatedLabel = React.useMemo(() => {\n if (!prePopulatedData || typeof prePopulatedData !== 'object' || !resourceType) return null;\n\n // For single FK: prePopulatedData._id should match value\n // For array FK: prePopulatedData is not applicable (arrays need per-item population)\n if (Array.isArray(value)) return null;\n const prePopulatedId = resolvePrePopulatedRecordIdentifier({\n record: prePopulatedData,\n resourceType,\n registry,\n });\n if (!prePopulatedId || prePopulatedId !== value) return null;\n\n // An IDENTITY-ONLY object carries no label. A context read declared `ID_ONLY`, or a parent whose\n // fetch degraded, arrives as `{ _id }`, and labelling it would fall through to the id itself —\n // seeding an ObjectId as the \"resolved\" label and suppressing the fetch that would have found\n // the name (#579). Only content beyond the identity counts as pre-populated.\n const carriesContent = Object.entries(prePopulatedData as Record<string, unknown>)\n .some(([key, fieldValue]) => key !== '_id' && key !== 'id' && fieldValue !== null && fieldValue !== undefined && fieldValue !== prePopulatedId);\n if (!carriesContent) return null;\n\n return FrontendResourceUtils.computeFrontendResourceLabel({\n resourceType,\n registry,\n currentObject: prePopulatedData,\n t,\n formatDate,\n formatDateTime,\n });\n }, [prePopulatedData, resourceType, value, registry, t, formatDate, formatDateTime]);\n\n // The HOST's context identifiers, flattened to ids: the page this reference sits on (display context or\n // form context — the same source as scopedContextualParameters).\n const hostContextIdentifiers = useMemo(() => {\n const identifiers: Record<string, string> = {};\n const contextIds = displayContext?.contextResourceIdentifiers || formSchemaContext?.contextResourceIdentifiers;\n if (contextIds) {\n for (const [resType, idOrObj] of Object.entries(contextIds)) {\n const idValue = typeof idOrObj === 'string' ? idOrObj : (idOrObj as { resourceId?: string })?.resourceId;\n if (idValue) identifiers[resType] = idValue;\n }\n }\n return identifiers;\n }, [displayContext?.contextResourceIdentifiers, formSchemaContext?.contextResourceIdentifiers]);\n\n // ── B1 (P4-03): FK route infrastructure ──────────────────────────────\n // Memoize route path selection for the referenced resource type. Computed for a NON-linkable reference too: its READ\n // is sent on the same route its link would take (#2741), and whether it is drawn as a link is `wrapWithLink`'s call.\n const fkLinkUrlInfo = useMemo(() => {\n if (!resourceType) return null;\n\n const refResourceConfig = registry.resourceConfigurations[resourceType];\n if (!refResourceConfig) return null;\n\n const contextIds = displayContext?.contextResourceIdentifiers || formSchemaContext?.contextResourceIdentifiers;\n\n const currentContextResourceType = displayContext?.resourceType || formSchemaContext?.resourceType;\n const currentParentRequirements = currentContextResourceType && contextIds\n ? frontendResourceUtils.buildParentResourcesRequirements(\n currentContextResourceType,\n contextIds,\n registry,\n )\n : [];\n\n // The resource's own field identifier (e.g., 'userId' for USERS) — for URL param substitution\n const ownFieldIdentifier = registry.allResourceFieldIdentifiers?.[resourceType];\n\n return { refResourceConfig, ownFieldIdentifier, currentParentRequirements };\n }, [\n resourceType,\n registry,\n displayContext?.contextResourceIdentifiers,\n displayContext?.resourceType,\n formSchemaContext?.contextResourceIdentifiers,\n formSchemaContext?.resourceType,\n ]);\n\n /**\n * The host's context scoped to ONE referenced record (#2144): the identifiers, parameters and parent\n * requirements every per-target step below starts from — the link URL, the overlay, the label fetch and both\n * clicks. A self-referencing parent the host carries (`parentUnitId`) describes the host's own record, so it\n * is kept only for a reference to that record; a unit's link to its parent no longer names the parent as its\n * own parent. See `frontendResourceUtils.scopeHostContextToReferencedRecord`.\n */\n // The record the host renders — a display's or a form's own type and id, never read off its type slot. The\n // display context has a default value outside a provider, so it is the host only when it names a type.\n const hostRecord = displayContext?.resourceType\n ? { resourceType: displayContext.resourceType, id: displayContext.resourceId }\n : formSchemaContext\n ? { resourceType: formSchemaContext.resourceType, id: formSchemaContext.resourceId }\n : undefined;\n const hostRecordType = hostRecord?.resourceType;\n const hostRecordId = hostRecord?.id;\n const scopeToTarget = useCallback((id: string) => scopeReferencedRecord({\n hostIdentifiers: hostContextIdentifiers,\n hostContextualParameters: scopedContextualParameters,\n hostParentRequirements: fkLinkUrlInfo?.currentParentRequirements,\n hostRecord: { resourceType: hostRecordType, id: hostRecordId },\n targetResourceType: resourceType ?? '',\n targetId: id,\n registry,\n }), [hostContextIdentifiers, scopedContextualParameters, fkLinkUrlInfo?.currentParentRequirements, hostRecordType, hostRecordId, resourceType, registry]);\n\n /**\n * Resolve a concrete link URL for a given FK value.\n * Builds scoped URLs like /organizations/org-123/users/user-456 instead of /USERS/user-456.\n */\n const resolveFkNavigationTarget = useCallback((id: string): {\n url: string;\n parentResourcesRequirements: ReturnType<typeof frontendResourceUtils.buildParentResourcesRequirementsFromRouteParams>;\n readOp: FrontendResourceConfiguration_Operation;\n } | null => {\n if (!fkLinkUrlInfo || !resourceType) return null;\n\n const { refResourceConfig, ownFieldIdentifier } = fkLinkUrlInfo;\n const targetScope = scopeToTarget(id);\n\n // Add the FK's own resource type → ID for route matching\n const fullContextIdentifiers = { ...targetScope.identifiers, [resourceType]: id };\n const contextualParameters = {\n ...targetScope.contextualParameters,\n ...(ownFieldIdentifier ? { [ownFieldIdentifier]: id } : {}),\n };\n const readOp = pickPreferredOperationForCoreSemanticAddressability({\n resourceConfig: refResourceConfig,\n operations: refResourceConfig.operations ?? [],\n coreOperation: CoreResourceOperation.READ,\n registry,\n hasResourceId: true,\n requireFrontendAddressable: true,\n contextResourceIdentifiers: fullContextIdentifiers,\n contextualParameters,\n });\n if (!readOp) return null;\n\n const routePaths = ResourcesConfigOperationsUrlsBuilderUtils.buildOperationFrontendRoutePaths(\n refResourceConfig,\n readOp,\n registry.allResourceFieldIdentifiers,\n );\n if (routePaths.length === 0) return null;\n\n try {\n const matchingPath = frontendResourceUtils.selectMatchingRoutePath(\n routePaths,\n fullContextIdentifiers,\n resourceType,\n ownFieldIdentifier,\n targetScope.parentRequirements,\n registry.allResourceFieldIdentifiers,\n );\n if (!matchingPath?.url) return null;\n const targetParentResourcesRequirements = frontendResourceUtils.buildParentResourcesRequirementsFromRouteParams(\n matchingPath.parameters ?? [],\n resourceType,\n registry,\n );\n\n // Build field identifiers for URL parameter substitution\n const fieldIdentifiers: Record<string, string> = {};\n // Parent field identifiers from the target's scoped contextual parameters\n for (const [key, val] of Object.entries(targetScope.contextualParameters)) {\n if (val !== undefined && val !== null) fieldIdentifiers[key] = String(val);\n }\n // Resource's own field identifier → FK value\n if (ownFieldIdentifier) {\n fieldIdentifiers[ownFieldIdentifier] = id;\n }\n\n const resolved = NavigationUtils.resolveUrlPath(matchingPath.url, fieldIdentifiers);\n // Only return if fully resolved (no remaining :param placeholders)\n if (resolved && !NavigationUtils.hasUnresolvedPlaceholders(resolved)) {\n return {\n url: resolved,\n parentResourcesRequirements: targetParentResourcesRequirements,\n readOp,\n };\n }\n } catch {\n // selectMatchingRoutePath may throw — graceful fallback\n }\n\n return null;\n }, [fkLinkUrlInfo, registry, resourceType, scopeToTarget]);\n\n /**\n * The OVERLAY fallback — a reference whose target READ is `EMBEDDED` (decided 2026-09-01).\n *\n * An EMBEDDED read has no route by contract (\"rendered within a host — overlay/drill-in when\n * standalone\"), so the URL resolver above answers null and the reference used to render as a\n * DEAD label. The navigation layer already escalates EMBEDDED content to an overlay\n * (`navigation-policy-resolver`: EMBEDDED never becomes THE PAGE) — all this resolver adds is\n * the read operation to hand it. API_ONLY stays dead on purpose: headless means no interface.\n */\n const resolveFkOverlayTarget = useCallback((id: string): {\n readOp: FrontendResourceConfiguration_Operation;\n } | null => {\n if (!fkLinkUrlInfo || !resourceType) return null;\n const { refResourceConfig, ownFieldIdentifier } = fkLinkUrlInfo;\n const targetScope = scopeToTarget(id);\n const fullContextIdentifiers = { ...targetScope.identifiers, [resourceType]: id };\n const readOp = pickPreferredOperationForCoreSemanticAddressability({\n resourceConfig: refResourceConfig,\n operations: refResourceConfig.operations ?? [],\n coreOperation: CoreResourceOperation.READ,\n registry,\n hasResourceId: true,\n requireFrontendAddressable: false,\n contextResourceIdentifiers: fullContextIdentifiers,\n contextualParameters: {\n ...targetScope.contextualParameters,\n ...(ownFieldIdentifier ? { [ownFieldIdentifier]: id } : {}),\n },\n });\n if (!readOp) return null;\n if (readOp.operationFrontendConfig?.surface !== ResourceOperationFrontendSurface.EMBEDDED) return null;\n return { readOp };\n }, [fkLinkUrlInfo, registry, resourceType, scopeToTarget]);\n\n /**\n * The route a reference's READ is sent on: the route it links to, else — for a target with no page to link to (an\n * EMBEDDED or API_ONLY read) — the READ's own most specific HTTP route its target-scoped parameters satisfy. Either\n * way the read carries that route's parent chain, so a working scope the scoped registry injects into every call (a\n * selected list) cannot reroute it under a parent the record need not have (#2741). `null` when no READ addresses the\n * target from its scope: `fetchResourceReferenceRecordAndLabel` then pins the route the scope it is handed selects, if\n * any, and sends the read unpinned only when no route is satisfiable from it (#2746).\n */\n const resolveReadPin = useCallback((id: string): {\n readOp: FrontendResourceConfiguration_Operation;\n parentResourcesRequirements: ReturnType<typeof frontendResourceUtils.buildParentResourcesRequirementsFromRouteParams>;\n } | null => {\n const linkTarget = resolveFkNavigationTarget(id);\n if (linkTarget) return { readOp: linkTarget.readOp, parentResourcesRequirements: linkTarget.parentResourcesRequirements };\n if (!fkLinkUrlInfo || !resourceType) return null;\n const { refResourceConfig, ownFieldIdentifier } = fkLinkUrlInfo;\n const targetScope = scopeToTarget(id);\n const contextualParameters = { ...targetScope.contextualParameters, ...(ownFieldIdentifier ? { [ownFieldIdentifier]: id } : {}) };\n const readOp = pickPreferredOperationForCoreSemanticAddressability({\n resourceConfig: refResourceConfig,\n operations: refResourceConfig.operations ?? [],\n coreOperation: CoreResourceOperation.READ,\n registry,\n hasResourceId: true,\n requireFrontendAddressable: false,\n contextResourceIdentifiers: { ...targetScope.identifiers, [resourceType]: id },\n contextualParameters,\n });\n if (!readOp) return null;\n const initiator = FrontendResourceUtils.selectOperationUrlInitiatorInfo({\n initiatorInfos: readOp.initiatorInfos ?? [],\n contextualParameters,\n targetResourceType: resourceType,\n targetDefaultFieldIdentifier: ownFieldIdentifier ?? '',\n });\n if (!initiator) return null;\n return {\n readOp,\n parentResourcesRequirements: frontendResourceUtils.buildParentResourcesRequirementsFromRouteParams(initiator.parameters, resourceType, registry),\n };\n }, [resolveFkNavigationTarget, fkLinkUrlInfo, resourceType, scopeToTarget, registry]);\n\n // Resolve a single FK value via API\n const resolveForeignKey = useCallback(async (id: string) => {\n if (!resourceType || !id) return;\n\n // Skip if already resolved or loading (read from ref for synchronous accuracy)\n const existing = resolvedFKsRef.current.get(id);\n if (existing && (existing.label !== null || existing.isLoading)) {\n return;\n }\n\n // Mark as loading — ref update is immediate for concurrent call detection\n trackResolvedFK(id, { id, label: null, error: null, isLoading: true });\n\n try {\n /*\n * Read on the route the reference links to (#2741): the most specific route its target-scoped context\n * satisfies, which `scopeReferencedRecord` keeps to the tenancy unless the target is the host's own record or is\n * readable only under a parent. Without the pin the request takes the most specific route its PARAMETERS\n * satisfy, and the scoped registry injects the viewer's whole working scope into every call: with a list\n * selected in a quick-switcher, a todo of another list was read under the selected one, refused, and shown as\n * unavailable. A target with no page to link to is pinned to its READ's own route (`resolveReadPin`).\n */\n const routeTarget = resolveReadPin(id);\n const { record: fetchedRecord, label } = await fetchResourceReferenceRecordAndLabel({\n resourceType,\n id,\n registry,\n doOperation,\n ...(routeTarget ? { readOperation: routeTarget.readOp, parentResourcesRequirements: routeTarget.parentResourcesRequirements } : {}),\n // The target's own scope: a parent the host carries for ITS record is not the target's parent.\n contextualParameters: scopeToTarget(id).contextualParameters,\n t,\n formatDate,\n formatDateTime,\n });\n\n trackResolvedFK(id, { id, label, data: fetchedRecord, error: null, isLoading: false });\n } catch (err) {\n // Shown as the id's tooltip, so resolved to localized text — `extractErrorInfo(err).message` was the\n // backend's i18n REFERENCE (#1160).\n trackResolvedFK(id, { id, label: null, error: toUserFacingErrorMessage(err), isLoading: false });\n }\n }, [resourceType, registry, doOperation, trackResolvedFK, t, formatDate, formatDateTime, scopeToTarget, toUserFacingErrorMessage, resolveReadPin]);\n\n // Resolve all FK values on mount/change — skip API when pre-populated data is available\n useEffect(() => {\n if (!resourceType || values.length === 0) return;\n\n // Only resolve if mode requires it — skip for ID display\n if (effectiveDisplayMode === ForeignKeyDisplayMode.ID) return;\n\n // If pre-populated label is available for single value, seed it into resolvedFKs\n if (prePopulatedLabel && values.length === 1 && !resolvedFKsRef.current.has(values[0])) {\n trackResolvedFK(values[0], {\n id: values[0],\n label: prePopulatedLabel,\n data: prePopulatedData as Record<string, unknown> | undefined,\n error: null,\n isLoading: false,\n });\n return;\n }\n\n values.forEach(id => {\n if (id && !resolvedFKsRef.current.has(id)) {\n resolveForeignKey(id);\n }\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps -- resolvedFKsRef used for non-reactive reads; resolvedFKs state intentionally excluded to break re-render cycle\n }, [resourceType, values, effectiveDisplayMode, resolveForeignKey, trackResolvedFK, prePopulatedLabel]);\n\n /**\n * Wrap content in a link/clickable element when linkable.\n * Parent references use onNavigateToParent (controller-managed) with URL fallback.\n */\n const wrapWithLink = useCallback((id: string, content: React.ReactNode): React.ReactNode => {\n if (!isLinkable || !resourceType) return content;\n // A SUMMARY card is block content: underlining it and painting it in the link colour underlined every line and\n // badge of the card. It is a block link instead, drawn by the focus contract, as a selectable card is.\n const summaryLink = effectiveDisplayMode === ForeignKeyDisplayMode.SUMMARY;\n\n const navigationTarget = resolveFkNavigationTarget(id);\n const shouldUseControllerNavigation = Boolean(navigationZone && navigationTarget?.readOp && navigationTarget?.url);\n\n const handleReferenceNavigation = (e: React.MouseEvent) => {\n if (\n !shouldUseControllerNavigation\n || !navigationTarget\n || e.button !== 0\n || e.ctrlKey\n || e.metaKey\n || e.shiftKey\n || e.altKey\n ) {\n return;\n }\n\n const fullContextIdentifiers = {\n ...scopeToTarget(id).identifiers,\n [resourceType]: id,\n };\n const readContext = frontendResourceUtils.createFrontendResourceOperationContextFromOperation({\n resourceType,\n operation: navigationTarget.readOp,\n contextResourceIdentifiers: fullContextIdentifiers,\n parentResourcesRequirements: navigationTarget.parentResourcesRequirements,\n });\n\n e.preventDefault();\n emit(FrontendEvents.NAVIGATION_REQUEST, {\n content: {\n contentType: NavigationContentType.RESOURCE_OPERATION,\n resourceContext: readContext,\n },\n initiator: { sourceZone: navigationZone },\n urlPath: navigationTarget.url,\n });\n };\n\n if (isParentReference && parentRefConfig?.onNavigateToParent) {\n const handleClick = (e: React.MouseEvent) => {\n if (e.button !== 0 || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) return;\n const handled = parentRefConfig.onNavigateToParent!(id);\n if (handled !== false) {\n e.preventDefault();\n }\n };\n\n if (navigationTarget?.url) {\n return (\n <Link to={navigationTarget.url} className=\"text-primary hover:underline\" onClick={handleClick}>\n {content}\n </Link>\n );\n }\n return (\n <button\n type=\"button\"\n /*\n * `block`, not the button default `inline-block` — and `inline` cannot work here.\n *\n * An inline-block's baseline is the baseline of its LAST line box, so inside a bulleted\n * list item a two-line reference dragged the ::marker down to its final line (measured on\n * the workbench's Requirements page, where every multi-valued \"Serves jobs\" link wraps).\n * The obvious fix, `display: inline`, is silently overridden: browsers fix up `inline` on\n * form controls to `inline-block` (verified via CDP — the cascade applied `.inline` and\n * the computed value stayed `inline-block`), so the class sat in the DOM doing nothing.\n * A BLOCK child is the shape that works: an outside marker aligns with the first line box\n * of a list item's block content, exactly like `<li><p>…</p></li>`.\n */\n className=\"block text-primary hover:underline bg-transparent border-none p-0 cursor-pointer text-left\"\n onClick={() => {\n parentRefConfig.onNavigateToParent!(id);\n }}\n >\n {content}\n </button>\n );\n }\n\n if (navigationTarget?.url) {\n return (\n <Link to={navigationTarget.url} className={summaryLink ? SUMMARY_LINK_CLASSES : 'text-primary hover:underline'} onClick={handleReferenceNavigation}>\n {content}\n </Link>\n );\n }\n\n /*\n * No route — the EMBEDDED-read overlay fallback (see `resolveFkOverlayTarget`).\n *\n * The source zone DEFAULTS to PRIMARY rather than gating on a context-provided zone: a\n * reference rendered by a display host that never plumbed `navigationZone` (an artifact\n * document, a composite view) would otherwise render its resolved label as dead text — the\n * silent-degradation shape this fallback exists to remove. PRIMARY is where such hosts live.\n */\n const overlayTarget = resolveFkOverlayTarget(id);\n if (overlayTarget) {\n const openOverlay = (e: React.MouseEvent) => {\n if (e.button !== 0 || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) return;\n e.preventDefault();\n const targetScope = scopeToTarget(id);\n const readContext = frontendResourceUtils.createFrontendResourceOperationContextFromOperation({\n resourceType,\n operation: overlayTarget.readOp,\n contextResourceIdentifiers: {\n ...targetScope.identifiers,\n [resourceType]: id,\n },\n parentResourcesRequirements: targetScope.parentRequirements,\n });\n // No urlPath on purpose: an overlay is not a place — nothing to deep-link, nothing to pop.\n emit(FrontendEvents.NAVIGATION_REQUEST, {\n content: {\n contentType: NavigationContentType.RESOURCE_OPERATION,\n resourceContext: readContext,\n },\n initiator: { sourceZone: navigationZone ?? NavigationZone.PRIMARY },\n });\n };\n return (\n <button\n type=\"button\"\n /*\n * `block`, not the button default `inline-block` — and `inline` cannot work here.\n *\n * An inline-block's baseline is the baseline of its LAST line box, so inside a bulleted\n * list item a two-line reference dragged the ::marker down to its final line (measured on\n * the workbench's Requirements page, where every multi-valued \"Serves jobs\" link wraps).\n * The obvious fix, `display: inline`, is silently overridden: browsers fix up `inline` on\n * form controls to `inline-block` (verified via CDP — the cascade applied `.inline` and\n * the computed value stayed `inline-block`), so the class sat in the DOM doing nothing.\n * A BLOCK child is the shape that works: an outside marker aligns with the first line box\n * of a list item's block content, exactly like `<li><p>…</p></li>`.\n */\n className={summaryLink\n ? cn(SUMMARY_LINK_CLASSES, 'w-full bg-transparent border-none p-0 cursor-pointer text-left')\n : 'block text-primary hover:underline bg-transparent border-none p-0 cursor-pointer text-left'}\n onClick={openOverlay}\n >\n {content}\n </button>\n );\n }\n\n return content;\n }, [emit, effectiveDisplayMode, fkLinkUrlInfo, isLinkable, isParentReference, navigationZone, parentRefConfig, resolveFkNavigationTarget, resolveFkOverlayTarget, resourceType, scopeToTarget]);\n\n // Render a single value\n const renderValue = useCallback((id: string) => {\n if (effectiveDisplayMode === ForeignKeyDisplayMode.ID) {\n return <span className=\"font-mono text-sm\">{id}</span>;\n }\n\n const resolved = resolvedFKs.get(id);\n const isLoading = resolved?.isLoading ?? false;\n\n if (isLoading || !resolved) {\n return <Skeleton className=\"h-4 w-24 inline-block\" />;\n }\n\n if (resolved.error) {\n // A FAILED resolution is exactly where the record's own readable copy earns its keep — more\n // so than an empty one. Measured 2026-09-19 on the member directory: reading another user's\n // record answers 403 for most rows, so this branch (not the empty-label one below) is what\n // printed `6aaba6b3a2d3b6b0ad61f33e` in the USER column.\n //\n // The error is NOT swallowed: it stays on `title`, so the failure is still discoverable, and a\n // field that declares no `labelFallbackField` still shows the id exactly as before. What\n // changes is only that a readable value present on the row is preferred to an opaque one.\n if (labelFallback) {\n return (\n <span className=\"text-muted-foreground text-sm\" title={resolved.error}>\n {labelFallback}\n </span>\n );\n }\n // No readable copy: the field says the record cannot be shown, and keeps the id (and why) on hover for whoever\n // needs to trace it. An id told a reader nothing (#2329). The words claim no reason on purpose: a 404 is not proof\n // the record is gone, because a read across a tenant boundary answers 404 by design, so a refusal and a deletion\n // are the same answer here, and \"no longer exists\" would be false for the first.\n return (\n <span className=\"text-muted-foreground text-sm italic\" title={`${id} · ${resolved.error}`}>\n {tComponent(FrontendComponentType.RESOURCES_FIELDS_RESOURCE_REFERENCE, 'recordUnavailable')}\n </span>\n );\n }\n\n // The id is the LAST resort, not the first. A record carrying a readable copy of the reference\n // (`labelFallbackField`) shows that instead — which is what keeps a member directory readable\n // for people who have no profile for a label to be built from.\n /*\n * Named from the fetched record with the CURRENT `t`, not the label frozen at fetch time (#1851 review). A\n * record whose name reads another label section (a product named by `billing_products.<key>.name`) could be\n * fetched before those words arrived, and the stored label then kept its key for the life of the component.\n * The stored label is used only when there is no stored record (`data`) or the resource declares no label\n * strategy: such a name cannot change with the words, and the resolver would log its configuration gap on every\n * render. A strategy that returns an empty name for some record also logs on each render; accepted, since\n * that is a labelling defect in the strategy and the log names it.\n */\n const hasLabelStrategy = !!resourceType\n && !!FrontendResourceUtils.frontendResourceLabelDefinitionOf(registry.resourceConfigurations?.[resourceType] as AnyFrontendResourceConfiguration | undefined);\n const currentLabel = resolved.data && resourceType && hasLabelStrategy\n ? FrontendResourceUtils.computeFrontendResourceLabel({ resourceType, registry, currentObject: resolved.data, t, formatDate, formatDateTime })\n : null;\n const label = currentLabel || resolved.label || labelFallback || id;\n\n if (effectiveDisplayMode === ParentDisplay.BADGE) {\n const handleBadgeClick = isLinkable && parentRefConfig?.onNavigateToParent\n ? () => parentRefConfig.onNavigateToParent!(id)\n : undefined;\n return (\n <Badge\n variant=\"secondary\"\n className={handleBadgeClick ? 'cursor-pointer hover:opacity-[var(--opacity-hover)]' : undefined}\n onClick={handleBadgeClick}\n >\n {label}\n </Badge>\n );\n }\n\n // \"summary\" mode — ParentDisplay.SUMMARY and ForeignKeyDisplayMode.SUMMARY share\n // the same string value, so we distinguish by isParentReference.\n if (effectiveDisplayMode === ParentDisplay.SUMMARY) {\n if (isParentReference) {\n const handleInlineClick = isLinkable && parentRefConfig?.onNavigateToParent\n ? () => parentRefConfig.onNavigateToParent!(id)\n : undefined;\n return (\n <span\n className={`text-muted-foreground text-sm ${handleInlineClick ? 'cursor-pointer hover:text-foreground transition-colors' : ''}`}\n onClick={handleInlineClick}\n role={handleInlineClick ? 'button' : undefined}\n tabIndex={handleInlineClick ? 0 : undefined}\n onKeyDown={handleInlineClick ? (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); handleInlineClick(); }} : undefined}\n >\n {label}\n </span>\n );\n }\n\n // FK field SUMMARY mode — render ResourceSummaryDisplayer\n if (resolved.data && resourceType) {\n const refConfig = registry.resourceConfigurations[resourceType];\n // The referenced record's own schema (#2455): for an inheritance resource, the variant its discriminators name.\n const summarySchema = FrontendResourceUtils.resolveRowSchema(refConfig, resolved.data as Record<string, unknown>);\n if (summarySchema) {\n const summaryContent = (\n <ResourceSummaryDisplayer\n resourceType={resourceType}\n schema={summarySchema}\n data={resolved.data}\n // The referenced record's NAME. The field's own label names the FIELD (\"Target todo\"),\n // never the record, and this card REPLACES the one-line label — so without it nothing on\n // screen says which record is referenced. Measured on Wonder Todos: a relationship row\n // read \"Blocks → Pending –\", the blocked todo's badges with no title. The edit picker\n // passes its option label for the same reason.\n primaryLabel={label}\n // The host's scope narrowed to the referenced record (#2144): the record's own fields read there (#2198).\n contextResourceIdentifiers={scopeToTarget(id).identifiers}\n />\n );\n return isLinkable ? wrapWithLink(id, summaryContent) : summaryContent;\n }\n }\n\n return wrapWithLink(id, <ReferenceLabel label={label} />);\n }\n\n // ForeignKeyDisplayMode.LABEL — resolved label, optionally linkable\n if (effectiveDisplayMode === ForeignKeyDisplayMode.LABEL) {\n return wrapWithLink(id, <ReferenceLabel label={label} />);\n }\n\n // Fallback — render as label\n return wrapWithLink(id, <ReferenceLabel label={label} />);\n }, [effectiveDisplayMode, resolvedFKs, resourceType, isParentReference, parentRefConfig, wrapWithLink, registry, isLinkable, t, tComponent, formatDate, formatDateTime, labelFallback]);\n\n // NONE is \"don't show any parent reference\": when the parent was all there was, the reference is absent — never an\n // empty-value mark in its place (#2195). A display field omits the whole field by the same rule.\n if (hidesWholeReference) {\n return null;\n }\n\n // Handle empty values\n if (values.length === 0) {\n return <span className=\"text-muted-foreground\">-</span>;\n }\n\n // Unknown resource type warning\n if (!resourceType && effectiveDisplayMode !== ForeignKeyDisplayMode.ID) {\n // Fall back to showing IDs with a warning\n return (\n <div className={className} title=\"Unknown resource type - showing IDs\">\n {values.length === 1 ? (\n <span className=\"font-mono text-sm\">{values[0]}</span>\n ) : (\n <ul className=\"list-disc ps-4 space-y-item-xs\">\n {values.map(id => (\n <li key={id} className=\"font-mono text-sm\">{id}</li>\n ))}\n </ul>\n )}\n </div>\n );\n }\n\n // Single value\n if (values.length === 1) {\n return <div className={className}>{renderValue(values[0])}</div>;\n }\n\n // Multiple values - render as list\n/*\n * `list-outside` (the default) with a start PADDING, NOT `list-inside`.\n *\n * `list-inside` puts the marker into the item's INLINE FLOW, where it has to share the first line\n * with the item's content — and the content here is a reference button, which is `inline-block`. An\n * inline-block box cannot break across lines, so as soon as its label is longer than the remaining\n * first line it wraps as ONE unit to the next, leaving the bullet stranded alone on a line of its\n * own. Measured on the workbench's Requirements page: every \"Serves jobs\" entry rendered as a bare\n * dot above its link, while \"Serves ICPs\" looked fine purely because it had ONE short-labelled\n * value — the single-value branch above renders no list at all, and a short label happened to fit.\n *\n * Outside markers sit in the margin and take no part in the inline flow, so the content may wrap\n * freely and the marker stays on the first line.\n *\n * PADDING rather than the `ms-4` margin this used until 2026-09-25, because the list is the value's\n * ROOT and a vertical field chrome stretches its children to `w-full`: a margin then pushes a\n * full-width box 1rem past its column, measured on the workbench's Build plan page where every\n * \"Serves functional requirements\" link ran to the pane's edge. An outside marker is drawn in the\n * list's padding box, so `ps-4` keeps the same inset inside the width instead of beyond it.\n */\n return (\n <ul className={cn('list-disc ps-4 space-y-item-xs', className)}>\n {values.map(id => (\n <li key={id}>{renderValue(id)}</li>\n ))}\n </ul>\n );\n};\n"]}
1
+ {"version":3,"file":"ResourceFieldDisplayPreset_ResourceReference_Default.js","sourceRoot":"","sources":["../../../../../../src/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_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CAAC,EAAE,CAAC,CAChB,uBAAc,WAAW,CAAC,EAAE,CAAC,IAApB,EAAE,CAAwB,CACpC,CAAC,GACC,CACN,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n * ResourceFieldDisplayPreset_ResourceReference_Default\n *\n * Displays relationship selectors by resolving target ids to human-readable labels.\n *\n * Callers may come from plain FK fields or from relationship-object display\n * bridges (`user`, `products`, ...). When the resource type is not passed\n * explicitly, the preset resolves it from relationship/FK metadata in the\n * frontend registry rather than from local naming guesses alone.\n */\n\nimport React, { useContext, useEffect, useState, useCallback, useMemo, useRef } from 'react';\nimport { z } from 'zod';\nimport { Link } from 'react-router';\nimport { Skeleton } from '~wildo-frontend-lib/components/feedback/skeleton';\nimport { Badge } from '~wildo-frontend-lib/components/data-display/badge';\nimport { Text } from '~wildo-frontend-lib/components/typography/text';\nimport { useEventBus } from '~wildo-frontend-lib/core/events/useEventBus';\nimport { FrontendEvents } from '~wildo-frontend-lib/core/events/events.frontend.schemas';\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { DEFAULT_FOREIGN_KEY_DISPLAY_MODE, ForeignKeyDisplayMode } from '@wildo-ai/zod-decorators';\nimport { FrontendComponentType, TextVariant } from '@wildo-ai/presets-components-models';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { FocusIndicatorShape, focusIndicatorClasses } from '~wildo-frontend-lib/core/ui/themes/focus-indicator';\nimport { FrontendResourceUtils, frontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport { pickPreferredOperationForCoreSemanticAddressability, resolveRecordOrganizationId } from '~wildo-frontend-lib/core/resources/resource-addressability.frontend.utils';\nimport { viewerReachesUserSubject } from '~wildo-frontend-lib/core/navigation/launcher-resolution';\nimport { useViewerEffectiveRolesInOrganization } from '~wildo-frontend-lib/core/navigation/launcher-runtime-availability';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { scopeReferencedRecord } from '~wildo-frontend-lib/core/resources/referenced-record-scope.frontend.utils';\nimport { useResourceDisplayContext, withoutHiddenParentReference } from '~wildo-frontend-lib/components/data-display/automatic-displayer.utils';\nimport { resolveForeignKeyReferencedResourceType } from '~wildo-frontend-lib/components/data-display/reference-display-target';\nimport { useOptionalFormSchemaContext } from '~wildo-frontend-lib/components/form/useFormSchemaContext';\nimport { CoreResourceOperation, CoreResourceType, coreResourceShared_FieldIdentifier, ParentDisplay, ResourcesConfigOperationsUrlsBuilderUtils } from '@wildo-ai/saas-models';\nimport { NavigationContentType, NavigationZone } from '~wildo-frontend-lib/core/navigation/navigation.schemas';\nimport { NavigationUtils } from '~wildo-frontend-lib/core/navigation/navigation.utils';\nimport { ScopedNavigationControllerContext, type NavigateOptions } from '~wildo-frontend-lib/core/navigation/useNavigationController';\nimport { ResourceSummaryDisplayer } from '~wildo-frontend-lib/components/data-display/ResourceSummaryDisplayer';\nimport { useUserFacingErrorMessage } from '~wildo-frontend-lib/core/errors/useUserFacingErrorMessage';\nimport type { ResourceFieldDisplayPreset_ResourceReference_DefaultProps } from '~wildo-frontend-lib/components/resources-fields/resource-reference/ResourceFieldDisplay_ResourceReference';\nimport {\n fetchResourceReferenceRecordAndLabel,\n normalizeResourceReferenceSelectionValue,\n} from '~wildo-frontend-lib/components/resources-fields/resource-reference/resource-reference.shared.utils';\nimport type { AnyFrontendResourceConfiguration, FrontendResourceConfiguration_Operation } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { ResourceOperationFrontendSurface } from '@wildo-ai/saas-models';\n\n// =============================================================================\n// TYPES (internal)\n// =============================================================================\n\ninterface ResolvedForeignKey {\n id: string;\n label: string | null;\n /** Full fetched data for SUMMARY display mode rendering. */\n data?: Record<string, unknown>;\n error: string | null;\n isLoading: boolean;\n}\n\nfunction resolvePrePopulatedRecordIdentifier(params: {\n record: Record<string, unknown>;\n resourceType: string;\n registry: ReturnType<typeof useResourceRegistry>['registry'];\n}): string | undefined {\n const configuredFieldIdentifier = params.registry.resourceConfigurations?.[params.resourceType]?.resourceFieldIdentifier\n ?? params.registry.allResourceFieldIdentifiers?.[params.resourceType];\n const rawId = (configuredFieldIdentifier ? params.record[configuredFieldIdentifier] : undefined)\n ?? params.record._id\n ?? params.record.id;\n\n return typeof rawId === 'string' && rawId !== '' ? rawId : undefined;\n}\n\n// =============================================================================\n// COMPONENT IMPLEMENTATION\n// =============================================================================\n\n/**\n * A reference's resolved LABEL, set in the body text recipe.\n *\n * It was a bare `<span>`, which takes its size from whatever encloses the value: every other display\n * value is a `Text` (the string formatter's own output), so a reference printed at the page's root\n * size while the facts around it printed at the body size — measured on the workbench's Build plan\n * and Roadmap pages, where each linked requirement read a size larger than the text it sat among.\n * `as=\"span\"` because the label sits inside a link or a button, where a block `<p>` is not allowed.\n *\n * `TextVariant.INHERIT` because the COLOUR is the wrapper's: the link or button around the label\n * carries `text-primary`, and the default variant would paint the label in the foreground colour —\n * every linkable reference in every application would stop looking like a link.\n */\n/**\n * A SUMMARY reference's link: a block in the text colour around its card, with the focus contract's offset ring and a\n * quiet hover, never the inline link's colour and underline.\n */\nconst SUMMARY_LINK_CLASSES = cn('block rounded-md text-inherit no-underline transition-colors hover:bg-muted/40', focusIndicatorClasses(FocusIndicatorShape.OFFSET));\n\nfunction ReferenceLabel({ label }: { readonly label: string }): React.JSX.Element {\n return <Text as=\"span\" variant={TextVariant.INHERIT}>{label}</Text>;\n}\n\nexport const ResourceFieldDisplayPreset_ResourceReference_Default = ({\n fieldName,\n value,\n resourceType: resourceTypeProp,\n data: prePopulatedData,\n displayParams,\n labelFallback,\n schema,\n className,\n}: ResourceFieldDisplayPreset_ResourceReference_DefaultProps): React.JSX.Element => {\n const { registry, doOperation } = useResourceRegistry();\n const { emit } = useEventBus();\n const displayContext = useResourceDisplayContext();\n const formSchemaContext = useOptionalFormSchemaContext();\n\n /*\n * Target resolution precedence: an explicit prop (the dispatcher's per-record polymorphic\n * resolution) → the decorator's declared `referencedResourceType` (an FK named in its own\n * vocabulary — see the param's JSDoc) → the field-name map (`resolveForeignKeyReferencedResourceType`, the\n * resolver `DisplayField` reads too) — and on a miss the field-name lookup THROWS, because an unresolvable FK\n * is a configuration error.\n */\n const resourceType = resolveForeignKeyReferencedResourceType({ explicitResourceType: resourceTypeProp, schema, fieldName, registry })\n || FrontendResourceUtils.resolveResourceTypeForForeignKey(fieldName, schema, registry);\n\n const { t, tComponent, formatDate, formatDateTime, isReady } = useI18n({ component: FrontendComponentType.RESOURCES_FIELDS_RESOURCE_REFERENCE, resource: resourceType });\n const toUserFacingErrorMessage = useUserFacingErrorMessage();\n\n // Resolve contextual parameters for scoped FK READ calls.\n // Display path: AutomaticDisplayer already built contextualParameters from contextResourceIdentifiers.\n // Form path: FormSchemaContext provides contextResourceIdentifiers, build params from them.\n const scopedContextualParameters = useMemo(() => {\n // Display path — pre-built contextualParameters available\n if (displayContext?.contextualParameters && Object.keys(displayContext.contextualParameters).length > 0) {\n return displayContext.contextualParameters;\n }\n // Form path — build from FormSchemaContext's contextResourceIdentifiers\n if (formSchemaContext?.contextResourceIdentifiers) {\n return FrontendResourceUtils.buildContextualParameters(\n formSchemaContext.contextResourceIdentifiers, registry\n );\n }\n return {};\n }, [displayContext?.contextualParameters, formSchemaContext?.contextResourceIdentifiers, registry]);\n\n // State for resolved labels (drives rendering)\n const [resolvedFKs, setResolvedFKs] = useState<Map<string, ResolvedForeignKey>>(new Map());\n // Ref for non-reactive reads in callbacks/effects — avoids stale closure & dependency cycle.\n // Mutated in place for synchronous accuracy across concurrent calls within the same loop.\n const resolvedFKsRef = useRef(new Map<string, ResolvedForeignKey>());\n\n /** Update both ref (immediate, for concurrent call detection) and state (for rendering). */\n const trackResolvedFK = useCallback((id: string, entry: ResolvedForeignKey) => {\n resolvedFKsRef.current.set(id, entry);\n setResolvedFKs(new Map(resolvedFKsRef.current));\n }, []);\n\n // The fallback for a caller that supplies no display params at all — today the\n // relationship-object branch of `DisplayValueDispatcher`, which renders a related\n // record rather than a decorated FK field. It derives from the SAME named source the\n // FK metadata reader (`getForeignKeyUIDisplay`) falls back to, so an unconfigured\n // reference reads identically whichever branch reached this preset. Restating a\n // `ForeignKeyDisplayMode` member here is what previously made the two disagree: this\n // site said SUMMARY while the metadata reader said LABEL, and which one an app author\n // saw depended on the branch.\n const displayMode = displayParams?.mode ?? DEFAULT_FOREIGN_KEY_DISPLAY_MODE;\n\n // ── C1 (P5-02): Parent reference display mode reconciliation ──────────\n const parentRefConfig = displayContext?.parentReferenceConfig;\n\n /*\n * The referenced ids, with a parent reference declared hidden (`ParentDisplay.NONE`) taken out — by the rule\n * `DisplayField` reads too (`withoutHiddenParentReference`), against the type resolved above, so the field box and\n * its value cannot disagree (#2195). A reference to ANOTHER record of the parent's type still renders; an array\n * holding the parent and others renders the others.\n */\n const { hidesWholeReference, visibleIds: values } = React.useMemo(\n () => withoutHiddenParentReference({\n parentReferenceConfig: parentRefConfig,\n referencedResourceType: resourceType,\n referencedIds: normalizeResourceReferenceSelectionValue(value),\n }),\n [parentRefConfig, resourceType, value],\n );\n\n /*\n * Under NONE nothing that remains is the parent — the parent's id was taken out above — so the remaining ids\n * render as the ordinary reference they are, not in a parent mode.\n */\n const isParentReference = Boolean(\n parentRefConfig\n && resourceType\n && parentRefConfig.parentResourceType === resourceType\n && parentRefConfig.displayMode !== ParentDisplay.NONE\n );\n\n /**\n * Effective display mode after reconciliation with ParentDisplay enum:\n * - CONTEXT / BREADCRUMB → forces linkable, keeps current FK mode\n * - BADGE → renders as Badge component\n * - SUMMARY → renders as inline summary text\n * - NONE → never reaches here: the hidden parent's id was taken out of `values`, and what remains is not the parent\n * - Not a parent reference → uses the decorator-based displayMode as-is\n */\n const effectiveDisplayMode = useMemo<ForeignKeyDisplayMode | ParentDisplay>(() => {\n if (!isParentReference || !parentRefConfig) return displayMode;\n\n switch (parentRefConfig.displayMode) {\n case ParentDisplay.CONTEXT:\n case ParentDisplay.BREADCRUMB:\n return displayMode;\n case ParentDisplay.BADGE:\n case ParentDisplay.SUMMARY:\n return parentRefConfig.displayMode;\n default: return displayMode;\n }\n }, [isParentReference, parentRefConfig, displayMode]);\n\n const isLinkable = useMemo(() => {\n if (isParentReference) {\n if (parentRefConfig?.showParentLink === false) {\n return false;\n }\n if (\n parentRefConfig?.displayMode === ParentDisplay.CONTEXT ||\n parentRefConfig?.displayMode === ParentDisplay.BREADCRUMB\n ) {\n return true;\n }\n }\n return displayParams?.linkable ?? true;\n }, [isParentReference, parentRefConfig, displayParams?.linkable]);\n const navigationZone = displayContext?.navigationZone ?? formSchemaContext?.navigationZone;\n /*\n * A SCOPED controller, when this reference is drawn inside a surface that keeps its own navigation stack — today the\n * Settings Hub's sections (`SettingsSectionNavigationHost`), whose rows and actions drill in INSIDE the hub.\n *\n * Read as a bare context rather than through `useNavigationController()`, which throws outside a NavigationProvider:\n * this preset also renders on hosts with no navigation at all (an artifact document), which is why it reaches\n * navigation through the event bus.\n *\n * And why the bus is not enough here: NAVIGATION_REQUEST is translated by ONE runtime-owned bridge\n * (`NavigationRequestBridge`), mounted under the NavigationProvider and therefore OUTSIDE any scoped host, so it\n * always reaches the GLOBAL controller. A member's name in the Settings Hub's members table was sent there: the\n * person's READ opened on the page beneath the hub while the hub stayed on top, and the click looked dead. Inside a\n * scoped host the reference asks that host, exactly as clicking the member's row does, so the person opens in the\n * hub's own drill-in with its back control.\n */\n const scopedNavigationController = useContext(ScopedNavigationControllerContext);\n /** Hands a navigation to the scoped host when there is one, else to the runtime's bridge. */\n const requestNavigation = useCallback((request: Pick<NavigateOptions, 'content' | 'initiator' | 'urlPath'>): void => {\n if (scopedNavigationController) {\n scopedNavigationController.navigate(request);\n return;\n }\n emit(FrontendEvents.NAVIGATION_REQUEST, { content: request.content, initiator: request.initiator, urlPath: request.urlPath });\n }, [emit, scopedNavigationController]);\n\n // Check if pre-populated data is usable through the configured resource id field.\n const prePopulatedLabel = React.useMemo(() => {\n if (!prePopulatedData || typeof prePopulatedData !== 'object' || !resourceType) return null;\n\n // For single FK: prePopulatedData._id should match value\n // For array FK: prePopulatedData is not applicable (arrays need per-item population)\n if (Array.isArray(value)) return null;\n const prePopulatedId = resolvePrePopulatedRecordIdentifier({\n record: prePopulatedData,\n resourceType,\n registry,\n });\n if (!prePopulatedId || prePopulatedId !== value) return null;\n\n // An IDENTITY-ONLY object carries no label. A context read declared `ID_ONLY`, or a parent whose\n // fetch degraded, arrives as `{ _id }`, and labelling it would fall through to the id itself —\n // seeding an ObjectId as the \"resolved\" label and suppressing the fetch that would have found\n // the name (#579). Only content beyond the identity counts as pre-populated.\n const carriesContent = Object.entries(prePopulatedData as Record<string, unknown>)\n .some(([key, fieldValue]) => key !== '_id' && key !== 'id' && fieldValue !== null && fieldValue !== undefined && fieldValue !== prePopulatedId);\n if (!carriesContent) return null;\n\n return FrontendResourceUtils.computeFrontendResourceLabel({\n resourceType,\n registry,\n currentObject: prePopulatedData,\n t,\n formatDate,\n formatDateTime,\n });\n }, [prePopulatedData, resourceType, value, registry, t, formatDate, formatDateTime]);\n\n // The HOST's context identifiers, flattened to ids: the page this reference sits on (display context or\n // form context — the same source as scopedContextualParameters).\n const hostContextIdentifiers = useMemo(() => {\n const identifiers: Record<string, string> = {};\n const contextIds = displayContext?.contextResourceIdentifiers || formSchemaContext?.contextResourceIdentifiers;\n if (contextIds) {\n for (const [resType, idOrObj] of Object.entries(contextIds)) {\n const idValue = typeof idOrObj === 'string' ? idOrObj : (idOrObj as { resourceId?: string })?.resourceId;\n if (idValue) identifiers[resType] = idValue;\n }\n }\n return identifiers;\n }, [displayContext?.contextResourceIdentifiers, formSchemaContext?.contextResourceIdentifiers]);\n\n // ── B1 (P4-03): FK route infrastructure ──────────────────────────────\n // Memoize route path selection for the referenced resource type. Computed for a NON-linkable reference too: its READ\n // is sent on the same route its link would take (#2741), and whether it is drawn as a link is `wrapWithLink`'s call.\n const fkLinkUrlInfo = useMemo(() => {\n if (!resourceType) return null;\n\n const refResourceConfig = registry.resourceConfigurations[resourceType];\n if (!refResourceConfig) return null;\n\n const contextIds = displayContext?.contextResourceIdentifiers || formSchemaContext?.contextResourceIdentifiers;\n\n const currentContextResourceType = displayContext?.resourceType || formSchemaContext?.resourceType;\n const currentParentRequirements = currentContextResourceType && contextIds\n ? frontendResourceUtils.buildParentResourcesRequirements(\n currentContextResourceType,\n contextIds,\n registry,\n )\n : [];\n\n // The resource's own field identifier (e.g., 'userId' for USERS) — for URL param substitution\n const ownFieldIdentifier = registry.allResourceFieldIdentifiers?.[resourceType];\n\n return { refResourceConfig, ownFieldIdentifier, currentParentRequirements };\n }, [\n resourceType,\n registry,\n displayContext?.contextResourceIdentifiers,\n displayContext?.resourceType,\n formSchemaContext?.contextResourceIdentifiers,\n formSchemaContext?.resourceType,\n ]);\n\n /**\n * The host's context scoped to ONE referenced record (#2144): the identifiers, parameters and parent\n * requirements every per-target step below starts from — the link URL, the overlay, the label fetch and both\n * clicks. A self-referencing parent the host carries (`parentUnitId`) describes the host's own record, so it\n * is kept only for a reference to that record; a unit's link to its parent no longer names the parent as its\n * own parent. See `frontendResourceUtils.scopeHostContextToReferencedRecord`.\n */\n // The record the host renders — a display's or a form's own type and id, never read off its type slot. The\n // display context has a default value outside a provider, so it is the host only when it names a type.\n const hostRecord = displayContext?.resourceType\n ? { resourceType: displayContext.resourceType, id: displayContext.resourceId }\n : formSchemaContext\n ? { resourceType: formSchemaContext.resourceType, id: formSchemaContext.resourceId }\n : undefined;\n const hostRecordType = hostRecord?.resourceType;\n const hostRecordId = hostRecord?.id;\n const scopeToTarget = useCallback((id: string) => scopeReferencedRecord({\n hostIdentifiers: hostContextIdentifiers,\n hostContextualParameters: scopedContextualParameters,\n hostParentRequirements: fkLinkUrlInfo?.currentParentRequirements,\n hostRecord: { resourceType: hostRecordType, id: hostRecordId },\n targetResourceType: resourceType ?? '',\n targetId: id,\n registry,\n }), [hostContextIdentifiers, scopedContextualParameters, fkLinkUrlInfo?.currentParentRequirements, hostRecordType, hostRecordId, resourceType, registry]);\n\n /*\n * The viewer, for the one question the READ pick below must ask about them (#3791): whose row the READ may reach.\n * Their roles in the tenant the host is read in, and their own user id. Both are read without the throwing hooks, so a\n * host outside the providers (an artifact document) gets a viewer nobody is known to be, and a reference to a person\n * offers no door there until the session is known.\n */\n const referenceViewer = useViewerEffectiveRolesInOrganization(\n resolveRecordOrganizationId(hostRecordType, hostRecordId != null ? String(hostRecordId) : undefined, hostContextIdentifiers),\n );\n const viewerUserId = useAppScopeSafe()?.currentUserId ?? null;\n /**\n * The READ variants of the referenced resource this viewer may OPEN on one target (#3791): every one, except a\n * `USER_SELF`-scoped variant addressed to another person that does not admit them (`viewerReachesUserSubject`).\n *\n * Without it the pick took the `users` default READ for any person: an organization administrator's click on a\n * member's name opened a page whose every read answered `403`, titled by the person's id. The person is the target\n * itself for a reference to a user, else the `userId` the target's scope names; when neither says, it is unknown and\n * no person-scoped variant is offered. Only the reference's DOORS ask this (its link and its overlay): its label read is\n * a different question and keeps its route.\n */\n const readOperationsViewerMayOpen = useCallback((\n refResourceConfig: AnyFrontendResourceConfiguration,\n id: string,\n contextualParameters: Record<string, unknown>,\n ): FrontendResourceConfiguration_Operation[] => {\n const targetIsPerson = resourceType === CoreResourceType.USERS || resourceType === CoreResourceType.USER_SELF;\n const scopedPerson = contextualParameters[coreResourceShared_FieldIdentifier[CoreResourceType.USERS]];\n const subjectUserId = targetIsPerson ? id : (typeof scopedPerson === 'string' ? scopedPerson : null);\n return (refResourceConfig.operations ?? []).filter((operation: FrontendResourceConfiguration_Operation) => viewerReachesUserSubject(\n { ...operation, resourcePrimaryScope: operation.resourcePrimaryScope ?? refResourceConfig.resourcePrimaryScope },\n { subjectUserId, viewerUserId },\n referenceViewer,\n ));\n }, [resourceType, referenceViewer, viewerUserId]);\n\n /**\n * Resolve a concrete link URL for a given FK value.\n * Builds scoped URLs like /organizations/org-123/users/user-456 instead of /USERS/user-456.\n */\n const resolveFkNavigationTarget = useCallback((id: string): {\n url: string;\n parentResourcesRequirements: ReturnType<typeof frontendResourceUtils.buildParentResourcesRequirementsFromRouteParams>;\n readOp: FrontendResourceConfiguration_Operation;\n } | null => {\n if (!fkLinkUrlInfo || !resourceType) return null;\n\n const { refResourceConfig, ownFieldIdentifier } = fkLinkUrlInfo;\n const targetScope = scopeToTarget(id);\n\n // Add the FK's own resource type → ID for route matching\n const fullContextIdentifiers = { ...targetScope.identifiers, [resourceType]: id };\n const contextualParameters = {\n ...targetScope.contextualParameters,\n ...(ownFieldIdentifier ? { [ownFieldIdentifier]: id } : {}),\n };\n const readOp = pickPreferredOperationForCoreSemanticAddressability({\n resourceConfig: refResourceConfig,\n operations: readOperationsViewerMayOpen(refResourceConfig, id, contextualParameters),\n coreOperation: CoreResourceOperation.READ,\n registry,\n hasResourceId: true,\n requireFrontendAddressable: true,\n contextResourceIdentifiers: fullContextIdentifiers,\n contextualParameters,\n });\n if (!readOp) return null;\n\n const routePaths = ResourcesConfigOperationsUrlsBuilderUtils.buildOperationFrontendRoutePaths(\n refResourceConfig,\n readOp,\n registry.allResourceFieldIdentifiers,\n );\n if (routePaths.length === 0) return null;\n\n try {\n const matchingPath = frontendResourceUtils.selectMatchingRoutePath(\n routePaths,\n fullContextIdentifiers,\n resourceType,\n ownFieldIdentifier,\n targetScope.parentRequirements,\n registry.allResourceFieldIdentifiers,\n );\n if (!matchingPath?.url) return null;\n const targetParentResourcesRequirements = frontendResourceUtils.buildParentResourcesRequirementsFromRouteParams(\n matchingPath.parameters ?? [],\n resourceType,\n registry,\n );\n\n // Build field identifiers for URL parameter substitution\n const fieldIdentifiers: Record<string, string> = {};\n // Parent field identifiers from the target's scoped contextual parameters\n for (const [key, val] of Object.entries(targetScope.contextualParameters)) {\n if (val !== undefined && val !== null) fieldIdentifiers[key] = String(val);\n }\n // Resource's own field identifier → FK value\n if (ownFieldIdentifier) {\n fieldIdentifiers[ownFieldIdentifier] = id;\n }\n\n const resolved = NavigationUtils.resolveUrlPath(matchingPath.url, fieldIdentifiers);\n // Only return if fully resolved (no remaining :param placeholders)\n if (resolved && !NavigationUtils.hasUnresolvedPlaceholders(resolved)) {\n return {\n url: resolved,\n parentResourcesRequirements: targetParentResourcesRequirements,\n readOp,\n };\n }\n } catch {\n // selectMatchingRoutePath may throw — graceful fallback\n }\n\n return null;\n }, [fkLinkUrlInfo, registry, resourceType, scopeToTarget, readOperationsViewerMayOpen]);\n\n /**\n * The OVERLAY fallback — a reference whose target READ is `EMBEDDED` (decided 2026-09-01).\n *\n * An EMBEDDED read has no route by contract (\"rendered within a host — overlay/drill-in when\n * standalone\"), so the URL resolver above answers null and the reference used to render as a\n * DEAD label. The navigation layer already escalates EMBEDDED content to an overlay\n * (`navigation-policy-resolver`: EMBEDDED never becomes THE PAGE) — all this resolver adds is\n * the read operation to hand it. API_ONLY stays dead on purpose: headless means no interface.\n */\n const resolveFkOverlayTarget = useCallback((id: string): {\n readOp: FrontendResourceConfiguration_Operation;\n } | null => {\n if (!fkLinkUrlInfo || !resourceType) return null;\n const { refResourceConfig, ownFieldIdentifier } = fkLinkUrlInfo;\n const targetScope = scopeToTarget(id);\n const fullContextIdentifiers = { ...targetScope.identifiers, [resourceType]: id };\n const contextualParameters = {\n ...targetScope.contextualParameters,\n ...(ownFieldIdentifier ? { [ownFieldIdentifier]: id } : {}),\n };\n const readOp = pickPreferredOperationForCoreSemanticAddressability({\n resourceConfig: refResourceConfig,\n operations: readOperationsViewerMayOpen(refResourceConfig, id, contextualParameters),\n coreOperation: CoreResourceOperation.READ,\n registry,\n hasResourceId: true,\n requireFrontendAddressable: false,\n contextResourceIdentifiers: fullContextIdentifiers,\n contextualParameters,\n });\n if (!readOp) return null;\n if (readOp.operationFrontendConfig?.surface !== ResourceOperationFrontendSurface.EMBEDDED) return null;\n return { readOp };\n }, [fkLinkUrlInfo, registry, resourceType, scopeToTarget, readOperationsViewerMayOpen]);\n\n /**\n * The route a reference's READ is sent on: the route it links to, else — for a target with no page to link to (an\n * EMBEDDED or API_ONLY read) — the READ's own most specific HTTP route its target-scoped parameters satisfy. Either\n * way the read carries that route's parent chain, so a working scope the scoped registry injects into every call (a\n * selected list) cannot reroute it under a parent the record need not have (#2741). `null` when no READ addresses the\n * target from its scope: `fetchResourceReferenceRecordAndLabel` then pins the route the scope it is handed selects, if\n * any, and sends the read unpinned only when no route is satisfiable from it (#2746).\n */\n const resolveReadPin = useCallback((id: string): {\n readOp: FrontendResourceConfiguration_Operation;\n parentResourcesRequirements: ReturnType<typeof frontendResourceUtils.buildParentResourcesRequirementsFromRouteParams>;\n } | null => {\n const linkTarget = resolveFkNavigationTarget(id);\n if (linkTarget) return { readOp: linkTarget.readOp, parentResourcesRequirements: linkTarget.parentResourcesRequirements };\n if (!fkLinkUrlInfo || !resourceType) return null;\n const { refResourceConfig, ownFieldIdentifier } = fkLinkUrlInfo;\n const targetScope = scopeToTarget(id);\n const contextualParameters = { ...targetScope.contextualParameters, ...(ownFieldIdentifier ? { [ownFieldIdentifier]: id } : {}) };\n const readOp = pickPreferredOperationForCoreSemanticAddressability({\n resourceConfig: refResourceConfig,\n operations: refResourceConfig.operations ?? [],\n coreOperation: CoreResourceOperation.READ,\n registry,\n hasResourceId: true,\n requireFrontendAddressable: false,\n contextResourceIdentifiers: { ...targetScope.identifiers, [resourceType]: id },\n contextualParameters,\n });\n if (!readOp) return null;\n const initiator = FrontendResourceUtils.selectOperationUrlInitiatorInfo({\n initiatorInfos: readOp.initiatorInfos ?? [],\n contextualParameters,\n targetResourceType: resourceType,\n targetDefaultFieldIdentifier: ownFieldIdentifier ?? '',\n });\n if (!initiator) return null;\n return {\n readOp,\n parentResourcesRequirements: frontendResourceUtils.buildParentResourcesRequirementsFromRouteParams(initiator.parameters, resourceType, registry),\n };\n }, [resolveFkNavigationTarget, fkLinkUrlInfo, resourceType, scopeToTarget, registry]);\n\n // Resolve a single FK value via API\n const resolveForeignKey = useCallback(async (id: string) => {\n if (!resourceType || !id) return;\n\n // Skip if already resolved or loading (read from ref for synchronous accuracy)\n const existing = resolvedFKsRef.current.get(id);\n if (existing && (existing.label !== null || existing.isLoading)) {\n return;\n }\n\n // Mark as loading — ref update is immediate for concurrent call detection\n trackResolvedFK(id, { id, label: null, error: null, isLoading: true });\n\n try {\n /*\n * Read on the route the reference links to (#2741): the most specific route its target-scoped context\n * satisfies, which `scopeReferencedRecord` keeps to the tenancy unless the target is the host's own record or is\n * readable only under a parent. Without the pin the request takes the most specific route its PARAMETERS\n * satisfy, and the scoped registry injects the viewer's whole working scope into every call: with a list\n * selected in a quick-switcher, a todo of another list was read under the selected one, refused, and shown as\n * unavailable. A target with no page to link to is pinned to its READ's own route (`resolveReadPin`).\n */\n const routeTarget = resolveReadPin(id);\n const { record: fetchedRecord, label } = await fetchResourceReferenceRecordAndLabel({\n resourceType,\n id,\n registry,\n doOperation,\n ...(routeTarget ? { readOperation: routeTarget.readOp, parentResourcesRequirements: routeTarget.parentResourcesRequirements } : {}),\n // The target's own scope: a parent the host carries for ITS record is not the target's parent.\n contextualParameters: scopeToTarget(id).contextualParameters,\n t,\n formatDate,\n formatDateTime,\n });\n\n trackResolvedFK(id, { id, label, data: fetchedRecord, error: null, isLoading: false });\n } catch (err) {\n // Shown as the id's tooltip, so resolved to localized text — `extractErrorInfo(err).message` was the\n // backend's i18n REFERENCE (#1160).\n trackResolvedFK(id, { id, label: null, error: toUserFacingErrorMessage(err), isLoading: false });\n }\n }, [resourceType, registry, doOperation, trackResolvedFK, t, formatDate, formatDateTime, scopeToTarget, toUserFacingErrorMessage, resolveReadPin]);\n\n // Resolve all FK values on mount/change — skip API when pre-populated data is available\n useEffect(() => {\n if (!resourceType || values.length === 0) return;\n\n // Only resolve if mode requires it — skip for ID display\n if (effectiveDisplayMode === ForeignKeyDisplayMode.ID) return;\n\n // If pre-populated label is available for single value, seed it into resolvedFKs\n if (prePopulatedLabel && values.length === 1 && !resolvedFKsRef.current.has(values[0])) {\n trackResolvedFK(values[0], {\n id: values[0],\n label: prePopulatedLabel,\n data: prePopulatedData as Record<string, unknown> | undefined,\n error: null,\n isLoading: false,\n });\n return;\n }\n\n values.forEach(id => {\n if (id && !resolvedFKsRef.current.has(id)) {\n resolveForeignKey(id);\n }\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps -- resolvedFKsRef used for non-reactive reads; resolvedFKs state intentionally excluded to break re-render cycle\n }, [resourceType, values, effectiveDisplayMode, resolveForeignKey, trackResolvedFK, prePopulatedLabel]);\n\n /**\n * Wrap content in a link/clickable element when linkable.\n * Parent references use onNavigateToParent (controller-managed) with URL fallback.\n */\n const wrapWithLink = useCallback((id: string, content: React.ReactNode): React.ReactNode => {\n if (!isLinkable || !resourceType) return content;\n // A SUMMARY card is block content: underlining it and painting it in the link colour underlined every line and\n // badge of the card. It is a block link instead, drawn by the focus contract, as a selectable card is.\n const summaryLink = effectiveDisplayMode === ForeignKeyDisplayMode.SUMMARY;\n\n const navigationTarget = resolveFkNavigationTarget(id);\n // A scoped host takes the click too: without it, the bare `<Link>` below would hand the address to the router and\n // leave the host (the hub closes and the record becomes the page), where every other drill-in stays inside it.\n const shouldUseControllerNavigation = Boolean((navigationZone || scopedNavigationController) && navigationTarget?.readOp && navigationTarget?.url);\n\n const handleReferenceNavigation = (e: React.MouseEvent) => {\n if (\n !shouldUseControllerNavigation\n || !navigationTarget\n || e.button !== 0\n || e.ctrlKey\n || e.metaKey\n || e.shiftKey\n || e.altKey\n ) {\n return;\n }\n\n const fullContextIdentifiers = {\n ...scopeToTarget(id).identifiers,\n [resourceType]: id,\n };\n const readContext = frontendResourceUtils.createFrontendResourceOperationContextFromOperation({\n resourceType,\n operation: navigationTarget.readOp,\n contextResourceIdentifiers: fullContextIdentifiers,\n parentResourcesRequirements: navigationTarget.parentResourcesRequirements,\n });\n\n e.preventDefault();\n requestNavigation({\n content: {\n contentType: NavigationContentType.RESOURCE_OPERATION,\n resourceContext: readContext,\n },\n initiator: { sourceZone: navigationZone ?? NavigationZone.PRIMARY },\n urlPath: navigationTarget.url,\n });\n };\n\n if (isParentReference && parentRefConfig?.onNavigateToParent) {\n const handleClick = (e: React.MouseEvent) => {\n if (e.button !== 0 || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) return;\n const handled = parentRefConfig.onNavigateToParent!(id);\n if (handled !== false) {\n e.preventDefault();\n }\n };\n\n if (navigationTarget?.url) {\n return (\n <Link to={navigationTarget.url} className=\"text-primary hover:underline\" onClick={handleClick}>\n {content}\n </Link>\n );\n }\n return (\n <button\n type=\"button\"\n /*\n * `block`, not the button default `inline-block` — and `inline` cannot work here.\n *\n * An inline-block's baseline is the baseline of its LAST line box, so inside a bulleted\n * list item a two-line reference dragged the ::marker down to its final line (measured on\n * the workbench's Requirements page, where every multi-valued \"Serves jobs\" link wraps).\n * The obvious fix, `display: inline`, is silently overridden: browsers fix up `inline` on\n * form controls to `inline-block` (verified via CDP — the cascade applied `.inline` and\n * the computed value stayed `inline-block`), so the class sat in the DOM doing nothing.\n * A BLOCK child is the shape that works: an outside marker aligns with the first line box\n * of a list item's block content, exactly like `<li><p>…</p></li>`.\n */\n className=\"block text-primary hover:underline bg-transparent border-none p-0 cursor-pointer text-left\"\n onClick={() => {\n parentRefConfig.onNavigateToParent!(id);\n }}\n >\n {content}\n </button>\n );\n }\n\n if (navigationTarget?.url) {\n return (\n <Link to={navigationTarget.url} className={summaryLink ? SUMMARY_LINK_CLASSES : 'text-primary hover:underline'} onClick={handleReferenceNavigation}>\n {content}\n </Link>\n );\n }\n\n /*\n * No route — the EMBEDDED-read overlay fallback (see `resolveFkOverlayTarget`).\n *\n * The source zone DEFAULTS to PRIMARY rather than gating on a context-provided zone: a\n * reference rendered by a display host that never plumbed `navigationZone` (an artifact\n * document, a composite view) would otherwise render its resolved label as dead text — the\n * silent-degradation shape this fallback exists to remove. PRIMARY is where such hosts live.\n */\n const overlayTarget = resolveFkOverlayTarget(id);\n if (overlayTarget) {\n const openOverlay = (e: React.MouseEvent) => {\n if (e.button !== 0 || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) return;\n e.preventDefault();\n const targetScope = scopeToTarget(id);\n const readContext = frontendResourceUtils.createFrontendResourceOperationContextFromOperation({\n resourceType,\n operation: overlayTarget.readOp,\n contextResourceIdentifiers: {\n ...targetScope.identifiers,\n [resourceType]: id,\n },\n parentResourcesRequirements: targetScope.parentRequirements,\n });\n // No urlPath on purpose: an overlay is not a place — nothing to deep-link, nothing to pop.\n requestNavigation({\n content: {\n contentType: NavigationContentType.RESOURCE_OPERATION,\n resourceContext: readContext,\n },\n initiator: { sourceZone: navigationZone ?? NavigationZone.PRIMARY },\n });\n };\n return (\n <button\n type=\"button\"\n /*\n * `block`, not the button default `inline-block` — and `inline` cannot work here.\n *\n * An inline-block's baseline is the baseline of its LAST line box, so inside a bulleted\n * list item a two-line reference dragged the ::marker down to its final line (measured on\n * the workbench's Requirements page, where every multi-valued \"Serves jobs\" link wraps).\n * The obvious fix, `display: inline`, is silently overridden: browsers fix up `inline` on\n * form controls to `inline-block` (verified via CDP — the cascade applied `.inline` and\n * the computed value stayed `inline-block`), so the class sat in the DOM doing nothing.\n * A BLOCK child is the shape that works: an outside marker aligns with the first line box\n * of a list item's block content, exactly like `<li><p>…</p></li>`.\n */\n className={summaryLink\n ? cn(SUMMARY_LINK_CLASSES, 'w-full bg-transparent border-none p-0 cursor-pointer text-left')\n : 'block text-primary hover:underline bg-transparent border-none p-0 cursor-pointer text-left'}\n onClick={openOverlay}\n >\n {content}\n </button>\n );\n }\n\n return content;\n }, [requestNavigation, scopedNavigationController, effectiveDisplayMode, fkLinkUrlInfo, isLinkable, isParentReference, navigationZone, parentRefConfig, resolveFkNavigationTarget, resolveFkOverlayTarget, resourceType, scopeToTarget]);\n\n // Render a single value\n const renderValue = useCallback((id: string) => {\n if (effectiveDisplayMode === ForeignKeyDisplayMode.ID) {\n return <span className=\"font-mono text-sm\">{id}</span>;\n }\n\n const resolved = resolvedFKs.get(id);\n const isLoading = resolved?.isLoading ?? false;\n\n if (isLoading || !resolved) {\n return <Skeleton className=\"h-4 w-24 inline-block\" />;\n }\n\n if (resolved.error) {\n // A FAILED resolution is exactly where the record's own readable copy earns its keep — more\n // so than an empty one. Measured 2026-09-19 on the member directory: reading another user's\n // record answers 403 for most rows, so this branch (not the empty-label one below) is what\n // printed `6aaba6b3a2d3b6b0ad61f33e` in the USER column.\n //\n // The error is NOT swallowed: it stays on `title`, so the failure is still discoverable, and a\n // field that declares no `labelFallbackField` still shows the id exactly as before. What\n // changes is only that a readable value present on the row is preferred to an opaque one.\n if (labelFallback) {\n return (\n <span className=\"text-muted-foreground text-sm\" title={resolved.error}>\n {labelFallback}\n </span>\n );\n }\n // No readable copy: the field says the record cannot be shown, and keeps the id (and why) on hover for whoever\n // needs to trace it. An id told a reader nothing (#2329). The words claim no reason on purpose: a 404 is not proof\n // the record is gone, because a read across a tenant boundary answers 404 by design, so a refusal and a deletion\n // are the same answer here, and \"no longer exists\" would be false for the first.\n return (\n <span className=\"text-muted-foreground text-sm italic\" title={`${id} · ${resolved.error}`}>\n {tComponent(FrontendComponentType.RESOURCES_FIELDS_RESOURCE_REFERENCE, 'recordUnavailable')}\n </span>\n );\n }\n\n // The id is the LAST resort, not the first. A record carrying a readable copy of the reference\n // (`labelFallbackField`) shows that instead — which is what keeps a member directory readable\n // for people who have no profile for a label to be built from.\n /*\n * Named from the fetched record with the CURRENT `t`, not the label frozen at fetch time (#1851 review). A\n * record whose name reads another label section (a product named by `billing_products.<key>.name`) could be\n * fetched before those words arrived, and the stored label then kept its key for the life of the component.\n * The stored label is used only when there is no stored record (`data`) or the resource declares no label\n * strategy: such a name cannot change with the words, and the resolver would log its configuration gap on every\n * render. A strategy that returns an empty name for some record also logs on each render; accepted, since\n * that is a labelling defect in the strategy and the log names it.\n */\n const hasLabelStrategy = !!resourceType\n && !!FrontendResourceUtils.frontendResourceLabelDefinitionOf(registry.resourceConfigurations?.[resourceType] as AnyFrontendResourceConfiguration | undefined);\n const currentLabel = resolved.data && resourceType && hasLabelStrategy\n ? FrontendResourceUtils.computeFrontendResourceLabel({ resourceType, registry, currentObject: resolved.data, t, formatDate, formatDateTime })\n : null;\n const label = currentLabel || resolved.label || labelFallback || id;\n\n if (effectiveDisplayMode === ParentDisplay.BADGE) {\n const handleBadgeClick = isLinkable && parentRefConfig?.onNavigateToParent\n ? () => parentRefConfig.onNavigateToParent!(id)\n : undefined;\n return (\n <Badge\n variant=\"secondary\"\n className={handleBadgeClick ? 'cursor-pointer hover:opacity-[var(--opacity-hover)]' : undefined}\n onClick={handleBadgeClick}\n >\n {label}\n </Badge>\n );\n }\n\n // \"summary\" mode — ParentDisplay.SUMMARY and ForeignKeyDisplayMode.SUMMARY share\n // the same string value, so we distinguish by isParentReference.\n if (effectiveDisplayMode === ParentDisplay.SUMMARY) {\n if (isParentReference) {\n const handleInlineClick = isLinkable && parentRefConfig?.onNavigateToParent\n ? () => parentRefConfig.onNavigateToParent!(id)\n : undefined;\n return (\n <span\n className={`text-muted-foreground text-sm ${handleInlineClick ? 'cursor-pointer hover:text-foreground transition-colors' : ''}`}\n onClick={handleInlineClick}\n role={handleInlineClick ? 'button' : undefined}\n tabIndex={handleInlineClick ? 0 : undefined}\n onKeyDown={handleInlineClick ? (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); handleInlineClick(); }} : undefined}\n >\n {label}\n </span>\n );\n }\n\n // FK field SUMMARY mode — render ResourceSummaryDisplayer\n if (resolved.data && resourceType) {\n const refConfig = registry.resourceConfigurations[resourceType];\n // The referenced record's own schema (#2455): for an inheritance resource, the variant its discriminators name.\n const summarySchema = FrontendResourceUtils.resolveRowSchema(refConfig, resolved.data as Record<string, unknown>);\n if (summarySchema) {\n const summaryContent = (\n <ResourceSummaryDisplayer\n resourceType={resourceType}\n schema={summarySchema}\n data={resolved.data}\n // The referenced record's NAME. The field's own label names the FIELD (\"Target todo\"),\n // never the record, and this card REPLACES the one-line label — so without it nothing on\n // screen says which record is referenced. Measured on Wonder Todos: a relationship row\n // read \"Blocks → Pending –\", the blocked todo's badges with no title. The edit picker\n // passes its option label for the same reason.\n primaryLabel={label}\n // The host's scope narrowed to the referenced record (#2144): the record's own fields read there (#2198).\n contextResourceIdentifiers={scopeToTarget(id).identifiers}\n />\n );\n return isLinkable ? wrapWithLink(id, summaryContent) : summaryContent;\n }\n }\n\n return wrapWithLink(id, <ReferenceLabel label={label} />);\n }\n\n // ForeignKeyDisplayMode.LABEL — resolved label, optionally linkable\n if (effectiveDisplayMode === ForeignKeyDisplayMode.LABEL) {\n return wrapWithLink(id, <ReferenceLabel label={label} />);\n }\n\n // Fallback — render as label\n return wrapWithLink(id, <ReferenceLabel label={label} />);\n }, [effectiveDisplayMode, resolvedFKs, resourceType, isParentReference, parentRefConfig, wrapWithLink, registry, isLinkable, t, tComponent, formatDate, formatDateTime, labelFallback]);\n\n // NONE is \"don't show any parent reference\": when the parent was all there was, the reference is absent — never an\n // empty-value mark in its place (#2195). A display field omits the whole field by the same rule.\n if (hidesWholeReference) {\n return null;\n }\n\n // Handle empty values\n if (values.length === 0) {\n return <span className=\"text-muted-foreground\">-</span>;\n }\n\n // Unknown resource type warning\n if (!resourceType && effectiveDisplayMode !== ForeignKeyDisplayMode.ID) {\n // Fall back to showing IDs with a warning\n return (\n <div className={className} title=\"Unknown resource type - showing IDs\">\n {values.length === 1 ? (\n <span className=\"font-mono text-sm\">{values[0]}</span>\n ) : (\n <ul className=\"list-disc ps-4 space-y-item-xs\">\n {values.map(id => (\n <li key={id} className=\"font-mono text-sm\">{id}</li>\n ))}\n </ul>\n )}\n </div>\n );\n }\n\n // Single value\n if (values.length === 1) {\n return <div className={className}>{renderValue(values[0])}</div>;\n }\n\n // Multiple values - render as list\n/*\n * `list-outside` (the default) with a start PADDING, NOT `list-inside`.\n *\n * `list-inside` puts the marker into the item's INLINE FLOW, where it has to share the first line\n * with the item's content — and the content here is a reference button, which is `inline-block`. An\n * inline-block box cannot break across lines, so as soon as its label is longer than the remaining\n * first line it wraps as ONE unit to the next, leaving the bullet stranded alone on a line of its\n * own. Measured on the workbench's Requirements page: every \"Serves jobs\" entry rendered as a bare\n * dot above its link, while \"Serves ICPs\" looked fine purely because it had ONE short-labelled\n * value — the single-value branch above renders no list at all, and a short label happened to fit.\n *\n * Outside markers sit in the margin and take no part in the inline flow, so the content may wrap\n * freely and the marker stays on the first line.\n *\n * PADDING rather than the `ms-4` margin this used until 2026-09-25, because the list is the value's\n * ROOT and a vertical field chrome stretches its children to `w-full`: a margin then pushes a\n * full-width box 1rem past its column, measured on the workbench's Build plan page where every\n * \"Serves functional requirements\" link ran to the pane's edge. An outside marker is drawn in the\n * list's padding box, so `ps-4` keeps the same inset inside the width instead of beyond it.\n */\n return (\n <ul className={cn('list-disc ps-4 space-y-item-xs', className)}>\n {values.map(id => (\n <li key={id}>{renderValue(id)}</li>\n ))}\n </ul>\n );\n};\n"]}
@@ -63,6 +63,18 @@ export interface SurfaceProps extends React.ComponentPropsWithoutRef<'div'> {
63
63
  export declare function responsiveMaxWidthToCssValue(value: SurfacePolicy['geometry'] extends infer Geometry ? Geometry extends {
64
64
  responsiveMaxWidth?: infer MaxWidth;
65
65
  } ? MaxWidth : never : never): string | undefined;
66
+ /**
67
+ * The inline `style` of a block whose width tier is OPTIONAL: the tier's `max-inline-size` when one is declared, and NO
68
+ * inline style when it is not, so the cap the HOST puts in `className` (or the block's own derived class) decides.
69
+ *
70
+ * `responsiveMaxWidthToCssValue(undefined)` is `'none'`, deliberately, for the Surface policy variable it feeds. As an
71
+ * INLINE style that `'none'` outranks every class, so a block that left its tier unset to let the host decide was
72
+ * uncapped whatever the host said. The record page's danger zone and sharing section were exactly that: the read
73
+ * layout hands them `[max-inline-size:var(--record-body-max-inline-size)]` so they share the record body's edges
74
+ * (060e526ea), and both rendered full width beside a body capped at the reading measure (#3751, measured on a
75
+ * member's page in the Settings Hub: body 672px, danger zone 889px).
76
+ */
77
+ export declare function optionalMaxInlineSizeStyle(value: Parameters<typeof responsiveMaxWidthToCssValue>[0] | undefined): React.CSSProperties | undefined;
66
78
  export declare const SurfaceHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
67
79
  export declare const SurfaceBody: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
68
80
  export declare const SurfaceFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../../../src/components/sections/surface.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAEL,cAAc,EAEd,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,aAAa,EACnB,MAAM,qCAAqC,CAAC;AAgB7C,MAAM,WAAW,YAAa,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IACzE;;;;OAIG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,mBAAmB,CAAC;IAC3C,cAAc,CAAC,EAAE,wBAAwB,CAAC;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;;;;;;;OAWG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AA6ID;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAAC,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AA4B,CAAC,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,SAAS,MAAM,QAAQ,GAAG,QAAQ,SAAS;IAAE,kBAAkB,CAAC,EAAE,MAAM,QAAQ,CAAA;CAAE,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CA+B9M;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,UAAU,CAAC,OAAO,4BAA4B,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,GACpE,KAAK,CAAC,aAAa,GAAG,SAAS,CAEjC;AA8qBD,eAAO,MAAM,aAAa,mKA0BxB,CAAC;AAIH,eAAO,MAAM,WAAW,mKAetB,CAAC;AAIH,eAAO,MAAM,aAAa,mKA6BxB,CAAC;AAIH,eAAO,MAAM,aAAa,mKAYxB,CAAC;AAIH,eAAO,MAAM,OAAO;;;;;CAKlB,CAAC"}
@@ -180,6 +180,20 @@ export function responsiveMaxWidthToCssValue(value) {
180
180
  return 'none';
181
181
  }
182
182
  }
183
+ /**
184
+ * The inline `style` of a block whose width tier is OPTIONAL: the tier's `max-inline-size` when one is declared, and NO
185
+ * inline style when it is not, so the cap the HOST puts in `className` (or the block's own derived class) decides.
186
+ *
187
+ * `responsiveMaxWidthToCssValue(undefined)` is `'none'`, deliberately, for the Surface policy variable it feeds. As an
188
+ * INLINE style that `'none'` outranks every class, so a block that left its tier unset to let the host decide was
189
+ * uncapped whatever the host said. The record page's danger zone and sharing section were exactly that: the read
190
+ * layout hands them `[max-inline-size:var(--record-body-max-inline-size)]` so they share the record body's edges
191
+ * (060e526ea), and both rendered full width beside a body capped at the reading measure (#3751, measured on a
192
+ * member's page in the Settings Hub: body 672px, danger zone 889px).
193
+ */
194
+ export function optionalMaxInlineSizeStyle(value) {
195
+ return value === undefined ? undefined : { maxInlineSize: responsiveMaxWidthToCssValue(value) };
196
+ }
183
197
  /**
184
198
  * Centering companion to {@link responsiveMaxWidthToCssValue}: a surface capped
185
199
  * to a finite max inline-size is centered in its container via