@aiquants/period-slider 0.19.0 → 0.20.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.
@@ -1,107 +1,92 @@
1
1
  import { default as React } from 'react';
2
2
  /**
3
- * The ref useCommittedRef returns, plus the record a state mirror keeps of the object a returned function last handed to the state it mirrors.
4
- * useCommittedRef が返す ref と、ステートの写しが持つ「返す関数が最後にそのステートへ渡したオブジェクト」の記録。
5
- *
6
- * Only state mirrors use the record. Every hand-off a returned function makes is a plain value, never an updater, and
7
- * React applies a hook's updates in the order they were queued, so while the record names the state's last queued
8
- * update, the stored state ends at the recorded object. The one updater a hook's state receives is the hook's record of
9
- * its own re-placement (recordPlacement), which clears the record first, because that updater may resolve to an earlier
10
- * hand-off instead of the value it carries.
11
- * 記録を使うのはステートの写しだけ。返す関数の受け渡しはすべて値そのもので (関数形の更新ではない)、React はフックの更新を積んだ順に
12
- * 当てるため、記録がステートの最後に積んだ更新を指している間は、保存されるステートが記録したオブジェクトに行き着く。フックのステートが
13
- * 受け取る更新関数はフック自身の収め直しの記録 (recordPlacement) だけで、それは先に記録を消す (その更新関数は運ぶ値ではなく前の受け渡しへ解け得るため)。
3
+ * A ref-shaped holder that counts the writes made through `current`, so a commit can tell whether a function wrote after the committing render ran.
4
+ * `current` を通した書き込みを数え、確定する描画が走った後に関数が書いたかを確定の段階で判定できる、ref の形の入れ物。
14
5
  */
15
- export interface CommittedRef<T> extends React.RefObject<T> {
6
+ export declare class CommittedMirror<T> implements React.RefObject<T> {
7
+ /** Held value / 保持する値 */
8
+ private held;
9
+ /** Writes made through `current` so far / これまでに `current` を通して書かれた回数 */
10
+ private writeCount;
16
11
  /**
17
- * Records the object a returned function is about to pass to the mirrored state's setter.
18
- * 返す関数が写すステートの設定関数へ渡そうとしているオブジェクトの記録。
12
+ * Creates the holder with the first render's value.
13
+ * 最初の描画の値で入れ物を作るコンストラクタ。
19
14
  *
20
- * @param value - The object about to be handed over / これから渡すオブジェクト
21
- * @returns Nothing / なし
15
+ * @param initial - The first render's value / 最初の描画の値
22
16
  */
23
- hand(value: T): void;
17
+ constructor(initial: T);
24
18
  /**
25
- * Whether the ref holds the recorded object, so the state's last queued update, or its stored value, already is the held object.
26
- * ref が記録したオブジェクトを持つか (ステートの最後に積んだ更新、または保存済みの値が、既に保持するオブジェクトそのものか)。
19
+ * The value of the last committed render, or a later value written outside render.
20
+ * 最後に確定した描画の値、またはその後に描画の外で書かれた値。
21
+ *
22
+ * @returns The held value / 保持する値
27
23
  */
28
- readonly holdsHanded: boolean;
24
+ get current(): T;
29
25
  /**
30
- * Drops the record, so the next commit path that settles on the held value hands it over again.
31
- * 記録を消す関数 (次に保持する値へ落ち着いた確定経路は、もう一度それを渡す)。
32
- *
33
- * The hook's record of its own re-placement (recordPlacement) calls it before it queues its updater, because that
34
- * updater may resolve to a hand-off queued before it rather than to the placed value the mirror holds.
35
- * フック自身の収め直しの記録 (recordPlacement) が更新関数を積む前に呼ぶ (その更新関数は、写しが持つ置いた値ではなく、前に積まれた受け渡しへ解け得るため)。
26
+ * Records a value written outside render: by an event handler, an effect or an effect's cleanup.
27
+ * 描画の外 (事象の処理・副作用とその後始末) で書かれた値の記録。
36
28
  *
37
- * @returns Nothing / なし
29
+ * @param next - The written value / 書かれた値
38
30
  */
39
- forgetHanded(): void;
31
+ set current(next: T);
40
32
  /**
41
- * Drops the record unless it is the state object the running render pass holds; the hook body calls it right after it creates the mirror.
42
- * 記録が、いま走っている描画の持つステートのオブジェクトでなければ記録を消す関数 (フック本体が写しを作った直後に呼ぶ)。
33
+ * Number of writes made through `current` so far.
34
+ * これまでに `current` を通して書かれた回数。
43
35
  *
44
- * A recorded hand-off stops being the state's last queued update in one way that shows in the next render of the hook:
45
- * a hand-off made during a render (a returned function called from the host's render body) leaves the queue with that
46
- * render when React throws the render away, and the restarted render holds an older state. The state this render pass
47
- * holds is then not the recorded object, so the record is dropped and the next equal value is handed over again. A
48
- * hook's state is a reducer whose setter has no eager path (useHookState in usePeriodSlider.ts), so the state that
49
- * discarded render computed is never the base a later hand-off is compared with. The hook's record of its own
50
- * re-placement clears the record and never leaves it stale.
51
- * Until the hook renders again the record stands, so an equal call made between React throwing such a render away and
52
- * the next render of the hook is skipped. A later render that hands the value over again stores it (the restarted
53
- * render of a transition that still calls the function); when none does (a transition reverted before it commits), the
54
- * call draws and notifies nothing. While Suspense keeps a transition held, React renders it again and throws it away
55
- * after every commit, and the host's render-phase call hands the same value over again: the mirror, this record and the
56
- * hook's known value keep returning to that value until the transition commits or is reverted, so shifts step from it
57
- * and a commit-path call with that value is neither drawn nor notified. A render that skips the recorded update because
58
- * of its lower priority drops the record too, which costs one more hand-off of an equal value, at the caller's priority.
59
- * A hand-off made while handling an event never leaves the queue before it is applied. The write only ever deletes:
60
- * made in a render that never commits, it can only add a hand-off, never cause one to be skipped.
61
- * 記録した受け渡しがステートの最後に積んだ更新でなくなる道は 1 つで、次のフックの描画に現れる。描画の中で行った受け渡し (ホストの描画本体から
62
- * 呼んだ返す関数) は、React がその描画を捨てると描画とともにキューから消え、やり直す描画は古いステートを持つ。このときこの描画が持つステートは
63
- * 記録したオブジェクトではないため、記録を消し、次の同じ値はもう一度渡す。フックのステートは即時の経路を持たない設定関数のリデューサー
64
- * (usePeriodSlider.ts の useHookState) のため、捨てた描画が求めたステートが後の受け渡しの比較の基準になることはない。
65
- * フック自身の収め直しの記録は記録を消すため、記録を古くしない。次にフックを描くまでは記録が残るため、React がそうした描画を捨ててから
66
- * 次にフックを描くまでの同じ値の呼び出しは省かれる。値を保存するのは、それをもう一度渡す後の描画 (まだ関数を呼ぶ移行のやり直し) だけで、
67
- * 渡す描画が無ければ (確定する前に取り消した移行)、その呼び出しは何も描かず、何も通知しない。Suspense が移行を保留している間は、
68
- * React が確定のたびにその移行を描き直して捨て、ホストの描画中の呼び出しが同じ値を渡し直すため、写し・この記録・フックの知っている値は、
69
- * その移行が確定するか取り消されるまでその値に戻り続ける (シフトはそこから進み、その値と同じ確定経路の呼び出しは描かれず、通知もされない)。
70
- * 記録した更新を優先度が低いために飛ばした描画も記録を消すが、同じ値の受け渡しが呼び出し側の優先度で 1 度増えるだけである。
71
- * 事象の処理中に行った受け渡しは、当てられる前にキューから消えることがない。この書き込みは消すだけで、確定しない描画で行っても
72
- * 受け渡しが増えるだけであり、省く判断は生まない。
36
+ * @returns The count / 回数
37
+ */
38
+ get writes(): number;
39
+ /**
40
+ * Copies a committed render's value unless a write came after that render ran.
41
+ * 確定した描画の値の写し (その描画が走った後に書き込みがあれば写さない)。
73
42
  *
74
- * @param state - The state object this render pass holds (the useHookState value, before the render derives the re-placed value) / この描画が持つステートのオブジェクト (描画が収め直した値を導く前の useHookState の値)
43
+ * @param committed - The committed render's value / 確定した描画の値
44
+ * @param writesAtRender - `writes` as that render read it / その描画が読んだ `writes`
75
45
  * @returns Nothing / なし
76
46
  */
77
- forgetHandedUnless(state: T): void;
47
+ commit(committed: T, writesAtRender: number): void;
78
48
  }
79
49
  /**
80
- * Mirrors a value of the committed render into a ref that the functions a hook returns, or a component's own functions that outlive their render, read at event time.
81
- * 確定した描画の値を、フックの返す関数やコンポーネントの描画より長く生きる自分の関数が事象の時点で読む ref へ写すフック。
50
+ * Mirrors the value of each committed render into a holder that functions outliving their render read at event time: the one commit-copy rule that useCommittedRef and the hooks' state mirrors (useStateMirror in renderScope.ts) share.
51
+ * 確定した描画の値を、描画より長く生きる関数が事象の時点で読む入れ物へ写すフック (useCommittedRef とフックのステートの写し (renderScope.ts の useStateMirror) が共有する、ただ 1 つの写しの規則)。
82
52
  *
83
53
  * React runs a component body for renders it discards or leaves suspended (a transition waiting on Suspense, an
84
54
  * interrupted concurrent render), so the copy is made in the commit phase, as an insertion effect: React runs it before
85
55
  * every layout effect of the commit and also for commits inside a hidden Activity, so a descendant's layout effect and a
86
- * hidden tree read the commit they belong to. The returned functions may write the ref while handling an event (a setter
87
- * records the value it handed to the state); a commit copies its render's value only when no such write happened after
88
- * that render ran, because a time-sliced render can run before an event and commit after it with an older value. The ref
89
- * object keeps its identity for the life of the component, so a function that reads it keeps its own. While a render is
90
- * in progress the ref still holds the last committed value, not the value of that render. A state mirror also carries the
91
- * record of the object a returned function last handed to the state (CommittedRef.hand / holdsHanded), which the hook
92
- * body clears with CommittedRef.forgetHandedUnless right after this call, and the hook's record of its own re-placement
93
- * with CommittedRef.forgetHanded.
56
+ * hidden tree read the commit they belong to. The returned functions, and a component's own functions, may write the
57
+ * holder from any code outside render: an event handler, an effect or an effect's cleanup (a setter records the value
58
+ * it handed to the state). A commit copies its render's value only when no such write happened after that render ran,
59
+ * because a time-sliced render can run before a write and commit after it with an older value. The holder keeps its
60
+ * identity for the life of the component, so a function that reads it keeps its own. While a render is in progress the
61
+ * holder still holds the last committed value, not the value of that render.
94
62
  * React は捨てる描画や中断したままの描画 (Suspense を待つ移行、割り込まれた並行描画) でも本体を走らせるため、写しは確定の段階で
95
63
  * 挿入副作用として行う (確定のどのレイアウト副作用よりも前に、隠れた Activity の中の確定でも走る。子孫のレイアウト副作用も隠れた木も、
96
- * 自分が属する確定の値を読む)。返す関数は事象の処理中に ref へ書いてよく (設定関数はステートへ渡した値を記録する)、確定はその描画が
97
- * 走った後に書き込みが無かったときだけ、その描画の値を写す (時間分割した描画は事象の前に走って事象の後に確定することがあり、その値は
98
- * 書き込みより古い)。ref オブジェクトはコンポーネントの存続中ずっと同じで、それを読む関数の同一性も保たれる。描画の途中の ref は、
99
- * その描画の値ではなく最後に確定した値を持つ。ステートの写しは、返す関数が最後にステートへ渡したオブジェクトの記録も持ち
100
- * (CommittedRef.hand / holdsHanded)、フック本体はこの呼び出しの直後に CommittedRef.forgetHandedUnless で、フック自身の収め直しの記録は
101
- * CommittedRef.forgetHanded でそれを消す。
64
+ * 自分が属する確定の値を読む)。返す関数とコンポーネント自身の関数は、描画の外のどこからでも入れ物へ書いてよく (事象の処理・副作用と
65
+ * その後始末。設定関数はステートへ渡した値を記録する)、確定はその描画が走った後に書き込みが無かったときだけ、その描画の値を写す
66
+ * (時間分割した描画は書き込みの前に走って書き込みの後に確定することがあり、その値は書き込みより古い)。入れ物は
67
+ * コンポーネントの存続中ずっと同じで、それを読む関数の同一性も保たれる。描画の途中の入れ物は、その描画の値ではなく最後に確定した値を持つ。
68
+ *
69
+ * @param value - The value this render holds / この描画が持つ値
70
+ * @param create - Creates the holder with the first render's value / 最初の描画の値で入れ物を作る関数
71
+ * @returns The holder created on the first render, holding the value of the last committed render (the first render's value until the first commit), or a later value written outside render / 最初の描画で作った入れ物 (最後に確定した描画の値 (最初の確定までは最初の描画の値)、またはその後に描画の外で書かれた値を持つ)
72
+ */
73
+ export declare function useCommittedHolder<T, M extends CommittedMirror<T>>(value: T, create: (initial: T) => M): M;
74
+ /**
75
+ * Mirrors a value of the committed render into a ref that the functions a hook returns, or a component's own functions that outlive their render, read at event time.
76
+ * 確定した描画の値を、フックの返す関数やコンポーネントの描画より長く生きる自分の関数が事象の時点で読む ref へ写すフック。
77
+ *
78
+ * The copy follows useCommittedHolder: it is made from the commit, before any layout effect of that commit, and a write
79
+ * made outside render after the committing render ran is not overwritten. A state hook mirrors the states its returned
80
+ * functions hand values to with useStateMirror (renderScope.ts), whose render scope also keeps the hand-off records and
81
+ * confines a call made inside the hook's duringRender(action) to the render in progress; this ref serves the values
82
+ * nothing writes during a render (bounds, candidates, callbacks, selector-arrow destinations) and a component's own flags.
83
+ * 写しは useCommittedHolder に従う (確定から、その確定のどのレイアウト副作用よりも前に写し、確定する描画が走った後に描画の外で書いた値は上書きしない)。
84
+ * 状態フックは、返す関数が値を渡すステートを useStateMirror (renderScope.ts) で写す (その描画の範囲が受け渡しの記録も持ち、フックの
85
+ * duringRender(action) の中の呼び出しを進行中の描画に閉じ込める)。この ref は、描画中に誰も書かない値 (境界・候補・コールバック・◀▶ の行き先) と
86
+ * コンポーネント自身の旗を運ぶ。
102
87
  *
103
88
  * @param value - The value this render holds / この描画が持つ値
104
- * @returns A ref holding the value of the last committed render (the first render's value until the first commit), or a later value a returned function wrote, with the hand-off record (empty until a returned function hands an object) / 最後に確定した描画の値 (最初の確定までは最初の描画の値)、またはその後に返す関数が書いた値を持つ ref と、受け渡しの記録 (返す関数がオブジェクトを渡すまでは空)
89
+ * @returns A ref holding the value of the last committed render (the first render's value until the first commit), or a later value written outside render / 最後に確定した描画の値 (最初の確定までは最初の描画の値)、またはその後に描画の外で書かれた値を持つ ref
105
90
  */
106
- export declare function useCommittedRef<T>(value: T): CommittedRef<T>;
91
+ export declare function useCommittedRef<T>(value: T): React.RefObject<T>;
107
92
  //# sourceMappingURL=useCommittedRef.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCommittedRef.d.ts","sourceRoot":"","sources":["../src/useCommittedRef.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IACvD;;;;;;OAMG;IACH,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAA;IAEpB;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;IAE7B;;;;;;;;;OASG;IACH,YAAY,IAAI,IAAI,CAAA;IAEpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACH,kBAAkB,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAA;CACrC;AAoHD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAS5D"}
1
+ {"version":3,"file":"useCommittedRef.d.ts","sourceRoot":"","sources":["../src/useCommittedRef.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B;;;GAGG;AACH,qBAAa,eAAe,CAAC,CAAC,CAAE,YAAW,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IACzD,yBAAyB;IACzB,OAAO,CAAC,IAAI,CAAG;IAEf,wEAAwE;IACxE,OAAO,CAAC,UAAU,CAAI;IAEtB;;;;;OAKG;gBACS,OAAO,EAAE,CAAC;IAItB;;;;;OAKG;IACH,IAAI,OAAO,IAAI,CAAC,CAEf;IAED;;;;;OAKG;IACH,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,EAGlB;IAED;;;;;OAKG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,SAAS,EAAE,CAAC,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI;CAGrD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,CAAC,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAS1G;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAE/D"}
@@ -121,6 +121,8 @@ export interface UsePeriodSliderRangeReturn {
121
121
  endSelectorProps: SelectorProps;
122
122
  /** Pre-configured props to spread directly onto PeriodSlider / PeriodSlider に直接スプレッド可能な Props */
123
123
  sliderProps: PeriodSliderRangeProps;
124
+ /** Runs an action as part of the host's render in progress: the returned functions called synchronously inside it act on that render only, so their writes and notifications wait for its commit and a render React discards leaves nothing. Call it during the host's own render, after the hook call; every call outside an action acts at once. Keeps its identity for the life of the component. Throws an Error when called after the hook's render scope closed, that is after its render committed or after the synchronous run that ran the body ended (`usePeriodSliderRange: duringRender(action) must be called during the host's render, after the hook call (...)`), while a misuse it does not detect (a call from another component's render or from a microtask queued before the hook call) is unsupported, and a TypeError when action is not a function; inside an action, a returned function of another hook instance throws an Error (`usePeriodSliderRange: a returned function was called during another hook's duringRender(action); ...`) / 進行中のホストの描画の一部として動作を走らせる関数 (中で同期に呼んだ返す関数はその描画の中だけで働き、書き込みと通知はその確定を待ち、React が捨てた描画は何も残さない)。ホスト自身の描画の中、フックを呼んだ後で呼ぶ。動作の外の呼び出しはその場で働く。同一性はコンポーネントの存続中ずっと変わらない。フックの描画の範囲が閉じた後 (その描画の確定・本体を走らせた同期の実行の終わりの後) に呼ぶと Error (検出しない誤用 (ほかのコンポーネントの描画・フックを呼ぶ前に積んだマイクロタスクからの呼び出し) は対応外)、action が関数でなければ TypeError を送出し、動作の中ではほかのフックのインスタンスの返す関数が Error を送出 */
125
+ duringRender: (action: () => void) => void;
124
126
  }
125
127
  /**
126
128
  * Custom hook to manage state and props for a range PeriodSlider.
@@ -133,9 +135,13 @@ export interface UsePeriodSliderRangeReturn {
133
135
  * reported), so a range a render re-places is still reported by the next mutation that settles on it. `initialRange` is checked against the bounds at
134
136
  * mount only: the range given at mount is where `resetRange` goes (later changes to the option are validated but not
135
137
  * adopted), and moving the bounds past it re-places the state instead of throwing. The returned functions read the bounds, candidates,
136
- * callbacks and state of the last committed render (useCommittedRef), never those of a render that has not committed, and
138
+ * callbacks and state of the last committed render (useCommittedRef and useStateMirror), never those of a render that has not committed, and
137
139
  * every commit path leaves its value as the state's last update (it skips the hand-off only when the state's last update
138
- * already is that object), so the stored value ends equal to the last reported or written one.
140
+ * already is that object), so the stored value ends equal to the last reported or written one. A returned function the host
141
+ * calls inside `duringRender(action)` during its own render acts on that render only: its writes and its notification
142
+ * wait for that render's commit, and a render React discards leaves nothing (renderScope.ts). Every other call acts at once;
143
+ * calling a returned function directly during a render is unsupported, because React does not undo such a call when it
144
+ * discards the render.
139
145
  * Range モード PeriodSlider のステート管理と Props 生成を行うカスタムフック。
140
146
  * 選択期間は [minDate, maxDate] の外へ出ず、`allowedDates` がレールを離散にしている間はレールが描く候補の上に置かれる
141
147
  * (全ての更新と、マウントの初期値と、境界・候補が動いたときの収め直し。収め直しは描画が描き、その確定がレイアウト副作用で記録するため、
@@ -143,8 +149,11 @@ export interface UsePeriodSliderRangeReturn {
143
149
  * 利用側の知っている期間 (初期値・`setRange` で書いた値・最後に通知した値) と異なるときだけ発火するため、収め直した期間も、次にその値へ落ち着く
144
150
  * 更新で通知される。`initialRange` を境界と照らすのはマウント時だけで、以後はリセットの行き先でしかなく、境界が初期値を
145
151
  * 越えて動いても送出せずステートを収め直す。
146
- * 返す関数は最後に確定した描画の境界・候補・コールバック・ステートを読み (useCommittedRef)、確定していない描画のものは読まない。
152
+ * 返す関数は最後に確定した描画の境界・候補・コールバック・ステートを読み (useCommittedRef・useStateMirror)、確定していない描画のものは読まない。
147
153
  * 確定経路は値をステートの最後の更新として残し (最後の更新が既にそのオブジェクトであるときだけ渡すのを省く)、保存される値は最後に通知した値か書いた値と一致する。
154
+ * ホストが自分の描画の中の `duringRender(action)` で呼んだ返す関数はその描画の中だけで働き、書き込みと通知はその描画の確定を待ち、
155
+ * React が捨てた描画は何も残さない (renderScope.ts)。それ以外の呼び出しはその場で働く。描画中に返す関数を直接呼ぶのは非対応である
156
+ * (React が描画を捨ててもその呼び出しは取り消されない)。
148
157
  *
149
158
  * @param options - Required unit, boundaries and initial range plus optional UI props / 必須の単位・境界・初期期間と任意の UI Props
150
159
  * @returns Range state, mutators and pre-configured slider/selector props / 期間ステート・更新関数・生成済み Props 群
@@ -155,6 +164,8 @@ export interface UsePeriodSliderRangeReturn {
155
164
  * @throws {RangeError} When selectorStep is not a rule per direction, or a rule carries a key, motion or edge the hook does not read / selectorStep が向きごとの規則でない場合、規則がフックの読まないキー・動き・縁の扱いを持つ場合
156
165
  * @throws {RangeError} From the returned shiftRange when delta is not an integer, naming the hook and the function / 返り値の shiftRange へ整数でない delta を渡した場合 (フック名と関数名を名乗る)
157
166
  * @throws {RangeError} During render, naming this hook, when allowedDates is supplied but is not an array (`null` included), holds an entry that is not a valid Date, or is non-empty with no entry inside [minDate, maxDate] - the conditions the component itself rejects / 描画中に本フックを名乗って送出 (allowedDates が配列でない指定値 (`null` を含む)、有効な Date でない要素を含む、空でないのに要素が 1 つも [minDate, maxDate] に入らない場合。本体が拒否するのと同じ条件)
167
+ * @throws {Error} From the returned duringRender when called after the hook's render scope closed (its render committed, or the synchronous run that ran the body ended) (`usePeriodSliderRange: duringRender(action) must be called during the host's render, after the hook call (...)`), and from any returned function called inside another hook's duringRender(action) (`usePeriodSliderRange: a returned function was called during another hook's duringRender(action); ...`) / 返り値の duringRender をフックの描画の範囲が閉じた後 (その描画の確定・本体を走らせた同期の実行の終わりの後) に呼んだ場合、ほかのフックの duringRender(action) の中で返す関数を呼んだ場合
168
+ * @throws {TypeError} From the returned duringRender when action is not a function (`usePeriodSliderRange: duringRender(action) must be a function (received: ...)`) / 返り値の duringRender へ関数でない action を渡した場合
158
169
  *
159
170
  * @example
160
171
  * ```tsx
@@ -209,6 +220,8 @@ export interface UsePeriodSliderPointReturn {
209
220
  selectorProps: SelectorProps;
210
221
  /** Pre-configured props to spread directly onto PeriodSlider / PeriodSlider に直接スプレッド可能な Props */
211
222
  sliderProps: PeriodSliderPointProps;
223
+ /** Runs an action as part of the host's render in progress: the returned functions called synchronously inside it act on that render only, so their writes and notifications wait for its commit and a render React discards leaves nothing. Call it during the host's own render, after the hook call; every call outside an action acts at once. Keeps its identity for the life of the component. Throws an Error when called after the hook's render scope closed, that is after its render committed or after the synchronous run that ran the body ended (`usePeriodSliderPoint: duringRender(action) must be called during the host's render, after the hook call (...)`), while a misuse it does not detect (a call from another component's render or from a microtask queued before the hook call) is unsupported, and a TypeError when action is not a function; inside an action, a returned function of another hook instance throws an Error (`usePeriodSliderPoint: a returned function was called during another hook's duringRender(action); ...`) / 進行中のホストの描画の一部として動作を走らせる関数 (中で同期に呼んだ返す関数はその描画の中だけで働き、書き込みと通知はその確定を待ち、React が捨てた描画は何も残さない)。ホスト自身の描画の中、フックを呼んだ後で呼ぶ。動作の外の呼び出しはその場で働く。同一性はコンポーネントの存続中ずっと変わらない。フックの描画の範囲が閉じた後 (その描画の確定・本体を走らせた同期の実行の終わりの後) に呼ぶと Error (検出しない誤用 (ほかのコンポーネントの描画・フックを呼ぶ前に積んだマイクロタスクからの呼び出し) は対応外)、action が関数でなければ TypeError を送出し、動作の中ではほかのフックのインスタンスの返す関数が Error を送出 */
224
+ duringRender: (action: () => void) => void;
212
225
  }
213
226
  /**
214
227
  * Custom hook to manage state and props for a point PeriodSlider.
@@ -220,17 +233,24 @@ export interface UsePeriodSliderPointReturn {
220
233
  * differs from the one the consumer knows (the initial value, one written through `setValue`, or the last one
221
234
  * reported), so a date a render re-places is still reported by the next mutation that settles on it. `initialValue` is checked against the bounds at
222
235
  * mount only, like the range hook's `initialRange`. The returned functions read the bounds, candidates,
223
- * callbacks and state of the last committed render (useCommittedRef), never those of a render that has not committed, and
236
+ * callbacks and state of the last committed render (useCommittedRef and useStateMirror), never those of a render that has not committed, and
224
237
  * every commit path leaves its value as the state's last update (it skips the hand-off only when the state's last update
225
- * already is that object), so the stored value ends equal to the last reported or written one.
238
+ * already is that object), so the stored value ends equal to the last reported or written one. A returned function the host
239
+ * calls inside `duringRender(action)` during its own render acts on that render only: its writes and its notification
240
+ * wait for that render's commit, and a render React discards leaves nothing (renderScope.ts). Every other call acts at once;
241
+ * calling a returned function directly during a render is unsupported, because React does not undo such a call when it
242
+ * discards the render.
226
243
  * Point モード PeriodSlider のステート管理と Props 生成を行うカスタムフック。
227
244
  * 選択日付は [minDate, maxDate] の外へ出ず、`allowedDates` がレールを離散にしている間はレールが描く候補の上に置かれる
228
245
  * (全ての更新と、マウントの初期値と、境界・候補が動いたときの収め直し。収め直しは描画が描き、その確定がレイアウト副作用で記録するため、
229
246
  * どの描画もステートを書かない。隠れた Activity の中の確定は記録せず、表示したときにその描画の Props から記録する)。`onChangePoint` は
230
247
  * 利用側の知っている日付 (初期値・`setValue` で書いた値・最後に通知した値) と異なるときだけ発火するため、収め直した日付も、次にその値へ落ち着く
231
248
  * 更新で通知される。`initialValue` を境界と照らすのは、範囲フックの `initialRange` と同じくマウント時だけ。
232
- * 返す関数は最後に確定した描画の境界・候補・コールバック・ステートを読み (useCommittedRef)、確定していない描画のものは読まない。
249
+ * 返す関数は最後に確定した描画の境界・候補・コールバック・ステートを読み (useCommittedRef・useStateMirror)、確定していない描画のものは読まない。
233
250
  * 確定経路は値をステートの最後の更新として残し (最後の更新が既にそのオブジェクトであるときだけ渡すのを省く)、保存される値は最後に通知した値か書いた値と一致する。
251
+ * ホストが自分の描画の中の `duringRender(action)` で呼んだ返す関数はその描画の中だけで働き、書き込みと通知はその描画の確定を待ち、
252
+ * React が捨てた描画は何も残さない (renderScope.ts)。それ以外の呼び出しはその場で働く。描画中に返す関数を直接呼ぶのは非対応である
253
+ * (React が描画を捨ててもその呼び出しは取り消されない)。
234
254
  *
235
255
  * @param options - Required unit, boundaries and initial value plus optional UI props / 必須の単位・境界・初期日付と任意の UI Props
236
256
  * @returns Point state, mutators and pre-configured slider/selector props / 日付ステート・更新関数・生成済み Props 群
@@ -240,6 +260,8 @@ export interface UsePeriodSliderPointReturn {
240
260
  * @throws {RangeError} From the returned selectorProps.onChange and sliderProps.onChangePoint given an Invalid Date or a date whose unit starts outside the Date range, naming the hook and the entry point, and from the render after setValue wrote one (`value`) / 返り値の selectorProps.onChange・sliderProps.onChangePoint へ Invalid Date または単位の始まりが Date の表現範囲の外にある日付を渡した場合 (フック名と入口の名前を名乗る)、setValue でそれを書いた後の描画 (`value`)
241
261
  * @throws {RangeError} From the returned shiftValue when delta is not an integer, naming the hook and the function / 返り値の shiftValue へ整数でない delta を渡した場合 (フック名と関数名を名乗る)
242
262
  * @throws {RangeError} During render, naming this hook, when allowedDates is supplied but is not an array (`null` included), holds an entry that is not a valid Date, or is non-empty with no entry inside [minDate, maxDate] - the conditions the component itself rejects / 描画中に本フックを名乗って送出 (allowedDates が配列でない指定値 (`null` を含む)、有効な Date でない要素を含む、空でないのに要素が 1 つも [minDate, maxDate] に入らない場合。本体が拒否するのと同じ条件)
263
+ * @throws {Error} From the returned duringRender when called after the hook's render scope closed (its render committed, or the synchronous run that ran the body ended) (`usePeriodSliderPoint: duringRender(action) must be called during the host's render, after the hook call (...)`), and from any returned function called inside another hook's duringRender(action) (`usePeriodSliderPoint: a returned function was called during another hook's duringRender(action); ...`) / 返り値の duringRender をフックの描画の範囲が閉じた後 (その描画の確定・本体を走らせた同期の実行の終わりの後) に呼んだ場合、ほかのフックの duringRender(action) の中で返す関数を呼んだ場合
264
+ * @throws {TypeError} From the returned duringRender when action is not a function (`usePeriodSliderPoint: duringRender(action) must be a function (received: ...)`) / 返り値の duringRender へ関数でない action を渡した場合
243
265
  *
244
266
  * @example
245
267
  * ```tsx
@@ -325,6 +347,8 @@ export interface UseVernierSliderRangeReturn {
325
347
  microEndSelectorProps: SelectorProps;
326
348
  /** Pre-configured props to spread directly onto PeriodSlider / PeriodSlider に直接スプレッド可能な Props */
327
349
  sliderProps: PeriodSliderVernierRangeProps;
350
+ /** Runs an action as part of the host's render in progress: the returned functions called synchronously inside it act on that render only, so their writes and notifications wait for its commit and a render React discards leaves nothing. Call it during the host's own render, after the hook call; every call outside an action acts at once. Keeps its identity for the life of the component. Throws an Error when called after the hook's render scope closed, that is after its render committed or after the synchronous run that ran the body ended (`useVernierSliderRange: duringRender(action) must be called during the host's render, after the hook call (...)`), while a misuse it does not detect (a call from another component's render or from a microtask queued before the hook call) is unsupported, and a TypeError when action is not a function; inside an action, a returned function of another hook instance throws an Error (`useVernierSliderRange: a returned function was called during another hook's duringRender(action); ...`) / 進行中のホストの描画の一部として動作を走らせる関数 (中で同期に呼んだ返す関数はその描画の中だけで働き、書き込みと通知はその確定を待ち、React が捨てた描画は何も残さない)。ホスト自身の描画の中、フックを呼んだ後で呼ぶ。動作の外の呼び出しはその場で働く。同一性はコンポーネントの存続中ずっと変わらない。フックの描画の範囲が閉じた後 (その描画の確定・本体を走らせた同期の実行の終わりの後) に呼ぶと Error (検出しない誤用 (ほかのコンポーネントの描画・フックを呼ぶ前に積んだマイクロタスクからの呼び出し) は対応外)、action が関数でなければ TypeError を送出し、動作の中ではほかのフックのインスタンスの返す関数が Error を送出 */
351
+ duringRender: (action: () => void) => void;
328
352
  }
329
353
  /**
330
354
  * Custom hook to manage state and props for a Vernier dual-scale PeriodSlider.
@@ -339,15 +363,22 @@ export interface UseVernierSliderRangeReturn {
339
363
  * micro selection to the slider, which re-places it by the gesture's own rule and reports it once. A selection the
340
364
  * consumer has not been told about is reported together with the window only while it stays on the new window's rail,
341
365
  * so no value outside that window is ever reported. The returned functions read the bounds, candidates,
342
- * callbacks and state of the last committed render (useCommittedRef), never those of a render that has not committed, and
366
+ * callbacks and state of the last committed render (useCommittedRef and useStateMirror), never those of a render that has not committed, and
343
367
  * every commit path leaves its value as the state's last update (it skips the hand-off only when the state's last update
344
- * already is that object), so the stored value ends equal to the last reported or written one.
368
+ * already is that object), so the stored value ends equal to the last reported or written one. A returned function the host
369
+ * calls inside `duringRender(action)` during its own render acts on that render only: its writes and its notification
370
+ * wait for that render's commit, and a render React discards leaves nothing (renderScope.ts). Every other call acts at once;
371
+ * calling a returned function directly during a render is unsupported, because React does not undo such a call when it
372
+ * discards the render.
345
373
  * Vernier 2 段スケール PeriodSlider のステート管理と Props 生成を行うカスタムフック。
346
374
  * ミクロの包含はミクロレールの単位で判定し、窓の端の単位の途中にあるミクロ日付はそのまま残す (離散のミクロレールでは窓が含む候補の上へ置く)。
347
375
  * マクロ窓は時刻で [minDate, maxDate] へ収める。
348
376
  * スライダー本体がマクロ窓を動かしたとき、フックは窓だけを記録し、ミクロ選択は操作ごとの規則で置き直す本体の通知 (1 度) に任せる。
349
- * 返す関数は最後に確定した描画の境界・候補・コールバック・ステートを読み (useCommittedRef)、確定していない描画のものは読まない。
377
+ * 返す関数は最後に確定した描画の境界・候補・コールバック・ステートを読み (useCommittedRef・useStateMirror)、確定していない描画のものは読まない。
350
378
  * 確定経路は値をステートの最後の更新として残し (最後の更新が既にそのオブジェクトであるときだけ渡すのを省く)、保存される値は最後に通知した値か書いた値と一致する。
379
+ * ホストが自分の描画の中の `duringRender(action)` で呼んだ返す関数はその描画の中だけで働き、書き込みと通知はその描画の確定を待ち、
380
+ * React が捨てた描画は何も残さない (renderScope.ts)。それ以外の呼び出しはその場で働く。描画中に返す関数を直接呼ぶのは非対応である
381
+ * (React が描画を捨ててもその呼び出しは取り消されない)。
351
382
  *
352
383
  * @param options - Required unit, boundaries, initial macro/micro ranges plus optional UI props / 必須の単位・境界・初期マクロ/ミクロ期間と任意の UI Props
353
384
  * @returns Dual-scale state, mutators and pre-configured slider/selector props / 2 段スケールのステート・更新関数・生成済み Props 群
@@ -357,6 +388,8 @@ export interface UseVernierSliderRangeReturn {
357
388
  * @throws {RangeError} On every render, when minDate falls in a unit that starts outside the Date range at macroUnit, microUnit or `unit` (the unit forwarded to the slider, which derives its shared flat values at it), with the remedy and the first failing unit named (`useVernierSliderRange: minDate must fall in a month that starts inside the Date range (received: ...); minDate is required, so pass the earliest date to offer instead of a sentinel for "no bound"`), or when initialMacroRange / a macroRange written through setMacroRange (at macroUnit) or initialMicroRange / a microRange written through its setter (at microUnit) holds such a date / 毎描画、macroUnit・microUnit・`unit` (スライダーへ渡す単位。スライダーは共有の平坦な値をこの単位で作る) のいずれかで minDate の単位の始まりが Date の表現範囲の外にある場合 (救済と最初に外れた単位を名乗る)、initialMacroRange・setMacroRange で書いた窓 (macroUnit)、initialMicroRange・設定関数で書いた microRange (microUnit) がそうした日付を含む場合
358
389
  * @throws {RangeError} From the returned functions: a setter or a sliderProps callback given an Invalid Date or a date whose unit (macroUnit for the macro entry points, microUnit for the micro ones) starts outside the Date range, or a shift function given a non-integer delta, each naming the hook and the function / 返り値の関数から: 設定関数・sliderProps のコールバックへの Invalid Date または単位 (マクロの入口は macroUnit、ミクロの入口は microUnit) の始まりが Date の表現範囲の外にある日付、シフト関数への整数でない delta (いずれもフック名と関数名を名乗る)
359
390
  * @throws {RangeError} During render, naming this hook and the list the row read (`microAllowedDates`, or `allowedDates (inherited by the micro row)` for a row that omits its own list), when the list of a row whose rail is discrete is supplied but is not an array (`null` included), holds an entry that is not a valid Date, or has no entry inside [minDate, maxDate] - the conditions the component itself rejects / 描画中に本フックと行が読んだ一覧 (`microAllowedDates`、自分の一覧を省略した行なら `allowedDates (inherited by the micro row)`) を名乗って送出 (離散のレールの行の一覧が配列でない指定値 (`null` を含む)、有効な Date でない要素を含む、要素が 1 つも [minDate, maxDate] に入らない場合。本体が拒否するのと同じ条件)
391
+ * @throws {Error} From the returned duringRender when called after the hook's render scope closed (its render committed, or the synchronous run that ran the body ended) (`useVernierSliderRange: duringRender(action) must be called during the host's render, after the hook call (...)`), and from any returned function called inside another hook's duringRender(action) (`useVernierSliderRange: a returned function was called during another hook's duringRender(action); ...`) / 返り値の duringRender をフックの描画の範囲が閉じた後 (その描画の確定・本体を走らせた同期の実行の終わりの後) に呼んだ場合、ほかのフックの duringRender(action) の中で返す関数を呼んだ場合
392
+ * @throws {TypeError} From the returned duringRender when action is not a function (`useVernierSliderRange: duringRender(action) must be a function (received: ...)`) / 返り値の duringRender へ関数でない action を渡した場合
360
393
  *
361
394
  * @example
362
395
  * ```tsx
@@ -436,6 +469,8 @@ export interface UseVernierSliderPointReturn {
436
469
  microSelectorProps: SelectorProps;
437
470
  /** Pre-configured props to spread directly onto PeriodSlider / PeriodSlider に直接スプレッド可能な Props */
438
471
  sliderProps: PeriodSliderVernierPointProps;
472
+ /** Runs an action as part of the host's render in progress: the returned functions called synchronously inside it act on that render only, so their writes and notifications wait for its commit and a render React discards leaves nothing. Call it during the host's own render, after the hook call; every call outside an action acts at once. Keeps its identity for the life of the component. Throws an Error when called after the hook's render scope closed, that is after its render committed or after the synchronous run that ran the body ended (`useVernierSliderPoint: duringRender(action) must be called during the host's render, after the hook call (...)`), while a misuse it does not detect (a call from another component's render or from a microtask queued before the hook call) is unsupported, and a TypeError when action is not a function; inside an action, a returned function of another hook instance throws an Error (`useVernierSliderPoint: a returned function was called during another hook's duringRender(action); ...`) / 進行中のホストの描画の一部として動作を走らせる関数 (中で同期に呼んだ返す関数はその描画の中だけで働き、書き込みと通知はその確定を待ち、React が捨てた描画は何も残さない)。ホスト自身の描画の中、フックを呼んだ後で呼ぶ。動作の外の呼び出しはその場で働く。同一性はコンポーネントの存続中ずっと変わらない。フックの描画の範囲が閉じた後 (その描画の確定・本体を走らせた同期の実行の終わりの後) に呼ぶと Error (検出しない誤用 (ほかのコンポーネントの描画・フックを呼ぶ前に積んだマイクロタスクからの呼び出し) は対応外)、action が関数でなければ TypeError を送出し、動作の中ではほかのフックのインスタンスの返す関数が Error を送出 */
473
+ duringRender: (action: () => void) => void;
439
474
  }
440
475
  /**
441
476
  * Custom hook to manage state and props for a Vernier dual-scale PeriodSlider whose micro rail selects one point.
@@ -449,15 +484,22 @@ export interface UseVernierSliderPointReturn {
449
484
  * macro window, the hook records the window only and leaves the point to the slider, which re-places it by the
450
485
  * gesture's own rule (macro-connect translates it) and reports it once. A point the consumer has not been told about
451
486
  * is reported together with the window only while it stays on the new window's rail. The returned functions read the bounds, candidates,
452
- * callbacks and state of the last committed render (useCommittedRef), never those of a render that has not committed, and
487
+ * callbacks and state of the last committed render (useCommittedRef and useStateMirror), never those of a render that has not committed, and
453
488
  * every commit path leaves its value as the state's last update (it skips the hand-off only when the state's last update
454
- * already is that object), so the stored value ends equal to the last reported or written one.
489
+ * already is that object), so the stored value ends equal to the last reported or written one. A returned function the host
490
+ * calls inside `duringRender(action)` during its own render acts on that render only: its writes and its notification
491
+ * wait for that render's commit, and a render React discards leaves nothing (renderScope.ts). Every other call acts at once;
492
+ * calling a returned function directly during a render is unsupported, because React does not undo such a call when it
493
+ * discards the render.
455
494
  * ミクロレールが時点を選ぶノギス 2 段スケール PeriodSlider のステート管理と Props 生成を行うカスタムフック。
456
495
  * ミクロの包含はミクロレールの単位で判定し、窓の端の単位の途中にある時点はそのまま残す (離散のミクロレールでは窓が含む候補の上へ置く)。
457
496
  * マクロ窓は時刻で [minDate, maxDate] へ収める。
458
497
  * スライダー本体がマクロ窓を動かしたとき、フックは窓だけを記録し、時点は操作ごとの規則 (macro-connect では平行移動) で置き直す本体の通知 (1 度) に任せる。
459
- * 返す関数は最後に確定した描画の境界・候補・コールバック・ステートを読み (useCommittedRef)、確定していない描画のものは読まない。
498
+ * 返す関数は最後に確定した描画の境界・候補・コールバック・ステートを読み (useCommittedRef・useStateMirror)、確定していない描画のものは読まない。
460
499
  * 確定経路は値をステートの最後の更新として残し (最後の更新が既にそのオブジェクトであるときだけ渡すのを省く)、保存される値は最後に通知した値か書いた値と一致する。
500
+ * ホストが自分の描画の中の `duringRender(action)` で呼んだ返す関数はその描画の中だけで働き、書き込みと通知はその描画の確定を待ち、
501
+ * React が捨てた描画は何も残さない (renderScope.ts)。それ以外の呼び出しはその場で働く。描画中に返す関数を直接呼ぶのは非対応である
502
+ * (React が描画を捨ててもその呼び出しは取り消されない)。
461
503
  *
462
504
  * @param options - Required unit, boundaries, initial macro window and micro point plus optional UI props / 必須の単位・境界・初期マクロ窓/ミクロ時点と任意の UI Props
463
505
  * @returns Dual-scale state, mutators and pre-configured slider/selector props / 2 段スケールのステート・更新関数・生成済み Props 群
@@ -467,6 +509,8 @@ export interface UseVernierSliderPointReturn {
467
509
  * @throws {RangeError} On every render, when minDate falls in a unit that starts outside the Date range at macroUnit, microUnit or `unit` (the unit forwarded to the slider, which derives its shared flat values at it), with the remedy and the first failing unit named (`useVernierSliderPoint: minDate must fall in a month that starts inside the Date range (received: ...); minDate is required, so pass the earliest date to offer instead of a sentinel for "no bound"`), or when initialMacroRange / a macroRange written through setMacroRange (at macroUnit) or initialMicroValue / a microValue written through its setter (at microUnit) holds such a date / 毎描画、macroUnit・microUnit・`unit` (スライダーへ渡す単位。スライダーは共有の平坦な値をこの単位で作る) のいずれかで minDate の単位の始まりが Date の表現範囲の外にある場合 (救済と最初に外れた単位を名乗る)、initialMacroRange・setMacroRange で書いた窓 (macroUnit)、initialMicroValue・設定関数で書いた microValue (microUnit) がそうした日付を含む場合
468
510
  * @throws {RangeError} From the returned functions: a setter or a sliderProps callback given an Invalid Date or a date whose unit (macroUnit for the macro entry points, microUnit for the micro ones) starts outside the Date range, or a shift function given a non-integer delta, each naming the hook and the function / 返り値の関数から: 設定関数・sliderProps のコールバックへの Invalid Date または単位 (マクロの入口は macroUnit、ミクロの入口は microUnit) の始まりが Date の表現範囲の外にある日付、シフト関数への整数でない delta (いずれもフック名と関数名を名乗る)
469
511
  * @throws {RangeError} During render, naming this hook and the list the row read (`microAllowedDates`, or `allowedDates (inherited by the micro row)` for a row that omits its own list), when the list of a row whose rail is discrete is supplied but is not an array (`null` included), holds an entry that is not a valid Date, or has no entry inside [minDate, maxDate] - the conditions the component itself rejects / 描画中に本フックと行が読んだ一覧 (`microAllowedDates`、自分の一覧を省略した行なら `allowedDates (inherited by the micro row)`) を名乗って送出 (離散のレールの行の一覧が配列でない指定値 (`null` を含む)、有効な Date でない要素を含む、要素が 1 つも [minDate, maxDate] に入らない場合。本体が拒否するのと同じ条件)
512
+ * @throws {Error} From the returned duringRender when called after the hook's render scope closed (its render committed, or the synchronous run that ran the body ended) (`useVernierSliderPoint: duringRender(action) must be called during the host's render, after the hook call (...)`), and from any returned function called inside another hook's duringRender(action) (`useVernierSliderPoint: a returned function was called during another hook's duringRender(action); ...`) / 返り値の duringRender をフックの描画の範囲が閉じた後 (その描画の確定・本体を走らせた同期の実行の終わりの後) に呼んだ場合、ほかのフックの duringRender(action) の中で返す関数を呼んだ場合
513
+ * @throws {TypeError} From the returned duringRender when action is not a function (`useVernierSliderPoint: duringRender(action) must be a function (received: ...)`) / 返り値の duringRender へ関数でない action を渡した場合
470
514
  *
471
515
  * @example
472
516
  * ```tsx
@@ -1 +1 @@
1
- {"version":3,"file":"usePeriodSlider.d.ts","sourceRoot":"","sources":["../src/usePeriodSlider.ts"],"names":[],"m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AC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;IACjE,qCAAqC;IACrC,UAAU,EAAE,IAAI,CAAA;IAChB,wMAAwM;IACxM,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAA;IACzD,mLAAmL;IACnL,iBAAiB,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IACvC,mLAAmL;IACnL,iBAAiB,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IACvC,kRAAkR;IAClR,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAClC,ghBAAghB;IAChhB,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,ugBAAugB;IACvgB,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,oEAAoE;IACpE,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,wEAAwE;IACxE,uBAAuB,EAAE,aAAa,CAAA;IACtC,sEAAsE;IACtE,qBAAqB,EAAE,aAAa,CAAA;IACpC,iIAAiI;IACjI,kBAAkB,EAAE,aAAa,CAAA;IACjC,iGAAiG;IACjG,WAAW,EAAE,6BAA6B,CAAA;IAC1C,u1CAAu1C;IACv1C,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,IAAI,KAAK,IAAI,CAAA;CAC7C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,4BAA4B,GAAG,2BAA2B,CAkcxG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiquants/period-slider",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "description": "Customizable period slider and year/month/date selectors for React",
5
5
  "sideEffects": [
6
6
  "**/*.css"
@@ -302,6 +302,16 @@ const clampActiveIndex = (index: number, count: number): number => (index < coun
302
302
  * (その描画がステートを読んだ後に積まれた移動は上書きしない)。操作要素の 2 つの IDREF は DOM に在る要素だけを指す。`aria-controls` は
303
303
  * ポップアップを描くのと同じ条件で listbox を名乗り、`aria-activedescendant` は Props ではなく、アクティブ行の ref が行を付けた確定で書き、
304
304
  * 書いた操作要素を持つ後始末が行を外す確定 (Activity・Suspense による退避を含む) で消す。
305
+ *
306
+ * Hiding the owner (a hidden Activity, or Suspense showing its fallback) closes the popup. React hides only the top-most host
307
+ * nodes of the hidden boundary and never reaches a portal below one, so the popup root's ref cleanup, which React runs in the
308
+ * hide commit, takes the root off screen with the same inline `display: none !important`, and the cleanup of a layout effect
309
+ * React runs on hide calls the close path while the open flag is set. open and close write that flag when they are called and
310
+ * every commit copies it, so an open queued in the same batch as the hide is closed too. The reveal shows a closed combobox.
311
+ * 所有側が隠れると (隠れた Activity、フォールバックを出した Suspense) ポップアップは閉じる。React が隠すのは境界の中の最上位のホスト要素だけで
312
+ * その下のポータルへは届かないため、隠す確定で React が走らせるポップアップの根の ref の後始末が同じインラインの `display: none !important` で
313
+ * 根を画面から外し、隠すときに React が走らせるレイアウト副作用の後始末が、開いている旗が立っていれば閉じる経路を呼ぶ。旗は open と close が
314
+ * 呼ばれた時点で書き、確定のたびに写すため、隠す更新と同じ一括で積まれた開く更新も閉じる。表示し直した操作要素は閉じている。
305
315
  */
306
316
  export const VirtualDateDropdown: React.FC<VirtualDateDropdownProps> = ({ domain, selectedIndex, openAnchorIndex, displayLabel, machineValue, disabled, ariaLabel, locale, labels, onCommitIndex, controlClassName }) => {
307
317
  const reactId = useId()
@@ -344,19 +354,34 @@ export const VirtualDateDropdown: React.FC<VirtualDateDropdownProps> = ({ domain
344
354
  setGeometry(resolvePopupGeometry(rect, desiredHeight, window.innerHeight, window.innerWidth))
345
355
  }, [desiredHeight])
346
356
 
357
+ // 開いているかは確定した描画が写すだけでなく、open と close が呼ばれた時点でも書く。確定した値だけを読むと、所有側を隠す更新と
358
+ // 同じ一括で積まれた開く更新を隠す確定が見落とし、隠れた木の描画がそれを開いたまま描いて、表示し直すと一覧が開いて出る
359
+ const isOpenRef = useCommittedRef(isOpen)
347
360
  const close = useCallback((): void => {
348
361
  setIsOpen(false)
349
362
  setActiveIndex(NO_OPTION_INDEX)
350
363
  typeAheadRef.current = { buffer: "", at: 0 }
351
- }, [])
364
+ isOpenRef.current = false
365
+ }, [isOpenRef])
366
+
367
+ // 隠れた操作要素はフォーカスを保てず (ブラウザは次の描画更新で外す)、表示し直しても React はフォーカスを戻さない。開いたまま戻すと、キーボードの届かない一覧が
368
+ // aria-expanded="true" のまま残る (ネイティブの <select> も描かれなくなると一覧を閉じ、自分からは開き直さない)。依存配列は変わらないため、
369
+ // 後始末が走るのは隠す確定 (Activity・Suspense)、アンマウント、StrictMode の付け外し (マウント時と表示し直した時) だけ。閉じたまま隠しても更新を積まない
370
+ useLayoutEffect(
371
+ () => () => {
372
+ if (isOpenRef.current) close()
373
+ },
374
+ [isOpenRef, close],
375
+ )
352
376
 
353
377
  const open = useCallback(
354
378
  (initialActive: number): void => {
355
379
  if (disabled || count === 0) return
356
380
  setActiveIndex(initialActive)
357
381
  setIsOpen(true)
382
+ isOpenRef.current = true
358
383
  },
359
- [disabled, count],
384
+ [disabled, count, isOpenRef],
360
385
  )
361
386
 
362
387
  // 開いた時点の矩形で配置を決め、ページのスクロールとリサイズに追従する。
@@ -428,8 +453,18 @@ export const VirtualDateDropdown: React.FC<VirtualDateDropdownProps> = ({ domain
428
453
  // 閉包の確定経路を呼ぶと、行を描いた後に所有側が渡し直したコールバックを読み落とす
429
454
  const commitRef = useCommittedRef(commit)
430
455
 
456
+ /**
457
+ * Handles a key pressed on the combobox control; does nothing while the control is disabled or while its owner hides it (the control's ref is detached).
458
+ * 操作要素で押されたキーの処理。無効な間と、所有側が隠して操作要素の ref が外れている間は何もしない関数。
459
+ *
460
+ * @param event - Key event React dispatched to the control / React が操作要素へ配った打鍵の事象
461
+ */
431
462
  const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {
432
- if (disabled) return
463
+ // 所有側 (Activity・Suspense) が隠している間、React は操作要素の ref を外している。ブラウザが隠れた要素からフォーカスを外すのは
464
+ // 次の描画更新のときで、それまでの入力は隠れた操作要素へ届く。受けると隠れた木で一覧を開き直し (Activity では配置を片付ける
465
+ // 副作用が走らず、隠す前の配置でポップアップが画面に出る)、Enter で onChange を呼び、表示し直すと開いたまま現れる。
466
+ // ref は確定のレイアウトの段階で付くため、画面に在る操作要素への入力は捨てない
467
+ if (disabled || controlRef.current === null) return
433
468
  // 集合の外の保持値でも先頭行から始めない。開く位置は保持値の近さで決まる
434
469
  const anchor = activeIndex !== NO_OPTION_INDEX ? activeIndex : selectedIndex !== NO_OPTION_INDEX ? selectedIndex : openAnchorIndex
435
470
 
@@ -516,7 +551,7 @@ export const VirtualDateDropdown: React.FC<VirtualDateDropdownProps> = ({ domain
516
551
  // aria-activedescendant は DOM に在る行しか指せない (WAI-ARIA)。どの行が DOM に在るかはスクローラが自分の状態で決め、描画範囲の通知は
517
552
  // 確定より後のアニメーションフレームで届くため、通知から導くと窓を動かした確定が消えた行を指し、戻した確定が名指しを欠く。そこで属性は
518
553
  // Props として描かず、アクティブ行の ref が行を付けた確定で書き、行を外す確定で返した後始末が消す。後始末は付けた時点の操作要素を閉包に持つ。
519
- // 隠れた Activity・Suspense が退避するときは操作要素の ref が行より先に外れ、外す時点で ref を読むと消し損ねて、隠れている間に閉じた
554
+ // 隠れた Activity・Suspense が退避するときは操作要素の ref が行より先に外れ、外す時点で ref を読むと消し損ねて、隠すと閉じる
520
555
  // ポップアップの消えた行を表示後も指し続ける。外す処理 (変更の段階) は付ける処理 (レイアウトの段階) より先に走り、消すのは自分が書いた値の
521
556
  // ときだけなので、次のアクティブ行の名指しは消さない
522
557
  const activeOptionId = activeIndex === NO_OPTION_INDEX ? null : optionId(activeIndex)
@@ -566,6 +601,25 @@ export const VirtualDateDropdown: React.FC<VirtualDateDropdownProps> = ({ domain
566
601
  [domain, selectedIndex, activeIndex, optionId, commitRef, nameActiveRow],
567
602
  )
568
603
 
604
+ /**
605
+ * Ref of the popup root: keeps the root off screen while it is detached, the way React hides the control.
606
+ * ポップアップの根の ref。根が外れている間、React が操作要素を隠すのと同じ方法で根を画面から外す関数。
607
+ *
608
+ * @param popup - Popup root React attaches / React が付けるポップアップの根
609
+ * @returns Cleanup React runs when the root detaches (deleted, or hidden by Activity / Suspense); hides it with inline `display: none !important` / 根が外れるとき (削除、または Activity / Suspense による退避) に React が呼ぶ後始末。インラインの `display: none !important` で隠す
610
+ */
611
+ const attachPopup = useCallback((popup: HTMLDivElement): (() => void) => {
612
+ popupRef.current = popup
613
+ // StrictMode の付け外しで、外した時の非表示を戻す。表示し直す前に必ず閉じるため、表示し直しで付け直すことは無い。ポップアップの style Props は display を持たない
614
+ popup.style.removeProperty("display")
615
+ return () => {
616
+ popupRef.current = null
617
+ // React が隠すのは境界の中の最上位のホスト要素だけで、その下のポータルは辿らない。閉じる更新は隠れた木の中で後から描かれ
618
+ // (Suspense では表示し直す確定まで描かれない)、それまでの確定でポップアップが操作要素なしに画面へ残らないよう、同じ指定で隠す
619
+ popup.style.setProperty("display", "none", "important")
620
+ }
621
+ }, [])
622
+
569
623
  // 配置と配色モードはどちらも操作要素の実測から来る。片方だけで描くと、最初のフレームだけ
570
624
  // 明色のポップアップが暗色のページに載る。listbox を描く条件はこの 1 つで、aria-controls も同じ条件で名乗る。
571
625
  // 開いている (isOpen) だけで名乗ると、配置の実測前の最初の確定と、件数 0 で閉じる前の確定で、存在しない listbox を指す
@@ -573,7 +627,7 @@ export const VirtualDateDropdown: React.FC<VirtualDateDropdownProps> = ({ domain
573
627
  const popup = isPopupShown ? (
574
628
  // biome-ignore lint/a11y/noStaticElementInteractions: ポップアップの外枠が拾うのは「フォーカスを奪わせない」ための mousedown 抑止だけで、操作機能は持たない。操作は内側の role="option" と操作要素が担う
575
629
  <div
576
- ref={popupRef}
630
+ ref={attachPopup}
577
631
  className="period-slider-date-popup"
578
632
  data-testid="period-slider-date-popup"
579
633
  data-color-mode={colorMode}
@@ -646,7 +700,8 @@ export const VirtualDateDropdown: React.FC<VirtualDateDropdownProps> = ({ domain
646
700
  data-value={machineValue}
647
701
  onKeyDown={handleKeyDown}
648
702
  onMouseDown={(event) => {
649
- if (disabled) return
703
+ // 隠れている間の押下を捨てる理由は handleKeyDown と同じ
704
+ if (disabled || controlRef.current === null) return
650
705
  // 押下で開閉を切り替える (ネイティブ <select> と同じ)。既定動作を止めるのは
651
706
  // 読み取り専用入力のテキスト選択を始めさせないため
652
707
  event.preventDefault()