@stencil/core 3.0.0-alpha.1 → 3.0.0-alpha.2
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/cli/config-flags.d.ts +16 -16
- package/cli/index.cjs +5 -4
- package/cli/index.js +5 -4
- package/cli/package.json +1 -1
- package/compiler/lib.dom.d.ts +308 -70
- package/compiler/lib.dom.iterable.d.ts +6 -2
- package/compiler/lib.es2015.promise.d.ts +9 -4
- package/compiler/lib.es2015.proxy.d.ts +1 -1
- package/compiler/lib.es2015.reflect.d.ts +25 -2
- package/compiler/lib.es2015.symbol.wellknown.d.ts +3 -3
- package/compiler/lib.es2019.d.ts +1 -0
- package/compiler/lib.es2019.intl.d.ts +25 -0
- package/compiler/lib.es2020.intl.d.ts +1 -1
- package/compiler/lib.es5.d.ts +26 -13
- package/compiler/lib.webworker.d.ts +266 -30
- package/compiler/lib.webworker.iterable.d.ts +10 -2
- package/compiler/package.json +1 -1
- package/compiler/stencil.d.ts +1 -23
- package/compiler/stencil.js +1372 -303
- package/compiler/stencil.min.js +2 -2
- package/compiler/sys/in-memory-fs.d.ts +3 -3
- package/compiler/transpile.d.ts +32 -0
- package/dependencies.json +2 -1
- package/dev-server/client/app-error.d.ts +1 -1
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/open-in-editor-api.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +2 -2
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +1 -1
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/client/patch-esm.js +1 -1
- package/internal/client/polyfills/css-shim.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/index.js +2 -2
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +4 -4
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +37 -37
- package/internal/stencil-public-compiler.d.ts +27 -27
- package/internal/stencil-public-runtime.d.ts +3 -3
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +1 -1
- package/mock-doc/index.d.ts +2 -2
- package/mock-doc/index.js +1 -1
- package/mock-doc/package.json +1 -1
- package/package.json +6 -6
- package/screenshot/package.json +1 -1
- package/sys/node/autoprefixer.js +1 -1
- package/sys/node/glob.js +1 -1
- package/sys/node/index.js +29 -42
- package/sys/node/package.json +1 -1
- package/sys/node/prompts.js +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +19 -13
- package/testing/jest/jest-preprocessor.d.ts +3 -3
- package/testing/package.json +1 -1
- package/testing/puppeteer/puppeteer-declarations.d.ts +4 -4
- package/testing/testing-utils.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r)}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@",VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return{start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t)}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else{if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s)}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value}))}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0)})),!t)return"break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return[];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t})})),t++})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o})}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors)})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return{original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return!1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t))}))}function reScope(e,t){var r=e.template.map((function(r){return"string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t)}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t)})).observe(document.head,{childList:!0})}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove()}})).catch((function(e){console.error(e)}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}))}))})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal()}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal()},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e)},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n)}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes)},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document))}("undefined"!=typeof window&&window);
|
|
1
|
+
var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},__assign.apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r)}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@",VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return{start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t)}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else{if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s)}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value}))}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0)})),!t)return"break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return[];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t})})),t++})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o})}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors)})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return{original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return!1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t))}))}function reScope(e,t){var r=e.template.map((function(r){return"string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t)}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t)})).observe(document.head,{childList:!0})}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove()}})).catch((function(e){console.error(e)}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}))}))})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal()}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal()},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e)},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n)}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes)},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document))}("undefined"!=typeof window&&window);
|
|
@@ -116,8 +116,8 @@ function hydrateApp(e, t, o, n, s) {
|
|
|
116
116
|
const t = Array.from(i).filter((e => e.parentElement));
|
|
117
117
|
return t.length > 0 ? Promise.all(t.map(g)).then(e) : m;
|
|
118
118
|
}().then(l).catch(a);
|
|
119
|
-
} catch (
|
|
120
|
-
a(
|
|
119
|
+
} catch (y) {
|
|
120
|
+
a(y);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/hydrate",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.2",
|
|
4
4
|
"description": "Stencil internal hydrate platform to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"private": true
|
|
@@ -442,12 +442,12 @@ const templateWindows = new Map, isPromise = e => !!e && ("object" == typeof e |
|
|
|
442
442
|
}, d = () => {
|
|
443
443
|
let t;
|
|
444
444
|
const r = [];
|
|
445
|
-
for (m(), h(r); e.length && "}" !== e.charAt(0) && (t = w() || A()); )
|
|
446
|
-
h(r)
|
|
445
|
+
for (m(), h(r); e.length && "}" !== e.charAt(0) && (t = w() || A()); ) r.push(t),
|
|
446
|
+
h(r);
|
|
447
447
|
return r;
|
|
448
448
|
}, m = () => u(/^\s*/), h = e => {
|
|
449
449
|
let t;
|
|
450
|
-
for (e = e || []; t = p(); )
|
|
450
|
+
for (e = e || []; t = p(); ) e.push(t);
|
|
451
451
|
return e;
|
|
452
452
|
}, p = () => {
|
|
453
453
|
const t = i();
|
|
@@ -482,7 +482,7 @@ const templateWindows = new Map, isPromise = e => !!e && ("object" == typeof e |
|
|
|
482
482
|
const e = [];
|
|
483
483
|
if (!l()) return a("missing '{'");
|
|
484
484
|
let t;
|
|
485
|
-
for (h(e); t = g(); )
|
|
485
|
+
for (h(e); t = g(); ) e.push(t), h(e);
|
|
486
486
|
return c() ? e : a("missing '}'");
|
|
487
487
|
}, C = () => {
|
|
488
488
|
let e;
|
package/internal/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.2",
|
|
4
4
|
"description": "Stencil internals only to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -132,7 +132,7 @@ export interface BuildConditionals extends Partial<BuildFeatures> {
|
|
|
132
132
|
transformTagName?: boolean;
|
|
133
133
|
attachStyles?: boolean;
|
|
134
134
|
}
|
|
135
|
-
export
|
|
135
|
+
export type ModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd' | 'commonjs' | 'esm' | 'module' | 'systemjs';
|
|
136
136
|
export interface RollupResultModule {
|
|
137
137
|
id: string;
|
|
138
138
|
}
|
|
@@ -211,8 +211,8 @@ export interface BuildStyleUpdate {
|
|
|
211
211
|
styleText: string;
|
|
212
212
|
styleMode: string;
|
|
213
213
|
}
|
|
214
|
-
export
|
|
215
|
-
export
|
|
214
|
+
export type BuildTask = any;
|
|
215
|
+
export type BuildStatus = 'pending' | 'error' | 'disabled' | 'default';
|
|
216
216
|
export interface CompilerBuildStats {
|
|
217
217
|
timestamp: string;
|
|
218
218
|
compiler: {
|
|
@@ -303,7 +303,7 @@ export interface BundleOutputChunk {
|
|
|
303
303
|
};
|
|
304
304
|
name: string;
|
|
305
305
|
}
|
|
306
|
-
export
|
|
306
|
+
export type SourceTarget = 'es5' | 'es2017' | 'latest';
|
|
307
307
|
export interface BundleEntryInputs {
|
|
308
308
|
[entryKey: string]: string;
|
|
309
309
|
}
|
|
@@ -313,7 +313,7 @@ export interface BundleEntryInputs {
|
|
|
313
313
|
* Stencil source. As a result, some types are duplicated here for Rollup that will be used within the codebase.
|
|
314
314
|
* Updates to rollup may require these typings to be updated.
|
|
315
315
|
*/
|
|
316
|
-
export
|
|
316
|
+
export type RollupResult = RollupChunkResult | RollupAssetResult;
|
|
317
317
|
export interface RollupAssetResult {
|
|
318
318
|
type: 'asset';
|
|
319
319
|
fileName: string;
|
|
@@ -346,7 +346,7 @@ export interface RollupSourceMap {
|
|
|
346
346
|
/**
|
|
347
347
|
* Result of Stencil compressing, mangling, and otherwise 'minifying' JavaScript
|
|
348
348
|
*/
|
|
349
|
-
export
|
|
349
|
+
export type OptimizeJsResult = {
|
|
350
350
|
output: string;
|
|
351
351
|
diagnostics: Diagnostic[];
|
|
352
352
|
sourceMap?: SourceMap;
|
|
@@ -399,7 +399,7 @@ export interface CollectionManifest {
|
|
|
399
399
|
compiler?: CollectionCompilerVersion;
|
|
400
400
|
bundles?: CollectionBundleManifest[];
|
|
401
401
|
}
|
|
402
|
-
export
|
|
402
|
+
export type CollectionComponentEntryPath = string;
|
|
403
403
|
export interface CollectionBundleManifest {
|
|
404
404
|
components: string[];
|
|
405
405
|
}
|
|
@@ -549,8 +549,8 @@ export interface BuildOutputFile {
|
|
|
549
549
|
name: string;
|
|
550
550
|
content: string;
|
|
551
551
|
}
|
|
552
|
-
export
|
|
553
|
-
export
|
|
552
|
+
export type OnCallback = (buildStart: CompilerBuildStart) => void;
|
|
553
|
+
export type RemoveCallback = () => boolean;
|
|
554
554
|
export interface CompilerCtx {
|
|
555
555
|
version: number;
|
|
556
556
|
activeBuildId: number;
|
|
@@ -584,7 +584,7 @@ export interface CompilerCtx {
|
|
|
584
584
|
rollupCache: Map<string, any>;
|
|
585
585
|
reset(): void;
|
|
586
586
|
}
|
|
587
|
-
export
|
|
587
|
+
export type NodeMap = WeakMap<any, ComponentCompilerMeta>;
|
|
588
588
|
/** Must be serializable to JSON!! */
|
|
589
589
|
export interface ComponentCompilerFeatures {
|
|
590
590
|
hasAttribute: boolean;
|
|
@@ -681,7 +681,7 @@ export interface ComponentCompilerLegacyContext {
|
|
|
681
681
|
name: string;
|
|
682
682
|
context: string;
|
|
683
683
|
}
|
|
684
|
-
export
|
|
684
|
+
export type Encapsulation = 'shadow' | 'scoped' | 'none';
|
|
685
685
|
/**
|
|
686
686
|
* Intermediate Representation (IR) of a static property on a Stencil component
|
|
687
687
|
*/
|
|
@@ -708,7 +708,7 @@ export interface ComponentCompilerVirtualProperty {
|
|
|
708
708
|
type: string;
|
|
709
709
|
docs: string;
|
|
710
710
|
}
|
|
711
|
-
export
|
|
711
|
+
export type ComponentCompilerPropertyType = 'any' | 'string' | 'boolean' | 'number' | 'unknown';
|
|
712
712
|
export interface ComponentCompilerPropertyComplexType {
|
|
713
713
|
original: string;
|
|
714
714
|
resolved: string;
|
|
@@ -722,7 +722,7 @@ export interface ComponentCompilerPropertyComplexType {
|
|
|
722
722
|
*
|
|
723
723
|
* Note any key can be a user defined type or a TypeScript standard type.
|
|
724
724
|
*/
|
|
725
|
-
export
|
|
725
|
+
export type ComponentCompilerTypeReferences = Record<string, ComponentCompilerTypeReference>;
|
|
726
726
|
/**
|
|
727
727
|
* Describes a reference to a type used by a component.
|
|
728
728
|
*/
|
|
@@ -862,7 +862,7 @@ export interface ComponentTestingConstructor extends ComponentConstructor {
|
|
|
862
862
|
export interface ComponentNativeConstructor extends ComponentConstructor {
|
|
863
863
|
cmpMeta: ComponentRuntimeMeta;
|
|
864
864
|
}
|
|
865
|
-
export
|
|
865
|
+
export type ComponentConstructorEncapsulation = 'shadow' | 'scoped' | 'none';
|
|
866
866
|
export interface ComponentConstructorProperties {
|
|
867
867
|
[propName: string]: ComponentConstructorProperty;
|
|
868
868
|
}
|
|
@@ -876,7 +876,7 @@ export interface ComponentConstructorProperty {
|
|
|
876
876
|
type?: ComponentConstructorPropertyType;
|
|
877
877
|
watchCallbacks?: string[];
|
|
878
878
|
}
|
|
879
|
-
export
|
|
879
|
+
export type ComponentConstructorPropertyType = StringConstructor | BooleanConstructor | NumberConstructor | 'string' | 'boolean' | 'number';
|
|
880
880
|
export interface ComponentConstructorEvent {
|
|
881
881
|
name: string;
|
|
882
882
|
method: string;
|
|
@@ -961,7 +961,7 @@ export interface DevServerMessage {
|
|
|
961
961
|
status: number;
|
|
962
962
|
};
|
|
963
963
|
}
|
|
964
|
-
export
|
|
964
|
+
export type DevServerSendMessage = (msg: DevServerMessage) => void;
|
|
965
965
|
export interface DevServerContext {
|
|
966
966
|
connectorHtml: string;
|
|
967
967
|
dirTemplate: string;
|
|
@@ -975,7 +975,7 @@ export interface DevServerContext {
|
|
|
975
975
|
serve500: (req: any, res: any, error: any, xSource: string) => void;
|
|
976
976
|
sys: CompilerSystem;
|
|
977
977
|
}
|
|
978
|
-
export
|
|
978
|
+
export type InitServerProcess = (sendMsg: (msg: DevServerMessage) => void) => (msg: DevServerMessage) => void;
|
|
979
979
|
export interface DevResponseHeaders {
|
|
980
980
|
'cache-control'?: string;
|
|
981
981
|
expires?: string;
|
|
@@ -1155,7 +1155,7 @@ export interface MinifyJsResult {
|
|
|
1155
1155
|
pos: number;
|
|
1156
1156
|
};
|
|
1157
1157
|
}
|
|
1158
|
-
export
|
|
1158
|
+
export type ModuleMap = Map<string, Module>;
|
|
1159
1159
|
/**
|
|
1160
1160
|
* Stencil's Intermediate Representation (IR) of a module, bundling together
|
|
1161
1161
|
* various pieces of information like the classes declared within it, the path
|
|
@@ -1320,13 +1320,13 @@ export interface RenderNode extends HostElement {
|
|
|
1320
1320
|
*/
|
|
1321
1321
|
['s-en']?: '' | /*shadow*/ 'c';
|
|
1322
1322
|
}
|
|
1323
|
-
export
|
|
1324
|
-
export
|
|
1323
|
+
export type LazyBundlesRuntimeData = LazyBundleRuntimeData[];
|
|
1324
|
+
export type LazyBundleRuntimeData = [
|
|
1325
1325
|
/** bundleIds */
|
|
1326
1326
|
string,
|
|
1327
1327
|
ComponentRuntimeMetaCompact[]
|
|
1328
1328
|
];
|
|
1329
|
-
export
|
|
1329
|
+
export type ComponentRuntimeMetaCompact = [
|
|
1330
1330
|
/** flags */
|
|
1331
1331
|
number,
|
|
1332
1332
|
/** tagname */
|
|
@@ -1392,7 +1392,7 @@ export interface ComponentRuntimeMembers {
|
|
|
1392
1392
|
* this is intended to store are documented in the {@link MEMBER_FLAGS} enum.
|
|
1393
1393
|
* 2. The attribute name to observe.
|
|
1394
1394
|
*/
|
|
1395
|
-
export
|
|
1395
|
+
export type ComponentRuntimeMember = [number, string?];
|
|
1396
1396
|
/**
|
|
1397
1397
|
* A tuple holding information about a host listener which is relevant at
|
|
1398
1398
|
* runtime. The field are:
|
|
@@ -1402,7 +1402,7 @@ export declare type ComponentRuntimeMember = [number, string?];
|
|
|
1402
1402
|
* 2. The event name.
|
|
1403
1403
|
* 3. The method name.
|
|
1404
1404
|
*/
|
|
1405
|
-
export
|
|
1405
|
+
export type ComponentRuntimeHostListener = [number, string, string];
|
|
1406
1406
|
/**
|
|
1407
1407
|
* A tuple containing information about props which are "reflected" at runtime,
|
|
1408
1408
|
* meaning that HTML attributes on the component instance are kept in sync with
|
|
@@ -1413,12 +1413,12 @@ export declare type ComponentRuntimeHostListener = [number, string, string];
|
|
|
1413
1413
|
* 1. the prop name
|
|
1414
1414
|
* 2. the prop attribute.
|
|
1415
1415
|
*/
|
|
1416
|
-
export
|
|
1417
|
-
export
|
|
1416
|
+
export type ComponentRuntimeReflectingAttr = [string, string | undefined];
|
|
1417
|
+
export type ModeBundleId = ModeBundleIds | string;
|
|
1418
1418
|
export interface ModeBundleIds {
|
|
1419
1419
|
[modeName: string]: string;
|
|
1420
1420
|
}
|
|
1421
|
-
export
|
|
1421
|
+
export type RuntimeRef = HostElement | {};
|
|
1422
1422
|
/**
|
|
1423
1423
|
* Interface used to track an Element, it's virtual Node (`VNode`), and other data
|
|
1424
1424
|
*/
|
|
@@ -1451,11 +1451,11 @@ export interface PlatformRuntime {
|
|
|
1451
1451
|
rel: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
1452
1452
|
ce: (eventName: string, opts?: any) => CustomEvent;
|
|
1453
1453
|
}
|
|
1454
|
-
export
|
|
1455
|
-
export
|
|
1456
|
-
export
|
|
1457
|
-
export
|
|
1458
|
-
export
|
|
1454
|
+
export type RefMap = WeakMap<any, HostRef>;
|
|
1455
|
+
export type StyleMap = Map<string, CSSStyleSheet | string>;
|
|
1456
|
+
export type RootAppliedStyleMap = WeakMap<Element, Set<string>>;
|
|
1457
|
+
export type AppliedStyleMap = Set<string>;
|
|
1458
|
+
export type ActivelyProcessingCmpMap = Set<Element>;
|
|
1459
1459
|
export interface ScreenshotConnector {
|
|
1460
1460
|
initBuild(opts: ScreenshotConnectorOptions): Promise<void>;
|
|
1461
1461
|
completeBuild(masterBuild: ScreenshotBuild): Promise<ScreenshotBuildResults>;
|
|
@@ -2107,7 +2107,7 @@ export interface TypesModule {
|
|
|
2107
2107
|
jsx: string;
|
|
2108
2108
|
element: string;
|
|
2109
2109
|
}
|
|
2110
|
-
export
|
|
2110
|
+
export type TypeInfo = {
|
|
2111
2111
|
name: string;
|
|
2112
2112
|
type: string;
|
|
2113
2113
|
optional: boolean;
|
|
@@ -2125,8 +2125,8 @@ export interface Hyperscript {
|
|
|
2125
2125
|
(sel: any, data: VNodeData, children: Array<VNode | undefined | null>): VNode;
|
|
2126
2126
|
(sel: any, data: VNodeData, children: VNode): VNode;
|
|
2127
2127
|
}
|
|
2128
|
-
export
|
|
2129
|
-
export
|
|
2128
|
+
export type ChildType = VNode | number | string;
|
|
2129
|
+
export type PropsType = VNodeProdData | number | string | null;
|
|
2130
2130
|
export interface VNodeProdData {
|
|
2131
2131
|
key?: string | number;
|
|
2132
2132
|
class?: {
|
|
@@ -2164,7 +2164,7 @@ export interface CompilerWorkerTask {
|
|
|
2164
2164
|
reject: (msg: string) => any;
|
|
2165
2165
|
retries?: number;
|
|
2166
2166
|
}
|
|
2167
|
-
export
|
|
2167
|
+
export type WorkerMsgHandler = (msgToWorker: MsgToWorker) => Promise<any>;
|
|
2168
2168
|
export interface WorkerTask {
|
|
2169
2169
|
taskId: number;
|
|
2170
2170
|
method: string;
|
|
@@ -2183,7 +2183,7 @@ export interface WorkerMessage {
|
|
|
2183
2183
|
error?: string;
|
|
2184
2184
|
exit?: boolean;
|
|
2185
2185
|
}
|
|
2186
|
-
export
|
|
2186
|
+
export type WorkerRunner = (methodName: string, args: any[]) => Promise<any>;
|
|
2187
2187
|
export interface WorkerRunnerOptions {
|
|
2188
2188
|
isLongRunningTask?: boolean;
|
|
2189
2189
|
workerKey?: string;
|
|
@@ -2217,7 +2217,7 @@ export interface TerminalInfo {
|
|
|
2217
2217
|
/**
|
|
2218
2218
|
* The task to run in order to collect the duration data point.
|
|
2219
2219
|
*/
|
|
2220
|
-
export
|
|
2220
|
+
export type TelemetryCallback = (...args: any[]) => void | Promise<void>;
|
|
2221
2221
|
/**
|
|
2222
2222
|
* The model for the data that's tracked.
|
|
2223
2223
|
*/
|
|
@@ -351,12 +351,12 @@ export interface Config extends StencilConfig {
|
|
|
351
351
|
* conforming to a given interface. For best results, pair with a validation
|
|
352
352
|
* function as shown in the example.
|
|
353
353
|
*/
|
|
354
|
-
|
|
354
|
+
type Loose<T extends Object> = Record<string, any> & Partial<T>;
|
|
355
355
|
/**
|
|
356
356
|
* A Loose version of the Config interface. This is intended to let us load a partial config
|
|
357
357
|
* and have type information carry though as we construct an object which is a valid `Config`.
|
|
358
358
|
*/
|
|
359
|
-
export
|
|
359
|
+
export type UnvalidatedConfig = Loose<Config>;
|
|
360
360
|
/**
|
|
361
361
|
* Helper type to strip optional markers from keys in a type, while preserving other type information for the key.
|
|
362
362
|
* This type takes a union of keys, K, in type T to allow for the type T to be gradually updated.
|
|
@@ -366,20 +366,20 @@ export declare type UnvalidatedConfig = Loose<Config>;
|
|
|
366
366
|
* type ReqFieldFoo = RequireFields<Foo, 'bar'>; // { bar: number, baz?: string }
|
|
367
367
|
* ```
|
|
368
368
|
*/
|
|
369
|
-
|
|
369
|
+
type RequireFields<T, K extends keyof T> = T & {
|
|
370
370
|
[P in K]-?: T[P];
|
|
371
371
|
};
|
|
372
372
|
/**
|
|
373
373
|
* Fields in {@link Config} to make required for {@link ValidatedConfig}
|
|
374
374
|
*/
|
|
375
|
-
|
|
375
|
+
type StrictConfigFields = 'flags' | 'logger' | 'outputTargets' | 'rootDir' | 'sys' | 'testing';
|
|
376
376
|
/**
|
|
377
377
|
* A version of {@link Config} that makes certain fields required. This type represents a valid configuration entity.
|
|
378
378
|
* When a configuration is received by the user, it is a bag of unverified data. In order to make stricter guarantees
|
|
379
379
|
* about the data from a type-safety perspective, this type is intended to be used throughout the codebase once
|
|
380
380
|
* validations have occurred at runtime.
|
|
381
381
|
*/
|
|
382
|
-
export
|
|
382
|
+
export type ValidatedConfig = RequireFields<Config, StrictConfigFields>;
|
|
383
383
|
export interface HydratedFlag {
|
|
384
384
|
/**
|
|
385
385
|
* Defaults to `hydrated`.
|
|
@@ -533,8 +533,8 @@ export interface DevServerEditor {
|
|
|
533
533
|
supported?: boolean;
|
|
534
534
|
priority?: number;
|
|
535
535
|
}
|
|
536
|
-
export
|
|
537
|
-
export
|
|
536
|
+
export type TaskCommand = 'build' | 'docs' | 'generate' | 'g' | 'help' | 'info' | 'prerender' | 'serve' | 'telemetry' | 'test' | 'version';
|
|
537
|
+
export type PageReloadStrategy = 'hmr' | 'pageReload' | null;
|
|
538
538
|
/**
|
|
539
539
|
* The prerender config is used when prerendering a `www` output target.
|
|
540
540
|
* Within `stencil.config.ts`, set the path to the prerendering
|
|
@@ -1225,7 +1225,7 @@ export interface HmrStyleUpdate {
|
|
|
1225
1225
|
styleTag: string;
|
|
1226
1226
|
styleText: string;
|
|
1227
1227
|
}
|
|
1228
|
-
export
|
|
1228
|
+
export type BuildOnEventRemove = () => boolean;
|
|
1229
1229
|
export interface BuildEvents extends BuildOnEvents, BuildEmitEvents {
|
|
1230
1230
|
unsubscribeAll(): void;
|
|
1231
1231
|
}
|
|
@@ -1233,19 +1233,19 @@ export interface CompilerBuildStart {
|
|
|
1233
1233
|
buildId: number;
|
|
1234
1234
|
timestamp: string;
|
|
1235
1235
|
}
|
|
1236
|
-
export
|
|
1237
|
-
export
|
|
1238
|
-
export
|
|
1239
|
-
export
|
|
1240
|
-
export
|
|
1241
|
-
export
|
|
1242
|
-
export
|
|
1243
|
-
export
|
|
1244
|
-
export
|
|
1245
|
-
export
|
|
1246
|
-
export
|
|
1247
|
-
export
|
|
1248
|
-
export
|
|
1236
|
+
export type CompilerFileWatcherCallback = (fileName: string, eventKind: CompilerFileWatcherEvent) => void;
|
|
1237
|
+
export type CompilerFileWatcherEvent = CompilerEventFileAdd | CompilerEventFileDelete | CompilerEventFileUpdate | CompilerEventDirAdd | CompilerEventDirDelete;
|
|
1238
|
+
export type CompilerEventName = CompilerEventFsChange | CompilerEventFileUpdate | CompilerEventFileAdd | CompilerEventFileDelete | CompilerEventDirAdd | CompilerEventDirDelete | CompilerEventBuildStart | CompilerEventBuildFinish | CompilerEventBuildNoChange | CompilerEventBuildLog;
|
|
1239
|
+
export type CompilerEventFsChange = 'fsChange';
|
|
1240
|
+
export type CompilerEventFileUpdate = 'fileUpdate';
|
|
1241
|
+
export type CompilerEventFileAdd = 'fileAdd';
|
|
1242
|
+
export type CompilerEventFileDelete = 'fileDelete';
|
|
1243
|
+
export type CompilerEventDirAdd = 'dirAdd';
|
|
1244
|
+
export type CompilerEventDirDelete = 'dirDelete';
|
|
1245
|
+
export type CompilerEventBuildStart = 'buildStart';
|
|
1246
|
+
export type CompilerEventBuildFinish = 'buildFinish';
|
|
1247
|
+
export type CompilerEventBuildLog = 'buildLog';
|
|
1248
|
+
export type CompilerEventBuildNoChange = 'buildNoChange';
|
|
1249
1249
|
export interface CompilerFileWatcher {
|
|
1250
1250
|
close(): void | Promise<void>;
|
|
1251
1251
|
}
|
|
@@ -1659,7 +1659,7 @@ export interface EmulateViewport {
|
|
|
1659
1659
|
* in this array without good reason!
|
|
1660
1660
|
*/
|
|
1661
1661
|
export declare const LOG_LEVELS: readonly ["debug", "info", "warn", "error"];
|
|
1662
|
-
export
|
|
1662
|
+
export type LogLevel = typeof LOG_LEVELS[number];
|
|
1663
1663
|
/**
|
|
1664
1664
|
* Common logger to be used by the compiler, dev-server and CLI. The CLI will use a
|
|
1665
1665
|
* NodeJS based console logging and colors, and the web will use browser based
|
|
@@ -1873,7 +1873,7 @@ export declare const CustomElementsExportBehaviorOptions: readonly ["default", "
|
|
|
1873
1873
|
* This type is auto-generated based on the values in `CustomElementsExportBehaviorOptions` array.
|
|
1874
1874
|
* This is used on the output target config for intellisense in typed configs.
|
|
1875
1875
|
*/
|
|
1876
|
-
export
|
|
1876
|
+
export type CustomElementsExportBehavior = typeof CustomElementsExportBehaviorOptions[number];
|
|
1877
1877
|
export interface OutputTargetDistCustomElements extends OutputTargetBaseNext {
|
|
1878
1878
|
type: 'dist-custom-elements';
|
|
1879
1879
|
empty?: boolean;
|
|
@@ -1917,7 +1917,7 @@ export interface OutputTargetBase {
|
|
|
1917
1917
|
*/
|
|
1918
1918
|
type: string;
|
|
1919
1919
|
}
|
|
1920
|
-
export
|
|
1920
|
+
export type OutputTargetBuild = OutputTargetDistCollection | OutputTargetDistLazy;
|
|
1921
1921
|
export interface OutputTargetCopy extends OutputTargetBase {
|
|
1922
1922
|
type: 'copy';
|
|
1923
1923
|
dir: string;
|
|
@@ -1997,7 +1997,7 @@ export interface OutputTargetWww extends OutputTargetBase {
|
|
|
1997
1997
|
serviceWorker?: ServiceWorkerConfig | null | false;
|
|
1998
1998
|
appDir?: string;
|
|
1999
1999
|
}
|
|
2000
|
-
export
|
|
2000
|
+
export type OutputTarget = OutputTargetCopy | OutputTargetCustom | OutputTargetDist | OutputTargetDistCollection | OutputTargetDistCustomElements | OutputTargetDistCustomElementsBundle | OutputTargetDistLazy | OutputTargetDistGlobalStyles | OutputTargetDistLazyLoader | OutputTargetDocsJson | OutputTargetDocsCustom | OutputTargetDocsReadme | OutputTargetDocsVscode | OutputTargetWww | OutputTargetHydrate | OutputTargetStats | OutputTargetDistTypes;
|
|
2001
2001
|
export interface ServiceWorkerConfig {
|
|
2002
2002
|
unregister?: boolean;
|
|
2003
2003
|
swDest?: string;
|
|
@@ -2136,7 +2136,7 @@ export interface OptimizeCssInput {
|
|
|
2136
2136
|
* Instead, this basically just serves as a label type to track
|
|
2137
2137
|
* that arguments are being passed consistently.
|
|
2138
2138
|
*/
|
|
2139
|
-
export
|
|
2139
|
+
export type AutoprefixerOptions = Object;
|
|
2140
2140
|
/**
|
|
2141
2141
|
* Output from CSS optimization functions, wrapping up optimized
|
|
2142
2142
|
* CSS and any diagnostics produced during optimization.
|
|
@@ -2306,7 +2306,7 @@ export interface TranspileOptions {
|
|
|
2306
2306
|
*/
|
|
2307
2307
|
sys?: CompilerSystem;
|
|
2308
2308
|
}
|
|
2309
|
-
export
|
|
2309
|
+
export type CompileTarget = 'latest' | 'esnext' | 'es2020' | 'es2019' | 'es2018' | 'es2017' | 'es2015' | 'es5' | string | undefined;
|
|
2310
2310
|
export interface TranspileResults {
|
|
2311
2311
|
code: string;
|
|
2312
2312
|
data?: any[];
|
|
@@ -133,7 +133,7 @@ export interface ListenOptions {
|
|
|
133
133
|
*/
|
|
134
134
|
passive?: boolean;
|
|
135
135
|
}
|
|
136
|
-
export
|
|
136
|
+
export type ListenTargetOptions = 'body' | 'document' | 'window';
|
|
137
137
|
export interface StateDecorator {
|
|
138
138
|
(): PropertyDecorator;
|
|
139
139
|
}
|
|
@@ -214,8 +214,8 @@ export declare const State: StateDecorator;
|
|
|
214
214
|
* https://stenciljs.com/docs/reactive-data#watch-decorator
|
|
215
215
|
*/
|
|
216
216
|
export declare const Watch: WatchDecorator;
|
|
217
|
-
export
|
|
218
|
-
export
|
|
217
|
+
export type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
|
|
218
|
+
export type ErrorHandler = (err: any, element?: HTMLElement) => void;
|
|
219
219
|
/**
|
|
220
220
|
* `setMode()` is used for libraries which provide multiple "modes" for styles.
|
|
221
221
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/testing",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.2",
|
|
4
4
|
"description": "Stencil internal testing platform to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"private": true
|
package/mock-doc/index.cjs
CHANGED
package/mock-doc/index.d.ts
CHANGED
|
@@ -714,7 +714,7 @@ declare function parseHtmlToDocument(html: string, ownerDocument?: MockDocument)
|
|
|
714
714
|
declare function parseHtmlToFragment(html: string, ownerDocument?: MockDocument): any;
|
|
715
715
|
declare function parseDocumentUtil(ownerDocument: any, html: string): any;
|
|
716
716
|
declare function parseFragmentUtil(ownerDocument: any, html: string): any;
|
|
717
|
-
|
|
717
|
+
type DOMParserSupportedType = 'text/html' | 'text/xml' | 'application/xml' | 'application/xhtml+xml' | 'image/svg+xml';
|
|
718
718
|
declare class MockDOMParser {
|
|
719
719
|
parseFromString(htmlToParse: string, mimeType: DOMParserSupportedType): MockDocument;
|
|
720
720
|
}
|
|
@@ -744,7 +744,7 @@ declare class MockPerformance implements Performance {
|
|
|
744
744
|
toJSON(): void;
|
|
745
745
|
}
|
|
746
746
|
declare function resetPerformance(perf: Performance): void;
|
|
747
|
-
|
|
747
|
+
type MockRequestInfo = MockRequest | string;
|
|
748
748
|
interface MockRequestInit {
|
|
749
749
|
body?: any;
|
|
750
750
|
cache?: string;
|
package/mock-doc/index.js
CHANGED
package/mock-doc/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./internal/stencil-core/index.cjs",
|
|
6
6
|
"module": "./internal/stencil-core/index.js",
|
|
@@ -103,10 +103,10 @@
|
|
|
103
103
|
"jest-cli": "^27.4.5",
|
|
104
104
|
"jest-environment-node": "^27.4.4",
|
|
105
105
|
"listr": "^0.14.3",
|
|
106
|
-
"magic-string": "^0.
|
|
106
|
+
"magic-string": "^0.27.0",
|
|
107
107
|
"merge-source-map": "^1.1.0",
|
|
108
108
|
"mime-db": "^1.46.0",
|
|
109
|
-
"minimatch": "5.1.
|
|
109
|
+
"minimatch": "5.1.1",
|
|
110
110
|
"node-fetch": "2.6.7",
|
|
111
111
|
"open": "^8.4.0",
|
|
112
112
|
"open-in-editor": "2.2.0",
|
|
@@ -114,15 +114,15 @@
|
|
|
114
114
|
"path-browserify": "^1.0.1",
|
|
115
115
|
"pixelmatch": "5.3.0",
|
|
116
116
|
"postcss": "^8.2.8",
|
|
117
|
-
"prettier": "2.8.
|
|
117
|
+
"prettier": "2.8.1",
|
|
118
118
|
"prompts": "2.4.2",
|
|
119
119
|
"puppeteer": "^19.3.0",
|
|
120
120
|
"rollup": "2.42.3",
|
|
121
121
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
122
122
|
"semver": "^7.3.7",
|
|
123
123
|
"sizzle": "^2.3.6",
|
|
124
|
-
"terser": "5.
|
|
125
|
-
"typescript": "4.
|
|
124
|
+
"terser": "5.16.1",
|
|
125
|
+
"typescript": "4.9.4",
|
|
126
126
|
"webpack": "^4.46.0",
|
|
127
127
|
"ws": "7.4.6"
|
|
128
128
|
},
|