@harvard-lts/mirador-eda-plugin 0.1.3 → 0.1.4

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.
Files changed (2) hide show
  1. package/dist/es/index.js +24 -35
  2. package/package.json +1 -1
package/dist/es/index.js CHANGED
@@ -16,9 +16,6 @@ function _arrayLikeToArray(r, a) {
16
16
  function _arrayWithHoles(r) {
17
17
  if (Array.isArray(r)) return r;
18
18
  }
19
- function _arrayWithoutHoles(r) {
20
- if (Array.isArray(r)) return _arrayLikeToArray(r);
21
- }
22
19
  function _defineProperty(e, r, t) {
23
20
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
24
21
  value: t,
@@ -27,9 +24,6 @@ function _defineProperty(e, r, t) {
27
24
  writable: !0
28
25
  }) : e[r] = t, e;
29
26
  }
30
- function _iterableToArray(r) {
31
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
32
- }
33
27
  function _iterableToArrayLimit(r, l) {
34
28
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
35
29
  if (null != t) {
@@ -60,9 +54,6 @@ function _iterableToArrayLimit(r, l) {
60
54
  function _nonIterableRest() {
61
55
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
62
56
  }
63
- function _nonIterableSpread() {
64
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
65
- }
66
57
  function ownKeys(e, r) {
67
58
  var t = Object.keys(e);
68
59
  if (Object.getOwnPropertySymbols) {
@@ -107,9 +98,6 @@ function _objectWithoutPropertiesLoose(r, e) {
107
98
  function _slicedToArray(r, e) {
108
99
  return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
109
100
  }
110
- function _toConsumableArray(r) {
111
- return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
112
- }
113
101
  function _toPrimitive(t, r) {
114
102
  if ("object" != typeof t || !t) return t;
115
103
  var e = t[Symbol.toPrimitive];
@@ -287,17 +275,13 @@ var EdaTranscriptionPanel = function EdaTranscriptionPanel(_ref) {
287
275
  paperClassName: classes.paper,
288
276
  children: [(!transcriptions || transcriptions.length === 0) && /*#__PURE__*/jsx("div", {
289
277
  className: classes.root,
290
- children: /*#__PURE__*/jsxs("div", {
278
+ children: /*#__PURE__*/jsx("div", {
291
279
  className: classes.section,
292
- children: [/*#__PURE__*/jsx(Typography, {
280
+ children: /*#__PURE__*/jsx(Typography, {
293
281
  variant: "body1",
294
- className: classes.noTranscriptionsMessage1,
295
- children: "No Emily Dickinson Archive transcriptions are available for this manifest."
296
- }), /*#__PURE__*/jsx(Typography, {
297
- variant: "body2",
298
- className: classes.noTranscriptionsMessage2,
299
- children: "This feature is only available for items from the Emily Dickinson Archive."
300
- })]
282
+ className: classes.noTranscriptionsMessage,
283
+ children: "Emily Dickinson Archive transcriptions are not available for this manuscript."
284
+ })
301
285
  })
302
286
  }), /*#__PURE__*/jsxs("div", {
303
287
  className: classes.root,
@@ -353,9 +337,11 @@ var EdaTranscriptionPanel = function EdaTranscriptionPanel(_ref) {
353
337
  var styles = function styles(theme) {
354
338
  return {
355
339
  "@global": {
356
- ".react-draggable": {
340
+ ".react-draggable": _defineProperty(_defineProperty({}, theme.breakpoints.down("sm"), {
341
+ minWidth: "235px !important"
342
+ }), theme.breakpoints.up("sm"), {
357
343
  minWidth: "350px !important" // this must match the paper minWidth
358
- }
344
+ })
359
345
  },
360
346
  root: {
361
347
  height: "100%",
@@ -363,9 +349,11 @@ var styles = function styles(theme) {
363
349
  display: "flex",
364
350
  flexDirection: "column"
365
351
  },
366
- paper: {
352
+ paper: _defineProperty(_defineProperty({}, theme.breakpoints.down("sm"), {
353
+ minWidth: "235px"
354
+ }), theme.breakpoints.up("sm"), {
367
355
  minWidth: "350px" // this must match the companion window minWidth
368
- },
356
+ }),
369
357
  controls: {
370
358
  padding: theme.spacing(2),
371
359
  borderBottom: "1px solid ".concat(theme.palette.divider),
@@ -380,9 +368,11 @@ var styles = function styles(theme) {
380
368
  marginBottom: theme.spacing(0.5),
381
369
  fontSize: "0.875rem"
382
370
  },
383
- selectInput: {
371
+ selectInput: _defineProperty(_defineProperty({}, theme.breakpoints.down("sm"), {
372
+ width: 230
373
+ }), theme.breakpoints.up("sm"), {
384
374
  width: 300
385
- },
375
+ }),
386
376
  section: {
387
377
  flex: 1,
388
378
  fontSize: ".875em",
@@ -435,11 +425,8 @@ var styles = function styles(theme) {
435
425
  display: "block !important"
436
426
  }
437
427
  },
438
- noTranscriptionsMessage1: {
428
+ noTranscriptionsMessage: {
439
429
  padding: "16px"
440
- },
441
- noTranscriptionsMessage2: {
442
- padding: "0 16px 16px"
443
430
  }
444
431
  };
445
432
  };
@@ -469,9 +456,11 @@ var EdaSideBarButtonsWrapper = function EdaSideBarButtonsWrapper(_ref) {
469
456
  var TargetComponent = _ref.TargetComponent,
470
457
  targetProps = _objectWithoutProperties(_ref, _excluded);
471
458
  // shallowEqual prevents re-renders unless transcriptions actually change
472
- var transcriptions = useSelector(getEdaTranscription, shallowEqual);
459
+ var transcriptions = useSelector(function (state) {
460
+ return getEdaTranscription(state, targetProps.windowId);
461
+ }, shallowEqual);
473
462
  var hasTranscriptions = Boolean(transcriptions && transcriptions.length > 0);
474
- console.log("EDA transcriptions available:", hasTranscriptions);
463
+
475
464
  // sets the translation for the EDA Transcriptions button tooltip
476
465
  var customTranslation = function customTranslation(key, opts) {
477
466
  if (key === "openCompanionWindow" && opts && opts.context === "edaTranscription") {
@@ -483,8 +472,8 @@ var EdaSideBarButtonsWrapper = function EdaSideBarButtonsWrapper(_ref) {
483
472
  return originalTranslation(key, opts);
484
473
  };
485
474
 
486
- // if transcriptions exist, add EDA Transcriptions button and hide Annotations button
487
- var plugin = hasTranscriptions ? [].concat(_toConsumableArray(targetProps.PluginComponents || []), [EdaTranscriptionButton]) : targetProps.PluginComponents;
475
+ // if transcriptions exist, add EDA Transcriptions button
476
+ var plugin = hasTranscriptions ? [EdaTranscriptionButton] : targetProps.PluginComponents;
488
477
  return /*#__PURE__*/jsx(TargetComponent, _objectSpread2(_objectSpread2({}, targetProps), {}, {
489
478
  t: customTranslation,
490
479
  panels: _objectSpread2(_objectSpread2({}, targetProps.panels), {}, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harvard-lts/mirador-eda-plugin",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "A Mirador plugin for displaying Emily Dickinson Archive transcriptions with toggleable line breaks and editorial marks",
5
5
  "module": "dist/es/index.js",
6
6
  "files": [