hypothesis 1.1242.0 → 1.1244.0
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/build/boot.js +1 -1
- package/build/manifest.json +6 -6
- package/build/scripts/annotator.bundle.js +2 -2
- package/build/scripts/annotator.bundle.js.map +1 -1
- package/build/scripts/sidebar.bundle.js +55 -55
- package/build/scripts/sidebar.bundle.js.map +1 -1
- package/build/scripts/ui-playground.bundle.js +1 -1
- package/build/scripts/ui-playground.bundle.js.map +1 -1
- package/package.json +2 -2
package/build/boot.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?
|
|
1
|
+
!function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?1bb2e6","styles/annotator.css":"styles/annotator.css?13d96a","styles/annotator.css.map":"styles/annotator.css.map?420356","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?e9b69c","styles/katex.min.css.map":"styles/katex.min.css.map?42d80c","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?c95edf","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?1d8ac6","styles/sidebar.css":"styles/sidebar.css?a9757b","styles/sidebar.css.map":"styles/sidebar.css.map?310106","styles/ui-playground.css":"styles/ui-playground.css?2817da","styles/ui-playground.css.map":"styles/ui-playground.css.map?a4aa2e","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?567bad","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?cf8f99","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?5464ef","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?30df62","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?ecb854"};function t(s){s.setAttribute("data-hypothesis-asset","")}function e(s,e){var r=s.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=e,t(r),s.head.appendChild(r)}function r(s,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.esModule,o=void 0===n||n,a=r.forceReload,i=void 0!==a&&a,l=s.createElement("script");o&&(l.type="module"),i&&(e+="#ts=".concat(Date.now())),l.src=e,l.async=!1,t(l),s.head.appendChild(l)}function n(s,e,r,n){var o=s.createElement("link");o.rel=e,o.href=n,o.type="application/annotator+".concat(r),t(o),s.head.appendChild(o)}function o(s,e,r){var n=s.createElement("link");n.rel="preload",n.as=e,n.href=r,"fetch"===e&&(n.crossOrigin="anonymous"),t(n),s.head.appendChild(n)}function a(s,t){return s.assetRoot+"build/"+s.manifest[t]}function i(s){var t=s.match(/(https?):\/\/([^:/]+)/);return t?{protocol:t[1],hostname:t[2]}:null}function l(){var s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=s.currentScript;return t?i(t.src):null}function p(s){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var e=l(t);if(!e)throw new Error("Could not process URL template because script origin is unknown");return s=(s=s.replace("{current_host}",e.hostname)).replace("{current_scheme}",e.protocol)}if(function(){var s=[function(){return Object.fromEntries([])},function(){return new URL(document.location.href)},function(){return new Request("https://hypothes.is")},function(){return Element.prototype.attachShadow},function(){return CSS.supports("display: grid")},function(){return document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0}];try{return s.every((function(s){return s()}))}catch(s){return!1}}()){var c=function(s){for(var t={},e=s.querySelectorAll("script.js-hypothesis-config"),r=0;r<e.length;r++){var n=void 0;try{n=JSON.parse(e[r].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),n={}}Object.assign(t,n)}return t}(document),u=p(c.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1244.0/");if(document.querySelector("hypothesis-app")){!function(s,t){o(s,"fetch",t.apiUrl),o(s,"fetch",t.apiUrl+"links");for(var n=0,i=["scripts/sidebar.bundle.js"];n<i.length;n++)r(s,a(t,i[n]),{esModule:!0});for(var l=0,p=["styles/katex.min.css","styles/sidebar.css"];l<p.length;l++)e(s,a(t,p[l]))}(document,{assetRoot:u,manifest:s,apiUrl:c.apiUrl})}else{var d=c,h=p(d.notebookAppUrl||"https://hypothes.is/notebook"),y=p(d.profileAppUrl||"https://hypothes.is/user-profile"),f=p(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,t){if(!s.querySelector('link[type="application/annotator+html"]')){n(s,"sidebar","html",t.sidebarAppUrl),n(s,"notebook","html",t.notebookAppUrl),n(s,"profile","html",t.profileAppUrl),o(s,"style",a(t,"styles/annotator.css")),n(s,"hypothesis-client","javascript",t.assetRoot+"build/boot.js");for(var i=0,l=["scripts/annotator.bundle.js"];i<l.length;i++)r(s,a(t,l[i]),{esModule:!1});var p=[];void 0!==window.PDFViewerApplication&&p.push("styles/pdfjs-overrides.css"),p.push("styles/highlights.css");for(var c=0,u=p;c<u.length;c++)e(s,a(t,u[c]))}}(document,{assetRoot:u,manifest:s,notebookAppUrl:h,profileAppUrl:y,sidebarAppUrl:f})}}else console.warn("The Hypothesis annotation tool is not supported in this browser. See https://web.hypothes.is/help/which-browsers-are-supported-by-hypothesis/.")}();
|
package/build/manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?
|
|
2
|
+
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?1bb2e6",
|
|
3
3
|
"styles/annotator.css": "styles/annotator.css?13d96a",
|
|
4
4
|
"styles/annotator.css.map": "styles/annotator.css.map?420356",
|
|
5
5
|
"styles/highlights.css": "styles/highlights.css?6b4ebd",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"styles/sidebar.css.map": "styles/sidebar.css.map?310106",
|
|
13
13
|
"styles/ui-playground.css": "styles/ui-playground.css?2817da",
|
|
14
14
|
"styles/ui-playground.css.map": "styles/ui-playground.css.map?a4aa2e",
|
|
15
|
-
"scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?
|
|
16
|
-
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?
|
|
17
|
-
"scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?
|
|
18
|
-
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?
|
|
19
|
-
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?
|
|
15
|
+
"scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?567bad",
|
|
16
|
+
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?cf8f99",
|
|
17
|
+
"scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?5464ef",
|
|
18
|
+
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?30df62",
|
|
19
|
+
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?ecb854"
|
|
20
20
|
}
|
|
@@ -16,7 +16,7 @@ sidebar:["appType","annotations","branding","enableExperimentalNewNoteButton","e
|
|
|
16
16
|
;function q(t,e){for(var n in e)t[n]=e[n];return t}function W(t){var e=t.parentNode;e&&e.removeChild(t)}function z(t,e,n,i,o){var r={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++L:o};return null==o&&null!=O.vnode&&O.vnode(r),r}function $(t){return t.children}function j(t,e){this.props=t,this.context=e}function X(t,e){if(null==e)return t.__?X(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?X(t):null}function Y(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return Y(t)}}function Z(t){(!t.__d&&(t.__d=!0)&&M.push(t)&&!G.__r++||I!==O.debounceRendering)&&((I=O.debounceRendering)||D)(G)}function G(){var t,e,n,i,o,r,s,a;for(M.sort(F);t=M.shift();)t.__d&&(e=M.length,i=void 0,o=void 0,s=(r=(n=t).__v).__e,(a=n.__P)&&(i=[],
|
|
17
17
|
(o=q({},r)).__v=r.__v+1,rt(a,r,o,n.__n,void 0!==a.ownerSVGElement,null!=r.__h?[s]:null,i,null==s?X(r):s,r.__h),st(i,r),r.__e!=s&&Y(r)),M.length>e&&M.sort(F));G.__r=0}function K(t,e,n,i,o,r,s,a,l,c){var h,u,d,f,p,m,g,_=i&&i.__k||V,v=_.length;for(n.__k=[],h=0;h<e.length;h++)if(null!=(f=n.__k[h]=null==(f=e[h])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?z(null,f,null,null,f):Array.isArray(f)?z($,{children:f},null,null,null):f.__b>0?z(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=n,f.__b=n.__b+1,null===(d=_[h])||d&&f.key==d.key&&f.type===d.type)_[h]=void 0;else for(u=0;u<v;u++){if((d=_[u])&&f.key==d.key&&f.type===d.type){_[u]=void 0;break}d=null}rt(t,f,d=d||H,o,r,s,a,l,c),p=f.__e,(u=f.ref)&&d.ref!=u&&(g||(g=[]),d.ref&&g.push(d.ref,null,f),g.push(u,f.__c||p,f)),null!=p?(null==m&&(m=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=l=Q(f,l,t):l=J(t,f,d,_,p,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=t&&(l=X(d))}
|
|
18
18
|
for(n.__e=m,h=v;h--;)null!=_[h]&&("function"==typeof n.type&&null!=_[h].__e&&_[h].__e==n.__d&&(n.__d=tt(i).nextSibling),ct(_[h],_[h]));if(g)for(h=0;h<g.length;h++)lt(g[h],g[++h],g[++h])}function Q(t,e,n){for(var i,o=t.__k,r=0;o&&r<o.length;r++)(i=o[r])&&(i.__=t,e="function"==typeof i.type?Q(i,e,n):J(n,i,i,o,i.__e,e));return e}function J(t,e,n,i,o,r){var s,a,l;if(void 0!==e.__d)s=e.__d,e.__d=void 0;else if(null==n||o!=r||null==o.parentNode)t:if(null==r||r.parentNode!==t)t.appendChild(o),s=null;else{for(a=r,l=0;(a=a.nextSibling)&&l<i.length;l+=1)if(a==o)break t;t.insertBefore(o,r),s=r}return void 0!==s?s:o.nextSibling}function tt(t){var e,n,i;if(null==t.type||"string"==typeof t.type)return t.__e;if(t.__k)for(e=t.__k.length-1;e>=0;e--)if((n=t.__k[e])&&(i=tt(n)))return i;return null}function et(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||U.test(e)?n:n+"px"}function nt(t,e,n,i,o){var r;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{
|
|
19
|
-
if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||et(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||et(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?i||t.addEventListener(e,r?ot:it,r):t.removeEventListener(e,r?ot:it,r);else if("dangerouslySetInnerHTML"!==e){if(o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n
|
|
19
|
+
if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||et(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||et(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?i||t.addEventListener(e,r?ot:it,r):t.removeEventListener(e,r?ot:it,r);else if("dangerouslySetInnerHTML"!==e){if(o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function it(t){return this.l[t.type+!1](O.event?O.event(t):t)}function ot(t){return this.l[t.type+!0](O.event?O.event(t):t)}function rt(t,e,n,i,o,r,s,a,l){var c,h,u,d,f,p,m,g,_,v,b,y,w,x,C,S=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(l=n.__h,a=e.__e=n.__e,e.__h=null,r=[a]),(c=O.__b)&&c(e);try{
|
|
20
20
|
t:if("function"==typeof S){if(g=e.props,_=(c=S.contextType)&&i[c.__c],v=c?_?_.props.value:c.__:i,n.__c?m=(h=e.__c=n.__c).__=h.__E:("prototype"in S&&S.prototype.render?e.__c=h=new S(g,v):(e.__c=h=new j(g,v),h.constructor=S,h.render=ht),_&&_.sub(h),h.props=g,h.state||(h.state={}),h.context=v,h.__n=i,u=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=S.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=q({},h.__s)),q(h.__s,S.getDerivedStateFromProps(g,h.__s))),d=h.props,f=h.state,h.__v=e,u)null==S.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==S.getDerivedStateFromProps&&g!==d&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(g,v),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(g,h.__s,v)||e.__v===n.__v){for(e.__v!==n.__v&&(h.props=g,h.state=h.__s,h.__d=!1),h.__e=!1,e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),
|
|
21
21
|
b=0;b<h._sb.length;b++)h.__h.push(h._sb[b]);h._sb=[],h.__h.length&&s.push(h);break t}null!=h.componentWillUpdate&&h.componentWillUpdate(g,h.__s,v),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(d,f,p)}))}if(h.context=v,h.props=g,h.__P=t,y=O.__r,w=0,"prototype"in S&&S.prototype.render){for(h.state=h.__s,h.__d=!1,y&&y(e),c=h.render(h.props,h.state,h.context),x=0;x<h._sb.length;x++)h.__h.push(h._sb[x]);h._sb=[]}else do{h.__d=!1,y&&y(e),c=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++w<25);h.state=h.__s,null!=h.getChildContext&&(i=q(q({},i),h.getChildContext())),u||null==h.getSnapshotBeforeUpdate||(p=h.getSnapshotBeforeUpdate(d,f)),C=null!=c&&c.type===$&&null==c.key?c.props.children:c,K(t,Array.isArray(C)?C:[C],e,n,i,o,r,s,a,l),h.base=e.__e,e.__h=null,h.__h.length&&s.push(h),m&&(h.__E=h.__=null),h.__e=!1}else null==r&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=at(n.__e,e,n,i,o,r,s,l);(c=O.diffed)&&c(e)}catch(t){e.__v=null,(l||null!=r)&&(e.__e=a,e.__h=!!l,
|
|
22
22
|
r[r.indexOf(a)]=null),O.__e(t,e,n)}}function st(t,e){O.__c&&O.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){O.__e(t,e.__v)}}))}function at(t,e,n,i,o,r,s,a){var l,c,h,u=n.props,d=e.props,f=e.type,p=0;if("svg"===f&&(o=!0),null!=r)for(;p<r.length;p++)if((l=r[p])&&"setAttribute"in l==!!f&&(f?l.localName===f:3===l.nodeType)){t=l,r[p]=null;break}if(null==t){if(null===f)return document.createTextNode(d);t=o?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,d.is&&d),r=null,a=!1}if(null===f)u===d||a&&t.data===d||(t.data=d);else{if(r=r&&P.call(t.childNodes),c=(u=n.props||H).dangerouslySetInnerHTML,h=d.dangerouslySetInnerHTML,!a){if(null!=r)for(u={},p=0;p<t.attributes.length;p++)u[t.attributes[p].name]=t.attributes[p].value;(h||c)&&(h&&(c&&h.__html==c.__html||h.__html===t.innerHTML)||(t.innerHTML=h&&h.__html||""))}if(function(t,e,n,i,o){var r;for(r in n)"children"===r||"key"===r||r in e||nt(t,r,null,n[r],i)
|
|
@@ -119,7 +119,7 @@ this._hostRPC.on("hoverAnnotations",(t=>this._hoverAnnotations(t))),this._hostRP
|
|
|
119
119
|
}(this.element),this._integration.destroy()}async anchor(t){const e=t=>{var e;const n=No(t);if(!n)return;const i=on(n,null===(e=t.annotation)||void 0===e?void 0:e.$cluster);i.forEach((e=>{e._annotation=t.annotation})),t.highlights=i,this._hoveredAnnotations.has(t.annotation.$tag)&&an(i,!0)};this.detach(t.$tag,!1),this._annotations.add(t.$tag),t.target||(t.target=[]);const n=await Promise.all(t.target.map((async e=>{if(!e.selector||!e.selector.some((t=>"TextQuoteSelector"===t.type)))return{annotation:t,target:e};let n;try{const i=await this._integration.anchor(this.element,e.selector),o=Ye.fromRange(i);n={annotation:t,target:e,range:o}}catch(i){n={annotation:t,target:e}}return n})));if(!this._annotations.has(t.$tag))return[];for(const t of n)e(t);return t.$orphan=n.length>0&&n.every((t=>t.target.selector&&!t.range)),this._updateAnchors(this.anchors.concat(n),!0),this._sidebarRPC.call("syncAnchoringStatus",t),n}detach(t,e=!0){this._annotations.delete(t);const n=[]
|
|
120
120
|
;for(const e of this.anchors)e.annotation.$tag!==t?n.push(e):e.highlights&&sn(e.highlights);this._updateAnchors(n,e)}_updateAnchors(t,e){var n;this.anchors=t,null===(n=this._clusterToolbar)||void 0===n||n.scheduleClusterUpdates(),e&&this._bucketBarClient.update(this.anchors)}async createAnnotation({highlight:t=!1}={}){const e=this.selectedRanges;this.selectedRanges=[];const n=await this.getDocumentInfo(),i=this.element,r=(await Promise.all(e.map((t=>this._integration.describe(i,t))))).map((t=>({source:n.uri,selector:t}))),s={uri:n.uri,document:n.metadata,target:r,$highlight:t,$cluster:t?"user-highlights":"user-annotations",$tag:"a:"+o(8)};return this._sidebarRPC.call("createAnnotation",s),this.anchor(s),Ao(),s}_hoverAnnotations(t){this._hoveredAnnotations.clear(),t.forEach((t=>this._hoveredAnnotations.add(t)));for(const e of this.anchors)if(e.highlights){const n=t.includes(e.annotation.$tag);an(e.highlights,n)}this._sidebarRPC.call("hoverAnnotations",t)}_scrollToClosestOffScreenAnchor(t,e){
|
|
121
121
|
const n=function(t,e){let n=null,i=0;for(let r of t){var o;if(null===(o=r.highlights)||void 0===o||!o.length)continue;const t=ln(r.highlights).top;"up"===e&&t>=137||"down"===e&&t<=window.innerHeight-22||(!n||"up"===e&&t>i||"down"===e&&t<i)&&(n=r,i=t)}return n}(this.anchors.filter((({annotation:e})=>t.includes(e.$tag))),e);n&&this._integration.scrollToAnchor(n)}_onSelection(t){const e=this._integration.getAnnotatableRange(t);if(!e)return void this._onClearSelection();const n=document.getSelection(),i=Ke(n),o=tn(n);o?(this.selectedRanges=[e],this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=So(),this._isAdderVisible=!0,this._adder.show(o,i)):this._onClearSelection()}_onClearSelection(){this._isAdderVisible=!1,this._adder.hide(),this.selectedRanges=[],this._informHostOnNextSelectionClear&&this._hostRPC.call("textUnselected"),this._informHostOnNextSelectionClear=!0}selectAnnotations(t,{toggle:e=!1,focusInSidebar:n=!1}={}){
|
|
122
|
-
e?this._sidebarRPC.call("toggleAnnotationSelection",t):this._sidebarRPC.call("showAnnotations",t,n),this._sidebarRPC.call("openSidebar")}setHighlightsVisible(t,e=!0){!function(t,e){t.classList.toggle("hypothesis-highlights-always-on",e)}(this.element,t),this._highlightsVisible=t,e&&this._hostRPC.call("highlightsVisibleChanged",t)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(t){this._sideBySideActive=this._integration.fitSideBySide(t)}get sideBySideActive(){return this._sideBySideActive}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){Ht(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}}function ko(t,e){const n=new URL(t),i=new URLSearchParams;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function To(t,e){var n;const i={};for(let[t,n]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=n&&(i[t]=n);i.origin=new URL(t).origin,i.version="1.
|
|
122
|
+
e?this._sidebarRPC.call("toggleAnnotationSelection",t):this._sidebarRPC.call("showAnnotations",t,n),this._sidebarRPC.call("openSidebar")}setHighlightsVisible(t,e=!0){!function(t,e){t.classList.toggle("hypothesis-highlights-always-on",e)}(this.element,t),this._highlightsVisible=t,e&&this._hostRPC.call("highlightsVisibleChanged",t)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(t){this._sideBySideActive=this._integration.fitSideBySide(t)}get sideBySideActive(){return this._sideBySideActive}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){Ht(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}}function ko(t,e){const n=new URL(t),i=new URLSearchParams;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function To(t,e){var n;const i={};for(let[t,n]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=n&&(i[t]=n);i.origin=new URL(t).origin,i.version="1.1244.0";const o=new URL(window.location.href)
|
|
123
123
|
;if(o.hash="",i.hostURL=o.toString(),Array.isArray(i.services)&&(null===(n=i.services)||void 0===n?void 0:n.length)>0){const t=i.services[0];t.onLoginRequest&&(t.onLoginRequestProvided=!0),t.onLogoutRequest&&(t.onLogoutRequestProvided=!0),t.onSignupRequest&&(t.onSignupRequestProvided=!0),t.onProfileRequest&&(t.onProfileRequestProvided=!0),t.onHelpRequest&&(t.onHelpRequestProvided=!0)}return i}function Po({config:t,groupId:e}){return Wt("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allowFullScreen:!0,src:ko(t.notebookAppUrl,{...To(t.notebookAppUrl,t),group:e})})}function Oo({eventBus:t,config:e}){const[n,i]=Nt(0),[o,r]=Nt(!0),[s,a]=Nt(null),l=Rt(""),c=Rt(null);At((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),At((()=>{document.body.style.overflow=o?l.current:"hidden"}),[o]),At((()=>{const e=t.createEmitter();return e.subscribe("openNotebook",(t=>{r(!1),i((t=>t+1)),a(t)})),c.current=e,()=>{e.destroy()}}),[t])
|
|
124
124
|
;return null===s?null:Wt("div",{className:be("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:o}),"data-testid":"notebook-outer",children:Wt("div",{className:"relative w-full h-full","data-testid":"notebook-inner",children:[Wt("div",{className:"absolute right-0 m-3",children:Wt(Ae,{title:"Close the Notebook",onClick:()=>{var t;r(!0),null===(t=c.current)||void 0===t||t.publish("closeNotebook")},variant:"dark",classes:be("!bg-transparent enabled:hover:!bg-grey-3"),children:Wt(Xt,{className:"w-4 h-4"})})}),Wt(Po,{config:e,groupId:s},n)]})})}class Lo{constructor(t,n,i){e(this,"_outerContainer",void 0),e(this,"_shadowRoot",void 0),this._outerContainer=document.createElement("hypothesis-notebook"),t.appendChild(this._outerContainer),this._shadowRoot=De(this._outerContainer),ut(Wt(Oo,{eventBus:n,config:i}),this._shadowRoot)}destroy(){ut(null,this._shadowRoot),this._outerContainer.remove()}}function Mo({eventBus:t,config:e}){const[n,i]=Nt(!0),o=Rt(null);At((()=>{const e=t.createEmitter()
|
|
125
125
|
;return e.subscribe("openProfile",(()=>{i(!1)})),o.current=e,()=>{e.destroy()}}),[t]);return n?null:Wt("div",{className:"fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50","data-testid":"profile-outer",children:Wt("div",{className:"relative w-full h-full","data-testid":"profile-inner",children:[Wt("div",{className:"absolute right-0 m-3",children:Wt(Ae,{title:"Close the Profile",onClick:()=>{var t;i(!0),null===(t=o.current)||void 0===t||t.publish("closeProfile")},variant:"dark",classes:be("!bg-transparent enabled:hover:!bg-grey-3"),children:Wt(Xt,{className:"w-4 h-4"})})}),Wt("iframe",{title:"Hypothesis profile",className:"h-full w-full border-0",src:e.profileAppUrl})]})})}class Io{constructor(t,n,i){e(this,"_outerContainer",void 0),e(this,"shadowRoot",void 0),this._outerContainer=document.createElement("hypothesis-profile"),t.appendChild(this._outerContainer),this.shadowRoot=De(this._outerContainer),ut(Wt(Mo,{eventBus:n,config:i}),this.shadowRoot)}destroy(){ut(null,this.shadowRoot),
|