@algolia/wizard 0.84.0-rc.202.651 → 0.84.0-rc.202.653
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/main.js
CHANGED
|
@@ -2315,7 +2315,7 @@ async function ensureApplication(resumeAppId) {
|
|
|
2315
2315
|
// package.json
|
|
2316
2316
|
var package_default = {
|
|
2317
2317
|
name: "@algolia/wizard",
|
|
2318
|
-
version: "0.84.0-rc.202.
|
|
2318
|
+
version: "0.84.0-rc.202.653",
|
|
2319
2319
|
description: "Magically implement Algolia functionality in your codebase",
|
|
2320
2320
|
type: "module",
|
|
2321
2321
|
engines: {
|
|
@@ -6321,7 +6321,10 @@ function ingestionInstructions(input) {
|
|
|
6321
6321
|
"Write the script in the project's primary language, using Algolia's official client for that language. Do not use the raw HTTP API.",
|
|
6322
6322
|
"After a successful ingest, the script must print exactly one line to stdout in the form `ALGOLIA_WIZARD_RECORD_COUNT=<n>`, where <n> is the total number of records pushed to Algolia. Print it last, on its own line, with no surrounding text.",
|
|
6323
6323
|
recordSizeInstruction(input.appPlan),
|
|
6324
|
-
"When you split one source item into several records, keep the fields that the search UI shows (title, description, URL parts) on every record. After you push
|
|
6324
|
+
"When you split one source item into several records, keep the fields that the search UI shows (title, description, URL parts) on every record. After you push those split records, the script must set the index settings with attributeForDistinct set to the parent identifier and distinct set to true, so that a search returns each source item once.",
|
|
6325
|
+
"After you push the records, set searchableAttributes to the primary text fields the UI will search and show. For any longer text field the UI may snippet (description, body, content), set attributesToSnippet (for example description:20). Without attributesToSnippet, Algolia returns no _snippetResult and Snippet helpers render blank.",
|
|
6326
|
+
"Store plain text in fields the UI shows or snippets. Strip Markdown, HTML, and similar markup at index time (or index a separate plain-text field) so result rows do not show raw ###, backticks, or tags.",
|
|
6327
|
+
"URL and slug fields used to build result links must resolve to real routes in this app. Do not invent ids or prefixes that the app does not serve.",
|
|
6325
6328
|
...algoliaClientDoc(input),
|
|
6326
6329
|
"Install the Algolia client with the project's own package manager via runShell, declaring it in whatever manifest the project uses (e.g. package.json, requirements.txt, Gemfile, go.mod, composer.json) so the dependency is not just installed ad hoc.",
|
|
6327
6330
|
`If the script loads its env vars from a file (e.g. via dotenv or an equivalent for its language) rather than the process environment directly, decide that up front and call writeCredentials on that file before you finish the script \u2014 do not wait to discover the need for it by having a writeFile call refused.`,
|
|
@@ -6366,6 +6369,7 @@ function searchInstructions(input) {
|
|
|
6366
6369
|
indexedContentMessage ?? "",
|
|
6367
6370
|
`Build the search UI for ${input.searchUiTarget}.`,
|
|
6368
6371
|
"Create search UI only. Do not create or modify ingestion scripts, rake/manage/CLI tasks, migrations, seeders, or other data-loading code, even if the data looks incomplete.",
|
|
6372
|
+
"Prefer Highlight (or the plain attribute) for titles and short fields. Use Snippet only for longer text, and only when attributesToSnippet is set for that attribute \u2014 via the index searchParameters (for example attributesToSnippet: ['body:20']) or index settings. Without it, _snippetResult is missing and the result panel looks empty even though search returns hits.",
|
|
6369
6373
|
FILE_EDIT_INSTRUCTION,
|
|
6370
6374
|
EXISTING_COMPONENT_INSTRUCTION,
|
|
6371
6375
|
mountCandidateMessage,
|
|
@@ -6461,7 +6465,7 @@ function validationInstructions(input) {
|
|
|
6461
6465
|
`The confirmed placement candidate was "${input.searchLocation ?? "unknown"}", but verify the actual mount rather than assuming the candidate was used.`,
|
|
6462
6466
|
"Inspect the generated search component, its actual mount file, that file's parent layout and sibling controls, and the relevant content UI. Do not rely only on type checks or tests.",
|
|
6463
6467
|
"Confirm that the application renders exactly one search bar. Check for an old search bar and duplicate mounts.",
|
|
6464
|
-
"If the project sets a Content-Security-Policy, confirm that connect-src allows https://*.algolia.net, https://*.algolianet.com, and https://insights.algolia.io, and that search-insights is loaded from npm.
|
|
6468
|
+
"If the project sets a Content-Security-Policy, confirm that connect-src allows https://*.algolia.net, https://*.algolianet.com, and https://insights.algolia.io, and that search-insights is loaded from npm (not a CDN). If a CSP exists and fails either check, set sufficient=false. If the project has no CSP, skip both checks: do not set sufficient=false, and do not ask to add a CSP.",
|
|
6465
6469
|
"Confirm content-specific search is placed with the corresponding content or task controls. Shared navigation is valid only for genuinely app-wide search that fits the visual hierarchy and responsive layout without crowding primary actions.",
|
|
6466
6470
|
"Confirm the input has a persistent accessible name; widget-provided combobox, popup, and item relationships and keyboard behavior are preserved; and loading, empty, and error status text is perceivable to assistive technology.",
|
|
6467
6471
|
"Inspect the CSS that actually applies to the generated DOM. Confirm the results panel and the element drawing the input frame have non-transparent surfaces, the input frame is distinguishable from its surrounding background in every supported theme, text meets 4.5:1 contrast, meaningful boundaries and focus indicators meet 3:1, and no state relies on color alone.",
|
|
@@ -9370,7 +9374,7 @@ async function resetProjectState() {
|
|
|
9370
9374
|
// package.json with { type: 'json' }
|
|
9371
9375
|
var package_default2 = {
|
|
9372
9376
|
name: "@algolia/wizard",
|
|
9373
|
-
version: "0.84.0-rc.202.
|
|
9377
|
+
version: "0.84.0-rc.202.653",
|
|
9374
9378
|
description: "Magically implement Algolia functionality in your codebase",
|
|
9375
9379
|
type: "module",
|
|
9376
9380
|
engines: {
|
|
@@ -76,6 +76,17 @@ search.start()
|
|
|
76
76
|
|
|
77
77
|
Ensure the attributes you map into the component match the entity. 'title' above is an example.
|
|
78
78
|
|
|
79
|
+
### Highlight vs Snippet
|
|
80
|
+
|
|
81
|
+
- Prefer `components.Highlight` (or the plain attribute) for titles and other short
|
|
82
|
+
fields. Highlight uses `_highlightResult`, which Algolia returns by default.
|
|
83
|
+
- Use `components.Snippet` only for longer text. Snippet reads `_snippetResult`,
|
|
84
|
+
which is **empty unless** `attributesToSnippet` is set. Without it, the result
|
|
85
|
+
row renders blank while search still returns hits.
|
|
86
|
+
- When you use Snippet, set `attributesToSnippet` on that index's
|
|
87
|
+
`searchParameters` (for example `['body:20']`), or as an index setting. Do both
|
|
88
|
+
for the same attribute names the template passes to Snippet.
|
|
89
|
+
|
|
79
90
|
### Navigation is `getURL`'s job, not the template's
|
|
80
91
|
|
|
81
92
|
- `indices[].getURL` — `(item) => string`, a route that already exists; don't invent one.
|
|
@@ -68,6 +68,17 @@ export function Search() {
|
|
|
68
68
|
|
|
69
69
|
Ensure the attributes you map into the component match the entity. 'title' above is an example.
|
|
70
70
|
|
|
71
|
+
### Highlight vs Snippet
|
|
72
|
+
|
|
73
|
+
- Prefer plain attributes or `<Highlight>` for titles and other short fields.
|
|
74
|
+
Highlight uses `_highlightResult`, which Algolia returns by default.
|
|
75
|
+
- Use `<Snippet>` only for longer text. Snippet reads `_snippetResult`, which is
|
|
76
|
+
**empty unless** `attributesToSnippet` is set. Without it, the result row
|
|
77
|
+
renders blank while search still returns hits.
|
|
78
|
+
- When you use Snippet, set `attributesToSnippet` on that index's
|
|
79
|
+
`searchParameters` (for example `['body:20']`), or as an index setting. Do both
|
|
80
|
+
for the same attribute names the component passes to Snippet.
|
|
81
|
+
|
|
71
82
|
### Navigation is `getURL`'s job, not the item component's
|
|
72
83
|
|
|
73
84
|
- `indices[].getURL` — `(item) => string`, a route that already exists; don't invent one.
|
|
@@ -154,6 +154,17 @@ function onFocusOut(event) {
|
|
|
154
154
|
Adapt the label, placeholder, highlighted attributes, result content, and destination to
|
|
155
155
|
the confirmed indexed entity. `products` and `name` above are examples.
|
|
156
156
|
|
|
157
|
+
### Highlight vs Snippet
|
|
158
|
+
|
|
159
|
+
- Prefer `ais-highlight` (or the plain attribute) for titles and other short fields.
|
|
160
|
+
Highlight uses `_highlightResult`, which Algolia returns by default.
|
|
161
|
+
- Use `ais-snippet` only for longer text. Snippet reads `_snippetResult`, which is
|
|
162
|
+
**empty unless** `attributesToSnippet` is set. Without it, the result row
|
|
163
|
+
renders blank while search still returns hits.
|
|
164
|
+
- When you use Snippet, set `attributesToSnippet` via `ais-configure` or that
|
|
165
|
+
index's search parameters (for example `['body:20']`), or as an index setting.
|
|
166
|
+
Do both for the same attribute names the template passes to the snippet.
|
|
167
|
+
|
|
157
168
|
Details that break accessibility if changed:
|
|
158
169
|
|
|
159
170
|
- `role="combobox"` on the `input`, not a wrapper — with `aria-controls` at the popup's
|