hypothesis 1.1763.0 → 1.1765.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-template.js +1 -1
- package/build/boot.js +1 -1
- package/build/manifest.json +6 -6
- package/build/scripts/annotator.bundle.js +3 -3
- package/build/scripts/annotator.bundle.js.map +1 -1
- package/build/scripts/sidebar.bundle.js +6 -6
- package/build/scripts/sidebar.bundle.js.map +1 -1
- package/build/scripts/ui-playground.bundle.js +4 -4
- package/build/scripts/ui-playground.bundle.js.map +1 -1
- package/package.json +33 -6
package/build/boot-template.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?9ba0c0","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?b18f6b","styles/annotator.css":"styles/annotator.css?2911a6","styles/annotator.css.map":"styles/annotator.css.map?0fa42e","styles/highlights.css":"styles/highlights.css?ef86d1","styles/highlights.css.map":"styles/highlights.css.map?6ce8dd","styles/katex.min.css":"styles/katex.min.css?027dee","styles/katex.min.css.map":"styles/katex.min.css.map?f4f041","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?d58df4","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?5a12c5","styles/sidebar.css":"styles/sidebar.css?5a6ac5","styles/sidebar.css.map":"styles/sidebar.css.map?d343de","styles/ui-playground.css":"styles/ui-playground.css?62a6e0","styles/ui-playground.css.map":"styles/ui-playground.css.map?a2f361","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?2112a1","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?f1502f","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?dabe35","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?a282bc"};function e(s){s.setAttribute("data-hypothesis-asset","")}function t(s,t){var r=s.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=t,e(r),s.head.appendChild(r)}function r(s,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.esModule,n=void 0===o||o,i=r.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 o(s,t,r,o){var n=s.createElement("link");n.rel=t,n.href=o,n.type="application/annotator+".concat(r),e(n),s.head.appendChild(n)}function n(s,t,r){var o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).crossOrigin,n=s.createElement("link");n.rel="preload",n.as=t,n.href=r,(o||"fetch"===t)&&(n.crossOrigin="anonymous",n.removeAttribute=()=>{}),e(n),s.head.appendChild(n)}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"),r=0;r<t.length;r++){var o=void 0;try{o=JSON.parse(t[r].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),o={}}Object.assign(e,o)}return e}(document),c=a(l.assetRoot||"__ASSET_ROOT__");if(document.querySelector("hypothesis-app")){!function(s,e){n(s,"fetch",e.apiUrl),n(s,"fetch",e.apiUrl+"links");for(var o=0,a=["scripts/sidebar.bundle.js"];o<a.length;o++)r(s,i(e,a[o]),{esModule:!0});for(var l=0,c=["styles/katex.min.css","styles/sidebar.css"];l<c.length;l++)t(s,i(e,c[l]))}(document,{assetRoot:c,manifest:s,apiUrl:l.apiUrl})}else{var p=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(p&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(p))throw new Error("Could not start Hypothesis extension as configuration is missing");var d=l,u=a(d.notebookAppUrl||"__NOTEBOOK_APP_URL__"),h=a(d.profileAppUrl||"__PROFILE_APP_URL__"),y=a(d.sidebarAppUrl||"__SIDEBAR_APP_URL__");!function(s,e){if(!s.querySelector('link[type="application/annotator+html"]')){o(s,"sidebar","html",e.sidebarAppUrl),o(s,"notebook","html",e.notebookAppUrl),o(s,"profile","html",e.profileAppUrl),n(s,"style",i(e,"styles/annotator.css"),{crossOrigin:!0}),o(s,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");for(var a=0,l=["scripts/annotator.bundle.js"];a<l.length;a++)r(s,i(e,l[a]),{esModule:!1});var c=[];void 0!==window.PDFViewerApplication&&c.push("styles/pdfjs-overrides.css"),c.push("styles/highlights.css");for(var p=0,d=c;p<d.length;p++)t(s,i(e,d[p]))}}(document,{assetRoot:c,manifest:s,notebookAppUrl:u,profileAppUrl:h,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/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?9ba0c0","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?b18f6b","styles/annotator.css":"styles/annotator.css?2911a6","styles/annotator.css.map":"styles/annotator.css.map?0fa42e","styles/highlights.css":"styles/highlights.css?ef86d1","styles/highlights.css.map":"styles/highlights.css.map?6ce8dd","styles/katex.min.css":"styles/katex.min.css?027dee","styles/katex.min.css.map":"styles/katex.min.css.map?f4f041","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?d58df4","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?5a12c5","styles/sidebar.css":"styles/sidebar.css?5a6ac5","styles/sidebar.css.map":"styles/sidebar.css.map?d343de","styles/ui-playground.css":"styles/ui-playground.css?62a6e0","styles/ui-playground.css.map":"styles/ui-playground.css.map?a2f361","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?2112a1","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?f1502f","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?dabe35","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?a282bc"};function e(s){s.setAttribute("data-hypothesis-asset","")}function t(s,t){var r=s.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=t,e(r),s.head.appendChild(r)}function r(s,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.esModule,n=void 0===o||o,i=r.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 o(s,t,r,o){var n=s.createElement("link");n.rel=t,n.href=o,n.type="application/annotator+".concat(r),e(n),s.head.appendChild(n)}function n(s,t,r){var o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).crossOrigin,n=s.createElement("link");n.rel="preload",n.as=t,n.href=r,(o||"fetch"===t)&&(n.crossOrigin="anonymous",n.removeAttribute=()=>{}),e(n),s.head.appendChild(n)}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"),r=0;r<t.length;r++){var o=void 0;try{o=JSON.parse(t[r].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),o={}}Object.assign(e,o)}return e}(document),c=a(l.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1765.0/");if(document.querySelector("hypothesis-app")){!function(s,e){n(s,"fetch",e.apiUrl),n(s,"fetch",e.apiUrl+"links");for(var o=0,a=["scripts/sidebar.bundle.js"];o<a.length;o++)r(s,i(e,a[o]),{esModule:!0});for(var l=0,c=["styles/katex.min.css","styles/sidebar.css"];l<c.length;l++)t(s,i(e,c[l]))}(document,{assetRoot:c,manifest:s,apiUrl:l.apiUrl})}else{var p=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(p&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(p))throw new Error("Could not start Hypothesis extension as configuration is missing");var d=l,u=a(d.notebookAppUrl||"https://hypothes.is/notebook"),h=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"]')){o(s,"sidebar","html",e.sidebarAppUrl),o(s,"notebook","html",e.notebookAppUrl),o(s,"profile","html",e.profileAppUrl),n(s,"style",i(e,"styles/annotator.css"),{crossOrigin:!0}),o(s,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");for(var a=0,l=["scripts/annotator.bundle.js"];a<l.length;a++)r(s,i(e,l[a]),{esModule:!1});var c=[];void 0!==window.PDFViewerApplication&&c.push("styles/pdfjs-overrides.css"),c.push("styles/highlights.css");for(var p=0,d=c;p<d.length;p++)t(s,i(e,d[p]))}}(document,{assetRoot:c,manifest:s,notebookAppUrl:u,profileAppUrl:h,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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?
|
|
3
|
-
"scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?
|
|
2
|
+
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?9ba0c0",
|
|
3
|
+
"scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?b18f6b",
|
|
4
4
|
"styles/annotator.css": "styles/annotator.css?2911a6",
|
|
5
5
|
"styles/annotator.css.map": "styles/annotator.css.map?0fa42e",
|
|
6
6
|
"styles/highlights.css": "styles/highlights.css?ef86d1",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"styles/sidebar.css.map": "styles/sidebar.css.map?d343de",
|
|
14
14
|
"styles/ui-playground.css": "styles/ui-playground.css?62a6e0",
|
|
15
15
|
"styles/ui-playground.css.map": "styles/ui-playground.css.map?a2f361",
|
|
16
|
-
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?
|
|
17
|
-
"scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?
|
|
18
|
-
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?
|
|
19
|
-
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?
|
|
16
|
+
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?2112a1",
|
|
17
|
+
"scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?f1502f",
|
|
18
|
+
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?dabe35",
|
|
19
|
+
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?a282bc"
|
|
20
20
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
!function(){"use strict";var t,e,n,o,i,r,s,a,l,c,h,d,u={},f=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function _(t,e){for(var n in e)t[n]=e[n];return t}function m(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function b(t,o,i,r,s){var a={type:t,props:o,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++n:s,__i:-1,__u:0};return null==s&&null!=e.vnode&&e.vnode(a),a}function y(t){return t.children}function w(t,e){this.props=t,this.context=e}function v(t,e){if(null==e)return t.__?v(t.__,t.__i+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?v(t):null}function x(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 x(t)}}function C(t){(!t.__d&&(t.__d=!0)&&o.push(t)&&!S.__r++||i!=e.debounceRendering)&&((i=e.debounceRendering)||r)(S)}function S(){
|
|
2
|
-
for(var t,n,i,r,a,l,c,h=1;o.length;)o.length>h&&o.sort(s),t=o.shift(),h=o.length,t.__d&&(i=void 0,r=void 0,a=(r=(n=t).__v).__e,l=[],c=[],n.__P&&((i=_({},r)).__v=r.__v+1,e.vnode&&e.vnode(i),T(n.__P,i,r,n.__n,n.__P.namespaceURI,32&r.__u?[a]:null,l,null==a?v(r):a,!!(32&r.__u),c),i.__v=r.__v,i.__.__k[i.__i]=i,L(l,i,c),r.__e=r.__=null,i.__e!=a&&x(i)));S.__r=0}function A(t,e,n,o,i,r,s,a,l,c,h){var d,p,_,m,w,x,C,S=o&&o.__k||f,A=e.length;for(l=function(t,e,n,o,i){var r,s,a,l,c,h=n.length,d=h,u=0;for(t.__k=new Array(i),r=0;r<i;r++)null!=(s=e[r])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=t.__k[r]=b(null,s,null,null,null):g(s)?s=t.__k[r]=b(y,{children:s},null,null,null):
|
|
2
|
+
for(var t,n,i,r,a,l,c,h=1;o.length;)o.length>h&&o.sort(s),t=o.shift(),h=o.length,t.__d&&(i=void 0,r=void 0,a=(r=(n=t).__v).__e,l=[],c=[],n.__P&&((i=_({},r)).__v=r.__v+1,e.vnode&&e.vnode(i),T(n.__P,i,r,n.__n,n.__P.namespaceURI,32&r.__u?[a]:null,l,null==a?v(r):a,!!(32&r.__u),c),i.__v=r.__v,i.__.__k[i.__i]=i,L(l,i,c),r.__e=r.__=null,i.__e!=a&&x(i)));S.__r=0}function A(t,e,n,o,i,r,s,a,l,c,h){var d,p,_,m,w,x,C,S=o&&o.__k||f,A=e.length;for(l=function(t,e,n,o,i){var r,s,a,l,c,h=n.length,d=h,u=0;for(t.__k=new Array(i),r=0;r<i;r++)null!=(s=e[r])&&"boolean"!=typeof s&&"function"!=typeof s?("string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?s=t.__k[r]=b(null,s,null,null,null):g(s)?s=t.__k[r]=b(y,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?s=t.__k[r]=b(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):t.__k[r]=s,l=r+u,s.__=t,s.__b=t.__b+1,a=null,-1!=(c=s.__i=M(s,n,l,d))&&(d--,(a=n[c])&&(a.__u|=2)),null==a||null==a.__v?(-1==c&&(i>h?u--:i<h&&u++),
|
|
3
3
|
"function"!=typeof s.type&&(s.__u|=4)):c!=l&&(c==l-1?u--:c==l+1?u++:(c>l?u--:u++,s.__u|=4))):t.__k[r]=null;if(d)for(r=0;r<h;r++)null!=(a=n[r])&&0==(2&a.__u)&&(a.__e==o&&(o=v(a)),D(a,a));return o}(n,e,S,l,A),d=0;d<A;d++)null!=(_=n.__k[d])&&(p=-1==_.__i?u:S[_.__i]||u,_.__i=d,x=T(t,_,p,i,r,s,a,l,c,h),m=_.__e,_.ref&&p.ref!=_.ref&&(p.ref&&B(p.ref,null,_),h.push(_.ref,_.__c||m,_)),null==w&&null!=m&&(w=m),(C=!!(4&_.__u))||p.__k===_.__k?l=k(_,l,t,C):"function"==typeof _.type&&void 0!==x?l=x:m&&(l=m.nextSibling),_.__u&=-7);return n.__e=w,l}function k(t,e,n,o){var i,r;if("function"==typeof t.type){for(i=t.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=t,e=k(i[r],e,n,o));return e}t.__e!=e&&(o&&(e&&t.type&&!e.parentNode&&(e=v(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function M(t,e,n,o){var i,r,s,a=t.key,l=t.type,c=e[n],h=null!=c&&0==(2&c.__u);if(null===c&&null==a||h&&a==c.key&&l==c.type)return n;if(o>(h?1:0))for(i=n-1,
|
|
4
4
|
r=n+1;i>=0||r<e.length;)if(null!=(c=e[s=i>=0?i--:r++])&&0==(2&c.__u)&&a==c.key&&l==c.type)return s;return-1}function R(t,e,n){"-"==e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||p.test(e)?n:n+"px"}function E(t,e,n,o,i){var r,s;t:if("style"==e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||R(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||R(t.style,e,n[e])}else if("o"==e[0]&&"n"==e[1])r=e!=(e=e.replace(a,"$1")),s=e.toLowerCase(),e=s in t||"onFocusOut"==e||"onFocusIn"==e?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?o?n.u=o.u:(n.u=l,t.addEventListener(e,r?h:c,r)):t.removeEventListener(e,r?h:c,r);else{if("http://www.w3.org/2000/svg"==i)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&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}
|
|
5
|
-
"function"==typeof n||(null==n||!1===n&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==n?"":n))}}function P(t){return function(n){if(this.l){var o=this.l[n.type+t];if(null==n.t)n.t=l++;else if(n.t<o.u)return;return o(e.event?e.event(n):n)}}}function T(t,n,o,i,r,s,a,l,c,h){var d,u,f,p,b,v,x,C,S,k,M,R,E,P,T,L,B,D=n.type;if(
|
|
5
|
+
"function"==typeof n||(null==n||!1===n&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==n?"":n))}}function P(t){return function(n){if(this.l){var o=this.l[n.type+t];if(null==n.t)n.t=l++;else if(n.t<o.u)return;return o(e.event?e.event(n):n)}}}function T(t,n,o,i,r,s,a,l,c,h){var d,u,f,p,b,v,x,C,S,k,M,R,E,P,T,L,B,D=n.type;if(void 0!==n.constructor)return null;128&o.__u&&(c=!!(32&o.__u),s=[l=n.__e=o.__e]),(d=e.__b)&&d(n);t:if("function"==typeof D)try{if(C=n.props,S="prototype"in D&&D.prototype.render,k=(d=D.contextType)&&i[d.__c],M=d?k?k.props.value:d.__:i,o.__c?x=(u=n.__c=o.__c).__=u.__E:(S?n.__c=u=new D(C,M):(n.__c=u=new w(C,M),u.constructor=D,u.render=F),k&&k.sub(u),u.state||(u.state={}),u.__n=i,f=u.__d=!0,u.__h=[],u._sb=[]),S&&null==u.__s&&(u.__s=u.state),S&&null!=D.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=_({},u.__s)),_(u.__s,D.getDerivedStateFromProps(C,u.__s))),p=u.props,b=u.state,u.__v=n,f)S&&null==D.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),
|
|
6
6
|
S&&null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(S&&null==D.getDerivedStateFromProps&&C!==p&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(C,M),n.__v==o.__v||!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(C,u.__s,M)){for(n.__v!=o.__v&&(u.props=C,u.state=u.__s,u.__d=!1),n.__e=o.__e,n.__k=o.__k,n.__k.some((function(t){t&&(t.__=n)})),R=0;R<u._sb.length;R++)u.__h.push(u._sb[R]);u._sb=[],u.__h.length&&a.push(u);break t}null!=u.componentWillUpdate&&u.componentWillUpdate(C,u.__s,M),S&&null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(p,b,v)}))}if(u.context=M,u.props=C,u.__P=t,u.__e=!1,E=e.__r,P=0,S){for(u.state=u.__s,u.__d=!1,E&&E(n),d=u.render(u.props,u.state,u.context),T=0;T<u._sb.length;T++)u.__h.push(u._sb[T]);u._sb=[]}else do{u.__d=!1,E&&E(n),d=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++P<25);u.state=u.__s,null!=u.getChildContext&&(i=_(_({},i),u.getChildContext())),
|
|
7
7
|
S&&!f&&null!=u.getSnapshotBeforeUpdate&&(v=u.getSnapshotBeforeUpdate(p,b)),L=d,null!=d&&d.type===y&&null==d.key&&(L=O(d.props.children)),l=A(t,g(L)?L:[L],n,o,i,r,s,a,l,c,h),u.base=n.__e,n.__u&=-161,u.__h.length&&a.push(u),x&&(u.__E=u.__=null)}catch(t){if(n.__v=null,c||null!=s)if(t.then){for(n.__u|=c?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;s[s.indexOf(l)]=null,n.__e=l}else{for(B=s.length;B--;)m(s[B]);N(n)}else n.__e=o.__e,n.__k=o.__k,t.then||N(n);e.__e(t,n,o)}else null==s&&n.__v==o.__v?(n.__k=o.__k,n.__e=o.__e):l=n.__e=I(o.__e,n,o,i,r,s,a,c,h);return(d=e.diffed)&&d(n),128&n.__u?void 0:l}function N(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(N)}function L(t,n,o){for(var i=0;i<o.length;i++)B(o[i],o[++i],o[++i]);e.__c&&e.__c(n,t),t.some((function(n){try{t=n.__h,n.__h=[],t.some((function(t){t.call(n)}))}catch(t){e.__e(t,n.__v)}}))}function O(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:g(t)?t.map(O):_({},t)}function I(n,o,i,r,s,a,l,c,h){
|
|
8
8
|
var d,f,p,_,b,y,w,x=i.props||u,C=o.props,S=o.type;if("svg"==S?s="http://www.w3.org/2000/svg":"math"==S?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=a)for(d=0;d<a.length;d++)if((b=a[d])&&"setAttribute"in b==!!S&&(S?b.localName==S:3==b.nodeType)){n=b,a[d]=null;break}if(null==n){if(null==S)return document.createTextNode(C);n=document.createElementNS(s,S,C.is&&C),c&&(e.__m&&e.__m(o,a),c=!1),a=null}if(null==S)x===C||c&&n.data==C||(n.data=C);else{if(a=a&&t.call(n.childNodes),!c&&null!=a)for(x={},d=0;d<n.attributes.length;d++)x[(b=n.attributes[d]).name]=b.value;for(d in x)if(b=x[d],"children"==d);else if("dangerouslySetInnerHTML"==d)p=b;else if(!(d in C)){if("value"==d&&"defaultValue"in C||"checked"==d&&"defaultChecked"in C)continue;E(n,d,null,b,s)}for(d in C)b=C[d],"children"==d?_=b:"dangerouslySetInnerHTML"==d?f=b:"value"==d?y=b:"checked"==d?w=b:c&&"function"!=typeof b||x[d]===b||E(n,d,b,x[d],s);if(f)c||p&&(f.__html==p.__html||f.__html==n.innerHTML)||(n.innerHTML=f.__html),
|
|
@@ -167,7 +167,7 @@ if(!this._integration.renderToBitmap)throw new Error("Thumbnail rendering not su
|
|
|
167
167
|
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.region)),this._updateAnchors(this.anchors.concat(n),!0),this._sidebarRPC.call("syncAnchoringStatus",t),n}detach(t,e=!0){this._annotations.delete(t);const n=[];for(const e of this.anchors)e.annotation.$tag!==t?n.push(e):e.highlights&&this._highlighter.removeHighlights(e.highlights);this._updateAnchors(n,e)}_updateAnchors(t,e){this.anchors=t,this._clusterToolbar?.scheduleClusterUpdates(),e&&this._bucketBarClient.update(this.anchors)}async createAnnotation(t){if("selection"===t)return this.createAnnotationFromSelection();if(!["rect","point"].includes(t))throw new Error("Unsupported annotation tool");{let e=!1;try{this._hostRPC.call("activeToolChanged",t);const e=this._pendingKeyboardMode;this._pendingKeyboardMode=void 0;const n=await this._drawTool.draw(t,e),o=await this.getDocumentInfo(),i=[{source:o.uri,selector:await this._integration.describe(this.element,n)}],r={
|
|
168
168
|
uri:o.uri,document:o.metadata,target:i,$tag:"a:"+Ce(8)};return this._sidebarRPC.call("createAnnotation",r),this.anchor(r),r}catch(t){if(t instanceof vo&&["canceled","restarted"].includes(t.kind))return e="restarted"===t.kind,null;throw t}finally{e||this._hostRPC.call("activeToolChanged",null)}}}_activateToolWithMoveMode(t){this._drawTool.getKeyboardModeState().keyboardActive?this._drawTool.setKeyboardMode("move"):(this._pendingKeyboardMode="move",this.createAnnotation(t).catch((()=>{this._pendingKeyboardMode=void 0})))}async createAnnotationFromSelection({highlight:t=!1}={}){const e=this.selectedRanges;this.selectedRanges=[];const n=await this.getDocumentInfo(),o=this.element,i=(await Promise.all(e.map((t=>this._integration.describe(o,t))))).map((t=>({source:n.uri,selector:t}))),r={uri:n.uri,document:n.metadata,target:i,$highlight:t,$cluster:t?"user-highlights":"user-annotations",$tag:"a:"+Ce(8)};return this._sidebarRPC.call("createAnnotation",r),this.anchor(r),Cr(),r}_hoverAnnotations(t){
|
|
169
169
|
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);this._highlighter.setHighlightsFocused(e.highlights,n)}this._sidebarRPC.call("hoverAnnotations",t)}_onSelection(t){const e=this._integration.getAnnotatableRange(t);if(!e)return void this._onClearSelection();const n=document.getSelection(),o=Kn(n),i=Gn(n);i?(this.selectedRanges=[e],this._hostRPC.call("textSelected"),this._commentsMode||(this._adder.annotationsForSelection=wr(),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}selectAnnotations(t,{toggle:e=!1,focusInSidebar:n=!1}={}){e?this._sidebarRPC.call("toggleAnnotationSelection",t):this._sidebarRPC.call("showAnnotations",t,n),this._sidebarRPC.call("openSidebar")}
|
|
170
|
-
setHighlightsVisible(t,e=!0){this._highlighter.setHighlightsVisible(t),this._highlightsVisible=t,e&&this._hostRPC.call("highlightsVisibleChanged",t)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(t){this._sidebarLayout=t,this._integration.fitSideBySide(t)}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){const e=yn().toggleHighlights;e&&un(t,e)&&this.setHighlightsVisible(!this._highlightsVisible&&!this._commentsMode)}_setOutsideAssignmentNoticeVisible(t){this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new mr(this.element)),this._outsideAssignmentNotice.setVisible(t)}}function kr(t,e){const n=new URL(t),o=new URLSearchParams;return o.append("config",JSON.stringify(e)),n.hash=o.toString(),n.toString()}function Mr(t,e){const n={};for(const[t,o]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=o&&(n[t]=o);n.origin=new URL(t).origin,n.version="1.
|
|
170
|
+
setHighlightsVisible(t,e=!0){this._highlighter.setHighlightsVisible(t),this._highlightsVisible=t,e&&this._hostRPC.call("highlightsVisibleChanged",t)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(t){this._sidebarLayout=t,this._integration.fitSideBySide(t)}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){const e=yn().toggleHighlights;e&&un(t,e)&&this.setHighlightsVisible(!this._highlightsVisible&&!this._commentsMode)}_setOutsideAssignmentNoticeVisible(t){this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new mr(this.element)),this._outsideAssignmentNotice.setVisible(t)}}function kr(t,e){const n=new URL(t),o=new URLSearchParams;return o.append("config",JSON.stringify(e)),n.hash=o.toString(),n.toString()}function Mr(t,e){const n={};for(const[t,o]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=o&&(n[t]=o);n.origin=new URL(t).origin,n.version="1.1765.0";const o=new URL(window.location.href);if(o.hash="",n.hostURL=o.toString(),
|
|
171
171
|
Array.isArray(n.services)&&n.services?.length>0){const t=n.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 n}function Rr({closed:t,onClose:e,children:n,className:o,"data-testid":i,"aria-label":r}){const s=it(null);return nt((()=>{t?s.current?.close():s.current?.showModal()}),[t]),nt((()=>{const t=s.current;return t?.addEventListener("cancel",e),()=>{t?.removeEventListener("cancel",e)}}),[e]),St("dialog",{ref:s,className:Tt("relative m-5 w-full h-full backdrop:bg-black/50",o),"data-testid":i,"aria-label":r,children:n})}function Er({closed:t,children:e,className:n,...o}){return St("div",{...o,className:Tt("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:t}),children:St("div",{className:Tt("relative w-full h-full",n),children:e})})}function Pr({document_:t=document,...e}){
|
|
172
172
|
return St(rt((()=>function(t){return"function"==typeof t.createElement("dialog").showModal}(t)?Rr:Er),[t]),{...e})}function Tr({config:t,groupId:e}){return St("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allow:"fullscreen; clipboard-write",src:kr(t.notebookAppUrl,{...Mr(t.notebookAppUrl,t),group:e})})}function Nr({eventBus:t,config:e}){const[n,o]=et(0),[i,r]=et(!0),[s,a]=et(null),l=it(""),c=it(null);nt((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),nt((()=>{document.body.style.overflow=i?l.current:"hidden"}),[i]),nt((()=>{const e=t.createEmitter();return e.subscribe("openNotebook",(t=>{r(!1),o((t=>t+1)),a(t)})),c.current=e,()=>{e.destroy()}}),[t]);const h=st((()=>{r(!0),c.current?.publish("closeNotebook")}),[]);return null===s?null:St(Pr,{closed:i,onClose:h,"data-testid":"notebook-outer","aria-label":"Hypothesis notebook",children:[St("div",{className:"absolute right-0 m-3",children:St(oe,{title:"Close notebook",onClick:h,
|
|
173
173
|
variant:"dark",classes:Tt("!bg-transparent enabled:hover:!bg-grey-3"),"data-testid":"close-button",children:St(It,{className:"w-4 h-4"})})}),St(Tr,{config:e,groupId:s},n)]})}class Lr{constructor(t,e,n){this._container=new Pn("notebook",(()=>St(Nr,{eventBus:e,config:n}))),t.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}function Or({eventBus:t,config:e}){const[n,o]=et(!0),i=it(null);nt((()=>{const e=t.createEmitter();return e.subscribe("openProfile",(()=>{o(!1)})),i.current=e,()=>{e.destroy()}}),[t]);const r=()=>{o(!0),i.current?.publish("closeProfile")};return n?null:St(Pr,{closed:n,onClose:r,"data-testid":"profile-outer","aria-label":"Hypothesis profile",children:[St("div",{className:"absolute right-0 m-3",children:St(oe,{title:"Close profile dialog",onClick:r,variant:"dark",classes:Tt("!bg-transparent enabled:hover:!bg-grey-3"),children:St(It,{className:"w-4 h-4"})})}),St("iframe",{title:"Hypothesis profile",className:"h-full w-full border-0",
|