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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/esm/components/ai-elements/meta/agent-wrappers.d.ts +1 -0
  2. package/dist/esm/components/ai-elements/meta/agent-wrappers.d.ts.map +1 -1
  3. package/dist/esm/components/ai-elements/meta/agent-wrappers.js.map +1 -1
  4. package/dist/esm/components/compliance/EmbeddedSigningFrame.d.ts +38 -0
  5. package/dist/esm/components/compliance/EmbeddedSigningFrame.d.ts.map +1 -0
  6. package/dist/esm/components/compliance/EmbeddedSigningFrame.js +106 -0
  7. package/dist/esm/components/compliance/EmbeddedSigningFrame.js.map +1 -0
  8. package/dist/esm/components/data-display/DisplayValueDispatcher.d.ts.map +1 -1
  9. package/dist/esm/components/data-display/DisplayValueDispatcher.js +17 -1
  10. package/dist/esm/components/data-display/DisplayValueDispatcher.js.map +1 -1
  11. package/dist/esm/components/data-display/ResourceAutomaticDisplayer.d.ts.map +1 -1
  12. package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js +22 -0
  13. package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js.map +1 -1
  14. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.d.ts.map +1 -1
  15. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js +5 -2
  16. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js.map +1 -1
  17. package/dist/esm/components/flows-actors/agent-config.labels.d.ts.map +1 -1
  18. package/dist/esm/components/flows-actors/agent-config.labels.js +2 -0
  19. package/dist/esm/components/flows-actors/agent-config.labels.js.map +1 -1
  20. package/dist/esm/components/flows-actors/approval.d.ts +7 -1
  21. package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
  22. package/dist/esm/components/flows-actors/approval.js +22 -5
  23. package/dist/esm/components/flows-actors/approval.js.map +1 -1
  24. package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts.map +1 -1
  25. package/dist/esm/components/form/automated/ResourceAutomatedForm.js +20 -1
  26. package/dist/esm/components/form/automated/ResourceAutomatedForm.js.map +1 -1
  27. package/dist/esm/components/form/chromes/FormFieldChrome.js +1 -1
  28. package/dist/esm/components/form/chromes/FormFieldChrome.js.map +1 -1
  29. package/dist/esm/components/form/chromes/field-control-aria.d.ts +8 -1
  30. package/dist/esm/components/form/chromes/field-control-aria.d.ts.map +1 -1
  31. package/dist/esm/components/form/chromes/field-control-aria.js +19 -2
  32. package/dist/esm/components/form/chromes/field-control-aria.js.map +1 -1
  33. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.d.ts +5 -0
  34. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.d.ts.map +1 -1
  35. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.js +6 -2
  36. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.js.map +1 -1
  37. package/dist/esm/components/resources/ResourceCollectionBody_Table.d.ts.map +1 -1
  38. package/dist/esm/components/resources/ResourceCollectionBody_Table.js +8 -1
  39. package/dist/esm/components/resources/ResourceCollectionBody_Table.js.map +1 -1
  40. package/dist/esm/components/resources/ResourceLayout_DangerZone.d.ts.map +1 -1
  41. package/dist/esm/components/resources/ResourceLayout_DangerZone.js +2 -2
  42. package/dist/esm/components/resources/ResourceLayout_DangerZone.js.map +1 -1
  43. package/dist/esm/components/resources/ResourceLayout_RecordSharing.js +2 -2
  44. package/dist/esm/components/resources/ResourceLayout_RecordSharing.js.map +1 -1
  45. package/dist/esm/components/resources/ResourceListItemRenderer.d.ts.map +1 -1
  46. package/dist/esm/components/resources/ResourceListItemRenderer.js +6 -1
  47. package/dist/esm/components/resources/ResourceListItemRenderer.js.map +1 -1
  48. package/dist/esm/components/resources/skeleton/DisplayLayout.js +2 -2
  49. package/dist/esm/components/resources/skeleton/DisplayLayout.js.map +1 -1
  50. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.d.ts.map +1 -1
  51. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js +71 -16
  52. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js.map +1 -1
  53. package/dist/esm/components/sections/surface.d.ts +12 -0
  54. package/dist/esm/components/sections/surface.d.ts.map +1 -1
  55. package/dist/esm/components/sections/surface.js +14 -0
  56. package/dist/esm/components/sections/surface.js.map +1 -1
  57. package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.d.ts.map +1 -1
  58. package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.js +3 -2
  59. package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.js.map +1 -1
  60. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts +15 -0
  61. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts.map +1 -1
  62. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js +29 -0
  63. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js.map +1 -1
  64. package/dist/esm/core/app-shell/shell-motion/use-shell-motion.d.ts.map +1 -1
  65. package/dist/esm/core/app-shell/shell-motion/use-shell-motion.js +2 -2
  66. package/dist/esm/core/app-shell/shell-motion/use-shell-motion.js.map +1 -1
  67. package/dist/esm/core/branding/useBrandPresentation.d.ts.map +1 -1
  68. package/dist/esm/core/branding/useBrandPresentation.js +17 -6
  69. package/dist/esm/core/branding/useBrandPresentation.js.map +1 -1
  70. package/dist/esm/core/events/events.frontend.schemas.d.ts +40 -0
  71. package/dist/esm/core/events/events.frontend.schemas.d.ts.map +1 -1
  72. package/dist/esm/core/events/events.frontend.schemas.js +24 -1
  73. package/dist/esm/core/events/events.frontend.schemas.js.map +1 -1
  74. package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.d.ts.map +1 -1
  75. package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.js +11 -1
  76. package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.js.map +1 -1
  77. package/dist/esm/core/i18n/I18nContext.d.ts.map +1 -1
  78. package/dist/esm/core/i18n/I18nContext.js +8 -2
  79. package/dist/esm/core/i18n/I18nContext.js.map +1 -1
  80. package/dist/esm/core/i18n/component-label-resolution.utils.d.ts.map +1 -1
  81. package/dist/esm/core/i18n/component-label-resolution.utils.js +6 -1
  82. package/dist/esm/core/i18n/component-label-resolution.utils.js.map +1 -1
  83. package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts +0 -15
  84. package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts.map +1 -1
  85. package/dist/esm/core/monitoring/analytics/AnalyticsContext.js +102 -5
  86. package/dist/esm/core/monitoring/analytics/AnalyticsContext.js.map +1 -1
  87. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.d.ts.map +1 -1
  88. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js +12 -3
  89. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js.map +1 -1
  90. package/dist/esm/core/navigation/NavigationContext.d.ts.map +1 -1
  91. package/dist/esm/core/navigation/NavigationContext.js +60 -17
  92. package/dist/esm/core/navigation/NavigationContext.js.map +1 -1
  93. package/dist/esm/core/navigation/launcher-resolution.d.ts +29 -0
  94. package/dist/esm/core/navigation/launcher-resolution.d.ts.map +1 -1
  95. package/dist/esm/core/navigation/launcher-resolution.js +31 -0
  96. package/dist/esm/core/navigation/launcher-resolution.js.map +1 -1
  97. package/dist/esm/core/navigation/navigation-controller-internals.d.ts +48 -0
  98. package/dist/esm/core/navigation/navigation-controller-internals.d.ts.map +1 -1
  99. package/dist/esm/core/navigation/navigation-controller-internals.js +56 -3
  100. package/dist/esm/core/navigation/navigation-controller-internals.js.map +1 -1
  101. package/dist/esm/core/navigation/useNavigationRouterSync.d.ts.map +1 -1
  102. package/dist/esm/core/navigation/useNavigationRouterSync.js +30 -2
  103. package/dist/esm/core/navigation/useNavigationRouterSync.js.map +1 -1
  104. package/dist/esm/core/resources/resource-read-cache.frontend.service.d.ts +6 -1
  105. package/dist/esm/core/resources/resource-read-cache.frontend.service.d.ts.map +1 -1
  106. package/dist/esm/core/resources/resource-read-cache.frontend.service.js +11 -1
  107. package/dist/esm/core/resources/resource-read-cache.frontend.service.js.map +1 -1
  108. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.d.ts +44 -0
  109. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.d.ts.map +1 -0
  110. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.js +63 -0
  111. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.js.map +1 -0
  112. package/dist/esm/core/resources/useOperationDirectExecution.d.ts.map +1 -1
  113. package/dist/esm/core/resources/useOperationDirectExecution.js +45 -6
  114. package/dist/esm/core/resources/useOperationDirectExecution.js.map +1 -1
  115. package/dist/esm/core/runtime/AppRouter.d.ts.map +1 -1
  116. package/dist/esm/core/runtime/AppRouter.js +18 -1
  117. package/dist/esm/core/runtime/AppRouter.js.map +1 -1
  118. package/dist/esm/core/runtime/ApplicationMainContext.d.ts +1 -1
  119. package/dist/esm/core/runtime/ApplicationMainContext.d.ts.map +1 -1
  120. package/dist/esm/core/runtime/ApplicationMainContext.js +12 -3
  121. package/dist/esm/core/runtime/ApplicationMainContext.js.map +1 -1
  122. package/dist/esm/core/security/UserOrgsContext.d.ts +6 -1
  123. package/dist/esm/core/security/UserOrgsContext.d.ts.map +1 -1
  124. package/dist/esm/core/security/UserOrgsContext.js +87 -10
  125. package/dist/esm/core/security/UserOrgsContext.js.map +1 -1
  126. package/dist/esm/core/security/consent-gate.frontend.utils.d.ts +17 -5
  127. package/dist/esm/core/security/consent-gate.frontend.utils.d.ts.map +1 -1
  128. package/dist/esm/core/security/consent-gate.frontend.utils.js +16 -7
  129. package/dist/esm/core/security/consent-gate.frontend.utils.js.map +1 -1
  130. package/dist/esm/core/security/useConsentGateBehavior.js +1 -1
  131. package/dist/esm/core/security/useConsentGateBehavior.js.map +1 -1
  132. package/dist/esm/core/security/useGrantedConsentPurposes.js +1 -1
  133. package/dist/esm/core/security/useGrantedConsentPurposes.js.map +1 -1
  134. package/dist/esm/core/ui/inner-control-activation.utils.d.ts +16 -0
  135. package/dist/esm/core/ui/inner-control-activation.utils.d.ts.map +1 -0
  136. package/dist/esm/core/ui/inner-control-activation.utils.js +44 -0
  137. package/dist/esm/core/ui/inner-control-activation.utils.js.map +1 -0
  138. package/dist/esm/index.d.ts +1 -0
  139. package/dist/esm/index.d.ts.map +1 -1
  140. package/dist/esm/index.js +1 -0
  141. package/dist/esm/index.js.map +1 -1
  142. package/dist/tsconfig.build.tsbuildinfo +1 -1
  143. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"DisplayLayout.js","sourceRoot":"","sources":["../../../../../src/components/resources/skeleton/DisplayLayout.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,OAAO,EAAkB,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAA2B,MAAM,qCAAqC,CAAC;AACjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,EACL,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAqB,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,0BAA0B,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AA0B,CAAC,OAAO,EAAE,cAAc,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IACvI,OAAO,EAAE,GAAG,MAAM,EAAE,YAAY,EAAE,CAAC;AACrC,CAAC;AAED;;;GAGG;AACH,SAAS,qBAAqB,CAAC,EAC7B,YAAY,EACZ,eAAe,GAIhB;IACC,OAAO,CACL,KAAC,kBAAkB,IACjB,QAAQ,EAAE,sBAAsB,CAAC,OAAO,EACxC,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,GAChC,CACH,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport React, { useMemo, type ReactNode } from 'react';\nimport { TypographyVariant, type ResponsiveMaxWidth } from '@wildo-ai/presets-components-models';\nimport { SectionLegendVoiceHost } from '../../sections/section-legend-voice';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { responsiveMaxWidthToCssValue } from '../../sections/surface';\nimport { FieldScopeProvider } from './FieldScopeContext';\nimport { useOptionalDisplayTemplateContext } from '../../data-display/DisplayTemplateContext';\nimport { ContentSectionContainer } from '../../sections/ContentSectionContainer';\nimport type { ContentSectionDescriptor } from '../../sections/ContentSectionContainer';\nimport {\n groupSectionsByAppearance,\n buildSectionConfigFromGroup,\n} from './section-consolidation.utils';\nimport { GroupedSectionBody, type SectionProps } from './Section';\nimport { GroupedSectionHostKind } from './Section.shared';\nimport type { SectionConfig } from '@wildo-ai/presets-components-models';\nimport { SectionMode, getEnumValues } from '@wildo-ai/zod-decorators';\nimport { getFieldSchema, getNestedValue } from '../../data-display/display-field-resolution.utils';\nimport {\n SectionStageBindingError,\n assertSectionStageBinding,\n resolveCurrentSectionStage,\n type SectionStageBinding,\n} from '../../sections/section-stages';\nimport type { SectionGroup } from './section-consolidation.utils';\n\n/** @wildo_source:part:start saas.frontend.display-layout.reading-measure facet:layer:frontend facet:family:layout facet:audience:app-developer */\nexport interface DisplayLayoutProps {\n /** Additional CSS classes for the root container. */\n className?: string;\n /**\n * How wide the layout root lets its content grow, named in the framework's own vocabulary.\n *\n * Left unset, the width is DERIVED from what the layout renders: the reading-measure cap (~42rem, themeable\n * via `--measure-max-width`) that keeps a single-column stack of label/value pairs readable instead of\n * stretched edge to edge — lifted as soon as the layout holds a collection (see the last paragraph).\n *\n * It is WRONG for a composed document. A template that renders tabs, quote blocks, tables or regions\n * is not a field stack: those set their own measure internally, and a 42rem cap around them squeezes\n * the whole composition into a column with dead space beside it. Such a template declares `'none'`.\n *\n * `'none'` is not \"uncapped\" in practice — the zone content boundary above has already capped the\n * area at the page-content width (`'content'`, ~80rem) and an adjacent pane is narrower still. This\n * prop decides only whether a SECOND, tighter cap applies inside that, and the answer depends on what\n * the template renders, which is why the template is the one asked.\n *\n * Left UNSET, the cap is derived from what the layout actually renders: the reading measure for fields,\n * lifted as soon as the layout holds a COLLECTION (a related list, an embedded collection — any surface\n * marked {@link COLLECTION_SURFACE_ATTRIBUTE}). A list squeezed into a 42rem column, under a header that\n * spans the page, is what a field-only cap does to a record whose page is mostly its list. Declared, the\n * value is the template's statement and is applied as given.\n */\n responsiveMaxWidth?: ResponsiveMaxWidth;\n children?: ReactNode;\n}\n/** @wildo_source:part:end saas.frontend.display-layout.reading-measure */\n\n/**\n * The attribute that marks a COLLECTION in the rendered page, so a layout around it can tell it holds a list.\n *\n * Carried by the `ResourceLayout_List` / `ResourceLayout_Search` wrappers (around any preset or custom view, from\n * the first paint) and by a `RelatedResourceSections` block that holds a list (before its labels load, whichever\n * tab is open). Read by CSS `:has()`: by `DisplayLayout`, to lift its reading measure, and by the READ page, to give\n * the danger zone the same width as the record body (`--record-body-max-inline-size`). Being CSS, the decision\n * follows the DOM and never needs a second render.\n */\nexport const COLLECTION_SURFACE_ATTRIBUTE = 'data-collection-surface';\n\n/**\n * Root wrapper for display (read-only) layout templates.\n *\n * Provides a root `FieldScopeContext` with empty prefix so nested\n * `<DisplayField name=\"...\">` components resolve field names correctly.\n *\n * `ResourceDisplayContext` (inline editing, RMM, file upload) is provided\n * by the parent `ResourceAutomaticDisplayer`, not by this layout component.\n *\n * @example\n * ```tsx\n * <DisplayLayout>\n * <Section name=\"general\">\n * <DisplayField name=\"title\" />\n * <DisplayField name=\"status\" />\n * </Section>\n * </DisplayLayout>\n * ```\n */\nexport function DisplayLayout({ className, children, responsiveMaxWidth }: DisplayLayoutProps): ReactNode {\n const displayCtx = useOptionalDisplayTemplateContext();\n const renderedChildren = useMemo(\n () => renderGroupedChildren(children, displayCtx),\n [children, displayCtx],\n );\n\n return (\n <FieldScopeProvider pathPrefix=\"\">\n {/* A read body names its section groups in the EYEBROW voice — see `SectionLegendVoiceHost`. */}\n <SectionLegendVoiceHost voice={TypographyVariant.EYEBROW}>\n {/*\n T4c — reading-measure cap (mirrors FormLayout). A single-column\n read/detail stack caps at `--measure-max-width` (~42rem) and aligns to\n the LEFT of the content zone, so detail views stop stretching\n edge-to-edge yet stay flush with the left-aligned resource header and\n danger-zone siblings (no centred gutter between them). `max-w` only\n engages above the measure, so a detail rendered inside a narrow\n dialog/panel is unaffected. Retune/opt-out via the CSS var or `className`.\n */}\n {/*\n `space-y-section` separates stacked SECTIONS (each titled CARD group /\n container) with a clear gap so consecutive cards read as distinct groups\n rather than one continuous stack. Sectionless templates whose direct\n children are bare SETTINGS_ROW field rows must NOT inherit that section\n gap: the row chrome is a self-delimiting list item (`py-card-sm` rhythm +\n `border-b` hairline), so consecutive rows stack FLUSH — the same\n content-aware rule the `ContentSection` body applies to settings rows.\n The pairwise `:has(+ …)` selector zeroes only the margin BETWEEN two\n adjacent settings rows, so a row followed by a real section (mixed\n template) keeps the section gap.\n\n ⚠ The attribute match is `^=settings` (prefix), NOT `=settings_row`:\n Tailwind converts an unescaped `_` inside an arbitrary variant to a\n SPACE, emitting the invalid selector `[data-chrome-mode=settings row]`\n which the browser silently drops (this killed ContentSection's original\n `…=settings_row]]:gap-0` spelling — verified against the served CSS).\n Only `settings_row` starts with `settings`, so the prefix is exact.\n */}\n <div\n className={cn(\n 'mr-auto w-full space-y-section',\n '[&>[data-chrome-mode^=settings]:has(+[data-chrome-mode^=settings])]:mb-0',\n // Derived width (no declaration): the reading measure, lifted when the layout holds a collection.\n // The selector spells the attribute literally because Tailwind reads class names statically;\n // `display-layout-derived-width.test.tsx` holds it equal to `COLLECTION_SURFACE_ATTRIBUTE`.\n responsiveMaxWidth === undefined\n && '[max-inline-size:var(--measure-max-width,42rem)] has-[[data-collection-surface]]:[max-inline-size:none]',\n className,\n )}\n style={responsiveMaxWidth === undefined ? undefined : { maxInlineSize: responsiveMaxWidthToCssValue(responsiveMaxWidth) }}\n data-inline-size-tier={responsiveMaxWidth ?? 'derived'}\n data-guidance-display\n >\n {renderedChildren}\n </div>\n </SectionLegendVoiceHost>\n </FieldScopeProvider>\n );\n}\n\n/**\n * Introspects children for `<Section>` elements with container-mode `appearance`.\n * Groups sections sharing the same container mode into a `ContentSectionContainer`.\n * Solo-mode sections and non-Section children render in place.\n */\nfunction renderGroupedChildren(\n children: ReactNode,\n displayCtx: ReturnType<typeof useOptionalDisplayTemplateContext>,\n): ReactNode {\n const grouped = groupSectionsByAppearance(children, displayCtx?.defaultSectionAppearance);\n\n return (\n <>\n {grouped.items.map((item, idx) => {\n if (item.type === 'node') {\n return <React.Fragment key={idx}>{item.node}</React.Fragment>;\n }\n\n const { group } = item;\n const config = withRecordStage(buildSectionConfigFromGroup(group), group, displayCtx);\n const sectionLabels = displayCtx?.sectionLabels ?? {};\n const sectionDescriptions = displayCtx?.sectionDescriptions ?? {};\n\n const contentSections: ContentSectionDescriptor[] = group.sections.map((el) => ({\n id: el.props.name,\n title: sectionLabels[el.props.name],\n description: sectionDescriptions[el.props.name],\n content: (\n <GroupedSectionContent\n sectionProps={el.props}\n providesHeading={!!sectionLabels[el.props.name]}\n />\n ),\n }));\n\n return (\n <ContentSectionContainer\n key={`group-${group.mode}-${idx}`}\n sections={contentSections}\n config={config}\n />\n );\n })}\n </>\n );\n}\n\n/**\n * A STAGES group's current stage, read from the record this layout displays (#1786). This host is the one that\n * holds the record, so it is where the bound field is read; the container only draws the result. Every other\n * mode's config is returned as built.\n *\n * The binding is checked against the field's schema on every render that groups it, and a binding that could\n * misstate a record's stage throws (`assertSectionStageBinding`). Outside a display template there is no record:\n * the config is returned without a stage and the container stacks the sections instead of guessing.\n */\nfunction withRecordStage(\n config: SectionConfig,\n group: SectionGroup,\n displayCtx: ReturnType<typeof useOptionalDisplayTemplateContext>,\n): SectionConfig {\n if (config.mode !== SectionMode.STAGES || displayCtx === null) return config;\n const [first, ...rest] = group.sections;\n const stageNames = group.sections.map((section) => section.props.name);\n // `stageBinding` exists only on the STAGES member of the `SectionProps` union; grouping already put only STAGES\n // sections here, but the element type does not know it.\n const stageBindingOf = (props: SectionProps): SectionStageBinding | undefined =>\n 'stageBinding' in props ? props.stageBinding : undefined;\n const stray = rest.find((section) => stageBindingOf(section.props) !== undefined);\n if (stray !== undefined) {\n throw new SectionStageBindingError(\n `section \"${stray.props.name}\" declares a stageBinding, but a group's binding is read from its FIRST section (\"${first.props.name}\"). Declare it there, once.`,\n );\n }\n const binding = stageBindingOf(first.props);\n const fieldSchema = binding ? getFieldSchema(displayCtx.schema, binding.field) : undefined;\n assertSectionStageBinding(binding, stageNames, fieldSchema ? getEnumValues(fieldSchema) : undefined);\n const currentStage = displayCtx.isLoading ? null : resolveCurrentSectionStage(binding, getNestedValue(displayCtx.data, binding.field));\n return { ...config, currentStage };\n}\n\n/**\n * Wraps an individual grouped section's content with section-level behaviors\n * (displayChromeMode) when rendered inside a container.\n */\nfunction GroupedSectionContent({\n sectionProps,\n providesHeading,\n}: {\n sectionProps: Pick<SectionProps, 'name' | 'children' | 'chromeMode' | 'className' | 'disabled'>;\n providesHeading?: boolean;\n}): ReactNode {\n return (\n <GroupedSectionBody\n hostKind={GroupedSectionHostKind.DISPLAY}\n sectionProps={sectionProps}\n providesHeading={providesHeading}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"DisplayLayout.js","sourceRoot":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C,OAAO,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,CAAC;IAClF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,wBAAwB,CAChC,YAAY,KAAK,CAAC,KAAK,CAAC,IAAI,qFAAqF,KAAK,CAAC,KAAK,CAAC,IAAI,6BAA6B,CAC/J,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GAAG,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3F,yBAAyB,CAAC,OAAO,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACrG,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,0BAA0B,CAAC,OAAO,EAAE,cAAc,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IACvI,OAAO,EAAE,GAAG,MAAM,EAAE,YAAY,EAAE,CAAC;AACrC,CAAC;AAED;;;GAGG;AACH,SAAS,qBAAqB,CAAC,EAC7B,YAAY,EACZ,eAAe,GAIhB;IACC,OAAO,CACL,KAAC,kBAAkB,IACjB,QAAQ,EAAE,sBAAsB,CAAC,OAAO,EACxC,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,GAChC,CACH,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport React, { useMemo, type ReactNode } from 'react';\nimport { TypographyVariant, type ResponsiveMaxWidth } from '@wildo-ai/presets-components-models';\nimport { SectionLegendVoiceHost } from '../../sections/section-legend-voice';\nimport { cn } from '~wildo-frontend-lib/core/ui/cn';\nimport { optionalMaxInlineSizeStyle } from '../../sections/surface';\nimport { FieldScopeProvider } from './FieldScopeContext';\nimport { useOptionalDisplayTemplateContext } from '../../data-display/DisplayTemplateContext';\nimport { ContentSectionContainer } from '../../sections/ContentSectionContainer';\nimport type { ContentSectionDescriptor } from '../../sections/ContentSectionContainer';\nimport {\n groupSectionsByAppearance,\n buildSectionConfigFromGroup,\n} from './section-consolidation.utils';\nimport { GroupedSectionBody, type SectionProps } from './Section';\nimport { GroupedSectionHostKind } from './Section.shared';\nimport type { SectionConfig } from '@wildo-ai/presets-components-models';\nimport { SectionMode, getEnumValues } from '@wildo-ai/zod-decorators';\nimport { getFieldSchema, getNestedValue } from '../../data-display/display-field-resolution.utils';\nimport {\n SectionStageBindingError,\n assertSectionStageBinding,\n resolveCurrentSectionStage,\n type SectionStageBinding,\n} from '../../sections/section-stages';\nimport type { SectionGroup } from './section-consolidation.utils';\n\n/** @wildo_source:part:start saas.frontend.display-layout.reading-measure facet:layer:frontend facet:family:layout facet:audience:app-developer */\nexport interface DisplayLayoutProps {\n /** Additional CSS classes for the root container. */\n className?: string;\n /**\n * How wide the layout root lets its content grow, named in the framework's own vocabulary.\n *\n * Left unset, the width is DERIVED from what the layout renders: the reading-measure cap (~42rem, themeable\n * via `--measure-max-width`) that keeps a single-column stack of label/value pairs readable instead of\n * stretched edge to edge — lifted as soon as the layout holds a collection (see the last paragraph).\n *\n * It is WRONG for a composed document. A template that renders tabs, quote blocks, tables or regions\n * is not a field stack: those set their own measure internally, and a 42rem cap around them squeezes\n * the whole composition into a column with dead space beside it. Such a template declares `'none'`.\n *\n * `'none'` is not \"uncapped\" in practice — the zone content boundary above has already capped the\n * area at the page-content width (`'content'`, ~80rem) and an adjacent pane is narrower still. This\n * prop decides only whether a SECOND, tighter cap applies inside that, and the answer depends on what\n * the template renders, which is why the template is the one asked.\n *\n * Left UNSET, the cap is derived from what the layout actually renders: the reading measure for fields,\n * lifted as soon as the layout holds a COLLECTION (a related list, an embedded collection — any surface\n * marked {@link COLLECTION_SURFACE_ATTRIBUTE}). A list squeezed into a 42rem column, under a header that\n * spans the page, is what a field-only cap does to a record whose page is mostly its list. Declared, the\n * value is the template's statement and is applied as given.\n */\n responsiveMaxWidth?: ResponsiveMaxWidth;\n children?: ReactNode;\n}\n/** @wildo_source:part:end saas.frontend.display-layout.reading-measure */\n\n/**\n * The attribute that marks a COLLECTION in the rendered page, so a layout around it can tell it holds a list.\n *\n * Carried by the `ResourceLayout_List` / `ResourceLayout_Search` wrappers (around any preset or custom view, from\n * the first paint) and by a `RelatedResourceSections` block that holds a list (before its labels load, whichever\n * tab is open). Read by CSS `:has()`: by `DisplayLayout`, to lift its reading measure, and by the READ page, to give\n * the danger zone the same width as the record body (`--record-body-max-inline-size`). Being CSS, the decision\n * follows the DOM and never needs a second render.\n */\nexport const COLLECTION_SURFACE_ATTRIBUTE = 'data-collection-surface';\n\n/**\n * Root wrapper for display (read-only) layout templates.\n *\n * Provides a root `FieldScopeContext` with empty prefix so nested\n * `<DisplayField name=\"...\">` components resolve field names correctly.\n *\n * `ResourceDisplayContext` (inline editing, RMM, file upload) is provided\n * by the parent `ResourceAutomaticDisplayer`, not by this layout component.\n *\n * @example\n * ```tsx\n * <DisplayLayout>\n * <Section name=\"general\">\n * <DisplayField name=\"title\" />\n * <DisplayField name=\"status\" />\n * </Section>\n * </DisplayLayout>\n * ```\n */\nexport function DisplayLayout({ className, children, responsiveMaxWidth }: DisplayLayoutProps): ReactNode {\n const displayCtx = useOptionalDisplayTemplateContext();\n const renderedChildren = useMemo(\n () => renderGroupedChildren(children, displayCtx),\n [children, displayCtx],\n );\n\n return (\n <FieldScopeProvider pathPrefix=\"\">\n {/* A read body names its section groups in the EYEBROW voice — see `SectionLegendVoiceHost`. */}\n <SectionLegendVoiceHost voice={TypographyVariant.EYEBROW}>\n {/*\n T4c — reading-measure cap (mirrors FormLayout). A single-column\n read/detail stack caps at `--measure-max-width` (~42rem) and aligns to\n the LEFT of the content zone, so detail views stop stretching\n edge-to-edge yet stay flush with the left-aligned resource header and\n danger-zone siblings (no centred gutter between them). `max-w` only\n engages above the measure, so a detail rendered inside a narrow\n dialog/panel is unaffected. Retune/opt-out via the CSS var or `className`.\n */}\n {/*\n `space-y-section` separates stacked SECTIONS (each titled CARD group /\n container) with a clear gap so consecutive cards read as distinct groups\n rather than one continuous stack. Sectionless templates whose direct\n children are bare SETTINGS_ROW field rows must NOT inherit that section\n gap: the row chrome is a self-delimiting list item (`py-card-sm` rhythm +\n `border-b` hairline), so consecutive rows stack FLUSH — the same\n content-aware rule the `ContentSection` body applies to settings rows.\n The pairwise `:has(+ …)` selector zeroes only the margin BETWEEN two\n adjacent settings rows, so a row followed by a real section (mixed\n template) keeps the section gap.\n\n ⚠ The attribute match is `^=settings` (prefix), NOT `=settings_row`:\n Tailwind converts an unescaped `_` inside an arbitrary variant to a\n SPACE, emitting the invalid selector `[data-chrome-mode=settings row]`\n which the browser silently drops (this killed ContentSection's original\n `…=settings_row]]:gap-0` spelling — verified against the served CSS).\n Only `settings_row` starts with `settings`, so the prefix is exact.\n */}\n <div\n className={cn(\n 'mr-auto w-full space-y-section',\n '[&>[data-chrome-mode^=settings]:has(+[data-chrome-mode^=settings])]:mb-0',\n // Derived width (no declaration): the reading measure, lifted when the layout holds a collection.\n // The selector spells the attribute literally because Tailwind reads class names statically;\n // `display-layout-derived-width.test.tsx` holds it equal to `COLLECTION_SURFACE_ATTRIBUTE`.\n responsiveMaxWidth === undefined\n && '[max-inline-size:var(--measure-max-width,42rem)] has-[[data-collection-surface]]:[max-inline-size:none]',\n className,\n )}\n style={optionalMaxInlineSizeStyle(responsiveMaxWidth)}\n data-inline-size-tier={responsiveMaxWidth ?? 'derived'}\n data-guidance-display\n >\n {renderedChildren}\n </div>\n </SectionLegendVoiceHost>\n </FieldScopeProvider>\n );\n}\n\n/**\n * Introspects children for `<Section>` elements with container-mode `appearance`.\n * Groups sections sharing the same container mode into a `ContentSectionContainer`.\n * Solo-mode sections and non-Section children render in place.\n */\nfunction renderGroupedChildren(\n children: ReactNode,\n displayCtx: ReturnType<typeof useOptionalDisplayTemplateContext>,\n): ReactNode {\n const grouped = groupSectionsByAppearance(children, displayCtx?.defaultSectionAppearance);\n\n return (\n <>\n {grouped.items.map((item, idx) => {\n if (item.type === 'node') {\n return <React.Fragment key={idx}>{item.node}</React.Fragment>;\n }\n\n const { group } = item;\n const config = withRecordStage(buildSectionConfigFromGroup(group), group, displayCtx);\n const sectionLabels = displayCtx?.sectionLabels ?? {};\n const sectionDescriptions = displayCtx?.sectionDescriptions ?? {};\n\n const contentSections: ContentSectionDescriptor[] = group.sections.map((el) => ({\n id: el.props.name,\n title: sectionLabels[el.props.name],\n description: sectionDescriptions[el.props.name],\n content: (\n <GroupedSectionContent\n sectionProps={el.props}\n providesHeading={!!sectionLabels[el.props.name]}\n />\n ),\n }));\n\n return (\n <ContentSectionContainer\n key={`group-${group.mode}-${idx}`}\n sections={contentSections}\n config={config}\n />\n );\n })}\n </>\n );\n}\n\n/**\n * A STAGES group's current stage, read from the record this layout displays (#1786). This host is the one that\n * holds the record, so it is where the bound field is read; the container only draws the result. Every other\n * mode's config is returned as built.\n *\n * The binding is checked against the field's schema on every render that groups it, and a binding that could\n * misstate a record's stage throws (`assertSectionStageBinding`). Outside a display template there is no record:\n * the config is returned without a stage and the container stacks the sections instead of guessing.\n */\nfunction withRecordStage(\n config: SectionConfig,\n group: SectionGroup,\n displayCtx: ReturnType<typeof useOptionalDisplayTemplateContext>,\n): SectionConfig {\n if (config.mode !== SectionMode.STAGES || displayCtx === null) return config;\n const [first, ...rest] = group.sections;\n const stageNames = group.sections.map((section) => section.props.name);\n // `stageBinding` exists only on the STAGES member of the `SectionProps` union; grouping already put only STAGES\n // sections here, but the element type does not know it.\n const stageBindingOf = (props: SectionProps): SectionStageBinding | undefined =>\n 'stageBinding' in props ? props.stageBinding : undefined;\n const stray = rest.find((section) => stageBindingOf(section.props) !== undefined);\n if (stray !== undefined) {\n throw new SectionStageBindingError(\n `section \"${stray.props.name}\" declares a stageBinding, but a group's binding is read from its FIRST section (\"${first.props.name}\"). Declare it there, once.`,\n );\n }\n const binding = stageBindingOf(first.props);\n const fieldSchema = binding ? getFieldSchema(displayCtx.schema, binding.field) : undefined;\n assertSectionStageBinding(binding, stageNames, fieldSchema ? getEnumValues(fieldSchema) : undefined);\n const currentStage = displayCtx.isLoading ? null : resolveCurrentSectionStage(binding, getNestedValue(displayCtx.data, binding.field));\n return { ...config, currentStage };\n}\n\n/**\n * Wraps an individual grouped section's content with section-level behaviors\n * (displayChromeMode) when rendered inside a container.\n */\nfunction GroupedSectionContent({\n sectionProps,\n providesHeading,\n}: {\n sectionProps: Pick<SectionProps, 'name' | 'children' | 'chromeMode' | 'className' | 'disabled'>;\n providesHeading?: boolean;\n}): ReactNode {\n return (\n <GroupedSectionBody\n hostKind={GroupedSectionHostKind.DISPLAY}\n sectionProps={sectionProps}\n providesHeading={providesHeading}\n />\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ResourceFieldDisplayPreset_ResourceReference_Default.d.ts","sourceRoot":"","sources":["../../../../../../src/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAA4D,MAAM,OAAO,CAAC;AAyBjF,OAAO,KAAK,EAAE,yDAAyD,EAAE,MAAM,2GAA2G,CAAC;AA8D3L,eAAO,MAAM,oDAAoD,GAAI,gIASlE,yDAAyD,KAAG,KAAK,CAAC,GAAG,CAAC,OAyyBxE,CAAC"}
1
+ {"version":3,"file":"ResourceFieldDisplayPreset_ResourceReference_Default.d.ts","sourceRoot":"","sources":["../../../../../../src/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAwE,MAAM,OAAO,CAAC;AA6B7F,OAAO,KAAK,EAAE,yDAAyD,EAAE,MAAM,2GAA2G,CAAC;AA8D3L,eAAO,MAAM,oDAAoD,GAAI,gIASlE,yDAAyD,KAAG,KAAK,CAAC,GAAG,CAAC,OAu2BxE,CAAC"}
@@ -9,7 +9,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
9
9
  * explicitly, the preset resolves it from relationship/FK metadata in the
10
10
  * frontend registry rather than from local naming guesses alone.
11
11
  */
12
- import React, { useEffect, useState, useCallback, useMemo, useRef } from 'react';
12
+ import React, { useContext, useEffect, useState, useCallback, useMemo, useRef } from 'react';
13
13
  import { Link } from 'react-router';
14
14
  import { Skeleton } from '../../../../components/feedback/skeleton.js';
15
15
  import { Badge } from '../../../../components/data-display/badge.js';
@@ -23,14 +23,18 @@ import { useI18n } from '../../../../core/i18n/useI18n.js';
23
23
  import { cn } from '../../../../core/ui/cn.js';
24
24
  import { FocusIndicatorShape, focusIndicatorClasses } from '../../../../core/ui/themes/focus-indicator.js';
25
25
  import { FrontendResourceUtils, frontendResourceUtils } from '../../../../core/resources/frontend-resource.utils.js';
26
- import { pickPreferredOperationForCoreSemanticAddressability } from '../../../../core/resources/resource-addressability.frontend.utils.js';
26
+ import { pickPreferredOperationForCoreSemanticAddressability, resolveRecordOrganizationId } from '../../../../core/resources/resource-addressability.frontend.utils.js';
27
+ import { viewerReachesUserSubject } from '../../../../core/navigation/launcher-resolution.js';
28
+ import { useViewerEffectiveRolesInOrganization } from '../../../../core/navigation/launcher-runtime-availability.js';
29
+ import { useAppScopeSafe } from '../../../../core/scope/useAppScope.js';
27
30
  import { scopeReferencedRecord } from '../../../../core/resources/referenced-record-scope.frontend.utils.js';
28
31
  import { useResourceDisplayContext, withoutHiddenParentReference } from '../../../../components/data-display/automatic-displayer.utils.js';
29
32
  import { resolveForeignKeyReferencedResourceType } from '../../../../components/data-display/reference-display-target.js';
30
33
  import { useOptionalFormSchemaContext } from '../../../../components/form/useFormSchemaContext.js';
31
- import { CoreResourceOperation, ParentDisplay, ResourcesConfigOperationsUrlsBuilderUtils } from '@wildo-ai/saas-models';
34
+ import { CoreResourceOperation, CoreResourceType, coreResourceShared_FieldIdentifier, ParentDisplay, ResourcesConfigOperationsUrlsBuilderUtils } from '@wildo-ai/saas-models';
32
35
  import { NavigationContentType, NavigationZone } from '../../../../core/navigation/navigation.schemas.js';
33
36
  import { NavigationUtils } from '../../../../core/navigation/navigation.utils.js';
37
+ import { ScopedNavigationControllerContext } from '../../../../core/navigation/useNavigationController.js';
34
38
  import { ResourceSummaryDisplayer } from '../../../../components/data-display/ResourceSummaryDisplayer.js';
35
39
  import { useUserFacingErrorMessage } from '../../../../core/errors/useUserFacingErrorMessage.js';
36
40
  import { fetchResourceReferenceRecordAndLabel, normalizeResourceReferenceSelectionValue, } from '../../../../components/resources-fields/resource-reference/resource-reference.shared.utils.js';
@@ -171,6 +175,30 @@ export const ResourceFieldDisplayPreset_ResourceReference_Default = ({ fieldName
171
175
  return displayParams?.linkable ?? true;
172
176
  }, [isParentReference, parentRefConfig, displayParams?.linkable]);
173
177
  const navigationZone = displayContext?.navigationZone ?? formSchemaContext?.navigationZone;
178
+ /*
179
+ * A SCOPED controller, when this reference is drawn inside a surface that keeps its own navigation stack — today the
180
+ * Settings Hub's sections (`SettingsSectionNavigationHost`), whose rows and actions drill in INSIDE the hub.
181
+ *
182
+ * Read as a bare context rather than through `useNavigationController()`, which throws outside a NavigationProvider:
183
+ * this preset also renders on hosts with no navigation at all (an artifact document), which is why it reaches
184
+ * navigation through the event bus.
185
+ *
186
+ * And why the bus is not enough here: NAVIGATION_REQUEST is translated by ONE runtime-owned bridge
187
+ * (`NavigationRequestBridge`), mounted under the NavigationProvider and therefore OUTSIDE any scoped host, so it
188
+ * always reaches the GLOBAL controller. A member's name in the Settings Hub's members table was sent there: the
189
+ * person's READ opened on the page beneath the hub while the hub stayed on top, and the click looked dead. Inside a
190
+ * scoped host the reference asks that host, exactly as clicking the member's row does, so the person opens in the
191
+ * hub's own drill-in with its back control.
192
+ */
193
+ const scopedNavigationController = useContext(ScopedNavigationControllerContext);
194
+ /** Hands a navigation to the scoped host when there is one, else to the runtime's bridge. */
195
+ const requestNavigation = useCallback((request) => {
196
+ if (scopedNavigationController) {
197
+ scopedNavigationController.navigate(request);
198
+ return;
199
+ }
200
+ emit(FrontendEvents.NAVIGATION_REQUEST, { content: request.content, initiator: request.initiator, urlPath: request.urlPath });
201
+ }, [emit, scopedNavigationController]);
174
202
  // Check if pre-populated data is usable through the configured resource id field.
175
203
  const prePopulatedLabel = React.useMemo(() => {
176
204
  if (!prePopulatedData || typeof prePopulatedData !== 'object' || !resourceType)
@@ -267,6 +295,30 @@ export const ResourceFieldDisplayPreset_ResourceReference_Default = ({ fieldName
267
295
  targetId: id,
268
296
  registry,
269
297
  }), [hostContextIdentifiers, scopedContextualParameters, fkLinkUrlInfo?.currentParentRequirements, hostRecordType, hostRecordId, resourceType, registry]);
298
+ /*
299
+ * The viewer, for the one question the READ pick below must ask about them (#3791): whose row the READ may reach.
300
+ * Their roles in the tenant the host is read in, and their own user id. Both are read without the throwing hooks, so a
301
+ * host outside the providers (an artifact document) gets a viewer nobody is known to be, and a reference to a person
302
+ * offers no door there until the session is known.
303
+ */
304
+ const referenceViewer = useViewerEffectiveRolesInOrganization(resolveRecordOrganizationId(hostRecordType, hostRecordId != null ? String(hostRecordId) : undefined, hostContextIdentifiers));
305
+ const viewerUserId = useAppScopeSafe()?.currentUserId ?? null;
306
+ /**
307
+ * The READ variants of the referenced resource this viewer may OPEN on one target (#3791): every one, except a
308
+ * `USER_SELF`-scoped variant addressed to another person that does not admit them (`viewerReachesUserSubject`).
309
+ *
310
+ * Without it the pick took the `users` default READ for any person: an organization administrator's click on a
311
+ * member's name opened a page whose every read answered `403`, titled by the person's id. The person is the target
312
+ * itself for a reference to a user, else the `userId` the target's scope names; when neither says, it is unknown and
313
+ * no person-scoped variant is offered. Only the reference's DOORS ask this (its link and its overlay): its label read is
314
+ * a different question and keeps its route.
315
+ */
316
+ const readOperationsViewerMayOpen = useCallback((refResourceConfig, id, contextualParameters) => {
317
+ const targetIsPerson = resourceType === CoreResourceType.USERS || resourceType === CoreResourceType.USER_SELF;
318
+ const scopedPerson = contextualParameters[coreResourceShared_FieldIdentifier[CoreResourceType.USERS]];
319
+ const subjectUserId = targetIsPerson ? id : (typeof scopedPerson === 'string' ? scopedPerson : null);
320
+ return (refResourceConfig.operations ?? []).filter((operation) => viewerReachesUserSubject({ ...operation, resourcePrimaryScope: operation.resourcePrimaryScope ?? refResourceConfig.resourcePrimaryScope }, { subjectUserId, viewerUserId }, referenceViewer));
321
+ }, [resourceType, referenceViewer, viewerUserId]);
270
322
  /**
271
323
  * Resolve a concrete link URL for a given FK value.
272
324
  * Builds scoped URLs like /organizations/org-123/users/user-456 instead of /USERS/user-456.
@@ -284,7 +336,7 @@ export const ResourceFieldDisplayPreset_ResourceReference_Default = ({ fieldName
284
336
  };
285
337
  const readOp = pickPreferredOperationForCoreSemanticAddressability({
286
338
  resourceConfig: refResourceConfig,
287
- operations: refResourceConfig.operations ?? [],
339
+ operations: readOperationsViewerMayOpen(refResourceConfig, id, contextualParameters),
288
340
  coreOperation: CoreResourceOperation.READ,
289
341
  registry,
290
342
  hasResourceId: true,
@@ -327,7 +379,7 @@ export const ResourceFieldDisplayPreset_ResourceReference_Default = ({ fieldName
327
379
  // selectMatchingRoutePath may throw — graceful fallback
328
380
  }
329
381
  return null;
330
- }, [fkLinkUrlInfo, registry, resourceType, scopeToTarget]);
382
+ }, [fkLinkUrlInfo, registry, resourceType, scopeToTarget, readOperationsViewerMayOpen]);
331
383
  /**
332
384
  * The OVERLAY fallback — a reference whose target READ is `EMBEDDED` (decided 2026-09-01).
333
385
  *
@@ -343,25 +395,26 @@ export const ResourceFieldDisplayPreset_ResourceReference_Default = ({ fieldName
343
395
  const { refResourceConfig, ownFieldIdentifier } = fkLinkUrlInfo;
344
396
  const targetScope = scopeToTarget(id);
345
397
  const fullContextIdentifiers = { ...targetScope.identifiers, [resourceType]: id };
398
+ const contextualParameters = {
399
+ ...targetScope.contextualParameters,
400
+ ...(ownFieldIdentifier ? { [ownFieldIdentifier]: id } : {}),
401
+ };
346
402
  const readOp = pickPreferredOperationForCoreSemanticAddressability({
347
403
  resourceConfig: refResourceConfig,
348
- operations: refResourceConfig.operations ?? [],
404
+ operations: readOperationsViewerMayOpen(refResourceConfig, id, contextualParameters),
349
405
  coreOperation: CoreResourceOperation.READ,
350
406
  registry,
351
407
  hasResourceId: true,
352
408
  requireFrontendAddressable: false,
353
409
  contextResourceIdentifiers: fullContextIdentifiers,
354
- contextualParameters: {
355
- ...targetScope.contextualParameters,
356
- ...(ownFieldIdentifier ? { [ownFieldIdentifier]: id } : {}),
357
- },
410
+ contextualParameters,
358
411
  });
359
412
  if (!readOp)
360
413
  return null;
361
414
  if (readOp.operationFrontendConfig?.surface !== ResourceOperationFrontendSurface.EMBEDDED)
362
415
  return null;
363
416
  return { readOp };
364
- }, [fkLinkUrlInfo, registry, resourceType, scopeToTarget]);
417
+ }, [fkLinkUrlInfo, registry, resourceType, scopeToTarget, readOperationsViewerMayOpen]);
365
418
  /**
366
419
  * 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
367
420
  * EMBEDDED or API_ONLY read) — the READ's own most specific HTTP route its target-scoped parameters satisfy. Either
@@ -481,7 +534,9 @@ export const ResourceFieldDisplayPreset_ResourceReference_Default = ({ fieldName
481
534
  // badge of the card. It is a block link instead, drawn by the focus contract, as a selectable card is.
482
535
  const summaryLink = effectiveDisplayMode === ForeignKeyDisplayMode.SUMMARY;
483
536
  const navigationTarget = resolveFkNavigationTarget(id);
484
- const shouldUseControllerNavigation = Boolean(navigationZone && navigationTarget?.readOp && navigationTarget?.url);
537
+ // A scoped host takes the click too: without it, the bare `<Link>` below would hand the address to the router and
538
+ // leave the host (the hub closes and the record becomes the page), where every other drill-in stays inside it.
539
+ const shouldUseControllerNavigation = Boolean((navigationZone || scopedNavigationController) && navigationTarget?.readOp && navigationTarget?.url);
485
540
  const handleReferenceNavigation = (e) => {
486
541
  if (!shouldUseControllerNavigation
487
542
  || !navigationTarget
@@ -503,12 +558,12 @@ export const ResourceFieldDisplayPreset_ResourceReference_Default = ({ fieldName
503
558
  parentResourcesRequirements: navigationTarget.parentResourcesRequirements,
504
559
  });
505
560
  e.preventDefault();
506
- emit(FrontendEvents.NAVIGATION_REQUEST, {
561
+ requestNavigation({
507
562
  content: {
508
563
  contentType: NavigationContentType.RESOURCE_OPERATION,
509
564
  resourceContext: readContext,
510
565
  },
511
- initiator: { sourceZone: navigationZone },
566
+ initiator: { sourceZone: navigationZone ?? NavigationZone.PRIMARY },
512
567
  urlPath: navigationTarget.url,
513
568
  });
514
569
  };
@@ -569,7 +624,7 @@ export const ResourceFieldDisplayPreset_ResourceReference_Default = ({ fieldName
569
624
  parentResourcesRequirements: targetScope.parentRequirements,
570
625
  });
571
626
  // No urlPath on purpose: an overlay is not a place — nothing to deep-link, nothing to pop.
572
- emit(FrontendEvents.NAVIGATION_REQUEST, {
627
+ requestNavigation({
573
628
  content: {
574
629
  contentType: NavigationContentType.RESOURCE_OPERATION,
575
630
  resourceContext: readContext,
@@ -595,7 +650,7 @@ export const ResourceFieldDisplayPreset_ResourceReference_Default = ({ fieldName
595
650
  : 'block text-primary hover:underline bg-transparent border-none p-0 cursor-pointer text-left', onClick: openOverlay, children: content }));
596
651
  }
597
652
  return content;
598
- }, [emit, effectiveDisplayMode, fkLinkUrlInfo, isLinkable, isParentReference, navigationZone, parentRefConfig, resolveFkNavigationTarget, resolveFkOverlayTarget, resourceType, scopeToTarget]);
653
+ }, [requestNavigation, scopedNavigationController, effectiveDisplayMode, fkLinkUrlInfo, isLinkable, isParentReference, navigationZone, parentRefConfig, resolveFkNavigationTarget, resolveFkOverlayTarget, resourceType, scopeToTarget]);
599
654
  // Render a single value
600
655
  const renderValue = useCallback((id) => {
601
656
  if (effectiveDisplayMode === ForeignKeyDisplayMode.ID) {