@qwik.dev/core 2.0.0-beta.1 → 2.0.0-beta.3
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/bindings/qwik.darwin-arm64.node +0 -0
- package/bindings/qwik.darwin-x64.node +0 -0
- package/bindings/qwik.linux-x64-gnu.node +0 -0
- package/bindings/qwik.win32-x64-msvc.node +0 -0
- package/bindings/qwik_wasm_bg.wasm +0 -0
- package/dist/build/package.json +1 -1
- package/dist/cli.cjs +2 -2
- package/dist/core-internal.d.ts +2 -3
- package/dist/core.cjs +122 -76
- package/dist/core.cjs.map +1 -1
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +122 -76
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.cjs +256 -242
- package/dist/core.prod.mjs +250 -239
- package/dist/insights/vite/index.cjs +1 -1
- package/dist/insights/vite/index.mjs +10 -10
- package/dist/loader/index.cjs +1 -1
- package/dist/loader/index.mjs +1 -1
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.cjs +108 -108
- package/dist/optimizer.mjs +106 -106
- package/dist/preloader.cjs +3 -3
- package/dist/preloader.mjs +3 -3
- package/dist/qwikloader.js +1 -1
- package/dist/server.cjs +47 -26
- package/dist/server.mjs +34 -13
- package/dist/starters/features/playwright/playwright-report/index.html +10 -8
- package/dist/testing/index.cjs +123 -68
- package/dist/testing/index.mjs +97 -42
- package/dist/testing/package.json +1 -1
- package/package.json +6 -6
package/dist/preloader.cjs
CHANGED
|
@@ -91,7 +91,7 @@ const preloadOne = (bundle) => {
|
|
|
91
91
|
doc.head.appendChild(link);
|
|
92
92
|
};
|
|
93
93
|
const adjustProbabilities = (bundle, newInverseProbability, seen) => {
|
|
94
|
-
if (seen
|
|
94
|
+
if (seen?.has(bundle)) {
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
97
|
const previousInverseProbability = bundle.$inverseProbability$;
|
|
@@ -111,7 +111,7 @@ const adjustProbabilities = (bundle, newInverseProbability, seen) => {
|
|
|
111
111
|
queueDirty = true;
|
|
112
112
|
}
|
|
113
113
|
if (bundle.$deps$) {
|
|
114
|
-
seen
|
|
114
|
+
seen ||= /* @__PURE__ */ new Set();
|
|
115
115
|
seen.add(bundle);
|
|
116
116
|
const probability = 1 - bundle.$inverseProbability$;
|
|
117
117
|
for (const dep of bundle.$deps$) {
|
|
@@ -142,7 +142,7 @@ const handleBundle = (name, inverseProbability) => {
|
|
|
142
142
|
};
|
|
143
143
|
let depsCount;
|
|
144
144
|
const preload = (name, probability) => {
|
|
145
|
-
if (!
|
|
145
|
+
if (!name?.length) {
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
148
|
depsCount = 0;
|
package/dist/preloader.mjs
CHANGED
|
@@ -71,7 +71,7 @@ const preloadOne = (e) => {
|
|
|
71
71
|
doc.head.appendChild(o);
|
|
72
72
|
};
|
|
73
73
|
const adjustProbabilities = (e, t, o) => {
|
|
74
|
-
if (o
|
|
74
|
+
if (o?.has(e)) return;
|
|
75
75
|
const n = e.u;
|
|
76
76
|
e.u = t;
|
|
77
77
|
if (n - e.u < 0.01) return;
|
|
@@ -87,7 +87,7 @@ const adjustProbabilities = (e, t, o) => {
|
|
|
87
87
|
queueDirty = 1;
|
|
88
88
|
}
|
|
89
89
|
if (e.h) {
|
|
90
|
-
o
|
|
90
|
+
o ||= /* @__PURE__ */ new Set();
|
|
91
91
|
o.add(e);
|
|
92
92
|
const t2 = 1 - e.u;
|
|
93
93
|
for (const n2 of e.h) {
|
|
@@ -114,7 +114,7 @@ const handleBundle = (e, t) => {
|
|
|
114
114
|
};
|
|
115
115
|
let depsCount;
|
|
116
116
|
const preload = (e, t) => {
|
|
117
|
-
if (!
|
|
117
|
+
if (!e?.length) return;
|
|
118
118
|
depsCount = 0;
|
|
119
119
|
let o = t ? 1 - t : 0.4;
|
|
120
120
|
if (Array.isArray(e)) for (let t2 = e.length - 1; t2 >= 0; t2--) {
|
package/dist/qwikloader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=document,e=window,n=new Set,o=new Set([t]);let r;const s=(t,e)=>Array.from(t.querySelectorAll(e)),i=t=>{const e=[];return o.forEach(
|
|
1
|
+
const t=document,e=window,n=new Set,o=new Set([t]);let r;const s=(t,e)=>Array.from(t.querySelectorAll(e)),i=t=>{const e=[];return o.forEach(n=>e.push(...s(n,t))),e},a=t=>{v(t),s(t,"[q\\:shadowroot]").forEach(t=>{const e=t.shadowRoot;e&&a(e)})},c=t=>t&&"function"==typeof t.then;let l=!0;const f=(t,e,n=e.type)=>{let o=l;i("[on"+t+"\\:"+n+"]").forEach(r=>{o=!0,b(r,t,e,n)}),o||window[t.slice(1)].removeEventListener(n,"-window"===t?d:_)},p=e=>{if(void 0===e._qwikjson_){let n=(e===t.documentElement?t.body:e).lastElementChild;for(;n;){if("SCRIPT"===n.tagName&&"qwik/json"===n.getAttribute("type")){e._qwikjson_=JSON.parse(n.textContent.replace(/\\x3C(\/?script)/gi,"<$1"));break}n=n.previousElementSibling}}},u=(t,e)=>new CustomEvent(t,{detail:e}),b=async(e,n,o,r=o.type)=>{const s="on"+n+":"+r;e.hasAttribute("preventdefault:"+r)&&o.preventDefault(),e.hasAttribute("stoppropagation:"+r)&&o.stopPropagation();const i=e._qc_,a=i&&i.li.filter(t=>t[0]===s);if(a&&a.length>0){for(const t of a){const n=t[1].getFn([e,o],()=>e.isConnected)(o,e),r=o.cancelBubble;c(n)&&await n,r&&o.stopPropagation()}return}const l=e.getAttribute(s),f=e.qDispatchEvent;if(f)return f(o,n);if(l){const n=e.closest("[q\\:container]:not([q\\:container=html]):not([q\\:container=text])"),r=n.getAttribute("q:base"),s=n.getAttribute("q:version")||"unknown",i=n.getAttribute("q:manifest-hash")||"dev",a=new URL(r,t.baseURI);for(const f of l.split("\n")){const l=new URL(f,a),u=l.href,b=l.hash.replace(/^#?([^?[|]*).*$/,"$1")||"default",h=performance.now();let _,d,w;const m=f.startsWith("#"),y={qBase:r,qManifest:i,qVersion:s,href:u,symbol:b,element:e,reqTime:h};if(m){const e=n.getAttribute("q:instance");_=(t["qFuncs_"+e]||[])[Number.parseInt(b)],_||(d="sync",w=Error("sym:"+b))}else{q("qsymbol",y);const t=l.href.split("#")[0];try{const e=import(t);p(n),_=(await e)[b],_||(d="no-symbol",w=Error(`${b} not in ${t}`))}catch(t){d||(d="async"),w=t}}if(!_){q("qerror",{importError:d,error:w,...y}),console.error(w);break}const v=t.__q_context__;if(e.isConnected)try{t.__q_context__=[e,o,l];const n=_(o,e);c(n)&&await n}catch(t){q("qerror",{error:t,...y})}finally{t.__q_context__=v}}}},q=(e,n)=>{t.dispatchEvent(u(e,n))},h=t=>t.replace(/([A-Z])/g,t=>"-"+t.toLowerCase()),_=async t=>{let e=h(t.type),n=t.target;for(f("-document",t,e);n&&n.getAttribute;){const o=b(n,"",t,e);let r=t.cancelBubble;c(o)&&await o,r||(r=r||t.cancelBubble||n.hasAttribute("stoppropagation:"+t.type)),n=t.bubbles&&!0!==r?n.parentElement:null}},d=t=>{f("-window",t,h(t.type))},w=()=>{var s;const c=t.readyState;if(!r&&("interactive"==c||"complete"==c)&&(o.forEach(a),r=1,q("qinit"),(null!=(s=e.requestIdleCallback)?s:e.setTimeout).bind(e)(()=>q("qidle")),n.has("qvisible"))){const t=i("[on\\:qvisible]"),e=new IntersectionObserver(t=>{for(const n of t)n.isIntersecting&&(e.unobserve(n.target),b(n.target,"",u("qvisible",n)))});t.forEach(t=>e.observe(t))}},m=(t,e,n,o=!1)=>{t.addEventListener(e,n,{capture:o,passive:!1})};let y;const v=(...t)=>{l=!0,clearTimeout(y),y=setTimeout(()=>l=!1,2e4);for(const r of t)"string"==typeof r?n.has(r)||(o.forEach(t=>m(t,r,_,!0)),m(e,r,d,!0),n.add(r)):o.has(r)||(n.forEach(t=>m(r,t,_,!0)),o.add(r))};if(!("__q_context__"in t)){t.__q_context__=0;const r=e.qwikevents;r&&(Array.isArray(r)?v(...r):v("click","input")),e.qwikevents={events:n,roots:o,push:v},m(t,"readystatechange",w),w()}
|
package/dist/server.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/server 2.0.0-beta.
|
|
3
|
+
* @qwik.dev/core/server 2.0.0-beta.3-dev+aa098fc
|
|
4
4
|
* Copyright QwikDev. All Rights Reserved.
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
|
|
@@ -59,7 +59,7 @@ __export(index_exports, {
|
|
|
59
59
|
versions: () => versions
|
|
60
60
|
});
|
|
61
61
|
module.exports = __toCommonJS(index_exports);
|
|
62
|
-
var
|
|
62
|
+
var import_core5 = require("@qwik.dev/core");
|
|
63
63
|
|
|
64
64
|
// packages/qwik/src/server/platform.ts
|
|
65
65
|
var import_core = require("@qwik.dev/core");
|
|
@@ -1167,16 +1167,16 @@ function getBuildBase(opts) {
|
|
|
1167
1167
|
return `${globalThis.BASE_URL || "/"}build/`;
|
|
1168
1168
|
}
|
|
1169
1169
|
var versions = {
|
|
1170
|
-
qwik: "2.0.0-beta.
|
|
1170
|
+
qwik: "2.0.0-beta.3-dev+aa098fc",
|
|
1171
1171
|
qwikDom: "2.1.19"
|
|
1172
1172
|
};
|
|
1173
1173
|
|
|
1174
1174
|
// packages/qwik/src/server/ssr-container.ts
|
|
1175
|
-
var
|
|
1175
|
+
var import_core4 = require("@qwik.dev/core");
|
|
1176
1176
|
var import_build7 = require("@qwik.dev/core/build");
|
|
1177
1177
|
|
|
1178
1178
|
// packages/qwik/src/server/scripts.ts
|
|
1179
|
-
var QWIK_LOADER_DEFAULT_MINIFIED = 'const t=document,e=window,n=new Set,o=new Set([t]);let r;const s=(t,e)=>Array.from(t.querySelectorAll(e)),i=t=>{const e=[];return o.forEach(
|
|
1179
|
+
var QWIK_LOADER_DEFAULT_MINIFIED = 'const t=document,e=window,n=new Set,o=new Set([t]);let r;const s=(t,e)=>Array.from(t.querySelectorAll(e)),i=t=>{const e=[];return o.forEach(n=>e.push(...s(n,t))),e},a=t=>{v(t),s(t,"[q\\\\:shadowroot]").forEach(t=>{const e=t.shadowRoot;e&&a(e)})},c=t=>t&&"function"==typeof t.then;let l=!0;const f=(t,e,n=e.type)=>{let o=l;i("[on"+t+"\\\\:"+n+"]").forEach(r=>{o=!0,b(r,t,e,n)}),o||window[t.slice(1)].removeEventListener(n,"-window"===t?d:_)},p=e=>{if(void 0===e._qwikjson_){let n=(e===t.documentElement?t.body:e).lastElementChild;for(;n;){if("SCRIPT"===n.tagName&&"qwik/json"===n.getAttribute("type")){e._qwikjson_=JSON.parse(n.textContent.replace(/\\\\x3C(\\/?script)/gi,"<$1"));break}n=n.previousElementSibling}}},u=(t,e)=>new CustomEvent(t,{detail:e}),b=async(e,n,o,r=o.type)=>{const s="on"+n+":"+r;e.hasAttribute("preventdefault:"+r)&&o.preventDefault(),e.hasAttribute("stoppropagation:"+r)&&o.stopPropagation();const i=e._qc_,a=i&&i.li.filter(t=>t[0]===s);if(a&&a.length>0){for(const t of a){const n=t[1].getFn([e,o],()=>e.isConnected)(o,e),r=o.cancelBubble;c(n)&&await n,r&&o.stopPropagation()}return}const l=e.getAttribute(s),f=e.qDispatchEvent;if(f)return f(o,n);if(l){const n=e.closest("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"),r=n.getAttribute("q:base"),s=n.getAttribute("q:version")||"unknown",i=n.getAttribute("q:manifest-hash")||"dev",a=new URL(r,t.baseURI);for(const f of l.split("\\n")){const l=new URL(f,a),u=l.href,b=l.hash.replace(/^#?([^?[|]*).*$/,"$1")||"default",h=performance.now();let _,d,w;const m=f.startsWith("#"),y={qBase:r,qManifest:i,qVersion:s,href:u,symbol:b,element:e,reqTime:h};if(m){const e=n.getAttribute("q:instance");_=(t["qFuncs_"+e]||[])[Number.parseInt(b)],_||(d="sync",w=Error("sym:"+b))}else{q("qsymbol",y);const t=l.href.split("#")[0];try{const e=import(t);p(n),_=(await e)[b],_||(d="no-symbol",w=Error(`${b} not in ${t}`))}catch(t){d||(d="async"),w=t}}if(!_){q("qerror",{importError:d,error:w,...y}),console.error(w);break}const v=t.__q_context__;if(e.isConnected)try{t.__q_context__=[e,o,l];const n=_(o,e);c(n)&&await n}catch(t){q("qerror",{error:t,...y})}finally{t.__q_context__=v}}}},q=(e,n)=>{t.dispatchEvent(u(e,n))},h=t=>t.replace(/([A-Z])/g,t=>"-"+t.toLowerCase()),_=async t=>{let e=h(t.type),n=t.target;for(f("-document",t,e);n&&n.getAttribute;){const o=b(n,"",t,e);let r=t.cancelBubble;c(o)&&await o,r||(r=r||t.cancelBubble||n.hasAttribute("stoppropagation:"+t.type)),n=t.bubbles&&!0!==r?n.parentElement:null}},d=t=>{f("-window",t,h(t.type))},w=()=>{var s;const c=t.readyState;if(!r&&("interactive"==c||"complete"==c)&&(o.forEach(a),r=1,q("qinit"),(null!=(s=e.requestIdleCallback)?s:e.setTimeout).bind(e)(()=>q("qidle")),n.has("qvisible"))){const t=i("[on\\\\:qvisible]"),e=new IntersectionObserver(t=>{for(const n of t)n.isIntersecting&&(e.unobserve(n.target),b(n.target,"",u("qvisible",n)))});t.forEach(t=>e.observe(t))}},m=(t,e,n,o=!1)=>{t.addEventListener(e,n,{capture:o,passive:!1})};let y;const v=(...t)=>{l=!0,clearTimeout(y),y=setTimeout(()=>l=!1,2e4);for(const r of t)"string"==typeof r?n.has(r)||(o.forEach(t=>m(t,r,_,!0)),m(e,r,d,!0),n.add(r)):o.has(r)||(n.forEach(t=>m(r,t,_,!0)),o.add(r))};if(!("__q_context__"in t)){t.__q_context__=0;const r=e.qwikevents;r&&(Array.isArray(r)?v(...r):v("click","input")),e.qwikevents={events:n,roots:o,push:v},m(t,"readystatechange",w),w()}';
|
|
1180
1180
|
var QWIK_LOADER_DEFAULT_DEBUG = 'const doc = document;\nconst win = window;\nconst events = /* @__PURE__ */ new Set();\nconst roots = /* @__PURE__ */ new Set([doc]);\nlet hasInitialized;\nconst nativeQuerySelectorAll = (root, selector) => Array.from(root.querySelectorAll(selector));\nconst querySelectorAll = (query) => {\n const elements = [];\n roots.forEach((root) => elements.push(...nativeQuerySelectorAll(root, query)));\n return elements;\n};\nconst findShadowRoots = (fragment) => {\n processEventOrNode(fragment);\n nativeQuerySelectorAll(fragment, "[q\\\\:shadowroot]").forEach((parent) => {\n const shadowRoot = parent.shadowRoot;\n shadowRoot && findShadowRoots(shadowRoot);\n });\n};\nconst isPromise = (promise) => promise && typeof promise.then === "function";\nlet doNotClean = true;\nconst broadcast = (infix, ev, type = ev.type) => {\n let found = doNotClean;\n querySelectorAll("[on" + infix + "\\\\:" + type + "]").forEach((el) => {\n found = true;\n dispatch(el, infix, ev, type);\n });\n if (!found) {\n window[infix.slice(1)].removeEventListener(\n type,\n infix === "-window" ? processWindowEvent : processDocumentEvent\n );\n }\n};\nconst resolveContainer = (containerEl) => {\n if (containerEl._qwikjson_ === void 0) {\n const parentJSON = containerEl === doc.documentElement ? doc.body : containerEl;\n let script = parentJSON.lastElementChild;\n while (script) {\n if (script.tagName === "SCRIPT" && script.getAttribute("type") === "qwik/json") {\n containerEl._qwikjson_ = JSON.parse(\n script.textContent.replace(/\\\\x3C(\\/?script)/gi, "<$1")\n );\n break;\n }\n script = script.previousElementSibling;\n }\n }\n};\nconst createEvent = (eventName, detail) => new CustomEvent(eventName, {\n detail\n});\nconst dispatch = async (element, scope, ev, eventName = ev.type) => {\n const attrName = "on" + scope + ":" + eventName;\n if (element.hasAttribute("preventdefault:" + eventName)) {\n ev.preventDefault();\n }\n if (element.hasAttribute("stoppropagation:" + eventName)) {\n ev.stopPropagation();\n }\n const ctx = element._qc_;\n const relevantListeners = ctx && ctx.li.filter((li) => li[0] === attrName);\n if (relevantListeners && relevantListeners.length > 0) {\n for (const listener of relevantListeners) {\n const results = listener[1].getFn([element, ev], () => element.isConnected)(ev, element);\n const cancelBubble = ev.cancelBubble;\n if (isPromise(results)) {\n await results;\n }\n if (cancelBubble) {\n ev.stopPropagation();\n }\n }\n return;\n }\n const attrValue = element.getAttribute(attrName);\n const qDispatchEvent = element.qDispatchEvent;\n if (qDispatchEvent) {\n return qDispatchEvent(ev, scope);\n }\n if (attrValue) {\n const container = element.closest(\n "[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"\n );\n const qBase = container.getAttribute("q:base");\n const qVersion = container.getAttribute("q:version") || "unknown";\n const qManifest = container.getAttribute("q:manifest-hash") || "dev";\n const base = new URL(qBase, doc.baseURI);\n for (const qrl of attrValue.split("\\n")) {\n const url = new URL(qrl, base);\n const href = url.href;\n const symbol = url.hash.replace(/^#?([^?[|]*).*$/, "$1") || "default";\n const reqTime = performance.now();\n let handler;\n let importError;\n let error;\n const isSync = qrl.startsWith("#");\n const eventData = {\n qBase,\n qManifest,\n qVersion,\n href,\n symbol,\n element,\n reqTime\n };\n if (isSync) {\n const hash = container.getAttribute("q:instance");\n handler = (doc["qFuncs_" + hash] || [])[Number.parseInt(symbol)];\n if (!handler) {\n importError = "sync";\n error = new Error("sym:" + symbol);\n }\n } else {\n emitEvent("qsymbol", eventData);\n const uri = url.href.split("#")[0];\n try {\n const module = import(\n uri\n );\n resolveContainer(container);\n handler = (await module)[symbol];\n if (!handler) {\n importError = "no-symbol";\n error = new Error(`${symbol} not in ${uri}`);\n }\n } catch (err) {\n importError || (importError = "async");\n error = err;\n }\n }\n if (!handler) {\n emitEvent("qerror", {\n importError,\n error,\n ...eventData\n });\n console.error(error);\n break;\n }\n const previousCtx = doc.__q_context__;\n if (element.isConnected) {\n try {\n doc.__q_context__ = [element, ev, url];\n const results = handler(ev, element);\n if (isPromise(results)) {\n await results;\n }\n } catch (error2) {\n emitEvent("qerror", { error: error2, ...eventData });\n } finally {\n doc.__q_context__ = previousCtx;\n }\n }\n }\n }\n};\nconst emitEvent = (eventName, detail) => {\n doc.dispatchEvent(createEvent(eventName, detail));\n};\nconst camelToKebab = (str) => str.replace(/([A-Z])/g, (a) => "-" + a.toLowerCase());\nconst processDocumentEvent = async (ev) => {\n let type = camelToKebab(ev.type);\n let element = ev.target;\n broadcast("-document", ev, type);\n while (element && element.getAttribute) {\n const results = dispatch(element, "", ev, type);\n let cancelBubble = ev.cancelBubble;\n if (isPromise(results)) {\n await results;\n }\n cancelBubble || (cancelBubble = cancelBubble || ev.cancelBubble || element.hasAttribute("stoppropagation:" + ev.type));\n element = ev.bubbles && cancelBubble !== true ? element.parentElement : null;\n }\n};\nconst processWindowEvent = (ev) => {\n broadcast("-window", ev, camelToKebab(ev.type));\n};\nconst processReadyStateChange = () => {\n var _a;\n const readyState = doc.readyState;\n if (!hasInitialized && (readyState == "interactive" || readyState == "complete")) {\n roots.forEach(findShadowRoots);\n hasInitialized = 1;\n emitEvent("qinit");\n const riC = (_a = win.requestIdleCallback) != null ? _a : win.setTimeout;\n riC.bind(win)(() => emitEvent("qidle"));\n if (events.has("qvisible")) {\n const results = querySelectorAll("[on\\\\:qvisible]");\n const observer = new IntersectionObserver((entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n observer.unobserve(entry.target);\n dispatch(entry.target, "", createEvent("qvisible", entry));\n }\n }\n });\n results.forEach((el) => observer.observe(el));\n }\n }\n};\nconst addEventListener = (el, eventName, handler, capture = false) => {\n el.addEventListener(eventName, handler, { capture, passive: false });\n};\nlet cleanTimer;\nconst processEventOrNode = (...eventNames) => {\n doNotClean = true;\n clearTimeout(cleanTimer);\n cleanTimer = setTimeout(() => doNotClean = false, 2e4);\n for (const eventNameOrNode of eventNames) {\n if (typeof eventNameOrNode === "string") {\n if (!events.has(eventNameOrNode)) {\n roots.forEach(\n (root) => addEventListener(root, eventNameOrNode, processDocumentEvent, true)\n );\n addEventListener(win, eventNameOrNode, processWindowEvent, true);\n events.add(eventNameOrNode);\n }\n } else {\n if (!roots.has(eventNameOrNode)) {\n events.forEach(\n (eventName) => addEventListener(eventNameOrNode, eventName, processDocumentEvent, true)\n );\n roots.add(eventNameOrNode);\n }\n }\n }\n};\nif (!("__q_context__" in doc)) {\n doc.__q_context__ = 0;\n const qwikevents = win.qwikevents;\n if (qwikevents) {\n if (Array.isArray(qwikevents)) {\n processEventOrNode(...qwikevents);\n } else {\n processEventOrNode("click", "input");\n }\n }\n win.qwikevents = {\n events,\n roots,\n push: processEventOrNode\n };\n addEventListener(doc, "readystatechange", processReadyStateChange);\n processReadyStateChange();\n}';
|
|
1181
1181
|
function getQwikLoaderScript(opts = {}) {
|
|
1182
1182
|
return opts.debug ? QWIK_LOADER_DEFAULT_DEBUG : QWIK_LOADER_DEFAULT_MINIFIED;
|
|
@@ -1191,14 +1191,15 @@ function getQwikPrefetchWorkerScript(opts = {}) {
|
|
|
1191
1191
|
var import_core2 = require("@qwik.dev/core");
|
|
1192
1192
|
var import_build6 = require("@qwik.dev/core/build");
|
|
1193
1193
|
var SsrNode = class {
|
|
1194
|
-
constructor(parentSsrNode, id,
|
|
1195
|
-
this.
|
|
1194
|
+
constructor(parentSsrNode, id, attributesIndex, cleanupQueue, vnodeData) {
|
|
1195
|
+
this.attributesIndex = attributesIndex;
|
|
1196
1196
|
this.cleanupQueue = cleanupQueue;
|
|
1197
1197
|
this.vnodeData = vnodeData;
|
|
1198
1198
|
var _a;
|
|
1199
1199
|
this.parentSsrNode = parentSsrNode;
|
|
1200
1200
|
(_a = this.parentSsrNode) == null ? void 0 : _a.addChild(this);
|
|
1201
1201
|
this.id = id;
|
|
1202
|
+
this.attrs = this.attributesIndex >= 0 ? this.vnodeData[this.attributesIndex] : import_core2._EMPTY_ARRAY;
|
|
1202
1203
|
if (import_build6.isDev && id.indexOf("undefined") != -1) {
|
|
1203
1204
|
throw new Error(`Invalid SSR node id: ${id}`);
|
|
1204
1205
|
}
|
|
@@ -1212,6 +1213,7 @@ var SsrNode = class {
|
|
|
1212
1213
|
id;
|
|
1213
1214
|
parentSsrNode;
|
|
1214
1215
|
children = null;
|
|
1216
|
+
attrs;
|
|
1215
1217
|
/** Local props which don't serialize; */
|
|
1216
1218
|
localProps = null;
|
|
1217
1219
|
get [import_core2._EFFECT_BACK_REF]() {
|
|
@@ -1219,7 +1221,7 @@ var SsrNode = class {
|
|
|
1219
1221
|
}
|
|
1220
1222
|
setProp(name, value) {
|
|
1221
1223
|
if (this.attrs === import_core2._EMPTY_ARRAY) {
|
|
1222
|
-
this.
|
|
1224
|
+
this.setEmptyArrayAsVNodeDataAttributes();
|
|
1223
1225
|
}
|
|
1224
1226
|
if (name.startsWith(NON_SERIALIZABLE_MARKER_PREFIX)) {
|
|
1225
1227
|
mapArray_set(this.localProps || (this.localProps = []), name, value, 0);
|
|
@@ -1230,6 +1232,17 @@ var SsrNode = class {
|
|
|
1230
1232
|
this.cleanupQueue.push(value);
|
|
1231
1233
|
}
|
|
1232
1234
|
}
|
|
1235
|
+
setEmptyArrayAsVNodeDataAttributes() {
|
|
1236
|
+
if (this.attributesIndex >= 0) {
|
|
1237
|
+
this.vnodeData[this.attributesIndex] = [];
|
|
1238
|
+
this.attrs = this.vnodeData[this.attributesIndex];
|
|
1239
|
+
} else {
|
|
1240
|
+
const newAttributesIndex = this.vnodeData.length > 1 ? 1 : 0;
|
|
1241
|
+
this.vnodeData.splice(newAttributesIndex, 0, []);
|
|
1242
|
+
this.attributesIndex = newAttributesIndex;
|
|
1243
|
+
this.attrs = this.vnodeData[this.attributesIndex];
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1233
1246
|
getProp(name) {
|
|
1234
1247
|
if (name.startsWith(NON_SERIALIZABLE_MARKER_PREFIX)) {
|
|
1235
1248
|
return this.localProps ? mapArray_get(this.localProps, name, 0) : null;
|
|
@@ -1613,7 +1626,6 @@ function isInPhrasing(text, allowInput) {
|
|
|
1613
1626
|
}
|
|
1614
1627
|
|
|
1615
1628
|
// packages/qwik/src/server/vnode-data.ts
|
|
1616
|
-
var import_core3 = require("@qwik.dev/core");
|
|
1617
1629
|
var OPEN_FRAGMENT = Number.MAX_SAFE_INTEGER;
|
|
1618
1630
|
var CLOSE_FRAGMENT = Number.MAX_SAFE_INTEGER - 1;
|
|
1619
1631
|
var WRITE_ELEMENT_ATTRS = Number.MAX_SAFE_INTEGER - 2;
|
|
@@ -1650,12 +1662,12 @@ function vNodeData_openElement(vNodeData) {
|
|
|
1650
1662
|
}
|
|
1651
1663
|
function vNodeData_createSsrNodeReference(currentComponentNode, vNodeData, depthFirstElementIdx, cleanupQueue) {
|
|
1652
1664
|
vNodeData[0] |= 8 /* REFERENCE */;
|
|
1653
|
-
let fragmentAttrs = import_core3._EMPTY_ARRAY;
|
|
1654
1665
|
const stack = [-1];
|
|
1666
|
+
let attributesIndex = -1;
|
|
1655
1667
|
for (let i = 1; i < vNodeData.length; i++) {
|
|
1656
1668
|
const value = vNodeData[i];
|
|
1657
1669
|
if (Array.isArray(value)) {
|
|
1658
|
-
|
|
1670
|
+
attributesIndex = i;
|
|
1659
1671
|
i++;
|
|
1660
1672
|
if (vNodeData[i] !== WRITE_ELEMENT_ATTRS) {
|
|
1661
1673
|
stack[stack.length - 1]++;
|
|
@@ -1663,7 +1675,6 @@ function vNodeData_createSsrNodeReference(currentComponentNode, vNodeData, depth
|
|
|
1663
1675
|
}
|
|
1664
1676
|
} else if (value === CLOSE_FRAGMENT) {
|
|
1665
1677
|
stack.pop();
|
|
1666
|
-
fragmentAttrs = import_core3._EMPTY_ARRAY;
|
|
1667
1678
|
} else if (value < 0) {
|
|
1668
1679
|
const numberOfElements = 0 - value;
|
|
1669
1680
|
stack[stack.length - 1] += numberOfElements;
|
|
@@ -1680,7 +1691,7 @@ function vNodeData_createSsrNodeReference(currentComponentNode, vNodeData, depth
|
|
|
1680
1691
|
}
|
|
1681
1692
|
}
|
|
1682
1693
|
}
|
|
1683
|
-
return new SsrNode(currentComponentNode, refId,
|
|
1694
|
+
return new SsrNode(currentComponentNode, refId, attributesIndex, cleanupQueue, vNodeData);
|
|
1684
1695
|
}
|
|
1685
1696
|
var ALPHANUMERIC = [];
|
|
1686
1697
|
function encodeAsAlphanumeric(value) {
|
|
@@ -1703,7 +1714,7 @@ function encodeAsAlphanumeric(value) {
|
|
|
1703
1714
|
}
|
|
1704
1715
|
|
|
1705
1716
|
// packages/qwik/src/server/preload-strategy.ts
|
|
1706
|
-
var
|
|
1717
|
+
var import_core3 = require("@qwik.dev/core");
|
|
1707
1718
|
|
|
1708
1719
|
// packages/qwik/src/server/preload-utils.ts
|
|
1709
1720
|
function flattenPrefetchResources(prefetchResources) {
|
|
@@ -1726,7 +1737,7 @@ function flattenPrefetchResources(prefetchResources) {
|
|
|
1726
1737
|
|
|
1727
1738
|
// packages/qwik/src/server/preload-strategy.ts
|
|
1728
1739
|
var getBundles = (qrls) => {
|
|
1729
|
-
const platform = (0,
|
|
1740
|
+
const platform = (0, import_core3.getPlatform)();
|
|
1730
1741
|
return qrls == null ? void 0 : qrls.map((qrl) => {
|
|
1731
1742
|
var _a;
|
|
1732
1743
|
const symbol = qrl.$symbol$;
|
|
@@ -1969,7 +1980,7 @@ var StringBufferWriter = class {
|
|
|
1969
1980
|
}
|
|
1970
1981
|
};
|
|
1971
1982
|
var EMPTY_OBJ = {};
|
|
1972
|
-
var SSRContainer = class extends
|
|
1983
|
+
var SSRContainer = class extends import_core4._SharedContainer {
|
|
1973
1984
|
tag;
|
|
1974
1985
|
isHtml;
|
|
1975
1986
|
writer;
|
|
@@ -2052,7 +2063,7 @@ var SSRContainer = class extends import_core5._SharedContainer {
|
|
|
2052
2063
|
}
|
|
2053
2064
|
async render(jsx) {
|
|
2054
2065
|
this.openContainer();
|
|
2055
|
-
await (0,
|
|
2066
|
+
await (0, import_core4._walkJSX)(this, jsx, {
|
|
2056
2067
|
currentStyleScoped: null,
|
|
2057
2068
|
parentComponentFrame: this.getComponentFrame()
|
|
2058
2069
|
});
|
|
@@ -2297,7 +2308,7 @@ var SSRContainer = class extends import_core5._SharedContainer {
|
|
|
2297
2308
|
}
|
|
2298
2309
|
for (let i = 0; i < injections.length; i++) {
|
|
2299
2310
|
const injection = injections[i];
|
|
2300
|
-
const jsxNode = (0,
|
|
2311
|
+
const jsxNode = (0, import_core4._jsxSplit)(injection.tag, null, injection.attributes || {}, null, 0, null);
|
|
2301
2312
|
if (injection.location === "head") {
|
|
2302
2313
|
this.additionalHeadNodes.push(jsxNode);
|
|
2303
2314
|
} else {
|
|
@@ -2317,7 +2328,7 @@ var SSRContainer = class extends import_core5._SharedContainer {
|
|
|
2317
2328
|
this.styleIds.add(styleId);
|
|
2318
2329
|
if (((_a = this.currentElementFrame) == null ? void 0 : _a.elementName) === "html") {
|
|
2319
2330
|
this.additionalHeadNodes.push(
|
|
2320
|
-
(0,
|
|
2331
|
+
(0, import_core4._jsxSorted)(
|
|
2321
2332
|
"style",
|
|
2322
2333
|
null,
|
|
2323
2334
|
{ dangerouslySetInnerHTML: content, [QStyle]: styleId },
|
|
@@ -2429,6 +2440,7 @@ var SSRContainer = class extends import_core5._SharedContainer {
|
|
|
2429
2440
|
for (let i = 0; i < fragmentAttrs.length; ) {
|
|
2430
2441
|
const key = fragmentAttrs[i++];
|
|
2431
2442
|
let value = fragmentAttrs[i++];
|
|
2443
|
+
let encodeValue = false;
|
|
2432
2444
|
if (typeof value !== "string") {
|
|
2433
2445
|
const rootId = addRoot(value);
|
|
2434
2446
|
if (rootId === void 0) {
|
|
@@ -2450,6 +2462,7 @@ var SSRContainer = class extends import_core5._SharedContainer {
|
|
|
2450
2462
|
write(VNodeDataChar.PROPS_CHAR);
|
|
2451
2463
|
break;
|
|
2452
2464
|
case ELEMENT_KEY:
|
|
2465
|
+
encodeValue = true;
|
|
2453
2466
|
write(VNodeDataChar.KEY_CHAR);
|
|
2454
2467
|
break;
|
|
2455
2468
|
case ELEMENT_SEQ:
|
|
@@ -2476,7 +2489,15 @@ var SSRContainer = class extends import_core5._SharedContainer {
|
|
|
2476
2489
|
write(key);
|
|
2477
2490
|
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2478
2491
|
}
|
|
2479
|
-
|
|
2492
|
+
const encodedValue = encodeValue ? encodeURI(value) : value;
|
|
2493
|
+
const isEncoded = encodeValue ? encodedValue !== value : false;
|
|
2494
|
+
if (isEncoded) {
|
|
2495
|
+
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2496
|
+
write(encodedValue);
|
|
2497
|
+
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2498
|
+
} else {
|
|
2499
|
+
write(value);
|
|
2500
|
+
}
|
|
2480
2501
|
}
|
|
2481
2502
|
}
|
|
2482
2503
|
this.closeElement();
|
|
@@ -2570,7 +2591,7 @@ var SSRContainer = class extends import_core5._SharedContainer {
|
|
|
2570
2591
|
if (unclaimedProjections.length) {
|
|
2571
2592
|
const previousCurrentComponentNode = this.currentComponentNode;
|
|
2572
2593
|
try {
|
|
2573
|
-
this.openElement(QTemplate, ["
|
|
2594
|
+
this.openElement(QTemplate, ["hidden", true, "aria-hidden", "true"], null);
|
|
2574
2595
|
let idx = 0;
|
|
2575
2596
|
let ssrComponentNode = null;
|
|
2576
2597
|
let ssrComponentFrame = null;
|
|
@@ -2601,7 +2622,7 @@ var SSRContainer = class extends import_core5._SharedContainer {
|
|
|
2601
2622
|
lastNode.vnodeData[0] |= 16 /* SERIALIZE */;
|
|
2602
2623
|
}
|
|
2603
2624
|
ssrComponentNode == null ? void 0 : ssrComponentNode.setProp(value, lastNode.id);
|
|
2604
|
-
await (0,
|
|
2625
|
+
await (0, import_core4._walkJSX)(this, children, {
|
|
2605
2626
|
currentStyleScoped: scopedStyleId,
|
|
2606
2627
|
parentComponentFrame: null
|
|
2607
2628
|
});
|
|
@@ -2731,7 +2752,7 @@ var SSRContainer = class extends import_core5._SharedContainer {
|
|
|
2731
2752
|
}
|
|
2732
2753
|
if (key === "ref") {
|
|
2733
2754
|
const lastNode = this.getOrCreateLastNode();
|
|
2734
|
-
if ((0,
|
|
2755
|
+
if ((0, import_core4.isSignal)(value)) {
|
|
2735
2756
|
value.$untrackedValue$ = new DomRef(lastNode);
|
|
2736
2757
|
continue;
|
|
2737
2758
|
} else if (typeof value === "function") {
|
|
@@ -2743,9 +2764,9 @@ var SSRContainer = class extends import_core5._SharedContainer {
|
|
|
2743
2764
|
throw qError(15 /* invalidRefValue */, [currentFile]);
|
|
2744
2765
|
}
|
|
2745
2766
|
}
|
|
2746
|
-
if ((0,
|
|
2767
|
+
if ((0, import_core4.isSignal)(value)) {
|
|
2747
2768
|
const lastNode = this.getOrCreateLastNode();
|
|
2748
|
-
const signalData = new
|
|
2769
|
+
const signalData = new import_core4._SubscriptionData({
|
|
2749
2770
|
$scopedStyleIdPrefix$: styleScopedId,
|
|
2750
2771
|
$isConst$: isConst
|
|
2751
2772
|
});
|
|
@@ -3001,7 +3022,7 @@ var Q_FUNCS_PREFIX = 'document["qFuncs_HASH"]=';
|
|
|
3001
3022
|
// packages/qwik/src/server/index.ts
|
|
3002
3023
|
async function setServerPlatform2(manifest) {
|
|
3003
3024
|
const platform = createPlatform({ manifest }, resolveManifest(manifest));
|
|
3004
|
-
(0,
|
|
3025
|
+
(0, import_core5.setPlatform)(platform);
|
|
3005
3026
|
}
|
|
3006
3027
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3007
3028
|
0 && (module.exports = {
|
package/dist/server.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/server 2.0.0-beta.
|
|
3
|
+
* @qwik.dev/core/server 2.0.0-beta.3-dev+aa098fc
|
|
4
4
|
* Copyright QwikDev. All Rights Reserved.
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
|
|
@@ -1122,7 +1122,7 @@ function getBuildBase(opts) {
|
|
|
1122
1122
|
return `${import.meta.env.BASE_URL || "/"}build/`;
|
|
1123
1123
|
}
|
|
1124
1124
|
var versions = {
|
|
1125
|
-
qwik: "2.0.0-beta.
|
|
1125
|
+
qwik: "2.0.0-beta.3-dev+aa098fc",
|
|
1126
1126
|
qwikDom: "2.1.19"
|
|
1127
1127
|
};
|
|
1128
1128
|
|
|
@@ -1138,7 +1138,7 @@ import {
|
|
|
1138
1138
|
import { isDev as isDev4 } from "@qwik.dev/core/build";
|
|
1139
1139
|
|
|
1140
1140
|
// packages/qwik/src/server/scripts.ts
|
|
1141
|
-
var QWIK_LOADER_DEFAULT_MINIFIED = 'const t=document,e=window,n=new Set,o=new Set([t]);let r;const s=(t,e)=>Array.from(t.querySelectorAll(e)),i=t=>{const e=[];return o.forEach(
|
|
1141
|
+
var QWIK_LOADER_DEFAULT_MINIFIED = 'const t=document,e=window,n=new Set,o=new Set([t]);let r;const s=(t,e)=>Array.from(t.querySelectorAll(e)),i=t=>{const e=[];return o.forEach(n=>e.push(...s(n,t))),e},a=t=>{v(t),s(t,"[q\\\\:shadowroot]").forEach(t=>{const e=t.shadowRoot;e&&a(e)})},c=t=>t&&"function"==typeof t.then;let l=!0;const f=(t,e,n=e.type)=>{let o=l;i("[on"+t+"\\\\:"+n+"]").forEach(r=>{o=!0,b(r,t,e,n)}),o||window[t.slice(1)].removeEventListener(n,"-window"===t?d:_)},p=e=>{if(void 0===e._qwikjson_){let n=(e===t.documentElement?t.body:e).lastElementChild;for(;n;){if("SCRIPT"===n.tagName&&"qwik/json"===n.getAttribute("type")){e._qwikjson_=JSON.parse(n.textContent.replace(/\\\\x3C(\\/?script)/gi,"<$1"));break}n=n.previousElementSibling}}},u=(t,e)=>new CustomEvent(t,{detail:e}),b=async(e,n,o,r=o.type)=>{const s="on"+n+":"+r;e.hasAttribute("preventdefault:"+r)&&o.preventDefault(),e.hasAttribute("stoppropagation:"+r)&&o.stopPropagation();const i=e._qc_,a=i&&i.li.filter(t=>t[0]===s);if(a&&a.length>0){for(const t of a){const n=t[1].getFn([e,o],()=>e.isConnected)(o,e),r=o.cancelBubble;c(n)&&await n,r&&o.stopPropagation()}return}const l=e.getAttribute(s),f=e.qDispatchEvent;if(f)return f(o,n);if(l){const n=e.closest("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"),r=n.getAttribute("q:base"),s=n.getAttribute("q:version")||"unknown",i=n.getAttribute("q:manifest-hash")||"dev",a=new URL(r,t.baseURI);for(const f of l.split("\\n")){const l=new URL(f,a),u=l.href,b=l.hash.replace(/^#?([^?[|]*).*$/,"$1")||"default",h=performance.now();let _,d,w;const m=f.startsWith("#"),y={qBase:r,qManifest:i,qVersion:s,href:u,symbol:b,element:e,reqTime:h};if(m){const e=n.getAttribute("q:instance");_=(t["qFuncs_"+e]||[])[Number.parseInt(b)],_||(d="sync",w=Error("sym:"+b))}else{q("qsymbol",y);const t=l.href.split("#")[0];try{const e=import(t);p(n),_=(await e)[b],_||(d="no-symbol",w=Error(`${b} not in ${t}`))}catch(t){d||(d="async"),w=t}}if(!_){q("qerror",{importError:d,error:w,...y}),console.error(w);break}const v=t.__q_context__;if(e.isConnected)try{t.__q_context__=[e,o,l];const n=_(o,e);c(n)&&await n}catch(t){q("qerror",{error:t,...y})}finally{t.__q_context__=v}}}},q=(e,n)=>{t.dispatchEvent(u(e,n))},h=t=>t.replace(/([A-Z])/g,t=>"-"+t.toLowerCase()),_=async t=>{let e=h(t.type),n=t.target;for(f("-document",t,e);n&&n.getAttribute;){const o=b(n,"",t,e);let r=t.cancelBubble;c(o)&&await o,r||(r=r||t.cancelBubble||n.hasAttribute("stoppropagation:"+t.type)),n=t.bubbles&&!0!==r?n.parentElement:null}},d=t=>{f("-window",t,h(t.type))},w=()=>{var s;const c=t.readyState;if(!r&&("interactive"==c||"complete"==c)&&(o.forEach(a),r=1,q("qinit"),(null!=(s=e.requestIdleCallback)?s:e.setTimeout).bind(e)(()=>q("qidle")),n.has("qvisible"))){const t=i("[on\\\\:qvisible]"),e=new IntersectionObserver(t=>{for(const n of t)n.isIntersecting&&(e.unobserve(n.target),b(n.target,"",u("qvisible",n)))});t.forEach(t=>e.observe(t))}},m=(t,e,n,o=!1)=>{t.addEventListener(e,n,{capture:o,passive:!1})};let y;const v=(...t)=>{l=!0,clearTimeout(y),y=setTimeout(()=>l=!1,2e4);for(const r of t)"string"==typeof r?n.has(r)||(o.forEach(t=>m(t,r,_,!0)),m(e,r,d,!0),n.add(r)):o.has(r)||(n.forEach(t=>m(r,t,_,!0)),o.add(r))};if(!("__q_context__"in t)){t.__q_context__=0;const r=e.qwikevents;r&&(Array.isArray(r)?v(...r):v("click","input")),e.qwikevents={events:n,roots:o,push:v},m(t,"readystatechange",w),w()}';
|
|
1142
1142
|
var QWIK_LOADER_DEFAULT_DEBUG = 'const doc = document;\nconst win = window;\nconst events = /* @__PURE__ */ new Set();\nconst roots = /* @__PURE__ */ new Set([doc]);\nlet hasInitialized;\nconst nativeQuerySelectorAll = (root, selector) => Array.from(root.querySelectorAll(selector));\nconst querySelectorAll = (query) => {\n const elements = [];\n roots.forEach((root) => elements.push(...nativeQuerySelectorAll(root, query)));\n return elements;\n};\nconst findShadowRoots = (fragment) => {\n processEventOrNode(fragment);\n nativeQuerySelectorAll(fragment, "[q\\\\:shadowroot]").forEach((parent) => {\n const shadowRoot = parent.shadowRoot;\n shadowRoot && findShadowRoots(shadowRoot);\n });\n};\nconst isPromise = (promise) => promise && typeof promise.then === "function";\nlet doNotClean = true;\nconst broadcast = (infix, ev, type = ev.type) => {\n let found = doNotClean;\n querySelectorAll("[on" + infix + "\\\\:" + type + "]").forEach((el) => {\n found = true;\n dispatch(el, infix, ev, type);\n });\n if (!found) {\n window[infix.slice(1)].removeEventListener(\n type,\n infix === "-window" ? processWindowEvent : processDocumentEvent\n );\n }\n};\nconst resolveContainer = (containerEl) => {\n if (containerEl._qwikjson_ === void 0) {\n const parentJSON = containerEl === doc.documentElement ? doc.body : containerEl;\n let script = parentJSON.lastElementChild;\n while (script) {\n if (script.tagName === "SCRIPT" && script.getAttribute("type") === "qwik/json") {\n containerEl._qwikjson_ = JSON.parse(\n script.textContent.replace(/\\\\x3C(\\/?script)/gi, "<$1")\n );\n break;\n }\n script = script.previousElementSibling;\n }\n }\n};\nconst createEvent = (eventName, detail) => new CustomEvent(eventName, {\n detail\n});\nconst dispatch = async (element, scope, ev, eventName = ev.type) => {\n const attrName = "on" + scope + ":" + eventName;\n if (element.hasAttribute("preventdefault:" + eventName)) {\n ev.preventDefault();\n }\n if (element.hasAttribute("stoppropagation:" + eventName)) {\n ev.stopPropagation();\n }\n const ctx = element._qc_;\n const relevantListeners = ctx && ctx.li.filter((li) => li[0] === attrName);\n if (relevantListeners && relevantListeners.length > 0) {\n for (const listener of relevantListeners) {\n const results = listener[1].getFn([element, ev], () => element.isConnected)(ev, element);\n const cancelBubble = ev.cancelBubble;\n if (isPromise(results)) {\n await results;\n }\n if (cancelBubble) {\n ev.stopPropagation();\n }\n }\n return;\n }\n const attrValue = element.getAttribute(attrName);\n const qDispatchEvent = element.qDispatchEvent;\n if (qDispatchEvent) {\n return qDispatchEvent(ev, scope);\n }\n if (attrValue) {\n const container = element.closest(\n "[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"\n );\n const qBase = container.getAttribute("q:base");\n const qVersion = container.getAttribute("q:version") || "unknown";\n const qManifest = container.getAttribute("q:manifest-hash") || "dev";\n const base = new URL(qBase, doc.baseURI);\n for (const qrl of attrValue.split("\\n")) {\n const url = new URL(qrl, base);\n const href = url.href;\n const symbol = url.hash.replace(/^#?([^?[|]*).*$/, "$1") || "default";\n const reqTime = performance.now();\n let handler;\n let importError;\n let error;\n const isSync = qrl.startsWith("#");\n const eventData = {\n qBase,\n qManifest,\n qVersion,\n href,\n symbol,\n element,\n reqTime\n };\n if (isSync) {\n const hash = container.getAttribute("q:instance");\n handler = (doc["qFuncs_" + hash] || [])[Number.parseInt(symbol)];\n if (!handler) {\n importError = "sync";\n error = new Error("sym:" + symbol);\n }\n } else {\n emitEvent("qsymbol", eventData);\n const uri = url.href.split("#")[0];\n try {\n const module = import(\n uri\n );\n resolveContainer(container);\n handler = (await module)[symbol];\n if (!handler) {\n importError = "no-symbol";\n error = new Error(`${symbol} not in ${uri}`);\n }\n } catch (err) {\n importError || (importError = "async");\n error = err;\n }\n }\n if (!handler) {\n emitEvent("qerror", {\n importError,\n error,\n ...eventData\n });\n console.error(error);\n break;\n }\n const previousCtx = doc.__q_context__;\n if (element.isConnected) {\n try {\n doc.__q_context__ = [element, ev, url];\n const results = handler(ev, element);\n if (isPromise(results)) {\n await results;\n }\n } catch (error2) {\n emitEvent("qerror", { error: error2, ...eventData });\n } finally {\n doc.__q_context__ = previousCtx;\n }\n }\n }\n }\n};\nconst emitEvent = (eventName, detail) => {\n doc.dispatchEvent(createEvent(eventName, detail));\n};\nconst camelToKebab = (str) => str.replace(/([A-Z])/g, (a) => "-" + a.toLowerCase());\nconst processDocumentEvent = async (ev) => {\n let type = camelToKebab(ev.type);\n let element = ev.target;\n broadcast("-document", ev, type);\n while (element && element.getAttribute) {\n const results = dispatch(element, "", ev, type);\n let cancelBubble = ev.cancelBubble;\n if (isPromise(results)) {\n await results;\n }\n cancelBubble || (cancelBubble = cancelBubble || ev.cancelBubble || element.hasAttribute("stoppropagation:" + ev.type));\n element = ev.bubbles && cancelBubble !== true ? element.parentElement : null;\n }\n};\nconst processWindowEvent = (ev) => {\n broadcast("-window", ev, camelToKebab(ev.type));\n};\nconst processReadyStateChange = () => {\n var _a;\n const readyState = doc.readyState;\n if (!hasInitialized && (readyState == "interactive" || readyState == "complete")) {\n roots.forEach(findShadowRoots);\n hasInitialized = 1;\n emitEvent("qinit");\n const riC = (_a = win.requestIdleCallback) != null ? _a : win.setTimeout;\n riC.bind(win)(() => emitEvent("qidle"));\n if (events.has("qvisible")) {\n const results = querySelectorAll("[on\\\\:qvisible]");\n const observer = new IntersectionObserver((entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n observer.unobserve(entry.target);\n dispatch(entry.target, "", createEvent("qvisible", entry));\n }\n }\n });\n results.forEach((el) => observer.observe(el));\n }\n }\n};\nconst addEventListener = (el, eventName, handler, capture = false) => {\n el.addEventListener(eventName, handler, { capture, passive: false });\n};\nlet cleanTimer;\nconst processEventOrNode = (...eventNames) => {\n doNotClean = true;\n clearTimeout(cleanTimer);\n cleanTimer = setTimeout(() => doNotClean = false, 2e4);\n for (const eventNameOrNode of eventNames) {\n if (typeof eventNameOrNode === "string") {\n if (!events.has(eventNameOrNode)) {\n roots.forEach(\n (root) => addEventListener(root, eventNameOrNode, processDocumentEvent, true)\n );\n addEventListener(win, eventNameOrNode, processWindowEvent, true);\n events.add(eventNameOrNode);\n }\n } else {\n if (!roots.has(eventNameOrNode)) {\n events.forEach(\n (eventName) => addEventListener(eventNameOrNode, eventName, processDocumentEvent, true)\n );\n roots.add(eventNameOrNode);\n }\n }\n }\n};\nif (!("__q_context__" in doc)) {\n doc.__q_context__ = 0;\n const qwikevents = win.qwikevents;\n if (qwikevents) {\n if (Array.isArray(qwikevents)) {\n processEventOrNode(...qwikevents);\n } else {\n processEventOrNode("click", "input");\n }\n }\n win.qwikevents = {\n events,\n roots,\n push: processEventOrNode\n };\n addEventListener(doc, "readystatechange", processReadyStateChange);\n processReadyStateChange();\n}';
|
|
1143
1143
|
function getQwikLoaderScript(opts = {}) {
|
|
1144
1144
|
return opts.debug ? QWIK_LOADER_DEFAULT_DEBUG : QWIK_LOADER_DEFAULT_MINIFIED;
|
|
@@ -1157,8 +1157,8 @@ import {
|
|
|
1157
1157
|
} from "@qwik.dev/core";
|
|
1158
1158
|
import { isDev as isDev3 } from "@qwik.dev/core/build";
|
|
1159
1159
|
var SsrNode = class {
|
|
1160
|
-
constructor(parentSsrNode, id,
|
|
1161
|
-
this.
|
|
1160
|
+
constructor(parentSsrNode, id, attributesIndex, cleanupQueue, vnodeData) {
|
|
1161
|
+
this.attributesIndex = attributesIndex;
|
|
1162
1162
|
this.cleanupQueue = cleanupQueue;
|
|
1163
1163
|
this.vnodeData = vnodeData;
|
|
1164
1164
|
__publicField(this, "__brand__", "SsrNode");
|
|
@@ -1170,11 +1170,13 @@ var SsrNode = class {
|
|
|
1170
1170
|
__publicField(this, "id");
|
|
1171
1171
|
__publicField(this, "parentSsrNode");
|
|
1172
1172
|
__publicField(this, "children", null);
|
|
1173
|
+
__publicField(this, "attrs");
|
|
1173
1174
|
/** Local props which don't serialize; */
|
|
1174
1175
|
__publicField(this, "localProps", null);
|
|
1175
1176
|
this.parentSsrNode = parentSsrNode;
|
|
1176
1177
|
this.parentSsrNode?.addChild(this);
|
|
1177
1178
|
this.id = id;
|
|
1179
|
+
this.attrs = this.attributesIndex >= 0 ? this.vnodeData[this.attributesIndex] : _EMPTY_ARRAY;
|
|
1178
1180
|
if (isDev3 && id.indexOf("undefined") != -1) {
|
|
1179
1181
|
throw new Error(`Invalid SSR node id: ${id}`);
|
|
1180
1182
|
}
|
|
@@ -1184,7 +1186,7 @@ var SsrNode = class {
|
|
|
1184
1186
|
}
|
|
1185
1187
|
setProp(name, value) {
|
|
1186
1188
|
if (this.attrs === _EMPTY_ARRAY) {
|
|
1187
|
-
this.
|
|
1189
|
+
this.setEmptyArrayAsVNodeDataAttributes();
|
|
1188
1190
|
}
|
|
1189
1191
|
if (name.startsWith(NON_SERIALIZABLE_MARKER_PREFIX)) {
|
|
1190
1192
|
mapArray_set(this.localProps || (this.localProps = []), name, value, 0);
|
|
@@ -1195,6 +1197,17 @@ var SsrNode = class {
|
|
|
1195
1197
|
this.cleanupQueue.push(value);
|
|
1196
1198
|
}
|
|
1197
1199
|
}
|
|
1200
|
+
setEmptyArrayAsVNodeDataAttributes() {
|
|
1201
|
+
if (this.attributesIndex >= 0) {
|
|
1202
|
+
this.vnodeData[this.attributesIndex] = [];
|
|
1203
|
+
this.attrs = this.vnodeData[this.attributesIndex];
|
|
1204
|
+
} else {
|
|
1205
|
+
const newAttributesIndex = this.vnodeData.length > 1 ? 1 : 0;
|
|
1206
|
+
this.vnodeData.splice(newAttributesIndex, 0, []);
|
|
1207
|
+
this.attributesIndex = newAttributesIndex;
|
|
1208
|
+
this.attrs = this.vnodeData[this.attributesIndex];
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1198
1211
|
getProp(name) {
|
|
1199
1212
|
if (name.startsWith(NON_SERIALIZABLE_MARKER_PREFIX)) {
|
|
1200
1213
|
return this.localProps ? mapArray_get(this.localProps, name, 0) : null;
|
|
@@ -1578,7 +1591,6 @@ function isInPhrasing(text, allowInput) {
|
|
|
1578
1591
|
}
|
|
1579
1592
|
|
|
1580
1593
|
// packages/qwik/src/server/vnode-data.ts
|
|
1581
|
-
import { _EMPTY_ARRAY as _EMPTY_ARRAY2 } from "@qwik.dev/core";
|
|
1582
1594
|
var OPEN_FRAGMENT = Number.MAX_SAFE_INTEGER;
|
|
1583
1595
|
var CLOSE_FRAGMENT = Number.MAX_SAFE_INTEGER - 1;
|
|
1584
1596
|
var WRITE_ELEMENT_ATTRS = Number.MAX_SAFE_INTEGER - 2;
|
|
@@ -1615,12 +1627,12 @@ function vNodeData_openElement(vNodeData) {
|
|
|
1615
1627
|
}
|
|
1616
1628
|
function vNodeData_createSsrNodeReference(currentComponentNode, vNodeData, depthFirstElementIdx, cleanupQueue) {
|
|
1617
1629
|
vNodeData[0] |= 8 /* REFERENCE */;
|
|
1618
|
-
let fragmentAttrs = _EMPTY_ARRAY2;
|
|
1619
1630
|
const stack = [-1];
|
|
1631
|
+
let attributesIndex = -1;
|
|
1620
1632
|
for (let i = 1; i < vNodeData.length; i++) {
|
|
1621
1633
|
const value = vNodeData[i];
|
|
1622
1634
|
if (Array.isArray(value)) {
|
|
1623
|
-
|
|
1635
|
+
attributesIndex = i;
|
|
1624
1636
|
i++;
|
|
1625
1637
|
if (vNodeData[i] !== WRITE_ELEMENT_ATTRS) {
|
|
1626
1638
|
stack[stack.length - 1]++;
|
|
@@ -1628,7 +1640,6 @@ function vNodeData_createSsrNodeReference(currentComponentNode, vNodeData, depth
|
|
|
1628
1640
|
}
|
|
1629
1641
|
} else if (value === CLOSE_FRAGMENT) {
|
|
1630
1642
|
stack.pop();
|
|
1631
|
-
fragmentAttrs = _EMPTY_ARRAY2;
|
|
1632
1643
|
} else if (value < 0) {
|
|
1633
1644
|
const numberOfElements = 0 - value;
|
|
1634
1645
|
stack[stack.length - 1] += numberOfElements;
|
|
@@ -1645,7 +1656,7 @@ function vNodeData_createSsrNodeReference(currentComponentNode, vNodeData, depth
|
|
|
1645
1656
|
}
|
|
1646
1657
|
}
|
|
1647
1658
|
}
|
|
1648
|
-
return new SsrNode(currentComponentNode, refId,
|
|
1659
|
+
return new SsrNode(currentComponentNode, refId, attributesIndex, cleanupQueue, vNodeData);
|
|
1649
1660
|
}
|
|
1650
1661
|
var ALPHANUMERIC = [];
|
|
1651
1662
|
function encodeAsAlphanumeric(value) {
|
|
@@ -2390,6 +2401,7 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2390
2401
|
for (let i = 0; i < fragmentAttrs.length; ) {
|
|
2391
2402
|
const key = fragmentAttrs[i++];
|
|
2392
2403
|
let value = fragmentAttrs[i++];
|
|
2404
|
+
let encodeValue = false;
|
|
2393
2405
|
if (typeof value !== "string") {
|
|
2394
2406
|
const rootId = addRoot(value);
|
|
2395
2407
|
if (rootId === void 0) {
|
|
@@ -2411,6 +2423,7 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2411
2423
|
write(VNodeDataChar.PROPS_CHAR);
|
|
2412
2424
|
break;
|
|
2413
2425
|
case ELEMENT_KEY:
|
|
2426
|
+
encodeValue = true;
|
|
2414
2427
|
write(VNodeDataChar.KEY_CHAR);
|
|
2415
2428
|
break;
|
|
2416
2429
|
case ELEMENT_SEQ:
|
|
@@ -2437,7 +2450,15 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2437
2450
|
write(key);
|
|
2438
2451
|
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2439
2452
|
}
|
|
2440
|
-
|
|
2453
|
+
const encodedValue = encodeValue ? encodeURI(value) : value;
|
|
2454
|
+
const isEncoded = encodeValue ? encodedValue !== value : false;
|
|
2455
|
+
if (isEncoded) {
|
|
2456
|
+
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2457
|
+
write(encodedValue);
|
|
2458
|
+
write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2459
|
+
} else {
|
|
2460
|
+
write(value);
|
|
2461
|
+
}
|
|
2441
2462
|
}
|
|
2442
2463
|
}
|
|
2443
2464
|
this.closeElement();
|
|
@@ -2526,7 +2547,7 @@ var SSRContainer = class extends _SharedContainer {
|
|
|
2526
2547
|
if (unclaimedProjections.length) {
|
|
2527
2548
|
const previousCurrentComponentNode = this.currentComponentNode;
|
|
2528
2549
|
try {
|
|
2529
|
-
this.openElement(QTemplate, ["
|
|
2550
|
+
this.openElement(QTemplate, ["hidden", true, "aria-hidden", "true"], null);
|
|
2530
2551
|
let idx = 0;
|
|
2531
2552
|
let ssrComponentNode = null;
|
|
2532
2553
|
let ssrComponentFrame = null;
|
|
@@ -20510,8 +20510,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
20510
20510
|
--color-select-menu-backdrop-border: rgba(0, 0, 0, 0);
|
|
20511
20511
|
--color-select-menu-tap-highlight: rgba(175, 184, 193, 0.5);
|
|
20512
20512
|
--color-select-menu-tap-focus-bg: #b6e3ff;
|
|
20513
|
-
--color-overlay-shadow:
|
|
20514
|
-
0 8px 24px rgba(66, 74, 83, 0.12);
|
|
20513
|
+
--color-overlay-shadow:
|
|
20514
|
+
0 1px 3px rgba(27, 31, 36, 0.12), 0 8px 24px rgba(66, 74, 83, 0.12);
|
|
20515
20515
|
--color-header-text: rgba(255, 255, 255, 0.7);
|
|
20516
20516
|
--color-header-bg: #24292f;
|
|
20517
20517
|
--color-header-logo: #ffffff;
|
|
@@ -20947,8 +20947,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
20947
20947
|
--color-select-menu-backdrop-border: #484f58;
|
|
20948
20948
|
--color-select-menu-tap-highlight: rgba(48, 54, 61, 0.5);
|
|
20949
20949
|
--color-select-menu-tap-focus-bg: #0c2d6b;
|
|
20950
|
-
--color-overlay-shadow:
|
|
20951
|
-
0 16px 32px rgba(1, 4, 9, 0.85);
|
|
20950
|
+
--color-overlay-shadow:
|
|
20951
|
+
0 0 0 1px #30363d, 0 16px 32px rgba(1, 4, 9, 0.85);
|
|
20952
20952
|
--color-header-text: rgba(240, 246, 252, 0.7);
|
|
20953
20953
|
--color-header-bg: #161b22;
|
|
20954
20954
|
--color-header-logo: #f0f6fc;
|
|
@@ -21196,11 +21196,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
21196
21196
|
}
|
|
21197
21197
|
}
|
|
21198
21198
|
:root {
|
|
21199
|
-
--box-shadow:
|
|
21199
|
+
--box-shadow:
|
|
21200
|
+
rgba(0, 0, 0, 0.133) 0px 1.6px 3.6px 0px,
|
|
21200
21201
|
rgba(0, 0, 0, 0.11) 0px 0.3px 0.9px 0px;
|
|
21201
|
-
--box-shadow-thick:
|
|
21202
|
-
rgb(0 0 0 /
|
|
21203
|
-
rgb(0 0 0 /
|
|
21202
|
+
--box-shadow-thick:
|
|
21203
|
+
rgb(0 0 0 / 10%) 0px 1.8px 1.9px, rgb(0 0 0 / 15%) 0px 6.1px 6.3px,
|
|
21204
|
+
rgb(0 0 0 / 10%) 0px -2px 4px, rgb(0 0 0 / 15%) 0px -6.1px 12px,
|
|
21205
|
+
rgb(0 0 0 / 25%) 0px 6px 12px;
|
|
21204
21206
|
}
|
|
21205
21207
|
* {
|
|
21206
21208
|
box-sizing: border-box;
|