@node-projects/web-component-designer 0.1.291 → 0.1.292
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.
|
@@ -4,18 +4,20 @@ export class ObservedCustomElementsRegistry {
|
|
|
4
4
|
constructor() {
|
|
5
5
|
this._originalCustomElementsRegistry = window.customElements;
|
|
6
6
|
const registry = {};
|
|
7
|
+
const originalCustomElementsRegistry = this._originalCustomElementsRegistry;
|
|
8
|
+
const newElements = this._newElements;
|
|
7
9
|
registry.define = function (name, constructor, options) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
newElements.push(name);
|
|
11
|
+
originalCustomElementsRegistry.define(name, constructor, options);
|
|
10
12
|
};
|
|
11
13
|
registry.get = function (name) {
|
|
12
|
-
return
|
|
14
|
+
return originalCustomElementsRegistry.get(name);
|
|
13
15
|
};
|
|
14
16
|
registry.upgrade = function (node) {
|
|
15
|
-
return
|
|
17
|
+
return originalCustomElementsRegistry.upgrade(node);
|
|
16
18
|
};
|
|
17
19
|
registry.whenDefined = function (name) {
|
|
18
|
-
return
|
|
20
|
+
return originalCustomElementsRegistry.whenDefined(name);
|
|
19
21
|
};
|
|
20
22
|
Object.defineProperty(window, "customElements", {
|
|
21
23
|
get() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObservedCustomElementsRegistry.js","sourceRoot":"","sources":["../../../src/elements/helper/ObservedCustomElementsRegistry.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,8BAA8B;IAE/B,+BAA+B,CAAuB;IACtD,YAAY,GAAa,EAAE,CAAC;IAEpC;QACI,IAAI,CAAC,+BAA+B,GAAG,MAAM,CAAC,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ObservedCustomElementsRegistry.js","sourceRoot":"","sources":["../../../src/elements/helper/ObservedCustomElementsRegistry.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,8BAA8B;IAE/B,+BAA+B,CAAuB;IACtD,YAAY,GAA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;IACvB,CAAC;CACJ"}
|
package/dist/index-min.js
CHANGED
|
@@ -1034,7 +1034,7 @@ span {
|
|
|
1034
1034
|
<svg id="rightArrow" part="arrow rightArrow" viewBox="-100 -100 200 200"><g transform="rotate(90)">${Yi}</g></svg>
|
|
1035
1035
|
</div>
|
|
1036
1036
|
</div>
|
|
1037
|
-
`;function Ed(s){return s?"vertical":"horizontal"}function eh(s){switch(s){case"vertical":return!0;case"horizontal":return!1;default:throw new Error('Invalid orientation value "'+s+'".')}}function Xi(s){return(s*100).toFixed(3)+"%"}function Ad(s){if(!(!s||!s.endsWith("px")))return Number(s.substring(0,s.length-2))}customElements.define("node-projects-plain-scrollbar",_o);Qs();Do();Me();Rn();var Js=class{_originalCustomElementsRegistry;_newElements=[];constructor(){this._originalCustomElementsRegistry=window.customElements;let e={};e.define=function(
|
|
1037
|
+
`;function Ed(s){return s?"vertical":"horizontal"}function eh(s){switch(s){case"vertical":return!0;case"horizontal":return!1;default:throw new Error('Invalid orientation value "'+s+'".')}}function Xi(s){return(s*100).toFixed(3)+"%"}function Ad(s){if(!(!s||!s.endsWith("px")))return Number(s.substring(0,s.length-2))}customElements.define("node-projects-plain-scrollbar",_o);Qs();Do();Me();Rn();var Js=class{_originalCustomElementsRegistry;_newElements=[];constructor(){this._originalCustomElementsRegistry=window.customElements;let e={},t=this._originalCustomElementsRegistry,i=this._newElements;e.define=function(r,n,o){i.push(r),t.define(r,n,o)},e.get=function(r){return t.get(r)},e.upgrade=function(r){return t.upgrade(r)},e.whenDefined=function(r){return t.whenDefined(r)},Object.defineProperty(window,"customElements",{get(){return e}})}dispose(){let e=this._originalCustomElementsRegistry;Object.defineProperty(window,"customElements",{get(){return e}})}getNewElements(){let e=this._newElements;return this._newElements=[],e}};Ye();Mo();Te();var ri=class s{static _canvas;static _context;static _video;static _captureStream;static _disableStream(){s._captureStream.getTracks().forEach(e=>e.stop()),s._canvas=null}static get screenshotsEnabled(){return s._captureStream&&s._captureStream.active}static async enableScreenshots(e=document.body){if(s._captureStream&&!s._captureStream.active&&s._disableStream(),s._canvas==null){s._canvas=document.createElement("canvas"),s._context=s._canvas.getContext("2d"),s._video=document.createElement("video");let t={video:{cursor:"never",displaySurface:"browser"},audio:!1,selfBrowserSurface:"include",preferCurrentTab:!0};if(s._video.style.display="none",e.appendChild(s._video),s._captureStream=await navigator.mediaDevices.getDisplayMedia(t),s._captureStream.getVideoTracks()[0].getSettings().displaySurface!="browser")throw s._disableStream(),alert("You need to share the current Tab, for the screenshot API to work"),"You need to share the current Tab, for the screenshot API to work";s._video.srcObject=s._captureStream,s._video.play(),await s._sleep(150)}}static async takeScreenshot(e,t=100,i=100,r=document.body){await s.enableScreenshots(r);let n=e.getBoundingClientRect();s._canvas.width=t,s._canvas.height=i,s._context.drawImage(s._video,0,0,1,1,0,0,t,i);let o=s._video.videoWidth/window.innerWidth,a=s._video.videoHeight/window.innerHeight;return s._context.drawImage(s._video,n.left*o,n.top*a,n.width*o,n.height*a,0,0,t,i),s._canvas.toDataURL("image/png")}static _sleep(e){let t=null,i=new Promise(r=>t=r);return window.setTimeout(t,e),i}};kn();var eo=class s{static addTouchEvents(e){return new s(e)}constructor(e){this._target=e,e.addEventListener("touchstart",t=>this._touchStart(t)),e.addEventListener("touchmove",t=>this._touchMove(t)),e.addEventListener("touchend",t=>this._touchEnd(t)),e.addEventListener("touchcancel",t=>this._touchEnd(t))}_target;_started;_startX_0;_startY_0;_lastZoom;_lastPanDistanceX;_lastPanDistanceY;_startZoomDistance;multitouchEventActive;_mode=null;_touchStart(e){e.touches.length===2?(this.multitouchEventActive=!0,this._mode=null,this._started=!0,this._startX_0=e.touches[0].screenX,this._startY_0=e.touches[0].screenY,this._lastZoom=0,this._lastPanDistanceX=0,this._lastPanDistanceY=0,this._startZoomDistance=Math.hypot(e.touches[0].screenX-e.touches[1].screenX,e.touches[0].screenY-e.touches[1].screenY)):(this.multitouchEventActive=!1,this._started=!1)}_touchMove(e){if(e.touches.length!==2&&(this.multitouchEventActive=!1,this._started=!1),this._started){e.preventDefault();let t=Math.hypot(e.touches[0].screenX-e.touches[1].screenX,e.touches[0].screenY-e.touches[1].screenY),i=this._startX_0-e.touches[0].screenX,r=this._startY_0-e.touches[0].screenY,n=i-this._lastPanDistanceX,o=r-this._lastPanDistanceY;this._lastPanDistanceX=i,this._lastPanDistanceY=r;let a=t-this._startZoomDistance,l=a-this._lastZoom;if(this._lastZoom=a,this._lastZoom,this._mode||(Math.abs(a)>10&&(this._mode="zoom"),(Math.abs(i)>10||Math.abs(r)>10)&&(this._mode="pan")),this._mode){if(this._mode=="zoom"){let c=new CustomEvent("zoom",{detail:{factor:a,diff:l}});this._target.dispatchEvent(c)}else if(this._mode=="pan"){let c=new CustomEvent("pan",{detail:{x:i,deltaX:n,y:r,deltaY:o}});this._target.dispatchEvent(c)}}}}_touchEnd(e){this.multitouchEventActive=!1,e.touches.length}};Go();ot();Ee();gr();Na();var to=class{_name;get name(){return this._name}_elementList;getElements(){return Promise.resolve(this._elementList)}constructor(e,t){this._name=e,this._elementList=[],t.elements.forEach(i=>{this.isIElementDefintion(i)?this._elementList.push(i):this._elementList.push({tag:i})})}isIElementDefintion(e){return e!=null&&e.tag!=null}};Ee();var io=class{_name;get name(){return this._name}_importPrefix;_elementList;_resolveStored;_rejectStored;constructor(e,t,i){this._name=e,this._importPrefix=t,this._parseManifest(i)}_parseManifest(e){this._elementList=[];for(let t of e.modules){for(let i of t.exports)if(i.kind=="custom-element-definition"){let r={tag:i.name,import:bt(this._importPrefix,"/")+"/"+ce(t.path,"/"),defaultWidth:"200px",defaultHeight:"200px",className:i.declaration.name};this._elementList.push(r)}for(let i of t.declarations)if(i.tagName){let r={tag:i.tagName,import:bt(this._importPrefix,"/")+"/"+ce(t.path,"/"),defaultWidth:"200px",defaultHeight:"200px",className:i.name};this._elementList.push(r)}this._resolveStored&&(this._resolveStored.forEach(i=>i(this._elementList)),this._resolveStored=null,this._rejectStored=null)}}async getElements(){return this._elementList?Promise.resolve(this._elementList):(this._resolveStored||(this._resolveStored=[],this._rejectStored=[]),new Promise((e,t)=>{this._resolveStored.push(e),this._rejectStored.push(t)}))}};Ae();te();ee();fe();var ni=class s extends K{getRefreshMode(e){return G.full}_name;get name(){return this._name}_propertiesList;constructor(e,t,i){super(i),this._name=e,this._parseManifest(t)}_parseManifest(e){this._propertiesList={};let t=[];for(let i of e.modules)i.declarations&&t.push(...i.declarations);for(let i of e.modules)for(let r of i.exports)if(r.kind=="custom-element-definition"){let n=[],o=t.find(a=>a.name==r.declaration.name);if(o){if(o.members){for(let a of o.members)if(a.kind=="field"&&a.privacy!=="private"&&a.privacy!=="protected"){let l=y.property;o.attributes&&(l=o.attributes.find(h=>h.fieldName==a.name)!=null?y.propertyAndAttribute:y.property);let c=s.manifestClassPropertyTypeToEditorPropertyType(a.type?.text,a.type?.editor);a.name&&n.push({name:a.name,service:this,propertyType:l,type:c[0],values:c[1],description:a.description})}this._propertiesList[r.name]=n}}else console.warn("declaration for "+r.declaration.name+" not found",e)}}static manifestClassPropertyTypeToEditorPropertyType(e,t){if(t&&t.toLowerCase()==="color")return["color"];if(e){if(e.toLowerCase()==="boolean")return["boolean"];if(e.toLowerCase()==="number")return["number"];if(e.toLowerCase()==="string")return["string"];if(e.startsWith("'")&&e.includes("|"))return["list",e.split("|").map(r=>r.trim()).map(r=>r.substring(1,r.length-1))]}return[e]}isHandledElement(e){return this._propertiesList[e.name]!=null}async getProperties(e){return this._propertiesList[e.name]}async getProperty(e,t){return this._propertiesList[e.name].find(i=>i.name==t)}getPropertyTarget(e,t){return this._propertiesList[e.name].find(i=>i.name==t.name).propertyType==y.attribute?M.attribute:M.property}getUnsetValue(e,t){return e[0].element[t.propertyName??t.name]}};Ee();var de={"@shoelace-style/shoelace":{html:`<link rel="stylesheet" media="(prefers-color-scheme:light)" href="\${baseUrl}dist/themes/light.css">
|
|
1038
1038
|
<link rel="stylesheet" media="(prefers-color-scheme:dark)" href="\${baseUrl}dist/themes/dark.css" onload="document.documentElement.classList.add('sl-theme-dark');">`},"@microsoft/fast-components":{script:`let res = await import('@microsoft/fast-components');
|
|
1039
1039
|
res.provideFASTDesignSystem().register(res.allComponents);`},"@zooplus/zoo-web-components":{script:`let res = await import('@zooplus/zoo-web-components');
|
|
1040
1040
|
res.registerComponents(res);`,style:`:root {
|
package/package.json
CHANGED