@lit-labs/ssr-client
Advanced tools
Comparing version 1.1.2-pre.0 to 1.1.2
@@ -105,3 +105,3 @@ /** | ||
export const renderLight = directive(RenderLightDirective); | ||
export const isRenderLightDirective = (value) => getDirectiveClass(value)?._$litRenderLight; | ||
export const isRenderLightDirective = (value) => { var _a; return (_a = getDirectiveClass(value)) === null || _a === void 0 ? void 0 : _a._$litRenderLight; }; | ||
//# sourceMappingURL=render-light.js.map |
@@ -75,3 +75,3 @@ /** | ||
const stack = []; | ||
const walker = document.createTreeWalker(container, NodeFilter.SHOW_COMMENT); | ||
const walker = document.createTreeWalker(container, NodeFilter.SHOW_COMMENT, null, false); | ||
let marker; | ||
@@ -89,4 +89,4 @@ // Walk the DOM looking for part marker comments | ||
currentChildPart = openChildPart(rootValue, marker, stack, options); | ||
rootPart ??= currentChildPart; | ||
rootPartMarker ??= marker; | ||
rootPart !== null && rootPart !== void 0 ? rootPart : (rootPart = currentChildPart); | ||
rootPartMarker !== null && rootPartMarker !== void 0 ? rootPartMarker : (rootPartMarker = marker); | ||
} | ||
@@ -93,0 +93,0 @@ else if (markerText.startsWith('lit-node')) { |
@@ -1,2 +0,2 @@ | ||
import{directive as e,Directive as t}from"lit/directive.js";import{getDirectiveClass as r}from"lit/directive-helpers.js"; | ||
import{directive as e,Directive as r}from"lit/directive.js";import{getDirectiveClass as t}from"lit/directive-helpers.js"; | ||
/** | ||
@@ -6,3 +6,3 @@ * @license | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/class i extends t{render(){}update(e){const t=e.parentNode;if("function"==typeof t.renderLight)return t.renderLight()}}i.t=!0;const o=e(i),s=e=>r(e)?.t;export{s as isRenderLightDirective,o as renderLight}; | ||
*/class i extends r{render(){}update(e){const r=e.parentNode;if("function"==typeof r.renderLight)return r.renderLight()}}i.t=!0;const o=e(i),n=e=>{var r;return null===(r=t(e))||void 0===r?void 0:r.t};export{n as isRenderLightDirective,o as renderLight}; | ||
//# sourceMappingURL=render-light.js.map |
@@ -6,3 +6,3 @@ import{noChange as e}from"lit-html";import{_$LH as t}from"lit-html/private-ssr-support.js";import{PartType as r}from"lit-html/directive.js";import{isPrimitive as n,isTemplateResult as o,isSingleExpression as a}from"lit-html/directive-helpers.js"; | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/const{TemplateInstance:i,isIterable:l,resolveDirective:s,ChildPart:c,ElementPart:d}=t,p=(e,t,r={})=>{if(void 0!==t._$litPart$)throw Error("container already contains a live render");let n,o,a;const i=[],l=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT);let s;for(;null!==(s=l.nextNode());){const t=s.data;if(t.startsWith("lit-part")){if(0===i.length&&void 0!==n)throw Error(`There must be only one root part per container. Found a part marker (${s}) when we already have a root part marker (${o})`);a=f(e,s,i,r),n??=a,o??=s}else if(t.startsWith("lit-node"))h(s,i,r);else if(t.startsWith("/lit-part")){if(1===i.length&&a!==n)throw Error("internal error");a=m(s,a,i)}}if(void 0===n){const e=t instanceof ShadowRoot?"{container.host.localName}'s shadow root":t instanceof DocumentFragment?"DocumentFragment":t.localName;console.error(`There should be exactly one root part in a render container, but we didn't find any in ${e}.`)}t._$litPart$=n},f=(t,r,a,d)=>{let p,f;if(0===a.length)f=new c(r,null,void 0,d),p=t;else{const e=a[a.length-1];if("template-instance"===e.type)f=new c(r,null,e.instance,d),e.instance._$AV.push(f),p=e.result.values[e.instancePartIndex++],e.templatePartIndex++;else if("iterable"===e.type){f=new c(r,null,e.part,d);const t=e.iterator.next();if(t.done)throw p=void 0,e.done=!0,Error("Unhandled shorter than expected iterable");p=t.value,e.part._$AH.push(f)}else f=new c(r,null,e.part,d)}if(p=s(f,p),p===e)a.push({part:f,type:"leaf"});else if(n(p))a.push({part:f,type:"leaf"}),f._$AH=p;else if(o(p)){const e="lit-part "+u(p);if(r.data!==e)throw Error("Hydration value mismatch: Unexpected TemplateResult rendered to part");{const e=c.prototype._$AC(p),t=new i(e,f);a.push({type:"template-instance",instance:t,part:f,templatePartIndex:0,instancePartIndex:0,result:p}),f._$AH=t}}else l(p)?(a.push({part:f,type:"iterable",value:p,iterator:p[Symbol.iterator](),done:!1}),f._$AH=[]):(a.push({part:f,type:"leaf"}),f._$AH=p??"");return f},m=(e,t,r)=>{if(void 0===t)throw Error("unbalanced part marker");t._$AB=e;const n=r.pop();if("iterable"===n.type&&!n.iterator.next().done)throw Error("unexpected longer than expected iterable");if(r.length>0)return r[r.length-1].part},h=(e,t,n)=>{const o=/lit-node (\d+)/.exec(e.data),i=parseInt(o[1]),l=e.nextElementSibling;if(null===l)throw Error("could not find node for attribute parts");l.removeAttribute("defer-hydration");const c=t[t.length-1];if("template-instance"!==c.type)throw Error("internal error");{const e=c.instance;for(;;){const t=e._$AD.parts[c.templatePartIndex];if(void 0===t||t.type!==r.ATTRIBUTE&&t.type!==r.ELEMENT||t.index!==i)break;if(t.type===r.ATTRIBUTE){const o=new t.ctor(l,t.name,t.strings,c.instance,n),i=a(o)?c.result.values[c.instancePartIndex]:c.result.values,s=!(o.type===r.EVENT||o.type===r.PROPERTY);o._$AI(i,o,c.instancePartIndex,s),c.instancePartIndex+=t.strings.length-1,e._$AV.push(o)}else{const t=new d(l,c.instance,n);s(t,c.result.values[c.instancePartIndex++]),e._$AV.push(t)}c.templatePartIndex++}}},u=e=>{const t=new Uint32Array(2).fill(5381);for(const r of e.strings)for(let e=0;e<r.length;e++)t[e%2]=33*t[e%2]^r.charCodeAt(e);const r=String.fromCharCode(...new Uint8Array(t.buffer));return btoa(r)};export{u as digestForTemplateResult,p as hydrate}; | ||
*/const{TemplateInstance:l,isIterable:i,resolveDirective:s,ChildPart:c,ElementPart:d}=t,p=(e,t,r={})=>{if(void 0!==t._$litPart$)throw Error("container already contains a live render");let n,o,a;const l=[],i=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT,null,!1);let s;for(;null!==(s=i.nextNode());){const t=s.data;if(t.startsWith("lit-part")){if(0===l.length&&void 0!==n)throw Error(`There must be only one root part per container. Found a part marker (${s}) when we already have a root part marker (${o})`);a=f(e,s,l,r),null!=n||(n=a),null!=o||(o=s)}else if(t.startsWith("lit-node"))h(s,l,r);else if(t.startsWith("/lit-part")){if(1===l.length&&a!==n)throw Error("internal error");a=m(s,a,l)}}if(void 0===n){const e=t instanceof ShadowRoot?"{container.host.localName}'s shadow root":t instanceof DocumentFragment?"DocumentFragment":t.localName;console.error(`There should be exactly one root part in a render container, but we didn't find any in ${e}.`)}t._$litPart$=n},f=(t,r,a,d)=>{let p,f;if(0===a.length)f=new c(r,null,void 0,d),p=t;else{const e=a[a.length-1];if("template-instance"===e.type)f=new c(r,null,e.instance,d),e.instance._$AV.push(f),p=e.result.values[e.instancePartIndex++],e.templatePartIndex++;else if("iterable"===e.type){f=new c(r,null,e.part,d);const t=e.iterator.next();if(t.done)throw p=void 0,e.done=!0,Error("Unhandled shorter than expected iterable");p=t.value,e.part._$AH.push(f)}else f=new c(r,null,e.part,d)}if(p=s(f,p),p===e)a.push({part:f,type:"leaf"});else if(n(p))a.push({part:f,type:"leaf"}),f._$AH=p;else if(o(p)){const e="lit-part "+u(p);if(r.data!==e)throw Error("Hydration value mismatch: Unexpected TemplateResult rendered to part");{const e=c.prototype._$AC(p),t=new l(e,f);a.push({type:"template-instance",instance:t,part:f,templatePartIndex:0,instancePartIndex:0,result:p}),f._$AH=t}}else i(p)?(a.push({part:f,type:"iterable",value:p,iterator:p[Symbol.iterator](),done:!1}),f._$AH=[]):(a.push({part:f,type:"leaf"}),f._$AH=null==p?"":p);return f},m=(e,t,r)=>{if(void 0===t)throw Error("unbalanced part marker");t._$AB=e;const n=r.pop();if("iterable"===n.type&&!n.iterator.next().done)throw Error("unexpected longer than expected iterable");if(r.length>0)return r[r.length-1].part},h=(e,t,n)=>{const o=/lit-node (\d+)/.exec(e.data),l=parseInt(o[1]),i=e.nextElementSibling;if(null===i)throw Error("could not find node for attribute parts");i.removeAttribute("defer-hydration");const c=t[t.length-1];if("template-instance"!==c.type)throw Error("internal error");{const e=c.instance;for(;;){const t=e._$AD.parts[c.templatePartIndex];if(void 0===t||t.type!==r.ATTRIBUTE&&t.type!==r.ELEMENT||t.index!==l)break;if(t.type===r.ATTRIBUTE){const o=new t.ctor(i,t.name,t.strings,c.instance,n),l=a(o)?c.result.values[c.instancePartIndex]:c.result.values,s=!(o.type===r.EVENT||o.type===r.PROPERTY);o._$AI(l,o,c.instancePartIndex,s),c.instancePartIndex+=t.strings.length-1,e._$AV.push(o)}else{const t=new d(i,c.instance,n);s(t,c.result.values[c.instancePartIndex++]),e._$AV.push(t)}c.templatePartIndex++}}},u=e=>{const t=new Uint32Array(2).fill(5381);for(const r of e.strings)for(let e=0;e<r.length;e++)t[e%2]=33*t[e%2]^r.charCodeAt(e);const r=String.fromCharCode(...new Uint8Array(t.buffer));return btoa(r)};export{u as digestForTemplateResult,p as hydrate}; | ||
//# sourceMappingURL=hydrate-lit-html.js.map |
@@ -106,5 +106,5 @@ import { directive, Directive } from 'lit/directive.js'; | ||
const renderLight = directive(RenderLightDirective); | ||
const isRenderLightDirective = (value) => getDirectiveClass(value)?._$litRenderLight; | ||
const isRenderLightDirective = (value) => { var _a; return (_a = getDirectiveClass(value)) === null || _a === void 0 ? void 0 : _a._$litRenderLight; }; | ||
export { isRenderLightDirective, renderLight }; | ||
//# sourceMappingURL=render-light.js.map |
@@ -69,3 +69,3 @@ import { Buffer } from 'buffer'; | ||
const stack = []; | ||
const walker = document.createTreeWalker(container, NodeFilter.SHOW_COMMENT); | ||
const walker = document.createTreeWalker(container, NodeFilter.SHOW_COMMENT, null, false); | ||
let marker; | ||
@@ -83,4 +83,4 @@ // Walk the DOM looking for part marker comments | ||
currentChildPart = openChildPart(rootValue, marker, stack, options); | ||
rootPart ??= currentChildPart; | ||
rootPartMarker ??= marker; | ||
rootPart !== null && rootPart !== void 0 ? rootPart : (rootPart = currentChildPart); | ||
rootPartMarker !== null && rootPartMarker !== void 0 ? rootPartMarker : (rootPartMarker = marker); | ||
} | ||
@@ -87,0 +87,0 @@ else if (markerText.startsWith('lit-node')) { |
@@ -1,2 +0,2 @@ | ||
import{directive as e,Directive as t}from"lit/directive.js";import{getDirectiveClass as r}from"lit/directive-helpers.js"; | ||
import{directive as e,Directive as r}from"lit/directive.js";import{getDirectiveClass as t}from"lit/directive-helpers.js"; | ||
/** | ||
@@ -6,3 +6,3 @@ * @license | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/class i extends t{render(){}update(e){const t=e.parentNode;if("function"==typeof t.renderLight)return t.renderLight()}}i.t=!0;const o=e(i),s=e=>r(e)?.t;export{s as isRenderLightDirective,o as renderLight}; | ||
*/class i extends r{render(){}update(e){const r=e.parentNode;if("function"==typeof r.renderLight)return r.renderLight()}}i.t=!0;const o=e(i),n=e=>{var r;return null===(r=t(e))||void 0===r?void 0:r.t};export{n as isRenderLightDirective,o as renderLight}; | ||
//# sourceMappingURL=render-light.js.map |
@@ -1,2 +0,2 @@ | ||
import{Buffer as e}from"buffer";import{noChange as t}from"lit-html";import{_$LH as r}from"lit-html/private-ssr-support.js";import{PartType as n}from"lit-html/directive.js";import{isPrimitive as o,isTemplateResult as a,isSingleExpression as i}from"lit-html/directive-helpers.js";const{TemplateInstance:l,isIterable:s,resolveDirective:c,ChildPart:d,ElementPart:f}=r,p=(e,t,r={})=>{if(void 0!==t._$litPart$)throw Error("container already contains a live render");let n,o,a;const i=[],l=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT);let s;for(;null!==(s=l.nextNode());){const t=s.data;if(t.startsWith("lit-part")){if(0===i.length&&void 0!==n)throw Error(`There must be only one root part per container. Found a part marker (${s}) when we already have a root part marker (${o})`);a=m(e,s,i,r),n??=a,o??=s}else if(t.startsWith("lit-node"))u(s,i,r);else if(t.startsWith("/lit-part")){if(1===i.length&&a!==n)throw Error("internal error");a=h(s,a,i)}}if(void 0===n){const e=t instanceof ShadowRoot?"{container.host.localName}'s shadow root":t instanceof DocumentFragment?"DocumentFragment":t.localName;console.error(`There should be exactly one root part in a render container, but we didn't find any in ${e}.`)}t._$litPart$=n},m=(e,r,n,i)=>{let f,p;if(0===n.length)p=new d(r,null,void 0,i),f=e;else{const e=n[n.length-1];if("template-instance"===e.type)p=new d(r,null,e.instance,i),e.instance._$AV.push(p),f=e.result.values[e.instancePartIndex++],e.templatePartIndex++;else if("iterable"===e.type){p=new d(r,null,e.part,i);const t=e.iterator.next();if(t.done)throw f=void 0,e.done=!0,Error("Unhandled shorter than expected iterable");f=t.value,e.part._$AH.push(p)}else p=new d(r,null,e.part,i)}if(f=c(p,f),f===t)n.push({part:p,type:"leaf"});else if(o(f))n.push({part:p,type:"leaf"}),p._$AH=f;else if(a(f)){const e="lit-part "+w(f);if(r.data!==e)throw Error("Hydration value mismatch: Unexpected TemplateResult rendered to part");{const e=d.prototype._$AC(f),t=new l(e,p);n.push({type:"template-instance",instance:t,part:p,templatePartIndex:0,instancePartIndex:0,result:f}),p._$AH=t}}else s(f)?(n.push({part:p,type:"iterable",value:f,iterator:f[Symbol.iterator](),done:!1}),p._$AH=[]):(n.push({part:p,type:"leaf"}),p._$AH=f??"");return p},h=(e,t,r)=>{if(void 0===t)throw Error("unbalanced part marker");t._$AB=e;const n=r.pop();if("iterable"===n.type&&!n.iterator.next().done)throw Error("unexpected longer than expected iterable");if(r.length>0)return r[r.length-1].part},u=(e,t,r)=>{const o=/lit-node (\d+)/.exec(e.data),a=parseInt(o[1]),l=e.nextElementSibling;if(null===l)throw Error("could not find node for attribute parts");l.removeAttribute("defer-hydration");const s=t[t.length-1];if("template-instance"!==s.type)throw Error("internal error");{const e=s.instance;for(;;){const t=e._$AD.parts[s.templatePartIndex];if(void 0===t||t.type!==n.ATTRIBUTE&&t.type!==n.ELEMENT||t.index!==a)break;if(t.type===n.ATTRIBUTE){const o=new t.ctor(l,t.name,t.strings,s.instance,r),a=i(o)?s.result.values[s.instancePartIndex]:s.result.values,c=!(o.type===n.EVENT||o.type===n.PROPERTY);o._$AI(a,o,s.instancePartIndex,c),s.instancePartIndex+=t.strings.length-1,e._$AV.push(o)}else{const t=new f(l,s.instance,r);c(t,s.result.values[s.instancePartIndex++]),e._$AV.push(t)}s.templatePartIndex++}}},w=t=>{const r=new Uint32Array(2).fill(5381);for(const e of t.strings)for(let t=0;t<e.length;t++)r[t%2]=33*r[t%2]^e.charCodeAt(t);const n=String.fromCharCode(...new Uint8Array(r.buffer));return e.from(n,"binary").toString("base64")};export{w as digestForTemplateResult,p as hydrate}; | ||
import{Buffer as e}from"buffer";import{noChange as t}from"lit-html";import{_$LH as r}from"lit-html/private-ssr-support.js";import{PartType as n}from"lit-html/directive.js";import{isPrimitive as o,isTemplateResult as a,isSingleExpression as i}from"lit-html/directive-helpers.js";const{TemplateInstance:l,isIterable:s,resolveDirective:c,ChildPart:d,ElementPart:f}=r,p=(e,t,r={})=>{if(void 0!==t._$litPart$)throw Error("container already contains a live render");let n,o,a;const i=[],l=document.createTreeWalker(t,NodeFilter.SHOW_COMMENT,null,!1);let s;for(;null!==(s=l.nextNode());){const t=s.data;if(t.startsWith("lit-part")){if(0===i.length&&void 0!==n)throw Error(`There must be only one root part per container. Found a part marker (${s}) when we already have a root part marker (${o})`);a=m(e,s,i,r),null!=n||(n=a),null!=o||(o=s)}else if(t.startsWith("lit-node"))h(s,i,r);else if(t.startsWith("/lit-part")){if(1===i.length&&a!==n)throw Error("internal error");a=u(s,a,i)}}if(void 0===n){const e=t instanceof ShadowRoot?"{container.host.localName}'s shadow root":t instanceof DocumentFragment?"DocumentFragment":t.localName;console.error(`There should be exactly one root part in a render container, but we didn't find any in ${e}.`)}t._$litPart$=n},m=(e,r,n,i)=>{let f,p;if(0===n.length)p=new d(r,null,void 0,i),f=e;else{const e=n[n.length-1];if("template-instance"===e.type)p=new d(r,null,e.instance,i),e.instance._$AV.push(p),f=e.result.values[e.instancePartIndex++],e.templatePartIndex++;else if("iterable"===e.type){p=new d(r,null,e.part,i);const t=e.iterator.next();if(t.done)throw f=void 0,e.done=!0,Error("Unhandled shorter than expected iterable");f=t.value,e.part._$AH.push(p)}else p=new d(r,null,e.part,i)}if(f=c(p,f),f===t)n.push({part:p,type:"leaf"});else if(o(f))n.push({part:p,type:"leaf"}),p._$AH=f;else if(a(f)){const e="lit-part "+w(f);if(r.data!==e)throw Error("Hydration value mismatch: Unexpected TemplateResult rendered to part");{const e=d.prototype._$AC(f),t=new l(e,p);n.push({type:"template-instance",instance:t,part:p,templatePartIndex:0,instancePartIndex:0,result:f}),p._$AH=t}}else s(f)?(n.push({part:p,type:"iterable",value:f,iterator:f[Symbol.iterator](),done:!1}),p._$AH=[]):(n.push({part:p,type:"leaf"}),p._$AH=null==f?"":f);return p},u=(e,t,r)=>{if(void 0===t)throw Error("unbalanced part marker");t._$AB=e;const n=r.pop();if("iterable"===n.type&&!n.iterator.next().done)throw Error("unexpected longer than expected iterable");if(r.length>0)return r[r.length-1].part},h=(e,t,r)=>{const o=/lit-node (\d+)/.exec(e.data),a=parseInt(o[1]),l=e.nextElementSibling;if(null===l)throw Error("could not find node for attribute parts");l.removeAttribute("defer-hydration");const s=t[t.length-1];if("template-instance"!==s.type)throw Error("internal error");{const e=s.instance;for(;;){const t=e._$AD.parts[s.templatePartIndex];if(void 0===t||t.type!==n.ATTRIBUTE&&t.type!==n.ELEMENT||t.index!==a)break;if(t.type===n.ATTRIBUTE){const o=new t.ctor(l,t.name,t.strings,s.instance,r),a=i(o)?s.result.values[s.instancePartIndex]:s.result.values,c=!(o.type===n.EVENT||o.type===n.PROPERTY);o._$AI(a,o,s.instancePartIndex,c),s.instancePartIndex+=t.strings.length-1,e._$AV.push(o)}else{const t=new f(l,s.instance,r);c(t,s.result.values[s.instancePartIndex++]),e._$AV.push(t)}s.templatePartIndex++}}},w=t=>{const r=new Uint32Array(2).fill(5381);for(const e of t.strings)for(let t=0;t<e.length;t++)r[t%2]=33*r[t%2]^e.charCodeAt(t);const n=String.fromCharCode(...new Uint8Array(r.buffer));return e.from(n,"binary").toString("base64")};export{w as digestForTemplateResult,p as hydrate}; | ||
//# sourceMappingURL=hydrate-lit-html.js.map |
{ | ||
"name": "@lit-labs/ssr-client", | ||
"version": "1.1.2-pre.0", | ||
"version": "1.1.2", | ||
"description": "Client package for @lit-labs/ssr.", | ||
@@ -128,8 +128,8 @@ "license": "BSD-3-Clause", | ||
"devDependencies": { | ||
"@lit-internal/scripts": "^1.0.1-pre.0" | ||
"@lit-internal/scripts": "^1.0.0" | ||
}, | ||
"dependencies": { | ||
"@lit/reactive-element": "^2.0.0-pre.0", | ||
"lit": "^3.0.0-pre.0", | ||
"lit-html": "^3.0.0-pre.0" | ||
"@lit/reactive-element": "^1.0.0", | ||
"lit": "^2.0.0", | ||
"lit-html": "^2.7.1" | ||
}, | ||
@@ -136,0 +136,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
214989
0
+ Added@lit/reactive-element@1.6.3(transitive)
+ Addedlit@2.8.0(transitive)
+ Addedlit-element@3.3.3(transitive)
+ Addedlit-html@2.8.0(transitive)
- Removed@lit/reactive-element@2.0.4(transitive)
- Removedlit@3.2.1(transitive)
- Removedlit-element@4.1.1(transitive)
- Removedlit-html@3.2.1(transitive)
Updated@lit/reactive-element@^1.0.0
Updatedlit@^2.0.0
Updatedlit-html@^2.7.1