@sima-land/moleculas 16.0.0-alpha.4 → 16.0.0-alpha.5

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.
@@ -148,21 +148,21 @@ exports.videos = [
148
148
  {
149
149
  type: 'video',
150
150
  data: {
151
- src: 'https://cdn2.static1-sima-land.com/flv/3404953.mp4',
151
+ src: 'https://cdn2.static1-sima-land.com/flv/6907296.mp4',
152
152
  thumbnail: 'https://loremflickr.com/240/240?random=7',
153
153
  },
154
154
  },
155
155
  {
156
156
  type: 'video',
157
157
  data: {
158
- src: 'https://cdn2.static1-sima-land.com/flv/3404953.mp4',
158
+ src: 'https://cdn2.static1-sima-land.com/flv/3619217.mp4',
159
159
  thumbnail: 'https://loremflickr.com/240/240?random=8',
160
160
  },
161
161
  },
162
162
  {
163
163
  type: 'video',
164
164
  data: {
165
- src: 'https://cdn2.static1-sima-land.com/flv/3404953.mp4',
165
+ src: 'https://cdn2.static1-sima-land.com/flv/4093038.mp4',
166
166
  thumbnail: 'https://loremflickr.com/240/240?random=9',
167
167
  },
168
168
  },
@@ -176,21 +176,21 @@ exports.videos = [
176
176
  {
177
177
  type: 'video',
178
178
  data: {
179
- src: 'https://cdn2.static1-sima-land.com/flv/3404953.mp4',
179
+ src: 'https://cdn2.static1-sima-land.com/flv/6907296.mp4',
180
180
  thumbnail: 'https://loremflickr.com/240/240?random=11',
181
181
  },
182
182
  },
183
183
  {
184
184
  type: 'video',
185
185
  data: {
186
- src: 'https://cdn2.static1-sima-land.com/flv/3404953.mp4',
186
+ src: 'https://cdn2.static1-sima-land.com/flv/3619217.mp4',
187
187
  thumbnail: 'https://loremflickr.com/240/240?random=12',
188
188
  },
189
189
  },
190
190
  {
191
191
  type: 'video',
192
192
  data: {
193
- src: 'https://cdn2.static1-sima-land.com/flv/3404953.mp4',
193
+ src: 'https://cdn2.static1-sima-land.com/flv/4093038.mp4',
194
194
  thumbnail: 'https://loremflickr.com/240/240?random=13',
195
195
  },
196
196
  },
@@ -204,21 +204,21 @@ exports.videos = [
204
204
  {
205
205
  type: 'video',
206
206
  data: {
207
- src: 'https://cdn2.static1-sima-land.com/flv/3404953.mp4',
207
+ src: 'https://cdn2.static1-sima-land.com/flv/6907296.mp4',
208
208
  thumbnail: 'https://loremflickr.com/240/240?random=15',
209
209
  },
210
210
  },
211
211
  {
212
212
  type: 'video',
213
213
  data: {
214
- src: 'https://cdn2.static1-sima-land.com/flv/3404953.mp4',
214
+ src: 'https://cdn2.static1-sima-land.com/flv/3619217.mp4',
215
215
  thumbnail: 'https://loremflickr.com/240/240?random=16',
216
216
  },
217
217
  },
218
218
  {
219
219
  type: 'video',
220
220
  data: {
221
- src: 'https://cdn2.static1-sima-land.com/flv/3404953.mp4',
221
+ src: 'https://cdn2.static1-sima-land.com/flv/4093038.mp4',
222
222
  thumbnail: 'https://loremflickr.com/240/240?random=17',
223
223
  },
224
224
  },
@@ -1,10 +1,33 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
5
28
  Object.defineProperty(exports, "__esModule", { value: true });
6
29
  exports.MediaView = void 0;
7
- const react_1 = __importDefault(require("react"));
30
+ const react_1 = __importStar(require("react"));
8
31
  const image_overlay_1 = require("../../../../desktop/components/gallery-modal/components/image-overlay");
9
32
  const breakpoint_1 = require("@sima-land/ui-nucleons/hooks/breakpoint");
10
33
  const media_view_module_scss_1 = __importDefault(require("./media-view.module.scss"));
@@ -17,13 +40,22 @@ const all_round_view_1 = require("./all-round-view");
17
40
  */
18
41
  function MediaView({ media, loading, videoProps }) {
19
42
  const desktop = (0, breakpoint_1.useBreakpoint)('xs+');
43
+ const videoRef = (0, react_1.useRef)(null);
44
+ const videoSrc = (media === null || media === void 0 ? void 0 : media.type) === 'video' ? media.data.src : null;
45
+ (0, react_1.useEffect)(() => {
46
+ var _a;
47
+ // ВАЖНО: при смене src у элемента source видео не меняется автоматически - перезапускаем явно
48
+ if (videoSrc) {
49
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.load();
50
+ }
51
+ }, [loading, videoSrc]);
20
52
  if (loading) {
21
53
  return react_1.default.createElement("div", { className: (0, classnames_1.default)(media_view_module_scss_1.default.root, media_view_module_scss_1.default.loading) });
22
54
  }
23
55
  return (react_1.default.createElement("div", { className: (0, classnames_1.default)(media_view_module_scss_1.default.root) },
24
56
  (media === null || media === void 0 ? void 0 : media.type) === 'image' && (react_1.default.createElement(image_overlay_1.ImageOverlay, { className: media_view_module_scss_1.default.image },
25
57
  react_1.default.createElement("img", { src: media.data.src, alt: media.data.alt || '' }))),
26
- (media === null || media === void 0 ? void 0 : media.type) === 'video' && (react_1.default.createElement("video", Object.assign({ autoPlay: false, controls: true, controlsList: 'nodownload' }, videoProps),
58
+ (media === null || media === void 0 ? void 0 : media.type) === 'video' && (react_1.default.createElement("video", Object.assign({ autoPlay: false, controls: true, controlsList: 'nodownload' }, videoProps, { ref: videoRef }),
27
59
  react_1.default.createElement("source", { src: media.data.src }))),
28
60
  (media === null || media === void 0 ? void 0 : media.type) === '360' && react_1.default.createElement(all_round_view_1.AllRoundView, { photos: media.data.photos, controls: desktop })));
29
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sima-land/moleculas",
3
- "version": "16.0.0-alpha.4",
3
+ "version": "16.0.0-alpha.5",
4
4
  "repository": "ssh://git@github.com:sima-land/moleculas.git",
5
5
  "author": "www.sima-land.ru team",
6
6
  "license": "Apache-2.0",