hart-estate-widget 0.0.59 → 0.0.62
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/build/components/RotationTab.js +14 -14
- package/build/locale/index.js +2 -2
- package/package.json +1 -1
@@ -58,15 +58,15 @@ var RotationTab = function RotationTab(_ref) {
|
|
58
58
|
text: _locale.default.getLocaleText('rotate-plan')
|
59
59
|
}];
|
60
60
|
|
61
|
-
var _useState = (0, _react.useState)(
|
61
|
+
var _useState = (0, _react.useState)(false),
|
62
62
|
_useState2 = _slicedToArray(_useState, 2),
|
63
63
|
showInstructions = _useState2[0],
|
64
64
|
setInstructionsState = _useState2[1];
|
65
65
|
|
66
66
|
var _useState3 = (0, _react.useState)(false),
|
67
67
|
_useState4 = _slicedToArray(_useState3, 2),
|
68
|
-
|
69
|
-
|
68
|
+
initialized = _useState4[0],
|
69
|
+
setInitState = _useState4[1];
|
70
70
|
|
71
71
|
var _useState5 = (0, _react.useState)(0),
|
72
72
|
_useState6 = _slicedToArray(_useState5, 2),
|
@@ -80,19 +80,21 @@ var RotationTab = function RotationTab(_ref) {
|
|
80
80
|
|
81
81
|
var updateRotation = function updateRotation() {
|
82
82
|
setActiveIndex(this.index);
|
83
|
-
setAutoplayState(this.looping);
|
84
83
|
};
|
85
84
|
|
86
85
|
var onStart = function onStart() {
|
87
86
|
setInstructionsState(false);
|
87
|
+
setInitState(true);
|
88
88
|
var container = document.querySelector('.widget-tab__threesixty-container');
|
89
89
|
var widgetTab = document.querySelector('.widget-tab');
|
90
90
|
var newRotation = new _threesixty.default(container, {
|
91
91
|
image: _toConsumableArray(images),
|
92
92
|
parentElement: widgetTab,
|
93
|
-
inverted: true
|
93
|
+
inverted: true,
|
94
|
+
speed: 150
|
94
95
|
});
|
95
96
|
newRotation._update = updateRotation;
|
97
|
+
newRotation.play();
|
96
98
|
var lastIndex = 0;
|
97
99
|
var controller = (0, _panzoom.default)(container, {
|
98
100
|
maxZoom: 3,
|
@@ -101,13 +103,12 @@ var RotationTab = function RotationTab(_ref) {
|
|
101
103
|
return !event.shiftKey;
|
102
104
|
}
|
103
105
|
});
|
106
|
+
newRotation.controller = controller;
|
104
107
|
controller.on('panstart', function () {
|
105
108
|
lastIndex = newRotation.index;
|
106
109
|
newRotation.stop();
|
107
110
|
|
108
111
|
newRotation._update = function () {};
|
109
|
-
|
110
|
-
setAutoplayState(newRotation.looping);
|
111
112
|
});
|
112
113
|
controller.on('panend', function () {
|
113
114
|
newRotation.goto(lastIndex);
|
@@ -116,13 +117,12 @@ var RotationTab = function RotationTab(_ref) {
|
|
116
117
|
setRotation(newRotation);
|
117
118
|
};
|
118
119
|
|
119
|
-
var
|
120
|
-
|
121
|
-
setAutoplayState(rotation.looping);
|
120
|
+
var openInstructions = function openInstructions() {
|
121
|
+
return setInstructionsState(true);
|
122
122
|
};
|
123
123
|
|
124
124
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
125
|
-
className: "widget-tab__threesixty ".concat(
|
125
|
+
className: "widget-tab__threesixty ".concat(initialized ? 'widget-tab__threesixty--active' : '')
|
126
126
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
127
127
|
className: "widget-tab__threesixty-container",
|
128
128
|
onContextMenu: _helpers.preventRightClick
|
@@ -133,15 +133,15 @@ var RotationTab = function RotationTab(_ref) {
|
|
133
133
|
alt: "rotation-view-".concat(index),
|
134
134
|
className: activeIndex === index ? 'active' : ''
|
135
135
|
});
|
136
|
-
}))), !showInstructions && /*#__PURE__*/_react.default.createElement("button", {
|
136
|
+
}))), !initialized && !showInstructions && /*#__PURE__*/_react.default.createElement("button", {
|
137
137
|
className: "widget-tab__threesixty-start",
|
138
|
-
onClick:
|
138
|
+
onClick: openInstructions
|
139
139
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
140
140
|
className: "widget-tab__threesixty-start-icon"
|
141
141
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
142
142
|
src: _rotation.default,
|
143
143
|
alt: "start-icon"
|
144
|
-
})), /*#__PURE__*/_react.default.createElement("span", null, _locale.default.getLocaleText(
|
144
|
+
})), /*#__PURE__*/_react.default.createElement("span", null, _locale.default.getLocaleText('rotate'))), showInstructions && /*#__PURE__*/_react.default.createElement(_Instructions.default, {
|
145
145
|
disabled: disabled,
|
146
146
|
steps: instructionSteps,
|
147
147
|
onClick: onStart
|
package/build/locale/index.js
CHANGED
@@ -9,9 +9,9 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
var _mobx = require("mobx");
|
11
11
|
|
12
|
-
var _data = _interopRequireDefault(require("./
|
12
|
+
var _data = _interopRequireDefault(require("./ru/data.json"));
|
13
13
|
|
14
|
-
var _data2 = _interopRequireDefault(require("./
|
14
|
+
var _data2 = _interopRequireDefault(require("./en/data.json"));
|
15
15
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
17
|
|