@harvard-lts/mirador-annotations-auth-plugin 0.0.1 → 0.0.3
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/es/index.js +371 -379
- package/package.json +3 -3
package/dist/es/index.js
CHANGED
|
@@ -14,6 +14,9 @@ import { withStyles } from '@material-ui/core/styles';
|
|
|
14
14
|
import { withTranslation } from 'react-i18next';
|
|
15
15
|
import { getVisibleCanvasIds, getCanvases, getCanvasLabel } from 'mirador/dist/es/src/state/selectors';
|
|
16
16
|
|
|
17
|
+
function _OverloadYield(e, d) {
|
|
18
|
+
this.v = e, this.k = d;
|
|
19
|
+
}
|
|
17
20
|
function _assertThisInitialized(e) {
|
|
18
21
|
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
19
22
|
return e;
|
|
@@ -98,306 +101,178 @@ function _possibleConstructorReturn(t, e) {
|
|
|
98
101
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
99
102
|
return _assertThisInitialized(t);
|
|
100
103
|
}
|
|
101
|
-
function
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
104
|
+
function _regenerator() {
|
|
105
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
106
|
+
var e,
|
|
107
|
+
t,
|
|
108
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
109
|
+
n = r.iterator || "@@iterator",
|
|
110
|
+
o = r.toStringTag || "@@toStringTag";
|
|
111
|
+
function i(r, n, o, i) {
|
|
112
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
113
|
+
u = Object.create(c.prototype);
|
|
114
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
115
|
+
var i,
|
|
116
|
+
c,
|
|
117
|
+
u,
|
|
118
|
+
f = 0,
|
|
119
|
+
p = o || [],
|
|
120
|
+
y = !1,
|
|
121
|
+
G = {
|
|
122
|
+
p: 0,
|
|
123
|
+
n: 0,
|
|
124
|
+
v: e,
|
|
125
|
+
a: d,
|
|
126
|
+
f: d.bind(e, 4),
|
|
127
|
+
d: function (t, r) {
|
|
128
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
function d(r, n) {
|
|
132
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
133
|
+
var o,
|
|
134
|
+
i = p[t],
|
|
135
|
+
d = G.p,
|
|
136
|
+
l = i[2];
|
|
137
|
+
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
138
|
+
}
|
|
139
|
+
if (o || r > 1) return a;
|
|
140
|
+
throw y = !0, n;
|
|
141
|
+
}
|
|
142
|
+
return function (o, p, l) {
|
|
143
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
144
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
145
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
146
|
+
try {
|
|
147
|
+
if (f = 2, i) {
|
|
148
|
+
if (c || (o = "next"), t = i[o]) {
|
|
149
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
150
|
+
if (!t.done) return t;
|
|
151
|
+
u = t.value, c < 2 && (c = 0);
|
|
152
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
153
|
+
i = e;
|
|
154
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
155
|
+
} catch (t) {
|
|
156
|
+
i = e, c = 1, u = t;
|
|
157
|
+
} finally {
|
|
158
|
+
f = 1;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
value: t,
|
|
163
|
+
done: y
|
|
164
|
+
};
|
|
149
165
|
};
|
|
150
|
-
}
|
|
166
|
+
}(r, o, i), !0), u;
|
|
151
167
|
}
|
|
152
|
-
|
|
153
|
-
var h = "suspendedStart",
|
|
154
|
-
l = "suspendedYield",
|
|
155
|
-
f = "executing",
|
|
156
|
-
s = "completed",
|
|
157
|
-
y = {};
|
|
168
|
+
var a = {};
|
|
158
169
|
function Generator() {}
|
|
159
170
|
function GeneratorFunction() {}
|
|
160
171
|
function GeneratorFunctionPrototype() {}
|
|
161
|
-
|
|
162
|
-
|
|
172
|
+
t = Object.getPrototypeOf;
|
|
173
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
174
|
+
return this;
|
|
175
|
+
}), t),
|
|
176
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
177
|
+
function f(e) {
|
|
178
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
179
|
+
}
|
|
180
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
163
181
|
return this;
|
|
182
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
183
|
+
return "[object Generator]";
|
|
184
|
+
}), (_regenerator = function () {
|
|
185
|
+
return {
|
|
186
|
+
w: i,
|
|
187
|
+
m: f
|
|
188
|
+
};
|
|
189
|
+
})();
|
|
190
|
+
}
|
|
191
|
+
function _regeneratorAsync(n, e, r, t, o) {
|
|
192
|
+
var a = _regeneratorAsyncGen(n, e, r, t, o);
|
|
193
|
+
return a.next().then(function (n) {
|
|
194
|
+
return n.done ? n.value : a.next();
|
|
164
195
|
});
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
196
|
+
}
|
|
197
|
+
function _regeneratorAsyncGen(r, e, t, o, n) {
|
|
198
|
+
return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise);
|
|
199
|
+
}
|
|
200
|
+
function _regeneratorAsyncIterator(t, e) {
|
|
201
|
+
function n(r, o, i, f) {
|
|
202
|
+
try {
|
|
203
|
+
var c = t[r](o),
|
|
204
|
+
u = c.value;
|
|
205
|
+
return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) {
|
|
206
|
+
n("next", t, i, f);
|
|
207
|
+
}, function (t) {
|
|
208
|
+
n("throw", t, i, f);
|
|
209
|
+
}) : e.resolve(u).then(function (t) {
|
|
210
|
+
c.value = t, i(c);
|
|
211
|
+
}, function (t) {
|
|
212
|
+
return n("throw", t, i, f);
|
|
173
213
|
});
|
|
174
|
-
})
|
|
214
|
+
} catch (t) {
|
|
215
|
+
f(t);
|
|
216
|
+
}
|
|
175
217
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}, function (t) {
|
|
185
|
-
invoke("throw", t, i, a);
|
|
186
|
-
}) : e.resolve(h).then(function (t) {
|
|
187
|
-
u.value = t, i(u);
|
|
188
|
-
}, function (t) {
|
|
189
|
-
return invoke("throw", t, i, a);
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
a(c.arg);
|
|
218
|
+
var r;
|
|
219
|
+
this.next || (_regeneratorDefine(_regeneratorAsyncIterator.prototype), _regeneratorDefine(_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
|
|
220
|
+
return this;
|
|
221
|
+
})), _regeneratorDefine(this, "_invoke", function (t, o, i) {
|
|
222
|
+
function f() {
|
|
223
|
+
return new e(function (e, r) {
|
|
224
|
+
n(t, i, e, r);
|
|
225
|
+
});
|
|
193
226
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
204
|
-
});
|
|
227
|
+
return r = r ? r.then(f, f) : f();
|
|
228
|
+
}, !0);
|
|
229
|
+
}
|
|
230
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
231
|
+
var i = Object.defineProperty;
|
|
232
|
+
try {
|
|
233
|
+
i({}, "", {});
|
|
234
|
+
} catch (e) {
|
|
235
|
+
i = 0;
|
|
205
236
|
}
|
|
206
|
-
function
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
237
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
238
|
+
function o(r, n) {
|
|
239
|
+
_regeneratorDefine(e, r, function (e) {
|
|
240
|
+
return this._invoke(r, n, e);
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
r ? i ? i(e, r, {
|
|
244
|
+
value: n,
|
|
245
|
+
enumerable: !t,
|
|
246
|
+
configurable: !t,
|
|
247
|
+
writable: !t
|
|
248
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
249
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
250
|
+
}
|
|
251
|
+
function _regeneratorKeys(e) {
|
|
252
|
+
var n = Object(e),
|
|
253
|
+
r = [];
|
|
254
|
+
for (var t in n) r.unshift(t);
|
|
255
|
+
return function e() {
|
|
256
|
+
for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
|
|
257
|
+
return e.done = !0, e;
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
function _regeneratorValues(e) {
|
|
261
|
+
if (null != e) {
|
|
262
|
+
var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
|
|
263
|
+
r = 0;
|
|
264
|
+
if (t) return t.call(e);
|
|
265
|
+
if ("function" == typeof e.next) return e;
|
|
266
|
+
if (!isNaN(e.length)) return {
|
|
267
|
+
next: function () {
|
|
268
|
+
return e && r >= e.length && (e = void 0), {
|
|
269
|
+
value: e && e[r++],
|
|
270
|
+
done: !e
|
|
215
271
|
};
|
|
216
272
|
}
|
|
217
|
-
for (n.method = i, n.arg = a;;) {
|
|
218
|
-
var c = n.delegate;
|
|
219
|
-
if (c) {
|
|
220
|
-
var u = maybeInvokeDelegate(c, n);
|
|
221
|
-
if (u) {
|
|
222
|
-
if (u === y) continue;
|
|
223
|
-
return u;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
227
|
-
if (o === h) throw o = s, n.arg;
|
|
228
|
-
n.dispatchException(n.arg);
|
|
229
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
230
|
-
o = f;
|
|
231
|
-
var p = tryCatch(e, r, n);
|
|
232
|
-
if ("normal" === p.type) {
|
|
233
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
234
|
-
return {
|
|
235
|
-
value: p.arg,
|
|
236
|
-
done: n.done
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
240
|
-
}
|
|
241
273
|
};
|
|
242
274
|
}
|
|
243
|
-
|
|
244
|
-
var n = r.method,
|
|
245
|
-
o = e.iterator[n];
|
|
246
|
-
if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
247
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
248
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
249
|
-
var a = i.arg;
|
|
250
|
-
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
251
|
-
}
|
|
252
|
-
function pushTryEntry(t) {
|
|
253
|
-
var e = {
|
|
254
|
-
tryLoc: t[0]
|
|
255
|
-
};
|
|
256
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
257
|
-
}
|
|
258
|
-
function resetTryEntry(t) {
|
|
259
|
-
var e = t.completion || {};
|
|
260
|
-
e.type = "normal", delete e.arg, t.completion = e;
|
|
261
|
-
}
|
|
262
|
-
function Context(t) {
|
|
263
|
-
this.tryEntries = [{
|
|
264
|
-
tryLoc: "root"
|
|
265
|
-
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
266
|
-
}
|
|
267
|
-
function values(e) {
|
|
268
|
-
if (e || "" === e) {
|
|
269
|
-
var r = e[a];
|
|
270
|
-
if (r) return r.call(e);
|
|
271
|
-
if ("function" == typeof e.next) return e;
|
|
272
|
-
if (!isNaN(e.length)) {
|
|
273
|
-
var o = -1,
|
|
274
|
-
i = function next() {
|
|
275
|
-
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
276
|
-
return next.value = t, next.done = !0, next;
|
|
277
|
-
};
|
|
278
|
-
return i.next = i;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
throw new TypeError(typeof e + " is not iterable");
|
|
282
|
-
}
|
|
283
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
284
|
-
value: GeneratorFunctionPrototype,
|
|
285
|
-
configurable: !0
|
|
286
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
287
|
-
value: GeneratorFunction,
|
|
288
|
-
configurable: !0
|
|
289
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
290
|
-
var e = "function" == typeof t && t.constructor;
|
|
291
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
292
|
-
}, e.mark = function (t) {
|
|
293
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
294
|
-
}, e.awrap = function (t) {
|
|
295
|
-
return {
|
|
296
|
-
__await: t
|
|
297
|
-
};
|
|
298
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
299
|
-
return this;
|
|
300
|
-
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
301
|
-
void 0 === i && (i = Promise);
|
|
302
|
-
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
303
|
-
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
304
|
-
return t.done ? t.value : a.next();
|
|
305
|
-
});
|
|
306
|
-
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
307
|
-
return this;
|
|
308
|
-
}), define(g, "toString", function () {
|
|
309
|
-
return "[object Generator]";
|
|
310
|
-
}), e.keys = function (t) {
|
|
311
|
-
var e = Object(t),
|
|
312
|
-
r = [];
|
|
313
|
-
for (var n in e) r.push(n);
|
|
314
|
-
return r.reverse(), function next() {
|
|
315
|
-
for (; r.length;) {
|
|
316
|
-
var t = r.pop();
|
|
317
|
-
if (t in e) return next.value = t, next.done = !1, next;
|
|
318
|
-
}
|
|
319
|
-
return next.done = !0, next;
|
|
320
|
-
};
|
|
321
|
-
}, e.values = values, Context.prototype = {
|
|
322
|
-
constructor: Context,
|
|
323
|
-
reset: function (e) {
|
|
324
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
325
|
-
},
|
|
326
|
-
stop: function () {
|
|
327
|
-
this.done = !0;
|
|
328
|
-
var t = this.tryEntries[0].completion;
|
|
329
|
-
if ("throw" === t.type) throw t.arg;
|
|
330
|
-
return this.rval;
|
|
331
|
-
},
|
|
332
|
-
dispatchException: function (e) {
|
|
333
|
-
if (this.done) throw e;
|
|
334
|
-
var r = this;
|
|
335
|
-
function handle(n, o) {
|
|
336
|
-
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
337
|
-
}
|
|
338
|
-
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
339
|
-
var i = this.tryEntries[o],
|
|
340
|
-
a = i.completion;
|
|
341
|
-
if ("root" === i.tryLoc) return handle("end");
|
|
342
|
-
if (i.tryLoc <= this.prev) {
|
|
343
|
-
var c = n.call(i, "catchLoc"),
|
|
344
|
-
u = n.call(i, "finallyLoc");
|
|
345
|
-
if (c && u) {
|
|
346
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
347
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
348
|
-
} else if (c) {
|
|
349
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
350
|
-
} else {
|
|
351
|
-
if (!u) throw Error("try statement without catch or finally");
|
|
352
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
},
|
|
357
|
-
abrupt: function (t, e) {
|
|
358
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
359
|
-
var o = this.tryEntries[r];
|
|
360
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
361
|
-
var i = o;
|
|
362
|
-
break;
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
366
|
-
var a = i ? i.completion : {};
|
|
367
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
368
|
-
},
|
|
369
|
-
complete: function (t, e) {
|
|
370
|
-
if ("throw" === t.type) throw t.arg;
|
|
371
|
-
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
372
|
-
},
|
|
373
|
-
finish: function (t) {
|
|
374
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
375
|
-
var r = this.tryEntries[e];
|
|
376
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
377
|
-
}
|
|
378
|
-
},
|
|
379
|
-
catch: function (t) {
|
|
380
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
381
|
-
var r = this.tryEntries[e];
|
|
382
|
-
if (r.tryLoc === t) {
|
|
383
|
-
var n = r.completion;
|
|
384
|
-
if ("throw" === n.type) {
|
|
385
|
-
var o = n.arg;
|
|
386
|
-
resetTryEntry(r);
|
|
387
|
-
}
|
|
388
|
-
return o;
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
throw Error("illegal catch attempt");
|
|
392
|
-
},
|
|
393
|
-
delegateYield: function (e, r, n) {
|
|
394
|
-
return this.delegate = {
|
|
395
|
-
iterator: values(e),
|
|
396
|
-
resultName: r,
|
|
397
|
-
nextLoc: n
|
|
398
|
-
}, "next" === this.method && (this.arg = t), y;
|
|
399
|
-
}
|
|
400
|
-
}, e;
|
|
275
|
+
throw new TypeError(typeof e + " is not iterable");
|
|
401
276
|
}
|
|
402
277
|
function _setPrototypeOf(t, e) {
|
|
403
278
|
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
@@ -418,6 +293,74 @@ function _toPropertyKey(t) {
|
|
|
418
293
|
var i = _toPrimitive(t, "string");
|
|
419
294
|
return "symbol" == typeof i ? i : i + "";
|
|
420
295
|
}
|
|
296
|
+
function _regeneratorRuntime() {
|
|
297
|
+
|
|
298
|
+
var r = _regenerator(),
|
|
299
|
+
e = r.m(_regeneratorRuntime),
|
|
300
|
+
t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
|
|
301
|
+
function n(r) {
|
|
302
|
+
var e = "function" == typeof r && r.constructor;
|
|
303
|
+
return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
|
|
304
|
+
}
|
|
305
|
+
var o = {
|
|
306
|
+
throw: 1,
|
|
307
|
+
return: 2,
|
|
308
|
+
break: 3,
|
|
309
|
+
continue: 3
|
|
310
|
+
};
|
|
311
|
+
function a(r) {
|
|
312
|
+
var e, t;
|
|
313
|
+
return function (n) {
|
|
314
|
+
e || (e = {
|
|
315
|
+
stop: function () {
|
|
316
|
+
return t(n.a, 2);
|
|
317
|
+
},
|
|
318
|
+
catch: function () {
|
|
319
|
+
return n.v;
|
|
320
|
+
},
|
|
321
|
+
abrupt: function (r, e) {
|
|
322
|
+
return t(n.a, o[r], e);
|
|
323
|
+
},
|
|
324
|
+
delegateYield: function (r, o, a) {
|
|
325
|
+
return e.resultName = o, t(n.d, _regeneratorValues(r), a);
|
|
326
|
+
},
|
|
327
|
+
finish: function (r) {
|
|
328
|
+
return t(n.f, r);
|
|
329
|
+
}
|
|
330
|
+
}, t = function (r, t, o) {
|
|
331
|
+
n.p = e.prev, n.n = e.next;
|
|
332
|
+
try {
|
|
333
|
+
return r(t, o);
|
|
334
|
+
} finally {
|
|
335
|
+
e.next = n.n;
|
|
336
|
+
}
|
|
337
|
+
}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
|
|
338
|
+
try {
|
|
339
|
+
return r.call(this, e);
|
|
340
|
+
} finally {
|
|
341
|
+
n.p = e.prev, n.n = e.next;
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
return (_regeneratorRuntime = function () {
|
|
346
|
+
return {
|
|
347
|
+
wrap: function (e, t, n, o) {
|
|
348
|
+
return r.w(a(e), t, n, o && o.reverse());
|
|
349
|
+
},
|
|
350
|
+
isGeneratorFunction: n,
|
|
351
|
+
mark: r.m,
|
|
352
|
+
awrap: function (r, e) {
|
|
353
|
+
return new _OverloadYield(r, e);
|
|
354
|
+
},
|
|
355
|
+
AsyncIterator: _regeneratorAsyncIterator,
|
|
356
|
+
async: function (r, e, t, o, u) {
|
|
357
|
+
return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u);
|
|
358
|
+
},
|
|
359
|
+
keys: _regeneratorKeys,
|
|
360
|
+
values: _regeneratorValues
|
|
361
|
+
};
|
|
362
|
+
})();
|
|
363
|
+
}
|
|
421
364
|
|
|
422
365
|
var AnnotationsAuthSidePanel = /*#__PURE__*/function (_Component) {
|
|
423
366
|
function AnnotationsAuthSidePanel(props) {
|
|
@@ -430,10 +373,10 @@ var AnnotationsAuthSidePanel = /*#__PURE__*/function (_Component) {
|
|
|
430
373
|
_this.handleAnnotationBlur = _this.handleAnnotationBlur.bind(_this);
|
|
431
374
|
var _this$props = _this.props,
|
|
432
375
|
windowId = _this$props.windowId,
|
|
433
|
-
|
|
376
|
+
canvasAnnotationPages = _this$props.canvasAnnotationPages;
|
|
434
377
|
_this.state = {
|
|
435
378
|
windowId: windowId,
|
|
436
|
-
|
|
379
|
+
canvasAnnotationPages: canvasAnnotationPages
|
|
437
380
|
};
|
|
438
381
|
return _this;
|
|
439
382
|
}
|
|
@@ -479,38 +422,71 @@ var AnnotationsAuthSidePanel = /*#__PURE__*/function (_Component) {
|
|
|
479
422
|
}, {
|
|
480
423
|
key: "componentDidMount",
|
|
481
424
|
value: function () {
|
|
482
|
-
var _componentDidMount = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function
|
|
483
|
-
var
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
while (1) switch (_context.prev = _context.next) {
|
|
425
|
+
var _componentDidMount = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
426
|
+
var canvasAnnotationPages, promises, results;
|
|
427
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
428
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
487
429
|
case 0:
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
430
|
+
canvasAnnotationPages = this.state.canvasAnnotationPages;
|
|
431
|
+
promises = [];
|
|
432
|
+
canvasAnnotationPages.forEach(function (annotationPage, index) {
|
|
433
|
+
var promise = new Promise(/*#__PURE__*/function () {
|
|
434
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve, reject) {
|
|
435
|
+
var result;
|
|
436
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
437
|
+
while (1) switch (_context.prev = _context.next) {
|
|
438
|
+
case 0:
|
|
439
|
+
_context.prev = 0;
|
|
440
|
+
_context.next = 3;
|
|
441
|
+
return fetch(annotationPage, {
|
|
442
|
+
method: 'get',
|
|
443
|
+
credentials: 'include'
|
|
444
|
+
});
|
|
445
|
+
case 3:
|
|
446
|
+
result = _context.sent;
|
|
447
|
+
resolve(result.json());
|
|
448
|
+
_context.next = 10;
|
|
449
|
+
break;
|
|
450
|
+
case 7:
|
|
451
|
+
_context.prev = 7;
|
|
452
|
+
_context.t0 = _context["catch"](0);
|
|
453
|
+
reject('Network response was not ok');
|
|
454
|
+
case 10:
|
|
455
|
+
case "end":
|
|
456
|
+
return _context.stop();
|
|
457
|
+
}
|
|
458
|
+
}, _callee, null, [[0, 7]]);
|
|
459
|
+
}));
|
|
460
|
+
return function (_x, _x2) {
|
|
461
|
+
return _ref.apply(this, arguments);
|
|
462
|
+
};
|
|
463
|
+
}());
|
|
464
|
+
promises.push(promise);
|
|
508
465
|
});
|
|
509
|
-
|
|
466
|
+
_context2.prev = 3;
|
|
467
|
+
_context2.next = 6;
|
|
468
|
+
return Promise.all(promises);
|
|
469
|
+
case 6:
|
|
470
|
+
results = _context2.sent;
|
|
471
|
+
this.setState({
|
|
472
|
+
annotationData: results,
|
|
473
|
+
loading: false
|
|
474
|
+
});
|
|
475
|
+
_context2.next = 14;
|
|
476
|
+
break;
|
|
477
|
+
case 10:
|
|
478
|
+
_context2.prev = 10;
|
|
479
|
+
_context2.t0 = _context2["catch"](3);
|
|
480
|
+
console.error('There was a problem receiving the annotation:', _context2.t0);
|
|
481
|
+
this.setState({
|
|
482
|
+
loading: false,
|
|
483
|
+
error: _context2.t0.message
|
|
484
|
+
});
|
|
485
|
+
case 14:
|
|
510
486
|
case "end":
|
|
511
|
-
return
|
|
487
|
+
return _context2.stop();
|
|
512
488
|
}
|
|
513
|
-
},
|
|
489
|
+
}, _callee2, this, [[3, 10]]);
|
|
514
490
|
}));
|
|
515
491
|
function componentDidMount() {
|
|
516
492
|
return _componentDidMount.apply(this, arguments);
|
|
@@ -520,7 +496,7 @@ var AnnotationsAuthSidePanel = /*#__PURE__*/function (_Component) {
|
|
|
520
496
|
}, {
|
|
521
497
|
key: "render",
|
|
522
498
|
value: function render() {
|
|
523
|
-
var
|
|
499
|
+
var _this2 = this;
|
|
524
500
|
var _this$props5 = this.props,
|
|
525
501
|
classes = _this$props5.classes,
|
|
526
502
|
containerRef = _this$props5.containerRef,
|
|
@@ -545,67 +521,71 @@ var AnnotationsAuthSidePanel = /*#__PURE__*/function (_Component) {
|
|
|
545
521
|
}), error && /*#__PURE__*/jsxs("p", {
|
|
546
522
|
children: ["Error: ", error]
|
|
547
523
|
})]
|
|
548
|
-
}), /*#__PURE__*/jsx(
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
524
|
+
}), annotationData && /*#__PURE__*/jsx(Fragment, {
|
|
525
|
+
children: annotationData.map(function (annotation, i) {
|
|
526
|
+
return /*#__PURE__*/jsx(MenuList, {
|
|
527
|
+
autoFocusItem: true,
|
|
528
|
+
variant: "selectedMenu",
|
|
529
|
+
children: /*#__PURE__*/jsx(ScrollTo, {
|
|
530
|
+
containerRef: containerRef,
|
|
531
|
+
offsetTop: 96 // offset for the height of the form above
|
|
532
|
+
,
|
|
533
|
+
scrollTo: selectedAnnotationId === {
|
|
534
|
+
annotation: annotation
|
|
535
|
+
}.id,
|
|
536
|
+
children: /*#__PURE__*/jsx(MenuItem, {
|
|
537
|
+
button: true,
|
|
538
|
+
component: listContainerComponent,
|
|
539
|
+
className: clsx(classes.annotationListItem, _defineProperty({}, classes.hovered, hoveredAnnotationIds.includes({
|
|
540
|
+
annotation: annotation
|
|
541
|
+
}.id))),
|
|
542
|
+
annotationid: {
|
|
543
|
+
annotation: annotation
|
|
544
|
+
}.id,
|
|
545
|
+
selected: selectedAnnotationId === {
|
|
546
|
+
annotation: annotation
|
|
547
|
+
}.id,
|
|
548
|
+
onClick: function onClick(e) {
|
|
549
|
+
return _this2.handleClick(e, {
|
|
550
|
+
annotation: annotation
|
|
551
|
+
});
|
|
552
|
+
},
|
|
553
|
+
onFocus: function onFocus() {
|
|
554
|
+
return _this2.handleAnnotationHover({
|
|
555
|
+
annotation: annotation
|
|
556
|
+
});
|
|
557
|
+
},
|
|
558
|
+
onBlur: _this2.handleAnnotationBlur,
|
|
559
|
+
onMouseEnter: function onMouseEnter() {
|
|
560
|
+
return _this2.handleAnnotationHover({
|
|
561
|
+
annotation: annotation
|
|
562
|
+
});
|
|
563
|
+
},
|
|
564
|
+
onMouseLeave: _this2.handleAnnotationBlur,
|
|
565
|
+
children: /*#__PURE__*/jsx(ListItemText, {
|
|
566
|
+
primaryTypographyProps: {
|
|
567
|
+
variant: 'body2'
|
|
568
|
+
},
|
|
569
|
+
children: /*#__PURE__*/jsx(SanitizedHtml, {
|
|
570
|
+
ruleSet: htmlSanitizationRuleSet,
|
|
571
|
+
htmlString: annotation.resources[0].resource.chars
|
|
572
|
+
})
|
|
573
|
+
})
|
|
574
|
+
}, {
|
|
575
|
+
annotation: annotation
|
|
576
|
+
}.id)
|
|
577
|
+
}, "".concat({
|
|
578
|
+
annotation: annotation
|
|
579
|
+
}.id, "-scroll"))
|
|
580
|
+
});
|
|
581
|
+
})
|
|
602
582
|
})]
|
|
603
583
|
});
|
|
604
584
|
}
|
|
605
585
|
}]);
|
|
606
586
|
}(Component);
|
|
607
587
|
AnnotationsAuthSidePanel.propTypes = {
|
|
608
|
-
|
|
588
|
+
canvasAnnotationPages: PropTypes.arrayOf(PropTypes.string),
|
|
609
589
|
canvasLabel: PropTypes.string,
|
|
610
590
|
classes: PropTypes.objectOf(PropTypes.string),
|
|
611
591
|
htmlSanitizationRuleSet: PropTypes.string,
|
|
@@ -617,7 +597,7 @@ AnnotationsAuthSidePanel.propTypes = {
|
|
|
617
597
|
windowId: PropTypes.string.isRequired
|
|
618
598
|
};
|
|
619
599
|
AnnotationsAuthSidePanel.defaultProps = {
|
|
620
|
-
|
|
600
|
+
canvasAnnotationPages: [],
|
|
621
601
|
canvasLabel: null,
|
|
622
602
|
classes: {},
|
|
623
603
|
htmlSanitizationRuleSet: 'iiif',
|
|
@@ -648,29 +628,41 @@ var styles = function styles(theme) {
|
|
|
648
628
|
};
|
|
649
629
|
|
|
650
630
|
/** */
|
|
651
|
-
function
|
|
652
|
-
var
|
|
631
|
+
function getAnnotationPages(canvases, canvasIds) {
|
|
632
|
+
var annotationPagesArray = [];
|
|
633
|
+
var annotationPages = [];
|
|
653
634
|
for (var i = 0; i < canvases.length; i++) {
|
|
654
635
|
if (canvases[i].id === canvasIds[0]) {
|
|
655
636
|
if (canvases[i].__jsonld.otherContent !== undefined) {
|
|
656
637
|
// Version 2 Annotation Page
|
|
657
|
-
|
|
638
|
+
canvases[i].__jsonld.otherContent[0]["@id"];
|
|
639
|
+
annotationPagesArray = canvases[i].__jsonld.otherContent;
|
|
640
|
+
for (var j = 0; j < annotationPagesArray.length; j++) {
|
|
641
|
+
if (annotationPagesArray[j]["@type"] === "sc:AnnotationList") {
|
|
642
|
+
annotationPages[j] = annotationPagesArray[j]["@id"];
|
|
643
|
+
}
|
|
644
|
+
}
|
|
658
645
|
}
|
|
659
646
|
if (canvases[i].__jsonld.annotations !== undefined) {
|
|
660
647
|
// Version 3 Annotation Page
|
|
661
|
-
|
|
648
|
+
canvases[i].__jsonld.annotations[0].id;
|
|
649
|
+
annotationPagesArray = canvases[i].__jsonld.annotations;
|
|
650
|
+
for (var _j = 0; _j < annotationPagesArray.length; _j++) {
|
|
651
|
+
if (annotationPagesArray[_j].type === "AnnotationPage") {
|
|
652
|
+
annotationPages[_j] = annotationPagesArray[_j].id;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
662
655
|
}
|
|
663
656
|
break;
|
|
664
657
|
}
|
|
665
658
|
}
|
|
666
|
-
|
|
667
|
-
return annotationPage;
|
|
659
|
+
return annotationPages;
|
|
668
660
|
}
|
|
669
661
|
var mapStateToProps = function mapStateToProps(state, _ref) {
|
|
670
662
|
var canvasId = _ref.canvasId,
|
|
671
663
|
windowId = _ref.windowId;
|
|
672
664
|
return {
|
|
673
|
-
|
|
665
|
+
canvasAnnotationPages: getAnnotationPages(getCanvases(state, {
|
|
674
666
|
windowId: windowId
|
|
675
667
|
}), getVisibleCanvasIds(state, {
|
|
676
668
|
windowId: windowId
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-component"
|
|
7
7
|
],
|
|
8
|
-
"version": "0.0.
|
|
8
|
+
"version": "0.0.3",
|
|
9
9
|
"description": "A Mirador 3 plugin for including authentication cookies for annotations.",
|
|
10
10
|
"module": "dist/es/index.js",
|
|
11
11
|
"files": [
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@testing-library/react": "^12.0.0",
|
|
35
35
|
"babel-jest": "^29.7.0",
|
|
36
36
|
"babel-loader": "^9.1.2",
|
|
37
|
-
"jest": "^
|
|
38
|
-
"jest-environment-jsdom": "^
|
|
37
|
+
"jest": "^30.0.2",
|
|
38
|
+
"jest-environment-jsdom": "^30.0.2",
|
|
39
39
|
"mirador": "^3.4.3",
|
|
40
40
|
"npm-run-all": "^4.1.5",
|
|
41
41
|
"rollup": "^3.29.5",
|