gospelo-iconcraft-react 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,24 +1,24 @@
1
- # @gospelo-dev/iconcraft-react
1
+ # gospelo-iconcraft-react
2
2
 
3
3
  React components for creating emboss-style decorative icon shapes from SVG. Features 3D-looking shapes with highlights, shadows, and smooth animations.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install @gospelo-dev/iconcraft-react
8
+ npm install gospelo-iconcraft-react
9
9
  ```
10
10
 
11
11
  ## Quick Start
12
12
 
13
13
  ```tsx
14
- import { IconCraft } from '@gospelo-dev/iconcraft-react';
14
+ import { IconCraftShape } from 'gospelo-iconcraft-react';
15
15
 
16
16
  function App() {
17
17
  return (
18
- <IconCraft
19
- svgContent="<svg>...</svg>"
18
+ <IconCraftShape
19
+ svg="<svg>...</svg>"
20
20
  mode="wax"
21
- baseColor="#6366f1"
21
+ shapeColor="#6366f1"
22
22
  />
23
23
  );
24
24
  }
@@ -31,12 +31,13 @@ function App() {
31
31
  Modern component with full feature support.
32
32
 
33
33
  ```tsx
34
- import { IconCraftShape } from '@gospelo-dev/iconcraft-react';
34
+ import { IconCraftShape } from 'gospelo-iconcraft-react';
35
35
 
36
36
  <IconCraftShape
37
37
  svg="<svg>...</svg>"
38
38
  mode="jelly"
39
- color="#10b981"
39
+ shapeColor="#10b981"
40
+ iconColor="#1d1d1f"
40
41
  size={120}
41
42
  animation="bounce"
42
43
  shadow
@@ -49,13 +50,15 @@ import { IconCraftShape } from '@gospelo-dev/iconcraft-react';
49
50
  |------|------|---------|-------------|
50
51
  | `svg` | `string` | required | SVG content string |
51
52
  | `mode` | `'jelly' \| 'droplet' \| 'wax'` | `'jelly'` | Shape mode |
52
- | `color` | `string` | `'#6366f1'` | Base color (hex) |
53
- | `iconStyle` | `'original' \| 'white' \| 'dark' \| 'emboss'` | `'emboss'` | Icon rendering style |
53
+ | `shapeColor` | `string` | `'#6366f1'` | Shape base color (hex) |
54
+ | `iconColor` | `string` | `'#1d1d1f'` | Icon color (for stroke/fill styles) |
55
+ | `iconStyle` | `'original' \| 'emboss' \| 'stroke' \| 'fill'` | `'emboss'` | Icon rendering style |
54
56
  | `size` | `number \| string` | - | Width and height |
55
57
  | `width` | `number \| string` | - | Width |
56
58
  | `height` | `number \| string` | - | Height |
57
59
  | `shadow` | `boolean` | `true` | Show drop shadow |
58
60
  | `highlight` | `boolean` | `true` | Show highlight effect |
61
+ | `rotation` | `number` | `0` | Icon rotation in degrees (0-360). Shape follows rotated icon. |
59
62
  | `animation` | `AnimationType \| AnimationOptions` | - | Animation preset or config |
60
63
  | `animateOnHover` | `boolean` | `false` | Trigger animation on hover |
61
64
  | `offset` | `number` | `20` | Contour offset |
@@ -72,7 +75,7 @@ import { IconCraftShape } from '@gospelo-dev/iconcraft-react';
72
75
  Original component for backwards compatibility.
73
76
 
74
77
  ```tsx
75
- import { IconCraft } from '@gospelo-dev/iconcraft-react';
78
+ import { IconCraft } from 'gospelo-iconcraft-react';
76
79
 
77
80
  <IconCraft
78
81
  svgContent="<svg>...</svg>"
@@ -151,7 +154,7 @@ interface AnimationOptions {
151
154
  ### Custom Animations
152
155
 
153
156
  ```tsx
154
- import { registerAnimation, IconCraftShape } from '@gospelo-dev/iconcraft-react';
157
+ import { registerAnimation, IconCraftShape } from 'gospelo-iconcraft-react';
155
158
 
156
159
  // Register custom animation
157
160
  registerAnimation('myAnimation', {
@@ -179,16 +182,16 @@ registerAnimation('myAnimation', {
179
182
  Low-level hook for direct WASM access.
180
183
 
181
184
  ```tsx
182
- import { useIconCraft } from '@gospelo-dev/iconcraft-react';
185
+ import { useIconCraft } from 'gospelo-iconcraft-react';
183
186
 
184
187
  function MyComponent() {
185
- const { result, loading, error, generate } = useIconCraft({
188
+ const { result, isLoading, error, generate } = useIconCraft({
186
189
  svg: svgContent,
187
190
  mode: 'wax',
188
- color: '#6366f1',
191
+ shapeColor: '#6366f1',
189
192
  });
190
193
 
191
- if (loading) return <div>Loading...</div>;
194
+ if (isLoading) return <div>Loading...</div>;
192
195
  if (error) return <div>Error: {error}</div>;
193
196
 
194
197
  return (
@@ -206,7 +209,7 @@ import {
206
209
  IconCraftProvider,
207
210
  useIconCraftStore,
208
211
  IconCraftView,
209
- } from '@gospelo-dev/iconcraft-react';
212
+ } from 'gospelo-iconcraft-react';
210
213
 
211
214
  function App() {
212
215
  return (
@@ -241,7 +244,7 @@ import type {
241
244
  AnimationOptions,
242
245
  IconCraftResult,
243
246
  IconCraftShapeProps,
244
- } from '@gospelo-dev/iconcraft-react';
247
+ } from 'gospelo-iconcraft-react';
245
248
  ```
246
249
 
247
250
  ## Browser Support
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
- import * as _gospelo_dev_iconcraft_wasm from '@gospelo-dev/iconcraft-wasm';
2
+ import * as gospelo_iconcraft_wasm from 'gospelo-iconcraft-wasm';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
 
5
5
  type ShapeMode = 'jelly' | 'droplet' | 'wax';
6
- type IconStyle = 'original' | 'white' | 'dark' | 'emboss';
6
+ type IconStyle = 'original' | 'emboss' | 'stroke' | 'fill';
7
7
  /** Built-in animation types */
8
8
  type BuiltInAnimationType = 'none' | 'shake' | 'bounce' | 'pulse' | 'swing' | 'wobble' | 'jello' | 'heartbeat' | 'float' | 'spin' | 'rubberBand' | 'squish' | 'tada' | 'flip' | 'drop' | 'pop' | 'wiggle' | 'breathe';
9
9
  /**
@@ -88,6 +88,7 @@ interface IconCraftResult {
88
88
  svg_paths: SvgPaths | null;
89
89
  emboss_svg: string | null;
90
90
  icon_paths: EmbossIconData | null;
91
+ rotation: number;
91
92
  }
92
93
  interface IconCraftShapeProps {
93
94
  /** SVG content string or URL */
@@ -95,7 +96,7 @@ interface IconCraftShapeProps {
95
96
  /** Shape mode: jelly, droplet, or wax */
96
97
  mode?: ShapeMode;
97
98
  /** Base color for the shape (hex) */
98
- color?: string;
99
+ shapeColor?: string;
99
100
  /** Custom color palette (overrides color) */
100
101
  palette?: Partial<ColorPalette>;
101
102
  /** Icon rendering style */
@@ -104,6 +105,8 @@ interface IconCraftShapeProps {
104
105
  shadow?: boolean;
105
106
  /** Show highlight effect */
106
107
  highlight?: boolean;
108
+ /** Icon rotation in degrees (0-360). Applied at WASM level so shape follows rotated icon. */
109
+ rotation?: number;
107
110
  /** Contour offset (default: 20) */
108
111
  offset?: number;
109
112
  /** Rasterization resolution (default: 256) */
@@ -149,13 +152,15 @@ interface IconCraftProps {
149
152
  */
150
153
  interface IconCraftConfigOptions {
151
154
  mode?: ShapeMode;
152
- color?: string;
155
+ shapeColor?: string;
153
156
  iconStyle?: IconStyle;
157
+ iconColor?: string;
154
158
  shadow?: boolean;
155
159
  highlight?: boolean;
156
160
  offset?: number;
157
161
  resolution?: number;
158
162
  simplify?: number;
163
+ rotation?: number;
159
164
  size?: number | string;
160
165
  width?: number | string;
161
166
  height?: number | string;
@@ -173,13 +178,15 @@ declare const DEFAULT_CONFIG: Required<Omit<IconCraftConfigOptions, 'width' | 'h
173
178
  */
174
179
  declare class IconCraftConfig {
175
180
  readonly mode: ShapeMode;
176
- readonly color: string;
181
+ readonly shapeColor: string;
177
182
  readonly iconStyle: IconStyle;
183
+ readonly iconColor: string;
178
184
  readonly shadow: boolean;
179
185
  readonly highlight: boolean;
180
186
  readonly offset: number;
181
187
  readonly resolution: number;
182
188
  readonly simplify: number;
189
+ readonly rotation: number;
183
190
  readonly size: number | string;
184
191
  readonly width?: number | string;
185
192
  readonly height?: number | string;
@@ -199,7 +206,8 @@ declare class IconCraftConfig {
199
206
  resolution: number;
200
207
  simplify: number;
201
208
  includeIcon: boolean;
202
- color: string;
209
+ shapeColor: string;
210
+ rotation: number;
203
211
  };
204
212
  /**
205
213
  * スタイル用のサイズを取得
@@ -325,7 +333,8 @@ interface WasmGenerateParams {
325
333
  resolution: number;
326
334
  simplify: number;
327
335
  includeIcon: boolean;
328
- color: string;
336
+ shapeColor: string;
337
+ rotation?: number;
329
338
  }
330
339
  /**
331
340
  * WASMマネージャー(Singleton)
@@ -342,7 +351,7 @@ declare class WasmManagerClass {
342
351
  /**
343
352
  * WASMモジュールを初期化
344
353
  */
345
- init(): Promise<typeof _gospelo_dev_iconcraft_wasm>;
354
+ init(): Promise<typeof gospelo_iconcraft_wasm>;
346
355
  /**
347
356
  * 初期化済みかどうか
348
357
  */
@@ -444,6 +453,70 @@ declare class IconCraftRegistry {
444
453
  */
445
454
  declare const globalRegistry: IconCraftRegistry;
446
455
 
456
+ /**
457
+ * Dial preset definition
458
+ */
459
+ interface DialPreset {
460
+ name: string;
461
+ renderRing: (props: DialRingProps) => React.ReactNode;
462
+ renderNotch: (props: DialNotchProps) => React.ReactNode;
463
+ renderLabel?: (props: DialLabelProps) => React.ReactNode;
464
+ }
465
+ /** Default: dashed ring with circle notch */
466
+ declare const dialPresetDashed: DialPreset;
467
+ /** Solid thin ring with diamond notch */
468
+ declare const dialPresetSolid: DialPreset;
469
+ /** Tick marks ring with arrow notch */
470
+ declare const dialPresetTicks: DialPreset;
471
+ /** Dotted ring with square notch */
472
+ declare const dialPresetDotted: DialPreset;
473
+ /** Double ring with pill-shaped notch */
474
+ declare const dialPresetDouble: DialPreset;
475
+ /** Crosshair style with + shaped notch */
476
+ declare const dialPresetCrosshair: DialPreset;
477
+ /** Minimal: only quarter arcs with triangle notch */
478
+ declare const dialPresetMinimal: DialPreset;
479
+ /** Needle: dashed ring with elongated needle notch */
480
+ declare const dialPresetNeedle: DialPreset;
481
+ /** Bar: solid ring with rounded bar notch */
482
+ declare const dialPresetBar: DialPreset;
483
+ /** Arrow: tick ring with arrow-head notch */
484
+ declare const dialPresetArrow: DialPreset;
485
+ /** All presets for easy iteration */
486
+ declare const dialPresets: {
487
+ readonly dotted: DialPreset;
488
+ readonly dashed: DialPreset;
489
+ readonly solid: DialPreset;
490
+ readonly ticks: DialPreset;
491
+ readonly double: DialPreset;
492
+ readonly crosshair: DialPreset;
493
+ readonly minimal: DialPreset;
494
+ readonly needle: DialPreset;
495
+ readonly bar: DialPreset;
496
+ readonly arrow: DialPreset;
497
+ };
498
+ type DialPresetName = keyof typeof dialPresets;
499
+ /**
500
+ * Reticle preset definition
501
+ */
502
+ interface ReticlePreset {
503
+ name: string;
504
+ render: (props: ReticleProps) => React.ReactNode;
505
+ }
506
+ /** Cross: back=bottom+right arms, front=top+left arms + center dot */
507
+ declare const reticlePresetCross: ReticlePreset;
508
+ /** Bullseye: circle + center dot */
509
+ declare const reticlePresetBullseye: ReticlePreset;
510
+ /** Globe: wireframe sphere — all lines split into back (far side) and front (near side) */
511
+ declare const reticlePresetGlobe: ReticlePreset;
512
+ /** All reticle presets */
513
+ declare const reticlePresets: {
514
+ readonly cross: ReticlePreset;
515
+ readonly bullseye: ReticlePreset;
516
+ readonly globe: ReticlePreset;
517
+ };
518
+ type ReticlePresetName = keyof typeof reticlePresets;
519
+
447
520
  interface IconCraftViewProps {
448
521
  /** IconCraftInstance */
449
522
  instance: IconCraftInstance;
@@ -470,19 +543,137 @@ interface IconCraftViewProps {
470
543
  onLoad?: () => void;
471
544
  /** Error callback */
472
545
  onError?: (error: string) => void;
546
+ /** Show rotation dial overlay */
547
+ showRotationDial?: boolean;
548
+ /** Rotation change callback (called on mouseup with final degree) */
549
+ onRotationChange?: (deg: number) => void;
550
+ /** Snap angle in degrees (default: 5) */
551
+ rotationSnap?: number;
552
+ /** Custom ring SVG renderer */
553
+ renderRing?: (props: DialRingProps) => React.ReactNode;
554
+ /** Custom notch SVG renderer */
555
+ renderNotch?: (props: DialNotchProps) => React.ReactNode;
556
+ /** Custom label SVG renderer */
557
+ renderLabel?: (props: DialLabelProps) => React.ReactNode;
558
+ /** Dial preset object (overrides renderRing/renderNotch/renderLabel) */
559
+ dialPreset?: DialPreset;
560
+ /** Show center reticle */
561
+ showReticle?: boolean;
562
+ /** Custom reticle SVG renderer */
563
+ renderReticle?: (props: ReticleProps) => React.ReactNode;
564
+ /** Reticle preset object (overrides renderReticle) */
565
+ reticlePreset?: ReticlePreset;
566
+ }
567
+ /** Props passed to custom reticle renderer */
568
+ interface ReticleProps {
569
+ cx: number;
570
+ cy: number;
571
+ size: number;
572
+ /** Which layer is being rendered: 'back' (behind icon) or 'front' (above icon) */
573
+ layer: 'back' | 'front';
574
+ }
575
+ /** Props passed to custom ring renderer */
576
+ interface DialRingProps {
577
+ cx: number;
578
+ cy: number;
579
+ radius: number;
580
+ }
581
+ /** Props passed to custom notch renderer */
582
+ interface DialNotchProps {
583
+ x: number;
584
+ y: number;
585
+ /** Current angle in degrees (0 = top) */
586
+ degrees: number;
587
+ onMouseDown: (e: React.MouseEvent) => void;
588
+ }
589
+ /** Props passed to custom label renderer */
590
+ interface DialLabelProps {
591
+ x: number;
592
+ y: number;
593
+ degrees: number;
473
594
  }
474
595
  /**
475
596
  * IconCraftView - インスタンスからSVGを表示するコンポーネント
476
597
  *
477
598
  * @example
478
599
  * ```tsx
479
- * const factory = new IconCraftFactory({ mode: 'wax', color: '#6366f1' });
600
+ * const factory = new IconCraftFactory({ mode: 'wax', shapeColor: '#6366f1' });
480
601
  * const icon = factory.create('<svg>...</svg>');
481
602
  *
482
603
  * <IconCraftView instance={icon} zIndex={10} />
483
604
  * ```
484
605
  */
485
- declare function IconCraftView({ instance, animation, animationTarget, animateOnHover, zIndex, className, style, onClick, onLoad, onError, }: IconCraftViewProps): react_jsx_runtime.JSX.Element | null;
606
+ declare function IconCraftView({ instance, animation, animationTarget, animateOnHover, zIndex, className, style, onClick, onLoad, onError, showRotationDial, onRotationChange, rotationSnap, renderRing: renderRingProp, renderNotch: renderNotchProp, renderLabel: renderLabelProp, dialPreset, showReticle, renderReticle: renderReticleProp, reticlePreset, }: IconCraftViewProps): react_jsx_runtime.JSX.Element | null;
607
+
608
+ /**
609
+ * IconCraftSimple Props
610
+ *
611
+ * シンプルなインターフェースでIconCraftを使用するためのコンポーネント
612
+ */
613
+ interface IconCraftSimpleProps {
614
+ /** SVG URL または SVG文字列 */
615
+ src: string;
616
+ /** シェイプモード */
617
+ mode?: ShapeMode;
618
+ /** アイコンスタイル */
619
+ iconStyle?: IconStyle;
620
+ /** アイコンの色(stroke/fillスタイル時) */
621
+ iconColor?: string;
622
+ /** シェイプカラー (hex) */
623
+ shapeColor?: string;
624
+ /** サイズ (px) */
625
+ size?: number;
626
+ /** アニメーション種類 */
627
+ animation?: AnimationType;
628
+ /** アニメーションオプション */
629
+ animationOptions?: AnimationOptions;
630
+ /** アニメーションターゲット */
631
+ animationTarget?: AnimationTarget;
632
+ /** ホバー時にアニメーション */
633
+ animateOnHover?: boolean;
634
+ /** Z-index */
635
+ zIndex?: number;
636
+ /** クラス名 */
637
+ className?: string;
638
+ /** インラインスタイル */
639
+ style?: React.CSSProperties;
640
+ /** クリックイベント */
641
+ onClick?: () => void;
642
+ /** ロード完了コールバック */
643
+ onLoad?: () => void;
644
+ /** エラーコールバック */
645
+ onError?: (error: string) => void;
646
+ /** 詳細設定(IconCraftViewに渡す追加props) */
647
+ viewProps?: Partial<Omit<IconCraftViewProps, 'instance'>>;
648
+ }
649
+ /**
650
+ * IconCraftSimple
651
+ *
652
+ * 最もシンプルな使い方でIconCraftを利用できるコンポーネント
653
+ *
654
+ * @example
655
+ * ```tsx
656
+ * // 基本的な使い方
657
+ * <IconCraftSimple src="/icon.svg" />
658
+ *
659
+ * // カスタマイズ
660
+ * <IconCraftSimple
661
+ * src="https://example.com/icon.svg"
662
+ * mode="jelly"
663
+ * shapeColor="#6366f1"
664
+ * size={200}
665
+ * animation="float"
666
+ * />
667
+ *
668
+ * // SVG文字列を直接渡す
669
+ * <IconCraftSimple
670
+ * src={`<svg>...</svg>`}
671
+ * mode="droplet"
672
+ * iconStyle="emboss"
673
+ * />
674
+ * ```
675
+ */
676
+ declare function IconCraftSimple({ src, mode, iconStyle, iconColor, shapeColor, size, animation, animationOptions, animationTarget, animateOnHover, zIndex, className, style, onClick, onLoad, onError, viewProps, }: IconCraftSimpleProps): react_jsx_runtime.JSX.Element;
486
677
 
487
678
  /**
488
679
  * IconCraftShape - Full-featured emboss icon component
@@ -492,13 +683,13 @@ declare function IconCraftView({ instance, animation, animationTarget, animateOn
492
683
  * <IconCraftShape
493
684
  * svg="<svg>...</svg>"
494
685
  * mode="wax"
495
- * color="#6366f1"
686
+ * shapeColor="#6366f1"
496
687
  * size={120}
497
688
  * animation="float"
498
689
  * />
499
690
  * ```
500
691
  */
501
- declare function IconCraftShape({ svg, mode, color, iconStyle, shadow: _shadow, highlight: _highlight, offset, resolution, simplify, width, height, size, animation, animateOnHover, className, style, onLoad, onError, onClick, }: IconCraftShapeProps): react_jsx_runtime.JSX.Element | null;
692
+ declare function IconCraftShape({ svg, mode, shapeColor, iconStyle, shadow: _shadow, highlight: _highlight, offset, resolution, simplify, rotation, width, height, size, animation, animateOnHover, className, style, onLoad, onError, onClick, }: IconCraftShapeProps): react_jsx_runtime.JSX.Element | null;
502
693
 
503
694
  /**
504
695
  * Legacy IconCraft component
@@ -756,7 +947,7 @@ interface UseIconCraftCreateOptions {
756
947
  * @example
757
948
  * ```tsx
758
949
  * const createIcon = useIconCraftCreate({
759
- * config: { mode: 'wax', color: '#6366f1' },
950
+ * config: { mode: 'wax', shapeColor: '#6366f1' },
760
951
  * autoSelect: true,
761
952
  * });
762
953
  *
@@ -777,8 +968,8 @@ interface UseIconCraftOptions {
777
968
  svg: string;
778
969
  /** Shape mode */
779
970
  mode?: ShapeMode;
780
- /** Base color (hex) */
781
- color?: string;
971
+ /** Shape color (hex) */
972
+ shapeColor?: string;
782
973
  /** Icon style */
783
974
  iconStyle?: IconStyle;
784
975
  /** Contour offset */
@@ -787,6 +978,8 @@ interface UseIconCraftOptions {
787
978
  resolution?: number;
788
979
  /** Polygon simplification epsilon */
789
980
  simplify?: number;
981
+ /** Icon rotation in degrees (0-360) */
982
+ rotation?: number;
790
983
  /** Auto-generate on mount/change */
791
984
  autoGenerate?: boolean;
792
985
  }
@@ -812,7 +1005,7 @@ interface UseIconCraftReturn {
812
1005
  * const { result, isLoading, error } = useIconCraft({
813
1006
  * svg: '<svg>...</svg>',
814
1007
  * mode: 'wax',
815
- * color: '#6366f1',
1008
+ * shapeColor: '#6366f1',
816
1009
  * });
817
1010
  * ```
818
1011
  */
@@ -939,4 +1132,103 @@ declare function getKeyframes(type: AnimationType): string;
939
1132
  declare const keyframes: Record<BuiltInAnimationType, string>;
940
1133
  declare function injectKeyframes(type: AnimationType): void;
941
1134
 
942
- export { type AnimationOptions, type AnimationTarget, type AnimationType, type BuiltInAnimationType, type ColorPalette, type CustomAnimationDefinition, type CustomAnimationRegistry, DEFAULT_CONFIG, DEFAULT_METADATA, type EmbossIconData, type EmbossPath, IconCraft, IconCraftConfig, type IconCraftConfigOptions, type IconCraftContextValue, type IconCraftDispatcher, type IconCraftEvent, type IconCraftEventFilter, type IconCraftEventHandler, type IconCraftEventType, IconCraftFactory, IconCraftInstance, type IconCraftMetadata, type IconCraftProps, IconCraftProvider, type IconCraftProviderProps, IconCraftRegistry, type IconCraftResult, IconCraftShape, type IconCraftShapeProps, type IconCraftStoreActions, type IconCraftStoreState, IconCraftView, type IconCraftViewProps, type IconLayout, type IconStyle, type ShapeMode, type SvgPaths, type TransformOriginCustom, type TransformOriginPreset, type TransformOriginValue, type UseIconCraftCreateOptions, type UseIconCraftReturn$1 as UseIconCraftInstanceReturn, type UseIconCraftOptions, type UseIconCraftReturn, type UseIconCraftSelectionReturn, type WasmGenerateParams, WasmManager, animationDefaults, createDispatcher, defaultFactory, generateIconId, getAnimationDefaults, getAnimationName, getAnimationStyle, getCustomAnimation, getKeyframes, getTimestampFromId, getTransformOrigin, globalRegistry, injectKeyframes, keyframes, parseAnimationOptions, registerAnimation, useIconCraft, useIconCraftContext, useIconCraftCreate, useIconCraftEvent, useIconCraft$1 as useIconCraftInstance, useIconCraftSelection, useIconCraftStore, useLegacyIconCraft };
1135
+ /**
1136
+ * バックアップ用のアイコンデータ
1137
+ */
1138
+ interface IconBackupData {
1139
+ /** SVG URL または SVG文字列 */
1140
+ svg: string;
1141
+ /** シェイプモード */
1142
+ mode: ShapeMode;
1143
+ /** アイコンスタイル */
1144
+ iconStyle: IconStyle;
1145
+ /** シェイプカラー */
1146
+ shapeColor: string;
1147
+ /** サイズ */
1148
+ size: number;
1149
+ /** X座標(オプション) */
1150
+ x?: number;
1151
+ /** Y座標(オプション) */
1152
+ y?: number;
1153
+ /** Z-index(オプション) */
1154
+ zIndex?: number;
1155
+ /** アイコンの色(オプション) */
1156
+ iconColor?: string;
1157
+ /** 回転角度(オプション) */
1158
+ rotation?: number;
1159
+ /** アニメーション(オプション) */
1160
+ animation?: AnimationType;
1161
+ /** カスタムメタデータ(オプション) */
1162
+ metadata?: Record<string, unknown>;
1163
+ }
1164
+ /**
1165
+ * バックアップファイルの形式
1166
+ */
1167
+ interface IconCraftBackup {
1168
+ /** バージョン */
1169
+ version: string;
1170
+ /** 作成日時 */
1171
+ createdAt: string;
1172
+ /** ライセンス(オプション) */
1173
+ license?: string;
1174
+ /** ライセンス元URL(オプション) */
1175
+ licenseUrl?: string;
1176
+ /** アイコンデータの配列 */
1177
+ icons: IconBackupData[];
1178
+ /** グローバル設定(オプション) */
1179
+ settings?: {
1180
+ defaultMode?: ShapeMode;
1181
+ defaultIconStyle?: IconStyle;
1182
+ defaultShapeColor?: string;
1183
+ defaultSize?: number;
1184
+ };
1185
+ }
1186
+ /**
1187
+ * 現在のバックアップバージョン
1188
+ */
1189
+ declare const BACKUP_VERSION = "1.0.0";
1190
+ /**
1191
+ * バックアップ作成オプション
1192
+ */
1193
+ interface CreateBackupOptions {
1194
+ /** グローバル設定 */
1195
+ settings?: IconCraftBackup['settings'];
1196
+ /** ライセンス */
1197
+ license?: string;
1198
+ /** ライセンス元URL */
1199
+ licenseUrl?: string;
1200
+ }
1201
+ /**
1202
+ * バックアップデータを作成
1203
+ */
1204
+ declare function createBackup(icons: IconBackupData[], options?: CreateBackupOptions): IconCraftBackup;
1205
+ /**
1206
+ * バックアップをJSONファイルとしてダウンロード
1207
+ */
1208
+ declare function downloadBackup(backup: IconCraftBackup, filename?: string): void;
1209
+ /**
1210
+ * バックアップをエクスポート(JSON文字列として)
1211
+ */
1212
+ declare function exportBackup(backup: IconCraftBackup): string;
1213
+ /**
1214
+ * バックアップの検証結果
1215
+ */
1216
+ interface BackupValidationResult {
1217
+ valid: boolean;
1218
+ errors: string[];
1219
+ warnings: string[];
1220
+ }
1221
+ /**
1222
+ * バックアップデータを検証
1223
+ */
1224
+ declare function validateBackup(data: unknown): BackupValidationResult;
1225
+ /**
1226
+ * JSONファイルからバックアップを読み込み
1227
+ */
1228
+ declare function parseBackup(json: string): IconCraftBackup | null;
1229
+ /**
1230
+ * ファイル入力からバックアップを読み込み
1231
+ */
1232
+ declare function loadBackupFromFile(file: File): Promise<IconCraftBackup | null>;
1233
+
1234
+ export { type AnimationOptions, type AnimationTarget, type AnimationType, BACKUP_VERSION, type BackupValidationResult, type BuiltInAnimationType, type ColorPalette, type CreateBackupOptions, type CustomAnimationDefinition, type CustomAnimationRegistry, DEFAULT_CONFIG, DEFAULT_METADATA, type DialLabelProps, type DialNotchProps, type DialPreset, type DialPresetName, type DialRingProps, type EmbossIconData, type EmbossPath, type IconBackupData, IconCraft, type IconCraftBackup, IconCraftConfig, type IconCraftConfigOptions, type IconCraftContextValue, type IconCraftDispatcher, type IconCraftEvent, type IconCraftEventFilter, type IconCraftEventHandler, type IconCraftEventType, IconCraftFactory, IconCraftInstance, type IconCraftMetadata, type IconCraftProps, IconCraftProvider, type IconCraftProviderProps, IconCraftRegistry, type IconCraftResult, IconCraftShape, type IconCraftShapeProps, IconCraftSimple, type IconCraftSimpleProps, type IconCraftStoreActions, type IconCraftStoreState, IconCraftView, type IconCraftViewProps, type IconLayout, type IconStyle, type ReticlePreset, type ReticlePresetName, type ReticleProps, type ShapeMode, type SvgPaths, type TransformOriginCustom, type TransformOriginPreset, type TransformOriginValue, type UseIconCraftCreateOptions, type UseIconCraftReturn$1 as UseIconCraftInstanceReturn, type UseIconCraftOptions, type UseIconCraftReturn, type UseIconCraftSelectionReturn, type WasmGenerateParams, WasmManager, animationDefaults, createBackup, createDispatcher, defaultFactory, dialPresetArrow, dialPresetBar, dialPresetCrosshair, dialPresetDashed, dialPresetDotted, dialPresetDouble, dialPresetMinimal, dialPresetNeedle, dialPresetSolid, dialPresetTicks, dialPresets, downloadBackup, exportBackup, generateIconId, getAnimationDefaults, getAnimationName, getAnimationStyle, getCustomAnimation, getKeyframes, getTimestampFromId, getTransformOrigin, globalRegistry, injectKeyframes, keyframes, loadBackupFromFile, parseAnimationOptions, parseBackup, registerAnimation, reticlePresetBullseye, reticlePresetCross, reticlePresetGlobe, reticlePresets, useIconCraft, useIconCraftContext, useIconCraftCreate, useIconCraftEvent, useIconCraft$1 as useIconCraftInstance, useIconCraftSelection, useIconCraftStore, useLegacyIconCraft, validateBackup };