@indxsearch/intrface 3.11.0 → 3.13.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/dist/intrface.css CHANGED
@@ -1,2 +1,2 @@
1
- ._placeholder_ee9qi_1{opacity:.05;justify-content:center;align-items:center;height:100%;min-height:600px;max-height:1000px;display:flex}._invalid_ee9qi_11 p{font:var(--text-base);padding:25px}._row_1i201_1{border-bottom:1px solid var(--lv0);font:var(--text-xs);color:var(--lv5);padding:20px 25px 20px 30px;position:relative}@media (prefers-color-scheme:dark){._row_1i201_1{border-color:var(--lv2)}}._row_1i201_1:last-child{border-bottom:none}._content_1i201_19{flex-direction:column;gap:10px;line-height:1.8;display:flex}._content_1i201_19 span{background-color:var(--lv0)}._indexNumber_1i201_31{font:var(--text-2xs);color:var(--lv4);position:absolute;top:25px;left:5px}._scoreNumber_1i201_39{font:var(--text-2xs);color:var(--lv4);position:absolute;top:25px;right:5px}@keyframes _fade_1i201_1{0%,to{opacity:1}50%{opacity:.4}}._skeletonBars_1i201_53{flex-direction:column;gap:10px;display:flex}._skeletonBarLg_1i201_59{background:var(--lv3);border-radius:1px;height:12px;animation:2.4s ease-in-out infinite _fade_1i201_1}._skeletonBarSm_1i201_66{background:var(--lv3);border-radius:1px;height:8px;animation:2.4s ease-in-out infinite _fade_1i201_1}@keyframes _skeletonAppear_81m3c_1{0%{opacity:0}to{opacity:1}}._wrapper_81m3c_6{animation:.2s .15s both _skeletonAppear_81m3c_1}._row_ujwhc_1{flex-wrap:wrap;align-items:center;gap:6px;display:flex}._title_ujwhc_8{font:var(--text-base);color:var(--lv8)}@keyframes _skeletonAppear_4nxla_1{0%{opacity:0}to{opacity:1}}@keyframes _fade_4nxla_1{0%,to{opacity:1}50%{opacity:.4}}._bar_4nxla_12{background:var(--lv2);border-radius:1px;height:10px;animation:.2s .15s both _skeletonAppear_4nxla_1,2.4s ease-in-out .35s infinite _fade_4nxla_1}._listRows_4nxla_19{flex-direction:column;gap:12px;display:flex}._sliderArea_4nxla_25{flex-direction:column;gap:14px;padding:4px 0 10px;display:flex}._sliderTrack_4nxla_32{background:var(--lv2);border-radius:1px;width:100%;height:6px;animation:.2s .15s both _skeletonAppear_4nxla_1,2.4s ease-in-out .35s infinite _fade_4nxla_1}._inputRow_4nxla_40{justify-content:space-between;display:flex}._inputBar_4nxla_45{background:var(--lv2);border-radius:1px;width:40px;height:20px;animation:.2s .15s both _skeletonAppear_4nxla_1,2.4s ease-in-out .35s infinite _fade_4nxla_1}._histogramRow_4nxla_55{height:8px;margin-top:2px}._list_18vbb_2{flex-direction:column;gap:10px;display:flex}._count_18vbb_7{font:var(--text-xs);color:var(--lv5);justify-content:space-between;align-items:center;gap:8px;display:flex}._countValue_18vbb_17{flex-shrink:0}._chip_18vbb_22{min-width:0;max-width:100%}._chip_18vbb_22 svg{flex-shrink:0}._chipLabel_18vbb_32{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}._grid_18vbb_40{flex-wrap:wrap;gap:10px;display:flex}._grid_18vbb_40 li{flex:0 auto;min-width:0;max-width:100%}._active_18vbb_54{background:var(--lv1)}._disabledMessage_adany_1{font:var(--text-2xs);margin-bottom:10px}._histogram_adany_6{height:20px;margin-bottom:2px;position:relative}._histogramLayer_adany_14{align-items:flex-end;padding:0 10px;display:flex;position:absolute;inset:0}._histogramLive_adany_22,._histogramLit_adany_23{pointer-events:none}._histogramLive_adany_22 ._histogramFill_adany_30{background:var(--lv3);border-radius:0}._histogramLit_adany_23 ._histogramFill_adany_30{background:var(--lv5);border-radius:0}._histogramBar_adany_43{cursor:pointer;background:0 0;border:0;flex:0 0;align-items:flex-end;min-width:0;height:100%;padding:0;display:flex}._histogramSeparators_adany_61{pointer-events:none;position:absolute;inset:0}._histogramSeparator_adany_48{background:var(--lv0);width:1px;margin-left:-.5px;position:absolute;top:0;bottom:0}._active_adany_76 ._histogramSeparator_adany_48{background:var(--lv1)}._histogramBar_adany_43:disabled{cursor:default}._histogramBar_adany_43:focus-visible{outline:1px solid var(--lv5);outline-offset:1px}._histogramFill_adany_30{background:var(--lv2);border-radius:1px 1px 0 0;width:100%;transition:height .15s;display:block}._active_adany_76{background:var(--lv1)}._list_apmmi_2{flex-direction:column;gap:10px;display:flex}._grid_apmmi_9{flex-wrap:wrap;gap:10px;display:flex}._grid_apmmi_9 li{flex:0 auto;min-width:0;max-width:100%}._count_apmmi_22{font:var(--text-xs);color:var(--lv5);justify-content:space-between;align-items:center;gap:8px;display:flex}._countValue_apmmi_31{flex-shrink:0}._chip_apmmi_35{min-width:0;max-width:100%}._error_apmmi_40{font:var(--text-xs);color:var(--negative,#c33)}._active_apmmi_46{background:var(--lv1)}._grid_1xjna_2{flex-wrap:wrap;gap:10px;margin:0;padding:0;list-style:none;display:flex}._grid_1xjna_2 li{flex:0 auto;min-width:0;max-width:100%}._chip_1xjna_21{min-width:0;max-width:100%}._chip_1xjna_21 svg{flex-shrink:0}._chipLabel_1xjna_32{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}._select_nwf7i_1{padding:6px 10px;font-size:14px}._radioGroup_nwf7i_6{flex-direction:column;gap:6px;display:flex}._list_1y4fk_1{flex-direction:column;gap:15px;list-style-type:none;display:flex}
1
+ ._withOffer_15olh_2{flex-direction:column;gap:8px;width:100%;display:flex}._offerRow_15olh_10{align-items:center;gap:10px;min-width:0;min-height:36px;display:flex}._offerHint_15olh_18{font:var(--text-xs);color:var(--lv4);flex-shrink:0;align-items:center;gap:4px;display:inline-flex}._kbd_15olh_27{min-width:18px;height:18px;font:var(--text-2xs);color:var(--lv5);background:var(--lv2);border-radius:3px;justify-content:center;align-items:center;padding:0 5px;display:inline-flex}._message_1mgfk_1{text-align:center;flex-direction:column;align-items:center;gap:6px;padding:80px 24px;display:flex}._icon_1mgfk_10{margin-bottom:10px;display:flex}._title_1mgfk_15{font:var(--text-lg);color:var(--lv7)}._detail_1mgfk_20{font:var(--text-sm);color:var(--lv5)}._technical_1mgfk_25{font-family:var(--font-mono,ui-monospace, monospace);color:var(--lv4);max-width:60ch;margin-top:4px;font-size:11px}._button_1mgfk_33{margin-top:10px}._placeholder_1qr5o_1{opacity:.05;justify-content:center;align-items:center;height:100%;min-height:600px;max-height:1000px;display:flex}._invalid_1qr5o_11 p{font:var(--text-base);padding:25px}._searchedFor_1qr5o_17{font:var(--text-sm);color:var(--lv5);flex-wrap:wrap;align-items:center;gap:4px 10px;margin-bottom:8px;display:flex}._searchedFor_1qr5o_17 strong{color:var(--lv8);font-weight:var(--med)}._row_11svi_1{border-bottom:1px solid var(--lv0);font:var(--text-xs);isolation:isolate;color:var(--lv5);padding:20px 25px 20px 30px;position:relative}@media (prefers-color-scheme:dark){._row_11svi_1{border-color:var(--lv2)}}._row_11svi_1:last-child{border-bottom:none}._content_11svi_22{flex-direction:column;gap:10px;line-height:1.8;display:flex}._content_11svi_22 .indx-chip{background-color:var(--lv0)}._indexNumber_11svi_36{font:var(--text-2xs);color:var(--lv4);position:absolute;top:25px;left:5px}._scoreNumber_11svi_44{font:var(--text-2xs);color:var(--lv4);position:absolute;top:25px;right:5px}._skeletonBars_11svi_53{flex-direction:column;gap:10px;display:flex}@keyframes _skeletonAppear_f970z_1{0%{opacity:0}to{opacity:1}}._wrapper_f970z_6{animation:.2s .15s both _skeletonAppear_f970z_1}@media (prefers-reduced-motion:reduce){._wrapper_f970z_6{animation:none}}._row_ujwhc_1{flex-wrap:wrap;align-items:center;gap:6px;display:flex}._title_ujwhc_8{font:var(--text-base);color:var(--lv8)}._listRows_13obt_2{flex-direction:column;gap:12px;display:flex}._sliderArea_13obt_8{flex-direction:column;gap:14px;padding:4px 0 10px;display:flex}._inputRow_13obt_15{justify-content:space-between;display:flex}._histogramRow_13obt_22{height:8px;margin-top:2px}._list_18vbb_2{flex-direction:column;gap:10px;display:flex}._count_18vbb_7{font:var(--text-xs);color:var(--lv5);justify-content:space-between;align-items:center;gap:8px;display:flex}._countValue_18vbb_17{flex-shrink:0}._chip_18vbb_22{min-width:0;max-width:100%}._chip_18vbb_22 svg{flex-shrink:0}._chipLabel_18vbb_32{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}._grid_18vbb_40{flex-wrap:wrap;gap:10px;display:flex}._grid_18vbb_40 li{flex:0 auto;min-width:0;max-width:100%}._active_18vbb_54{background:var(--lv1)}._notice_4sel0_1{font:var(--text-xs);color:var(--lv5);flex-direction:column;gap:2px;display:flex}._technical_4sel0_9{font-family:var(--font-mono,ui-monospace, monospace);color:var(--lv4);font-size:11px}._disabledMessage_adany_1{font:var(--text-2xs);margin-bottom:10px}._histogram_adany_6{height:20px;margin-bottom:2px;position:relative}._histogramLayer_adany_14{align-items:flex-end;padding:0 10px;display:flex;position:absolute;inset:0}._histogramLive_adany_22,._histogramLit_adany_23{pointer-events:none}._histogramLive_adany_22 ._histogramFill_adany_30{background:var(--lv3);border-radius:0}._histogramLit_adany_23 ._histogramFill_adany_30{background:var(--lv5);border-radius:0}._histogramBar_adany_43{cursor:pointer;background:0 0;border:0;flex:0 0;align-items:flex-end;min-width:0;height:100%;padding:0;display:flex}._histogramSeparators_adany_61{pointer-events:none;position:absolute;inset:0}._histogramSeparator_adany_48{background:var(--lv0);width:1px;margin-left:-.5px;position:absolute;top:0;bottom:0}._active_adany_76 ._histogramSeparator_adany_48{background:var(--lv1)}._histogramBar_adany_43:disabled{cursor:default}._histogramBar_adany_43:focus-visible{outline:1px solid var(--lv5);outline-offset:1px}._histogramFill_adany_30{background:var(--lv2);border-radius:1px 1px 0 0;width:100%;transition:height .15s;display:block}._active_adany_76{background:var(--lv1)}._list_9je85_2{flex-direction:column;gap:10px;display:flex}._grid_9je85_9{flex-wrap:wrap;gap:10px;display:flex}._grid_9je85_9 li{flex:0 auto;min-width:0;max-width:100%}._count_9je85_22{font:var(--text-xs);color:var(--lv5);justify-content:space-between;align-items:center;gap:8px;display:flex}._countValue_9je85_31{flex-shrink:0}._chip_9je85_35{min-width:0;max-width:100%}._active_9je85_41{background:var(--lv1)}._grid_1xjna_2{flex-wrap:wrap;gap:10px;margin:0;padding:0;list-style:none;display:flex}._grid_1xjna_2 li{flex:0 auto;min-width:0;max-width:100%}._chip_1xjna_21{min-width:0;max-width:100%}._chip_1xjna_21 svg{flex-shrink:0}._chipLabel_1xjna_32{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}._select_nwf7i_1{padding:6px 10px;font-size:14px}._radioGroup_nwf7i_6{flex-direction:column;gap:6px;display:flex}._list_1y4fk_1{flex-direction:column;gap:15px;list-style-type:none;display:flex}._panel_gjc13_1,._thread_gjc13_4{flex-direction:column;gap:20px;display:flex}._fill_gjc13_5{gap:12px;height:100%;min-height:0}._fill_gjc13_5 ._thread_gjc13_4{overscroll-behavior:contain;flex:1;min-height:0;overflow-y:auto}._fill_gjc13_5>:last-child:not(._thread_gjc13_4){flex-shrink:0}._answer_gjc13_8{flex-direction:column;gap:10px;display:flex}._paragraph_gjc13_9{font:var(--text-sm);color:var(--lv8);margin:0;line-height:1.55}._action_gjc13_10{margin-top:10px}._turn_gjc13_11{flex-direction:column;gap:20px;display:flex}._heading_gjc13_14{font:var(--text-sm);font-weight:var(--med);color:var(--lv8);margin:4px 0 0}._list_gjc13_15{font:var(--text-sm);color:var(--lv8);flex-direction:column;gap:4px;margin:0;padding-left:20px;line-height:1.55;display:flex}._inlineCode_gjc13_16{font-family:var(--font-mono);background:var(--lv1);border-radius:4px;padding:1px 5px;font-size:.92em}._codeBlock_gjc13_17{background:var(--lv1);border-radius:var(--radius);font:var(--text-xs);font-family:var(--font-mono);color:var(--lv8);margin:0;padding:12px 14px;line-height:1.6;overflow-x:auto}._codeBlock_gjc13_17 code{font:inherit;white-space:pre}._searched_gjc13_22{flex-wrap:wrap;align-items:center;gap:6px;display:flex}._searchedLabel_gjc13_23{font:var(--text-xs);color:var(--lv5)}._steps_gjc13_26{flex-direction:column;gap:4px;display:flex}._stepDone_gjc13_27{font:var(--text-xs);color:var(--lv5)}
2
2
  /*$vite$:1*/
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * The markdown an answer model writes, rendered without a dependency and without HTML: every piece
4
+ * becomes a React element, so an answer cannot inject markup. Covers what answers from records
5
+ * use: paragraphs, headings, lists, fenced code (with an unclosed fence while it streams), inline
6
+ * code, bold, italics, http(s) links, and [n] as a citation mark.
7
+ */
8
+ type Cite = (n: number) => React.ReactNode;
9
+ /** Renders an answer's markdown, with `cite(n)` for each [n]. */
10
+ export declare function answerMarkdown(answer: string, cite: Cite): React.ReactNode;
11
+ export {};
@@ -0,0 +1,24 @@
1
+ /** Ask phrases: the words a question is built with, in four groups matched in order from the
2
+ * start. A dataset's own list, served as `effective.askPhrases` by the Search or ask settings;
3
+ * the server (SearchOrAskPhrases) is the authority and applies the same rule to the judge's search. */
4
+ export interface AskPhrases {
5
+ leadIns: string[];
6
+ frames: string[];
7
+ links: string[];
8
+ articles: string[];
9
+ }
10
+ /**
11
+ * What to search for what is typed, and the phrases taken off it: "help me find the movie about
12
+ * the green ogre" searches "green ogre". A lead-in, then what is asked for, then the link, then an
13
+ * article; nothing is taken unless the start has a question's shape (a lead-in of two words or
14
+ * more, a one-word lead-in with what is asked for, or what is asked for with its link) and a word
15
+ * of substance is left, so a title ("help", "what we do in the shadows"), a genre ("film noir") and
16
+ * an unfinished "help me find" search as typed. Then what is asked for comes off the end too
17
+ * ("show me green ogre movie" searches "green ogre"), once the start was a question and while two
18
+ * words stay before it, so a one-word title ("bee movie", "the lego movie") keeps its "movie".
19
+ * The same rule as the server's.
20
+ */
21
+ export declare function stripAskPhrases(typed: string, phrases: AskPhrases): {
22
+ text: string;
23
+ taken: string[];
24
+ };
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Search or ask: the rules a page applies before and after the server's judgement. The server
3
+ * judges (POST search-or-ask/intent); these decide when it is worth asking and keep the offer from
4
+ * blinking while the visitor types. They are the rules JevProbe's replay measured
5
+ * (JevProbe/Replay/Typing.cs and Panel.cs); keep them in step.
6
+ */
7
+ export type Offer = 'none' | 'invite' | 'strong';
8
+ /** Entered at one probability, left only below a lower one. The dataset's settings carry them. */
9
+ export interface OfferThresholds {
10
+ strong: number;
11
+ strongHide: number;
12
+ invite: number;
13
+ inviteHide: number;
14
+ }
15
+ export declare const DEFAULT_THRESHOLDS: OfferThresholds;
16
+ export declare function isIdentifier(text: string): boolean;
17
+ /** Whether a pause on this text may ask the server at all. */
18
+ export declare function triggers(text: string): boolean;
19
+ /** The next offer from the current one and a new probability, with hysteresis. */
20
+ export declare function nextOffer(current: Offer, p: number, t?: OfferThresholds): Offer;
21
+ /** One word can show a question starting ("how" scores high) but holds nothing to answer yet, so
22
+ * it gets the invitation at most; the strong offer waits for a second word or a question mark. */
23
+ /** The cut's two lines, the dataset's (`cutShareOfTop`, `cutTopFloor`), as the intent answer carries them. */
24
+ export interface CutRule {
25
+ /** A result stays while it scores at least this share of the top result. */
26
+ shareOfTop: number;
27
+ /** The list shows at all only when the top result scores at least this share of the scale. */
28
+ topFloor: number;
29
+ }
30
+ export declare const DEFAULT_CUT: CutRule;
31
+ /**
32
+ * Coverage while asking (the dataset's `strictCoverageWhileAsking`, on by default): whole words
33
+ * only, no typos, prefixes or joined words, words of three letters or more. The forgiving matching
34
+ * that is right for a typed name confirms the wrong records under a question: "ullern
35
+ * videregående" confirmed seven other schools by prefix and fuzzy matches of the second word.
36
+ * The hook puts these on the page's searches while the offer is strong and takes them off after.
37
+ */
38
+ export declare const STRICT_COVERAGE: {
39
+ readonly coverFuzzyWords: false;
40
+ readonly coverPrefixSuffix: false;
41
+ readonly coverJoinedWords: false;
42
+ readonly minWordSize: 3;
43
+ };
44
+ /** The search score's scale: coverage scores run to 65535. */
45
+ export declare const SCORE_SCALE = 65535;
46
+ /**
47
+ * The results a page shows under the "strong matches only while asking" rule (the dataset's
48
+ * `cutWhileAsking`, on by default). While the offer is strong: nothing when the top result is
49
+ * under the floor (a flat, weak list says the search has nothing for a question), else the
50
+ * results scoring at least the share of the top, never past the truncation point. Otherwise the
51
+ * list as it came. The truncation index alone was too lenient: coverage confirms a record on a
52
+ * two-letter word, so "is" and "or" confirmed forty-four Pokémon (14 Oct 2026).
53
+ */
54
+ export declare function visibleResults<T extends {
55
+ score: number;
56
+ }>(results: T[], truncationIndex: number | undefined, cut: boolean, rule?: CutRule): T[];
57
+ export declare function canAnswer(text: string): boolean;
58
+ /** Reads a `text/event-stream` body as `{ event, data }` messages, data parsed as JSON. */
59
+ export declare function readSse(body: ReadableStream<Uint8Array>): AsyncGenerator<{
60
+ event: string;
61
+ data: unknown;
62
+ }>;
63
+ /** What the statistics need to place a judgement or an ask, as a search sends it: the search
64
+ * behind it, the page load's session, the surface, and whether it counts. */
65
+ export declare function statisticsParams(ctx: {
66
+ state: {
67
+ queryId?: string;
68
+ };
69
+ sessionId?: string;
70
+ source?: string;
71
+ count?: boolean;
72
+ }): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indxsearch/intrface",
3
- "version": "3.11.0",
3
+ "version": "3.13.0",
4
4
  "description": "Indx Search interface components for React. Provides ready-to-use filter panels, search inputs, faceted navigation, and sorting components. Built on @indxsearch/systm.",
5
5
  "keywords": [
6
6
  "indx",
@@ -72,8 +72,8 @@
72
72
  },
73
73
  "dependencies": {
74
74
  "@indxsearch/indx-types": "^3.0.0",
75
- "@indxsearch/pixl": "^1.5.0",
76
- "@indxsearch/systm": "^2.17.0",
75
+ "@indxsearch/pixl": "^1.5.1",
76
+ "@indxsearch/systm": "^2.21.0",
77
77
  "react-range": "^1.10.0"
78
78
  },
79
79
  "publishConfig": {