@airdraft/react-ui 0.1.29 → 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 CHANGED
@@ -2,6 +2,35 @@
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
+
12
+ ### [0.1.30](https://github.com/aevrHQ/airdraft/compare/react-ui@v0.1.28...react-ui@v0.1.30) (2026-06-25)
13
+
14
+
15
+ ### Features
16
+
17
+ * **adapter:** update write methods to return WriteResult with SHA ([0515041](https://github.com/aevrHQ/airdraft/commit/0515041b9c92e035271e175b1fcccbbc430a730a))
18
+ * **auth:** update access token TTL to 4 hours and implement proactive token refresh in client ([8b2f5c9](https://github.com/aevrHQ/airdraft/commit/8b2f5c9dfd6bba054526b978104a0aa2d55e2e06))
19
+ * **auth:** update authentication flow to include token expiration handling and return CmsAuthResult ([62e8522](https://github.com/aevrHQ/airdraft/commit/62e85222be41822422c527635b6d7d263d9188be))
20
+ * **cli:** enhance project initialization with git root and package manager detection ([34f9312](https://github.com/aevrHQ/airdraft/commit/34f9312e58ac6cb85d6e0aa6c093f7a87743f6ce))
21
+ * **cloud-auth:** add README for cloud authentication adapter interface and usage examples ([2791323](https://github.com/aevrHQ/airdraft/commit/279132312ae619dbc9d788024827639bb4fd7575))
22
+ * **invite:** add member management features and role updates ([95d9703](https://github.com/aevrHQ/airdraft/commit/95d9703b927c5f963958a3dcea3abf8e7cb22168))
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **client,react:** embed expiresAt on CmsUser for backward compat ([d7ede8a](https://github.com/aevrHQ/airdraft/commit/d7ede8a018b8dc8f0ebfec835d1349eb5cc64384))
28
+ * **cli:** improve config file detection for user creation process ([590738b](https://github.com/aevrHQ/airdraft/commit/590738bbcaf26c9205d7dda534056c9c3c093b78))
29
+ * **cloud:** update @airdraft/core dependency version and increment package versions ([1906531](https://github.com/aevrHQ/airdraft/commit/1906531a7e75a2712fdb9290c45638df502baef9))
30
+ * **cloud:** update version to 0.1.16 in package.json and package-lock.json ([1f75756](https://github.com/aevrHQ/airdraft/commit/1f757569b0eaf817a5c09d2331e5da07288119e2))
31
+ * **dependencies:** update package versions for auth, client, plugin-auth, react, and react-ui ([3657bfa](https://github.com/aevrHQ/airdraft/commit/3657bfaa102aaf5d970615de8bf6a8dc479a207a))
32
+ * **react-ui:** defensive optional chaining on user.email in CmsAdminHeader ([2934f0f](https://github.com/aevrHQ/airdraft/commit/2934f0f4e2349d5d3652d80c331f24c530e5c9df))
33
+
5
34
  ### [0.1.28](https://github.com/aevrHQ/airdraft/compare/react-ui@v0.1.25...react-ui@v0.1.28) (2026-06-03)
6
35
 
7
36
 
@@ -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-2xl", children: [Object.entries(fields)
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@airdraft/react-ui",
3
- "version": "0.1.29",
3
+ "version": "0.1.31",
4
4
  "description": "Airdraft React UI — schema editor and team management components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",