@realsee/vreo 0.2.0-alpha.9 → 1.0.0-alpha.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/CHANGELOG.md +30 -0
- package/README.md +16 -5
- package/docs/assets/highlight.css +1 -1
- package/docs/assets/main.js +2 -2
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +28 -2
- package/docs/classes/Player.AudioLike.html +52 -0
- package/docs/classes/Player.Controller.html +13 -13
- package/docs/classes/Player.Player-1.html +11 -11
- package/docs/classes/Player.VideoAgentMesh.html +53 -53
- package/docs/classes/Player.VideoAgentScene.html +1 -1
- package/docs/demo/assets/AppReact.ea8cbdb3.js +1 -0
- package/docs/demo/assets/default.1dd2b2d4.js +3988 -0
- package/docs/demo/assets/default.bc4c715d.css +1 -0
- package/docs/demo/assets/dynamic.cd7d1da6.js +1 -0
- package/docs/demo/assets/examples.98aaf9e2.js +25 -0
- package/docs/demo/assets/examples.dac4a6fe.css +1 -0
- package/docs/demo/assets/index.9331038f.css +1 -0
- package/docs/demo/assets/index.a3d7bd8a.js +1 -0
- package/docs/demo/assets/main.f0c47cae.js +1 -0
- package/docs/demo/assets/react.2ee8565f.css +1 -0
- package/docs/demo/assets/react.5f3bcfc5.js +25 -0
- package/docs/demo/assets/znRoyv06SZQeqA7m.0057e8ae.js +1 -0
- package/docs/demo/examples.html +17 -0
- package/docs/demo/index-react-dynamic.html +20 -0
- package/docs/demo/index-react.html +20 -0
- package/docs/demo/index.html +19 -0
- package/docs/enums/Player.InfoPanelStyleEnum.html +1 -1
- package/docs/enums/Player.InfoPanelTypeEnum.html +2 -2
- package/docs/enums/Player.PanoEffectEnum.html +2 -2
- package/docs/enums/Player.PanoTagEnum.html +2 -2
- package/docs/enums/Player.PanoTagStyleEnum.html +7 -0
- package/docs/enums/Player.VreoKeyframeEnum.html +12 -12
- package/docs/enums/fivePlugins.CameraMovementEffect.html +1 -1
- package/docs/enums/fivePlugins.Rotation.html +1 -1
- package/docs/index.html +13 -6
- package/docs/interfaces/Player.CustomVreoKeyframeProps.html +1 -1
- package/docs/interfaces/Player.PlayerConfigs.html +4 -3
- package/docs/interfaces/Player.Vertex.html +2 -2
- package/docs/interfaces/Player.VideoAgentMeshOptions.html +8 -1
- package/docs/interfaces/Player.VreoKeyframe.html +2 -2
- package/docs/interfaces/Player.VreoUnit.html +2 -2
- package/docs/interfaces/Player.VreoVideo.html +2 -2
- package/docs/interfaces/fivePlugins.CSS3DRenderPluginExportType.html +4 -0
- package/docs/interfaces/fivePlugins.CameraMovementOptsCallback.html +1 -1
- package/docs/interfaces/fivePlugins.CameraMovementPluginExportType.html +2 -2
- package/docs/interfaces/fivePlugins.CameraMovementPluginParameterType.html +1 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/fivePlugins.Vector3Position.html +3 -0
- package/docs/interfaces/react.VreoActionCallbacks.html +15 -7
- package/docs/interfaces/react.VreoProviderProps.html +1 -1
- package/docs/modules/Player.html +21 -15
- package/docs/modules/custom.html +1 -1
- package/docs/modules/fivePlugins.html +5 -2
- package/docs/modules/react.html +1 -1
- package/docs/modules.html +1 -1
- package/lib/PlayController/createHTMLAudioElement.js +6 -11
- package/lib/PlayController/index.js +19 -85
- package/lib/Player/App.js +7 -29
- package/lib/Player/Controller.d.ts +29 -8
- package/lib/Player/Controller.js +185 -87
- package/lib/Player/custom/SpatialScenePanel/index.js +47 -72
- package/lib/Player/hooks.js +2 -12
- package/lib/Player/index.d.ts +5 -3
- package/lib/Player/index.js +108 -122
- package/lib/Player/modules/Drawer/index.js +1 -18
- package/lib/Player/modules/PopUp/index.js +1 -11
- package/lib/Player/modules/ResizeObserver/index.d.ts +2 -0
- package/lib/Player/modules/ResizeObserver/index.js +29 -0
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.d.ts +16 -2
- package/lib/Player/modules/VideoAgent/VideoAgentMesh.js +124 -145
- package/lib/Player/modules/VideoAgent/VideoAgentScene.d.ts +3 -6
- package/lib/Player/modules/VideoAgent/VideoAgentScene.js +25 -52
- package/lib/Player/modules/VideoAgent/index.js +46 -22
- package/lib/Player/modules/Wave/index.d.ts +5 -0
- package/lib/Player/modules/Wave/index.js +77 -0
- package/lib/Player/modules/keyframes/BgMusic/index.js +3 -16
- package/lib/Player/modules/keyframes/CameraMovement/index.js +4 -28
- package/lib/Player/modules/keyframes/InfoPanel/index.js +30 -35
- package/lib/Player/modules/keyframes/ModelVideo/index.js +40 -29
- package/lib/Player/modules/keyframes/PanoEffect/index.js +16 -44
- package/lib/Player/modules/keyframes/PanoEffect/lineAnime.js +1 -8
- package/lib/Player/modules/keyframes/PanoTag/index.d.ts +1 -2
- package/lib/Player/modules/keyframes/PanoTag/index.js +75 -132
- package/lib/Player/modules/keyframes/PanoTextLabel/index.d.ts +3 -0
- package/lib/Player/modules/keyframes/PanoTextLabel/index.js +93 -66
- package/lib/Player/modules/keyframes/Prompter/index.js +18 -53
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +22 -25
- package/lib/Player/modules/keyframes/VideoEffect/index.js +13 -48
- package/lib/Player/typings.d.ts +12 -1
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.d.ts +2 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/centerPoint.js +10 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.d.ts +7 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/createResizeObserver.js +31 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.d.ts +3 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/evenNumber.js +10 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/index.d.ts +56 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/index.js +234 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.d.ts +7 -0
- package/lib/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.js +15 -0
- package/lib/fivePlugins/CameraMovementPlugin/index.js +36 -82
- package/lib/fivePlugins/CameraMovementPlugin/typings.js +0 -4
- package/lib/fivePlugins/ModelTVVideoPlugin/index.js +12 -61
- package/lib/index.js +0 -1
- package/lib/react/index.d.ts +8 -4
- package/lib/react/index.js +10 -37
- package/lib/shared-utils/AduioLike.d.ts +37 -0
- package/lib/shared-utils/AduioLike.js +132 -0
- package/lib/shared-utils/Preloader.js +0 -7
- package/lib/shared-utils/addResizeListener.d.ts +4 -0
- package/lib/shared-utils/addResizeListener.js +46 -0
- package/lib/shared-utils/animationFrame/BetterTween.js +7 -39
- package/lib/shared-utils/animationFrame/index.js +2 -10
- package/lib/shared-utils/animationFrame/tween.js +3 -16
- package/lib/shared-utils/createTransMatrix.d.ts +1 -0
- package/lib/shared-utils/createTransMatrix.js +28 -0
- package/lib/shared-utils/getFileExpandedName.d.ts +1 -0
- package/lib/shared-utils/getFileExpandedName.js +12 -0
- package/lib/shared-utils/getMediaInfo.d.ts +9 -0
- package/lib/shared-utils/getMediaInfo.js +66 -0
- package/lib/shared-utils/setElementDataset.d.ts +1 -0
- package/lib/shared-utils/setElementDataset.js +22 -0
- package/lib/typings/VreoUnit.d.ts +37 -2
- package/lib/typings/VreoUnit.js +10 -13
- package/package.json +10 -10
- package/resources/PlayController/index.ts +0 -13
- package/resources/Player/App.tsx +5 -4
- package/resources/Player/Controller.ts +274 -146
- package/resources/Player/custom/SpatialScenePanel/index.tsx +5 -5
- package/resources/Player/hooks.ts +3 -5
- package/resources/Player/index.tsx +190 -140
- package/resources/Player/modules/ResizeObserver/index.tsx +23 -0
- package/resources/Player/modules/VideoAgent/VideoAgentMesh.ts +87 -31
- package/resources/Player/modules/VideoAgent/VideoAgentScene.ts +27 -24
- package/resources/Player/modules/VideoAgent/index.tsx +28 -12
- package/resources/Player/modules/Wave/index.tsx +64 -0
- package/resources/Player/modules/keyframes/InfoPanel/index.tsx +26 -11
- package/resources/Player/modules/keyframes/ModelVideo/index.tsx +36 -3
- package/resources/Player/modules/keyframes/PanoTag/index.tsx +52 -97
- package/resources/Player/modules/keyframes/PanoTextLabel/index.tsx +86 -34
- package/resources/Player/modules/keyframes/Prompter/index.tsx +6 -16
- package/resources/Player/modules/keyframes/UpdateVRPanorama/index.tsx +6 -2
- package/resources/Player/typings.ts +15 -1
- package/resources/fivePlugins/CSS3DRenderPlugin/centerPoint.ts +5 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/createResizeObserver.ts +17 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/evenNumber.ts +4 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/index.ts +254 -0
- package/resources/fivePlugins/CSS3DRenderPlugin/transformPositionToVector3.ts +5 -0
- package/resources/fivePlugins/CameraMovementPlugin/index.ts +19 -12
- package/resources/react/index.tsx +7 -3
- package/resources/shared-utils/AduioLike.ts +109 -0
- package/resources/shared-utils/addResizeListener.ts +46 -0
- package/resources/shared-utils/createTransMatrix.ts +12 -0
- package/resources/shared-utils/getFileExpandedName.ts +6 -0
- package/resources/shared-utils/getMediaInfo.ts +52 -0
- package/resources/shared-utils/setElementDataset.ts +18 -0
- package/resources/typings/VreoUnit.ts +41 -3
- package/stylesheets/custom/SpatialScenePanel.css +2 -1
- package/stylesheets/default.css +350 -84
|
@@ -1,28 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
4
|
-
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.ModelVideo = ModelVideo;
|
|
9
|
-
|
|
10
8
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
9
|
+
var THREE = _interopRequireWildcard(require("three"));
|
|
10
|
+
var _hooks = require("../../../hooks");
|
|
12
11
|
var _ModelTVVideoPlugin = require("../../../../fivePlugins/ModelTVVideoPlugin");
|
|
13
|
-
|
|
12
|
+
var _createTransMatrix = require("../../../../shared-utils/createTransMatrix");
|
|
14
13
|
var _VreoUnit = require("../../../../typings/VreoUnit");
|
|
15
|
-
|
|
16
|
-
var _hooks = require("../../../hooks");
|
|
17
|
-
|
|
18
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
|
|
20
15
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
16
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
22
17
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
23
|
-
|
|
24
18
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
25
|
-
|
|
26
19
|
function ModelVideo() {
|
|
27
20
|
var controller = (0, _hooks.useController)();
|
|
28
21
|
var five = (0, _hooks.useFiveInstance)();
|
|
@@ -30,54 +23,72 @@ function ModelVideo() {
|
|
|
30
23
|
var timeoutRef = React.useRef();
|
|
31
24
|
React.useEffect(function () {
|
|
32
25
|
var callback = /*#__PURE__*/function () {
|
|
33
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/
|
|
26
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(keyframe) {
|
|
34
27
|
var _controller$configs, _controller$configs$v;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
28
|
+
var start, end, _ref2, videoSrc, videoPosterSrc, vertexs, matrixWorld, position, points;
|
|
29
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
39
30
|
while (1) {
|
|
40
31
|
switch (_context.prev = _context.next) {
|
|
41
32
|
case 0:
|
|
42
33
|
if (!ref.current) {
|
|
43
34
|
ref.current = (0, _ModelTVVideoPlugin.ModelTVVideoPlugin)(five, {});
|
|
44
35
|
}
|
|
45
|
-
|
|
46
36
|
start = keyframe.start, end = keyframe.end;
|
|
47
|
-
_ref2 = keyframe.data, videoSrc = _ref2.videoSrc, videoPosterSrc = _ref2.videoPosterSrc, vertexs = _ref2.vertexs;
|
|
37
|
+
_ref2 = keyframe.data, videoSrc = _ref2.videoSrc, videoPosterSrc = _ref2.videoPosterSrc, vertexs = _ref2.vertexs, matrixWorld = _ref2.matrixWorld;
|
|
38
|
+
position = function () {
|
|
39
|
+
if (vertexs.length < 4) {
|
|
40
|
+
throw new Error('ModelVideo: 顶点数据集合不够,无法组成矩形 ....');
|
|
41
|
+
}
|
|
42
|
+
if (vertexs.length === 4) {
|
|
43
|
+
return vertexs;
|
|
44
|
+
}
|
|
45
|
+
var box = new THREE.Box3();
|
|
46
|
+
vertexs.forEach(function (v) {
|
|
47
|
+
return box.expandByPoint(new THREE.Vector3(v.x, v.y, v.z));
|
|
48
|
+
});
|
|
49
|
+
return [new THREE.Vector3(box.min.x, box.max.y, box.max.z), new THREE.Vector3(box.min.x, box.min.y, box.max.z), new THREE.Vector3(box.max.x, box.min.y, box.max.z), new THREE.Vector3(box.max.x, box.max.y, box.max.z)];
|
|
50
|
+
}();
|
|
51
|
+
points = function () {
|
|
52
|
+
if (matrixWorld) {
|
|
53
|
+
var transMatrix = (0, _createTransMatrix.createTransMatrix)(matrixWorld);
|
|
54
|
+
return [position.map(function (p) {
|
|
55
|
+
var res = transMatrix([p.x, p.y, p.z]);
|
|
56
|
+
return {
|
|
57
|
+
x: res[0],
|
|
58
|
+
y: res[1],
|
|
59
|
+
z: res[2]
|
|
60
|
+
};
|
|
61
|
+
})];
|
|
62
|
+
}
|
|
63
|
+
return [position];
|
|
64
|
+
}();
|
|
48
65
|
ref.current.disable();
|
|
49
|
-
_context.next =
|
|
66
|
+
_context.next = 8;
|
|
50
67
|
return ref.current.load({
|
|
51
68
|
video_src: videoSrc,
|
|
52
69
|
video_poster_src: videoPosterSrc,
|
|
53
|
-
points:
|
|
70
|
+
points: points
|
|
54
71
|
}, (_controller$configs = controller.configs) === null || _controller$configs === void 0 ? void 0 : (_controller$configs$v = _controller$configs.videos) === null || _controller$configs$v === void 0 ? void 0 : _controller$configs$v.modelTVVideo);
|
|
55
|
-
|
|
56
|
-
case 6:
|
|
72
|
+
case 8:
|
|
57
73
|
ref.current.enable();
|
|
58
74
|
timeoutRef.current = setTimeout(function () {
|
|
59
75
|
var _ref$current;
|
|
60
|
-
|
|
61
76
|
return (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.disable();
|
|
62
77
|
}, end - start);
|
|
63
|
-
|
|
64
|
-
case 8:
|
|
78
|
+
case 10:
|
|
65
79
|
case "end":
|
|
66
80
|
return _context.stop();
|
|
67
81
|
}
|
|
68
82
|
}
|
|
69
83
|
}, _callee);
|
|
70
84
|
}));
|
|
71
|
-
|
|
72
85
|
return function callback(_x) {
|
|
73
86
|
return _ref.apply(this, arguments);
|
|
74
87
|
};
|
|
75
88
|
}();
|
|
76
|
-
|
|
77
89
|
controller.on(_VreoUnit.VreoKeyframeEnum.ModelVideo, callback);
|
|
78
90
|
return function () {
|
|
79
91
|
controller.off(_VreoUnit.VreoKeyframeEnum.ModelVideo, callback);
|
|
80
|
-
|
|
81
92
|
if (timeoutRef.current) {
|
|
82
93
|
clearTimeout(timeoutRef.current);
|
|
83
94
|
}
|
|
@@ -1,77 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
4
|
-
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.PanoEffect = PanoEffect;
|
|
9
|
-
|
|
10
8
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _three = require("three");
|
|
13
|
-
|
|
14
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
-
|
|
16
11
|
var _lineAnime = _interopRequireDefault(require("./lineAnime"));
|
|
17
|
-
|
|
18
12
|
var _hooks = require("../../../hooks");
|
|
19
|
-
|
|
20
13
|
var _VreoUnit = require("../../../../typings/VreoUnit");
|
|
21
|
-
|
|
22
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
-
|
|
24
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
-
|
|
26
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
-
|
|
28
17
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
29
|
-
|
|
30
18
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
31
|
-
|
|
32
19
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
33
|
-
|
|
34
20
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
35
|
-
|
|
36
21
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
37
|
-
|
|
38
22
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
39
|
-
|
|
40
23
|
function PanoEffect() {
|
|
41
24
|
var _React$useState = React.useState(null),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
25
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
26
|
+
state = _React$useState2[0],
|
|
27
|
+
setState = _React$useState2[1];
|
|
46
28
|
var five = (0, _hooks.useFiveInstance)();
|
|
47
29
|
var lineRef = React.useRef(null);
|
|
48
|
-
|
|
49
30
|
var _React$useState3 = React.useState(null),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
31
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
32
|
+
pos = _React$useState4[0],
|
|
33
|
+
setPos = _React$useState4[1];
|
|
54
34
|
var timeoutRef = React.useRef();
|
|
55
35
|
var controller = (0, _hooks.useController)();
|
|
56
36
|
var project2d = (0, _hooks.useFiveProject2d)();
|
|
57
|
-
|
|
58
37
|
var delLine = function delLine() {
|
|
59
38
|
if (lineRef.current) {
|
|
60
39
|
lineRef.current.dispose();
|
|
61
40
|
}
|
|
62
41
|
};
|
|
63
|
-
|
|
64
42
|
React.useEffect(function () {
|
|
65
43
|
var callback = function callback(keyframe) {
|
|
66
44
|
var start = keyframe.start,
|
|
67
|
-
|
|
68
|
-
|
|
45
|
+
end = keyframe.end,
|
|
46
|
+
data = keyframe.data;
|
|
69
47
|
var videoEffectData = data;
|
|
70
|
-
|
|
71
48
|
var _videoEffectData$twoV = _slicedToArray(videoEffectData.twoVertexs, 2),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
49
|
+
v1 = _videoEffectData$twoV[0],
|
|
50
|
+
v2 = _videoEffectData$twoV[1];
|
|
75
51
|
var p1 = new _three.Vector3(v1.x, v1.y, v1.z);
|
|
76
52
|
var p2 = new _three.Vector3(v2.x, v2.y, v2.z);
|
|
77
53
|
lineRef.current = (0, _lineAnime["default"])(five, p1.clone(), p2.clone());
|
|
@@ -81,7 +57,7 @@ function PanoEffect() {
|
|
|
81
57
|
var p = project2d(center);
|
|
82
58
|
if (!p) return;
|
|
83
59
|
var left = p.x,
|
|
84
|
-
|
|
60
|
+
top = p.y;
|
|
85
61
|
setState({
|
|
86
62
|
center: center,
|
|
87
63
|
distance: distance
|
|
@@ -96,15 +72,12 @@ function PanoEffect() {
|
|
|
96
72
|
delLine();
|
|
97
73
|
}, end - start);
|
|
98
74
|
};
|
|
99
|
-
|
|
100
75
|
controller.on(_VreoUnit.VreoKeyframeEnum.PanoEffect, callback);
|
|
101
76
|
return function () {
|
|
102
77
|
controller.off(_VreoUnit.VreoKeyframeEnum.PanoEffect, callback);
|
|
103
|
-
|
|
104
78
|
if (timeoutRef.current) {
|
|
105
79
|
clearTimeout(timeoutRef.current);
|
|
106
80
|
}
|
|
107
|
-
|
|
108
81
|
delLine();
|
|
109
82
|
};
|
|
110
83
|
}, [controller]);
|
|
@@ -112,19 +85,18 @@ function PanoEffect() {
|
|
|
112
85
|
var callback = function callback() {
|
|
113
86
|
if (!(state !== null && state !== void 0 && state.center)) return;
|
|
114
87
|
var _state$center = state.center,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
88
|
+
x = _state$center.x,
|
|
89
|
+
y = _state$center.y,
|
|
90
|
+
z = _state$center.z;
|
|
118
91
|
var res = project2d(new _three.Vector3(x, y, z));
|
|
119
92
|
if (!res) return;
|
|
120
93
|
var left = res.x,
|
|
121
|
-
|
|
94
|
+
top = res.y;
|
|
122
95
|
setPos({
|
|
123
96
|
left: left,
|
|
124
97
|
top: top
|
|
125
98
|
});
|
|
126
99
|
};
|
|
127
|
-
|
|
128
100
|
five.on('currentStateChange', callback);
|
|
129
101
|
return function () {
|
|
130
102
|
five.off('currentStateChange', callback);
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
4
|
-
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = lineAnime;
|
|
9
|
-
|
|
10
8
|
var THREE = _interopRequireWildcard(require("three"));
|
|
11
|
-
|
|
12
9
|
var _line = require("@realsee/five/line");
|
|
13
|
-
|
|
14
10
|
var _BetterTween = require("../../../../shared-utils/animationFrame/BetterTween");
|
|
15
|
-
|
|
16
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
-
|
|
18
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
-
|
|
20
13
|
function lineAnime(five, startPoint, endPoint) {
|
|
21
14
|
var pointImage = 'data:image/png;base64,' + 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==';
|
|
22
15
|
var pointTexture = new THREE.TextureLoader().load(pointImage);
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function PanoTag(): JSX.Element;
|
|
1
|
+
export declare function PanoTag(): null;
|
|
@@ -1,168 +1,111 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
4
|
-
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.PanoTag = PanoTag;
|
|
9
|
-
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
|
|
12
8
|
var React = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
|
-
var _three = require("three");
|
|
15
|
-
|
|
16
9
|
var _hooks = require("../../../hooks");
|
|
17
|
-
|
|
18
10
|
var _VreoUnit = require("../../../../typings/VreoUnit");
|
|
19
|
-
|
|
11
|
+
var _dnalogel = require("@realsee/dnalogel");
|
|
20
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
|
|
22
13
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
-
|
|
26
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
-
|
|
28
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
-
|
|
30
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
31
|
-
|
|
32
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
33
|
-
|
|
34
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
35
|
-
|
|
36
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
-
|
|
38
14
|
function PanoTag() {
|
|
39
|
-
var _React$useState = React.useState(null),
|
|
40
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
41
|
-
state = _React$useState2[0],
|
|
42
|
-
setState = _React$useState2[1];
|
|
43
|
-
|
|
44
|
-
var _React$useState3 = React.useState(null),
|
|
45
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
46
|
-
pos = _React$useState4[0],
|
|
47
|
-
setPos = _React$useState4[1];
|
|
48
|
-
|
|
49
15
|
var timeoutRef = React.useRef();
|
|
50
16
|
var controller = (0, _hooks.useController)();
|
|
51
17
|
var five = (0, _hooks.useFiveInstance)();
|
|
52
|
-
var
|
|
18
|
+
var panoTagPlugin = React.useRef((0, _dnalogel.PanoTagPlugin)(five, {
|
|
19
|
+
config: {
|
|
20
|
+
globalConfig: {
|
|
21
|
+
visibleConfig: {
|
|
22
|
+
keep: 'visible'
|
|
23
|
+
},
|
|
24
|
+
unfoldedConfig: {
|
|
25
|
+
autoUnfold: {
|
|
26
|
+
strategy: 'MinimumDistance'
|
|
27
|
+
},
|
|
28
|
+
unfoldDistance: {
|
|
29
|
+
max: 100
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}));
|
|
53
35
|
React.useEffect(function () {
|
|
54
36
|
var _controller$configs;
|
|
55
|
-
|
|
56
37
|
if (((_controller$configs = controller.configs) === null || _controller$configs === void 0 ? void 0 : _controller$configs.keyframeMap.PanoTag) === false) {
|
|
57
38
|
return;
|
|
58
39
|
}
|
|
59
|
-
|
|
60
40
|
var callback = function callback(keyframe) {
|
|
41
|
+
if (!panoTagPlugin.current) return;
|
|
61
42
|
var start = keyframe.start,
|
|
62
|
-
|
|
63
|
-
|
|
43
|
+
end = keyframe.end,
|
|
44
|
+
data = keyframe.data;
|
|
64
45
|
var panoTagData = data;
|
|
65
|
-
var
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
46
|
+
var id = Date.now().toString();
|
|
47
|
+
var pointType = _dnalogel.PointType.PointTag;
|
|
48
|
+
var dimensionType = _dnalogel.DimensionType.Two;
|
|
49
|
+
var position = [panoTagData.vertex.x, panoTagData.vertex.y, panoTagData.vertex.z];
|
|
50
|
+
var tag = function () {
|
|
51
|
+
if (panoTagData.imgUrl) {
|
|
52
|
+
return {
|
|
53
|
+
id: id,
|
|
54
|
+
pointType: pointType,
|
|
55
|
+
position: position,
|
|
56
|
+
dimensionType: dimensionType,
|
|
57
|
+
contentType: _dnalogel.ContentType.ImageText,
|
|
58
|
+
data: {
|
|
59
|
+
text: panoTagData.text,
|
|
60
|
+
mediaData: [{
|
|
61
|
+
type: 'Image',
|
|
62
|
+
url: panoTagData.imgUrl
|
|
63
|
+
}]
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
} else {
|
|
67
|
+
return {
|
|
68
|
+
id: id,
|
|
69
|
+
pointType: pointType,
|
|
70
|
+
position: position,
|
|
71
|
+
dimensionType: dimensionType,
|
|
72
|
+
contentType: _dnalogel.ContentType.Text,
|
|
73
|
+
data: {
|
|
74
|
+
text: panoTagData.text
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}();
|
|
79
|
+
|
|
80
|
+
// show
|
|
81
|
+
panoTagPlugin.current.load({
|
|
82
|
+
tagList: [tag]
|
|
83
83
|
});
|
|
84
84
|
timeoutRef.current = setTimeout(function () {
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
var _tag$hooks;
|
|
86
|
+
// clear
|
|
87
|
+
var tag = panoTagPlugin.current.getTagById(id);
|
|
88
|
+
if (tag.state) {
|
|
89
|
+
tag.state.unfolded = false;
|
|
90
|
+
panoTagPlugin.current.updateRenderAllTags();
|
|
91
|
+
}
|
|
92
|
+
(_tag$hooks = tag.hooks) === null || _tag$hooks === void 0 ? void 0 : _tag$hooks.on('folded', function () {
|
|
93
|
+
setTimeout(function () {
|
|
94
|
+
if (tag.state) {
|
|
95
|
+
tag.state.visible = false;
|
|
96
|
+
panoTagPlugin.current.destroyTagById(id);
|
|
97
|
+
}
|
|
98
|
+
}, 1500);
|
|
99
|
+
});
|
|
87
100
|
}, end - start);
|
|
88
101
|
};
|
|
89
|
-
|
|
90
102
|
controller.on(_VreoUnit.VreoKeyframeEnum.PanoTag, callback);
|
|
91
103
|
return function () {
|
|
92
104
|
controller.off(_VreoUnit.VreoKeyframeEnum.PanoTag, callback);
|
|
93
|
-
|
|
94
105
|
if (timeoutRef.current) {
|
|
95
106
|
clearTimeout(timeoutRef.current);
|
|
96
107
|
}
|
|
97
108
|
};
|
|
98
109
|
}, [controller]);
|
|
99
|
-
|
|
100
|
-
var callback = function callback() {
|
|
101
|
-
if (!(state !== null && state !== void 0 && state.vertex)) return;
|
|
102
|
-
var _state$vertex = state.vertex,
|
|
103
|
-
x = _state$vertex.x,
|
|
104
|
-
y = _state$vertex.y,
|
|
105
|
-
z = _state$vertex.z;
|
|
106
|
-
var res = project2d(new _three.Vector3(x, y, z));
|
|
107
|
-
if (!res) return;
|
|
108
|
-
var left = res.x,
|
|
109
|
-
top = res.y;
|
|
110
|
-
setPos({
|
|
111
|
-
left: left,
|
|
112
|
-
top: top
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
five.on('currentStateChange', callback);
|
|
117
|
-
return function () {
|
|
118
|
-
five.off('currentStateChange', callback);
|
|
119
|
-
};
|
|
120
|
-
}, [state === null || state === void 0 ? void 0 : state.vertex]);
|
|
121
|
-
|
|
122
|
-
var boxContent = function () {
|
|
123
|
-
if (!state) return undefined;
|
|
124
|
-
|
|
125
|
-
if (state.type === _VreoUnit.PanoTagEnum.Text) {
|
|
126
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, state.text));
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (state.type === _VreoUnit.PanoTagEnum.Image) {
|
|
130
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("img", {
|
|
131
|
-
className: "PanoTag-img",
|
|
132
|
-
src: state.imgUrl,
|
|
133
|
-
alt: state.text || ''
|
|
134
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
135
|
-
className: "PanoTag-txt"
|
|
136
|
-
}, state.text));
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
return undefined;
|
|
140
|
-
}();
|
|
141
|
-
|
|
142
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
143
|
-
className: (0, _classnames["default"])('PanoTag', {
|
|
144
|
-
'PanoTag--notHidden': state
|
|
145
|
-
}),
|
|
146
|
-
style: {
|
|
147
|
-
left: ((pos === null || pos === void 0 ? void 0 : pos.left) || 0) + 'px',
|
|
148
|
-
top: ((pos === null || pos === void 0 ? void 0 : pos.top) || 0) + 'px'
|
|
149
|
-
}
|
|
150
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
151
|
-
className: "PanoTag-point"
|
|
152
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
153
|
-
className: "PanoTag-content"
|
|
154
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
155
|
-
className: "PanoTag-linewrap"
|
|
156
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
157
|
-
className: "PanoTag-slashline"
|
|
158
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
159
|
-
className: "PanoTag-straightline"
|
|
160
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
161
|
-
onClick: function onClick() {
|
|
162
|
-
if (state !== null && state !== void 0 && state.imgUrl) {// @TODO
|
|
163
|
-
// setDrawerVisible(true)
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
className: 'PanoTag-box PanoTag-box--' + ((state === null || state === void 0 ? void 0 : state.type) || '')
|
|
167
|
-
}, boxContent))));
|
|
110
|
+
return null;
|
|
168
111
|
}
|