hypothesis 1.1589.0 → 1.1591.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
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?a933e9","styles/annotator.css":"styles/annotator.css?427463","styles/annotator.css.map":"styles/annotator.css.map?94a857","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?d92c5a","styles/katex.min.css.map":"styles/katex.min.css.map?e7e03f","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?661aee","styles/sidebar.css.map":"styles/sidebar.css.map?9a27bf","styles/ui-playground.css":"styles/ui-playground.css?df98db","styles/ui-playground.css.map":"styles/ui-playground.css.map?0df86b","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?90e514","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?437f5f","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?4107fe","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?f2cbfd","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?f66fa1"};function e(s){s.setAttribute("data-hypothesis-asset","")}function t(s,t){var o=s.createElement("link");o.rel="stylesheet",o.type="text/css",o.href=t,e(o),s.head.appendChild(o)}function o(s,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=o.esModule,n=void 0===r||r,i=o.forceReload,a=void 0!==i&&i,l=s.createElement("script");n&&(l.type="module"),a&&(t+="#ts=".concat(Date.now())),l.src=t,l.async=!1,e(l),s.head.appendChild(l)}function r(s,t,o,r){var n=s.createElement("link");n.rel=t,n.href=r,n.type="application/annotator+".concat(o),e(n),s.head.appendChild(n)}function n(s,t,o){var r=s.createElement("link");r.rel="preload",r.as=t,r.href=o,"fetch"===t&&(r.crossOrigin="anonymous"),e(r),s.head.appendChild(r)}function i(s,e){return s.assetRoot+"build/"+s.manifest[e]}function a(s){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var t=function(){var s,e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).currentScript;return t?(s=t.src,(e=s.match(/(https?):\/\/([^:/]+)/))?{protocol:e[1],hostname:e[2]}:null):null}(e);if(!t)throw new Error("Could not process URL template because script origin is unknown");return s=(s=s.replace("{current_host}",t.hostname)).replace("{current_scheme}",t.protocol)}if(function(){var s=[()=>Object.fromEntries([]),()=>new URL(document.location.href),()=>new Request("https://hypothes.is"),()=>Element.prototype.attachShadow,()=>CSS.supports("display: grid"),()=>(document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0)];try{return s.every((s=>s()))}catch(s){return!1}}()){var l=function(s){for(var e={},t=s.querySelectorAll("script.js-hypothesis-config"),o=0;o<t.length;o++){var r=void 0;try{r=JSON.parse(t[o].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),r={}}Object.assign(e,r)}return e}(document),p=a(l.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1591.0/");if(document.querySelector("hypothesis-app")){!function(s,e){n(s,"fetch",e.apiUrl),n(s,"fetch",e.apiUrl+"links");for(var r=0,a=["scripts/sidebar.bundle.js"];r<a.length;r++)o(s,i(e,a[r]),{esModule:!0});for(var l=0,p=["styles/katex.min.css","styles/sidebar.css"];l<p.length;l++)t(s,i(e,p[l]))}(document,{assetRoot:p,manifest:s,apiUrl:l.apiUrl})}else{var c=function(){var s;return null===(s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).chrome)||void 0===s||null===(s=s.runtime)||void 0===s?void 0:s.id}();if(c&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(c))throw new Error("Could not start Hypothesis extension as configuration is missing");var d=l,h=a(d.notebookAppUrl||"https://hypothes.is/notebook"),u=a(d.profileAppUrl||"https://hypothes.is/user-profile"),y=a(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,e){if(!s.querySelector('link[type="application/annotator+html"]')){r(s,"sidebar","html",e.sidebarAppUrl),r(s,"notebook","html",e.notebookAppUrl),r(s,"profile","html",e.profileAppUrl),n(s,"style",i(e,"styles/annotator.css")),r(s,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");for(var a=0,l=["scripts/annotator.bundle.js"];a<l.length;a++)o(s,i(e,l[a]),{esModule:!1});var p=[];void 0!==window.PDFViewerApplication&&p.push("styles/pdfjs-overrides.css"),p.push("styles/highlights.css");for(var c=0,d=p;c<d.length;c++)t(s,i(e,d[c]))}}(document,{assetRoot:p,manifest:s,notebookAppUrl:h,profileAppUrl:u,sidebarAppUrl:y})}}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?a933e9",
|
|
3
3
|
"styles/annotator.css": "styles/annotator.css?427463",
|
|
4
4
|
"styles/annotator.css.map": "styles/annotator.css.map?94a857",
|
|
5
5
|
"styles/highlights.css": "styles/highlights.css?6b4ebd",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"styles/ui-playground.css": "styles/ui-playground.css?df98db",
|
|
14
14
|
"styles/ui-playground.css.map": "styles/ui-playground.css.map?0df86b",
|
|
15
15
|
"scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?90e514",
|
|
16
|
-
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?
|
|
16
|
+
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?437f5f",
|
|
17
17
|
"scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?4107fe",
|
|
18
|
-
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?
|
|
18
|
+
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?f2cbfd",
|
|
19
19
|
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?f66fa1"
|
|
20
20
|
}
|
|
@@ -147,7 +147,7 @@ this._sidebarRPC.on("navigateToSegment",(e=>this._integration.navigateToSegment?
|
|
|
147
147
|
if(!t.selector||!t.selector.some((e=>"TextQuoteSelector"===e.type)))return{annotation:e,target:t};let n;try{const o=await this._integration.anchor(this.element,t.selector),i=ho.fromRange(o);n={annotation:e,target:t,range:i}}catch{n={annotation:e,target:t}}return n})));if(!this._annotations.has(e.$tag))return[];for(const e of n)t(e);return e.$orphan=n.length>0&&n.every((e=>e.target.selector&&!e.range)),this._updateAnchors(this.anchors.concat(n),!0),this._sidebarRPC.call("syncAnchoringStatus",e),n}detach(e,t=!0){this._annotations.delete(e);const n=[];for(const t of this.anchors)t.annotation.$tag!==e?n.push(t):t.highlights&&So(t.highlights);this._updateAnchors(n,t)}_updateAnchors(e,t){this.anchors=e,this._clusterToolbar?.scheduleClusterUpdates(),t&&this._bucketBarClient.update(this.anchors)}async createAnnotation({highlight:e=!1}={}){const t=this.selectedRanges;this.selectedRanges=[];const n=await this.getDocumentInfo(),o=this.element,i=(await Promise.all(t.map((e=>this._integration.describe(o,e))))).map((e=>({
|
|
148
148
|
source:n.uri,selector:e}))),r={uri:n.uri,document:n.metadata,target:i,$highlight:e,$cluster:e?"user-highlights":"user-annotations",$tag:"a:"+Zt(8)};return this._sidebarRPC.call("createAnnotation",r),this.anchor(r),Cr(),r}_hoverAnnotations(e){this._hoveredAnnotations.clear(),e.forEach((e=>this._hoveredAnnotations.add(e)));for(const t of this.anchors)if(t.highlights){const n=e.includes(t.annotation.$tag);Eo(t.highlights,n)}this._sidebarRPC.call("hoverAnnotations",e)}_onSelection(e){const t=this._integration.getAnnotatableRange(e);if(!t)return void this._onClearSelection();const n=document.getSelection(),o=_o(n),i=wo(n);i?(this.selectedRanges=[t],this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=yr(),this._isAdderVisible=!0,this._adder.show(i,o)):this._onClearSelection()}_onClearSelection(){this._isAdderVisible=!1,this._adder.hide(),this.selectedRanges=[],this._informHostOnNextSelectionClear&&this._hostRPC.call("textUnselected"),this._informHostOnNextSelectionClear=!0}
|
|
149
149
|
selectAnnotations(e,{toggle:t=!1,focusInSidebar:n=!1}={}){t?this._sidebarRPC.call("toggleAnnotationSelection",e):this._sidebarRPC.call("showAnnotations",e,n),this._sidebarRPC.call("openSidebar")}setHighlightsVisible(e,t=!0){!function(e,t){e.classList.toggle("hypothesis-highlights-always-on",t)}(this.element,e),this._highlightsVisible=e,t&&this._hostRPC.call("highlightsVisibleChanged",e)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(e){this._sidebarLayout=e,this._integration.fitSideBySide(e)}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(e){zn(e,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}_setOutsideAssignmentNoticeVisible(e){this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new br(this.element)),this._outsideAssignmentNotice.setVisible(e)}}function Ar(e,t){const n=new URL(e),o=new URLSearchParams;return o.append("config",JSON.stringify(t)),n.hash=o.toString(),n.toString()}function Rr(e,t){const n={}
|
|
150
|
-
;for(const[e,o]of Object.entries(t))"notebookAppUrl"!==e&&"sidebarAppUrl"!==e&&null!=o&&(n[e]=o);n.origin=new URL(e).origin,n.version="1.
|
|
150
|
+
;for(const[e,o]of Object.entries(t))"notebookAppUrl"!==e&&"sidebarAppUrl"!==e&&null!=o&&(n[e]=o);n.origin=new URL(e).origin,n.version="1.1591.0";const o=new URL(window.location.href);if(o.hash="",n.hostURL=o.toString(),Array.isArray(n.services)&&n.services?.length>0){const e=n.services[0];e.onLoginRequest&&(e.onLoginRequestProvided=!0),e.onLogoutRequest&&(e.onLogoutRequestProvided=!0),e.onSignupRequest&&(e.onSignupRequestProvided=!0),e.onProfileRequest&&(e.onProfileRequestProvided=!0),e.onHelpRequest&&(e.onHelpRequestProvided=!0)}return n}function kr({closed:e,onClose:t,children:n,"data-testid":o,"aria-label":i}){const r=se(null);return ie((()=>{e?r.current?.close():r.current?.showModal()}),[e]),ie((()=>{const e=r.current;return e?.addEventListener("cancel",t),()=>{e?.removeEventListener("cancel",t)}}),[t]),Te("dialog",{ref:r,className:"relative w-full h-full backdrop:bg-black/50","data-testid":o,"aria-label":i,children:n})}function Pr({closed:e,children:t,...n}){return Te("div",{...n,
|
|
151
151
|
className:ke("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:e}),children:Te("div",{className:"relative w-full h-full",children:t})})}function Tr({document_:e=document,...t}){return Te(ae((()=>function(e){return"function"==typeof e.createElement("dialog").showModal}(e)?kr:Pr),[e]),{...t})}function Mr({config:e,groupId:t}){return Te("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allow:"fullscreen; clipboard-write",src:Ar(e.notebookAppUrl,{...Rr(e.notebookAppUrl,e),group:t})})}function Lr({eventBus:e,config:t}){const[n,o]=oe(0),[i,r]=oe(!0),[s,a]=oe(null),l=se(""),c=se(null);ie((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),ie((()=>{document.body.style.overflow=i?l.current:"hidden"}),[i]),ie((()=>{const t=e.createEmitter();return t.subscribe("openNotebook",(e=>{r(!1),o((e=>e+1)),a(e)})),c.current=t,()=>{t.destroy()}}),[e]);const u=le((()=>{r(!0),c.current?.publish("closeNotebook")}),[])
|
|
152
152
|
;return null===s?null:Te(Tr,{closed:i,onClose:u,"data-testid":"notebook-outer","aria-label":"Hypothesis notebook",children:[Te("div",{className:"absolute right-0 m-3",children:Te(Ct,{title:"Close notebook",onClick:u,variant:"dark",classes:ke("!bg-transparent enabled:hover:!bg-grey-3"),"data-testid":"close-button",children:Te(Fe,{className:"w-4 h-4"})})}),Te(Mr,{config:t,groupId:s},n)]})}class Or{constructor(e,t,n){this._container=new Zn("notebook",(()=>Te(Lr,{eventBus:t,config:n}))),e.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}function Ir({eventBus:e,config:t}){const[n,o]=oe(!0),i=se(null);ie((()=>{const t=e.createEmitter();return t.subscribe("openProfile",(()=>{o(!1)})),i.current=t,()=>{t.destroy()}}),[e]);const r=()=>{o(!0),i.current?.publish("closeProfile")};return n?null:Te(Tr,{closed:n,onClose:r,"data-testid":"profile-outer","aria-label":"Hypothesis profile",children:[Te("div",{className:"absolute right-0 m-3",children:Te(Ct,{
|
|
153
153
|
title:"Close profile dialog",onClick:r,variant:"dark",classes:ke("!bg-transparent enabled:hover:!bg-grey-3"),children:Te(Fe,{className:"w-4 h-4"})})}),Te("iframe",{title:"Hypothesis profile",className:"h-full w-full border-0",src:t.profileAppUrl})]})}class Br{constructor(e,t,n){this._container=new Zn("profile",(()=>Te(Ir,{eventBus:t,config:n}))),e.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}function Hr({above:e,below:t,buckets:n,onFocusAnnotations:o,onScrollToAnnotation:i,onSelectAnnotations:r}){const s=e.anchors.length>0,a=t.anchors.length>0,l=e=>e.anchors.map((e=>e.tag));return Te("ul",{className:"relative",children:[s&&Te("li",{className:"absolute right-0 pointer-events-auto mt-[-11px]",style:{top:e.position},children:Te(Qt,{"data-testid":"up-navigation-button",direction:"up",onClick:()=>{const t=[...e.anchors].sort(((e,t)=>e.bottom-t.bottom)),n=t[t.length-1];i(n.tag)},onBlur:()=>o([]),onFocus:()=>o(l(e)),onMouseEnter:()=>o(l(e)),onMouseOut:()=>o([]),
|