vi_runtime 0.0.0-stage → 1.0.1
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/README.md
CHANGED
|
@@ -1,3 +1,144 @@
|
|
|
1
|
-
#
|
|
1
|
+
# vi_runtime
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
Lib template for the VIZOR ENGINE PLATFORM
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# VIZOR Collaborator instructions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
FIRST TIME :
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
1. Clone the project:
|
|
15
|
+
|
|
16
|
+
git clone https://github.com/your-username/your-repository.git
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
NOTA : Al clonar el template y crear una nueva libreria
|
|
21
|
+
usar rm -rf .git
|
|
22
|
+
para desvincular el proyecto
|
|
23
|
+
y crear otro repositorio en github.
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
2. Modify:
|
|
29
|
+
|
|
30
|
+
Make your changes in the codebase.
|
|
31
|
+
|
|
32
|
+
3. Create a local branch:
|
|
33
|
+
|
|
34
|
+
- NOTA : Como nombre del branch se puede usar la versión,
|
|
35
|
+
ejemplo : release-vX.Y.Z
|
|
36
|
+
|
|
37
|
+
Colocar en CHANGELOG.md el detalle de los cambios realizados:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
git checkout -b feature-branch-name
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
4. Add and commit changes:
|
|
46
|
+
|
|
47
|
+
git add .
|
|
48
|
+
|
|
49
|
+
git commit -m "Description of the changes"
|
|
50
|
+
|
|
51
|
+
5. Push the branch:
|
|
52
|
+
|
|
53
|
+
git push origin feature-branch-name
|
|
54
|
+
|
|
55
|
+
6. Create a pull request on GitHub.
|
|
56
|
+
|
|
57
|
+
7. Ask the owner to accept and merge
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
NEXT STEPS (Continous Development)
|
|
62
|
+
|
|
63
|
+
1. pull to have the lastest changes
|
|
64
|
+
|
|
65
|
+
git checkout main
|
|
66
|
+
git pull origin main
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
2. create a new branch (use a name that clearly comunicate the featur you ar working on)
|
|
70
|
+
|
|
71
|
+
git checkout -b new-feature-branch
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
3. Make your changes in the codebase.
|
|
75
|
+
|
|
76
|
+
4. push the new changes
|
|
77
|
+
|
|
78
|
+
git add .
|
|
79
|
+
git commit -m "Description of changes"
|
|
80
|
+
git push origin new-feature-branch
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
# Managing Versioning
|
|
86
|
+
|
|
87
|
+
Determine the version update type:
|
|
88
|
+
Decide whether the changes constitute a major, minor, or patch update based on the Semantic
|
|
89
|
+
|
|
90
|
+
Versioning guidelines:
|
|
91
|
+
|
|
92
|
+
Major: Incompatible API changes.
|
|
93
|
+
Minor: Backward-compatible functionality.
|
|
94
|
+
Patch: Backward-compatible bug fixes.
|
|
95
|
+
|
|
96
|
+
Update the version number:
|
|
97
|
+
Update the version number in the relevant files (e.g., package.json for Node.js projects) based on the determined version update type.
|
|
98
|
+
|
|
99
|
+
1. Create a release branch:
|
|
100
|
+
|
|
101
|
+
git checkout main
|
|
102
|
+
git pull origin main
|
|
103
|
+
git checkout -b release-vX.Y.Z
|
|
104
|
+
Update the changelog:
|
|
105
|
+
Document the changes in a CHANGELOG.md file, outlining the new features, bug fixes, and other relevant information for the release.
|
|
106
|
+
|
|
107
|
+
2. Commit the version update and changelog:
|
|
108
|
+
|
|
109
|
+
git add .
|
|
110
|
+
git commit -m "Bump version to vX.Y.Z and update changelog"
|
|
111
|
+
|
|
112
|
+
3. Push the release branch:
|
|
113
|
+
|
|
114
|
+
git push origin release-vX.Y.Z
|
|
115
|
+
|
|
116
|
+
4. Create a pull request for the release branch:
|
|
117
|
+
|
|
118
|
+
5. Create a pull request to merge the release branch into the main branch.
|
|
119
|
+
|
|
120
|
+
6. Merge the pull request:
|
|
121
|
+
|
|
122
|
+
Once reviewed and approved, merge the pull request.
|
|
123
|
+
|
|
124
|
+
7. Tag the release:
|
|
125
|
+
|
|
126
|
+
8. After merging, create a tag for the new release:
|
|
127
|
+
|
|
128
|
+
git checkout main
|
|
129
|
+
git pull origin main
|
|
130
|
+
git tag -a vX.Y.Z -m "Release version vX.Y.Z"
|
|
131
|
+
git push origin vX.Y.Z
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
9. Create a release on GitHub:
|
|
135
|
+
|
|
136
|
+
Go to the GitHub repository, navigate to the "Releases" section, and create a new release using the created tag. Provide the release notes based on the changelog.
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
By following these steps, you'll maintain a well-organized versioning system, ensuring that the codebase remains structured and that changes are properly documented and released.
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
# vizor_lib_template
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see vi_runtime.min.js.LICENSE.txt */
|
|
2
|
+
var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{G:()=>j,j:()=>w});var r=["domain"],n=["visible","columns"];function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],l=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(t,e)||p(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function a(){a=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},l=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",s=c.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof w?e:w,a=Object.create(i.prototype),c=new N(n||[]);return o(a,"_invoke",{value:k(t,r,c)}),a}function v(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var d="suspendedStart",p="suspendedYield",y="executing",m="completed",g={};function w(){}function b(){}function _(){}var x={};f(x,l,(function(){return this}));var j=Object.getPrototypeOf,O=j&&j(j(I([])));O&&O!==r&&n.call(O,l)&&(x=O);var E=_.prototype=w.prototype=Object.create(x);function S(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,a,c,l){var u=v(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==i(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,c,l)}),(function(t){r("throw",t,c,l)})):e.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return r("throw",t,c,l)}))}l(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function k(e,r,n){var o=d;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var l=C(c,n);if(l){if(l===g)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=v(e,r,n);if("normal"===u.type){if(o=n.done?m:p,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function C(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=v(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[l];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(i(e)+" is not iterable")}return b.prototype=_,o(E,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:b,configurable:!0}),b.displayName=f(_,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,f(t,s,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},S(L.prototype),f(L.prototype,u,(function(){return this})),e.AsyncIterator=L,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new L(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(E),f(E,s,"Generator"),f(E,l,(function(){return this})),f(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function c(t,e,r,n,o,i,a){try{var c=t[i](a),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).then(n,o)}function l(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){c(i,n,o,a,l,"next",t)}function l(t){c(i,n,o,a,l,"throw",t)}a(void 0)}))}}function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function f(t,e,r){return(e=g(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.includes(r)||{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function v(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=p(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function d(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||p(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(t,e){if(t){if("string"==typeof t)return y(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(t,e):void 0}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function m(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,g(n.key),n)}}function g(t){var e=function(t,e){if("object"!=i(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==i(e)?e:e+""}var w=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.container,n=void 0===r?"mapa_div":r,o=e.landmarks,i=void 0===o?{}:o,a=e.rtcConfig,c=void 0===a?null:a,l=e.company,u=void 0===l?"":l,s=e.dataSources,f=void 0===s?[]:s,h=e.collectorConfigs,v=void 0===h?{}:h,d=e.tableConfigs,p=void 0===d?{}:d,y=e.handler,m=void 0===y?vi_RTC:y;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.host="string"==typeof n?document.getElementById(n):n,!this.host)throw new Error("Vizor container not found");this.landmarks=i,this.rtcConfig=c,this.company=u,this.dataSources=f,this.collectorConfigs=v,this.tableConfigs=p,this.tables=[],this.tableWindows=[],this.handler=m,this.collectors=[],this.scenes=[],this._sceneConfigs=[],this.mvc=null,this.store=null,this.eventBus=null,this._focusInProgress=new Set},e=[{key:"getCollectionNames",value:function(t){return d(new Set([].concat(d((t.tableDataEditors||[]).map((function(t){var e;return(null===(e=t.source)||void 0===e?void 0:e.collectionName)||t.table||t.name}))),d(t.scenes.flatMap((function(t){return[].concat(d(t.coleccions||[]),d(Object.keys(t.vos||{})))}))),d((t.collectors||[]).map((function(t){return t.datasource})))).filter(Boolean)))}},{key:"installDataSources",value:function(t,e){var n,o=Array.isArray(window.vizor_project_data_sources)?window.vizor_project_data_sources:[],i=[].concat(d(Array.isArray(t.dataSources)?t.dataSources:[]),d(Array.isArray(t.datasources)?t.datasources:[]),d(Array.isArray(this.dataSources)?this.dataSources:[])),a=new Map(o.map((function(t){return[t.name,t]}))),c=v(i);try{for(c.s();!(n=c.n()).done;){var l=n.value;null!=l&&l.name&&a.set(l.name,l)}}catch(t){c.e(t)}finally{c.f()}var u,f=v(e);try{for(f.s();!(u=f.n()).done;){var p=u.value;if(!a.has(p))if(this.rtcConfig){var y=this.rtcConfig,m=(y.domain,h(y,r));a.set(p,{name:p,connector_name:"rtdb",config:JSON.stringify(s(s({},m),{},{domain:p}))})}else console.warn('Vizor: missing datasource "'.concat(p,'" and no rtcConfig to construct it.'))}}catch(t){f.e(t)}finally{f.f()}return window.vizor_project_data_sources=d(a.values()),window.vizor_project_data_sources}},{key:"connectMVC",value:function(){var t=this;this.mvc=new vi_MVC_Controller,this.store=new vi_Store;var e,r=v(this.collectors);try{var n=function(){var r,n=e.value,o=n.name;t.store.addCollectionIfNotExist(o);var i=["".concat(o,":loaded"),"".concat(o,":add_or_update"),"".concat(o,":delete")];t.mvc.add_route({origin:n,collection:o,target:t.store,events:i});var a=null===(r=t.tables.find((function(t){return t.collection===o})))||void 0===r?void 0:r.table;a&&t.mvc.add_route({origin:t.store,collection:o,target:a,events:i});for(var c=0;c<t.scenes.length;c++){var l=t._sceneConfigs[c];new Set([].concat(d(l.coleccions||[]),d(Object.keys(l.vos||{})))).has(o)&&t.mvc.add_route({origin:t.store,collection:o,target:t.scenes[c],events:i})}};for(r.s();!(e=r.n()).done;)n()}catch(t){r.e(t)}finally{r.f()}}},{key:"createTables",value:function(t){var e,r=new Map((t.tableDataEditors||[]).filter((function(t){var e;return(null==t||null===(e=t.source)||void 0===e?void 0:e.collectionName)||(null==t?void 0:t.table)||(null==t?void 0:t.name)})).map((function(t){var e;return[(null===(e=t.source)||void 0===e?void 0:e.collectionName)||t.table||t.name,t]}))),o=new Map((t.tables||[]).filter((function(t){return(null==t?void 0:t.collection)||(null==t?void 0:t.name)})).map((function(t){return[t.collection||t.name,t]}))),i=v(this.collectors);try{for(i.s();!(e=i.n()).done;){var a,c,l,u=e.value.name,f=r.get(u),d=s(s({},this.tableConfigs[u]||{}),o.get(u)||{}),p=Array.isArray(null==f?void 0:f.columns)?f.columns:null,y=Array.isArray(d.columns)?d.columns:null,m=(null!==(a=null!=p?p:y)&&void 0!==a?a:[]).filter((function(t){return t&&"string"==typeof t.data&&t.data.trim()})).map((function(t){return s(s({},t),{},{title:t.title||t.data,visible:!1!==t.visible})}));if(m.length){var g=this.tables.length,w=new vi_Window("vizor-table-window-".concat(u),"",null!==(c=d.width)&&void 0!==c?c:500,null!==(l=d.height)&&void 0!==l?l:420,d.title||u,s({backgroundColor:"#ffffff",closeButton:!0,showCloseButton:!0,position:d.position||{top:"".concat(90+28*g,"px"),left:"".concat(150+28*g,"px"),bottom:"auto",right:"auto"}},d.windowOptions||{})),b=(d.visible,d.columns,h(d,n)),_=new vi_Table(u,w,s(s({select:"single",paging:!0,searching:!0,ordering:!0,info:!0,scrollCollapse:!0,scrollY:"350px",scroller:!0},b),{},{columns:m}));!0!==d.visible&&w.hide(),this.tableWindows.push({collection:u,window:w}),this.tables.push({collection:u,table:_,window:w})}else console.warn('Vizor: no valid table columns configured for "'.concat(u,'"; skipping table.'))}}catch(t){i.e(t)}finally{i.f()}}},{key:"connectSelectionBus",value:function(){var t=this,e=new vi_EventBus;this.eventBus=e,this._focusInProgress.clear();var r,n=v(this.scenes);try{for(n.s();!(r=n.n()).done;){var o=r.value;e.add(o)}}catch(t){n.e(t)}finally{n.f()}var i,a=v(this.tables);try{for(a.s();!(i=a.n()).done;){var c=i.value.table;e.add(c)}}catch(t){a.e(t)}finally{a.f()}var l,u=v(new Set(this.getCollectionNames(this._currentConfig)));try{var s=function(){var r=l.value;e.on(r,"selected",(function(e,n,o){var i,a,c,l,u=null!==(i=null!==(a=null==o?void 0:o.id)&&void 0!==a?a:null==o||null===(c=o.record)||void 0===c?void 0:c.id)&&void 0!==i?i:null==o||null===(l=o.data)||void 0===l?void 0:l.id;if(null!=u){var s="".concat(r,":").concat(String(u));if(!t._focusInProgress.has(s)){t._focusInProgress.add(s);try{var f=t.getTable(r);"function"==typeof(null==f?void 0:f.focus)&&f.focus(u);for(var h=0;h<t.scenes.length;h++){var v=t._sceneConfigs[h];new Set([].concat(d(v.coleccions||[]),d(Object.keys(v.vos||{})))).has(r)&&"function"==typeof t.scenes[h].focus&&t.scenes[h].focus(r,{id:u})}}catch(t){console.error("Vizor: selection focus failed for ".concat(r),t)}finally{t._focusInProgress.delete(s)}}}}))};for(u.s();!(l=u.n()).done;)s()}catch(t){u.e(t)}finally{u.f()}return window.vizor_event_bus=e,e}},{key:"getTable",value:function(t){var e;return null===(e=this.tables.find((function(e){return e.collection===t})))||void 0===e?void 0:e.table}},{key:"getTableWindow",value:function(t){var e;return null===(e=this.tableWindows.find((function(e){return e.collection===t})))||void 0===e?void 0:e.window}},{key:"getRecords",value:function(t){var e;return(null===(e=this.store)||void 0===e?void 0:e.queryData(t,{}))||[]}},{key:"getCollector",value:function(t){return this.collectors.find((function(e){return e.name===t}))}},{key:"build",value:(u=l(a().mark((function t(e){var r,n,o,i,c,u,f,h,d,p,y,m,g,w,b,_,x,j,O,E,S,L,k,C,P=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((r="string"==typeof e?JSON.parse(e):e)&&Array.isArray(r.scenes)){t.next=3;break}throw new Error("Invalid Vizor config: scenes missing");case 3:n=v(this.collectors);try{for(n.s();!(o=n.n()).done;){i=o.value;try{null===(c=i.handler)||void 0===c||null===(u=(f=c).disconnect)||void 0===u||u.call(f)}catch(t){console.warn(t)}}}catch(t){n.e(t)}finally{n.f()}h=v(this.tableWindows);try{for(h.s();!(d=h.n()).done;){p=d.value;try{null===(y=p.window)||void 0===y||null===(m=(g=y).close)||void 0===m||m.call(g)}catch(t){console.warn(t)}}}catch(t){h.e(t)}finally{h.f()}this.collectors=[],this.tables=[],this.tableWindows=[],this.scenes=[],this._sceneConfigs=[],this.mvc=null,this.store=null,this.eventBus=null,this._currentConfig=r,this.host.replaceChildren(),Object.assign(this.host.style,{position:"relative",minHeight:"600px",width:"100%",height:"100vh"}),w=this.getCollectionNames(r),this.installDataSources(r,w),b=new Map((r.collectors||[]).filter((function(t){return null==t?void 0:t.datasource})).map((function(t){return[t.datasource,t]}))),_=v(w),t.prev=22,j=a().mark((function t(){var e,r,n,o,i,c,l;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=x.value,o=window.vizor_project_data_sources.find((function(t){return t.name===n}))){t.next=4;break}return t.abrupt("return",1);case 4:i=s(s({},P.collectorConfigs[n]||{}),b.get(n)||{}),c=null!==(e=i.rtdb)&&void 0!==e?e:"rtdb"===o.connector_name,l=new vi_Collector(s({datasource:n,prefix:P.company,handler:c?P.handler:i.handler,rtdb:c,one_shot:null!==(r=i.one_shot)&&void 0!==r&&r,where:i.where||{}},i)),P.collectors.push(l);case 8:case"end":return t.stop()}}),t)})),_.s();case 25:if((x=_.n()).done){t.next=31;break}return t.delegateYield(j(),"t0",27);case 27:if(!t.t0){t.next=29;break}return t.abrupt("continue",29);case 29:t.next=25;break;case 31:t.next=36;break;case 33:t.prev=33,t.t1=t.catch(22),_.e(t.t1);case 36:return t.prev=36,_.f(),t.finish(36);case 39:O=v(r.scenes);try{for(O.s();!(E=O.n()).done;)S=E.value,L=document.createElement("div"),Object.assign(L.style,{position:"relative",width:"100%",height:"100%",minHeight:"600px"}),this.host.appendChild(L),k={contentContainer:L,div:L},C=this.createScene(S,k),this.scenes.push(C),this._sceneConfigs.push(S),this.installInfoWindow(C,S),this.restoreVods(C,S),this.restoreCamera(C,S)}catch(t){O.e(t)}finally{O.f()}return this.createTables(r),this.connectSelectionBus(),this.connectMVC(),window.vizor_store=this.store,window.vizor_mvc=this.mvc,window.vizor_tables=this.tables,window.vizor_table_windows=this.tableWindows,t.next=50,Promise.allSettled(this.collectors.map(function(){var t=l(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.load();case 3:t.next=9;break;case 5:throw t.prev=5,t.t0=t.catch(0),console.error("Vizor: collector ".concat(e.name," failed"),t.t0),t.t0;case 9:case"end":return t.stop()}}),t,null,[[0,5]])})));return function(e){return t.apply(this,arguments)}}()));case 50:return t.abrupt("return",this.scenes);case 51:case"end":return t.stop()}}),t,this,[[22,33,36,39]])}))),function(t){return u.apply(this,arguments)})},{key:"installInfoWindow",value:function(t,e){var r,n=this,o="function"==typeof(null==t?void 0:t.setInfoWindow)?t:null==t?void 0:t._renderer;if("function"==typeof(null==o?void 0:o.setInfoWindow)){var a=new Map(((null===(r=this._currentConfig)||void 0===r?void 0:r.tableDataEditors)||[]).filter((function(t){var e;return(null==t||null===(e=t.source)||void 0===e?void 0:e.collectionName)||(null==t?void 0:t.table)||(null==t?void 0:t.name)})).map((function(t){var e;return[(null===(e=t.source)||void 0===e?void 0:e.collectionName)||t.table||t.name,t]}))),c=function(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")};o.setInfoWindow((function(t,e,r,o){var l,u,s=(null==o||null===(l=o.userData)||void 0===l?void 0:l.data)||(null==o?void 0:o.data)||(null==r?void 0:r.data)||{},f="string"==typeof t?t:(null==t?void 0:t.collection)||(null==t?void 0:t.domain)||(null==t?void 0:t.name),h=a.get(f),v=((null==h?void 0:h.columns)||(null===(u=n.tableConfigs[f])||void 0===u?void 0:u.columns)||[]).filter((function(t){return!1!==(null==t?void 0:t.visible)&&"string"==typeof(null==t?void 0:t.data)&&t.data.trim()})).filter((function(t){var e=null==s?void 0:s[t.data];return null!=e&&"object"!==i(e)})).map((function(t){return'<div style="display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;padding:7px 0;border-bottom:1px solid #333;align-items:start"><span style="color:#fff;overflow-wrap:anywhere">'.concat(c(t.title||t.data),'</span><span style="color:#ffd54f;text-align:right;overflow-wrap:anywhere">').concat(c(s[t.data]),"</span></div>")})).join("");return'<div style="width:100%;height:100%;box-sizing:border-box;overflow:auto;background:#1e1e1e;padding:12px;border-radius:8px;font:13px Arial,sans-serif">'.concat(v||'<span style="color:#999">No visible fields available</span>',"</div>")}))}else console.warn("Vizor: this scene does not support setInfoWindow",e.type)}},{key:"createScene",value:function(t,e){if("map"===t.type){var r,n=new vi_PlaneEarth(e,{background:"333333",center:{latitude:25.6783587,longitude:-100.368862},interaction:{enable:!0,select:!0,hover:!0},camera:{position:{x:6,y:1,z:6}},fog:!0});return null===(r=n.setLandmarks)||void 0===r||r.call(n,this.landmarks),n}if("dataSpace"===t.type){var o,i=new vi_3DGSceneRenderer(e,{},[]);i.axis(),i.createBaseFloor(500,500,20,-3),i.setBackgound(0),i.controls.maxDistance=1e5;var a=t.dataSpaceCongif?vi_gdata_space.fromConfig(i,t.dataSpaceCongif,vi_dim):new vi_gdata_space(i,{slot:{type:"linear",origin:{a:0,m:0},delta:{a:0,m:0}}});return a.draw(),null===(o=a.setLandmarks)||void 0===o||o.call(a,this.landmarks),a._renderer=i,a}throw new Error("Unsupported scene type: ".concat(t.type))}},{key:"restoreVods",value:function(t,e){for(var r=vi_3DGSceneRenderer.THREE,n=0,i=Object.entries(e.vos||{});n<i.length;n++){var a=o(i[n],2),c=a[0],l=a[1],u=null==l?void 0:l.geom;if(Array.isArray(u)){var s,f=structuredClone(u),h=v(f);try{for(h.s();!(s=h.n()).done;)for(var d=s.value,p=0,y=["cylinder","ring","sphere","box","plane"];p<y.length;p++){var m,g,w,b=d[y[p]];if(null!=b&&b.material){var _=b.material;_.isMaterial||(_.metadata&&_.type?b.material=(new r.MaterialLoader).parse(_):b.material=new r.MeshPhongMaterial({color:null!==(m=_.color)&&void 0!==m?m:16777215,opacity:null!==(g=_.opacity)&&void 0!==g?g:1,transparent:null!==(w=_.transparent)&&void 0!==w&&w}))}}}catch(t){h.e(t)}finally{h.f()}var x=new vi_vod(f,(function(t,e){var r,n=v(t);try{for(n.s();!(r=n.n()).done;){var o=r.value;o.userData||(o.userData={}),o.userData.data=e}}catch(t){n.e(t)}finally{n.f()}return t}));t.add_vod(c,x)}}}},{key:"restoreCamera",value:function(t,e){var r,n,o,i,a=t.camera||(null===(r=t._renderer)||void 0===r?void 0:r.camera),c=t.controls||(null===(n=t._renderer)||void 0===n?void 0:n.controls);if(e.camera&&null!=a&&a.position){var l=e.camera;a.position.set(l.x,l.y,l.z)}if(e.controls&&null!=c&&c.target){var u=e.controls;c.target.set(u.x,u.y,u.z)}null==c||null===(o=c.update)||void 0===o||o.call(c),null==a||null===(i=a.updateProjectionMatrix)||void 0===i||i.call(a)}}],e&&m(t.prototype,e),c&&m(t,c),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,c,u}();function b(t){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b(t)}function _(){_=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new N(n||[]);return o(a,"_invoke",{value:k(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",v="suspendedYield",d="executing",p="completed",y={};function m(){}function g(){}function w(){}var x={};u(x,a,(function(){return this}));var j=Object.getPrototypeOf,O=j&&j(j(I([])));O&&O!==r&&n.call(O,a)&&(x=O);var E=w.prototype=m.prototype=Object.create(x);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,i,a,c){var l=f(t[o],t,i);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==b(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function k(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===p){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var l=C(c,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?p:v,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=p,n.method="throw",n.arg=u.arg)}}}function C(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(b(e)+" is not iterable")}return g.prototype=w,o(E,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=u(w,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,u(t,l,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},S(L.prototype),u(L.prototype,c,(function(){return this})),e.AsyncIterator=L,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new L(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(E),u(E,l,"Generator"),u(E,a,(function(){return this})),u(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=I,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function x(t,e,r,n,o,i,a){try{var c=t[i](a),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).then(n,o)}function j(t){return O.apply(this,arguments)}function O(){var t;return t=_().mark((function t(e){var r,n=arguments;return _().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new w(n.length>1&&void 0!==n[1]?n[1]:{}),t.next=4,r.build(e);case 4:return t.abrupt("return",r);case 5:case"end":return t.stop()}}),t)})),O=function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){x(i,n,o,a,c,"next",t)}function c(t){x(i,n,o,a,c,"throw",t)}a(void 0)}))},O.apply(this,arguments)}var E=e.G,S=e.j;export{E as runVizor,S as vi_Runner};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see vi_runtime.min.js.LICENSE.txt */
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.vi_runtime=e():t.vi_runtime=e()}(this,(()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(){n=function(){return e};var t,e={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),c=new G(n||[]);return a(i,"_invoke",{value:P(t,r,c)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var y="suspendedStart",v="suspendedYield",d="executing",m="completed",g={};function b(){}function w(){}function x(){}var j={};s(j,u,(function(){return this}));var E=Object.getPrototypeOf,L=E&&E(E(q([])));L&&L!==o&&i.call(L,u)&&(j=L);var _=x.prototype=b.prototype=Object.create(j);function S(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(o,a,c,u){var l=p(t[o],t,a);if("throw"!==l.type){var f=l.arg,s=f.value;return s&&"object"==r(s)&&i.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):e.resolve(s).then((function(t){f.value=t,c(f)}),(function(t){return n("throw",t,c,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}})}function P(e,r,n){var o=y;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=k(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=p(e,r,n);if("normal"===l.type){if(o=n.done?m:v,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function k(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=p(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function G(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function q(e){if(e||""===e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return w.prototype=x,a(_,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=s(x,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,s(t,f,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},S(O.prototype),s(O.prototype,l,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new O(h(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(_),s(_,f,"Generator"),s(_,u,(function(){return this})),s(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=q,G.prototype={constructor:G,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:q(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function o(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function i(t){return new Promise((function(e,r){var n=document.createElement("script");n.src=t,n.onload=function(){return e(t)},n.onerror=function(){return r(new Error("Failed to load script: ".concat(t)))},document.body.appendChild(n)}))}function a(){return c.apply(this,arguments)}function c(){var t;return t=n().mark((function t(){return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("Initializing vi_runtime"),t.prev=1,t.next=4,i("https://code.jquery.com/jquery-3.6.0.min.js");case 4:return t.next=6,i("https://code.jquery.com/ui/1.12.1/jquery-ui.min.js");case 6:e="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css",r=void 0,(r=document.createElement("link")).rel="stylesheet",r.href=e,document.head.appendChild(r),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(1),console.error("Error initializing vi_runtime:",t.t0);case 12:case"end":return t.stop()}var e,r}),t,null,[[1,9]])})),c=function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function c(t){o(a,n,i,c,u,"next",t)}function u(t){o(a,n,i,c,u,"throw",t)}c(void 0)}))},c.apply(this,arguments)}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function l(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}}function f(t){var e=function(t,e){if("object"!=u(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==u(e)?e:e+""}t.r(e),t.d(e,{init:()=>a,vi_TestLib:()=>s});var s=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),console.log("instance created")},r=[{key:"my_static_method",value:function(){return"return of static method"}}],(e=[{key:"doSomething",value:function(){console.log("done")}}])&&l(t.prototype,e),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();return e})()));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
package/package.json
CHANGED
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vi_runtime",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "desciption of libname",
|
|
5
|
+
"main": "dist/vi_runtime.min.js",
|
|
6
|
+
"module": "dist/vi_runtime.min.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./dist/vi_runtime.min.js"
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
"files":[
|
|
12
|
+
"README.md",
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "webpack --mode production",
|
|
17
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
18
|
+
},
|
|
19
|
+
"author": "Esteban Ortiz",
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@babel/core": "^7.25.2",
|
|
23
|
+
"@babel/preset-env": "^7.25.3",
|
|
24
|
+
"babel-loader": "^9.1.3",
|
|
25
|
+
"webpack": "^5.93.0",
|
|
26
|
+
"webpack-cli": "^5.1.4",
|
|
27
|
+
"webpack-dev-server": "^5.0.4"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"jquery": "^3.7.1",
|
|
31
|
+
"jquery-ui": "^1.13.3"
|
|
32
|
+
}
|
|
33
|
+
}
|