manifest-editor 1.4.2 → 2.0.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.css","names":[],"sources":["../src/index.css"],"sourcesContent":["export default undefined;"],"mappings":"AAAA"}
package/dist/index.d.cts CHANGED
@@ -1,15 +1,17 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { Vault } from '@iiif/helpers';
3
- import { Manifest, Collection } from '@iiif/presentation-3';
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import { Vault } from "@iiif/helpers";
3
+ import { Collection, Manifest } from "@iiif/presentation-3";
4
4
 
5
+ //#region src/ManifestEditor.d.ts
5
6
  interface ManifestEditorProps {
6
- resource: {
7
- id: string;
8
- type: "Manifest" | "Collection";
9
- };
10
- data?: Manifest | Collection;
11
- vault?: Vault;
7
+ resource: {
8
+ id: string;
9
+ type: "Manifest" | "Collection";
10
+ };
11
+ data?: Manifest | Collection;
12
+ vault?: Vault;
12
13
  }
13
- declare function ManifestEditor(props: ManifestEditorProps): react_jsx_runtime.JSX.Element | null;
14
-
14
+ declare function ManifestEditor(props: ManifestEditorProps): react_jsx_runtime0.JSX.Element | null;
15
+ //#endregion
15
16
  export { ManifestEditor };
17
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/ManifestEditor.tsx"],"sourcesContent":[],"mappings":";;;;;UAUU,mBAAA;;;IAAA,IAAA,EAAA,UAAA,GAAmB,YAAA;EAEpB,CAAA;EAAW,IAAA,CAAA,EAAX,QAAW,GAAA,UAAA;EACV,KAAA,CAAA,EAAA,KAAA;;AAUM,iBAAA,cAAA,CAAsB,KAAA,EAAA,mBAAmB,CAAA,EAAA,kBAAA,CAAA,GAAA,CAAA,OAAA,GAAA,IAAA"}
package/dist/index.d.ts CHANGED
@@ -1,15 +1,17 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { Vault } from '@iiif/helpers';
3
- import { Manifest, Collection } from '@iiif/presentation-3';
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import { Vault } from "@iiif/helpers";
3
+ import { Collection, Manifest } from "@iiif/presentation-3";
4
4
 
5
+ //#region src/ManifestEditor.d.ts
5
6
  interface ManifestEditorProps {
6
- resource: {
7
- id: string;
8
- type: "Manifest" | "Collection";
9
- };
10
- data?: Manifest | Collection;
11
- vault?: Vault;
7
+ resource: {
8
+ id: string;
9
+ type: "Manifest" | "Collection";
10
+ };
11
+ data?: Manifest | Collection;
12
+ vault?: Vault;
12
13
  }
13
- declare function ManifestEditor(props: ManifestEditorProps): react_jsx_runtime.JSX.Element | null;
14
-
14
+ declare function ManifestEditor(props: ManifestEditorProps): react_jsx_runtime0.JSX.Element | null;
15
+ //#endregion
15
16
  export { ManifestEditor };
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/ManifestEditor.tsx"],"sourcesContent":[],"mappings":";;;;;UAUU,mBAAA;;;IAAA,IAAA,EAAA,UAAA,GAAmB,YAAA;EAEpB,CAAA;EAAW,IAAA,CAAA,EAAX,QAAW,GAAA,UAAA;EACV,KAAA,CAAA,EAAA,KAAA;;AAUM,iBAAA,cAAA,CAAsB,KAAA,EAAA,mBAAmB,CAAA,EAAA,kBAAA,CAAA,GAAA,CAAA,OAAA,GAAA,IAAA"}
package/dist/index.js CHANGED
@@ -1,48 +1,2 @@
1
- // src/ManifestEditor.tsx
2
- import { collectionPreset } from "@manifest-editor/collection-preset";
3
- import * as manifestEditorPreset from "@manifest-editor/manifest-preset";
4
- import { AppProvider, Layout, ShellProvider, mapApp } from "@manifest-editor/shell";
5
- import { VaultProvider, useExistingVault } from "react-iiif-vault";
6
-
7
- // ../../node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js
8
- var isProduction = false;
9
- var prefix = "Invariant failed";
10
- function invariant(condition, message) {
11
- if (condition) {
12
- return;
13
- }
14
- if (isProduction) {
15
- throw new Error(prefix);
16
- }
17
- var provided = typeof message === "function" ? message() : message;
18
- var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
19
- throw new Error(value);
20
- }
21
-
22
- // src/ManifestEditor.tsx
23
- import { jsx } from "react/jsx-runtime";
24
- var manifestEditor = mapApp(manifestEditorPreset);
25
- function ManifestEditor(props) {
26
- const vault = useExistingVault(props.vault);
27
- invariant(props.resource);
28
- invariant(props.data, "Data is required");
29
- if (!vault.requestStatus(props.resource.id)) {
30
- vault.loadManifestSync(props.resource.id, props.data);
31
- }
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, {}) }) }) });
45
- }
46
- export {
47
- ManifestEditor
48
- };
1
+ import{collectionPreset as e}from"@manifest-editor/collection-preset";import*as t from"@manifest-editor/manifest-preset";import{AppProvider as n,Layout as r,ShellProvider as i,mapApp as a}from"@manifest-editor/shell";import{VaultProvider as o,useExistingVault as s}from"react-iiif-vault";import{jsx as c}from"react/jsx-runtime";var l=!0,u=`Invariant failed`;function d(e,t){if(!e){if(l)throw Error(u);var n=typeof t==`function`?t():t,r=n?`${u}: ${n}`:u;throw Error(r)}}const f=a(t);function p(t){let a=s(t.vault);d(t.resource),d(t.data,`Data is required`),a.requestStatus(t.resource.id)||a.loadManifestSync(t.resource.id,t.data);let l=null,u=null;return t.resource.type===`Manifest`?(l=f,u=f.metadata.id):t.resource.type===`Collection`&&(l=e,u=e.metadata.id),l===null||u===null?null:c(n,{appId:u,definition:l,instanceId:`test-1`,children:c(o,{vault:a,children:c(i,{resource:t.resource,children:c(r,{})})})})}export{p as ManifestEditor};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js","../src/ManifestEditor.tsx"],"sourcesContent":["var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","import type { Vault } from \"@iiif/helpers\";\nimport type { Collection, Manifest } from \"@iiif/presentation-3\";\nimport { collectionPreset } from \"@manifest-editor/collection-preset\";\nimport * as manifestEditorPreset from \"@manifest-editor/manifest-preset\";\nimport { AppProvider, Layout, ShellProvider, mapApp } from \"@manifest-editor/shell\";\nimport { VaultProvider, useExistingVault } from \"react-iiif-vault\";\nimport invariant from \"tiny-invariant\";\n\nconst manifestEditor = mapApp(manifestEditorPreset);\n\ninterface ManifestEditorProps {\n resource: { id: string; type: \"Manifest\" | \"Collection\" };\n data?: Manifest | Collection;\n vault?: Vault;\n\n // // Future bits.\n // onChange?: (resource: { id: string; type: \"Manifest\" | \"Collection\" }, vault: Vault) => void;\n // onSave?: (data: Manifest | Collection) => void;\n // config?: any;\n // appState?: any;\n // previews?: PreviewConfiguration[];\n}\n\nexport function ManifestEditor(props: ManifestEditorProps) {\n const vault = useExistingVault(props.vault);\n\n invariant(props.resource);\n invariant(props.data, \"Data is required\");\n\n if (!vault.requestStatus(props.resource.id)) {\n vault.loadManifestSync(props.resource.id, props.data);\n }\n\n let preset = null;\n let appId = null;\n\n if (props.resource.type === \"Manifest\") {\n preset = manifestEditor;\n appId = manifestEditor.metadata.id;\n } else if (props.resource.type === \"Collection\") {\n preset = collectionPreset;\n appId = collectionPreset.metadata.id;\n }\n\n if (preset === null || appId === null) {\n return null;\n }\n\n return (\n <AppProvider appId={appId} definition={preset} instanceId=\"test-1\">\n <VaultProvider vault={vault}>\n <ShellProvider resource={props.resource}>\n <Layout />\n </ShellProvider>\n </VaultProvider>\n </AppProvider>\n );\n}\n"],"x_google_ignoreList":[0],"mappings":"wUAAA,IAAI,EAAe,GACf,EAAS,mBACb,SAAS,EAAU,EAAW,EAAS,CAC/B,MAGJ,IAAI,EACA,MAAU,MAAM,EAAO,CAE3B,IAAI,EAAW,OAAO,GAAY,WAAa,GAAS,CAAG,EACvD,EAAQ,EAAW,GAAU,MAAqB,IAAY,EAClE,MAAU,MAAM,EAAM,ECH1B,MAAM,EAAiB,EAAO,EAAqB,CAenD,SAAgB,EAAe,EAA4B,CACzD,IAAM,EAAQ,EAAiB,EAAM,MAAM,CAE3C,EAAU,EAAM,SAAS,CACzB,EAAU,EAAM,KAAM,mBAAmB,CAEpC,EAAM,cAAc,EAAM,SAAS,GAAG,EACzC,EAAM,iBAAiB,EAAM,SAAS,GAAI,EAAM,KAAK,CAGvD,IAAI,EAAS,KACT,EAAQ,KAcZ,OAZI,EAAM,SAAS,OAAS,YAC1B,EAAS,EACT,EAAQ,EAAe,SAAS,IACvB,EAAM,SAAS,OAAS,eACjC,EAAS,EACT,EAAQ,EAAiB,SAAS,IAGhC,IAAW,MAAQ,IAAU,KACxB,KAIP,EAAC,EAAA,CAAmB,QAAO,WAAY,EAAQ,WAAW,kBACxD,EAAC,EAAA,CAAqB,iBACpB,EAAC,EAAA,CAAc,SAAU,EAAM,kBAC7B,EAAC,EAAA,EAAA,CAAS,EACI,EACF,EACJ"}
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "manifest-editor",
3
- "version": "1.4.2",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
5
  "bugs": "https://github.com/digirati-co-uk/iiif-manifest-editor/issues",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/digirati-co-uk/iiif-manifest-editor.git",
8
+ "url": "git+https://github.com/digirati-co-uk/iiif-manifest-editor.git",
9
9
  "directory": "packages/manifest-editor"
10
10
  },
11
11
  "engines": {
@@ -18,59 +18,53 @@
18
18
  ],
19
19
  "main": "./dist/index.cjs",
20
20
  "module": "./dist/index.js",
21
- "types": "./dist/index.d.ts",
21
+ "types": "./dist/index.d.cts",
22
22
  "files": [
23
23
  "dist",
24
24
  "reset.css"
25
25
  ],
26
26
  "exports": {
27
27
  ".": {
28
- "import": {
29
- "types": "./dist/index.d.ts",
30
- "default": "./dist/index.js"
31
- },
32
- "require": {
33
- "types": "./dist/index.d.cts",
34
- "default": "./dist/index.cjs"
35
- }
28
+ "import": "./dist/index.js",
29
+ "require": "./dist/index.cjs"
36
30
  },
37
- "./dist/index.css": "./dist/index.css",
38
- "./reset.css": "./reset.css"
31
+ "./package.json": "./package.json",
32
+ "./dist/index.css": "./dist/index.css"
39
33
  },
40
34
  "scripts": {
41
- "build": "tsup src/index.ts",
42
- "dev": "tsup src/index.ts --watch",
35
+ "build": "tsdown src/index.ts",
36
+ "dev": "tsdown src/index.ts --watch",
43
37
  "lint": "publint",
44
38
  "typecheck": "tsc --noEmit",
45
- "prepack": "tsup src/index.ts"
39
+ "prepack": "tsdown src/index.ts"
46
40
  },
47
41
  "dependencies": {
48
- "@iiif/helpers": "^1.3.1",
49
- "@iiif/parser": "^2.1.8",
42
+ "@iiif/helpers": "1.5.7",
43
+ "@iiif/parser": "2.2.8",
50
44
  "@iiif/presentation-3": "^2.2.3",
51
45
  "@iiif/presentation-3-normalized": "^0.9.7",
52
- "@manifest-editor/collection-preset": "1.4.2",
53
- "@manifest-editor/components": "1.4.2",
54
- "@manifest-editor/editors": "1.4.2",
55
- "@manifest-editor/iiif-browser": "1.4.1",
56
- "@manifest-editor/manifest-preset": "1.4.2",
57
- "@manifest-editor/shell": "1.4.2",
58
- "react": "^18.3.1",
59
- "react-dom": "^18.3.1",
60
- "react-iiif-vault": "^1.2.1"
46
+ "@manifest-editor/collection-preset": "2.0.0",
47
+ "@manifest-editor/components": "2.0.0",
48
+ "@manifest-editor/editors": "2.0.0",
49
+ "@manifest-editor/manifest-preset": "2.0.0",
50
+ "@manifest-editor/shell": "2.0.0",
51
+ "react": "19.2.0",
52
+ "react-dom": "19.2.0",
53
+ "react-iiif-vault": "2.0.6"
61
54
  },
62
55
  "devDependencies": {
63
- "@manifest-editor/ui": "1.0.0",
64
- "@repo/eslint-config": "workspace:*",
56
+ "@manifest-editor/ui": "2.0.0",
57
+ "@repo/eslint-config": "",
65
58
  "@types/react": "^18.3.3",
66
59
  "@types/react-dom": "^18.3.0",
67
60
  "postcss": "^8.4.38",
68
61
  "postcss-import": "^16.1.0",
62
+ "rollup-plugin-postcss": "^4.0.2",
69
63
  "tiny-invariant": "^1.3.3",
70
- "tsup": "^8.0.2"
64
+ "tsdown": "0.16.4"
71
65
  },
72
66
  "publishConfig": {
73
67
  "access": "public"
74
68
  },
75
- "gitHead": "7da90acfb83545d53d34ba95b86c8d5492005e81"
69
+ "gitHead": "0baa971edfd5c47a0c492ccfd3e836fb1345a038"
76
70
  }