@salesforce/ui-bundle-template-app-react-template-b2e 11.57.2 → 11.57.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [11.57.3](https://github.com/salesforce-experience-platform-emu/webapps/compare/v11.57.2...v11.57.3) (2026-08-14)
7
+
8
+ **Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
9
+
10
+
11
+
12
+
13
+
6
14
  ## [11.57.2](https://github.com/salesforce-experience-platform-emu/webapps/compare/v11.57.1...v11.57.2) (2026-08-14)
7
15
 
8
16
  **Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
@@ -18,8 +18,8 @@
18
18
  "graphql:schema": "node scripts/get-graphql-schema.mjs"
19
19
  },
20
20
  "dependencies": {
21
- "@salesforce/platform-sdk": "^11.57.2",
22
- "@salesforce/ui-bundle": "^11.57.2",
21
+ "@salesforce/platform-sdk": "^11.57.3",
22
+ "@salesforce/ui-bundle": "^11.57.3",
23
23
  "@tailwindcss/vite": "^4.1.17",
24
24
  "class-variance-authority": "^0.7.1",
25
25
  "clsx": "^2.1.1",
@@ -45,8 +45,8 @@
45
45
  "@graphql-eslint/eslint-plugin": "^4.1.0",
46
46
  "@graphql-tools/utils": "^11.0.0",
47
47
  "@playwright/test": "^1.49.0",
48
- "@salesforce/graphiti": "^11.57.2",
49
- "@salesforce/vite-plugin-ui-bundle": "^11.57.2",
48
+ "@salesforce/graphiti": "^11.57.3",
49
+ "@salesforce/vite-plugin-ui-bundle": "^11.57.3",
50
50
  "@testing-library/jest-dom": "^6.6.3",
51
51
  "@testing-library/react": "^16.1.0",
52
52
  "@testing-library/user-event": "^14.5.2",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle-template-base-sfdx-project",
3
- "version": "11.57.2",
3
+ "version": "11.57.3",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@salesforce/ui-bundle-template-base-sfdx-project",
9
- "version": "11.57.2",
9
+ "version": "11.57.3",
10
10
  "license": "SEE LICENSE IN LICENSE.txt",
11
11
  "dependencies": {
12
12
  "fast-xml-parser": "^5.9.3",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle-template-base-sfdx-project",
3
- "version": "11.57.2",
3
+ "version": "11.57.3",
4
4
  "description": "Base SFDX project template",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "publishConfig": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle-template-app-react-template-b2e",
3
- "version": "11.57.2",
3
+ "version": "11.57.3",
4
4
  "description": "Salesforce React internal app template",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "",
@@ -1,246 +0,0 @@
1
- # Search feature
2
-
3
- Explains how this search feature is structured and how to customize it — which
4
- files own configuration, how sObject and CMS sources differ, how CMS search is
5
- wired end to end, and how to mount the UI. Read it before changing anything
6
- under this directory.
7
-
8
- ## 1. What this feature is / where sources live
9
-
10
- - `config.json` (co-located here) declares `sources: SourceConfig[]` — a
11
- discriminated union on `kind` — plus an optional `pagination` block. The
12
- shipped default has 3 `"sobject"` sources (`accounts`, `contacts`,
13
- `opportunities`) and one `"cms"` source (`key: "content"`).
14
- - `loadConfig.ts` re-exports `config.json`, typed as `SearchConfig`. For a
15
- pure config change (add/remove a source, tweak fields), **edit
16
- `config.json` directly — no code changes required.**
17
- - `types.ts` is the source of truth for `SourceConfig` (`SObjectSourceConfig |
18
- CmsSourceConfig`) and `SearchConfig`.
19
-
20
- ## 2. Choosing sObject vs CMS per source
21
-
22
- - **sObject source** (`kind: "sobject"`): requires `objectName`, `label`,
23
- `searchableFields`, `displayFields`. Optional: `labelSingular`, `idField`
24
- (defaults `"Id"`), `routePattern`, `filterBy`, `sortBy`, `defaultSort`,
25
- `whereTypeName`/`orderByTypeName`. Queried via the `uiapi` GraphQL bridge
26
- (`adapters/sobject`).
27
- - **CMS source** (`kind: "cms"`): deliberately minimal — only `kind`, `key`,
28
- `label`, and optionally `labelSingular`/`routePattern`
29
- (`adapters/cms/types.ts`, `CmsSourceConfig`). No `channelId`, no content
30
- types, no `displayFields` — all of that is resolved at runtime. Routed via
31
- `adapters/registry.ts` to `cmsAdapter` (`adapters/cms/index.ts`).
32
- - `adapters/registry.ts` maps `kind` → adapter (`sobject → sObjectAdapter`,
33
- `cms → cmsAdapter`). Adding a new backend `kind` means registering an
34
- adapter here plus extending the `SourceConfig` union in `types.ts` — out of
35
- scope for typical customization; most tasks only touch `config.json`.
36
-
37
- ## 3. Enabling sObject search
38
-
39
- sObject sources work out of the box — no runtime id resolution and no gating.
40
- They query the org's `uiapi` GraphQL bridge through `adapters/sobject`.
41
-
42
- - **Declare the source** in `config.json`: `kind: "sobject"`, `objectName` (the
43
- API name, e.g. `"Account"`), `label`, `searchableFields` (the fields the
44
- free-text term matches against), and `displayFields` (what each result row
45
- shows). A `displayFields` entry is a plain field name (`"Name"`), a
46
- `{ name, raw }` (use the raw value, skip display formatting), or a
47
- `{ name, subfields }` for a parent relationship
48
- (`{ "name": "Owner", "subfields": ["Name"] }`).
49
- - **Optional per-source knobs:** `labelSingular`, `idField` (defaults `"Id"`),
50
- `filterBy` (facets — `picklist` / `numeric` / `daterange`), `sortBy` +
51
- `defaultSort`, and `routePattern` (see §6). `whereTypeName` / `orderByTypeName`
52
- override the generated GraphQL input type names for objects whose where/orderBy
53
- types don't follow the default `<Object>` naming.
54
- - **Query construction:** `buildSearchQuery` (`api/buildSearchQuery.ts`)
55
- assembles the GraphQL from the source config, `buildOrderBy` builds the sort
56
- clause, and picklist filter values come from `useDistinctValues` /
57
- `fetchDistinctValues`. The whole path runs through the platform data SDK — no
58
- enablement step beyond declaring the source.
59
- - **FLS caveat:** a field the running user can't read is silently dropped by the
60
- platform, so an sObject source that "returns nothing" usually means the app's
61
- permission set is missing field access, not a config error.
62
-
63
- ## 4. Enabling CMS search
64
-
65
- This is the part most likely to be missed — read all of it before assuming
66
- CMS search "just works" after adding a `cms` source to `config.json`.
67
-
68
- - **API version requirement.** Search on CMS content is supported only when the
69
- bundle is built against **API version 68.0 or greater**. The build-time
70
- version (`__SF_API_VERSION__`, injected from the resolved org's API version)
71
- is the version every SDK request is actually issued at, so it is the gate.
72
- - **No static id in config.** The UIBundle id is resolved at runtime by
73
- `adapters/cms/searchChannel.ts::getUIBundleId()`, which calls
74
- `@salesforce/platform-sdk`'s `getCurrentApp()` and reads
75
- `identity.bundleId` — the UIBundle **record id** (a `9YE...` id). This is
76
- only populated when running on the WebApp surface (the runtime injects
77
- `SFDC_ENV`, per `packages/sdk/platform-sdk/src/core/app.ts`). Locally, or on
78
- any non-WebApp surface, `bundleId` is `undefined`/`""`, and the CMS source
79
- is skipped with no error — by design.
80
- - **The gate:** `hooks/useSearch.ts` resolves `getUIBundleId()` **and**
81
- `getOrgSupportsCmsSearch()` once per fetch and, for the CMS source, includes
82
- the CMS request only when BOTH pass: `isConfiguredUIBundleId(uiBundleId)`
83
- (`adapters/cms/searchChannel.ts`) and the build API-version check (above).
84
- `isConfiguredUIBundleId` validates the `9YE` shape
85
- (`UI_BUNDLE_ID_PATTERN = /^9YE[a-zA-Z0-9]{12,15}$/`) — an empty or malformed
86
- id, or a build below v68, causes the CMS source to be silently dropped from
87
- the request (no per-source error banner), not sent to the server.
88
- - **CMS UI surfaces hide on a gated build too.** When CMS search is skipped for
89
- the build-version reason, its scope entry and result section would only ever
90
- be empty, so both are hidden using the SAME gate as the fetch skip —
91
- `isCmsSearchSupported()` (the synchronous core of `getOrgSupportsCmsSearch()`,
92
- in `adapters/cms/api/orgApiVersionService.ts`). Two minimal guards read it:
93
- `ScopeSelector` skips the CMS `<SelectItem>` ("Content") and `SearchResults`
94
- skips the CMS `SourceSection` ("Content" heading + empty state). Both are safe
95
- during render because the gate reads only the build-time API version. (The
96
- runtime `bundleId` gate above is _not_ build-constant — it can differ per
97
- surface — so it stays a per-fetch skip and does not hide the UI; a CMS source
98
- skipped only for a missing `bundleId` still shows its section, empty.)
99
- - **The query field:** `adapters/cms/cmsQueryFragment.ts` sends the resolved
100
- `$UIBundleId` into `searchIdentifiers.uibundleIds` (NOT `channelIds`) on
101
- `managed_content.search.searchContentInChannels`. Content-type filtering
102
- (`$cmsContentTypeFQNs`) is omitted on the bootstrap call and supplied once
103
- discovery completes.
104
- - **Why `uibundleIds` (evidence from core).** `ContentSearchIdentifiersInput`
105
- has three id-space fields — `channelIds` (`0ap` Managed Content channel ids),
106
- `siteIds`, and `uibundleIds` — and the `9YE` UIBundle **record id** belongs
107
- only in `uibundleIds`. In core (`core-2206/core-266-public`): the schema
108
- `ui-services-private/.../graphql-schemas/mcontent-search.graphqls` documents
109
- `uibundleIds` as _"Each UI bundle ID is resolved to its associated Managed
110
- Content channel(s)"_; the resolver
111
- `mcontent-impl/.../ManagedContentGraphQLSearchServiceImpl.resolveChannelIdsFromSitesAndUiBundles()`
112
- resolves each id via `getManagedContentChannelsByTarget(uibundleId)` (the id
113
- is the channel's **TargetEntityId**, i.e. a UIBundle record id); the UDD
114
- `lwr-udd/.../UIBundle.entity.xml` sets `keyPrefix="9YE"`; and the unit test
115
- `ManagedContentGraphQLSearchServiceImplTest.testUiBundleId_resolvesToChannelIds_andIsSearched()`
116
- passes a `9YE…` id into `uibundleIds` and asserts it resolves (W-23364628).
117
- `channelIds` values are validated as channel/site ids and never run through
118
- the target-entity resolver, so a `9YE` id sent there fails with
119
- `"9YE… isn't a valid managed content channel ID or a site ID"` — the exact
120
- error this wiring fixes. (Server-side, resolution of `uibundleIds`/`siteIds`
121
- is gated by the core feature flag `isAllowTargetEntityIdsEnabled()`.)
122
- - **Content-type discovery:** after the first CMS result returns,
123
- `adapters/cms/channelResolver.ts::resolveChannelId()` extracts the `0ap`
124
- managed-content-channel id from
125
- `nodes[0].managedContentChannelDeliveryDetails[0].managedContentChannelDetails.id`.
126
- `adapters/cms/hooks/useSearchableContentTypes.ts` (session-cached) then
127
- fetches `GET /connect/cms/channels/{channelId}/searchable-content-types` to
128
- populate the scope dropdown's per-content-type entries. Note: this `0ap` id
129
- is a _different_ id space from the `9YE` UIBundle id above — don't confuse
130
- the two when debugging.
131
- - **Seeding content:** the resolved `bundleId` only surfaces content published
132
- to the UIBundle's own channel (WebApp type), so CMS content must be published
133
- there — not to the Experience Site COMMUNITY channel. Content published to
134
- the wrong channel returns zero results even when the id/gate/query wiring is
135
- correct, so empty CMS results with everything else in place usually points at
136
- the publishing target rather than the code.
137
- - **Mounting:** add a `{ "kind": "cms", "key": "...", "label": "..." }` entry
138
- to `config.sources` (in `config.json`, or a custom `SearchConfig` object at
139
- runtime), then render `<Search config={config} />` somewhere routed — see
140
- the next section.
141
-
142
- ## 5. Mounting `<Search>` — the routing caveat
143
-
144
- - `GlobalSearchBox` (`components/GlobalSearchBox.tsx`) is a **pure
145
- launcher** — a text input + button that calls `navigate('/search?q=...')`
146
- on submit. **It renders no results itself.**
147
- - **`GlobalSearchBox` only routes to `/search`; you must mount `<Search>` at
148
- that route for results to render.** In this template, `routes.tsx` does
149
- exactly that: `path: "search"` renders `<GlobalSearch config={config} .../>`
150
- (`GlobalSearch` is `Search` aliased on import). If an app drops in
151
- `GlobalSearchBox` without also mounting `<Search>` (or a custom results UI
152
- built on `useSearch`) at the route it navigates to, searches will appear to
153
- do nothing.
154
- - `<Search>` itself (`components/Search.tsx`) is the batteries-included
155
- drop-in. For narrower customizations (e.g. a single-object search page),
156
- see its prop JSDoc for `restrictTo` (lock to one source), `renderResult` /
157
- `renderFilters` (per-source overrides), and `showScopeSelector`.
158
-
159
- ## 6. Adding a detail page (object detail / CMS content detail)
160
-
161
- **By default, result cards are NOT clickable** — the feature renders each row as
162
- plain (non-linked) text (see the final `return <div>…` branch in
163
- `DefaultResultRow.tsx` / `CmsResultRow.tsx`). Making a card clickable is a
164
- two-part change, and **both parts are required** — one without the other either
165
- does nothing or 404s:
166
-
167
- 1. **In this feature** (`config.json`): give the source a `routePattern`. This is
168
- the _only_ thing that turns the row into a `<Link>`. Without it the row stays
169
- non-clickable no matter what routes the app defines.
170
- 2. **In the app** (`src/routes.tsx`): the detail page must actually exist and be
171
- registered at a matching dynamic route. The feature only builds the href
172
- (e.g. `/accounts/001…`); it does not own any route. If that route isn't in the
173
- app's `routes.tsx`, the (now-clickable) card navigates to a dead URL and 404s.
174
-
175
- So: `routePattern` present **and** a matching detail route/page in the app →
176
- clickable card that opens a detail page. `routePattern` absent → non-clickable
177
- card (the default). `routePattern` present but no app route → clickable card that
178
- 404s.
179
-
180
- - **How the link is built:** `routePattern` is a path template with `:token`
181
- placeholders resolved per result.
182
- - **sObject rows** (`components/results/DefaultResultRow.tsx`,
183
- `resolveRoute(routePattern, node, idField)`): `:fieldName` tokens are
184
- substituted from the record's field values, and a bare `:id` maps to the
185
- source's `idField` (default `Id`). The shipped `accounts` source uses
186
- `"/accounts/:id"`.
187
- - **CMS rows** (`components/results/CmsResultRow.tsx`): tokens are `:id`
188
- (the `managedContentId`) and `:key`; when no `routePattern` is set it falls
189
- back to `/content/:contentType/:id`.
190
- - **Authoring the app-side route + page** (part 2 above): register the matching
191
- dynamic route in the app's `routes.tsx` (e.g. `path: "accounts/:id"` /
192
- `path: "content/:contentType/:id"`). That route's component reads the route
193
- param (`useParams`) and fetches the single record/content item — sObject
194
- detail: fetch the one record by id via the platform data SDK (see the
195
- `experience-ui-bundle-salesforce-data-access` skill — do not hand-roll
196
- `fetch`); CMS detail: fetch the content item by `managedContentId` through the
197
- CMS delivery API.
198
- - **Generating the page:** whichever kind of detail page you need, nothing inside
199
- this search feature changes beyond setting `routePattern` — the page and route
200
- live in the app, not in this directory. Pick the skill by source type:
201
- - **sObject object-detail page** — a normal routed page; generate it with the
202
- `experience-ui-bundle-frontend-generate` skill (its page types include "detail
203
- view"; record data is fetched via the platform Data SDK per the
204
- `experience-ui-bundle-salesforce-data-access` skill).
205
- - **CMS content-detail page** — generate it with the
206
- `experience-cms-content-render` skill. That skill owns CMS content _fetch +
207
- render_ (the delivery API, `contentKey`/`contentType`, RichText, and image
208
- resolution) and **takes precedence** over `experience-ui-bundle-frontend-generate`
209
- for the rendering portion — the UI skill owns only the page/layout shell. Its
210
- Detail Page branch writes `src/pages/<type>/<PageName>.tsx` and inserts the
211
- route, so the app gets both the page and the matching route wired for you. (It
212
- is scoped to _rendering existing_ content — use this search feature, not that
213
- skill, for the search itself.)
214
-
215
- ## 7. Config knobs reference
216
-
217
- | Knob | Values / notes |
218
- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
219
- | `pagination.mode` | `"per-source"` (default; one section per source) vs `"merged"` (one combined grid, single global pager) — `types.ts` |
220
- | `pagination.mergeOrder` | `"sequential" \| "interleaved" \| "proportional"` — merged mode only |
221
- | `pagination.pageSize` / `pageSizeOptions` | shared across every source, every scope |
222
- | Per-sobject-source | `objectName`, `label`/`labelSingular`, `idField`, `routePattern`, `searchableFields`, `displayFields` (`string \| {name,raw} \| {name,subfields}`), `filterBy`, `sortBy`, `defaultSort`, `whereTypeName`/`orderByTypeName` |
223
- | Per-cms-source | `key`, `label`, `labelSingular?`, `routePattern?` — nothing else, by design |
224
- | `MIN_QUERY_LENGTH` | `constants.ts`, currently `3`. Both backends reject shorter terms server-side; gated client-side in `useSearch.ts` and `GlobalSearchBox.tsx` so the UI never shows a spurious failure for a too-short query |
225
-
226
- ## 8. Public API pointers
227
-
228
- Import from the barrel (`index.ts`) rather than reaching into internals. The
229
- main extension points, grouped by concern:
230
-
231
- - **Core (both source types):** `useSearch` — the hook (state, fetch,
232
- pagination) behind `<Search>`; `runSearch` — the underlying fetch;
233
- `buildSearchQuery` — assembles the query payload; `getAdapter` — resolves a
234
- source `kind` to its adapter; `config` — the loaded `SearchConfig`.
235
- - **sObject sources:** `useDistinctValues` / `fetchDistinctValues` — picklist
236
- filter values; `buildOrderBy` — sort clause construction; the filter inputs
237
- (`TextFilter`, `SelectFilter`, `MultiSelectFilter`, `NumericRangeFilter`,
238
- `BooleanFilter`, `DateRangeFilter`) and `DefaultResultRow` for rendering.
239
- - **CMS source:** `cmsAdapter`; `useSearchableContentTypes` — content-type
240
- discovery; `isValidCmsFqn` / `formatContentTypeLabel` — content-type FQN
241
- helpers; `CmsResultRow` for rendering.
242
- - **Types:** `SearchConfig`, `SourceConfig`, `SObjectSourceConfig`,
243
- `CmsSourceConfig`, `SourceAdapter`, `SearchHandle`, and related runtime types.
244
-
245
- See `index.ts` for the full exported surface (all components, filter inputs,
246
- utils) — this list is intentionally short.