@jsenv/core 41.5.18 → 41.5.20
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/dist/build/build.js +55 -4
- package/dist/client/directory_listing/js/directory_listing.js +9 -9
- package/dist/client/directory_listing/jsenv_core_node_modules.js +5 -5
- package/dist/client/import_meta_css/import_meta_css_build.js +1 -1
- package/dist/client/import_meta_css/import_meta_css_dev.js +1 -1
- package/dist/start_dev_server/jsenv_core_packages.js +1 -1
- package/dist/start_dev_server/start_dev_server.js +55 -4
- package/package.json +15 -15
- package/src/plugins/import_meta_css/client/import_meta_css_build.js +1 -1
- package/src/plugins/import_meta_css/client/import_meta_css_dev.js +1 -1
- package/src/plugins/reference_analysis/js/jsenv_plugin_js_reference_analysis.js +55 -2
package/dist/build/build.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { parseHtml, injectHtmlNodeAsEarlyAsPossible, createHtmlNode, stringifyHtmlAst, applyBabelPlugins, generateUrlForInlineContent, injectJsenvScript, parseJsWithAcorn, visitHtmlNodes, analyzeScriptNode, getHtmlNodeText, getHtmlNodeAttribute, getHtmlNodePosition, getUrlForContentInsideHtml, setHtmlNodeAttributes, setHtmlNodeText, parseCssUrls, getHtmlNodeAttributePosition, parseSrcSet, removeHtmlNodeText, parseJsUrls, getUrlForContentInsideJs, renderCssTemplateLiteral, visitJsAst, getImportMetaPropertyName, visitJsAstUntil, analyzeLinkNode, findHtmlNode, removeHtmlNode, insertHtmlNodeAfter } from "@jsenv/ast";
|
|
2
|
-
import { lookupPackageDirectory, urlIsOrIsInsideOf, registerDirectoryLifecycle, urlToRelativeUrl, createDetailedMessage, stringifyUrlSite, generateContentFrame, validateResponseIntegrity, ensureWindowsDriveLetter, setUrlFilename, moveUrl, getCallerPosition, urlToBasename, urlToExtension, asSpecifierWithoutSearch, asUrlWithoutSearch, injectQueryParamsIntoSpecifier, bufferToEtag, isFileSystemPath, urlToPathname, setUrlBasename, urlToFileSystemPath, writeFileSync, createLogger, URL_META, applyNodeEsmResolution, normalizeUrl, ANSI, RUNTIME_COMPAT, CONTENT_TYPE, readPackageAtOrNull, urlToFilename, DATA_URL, errorToHTML, normalizeImportMap, composeTwoImportMaps, resolveImport, JS_QUOTES, readCustomConditionsFromProcessArgs, collectFiles, readEntryStatSync, applyFileSystemMagicResolution, getExtensionsToTry, ensurePathnameTrailingSlash, compareFileUrls, setUrlExtension, isSpecifierForNodeBuiltin, injectQueryParams, renderDetails, humanizeDuration, humanizeFileSize, renderTable, renderBigSection, distributePercentages, humanizeMemory, comparePathnames,
|
|
1
|
+
import { parseHtml, injectHtmlNodeAsEarlyAsPossible, createHtmlNode, stringifyHtmlAst, applyBabelPlugins, generateUrlForInlineContent, injectJsenvScript, parseJsWithAcorn, visitHtmlNodes, analyzeScriptNode, getHtmlNodeText, getHtmlNodeAttribute, getHtmlNodePosition, getUrlForContentInsideHtml, setHtmlNodeAttributes, setHtmlNodeText, parseCssUrls, getHtmlNodeAttributePosition, parseSrcSet, removeHtmlNodeText, parseJsUrls, hasCssOpaqueDirective, getUrlForContentInsideJs, renderCssTemplateLiteral, visitJsAst, getImportMetaPropertyName, visitJsAstUntil, analyzeLinkNode, findHtmlNode, removeHtmlNode, insertHtmlNodeAfter } from "@jsenv/ast";
|
|
2
|
+
import { lookupPackageDirectory, urlIsOrIsInsideOf, registerDirectoryLifecycle, urlToRelativeUrl, createDetailedMessage, stringifyUrlSite, generateContentFrame, validateResponseIntegrity, ensureWindowsDriveLetter, setUrlFilename, moveUrl, getCallerPosition, urlToBasename, urlToExtension, asSpecifierWithoutSearch, asUrlWithoutSearch, injectQueryParamsIntoSpecifier, bufferToEtag, isFileSystemPath, urlToPathname, setUrlBasename, urlToFileSystemPath, writeFileSync, createLogger, URL_META, applyNodeEsmResolution, normalizeUrl, ANSI, RUNTIME_COMPAT, CONTENT_TYPE, readPackageAtOrNull, urlToFilename, DATA_URL, errorToHTML, normalizeImportMap, composeTwoImportMaps, resolveImport, UNICODE, JS_QUOTES, readCustomConditionsFromProcessArgs, collectFiles, readEntryStatSync, applyFileSystemMagicResolution, getExtensionsToTry, ensurePathnameTrailingSlash, compareFileUrls, setUrlExtension, isSpecifierForNodeBuiltin, injectQueryParams, renderDetails, humanizeDuration, humanizeFileSize, renderTable, renderBigSection, distributePercentages, humanizeMemory, comparePathnames, escapeRegexpSpecialChars, injectQueryParamIntoSpecifierWithoutEncoding, renderUrlOrRelativeUrlFilename, assertAndNormalizeDirectoryUrl, Abort, raceProcessTeardownEvents, startMonitoringMemoryUsage, inferRuntimeCompatFromClosestPackage, browserDefaultRuntimeCompat, nodeDefaultRuntimeCompat, clearDirectorySync, createTaskLog, createLookupPackageDirectory, ensureEmptyDirectory, updateJsonFileSync, createDynamicLog } from "./jsenv_core_packages.js";
|
|
3
3
|
import { bundleJsModules, jsenvPluginBundling } from "@jsenv/plugin-bundling";
|
|
4
4
|
import { jsenvPluginMinification } from "@jsenv/plugin-minification";
|
|
5
5
|
import { jsenvPluginTranspilation, jsenvPluginJsModuleFallback } from "@jsenv/plugin-transpilation";
|
|
@@ -5810,7 +5810,20 @@ const parseAndTransformJsReferences = async (
|
|
|
5810
5810
|
renderCssTemplateLiteral(inlineUrlInfo.content, substitutions)
|
|
5811
5811
|
: JS_QUOTES.escapeSpecialChars(inlineUrlInfo.content, { quote });
|
|
5812
5812
|
if (replacement === null) {
|
|
5813
|
-
// a placeholder did not survive
|
|
5813
|
+
// a placeholder did not survive the css transformation: giving the
|
|
5814
|
+
// expressions back would not give back what the source said
|
|
5815
|
+
if (inlineReferenceInfo.alreadyBuilt) {
|
|
5816
|
+
return;
|
|
5817
|
+
}
|
|
5818
|
+
warnCssShippedAsWritten(urlInfo, {
|
|
5819
|
+
line: inlineReferenceInfo.line,
|
|
5820
|
+
column: inlineReferenceInfo.column,
|
|
5821
|
+
reason: `a "\${}" placeholder did not survive the css transformation`,
|
|
5822
|
+
templateSource: urlInfo.content.slice(
|
|
5823
|
+
inlineReferenceInfo.start,
|
|
5824
|
+
inlineReferenceInfo.end,
|
|
5825
|
+
),
|
|
5826
|
+
});
|
|
5814
5827
|
return;
|
|
5815
5828
|
}
|
|
5816
5829
|
magicSource.replace({
|
|
@@ -5918,7 +5931,13 @@ const parseAndTransformJsReferences = async (
|
|
|
5918
5931
|
isNodeJs,
|
|
5919
5932
|
});
|
|
5920
5933
|
for (const jsReferenceInfo of jsReferenceInfos) {
|
|
5921
|
-
if (jsReferenceInfo.
|
|
5934
|
+
if (jsReferenceInfo.isOpaqueCss) {
|
|
5935
|
+
if (!jsReferenceInfo.alreadyBuilt) {
|
|
5936
|
+
// a dependency's built css is opaque in a source this build does not
|
|
5937
|
+
// have; its own build is where that is told
|
|
5938
|
+
warnCssShippedAsWritten(urlInfo, jsReferenceInfo);
|
|
5939
|
+
}
|
|
5940
|
+
} else if (jsReferenceInfo.isInline) {
|
|
5922
5941
|
onInlineReference(jsReferenceInfo);
|
|
5923
5942
|
} else {
|
|
5924
5943
|
onExternalReference(jsReferenceInfo);
|
|
@@ -5933,6 +5952,38 @@ const parseAndTransformJsReferences = async (
|
|
|
5933
5952
|
return magicSource.toContentAndSourcemap();
|
|
5934
5953
|
};
|
|
5935
5954
|
|
|
5955
|
+
// An import.meta.css the build cannot parse is shipped exactly as written:
|
|
5956
|
+
// comments, indentation, untranspiled properties and unresolved url() included,
|
|
5957
|
+
// in this build and in every build of every consumer of what it produces.
|
|
5958
|
+
// Nothing downstream can undo it, so the only place it can be told is here.
|
|
5959
|
+
const warnCssShippedAsWritten = (
|
|
5960
|
+
urlInfo,
|
|
5961
|
+
{ line, column, reason, templateSource },
|
|
5962
|
+
) => {
|
|
5963
|
+
if (!urlInfo.context.build) {
|
|
5964
|
+
return;
|
|
5965
|
+
}
|
|
5966
|
+
if (hasCssOpaqueDirective(templateSource)) {
|
|
5967
|
+
return;
|
|
5968
|
+
}
|
|
5969
|
+
urlInfo.context.logger.warn(
|
|
5970
|
+
createDetailedMessage(
|
|
5971
|
+
`${UNICODE.WARNING} import.meta.css shipped as written: not parsed, not transpiled, not minified`,
|
|
5972
|
+
{
|
|
5973
|
+
// line/column are read from the content as analyzed, which is not the
|
|
5974
|
+
// file on disk once something transpiled it (jsx, babel helpers)
|
|
5975
|
+
"css template":
|
|
5976
|
+
urlInfo.content === urlInfo.originalContent
|
|
5977
|
+
? `${urlInfo.url}:${line}:${column}`
|
|
5978
|
+
: urlInfo.url,
|
|
5979
|
+
reason,
|
|
5980
|
+
"suggestion": `only a "\${}" standing where a css value stands can be read; a custom property set from JS, a data attribute or a selector list covers nearly every other reason to interpolate`,
|
|
5981
|
+
"to silence": `write "jsenv-css-opaque" in a css comment inside that template`,
|
|
5982
|
+
},
|
|
5983
|
+
),
|
|
5984
|
+
);
|
|
5985
|
+
};
|
|
5986
|
+
|
|
5936
5987
|
const jsenvPluginReferenceExpectedTypes = () => {
|
|
5937
5988
|
const redirectJsReference = (reference) => {
|
|
5938
5989
|
const urlObject = new URL(reference.url);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { tn, u, H, A } from "../jsenv_core_node_modules.js";
|
|
2
2
|
|
|
3
3
|
const directoryIconUrl = new URL("../other/dir.png", import.meta.url).href;
|
|
4
4
|
const fileIconUrl = new URL("../other/file.png", import.meta.url).href;
|
|
@@ -30,12 +30,12 @@ const updateDirectoryContentItems = value => {
|
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
const DirectoryListing = () => {
|
|
33
|
-
const directoryItems =
|
|
33
|
+
const directoryItems = H(callback => {
|
|
34
34
|
directoryItemsChangeCallbackSet.add(callback);
|
|
35
35
|
}, () => {
|
|
36
36
|
return directoryContentItems;
|
|
37
37
|
});
|
|
38
|
-
return u(
|
|
38
|
+
return u(A, {
|
|
39
39
|
children: [enoentDetails ? u(ErrorMessage, {}) : null, u(Breadcrumb, {
|
|
40
40
|
items: breadcrumb
|
|
41
41
|
}), u(DirectoryContent, {
|
|
@@ -53,7 +53,7 @@ const ErrorMessage = () => {
|
|
|
53
53
|
let errorSuggestion;
|
|
54
54
|
let spaExplanation = null;
|
|
55
55
|
if (spaFallbackFilePaths) {
|
|
56
|
-
spaExplanation = u(
|
|
56
|
+
spaExplanation = u(A, {
|
|
57
57
|
children: [u("strong", {
|
|
58
58
|
children: "SPA mode:"
|
|
59
59
|
}), " a url without extension is a route, served with the closest html file. None of these exists:", u("ul", {
|
|
@@ -67,7 +67,7 @@ const ErrorMessage = () => {
|
|
|
67
67
|
})]
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
errorText = u(
|
|
70
|
+
errorText = u(A, {
|
|
71
71
|
children: [u("strong", {
|
|
72
72
|
children: "File not found:"
|
|
73
73
|
}), "\xA0", u(Overflow, {
|
|
@@ -82,7 +82,7 @@ const ErrorMessage = () => {
|
|
|
82
82
|
}), " ", "does not exist on the server."]
|
|
83
83
|
})]
|
|
84
84
|
});
|
|
85
|
-
errorSuggestion = u(
|
|
85
|
+
errorSuggestion = u(A, {
|
|
86
86
|
children: [u("span", {
|
|
87
87
|
className: "icon",
|
|
88
88
|
children: "🔍"
|
|
@@ -136,7 +136,7 @@ const Breadcrumb = ({
|
|
|
136
136
|
isServerRootDirectory
|
|
137
137
|
} = navItem;
|
|
138
138
|
const isDirectory = new URL(url).pathname.endsWith("/");
|
|
139
|
-
return u(
|
|
139
|
+
return u(A, {
|
|
140
140
|
children: [u(BreadcrumbItem, {
|
|
141
141
|
url: urlRelativeToServer,
|
|
142
142
|
isCurrent: isCurrent,
|
|
@@ -231,7 +231,7 @@ const DirectoryContentItem = ({
|
|
|
231
231
|
className: "directory_content_item_text",
|
|
232
232
|
children: [u(Overflow, {
|
|
233
233
|
children: children
|
|
234
|
-
}), isDirectory ? u(
|
|
234
|
+
}), isDirectory ? u(A, {
|
|
235
235
|
children: [u("span", {
|
|
236
236
|
style: "flex:1"
|
|
237
237
|
}), u("span", {
|
|
@@ -296,4 +296,4 @@ if (autoreload) {
|
|
|
296
296
|
}
|
|
297
297
|
};
|
|
298
298
|
}
|
|
299
|
-
|
|
299
|
+
tn(u(DirectoryListing, {}), document.querySelector("#root"));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var n,l$1,t$1,i$1,r$1,f$1,e$1,o$2,c$1,s$1,a$1,h$1,v$1={},y$1=[],w$2=/(mi|mn|mo|ms$|mte|msp)/,d$1=Array.isArray,g$1=y$1.slice,_$1=Object.assign;function b(n){n&&n.parentNode&&n.remove();}function m$1(n,l,u){var t,i,r,f={};for(r in l)"key"==r?t=l[r]:"ref"==r&&"function"!=typeof n?i=l[r]:f[r]=l[r];return arguments.length>2&&(f.children=arguments.length>3?g$1.call(arguments,2):u),k$1(n,f,t,i,null)}function k$1(u,t,i,r,f){var e={type:u,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==f?++l$1:f,__i:-1,__u:0};return null==f&&null!=n.vnode&&n.vnode(e),e}function $$1(n){return n.children}function S(n,l){this.props=n,this.context=l,this.__g=0;}function x$1(n,l){if(null==l)return n.__?x$1(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?x$1(n):null}function C$2(n){if(null!=(n=n.__)&&null!=n.__c)return n.__e=null,n.__k.some(function(l){if(null!=l&&null!=l.__e)return n.__e=l.__e}),C$2(n)}function L(l){(8&l.__g||!(l.__g|=8)||!t$1.push(l)||r$1++)&&i$1==n.debounceRendering||((i$1=n.debounceRendering)||queueMicrotask)(j$1);}function j$1(){var l,u,i,e,o,c,s,a,h;try{for(u=1;t$1.length;)t$1.length>u&&t$1.sort(f$1),l=t$1.shift(),u=t$1.length,8&l.__g&&(e=void 0,o=void 0,c=(o=(i=l).__v).__e,s=[],a=[],(h=i.__P)&&((e=_$1({},o)).__v=o.__v+1,n.vnode&&n.vnode(e),V(h,e,o,i.__n,h.namespaceURI,32&o.__u?[c]:null,s,null==c?x$1(o):c,!!(32&o.__u),a,h.ownerDocument),e.__v=o.__v,e.__.__k[e.__i]=e,B$1(s,e,a),o.__=o.__e=null,e.__e!=c&&C$2(e)));}finally{t$1.length=r$1=0;}}function A$1(n,l,u,t,i,r,f,e,o,c,s,a){var h,p,w,d,g,_,b,m=t&&t.__k||y$1,k=l.length;for(o=H(u,l,m,o,k),h=0;h<k;h++)null!=(w=u.__k[h])&&(p=-1!=w.__i&&m[w.__i]||v$1,w.__i=h,_=V(n,w,p,i,r,f,e,o,c,s,a),d=w.__e,w.ref&&p.ref!=w.ref&&(p.ref&&F(p.ref,null,w),s.push(w.ref,w.__c||d,w)),null==g&&null!=d&&(g=d),(b=4&w.__u)||p.__k===w.__k?(o=I(w,o,n,b),b&&p.__e&&(p.__e=null)):"function"==typeof w.type&&void 0!==_?o=_:d&&(o=d.nextSibling),w.__u&=-7);return u.__e=g,o}function H(n,l,u,t,i){var r,f,e,o,c,s=u.length,a=s,h=0;for(n.__k=new Array(i),r=0;r<i;r++)null!=(f=l[r])&&"boolean"!=typeof f&&"function"!=typeof f?("string"==typeof f||"number"==typeof f||"bigint"==typeof f||f.constructor==String?f=n.__k[r]=k$1(null,f,null,null,null):d$1(f)?f=n.__k[r]=k$1($$1,{children:f},null,null,null):void 0===f.constructor&&f.__b>0?f=n.__k[r]=k$1(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):n.__k[r]=f,o=r+h,f.__=n,f.__b=n.__b+1,e=null,-1!=(c=f.__i=T(f,u,o,a))&&(a--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>s?h--:i<s&&h++),"function"!=typeof f.type&&(f.__u|=4)):c!=o&&(c==o-1?h--:c==o+1?h++:(c>o?h--:h++,f.__u|=4))):n.__k[r]=null;if(a)for(r=0;r<s;r++)null!=(e=u[r])&&0==(2&e.__u)&&(e.__e==t&&(t=x$1(e)),G$1(e,e));return t}function I(n,l,u,t){var i,r;if("function"==typeof n.type){for(i=n.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=n,l=I(i[r],l,u,t));return l}n.__e!=l&&(t&&(l&&n.type&&!l.parentNode&&(l=x$1(n)),u.insertBefore(n.__e,l||null)),l=n.__e);do{l=l&&l.nextSibling;}while(null!=l&&8==l.nodeType);return l}function O$1(n,l){return l=l||[],null==n||"boolean"==typeof n||(d$1(n)?n.some(function(n){O$1(n,l);}):l.push(n)),l}function T(n,l,u,t){var i,r,f,e=n.key,o=n.type,c=l[u],s=null!=c&&0==(2&c.__u);if(null===c&&null==e||s&&e==c.key&&o==c.type)return u;if(t>(s?1:0))for(i=u-1,r=u+1;i>=0||r<l.length;)if(null!=(c=l[f=i>=0?i--:r++])&&0==(2&c.__u)&&e==c.key&&o==c.type)return f;return -1}function q$1(n,l,u){"-"==l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":u;}function N$1(n,l,u,t,i){var r;n:if("style"==l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||q$1(n.style,l,"");if(u)for(l in u)t&&u[l]==t[l]||q$1(n.style,l,u[l]);}else if("o"==l[0]&&"n"==l[1])r=l!=(l=l.replace(c$1,"$1")),l=l.slice(2).toLowerCase(),n.__l||(n.__l={}),n.__l[l+r]=u,u?t?u[o$2]=t[o$2]:(u[o$2]=s$1,n.addEventListener(l,r?h$1:a$1,r)):n.removeEventListener(l,r?h$1:a$1,r);else {if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||false===u&&"-"!=l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u));}}function P$1(l){return function(u){if(this.__l){var t=this.__l[u.type+l];if(null==u[e$1])u[e$1]=s$1++;else if(u[e$1]<t[o$2])return;return t(n.event?n.event(u):u)}}}function V(l,u,t,i,r,f,e,o,c,s,a){var h,p,v,w,g,m,k,M,x,C,L,j,H,I,O,T,q,N,P,V,B,F=u.type;if(void 0!==u.constructor)return null;if(128&t.__u&&(c=32&t.__u)&&t.__c.__z){if(f=[],8==(p=t.__c.__z).nodeType)for(v=1,w=p.nextSibling;w&&v>0;w=w.nextSibling){if(8==w.nodeType)if(w.data.startsWith("$s"))v++;else if(w.data.startsWith("/$s")&&!--v)break;f.push(w);}else f.push(p);o=f[0],t.__c.__z=null;}(h=n.__b)&&h(u);n:if("function"==typeof F){g=e.length;try{if(C=u.props,L=F.prototype&&F.prototype.render,j=(h=F.contextType)&&i[h.__c],H=h?j?j.props.value:h.__:i,t.__c?2&(m=u.__c=t.__c).__g&&(m.__g|=1):(L?u.__c=m=new F(C,H):(u.__c=m=new S(C,H),m.constructor=F,m.render=J$1),j&&j.sub(m),m.state||(m.state={}),m.__n=i,m.__g|=8,m.__h=[],m._sb=[]),L&&null==m.__s&&(m.__s=m.state),L&&null!=F.getDerivedStateFromProps&&(m.__s==m.state&&(m.__s=_$1({},m.__s)),_$1(m.__s,F.getDerivedStateFromProps(C,m.__s))),k=m.props,M=m.state,m.__v=u,t.__c){if(L&&null==F.getDerivedStateFromProps&&C!==k&&null!=m.componentWillReceiveProps&&m.componentWillReceiveProps(C,H),u.__v==t.__v||!(4&m.__g)&&null!=m.shouldComponentUpdate&&!1===m.shouldComponentUpdate(C,m.__s,H)){u.__v!=t.__v&&(m.props=C,m.state=m.__s,m.__g&=-9),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u);}),y$1.push.apply(m.__h,m._sb),m._sb=[],m.__h.length&&e.push(m);break n}null!=m.componentWillUpdate&&m.componentWillUpdate(C,m.__s,H),L&&null!=m.componentDidUpdate&&m.__h.push(function(){m.componentDidUpdate(k,M,x);});}else L&&null==F.getDerivedStateFromProps&&null!=m.componentWillMount&&m.componentWillMount(),L&&null!=m.componentDidMount&&m.__h.push(m.componentDidMount);if(m.context=H,m.props=C,m.__P=l,m.__g&=-5,I=n.__r,O=0,L)m.state=m.__s,m.__g&=-9,I&&I(u),h=m.render(m.props,m.state,m.context),y$1.push.apply(m.__h,m._sb),m._sb=[];else do{m.__g&=-9,I&&I(u),h=m.render(m.props,m.state,m.context),m.state=m.__s;}while(8&m.__g&&++O<25);m.state=m.__s,null!=m.getChildContext&&(i=_$1({},i,m.getChildContext())),L&&t.__c&&null!=m.getSnapshotBeforeUpdate&&(x=m.getSnapshotBeforeUpdate(k,M)),T=null!=h&&h.type===$$1&&null==h.key?D$1(h.props.children):h,o=A$1(l,d$1(T)?T:[T],u,t,i,r,f,e,o,c,s,a),u.__u&=-161,m.__h.length&&e.push(m),2&m.__g&&(m.__g&=-4);}catch(l){if(e.length=g,u.__v=null,c||null!=f){if(l.then){if(q=0,u.__u|=c?160:128,null!=f)for(P=0;P<f.length;P++)if(null!=(V=f[P]))if(8==V.nodeType){if(V.data.startsWith("$s"))q||(N=V),q++;else if(V.data.startsWith("/$s")&&0==--q){o=V,f[P]=null;break}f[P]=null;}else q&&(f[P]=null);if(N)u.__c.__z=N;else {for(;o&&8==o.nodeType&&o.nextSibling;)o=o.nextSibling;null!=f&&(f[f.indexOf(o)]=null),u.__c.__z=o;}u.__e=o;}else if(null!=f)for(B=f.length;B--;)b(f[B]);}else u.__e=t.__e;null==u.__k&&(u.__k=t.__k||[]),l.then||z$2(u),n.__e(l,u,t);}}else o=u.__e=E(t.__e,u,t,i,r,f,e,c,s,a);return (h=n.diffed)&&h(u),128&u.__u?void 0:o}function z$2(n){n&&n.__c&&(n.__c.__g|=4),n&&n.__k&&n.__k.forEach(z$2);}function B$1(l,u,t){for(var i=0;i<t.length;i++)F(t[i],t[++i],t[++i]);n.__c&&n.__c(u,l),l.some(function(u){try{l=u.__h,u.__h=[],l.some(function(n){n.call(u);});}catch(l){n.__e(l,u.__v);}});}function D$1(n){return "object"!=typeof n||null==n||n.__b>0?n:d$1(n)?n.map(D$1):void 0!==n.constructor?null:_$1({},n)}function E(l,u,t,i,r,f,e,o,c,s){var a,h,p,y,_,m,k,M,$=t.props||v$1,S=u.props,C=u.type;if("svg"==C?r="http://www.w3.org/2000/svg":"math"==C?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=f)for(a=0;a<f.length;a++)if((_=f[a])&&"setAttribute"in _==!!C&&(C?_.localName==C:3==_.nodeType)){l=_,f[a]=null;break}if(null==l){if(null==C)return s.createTextNode(S);l=s.createElementNS(r,C,S.is&&S),o&&(n.__m&&n.__m(u,f),o=false),f=null;}if(null==C)$===S||o&&l.data==S||(l.data=S);else {if(f="textarea"==C&&null!=S.defaultValue?null:f&&g$1.call(l.childNodes),!o&&null!=f)for($={},a=0;a<l.attributes.length;a++)$[(_=l.attributes[a]).name]=_.value;for(a in $)_=$[a],"dangerouslySetInnerHTML"==a?p=_:"children"==a||a in S||"value"==a&&"defaultValue"in S||"checked"==a&&"defaultChecked"in S||N$1(l,a,null,_,r);for(a in M=1&t.__u,S)_=S[a],"children"==a?y=_:"dangerouslySetInnerHTML"==a?h=_:"value"==a?m=_:"checked"==a?k=_:o&&"function"!=typeof _||!($[a]!==_||M&&null!=_)||N$1(l,a,_,$[a],r);if(h)o||p&&(h.__html==p.__html||h.__html==l.innerHTML)||(l.innerHTML=h.__html),u.__k=[];else if(p&&(l.innerHTML=""),("foreignObject"==C||"http://www.w3.org/1998/Math/MathML"==r&&w$2.test(C))&&(r="http://www.w3.org/1999/xhtml"),A$1("template"==C?l.content:l,d$1(y)?y:[y],u,t,i,r,f,e,f?f[0]:t.__k&&x$1(t,0),o,c,s),null!=f)for(a=f.length;a--;)b(f[a]);o&&"textarea"!=C||(a="value","progress"==C&&null==m?l.removeAttribute("value"):null==m||m===l[a]&&("progress"!==C||m)||N$1(l,a,m,$[a],r),a="checked",null!=k&&k!=l[a]&&N$1(l,a,k,$[a],r));}return l}function F(l,u,t){try{"function"==typeof l?("function"==typeof l.__u&&l.__u(),"function"==typeof l.__u&&null==u||(l.__u=l(u))):l.current=u;}catch(l){n.__e(l,t);}}function G$1(l,u,t){var i,r;if(n.unmount&&n.unmount(l),!(i=l.ref)||i.current&&i.current!=l.__e||F(i,null,u),null!=(i=l.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(l){n.__e(l,u);}i.__P=i.__n=null;}if(i=l.__k)for(r=0;r<i.length;r++)i[r]&&G$1(i[r],u,t||"function"!=typeof l.type);t||b(l.__e),l.__e&&l.__e.__l&&(l.__e.__l=null),l.__e=l.__c=l.__=null;}function J$1(n,l,u){return this.constructor(n,u)}function K$1(l,u){var t,i,r,f;n.__&&n.__(l,u),9==u.nodeType&&(u=u.documentElement),i=(t=l&&32&l.__u)?null:u.__k,u.__k=m$1($$1,null,[l]),r=[],f=[],V(u,u.__k,i||v$1,v$1,u.namespaceURI,i?null:u.firstChild?g$1.call(u.childNodes):null,r,i?i.__e:u.firstChild,t,f,u.ownerDocument),B$1(r,u.__k,f),u.__k.props.children=null;}n={__e:function(n,l,u,t){for(var i,f,e;l=l.__;)if((i=l.__c)&&!(1&i.__g)){i.__g|=4;try{if((f=i.constructor)&&null!=f.getDerivedStateFromError&&(i.setState(f.getDerivedStateFromError(n)),e=8&i.__g),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),e=8&i.__g),e)return void(i.__g|=2)}catch(l){n=l;}}throw r$1=0,n}},l$1=0,S.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=_$1({},this.state),"function"==typeof n&&(n=n(_$1({},u),this.props)),n&&(_$1(u,n),this.__v&&(l&&this._sb.push(l),L(this)));},S.prototype.forceUpdate=function(n){this.__v&&(this.__g|=4,n&&this.__h.push(n),L(this));},S.prototype.render=$$1,t$1=[],r$1=0,f$1=function(n,l){return n.__v.__b-l.__v.__b},e$1=Symbol(),o$2=Symbol(),c$1=/(PointerCapture)$|Capture$/i,s$1=0,a$1=P$1(false),h$1=P$1(true);
|
|
1
|
+
var n,t$1,i$1,f$1,e$1,o$2,u$2,c$1,s$1,a$1,h$1,l$1,y$1=32,v$1="http://www.w3.org/2000/svg",_$1="http://www.w3.org/1999/xhtml",d$1="http://www.w3.org/1998/Math/MathML",w$1=null,b=void 0,k$1={},g$1=[],m$1=/^m(i|n|o|s|text|space)$/,$$1=typeof Element<"u"&&"moveBefore"in Element.prototype,S=Array.isArray,x$1=g$1.slice,M=Object.assign;function C$1(n){n&&n.parentNode&&n.remove();}function I$1(r,i,f,e,o){var u={type:r,props:i,key:f,ref:e,__k:w$1,__:w$1,__b:0,__e:w$1,__c:w$1,constructor:b,__v:o||++t$1,__i:-1,__u:0};return !o&&n.vnode&&n.vnode(u),u}function A$1(n){return n.children}function E$1(n,t){this.props=n,this.context=t,this.__g=0;}function O(n,t){if(t==w$1)return n.__?O(n.__,n.__i+1):w$1;for(var r;t<n.__k.length;t++)if((r=n.__k[t])&&r.__e)return r.__e;return "function"!=typeof n.type||n.props.__P?w$1:O(n)}function P$1(t){var r,i=t.__v,f=i.__e,e=[],o=[],u=t.__P;u&&((r=M({constructor:b},i)).__v=i.__v+1,n.vnode&&n.vnode(r),Q$1(u,r,i,t.__n,u.namespaceURI,i.__u&y$1?[f]:w$1,e,f||O(i),i.__u&y$1,o),r.__v=i.__v,r.__.__k[r.__i]=r,U(e,r,o),i.__=i.__e=w$1,r.__e!=f&&T$1(r));}function T$1(n){if((n=n.__)&&n.__c&&!n.props.__P)return n.__e=w$1,n.__k.some(function(t){return t&&(n.__e=t.__e)}),T$1(n)}function q(t){(8&t.__g||!(t.__g|=8)||!i$1.push(t)||e$1++)&&f$1==n.debounceRendering||((f$1=n.debounceRendering)||queueMicrotask)(B$2);}function B$2(){try{for(var n,t=1;i$1.length;)i$1.length>t&&i$1.sort(o$2),n=i$1.shift(),t=i$1.length,8&n.__g&&P$1(n);}finally{i$1.length=e$1=0;}}function N(n,t,r,i,f,e,o,u,c,s,a){var h,l,p,y,v,_,d=i.__k||g$1,m=t.length;for(c=V$1(r,t,d,c,m),h=0;h<m;h++)(p=r.__k[h])!=w$1&&(l=~p.__i&&d[p.__i]||k$1,p.__i=h,_=Q$1(n,p,l,f,e,o,u,c,s,a),y=p.__e,p.ref&&l.ref!=p.ref&&(l.ref&&Y(l.ref,w$1,p),a.push(p.ref,p.__c||y,p)),v=v||y,4&p.__u?(c=z$2(p,c,n,!l.__v),l.__e&&(l.__e=w$1)):"function"==typeof p.type&&_!==b?c=_:y&&(c=y.nextSibling),p.__u&=-7);return r.__e=v,c}function V$1(n,t,r,i,f){var e,o,u,c,s,a,h,l,p,y,v=r.length,_=v,d=0,k=false,g=n.__k=Array(f);for(e=0;e<f;e++)(o=t[e])!=w$1&&"boolean"!=typeof o&&"function"!=typeof o?("object"!=typeof o||o.constructor==String?o=g[e]=I$1(w$1,o):S(o)?o=g[e]=I$1(A$1,{children:o}):o.constructor===b&&o.__b?o=g[e]=I$1(o.type,o.props,o.key,o.ref,o.__v):g[e]=o,c=e+d,o.__=n,o.__b=n.__b+1,s=o.__i=F$1(o,r,c,_),u=w$1,~s&&(_--,(u=r[s])&&(u.__u|=2)),u&&u.__v?(o.__u|=2,s==c-1?d--:s==c+1?d++:s!=c&&(s>c?d--:d++,k=true)):(~s||(f>v?d--:f<v&&d++),"function"!=typeof o.type&&(o.__u|=4))):g[e]=w$1;if(k){for(a=[],h=[],e=0;e<f;e++)if((o=g[e])&&2&o.__u){for(l=0,p=a.length;l<p;)a[y=l+p>>1]<o.__i?l=y+1:p=y;a[l]=o.__i,h[e]=l+1;}for(d=a.length;e--;)h[e]&&(h[e]==d?d--:g[e].__u|=4);}if(_)for(e=0;e<v;e++)!(u=r[e])||2&u.__u||(u.__e==i&&(i=O(u)),Z$1(u,u));return i}function z$2(n,t,r,i){var f,e;if("function"==typeof n.type){if(n.props.__P)return t;if(f=n.__k)for(e=0;e<f.length;e++)f[e]&&(f[e].__=n,t=z$2(f[e],t,r,false));return t}for(n.__e!=t&&(t&&n.type&&!t.parentNode&&(t=O(n)),$$1&&!i&&n.__e.parentNode?r.moveBefore(n.__e,t):r.insertBefore(n.__e,t||w$1),t=n.__e);(t=t&&t.nextSibling)&&8==t.nodeType;);return t}function D$1(n,t){return t=t||[],n!=w$1&&"boolean"!=typeof n&&(S(n)?n.some(function(n){D$1(n,t);}):t.push(n)),t}function F$1(n,t,r,i){var f,e,o,u=n.key,c=n.type,s=t[r],a=s&&!(2&s.__u);if(s===w$1&&u==w$1||a&&u==s.key&&c==s.type)return r;if(i>(a?1:0))for(f=r-1,e=r+1;f>=0||e<t.length;)if((s=t[o=f>=0?f--:e++])&&!(2&s.__u)&&u==s.key&&c==s.type)return o;return -1}function G$2(n,t,r){r==w$1&&(r=""),"-"==t[0]?n.setProperty(t,r):n[t]=r;}function J$1(n,t,r,i,f){var e;n:if("style"==t)if("string"==typeof r)n.style.cssText=r;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(t in i)r&&t in r||G$2(n.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||G$2(n.style,t,r[t]);}else if("o"==t[0]&&"n"==t[1])e=t!=(t=t.replace(s$1,"$1")),t=t.slice(2).toLowerCase(),(n.__e||(n.__e={}))[t+e]=r,r?i?r[c$1]=i[c$1]:(r[c$1]=a$1,n.addEventListener(t,e?l$1:h$1,e)):n.removeEventListener(t,e?l$1:h$1,e);else {if(f==v$1)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in n)try{n[t]=r==w$1?"":r;break n}catch(n){}"function"==typeof r||(r==w$1||false===r&&"-"!=t[4]?n.removeAttribute(t):n.setAttribute(t,"popover"==t&&1==r?"":r));}}function K$1(t){return function(r){if(this.__e){var i=this.__e[r.type+t];if(r[u$2]==w$1)r[u$2]=a$1++;else if(r[u$2]<i[c$1])return;return i(n.event?n.event(r):r)}}}function Q$1(t,r,i,f,e,o,u,c,s,a){var h,l,p,v,_,d,k,m,$,x,j,H,I,L,P,T,q,B,V,z=r.type;if(r.constructor!==b)return w$1;if(128&i.__u&&(s=i.__u&y$1)&&(h=i.__c.__z)){if(r.__u|=y$1,o=[],8==h.nodeType)for(l=1,p=h.nextSibling;p;p=p.nextSibling){if(8==p.nodeType)if(p.data.startsWith("$s"))l++;else if(p.data.startsWith("/$s")&&! --l)break;o.push(p);}else o.push(h);c=o[0],i.__c.__z=w$1;}(h=n.__b)&&h(r);n:if("function"==typeof z){v=u.length;try{if($=r.props,x=(h=z.prototype)&&h.render,j=(h=z.contextType)&&f[h.__c],H=h?j?j.props.value:h.__:f,i.__c?2&(_=r.__c=i.__c).__g&&(_.__g|=1):(x?r.__c=_=new z($,H):(r.__c=_=new E$1($,H),_.constructor=z,_.render=nn),j&&j.sub(_),_.state||(_.state={}),_.__n=f,_.__g|=8,_.__h=[],_.__k=[]),x&&(_.__s||(_.__s=_.state),z.getDerivedStateFromProps&&(_.__s==_.state&&(_.__s=M({},_.__s)),M(_.__s,z.getDerivedStateFromProps($,_.__s)))),d=_.props,k=_.state,_.__v=r,i.__c){if(x&&!z.getDerivedStateFromProps&&$!==d&&_.componentWillReceiveProps&&_.componentWillReceiveProps($,H),r.__v==i.__v&&!(8&_.__g)||!(4&_.__g)&&_.shouldComponentUpdate&&!1===_.shouldComponentUpdate($,_.__s,H)){r.__v!=i.__v&&(_.props=$,_.state=_.__s,_.__g&=-9),r.__e=i.__e,r.__k=i.__k,r.__k.some(function(n){n&&(n.__=r);}),g$1.push.apply(_.__h,_.__k),_.__k=[],_.__h.length&&u.push(_),c=O(i);break n}_.componentWillUpdate&&_.componentWillUpdate($,_.__s,H),x&&_.componentDidUpdate&&_.__h.push(function(){_.componentDidUpdate(d,k,m);});}else x&&!z.getDerivedStateFromProps&&_.componentWillMount&&_.componentWillMount(),x&&_.componentDidMount&&_.__h.push(_.componentDidMount);if(_.context=H,_.props=$,_.__P=t,_.__g&=-5,I=n.__r,L=0,x)_.state=_.__s,_.__g&=-9,I&&I(r),h=_.render(_.props,_.state,_.context),g$1.push.apply(_.__h,_.__k),_.__k=[];else do{_.__g&=-9,I&&I(r),h=_.render(_.props,_.state,_.context),_.state=_.__s;}while(8&_.__g&&++L<25);_.state=_.__s,_.getChildContext&&(f=M({},f,_.getChildContext())),x&&i.__c&&_.getSnapshotBeforeUpdate&&(m=_.getSnapshotBeforeUpdate(d,k)),P=h&&h.type===A$1&&h.key==w$1?W$1(h.props.children):h,$.__P&&(h=c,e=(t=$.__P).namespaceURI,i.props&&i.props.__P!=t&&(i.__k.some(function(n){n&&Z$1(n,n);}),i.__k=w$1),c=i.__k?O(i,0):w$1),c=N(t,S(P)?P:[P],r,i,f,e,o,u,c,s,a),$.__P&&(r.__e=w$1,c=h),r.__u&=-161,_.__h.length&&u.push(_),1&_.__g&&(_.__g&=-4);}catch(t){if(u.length=v,r.__v=w$1,s||o)if(t.then){if(T=0,r.__u|=s?160:128,o)for(B=0;B<o.length;B++)if(V=o[B])if(8==V.nodeType){if(o[B]=w$1,V.data.startsWith("$s"))T++||(q=V);else if(V.data.startsWith("/$s")&&! --T){c=V;break}}else T&&(o[B]=w$1);if(!q){for(;c&&8==c.nodeType&&c.nextSibling;)c=c.nextSibling;o&&(o[o.indexOf(c)]=w$1),q=c;}r.__c.__z=q,r.__e=c;}else o&&o.some(C$1);else r.__e=i.__e;r.__k||(r.__k=i.__k||[]),t.then||R$1(r),n.__e(t,r,i);}}else c=r.__e=X(i.__e,r,i,f,e,o,u,s,a,t);return (h=n.diffed)&&h(r),128&r.__u?b:c}function R$1(n){n&&(n.__c&&(n.__c.__g|=4),n.__k&&n.__k.some(R$1));}function U(t,r,i){for(var f=0;f<i.length;)Y(i[f++],i[f++],i[f++]);n.__c&&n.__c(r,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(n){n.call(r);});}catch(t){n.__e(t,r.__v);}});}function W$1(n){return "object"!=typeof n||n==w$1||n.__b?n:S(n)?n.map(W$1):n.constructor!==b?w$1:M({constructor:b},n)}function X(t,r,i,f,e,o,u,c,s,a){var h,l,p,y,g,$,M,j,H,I=i.props||k$1,L=r.props,A=r.type;if("svg"==A?e=v$1:"math"==A?e=d$1:e||(e=_$1),o)for(h=0;h<o.length;h++)if((g=o[h])&&(A?g.localName==A:3==g.nodeType)){t=g,o[h]=w$1;break}if(!t){if(j=a.ownerDocument,!A)return j.createTextNode(L);t=j.createElementNS(e,A,L.is&&L),c&&(n.__m&&n.__m(r,o),c=false),o=w$1;}if(A){if(a="template"==A?t.content:t,o="textarea"==A&&L.defaultValue!=w$1?w$1:o&&x$1.call(a.childNodes),!c&&o)for(I={},h=0;h<t.attributes.length;h++)I[(g=t.attributes[h]).name]=g.value;for(h in I)g=I[h],"dangerouslySetInnerHTML"==h?p=g:"children"==h||h in L||"value"==h&&"defaultValue"in L||"checked"==h&&"defaultChecked"in L||J$1(t,h,w$1,g,e);for(h in H=1&i.__u,L)g=L[h],"children"==h?y=g:"dangerouslySetInnerHTML"==h?l=g:"value"==h?$=g:"checked"==h?M=g:c&&"function"!=typeof g||!(I[h]!==g||H&&g!=w$1)||J$1(t,h,g,I[h],e);l?(c||p&&(l.__html==p.__html||l.__html==t.innerHTML)||(t.innerHTML=l.__html),r.__k=[]):(p&&(t.textContent=""),("foreignObject"==A||e==d$1&&m$1.test(A))&&(e=_$1),N(a,S(y)?y:[y],r,i,f,e,o,u,o?o[0]:i.__k&&O(i,0),c,s),o&&o.some(C$1)),c&&"textarea"!=A||(h="value","progress"==A&&$==w$1?t.removeAttribute(h):$==b||$===t[h]&&("progress"!=A||$)||J$1(t,h,$,I[h],e),h="checked",M!=b&&M!=t[h]&&J$1(t,h,M,I[h],e));}else I===L||c&&t.data==L||(t.data=L);return t}function Y(t,r,i){try{"function"==typeof t?("function"==typeof t.__u&&t.__u(),("function"!=typeof t.__u||r)&&(t.__u=t(r))):t.current=r;}catch(t){n.__e(t,i);}}function Z$1(t,r,i){var f,e;if(n.unmount&&n.unmount(t),!(f=t.ref)||f.current&&f.current!=t.__e||Y(f,w$1,r),f=t.__c){if(f.componentWillUnmount)try{f.componentWillUnmount();}catch(t){n.__e(t,r);}f.__P=f.__n=w$1;}if(f=t.__k)for(e=0;e<f.length;e++)f[e]&&Z$1(f[e],r,"function"!=typeof t.type||i&&!t.props.__P);(f=t.__e)&&(i||C$1(f),f.__e&&(f.__e=w$1)),t.__e=t.__c=t.__=w$1;}function nn(n,t,r){return this.constructor(n,r)}function tn(t,r){var i,f,e,o;n.__&&n.__(t,r),9==r.nodeType&&(r=r.documentElement),f=(i=t&&t.__u&y$1)?w$1:r.__k,r.__k=I$1(A$1,{children:[t]}),e=[],o=[],Q$1(r,r.__k,f||k$1,k$1,r.namespaceURI,f?w$1:r.firstChild?x$1.call(r.childNodes):w$1,e,f?f.__e:r.firstChild,i,o),U(e,r.__k,o),r.__k.props.children=w$1;}n={__e:function(n,t,r,i){for(var f,o,u;t=t.__;)if((f=t.__c)&&!(1&f.__g)){f.__g|=4;try{if((o=f.constructor)&&o.getDerivedStateFromError&&(f.setState(o.getDerivedStateFromError(n)),u=8&f.__g),f.componentDidCatch&&(f.componentDidCatch(n,i||{}),u=8&f.__g),u)return void(f.__g|=2)}catch(t){n=t;}}throw e$1=0,n}},t$1=0,E$1.prototype.setState=function(n,t){var r=this.__s;r&&r!=this.state||(r=this.__s=M({},this.state)),"function"==typeof n&&(n=n(M({},r),this.props)),n&&(M(r,n),this.__v&&(t&&this.__k.push(t),q(this)));},E$1.prototype.forceUpdate=function(n){this.__v&&(this.__g|=4,n&&this.__h.push(n),q(this));},E$1.prototype.render=A$1,i$1=[],e$1=0,o$2=function(n,t){return n.__v.__b-t.__v.__b},u$2=Symbol(),c$1=Symbol(),s$1=/(PointerCapture)$|Capture$/i,a$1=0,h$1=K$1(false),l$1=K$1(true);
|
|
2
2
|
|
|
3
|
-
var t,r,u$1,i,o$1=Object.is,f=0,c=[],e=n,a
|
|
3
|
+
var t,r,u$1,i,o$1=Object.is,f=0,c=[],e=[],a=n,v=a.__b,l=a.__r,m=a.diffed,s=a.__c,h=a.unmount,p=a.__;function y(n,t){a.__h&&a.__h(r,n,f||t),f=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return f=1,_(G$1,n)}function _(n,u,i){var f=y(t++,2);if(f.t=n,!f.__c&&(f.__=[i?i(u):G$1(void 0,u),function(n){var t=f.__N?f.__N[0]:f.__[0],r=f.t(t,n);o$1(t,r)||(f.__N=[r,f.__[1]],f.__c.setState({}));}],f.__c=r,!r.__f)){r.__f=true;var c=r.shouldComponentUpdate;r.shouldComponentUpdate=function(n,t,r){var u=this.__H;if(!u)return true;var i=false,f=this.props!=n;if(u.__.some(function(n){n.__N&&(i=true,o$1(n.__[0],n.__N[0])||(f=true));}),c){var e=c.call(this,n,t,r);return i?e||f:e}return !i||f};}return f.__}function A(n,u){var i=y(t++,3);!a.__s&&E(i.__H,u)&&(i.__P=true,i.__=n,i.u=u,r.__H.__h.push(i));}function F(n,u){var i=y(t++,4);!a.__s&&E(i.__H,u)&&(i.__P=false,i.__=n,i.u=u,r.__h.push(i));}function g(){var n;do{for(;n=e.shift();)try{C(n);}catch(t){a.__e(t,{__:(n=n.__P)&&n.__v});}for(;n=c.shift();){var t=n.__H;if(n.__P&&t)try{t.__h.some(C),t.__h.some(D),t.__h=[];}catch(r){t.__h=[],a.__e(r,n.__v);}}}while(e.length)}a.__b=function(n){r=null,v&&v(n);},a.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),p&&p(n,t);},a.__r=function(n){l&&l(n),t=0;var i=(r=n.__c).__H;i&&(u$1==r?r.__h=[]:(i.__h.some(C),i.__h.some(D),t=0),i.__h=[],i.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0;})),u$1=r;},a.diffed=function(n){m&&m(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&B$1(c.push(t)),t.__H.__.some(function(n){n.u&&(n.__H=n.u);})),u$1=r=null;},a.__c=function(n,t){t.some(function(n){try{n.__h.some(C),n.__h=n.__h.filter(function(n){return !n.__||D(n)});}catch(r){t.some(function(n){n.__h&&(n.__h=[]);}),t=[],a.__e(r,n.__v);}}),s&&s(n,t);},a.unmount=function(n){h&&h(n);var t,r,u=n.__c;u&&u.__H&&(u.__H.__.some(function(u){try{if(u.__P&&u.__c){if(void 0===r){for(r=n.__;r&&(!r.__c||!r.__c.__P);)r=r.__;r=r&&r.__c;}u.__P=r,B$1(e.push(u));}else C(u);}catch(n){t=n;}}),u.__H=void 0,t&&a.__e(t,u.__v));};var k="function"==typeof requestAnimationFrame;function z$1(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,35);k&&(t=requestAnimationFrame(r));}function B$1(n){1!=n&&i==a.requestAnimationFrame||((i=a.requestAnimationFrame)||z$1)(g);}function C(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function D(n){var t=r;n.__c=n.__(),r=t;}function E(n,t){return !n||n.length!=t.length||t.some(function(t,r){return !o$1(t,n[r])})}function G$1(n,t){return "function"==typeof t?t(n):t}
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var w=Object.assign;function R(n,t){for(var e in n)if("__source"!=e&&n[e]!==t[e])return true;for(var r in t)if("__source"!=r&&!(r in n))return true;return false}var x=/^(-|f[lo].*[^se]$|g.{5,}[^ps]$|z|o[pr]|(W.{5})?[lL]i.*(t|mp)$|an|(bo|s).{4}Im|sca|m.{6}[ds]|ta|c.*[st]$|wido|ini)/;function I(n,t){this.props=n,this.context=t;}(I.prototype=new E$1).isPureReactComponent=true,I.prototype.shouldComponentUpdate=function(n,t){return R(this.props,n)||R(this.state,t)};var V,T,W=Symbol.for("react.element"),P=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,$=/[A-Z0-9]/g,z="undefined"!=typeof document,H=/* @__PURE__ */Q(function(n$1,t,e){var r=n.__s||V?(e||t)():t(),o=d({t:{__:r,u:t}}),i=o[0].t,f=o[1];return F(function(){i.__=r,i.u=t,Z(i)&&f({t:i});},[n$1,r,t]),A(function(){return Z(i)&&f({t:i}),n$1(function(){Z(i)&&f({t:i});})},[n$1]),r});function Z(n){try{return !Object.is(n.__,n.u())}catch(n){return true}}var B=function(n){return /fil|che|rad/.test(n)};E$1.prototype.isReactComponent=true,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(E$1.prototype,n,{configurable:true,get:function(){return this["UNSAFE_"+n]},set:function(t){Object.defineProperty(this,n,{configurable:true,writable:true,value:t});}});});var G=n.event;n.event=function(n){return G&&(n=G(n)),n.persist=function(){},n.isPropagationStopped=function(){return this.cancelBubble},n.isDefaultPrevented=function(){return this.defaultPrevented},n.nativeEvent=n};var J={configurable:true,get:function(){return this.class}},K=n.vnode;function Q(n$1){if(!T){T=true;var t=n.__r;n.__r=function(n){t&&t(n),32&n.__u&&(V=n),n.__c;};var e=n.diffed;n.diffed=function(n){e&&e(n),V==n&&(V=null);};}return n$1}n.vnode=function(t){if("string"==typeof t.type)!function(t){var e=t.props,r=t.type,u={},o=-1==r.indexOf("-");for(var i in e){var f=e[i];if(!("value"==i&&"defaultValue"in e&&null==f||z&&"children"==i&&"noscript"==r||"class"==i||"className"==i)){if("style"==i&&"object"==typeof f){var c=void 0;for(var a in f)"number"!=typeof f[a]||x.test(a)||(c||(c=f=w({},f)),f[a]+="px");}else if("defaultValue"==i&&"value"in e&&null==e.value)i="value";else if("download"==i&&true===f)f="";else if("translate"==i&&"no"===f)f=false;else if("o"==i[0]&&"n"==i[1]){var l=i.toLowerCase();"ondoubleclick"==l?i="ondblclick":"onchange"!=l||"input"!=r&&"textarea"!=r||B(e.type)?"onfocus"==l?i="onfocusin":"onblur"==l&&(i="onfocusout"):l=i="oninput","oninput"==l&&u[i=l]&&(i="oninputCapture");}else o&&P.test(i)?i=i.replace($,"-$&").toLowerCase():null===f&&(f=void 0);u[i]=f;}}"select"==r&&(u.multiple&&Array.isArray(u.value)&&(u.value=D$1(e.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value);})),null!=u.defaultValue&&(u.value=D$1(e.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value;}))),e.class&&!e.className?(u.class=e.class,Object.defineProperty(u,"className",J)):e.className&&(u.class=u.className=e.className),t.props=u;}(t);else if("function"==typeof t.type&&("ref"in t.props&&"prototype"in t.type&&t.type.prototype.render&&(t.ref=t.props.ref,delete t.props.ref),t.type.defaultProps)){var e=w({},t.props);for(var r in t.type.defaultProps) void 0===e[r]&&(e[r]=t.type.defaultProps[r]);t.props=e;}t.$$typeof=W,K&&K(t);};
|
|
6
6
|
|
|
7
|
-
var o=0;function u(t,e,n$1,f,u,i){e||(e={});var a,c,l=e;if("ref"in l&&"function"!=typeof t)for(c in l={},e)"ref"==c?a=e[c]:l[c]=e[c];var p={type:t,props:l,key:n$1,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--o,__i:-1,__u:0
|
|
7
|
+
var o=0;function u(t,e,n$1,f,u,i){e||(e={});var a,c,l=e;if("ref"in l&&"function"!=typeof t)for(c in l={},e)"ref"==c?a=e[c]:l[c]=e[c];var p={type:t,props:l,key:n$1,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--o,__i:-1,__u:0};return n.vnode&&n.vnode(p),p}
|
|
8
8
|
|
|
9
|
-
export {
|
|
9
|
+
export { A$1 as A, H, tn, u };
|
|
@@ -10,7 +10,7 @@ const installImportMetaCssBuild = (importMeta) => {
|
|
|
10
10
|
const stylesheet = new CSSStyleSheet({ baseUrl: importMeta.url });
|
|
11
11
|
stylesheet.replaceSync(value);
|
|
12
12
|
stylesheetMap.set(url, stylesheet);
|
|
13
|
-
document.adoptedStyleSheets
|
|
13
|
+
document.adoptedStyleSheets.push(stylesheet);
|
|
14
14
|
};
|
|
15
15
|
const update = (url, value) => {
|
|
16
16
|
stylesheetMap.get(url).replaceSync(value);
|
|
@@ -14,7 +14,7 @@ const installImportMetaCssDev = (importMeta) => {
|
|
|
14
14
|
const adopt = (value) => {
|
|
15
15
|
stylesheet = new CSSStyleSheet({ baseUrl: importMeta.url });
|
|
16
16
|
stylesheet.replaceSync(addUrlInfo(value));
|
|
17
|
-
document.adoptedStyleSheets
|
|
17
|
+
document.adoptedStyleSheets.push(stylesheet);
|
|
18
18
|
};
|
|
19
19
|
const update = (value) => {
|
|
20
20
|
stylesheet.replaceSync(addUrlInfo(value));
|
|
@@ -7449,4 +7449,4 @@ const isResponseEligibleForIntegrityValidation = (response) => {
|
|
|
7449
7449
|
return ["basic", "cors", "default"].includes(response.type);
|
|
7450
7450
|
};
|
|
7451
7451
|
|
|
7452
|
-
export { ANSI, CONTENT_TYPE, DATA_URL, JS_QUOTES, RUNTIME_COMPAT, URL_META, applyFileSystemMagicResolution, applyNodeEsmResolution, asSpecifierWithoutSearch, asUrlWithoutSearch, assertAndNormalizeDirectoryUrl, browserDefaultRuntimeCompat, bufferToEtag, collectFiles, compareFileUrls, composeTwoImportMaps, createDetailedMessage$1 as createDetailedMessage, createLogger, createTaskLog, ensurePathnameTrailingSlash, ensureWindowsDriveLetter, errorToHTML, formatError, generateContentFrame, getCallerPosition, getExtensionsToTry, inferRuntimeCompatFromClosestPackage, injectQueryParams, injectQueryParamsIntoSpecifier, isFileSystemPath, isSpecifierForNodeBuiltin, lookupPackageDirectory, moveUrl, normalizeImportMap, normalizeUrl, readCustomConditionsFromProcessArgs, readEntryStatSync, readPackageAtOrNull, registerDirectoryLifecycle, registerFileLifecycle, resolveImport, setUrlBasename, setUrlExtension, setUrlFilename, stringifyUrlSite, urlIsOrIsInsideOf, urlToBasename, urlToExtension$1 as urlToExtension, urlToFileSystemPath, urlToFilename$1 as urlToFilename, urlToPathname$1 as urlToPathname, urlToRelativeUrl, validateResponseIntegrity, writeFileSync };
|
|
7452
|
+
export { ANSI, CONTENT_TYPE, DATA_URL, JS_QUOTES, RUNTIME_COMPAT, UNICODE, URL_META, applyFileSystemMagicResolution, applyNodeEsmResolution, asSpecifierWithoutSearch, asUrlWithoutSearch, assertAndNormalizeDirectoryUrl, browserDefaultRuntimeCompat, bufferToEtag, collectFiles, compareFileUrls, composeTwoImportMaps, createDetailedMessage$1 as createDetailedMessage, createLogger, createTaskLog, ensurePathnameTrailingSlash, ensureWindowsDriveLetter, errorToHTML, formatError, generateContentFrame, getCallerPosition, getExtensionsToTry, inferRuntimeCompatFromClosestPackage, injectQueryParams, injectQueryParamsIntoSpecifier, isFileSystemPath, isSpecifierForNodeBuiltin, lookupPackageDirectory, moveUrl, normalizeImportMap, normalizeUrl, readCustomConditionsFromProcessArgs, readEntryStatSync, readPackageAtOrNull, registerDirectoryLifecycle, registerFileLifecycle, resolveImport, setUrlBasename, setUrlExtension, setUrlFilename, stringifyUrlSite, urlIsOrIsInsideOf, urlToBasename, urlToExtension$1 as urlToExtension, urlToFileSystemPath, urlToFilename$1 as urlToFilename, urlToPathname$1 as urlToPathname, urlToRelativeUrl, validateResponseIntegrity, writeFileSync };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { WebSocketResponse, pickContentType, ServerEvents, serverPluginErrorHandler, fetchDirectory, composeTwoResponses, serverPluginCORS, jsenvAccessControlAllowedHeaders, startServer } from "@jsenv/server";
|
|
2
2
|
import { existsSync, statSync, readFileSync, realpathSync, readdirSync, lstatSync } from "node:fs";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
|
-
import { urlToRelativeUrl, registerFileLifecycle, lookupPackageDirectory, readPackageAtOrNull, generateContentFrame, errorToHTML, DATA_URL, CONTENT_TYPE, normalizeImportMap, composeTwoImportMaps, resolveImport, JS_QUOTES, urlToExtension, urlToBasename, applyNodeEsmResolution, URL_META, readCustomConditionsFromProcessArgs, urlIsOrIsInsideOf, collectFiles, registerDirectoryLifecycle, readEntryStatSync, applyFileSystemMagicResolution, getExtensionsToTry, urlToFilename, asUrlWithoutSearch, ensurePathnameTrailingSlash, compareFileUrls, setUrlExtension,
|
|
4
|
+
import { urlToRelativeUrl, registerFileLifecycle, lookupPackageDirectory, readPackageAtOrNull, generateContentFrame, errorToHTML, DATA_URL, CONTENT_TYPE, normalizeImportMap, composeTwoImportMaps, resolveImport, createDetailedMessage, UNICODE, JS_QUOTES, urlToExtension, urlToBasename, applyNodeEsmResolution, URL_META, readCustomConditionsFromProcessArgs, urlIsOrIsInsideOf, collectFiles, registerDirectoryLifecycle, readEntryStatSync, applyFileSystemMagicResolution, getExtensionsToTry, urlToFilename, asUrlWithoutSearch, ensurePathnameTrailingSlash, compareFileUrls, setUrlExtension, stringifyUrlSite, injectQueryParamsIntoSpecifier, isSpecifierForNodeBuiltin, injectQueryParams, urlToFileSystemPath, writeFileSync, moveUrl, ensureWindowsDriveLetter, validateResponseIntegrity, setUrlFilename, getCallerPosition, asSpecifierWithoutSearch, bufferToEtag, isFileSystemPath, urlToPathname, setUrlBasename, createLogger, normalizeUrl, ANSI, RUNTIME_COMPAT, formatError, assertAndNormalizeDirectoryUrl, browserDefaultRuntimeCompat, inferRuntimeCompatFromClosestPackage, createTaskLog } from "./jsenv_core_packages.js";
|
|
5
5
|
import { createPluginsController } from "@jsenv/server/src/plugins_controller.js";
|
|
6
|
-
import { parseHtml, injectJsenvScript, stringifyHtmlAst, parseCssUrls, getHtmlNodeAttribute, getHtmlNodePosition, getHtmlNodeAttributePosition, setHtmlNodeAttributes, parseSrcSet, getUrlForContentInsideHtml, removeHtmlNodeText, setHtmlNodeText, getHtmlNodeText, analyzeScriptNode, visitHtmlNodes, parseJsUrls, getUrlForContentInsideJs, renderCssTemplateLiteral, applyBabelPlugins, visitJsAst, getImportMetaPropertyName, visitJsAstUntil, analyzeLinkNode, injectHtmlNodeAsEarlyAsPossible, createHtmlNode, generateUrlForInlineContent, parseJsWithAcorn } from "@jsenv/ast";
|
|
6
|
+
import { parseHtml, injectJsenvScript, stringifyHtmlAst, parseCssUrls, getHtmlNodeAttribute, getHtmlNodePosition, getHtmlNodeAttributePosition, setHtmlNodeAttributes, parseSrcSet, getUrlForContentInsideHtml, removeHtmlNodeText, setHtmlNodeText, getHtmlNodeText, analyzeScriptNode, visitHtmlNodes, parseJsUrls, hasCssOpaqueDirective, getUrlForContentInsideJs, renderCssTemplateLiteral, applyBabelPlugins, visitJsAst, getImportMetaPropertyName, visitJsAstUntil, analyzeLinkNode, injectHtmlNodeAsEarlyAsPossible, createHtmlNode, generateUrlForInlineContent, parseJsWithAcorn } from "@jsenv/ast";
|
|
7
7
|
import { jsenvPluginSupervisor } from "@jsenv/plugin-supervisor";
|
|
8
8
|
import { jsenvPluginTranspilation } from "@jsenv/plugin-transpilation";
|
|
9
9
|
import { createMagicSource, composeTwoSourcemaps, generateSourcemapFileUrl, generateSourcemapDataUrl, SOURCEMAP, applyContentEditsOnSourcemap, composeSourcemaps } from "@jsenv/sourcemap";
|
|
@@ -2392,7 +2392,20 @@ const parseAndTransformJsReferences = async (
|
|
|
2392
2392
|
renderCssTemplateLiteral(inlineUrlInfo.content, substitutions)
|
|
2393
2393
|
: JS_QUOTES.escapeSpecialChars(inlineUrlInfo.content, { quote });
|
|
2394
2394
|
if (replacement === null) {
|
|
2395
|
-
// a placeholder did not survive
|
|
2395
|
+
// a placeholder did not survive the css transformation: giving the
|
|
2396
|
+
// expressions back would not give back what the source said
|
|
2397
|
+
if (inlineReferenceInfo.alreadyBuilt) {
|
|
2398
|
+
return;
|
|
2399
|
+
}
|
|
2400
|
+
warnCssShippedAsWritten(urlInfo, {
|
|
2401
|
+
line: inlineReferenceInfo.line,
|
|
2402
|
+
column: inlineReferenceInfo.column,
|
|
2403
|
+
reason: `a "\${}" placeholder did not survive the css transformation`,
|
|
2404
|
+
templateSource: urlInfo.content.slice(
|
|
2405
|
+
inlineReferenceInfo.start,
|
|
2406
|
+
inlineReferenceInfo.end,
|
|
2407
|
+
),
|
|
2408
|
+
});
|
|
2396
2409
|
return;
|
|
2397
2410
|
}
|
|
2398
2411
|
magicSource.replace({
|
|
@@ -2500,7 +2513,13 @@ const parseAndTransformJsReferences = async (
|
|
|
2500
2513
|
isNodeJs,
|
|
2501
2514
|
});
|
|
2502
2515
|
for (const jsReferenceInfo of jsReferenceInfos) {
|
|
2503
|
-
if (jsReferenceInfo.
|
|
2516
|
+
if (jsReferenceInfo.isOpaqueCss) {
|
|
2517
|
+
if (!jsReferenceInfo.alreadyBuilt) {
|
|
2518
|
+
// a dependency's built css is opaque in a source this build does not
|
|
2519
|
+
// have; its own build is where that is told
|
|
2520
|
+
warnCssShippedAsWritten(urlInfo, jsReferenceInfo);
|
|
2521
|
+
}
|
|
2522
|
+
} else if (jsReferenceInfo.isInline) {
|
|
2504
2523
|
onInlineReference(jsReferenceInfo);
|
|
2505
2524
|
} else {
|
|
2506
2525
|
onExternalReference(jsReferenceInfo);
|
|
@@ -2515,6 +2534,38 @@ const parseAndTransformJsReferences = async (
|
|
|
2515
2534
|
return magicSource.toContentAndSourcemap();
|
|
2516
2535
|
};
|
|
2517
2536
|
|
|
2537
|
+
// An import.meta.css the build cannot parse is shipped exactly as written:
|
|
2538
|
+
// comments, indentation, untranspiled properties and unresolved url() included,
|
|
2539
|
+
// in this build and in every build of every consumer of what it produces.
|
|
2540
|
+
// Nothing downstream can undo it, so the only place it can be told is here.
|
|
2541
|
+
const warnCssShippedAsWritten = (
|
|
2542
|
+
urlInfo,
|
|
2543
|
+
{ line, column, reason, templateSource },
|
|
2544
|
+
) => {
|
|
2545
|
+
if (!urlInfo.context.build) {
|
|
2546
|
+
return;
|
|
2547
|
+
}
|
|
2548
|
+
if (hasCssOpaqueDirective(templateSource)) {
|
|
2549
|
+
return;
|
|
2550
|
+
}
|
|
2551
|
+
urlInfo.context.logger.warn(
|
|
2552
|
+
createDetailedMessage(
|
|
2553
|
+
`${UNICODE.WARNING} import.meta.css shipped as written: not parsed, not transpiled, not minified`,
|
|
2554
|
+
{
|
|
2555
|
+
// line/column are read from the content as analyzed, which is not the
|
|
2556
|
+
// file on disk once something transpiled it (jsx, babel helpers)
|
|
2557
|
+
"css template":
|
|
2558
|
+
urlInfo.content === urlInfo.originalContent
|
|
2559
|
+
? `${urlInfo.url}:${line}:${column}`
|
|
2560
|
+
: urlInfo.url,
|
|
2561
|
+
reason,
|
|
2562
|
+
"suggestion": `only a "\${}" standing where a css value stands can be read; a custom property set from JS, a data attribute or a selector list covers nearly every other reason to interpolate`,
|
|
2563
|
+
"to silence": `write "jsenv-css-opaque" in a css comment inside that template`,
|
|
2564
|
+
},
|
|
2565
|
+
),
|
|
2566
|
+
);
|
|
2567
|
+
};
|
|
2568
|
+
|
|
2518
2569
|
const jsenvPluginReferenceExpectedTypes = () => {
|
|
2519
2570
|
const redirectJsReference = (reference) => {
|
|
2520
2571
|
const urlObject = new URL(reference.url);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/core",
|
|
3
|
-
"version": "41.5.
|
|
3
|
+
"version": "41.5.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Tool to develop, test and build js projects",
|
|
6
6
|
"repository": {
|
|
@@ -73,12 +73,12 @@
|
|
|
73
73
|
"test:snapshot_clear": "npx @jsenv/filesystem clear **/tests/**/side_effects/"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@jsenv/ast": "6.10.
|
|
77
|
-
"@jsenv/js-module-fallback": "1.6.
|
|
76
|
+
"@jsenv/ast": "6.10.5",
|
|
77
|
+
"@jsenv/js-module-fallback": "1.6.9",
|
|
78
78
|
"@jsenv/plugin-bundling": "2.10.28",
|
|
79
|
-
"@jsenv/plugin-minification": "1.7.
|
|
80
|
-
"@jsenv/plugin-supervisor": "1.8.
|
|
81
|
-
"@jsenv/plugin-transpilation": "1.7.
|
|
79
|
+
"@jsenv/plugin-minification": "1.7.22",
|
|
80
|
+
"@jsenv/plugin-supervisor": "1.8.24",
|
|
81
|
+
"@jsenv/plugin-transpilation": "1.7.9",
|
|
82
82
|
"@jsenv/server": "17.6.4",
|
|
83
83
|
"@jsenv/sourcemap": "1.4.9",
|
|
84
84
|
"react-table": "7.8.0"
|
|
@@ -113,17 +113,17 @@
|
|
|
113
113
|
"@jsenv/url-meta": "workspace:*",
|
|
114
114
|
"@jsenv/urls": "workspace:*",
|
|
115
115
|
"@jsenv/utils": "workspace:*",
|
|
116
|
-
"@playwright/browser-chromium": "1.
|
|
117
|
-
"@playwright/browser-firefox": "1.
|
|
118
|
-
"@playwright/browser-webkit": "1.
|
|
119
|
-
"eslint": "10.
|
|
116
|
+
"@playwright/browser-chromium": "1.63.0",
|
|
117
|
+
"@playwright/browser-firefox": "1.63.0",
|
|
118
|
+
"@playwright/browser-webkit": "1.63.0",
|
|
119
|
+
"eslint": "10.10.0",
|
|
120
120
|
"eslint-plugin-import-x": "4.17.1",
|
|
121
121
|
"eslint-plugin-react": "7.37.5",
|
|
122
|
-
"eslint-plugin-regexp": "3.
|
|
123
|
-
"globals": "17.
|
|
124
|
-
"open": "11.0.
|
|
125
|
-
"playwright": "1.
|
|
126
|
-
"preact": "11.0.0-
|
|
122
|
+
"eslint-plugin-regexp": "3.3.0",
|
|
123
|
+
"globals": "17.12.0",
|
|
124
|
+
"open": "11.0.2",
|
|
125
|
+
"playwright": "1.63.0",
|
|
126
|
+
"preact": "11.0.0-rc.2",
|
|
127
127
|
"prettier": "3.9.6",
|
|
128
128
|
"prettier-plugin-css-order": "git+https://github.com/dmail-fork/prettier-plugin-css-order.git",
|
|
129
129
|
"prettier-plugin-embed": "0.5.1",
|
|
@@ -10,7 +10,7 @@ export const installImportMetaCssBuild = (importMeta) => {
|
|
|
10
10
|
const stylesheet = new CSSStyleSheet({ baseUrl: importMeta.url });
|
|
11
11
|
stylesheet.replaceSync(value);
|
|
12
12
|
stylesheetMap.set(url, stylesheet);
|
|
13
|
-
document.adoptedStyleSheets
|
|
13
|
+
document.adoptedStyleSheets.push(stylesheet);
|
|
14
14
|
};
|
|
15
15
|
const update = (url, value) => {
|
|
16
16
|
stylesheetMap.get(url).replaceSync(value);
|
|
@@ -14,7 +14,7 @@ export const installImportMetaCssDev = (importMeta) => {
|
|
|
14
14
|
const adopt = (value) => {
|
|
15
15
|
stylesheet = new CSSStyleSheet({ baseUrl: importMeta.url });
|
|
16
16
|
stylesheet.replaceSync(addUrlInfo(value));
|
|
17
|
-
document.adoptedStyleSheets
|
|
17
|
+
document.adoptedStyleSheets.push(stylesheet);
|
|
18
18
|
};
|
|
19
19
|
const update = (value) => {
|
|
20
20
|
stylesheet.replaceSync(addUrlInfo(value));
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getUrlForContentInsideJs,
|
|
3
|
+
hasCssOpaqueDirective,
|
|
3
4
|
parseJsUrls,
|
|
4
5
|
renderCssTemplateLiteral,
|
|
5
6
|
} from "@jsenv/ast";
|
|
7
|
+
import { createDetailedMessage, UNICODE } from "@jsenv/humanize";
|
|
6
8
|
import {
|
|
7
9
|
isWebWorkerEntryPointReference,
|
|
8
10
|
isWebWorkerUrlInfo,
|
|
@@ -82,7 +84,20 @@ const parseAndTransformJsReferences = async (
|
|
|
82
84
|
renderCssTemplateLiteral(inlineUrlInfo.content, substitutions)
|
|
83
85
|
: JS_QUOTES.escapeSpecialChars(inlineUrlInfo.content, { quote });
|
|
84
86
|
if (replacement === null) {
|
|
85
|
-
// a placeholder did not survive
|
|
87
|
+
// a placeholder did not survive the css transformation: giving the
|
|
88
|
+
// expressions back would not give back what the source said
|
|
89
|
+
if (inlineReferenceInfo.alreadyBuilt) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
warnCssShippedAsWritten(urlInfo, {
|
|
93
|
+
line: inlineReferenceInfo.line,
|
|
94
|
+
column: inlineReferenceInfo.column,
|
|
95
|
+
reason: `a "\${}" placeholder did not survive the css transformation`,
|
|
96
|
+
templateSource: urlInfo.content.slice(
|
|
97
|
+
inlineReferenceInfo.start,
|
|
98
|
+
inlineReferenceInfo.end,
|
|
99
|
+
),
|
|
100
|
+
});
|
|
86
101
|
return;
|
|
87
102
|
}
|
|
88
103
|
magicSource.replace({
|
|
@@ -190,7 +205,13 @@ const parseAndTransformJsReferences = async (
|
|
|
190
205
|
isNodeJs,
|
|
191
206
|
});
|
|
192
207
|
for (const jsReferenceInfo of jsReferenceInfos) {
|
|
193
|
-
if (jsReferenceInfo.
|
|
208
|
+
if (jsReferenceInfo.isOpaqueCss) {
|
|
209
|
+
if (!jsReferenceInfo.alreadyBuilt) {
|
|
210
|
+
// a dependency's built css is opaque in a source this build does not
|
|
211
|
+
// have; its own build is where that is told
|
|
212
|
+
warnCssShippedAsWritten(urlInfo, jsReferenceInfo);
|
|
213
|
+
}
|
|
214
|
+
} else if (jsReferenceInfo.isInline) {
|
|
194
215
|
onInlineReference(jsReferenceInfo);
|
|
195
216
|
} else {
|
|
196
217
|
onExternalReference(jsReferenceInfo);
|
|
@@ -204,3 +225,35 @@ const parseAndTransformJsReferences = async (
|
|
|
204
225
|
}
|
|
205
226
|
return magicSource.toContentAndSourcemap();
|
|
206
227
|
};
|
|
228
|
+
|
|
229
|
+
// An import.meta.css the build cannot parse is shipped exactly as written:
|
|
230
|
+
// comments, indentation, untranspiled properties and unresolved url() included,
|
|
231
|
+
// in this build and in every build of every consumer of what it produces.
|
|
232
|
+
// Nothing downstream can undo it, so the only place it can be told is here.
|
|
233
|
+
const warnCssShippedAsWritten = (
|
|
234
|
+
urlInfo,
|
|
235
|
+
{ line, column, reason, templateSource },
|
|
236
|
+
) => {
|
|
237
|
+
if (!urlInfo.context.build) {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
if (hasCssOpaqueDirective(templateSource)) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
urlInfo.context.logger.warn(
|
|
244
|
+
createDetailedMessage(
|
|
245
|
+
`${UNICODE.WARNING} import.meta.css shipped as written: not parsed, not transpiled, not minified`,
|
|
246
|
+
{
|
|
247
|
+
// line/column are read from the content as analyzed, which is not the
|
|
248
|
+
// file on disk once something transpiled it (jsx, babel helpers)
|
|
249
|
+
"css template":
|
|
250
|
+
urlInfo.content === urlInfo.originalContent
|
|
251
|
+
? `${urlInfo.url}:${line}:${column}`
|
|
252
|
+
: urlInfo.url,
|
|
253
|
+
reason,
|
|
254
|
+
"suggestion": `only a "\${}" standing where a css value stands can be read; a custom property set from JS, a data attribute or a selector list covers nearly every other reason to interpolate`,
|
|
255
|
+
"to silence": `write "jsenv-css-opaque" in a css comment inside that template`,
|
|
256
|
+
},
|
|
257
|
+
),
|
|
258
|
+
);
|
|
259
|
+
};
|