@tatamicks/core 0.1.0 → 0.1.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.
@@ -2,6 +2,7 @@ import { default as default_2 } from 'react';
2
2
  import { ForwardRefExoticComponent } from 'react';
3
3
  import { JSX as JSX_2 } from 'react/jsx-runtime';
4
4
  import { MemoExoticComponent } from 'react';
5
+ import { ReactNode } from 'react';
5
6
  import { RefAttributes } from 'react';
6
7
 
7
8
  export declare const ACTUAL_UNITS: readonly ["mm", "cm", "pt", "inch", "px"];
@@ -59,6 +60,13 @@ export declare function assertPositive(value: number, name?: string): void;
59
60
  */
60
61
  export declare function assertRange(value: number, min: number, max: number, name?: string): void;
61
62
 
63
+ export declare const BackgroundPanel: default_2.FC<BackgroundPanelProps>;
64
+
65
+ export declare interface BackgroundPanelProps {
66
+ selectedBlocks: Block[];
67
+ onUpdateBlocks: (updates: Record<string, Partial<Block>>) => void;
68
+ }
69
+
62
70
  export declare function binarySearch(num: number, arr: readonly number[]): number;
63
71
 
64
72
  /**
@@ -96,6 +104,55 @@ export declare interface BlockBehavior {
96
104
  readOnly?: boolean;
97
105
  }
98
106
 
107
+ /**
108
+ * BlockBorder
109
+ *
110
+ * ブロックの境界線を描画するコンポーネント
111
+ * - block.style?.borderで設定された枠線を描画
112
+ * - pointer-events: none (クリックイベント透過)
113
+ *
114
+ * @remarks
115
+ * - ユーザー設定の枠線を描画
116
+ * - BlockBaseBorderと構造は同じだが、用途とz-indexが異なる
117
+ * - BlockBaseBorder: ガイド線(GUIDE層)
118
+ * - BlockBorder: 実際の枠線(BORDER層)
119
+ */
120
+ export declare const BlockBorder: default_2.FC<BlockBorderProps>;
121
+
122
+ /**
123
+ * BlockBorderコンポーネントのProps
124
+ */
125
+ export declare interface BlockBorderProps {
126
+ blockSizePx: BlockSizePx;
127
+ borderStyle?: BorderStyle;
128
+ blockZIndex: number;
129
+ subZIndex?: number;
130
+ visible?: boolean;
131
+ dpi?: number;
132
+ className?: string;
133
+ }
134
+
135
+ /**
136
+ * BlockCanvas
137
+ *
138
+ * ブロック背景を描画するコンポーネント
139
+ * - z-index: ブロック基底値 + 0 (各ブロックの最下層)
140
+ * - pointer-events: none (クリックイベント透過)
141
+ * - 背景色のみを描画(境界線はBlockBaseBorderが担当)
142
+ */
143
+ export declare const BlockCanvas: default_2.FC<BlockCanvasProps>;
144
+
145
+ /**
146
+ * BlockCanvasコンポーネントのProps
147
+ */
148
+ export declare interface BlockCanvasProps {
149
+ blockSizePx: BlockSizePx;
150
+ blockZIndex: number;
151
+ subZIndex?: number;
152
+ backgroundColor?: string;
153
+ className?: string;
154
+ }
155
+
99
156
  export declare interface BlockChangeEvent {
100
157
  type: BlockChangeType;
101
158
  blockIds: string[];
@@ -120,6 +177,26 @@ export declare enum BlockChangeType {
120
177
  PASTE = "paste"
121
178
  }
122
179
 
180
+ export declare const BlockContainer: MemoExoticComponent<ForwardRefExoticComponent<BlockContainerProps & RefAttributes<BlockRef>>>;
181
+
182
+ export declare interface BlockContainerProps {
183
+ block: Block;
184
+ plugin: BlockPlugin;
185
+ blockRectPx: BlockRectPx;
186
+ blockZIndex: number;
187
+ mode: NoteMode;
188
+ value: Value;
189
+ onValueChange?: (val: Value) => void;
190
+ onValueBlur?: (val: Value) => void;
191
+ showGuides?: boolean;
192
+ showBorder?: boolean;
193
+ blockSubZIndex?: Record<string, number>;
194
+ defaultGuideBorder?: BorderStyle;
195
+ dpi?: number;
196
+ className?: string;
197
+ pointerEvents?: "auto" | "none";
198
+ }
199
+
123
200
  /**
124
201
  * ブロックコンテナスタイルのオプション
125
202
  */
@@ -130,6 +207,81 @@ export declare interface BlockContainerStyleOptions {
130
207
  pointerEvents?: "auto" | "none";
131
208
  }
132
209
 
210
+ /**
211
+ * BlockBaseBorder
212
+ *
213
+ * レイアウト編集時にブロックの境界を可視化するガイド線コンポーネント
214
+ * - formモードでのみ使用される
215
+ * - block.style?.borderが未設定のブロックに表示
216
+ * - pointer-events: none (クリックイベント透過)
217
+ *
218
+ * @remarks
219
+ * - 固定スタイル(薄いグレーの実線)でブロック境界を描画
220
+ * - ユーザー設定の枠線とは別の、編集補助用のガイド
221
+ * - BorderOverlayと構造は同じだが、用途と表示条件が異なる
222
+ */
223
+ export declare const BlockGuideBorder: default_2.FC<BlockGuideBorderProps>;
224
+
225
+ /**
226
+ * BlockBaseBorderコンポーネントのProps
227
+ */
228
+ export declare interface BlockGuideBorderProps {
229
+ blockSizePx: BlockSizePx;
230
+ blockZIndex: number;
231
+ subZIndex?: number;
232
+ borderStyle?: BorderStyle;
233
+ visible?: boolean;
234
+ dpi?: number;
235
+ className?: string;
236
+ }
237
+
238
+ export declare const BlockLayer: MemoExoticComponent<({ blocks, pluginRegistry, mode, values, selectedBlockIds, getBlockRectPx, onValueChange, onValueBlur, showGuides, showBorder, blockSubZIndex, defaultGuideBorder, dpi, className, }: BlockLayerProps) => JSX_2.Element>;
239
+
240
+ export declare interface BlockLayerProps {
241
+ blocks: Block[];
242
+ pluginRegistry: Record<string, BlockPlugin>;
243
+ mode: NoteMode;
244
+ values: Record<string, Value>;
245
+ selectedBlockIds?: string[];
246
+ getBlockRectPx: (block: Block) => BlockRectPx;
247
+ onValueChange?: OnChange;
248
+ onValueBlur?: OnBlur;
249
+ showGuides?: boolean;
250
+ showBorder?: boolean;
251
+ blockSubZIndex?: Record<string, number>;
252
+ defaultGuideBorder?: BorderStyle;
253
+ dpi?: number;
254
+ className?: string;
255
+ }
256
+
257
+ /**
258
+ * ブロックレイアウト(グリッド座標系)
259
+ */
260
+ export declare interface BlockLayout {
261
+ x: number;
262
+ y: number;
263
+ w: number;
264
+ h: number;
265
+ }
266
+
267
+ /**
268
+ * BlockOrderPanel
269
+ * ブロックの配列順序を変更するパネル
270
+ * UIでは上が最前面、下が最背面(一般的なデザインソフトと同じ)
271
+ * 内部配列では最後が最前面
272
+ */
273
+ export declare const BlockOrderPanel: {
274
+ ({ blocks, onBlocksChange, }: BlockOrderPanelProps): JSX_2.Element;
275
+ displayName: string;
276
+ };
277
+
278
+ export declare interface BlockOrderPanelProps {
279
+ /** ブロック一覧 */
280
+ blocks: Block[];
281
+ /** ブロック更新時のコールバック (blocks配列全体を更新) */
282
+ onBlocksChange: (blocks: Block[]) => void;
283
+ }
284
+
133
285
  /**
134
286
  * BlockPlugin 型定義
135
287
  *
@@ -189,7 +341,7 @@ export declare interface BlockPosPx {
189
341
  */
190
342
  export declare const BlockPropertyPanel: MemoExoticComponent<({ selectedBlocks, pluginRegistry, onUpdateBlocks, gridSize, className, }: BlockPropertyPanelProps) => JSX_2.Element>;
191
343
 
192
- declare interface BlockPropertyPanelProps {
344
+ export declare interface BlockPropertyPanelProps {
193
345
  selectedBlocks: Block[];
194
346
  pluginRegistry: Record<string, BlockPlugin>;
195
347
  onUpdateBlocks: (updates: Record<string, Partial<Block>>) => void;
@@ -224,6 +376,43 @@ export declare interface BlockRef {
224
376
  focus: () => void;
225
377
  }
226
378
 
379
+ export declare const BlockRenderer: typeof ForwardedBlockRenderer;
380
+
381
+ /**
382
+ * BlockRendererコンポーネントのProps
383
+ *
384
+ * @template P - プラグイン固有プロパティ型
385
+ * @template V - プラグインが扱う値の型
386
+ */
387
+ export declare interface BlockRendererProps<P = Record<string, Value>, V = Value> {
388
+ /** ブロックID */
389
+ id: string;
390
+ /** プラグイン定義 */
391
+ plugin: BlockPlugin<P, V>;
392
+ /** プラグイン固有プロパティ */
393
+ props: P;
394
+ /** ブロックの現在値 */
395
+ value: V;
396
+ /** 値変更コールバック (オプション) */
397
+ onChange?: (value: V) => void;
398
+ /** 値確定コールバック (オプション) */
399
+ onBlur?: (value: V) => void;
400
+ /** 読み取り専用フラグ */
401
+ readOnly: boolean;
402
+ /** 現在のモード */
403
+ mode: NoteMode;
404
+ /** ブロックの位置とサイズ(ピクセル単位) */
405
+ blockSizePx: BlockSizePx;
406
+ /** ブロック基底z-index */
407
+ blockZIndex: number;
408
+ /** ブロック内でのレイヤーz-index (オプション) */
409
+ subZIndex?: number;
410
+ /** バリデーション状態 (オプション) */
411
+ validationState?: "valid" | "invalid" | "warning";
412
+ /** 追加のクラス名 */
413
+ className?: string;
414
+ }
415
+
227
416
  export declare interface BlockSize {
228
417
  w: number;
229
418
  h: number;
@@ -366,6 +555,13 @@ export declare interface BorderOverlayProps {
366
555
  className?: string;
367
556
  }
368
557
 
558
+ export declare const BorderPanel: default_2.FC<BorderPanelProps>;
559
+
560
+ export declare interface BorderPanelProps {
561
+ selectedBlocks: Block[];
562
+ onUpdateBlocks: (updates: Record<string, Partial<Block>>) => void;
563
+ }
564
+
369
565
  export declare const BorderRenderer: MemoExoticComponent<({ width, height, border, dpi, className, }: BorderRendererProps) => JSX_2.Element | null>;
370
566
 
371
567
  export declare interface BorderRendererProps {
@@ -397,6 +593,52 @@ export declare type BorderUnit = (typeof BORDER_UNITS)[number];
397
593
  */
398
594
  export declare function calculateGridResize(dimensions: Dimension<GridUnit>[], index: number, deltaPx: number, totalContentPx: number): Dimension<GridUnit>[];
399
595
 
596
+ /**
597
+ * リサイズ後のレイアウトを計算
598
+ *
599
+ * @param params - リサイズパラメータ
600
+ * @returns 新しいレイアウト
601
+ *
602
+ * @remarks
603
+ * - 最小サイズは1x1
604
+ * - グリッド範囲外にははみ出さない
605
+ * - 左端・上端を超える場合は自動的にクランプ
606
+ *
607
+ * @example
608
+ * ```typescript
609
+ * const newLayout = calculateResizedLayout({
610
+ * layout: { x: 2, y: 2, w: 3, h: 3 },
611
+ * handle: ResizeHandle.SE,
612
+ * deltaCol: 2,
613
+ * deltaRow: 1,
614
+ * gridCols: 10,
615
+ * gridRows: 10,
616
+ * });
617
+ * // => { x: 2, y: 2, w: 5, h: 4 }
618
+ * ```
619
+ */
620
+ export declare function calculateResizedLayout({ layout, handle, deltaCol, deltaRow, gridCols, gridRows, }: ResizeParams): BlockLayout;
621
+
622
+ /**
623
+ * CanvasPanel
624
+ * キャンバス設定の統合パネル
625
+ * - PaperSizePanel: 用紙サイズ設定
626
+ * - MarginPanel: マージン設定
627
+ * - GridSizePanel: グリッドサイズ設定
628
+ * - BlockOrderPanel: ブロック順序設定
629
+ */
630
+ export declare const CanvasPanel: {
631
+ ({ schema, onSchemaChange }: CanvasPanelProps): JSX_2.Element;
632
+ displayName: string;
633
+ };
634
+
635
+ export declare interface CanvasPanelProps {
636
+ /** フォームスキーマ */
637
+ schema: FormSchema;
638
+ /** スキーマ変更時のコールバック */
639
+ onSchemaChange: (newSchema: FormSchema) => void;
640
+ }
641
+
400
642
  /**
401
643
  * チェックボックスコンポーネント
402
644
  */
@@ -405,7 +647,7 @@ export declare const Checkbox: {
405
647
  displayName: string;
406
648
  };
407
649
 
408
- declare interface CheckboxConfig {
650
+ export declare interface CheckboxConfig {
409
651
  label?: string;
410
652
  [key: string]: Value;
411
653
  }
@@ -419,6 +661,70 @@ export declare interface CheckboxProps extends PropertyComponentProps<boolean |
419
661
  config?: CheckboxConfig;
420
662
  }
421
663
 
664
+ /**
665
+ * @file clampBlock.ts
666
+ * @description ブロックをグリッド範囲内にクランプする共通ロジック
667
+ *
668
+ * @remarks
669
+ * 移動・挿入・リサイズ時のはみ出し防止処理を集約。
670
+ * DRY原則に従い、InteractionLayer内の重複コードを排除。
671
+ */
672
+ /**
673
+ * ブロックの位置をグリッド範囲内にクランプ
674
+ *
675
+ * @param position - ブロックの位置 (x, y)
676
+ * @param size - ブロックのサイズ (w, h)
677
+ * @param gridCols - グリッドの列数
678
+ * @param gridRows - グリッドの行数
679
+ * @returns クランプされた位置 { x, y }
680
+ *
681
+ * @remarks
682
+ * - x は 0 ~ (gridCols - w) の範囲にクランプ
683
+ * - y は 0 ~ (gridRows - h) の範囲にクランプ
684
+ * - ブロックがグリッドからはみ出さないことを保証
685
+ *
686
+ * @example
687
+ * ```typescript
688
+ * const clamped = clampBlockToGrid(
689
+ * { x: -1, y: 5 },
690
+ * { w: 2, h: 3 },
691
+ * 10, // gridCols
692
+ * 10 // gridRows
693
+ * );
694
+ * // => { x: 0, y: 5 }
695
+ * ```
696
+ */
697
+ export declare function clampBlockToGrid(position: {
698
+ x: number;
699
+ y: number;
700
+ }, size: {
701
+ w: number;
702
+ h: number;
703
+ }, gridCols: number, gridRows: number): {
704
+ x: number;
705
+ y: number;
706
+ };
707
+
708
+ export declare interface ClampedBlockPosition {
709
+ blockId: string;
710
+ x: number;
711
+ y: number;
712
+ }
713
+
714
+ /**
715
+ * 複数ブロックの移動をクランプ
716
+ * 全体のバウンディングボックスを計算し、グリッド範囲内に収めた上で
717
+ * 相対位置を保持したまま各ブロックの新しい座標を返す
718
+ *
719
+ * @param blocks - 移動対象のブロック配列
720
+ * @param deltaCol - 列方向の移動量
721
+ * @param deltaRow - 行方向の移動量
722
+ * @param gridCols - グリッドの列数
723
+ * @param gridRows - グリッドの行数
724
+ * @returns クランプ後の各ブロックの座標配列
725
+ */
726
+ export declare function clampMultipleBlocks(blocks: Block[], deltaCol: number, deltaRow: number, gridCols: number, gridRows: number): ClampedBlockPosition[];
727
+
422
728
  /**
423
729
  * 印刷後のクリーンアップ処理
424
730
  */
@@ -426,6 +732,115 @@ export declare function cleanupPrint(options?: {
426
732
  restoreScrollbars?: boolean;
427
733
  }): void;
428
734
 
735
+ /**
736
+ * カラーパレット定義(30色)
737
+ */
738
+ export declare const COLOR_PALETTE: readonly [{
739
+ readonly label: "無色";
740
+ readonly value: string | undefined;
741
+ }, {
742
+ readonly label: "白";
743
+ readonly value: "#ffffff";
744
+ }, {
745
+ readonly label: "グレー1";
746
+ readonly value: "#efefef";
747
+ }, {
748
+ readonly label: "グレー2";
749
+ readonly value: "#d9d9d9";
750
+ }, {
751
+ readonly label: "グレー3";
752
+ readonly value: "#cccccc";
753
+ }, {
754
+ readonly label: "グレー4";
755
+ readonly value: "#b7b7b7";
756
+ }, {
757
+ readonly label: "グレー5";
758
+ readonly value: "#999999";
759
+ }, {
760
+ readonly label: "グレー6";
761
+ readonly value: "#666666";
762
+ }, {
763
+ readonly label: "グレー7";
764
+ readonly value: "#434343";
765
+ }, {
766
+ readonly label: "黒";
767
+ readonly value: "#000000";
768
+ }, {
769
+ readonly label: "薄茶";
770
+ readonly value: "#E6B8AF";
771
+ }, {
772
+ readonly label: "薄赤";
773
+ readonly value: "#F4CCCC";
774
+ }, {
775
+ readonly label: "薄橙";
776
+ readonly value: "#FCE5CD";
777
+ }, {
778
+ readonly label: "薄黄";
779
+ readonly value: "#FFF2CC";
780
+ }, {
781
+ readonly label: "薄緑";
782
+ readonly value: "#D9EAD3";
783
+ }, {
784
+ readonly label: "薄青緑";
785
+ readonly value: "#D0E0E3";
786
+ }, {
787
+ readonly label: "薄青";
788
+ readonly value: "#C9DAF8";
789
+ }, {
790
+ readonly label: "薄青紫";
791
+ readonly value: "#CFE2F3";
792
+ }, {
793
+ readonly label: "薄紫";
794
+ readonly value: "#D9D2E9";
795
+ }, {
796
+ readonly label: "薄赤紫";
797
+ readonly value: "#EAD1DC";
798
+ }, {
799
+ readonly label: "茶";
800
+ readonly value: "#DD7E6B";
801
+ }, {
802
+ readonly label: "赤";
803
+ readonly value: "#EA9999";
804
+ }, {
805
+ readonly label: "橙";
806
+ readonly value: "#F9CB9C";
807
+ }, {
808
+ readonly label: "黄";
809
+ readonly value: "#FFE599";
810
+ }, {
811
+ readonly label: "緑";
812
+ readonly value: "#B6D7A8";
813
+ }, {
814
+ readonly label: "青緑";
815
+ readonly value: "#A2C4C9";
816
+ }, {
817
+ readonly label: "青";
818
+ readonly value: "#A4C2F4";
819
+ }, {
820
+ readonly label: "青紫";
821
+ readonly value: "#9FC5E8";
822
+ }, {
823
+ readonly label: "紫";
824
+ readonly value: "#B4A7D6";
825
+ }, {
826
+ readonly label: "赤紫";
827
+ readonly value: "#D5A6BD";
828
+ }];
829
+
830
+ /**
831
+ * カラーパレットコンポーネント
832
+ */
833
+ export declare const ColorPalette: {
834
+ ({ onColorSelect, selectedColor, readOnly, }: ColorPaletteProps): default_2.ReactElement;
835
+ displayName: string;
836
+ };
837
+
838
+ export declare interface ColorPaletteProps {
839
+ onColorSelect: (color: string | undefined) => void;
840
+ selectedColor?: string;
841
+ readOnly?: boolean;
842
+ }
843
+
429
844
  /**
430
845
  * カラーピッカーコンポーネント
431
846
  */
@@ -438,13 +853,31 @@ export declare const ColorPicker: {
438
853
  * Config型定義
439
854
  * Record<string, Value> との互換性を持たせる
440
855
  */
441
- declare interface ColorPickerConfig {
856
+ export declare interface ColorPickerConfig {
442
857
  allowUndefined?: boolean;
443
858
  width?: number;
444
859
  height?: number;
445
860
  [key: string]: Value;
446
861
  }
447
862
 
863
+ /**
864
+ * カラーピッカーポップオーバーコンポーネント
865
+ */
866
+ export declare const ColorPickerPopover: {
867
+ ({ isOpen, onClose, rgba, onRgbaChange, onColorSelect, selectedColor, readOnly, }: ColorPickerPopoverProps): default_2.ReactElement | null;
868
+ displayName: string;
869
+ };
870
+
871
+ export declare interface ColorPickerPopoverProps {
872
+ isOpen: boolean;
873
+ onClose: () => void;
874
+ rgba: RGBA;
875
+ onRgbaChange: (channel: keyof RGBA, value: number | undefined) => void;
876
+ onColorSelect: (color: string | undefined) => void;
877
+ selectedColor?: string;
878
+ readOnly?: boolean;
879
+ }
880
+
448
881
  /**
449
882
  * ColorPicker固有のProps
450
883
  * T は string | undefined
@@ -504,8 +937,14 @@ export declare function createBlockId(kind: string): string;
504
937
  */
505
938
  export declare const createInitialProps: <P>(plugin: BlockPlugin<P>) => P;
506
939
 
940
+ export declare const DEFAULT_DPI = 96;
941
+
507
942
  export declare const DEFAULT_GRID: Grid;
508
943
 
944
+ export declare const DEFAULT_GUIDE_BORDER: BorderStyle;
945
+
946
+ export declare const DEFAULT_GUIDE_LINE: LineStyle;
947
+
509
948
  export declare const DEFAULT_PAPER: Paper;
510
949
 
511
950
  export declare const DEFAULT_PAPER_MARGIN: PaperMargin;
@@ -551,7 +990,7 @@ export declare interface Dimension<U extends Unit = Unit> {
551
990
 
552
991
  export declare const DimensionInput: <U extends Unit>(props: DimensionInputProps<U>) => default_2.ReactElement;
553
992
 
554
- declare interface DimensionInputConfig<U extends Unit> {
993
+ export declare interface DimensionInputConfig<U extends Unit> {
555
994
  allowedUnits?: readonly U[];
556
995
  min?: number;
557
996
  max?: number;
@@ -608,6 +1047,59 @@ export declare function dimensionToString<U extends Unit>(dim: Dimension<U>): st
608
1047
  */
609
1048
  export declare function distributeRemainder(floatPixels: number[]): number[];
610
1049
 
1050
+ /**
1051
+ * ドラッグ状態の詳細情報
1052
+ */
1053
+ export declare interface DraggingState {
1054
+ /** ドラッグ種別 */
1055
+ type: DragType;
1056
+ /** ドラッグ対象のブロックID群 */
1057
+ blockIds: string[];
1058
+ /** 開始グリッド座標 */
1059
+ startGrid: {
1060
+ col: number;
1061
+ row: number;
1062
+ };
1063
+ /** 現在のグリッド座標 */
1064
+ currentGrid: {
1065
+ col: number;
1066
+ row: number;
1067
+ };
1068
+ /** 現在のマウス座標 (px, キャンバス相対) - キャンバス外でのゴースト表示用 */
1069
+ currentMousePx?: {
1070
+ x: number;
1071
+ y: number;
1072
+ };
1073
+ /** リサイズ用: ハンドル位置 */
1074
+ handle?: ResizeHandle;
1075
+ /** 挿入用: プラグイン種別 */
1076
+ pluginKind?: string;
1077
+ /** 挿入用: デフォルトサイズ */
1078
+ defaultSize?: {
1079
+ w: number;
1080
+ h: number;
1081
+ };
1082
+ /** キャンバス外フラグ (true: 範囲外でドロップすると削除) */
1083
+ isOutside?: boolean;
1084
+ }
1085
+
1086
+ export declare const DragLayer: MemoExoticComponent<({ blocks, pluginRegistry, gridLength, draggingState, getBlockRectPx, selectionStyle, ghostZIndex, selectBorderZIndex, blockHandlesZIndex, }: DragLayerProps) => JSX_2.Element | null>;
1087
+
1088
+ export declare interface DragLayerProps {
1089
+ blocks: Block[];
1090
+ pluginRegistry: Record<string, BlockPlugin>;
1091
+ gridLength: {
1092
+ cols: number;
1093
+ rows: number;
1094
+ };
1095
+ draggingState: DraggingState | undefined;
1096
+ getBlockRectPx: (block: Block) => BlockRectPx;
1097
+ selectionStyle?: BorderStyle;
1098
+ ghostZIndex?: number;
1099
+ selectBorderZIndex?: number;
1100
+ blockHandlesZIndex?: number;
1101
+ }
1102
+
611
1103
  /**
612
1104
  * GlobalDragStore
613
1105
  *
@@ -656,6 +1148,46 @@ export declare type DragState = {
656
1148
  };
657
1149
  } | null;
658
1150
 
1151
+ /**
1152
+ * ドラッグ種別
1153
+ *
1154
+ * @remarks
1155
+ * ドラッグ操作の種類を型安全に扱うための列挙型
1156
+ */
1157
+ export declare enum DragType {
1158
+ /** ブロックの移動 */
1159
+ MOVE = "move",
1160
+ /** ブロックのリサイズ */
1161
+ RESIZE = "resize",
1162
+ /** 新規ブロックの挿入 */
1163
+ INSERT = "insert"
1164
+ }
1165
+
1166
+ export declare const EditingBlock: typeof ForwardedEditingBlock;
1167
+
1168
+ export declare interface EditingBlockProps<P = Record<string, Value>, V = Value> {
1169
+ /** ブロックID */
1170
+ id: string;
1171
+ /** プラグイン定義 */
1172
+ plugin: BlockPlugin<P, V>;
1173
+ /** プラグイン固有プロパティ */
1174
+ props: P;
1175
+ /** ブロックの現在値 */
1176
+ value: V;
1177
+ /** 値変更コールバック */
1178
+ onChange: (value: V) => void;
1179
+ /** 値確定コールバック (オプション) */
1180
+ onBlur?: (value: V) => void;
1181
+ /** ブロックの位置とサイズ(ピクセル単位) */
1182
+ blockRectPx: BlockRectPx;
1183
+ /** z-index (オプション、デフォルト: Z_INDEX.EDIT_BLOCK) */
1184
+ zIndex?: number;
1185
+ /** バリデーション状態 (オプション) */
1186
+ validationState?: "valid" | "invalid" | "warning";
1187
+ /** 追加のクラス名 */
1188
+ className?: string;
1189
+ }
1190
+
659
1191
  /**
660
1192
  * 印刷を実行(準備 + 印刷 + クリーンアップ)
661
1193
  */
@@ -676,6 +1208,19 @@ export declare interface FeaturePlugin {
676
1208
  kind: string;
677
1209
  }
678
1210
 
1211
+ /**
1212
+ * 指定された座標にあるブロックを検索します
1213
+ *
1214
+ * @param point - 検索対象の座標 (Client/Offset座標ではなく、InteractionLayer内の相対座標)
1215
+ * @param blocks - ブロックのリスト
1216
+ * @param getBlockRectPx - ブロックからピクセル矩形を計算する関数 (useGridCalc由来)
1217
+ * @returns 見つかったブロックのID。見つからない場合は null
1218
+ */
1219
+ export declare function findBlockAtPoint(point: {
1220
+ x: number;
1221
+ y: number;
1222
+ }, blocks: Block[], getBlockRectPx: (block: Block) => BlockRectPx): string | null;
1223
+
679
1224
  export declare function findGridIndex(starts: readonly number[], maxStep: number, windowPx: number): (px: number) => number;
680
1225
 
681
1226
  export declare const FONT_UNITS: readonly ["px", "pt", "mm"];
@@ -705,6 +1250,14 @@ export declare interface FormSchema {
705
1250
  metaData?: Record<string, Value>;
706
1251
  }
707
1252
 
1253
+ declare const ForwardedBlockRenderer: <P extends Record<string, Value> = Record<string, Value>, V extends Value = Value>(props: BlockRendererProps<P, V> & {
1254
+ ref?: default_2.Ref<BlockRef>;
1255
+ }) => default_2.ReactElement;
1256
+
1257
+ declare const ForwardedEditingBlock: <P extends Record<string, Value>, V extends Value>(props: EditingBlockProps<P, V> & {
1258
+ ref?: default_2.ForwardedRef<BlockRef>;
1259
+ }) => default_2.ReactElement;
1260
+
708
1261
  /**
709
1262
  * ブロックコンテナの共通スタイルを生成
710
1263
  *
@@ -741,6 +1294,28 @@ export declare function getBlockContainerStyle(blockRectPx: BlockRectPx, options
741
1294
  */
742
1295
  export declare function getBlockZIndex(index: number): number;
743
1296
 
1297
+ /**
1298
+ * 選択中のブロックから共通の値を取得する
1299
+ * 値がバラバラの場合は undefined を返す
1300
+ *
1301
+ * @param blocks 選択中のブロック配列
1302
+ * @param path プロパティへのパス (例: "props.text", "layout.x", "style.backgroundColor")
1303
+ * @returns 全ブロックで共通の値、または値が異なる場合は undefined
1304
+ *
1305
+ * @example
1306
+ * ```ts
1307
+ * // propsの値を取得
1308
+ * const textValue = getCommonValue(blocks, "props.text");
1309
+ *
1310
+ * // layoutの値を取得
1311
+ * const xPos = getCommonValue<number>(blocks, "layout.x");
1312
+ *
1313
+ * // styleの値を取得
1314
+ * const bgColor = getCommonValue(blocks, "style.backgroundColor");
1315
+ * ```
1316
+ */
1317
+ export declare function getCommonValue<T = Value>(blocks: Block[], path: string): T | undefined;
1318
+
744
1319
  /**
745
1320
  * サポートされる最大ブロック数を取得
746
1321
  *
@@ -871,6 +1446,37 @@ export declare interface GridChangeEvent {
871
1446
 
872
1447
  export declare type GridChangeType = "resize" | "insert" | "delete" | "equalize";
873
1448
 
1449
+ /**
1450
+ * GridDimensionLabel - グリッド線間の寸法表示
1451
+ *
1452
+ * グリッド線と線の間に寸法(値と単位)を表示します。
1453
+ * ダブルクリックで単位編集UIを表示します。
1454
+ */
1455
+ export declare const GridDimensionLabel: MemoExoticComponent<({ direction, index, dimension, position, currentPxSize, marginLeftPx, marginTopPx, isNearCursor, resizingPxSize, onDimensionChange, }: GridDimensionLabelProps) => JSX_2.Element | null>;
1456
+
1457
+ export declare interface GridDimensionLabelProps {
1458
+ /** ラベルの方向 ('column' or 'row') */
1459
+ direction: "column" | "row";
1460
+ /** 次元のインデックス(配列のインデックス) */
1461
+ index: number;
1462
+ /** 寸法の値(Dimensionオブジェクト) */
1463
+ dimension: Dimension<GridUnit>;
1464
+ /** ラベルの位置 (px) - 中央座標 */
1465
+ position: number;
1466
+ /** 現在のpxサイズ(単位変換用) */
1467
+ currentPxSize: number;
1468
+ /** 印刷可能領域の左マージン (px) */
1469
+ marginLeftPx: number;
1470
+ /** 印刷可能領域の上マージン (px) */
1471
+ marginTopPx: number;
1472
+ /** カーソルが近い場合にのみ表示 */
1473
+ isNearCursor: boolean;
1474
+ /** リサイズ中のプレビューサイズ(px) - 指定時は単位変換して表示 */
1475
+ resizingPxSize?: number;
1476
+ /** 寸法更新時のコールバック */
1477
+ onDimensionChange?: (direction: "column" | "row", index: number, dimension: Dimension<GridUnit>) => void;
1478
+ }
1479
+
874
1480
  /**
875
1481
  * GridLayer - グリッドシステムの統合コンポーネント
876
1482
  *
@@ -961,6 +1567,54 @@ export declare interface GridPosPx {
961
1567
  rows: number[];
962
1568
  }
963
1569
 
1570
+ /**
1571
+ * GridResizeHandle - グリッドリサイズ用のハンドル
1572
+ *
1573
+ * グリッド線の両端にハンドルを配置し、ドラッグでリサイズ可能にします。
1574
+ * 設計文書に従い、「グリッド線そのもののドラッグは禁止」し、
1575
+ * 「グリッド線の両端ハンドル」のみをドラッグ可能とします。
1576
+ */
1577
+ export declare const GridResizeHandle: MemoExoticComponent<({ direction, index, position, marginLeftPx, marginTopPx, onResizeStart, onResize, onResizeEnd, }: GridResizeHandleProps) => JSX_2.Element>;
1578
+
1579
+ /**
1580
+ * @file GridResizeHandle.tsx
1581
+ * @description グリッドリサイズ用のハンドルコンポーネント
1582
+ */
1583
+ export declare interface GridResizeHandleProps {
1584
+ /** ハンドルの方向 ('column' or 'row') */
1585
+ direction: "column" | "row";
1586
+ /** グリッドのインデックス (列なら列番号、行なら行番号) */
1587
+ index: number;
1588
+ /** ハンドルの位置 (px) - グリッド線の位置 */
1589
+ position: number;
1590
+ /** 印刷可能領域の左マージン (px) */
1591
+ marginLeftPx: number;
1592
+ /** 印刷可能領域の上マージン (px) */
1593
+ marginTopPx: number;
1594
+ /** リサイズ開始時のコールバック */
1595
+ onResizeStart?: (direction: "column" | "row", index: number) => void;
1596
+ /** リサイズ中のコールバック */
1597
+ onResize?: (direction: "column" | "row", index: number, delta: number) => void;
1598
+ /** リサイズ終了時のコールバック */
1599
+ onResizeEnd?: (direction: "column" | "row", index: number, delta: number) => void;
1600
+ }
1601
+
1602
+ /**
1603
+ * GridSizePanel
1604
+ * 行・列数を変更するパネル
1605
+ */
1606
+ export declare const GridSizePanel: {
1607
+ ({ grid, onGridChange }: GridSizePanelProps): JSX_2.Element;
1608
+ displayName: string;
1609
+ };
1610
+
1611
+ export declare interface GridSizePanelProps {
1612
+ /** グリッド設定 */
1613
+ grid: Grid;
1614
+ /** グリッド変更時のコールバック */
1615
+ onGridChange: (grid: Grid) => void;
1616
+ }
1617
+
964
1618
  export declare function gridToMms(dims: Dimension<GridUnit>[], contentSizeMm: number): number[];
965
1619
 
966
1620
  export declare function gridToPxs(dims: Dimension<GridUnit>[], contentSizeMm: number, dpi: number): number[];
@@ -994,6 +1648,256 @@ export declare interface ImageSchema {
994
1648
  alt?: string;
995
1649
  }
996
1650
 
1651
+ /**
1652
+ * ImportExportPanel
1653
+ * スキーマと値のインポート/エクスポート機能を提供
1654
+ */
1655
+ export declare const ImportExportPanel: {
1656
+ ({ schema, values, onSchemaChange, onValuesChange, }: ImportExportPanelProps): JSX_2.Element;
1657
+ displayName: string;
1658
+ };
1659
+
1660
+ export declare interface ImportExportPanelProps {
1661
+ /** スキーマ */
1662
+ schema: FormSchema;
1663
+ /** 値 */
1664
+ values: Record<string, Value>;
1665
+ /** スキーマ変更時のコールバック */
1666
+ onSchemaChange: (schema: FormSchema) => void;
1667
+ /** 値変更時のコールバック */
1668
+ onValuesChange: (values: Record<string, Value>) => void;
1669
+ }
1670
+
1671
+ export declare const InsertGhost: MemoExoticComponent<({ pluginRegistry, gridLength, getBlockRectPx, currentGrid, currentMousePx, pluginKind, defaultSize, isOutside, selectionStyle, ghostZIndex, selectBorderZIndex, blockHandlesZIndex, }: InsertGhostProps) => JSX_2.Element | null>;
1672
+
1673
+ export declare interface InsertGhostProps {
1674
+ pluginRegistry: Record<string, BlockPlugin>;
1675
+ gridLength: {
1676
+ cols: number;
1677
+ rows: number;
1678
+ };
1679
+ getBlockRectPx: (block: Block) => BlockRectPx;
1680
+ currentGrid: {
1681
+ col: number;
1682
+ row: number;
1683
+ };
1684
+ currentMousePx?: {
1685
+ x: number;
1686
+ y: number;
1687
+ };
1688
+ pluginKind: string;
1689
+ defaultSize: {
1690
+ w: number;
1691
+ h: number;
1692
+ };
1693
+ isOutside: boolean;
1694
+ selectionStyle: BorderStyle;
1695
+ ghostZIndex?: number;
1696
+ selectBorderZIndex?: number;
1697
+ blockHandlesZIndex?: number;
1698
+ }
1699
+
1700
+ export declare const InteractionBlock: default_2.MemoExoticComponent<({ block, rect, showHandles, onResizeStart, activeHandle, selectionStyle, handleStyle, selectBorderZIndex, blockHandlesZIndex, }: InteractionBlockProps) => JSX_2.Element>;
1701
+
1702
+ export declare interface InteractionBlockProps {
1703
+ block: Block;
1704
+ rect: BlockRectPx;
1705
+ showHandles?: boolean;
1706
+ onResizeStart?: (e: default_2.PointerEvent, handle: ResizeHandle) => void;
1707
+ activeHandle?: ResizeHandle | null;
1708
+ selectionStyle?: BorderStyle;
1709
+ handleStyle?: typeof RESIZE_HANDLE_STYLE;
1710
+ /** 選択枠のz-index (デフォルト: interactionZIndexs.select_border) */
1711
+ selectBorderZIndex?: number;
1712
+ /** リサイズハンドルのz-index (デフォルト: interactionZIndexs.block_handles) */
1713
+ blockHandlesZIndex?: number;
1714
+ }
1715
+
1716
+ /**
1717
+ * インタラクション変更イベント
1718
+ *
1719
+ * @remarks
1720
+ * OnBlockChangeと同じパターン (type付きUnion型)
1721
+ * 全ての操作をこのイベントで表現する
1722
+ */
1723
+ export declare type InteractionChangeEvent = {
1724
+ type: InteractionEventType.SELECT;
1725
+ blockIds: string[];
1726
+ shiftKey?: boolean;
1727
+ } | {
1728
+ type: InteractionEventType.DESELECT;
1729
+ } | {
1730
+ type: InteractionEventType.START_PRESS;
1731
+ blockId: string;
1732
+ startGrid: {
1733
+ col: number;
1734
+ row: number;
1735
+ };
1736
+ selectedBlockIds?: string[];
1737
+ } | {
1738
+ type: InteractionEventType.UPDATE_DRAG;
1739
+ currentGrid: {
1740
+ col: number;
1741
+ row: number;
1742
+ };
1743
+ currentMousePx: {
1744
+ x: number;
1745
+ y: number;
1746
+ };
1747
+ isOutside?: boolean;
1748
+ } | {
1749
+ type: InteractionEventType.END_DRAG;
1750
+ } | {
1751
+ type: InteractionEventType.CANCEL_DRAG;
1752
+ } | {
1753
+ type: InteractionEventType.EDIT;
1754
+ blockId: string;
1755
+ } | {
1756
+ type: InteractionEventType.END_EDIT;
1757
+ } | {
1758
+ type: InteractionEventType.START_INSERT;
1759
+ pluginKind: string;
1760
+ defaultSize: {
1761
+ w: number;
1762
+ h: number;
1763
+ };
1764
+ } | {
1765
+ type: InteractionEventType.CANCEL_INSERT;
1766
+ } | {
1767
+ type: InteractionEventType.START_RESIZE;
1768
+ blockId: string;
1769
+ handle: ResizeHandle;
1770
+ startGrid: {
1771
+ col: number;
1772
+ row: number;
1773
+ };
1774
+ };
1775
+
1776
+ /**
1777
+ * インタラクション変更イベント種別
1778
+ *
1779
+ * @remarks
1780
+ * インタラクション変更イベントの種類を型安全に扱うための列挙型
1781
+ */
1782
+ export declare enum InteractionEventType {
1783
+ /** ブロックを選択 */
1784
+ SELECT = "select",
1785
+ /** 選択を解除 */
1786
+ DESELECT = "deselect",
1787
+ /** プレス開始(ドラッグ判定前) */
1788
+ START_PRESS = "startPress",
1789
+ /** ドラッグ更新 */
1790
+ UPDATE_DRAG = "updateDrag",
1791
+ /** ドラッグ終了 */
1792
+ END_DRAG = "endDrag",
1793
+ /** ドラッグキャンセル */
1794
+ CANCEL_DRAG = "cancelDrag",
1795
+ /** 編集開始 */
1796
+ EDIT = "edit",
1797
+ /** 編集終了 */
1798
+ END_EDIT = "endEdit",
1799
+ /** 挿入開始 */
1800
+ START_INSERT = "startInsert",
1801
+ /** 挿入キャンセル */
1802
+ CANCEL_INSERT = "cancelInsert",
1803
+ /** リサイズ開始 */
1804
+ START_RESIZE = "startResize"
1805
+ }
1806
+
1807
+ export declare const InteractionLayer: MemoExoticComponent<({ blocks, pluginRegistry, gridLength, getBlockRectPx, getColIndex, getRowIndex, state, onChange, onBlockChange, scale, className, selectionStyle, handleStyle, editBlockZIndex, selectBorderZIndex, blockHandlesZIndex, dragGhostZIndex, }: InteractionLayerProps) => JSX_2.Element>;
1808
+
1809
+ /**
1810
+ * InteractionLayerProps
1811
+ */
1812
+ export declare interface InteractionLayerProps {
1813
+ blocks: Block[];
1814
+ pluginRegistry: Record<string, BlockPlugin>;
1815
+ gridLength: {
1816
+ cols: number;
1817
+ rows: number;
1818
+ };
1819
+ getBlockRectPx: (block: Block) => BlockRectPx;
1820
+ getColIndex: (px: number) => number;
1821
+ getRowIndex: (px: number) => number;
1822
+ state: InteractionState;
1823
+ onChange: OnInteractionChange;
1824
+ onBlockChange?: OnBlockChange;
1825
+ scale?: number;
1826
+ className?: string;
1827
+ selectionStyle?: BorderStyle;
1828
+ handleStyle?: typeof RESIZE_HANDLE_STYLE;
1829
+ editBlockZIndex?: number;
1830
+ selectBorderZIndex?: number;
1831
+ blockHandlesZIndex?: number;
1832
+ dragGhostZIndex?: number;
1833
+ }
1834
+
1835
+ /**
1836
+ * インタラクションモード
1837
+ *
1838
+ * @remarks
1839
+ * インタラクション操作の状態を型安全に扱うための列挙型
1840
+ */
1841
+ export declare enum InteractionMode {
1842
+ /** 待機状態 */
1843
+ IDLE = "idle",
1844
+ /** マウスダウン中(クリックかドラッグか判定前) */
1845
+ PRESSING = "pressing",
1846
+ /** ドラッグ確定 */
1847
+ DRAGGING = "dragging",
1848
+ /** 編集中 */
1849
+ EDITING = "editing"
1850
+ }
1851
+
1852
+ /**
1853
+ * インタラクション状態 (単一オブジェクト)
1854
+ *
1855
+ * @remarks
1856
+ * Pluginの `value` に相当する統合状態
1857
+ * 全ての操作状態をこのオブジェクト1つで管理する
1858
+ */
1859
+ export declare interface InteractionState {
1860
+ /** 現在のモード */
1861
+ mode: InteractionMode;
1862
+ /** 選択中のブロックID群 */
1863
+ selectedBlockIds: string[];
1864
+ /** 編集中のブロックID (nullの場合は編集モードではない) */
1865
+ editingBlockId: string | null;
1866
+ /** ドラッグ中の状態 (ドラッグ中のみ有効) */
1867
+ dragging?: DraggingState;
1868
+ }
1869
+
1870
+ export declare const interactionZIndexs: {
1871
+ readonly base: 2100000;
1872
+ readonly select_block: 2000000;
1873
+ readonly block_ghost: 2200000;
1874
+ readonly hover_outline: 2300000;
1875
+ readonly edit_block: 2400000;
1876
+ readonly grid_ghost: 2700000;
1877
+ readonly grid_handles: 2800000;
1878
+ readonly select_border: 2500000;
1879
+ readonly block_handles: 2600000;
1880
+ readonly rubber_band: 2900000;
1881
+ };
1882
+
1883
+ /**
1884
+ * Hex カラー文字列の妥当性をチェック
1885
+ * @param hex チェックする文字列
1886
+ * @returns 妥当な Hex カラー文字列かどうか
1887
+ */
1888
+ export declare function isValidHex(hex: string): boolean;
1889
+
1890
+ export declare const LayoutPanel: default_2.FC<LayoutPanelProps>;
1891
+
1892
+ export declare interface LayoutPanelProps {
1893
+ selectedBlocks: Block[];
1894
+ onUpdateBlocks: (updates: Record<string, Partial<Block>>) => void;
1895
+ gridSize?: {
1896
+ cols: number;
1897
+ rows: number;
1898
+ };
1899
+ }
1900
+
997
1901
  export declare interface LineStyle {
998
1902
  color: string;
999
1903
  width: Dimension<BorderUnit>;
@@ -1032,8 +1936,55 @@ export declare interface MarginOverlayProps {
1032
1936
  className?: string;
1033
1937
  }
1034
1938
 
1939
+ /**
1940
+ * MarginPanel
1941
+ * マージンを変更するパネル
1942
+ */
1943
+ export declare const MarginPanel: {
1944
+ ({ paper, onPaperChange }: MarginPanelProps): JSX_2.Element;
1945
+ displayName: string;
1946
+ };
1947
+
1948
+ export declare interface MarginPanelProps {
1949
+ /** 用紙設定 */
1950
+ paper: Paper;
1951
+ /** 用紙変更時のコールバック */
1952
+ onPaperChange: (paper: Paper) => void;
1953
+ }
1954
+
1955
+ export declare const MetaPanel: default_2.FC<MetaPanelProps>;
1956
+
1957
+ export declare interface MetaPanelProps {
1958
+ selectedBlocks: Block[];
1959
+ onUpdateBlocks: (updates: Record<string, Partial<Block>>) => void;
1960
+ }
1961
+
1035
1962
  export declare function mmsToPxs(mms: number[], dpi?: number): number[];
1036
1963
 
1964
+ export declare const MovingGhost: MemoExoticComponent<({ blocks, pluginRegistry, gridLength, getBlockRectPx, selectedBlockIds, deltaCol, deltaRow, isOutside, currentMousePx, selectionStyle, ghostZIndex, selectBorderZIndex, blockHandlesZIndex, }: MovingGhostProps) => JSX_2.Element>;
1965
+
1966
+ export declare interface MovingGhostProps {
1967
+ blocks: Block[];
1968
+ pluginRegistry: Record<string, BlockPlugin>;
1969
+ gridLength: {
1970
+ cols: number;
1971
+ rows: number;
1972
+ };
1973
+ getBlockRectPx: (block: Block) => BlockRectPx;
1974
+ selectedBlockIds: string[];
1975
+ deltaCol: number;
1976
+ deltaRow: number;
1977
+ isOutside: boolean;
1978
+ currentMousePx?: {
1979
+ x: number;
1980
+ y: number;
1981
+ };
1982
+ selectionStyle: BorderStyle;
1983
+ ghostZIndex?: number;
1984
+ selectBorderZIndex?: number;
1985
+ blockHandlesZIndex?: number;
1986
+ }
1987
+
1037
1988
  export declare const multilineDefinition: PluginProperties<MultilineSchema>;
1038
1989
 
1039
1990
  export declare interface MultilineSchema {
@@ -1127,7 +2078,7 @@ export declare const NumberInput: {
1127
2078
  displayName: string;
1128
2079
  };
1129
2080
 
1130
- declare interface NumberInputConfig {
2081
+ export declare interface NumberInputConfig {
1131
2082
  min?: number;
1132
2083
  max?: number;
1133
2084
  step?: number;
@@ -1162,6 +2113,15 @@ export declare type OnError = (error: Error, context?: string) => void;
1162
2113
 
1163
2114
  export declare type OnGridChange = (event: GridChangeEvent) => void;
1164
2115
 
2116
+ /**
2117
+ * インタラクション変更コールバック
2118
+ *
2119
+ * @remarks
2120
+ * Pluginの `onChange` に相当
2121
+ * 全ての操作変更をこの1つのコールバックで処理する
2122
+ */
2123
+ export declare type OnInteractionChange = (event: InteractionChangeEvent) => void;
2124
+
1165
2125
  export declare type OnPaperChange = (event: PaperChangeEvent) => void;
1166
2126
 
1167
2127
  export declare type OnSchemaChange = (schema: FormSchema) => void;
@@ -1177,6 +2137,27 @@ export declare type OnValuesChange = (values: Record<string, Value>) => void;
1177
2137
  */
1178
2138
  export declare type Orientation = "portrait" | "landscape";
1179
2139
 
2140
+ /**
2141
+ * OtherPanel
2142
+ * その他の設定の統合パネル
2143
+ * - ImportExportPanel: スキーマ・値のインポート/エクスポート
2144
+ */
2145
+ export declare const OtherPanel: {
2146
+ ({ schema, values, onSchemaChange, onValuesChange, }: OtherPanelProps): JSX_2.Element;
2147
+ displayName: string;
2148
+ };
2149
+
2150
+ export declare interface OtherPanelProps {
2151
+ /** フォームスキーマ */
2152
+ schema: FormSchema;
2153
+ /** 入力データ */
2154
+ values: Record<string, Value>;
2155
+ /** スキーマ変更時のコールバック */
2156
+ onSchemaChange: (newSchema: FormSchema) => void;
2157
+ /** 入力データ変更時のコールバック */
2158
+ onValuesChange: (newValues: Record<string, Value>) => void;
2159
+ }
2160
+
1180
2161
  export declare const PADDING_UNITS: readonly ["mm", "pt", "px", "%"];
1181
2162
 
1182
2163
  /**
@@ -1207,7 +2188,7 @@ export declare const PalettePanel: {
1207
2188
  displayName: string;
1208
2189
  };
1209
2190
 
1210
- declare interface PalettePanelProps {
2191
+ export declare interface PalettePanelProps {
1211
2192
  /** 利用可能なプラグイン一覧 */
1212
2193
  plugins: BlockPlugin[];
1213
2194
  /** カスタムクラス名 */
@@ -1264,6 +2245,22 @@ export declare interface PaperSize {
1264
2245
  height: Dimension<PaperUnit>;
1265
2246
  }
1266
2247
 
2248
+ /**
2249
+ * PaperSizePanel
2250
+ * 用紙サイズを変更するパネル
2251
+ */
2252
+ export declare const PaperSizePanel: {
2253
+ ({ paper, onPaperChange, }: PaperSizePanelProps): JSX_2.Element;
2254
+ displayName: string;
2255
+ };
2256
+
2257
+ export declare interface PaperSizePanelProps {
2258
+ /** 用紙設定 */
2259
+ paper: Paper;
2260
+ /** 用紙変更時のコールバック */
2261
+ onPaperChange: (paper: Paper) => void;
2262
+ }
2263
+
1267
2264
  export declare enum PaperSizePreset {
1268
2265
  A4 = "A4",
1269
2266
  B5 = "B5",
@@ -1275,6 +2272,13 @@ export declare enum PaperSizePreset {
1275
2272
 
1276
2273
  export declare type PaperUnit = (typeof PAPER_UNITS)[number];
1277
2274
 
2275
+ /**
2276
+ * カラー文字列を RGBA オブジェクトに変換
2277
+ * @param value カラー文字列 (#RRGGBB, #RRGGBBAA, rgba(r,g,b,a), undefined)
2278
+ * @returns RGBA オブジェクト、または null(変換失敗時)
2279
+ */
2280
+ export declare function parseColor(value: string | undefined): RGBA | null;
2281
+
1278
2282
  /**
1279
2283
  * PlaceholderSchema の実体定義
1280
2284
  */
@@ -1298,6 +2302,14 @@ export declare interface PluginIconProps {
1298
2302
  style?: default_2.CSSProperties;
1299
2303
  }
1300
2304
 
2305
+ export declare const PluginPanels: React.FC<PluginPanelsProps>;
2306
+
2307
+ export declare interface PluginPanelsProps {
2308
+ selectedBlocks: Block[];
2309
+ pluginRegistry: Record<string, BlockPlugin>;
2310
+ onUpdateBlocks: (updates: Record<string, Partial<Block>>) => void;
2311
+ }
2312
+
1301
2313
  export declare type PluginProperties<P> = {
1302
2314
  [K in keyof P]-?: PropertyConfig<P[K], P>;
1303
2315
  };
@@ -1378,6 +2390,15 @@ declare interface PropertyDefinition_2<T, Context = Record<string, Value>> {
1378
2390
  }
1379
2391
  export { PropertyDefinition_2 as PropertyDefinition }
1380
2392
 
2393
+ export declare const PropertyField: MemoExoticComponent<({ propertyKey, definition, selectedBlocks, onChange, }: PropertyFieldProps) => JSX_2.Element | null>;
2394
+
2395
+ export declare interface PropertyFieldProps {
2396
+ propertyKey: string;
2397
+ definition: PropertyDefinition_2<Value, Record<string, Value>>;
2398
+ selectedBlocks: Block[];
2399
+ onChange: (key: string, val: Value) => void;
2400
+ }
2401
+
1381
2402
  /**
1382
2403
  * @file objectUtils.ts
1383
2404
  * @description オブジェクト操作のユーティリティ関数
@@ -1409,6 +2430,113 @@ export declare interface RendererProps<P = Record<string, Value>, V = Value> {
1409
2430
  validationState?: "valid" | "invalid" | "warning";
1410
2431
  }
1411
2432
 
2433
+ export declare const RESIZE_HANDLE_STYLE: ResizeHandleStyle;
2434
+
2435
+ export declare const ResizeGhost: MemoExoticComponent<({ blocks, pluginRegistry, gridLength, getBlockRectPx, blockId, handle, deltaCol, deltaRow, isOutside, selectionStyle, ghostZIndex, selectBorderZIndex, blockHandlesZIndex, }: ResizeGhostProps) => JSX_2.Element | null>;
2436
+
2437
+ export declare interface ResizeGhostProps {
2438
+ blocks: Block[];
2439
+ pluginRegistry: Record<string, BlockPlugin>;
2440
+ gridLength: {
2441
+ cols: number;
2442
+ rows: number;
2443
+ };
2444
+ getBlockRectPx: (block: Block) => BlockRectPx;
2445
+ blockId: string;
2446
+ handle: ResizeHandle;
2447
+ deltaCol: number;
2448
+ deltaRow: number;
2449
+ isOutside: boolean;
2450
+ selectionStyle: BorderStyle;
2451
+ ghostZIndex?: number;
2452
+ selectBorderZIndex?: number;
2453
+ blockHandlesZIndex?: number;
2454
+ }
2455
+
2456
+ /**
2457
+ * リサイズハンドル方向
2458
+ *
2459
+ * @remarks
2460
+ * 8方向のリサイズハンドルを型安全に扱うための列挙型
2461
+ */
2462
+ export declare enum ResizeHandle {
2463
+ /** 北(上) */
2464
+ N = "n",
2465
+ /** 北東(右上) */
2466
+ NE = "ne",
2467
+ /** 東(右) */
2468
+ E = "e",
2469
+ /** 南東(右下) */
2470
+ SE = "se",
2471
+ /** 南(下) */
2472
+ S = "s",
2473
+ /** 南西(左下) */
2474
+ SW = "sw",
2475
+ /** 西(左) */
2476
+ W = "w",
2477
+ /** 北西(左上) */
2478
+ NW = "nw"
2479
+ }
2480
+
2481
+ export declare const ResizeHandles: default_2.MemoExoticComponent<({ onResizeStart, activeHandle, handleStyle, zIndex, }: ResizeHandlesProps) => JSX_2.Element>;
2482
+
2483
+ export declare interface ResizeHandlesProps {
2484
+ onResizeStart: (e: default_2.PointerEvent, handle: ResizeHandle) => void;
2485
+ activeHandle?: ResizeHandle | null;
2486
+ handleStyle?: ResizeHandleStyle;
2487
+ zIndex?: number;
2488
+ }
2489
+
2490
+ export declare interface ResizeHandleStyle {
2491
+ size: number;
2492
+ backgroundColor: string;
2493
+ borderColor: string;
2494
+ borderWidth: number;
2495
+ borderRadius: string;
2496
+ }
2497
+
2498
+ /**
2499
+ * リサイズ計算パラメータ
2500
+ */
2501
+ export declare interface ResizeParams {
2502
+ /** 現在のレイアウト */
2503
+ layout: BlockLayout;
2504
+ /** リサイズハンドル */
2505
+ handle: ResizeHandle;
2506
+ /** 列方向の移動量 */
2507
+ deltaCol: number;
2508
+ /** 行方向の移動量 */
2509
+ deltaRow: number;
2510
+ /** グリッドの列数 */
2511
+ gridCols: number;
2512
+ /** グリッドの行数 */
2513
+ gridRows: number;
2514
+ }
2515
+
2516
+ /**
2517
+ * RGBA カラー型定義
2518
+ */
2519
+ export declare interface RGBA {
2520
+ r: number;
2521
+ g: number;
2522
+ b: number;
2523
+ a: number;
2524
+ }
2525
+
2526
+ /**
2527
+ * RGBA入力コンポーネント
2528
+ */
2529
+ export declare const RGBAInputs: {
2530
+ ({ rgba, onChange, readOnly, }: RGBAInputsProps): default_2.ReactElement;
2531
+ displayName: string;
2532
+ };
2533
+
2534
+ export declare interface RGBAInputsProps {
2535
+ rgba: RGBA;
2536
+ onChange: (channel: keyof RGBA, value: number | undefined) => void;
2537
+ readOnly?: boolean;
2538
+ }
2539
+
1412
2540
  /**
1413
2541
  * ドロップダウン選択コンポーネント
1414
2542
  */
@@ -1420,7 +2548,7 @@ export declare const Select: {
1420
2548
  /**
1421
2549
  * Config型定義
1422
2550
  */
1423
- declare interface SelectConfig {
2551
+ export declare interface SelectConfig {
1424
2552
  options?: readonly SelectOption[];
1425
2553
  placeholder?: string;
1426
2554
  width?: number;
@@ -1428,6 +2556,34 @@ declare interface SelectConfig {
1428
2556
  [key: string]: Value;
1429
2557
  }
1430
2558
 
2559
+ export declare const SELECTION_STYLE: BorderStyle;
2560
+
2561
+ export declare const SelectionBorder: MemoExoticComponent<({ width, height, zIndex, borderStyle, }: SelectionBorderProps) => JSX_2.Element>;
2562
+
2563
+ declare interface SelectionBorderProps {
2564
+ width: number;
2565
+ height: number;
2566
+ zIndex?: number;
2567
+ borderStyle?: BorderStyle;
2568
+ }
2569
+
2570
+ export declare const SelectionLayer: default_2.MemoExoticComponent<({ blocks, selectedBlockIds, isDragging, draggingState, getBlockRectPx, onResizeStart, selectionStyle, handleStyle, selectBorderZIndex, blockHandlesZIndex, }: SelectionLayerProps) => JSX_2.Element | null>;
2571
+
2572
+ export declare interface SelectionLayerProps {
2573
+ blocks: Block[];
2574
+ selectedBlockIds: string[];
2575
+ isDragging: boolean;
2576
+ draggingState?: DraggingState;
2577
+ getBlockRectPx: (block: Block) => BlockRectPx;
2578
+ onResizeStart: (e: default_2.PointerEvent, handle: ResizeHandle, blockId: string) => void;
2579
+ selectionStyle?: BorderStyle;
2580
+ handleStyle?: typeof RESIZE_HANDLE_STYLE;
2581
+ /** 選択枠のz-index (デフォルト: interactionZIndexs.select_border) */
2582
+ selectBorderZIndex?: number;
2583
+ /** リサイズハンドルのz-index (デフォルト: interactionZIndexs.block_handles) */
2584
+ blockHandlesZIndex?: number;
2585
+ }
2586
+
1431
2587
  /**
1432
2588
  * 選択肢の型
1433
2589
  */
@@ -1503,7 +2659,7 @@ export declare const Sidebar: {
1503
2659
  displayName: string;
1504
2660
  };
1505
2661
 
1506
- declare interface SidebarProps {
2662
+ export declare interface SidebarProps {
1507
2663
  /** 全ブロック */
1508
2664
  blocks: Block[];
1509
2665
  /** 選択中のブロックID一覧 */
@@ -1550,6 +2706,21 @@ export declare function stringsToDimensions<U extends Unit>(strs: string[], allo
1550
2706
 
1551
2707
  export declare function stringToDimension<U extends Unit>(str: string, allowedUnits: readonly U[]): Dimension<U>;
1552
2708
 
2709
+ /**
2710
+ * TabPanel
2711
+ * タブコンテンツの共通ラッパー
2712
+ */
2713
+ export declare const TabPanel: ({ children, emptyMessage, className, }: TabPanelProps) => JSX_2.Element;
2714
+
2715
+ export declare interface TabPanelProps {
2716
+ /** パネルの内容 */
2717
+ children: ReactNode;
2718
+ /** 空状態のメッセージ(childrenがない場合に表示) */
2719
+ emptyMessage?: string;
2720
+ /** カスタムクラス名 */
2721
+ className?: string;
2722
+ }
2723
+
1553
2724
  export declare const Tabs: default_2.FC<TabsProps>;
1554
2725
 
1555
2726
  export declare const TabsContent: default_2.FC<TabsContentProps>;
@@ -1603,7 +2774,7 @@ export declare const TextInput: {
1603
2774
  * Config型定義
1604
2775
  * Record<string, Value> との互換性を持たせる
1605
2776
  */
1606
- declare interface TextInputConfig {
2777
+ export declare interface TextInputConfig {
1607
2778
  placeholder?: string;
1608
2779
  maxLength?: number;
1609
2780
  multiline?: boolean;
@@ -1628,6 +2799,13 @@ export declare interface TextInputProps extends PropertyComponentProps<string |
1628
2799
  onBlur?: () => void;
1629
2800
  }
1630
2801
 
2802
+ /**
2803
+ * RGBA オブジェクトを Hex 文字列に変換
2804
+ * @param rgba RGBA オブジェクト
2805
+ * @returns #RRGGBB または #RRGGBBAA 形式の文字列、透明の場合は undefined
2806
+ */
2807
+ export declare function toHex(rgba: RGBA): string | undefined;
2808
+
1631
2809
  export declare const toMm: {
1632
2810
  fromCm(cm: number): number;
1633
2811
  fromInch(inch: number): number;
@@ -1646,6 +2824,13 @@ export declare const toPx: {
1646
2824
  fromDim<U extends Unit>(dim: Dimension<U>, dpi?: number, baseSizePx?: number): number;
1647
2825
  };
1648
2826
 
2827
+ /**
2828
+ * RGBA オブジェクトを rgba() 文字列に変換
2829
+ * @param rgba RGBA オブジェクト
2830
+ * @returns rgba(r, g, b, a) 形式の文字列、透明の場合は undefined
2831
+ */
2832
+ export declare function toRgbaString(rgba: RGBA): string | undefined;
2833
+
1649
2834
  export declare type Unit = (typeof ALL_UNITS)[number];
1650
2835
 
1651
2836
  /**
@@ -1689,6 +2874,43 @@ export declare const universalProperties: {
1689
2874
  readonly alignItems: PropertyConfig<VerticalAlign | undefined, AlignmentSchema>;
1690
2875
  };
1691
2876
 
2877
+ export declare function useGridCalc(paper: Paper, grid: Grid, dpi?: number): {
2878
+ paperPx: PaperPx;
2879
+ gridPosPx: GridPosPx;
2880
+ getColIndex: (px: number) => number;
2881
+ getRowIndex: (px: number) => number;
2882
+ getBlockRectPx: (block: Block) => BlockRectPx;
2883
+ };
2884
+
2885
+ /**
2886
+ * インタラクション状態管理Hook
2887
+ *
2888
+ * @remarks
2889
+ * Reducer的なロジックを内包、外部からはシンプルなAPIのみ公開
2890
+ *
2891
+ * **核心機能**: グリッド変化判定によるドラッグ確定
2892
+ * - `mode: 'pressing'` でグリッドをまたいだら → `mode: 'dragging'` に遷移
2893
+ * - ピクセル閾値 (5px) は使わない
2894
+ *
2895
+ * @param initialState - 初期状態 (オプション)
2896
+ * @returns [state, handleChange] - 状態とコールバック
2897
+ *
2898
+ * @example
2899
+ * ```tsx
2900
+ * const [state, onChange] = useInteractionState();
2901
+ *
2902
+ * // ブロックをクリック
2903
+ * onChange({ type: InteractionEventType.SELECT, blockIds: ['block-1'] });
2904
+ *
2905
+ * // ドラッグ開始 (まだpressing)
2906
+ * onChange({ type: InteractionEventType.START_PRESS, blockId: 'block-1', startGrid: { col: 0, row: 0 } });
2907
+ *
2908
+ * // グリッドをまたぐ (自動的にdraggingへ遷移)
2909
+ * onChange({ type: InteractionEventType.UPDATE_DRAG, currentGrid: { col: 1, row: 0 } });
2910
+ * ```
2911
+ */
2912
+ export declare function useInteractionState(initialState?: Partial<InteractionState>): readonly [InteractionState, (event: InteractionChangeEvent) => void];
2913
+
1692
2914
  /**
1693
2915
  * 未知の値がFormSchemaかどうかをバリデーションし、型安全に変換
1694
2916
  *