@yogiswara/honcho-editor-ui 3.3.4 → 3.4.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 (36) hide show
  1. package/dist/components/editor/GalleryAlbum/AlbumImageGallery.d.ts +14 -7
  2. package/dist/components/editor/GalleryAlbum/AlbumImageGallery.js +207 -5
  3. package/dist/components/editor/GalleryAlbum/ImageItemComponents.d.ts +25 -0
  4. package/dist/components/editor/GalleryAlbum/ImageItemComponents.js +179 -0
  5. package/dist/components/editor/GalleryAlbum/colorsGallery.d.ts +9 -0
  6. package/dist/components/editor/GalleryAlbum/colorsGallery.js +9 -0
  7. package/dist/components/editor/GalleryAlbum/svg/Tick.d.ts +2 -0
  8. package/dist/components/editor/GalleryAlbum/svg/Tick.js +6 -0
  9. package/dist/components/editor/HBulkAccordionColorAdjustment.js +1 -2
  10. package/dist/components/editor/HBulkAccordionColorAdjustmentColors.js +1 -1
  11. package/dist/components/editor/HBulkPreset.d.ts +3 -7
  12. package/dist/components/editor/HBulkPreset.js +21 -22
  13. package/dist/components/editor/HBulkPresetMobile.d.ts +2 -2
  14. package/dist/components/editor/HBulkPresetMobile.js +2 -2
  15. package/dist/components/editor/HImageEditorBulkMobile.d.ts +2 -2
  16. package/dist/hooks/demo/HonchoEditorBulkDemo.d.ts +0 -3
  17. package/dist/hooks/demo/HonchoEditorBulkDemo.js +770 -411
  18. package/dist/hooks/demo/HonchoEditorSingleCleanDemo.d.ts +0 -3
  19. package/dist/hooks/demo/HonchoEditorSingleCleanDemo.js +882 -354
  20. package/dist/hooks/demo/index.d.ts +0 -2
  21. package/dist/hooks/demo/index.js +3 -2
  22. package/dist/hooks/editor/type.d.ts +15 -13
  23. package/dist/hooks/editor/useHonchoEditorBulk.d.ts +47 -5
  24. package/dist/hooks/editor/useHonchoEditorBulk.js +252 -133
  25. package/dist/hooks/useAdjustmentHistory.js +12 -12
  26. package/dist/hooks/useAdjustmentHistoryBatch.d.ts +33 -31
  27. package/dist/hooks/useAdjustmentHistoryBatch.js +703 -170
  28. package/dist/hooks/usePreset.js +12 -12
  29. package/dist/index.d.ts +5 -7
  30. package/dist/index.js +5 -4
  31. package/dist/services/type.d.ts +14 -0
  32. package/dist/utils/adjustment.d.ts +1 -1
  33. package/dist/utils/adjustment.js +15 -14
  34. package/dist/utils/logger.d.ts +3 -0
  35. package/dist/utils/logger.js +11 -0
  36. package/package.json +4 -2
@@ -1,4 +1,4 @@
1
- import { AdjustmentState, Controller } from './editor/type';
1
+ import { AdjustmentState, Controller, ColorAdjustment } from './editor/type';
2
2
  export interface HistoryAdjustmentBatch {
3
3
  imageId: string;
4
4
  currentHistoryEntryId: string;
@@ -43,17 +43,17 @@ interface BatchHistoryOptions {
43
43
  devWarnings?: boolean;
44
44
  /** Default adjustment state for new images */
45
45
  defaultAdjustmentState?: Partial<AdjustmentState>;
46
- /** Controller for backend operations */
47
- controller?: Controller;
48
- /** Firebase UID for backend operations */
49
- firebaseUid?: string;
50
- /** Event ID for backend operations */
51
- eventId?: string;
52
46
  }
53
47
  /**
54
- * Information about the current batch history state
48
+ * State for batch history management
55
49
  */
56
- export interface BatchHistoryInfo {
50
+ export interface BatchHistoryState {
51
+ /** Current batch adjustment state */
52
+ currentBatch: BatchAdjustmentState;
53
+ /** Currently selected image IDs */
54
+ selectedIds: string[];
55
+ /** All image IDs being managed */
56
+ allImageIds: string[];
57
57
  /** Whether undo operation is available for selected images */
58
58
  canUndo: boolean;
59
59
  /** Whether redo operation is available for selected images */
@@ -76,21 +76,31 @@ export interface BatchHistoryActions {
76
76
  /** Apply adjustment deltas to selected images */
77
77
  adjustSelected: (delta: Partial<AdjustmentState>) => void;
78
78
  /** Apply preset values directly to selected images (preserves history) */
79
- adjustSelectedWithPreset: (presetAdjustments: AdjustmentState) => void;
79
+ adjustSelectedWithPreset: (presetAdjustments: AdjustmentState, presetId: string) => void;
80
+ /** Apply partial adjustment values directly to selected images (only updates specified properties) */
81
+ adjustSelectedWithPaste: (adjustments: Partial<AdjustmentState>) => void;
80
82
  /** Undo last changes to selected images */
81
83
  undo: () => void;
82
84
  /** Redo next changes to selected images */
83
85
  redo: () => void;
84
- /** Reset selected images to default state */
86
+ /** Reset selected images to default state (creates new history entry that can be undone) */
85
87
  reset: (imageIds?: string[]) => void;
86
88
  /** Set selection with optional initial adjustments per image */
87
89
  setSelection: (configs: ImageAdjustmentConfig[]) => void;
90
+ /** Initialize images from pagination data without backend sync */
91
+ initializeFromPagination: (configs: ImageAdjustmentConfig[]) => void;
88
92
  /** Sync/replace adjustment for images (clears their history) */
89
93
  syncAdjustment: (configs: ImageAdjustmentConfig[]) => void;
90
94
  /** Check for gallery updates and sync history for updated images */
91
95
  syncGalleryUpdates: () => Promise<void>;
96
+ /** Sync history for a specific image from backend */
97
+ syncFromBackend: (imageId: string) => Promise<void>;
98
+ /** Sync history for all images that have updates since last timestamp */
99
+ syncHistoryFromBackendAll: () => Promise<void>;
100
+ /** Clear the synced history cache (forces re-sync on next selection) */
101
+ clearSyncedHistoryCache: () => void;
92
102
  /** Add or remove image from selection */
93
- toggleSelection: (imageId: string) => void;
103
+ toggleSelection: (imageId: string) => Promise<void>;
94
104
  /** Select all images */
95
105
  selectAll: () => void;
96
106
  /** Clear selection */
@@ -103,32 +113,21 @@ export interface BatchHistoryActions {
103
113
  getCurrentBatch: () => BatchAdjustmentState;
104
114
  /** Sync entire batch state */
105
115
  syncBatch: (newBatch: BatchAdjustmentState, targetIndex?: number) => void;
106
- }
107
- /**
108
- * Configuration actions for runtime adjustment
109
- */
110
- export interface BatchHistoryConfig {
111
116
  /** Set maximum history size */
112
117
  setMaxSize: (size: number | 'unlimited') => void;
113
118
  /** Get current memory usage estimate */
114
119
  getMemoryUsage: () => number;
120
+ /** Update state from socket - syncs history if image is selected, updates state if not selected */
121
+ updateFromSocket: (imageId: string, adjustmentTaskId: string, adjustment: ColorAdjustment, preset_id?: string) => Promise<void>;
115
122
  }
116
123
  /**
117
124
  * Return type for the useAdjustmentHistoryBatch hook
118
125
  */
119
126
  export interface UseAdjustmentHistoryBatchReturn {
120
- /** Current batch adjustment state */
121
- currentBatch: BatchAdjustmentState;
122
- /** Currently selected image IDs */
123
- selectedIds: string[];
124
- /** All image IDs being managed */
125
- allImageIds: string[];
126
- /** Information about history state */
127
- historyInfo: BatchHistoryInfo;
128
- /** Available history actions */
127
+ /** All state information */
128
+ state: BatchHistoryState;
129
+ /** Available actions */
129
130
  actions: BatchHistoryActions;
130
- /** Configuration options */
131
- config: BatchHistoryConfig;
132
131
  }
133
132
  /**
134
133
  * Advanced hook for managing batch AdjustmentState history with selective undo/redo functionality.
@@ -147,7 +146,7 @@ export interface UseAdjustmentHistoryBatchReturn {
147
146
  *
148
147
  * **Typical Usage Flow:**
149
148
  * ```typescript
150
- * const { actions, currentBatch, selectedIds } = useAdjustmentHistoryBatch();
149
+ * const { state, actions } = useAdjustmentHistoryBatch(controller, firebaseUid, eventId);
151
150
  *
152
151
  * // Select images (new images get default state automatically)
153
152
  * actions.setSelection(['img1', 'img2', 'img3']);
@@ -170,8 +169,11 @@ export interface UseAdjustmentHistoryBatchReturn {
170
169
  * - `currentBatch.allImages`: All images that have been selected/adjusted (persistent)
171
170
  * - `selectedIds`: Array of currently selected image IDs
172
171
  *
172
+ * @param controller - Controller for backend operations
173
+ * @param firebaseUid - Firebase UID for backend operations
174
+ * @param eventId - Event ID for backend operations
173
175
  * @param options - Configuration options for history behavior
174
- * @returns Object with current batch, selection, history info, actions, and config
176
+ * @returns Object with state and actions
175
177
  */
176
- export declare function useAdjustmentHistoryBatch(options?: BatchHistoryOptions): UseAdjustmentHistoryBatchReturn;
178
+ export declare function useAdjustmentHistoryBatch(controller: Controller, firebaseUid: string, eventId: string, options?: BatchHistoryOptions): UseAdjustmentHistoryBatchReturn;
177
179
  export {};