@solostylist/image-editor 1.0.12 → 1.0.14
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/lib/actions/add-filter.d.ts +10 -0
- package/lib/actions/add-filter.d.ts.map +1 -0
- package/lib/actions/add-filter.js +2 -1
- package/lib/actions/change-pointer-icon.d.ts +6 -0
- package/lib/actions/change-pointer-icon.d.ts.map +1 -0
- package/lib/actions/change-rotation.d.ts +6 -0
- package/lib/actions/change-rotation.d.ts.map +1 -0
- package/lib/actions/clear-annotations-selections.d.ts +5 -0
- package/lib/actions/clear-annotations-selections.d.ts.map +1 -0
- package/lib/actions/duplicate-annotations.d.ts +9 -0
- package/lib/actions/duplicate-annotations.d.ts.map +1 -0
- package/lib/actions/enable-text-content-edit.d.ts +8 -0
- package/lib/actions/enable-text-content-edit.d.ts.map +1 -0
- package/lib/actions/enable-text-content-edit.js +2 -1
- package/lib/actions/hide-loader.d.ts +5 -0
- package/lib/actions/hide-loader.d.ts.map +1 -0
- package/lib/actions/index.d.ts +40 -0
- package/lib/actions/index.d.ts.map +1 -0
- package/lib/actions/redo.d.ts +5 -0
- package/lib/actions/redo.d.ts.map +1 -0
- package/lib/actions/remove-annotations.d.ts +9 -0
- package/lib/actions/remove-annotations.d.ts.map +1 -0
- package/lib/actions/reset.d.ts +8 -0
- package/lib/actions/reset.d.ts.map +1 -0
- package/lib/actions/select-annotation.d.ts +6 -0
- package/lib/actions/select-annotation.d.ts.map +1 -0
- package/lib/actions/select-tab.d.ts +6 -0
- package/lib/actions/select-tab.d.ts.map +1 -0
- package/lib/actions/select-tool.d.ts +9 -0
- package/lib/actions/select-tool.d.ts.map +1 -0
- package/lib/actions/set-annotation.d.ts +10 -0
- package/lib/actions/set-annotation.d.ts.map +1 -0
- package/lib/actions/set-canvas-size.d.ts +6 -0
- package/lib/actions/set-canvas-size.d.ts.map +1 -0
- package/lib/actions/set-crop.d.ts +9 -0
- package/lib/actions/set-crop.d.ts.map +1 -0
- package/lib/actions/set-crop.js +6 -1
- package/lib/actions/set-feedback.d.ts +6 -0
- package/lib/actions/set-feedback.d.ts.map +1 -0
- package/lib/actions/set-finetune.d.ts +11 -0
- package/lib/actions/set-finetune.d.ts.map +1 -0
- package/lib/actions/set-latest-color.d.ts +6 -0
- package/lib/actions/set-latest-color.d.ts.map +1 -0
- package/lib/actions/set-original-image.d.ts +6 -0
- package/lib/actions/set-original-image.d.ts.map +1 -0
- package/lib/actions/set-resize.d.ts +9 -0
- package/lib/actions/set-resize.d.ts.map +1 -0
- package/lib/actions/set-saved.d.ts +5 -0
- package/lib/actions/set-saved.d.ts.map +1 -0
- package/lib/actions/set-saving.d.ts +6 -0
- package/lib/actions/set-saving.d.ts.map +1 -0
- package/lib/actions/set-show-tabs-menu.d.ts +8 -0
- package/lib/actions/set-show-tabs-menu.d.ts.map +1 -0
- package/lib/actions/set-shown-image-dimensions.d.ts +13 -0
- package/lib/actions/set-shown-image-dimensions.d.ts.map +1 -0
- package/lib/actions/set-shown-image-dimensions.js +3 -2
- package/lib/actions/show-loader.d.ts +5 -0
- package/lib/actions/show-loader.d.ts.map +1 -0
- package/lib/actions/toggle-flip.d.ts +9 -0
- package/lib/actions/toggle-flip.d.ts.map +1 -0
- package/lib/actions/toggle-original-image-display.d.ts +8 -0
- package/lib/actions/toggle-original-image-display.d.ts.map +1 -0
- package/lib/actions/undo.d.ts +5 -0
- package/lib/actions/undo.d.ts.map +1 -0
- package/lib/actions/update-state.d.ts +7 -0
- package/lib/actions/update-state.d.ts.map +1 -0
- package/lib/actions/zoom-canvas.d.ts +10 -0
- package/lib/actions/zoom-canvas.d.ts.map +1 -0
- package/lib/components/app/index.d.ts +3 -0
- package/lib/components/app/index.d.ts.map +1 -0
- package/lib/components/app/index.js +147 -69
- package/lib/components/assembly-point/index.d.ts +8 -0
- package/lib/components/assembly-point/index.d.ts.map +1 -0
- package/lib/components/assembly-point/index.js +11 -10
- package/lib/components/common/annotation-options/annotation-options.constants.d.ts +9 -0
- package/lib/components/common/annotation-options/annotation-options.constants.d.ts.map +1 -0
- package/lib/components/common/annotation-options/index.d.ts +21 -0
- package/lib/components/common/annotation-options/index.d.ts.map +1 -0
- package/lib/components/common/annotation-options/index.js +61 -55
- package/lib/components/common/annotation-options/opacity-field.d.ts +10 -0
- package/lib/components/common/annotation-options/opacity-field.d.ts.map +1 -0
- package/lib/components/common/annotation-options/opacity-field.js +2 -1
- package/lib/components/common/annotation-options/position-fields.d.ts +8 -0
- package/lib/components/common/annotation-options/position-fields.d.ts.map +1 -0
- package/lib/components/common/annotation-options/position-fields.js +15 -13
- package/lib/components/common/annotation-options/shadow-fields.d.ts +9 -0
- package/lib/components/common/annotation-options/shadow-fields.d.ts.map +1 -0
- package/lib/components/common/annotation-options/shadow-fields.js +40 -37
- package/lib/components/common/annotation-options/stroke-fields.d.ts +9 -0
- package/lib/components/common/annotation-options/stroke-fields.d.ts.map +1 -0
- package/lib/components/common/annotation-options/stroke-fields.js +13 -10
- package/lib/components/common/button-with-menu/index.d.ts +16 -0
- package/lib/components/common/button-with-menu/index.d.ts.map +1 -0
- package/lib/components/common/button-with-menu/index.js +37 -27
- package/lib/components/common/color-input/index.d.ts +8 -0
- package/lib/components/common/color-input/index.d.ts.map +1 -0
- package/lib/components/common/color-input/index.js +21 -18
- package/lib/components/common/color-picker-modal/index.d.ts +10 -0
- package/lib/components/common/color-picker-modal/index.d.ts.map +1 -0
- package/lib/components/common/color-picker-modal/index.js +29 -22
- package/lib/components/common/hidden-upload-input/index.d.ts +3 -0
- package/lib/components/common/hidden-upload-input/index.d.ts.map +1 -0
- package/lib/components/common/hidden-upload-input/index.js +5 -2
- package/lib/components/common/icon-wrapper/index.d.ts +16 -0
- package/lib/components/common/icon-wrapper/index.d.ts.map +1 -0
- package/lib/components/common/icon-wrapper/index.js +9 -4
- package/lib/components/common/image-preview-tile/index.d.ts +14 -0
- package/lib/components/common/image-preview-tile/index.d.ts.map +1 -0
- package/lib/components/common/image-preview-tile/index.js +15 -13
- package/lib/components/common/slider/index.d.ts +12 -0
- package/lib/components/common/slider/index.d.ts.map +1 -0
- package/lib/components/common/slider/index.js +30 -23
- package/lib/components/feedback-popup/index.d.ts +8 -0
- package/lib/components/feedback-popup/index.d.ts.map +1 -0
- package/lib/components/feedback-popup/index.js +9 -6
- package/lib/components/layers/design-layer/annotation-nodes/annotation-nodes.constants.d.ts +11 -0
- package/lib/components/layers/design-layer/annotation-nodes/annotation-nodes.constants.d.ts.map +1 -0
- package/lib/components/layers/design-layer/annotation-nodes/arrow-node.d.ts +15 -0
- package/lib/components/layers/design-layer/annotation-nodes/arrow-node.d.ts.map +1 -0
- package/lib/components/layers/design-layer/annotation-nodes/arrow-node.js +6 -3
- package/lib/components/layers/design-layer/annotation-nodes/ellipse-node.d.ts +14 -0
- package/lib/components/layers/design-layer/annotation-nodes/ellipse-node.d.ts.map +1 -0
- package/lib/components/layers/design-layer/annotation-nodes/ellipse-node.js +6 -3
- package/lib/components/layers/design-layer/annotation-nodes/image-node.d.ts +14 -0
- package/lib/components/layers/design-layer/annotation-nodes/image-node.d.ts.map +1 -0
- package/lib/components/layers/design-layer/annotation-nodes/image-node.js +6 -3
- package/lib/components/layers/design-layer/annotation-nodes/index.d.ts +3 -0
- package/lib/components/layers/design-layer/annotation-nodes/index.d.ts.map +1 -0
- package/lib/components/layers/design-layer/annotation-nodes/index.js +3 -3
- package/lib/components/layers/design-layer/annotation-nodes/line-node.d.ts +12 -0
- package/lib/components/layers/design-layer/annotation-nodes/line-node.d.ts.map +1 -0
- package/lib/components/layers/design-layer/annotation-nodes/line-node.js +6 -3
- package/lib/components/layers/design-layer/annotation-nodes/memoized-annotation.d.ts +11 -0
- package/lib/components/layers/design-layer/annotation-nodes/memoized-annotation.d.ts.map +1 -0
- package/lib/components/layers/design-layer/annotation-nodes/memoized-annotation.js +6 -4
- package/lib/components/layers/design-layer/annotation-nodes/polygon-node.d.ts +15 -0
- package/lib/components/layers/design-layer/annotation-nodes/polygon-node.d.ts.map +1 -0
- package/lib/components/layers/design-layer/annotation-nodes/polygon-node.js +6 -3
- package/lib/components/layers/design-layer/annotation-nodes/rect-node.d.ts +16 -0
- package/lib/components/layers/design-layer/annotation-nodes/rect-node.d.ts.map +1 -0
- package/lib/components/layers/design-layer/annotation-nodes/rect-node.js +6 -3
- package/lib/components/layers/design-layer/annotation-nodes/text-node.d.ts +21 -0
- package/lib/components/layers/design-layer/annotation-nodes/text-node.d.ts.map +1 -0
- package/lib/components/layers/design-layer/annotation-nodes/text-node.js +6 -3
- package/lib/components/layers/design-layer/index.d.ts +3 -0
- package/lib/components/layers/design-layer/index.d.ts.map +1 -0
- package/lib/components/layers/design-layer/index.js +43 -39
- package/lib/components/layers/design-layer/nodes-common-prop-types.d.ts +45 -0
- package/lib/components/layers/design-layer/nodes-common-prop-types.d.ts.map +1 -0
- package/lib/components/layers/design-layer/preview-group.d.ts +3 -0
- package/lib/components/layers/design-layer/preview-group.d.ts.map +1 -0
- package/lib/components/layers/design-layer/preview-group.js +5 -2
- package/lib/components/layers/index.d.ts +3 -0
- package/lib/components/layers/index.d.ts.map +1 -0
- package/lib/components/layers/transformers-layer/crop-transformer.d.ts +3 -0
- package/lib/components/layers/transformers-layer/crop-transformer.d.ts.map +1 -0
- package/lib/components/layers/transformers-layer/crop-transformer.js +65 -62
- package/lib/components/layers/transformers-layer/index.d.ts +3 -0
- package/lib/components/layers/transformers-layer/index.d.ts.map +1 -0
- package/lib/components/layers/transformers-layer/index.js +7 -4
- package/lib/components/layers/transformers-layer/nodes-transformer.d.ts +3 -0
- package/lib/components/layers/transformers-layer/nodes-transformer.d.ts.map +1 -0
- package/lib/components/layers/transformers-layer/nodes-transformer.js +2 -1
- package/lib/components/layers/transformers-layer/transformers-layer.utils.d.ts +42 -0
- package/lib/components/layers/transformers-layer/transformers-layer.utils.d.ts.map +1 -0
- package/lib/components/main-canvas/canvas-node.d.ts +6 -0
- package/lib/components/main-canvas/canvas-node.d.ts.map +1 -0
- package/lib/components/main-canvas/canvas-node.js +13 -9
- package/lib/components/main-canvas/index.d.ts +3 -0
- package/lib/components/main-canvas/index.d.ts.map +1 -0
- package/lib/components/main-canvas/index.js +136 -29
- package/lib/components/main-canvas/touch-zooming-events.d.ts +11 -0
- package/lib/components/main-canvas/touch-zooming-events.d.ts.map +1 -0
- package/lib/components/main-canvas/touch-zooming-events.js +3 -2
- package/lib/components/node-controls/index.d.ts +3 -0
- package/lib/components/node-controls/index.d.ts.map +1 -0
- package/lib/components/node-controls/index.js +16 -11
- package/lib/components/tabs/index.d.ts +6 -0
- package/lib/components/tabs/index.d.ts.map +1 -0
- package/lib/components/tabs/index.js +165 -22
- package/lib/components/tabs/tabs.constants.d.ts +9 -0
- package/lib/components/tabs/tabs.constants.d.ts.map +1 -0
- package/lib/components/tabs-drawer/index.d.ts +6 -0
- package/lib/components/tabs-drawer/index.d.ts.map +1 -0
- package/lib/components/tabs-drawer/index.js +75 -46
- package/lib/components/tools/arrow/arrow-button.d.ts +8 -0
- package/lib/components/tools/arrow/arrow-button.d.ts.map +1 -0
- package/lib/components/tools/arrow/arrow-button.js +2 -1
- package/lib/components/tools/arrow/arrow-options.d.ts +4 -0
- package/lib/components/tools/arrow/arrow-options.d.ts.map +1 -0
- package/lib/components/tools/arrow/arrow-options.js +2 -1
- package/lib/components/tools/arrow/index.d.ts +3 -0
- package/lib/components/tools/arrow/index.d.ts.map +1 -0
- package/lib/components/tools/blur/blur-options.d.ts +6 -0
- package/lib/components/tools/blur/blur-options.d.ts.map +1 -0
- package/lib/components/tools/blur/blur-options.js +11 -9
- package/lib/components/tools/blur/blur.d.ts +8 -0
- package/lib/components/tools/blur/blur.d.ts.map +1 -0
- package/lib/components/tools/blur/blur.js +2 -1
- package/lib/components/tools/blur/index.d.ts +3 -0
- package/lib/components/tools/blur/index.d.ts.map +1 -0
- package/lib/components/tools/brightness/brightness-options.d.ts +6 -0
- package/lib/components/tools/brightness/brightness-options.d.ts.map +1 -0
- package/lib/components/tools/brightness/brightness-options.js +12 -10
- package/lib/components/tools/brightness/brightness.d.ts +8 -0
- package/lib/components/tools/brightness/brightness.d.ts.map +1 -0
- package/lib/components/tools/brightness/brightness.js +2 -1
- package/lib/components/tools/brightness/index.d.ts +3 -0
- package/lib/components/tools/brightness/index.d.ts.map +1 -0
- package/lib/components/tools/contrast/contrast-options.d.ts +6 -0
- package/lib/components/tools/contrast/contrast-options.d.ts.map +1 -0
- package/lib/components/tools/contrast/contrast-options.js +11 -9
- package/lib/components/tools/contrast/contrast.d.ts +8 -0
- package/lib/components/tools/contrast/contrast.d.ts.map +1 -0
- package/lib/components/tools/contrast/contrast.js +2 -1
- package/lib/components/tools/contrast/index.d.ts +3 -0
- package/lib/components/tools/contrast/index.d.ts.map +1 -0
- package/lib/components/tools/crop/crop.constants.d.ts +15 -0
- package/lib/components/tools/crop/crop.constants.d.ts.map +1 -0
- package/lib/components/tools/crop/crop.d.ts +7 -0
- package/lib/components/tools/crop/crop.d.ts.map +1 -0
- package/lib/components/tools/crop/crop.js +25 -22
- package/lib/components/tools/crop/index.d.ts +2 -0
- package/lib/components/tools/crop/index.d.ts.map +1 -0
- package/lib/components/tools/ellipse/ellipse-button.d.ts +8 -0
- package/lib/components/tools/ellipse/ellipse-button.d.ts.map +1 -0
- package/lib/components/tools/ellipse/ellipse-button.js +2 -1
- package/lib/components/tools/ellipse/ellipse-options.d.ts +4 -0
- package/lib/components/tools/ellipse/ellipse-options.d.ts.map +1 -0
- package/lib/components/tools/ellipse/ellipse-options.js +2 -1
- package/lib/components/tools/ellipse/index.d.ts +3 -0
- package/lib/components/tools/ellipse/index.d.ts.map +1 -0
- package/lib/components/tools/filters/filter-item.d.ts +11 -0
- package/lib/components/tools/filters/filter-item.d.ts.map +1 -0
- package/lib/components/tools/filters/filter-item.js +36 -28
- package/lib/components/tools/filters/filters.constants.d.ts +8 -0
- package/lib/components/tools/filters/filters.constants.d.ts.map +1 -0
- package/lib/components/tools/filters/filters.d.ts +6 -0
- package/lib/components/tools/filters/filters.d.ts.map +1 -0
- package/lib/components/tools/filters/filters.js +26 -18
- package/lib/components/tools/filters/index.d.ts +2 -0
- package/lib/components/tools/filters/index.d.ts.map +1 -0
- package/lib/components/tools/flip/flip-x.d.ts +8 -0
- package/lib/components/tools/flip/flip-x.d.ts.map +1 -0
- package/lib/components/tools/flip/flip-x.js +2 -1
- package/lib/components/tools/flip/flip-y.d.ts +8 -0
- package/lib/components/tools/flip/flip-y.d.ts.map +1 -0
- package/lib/components/tools/flip/flip-y.js +2 -1
- package/lib/components/tools/flip/index.d.ts +3 -0
- package/lib/components/tools/flip/index.d.ts.map +1 -0
- package/lib/components/tools/hsv/hsv.d.ts +8 -0
- package/lib/components/tools/hsv/hsv.d.ts.map +1 -0
- package/lib/components/tools/hsv/hsv.js +2 -1
- package/lib/components/tools/hsv/hsvoptions.d.ts +6 -0
- package/lib/components/tools/hsv/hsvoptions.d.ts.map +1 -0
- package/lib/components/tools/hsv/hsvoptions.js +32 -30
- package/lib/components/tools/hsv/index.d.ts +3 -0
- package/lib/components/tools/hsv/index.d.ts.map +1 -0
- package/lib/components/tools/image/image-button.d.ts +8 -0
- package/lib/components/tools/image/image-button.d.ts.map +1 -0
- package/lib/components/tools/image/image-button.js +2 -1
- package/lib/components/tools/image/image-controls.d.ts +13 -0
- package/lib/components/tools/image/image-controls.d.ts.map +1 -0
- package/lib/components/tools/image/image-controls.js +5 -3
- package/lib/components/tools/image/image-options.d.ts +3 -0
- package/lib/components/tools/image/image-options.d.ts.map +1 -0
- package/lib/components/tools/image/image-options.js +24 -21
- package/lib/components/tools/image/images-gallery.d.ts +14 -0
- package/lib/components/tools/image/images-gallery.d.ts.map +1 -0
- package/lib/components/tools/image/images-gallery.js +28 -26
- package/lib/components/tools/image/index.d.ts +3 -0
- package/lib/components/tools/image/index.d.ts.map +1 -0
- package/lib/components/tools/line/index.d.ts +3 -0
- package/lib/components/tools/line/index.d.ts.map +1 -0
- package/lib/components/tools/line/line-button.d.ts +8 -0
- package/lib/components/tools/line/line-button.d.ts.map +1 -0
- package/lib/components/tools/line/line-button.js +2 -1
- package/lib/components/tools/line/line-options.d.ts +4 -0
- package/lib/components/tools/line/line-options.d.ts.map +1 -0
- package/lib/components/tools/line/line-options.js +2 -1
- package/lib/components/tools/pen/index.d.ts +3 -0
- package/lib/components/tools/pen/index.d.ts.map +1 -0
- package/lib/components/tools/pen/pen-button.d.ts +8 -0
- package/lib/components/tools/pen/pen-button.d.ts.map +1 -0
- package/lib/components/tools/pen/pen-button.js +2 -1
- package/lib/components/tools/pen/pen-options.d.ts +3 -0
- package/lib/components/tools/pen/pen-options.d.ts.map +1 -0
- package/lib/components/tools/pen/pen-options.js +6 -4
- package/lib/components/tools/polygon/index.d.ts +3 -0
- package/lib/components/tools/polygon/index.d.ts.map +1 -0
- package/lib/components/tools/polygon/polygon-button.d.ts +8 -0
- package/lib/components/tools/polygon/polygon-button.d.ts.map +1 -0
- package/lib/components/tools/polygon/polygon-button.js +2 -1
- package/lib/components/tools/polygon/polygon-options.d.ts +4 -0
- package/lib/components/tools/polygon/polygon-options.d.ts.map +1 -0
- package/lib/components/tools/polygon/polygon-options.js +2 -1
- package/lib/components/tools/polygon/polygon-sides-field.d.ts +9 -0
- package/lib/components/tools/polygon/polygon-sides-field.d.ts.map +1 -0
- package/lib/components/tools/polygon/polygon-sides-field.js +2 -1
- package/lib/components/tools/polygon/polygon.constants.d.ts +12 -0
- package/lib/components/tools/polygon/polygon.constants.d.ts.map +1 -0
- package/lib/components/tools/rect/index.d.ts +3 -0
- package/lib/components/tools/rect/index.d.ts.map +1 -0
- package/lib/components/tools/rect/rect-button.d.ts +8 -0
- package/lib/components/tools/rect/rect-button.d.ts.map +1 -0
- package/lib/components/tools/rect/rect-button.js +2 -1
- package/lib/components/tools/rect/rect-corner-field.d.ts +9 -0
- package/lib/components/tools/rect/rect-corner-field.d.ts.map +1 -0
- package/lib/components/tools/rect/rect-corner-field.js +2 -1
- package/lib/components/tools/rect/rect-options.d.ts +4 -0
- package/lib/components/tools/rect/rect-options.d.ts.map +1 -0
- package/lib/components/tools/rect/rect-options.js +2 -1
- package/lib/components/tools/rect/rect.constants.d.ts +12 -0
- package/lib/components/tools/rect/rect.constants.d.ts.map +1 -0
- package/lib/components/tools/resize/index.d.ts +2 -0
- package/lib/components/tools/resize/index.d.ts.map +1 -0
- package/lib/components/tools/resize/resize.d.ts +13 -0
- package/lib/components/tools/resize/resize.d.ts.map +1 -0
- package/lib/components/tools/resize/resize.js +41 -34
- package/lib/components/tools/rotate/index.d.ts +3 -0
- package/lib/components/tools/rotate/index.d.ts.map +1 -0
- package/lib/components/tools/rotate/rotate-button.d.ts +8 -0
- package/lib/components/tools/rotate/rotate-button.d.ts.map +1 -0
- package/lib/components/tools/rotate/rotate-button.js +2 -1
- package/lib/components/tools/rotate/rotate-options.d.ts +3 -0
- package/lib/components/tools/rotate/rotate-options.d.ts.map +1 -0
- package/lib/components/tools/rotate/rotate-options.js +51 -45
- package/lib/components/tools/text/index.d.ts +3 -0
- package/lib/components/tools/text/index.d.ts.map +1 -0
- package/lib/components/tools/text/text-button.d.ts +8 -0
- package/lib/components/tools/text/text-button.d.ts.map +1 -0
- package/lib/components/tools/text/text-button.js +2 -1
- package/lib/components/tools/text/text-options/handle-text-change-area.d.ts +4 -0
- package/lib/components/tools/text/text-options/handle-text-change-area.d.ts.map +1 -0
- package/lib/components/tools/text/text-options/index.d.ts +4 -0
- package/lib/components/tools/text/text-options/index.d.ts.map +1 -0
- package/lib/components/tools/text/text-options/index.js +2 -1
- package/lib/components/tools/text/text-options/text-alignment-fields.d.ts +9 -0
- package/lib/components/tools/text/text-options/text-alignment-fields.d.ts.map +1 -0
- package/lib/components/tools/text/text-options/text-alignment-fields.js +26 -21
- package/lib/components/tools/text/text-options/text-controls.d.ts +12 -0
- package/lib/components/tools/text/text-options/text-controls.d.ts.map +1 -0
- package/lib/components/tools/text/text-options/text-controls.js +51 -44
- package/lib/components/tools/text/text-options/text-options.constants.d.ts +14 -0
- package/lib/components/tools/text/text-options/text-options.constants.d.ts.map +1 -0
- package/lib/components/tools/text/text-options/text-spacings-fields.d.ts +10 -0
- package/lib/components/tools/text/text-options/text-spacings-fields.d.ts.map +1 -0
- package/lib/components/tools/text/text-options/text-spacings-fields.js +20 -17
- package/lib/components/tools/tools.constants.d.ts +9 -0
- package/lib/components/tools/tools.constants.d.ts.map +1 -0
- package/lib/components/tools/warmth/index.d.ts +3 -0
- package/lib/components/tools/warmth/index.d.ts.map +1 -0
- package/lib/components/tools/warmth/warmth-options.d.ts +7 -0
- package/lib/components/tools/warmth/warmth-options.d.ts.map +1 -0
- package/lib/components/tools/warmth/warmth-options.js +11 -9
- package/lib/components/tools/warmth/warmth.d.ts +8 -0
- package/lib/components/tools/warmth/warmth.d.ts.map +1 -0
- package/lib/components/tools/warmth/warmth.js +2 -1
- package/lib/components/tools/watermark/index.d.ts +2 -0
- package/lib/components/tools/watermark/index.d.ts.map +1 -0
- package/lib/components/tools/watermark/watermark-padding.d.ts +8 -0
- package/lib/components/tools/watermark/watermark-padding.d.ts.map +1 -0
- package/lib/components/tools/watermark/watermark-padding.js +36 -30
- package/lib/components/tools/watermark/watermark.d.ts +3 -0
- package/lib/components/tools/watermark/watermark.d.ts.map +1 -0
- package/lib/components/tools/watermark/watermark.js +35 -28
- package/lib/components/tools/watermark/watermarks-gallery.d.ts +7 -0
- package/lib/components/tools/watermark/watermarks-gallery.d.ts.map +1 -0
- package/lib/components/tools/watermark/watermarks-gallery.js +22 -18
- package/lib/components/tools-bar/index.d.ts +3 -0
- package/lib/components/tools-bar/index.d.ts.map +1 -0
- package/lib/components/tools-bar/index.js +57 -29
- package/lib/components/tools-bar/tools-bar-item-button.d.ts +23 -0
- package/lib/components/tools-bar/tools-bar-item-button.d.ts.map +1 -0
- package/lib/components/tools-bar/tools-bar-item-button.js +17 -9
- package/lib/components/topbar/canvas-zooming.d.ts +3 -0
- package/lib/components/topbar/canvas-zooming.d.ts.map +1 -0
- package/lib/components/topbar/canvas-zooming.js +54 -46
- package/lib/components/topbar/confirmation-modal.d.ts +8 -0
- package/lib/components/topbar/confirmation-modal.d.ts.map +1 -0
- package/lib/components/topbar/confirmation-modal.js +26 -19
- package/lib/components/topbar/image-dimensions-and-display-toggle.d.ts +3 -0
- package/lib/components/topbar/image-dimensions-and-display-toggle.d.ts.map +1 -0
- package/lib/components/topbar/image-dimensions-and-display-toggle.js +20 -14
- package/lib/components/topbar/index.d.ts +7 -0
- package/lib/components/topbar/index.d.ts.map +1 -0
- package/lib/components/topbar/index.js +49 -35
- package/lib/components/topbar/redo-button.d.ts +3 -0
- package/lib/components/topbar/redo-button.d.ts.map +1 -0
- package/lib/components/topbar/redo-button.js +6 -4
- package/lib/components/topbar/reset-button.d.ts +3 -0
- package/lib/components/topbar/reset-button.d.ts.map +1 -0
- package/lib/components/topbar/reset-button.js +12 -9
- package/lib/components/topbar/save-button.d.ts +3 -0
- package/lib/components/topbar/save-button.d.ts.map +1 -0
- package/lib/components/topbar/save-button.js +69 -57
- package/lib/components/topbar/topbar-action-buttons.d.ts +3 -0
- package/lib/components/topbar/topbar-action-buttons.d.ts.map +1 -0
- package/lib/components/topbar/topbar-action-buttons.js +27 -0
- package/lib/components/topbar/topbar.constants.d.ts +8 -0
- package/lib/components/topbar/topbar.constants.d.ts.map +1 -0
- package/lib/components/topbar/undo-button.d.ts +3 -0
- package/lib/components/topbar/undo-button.d.ts.map +1 -0
- package/lib/components/topbar/undo-button.js +6 -4
- package/lib/context/app-context.d.ts +14 -0
- package/lib/context/app-context.d.ts.map +1 -0
- package/lib/context/app-provider-overriden-value.d.ts +11 -0
- package/lib/context/app-provider-overriden-value.d.ts.map +1 -0
- package/lib/context/app-provider-overriden-value.js +5 -3
- package/lib/context/app-provider.d.ts +10 -0
- package/lib/context/app-provider.d.ts.map +1 -0
- package/lib/context/app-provider.js +13 -9
- package/lib/context/app-reducer.d.ts +5 -0
- package/lib/context/app-reducer.d.ts.map +1 -0
- package/lib/context/app-reducer.js +2 -1
- package/lib/context/default-config.d.ts +4 -0
- package/lib/context/default-config.d.ts.map +1 -0
- package/lib/context/default-config.js +1 -1
- package/lib/context/default-translations.d.ts +4 -0
- package/lib/context/default-translations.d.ts.map +1 -0
- package/lib/context/default-translations.js +465 -113
- package/lib/context/get-initial-app-state.d.ts +5 -0
- package/lib/context/get-initial-app-state.d.ts.map +1 -0
- package/lib/context/get-initial-app-state.js +4 -4
- package/lib/context/index.d.ts +5 -0
- package/lib/context/index.d.ts.map +1 -0
- package/lib/custom/filters/aden.d.ts +14 -0
- package/lib/custom/filters/aden.d.ts.map +1 -0
- package/lib/custom/filters/amaro.d.ts +14 -0
- package/lib/custom/filters/amaro.d.ts.map +1 -0
- package/lib/custom/filters/ashby.d.ts +14 -0
- package/lib/custom/filters/ashby.d.ts.map +1 -0
- package/lib/custom/filters/base-filters.d.ts +14 -0
- package/lib/custom/filters/base-filters.d.ts.map +1 -0
- package/lib/custom/filters/black-and-white.d.ts +14 -0
- package/lib/custom/filters/black-and-white.d.ts.map +1 -0
- package/lib/custom/filters/brannan.d.ts +14 -0
- package/lib/custom/filters/brannan.d.ts.map +1 -0
- package/lib/custom/filters/brooklyn.d.ts +14 -0
- package/lib/custom/filters/brooklyn.d.ts.map +1 -0
- package/lib/custom/filters/charmes.d.ts +14 -0
- package/lib/custom/filters/charmes.d.ts.map +1 -0
- package/lib/custom/filters/clarendon.d.ts +14 -0
- package/lib/custom/filters/clarendon.d.ts.map +1 -0
- package/lib/custom/filters/crema.d.ts +14 -0
- package/lib/custom/filters/crema.d.ts.map +1 -0
- package/lib/custom/filters/dogpatch.d.ts +14 -0
- package/lib/custom/filters/dogpatch.d.ts.map +1 -0
- package/lib/custom/filters/earlybird.d.ts +14 -0
- package/lib/custom/filters/earlybird.d.ts.map +1 -0
- package/lib/custom/filters/gingham.d.ts +14 -0
- package/lib/custom/filters/gingham.d.ts.map +1 -0
- package/lib/custom/filters/ginza.d.ts +14 -0
- package/lib/custom/filters/ginza.d.ts.map +1 -0
- package/lib/custom/filters/hefe.d.ts +14 -0
- package/lib/custom/filters/hefe.d.ts.map +1 -0
- package/lib/custom/filters/helena.d.ts +14 -0
- package/lib/custom/filters/helena.d.ts.map +1 -0
- package/lib/custom/filters/hudson.d.ts +14 -0
- package/lib/custom/filters/hudson.d.ts.map +1 -0
- package/lib/custom/filters/index.d.ts +41 -0
- package/lib/custom/filters/index.d.ts.map +1 -0
- package/lib/custom/filters/juno.d.ts +14 -0
- package/lib/custom/filters/juno.d.ts.map +1 -0
- package/lib/custom/filters/kelvin.d.ts +14 -0
- package/lib/custom/filters/kelvin.d.ts.map +1 -0
- package/lib/custom/filters/lark.d.ts +14 -0
- package/lib/custom/filters/lark.d.ts.map +1 -0
- package/lib/custom/filters/lo-fi.d.ts +14 -0
- package/lib/custom/filters/lo-fi.d.ts.map +1 -0
- package/lib/custom/filters/ludwig.d.ts +14 -0
- package/lib/custom/filters/ludwig.d.ts.map +1 -0
- package/lib/custom/filters/maven.d.ts +14 -0
- package/lib/custom/filters/maven.d.ts.map +1 -0
- package/lib/custom/filters/mayfair.d.ts +14 -0
- package/lib/custom/filters/mayfair.d.ts.map +1 -0
- package/lib/custom/filters/moon.d.ts +14 -0
- package/lib/custom/filters/moon.d.ts.map +1 -0
- package/lib/custom/filters/nashville.d.ts +14 -0
- package/lib/custom/filters/nashville.d.ts.map +1 -0
- package/lib/custom/filters/ninteen-seventy-seven.d.ts +14 -0
- package/lib/custom/filters/ninteen-seventy-seven.d.ts.map +1 -0
- package/lib/custom/filters/perpetua.d.ts +14 -0
- package/lib/custom/filters/perpetua.d.ts.map +1 -0
- package/lib/custom/filters/reyes.d.ts +14 -0
- package/lib/custom/filters/reyes.d.ts.map +1 -0
- package/lib/custom/filters/rise.d.ts +14 -0
- package/lib/custom/filters/rise.d.ts.map +1 -0
- package/lib/custom/filters/sierra.d.ts +14 -0
- package/lib/custom/filters/sierra.d.ts.map +1 -0
- package/lib/custom/filters/skyline.d.ts +14 -0
- package/lib/custom/filters/skyline.d.ts.map +1 -0
- package/lib/custom/filters/slumber.d.ts +14 -0
- package/lib/custom/filters/slumber.d.ts.map +1 -0
- package/lib/custom/filters/stinson.d.ts +14 -0
- package/lib/custom/filters/stinson.d.ts.map +1 -0
- package/lib/custom/filters/sutro.d.ts +14 -0
- package/lib/custom/filters/sutro.d.ts.map +1 -0
- package/lib/custom/filters/toaster.d.ts +14 -0
- package/lib/custom/filters/toaster.d.ts.map +1 -0
- package/lib/custom/filters/valencia.d.ts +14 -0
- package/lib/custom/filters/valencia.d.ts.map +1 -0
- package/lib/custom/filters/vesper.d.ts +14 -0
- package/lib/custom/filters/vesper.d.ts.map +1 -0
- package/lib/custom/filters/walden.d.ts +14 -0
- package/lib/custom/filters/walden.d.ts.map +1 -0
- package/lib/custom/filters/willow.d.ts +14 -0
- package/lib/custom/filters/willow.d.ts.map +1 -0
- package/lib/custom/filters/xpro2.d.ts +14 -0
- package/lib/custom/filters/xpro2.d.ts.map +1 -0
- package/lib/custom/finetunes/custom-threshold.d.ts +15 -0
- package/lib/custom/finetunes/custom-threshold.d.ts.map +1 -0
- package/lib/custom/finetunes/index.d.ts +3 -0
- package/lib/custom/finetunes/index.d.ts.map +1 -0
- package/lib/custom/finetunes/warmth.d.ts +17 -0
- package/lib/custom/finetunes/warmth.d.ts.map +1 -0
- package/lib/demo/app.d.ts +6 -0
- package/lib/demo/app.d.ts.map +1 -0
- package/lib/demo/app.js +142 -86
- package/lib/demo/index.d.ts +2 -0
- package/lib/demo/index.d.ts.map +1 -0
- package/lib/hooks/index.d.ts +14 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/index.js +2 -1
- package/lib/hooks/use-annotation/get-bounding-rect-un-scaled.d.ts +19 -0
- package/lib/hooks/use-annotation/get-bounding-rect-un-scaled.d.ts.map +1 -0
- package/lib/hooks/use-annotation/get-new-annotation-preview.d.ts +25 -0
- package/lib/hooks/use-annotation/get-new-annotation-preview.d.ts.map +1 -0
- package/lib/hooks/use-annotation/get-new-annotation-preview.js +2 -2
- package/lib/hooks/use-annotation/index.d.ts +74 -0
- package/lib/hooks/use-annotation/index.d.ts.map +1 -0
- package/lib/hooks/use-annotation/index.js +15 -2
- package/lib/hooks/use-annotation/preview-then-call-annotation-adding.d.ts +3 -0
- package/lib/hooks/use-annotation/preview-then-call-annotation-adding.d.ts.map +1 -0
- package/lib/hooks/use-annotation-events.d.ts +11 -0
- package/lib/hooks/use-annotation-events.d.ts.map +1 -0
- package/lib/hooks/use-app-reducer.d.ts +13 -0
- package/lib/hooks/use-app-reducer.d.ts.map +1 -0
- package/lib/hooks/use-app-reducer.js +2 -1
- package/lib/hooks/use-debounced-callback.d.ts +5 -0
- package/lib/hooks/use-debounced-callback.d.ts.map +1 -0
- package/lib/hooks/use-drag.d.ts +8 -0
- package/lib/hooks/use-drag.d.ts.map +1 -0
- package/lib/hooks/use-filter.d.ts +4 -0
- package/lib/hooks/use-filter.d.ts.map +1 -0
- package/lib/hooks/use-finetune.d.ts +5 -0
- package/lib/hooks/use-finetune.d.ts.map +1 -0
- package/lib/hooks/use-image-editor-actions.d.ts +16 -0
- package/lib/hooks/use-image-editor-actions.d.ts.map +1 -0
- package/lib/hooks/use-image-editor-actions.js +147 -0
- package/lib/hooks/use-phone-screen.d.ts +3 -0
- package/lib/hooks/use-phone-screen.d.ts.map +1 -0
- package/lib/hooks/use-popover.d.ts +11 -0
- package/lib/hooks/use-popover.d.ts.map +1 -0
- package/lib/hooks/use-resize-observer.d.ts +12 -0
- package/lib/hooks/use-resize-observer.d.ts.map +1 -0
- package/lib/hooks/use-resize-observer.js +2 -3
- package/lib/hooks/use-store.d.ts +5 -0
- package/lib/hooks/use-store.d.ts.map +1 -0
- package/lib/hooks/use-transformed-img-data.d.ts +20 -0
- package/lib/hooks/use-transformed-img-data.d.ts.map +1 -0
- package/lib/hooks/use-transformed-img-data.js +13 -9
- package/lib/hooks/use-update-effect.d.ts +5 -0
- package/lib/hooks/use-update-effect.d.ts.map +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/types/actions.d.ts +197 -0
- package/lib/types/actions.d.ts.map +1 -0
- package/lib/types/annotations.d.ts +181 -0
- package/lib/types/annotations.d.ts.map +1 -0
- package/lib/types/common.d.ts +31 -0
- package/lib/types/common.d.ts.map +1 -0
- package/lib/types/config.d.ts +193 -0
- package/lib/types/config.d.ts.map +1 -0
- package/lib/types/index.d.ts +6 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/state.d.ts +105 -0
- package/lib/types/state.d.ts.map +1 -0
- package/lib/utils/assign-finetune-names-to-konva.d.ts +3 -0
- package/lib/utils/assign-finetune-names-to-konva.d.ts.map +1 -0
- package/lib/utils/calculate-zoom-data.d.ts +9 -0
- package/lib/utils/calculate-zoom-data.d.ts.map +1 -0
- package/lib/utils/calculate-zoom-data.js +5 -4
- package/lib/utils/compare-ratios.d.ts +3 -0
- package/lib/utils/compare-ratios.d.ts.map +1 -0
- package/lib/utils/constants.d.ts +85 -0
- package/lib/utils/constants.d.ts.map +1 -0
- package/lib/utils/crop-image.d.ts +12 -0
- package/lib/utils/crop-image.d.ts.map +1 -0
- package/lib/utils/crop-image.js +10 -4
- package/lib/utils/debounce.d.ts +3 -0
- package/lib/utils/debounce.d.ts.map +1 -0
- package/lib/utils/deep-merge.d.ts +3 -0
- package/lib/utils/deep-merge.d.ts.map +1 -0
- package/lib/utils/extract-current-design-state.d.ts +11 -0
- package/lib/utils/extract-current-design-state.d.ts.map +1 -0
- package/lib/utils/extract-current-design-state.js +3 -2
- package/lib/utils/extract-name-from-url.d.ts +3 -0
- package/lib/utils/extract-name-from-url.d.ts.map +1 -0
- package/lib/utils/filter-str-to-class.d.ts +4 -0
- package/lib/utils/filter-str-to-class.d.ts.map +1 -0
- package/lib/utils/filter-str-to-class.js +2 -1
- package/lib/utils/finetunes-strs-to-classes.d.ts +4 -0
- package/lib/utils/finetunes-strs-to-classes.d.ts.map +1 -0
- package/lib/utils/finetunes-strs-to-classes.js +2 -1
- package/lib/utils/get-center-rotated-point.d.ts +8 -0
- package/lib/utils/get-center-rotated-point.d.ts.map +1 -0
- package/lib/utils/get-default-save-quality.d.ts +3 -0
- package/lib/utils/get-default-save-quality.d.ts.map +1 -0
- package/lib/utils/get-dimensions-minimal-ratio.d.ts +3 -0
- package/lib/utils/get-dimensions-minimal-ratio.d.ts.map +1 -0
- package/lib/utils/get-elem-document-coords.d.ts +9 -0
- package/lib/utils/get-elem-document-coords.d.ts.map +1 -0
- package/lib/utils/get-file-full-name.d.ts +8 -0
- package/lib/utils/get-file-full-name.d.ts.map +1 -0
- package/lib/utils/get-file-full-name.js +3 -3
- package/lib/utils/get-pointer-offset-position-bounded-to-object.d.ts +21 -0
- package/lib/utils/get-pointer-offset-position-bounded-to-object.d.ts.map +1 -0
- package/lib/utils/get-pointer-offset-position-bounded-to-object.js +2 -1
- package/lib/utils/get-proper-dimensions.d.ts +11 -0
- package/lib/utils/get-proper-dimensions.d.ts.map +1 -0
- package/lib/utils/get-proper-dimensions.js +3 -2
- package/lib/utils/get-proper-image-to-canvas-spacing.d.ts +3 -0
- package/lib/utils/get-proper-image-to-canvas-spacing.d.ts.map +1 -0
- package/lib/utils/get-scroll-offset.d.ts +7 -0
- package/lib/utils/get-scroll-offset.d.ts.map +1 -0
- package/lib/utils/get-size-after-rotation.d.ts +9 -0
- package/lib/utils/get-size-after-rotation.d.ts.map +1 -0
- package/lib/utils/get-zoom-fit-factor.d.ts +4 -0
- package/lib/utils/get-zoom-fit-factor.d.ts.map +1 -0
- package/lib/utils/image-to-base64.d.ts +3 -0
- package/lib/utils/image-to-base64.d.ts.map +1 -0
- package/lib/utils/is-default-zero-values-only.d.ts +3 -0
- package/lib/utils/is-default-zero-values-only.d.ts.map +1 -0
- package/lib/utils/is-same-image.d.ts +3 -0
- package/lib/utils/is-same-image.d.ts.map +1 -0
- package/lib/utils/load-image.d.ts +3 -0
- package/lib/utils/load-image.d.ts.map +1 -0
- package/lib/utils/load-image.js +1 -3
- package/lib/utils/map-crop-box.d.ts +16 -0
- package/lib/utils/map-crop-box.d.ts.map +1 -0
- package/lib/utils/map-number.d.ts +3 -0
- package/lib/utils/map-number.d.ts.map +1 -0
- package/lib/utils/map-position-string-to-point.d.ts +8 -0
- package/lib/utils/map-position-string-to-point.d.ts.map +1 -0
- package/lib/utils/random-id.d.ts +3 -0
- package/lib/utils/random-id.d.ts.map +1 -0
- package/lib/utils/restrict-number.d.ts +3 -0
- package/lib/utils/restrict-number.d.ts.map +1 -0
- package/lib/utils/restrict-number.js +2 -2
- package/lib/utils/serialize-design-state.d.ts +27 -0
- package/lib/utils/serialize-design-state.d.ts.map +1 -0
- package/lib/utils/serialize-design-state.js +5 -3
- package/lib/utils/to-precised-float.d.ts +3 -0
- package/lib/utils/to-precised-float.d.ts.map +1 -0
- package/lib/utils/translator.d.ts +6 -0
- package/lib/utils/translator.d.ts.map +1 -0
- package/lib/utils/translator.js +11 -2
- package/package.json +10 -3
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Annotation } from 'types/annotations';
|
|
2
|
+
/**
|
|
3
|
+
* Working version of an Annotation with all properties optional + control flags
|
|
4
|
+
* This allows flexible manipulation before saving to state
|
|
5
|
+
*/
|
|
6
|
+
interface WorkingAnnotationBase {
|
|
7
|
+
id?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
x?: number;
|
|
10
|
+
y?: number;
|
|
11
|
+
scaleX?: number;
|
|
12
|
+
scaleY?: number;
|
|
13
|
+
rotation?: number;
|
|
14
|
+
opacity?: number;
|
|
15
|
+
fill?: string;
|
|
16
|
+
stroke?: string;
|
|
17
|
+
strokeWidth?: number;
|
|
18
|
+
shadowOffsetX?: number;
|
|
19
|
+
shadowOffsetY?: number;
|
|
20
|
+
shadowBlur?: number;
|
|
21
|
+
shadowColor?: string;
|
|
22
|
+
shadowOpacity?: number;
|
|
23
|
+
padding?: number;
|
|
24
|
+
width?: number;
|
|
25
|
+
height?: number;
|
|
26
|
+
text?: string;
|
|
27
|
+
fontFamily?: string;
|
|
28
|
+
fontSize?: number;
|
|
29
|
+
letterSpacing?: number;
|
|
30
|
+
lineHeight?: number;
|
|
31
|
+
align?: string;
|
|
32
|
+
fontStyle?: string;
|
|
33
|
+
image?: string | HTMLImageElement;
|
|
34
|
+
disableUpload?: boolean;
|
|
35
|
+
gallery?: Array<{
|
|
36
|
+
originalUrl: string;
|
|
37
|
+
previewUrl: string;
|
|
38
|
+
}>;
|
|
39
|
+
cornerRadius?: number;
|
|
40
|
+
radius?: number;
|
|
41
|
+
sides?: number;
|
|
42
|
+
radiusX?: number;
|
|
43
|
+
radiusY?: number;
|
|
44
|
+
points?: number[];
|
|
45
|
+
tension?: number;
|
|
46
|
+
lineCap?: string;
|
|
47
|
+
selectAnnotationAfterDrawing?: boolean;
|
|
48
|
+
pointerLength?: number;
|
|
49
|
+
pointerWidth?: number;
|
|
50
|
+
shouldSave?: boolean;
|
|
51
|
+
neverSave?: boolean;
|
|
52
|
+
fonts?: (string | {
|
|
53
|
+
label: string;
|
|
54
|
+
value: string;
|
|
55
|
+
})[];
|
|
56
|
+
onFontChange?: (newFontFamily: string, reRenderCanvasFn: () => void) => void;
|
|
57
|
+
}
|
|
58
|
+
type UpdateFnOrObj = Partial<WorkingAnnotationBase> | ((latest: WorkingAnnotationBase) => Partial<WorkingAnnotationBase>);
|
|
59
|
+
/**
|
|
60
|
+
* Generic hook for managing annotations with preview and state updates
|
|
61
|
+
*
|
|
62
|
+
* @template T - The specific annotation type (TextAnnotation, ImageAnnotation, etc.)
|
|
63
|
+
* @param annotation - Initial annotation data
|
|
64
|
+
* @param enablePreview - Whether to show preview on canvas
|
|
65
|
+
* @returns [workingAnnotation, updateFunction, saveFunction]
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* const [text, updateText, saveText] = useAnnotation<TextAnnotation>({ name: 'Text' });
|
|
69
|
+
* // text is typed as TextAnnotation & { shouldSave?, neverSave? }
|
|
70
|
+
* // Full autocomplete for text-specific properties!
|
|
71
|
+
*/
|
|
72
|
+
declare const useAnnotation: <T extends Annotation = Annotation>(annotation?: Partial<WorkingAnnotationBase>, enablePreview?: boolean) => [T & Pick<WorkingAnnotationBase, "shouldSave" | "neverSave">, (updatesObjOrFn: UpdateFnOrObj) => void, (newAnnotationData: Partial<WorkingAnnotationBase>) => void];
|
|
73
|
+
export default useAnnotation;
|
|
74
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-annotation/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C;;;GAGG;AACH,UAAU,qBAAqB;IAE7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC;IAClC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IAGpB,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IACtD,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;CAC9E;AAED,KAAK,aAAa,GACd,OAAO,CAAC,qBAAqB,CAAC,GAC9B,CAAC,CAAC,MAAM,EAAE,qBAAqB,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC;AAExE;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,aAAa,GAAI,CAAC,SAAS,UAAU,GAAG,UAAU,EACtD,aAAY,OAAO,CAAC,qBAAqB,CAAM,EAC/C,gBAAe,OAAc,KAC5B,CACD,CAAC,GAAG,IAAI,CAAC,qBAAqB,EAAE,YAAY,GAAG,WAAW,CAAC,EAC3D,CAAC,cAAc,EAAE,aAAa,KAAK,IAAI,EACvC,CAAC,iBAAiB,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAkN5D,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -83,9 +83,10 @@ var useAnnotation = function useAnnotation() {
|
|
|
83
83
|
}, [annotationDefaults, annotation]);
|
|
84
84
|
var saveAnnotationNoDebounce = useCallback(function (newAnnotationData) {
|
|
85
85
|
setTmpAnnotation(function (latest) {
|
|
86
|
-
var
|
|
86
|
+
var _newAnnotationData$na, _newAnnotationData$id, _newAnnotationData$na2;
|
|
87
|
+
var initialProps = getAnnotationInitialProps(latest, (_newAnnotationData$na = newAnnotationData.name) !== null && _newAnnotationData$na !== void 0 ? _newAnnotationData$na : annotation.name);
|
|
87
88
|
return _objectSpread(_objectSpread(_objectSpread({}, initialProps), newAnnotationData), {}, {
|
|
88
|
-
id: newAnnotationData.id
|
|
89
|
+
id: (_newAnnotationData$id = newAnnotationData.id) !== null && _newAnnotationData$id !== void 0 ? _newAnnotationData$id : randomId((_newAnnotationData$na2 = newAnnotationData.name) !== null && _newAnnotationData$na2 !== void 0 ? _newAnnotationData$na2 : latest.name),
|
|
89
90
|
shouldSave: true,
|
|
90
91
|
neverSave: false
|
|
91
92
|
});
|
|
@@ -121,9 +122,21 @@ var useAnnotation = function useAnnotation() {
|
|
|
121
122
|
var stopAnnotationEventsListening = null;
|
|
122
123
|
if (canvas && enablePreview) {
|
|
123
124
|
var annotationInitialProps = getAnnotationInitialProps(tmpAnnotation, annotation.name);
|
|
125
|
+
console.log('[useAnnotation] attach preview events', {
|
|
126
|
+
hasCanvas: Boolean(canvas),
|
|
127
|
+
hasPreviewGroup: Boolean(previewGroup),
|
|
128
|
+
annotationName: annotation.name
|
|
129
|
+
});
|
|
124
130
|
stopAnnotationEventsListening = previewThenCallAnnotationAdding(canvas, _objectSpread(_objectSpread({}, annotationInitialProps), {}, {
|
|
125
131
|
name: annotation.name
|
|
126
132
|
}), previewGroup, saveAnnotationNoDebounce);
|
|
133
|
+
} else {
|
|
134
|
+
console.log('[useAnnotation] skip preview events', {
|
|
135
|
+
hasCanvas: Boolean(canvas),
|
|
136
|
+
enablePreview: enablePreview,
|
|
137
|
+
hasPreviewGroup: Boolean(previewGroup),
|
|
138
|
+
annotationName: annotation.name
|
|
139
|
+
});
|
|
127
140
|
}
|
|
128
141
|
return function () {
|
|
129
142
|
if (stopAnnotationEventsListening) {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const previewThenCallAnnotationAdding: (canvas: any, annotation: Record<string, any>, previewGroup: any, callbkAfterPreview: (annotationData: Record<string, any>, isNew?: boolean) => void) => (() => void);
|
|
2
|
+
export default previewThenCallAnnotationAdding;
|
|
3
|
+
//# sourceMappingURL=preview-then-call-annotation-adding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-then-call-annotation-adding.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-annotation/preview-then-call-annotation-adding.ts"],"names":[],"mappings":"AAgCA,QAAA,MAAM,+BAA+B,GACnC,QAAQ,GAAG,EACX,YAAY,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC/B,cAAc,GAAG,EACjB,oBAAoB,CAClB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACnC,KAAK,CAAC,EAAE,OAAO,KACZ,IAAI,KACR,CAAC,MAAM,IAAI,CAsNb,CAAC;AAEF,eAAe,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { KonvaEventObject } from 'konva/lib/Node';
|
|
2
|
+
export interface AnnotationEventHandlers {
|
|
3
|
+
onTransform?: (e: KonvaEventObject<Event>) => void;
|
|
4
|
+
onTransformEnd?: (e: KonvaEventObject<Event>) => void;
|
|
5
|
+
onDragEnd?: (e: KonvaEventObject<DragEvent>) => void;
|
|
6
|
+
onClick?: (e: KonvaEventObject<MouseEvent | TouchEvent>) => void;
|
|
7
|
+
onTap?: (e: KonvaEventObject<MouseEvent | TouchEvent>) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const useAnnotationEvents: () => AnnotationEventHandlers;
|
|
10
|
+
export default useAnnotationEvents;
|
|
11
|
+
//# sourceMappingURL=use-annotation-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-annotation-events.d.ts","sourceRoot":"","sources":["../../src/hooks/use-annotation-events.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAOlD,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IACnD,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IACtD,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,gBAAgB,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;IACrD,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,gBAAgB,CAAC,UAAU,GAAG,UAAU,CAAC,KAAK,IAAI,CAAC;IACjE,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,gBAAgB,CAAC,UAAU,GAAG,UAAU,CAAC,KAAK,IAAI,CAAC;CAChE;AAED,QAAA,MAAM,mBAAmB,QAAO,uBAkH/B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** External Dependencies */
|
|
2
|
+
import { Reducer } from 'react';
|
|
3
|
+
import { AppState } from 'types/state';
|
|
4
|
+
import { Action, Dispatch } from 'types/actions';
|
|
5
|
+
import { ImageEditorConfig } from 'types/config';
|
|
6
|
+
/**
|
|
7
|
+
* A normal react useReducer wrapped inside our own UNDO/REDO Reducer as middleware
|
|
8
|
+
* for updating the UNDO/REDO states automatically
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
declare const useAppReducer: (reducer: Reducer<AppState, Action>, initialState: AppState, passedConfig?: Partial<ImageEditorConfig>) => [AppState, Dispatch];
|
|
12
|
+
export default useAppReducer;
|
|
13
|
+
//# sourceMappingURL=use-app-reducer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-app-reducer.d.ts","sourceRoot":"","sources":["../../src/hooks/use-app-reducer.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,OAAO,EAAc,OAAO,EAAE,MAAM,OAAO,CAAC;AAK5C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAgBjD;;;;GAIG;AACH,QAAA,MAAM,aAAa,GACjB,SAAS,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,EAClC,cAAc,QAAQ,EACtB,eAAc,OAAO,CAAC,iBAAiB,CAAM,KAC5C,CAAC,QAAQ,EAAE,QAAQ,CAmDrB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -25,7 +25,8 @@ var useAppReducer = function useAppReducer(reducer, initialState) {
|
|
|
25
25
|
hasUndo: false
|
|
26
26
|
});
|
|
27
27
|
var undoRedoResetReducer = function undoRedoResetReducer(state, action) {
|
|
28
|
-
var
|
|
28
|
+
var _reducer;
|
|
29
|
+
var newPresentState = (_reducer = reducer(state, action)) !== null && _reducer !== void 0 ? _reducer : initialStateWithUndoRedo;
|
|
29
30
|
if ([UNDO, REDO, RESET].includes(action.type)) {
|
|
30
31
|
applyModifyFn(passedConfig.onModify, newPresentState);
|
|
31
32
|
return newPresentState;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** External Dependencies */
|
|
2
|
+
import { DependencyList } from 'react';
|
|
3
|
+
declare const useDebouncedCallback: <T extends (...args: any[]) => any>(func: T, timeout: number, dependencies?: DependencyList) => ((...args: Parameters<T>) => void);
|
|
4
|
+
export default useDebouncedCallback;
|
|
5
|
+
//# sourceMappingURL=use-debounced-callback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-debounced-callback.d.ts","sourceRoot":"","sources":["../../src/hooks/use-debounced-callback.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,OAAO,EAAe,cAAc,EAAE,MAAM,OAAO,CAAC;AAKpD,QAAA,MAAM,oBAAoB,GAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAC7D,MAAM,CAAC,EACP,SAAS,MAAM,EACf,eAAc,cAAmB,KAChC,CAAC,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAEnC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type DragEventHandler = (e: MouseEvent | Touch) => void;
|
|
2
|
+
interface DragHandlers {
|
|
3
|
+
onMouseDown: (e: MouseEvent | TouchEvent) => void;
|
|
4
|
+
onTouchStart: (e: MouseEvent | TouchEvent) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const useDrag: (onMove?: DragEventHandler, onStart?: DragEventHandler, onEnd?: DragEventHandler) => DragHandlers;
|
|
7
|
+
export default useDrag;
|
|
8
|
+
//# sourceMappingURL=use-drag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-drag.d.ts","sourceRoot":"","sources":["../../src/hooks/use-drag.ts"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,KAAK,KAAK,IAAI,CAAC;AAExD,UAAU,YAAY;IACpB,WAAW,EAAE,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU,KAAK,IAAI,CAAC;IAClD,YAAY,EAAE,CAAC,CAAC,EAAE,UAAU,GAAG,UAAU,KAAK,IAAI,CAAC;CACpD;AAED,QAAA,MAAM,OAAO,GACX,SAAS,gBAAgB,EACzB,UAAU,gBAAgB,EAC1B,QAAQ,gBAAgB,KACvB,YAwCF,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-filter.d.ts","sourceRoot":"","sources":["../../src/hooks/use-filter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAMxC,QAAA,MAAM,SAAS,QAAO,CACpB,MAAM,GAAG,IAAI,EACb,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAcvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Filter } from 'konva/lib/Node';
|
|
2
|
+
import { FinetunesProps } from 'types/state';
|
|
3
|
+
declare const useFinetune: (finetune: Filter, initialProps: FinetunesProps) => [FinetunesProps, (newFinetuneProps: FinetunesProps) => void];
|
|
4
|
+
export default useFinetune;
|
|
5
|
+
//# sourceMappingURL=use-finetune.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-finetune.d.ts","sourceRoot":"","sources":["../../src/hooks/use-finetune.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAKxC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,QAAA,MAAM,WAAW,GACf,UAAU,MAAM,EAChB,cAAc,cAAc,KAC3B,CAAC,cAAc,EAAE,CAAC,gBAAgB,EAAE,cAAc,KAAK,IAAI,CAiC7D,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ImageFileInfo {
|
|
2
|
+
name?: string;
|
|
3
|
+
extension?: string;
|
|
4
|
+
quality?: number;
|
|
5
|
+
size?: {
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
declare const useImageEditorActions: () => {
|
|
11
|
+
saveImage: (imageFileInfo?: Partial<ImageFileInfo> | string) => Promise<void>;
|
|
12
|
+
resetImage: () => void;
|
|
13
|
+
getDefaultImageFileInfo: () => ImageFileInfo;
|
|
14
|
+
};
|
|
15
|
+
export default useImageEditorActions;
|
|
16
|
+
//# sourceMappingURL=use-image-editor-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-image-editor-actions.d.ts","sourceRoot":"","sources":["../../src/hooks/use-image-editor-actions.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5C;AAED,QAAA,MAAM,qBAAqB;gCA4EA,OAAO,CAAC,aAAa,CAAC,GAAG,MAAM;;mCAfR,aAAa;CAuF9D,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
import { useCallback } from 'react';
|
|
7
|
+
import { RESET, SET_FEEDBACK, SET_SAVING } from "../actions";
|
|
8
|
+
import { useStore, useTransformedImgData } from "./index";
|
|
9
|
+
import { DEFAULT_SAVE_QUALITY, ELLIPSE_CROP, SUPPORTED_IMAGE_TYPES } from "../utils/constants";
|
|
10
|
+
import getDefaultSaveQuality from "../utils/get-default-save-quality";
|
|
11
|
+
import getFileFullName from "../utils/get-file-full-name";
|
|
12
|
+
import randomId from "../utils/random-id";
|
|
13
|
+
var useImageEditorActions = function useImageEditorActions() {
|
|
14
|
+
var _useStore = useStore(),
|
|
15
|
+
dispatch = _useStore.dispatch,
|
|
16
|
+
originalImage = _useStore.originalImage,
|
|
17
|
+
resize = _useStore.resize,
|
|
18
|
+
haveNotSavedChanges = _useStore.haveNotSavedChanges,
|
|
19
|
+
_useStore$adjustments = _useStore.adjustments,
|
|
20
|
+
_useStore$adjustments2 = _useStore$adjustments === void 0 ? {} : _useStore$adjustments,
|
|
21
|
+
crop = _useStore$adjustments2.crop,
|
|
22
|
+
t = _useStore.t,
|
|
23
|
+
_useStore$config = _useStore.config,
|
|
24
|
+
onClose = _useStore$config.onClose,
|
|
25
|
+
closeAfterSave = _useStore$config.closeAfterSave,
|
|
26
|
+
onSave = _useStore$config.onSave,
|
|
27
|
+
forceToPngInEllipticalCrop = _useStore$config.forceToPngInEllipticalCrop,
|
|
28
|
+
defaultSavedImageName = _useStore$config.defaultSavedImageName,
|
|
29
|
+
defaultSavedImageType = _useStore$config.defaultSavedImageType,
|
|
30
|
+
_useStore$config$defa = _useStore$config.defaultSavedImageQuality,
|
|
31
|
+
defaultSavedImageQuality = _useStore$config$defa === void 0 ? DEFAULT_SAVE_QUALITY : _useStore$config$defa,
|
|
32
|
+
savedImageNamePrefix = _useStore$config.savedImageNamePrefix;
|
|
33
|
+
var transformImgFn = useTransformedImgData();
|
|
34
|
+
var getFileNameAndExtension = useCallback(function () {
|
|
35
|
+
var nameFromSource = defaultSavedImageName !== null && defaultSavedImageName !== void 0 ? defaultSavedImageName : originalImage === null || originalImage === void 0 ? void 0 : originalImage.title;
|
|
36
|
+
var resolvedName = nameFromSource && nameFromSource.length > 0 ? nameFromSource : savedImageNamePrefix ? function () {
|
|
37
|
+
var now = new Date();
|
|
38
|
+
var day = String(now.getDate()).padStart(2, '0');
|
|
39
|
+
var month = String(now.getMonth() + 1).padStart(2, '0');
|
|
40
|
+
var year = String(now.getFullYear());
|
|
41
|
+
var dateStamp = "".concat(day, "-").concat(month, "-").concat(year);
|
|
42
|
+
var uuid = typeof crypto !== 'undefined' && crypto.randomUUID ? crypto.randomUUID() : randomId();
|
|
43
|
+
return "".concat(savedImageNamePrefix, "_").concat(dateStamp, "-").concat(uuid);
|
|
44
|
+
}() : undefined;
|
|
45
|
+
return getFileFullName(resolvedName, forceToPngInEllipticalCrop && (crop === null || crop === void 0 ? void 0 : crop.ratio) === ELLIPSE_CROP ? 'png' : SUPPORTED_IMAGE_TYPES.includes(defaultSavedImageType === null || defaultSavedImageType === void 0 ? void 0 : defaultSavedImageType.toLowerCase()) && defaultSavedImageType || undefined);
|
|
46
|
+
}, [defaultSavedImageName, originalImage, savedImageNamePrefix, forceToPngInEllipticalCrop, crop === null || crop === void 0 ? void 0 : crop.ratio, defaultSavedImageType]);
|
|
47
|
+
var getDefaultImageFileInfo = useCallback(function () {
|
|
48
|
+
var _getFileNameAndExtens = getFileNameAndExtension(),
|
|
49
|
+
name = _getFileNameAndExtens.name,
|
|
50
|
+
extension = _getFileNameAndExtens.extension;
|
|
51
|
+
return {
|
|
52
|
+
name: name,
|
|
53
|
+
extension: extension,
|
|
54
|
+
quality: getDefaultSaveQuality(defaultSavedImageQuality),
|
|
55
|
+
size: {
|
|
56
|
+
width: resize === null || resize === void 0 ? void 0 : resize.width,
|
|
57
|
+
height: resize === null || resize === void 0 ? void 0 : resize.height
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}, [getFileNameAndExtension, defaultSavedImageQuality, resize]);
|
|
61
|
+
var saveImage = useCallback(function () {
|
|
62
|
+
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(imageFileInfo) {
|
|
63
|
+
var normalizedInfo, mergedFileInfo, transformedData, savingResult;
|
|
64
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
65
|
+
while (1) switch (_context.prev = _context.next) {
|
|
66
|
+
case 0:
|
|
67
|
+
if (!(typeof onSave !== 'function')) {
|
|
68
|
+
_context.next = 1;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
throw new Error('Please provide onSave function handler.');
|
|
72
|
+
case 1:
|
|
73
|
+
normalizedInfo = typeof imageFileInfo === 'string' ? {
|
|
74
|
+
name: imageFileInfo
|
|
75
|
+
} : imageFileInfo !== null && imageFileInfo !== void 0 ? imageFileInfo : {};
|
|
76
|
+
mergedFileInfo = _objectSpread(_objectSpread(_objectSpread({}, getDefaultImageFileInfo()), normalizedInfo), {}, {
|
|
77
|
+
size: _objectSpread(_objectSpread({}, getDefaultImageFileInfo().size), normalizedInfo.size)
|
|
78
|
+
});
|
|
79
|
+
if (!(!mergedFileInfo.name || !mergedFileInfo.extension)) {
|
|
80
|
+
_context.next = 2;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
dispatch({
|
|
84
|
+
type: SET_FEEDBACK,
|
|
85
|
+
payload: {
|
|
86
|
+
feedback: {
|
|
87
|
+
message: t('nameIsRequired')
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return _context.abrupt("return");
|
|
92
|
+
case 2:
|
|
93
|
+
dispatch({
|
|
94
|
+
type: SET_SAVING,
|
|
95
|
+
payload: {
|
|
96
|
+
isSaving: true
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
transformedData = transformImgFn(mergedFileInfo, false, true);
|
|
100
|
+
savingResult = onSave(transformedData.imageData, transformedData.designState);
|
|
101
|
+
_context.prev = 3;
|
|
102
|
+
if (!(savingResult instanceof Promise)) {
|
|
103
|
+
_context.next = 4;
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
_context.next = 4;
|
|
107
|
+
return savingResult;
|
|
108
|
+
case 4:
|
|
109
|
+
_context.prev = 4;
|
|
110
|
+
dispatch({
|
|
111
|
+
type: SET_SAVING,
|
|
112
|
+
payload: {
|
|
113
|
+
isSaving: false
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
return _context.finish(4);
|
|
117
|
+
case 5:
|
|
118
|
+
if (closeAfterSave && onClose) {
|
|
119
|
+
onClose('after_save', haveNotSavedChanges);
|
|
120
|
+
}
|
|
121
|
+
case 6:
|
|
122
|
+
case "end":
|
|
123
|
+
return _context.stop();
|
|
124
|
+
}
|
|
125
|
+
}, _callee, null, [[3,, 4, 5]]);
|
|
126
|
+
}));
|
|
127
|
+
return function (_x) {
|
|
128
|
+
return _ref.apply(this, arguments);
|
|
129
|
+
};
|
|
130
|
+
}(), [closeAfterSave, dispatch, getDefaultImageFileInfo, haveNotSavedChanges, onClose, onSave, t, transformImgFn]);
|
|
131
|
+
var resetImage = useCallback(function () {
|
|
132
|
+
dispatch({
|
|
133
|
+
type: RESET,
|
|
134
|
+
payload: {
|
|
135
|
+
config: {
|
|
136
|
+
onClose: onClose
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}, [dispatch, onClose]);
|
|
141
|
+
return {
|
|
142
|
+
saveImage: saveImage,
|
|
143
|
+
resetImage: resetImage,
|
|
144
|
+
getDefaultImageFileInfo: getDefaultImageFileInfo
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
export default useImageEditorActions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-phone-screen.d.ts","sourceRoot":"","sources":["../../src/hooks/use-phone-screen.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,cAAc,GAAI,cAAa,MAAY,KAAG,OACQ,CAAC;AAE7D,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
interface PopoverState {
|
|
3
|
+
anchorEl: HTMLElement | null;
|
|
4
|
+
open: boolean;
|
|
5
|
+
handleOpen: (event: MouseEvent<HTMLElement>) => void;
|
|
6
|
+
handleClose: () => void;
|
|
7
|
+
handleToggle: (event: MouseEvent<HTMLElement>) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const usePopover: () => PopoverState;
|
|
10
|
+
export default usePopover;
|
|
11
|
+
//# sourceMappingURL=use-popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-popover.d.ts","sourceRoot":"","sources":["../../src/hooks/use-popover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1D,UAAU,YAAY;IACpB,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACrD,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CACxD;AAED,QAAA,MAAM,UAAU,QAAO,YAsBtB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface ResizeCallbackData {
|
|
2
|
+
entry: ResizeObserverEntry;
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
}
|
|
6
|
+
type OnResizeCallback = (data: ResizeCallbackData) => void;
|
|
7
|
+
type ObserveElementFn = (element: Element, newOnResizeCallback?: OnResizeCallback) => void;
|
|
8
|
+
type UnobserveElementFn = (element: Element, newOnResizeCallback?: OnResizeCallback) => void;
|
|
9
|
+
type UpdateOnResizeCallbackFn = (newOnResizeCallback: OnResizeCallback) => void;
|
|
10
|
+
declare const useResizeObserver: (onResize?: OnResizeCallback) => [ObserveElementFn, UnobserveElementFn, UpdateOnResizeCallbackFn];
|
|
11
|
+
export default useResizeObserver;
|
|
12
|
+
//# sourceMappingURL=use-resize-observer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-resize-observer.d.ts","sourceRoot":"","sources":["../../src/hooks/use-resize-observer.ts"],"names":[],"mappings":"AAGA,UAAU,kBAAkB;IAC1B,KAAK,EAAE,mBAAmB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,KAAK,gBAAgB,GAAG,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;AAE3D,KAAK,gBAAgB,GAAG,CACtB,OAAO,EAAE,OAAO,EAChB,mBAAmB,CAAC,EAAE,gBAAgB,KACnC,IAAI,CAAC;AACV,KAAK,kBAAkB,GAAG,CACxB,OAAO,EAAE,OAAO,EAChB,mBAAmB,CAAC,EAAE,gBAAgB,KACnC,IAAI,CAAC;AACV,KAAK,wBAAwB,GAAG,CAAC,mBAAmB,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAEhF,QAAA,MAAM,iBAAiB,GACrB,WAAU,gBAA2B,KACpC,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,wBAAwB,CA4EjE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -21,9 +21,8 @@ var useResizeObserver = function useResizeObserver() {
|
|
|
21
21
|
onResizeCallback.current = newOnResizeCallback;
|
|
22
22
|
}, []);
|
|
23
23
|
var initObserver = useCallback(function () {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
24
|
+
var _resizeObserver$curre;
|
|
25
|
+
(_resizeObserver$curre = resizeObserver.current) !== null && _resizeObserver$curre !== void 0 ? _resizeObserver$curre : resizeObserver.current = new ResizeObserver(observerCallback);
|
|
27
26
|
}, []);
|
|
28
27
|
var observeElement = useCallback(function (element, newOnResizeCallback) {
|
|
29
28
|
if (element) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-store.d.ts","sourceRoot":"","sources":["../../src/hooks/use-store.ts"],"names":[],"mappings":"AAGA,4BAA4B;AAC5B,OAAmB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAElE,QAAA,MAAM,QAAQ,QAAO,eAAyC,CAAC;AAC/D,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SavedImageData } from 'types/common';
|
|
2
|
+
import { ImageDesignState } from 'types/state';
|
|
3
|
+
interface ImageFileInfo {
|
|
4
|
+
name?: string;
|
|
5
|
+
extension?: string;
|
|
6
|
+
quality?: number;
|
|
7
|
+
size?: {
|
|
8
|
+
width?: number;
|
|
9
|
+
height?: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
interface TransformedImgResult {
|
|
13
|
+
imageData: SavedImageData;
|
|
14
|
+
designState: ImageDesignState;
|
|
15
|
+
hideLoadingSpinner?: () => void;
|
|
16
|
+
}
|
|
17
|
+
type GetTransformedDataFn = (imageFileInfo?: ImageFileInfo, pixelRatio?: boolean | number, keepLoadingSpinnerShown?: boolean) => TransformedImgResult;
|
|
18
|
+
declare const useTransformedImgData: () => GetTransformedDataFn;
|
|
19
|
+
export default useTransformedImgData;
|
|
20
|
+
//# sourceMappingURL=use-transformed-img-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-transformed-img-data.d.ts","sourceRoot":"","sources":["../../src/hooks/use-transformed-img-data.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAY/C,UAAU,aAAa;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5C;AAED,UAAU,oBAAoB;IAC5B,SAAS,EAAE,cAAc,CAAC;IAC1B,WAAW,EAAE,gBAAgB,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;CACjC;AAED,KAAK,oBAAoB,GAAG,CAC1B,aAAa,CAAC,EAAE,aAAa,EAC7B,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,EAC7B,uBAAuB,CAAC,EAAE,OAAO,KAC9B,oBAAoB,CAAC;AAE1B,QAAA,MAAM,qBAAqB,QAAO,oBAsLjC,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -30,9 +30,13 @@ var useTransformedImgData = function useTransformedImgData() {
|
|
|
30
30
|
forceToPngInEllipticalCrop = _state$config.forceToPngInEllipticalCrop,
|
|
31
31
|
defaultSavedImageType = _state$config.defaultSavedImageType;
|
|
32
32
|
var getTransformedImgData = function getTransformedImgData() {
|
|
33
|
+
var _x, _y, _width, _height, _mappedCropBox$x, _mappedCropBox$y, _size$width, _size$height;
|
|
33
34
|
var imageFileInfo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
34
35
|
var pixelRatio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
35
36
|
var keepLoadingSpinnerShown = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
37
|
+
if (!originalImage) {
|
|
38
|
+
throw new Error('No image loaded');
|
|
39
|
+
}
|
|
36
40
|
var currentImgFileInfo = _objectSpread({
|
|
37
41
|
size: resize
|
|
38
42
|
}, imageFileInfo);
|
|
@@ -67,7 +71,7 @@ var useTransformedImgData = function useTransformedImgData() {
|
|
|
67
71
|
scaleX: preparedDesignLayerScale.x,
|
|
68
72
|
scaleY: preparedDesignLayerScale.y
|
|
69
73
|
});
|
|
70
|
-
var _ref = _objectSpread(_objectSpread({}, (!currentImgFileInfo.name || !currentImgFileInfo.extension) && getFileFullName(originalImage.
|
|
74
|
+
var _ref = _objectSpread(_objectSpread({}, (!currentImgFileInfo.name || !currentImgFileInfo.extension) && getFileFullName(originalImage.title, forceToPngInEllipticalCrop && crop.ratio === ELLIPSE_CROP ? 'png' : SUPPORTED_IMAGE_TYPES.includes(defaultSavedImageType === null || defaultSavedImageType === void 0 ? void 0 : defaultSavedImageType.toLowerCase()) && defaultSavedImageType || undefined)), currentImgFileInfo),
|
|
71
75
|
name = _ref.name,
|
|
72
76
|
extension = _ref.extension,
|
|
73
77
|
_ref$quality = _ref.quality,
|
|
@@ -79,15 +83,15 @@ var useTransformedImgData = function useTransformedImgData() {
|
|
|
79
83
|
x: 0,
|
|
80
84
|
y: 0
|
|
81
85
|
} : {
|
|
82
|
-
x: crop.x
|
|
83
|
-
y: crop.y
|
|
84
|
-
width: crop.width
|
|
85
|
-
height: crop.height
|
|
86
|
+
x: (_x = crop.x) !== null && _x !== void 0 ? _x : clipX,
|
|
87
|
+
y: (_y = crop.y) !== null && _y !== void 0 ? _y : clipY,
|
|
88
|
+
width: (_width = crop.width) !== null && _width !== void 0 ? _width : clipWidth,
|
|
89
|
+
height: (_height = crop.height) !== null && _height !== void 0 ? _height : clipHeight
|
|
86
90
|
}, shownImageDimensions, preparedCanvas.attrs);
|
|
87
91
|
var rotatedCropBox = getSizeAfterRotation(mappedCropBox.width, mappedCropBox.height, rotation);
|
|
88
92
|
preparedCanvas.setAttrs({
|
|
89
|
-
offsetX: mappedCropBox.width / 2 + (mappedCropBox.x
|
|
90
|
-
offsetY: mappedCropBox.height / 2 + (mappedCropBox.y
|
|
93
|
+
offsetX: mappedCropBox.width / 2 + ((_mappedCropBox$x = mappedCropBox.x) !== null && _mappedCropBox$x !== void 0 ? _mappedCropBox$x : 0),
|
|
94
|
+
offsetY: mappedCropBox.height / 2 + ((_mappedCropBox$y = mappedCropBox.y) !== null && _mappedCropBox$y !== void 0 ? _mappedCropBox$y : 0),
|
|
91
95
|
width: rotatedCropBox.width,
|
|
92
96
|
height: rotatedCropBox.height,
|
|
93
97
|
x: rotatedCropBox.width / 2,
|
|
@@ -125,8 +129,8 @@ var useTransformedImgData = function useTransformedImgData() {
|
|
|
125
129
|
mimeType: "image/".concat(extension),
|
|
126
130
|
imageCanvas: finalCanvas,
|
|
127
131
|
imageBase64: finalImgBase64,
|
|
128
|
-
width: size.width
|
|
129
|
-
height: size.height
|
|
132
|
+
width: (_size$width = size.width) !== null && _size$width !== void 0 ? _size$width : mappedCropBox.width,
|
|
133
|
+
height: (_size$height = size.height) !== null && _size$height !== void 0 ? _size$height : mappedCropBox.height
|
|
130
134
|
}, isQualityAcceptable ? {
|
|
131
135
|
quality: quality
|
|
132
136
|
} : {});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** External Dependencies */
|
|
2
|
+
import { DependencyList, EffectCallback } from 'react';
|
|
3
|
+
declare const useUpdateEffect: (effectCallback: EffectCallback, dependencies: DependencyList) => void;
|
|
4
|
+
export default useUpdateEffect;
|
|
5
|
+
//# sourceMappingURL=use-update-effect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-update-effect.d.ts","sourceRoot":"","sources":["../../src/hooks/use-update-effect.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,OAAO,EAAqB,cAAc,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE1E,QAAA,MAAM,eAAe,GACnB,gBAAgB,cAAc,EAC9B,cAAc,cAAc,KAC3B,IAmBF,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAE,QAAQ,IAAI,IAAI,EAAE,SAAS,IAAI,KAAK,EAAE,CAAC;AAChD,eAAe,WAAW,CAAC"}
|