@aphexcms/cms-core 2.0.7 → 2.0.8

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.
@@ -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
- {#if fullDocument?._meta?.publishedHash && fullDocument?._meta?.status !== 'unpublished'}
1042
- <p class="text-muted-foreground text-xs">Unpublish first to restore</p>
1043
- {:else}
1044
- <Button
1045
- size="sm"
1046
- onclick={async () => {
1047
- if (!documentId || !activePreview) return;
1048
- try {
1049
- await documents.restoreVersion(documentId, activePreview.versionNumber);
1050
- const docRes = await documents.getById(documentId);
1051
- if (docRes.success && docRes.data) {
1052
- const doc = docRes.data as Record<string, any>;
1053
- fullDocument = doc;
1054
- const newData: Record<string, any> = {};
1055
- if (schema) {
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
- previewingVersion = null;
1067
- perspective = 'draft';
1068
- publishedData = null;
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
- Restore
1076
- </Button>
1077
- {/if}
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,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACrE,oBAAoB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,sBAAsB,CAAC,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QA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GAAG,IAAI,CAAC;IAC5H,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAkrCF,QAAA,MAAM,cAAc,2CAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aphexcms/cms-core",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "Aphex CMS Core - A Sanity-style CMS with ports and adapters architecture",
5
5
  "publishConfig": {
6
6
  "access": "public",