instruckt 0.4.15 → 0.4.16
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/instruckt.iife.js +1 -1
- package/package.json +1 -1
package/dist/instruckt.iife.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* instruckt v0.4.
|
|
1
|
+
/* instruckt v0.4.15 | MIT */
|
|
2
2
|
"use strict";var Instruckt=(()=>{var I=Object.defineProperty,Ut=Object.defineProperties,jt=Object.getOwnPropertyDescriptor,_t=Object.getOwnPropertyDescriptors,Dt=Object.getOwnPropertyNames,ct=Object.getOwnPropertySymbols;var dt=Object.prototype.hasOwnProperty,Vt=Object.prototype.propertyIsEnumerable;var lt=(n,t,e)=>t in n?I(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,O=(n,t)=>{for(var e in t||(t={}))dt.call(t,e)&<(n,e,t[e]);if(ct)for(var e of ct(t))Vt.call(t,e)&<(n,e,t[e]);return n},q=(n,t)=>Ut(n,_t(t));var qt=(n,t)=>{for(var e in t)I(n,e,{get:t[e],enumerable:!0})},Wt=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Dt(t))!dt.call(n,i)&&i!==e&&I(n,i,{get:()=>t[i],enumerable:!(o=jt(t,i))||o.enumerable});return n};var Kt=n=>Wt(I({},"__esModule",{value:!0}),n);var Ke={};qt(Ke,{Instruckt:()=>B,init:()=>We});function Nt(){let n=document.cookie.match(/(?:^|;\s*)XSRF-TOKEN=([^;]+)/);return n?decodeURIComponent(n[1]):""}function W(){let n={"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"},t=Nt();return t&&(n["X-XSRF-TOKEN"]=t),n}function L(n){let t={};for(let[e,o]of Object.entries(n)){let i=e.replace(/_([a-z])/g,(r,s)=>s.toUpperCase());t[i]=Array.isArray(o)?o.map(r=>r&&typeof r=="object"&&!Array.isArray(r)?L(r):r):o&&typeof o=="object"&&!Array.isArray(o)?L(o):o}return t}function K(n){let t={};for(let[e,o]of Object.entries(n)){let i=e.replace(/[A-Z]/g,r=>`_${r.toLowerCase()}`);t[i]=o&&typeof o=="object"&&!Array.isArray(o)?K(o):o}return t}var H=class{constructor(t){this.endpoint=t}async getAnnotations(){let t=await fetch(`${this.endpoint}/annotations`,{headers:W()});if(!t.ok)throw new Error(`instruckt: failed to load annotations (${t.status})`);return(await t.json()).map(o=>L(o))}async addAnnotation(t){let e=await fetch(`${this.endpoint}/annotations`,{method:"POST",headers:W(),body:JSON.stringify(K(t))});if(!e.ok)throw new Error(`instruckt: failed to add annotation (${e.status})`);return L(await e.json())}async updateAnnotation(t,e){let o=await fetch(`${this.endpoint}/annotations/${t}`,{method:"PATCH",headers:W(),body:JSON.stringify(K(e))});if(!o.ok)throw new Error(`instruckt: failed to update annotation (${o.status})`);return L(await o.json())}};var Xt=`
|
|
3
3
|
body.ik-annotating,
|
|
4
4
|
body.ik-annotating * { cursor: crosshair !important; }
|