@solostylist/image-editor 1.0.8 → 1.0.10
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.js +11 -1
- package/lib/actions/change-pointer-icon.js +10 -1
- package/lib/actions/change-rotation.js +13 -1
- package/lib/actions/clear-annotations-selections.js +10 -1
- package/lib/actions/duplicate-annotations.js +26 -1
- package/lib/actions/enable-text-content-edit.js +10 -1
- package/lib/actions/hide-loader.js +10 -1
- package/lib/actions/index.js +36 -1
- package/lib/actions/redo.js +27 -1
- package/lib/actions/remove-annotations.js +27 -1
- package/lib/actions/reset.js +26 -1
- package/lib/actions/select-annotation.js +27 -1
- package/lib/actions/select-tab.js +16 -1
- package/lib/actions/select-tool.js +11 -1
- package/lib/actions/set-annotation.js +28 -1
- package/lib/actions/set-canvas-size.js +31 -1
- package/lib/actions/set-crop.js +25 -1
- package/lib/actions/set-feedback.js +11 -1
- package/lib/actions/set-finetune.js +13 -1
- package/lib/actions/set-latest-color.js +10 -1
- package/lib/actions/set-original-image.js +13 -1
- package/lib/actions/set-resize.js +14 -1
- package/lib/actions/set-saved.js +10 -1
- package/lib/actions/set-saving.js +11 -1
- package/lib/actions/set-show-tabs-menu.js +10 -1
- package/lib/actions/set-shown-image-dimensions.js +12 -1
- package/lib/actions/show-loader.js +10 -1
- package/lib/actions/toggle-flip.js +13 -1
- package/lib/actions/toggle-original-image-display.js +10 -1
- package/lib/actions/undo.js +27 -1
- package/lib/actions/update-state.js +7 -1
- package/lib/actions/zoom-canvas.js +37 -1
- package/lib/components/app/index.js +283 -1
- package/lib/components/assembly-point/index.js +23 -1
- package/lib/components/common/annotation-options/annotation-options.constants.js +10 -1
- package/lib/components/common/annotation-options/index.js +140 -1
- package/lib/components/common/annotation-options/opacity-field.js +23 -1
- package/lib/components/common/annotation-options/position-fields.js +39 -1
- package/lib/components/common/annotation-options/shadow-fields.js +62 -1
- package/lib/components/common/annotation-options/stroke-fields.js +33 -1
- package/lib/components/common/button-with-menu/index.js +86 -1
- package/lib/components/common/color-input/index.js +101 -1
- package/lib/components/common/color-picker-modal/index.js +70 -1
- package/lib/components/common/hidden-upload-input/index.js +17 -1
- package/lib/components/common/icon-wrapper/index.js +40 -1
- package/lib/components/common/image-preview-tile/index.js +57 -1
- package/lib/components/common/slider/index.js +38 -1
- package/lib/components/feedback-popup/index.js +41 -1
- package/lib/components/layers/design-layer/annotation-nodes/annotation-nodes.constants.js +10 -1
- package/lib/components/layers/design-layer/annotation-nodes/arrow-node.js +62 -1
- package/lib/components/layers/design-layer/annotation-nodes/ellipse-node.js +64 -1
- package/lib/components/layers/design-layer/annotation-nodes/image-node.js +78 -1
- package/lib/components/layers/design-layer/annotation-nodes/index.js +22 -1
- package/lib/components/layers/design-layer/annotation-nodes/line-node.js +60 -1
- package/lib/components/layers/design-layer/annotation-nodes/memoized-annotation.js +16 -1
- package/lib/components/layers/design-layer/annotation-nodes/polygon-node.js +63 -1
- package/lib/components/layers/design-layer/annotation-nodes/rect-node.js +65 -1
- package/lib/components/layers/design-layer/annotation-nodes/text-node.js +80 -1
- package/lib/components/layers/design-layer/index.js +202 -1
- package/lib/components/layers/design-layer/nodes-common-prop-types.js +16 -1
- package/lib/components/layers/design-layer/preview-group.js +9 -1
- package/lib/components/layers/index.js +2 -1
- package/lib/components/layers/transformers-layer/crop-transformer.js +248 -1
- package/lib/components/layers/transformers-layer/index.js +16 -1
- package/lib/components/layers/transformers-layer/nodes-transformer.js +73 -1
- package/lib/components/layers/transformers-layer/transformers-layer.utils.js +93 -1
- package/lib/components/main-canvas/canvas-node.js +177 -1
- package/lib/components/main-canvas/index.js +51 -1
- package/lib/components/main-canvas/touch-zooming-events.js +69 -1
- package/lib/components/node-controls/index.js +79 -1
- package/lib/components/tabs/index.js +66 -1
- package/lib/components/tabs/tabs.constants.js +27 -1
- package/lib/components/tabs-drawer/index.js +109 -1
- package/lib/components/tools/arrow/arrow-button.js +17 -1
- package/lib/components/tools/arrow/arrow-options.js +19 -1
- package/lib/components/tools/arrow/index.js +2 -1
- package/lib/components/tools/blur/blur-options.js +35 -1
- package/lib/components/tools/blur/blur.js +17 -1
- package/lib/components/tools/blur/index.js +2 -1
- package/lib/components/tools/brightness/brightness-options.js +36 -1
- package/lib/components/tools/brightness/brightness.js +17 -1
- package/lib/components/tools/brightness/index.js +2 -1
- package/lib/components/tools/contrast/contrast-options.js +35 -1
- package/lib/components/tools/contrast/contrast.js +17 -1
- package/lib/components/tools/contrast/index.js +2 -1
- package/lib/components/tools/crop/crop.constants.js +31 -1
- package/lib/components/tools/crop/crop.js +122 -1
- package/lib/components/tools/crop/index.js +1 -1
- package/lib/components/tools/ellipse/ellipse-button.js +17 -1
- package/lib/components/tools/ellipse/ellipse-options.js +17 -1
- package/lib/components/tools/ellipse/index.js +2 -1
- package/lib/components/tools/filters/filter-item.js +77 -1
- package/lib/components/tools/filters/filters.constants.js +139 -1
- package/lib/components/tools/filters/filters.js +74 -1
- package/lib/components/tools/filters/index.js +1 -1
- package/lib/components/tools/flip/flip-x.js +48 -1
- package/lib/components/tools/flip/flip-y.js +50 -1
- package/lib/components/tools/flip/index.js +2 -1
- package/lib/components/tools/hsv/hsv.js +17 -1
- package/lib/components/tools/hsv/hsvoptions.js +60 -1
- package/lib/components/tools/hsv/index.js +2 -1
- package/lib/components/tools/image/image-button.js +17 -1
- package/lib/components/tools/image/image-controls.js +12 -1
- package/lib/components/tools/image/image-options.js +162 -1
- package/lib/components/tools/image/images-gallery.js +55 -1
- package/lib/components/tools/image/index.js +2 -1
- package/lib/components/tools/line/index.js +2 -1
- package/lib/components/tools/line/line-button.js +17 -1
- package/lib/components/tools/line/line-options.js +19 -1
- package/lib/components/tools/pen/index.js +2 -1
- package/lib/components/tools/pen/pen-button.js +17 -1
- package/lib/components/tools/pen/pen-options.js +120 -1
- package/lib/components/tools/polygon/index.js +2 -1
- package/lib/components/tools/polygon/polygon-button.js +17 -1
- package/lib/components/tools/polygon/polygon-options.js +22 -1
- package/lib/components/tools/polygon/polygon-sides-field.js +23 -1
- package/lib/components/tools/polygon/polygon.constants.js +10 -1
- package/lib/components/tools/rect/index.js +2 -1
- package/lib/components/tools/rect/rect-button.js +17 -1
- package/lib/components/tools/rect/rect-corner-field.js +24 -1
- package/lib/components/tools/rect/rect-options.js +21 -1
- package/lib/components/tools/rect/rect.constants.js +10 -1
- package/lib/components/tools/resize/index.js +1 -1
- package/lib/components/tools/resize/resize.js +141 -1
- package/lib/components/tools/rotate/index.js +2 -1
- package/lib/components/tools/rotate/rotate-button.js +17 -1
- package/lib/components/tools/rotate/rotate-options.js +97 -1
- package/lib/components/tools/text/index.js +2 -1
- package/lib/components/tools/text/text-button.js +17 -1
- package/lib/components/tools/text/text-options/handle-text-change-area.js +122 -1
- package/lib/components/tools/text/text-options/index.js +17 -1
- package/lib/components/tools/text/text-options/text-alignment-fields.js +38 -1
- package/lib/components/tools/text/text-options/text-controls.js +147 -1
- package/lib/components/tools/text/text-options/text-options.constants.js +16 -1
- package/lib/components/tools/text/text-options/text-spacings-fields.js +34 -1
- package/lib/components/tools/tools.constants.js +98 -1
- package/lib/components/tools/warmth/index.js +2 -1
- package/lib/components/tools/warmth/warmth-options.js +35 -1
- package/lib/components/tools/warmth/warmth.js +17 -1
- package/lib/components/tools/watermark/index.js +1 -1
- package/lib/components/tools/watermark/watermark-padding.js +59 -1
- package/lib/components/tools/watermark/watermark.js +221 -1
- package/lib/components/tools/watermark/watermarks-gallery.js +77 -1
- package/lib/components/tools-bar/index.js +113 -1
- package/lib/components/tools-bar/tools-bar-item-button.js +39 -1
- package/lib/components/topbar/canvas-zooming.js +119 -1
- package/lib/components/topbar/confirmation-modal.js +53 -1
- package/lib/components/topbar/image-dimensions-and-display-toggle.js +68 -1
- package/lib/components/topbar/index.js +47 -1
- package/lib/components/topbar/redo-button.js +25 -1
- package/lib/components/topbar/reset-button.js +21 -1
- package/lib/components/topbar/save-button.js +251 -1
- package/lib/components/topbar/topbar.constants.js +31 -1
- package/lib/components/topbar/undo-button.js +27 -1
- package/lib/context/app-context.js +3 -1
- package/lib/context/app-provider-overriden-value.js +9 -1
- package/lib/context/app-provider.js +48 -1
- package/lib/context/app-reducer.js +5 -1
- package/lib/context/default-config.js +75 -1
- package/lib/context/default-translations.js +115 -1
- package/lib/context/get-initial-app-state.js +61 -1
- package/lib/context/index.js +4 -1
- package/lib/custom/filters/aden.js +8 -1
- package/lib/custom/filters/amaro.js +8 -1
- package/lib/custom/filters/ashby.js +8 -1
- package/lib/custom/filters/base-filters.js +82 -1
- package/lib/custom/filters/black-and-white.js +11 -1
- package/lib/custom/filters/brannan.js +8 -1
- package/lib/custom/filters/brooklyn.js +8 -1
- package/lib/custom/filters/charmes.js +8 -1
- package/lib/custom/filters/clarendon.js +9 -1
- package/lib/custom/filters/crema.js +8 -1
- package/lib/custom/filters/dogpatch.js +8 -1
- package/lib/custom/filters/earlybird.js +7 -1
- package/lib/custom/filters/gingham.js +8 -1
- package/lib/custom/filters/ginza.js +8 -1
- package/lib/custom/filters/hefe.js +8 -1
- package/lib/custom/filters/helena.js +8 -1
- package/lib/custom/filters/hudson.js +9 -1
- package/lib/custom/filters/index.js +40 -1
- package/lib/custom/filters/juno.js +8 -1
- package/lib/custom/filters/kelvin.js +9 -1
- package/lib/custom/filters/lark.js +9 -1
- package/lib/custom/filters/lo-fi.js +8 -1
- package/lib/custom/filters/ludwig.js +8 -1
- package/lib/custom/filters/maven.js +9 -1
- package/lib/custom/filters/mayfair.js +8 -1
- package/lib/custom/filters/moon.js +7 -1
- package/lib/custom/filters/nashville.js +8 -1
- package/lib/custom/filters/ninteen-seventy-seven.js +8 -1
- package/lib/custom/filters/perpetua.js +7 -1
- package/lib/custom/filters/reyes.js +9 -1
- package/lib/custom/filters/rise.js +9 -1
- package/lib/custom/filters/sierra.js +8 -1
- package/lib/custom/filters/skyline.js +8 -1
- package/lib/custom/filters/slumber.js +8 -1
- package/lib/custom/filters/stinson.js +8 -1
- package/lib/custom/filters/sutro.js +8 -1
- package/lib/custom/filters/toaster.js +8 -1
- package/lib/custom/filters/valencia.js +9 -1
- package/lib/custom/filters/vesper.js +9 -1
- package/lib/custom/filters/walden.js +8 -1
- package/lib/custom/filters/willow.js +8 -1
- package/lib/custom/filters/xpro2.js +9 -1
- package/lib/custom/finetunes/custom-threshold.js +19 -1
- package/lib/custom/finetunes/index.js +2 -1
- package/lib/custom/finetunes/warmth.js +15 -1
- package/lib/demo/app.js +175 -1
- package/lib/demo/index.js +1 -1
- package/lib/hooks/index.js +12 -1
- package/lib/hooks/use-annotation/get-bounding-rect-un-scaled.js +14 -1
- package/lib/hooks/use-annotation/get-new-annotation-preview.js +83 -1
- package/lib/hooks/use-annotation/index.js +138 -1
- package/lib/hooks/use-annotation/preview-then-call-annotation-adding.js +159 -1
- package/lib/hooks/use-annotation-events.js +83 -1
- package/lib/hooks/use-app-reducer.js +53 -1
- package/lib/hooks/use-debounced-callback.js +7 -1
- package/lib/hooks/use-drag.js +37 -1
- package/lib/hooks/use-filter.js +20 -1
- package/lib/hooks/use-finetune.js +31 -1
- package/lib/hooks/use-phone-screen.js +5 -1
- package/lib/hooks/use-popover.js +27 -1
- package/lib/hooks/use-resize-observer.js +60 -1
- package/lib/hooks/use-store.js +6 -1
- package/lib/hooks/use-transformed-img-data.js +156 -1
- package/lib/hooks/use-update-effect.js +18 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -1
- package/lib/types/actions.js +31 -1
- package/lib/types/annotations.js +42 -1
- package/lib/types/common.js +1 -1
- package/lib/types/config.js +34 -1
- package/lib/types/index.js +5 -1
- package/lib/types/state.js +1 -1
- package/lib/utils/assign-finetune-names-to-konva.js +7 -1
- package/lib/utils/calculate-zoom-data.js +36 -1
- package/lib/utils/compare-ratios.js +5 -1
- package/lib/utils/constants.js +84 -1
- package/lib/utils/crop-image.js +10 -1
- package/lib/utils/debounce.js +19 -1
- package/lib/utils/deep-merge.js +26 -1
- package/lib/utils/extract-current-design-state.js +15 -1
- package/lib/utils/extract-name-from-url.js +5 -1
- package/lib/utils/filter-str-to-class.js +9 -1
- package/lib/utils/finetunes-strs-to-classes.js +13 -1
- package/lib/utils/get-center-rotated-point.js +34 -1
- package/lib/utils/get-default-save-quality.js +5 -1
- package/lib/utils/get-dimensions-minimal-ratio.js +6 -1
- package/lib/utils/get-elem-document-coords.js +24 -1
- package/lib/utils/get-file-full-name.js +21 -1
- package/lib/utils/get-pointer-offset-position-bounded-to-object.js +26 -1
- package/lib/utils/get-proper-dimensions.js +21 -1
- package/lib/utils/get-proper-image-to-canvas-spacing.js +6 -1
- package/lib/utils/get-scroll-offset.js +13 -1
- package/lib/utils/get-size-after-rotation.js +31 -1
- package/lib/utils/get-zoom-fit-factor.js +5 -1
- package/lib/utils/image-to-base64.js +12 -1
- package/lib/utils/is-default-zero-values-only.js +6 -1
- package/lib/utils/is-same-image.js +4 -1
- package/lib/utils/load-image.js +19 -1
- package/lib/utils/map-crop-box.js +16 -1
- package/lib/utils/map-number.js +4 -1
- package/lib/utils/map-position-string-to-point.js +92 -1
- package/lib/utils/random-id.js +5 -1
- package/lib/utils/restrict-number.js +7 -1
- package/lib/utils/serialize-design-state.js +62 -1
- package/lib/utils/to-precised-float.js +5 -1
- package/lib/utils/translator.js +14 -1
- package/package.json +1 -1
|
@@ -1 +1,62 @@
|
|
|
1
|
-
import _extends from"@babel/runtime/helpers/extends";
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["id", "name", "fill", "pointerLength", "pointerWidth", "scaleX", "scaleY", "rotation", "annotationEvents", "points", "lineCap", "stroke", "strokeWidth", "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", "shadowOpacity", "opacity"];
|
|
4
|
+
import { Arrow } from 'react-konva';
|
|
5
|
+
import { nodesCommonDefaults } from "../nodes-common-prop-types";
|
|
6
|
+
var ArrowNode = function ArrowNode(_ref) {
|
|
7
|
+
var id = _ref.id,
|
|
8
|
+
name = _ref.name,
|
|
9
|
+
fill = _ref.fill,
|
|
10
|
+
pointerLength = _ref.pointerLength,
|
|
11
|
+
pointerWidth = _ref.pointerWidth,
|
|
12
|
+
_ref$scaleX = _ref.scaleX,
|
|
13
|
+
scaleX = _ref$scaleX === void 0 ? nodesCommonDefaults.scaleX : _ref$scaleX,
|
|
14
|
+
_ref$scaleY = _ref.scaleY,
|
|
15
|
+
scaleY = _ref$scaleY === void 0 ? nodesCommonDefaults.scaleY : _ref$scaleY,
|
|
16
|
+
_ref$rotation = _ref.rotation,
|
|
17
|
+
rotation = _ref$rotation === void 0 ? nodesCommonDefaults.rotation : _ref$rotation,
|
|
18
|
+
annotationEvents = _ref.annotationEvents,
|
|
19
|
+
points = _ref.points,
|
|
20
|
+
_ref$lineCap = _ref.lineCap,
|
|
21
|
+
lineCap = _ref$lineCap === void 0 ? 'butt' : _ref$lineCap,
|
|
22
|
+
_ref$stroke = _ref.stroke,
|
|
23
|
+
stroke = _ref$stroke === void 0 ? '#000000' : _ref$stroke,
|
|
24
|
+
_ref$strokeWidth = _ref.strokeWidth,
|
|
25
|
+
strokeWidth = _ref$strokeWidth === void 0 ? 6 : _ref$strokeWidth,
|
|
26
|
+
_ref$shadowOffsetX = _ref.shadowOffsetX,
|
|
27
|
+
shadowOffsetX = _ref$shadowOffsetX === void 0 ? nodesCommonDefaults.shadowOffsetX : _ref$shadowOffsetX,
|
|
28
|
+
_ref$shadowOffsetY = _ref.shadowOffsetY,
|
|
29
|
+
shadowOffsetY = _ref$shadowOffsetY === void 0 ? nodesCommonDefaults.shadowOffsetY : _ref$shadowOffsetY,
|
|
30
|
+
_ref$shadowBlur = _ref.shadowBlur,
|
|
31
|
+
shadowBlur = _ref$shadowBlur === void 0 ? nodesCommonDefaults.shadowBlur : _ref$shadowBlur,
|
|
32
|
+
_ref$shadowColor = _ref.shadowColor,
|
|
33
|
+
shadowColor = _ref$shadowColor === void 0 ? nodesCommonDefaults.shadowColor : _ref$shadowColor,
|
|
34
|
+
_ref$shadowOpacity = _ref.shadowOpacity,
|
|
35
|
+
shadowOpacity = _ref$shadowOpacity === void 0 ? nodesCommonDefaults.shadowOpacity : _ref$shadowOpacity,
|
|
36
|
+
_ref$opacity = _ref.opacity,
|
|
37
|
+
opacity = _ref$opacity === void 0 ? nodesCommonDefaults.opacity : _ref$opacity,
|
|
38
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
39
|
+
return React.createElement(Arrow, _extends({
|
|
40
|
+
id: id,
|
|
41
|
+
name: name,
|
|
42
|
+
rotation: rotation,
|
|
43
|
+
scaleX: scaleX,
|
|
44
|
+
scaleY: scaleY,
|
|
45
|
+
stroke: stroke,
|
|
46
|
+
strokeWidth: strokeWidth,
|
|
47
|
+
shadowOffsetX: shadowOffsetX,
|
|
48
|
+
shadowOffsetY: shadowOffsetY,
|
|
49
|
+
shadowBlur: shadowBlur,
|
|
50
|
+
shadowColor: shadowColor,
|
|
51
|
+
shadowOpacity: shadowOpacity,
|
|
52
|
+
fill: fill,
|
|
53
|
+
x: 0,
|
|
54
|
+
y: 0,
|
|
55
|
+
points: points,
|
|
56
|
+
pointerLength: pointerLength,
|
|
57
|
+
pointerWidth: pointerWidth,
|
|
58
|
+
lineCap: lineCap,
|
|
59
|
+
opacity: opacity
|
|
60
|
+
}, annotationEvents, otherProps));
|
|
61
|
+
};
|
|
62
|
+
export default ArrowNode;
|
|
@@ -1 +1,64 @@
|
|
|
1
|
-
import _extends from"@babel/runtime/helpers/extends";
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["id", "name", "fill", "x", "y", "radiusX", "radiusY", "scaleX", "scaleY", "rotation", "annotationEvents", "stroke", "strokeWidth", "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", "shadowOpacity", "opacity"];
|
|
4
|
+
import { Ellipse } from 'react-konva';
|
|
5
|
+
import { nodesCommonDefaults } from "../nodes-common-prop-types";
|
|
6
|
+
var EllipseNode = function EllipseNode(_ref) {
|
|
7
|
+
var id = _ref.id,
|
|
8
|
+
name = _ref.name,
|
|
9
|
+
_ref$fill = _ref.fill,
|
|
10
|
+
fill = _ref$fill === void 0 ? '#000' : _ref$fill,
|
|
11
|
+
x = _ref.x,
|
|
12
|
+
y = _ref.y,
|
|
13
|
+
_ref$radiusX = _ref.radiusX,
|
|
14
|
+
radiusX = _ref$radiusX === void 0 ? 0 : _ref$radiusX,
|
|
15
|
+
_ref$radiusY = _ref.radiusY,
|
|
16
|
+
radiusY = _ref$radiusY === void 0 ? 0 : _ref$radiusY,
|
|
17
|
+
_ref$scaleX = _ref.scaleX,
|
|
18
|
+
scaleX = _ref$scaleX === void 0 ? nodesCommonDefaults.scaleX : _ref$scaleX,
|
|
19
|
+
_ref$scaleY = _ref.scaleY,
|
|
20
|
+
scaleY = _ref$scaleY === void 0 ? nodesCommonDefaults.scaleY : _ref$scaleY,
|
|
21
|
+
_ref$rotation = _ref.rotation,
|
|
22
|
+
rotation = _ref$rotation === void 0 ? nodesCommonDefaults.rotation : _ref$rotation,
|
|
23
|
+
annotationEvents = _ref.annotationEvents,
|
|
24
|
+
_ref$stroke = _ref.stroke,
|
|
25
|
+
stroke = _ref$stroke === void 0 ? nodesCommonDefaults.stroke : _ref$stroke,
|
|
26
|
+
_ref$strokeWidth = _ref.strokeWidth,
|
|
27
|
+
strokeWidth = _ref$strokeWidth === void 0 ? nodesCommonDefaults.strokeWidth : _ref$strokeWidth,
|
|
28
|
+
_ref$shadowOffsetX = _ref.shadowOffsetX,
|
|
29
|
+
shadowOffsetX = _ref$shadowOffsetX === void 0 ? nodesCommonDefaults.shadowOffsetX : _ref$shadowOffsetX,
|
|
30
|
+
_ref$shadowOffsetY = _ref.shadowOffsetY,
|
|
31
|
+
shadowOffsetY = _ref$shadowOffsetY === void 0 ? nodesCommonDefaults.shadowOffsetY : _ref$shadowOffsetY,
|
|
32
|
+
_ref$shadowBlur = _ref.shadowBlur,
|
|
33
|
+
shadowBlur = _ref$shadowBlur === void 0 ? nodesCommonDefaults.shadowBlur : _ref$shadowBlur,
|
|
34
|
+
_ref$shadowColor = _ref.shadowColor,
|
|
35
|
+
shadowColor = _ref$shadowColor === void 0 ? nodesCommonDefaults.shadowColor : _ref$shadowColor,
|
|
36
|
+
_ref$shadowOpacity = _ref.shadowOpacity,
|
|
37
|
+
shadowOpacity = _ref$shadowOpacity === void 0 ? nodesCommonDefaults.shadowOpacity : _ref$shadowOpacity,
|
|
38
|
+
_ref$opacity = _ref.opacity,
|
|
39
|
+
opacity = _ref$opacity === void 0 ? nodesCommonDefaults.opacity : _ref$opacity,
|
|
40
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
41
|
+
return React.createElement(Ellipse, _extends({
|
|
42
|
+
id: id,
|
|
43
|
+
name: name,
|
|
44
|
+
rotation: rotation,
|
|
45
|
+
scaleX: scaleX,
|
|
46
|
+
scaleY: scaleY,
|
|
47
|
+
stroke: stroke,
|
|
48
|
+
strokeWidth: strokeWidth,
|
|
49
|
+
shadowOffsetX: shadowOffsetX,
|
|
50
|
+
shadowOffsetY: shadowOffsetY,
|
|
51
|
+
shadowBlur: shadowBlur,
|
|
52
|
+
shadowColor: shadowColor,
|
|
53
|
+
shadowOpacity: shadowOpacity,
|
|
54
|
+
fill: fill,
|
|
55
|
+
x: x,
|
|
56
|
+
y: y,
|
|
57
|
+
radiusX: radiusX,
|
|
58
|
+
radiusY: radiusY,
|
|
59
|
+
offsetX: -radiusX,
|
|
60
|
+
offsetY: -radiusY,
|
|
61
|
+
opacity: opacity
|
|
62
|
+
}, annotationEvents, otherProps));
|
|
63
|
+
};
|
|
64
|
+
export default EllipseNode;
|
|
@@ -1 +1,78 @@
|
|
|
1
|
-
import _extends from"@babel/runtime/helpers/extends";
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["id", "name", "image", "x", "y", "width", "height", "scaleX", "scaleY", "rotation", "annotationEvents", "stroke", "strokeWidth", "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", "shadowOpacity", "opacity"];
|
|
5
|
+
import { useEffect, useState } from 'react';
|
|
6
|
+
import { Image } from 'react-konva';
|
|
7
|
+
import loadImage from 'utils/load-image';
|
|
8
|
+
import { nodesCommonDefaults } from "../nodes-common-prop-types";
|
|
9
|
+
var ImageNode = function ImageNode(_ref) {
|
|
10
|
+
var id = _ref.id,
|
|
11
|
+
name = _ref.name,
|
|
12
|
+
image = _ref.image,
|
|
13
|
+
x = _ref.x,
|
|
14
|
+
y = _ref.y,
|
|
15
|
+
_ref$width = _ref.width,
|
|
16
|
+
width = _ref$width === void 0 ? 0 : _ref$width,
|
|
17
|
+
_ref$height = _ref.height,
|
|
18
|
+
height = _ref$height === void 0 ? 0 : _ref$height,
|
|
19
|
+
_ref$scaleX = _ref.scaleX,
|
|
20
|
+
scaleX = _ref$scaleX === void 0 ? nodesCommonDefaults.scaleX : _ref$scaleX,
|
|
21
|
+
_ref$scaleY = _ref.scaleY,
|
|
22
|
+
scaleY = _ref$scaleY === void 0 ? nodesCommonDefaults.scaleY : _ref$scaleY,
|
|
23
|
+
_ref$rotation = _ref.rotation,
|
|
24
|
+
rotation = _ref$rotation === void 0 ? nodesCommonDefaults.rotation : _ref$rotation,
|
|
25
|
+
annotationEvents = _ref.annotationEvents,
|
|
26
|
+
_ref$stroke = _ref.stroke,
|
|
27
|
+
stroke = _ref$stroke === void 0 ? nodesCommonDefaults.stroke : _ref$stroke,
|
|
28
|
+
_ref$strokeWidth = _ref.strokeWidth,
|
|
29
|
+
strokeWidth = _ref$strokeWidth === void 0 ? nodesCommonDefaults.strokeWidth : _ref$strokeWidth,
|
|
30
|
+
_ref$shadowOffsetX = _ref.shadowOffsetX,
|
|
31
|
+
shadowOffsetX = _ref$shadowOffsetX === void 0 ? nodesCommonDefaults.shadowOffsetX : _ref$shadowOffsetX,
|
|
32
|
+
_ref$shadowOffsetY = _ref.shadowOffsetY,
|
|
33
|
+
shadowOffsetY = _ref$shadowOffsetY === void 0 ? nodesCommonDefaults.shadowOffsetY : _ref$shadowOffsetY,
|
|
34
|
+
_ref$shadowBlur = _ref.shadowBlur,
|
|
35
|
+
shadowBlur = _ref$shadowBlur === void 0 ? nodesCommonDefaults.shadowBlur : _ref$shadowBlur,
|
|
36
|
+
_ref$shadowColor = _ref.shadowColor,
|
|
37
|
+
shadowColor = _ref$shadowColor === void 0 ? nodesCommonDefaults.shadowColor : _ref$shadowColor,
|
|
38
|
+
_ref$shadowOpacity = _ref.shadowOpacity,
|
|
39
|
+
shadowOpacity = _ref$shadowOpacity === void 0 ? nodesCommonDefaults.shadowOpacity : _ref$shadowOpacity,
|
|
40
|
+
_ref$opacity = _ref.opacity,
|
|
41
|
+
opacity = _ref$opacity === void 0 ? nodesCommonDefaults.opacity : _ref$opacity,
|
|
42
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
+
var _useState = useState(null),
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
imgElement = _useState2[0],
|
|
46
|
+
setImgElement = _useState2[1];
|
|
47
|
+
useEffect(function () {
|
|
48
|
+
if (typeof image === 'string') {
|
|
49
|
+
void loadImage(image).then(setImgElement);
|
|
50
|
+
}
|
|
51
|
+
}, [image]);
|
|
52
|
+
var isImgElement = image instanceof HTMLImageElement;
|
|
53
|
+
if (!isImgElement && !imgElement) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
var finalImg = isImgElement ? image : imgElement;
|
|
57
|
+
return React.createElement(Image, _extends({
|
|
58
|
+
id: id,
|
|
59
|
+
name: name,
|
|
60
|
+
rotation: rotation,
|
|
61
|
+
scaleX: scaleX,
|
|
62
|
+
scaleY: scaleY,
|
|
63
|
+
stroke: stroke,
|
|
64
|
+
strokeWidth: strokeWidth,
|
|
65
|
+
shadowOffsetX: shadowOffsetX,
|
|
66
|
+
shadowOffsetY: shadowOffsetY,
|
|
67
|
+
shadowBlur: shadowBlur,
|
|
68
|
+
shadowColor: shadowColor,
|
|
69
|
+
shadowOpacity: shadowOpacity,
|
|
70
|
+
image: finalImg,
|
|
71
|
+
x: x,
|
|
72
|
+
y: y,
|
|
73
|
+
width: width,
|
|
74
|
+
height: height,
|
|
75
|
+
opacity: opacity
|
|
76
|
+
}, otherProps, annotationEvents, otherProps));
|
|
77
|
+
};
|
|
78
|
+
export default ImageNode;
|
|
@@ -1 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { useAnnotationEvents, useStore } from 'hooks';
|
|
3
|
+
import MemoizedAnnotation from "./memoized-annotation";
|
|
4
|
+
var AnnotationNodes = function AnnotationNodes() {
|
|
5
|
+
var _useStore = useStore(),
|
|
6
|
+
_useStore$annotations = _useStore.annotations,
|
|
7
|
+
annotations = _useStore$annotations === void 0 ? {} : _useStore$annotations,
|
|
8
|
+
_useStore$selectionsI = _useStore.selectionsIds,
|
|
9
|
+
selectionsIds = _useStore$selectionsI === void 0 ? [] : _useStore$selectionsI;
|
|
10
|
+
var annotationEvents = useAnnotationEvents();
|
|
11
|
+
return useMemo(function () {
|
|
12
|
+
return Object.values(annotations).map(function (annotation) {
|
|
13
|
+
return React.createElement(MemoizedAnnotation, {
|
|
14
|
+
key: annotation.id,
|
|
15
|
+
annotation: annotation,
|
|
16
|
+
annotationEvents: annotationEvents,
|
|
17
|
+
selectionsIds: selectionsIds
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
}, [annotations, annotationEvents, selectionsIds]);
|
|
21
|
+
};
|
|
22
|
+
export default AnnotationNodes;
|
|
@@ -1 +1,60 @@
|
|
|
1
|
-
import _extends from"@babel/runtime/helpers/extends";
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["id", "name", "scaleX", "scaleY", "rotation", "annotationEvents", "points", "lineCap", "stroke", "strokeWidth", "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", "shadowOpacity", "tension", "opacity"];
|
|
4
|
+
import { Line } from 'react-konva';
|
|
5
|
+
import { nodesCommonDefaults } from "../nodes-common-prop-types";
|
|
6
|
+
var LineNode = function LineNode(_ref) {
|
|
7
|
+
var id = _ref.id,
|
|
8
|
+
name = _ref.name,
|
|
9
|
+
_ref$scaleX = _ref.scaleX,
|
|
10
|
+
scaleX = _ref$scaleX === void 0 ? nodesCommonDefaults.scaleX : _ref$scaleX,
|
|
11
|
+
_ref$scaleY = _ref.scaleY,
|
|
12
|
+
scaleY = _ref$scaleY === void 0 ? nodesCommonDefaults.scaleY : _ref$scaleY,
|
|
13
|
+
_ref$rotation = _ref.rotation,
|
|
14
|
+
rotation = _ref$rotation === void 0 ? nodesCommonDefaults.rotation : _ref$rotation,
|
|
15
|
+
_ref$annotationEvents = _ref.annotationEvents,
|
|
16
|
+
annotationEvents = _ref$annotationEvents === void 0 ? {} : _ref$annotationEvents,
|
|
17
|
+
points = _ref.points,
|
|
18
|
+
_ref$lineCap = _ref.lineCap,
|
|
19
|
+
lineCap = _ref$lineCap === void 0 ? 'butt' : _ref$lineCap,
|
|
20
|
+
_ref$stroke = _ref.stroke,
|
|
21
|
+
stroke = _ref$stroke === void 0 ? '#000000' : _ref$stroke,
|
|
22
|
+
_ref$strokeWidth = _ref.strokeWidth,
|
|
23
|
+
strokeWidth = _ref$strokeWidth === void 0 ? 1 : _ref$strokeWidth,
|
|
24
|
+
_ref$shadowOffsetX = _ref.shadowOffsetX,
|
|
25
|
+
shadowOffsetX = _ref$shadowOffsetX === void 0 ? nodesCommonDefaults.shadowOffsetX : _ref$shadowOffsetX,
|
|
26
|
+
_ref$shadowOffsetY = _ref.shadowOffsetY,
|
|
27
|
+
shadowOffsetY = _ref$shadowOffsetY === void 0 ? nodesCommonDefaults.shadowOffsetY : _ref$shadowOffsetY,
|
|
28
|
+
_ref$shadowBlur = _ref.shadowBlur,
|
|
29
|
+
shadowBlur = _ref$shadowBlur === void 0 ? nodesCommonDefaults.shadowBlur : _ref$shadowBlur,
|
|
30
|
+
_ref$shadowColor = _ref.shadowColor,
|
|
31
|
+
shadowColor = _ref$shadowColor === void 0 ? nodesCommonDefaults.shadowColor : _ref$shadowColor,
|
|
32
|
+
_ref$shadowOpacity = _ref.shadowOpacity,
|
|
33
|
+
shadowOpacity = _ref$shadowOpacity === void 0 ? nodesCommonDefaults.shadowOpacity : _ref$shadowOpacity,
|
|
34
|
+
tension = _ref.tension,
|
|
35
|
+
_ref$opacity = _ref.opacity,
|
|
36
|
+
opacity = _ref$opacity === void 0 ? nodesCommonDefaults.opacity : _ref$opacity,
|
|
37
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
+
return React.createElement(Line, _extends({
|
|
39
|
+
id: id,
|
|
40
|
+
name: name,
|
|
41
|
+
rotation: rotation,
|
|
42
|
+
scaleX: scaleX,
|
|
43
|
+
scaleY: scaleY,
|
|
44
|
+
stroke: stroke,
|
|
45
|
+
strokeWidth: strokeWidth,
|
|
46
|
+
shadowOffsetX: shadowOffsetX,
|
|
47
|
+
shadowOffsetY: shadowOffsetY,
|
|
48
|
+
shadowBlur: shadowBlur,
|
|
49
|
+
shadowColor: shadowColor,
|
|
50
|
+
shadowOpacity: shadowOpacity,
|
|
51
|
+
points: points,
|
|
52
|
+
lineCap: lineCap,
|
|
53
|
+
tension: tension,
|
|
54
|
+
hitStrokeWidth: 20,
|
|
55
|
+
x: 0,
|
|
56
|
+
y: 0,
|
|
57
|
+
opacity: opacity
|
|
58
|
+
}, annotationEvents, otherProps));
|
|
59
|
+
};
|
|
60
|
+
export default LineNode;
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
import _extends from"@babel/runtime/helpers/extends";
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import { ANNOTATION_NAMES_TO_COMPONENT } from "./annotation-nodes.constants";
|
|
4
|
+
var MemoizedAnnotation = function MemoizedAnnotation(_ref) {
|
|
5
|
+
var annotation = _ref.annotation,
|
|
6
|
+
annotationEvents = _ref.annotationEvents,
|
|
7
|
+
selectionsIds = _ref.selectionsIds;
|
|
8
|
+
var AnnotationComponent = ANNOTATION_NAMES_TO_COMPONENT[annotation.name];
|
|
9
|
+
if (!AnnotationComponent) return null;
|
|
10
|
+
return React.createElement(AnnotationComponent, _extends({
|
|
11
|
+
key: annotation.id,
|
|
12
|
+
annotationEvents: annotationEvents,
|
|
13
|
+
draggable: selectionsIds.includes(annotation.id)
|
|
14
|
+
}, annotation));
|
|
15
|
+
};
|
|
16
|
+
export default memo(MemoizedAnnotation);
|
|
@@ -1 +1,63 @@
|
|
|
1
|
-
import _extends from"@babel/runtime/helpers/extends";
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["id", "name", "fill", "x", "y", "radius", "scaleX", "scaleY", "rotation", "sides", "annotationEvents", "stroke", "strokeWidth", "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", "shadowOpacity", "opacity"];
|
|
4
|
+
import { RegularPolygon } from 'react-konva';
|
|
5
|
+
import { nodesCommonDefaults } from "../nodes-common-prop-types";
|
|
6
|
+
var PolygonNode = function PolygonNode(_ref) {
|
|
7
|
+
var id = _ref.id,
|
|
8
|
+
name = _ref.name,
|
|
9
|
+
_ref$fill = _ref.fill,
|
|
10
|
+
fill = _ref$fill === void 0 ? '#000' : _ref$fill,
|
|
11
|
+
x = _ref.x,
|
|
12
|
+
y = _ref.y,
|
|
13
|
+
radius = _ref.radius,
|
|
14
|
+
_ref$scaleX = _ref.scaleX,
|
|
15
|
+
scaleX = _ref$scaleX === void 0 ? nodesCommonDefaults.scaleX : _ref$scaleX,
|
|
16
|
+
_ref$scaleY = _ref.scaleY,
|
|
17
|
+
scaleY = _ref$scaleY === void 0 ? nodesCommonDefaults.scaleY : _ref$scaleY,
|
|
18
|
+
_ref$rotation = _ref.rotation,
|
|
19
|
+
rotation = _ref$rotation === void 0 ? nodesCommonDefaults.rotation : _ref$rotation,
|
|
20
|
+
_ref$sides = _ref.sides,
|
|
21
|
+
sides = _ref$sides === void 0 ? 3 : _ref$sides,
|
|
22
|
+
annotationEvents = _ref.annotationEvents,
|
|
23
|
+
_ref$stroke = _ref.stroke,
|
|
24
|
+
stroke = _ref$stroke === void 0 ? nodesCommonDefaults.stroke : _ref$stroke,
|
|
25
|
+
_ref$strokeWidth = _ref.strokeWidth,
|
|
26
|
+
strokeWidth = _ref$strokeWidth === void 0 ? nodesCommonDefaults.strokeWidth : _ref$strokeWidth,
|
|
27
|
+
_ref$shadowOffsetX = _ref.shadowOffsetX,
|
|
28
|
+
shadowOffsetX = _ref$shadowOffsetX === void 0 ? nodesCommonDefaults.shadowOffsetX : _ref$shadowOffsetX,
|
|
29
|
+
_ref$shadowOffsetY = _ref.shadowOffsetY,
|
|
30
|
+
shadowOffsetY = _ref$shadowOffsetY === void 0 ? nodesCommonDefaults.shadowOffsetY : _ref$shadowOffsetY,
|
|
31
|
+
_ref$shadowBlur = _ref.shadowBlur,
|
|
32
|
+
shadowBlur = _ref$shadowBlur === void 0 ? nodesCommonDefaults.shadowBlur : _ref$shadowBlur,
|
|
33
|
+
_ref$shadowColor = _ref.shadowColor,
|
|
34
|
+
shadowColor = _ref$shadowColor === void 0 ? nodesCommonDefaults.shadowColor : _ref$shadowColor,
|
|
35
|
+
_ref$shadowOpacity = _ref.shadowOpacity,
|
|
36
|
+
shadowOpacity = _ref$shadowOpacity === void 0 ? nodesCommonDefaults.shadowOpacity : _ref$shadowOpacity,
|
|
37
|
+
_ref$opacity = _ref.opacity,
|
|
38
|
+
opacity = _ref$opacity === void 0 ? nodesCommonDefaults.opacity : _ref$opacity,
|
|
39
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
40
|
+
return React.createElement(RegularPolygon, _extends({
|
|
41
|
+
id: id,
|
|
42
|
+
name: name,
|
|
43
|
+
rotation: rotation,
|
|
44
|
+
scaleX: scaleX,
|
|
45
|
+
scaleY: scaleY,
|
|
46
|
+
stroke: stroke,
|
|
47
|
+
strokeWidth: strokeWidth,
|
|
48
|
+
shadowOffsetX: shadowOffsetX,
|
|
49
|
+
shadowOffsetY: shadowOffsetY,
|
|
50
|
+
shadowBlur: shadowBlur,
|
|
51
|
+
shadowColor: shadowColor,
|
|
52
|
+
shadowOpacity: shadowOpacity,
|
|
53
|
+
fill: fill,
|
|
54
|
+
x: x,
|
|
55
|
+
y: y,
|
|
56
|
+
radius: radius,
|
|
57
|
+
offsetX: -radius,
|
|
58
|
+
offsetY: -radius,
|
|
59
|
+
sides: sides,
|
|
60
|
+
opacity: opacity
|
|
61
|
+
}, annotationEvents, otherProps));
|
|
62
|
+
};
|
|
63
|
+
export default PolygonNode;
|
|
@@ -1 +1,65 @@
|
|
|
1
|
-
import _extends from"@babel/runtime/helpers/extends";
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["id", "name", "fill", "x", "y", "width", "height", "scaleX", "scaleY", "rotation", "annotationEvents", "stroke", "strokeWidth", "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", "shadowOpacity", "opacity", "cornerRadius"];
|
|
4
|
+
import { Rect } from 'react-konva';
|
|
5
|
+
import { nodesCommonDefaults } from "../nodes-common-prop-types";
|
|
6
|
+
var RectNode = function RectNode(_ref) {
|
|
7
|
+
var id = _ref.id,
|
|
8
|
+
name = _ref.name,
|
|
9
|
+
_ref$fill = _ref.fill,
|
|
10
|
+
fill = _ref$fill === void 0 ? '#000' : _ref$fill,
|
|
11
|
+
x = _ref.x,
|
|
12
|
+
y = _ref.y,
|
|
13
|
+
_ref$width = _ref.width,
|
|
14
|
+
width = _ref$width === void 0 ? 0 : _ref$width,
|
|
15
|
+
_ref$height = _ref.height,
|
|
16
|
+
height = _ref$height === void 0 ? 0 : _ref$height,
|
|
17
|
+
_ref$scaleX = _ref.scaleX,
|
|
18
|
+
scaleX = _ref$scaleX === void 0 ? nodesCommonDefaults.scaleX : _ref$scaleX,
|
|
19
|
+
_ref$scaleY = _ref.scaleY,
|
|
20
|
+
scaleY = _ref$scaleY === void 0 ? nodesCommonDefaults.scaleY : _ref$scaleY,
|
|
21
|
+
_ref$rotation = _ref.rotation,
|
|
22
|
+
rotation = _ref$rotation === void 0 ? nodesCommonDefaults.rotation : _ref$rotation,
|
|
23
|
+
annotationEvents = _ref.annotationEvents,
|
|
24
|
+
_ref$stroke = _ref.stroke,
|
|
25
|
+
stroke = _ref$stroke === void 0 ? nodesCommonDefaults.stroke : _ref$stroke,
|
|
26
|
+
_ref$strokeWidth = _ref.strokeWidth,
|
|
27
|
+
strokeWidth = _ref$strokeWidth === void 0 ? nodesCommonDefaults.strokeWidth : _ref$strokeWidth,
|
|
28
|
+
_ref$shadowOffsetX = _ref.shadowOffsetX,
|
|
29
|
+
shadowOffsetX = _ref$shadowOffsetX === void 0 ? nodesCommonDefaults.shadowOffsetX : _ref$shadowOffsetX,
|
|
30
|
+
_ref$shadowOffsetY = _ref.shadowOffsetY,
|
|
31
|
+
shadowOffsetY = _ref$shadowOffsetY === void 0 ? nodesCommonDefaults.shadowOffsetY : _ref$shadowOffsetY,
|
|
32
|
+
_ref$shadowBlur = _ref.shadowBlur,
|
|
33
|
+
shadowBlur = _ref$shadowBlur === void 0 ? nodesCommonDefaults.shadowBlur : _ref$shadowBlur,
|
|
34
|
+
_ref$shadowColor = _ref.shadowColor,
|
|
35
|
+
shadowColor = _ref$shadowColor === void 0 ? nodesCommonDefaults.shadowColor : _ref$shadowColor,
|
|
36
|
+
_ref$shadowOpacity = _ref.shadowOpacity,
|
|
37
|
+
shadowOpacity = _ref$shadowOpacity === void 0 ? nodesCommonDefaults.shadowOpacity : _ref$shadowOpacity,
|
|
38
|
+
_ref$opacity = _ref.opacity,
|
|
39
|
+
opacity = _ref$opacity === void 0 ? nodesCommonDefaults.opacity : _ref$opacity,
|
|
40
|
+
_ref$cornerRadius = _ref.cornerRadius,
|
|
41
|
+
cornerRadius = _ref$cornerRadius === void 0 ? 0 : _ref$cornerRadius,
|
|
42
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
+
return React.createElement(Rect, _extends({
|
|
44
|
+
id: id,
|
|
45
|
+
name: name,
|
|
46
|
+
rotation: rotation,
|
|
47
|
+
scaleX: scaleX,
|
|
48
|
+
scaleY: scaleY,
|
|
49
|
+
stroke: stroke,
|
|
50
|
+
strokeWidth: strokeWidth,
|
|
51
|
+
shadowOffsetX: shadowOffsetX,
|
|
52
|
+
shadowOffsetY: shadowOffsetY,
|
|
53
|
+
shadowBlur: shadowBlur,
|
|
54
|
+
shadowColor: shadowColor,
|
|
55
|
+
shadowOpacity: shadowOpacity,
|
|
56
|
+
fill: fill,
|
|
57
|
+
x: x,
|
|
58
|
+
y: y,
|
|
59
|
+
width: width,
|
|
60
|
+
height: height,
|
|
61
|
+
opacity: opacity,
|
|
62
|
+
cornerRadius: cornerRadius
|
|
63
|
+
}, annotationEvents, otherProps));
|
|
64
|
+
};
|
|
65
|
+
export default RectNode;
|
|
@@ -1 +1,80 @@
|
|
|
1
|
-
import _extends from"@babel/runtime/helpers/extends";
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["id", "name", "text", "fontFamily", "fontSize", "fontStyle", "fill", "x", "y", "width", "height", "scaleX", "scaleY", "rotation", "annotationEvents", "stroke", "strokeWidth", "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", "shadowOpacity", "opacity", "letterSpacing", "lineHeight", "align"];
|
|
4
|
+
import { Text } from 'react-konva';
|
|
5
|
+
import { nodesCommonDefaults } from "../nodes-common-prop-types";
|
|
6
|
+
var TextNode = function TextNode(_ref) {
|
|
7
|
+
var id = _ref.id,
|
|
8
|
+
name = _ref.name,
|
|
9
|
+
_ref$text = _ref.text,
|
|
10
|
+
text = _ref$text === void 0 ? 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur imperdiet tortor quis odio facilisis, id aliquet nulla facilisis. Etiam tincidunt tempor odio nec placerat.' : _ref$text,
|
|
11
|
+
_ref$fontFamily = _ref.fontFamily,
|
|
12
|
+
fontFamily = _ref$fontFamily === void 0 ? 'Arial' : _ref$fontFamily,
|
|
13
|
+
_ref$fontSize = _ref.fontSize,
|
|
14
|
+
fontSize = _ref$fontSize === void 0 ? 14 : _ref$fontSize,
|
|
15
|
+
fontStyle = _ref.fontStyle,
|
|
16
|
+
_ref$fill = _ref.fill,
|
|
17
|
+
fill = _ref$fill === void 0 ? '#000' : _ref$fill,
|
|
18
|
+
x = _ref.x,
|
|
19
|
+
y = _ref.y,
|
|
20
|
+
_ref$width = _ref.width,
|
|
21
|
+
width = _ref$width === void 0 ? 0 : _ref$width,
|
|
22
|
+
_ref$height = _ref.height,
|
|
23
|
+
height = _ref$height === void 0 ? 0 : _ref$height,
|
|
24
|
+
_ref$scaleX = _ref.scaleX,
|
|
25
|
+
scaleX = _ref$scaleX === void 0 ? nodesCommonDefaults.scaleX : _ref$scaleX,
|
|
26
|
+
_ref$scaleY = _ref.scaleY,
|
|
27
|
+
scaleY = _ref$scaleY === void 0 ? nodesCommonDefaults.scaleY : _ref$scaleY,
|
|
28
|
+
_ref$rotation = _ref.rotation,
|
|
29
|
+
rotation = _ref$rotation === void 0 ? nodesCommonDefaults.rotation : _ref$rotation,
|
|
30
|
+
annotationEvents = _ref.annotationEvents,
|
|
31
|
+
_ref$stroke = _ref.stroke,
|
|
32
|
+
stroke = _ref$stroke === void 0 ? nodesCommonDefaults.stroke : _ref$stroke,
|
|
33
|
+
_ref$strokeWidth = _ref.strokeWidth,
|
|
34
|
+
strokeWidth = _ref$strokeWidth === void 0 ? nodesCommonDefaults.strokeWidth : _ref$strokeWidth,
|
|
35
|
+
_ref$shadowOffsetX = _ref.shadowOffsetX,
|
|
36
|
+
shadowOffsetX = _ref$shadowOffsetX === void 0 ? nodesCommonDefaults.shadowOffsetX : _ref$shadowOffsetX,
|
|
37
|
+
_ref$shadowOffsetY = _ref.shadowOffsetY,
|
|
38
|
+
shadowOffsetY = _ref$shadowOffsetY === void 0 ? nodesCommonDefaults.shadowOffsetY : _ref$shadowOffsetY,
|
|
39
|
+
_ref$shadowBlur = _ref.shadowBlur,
|
|
40
|
+
shadowBlur = _ref$shadowBlur === void 0 ? nodesCommonDefaults.shadowBlur : _ref$shadowBlur,
|
|
41
|
+
_ref$shadowColor = _ref.shadowColor,
|
|
42
|
+
shadowColor = _ref$shadowColor === void 0 ? nodesCommonDefaults.shadowColor : _ref$shadowColor,
|
|
43
|
+
_ref$shadowOpacity = _ref.shadowOpacity,
|
|
44
|
+
shadowOpacity = _ref$shadowOpacity === void 0 ? nodesCommonDefaults.shadowOpacity : _ref$shadowOpacity,
|
|
45
|
+
_ref$opacity = _ref.opacity,
|
|
46
|
+
opacity = _ref$opacity === void 0 ? nodesCommonDefaults.opacity : _ref$opacity,
|
|
47
|
+
letterSpacing = _ref.letterSpacing,
|
|
48
|
+
lineHeight = _ref.lineHeight,
|
|
49
|
+
_ref$align = _ref.align,
|
|
50
|
+
align = _ref$align === void 0 ? 'left' : _ref$align,
|
|
51
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
52
|
+
return React.createElement(Text, _extends({
|
|
53
|
+
id: id,
|
|
54
|
+
name: name,
|
|
55
|
+
rotation: rotation,
|
|
56
|
+
scaleX: scaleX,
|
|
57
|
+
scaleY: scaleY,
|
|
58
|
+
stroke: stroke,
|
|
59
|
+
strokeWidth: strokeWidth,
|
|
60
|
+
shadowOffsetX: shadowOffsetX,
|
|
61
|
+
shadowOffsetY: shadowOffsetY,
|
|
62
|
+
shadowBlur: shadowBlur,
|
|
63
|
+
shadowColor: shadowColor,
|
|
64
|
+
shadowOpacity: shadowOpacity,
|
|
65
|
+
opacity: opacity,
|
|
66
|
+
fill: fill,
|
|
67
|
+
text: text,
|
|
68
|
+
fontFamily: fontFamily,
|
|
69
|
+
fontStyle: fontStyle,
|
|
70
|
+
fontSize: fontSize,
|
|
71
|
+
letterSpacing: letterSpacing,
|
|
72
|
+
lineHeight: lineHeight,
|
|
73
|
+
align: align,
|
|
74
|
+
x: x,
|
|
75
|
+
y: y,
|
|
76
|
+
width: width,
|
|
77
|
+
height: height
|
|
78
|
+
}, annotationEvents, otherProps));
|
|
79
|
+
};
|
|
80
|
+
export default TextNode;
|