@manifest-editor/shell 1.3.1 → 1.4.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/dist/index.cjs +226 -217
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +235 -219
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1598,31 +1598,17 @@ function AtlasStoreProvider({
|
|
|
1598
1598
|
|
|
1599
1599
|
// src/BaseCreator/BaseCreator.tsx
|
|
1600
1600
|
import { toRef as toRef3 } from "@iiif/parser";
|
|
1601
|
-
import {
|
|
1601
|
+
import {
|
|
1602
|
+
CreatorGrid,
|
|
1603
|
+
ErrorMessage as ErrorMessage2,
|
|
1604
|
+
GridIcon,
|
|
1605
|
+
IconButton as IconButton2,
|
|
1606
|
+
ModalBackSlot,
|
|
1607
|
+
Spinner
|
|
1608
|
+
} from "@manifest-editor/components";
|
|
1602
1609
|
import {
|
|
1603
1610
|
matchBasedOnResource as matchBasedOnResource2
|
|
1604
1611
|
} from "@manifest-editor/creator-api";
|
|
1605
|
-
|
|
1606
|
-
// ../ui/madoc/components/icons/Spinner.tsx
|
|
1607
|
-
import { jsx as jsx13, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1608
|
-
function Spinner(props) {
|
|
1609
|
-
return /* @__PURE__ */ jsx13("svg", { width: "1em", height: "1em", viewBox: "0 0 42 42", xmlns: "http://www.w3.org/2000/svg", stroke: "#fff", ...props, children: /* @__PURE__ */ jsxs4("g", { transform: "translate(2 2)", strokeWidth: 5, fill: "none", fillRule: "evenodd", children: [
|
|
1610
|
-
/* @__PURE__ */ jsx13("circle", { strokeOpacity: 0.5, cx: 18, cy: 18, r: 18 }),
|
|
1611
|
-
/* @__PURE__ */ jsx13("path", { d: "M36 18c0-9.94-8.06-18-18-18", children: /* @__PURE__ */ jsx13(
|
|
1612
|
-
"animateTransform",
|
|
1613
|
-
{
|
|
1614
|
-
attributeName: "transform",
|
|
1615
|
-
type: "rotate",
|
|
1616
|
-
from: "0 18 18",
|
|
1617
|
-
to: "360 18 18",
|
|
1618
|
-
dur: "1s",
|
|
1619
|
-
repeatCount: "indefinite"
|
|
1620
|
-
}
|
|
1621
|
-
) })
|
|
1622
|
-
] }) });
|
|
1623
|
-
}
|
|
1624
|
-
|
|
1625
|
-
// src/BaseCreator/BaseCreator.tsx
|
|
1626
1612
|
import { Suspense, memo as memo3, useEffect as useEffect8, useMemo as useMemo12, useRef as useRef3, useState as useState5 } from "react";
|
|
1627
1613
|
import { useVault as useVault4 } from "react-iiif-vault";
|
|
1628
1614
|
|
|
@@ -1654,11 +1640,11 @@ function useLayoutProvider() {
|
|
|
1654
1640
|
import styled6 from "styled-components";
|
|
1655
1641
|
|
|
1656
1642
|
// ../ui/icons/StarIcon.tsx
|
|
1657
|
-
import { jsx as
|
|
1658
|
-
var StarIcon = (props) => /* @__PURE__ */
|
|
1659
|
-
/* @__PURE__ */
|
|
1660
|
-
/* @__PURE__ */
|
|
1661
|
-
/* @__PURE__ */
|
|
1643
|
+
import { jsx as jsx13, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1644
|
+
var StarIcon = (props) => /* @__PURE__ */ jsxs4("svg", { xmlns: "http://www.w3.org/2000/svg", height: "1em", width: "1em", viewBox: "0 0 24 24", ...props, children: [
|
|
1645
|
+
/* @__PURE__ */ jsx13("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
1646
|
+
/* @__PURE__ */ jsx13("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
1647
|
+
/* @__PURE__ */ jsx13(
|
|
1662
1648
|
"path",
|
|
1663
1649
|
{
|
|
1664
1650
|
d: "M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z",
|
|
@@ -1668,10 +1654,10 @@ var StarIcon = (props) => /* @__PURE__ */ jsxs5("svg", { xmlns: "http://www.w3.o
|
|
|
1668
1654
|
] });
|
|
1669
1655
|
|
|
1670
1656
|
// ../ui/icons/BackIcon.tsx
|
|
1671
|
-
import { jsx as
|
|
1672
|
-
var BackIcon = ({ style }) => /* @__PURE__ */
|
|
1673
|
-
/* @__PURE__ */
|
|
1674
|
-
/* @__PURE__ */
|
|
1657
|
+
import { jsx as jsx14, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1658
|
+
var BackIcon = ({ style }) => /* @__PURE__ */ jsxs5("svg", { xmlns: "http://www.w3.org/2000/svg", height: "1rem", viewBox: "0 0 24 24", width: "1rem", fill: "#000000", style, children: [
|
|
1659
|
+
/* @__PURE__ */ jsx14("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
1660
|
+
/* @__PURE__ */ jsx14("path", { d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" })
|
|
1675
1661
|
] });
|
|
1676
1662
|
|
|
1677
1663
|
// src/Layout/components/ModularPanel.tsx
|
|
@@ -1690,13 +1676,13 @@ var PaddedSidebarContainer = styled4.div`
|
|
|
1690
1676
|
// src/Layout/components/PanelError.tsx
|
|
1691
1677
|
import { ErrorMessage } from "@manifest-editor/components";
|
|
1692
1678
|
import { useState as useState3 } from "react";
|
|
1693
|
-
import { jsx as
|
|
1679
|
+
import { jsx as jsx15, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1694
1680
|
function PanelError(props) {
|
|
1695
1681
|
let error = props.error.toString();
|
|
1696
1682
|
const [isFixing, setIsFixing] = useState3(false);
|
|
1697
|
-
return /* @__PURE__ */
|
|
1698
|
-
/* @__PURE__ */
|
|
1699
|
-
/* @__PURE__ */
|
|
1683
|
+
return /* @__PURE__ */ jsxs6(PaddedSidebarContainer, { children: [
|
|
1684
|
+
/* @__PURE__ */ jsx15(ErrorMessage, { className: "mb-2", children: error }),
|
|
1685
|
+
/* @__PURE__ */ jsx15(CalltoButton, { onClick: props.resetErrorBoundary, children: "Try again" })
|
|
1700
1686
|
] });
|
|
1701
1687
|
}
|
|
1702
1688
|
|
|
@@ -1820,7 +1806,7 @@ import useDropdownMenu2 from "react-accessible-dropdown-menu-hook";
|
|
|
1820
1806
|
var OverrideScrollbar = "ModularPanel_OverrideScrollbar";
|
|
1821
1807
|
|
|
1822
1808
|
// src/Layout/components/ModularPanel.tsx
|
|
1823
|
-
import { jsx as
|
|
1809
|
+
import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1824
1810
|
var LayoutTitleReactContext = createContext10(null);
|
|
1825
1811
|
function useSetCustomTitle() {
|
|
1826
1812
|
return useContext10(LayoutTitleReactContext);
|
|
@@ -1917,7 +1903,7 @@ var ModulePanelButton = styled6.button`
|
|
|
1917
1903
|
var ModulePanelSpacer = styled6.div`
|
|
1918
1904
|
flex: 1 1 0px;
|
|
1919
1905
|
`;
|
|
1920
|
-
var ModularPanelLabel = styled6.
|
|
1906
|
+
var ModularPanelLabel = styled6.div`
|
|
1921
1907
|
font-size: 0.875em;
|
|
1922
1908
|
flex: 1 1 0px;
|
|
1923
1909
|
padding-left: 1em;
|
|
@@ -1995,16 +1981,16 @@ function ModularPanel({
|
|
|
1995
1981
|
if (!panel || !state.current) {
|
|
1996
1982
|
return null;
|
|
1997
1983
|
}
|
|
1998
|
-
const backButton = panel.backAction || state.stack.length ? /* @__PURE__ */
|
|
1999
|
-
const closeButton = /* @__PURE__ */
|
|
2000
|
-
return /* @__PURE__ */
|
|
2001
|
-
noHeader ? null : /* @__PURE__ */
|
|
2002
|
-
/* @__PURE__ */
|
|
1984
|
+
const backButton = panel.backAction || state.stack.length ? /* @__PURE__ */ jsx16(ModulePanelButton, { onClick: backAction, children: /* @__PURE__ */ jsx16(BackIcon, {}) }) : null;
|
|
1985
|
+
const closeButton = /* @__PURE__ */ jsx16(ModulePanelButton, { onClick: close || actions.close, children: /* @__PURE__ */ jsx16(CloseIcon, {}) });
|
|
1986
|
+
return /* @__PURE__ */ jsx16(LayoutTitleReactContext.Provider, { value: _setCustomTitle, children: /* @__PURE__ */ jsxs7(ModularPanelWrapper, { "data-state": transition, "data-flipped": isLeft, style, "data-header": !noHeader, children: [
|
|
1987
|
+
noHeader ? null : /* @__PURE__ */ jsxs7(ModularPanelHeader, { "data-tabs": !!tabs, "data-error": didError, children: [
|
|
1988
|
+
/* @__PURE__ */ jsxs7(Dropdown, { style: { display: "flex", height: "100%" }, children: [
|
|
2003
1989
|
panel.renderBackAction ? panel.renderBackAction({ backAction, fallback: backButton }) : backButton,
|
|
2004
|
-
switchablePanels.length ? /* @__PURE__ */
|
|
2005
|
-
/* @__PURE__ */
|
|
2006
|
-
/* @__PURE__ */
|
|
2007
|
-
switchablePanels.map((newPanel, i) => /* @__PURE__ */
|
|
1990
|
+
switchablePanels.length ? /* @__PURE__ */ jsxs7(DropdownMenu, { $open: isOpen, style: { left: "0.5em" }, children: [
|
|
1991
|
+
/* @__PURE__ */ jsx16(DropdownLabel, { children: "All panels" }),
|
|
1992
|
+
/* @__PURE__ */ jsx16(DropdownDivider, {}),
|
|
1993
|
+
switchablePanels.map((newPanel, i) => /* @__PURE__ */ jsx16(
|
|
2008
1994
|
DropdownItem,
|
|
2009
1995
|
{
|
|
2010
1996
|
...itemProps[i],
|
|
@@ -2016,11 +2002,11 @@ function ModularPanel({
|
|
|
2016
2002
|
))
|
|
2017
2003
|
] }) : null
|
|
2018
2004
|
] }),
|
|
2019
|
-
customTitle ? /* @__PURE__ */
|
|
2020
|
-
pinnable ? state.pinned ? /* @__PURE__ */
|
|
2005
|
+
customTitle ? /* @__PURE__ */ jsx16(ModularPanelLabel, { children: customTitle }) : hideHeader ? /* @__PURE__ */ jsx16(ModulePanelSpacer, {}) : /* @__PURE__ */ jsx16(ModularPanelLabel, { children: panel.label }),
|
|
2006
|
+
pinnable ? state.pinned ? /* @__PURE__ */ jsx16(ModulePanelButton, { onClick: pinActions.unpin, children: /* @__PURE__ */ jsx16(StarIcon, { fill: "orange" }) }) : /* @__PURE__ */ jsx16(ModulePanelButton, { onClick: () => pinActions.pin({ id: panel.id, state: state.state }), children: /* @__PURE__ */ jsx16(StarIcon, { fill: "#ddd" }) }) : null,
|
|
2021
2007
|
panel.renderCloseAction ? panel.renderCloseAction({ closeAction: close || actions.close, fallback: closeButton }) : closeButton
|
|
2022
2008
|
] }),
|
|
2023
|
-
/* @__PURE__ */
|
|
2009
|
+
/* @__PURE__ */ jsx16(ModularPanelContent, { className: OverrideScrollbar, children: /* @__PURE__ */ jsx16(
|
|
2024
2010
|
ErrorBoundary,
|
|
2025
2011
|
{
|
|
2026
2012
|
onError: () => setDidError(true),
|
|
@@ -2077,15 +2063,13 @@ function createDownload(data, fileName, fileType = "text/json") {
|
|
|
2077
2063
|
a.remove();
|
|
2078
2064
|
}
|
|
2079
2065
|
async function copyToClipboard(json) {
|
|
2080
|
-
return navigator.clipboard.writeText(
|
|
2081
|
-
typeof json === "string" ? json : JSON.stringify(json, null, 2)
|
|
2082
|
-
);
|
|
2066
|
+
return navigator.clipboard.writeText(typeof json === "string" ? json : JSON.stringify(json, null, 2));
|
|
2083
2067
|
}
|
|
2084
2068
|
function randomId() {
|
|
2085
2069
|
return `${Math.random().toString(36).substr(2)}-${Date.now().toString(36)}`;
|
|
2086
2070
|
}
|
|
2087
2071
|
function mapApp(input, map) {
|
|
2088
|
-
const { default: metadata, ...props } = input;
|
|
2072
|
+
const { default: metadata, config, ...props } = input;
|
|
2089
2073
|
const app = {
|
|
2090
2074
|
metadata,
|
|
2091
2075
|
layout: {
|
|
@@ -2093,7 +2077,8 @@ function mapApp(input, map) {
|
|
|
2093
2077
|
rightPanels: [],
|
|
2094
2078
|
centerPanels: [],
|
|
2095
2079
|
...props
|
|
2096
|
-
}
|
|
2080
|
+
},
|
|
2081
|
+
config
|
|
2097
2082
|
};
|
|
2098
2083
|
return map ? map(app) : app;
|
|
2099
2084
|
}
|
|
@@ -2116,35 +2101,17 @@ function extendApp(app, metadata, extensions) {
|
|
|
2116
2101
|
}),
|
|
2117
2102
|
...extensions?.leftPanels || []
|
|
2118
2103
|
],
|
|
2119
|
-
annotations: [
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
],
|
|
2123
|
-
canvasEditors: [
|
|
2124
|
-
...extensions?.canvasEditors || [],
|
|
2125
|
-
...app.layout.canvasEditors || []
|
|
2126
|
-
],
|
|
2127
|
-
creators: [
|
|
2128
|
-
...extensions?.creators || [],
|
|
2129
|
-
...app.layout.creators || []
|
|
2130
|
-
],
|
|
2104
|
+
annotations: [...extensions?.annotations || [], ...app.layout.annotations || []],
|
|
2105
|
+
canvasEditors: [...extensions?.canvasEditors || [], ...app.layout.canvasEditors || []],
|
|
2106
|
+
creators: [...extensions?.creators || [], ...app.layout.creators || []],
|
|
2131
2107
|
editors: [
|
|
2132
2108
|
//
|
|
2133
2109
|
...extensions?.editors || [],
|
|
2134
2110
|
...app.layout.editors || []
|
|
2135
2111
|
],
|
|
2136
|
-
rightPanels: [
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
],
|
|
2140
|
-
centerPanels: [
|
|
2141
|
-
...app.layout.centerPanels || [],
|
|
2142
|
-
...extensions?.centerPanels || []
|
|
2143
|
-
],
|
|
2144
|
-
modals: [
|
|
2145
|
-
...app.layout.modals || [],
|
|
2146
|
-
...extensions?.modalPanels || []
|
|
2147
|
-
]
|
|
2112
|
+
rightPanels: [...app.layout.rightPanels || [], ...extensions?.rightPanels || []],
|
|
2113
|
+
centerPanels: [...app.layout.centerPanels || [], ...extensions?.centerPanels || []],
|
|
2114
|
+
modals: [...app.layout.modals || [], ...extensions?.modalPanels || []]
|
|
2148
2115
|
}
|
|
2149
2116
|
};
|
|
2150
2117
|
}
|
|
@@ -2317,7 +2284,7 @@ function createPreviewVault(homepageCollectionId = "vault://homepage-collection.
|
|
|
2317
2284
|
}
|
|
2318
2285
|
|
|
2319
2286
|
// src/PreviewVault/PreviewVault.tsx
|
|
2320
|
-
import { jsx as
|
|
2287
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2321
2288
|
function usePreviewVault() {
|
|
2322
2289
|
return useContext11(PreviewVaultReactContext);
|
|
2323
2290
|
}
|
|
@@ -2339,11 +2306,11 @@ function PreviewVaultContext(props) {
|
|
|
2339
2306
|
useEffect7(() => {
|
|
2340
2307
|
return unsubscribe;
|
|
2341
2308
|
}, []);
|
|
2342
|
-
return /* @__PURE__ */
|
|
2309
|
+
return /* @__PURE__ */ jsx17(PreviewVaultAddHistory.Provider, { value: { addHistory, clearHistory }, children: /* @__PURE__ */ jsx17(PreviewVaultReactContext.Provider, { value: vault, children: props.children }) });
|
|
2343
2310
|
}
|
|
2344
2311
|
function PreviewVaultBoundary({ children }) {
|
|
2345
2312
|
const vault = usePreviewVault();
|
|
2346
|
-
return /* @__PURE__ */
|
|
2313
|
+
return /* @__PURE__ */ jsx17(VaultProvider2, { vault, children });
|
|
2347
2314
|
}
|
|
2348
2315
|
|
|
2349
2316
|
// src/BaseCreator/BaseCreator.hooks.tsx
|
|
@@ -2444,11 +2411,12 @@ function useInlineCreator() {
|
|
|
2444
2411
|
}
|
|
2445
2412
|
|
|
2446
2413
|
// src/BaseCreator/BaseCreator.tsx
|
|
2447
|
-
import { Fragment as Fragment2, jsx as
|
|
2414
|
+
import { Fragment as Fragment2, jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2448
2415
|
var RenderCreator = memo3(function RenderCreator2(props) {
|
|
2449
2416
|
const vault = useVault4();
|
|
2450
2417
|
const { edit, modal } = useLayoutActions();
|
|
2451
2418
|
const [isCreating, setIsCreating] = useState5(false);
|
|
2419
|
+
const [error, setError] = useState5(null);
|
|
2452
2420
|
const creator = useInlineCreator();
|
|
2453
2421
|
const isCreatingRef = useRef3(false);
|
|
2454
2422
|
const canvasSelector = props.resource.initialData?.selector;
|
|
@@ -2464,18 +2432,32 @@ var RenderCreator = memo3(function RenderCreator2(props) {
|
|
|
2464
2432
|
initialData: props.resource.initialData
|
|
2465
2433
|
};
|
|
2466
2434
|
const runCreate = (payload) => {
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2435
|
+
try {
|
|
2436
|
+
if (isCreating || isCreatingRef.current)
|
|
2437
|
+
return;
|
|
2438
|
+
setIsCreating(true);
|
|
2439
|
+
isCreatingRef.current = true;
|
|
2440
|
+
creator.create(props.creator.id, payload, options).catch((err) => {
|
|
2441
|
+
setError(err?.message || "Unknown error");
|
|
2442
|
+
return null;
|
|
2443
|
+
}).then(async (ref) => {
|
|
2444
|
+
if (!ref)
|
|
2445
|
+
return;
|
|
2446
|
+
const singleRef = Array.isArray(ref) ? ref[0] : ref;
|
|
2447
|
+
setIsCreating(false);
|
|
2448
|
+
modal.popStack();
|
|
2449
|
+
modal.close();
|
|
2450
|
+
if (singleRef) {
|
|
2451
|
+
edit(singleRef, {
|
|
2452
|
+
parent: toRef3(props.resource.parent),
|
|
2453
|
+
property: props.resource.property,
|
|
2454
|
+
index: props.resource.index
|
|
2455
|
+
});
|
|
2456
|
+
}
|
|
2477
2457
|
});
|
|
2478
|
-
})
|
|
2458
|
+
} catch (err) {
|
|
2459
|
+
setError(err?.message || "Unknown error");
|
|
2460
|
+
}
|
|
2479
2461
|
};
|
|
2480
2462
|
const validate = async () => {
|
|
2481
2463
|
return true;
|
|
@@ -2485,19 +2467,21 @@ var RenderCreator = memo3(function RenderCreator2(props) {
|
|
|
2485
2467
|
runCreate({});
|
|
2486
2468
|
}
|
|
2487
2469
|
}, [props.creator]);
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
}
|
|
2493
|
-
|
|
2470
|
+
if (error) {
|
|
2471
|
+
return /* @__PURE__ */ jsx18("div", { className: "flex flex-col items-center p-4", children: /* @__PURE__ */ jsx18(ErrorMessage2, { children: error }) });
|
|
2472
|
+
}
|
|
2473
|
+
const spinner = /* @__PURE__ */ jsx18("div", { className: "flex flex-col items-center py-8", children: /* @__PURE__ */ jsxs8("div", { className: "flex gap-2 items-center", children: [
|
|
2474
|
+
/* @__PURE__ */ jsx18(Spinner, {}),
|
|
2475
|
+
" ",
|
|
2476
|
+
/* @__PURE__ */ jsx18("span", { children: "Loading" })
|
|
2477
|
+
] }) });
|
|
2494
2478
|
if (isCreating) {
|
|
2495
|
-
return
|
|
2479
|
+
return spinner;
|
|
2496
2480
|
}
|
|
2497
2481
|
if (!props.creator.render) {
|
|
2498
|
-
return /* @__PURE__ */
|
|
2482
|
+
return /* @__PURE__ */ jsx18("div", { children: /* @__PURE__ */ jsx18(Button, { onClick: () => runCreate({}), children: "Create" }) });
|
|
2499
2483
|
}
|
|
2500
|
-
return /* @__PURE__ */
|
|
2484
|
+
return /* @__PURE__ */ jsx18(Fragment2, { children: /* @__PURE__ */ jsx18(Suspense, { fallback: spinner, children: props.creator.render({
|
|
2501
2485
|
vault,
|
|
2502
2486
|
runCreate,
|
|
2503
2487
|
validate,
|
|
@@ -2507,9 +2491,7 @@ var RenderCreator = memo3(function RenderCreator2(props) {
|
|
|
2507
2491
|
function BaseCreator(props) {
|
|
2508
2492
|
const app = useApp();
|
|
2509
2493
|
const vault = useVault4();
|
|
2510
|
-
const [currentId, setCurrentId] = useState5(
|
|
2511
|
-
props.resource.initialCreator || ""
|
|
2512
|
-
);
|
|
2494
|
+
const [currentId, setCurrentId] = useState5(props.resource.initialCreator || "");
|
|
2513
2495
|
const set = useSetCustomTitle();
|
|
2514
2496
|
const supported = useMemo12(
|
|
2515
2497
|
() => matchBasedOnResource2(props.resource, app.layout.creators || [], {
|
|
@@ -2527,19 +2509,33 @@ function BaseCreator(props) {
|
|
|
2527
2509
|
}
|
|
2528
2510
|
});
|
|
2529
2511
|
if (supported.length === 0) {
|
|
2530
|
-
return /* @__PURE__ */
|
|
2512
|
+
return /* @__PURE__ */ jsx18("div", { children: "Not currently supported" });
|
|
2531
2513
|
}
|
|
2514
|
+
const backButton = /* @__PURE__ */ jsx18(ModalBackSlot, { children: /* @__PURE__ */ jsx18(
|
|
2515
|
+
IconButton2,
|
|
2516
|
+
{
|
|
2517
|
+
root: document.getElementById("headlessui-portal-root") || void 0,
|
|
2518
|
+
label: "Back to Add content options",
|
|
2519
|
+
className: "group",
|
|
2520
|
+
placement: "right",
|
|
2521
|
+
onPress: () => setCurrentId(""),
|
|
2522
|
+
children: /* @__PURE__ */ jsx18(GridIcon, { className: "text-2xl opacity-50 group-hover:opacity-70" })
|
|
2523
|
+
}
|
|
2524
|
+
) });
|
|
2532
2525
|
if (current) {
|
|
2533
2526
|
const shouldHideModal = current.hiddenModal;
|
|
2534
2527
|
if (shouldHideModal) {
|
|
2535
|
-
return /* @__PURE__ */
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2528
|
+
return /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
2529
|
+
backButton,
|
|
2530
|
+
/* @__PURE__ */ jsx18(RenderCreator, { creator: current, resource: props.resource })
|
|
2531
|
+
] });
|
|
2532
|
+
}
|
|
2533
|
+
return /* @__PURE__ */ jsxs8("div", { children: [
|
|
2534
|
+
backButton,
|
|
2535
|
+
/* @__PURE__ */ jsx18("div", { className: "p-2 py-6", children: /* @__PURE__ */ jsx18(RenderCreator, { creator: current, resource: props.resource }) })
|
|
2540
2536
|
] });
|
|
2541
2537
|
}
|
|
2542
|
-
return /* @__PURE__ */
|
|
2538
|
+
return /* @__PURE__ */ jsx18(
|
|
2543
2539
|
CreatorGrid,
|
|
2544
2540
|
{
|
|
2545
2541
|
label: "Select a type",
|
|
@@ -2555,13 +2551,13 @@ function BaseCreator(props) {
|
|
|
2555
2551
|
}
|
|
2556
2552
|
|
|
2557
2553
|
// src/BaseCreator/index.tsx
|
|
2558
|
-
import { jsx as
|
|
2554
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2559
2555
|
var baseCreator = {
|
|
2560
2556
|
id: "@manifest-editor/creator",
|
|
2561
2557
|
label: "Add content",
|
|
2562
2558
|
options: { hideHeader: true, tabs: false },
|
|
2563
2559
|
render(state) {
|
|
2564
|
-
return /* @__PURE__ */
|
|
2560
|
+
return /* @__PURE__ */ jsx19(BaseCreator, { resource: state });
|
|
2565
2561
|
}
|
|
2566
2562
|
};
|
|
2567
2563
|
|
|
@@ -2668,7 +2664,7 @@ function filterStack(newStackWithDuplicates, current) {
|
|
|
2668
2664
|
import { EditorInstance } from "@manifest-editor/editor-api";
|
|
2669
2665
|
import { useResourceContext, useVault as useVault5 } from "react-iiif-vault";
|
|
2670
2666
|
import { toRef as toRef5 } from "@iiif/parser";
|
|
2671
|
-
import { jsx as
|
|
2667
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2672
2668
|
var defaultState = { stack: [], current: null, create: null };
|
|
2673
2669
|
var EditingStackContext = createContext12(defaultState);
|
|
2674
2670
|
var EditingStackActionsContext = createContext12({
|
|
@@ -2808,16 +2804,16 @@ function EditingStack(props) {
|
|
|
2808
2804
|
return { edit, updateCurrent, close, back, create: create2 };
|
|
2809
2805
|
}, []);
|
|
2810
2806
|
const { instanceId } = useAppInstance();
|
|
2811
|
-
return /* @__PURE__ */
|
|
2807
|
+
return /* @__PURE__ */ jsx20(EditingStackActionsContext.Provider, { value: actions, children: /* @__PURE__ */ jsx20(EditingStackContext.Provider, { value: state, children: props.children }) }, instanceId);
|
|
2812
2808
|
}
|
|
2813
2809
|
|
|
2814
2810
|
// src/BaseEditor/BaseEditor.tsx
|
|
2815
|
-
import { jsx as
|
|
2811
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2816
2812
|
function BaseEditorBackButton({ fallback, backAction }) {
|
|
2817
2813
|
const stack = useEditingResourceStack();
|
|
2818
2814
|
const { back } = useEditingStack();
|
|
2819
2815
|
if (stack.length) {
|
|
2820
|
-
return /* @__PURE__ */
|
|
2816
|
+
return /* @__PURE__ */ jsx21(ModulePanelButton, { onClick: back, children: /* @__PURE__ */ jsx21(BackIcon, {}) });
|
|
2821
2817
|
}
|
|
2822
2818
|
return fallback;
|
|
2823
2819
|
}
|
|
@@ -2825,22 +2821,20 @@ function BaseEditorCloseButton({ closeAction, fallback }) {
|
|
|
2825
2821
|
const stack = useEditingResourceStack();
|
|
2826
2822
|
const current = useEditingResource();
|
|
2827
2823
|
if (current || stack.length) {
|
|
2828
|
-
return /* @__PURE__ */
|
|
2824
|
+
return /* @__PURE__ */ jsx21(
|
|
2829
2825
|
ModulePanelButton,
|
|
2830
2826
|
{
|
|
2831
2827
|
onClick: () => {
|
|
2832
2828
|
closeAction();
|
|
2833
2829
|
},
|
|
2834
|
-
children: /* @__PURE__ */
|
|
2830
|
+
children: /* @__PURE__ */ jsx21(CloseIcon, {})
|
|
2835
2831
|
}
|
|
2836
2832
|
);
|
|
2837
2833
|
}
|
|
2838
2834
|
return fallback;
|
|
2839
2835
|
}
|
|
2840
2836
|
function editBasedOnResource(resource, list, options, config) {
|
|
2841
|
-
const filteredList = list.filter(
|
|
2842
|
-
(l) => l.resourceType === resource.resource.source.type
|
|
2843
|
-
);
|
|
2837
|
+
const filteredList = list.filter((l) => l.resourceType === resource.resource.source.type);
|
|
2844
2838
|
if (filteredList.length === 0) {
|
|
2845
2839
|
return null;
|
|
2846
2840
|
}
|
|
@@ -2888,9 +2882,7 @@ function editBasedOnResource(resource, list, options, config) {
|
|
|
2888
2882
|
}
|
|
2889
2883
|
return null;
|
|
2890
2884
|
}
|
|
2891
|
-
function BaseEditor({
|
|
2892
|
-
currentTab = void 0
|
|
2893
|
-
}) {
|
|
2885
|
+
function BaseEditor({ currentTab = void 0 }) {
|
|
2894
2886
|
const resource = useEditingResource();
|
|
2895
2887
|
const currentResourceContext = useContext13(ResourceReactContext);
|
|
2896
2888
|
const app = useApp();
|
|
@@ -2920,7 +2912,7 @@ function BaseEditor({
|
|
|
2920
2912
|
if (!resource) {
|
|
2921
2913
|
return children;
|
|
2922
2914
|
}
|
|
2923
|
-
return /* @__PURE__ */
|
|
2915
|
+
return /* @__PURE__ */ jsx21(ResourceReactContext.Provider, { value: newResourceContext, children });
|
|
2924
2916
|
}
|
|
2925
2917
|
const match = useMemo14(() => {
|
|
2926
2918
|
if (!resource) {
|
|
@@ -2928,28 +2920,19 @@ function BaseEditor({
|
|
|
2928
2920
|
}
|
|
2929
2921
|
const editors = app.layout.editors || [];
|
|
2930
2922
|
const resources = app.layout.resources || [];
|
|
2931
|
-
const mappedResources = resources.map(
|
|
2932
|
-
(resource2)
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
(e) => e.supports.resourceTypes.includes(resource2)
|
|
2941
|
-
)
|
|
2942
|
-
};
|
|
2943
|
-
}
|
|
2944
|
-
return resource2;
|
|
2923
|
+
const mappedResources = resources.map((resource2) => {
|
|
2924
|
+
if (typeof resource2 === "string") {
|
|
2925
|
+
return {
|
|
2926
|
+
id: "@default/" + resource2,
|
|
2927
|
+
label: resource2,
|
|
2928
|
+
resourceType: resource2,
|
|
2929
|
+
auto: true,
|
|
2930
|
+
editors: editors.filter((e) => e.supports.resourceTypes.includes(resource2))
|
|
2931
|
+
};
|
|
2945
2932
|
}
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
mappedResources,
|
|
2950
|
-
{ edit: true, vault },
|
|
2951
|
-
resourceConfig
|
|
2952
|
-
);
|
|
2933
|
+
return resource2;
|
|
2934
|
+
});
|
|
2935
|
+
return editBasedOnResource(resource, mappedResources, { edit: true, vault }, resourceConfig);
|
|
2953
2936
|
}, [resource, app]);
|
|
2954
2937
|
useEffect10(() => {
|
|
2955
2938
|
set(match?.label || "");
|
|
@@ -2965,17 +2948,15 @@ function BaseEditor({
|
|
|
2965
2948
|
return null;
|
|
2966
2949
|
}
|
|
2967
2950
|
if (resourceConfig.singleTab) {
|
|
2968
|
-
const first = (match?.editors || []).find(
|
|
2969
|
-
(editor) => editor.id === resourceConfig.singleTab
|
|
2970
|
-
);
|
|
2951
|
+
const first = (match?.editors || []).find((editor) => editor.id === resourceConfig.singleTab);
|
|
2971
2952
|
if (first) {
|
|
2972
2953
|
return wrap(
|
|
2973
|
-
/* @__PURE__ */
|
|
2954
|
+
/* @__PURE__ */ jsx21("div", { className: "w-full", children: first.component(resourceConfig) }, resource.resource.source?.id)
|
|
2974
2955
|
);
|
|
2975
2956
|
}
|
|
2976
2957
|
}
|
|
2977
2958
|
return wrap(
|
|
2978
|
-
/* @__PURE__ */
|
|
2959
|
+
/* @__PURE__ */ jsx21(
|
|
2979
2960
|
SidebarTabs,
|
|
2980
2961
|
{
|
|
2981
2962
|
menuId: resource.resource.source.id,
|
|
@@ -2997,20 +2978,20 @@ function BaseEditor({
|
|
|
2997
2978
|
}
|
|
2998
2979
|
|
|
2999
2980
|
// src/BaseEditor/index.tsx
|
|
3000
|
-
import { jsx as
|
|
2981
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
3001
2982
|
var baseEditor = {
|
|
3002
2983
|
id: "@manifest-editor/editor",
|
|
3003
2984
|
label: "Editor",
|
|
3004
2985
|
options: { hideHeader: true, tabs: true, minWidth: 400 },
|
|
3005
|
-
renderBackAction: ({ backAction, fallback }) => /* @__PURE__ */
|
|
3006
|
-
renderCloseAction: ({ closeAction, fallback }) => /* @__PURE__ */
|
|
2986
|
+
renderBackAction: ({ backAction, fallback }) => /* @__PURE__ */ jsx22(BaseEditorBackButton, { backAction, fallback }),
|
|
2987
|
+
renderCloseAction: ({ closeAction, fallback }) => /* @__PURE__ */ jsx22(BaseEditorCloseButton, { closeAction, fallback }),
|
|
3007
2988
|
render({ currentTab }) {
|
|
3008
|
-
return /* @__PURE__ */
|
|
2989
|
+
return /* @__PURE__ */ jsx22(BaseEditor, { currentTab });
|
|
3009
2990
|
}
|
|
3010
2991
|
};
|
|
3011
2992
|
|
|
3012
2993
|
// src/ConfigContext/ConfigEditor.tsx
|
|
3013
|
-
import {
|
|
2994
|
+
import { ActionButton, Form, Sidebar, SidebarContent, SidebarHeader } from "@manifest-editor/components";
|
|
3014
2995
|
|
|
3015
2996
|
// src/hooks/use-decay-state.ts
|
|
3016
2997
|
import { useMemo as useMemo15, useRef as useRef4, useState as useState6 } from "react";
|
|
@@ -3042,9 +3023,10 @@ function useDecayState(time) {
|
|
|
3042
3023
|
}
|
|
3043
3024
|
|
|
3044
3025
|
// src/ConfigContext/ConfigEditor.tsx
|
|
3045
|
-
import { jsx as
|
|
3026
|
+
import { jsx as jsx23, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3046
3027
|
function ConfigEditor() {
|
|
3047
3028
|
const previews = usePreviewContext();
|
|
3029
|
+
const resource = useAppResource();
|
|
3048
3030
|
const config = useConfig();
|
|
3049
3031
|
const setConfig = useSaveConfig();
|
|
3050
3032
|
const [isSaved, saveState] = useDecayState(2e3);
|
|
@@ -3069,13 +3051,13 @@ function ConfigEditor() {
|
|
|
3069
3051
|
saveState.set();
|
|
3070
3052
|
saveState.clear();
|
|
3071
3053
|
}
|
|
3072
|
-
return /* @__PURE__ */
|
|
3073
|
-
/* @__PURE__ */
|
|
3074
|
-
isSaved ? /* @__PURE__ */
|
|
3075
|
-
/* @__PURE__ */
|
|
3076
|
-
/* @__PURE__ */
|
|
3077
|
-
/* @__PURE__ */
|
|
3078
|
-
/* @__PURE__ */
|
|
3054
|
+
return /* @__PURE__ */ jsxs9(Sidebar, { children: [
|
|
3055
|
+
/* @__PURE__ */ jsx23(SidebarHeader, { title: "Workspace configuration" }),
|
|
3056
|
+
isSaved ? /* @__PURE__ */ jsx23("div", { className: "bg-me-primary-500 text-white p-3 text-sm", children: "Changes saved" }) : null,
|
|
3057
|
+
/* @__PURE__ */ jsx23(SidebarContent, { className: "p-4", children: /* @__PURE__ */ jsxs9(Form.Form, { onSubmit, className: "flex flex-col gap-3", children: [
|
|
3058
|
+
/* @__PURE__ */ jsxs9(Form.InputContainer, { children: [
|
|
3059
|
+
/* @__PURE__ */ jsx23(Form.Label, { htmlFor: "defaultLanguage", children: "Default Language" }),
|
|
3060
|
+
/* @__PURE__ */ jsx23(
|
|
3079
3061
|
Form.Input,
|
|
3080
3062
|
{
|
|
3081
3063
|
type: "text",
|
|
@@ -3085,9 +3067,9 @@ function ConfigEditor() {
|
|
|
3085
3067
|
}
|
|
3086
3068
|
)
|
|
3087
3069
|
] }),
|
|
3088
|
-
/* @__PURE__ */
|
|
3089
|
-
/* @__PURE__ */
|
|
3090
|
-
/* @__PURE__ */
|
|
3070
|
+
/* @__PURE__ */ jsxs9(Form.InputContainer, { children: [
|
|
3071
|
+
/* @__PURE__ */ jsx23(Form.Label, { htmlFor: "availableLanguages", children: "Available Languages" }),
|
|
3072
|
+
/* @__PURE__ */ jsx23(
|
|
3091
3073
|
Form.Input,
|
|
3092
3074
|
{
|
|
3093
3075
|
type: "text",
|
|
@@ -3097,8 +3079,8 @@ function ConfigEditor() {
|
|
|
3097
3079
|
}
|
|
3098
3080
|
)
|
|
3099
3081
|
] }),
|
|
3100
|
-
/* @__PURE__ */
|
|
3101
|
-
/* @__PURE__ */
|
|
3082
|
+
/* @__PURE__ */ jsxs9(Form.InputContainer, { horizontal: true, className: "my-3", children: [
|
|
3083
|
+
/* @__PURE__ */ jsx23(
|
|
3102
3084
|
Form.Input,
|
|
3103
3085
|
{
|
|
3104
3086
|
type: "checkbox",
|
|
@@ -3107,10 +3089,10 @@ function ConfigEditor() {
|
|
|
3107
3089
|
defaultChecked: config.i18n?.advancedLanguageMode || false
|
|
3108
3090
|
}
|
|
3109
3091
|
),
|
|
3110
|
-
/* @__PURE__ */
|
|
3092
|
+
/* @__PURE__ */ jsx23(Form.Label, { htmlFor: "advancedLanguageMode", children: "Advanced Language Mode" })
|
|
3111
3093
|
] }),
|
|
3112
|
-
/* @__PURE__ */
|
|
3113
|
-
/* @__PURE__ */
|
|
3094
|
+
/* @__PURE__ */ jsxs9(Form.InputContainer, { horizontal: true, className: "my-3", children: [
|
|
3095
|
+
/* @__PURE__ */ jsx23(
|
|
3114
3096
|
Form.Input,
|
|
3115
3097
|
{
|
|
3116
3098
|
type: "checkbox",
|
|
@@ -3119,10 +3101,10 @@ function ConfigEditor() {
|
|
|
3119
3101
|
defaultChecked: config.i18n?.textGranularityEnabled || false
|
|
3120
3102
|
}
|
|
3121
3103
|
),
|
|
3122
|
-
/* @__PURE__ */
|
|
3104
|
+
/* @__PURE__ */ jsx23(Form.Label, { htmlFor: "textGranularityEnabled", children: "Enable text granularity" })
|
|
3123
3105
|
] }),
|
|
3124
|
-
/* @__PURE__ */
|
|
3125
|
-
/* @__PURE__ */
|
|
3106
|
+
/* @__PURE__ */ jsxs9(Form.InputContainer, { horizontal: true, className: "my-3", children: [
|
|
3107
|
+
/* @__PURE__ */ jsx23(
|
|
3126
3108
|
Form.Input,
|
|
3127
3109
|
{
|
|
3128
3110
|
type: "checkbox",
|
|
@@ -3131,16 +3113,20 @@ function ConfigEditor() {
|
|
|
3131
3113
|
defaultChecked: config.export?.version === 2
|
|
3132
3114
|
}
|
|
3133
3115
|
),
|
|
3134
|
-
/* @__PURE__ */
|
|
3116
|
+
/* @__PURE__ */ jsxs9(Form.Label, { htmlFor: "isVersion2", children: [
|
|
3117
|
+
"Export Presentation 2 ",
|
|
3118
|
+
resource.type,
|
|
3119
|
+
"s"
|
|
3120
|
+
] })
|
|
3135
3121
|
] }),
|
|
3136
|
-
/* @__PURE__ */
|
|
3137
|
-
/* @__PURE__ */
|
|
3138
|
-
/* @__PURE__ */
|
|
3122
|
+
/* @__PURE__ */ jsxs9(Form.InputContainer, { children: [
|
|
3123
|
+
/* @__PURE__ */ jsx23(Form.Label, { htmlFor: "defaultPreview", children: "Default preview" }),
|
|
3124
|
+
/* @__PURE__ */ jsx23("div", { children: previews.configs.map((preview, key) => {
|
|
3139
3125
|
if (preview.type === "iiif-preview-service") {
|
|
3140
3126
|
return null;
|
|
3141
3127
|
}
|
|
3142
|
-
return /* @__PURE__ */
|
|
3143
|
-
/* @__PURE__ */
|
|
3128
|
+
return /* @__PURE__ */ jsxs9(Form.InputContainer, { horizontal: true, children: [
|
|
3129
|
+
/* @__PURE__ */ jsx23(
|
|
3144
3130
|
Form.Input,
|
|
3145
3131
|
{
|
|
3146
3132
|
type: "radio",
|
|
@@ -3150,19 +3136,19 @@ function ConfigEditor() {
|
|
|
3150
3136
|
defaultChecked: !config.defaultPreview ? key === 0 : config.defaultPreview === preview.id
|
|
3151
3137
|
}
|
|
3152
3138
|
),
|
|
3153
|
-
/* @__PURE__ */
|
|
3139
|
+
/* @__PURE__ */ jsx23("label", { htmlFor: preview.id, children: preview.label })
|
|
3154
3140
|
] }, preview.id);
|
|
3155
3141
|
}) })
|
|
3156
3142
|
] }),
|
|
3157
|
-
/* @__PURE__ */
|
|
3143
|
+
resource.type === "Manifest" ? /* @__PURE__ */ jsx23(
|
|
3158
3144
|
"a",
|
|
3159
3145
|
{
|
|
3160
3146
|
className: "text-sm text-me-primary-500 hover:underline hover:text-me-primary-600",
|
|
3161
3147
|
href: window.location.pathname.includes("/exhibition") ? window.location.pathname.replace("/exhibition", "") || "/" : `${window.location.pathname}/exhibition`,
|
|
3162
3148
|
children: window.location.pathname.includes("/exhibition") ? "Return to Manifest Editor" : "Go to Exhibition Editor"
|
|
3163
3149
|
}
|
|
3164
|
-
),
|
|
3165
|
-
/* @__PURE__ */
|
|
3150
|
+
) : null,
|
|
3151
|
+
/* @__PURE__ */ jsx23("div", { className: "mt-5", children: /* @__PURE__ */ jsx23(ActionButton, { type: "submit", children: "Save changes" }) })
|
|
3166
3152
|
] }) })
|
|
3167
3153
|
] });
|
|
3168
3154
|
}
|
|
@@ -3180,12 +3166,12 @@ var CenterPanelContainer_default = {
|
|
|
3180
3166
|
};
|
|
3181
3167
|
|
|
3182
3168
|
// ../ui/ui/CenterPanelContainer/CenterPanelContainer.tsx
|
|
3183
|
-
import { jsx as
|
|
3169
|
+
import { jsx as jsx24, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3184
3170
|
function CenterPanelContainer(props) {
|
|
3185
|
-
return /* @__PURE__ */
|
|
3186
|
-
props.title || props.close ? /* @__PURE__ */
|
|
3187
|
-
props.title ? /* @__PURE__ */
|
|
3188
|
-
props.close ? /* @__PURE__ */
|
|
3171
|
+
return /* @__PURE__ */ jsxs10("div", { className: CenterPanelContainer_default.CenterPanelContainer, children: [
|
|
3172
|
+
props.title || props.close ? /* @__PURE__ */ jsxs10("div", { className: CenterPanelContainer_default.CenterPanelHeader, children: [
|
|
3173
|
+
props.title ? /* @__PURE__ */ jsx24("h2", { className: CenterPanelContainer_default.CenterPanelTitle, children: props.title }) : null,
|
|
3174
|
+
props.close ? /* @__PURE__ */ jsx24(Button, { className: CenterPanelContainer_default.CenterPanelClose, onClick: props.close, children: /* @__PURE__ */ jsx24(CloseIcon, {}) }) : null
|
|
3189
3175
|
] }) : null,
|
|
3190
3176
|
props.children
|
|
3191
3177
|
] });
|
|
@@ -3202,7 +3188,7 @@ import {
|
|
|
3202
3188
|
useRef as useRef5,
|
|
3203
3189
|
useState as useState7
|
|
3204
3190
|
} from "react";
|
|
3205
|
-
import { jsx as
|
|
3191
|
+
import { jsx as jsx25, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3206
3192
|
var AccordionContainer = styled7.div`
|
|
3207
3193
|
flex: 1;
|
|
3208
3194
|
display: flex;
|
|
@@ -3557,16 +3543,16 @@ var AccordionItem = forwardRef(function AccordionItem2(props, ref) {
|
|
|
3557
3543
|
setScrolled(false);
|
|
3558
3544
|
}
|
|
3559
3545
|
};
|
|
3560
|
-
return /* @__PURE__ */
|
|
3561
|
-
/* @__PURE__ */
|
|
3562
|
-
props.icon ? /* @__PURE__ */
|
|
3563
|
-
/* @__PURE__ */
|
|
3546
|
+
return /* @__PURE__ */ jsxs11(ItemRow, { "data-large": props.large, "data-open": open, children: [
|
|
3547
|
+
/* @__PURE__ */ jsxs11(ItemHeading, { "data-open": open, children: [
|
|
3548
|
+
props.icon ? /* @__PURE__ */ jsx25(ItemIcon, { onClick: toggle, children: props.icon }) : null,
|
|
3549
|
+
/* @__PURE__ */ jsxs11(ItemLabel, { ref: btn, onClick: toggle, "aria-expanded": open, "aria-controls": `accordion-${id}`, children: [
|
|
3564
3550
|
props.label,
|
|
3565
|
-
props.description ? /* @__PURE__ */
|
|
3551
|
+
props.description ? /* @__PURE__ */ jsx25(ItemDescription, { children: props.description }) : null
|
|
3566
3552
|
] }),
|
|
3567
|
-
/* @__PURE__ */
|
|
3553
|
+
/* @__PURE__ */ jsx25(ItemCollapse, { onClick: toggle, children: /* @__PURE__ */ jsx25(DownIcon, { width: "1em", height: "1em", rotate: open ? 0 : 180 }) })
|
|
3568
3554
|
] }),
|
|
3569
|
-
/* @__PURE__ */
|
|
3555
|
+
/* @__PURE__ */ jsx25(
|
|
3570
3556
|
ItemBody,
|
|
3571
3557
|
{
|
|
3572
3558
|
"aria-labelledby": `accordion-${id}`,
|
|
@@ -3578,7 +3564,7 @@ var AccordionItem = forwardRef(function AccordionItem2(props, ref) {
|
|
|
3578
3564
|
$initial: !open,
|
|
3579
3565
|
"data-scrolled": scrolled,
|
|
3580
3566
|
hidden: !open,
|
|
3581
|
-
children: /* @__PURE__ */
|
|
3567
|
+
children: /* @__PURE__ */ jsx25(ItemBodyInner, { children: /* @__PURE__ */ jsx25(
|
|
3582
3568
|
ItemBodyPadding,
|
|
3583
3569
|
{
|
|
3584
3570
|
"data-max-height": !!maxHeight,
|
|
@@ -3593,13 +3579,13 @@ var AccordionItem = forwardRef(function AccordionItem2(props, ref) {
|
|
|
3593
3579
|
});
|
|
3594
3580
|
function Accordion(props) {
|
|
3595
3581
|
const { getItemProps, onKeyDown } = useAccordionItems(props.items.length, props.singleMode);
|
|
3596
|
-
return /* @__PURE__ */
|
|
3582
|
+
return /* @__PURE__ */ jsx25(AccordionContainer, { onKeyDown, children: props.items.map((item, key) => /* @__PURE__ */ jsx25(AccordionItem, { overflow: props.overflow, maxHeight: props.maxHeight, ...item, ...getItemProps(key), children: item.children }, key)) });
|
|
3597
3583
|
}
|
|
3598
3584
|
|
|
3599
3585
|
// ../ui/icons/DownloadIcon.tsx
|
|
3600
|
-
import { jsx as
|
|
3586
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
3601
3587
|
function DownloadIcon() {
|
|
3602
|
-
return /* @__PURE__ */
|
|
3588
|
+
return /* @__PURE__ */ jsx26("svg", { xmlns: "http://www.w3.org/2000/svg", height: "48", viewBox: "0 -960 960 960", width: "48", children: /* @__PURE__ */ jsx26("path", { d: "M220-160q-24 0-42-18t-18-42v-143h60v143h520v-143h60v143q0 24-18 42t-42 18H220Zm260-153L287-506l43-43 120 120v-371h60v371l120-120 43 43-193 193Z" }) });
|
|
3603
3589
|
}
|
|
3604
3590
|
|
|
3605
3591
|
// ../ui/atoms/ButtonRow.tsx
|
|
@@ -3629,7 +3615,7 @@ var ButtonRow = styled8.div`
|
|
|
3629
3615
|
`;
|
|
3630
3616
|
|
|
3631
3617
|
// src/ExportPanel/ExportPanel.tsx
|
|
3632
|
-
import { jsx as
|
|
3618
|
+
import { jsx as jsx27, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3633
3619
|
function ExportPanel(props) {
|
|
3634
3620
|
const manifest = useManifest();
|
|
3635
3621
|
const vault = useVault7();
|
|
@@ -3640,7 +3626,7 @@ function ExportPanel(props) {
|
|
|
3640
3626
|
const version2 = useMemo17(() => {
|
|
3641
3627
|
return JSON.stringify(vault.toPresentation2(manifest), null, 2);
|
|
3642
3628
|
}, [manifest, vault]);
|
|
3643
|
-
return /* @__PURE__ */
|
|
3629
|
+
return /* @__PURE__ */ jsx27(CenterPanelContainer, { title: "Export manifest", close: actions.centerPanel.popStack, children: /* @__PURE__ */ jsx27("div", { style: { flex: 1, overflowY: "auto" }, children: /* @__PURE__ */ jsx27(
|
|
3644
3630
|
Accordion,
|
|
3645
3631
|
{
|
|
3646
3632
|
items: [
|
|
@@ -3651,12 +3637,12 @@ function ExportPanel(props) {
|
|
|
3651
3637
|
large: true,
|
|
3652
3638
|
initialOpen: true,
|
|
3653
3639
|
overflow: true,
|
|
3654
|
-
icon: /* @__PURE__ */
|
|
3655
|
-
children: /* @__PURE__ */
|
|
3656
|
-
/* @__PURE__ */
|
|
3657
|
-
/* @__PURE__ */
|
|
3658
|
-
/* @__PURE__ */
|
|
3659
|
-
/* @__PURE__ */
|
|
3640
|
+
icon: /* @__PURE__ */ jsx27(Button, { onClick: () => createDownload(version3, "manifest.json"), children: /* @__PURE__ */ jsx27(DownloadIcon, {}) }),
|
|
3641
|
+
children: /* @__PURE__ */ jsxs12("div", { style: { maxWidth: "100%" }, children: [
|
|
3642
|
+
/* @__PURE__ */ jsx27("pre", { style: { whiteSpace: "pre-wrap" }, children: JSON.stringify(vault.toPresentation3(manifest), null, 2) }),
|
|
3643
|
+
/* @__PURE__ */ jsxs12(ButtonRow, { "data-sticky": "true", children: [
|
|
3644
|
+
/* @__PURE__ */ jsx27(Button, { onClick: () => copyToClipboard(version3), children: "Copy to clipboard" }),
|
|
3645
|
+
/* @__PURE__ */ jsx27(Button, { onClick: () => createDownload(version3, "manifest.json"), children: "Download" })
|
|
3660
3646
|
] })
|
|
3661
3647
|
] })
|
|
3662
3648
|
},
|
|
@@ -3665,12 +3651,12 @@ function ExportPanel(props) {
|
|
|
3665
3651
|
description: 'Download this version by clicking the "Download" button.',
|
|
3666
3652
|
maxHeight: 400,
|
|
3667
3653
|
large: true,
|
|
3668
|
-
icon: /* @__PURE__ */
|
|
3669
|
-
children: /* @__PURE__ */
|
|
3670
|
-
/* @__PURE__ */
|
|
3671
|
-
/* @__PURE__ */
|
|
3672
|
-
/* @__PURE__ */
|
|
3673
|
-
/* @__PURE__ */
|
|
3654
|
+
icon: /* @__PURE__ */ jsx27(Button, { onClick: () => createDownload(version2, "manifest.json"), children: /* @__PURE__ */ jsx27(DownloadIcon, {}) }),
|
|
3655
|
+
children: /* @__PURE__ */ jsxs12("div", { style: { maxWidth: "100%" }, children: [
|
|
3656
|
+
/* @__PURE__ */ jsx27("pre", { style: { whiteSpace: "pre-wrap" }, children: JSON.stringify(vault.toPresentation2(manifest), null, 2) }),
|
|
3657
|
+
/* @__PURE__ */ jsxs12(ButtonRow, { "data-sticky": "true", children: [
|
|
3658
|
+
/* @__PURE__ */ jsx27(Button, { onClick: () => copyToClipboard(version2), children: "Copy to clipboard" }),
|
|
3659
|
+
/* @__PURE__ */ jsx27(Button, { onClick: () => createDownload(version2, "manifest.json"), children: "Download" })
|
|
3674
3660
|
] })
|
|
3675
3661
|
] })
|
|
3676
3662
|
}
|
|
@@ -3682,6 +3668,36 @@ function ExportPanel(props) {
|
|
|
3682
3668
|
// src/Layout/Layout.tsx
|
|
3683
3669
|
import { Modal, PanelSideMenu as PanelSideMenu2 } from "@manifest-editor/components";
|
|
3684
3670
|
|
|
3671
|
+
// ../ui/madoc/components/icons/Spinner.tsx
|
|
3672
|
+
import { jsx as jsx28, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3673
|
+
function Spinner2(props) {
|
|
3674
|
+
return /* @__PURE__ */ jsx28(
|
|
3675
|
+
"svg",
|
|
3676
|
+
{
|
|
3677
|
+
width: "1em",
|
|
3678
|
+
height: "1em",
|
|
3679
|
+
viewBox: "0 0 42 42",
|
|
3680
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3681
|
+
stroke: "currentColor",
|
|
3682
|
+
...props,
|
|
3683
|
+
children: /* @__PURE__ */ jsxs13("g", { transform: "translate(2 2)", strokeWidth: 5, fill: "none", fillRule: "evenodd", children: [
|
|
3684
|
+
/* @__PURE__ */ jsx28("circle", { strokeOpacity: 0.5, cx: 18, cy: 18, r: 18 }),
|
|
3685
|
+
/* @__PURE__ */ jsx28("path", { d: "M36 18c0-9.94-8.06-18-18-18", children: /* @__PURE__ */ jsx28(
|
|
3686
|
+
"animateTransform",
|
|
3687
|
+
{
|
|
3688
|
+
attributeName: "transform",
|
|
3689
|
+
type: "rotate",
|
|
3690
|
+
from: "0 18 18",
|
|
3691
|
+
to: "360 18 18",
|
|
3692
|
+
dur: "1s",
|
|
3693
|
+
repeatCount: "indefinite"
|
|
3694
|
+
}
|
|
3695
|
+
) })
|
|
3696
|
+
] })
|
|
3697
|
+
}
|
|
3698
|
+
);
|
|
3699
|
+
}
|
|
3700
|
+
|
|
3685
3701
|
// ../ui/ui/GhostBlocks/GhostBlocks.module.css
|
|
3686
3702
|
var GhostBlocks_default = {
|
|
3687
3703
|
ghostLoadingBlock: "GhostBlocks_ghostLoadingBlock",
|
|
@@ -4511,7 +4527,7 @@ var Layout = memo4(function Layout2(props) {
|
|
|
4511
4527
|
justifyContent: "center",
|
|
4512
4528
|
alignItems: "center"
|
|
4513
4529
|
},
|
|
4514
|
-
children: /* @__PURE__ */ jsx32(
|
|
4530
|
+
children: /* @__PURE__ */ jsx32(Spinner2, { stroke: "rgba(0,0,0,.3)", fontSize: "2em" })
|
|
4515
4531
|
}
|
|
4516
4532
|
) : state.centerPanel.open ? centerPanel ? renderHelper(
|
|
4517
4533
|
centerPanel.render(
|