manifest-editor 1.3.1 → 1.4.1

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/index.cjs CHANGED
@@ -35,8 +35,9 @@ __export(src_exports, {
35
35
  module.exports = __toCommonJS(src_exports);
36
36
 
37
37
  // src/ManifestEditor.tsx
38
- var import_shell = require("@manifest-editor/shell");
38
+ var import_collection_preset = require("@manifest-editor/collection-preset");
39
39
  var manifestEditorPreset = __toESM(require("@manifest-editor/manifest-preset"), 1);
40
+ var import_shell = require("@manifest-editor/shell");
40
41
  var import_react_iiif_vault = require("react-iiif-vault");
41
42
 
42
43
  // ../../node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js
@@ -61,9 +62,20 @@ function ManifestEditor(props) {
61
62
  const vault = (0, import_react_iiif_vault.useExistingVault)(props.vault);
62
63
  invariant(props.resource);
63
64
  invariant(props.data, "Data is required");
64
- invariant(props.resource.type === "Manifest", "Only Manifests are supported at the moment");
65
65
  if (!vault.requestStatus(props.resource.id)) {
66
66
  vault.loadManifestSync(props.resource.id, props.data);
67
67
  }
68
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_shell.AppProvider, { appId: "manifest-editor", definition: manifestEditor, instanceId: "test-1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_iiif_vault.VaultProvider, { vault, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_shell.ShellProvider, { resource: props.resource, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_shell.Layout, {}) }) }) });
68
+ let preset = null;
69
+ let appId = null;
70
+ if (props.resource.type === "Manifest") {
71
+ preset = manifestEditor;
72
+ appId = manifestEditor.metadata.id;
73
+ } else if (props.resource.type === "Collection") {
74
+ preset = import_collection_preset.collectionPreset;
75
+ appId = import_collection_preset.collectionPreset.metadata.id;
76
+ }
77
+ if (preset === null || appId === null) {
78
+ return null;
79
+ }
80
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_shell.AppProvider, { appId, definition: preset, instanceId: "test-1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_iiif_vault.VaultProvider, { vault, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_shell.ShellProvider, { resource: props.resource, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_shell.Layout, {}) }) }) });
69
81
  }
package/dist/index.css CHANGED
@@ -1563,6 +1563,9 @@
1563
1563
  .right-1 {
1564
1564
  right: 0.25rem;
1565
1565
  }
1566
+ .right-3 {
1567
+ right: 0.75rem;
1568
+ }
1566
1569
  .start-12 {
1567
1570
  inset-inline-start: 3rem;
1568
1571
  }
@@ -1572,6 +1575,9 @@
1572
1575
  .top-1 {
1573
1576
  top: 0.25rem;
1574
1577
  }
1578
+ .top-3 {
1579
+ top: 0.75rem;
1580
+ }
1575
1581
  .z-0 {
1576
1582
  z-index: 0;
1577
1583
  }
@@ -1603,6 +1609,10 @@
1603
1609
  margin-top: 1rem;
1604
1610
  margin-bottom: 1rem;
1605
1611
  }
1612
+ .my-5 {
1613
+ margin-top: 1.25rem;
1614
+ margin-bottom: 1.25rem;
1615
+ }
1606
1616
  .my-8 {
1607
1617
  margin-top: 2rem;
1608
1618
  margin-bottom: 2rem;
@@ -1631,6 +1641,12 @@
1631
1641
  .mt-1 {
1632
1642
  margin-top: 0.25rem;
1633
1643
  }
1644
+ .line-clamp-2 {
1645
+ overflow: hidden;
1646
+ display: -webkit-box;
1647
+ -webkit-box-orient: vertical;
1648
+ -webkit-line-clamp: 2;
1649
+ }
1634
1650
  .block {
1635
1651
  display: block;
1636
1652
  }
@@ -1670,6 +1686,9 @@
1670
1686
  .h-8 {
1671
1687
  height: 2rem;
1672
1688
  }
1689
+ .h-96 {
1690
+ height: 24rem;
1691
+ }
1673
1692
  .h-\[23px\] {
1674
1693
  height: 23px;
1675
1694
  }
@@ -1752,6 +1771,10 @@
1752
1771
  .flex-shrink-0 {
1753
1772
  flex-shrink: 0;
1754
1773
  }
1774
+ .-translate-y-1 {
1775
+ --tw-translate-y: -0.25rem;
1776
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1777
+ }
1755
1778
  .translate-x-3 {
1756
1779
  --tw-translate-x: 0.75rem;
1757
1780
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
@@ -1840,6 +1863,9 @@
1840
1863
  .gap-2 {
1841
1864
  gap: 0.5rem;
1842
1865
  }
1866
+ .gap-3 {
1867
+ gap: 0.75rem;
1868
+ }
1843
1869
  .gap-4 {
1844
1870
  gap: 1rem;
1845
1871
  }
@@ -1948,6 +1974,10 @@
1948
1974
  .border-transparent {
1949
1975
  border-color: transparent;
1950
1976
  }
1977
+ .border-b-gray-200 {
1978
+ --tw-border-opacity: 1;
1979
+ border-bottom-color: rgb(229 231 235 / var(--tw-border-opacity));
1980
+ }
1951
1981
  .border-b-me-gray-300 {
1952
1982
  --tw-border-opacity: 1;
1953
1983
  border-bottom-color: rgb(217 217 217 / var(--tw-border-opacity));
@@ -1974,6 +2004,10 @@
1974
2004
  --tw-bg-opacity: 1;
1975
2005
  background-color: rgb(243 244 246 / var(--tw-bg-opacity));
1976
2006
  }
2007
+ .bg-gray-200 {
2008
+ --tw-bg-opacity: 1;
2009
+ background-color: rgb(229 231 235 / var(--tw-bg-opacity));
2010
+ }
1977
2011
  .bg-me-gray-100 {
1978
2012
  --tw-bg-opacity: 1;
1979
2013
  background-color: rgb(245 245 245 / var(--tw-bg-opacity));
@@ -2079,6 +2113,9 @@
2079
2113
  .pt-3 {
2080
2114
  padding-top: 0.75rem;
2081
2115
  }
2116
+ .text-left {
2117
+ text-align: left;
2118
+ }
2082
2119
  .text-center {
2083
2120
  text-align: center;
2084
2121
  }
@@ -2148,6 +2185,10 @@
2148
2185
  --tw-text-opacity: 1;
2149
2186
  color: rgb(107 114 128 / var(--tw-text-opacity));
2150
2187
  }
2188
+ .text-gray-600 {
2189
+ --tw-text-opacity: 1;
2190
+ color: rgb(75 85 99 / var(--tw-text-opacity));
2191
+ }
2151
2192
  .text-gray-900 {
2152
2193
  --tw-text-opacity: 1;
2153
2194
  color: rgb(17 24 39 / var(--tw-text-opacity));
@@ -2177,6 +2218,9 @@
2177
2218
  .opacity-50 {
2178
2219
  opacity: 0.5;
2179
2220
  }
2221
+ .opacity-70 {
2222
+ opacity: 0.7;
2223
+ }
2180
2224
  .opacity-90 {
2181
2225
  opacity: 0.9;
2182
2226
  }
@@ -2243,6 +2287,14 @@
2243
2287
  --tw-ring-opacity: 1;
2244
2288
  --tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity));
2245
2289
  }
2290
+ .ring-me-gray-500 {
2291
+ --tw-ring-opacity: 1;
2292
+ --tw-ring-color: rgb(161 161 161 / var(--tw-ring-opacity));
2293
+ }
2294
+ .ring-me-primary-100 {
2295
+ --tw-ring-opacity: 1;
2296
+ --tw-ring-color: rgb(241 214 229 / var(--tw-ring-opacity));
2297
+ }
2246
2298
  .ring-me-primary-500 {
2247
2299
  --tw-ring-opacity: 1;
2248
2300
  --tw-ring-color: rgb(184 76 116 / var(--tw-ring-opacity));
@@ -2327,6 +2379,10 @@
2327
2379
  --grid-item--min-width: 120px;
2328
2380
  --total-gap-width: 1.5rem;
2329
2381
  }
2382
+ div[data-floating-ui-portal] {
2383
+ z-index: 505;
2384
+ position: relative;
2385
+ }
2330
2386
  .grid-lg,
2331
2387
  .grid-md,
2332
2388
  .grid-sm {
@@ -2490,6 +2546,24 @@ div.mdxeditor-popup-container > *[role=dialog] {
2490
2546
  var(--tw-ring-shadow),
2491
2547
  var(--tw-shadow, 0 0 #0000);
2492
2548
  }
2549
+ .hover\:ring-2:hover {
2550
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
2551
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
2552
+ box-shadow:
2553
+ var(--tw-ring-offset-shadow),
2554
+ var(--tw-ring-shadow),
2555
+ var(--tw-shadow, 0 0 #0000);
2556
+ }
2557
+ .focus\:not-sr-only:focus {
2558
+ position: static;
2559
+ width: auto;
2560
+ height: auto;
2561
+ padding: 0;
2562
+ margin: 0;
2563
+ overflow: visible;
2564
+ clip: auto;
2565
+ white-space: normal;
2566
+ }
2493
2567
  .focus\:border-me-primary-500:focus {
2494
2568
  --tw-border-opacity: 1;
2495
2569
  border-color: rgb(184 76 116 / var(--tw-border-opacity));
@@ -2530,9 +2604,37 @@ div.mdxeditor-popup-container > *[role=dialog] {
2530
2604
  --tw-border-opacity: 1;
2531
2605
  border-color: rgb(137 44 78 / var(--tw-border-opacity));
2532
2606
  }
2607
+ .data-\[active\]\:border-b-me-primary-500[data-active] {
2608
+ --tw-border-opacity: 1;
2609
+ border-bottom-color: rgb(184 76 116 / var(--tw-border-opacity));
2610
+ }
2611
+ .data-\[active\]\:bg-gray-200[data-active] {
2612
+ --tw-bg-opacity: 1;
2613
+ background-color: rgb(229 231 235 / var(--tw-bg-opacity));
2614
+ }
2615
+ .data-\[selected\]\:bg-me-primary-100[data-selected] {
2616
+ --tw-bg-opacity: 1;
2617
+ background-color: rgb(241 214 229 / var(--tw-bg-opacity));
2618
+ }
2619
+ .data-\[active\]\:text-me-primary-500[data-active] {
2620
+ --tw-text-opacity: 1;
2621
+ color: rgb(184 76 116 / var(--tw-text-opacity));
2622
+ }
2533
2623
  .data-\[visible\]\:opacity-100[data-visible] {
2534
2624
  opacity: 1;
2535
2625
  }
2626
+ .data-\[selected\]\:ring-2[data-selected] {
2627
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
2628
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
2629
+ box-shadow:
2630
+ var(--tw-ring-offset-shadow),
2631
+ var(--tw-ring-shadow),
2632
+ var(--tw-shadow, 0 0 #0000);
2633
+ }
2634
+ .data-\[selected\]\:ring-me-primary-500[data-selected] {
2635
+ --tw-ring-opacity: 1;
2636
+ --tw-ring-color: rgb(184 76 116 / var(--tw-ring-opacity));
2637
+ }
2536
2638
  .prose-a\:text-me-primary-500 :is(:where(a):not(:where([class~=not-prose], [class~=not-prose] *))) {
2537
2639
  --tw-text-opacity: 1;
2538
2640
  color: rgb(184 76 116 / var(--tw-text-opacity));
@@ -2546,11 +2648,6 @@ div.mdxeditor-popup-container > *[role=dialog] {
2546
2648
  .prose-ul\:list-disc :is(:where(ul):not(:where([class~=not-prose], [class~=not-prose] *))) {
2547
2649
  list-style-type: disc;
2548
2650
  }
2549
- @media (min-width: 768px) {
2550
- .md\:p-5 {
2551
- padding: 1.25rem;
2552
- }
2553
- }
2554
2651
  .\[\&\>svg\]\:h-16 > svg {
2555
2652
  height: 4rem;
2556
2653
  }
package/dist/index.d.cts CHANGED
@@ -10,6 +10,6 @@ interface ManifestEditorProps {
10
10
  data?: Manifest | Collection;
11
11
  vault?: Vault;
12
12
  }
13
- declare function ManifestEditor(props: ManifestEditorProps): react_jsx_runtime.JSX.Element;
13
+ declare function ManifestEditor(props: ManifestEditorProps): react_jsx_runtime.JSX.Element | null;
14
14
 
15
15
  export { ManifestEditor };
package/dist/index.d.ts CHANGED
@@ -10,6 +10,6 @@ interface ManifestEditorProps {
10
10
  data?: Manifest | Collection;
11
11
  vault?: Vault;
12
12
  }
13
- declare function ManifestEditor(props: ManifestEditorProps): react_jsx_runtime.JSX.Element;
13
+ declare function ManifestEditor(props: ManifestEditorProps): react_jsx_runtime.JSX.Element | null;
14
14
 
15
15
  export { ManifestEditor };
package/dist/index.js CHANGED
@@ -1,7 +1,8 @@
1
1
  // src/ManifestEditor.tsx
2
- import { AppProvider, Layout, ShellProvider, mapApp } from "@manifest-editor/shell";
2
+ import { collectionPreset } from "@manifest-editor/collection-preset";
3
3
  import * as manifestEditorPreset from "@manifest-editor/manifest-preset";
4
- import { useExistingVault, VaultProvider } from "react-iiif-vault";
4
+ import { AppProvider, Layout, ShellProvider, mapApp } from "@manifest-editor/shell";
5
+ import { VaultProvider, useExistingVault } from "react-iiif-vault";
5
6
 
6
7
  // ../../node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js
7
8
  var isProduction = false;
@@ -25,11 +26,22 @@ function ManifestEditor(props) {
25
26
  const vault = useExistingVault(props.vault);
26
27
  invariant(props.resource);
27
28
  invariant(props.data, "Data is required");
28
- invariant(props.resource.type === "Manifest", "Only Manifests are supported at the moment");
29
29
  if (!vault.requestStatus(props.resource.id)) {
30
30
  vault.loadManifestSync(props.resource.id, props.data);
31
31
  }
32
- return /* @__PURE__ */ jsx(AppProvider, { appId: "manifest-editor", definition: manifestEditor, instanceId: "test-1", children: /* @__PURE__ */ jsx(VaultProvider, { vault, children: /* @__PURE__ */ jsx(ShellProvider, { resource: props.resource, children: /* @__PURE__ */ jsx(Layout, {}) }) }) });
32
+ let preset = null;
33
+ let appId = null;
34
+ if (props.resource.type === "Manifest") {
35
+ preset = manifestEditor;
36
+ appId = manifestEditor.metadata.id;
37
+ } else if (props.resource.type === "Collection") {
38
+ preset = collectionPreset;
39
+ appId = collectionPreset.metadata.id;
40
+ }
41
+ if (preset === null || appId === null) {
42
+ return null;
43
+ }
44
+ return /* @__PURE__ */ jsx(AppProvider, { appId, definition: preset, instanceId: "test-1", children: /* @__PURE__ */ jsx(VaultProvider, { vault, children: /* @__PURE__ */ jsx(ShellProvider, { resource: props.resource, children: /* @__PURE__ */ jsx(Layout, {}) }) }) });
33
45
  }
34
46
  export {
35
47
  ManifestEditor
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "manifest-editor",
3
- "version": "1.3.1",
3
+ "version": "1.4.1",
4
4
  "type": "module",
5
5
  "bugs": "https://github.com/digirati-co-uk/iiif-manifest-editor/issues",
6
6
  "repository": {
@@ -46,15 +46,15 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@iiif/helpers": "^1.3.1",
49
- "@iiif/parser": "^2.1.7",
49
+ "@iiif/parser": "^2.1.8",
50
50
  "@iiif/presentation-3": "^2.2.3",
51
51
  "@iiif/presentation-3-normalized": "^0.9.7",
52
- "@manifest-editor/collection-preset": "1.3.1",
53
- "@manifest-editor/components": "1.3.1",
54
- "@manifest-editor/editors": "1.3.1",
55
- "@manifest-editor/iiif-browser": "1.3.0",
56
- "@manifest-editor/manifest-preset": "1.3.1",
57
- "@manifest-editor/shell": "1.3.1",
52
+ "@manifest-editor/collection-preset": "1.4.1",
53
+ "@manifest-editor/components": "1.4.1",
54
+ "@manifest-editor/editors": "1.4.1",
55
+ "@manifest-editor/iiif-browser": "1.4.1",
56
+ "@manifest-editor/manifest-preset": "1.4.1",
57
+ "@manifest-editor/shell": "1.4.1",
58
58
  "react": "^18.3.1",
59
59
  "react-dom": "^18.3.1",
60
60
  "react-iiif-vault": "^1.2.1"
@@ -72,5 +72,5 @@
72
72
  "publishConfig": {
73
73
  "access": "public"
74
74
  },
75
- "gitHead": "920fe405869996394c204c6eae70f446aab78986"
75
+ "gitHead": "7e8791689668c2428ecf0d617f69038d0fd2e758"
76
76
  }