@aiquants/resize-panels 2.0.0 → 2.0.1

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 (64) hide show
  1. package/dist/GlobalDebugOverlay.d.ts +4 -0
  2. package/dist/Panel.d.ts +13 -0
  3. package/dist/{src/PanelDebugInfo.d.ts → PanelDebugInfo.d.ts} +2 -14
  4. package/dist/PanelGroup.d.ts +2 -0
  5. package/dist/PanelResizeHandle.d.ts +2 -0
  6. package/dist/allocateLayout.d.ts +12 -0
  7. package/dist/context.d.ts +3 -0
  8. package/dist/debugOverlayStore.d.ts +32 -0
  9. package/dist/{src/hooks.d.ts → hooks.d.ts} +8 -23
  10. package/dist/index.d.ts +13 -2
  11. package/dist/reducer.d.ts +8 -0
  12. package/dist/roundHalfToEven.d.ts +1 -0
  13. package/dist/types.d.ts +183 -0
  14. package/dist/utils/simple-logger.d.ts +37 -0
  15. package/dist/utils.d.ts +16 -0
  16. package/package.json +2 -3
  17. package/dist/src/GlobalDebugOverlay.d.ts +0 -21
  18. package/dist/src/GlobalDebugOverlay.d.ts.map +0 -1
  19. package/dist/src/Panel.d.ts +0 -46
  20. package/dist/src/Panel.d.ts.map +0 -1
  21. package/dist/src/PanelDebugInfo.d.ts.map +0 -1
  22. package/dist/src/PanelGroup.d.ts +0 -7
  23. package/dist/src/PanelGroup.d.ts.map +0 -1
  24. package/dist/src/PanelResizeHandle.d.ts +0 -7
  25. package/dist/src/PanelResizeHandle.d.ts.map +0 -1
  26. package/dist/src/allocateLayout.d.ts +0 -60
  27. package/dist/src/allocateLayout.d.ts.map +0 -1
  28. package/dist/src/context.d.ts +0 -12
  29. package/dist/src/context.d.ts.map +0 -1
  30. package/dist/src/debugOverlayStore.d.ts +0 -69
  31. package/dist/src/debugOverlayStore.d.ts.map +0 -1
  32. package/dist/src/hooks.d.ts.map +0 -1
  33. package/dist/src/index.d.ts +0 -32
  34. package/dist/src/index.d.ts.map +0 -1
  35. package/dist/src/reducer.d.ts +0 -49
  36. package/dist/src/reducer.d.ts.map +0 -1
  37. package/dist/src/roundHalfToEven.d.ts +0 -10
  38. package/dist/src/roundHalfToEven.d.ts.map +0 -1
  39. package/dist/src/types.d.ts +0 -481
  40. package/dist/src/types.d.ts.map +0 -1
  41. package/dist/src/utils/simple-logger.d.ts +0 -111
  42. package/dist/src/utils/simple-logger.d.ts.map +0 -1
  43. package/dist/src/utils.d.ts +0 -164
  44. package/dist/src/utils.d.ts.map +0 -1
  45. package/dist/tests/support/dom-harness.d.ts +0 -89
  46. package/dist/tests/support/dom-harness.d.ts.map +0 -1
  47. package/src/GlobalDebugOverlay.tsx +0 -284
  48. package/src/Panel.tsx +0 -297
  49. package/src/PanelDebugInfo.tsx +0 -94
  50. package/src/PanelGroup.tsx +0 -245
  51. package/src/PanelResizeHandle.tsx +0 -758
  52. package/src/allocateLayout.ts +0 -412
  53. package/src/context.ts +0 -25
  54. package/src/debugOverlayStore.ts +0 -355
  55. package/src/hooks.ts +0 -376
  56. package/src/index.ts +0 -93
  57. package/src/reducer.ts +0 -472
  58. package/src/roundHalfToEven.ts +0 -40
  59. package/src/styles/components.entry.css +0 -10
  60. package/src/styles/resize-panels.css +0 -1
  61. package/src/styles/standalone.entry.css +0 -12
  62. package/src/types.ts +0 -505
  63. package/src/utils/simple-logger.ts +0 -186
  64. package/src/utils.ts +0 -320
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAErD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,wDAAqD,CAAA;AAEnF;;;GAGG;AACH,eAAO,MAAM,aAAa,8BAMzB,CAAA"}
@@ -1,69 +0,0 @@
1
- import { ContainerSize, PanelDirection, PanelLayoutData, ResizeHandleLayoutData } from './types';
2
- /**
3
- * Panel layout data enriched with the DOM measurement the overlay compares it against.
4
- * オーバーレイが突き合わせる DOM 実測値を添えたパネルレイアウトデータ。
5
- */
6
- export type DebugPanelSnapshot = PanelLayoutData & {
7
- measuredPixelSize?: number;
8
- measuredPercentageSize?: number;
9
- };
10
- /**
11
- * Snapshot of the debug overlay state across panel groups.
12
- * デバッグオーバーレイのスナップショット状態を表す構造体。
13
- */
14
- export type DebugOverlaySnapshot = {
15
- ownerId: string | null;
16
- groups: DebugGroupState[];
17
- };
18
- /**
19
- * Aggregated state for a panel group tracked by the debug overlay.
20
- * デバッグオーバーレイが追跡するパネルグループの集約状態。
21
- */
22
- export type DebugGroupState = {
23
- groupId: string;
24
- displayName: string;
25
- direction: PanelDirection;
26
- containerSize: ContainerSize;
27
- panels: DebugPanelSnapshot[];
28
- handles: ResizeHandleLayoutData[];
29
- index: number;
30
- };
31
- type DebugGroupUpdate = {
32
- displayName: string;
33
- direction: PanelDirection;
34
- containerSize: ContainerSize;
35
- panels: DebugPanelSnapshot[];
36
- handles: ResizeHandleLayoutData[];
37
- };
38
- /**
39
- * Subscribe to the identifier of the panel group that renders the overlay.
40
- * オーバーレイを描画するパネルグループ識別子を購読するフック。
41
- */
42
- export declare const useDebugOverlayOwnerId: () => string | null;
43
- /**
44
- * Subscribe to the aggregate debug overlay snapshot.
45
- * 集約されたデバッグオーバーレイのスナップショットを購読するフック。
46
- */
47
- export declare const useDebugOverlaySnapshot: () => DebugOverlaySnapshot;
48
- /**
49
- * Enable a panel group for inclusion in the debug overlay.
50
- * デバッグオーバーレイへの取り込み対象としてパネルグループを有効化するメソッド。
51
- */
52
- export declare const enableDebugOverlayGroup: (groupId: string) => void;
53
- /**
54
- * Disable a panel group from the debug overlay without erasing cached data.
55
- * キャッシュを保持したままパネルグループをデバッグオーバーレイ対象から外すメソッド。
56
- */
57
- export declare const disableDebugOverlayGroup: (groupId: string) => void;
58
- /**
59
- * Persist the latest panel group measurements into the debug overlay store.
60
- * 最新のパネルグループ測定値をデバッグオーバーレイストアに保存するメソッド。
61
- */
62
- export declare const updateDebugOverlayGroup: (groupId: string, update: DebugGroupUpdate) => void;
63
- /**
64
- * Remove a panel group from the debug overlay store entirely.
65
- * パネルグループをデバッグオーバーレイストアから完全に削除するメソッド。
66
- */
67
- export declare const removeDebugOverlayGroup: (groupId: string) => void;
68
- export {};
69
- //# sourceMappingURL=debugOverlayStore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"debugOverlayStore.d.ts","sourceRoot":"","sources":["../../src/debugOverlayStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAErG;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG;IAC/C,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,sBAAsB,CAAC,EAAE,MAAM,CAAA;CAClC,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,MAAM,EAAE,eAAe,EAAE,CAAA;CAC5B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,cAAc,CAAA;IACzB,aAAa,EAAE,aAAa,CAAA;IAC5B,MAAM,EAAE,kBAAkB,EAAE,CAAA;IAC5B,OAAO,EAAE,sBAAsB,EAAE,CAAA;IACjC,KAAK,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,KAAK,gBAAgB,GAAG;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,cAAc,CAAA;IACzB,aAAa,EAAE,aAAa,CAAA;IAC5B,MAAM,EAAE,kBAAkB,EAAE,CAAA;IAC5B,OAAO,EAAE,sBAAsB,EAAE,CAAA;CACpC,CAAA;AAsQD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,qBAElC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,4BAEnC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,MAAM,SAEtD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GAAI,SAAS,MAAM,SAEvD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,MAAM,EAAE,QAAQ,gBAAgB,SAEhF,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,MAAM,SAEtD,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,KAAK,aAAa,EAAkF,MAAM,OAAO,CAAA;AAG1H,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAsB,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAkBvJ;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,2DAAmE,eAAe;;;;;;;;+BAqKvE,iBAAiB;8BAWlB,MAAM;gCAaJ,MAAM,SAAS,MAAM,aAAa,MAAM;4BAI5C,MAAM,QAAQ,sBAAsB;0BAItC,MAAM,QAAQ,sBAAsB,eAAe,MAAM;uBAI5D,MAAM;0CAEa,MAAM,eAAe,gBAAgB,GAAG,IAAI;;4CAkB1C,MAAM,eAAe,sBAAsB,GAAG,IAAI;;;;;CAkE5G,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM;;;;;qBAKjC,sBAAsB;mBAOtB,sBAAsB,eAAe,MAAM;mBAO3C,sBAAsB,eAAe,MAAM;CAsBzD,CAAA"}
@@ -1,32 +0,0 @@
1
- /**
2
- * @package @aiquants/resize-panels
3
- * @description Reusable resizable panel components and utilities for React
4
- *
5
- * 再利用可能なリサイズパネルコンポーネントとユーティリティ
6
- */
7
- export type { LayoutAllocation, PanelBounds } from './allocateLayout';
8
- export { allocatePanelSizes, isPixelPanel, resolvePanelBounds } from './allocateLayout';
9
- export { PanelGroupContext, usePanelGroup } from './context';
10
- export { usePanelControls, useResizablePanels } from './hooks';
11
- export { Panel } from './Panel';
12
- export { PanelGroup } from './PanelGroup';
13
- export { PanelResizeHandle } from './PanelResizeHandle';
14
- export { findLayoutInvariantBreach, getPanelPreferenceInPixels, initialPanelGroupLayoutState, panelReducer } from './reducer';
15
- export type { CollapsibleConfig, CollapsibleDirection, ContainerAxisMeasurement, FlexibleSize, LayoutConstraintViolation, LayoutConstraintViolationReason, PanelAction, PanelCollapseDirection, PanelDirection, PanelGroupContextValue, PanelGroupLayoutState, PanelGroupProps, PanelLayoutData, PanelMeasurement, PanelProps, PanelRegistration, PanelResizeHandleIndicatorConfig, PanelResizeHandleProps, PersistedPanelSize, ResizeHandleLayoutData, SizeConfig, SizeUnit, } from './types';
16
- export { calculateSnapThreshold, clamp, findOwningGroup, getConstraintInPixels, getContainerSize, getGroupLayoutElements, loadLayout, normalizeSizeConfig, percentageToPixels, saveLayout, toRoundedPercentage, } from './utils';
17
- /**
18
- * Locate a panel element in the DOM by its data attribute.
19
- * data 属性を手がかりにパネル要素を DOM から取得する補助関数。
20
- */
21
- export declare const getPanelElement: (id: string) => HTMLElement | null;
22
- /**
23
- * Locate a panel group element in the DOM by its data attribute.
24
- * data 属性を手がかりにパネルグループ要素を DOM から取得する補助関数。
25
- */
26
- export declare const getPanelGroupElement: (id: string) => HTMLElement | null;
27
- /**
28
- * Locate a resize handle element in the DOM by its data attribute.
29
- * data 属性を手がかりにリサイズハンドル要素を DOM から取得する補助関数。
30
- */
31
- export declare const getResizeHandleElement: (id: string) => HTMLElement | null;
32
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACrE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACvF,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC5D,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7H,YAAY,EACR,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,YAAY,EACZ,yBAAyB,EACzB,+BAA+B,EAC/B,WAAW,EACX,sBAAsB,EACtB,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,gCAAgC,EAChC,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,QAAQ,GACX,MAAM,SAAS,CAAA;AAChB,OAAO,EACH,sBAAsB,EACtB,KAAK,EACL,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACV,mBAAmB,GACtB,MAAM,SAAS,CAAA;AAUhB;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,IAAI,MAAM,KAAG,WAAW,GAAG,IAK1D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,IAAI,MAAM,KAAG,WAAW,GAAG,IAK/D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAI,IAAI,MAAM,KAAG,WAAW,GAAG,IAKjE,CAAA"}
@@ -1,49 +0,0 @@
1
- import { PanelAction, PanelGroupLayoutState, PanelLayoutData } from './types';
2
- /**
3
- * Empty layout state used before the group has measured itself or registered any panel.
4
- * グループが自身を計測する前・パネル登録前の空レイアウト状態。
5
- */
6
- export declare const initialPanelGroupLayoutState: PanelGroupLayoutState;
7
- /**
8
- * Find the layout invariant breach in a state, if there is one.
9
- * レイアウト状態に不変条件の違反があれば、その内容を返す処理。
10
- *
11
- * The condition is the one the whole package rests on: with a measured container and no reported constraint
12
- * conflict, the active panels fill it exactly. The misaligned handle this package once shipped was a silent
13
- * violation of exactly this — the sizes stopped filling the container and nothing noticed.
14
- * ここで見る条件はパッケージ全体の土台である: コンテナが計測済みで制約矛盾も報告されていないなら、
15
- * アクティブなパネルはコンテナをちょうど満たす。かつて出荷された「ハンドルがずれる」欠陥は、まさにこの条件が
16
- * 無言で破れた状態だった。
17
- *
18
- * @param state - Layout state to check / 検査するレイアウト状態
19
- * @returns Allocated total and container length when they disagree, otherwise null / 食い違う場合の合計と
20
- * コンテナ長、問題なければ null
21
- */
22
- export declare const findLayoutInvariantBreach: (state: PanelGroupLayoutState) => {
23
- allocatedTotal: number;
24
- containerSize: number;
25
- } | null;
26
- /**
27
- * Express a panel's preference as a length in pixels for the given container.
28
- * パネルの希望値を、指定コンテナに対するピクセル長として表す処理。
29
- *
30
- * This is the length the panel occupies when it is open, which is what a persisted layout has to carry: the
31
- * allocated size of a collapsed panel is 0 and would restore as "closed and with nothing to open to".
32
- * これは「開いているときに占める長さ」であり、保存レイアウトが持つべき値でもある。折りたたみ中のパネルの
33
- * 配分結果は 0 であり、そのまま保存すると「閉じたまま、開く先も無い」状態として復元されてしまう。
34
- *
35
- * @param panel - Panel layout data / パネルレイアウトデータ
36
- * @param containerSize - Container content-box length in pixels / コンテナ内容領域長 (px)
37
- * @returns Preferred length in pixels / 希望する長さ (px)
38
- */
39
- export declare const getPanelPreferenceInPixels: (panel: PanelLayoutData, containerSize: number) => number;
40
- /**
41
- * Reduce the layout state of one panel group.
42
- * パネルグループのレイアウト状態を遷移させるリデューサー。
43
- *
44
- * @param state - Current layout state / 現在のレイアウト状態
45
- * @param action - Action describing the edit / 編集内容を表すアクション
46
- * @returns Next layout state, identical by reference when nothing changed / 次のレイアウト状態 (無変化なら同一参照)
47
- */
48
- export declare const panelReducer: (state: PanelGroupLayoutState, action: PanelAction) => PanelGroupLayoutState;
49
- //# sourceMappingURL=reducer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/reducer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAA4D,KAAK,WAAW,EAA+B,KAAK,qBAAqB,EAAE,KAAK,eAAe,EAA0B,MAAM,SAAS,CAAA;AAM3M;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,qBAI1C,CAAA;AAkDD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,yBAAyB,GAAI,OAAO,qBAAqB,KAAG;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,IAqB5H,CAAA;AAuHD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,0BAA0B,GAAI,OAAO,eAAe,EAAE,eAAe,MAAM,KAAG,MAG1F,CAAA;AAiCD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,qBAAqB,EAAE,QAAQ,WAAW,KAAG,qBAuLhF,CAAA"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Round a number to specified digits using banker's rounding (round half to even).
3
- * 指定した桁で銀行丸め (最近接偶数への丸め) を行う関数。
4
- *
5
- * @param value - 丸め対象の数値
6
- * @param digits - 丸める桁数 (0: 整数, 1: 小数第1位, -1: 十の位)
7
- * @returns 丸められた数値
8
- */
9
- export declare const roundHalfToEven: (value: number, digits?: number) => number;
10
- //# sourceMappingURL=roundHalfToEven.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"roundHalfToEven.d.ts","sourceRoot":"","sources":["../../src/roundHalfToEven.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,EAAE,SAAQ,MAAU,KAAG,MA+BnE,CAAA"}
@@ -1,481 +0,0 @@
1
- import { CSSProperties, HTMLAttributes, ReactNode } from 'react';
2
- /**
3
- * Pixel threshold under which a panel is treated as visually closed.
4
- * パネルが見た目上閉じていると扱われるピクセル閾値。
5
- */
6
- export declare const PANEL_SNAP_THRESHOLD = 12;
7
- /**
8
- * Numeric tolerance for layout arithmetic, in pixels.
9
- * レイアウト演算の許容誤差 (px)。
10
- *
11
- * Sizes are IEEE-754 doubles produced by divisions, so exact comparisons would freeze drags on a 1 ulp
12
- * difference. Everything below this tolerance is treated as equality.
13
- * サイズは除算由来の倍精度値であり、厳密比較では 1 ulp の差でドラッグが凍結する。この許容値未満は同値とみなす。
14
- */
15
- export declare const PANEL_ALLOCATION_EPSILON = 0.000001;
16
- /**
17
- * Default thickness in pixels for the resize handle interactive area.
18
- * リサイズハンドルのインタラクティブ領域のデフォルト厚み (px)。
19
- */
20
- export declare const PANEL_HANDLE_THICKNESS = 8;
21
- /**
22
- * Default thickness in pixels for the visual indicator wrapper.
23
- * 視覚インジケーター外枠のデフォルト厚み (px)。
24
- */
25
- export declare const PANEL_INDICATOR_THICKNESS = 6;
26
- /**
27
- * Default length in pixels for the visual indicator wrapper in horizontal layout.
28
- * 水平レイアウトにおける視覚インジケーター外枠のデフォルト長さ (px)。
29
- */
30
- export declare const PANEL_INDICATOR_LENGTH_HORIZONTAL = 48;
31
- /**
32
- * Default length in pixels for the visual indicator wrapper in vertical layout.
33
- * 垂直レイアウトにおける視覚インジケーター外枠のデフォルト長さ (px)。
34
- */
35
- export declare const PANEL_INDICATOR_LENGTH_VERTICAL = 80;
36
- /**
37
- * Default thickness in pixels for the inner bar inside the visual indicator.
38
- * 視覚インジケーター内部バーのデフォルト厚み (px)。
39
- */
40
- export declare const PANEL_INDICATOR_BAR_THICKNESS = 2;
41
- /**
42
- * Default length in pixels for the inner bar inside the visual indicator in horizontal layout.
43
- * 水平レイアウトにおける視覚インジケーター内部バーのデフォルト長さ (px)。
44
- */
45
- export declare const PANEL_INDICATOR_BAR_LENGTH_HORIZONTAL = 32;
46
- /**
47
- * Default length in pixels for the inner bar inside the visual indicator in vertical layout.
48
- * 垂直レイアウトにおける視覚インジケーター内部バーのデフォルト長さ (px)。
49
- */
50
- export declare const PANEL_INDICATOR_BAR_LENGTH_VERTICAL = 64;
51
- /**
52
- * Spacing in pixels between visual indicators of handles that share a boundary.
53
- * 境界を共有するハンドルの視覚インジケーター同士のピクセル間隔。
54
- */
55
- export declare const PANEL_VISIBLE_INDICATOR_SPACING = 8;
56
- /**
57
- * Pointer move throttling interval in milliseconds during dragging.
58
- * ドラッグ中のポインタ移動を間引くミリ秒単位の間隔。
59
- */
60
- export declare const PANEL_HANDLE_DRAG_THROTTLE_MS = 8;
61
- /**
62
- * Pixel step applied per arrow-key press when resizing with the keyboard.
63
- * キーボード (矢印キー) リサイズで 1 押下ごとに適用するピクセル量。
64
- */
65
- export declare const PANEL_KEYBOARD_RESIZE_STEP = 10;
66
- /**
67
- * Ratio of container size used when determining collapse thresholds.
68
- * 折りたたみ閾値を決定する際に使用するコンテナサイズ比率。
69
- */
70
- export declare const PANEL_COLLAPSE_THRESHOLD_RATIO = 0.05;
71
- /**
72
- * Maximum pixel value considered when collapsing panels.
73
- * パネルを折りたたむ際に考慮するピクセル上限値。
74
- */
75
- export declare const PANEL_COLLAPSE_THRESHOLD_MAX = 10;
76
- /**
77
- * Ratio of container size required to expand a collapsed panel.
78
- * 折りたたまれたパネルを展開するために必要なコンテナサイズ比率。
79
- */
80
- export declare const PANEL_EXPAND_THRESHOLD_RATIO = 0.05;
81
- /**
82
- * Maximum pixel threshold used when expanding panels.
83
- * パネルを展開する際に用いるピクセル閾値の上限。
84
- */
85
- export declare const PANEL_EXPAND_THRESHOLD_MAX = 20;
86
- /**
87
- * Minimum thickness required for a handle to be treated as visible.
88
- * ハンドルが可視と判断されるために必要な最小厚み。
89
- */
90
- export declare const PANEL_HANDLE_VISIBILITY_THRESHOLD = 0.05;
91
- /**
92
- * Layout direction of panels
93
- * パネルのレイアウト方向
94
- */
95
- export type PanelDirection = "horizontal" | "vertical";
96
- /**
97
- * Size unit types for panels
98
- * パネルのサイズ単位タイプ
99
- */
100
- export type SizeUnit = "percentage" | "pixels";
101
- /**
102
- * Size configuration with value and unit
103
- * 値と単位を持つサイズ設定
104
- */
105
- export type SizeConfig = {
106
- value: number;
107
- unit: SizeUnit;
108
- };
109
- /**
110
- * Flexible size that can be defined in pixels or as a percentage
111
- * ピクセルまたはパーセンテージで定義できる柔軟なサイズ
112
- */
113
- export type FlexibleSize = SizeConfig | number;
114
- /**
115
- * Container size dimensions
116
- * コンテナサイズの寸法
117
- */
118
- export type ContainerSize = {
119
- width: number;
120
- height: number;
121
- };
122
- /**
123
- * Direction from which collapsible panels may close.
124
- * パネルを折りたためる方向を表す列挙値。
125
- */
126
- export type PanelCollapseDirection = "start" | "end";
127
- /**
128
- * Directional options accepted by the collapsible configuration.
129
- * 折りたたみ設定が受け付ける方向指定値。
130
- */
131
- export type CollapsibleDirection = PanelCollapseDirection | "both";
132
- /**
133
- * Configuration object describing how a panel collapses.
134
- * パネルの折りたたみ方を表す設定オブジェクト。
135
- */
136
- export type CollapsibleConfig = {
137
- from: CollapsibleDirection;
138
- };
139
- /**
140
- * Axis-aligned container measurement.
141
- * 軸方向のコンテナ計測値。
142
- *
143
- * `content` is what every layout number is relative to: percentage sizes resolve against it and the
144
- * allocator fills exactly this length. `border` is the same box plus padding and borders, used only when a
145
- * caller needs the element's outer footprint.
146
- * すべてのレイアウト数値の基準は `content`: パーセンテージ指定はこの長さに解決され、配分器はこの長さを満たす。
147
- * `border` は同じ軸のパディング・枠線を含む外形で、要素の外寸が必要な場合にのみ使う。
148
- */
149
- export type ContainerAxisMeasurement = {
150
- content: number;
151
- border: number;
152
- };
153
- /**
154
- * Reason code for layout constraint violations.
155
- * レイアウト制約違反の理由コード。
156
- */
157
- export type LayoutConstraintViolationReason = "minimum-exceeded" | "maximum-insufficient";
158
- /**
159
- * Snapshot describing when panel constraints conflict with the container size.
160
- * パネル制約とコンテナサイズが矛盾した際のスナップショット。
161
- */
162
- export type LayoutConstraintViolation = {
163
- reason: LayoutConstraintViolationReason;
164
- totalMinimumSize: number;
165
- totalMaximumSize: number;
166
- availableContainerSize: number;
167
- };
168
- /**
169
- * Canonical layout state of a single panel.
170
- * 単一パネルの正準レイアウト状態。
171
- *
172
- * The state separates three roles and never stores the same quantity twice: configuration comes from the
173
- * component's props, the preference is what the user asked for (a share of the container for flexible
174
- * panels, an absolute length for pixel panels), and `size` is the allocator's answer for the current
175
- * container. Everything else — the rendered flex basis, the handle position, the percentage shown in the
176
- * debug overlay — is derived from those.
177
- * 状態は 3 つの役割に分かれ、同じ量を二重に持たない: 構成はコンポーネントの props 由来、希望値は利用者の要求
178
- * (柔軟パネルはコンテナ比、ピクセルパネルは絶対長)、`size` は現在のコンテナに対する配分器の答え。描画される
179
- * flex basis・ハンドル位置・デバッグ表示の割合は、すべてここから導出される。
180
- */
181
- export interface PanelLayoutData {
182
- id: string;
183
- /** Which preference field drives this panel. どちらの希望値でサイズが決まるか。 */
184
- sizeUnit: SizeUnit;
185
- /** Allocated length in pixels for the current container. 現在のコンテナに対する配分結果 (px)。 */
186
- size: number;
187
- /**
188
- * Ratio weight of a flexible panel, expressed as a share of the container in percent.
189
- * 柔軟パネルの重み (コンテナ比 %)。
190
- *
191
- * Only the ratio between panels matters — unless the panel declares `flexAdjustPriority`, which turns the
192
- * same number into an absolute claim on that share of the container.
193
- * 意味を持つのはパネル間の比だけ。ただし `flexAdjustPriority` を宣言したパネルでは、同じ数値が
194
- * 「コンテナのその割合」という絶対的な要求になる。
195
- */
196
- preferredPercentageSize: number;
197
- /** Requested absolute length of a pixel panel. ピクセルパネルの希望絶対長 (px)。 */
198
- preferredPixelSize: number;
199
- minSize?: FlexibleSize;
200
- maxSize?: FlexibleSize;
201
- collapseFromStart: boolean;
202
- collapseFromEnd: boolean;
203
- collapsed: boolean;
204
- collapsedByDirection: PanelCollapseDirection | null;
205
- /**
206
- * Preference captured when the panel collapsed, restored verbatim on expand.
207
- * 折りたたみ時に退避し、展開時にそのまま復元する希望値。
208
- */
209
- preferenceBeforeCollapse: number;
210
- /**
211
- * Preference the component last authored through its props, used to tell a prop change from a re-registration.
212
- * コンポーネントが props で最後に宣言した希望値。prop 変更と単なる再登録を区別するために保持。
213
- */
214
- authoredPreference: number;
215
- /** Serving order among pixel panels, higher first. ピクセルパネル間の充当順位 (大きいほど先)。 */
216
- pixelAdjustPriority?: number;
217
- /**
218
- * Serving order among flexible panels, higher first; absent means pure ratio sharing.
219
- * 柔軟パネル間の充当順位 (大きいほど先)。未指定なら純粋な比例配分。
220
- *
221
- * Declaring it changes how `preferredPercentageSize` is read: the panel claims that share of the container
222
- * before the ratio panels divide what is left.
223
- * 宣言すると `preferredPercentageSize` の読み方が変わり、比例配分のパネルが残りを分ける前に
224
- * コンテナのその割合を確保する。
225
- */
226
- flexAdjustPriority?: number;
227
- }
228
- /**
229
- * Layout state of one panel group: the container it was measured against, its panels in DOM order, and
230
- * whether the panels' constraints can be satisfied at that size.
231
- * パネルグループのレイアウト状態: 計測対象のコンテナ長・DOM 順のパネル一覧・制約充足可否。
232
- */
233
- export interface PanelGroupLayoutState {
234
- /** Content-box length of the group along its axis; 0 until the first measurement. 軸方向の内容領域長 (未計測は 0)。 */
235
- containerSize: number;
236
- panels: PanelLayoutData[];
237
- violation: LayoutConstraintViolation | null;
238
- }
239
- /**
240
- * Configuration and preference a panel publishes when it registers with its group.
241
- * パネルがグループへ登録する際に公開する構成と希望値。
242
- */
243
- export type PanelRegistration = Omit<PanelLayoutData, "size" | "collapsedByDirection" | "preferenceBeforeCollapse" | "authoredPreference">;
244
- /**
245
- * One panel's persisted length, kept with its identifier so a stored layout can never be applied to a
246
- * different set of panels.
247
- * 保存されたパネル 1 枚分の長さ。別構成のパネルへ誤って適用されないよう識別子を伴う。
248
- */
249
- export type PersistedPanelSize = {
250
- id: string;
251
- size: number;
252
- /** Whether the panel was collapsed when the layout was written. 保存時に折りたたまれていたか。 */
253
- collapsed: boolean;
254
- };
255
- /**
256
- * Actions accepted by the panel group reducer.
257
- * パネルグループのリデューサーが受け付けるアクション。
258
- */
259
- export type PanelAction = {
260
- type: "SET_CONTAINER_SIZE";
261
- containerSize: number;
262
- } | {
263
- type: "REGISTER_PANEL";
264
- panel: PanelRegistration;
265
- } | {
266
- type: "UNREGISTER_PANEL";
267
- id: string;
268
- } | {
269
- type: "REORDER_PANELS";
270
- ids: string[];
271
- } | {
272
- type: "RESIZE_PANELS";
273
- startId: string;
274
- endId: string;
275
- startSize: number;
276
- } | {
277
- type: "COLLAPSE_PANEL";
278
- id: string;
279
- from: PanelCollapseDirection;
280
- } | {
281
- type: "EXPAND_PANEL";
282
- id: string;
283
- from: PanelCollapseDirection;
284
- targetSize?: number;
285
- } | {
286
- type: "RESTORE_LAYOUT";
287
- entries: PersistedPanelSize[];
288
- };
289
- /**
290
- * Props for the Panel component
291
- * Panel コンポーネントのプロパティ
292
- */
293
- export interface PanelProps extends Omit<HTMLAttributes<HTMLDivElement>, "id" | "children" | "className" | "style" | "aria-hidden"> {
294
- id?: string;
295
- /**
296
- * Initial size. A percentage (or bare number) makes the panel flexible, pixels make it fixed.
297
- * 初期サイズ。パーセンテージ (数値のみの指定を含む) なら柔軟パネル、ピクセルなら固定パネル。
298
- * @default { value: 50, unit: "percentage" }
299
- */
300
- defaultSize?: FlexibleSize;
301
- minSize?: FlexibleSize;
302
- maxSize?: FlexibleSize;
303
- className?: string;
304
- style?: CSSProperties;
305
- children?: ReactNode;
306
- collapsible?: CollapsibleConfig;
307
- defaultCollapsed?: boolean;
308
- pixelAdjustPriority?: number;
309
- flexAdjustPriority?: number;
310
- contentOverflow?: CSSProperties["overflow"];
311
- }
312
- /**
313
- * Props for the PanelGroup component
314
- * PanelGroup コンポーネントのプロパティ
315
- */
316
- export interface PanelGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "id" | "children" | "className" | "style"> {
317
- id?: string;
318
- direction: PanelDirection;
319
- className?: string;
320
- style?: CSSProperties;
321
- children?: ReactNode;
322
- showDebugInfo?: boolean;
323
- onLayout?: (panelSizes: number[]) => void;
324
- autoSaveId?: string;
325
- }
326
- /**
327
- * Value provided by the PanelGroupContext
328
- * PanelGroupContext によって提供される値
329
- */
330
- export interface PanelGroupContextValue {
331
- direction: PanelDirection;
332
- registerPanel: (panel: PanelRegistration) => void;
333
- unregisterPanel: (id: string) => void;
334
- getPanel: (id: string) => PanelLayoutData | undefined;
335
- panels: PanelLayoutData[];
336
- /** Content-box length of the group along its axis. グループ軸方向の内容領域長。 */
337
- containerSize: number;
338
- /**
339
- * Key that changes whenever the document order of the group's panels and handle anchors changes.
340
- * グループのパネルとハンドルのアンカーの文書順が変わるたびに変化する鍵。
341
- *
342
- * A handle that moves to another boundary leaves the panel id sequence untouched, so the panels alone
343
- * cannot tell a handle that its neighbours changed.
344
- * ハンドルが別の境界へ移ってもパネルの id 列は変わらないため、パネルだけではハンドルへ隣の変化を伝えられない。
345
- */
346
- layoutOrderKey: string;
347
- showDebugInfo: boolean;
348
- resizePanels: (startId: string, endId: string, startSize: number) => void;
349
- collapsePanel: (id: string, from: PanelCollapseDirection) => void;
350
- expandPanel: (id: string, from: PanelCollapseDirection, targetSize?: number) => void;
351
- reportPanelMeasurement: (id: string, measurement: PanelMeasurement | null) => void;
352
- panelMeasurements: Record<string, PanelMeasurement>;
353
- reportHandleMeasurement: (id: string, measurement: ResizeHandleLayoutData | null) => void;
354
- handleMeasurements: Record<string, ResizeHandleLayoutData>;
355
- layoutConstraintViolation: LayoutConstraintViolation | null;
356
- }
357
- /**
358
- * Visual indicator configuration options for PanelResizeHandle.
359
- * PanelResizeHandle の視覚インジケーターに関する設定オプション。
360
- */
361
- export interface PanelResizeHandleIndicatorConfig {
362
- /**
363
- * Primary axis thickness of the indicator pill in pixels.
364
- * (Horizontal: width, Vertical: height)
365
- * インジケーター外枠の主軸方向の厚み (px)。(水平: 幅, 垂直: 高さ)
366
- * @default 6
367
- */
368
- thickness?: number;
369
- /**
370
- * Cross axis length of the indicator pill in pixels.
371
- * (Horizontal: height, Vertical: width)
372
- * インジケーター外枠の交差軸方向の長さ (px)。(水平: 高さ, 垂直: 幅)
373
- * @default horizontal ? 48 : 80
374
- */
375
- length?: number;
376
- /**
377
- * Primary axis thickness of the inner bar in pixels.
378
- * インジケーター内部バーの主軸方向の厚み (px)。
379
- * @default 2
380
- */
381
- barThickness?: number;
382
- /**
383
- * Cross axis length of the inner bar in pixels.
384
- * インジケーター内部バーの交差軸方向の長さ (px)。
385
- * @default horizontal ? 32 : 64
386
- */
387
- barLength?: number;
388
- /**
389
- * Whether the indicator is visible.
390
- * インジケーターを表示するかどうかの指定。
391
- * @default true
392
- */
393
- visible?: boolean;
394
- /**
395
- * Additional CSS class name for the indicator wrapper.
396
- * インジケーター外枠に付与する追加 CSS クラス名。
397
- */
398
- className?: string;
399
- /**
400
- * Additional CSS class name for the inner bar.
401
- * インジケーター内部バーに付与する追加 CSS クラス名。
402
- */
403
- barClassName?: string;
404
- }
405
- /**
406
- * Props for the PanelResizeHandle component
407
- * PanelResizeHandle コンポーネントのプロパティ
408
- */
409
- /**
410
- * ARIA attributes the handle computes from the layout; a consumer value would be silently discarded.
411
- * ハンドルがレイアウトから算出する ARIA 属性 (利用者の指定は黙って捨てられるため受け付けない)。
412
- */
413
- type OwnedSeparatorAria = "role" | "aria-orientation" | "aria-valuenow" | "aria-valuemin" | "aria-valuemax" | "aria-disabled" | "aria-hidden";
414
- export interface PanelResizeHandleProps extends Omit<HTMLAttributes<HTMLButtonElement>, "id" | "children" | "className" | "style" | "title" | OwnedSeparatorAria> {
415
- id?: string;
416
- disabled?: boolean;
417
- onDragging?: (isDragging: boolean) => void;
418
- className?: string;
419
- style?: CSSProperties;
420
- children?: ReactNode;
421
- /**
422
- * Primary axis thickness of the handle's interactive area in pixels.
423
- * (Horizontal: width, Vertical: height)
424
- * リサイズハンドルの操作領域 (ヒットエリア) の厚み (px)。(水平: 幅, 垂直: 高さ)
425
- * @default PANEL_HANDLE_THICKNESS (8)
426
- */
427
- thickness?: number;
428
- /**
429
- * Configuration for the visual indicator, or boolean to toggle visibility.
430
- * 視覚インジケーターの設定オブジェクト、または表示/非表示の真偽値。
431
- * @default true
432
- */
433
- indicator?: boolean | PanelResizeHandleIndicatorConfig;
434
- /**
435
- * Shorthand for indicator wrapper thickness in pixels.
436
- * インジケーター外枠厚み (px) のショートハンド。
437
- */
438
- indicatorThickness?: number;
439
- /**
440
- * Shorthand for indicator wrapper length in pixels.
441
- * インジケーター外枠長さ (px) のショートハンド。
442
- */
443
- indicatorLength?: number;
444
- /**
445
- * Shorthand for indicator inner bar thickness in pixels.
446
- * インジケーター内部バー厚み (px) のショートハンド。
447
- */
448
- indicatorBarThickness?: number;
449
- /**
450
- * Shorthand for indicator inner bar length in pixels.
451
- * インジケーター内部バー長さ (px) のショートハンド。
452
- */
453
- indicatorBarLength?: number;
454
- /**
455
- * Custom tooltip text for the handle element.
456
- * ハンドル要素のカスタムツールチップテキスト。
457
- */
458
- title?: string;
459
- }
460
- /**
461
- * Observed pixel and percentage measurements for a registered panel.
462
- * 登録済みパネルの実測ピクセル寸法およびパーセンテージ寸法。
463
- */
464
- export interface PanelMeasurement {
465
- pixelSize: number;
466
- percentageSize: number;
467
- }
468
- /**
469
- * Layout data for a resize handle (divider) within a panel group.
470
- * パネルグループ内のリサイズハンドル(ディバイダー)に関するレイアウトデータ。
471
- */
472
- export interface ResizeHandleLayoutData {
473
- id: string;
474
- thickness: number;
475
- direction: PanelDirection;
476
- visible: boolean;
477
- startPanelId: string | null;
478
- endPanelId: string | null;
479
- }
480
- export {};
481
- //# sourceMappingURL=types.d.ts.map