@airdraft/react-ui 0.1.30 → 0.1.31
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/CHANGELOG.md +7 -0
- package/dist/EntryEditor.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.1.31](https://github.com/aevrHQ/airdraft/compare/react-ui@v0.1.30...react-ui@v0.1.31) (2026-06-25)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Code Refactoring
|
|
9
|
+
|
|
10
|
+
* **core:** improve GitHubAdapter invalidate cache logic ([3be9320](https://github.com/aevrHQ/airdraft/commit/3be93201bd88a84d46d3582738fbe23cb0c2581e))
|
|
11
|
+
|
|
5
12
|
### [0.1.30](https://github.com/aevrHQ/airdraft/compare/react-ui@v0.1.28...react-ui@v0.1.30) (2026-06-25)
|
|
6
13
|
|
|
7
14
|
|
package/dist/EntryEditor.js
CHANGED
|
@@ -480,7 +480,7 @@ export function EntryEditor({ collection, slug, onBack, className }) {
|
|
|
480
480
|
const hasRichText = Object.values(fields).some((f) => f.type === 'rich-text');
|
|
481
481
|
const title = String(entry?.data?.['title'] ?? entry?.data?.['name'] ?? slug);
|
|
482
482
|
const collectionLabel = schema?.label ?? collection;
|
|
483
|
-
return (_jsxs("div", { className: className, children: [_jsx(PageHeader, { title: loading ? '…' : title, description: `${collectionLabel} / ${slug}`, actions: _jsxs("div", { className: "flex items-center gap-2", children: [!loading && hasRichText && _jsx(EditorModeToggle, {}), onBack && (_jsx(Button, { variant: "outline", size: "sm", onClick: onBack, children: "\u2190 Back" }))] }) }), loading && (_jsx("div", { className: "flex justify-center py-10 mt-6", children: _jsx(Loader, {}) })), !loading && entryError && (_jsx(ErrorAlert, { error: entryError, title: "Failed to load entry", className: "mt-6" })), !loading && !entryError && entry && (_jsxs(_Fragment, { children: [hasDraft && (_jsxs("div", { className: "mt-6 flex items-center gap-3 rounded-lg border border-blue-500/40 bg-blue-500/10 px-4 py-3 text-sm", children: [_jsxs("p", { className: "flex-1 text-blue-700 dark:text-blue-400 text-xs", children: ["You have unsaved changes from ", draftTime, "."] }), _jsxs("div", { className: "flex gap-2 shrink-0", children: [_jsx(Button, { type: "button", size: "sm", variant: "outline", onClick: restoreDraft, children: "Restore draft" }), _jsx(Button, { type: "button", size: "sm", variant: "ghost", onClick: discardDraft, children: "Discard" })] })] })), conflict && (_jsxs("div", { className: "mt-6 flex items-start gap-3 rounded-lg border border-amber-500/40 bg-amber-500/10 px-4 py-3 text-sm", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-500" }), _jsxs("div", { className: "flex-1", children: [_jsx("p", { className: "font-medium text-amber-700 dark:text-amber-400", children: "Conflict detected" }), _jsx("p", { className: "text-muted-foreground text-xs mt-0.5", children: "This entry was updated by someone else. Reload to get the latest version before saving." })] }), _jsxs(Button, { type: "button", size: "sm", variant: "outline", className: "shrink-0 border-amber-500/40 text-amber-700 hover:bg-amber-500/10 dark:text-amber-400", onClick: () => { refresh(); }, children: [_jsx(RefreshCw, { className: "mr-1.5 h-3.5 w-3.5" }), "Reload"] })] })), _jsxs("form", { onSubmit: handleSave, className: "mt-6 space-y-5 max-w-
|
|
483
|
+
return (_jsxs("div", { className: className, children: [_jsx(PageHeader, { title: loading ? '…' : title, description: `${collectionLabel} / ${slug}`, actions: _jsxs("div", { className: "flex items-center gap-2", children: [!loading && hasRichText && _jsx(EditorModeToggle, {}), onBack && (_jsx(Button, { variant: "outline", size: "sm", onClick: onBack, children: "\u2190 Back" }))] }) }), loading && (_jsx("div", { className: "flex justify-center py-10 mt-6", children: _jsx(Loader, {}) })), !loading && entryError && (_jsx(ErrorAlert, { error: entryError, title: "Failed to load entry", className: "mt-6" })), !loading && !entryError && entry && (_jsxs(_Fragment, { children: [hasDraft && (_jsxs("div", { className: "mt-6 flex items-center gap-3 rounded-lg border border-blue-500/40 bg-blue-500/10 px-4 py-3 text-sm", children: [_jsxs("p", { className: "flex-1 text-blue-700 dark:text-blue-400 text-xs", children: ["You have unsaved changes from ", draftTime, "."] }), _jsxs("div", { className: "flex gap-2 shrink-0", children: [_jsx(Button, { type: "button", size: "sm", variant: "outline", onClick: restoreDraft, children: "Restore draft" }), _jsx(Button, { type: "button", size: "sm", variant: "ghost", onClick: discardDraft, children: "Discard" })] })] })), conflict && (_jsxs("div", { className: "mt-6 flex items-start gap-3 rounded-lg border border-amber-500/40 bg-amber-500/10 px-4 py-3 text-sm", children: [_jsx(AlertTriangle, { className: "mt-0.5 h-4 w-4 shrink-0 text-amber-500" }), _jsxs("div", { className: "flex-1", children: [_jsx("p", { className: "font-medium text-amber-700 dark:text-amber-400", children: "Conflict detected" }), _jsx("p", { className: "text-muted-foreground text-xs mt-0.5", children: "This entry was updated by someone else. Reload to get the latest version before saving." })] }), _jsxs(Button, { type: "button", size: "sm", variant: "outline", className: "shrink-0 border-amber-500/40 text-amber-700 hover:bg-amber-500/10 dark:text-amber-400", onClick: () => { refresh(); }, children: [_jsx(RefreshCw, { className: "mr-1.5 h-3.5 w-3.5" }), "Reload"] })] })), _jsxs("form", { onSubmit: handleSave, className: "mt-6 space-y-5 max-w-4xl", children: [Object.entries(fields)
|
|
484
484
|
.filter(([, cfg]) => !cfg.hidden)
|
|
485
485
|
.map(([name, cfg]) => (_jsx(FieldInput, { name: name, config: cfg, value: form[name], onChange: handleChange, uploadImage: uploadImage }, name))), schema?.publish && (_jsx(PublishSection, { published: Boolean(form['published']), publishedAt: form['publishedAt'] ?? entry.publishedAt ?? null, onPublishedChange: (v) => handleChange('published', v), onPublishedAtChange: (v) => handleChange('publishedAt', v) })), _jsxs("div", { className: "flex items-center gap-3 pt-4", children: [_jsxs(Button, { type: "submit", disabled: updating, children: [_jsx(Loader, { loading: updating, className: "size-3.5" }), updating ? 'Saving…' : 'Save changes'] }), saved && !updating && (_jsx("span", { className: "text-sm text-green-600", children: "Saved" })), mutError && !conflict && (_jsx(ErrorAlert, { error: mutError, title: "Save failed", compact: true }))] })] })] }))] }));
|
|
486
486
|
}
|