@aphexcms/cms-core 2.0.7 → 2.0.9
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/cli/index.js
CHANGED
|
File without changes
|
|
@@ -1038,43 +1038,39 @@
|
|
|
1038
1038
|
<p class="text-muted-foreground text-sm">
|
|
1039
1039
|
Revision from {new Date(activePreview.createdAt || Date.now()).toLocaleString(undefined, { month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit', hour12: true })}
|
|
1040
1040
|
</p>
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
for (const field of schema.fields) {
|
|
1057
|
-
if (doc[field.name] !== undefined) {
|
|
1058
|
-
newData[field.name] = doc[field.name];
|
|
1059
|
-
}
|
|
1041
|
+
<Button
|
|
1042
|
+
size="sm"
|
|
1043
|
+
onclick={async () => {
|
|
1044
|
+
if (!documentId || !activePreview) return;
|
|
1045
|
+
try {
|
|
1046
|
+
await documents.restoreVersion(documentId, activePreview.versionNumber);
|
|
1047
|
+
const docRes = await documents.getById(documentId);
|
|
1048
|
+
if (docRes.success && docRes.data) {
|
|
1049
|
+
const doc = docRes.data as Record<string, any>;
|
|
1050
|
+
fullDocument = doc;
|
|
1051
|
+
const newData: Record<string, any> = {};
|
|
1052
|
+
if (schema) {
|
|
1053
|
+
for (const field of schema.fields) {
|
|
1054
|
+
if (doc[field.name] !== undefined) {
|
|
1055
|
+
newData[field.name] = doc[field.name];
|
|
1060
1056
|
}
|
|
1061
1057
|
}
|
|
1062
|
-
documentData = newData;
|
|
1063
|
-
hasUnsavedChanges = false;
|
|
1064
|
-
lastSaved = new Date();
|
|
1065
1058
|
}
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
toast.success('Revision restored');
|
|
1070
|
-
} catch {
|
|
1071
|
-
toast.error('Failed to restore revision');
|
|
1059
|
+
documentData = newData;
|
|
1060
|
+
hasUnsavedChanges = false;
|
|
1061
|
+
lastSaved = new Date();
|
|
1072
1062
|
}
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1063
|
+
previewingVersion = null;
|
|
1064
|
+
perspective = 'draft';
|
|
1065
|
+
publishedData = null;
|
|
1066
|
+
toast.success('Revision restored');
|
|
1067
|
+
} catch {
|
|
1068
|
+
toast.error('Failed to restore revision');
|
|
1069
|
+
}
|
|
1070
|
+
}}
|
|
1071
|
+
>
|
|
1072
|
+
Restore
|
|
1073
|
+
</Button>
|
|
1078
1074
|
</div>
|
|
1079
1075
|
{:else if isViewingPublished}
|
|
1080
1076
|
<!-- Published view footer -->
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentEditor.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/admin/DocumentEditor.svelte.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAWxD,UAAU,KAAK;IACd,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,e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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
|
|
2
|
+
"name": "@aphexcms/cms-core",
|
|
3
|
+
"version": "2.0.9",
|
|
4
|
+
"description": "Aphex CMS Core - A Sanity-style CMS with ports and adapters architecture",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public",
|
|
7
|
+
"provenance": true
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/IcelandicIcecream/aphex.git",
|
|
12
|
+
"directory": "packages/cms-core"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"svelte": "./dist/index.js",
|
|
18
|
+
"bin": {
|
|
19
|
+
"aphex": "./dist/cli/index.js"
|
|
20
|
+
},
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"svelte": "./dist/index.js",
|
|
25
|
+
"default": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./server": {
|
|
28
|
+
"types": "./dist/server/index.d.ts",
|
|
29
|
+
"default": "./dist/server/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./client": {
|
|
32
|
+
"types": "./dist/client/index.d.ts",
|
|
33
|
+
"default": "./dist/client/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./schema": {
|
|
36
|
+
"types": "./dist/schema/index.d.ts",
|
|
37
|
+
"default": "./dist/schema/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./routes/*": {
|
|
40
|
+
"types": "./dist/routes/*.d.ts",
|
|
41
|
+
"default": "./dist/routes/*.js"
|
|
42
|
+
},
|
|
43
|
+
"./*": {
|
|
44
|
+
"types": "./dist/*.d.ts",
|
|
45
|
+
"default": "./dist/*.js"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"files": [
|
|
49
|
+
"dist",
|
|
50
|
+
"dist/cli"
|
|
51
|
+
],
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "svelte-package && tsc && node ../../scripts/fix-imports.js ./dist",
|
|
54
|
+
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
55
|
+
"format": "prettier --write .",
|
|
56
|
+
"lint": "prettier --check . && eslint .",
|
|
57
|
+
"package": "pnpm build && pnpm pack",
|
|
58
|
+
"dev:local": "node ../../scripts/swap-package-paths.js ./package.json src lib",
|
|
59
|
+
"prepack": "node ../../scripts/swap-package-paths.js ./package.json dist lib",
|
|
60
|
+
"postpack": "node ../../scripts/swap-package-paths.js ./package.json src lib"
|
|
61
|
+
},
|
|
62
|
+
"keywords": [
|
|
63
|
+
"cms",
|
|
64
|
+
"svelte",
|
|
65
|
+
"sveltekit",
|
|
66
|
+
"content-management",
|
|
67
|
+
"sanity-style",
|
|
68
|
+
"typescript",
|
|
69
|
+
"aphex"
|
|
70
|
+
],
|
|
71
|
+
"author": "Benjamin Sinidol",
|
|
72
|
+
"license": "MIT",
|
|
73
|
+
"peerDependencies": {
|
|
74
|
+
"@aphexcms/ui": "workspace:*",
|
|
75
|
+
"@envelop/graphql-jit": "^11.0.0",
|
|
76
|
+
"@graphql-yoga/render-graphiql": "^5.16.2",
|
|
77
|
+
"@lucide/svelte": "^0.554.0",
|
|
78
|
+
"@sveltejs/kit": "^2.49.0",
|
|
79
|
+
"bits-ui": "^2.14.4",
|
|
80
|
+
"clsx": "^2.1.1",
|
|
81
|
+
"graphql": "^16.12.0",
|
|
82
|
+
"graphql-yoga": "^5.16.2",
|
|
83
|
+
"mode-watcher": "^1.1.0",
|
|
84
|
+
"svelte": "^5.44.0",
|
|
85
|
+
"tailwind-merge": "^3.4.0",
|
|
86
|
+
"tailwind-variants": "^3.2.2"
|
|
87
|
+
},
|
|
88
|
+
"peerDependenciesMeta": {
|
|
89
|
+
"graphql": {
|
|
90
|
+
"optional": true
|
|
91
|
+
},
|
|
92
|
+
"graphql-yoga": {
|
|
93
|
+
"optional": true
|
|
94
|
+
},
|
|
95
|
+
"@envelop/graphql-jit": {
|
|
96
|
+
"optional": true
|
|
97
|
+
},
|
|
98
|
+
"@graphql-yoga/render-graphiql": {
|
|
99
|
+
"optional": true
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"dependencies": {
|
|
103
|
+
"@clack/prompts": "^0.11.0",
|
|
104
|
+
"@dnd-kit/helpers": "^0.3.0",
|
|
105
|
+
"@dnd-kit/svelte": "^0.3.0",
|
|
106
|
+
"cac": "^6.7.14",
|
|
107
|
+
"dayjs": "^1.11.19",
|
|
108
|
+
"esbuild": "^0.27.0",
|
|
109
|
+
"picocolors": "^1.1.1",
|
|
110
|
+
"s3mini": "^0.7.0",
|
|
111
|
+
"sharp": "^0.34.5",
|
|
112
|
+
"svelte-sonner": "^1.0.7",
|
|
113
|
+
"tsx": "^4.20.6"
|
|
114
|
+
},
|
|
115
|
+
"devDependencies": {
|
|
116
|
+
"@eslint/compat": "^2.0.0",
|
|
117
|
+
"@eslint/js": "^9.39.1",
|
|
118
|
+
"@internationalized/date": "^3.10.0",
|
|
119
|
+
"@sveltejs/adapter-auto": "^7.0.0",
|
|
120
|
+
"@sveltejs/kit": "^2.49.0",
|
|
121
|
+
"@sveltejs/package": "^2.5.6",
|
|
122
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
123
|
+
"@tailwindcss/vite": "^4.1.17",
|
|
124
|
+
"@types/node": "^22.0.0",
|
|
125
|
+
"eslint": "^9.39.1",
|
|
126
|
+
"eslint-config-prettier": "^10.1.8",
|
|
127
|
+
"eslint-plugin-svelte": "^3.13.0",
|
|
128
|
+
"globals": "^16.5.0",
|
|
129
|
+
"prettier": "^3.6.2",
|
|
130
|
+
"prettier-plugin-svelte": "^3.4.0",
|
|
131
|
+
"prettier-plugin-tailwindcss": "^0.7.1",
|
|
132
|
+
"svelte": "^5.44.0",
|
|
133
|
+
"svelte-check": "^4.3.4",
|
|
134
|
+
"tailwindcss": "^4.1.17",
|
|
135
|
+
"typescript": "^5.9.3",
|
|
136
|
+
"typescript-eslint": "^8.48.0",
|
|
137
|
+
"vite": "^7.2.4"
|
|
138
|
+
}
|
|
139
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Benjamin Sinidol
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|