@stapel/search-react 0.21.0 → 0.23.0
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/CHANGELOG.md +141 -0
- package/MODULE.md +12 -0
- package/README.md +143 -2
- package/dist/api/types.d.ts +37 -3
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/types.js.map +1 -1
- package/dist/default/FacetGroupControl.d.ts +53 -5
- package/dist/default/FacetGroupControl.d.ts.map +1 -1
- package/dist/default/FacetGroupControl.js +189 -8
- package/dist/default/FacetGroupControl.js.map +1 -1
- package/dist/default/FacetPanelPane.d.ts +41 -0
- package/dist/default/FacetPanelPane.d.ts.map +1 -1
- package/dist/default/FacetPanelPane.js +72 -18
- package/dist/default/FacetPanelPane.js.map +1 -1
- package/dist/default/FilterChips.d.ts.map +1 -1
- package/dist/default/FilterChips.js +2 -2
- package/dist/default/FilterChips.js.map +1 -1
- package/dist/default/PartitionChips.d.ts +37 -0
- package/dist/default/PartitionChips.d.ts.map +1 -0
- package/dist/default/PartitionChips.js +120 -0
- package/dist/default/PartitionChips.js.map +1 -0
- package/dist/default/PopularValues.d.ts +58 -0
- package/dist/default/PopularValues.d.ts.map +1 -0
- package/dist/default/PopularValues.js +46 -0
- package/dist/default/PopularValues.js.map +1 -0
- package/dist/default/RangeFilterRow.d.ts.map +1 -1
- package/dist/default/RangeFilterRow.js +65 -11
- package/dist/default/RangeFilterRow.js.map +1 -1
- package/dist/default/SearchPage.d.ts +49 -0
- package/dist/default/SearchPage.d.ts.map +1 -1
- package/dist/default/SearchPage.js +43 -2
- package/dist/default/SearchPage.js.map +1 -1
- package/dist/default/index.d.ts +7 -3
- package/dist/default/index.d.ts.map +1 -1
- package/dist/default/index.js +8 -3
- package/dist/default/index.js.map +1 -1
- package/dist/headless/useFacetLabels.js +7 -7
- package/dist/headless/useFacetLabels.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +9 -0
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/keys.d.ts +52 -0
- package/dist/i18n/keys.d.ts.map +1 -1
- package/dist/i18n/keys.js +62 -0
- package/dist/i18n/keys.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +9 -0
- package/dist/i18n/ru.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/state/facets.d.ts +90 -6
- package/dist/state/facets.d.ts.map +1 -1
- package/dist/state/facets.js +216 -15
- package/dist/state/facets.js.map +1 -1
- package/dist/state/ranges.d.ts +22 -0
- package/dist/state/ranges.d.ts.map +1 -1
- package/dist/state/ranges.js +30 -0
- package/dist/state/ranges.js.map +1 -1
- package/dist/state/translit.d.ts +58 -0
- package/dist/state/translit.d.ts.map +1 -0
- package/dist/state/translit.js +115 -0
- package/dist/state/translit.js.map +1 -0
- package/llms.txt +3 -1
- package/manifest.json +45 -1
- package/nav-manifest.json +1 -1
- package/package.json +8 -8
- package/src/analytics/generated/events.json +1 -1
- package/src/api/types.ts +42 -3
- package/src/default/FacetGroupControl.tsx +339 -9
- package/src/default/FacetPanelPane.tsx +131 -19
- package/src/default/FilterChips.tsx +5 -2
- package/src/default/PartitionChips.tsx +204 -0
- package/src/default/PopularValues.tsx +151 -0
- package/src/default/RangeFilterRow.tsx +116 -1
- package/src/default/SearchPage.tsx +61 -2
- package/src/default/index.ts +27 -2
- package/src/headless/useFacetLabels.ts +7 -7
- package/src/i18n/es.ts +9 -0
- package/src/i18n/keys.ts +63 -0
- package/src/i18n/ru.ts +9 -0
- package/src/index.ts +13 -0
- package/src/state/facets.ts +259 -27
- package/src/state/ranges.ts +44 -0
- package/src/state/translit.ts +113 -0
package/dist/index.js
CHANGED
|
@@ -45,8 +45,9 @@ export { SEARCH_SORTS, SUGGEST_DEGRADED_CATEGORIES, SUGGEST_DEGRADED_ROLLUP, sug
|
|
|
45
45
|
// ── state (pure: no React, no router) ────────────────────────────────────────
|
|
46
46
|
export { FILTER_PREFIX, RANGE_PREFIX, SEARCH_PARAM, activeFilterCount, clearFilters, ownsParam, parseSearchState, patchSearchState, setFilterValues, setRangeValue, toggleFilterValue, writeSearchState, } from "./state/urlState.js";
|
|
47
47
|
export { FACET_PLAN_EVIDENCE, countIsEstimate, countKind, degradationAudience, degradationMessageKey, isCountNuanceOnly, parseDegradations, readerFacing, } from "./state/degradations.js";
|
|
48
|
-
export { FACETABLE_FEATURE_TYPES, buildFacetGroups, facetOptionLabel, isFacetableFeature, } from "./state/facets.js";
|
|
49
|
-
export {
|
|
48
|
+
export { FACETABLE_FEATURE_TYPES, buildFacetGroups, facetGroupHasEvidence, facetGroupIsDrawable, facetOptionLabel, isFacetableFeature, orderFacetGroupsBySchema, } from "./state/facets.js";
|
|
49
|
+
export { consonantKey, translitKey, translitPrefixMatch, } from "./state/translit.js";
|
|
50
|
+
export { RANGE_FEATURE_TYPES, RANGE_PICKER_MAX_VALUES, buildRangeGroups, coreRangeLabelKey, isRangeFeature, isRangeUsable, } from "./state/ranges.js";
|
|
50
51
|
export { SEARCH_BOX_DEBOUNCE_MS, SEARCH_BOX_SUGGEST_DEBOUNCE_MS, SEARCH_COUNT_DEBOUNCE_MS, SEARCH_COUNT_PAGE_SIZE, SEARCH_DEFAULT_PAGE_SIZE, SEARCH_MAX_PAGE_SIZE, SEARCH_QUERY_MAX_CHARS, SUGGEST_MAX_LIMIT, SUGGEST_MIN_CHARS, } from "./state/limits.js";
|
|
51
52
|
// ── model (runtime wiring, query keys, context, hooks) ───────────────────────
|
|
52
53
|
export { createSearchRuntime } from "./model/runtime.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,gFAAgF;AAChF,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAGxE,OAAO,EACL,YAAY,EACZ,2BAA2B,EAC3B,uBAAuB,EACvB,YAAY,GACb,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,gFAAgF;AAChF,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAGxE,OAAO,EACL,YAAY,EACZ,2BAA2B,EAC3B,uBAAuB,EACvB,YAAY,GACb,MAAM,gBAAgB,CAAC;AA0BxB,gFAAgF;AAChF,OAAO,EACL,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAS7B,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,GACb,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EACL,YAAY,EACZ,WAAW,EACX,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,aAAa,GACd,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,sBAAsB,EACtB,8BAA8B,EAC9B,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB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HANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import type { FeatureDef } from "@stapel/attributes-react";
|
|
2
|
-
import type { FacetMeta, SearchQueryState } from "../api/types.js";
|
|
2
|
+
import type { FacetLabelsMap, FacetMeta, SearchQueryState } from "../api/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Where a caption came from — the group's heading and every option carry it,
|
|
5
|
+
* because "did anybody actually name this?" is a question two surfaces have
|
|
6
|
+
* to answer and neither can answer by looking at the string.
|
|
7
|
+
*
|
|
8
|
+
* `"none"` is the honest bottom: the raw slug for a heading, the raw index
|
|
9
|
+
* term for an option. It is not a label, it is what is printed when there is
|
|
10
|
+
* none, and it is the one value a storefront's own test asserts against.
|
|
11
|
+
*/
|
|
12
|
+
export type FacetLabelSource = "server" | "schema" | "host" | "none";
|
|
3
13
|
/**
|
|
4
14
|
* Value types whose values are a BOUNDED OPTION SET — the only kind of
|
|
5
15
|
* feature a person can be offered as a filter.
|
|
@@ -42,13 +52,21 @@ export interface FacetOption {
|
|
|
42
52
|
readonly count: number | null;
|
|
43
53
|
/** Resolved through the category schema; the raw value when there is none. */
|
|
44
54
|
readonly label: string;
|
|
55
|
+
/** Which of the three sources named it — `"none"` means {@link label} IS
|
|
56
|
+
* the raw index term. The host seam reads this rather than comparing the
|
|
57
|
+
* two strings. */
|
|
58
|
+
readonly labelSource: FacetLabelSource;
|
|
45
59
|
readonly selected: boolean;
|
|
46
60
|
}
|
|
47
61
|
/** One facet slug, with its options. */
|
|
48
62
|
export interface FacetGroup {
|
|
49
63
|
readonly slug: string;
|
|
50
|
-
/** The
|
|
64
|
+
/** The group's heading: the answer's own `label`, else the feature's
|
|
65
|
+
* display name, else — with a dev warning — the raw slug. */
|
|
51
66
|
readonly label: string;
|
|
67
|
+
/** Which source named the heading. `"none"` is the slug standing in for a
|
|
68
|
+
* name nobody has; a surface marks it so a storefront test can fail on it. */
|
|
69
|
+
readonly labelSource: FacetLabelSource;
|
|
52
70
|
/** The category-schema entry behind the slug, when the host supplied one. */
|
|
53
71
|
readonly feature: FeatureDef | undefined;
|
|
54
72
|
/** `false` when the server skipped this slug — counts are `null`. */
|
|
@@ -89,6 +107,70 @@ export declare function facetCoverage(group: FacetGroup): number;
|
|
|
89
107
|
export declare function compareFacetsByEvidence(a: FacetGroup, b: FacetGroup): number;
|
|
90
108
|
/** {@link compareFacetsByEvidence}, applied. Never mutates the input. */
|
|
91
109
|
export declare function orderFacetGroups(groups: readonly FacetGroup[]): readonly FacetGroup[];
|
|
110
|
+
/**
|
|
111
|
+
* Does the ANSWER have evidence for this axis — at least one value some
|
|
112
|
+
* candidate actually carries?
|
|
113
|
+
*
|
|
114
|
+
* The one fact that outranks every other rule in this module. A bucket with a
|
|
115
|
+
* count above zero is the server saying "documents in this result set have
|
|
116
|
+
* this value", and no schema opinion, no missing feature list and no type
|
|
117
|
+
* table may take an axis like that off the screen.
|
|
118
|
+
*/
|
|
119
|
+
export declare function facetGroupHasEvidence(group: FacetGroup): boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Is there anything for a surface to DRAW here?
|
|
122
|
+
*
|
|
123
|
+
* Shared by the rail and the chip row, which each used to hold their own
|
|
124
|
+
* `options.length > 0` — one predicate, or the two surfaces drift into two
|
|
125
|
+
* opinions about what an empty group is.
|
|
126
|
+
*
|
|
127
|
+
* A group with no options is a heading over nothing: after
|
|
128
|
+
* {@link buildFacetGroups} learned to read the schema, what is left in that
|
|
129
|
+
* state is a `ref_select` whose config is a bare `optionsRef` pointer and
|
|
130
|
+
* which the server did not count — nothing to enumerate from either side. It
|
|
131
|
+
* is not drawn, and in development it is NAMED: a required axis (the make on
|
|
132
|
+
* cars leaf) disappearing out of a rail is exactly the fault this pair spent
|
|
133
|
+
* a release chasing, and it must not disappear silently a second time.
|
|
134
|
+
*
|
|
135
|
+
* A group the reader has already FILTERED on is drawn whatever its options
|
|
136
|
+
* say — a constraint with no control to remove it is worse than a bare
|
|
137
|
+
* heading.
|
|
138
|
+
*/
|
|
139
|
+
export declare function facetGroupIsDrawable(group: FacetGroup): boolean;
|
|
140
|
+
/**
|
|
141
|
+
* The order the RAIL puts groups in: the category's own schema order, with
|
|
142
|
+
* the axes the schema calls required in front of it.
|
|
143
|
+
*
|
|
144
|
+
* Evidence order ({@link compareFacetsByEvidence}) answers "which axis does
|
|
145
|
+
* this corpus fill in", which is the right question for a chip row that has
|
|
146
|
+
* room for four. It is the wrong question for a rail: on a cars leaf with
|
|
147
|
+
* three listings the busiest axis is whichever three values happen to be
|
|
148
|
+
* counted, so the rail opened on condition and colour while make, model and
|
|
149
|
+
* year — the three fields the schema marks
|
|
150
|
+
* `mandatory`, i.e. the three every seller had to fill and every buyer
|
|
151
|
+
* narrows by first — sat below them or off the fold entirely.
|
|
152
|
+
*
|
|
153
|
+
* So: the schema's own order, which is the order the composer asks the
|
|
154
|
+
* seller to fill the form in, with required first. Four bands:
|
|
155
|
+
*
|
|
156
|
+
* 1. `pinned` slugs, in the order given — the axis a page has already
|
|
157
|
+
* decided is its subject (a partition's own field).
|
|
158
|
+
* 2. schema-required (`mandatory: true`), in schema order.
|
|
159
|
+
* 3. everything else the schema names, in schema order.
|
|
160
|
+
* 4. what the schema does not name at all — including EVERY group when the
|
|
161
|
+
* host passed no feature list, which is the live parent-node case — in
|
|
162
|
+
* evidence order, because with no schema there is no other order to have.
|
|
163
|
+
*
|
|
164
|
+
* Stable: within a band the comparator falls through to evidence and then to
|
|
165
|
+
* the order `buildFacetGroups` gave, so equal-ranked groups never reshuffle.
|
|
166
|
+
*/
|
|
167
|
+
export declare function orderFacetGroupsBySchema(input: {
|
|
168
|
+
readonly groups: readonly FacetGroup[];
|
|
169
|
+
/** The category schema, in the order the category declares it. */
|
|
170
|
+
readonly categoryFeatures?: readonly FeatureDef[];
|
|
171
|
+
/** Slugs pinned above everything, in the order given. */
|
|
172
|
+
readonly pinned?: readonly string[];
|
|
173
|
+
}): readonly FacetGroup[];
|
|
92
174
|
export interface BuildFacetGroupsInput {
|
|
93
175
|
/** The envelope's `facets`: `{slug: {value: count}}`. */
|
|
94
176
|
readonly facets: Readonly<Record<string, Readonly<Record<string, number>>>>;
|
|
@@ -113,15 +195,17 @@ export interface BuildFacetGroupsInput {
|
|
|
113
195
|
* `apple` or `chernyy`. The server read that vocabulary against the
|
|
114
196
|
* snapshot the documents were written with.
|
|
115
197
|
*
|
|
198
|
+
* Each entry also carries the GROUP's own `label` — the heading, resolved
|
|
199
|
+
* from the feature definition server-side and localized like everything
|
|
200
|
+
* else. It leads for the same two reasons, and it is what a category whose
|
|
201
|
+
* host passed no feature list has instead of a rail full of index slugs.
|
|
202
|
+
*
|
|
116
203
|
* ABSENT on a server older than 0.4.0 — absent, not empty — which is why
|
|
117
204
|
* every read of it here is optional-chained and every option falls through
|
|
118
205
|
* to the schema and then to its raw self. No labels are invented at any
|
|
119
206
|
* step.
|
|
120
207
|
*/
|
|
121
|
-
readonly facetLabels?:
|
|
122
|
-
readonly translatable: boolean;
|
|
123
|
-
readonly values: Readonly<Record<string, string>>;
|
|
124
|
-
}>>;
|
|
208
|
+
readonly facetLabels?: FacetLabelsMap;
|
|
125
209
|
/** Translator for label keys. */
|
|
126
210
|
readonly t?: (key: string) => string;
|
|
127
211
|
/** BCP-47 tag, forwarded to `formatFeatureValue` for `date` options. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facets.d.ts","sourceRoot":"","sources":["../../src/state/facets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"facets.d.ts","sourceRoot":"","sources":["../../src/state/facets.ts"],"names":[],"mappings":"AA0DA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnF;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAoErE;;;;;;;;;;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EAAE,UAAU,GAAG,SAAS,EAC/B,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3E,MAAM,CAkCR;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,SAAS,UAAU,EAAE,CA4GpF"}
|
package/dist/state/facets.js
CHANGED
|
@@ -8,9 +8,12 @@
|
|
|
8
8
|
* they would have if you swapped to them. A panel that greys the siblings
|
|
9
9
|
* out has silently converted a drill-down facet into a naive one, and the
|
|
10
10
|
* e2e leg in the spec (§7.2) exists to catch exactly that.
|
|
11
|
-
* 2. **
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* 2. **LABELS have one stated order: ANSWER, then schema, then the raw
|
|
12
|
+
* term** — for the group's heading and for every option alike, with a host
|
|
13
|
+
* resolver between the last two for options, applied by
|
|
14
|
+
* `useHostFacetLabels` on what this module could not name. The bottom of
|
|
15
|
+
* that order is not a label and is marked as such: `labelSource: "none"`,
|
|
16
|
+
* a warning in development, and a data attribute on the drawn group.
|
|
14
17
|
*
|
|
15
18
|
* The answer leads because it is the only source that always exists and
|
|
16
19
|
* the only one that has RESOLVED anything: `categoryFeatures` is an
|
|
@@ -47,7 +50,65 @@
|
|
|
47
50
|
* chipped is therefore decided from the category's own feature defs, by
|
|
48
51
|
* value TYPE (see {@link FACETABLE_FEATURE_TYPES}), not by what came back.
|
|
49
52
|
*/
|
|
50
|
-
import { VOCABULARY_BACKED_TYPES, featureConfig,
|
|
53
|
+
import { VOCABULARY_BACKED_TYPES, featureConfig, featureType, formatFeatureValue, } from "@stapel/attributes-react";
|
|
54
|
+
/** Slugs already complained about — one warning per slug per page load, not
|
|
55
|
+
* one per render. */
|
|
56
|
+
const warnedSlugs = new Set();
|
|
57
|
+
/**
|
|
58
|
+
* A heading nobody named, said once, in development only.
|
|
59
|
+
*
|
|
60
|
+
* A raw slug in a filter panel is a wiring fault — the category has no
|
|
61
|
+
* feature definition for the slug and the server sent no label — and it is
|
|
62
|
+
* invisible to everyone but the buyer who meets it. The group still renders,
|
|
63
|
+
* because a heading a person cannot read still beats options with no heading
|
|
64
|
+
* at all; `FacetGroup.labelSource` is how a surface marks it up for a test.
|
|
65
|
+
*/
|
|
66
|
+
function warnUnnamedGroup(slug) {
|
|
67
|
+
const env = typeof process === "undefined" ? undefined : process.env;
|
|
68
|
+
if (env?.NODE_ENV === "production")
|
|
69
|
+
return;
|
|
70
|
+
if (warnedSlugs.has(slug))
|
|
71
|
+
return;
|
|
72
|
+
warnedSlugs.add(slug);
|
|
73
|
+
console.warn(`[search-react] facet group "${slug}" has no label: the answer sent none ` +
|
|
74
|
+
`and no category feature defines it, so the heading is the raw slug.`);
|
|
75
|
+
}
|
|
76
|
+
/** Slugs already reported as undrawable — one warning per slug per page. */
|
|
77
|
+
const warnedUndrawable = new Set();
|
|
78
|
+
/**
|
|
79
|
+
* An axis that reached the panel with nothing to draw, said once, in
|
|
80
|
+
* development only.
|
|
81
|
+
*
|
|
82
|
+
* Measured on a live classified's cars branch: `make_ref_select`,
|
|
83
|
+
* `model` and `generation` are `ref_select` features whose config is a bare
|
|
84
|
+
* `optionsRef` pointer into a vocabulary — there is no option table in the
|
|
85
|
+
* schema and there never will be — so whenever the server's facet plan does
|
|
86
|
+
* not COUNT them there is nothing on the client to enumerate, and the group
|
|
87
|
+
* left the rail without a word while every `select`-typed comfort option
|
|
88
|
+
* (steering side, power steering, heating) drew its schema table and stayed.
|
|
89
|
+
* buyer's report was "I cannot pick a make".
|
|
90
|
+
*
|
|
91
|
+
* The panel still refuses to draw a heading over nothing — that is the right
|
|
92
|
+
* call — but the disappearance is a WIRING FAULT with two possible owners
|
|
93
|
+
* (the server's plan skipped a required axis, or the host threaded the wrong
|
|
94
|
+
* category's schema), and neither of them can see it from the page.
|
|
95
|
+
*/
|
|
96
|
+
function warnUndrawableGroup(group) {
|
|
97
|
+
const env = typeof process === "undefined" ? undefined : process.env;
|
|
98
|
+
if (env?.NODE_ENV === "production")
|
|
99
|
+
return;
|
|
100
|
+
if (warnedUndrawable.has(group.slug))
|
|
101
|
+
return;
|
|
102
|
+
warnedUndrawable.add(group.slug);
|
|
103
|
+
console.warn(`[search-react] facet group "${group.slug}" has no values to draw: the ` +
|
|
104
|
+
`answer did not count it${group.feature === undefined
|
|
105
|
+
? " and the category schema passed to this page does not define it"
|
|
106
|
+
: " and its config carries a vocabulary pointer, not an option table"}, so the group is not rendered.` +
|
|
107
|
+
(group.feature?.mandatory === true
|
|
108
|
+
? " The schema marks this axis REQUIRED — a buyer cannot narrow by a" +
|
|
109
|
+
" field every seller had to fill."
|
|
110
|
+
: ""));
|
|
111
|
+
}
|
|
51
112
|
/**
|
|
52
113
|
* Value types whose values are a BOUNDED OPTION SET — the only kind of
|
|
53
114
|
* feature a person can be offered as a filter.
|
|
@@ -136,6 +197,101 @@ export function compareFacetsByEvidence(a, b) {
|
|
|
136
197
|
export function orderFacetGroups(groups) {
|
|
137
198
|
return [...groups].sort(compareFacetsByEvidence);
|
|
138
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Does the ANSWER have evidence for this axis — at least one value some
|
|
202
|
+
* candidate actually carries?
|
|
203
|
+
*
|
|
204
|
+
* The one fact that outranks every other rule in this module. A bucket with a
|
|
205
|
+
* count above zero is the server saying "documents in this result set have
|
|
206
|
+
* this value", and no schema opinion, no missing feature list and no type
|
|
207
|
+
* table may take an axis like that off the screen.
|
|
208
|
+
*/
|
|
209
|
+
export function facetGroupHasEvidence(group) {
|
|
210
|
+
return group.options.some((option) => (option.count ?? 0) > 0);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Is there anything for a surface to DRAW here?
|
|
214
|
+
*
|
|
215
|
+
* Shared by the rail and the chip row, which each used to hold their own
|
|
216
|
+
* `options.length > 0` — one predicate, or the two surfaces drift into two
|
|
217
|
+
* opinions about what an empty group is.
|
|
218
|
+
*
|
|
219
|
+
* A group with no options is a heading over nothing: after
|
|
220
|
+
* {@link buildFacetGroups} learned to read the schema, what is left in that
|
|
221
|
+
* state is a `ref_select` whose config is a bare `optionsRef` pointer and
|
|
222
|
+
* which the server did not count — nothing to enumerate from either side. It
|
|
223
|
+
* is not drawn, and in development it is NAMED: a required axis (the make on
|
|
224
|
+
* cars leaf) disappearing out of a rail is exactly the fault this pair spent
|
|
225
|
+
* a release chasing, and it must not disappear silently a second time.
|
|
226
|
+
*
|
|
227
|
+
* A group the reader has already FILTERED on is drawn whatever its options
|
|
228
|
+
* say — a constraint with no control to remove it is worse than a bare
|
|
229
|
+
* heading.
|
|
230
|
+
*/
|
|
231
|
+
export function facetGroupIsDrawable(group) {
|
|
232
|
+
if (group.selected.length > 0)
|
|
233
|
+
return true;
|
|
234
|
+
if (group.options.length > 0)
|
|
235
|
+
return true;
|
|
236
|
+
warnUndrawableGroup(group);
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* The order the RAIL puts groups in: the category's own schema order, with
|
|
241
|
+
* the axes the schema calls required in front of it.
|
|
242
|
+
*
|
|
243
|
+
* Evidence order ({@link compareFacetsByEvidence}) answers "which axis does
|
|
244
|
+
* this corpus fill in", which is the right question for a chip row that has
|
|
245
|
+
* room for four. It is the wrong question for a rail: on a cars leaf with
|
|
246
|
+
* three listings the busiest axis is whichever three values happen to be
|
|
247
|
+
* counted, so the rail opened on condition and colour while make, model and
|
|
248
|
+
* year — the three fields the schema marks
|
|
249
|
+
* `mandatory`, i.e. the three every seller had to fill and every buyer
|
|
250
|
+
* narrows by first — sat below them or off the fold entirely.
|
|
251
|
+
*
|
|
252
|
+
* So: the schema's own order, which is the order the composer asks the
|
|
253
|
+
* seller to fill the form in, with required first. Four bands:
|
|
254
|
+
*
|
|
255
|
+
* 1. `pinned` slugs, in the order given — the axis a page has already
|
|
256
|
+
* decided is its subject (a partition's own field).
|
|
257
|
+
* 2. schema-required (`mandatory: true`), in schema order.
|
|
258
|
+
* 3. everything else the schema names, in schema order.
|
|
259
|
+
* 4. what the schema does not name at all — including EVERY group when the
|
|
260
|
+
* host passed no feature list, which is the live parent-node case — in
|
|
261
|
+
* evidence order, because with no schema there is no other order to have.
|
|
262
|
+
*
|
|
263
|
+
* Stable: within a band the comparator falls through to evidence and then to
|
|
264
|
+
* the order `buildFacetGroups` gave, so equal-ranked groups never reshuffle.
|
|
265
|
+
*/
|
|
266
|
+
export function orderFacetGroupsBySchema(input) {
|
|
267
|
+
const schemaIndex = new Map();
|
|
268
|
+
(input.categoryFeatures ?? []).forEach((feature, index) => {
|
|
269
|
+
if (!schemaIndex.has(feature.slug))
|
|
270
|
+
schemaIndex.set(feature.slug, index);
|
|
271
|
+
});
|
|
272
|
+
const pinnedIndex = new Map();
|
|
273
|
+
(input.pinned ?? []).forEach((slug, index) => {
|
|
274
|
+
if (!pinnedIndex.has(slug))
|
|
275
|
+
pinnedIndex.set(slug, index);
|
|
276
|
+
});
|
|
277
|
+
const band = (group) => {
|
|
278
|
+
if (pinnedIndex.has(group.slug))
|
|
279
|
+
return 0;
|
|
280
|
+
if (!schemaIndex.has(group.slug))
|
|
281
|
+
return 3;
|
|
282
|
+
return group.feature?.mandatory === true ? 1 : 2;
|
|
283
|
+
};
|
|
284
|
+
const within = (group) => pinnedIndex.get(group.slug) ?? schemaIndex.get(group.slug) ?? 0;
|
|
285
|
+
return [...input.groups].sort((a, b) => {
|
|
286
|
+
const byBand = band(a) - band(b);
|
|
287
|
+
if (byBand !== 0)
|
|
288
|
+
return byBand;
|
|
289
|
+
const byOrder = within(a) - within(b);
|
|
290
|
+
if (byOrder !== 0)
|
|
291
|
+
return byOrder;
|
|
292
|
+
return compareFacetsByEvidence(a, b);
|
|
293
|
+
});
|
|
294
|
+
}
|
|
139
295
|
function translate(t, key) {
|
|
140
296
|
if (t === undefined)
|
|
141
297
|
return key;
|
|
@@ -200,8 +356,44 @@ function declaredOptionValues(feature) {
|
|
|
200
356
|
* value — never a blank, and never a guess.
|
|
201
357
|
*/
|
|
202
358
|
function resolveLabel(input, feature, slug, value, labelOptions) {
|
|
203
|
-
|
|
204
|
-
|
|
359
|
+
const answer = serverLabel(input.facetLabels, slug, value, input.t);
|
|
360
|
+
if (answer !== undefined)
|
|
361
|
+
return { label: answer, labelSource: "server" };
|
|
362
|
+
const schema = facetOptionLabel(feature, value, labelOptions);
|
|
363
|
+
// `facetOptionLabel` hands back the value unchanged for an option it
|
|
364
|
+
// cannot name, and that identity is the whole test — a formatter that
|
|
365
|
+
// returned the term is a formatter that named nothing.
|
|
366
|
+
return schema === value
|
|
367
|
+
? { label: value, labelSource: "none" }
|
|
368
|
+
: { label: schema, labelSource: "schema" };
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* The group's HEADING, in the one order the fleet states: the answer, then
|
|
372
|
+
* the category schema, then the slug under a dev warning.
|
|
373
|
+
*
|
|
374
|
+
* The answer leads because it is the only source that always exists. The
|
|
375
|
+
* schema slot is optional, and at a live classified's cars branch the
|
|
376
|
+
* storefront passed an empty feature list, so every heading in the rail was
|
|
377
|
+
* a raw index slug — the make group was on screen, unlabelled, and the
|
|
378
|
+
* complaint that came back was "I cannot pick a make".
|
|
379
|
+
*
|
|
380
|
+
* The slug is not a fallback anyone may ship: it renders, because a heading
|
|
381
|
+
* beats no heading, and it renders MARKED — `labelSource: "none"`, a warning
|
|
382
|
+
* in development, and a data attribute on the drawn group.
|
|
383
|
+
*/
|
|
384
|
+
function resolveGroupLabel(input, feature, slug) {
|
|
385
|
+
const answer = input.facetLabels?.[slug]?.label;
|
|
386
|
+
if (typeof answer === "string" && answer.length > 0) {
|
|
387
|
+
return { label: translate(input.t, answer), labelSource: "server" };
|
|
388
|
+
}
|
|
389
|
+
// `featureName` falls back to the slug itself, so the def has to be asked
|
|
390
|
+
// for a NAME rather than for a name-or-slug: a def with none names nothing.
|
|
391
|
+
const declared = feature?.name;
|
|
392
|
+
if (typeof declared === "string" && declared.length > 0) {
|
|
393
|
+
return { label: translate(input.t, declared), labelSource: "schema" };
|
|
394
|
+
}
|
|
395
|
+
warnUnnamedGroup(slug);
|
|
396
|
+
return { label: slug, labelSource: "none" };
|
|
205
397
|
}
|
|
206
398
|
/**
|
|
207
399
|
* A facet value as a person reads it, through
|
|
@@ -283,6 +475,19 @@ export function buildFacetGroups(input) {
|
|
|
283
475
|
seen.add(slug);
|
|
284
476
|
// Applied first, type second — in that order, so an `imei` somebody
|
|
285
477
|
// somehow got into a link keeps the control that removes it.
|
|
478
|
+
//
|
|
479
|
+
// EVIDENCE does not enter here, and the reason is worth stating because
|
|
480
|
+
// the opposite was tried: a counted bucket cannot promote a slug the
|
|
481
|
+
// schema NAMES AND DISOWNS. An `imei` the engine counted is still not a
|
|
482
|
+
// filter — a free-text identifier enumerates one term per document — and
|
|
483
|
+
// a `visibility: "owner"` feature is one the canon says is never
|
|
484
|
+
// facetable at all. What evidence does outrank is SILENCE: an absent def,
|
|
485
|
+
// an untyped def, and the whole empty feature list the live cars page
|
|
486
|
+
// passes at its parent node all answer "not a verdict"
|
|
487
|
+
// (see {@link isFacetableFeature}), so a counted axis is never dropped
|
|
488
|
+
// for a schema that says nothing about it. That is the live case; a
|
|
489
|
+
// wrong-schema case where some other category types `make_ref_select` as
|
|
490
|
+
// free text is not one this pair can tell apart from a real `imei`.
|
|
286
491
|
const applied = (input.state.filters[slug] ?? []).length > 0;
|
|
287
492
|
if (!applied && !isFacetableFeature(bySlug.get(slug)))
|
|
288
493
|
continue;
|
|
@@ -350,21 +555,17 @@ export function buildFacetGroups(input) {
|
|
|
350
555
|
};
|
|
351
556
|
return {
|
|
352
557
|
slug,
|
|
353
|
-
|
|
354
|
-
? slug
|
|
355
|
-
: translate(input.t, featureName(feature)),
|
|
558
|
+
...resolveGroupLabel(input, feature, slug),
|
|
356
559
|
feature,
|
|
357
560
|
counted,
|
|
358
561
|
selected,
|
|
359
562
|
options: values.map((value) => ({
|
|
360
563
|
value,
|
|
361
564
|
count: counted ? (counts[value] ?? 0) : null,
|
|
362
|
-
// The
|
|
363
|
-
//
|
|
364
|
-
//
|
|
365
|
-
|
|
366
|
-
// makes "did it resolve?" answerable without a second lookup.
|
|
367
|
-
label: resolveLabel(input, feature, slug, value, labelOptions),
|
|
565
|
+
// The answer's caption first, then the schema's own option table,
|
|
566
|
+
// then the raw value — and the source is carried rather than
|
|
567
|
+
// re-derived, so "did it resolve?" needs no second lookup.
|
|
568
|
+
...resolveLabel(input, feature, slug, value, labelOptions),
|
|
368
569
|
selected: selected.includes(value),
|
|
369
570
|
})),
|
|
370
571
|
};
|
package/dist/state/facets.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facets.js","sourceRoot":"","sources":["../../src/state/facets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,WAAW,EACX,WAAW,EACX,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAIlC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,MAAM;IACN,qBAAqB;IACrB,GAAG,uBAAuB;IAC1B,QAAQ;CACT,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAA+B;IAChE,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACvC,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IAClC,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACpC,OAAO,uBAAuB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAChD,CAAC;AA6BD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,aAAa,CAAC,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AC,CAAC,EAAE,CAAC;SAChE,CAAC;QAEF,OAAO;YACL,IAAI;YACJ,GAAG,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC;YAC1C,OAAO;YACP,OAAO;YACP,QAAQ;YACR,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBAC9B,KAAK;gBACL,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;gBAC5C,kEAAkE;gBAClE,6DAA6D;gBAC7D,2DAA2D;gBAC3D,GAAG,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,CAAC;gBAC1D,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;aACnC,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,SAAS,eAAe,CAAC,KAAiB;IACxC,IAAI,CAAC,KAAK,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAChC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3C,OAAO,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAClC,CAAC"}
|
package/dist/state/ranges.d.ts
CHANGED
|
@@ -32,6 +32,19 @@ export interface RangeGroup {
|
|
|
32
32
|
* category forgot to declare an attribute for it.
|
|
33
33
|
*/
|
|
34
34
|
readonly core: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* The values this axis can take, when it is a BOUNDED INTEGER small enough
|
|
37
|
+
* to pick from — `undefined` for every other axis, including price.
|
|
38
|
+
*
|
|
39
|
+
* A year is not a number a person types, it is one of a hundred-odd values,
|
|
40
|
+
* and the reference classified draws it as two pickers. `min`/`max` from
|
|
41
|
+
* the schema (`year: 1900..2027` on a live cars leaf) bound the list;
|
|
42
|
+
* {@link RANGE_PICKER_MAX_VALUES} is where a picker stops being one and
|
|
43
|
+
* becomes a scroll with a search box in it, at which point two typed fields
|
|
44
|
+
* are the better control. Descending, because the busy end of a bounded
|
|
45
|
+
* axis is its top: a year picker that opens on 1900 is a picker nobody uses.
|
|
46
|
+
*/
|
|
47
|
+
readonly picker: readonly number[] | undefined;
|
|
35
48
|
/**
|
|
36
49
|
* ISO 4217 code when the row is money, so the control can read as money
|
|
37
50
|
* instead of as a bare integer. Only ever set on a core axis: an attribute
|
|
@@ -68,6 +81,15 @@ export interface BuildRangeGroupsInput {
|
|
|
68
81
|
/** Translator for label keys (the schema's `name` is often one). */
|
|
69
82
|
readonly t?: (key: string) => string;
|
|
70
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* How many values a bounded integer may have and still be a PICKER.
|
|
86
|
+
*
|
|
87
|
+
* 300 covers every year range a catalogue declares (a live cars leaf is
|
|
88
|
+
* 1900..2027, 128 values) and a door count, a seat count, a floor number,
|
|
89
|
+
* and stops well short of a mileage (1..1000000), which is a number people
|
|
90
|
+
* type and never a list.
|
|
91
|
+
*/
|
|
92
|
+
export declare const RANGE_PICKER_MAX_VALUES = 300;
|
|
71
93
|
/** Is this feature one a numeric range row is drawn for? */
|
|
72
94
|
export declare function isRangeFeature(feature: FeatureDef): boolean;
|
|
73
95
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ranges.d.ts","sourceRoot":"","sources":["../../src/state/ranges.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAI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;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAC/C;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAClD;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,oEAAoE;IACpE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CACtC;AAgBD;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAsB3C,4DAA4D;AAC5D,wBAAgB,cAAc,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAG3D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,qBAAqB,GAC3B,SAAS,UAAU,EAAE,CA8CvB;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAMzD"}
|
package/dist/state/ranges.js
CHANGED
|
@@ -66,6 +66,35 @@ function translate(t, key) {
|
|
|
66
66
|
const resolved = t(key);
|
|
67
67
|
return resolved.length > 0 ? resolved : key;
|
|
68
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* How many values a bounded integer may have and still be a PICKER.
|
|
71
|
+
*
|
|
72
|
+
* 300 covers every year range a catalogue declares (a live cars leaf is
|
|
73
|
+
* 1900..2027, 128 values) and a door count, a seat count, a floor number,
|
|
74
|
+
* and stops well short of a mileage (1..1000000), which is a number people
|
|
75
|
+
* type and never a list.
|
|
76
|
+
*/
|
|
77
|
+
export const RANGE_PICKER_MAX_VALUES = 300;
|
|
78
|
+
/**
|
|
79
|
+
* The value list for a bounded integer axis, or `undefined`.
|
|
80
|
+
*
|
|
81
|
+
* A CORE axis never gets one: price is unbounded by construction and the
|
|
82
|
+
* server does not declare bounds for it.
|
|
83
|
+
*/
|
|
84
|
+
function pickerValues(feature, min, max) {
|
|
85
|
+
if (feature === undefined)
|
|
86
|
+
return undefined;
|
|
87
|
+
if (featureType(feature) !== "int")
|
|
88
|
+
return undefined;
|
|
89
|
+
if (min === undefined || max === undefined)
|
|
90
|
+
return undefined;
|
|
91
|
+
if (!Number.isInteger(min) || !Number.isInteger(max))
|
|
92
|
+
return undefined;
|
|
93
|
+
const span = max - min + 1;
|
|
94
|
+
if (span < 2 || span > RANGE_PICKER_MAX_VALUES)
|
|
95
|
+
return undefined;
|
|
96
|
+
return Array.from({ length: span }, (_, i) => max - i);
|
|
97
|
+
}
|
|
69
98
|
/** Is this feature one a numeric range row is drawn for? */
|
|
70
99
|
export function isRangeFeature(feature) {
|
|
71
100
|
const type = featureType(feature);
|
|
@@ -123,6 +152,7 @@ export function buildRangeGroups(input) {
|
|
|
123
152
|
? undefined
|
|
124
153
|
: (str(config["postfix"]) ?? str(config["unit_m"]) ?? str(config["unit_i"])),
|
|
125
154
|
step: feature !== undefined && featureType(feature) === "int" ? 1 : undefined,
|
|
155
|
+
picker: isCore ? undefined : pickerValues(feature, num(config["min"]), num(config["max"])),
|
|
126
156
|
active: applied !== undefined,
|
|
127
157
|
core: isCore,
|
|
128
158
|
currency: isCore ? str(input.currency) : undefined,
|
package/dist/state/ranges.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ranges.js","sourceRoot":"","sources":["../../src/state/ranges.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;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