@penn-libraries/web 1.2.0 → 1.2.1-dev.1
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/cjs/{index-Ag6DtE87.js → index-C2lJ0X_b.js} +64 -2
- package/dist/cjs/index-C2lJ0X_b.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/pennlibs-autocomplete.cjs.entry.js +1 -1
- package/dist/cjs/pennlibs-banner.cjs.entry.js +1 -1
- package/dist/cjs/pennlibs-chat.cjs.entry.js +1 -1
- package/dist/cjs/pennlibs-fallback-img.cjs.entry.js +1 -1
- package/dist/cjs/pennlibs-feedback.pennlibs-footer.pennlibs-header.entry.cjs.js.map +1 -1
- package/dist/cjs/pennlibs-feedback_3.cjs.entry.js +39 -9
- package/dist/cjs/pennlibs-hero.cjs.entry.js +1 -1
- package/dist/cjs/pennlibs-iiif-img.cjs.entry.js +1 -1
- package/dist/cjs/web.cjs.js +2 -2
- package/dist/collection/components/pennlibs-feedback/pennlibs-feedback.css +1 -29
- package/dist/collection/components/pennlibs-feedback/pennlibs-feedback.js +38 -8
- package/dist/collection/components/pennlibs-feedback/pennlibs-feedback.js.map +1 -1
- package/dist/components/pennlibs-feedback.js +39 -10
- package/dist/components/pennlibs-feedback.js.map +1 -1
- package/dist/docs.json +2 -2
- package/dist/{web/p-mkVX9lU0.js → esm/index-kmszRyIe.js} +64 -2
- package/dist/esm/index-kmszRyIe.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/pennlibs-autocomplete.entry.js +1 -1
- package/dist/esm/pennlibs-banner.entry.js +1 -1
- package/dist/esm/pennlibs-chat.entry.js +1 -1
- package/dist/esm/pennlibs-fallback-img.entry.js +1 -1
- package/dist/esm/pennlibs-feedback.pennlibs-footer.pennlibs-header.entry.js.map +1 -1
- package/dist/esm/pennlibs-feedback_3.entry.js +39 -9
- package/dist/esm/pennlibs-hero.entry.js +1 -1
- package/dist/esm/pennlibs-iiif-img.entry.js +1 -1
- package/dist/esm/web.js +3 -3
- package/dist/types/components/pennlibs-feedback/pennlibs-feedback.d.ts +7 -1
- package/dist/web/index.esm.js +1 -1
- package/dist/web/{p-7c6382d0.entry.js → p-1c0dd1ec.entry.js} +1 -1
- package/dist/web/{p-e426fb61.entry.js → p-51bc70b8.entry.js} +1 -1
- package/dist/web/{p-10931f0a.entry.js → p-5c02b8da.entry.js} +39 -9
- package/dist/web/{p-4fb3e5a4.entry.js → p-906263a3.entry.js} +1 -1
- package/dist/web/{p-190f0293.entry.js → p-badb334a.entry.js} +1 -1
- package/dist/web/{p-154851d1.entry.js → p-d392e98a.entry.js} +1 -1
- package/dist/web/{p-0c1113f4.entry.js → p-e1947e84.entry.js} +1 -1
- package/dist/{esm/index-mkVX9lU0.js → web/p-kmszRyIe.js} +64 -2
- package/dist/web/p-kmszRyIe.js.map +1 -0
- package/dist/web/pennlibs-feedback.pennlibs-footer.pennlibs-header.entry.esm.js.map +1 -1
- package/dist/web/web.esm.js +3 -3
- package/hydrate/index.js +68 -9
- package/hydrate/index.mjs +68 -9
- package/package.json +1 -1
- package/dist/cjs/index-Ag6DtE87.js.map +0 -1
- package/dist/esm/index-mkVX9lU0.js.map +0 -1
- package/dist/web/p-mkVX9lU0.js.map +0 -1
package/dist/web/web.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './p-
|
|
2
|
-
export { s as setNonce } from './p-
|
|
1
|
+
import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './p-kmszRyIe.js';
|
|
2
|
+
export { s as setNonce } from './p-kmszRyIe.js';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
Stencil Client Patch Browser v4.38.1 | MIT Licensed | https://stenciljs.com
|
|
@@ -16,6 +16,6 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["p-
|
|
19
|
+
return bootstrapLazy([["p-906263a3",[[257,"pennlibs-iiif-img",{"uuid":[1],"alt":[1],"region":[513],"rotation":[1],"quality":[1],"loading":[1],"showFallback":[4,"show-fallback"],"isLoaded":[32],"hasError":[32],"imageDimensions":[32],"observedWidth":[32]},null,{"region":["handleRegionChange"]}]]],["p-5c02b8da",[[258,"pennlibs-feedback",{"hideQuestion":[4,"hide-question"],"answer":[32],"selected":[32]}],[257,"pennlibs-footer",{"showBuiltWith":[4,"show-built-with"],"navigationByChildren":[32]}],[257,"pennlibs-header",{"serviceName":[1,"service-name"],"serviceLede":[1,"service-lede"],"serviceHref":[1,"service-href"],"theme":[1],"isMenuOpen":[32],"navigation":[32]}]]],["p-1c0dd1ec",[[257,"pennlibs-autocomplete",{"for":[1],"showSuggestions":[32],"currentIndex":[32],"originalValue":[32],"options":[32]},[[0,"slotchange","handleSlotChange"],[16,"input","handleInputEvent"],[16,"focus","handleFocusEvent"],[16,"blur","handleBlurEvent"],[0,"focusout","handleFocusOut"],[4,"keydown","handleKeyDown"]]]]],["p-e1947e84",[[257,"pennlibs-banner"]]],["p-badb334a",[[257,"pennlibs-chat",{"href":[32]}]]],["p-d392e98a",[[257,"pennlibs-hero",{"heroPictureElement":[32],"heroHeadingElement":[32],"heroParagraphElement":[32],"heroSrc":[32]}]]],["p-51bc70b8",[[257,"pennlibs-fallback-img"]]]], options);
|
|
20
20
|
});
|
|
21
21
|
//# sourceMappingURL=web.esm.js.map
|
package/hydrate/index.js
CHANGED
|
@@ -737,6 +737,16 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
737
737
|
const shadowRootNodes = shadowRoot ? [] : null;
|
|
738
738
|
const vnode = newVNode(tagName, null);
|
|
739
739
|
vnode.$elm$ = hostElm;
|
|
740
|
+
let scopeId2;
|
|
741
|
+
{
|
|
742
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
743
|
+
if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
|
|
744
|
+
scopeId2 = hostElm["s-sc"];
|
|
745
|
+
hostElm.classList.add(scopeId2 + "-h");
|
|
746
|
+
} else if (hostElm["s-sc"]) {
|
|
747
|
+
delete hostElm["s-sc"];
|
|
748
|
+
}
|
|
749
|
+
}
|
|
740
750
|
if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {
|
|
741
751
|
initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
742
752
|
}
|
|
@@ -840,6 +850,11 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
840
850
|
}
|
|
841
851
|
}
|
|
842
852
|
}
|
|
853
|
+
if (scopeId2 && slotNodes.length) {
|
|
854
|
+
slotNodes.forEach((slot) => {
|
|
855
|
+
slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
|
|
856
|
+
});
|
|
857
|
+
}
|
|
843
858
|
if (shadowRoot) {
|
|
844
859
|
let rnIdex = 0;
|
|
845
860
|
const rnLen = shadowRootNodes.length;
|
|
@@ -869,6 +884,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
869
884
|
let childIdSplt;
|
|
870
885
|
let childVNode;
|
|
871
886
|
let i2;
|
|
887
|
+
const scopeId2 = hostElm["s-sc"];
|
|
872
888
|
if (node.nodeType === 1 /* ElementNode */) {
|
|
873
889
|
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
874
890
|
if (childNodeType) {
|
|
@@ -891,6 +907,10 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
891
907
|
if (!parentVNode.$children$) {
|
|
892
908
|
parentVNode.$children$ = [];
|
|
893
909
|
}
|
|
910
|
+
if (scopeId2 && childIdSplt[0] === hostId) {
|
|
911
|
+
node["s-si"] = scopeId2;
|
|
912
|
+
childVNode.$attrs$.class += " " + scopeId2;
|
|
913
|
+
}
|
|
894
914
|
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
895
915
|
if (typeof slotName === "string") {
|
|
896
916
|
if (childVNode.$tag$ === "slot-fb") {
|
|
@@ -905,6 +925,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
905
925
|
shadowRootNodes,
|
|
906
926
|
slottedNodes
|
|
907
927
|
);
|
|
928
|
+
if (scopeId2) {
|
|
929
|
+
node.classList.add(scopeId2);
|
|
930
|
+
}
|
|
908
931
|
}
|
|
909
932
|
childVNode.$elm$["s-sn"] = slotName;
|
|
910
933
|
childVNode.$elm$.removeAttribute("s-sn");
|
|
@@ -2061,6 +2084,9 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
2061
2084
|
}
|
|
2062
2085
|
};
|
|
2063
2086
|
var insertBefore = (parent, newNode, reference) => {
|
|
2087
|
+
if (typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
|
|
2088
|
+
addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
|
|
2089
|
+
}
|
|
2064
2090
|
{
|
|
2065
2091
|
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
2066
2092
|
}
|
|
@@ -2613,6 +2639,9 @@ var connectedCallback = (elm) => {
|
|
|
2613
2639
|
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2614
2640
|
const scopeId2 = addStyle(elm.shadowRoot, cmpMeta);
|
|
2615
2641
|
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
2642
|
+
} else if (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2643
|
+
const scopeId2 = getScopeId(cmpMeta);
|
|
2644
|
+
elm["s-sc"] = scopeId2;
|
|
2616
2645
|
}
|
|
2617
2646
|
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2618
2647
|
}
|
|
@@ -4206,9 +4235,8 @@ class NoImage {
|
|
|
4206
4235
|
}; }
|
|
4207
4236
|
}
|
|
4208
4237
|
|
|
4209
|
-
const pennlibsFeedbackCss = "
|
|
4238
|
+
const pennlibsFeedbackCss = ".feedback__container.sc-pennlibs-feedback{display:block;background:#eeeff4;font-family:var(--pl-font-family);font-size:var(--pl-font-size);color:var(--pl-color-fg-default);line-height:1.4;box-sizing:border-box;padding:0.75em 0}@media print{.sc-pennlibs-feedback-h{display:none}}*.sc-pennlibs-feedback,*.sc-pennlibs-feedback::before,*.sc-pennlibs-feedback::after{box-sizing:border-box}.viewport-margins.sc-pennlibs-feedback{max-width:var(--pl-viewport-margins-max-width);margin:0 auto;padding:0 var(--pl-viewport-margins-gutter, 1em)}.feedback__content.sc-pennlibs-feedback{display:flex;justify-content:space-between;gap:var(--pl-space-s);flex-wrap:wrap}.feedback__inline-question.sc-pennlibs-feedback{display:flex;flex-wrap:wrap;gap:0.5em;align-items:center}h2.sc-pennlibs-feedback{display:inline-block;margin:0;font-family:var(--pl-font-sans-serif);font-size:1em;font-weight:400}p.sc-pennlibs-feedback{margin:0;padding:calc(0.5em + 1px) 0}a.sc-pennlibs-feedback{color:var(--pl-color-fg-accent);text-decoration:underline;text-underline-offset:var(--pl-link-text-underline-offset);text-decoration-thickness:var(--pl-link-hover-text-decoration-thickness)}button.sc-pennlibs-feedback{all:unset;display:flex;align-items:center;gap:0.5em;padding:0.25em 1.25em;font-family:var(--pl-font-family);font-weight:500;line-height:1.4;color:var(--pl-color-fg-default);background:var(--pl-color-bg-default);border:solid 1px var(--pl-color-fg-subtle);border-radius:1em;box-sizing:border-box}button.sc-pennlibs-feedback:hover{cursor:pointer}button.sc-pennlibs-feedback:hover span.sc-pennlibs-feedback{text-decoration:underline}button.selected.sc-pennlibs-feedback{background:var(--pl-color-bg-accent-emphasis);color:var(--pl-color-fg-on-emphasis);border-color:var(--pl-color-bg-accent-emphasis)}.feedback__inline-question.sc-pennlibs-feedback+.feedback__share-feedback.sc-pennlibs-feedback,p.sc-pennlibs-feedback{animation:none}.feedback__content.sc-pennlibs-feedback>p.sc-pennlibs-feedback{animation:fadeIn 300ms ease-in}@keyframes fadeIn{from{opacity:0}to{opacity:1}}*.sc-pennlibs-feedback:focus{outline:0;box-shadow:0 0 0 2px var(--pl-color-bg-attention),\n 0 0 0 3px var(--pl-color-bg-emphasis)}@media (max-width: 26em){h2.sc-pennlibs-feedback{display:block;width:100%}}.visually-hidden.sc-pennlibs-feedback{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}";
|
|
4210
4239
|
|
|
4211
|
-
const FEEDBACK_STORAGE_KEY = `pennlibs-feedback-${window.location.pathname}`;
|
|
4212
4240
|
const FEEDBACK_TTL = 5 * 60 * 1000; // 5 minutes
|
|
4213
4241
|
const FEEDBACK_QUESTION = 'Did you find what you need?';
|
|
4214
4242
|
/**
|
|
@@ -4232,28 +4260,59 @@ class PennlibsFeedback {
|
|
|
4232
4260
|
this.hideQuestion = false;
|
|
4233
4261
|
this.answer = undefined;
|
|
4234
4262
|
this.selected = undefined;
|
|
4263
|
+
this.currentUrl = '';
|
|
4264
|
+
this.onNavigate = (event) => {
|
|
4265
|
+
try {
|
|
4266
|
+
const destinationUrl = new URL(event.destination.url).href;
|
|
4267
|
+
if (destinationUrl !== this.currentUrl) {
|
|
4268
|
+
this.currentUrl = destinationUrl;
|
|
4269
|
+
this.selected = undefined;
|
|
4270
|
+
this.answer = undefined;
|
|
4271
|
+
this.loadStoredAnswer();
|
|
4272
|
+
}
|
|
4273
|
+
}
|
|
4274
|
+
catch (_a) {
|
|
4275
|
+
this.selected = undefined;
|
|
4276
|
+
this.answer = undefined;
|
|
4277
|
+
}
|
|
4278
|
+
};
|
|
4279
|
+
}
|
|
4280
|
+
get storageKey() {
|
|
4281
|
+
return `pennlibs-feedback-${this.currentUrl}`;
|
|
4282
|
+
}
|
|
4283
|
+
connectedCallback() {
|
|
4284
|
+
this.currentUrl = window.location.href;
|
|
4285
|
+
window.navigation.addEventListener('navigate', this.onNavigate);
|
|
4286
|
+
}
|
|
4287
|
+
disconnectedCallback() {
|
|
4288
|
+
window.navigation.removeEventListener('navigate', this.onNavigate);
|
|
4235
4289
|
}
|
|
4236
4290
|
componentWillLoad() {
|
|
4237
|
-
|
|
4291
|
+
this.loadStoredAnswer();
|
|
4292
|
+
}
|
|
4293
|
+
loadStoredAnswer() {
|
|
4294
|
+
const stored = sessionStorage.getItem(this.storageKey);
|
|
4238
4295
|
if (stored) {
|
|
4239
4296
|
try {
|
|
4240
4297
|
const { answer, timestamp } = JSON.parse(stored);
|
|
4241
4298
|
if (Date.now() - timestamp > FEEDBACK_TTL) {
|
|
4242
|
-
sessionStorage.removeItem(
|
|
4299
|
+
sessionStorage.removeItem(this.storageKey);
|
|
4243
4300
|
}
|
|
4244
4301
|
else {
|
|
4245
4302
|
this.answer = answer;
|
|
4246
4303
|
}
|
|
4247
4304
|
}
|
|
4248
4305
|
catch (_a) {
|
|
4249
|
-
sessionStorage.removeItem(
|
|
4306
|
+
sessionStorage.removeItem(this.storageKey);
|
|
4250
4307
|
}
|
|
4251
4308
|
}
|
|
4252
4309
|
}
|
|
4253
|
-
|
|
4310
|
+
handleSubmit(event) {
|
|
4254
4311
|
var _a;
|
|
4312
|
+
event.preventDefault();
|
|
4313
|
+
const answer = event.submitter.value;
|
|
4255
4314
|
this.selected = answer;
|
|
4256
|
-
sessionStorage.setItem(
|
|
4315
|
+
sessionStorage.setItem(this.storageKey, JSON.stringify({ answer, timestamp: Date.now() }));
|
|
4257
4316
|
this.feedbackEvent.emit({
|
|
4258
4317
|
question: FEEDBACK_QUESTION,
|
|
4259
4318
|
answer: answer,
|
|
@@ -4266,11 +4325,11 @@ class PennlibsFeedback {
|
|
|
4266
4325
|
}, 600);
|
|
4267
4326
|
}
|
|
4268
4327
|
render() {
|
|
4269
|
-
return (hAsync("div", { key: '
|
|
4328
|
+
return (hAsync("div", { key: '12bdec6f975166a4c5d451fc1834f70fbce3b424', class: "feedback__container" }, hAsync("div", { key: '4c607ceef5f10760d540d2549a2b186a871714c7', class: "viewport-margins" }, hAsync("div", { key: 'a967498163e05ce60a12bf230d303caa31373c8d', class: "feedback__content" }, !this.hideQuestion && (this.answer === 'yes' ? (hAsync("p", null, "Thank you for letting us know.")) : this.answer === 'no' ? (hAsync("p", null, "We'd like to help. ", hAsync("a", { href: "https://www.library.upenn.edu/contact-us" }, "Contact us"), " and let us know what you're looking for.")) : (hAsync("form", { class: "feedback__inline-question", onSubmit: (e) => this.handleSubmit(e) }, hAsync("h2", null, "Did you find what you need?"), hAsync("button", { type: "submit", name: "answer", value: "yes", class: { 'selected': this.selected === 'yes' }, disabled: !!this.selected }, hAsync("span", null, "Yes"), hAsync("span", { class: "visually-hidden" }, ", I found what I needed.")), hAsync("button", { type: "submit", name: "answer", value: "no", class: { 'selected': this.selected === 'no' }, disabled: !!this.selected }, hAsync("span", null, "No"), hAsync("span", { class: "visually-hidden" }, ", I did not find what I needed."))))), hAsync("div", { key: 'f918da2833ae0c64e67a9e95551edaeb78e2ba05', class: "feedback__share-feedback" }, hAsync("p", { key: '12928af116ffadf669cbc694160ee6ca3458528b' }, "To help us improve, ", hAsync("a", { key: '7281b7423677b104fb622a7fdcf8e768517ea84e', href: `https://upenn.co1.qualtrics.com/jfe/form/SV_3xVrP7EKWS92zfE?reporting_from_url=${encodeURIComponent(window.location.href)}` }, "share your feedback"), "."))))));
|
|
4270
4329
|
}
|
|
4271
4330
|
static get style() { return pennlibsFeedbackCss; }
|
|
4272
4331
|
static get cmpMeta() { return {
|
|
4273
|
-
"$flags$":
|
|
4332
|
+
"$flags$": 258,
|
|
4274
4333
|
"$tagName$": "pennlibs-feedback",
|
|
4275
4334
|
"$members$": {
|
|
4276
4335
|
"hideQuestion": [4, "hide-question"],
|
package/hydrate/index.mjs
CHANGED
|
@@ -735,6 +735,16 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
735
735
|
const shadowRootNodes = shadowRoot ? [] : null;
|
|
736
736
|
const vnode = newVNode(tagName, null);
|
|
737
737
|
vnode.$elm$ = hostElm;
|
|
738
|
+
let scopeId2;
|
|
739
|
+
{
|
|
740
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
741
|
+
if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
|
|
742
|
+
scopeId2 = hostElm["s-sc"];
|
|
743
|
+
hostElm.classList.add(scopeId2 + "-h");
|
|
744
|
+
} else if (hostElm["s-sc"]) {
|
|
745
|
+
delete hostElm["s-sc"];
|
|
746
|
+
}
|
|
747
|
+
}
|
|
738
748
|
if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {
|
|
739
749
|
initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
740
750
|
}
|
|
@@ -838,6 +848,11 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
838
848
|
}
|
|
839
849
|
}
|
|
840
850
|
}
|
|
851
|
+
if (scopeId2 && slotNodes.length) {
|
|
852
|
+
slotNodes.forEach((slot) => {
|
|
853
|
+
slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
|
|
854
|
+
});
|
|
855
|
+
}
|
|
841
856
|
if (shadowRoot) {
|
|
842
857
|
let rnIdex = 0;
|
|
843
858
|
const rnLen = shadowRootNodes.length;
|
|
@@ -867,6 +882,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
867
882
|
let childIdSplt;
|
|
868
883
|
let childVNode;
|
|
869
884
|
let i2;
|
|
885
|
+
const scopeId2 = hostElm["s-sc"];
|
|
870
886
|
if (node.nodeType === 1 /* ElementNode */) {
|
|
871
887
|
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
872
888
|
if (childNodeType) {
|
|
@@ -889,6 +905,10 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
889
905
|
if (!parentVNode.$children$) {
|
|
890
906
|
parentVNode.$children$ = [];
|
|
891
907
|
}
|
|
908
|
+
if (scopeId2 && childIdSplt[0] === hostId) {
|
|
909
|
+
node["s-si"] = scopeId2;
|
|
910
|
+
childVNode.$attrs$.class += " " + scopeId2;
|
|
911
|
+
}
|
|
892
912
|
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
893
913
|
if (typeof slotName === "string") {
|
|
894
914
|
if (childVNode.$tag$ === "slot-fb") {
|
|
@@ -903,6 +923,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
903
923
|
shadowRootNodes,
|
|
904
924
|
slottedNodes
|
|
905
925
|
);
|
|
926
|
+
if (scopeId2) {
|
|
927
|
+
node.classList.add(scopeId2);
|
|
928
|
+
}
|
|
906
929
|
}
|
|
907
930
|
childVNode.$elm$["s-sn"] = slotName;
|
|
908
931
|
childVNode.$elm$.removeAttribute("s-sn");
|
|
@@ -2059,6 +2082,9 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
2059
2082
|
}
|
|
2060
2083
|
};
|
|
2061
2084
|
var insertBefore = (parent, newNode, reference) => {
|
|
2085
|
+
if (typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
|
|
2086
|
+
addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
|
|
2087
|
+
}
|
|
2062
2088
|
{
|
|
2063
2089
|
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
2064
2090
|
}
|
|
@@ -2611,6 +2637,9 @@ var connectedCallback = (elm) => {
|
|
|
2611
2637
|
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2612
2638
|
const scopeId2 = addStyle(elm.shadowRoot, cmpMeta);
|
|
2613
2639
|
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
2640
|
+
} else if (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2641
|
+
const scopeId2 = getScopeId(cmpMeta);
|
|
2642
|
+
elm["s-sc"] = scopeId2;
|
|
2614
2643
|
}
|
|
2615
2644
|
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2616
2645
|
}
|
|
@@ -4204,9 +4233,8 @@ class NoImage {
|
|
|
4204
4233
|
}; }
|
|
4205
4234
|
}
|
|
4206
4235
|
|
|
4207
|
-
const pennlibsFeedbackCss = "
|
|
4236
|
+
const pennlibsFeedbackCss = ".feedback__container.sc-pennlibs-feedback{display:block;background:#eeeff4;font-family:var(--pl-font-family);font-size:var(--pl-font-size);color:var(--pl-color-fg-default);line-height:1.4;box-sizing:border-box;padding:0.75em 0}@media print{.sc-pennlibs-feedback-h{display:none}}*.sc-pennlibs-feedback,*.sc-pennlibs-feedback::before,*.sc-pennlibs-feedback::after{box-sizing:border-box}.viewport-margins.sc-pennlibs-feedback{max-width:var(--pl-viewport-margins-max-width);margin:0 auto;padding:0 var(--pl-viewport-margins-gutter, 1em)}.feedback__content.sc-pennlibs-feedback{display:flex;justify-content:space-between;gap:var(--pl-space-s);flex-wrap:wrap}.feedback__inline-question.sc-pennlibs-feedback{display:flex;flex-wrap:wrap;gap:0.5em;align-items:center}h2.sc-pennlibs-feedback{display:inline-block;margin:0;font-family:var(--pl-font-sans-serif);font-size:1em;font-weight:400}p.sc-pennlibs-feedback{margin:0;padding:calc(0.5em + 1px) 0}a.sc-pennlibs-feedback{color:var(--pl-color-fg-accent);text-decoration:underline;text-underline-offset:var(--pl-link-text-underline-offset);text-decoration-thickness:var(--pl-link-hover-text-decoration-thickness)}button.sc-pennlibs-feedback{all:unset;display:flex;align-items:center;gap:0.5em;padding:0.25em 1.25em;font-family:var(--pl-font-family);font-weight:500;line-height:1.4;color:var(--pl-color-fg-default);background:var(--pl-color-bg-default);border:solid 1px var(--pl-color-fg-subtle);border-radius:1em;box-sizing:border-box}button.sc-pennlibs-feedback:hover{cursor:pointer}button.sc-pennlibs-feedback:hover span.sc-pennlibs-feedback{text-decoration:underline}button.selected.sc-pennlibs-feedback{background:var(--pl-color-bg-accent-emphasis);color:var(--pl-color-fg-on-emphasis);border-color:var(--pl-color-bg-accent-emphasis)}.feedback__inline-question.sc-pennlibs-feedback+.feedback__share-feedback.sc-pennlibs-feedback,p.sc-pennlibs-feedback{animation:none}.feedback__content.sc-pennlibs-feedback>p.sc-pennlibs-feedback{animation:fadeIn 300ms ease-in}@keyframes fadeIn{from{opacity:0}to{opacity:1}}*.sc-pennlibs-feedback:focus{outline:0;box-shadow:0 0 0 2px var(--pl-color-bg-attention),\n 0 0 0 3px var(--pl-color-bg-emphasis)}@media (max-width: 26em){h2.sc-pennlibs-feedback{display:block;width:100%}}.visually-hidden.sc-pennlibs-feedback{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}";
|
|
4208
4237
|
|
|
4209
|
-
const FEEDBACK_STORAGE_KEY = `pennlibs-feedback-${window.location.pathname}`;
|
|
4210
4238
|
const FEEDBACK_TTL = 5 * 60 * 1000; // 5 minutes
|
|
4211
4239
|
const FEEDBACK_QUESTION = 'Did you find what you need?';
|
|
4212
4240
|
/**
|
|
@@ -4230,28 +4258,59 @@ class PennlibsFeedback {
|
|
|
4230
4258
|
this.hideQuestion = false;
|
|
4231
4259
|
this.answer = undefined;
|
|
4232
4260
|
this.selected = undefined;
|
|
4261
|
+
this.currentUrl = '';
|
|
4262
|
+
this.onNavigate = (event) => {
|
|
4263
|
+
try {
|
|
4264
|
+
const destinationUrl = new URL(event.destination.url).href;
|
|
4265
|
+
if (destinationUrl !== this.currentUrl) {
|
|
4266
|
+
this.currentUrl = destinationUrl;
|
|
4267
|
+
this.selected = undefined;
|
|
4268
|
+
this.answer = undefined;
|
|
4269
|
+
this.loadStoredAnswer();
|
|
4270
|
+
}
|
|
4271
|
+
}
|
|
4272
|
+
catch (_a) {
|
|
4273
|
+
this.selected = undefined;
|
|
4274
|
+
this.answer = undefined;
|
|
4275
|
+
}
|
|
4276
|
+
};
|
|
4277
|
+
}
|
|
4278
|
+
get storageKey() {
|
|
4279
|
+
return `pennlibs-feedback-${this.currentUrl}`;
|
|
4280
|
+
}
|
|
4281
|
+
connectedCallback() {
|
|
4282
|
+
this.currentUrl = window.location.href;
|
|
4283
|
+
window.navigation.addEventListener('navigate', this.onNavigate);
|
|
4284
|
+
}
|
|
4285
|
+
disconnectedCallback() {
|
|
4286
|
+
window.navigation.removeEventListener('navigate', this.onNavigate);
|
|
4233
4287
|
}
|
|
4234
4288
|
componentWillLoad() {
|
|
4235
|
-
|
|
4289
|
+
this.loadStoredAnswer();
|
|
4290
|
+
}
|
|
4291
|
+
loadStoredAnswer() {
|
|
4292
|
+
const stored = sessionStorage.getItem(this.storageKey);
|
|
4236
4293
|
if (stored) {
|
|
4237
4294
|
try {
|
|
4238
4295
|
const { answer, timestamp } = JSON.parse(stored);
|
|
4239
4296
|
if (Date.now() - timestamp > FEEDBACK_TTL) {
|
|
4240
|
-
sessionStorage.removeItem(
|
|
4297
|
+
sessionStorage.removeItem(this.storageKey);
|
|
4241
4298
|
}
|
|
4242
4299
|
else {
|
|
4243
4300
|
this.answer = answer;
|
|
4244
4301
|
}
|
|
4245
4302
|
}
|
|
4246
4303
|
catch (_a) {
|
|
4247
|
-
sessionStorage.removeItem(
|
|
4304
|
+
sessionStorage.removeItem(this.storageKey);
|
|
4248
4305
|
}
|
|
4249
4306
|
}
|
|
4250
4307
|
}
|
|
4251
|
-
|
|
4308
|
+
handleSubmit(event) {
|
|
4252
4309
|
var _a;
|
|
4310
|
+
event.preventDefault();
|
|
4311
|
+
const answer = event.submitter.value;
|
|
4253
4312
|
this.selected = answer;
|
|
4254
|
-
sessionStorage.setItem(
|
|
4313
|
+
sessionStorage.setItem(this.storageKey, JSON.stringify({ answer, timestamp: Date.now() }));
|
|
4255
4314
|
this.feedbackEvent.emit({
|
|
4256
4315
|
question: FEEDBACK_QUESTION,
|
|
4257
4316
|
answer: answer,
|
|
@@ -4264,11 +4323,11 @@ class PennlibsFeedback {
|
|
|
4264
4323
|
}, 600);
|
|
4265
4324
|
}
|
|
4266
4325
|
render() {
|
|
4267
|
-
return (hAsync("div", { key: '
|
|
4326
|
+
return (hAsync("div", { key: '12bdec6f975166a4c5d451fc1834f70fbce3b424', class: "feedback__container" }, hAsync("div", { key: '4c607ceef5f10760d540d2549a2b186a871714c7', class: "viewport-margins" }, hAsync("div", { key: 'a967498163e05ce60a12bf230d303caa31373c8d', class: "feedback__content" }, !this.hideQuestion && (this.answer === 'yes' ? (hAsync("p", null, "Thank you for letting us know.")) : this.answer === 'no' ? (hAsync("p", null, "We'd like to help. ", hAsync("a", { href: "https://www.library.upenn.edu/contact-us" }, "Contact us"), " and let us know what you're looking for.")) : (hAsync("form", { class: "feedback__inline-question", onSubmit: (e) => this.handleSubmit(e) }, hAsync("h2", null, "Did you find what you need?"), hAsync("button", { type: "submit", name: "answer", value: "yes", class: { 'selected': this.selected === 'yes' }, disabled: !!this.selected }, hAsync("span", null, "Yes"), hAsync("span", { class: "visually-hidden" }, ", I found what I needed.")), hAsync("button", { type: "submit", name: "answer", value: "no", class: { 'selected': this.selected === 'no' }, disabled: !!this.selected }, hAsync("span", null, "No"), hAsync("span", { class: "visually-hidden" }, ", I did not find what I needed."))))), hAsync("div", { key: 'f918da2833ae0c64e67a9e95551edaeb78e2ba05', class: "feedback__share-feedback" }, hAsync("p", { key: '12928af116ffadf669cbc694160ee6ca3458528b' }, "To help us improve, ", hAsync("a", { key: '7281b7423677b104fb622a7fdcf8e768517ea84e', href: `https://upenn.co1.qualtrics.com/jfe/form/SV_3xVrP7EKWS92zfE?reporting_from_url=${encodeURIComponent(window.location.href)}` }, "share your feedback"), "."))))));
|
|
4268
4327
|
}
|
|
4269
4328
|
static get style() { return pennlibsFeedbackCss; }
|
|
4270
4329
|
static get cmpMeta() { return {
|
|
4271
|
-
"$flags$":
|
|
4330
|
+
"$flags$": 258,
|
|
4272
4331
|
"$tagName$": "pennlibs-feedback",
|
|
4273
4332
|
"$members$": {
|
|
4274
4333
|
"hideQuestion": [4, "hide-question"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@penn-libraries/web",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1-dev.1",
|
|
4
4
|
"description": "Reusable web designs for University of Pennsylvania Libraries websites. This package contains our code for shared Web Components and Cascading Style Sheets (CSS).",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|