@nivaro/react 0.3.33 → 0.3.35

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 (32) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +79 -5
  4. package/dist/index.js +338 -329
  5. package/dist/shared/components/ItemEditForm.js +5274 -5069
  6. package/dist/shared/components/ProfileView.js +46 -44
  7. package/dist/shared/components/ReportView.js +208 -205
  8. package/dist/shared/components/SearchHighlight.js +30 -0
  9. package/dist/shared/components/TipLayer.js +39 -37
  10. package/dist/shared/components/item-edit/CatalogPickerField.js +1484 -1232
  11. package/dist/shared/components/item-edit/FieldAffordances.js +424 -213
  12. package/dist/shared/components/item-edit/FieldRow.js +475 -427
  13. package/dist/shared/components/item-edit/PersonalDefaultControl.js +211 -0
  14. package/dist/shared/components/item-edit/PersonalDefaultPill.js +20 -0
  15. package/dist/shared/components/item-edit/RecordLiveSync.js +115 -110
  16. package/dist/shared/components/item-edit/RelationCombobox.js +42 -41
  17. package/dist/shared/components/item-edit/catalog-search.js +34 -0
  18. package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +43 -43
  19. package/dist/shared/components/item-edit/live-record-marks.js +13 -0
  20. package/dist/shared/components/item-edit/personal-default-checks.js +134 -0
  21. package/dist/shared/components/item-edit/usePersonalDefaults.js +442 -0
  22. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +130 -111
  23. package/dist/shared/components/layout-editor/inspector/RulesTab.js +76 -75
  24. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  25. package/dist/shared/components/profile/MyDefaultsCard.js +667 -0
  26. package/dist/shared/components/profile/PersonProfile.js +42 -40
  27. package/dist/shared/components/profile/my-defaults-labels.js +76 -0
  28. package/dist/shared/components/profile/primitives.js +72 -67
  29. package/dist/shared/lib/personal-defaults.js +76 -0
  30. package/dist/shared/lib/request-gate.js +78 -76
  31. package/dist/shared/lib/search-text.js +111 -0
  32. package/package.json +1 -1
@@ -9,7 +9,7 @@ import { noteReplayEvent as _e, createReplayCheckoutState as De } from "../share
9
9
  import { emitReplayTap as Te, setReplayRecorderMode as N, registerReplayCapture as qe, clipEndOffset as Le, withClipKind as Pe } from "../shared/lib/replay-capture.js";
10
10
  import { instrumentConsole as Ne, instrumentRequests as Fe, redactSecrets as Me } from "../shared/lib/replay-context.js";
11
11
  import { instrumentSocket as Oe } from "../shared/lib/replay-socket.js";
12
- const Ue = "nivaro-react@0.3.33", j = 1e4, We = 150, He = 3e3, Ke = 600, $e = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
12
+ const Ue = "nivaro-react@0.3.35", j = 1e4, We = 150, He = 3e3, Ke = 600, $e = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
13
13
  function Be(n) {
14
14
  return typeof n.url != "string" || typeof fetch != "function" ? null : (f, a) => {
15
15
  const u = typeof n.getToken == "function" ? n.getToken() : void 0, d = { "Content-Type": "application/json" };
package/dist/index.d.ts CHANGED
@@ -2851,6 +2851,9 @@ export declare interface EventPathSheetProps {
2851
2851
 
2852
2852
  declare type EventStatus = 'ok' | 'error' | 'info';
2853
2853
 
2854
+ /** Each token with its alternatives (itself first, then every synonym it shares a group with). */
2855
+ export declare function expandTokens(tokens: string[], synonyms?: SynonymGroups): string[][];
2856
+
2854
2857
  export declare type ExprNode = {
2855
2858
  kind: 'number';
2856
2859
  value: number;
@@ -3202,6 +3205,9 @@ export declare function focusRecordTarget(target: {
3202
3205
  rowId?: string;
3203
3206
  }): void;
3204
3207
 
3208
+ /** Case- and accent-folded text. */
3209
+ export declare function foldSearchText(text: string): string;
3210
+
3205
3211
  /** A press of Expand all or Collapse all; `seq` changes on every press. */
3206
3212
  declare interface FoldSignal {
3207
3213
  open: boolean;
@@ -4093,6 +4099,18 @@ declare interface HelpVideoWhatsNew {
4093
4099
  whole: boolean;
4094
4100
  }
4095
4101
 
4102
+ export declare interface HighlightPart {
4103
+ text: string;
4104
+ match: boolean;
4105
+ }
4106
+
4107
+ /**
4108
+ * The text split into matched / unmatched runs for every token and synonym
4109
+ * found in it. Overlapping or touching matches merge into one run. No query,
4110
+ * or nothing found, returns the whole text as one unmatched part.
4111
+ */
4112
+ export declare function highlightParts(text: string | null | undefined, q: string | null | undefined, opts?: SearchTextOptions): HighlightPart[];
4113
+
4096
4114
  /** A held frame (#1537): the edited timeline freezes on the source frame at
4097
4115
  * `at_ms` for `hold_ms` (edited time, 0.2–10 s). Extra edited time with no
4098
4116
  * source advance, like 0.5x slow motion; everything on screen at that moment
@@ -5042,11 +5060,6 @@ export declare type ItemEditAuthContextValue = {
5042
5060
  userId: string;
5043
5061
  };
5044
5062
 
5045
- /**
5046
- * The record form. With `design` (the layout editor's canvas) the whole form —
5047
- * its own hooks included — runs inside DesignCanvas: a client that cannot
5048
- * write, no realtime, inert inputs, selectable shells.
5049
- */
5050
5063
  export declare function ItemEditForm(props: ItemEditFormProps): JSX.Element;
5051
5064
 
5052
5065
  export declare interface ItemEditFormProps {
@@ -5822,6 +5835,12 @@ declare type MatchedDrawerConfig = {
5822
5835
  defaults?: Record<string, unknown>;
5823
5836
  };
5824
5837
 
5838
+ /**
5839
+ * Every token (or one of its synonyms) occurs in the text. An empty query
5840
+ * matches everything — same contract as `matchesAllTokens`.
5841
+ */
5842
+ export declare function matchesSearch(text: string | null | undefined, q: string | null | undefined, opts?: SearchTextOptions): boolean;
5843
+
5825
5844
  /** Match a filter surface (by its own key and/or its options collection) to a
5826
5845
  * scope dimension. Convention: key === dimension name wins, else the filter's
5827
5846
  * options collection === the dimension's target collection. */
@@ -9144,6 +9163,36 @@ declare interface ScopeDimensionLite {
9144
9163
  display_field?: string | null;
9145
9164
  }
9146
9165
 
9166
+ /**
9167
+ * Text with the typed search marked (lib/search-text.ts `highlightParts`):
9168
+ * every token and synonym, case- and accent-insensitive. The mark keeps the
9169
+ * text's own colour and only tints behind it (the admin palette's treatment),
9170
+ * so it reads in light and dark alike. No query = the plain text.
9171
+ */
9172
+ export declare function SearchHighlight({ text, query, synonyms, className, markClassName }: {
9173
+ text: string | null | undefined;
9174
+ query: string | null | undefined;
9175
+ synonyms?: SynonymGroups;
9176
+ className?: string;
9177
+ markClassName?: string;
9178
+ }): JSX.Element;
9179
+
9180
+ /**
9181
+ * The API's `search_rank=1` tier for one row, from its searched values in
9182
+ * request order (`values[0]` = the primary column, e.g. the item number):
9183
+ * 0 primary equals the text · 1 another column equals it · 2 primary starts
9184
+ * with it · 3 another column starts with it · 4 every word starts a word of
9185
+ * some column (start, or after a non-letter/digit) · 5 anything else.
9186
+ * Case-insensitive like the database collation; accents are compared as-is
9187
+ * (SQL Server *_CI_AS), so this never folds them.
9188
+ */
9189
+ export declare function searchRankTier(values: ReadonlyArray<unknown>, q: string | null | undefined): number;
9190
+
9191
+ export declare interface SearchTextOptions {
9192
+ /** Groups of interchangeable words/phrases; a token in a group also matches the rest. */
9193
+ synonyms?: SynonymGroups;
9194
+ }
9195
+
9147
9196
  export declare type SectionState = {
9148
9197
  isCollapsed: (key: string) => boolean;
9149
9198
  toggle: (key: string) => void;
@@ -9879,6 +9928,28 @@ export declare function SupportView({ initialTicketId, onTicketChange, className
9879
9928
  className?: string;
9880
9929
  }): JSX.Element;
9881
9930
 
9931
+ /**
9932
+ * One search-text vocabulary for every client surface that matches typed text
9933
+ * against labels: pickers (RelationCombobox, CatalogPickerField), the command
9934
+ * palettes and full search pages (2026-10-28 search program, item 22).
9935
+ *
9936
+ * - `tokenize(q)`: words, lower-cased and accent-folded; "quoted phrases" stay
9937
+ * one token. Duplicates drop.
9938
+ * - `matchesSearch(text, q)`: every token (or one of its synonyms) is a
9939
+ * substring of the text — `matchesAllTokens` (lib/utils.ts) semantics, plus
9940
+ * accent folding, phrases and synonyms.
9941
+ * - `highlightParts(text, q)`: the text cut into matched / unmatched parts for
9942
+ * rendering `<mark>`s (multi-token, case- and accent-insensitive, overlaps
9943
+ * merged, indices mapped back to the ORIGINAL text).
9944
+ * - Synonyms are a hook, never fetched here: pass `synonyms` (groups of
9945
+ * interchangeable words, e.g. the search-analytics synonym list the server's
9946
+ * `searchPhrases` reads) and each token also matches the others in its group.
9947
+ *
9948
+ * `searchRankTier` is the client twin of the API's `search_rank=1` ORDER BY
9949
+ * (api/src/services/list-search-rank.ts) — change both together.
9950
+ */
9951
+ export declare type SynonymGroups = ReadonlyArray<ReadonlyArray<string>>;
9952
+
9882
9953
  declare type TabKey = 'catalog' | 'rules' | 'subscriptions' | 'history' | 'widget_alerts' | 'widget_alert_history' | 'anomaly_rules' | 'anomaly_history';
9883
9954
 
9884
9955
  export declare type TabState = {
@@ -10025,6 +10096,9 @@ export declare function TipLayer(): ReactPortal | null;
10025
10096
 
10026
10097
  export declare function titleCase(str: string): string;
10027
10098
 
10099
+ /** Typed text → tokens: whitespace-split words, "quoted phrases" kept whole; folded, unique. */
10100
+ export declare function tokenize(q: string | null | undefined): string[];
10101
+
10028
10102
  export declare type TokenResolver = (path: string) => unknown;
10029
10103
 
10030
10104
  declare type Tone = 'accent' | 'warning' | 'neutral';