@aiquants/contact-map 0.12.0 → 0.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/README.md +6 -1
- package/dist/client.d.mts +2 -1
- package/dist/client.d.ts +2 -1
- package/dist/client.js +2 -2
- package/dist/client.mjs +2 -2
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -138,7 +138,9 @@ A 401 or 403 ends the load at once in phase `auth-required` with the error `Auth
|
|
|
138
138
|
|
|
139
139
|
```tsx
|
|
140
140
|
// app/routes/contact_map.tsx
|
|
141
|
-
import { ContactMapConfigProvider, ContactMapSearchPage } from "@aiquants/contact-map/client"
|
|
141
|
+
import { ContactMapConfigProvider, ContactMapSearchPage, contactMapShouldRevalidate } from "@aiquants/contact-map/client"
|
|
142
|
+
|
|
143
|
+
export const shouldRevalidate = contactMapShouldRevalidate
|
|
142
144
|
|
|
143
145
|
export default function ContactMapRoute() {
|
|
144
146
|
return (
|
|
@@ -154,6 +156,9 @@ export default function ContactMapRoute() {
|
|
|
154
156
|
}
|
|
155
157
|
```
|
|
156
158
|
|
|
159
|
+
Export `contactMapShouldRevalidate` as the route's `shouldRevalidate`. On the same path, a change of nothing but the page's own URL state (the list / tree tab `view` and the search term `q`) does not run the route's loader, since the records stream in on the client. Every other transition keeps React Router's decision (another path, another parameter, and the unchanged URL after an action, a `revalidate()` call or a link to the current page), so a loader that checks the session still runs then; a submission is decided by its URL the same way. It is built with `@aiquants/route-revalidation`.
|
|
160
|
+
ルートの `shouldRevalidate` には `contactMapShouldRevalidate` を公開する。同じパスでページ自身の URL の状態 (一覧とツリーのタブ `view` と検索語 `q`) だけが変わる遷移では、ルートのローダーを走らせない (レコードはクライアントへストリームで届く)。ほかの遷移 (別のパス・ほかのパラメータ・アクションの後や `revalidate()`・今のページへのリンクのような URL の変わらない場合) は React Router の判断を保つので、セッションを確かめるローダーはそのときも走る。送信も URL で同じに決める。`@aiquants/route-revalidation` で組んでいる。
|
|
161
|
+
|
|
157
162
|
The page needs its styles, which depend on the host: a host that builds with Tailwind CSS v4 generates the classes itself, and a host without it imports the standalone CSS (see Styling).
|
|
158
163
|
ページにはスタイルが要り、その用意はホストによって変わる: Tailwind CSS v4 でビルドするホストは自分のビルドでクラスを生成し、Tailwind CSS を使わないホストはスタンドアロンの CSS を読み込む (スタイルの節を参照)。
|
|
159
164
|
|
package/dist/client.d.mts
CHANGED
|
@@ -8,6 +8,7 @@ import { VirtualScrollLocale } from "@aiquants/virtualscroll";
|
|
|
8
8
|
import * as _aiquants_fuzzy_search from "@aiquants/fuzzy-search";
|
|
9
9
|
import { UseFuzzySearchOptions as UseFuzzySearchOptions$1, UnifiedWorkerStats } from "@aiquants/fuzzy-search";
|
|
10
10
|
import { R as ResponsiveThresholds, C as ContactMapDirectoryEntry, a as ContactRecordForTree, b as ContactMapTreeNaming } from "./tree-types-B9J5unS2.mjs";
|
|
11
|
+
import * as _aiquants_route_revalidation from "@aiquants/route-revalidation";
|
|
11
12
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
12
13
|
interface AdvancedSearchSettingsProps {
|
|
13
14
|
searchOptions: UseFuzzySearchOptions;
|
|
@@ -709,7 +710,7 @@ declare const getTreeWorkerSession: (treeWorkerUrl?: string) => TreeWorkerSessio
|
|
|
709
710
|
declare const resetTreeWorkerSessionForTesting: () => void;
|
|
710
711
|
declare function useTreeWorker(records: readonly ContactRecordForTree[], isComplete?: boolean): TreeWorkerState;
|
|
711
712
|
declare const useContactMapLabels: () => ContactMapLabels;
|
|
712
|
-
declare
|
|
713
|
+
declare const contactMapShouldRevalidate: _aiquants_route_revalidation.RouteShouldRevalidate;
|
|
713
714
|
type ProgressProps = react.ComponentPropsWithoutRef<"div"> & {
|
|
714
715
|
value?: number;
|
|
715
716
|
max?: number;
|
package/dist/client.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { VirtualScrollLocale } from "@aiquants/virtualscroll";
|
|
|
8
8
|
import * as _aiquants_fuzzy_search from "@aiquants/fuzzy-search";
|
|
9
9
|
import { UseFuzzySearchOptions as UseFuzzySearchOptions$1, UnifiedWorkerStats } from "@aiquants/fuzzy-search";
|
|
10
10
|
import { R as ResponsiveThresholds, C as ContactMapDirectoryEntry, a as ContactRecordForTree, b as ContactMapTreeNaming } from "./tree-types-B9J5unS2.js";
|
|
11
|
+
import * as _aiquants_route_revalidation from "@aiquants/route-revalidation";
|
|
11
12
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
12
13
|
interface AdvancedSearchSettingsProps {
|
|
13
14
|
searchOptions: UseFuzzySearchOptions;
|
|
@@ -709,7 +710,7 @@ declare const getTreeWorkerSession: (treeWorkerUrl?: string) => TreeWorkerSessio
|
|
|
709
710
|
declare const resetTreeWorkerSessionForTesting: () => void;
|
|
710
711
|
declare function useTreeWorker(records: readonly ContactRecordForTree[], isComplete?: boolean): TreeWorkerState;
|
|
711
712
|
declare const useContactMapLabels: () => ContactMapLabels;
|
|
712
|
-
declare
|
|
713
|
+
declare const contactMapShouldRevalidate: _aiquants_route_revalidation.RouteShouldRevalidate;
|
|
713
714
|
type ProgressProps = react.ComponentPropsWithoutRef<"div"> & {
|
|
714
715
|
value?: number;
|
|
715
716
|
max?: number;
|