@servantcdh/ez-planet-labeling 1.0.15 → 1.0.17

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/dist/index.d.ts CHANGED
@@ -1262,6 +1262,11 @@ export declare interface LabelingApiHeaders {
1262
1262
  userName?: string;
1263
1263
  }
1264
1264
 
1265
+ declare interface LabelingCanvasObjectsState {
1266
+ objects: LabeledFabricObject[];
1267
+ setObjects: (objects: LabeledFabricObject[]) => void;
1268
+ }
1269
+
1265
1270
  /**
1266
1271
  * Data that the host feeds into the labeling workspace.
1267
1272
  * Each field mirrors one of the former react-query hooks.
@@ -1749,6 +1754,8 @@ export declare const useImageTypeLabelingToolSelectionStore: UseBoundStore<Store
1749
1754
 
1750
1755
  export declare const useLabelBatchStore: UseBoundStore<StoreApi<LabelBatchState>>;
1751
1756
 
1757
+ export declare const useLabelingCanvasObjectsStore: UseBoundStore<StoreApi<LabelingCanvasObjectsState>>;
1758
+
1752
1759
  export declare const useLabelInsertPayloadStore: UseBoundStore<StoreApi<LabelInsertPayloadState>>;
1753
1760
 
1754
1761
  export declare const useToolbarSubMenuItemsStore: UseBoundStore<StoreApi<ToolbarSubMenuItemsState>>;
package/dist/index.js CHANGED
@@ -3589,7 +3589,7 @@ const LIB_AUTHOR = "최동호";
3589
3589
  const LIB_CONTACT = "servantcdh@naver.com";
3590
3590
  const __EZ_PLANET_META__ = Object.freeze({
3591
3591
  name: LIB_NAME,
3592
- version: "1.0.15",
3592
+ version: "1.0.17",
3593
3593
  author: LIB_AUTHOR,
3594
3594
  contact: LIB_CONTACT,
3595
3595
  license: "Proprietary — See LICENSE"
@@ -6401,6 +6401,10 @@ const MagicBrush = {
6401
6401
  traceContours,
6402
6402
  simplifyContours
6403
6403
  };
6404
+ const useLabelingCanvasObjectsStore = create((set) => ({
6405
+ objects: [],
6406
+ setObjects: (objects2) => set({ objects: objects2 })
6407
+ }));
6404
6408
  const lastMousePosition = getLastMousePosition();
6405
6409
  const createBrushCursor = (brush, colorCode) => {
6406
6410
  const activeCanvas = ensureCanvas();
@@ -6484,6 +6488,8 @@ const getRectInit = ({ colorCode, callback }, isBlank, isSegmentAnything = false
6484
6488
  isBlank = isSegmentAnything;
6485
6489
  activeCanvas.getObjects().forEach((object) => object.set({ visible: false }));
6486
6490
  activeCanvas.renderAll();
6491
+ const hiddenObjects = getLabeledObjects(activeCanvas);
6492
+ useLabelingCanvasObjectsStore.getState().setObjects([...hiddenObjects]);
6487
6493
  }
6488
6494
  let lastPointX = 0;
6489
6495
  let lastPointY = 0;
@@ -6601,6 +6607,8 @@ const getRectInit = ({ colorCode, callback }, isBlank, isSegmentAnything = false
6601
6607
  getLabeledObjects(activeCanvas).forEach(
6602
6608
  (object) => object.set({ visible: true })
6603
6609
  );
6610
+ const objects2 = getLabeledObjects(activeCanvas);
6611
+ useLabelingCanvasObjectsStore.getState().setObjects([...objects2]);
6604
6612
  }
6605
6613
  if (hasContext()) {
6606
6614
  activeCanvas.renderAll();
@@ -20030,10 +20038,6 @@ const useSuperPixelConfigStore = create(
20030
20038
  }
20031
20039
  })
20032
20040
  );
20033
- const useLabelingCanvasObjectsStore = create((set) => ({
20034
- objects: [],
20035
- setObjects: (objects2) => set({ objects: objects2 })
20036
- }));
20037
20041
  const DEFAULT_RECT_STROKE = "#FF3B30";
20038
20042
  const isBoxValue = (value, inferenceType) => {
20039
20043
  if (inferenceType !== "OBJECT_DETECTION") {
@@ -26414,6 +26418,7 @@ export {
26414
26418
  useImageTypeLabelingToolSelectionStore,
26415
26419
  useLabelBatchStore,
26416
26420
  useLabelInsertPayloadStore,
26421
+ useLabelingCanvasObjectsStore,
26417
26422
  useToolbarSubMenuItemsStore,
26418
26423
  useWorkspaceConfigStore,
26419
26424
  useWorkspaceNavigationDetailSelectionStore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servantcdh/ez-planet-labeling",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",