efficient-web-builder 74.5.0 → 74.6.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.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 74.6.0 - 2026-11-22
|
|
4
|
+
|
|
5
|
+
From main at `ca2a3c7d`.
|
|
6
|
+
|
|
7
|
+
A minor: accept efficient-shell 15. The peer range widens to `^14.5.1 || ^15.0.0` and the repository builds against `^15.1.0`. No new peer, no removed path, no stored key or value moves.
|
|
8
|
+
|
|
9
|
+
**For hosts:**
|
|
10
|
+
- No step on shell 14. A host may now pin efficient-shell `^15.1.0` (admin-portal next). efficient-easel 37.3.x still peers on `^13.23.1 || ^14.0.0`, so a host on shell 15 sees easel's peer warning until easel widens too.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- **Version history is a centred popup.** efficient-shell 15.0.0 took the side `Drawer` away (`side`, `size`, `DrawerSize`; harness UI-20: a popup never slides in from the side). The Publish menu's Version history, the builder's one side drawer, is now the shell's `Dialog` at `size="xl"`, centred on the editor, its list scrolling inside it. Same title, lines, rows and Restore; on shell 14 it draws the same. `components/VersionHistoryDrawer` keeps its name and path.
|
|
15
|
+
|
|
3
16
|
## 74.5.0 - 2026-11-22
|
|
4
17
|
|
|
5
18
|
From main at `2a217a08`: #834.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as u,Fragment as N}from"react/jsx-runtime";import{useCallback as q,useEffect as J,useId as
|
|
1
|
+
"use client";import{jsx as e,jsxs as u,Fragment as N}from"react/jsx-runtime";import{useCallback as q,useEffect as J,useId as D,useRef as Q,useState as p}from"react";import{useSettledAction as X}from"efficient-easel/easel";import{Avatar as Z,Banner as S,Button as k,ColoredBadge as z,Dialog as E,DropdownMenu as ee,FormField as H,iconButtonClasses as ne,Inline as F,Input as te,ListRow as re,Select as oe,SortableList as se,Stack as P}from"efficient-shell/ui";import{EditIcon as ae,EyeIcon as Y,MenuIcon as ie,MoreIcon as le,PageIcon as j,RevertIcon as A,StylesIcon as ce}from"efficient-shell/icons/efficient";import{useScreenDocument as M}from"efficient-easel/screen/components/ScreenDocumentContext";import{say as n,sayCount as G}from"../../format/lib/editor-words.js";import{useSiteLiveState as de}from"../lib/site-live-state.js";import{changeLine as ue,closeVersionHistory as he,HeldEditsNotSaved as pe,changesSummary as ge,restoreSiteVersion as fe,useVersionHistoryOpen as me,versionTitle as ye,versionWhen as we}from"../lib/site-versions.js";const be={page:j,menu:ie};function ve(t,o){return t.pages.find(r=>r.id===o)??t.pages[0]??null}function ke(t,o){const r=window.open("","_blank");if(r)try{r.opener=null}catch{}return t.preview(o).then(({url:a})=>{r&&!r.closed?r.location.href=a:window.open(a,"_blank","noopener,noreferrer")},a=>{throw r?.close(),a})}function Ce({version:t,page:o,waiting:r,busy:a,error:g,onCancel:b,onConfirm:y,onPage:i}){const l=D();if(!t)return null;const f=t.kind==="draft_before_restore",c=t.number,d=ge(t),v=f?n("Put your drafts back?"):o?n("Restore {page} from version {n}?",{page:o.name,n:c}):n("Restore version {n}?",{n:c}),m=f?n("Your drafts go back to how they were before the restore."):o?n("{page} goes back to version {n} as a draft. Nothing else on your website changes.",{page:o.name,n:c}):d?n("The whole website goes back to version {n} as a draft: {what}.",{n:c,what:d}):n("The whole website goes back to version {n} as a draft.",{n:c}),h=t.deletedPictures??0;return e(E,{open:!0,onClose:()=>{a||b()},size:"sm",title:v,footer:u(N,{children:[e(k,{variant:"secondary",onClick:b,disabled:a,children:n("Cancel")}),e(k,{onClick:y,loading:a,disabled:a,children:n("Restore as draft")})]}),children:u(P,{gap:4,children:[o&&t.pages.length>1?e(H,{label:n("Page"),htmlFor:l,children:e(oe,{id:l,value:o.id,options:t.pages.map(C=>({value:C.id,label:C.name})),onChange:i,disabled:a})}):null,e("p",{children:m}),e("p",{children:n("Your live website does not change until you press Publish.")}),h>0?e(S,{tone:"warning",children:G("{n} picture in this version was deleted from the media library. It stays empty.","{n} pictures in this version were deleted from the media library. They stay empty.",h)}):null,r?e(S,{tone:"info",title:n("Your unpublished changes are kept"),children:n("They are saved in Version history as “Draft before restore”, so you can get them back.")}):null,g?e(S,{tone:"danger",children:g}):null]})})}function Ne({version:t,onCancel:o,onSave:r}){const a=D(),[g,b]=p(null),[y,i]=p(""),[l,f]=p(!1),[c,d]=p(null);if(t!==g&&(b(t),i(t?.name??""),d(null)),!t)return null;const v=y.trim()===t.name,m=async()=>{if(!(l||v)){f(!0),d(null);try{await r(y.trim())}catch{d(n("The name was not saved. Try again."))}finally{f(!1)}}};return e(E,{open:!0,onClose:()=>{l||o()},size:"sm",title:n("Name this version"),footer:u(N,{children:[e(k,{variant:"secondary",onClick:o,disabled:l,children:n("Cancel")}),e(k,{onClick:()=>{m()},loading:l,disabled:l||v,children:n("Save")})]}),children:e(H,{label:n("Name"),htmlFor:a,hint:n("Named versions are always kept. Leave it empty to take the name away."),error:c??void 0,children:e(te,{id:a,value:y,invalid:!!c,onChange:h=>i(h.target.value),onKeyDown:h=>{h.key==="Enter"&&m()}})})})}function Se({version:t,expanded:o,onToggle:r,onPreview:a,onRestore:g,onRestorePage:b,onName:y}){const i=t.kind==="draft_before_restore",l=!t.live,f=t.changes.length,c=[...i?[]:[{key:"preview",label:n("Preview"),icon:e(Y,{}),onSelect:a}],...l?[{key:"restore",label:i?n("Put these drafts back"):n("Restore whole website"),icon:e(A,{}),onSelect:g}]:[],...l&&!i&&t.pages.length?[{key:"restore-page",label:n("Restore one page only"),icon:e(j,{}),onSelect:b}]:[],...i?[]:[{type:"divider",key:"divider"},{key:"name",label:n("Name this version"),icon:e(ae,{}),onSelect:y}]];return e(re,{title:u("span",{className:"sf-version-title",children:[e("span",{children:ye(t)}),t.live?e(z,{tone:"success",size:"xs",children:n("Live")}):null,t.name?e(z,{tone:"neutral",size:"xs",children:n("Version {n}",{n:t.number})}):null,i?e(z,{tone:"warning",size:"xs",children:n("Not published")}):null]}),expanded:o,onToggle:r,actions:e(ee,{align:"end","aria-label":n("More"),items:c,triggerClassName:ne({variant:"ghost",size:"sm"}),trigger:e(le,{})}),below:u(P,{gap:3,children:[u(F,{gap:2,align:"center",wrap:!0,className:"sf-version-meta",children:[e(Z,{name:t.createdBy,size:"xs"}),e("span",{children:t.createdBy}),e("span",{"aria-hidden":"true",children:"·"}),e("span",{children:we(t.createdAt)}),f?u(N,{children:[e("span",{"aria-hidden":"true",children:"·"}),e("span",{children:G("{n} change","{n} changes",f)})]}):null]}),o?u(P,{gap:3,children:[f?e(P,{gap:2,children:t.changes.map(d=>{const v=be[d.kind]??ce;return u(F,{gap:2,align:"center",children:[e(v,{size:16}),e("span",{children:ue(d)})]},`${d.kind}:${d.id}`)})}):null,u(F,{gap:2,children:[i?null:e(k,{variant:"secondary",size:"sm",leftIcon:e(Y,{}),onClick:a,children:n("Preview")}),l?e(k,{variant:"secondary",size:"sm",leftIcon:e(A,{}),onClick:g,children:n("Restore")}):null]})]}):null]})})}function Pe({open:t,onClose:o,access:r,waiting:a}){const{flushSave:g,reloadFromServer:b,docId:y}=M(),[i,l]=p(null),[f,c]=p(!1),[d,v]=p(null),[m,h]=p(null),[C,B]=p(!1),[O,I]=p(null),[L,T]=p(null),[$,V]=p(!1),x=Q(0),R=q(()=>{const s=++x.current;c(!1),r.list().then(w=>{s===x.current&&l(w)},()=>{s===x.current&&c(!0)})},[r]);J(()=>{t&&R()},[t,R]);const K=s=>{V(!1),ke(r,s.id).catch(()=>V(!0))},U=async()=>{if(!(!m||C)){B(!0),I(null);try{await fe({access:r,version:m.version,page:m.page,flushSave:g,reload:b}),h(null),o()}catch(s){I(s instanceof pe?n("Your last changes did not save, so nothing was restored. Try again."):n("The version was not restored. Nothing changed. Try again."))}finally{B(!1)}}},_=X({onPress:()=>{U()},busy:C});return u(N,{children:[e(E,{open:t,onClose:o,size:"xl",title:n("Version history"),description:u(N,{children:[n("Every Publish keeps a copy of the whole website: pages, menus and site styles.")," ",n("Products, prices and forms always show as they are now.")]}),footer:e("span",{className:"sf-version-foot",children:n("The newest 30 are kept. Named versions are always kept.")}),children:u(P,{gap:3,children:[$?e(S,{tone:"danger",onDismiss:()=>V(!1),children:n("The preview did not open. Try again.")}):null,f?e(S,{tone:"danger",action:e(k,{variant:"secondary",size:"sm",onClick:R,children:n("Try again")}),children:n("Version history did not load.")}):i===null?e("p",{className:"sf-version-foot",children:n("Loading versions")}):i.length===0?e("p",{className:"sf-version-foot",children:n("No versions yet. Every Publish from now on keeps one.")}):e(se,{"aria-label":n("Versions"),spacing:"comfortable",children:i.map(s=>e(Se,{version:s,expanded:d===s.id,onToggle:()=>v(w=>w===s.id?null:s.id),onPreview:()=>K(s),onRestore:()=>{I(null),h({version:s,page:null})},onRestorePage:()=>{I(null),h({version:s,page:ve(s,y)})},onName:()=>T(s)},s.id))})]})}),e(Ce,{version:m?.version??null,page:m?.page??null,waiting:a,busy:_.busy===!0,error:O,onCancel:()=>h(null),onConfirm:_.onPress,onPage:s=>h(w=>w&&{...w,page:w.version.pages.find(W=>W.id===s)??w.page})}),e(Ne,{version:L,onCancel:()=>T(null),onSave:async s=>{await r.name(L.id,s),T(null),R()}})]})}function Le(){const{adapter:t,hasUnsavedEdits:o}=M(),r=t.siteVersions,a=me(),g=de();return r?e(Pe,{open:a,onClose:he,access:r,waiting:o||g?.state==="changed"}):null}export{Ce as RestoreVersionDialog,Le as VersionHistory,Pe as VersionHistoryDrawer};
|
|
@@ -4080,7 +4080,7 @@ input.sf-list-marking {
|
|
|
4080
4080
|
/* Version history (components/VersionHistoryDrawer, 33.0.0): a row's name
|
|
4081
4081
|
beside its badges, and the drawer's quiet lines (who, when, how much; the
|
|
4082
4082
|
retention line; loading and empty). Layout and ink only; every part is the
|
|
4083
|
-
shell's (
|
|
4083
|
+
shell's (Dialog, ListRow, ColoredBadge, Avatar). */
|
|
4084
4084
|
.sf-version-title {
|
|
4085
4085
|
display: inline-flex;
|
|
4086
4086
|
flex-wrap: wrap;
|