@charlietango/ddb-widget
Advanced tools
Comparing version 0.1.31 to 0.1.32
@@ -0,1 +1,2 @@ | ||
alert('me here'); | ||
function initTracking() { | ||
@@ -9,4 +10,2 @@ window._ti = window._ti || {}; | ||
}; | ||
/** start TagIntegration loader */ | ||
// @ts-ignore | ||
(function (c, d, a, f) { c.wts = c.wts || []; var g = function (b) { var a = ""; b.customDomain && b.customPath ? a = b.customDomain + "/" + b.customPath : b.tiDomain && b.tiId && (a = b.tiDomain + "/resp/api/get/" + b.tiId + "?url=" + encodeURIComponent(c.location.href) + "&v=5"); if (b.option) | ||
@@ -27,3 +26,2 @@ for (var d in b.option) | ||
} })(window, document, "script", _tiConfig); | ||
/** end TagIntegration loader */ | ||
} | ||
@@ -43,3 +41,2 @@ function isMobileDevice() { | ||
if (this.isMobile) { | ||
// prevents scrolling underneath, when overlay is open. Doesn't work on iOS safari :( | ||
document.getElementsByTagName('html')[0].style.overflowY = this.isOpen ? 'hidden' : 'auto'; | ||
@@ -64,4 +61,2 @@ } | ||
initTracking(); | ||
// DEV MOCK API | ||
// const api = 'https://f60f89fd-2e07-4931-b871-2380fd93d266.mock.pstmn.io/ddb/list' | ||
const api = 'https://ddb-be.s1.umbraco.io/api/ddb/list'; | ||
@@ -68,0 +63,0 @@ return this.fetchWidgetData(api); |
@@ -1,135 +0,1 @@ | ||
(function(win, doc, namespace, fsNamespace, resourcesUrl, appCore, appCoreSsr, appCorePolyfilled, hydratedCssClass, components) { | ||
function init(win, doc, namespace, fsNamespace, resourcesUrl, appCore, appCorePolyfilled, hydratedCssClass, cmpTags, HTMLElementPrototype, App, x, y, scriptElm) { | ||
alert('me here') | ||
// create global namespace if it doesn't already exist | ||
App = win[namespace] = win[namespace] || {}; | ||
if (cmpTags) { | ||
// auto hide components until they been fully hydrated | ||
// reusing the "x" and "i" variables from the args for funzies | ||
x = doc.createElement('style'); | ||
x.innerHTML = cmpTags + '{visibility:hidden}.' + hydratedCssClass + '{visibility:inherit}'; | ||
x.setAttribute('data-styles', ''); | ||
y = doc.head.querySelector('meta[charset]'); | ||
doc.head.insertBefore(x, y ? y.nextSibling : doc.head.firstChild); | ||
} | ||
createComponentOnReadyPrototype(win, namespace, HTMLElementPrototype); | ||
resourcesUrl = resourcesUrl || App.resourcesUrl; | ||
// figure out the script element for this current script | ||
y = doc.querySelectorAll('script'); | ||
for (x = y.length - 1; x >= 0; x--) { | ||
scriptElm = y[x]; | ||
if (scriptElm.src || scriptElm.hasAttribute('data-resources-url')) { | ||
break; | ||
} | ||
} | ||
// get the resource path attribute on this script element | ||
y = scriptElm.getAttribute('data-resources-url'); | ||
if (!resourcesUrl && y) { | ||
// the script element has a data-resources-url attribute, always use that | ||
resourcesUrl = y; | ||
} | ||
if (!resourcesUrl && scriptElm.src) { | ||
// we don't have an exact resourcesUrl, so let's | ||
// figure it out relative to this script's src and app's filesystem namespace | ||
y = scriptElm.src.split('/').slice(0, -1); | ||
resourcesUrl = (y.join('/')) + (y.length ? '/' : '') + fsNamespace + '/'; | ||
} | ||
// request the core this browser needs | ||
// test for native support of custom elements and fetch | ||
// if either of those are not supported, then use the core w/ polyfills | ||
// also check if the page was build with ssr or not | ||
x = doc.createElement('script'); | ||
if (usePolyfills(win, win.location, x, 'import("")')) { | ||
// requires the es5/polyfilled core | ||
x.src = resourcesUrl + appCorePolyfilled; | ||
} | ||
else { | ||
// let's do this! | ||
x.src = resourcesUrl + appCore; | ||
x.setAttribute('type', 'module'); | ||
x.setAttribute('crossorigin', true); | ||
} | ||
x.setAttribute('data-resources-url', resourcesUrl); | ||
x.setAttribute('data-namespace', fsNamespace); | ||
doc.head.appendChild(x); | ||
} | ||
function usePolyfills(win, location, scriptElm, dynamicImportTest) { | ||
// fyi, dev mode has verbose if/return statements | ||
// but it minifies to a nice 'lil one-liner ;) | ||
if (location.search.indexOf('core=esm') > 0) { | ||
// force esm build | ||
return false; | ||
} | ||
if ((location.search.indexOf('core=es5') > 0) || | ||
(location.protocol === 'file:') || | ||
(!(win.customElements && win.customElements.define)) || | ||
(!win.fetch) || | ||
(!(win.CSS && win.CSS.supports && win.CSS.supports('color', 'var(--c)'))) || | ||
(!('noModule' in scriptElm))) { | ||
// es5 build w/ polyfills | ||
return true; | ||
} | ||
// final test to see if this browser support dynamic imports | ||
return doesNotSupportsDynamicImports(dynamicImportTest); | ||
} | ||
function doesNotSupportsDynamicImports(dynamicImportTest) { | ||
try { | ||
new Function(dynamicImportTest); | ||
return false; | ||
} | ||
catch (e) { } | ||
return true; | ||
} | ||
function createComponentOnReadyPrototype(win, namespace, HTMLElementPrototype) { | ||
(win['s-apps'] = win['s-apps'] || []).push(namespace); | ||
if (!HTMLElementPrototype.componentOnReady) { | ||
HTMLElementPrototype.componentOnReady = function componentOnReady() { | ||
/*tslint:disable*/ | ||
var elm = this; | ||
function executor(resolve) { | ||
if (elm.nodeName.indexOf('-') > 0) { | ||
// window hasn't loaded yet and there's a | ||
// good chance this is a custom element | ||
var apps = win['s-apps']; | ||
var appsReady = 0; | ||
// loop through all the app namespaces | ||
for (var i = 0; i < apps.length; i++) { | ||
// see if this app has "componentOnReady" setup | ||
if (win[apps[i]].componentOnReady) { | ||
// this app's core has loaded call its "componentOnReady" | ||
if (win[apps[i]].componentOnReady(elm, resolve)) { | ||
// this component does belong to this app and would | ||
// have fired off the resolve fn | ||
// let's stop here, we're good | ||
return; | ||
} | ||
appsReady++; | ||
} | ||
} | ||
if (appsReady < apps.length) { | ||
// not all apps are ready yet | ||
// add it to the queue to be figured out when they are | ||
(win['s-cr'] = win['s-cr'] || []).push([elm, resolve]); | ||
return; | ||
} | ||
} | ||
// not a recognized app component | ||
resolve(null); | ||
} | ||
// callback wasn't provided, let's return a promise | ||
if (win.Promise) { | ||
// use native/polyfilled promise | ||
return new win.Promise(executor); | ||
} | ||
// promise may not have been polyfilled yet | ||
return { then: executor }; | ||
}; | ||
} | ||
} | ||
init(win, doc, namespace, fsNamespace, resourcesUrl, appCore, appCoreSsr, appCorePolyfilled, hydratedCssClass, components); | ||
})(window, document, "DdbWidget","ddb-widget","https://unpkg.com/@charlietango/ddb-widget/dist/ddb-widget/","ddb-widget.core.js","es5-build-disabled.js","hydrated","ddb-widget,link-list,widget-launcher,widget-window",HTMLElement.prototype); | ||
!function(e,t,r,i,n,s,d,o,c,a,u,l,p,h){for(u=e.DdbWidget=e.DdbWidget||{},(l=t.createElement("style")).innerHTML=c+"{visibility:hidden}.hydrated{visibility:inherit}",l.setAttribute("data-styles",""),p=t.head.querySelector("meta[charset]"),t.head.insertBefore(l,p?p.nextSibling:t.head.firstChild),function(e,t,r){(e["s-apps"]=e["s-apps"]||[]).push("DdbWidget"),r.componentOnReady||(r.componentOnReady=function(){var t=this;function r(r){if(t.nodeName.indexOf("-")>0){for(var i=e["s-apps"],n=0,s=0;s<i.length;s++)if(e[i[s]].componentOnReady){if(e[i[s]].componentOnReady(t,r))return;n++}if(n<i.length)return void(e["s-cr"]=e["s-cr"]||[]).push([t,r])}r(null)}return e.Promise?new e.Promise(r):{then:r}})}(e,0,a),n=n||u.resourcesUrl,l=(p=t.querySelectorAll("script")).length-1;l>=0&&!(h=p[l]).src&&!h.hasAttribute("data-resources-url");l--);p=h.getAttribute("data-resources-url"),!n&&p&&(n=p),!n&&h.src&&(n=(p=h.src.split("/").slice(0,-1)).join("/")+(p.length?"/":"")+"ddb-widget/"),l=t.createElement("script"),function(e,t,r,i){return!(t.search.indexOf("core=esm")>0)&&(!(!(t.search.indexOf("core=es5")>0||"file:"===t.protocol)&&e.customElements&&e.customElements.define&&e.fetch&&e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")&&"noModule"in r)||function(e){try{return new Function('import("")'),!1}catch(e){}return!0}())}(e,e.location,l)?l.src=n+"ddb-widget.ess0frvv.js":(l.src=n+"ddb-widget.4g8wntc2.js",l.setAttribute("type","module"),l.setAttribute("crossorigin",!0)),l.setAttribute("data-resources-url",n),l.setAttribute("data-namespace","ddb-widget"),t.head.appendChild(l)}(window,document,0,0,"https://unpkg.com/@charlietango/ddb-widget/dist/ddb-widget/",0,0,0,"ddb-widget,link-list,widget-launcher,widget-window",HTMLElement.prototype); |
{ | ||
"name": "@charlietango/ddb-widget", | ||
"version": "0.1.31", | ||
"version": "0.1.32", | ||
"description": "Web Component built with Stencil by Charlie Tango", | ||
@@ -5,0 +5,0 @@ "module": "dist/esm/index.js", |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
518917
60
4583
21
11